@zydon/common-csr 2.1.8 → 2.1.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,9 +1,9 @@
1
1
  import { stylesMode, paper, varAlpha } from '@zydon/common/theme/styles';
2
2
  import { forwardRef, cloneElement, useState, useCallback, useRef, useEffect, useMemo } from 'react';
3
3
  import q from '@mui/material/Box';
4
- import Fe from '@mui/material/ButtonBase';
4
+ import Ge from '@mui/material/ButtonBase';
5
5
  import { styled, useTheme } from '@mui/material/styles';
6
- import Ge from '@mui/material/Tooltip';
6
+ import Fe from '@mui/material/Tooltip';
7
7
  import he from '@zydon/common/components/Icon';
8
8
  import Me from '@mui/material/Collapse';
9
9
  import Te from '@mui/material/Typography';
@@ -15,6 +15,6 @@ import eo from '@mui/material/Paper';
15
15
  import oo from '@mui/material/Popover';
16
16
  import Xo from '@mui/material/Divider';
17
17
 
18
- var t={mini:{root:"nav__section__mini"},horizontal:{root:"nav__section__horizontal"},vertical:{root:"nav__section__vertical"},item:{root:"mnl__nav__item",icon:"mnl__nav__item__icon",info:"mnl__nav__item__info",texts:"mnl__nav__item__texts",title:"mnl__nav__item__title",arrow:"mnl__nav__item__arrow",caption:"mnl__nav__item__caption"},li:"mnl__nav__li",ul:"mnl__nav__ul",paper:"mnl__nav__paper",subheader:"mnl__nav__subheader",state:{open:"state--open",active:"state--active",disabled:"state--disabled"}};var ue={dark:"#282F37",light:"#EDEFF2"};function Y(e,a){let{vars:{palette:o}}=e;return {"--nav-item-color":o.text.secondary,"--nav-item-hover-bg":o.action.hover,"--nav-item-caption-color":o.text.disabled,"--nav-item-root-active-color":o.primary.main,"--nav-item-root-active-color-on-dark":o.primary.light,"--nav-item-root-active-bg":varAlpha(o.primary.mainChannel,.08),"--nav-item-root-active-hover-bg":varAlpha(o.primary.mainChannel,.16),"--nav-item-root-open-color":o.text.primary,"--nav-item-root-open-bg":o.action.hover,"--nav-item-sub-active-color":o.text.primary,"--nav-item-sub-active-bg":o.action.selected,"--nav-item-sub-open-color":o.text.primary,"--nav-item-sub-open-bg":o.action.hover,...a==="vertical"&&{"--nav-item-sub-active-bg":o.action.hover,"--nav-subheader-color":o.text.disabled,"--nav-subheader-hover-color":o.text.primary}}}function $e(e){let{shape:a,spacing:o}=e;return {...Y(e,"vertical"),"--nav-item-gap":o(.5),"--nav-item-radius":`${a.borderRadius}px`,"--nav-item-pt":o(.5),"--nav-item-pr":o(1),"--nav-item-pb":o(.5),"--nav-item-pl":o(1.5),"--nav-item-root-height":"44px","--nav-item-sub-height":"36px","--nav-icon-size":"24px","--nav-icon-margin":o(0,1.5,0,0),"--nav-bullet-size":"12px","--nav-bullet-light-color":ue.light,"--nav-bullet-dark-color":ue.dark}}function _e(e){let{shape:a,spacing:o}=e;return {...Y(e,"mini"),"--nav-item-gap":o(.5),"--nav-item-radius":`${a.borderRadius}px`,"--nav-item-root-height":"56px","--nav-item-root-padding":o(1,.5,.75,.5),"--nav-item-sub-height":"34px","--nav-item-sub-padding":o(0,1),"--nav-icon-size":"22px","--nav-icon-root-margin":o(0,0,.75,0),"--nav-icon-sub-margin":o(0,1,0,0)}}function Ee(e){let{shape:a,spacing:o}=e;return {...Y(e,"horizontal"),"--nav-item-gap":o(.75),"--nav-height":"56px","--nav-item-radius":`${a.borderRadius*.75}px`,"--nav-item-root-height":"32px","--nav-item-root-padding":o(0,.75),"--nav-item-sub-height":"34px","--nav-item-sub-padding":o(0,1),"--nav-icon-size":"22px","--nav-icon-sub-margin":o(0,1,0,0),"--nav-icon-root-margin":o(0,1,0,0)}}var k={mini:_e,vertical:$e,horizontal:Ee};function S({open:e,active:a,disabled:o}){let i=t.item.root;return a?i+=` ${t.state.active}`:e?i+=` ${t.state.open}`:o&&(i+=` ${t.state.disabled}`),i}var u={icon:{flexShrink:0,display:"inline-flex",["& svg, & img"]:{width:"100%",height:"100%"}},arrow:{width:16,height:16,flexShrink:0,marginLeft:"6px",display:"inline-flex"},info:{fontSize:12,flexShrink:0,fontWeight:600,marginLeft:"6px",lineHeight:18/12,display:"inline-flex"},noWrap:{width:"100%",maxWidth:"100%",display:"block",overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"},disabled:{opacity:.48,pointerEvents:"none"}};function K({sx:e,children:a}){return jsx(Fragment,{children:jsx(Te,{component:"div",sx:{gap:1,alignItems:"center",position:"relative",typography:"overline",display:"inline-flex",alignSelf:"flex-start",color:"var(--nav-subheader-color)",padding:o=>o.spacing(2,1,1,1.5),fontSize:o=>o.typography.pxToRem(11),transition:o=>o.transitions.create(["color","padding-left"],{duration:o.transitions.duration.standard}),...e},children:a})})}function Q({sx:e,depth:a,children:o,...i}){return jsx(Me,{sx:{...a+1!==1&&{pl:"calc(var(--nav-item-pl) + var(--nav-icon-size) / 2)",[`& .${t.ul}`]:{position:"relative",pl:"var(--nav-bullet-size)","&::before":{top:0,left:0,width:"2px",content:'""',position:"absolute",bottom:"calc(var(--nav-item-sub-height) - 2px - var(--nav-bullet-size) / 2)",bgcolor:"var(--nav-bullet-light-color)",[stylesMode.dark]:{bgcolor:"var(--nav-bullet-dark-color)"}}}},...e},...i,children:o})}function b({sx:e,children:a,disabled:o,...i}){return jsx(q,{component:"li",className:t.li,sx:{display:"flex",flexDirection:"column",...o&&{cursor:"not-allowed"},...e},...i,children:a})}function N({children:e,sx:a,...o}){return jsx(q,{component:"ul",className:t.ul,sx:{display:"flex",flexDirection:"column",...a},...o,children:e})}var fe=forwardRef(({href:e,...a},o)=>jsx(Link,{ref:o,to:e,...a}));function E({path:e,icon:a,info:o,depth:i,render:r,hasChild:s,externalLink:m,enabledRootRedirect:n}){let l=i===1,v=!l,c=Number(i)>2,d=s&&!n?{component:"div"}:m?{href:e,target:"_blank",rel:"noopener"}:{component:fe,href:e},g=null;a&&r?.navIcon&&typeof a=="string"?g=r?.navIcon[a]:g=a;let f=null;if(o&&r?.navInfo&&Array.isArray(o)){let[x,h]=o,y=r.navInfo(h)[x];f=y?cloneElement(y):null;}else f=o;return {subItem:v,rootItem:l,subDeepItem:c,baseProps:d,renderIcon:g,renderInfo:f}}var j=forwardRef(({path:e,icon:a,info:o,title:i,caption:r,open:s,depth:m,render:n,active:l,disabled:v,hasChild:c,slotProps:p,externalLink:d,enabledRootRedirect:g,...f},x)=>{let h=E({path:e,icon:a,info:o,depth:m,render:n,hasChild:c,externalLink:d,enabledRootRedirect:g});return jsxs(Je,{ref:x,"aria-label":i,depth:m,active:l,disabled:v,open:s&&!l,sx:{...p?.sx,[`& .${t.item.icon}`]:p?.icon,[`& .${t.item.title}`]:p?.title,[`& .${t.item.caption}`]:p?.caption,[`& .${t.item.info}`]:p?.info,[`& .${t.item.arrow}`]:p?.arrow},className:S({open:s&&!l,active:l,disabled:v}),...h.baseProps,...f,children:[a&&jsx(q,{component:"span",className:t.item.icon,children:h.renderIcon}),i&&jsx(q,{component:"span",className:t.item.title,children:i}),r&&jsx(Ge,{title:r,arrow:!0,children:jsx(he,{icon:"INFO_CIRCLE",className:t.item.caption})}),o&&jsx(q,{component:"span",className:t.item.info,children:h.renderInfo}),c&&jsx(he,{icon:h.subItem?"CHEVRON_RIGHT":"ARROW_DOWN_SIMPLE",className:t.item.arrow})]})}),Je=styled(Fe,{shouldForwardProp:e=>e!=="active"&&e!=="open"&&e!=="disabled"&&e!=="depth"})(({active:e,open:a,disabled:o,depth:i,theme:r})=>{let s=i===1,m=!s,n={item:{flexShrink:0,color:"var(--nav-item-color)",borderRadius:"var(--nav-item-radius)","&:hover":{backgroundColor:"var(--nav-item-hover-bg)"}},title:{...r.typography.body2,fontWeight:e?r.typography.fontWeightSemiBold:r.typography.fontWeightMedium},caption:{width:16,height:16,color:"var(--nav-item-caption-color)"},icon:{...u.icon,width:"var(--nav-icon-size)",height:"var(--nav-icon-size)"},arrow:{...u.arrow},info:{...u.info}};return {...s&&{...n.item,padding:"var(--nav-item-root-padding)",minHeight:"var(--nav-item-root-height)",[`& .${t.item.icon}`]:{...n.icon,margin:"var(--nav-icon-root-margin)"},[`& .${t.item.title}`]:{...n.title,whiteSpace:"nowrap"},[`& .${t.item.caption}`]:{...n.caption,marginLeft:r.spacing(.75)},[`& .${t.item.arrow}`]:{...n.arrow},[`& .${t.item.info}`]:{...n.info},...e&&{color:"var(--nav-item-root-active-color)",backgroundColor:"var(--nav-item-root-active-bg)","&:hover":{backgroundColor:"var(--nav-item-root-active-hover-bg)"},[stylesMode.dark]:{color:"var(--nav-item-root-active-color-on-dark)"}},...a&&{color:"var(--nav-item-root-open-color)",backgroundColor:"var(--nav-item-root-open-bg)"}},...m&&{...n.item,padding:"var(--nav-item-sub-padding)",minHeight:"var(--nav-item-sub-height)",color:r.vars.palette.text.secondary,[`& .${t.item.icon}`]:{...n.icon,margin:"var(--nav-icon-sub-margin)"},[`& .${t.item.title}`]:{...n.title,flexGrow:1},[`& .${t.item.caption}`]:{...n.caption},[`& .${t.item.arrow}`]:{...n.arrow,marginRight:r.spacing(-.5)},[`& .${t.item.info}`]:{...n.info},...e&&{color:"var(--nav-item-sub-active-color)",backgroundColor:"var(--nav-item-sub-active-bg)"},...a&&{color:"var(--nav-item-sub-open-color)",backgroundColor:"var(--nav-item-sub-open-bg)"}},...o&&u.disabled}});var ge=e=>{let a=e.split("?")[1];return a?new URLSearchParams(a).toString().length>0:!1};function ee(e){return e!=="/"&&e.endsWith("/")?e.slice(0,-1):e}function be(e){try{let a=new URL(e,window.location.origin);return ee(a.pathname)}catch{return e}}function I(e){return e.startsWith("http")}function T(e){return e.replace(window.location.origin,"")}function w(){let{pathname:e}=useLocation();return useMemo(()=>e,[e])}function W(e,a=!0){let o=ee(w()),i=ge(e);if(e.startsWith("#")||I(e))return !1;if(a||i){let m=o.includes(e),n=be(e);return m||i&&n===o}return o===e}function oe({data:e,depth:a,render:o,cssVars:i,slotProps:r,enabledRootRedirect:s}){let m=useTheme(),n=w(),l=useRef(null),v=W(e.path,!!e.children),[c,p]=useState(!1);useEffect(()=>{c&&g();},[n]);let d=useCallback(()=>{e.children&&p(!0);},[e.children]),g=useCallback(()=>{p(!1);},[]),f=jsx(j,{ref:l,render:o,title:e.title,path:e.path,icon:e.icon,info:e.info,caption:e.caption,depth:a,active:v,disabled:e.disabled,hasChild:!!e.children,open:e.children&&c,externalLink:I(e.path),enabledRootRedirect:s,slotProps:a===1?r?.rootItem:r?.subItem,onMouseEnter:d,onMouseLeave:g});return e.roles&&r?.currentRole&&!e?.roles?.includes(r?.currentRole)?null:e.children?jsxs(b,{disabled:e.disabled,children:[f,jsx(oo,{disableScrollLock:!0,open:c,anchorEl:l.current,anchorOrigin:a===1?{vertical:"bottom",horizontal:"left"}:{vertical:"center",horizontal:"right"},transformOrigin:a===1?{vertical:"top",horizontal:"left"}:{vertical:"center",horizontal:"left"},slotProps:{paper:{onMouseEnter:d,onMouseLeave:g,sx:{px:.75,boxShadow:"none",overflow:"unset",backdropFilter:"none",background:"transparent",...a===1&&{ml:-.75},...c&&{pointerEvents:"auto"}}}},sx:{...i,pointerEvents:"none"},children:jsx(eo,{className:t.paper,sx:{minWidth:180,...paper({theme:m,dropdown:!0}),...r?.paper},children:jsx(no,{data:e.children,depth:a,render:o,cssVars:i,slotProps:r,enabledRootRedirect:s})})})]}):jsx(b,{disabled:e.disabled,children:f})}function no({data:e,depth:a,render:o,cssVars:i,slotProps:r,enabledRootRedirect:s}){return jsx(N,{sx:{gap:.5},children:e.map(m=>jsx(oe,{data:m,render:o,depth:a+1,cssVars:i,slotProps:r,enabledRootRedirect:s},m.title))})}function un({sx:e,data:a,render:o,slotProps:i,enabledRootRedirect:r,cssVars:s}){let m=useTheme(),n={...k.horizontal(m),...s};return jsx(mo,{sx:{height:1},slotProps:{content:{height:1,display:"flex",alignItems:"center"}},children:jsx(io,{component:"nav",direction:"row",alignItems:"center",className:t.horizontal.root,sx:{...n,mx:"auto",height:1,minHeight:"var(--nav-height)",...e},children:jsx(N,{sx:{flexDirection:"row",gap:"var(--nav-item-gap)"},children:a.map(l=>jsx(lo,{render:o,cssVars:n,items:l.items,slotProps:i,enabledRootRedirect:r},l.subheader??l.items[0].title))})})})}function lo({items:e,render:a,slotProps:o,enabledRootRedirect:i,cssVars:r}){return jsx(b,{children:jsx(N,{sx:{flexDirection:"row",gap:"var(--nav-item-gap)"},children:e.map(s=>jsx(oe,{depth:1,data:s,render:a,cssVars:r,slotProps:o,enabledRootRedirect:i},s.title))})})}var re=forwardRef(({path:e,icon:a,info:o,title:i,caption:r,open:s,depth:m,render:n,active:l,disabled:v,hasChild:c,slotProps:p,externalLink:d,enabledRootRedirect:g,...f},x)=>{let h=E({path:e,icon:a,info:o,depth:m,render:n,hasChild:c,externalLink:d,enabledRootRedirect:g});return jsxs(go,{ref:x,"aria-label":i,depth:m,active:l,disabled:v,open:s&&!l,sx:{...p?.sx,[`& .${t.item.icon}`]:p?.icon,[`& .${t.item.title}`]:p?.title,[`& .${t.item.caption}`]:p?.caption,[`& .${t.item.info}`]:p?.info,[`& .${t.item.arrow}`]:p?.arrow},className:S({open:s&&!l,active:l,disabled:v}),...h.baseProps,...f,children:[a&&jsx(q,{component:"span",className:t.item.icon,children:h.renderIcon}),i&&jsx(q,{component:"span",className:t.item.title,children:i}),r&&jsx(Ge,{title:r,arrow:!0,placement:"right",children:jsx(he,{icon:"INFO_CIRCLE",className:t.item.caption})}),o&&h.subItem&&jsx(q,{component:"span",className:t.item.info,children:h.renderInfo})]})}),go=styled(Fe,{shouldForwardProp:e=>e!=="active"&&e!=="open"&&e!=="disabled"&&e!=="depth"})(({active:e,open:a,disabled:o,depth:i,theme:r})=>{let s=i===1,m=!s,n={item:{width:"100%",borderRadius:"var(--nav-item-radius)",color:"var(--nav-item-color)","&:hover":{backgroundColor:"var(--nav-item-hover-bg)"}},title:{},caption:{width:16,height:16,color:"var(--nav-item-caption-color)"},icon:{...u.icon,width:"var(--nav-icon-size)",height:"var(--nav-icon-size)"},arrow:{...u.arrow},info:{...u.info}};return {...s&&{...n.item,textAlign:"center",flexDirection:"column",width:48,minHeight:44,padding:"var(--nav-item-root-padding)",[`& .${t.item.icon}`]:{...n.icon},[`& .${t.item.title}`]:{...n.title,...u.noWrap,lineHeight:"16px",fontSize:r.typography.pxToRem(10),fontWeight:e?r.typography.fontWeightBold:r.typography.fontWeightSemiBold},[`& .${t.item.caption}`]:{...n.caption,top:11,left:6,position:"absolute"},[`& .${t.item.arrow}`]:{...n.arrow,top:11,right:6,position:"absolute"},[`& .${t.item.info}`]:{...n.info},...e&&{color:r.palette.primary.contrastText,backgroundColor:r.palette.primary.main,"&:hover":{backgroundColor:r.palette.primary.lighter},[stylesMode.dark]:{color:"var(--nav-item-root-active-color-on-dark)"}},...a&&{color:"var(--nav-item-root-open-color)",backgroundColor:"var(--nav-item-root-open-bg)"}},...m&&{...n.item,color:r.vars.palette.text.secondary,minHeight:"var(--nav-item-sub-height)",padding:"var(--nav-item-sub-padding)",[`& .${t.item.icon}`]:{...n.icon,margin:"var(--nav-icon-sub-margin)"},[`& .${t.item.title}`]:{...n.title,...r.typography.body2,fontWeight:e?r.typography.fontWeightSemiBold:r.typography.fontWeightMedium,flex:"1 1 auto"},[`& .${t.item.caption}`]:{...n.caption},[`& .${t.item.arrow}`]:{...n.arrow,marginRight:r.spacing(-.5)},[`& .${t.item.info}`]:{...n.info},...e&&{color:"var(--nav-item-sub-active-color)",backgroundColor:"var(--nav-item-sub-active-bg)"},...a&&{color:"var(--nav-item-sub-open-color)",backgroundColor:"var(--nav-item-sub-open-bg)"}},...o&&u.disabled}});var ne=({data:e,depth:a,render:o,cssVars:i,slotProps:r,enabledRootRedirect:s})=>{let m=useTheme(),n=w(),l=useRef(null),v=W(e.path,!!e.children),[c,p]=useState(!1);useEffect(()=>{c&&g();},[n]);let d=useCallback(()=>{e.children&&p(!0);},[e.children]),g=useCallback(()=>{p(!1);},[]),f=jsx(re,{ref:l,render:o,path:e.path,icon:e.icon,info:e.info,title:e.title,caption:e.caption,depth:a,active:v,disabled:e.disabled,hasChild:!!e.children,open:e.children&&c,externalLink:I(e.path),enabledRootRedirect:s,slotProps:a===1?r?.rootItem:r?.subItem,onMouseEnter:d,onMouseLeave:g});return e.roles&&r?.currentRole&&!e?.roles?.includes(r?.currentRole)?null:e.children?jsxs(b,{disabled:e.disabled,children:[f,jsx(oo,{disableScrollLock:!0,open:c,anchorEl:l.current,anchorOrigin:{vertical:"center",horizontal:"right"},transformOrigin:{vertical:"center",horizontal:"left"},slotProps:{paper:{onMouseEnter:d,onMouseLeave:g,sx:{px:.75,boxShadow:"none",overflow:"unset",backdropFilter:"none",background:"transparent",...a>1&&{mt:-1},...c&&{pointerEvents:"auto"}}}},sx:{...i,pointerEvents:"none"},children:jsx(eo,{className:t.paper,sx:{minWidth:180,...paper({theme:m,dropdown:!0}),...r?.paper},children:jsx(Co,{data:e.children,depth:a,render:o,cssVars:i,slotProps:r,enabledRootRedirect:s})})})]}):jsx(b,{disabled:e.disabled,children:f})};function Co({data:e,render:a,depth:o,slotProps:i,enabledRootRedirect:r,cssVars:s}){return jsx(N,{sx:{gap:.5},children:e.map(m=>jsx(ne,{data:m,render:a,depth:o+1,cssVars:s,slotProps:i,enabledRootRedirect:r},m.title))})}var Xn=({sx:e,data:a,render:o,slotProps:i,enabledRootRedirect:r,cssVars:s})=>{let m=useTheme(),n={...k.mini(m),...s};return jsx(io,{component:"nav",className:t.mini.root,sx:{...n,...e},children:jsx(N,{sx:{flex:"1 1 auto",gap:"var(--nav-item-gap)"},children:a.map(l=>jsx(Bo,{render:o,cssVars:n,items:l.items,slotProps:i,enabledRootRedirect:r},l.subheader??l.items[0].title))})})},Bo=({items:e,render:a,slotProps:o,enabledRootRedirect:i,cssVars:r})=>jsx(b,{children:jsx(N,{sx:{gap:"var(--nav-item-gap)"},children:e.map(s=>jsx(ne,{depth:1,data:s,render:a,cssVars:r,slotProps:o,enabledRootRedirect:i},s.title))})});function X({path:e,icon:a,info:o,depth:i,render:r,hasChild:s,externalLink:m,enabledRootRedirect:n,onNavigate:l}){let v=i===1,c=!v,p=Number(i)>2,g=s&&!n?{component:"div"}:m?{href:e,target:"_blank",rel:"noopener"}:{onClick:h=>l(h,e)},f=null;a&&r?.navIcon&&typeof a=="string"?f=r?.navIcon[a]:f=a;let x=null;if(o&&r?.navInfo&&Array.isArray(o)){let[h,y]=o,A=r.navInfo(y)[h];x=A?cloneElement(A):null;}else x=o;return {subItem:c,rootItem:v,subDeepItem:p,baseProps:g,renderIcon:f,renderInfo:x}}var ie=forwardRef(({path:e,icon:a,info:o,title:i,caption:r,open:s,depth:m,render:n,active:l,disabled:v,hasChild:c,slotProps:p,externalLink:d,enabledRootRedirect:g,onNavigate:f,...x},h)=>{let y=X({path:e,icon:a,info:o,depth:m,render:n,hasChild:c,externalLink:d,enabledRootRedirect:g,onNavigate:f});return jsxs(Vo,{ref:h,"aria-label":i,depth:m,active:l,disabled:v,open:s&&!l,sx:{...p?.sx,[`& .${t.item.icon}`]:p?.icon,[`& .${t.item.title}`]:p?.title,[`& .${t.item.caption}`]:p?.caption,[`& .${t.item.info}`]:p?.info,[`& .${t.item.arrow}`]:p?.arrow},className:S({open:s&&!l,active:l,disabled:v}),...y.baseProps,...x,...y.baseProps.onClick?{onClick:y.baseProps.onClick,style:{textAlign:"left"}}:{},children:[a&&jsx(q,{component:"span",className:t.item.icon,children:y.renderIcon}),i&&jsx(q,{component:"span",className:t.item.title,children:i}),r&&jsx(Ge,{title:r,arrow:!0,placement:"right",children:jsx(he,{icon:"INFO_CIRCLE",className:t.item.caption})}),o&&y.subItem&&jsx(q,{component:"span",className:t.item.info,children:y.renderInfo})]})}),Vo=styled(Fe,{shouldForwardProp:e=>e!=="active"&&e!=="open"&&e!=="disabled"&&e!=="depth"})(({active:e,open:a,disabled:o,depth:i,theme:r})=>{let s=i===1,m=!s,n={item:{width:"100%",borderRadius:"var(--nav-item-radius)",color:"var(--nav-item-color)","&:hover":{backgroundColor:"var(--nav-item-hover-bg)"}},title:{},caption:{width:16,height:16,color:"var(--nav-item-caption-color)"},icon:{...u.icon,width:"var(--nav-icon-size)",height:"var(--nav-icon-size)"},arrow:{...u.arrow},info:{...u.info}};return {...s&&{...n.item,textAlign:"center",flexDirection:"column",width:48,minHeight:44,padding:"var(--nav-item-root-padding)",[`& .${t.item.icon}`]:{...n.icon},[`& .${t.item.title}`]:{...n.title,...u.noWrap,lineHeight:"16px",fontSize:r.typography.pxToRem(10),fontWeight:e?r.typography.fontWeightBold:r.typography.fontWeightSemiBold},[`& .${t.item.caption}`]:{...n.caption,top:11,left:6,position:"absolute"},[`& .${t.item.arrow}`]:{...n.arrow,top:11,right:6,position:"absolute"},[`& .${t.item.info}`]:{...n.info},...e&&{color:r.palette.primary.contrastText,backgroundColor:r.palette.primary.main,"&:hover":{backgroundColor:r.palette.primary.lighter},[stylesMode.dark]:{color:"var(--nav-item-root-active-color-on-dark)"}},...a&&{color:"var(--nav-item-root-open-color)",backgroundColor:"var(--nav-item-root-open-bg)"}},...m&&{...n.item,color:r.vars.palette.text.secondary,minHeight:"var(--nav-item-sub-height)",padding:"var(--nav-item-sub-padding)",[`& .${t.item.icon}`]:{...n.icon,margin:"var(--nav-icon-sub-margin)"},[`& .${t.item.title}`]:{...n.title,...r.typography.body2,fontWeight:e?r.typography.fontWeightSemiBold:r.typography.fontWeightMedium,flex:"1 1 auto"},[`& .${t.item.caption}`]:{...n.caption},[`& .${t.item.arrow}`]:{...n.arrow,marginRight:r.spacing(-.5)},[`& .${t.item.info}`]:{...n.info},...e&&{color:"var(--nav-item-sub-active-color)",backgroundColor:"var(--nav-item-sub-active-bg)"},...a&&{color:"var(--nav-item-sub-open-color)",backgroundColor:"var(--nav-item-sub-open-bg)"}},...o&&u.disabled}});var se=({data:e,depth:a,render:o,cssVars:i,slotProps:r,enabledRootRedirect:s,onNavigate:m,pathname:n})=>{let l=useTheme(),v=useRef(null),c=I(e.path),p=T(e.path),d=!!matchPath({path:p||"",end:!c},n),g=Array.isArray(e.children)?e.children.some(Be=>matchPath({path:T(Be.path)||"",end:!c},n)):d,[f,x]=useState(!1);useEffect(()=>{f&&y();},[n]);let h=useCallback(()=>{e.children&&x(!0);},[e.children]),y=useCallback(()=>{x(!1);},[]),A=jsx(ie,{ref:v,render:o,path:e.path,icon:e.icon,info:e.info,title:e.title,caption:e.caption,depth:a,active:g,disabled:e.disabled,hasChild:!!e.children,open:e.children&&f,externalLink:!1,enabledRootRedirect:s,slotProps:a===1?r?.rootItem:r?.subItem,onMouseEnter:h,onMouseLeave:y,onNavigate:m});return e.roles&&r?.currentRole&&!e?.roles?.includes(r?.currentRole)?null:e.children?jsxs(b,{disabled:e.disabled,children:[A,jsx(oo,{disableScrollLock:!0,open:f,anchorEl:v.current,anchorOrigin:{vertical:"center",horizontal:"right"},transformOrigin:{vertical:"center",horizontal:"left"},slotProps:{paper:{onMouseEnter:h,onMouseLeave:y,sx:{px:.75,boxShadow:"none",overflow:"unset",backdropFilter:"none",background:"transparent",...a>1&&{mt:-1},...f&&{pointerEvents:"auto"}}}},sx:{...i,pointerEvents:"none"},children:jsx(eo,{className:t.paper,sx:{minWidth:180,...paper({theme:l,dropdown:!0}),...r?.paper},children:jsx(Jo,{data:e.children,depth:a,render:o,cssVars:i,slotProps:r,enabledRootRedirect:s,onNavigate:m,pathname:n})})})]}):jsx(b,{disabled:e.disabled,children:A})};function Jo({data:e,render:a,depth:o,slotProps:i,enabledRootRedirect:r,cssVars:s,onNavigate:m,pathname:n}){return jsx(N,{sx:{gap:.5},children:e.map(l=>jsx(se,{data:l,render:a,depth:o+1,cssVars:s,slotProps:i,enabledRootRedirect:r,onNavigate:m,pathname:n},l.title))})}var Wa=({sx:e,data:a,render:o,slotProps:i,enabledRootRedirect:r,cssVars:s,onNavigate:m,pathname:n})=>{let l=useTheme(),v={...k.mini(l),...s};return jsx(io,{component:"nav",className:t.mini.root,sx:{...v,...e},children:jsx(N,{sx:{flex:"1 1 auto",gap:"var(--nav-item-gap)",alignItems:"center",justifyContent:"center"},children:a.map(c=>jsxs(Fragment,{children:[c.subheader&&jsx(Fragment,{children:jsx(Xo,{sx:{my:2},flexItem:!0})}),jsx(jo,{render:o,cssVars:v,items:c.items,slotProps:i,enabledRootRedirect:r,onNavigate:m,pathname:n})]},c.subheader??c.items[0].title))})})},jo=({items:e,render:a,slotProps:o,enabledRootRedirect:i,cssVars:r,onNavigate:s,pathname:m})=>jsx(b,{children:jsx(N,{sx:{gap:"var(--nav-item-gap)"},children:e.map(n=>jsx(se,{depth:1,data:n,render:a,cssVars:r,slotProps:o,enabledRootRedirect:i,onNavigate:s,pathname:m},n.title))})});var me=forwardRef(({path:e,icon:a,info:o,title:i,caption:r,open:s,depth:m,render:n,active:l,disabled:v,hasChild:c,slotProps:p,externalLink:d,enabledRootRedirect:g,...f},x)=>{let h=E({path:e,icon:a,info:o,depth:m,render:n,hasChild:c,externalLink:d,enabledRootRedirect:g});return jsxs(st,{ref:x,"aria-label":i,depth:m,active:l,disabled:v,open:s&&!l,sx:{...p?.sx,[`& .${t.item.icon}`]:p?.icon,[`& .${t.item.texts}`]:p?.texts,[`& .${t.item.title}`]:p?.title,[`& .${t.item.caption}`]:p?.caption,[`& .${t.item.info}`]:p?.info,[`& .${t.item.arrow}`]:p?.arrow},className:S({open:s&&!l,active:l,disabled:v}),...h.baseProps,...f,children:[a&&jsx(q,{component:"span",className:t.item.icon,children:h.renderIcon}),i&&jsxs(q,{component:"span",className:t.item.texts,children:[jsx(q,{component:"span",className:t.item.title,children:i}),r&&jsx(Ge,{title:r,placement:"top-start",children:jsx(q,{component:"span",className:t.item.caption,children:r})})]}),o&&jsx(q,{component:"span",className:t.item.info,children:h.renderInfo}),c&&jsx(he,{icon:s?"ARROW_DOWN_SIMPLE":"CHEVRON_LEFT",className:t.item.arrow})]})}),st=styled(Fe,{shouldForwardProp:e=>e!=="active"&&e!=="open"&&e!=="disabled"&&e!=="depth"})(({active:e,open:a,disabled:o,depth:i,theme:r})=>{let s=i===1,m=!s,n={item:{width:"100%",paddingTop:"var(--nav-item-pt)",paddingLeft:"var(--nav-item-pl)",paddingRight:"var(--nav-item-pr)",paddingBottom:"var(--nav-item-pb)",borderRadius:"var(--nav-item-radius)",color:"var(--nav-item-color)","&:hover":{backgroundColor:"var(--nav-item-hover-bg)"}},texts:{minWidth:0,flex:"1 1 auto"},title:{...u.noWrap,...r.typography.body2,fontWeight:e?r.typography.fontWeightSemiBold:r.typography.fontWeightMedium},caption:{...u.noWrap,...r.typography.caption,color:"var(--nav-item-caption-color)"},icon:{...u.icon,width:"var(--nav-icon-size)",height:"var(--nav-icon-size)",margin:"var(--nav-icon-margin)"},arrow:{...u.arrow},info:{...u.info}};return {...s&&{...n.item,minHeight:"var(--nav-item-root-height)",[`& .${t.item.icon}`]:{...n.icon},[`& .${t.item.texts}`]:{...n.texts},[`& .${t.item.title}`]:{...n.title},[`& .${t.item.caption}`]:{...n.caption},[`& .${t.item.arrow}`]:{...n.arrow},[`& .${t.item.info}`]:{...n.info},...e&&{color:"var(--nav-item-root-active-color)",backgroundColor:"var(--nav-item-root-active-bg)","&:hover":{backgroundColor:"var(--nav-item-root-active-hover-bg)"},[stylesMode.dark]:{color:"var(--nav-item-root-active-color-on-dark)"}},...a&&{color:"var(--nav-item-root-open-color)",backgroundColor:"var(--nav-item-root-open-bg)"}},...m&&{...n.item,minHeight:"var(--nav-item-sub-height)",[`& .${t.item.icon}`]:{...n.icon},[`& .${t.item.texts}`]:{...n.texts},[`& .${t.item.title}`]:{...n.title},[`& .${t.item.caption}`]:{...n.caption},[`& .${t.item.arrow}`]:{...n.arrow},[`& .${t.item.info}`]:{...n.info},"&::before":{left:0,content:'""',position:"absolute",width:"var(--nav-bullet-size)",height:"var(--nav-bullet-size)",transform:"translate(calc(var(--nav-bullet-size) * -1), calc(var(--nav-bullet-size) * -0.4))",backgroundColor:"var(--nav-bullet-light-color)",mask:`url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' fill='none' viewBox='0 0 14 14'%3E%3Cpath d='M1 1v4a8 8 0 0 0 8 8h4' stroke='%23efefef' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat 50% 50%/100% auto`,WebkitMask:`url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' fill='none' viewBox='0 0 14 14'%3E%3Cpath d='M1 1v4a8 8 0 0 0 8 8h4' stroke='%23efefef' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat 50% 50%/100% auto`,[stylesMode.dark]:{backgroundColor:"var(--nav-bullet-dark-color)"}},...e&&{color:"var(--nav-item-sub-active-color)",backgroundColor:"var(--nav-item-sub-active-bg)"},...a&&{color:"var(--nav-item-sub-open-color)",backgroundColor:"var(--nav-item-sub-open-bg)"}},...o&&u.disabled}});var le=({data:e,render:a,depth:o,slotProps:i,enabledRootRedirect:r})=>{let s=w(),m=W(e.path,!!e.children),[n,l]=useState(m);useEffect(()=>{m||c();},[s]);let v=useCallback(()=>{e.children&&l(d=>!d);},[e.children]),c=useCallback(()=>{l(!1);},[]),p=jsx(me,{render:a,path:e.path,icon:e.icon,info:e.info,title:e.title,caption:e.caption,depth:o,active:m,disabled:e.disabled,hasChild:!!e.children,open:e.children&&n,externalLink:I(e.path),enabledRootRedirect:r,slotProps:o===1?i?.rootItem:i?.subItem,onClick:v});return e.roles&&i?.currentRole&&!e?.roles?.includes(i?.currentRole)?null:e.children?jsxs(b,{disabled:e.disabled,sx:{[`& .${t.li}`]:{"&:first-of-type":{mt:"var(--nav-item-gap)"}}},children:[p,jsx(Q,{"data-group":e.title,in:n,depth:o,unmountOnExit:!0,mountOnEnter:!0,children:jsx(pt,{data:e.children,render:a,depth:o,slotProps:i,enabledRootRedirect:r})})]}):jsx(b,{disabled:e.disabled,children:p})},pt=({data:e,render:a,depth:o,slotProps:i,enabledRootRedirect:r})=>jsx(N,{sx:{gap:"var(--nav-item-gap)"},children:e.map(s=>jsx(le,{data:s,render:a,depth:o+1,slotProps:i,enabledRootRedirect:r},s.title))});var gi=({sx:e,data:a,render:o,slotProps:i,enabledRootRedirect:r,cssVars:s})=>{let m=useTheme(),n={...k.vertical(m),...s};return jsx(io,{component:"nav",className:t.vertical.root,sx:{...n,...e},children:jsx(N,{sx:{flex:"1 1 auto",gap:"var(--nav-item-gap)"},children:a.map(l=>jsx(gt,{subheader:l.subheader,items:l.items,render:o,slotProps:i,enabledRootRedirect:r},l.subheader??l.items[0].title))})})},gt=({items:e,render:a,subheader:o,slotProps:i,enabledRootRedirect:r})=>{let[s,m]=useState(!0),n=useCallback(()=>{m(v=>!v);},[]),l=jsx(N,{sx:{gap:"var(--nav-item-gap)"},children:e.map(v=>jsx(le,{data:v,render:a,depth:1,slotProps:i,enabledRootRedirect:r},v.title))});return jsx(b,{children:o?jsxs(Fragment,{children:[jsx(K,{"data-title":o,open:s,onClick:n,sx:i?.subheader,children:o}),jsx(Me,{in:s,children:l})]}):l})};var pe=forwardRef(({path:e,icon:a,info:o,title:i,caption:r,open:s,depth:m,render:n,active:l,disabled:v,hasChild:c,slotProps:p,externalLink:d,enabledRootRedirect:g,onNavigate:f,...x},h)=>{let y=X({path:e,icon:a,info:o,depth:m,render:n,hasChild:c,externalLink:d,enabledRootRedirect:g,onNavigate:f});return jsxs(wt,{ref:h,"aria-label":i,depth:m,active:l,disabled:v,open:s&&!l,sx:{...p?.sx,[`& .${t.item.icon}`]:p?.icon,[`& .${t.item.texts}`]:p?.texts,[`& .${t.item.title}`]:p?.title,[`& .${t.item.caption}`]:p?.caption,[`& .${t.item.info}`]:p?.info,[`& .${t.item.arrow}`]:p?.arrow},className:S({open:s&&!l,active:l,disabled:v}),...y.baseProps,...x,...y.baseProps.onClick?{onClick:y.baseProps.onClick,style:{textAlign:"left"}}:{},children:[a&&jsx(q,{component:"span",className:t.item.icon,children:y.renderIcon}),i&&jsxs(q,{component:"span",className:t.item.texts,children:[jsx(q,{component:"span",className:t.item.title,children:i}),r&&jsx(Ge,{title:r,placement:"top-start",children:jsx(q,{component:"span",className:t.item.caption,children:r})})]}),o&&jsx(q,{component:"span",className:t.item.info,children:y.renderInfo}),c&&jsx(he,{icon:s?"ARROW_DOWN_SIMPLE":"CHEVRON_LEFT",className:t.item.arrow})]})}),wt=styled(Fe,{shouldForwardProp:e=>e!=="active"&&e!=="open"&&e!=="disabled"&&e!=="depth"})(({active:e,open:a,disabled:o,depth:i,theme:r})=>{let s=i===1,m=!s,n={item:{width:"100%",paddingTop:"var(--nav-item-pt)",paddingLeft:"var(--nav-item-pl)",paddingRight:"var(--nav-item-pr)",paddingBottom:"var(--nav-item-pb)",borderRadius:"var(--nav-item-radius)",color:"var(--nav-item-color)","&:hover":{backgroundColor:"var(--nav-item-hover-bg)"}},texts:{minWidth:0,flex:"1 1 auto"},title:{...u.noWrap,...r.typography.body2,fontWeight:e?r.typography.fontWeightSemiBold:r.typography.fontWeightMedium},caption:{...u.noWrap,...r.typography.caption,color:"var(--nav-item-caption-color)"},icon:{...u.icon,width:"var(--nav-icon-size)",height:"var(--nav-icon-size)",margin:"var(--nav-icon-margin)"},arrow:{...u.arrow},info:{...u.info}};return {...s&&{...n.item,minHeight:"var(--nav-item-root-height)",[`& .${t.item.icon}`]:{...n.icon},[`& .${t.item.texts}`]:{...n.texts},[`& .${t.item.title}`]:{...n.title},[`& .${t.item.caption}`]:{...n.caption},[`& .${t.item.arrow}`]:{...n.arrow},[`& .${t.item.info}`]:{...n.info},...e&&{color:"var(--nav-item-root-active-color)",backgroundColor:"var(--nav-item-root-active-bg)","&:hover":{backgroundColor:"var(--nav-item-root-active-hover-bg)"},[stylesMode.dark]:{color:"var(--nav-item-root-active-color-on-dark)"}},...a&&{color:"var(--nav-item-root-open-color)",backgroundColor:"var(--nav-item-root-open-bg)"}},...m&&{...n.item,minHeight:"var(--nav-item-sub-height)",[`& .${t.item.icon}`]:{...n.icon},[`& .${t.item.texts}`]:{...n.texts},[`& .${t.item.title}`]:{...n.title},[`& .${t.item.caption}`]:{...n.caption},[`& .${t.item.arrow}`]:{...n.arrow},[`& .${t.item.info}`]:{...n.info},"&::before":{left:0,content:'""',position:"absolute",width:"var(--nav-bullet-size)",height:"var(--nav-bullet-size)",transform:"translate(calc(var(--nav-bullet-size) * -1), calc(var(--nav-bullet-size) * -0.4))",backgroundColor:"var(--nav-bullet-light-color)",mask:`url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' fill='none' viewBox='0 0 14 14'%3E%3Cpath d='M1 1v4a8 8 0 0 0 8 8h4' stroke='%23efefef' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat 50% 50%/100% auto`,WebkitMask:`url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' fill='none' viewBox='0 0 14 14'%3E%3Cpath d='M1 1v4a8 8 0 0 0 8 8h4' stroke='%23efefef' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat 50% 50%/100% auto`,[stylesMode.dark]:{backgroundColor:"var(--nav-bullet-dark-color)"}},...e&&{color:"var(--nav-item-sub-active-color)",backgroundColor:"var(--nav-item-sub-active-bg)"},...a&&{color:"var(--nav-item-sub-open-color)",backgroundColor:"var(--nav-item-sub-open-bg)"}},...o&&u.disabled}});var ce=({data:e,render:a,depth:o,slotProps:i,enabledRootRedirect:r,onNavigate:s,pathname:m})=>{let n=I(e.path),l=T(e.path),v=!!matchPath({path:l||"",end:!n},m),c=Array.isArray(e.children)?e.children.some(h=>matchPath({path:T(h.path)||"",end:!n},m)):v,[p,d]=useState(c);useEffect(()=>{c||f();},[m]);let g=useCallback(()=>{e.children&&d(h=>!h);},[e.children]),f=useCallback(()=>{d(!1);},[]),x=jsx(pe,{render:a,path:e.path,icon:e.icon,info:e.info,title:e.title,caption:e.caption,depth:o,active:c,disabled:e.disabled,hasChild:!!e.children,open:e.children&&p,externalLink:!1,enabledRootRedirect:r,slotProps:o===1?i?.rootItem:i?.subItem,onClick:g,onNavigate:s});return e.roles&&i?.currentRole&&!e?.roles?.includes(i?.currentRole)?null:e.children?jsxs(b,{disabled:e.disabled,sx:{[`& .${t.li}`]:{"&:first-of-type":{mt:"var(--nav-item-gap)"}}},children:[x,jsx(Q,{"data-group":e.title,in:p,depth:o,unmountOnExit:!0,mountOnEnter:!0,children:jsx(Pt,{data:e.children,render:a,depth:o,slotProps:i,enabledRootRedirect:r,onNavigate:s,pathname:m})})]}):jsx(b,{disabled:e.disabled,children:x})},Pt=({data:e,render:a,depth:o,slotProps:i,enabledRootRedirect:r,onNavigate:s,pathname:m})=>jsx(N,{sx:{gap:"var(--nav-item-gap)"},children:e.map(n=>jsx(ce,{data:n,render:a,depth:o+1,slotProps:i,enabledRootRedirect:r,onNavigate:s,pathname:m},n.title))});var Yi=({sx:e,data:a,render:o,slotProps:i,enabledRootRedirect:r,cssVars:s,onNavigate:m,pathname:n})=>{let l=useTheme(),v={...k.vertical(l),...s};return jsx(io,{component:"nav",className:t.vertical.root,sx:{...v,...e},children:jsx(N,{sx:{flex:"1 1 auto",gap:"var(--nav-item-gap)"},children:a.map(c=>jsx(Tt,{subheader:c.subheader,items:c.items,render:o,renderEmptyView:c.renderEmptyView,slotProps:i,enabledRootRedirect:r,onNavigate:m,pathname:n},c.subheader??c.items[0].title))})})},Tt=({items:e,render:a,renderEmptyView:o,subheader:i,slotProps:r,enabledRootRedirect:s,onNavigate:m,pathname:n})=>{let[l,v]=useState(!0),c=useCallback(()=>{v(d=>!d);},[]),p=o&&e.length===0?o():jsx(N,{sx:{gap:"var(--nav-item-gap)"},children:e.map(d=>jsx(ce,{data:d,render:a,depth:1,slotProps:r,enabledRootRedirect:s,onNavigate:m,pathname:n},d.title))});return jsx(b,{children:i?jsxs(Fragment,{children:[jsx(K,{"data-title":i,open:l,onClick:c,sx:r?.subheader,children:i}),jsx(Me,{in:l,children:p})]}):p})};
18
+ var t={mini:{root:"nav__section__mini"},horizontal:{root:"nav__section__horizontal"},vertical:{root:"nav__section__vertical"},item:{root:"mnl__nav__item",icon:"mnl__nav__item__icon",info:"mnl__nav__item__info",texts:"mnl__nav__item__texts",title:"mnl__nav__item__title",arrow:"mnl__nav__item__arrow",caption:"mnl__nav__item__caption"},li:"mnl__nav__li",ul:"mnl__nav__ul",paper:"mnl__nav__paper",subheader:"mnl__nav__subheader",state:{open:"state--open",active:"state--active",disabled:"state--disabled"}};var ue={dark:"#282F37",light:"#EDEFF2"};function Y(e,a){let{vars:{palette:o}}=e;return {"--nav-item-color":o.text.secondary,"--nav-item-hover-bg":o.action.hover,"--nav-item-caption-color":o.text.disabled,"--nav-item-root-active-color":o.primary.main,"--nav-item-root-active-color-on-dark":o.primary.light,"--nav-item-root-active-bg":varAlpha(o.primary.mainChannel,.08),"--nav-item-root-active-hover-bg":varAlpha(o.primary.mainChannel,.16),"--nav-item-root-open-color":o.text.primary,"--nav-item-root-open-bg":o.action.hover,"--nav-item-sub-active-color":o.text.primary,"--nav-item-sub-active-bg":o.action.selected,"--nav-item-sub-open-color":o.text.primary,"--nav-item-sub-open-bg":o.action.hover,...a==="vertical"&&{"--nav-item-sub-active-bg":o.action.hover,"--nav-subheader-color":o.text.disabled,"--nav-subheader-hover-color":o.text.primary}}}function $e(e){let{shape:a,spacing:o}=e;return {...Y(e,"vertical"),"--nav-item-gap":o(.5),"--nav-item-radius":`${a.borderRadius}px`,"--nav-item-pt":o(.5),"--nav-item-pr":o(1),"--nav-item-pb":o(.5),"--nav-item-pl":o(1.5),"--nav-item-root-height":"44px","--nav-item-sub-height":"36px","--nav-icon-size":"24px","--nav-icon-margin":o(0,1.5,0,0),"--nav-bullet-size":"12px","--nav-bullet-light-color":ue.light,"--nav-bullet-dark-color":ue.dark}}function _e(e){let{shape:a,spacing:o}=e;return {...Y(e,"mini"),"--nav-item-gap":o(.5),"--nav-item-radius":`${a.borderRadius}px`,"--nav-item-root-height":"56px","--nav-item-root-padding":o(1,.5,.75,.5),"--nav-item-sub-height":"34px","--nav-item-sub-padding":o(0,1),"--nav-icon-size":"22px","--nav-icon-root-margin":o(0,0,.75,0),"--nav-icon-sub-margin":o(0,1,0,0)}}function Ee(e){let{shape:a,spacing:o}=e;return {...Y(e,"horizontal"),"--nav-item-gap":o(.75),"--nav-height":"56px","--nav-item-radius":`${a.borderRadius*.75}px`,"--nav-item-root-height":"32px","--nav-item-root-padding":o(0,.75),"--nav-item-sub-height":"34px","--nav-item-sub-padding":o(0,1),"--nav-icon-size":"22px","--nav-icon-sub-margin":o(0,1,0,0),"--nav-icon-root-margin":o(0,1,0,0)}}var k={mini:_e,vertical:$e,horizontal:Ee};function S({open:e,active:a,disabled:o}){let i=t.item.root;return a?i+=` ${t.state.active}`:e?i+=` ${t.state.open}`:o&&(i+=` ${t.state.disabled}`),i}var u={icon:{flexShrink:0,display:"inline-flex",["& svg, & img"]:{width:"100%",height:"100%"}},arrow:{width:16,height:16,flexShrink:0,marginLeft:"6px",display:"inline-flex"},info:{fontSize:12,flexShrink:0,fontWeight:600,marginLeft:"6px",lineHeight:18/12,display:"inline-flex"},noWrap:{width:"100%",maxWidth:"100%",display:"block",overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"},disabled:{opacity:.48,pointerEvents:"none"}};function K({sx:e,children:a}){return jsx(Fragment,{children:jsx(Te,{component:"div",sx:{gap:1,alignItems:"center",position:"relative",typography:"overline",display:"inline-flex",alignSelf:"flex-start",color:"var(--nav-subheader-color)",padding:o=>o.spacing(2,1,1,1.5),fontSize:o=>o.typography.pxToRem(11),transition:o=>o.transitions.create(["color","padding-left"],{duration:o.transitions.duration.standard}),...e},children:a})})}function Q({sx:e,depth:a,children:o,...i}){return jsx(Me,{sx:{...a+1!==1&&{pl:"calc(var(--nav-item-pl) + var(--nav-icon-size) / 2)",[`& .${t.ul}`]:{position:"relative",pl:"var(--nav-bullet-size)","&::before":{top:0,left:0,width:"2px",content:'""',position:"absolute",bottom:"calc(var(--nav-item-sub-height) - 2px - var(--nav-bullet-size) / 2)",bgcolor:"var(--nav-bullet-light-color)",[stylesMode.dark]:{bgcolor:"var(--nav-bullet-dark-color)"}}}},...e},...i,children:o})}function b({sx:e,children:a,disabled:o,...i}){return jsx(q,{component:"li",className:t.li,sx:{display:"flex",flexDirection:"column",...o&&{cursor:"not-allowed"},...e},...i,children:a})}function N({children:e,sx:a,...o}){return jsx(q,{component:"ul",className:t.ul,sx:{display:"flex",flexDirection:"column",...a},...o,children:e})}var fe=forwardRef(({href:e,...a},o)=>jsx(Link,{ref:o,to:e,...a}));function E({path:e,icon:a,info:o,depth:i,render:r,hasChild:s,externalLink:m,enabledRootRedirect:n}){let l=i===1,v=!l,c=Number(i)>2,d=s&&!n?{component:"div"}:m?{href:e,target:"_blank",rel:"noopener"}:{component:fe,href:e},g=null;a&&r?.navIcon&&typeof a=="string"?g=r?.navIcon[a]:g=a;let f=null;if(o&&r?.navInfo&&Array.isArray(o)){let[x,h]=o,y=r.navInfo(h)[x];f=y?cloneElement(y):null;}else f=o;return {subItem:v,rootItem:l,subDeepItem:c,baseProps:d,renderIcon:g,renderInfo:f}}var j=forwardRef(({path:e,icon:a,info:o,title:i,caption:r,open:s,depth:m,render:n,active:l,disabled:v,hasChild:c,slotProps:p,externalLink:d,enabledRootRedirect:g,...f},x)=>{let h=E({path:e,icon:a,info:o,depth:m,render:n,hasChild:c,externalLink:d,enabledRootRedirect:g});return jsxs(Je,{ref:x,"aria-label":i,depth:m,active:l,disabled:v,open:s&&!l,sx:{...p?.sx,[`& .${t.item.icon}`]:p?.icon,[`& .${t.item.title}`]:p?.title,[`& .${t.item.caption}`]:p?.caption,[`& .${t.item.info}`]:p?.info,[`& .${t.item.arrow}`]:p?.arrow},className:S({open:s&&!l,active:l,disabled:v}),...h.baseProps,...f,children:[a&&jsx(q,{component:"span",className:t.item.icon,children:h.renderIcon}),i&&jsx(q,{component:"span",className:t.item.title,children:i}),r&&jsx(Fe,{title:r,arrow:!0,children:jsx(he,{icon:"INFO_CIRCLE",className:t.item.caption})}),o&&jsx(q,{component:"span",className:t.item.info,children:h.renderInfo}),c&&jsx(he,{icon:h.subItem?"CHEVRON_RIGHT":"ARROW_DOWN_SIMPLE",className:t.item.arrow})]})}),Je=styled(Ge,{shouldForwardProp:e=>e!=="active"&&e!=="open"&&e!=="disabled"&&e!=="depth"})(({active:e,open:a,disabled:o,depth:i,theme:r})=>{let s=i===1,m=!s,n={item:{flexShrink:0,color:"var(--nav-item-color)",borderRadius:"var(--nav-item-radius)","&:hover":{backgroundColor:"var(--nav-item-hover-bg)"}},title:{...r.typography.body2,fontWeight:e?r.typography.fontWeightSemiBold:r.typography.fontWeightMedium},caption:{width:16,height:16,color:"var(--nav-item-caption-color)"},icon:{...u.icon,width:"var(--nav-icon-size)",height:"var(--nav-icon-size)"},arrow:{...u.arrow},info:{...u.info}};return {...s&&{...n.item,padding:"var(--nav-item-root-padding)",minHeight:"var(--nav-item-root-height)",[`& .${t.item.icon}`]:{...n.icon,margin:"var(--nav-icon-root-margin)"},[`& .${t.item.title}`]:{...n.title,whiteSpace:"nowrap"},[`& .${t.item.caption}`]:{...n.caption,marginLeft:r.spacing(.75)},[`& .${t.item.arrow}`]:{...n.arrow},[`& .${t.item.info}`]:{...n.info},...e&&{color:"var(--nav-item-root-active-color)",backgroundColor:"var(--nav-item-root-active-bg)","&:hover":{backgroundColor:"var(--nav-item-root-active-hover-bg)"},[stylesMode.dark]:{color:"var(--nav-item-root-active-color-on-dark)"}},...a&&{color:"var(--nav-item-root-open-color)",backgroundColor:"var(--nav-item-root-open-bg)"}},...m&&{...n.item,padding:"var(--nav-item-sub-padding)",minHeight:"var(--nav-item-sub-height)",color:r.vars.palette.text.secondary,[`& .${t.item.icon}`]:{...n.icon,margin:"var(--nav-icon-sub-margin)"},[`& .${t.item.title}`]:{...n.title,flexGrow:1},[`& .${t.item.caption}`]:{...n.caption},[`& .${t.item.arrow}`]:{...n.arrow,marginRight:r.spacing(-.5)},[`& .${t.item.info}`]:{...n.info},...e&&{color:"var(--nav-item-sub-active-color)",backgroundColor:"var(--nav-item-sub-active-bg)"},...a&&{color:"var(--nav-item-sub-open-color)",backgroundColor:"var(--nav-item-sub-open-bg)"}},...o&&u.disabled}});var ge=e=>{let a=e.split("?")[1];return a?new URLSearchParams(a).toString().length>0:!1};function ee(e){return e!=="/"&&e.endsWith("/")?e.slice(0,-1):e}function be(e){try{let a=new URL(e,window.location.origin);return ee(a.pathname)}catch{return e}}function I(e){return e.startsWith("http")}function T(e){return e.replace(window.location.origin,"")}function w(){let{pathname:e}=useLocation();return useMemo(()=>e,[e])}function W(e,a=!0){let o=ee(w()),i=ge(e);if(e.startsWith("#")||I(e))return !1;if(a||i){let m=o.includes(e),n=be(e);return m||i&&n===o}return o===e}function oe({data:e,depth:a,render:o,cssVars:i,slotProps:r,enabledRootRedirect:s}){let m=useTheme(),n=w(),l=useRef(null),v=W(e.path,!!e.children),[c,p]=useState(!1);useEffect(()=>{c&&g();},[n]);let d=useCallback(()=>{e.children&&p(!0);},[e.children]),g=useCallback(()=>{p(!1);},[]),f=jsx(j,{ref:l,render:o,title:e.title,path:e.path,icon:e.icon,info:e.info,caption:e.caption,depth:a,active:v,disabled:e.disabled,hasChild:!!e.children,open:e.children&&c,externalLink:I(e.path),enabledRootRedirect:s,slotProps:a===1?r?.rootItem:r?.subItem,onMouseEnter:d,onMouseLeave:g});return e.roles&&r?.currentRole&&!e?.roles?.includes(r?.currentRole)?null:e.children?jsxs(b,{disabled:e.disabled,children:[f,jsx(oo,{disableScrollLock:!0,open:c,anchorEl:l.current,anchorOrigin:a===1?{vertical:"bottom",horizontal:"left"}:{vertical:"center",horizontal:"right"},transformOrigin:a===1?{vertical:"top",horizontal:"left"}:{vertical:"center",horizontal:"left"},slotProps:{paper:{onMouseEnter:d,onMouseLeave:g,sx:{px:.75,boxShadow:"none",overflow:"unset",backdropFilter:"none",background:"transparent",...a===1&&{ml:-.75},...c&&{pointerEvents:"auto"}}}},sx:{...i,pointerEvents:"none"},children:jsx(eo,{className:t.paper,sx:{minWidth:180,...paper({theme:m,dropdown:!0}),...r?.paper},children:jsx(no,{data:e.children,depth:a,render:o,cssVars:i,slotProps:r,enabledRootRedirect:s})})})]}):jsx(b,{disabled:e.disabled,children:f})}function no({data:e,depth:a,render:o,cssVars:i,slotProps:r,enabledRootRedirect:s}){return jsx(N,{sx:{gap:.5},children:e.map(m=>jsx(oe,{data:m,render:o,depth:a+1,cssVars:i,slotProps:r,enabledRootRedirect:s},m.title))})}function un({sx:e,data:a,render:o,slotProps:i,enabledRootRedirect:r,cssVars:s}){let m=useTheme(),n={...k.horizontal(m),...s};return jsx(mo,{sx:{height:1},slotProps:{content:{height:1,display:"flex",alignItems:"center"}},children:jsx(io,{component:"nav",direction:"row",alignItems:"center",className:t.horizontal.root,sx:{...n,mx:"auto",height:1,minHeight:"var(--nav-height)",...e},children:jsx(N,{sx:{flexDirection:"row",gap:"var(--nav-item-gap)"},children:a.map(l=>jsx(lo,{render:o,cssVars:n,items:l.items,slotProps:i,enabledRootRedirect:r},l.subheader??l.items[0].title))})})})}function lo({items:e,render:a,slotProps:o,enabledRootRedirect:i,cssVars:r}){return jsx(b,{children:jsx(N,{sx:{flexDirection:"row",gap:"var(--nav-item-gap)"},children:e.map(s=>jsx(oe,{depth:1,data:s,render:a,cssVars:r,slotProps:o,enabledRootRedirect:i},s.title))})})}var re=forwardRef(({path:e,icon:a,info:o,title:i,caption:r,open:s,depth:m,render:n,active:l,disabled:v,hasChild:c,slotProps:p,externalLink:d,enabledRootRedirect:g,...f},x)=>{let h=E({path:e,icon:a,info:o,depth:m,render:n,hasChild:c,externalLink:d,enabledRootRedirect:g});return jsxs(go,{ref:x,"aria-label":i,depth:m,active:l,disabled:v,open:s&&!l,sx:{...p?.sx,[`& .${t.item.icon}`]:p?.icon,[`& .${t.item.title}`]:p?.title,[`& .${t.item.caption}`]:p?.caption,[`& .${t.item.info}`]:p?.info,[`& .${t.item.arrow}`]:p?.arrow},className:S({open:s&&!l,active:l,disabled:v}),...h.baseProps,...f,children:[a&&jsx(q,{component:"span",className:t.item.icon,children:h.renderIcon}),i&&jsx(q,{component:"span",className:t.item.title,children:i}),r&&jsx(Fe,{title:r,arrow:!0,placement:"right",children:jsx(he,{icon:"INFO_CIRCLE",className:t.item.caption})}),o&&h.subItem&&jsx(q,{component:"span",className:t.item.info,children:h.renderInfo})]})}),go=styled(Ge,{shouldForwardProp:e=>e!=="active"&&e!=="open"&&e!=="disabled"&&e!=="depth"})(({active:e,open:a,disabled:o,depth:i,theme:r})=>{let s=i===1,m=!s,n={item:{width:"100%",borderRadius:"var(--nav-item-radius)",color:"var(--nav-item-color)","&:hover":{backgroundColor:"var(--nav-item-hover-bg)"}},title:{},caption:{width:16,height:16,color:"var(--nav-item-caption-color)"},icon:{...u.icon,width:"var(--nav-icon-size)",height:"var(--nav-icon-size)"},arrow:{...u.arrow},info:{...u.info}};return {...s&&{...n.item,textAlign:"center",flexDirection:"column",width:48,minHeight:44,padding:"var(--nav-item-root-padding)",[`& .${t.item.icon}`]:{...n.icon},[`& .${t.item.title}`]:{...n.title,...u.noWrap,lineHeight:"16px",fontSize:r.typography.pxToRem(10),fontWeight:e?r.typography.fontWeightBold:r.typography.fontWeightSemiBold},[`& .${t.item.caption}`]:{...n.caption,top:11,left:6,position:"absolute"},[`& .${t.item.arrow}`]:{...n.arrow,top:11,right:6,position:"absolute"},[`& .${t.item.info}`]:{...n.info},...e&&{color:r.palette.primary.contrastText,backgroundColor:r.palette.primary.main,"&:hover":{backgroundColor:r.palette.primary.lighter},[stylesMode.dark]:{color:"var(--nav-item-root-active-color-on-dark)"}},...a&&{color:"var(--nav-item-root-open-color)",backgroundColor:"var(--nav-item-root-open-bg)"}},...m&&{...n.item,color:r.vars.palette.text.secondary,minHeight:"var(--nav-item-sub-height)",padding:"var(--nav-item-sub-padding)",[`& .${t.item.icon}`]:{...n.icon,margin:"var(--nav-icon-sub-margin)"},[`& .${t.item.title}`]:{...n.title,...r.typography.body2,fontWeight:e?r.typography.fontWeightSemiBold:r.typography.fontWeightMedium,flex:"1 1 auto"},[`& .${t.item.caption}`]:{...n.caption},[`& .${t.item.arrow}`]:{...n.arrow,marginRight:r.spacing(-.5)},[`& .${t.item.info}`]:{...n.info},...e&&{color:"var(--nav-item-sub-active-color)",backgroundColor:"var(--nav-item-sub-active-bg)"},...a&&{color:"var(--nav-item-sub-open-color)",backgroundColor:"var(--nav-item-sub-open-bg)"}},...o&&u.disabled}});var ne=({data:e,depth:a,render:o,cssVars:i,slotProps:r,enabledRootRedirect:s})=>{let m=useTheme(),n=w(),l=useRef(null),v=W(e.path,!!e.children),[c,p]=useState(!1);useEffect(()=>{c&&g();},[n]);let d=useCallback(()=>{e.children&&p(!0);},[e.children]),g=useCallback(()=>{p(!1);},[]),f=jsx(re,{ref:l,render:o,path:e.path,icon:e.icon,info:e.info,title:e.title,caption:e.caption,depth:a,active:v,disabled:e.disabled,hasChild:!!e.children,open:e.children&&c,externalLink:I(e.path),enabledRootRedirect:s,slotProps:a===1?r?.rootItem:r?.subItem,onMouseEnter:d,onMouseLeave:g});return e.roles&&r?.currentRole&&!e?.roles?.includes(r?.currentRole)?null:e.children?jsxs(b,{disabled:e.disabled,children:[f,jsx(oo,{disableScrollLock:!0,open:c,anchorEl:l.current,anchorOrigin:{vertical:"center",horizontal:"right"},transformOrigin:{vertical:"center",horizontal:"left"},slotProps:{paper:{onMouseEnter:d,onMouseLeave:g,sx:{px:.75,boxShadow:"none",overflow:"unset",backdropFilter:"none",background:"transparent",...a>1&&{mt:-1},...c&&{pointerEvents:"auto"}}}},sx:{...i,pointerEvents:"none"},children:jsx(eo,{className:t.paper,sx:{minWidth:180,...paper({theme:m,dropdown:!0}),...r?.paper},children:jsx(Co,{data:e.children,depth:a,render:o,cssVars:i,slotProps:r,enabledRootRedirect:s})})})]}):jsx(b,{disabled:e.disabled,children:f})};function Co({data:e,render:a,depth:o,slotProps:i,enabledRootRedirect:r,cssVars:s}){return jsx(N,{sx:{gap:.5},children:e.map(m=>jsx(ne,{data:m,render:a,depth:o+1,cssVars:s,slotProps:i,enabledRootRedirect:r},m.title))})}var Xn=({sx:e,data:a,render:o,slotProps:i,enabledRootRedirect:r,cssVars:s})=>{let m=useTheme(),n={...k.mini(m),...s};return jsx(io,{component:"nav",className:t.mini.root,sx:{...n,...e},children:jsx(N,{sx:{flex:"1 1 auto",gap:"var(--nav-item-gap)"},children:a.map(l=>jsx(Bo,{render:o,cssVars:n,items:l.items,slotProps:i,enabledRootRedirect:r},l.subheader??l.items[0].title))})})},Bo=({items:e,render:a,slotProps:o,enabledRootRedirect:i,cssVars:r})=>jsx(b,{children:jsx(N,{sx:{gap:"var(--nav-item-gap)"},children:e.map(s=>jsx(ne,{depth:1,data:s,render:a,cssVars:r,slotProps:o,enabledRootRedirect:i},s.title))})});function X({path:e,icon:a,info:o,depth:i,render:r,hasChild:s,externalLink:m,enabledRootRedirect:n,onNavigate:l}){let v=i===1,c=!v,p=Number(i)>2,g=s&&!n?{component:"div"}:m?{href:e,target:"_blank",rel:"noopener"}:{onClick:h=>l(h,e)},f=null;a&&r?.navIcon&&typeof a=="string"?f=r?.navIcon[a]:f=a;let x=null;if(o&&r?.navInfo&&Array.isArray(o)){let[h,y]=o,A=r.navInfo(y)[h];x=A?cloneElement(A):null;}else x=o;return {subItem:c,rootItem:v,subDeepItem:p,baseProps:g,renderIcon:f,renderInfo:x}}var ie=forwardRef(({path:e,icon:a,info:o,title:i,caption:r,open:s,depth:m,render:n,active:l,disabled:v,hasChild:c,slotProps:p,externalLink:d,enabledRootRedirect:g,onNavigate:f,...x},h)=>{let y=X({path:e,icon:a,info:o,depth:m,render:n,hasChild:c,externalLink:d,enabledRootRedirect:g,onNavigate:f});return jsxs(Vo,{ref:h,"aria-label":i,depth:m,active:l,disabled:v,open:s&&!l,sx:{...p?.sx,[`& .${t.item.icon}`]:p?.icon,[`& .${t.item.title}`]:p?.title,[`& .${t.item.caption}`]:p?.caption,[`& .${t.item.info}`]:p?.info,[`& .${t.item.arrow}`]:p?.arrow},className:S({open:s&&!l,active:l,disabled:v}),...y.baseProps,...x,...y.baseProps.onClick?{onClick:y.baseProps.onClick,style:{textAlign:"left"}}:{},children:[a&&jsx(q,{component:"span",className:t.item.icon,children:y.renderIcon}),i&&jsx(q,{component:"span",className:t.item.title,children:i}),r&&jsx(Fe,{title:r,arrow:!0,placement:"right",children:jsx(he,{icon:"INFO_CIRCLE",className:t.item.caption})}),o&&y.subItem&&jsx(q,{component:"span",className:t.item.info,children:y.renderInfo})]})}),Vo=styled(Ge,{shouldForwardProp:e=>e!=="active"&&e!=="open"&&e!=="disabled"&&e!=="depth"})(({active:e,open:a,disabled:o,depth:i,theme:r})=>{let s=i===1,m=!s,n={item:{width:"100%",borderRadius:"var(--nav-item-radius)",color:"var(--nav-item-color)","&:hover":{backgroundColor:"var(--nav-item-hover-bg)"}},title:{},caption:{width:16,height:16,color:"var(--nav-item-caption-color)"},icon:{...u.icon,width:"var(--nav-icon-size)",height:"var(--nav-icon-size)"},arrow:{...u.arrow},info:{...u.info}};return {...s&&{...n.item,textAlign:"center",flexDirection:"column",width:48,minHeight:44,padding:"var(--nav-item-root-padding)",[`& .${t.item.icon}`]:{...n.icon},[`& .${t.item.title}`]:{...n.title,...u.noWrap,lineHeight:"16px",fontSize:r.typography.pxToRem(10),fontWeight:e?r.typography.fontWeightBold:r.typography.fontWeightSemiBold},[`& .${t.item.caption}`]:{...n.caption,top:11,left:6,position:"absolute"},[`& .${t.item.arrow}`]:{...n.arrow,top:11,right:6,position:"absolute"},[`& .${t.item.info}`]:{...n.info},...e&&{color:r.palette.primary.contrastText,backgroundColor:r.palette.primary.main,"&:hover":{backgroundColor:r.palette.primary.lighter},[stylesMode.dark]:{color:"var(--nav-item-root-active-color-on-dark)"}},...a&&{color:"var(--nav-item-root-open-color)",backgroundColor:"var(--nav-item-root-open-bg)"}},...m&&{...n.item,color:r.vars.palette.text.secondary,minHeight:"var(--nav-item-sub-height)",padding:"var(--nav-item-sub-padding)",[`& .${t.item.icon}`]:{...n.icon,margin:"var(--nav-icon-sub-margin)"},[`& .${t.item.title}`]:{...n.title,...r.typography.body2,fontWeight:e?r.typography.fontWeightSemiBold:r.typography.fontWeightMedium,flex:"1 1 auto"},[`& .${t.item.caption}`]:{...n.caption},[`& .${t.item.arrow}`]:{...n.arrow,marginRight:r.spacing(-.5)},[`& .${t.item.info}`]:{...n.info},...e&&{color:"var(--nav-item-sub-active-color)",backgroundColor:"var(--nav-item-sub-active-bg)"},...a&&{color:"var(--nav-item-sub-open-color)",backgroundColor:"var(--nav-item-sub-open-bg)"}},...o&&u.disabled}});var se=({data:e,depth:a,render:o,cssVars:i,slotProps:r,enabledRootRedirect:s,onNavigate:m,pathname:n})=>{let l=useTheme(),v=useRef(null),c=I(e.path),p=T(e.path),d=!!matchPath({path:p||"",end:!c},n),g=Array.isArray(e.children)?e.children.some(Be=>matchPath({path:T(Be.path)||"",end:!c},n)):d,[f,x]=useState(!1);useEffect(()=>{f&&y();},[n]);let h=useCallback(()=>{e.children&&x(!0);},[e.children]),y=useCallback(()=>{x(!1);},[]),A=jsx(ie,{ref:v,render:o,path:e.path,icon:e.icon,info:e.info,title:e.title,caption:e.caption,depth:a,active:g,disabled:e.disabled,hasChild:!!e.children,open:e.children&&f,externalLink:!1,enabledRootRedirect:s,slotProps:a===1?r?.rootItem:r?.subItem,onMouseEnter:h,onMouseLeave:y,onNavigate:m});return e.roles&&r?.currentRole&&!e?.roles?.includes(r?.currentRole)?null:e.children?jsxs(b,{disabled:e.disabled,children:[A,jsx(oo,{disableScrollLock:!0,open:f,anchorEl:v.current,anchorOrigin:{vertical:"center",horizontal:"right"},transformOrigin:{vertical:"center",horizontal:"left"},slotProps:{paper:{onMouseEnter:h,onMouseLeave:y,sx:{px:.75,boxShadow:"none",overflow:"unset",backdropFilter:"none",background:"transparent",...a>1&&{mt:-1},...f&&{pointerEvents:"auto"}}}},sx:{...i,pointerEvents:"none"},children:jsx(eo,{className:t.paper,sx:{minWidth:180,...paper({theme:l,dropdown:!0}),...r?.paper},children:jsx(Jo,{data:e.children,depth:a,render:o,cssVars:i,slotProps:r,enabledRootRedirect:s,onNavigate:m,pathname:n})})})]}):jsx(b,{disabled:e.disabled,children:A})};function Jo({data:e,render:a,depth:o,slotProps:i,enabledRootRedirect:r,cssVars:s,onNavigate:m,pathname:n}){return jsx(N,{sx:{gap:.5},children:e.map(l=>jsx(se,{data:l,render:a,depth:o+1,cssVars:s,slotProps:i,enabledRootRedirect:r,onNavigate:m,pathname:n},l.title))})}var Wa=({sx:e,data:a,render:o,slotProps:i,enabledRootRedirect:r,cssVars:s,onNavigate:m,pathname:n})=>{let l=useTheme(),v={...k.mini(l),...s};return jsx(io,{component:"nav",className:t.mini.root,sx:{...v,...e},children:jsx(N,{sx:{flex:"1 1 auto",gap:"var(--nav-item-gap)",alignItems:"center",justifyContent:"center"},children:a.map(c=>jsxs(Fragment,{children:[c.subheader&&jsx(Fragment,{children:jsx(Xo,{sx:{my:2},flexItem:!0})}),jsx(jo,{render:o,cssVars:v,items:c.items,slotProps:i,enabledRootRedirect:r,onNavigate:m,pathname:n})]},c.subheader??c.items[0].title))})})},jo=({items:e,render:a,slotProps:o,enabledRootRedirect:i,cssVars:r,onNavigate:s,pathname:m})=>jsx(b,{children:jsx(N,{sx:{gap:"var(--nav-item-gap)"},children:e.map(n=>jsx(se,{depth:1,data:n,render:a,cssVars:r,slotProps:o,enabledRootRedirect:i,onNavigate:s,pathname:m},n.title))})});var me=forwardRef(({path:e,icon:a,info:o,title:i,caption:r,open:s,depth:m,render:n,active:l,disabled:v,hasChild:c,slotProps:p,externalLink:d,enabledRootRedirect:g,...f},x)=>{let h=E({path:e,icon:a,info:o,depth:m,render:n,hasChild:c,externalLink:d,enabledRootRedirect:g});return jsxs(st,{ref:x,"aria-label":i,depth:m,active:l,disabled:v,open:s&&!l,sx:{...p?.sx,[`& .${t.item.icon}`]:p?.icon,[`& .${t.item.texts}`]:p?.texts,[`& .${t.item.title}`]:p?.title,[`& .${t.item.caption}`]:p?.caption,[`& .${t.item.info}`]:p?.info,[`& .${t.item.arrow}`]:p?.arrow},className:S({open:s&&!l,active:l,disabled:v}),...h.baseProps,...f,children:[a&&jsx(q,{component:"span",className:t.item.icon,children:h.renderIcon}),i&&jsxs(q,{component:"span",className:t.item.texts,children:[jsx(q,{component:"span",className:t.item.title,children:i}),r&&jsx(Fe,{title:r,placement:"top-start",children:jsx(q,{component:"span",className:t.item.caption,children:r})})]}),o&&jsx(q,{component:"span",className:t.item.info,children:h.renderInfo}),c&&jsx(he,{icon:s?"ARROW_DOWN_SIMPLE":"CHEVRON_LEFT",className:t.item.arrow})]})}),st=styled(Ge,{shouldForwardProp:e=>e!=="active"&&e!=="open"&&e!=="disabled"&&e!=="depth"})(({active:e,open:a,disabled:o,depth:i,theme:r})=>{let s=i===1,m=!s,n={item:{width:"100%",paddingTop:"var(--nav-item-pt)",paddingLeft:"var(--nav-item-pl)",paddingRight:"var(--nav-item-pr)",paddingBottom:"var(--nav-item-pb)",borderRadius:"var(--nav-item-radius)",color:"var(--nav-item-color)","&:hover":{backgroundColor:"var(--nav-item-hover-bg)"}},texts:{minWidth:0,flex:"1 1 auto"},title:{...u.noWrap,...r.typography.body2,fontWeight:e?r.typography.fontWeightSemiBold:r.typography.fontWeightMedium},caption:{...u.noWrap,...r.typography.caption,color:"var(--nav-item-caption-color)"},icon:{...u.icon,width:"var(--nav-icon-size)",height:"var(--nav-icon-size)",margin:"var(--nav-icon-margin)"},arrow:{...u.arrow},info:{...u.info}};return {...s&&{...n.item,minHeight:"var(--nav-item-root-height)",[`& .${t.item.icon}`]:{...n.icon},[`& .${t.item.texts}`]:{...n.texts},[`& .${t.item.title}`]:{...n.title},[`& .${t.item.caption}`]:{...n.caption},[`& .${t.item.arrow}`]:{...n.arrow},[`& .${t.item.info}`]:{...n.info},...e&&{color:"var(--nav-item-root-active-color)",backgroundColor:"var(--nav-item-root-active-bg)","&:hover":{backgroundColor:"var(--nav-item-root-active-hover-bg)"},[stylesMode.dark]:{color:"var(--nav-item-root-active-color-on-dark)"}},...a&&{color:"var(--nav-item-root-open-color)",backgroundColor:"var(--nav-item-root-open-bg)"}},...m&&{...n.item,minHeight:"var(--nav-item-sub-height)",[`& .${t.item.icon}`]:{...n.icon},[`& .${t.item.texts}`]:{...n.texts},[`& .${t.item.title}`]:{...n.title},[`& .${t.item.caption}`]:{...n.caption},[`& .${t.item.arrow}`]:{...n.arrow},[`& .${t.item.info}`]:{...n.info},"&::before":{left:0,content:'""',position:"absolute",width:"var(--nav-bullet-size)",height:"var(--nav-bullet-size)",transform:"translate(calc(var(--nav-bullet-size) * -1), calc(var(--nav-bullet-size) * -0.4))",backgroundColor:"var(--nav-bullet-light-color)",mask:`url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' fill='none' viewBox='0 0 14 14'%3E%3Cpath d='M1 1v4a8 8 0 0 0 8 8h4' stroke='%23efefef' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat 50% 50%/100% auto`,WebkitMask:`url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' fill='none' viewBox='0 0 14 14'%3E%3Cpath d='M1 1v4a8 8 0 0 0 8 8h4' stroke='%23efefef' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat 50% 50%/100% auto`,[stylesMode.dark]:{backgroundColor:"var(--nav-bullet-dark-color)"}},...e&&{color:"var(--nav-item-sub-active-color)",backgroundColor:"var(--nav-item-sub-active-bg)"},...a&&{color:"var(--nav-item-sub-open-color)",backgroundColor:"var(--nav-item-sub-open-bg)"}},...o&&u.disabled}});var le=({data:e,render:a,depth:o,slotProps:i,enabledRootRedirect:r})=>{let s=w(),m=W(e.path,!!e.children),[n,l]=useState(m);useEffect(()=>{m||c();},[s]);let v=useCallback(()=>{e.children&&l(d=>!d);},[e.children]),c=useCallback(()=>{l(!1);},[]),p=jsx(me,{render:a,path:e.path,icon:e.icon,info:e.info,title:e.title,caption:e.caption,depth:o,active:m,disabled:e.disabled,hasChild:!!e.children,open:e.children&&n,externalLink:I(e.path),enabledRootRedirect:r,slotProps:o===1?i?.rootItem:i?.subItem,onClick:v});return e.roles&&i?.currentRole&&!e?.roles?.includes(i?.currentRole)?null:e.children?jsxs(b,{disabled:e.disabled,sx:{[`& .${t.li}`]:{"&:first-of-type":{mt:"var(--nav-item-gap)"}}},children:[p,jsx(Q,{"data-group":e.title,in:n,depth:o,unmountOnExit:!0,mountOnEnter:!0,children:jsx(pt,{data:e.children,render:a,depth:o,slotProps:i,enabledRootRedirect:r})})]}):jsx(b,{disabled:e.disabled,children:p})},pt=({data:e,render:a,depth:o,slotProps:i,enabledRootRedirect:r})=>jsx(N,{sx:{gap:"var(--nav-item-gap)"},children:e.map(s=>jsx(le,{data:s,render:a,depth:o+1,slotProps:i,enabledRootRedirect:r},s.title))});var gi=({sx:e,data:a,render:o,slotProps:i,enabledRootRedirect:r,cssVars:s})=>{let m=useTheme(),n={...k.vertical(m),...s};return jsx(io,{component:"nav",className:t.vertical.root,sx:{...n,...e},children:jsx(N,{sx:{flex:"1 1 auto",gap:"var(--nav-item-gap)"},children:a.map(l=>jsx(gt,{subheader:l.subheader,items:l.items,render:o,slotProps:i,enabledRootRedirect:r},l.subheader??l.items[0].title))})})},gt=({items:e,render:a,subheader:o,slotProps:i,enabledRootRedirect:r})=>{let[s,m]=useState(!0),n=useCallback(()=>{m(v=>!v);},[]),l=jsx(N,{sx:{gap:"var(--nav-item-gap)"},children:e.map(v=>jsx(le,{data:v,render:a,depth:1,slotProps:i,enabledRootRedirect:r},v.title))});return jsx(b,{children:o?jsxs(Fragment,{children:[jsx(K,{"data-title":o,open:s,onClick:n,sx:i?.subheader,children:o}),jsx(Me,{in:s,children:l})]}):l})};var pe=forwardRef(({path:e,icon:a,info:o,title:i,caption:r,open:s,depth:m,render:n,active:l,disabled:v,hasChild:c,slotProps:p,externalLink:d,enabledRootRedirect:g,onNavigate:f,...x},h)=>{let y=X({path:e,icon:a,info:o,depth:m,render:n,hasChild:c,externalLink:d,enabledRootRedirect:g,onNavigate:f});return jsxs(wt,{ref:h,"aria-label":i,depth:m,active:l,disabled:v,open:s&&!l,sx:{...p?.sx,[`& .${t.item.icon}`]:p?.icon,[`& .${t.item.texts}`]:p?.texts,[`& .${t.item.title}`]:p?.title,[`& .${t.item.caption}`]:p?.caption,[`& .${t.item.info}`]:p?.info,[`& .${t.item.arrow}`]:p?.arrow},className:S({open:s&&!l,active:l,disabled:v}),...y.baseProps,...x,...y.baseProps.onClick?{onClick:y.baseProps.onClick,style:{textAlign:"left"}}:{},children:[a&&jsx(q,{component:"span",className:t.item.icon,children:y.renderIcon}),i&&jsxs(q,{component:"span",className:t.item.texts,children:[jsx(q,{component:"span",className:t.item.title,children:i}),r&&jsx(Fe,{title:r,placement:"top-start",children:jsx(q,{component:"span",className:t.item.caption,children:r})})]}),o&&jsx(q,{component:"span",className:t.item.info,children:y.renderInfo}),c&&jsx(he,{icon:s?"ARROW_DOWN_SIMPLE":"CHEVRON_RIGHT",className:t.item.arrow})]})}),wt=styled(Ge,{shouldForwardProp:e=>e!=="active"&&e!=="open"&&e!=="disabled"&&e!=="depth"})(({active:e,open:a,disabled:o,depth:i,theme:r})=>{let s=i===1,m=!s,n={item:{width:"100%",paddingTop:"var(--nav-item-pt)",paddingLeft:"var(--nav-item-pl)",paddingRight:"var(--nav-item-pr)",paddingBottom:"var(--nav-item-pb)",borderRadius:"var(--nav-item-radius)",color:"var(--nav-item-color)","&:hover":{backgroundColor:"var(--nav-item-hover-bg)"}},texts:{minWidth:0,flex:"1 1 auto"},title:{...u.noWrap,...r.typography.body2,fontWeight:e?r.typography.fontWeightSemiBold:r.typography.fontWeightMedium},caption:{...u.noWrap,...r.typography.caption,color:"var(--nav-item-caption-color)"},icon:{...u.icon,width:"var(--nav-icon-size)",height:"var(--nav-icon-size)",margin:"var(--nav-icon-margin)"},arrow:{...u.arrow},info:{...u.info}};return {...s&&{...n.item,minHeight:"var(--nav-item-root-height)",[`& .${t.item.icon}`]:{...n.icon},[`& .${t.item.texts}`]:{...n.texts},[`& .${t.item.title}`]:{...n.title},[`& .${t.item.caption}`]:{...n.caption},[`& .${t.item.arrow}`]:{...n.arrow},[`& .${t.item.info}`]:{...n.info},...e&&{color:"var(--nav-item-root-active-color)",backgroundColor:"var(--nav-item-root-active-bg)","&:hover":{backgroundColor:"var(--nav-item-root-active-hover-bg)"},[stylesMode.dark]:{color:"var(--nav-item-root-active-color-on-dark)"}},...a&&{color:"var(--nav-item-root-open-color)",backgroundColor:"var(--nav-item-root-open-bg)"}},...m&&{...n.item,minHeight:"var(--nav-item-sub-height)",[`& .${t.item.icon}`]:{...n.icon},[`& .${t.item.texts}`]:{...n.texts},[`& .${t.item.title}`]:{...n.title},[`& .${t.item.caption}`]:{...n.caption},[`& .${t.item.arrow}`]:{...n.arrow},[`& .${t.item.info}`]:{...n.info},"&::before":{left:0,content:'""',position:"absolute",width:"var(--nav-bullet-size)",height:"var(--nav-bullet-size)",transform:"translate(calc(var(--nav-bullet-size) * -1), calc(var(--nav-bullet-size) * -0.4))",backgroundColor:"var(--nav-bullet-light-color)",mask:`url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' fill='none' viewBox='0 0 14 14'%3E%3Cpath d='M1 1v4a8 8 0 0 0 8 8h4' stroke='%23efefef' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat 50% 50%/100% auto`,WebkitMask:`url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' fill='none' viewBox='0 0 14 14'%3E%3Cpath d='M1 1v4a8 8 0 0 0 8 8h4' stroke='%23efefef' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat 50% 50%/100% auto`,[stylesMode.dark]:{backgroundColor:"var(--nav-bullet-dark-color)"}},...e&&{color:"var(--nav-item-sub-active-color)",backgroundColor:"var(--nav-item-sub-active-bg)"},...a&&{color:"var(--nav-item-sub-open-color)",backgroundColor:"var(--nav-item-sub-open-bg)"}},...o&&u.disabled}});var ce=({data:e,render:a,depth:o,slotProps:i,enabledRootRedirect:r,onNavigate:s,pathname:m})=>{let n=I(e.path),l=T(e.path),v=!!matchPath({path:l||"",end:!n},m),c=Array.isArray(e.children)?e.children.some(h=>matchPath({path:T(h.path)||"",end:!n},m)):v,[p,d]=useState(c);useEffect(()=>{c||f();},[m]);let g=useCallback(()=>{e.children&&d(h=>!h);},[e.children]),f=useCallback(()=>{d(!1);},[]),x=jsx(pe,{render:a,path:e.path,icon:e.icon,info:e.info,title:e.title,caption:e.caption,depth:o,active:c,disabled:e.disabled,hasChild:!!e.children,open:e.children&&p,externalLink:!1,enabledRootRedirect:r,slotProps:o===1?i?.rootItem:i?.subItem,onClick:g,onNavigate:s});return e.roles&&i?.currentRole&&!e?.roles?.includes(i?.currentRole)?null:e.children?jsxs(b,{disabled:e.disabled,sx:{[`& .${t.li}`]:{"&:first-of-type":{mt:"var(--nav-item-gap)"}}},children:[x,jsx(Q,{"data-group":e.title,in:p,depth:o,unmountOnExit:!0,mountOnEnter:!0,children:jsx(Pt,{data:e.children,render:a,depth:o,slotProps:i,enabledRootRedirect:r,onNavigate:s,pathname:m})})]}):jsx(b,{disabled:e.disabled,children:x})},Pt=({data:e,render:a,depth:o,slotProps:i,enabledRootRedirect:r,onNavigate:s,pathname:m})=>jsx(N,{sx:{gap:"var(--nav-item-gap)"},children:e.map(n=>jsx(ce,{data:n,render:a,depth:o+1,slotProps:i,enabledRootRedirect:r,onNavigate:s,pathname:m},n.title))});var Yi=({sx:e,data:a,render:o,slotProps:i,enabledRootRedirect:r,cssVars:s,onNavigate:m,pathname:n})=>{let l=useTheme(),v={...k.vertical(l),...s};return jsx(io,{component:"nav",className:t.vertical.root,sx:{...v,...e},children:jsx(N,{sx:{flex:"1 1 auto",gap:"var(--nav-item-gap)"},children:a.map(c=>jsx(Tt,{subheader:c.subheader,items:c.items,render:o,renderEmptyView:c.renderEmptyView,slotProps:i,enabledRootRedirect:r,onNavigate:m,pathname:n},c.subheader??c.items[0].title))})})},Tt=({items:e,render:a,renderEmptyView:o,subheader:i,slotProps:r,enabledRootRedirect:s,onNavigate:m,pathname:n})=>{let[l,v]=useState(!0),c=useCallback(()=>{v(d=>!d);},[]),p=o&&e.length===0?o():jsx(N,{sx:{gap:"var(--nav-item-gap)"},children:e.map(d=>jsx(ce,{data:d,render:a,depth:1,slotProps:r,enabledRootRedirect:s,onNavigate:m,pathname:n},d.title))});return jsx(b,{children:i?jsxs(Fragment,{children:[jsx(K,{"data-title":i,open:l,onClick:c,sx:r?.subheader,children:i}),jsx(Me,{in:l,children:p})]}):p})};
19
19
 
20
20
  export { Q as NavCollapse, b as NavLi, un as NavSectionHorizontal, j as NavSectionHorizontalItem, Xn as NavSectionMini, ie as NavSectionMiniButtonItem, re as NavSectionMiniItem, Wa as NavSectionMiniWithButtons, gi as NavSectionVertical, pe as NavSectionVerticalButtonItem, me as NavSectionVerticalItem, Yi as NavSectionVerticalWithButtons, N as NavUl, K as Subheader, ue as bulletColor, t as navSectionClasses, k as navSectionCssVars, u as sharedStyles, S as stateClasses, E as useNavItem };
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "2.1.8",
2
+ "version": "2.1.9",
3
3
  "name": "@zydon/common-csr",
4
4
  "description": "Zydon common resources for React projects (only Client-Side Rendering (CSR))",
5
5
  "license": "MIT",