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QACzBiB,EAAAA,cAAC8C,EAAAA,EAAgB,CACf/E,KAAMiB,EAAaD,MAAM,GACzBoC,KAAiC,QAA7BrD,EAAEU,EAAmBO,MAAM,UAAE,IAAAjB,OAAA,EAA3BA,EAA6BqB,aAIlC,C,wBC/Jb,IAXER,IAAkE,CAElES,mBAAoBT,EAASoE,MAC3BrF,IAAA,IAAC,SAAEyB,GAAUzB,EAAA,MAAkB,sBAAbyB,CAAgC,IAEpDE,mBAAoBV,EAASoE,MAC3BC,IAAA,IAAC,SAAE7D,GAAU6D,EAAA,MAAkB,sBAAb7D,CAAgC,IAEpDG,QAASX,EAASoE,MAAKE,IAAA,IAAC,SAAE9D,GAAU8D,EAAA,MAAkB,YAAb9D,CAAsB,K","sources":["webpack://@unum/unum-co-uk/./src/templates/page.tsx","webpack://@unum/unum-co-uk/./src/utils/page-config.ts"],"sourcesContent":["import React from \"react\";\r\nimport { graphql } from \"gatsby\";\r\nimport ReactMarkdown from \"react-markdown\";\r\nimport Button, { Rank } from \"@unum/button\";\r\nimport Heading from \"@unum/heading\";\r\nimport Hero from \"@unum/hero\";\r\nimport Section from \"@unum/section\";\r\nimport TableOfContents from \"@unum/table-of-contents\";\r\nimport LozengeNav from \"@unum/lozenge-nav\";\r\nimport { GetPageQuery } from \"../../graphql-types\";\r\nimport FeaturedAsset from \"../components/FeaturedAsset\";\r\nimport Layout, { Location } from \"../components/Layout\";\r\nimport { getClickableAction } from \"../components/Link\";\r\nimport PreFooterSection from \"../components/PreFooterSection\";\r\nimport RichText from \"../components/RichText\";\r\nimport Sections from \"../components/Sections\";\r\nimport renderSpotlightContent from \"../utils/render-spotlight-content\";\r\nimport { ShareImages } from \"../utils/meta-open-graph\";\r\nimport pageConfig from \"../utils/page-config\";\r\nimport { BreadcrumbItem } from \"@unum/breadcrumb\";\r\n\r\ntype Props = {\r\n data: GetPageQuery;\r\n location: Location;\r\n pageContext: {\r\n id: string;\r\n breadcrumbItems: BreadcrumbItem[];\r\n };\r\n};\r\n\r\nconst heroTypeToLayout: Record<\r\n GetPageQuery[\"page\"][\"elements\"][\"hero_type\"][\"value\"][0][\"codename\"],\r\n | \"no-hero\"\r\n | \"curve\"\r\n | \"two-column\"\r\n | \"two-column-asset\"\r\n | \"campaign-left\"\r\n | \"campaign-right\"\r\n> = {\r\n curve: \"curve\",\r\n two_column: \"two-column\",\r\n two_column_asset: \"two-column-asset\",\r\n no_hero: \"no-hero\",\r\n no_image: \"two-column-asset\",\r\n campaign_left: \"campaign-left\",\r\n campaign_right: \"campaign-right\"\r\n};\r\n\r\nconst heroLayoutToButtonRankMap: Record<\r\n | \"curve\"\r\n | \"two-column\"\r\n | \"two-column-asset\"\r\n | \"campaign-left\"\r\n | \"campaign-right\",\r\n Rank\r\n> = {\r\n curve: \"tertiary\",\r\n \"two-column\": \"secondary\",\r\n \"two-column-asset\": \"secondary\",\r\n \"campaign-left\": \"primary\",\r\n \"campaign-right\": \"primary\"\r\n};\r\n\r\nconst Page = ({ data, location, pageContext }: Props) => {\r\n const {\r\n title,\r\n subtitle,\r\n hero_type,\r\n ctas,\r\n sections,\r\n branch,\r\n pre_footer_content,\r\n footer_text,\r\n metadata_description,\r\n settings\r\n } = data.page.elements;\r\n const featured_asset = data.page.elements.featured_asset.value[0];\r\n const { help_section } = data.site?.elements || {};\r\n const heroLayout =\r\n heroTypeToLayout[hero_type.value[0]?.codename] || \"two-column-asset\";\r\n\r\n const { isStandaloneHeader, isStandaloneFooter, noIndex } = pageConfig(\r\n settings.value\r\n );\r\n\r\n const shareImages = {\r\n featured: featured_asset.elements as ShareImages[\"featured\"],\r\n meta: data.page.elements.social_sharing_images.value as ShareImages[\"meta\"]\r\n };\r\n\r\n const hasHero = heroLayout !== \"no-hero\";\r\n const ContentWrapper = hasHero ? Heading.Content : React.Fragment;\r\n\r\n const { breadcrumbItems } = pageContext;\r\n\r\n return (\r\n \r\n {hasHero && (\r\n \r\n {title.value}\r\n ,\r\n \"title\"\r\n )}\r\n asset={\r\n hero_type.value[0]?.codename !== \"no_image\" && (\r\n \r\n )\r\n }\r\n layout={heroLayout}\r\n ctas={ctas?.value.map((cta, index) => {\r\n return (\r\n \r\n {/* @ts-expect-error As per other examples throughout codebase */}\r\n {cta.elements.label.value}\r\n \r\n );\r\n })}\r\n >\r\n {renderSpotlightContent(, \"subtitle\")}\r\n \r\n )}\r\n\r\n \r\n \r\n \r\n {(headings) => {\r\n if (headings.length > 1) {\r\n return (\r\n
\r\n ({\r\n ariaLabel: heading.title,\r\n action: { model: \"htmlLink\", href: `#${heading.id}` },\r\n active: false\r\n }))}\r\n />\r\n
\r\n );\r\n }\r\n }}\r\n
\r\n \r\n \r\n
\r\n
\r\n \r\n );\r\n};\r\n\r\nexport default Page;\r\n\r\nexport const query = graphql`\r\n query getPage($id: String!) {\r\n page: kontentItemPage(id: { eq: $id }) {\r\n id\r\n system {\r\n id\r\n }\r\n elements {\r\n title {\r\n value\r\n }\r\n featured_asset {\r\n value {\r\n ...ExternalVideoFragment\r\n ...ImageFragment\r\n }\r\n }\r\n subtitle {\r\n ...RichTextFragment\r\n }\r\n ctas {\r\n value {\r\n id\r\n ...LinkFragment\r\n }\r\n }\r\n hero_type {\r\n value {\r\n name\r\n codename\r\n }\r\n }\r\n sections {\r\n value {\r\n ...SectionsFragment\r\n }\r\n }\r\n branch {\r\n value {\r\n ...BranchFragment\r\n }\r\n }\r\n pre_footer_content {\r\n value {\r\n codename\r\n }\r\n }\r\n footer_text {\r\n value\r\n }\r\n meta_override_title {\r\n value\r\n }\r\n metadata_description {\r\n value\r\n }\r\n social_sharing_images {\r\n value {\r\n ... on kontent_item_asset {\r\n elements {\r\n image {\r\n value {\r\n type\r\n url\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n settings {\r\n value {\r\n codename\r\n }\r\n }\r\n }\r\n }\r\n site: kontentItemSite {\r\n elements {\r\n help_section {\r\n value {\r\n ...TitleWithContentFragment\r\n }\r\n }\r\n }\r\n }\r\n }\r\n`;\r\n","import { Kontent_Item_Multiple_Choice_Element } from \"../../graphql-types\";\r\n\r\nexport const pageConfig = (\r\n settings: Pick[]\r\n) => ({\r\n isStandaloneHeader: settings.some(\r\n ({ codename }) => codename === \"standalone_header\"\r\n ),\r\n isStandaloneFooter: settings.some(\r\n ({ codename }) => codename === \"standalone_footer\"\r\n ),\r\n noIndex: settings.some(({ codename }) => codename === \"noindex\")\r\n});\r\n\r\nexport default pageConfig;\r\n"],"names":["heroTypeToLayout","curve","two_column","two_column_asset","no_hero","no_image","campaign_left","campaign_right","heroLayoutToButtonRankMap","_ref","_data$site","_hero_type$value$","_hero_type$value$2","_pre_footer_content$v","data","location","pageContext","title","subtitle","hero_type","ctas","sections","branch","pre_footer_content","footer_text","metadata_description","settings","page","elements","featured_asset","value","help_section","site","heroLayout","codename","isStandaloneHeader","isStandaloneFooter","noIndex","pageConfig","shareImages","featured","meta","social_sharing_images","hasHero","ContentWrapper","Heading","Content","React","breadcrumbItems","Layout","metaTitle","meta_override_title","description","footerText","system","id","hasNoIndex","breadCrumbItems","Hero","renderSpotlightContent","ReactMarkdown","disallowedElements","unwrapDisallowed","asset","FeaturedAsset","showPreview","type","layout","map","cta","index","Button","key","action","getClickableAction","rank","theme","label","RichText","TableOfContents","Menu","headings","length","Section","spacing","LozengeNav","links","heading","ariaLabel","model","href","active","Sections","PreFooterSection","some","_ref2","_ref3"],"sourceRoot":""}