@mui-toolpad-extended-tuni/core 3.3.1 → 3.3.2

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.
package/dist/index.cjs CHANGED
@@ -120,7 +120,7 @@ export default theme;`}function am(e){return typeof e=="number"?`${(e*100).toFix
120
120
  `))}v[m]={}}}};Object.keys(w.components).forEach(v=>{const g=w.components[v].styleOverrides;g&&v.startsWith("Mui")&&y(g,v)})}return w.unstable_sxConfig={...ws,...h==null?void 0:h.unstable_sxConfig},w.unstable_sx=function(y){return Si({sx:y,theme:this})},w.toRuntimeSource=Sy,eR(w),w}function tR(e){let t;return e<1?t=5.11916*e**2:t=4.5*Math.log(e+1)+2,Math.round(t*10)/1e3}const nR=[...Array(25)].map((e,t)=>{if(t===0)return"none";const n=tR(t);return`linear-gradient(rgba(255 255 255 / ${n}), rgba(255 255 255 / ${n}))`});function Ey(e){return{inputPlaceholder:e==="dark"?.5:.42,inputUnderline:e==="dark"?.7:.42,switchTrackDisabled:e==="dark"?.2:.12,switchTrack:e==="dark"?.3:.38}}function Oy(e){return e==="dark"?nR:[]}function rR(e){const{palette:t={mode:"light"},opacity:n,overlays:i,colorSpace:s,...a}=e,u=gf({...t,colorSpace:s});return{palette:u,opacity:{...Ey(u.mode),...n},overlays:i||Oy(u.mode),...a}}function iR(e){var t;return!!e[0].match(/(cssVarPrefix|colorSchemeSelector|modularCssLayers|rootSelector|typography|mixins|breakpoints|direction|transitions)/)||!!e[0].match(/sxConfig$/)||e[0]==="palette"&&!!((t=e[1])!=null&&t.match(/(mode|contrastThreshold|tonalOffset)/))}const oR=e=>[...[...Array(25)].map((t,n)=>`--${e?`${e}-`:""}overlays-${n}`),`--${e?`${e}-`:""}palette-AppBar-darkBg`,`--${e?`${e}-`:""}palette-AppBar-darkColor`],sR=e=>(t,n)=>{const i=e.rootSelector||":root",s=e.colorSchemeSelector;let a=s;if(s==="class"&&(a=".%s"),s==="data"&&(a="[data-%s]"),s!=null&&s.startsWith("data-")&&!s.includes("%s")&&(a=`[${s}="%s"]`),e.defaultColorScheme===t){if(t==="dark"){const u={};return oR(e.cssVarPrefix).forEach(c=>{u[c]=n[c],delete n[c]}),a==="media"?{[i]:n,"@media (prefers-color-scheme: dark)":{[i]:u}}:a?{[a.replace("%s",t)]:u,[`${i}, ${a.replace("%s",t)}`]:n}:{[i]:{...n,...u}}}if(a&&a!=="media")return`${i}, ${a.replace("%s",String(t))}`}else if(t){if(a==="media")return{[`@media (prefers-color-scheme: ${String(t)})`]:{[i]:n}};if(a)return a.replace("%s",String(t))}return i};function aR(e,t){t.forEach(n=>{e[n]||(e[n]={})})}function ne(e,t,n){!e[t]&&n&&(e[t]=n)}function Qo(e){return typeof e!="string"||!e.startsWith("hsl")?e:my(e)}function fr(e,t){`${t}Channel`in e||(e[`${t}Channel`]=Ko(Qo(e[t]),`MUI: Can't create \`palette.${t}Channel\` because \`palette.${t}\` is not one of these formats: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla(), color().
121
121
  To suppress this warning, you need to explicitly provide the \`palette.${t}Channel\` as a string (in rgb format, for example "12 12 12") or undefined if you want to remove the channel token.`))}function uR(e){return typeof e=="number"?`${e}px`:typeof e=="string"||typeof e=="function"||Array.isArray(e)?e:"8px"}const qn=e=>{try{return e()}catch{}},lR=(e="mui")=>T_(e);function gc(e,t,n,i,s){if(!n)return;n=n===!0?{}:n;const a=s==="dark"?"dark":"light";if(!i){t[s]=rR({...n,palette:{mode:a,...n==null?void 0:n.palette},colorSpace:e});return}const{palette:u,...c}=kc({...i,palette:{mode:a,...n==null?void 0:n.palette},colorSpace:e});return t[s]={...n,palette:u,opacity:{...Ey(a),...n==null?void 0:n.opacity},overlays:(n==null?void 0:n.overlays)||Oy(a)},c}function cR(e={},...t){const{colorSchemes:n={light:!0},defaultColorScheme:i,disableCssColorScheme:s=!1,cssVarPrefix:a="mui",nativeColor:u=!1,shouldSkipGeneratingVar:c=iR,colorSchemeSelector:f=n.light&&n.dark?"media":void 0,rootSelector:p=":root",...h}=e,x=Object.keys(n)[0],R=i||(n.light&&x!=="light"?"light":x),w=lR(a),{[R]:C,light:y,dark:v,...g}=n,m={...g};let S=C;if((R==="dark"&&!("dark"in n)||R==="light"&&!("light"in n))&&(S=!0),!S)throw new Error(process.env.NODE_ENV!=="production"?`MUI: The \`colorSchemes.${R}\` option is either missing or invalid.`:ls(21,R));let E;u&&(E="oklch");const T=gc(E,m,S,h,R);y&&!m.light&&gc(E,m,y,void 0,"light"),v&&!m.dark&&gc(E,m,v,void 0,"dark");let M={defaultColorScheme:R,...T,cssVarPrefix:a,colorSchemeSelector:f,rootSelector:p,getCssVar:w,colorSchemes:m,font:{...z_(T.typography),...T.font},spacing:uR(h.spacing)};Object.keys(M.colorSchemes).forEach(Z=>{const _=M.colorSchemes[Z].palette,H=K=>{const q=K.split("-"),X=q[1],fe=q[2];return w(K,_[X][fe])};_.mode==="light"&&(ne(_.common,"background","#fff"),ne(_.common,"onBackground","#000")),_.mode==="dark"&&(ne(_.common,"background","#000"),ne(_.common,"onBackground","#fff"));function B(K,q,X){if(E){let fe;return K===ri&&(fe=`transparent ${((1-X)*100).toFixed(0)}%`),K===tt&&(fe=`#000 ${(X*100).toFixed(0)}%`),K===nt&&(fe=`#fff ${(X*100).toFixed(0)}%`),`color-mix(in ${E}, ${q}, ${fe})`}return K(q,X)}if(aR(_,["Alert","AppBar","Avatar","Button","Chip","FilledInput","LinearProgress","Skeleton","Slider","SnackbarContent","SpeedDialAction","StepConnector","StepContent","Switch","TableCell","Tooltip"]),_.mode==="light"){ne(_.Alert,"errorColor",B(tt,_.error.light,.6)),ne(_.Alert,"infoColor",B(tt,_.info.light,.6)),ne(_.Alert,"successColor",B(tt,_.success.light,.6)),ne(_.Alert,"warningColor",B(tt,_.warning.light,.6)),ne(_.Alert,"errorFilledBg",H("palette-error-main")),ne(_.Alert,"infoFilledBg",H("palette-info-main")),ne(_.Alert,"successFilledBg",H("palette-success-main")),ne(_.Alert,"warningFilledBg",H("palette-warning-main")),ne(_.Alert,"errorFilledColor",qn(()=>_.getContrastText(_.error.main))),ne(_.Alert,"infoFilledColor",qn(()=>_.getContrastText(_.info.main))),ne(_.Alert,"successFilledColor",qn(()=>_.getContrastText(_.success.main))),ne(_.Alert,"warningFilledColor",qn(()=>_.getContrastText(_.warning.main))),ne(_.Alert,"errorStandardBg",B(nt,_.error.light,.9)),ne(_.Alert,"infoStandardBg",B(nt,_.info.light,.9)),ne(_.Alert,"successStandardBg",B(nt,_.success.light,.9)),ne(_.Alert,"warningStandardBg",B(nt,_.warning.light,.9)),ne(_.Alert,"errorIconColor",H("palette-error-main")),ne(_.Alert,"infoIconColor",H("palette-info-main")),ne(_.Alert,"successIconColor",H("palette-success-main")),ne(_.Alert,"warningIconColor",H("palette-warning-main")),ne(_.AppBar,"defaultBg",H("palette-grey-100")),ne(_.Avatar,"defaultBg",H("palette-grey-400")),ne(_.Button,"inheritContainedBg",H("palette-grey-300")),ne(_.Button,"inheritContainedHoverBg",H("palette-grey-A100")),ne(_.Chip,"defaultBorder",H("palette-grey-400")),ne(_.Chip,"defaultAvatarColor",H("palette-grey-700")),ne(_.Chip,"defaultIconColor",H("palette-grey-700")),ne(_.FilledInput,"bg","rgba(0, 0, 0, 0.06)"),ne(_.FilledInput,"hoverBg","rgba(0, 0, 0, 0.09)"),ne(_.FilledInput,"disabledBg","rgba(0, 0, 0, 0.12)"),ne(_.LinearProgress,"primaryBg",B(nt,_.primary.main,.62)),ne(_.LinearProgress,"secondaryBg",B(nt,_.secondary.main,.62)),ne(_.LinearProgress,"errorBg",B(nt,_.error.main,.62)),ne(_.LinearProgress,"infoBg",B(nt,_.info.main,.62)),ne(_.LinearProgress,"successBg",B(nt,_.success.main,.62)),ne(_.LinearProgress,"warningBg",B(nt,_.warning.main,.62)),ne(_.Skeleton,"bg",E?B(ri,_.text.primary,.11):`rgba(${H("palette-text-primaryChannel")} / 0.11)`),ne(_.Slider,"primaryTrack",B(nt,_.primary.main,.62)),ne(_.Slider,"secondaryTrack",B(nt,_.secondary.main,.62)),ne(_.Slider,"errorTrack",B(nt,_.error.main,.62)),ne(_.Slider,"infoTrack",B(nt,_.info.main,.62)),ne(_.Slider,"successTrack",B(nt,_.success.main,.62)),ne(_.Slider,"warningTrack",B(nt,_.warning.main,.62));const K=E?B(tt,_.background.default,.6825):Ta(_.background.default,.8);ne(_.SnackbarContent,"bg",K),ne(_.SnackbarContent,"color",qn(()=>E?Ac.text.primary:_.getContrastText(K))),ne(_.SpeedDialAction,"fabHoverBg",Ta(_.background.paper,.15)),ne(_.StepConnector,"border",H("palette-grey-400")),ne(_.StepContent,"border",H("palette-grey-400")),ne(_.Switch,"defaultColor",H("palette-common-white")),ne(_.Switch,"defaultDisabledColor",H("palette-grey-100")),ne(_.Switch,"primaryDisabledColor",B(nt,_.primary.main,.62)),ne(_.Switch,"secondaryDisabledColor",B(nt,_.secondary.main,.62)),ne(_.Switch,"errorDisabledColor",B(nt,_.error.main,.62)),ne(_.Switch,"infoDisabledColor",B(nt,_.info.main,.62)),ne(_.Switch,"successDisabledColor",B(nt,_.success.main,.62)),ne(_.Switch,"warningDisabledColor",B(nt,_.warning.main,.62)),ne(_.TableCell,"border",B(nt,B(ri,_.divider,1),.88)),ne(_.Tooltip,"bg",B(ri,_.grey[700],.92))}if(_.mode==="dark"){ne(_.Alert,"errorColor",B(nt,_.error.light,.6)),ne(_.Alert,"infoColor",B(nt,_.info.light,.6)),ne(_.Alert,"successColor",B(nt,_.success.light,.6)),ne(_.Alert,"warningColor",B(nt,_.warning.light,.6)),ne(_.Alert,"errorFilledBg",H("palette-error-dark")),ne(_.Alert,"infoFilledBg",H("palette-info-dark")),ne(_.Alert,"successFilledBg",H("palette-success-dark")),ne(_.Alert,"warningFilledBg",H("palette-warning-dark")),ne(_.Alert,"errorFilledColor",qn(()=>_.getContrastText(_.error.dark))),ne(_.Alert,"infoFilledColor",qn(()=>_.getContrastText(_.info.dark))),ne(_.Alert,"successFilledColor",qn(()=>_.getContrastText(_.success.dark))),ne(_.Alert,"warningFilledColor",qn(()=>_.getContrastText(_.warning.dark))),ne(_.Alert,"errorStandardBg",B(tt,_.error.light,.9)),ne(_.Alert,"infoStandardBg",B(tt,_.info.light,.9)),ne(_.Alert,"successStandardBg",B(tt,_.success.light,.9)),ne(_.Alert,"warningStandardBg",B(tt,_.warning.light,.9)),ne(_.Alert,"errorIconColor",H("palette-error-main")),ne(_.Alert,"infoIconColor",H("palette-info-main")),ne(_.Alert,"successIconColor",H("palette-success-main")),ne(_.Alert,"warningIconColor",H("palette-warning-main")),ne(_.AppBar,"defaultBg",H("palette-grey-900")),ne(_.AppBar,"darkBg",H("palette-background-paper")),ne(_.AppBar,"darkColor",H("palette-text-primary")),ne(_.Avatar,"defaultBg",H("palette-grey-600")),ne(_.Button,"inheritContainedBg",H("palette-grey-800")),ne(_.Button,"inheritContainedHoverBg",H("palette-grey-700")),ne(_.Chip,"defaultBorder",H("palette-grey-700")),ne(_.Chip,"defaultAvatarColor",H("palette-grey-300")),ne(_.Chip,"defaultIconColor",H("palette-grey-300")),ne(_.FilledInput,"bg","rgba(255, 255, 255, 0.09)"),ne(_.FilledInput,"hoverBg","rgba(255, 255, 255, 0.13)"),ne(_.FilledInput,"disabledBg","rgba(255, 255, 255, 0.12)"),ne(_.LinearProgress,"primaryBg",B(tt,_.primary.main,.5)),ne(_.LinearProgress,"secondaryBg",B(tt,_.secondary.main,.5)),ne(_.LinearProgress,"errorBg",B(tt,_.error.main,.5)),ne(_.LinearProgress,"infoBg",B(tt,_.info.main,.5)),ne(_.LinearProgress,"successBg",B(tt,_.success.main,.5)),ne(_.LinearProgress,"warningBg",B(tt,_.warning.main,.5)),ne(_.Skeleton,"bg",E?B(ri,_.text.primary,.13):`rgba(${H("palette-text-primaryChannel")} / 0.13)`),ne(_.Slider,"primaryTrack",B(tt,_.primary.main,.5)),ne(_.Slider,"secondaryTrack",B(tt,_.secondary.main,.5)),ne(_.Slider,"errorTrack",B(tt,_.error.main,.5)),ne(_.Slider,"infoTrack",B(tt,_.info.main,.5)),ne(_.Slider,"successTrack",B(tt,_.success.main,.5)),ne(_.Slider,"warningTrack",B(tt,_.warning.main,.5));const K=E?B(nt,_.background.default,.985):Ta(_.background.default,.98);ne(_.SnackbarContent,"bg",K),ne(_.SnackbarContent,"color",qn(()=>E?wy.text.primary:_.getContrastText(K))),ne(_.SpeedDialAction,"fabHoverBg",Ta(_.background.paper,.15)),ne(_.StepConnector,"border",H("palette-grey-600")),ne(_.StepContent,"border",H("palette-grey-600")),ne(_.Switch,"defaultColor",H("palette-grey-300")),ne(_.Switch,"defaultDisabledColor",H("palette-grey-600")),ne(_.Switch,"primaryDisabledColor",B(tt,_.primary.main,.55)),ne(_.Switch,"secondaryDisabledColor",B(tt,_.secondary.main,.55)),ne(_.Switch,"errorDisabledColor",B(tt,_.error.main,.55)),ne(_.Switch,"infoDisabledColor",B(tt,_.info.main,.55)),ne(_.Switch,"successDisabledColor",B(tt,_.success.main,.55)),ne(_.Switch,"warningDisabledColor",B(tt,_.warning.main,.55)),ne(_.TableCell,"border",B(tt,B(ri,_.divider,1),.68)),ne(_.Tooltip,"bg",B(ri,_.grey[700],.92))}fr(_.background,"default"),fr(_.background,"paper"),fr(_.common,"background"),fr(_.common,"onBackground"),fr(_,"divider"),Object.keys(_).forEach(K=>{const q=_[K];K!=="tonalOffset"&&q&&typeof q=="object"&&(q.main&&ne(_[K],"mainChannel",Ko(Qo(q.main))),q.light&&ne(_[K],"lightChannel",Ko(Qo(q.light))),q.dark&&ne(_[K],"darkChannel",Ko(Qo(q.dark))),q.contrastText&&ne(_[K],"contrastTextChannel",Ko(Qo(q.contrastText))),K==="text"&&(fr(_[K],"primary"),fr(_[K],"secondary")),K==="action"&&(q.active&&fr(_[K],"active"),q.selected&&fr(_[K],"selected")))})}),M=t.reduce((Z,_)=>bi(Z,_),M);const D={prefix:a,disableCssColorScheme:s,shouldSkipGeneratingVar:c,getSelector:sR(M),enableContrastVars:u},{vars:A,generateThemeVars:z,generateStyleSheets:J}=R_(M,D);return M.vars=A,Object.entries(M.colorSchemes[M.defaultColorScheme]).forEach(([Z,_])=>{M[Z]=_}),M.generateThemeVars=z,M.generateStyleSheets=J,M.generateSpacing=function(){return ly(h.spacing,df(this))},M.getColorSchemeSelector=D_(f),M.spacing=M.generateSpacing(),M.shouldSkipGeneratingVar=c,M.unstable_sxConfig={...ws,...h==null?void 0:h.unstable_sxConfig},M.unstable_sx=function(_){return Si({sx:_,theme:this})},M.toRuntimeSource=Sy,M}function um(e,t,n){e.colorSchemes&&n&&(e.colorSchemes[t]={...n!==!0&&n,palette:gf({...n===!0?{}:n.palette,mode:t})})}function Ty(e={},...t){const{palette:n,cssVariables:i=!1,colorSchemes:s=n?void 0:{light:!0},defaultColorScheme:a=n==null?void 0:n.mode,...u}=e,c=a||"light",f=s==null?void 0:s[c],p={...s,...n?{[c]:{...typeof f!="boolean"&&f,palette:n}}:void 0};if(i===!1){if(!("colorSchemes"in e))return kc(e,...t);let h=n;"palette"in e||p[c]&&(p[c]!==!0?h=p[c].palette:c==="dark"&&(h={mode:"dark"}));const x=kc({...e,palette:h},...t);return x.defaultColorScheme=c,x.colorSchemes=p,x.palette.mode==="light"&&(x.colorSchemes.light={...p.light!==!0&&p.light,palette:x.palette},um(x,"dark",p.dark)),x.palette.mode==="dark"&&(x.colorSchemes.dark={...p.dark!==!0&&p.dark,palette:x.palette},um(x,"light",p.light)),x}return!n&&!("light"in p)&&c==="light"&&(p.light=!0),cR({...u,colorSchemes:p,defaultColorScheme:c,...typeof i!="boolean"&&i},...t)}const Cy=Ty(),yf="$$material";function xs(){const e=cy(Cy);return process.env.NODE_ENV!=="production"&&oe.useDebugValue(e),e[yf]||e}function fR(e){return e!=="ownerState"&&e!=="theme"&&e!=="sx"&&e!=="as"}const _y=e=>fR(e)&&e!=="classes",Lt=d_({themeId:yf,defaultTheme:Cy,rootShouldForwardProp:_y}),Cn=O_;process.env.NODE_ENV!=="production"&&(b.node,b.object.isRequired);function xr(e){return E_(e)}function Qn(e,t,n="Mui"){const i={};return t.forEach(s=>{i[s]=Kn(e,s,n)}),i}function dR(e){return Kn("MuiSvgIcon",e)}Qn("MuiSvgIcon",["root","colorPrimary","colorSecondary","colorAction","colorError","colorDisabled","fontSizeInherit","fontSizeSmall","fontSizeMedium","fontSizeLarge"]);const pR=e=>{const{color:t,fontSize:n,classes:i}=e,s={root:["root",t!=="inherit"&&`color${fn(t)}`,`fontSize${fn(n)}`]};return jr(s,dR,i)},hR=Lt("svg",{name:"MuiSvgIcon",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.color!=="inherit"&&t[`color${fn(n.color)}`],t[`fontSize${fn(n.fontSize)}`]]}})(Cn(({theme:e})=>{var t,n,i,s,a,u,c,f,p,h,x,R,w,C;return{userSelect:"none",width:"1em",height:"1em",display:"inline-block",flexShrink:0,transition:(s=(t=e.transitions)==null?void 0:t.create)==null?void 0:s.call(t,"fill",{duration:(i=(n=(e.vars??e).transitions)==null?void 0:n.duration)==null?void 0:i.shorter}),variants:[{props:y=>!y.hasSvgAsChild,style:{fill:"currentColor"}},{props:{fontSize:"inherit"},style:{fontSize:"inherit"}},{props:{fontSize:"small"},style:{fontSize:((u=(a=e.typography)==null?void 0:a.pxToRem)==null?void 0:u.call(a,20))||"1.25rem"}},{props:{fontSize:"medium"},style:{fontSize:((f=(c=e.typography)==null?void 0:c.pxToRem)==null?void 0:f.call(c,24))||"1.5rem"}},{props:{fontSize:"large"},style:{fontSize:((h=(p=e.typography)==null?void 0:p.pxToRem)==null?void 0:h.call(p,35))||"2.1875rem"}},...Object.entries((e.vars??e).palette).filter(([,y])=>y&&y.main).map(([y])=>{var v,g;return{props:{color:y},style:{color:(g=(v=(e.vars??e).palette)==null?void 0:v[y])==null?void 0:g.main}}}),{props:{color:"action"},style:{color:(R=(x=(e.vars??e).palette)==null?void 0:x.action)==null?void 0:R.active}},{props:{color:"disabled"},style:{color:(C=(w=(e.vars??e).palette)==null?void 0:w.action)==null?void 0:C.disabled}},{props:{color:"inherit"},style:{color:void 0}}]}})),Qa=oe.forwardRef(function(t,n){const i=xr({props:t,name:"MuiSvgIcon"}),{children:s,className:a,color:u="inherit",component:c="svg",fontSize:f="medium",htmlColor:p,inheritViewBox:h=!1,titleAccess:x,viewBox:R="0 0 24 24",...w}=i,C=oe.isValidElement(s)&&s.type==="svg",y={...i,color:u,component:c,fontSize:f,instanceFontSize:t.fontSize,inheritViewBox:h,viewBox:R,hasSvgAsChild:C},v={};h||(v.viewBox=R);const g=pR(y);return F.jsxs(hR,{as:c,className:at(g.root,a),focusable:"false",color:p,"aria-hidden":x?void 0:!0,role:x?"img":void 0,ref:n,...v,...w,...C&&s.props,ownerState:y,children:[C?s.props.children:s,x?F.jsx("title",{children:x}):null]})});process.env.NODE_ENV!=="production"&&(Qa.propTypes={children:b.node,classes:b.object,className:b.string,color:b.oneOfType([b.oneOf(["inherit","action","disabled","primary","secondary","error","info","success","warning"]),b.string]),component:b.elementType,fontSize:b.oneOfType([b.oneOf(["inherit","large","medium","small"]),b.string]),htmlColor:b.string,inheritViewBox:b.bool,shapeRendering:b.string,sx:b.oneOfType([b.arrayOf(b.oneOfType([b.func,b.object,b.bool])),b.func,b.object]),titleAccess:b.string,viewBox:b.string});Qa.muiName="SvgIcon";function jt(e,t){function n(i,s){return F.jsx(Qa,{"data-testid":process.env.NODE_ENV!=="production"?`${t}Icon`:void 0,ref:s,...i,children:e})}return process.env.NODE_ENV!=="production"&&(n.displayName=`${t}Icon`),n.muiName=Qa.muiName,oe.memo(oe.forwardRef(n))}function mR(e,t){var n,i,s;return oe.isValidElement(e)&&t.indexOf(e.type.muiName??((s=(i=(n=e.type)==null?void 0:n._payload)==null?void 0:i.value)==null?void 0:s.muiName))!==-1}function lm(e){return e&&e.ownerDocument||document}function cm(e,t){typeof e=="function"?e(t):e&&(e.current=t)}const fs=typeof window<"u"?oe.useLayoutEffect:oe.useEffect;let fm=0;function gR(e){const[t,n]=oe.useState(e),i=e||t;return oe.useEffect(()=>{t==null&&(fm+=1,n(`mui-${fm}`))},[t]),i}const yR={...oe},dm=yR.useId;function vR(e){if(dm!==void 0){const t=dm();return e??t}return gR(e)}function Ry(e){const{controlled:t,default:n,name:i,state:s="value"}=e,{current:a}=oe.useRef(t!==void 0),[u,c]=oe.useState(n),f=a?t:u;if(process.env.NODE_ENV!=="production"){oe.useEffect(()=>{a!==(t!==void 0)&&console.error([`MUI: A component is changing the ${a?"":"un"}controlled ${s} state of ${i} to be ${a?"un":""}controlled.`,"Elements should not switch from uncontrolled to controlled (or vice versa).",`Decide between using a controlled or uncontrolled ${i} element for the lifetime of the component.`,"The nature of the state is determined during the first render. It's considered controlled if the value is not `undefined`.","More info: https://fb.me/react-controlled-components"].join(`
122
122
  `))},[s,i,t]);const{current:h}=oe.useRef(n);oe.useEffect(()=>{!a&&JSON.stringify(n)!==JSON.stringify(h)&&console.error([`MUI: A component is changing the default ${s} state of an uncontrolled ${i} after being initialized. To suppress this warning opt to use a controlled ${i}.`].join(`
123
- `))},[JSON.stringify(n)])}const p=oe.useCallback(h=>{a||c(h)},[]);return[f,p]}function to(e){const t=oe.useRef(e);return fs(()=>{t.current=e}),oe.useRef((...n)=>(0,t.current)(...n)).current}function Fn(...e){const t=oe.useRef(void 0),n=oe.useCallback(i=>{const s=e.map(a=>{if(a==null)return null;if(typeof a=="function"){const u=a,c=u(i);return typeof c=="function"?c:()=>{u(null)}}return a.current=i,()=>{a.current=null}});return()=>{s.forEach(a=>a==null?void 0:a())}},e);return oe.useMemo(()=>e.every(i=>i==null)?null:i=>{t.current&&(t.current(),t.current=void 0),i!=null&&(t.current=n(i))},e)}function bR(e,t){const n=e.charCodeAt(2);return e[0]==="o"&&e[1]==="n"&&n>=65&&n<=90&&typeof t=="function"}function wR(e,t){if(!e)return t;function n(u,c){const f={};return Object.keys(c).forEach(p=>{bR(p,c[p])&&typeof u[p]=="function"&&(f[p]=(...h)=>{u[p](...h),c[p](...h)})}),f}if(typeof e=="function"||typeof t=="function")return u=>{const c=typeof t=="function"?t(u):t,f=typeof e=="function"?e({...u,...c}):e,p=at(u==null?void 0:u.className,c==null?void 0:c.className,f==null?void 0:f.className),h=n(f,c);return{...c,...f,...h,...!!p&&{className:p},...(c==null?void 0:c.style)&&(f==null?void 0:f.style)&&{style:{...c.style,...f.style}},...(c==null?void 0:c.sx)&&(f==null?void 0:f.sx)&&{sx:[...Array.isArray(c.sx)?c.sx:[c.sx],...Array.isArray(f.sx)?f.sx:[f.sx]]}}};const i=t,s=n(e,i),a=at(i==null?void 0:i.className,e==null?void 0:e.className);return{...t,...e,...s,...!!a&&{className:a},...(i==null?void 0:i.style)&&(e==null?void 0:e.style)&&{style:{...i.style,...e.style}},...(i==null?void 0:i.sx)&&(e==null?void 0:e.sx)&&{sx:[...Array.isArray(i.sx)?i.sx:[i.sx],...Array.isArray(e.sx)?e.sx:[e.sx]]}}}const xR=jt(F.jsx("path",{d:"M10 18h4v-2h-4zM3 6v2h18V6zm3 7h12v-2H6z"}),"FilterList"),SR=()=>{const e=xs(),[t,n]=j.useState(null),{sectionOrder:i,setVisibleSections:s,recalculateNavigation:a}=gr(),{filterOptions:u,setFilterOptions:c}=Br(),f=j.useMemo(()=>({...u}),[u]);j.useEffect(()=>{const R={...u};let w=!1;i.forEach(g=>{u[g]===void 0&&(R[g]=g==="Courses",w=!0)});const C=w?R:u,y=gr.getState().visibleSections,v=JSON.stringify(y)!==JSON.stringify(C);(w||v)&&(w&&c(R),s(C))},[i,u,c,s]);const p=j.useCallback(R=>{R.preventDefault(),R.stopPropagation(),n(R.currentTarget)},[]),h=j.useCallback(()=>{n(null)},[]),x=j.useCallback((R,w)=>{R.preventDefault(),R.stopPropagation();const C={...u,[w]:!u[w]};c(C),s(C),a()},[u,c,s,a]);return Object.keys(f).length===0?null:F.jsxs(me.Box,{children:[F.jsx(me.Tooltip,{title:"Filter navigation sections",children:F.jsx(me.IconButton,{disabled:Object.keys(f).length===0,onClick:p,size:"small",children:F.jsx(xR,{htmlColor:Object.keys(f).length===0?e.palette.text.disabled:e.palette.text.primary})})}),F.jsx(me.Menu,{anchorEl:t,open:!!t,onClose:h,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},children:Object.keys(f).map(R=>F.jsxs(me.MenuItem,{onClick:w=>x(w,R),children:[F.jsx(me.Checkbox,{checked:f[R]}),F.jsx(me.ListItemText,{primary:R})]},R))})]})},ER=({sections:e})=>{const{addSection:t,recalculateNavigation:n}=gr(),i=j.useRef([]),s=j.useMemo(()=>e.map(a=>({underHeader:a.underHeader,keepVisible:a.keepVisible,pages:a.pages.map(u=>({segment:u.segment,title:u.title,Icon:u.Icon,instances:u.instances,description:u.description,microservices:u.microservices,actionFC:u.actionFC}))})),[e]);return j.useEffect(()=>()=>{},[]),j.useEffect(()=>{Pc.isEqual(i.current,s)||(s.forEach(a=>{t(a)}),n(),i.current=s)},[s,t,n]),null},OR=({heading:e,subheading:t})=>F.jsxs(F.Fragment,{children:[F.jsx(me.Typography,{variant:"h1",sx:{textAlign:"center",mt:5,color:"text.secondary"},children:e}),t&&F.jsx(me.Typography,{variant:"h4",sx:{textAlign:"center",mt:2,color:"text.secondary"},children:t})]});let pm=0,hm=0;const mm=500,gm=200,ym=5,TR=({direction:e,itemSize:t,itemsPerPage:n=1,itemCount:i})=>{const s=j.useRef(null),[a,u]=j.useState(!1),[c,f]=j.useState(!1),[p,h]=j.useState(!1),[x,R]=j.useState(!1),[w,C]=j.useState({pos:0,scroll:0}),[y,v]=j.useState(0),[g,m]=j.useState(1),S=j.useRef(null),E=j.useRef(null);j.useEffect(()=>{const q=s.current;if(!q)return;let X=null;const fe=()=>{const ue=s.current;if(!ue)return;const ye=e==="horizontal",pe=ye?ue.scrollLeft:ue.scrollTop,Oe=i??ue.children.length,Te=5;if(ye){const ve=Math.max(1,Math.round((ue.clientWidth+Te)/t)),ee=Math.max(1,Oe-ve+1),ce=Math.min(Math.floor(pe/t),ee-1);m(ee),v(ce),u(ce>0),f(ce<ee-1)}else{const ve=Math.max(1,Math.round((ue.clientHeight+Te)/t)),ee=Math.max(1,Oe-ve+1),ce=Math.min(Math.floor(pe/t),ee-1);m(ee),v(ce),u(ce>0),f(ce<ee-1)}},ae=()=>{X===null&&(X=setTimeout(()=>{X=null,fe()},100))},Y=new ResizeObserver(fe);Y.observe(q),q.addEventListener("scroll",ae);const $=new MutationObserver(fe);return $.observe(q,{childList:!0,subtree:!0}),requestAnimationFrame(()=>{requestAnimationFrame(fe)}),()=>{q.removeEventListener("scroll",ae),Y.disconnect(),$.disconnect(),X&&clearTimeout(X)}},[e,t,n,i]),j.useEffect(()=>{const q=s.current;if(!q||!i)return;const X=e==="horizontal"?q.scrollLeft:q.scrollTop,fe=Math.max(1,Math.ceil(i/n)),ae=Math.min(Math.floor(X/t),fe-1);m(fe),v(ae),u(ae>0),f(ae<fe-1)},[i,n,t,e]);const T=j.useCallback(()=>{const q=s.current;if(!q)return;const X=e==="horizontal",fe=X?q.scrollLeft:q.scrollTop,ae=Math.round(fe/t)*t;q.style.scrollBehavior="smooth",X?q.scrollLeft=ae:q.scrollTop=ae},[e,t]);j.useEffect(()=>{const q=X=>{X.preventDefault(),p&&(h(!1),T()),E.current&&(clearTimeout(E.current),E.current=null)};return window.addEventListener("mouseup",q),()=>window.removeEventListener("mouseup",q)},[p,T]);const M=q=>{const X=s.current;if(!X)return;const ae=(e==="horizontal"?X.scrollLeft:X.scrollTop)+(q?t:-t);X.style.scrollBehavior="smooth",e==="horizontal"?X.scrollLeft=ae:X.scrollTop=ae},D=q=>{M(q==="end")},A=q=>{if(!s.current)return;const X=q*t;s.current.style.scrollBehavior="smooth",e==="horizontal"?s.current.scrollLeft=X:s.current.scrollTop=X},z=q=>{q.preventDefault(),R(!1);const X=e==="horizontal"?q.pageX:q.pageY,fe=e==="horizontal"?s.current.scrollLeft:s.current.scrollTop;C({pos:X,scroll:fe}),S.current=null,s.current&&(s.current.style.scrollBehavior="auto"),E.current=window.setTimeout(()=>{h(!0),E.current=null},gm)},J=q=>{if(!s.current)return;if(q.buttons===0){h(!1),E.current&&(clearTimeout(E.current),E.current=null);return}const X=e==="horizontal"?q.pageX:q.pageY,fe=w.pos-X;if(Math.abs(fe)>ym){R(!0),p||(h(!0),E.current&&(clearTimeout(E.current),E.current=null));const ae=performance.now();if(e==="horizontal"){if(ae-hm<mm)return;pm=ae}else{if(ae-pm<mm)return;hm=ae}const Y=fe>0?"end":"start";Y!==S.current&&(S.current=Y,D(Y))}},Z=q=>{s.current&&(q.preventDefault(),h(!1),S.current=null,E.current&&(clearTimeout(E.current),E.current=null),T())},_=q=>{const X=q.touches[0],fe=e==="horizontal"?X.pageX:X.pageY,ae=e==="horizontal"?s.current.scrollLeft:s.current.scrollTop;R(!1),C({pos:fe,scroll:ae}),E.current=window.setTimeout(()=>{h(!0),E.current=null},gm)},H=q=>{if(!s.current)return;const X=q.touches[0],fe=e==="horizontal"?X.pageX:X.pageY,ae=w.pos-fe;Math.abs(ae)>ym&&(R(!0),p||(h(!0),E.current&&(clearTimeout(E.current),E.current=null)),q.preventDefault(),e==="horizontal"?s.current.scrollLeft=w.scroll+ae:s.current.scrollTop=w.scroll+ae)},B=()=>{h(!1),E.current&&(clearTimeout(E.current),E.current=null),s.current&&x&&T()},K=g>1;return{containerRef:s,showStartButton:a,showEndButton:c,isDragging:p,hasDragged:x,setHasDragged:R,scroll:D,handleMouseDown:z,handleMouseMove:J,handleMouseUp:Z,currentPage:y,totalPages:g,scrollToPage:A,disableStartButton:!a,disableEndButton:!c,handleTouchStart:_,handleTouchMove:H,handleTouchEnd:B,canScroll:K}},CR=jt(F.jsx("path",{d:"M7.41 15.41 12 10.83l4.59 4.58L18 14l-6-6-6 6z"}),"KeyboardArrowUp"),_R=jt(F.jsx("path",{d:"M7.41 8.59 12 13.17l4.59-4.58L18 10l-6 6-6-6z"}),"KeyboardArrowDown"),RR=jt(F.jsx("path",{d:"M15.41 7.41 14 6l-6 6 6 6 1.41-1.41L10.83 12z"}),"ChevronLeft"),DR=jt(F.jsx("path",{d:"M10 6 8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z"}),"ChevronRight"),vm=({total:e,current:t,onDotClick:n,vertical:i=!1,onArrowClick:s,disableStart:a=!1,disableEnd:u=!1})=>{const c=Math.max(0,e);return c<=0?null:F.jsxs(me.Box,{"data-testid":"pagination-dots",sx:{width:"fit-content",display:"flex",alignItems:"center",borderRadius:1,...i?{flexDirection:"column"}:{flexDirection:"row"}},children:[F.jsx(me.IconButton,{size:"small",disabled:a,onClick:()=>!a&&(s==null?void 0:s("start")),sx:{p:.5,opacity:a?0:1,transition:"opacity 0.2s ease"},children:i?F.jsx(CR,{}):F.jsx(RR,{})}),F.jsx(me.Box,{sx:{display:"flex",flexDirection:i?"column":"row",gap:.5},children:Array.from({length:c}).map((f,p)=>F.jsx(me.Box,{onClick:h=>{h.stopPropagation(),n==null||n(p)},sx:{width:6,height:6,borderRadius:"50%",bgcolor:t===p?"primary.main":"action.disabled",transition:"all 0.2s ease",cursor:n?"pointer":"default","&:hover":n?{transform:"scale(1.2)",bgcolor:t===p?"primary.dark":"primary.light"}:{}}},p))}),F.jsx(me.IconButton,{size:"small",onClick:()=>!u&&(s==null?void 0:s("end")),disabled:u,sx:{p:.5,opacity:u?0:1,transition:"opacity 0.2s ease"},children:i?F.jsx(_R,{}):F.jsx(DR,{})})]})},Dy=j.createContext({itemCounts:{horizontal:1,vertical:1},setItemCounts:()=>{}}),My=({children:e})=>{const[t,n]=j.useState({horizontal:1,vertical:1});return F.jsx(Dy.Provider,{value:{itemCounts:t,setItemCounts:n},children:e})},Py=()=>{const e=j.useContext(Dy);if(!e)throw new Error("useResizeContext must be used within a ResizeProvider");return e},MR=25,pi=({direction:e,children:t,itemSize:n,containerSize:i="100%",hideScrollbar:s=!0,snapScroll:a=!0,title:u,priority:c})=>{const{itemCounts:f}=Py(),p=e==="vertical"?f.vertical:f.horizontal,{containerRef:h,showStartButton:x,showEndButton:R,isDragging:w,hasDragged:C,scroll:y,handleMouseDown:v,handleMouseMove:g,handleMouseUp:m,currentPage:S,totalPages:E,scrollToPage:T,disableStartButton:M,disableEndButton:D,handleTouchStart:A,handleTouchMove:z,handleTouchEnd:J,canScroll:Z,setHasDragged:_}=TR({direction:e,itemSize:n,itemsPerPage:p}),H=e==="vertical",B=()=>u?F.jsx(me.Typography,{variant:"h6",sx:{color:c==="high"?"primary.main":c==="low"?"text.secondary":"text.primary"},children:u}):null;let K={zIndex:1,padding:1,width:"100%",height:"100%",display:"flex",overflow:"hidden",position:"relative",flexDirection:H?"column":"row",cursor:w?"grabbing":"grab",touchAction:H?"pan-y":"pan-x",scrollSnapType:a?"x mandatory":"none",scrollbarWidth:s?"none":"auto",userSelect:"none",scrollBehavior:"smooth",WebkitOverflowScrolling:"touch",msOverflowStyle:"none","&::-webkit-scrollbar":{display:s?"none":"auto"}};H&&(K={...K,"& > div":{scrollSnapAlign:a?"start":"none",minHeight:n,flex:"0 0 auto",height:n,willChange:"transform"}});const q={onMouseDown:v,onMouseMove:g,onMouseUp:m,onMouseLeave:m,onTouchStart:A,onTouchMove:z,onTouchEnd:J,onClickCapture:X=>{C&&(X.stopPropagation(),X.preventDefault(),_(!1))}};return F.jsxs(me.Box,{sx:{display:"flex",flexDirection:"column",height:i,width:"100%"},children:[B(),H?F.jsxs(me.Box,{sx:{display:"flex",flexDirection:"row",height:"100%"},children:[F.jsx(me.Box,{"data-testid":"reel-container",ref:h,sx:K,...q,children:t}),F.jsx(me.Box,{"data-testid":"pagination-dots-container",sx:{width:MR,display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center"},children:F.jsx(vm,{total:E,current:S,onDotClick:T,onArrowClick:y,vertical:!0,showArrows:x||R,disableStart:M,disableEnd:D})})]}):F.jsxs(me.Box,{sx:{display:"flex",flexDirection:"column",height:"100%"},children:[F.jsx(me.Box,{ref:h,sx:K,...q,children:j.Children.map(t,X=>F.jsx(me.Box,{"data-testid":"reel-item",sx:{width:n,scrollSnapAlign:"start",display:"flex",flexShrink:0},children:X}))}),F.jsx(vm,{total:E,current:S,onDotClick:T,onArrowClick:y,showArrows:Z,disableStart:M,disableEnd:D})]})]})},PR=me.keyframes`
123
+ `))},[JSON.stringify(n)])}const p=oe.useCallback(h=>{a||c(h)},[]);return[f,p]}function to(e){const t=oe.useRef(e);return fs(()=>{t.current=e}),oe.useRef((...n)=>(0,t.current)(...n)).current}function Fn(...e){const t=oe.useRef(void 0),n=oe.useCallback(i=>{const s=e.map(a=>{if(a==null)return null;if(typeof a=="function"){const u=a,c=u(i);return typeof c=="function"?c:()=>{u(null)}}return a.current=i,()=>{a.current=null}});return()=>{s.forEach(a=>a==null?void 0:a())}},e);return oe.useMemo(()=>e.every(i=>i==null)?null:i=>{t.current&&(t.current(),t.current=void 0),i!=null&&(t.current=n(i))},e)}function bR(e,t){const n=e.charCodeAt(2);return e[0]==="o"&&e[1]==="n"&&n>=65&&n<=90&&typeof t=="function"}function wR(e,t){if(!e)return t;function n(u,c){const f={};return Object.keys(c).forEach(p=>{bR(p,c[p])&&typeof u[p]=="function"&&(f[p]=(...h)=>{u[p](...h),c[p](...h)})}),f}if(typeof e=="function"||typeof t=="function")return u=>{const c=typeof t=="function"?t(u):t,f=typeof e=="function"?e({...u,...c}):e,p=at(u==null?void 0:u.className,c==null?void 0:c.className,f==null?void 0:f.className),h=n(f,c);return{...c,...f,...h,...!!p&&{className:p},...(c==null?void 0:c.style)&&(f==null?void 0:f.style)&&{style:{...c.style,...f.style}},...(c==null?void 0:c.sx)&&(f==null?void 0:f.sx)&&{sx:[...Array.isArray(c.sx)?c.sx:[c.sx],...Array.isArray(f.sx)?f.sx:[f.sx]]}}};const i=t,s=n(e,i),a=at(i==null?void 0:i.className,e==null?void 0:e.className);return{...t,...e,...s,...!!a&&{className:a},...(i==null?void 0:i.style)&&(e==null?void 0:e.style)&&{style:{...i.style,...e.style}},...(i==null?void 0:i.sx)&&(e==null?void 0:e.sx)&&{sx:[...Array.isArray(i.sx)?i.sx:[i.sx],...Array.isArray(e.sx)?e.sx:[e.sx]]}}}const xR=jt(F.jsx("path",{d:"M10 18h4v-2h-4zM3 6v2h18V6zm3 7h12v-2H6z"}),"FilterList"),SR=()=>{const e=xs(),[t,n]=j.useState(null),{sectionOrder:i,setVisibleSections:s,recalculateNavigation:a}=gr(),{filterOptions:u,setFilterOptions:c}=Br(),f=j.useMemo(()=>({...u}),[u]);j.useEffect(()=>{const R={...u};let w=!1;i.forEach(g=>{u[g]===void 0&&(R[g]=g==="Courses",w=!0)});const C=w?R:u,y=gr.getState().visibleSections,v=JSON.stringify(y)!==JSON.stringify(C);(w||v)&&(w&&c(R),s(C))},[i,u,c,s]);const p=j.useCallback(R=>{R.preventDefault(),R.stopPropagation(),n(R.currentTarget)},[]),h=j.useCallback(()=>{n(null)},[]),x=j.useCallback((R,w)=>{R.preventDefault(),R.stopPropagation();const C={...u,[w]:!u[w]};c(C),s(C),a()},[u,c,s,a]);return Object.keys(f).length===0?null:F.jsxs(me.Box,{children:[F.jsx(me.Tooltip,{title:"Filter navigation sections",children:F.jsx(me.IconButton,{disabled:Object.keys(f).length===0,onClick:p,size:"small",children:F.jsx(xR,{htmlColor:Object.keys(f).length===0?e.palette.text.disabled:e.palette.text.primary})})}),F.jsx(me.Menu,{anchorEl:t,open:!!t,onClose:h,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},children:Object.keys(f).map(R=>F.jsxs(me.MenuItem,{onClick:w=>x(w,R),children:[F.jsx(me.Checkbox,{checked:f[R]}),F.jsx(me.ListItemText,{primary:R})]},R))})]})},ER=({sections:e})=>{const{addSection:t,recalculateNavigation:n}=gr(),i=j.useRef([]),s=j.useMemo(()=>e.map(a=>({underHeader:a.underHeader,keepVisible:a.keepVisible,pages:a.pages.map(u=>({segment:u.segment,title:u.title,Icon:u.Icon,instances:u.instances,description:u.description,microservices:u.microservices,actionFC:u.actionFC}))})),[e]);return j.useEffect(()=>()=>{},[]),j.useEffect(()=>{Pc.isEqual(i.current,s)||(s.forEach(a=>{t(a)}),n(),i.current=s)},[s]),null},OR=({heading:e,subheading:t})=>F.jsxs(F.Fragment,{children:[F.jsx(me.Typography,{variant:"h1",sx:{textAlign:"center",mt:5,color:"text.secondary"},children:e}),t&&F.jsx(me.Typography,{variant:"h4",sx:{textAlign:"center",mt:2,color:"text.secondary"},children:t})]});let pm=0,hm=0;const mm=500,gm=200,ym=5,TR=({direction:e,itemSize:t,itemsPerPage:n=1,itemCount:i})=>{const s=j.useRef(null),[a,u]=j.useState(!1),[c,f]=j.useState(!1),[p,h]=j.useState(!1),[x,R]=j.useState(!1),[w,C]=j.useState({pos:0,scroll:0}),[y,v]=j.useState(0),[g,m]=j.useState(1),S=j.useRef(null),E=j.useRef(null);j.useEffect(()=>{const q=s.current;if(!q)return;let X=null;const fe=()=>{const ue=s.current;if(!ue)return;const ye=e==="horizontal",pe=ye?ue.scrollLeft:ue.scrollTop,Oe=i??ue.children.length,Te=5;if(ye){const ve=Math.max(1,Math.round((ue.clientWidth+Te)/t)),ee=Math.max(1,Oe-ve+1),ce=Math.min(Math.floor(pe/t),ee-1);m(ee),v(ce),u(ce>0),f(ce<ee-1)}else{const ve=Math.max(1,Math.round((ue.clientHeight+Te)/t)),ee=Math.max(1,Oe-ve+1),ce=Math.min(Math.floor(pe/t),ee-1);m(ee),v(ce),u(ce>0),f(ce<ee-1)}},ae=()=>{X===null&&(X=setTimeout(()=>{X=null,fe()},100))},Y=new ResizeObserver(fe);Y.observe(q),q.addEventListener("scroll",ae);const $=new MutationObserver(fe);return $.observe(q,{childList:!0,subtree:!0}),requestAnimationFrame(()=>{requestAnimationFrame(fe)}),()=>{q.removeEventListener("scroll",ae),Y.disconnect(),$.disconnect(),X&&clearTimeout(X)}},[e,t,n,i]),j.useEffect(()=>{const q=s.current;if(!q||!i)return;const X=e==="horizontal"?q.scrollLeft:q.scrollTop,fe=Math.max(1,Math.ceil(i/n)),ae=Math.min(Math.floor(X/t),fe-1);m(fe),v(ae),u(ae>0),f(ae<fe-1)},[i,n,t,e]);const T=j.useCallback(()=>{const q=s.current;if(!q)return;const X=e==="horizontal",fe=X?q.scrollLeft:q.scrollTop,ae=Math.round(fe/t)*t;q.style.scrollBehavior="smooth",X?q.scrollLeft=ae:q.scrollTop=ae},[e,t]);j.useEffect(()=>{const q=X=>{X.preventDefault(),p&&(h(!1),T()),E.current&&(clearTimeout(E.current),E.current=null)};return window.addEventListener("mouseup",q),()=>window.removeEventListener("mouseup",q)},[p,T]);const M=q=>{const X=s.current;if(!X)return;const ae=(e==="horizontal"?X.scrollLeft:X.scrollTop)+(q?t:-t);X.style.scrollBehavior="smooth",e==="horizontal"?X.scrollLeft=ae:X.scrollTop=ae},D=q=>{M(q==="end")},A=q=>{if(!s.current)return;const X=q*t;s.current.style.scrollBehavior="smooth",e==="horizontal"?s.current.scrollLeft=X:s.current.scrollTop=X},z=q=>{q.preventDefault(),R(!1);const X=e==="horizontal"?q.pageX:q.pageY,fe=e==="horizontal"?s.current.scrollLeft:s.current.scrollTop;C({pos:X,scroll:fe}),S.current=null,s.current&&(s.current.style.scrollBehavior="auto"),E.current=window.setTimeout(()=>{h(!0),E.current=null},gm)},J=q=>{if(!s.current)return;if(q.buttons===0){h(!1),E.current&&(clearTimeout(E.current),E.current=null);return}const X=e==="horizontal"?q.pageX:q.pageY,fe=w.pos-X;if(Math.abs(fe)>ym){R(!0),p||(h(!0),E.current&&(clearTimeout(E.current),E.current=null));const ae=performance.now();if(e==="horizontal"){if(ae-hm<mm)return;pm=ae}else{if(ae-pm<mm)return;hm=ae}const Y=fe>0?"end":"start";Y!==S.current&&(S.current=Y,D(Y))}},Z=q=>{s.current&&(q.preventDefault(),h(!1),S.current=null,E.current&&(clearTimeout(E.current),E.current=null),T())},_=q=>{const X=q.touches[0],fe=e==="horizontal"?X.pageX:X.pageY,ae=e==="horizontal"?s.current.scrollLeft:s.current.scrollTop;R(!1),C({pos:fe,scroll:ae}),E.current=window.setTimeout(()=>{h(!0),E.current=null},gm)},H=q=>{if(!s.current)return;const X=q.touches[0],fe=e==="horizontal"?X.pageX:X.pageY,ae=w.pos-fe;Math.abs(ae)>ym&&(R(!0),p||(h(!0),E.current&&(clearTimeout(E.current),E.current=null)),q.preventDefault(),e==="horizontal"?s.current.scrollLeft=w.scroll+ae:s.current.scrollTop=w.scroll+ae)},B=()=>{h(!1),E.current&&(clearTimeout(E.current),E.current=null),s.current&&x&&T()},K=g>1;return{containerRef:s,showStartButton:a,showEndButton:c,isDragging:p,hasDragged:x,setHasDragged:R,scroll:D,handleMouseDown:z,handleMouseMove:J,handleMouseUp:Z,currentPage:y,totalPages:g,scrollToPage:A,disableStartButton:!a,disableEndButton:!c,handleTouchStart:_,handleTouchMove:H,handleTouchEnd:B,canScroll:K}},CR=jt(F.jsx("path",{d:"M7.41 15.41 12 10.83l4.59 4.58L18 14l-6-6-6 6z"}),"KeyboardArrowUp"),_R=jt(F.jsx("path",{d:"M7.41 8.59 12 13.17l4.59-4.58L18 10l-6 6-6-6z"}),"KeyboardArrowDown"),RR=jt(F.jsx("path",{d:"M15.41 7.41 14 6l-6 6 6 6 1.41-1.41L10.83 12z"}),"ChevronLeft"),DR=jt(F.jsx("path",{d:"M10 6 8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z"}),"ChevronRight"),vm=({total:e,current:t,onDotClick:n,vertical:i=!1,onArrowClick:s,disableStart:a=!1,disableEnd:u=!1})=>{const c=Math.max(0,e);return c<=0?null:F.jsxs(me.Box,{"data-testid":"pagination-dots",sx:{width:"fit-content",display:"flex",alignItems:"center",borderRadius:1,...i?{flexDirection:"column"}:{flexDirection:"row"}},children:[F.jsx(me.IconButton,{size:"small",disabled:a,onClick:()=>!a&&(s==null?void 0:s("start")),sx:{p:.5,opacity:a?0:1,transition:"opacity 0.2s ease"},children:i?F.jsx(CR,{}):F.jsx(RR,{})}),F.jsx(me.Box,{sx:{display:"flex",flexDirection:i?"column":"row",gap:.5},children:Array.from({length:c}).map((f,p)=>F.jsx(me.Box,{onClick:h=>{h.stopPropagation(),n==null||n(p)},sx:{width:6,height:6,borderRadius:"50%",bgcolor:t===p?"primary.main":"action.disabled",transition:"all 0.2s ease",cursor:n?"pointer":"default","&:hover":n?{transform:"scale(1.2)",bgcolor:t===p?"primary.dark":"primary.light"}:{}}},p))}),F.jsx(me.IconButton,{size:"small",onClick:()=>!u&&(s==null?void 0:s("end")),disabled:u,sx:{p:.5,opacity:u?0:1,transition:"opacity 0.2s ease"},children:i?F.jsx(_R,{}):F.jsx(DR,{})})]})},Dy=j.createContext({itemCounts:{horizontal:1,vertical:1},setItemCounts:()=>{}}),My=({children:e})=>{const[t,n]=j.useState({horizontal:1,vertical:1});return F.jsx(Dy.Provider,{value:{itemCounts:t,setItemCounts:n},children:e})},Py=()=>{const e=j.useContext(Dy);if(!e)throw new Error("useResizeContext must be used within a ResizeProvider");return e},MR=25,pi=({direction:e,children:t,itemSize:n,containerSize:i="100%",hideScrollbar:s=!0,snapScroll:a=!0,title:u,priority:c})=>{const{itemCounts:f}=Py(),p=e==="vertical"?f.vertical:f.horizontal,{containerRef:h,showStartButton:x,showEndButton:R,isDragging:w,hasDragged:C,scroll:y,handleMouseDown:v,handleMouseMove:g,handleMouseUp:m,currentPage:S,totalPages:E,scrollToPage:T,disableStartButton:M,disableEndButton:D,handleTouchStart:A,handleTouchMove:z,handleTouchEnd:J,canScroll:Z,setHasDragged:_}=TR({direction:e,itemSize:n,itemsPerPage:p}),H=e==="vertical",B=()=>u?F.jsx(me.Typography,{variant:"h6",sx:{color:c==="high"?"primary.main":c==="low"?"text.secondary":"text.primary"},children:u}):null;let K={zIndex:1,padding:1,width:"100%",height:"100%",display:"flex",overflow:"hidden",position:"relative",flexDirection:H?"column":"row",cursor:w?"grabbing":"grab",touchAction:H?"pan-y":"pan-x",scrollSnapType:a?"x mandatory":"none",scrollbarWidth:s?"none":"auto",userSelect:"none",scrollBehavior:"smooth",WebkitOverflowScrolling:"touch",msOverflowStyle:"none","&::-webkit-scrollbar":{display:s?"none":"auto"}};H&&(K={...K,"& > div":{scrollSnapAlign:a?"start":"none",minHeight:n,flex:"0 0 auto",height:n,willChange:"transform"}});const q={onMouseDown:v,onMouseMove:g,onMouseUp:m,onMouseLeave:m,onTouchStart:A,onTouchMove:z,onTouchEnd:J,onClickCapture:X=>{C&&(X.stopPropagation(),X.preventDefault(),_(!1))}};return F.jsxs(me.Box,{sx:{display:"flex",flexDirection:"column",height:i,width:"100%"},children:[B(),H?F.jsxs(me.Box,{sx:{display:"flex",flexDirection:"row",height:"100%"},children:[F.jsx(me.Box,{"data-testid":"reel-container",ref:h,sx:K,...q,children:t}),F.jsx(me.Box,{"data-testid":"pagination-dots-container",sx:{width:MR,display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center"},children:F.jsx(vm,{total:E,current:S,onDotClick:T,onArrowClick:y,vertical:!0,showArrows:x||R,disableStart:M,disableEnd:D})})]}):F.jsxs(me.Box,{sx:{display:"flex",flexDirection:"column",height:"100%"},children:[F.jsx(me.Box,{ref:h,sx:K,...q,children:j.Children.map(t,X=>F.jsx(me.Box,{"data-testid":"reel-item",sx:{width:n,scrollSnapAlign:"start",display:"flex",flexShrink:0},children:X}))}),F.jsx(vm,{total:E,current:S,onDotClick:T,onArrowClick:y,showArrows:Z,disableStart:M,disableEnd:D})]})]})},PR=me.keyframes`
124
124
  0% { transform: scale(0.95); opacity: 0.5; }
125
125
  50% { transform: scale(1.05); opacity: 0.8; }
126
126
  100% { transform: scale(0.95); opacity: 0.5; }
package/dist/index.es.js CHANGED
@@ -8789,7 +8789,7 @@ const RR = Gt(/* @__PURE__ */ F.jsx("path", {
8789
8789
  Hc.isEqual(i.current, s) || (s.forEach((a) => {
8790
8790
  t(a);
8791
8791
  }), n(), i.current = s);
8792
- }, [s, t, n]), null;
8792
+ }, [s]), null;
8793
8793
  }, Ck = ({ heading: e, subheading: t }) => /* @__PURE__ */ F.jsxs(F.Fragment, { children: [
8794
8794
  /* @__PURE__ */ F.jsx(
8795
8795
  vs,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mui-toolpad-extended-tuni/core",
3
- "version": "3.3.1",
3
+ "version": "3.3.2",
4
4
  "description": "Core shared dependencies for MUI Toolpad Extended TUNI microservices",
5
5
  "author": "Jaakko Rajala",
6
6
  "type": "module",