(window.__LOADABLE_LOADED_CHUNKS__=window.__LOADABLE_LOADED_CHUNKS__||[]).push([[156,10],{397:function(e,t,a){"use strict";a.r(t),a.d(t,"TabbedMenu",(function(){return z}));var n=a(0),o=a.n(n),i=a(13),r=a.n(i),c=a(676),s=a(210),l=a(7),d=a(283),u=a(24),b=a(705);var p=a(28),m=a(288),f=a(20);function h(e){void 0===e&&(e=0);const t=Object(n.useRef)(new Set),[a,o]=Object(n.useState)(0),i=Object(n.useMemo)(()=>Object(f.a)()?new m.a(()=>{o(Array.from(t.current).reduce((e,t)=>e+t.clientHeight,0))},!0):null,[]);Object(n.useEffect)(()=>()=>null==i?void 0:i.disconnect(),[i]);return{ref:Object(n.useCallback)(e=>{if(e===document.body||!i)return;t.current.clear();let a=e;for(;a;){const e=a.previousElementSibling;if(null===e)a=a.parentElement;else{a=e;"sticky"===window.getComputedStyle(a).position&&(i.observe(e),t.current.add(e))}}},[i]),height:a+e}}var g=a(284);var O=a(2),v=a(1),j=a(17),y=a(205),w=a(21),x=a(27);const k=Object(w.b)("tabbed-menu-button",[{name:null,modifiers:["tabs","selected","stickied"]},"title","icon","text","subtitle"]);var E=O.d.button.withConfig({componentId:"sc-1sog78l-0"})(["@media print{&.","{position:static !important;}.","{display:none !important;}}&.","{"," position:sticky;width:calc(100% + 32px);margin-left:-16px;background-color:",";padding:16px;color:",";fill:",";@media (hover:hover){&:not(.","):hover{color:var(--selected-tab-button-colour,",");fill:var(--selected-tab-button-colour,",");}:focus-visible{",";position:sticky;color:inherit;}}}&.","{background-color:var(--selected-tab-button-colour,",");color:var(--selected-tab-button-text-colour,",");fill:var(--selected-tab-button-text-colour,",");&.","{z-index:1;box-shadow:0px 3px 6px #00000029;}.","{transform:rotate(-180deg);}}.","{display:flex;align-items:center;justify-content:space-between;}.","{margin-top:0;font-size:18px;font-weight:",";line-height:22px;color:inherit;}.","{width:16px;height:16px;transition:transform 0.25s ease-out;flex-shrink:0;@media (prefers-reduced-motion){transition:none;}}.","{display:block;font-size:16px;line-height:24px;margin-top:8px;}@media not print{&.","{box-shadow:initial;position:static;margin-left:0;width:100%;&:not(:first-child){margin-top:2px;}&.",".","{box-shadow:none;}.","{transform:rotate(-90deg);}}}"],k.className,k.icon,k.className,Object(y.a)(),e=>{let{theme:t}=e;return t.altBackgroundColor},v.a.charcoal,v.a.charcoal,k.blockModifiers.selected,v.a.red,v.a.red,Object(x.c)(),k.blockModifiers.selected,v.a.red,v.a.white,v.a.white,k.blockModifiers.stickied,k.icon,k.title,k.text,j.a.SemiBold,k.icon,k.subtitle,k.blockModifiers.tabs,k.blockModifiers.selected,k.blockModifiers.stickied,k.icon),S=a(4);const N=["onClick","onKeyDown","isSelected","label","subtitle","canBeSticky","isTabStyle"];function A(){return(A=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0||(o[a]=e[a]);return o}(e,N);const{height:m,isStickied:f,ref:O}=function(e,t){void 0===e&&(e=!0),void 0===t&&(t=!0);const{ref:a,height:o}=h(),{observeElement:i,isStickied:r}=Object(g.a)(e?-o-1:0);return{ref:Object(n.useCallback)(n=>{t&&i(n),e&&a(n)},[t,i,e,a]),height:e?o:void 0,isStickied:t?r:void 0}}();return o.a.createElement(E,A({},b,{className:r()(k.className,{[k.blockModifiers.tabs]:u,[k.blockModifiers.selected]:c,[k.blockModifiers.stickied]:d&&f}),onClick:a,onKeyDown:i,style:d?{top:m+"px"}:void 0,ref:e=>{e&&(t&&("function"==typeof t?t(e):t.current=e),O(e))}}),o.a.createElement("div",{className:k.title},o.a.createElement("h3",{className:k.text},s),o.a.createElement(p.b,{iconId:p.a.ChevronDown,className:k.icon,ariaHidden:!0})),Object(S.a)(l)&&o.a.createElement("span",{className:k.subtitle},l))}));var T=a(115),C=a(271),B=a(158);function L(e){let{tab:t}=e;return"content"in t?o.a.createElement(o.a.Fragment,null,t.content):"composer"in t&&Object(l.a)(t.composer)?o.a.createElement(C.b,{composer:t.composer,doNotUseContainers:!0,preventAutomaticThemeChanges:!0,useParentTheme:!0,ignoreBackgroundSettings:!0,isNested:!0}):"markup"in t&&Object(S.a)(t.markup)?o.a.createElement(B.default,{content:t.markup}):u.a}var M=a(688),R=a(665);function P(){return(P=Object.assign?Object.assign.bind():function(e){for(var t=1;tt.flatMap(e=>e.tabs.map(t=>Object.assign({},t,{id:t.hash,group:e.label}))),[t]),{tabListProps:u,tabs:b}=Object(M.a)(d,{orientation:R.a.VERTICAL,selectedTabIndex:a,onSelectedTabIndexChanged:e=>i(e),useProvidedTabIds:l}),{ref:p,height:m}=h(16);return o.a.createElement("div",{className:r()(c.a.list.className,c.a.list.tabs)},o.a.createElement("div",P({},u,{ref:p,style:s?{top:m+"px"}:void 0,className:r()(c.a.buttons.className,{[c.a.buttons["no-sticky"]]:!s})}),b.map((e,t,a)=>o.a.createElement(o.a.Fragment,{key:e.label},(0===t||e.group!==a[t-1].group)&&Object(S.a)(e.group)&&o.a.createElement("span",{className:c.a["group-name"]},e.group),o.a.createElement(I,P({},e.tabProps,{label:e.label,subtitle:e.subtitle,isSelected:e.isSelected,canBeSticky:!1,isTabStyle:!0}))))),o.a.createElement("div",{className:c.a.panels},b.map(e=>o.a.createElement("div",{key:e.panelProps.key,"aria-hidden":e.panelProps["aria-hidden"],"aria-labelledby":e.panelProps["aria-labelledby"],id:e.panelProps.id,role:e.panelProps.role,className:r()(c.a.panel.className,{[c.a.panel.hidden]:!e.isSelected})},o.a.createElement(T.b,{isInteracting:e.isSelected},o.a.createElement(L,{tab:e}))))))}var H=a(114);function _(e){let{groups:t,selectedIndex:a,selectIndex:i,canButtonsBeSticky:s=!0,useTabHashAsButtonIds:l}=e;const u=Object(n.useRef)([]),b=Object(n.useRef)([]),p="tabbed-menu-"+Object(H.a)(),m=(e,a)=>{const n=Object(R.b)(e,a.key,t.length,R.a.VERTICAL,-1);n>=0&&b.current[n]&&(b.current[n].focus(),a.preventDefault(),a.stopPropagation())},f=e=>{i(e),e!==a&&requestAnimationFrame(()=>{const t=u.current[e];t&&window.scrollTo({top:t.getBoundingClientRect().top-document.body.getBoundingClientRect().top-Object(d.a)(t)})})};return o.a.createElement("div",{className:r()(c.a.list.className,c.a.list.accordion)},t.map((e,t)=>{var n;return o.a.createElement(o.a.Fragment,{key:null!=(n=e.label)?n:t},Object(S.a)(e.label)&&o.a.createElement("span",{className:c.a["group-name"]},e.label),e.tabs.map(e=>{const t=e.flatIndex,n=t===a,i=l&&Object(S.a)(e.hash)?e.hash:`${p}-${t}-button`,d=`${p}-${t}-panel`;return o.a.createElement("div",{key:e.label,ref:e=>e&&(u.current[t]=e),className:c.a["list-item"]},o.a.createElement(I,{label:e.label,subtitle:e.subtitle,onClick:f.bind(null,t),onKeyDown:m.bind(null,t),isSelected:n,"aria-expanded":n,"aria-controls":d,ref:e=>e&&(b.current[t]=e),id:i,canBeSticky:s,isTabStyle:!1}),o.a.createElement(T.b,{isInteracting:n},o.a.createElement("div",{role:"region","aria-hidden":!n,"aria-labelledby":i,id:d,className:r()(c.a.panel.className,{[c.a.panel.hidden]:!n})},o.a.createElement(L,{tab:e}))))}))}))}var K=a(22),F=a(41);function z(e){let{className:t,groups:a=[],forceAccordionLayout:i=!1,canAccordionButtonsBeSticky:p=!0,canTabsButtonsBeSticky:m=!0,onSelectTab:f,containerElementRef:h,topScrollMargin:g=0,firstOptionStartsOpen:O=!1,title:v,description:j}=e;const y=Object(b.a)("print"),w=Object(s.a)(c.c,!0)&&!i&&!y,x=Object(n.useRef)(null),[k,E]=Object(n.useState)(w||O?0:-1),N=e=>{E(t=>{(w||e===t)&&requestAnimationFrame(()=>{var e;const t=null!=(e=null==h?void 0:h.current)?e:x.current;t&&document.contains(t)&&window.scrollTo({top:t.getBoundingClientRect().top-document.body.getBoundingClientRect().top-(null!=g?g:0)-Object(d.a)(t,!0)})}),!f||e===t&&w||f(e,t,w?K.b.CLICK:e!==t?K.b.EXPAND:K.b.COLLAPSE);for(const t of T)for(const a of t.tabs)if(a.flatIndex===e){Object(S.a)(a.hash)&&"#"+a.hash!==window.location.hash&&window.history.pushState(!0,"","#"+a.hash);break}return e!==t||w?e:-1})},A=w?D:_,I=w?m:p,T=Object(n.useMemo)(()=>{if(!Object(l.a)(a))return[];let e=0;return a.map(t=>Object.assign({},t,{tabs:t.tabs.map(t=>Object.assign({},t,{flatIndex:e++}))}))},[a]),{hash:C}=Object(F.h)();return Object(n.useEffect)(()=>{if(!Object(S.a)(C))return void E(w||O?0:-1);const e=C.slice(1);if(Object(S.a)(e))for(const t of T)for(const a of t.tabs)a.hash===e&&N(a.flatIndex)},[C]),Object(l.a)(T)?o.a.createElement(c.b,{className:r()(t,c.a.className),ref:x},(Object(S.a)(v)||Object(S.a)(j))&&o.a.createElement("div",{className:c.a.header},Object(S.a)(v)&&o.a.createElement("h2",{className:c.a.title},v),Object(S.a)(j)&&o.a.createElement(B.default,{content:j,className:c.a.description})),o.a.createElement(A,{groups:T,selectedIndex:k,selectIndex:N,canButtonsBeSticky:I,useTabHashAsButtonIds:!1})):u.a}},665:function(e,t,a){"use strict";a.d(t,"a",(function(){return o})),a.d(t,"b",(function(){return i}));var n=a(672);const o={HORIZONTAL:"horizontal",VERTICAL:"vertical"};function i(e,t,a,i,r){const c=i===o.VERTICAL?n.a.ArrowDown:n.a.ArrowRight;switch(t){case i===o.VERTICAL?n.a.ArrowUp:n.a.ArrowLeft:return(e+a-1)%a;case c:return(e+1)%a;case n.a.Home:return 0;case n.a.End:return Math.max(a-1,0);default:return"number"==typeof r?r:e}}},672:function(e,t,a){"use strict";a.d(t,"a",(function(){return n}));const n={ArrowLeft:"ArrowLeft",ArrowRight:"ArrowRight",ArrowUp:"ArrowUp",ArrowDown:"ArrowDown",Home:"Home",End:"End",Tab:"Tab"}},676:function(e,t,a){"use strict";a.d(t,"a",(function(){return l})),a.d(t,"c",(function(){return d}));var n=a(2),o=a(1),i=a(17),r=a(21),c=a(15),s=a(10);const l=Object(r.b)("tabbed-menu",["header","title","description","group-name",{name:"buttons",modifiers:["no-sticky"]},"panels",{name:"panel",modifiers:["hidden"]},{name:"list",modifiers:["accordion","tabs"]},"list-item"]),d=c.a.medium,u=n.d.div.withConfig({componentId:"sc-9u15u3-0"})(["&.","{position:relative;}@media print{.","{height:unset !important;}}.","{margin-bottom:24px;}.","{margin-top:0;}."," + .","{margin-top:24px;}"," .","{font-weight:",";font-size:24px;line-height:29px;display:inline-block;margin-bottom:16px;&:not(:first-child){margin-top:25px;}}.","{display:flex;flex-direction:column;}.","{&:not(:first-child){margin-top:2px;}}.","{padding:24px 0;color:",";position:relative;}.","{height:0;padding:0;overflow:hidden;}@media not print{.","{&.","{display:grid;grid-template-columns:1fr 1fr 1fr;position:relative;}.","{grid-column:1 / 2;position:sticky;top:0;grid-row:1 / 2;}.","{font-size:26px;line-height:32px;&:not(:first-child){margin-top:36px;}}.","{position:static;top:unset;}.","{grid-column:2 / 4;grid-row:1 / 3;margin-left:62px;}.","{padding:0;}}}"],l.className,l.panel.hidden,l.header,l.title,l.title,l.description,Object(s.a)(d,Object(n.c)([".","{margin-bottom:40px;}."," + .","{margin-top:40px;}"],l.header,l.title,l.description)),l["group-name"],i.a.Bold,l.list.className,l["list-item"],l.panel.className,o.a.charcoal,l.panel.hidden,l.list.tabs,l.list.className,l.buttons.className,l["group-name"],l.buttons["no-sticky"],l.panels,l.panel.className);t.b=u},688:function(e,t,a){"use strict";a.d(t,"a",(function(){return h}));var n=a(0),o=a(7),i=a(114),r=a(54),c=a(185),s=a(672),l=a(184),d=a(665),u=a(4);const b=Symbol("tabs-programmatic-event"),p="tablist",m="tab",f="tabpanel";function h(e,t){let{onSelectedTabIndexChanged:a=r.a,orientation:h=d.a.HORIZONTAL,automaticActivation:g=!1,selectedTabIndex:O,useProvidedTabIds:v=!1}=void 0===t?{}:t;const j=Object(i.a)(),[y,w]=Object(n.useState)(0),x=Object(n.useRef)(0),k=Object(n.useRef)([]);Object(n.useEffect)(()=>{void 0!==O&&(w(O),x.current=O)},[O]);const E=Object(n.useCallback)((t,n)=>{w(o=>{if(t===o)return o;const i=Object(l.a)(t,0,e.length-1);return x.current=i,n!==b&&"function"==typeof a&&a(i,n,e),i})},[a,e]),S=Object(n.useCallback)(t=>{var a;if(!Object(o.a)(e))return;if(t.key===s.a.Tab)return void(x.current=y);const n=Object(d.b)(x.current,t.key,e.length,h);n!==x.current&&(x.current=n,null==(a=k.current[n])||a.focus(),g&&E(n,t),t.preventDefault(),t.stopPropagation())},[e,E,h,g,y]),N=Object(n.useMemo)(()=>Object(o.a)(e)?e.map((e,t)=>{const a=`${j}-${t}`,n="tabPanel-"+a,o=v&&Object(u.a)(null==e?void 0:e.id)?null==e?void 0:e.id:"tab-"+a,i=t===y;return Object.assign({},e,{isSelected:i,tabProps:{key:t,ref:e=>k.current[t]=null!=e?e:k.current[t],id:o,onKeyDown:S,onClick:e=>E(t,e),"aria-controls":n,"aria-selected":i,role:m,tabIndex:i?c.a.TabAndFocusable:c.a.NoKeyboardButFocusable},panelProps:{"aria-hidden":!i,"aria-labelledby":o,key:t,id:n,role:f,tabIndex:i?c.a.TabAndFocusable:c.a.DefaultBehaviour}})}):[],[e,S,E,j,y,v]);return Object(n.useMemo)(()=>({tabListProps:{role:p,"aria-owns":N.map(e=>{let{tabProps:{id:t}}=e;return t}).join(" ")},selectedIndex:y,setSelectedIndex:e=>E(e,b),selectedTab:N[y],tabs:N}),[N,y,E])}},705:function(e,t,a){"use strict";a.d(t,"a",(function(){return i}));var n=a(0),o=a(20);function i(e){const[t,a]=Object(n.useState)(!1);return Object(n.useEffect)(()=>{if(!Object(o.a)())return;const t=function(e){if("function"==typeof window.matchMedia)return window.matchMedia(e);if("function"==typeof window.msMatchMedia)return window.msMatchMedia(e);return null}(e);if(null===t)return;a(t.matches);const n=e=>{a(e.matches)},i="function"==typeof t.addEventListener,r="function"==typeof t.addListener;return i?t.addEventListener("change",n):r&&t.addListener(n),()=>{i?t.removeEventListener("change",n):r&&t.removeListener(n)}},[e]),t}}}]); //# sourceMappingURL=tabbedMenu.cc.8ef28596c119422bb3c4.mjs.map