import{u as rn,C as on,D as an,d as cn,a as dn,b as ve,c as ln,S as sn,s as un,K as gn,P as fn,e as mn,E as X}from"./utilities.esm-DpQ0TZP_.js";import{u as D,h as S,N as Sn,K as Z,O as bn}from"./OdysseyThemeProvider-Bh0Bu-2o.js";import{r as a}from"./index-NdkWRN8K.js";import{f as hn,i as pn}from"./Typography-Cz6D417Y.js";import{u as N}from"./UiShellProvider-BEcD16AU.js";import{u as Be}from"./useMountLifecycleEffect-CjsUCFhB.js";import{U as Ee,T as xn,a as ue,b as In,S as yn}from"./uiShellSharedConstants-DD9UP82e.js";import{u as vn}from"./useUniqueId-Bsgqe1tm.js";import{j as i}from"./jsx-runtime-CnH95YSl.js";import{A as Mn,b as jn,a as wn}from"./AccordionSummary-BjqT0nEb.js";import{M as ie}from"./Box-1mvP3NLW.js";import{M as kn}from"./Link-BDoLypER.js";import{S as J}from"./Skeleton-BPjIT6NG.js";import{M as Bn}from"./Badge-BO7bTIEa.js";import{M as En}from"./Status-BlOUycBm.js";import{L as Ln}from"./Link-DNIf0luC.js";import{M as Dn}from"./ExternalLink-D0l1c5Cz.js";import{M as An}from"./ChevronRight-C12ToI7Y.js";import{M as Tn}from"./MuiPropsContext-DhRylJZk.js";import{M as Hn}from"./Tooltip-CsVWtVfL.js";import{B as Fn}from"./Button-BzIwUmSM.js";/*!
 * Copyright (c) 2024-present, Okta, Inc. and/or its affiliates. All rights reserved.
 * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the "License.")
 *
 * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *
 * See the License for the specific language governing permissions and limitations under the License.
 */const oe=a.createContext({isCompact:!1,isSortable:!1,depth:1}),Le=()=>a.useContext(oe),$n=S("div",{shouldForwardProp:e=>e!=="backgroundColor"&&e!=="fontColor"})(({backgroundColor:e,fontColor:n})=>({width:"100%",".MuiAccordion-root":{backgroundColor:e,color:n||"inherit"}})),Rn=S("span",{shouldForwardProp:e=>e!=="odysseyDesignTokens"&&e!=="isIconVisible"&&e!=="sideNavContrastColors"})(({sideNavContrastColors:e,odysseyDesignTokens:n,isIconVisible:t})=>({width:"100%",marginInlineStart:t?n.Spacing3:0,fontWeight:n.TypographyWeightBody,color:(e==null?void 0:e.fontColor)||n.TypographyColorHeading,".Mui-disabled &":{color:n.TypographyColorDisabled,...(e==null?void 0:e.itemDisabledFontColor)&&{color:e==null?void 0:e.itemDisabledFontColor}}})),Pn=S(wn,{shouldForwardProp:e=>e!=="odysseyDesignTokens"&&e!=="isCompact"&&e!=="isDisabled"&&e!=="sideNavContrastColors"&&e!=="depth"})(({odysseyDesignTokens:e,sideNavContrastColors:n,isCompact:t,isDisabled:r,depth:c=1})=>({borderRadius:e.BorderRadiusMain,paddingBlock:e.Spacing3,paddingInlineStart:`calc(${e.Spacing4} * ${c})`,paddingInlineEnd:e.Spacing4,alignItems:"center",".MuiAccordionSummary-content":{alignItems:"center"},...r&&{opacity:"1 !important",...(n==null?void 0:n.itemDisabledFontColor)&&{svg:{path:{fill:`${n.itemDisabledFontColor} !important`}}}},...!r&&{"&:hover":{backgroundColor:e.HueNeutral50}},...!r&&(n==null?void 0:n.fontColor)&&{svg:{path:{fill:`${n.fontColor} !important`}}},...(n==null?void 0:n.itemHoverBackgroundColor)&&{...!r&&{"&:hover":{backgroundColor:n.itemHoverBackgroundColor}}},"&:focus-visible":{backgroundColor:"unset",outline:"none",boxShadow:`inset 0 0 0 2px ${e.PalettePrimaryMain}`,...(n==null?void 0:n.focusRingColor)&&{boxShadow:`inset 0 0 0 2px ${n.focusRingColor}`}},...t&&{paddingBlock:e.Spacing2,minHeight:"unset"}})),_n=({children:e,label:n,id:t,isCompact:r,isDefaultExpanded:c,isDisabled:o,isExpanded:s,onChange:g,translate:d,startIcon:f})=>{const u=vn(t),x=`${u}-header`,p=`${u}-content`,b=D(),m=N(),I=Le();return i.jsx($n,{backgroundColor:m==null?void 0:m.sideNavBackgroundColor,children:i.jsxs(Mn,{className:"nav-accordion",defaultExpanded:c,disabled:o,disableGutters:!0,expanded:s,onChange:g,children:[i.jsxs(Pn,{"aria-controls":p,className:"nav-accordion-summary",depth:I.depth,expandIcon:i.jsx(Sn,{}),id:x,isCompact:r,isDisabled:o,odysseyDesignTokens:b,sideNavContrastColors:m==null?void 0:m.sideNavContrastColors,children:[f&&f,i.jsx(Rn,{isIconVisible:!!f,odysseyDesignTokens:b,sideNavContrastColors:m==null?void 0:m.sideNavContrastColors,translate:d,children:n})]}),i.jsx(jn,{"aria-labelledby":x,className:"nav-accordion-details",children:e})]})})},De=a.memo(_n);De.displayName="NavAccordion";/*!
 * Copyright (c) 2025-present, Okta, Inc. and/or its affiliates. All rights reserved.
 * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the "License.")
 *
 * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *
 * See the License for the specific language governing permissions and limitations under the License.
 */const Me=e=>{const n=document.documentElement.getAttribute("dir")==="rtl",{top:t,bottom:r,left:c,right:o}=e.getBoundingClientRect();return{top:t,bottom:r,left:n?o:c,right:n?c:o}};/*!
 * Copyright (c) 2025-present, Okta, Inc. and/or its affiliates. All rights reserved.
 * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the "License.")
 *
 * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *
 * See the License for the specific language governing permissions and limitations under the License.
 */const je={isAtContainerInlineStart:null,isAtContainerInlineEnd:null,isAtContainerBlockStart:null,isAtContainerBlockEnd:null};function zn({containerElement:e,element:n,monitoringElement:t}){const[r,c]=a.useState(je),o=a.useRef(0),s=t??(n==null?void 0:n.parentElement),g=a.useCallback(()=>{cancelAnimationFrame(o.current),o.current=requestAnimationFrame(()=>{if(n){const d=Me(n),f=Me(e??document.body);c({isAtContainerInlineStart:d.left===f.left,isAtContainerInlineEnd:d.right===f.right,isAtContainerBlockStart:d.top===f.top,isAtContainerBlockEnd:d.bottom===f.bottom})}else c(je)})},[e,n]);return a.useEffect(()=>{const d=new MutationObserver(()=>{g()});return s&&d.observe(s,{attributes:!0,attributeFilter:["style"],childList:!0,subtree:!0}),window.addEventListener("resize",g),g(),()=>{cancelAnimationFrame(o.current),d.disconnect(),window.removeEventListener("resize",g)}},[s,g]),r}/*!
 * Copyright (c) 2024-present, Okta, Inc. and/or its affiliates. All rights reserved.
 * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the "License.")
 *
 * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *
 * See the License for the specific language governing permissions and limitations under the License.
 */const Vn=S("nav")({display:"flex"}),Nn=S("div",{shouldForwardProp:e=>e!=="odysseyDesignTokens"&&e!=="borderColor"})(({borderColor:e,odysseyDesignTokens:n})=>({"& + &":{marginInlineStart:n.Spacing4,paddingInlineStart:n.Spacing4,borderInlineStart:`1px solid ${e||n.HueNeutral300}`}})),On=({footerItems:e})=>{const n=D(),{t}=Z(),r=N(),c=a.useMemo(()=>e==null?void 0:e.map(o=>{var s;return i.jsx(Nn,{borderColor:(s=r==null?void 0:r.sideNavContrastColors)==null?void 0:s.fontColor,odysseyDesignTokens:n,role:"menuitem",children:o.href?i.jsx(kn,{href:o.href,children:o.label}):i.jsx(ie,{component:"span",children:o.label})},o.id)}),[e,n,r]);return i.jsx(Vn,{"aria-label":t("navigation.footer"),role:"menubar",children:c})},Ae=a.memo(On);Ae.displayName="SideNavFooterContent";/*!
 * Copyright (c) 2024-present, Okta, Inc. and/or its affiliates. All rights reserved.
 * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the "License.")
 *
 * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *
 * See the License for the specific language governing permissions and limitations under the License.
 */const Wn=()=>i.jsxs("svg",{fill:"none",height:"24",viewBox:"0 0 67 24",width:"67",xmlns:"http://www.w3.org/2000/svg",children:[i.jsx("title",{children:"Okta"}),i.jsx("path",{d:"M55.308 20.5716C52.1058 20.5716 49.8418 18.0813 49.8418 14.8145C49.8418 11.5476 52.1058 9.0574 55.308 9.0574C58.5103 9.0574 60.7097 11.5476 60.7097 14.8145C60.7097 18.0813 58.478 20.5716 55.308 20.5716ZM54.7905 24C57.3782 24 59.5777 22.9972 60.9682 20.8947C61.2267 22.9326 62.7147 23.6763 64.5905 23.6763H66.0785V20.4418H65.4317C64.3643 20.4418 64.1058 19.9242 64.1058 18.7276V5.95153H60.6774V8.57159C59.5131 6.72814 57.3136 5.62842 54.7911 5.62842C50.2952 5.62842 46.1554 9.38051 46.1554 14.8139C46.1554 20.2473 50.2947 24 54.7905 24ZM37.1309 19.5688C37.1309 22.4797 38.942 23.6763 41.1092 23.6763H45.2813V20.4418H42.2412C40.9799 20.4418 40.7209 19.9565 40.7209 18.7276V9.18608H45.2813V5.95153H40.7209V0H37.1309V19.5688ZM20.7972 23.6763H24.3872V16.0758H25.5838L31.6969 23.6763H36.225L28.4301 14.0379L34.4139 5.9521H30.371L25.4869 12.7766H24.3872V0.00113398H20.7972V23.6763ZM9.1532 5.62842C4.13983 5.62842 0 9.38051 0 14.8139C0 20.2473 4.13983 23.9994 9.1532 23.9994C14.1666 23.9994 18.3064 20.2473 18.3064 14.8139C18.3064 9.38051 14.1666 5.62842 9.1532 5.62842ZM9.1532 20.5716C5.95096 20.5716 3.68689 18.0813 3.68689 14.8145C3.68689 11.5476 5.95096 9.0574 9.1532 9.0574C12.3554 9.0574 14.6195 11.5476 14.6195 14.8145C14.6195 18.0813 12.3554 20.5716 9.1532 20.5716Z",fill:"black"})]}),Zn=a.memo(Wn);/*!
 * Copyright (c) 2024-present, Okta, Inc. and/or its affiliates. All rights reserved.
 * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the "License.")
 *
 * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *
 * See the License for the specific language governing permissions and limitations under the License.
 */const Gn=S("div",{shouldForwardProp:e=>e!=="isLogoInteractive"})(({isLogoInteractive:e})=>({alignItems:"center",display:"flex",height:"100%",...e&&{cursor:"pointer"}})),Kn=S("a")(()=>({alignItems:"center",display:"flex",height:"100%"})),Un=({imageAltText:e,imageUrl:n,logoComponent:t,...r})=>{const c=a.useMemo(()=>t||(e&&n?i.jsx("img",{alt:e,src:n}):i.jsx(Zn,{})),[e,t,n]);return"href"in r&&"ariaLabel"in r?i.jsx(Kn,{"aria-label":r.ariaLabel,"data-se":"sidenav-header-logo",href:r.href,onClick:r.onClick,children:c}):i.jsx(Gn,{"aria-label":r.ariaLabel,"data-se":"sidenav-header-logo",isLogoInteractive:!!r.onClick||r.href,onClick:r.onClick,role:"presentation",children:c})},Te=a.memo(Un);Te.displayName="SideNavLogo";const Xn=S("div")({position:"relative",display:"flex",flexDirection:"column",zIndex:Ee}),qn=S("div",{shouldForwardProp:e=>e!=="headerBackgroundColor"&&e!=="isSameBackgroundAsMain"&&e!=="odysseyDesignTokens"})(({headerBackgroundColor:e,isSameBackgroundAsMain:n,odysseyDesignTokens:t})=>({display:"flex",alignItems:"center",height:xn,paddingBlock:t.Spacing4,paddingInline:t.Spacing5,backgroundColor:n?e:t.HueNeutralWhite,"svg, img":{maxHeight:"100%",width:"auto",maxWidth:"100%"}})),Yn=S("div",{shouldForwardProp:e=>e!=="odysseyDesignTokens"&&e!=="contrastFontColor"})(({contrastFontColor:e,odysseyDesignTokens:n})=>({display:"flex",justifyContent:"space-between",alignItems:"center",paddingBlock:n.Spacing4,paddingInline:n.Spacing5,width:"100%","& .MuiTypography-root":{margin:0,width:"100%",color:e||"inherit"}})),Jn=({appName:e,isLoading:n,logoProps:t})=>{var o;const r=D(),c=N();return i.jsxs(Xn,{children:[i.jsx(qn,{"data-se":"sidenav-header-logo-container",headerBackgroundColor:c==null?void 0:c.sideNavBackgroundColor,isSameBackgroundAsMain:t==null?void 0:t.isSameBackgroundAsMain,odysseyDesignTokens:r,children:n?i.jsx(J,{height:24,variant:"rounded",width:67}):i.jsx(Te,{...t})}),e&&i.jsx(Yn,{contrastFontColor:(o=c==null?void 0:c.sideNavContrastColors)==null?void 0:o.fontColor,odysseyDesignTokens:r,children:i.jsx(hn,{component:"h2",children:n?i.jsx(J,{}):e})})]})},ae=a.memo(Jn);ae.displayName="SideNavHeader";/*!
 * Copyright (c) 2024-present, Okta, Inc. and/or its affiliates. All rights reserved.
 * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the "License.")
 *
 * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *
 * See the License for the specific language governing permissions and limitations under the License.
 */const Qn=S("div",{shouldForwardProp:e=>e!=="odysseyDesignTokens"&&e!=="isIconVisible"})(({odysseyDesignTokens:e,isIconVisible:n})=>({width:"100%",marginInlineStart:n?e.Spacing3:0,alignItems:"center",display:"flex",fontSize:e.TypographySizeBody,overflowWrap:"anywhere"})),Cn=({count:e,label:n,startIcon:t,endIcon:r,severity:c,statusLabel:o,translate:s})=>{const g=D(),d=a.useMemo(()=>({alignItems:"center",display:"flex",gap:g.Spacing1,marginInlineStart:g.Spacing2}),[g]);return i.jsxs(i.Fragment,{children:[t&&t,i.jsxs(Qn,{isIconVisible:!!t,odysseyDesignTokens:g,translate:s,children:[n,!e&&c&&i.jsx(ie,{sx:d,children:c&&i.jsx(En,{label:o||"",severity:c})}),!c&&e&&i.jsx(ie,{sx:d,children:e&&i.jsx(Bn,{badgeContent:e})})]}),r&&r]})},q=a.memo(Cn);q.displayName="SideNavItemLinkContent";const ce=S("li",{shouldForwardProp:e=>e!=="isSelected"&&e!=="odysseyDesignTokens"&&e!=="sideNavContrastColors"})(({isSelected:e,odysseyDesignTokens:n,sideNavContrastColors:t})=>({display:"flex",alignItems:"center",backgroundColor:"unset",borderRadius:n.BorderRadiusMain,transition:`backgroundColor ${n.TransitionDurationMain}, color ${n.TransitionDurationMain}`,...e&&{color:t!=null&&t.fontColor?`${t.fontColor}`:`${n.TypographyColorAction}`,backgroundColor:(t==null?void 0:t.itemSelectedBackgroundColor)||n.HueBlue50}})),et=e=>{e&&(e==null||e.scrollIntoView({behavior:"instant",block:"center",inline:"nearest"}))},He=({isDisabled:e,isSelected:n,odysseyDesignTokens:t,sideNavContrastColors:r,isActiveDropTarget:c})=>({display:"flex",alignItems:"center",width:"100%",textDecoration:"none",color:r!=null&&r.fontColor?`${r==null?void 0:r.fontColor} !important`:`${t.TypographyColorHeading} !important`,minHeight:"unset",paddingBlock:t.Spacing3,paddingInlineEnd:t.Spacing4,borderRadius:t.BorderRadiusMain,transition:`backgroundColor ${t.TransitionDurationMain}, color ${t.TransitionDurationMain}`,cursor:"pointer",...c&&{backgroundColor:(r==null?void 0:r.itemHoverBackgroundColor)||t.HueNeutral50},"&:hover, li:has(> button:hover, > button:focus, > button:focus-visible) &":{textDecoration:"none",backgroundColor:(r==null?void 0:r.itemHoverBackgroundColor)||t.HueNeutral50,...n&&{backgroundColor:(r==null?void 0:r.itemSelectedBackgroundColor)||t.HueBlue50,color:(r==null?void 0:r.fontColor)||t.TypographyColorAction},...e&&{backgroundColor:"unset"}},...n&&{color:r!=null&&r.fontColor?`${r==null?void 0:r.fontColor} !important`:`${t.TypographyColorAction} !important`,fontWeight:t.TypographyWeightBodyBold},...e&&{cursor:"default",color:`${t.TypographyColorDisabled} !important`,...(r==null?void 0:r.itemDisabledFontColor)&&{color:`${r==null?void 0:r.itemDisabledFontColor} !important`}},"&:focus-visible":{outline:"none",boxShadow:`inset 0 0 0 2px ${(r==null?void 0:r.focusRingColor)||t.PalettePrimaryMain}`}}),Fe=({odysseyDesignTokens:e,contextValue:n,paddingInlineStart:t=e.Spacing6})=>({paddingInlineStart:`calc(${e.Spacing4} * ${n.depth} + ${t})`,...n.depth===1&&{paddingInlineStart:e.Spacing4},...n.isCompact&&{paddingBlock:e.Spacing1}}),we=S("div",{shouldForwardProp:e=>e!=="odysseyDesignTokens"&&e!="contextValue"&&e!=="isDisabled"&&e!=="sideNavContrastColors"&&e!=="isSelected"&&e!=="isActiveDropTarget"})(({isDisabled:e,isSelected:n,contextValue:t,odysseyDesignTokens:r,sideNavContrastColors:c,isActiveDropTarget:o})=>({...He({isDisabled:e,isSelected:n,odysseyDesignTokens:r,sideNavContrastColors:c,isActiveDropTarget:o}),...Fe({odysseyDesignTokens:r,contextValue:t,paddingInlineStart:t.absolutePaddingStart})})),nt=S(Ln,{shouldForwardProp:e=>e!="contextValue"&&e!=="isDisabled"&&e!=="isSelected"&&e!=="odysseyDesignTokens"&&e!=="sideNavContrastColors"&&e!=="isActiveDropTarget"})(({isDisabled:e,isSelected:n,contextValue:t,odysseyDesignTokens:r,sideNavContrastColors:c,isActiveDropTarget:o})=>({...He({isDisabled:e,isSelected:n,odysseyDesignTokens:r,sideNavContrastColors:c,isActiveDropTarget:o}),...Fe({odysseyDesignTokens:r,contextValue:t,paddingInlineStart:t.absolutePaddingStart})})),tt=({count:e,id:n,label:t,href:r,target:c,startIcon:o,severity:s,statusLabel:g,endIcon:d,onClick:f,isDisabled:u,isSelected:x,scrollRef:p,onItemSelected:b,translate:m})=>{const I=N(),P=Le(),F=a.useMemo(()=>P,[P]),A=D(),[L,T]=a.useState(!1),_=a.useRef(null);a.useImperativeHandle(p,()=>({scrollIntoView:()=>{et(_.current)}}),[]);const j=a.useCallback(H=>{b==null||b(n),f==null||f(H)},[n,f,b]),W=a.useCallback(H=>{(H==null?void 0:H.key)==="Enter"&&(H.preventDefault(),b==null||b(n),f==null||f(H))},[n,f,b]);return i.jsx(ce,{"aria-current":x?"page":void 0,"aria-disabled":u,disabled:u,id:n,isSelected:x,odysseyDesignTokens:A,onDragLeave:()=>{T(!1)},onDragOver:()=>{T(!0)},onDrop:()=>{T(!1)},ref:_,sideNavContrastColors:I==null?void 0:I.sideNavContrastColors,children:u?i.jsx(we,{contextValue:F,"data-se":"tb--sidenav-text-container",isActiveDropTarget:!1,isDisabled:u,isSelected:x,odysseyDesignTokens:A,sideNavContrastColors:I==null?void 0:I.sideNavContrastColors,children:i.jsx(q,{count:e,endIcon:d,label:t,severity:s,startIcon:o,statusLabel:g,translate:m})}):r?i.jsxs(nt,{contextValue:F,"data-se":"tb--sidenav-text-container",href:r,isActiveDropTarget:L,isDisabled:u,isSelected:x,odysseyDesignTokens:A,onClick:j,sideNavContrastColors:I==null?void 0:I.sideNavContrastColors,target:c,children:[i.jsx(q,{count:e,endIcon:d,label:t,severity:s,startIcon:o,statusLabel:g,translate:m}),c==="_blank"&&i.jsx("span",{className:"Link-indicator",role:"presentation",children:i.jsx(Dn,{})})]}):i.jsx(we,{contextValue:F,"data-se":"tb--sidenav-text-container",isActiveDropTarget:L,isDisabled:u,isSelected:x,odysseyDesignTokens:A,onClick:j,onKeyDown:W,role:"button",sideNavContrastColors:I==null?void 0:I.sideNavContrastColors,tabIndex:0,children:i.jsx(q,{count:e,endIcon:d,label:t,severity:s,startIcon:o,statusLabel:g,translate:m})})},n)},de=a.memo(tt);de.displayName="SideNavItemContent";/*!
 * Copyright (c) 2024-present, Okta, Inc. and/or its affiliates. All rights reserved.
 * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the "License.")
 *
 * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *
 * See the License for the specific language governing permissions and limitations under the License.
 */const $e=a.createContext({attributes:{},listeners:void 0,ref:a.createRef()}),rt=S("li",{shouldForwardProp:e=>e!=="odysseyDesignTokens"&&e!=="isSelected"&&e!=="sideNavContrastColors"})(({odysseyDesignTokens:e,isSelected:n,sideNavContrastColors:t})=>({position:"relative",button:{top:"50%",left:e.Spacing2,transform:"translateY(-50%)"},svg:{path:{fill:"currentColor",...(t==null?void 0:t.fontColor)&&{fill:t.fontColor}}},"&:has(a:hover, button:hover, a:focus, button:focus, a:focus-visible, button:focus-visible, [role='button']:hover, [role='button']:focus, [role='button']:focus-visible)":{button:{opacity:1,outlineWidth:0}},...n&&{svg:{path:{fill:e.TypographyColorAction,...(t==null?void 0:t.fontColor)&&{fill:t.fontColor}}}}})),it=S("ul")({padding:0,listStyle:"none",listStyleType:"none"}),ot=S("button",{shouldForwardProp:e=>e!=="odysseyDesignTokens"&&e!=="isDragging"&&e!=="focusRingColor"})(({odysseyDesignTokens:e,isDragging:n,focusRingColor:t})=>({position:"absolute",opacity:0,padding:e.Spacing2,border:"none",backgroundColor:"transparent",cursor:`${n?"grabbing":"grab"}`,transition:`opacity ${e.TransitionDurationMain}`,borderRadius:e.BorderRadiusMain,svg:{display:"flex"},"&:focus, &:focus-visible":{outline:"none",boxShadow:`inset 0 0 0 2px ${e.PalettePrimaryMain}`,...t&&{boxShadow:`inset 0 0 0 2px ${t}`}}})),at=({isDragging:e})=>{var g;const{attributes:n,listeners:t,ref:r}=a.useContext($e),c=D(),{t:o}=Z(),s=N();return i.jsx(ot,{...n,...t,"aria-label":o("navigation.drag.handle"),focusRingColor:(g=s==null?void 0:s.sideNavContrastColors)==null?void 0:g.focusRingColor,isDragging:e,odysseyDesignTokens:c,ref:r,children:i.jsx("svg",{fill:"none",height:"16",viewBox:"0 0 16 16",width:"16",xmlns:"http://www.w3.org/2000/svg",children:i.jsx("path",{clipRule:"evenodd",d:"M6 2.33331C6 2.8856 5.55228 3.33331 5 3.33331C4.44772 3.33331 4 2.8856 4 2.33331C4 1.78103 4.44772 1.33331 5 1.33331C5.55228 1.33331 6 1.78103 6 2.33331ZM11 3.33331C11.5523 3.33331 12 2.8856 12 2.33331C12 1.78103 11.5523 1.33331 11 1.33331C10.4477 1.33331 10 1.78103 10 2.33331C10 2.8856 10.4477 3.33331 11 3.33331ZM11 7.11109C11.5523 7.11109 12 6.66338 12 6.11109C12 5.55881 11.5523 5.11109 11 5.11109C10.4477 5.11109 10 5.55881 10 6.11109C10 6.66338 10.4477 7.11109 11 7.11109ZM12 9.88887C12 10.4412 11.5523 10.8889 11 10.8889C10.4477 10.8889 10 10.4412 10 9.88887C10 9.33659 10.4477 8.88887 11 8.88887C11.5523 8.88887 12 9.33659 12 9.88887ZM11 14.6666C11.5523 14.6666 12 14.2189 12 13.6666C12 13.1144 11.5523 12.6666 11 12.6666C10.4477 12.6666 10 13.1144 10 13.6666C10 14.2189 10.4477 14.6666 11 14.6666ZM5 7.11109C5.55228 7.11109 6 6.66338 6 6.11109C6 5.55881 5.55228 5.11109 5 5.11109C4.44772 5.11109 4 5.55881 4 6.11109C4 6.66338 4.44772 7.11109 5 7.11109ZM6 9.88888C6 10.4412 5.55228 10.8889 5 10.8889C4.44772 10.8889 4 10.4412 4 9.88888C4 9.33659 4.44772 8.88888 5 8.88888C5.55228 8.88888 6 9.33659 6 9.88888ZM5 14.6666C5.55228 14.6666 6 14.2189 6 13.6666C6 13.1144 5.55228 12.6666 5 12.6666C4.44772 12.6666 4 13.1144 4 13.6666C4 14.2189 4.44772 14.6666 5 14.6666Z",fill:"#3F59E4",fillRule:"evenodd"})})})},ct=({id:e,isDisabled:n,isSelected:t,isSortable:r=!0,children:c})=>{const{attributes:o,isDragging:s,listeners:g,setNodeRef:d,setActivatorNodeRef:f,transform:u,transition:x}=rn({id:e}),p=a.useMemo(()=>({attributes:o,listeners:g,ref:f}),[o,g,f]),b={opacity:s?.4:void 0,transform:on.Translate.toString(u),transition:x},m=N(),I=D();return i.jsx($e.Provider,{value:p,children:i.jsxs(rt,{isSelected:t,odysseyDesignTokens:I,ref:d,sideNavContrastColors:m==null?void 0:m.sideNavContrastColors,style:b,children:[!n&&r&&i.jsx(at,{isDragging:s}),i.jsx(it,{children:c})]})})};/*!
 * Copyright (c) 2024-present, Okta, Inc. and/or its affiliates. All rights reserved.
 * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the "License.")
 *
 * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *
 * See the License for the specific language governing permissions and limitations under the License.
 */const dt={sideEffects:cn({styles:{active:{opacity:"0.4"}}})};function lt({children:e}){return i.jsx(an,{dropAnimation:dt,children:e})}/*!
 * Copyright (c) 2024-present, Okta, Inc. and/or its affiliates. All rights reserved.
 * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the "License.")
 *
 * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *
 * See the License for the specific language governing permissions and limitations under the License.
 */const le=({parentId:e,items:n,onChange:t,renderItem:r})=>{const[c,o]=a.useState(null),s=a.useMemo(()=>n.find(u=>u.id===(c==null?void 0:c.id)),[c,n]),g=dn(ve(fn),ve(gn,{coordinateGetter:un})),{t:d}=Z(),f=a.useMemo(()=>({onDragStart:({active:u})=>`${d("sortable.list.drag.start",{activeId:u.id})}`,onDragOver:({active:u,over:x})=>x?`${d("sortable.list.drag.moved.over",{activeId:u.id,overId:x.id})}`:`${d("sortable.list.drag.nolonger.over",{activeId:u.id})}`,onDragEnd:({active:u,over:x})=>x?`${d("sortable.list.drag.end.dropped.over",{activeId:u.id,overId:x.id})}`:`${d("sortable.list.drag.end.dropped",{activeId:u.id})}`,onDragCancel:({active:u})=>`${d("sortable.list.drag.cancel",{activeId:u.id})}`}),[d]);return i.jsxs(ln,{accessibility:{announcements:f},onDragCancel:()=>{o(null)},onDragEnd:({active:u,over:x})=>{if(x&&u.id!==(x==null?void 0:x.id)){const p=n.findIndex(({id:m})=>m===u.id),b=n.findIndex(({id:m})=>m===x.id);n[b].isSortable!==!1&&t(e,u.id,p,b)}o(null)},onDragStart:({active:u})=>{o(u)},sensors:g,children:[i.jsx(sn,{items:n,children:n.map(u=>i.jsx(a.Fragment,{children:r(u)},u.id))}),i.jsx(lt,{children:s?r(s):null})]})};le.Item=ct;/*!
 * Copyright (c) 2023-present, Okta, Inc. and/or its affiliates. All rights reserved.
 * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the "License.")
 *
 * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *
 * See the License for the specific language governing permissions and limitations under the License.
 */const st=({items:e,onChange:n,parentId:t,processSideNavItems:r,depth:c=1})=>{const o=a.useMemo(()=>r(e,c),[r,e,c]),s=a.useMemo(()=>o.map(d=>d.sortableItem),[o]),g=a.useCallback(d=>i.jsx(le.Item,{id:d.id,isDisabled:d.isDisabled,isSelected:d.isSelected,isSortable:d.isSortable,children:d.navItem}),[]);return i.jsx(le,{items:s,onChange:n,parentId:t,renderItem:g})},Re=a.memo(st);Re.displayName="SideNavSortableList";const V=24,Y=V/2,ut=S(Fn,{shouldForwardProp:e=>e!=="clickAreaPadding"&&e!=="odysseyDesignTokens"})(({clickAreaPadding:e,odysseyDesignTokens:n})=>({border:0,height:`${V}px`,left:`-${e*2}px`,padding:0,position:"relative",width:`calc(${V}px + (${e}px * 2))`,zIndex:ue,"&&":{backgroundColor:"transparent",borderColor:"transparent",boxShadow:"none",color:n.PalettePrimaryText},"&:focus-visible":{outline:"none"},"&:hover, &:focus-visible":{color:n.HueNeutralWhite},"&::before":{backgroundColor:n.HueNeutralWhite,borderColor:"transparent",borderRadius:"50%",boxShadow:n.ShadowScale1,color:n.PalettePrimaryText,content:"''",height:`${V}px`,left:`${e*2}px`,position:"absolute",top:0,width:`${V}px`},"&:hover::before, &:focus-visible::before":{backgroundColor:n.PalettePrimaryText}})),gt=S(An,{shouldForwardProp:e=>e!=="odysseyDesignTokens"&&e!=="isSideNavCollapsed"})(({isSideNavCollapsed:e,odysseyDesignTokens:n})=>({fontSize:"125%",left:e?void 0:"4px",position:"absolute",right:e?"4px":void 0,top:"3px",transform:e?"rotate(0deg)":"rotate(-180deg)",transitionDuration:n.TransitionDurationMain,transitionProperty:"transform",transitionTimingFunction:"ease-in-out"})),ft=typeof window>"u"?null:document.createElement("button"),mt=({ariaControls:e,clickAreaPadding:n=0,id:t,isSideNavCollapsed:r,onClick:c,onHighlight:o,tabIndex:s})=>{const g=D(),{t:d}=Z(),f=a.useRef(ft);a.useEffect(()=>{var I,P,F,A;const p=()=>{o==null||o(!0)},b=()=>{o==null||o(!1)},m=()=>{var L;o==null||o(!!((L=f.current)!=null&&L.matches(":focus-visible")))};return(I=f.current)==null||I.addEventListener("mouseenter",p),(P=f.current)==null||P.addEventListener("mouseleave",b),(F=f.current)==null||F.addEventListener("focus",m,!0),(A=f.current)==null||A.addEventListener("blur",m,!0),b(),()=>{var L,T,_,j;(L=f.current)==null||L.removeEventListener("mouseenter",p),(T=f.current)==null||T.removeEventListener("mouseleave",b),(_=f.current)==null||_.removeEventListener("focus",m,!0),(j=f.current)==null||j.removeEventListener("blur",m,!0)}},[o]);const u=a.useMemo(()=>d(r?"sidenav.toggle.expand":"sidenav.toggle.collapse"),[r,d]),x=a.useCallback(p=>i.jsx(ut,{...p,"aria-controls":e,"aria-expanded":!r,"aria-label":u,clickAreaPadding:n,"data-se":"sidenav-toggle-button","data-sidenav-toggle":!0,id:t,odysseyDesignTokens:g,onClick:c,ref:b=>{var m;b&&(f.current=b,(m=p.ref)==null||m.call(p,b))},tabIndex:s,variant:"floating",children:i.jsx(gt,{isSideNavCollapsed:r,odysseyDesignTokens:g})}),[e,n,t,r,g,c,s,u]);return i.jsx(Hn,{ariaType:"description",placement:"right",text:u,children:i.jsx(Tn.Consumer,{children:x})})},Pe=a.memo(mt);Pe.displayName="SideNavToggleButton";/*!
 * Copyright (c) 2025-present, Okta, Inc. and/or its affiliates. All rights reserved.
 * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the "License.")
 *
 * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *
 * See the License for the specific language governing permissions and limitations under the License.
 */const St=e=>{const n=window.sessionStorage.getItem(e);try{return typeof n=="string"?JSON.parse(n):null}catch{return typeof n=="string"?n:null}},bt=({initialState:e,key:n})=>{const t=a.useMemo(()=>St(n),[n]),r=a.useCallback(g=>{const d=typeof g>"u"?"":JSON.stringify(g);window.sessionStorage.setItem(n,d)},[n]),[c,o]=a.useState(()=>t??e);a.useEffect(()=>{r(c)},[c,r]);const s=a.useCallback(()=>{o(t??e)},[e,t]);return Be({onUpdate:s}),{sessionState:c,setSessionState:o}};/*!
 * Copyright (c) 2025-present, Okta, Inc. and/or its affiliates. All rights reserved.
 * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the "License.")
 *
 * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *
 * See the License for the specific language governing permissions and limitations under the License.
 */const ht="__uiShell-sideNav-isCollapsed",pt=e=>bt({initialState:e,key:ht}),se=12,xt=2,_e=e=>e.flatMap(n=>n.nestedNavItems?[n,..._e(n.nestedNavItems)]:n),It=S("div",{shouldForwardProp:e=>e!=="odysseyDesignTokens"&&e!=="isSideNavCollapsed"})(({odysseyDesignTokens:e,isSideNavCollapsed:n})=>({position:"relative",display:"grid",gridTemplateColumns:yn,height:"100%",transition:`grid-template-columns ${e.TransitionDurationMain}, opacity 300ms`,transitionTimingFunction:e.TransitionTimingMain,overflow:"hidden",...n&&{gridTemplateColumns:0,opacity:0}})),yt=S("div",{shouldForwardProp:e=>e!=="odysseyDesignTokens"&&e!=="isSideNavCollapsed"})(({odysseyDesignTokens:e,isSideNavCollapsed:n})=>({display:"grid",gridTemplateRows:"max-content 1fr max-content",height:"100%",transition:"opacity 50ms",transitionTimingFunction:e.TransitionTimingMain,overflow:"hidden",...n&&{opacity:0}})),vt=S("nav",{shouldForwardProp:e=>e!=="backgroundColor"&&e!=="hasNeighbouringContentAtInlineStart"&&e!=="isAppContentWhiteBackground"&&e!=="isSideNavCollapsed"&&e!=="isSideNavToggleHighlighted"&&e!=="odysseyDesignTokens"})(({backgroundColor:e,hasNeighbouringContentAtInlineStart:n,isAppContentWhiteBackground:t,isSideNavCollapsed:r,isSideNavToggleHighlighted:c,odysseyDesignTokens:o})=>({backgroundColor:e||o.HueNeutralWhite,height:"100%",position:"relative",width:"fit-content","&::before, &::after":{content:"''",height:"100%",pointerEvents:"none",position:"absolute",right:`-${o.BorderWidthMain}`,top:0,transition:`opacity ${o.TransitionDurationMain}, transform ${o.TransitionDurationMain}, width ${o.TransitionDurationMain}`,userSelect:"none",zIndex:ue},"&::before":{backgroundColor:c?o.BorderColorPrimaryControl:o.HueNeutral100,opacity:t||!r&&c?1:0,width:`calc(${o.BorderWidthMain} * 2)`},"&::after":{backgroundColor:o.HueNeutral200,opacity:r?1:0,transform:r&&!n?c?`translateX(calc(100% - (${o.BorderWidthMain} * 2)))`:`translateX(calc(100% - ${se}px))`:"translateX(0)",width:n?0:`calc(${Y+se}px + ${o.BorderWidthMain} * 2)`,...r&&c?{borderRightColor:o.BorderColorPrimaryControl,borderRightStyle:o.BorderStyleMain,borderRightWidth:`calc(${o.BorderWidthMain} * 2)`}:{}}})),Mt=S("div",{shouldForwardProp:e=>e!=="hasNeighbouringContentAtInlineStart"&&e!=="isSideNavCollapsed"&&e!=="isSideNavToggleHighlighted"&&e!=="odysseyDesignTokens"})(({hasNeighbouringContentAtInlineStart:e,isSideNavCollapsed:n,isSideNavToggleHighlighted:t,odysseyDesignTokens:r})=>({position:"absolute",right:`${Y}px`,top:In,width:`${V}px`,transform:n&&!e?t?`translate3d(calc(100% + ${Y+se}px), 0, 0)`:`translate3d(calc(100% + ${Y+xt}px), 0, 0)`:"translate3d(100%, 0, 0)",transition:`transform ${r.TransitionDurationMain}`,zIndex:ue+1})),jt=S("div",{shouldForwardProp:e=>e!=="borderColor"&&e!=="hasContentScrolled"&&e!=="odysseyDesignTokens"})(({borderColor:e,hasContentScrolled:n,odysseyDesignTokens:t})=>({flexShrink:0,...n&&{borderBottomWidth:t.BorderWidthMain,borderBottomStyle:t.BorderStyleMain,borderBottomColor:t.HueNeutral100,...e&&{borderBottomColor:e.concat("15")}}})),ke=S("ul")(()=>({padding:0,listStyle:"none",listStyleType:"none",margin:0,width:"100%"})),wt=S("div",{shouldForwardProp:e=>e!=="odysseyDesignTokens"&&e!=="hasBlockStartPadding"})(({odysseyDesignTokens:e,hasBlockStartPadding:n})=>({display:"inline-grid",gridTemplateRows:"1fr max-content",overflowY:"auto",paddingBlockStart:n?e.Spacing2:0,paddingInline:e.Spacing2})),kt=S("li",{shouldForwardProp:e=>e!=="odysseyDesignTokens"&&e!=="contrastFontColor"})(({contrastFontColor:e,odysseyDesignTokens:n})=>({color:e||n.HueNeutral600,marginBlock:`${n.Spacing3}`,paddingBlock:n.Spacing1,paddingInline:n.Spacing4})),ze=S("div",{shouldForwardProp:e=>e!=="odysseyDesignTokens"&&e!=="sideNavBackgroundColor"})(({odysseyDesignTokens:e,sideNavBackgroundColor:n})=>({backgroundColor:e.HueNeutralWhite,flexShrink:0,padding:e.Spacing4,...n&&{backgroundColor:n}})),Bt=S(ze,{shouldForwardProp:e=>e!=="isContentScrollable"&&e!=="odysseyDesignTokens"&&e!=="sideNavBackgroundColor"})(({isContentScrollable:e,odysseyDesignTokens:n,sideNavBackgroundColor:t})=>({transitionProperty:"box-shadow",transitionDuration:n.TransitionDurationMain,transitionTiming:n.TransitionTimingMain,zIndex:Ee,...e&&{boxShadow:"0px -8px 8px -8px rgba(39, 39, 39, 0.08)"},...t&&{backgroundColor:t}})),Et=S("div",{shouldForwardProp:e=>e!=="odysseyDesignTokens"&&e!=="sideNavContrastColors"})(({odysseyDesignTokens:e,sideNavContrastColors:n})=>({display:"flex",flexWrap:"wrap",alignItems:"center",fontSize:e.TypographySizeOverline,"a, span":{color:e.HueNeutral600,transition:`color ${e.TransitionDurationMain}`,"&:visited":{color:e.HueNeutral600,...(n==null?void 0:n.fontColor)&&{color:n==null?void 0:n.fontColor}},"&:hover":{textDecoration:"none",color:e.HueNeutral900,...(n==null?void 0:n.fontColor)&&{color:n==null?void 0:n.fontColor}},...(n==null?void 0:n.fontColor)&&{color:n==null?void 0:n.fontColor}}})),Lt=S("div",{shouldForwardProp:e=>e!=="odysseyDesignTokens"})(({odysseyDesignTokens:e})=>({alignItems:"center",display:"flex",gap:e.Spacing2,paddingBlock:e.Spacing2,paddingInline:e.Spacing4})),Dt=e=>e.scrollHeight>e.clientHeight,At=()=>{const e=D();return i.jsxs(Lt,{odysseyDesignTokens:e,children:[i.jsx(J,{height:e.Spacing4,variant:"circular",width:e.Spacing4}),i.jsx(J,{variant:"rounded",width:"100%"})]})},Tt=({appName:e,footerComponent:n,footerItems:t,hasCustomFooter:r,hasSessionStorageState:c,isCollapsible:o,isCollapsed:s=!1,isCompact:g,isLoading:d,isObtrusive:f,logoProps:u,leavesPaddingStart:x,onCollapse:p,onExpand:b,onSort:m,sideNavItems:I})=>{var me,Se,be;const[P,F]=a.useState(!1),[A,L]=a.useState(!1),[T,_]=a.useState(!1),[j,W]=a.useState(I||[]),[H,Ve]=a.useState(s),{sessionState:Ne,setSessionState:Oe}=pt(s),O=c?Ne:H,$=c?Oe:Ve,h=N(),k=D(),{t:We}=Z(),E=a.useRef(null),R=a.useRef(null),z=a.useRef(null),Q=a.useRef(null),{isAtContainerInlineStart:Ze}=zn({element:Q.current,monitoringElement:(Se=(me=Q.current)==null?void 0:me.parentElement)==null?void 0:Se.parentElement}),C=!Ze,G=a.useMemo(()=>i.jsx("div",{}),[]);a.useEffect(()=>W(I||[]),[I]);const Ge=a.useCallback(()=>{o||$(s)},[s,o,$]),Ke=a.useCallback(()=>{$(s)},[s,$]);Be({onMount:Ge,onUpdate:Ke}),a.useEffect(()=>{const l=()=>{E.current&&E.current.parentElement&&L(Dt(E.current.parentElement))};let y;if(R.current||(R.current=new ResizeObserver(()=>{cancelAnimationFrame(y),y=requestAnimationFrame(l)})),R.current&&E.current&&(R.current.observe(E.current),E.current.parentElement&&R.current.observe(E.current.parentElement)),l(),!z.current&&E.current&&(z.current=new IntersectionObserver(v=>{var w;const M=(w=v.slice().sort((B,re)=>B.time-re.time).at(0))==null?void 0:w.isIntersecting;F(!M)},{root:E.current.parentElement,threshold:1})),z.current&&E.current){const v=E.current,[M]=Array.from((v==null?void 0:v.children)||[]);M&&z.current.observe(M)}return()=>{R.current&&(R.current.disconnect(),R.current=null),z.current&&(z.current.disconnect(),z.current=null),cancelAnimationFrame(y)}},[j]);const ee=a.useRef(null),K=a.useMemo(()=>{const y=_e(j).find(v=>v.isSelected);return y==null?void 0:y.id},[j]);a.useEffect(()=>{K&&ee.current&&ee.current.scrollIntoView()},[K]);const ge=a.useCallback(l=>l===K?ee:void 0,[K]),fe=a.useCallback(l=>{const y=M=>M.map(w=>w.nestedNavItems?{...w,isSelected:w.id===l,nestedNavItems:y(w.nestedNavItems)}:{...w,isSelected:w.id===l}),v=y(j);W(v),(s||f)&&(o?h==null||h.closeSideNavMenu():p==null||p())},[s,o,f,p,j,h]),Ue=a.useCallback(l=>({depth:l}),[]),Xe=a.useCallback((l,y)=>({isCompact:g,depth:l,isSortable:y,absolutePaddingStart:x}),[g,x]),qe=(l,y=1)=>{var Ie;const{href:v,id:M,isDefaultExpanded:w,isDisabled:B,isExpanded:re,isSectionHeader:Ce,label:he,startIcon:pe,nestedNavItems:U,onChange:en,isSortable:xe,translate:nn}=l;if(Ce)return i.jsx(X,{fallback:G,children:i.jsx(kt,{contrastFontColor:(Ie=h==null?void 0:h.sideNavContrastColors)==null?void 0:Ie.fontColor,id:M,odysseyDesignTokens:k,children:i.jsx(pn,{component:"h3",children:he})})},M);if(U&&U.length>0){const ye=i.jsx(ke,{role:"presentation",children:xe?i.jsx(Re,{depth:y+1,items:U,onChange:Je,parentId:l.id,processSideNavItems:ne}):ne(U,y+1).map(tn=>tn.sortableItem.navItem)});return v?i.jsxs(X,{fallback:G,children:[i.jsx(de,{...l,href:v,onItemSelected:fe,scrollRef:ge(l.id),startIcon:l.startIcon}),i.jsx(ce,{"aria-disabled":B,disabled:B,id:`${M}-items`,odysseyDesignTokens:k,children:ye})]},M):i.jsx(X,{fallback:G,children:i.jsx(ce,{"aria-disabled":B,disabled:B,id:M,odysseyDesignTokens:k,children:i.jsx(oe.Provider,{value:Ue(y),children:i.jsx(De,{isCompact:g,isDefaultExpanded:w,isDisabled:B,isExpanded:re,label:he,onChange:en,startIcon:pe,children:ye})},M)})},M)}else return i.jsx(X,{fallback:G,children:i.jsx(oe.Provider,{value:Xe(y,xe),children:i.jsx(de,{...l,onItemSelected:fe,scrollRef:ge(M),startIcon:pe,translate:nn})},M)},M)},ne=(l,y=1)=>l==null?void 0:l.map(v=>({...v,sortableItem:{id:v.id,isSelected:v.isSelected,isDisabled:v.isDisabled,isSortable:v.isSortable,navItem:qe(v,y)}})),te=a.useCallback(()=>{$(l=>(l?b==null||b():p==null||p(),!l))},[p,b,$]),Ye=a.useCallback(l=>{((l==null?void 0:l.key)==="Enter"||(l==null?void 0:l.code)==="Space")&&(l.preventDefault(),te())},[te]);a.useEffect(()=>{const l=h==null?void 0:h.subscribeToCloseSideNavMenu(()=>{p==null||p(),$(!0)});return()=>{l==null||l()}},[p,$,h]);const Je=a.useCallback((l,y,v,M)=>{const w=j.map(B=>B.id===l&&B.nestedNavItems?{...B,nestedNavItems:mn(B.nestedNavItems,v,M)}:B);W(w),m==null||m(w,l,y,v,M)},[m,j]),Qe=a.useCallback(l=>{_(l)},[]);return i.jsxs(vt,{"aria-label":We("navigation.label"),backgroundColor:h==null?void 0:h.sideNavBackgroundColor,hasNeighbouringContentAtInlineStart:C,id:"side-nav-expandable",isAppContentWhiteBackground:(h==null?void 0:h.appBackgroundColor)===k.HueNeutralWhite,isSideNavCollapsed:O,isSideNavToggleHighlighted:T,odysseyDesignTokens:k,ref:Q,children:[o&&i.jsx(Mt,{hasNeighbouringContentAtInlineStart:C,isSideNavCollapsed:O,isSideNavToggleHighlighted:T,odysseyDesignTokens:k,children:i.jsx(Pe,{ariaControls:"side-nav-expandable",clickAreaPadding:O&&!C?V/2:0,isSideNavCollapsed:O,onClick:te,onHighlight:Qe,onKeyDown:Ye})}),i.jsx(bn,{children:i.jsx(It,{"data-se":"collapsible-region",isSideNavCollapsed:O,odysseyDesignTokens:k,children:i.jsxs(yt,{isSideNavCollapsed:O,odysseyDesignTokens:k,children:[e||d||u?i.jsx(jt,{borderColor:(be=h==null?void 0:h.sideNavContrastColors)==null?void 0:be.fontColor,hasContentScrolled:P,odysseyDesignTokens:k,children:d&&!e&&!u?i.jsx(ae,{isLoading:d}):i.jsx(ae,{appName:e,isLoading:d,logoProps:u})}):i.jsx("div",{}),i.jsxs(wt,{"data-se":"scrollable-region",hasBlockStartPadding:!e,odysseyDesignTokens:k,children:[i.jsx(ke,{ref:E,role:"none",children:d?Array(6).fill(null).map((l,y)=>i.jsx(At,{},y)):ne(j).map(l=>l.sortableItem.navItem)}),!d&&t&&!r&&i.jsx(ze,{odysseyDesignTokens:k,sideNavBackgroundColor:h==null?void 0:h.sideNavBackgroundColor,children:i.jsx(Et,{odysseyDesignTokens:k,sideNavContrastColors:h==null?void 0:h.sideNavContrastColors,children:i.jsx(Ae,{footerItems:t})})})]}),!d&&!t&&r&&i.jsx(Bt,{isContentScrollable:A,odysseyDesignTokens:k,sideNavBackgroundColor:h==null?void 0:h.sideNavBackgroundColor,children:n})]})})})]})},Ht=a.memo(Tt);Ht.displayName="SideNav";export{Ht as M,Te as a};
