omnieye-theme-studio 1.2.1 → 1.2.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/README.md +1 -1
- package/dist/index.esm.js +1 -1
- package/dist/index.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -49,4 +49,4 @@ Full 1:1 port of `Theme Manager.dc.html`:
|
|
|
49
49
|
- **Section → screen auto-switch:** opening a rail section jumps the preview to its mapped screen (theme/cards/brand/surface→Dashboard, colour/typography→Components, tables→Orders, notifications→Operations, login→Login), guarded so reopening the same section won't override a manual screen change.
|
|
50
50
|
- **“Change preview screen” popover:** the monitor icon on any section header toggles a shared “Previewing Screen” grid (all 8 screens); picking one sets it and closes; auto-hides when any section is opened/closed.
|
|
51
51
|
|
|
52
|
-
State persists to `localStorage` (`omnieye-theme-studio`)
|
|
52
|
+
State persists to `localStorage` (`omnieye-theme-studio`)..
|
package/dist/index.esm.js
CHANGED
|
@@ -4357,7 +4357,7 @@ function Ks({ icon: e, title: r, info: t, open: n, dimmed: o, onToggle: s, onPre
|
|
|
4357
4357
|
{
|
|
4358
4358
|
sx: {
|
|
4359
4359
|
background: x,
|
|
4360
|
-
opacity: o ? 0.
|
|
4360
|
+
opacity: o ? 0.3 : 1,
|
|
4361
4361
|
transform: n ? "translateY(-2px)" : "none",
|
|
4362
4362
|
transition: "opacity .22s ease, transform .22s ease",
|
|
4363
4363
|
borderBottom: `1px solid ${m.divider}`,
|
package/dist/index.js
CHANGED
|
@@ -71,4 +71,4 @@ theme.transitions = createTransitions(theme.transitions || {});
|
|
|
71
71
|
|
|
72
72
|
export default theme;`}function un(e){return typeof e=="number"?`${(e*100).toFixed(0)}%`:`calc((${e}) * 100%)`}const Ya=e=>{if(!Number.isNaN(+e))return+e;const r=e.match(/\d*\.?\d+/g);if(!r)return 0;let t=0;for(let o=0;o<r.length;o+=1)t+=+r[o];return t};function Ja(e){Object.assign(e,{alpha(r,t){const o=this||e;return o.colorSpace?`oklch(from ${r} l c h / ${typeof t=="string"?`calc(${t})`:t})`:o.vars?`rgba(${r.replace(/var\(--([^,\s)]+)(?:,[^)]+)?\)+/g,"var(--$1Channel)")} / ${typeof t=="string"?`calc(${t})`:t})`:On(r,Ya(t))},lighten(r,t){const o=this||e;return o.colorSpace?`color-mix(in ${o.colorSpace}, ${r}, #fff ${un(t)})`:Kt(r,t)},darken(r,t){const o=this||e;return o.colorSpace?`color-mix(in ${o.colorSpace}, ${r}, #000 ${un(t)})`:qt(r,t)}})}function mr(e={},...r){const{breakpoints:t,mixins:o={},spacing:i,palette:s={},transitions:a={},typography:l={},shape:c,colorSpace:g,...f}=e;if(e.vars&&e.generateThemeVars===void 0)throw new Error(process.env.NODE_ENV!=="production"?"MUI: `vars` is a private field used for CSS variables support.\nPlease use another name or follow the [docs](https://v7.mui.com/material-ui/customization/css-theme-variables/usage/) to enable the feature.":Ze(20));const x=Tr({...s,colorSpace:g}),m=En(e);let h=we(m,{mixins:Aa(m.breakpoints,o),palette:x,shadows:za.slice(),typography:Da(x,l),transitions:Va(a),zIndex:{...Ua}});if(h=we(h,f),h=r.reduce((b,u)=>we(b,u),h),process.env.NODE_ENV!=="production"){const b=["active","checked","completed","disabled","error","expanded","focused","focusVisible","required","selected"],u=(y,v)=>{let E;for(E in y){const H=y[E];if(b.includes(E)&&Object.keys(H).length>0){if(process.env.NODE_ENV!=="production"){const S=jr("",E);console.error([`MUI: The \`${v}\` component increases the CSS specificity of the \`${E}\` internal state.`,"You can not override it like this: ",JSON.stringify(y,null,2),"",`Instead, you need to use the '&.${S}' syntax:`,JSON.stringify({root:{[`&.${S}`]:H}},null,2),"","https://mui.com/r/state-classes-guide"].join(`
|
|
73
73
|
`))}y[E]={}}}};Object.keys(h.components).forEach(y=>{const v=h.components[y].styleOverrides;v&&y.startsWith("Mui")&&u(v,y)})}return h.unstable_sxConfig={...Yt,...f==null?void 0:f.unstable_sxConfig},h.unstable_sx=function(u){return dt({sx:u,theme:this})},h.toRuntimeSource=Wn,Ja(h),h}function qa(e){let r;return e<1?r=5.11916*e**2:r=4.5*Math.log(e+1)+2,Math.round(r*10)/1e3}const Ka=[...Array(25)].map((e,r)=>{if(r===0)return"none";const t=qa(r);return`linear-gradient(rgba(255 255 255 / ${t}), rgba(255 255 255 / ${t}))`});function zn(e){return{inputPlaceholder:e==="dark"?.5:.42,inputUnderline:e==="dark"?.7:.42,switchTrackDisabled:e==="dark"?.2:.12,switchTrack:e==="dark"?.3:.38}}function _n(e){return e==="dark"?Ka:[]}function Xa(e){const{palette:r={mode:"light"},opacity:t,overlays:o,colorSpace:i,...s}=e,a=Tr({...r,colorSpace:i});return{palette:a,opacity:{...zn(a.mode),...t},overlays:o||_n(a.mode),...s}}function Qa(e){var r;return!!e[0].match(/(cssVarPrefix|colorSchemeSelector|modularCssLayers|rootSelector|typography|mixins|breakpoints|direction|transitions)/)||!!e[0].match(/sxConfig$/)||e[0]==="palette"&&!!((r=e[1])!=null&&r.match(/(mode|contrastThreshold|tonalOffset)/))}const Za=e=>[...[...Array(25)].map((r,t)=>`--${e?`${e}-`:""}overlays-${t}`),`--${e?`${e}-`:""}palette-AppBar-darkBg`,`--${e?`${e}-`:""}palette-AppBar-darkColor`],es=e=>(r,t)=>{const o=e.rootSelector||":root",i=e.colorSchemeSelector;let s=i;if(i==="class"&&(s=".%s"),i==="data"&&(s="[data-%s]"),i!=null&&i.startsWith("data-")&&!i.includes("%s")&&(s=`[${i}="%s"]`),e.defaultColorScheme===r){if(r==="dark"){const a={};return Za(e.cssVarPrefix).forEach(l=>{a[l]=t[l],delete t[l]}),s==="media"?{[o]:t,"@media (prefers-color-scheme: dark)":{[o]:a}}:s?{[s.replace("%s",r)]:a,[`${o}, ${s.replace("%s",r)}`]:t}:{[o]:{...t,...a}}}if(s&&s!=="media")return`${o}, ${s.replace("%s",String(r))}`}else if(r){if(s==="media")return{[`@media (prefers-color-scheme: ${String(r)})`]:{[o]:t}};if(s)return s.replace("%s",String(r))}return o};function ts(e,r){r.forEach(t=>{e[t]||(e[t]={})})}function w(e,r,t){!e[r]&&t&&(e[r]=t)}function gt(e){return typeof e!="string"||!e.startsWith("hsl")?e:An(e)}function Pe(e,r){`${r}Channel`in e||(e[`${r}Channel`]=ht(gt(e[r]),`MUI: Can't create \`palette.${r}Channel\` because \`palette.${r}\` is not one of these formats: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla(), color().
|
|
74
|
-
To suppress this warning, you need to explicitly provide the \`palette.${r}Channel\` as a string (in rgb format, for example "12 12 12") or undefined if you want to remove the channel token.`))}function rs(e){return typeof e=="number"?`${e}px`:typeof e=="string"||typeof e=="function"||Array.isArray(e)?e:"8px"}const Ee=e=>{try{return e()}catch{}},ns=(e="mui")=>va(e);function dr(e,r,t,o,i){if(!t)return;t=t===!0?{}:t;const s=i==="dark"?"dark":"light";if(!o){r[i]=Xa({...t,palette:{mode:s,...t==null?void 0:t.palette},colorSpace:e});return}const{palette:a,...l}=mr({...o,palette:{mode:s,...t==null?void 0:t.palette},colorSpace:e});return r[i]={...t,palette:a,opacity:{...zn(s),...t==null?void 0:t.opacity},overlays:(t==null?void 0:t.overlays)||_n(s)},l}function os(e={},...r){const{colorSchemes:t={light:!0},defaultColorScheme:o,disableCssColorScheme:i=!1,cssVarPrefix:s="mui",nativeColor:a=!1,shouldSkipGeneratingVar:l=Qa,colorSchemeSelector:c=t.light&&t.dark?"media":void 0,rootSelector:g=":root",...f}=e,x=Object.keys(t)[0],m=o||(t.light&&x!=="light"?"light":x),h=ns(s),{[m]:b,light:u,dark:y,...v}=t,E={...v};let H=b;if((m==="dark"&&!("dark"in t)||m==="light"&&!("light"in t))&&(H=!0),!H)throw new Error(process.env.NODE_ENV!=="production"?`MUI: The \`colorSchemes.${m}\` option is either missing or invalid.`:Ze(21,m));let S;a&&(S="oklch");const C=dr(S,E,H,f,m);u&&!E.light&&dr(S,E,u,void 0,"light"),y&&!E.dark&&dr(S,E,y,void 0,"dark");let B={defaultColorScheme:m,...C,cssVarPrefix:s,colorSchemeSelector:c,rootSelector:g,getCssVar:h,colorSchemes:E,font:{...Ia(C.typography),...C.font},spacing:rs(f.spacing)};Object.keys(B.colorSchemes).forEach(Y=>{const d=B.colorSchemes[Y].palette,I=W=>{const z=W.split("-"),q=z[1],U=z[2];return h(W,d[q][U])};d.mode==="light"&&(w(d.common,"background","#fff"),w(d.common,"onBackground","#000")),d.mode==="dark"&&(w(d.common,"background","#000"),w(d.common,"onBackground","#fff"));function P(W,z,q){if(S){let U;return W===Je&&(U=`transparent ${((1-q)*100).toFixed(0)}%`),W===ne&&(U=`#000 ${(q*100).toFixed(0)}%`),W===oe&&(U=`#fff ${(q*100).toFixed(0)}%`),`color-mix(in ${S}, ${z}, ${U})`}return W(z,q)}if(ts(d,["Alert","AppBar","Avatar","Button","Chip","FilledInput","LinearProgress","Skeleton","Slider","SnackbarContent","SpeedDialAction","StepConnector","StepContent","Switch","TableCell","Tooltip"]),d.mode==="light"){w(d.Alert,"errorColor",P(ne,a?h("palette-error-light"):d.error.light,.6)),w(d.Alert,"infoColor",P(ne,a?h("palette-info-light"):d.info.light,.6)),w(d.Alert,"successColor",P(ne,a?h("palette-success-light"):d.success.light,.6)),w(d.Alert,"warningColor",P(ne,a?h("palette-warning-light"):d.warning.light,.6)),w(d.Alert,"errorFilledBg",I("palette-error-main")),w(d.Alert,"infoFilledBg",I("palette-info-main")),w(d.Alert,"successFilledBg",I("palette-success-main")),w(d.Alert,"warningFilledBg",I("palette-warning-main")),w(d.Alert,"errorFilledColor",Ee(()=>d.getContrastText(d.error.main))),w(d.Alert,"infoFilledColor",Ee(()=>d.getContrastText(d.info.main))),w(d.Alert,"successFilledColor",Ee(()=>d.getContrastText(d.success.main))),w(d.Alert,"warningFilledColor",Ee(()=>d.getContrastText(d.warning.main))),w(d.Alert,"errorStandardBg",P(oe,a?h("palette-error-light"):d.error.light,.9)),w(d.Alert,"infoStandardBg",P(oe,a?h("palette-info-light"):d.info.light,.9)),w(d.Alert,"successStandardBg",P(oe,a?h("palette-success-light"):d.success.light,.9)),w(d.Alert,"warningStandardBg",P(oe,a?h("palette-warning-light"):d.warning.light,.9)),w(d.Alert,"errorIconColor",I("palette-error-main")),w(d.Alert,"infoIconColor",I("palette-info-main")),w(d.Alert,"successIconColor",I("palette-success-main")),w(d.Alert,"warningIconColor",I("palette-warning-main")),w(d.AppBar,"defaultBg",I("palette-grey-100")),w(d.Avatar,"defaultBg",I("palette-grey-400")),w(d.Button,"inheritContainedBg",I("palette-grey-300")),w(d.Button,"inheritContainedHoverBg",I("palette-grey-A100")),w(d.Chip,"defaultBorder",I("palette-grey-400")),w(d.Chip,"defaultAvatarColor",I("palette-grey-700")),w(d.Chip,"defaultIconColor",I("palette-grey-700")),w(d.FilledInput,"bg","rgba(0, 0, 0, 0.06)"),w(d.FilledInput,"hoverBg","rgba(0, 0, 0, 0.09)"),w(d.FilledInput,"disabledBg","rgba(0, 0, 0, 0.12)"),w(d.LinearProgress,"primaryBg",P(oe,a?h("palette-primary-main"):d.primary.main,.62)),w(d.LinearProgress,"secondaryBg",P(oe,a?h("palette-secondary-main"):d.secondary.main,.62)),w(d.LinearProgress,"errorBg",P(oe,a?h("palette-error-main"):d.error.main,.62)),w(d.LinearProgress,"infoBg",P(oe,a?h("palette-info-main"):d.info.main,.62)),w(d.LinearProgress,"successBg",P(oe,a?h("palette-success-main"):d.success.main,.62)),w(d.LinearProgress,"warningBg",P(oe,a?h("palette-warning-light"):d.warning.main,.62)),w(d.Skeleton,"bg",S?P(Je,a?h("palette-text-primary"):d.text.primary,.11):`rgba(${I("palette-text-primaryChannel")} / 0.11)`),w(d.Slider,"primaryTrack",P(oe,a?h("palette-primary-main"):d.primary.main,.62)),w(d.Slider,"secondaryTrack",P(oe,a?h("palette-secondary-main"):d.secondary.main,.62)),w(d.Slider,"errorTrack",P(oe,a?h("palette-error-main"):d.error.main,.62)),w(d.Slider,"infoTrack",P(oe,a?h("palette-info-main"):d.info.main,.62)),w(d.Slider,"successTrack",P(oe,a?h("palette-success-main"):d.success.main,.62)),w(d.Slider,"warningTrack",P(oe,a?h("palette-warning-main"):d.warning.main,.62));const W=S?P(ne,a?h("palette-background-default"):d.background.default,.6825):Rt(d.background.default,.8);w(d.SnackbarContent,"bg",W),w(d.SnackbarContent,"color",Ee(()=>S?xr.text.primary:d.getContrastText(W))),w(d.SpeedDialAction,"fabHoverBg",Rt(d.background.paper,.15)),w(d.StepConnector,"border",I("palette-grey-400")),w(d.StepContent,"border",I("palette-grey-400")),w(d.Switch,"defaultColor",I("palette-common-white")),w(d.Switch,"defaultDisabledColor",I("palette-grey-100")),w(d.Switch,"primaryDisabledColor",P(oe,a?h("palette-primary-main"):d.primary.main,.62)),w(d.Switch,"secondaryDisabledColor",P(oe,a?h("palette-secondary-main"):d.secondary.main,.62)),w(d.Switch,"errorDisabledColor",P(oe,a?h("palette-error-main"):d.error.main,.62)),w(d.Switch,"infoDisabledColor",P(oe,a?h("palette-info-main"):d.info.main,.62)),w(d.Switch,"successDisabledColor",P(oe,a?h("palette-success-main"):d.success.main,.62)),w(d.Switch,"warningDisabledColor",P(oe,a?h("palette-warning-main"):d.warning.main,.62)),w(d.TableCell,"border",P(oe,Je(a?h("palette-divider"):d.divider,1),.88)),w(d.Tooltip,"bg",P(Je,a?h("palette-grey-700"):d.grey[700],.92))}if(d.mode==="dark"){w(d.Alert,"errorColor",P(oe,a?h("palette-error-light"):d.error.light,.6)),w(d.Alert,"infoColor",P(oe,a?h("palette-info-light"):d.info.light,.6)),w(d.Alert,"successColor",P(oe,a?h("palette-success-light"):d.success.light,.6)),w(d.Alert,"warningColor",P(oe,a?h("palette-warning-light"):d.warning.light,.6)),w(d.Alert,"errorFilledBg",I("palette-error-dark")),w(d.Alert,"infoFilledBg",I("palette-info-dark")),w(d.Alert,"successFilledBg",I("palette-success-dark")),w(d.Alert,"warningFilledBg",I("palette-warning-dark")),w(d.Alert,"errorFilledColor",Ee(()=>d.getContrastText(d.error.dark))),w(d.Alert,"infoFilledColor",Ee(()=>d.getContrastText(d.info.dark))),w(d.Alert,"successFilledColor",Ee(()=>d.getContrastText(d.success.dark))),w(d.Alert,"warningFilledColor",Ee(()=>d.getContrastText(d.warning.dark))),w(d.Alert,"errorStandardBg",P(ne,a?h("palette-error-light"):d.error.light,.9)),w(d.Alert,"infoStandardBg",P(ne,a?h("palette-info-light"):d.info.light,.9)),w(d.Alert,"successStandardBg",P(ne,a?h("palette-success-light"):d.success.light,.9)),w(d.Alert,"warningStandardBg",P(ne,a?h("palette-warning-light"):d.warning.light,.9)),w(d.Alert,"errorIconColor",I("palette-error-main")),w(d.Alert,"infoIconColor",I("palette-info-main")),w(d.Alert,"successIconColor",I("palette-success-main")),w(d.Alert,"warningIconColor",I("palette-warning-main")),w(d.AppBar,"defaultBg",I("palette-grey-900")),w(d.AppBar,"darkBg",I("palette-background-paper")),w(d.AppBar,"darkColor",I("palette-text-primary")),w(d.Avatar,"defaultBg",I("palette-grey-600")),w(d.Button,"inheritContainedBg",I("palette-grey-800")),w(d.Button,"inheritContainedHoverBg",I("palette-grey-700")),w(d.Chip,"defaultBorder",I("palette-grey-700")),w(d.Chip,"defaultAvatarColor",I("palette-grey-300")),w(d.Chip,"defaultIconColor",I("palette-grey-300")),w(d.FilledInput,"bg","rgba(255, 255, 255, 0.09)"),w(d.FilledInput,"hoverBg","rgba(255, 255, 255, 0.13)"),w(d.FilledInput,"disabledBg","rgba(255, 255, 255, 0.12)"),w(d.LinearProgress,"primaryBg",P(ne,a?h("palette-primary-main"):d.primary.main,.5)),w(d.LinearProgress,"secondaryBg",P(ne,a?h("palette-secondary-main"):d.secondary.main,.5)),w(d.LinearProgress,"errorBg",P(ne,a?h("palette-error-main"):d.error.main,.5)),w(d.LinearProgress,"infoBg",P(ne,a?h("palette-info-main"):d.info.main,.5)),w(d.LinearProgress,"successBg",P(ne,a?h("palette-success-main"):d.success.main,.5)),w(d.LinearProgress,"warningBg",P(ne,a?h("palette-warning-main"):d.warning.main,.5)),w(d.Skeleton,"bg",S?P(Je,a?h("palette-text-primary"):d.text.primary,.13):`rgba(${I("palette-text-primaryChannel")} / 0.13)`),w(d.Slider,"primaryTrack",P(ne,a?h("palette-primary-main"):d.primary.main,.5)),w(d.Slider,"secondaryTrack",P(ne,a?h("palette-secondary-main"):d.secondary.main,.5)),w(d.Slider,"errorTrack",P(ne,a?h("palette-error-main"):d.error.main,.5)),w(d.Slider,"infoTrack",P(ne,a?h("palette-info-main"):d.info.main,.5)),w(d.Slider,"successTrack",P(ne,a?h("palette-success-main"):d.success.main,.5)),w(d.Slider,"warningTrack",P(ne,a?h("palette-warning-light"):d.warning.main,.5));const W=S?P(oe,a?h("palette-background-default"):d.background.default,.985):Rt(d.background.default,.98);w(d.SnackbarContent,"bg",W),w(d.SnackbarContent,"color",Ee(()=>S?Mn.text.primary:d.getContrastText(W))),w(d.SpeedDialAction,"fabHoverBg",Rt(d.background.paper,.15)),w(d.StepConnector,"border",I("palette-grey-600")),w(d.StepContent,"border",I("palette-grey-600")),w(d.Switch,"defaultColor",I("palette-grey-300")),w(d.Switch,"defaultDisabledColor",I("palette-grey-600")),w(d.Switch,"primaryDisabledColor",P(ne,a?h("palette-primary-main"):d.primary.main,.55)),w(d.Switch,"secondaryDisabledColor",P(ne,a?h("palette-secondary-main"):d.secondary.main,.55)),w(d.Switch,"errorDisabledColor",P(ne,a?h("palette-error-main"):d.error.main,.55)),w(d.Switch,"infoDisabledColor",P(ne,a?h("palette-info-main"):d.info.main,.55)),w(d.Switch,"successDisabledColor",P(ne,a?h("palette-success-main"):d.success.main,.55)),w(d.Switch,"warningDisabledColor",P(ne,a?h("palette-warning-light"):d.warning.main,.55)),w(d.TableCell,"border",P(ne,Je(a?h("palette-divider"):d.divider,1),.68)),w(d.Tooltip,"bg",P(Je,a?h("palette-grey-700"):d.grey[700],.92))}a||(Pe(d.background,"default"),Pe(d.background,"paper"),Pe(d.common,"background"),Pe(d.common,"onBackground"),Pe(d,"divider")),Object.keys(d).forEach(W=>{const z=d[W];W!=="tonalOffset"&&!a&&z&&typeof z=="object"&&(z.main&&w(d[W],"mainChannel",ht(gt(z.main))),z.light&&w(d[W],"lightChannel",ht(gt(z.light))),z.dark&&w(d[W],"darkChannel",ht(gt(z.dark))),z.contrastText&&w(d[W],"contrastTextChannel",ht(gt(z.contrastText))),W==="text"&&(Pe(d[W],"primary"),Pe(d[W],"secondary")),W==="action"&&(z.active&&Pe(d[W],"active"),z.selected&&Pe(d[W],"selected")))})}),B=r.reduce((Y,d)=>we(Y,d),B);const D={prefix:s,disableCssColorScheme:i,shouldSkipGeneratingVar:l,getSelector:es(B),enableContrastVars:a},{vars:$,generateThemeVars:X,generateStyleSheets:Q}=ja(B,D);return B.vars=$,Object.entries(B.colorSchemes[B.defaultColorScheme]).forEach(([Y,d])=>{B[Y]=d}),B.generateThemeVars=X,B.generateStyleSheets=Q,B.generateSpacing=function(){return Rn(f.spacing,Sr(this))},B.getColorSchemeSelector=wa(c),B.spacing=B.generateSpacing(),B.shouldSkipGeneratingVar=l,B.unstable_sxConfig={...Yt,...f==null?void 0:f.unstable_sxConfig},B.unstable_sx=function(d){return dt({sx:d,theme:this})},B.toRuntimeSource=Wn,B}function fn(e,r,t){e.colorSchemes&&t&&(e.colorSchemes[r]={...t!==!0&&t,palette:Tr({...t===!0?{}:t.palette,mode:r})})}function Ln(e={},...r){const{palette:t,cssVariables:o=!1,colorSchemes:i=t?void 0:{light:!0},defaultColorScheme:s=t==null?void 0:t.mode,...a}=e,l=s||"light",c=i==null?void 0:i[l],g={...i,...t?{[l]:{...typeof c!="boolean"&&c,palette:t}}:void 0};if(o===!1){if(!("colorSchemes"in e))return mr(e,...r);let f=t;"palette"in e||g[l]&&(g[l]!==!0?f=g[l].palette:l==="dark"&&(f={mode:"dark"}));const x=mr({...e,palette:f},...r);return x.defaultColorScheme=l,x.colorSchemes=g,x.palette.mode==="light"&&(x.colorSchemes.light={...g.light!==!0&&g.light,palette:x.palette},fn(x,"dark",g.dark)),x.palette.mode==="dark"&&(x.colorSchemes.dark={...g.dark!==!0&&g.dark,palette:x.palette},fn(x,"light",g.light)),x}return!t&&!("light"in g)&&l==="light"&&(g.light=!0),os({...a,colorSchemes:g,defaultColorScheme:l,...typeof o!="boolean"&&o},...r)}const is=Ln(),as="$$material";function ss(e){return e!=="ownerState"&&e!=="theme"&&e!=="sx"&&e!=="as"}const ls=e=>ss(e)&&e!=="classes",ds=sa({themeId:as,defaultTheme:is,rootShouldForwardProp:ls}),cs=ba;process.env.NODE_ENV!=="production"&&(ee.node,ee.object.isRequired);function ps(e){return ya(e)}function us(e){return jr("MuiSvgIcon",e)}ra("MuiSvgIcon",["root","colorPrimary","colorSecondary","colorAction","colorError","colorDisabled","fontSizeInherit","fontSizeSmall","fontSizeMedium","fontSizeLarge"]);const fs=e=>{const{color:r,fontSize:t,classes:o}=e,i={root:["root",r!=="inherit"&&`color${et(r)}`,`fontSize${et(t)}`]};return Yo(i,us,o)},hs=ds("svg",{name:"MuiSvgIcon",slot:"Root",overridesResolver:(e,r)=>{const{ownerState:t}=e;return[r.root,t.color!=="inherit"&&r[`color${et(t.color)}`],r[`fontSize${et(t.fontSize)}`]]}})(cs(({theme:e})=>{var r,t,o,i,s,a,l,c,g,f,x,m,h,b;return{userSelect:"none",width:"1em",height:"1em",display:"inline-block",flexShrink:0,transition:(i=(r=e.transitions)==null?void 0:r.create)==null?void 0:i.call(r,"fill",{duration:(o=(t=(e.vars??e).transitions)==null?void 0:t.duration)==null?void 0:o.shorter}),variants:[{props:u=>!u.hasSvgAsChild,style:{fill:"currentColor"}},{props:{fontSize:"inherit"},style:{fontSize:"inherit"}},{props:{fontSize:"small"},style:{fontSize:((a=(s=e.typography)==null?void 0:s.pxToRem)==null?void 0:a.call(s,20))||"1.25rem"}},{props:{fontSize:"medium"},style:{fontSize:((c=(l=e.typography)==null?void 0:l.pxToRem)==null?void 0:c.call(l,24))||"1.5rem"}},{props:{fontSize:"large"},style:{fontSize:((f=(g=e.typography)==null?void 0:g.pxToRem)==null?void 0:f.call(g,35))||"2.1875rem"}},...Object.entries((e.vars??e).palette).filter(([,u])=>u&&u.main).map(([u])=>{var y,v;return{props:{color:u},style:{color:(v=(y=(e.vars??e).palette)==null?void 0:y[u])==null?void 0:v.main}}}),{props:{color:"action"},style:{color:(m=(x=(e.vars??e).palette)==null?void 0:x.action)==null?void 0:m.active}},{props:{color:"disabled"},style:{color:(b=(h=(e.vars??e).palette)==null?void 0:h.action)==null?void 0:b.disabled}},{props:{color:"inherit"},style:{color:void 0}}]}})),Dt=_e.forwardRef(function(r,t){const o=ps({props:r,name:"MuiSvgIcon"}),{children:i,className:s,color:a="inherit",component:l="svg",fontSize:c="medium",htmlColor:g,inheritViewBox:f=!1,titleAccess:x,viewBox:m="0 0 24 24",...h}=o,b=_e.isValidElement(i)&&i.type==="svg",u={...o,color:a,component:l,fontSize:c,instanceFontSize:r.fontSize,inheritViewBox:f,viewBox:m,hasSvgAsChild:b},y={};f||(y.viewBox=m);const v=fs(u);return n.jsxs(hs,{as:l,className:wn(v.root,s),focusable:"false",color:g,"aria-hidden":x?void 0:!0,role:x?"img":void 0,ref:t,...y,...h,...b&&i.props,ownerState:u,children:[b?i.props.children:i,x?n.jsx("title",{children:x}):null]})});process.env.NODE_ENV!=="production"&&(Dt.propTypes={children:ee.node,classes:ee.object,className:ee.string,color:ee.oneOfType([ee.oneOf(["inherit","action","disabled","primary","secondary","error","info","success","warning"]),ee.string]),component:ee.elementType,fontSize:ee.oneOfType([ee.oneOf(["inherit","large","medium","small"]),ee.string]),htmlColor:ee.string,inheritViewBox:ee.bool,shapeRendering:ee.string,sx:ee.oneOfType([ee.arrayOf(ee.oneOfType([ee.func,ee.object,ee.bool])),ee.func,ee.object]),titleAccess:ee.string,viewBox:ee.string});Dt.muiName="SvgIcon";function vt(e,r){function t(o,i){return n.jsx(Dt,{"data-testid":process.env.NODE_ENV!=="production"?`${r}Icon`:void 0,ref:i,...o,children:e})}return process.env.NODE_ENV!=="production"&&(t.displayName=`${r}Icon`),t.muiName=Dt.muiName,_e.memo(_e.forwardRef(t))}const gs=vt(n.jsx("path",{d:"M3 18c0 .55.45 1 1 1h5v-2H4c-.55 0-1 .45-1 1M3 6c0 .55.45 1 1 1h9V5H4c-.55 0-1 .45-1 1m10 14v-1h7c.55 0 1-.45 1-1s-.45-1-1-1h-7v-1c0-.55-.45-1-1-1s-1 .45-1 1v4c0 .55.45 1 1 1s1-.45 1-1M7 10v1H4c-.55 0-1 .45-1 1s.45 1 1 1h3v1c0 .55.45 1 1 1s1-.45 1-1v-4c0-.55-.45-1-1-1s-1 .45-1 1m14 2c0-.55-.45-1-1-1h-9v2h9c.55 0 1-.45 1-1m-5-3c.55 0 1-.45 1-1V7h3c.55 0 1-.45 1-1s-.45-1-1-1h-3V4c0-.55-.45-1-1-1s-1 .45-1 1v4c0 .55.45 1 1 1"}),"TuneRounded"),xs=vt(n.jsx("path",{d:"M12 5V3.21c0-.45-.54-.67-.85-.35l-2.8 2.79c-.2.2-.2.51 0 .71l2.79 2.79c.32.31.86.09.86-.36V7c3.31 0 6 2.69 6 6 0 2.72-1.83 5.02-4.31 5.75-.42.12-.69.52-.69.95 0 .65.62 1.16 1.25.97C17.57 19.7 20 16.64 20 13c0-4.42-3.58-8-8-8m-6 8c0-1.34.44-2.58 1.19-3.59.3-.4.26-.95-.09-1.31-.42-.42-1.14-.38-1.5.1-1 1.34-1.6 3-1.6 4.8 0 3.64 2.43 6.7 5.75 7.67.63.19 1.25-.32 1.25-.97 0-.43-.27-.83-.69-.95C7.83 18.02 6 15.72 6 13"}),"RestartAltRounded"),ms=vt(n.jsx("path",{d:"M9.37 5.51c-.18.64-.27 1.31-.27 1.99 0 4.08 3.32 7.4 7.4 7.4.68 0 1.35-.09 1.99-.27C17.45 17.19 14.93 19 12 19c-3.86 0-7-3.14-7-7 0-2.93 1.81-5.45 4.37-6.49M12 3c-4.97 0-9 4.03-9 9s4.03 9 9 9 9-4.03 9-9c0-.46-.04-.92-.1-1.36-.98 1.37-2.58 2.26-4.4 2.26-2.98 0-5.4-2.42-5.4-5.4 0-1.81.89-3.42 2.26-4.4-.44-.06-.9-.1-1.36-.1"}),"DarkModeOutlined"),ys=vt(n.jsx("path",{d:"M12 9c1.65 0 3 1.35 3 3s-1.35 3-3 3-3-1.35-3-3 1.35-3 3-3m0-2c-2.76 0-5 2.24-5 5s2.24 5 5 5 5-2.24 5-5-2.24-5-5-5M2 13h2c.55 0 1-.45 1-1s-.45-1-1-1H2c-.55 0-1 .45-1 1s.45 1 1 1m18 0h2c.55 0 1-.45 1-1s-.45-1-1-1h-2c-.55 0-1 .45-1 1s.45 1 1 1M11 2v2c0 .55.45 1 1 1s1-.45 1-1V2c0-.55-.45-1-1-1s-1 .45-1 1m0 18v2c0 .55.45 1 1 1s1-.45 1-1v-2c0-.55-.45-1-1-1s-1 .45-1 1M5.99 4.58c-.39-.39-1.03-.39-1.41 0-.39.39-.39 1.03 0 1.41l1.06 1.06c.39.39 1.03.39 1.41 0s.39-1.03 0-1.41zm12.37 12.37c-.39-.39-1.03-.39-1.41 0-.39.39-.39 1.03 0 1.41l1.06 1.06c.39.39 1.03.39 1.41 0 .39-.39.39-1.03 0-1.41zm1.06-10.96c.39-.39.39-1.03 0-1.41-.39-.39-1.03-.39-1.41 0l-1.06 1.06c-.39.39-.39 1.03 0 1.41s1.03.39 1.41 0zM7.05 18.36c.39-.39.39-1.03 0-1.41-.39-.39-1.03-.39-1.41 0l-1.06 1.06c-.39.39-.39 1.03 0 1.41s1.03.39 1.41 0z"}),"LightModeOutlined"),hn=e=>{let r;const t=new Set,o=(g,f)=>{const x=typeof g=="function"?g(r):g;if(!Object.is(x,r)){const m=r;r=f??(typeof x!="object"||x===null)?x:Object.assign({},r,x),t.forEach(h=>h(r,m))}},i=()=>r,l={setState:o,getState:i,getInitialState:()=>c,subscribe:g=>(t.add(g),()=>t.delete(g))},c=r=e(o,i,l);return l},bs=(e=>e?hn(e):hn),vs=e=>e;function Ss(e,r=vs){const t=_.useSyncExternalStore(e.subscribe,_.useCallback(()=>r(e.getState()),[e,r]),_.useCallback(()=>r(e.getInitialState()),[e,r]));return _.useDebugValue(t),t}const gn=e=>{const r=bs(e),t=o=>Ss(r,o);return Object.assign(t,r),t},Nn=(e=>e?gn(e):gn);function Cs(e,r){let t;try{t=e()}catch{return}return{getItem:i=>{var s;const a=c=>c===null?null:JSON.parse(c,void 0),l=(s=t.getItem(i))!=null?s:null;return l instanceof Promise?l.then(a):a(l)},setItem:(i,s)=>t.setItem(i,JSON.stringify(s,void 0)),removeItem:i=>t.removeItem(i)}}const yr=e=>r=>{try{const t=e(r);return t instanceof Promise?t:{then(o){return yr(o)(t)},catch(o){return this}}}catch(t){return{then(o){return this},catch(o){return yr(o)(t)}}}},js=(e,r)=>(t,o,i)=>{let s={storage:Cs(()=>window.localStorage),partialize:y=>y,version:0,merge:(y,v)=>({...v,...y}),...r},a=!1,l=0;const c=new Set,g=new Set;let f=s.storage;if(!f)return e((...y)=>{console.warn(`[zustand persist middleware] Unable to update item '${s.name}', the given storage is currently unavailable.`),t(...y)},o,i);const x=()=>{const y=s.partialize({...o()});return f.setItem(s.name,{state:y,version:s.version})},m=i.setState;i.setState=(y,v)=>(m(y,v),x());const h=e((...y)=>(t(...y),x()),o,i);i.getInitialState=()=>h;let b;const u=()=>{var y,v;if(!f)return;const E=++l;a=!1,c.forEach(S=>{var C;return S((C=o())!=null?C:h)});const H=((v=s.onRehydrateStorage)==null?void 0:v.call(s,(y=o())!=null?y:h))||void 0;return yr(f.getItem.bind(f))(s.name).then(S=>{if(S)if(typeof S.version=="number"&&S.version!==s.version){if(s.migrate){const C=s.migrate(S.state,S.version);return C instanceof Promise?C.then(B=>[!0,B]):[!0,C]}console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return[!1,S.state];return[!1,void 0]}).then(S=>{var C;if(E!==l)return;const[B,D]=S;if(b=s.merge(D,(C=o())!=null?C:h),t(b,!0),B)return x()}).then(()=>{E===l&&(H==null||H(o(),void 0),b=o(),a=!0,g.forEach(S=>S(b)))}).catch(S=>{E===l&&(H==null||H(void 0,S))})};return i.persist={setOptions:y=>{s={...s,...y},y.storage&&(f=y.storage)},clearStorage:()=>{f==null||f.removeItem(s.name)},getOptions:()=>s,rehydrate:()=>u(),hasHydrated:()=>a,onHydrate:y=>(c.add(y),()=>{c.delete(y)}),onFinishHydration:y=>(g.add(y),()=>{g.delete(y)})},s.skipHydration||u(),b||h},ws=js,Re={appName:"Crystal Ball",appTagline:"Run your whole business in one place",logoMode:"icon",logoUrl:"",iconColor:"#1565c0",presetId:"corporate",mode:"light",primaryHex:"#1565c0",secondaryHex:"#00897b",highlightHex:"",errorHex:"#d32f2f",warningHex:"#ed6c02",infoHex:"#0288d1",successHex:"#2e7d32",cardBgHex:"",cardHdrHex:"",pageBgHex:"",notifCardHex:"",textPrimaryHex:"",textSecondaryHex:"",dividerHex:"",btnColorHex:"",btnTextHex:"",h1Color:"",h2Color:"",h3Color:"",h4Color:"",h5Color:"",h6Color:"",fontFamily:"Roboto",headingFont:"Figtree",customFonts:[],customHeadFonts:[],textSize:"df",baseFontPx:0,bodyLineHeight:0,bodyWeight:0,letterSpace:0,scaleRatio:"default",scaleRatioCustom:0,h1Size:0,h2Size:0,h3Size:0,h4Size:0,h5Size:0,h6Size:0,h1Weight:0,h2Weight:0,h3Weight:0,h4Weight:0,h5Weight:0,h6Weight:0,headingWeight:600,headingLH:0,radiusPreset:"rounded",radiusVal:9,density:"default",densityScale:0,cardShadowPx:-1,contrast:"medium",contrastMode:"auto",containerPadPx:0,edgePadPx:0,cardGapPx:0,cardStyle:"soft",cardHeader:"plain",surfaceTint:"snow",nestedStyle:"recessed",nestedDepth:-1,headerStrength:-1,tintIntensity:-1,btnCase:"upper",accentGradient:!1,statusBold:!1,mapGlass:"light",chartScheme:"brand",tableDensity:"default",tableColDensity:"default",tableDividers:!1,tableColDividers:!1,tableRowDivW:1,tableColDivW:1,tableStripe:!1,tableHeaderStyle:"tinted",tableCellAlignH:"left",tableCellAlignV:"middle",notifPosition:"bottom-right",notifStyle:"toast",notifAccent:"severity",notifBadge:!0,notifAutoDismiss:!1,autoDismissSec:0,toastW:0,navPattern:"sidebar",sidebarWidth:220,appBarH:0,loginLayout:"split",loginImage:"",loginShowTagline:!0,loginPanelColor:"",loginImgOpacity:0,loginCardW:0},$e=e=>JSON.stringify(e);function cr(e){const r={...Re};if(e&&typeof e=="object")for(const t of Object.keys(Re)){const o=e[t];o!==void 0&&typeof o==typeof Re[t]&&(r[t]=o)}return r}function Ts(e){if(!e||typeof e!="object")return!1;const r=Object.keys(Re);let t=0;for(const o of r){const i=e[o];i!==void 0&&typeof i==typeof Re[o]&&t++}return t/r.length>=.5}const L=Nn()(ws((e,r)=>({settings:{...Re},savedThemes:[],baseline:$e(Re),editingSavedId:null,lastImportedId:null,set:t=>e(o=>({settings:{...o.settings,...t,presetId:"custom"}})),applyPreset:(t,o)=>e(i=>{const s={...i.settings,...o,presetId:t};return{settings:s,baseline:$e(s),editingSavedId:null,lastImportedId:null}}),reset:()=>e(()=>({settings:{...Re},baseline:$e(Re),editingSavedId:null,lastImportedId:null})),captureBaseline:()=>e(t=>({baseline:$e(t.settings)})),restoreBaseline:()=>e(t=>{try{return{settings:JSON.parse(t.baseline)}}catch{return{}}}),isDirty:()=>$e(r().settings)!==r().baseline,saveTheme:t=>e(o=>{const i="cust"+Date.now(),s={...o.settings};return{savedThemes:[...o.savedThemes,{id:i,name:t,snap:s}],settings:{...o.settings,presetId:i},baseline:$e({...o.settings,presetId:i}),editingSavedId:i,lastImportedId:null}}),updateSaved:(t,o,i)=>e(s=>{const a={...i,presetId:t};return{savedThemes:s.savedThemes.map(l=>l.id===t?{...l,name:o,snap:i}:l),settings:a,baseline:$e(a),editingSavedId:t,lastImportedId:null}}),applySaved:t=>e(()=>{const o={...cr(t.snap),presetId:t.id};return{settings:o,baseline:$e(o),editingSavedId:t.id,lastImportedId:null}}),renameSaved:(t,o)=>e(i=>({savedThemes:i.savedThemes.map(s=>s.id===t?{...s,name:o}:s)})),deleteSaved:t=>e(o=>({savedThemes:o.savedThemes.filter(i=>i.id!==t),editingSavedId:o.editingSavedId===t?null:o.editingSavedId,lastImportedId:o.lastImportedId===t?null:o.lastImportedId})),importTheme:(t,o)=>{const i=cr(o),s={id:"imp"+Date.now(),name:t,snap:i};return e(a=>{const l={...i,presetId:s.id};return{savedThemes:[s,...a.savedThemes],settings:l,baseline:$e(l),editingSavedId:s.id,lastImportedId:s.id}}),s}}),{name:"omnieye-theme-studio",merge:(e,r)=>{const t=e??{};return{...r,...t,settings:cr(t.settings)}}}));function He(e){const r=e==="dark";return{studioBg:r?"#15181d":"#f5f7fa",studioBd:r?"#2a2f38":"#d8dee6",card:r?"#1e222a":"#ffffff",cardBd:r?"#2b313b":"#e6eaf0",inset:r?"#262b34":"#f7f9fb",insetBd:r?"#363d48":"#e9edf2",divider:r?"#262b34":"#f0f3f7",iconTile:r?"#2b313b":"#eef1f6",text:r?"rgba(255,255,255,0.92)":"#1c2127",label:r?"rgba(255,255,255,0.5)":"#9aa4b0",label2:r?"rgba(255,255,255,0.6)":"#7a8593",body:r?"rgba(255,255,255,0.78)":"#5a6573",muted:r?"rgba(255,255,255,0.42)":"#aeb6c0",chevron:r?"rgba(255,255,255,0.42)":"#b3bcc7"}}function br(e){if(!e||e.length<7)return[210,60,45];const r=parseInt(e.slice(1,3),16)/255,t=parseInt(e.slice(3,5),16)/255,o=parseInt(e.slice(5,7),16)/255,i=Math.max(r,t,o),s=Math.min(r,t,o),a=i-s;let l=0,c=0;const g=(i+s)/2;return a&&(c=a/(1-Math.abs(2*g-1)),i===r?l=(t-o)/a%6:i===t?l=(o-r)/a+2:l=(r-t)/a+4,l=Math.round(l*60),l<0&&(l+=360)),[l,Math.round(c*100),Math.round(g*100)]}function le(e,r,t){r/=100,t/=100;const o=i=>{const s=(i+e/30)%12,a=r*Math.min(t,1-t);return Math.round((t-a*Math.max(-1,Math.min(s-3,Math.min(9-s,1))))*255).toString(16).padStart(2,"0")};return"#"+o(0)+o(8)+o(4)}function Se(e){try{const[r,t]=br(e),o=Math.max(t,18);return{50:le(r,Math.max(Math.round(o*.3),10),96),100:le(r,Math.max(Math.round(o*.42),12),91),200:le(r,Math.max(Math.round(o*.55),16),82),300:le(r,Math.max(Math.round(o*.7),20),70),400:le(r,o,60),500:e,600:le(r,Math.min(o+4,100),44),700:le(r,Math.min(o+8,100),36),800:le(r,Math.max(Math.round(o*.92),16),26),900:le(r,Math.max(Math.round(o*.8),14),16)}}catch{return{50:"#eef",100:"#dde",200:"#bbd",300:"#99c",400:"#77b",500:e||"#1565c0",600:"#1257a8",700:"#0e4488",800:"#0a3266",900:"#062044"}}}function pr(e,r){try{const t=l=>{const c=[1,3,5].map(g=>{const f=parseInt(l.slice(g,g+2),16)/255;return f<=.04045?f/12.92:Math.pow((f+.055)/1.055,2.4)});return .2126*c[0]+.7152*c[1]+.0722*c[2]},o=t(e),i=t(r),s=Math.max(o,i),a=Math.min(o,i);return(s+.05)/(a+.05)}catch{return 1}}function ce(e,r){if(!e||e[0]!=="#"||e.length<7)return"rgba(20,30,48,"+r+")";const t=parseInt(e.slice(1,3),16),o=parseInt(e.slice(3,5),16),i=parseInt(e.slice(5,7),16);return"rgba("+t+","+o+","+i+","+r+")"}function kr(e){const r=Se(e.primaryHex),t=Se(e.secondaryHex),o=e.mode==="dark",i=o?r[300]:e.primaryHex,s=o?t[300]:e.secondaryHex,a={pMain:i,pDark:r[700],pLight:r[300],highlight:e.highlightHex||"#ffd400",highlightSoft:ce(e.highlightHex||"#ffd400",.15),highlightBd:ce(e.highlightHex||"#ffd400",.34),pContrast:e.contrastMode==="light"?"#ffffff":e.contrastMode==="dark"?"rgba(0,0,0,0.87)":pr(i,"#ffffff")>=2.9?"#ffffff":"rgba(0,0,0,0.87)",pContainer:o?ce(e.primaryHex,.26):r[50],onPContainer:o?r[100]:r[800],sMain:s,sContrast:pr(s,"#ffffff")>=2.9?"#ffffff":"rgba(0,0,0,0.87)",bgDefault:o?"#121212":"#f3f5f8",paper:o?"#1e1e1e":"#ffffff",paper2:o?"#262630":"#f6f8fb",frameGutterBg:o?"#0a0a0a":"#e3e7ec",footerBg:o?"#17171c":"#eceef2",textPrimary:o?"rgba(255,255,255,0.92)":"rgba(0,0,0,0.87)",textSecondary:o?"rgba(255,255,255,0.62)":"rgba(0,0,0,0.6)",textDisabled:o?"rgba(255,255,255,0.4)":"rgba(0,0,0,0.38)",divider:o?"rgba(255,255,255,0.12)":"rgba(0,0,0,0.12)",outline:o?"rgba(255,255,255,0.23)":"rgba(0,0,0,0.23)"},l=e.statusBold,c=l?e.errorHex:ce(e.errorHex,o?.22:.13),g=l?e.warningHex:ce(e.warningHex,o?.22:.14),f=l?e.infoHex:ce(e.infoHex,o?.22:.13),x=l?e.successHex:ce(e.successHex,o?.22:.13),m=l?"#ffffff":o?Se(e.errorHex)[300]:e.errorHex,h=l?"#ffffff":o?Se(e.warningHex)[300]:Se(e.warningHex)[700],b=l?"#ffffff":o?Se(e.infoHex)[300]:e.infoHex,u=l?"#ffffff":o?Se(e.successHex)[300]:Se(e.successHex)[700],y=br(e.primaryHex)[0],v={neutral:[220,6],warm:[32,26],cool:[210,30],brand:[y,42],slate:[214,16],snow:[0,0]},E=v[e.surfaceTint]||v.neutral,H=e.tintIntensity>=0?e.tintIntensity:100,S=[E[0],Math.round(E[1]*H/100)];o?(a.bgDefault=le(S[0],Math.round(S[1]*.7),7),a.paper=le(S[0],Math.round(S[1]*.7),13),a.paper2=le(S[0],Math.round(S[1]*.85),19)):e.surfaceTint==="snow"&&!(e.tintIntensity>0)?(a.bgDefault="#ffffff",a.paper="#ffffff",a.paper2="#ffffff"):(a.bgDefault=le(S[0],Math.round(S[1]*.9),e.surfaceTint==="brand"?92:e.surfaceTint==="cool"?94:96),a.paper=le(S[0],Math.round(S[1]*.4),99),a.paper2=le(S[0],Math.round(S[1]*.85),e.surfaceTint==="brand"?95:96.5)),e.pageBgHex&&(a.bgDefault=e.pageBgHex),e.cardBgHex&&(a.paper=e.cardBgHex);const C={soft:0,standard:1,medium:2,high:3},B=C[e.contrast]!==void 0?C[e.contrast]:1,D=o?[["rgba(255,255,255,0.82)","rgba(255,255,255,0.55)","rgba(255,255,255,0.09)","rgba(255,255,255,0.16)"],["rgba(255,255,255,0.92)","rgba(255,255,255,0.62)","rgba(255,255,255,0.12)","rgba(255,255,255,0.23)"],["rgba(255,255,255,0.96)","rgba(255,255,255,0.74)","rgba(255,255,255,0.18)","rgba(255,255,255,0.34)"],["#ffffff","rgba(255,255,255,0.87)","rgba(255,255,255,0.26)","rgba(255,255,255,0.46)"]]:[["rgba(0,0,0,0.72)","rgba(0,0,0,0.5)","rgba(0,0,0,0.08)","rgba(0,0,0,0.16)"],["rgba(0,0,0,0.87)","rgba(0,0,0,0.6)","rgba(0,0,0,0.12)","rgba(0,0,0,0.23)"],["rgba(0,0,0,0.92)","rgba(0,0,0,0.7)","rgba(0,0,0,0.18)","rgba(0,0,0,0.34)"],["#000000","rgba(0,0,0,0.8)","rgba(0,0,0,0.24)","rgba(0,0,0,0.46)"]];a.textPrimary=D[B][0],a.textSecondary=D[B][1],a.divider=D[B][2],a.outline=D[B][3],e.textPrimaryHex&&(a.textPrimary=e.textPrimaryHex),e.textSecondaryHex&&(a.textSecondary=e.textSecondaryHex),e.dividerHex&&(a.divider=e.dividerHex),e.nestedStyle==="lighter"?a.paper2=o?le(S[0],Math.round(S[1]*.9),22):le(S[0],Math.max(Math.round(S[1]*.3),4),100):e.nestedStyle==="bordered"?a.paper2=a.paper:a.paper2=o?le(S[0],Math.round(S[1]*.9),Math.max(3,5)):le(S[0],Math.min(Math.round(S[1]*1.1),60),Math.max(88,94-S[1]*.18));const $=e.btnColorHex||i,X=e.accentGradient?"linear-gradient(135deg,"+$+","+(e.btnColorHex?Se(e.btnColorHex)[700]:r[o?500:700])+")":$,Q=e.btnTextHex||(pr($,"#ffffff")>=2.9?"#ffffff":"rgba(0,0,0,0.87)"),Y=e.h1Color||null,d=e.h2Color||null,I=e.h3Color||null,P=e.h4Color||null,W=e.h5Color||null,z=e.h6Color||null,q=[{key:"sm",px:13},{key:"df",px:12},{key:"lg",px:18}],U=q.find(me=>me.key===e.textSize)||q[1],G=e.baseFontPx>0?e.baseFontPx:U.px,R=e.bodyLineHeight>0?e.bodyLineHeight:1.5,O=e.h1Size>0?e.h1Size:20,J=Math.round(O*1.1),V=O,N=Math.max(Math.round(O*.9),11),M=Math.max(Math.round(O*.8),11),j=Math.max(Math.round(O*.7),10),A=Math.max(Math.round(O*.6),10),k=Math.max(Math.round(O*.5),9),T=G,K=Math.round(G*.92),se=Math.round(G*.8),F=Math.round(G*.72),fe=e.headingWeight,Oe=e.headingLH>0?e.headingLH:1.2,De=e.bodyWeight>0?e.bodyWeight:400,Ve=Math.min(900,De+200),Ue={compact:.82,default:1,comfortable:1.16},Be=e.densityScale>0?e.densityScale/100:Ue[e.density]??1,Xt=Math.round(20*Be),Me=Math.round(14*Be),St=e.cardGapPx>0?e.cardGapPx:Math.round(16*Be),Ge=Math.round(11*Be*({compact:.66,default:1,comfortable:1.32}[e.tableDensity]??1)),Fe=e.containerPadPx>0?e.containerPadPx:Math.round(10*Be),Z=e.radiusVal,ct=Z+"px",pt=Math.max(Math.round(Z*.6),2)+"px",We={0:"none",1:"0px 2px 1px -1px rgba(0,0,0,0.2),0px 1px 1px 0px rgba(0,0,0,0.14),0px 1px 3px 0px rgba(0,0,0,0.12)",2:"0px 3px 3px -2px rgba(0,0,0,0.2),0px 3px 4px 0px rgba(0,0,0,0.14),0px 1px 8px 0px rgba(0,0,0,0.12)",4:"0px 2px 4px -1px rgba(0,0,0,0.2),0px 4px 5px 0px rgba(0,0,0,0.14),0px 1px 10px 0px rgba(0,0,0,0.12)",8:"0px 5px 5px -3px rgba(0,0,0,0.2),0px 8px 10px 1px rgba(0,0,0,0.14),0px 3px 14px 2px rgba(0,0,0,0.12)"},Rr="1px solid rgba(255,255,255,0.06)";let ut,Ye,Ct;e.cardStyle==="outlined"?(ut="none",Ye="1.5px solid "+a.outline,Ct="none"):e.cardStyle==="soft"?(ut=We[1],Ye=o?Rr:"none",Ct=We[1]):(ut=We[8],Ye=o?Rr:"none",Ct=We[4]),e.cardShadowPx>=0&&(ut="0 "+Math.round(e.cardShadowPx*.45)+"px "+e.cardShadowPx+"px rgba(16,24,40,"+(o?.55:.16)+")");let jt="transparent",Er="1px solid "+a.divider,Qt="none";e.cardHeader==="plain"?Er="none":e.cardHeader==="tinted"?jt=a.pContainer:e.cardHeader==="accent"&&(Qt="inset 3px 0 0 "+i),e.headerStrength>=0&&(e.cardHeader==="tinted"?jt=ce(e.primaryHex,(o?.14:.08)*(e.headerStrength/100)):e.cardHeader==="accent"&&(Qt="inset "+Math.round(e.headerStrength*.06)+"px 0 0 "+i)),e.cardHdrHex&&(jt=e.cardHdrHex);const Gn=o?"none":We[4],Yn=o?"1px solid "+a.divider:"none",Jn=e.nestedStyle==="bordered"?"1.5px solid "+a.outline:"1px solid "+a.divider,qn=e.nestedDepth>0?"inset 3px 0 0 "+ce(e.primaryHex,.55)+", 0 "+Math.round(e.nestedDepth*.4)+"px "+e.nestedDepth+"px rgba(16,24,40,"+(o?.42:.1)+")":"none",Kn=(e.appName||"").trim().split(/\s+/).slice(0,2).map(me=>me[0]||"").join("").toUpperCase()||"AP",Xn=!!(e.logoMode==="image"&&e.logoUrl),Qn=!!e.loginImage,Hr=me=>{const be=me||"Roboto";return be.includes(" ")&&!be.startsWith('"')&&!be.startsWith("'")?`"${be}"`:be},Zn=Hr(e.headingFont||e.fontFamily),eo=Hr(e.fontFamily),ye=br(e.primaryHex)[0],xe=(me,be)=>le((me%360+360)%360,62,o?60:46),Pr={brand:[i,s,xe(ye+42),xe(ye+205),xe(ye+120)],categorical:[xe(ye),xe(ye+72),xe(ye+144),xe(ye+216),xe(ye+288)],sequential:[le(ye,55,o?40:78),le(ye,60,o?50:64),i,le(ye,70,o?70:38),le(ye,78,o?82:26)],cbsafe:["#0072B2","#E69F00","#009E73","#CC79A7","#56B4E9"],warm:[xe(8),xe(28),xe(45),xe(350),xe(18)],cool:[xe(200),xe(220),xe(255),xe(180),xe(235)]},to=Pr[e.chartScheme]||Pr.brand,ro=[r[600],t[600],le((ye+42)%360,55,46),le((ye+205)%360,50,46)],no={error:{cb:c,cc:m},success:{cb:x,cc:u},info:{cb:f,cc:b},warning:{cb:g,cc:h}},Zt=e.mapGlass==="light",oo=Zt?"rgba(255,255,255,0.84)":"rgba(15,20,28,0.74)",io=Zt?"#1c2733":"#f3f6fa",ao=Zt?"rgba(0,0,0,0.12)":"rgba(255,255,255,0.18)",so="repeating-linear-gradient(45deg, rgba(255,255,255,0.04) 0px, rgba(255,255,255,0.04) 11px, rgba(255,255,255,0) 11px, rgba(255,255,255,0) 22px), radial-gradient(circle at 50% 38%, "+ce(i,.22)+", rgba(0,0,0,0) 60%), "+"#0f141c",lo="linear-gradient(135deg,"+i+","+r[700]+")",co="linear-gradient(180deg,"+ce(r[900],.12)+","+ce(r[900],.55)+")",po="linear-gradient(135deg,"+r[700]+","+r[900]+")",uo="linear-gradient(135deg,"+ce(r[900],.55)+","+ce(e.primaryHex,.45)+")",$r={"top-right":{top:"14px",right:"14px"},"top-center":{top:"14px",left:"50%",transform:"translateX(-50%)"},"bottom-right":{bottom:"14px",right:"14px"},"bottom-left":{bottom:"14px",left:"14px"}},fo=$r[e.notifPosition]||$r["top-right"],Ir=e.notifAccent==="primary"?{bar:i,icbg:a.pContainer,icc:a.onPContainer,dot:i}:e.notifAccent==="mono"?{bar:a.textSecondary,icbg:a.paper2,icc:a.textPrimary,dot:a.textSecondary}:{bar:e.warningHex,icbg:g,icc:h,dot:e.warningHex};let wt;e.notifStyle==="toast"?wt={boxShadow:We[8],border:typeof Ye=="string"&&Ye!=="none"?Ye:"none"}:e.notifStyle==="banner"?wt={boxShadow:We[2],borderLeft:"4px solid "+Ir.bar}:wt={boxShadow:"none",border:"1px solid "+a.divider};const ho=e.notifCardHex||(o?"#1e1e1e":"#ffffff"),go={compact:"7px",default:"11px",comfortable:"16px"},xo={compact:"6px",default:"12px",comfortable:"22px"},mo={top:"flex-start",middle:"center",bottom:"flex-end"},yo={left:"flex-start",center:"center",right:"flex-end"},bo={plain:"transparent",tinted:a.paper2,accent:a.highlightSoft},vo={rowPy:go[e.tableDensity]||"11px",cellPx:xo[e.tableColDensity]||"12px",rowBorder:e.tableDividers?(e.tableRowDivW||1)+"px solid "+a.divider:"none",colBorder:e.tableColDividers?(e.tableColDivW||1)+"px solid "+a.divider:"none",headBg:bo[e.tableHeaderStyle]||a.paper2,cellAI:mo[e.tableCellAlignV]||"center",cellJC:yo[e.tableCellAlignH]||"flex-start",stripeBg:o?"rgba(255,255,255,0.035)":"rgba(0,0,0,0.028)",statusMap:{Delivered:{sb:x,sc:u},Processing:{sb:a.pContainer,sc:o?a.pLight:a.pDark},Pending:{sb:g,sc:h},Shipped:{sb:f,sc:b}},filters:["All","Delivered","Processing","Pending"].map((me,be)=>({label:me,bg:be===0?a.highlightSoft:"transparent",c:be===0?a.textPrimary:a.textSecondary,brd:be===0?a.highlightBd:a.outline}))},So={sm:"Small",df:"Default",lg:"Large"},Co={compact:"Compact",default:"Default",comfortable:"Comfortable"},jo={outlined:"Outlined",soft:"Soft",floating:"Floating"},wo={sharp:"Sharp",rounded:"Rounded",round:"Round"},To=[{key:"sidebar",label:"Sidebar",desc:"Full drawer",ic:"▤"},{key:"rail",label:"Rail",desc:"Icons only",ic:"▥"},{key:"topbar",label:"Top Bar",desc:"Horizontal",ic:"▦"}],ko=e.fontFamily+" · "+(So[e.textSize]||"Default"),Bo=(wo[e.radiusPreset]||"Custom")+" · "+(Co[e.density]||"Default")+" · "+(jo[e.cardStyle]||"Soft"),Ro=[{label:"General",ic:"◉"},{label:"Appearance",ic:"◧"},{label:"Modules",ic:"◫"},{label:"Team",ic:"◍"},{label:"Security",ic:"▣"},{label:"Billing",ic:"◳"}].map((me,be)=>({...me,on:be===1,bg:be===1?a.highlightSoft:"transparent",c:be===1?a.textPrimary:a.textSecondary,bar:be===1?"3px solid "+a.highlight:"3px solid transparent"})),Eo=To.map(me=>({...me,active:e.navPattern===me.key,brd:e.navPattern===me.key?i:a.divider,bg:e.navPattern===me.key?a.pContainer:a.paper,color:e.navPattern===me.key?a.onPContainer:a.textPrimary})),Ho=e.sidebarWidth,Po=e.appBarH>0?e.appBarH:56,$o=e.appBarH>0?e.appBarH+"px":"Auto (56px)";return{pal:r,spal:t,isDark:o,pMain:i,sMain:s,t:a,errSoft:c,warnSoft:g,infoSoft:f,sucSoft:x,errTxt:m,warnTxt:h,infoTxt:b,sucTxt:u,sevMap:no,accentBg:X,btnText:Q,hc1:Y,hc2:d,hc3:I,hc4:P,hc5:W,hc6:z,base:G,bodyLH:R,h1base:O,tDisplay:J,tH1:V,tH2:N,tTitle:M,tH4:j,tH5:A,tH6:k,tBody:T,tBodySm:K,tCaption:se,tOverline:F,wH1:fe,wH2:fe,wH3:fe,wH4:fe,wH5:fe,wH6:fe,headLH:Oe,bodyWeightEff:De,bwEmph:Ve,pad:Xt,padSm:Me,gap:St,rowPy:Ge,screenPad:Fe,r:Z,rad:ct,radSm:pt,SH:We,cardShadow:ut,cardBorder:Ye,btnShadow:Ct,cardHdrBg:jt,cardHdrBorder:Er,cardHdrAccent:Qt,appbarShadow:Gn,appbarBorder:Yn,nestBorder:Jn,nestShadow:qn,iconInitials:Kn,hasLogo:Xn,hasLoginImage:Qn,headFam:Zn,bodyFam:eo,chartHue:ye,chartPalette:to,avatarColors:ro,overlaySurface:oo,onOverlay:io,overlayBorder:ao,mediaBg:so,loginBrandGrad:lo,loginScrimGrad:co,loginCenteredGrad:po,loginScrimGradC:uo,npos:fo,nacc:Ir,toastDeco:wt,toastBg:ho,btnCase:e.btnCase!=="none"?"uppercase":"none",table:vo,typeSummary:ko,shapeSummary:Bo,settingsCats:Ro,navSettingsChips:Eo,sidebarWidth:Ho,appBarHEff:Po,appBarHLabel:$o}}function ks({icon:e,title:r,info:t,open:o,dimmed:i,onToggle:s,onPreviewMenu:a,children:l}){const c=L(v=>v.settings),g=c.mode==="dark",f=c.primaryHex||"#1565c0",x=He(c.mode),m=Se(f),h=kr(c),b=o?g?ce(f,.22):ce(f,.1):"transparent",u=o?g?m[200]:m[700]:x.text,y=o?f:x.chevron;return n.jsxs(p.Box,{sx:{background:b,opacity:i?.1:1,transform:o?"translateY(-2px)":"none",transition:"opacity .22s ease, transform .22s ease",borderBottom:`1px solid ${x.divider}`,overflow:"hidden"},children:[n.jsxs(p.Box,{component:"button",onClick:s,sx:{width:"100%",display:"flex",alignItems:"center",gap:"9px",p:"7px 11px",background:"transparent",border:"none",textAlign:"left",cursor:"pointer",fontFamily:"inherit"},children:[n.jsx(p.Box,{sx:{width:32,height:32,borderRadius:"10px",background:x.iconTile,color:x.body,display:"grid",placeItems:"center",flexShrink:0,position:"relative"},children:e}),n.jsx(p.Box,{sx:{flex:1,minWidth:0},children:n.jsx(p.Box,{sx:{fontSize:`${h.tH5}px`,fontWeight:h.wH5,fontFamily:`${h.headFam},sans-serif`,lineHeight:1.25,color:u,letterSpacing:"-.2px",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:r})}),a&&n.jsx(p.Box,{component:"span",title:"Change preview screen",onClick:v=>{v.stopPropagation(),a()},sx:{width:16,height:16,mr:"6px",flexShrink:0,cursor:"pointer",display:"grid",placeItems:"center",color:x.chevron,transition:"filter .15s ease, transform .1s ease","&:hover":{filter:"brightness(1.15)",transform:"scale(1.12)"}},children:n.jsxs("svg",{width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[n.jsx("rect",{x:"2",y:"3",width:"20",height:"14",rx:"2"}),n.jsx("path",{d:"M8 21h8M12 17v4"})]})}),t&&n.jsx(p.Box,{component:"span",title:t,sx:{width:15,height:15,borderRadius:"50%",border:`1.2px solid ${x.chevron}`,color:x.chevron,fontSize:"9px",fontWeight:800,fontStyle:"italic",fontFamily:"Georgia, serif",display:"grid",placeItems:"center",mr:"7px",flexShrink:0,cursor:"help"},children:"i"}),n.jsx(p.Box,{sx:{width:20,height:20,borderRadius:"6px",display:"grid",placeItems:"center",fontSize:"9px",color:y,flexShrink:0,transition:"background .18s, border-color .18s"},children:n.jsx(p.Box,{component:"span",sx:{display:"block",lineHeight:1,transform:o?"rotate(180deg)":"none",transition:"transform .2s"},children:"▼"})})]}),n.jsx(p.Collapse,{in:o,unmountOnExit:!0,timeout:280,children:n.jsx(p.Box,{sx:{p:"2px 13px 12px",borderTop:`1px solid ${x.divider}`},children:l})})]})}function ve(){const e=L(r=>r.settings);return _.useMemo(()=>kr(e),[e])}function tt({tabs:e,active:r,onChange:t}){const o=L(m=>m.settings.mode),i=L(m=>m.settings.primaryHex)||"#1565c0",s=L(m=>m.settings.highlightHex)||"#ffd400",a=L(m=>m.settings.bodyWeight)||400,l=o==="dark",c=Math.min(900,a+200),g=ve(),f=l?"#e6edf3":"#1c2127",x=l?"#cdd4de":"#5a6573";return n.jsx(p.Box,{sx:{display:"flex",gap:"2px",mb:"2px",px:"2px",borderBottom:"1.5px solid rgba(120,130,145,0.5)"},children:e.map(m=>{const h=m.key===r,b=n.jsx(p.Button,{onClick:()=>t(m.key),disableRipple:!0,sx:{flex:1,minWidth:0,px:"2px",pt:"9px",pb:"8px",minHeight:44,borderRadius:"6px 6px 0 0",mb:"-1px",fontSize:`${g.tBodySm}px`,fontFamily:`${g.headFam},sans-serif`,fontWeight:h?c:a,letterSpacing:0,textTransform:"none",whiteSpace:"normal",lineHeight:1.15,textAlign:"center",color:h?f:x,opacity:h?1:.3,bgcolor:h?ce(s,l?.26:.18):"transparent",borderBottom:h?`3px solid ${i}`:"2px solid transparent",transition:"color .16s ease, background .16s ease, border-color .16s ease, opacity .16s ease","&:hover":h?{bgcolor:ce(s,l?.26:.18)}:{opacity:1,bgcolor:"rgba(150,160,175,0.35)",borderRadius:"8px",boxShadow:"0 6px 18px rgba(0,0,0,0.35)",transform:"translateY(-2px)"}},children:m.label},m.key);return m.info?n.jsx(p.Tooltip,{title:m.info,arrow:!0,slotProps:{popper:{style:{pointerEvents:"none"}}},children:b},m.key):b})})}const Mt=[{id:"corporate",name:"Corporate Blue",snap:{primaryHex:"#1565c0",secondaryHex:"#00897b",iconColor:"#1565c0"}},{id:"emerald",name:"Emerald",snap:{primaryHex:"#2e7d32",secondaryHex:"#00897b",iconColor:"#2e7d32"}},{id:"indigo",name:"Indigo Violet",snap:{primaryHex:"#3949ab",secondaryHex:"#7c4dff",iconColor:"#3949ab"}},{id:"slate",name:"Graphite",snap:{primaryHex:"#455a64",secondaryHex:"#78909c",iconColor:"#455a64"}},{id:"teal",name:"Ocean Teal",snap:{primaryHex:"#00838f",secondaryHex:"#0277bd",iconColor:"#00838f"}},{id:"amber",name:"Amber",snap:{primaryHex:"#e65100",secondaryHex:"#d84315",iconColor:"#e65100"}}];function Bs(){var N,M;const[e,r]=_.useState("presets"),t=L(j=>j.settings),o=t.mode==="dark",i=t.highlightHex||"#ffd400",s=ce(i,o?.3:.18),a=o?"#e6edf3":"#1c2127",l=o?"rgba(255,255,255,0.82)":"#2c333d",c=L(j=>j.savedThemes),g=L(j=>j.applyPreset),f=L(j=>j.applySaved),x=L(j=>j.saveTheme),m=L(j=>j.updateSaved),h=L(j=>j.renameSaved),b=L(j=>j.deleteSaved),u=L(j=>j.importTheme),y=L(j=>j.set),v=L(j=>j.isDirty),E=L(j=>j.editingSavedId),H=L(j=>j.lastImportedId),S=c.find(j=>j.id===E),C=(j,A)=>{const k=new Blob([JSON.stringify({name:j,snap:A},null,2)],{type:"application/json"}),T=URL.createObjectURL(k),K=document.createElement("a");K.href=T,K.download=`${j.replace(/[^a-z0-9]+/gi,"-").toLowerCase()}.theme.json`,K.click(),URL.revokeObjectURL(T)},[B,D]=_.useState("");_.useEffect(()=>{if(!B)return;const j=setTimeout(()=>D(""),5e3);return()=>clearTimeout(j)},[B]);const[$,X]=_.useState(null),Q=j=>{const A=c.map(K=>K.name.toLowerCase());let k=j,T=2;for(;A.includes(k.toLowerCase());)k=`${j} ${T++}`;return k},Y=j=>{var T;const A=(T=j.target.files)==null?void 0:T[0];if(!A)return;const k=new FileReader;k.onload=()=>{try{const K=JSON.parse(k.result),se=K.snap??K;if(!Ts(se)){D("Invalid theme file. The selected file is not a valid Theme Studio export.");return}const F=K.name||"Imported Theme";if(c.some(fe=>fe.name.toLowerCase()===F.toLowerCase())){X({name:F,snap:se});return}D(""),u(F,se)}catch{D("Invalid theme file. The selected file is not a valid Theme Studio export.")}},k.readAsText(A),j.target.value=""},[d,I]=_.useState(null),[P,W]=_.useState(!1),[z,q]=_.useState(""),[U,G]=_.useState(null),[R,O]=_.useState(null),J=(S==null?void 0:S.name)||((N=Mt.find(j=>j.id===t.presetId))==null?void 0:N.name)||((M=c.find(j=>j.id===t.presetId))==null?void 0:M.name)||"Custom Theme",V=(j,A)=>{const k=j.trim();return k?c.some(T=>T.name.toLowerCase()===k.toLowerCase()&&T.id!==A)?"Name already exists":"":"Name required"};return n.jsxs(n.Fragment,{children:[n.jsx(tt,{active:e,onChange:r,tabs:[{key:"presets",label:"Presets",info:"Ready-made colour themes."},{key:"saved",label:"My Themes",info:"Your saved custom themes."},{key:"mode",label:"Mode",info:"Light / Dark."}]}),n.jsxs(p.Box,{sx:{p:"12px 2px 2px"},children:[e==="presets"&&n.jsx(p.Box,{sx:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:"9px"},children:Mt.map(j=>{const A=t.presetId===j.id;return n.jsxs(p.Box,{onClick:()=>g(j.id,j.snap),title:`${j.name} — applies this colour palette`,sx:{display:"flex",alignItems:"center",gap:"9px",p:"9px 10px",borderRadius:"11px",cursor:"pointer",textAlign:"left",border:`1px solid ${A?i:o?"#363d48":"#e3e8ee"}`,bgcolor:A?s:o?"#262b34":"#ffffff",transition:"all .14s ease"},children:[n.jsxs(p.Box,{sx:{display:"flex",flexDirection:"column",gap:"2px",flexShrink:0},children:[n.jsx(p.Box,{sx:{width:20,height:11,borderRadius:"3px",bgcolor:j.snap.primaryHex}}),n.jsx(p.Box,{sx:{width:20,height:7,borderRadius:"2px",bgcolor:j.snap.secondaryHex}})]}),n.jsx(p.Box,{component:"span",sx:{fontSize:"11px",fontWeight:600,color:A?a:l,lineHeight:1.3},children:j.name})]},j.id)})}),e==="saved"&&n.jsxs(p.Box,{sx:{display:"flex",flexDirection:"column",gap:1},children:[c.length===0&&n.jsx(p.Typography,{variant:"caption",sx:{color:"text.secondary",py:2,textAlign:"center"},children:"No saved themes yet."}),n.jsx(p.Box,{sx:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:.9},children:c.map(j=>{const A=E===j.id;return n.jsxs(p.Box,{onClick:()=>f(j),title:"Apply this saved theme",sx:{display:"flex",flexDirection:"column",gap:.9,p:"9px 10px",borderRadius:"11px",cursor:"pointer",position:"relative",border:`1px solid ${A?i:o?"#363d48":"#e3e8ee"}`,bgcolor:A?s:o?"#262b34":"#ffffff",transition:"all .14s ease"},children:[A&&H===j.id&&n.jsx(p.Tooltip,{title:"recently upload",arrow:!0,children:n.jsx(p.Box,{component:"span",sx:{position:"absolute",top:-2,right:0,width:6,height:6,borderRadius:"50%",bgcolor:"error.main",flexShrink:0}})}),n.jsxs(p.Box,{sx:{display:"flex",alignItems:"center",gap:1},children:[n.jsxs(p.Box,{sx:{display:"flex",flexDirection:"column",gap:"2px",flexShrink:0},children:[n.jsx(p.Box,{sx:{width:20,height:11,borderRadius:"3px",bgcolor:j.snap.primaryHex}}),n.jsx(p.Box,{sx:{width:20,height:7,borderRadius:"2px",bgcolor:j.snap.secondaryHex}})]}),n.jsx(p.Box,{component:"span",sx:{flex:1,minWidth:0,fontSize:"11px",fontWeight:600,color:A?a:l,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"normal"},children:j.name}),n.jsx(p.Box,{sx:{display:"flex",alignItems:"center",justifyContent:"flex-end"},children:n.jsx(p.Box,{component:"span",onClick:k=>{k.stopPropagation(),I({el:k.currentTarget,id:j.id})},sx:{cursor:"pointer",color:"text.muted",px:.5},children:"⋮"})})]})]},j.id)})}),B&&n.jsxs(p.Box,{sx:{display:"flex",alignItems:"flex-start",gap:1,bgcolor:"rgba(211,47,47,0.08)",border:"1px solid rgba(211,47,47,0.35)",borderRadius:"10px",px:1.5,py:1.25,color:"#b3261e"},children:[n.jsx(p.Box,{component:"span",sx:{fontWeight:900,fontSize:15,lineHeight:1.4},children:"!"}),n.jsx(p.Box,{sx:{fontSize:12.5,lineHeight:1.4},children:B})]}),n.jsxs(p.Box,{sx:{display:"flex",gap:1,mt:1},children:[n.jsxs(p.Button,{size:"small",variant:"outlined",component:"label",sx:{flex:1,textTransform:"none"},children:["↑ Import",n.jsx("input",{hidden:!0,type:"file",accept:".json,application/json",onChange:Y})]}),n.jsx(p.Button,{size:"small",variant:"outlined",onClick:()=>C(J,t),sx:{flex:1,textTransform:"none"},children:"⤓ Download"}),n.jsx(p.Button,{size:"small",variant:"contained",disabled:!v(),onClick:()=>{q(S?S.name:""),W(!0)},sx:{flex:1,textTransform:"none"},children:"+ Save"})]})]}),e==="mode"&&n.jsx(p.Box,{sx:{display:"flex",gap:1},children:["light","dark"].map(j=>n.jsx(p.Button,{onClick:()=>y({mode:j}),variant:t.mode===j?"contained":"outlined",sx:{flex:1,textTransform:"capitalize"},children:j},j))})]}),n.jsxs(p.Menu,{open:!!d,anchorEl:d==null?void 0:d.el,onClose:()=>I(null),children:[n.jsx(p.MenuItem,{onClick:()=>{const j=c.find(A=>A.id===d.id);f(j),I(null)},children:"✏️ Edit"}),n.jsx(p.MenuItem,{onClick:()=>{const j=c.find(A=>A.id===d.id);G({id:j.id,name:j.name}),I(null)},children:"✎ Rename"}),n.jsx(p.MenuItem,{onClick:()=>{const j=c.find(A=>A.id===d.id);O({id:j.id,name:j.name}),I(null)},children:"🗑 Delete"}),n.jsx(p.MenuItem,{onClick:()=>{const j=c.find(A=>A.id===d.id);C(j.name,j.snap),I(null)},children:"⤓ Download"})]}),n.jsxs(p.Dialog,{open:P,onClose:()=>W(!1),children:[n.jsx(p.DialogTitle,{children:S?`Save changes to “${S.name}”`:"Save theme"}),n.jsx(p.DialogContent,{children:n.jsx(p.TextField,{autoFocus:!0,fullWidth:!0,size:"small",label:"Theme name",value:z,onChange:j=>q(j.target.value),error:!!V(z,S==null?void 0:S.id),helperText:V(z,S==null?void 0:S.id),sx:{mt:1}})}),n.jsxs(p.DialogActions,{children:[n.jsx(p.Button,{onClick:()=>W(!1),children:"Cancel"}),S&&n.jsx(p.Button,{variant:"contained",disabled:!!V(z,S.id),onClick:()=>{m(S.id,z.trim(),t),W(!1)},children:"Update"}),n.jsx(p.Button,{variant:S?"outlined":"contained",disabled:!!V(z),onClick:()=>{x(z.trim()),W(!1)},children:S?"Save as New":"Save"})]})]}),n.jsxs(p.Dialog,{open:!!U,onClose:()=>G(null),children:[n.jsx(p.DialogTitle,{children:"Rename theme"}),n.jsx(p.DialogContent,{children:n.jsx(p.TextField,{autoFocus:!0,fullWidth:!0,size:"small",label:"New name",value:(U==null?void 0:U.name)??"",onChange:j=>G(A=>A&&{...A,name:j.target.value}),error:!!(U&&V(U.name,U.id)),helperText:U?V(U.name,U.id):"",sx:{mt:1}})}),n.jsxs(p.DialogActions,{children:[n.jsx(p.Button,{onClick:()=>G(null),children:"Cancel"}),n.jsx(p.Button,{variant:"contained",disabled:!!(U&&V(U.name,U.id)),onClick:()=>{h(U.id,U.name.trim()),G(null)},children:"Rename"})]})]}),n.jsxs(p.Dialog,{open:!!$,onClose:()=>X(null),children:[n.jsx(p.DialogTitle,{children:"Theme already exists"}),n.jsx(p.DialogContent,{children:n.jsxs(p.Typography,{variant:"body2",children:["A theme named “",$==null?void 0:$.name,"” is already in My Themes. Upload it anyway as a copy?"]})}),n.jsxs(p.DialogActions,{children:[n.jsx(p.Button,{onClick:()=>{X(null),D("You’ve selected a duplicate file — it already exists.")},children:"Cancel"}),n.jsx(p.Button,{variant:"contained",onClick:()=>{u(Q($.name),$.snap),X(null)},children:"Yes, continue"})]})]}),n.jsxs(p.Dialog,{open:!!R,onClose:()=>O(null),children:[n.jsx(p.DialogTitle,{children:"Delete theme"}),n.jsx(p.DialogContent,{children:n.jsxs(p.Typography,{variant:"body2",children:["Delete “",R==null?void 0:R.name,"”? This cannot be undone."]})}),n.jsxs(p.DialogActions,{children:[n.jsx(p.Button,{onClick:()=>O(null),children:"Cancel"}),n.jsx(p.Button,{color:"error",variant:"contained",onClick:()=>{b(R.id),O(null)},children:"Delete"})]})]})]})}function Rs({tip:e,sk:r}){return n.jsx(p.Box,{component:"span",title:e,sx:{width:13,height:13,borderRadius:"50%",border:`1.1px solid ${r.chevron}`,color:r.chevron,fontSize:8,fontWeight:800,fontStyle:"italic",fontFamily:"Georgia, serif",display:"inline-grid",placeItems:"center",flexShrink:0,cursor:"help",verticalAlign:"middle"},children:"i"})}function qe({children:e,tip:r,sk:t,mt:o}){const i=ve();return n.jsxs(p.Box,{sx:{fontSize:`${i.tCaption}px`,fontWeight:i.bwEmph,fontFamily:`${i.bodyFam},sans-serif`,color:t.label2,textTransform:"uppercase",letterSpacing:".5px",mb:"6px",mt:o?`${o}px`:0,display:"flex",alignItems:"center",gap:"5px"},children:[e,r&&n.jsx(Rs,{tip:r,sk:t})]})}function st({value:e,onChange:r,w:t=30,h:o=24,r:i=7,border:s,sk:a}){return n.jsx(p.Box,{sx:{width:t,height:o,borderRadius:`${i}px`,position:"relative",overflow:"hidden",flexShrink:0,background:e,border:s?`1px solid ${a.insetBd}`:"none"},children:n.jsx(p.Box,{component:"input",type:"color",value:e,onChange:l=>r(l.target.value),sx:{position:"absolute",top:-4,left:-4,width:t+10,height:o+10,opacity:0,cursor:"pointer",border:"none",p:0}})})}const Es=/^#[0-9a-fA-F]{6}$/;function Hs({value:e,onCommit:r,onWarnChange:t}){const[o,i]=_.useState(!1),[s,a]=_.useState(e),[l,c]=_.useState(""),g=_.useRef(void 0);_.useEffect(()=>{o||a(e)},[e,o]),_.useEffect(()=>()=>clearTimeout(g.current),[]);const f=m=>{clearTimeout(g.current),c(m),t==null||t(m),m&&(g.current=setTimeout(()=>{c(""),t==null||t("")},3e3))},x=m=>{const h=m.trim();return Es.test(h)?(f(""),r(h),!0):(f("Enter a valid hex colour, e.g. #1565c0"),!1)};return o?n.jsx(p.InputBase,{autoFocus:!0,value:s,title:l||void 0,onChange:m=>{a(m.target.value)},onBlur:()=>{x(s)||a(e),i(!1)},onKeyDown:m=>{m.key==="Enter"&&x(s)&&i(!1),m.key==="Escape"&&(a(e),f(""),i(!1))},sx:{color:l?"#ffcdd2":"#fff",fontSize:"12.5px",fontWeight:700,width:100,position:"relative",zIndex:1}}):n.jsxs(p.Box,{component:"span",title:l||void 0,onClick:()=>{a(e),i(!0)},sx:{color:l?"#ffcdd2":"rgba(255,255,255,.85)",fontSize:"12.5px",fontWeight:700,cursor:"text",position:"relative",zIndex:1},children:[e," · tap to change"]})}function Ps(){const[e,r]=_.useState("brand"),[t,o]=_.useState(""),i=L(v=>v.settings),s=L(v=>v.set),a=He(i.mode),l=ve(),c={fontSize:"11.5px",color:a.body,fontWeight:600},g={fontSize:`${l.tBodySm}px`,color:a.body,fontWeight:l.bodyWeightEff,fontFamily:`${l.bodyFam},sans-serif`,lineHeight:l.bodyLH},f=i.primaryHex||"#1565c0",x=Se(f),m=[50,100,200,300,400,500,600,700,800,900].map(v=>x[v]),h=v=>s({...v,presetId:"custom"}),b=[{key:"h1Color",label:"H1 · Page Title"},{key:"h2Color",label:"H2 · Metric"},{key:"h3Color",label:"H3 · Card Title"},{key:"h4Color",label:"H4 · Section Label"},{key:"h5Color",label:"H5 · Caption"},{key:"h6Color",label:"H6 · Overline"}],u=[{key:"successHex",label:"Success"},{key:"warningHex",label:"Warning"},{key:"infoHex",label:"Info"},{key:"errorHex",label:"Error"}],y=[{key:"cardBgHex",label:"Card background",fb:"#ffffff"},{key:"cardHdrHex",label:"Card header",fb:"#f6f8fb"},{key:"pageBgHex",label:"Page background",fb:"#f4f6f9"},{key:"notifCardHex",label:"Notification background",fb:"#ffffff"}];return n.jsxs(p.Box,{sx:{display:"flex",flexDirection:"column",gap:"11px"},children:[n.jsx(tt,{active:e,onChange:r,tabs:[{key:"brand",label:"Brand",info:"Core brand colours — primary, secondary and the selection highlight colour used across the app."},{key:"text",label:"Text",info:"Heading and body text colours"},{key:"status",label:"Status",info:"Status colours & surface overrides"}]}),n.jsxs(p.Box,{sx:{p:"12px 2px 2px",display:"flex",flexDirection:"column",gap:"11px"},children:[e==="brand"&&n.jsxs(p.Box,{sx:{display:"flex",flexDirection:"column",gap:"11px"},children:[n.jsxs(p.Box,{children:[n.jsx(qe,{sk:a,tip:"Primary brand colour — main/filled buttons, active sidebar item, links, focus rings, first chart series, and the login Sign-in button.",children:"Brand Color"}),n.jsxs(p.Box,{sx:{position:"relative",height:46,borderRadius:"11px",background:f,overflow:"hidden",display:"flex",alignItems:"center",px:"14px",boxShadow:`0 3px 10px ${f}44`},children:[n.jsx(Hs,{value:f,onCommit:v=>h({primaryHex:v}),onWarnChange:o}),n.jsx(p.Box,{component:"input",type:"color",value:f,onChange:v=>h({primaryHex:v.target.value}),sx:{position:"absolute",inset:0,width:"100%",height:"100%",opacity:0,cursor:"pointer",border:"none",p:0}})]}),n.jsx(p.Box,{sx:{display:"flex",gap:"2px",borderRadius:"7px",overflow:"hidden",height:14,mt:"7px"},children:m.map((v,E)=>n.jsx(p.Box,{sx:{flex:1,background:v}},E))}),t&&n.jsxs(p.Box,{sx:{display:"inline-flex",alignItems:"center",gap:"6px",mt:"8px",px:"10px",py:"6px",borderRadius:"8px",bgcolor:l.warnSoft,border:`1px solid ${l.warnTxt}`,color:l.warnTxt,fontSize:12,fontWeight:600},children:[n.jsx(p.Box,{component:"span",sx:{fontSize:13,lineHeight:1},children:"⚠"}),t]})]}),n.jsxs(p.Box,{children:[n.jsx(qe,{sk:a,tip:"Secondary accent — secondary/outlined buttons, switches & toggles, selected chips, and the second data series in charts.",children:"Secondary / Accent"}),n.jsx(p.Box,{sx:{position:"relative",height:34,borderRadius:"9px",background:i.secondaryHex,overflow:"hidden"},children:n.jsx(p.Box,{component:"input",type:"color",value:i.secondaryHex,onChange:v=>h({secondaryHex:v.target.value}),sx:{position:"absolute",inset:0,width:"100%",height:"100%",opacity:0,cursor:"pointer",border:"none",p:0}})})]}),n.jsxs(p.Box,{children:[n.jsx(qe,{sk:a,tip:"Accent colour used to draw attention — highlight panels, featured badges, callouts. Defaults to the brand colour.",children:"Highlight Colour"}),n.jsx(p.Box,{sx:{position:"relative",height:34,borderRadius:"8px",background:i.highlightHex||"#ffd400",overflow:"hidden",border:`1px solid ${a.insetBd}`},children:n.jsx(p.Box,{component:"input",type:"color",value:i.highlightHex||"#ffd400",onChange:v=>h({highlightHex:v.target.value}),sx:{position:"absolute",inset:0,width:"100%",height:"100%",opacity:0,cursor:"pointer",border:"none",p:0}})})]})]}),e==="text"&&n.jsxs(p.Box,{sx:{display:"flex",flexDirection:"column",gap:"11px"},children:[n.jsx(qe,{sk:a,children:"Heading Text Colors"}),n.jsx(p.Box,{sx:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:"9px"},children:b.map(v=>n.jsxs(p.Box,{sx:{display:"flex",alignItems:"center",gap:"9px"},children:[n.jsx(st,{sk:a,border:!0,value:i[v.key]||"#1c2127",onChange:E=>s({[v.key]:E})}),n.jsx(p.Box,{component:"span",sx:g,children:v.label})]},v.key))}),n.jsx(qe,{sk:a,children:"Body Text Colors"}),n.jsxs(p.Box,{sx:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:"7px"},children:[n.jsxs(p.Box,{sx:{display:"flex",alignItems:"center",gap:"9px"},children:[n.jsx(st,{sk:a,border:!0,value:i.textPrimaryHex||"#1c2127",onChange:v=>s({textPrimaryHex:v})}),n.jsx(p.Box,{component:"span",sx:c,title:"Main body text colour.",children:"Primary Text"})]}),n.jsxs(p.Box,{sx:{display:"flex",alignItems:"center",gap:"9px"},children:[n.jsx(st,{sk:a,border:!0,value:i.textSecondaryHex||"#5a6573",onChange:v=>s({textSecondaryHex:v})}),n.jsx(p.Box,{component:"span",sx:c,title:"Muted text colour.",children:"Secondary Text"})]}),n.jsxs(p.Box,{sx:{display:"flex",alignItems:"center",gap:"9px"},children:[n.jsx(st,{sk:a,border:!0,value:i.dividerHex||"#e3e8ee",onChange:v=>s({dividerHex:v})}),n.jsx(p.Box,{component:"span",sx:c,title:"Divider / border colour.",children:"Divider"})]})]})]}),e==="status"&&n.jsxs(p.Box,{sx:{display:"flex",flexDirection:"column",gap:"7px"},children:[n.jsxs(p.Box,{children:[n.jsx(qe,{sk:a,tip:"Success, warning, error & info colours — used for alerts, status pills, toasts and validation states.",children:"Status Colors"}),n.jsx(p.Box,{sx:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:"7px"},children:u.map(v=>n.jsxs(p.Box,{sx:{display:"flex",alignItems:"center",gap:"8px",background:a.card,border:`1px solid ${a.insetBd}`,borderRadius:"9px",px:"9px",py:"7px"},children:[n.jsx(st,{sk:a,w:22,h:22,r:6,value:i[v.key],onChange:E=>s({[v.key]:E})}),n.jsx(p.Box,{component:"span",sx:c,children:v.label})]},v.key))})]}),n.jsxs(p.Box,{children:[n.jsx(qe,{sk:a,tip:"Override the auto-generated surface colours. Leave on Auto to follow the surface tint & mode.",children:"Surfaces"}),n.jsx(p.Box,{sx:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:"7px"},children:y.map(v=>{const E=!!i[v.key];return n.jsxs(p.Box,{sx:{display:"flex",alignItems:"center",gap:"8px",background:a.card,border:`1px solid ${a.insetBd}`,borderRadius:"9px",px:"9px",py:"5px"},children:[n.jsx(st,{sk:a,w:22,h:22,r:6,border:!0,value:i[v.key]||v.fb,onChange:H=>s({[v.key]:H})}),n.jsx(p.Box,{component:"span",sx:{...c,flex:1},children:v.label}),E&&n.jsx(p.Box,{component:"button",title:"Reset to Auto",onClick:()=>s({[v.key]:""}),sx:{background:"transparent",border:`1px solid ${a.insetBd}`,borderRadius:"6px",color:a.muted,fontSize:"10px",fontWeight:700,px:"7px",py:"3px",cursor:"pointer"},children:"Auto"})]},v.key)})})]})]})]})]})}function ge(e){const{label:r,info:t,value:o,effective:i,min:s,max:a,step:l=1,unit:c="",autoLabel:g,autoValue:f=0,softMin:x,softMax:m,floorValue:h,floorReset:b,floorMessage:u,extra:y,onChange:v}=e,E=He(L(q=>q.settings.mode)),H=ve(),S=`${H.bodyFam},sans-serif`,[C,B]=_.useState(!1),[D,$]=_.useState(String(i)),[X,Q]=_.useState(""),Y=_.useRef(void 0);_.useEffect(()=>{C||$(String(i))},[i,C]),_.useEffect(()=>()=>clearTimeout(Y.current),[]);const d=q=>{clearTimeout(Y.current),Q(q),q&&(Y.current=setTimeout(()=>Q(""),3e3))},I=q=>x!=null&&q<x?`Below ${x}${c} may break the UI`:m!=null&&q>m?`Above ${m}${c} may break the UI`:"",P=()=>{d(u??`Minimum is ${b}${c} — reset`),v(b),$(String(b))},W=q=>{const U=parseFloat(q);if(isNaN(U)){d("Enter a number"),$(String(i));return}if(h!=null&&b!=null&&U<=h){P();return}const G=Math.min(a,Math.max(s,U));d(G!==U?`Must be between ${s}${c} and ${a}${c} — clamped to ${G}${c}`:I(G)),$(String(G)),v(G)},z=o===f&&g?g:`${i}${c}`;return n.jsxs(p.Box,{sx:{mb:1.5},children:[n.jsxs(p.Box,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",mb:"8px"},children:[n.jsxs(p.Typography,{sx:{fontSize:`${H.tBodySm}px`,fontWeight:H.bwEmph,fontFamily:S,lineHeight:H.bodyLH,color:E.label2,display:"flex",alignItems:"center",gap:"5px"},children:[r,t&&n.jsx(p.Tooltip,{title:t,arrow:!0,slotProps:{popper:{style:{pointerEvents:"none"}}},children:n.jsx(p.Box,{component:"span",sx:{width:13,height:13,borderRadius:"50%",border:`1.1px solid ${E.chevron}`,color:E.chevron,fontSize:8,fontWeight:800,fontStyle:"italic",fontFamily:"Georgia, serif",display:"inline-grid",placeItems:"center",cursor:"help"},children:"i"})})]}),n.jsxs(p.Box,{sx:{display:"flex",alignItems:"center",gap:"5px",flexShrink:0},children:[C?n.jsx(p.InputBase,{autoFocus:!0,value:D,onChange:q=>$(q.target.value),onBlur:()=>{W(D),B(!1)},onKeyDown:q=>{q.key==="Enter"&&(W(D),B(!1)),q.key==="Escape"&&B(!1)},sx:{width:56,fontSize:`${H.tBodySm}px`,fontWeight:700,fontFamily:S,border:"1.5px solid",borderColor:"primary.main",borderRadius:"6px",px:"6px",py:"3px","& input":{p:0,textAlign:"center"}}}):n.jsxs(p.Box,{component:"button",onClick:()=>{$(String(i)),B(!0)},sx:{display:"inline-flex",alignItems:"center",gap:"5px",fontFamily:S,fontSize:`${H.tBodySm}px`,fontWeight:800,color:E.body,bgcolor:"rgba(130,140,155,0.14)",border:"1px solid rgba(130,140,155,0.28)",borderRadius:"6px",px:"7px",py:"2px",cursor:"pointer",lineHeight:1.3,"&:hover":{bgcolor:"rgba(130,140,155,0.24)"}},children:[z,n.jsxs("svg",{width:"11",height:"11",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.2",strokeLinecap:"round",strokeLinejoin:"round",style:{display:"block",flexShrink:0},children:[n.jsx("path",{d:"M12 20h9"}),n.jsx("path",{d:"M16.5 3.5a2.1 2.1 0 0 1 3 3L7 19l-4 1 1-4z"})]})]}),y]})]}),n.jsx(p.Box,{component:"input",type:"range",min:s,max:a,step:l,value:i,onChange:q=>{const U=parseFloat(q.target.value);if(h!=null&&b!=null&&U<=h){P();return}d(I(U)),v(U)},sx:{WebkitAppearance:"none",appearance:"none",width:"100%",height:"4px",m:0,p:0,display:"block",borderRadius:"2px",outline:"none",cursor:"pointer",background:"#dde3ea",accentColor:"primary.main","&::-webkit-slider-thumb":{WebkitAppearance:"none",width:18,height:18,borderRadius:"50%",background:"#fff",cursor:"pointer",boxShadow:"0 1px 4px rgba(0,0,0,.25),0 0 0 1px rgba(0,0,0,.05)"},"&::-moz-range-thumb":{width:18,height:18,border:"none",borderRadius:"50%",background:"#fff",cursor:"pointer",boxShadow:"0 1px 4px rgba(0,0,0,.25),0 0 0 1px rgba(0,0,0,.05)"}}}),X&&n.jsxs(p.Box,{sx:{display:"inline-flex",alignItems:"center",gap:"6px",mt:"8px",px:"10px",py:"6px",borderRadius:"8px",bgcolor:H.warnSoft,border:`1px solid ${H.warnTxt}`,color:H.warnTxt,fontSize:12,fontWeight:600},children:[n.jsx(p.Box,{component:"span",sx:{fontSize:13,lineHeight:1},children:"⚠"}),X]})]})}const xn=new Set;function Vn(e,r){if(xn.has(e))return;xn.add(e);const t=document.createElement("style");t.textContent=`@font-face{font-family:'${e}';src:url('${r}');font-display:swap;}`,document.head.appendChild(t)}function mn(e){e.forEach(r=>Vn(r.name,r.dataUrl))}const $s=[{key:"Roboto",label:"Roboto",sub:"Material"},{key:"Inter",label:"Inter",sub:"Enterprise"},{key:"DM Sans",label:"DM Sans",sub:"Modern"},{key:"Manrope",label:"Manrope",sub:"Geometric"},{key:"Plus Jakarta Sans",label:"Jakarta",sub:"Friendly"},{key:"Nunito Sans",label:"Nunito",sub:"Rounded"}],Is=[{key:"Figtree",label:"Google Sans"},{key:"Roboto",label:"Roboto"},{key:"Inter",label:"Inter"},{key:"Arial",label:"Arial"},{key:"Manrope",label:"Manrope"},{key:"Plus Jakarta Sans",label:"Jakarta"}];function Et({label:e,fam:r,active:t,onClick:o}){const i=L(f=>f.settings.mode),s=L(f=>f.settings.primaryHex)||"#1565c0",a=L(f=>f.settings.highlightHex)||"#ffd400",l=i==="dark",c=Se(s),g=ce(a,l?.3:.18);return n.jsx(p.Box,{onClick:o,sx:{py:"17px",px:"4px",borderRadius:"10px",textAlign:"center",cursor:"pointer",border:`1px solid ${t?l?c[400]:s:l?"#363d48":"#e3e8ee"}`,bgcolor:t?g:l?"#262b34":"#ffffff",transition:"all .14s ease","&:hover":t?{}:{borderColor:l?"#4a5361":"#c9d0d9"}},children:n.jsx(p.Box,{sx:{fontFamily:`${r}, sans-serif`,fontSize:13,fontWeight:700,lineHeight:1,color:t?l?c[200]:c[700]:l?"#aeb6c0":"#5a6573"},children:e})})}const As=["woff2","woff","ttf","otf"],Os=10*1024*1024,Ds=e=>new Promise((r,t)=>{const o=new FileReader;o.onload=()=>r(o.result),o.onerror=()=>t(o.error),o.readAsDataURL(e)}),Ms=e=>new Promise(r=>{const t=setTimeout(()=>r(!1),5e3),o=new FileReader;o.onload=()=>{var a;clearTimeout(t);const i=new Uint8Array(o.result),s=((a=e.name.split(".").pop())==null?void 0:a.toLowerCase())||"";if(s==="woff2"&&i[0]===119&&i[1]===79&&i[2]===70&&i[3]===50||s==="woff"&&i[0]===119&&i[1]===79&&i[2]===70&&i[3]===70||s==="otf"&&i[0]===79&&i[1]===84&&i[2]===84&&i[3]===79||s==="ttf"&&i[0]===0&&i[1]===1&&i[2]===0&&i[3]===0||s==="ttf"&&i[0]===79&&i[1]===84&&i[2]===84&&i[3]===79)return r(!0);r(!1)},o.onerror=()=>{clearTimeout(t),r(!1)};try{o.readAsArrayBuffer(e.slice(0,4))}catch{clearTimeout(t),r(!1)}});function yn({label:e,list:r,onAdd:t}){const o=He(L(f=>f.settings.mode)),i=ve(),[s,a]=_.useState(""),l=_.useRef(void 0);_.useEffect(()=>()=>clearTimeout(l.current),[]);const c=f=>{clearTimeout(l.current),a(f),f&&(l.current=setTimeout(()=>a(""),3e3))},g=async f=>{var E;const x=Array.from(f.target.files??[]);if(f.target.value="",!x.length)return;const m=[],h=[],b=[],u=[],y=[];for(const H of x){const S=((E=H.name.split(".").pop())==null?void 0:E.toLowerCase())||"";if(!As.includes(S)){b.push(H.name);continue}if(H.size>Os){u.push(H.name);continue}if(!await Ms(H)){y.push(H.name);continue}const C=H.name.replace(/\.[^.]+$/,""),B=$=>$.toLowerCase()===C.toLowerCase();if(r.some($=>B($.name))||m.some($=>B($.name))){h.push(C);continue}const D=await Ds(H);Vn(C,D),m.push({name:C,dataUrl:D})}m.length&&t(m);const v=[];h.length&&v.push(`Already added: ${h.join(", ")}`),b.length&&v.push(`Unsupported file type: ${b.join(", ")}`),u.length&&v.push(`Too large (max 10MB): ${u.join(", ")}`),y.length&&v.push(`Invalid font file: ${y.join(", ")}`),c(v.join(" · "))};return n.jsxs(p.Box,{sx:{mt:1.5},children:[n.jsxs(p.Box,{component:"label",sx:{display:"flex",alignItems:"center",justifyContent:"center",gap:.75,bgcolor:o.inset,border:`1.5px dashed ${o.insetBd}`,borderRadius:"9px",p:1.5,cursor:"pointer",color:o.body,fontSize:11.5,fontWeight:600,fontFamily:`${i.bodyFam},sans-serif`,textAlign:"center"},children:["⬆ ",e,n.jsx(p.Box,{component:"span",sx:{color:o.muted},children:".woff2 / .ttf / .otf"}),n.jsx("input",{type:"file",accept:".woff2,.woff,.ttf,.otf",multiple:!0,onChange:g,style:{display:"none"}})]}),s&&n.jsxs(p.Box,{sx:{mt:.9,display:"flex",alignItems:"center",gap:.9,bgcolor:"error.main",borderRadius:2,px:1.4,py:.9,color:"error.contrastText",fontFamily:`${i.bodyFam},sans-serif`},children:[n.jsx(p.Box,{component:"span",sx:{fontWeight:900,fontSize:12},children:"✕"}),n.jsx(p.Box,{component:"span",sx:{fontSize:11.5},children:s})]})]})}const Fs={compact:1.15,default:1.25,airy:1.414};function Ws(){const e=L(f=>f.settings),r=L(f=>f.set),t=He(e.mode),o=ve(),[i,s]=_.useState(!1),a=e.scaleRatioCustom>0?e.scaleRatioCustom:Fs[e.scaleRatio]??1.25,[l,c]=_.useState(a.toFixed(2));_.useEffect(()=>{i||c(a.toFixed(2))},[a,i]);const g=()=>{const f=parseFloat(l);isNaN(f)||r({scaleRatioCustom:f}),s(!1)};return i?n.jsx(p.InputBase,{autoFocus:!0,value:l,onChange:f=>c(f.target.value),onBlur:g,onKeyDown:f=>{f.key==="Enter"&&g(),f.key==="Escape"&&s(!1)},sx:{width:56,fontSize:"11.5px",fontWeight:700,fontFamily:`${o.bodyFam},sans-serif`,border:"1.5px solid",borderColor:"primary.main",borderRadius:"6px",px:"6px",py:"3px","& input":{p:0,textAlign:"center"}}}):n.jsx(p.Box,{component:"button",title:"Configure scale ratio — each heading is the one above ÷ this value",onClick:()=>{c(a.toFixed(2)),s(!0)},sx:{display:"inline-grid",placeItems:"center",color:t.body,bgcolor:"rgba(130,140,155,0.14)",border:"1px solid rgba(130,140,155,0.28)",borderRadius:"6px",px:"6px",py:"3px",cursor:"pointer",fontFamily:`${o.bodyFam},sans-serif`,"&:hover":{bgcolor:"rgba(130,140,155,0.24)"}},children:n.jsxs("svg",{width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",style:{display:"block"},children:[n.jsx("circle",{cx:"12",cy:"12",r:"3"}),n.jsx("path",{d:"M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 1 1-2.83 2.83l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-4 0v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 1 1-2.83-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1 0-4h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 1 1 2.83-2.83l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 4 0v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 1 1 2.83 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 0 4h-.09a1.65 1.65 0 0 0-1.51 1z"})]})})}function zs(){const[e,r]=_.useState("bodyFont"),t=L(i=>i.settings),o=L(i=>i.set);return n.jsxs(n.Fragment,{children:[n.jsx(tt,{active:e,onChange:r,tabs:[{key:"bodyFont",label:"Body Font",info:"Typeface used for body / paragraph text (headings use the Heading Font)"},{key:"headFont",label:"Heading Font",info:"Choose a separate typeface for headings (or match the body font)"},{key:"headText",label:"Heading Text",info:"Fine-tune size & weight per heading level (H1–H4)"},{key:"bodyText",label:"Body Text",info:"Adjust base font size and line height for body copy"}]}),n.jsxs(p.Box,{sx:{p:"12px 2px 2px"},children:[e==="bodyFont"&&n.jsxs(n.Fragment,{children:[n.jsxs(p.Box,{sx:{display:"grid",gridTemplateColumns:"repeat(3,1fr)",gap:"10px"},children:[$s.map(i=>n.jsx(Et,{label:i.label,sub:i.sub,fam:i.key,active:t.fontFamily===i.key,onClick:()=>o({fontFamily:i.key})},i.key)),t.customFonts.map(i=>n.jsx(Et,{label:i.name,sub:"Custom",fam:i.name,active:t.fontFamily===i.name,onClick:()=>o({fontFamily:i.name})},i.name))]}),n.jsx(yn,{label:"Upload custom font",list:t.customFonts,onAdd:i=>o({customFonts:[...i,...t.customFonts],fontFamily:i[0].name})})]}),e==="headFont"&&n.jsxs(n.Fragment,{children:[n.jsxs(p.Box,{sx:{display:"grid",gridTemplateColumns:"repeat(3,1fr)",gap:"10px"},children:[Is.map(i=>n.jsx(Et,{label:i.label,fam:i.key,active:t.headingFont===i.key,onClick:()=>o({headingFont:i.key})},i.key)),t.customHeadFonts.map(i=>n.jsx(Et,{label:i.name,sub:"Custom",fam:i.name,active:t.headingFont===i.name,onClick:()=>o({headingFont:i.name})},i.name))]}),n.jsx(yn,{label:"Upload heading font",list:t.customHeadFonts,onAdd:i=>o({customHeadFonts:[...i,...t.customHeadFonts],headingFont:i[0].name})})]}),e==="headText"&&n.jsxs(n.Fragment,{children:[n.jsx(ge,{label:"H1 size",info:"All heading levels scale from H1 by a modular ratio (configurable via the gear icon).",value:t.h1Size,effective:t.h1Size||20,min:18,max:56,unit:"px",extra:n.jsx(Ws,{}),onChange:i=>o({h1Size:i})}),n.jsx(ge,{label:"Weight (all headings)",value:t.headingWeight,effective:t.headingWeight,min:300,max:900,step:100,onChange:i=>o({headingWeight:i})}),n.jsx(ge,{label:"Line height (all headings)",value:t.headingLH,effective:t.headingLH||1.2,min:.9,max:2,step:.05,autoLabel:"Auto (1.20)",onChange:i=>o({headingLH:i})})]}),e==="bodyText"&&n.jsxs(n.Fragment,{children:[n.jsx(ge,{label:"Base font size",info:"Root body text size.",value:t.baseFontPx,effective:t.baseFontPx||12,min:9,max:20,unit:"px",softMin:9,onChange:i=>o({baseFontPx:i})}),n.jsx(ge,{label:"Body weight",value:t.bodyWeight,effective:t.bodyWeight||400,min:300,max:900,step:100,autoLabel:"Auto (400)",onChange:i=>o({bodyWeight:i})}),n.jsx(ge,{label:"Body line height",value:t.bodyLineHeight,effective:t.bodyLineHeight||1.5,min:1.2,max:2,step:.05,autoLabel:"Auto (1.50)",onChange:i=>o({bodyLineHeight:i})})]})]})]})}function je({options:e,value:r,columns:t=3,onChange:o}){const i=L(v=>v.settings.mode),s=L(v=>v.settings.primaryHex)||"#1565c0",a=L(v=>v.settings.highlightHex)||"#ffd400",l=i==="dark",c=Se(s),g=ve(),f=`${g.bodyFam},sans-serif`,x=ce(a,l?.3:.18),m=l?c[400]:s,h=l?c[200]:c[700],b=l?"#262b34":"#ffffff",u=l?"#363d48":"#e3e8ee",y=l?"#aeb6c0":"#5a6573";return n.jsx(p.Box,{sx:{display:"grid",gridTemplateColumns:`repeat(${t}, 1fr)`,gap:"6px"},children:e.map(v=>{const E=v.key===r,H=n.jsx(p.Box,{onClick:()=>o(v.key),sx:{py:"9px",px:"4px",borderRadius:"10px",textAlign:"center",cursor:"pointer",userSelect:"none",fontSize:`${g.tCaption}px`,fontWeight:E?g.bwEmph:g.bodyWeightEff,fontFamily:f,border:`1px solid ${E?m:u}`,bgcolor:E?x:b,color:E?h:y,transition:"color .14s ease, background .14s ease, border-color .14s ease","&:hover":E?{}:{borderColor:l?"#4a5361":"#c9d0d9"}},children:v.label},v.key);return v.info?n.jsx(p.Tooltip,{title:v.info,arrow:!0,slotProps:{popper:{style:{pointerEvents:"none"}}},children:H},v.key):H})})}const Ht={outlined:0,soft:6,floating:24},Pt={plain:0,tinted:40,accent:60},_s={bordered:0,recessed:6,lighter:4};function Ls(){const[e,r]=_.useState("style"),t=L(c=>c.settings),o=L(c=>c.set),i=t.cardShadowPx>=0?t.cardShadowPx:Ht[t.cardStyle]??24,s=t.headerStrength>=0?t.headerStrength:Pt[t.cardHeader]??45,a=t.nestedDepth>=0?t.nestedDepth:_s[t.nestedStyle]??6,l=t.tintIntensity>=0?t.tintIntensity:100;return n.jsxs(n.Fragment,{children:[n.jsx(tt,{active:e,onChange:r,tabs:[{key:"style",label:"Style",info:"Card border vs shadow depth."},{key:"header",label:"Header",info:"Card header treatment."},{key:"nested",label:"Nested",info:"How cards-within-cards look."},{key:"tint",label:"Tint",info:"Overall surface tint colour & strength."}]}),n.jsxs(p.Box,{sx:{p:"12px 2px 2px"},children:[e==="style"&&n.jsxs(n.Fragment,{children:[n.jsx(je,{value:t.cardStyle,onChange:c=>{const g=c;o({cardStyle:g,cardShadowPx:Ht[g]})},options:[{key:"outlined",label:"Outlined"},{key:"soft",label:"Soft"},{key:"floating",label:"Floating"}]}),n.jsx(p.Box,{sx:{mt:1.5},children:n.jsx(ge,{label:"Shadow depth",info:"Card elevation (px).",value:t.cardShadowPx,effective:i,min:0,max:32,unit:"px",autoValue:-1,autoLabel:`Auto (${i}px)`,softMin:t.cardStyle==="outlined"?void 0:1,softMax:32,floorValue:t.cardStyle==="outlined"?void 0:0,floorReset:Ht[t.cardStyle],floorMessage:`${t.cardStyle==="soft"?"Soft":"Floating"} cards need shadow - reset to ${Ht[t.cardStyle]}px`,onChange:c=>o({cardShadowPx:c})})})]}),e==="header"&&n.jsxs(n.Fragment,{children:[n.jsx(je,{value:t.cardHeader,onChange:c=>{const g=c;o({cardHeader:g,headerStrength:Pt[g]})},options:[{key:"plain",label:"Plain"},{key:"tinted",label:"Tinted"},{key:"accent",label:"Accent"}]}),n.jsx(p.Box,{sx:{mt:1.5},children:n.jsx(ge,{label:"Header strength",info:"Header tint / accent intensity.",value:t.headerStrength,effective:s,min:0,max:100,unit:"%",autoValue:-1,autoLabel:`Auto (${s}%)`,softMin:t.cardHeader==="plain"?void 0:1,floorValue:t.cardHeader==="plain"?void 0:0,floorReset:Pt[t.cardHeader],floorMessage:`${t.cardHeader==="tinted"?"Tinted":"Accent"} headers need strength - reset to ${Pt[t.cardHeader]}%`,onChange:c=>o({headerStrength:c})})})]}),e==="nested"&&n.jsxs(n.Fragment,{children:[n.jsx(je,{value:t.nestedStyle,onChange:c=>o({nestedStyle:c}),options:[{key:"recessed",label:"Recessed"},{key:"lighter",label:"Lighter"},{key:"bordered",label:"Bordered"}]}),n.jsx(p.Box,{sx:{mt:1.5},children:n.jsx(ge,{label:"Nested depth",info:"Inset depth of cards-within-cards.",value:t.nestedDepth,effective:a,min:0,max:24,unit:"px",autoValue:-1,autoLabel:`Auto (${a}px)`,onChange:c=>o({nestedDepth:c})})})]}),e==="tint"&&n.jsxs(n.Fragment,{children:[n.jsx(je,{value:t.surfaceTint,onChange:c=>o({surfaceTint:c}),options:[{key:"snow",label:"None"},{key:"neutral",label:"Low"},{key:"brand",label:"High"}]}),n.jsx(p.Box,{sx:{mt:1.5},children:n.jsx(ge,{label:"Tint intensity",info:"Strength of the page surface tint.",value:t.tintIntensity,effective:l,min:0,max:100,unit:"%",autoValue:-1,autoLabel:`Auto (${l}%)`,onChange:c=>o({tintIntensity:c})})})]})]})]})}function Ns(){const[e,r]=_.useState("rows"),t=L(i=>i.settings),o=L(i=>i.set);return n.jsxs(n.Fragment,{children:[n.jsx(tt,{active:e,onChange:r,tabs:[{key:"rows",label:"Rows",info:"Row density & dividers."},{key:"cols",label:"Columns",info:"Column density & dividers."},{key:"cells",label:"Cells",info:"Cell text & vertical alignment."},{key:"styling",label:"Styling",info:"Header background & row striping."}]}),n.jsxs(p.Box,{sx:{p:"12px 2px 2px"},children:[e==="rows"&&n.jsxs(n.Fragment,{children:[n.jsx(je,{value:t.tableDensity,onChange:i=>o({tableDensity:i}),options:[{key:"compact",label:"Compact"},{key:"default",label:"Default"},{key:"comfortable",label:"Comfortable"}]}),n.jsx(p.FormControlLabel,{sx:{mt:1},control:n.jsx(p.Switch,{checked:t.tableDividers,onChange:i=>o({tableDividers:i.target.checked})}),label:"Row dividers"}),t.tableDividers&&n.jsx(ge,{label:"Divider width",value:t.tableRowDivW,effective:t.tableRowDivW,min:1,max:4,unit:"px",onChange:i=>o({tableRowDivW:i})})]}),e==="cols"&&n.jsxs(n.Fragment,{children:[n.jsx(je,{value:t.tableColDensity,onChange:i=>o({tableColDensity:i}),options:[{key:"compact",label:"Compact"},{key:"default",label:"Default"},{key:"comfortable",label:"Comfortable"}]}),n.jsx(p.FormControlLabel,{sx:{mt:1},control:n.jsx(p.Switch,{checked:t.tableColDividers,onChange:i=>o({tableColDividers:i.target.checked})}),label:"Column dividers"}),t.tableColDividers&&n.jsx(ge,{label:"Divider width",value:t.tableColDivW,effective:t.tableColDivW,min:1,max:4,unit:"px",onChange:i=>o({tableColDivW:i})})]}),e==="cells"&&n.jsxs(n.Fragment,{children:[n.jsx(je,{value:t.tableCellAlignH,onChange:i=>o({tableCellAlignH:i}),options:[{key:"left",label:"Left"},{key:"center",label:"Center"},{key:"right",label:"Right"}]}),n.jsx(p.Box,{sx:{mt:1},children:n.jsx(je,{value:t.tableCellAlignV,onChange:i=>o({tableCellAlignV:i}),options:[{key:"top",label:"Top"},{key:"middle",label:"Middle"},{key:"bottom",label:"Bottom"}]})})]}),e==="styling"&&n.jsxs(n.Fragment,{children:[n.jsx(je,{value:t.tableHeaderStyle,onChange:i=>o({tableHeaderStyle:i}),options:[{key:"plain",label:"Plain"},{key:"tinted",label:"Tinted"},{key:"accent",label:"Accent"}]}),n.jsx(p.FormControlLabel,{sx:{mt:1},control:n.jsx(p.Switch,{checked:t.tableStripe,onChange:i=>o({tableStripe:i.target.checked})}),label:"Striped rows"})]})]})]})}const ur={compact:.82,default:1,comfortable:1.16};function Vs(){const[e,r]=_.useState("shape"),t=L(c=>c.settings),o=L(c=>c.set),i=He(t.mode),s=t.densityScale>0?t.densityScale:Math.round((ur[t.density]??1)*100),a=t.cardGapPx>0?t.cardGapPx:Math.round(16*(ur[t.density]??1)),l=t.containerPadPx>0?t.containerPadPx:Math.round(10*(ur[t.density]??1));return n.jsxs(n.Fragment,{children:[n.jsx(tt,{active:e,onChange:r,tabs:[{key:"shape",label:"Shape",info:"Corner radius & layout density."},{key:"effects",label:"Effects",info:"Spacing, button case & status chips."}]}),n.jsxs(p.Box,{sx:{p:"12px 2px 2px"},children:[e==="shape"&&n.jsxs(n.Fragment,{children:[n.jsx(p.Typography,{variant:"caption",sx:{fontWeight:700,color:i.label2,textTransform:"uppercase",letterSpacing:".6px",display:"block",mb:.75},children:"Corner Radius"}),n.jsx(je,{value:t.radiusPreset,onChange:c=>o({radiusPreset:c,radiusVal:c==="sharp"?0:c==="round"?18:9}),options:[{key:"sharp",label:"Sharp"},{key:"rounded",label:"Rounded"},{key:"round",label:"Round"}]}),n.jsx(p.Box,{sx:{mt:1.25},children:n.jsx(ge,{label:"Exact radius",value:t.radiusVal,effective:t.radiusVal,min:0,max:28,unit:"px",onChange:c=>o({radiusVal:c,radiusPreset:"rounded"})})}),n.jsx(p.Typography,{variant:"caption",sx:{fontWeight:700,color:i.label2,textTransform:"uppercase",letterSpacing:".6px",display:"block",mb:.75,mt:.5},children:"Density"}),n.jsx(je,{value:t.densityScale>0?"":t.density,onChange:c=>o({density:c,densityScale:0}),options:[{key:"compact",label:"Compact"},{key:"default",label:"Default"},{key:"comfortable",label:"Comfortable"}]}),n.jsx(p.Box,{sx:{mt:1.25},children:n.jsx(ge,{label:"Exact density",info:"Fine-tune spacing scale (%).",value:t.densityScale,effective:s,min:60,max:140,unit:"%",onChange:c=>o({densityScale:c})})})]}),e==="effects"&&n.jsxs(n.Fragment,{children:[n.jsx(ge,{label:"Card-to-card gap",value:t.cardGapPx,effective:a,min:0,max:40,step:2,unit:"px",autoLabel:`Auto (${a}px)`,onChange:c=>o({cardGapPx:c})}),n.jsx(ge,{label:"Container padding",value:t.containerPadPx,effective:l,min:0,max:40,step:2,unit:"px",autoLabel:`Auto (${l}px)`,onChange:c=>o({containerPadPx:c})}),n.jsx(ge,{label:"Edge gap",info:"Space between the preview frame and the outer app card.",value:t.edgePadPx,effective:t.edgePadPx,min:0,max:40,step:2,unit:"px",autoLabel:"0px (flush)",onChange:c=>o({edgePadPx:c})}),n.jsxs(p.Box,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",mt:1},children:[n.jsx(p.Typography,{variant:"caption",sx:{fontWeight:700,color:i.label2},children:"Uppercase button labels"}),n.jsx(p.Switch,{size:"small",checked:t.btnCase==="upper",onChange:c=>o({btnCase:c.target.checked?"upper":"none"})})]}),n.jsxs(p.Box,{sx:{mt:1.25},children:[n.jsx(p.Typography,{variant:"caption",sx:{fontWeight:700,color:i.label2,textTransform:"uppercase",letterSpacing:".6px",display:"block",mb:.75},children:"Status Chips"}),n.jsx(je,{columns:2,value:t.statusBold?"bold":"soft",onChange:c=>o({statusBold:c==="bold"}),options:[{key:"soft",label:"Soft"},{key:"bold",label:"Bold"}]})]})]})]})]})}function Us(){const[e,r]=_.useState("placement"),t=L(i=>i.settings),o=L(i=>i.set);return n.jsxs(n.Fragment,{children:[n.jsx(tt,{active:e,onChange:r,tabs:[{key:"placement",label:"Placement",info:"Where toasts appear."},{key:"behaviour",label:"Behaviour",info:"Width & auto-dismiss."}]}),n.jsxs(p.Box,{sx:{p:"12px 2px 2px"},children:[e==="placement"&&n.jsx(je,{columns:2,value:t.notifPosition,onChange:i=>o({notifPosition:i}),options:[{key:"top-center",label:"Top Center"},{key:"top-right",label:"Top Right"},{key:"bottom-left",label:"Bottom Left"},{key:"bottom-right",label:"Bottom Right"}]}),e==="behaviour"&&n.jsxs(n.Fragment,{children:[n.jsx(ge,{label:"Toast width",value:t.toastW,effective:t.toastW||252,min:200,max:500,unit:"px",softMax:500,onChange:i=>o({toastW:i})}),n.jsx(p.FormControlLabel,{sx:{mt:.5},control:n.jsx(p.Switch,{checked:t.notifBadge,onChange:i=>o({notifBadge:i.target.checked})}),label:"Show unread badge"}),n.jsx(p.FormControlLabel,{sx:{mt:.5,display:"flex"},control:n.jsx(p.Switch,{checked:t.notifAutoDismiss,onChange:i=>o({notifAutoDismiss:i.target.checked})}),label:"Auto-dismiss toasts"}),t.notifAutoDismiss&&n.jsx(ge,{label:"Dismiss after",value:t.autoDismissSec,effective:t.autoDismissSec||5,min:5,max:30,unit:"s",onChange:i=>o({autoDismissSec:i})})]})]})]})}function Gs({label:e,info:r,value:t,fallback:o,onChange:i,onReset:s}){const a=He(L(f=>f.settings.mode)),[l,c]=_.useState(null),g=t||o;return n.jsxs(p.Box,{sx:{display:"flex",alignItems:"center",gap:1,py:.5},children:[n.jsx(p.Box,{onClick:f=>c(f.currentTarget),sx:{width:22,height:22,borderRadius:1.5,border:`1px solid ${a.insetBd}`,bgcolor:g,cursor:"pointer",flexShrink:0}}),n.jsxs(p.Typography,{variant:"caption",sx:{flex:1,color:a.body,display:"flex",alignItems:"center",gap:.5},children:[e,r&&n.jsx(p.Tooltip,{title:r,arrow:!0,slotProps:{popper:{style:{pointerEvents:"none"}}},children:n.jsx(p.Box,{component:"span",sx:{width:13,height:13,borderRadius:"50%",border:`1.1px solid ${a.chevron}`,color:a.chevron,fontSize:8,fontWeight:800,fontStyle:"italic",fontFamily:"Georgia, serif",display:"inline-grid",placeItems:"center",cursor:"help"},children:"i"})})]}),t&&s&&n.jsx(p.Box,{component:"span",onClick:s,title:"Reset to theme default",sx:{fontSize:13,color:a.muted,cursor:"pointer"},children:"↺"}),n.jsx(p.Popover,{open:!!l,anchorEl:l,onClose:()=>c(null),anchorOrigin:{vertical:"bottom",horizontal:"right"},children:n.jsx(p.Box,{sx:{p:1},children:n.jsx("input",{type:"color",value:g,onChange:f=>i(f.target.value),style:{width:160,height:40,border:"none",background:"none"}})})})]})}function Ys({src:e,aspect:r,onCancel:t,onConfirm:o}){const[i,s]=_.useState(1),[a,l]=_.useState({x:0,y:0}),c=_.useRef(null),g=_.useRef(null),f=_.useRef(null),x=_.useRef(null);_.useEffect(()=>{const b=y=>{x.current&&l({x:x.current.ox+(y.clientX-x.current.sx),y:x.current.oy+(y.clientY-x.current.sy)})},u=()=>{x.current=null};return document.addEventListener("pointermove",b),document.addEventListener("pointerup",u),()=>{document.removeEventListener("pointermove",b),document.removeEventListener("pointerup",u)}},[]);const m=b=>{b.preventDefault(),x.current={sx:b.clientX,sy:b.clientY,ox:a.x,oy:a.y}},h=()=>{const b=c.current,u=g.current,y=f.current;if(!b||!u){o(e);return}const v=(y||b).getBoundingClientRect(),E=1e3,H=Math.round(E*r),S=H/v.width,C=document.createElement("canvas");C.width=H,C.height=E;const B=C.getContext("2d");if(!B){o(e);return}const D=u.getBoundingClientRect(),$=(D.left-v.left)*S,X=(D.top-v.top)*S,Q=D.width*S,Y=D.height*S;try{B.drawImage(u,$,X,Q,Y),o(C.toDataURL("image/png"))}catch{o(e)}};return Ao.createPortal(n.jsx(p.Box,{sx:{position:"fixed",inset:0,zIndex:1400,bgcolor:"rgba(15,23,42,.6)",display:"flex",alignItems:"center",justifyContent:"center",p:2.25,overflow:"auto"},children:n.jsxs(p.Box,{sx:{width:"100%",maxWidth:320,bgcolor:"background.paper",border:"1px solid",borderColor:"divider",borderRadius:3,boxShadow:"0 20px 50px rgba(15,23,42,.4)",p:2},children:[n.jsx(p.Typography,{sx:{fontSize:14,fontWeight:800,mb:.5},children:"Adjust brand image"}),n.jsx(p.Typography,{sx:{fontSize:11.5,color:"text.secondary",mb:1.5,lineHeight:1.45},children:"Drag and zoom to fit your image inside the bright frame. Anything in the dimmed area is cropped out."}),n.jsxs(p.Box,{ref:c,onPointerDown:m,sx:{position:"relative",width:"100%",aspectRatio:"1.55",borderRadius:2.5,overflow:"hidden",bgcolor:"#e9edf2",cursor:"grab",touchAction:"none",display:"grid",placeItems:"center","&:active":{cursor:"grabbing"}},children:[n.jsx("img",{ref:g,src:e,alt:"",draggable:!1,style:{position:"absolute",left:"50%",top:"50%",transform:`translate(-50%,-50%) translate(${a.x}px,${a.y}px) scale(${i})`,transformOrigin:"center",maxWidth:"100%",maxHeight:"100%",width:"auto",height:"auto",userSelect:"none",pointerEvents:"none"}}),n.jsx(p.Box,{ref:f,sx:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%,-50%)",height:"72%",aspectRatio:String(r),maxWidth:"90%",boxShadow:"0 0 0 9999px rgba(10,15,25,.62)",border:"2px solid #fff",borderRadius:"3px",pointerEvents:"none"}})]}),n.jsxs(p.Box,{sx:{display:"flex",alignItems:"center",gap:1,my:1.5},children:[n.jsx(p.Typography,{sx:{fontSize:12,fontWeight:700,color:"text.secondary"},children:"Zoom"}),n.jsx(p.Slider,{size:"small",min:.3,max:4,step:.02,value:i,onChange:(b,u)=>s(u)})]}),n.jsxs(p.Box,{sx:{display:"flex",gap:1},children:[n.jsx(p.Box,{component:"button",onClick:t,sx:{flex:1,p:1.25,borderRadius:2.5,border:"1px solid",borderColor:"divider",bgcolor:"action.hover",color:"text.secondary",fontSize:12.5,fontWeight:700,cursor:"pointer"},children:"Cancel"}),n.jsx(p.Box,{component:"button",onClick:h,sx:{flex:1,p:1.25,borderRadius:2.5,border:"none",bgcolor:"primary.main",color:"primary.contrastText",fontSize:12.5,fontWeight:700,cursor:"pointer"},children:"Confirm"})]})]})}),document.body)}function Js(){const e=L(f=>f.settings),r=L(f=>f.set),t=He(e.mode),[o,i]=_.useState(null),s=(f,x)=>{var b;const m=(b=f.target.files)==null?void 0:b[0];if(!m)return;const h=new FileReader;h.onload=()=>i({src:h.result,aspect:x==="logoUrl"?3.5:1.55,target:x}),h.readAsDataURL(m),f.target.value=""},a=f=>{o&&(o.target==="logoUrl"?r({logoUrl:f,logoMode:"image"}):r({loginImage:f}),i(null))},l={fontSize:11,fontWeight:700,textTransform:"uppercase",letterSpacing:".6px"},c={display:"flex",alignItems:"center",justifyContent:"center",gap:1,border:`1.5px dashed ${t.insetBd}`,borderRadius:2.5,p:1.75,cursor:"pointer",color:t.body,fontSize:12.5,fontWeight:600,bgcolor:t.inset},g=(f,x)=>n.jsxs(p.Box,{sx:{display:"flex",alignItems:"center",gap:1,mt:1,p:.9,bgcolor:t.inset,border:`1px solid ${t.insetBd}`,borderRadius:2},children:[n.jsx(p.Typography,{variant:"caption",sx:{flex:1,minWidth:0,color:t.body,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:f}),n.jsx(p.Box,{component:"button",onClick:x,title:"Remove",sx:{border:"none",background:"transparent",color:t.muted,cursor:"pointer",fontSize:14},children:"✕"})]});return n.jsxs(p.Box,{sx:{display:"flex",flexDirection:"column",gap:1.75},children:[n.jsxs(p.Box,{children:[n.jsx(p.Typography,{variant:"caption",sx:{...l,color:t.label2,display:"block",mb:1},children:"Brand Image"}),n.jsxs(p.Box,{component:"label",sx:c,children:["⬆ Choose image",n.jsx("input",{hidden:!0,type:"file",accept:"image/*",onChange:f=>s(f,"loginImage")})]}),e.loginImage&&g("Uploaded image",()=>r({loginImage:""}))]}),n.jsxs(p.Box,{children:[n.jsx(p.Typography,{variant:"caption",sx:{...l,color:t.label2,display:"block",mb:1},children:"Logo"}),n.jsxs(p.Box,{component:"label",sx:c,children:["⬆ Choose logo file",n.jsx("input",{hidden:!0,type:"file",accept:"image/png,image/svg+xml,image/webp",onChange:f=>s(f,"logoUrl")})]}),e.logoMode==="image"&&e.logoUrl&&g("Uploaded logo",()=>r({logoUrl:"",logoMode:"icon"}))]}),n.jsxs(p.Box,{children:[n.jsx(p.Typography,{variant:"caption",sx:{...l,color:t.label2,display:"block",mb:.5},children:"Panel Colour"}),n.jsx(Gs,{label:"Login panel background",value:e.loginPanelColor,fallback:e.primaryHex,onChange:f=>r({loginPanelColor:f}),onReset:()=>r({loginPanelColor:""})})]}),o&&n.jsx(Ys,{src:o.src,aspect:o.aspect,onCancel:()=>i(null),onConfirm:a})]})}const qs=[{key:"dashboard",label:"Dashboard"},{key:"orders",label:"Orders"},{key:"reports",label:"Reports"},{key:"cameras",label:"Cameras"},{key:"operations",label:"Operations"},{key:"components",label:"Components"},{key:"login",label:"Login"}],Ks=[{key:"dashboard",label:"Dashboard"},{key:"operations",label:"Operations"},{key:"cameras",label:"Cameras"},{key:"reports",label:"Reports"},{key:"orders",label:"Orders"},{key:"components",label:"Components"}],Ke=Nn(e=>({openSection:"",setOpenSection:r=>e({openSection:r}),previewScreen:"dashboard",setPreviewScreen:r=>e({previewScreen:r}),previewMenuOpen:!1,setPreviewMenuOpen:r=>e({previewMenuOpen:r}),studioOpen:!0,setStudioOpen:r=>e({studioOpen:r})}));function Xs({onClose:e}){var M,j,A,k;const r=Ke(T=>T.openSection),t=Ke(T=>T.setOpenSection),o=Ke(T=>T.setPreviewScreen),i=Ke(T=>T.previewScreen),s=Ke(T=>T.previewMenuOpen),a=Ke(T=>T.setPreviewMenuOpen),l=L(T=>T.settings),c=L(T=>T.savedThemes),g=L(T=>T.editingSavedId),f=L(T=>T.isDirty),x=L(T=>T.set),m=L(T=>T.reset),h=He(l.mode),b=_.useRef("theme"),[u,y]=_.useState(!1),v=(T,K)=>{const se=r!==T;t(se?T:""),a(!1),se&&b.current!==T&&(o(K),b.current=T)},E=((M=c.find(T=>T.id===g))==null?void 0:M.name)||((j=Mt.find(T=>T.id===l.presetId))==null?void 0:j.name)||((A=c.find(T=>T.id===l.presetId))==null?void 0:A.name)||"Custom Theme",H=f(),S=((k=Mt.find(T=>T.id===Re.presetId))==null?void 0:k.name)??"default",C={fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},B=({children:T})=>n.jsx("svg",{width:"18",height:"18",viewBox:"0 0 24 24",...C,children:T}),D=n.jsxs(B,{children:[n.jsx("circle",{cx:"13.5",cy:"6.5",r:"2.5"}),n.jsx("circle",{cx:"17.5",cy:"10.5",r:"2.5"}),n.jsx("circle",{cx:"8.5",cy:"7.5",r:"2.5"}),n.jsx("circle",{cx:"6.5",cy:"12.5",r:"2.5"}),n.jsx("path",{d:"M12 2a10 10 0 0 0 0 20 3 3 0 0 0 0-6 2 2 0 0 1 0-4 4 4 0 0 0 4-4 6 6 0 0 0-4-6z"})]}),$=n.jsxs(p.Box,{sx:{display:"flex",gap:"2px",width:14,height:14},children:[n.jsx(p.Box,{sx:{flex:1,background:l.secondaryHex,borderRadius:"2px"}}),n.jsx(p.Box,{sx:{flex:1,background:l.errorHex,borderRadius:"2px"}}),n.jsx(p.Box,{sx:{flex:1,background:l.successHex,borderRadius:"2px"}})]}),X=n.jsxs(B,{children:[n.jsx("path",{d:"M4 20 9 5l5 15M6 14h6"}),n.jsx("path",{d:"M15 20l3-9 3 9M16.2 17h3.6"})]}),Q=n.jsxs(B,{children:[n.jsx("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2"}),n.jsx("path",{d:"M3 9h18"})]}),Y=n.jsxs(B,{children:[n.jsx("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2"}),n.jsx("path",{d:"M3 9h18M3 15h18M9 3v18"})]}),d=n.jsx(B,{children:n.jsx("rect",{x:"4",y:"4",width:"16",height:"16",rx:"4"})}),I=n.jsxs(n.Fragment,{children:[n.jsxs(B,{children:[n.jsx("path",{d:"M6 8a6 6 0 0 1 12 0c0 7 3 9 3 9H3s3-2 3-9"}),n.jsx("path",{d:"M10 21a2 2 0 0 0 4 0"})]}),n.jsx(p.Box,{sx:{position:"absolute",top:"6px",right:"6px",width:7,height:7,borderRadius:"50%",background:l.primaryHex,border:`1.5px solid ${h.iconTile}`}})]}),P=n.jsxs(B,{children:[n.jsx("path",{d:"M15 3h4a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2h-4"}),n.jsx("path",{d:"M10 17l5-5-5-5"}),n.jsx("path",{d:"M15 12H3"})]}),W=l.mode==="dark",z=T=>T.charAt(0).toUpperCase()+T.slice(1),q={sm:"Small",df:"Default",lg:"Large"},U={sharp:"Sharp",rounded:"Rounded",round:"Round"},G={compact:"Compact",default:"Default",comfortable:"Comfortable"},R={flat:"Flat",outlined:"Outlined",soft:"Soft",raised:"Raised",elevated:"Elevated",floating:"Floating"},O={split:"Split Brand",centered:"Centered Card"},J={"top-center":"Top Center","top-right":"Top Right","bottom-left":"Bottom Left","bottom-right":"Bottom Right"},V={theme:`${E} · ${W?"Dark":"Light"}`,color:"Secondary & status colours",type:`${l.fontFamily} · ${q[l.textSize]??"Default"}`,cards:"Card style, header, nesting & surface tint",tables:"Table row density, dividers, striping & header style — previewed on the Orders screen",shape:`${U[l.radiusPreset]??"Custom"} · ${G[l.density]??"Default"} · ${R[l.cardStyle]??""}`,notif:`${J[l.notifPosition]??""} · ${z(l.notifStyle)}`,login:`${O[l.loginLayout]??""}${l.loginImage?" · image":""}`},N=[{id:"theme",title:"Theme Settings",info:"Presets, saved themes & light/dark mode.",icon:D,screen:"dashboard",body:n.jsx(Bs,{})},{id:"color",title:"Colour Settings",info:"Brand, text & status colours.",icon:$,screen:"components",body:n.jsx(Ps,{})},{id:"type",title:"Typography",info:"Fonts, sizes, weight & line-height.",icon:X,screen:"components",body:n.jsx(zs,{})},{id:"cards",title:"Cards",info:"Card style, header, nesting & tint.",icon:Q,screen:"dashboard",body:n.jsx(Ls,{})},{id:"tables",title:"Tables",info:"Row/column density, dividers & alignment.",icon:Y,screen:"orders",body:n.jsx(Ns,{})},{id:"shape",title:"Surface & Shape",info:"Radius, density, elevation & spacing.",icon:d,screen:"dashboard",body:n.jsx(Vs,{})},{id:"notif",title:"Notifications",info:"Toast placement & behaviour.",icon:I,screen:"operations",body:n.jsx(Us,{})},{id:"login",title:"Login Screen",info:"Brand image, logo & panel colour.",icon:P,screen:"login",body:n.jsx(Js,{})}];return n.jsxs(p.Box,{sx:{display:"flex",flexDirection:"column",bgcolor:h.card},children:[n.jsxs(p.Box,{sx:{display:"flex",alignItems:"center",gap:1,px:1.5,py:1.1,borderBottom:`1px solid ${h.divider}`,bgcolor:h.card},children:[n.jsxs(p.Box,{sx:{display:"flex",gap:.5,flexShrink:0},children:[n.jsx(p.Box,{sx:{width:13,height:13,borderRadius:"3px",bgcolor:l.primaryHex}}),n.jsx(p.Box,{sx:{width:13,height:13,borderRadius:"3px",bgcolor:l.secondaryHex}})]}),n.jsxs(p.Box,{sx:{flex:1,minWidth:0,display:"flex",alignItems:"center",gap:"6px"},children:[n.jsx(p.Typography,{variant:"caption",sx:{minWidth:0,fontWeight:800,color:h.text,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:E}),H&&n.jsx(p.Tooltip,{title:"Unsaved changes",arrow:!0,slotProps:{popper:{style:{pointerEvents:"none"}}},children:n.jsx(p.Box,{component:"span",sx:{width:6,height:6,borderRadius:"50%",bgcolor:"error.main",flexShrink:0}})})]}),n.jsx(p.Tooltip,{title:"Reset to defaults",arrow:!0,slotProps:{popper:{style:{pointerEvents:"none"}}},children:n.jsx(p.IconButton,{size:"small",onClick:()=>y(!0),sx:{bgcolor:"action.selected"},children:n.jsx(xs,{sx:{fontSize:16}})})}),n.jsx(p.Tooltip,{title:l.mode==="dark"?"Switch to light":"Switch to dark",arrow:!0,slotProps:{popper:{style:{pointerEvents:"none"}}},children:n.jsx(p.IconButton,{size:"small",onClick:()=>x({mode:l.mode==="dark"?"light":"dark"}),sx:{bgcolor:"action.selected"},children:l.mode==="dark"?n.jsx(ys,{sx:{fontSize:16}}):n.jsx(ms,{sx:{fontSize:16}})})})]}),s&&n.jsxs(p.Box,{sx:{borderBottom:"1px solid",borderColor:"divider",borderLeft:"3px solid #eab308",bgcolor:T=>T.palette.mode==="dark"?"rgba(234,179,8,0.14)":"#fef9c3",px:1.6,py:1.5},children:[n.jsx(p.Typography,{sx:{fontSize:10,fontWeight:800,textTransform:"uppercase",letterSpacing:".6px",color:T=>T.palette.mode==="dark"?"#f2cd5c":"#854d0e",mb:1},children:"Previewing Screen"}),n.jsx(p.Box,{sx:{display:"grid",gridTemplateColumns:"1fr 1fr 1fr",gap:.75},children:Ks.map(T=>{const K=i===T.key;return n.jsx(p.Box,{component:"button",onClick:()=>{i!==T.key&&o(T.key),a(!1)},sx:{px:.75,py:1,borderRadius:2,cursor:"pointer",fontSize:11,fontWeight:K?800:600,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",border:"1.5px solid",borderColor:K?"#d4a915":"#e6dca8",bgcolor:K?"#fde68a":"background.paper",color:K?"#713f12":"text.secondary"},children:T.label},T.key)})})]}),N.map(T=>n.jsx(ks,{icon:T.icon,title:T.title,info:V[T.id]??T.info,open:r===T.id,dimmed:r!==""&&r!==T.id,onToggle:()=>v(T.id,T.screen),onPreviewMenu:()=>a(!s),children:T.body},T.id)),n.jsxs(p.Dialog,{open:u,onClose:()=>y(!1),PaperProps:{sx:{borderRadius:3,width:320,p:2.5}},children:[n.jsx(p.Typography,{sx:{fontSize:15,fontWeight:800,mb:.75},children:"Reset everything?"}),n.jsxs(p.Typography,{sx:{fontSize:12.5,color:"text.secondary",lineHeight:1.5,mb:2.25},children:["This reverts every change you've made — theme preset, light/dark mode, brand colours, logo, typography, cards, surface & shape, notifications and login screen — back to the default ",S," preset. This can't be undone."]}),n.jsxs(p.Box,{sx:{display:"flex",flexDirection:"column",gap:1},children:[n.jsx(p.Box,{component:"button",onClick:()=>{m(),y(!1)},sx:{p:1.4,borderRadius:2.5,border:"none",bgcolor:"error.main",color:"error.contrastText",fontSize:13,fontWeight:700,cursor:"pointer"},children:"Reset to defaults"}),n.jsx(p.Box,{component:"button",onClick:()=>y(!1),sx:{p:1.1,borderRadius:2.5,border:"none",bgcolor:"transparent",color:"text.secondary",fontSize:12.5,fontWeight:600,cursor:"pointer"},children:"Cancel"})]})]})]})}const Qs=vt(n.jsx("path",{d:"M21 2H3c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h7v2H8v2h8v-2h-2v-2h7c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2m0 14H3V4h18z"}),"DesktopWindowsOutlined");function Br(e,r,t){const o=_.useRef(null),[i,s]=_.useState(e);return _.useLayoutEffect(()=>{const a=o.current;if(!a)return;const l=()=>{const x=a.children.length;if(!x)return;const m=parseFloat(getComputedStyle(a).rowGap)||0;let h=0;for(const y of Array.from(a.children))h+=y.offsetHeight;const b=h/x,u=a.clientHeight;u<=0||b<=0||s(Math.max(r,Math.min(t,Math.floor((u+m)/(b+m)))))};l();const c=requestAnimationFrame(l),g=setTimeout(l,300),f=new ResizeObserver(l);return f.observe(a),()=>{cancelAnimationFrame(c),clearTimeout(g),f.disconnect()}},[r,t]),[o,i]}function Un(e,r,t){const o=_.useRef(null),i=_.useRef(null),[s,a]=_.useState(e);return _.useLayoutEffect(()=>{const l=i.current;if(!l)return;const c=()=>{var u;const m=Array.from(l.children).filter(y=>getComputedStyle(y).position!=="absolute"),h=m.length?m[0].offsetHeight:((u=o.current)==null?void 0:u.offsetHeight)||36,b=l.clientHeight;b<=0||h<=0||a(Math.max(r,Math.min(t,Math.floor(b/h))))};c();const g=requestAnimationFrame(c),f=setTimeout(c,300),x=new ResizeObserver(c);return x.observe(l),()=>{cancelAnimationFrame(g),clearTimeout(f),x.disconnect()}},[r,t]),[o,i,s]}const Zs=["Jan","Feb","Mar","Apr","May","Jun"],el=[44,60,50,74,88,96],tl=[24,32,30,42,52,60];function rl(){const e=ve(),r=L(M=>M.settings),{t,rad:o,radSm:i,pad:s,padSm:a,gap:l,screenPad:c,tH1:g,tH2:f,tTitle:x,tH4:m,wH1:h,headFam:b,headLH:u,accentBg:y,btnText:v,tBodySm:E,bwEmph:H,btnCase:S,bodyWeightEff:C,bodyLH:B,tCaption:D,pMain:$,sMain:X}=e,Q=b+",sans-serif",Y=r.fontFamily+",sans-serif",d=e.hc1||t.textPrimary,I=e.hc2||t.textPrimary,P=e.hc3||t.textPrimary,W=[{label:"Revenue",val:"$2.41M",chg:"+12.5%",up:!0},{label:"Open Orders",val:"1,284",chg:"+3.2%",up:!0},{label:"Inventory",val:"8,540",chg:"-1.8%",up:!1},{label:"Active Users",val:"342",chg:"+5",up:!0}].map(M=>({...M,cc:M.up?e.sucTxt:e.errTxt,cb:M.up?e.sucSoft:e.errSoft,arrow:M.up?"▲":"▼"})),z=M=>M==="✓"?{cb:e.sucSoft,cc:e.sucTxt}:M==="!"?{cb:e.warnSoft,cc:e.warnTxt}:M==="+"?{cb:e.infoSoft,cc:e.infoTxt}:{cb:t.pContainer,cc:e.isDark?t.pLight:t.pDark},q=[{title:"Order ORD-1042 delivered to Acme Corp",time:"2m ago",ic:"✓"},{title:"Invoice #4821 paid — $12,400",time:"18m ago",ic:"$"},{title:"Low stock alert: Widget Pro (12 left)",time:"1h ago",ic:"!"},{title:"New customer onboarded: Globex Ltd",time:"3h ago",ic:"+"},{title:'Report "Q2 Summary" exported to PDF',time:"5h ago",ic:"▤"},{title:"Shipment SHP-2093 dispatched — Initech",time:"6h ago",ic:"✓"},{title:"Refund processed — $840 to Umbrella Co",time:"7h ago",ic:"$"},{title:"Payment overdue: Waystar Royco",time:"8h ago",ic:"!"},{title:"New support ticket — Stark Industries",time:"9h ago",ic:"+"},{title:"Backup completed — 12,480 records",time:"11h ago",ic:"✓"},{title:"Purchase order PO-771 approved",time:"13h ago",ic:"$"},{title:"Inventory reconciled — Warehouse 3",time:"15h ago",ic:"▤"},{title:"SLA breach warning — Hooli Inc",time:"17h ago",ic:"!"},{title:"New user invited — M. Fernandez",time:"19h ago",ic:"+"},{title:"Quarterly report scheduled",time:"21h ago",ic:"▤"},{title:"Order ORD-1039 delivered to Oscorp",time:"23h ago",ic:"✓"}].map(M=>({...M,...z(M.ic)})),[U,G]=Br(5,4,q.length),R=q.slice(0,G),O=e.cardBorder==="none"?"none":e.cardBorder,J={background:t.paper,border:O,borderRadius:o,boxShadow:e.cardShadow,overflow:"hidden"},V={padding:`${a}px ${s}px`,background:e.cardHdrBg,borderBottom:e.cardHdrBorder,boxShadow:e.cardHdrAccent,display:"flex",alignItems:"center",justifyContent:"space-between"},N={fontSize:x,lineHeight:u,fontWeight:h,color:P,fontFamily:Q};return n.jsxs("div",{style:{display:"flex",flexDirection:"column",background:t.paper,border:O,borderRadius:o,boxShadow:e.cardShadow,overflow:"hidden",fontFamily:Y,fontWeight:C,color:t.textPrimary},children:[n.jsxs("div",{style:{padding:s,background:e.cardHdrBg,borderBottom:e.cardHdrBorder,boxShadow:e.cardHdrAccent,display:"flex",alignItems:"center",justifyContent:"space-between",gap:14},children:[n.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[n.jsx("div",{style:{fontSize:g,lineHeight:u,fontWeight:h,color:d,letterSpacing:"-.3px",fontFamily:Q},children:"Dashboard"}),n.jsx("span",{title:"Good morning, Admin · Jun 21, 2026",style:{width:16,height:16,borderRadius:"50%",border:"1.2px solid "+t.textSecondary,color:t.textSecondary,fontSize:9.5,fontWeight:H,fontStyle:"italic",fontFamily:"Georgia,serif",display:"grid",placeItems:"center",flexShrink:0,cursor:"help"},children:"i"})]}),n.jsx("button",{style:{padding:"10px 20px",borderRadius:i,border:"none",background:y,color:v,fontSize:E,fontWeight:H,textTransform:S,letterSpacing:".4px",boxShadow:e.btnShadow,whiteSpace:"nowrap",cursor:"pointer"},children:"+ New"})]}),n.jsxs("div",{style:{padding:c,background:t.bgDefault,display:"flex",flexDirection:"column",flex:1,minHeight:0},children:[n.jsxs("div",{style:{...J,marginBottom:l},children:[n.jsxs("div",{style:V,children:[n.jsx("span",{style:{...N},children:"Performance Overview"}),n.jsx("span",{style:{fontSize:D,color:t.textSecondary,fontWeight:H},children:"This month"})]}),n.jsx("div",{style:{padding:s,display:"grid",gridTemplateColumns:"repeat(4,1fr)",gap:l},children:W.map(M=>n.jsxs("div",{style:{background:t.paper2,border:e.nestBorder,borderRadius:i,boxShadow:e.nestShadow,padding:a},children:[n.jsx("div",{style:{fontSize:m,color:t.textSecondary,fontWeight:h,fontFamily:Q,textTransform:"uppercase",letterSpacing:".6px",marginBottom:8},children:M.label}),n.jsx("div",{style:{fontSize:f,fontWeight:h,color:I,letterSpacing:"-.8px",lineHeight:1,marginBottom:6},children:M.val}),n.jsxs("span",{style:{fontSize:D,fontWeight:H,color:M.cc,background:M.cb,padding:"3px 9px",borderRadius:999},children:[M.arrow," ",M.chg]})]},M.label))})]}),n.jsxs("div",{style:{display:"grid",gridTemplateColumns:"1fr 300px",gap:l,flex:1,minHeight:0},children:[n.jsxs("div",{style:{...J,display:"flex",flexDirection:"column",minHeight:0},children:[n.jsxs("div",{style:V,children:[n.jsx("span",{style:N,children:"Revenue Trend"}),n.jsx("div",{style:{display:"flex",gap:12},children:[["Revenue",$],["Profit",X]].map(([M,j])=>n.jsxs("div",{style:{display:"flex",alignItems:"center",gap:5},children:[n.jsx("div",{style:{width:10,height:10,borderRadius:2,background:j}}),n.jsx("span",{style:{fontSize:D,color:t.textSecondary},children:M})]},M))})]}),n.jsx("div",{style:{padding:`${a}px ${s}px`,display:"flex",alignItems:"flex-end",gap:12,flex:1,minHeight:200},children:Zs.map((M,j)=>n.jsxs("div",{style:{flex:1,display:"flex",flexDirection:"column",alignItems:"center",gap:6,height:"100%"},children:[n.jsxs("div",{style:{width:"100%",display:"flex",flexDirection:"column",justifyContent:"flex-end",gap:3,flex:1},children:[n.jsx("div",{style:{width:"100%",height:tl[j]+"%",background:X,opacity:.55,borderRadius:`${i} ${i} 0 0`}}),n.jsx("div",{style:{width:"100%",height:el[j]+"%",background:$,borderRadius:`${i} ${i} 0 0`}})]}),n.jsx("span",{style:{fontSize:D,color:t.textSecondary},children:M})]},M))})]}),n.jsxs("div",{style:{...J,display:"flex",flexDirection:"column",minHeight:0},children:[n.jsx("div",{style:{padding:`${a}px ${s}px`,background:e.cardHdrBg,borderBottom:e.cardHdrBorder,boxShadow:e.cardHdrAccent},children:n.jsx("span",{style:N,children:"Recent Activity"})}),n.jsx("div",{ref:U,style:{padding:a,display:"flex",flexDirection:"column",justifyContent:"space-between",gap:4,flex:1,minHeight:0},children:R.map((M,j)=>n.jsxs("div",{style:{display:"flex",gap:11,alignItems:"flex-start",padding:8,borderRadius:i},children:[n.jsx("div",{style:{width:28,height:28,borderRadius:i,background:M.cb,color:M.cc,display:"grid",placeItems:"center",flexShrink:0,fontSize:13,fontWeight:H},children:M.ic}),n.jsxs("div",{style:{flex:1,minWidth:0},children:[n.jsx("div",{style:{fontSize:E,color:t.textPrimary,fontFamily:Y,fontWeight:C,lineHeight:B,marginBottom:2},children:M.title}),n.jsx("div",{style:{fontSize:D,color:t.textSecondary,fontFamily:Y},children:M.time})]})]},j))})]})]})]})]})}const nl=[{id:"ORD-1042",cust:"Acme Corporation",status:"Delivered",amt:"$12,400",date:"Jun 18"},{id:"ORD-1041",cust:"Globex Ltd",status:"Processing",amt:"$8,750",date:"Jun 17"},{id:"ORD-1040",cust:"Initech",status:"Pending",amt:"$5,200",date:"Jun 16"},{id:"ORD-1039",cust:"Umbrella Co",status:"Shipped",amt:"$22,100",date:"Jun 15"},{id:"ORD-1038",cust:"Waystar Royco",status:"Delivered",amt:"$9,800",date:"Jun 14"},{id:"ORD-1037",cust:"Stark Industries",status:"Processing",amt:"$31,500",date:"Jun 13"},{id:"ORD-1036",cust:"Wayne Enterprises",status:"Delivered",amt:"$18,240",date:"Jun 12"},{id:"ORD-1035",cust:"Soylent Corp",status:"Pending",amt:"$4,120",date:"Jun 11"},{id:"ORD-1034",cust:"Hooli Inc",status:"Shipped",amt:"$27,900",date:"Jun 10"},{id:"ORD-1033",cust:"Cyberdyne Systems",status:"Delivered",amt:"$14,650",date:"Jun 09"},{id:"ORD-1032",cust:"Massive Dynamic",status:"Processing",amt:"$10,300",date:"Jun 08"},{id:"ORD-1031",cust:"Tyrell Corp",status:"Delivered",amt:"$16,780",date:"Jun 07"},{id:"ORD-1030",cust:"Oscorp",status:"Shipped",amt:"$7,940",date:"Jun 06"},{id:"ORD-1029",cust:"Nakatomi Trading",status:"Pending",amt:"$3,560",date:"Jun 05"},{id:"ORD-1028",cust:"Gekko & Co",status:"Delivered",amt:"$25,300",date:"Jun 04"},{id:"ORD-1027",cust:"Bluth Company",status:"Processing",amt:"$6,410",date:"Jun 03"}],fr="100px 1fr 120px 100px 80px 70px";function ol(){const e=ve(),r=L(G=>G.settings),{t,rad:o,radSm:i,pad:s,padSm:a,screenPad:l,rowPy:c,tH1:g,wH1:f,headFam:x,headLH:m,accentBg:h,btnText:b,btnShadow:u,tBody:y,tBodySm:v,tCaption:E,tOverline:H,bwEmph:S,btnCase:C,bodyWeightEff:B,pMain:D,table:$}=e,X=x+",sans-serif",Q=r.fontFamily+",sans-serif",Y=e.hc1||t.textPrimary,[d,I,P]=Un(12,3,16),W=nl.slice(0,P).map((G,R)=>({...G,...$.statusMap[G.status]||{sb:t.divider,sc:t.textSecondary},rowBg:r.tableStripe&&R%2===1?$.stripeBg:"transparent"})),z=e.cardBorder==="none"?"none":e.cardBorder,q=G=>({fontSize:H,fontWeight:S,color:t.textSecondary,textTransform:"uppercase",letterSpacing:".5px",borderRight:$.colBorder,alignSelf:"stretch",display:"flex",alignItems:$.cellAI,justifyContent:$.cellJC,padding:`${$.rowPy} ${$.cellPx}`}),U={alignSelf:"stretch",display:"flex",alignItems:$.cellAI,justifyContent:$.cellJC,padding:`${$.rowPy} ${$.cellPx}`};return n.jsxs("div",{style:{display:"flex",flexDirection:"column",background:t.paper,border:z,borderRadius:o,boxShadow:e.cardShadow,overflow:"hidden",fontFamily:Q,fontWeight:B,color:t.textPrimary},children:[n.jsxs("div",{style:{padding:s,background:e.cardHdrBg,borderBottom:e.cardHdrBorder,boxShadow:e.cardHdrAccent,display:"flex",alignItems:"flex-start",justifyContent:"space-between",gap:14},children:[n.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[n.jsx("div",{style:{fontSize:g,lineHeight:m,fontWeight:f,color:Y,letterSpacing:"-.3px",fontFamily:X},children:"Orders"}),n.jsx("span",{title:"1,284 orders · June 2026",style:{width:16,height:16,borderRadius:"50%",border:"1.2px solid "+t.textSecondary,color:t.textSecondary,fontSize:9.5,fontWeight:S,fontStyle:"italic",fontFamily:"Georgia,serif",display:"grid",placeItems:"center",flexShrink:0,cursor:"help"},children:"i"})]}),n.jsx("button",{style:{padding:"10px 20px",borderRadius:i,border:"none",background:h,color:b,fontSize:v,fontWeight:S,textTransform:C,letterSpacing:".4px",boxShadow:u,whiteSpace:"nowrap",cursor:"pointer"},children:"+ New Order"})]}),n.jsx("div",{style:{padding:l,background:t.bgDefault,display:"flex",flexDirection:"column",flex:1,minHeight:0},children:n.jsxs("div",{style:{display:"flex",flexDirection:"column",background:t.paper,border:z,borderRadius:o,boxShadow:e.cardShadow,overflow:"hidden",flex:1,minHeight:0},children:[n.jsxs("div",{style:{padding:`${a}px ${s}px`,background:e.cardHdrBg,borderBottom:e.cardHdrBorder,boxShadow:e.cardHdrAccent,display:"flex",gap:9,alignItems:"center",flexWrap:"wrap"},children:[n.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,background:t.paper,border:"1.5px solid "+t.divider,borderRadius:999,padding:"8px 15px",flex:1,minWidth:170},children:[n.jsx("span",{style:{color:t.textSecondary,fontSize:13},children:"⌕"}),n.jsx("span",{style:{fontSize:v,color:t.textSecondary},children:"Search orders…"})]}),$.filters.map(G=>n.jsx("button",{style:{padding:"7px 14px",borderRadius:999,border:"1px solid "+G.brd,background:G.bg,color:G.c,fontSize:E,fontWeight:S,whiteSpace:"nowrap",cursor:"pointer"},children:G.label},G.label))]}),n.jsxs("div",{ref:d,style:{display:"grid",gridTemplateColumns:fr,padding:`0 ${s}px`,borderBottom:$.rowBorder,background:$.headBg},children:[["Order ID","Customer","Status","Amount","Date"].map(G=>n.jsx("div",{style:q(),children:G},G)),n.jsx("div",{style:{alignSelf:"stretch",padding:`${$.rowPy} 0`}})]}),n.jsxs("div",{ref:I,style:{position:"relative",display:"flex",flexDirection:"column",flex:1,minHeight:0},children:[n.jsxs("div",{style:{position:"absolute",inset:0,padding:`0 ${s}px`,display:"grid",gridTemplateColumns:fr,pointerEvents:"none",zIndex:2},children:[n.jsx("div",{style:{borderRight:$.colBorder}}),n.jsx("div",{style:{borderRight:$.colBorder}}),n.jsx("div",{style:{borderRight:$.colBorder}}),n.jsx("div",{style:{borderRight:$.colBorder}}),n.jsx("div",{style:{borderRight:$.colBorder}}),n.jsx("div",{})]}),W.map(G=>n.jsxs("div",{style:{display:"grid",gridTemplateColumns:fr,padding:`0 ${s}px`,borderBottom:$.rowBorder,alignItems:"stretch",background:G.rowBg},children:[n.jsx("div",{style:{...U,fontSize:v,fontWeight:S,color:D,fontFamily:Q},children:G.id}),n.jsx("div",{style:{...U,fontSize:y,color:t.textPrimary,fontWeight:S},children:G.cust}),n.jsx("div",{style:U,children:n.jsx("span",{style:{padding:"4px 11px",borderRadius:999,fontSize:E,fontWeight:S,background:G.sb,color:G.sc,whiteSpace:"nowrap"},children:G.status})}),n.jsx("div",{style:{...U,fontSize:y,color:t.textPrimary,fontWeight:S},children:G.amt}),n.jsx("div",{style:{...U,fontSize:v,color:t.textSecondary},children:G.date}),n.jsx("div",{style:U,children:n.jsx("button",{style:{fontSize:E,color:D,background:t.pContainer,border:"none",fontWeight:S,padding:"5px 11px",borderRadius:i,cursor:"pointer"},children:"View"})})]},G.id))]}),n.jsxs("div",{style:{padding:`${c}px ${s}px`,display:"flex",alignItems:"center",gap:7,borderTop:"1px solid "+t.divider},children:[n.jsxs("span",{style:{fontSize:v,color:t.textSecondary,flex:1},children:["Showing 1–",W.length," of 1,284"]}),n.jsx("button",{style:{width:32,height:32,borderRadius:i,border:"1px solid "+t.outline,background:"transparent",color:t.textSecondary,cursor:"pointer"},children:"‹"}),n.jsx("button",{style:{width:32,height:32,borderRadius:i,border:"none",background:h,color:b,fontWeight:S,cursor:"pointer"},children:"1"}),n.jsx("button",{style:{width:32,height:32,borderRadius:i,border:"1px solid "+t.outline,background:"transparent",color:t.textSecondary,cursor:"pointer"},children:"2"}),n.jsx("button",{style:{width:32,height:32,borderRadius:i,border:"1px solid "+t.outline,background:"transparent",color:t.textSecondary,cursor:"pointer"},children:"›"})]})]})})]})}function il(){const e=ve(),r=L(Z=>Z.settings),{t,rad:o,radSm:i,pad:s,padSm:a,gap:l,screenPad:c,tH1:g,tH2:f,tTitle:x,tH4:m,tH5:h,tH6:b,tBody:u,tBodySm:y,tCaption:v,wH1:E,headFam:H,headLH:S,accentBg:C,btnText:B,btnShadow:D,bwEmph:$,btnCase:X,bodyWeightEff:Q,bodyLH:Y,pMain:d,errSoft:I,errTxt:P,warnSoft:W,warnTxt:z,infoSoft:q,infoTxt:U,sucSoft:G,sucTxt:R}=e,O=H+",sans-serif",J=r.fontFamily+",sans-serif",V=e.t.highlight,N=e.t.highlightSoft,M=e.t.highlightBd,j=t.pContainer,A=t.onPContainer,k=t.pContrast,T=e.hc1||t.textPrimary,K=e.hc2||t.textPrimary,se=e.hc3||t.textPrimary,F=e.hc4||t.textPrimary,fe=e.hc5||t.textPrimary,Oe=e.hc6||t.textPrimary,De=e.cardBorder==="none"?"none":e.cardBorder,Ve={display:"flex",flexDirection:"column",background:t.paper,border:De,borderRadius:o,boxShadow:e.cardShadow,overflow:"hidden",height:"100%"},Ue={padding:`${a}px ${s}px`,background:e.cardHdrBg,borderBottom:e.cardHdrBorder,boxShadow:e.cardHdrAccent},Be={fontSize:x,lineHeight:S,fontWeight:E,color:se,fontFamily:O},Xt=[{label:"Dashboard Overview",size:g,w:E,color:T,lh:1.1,ls:"-.5px",name:"H1",border:!0},{label:"Revenue Report",size:f,w:E,color:K,lh:1.1,ls:"-.4px",name:"H2",border:!0},{label:"Performance Overview",size:x,w:E,color:se,lh:1.15,name:"H3",border:!0},{label:"Active Users",size:m,w:E,color:F,lh:1.2,name:"H4",border:!0},{label:"Last updated 2m ago",size:h,w:E,color:fe,lh:1.25,name:"H5",border:!0},{label:"Status · Live",size:b,w:E,color:Oe,lh:1.3,name:"H6",border:!0}],Me=Z=>n.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10,padding:"11px 12px",borderBottom:"1px solid "+t.divider,background:Z?N:"transparent",boxShadow:Z?"inset 3px 0 0 "+V:"none"},children:[n.jsx("div",{style:{width:16,height:16,borderRadius:"50%",border:"2px solid "+(Z?V:t.outline),display:"grid",placeItems:"center",flexShrink:0},children:Z&&n.jsx("div",{style:{width:8,height:8,borderRadius:"50%",background:V}})}),n.jsx("span",{style:{flex:1,fontSize:y,fontFamily:J,fontWeight:Z?$:Q,color:t.textPrimary},children:Z?"Selected item":"Unselected item"}),Z&&n.jsx("span",{style:{fontSize:v,fontFamily:J,fontWeight:$,color:t.textSecondary},children:"Active"})]}),St=(Z,ct,pt)=>n.jsxs("div",{style:{position:"relative",border:Z?"2px solid "+d:"1.5px solid "+t.outline,borderRadius:i,padding:"12px 13px"},children:[n.jsx("span",{style:{position:"absolute",top:-8,left:10,background:t.paper,padding:"0 5px",fontSize:v,color:Z?d:t.textSecondary,fontWeight:Z?$:void 0},children:ct}),n.jsx("span",{style:{fontSize:u,color:Z?t.textPrimary:t.textSecondary},children:pt})]}),Ge=(Z,ct,pt)=>n.jsx("span",{style:{padding:"5px 13px",borderRadius:999,background:Z,color:ct,fontSize:v,fontWeight:$},children:pt}),Fe=Z=>({padding:"9px 20px",borderRadius:i,fontSize:y,fontWeight:$,textTransform:X,letterSpacing:".4px",cursor:"pointer",...Z});return n.jsxs("div",{style:{display:"flex",flexDirection:"column",background:t.paper,border:De,borderRadius:o,boxShadow:e.cardShadow,overflow:"hidden",fontFamily:J,fontWeight:Q,color:t.textPrimary},children:[n.jsx("div",{style:{padding:s,background:e.cardHdrBg,borderBottom:e.cardHdrBorder,boxShadow:e.cardHdrAccent},children:n.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[n.jsx("div",{style:{fontSize:g,lineHeight:S,fontWeight:E,color:T,letterSpacing:"-.3px",fontFamily:O},children:"Component Library"}),n.jsx("span",{title:"Every Material UI component reflects your live theme",style:{width:16,height:16,borderRadius:"50%",border:"1.2px solid "+t.textSecondary,color:t.textSecondary,fontSize:9.5,fontWeight:$,fontStyle:"italic",fontFamily:"Georgia,serif",display:"grid",placeItems:"center",flexShrink:0,cursor:"help"},children:"i"})]})}),n.jsxs("div",{style:{padding:c,background:t.bgDefault,display:"flex",flexDirection:"column",gap:l,flex:1,minHeight:0},children:[n.jsxs("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:l,alignItems:"stretch"},children:[n.jsxs("div",{style:Ve,children:[n.jsx("div",{style:Ue,children:n.jsx("span",{style:Be,children:"Typography Scale"})}),n.jsxs("div",{style:{padding:s,display:"flex",flexDirection:"column",justifyContent:"space-between",flex:1,minHeight:0,gap:6},children:[Xt.map(Z=>n.jsxs("div",{style:{display:"flex",alignItems:"baseline",justifyContent:"space-between",gap:12,borderBottom:"1px solid "+t.divider,paddingBottom:14},children:[n.jsx("span",{style:{fontSize:Z.size,lineHeight:Z.lh,fontWeight:Z.w,color:Z.color,fontFamily:O,letterSpacing:Z.ls},children:Z.label}),n.jsxs("span",{style:{fontSize:Z.size,color:t.textSecondary,fontWeight:Z.w,whiteSpace:"nowrap",flexShrink:0,fontFamily:O},children:[Z.name," · ",Z.size]})]},Z.name)),n.jsxs("div",{style:{display:"flex",alignItems:"baseline",justifyContent:"space-between",gap:12},children:[n.jsx("span",{style:{fontSize:u,lineHeight:Y,color:t.textPrimary,fontFamily:J,fontWeight:Q},children:"Body text — the quick brown fox jumps over the lazy dog."}),n.jsxs("span",{style:{fontSize:u,color:t.textSecondary,fontWeight:Q,whiteSpace:"nowrap",flexShrink:0,fontFamily:J},children:["Body · ",u]})]}),n.jsxs("div",{style:{display:"flex",alignItems:"baseline",justifyContent:"space-between",gap:12},children:[n.jsx("span",{style:{fontSize:v,lineHeight:Y,color:t.textSecondary,fontFamily:J,fontWeight:Q},children:"Caption & helper text style"}),n.jsxs("span",{style:{fontSize:v,color:t.textSecondary,fontWeight:Q,whiteSpace:"nowrap",flexShrink:0,fontFamily:J},children:["Caption · ",v]})]})]})]}),n.jsxs("div",{style:Ve,children:[n.jsx("div",{style:Ue,children:n.jsx("span",{style:Be,children:"Selection States"})}),n.jsxs("div",{style:{padding:s,display:"flex",flexDirection:"column",gap:14},children:[n.jsxs("div",{style:{display:"flex",gap:2,borderBottom:"1.5px solid "+t.divider},children:[n.jsx("div",{style:{flex:1,textAlign:"center",padding:"8px 4px",fontSize:y,fontWeight:$,color:t.textPrimary,background:N,borderBottom:"2.5px solid "+d,marginBottom:-1.5,borderRadius:"6px 6px 0 0"},children:"Overview"}),n.jsx("div",{style:{flex:1,textAlign:"center",padding:"8px 4px",fontSize:y,fontWeight:$,color:t.textSecondary},children:"Activity"}),n.jsx("div",{style:{flex:1,textAlign:"center",padding:"8px 4px",fontSize:y,fontWeight:$,color:t.textSecondary},children:"Settings"})]}),n.jsxs("div",{style:{display:"flex",flexDirection:"column",border:"1px solid "+t.divider,borderRadius:i,overflow:"hidden"},children:[Me(!0),Me(!1),Me(!1),Me(!1),Me(!0),Me(!1)]}),n.jsx("div",{style:{display:"inline-flex",alignSelf:"flex-start",padding:"6px 12px",borderRadius:i,background:N,border:"1px solid "+M},children:n.jsx("span",{style:{fontSize:v,fontWeight:$,color:V},children:"2 selected items"})})]})]})]}),n.jsxs("div",{style:{...Ve,height:"auto"},children:[n.jsx("div",{style:Ue,children:n.jsx("span",{style:Be,children:"Inputs & Selection"})}),n.jsxs("div",{style:{padding:s},children:[n.jsxs("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:l,marginBottom:l},children:[St(!1,"Outlined","Placeholder…"),St(!0,"Focused","Active value")]}),n.jsxs("div",{style:{display:"flex",gap:22,alignItems:"center",flexWrap:"wrap",paddingTop:a,borderTop:"1px solid "+t.divider},children:[n.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[n.jsx("div",{style:{width:18,height:18,borderRadius:4,background:d,display:"grid",placeItems:"center",color:k,fontSize:11,fontWeight:$},children:"✓"}),n.jsx("span",{style:{fontSize:y,color:t.textPrimary},children:"Checkbox"})]}),n.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[n.jsx("div",{style:{width:18,height:18,borderRadius:"50%",border:"2px solid "+d,display:"grid",placeItems:"center"},children:n.jsx("div",{style:{width:9,height:9,borderRadius:"50%",background:d}})}),n.jsx("span",{style:{fontSize:y,color:t.textPrimary},children:"Radio"})]}),n.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[n.jsx("div",{style:{width:38,height:22,borderRadius:999,background:d,position:"relative"},children:n.jsx("div",{style:{position:"absolute",top:3,right:3,width:16,height:16,borderRadius:"50%",background:"#fff"}})}),n.jsx("span",{style:{fontSize:y,color:t.textPrimary},children:"Switch"})]})]})]})]}),n.jsxs("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:l,alignItems:"stretch"},children:[n.jsxs("div",{style:Ve,children:[n.jsx("div",{style:Ue,children:n.jsx("span",{style:Be,children:"Buttons"})}),n.jsxs("div",{style:{padding:s,display:"flex",gap:10,flexWrap:"wrap",alignItems:"center"},children:[n.jsx("button",{style:Fe({border:"none",background:C,color:B,boxShadow:D}),children:"Contained"}),n.jsx("button",{style:Fe({border:"1.5px solid "+d,background:"transparent",color:d}),children:"Outlined"}),n.jsx("button",{style:Fe({border:"none",background:"transparent",color:d}),children:"Text"}),n.jsx("button",{style:Fe({border:"none",background:j,color:A}),children:"Tonal"}),n.jsx("button",{style:Fe({border:"none",background:C,color:B,boxShadow:D,borderRadius:999}),children:"Rounded"}),n.jsx("button",{style:Fe({border:"none",background:I,color:P}),children:"Error"})]})]}),n.jsxs("div",{style:Ve,children:[n.jsx("div",{style:Ue,children:n.jsx("span",{style:Be,children:"Chips, Alerts & Progress"})}),n.jsxs("div",{style:{padding:s},children:[n.jsxs("div",{style:{display:"flex",gap:8,flexWrap:"wrap",marginBottom:l},children:[Ge(j,A,"Primary"),Ge(G,R,"Success"),Ge(W,z,"Warning"),Ge(q,U,"Info"),Ge(I,P,"Error")]}),n.jsxs("div",{style:{display:"flex",justifyContent:"space-between",marginBottom:7},children:[n.jsx("span",{style:{fontSize:y,color:t.textPrimary,fontWeight:$},children:"Revenue goal"}),n.jsx("span",{style:{fontSize:y,color:d,fontWeight:$},children:"74%"})]}),n.jsx("div",{style:{height:8,background:t.paper2,border:"1px solid "+t.divider,borderRadius:999,overflow:"hidden"},children:n.jsx("div",{style:{height:"100%",width:"74%",background:d,borderRadius:999}})})]})]})]})]})]})}const al=[{label:"Cameras Online",val:"5 / 6"},{label:"Recording",val:"4"},{label:"Motion Alerts",val:"2"},{label:"Storage Used",val:"82%"}],sl=[{name:"CAM 01",loc:"Main Lobby",rec:!0,online:!0,time:"14:32:08"},{name:"CAM 02",loc:"North Gate",rec:!0,online:!0,time:"14:32:08"},{name:"CAM 03",loc:"Loading Bay",rec:!1,online:!0,time:"14:32:07"},{name:"CAM 04",loc:"Rooftop",rec:!0,online:!0,time:"14:32:08"},{name:"CAM 05",loc:"Parking Deck",rec:!1,online:!1,time:"—"},{name:"CAM 06",loc:"Server Room",rec:!0,online:!0,time:"14:32:08"}],ll=[{cam:"CAM 04",label:"Motion detected — Rooftop",time:"just now",sev:"error"},{cam:"CAM 02",label:"Person identified — North Gate",time:"6m ago",sev:"info"},{cam:"CAM 01",label:"Loitering cleared — Main Lobby",time:"22m ago",sev:"success"},{cam:"CAM 06",label:"Door forced — Server Room",time:"34m ago",sev:"error"},{cam:"CAM 03",label:"Vehicle detected — Loading Bay",time:"48m ago",sev:"info"},{cam:"CAM 05",label:"Signal restored — Parking Deck",time:"1h ago",sev:"success"},{cam:"CAM 02",label:"Tailgating flagged — North Gate",time:"1h ago",sev:"error"},{cam:"CAM 04",label:"Crowd density normal — Rooftop",time:"2h ago",sev:"success"},{cam:"CAM 01",label:"Object left behind — Main Lobby",time:"2h ago",sev:"info"},{cam:"CAM 03",label:"Motion detected — Loading Bay",time:"3h ago",sev:"error"},{cam:"CAM 06",label:"Access granted — Server Room",time:"3h ago",sev:"success"},{cam:"CAM 05",label:"Camera offline — Parking Deck",time:"4h ago",sev:"error"},{cam:"CAM 02",label:"Face match — North Gate",time:"5h ago",sev:"info"},{cam:"CAM 01",label:"Queue length normal — Main Lobby",time:"6h ago",sev:"success"},{cam:"CAM 04",label:"Perimeter breach — Rooftop",time:"7h ago",sev:"error"},{cam:"CAM 03",label:"Package scanned — Loading Bay",time:"8h ago",sev:"info"}];function dl(){const e=ve(),r=L(k=>k.settings),{t,rad:o,radSm:i,pad:s,padSm:a,gap:l,screenPad:c,tH1:g,tH2:f,tTitle:x,wH1:m,headFam:h,headLH:b,accentBg:u,btnText:y,btnShadow:v,tBodySm:E,tCaption:H,tOverline:S,bwEmph:C,btnCase:B,bodyWeightEff:D,errSoft:$,errTxt:X,mediaBg:Q,overlaySurface:Y,overlayBorder:d,onOverlay:I,sevMap:P}=e,W=h+",sans-serif",z=r.fontFamily+",sans-serif",q=e.hc1||t.textPrimary,U=e.hc2||t.textPrimary,G=e.hc3||t.textPrimary,R=e.cardBorder==="none"?"none":e.cardBorder,O=sl.map(k=>({...k,dotC:k.online?r.successHex:t.textDisabled})),[J,V]=Br(3,3,16),N=ll.slice(0,V).map(k=>({...k,...P[k.sev]})),M={background:t.paper,border:R,borderRadius:o,boxShadow:e.cardShadow,overflow:"hidden"},j={padding:`${a}px ${s}px`,background:e.cardHdrBg,borderBottom:e.cardHdrBorder,boxShadow:e.cardHdrAccent,display:"flex",alignItems:"center",justifyContent:"space-between"},A={fontSize:x,lineHeight:b,fontWeight:m,color:G,fontFamily:W};return n.jsxs("div",{style:{display:"flex",flexDirection:"column",background:t.paper,border:R,borderRadius:o,boxShadow:e.cardShadow,overflow:"hidden",fontFamily:z,fontWeight:D,color:t.textPrimary},children:[n.jsxs("div",{style:{padding:s,background:e.cardHdrBg,borderBottom:e.cardHdrBorder,boxShadow:e.cardHdrAccent,display:"flex",alignItems:"flex-start",justifyContent:"space-between",gap:14},children:[n.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[n.jsx("div",{style:{fontSize:g,lineHeight:b,fontWeight:m,color:q,letterSpacing:"-.3px",fontFamily:W},children:"Camera Surveillance"}),n.jsx("span",{title:"6 feeds · live monitoring & recording",style:{width:16,height:16,borderRadius:"50%",border:"1.2px solid "+t.textSecondary,color:t.textSecondary,fontSize:9.5,fontWeight:C,fontStyle:"italic",fontFamily:"Georgia,serif",display:"grid",placeItems:"center",flexShrink:0,cursor:"help"},children:"i"})]}),n.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[n.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:6,fontSize:H,fontWeight:C,color:X,background:$,padding:"6px 12px",borderRadius:999},children:[n.jsx("span",{style:{width:7,height:7,borderRadius:"50%",background:r.errorHex}}),"LIVE"]}),n.jsx("button",{style:{padding:"10px 18px",borderRadius:i,border:"none",background:u,color:y,fontSize:E,fontWeight:C,textTransform:B,letterSpacing:".4px",boxShadow:v,whiteSpace:"nowrap",cursor:"pointer"},children:"+ Add Camera"})]})]}),n.jsxs("div",{style:{padding:c,background:t.bgDefault,display:"flex",flexDirection:"column",flex:1,minHeight:0},children:[n.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(4,1fr)",gap:l,marginBottom:l},children:al.map(k=>n.jsxs("div",{style:M,children:[n.jsx("div",{style:{padding:`${a}px ${s}px`,background:e.cardHdrBg,borderBottom:e.cardHdrBorder,boxShadow:e.cardHdrAccent},children:n.jsx("span",{style:{fontSize:S,color:t.textSecondary,textTransform:"uppercase",letterSpacing:".6px",fontWeight:C},children:k.label})}),n.jsx("div",{style:{padding:`${a}px ${s}px`},children:n.jsx("div",{style:{fontSize:f,fontWeight:m,color:U,letterSpacing:"-.8px",lineHeight:1},children:k.val})})]},k.label))}),n.jsxs("div",{style:{display:"grid",gridTemplateColumns:"1fr 300px",gap:l,flex:1,minHeight:0},children:[n.jsxs("div",{style:{...M,display:"flex",flexDirection:"column"},children:[n.jsxs("div",{style:j,children:[n.jsx("span",{style:A,children:"Camera Wall"}),n.jsx("span",{style:{fontSize:H,color:t.textSecondary,fontWeight:C},children:"2 × 3 grid"})]}),n.jsx("div",{style:{padding:s,display:"grid",gridTemplateColumns:"1fr 1fr 1fr",gridAutoRows:"1fr",gap:l},children:O.map(k=>n.jsxs("div",{style:{position:"relative",borderRadius:i,overflow:"hidden",background:Q,minHeight:104,border:"1px solid "+t.divider},children:[n.jsx("div",{style:{position:"absolute",inset:0,display:"grid",placeItems:"center"},children:n.jsx("span",{style:{fontFamily:"monospace",fontSize:H,color:"rgba(255,255,255,.3)",letterSpacing:1},children:k.loc})}),n.jsxs("div",{style:{position:"absolute",top:7,left:7,display:"flex",alignItems:"center",gap:5,background:Y,border:"1px solid "+d,borderRadius:999,padding:"2px 8px"},children:[n.jsx("span",{style:{width:6,height:6,borderRadius:"50%",background:k.dotC}}),n.jsx("span",{style:{color:I,fontSize:H,fontWeight:700,letterSpacing:".4px"},children:k.name})]}),k.rec&&n.jsxs("div",{style:{position:"absolute",top:7,right:7,display:"flex",alignItems:"center",gap:4,background:Y,borderRadius:999,padding:"2px 7px"},children:[n.jsx("span",{style:{width:6,height:6,borderRadius:"50%",background:r.errorHex}}),n.jsx("span",{style:{color:I,fontSize:8,fontWeight:800,letterSpacing:".5px"},children:"REC"})]}),k.online&&n.jsx("div",{style:{position:"absolute",bottom:0,left:0,right:0,padding:"5px 8px",background:"linear-gradient(0deg,rgba(0,0,0,.7),rgba(0,0,0,0))",display:"flex",justifyContent:"space-between",alignItems:"center"},children:n.jsx("span",{style:{color:"#fff",fontSize:H,fontWeight:600,fontFamily:"monospace"},children:k.time})})]},k.name))})]}),n.jsxs("div",{style:{...M,display:"flex",flexDirection:"column"},children:[n.jsx("div",{style:{padding:`${a}px ${s}px`,background:e.cardHdrBg,borderBottom:e.cardHdrBorder,boxShadow:e.cardHdrAccent},children:n.jsx("span",{style:A,children:"Recent Detections"})}),n.jsx("div",{ref:J,style:{padding:a,display:"flex",flexDirection:"column",justifyContent:"space-between",gap:2,flex:1,minHeight:0},children:N.map((k,T)=>n.jsxs("div",{style:{display:"flex",gap:11,alignItems:"flex-start",padding:"9px 8px",borderRadius:i},children:[n.jsx("div",{style:{width:28,height:28,borderRadius:i,background:k.cb,color:k.cc,display:"grid",placeItems:"center",flexShrink:0,fontSize:11,fontWeight:800,fontFamily:"monospace"},children:"●"}),n.jsxs("div",{style:{flex:1,minWidth:0},children:[n.jsx("div",{style:{fontSize:E,color:t.textPrimary,fontWeight:D,lineHeight:1.35},children:k.label}),n.jsxs("div",{style:{fontSize:H,color:t.textSecondary,marginTop:2},children:[k.cam," · ",k.time]})]})]},T))})]})]})]})]})}const cl=[{ic:"!",label:"Camera 04 motion detected — Loading Bay",time:"just now",sev:"error",unread:!0},{ic:"✓",label:"Stream reconnected — North Gate feed",time:"4m ago",sev:"success",unread:!0},{ic:"i",label:"Access request — J. Okoro (Operator)",time:"22m ago",sev:"info",unread:!1},{ic:"!",label:"Report archive storage 82% full",time:"1h ago",sev:"warning",unread:!1},{ic:"✓",label:"Backup completed — 12,480 clips archived",time:"2h ago",sev:"success",unread:!1},{ic:"i",label:"Firmware update available — 3 devices",time:"3h ago",sev:"info",unread:!1},{ic:"!",label:"Camera 02 lens obstruction detected",time:"5h ago",sev:"error",unread:!1},{ic:"✓",label:"Nightly health check passed — all nodes",time:"6h ago",sev:"success",unread:!1},{ic:"i",label:"New operator invited — M. Fernandez",time:"7h ago",sev:"info",unread:!1},{ic:"!",label:"Bandwidth spike on West Wing uplink",time:"8h ago",sev:"warning",unread:!1},{ic:"✓",label:"Retention policy applied — 30 day window",time:"9h ago",sev:"success",unread:!1},{ic:"i",label:"Scheduled maintenance — Sat 02:00 UTC",time:"11h ago",sev:"info",unread:!1},{ic:"!",label:"Motion zone breach — Perimeter Gate 3",time:"12h ago",sev:"error",unread:!1},{ic:"✓",label:"Clip export finished — Incident #4821",time:"14h ago",sev:"success",unread:!1},{ic:"i",label:"Analytics model updated — v2.4.1",time:"16h ago",sev:"info",unread:!1},{ic:"!",label:"Disk latency elevated — NVR-02",time:"18h ago",sev:"warning",unread:!1}];function pl(){const e=ve(),r=L(A=>A.settings),{t,rad:o,radSm:i,pad:s,padSm:a,gap:l,screenPad:c,tH1:g,tTitle:f,wH1:x,headFam:m,headLH:h,accentBg:b,btnText:u,tBodySm:y,tCaption:v,tOverline:E,bwEmph:H,bodyWeightEff:S,bodyLH:C,errSoft:B,errTxt:D,pMain:$,mediaBg:X,overlaySurface:Q,overlayBorder:Y,onOverlay:d,sevMap:I}=e,P=m+",sans-serif",W=r.fontFamily+",sans-serif",z=e.hc1||t.textPrimary,q=e.hc3||t.textPrimary,U=e.cardBorder==="none"?"none":e.cardBorder,[G,R]=Br(7,4,16),O=cl.slice(0,R).map(A=>({...A,...I[A.sev],rowBg:A.unread?ce(r.primaryHex,e.isDark?.12:.05):"transparent"})),J=O.filter(A=>A.unread).length,V={display:"flex",flexDirection:"column",minHeight:0,background:t.paper,border:U,borderRadius:o,boxShadow:e.cardShadow,overflow:"hidden"},N={padding:`${a}px ${s}px`,background:e.cardHdrBg,borderBottom:e.cardHdrBorder,boxShadow:e.cardHdrAccent,display:"flex",alignItems:"center",justifyContent:"space-between"},M={fontSize:f,lineHeight:h,fontWeight:x,color:q,fontFamily:P},j={height:30,borderRadius:i,border:"none",background:"rgba(255,255,255,.14)",color:d,fontSize:v,fontWeight:H,cursor:"pointer",fontFamily:"inherit"};return n.jsxs("div",{style:{display:"flex",flexDirection:"column",background:t.paper,border:U,borderRadius:o,boxShadow:e.cardShadow,overflow:"hidden",fontFamily:W,fontWeight:S,color:t.textPrimary},children:[n.jsx("div",{style:{padding:s,background:e.cardHdrBg,borderBottom:e.cardHdrBorder,boxShadow:e.cardHdrAccent},children:n.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[n.jsx("div",{style:{fontSize:g,lineHeight:h,fontWeight:x,color:z,letterSpacing:"-.3px",fontFamily:P},children:"Operations Center"}),n.jsx("span",{title:"Live map, camera feeds, alerts & access — every module themed end to end",style:{width:16,height:16,borderRadius:"50%",border:"1.2px solid "+t.textSecondary,color:t.textSecondary,fontSize:9.5,fontWeight:H,fontStyle:"italic",fontFamily:"Georgia,serif",display:"grid",placeItems:"center",flexShrink:0,cursor:"help"},children:"i"})]})}),n.jsx("div",{style:{padding:c,background:t.bgDefault,display:"flex",flexDirection:"column",flex:1,minHeight:0},children:n.jsxs("div",{style:{display:"grid",gridTemplateColumns:"1fr 320px",gap:l,flex:1,minHeight:0},children:[n.jsxs("div",{style:V,children:[n.jsxs("div",{style:N,children:[n.jsx("span",{style:M,children:"Live Map · Street View"}),n.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:6,fontSize:v,fontWeight:H,color:D,background:B,padding:"3px 10px",borderRadius:999},children:[n.jsx("span",{style:{width:7,height:7,borderRadius:"50%",background:r.errorHex}}),"LIVE"]})]}),n.jsxs("div",{style:{position:"relative",flex:1,minHeight:320,background:X,display:"flex",alignItems:"center",justifyContent:"center"},children:[n.jsx("span",{style:{fontFamily:"monospace",fontSize:v,color:"rgba(255,255,255,.42)",letterSpacing:1.5},children:"◍ GOOGLE STREET VIEW / EARTH EMBED"}),n.jsx("div",{style:{position:"absolute",top:12,left:12,display:"flex",alignItems:"center",gap:7,background:Q,border:"1px solid "+Y,borderRadius:999,padding:"6px 12px"},children:n.jsx("span",{style:{color:d,fontSize:v,fontWeight:H},children:"◎ 40.7128, -74.0060 · Manhattan"})}),n.jsxs("div",{style:{position:"absolute",bottom:12,left:"50%",transform:"translateX(-50%)",display:"flex",alignItems:"center",gap:4,background:Q,border:"1px solid "+Y,borderRadius:i,padding:5},children:[n.jsx("button",{style:{width:30,height:30,borderRadius:i,border:"none",background:b,color:u,fontSize:16,fontWeight:H,cursor:"pointer"},children:"+"}),n.jsx("button",{style:{width:30,height:30,borderRadius:i,border:"none",background:"rgba(255,255,255,.14)",color:d,fontSize:16,fontWeight:H,cursor:"pointer"},children:"−"}),n.jsx("div",{style:{width:1,height:18,background:Y,margin:"0 3px"}}),n.jsx("button",{style:{...j,padding:"0 12px"},children:"Layers"}),n.jsx("button",{style:{...j,padding:"0 12px"},children:"◎ Locate"})]})]})]}),n.jsxs("div",{style:V,children:[n.jsxs("div",{style:N,children:[n.jsx("span",{style:M,children:"Notifications"}),n.jsxs("span",{style:{fontSize:E,fontWeight:H,color:t.pContrast,background:$,padding:"2px 9px",borderRadius:999},children:[J," NEW"]})]}),n.jsx("div",{ref:G,style:{padding:a,display:"flex",flexDirection:"column",gap:2,flex:1,minHeight:0},children:O.map((A,k)=>n.jsxs("div",{style:{display:"flex",gap:11,alignItems:"flex-start",padding:"9px 8px",borderRadius:i,background:A.rowBg},children:[n.jsx("div",{style:{width:26,height:26,borderRadius:i,background:A.cb,color:A.cc,display:"grid",placeItems:"center",flexShrink:0,fontSize:13,fontWeight:H},children:A.ic}),n.jsxs("div",{style:{flex:1,minWidth:0},children:[n.jsx("div",{style:{fontSize:y,color:t.textPrimary,fontWeight:S,lineHeight:C},children:A.label}),n.jsx("div",{style:{fontSize:v,color:t.textSecondary,marginTop:2},children:A.time})]}),A.unread&&n.jsx("div",{style:{width:8,height:8,borderRadius:"50%",background:$,flexShrink:0,marginTop:6}})]},k))})]})]})})]})}const ul=[{label:"Reports Generated",val:"248"},{label:"Avg Generation",val:"1.2s"},{label:"Data Points",val:"84.2K"},{label:"Scheduled",val:"12"}],fl=["Jan","Feb","Mar","Apr","May","Jun"],hl=[44,60,50,74,88,96],gl=[24,32,30,42,52,60],xl=[{l:"Reports",h:72},{l:"Cameras",h:92},{l:"Alerts",h:40},{l:"Users",h:58},{l:"Storage",h:80}],ml=[{name:"Q2 Revenue Summary",type:"Financial",date:"Jun 20",status:"Ready"},{name:"Camera Uptime Audit",type:"Operations",date:"Jun 19",status:"Ready"},{name:"User Access Log",type:"Security",date:"Jun 18",status:"Ready"},{name:"Inventory Forecast",type:"Analytics",date:"Jun 17",status:"Processing"},{name:"Monthly KPI Digest",type:"Executive",date:"Jun 15",status:"Ready"},{name:"Incident Response Log",type:"Security",date:"Jun 14",status:"Ready"},{name:"Storage Utilization Report",type:"Operations",date:"Jun 13",status:"Ready"},{name:"Weekly Traffic Analysis",type:"Analytics",date:"Jun 12",status:"Processing"},{name:"Vendor SLA Compliance",type:"Financial",date:"Jun 11",status:"Ready"},{name:"Motion Event Rollup",type:"Operations",date:"Jun 10",status:"Ready"},{name:"Quarterly Audit Trail",type:"Security",date:"Jun 09",status:"Ready"},{name:"Energy Consumption Digest",type:"Analytics",date:"Jun 08",status:"Processing"},{name:"Executive Board Pack",type:"Executive",date:"Jun 07",status:"Ready"},{name:"Device Firmware Ledger",type:"Operations",date:"Jun 06",status:"Ready"},{name:"Access Anomaly Report",type:"Security",date:"Jun 05",status:"Ready"},{name:"Cost Allocation Summary",type:"Financial",date:"Jun 04",status:"Ready"}],bn="1fr 130px 110px 90px 70px";function yl(){const e=ve(),r=L(k=>k.settings),{t,rad:o,radSm:i,pad:s,padSm:a,gap:l,screenPad:c,rowPy:g,tH1:f,tH2:x,tTitle:m,wH1:h,headFam:b,headLH:u,accentBg:y,btnText:v,btnShadow:E,tBody:H,tBodySm:S,tCaption:C,tOverline:B,bwEmph:D,btnCase:$,bodyWeightEff:X,pMain:Q,sMain:Y,chartPalette:d}=e,I=b+",sans-serif",P=r.fontFamily+",sans-serif",W=e.hc1||t.textPrimary,z=e.hc2||t.textPrimary,q=e.hc3||t.textPrimary,U=e.cardBorder==="none"?"none":e.cardBorder,[G,R,O]=Un(5,3,16),J=ml.slice(0,O).map(k=>({...k,sb:k.status==="Ready"?e.sucSoft:e.warnSoft,sc:k.status==="Ready"?e.sucTxt:e.warnTxt})),V=xl.map((k,T)=>({...k,c:d[T%d.length]})),N={background:t.paper,border:U,borderRadius:o,boxShadow:e.cardShadow,overflow:"hidden"},M={padding:`${a}px ${s}px`,background:e.cardHdrBg,borderBottom:e.cardHdrBorder,boxShadow:e.cardHdrAccent,display:"flex",alignItems:"center",justifyContent:"space-between"},j={fontSize:m,lineHeight:u,fontWeight:h,color:q,fontFamily:I},A={fontSize:B,fontWeight:D,color:t.textSecondary,textTransform:"uppercase",letterSpacing:".5px"};return n.jsxs("div",{style:{display:"flex",flexDirection:"column",background:t.paper,border:U,borderRadius:o,boxShadow:e.cardShadow,overflow:"hidden",fontFamily:P,fontWeight:X,color:t.textPrimary},children:[n.jsxs("div",{style:{padding:s,background:e.cardHdrBg,borderBottom:e.cardHdrBorder,boxShadow:e.cardHdrAccent,display:"flex",alignItems:"flex-start",justifyContent:"space-between",gap:14},children:[n.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[n.jsx("div",{style:{fontSize:f,lineHeight:u,fontWeight:h,color:W,letterSpacing:"-.3px",fontFamily:I},children:"Reports"}),n.jsx("span",{title:"Generated insights across every module",style:{width:16,height:16,borderRadius:"50%",border:"1.2px solid "+t.textSecondary,color:t.textSecondary,fontSize:9.5,fontWeight:D,fontStyle:"italic",fontFamily:"Georgia,serif",display:"grid",placeItems:"center",flexShrink:0,cursor:"help"},children:"i"})]}),n.jsx("button",{style:{padding:"10px 20px",borderRadius:i,border:"none",background:y,color:v,fontSize:S,fontWeight:D,textTransform:$,letterSpacing:".4px",boxShadow:E,whiteSpace:"nowrap",cursor:"pointer"},children:"↓ Export PDF"})]}),n.jsxs("div",{style:{padding:c,background:t.bgDefault,display:"flex",flexDirection:"column",flex:1,minHeight:0},children:[n.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(4,1fr)",gap:l,marginBottom:l},children:ul.map(k=>n.jsxs("div",{style:N,children:[n.jsx("div",{style:{padding:`${a}px ${s}px`,background:e.cardHdrBg,borderBottom:e.cardHdrBorder,boxShadow:e.cardHdrAccent},children:n.jsx("span",{style:{fontSize:B,color:t.textSecondary,textTransform:"uppercase",letterSpacing:".6px",fontWeight:D},children:k.label})}),n.jsx("div",{style:{padding:`${a}px ${s}px`},children:n.jsx("div",{style:{fontSize:x,fontWeight:h,color:z,letterSpacing:"-.8px",lineHeight:1},children:k.val})})]},k.label))}),n.jsxs("div",{style:{display:"grid",gridTemplateColumns:"1fr 300px",gap:l,marginBottom:l},children:[n.jsxs("div",{style:N,children:[n.jsxs("div",{style:M,children:[n.jsx("span",{style:j,children:"Revenue & Profit Trend"}),n.jsx("span",{style:{fontSize:C,color:t.textSecondary,fontWeight:D},children:"6 months"})]}),n.jsx("div",{style:{padding:s,display:"flex",alignItems:"flex-end",gap:12,height:160},children:fl.map((k,T)=>n.jsxs("div",{style:{flex:1,display:"flex",flexDirection:"column",alignItems:"center",gap:6,height:"100%"},children:[n.jsxs("div",{style:{width:"100%",display:"flex",flexDirection:"column",justifyContent:"flex-end",gap:3,flex:1},children:[n.jsx("div",{style:{width:"100%",height:gl[T]+"%",background:Y,opacity:.55,borderRadius:`${i} ${i} 0 0`}}),n.jsx("div",{style:{width:"100%",height:hl[T]+"%",background:Q,borderRadius:`${i} ${i} 0 0`}})]}),n.jsx("span",{style:{fontSize:C,color:t.textSecondary},children:k})]},k))})]}),n.jsxs("div",{style:N,children:[n.jsx("div",{style:{padding:`${a}px ${s}px`,background:e.cardHdrBg,borderBottom:e.cardHdrBorder,boxShadow:e.cardHdrAccent},children:n.jsx("span",{style:j,children:"By Module"})}),n.jsx("div",{style:{padding:s,display:"flex",alignItems:"flex-end",gap:10,height:128},children:V.map(k=>n.jsx("div",{style:{flex:1,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"flex-end",height:"100%"},children:n.jsx("div",{style:{width:"100%",height:k.h+"%",background:k.c,borderRadius:`${i} ${i} 0 0`}})},k.l))})]})]}),n.jsxs("div",{style:{...N,display:"flex",flexDirection:"column",flex:1,minHeight:0},children:[n.jsx("div",{style:{padding:`${a}px ${s}px`,background:e.cardHdrBg,borderBottom:e.cardHdrBorder,boxShadow:e.cardHdrAccent},children:n.jsx("span",{style:j,children:"Recent Reports"})}),n.jsxs("div",{ref:G,style:{display:"grid",gridTemplateColumns:bn,padding:`${g}px ${s}px`,borderBottom:"1px solid "+t.divider,background:t.paper2},children:[["Report","Type","Status","Date"].map(k=>n.jsx("div",{style:A,children:k},k)),n.jsx("div",{})]}),n.jsx("div",{ref:R,style:{display:"flex",flexDirection:"column",flex:1,minHeight:0},children:J.map(k=>n.jsxs("div",{style:{display:"grid",gridTemplateColumns:bn,padding:`${g}px ${s}px`,borderBottom:"1px solid "+t.divider,alignItems:"center"},children:[n.jsx("div",{style:{fontSize:H,color:t.textPrimary,fontWeight:D},children:k.name}),n.jsx("div",{style:{fontSize:S,color:t.textSecondary},children:k.type}),n.jsx("div",{children:n.jsx("span",{style:{padding:"4px 11px",borderRadius:999,fontSize:C,fontWeight:D,background:k.sb,color:k.sc,whiteSpace:"nowrap"},children:k.status})}),n.jsx("div",{style:{fontSize:S,color:t.textSecondary},children:k.date}),n.jsx("div",{children:n.jsx("button",{style:{fontSize:C,color:Q,background:t.pContainer,border:"none",fontWeight:D,padding:"5px 11px",borderRadius:i,cursor:"pointer"},children:"↓ PDF"})})]},k.name))})]})]})]})}const vn=({size:e})=>n.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.6,strokeLinecap:"round",strokeLinejoin:"round",children:[n.jsx("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2"}),n.jsx("circle",{cx:"8.5",cy:"8.5",r:"1.5"}),n.jsx("path",{d:"m21 15-5-5L5 21"})]});function bl(){const e=ve(),r=L(z=>z.settings),{t,rad:o,radSm:i,pad:s,tH1:a,tBody:l,tBodySm:c,tCaption:g,wH1:f,headLH:x,accentBg:m,btnText:h,btnShadow:b,bwEmph:u,pMain:y,iconInitials:v,hasLoginImage:E,loginCenteredGrad:H,loginScrimGradC:S}=e,C=r.fontFamily+",sans-serif",B=e.hc1||t.textPrimary,D=t.pContrast,$=e.cardBorder==="none"?"none":e.cardBorder,X=r.logoMode==="image"&&!!r.logoUrl,Q=e.isDark?t.paper2:"#ffffff",Y=r.loginPanelColor||t.bgDefault,d=r.loginImgOpacity>0?r.loginImgOpacity:1,I=E?n.jsx("img",{src:r.loginImage,alt:"",style:{position:"absolute",inset:0,width:"100%",height:"100%",objectFit:"cover",zIndex:0,opacity:d}}):null,P={background:t.paper,border:$,borderRadius:o,boxShadow:e.cardShadow,padding:s,display:"flex",flexDirection:"column",gap:20},W=z=>({position:"relative",background:t.paper2,border:"1.5px solid "+(z?y:t.outline),borderRadius:i});return r.loginLayout==="centered"?n.jsxs("div",{style:{minHeight:560,background:H,display:"flex",alignItems:"center",justifyContent:"center",padding:40,position:"relative",overflow:"hidden",fontFamily:C,borderRadius:o},children:[I,E&&n.jsx("div",{style:{position:"absolute",inset:0,background:S,zIndex:0}}),n.jsxs("div",{style:{position:"relative",zIndex:1,width:"100%",maxWidth:380,background:t.paper,border:$,borderRadius:o,boxShadow:"0 24px 60px rgba(0,0,0,.35)",padding:s,display:"flex",flexDirection:"column",gap:20,alignItems:"center"},children:[n.jsx("div",{style:{width:72,height:72,borderRadius:20,background:r.iconColor,display:"grid",placeItems:"center",boxShadow:"0 6px 18px "+r.iconColor+"55"},children:n.jsx("span",{style:{color:"#fff",fontSize:24,fontWeight:u,letterSpacing:"-1px"},children:v})}),n.jsxs("div",{style:{width:"100%",display:"flex",flexDirection:"column",gap:14},children:[n.jsxs("div",{style:{position:"relative",border:"1.5px solid "+t.outline,borderRadius:i,padding:"13px 14px"},children:[n.jsx("span",{style:{position:"absolute",top:-8,left:11,background:t.paper,padding:"0 5px",fontSize:11,color:t.textSecondary},children:"Email"}),n.jsx("span",{style:{fontSize:l,color:t.textPrimary},children:"admin@company.com"})]}),n.jsxs("div",{style:{position:"relative",border:"1.5px solid "+t.outline,borderRadius:i,padding:"13px 14px"},children:[n.jsx("span",{style:{position:"absolute",top:-8,left:11,background:t.paper,padding:"0 5px",fontSize:11,color:t.textSecondary},children:"Password"}),n.jsx("span",{style:{fontSize:l,color:t.textPrimary,letterSpacing:3},children:"••••••••"})]}),n.jsx("button",{style:{padding:13,borderRadius:i,border:"none",background:m,color:h,fontSize:l,fontWeight:u,textTransform:"uppercase",letterSpacing:".5px",boxShadow:b,cursor:"pointer"},children:"Sign in"})]})]})]}):n.jsxs("div",{style:{display:"grid",gridTemplateColumns:"3fr 1fr",minHeight:560,fontFamily:C,borderRadius:o,overflow:"hidden"},children:[n.jsxs("div",{style:{background:Q,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",padding:"48px 40px",gap:22,position:"relative",overflow:"hidden"},children:[I,!E&&n.jsxs("div",{style:{position:"absolute",inset:0,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:12,color:t.textSecondary,border:"1.5px dashed "+t.outline,padding:24,boxSizing:"border-box"},children:[n.jsx(vn,{size:46}),n.jsx("div",{style:{fontSize:14,fontWeight:u,color:t.textPrimary},children:"No brand image"}),n.jsx("div",{style:{fontSize:12,color:t.textSecondary,textAlign:"center",maxWidth:220},children:"Upload an image in the Login Screen settings to fill this panel."})]})]}),n.jsxs("div",{style:{background:Y,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:22,padding:"48px 40px"},children:[X?n.jsx("img",{src:r.logoUrl,alt:r.appName,style:{maxHeight:64,maxWidth:200,objectFit:"contain"}}):n.jsxs("div",{style:{display:"inline-flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:6,maxWidth:200,maxHeight:64,border:"1.5px dashed "+t.outline,borderRadius:i,boxSizing:"border-box",color:t.textSecondary,padding:"8px 16px"},children:[n.jsx(vn,{size:20}),n.jsx("span",{style:{fontSize:g,fontWeight:u,color:t.textSecondary,whiteSpace:"nowrap"},children:"No logo uploaded"})]}),n.jsxs("div",{style:{width:"100%",maxWidth:340,...P},children:[n.jsxs("div",{style:{textAlign:"center"},children:[n.jsx("div",{style:{fontSize:a,lineHeight:x,fontWeight:f,color:B,letterSpacing:"-.4px",marginBottom:5},children:"Welcome back"}),n.jsx("div",{style:{fontSize:c,color:t.textSecondary},children:"Sign in to continue"})]}),n.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:16},children:[n.jsxs("div",{children:[n.jsx("div",{style:{fontSize:g,fontWeight:u,color:t.textPrimary,marginBottom:7},children:"Email Address"}),n.jsxs("div",{style:{...W(!1),padding:"12px 14px 12px 40px"},children:[n.jsx("span",{style:{position:"absolute",left:13,top:"50%",transform:"translateY(-50%)",color:t.textSecondary,fontSize:14},children:"✉"}),n.jsx("span",{style:{fontSize:l,color:t.textPrimary},children:"admin@company.com"})]})]}),n.jsxs("div",{children:[n.jsx("div",{style:{fontSize:g,fontWeight:u,color:t.textPrimary,marginBottom:7},children:"Password"}),n.jsxs("div",{style:{...W(!0),padding:"12px 40px 12px 40px"},children:[n.jsx("span",{style:{position:"absolute",left:13,top:"50%",transform:"translateY(-50%)",color:t.textSecondary,fontSize:14},children:"🔒"}),n.jsx("span",{style:{fontSize:l,color:t.textPrimary,letterSpacing:3},children:"••••••••"}),n.jsx("span",{style:{position:"absolute",right:13,top:"50%",transform:"translateY(-50%)",color:t.textSecondary,fontSize:14},children:"👁"})]})]}),n.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between"},children:[n.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[n.jsx("div",{style:{width:17,height:17,borderRadius:4,background:y,display:"grid",placeItems:"center",color:D,fontSize:11,fontWeight:u},children:"✓"}),n.jsx("span",{style:{fontSize:c,color:t.textPrimary},children:"Remember me"})]}),n.jsx("span",{style:{fontSize:c,color:y,fontWeight:u},children:"Forgot password?"})]}),n.jsxs("button",{style:{padding:13,borderRadius:i,border:"none",background:m,color:h,fontSize:l,fontWeight:u,letterSpacing:".3px",boxShadow:b,marginTop:2,display:"flex",alignItems:"center",justifyContent:"center",gap:8,cursor:"pointer"},children:["Login ",n.jsx("span",{style:{fontSize:15},children:"→"})]})]}),n.jsxs("div",{style:{textAlign:"center",fontSize:g,color:t.textSecondary},children:["Powered by ",n.jsx("span",{style:{color:y,fontWeight:u},children:r.appName})," © 2026"]})]})]})]})}function vl(){const e=ve(),r=L(b=>b.settings),[t,o]=_.useState(!1);if(t)return null;const{t:i,npos:s,nacc:a,toastDeco:l,toastBg:c,rad:g,radSm:f,tBodySm:x,tCaption:m}=e,h=(r.toastW>0?r.toastW:252)+"px";return n.jsxs("div",{style:{position:"absolute",zIndex:40,width:h,maxWidth:"70%",boxSizing:"border-box",background:c,borderRadius:g,display:"flex",gap:"10px",alignItems:"flex-start",padding:"12px 13px",fontFamily:r.fontFamily+",sans-serif",...s,...l},children:[n.jsx("div",{style:{width:"30px",height:"30px",borderRadius:f,background:a.icbg,color:a.icc,display:"grid",placeItems:"center",flexShrink:0,fontSize:"15px",fontWeight:800},children:"!"}),n.jsxs("div",{style:{flex:1,minWidth:0},children:[n.jsx("div",{style:{fontSize:x+"px",fontWeight:700,color:i.textPrimary,marginBottom:"2px"},children:"Low stock alert"}),n.jsx("div",{style:{fontSize:m+"px",color:i.textSecondary,lineHeight:1.4},children:"Widget Pro is down to 12 units left."})]}),r.notifAutoDismiss&&n.jsx("div",{title:"Auto-dismiss countdown",style:{flexShrink:0,marginTop:"1px",minWidth:"26px",height:"20px",padding:"0 7px",borderRadius:"999px",background:ce(a.dot,.14),color:a.dot,fontSize:m-.5+"px",fontWeight:800,display:"grid",placeItems:"center",fontVariantNumeric:"tabular-nums"},children:(r.autoDismissSec>0?r.autoDismissSec:8)+"s"}),n.jsx("button",{title:"Dismiss notification",onClick:()=>o(!0),style:{flexShrink:0,width:"20px",height:"20px",marginTop:"1px",border:"none",background:"transparent",color:i.textSecondary,cursor:"pointer",borderRadius:"6px",display:"grid",placeItems:"center",padding:0,lineHeight:1},children:n.jsx("svg",{width:13,height:13,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2.4,strokeLinecap:"round",children:n.jsx("path",{d:"M18 6 6 18M6 6l12 12"})})})]})}const Sl=[75,90,100,125];function Cl(){var f;const e=Ke(x=>x.previewScreen),r=L(x=>x.settings.edgePadPx)||0,t=e==="operations"?0:r,[o,i]=_.useState("fit"),s=_.useRef(null),a=_.useRef(null),[l,c]=_.useState(100);_.useLayoutEffect(()=>{const x=s.current,m=a.current;if(!x||!m)return;const h=()=>{const E=getComputedStyle(x),H=(parseFloat(E.paddingTop)||0)+(parseFloat(E.paddingBottom)||0);if(o!=="fit"){const d=o/100;m.style.zoom=String(d);const I=x.clientHeight-H;m.style.minHeight=(I>0?Math.floor(I/d):0)+"px",c(o);return}m.style.zoom="1",m.style.minHeight="0px",m.offsetHeight;const S=(parseFloat(E.paddingLeft)||0)+(parseFloat(E.paddingRight)||0),C=x.clientWidth-S,B=x.clientHeight-H,D=m.scrollWidth,$=m.scrollHeight;if(D<=0||$<=0||C<=0||B<=0)return;const X=Math.min(C/D,B/$,1),Q=X<.985?Math.max(.36,X):1;m.style.zoom=String(Q);const Y=Math.min(C/D,1);m.style.minHeight=Math.floor(B/Math.max(Y,.36))+"px",c(Math.round(Q*100))};let b=0,u=0;const y=()=>{h(),++u<36&&(b=requestAnimationFrame(y))};y();const v=new ResizeObserver(h);return v.observe(x),v.observe(m),()=>{cancelAnimationFrame(b),v.disconnect()}},[o,t,e]);const g=((f=qs.find(x=>x.key===e))==null?void 0:f.label)??"";return n.jsxs(p.Box,{sx:{flex:1,minWidth:0,display:"flex",flexDirection:"column",bgcolor:"background.default"},children:[n.jsxs(p.Box,{sx:{px:2.5,py:1.25,borderBottom:"1px solid",borderColor:"divider",display:"flex",alignItems:"center",gap:1.5,bgcolor:"background.paper"},children:[n.jsx(Qs,{sx:{fontSize:22,color:"text.secondary"}}),n.jsxs(p.Typography,{variant:"h5",sx:{flex:1,fontSize:18,fontWeight:700,letterSpacing:"-.2px"},children:["Previewing ",g]}),n.jsxs(p.Select,{size:"small",value:o,onChange:x=>i(x.target.value==="fit"?"fit":Number(x.target.value)),sx:{minWidth:128,fontSize:13,fontWeight:600,"& .MuiSelect-select":{py:.75}},children:[n.jsxs(p.MenuItem,{value:"fit",children:["Fit (",l,"%)"]}),Sl.map(x=>n.jsxs(p.MenuItem,{value:x,children:[x,"%"]},x))]})]}),n.jsxs(p.Box,{ref:s,sx:{flex:1,overflow:"auto",p:`${t}px`,position:"relative",bgcolor:"background.default"},children:[n.jsxs(p.Box,{ref:a,sx:{width:"100%",display:"flex",flexDirection:"column","& > *":{flex:"1 1 0%",minHeight:0}},children:[e==="dashboard"&&n.jsx(rl,{}),e==="orders"&&n.jsx(ol,{}),e==="reports"&&n.jsx(yl,{}),e==="cameras"&&n.jsx(dl,{}),e==="operations"&&n.jsx(pl,{}),e==="components"&&n.jsx(il,{}),e==="login"&&n.jsx(bl,{})]}),e!=="login"&&n.jsx(vl,{})]})]})}const jl=300,wl=520;function Tl(){const[e,r]=_.useState(!0),[t,o]=_.useState(300),[i,s]=_.useState(!1),a=L(y=>y.isDirty),l=L(y=>y.captureBaseline),c=L(y=>y.restoreBaseline),g=He(L(y=>y.settings.mode)),f=L(y=>y.settings.customFonts),x=L(y=>y.settings.customHeadFonts),m=_.useRef(null);_.useEffect(()=>{mn(f),mn(x)},[f,x]);const h=y=>{y.preventDefault(),m.current={x:y.clientX,w:t};const v=H=>{if(!m.current)return;const S=Math.max(jl,Math.min(wl,m.current.w+(H.clientX-m.current.x)));o(S)},E=()=>{m.current=null,window.removeEventListener("mousemove",v),window.removeEventListener("mouseup",E)};window.addEventListener("mousemove",v),window.addEventListener("mouseup",E)},b=()=>{a()?s(!0):r(!1)},u=()=>{r(!0),l()};return n.jsxs(p.Box,{sx:{position:"relative",width:"100%",height:"100%",display:"flex",flexDirection:"column",bgcolor:"background.paper"},children:[n.jsx(p.Box,{sx:{flex:1,minHeight:0,display:"flex"},children:n.jsxs(p.Box,{sx:{flex:1,minWidth:0,display:"flex",bgcolor:"background.default",borderTop:"1px solid",borderColor:"divider"},children:[e?n.jsxs(p.Box,{sx:{display:"flex",flexShrink:0},children:[n.jsx(p.Box,{sx:{width:t,flexShrink:0,borderRight:`1px solid ${g.studioBd}`,display:"flex",flexDirection:"column",bgcolor:g.card,overflow:"auto",scrollbarWidth:"none",msOverflowStyle:"none","&::-webkit-scrollbar":{display:"none"}},children:n.jsx(Xs,{onClose:b})}),n.jsx(p.Box,{onMouseDown:h,sx:{width:5,cursor:"col-resize",flexShrink:0,bgcolor:"divider",opacity:.4,"&:hover":{opacity:1,bgcolor:"primary.main"}}})]}):n.jsx(p.Tooltip,{title:"Open Theme Studio",placement:"right",arrow:!0,slotProps:{popper:{style:{pointerEvents:"none"}}},children:n.jsx(p.IconButton,{onClick:u,sx:{position:"absolute",left:68,bottom:56,zIndex:10,bgcolor:"primary.main",color:"primary.contrastText",boxShadow:4,"&:hover":{bgcolor:"primary.dark"}},children:n.jsx(gs,{})})}),n.jsx(Cl,{})]})}),n.jsxs(p.Dialog,{open:i,onClose:()=>s(!1),PaperProps:{sx:{borderRadius:3,width:300,p:2.5}},children:[n.jsx(p.Typography,{sx:{fontSize:15,fontWeight:800,mb:.75},children:"Save changes?"}),n.jsx(p.Typography,{sx:{fontSize:12.5,color:"text.secondary",lineHeight:1.5,mb:2.25},children:"You've made changes to the theme. Do you want to save them before leaving?"}),n.jsxs(p.Box,{sx:{display:"flex",flexDirection:"column",gap:1},children:[n.jsx(p.Box,{component:"button",onClick:()=>{l(),s(!1),r(!1)},sx:{p:1.4,borderRadius:2.5,border:"none",bgcolor:"primary.main",color:"primary.contrastText",fontSize:13,fontWeight:700,cursor:"pointer"},children:"Save & exit"}),n.jsx(p.Box,{component:"button",onClick:()=>{c(),s(!1),r(!1)},sx:{p:1.4,borderRadius:2.5,border:"1px solid",borderColor:"divider",bgcolor:"action.hover",color:"text.secondary",fontSize:13,fontWeight:600,cursor:"pointer"},children:"Discard & exit"}),n.jsx(p.Box,{component:"button",onClick:()=>s(!1),sx:{p:1.1,borderRadius:2.5,border:"none",bgcolor:"transparent",color:"text.secondary",fontSize:12.5,fontWeight:600,cursor:"pointer"},children:"Keep editing"})]})]})]})}function kl(e){const r=kr(e),t=r.t,o=`${r.headFam},sans-serif`,i=`${r.bodyFam},sans-serif`,s=a=>({fontFamily:o,fontSize:a,fontWeight:r.wH1,lineHeight:r.headLH});if(typeof window<"u"&&typeof document<"u"){const a=["Roboto","Inter","DM Sans","Manrope","Plus Jakarta Sans","Nunito Sans","Figtree"],c=[e.fontFamily,e.headingFont].filter(Boolean).map(f=>f.replace(/"/g,"").replace(/'/g,"")),g=Array.from(new Set(c)).filter(f=>a.includes(f));if(g.length>0){const f="dynamic-google-fonts";let x=document.getElementById(f);const h=`https://fonts.googleapis.com/css2?${g.map(b=>`family=${b.replace(/ /g,"+")}:wght@300;400;500;600;700;800;900`).join("&")}&display=swap`;x||(x=document.createElement("link"),x.id=f,x.rel="stylesheet",document.head.appendChild(x)),x.href=h}}return Ln({palette:{mode:e.mode,primary:{main:r.pMain,dark:r.pal[700],light:r.pal[300],contrastText:t.pContrast},secondary:{main:r.sMain,dark:r.spal[700],light:r.spal[300],contrastText:t.sContrast},success:{main:e.successHex},warning:{main:e.warningHex},info:{main:e.infoHex},error:{main:e.errorHex},background:{default:t.bgDefault,paper:t.paper},text:{primary:t.textPrimary,secondary:t.textSecondary,disabled:t.textDisabled},divider:t.divider},shape:{borderRadius:r.r},typography:{fontFamily:i,fontSize:r.base,h1:s(r.tH1),h2:s(r.tH2),h3:s(r.tTitle),h4:s(r.tH4),h5:s(r.tH5),h6:s(r.tH6),body1:{fontFamily:i,fontSize:r.tBody,lineHeight:r.bodyLH,fontWeight:r.bodyWeightEff},body2:{fontFamily:i,fontSize:r.tBodySm,lineHeight:r.bodyLH,fontWeight:r.bodyWeightEff},caption:{fontFamily:i,fontSize:r.tCaption,lineHeight:r.bodyLH},button:{textTransform:r.btnCase,fontWeight:r.bwEmph}},components:{MuiCssBaseline:{styleOverrides:{"button, input, textarea, select":{fontFamily:"inherit"}}},MuiCard:{styleOverrides:{root:{borderRadius:r.r,border:r.cardBorder==="none"?"none":r.cardBorder,boxShadow:r.cardShadow,backgroundImage:"none"}}},MuiCardHeader:{styleOverrides:{root:{backgroundColor:r.cardHdrBg,borderBottom:r.cardHdrBorder,boxShadow:r.cardHdrAccent}}},MuiDialog:{styleOverrides:{paper:{borderRadius:r.r,border:r.cardBorder==="none"?"none":r.cardBorder,boxShadow:r.cardShadow,backgroundImage:"none"}}},MuiDialogTitle:{styleOverrides:{root:{backgroundColor:r.cardHdrBg,borderBottom:r.cardHdrBorder,boxShadow:r.cardHdrAccent}}},MuiButton:{styleOverrides:{root:{borderRadius:r.r,boxShadow:"none"}},defaultProps:{disableElevation:!0},variants:e.accentGradient?[{props:{variant:"contained"},style:{backgroundImage:r.accentBg}}]:[]},MuiChip:{styleOverrides:{root:{borderRadius:999,fontWeight:e.statusBold?700:500}}}},urmTable:{rowPaddingY:r.table.rowPy,cellPaddingX:r.table.cellPx,headerBg:r.table.headBg,rowDivider:r.table.rowBorder,colDivider:r.table.colBorder,cellAlignH:e.tableCellAlignH,cellAlignV:e.tableCellAlignV,striped:e.tableStripe,stripeBg:r.table.stripeBg},tokens:{toastW:e.toastW>0?e.toastW:void 0,cardBorder:r.toastDeco.border,cardShadow:r.toastDeco.boxShadow,cardBodyBorder:r.cardBorder==="none"?"none":r.cardBorder,cardBodyShadow:r.cardShadow,cardHdrBg:r.cardHdrBg,cardHdrBorder:r.cardHdrBorder,cardHdrAccent:r.cardHdrAccent,cardHeader:e.cardHeader,status:{errSoft:r.errSoft,warnSoft:r.warnSoft,infoSoft:r.infoSoft,sucSoft:r.sucSoft,errTxt:r.errTxt,warnTxt:r.warnTxt,infoTxt:r.infoTxt,sucTxt:r.sucTxt},notifPosition:e.notifPosition,notifStyle:e.notifStyle,notifAccent:e.notifAccent,notifAutoDismiss:e.notifAutoDismiss,toastBg:r.toastBg,autoDismissSec:e.autoDismissSec>0?e.autoDismissSec:void 0,statusBold:e.statusBold,cardHdrHex:e.cardHdrHex||void 0,containerPad:r.screenPad,cardGap:r.gap,edgePad:e.edgePadPx,highlight:t.highlight,highlightSoft:t.highlightSoft,highlightBd:t.highlightBd}})}exports.DEFAULT_SETTINGS=Re;exports.ThemeStudio=Tl;exports.buildMuiTheme=kl;exports.useThemeStore=L;
|
|
74
|
+
To suppress this warning, you need to explicitly provide the \`palette.${r}Channel\` as a string (in rgb format, for example "12 12 12") or undefined if you want to remove the channel token.`))}function rs(e){return typeof e=="number"?`${e}px`:typeof e=="string"||typeof e=="function"||Array.isArray(e)?e:"8px"}const Ee=e=>{try{return e()}catch{}},ns=(e="mui")=>va(e);function dr(e,r,t,o,i){if(!t)return;t=t===!0?{}:t;const s=i==="dark"?"dark":"light";if(!o){r[i]=Xa({...t,palette:{mode:s,...t==null?void 0:t.palette},colorSpace:e});return}const{palette:a,...l}=mr({...o,palette:{mode:s,...t==null?void 0:t.palette},colorSpace:e});return r[i]={...t,palette:a,opacity:{...zn(s),...t==null?void 0:t.opacity},overlays:(t==null?void 0:t.overlays)||_n(s)},l}function os(e={},...r){const{colorSchemes:t={light:!0},defaultColorScheme:o,disableCssColorScheme:i=!1,cssVarPrefix:s="mui",nativeColor:a=!1,shouldSkipGeneratingVar:l=Qa,colorSchemeSelector:c=t.light&&t.dark?"media":void 0,rootSelector:g=":root",...f}=e,x=Object.keys(t)[0],m=o||(t.light&&x!=="light"?"light":x),h=ns(s),{[m]:b,light:u,dark:y,...v}=t,E={...v};let H=b;if((m==="dark"&&!("dark"in t)||m==="light"&&!("light"in t))&&(H=!0),!H)throw new Error(process.env.NODE_ENV!=="production"?`MUI: The \`colorSchemes.${m}\` option is either missing or invalid.`:Ze(21,m));let S;a&&(S="oklch");const C=dr(S,E,H,f,m);u&&!E.light&&dr(S,E,u,void 0,"light"),y&&!E.dark&&dr(S,E,y,void 0,"dark");let B={defaultColorScheme:m,...C,cssVarPrefix:s,colorSchemeSelector:c,rootSelector:g,getCssVar:h,colorSchemes:E,font:{...Ia(C.typography),...C.font},spacing:rs(f.spacing)};Object.keys(B.colorSchemes).forEach(Y=>{const d=B.colorSchemes[Y].palette,I=W=>{const z=W.split("-"),q=z[1],U=z[2];return h(W,d[q][U])};d.mode==="light"&&(w(d.common,"background","#fff"),w(d.common,"onBackground","#000")),d.mode==="dark"&&(w(d.common,"background","#000"),w(d.common,"onBackground","#fff"));function P(W,z,q){if(S){let U;return W===Je&&(U=`transparent ${((1-q)*100).toFixed(0)}%`),W===ne&&(U=`#000 ${(q*100).toFixed(0)}%`),W===oe&&(U=`#fff ${(q*100).toFixed(0)}%`),`color-mix(in ${S}, ${z}, ${U})`}return W(z,q)}if(ts(d,["Alert","AppBar","Avatar","Button","Chip","FilledInput","LinearProgress","Skeleton","Slider","SnackbarContent","SpeedDialAction","StepConnector","StepContent","Switch","TableCell","Tooltip"]),d.mode==="light"){w(d.Alert,"errorColor",P(ne,a?h("palette-error-light"):d.error.light,.6)),w(d.Alert,"infoColor",P(ne,a?h("palette-info-light"):d.info.light,.6)),w(d.Alert,"successColor",P(ne,a?h("palette-success-light"):d.success.light,.6)),w(d.Alert,"warningColor",P(ne,a?h("palette-warning-light"):d.warning.light,.6)),w(d.Alert,"errorFilledBg",I("palette-error-main")),w(d.Alert,"infoFilledBg",I("palette-info-main")),w(d.Alert,"successFilledBg",I("palette-success-main")),w(d.Alert,"warningFilledBg",I("palette-warning-main")),w(d.Alert,"errorFilledColor",Ee(()=>d.getContrastText(d.error.main))),w(d.Alert,"infoFilledColor",Ee(()=>d.getContrastText(d.info.main))),w(d.Alert,"successFilledColor",Ee(()=>d.getContrastText(d.success.main))),w(d.Alert,"warningFilledColor",Ee(()=>d.getContrastText(d.warning.main))),w(d.Alert,"errorStandardBg",P(oe,a?h("palette-error-light"):d.error.light,.9)),w(d.Alert,"infoStandardBg",P(oe,a?h("palette-info-light"):d.info.light,.9)),w(d.Alert,"successStandardBg",P(oe,a?h("palette-success-light"):d.success.light,.9)),w(d.Alert,"warningStandardBg",P(oe,a?h("palette-warning-light"):d.warning.light,.9)),w(d.Alert,"errorIconColor",I("palette-error-main")),w(d.Alert,"infoIconColor",I("palette-info-main")),w(d.Alert,"successIconColor",I("palette-success-main")),w(d.Alert,"warningIconColor",I("palette-warning-main")),w(d.AppBar,"defaultBg",I("palette-grey-100")),w(d.Avatar,"defaultBg",I("palette-grey-400")),w(d.Button,"inheritContainedBg",I("palette-grey-300")),w(d.Button,"inheritContainedHoverBg",I("palette-grey-A100")),w(d.Chip,"defaultBorder",I("palette-grey-400")),w(d.Chip,"defaultAvatarColor",I("palette-grey-700")),w(d.Chip,"defaultIconColor",I("palette-grey-700")),w(d.FilledInput,"bg","rgba(0, 0, 0, 0.06)"),w(d.FilledInput,"hoverBg","rgba(0, 0, 0, 0.09)"),w(d.FilledInput,"disabledBg","rgba(0, 0, 0, 0.12)"),w(d.LinearProgress,"primaryBg",P(oe,a?h("palette-primary-main"):d.primary.main,.62)),w(d.LinearProgress,"secondaryBg",P(oe,a?h("palette-secondary-main"):d.secondary.main,.62)),w(d.LinearProgress,"errorBg",P(oe,a?h("palette-error-main"):d.error.main,.62)),w(d.LinearProgress,"infoBg",P(oe,a?h("palette-info-main"):d.info.main,.62)),w(d.LinearProgress,"successBg",P(oe,a?h("palette-success-main"):d.success.main,.62)),w(d.LinearProgress,"warningBg",P(oe,a?h("palette-warning-light"):d.warning.main,.62)),w(d.Skeleton,"bg",S?P(Je,a?h("palette-text-primary"):d.text.primary,.11):`rgba(${I("palette-text-primaryChannel")} / 0.11)`),w(d.Slider,"primaryTrack",P(oe,a?h("palette-primary-main"):d.primary.main,.62)),w(d.Slider,"secondaryTrack",P(oe,a?h("palette-secondary-main"):d.secondary.main,.62)),w(d.Slider,"errorTrack",P(oe,a?h("palette-error-main"):d.error.main,.62)),w(d.Slider,"infoTrack",P(oe,a?h("palette-info-main"):d.info.main,.62)),w(d.Slider,"successTrack",P(oe,a?h("palette-success-main"):d.success.main,.62)),w(d.Slider,"warningTrack",P(oe,a?h("palette-warning-main"):d.warning.main,.62));const W=S?P(ne,a?h("palette-background-default"):d.background.default,.6825):Rt(d.background.default,.8);w(d.SnackbarContent,"bg",W),w(d.SnackbarContent,"color",Ee(()=>S?xr.text.primary:d.getContrastText(W))),w(d.SpeedDialAction,"fabHoverBg",Rt(d.background.paper,.15)),w(d.StepConnector,"border",I("palette-grey-400")),w(d.StepContent,"border",I("palette-grey-400")),w(d.Switch,"defaultColor",I("palette-common-white")),w(d.Switch,"defaultDisabledColor",I("palette-grey-100")),w(d.Switch,"primaryDisabledColor",P(oe,a?h("palette-primary-main"):d.primary.main,.62)),w(d.Switch,"secondaryDisabledColor",P(oe,a?h("palette-secondary-main"):d.secondary.main,.62)),w(d.Switch,"errorDisabledColor",P(oe,a?h("palette-error-main"):d.error.main,.62)),w(d.Switch,"infoDisabledColor",P(oe,a?h("palette-info-main"):d.info.main,.62)),w(d.Switch,"successDisabledColor",P(oe,a?h("palette-success-main"):d.success.main,.62)),w(d.Switch,"warningDisabledColor",P(oe,a?h("palette-warning-main"):d.warning.main,.62)),w(d.TableCell,"border",P(oe,Je(a?h("palette-divider"):d.divider,1),.88)),w(d.Tooltip,"bg",P(Je,a?h("palette-grey-700"):d.grey[700],.92))}if(d.mode==="dark"){w(d.Alert,"errorColor",P(oe,a?h("palette-error-light"):d.error.light,.6)),w(d.Alert,"infoColor",P(oe,a?h("palette-info-light"):d.info.light,.6)),w(d.Alert,"successColor",P(oe,a?h("palette-success-light"):d.success.light,.6)),w(d.Alert,"warningColor",P(oe,a?h("palette-warning-light"):d.warning.light,.6)),w(d.Alert,"errorFilledBg",I("palette-error-dark")),w(d.Alert,"infoFilledBg",I("palette-info-dark")),w(d.Alert,"successFilledBg",I("palette-success-dark")),w(d.Alert,"warningFilledBg",I("palette-warning-dark")),w(d.Alert,"errorFilledColor",Ee(()=>d.getContrastText(d.error.dark))),w(d.Alert,"infoFilledColor",Ee(()=>d.getContrastText(d.info.dark))),w(d.Alert,"successFilledColor",Ee(()=>d.getContrastText(d.success.dark))),w(d.Alert,"warningFilledColor",Ee(()=>d.getContrastText(d.warning.dark))),w(d.Alert,"errorStandardBg",P(ne,a?h("palette-error-light"):d.error.light,.9)),w(d.Alert,"infoStandardBg",P(ne,a?h("palette-info-light"):d.info.light,.9)),w(d.Alert,"successStandardBg",P(ne,a?h("palette-success-light"):d.success.light,.9)),w(d.Alert,"warningStandardBg",P(ne,a?h("palette-warning-light"):d.warning.light,.9)),w(d.Alert,"errorIconColor",I("palette-error-main")),w(d.Alert,"infoIconColor",I("palette-info-main")),w(d.Alert,"successIconColor",I("palette-success-main")),w(d.Alert,"warningIconColor",I("palette-warning-main")),w(d.AppBar,"defaultBg",I("palette-grey-900")),w(d.AppBar,"darkBg",I("palette-background-paper")),w(d.AppBar,"darkColor",I("palette-text-primary")),w(d.Avatar,"defaultBg",I("palette-grey-600")),w(d.Button,"inheritContainedBg",I("palette-grey-800")),w(d.Button,"inheritContainedHoverBg",I("palette-grey-700")),w(d.Chip,"defaultBorder",I("palette-grey-700")),w(d.Chip,"defaultAvatarColor",I("palette-grey-300")),w(d.Chip,"defaultIconColor",I("palette-grey-300")),w(d.FilledInput,"bg","rgba(255, 255, 255, 0.09)"),w(d.FilledInput,"hoverBg","rgba(255, 255, 255, 0.13)"),w(d.FilledInput,"disabledBg","rgba(255, 255, 255, 0.12)"),w(d.LinearProgress,"primaryBg",P(ne,a?h("palette-primary-main"):d.primary.main,.5)),w(d.LinearProgress,"secondaryBg",P(ne,a?h("palette-secondary-main"):d.secondary.main,.5)),w(d.LinearProgress,"errorBg",P(ne,a?h("palette-error-main"):d.error.main,.5)),w(d.LinearProgress,"infoBg",P(ne,a?h("palette-info-main"):d.info.main,.5)),w(d.LinearProgress,"successBg",P(ne,a?h("palette-success-main"):d.success.main,.5)),w(d.LinearProgress,"warningBg",P(ne,a?h("palette-warning-main"):d.warning.main,.5)),w(d.Skeleton,"bg",S?P(Je,a?h("palette-text-primary"):d.text.primary,.13):`rgba(${I("palette-text-primaryChannel")} / 0.13)`),w(d.Slider,"primaryTrack",P(ne,a?h("palette-primary-main"):d.primary.main,.5)),w(d.Slider,"secondaryTrack",P(ne,a?h("palette-secondary-main"):d.secondary.main,.5)),w(d.Slider,"errorTrack",P(ne,a?h("palette-error-main"):d.error.main,.5)),w(d.Slider,"infoTrack",P(ne,a?h("palette-info-main"):d.info.main,.5)),w(d.Slider,"successTrack",P(ne,a?h("palette-success-main"):d.success.main,.5)),w(d.Slider,"warningTrack",P(ne,a?h("palette-warning-light"):d.warning.main,.5));const W=S?P(oe,a?h("palette-background-default"):d.background.default,.985):Rt(d.background.default,.98);w(d.SnackbarContent,"bg",W),w(d.SnackbarContent,"color",Ee(()=>S?Mn.text.primary:d.getContrastText(W))),w(d.SpeedDialAction,"fabHoverBg",Rt(d.background.paper,.15)),w(d.StepConnector,"border",I("palette-grey-600")),w(d.StepContent,"border",I("palette-grey-600")),w(d.Switch,"defaultColor",I("palette-grey-300")),w(d.Switch,"defaultDisabledColor",I("palette-grey-600")),w(d.Switch,"primaryDisabledColor",P(ne,a?h("palette-primary-main"):d.primary.main,.55)),w(d.Switch,"secondaryDisabledColor",P(ne,a?h("palette-secondary-main"):d.secondary.main,.55)),w(d.Switch,"errorDisabledColor",P(ne,a?h("palette-error-main"):d.error.main,.55)),w(d.Switch,"infoDisabledColor",P(ne,a?h("palette-info-main"):d.info.main,.55)),w(d.Switch,"successDisabledColor",P(ne,a?h("palette-success-main"):d.success.main,.55)),w(d.Switch,"warningDisabledColor",P(ne,a?h("palette-warning-light"):d.warning.main,.55)),w(d.TableCell,"border",P(ne,Je(a?h("palette-divider"):d.divider,1),.68)),w(d.Tooltip,"bg",P(Je,a?h("palette-grey-700"):d.grey[700],.92))}a||(Pe(d.background,"default"),Pe(d.background,"paper"),Pe(d.common,"background"),Pe(d.common,"onBackground"),Pe(d,"divider")),Object.keys(d).forEach(W=>{const z=d[W];W!=="tonalOffset"&&!a&&z&&typeof z=="object"&&(z.main&&w(d[W],"mainChannel",ht(gt(z.main))),z.light&&w(d[W],"lightChannel",ht(gt(z.light))),z.dark&&w(d[W],"darkChannel",ht(gt(z.dark))),z.contrastText&&w(d[W],"contrastTextChannel",ht(gt(z.contrastText))),W==="text"&&(Pe(d[W],"primary"),Pe(d[W],"secondary")),W==="action"&&(z.active&&Pe(d[W],"active"),z.selected&&Pe(d[W],"selected")))})}),B=r.reduce((Y,d)=>we(Y,d),B);const D={prefix:s,disableCssColorScheme:i,shouldSkipGeneratingVar:l,getSelector:es(B),enableContrastVars:a},{vars:$,generateThemeVars:X,generateStyleSheets:Q}=ja(B,D);return B.vars=$,Object.entries(B.colorSchemes[B.defaultColorScheme]).forEach(([Y,d])=>{B[Y]=d}),B.generateThemeVars=X,B.generateStyleSheets=Q,B.generateSpacing=function(){return Rn(f.spacing,Sr(this))},B.getColorSchemeSelector=wa(c),B.spacing=B.generateSpacing(),B.shouldSkipGeneratingVar=l,B.unstable_sxConfig={...Yt,...f==null?void 0:f.unstable_sxConfig},B.unstable_sx=function(d){return dt({sx:d,theme:this})},B.toRuntimeSource=Wn,B}function fn(e,r,t){e.colorSchemes&&t&&(e.colorSchemes[r]={...t!==!0&&t,palette:Tr({...t===!0?{}:t.palette,mode:r})})}function Ln(e={},...r){const{palette:t,cssVariables:o=!1,colorSchemes:i=t?void 0:{light:!0},defaultColorScheme:s=t==null?void 0:t.mode,...a}=e,l=s||"light",c=i==null?void 0:i[l],g={...i,...t?{[l]:{...typeof c!="boolean"&&c,palette:t}}:void 0};if(o===!1){if(!("colorSchemes"in e))return mr(e,...r);let f=t;"palette"in e||g[l]&&(g[l]!==!0?f=g[l].palette:l==="dark"&&(f={mode:"dark"}));const x=mr({...e,palette:f},...r);return x.defaultColorScheme=l,x.colorSchemes=g,x.palette.mode==="light"&&(x.colorSchemes.light={...g.light!==!0&&g.light,palette:x.palette},fn(x,"dark",g.dark)),x.palette.mode==="dark"&&(x.colorSchemes.dark={...g.dark!==!0&&g.dark,palette:x.palette},fn(x,"light",g.light)),x}return!t&&!("light"in g)&&l==="light"&&(g.light=!0),os({...a,colorSchemes:g,defaultColorScheme:l,...typeof o!="boolean"&&o},...r)}const is=Ln(),as="$$material";function ss(e){return e!=="ownerState"&&e!=="theme"&&e!=="sx"&&e!=="as"}const ls=e=>ss(e)&&e!=="classes",ds=sa({themeId:as,defaultTheme:is,rootShouldForwardProp:ls}),cs=ba;process.env.NODE_ENV!=="production"&&(ee.node,ee.object.isRequired);function ps(e){return ya(e)}function us(e){return jr("MuiSvgIcon",e)}ra("MuiSvgIcon",["root","colorPrimary","colorSecondary","colorAction","colorError","colorDisabled","fontSizeInherit","fontSizeSmall","fontSizeMedium","fontSizeLarge"]);const fs=e=>{const{color:r,fontSize:t,classes:o}=e,i={root:["root",r!=="inherit"&&`color${et(r)}`,`fontSize${et(t)}`]};return Yo(i,us,o)},hs=ds("svg",{name:"MuiSvgIcon",slot:"Root",overridesResolver:(e,r)=>{const{ownerState:t}=e;return[r.root,t.color!=="inherit"&&r[`color${et(t.color)}`],r[`fontSize${et(t.fontSize)}`]]}})(cs(({theme:e})=>{var r,t,o,i,s,a,l,c,g,f,x,m,h,b;return{userSelect:"none",width:"1em",height:"1em",display:"inline-block",flexShrink:0,transition:(i=(r=e.transitions)==null?void 0:r.create)==null?void 0:i.call(r,"fill",{duration:(o=(t=(e.vars??e).transitions)==null?void 0:t.duration)==null?void 0:o.shorter}),variants:[{props:u=>!u.hasSvgAsChild,style:{fill:"currentColor"}},{props:{fontSize:"inherit"},style:{fontSize:"inherit"}},{props:{fontSize:"small"},style:{fontSize:((a=(s=e.typography)==null?void 0:s.pxToRem)==null?void 0:a.call(s,20))||"1.25rem"}},{props:{fontSize:"medium"},style:{fontSize:((c=(l=e.typography)==null?void 0:l.pxToRem)==null?void 0:c.call(l,24))||"1.5rem"}},{props:{fontSize:"large"},style:{fontSize:((f=(g=e.typography)==null?void 0:g.pxToRem)==null?void 0:f.call(g,35))||"2.1875rem"}},...Object.entries((e.vars??e).palette).filter(([,u])=>u&&u.main).map(([u])=>{var y,v;return{props:{color:u},style:{color:(v=(y=(e.vars??e).palette)==null?void 0:y[u])==null?void 0:v.main}}}),{props:{color:"action"},style:{color:(m=(x=(e.vars??e).palette)==null?void 0:x.action)==null?void 0:m.active}},{props:{color:"disabled"},style:{color:(b=(h=(e.vars??e).palette)==null?void 0:h.action)==null?void 0:b.disabled}},{props:{color:"inherit"},style:{color:void 0}}]}})),Dt=_e.forwardRef(function(r,t){const o=ps({props:r,name:"MuiSvgIcon"}),{children:i,className:s,color:a="inherit",component:l="svg",fontSize:c="medium",htmlColor:g,inheritViewBox:f=!1,titleAccess:x,viewBox:m="0 0 24 24",...h}=o,b=_e.isValidElement(i)&&i.type==="svg",u={...o,color:a,component:l,fontSize:c,instanceFontSize:r.fontSize,inheritViewBox:f,viewBox:m,hasSvgAsChild:b},y={};f||(y.viewBox=m);const v=fs(u);return n.jsxs(hs,{as:l,className:wn(v.root,s),focusable:"false",color:g,"aria-hidden":x?void 0:!0,role:x?"img":void 0,ref:t,...y,...h,...b&&i.props,ownerState:u,children:[b?i.props.children:i,x?n.jsx("title",{children:x}):null]})});process.env.NODE_ENV!=="production"&&(Dt.propTypes={children:ee.node,classes:ee.object,className:ee.string,color:ee.oneOfType([ee.oneOf(["inherit","action","disabled","primary","secondary","error","info","success","warning"]),ee.string]),component:ee.elementType,fontSize:ee.oneOfType([ee.oneOf(["inherit","large","medium","small"]),ee.string]),htmlColor:ee.string,inheritViewBox:ee.bool,shapeRendering:ee.string,sx:ee.oneOfType([ee.arrayOf(ee.oneOfType([ee.func,ee.object,ee.bool])),ee.func,ee.object]),titleAccess:ee.string,viewBox:ee.string});Dt.muiName="SvgIcon";function vt(e,r){function t(o,i){return n.jsx(Dt,{"data-testid":process.env.NODE_ENV!=="production"?`${r}Icon`:void 0,ref:i,...o,children:e})}return process.env.NODE_ENV!=="production"&&(t.displayName=`${r}Icon`),t.muiName=Dt.muiName,_e.memo(_e.forwardRef(t))}const gs=vt(n.jsx("path",{d:"M3 18c0 .55.45 1 1 1h5v-2H4c-.55 0-1 .45-1 1M3 6c0 .55.45 1 1 1h9V5H4c-.55 0-1 .45-1 1m10 14v-1h7c.55 0 1-.45 1-1s-.45-1-1-1h-7v-1c0-.55-.45-1-1-1s-1 .45-1 1v4c0 .55.45 1 1 1s1-.45 1-1M7 10v1H4c-.55 0-1 .45-1 1s.45 1 1 1h3v1c0 .55.45 1 1 1s1-.45 1-1v-4c0-.55-.45-1-1-1s-1 .45-1 1m14 2c0-.55-.45-1-1-1h-9v2h9c.55 0 1-.45 1-1m-5-3c.55 0 1-.45 1-1V7h3c.55 0 1-.45 1-1s-.45-1-1-1h-3V4c0-.55-.45-1-1-1s-1 .45-1 1v4c0 .55.45 1 1 1"}),"TuneRounded"),xs=vt(n.jsx("path",{d:"M12 5V3.21c0-.45-.54-.67-.85-.35l-2.8 2.79c-.2.2-.2.51 0 .71l2.79 2.79c.32.31.86.09.86-.36V7c3.31 0 6 2.69 6 6 0 2.72-1.83 5.02-4.31 5.75-.42.12-.69.52-.69.95 0 .65.62 1.16 1.25.97C17.57 19.7 20 16.64 20 13c0-4.42-3.58-8-8-8m-6 8c0-1.34.44-2.58 1.19-3.59.3-.4.26-.95-.09-1.31-.42-.42-1.14-.38-1.5.1-1 1.34-1.6 3-1.6 4.8 0 3.64 2.43 6.7 5.75 7.67.63.19 1.25-.32 1.25-.97 0-.43-.27-.83-.69-.95C7.83 18.02 6 15.72 6 13"}),"RestartAltRounded"),ms=vt(n.jsx("path",{d:"M9.37 5.51c-.18.64-.27 1.31-.27 1.99 0 4.08 3.32 7.4 7.4 7.4.68 0 1.35-.09 1.99-.27C17.45 17.19 14.93 19 12 19c-3.86 0-7-3.14-7-7 0-2.93 1.81-5.45 4.37-6.49M12 3c-4.97 0-9 4.03-9 9s4.03 9 9 9 9-4.03 9-9c0-.46-.04-.92-.1-1.36-.98 1.37-2.58 2.26-4.4 2.26-2.98 0-5.4-2.42-5.4-5.4 0-1.81.89-3.42 2.26-4.4-.44-.06-.9-.1-1.36-.1"}),"DarkModeOutlined"),ys=vt(n.jsx("path",{d:"M12 9c1.65 0 3 1.35 3 3s-1.35 3-3 3-3-1.35-3-3 1.35-3 3-3m0-2c-2.76 0-5 2.24-5 5s2.24 5 5 5 5-2.24 5-5-2.24-5-5-5M2 13h2c.55 0 1-.45 1-1s-.45-1-1-1H2c-.55 0-1 .45-1 1s.45 1 1 1m18 0h2c.55 0 1-.45 1-1s-.45-1-1-1h-2c-.55 0-1 .45-1 1s.45 1 1 1M11 2v2c0 .55.45 1 1 1s1-.45 1-1V2c0-.55-.45-1-1-1s-1 .45-1 1m0 18v2c0 .55.45 1 1 1s1-.45 1-1v-2c0-.55-.45-1-1-1s-1 .45-1 1M5.99 4.58c-.39-.39-1.03-.39-1.41 0-.39.39-.39 1.03 0 1.41l1.06 1.06c.39.39 1.03.39 1.41 0s.39-1.03 0-1.41zm12.37 12.37c-.39-.39-1.03-.39-1.41 0-.39.39-.39 1.03 0 1.41l1.06 1.06c.39.39 1.03.39 1.41 0 .39-.39.39-1.03 0-1.41zm1.06-10.96c.39-.39.39-1.03 0-1.41-.39-.39-1.03-.39-1.41 0l-1.06 1.06c-.39.39-.39 1.03 0 1.41s1.03.39 1.41 0zM7.05 18.36c.39-.39.39-1.03 0-1.41-.39-.39-1.03-.39-1.41 0l-1.06 1.06c-.39.39-.39 1.03 0 1.41s1.03.39 1.41 0z"}),"LightModeOutlined"),hn=e=>{let r;const t=new Set,o=(g,f)=>{const x=typeof g=="function"?g(r):g;if(!Object.is(x,r)){const m=r;r=f??(typeof x!="object"||x===null)?x:Object.assign({},r,x),t.forEach(h=>h(r,m))}},i=()=>r,l={setState:o,getState:i,getInitialState:()=>c,subscribe:g=>(t.add(g),()=>t.delete(g))},c=r=e(o,i,l);return l},bs=(e=>e?hn(e):hn),vs=e=>e;function Ss(e,r=vs){const t=_.useSyncExternalStore(e.subscribe,_.useCallback(()=>r(e.getState()),[e,r]),_.useCallback(()=>r(e.getInitialState()),[e,r]));return _.useDebugValue(t),t}const gn=e=>{const r=bs(e),t=o=>Ss(r,o);return Object.assign(t,r),t},Nn=(e=>e?gn(e):gn);function Cs(e,r){let t;try{t=e()}catch{return}return{getItem:i=>{var s;const a=c=>c===null?null:JSON.parse(c,void 0),l=(s=t.getItem(i))!=null?s:null;return l instanceof Promise?l.then(a):a(l)},setItem:(i,s)=>t.setItem(i,JSON.stringify(s,void 0)),removeItem:i=>t.removeItem(i)}}const yr=e=>r=>{try{const t=e(r);return t instanceof Promise?t:{then(o){return yr(o)(t)},catch(o){return this}}}catch(t){return{then(o){return this},catch(o){return yr(o)(t)}}}},js=(e,r)=>(t,o,i)=>{let s={storage:Cs(()=>window.localStorage),partialize:y=>y,version:0,merge:(y,v)=>({...v,...y}),...r},a=!1,l=0;const c=new Set,g=new Set;let f=s.storage;if(!f)return e((...y)=>{console.warn(`[zustand persist middleware] Unable to update item '${s.name}', the given storage is currently unavailable.`),t(...y)},o,i);const x=()=>{const y=s.partialize({...o()});return f.setItem(s.name,{state:y,version:s.version})},m=i.setState;i.setState=(y,v)=>(m(y,v),x());const h=e((...y)=>(t(...y),x()),o,i);i.getInitialState=()=>h;let b;const u=()=>{var y,v;if(!f)return;const E=++l;a=!1,c.forEach(S=>{var C;return S((C=o())!=null?C:h)});const H=((v=s.onRehydrateStorage)==null?void 0:v.call(s,(y=o())!=null?y:h))||void 0;return yr(f.getItem.bind(f))(s.name).then(S=>{if(S)if(typeof S.version=="number"&&S.version!==s.version){if(s.migrate){const C=s.migrate(S.state,S.version);return C instanceof Promise?C.then(B=>[!0,B]):[!0,C]}console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return[!1,S.state];return[!1,void 0]}).then(S=>{var C;if(E!==l)return;const[B,D]=S;if(b=s.merge(D,(C=o())!=null?C:h),t(b,!0),B)return x()}).then(()=>{E===l&&(H==null||H(o(),void 0),b=o(),a=!0,g.forEach(S=>S(b)))}).catch(S=>{E===l&&(H==null||H(void 0,S))})};return i.persist={setOptions:y=>{s={...s,...y},y.storage&&(f=y.storage)},clearStorage:()=>{f==null||f.removeItem(s.name)},getOptions:()=>s,rehydrate:()=>u(),hasHydrated:()=>a,onHydrate:y=>(c.add(y),()=>{c.delete(y)}),onFinishHydration:y=>(g.add(y),()=>{g.delete(y)})},s.skipHydration||u(),b||h},ws=js,Re={appName:"Crystal Ball",appTagline:"Run your whole business in one place",logoMode:"icon",logoUrl:"",iconColor:"#1565c0",presetId:"corporate",mode:"light",primaryHex:"#1565c0",secondaryHex:"#00897b",highlightHex:"",errorHex:"#d32f2f",warningHex:"#ed6c02",infoHex:"#0288d1",successHex:"#2e7d32",cardBgHex:"",cardHdrHex:"",pageBgHex:"",notifCardHex:"",textPrimaryHex:"",textSecondaryHex:"",dividerHex:"",btnColorHex:"",btnTextHex:"",h1Color:"",h2Color:"",h3Color:"",h4Color:"",h5Color:"",h6Color:"",fontFamily:"Roboto",headingFont:"Figtree",customFonts:[],customHeadFonts:[],textSize:"df",baseFontPx:0,bodyLineHeight:0,bodyWeight:0,letterSpace:0,scaleRatio:"default",scaleRatioCustom:0,h1Size:0,h2Size:0,h3Size:0,h4Size:0,h5Size:0,h6Size:0,h1Weight:0,h2Weight:0,h3Weight:0,h4Weight:0,h5Weight:0,h6Weight:0,headingWeight:600,headingLH:0,radiusPreset:"rounded",radiusVal:9,density:"default",densityScale:0,cardShadowPx:-1,contrast:"medium",contrastMode:"auto",containerPadPx:0,edgePadPx:0,cardGapPx:0,cardStyle:"soft",cardHeader:"plain",surfaceTint:"snow",nestedStyle:"recessed",nestedDepth:-1,headerStrength:-1,tintIntensity:-1,btnCase:"upper",accentGradient:!1,statusBold:!1,mapGlass:"light",chartScheme:"brand",tableDensity:"default",tableColDensity:"default",tableDividers:!1,tableColDividers:!1,tableRowDivW:1,tableColDivW:1,tableStripe:!1,tableHeaderStyle:"tinted",tableCellAlignH:"left",tableCellAlignV:"middle",notifPosition:"bottom-right",notifStyle:"toast",notifAccent:"severity",notifBadge:!0,notifAutoDismiss:!1,autoDismissSec:0,toastW:0,navPattern:"sidebar",sidebarWidth:220,appBarH:0,loginLayout:"split",loginImage:"",loginShowTagline:!0,loginPanelColor:"",loginImgOpacity:0,loginCardW:0},$e=e=>JSON.stringify(e);function cr(e){const r={...Re};if(e&&typeof e=="object")for(const t of Object.keys(Re)){const o=e[t];o!==void 0&&typeof o==typeof Re[t]&&(r[t]=o)}return r}function Ts(e){if(!e||typeof e!="object")return!1;const r=Object.keys(Re);let t=0;for(const o of r){const i=e[o];i!==void 0&&typeof i==typeof Re[o]&&t++}return t/r.length>=.5}const L=Nn()(ws((e,r)=>({settings:{...Re},savedThemes:[],baseline:$e(Re),editingSavedId:null,lastImportedId:null,set:t=>e(o=>({settings:{...o.settings,...t,presetId:"custom"}})),applyPreset:(t,o)=>e(i=>{const s={...i.settings,...o,presetId:t};return{settings:s,baseline:$e(s),editingSavedId:null,lastImportedId:null}}),reset:()=>e(()=>({settings:{...Re},baseline:$e(Re),editingSavedId:null,lastImportedId:null})),captureBaseline:()=>e(t=>({baseline:$e(t.settings)})),restoreBaseline:()=>e(t=>{try{return{settings:JSON.parse(t.baseline)}}catch{return{}}}),isDirty:()=>$e(r().settings)!==r().baseline,saveTheme:t=>e(o=>{const i="cust"+Date.now(),s={...o.settings};return{savedThemes:[...o.savedThemes,{id:i,name:t,snap:s}],settings:{...o.settings,presetId:i},baseline:$e({...o.settings,presetId:i}),editingSavedId:i,lastImportedId:null}}),updateSaved:(t,o,i)=>e(s=>{const a={...i,presetId:t};return{savedThemes:s.savedThemes.map(l=>l.id===t?{...l,name:o,snap:i}:l),settings:a,baseline:$e(a),editingSavedId:t,lastImportedId:null}}),applySaved:t=>e(()=>{const o={...cr(t.snap),presetId:t.id};return{settings:o,baseline:$e(o),editingSavedId:t.id,lastImportedId:null}}),renameSaved:(t,o)=>e(i=>({savedThemes:i.savedThemes.map(s=>s.id===t?{...s,name:o}:s)})),deleteSaved:t=>e(o=>({savedThemes:o.savedThemes.filter(i=>i.id!==t),editingSavedId:o.editingSavedId===t?null:o.editingSavedId,lastImportedId:o.lastImportedId===t?null:o.lastImportedId})),importTheme:(t,o)=>{const i=cr(o),s={id:"imp"+Date.now(),name:t,snap:i};return e(a=>{const l={...i,presetId:s.id};return{savedThemes:[s,...a.savedThemes],settings:l,baseline:$e(l),editingSavedId:s.id,lastImportedId:s.id}}),s}}),{name:"omnieye-theme-studio",merge:(e,r)=>{const t=e??{};return{...r,...t,settings:cr(t.settings)}}}));function He(e){const r=e==="dark";return{studioBg:r?"#15181d":"#f5f7fa",studioBd:r?"#2a2f38":"#d8dee6",card:r?"#1e222a":"#ffffff",cardBd:r?"#2b313b":"#e6eaf0",inset:r?"#262b34":"#f7f9fb",insetBd:r?"#363d48":"#e9edf2",divider:r?"#262b34":"#f0f3f7",iconTile:r?"#2b313b":"#eef1f6",text:r?"rgba(255,255,255,0.92)":"#1c2127",label:r?"rgba(255,255,255,0.5)":"#9aa4b0",label2:r?"rgba(255,255,255,0.6)":"#7a8593",body:r?"rgba(255,255,255,0.78)":"#5a6573",muted:r?"rgba(255,255,255,0.42)":"#aeb6c0",chevron:r?"rgba(255,255,255,0.42)":"#b3bcc7"}}function br(e){if(!e||e.length<7)return[210,60,45];const r=parseInt(e.slice(1,3),16)/255,t=parseInt(e.slice(3,5),16)/255,o=parseInt(e.slice(5,7),16)/255,i=Math.max(r,t,o),s=Math.min(r,t,o),a=i-s;let l=0,c=0;const g=(i+s)/2;return a&&(c=a/(1-Math.abs(2*g-1)),i===r?l=(t-o)/a%6:i===t?l=(o-r)/a+2:l=(r-t)/a+4,l=Math.round(l*60),l<0&&(l+=360)),[l,Math.round(c*100),Math.round(g*100)]}function le(e,r,t){r/=100,t/=100;const o=i=>{const s=(i+e/30)%12,a=r*Math.min(t,1-t);return Math.round((t-a*Math.max(-1,Math.min(s-3,Math.min(9-s,1))))*255).toString(16).padStart(2,"0")};return"#"+o(0)+o(8)+o(4)}function Se(e){try{const[r,t]=br(e),o=Math.max(t,18);return{50:le(r,Math.max(Math.round(o*.3),10),96),100:le(r,Math.max(Math.round(o*.42),12),91),200:le(r,Math.max(Math.round(o*.55),16),82),300:le(r,Math.max(Math.round(o*.7),20),70),400:le(r,o,60),500:e,600:le(r,Math.min(o+4,100),44),700:le(r,Math.min(o+8,100),36),800:le(r,Math.max(Math.round(o*.92),16),26),900:le(r,Math.max(Math.round(o*.8),14),16)}}catch{return{50:"#eef",100:"#dde",200:"#bbd",300:"#99c",400:"#77b",500:e||"#1565c0",600:"#1257a8",700:"#0e4488",800:"#0a3266",900:"#062044"}}}function pr(e,r){try{const t=l=>{const c=[1,3,5].map(g=>{const f=parseInt(l.slice(g,g+2),16)/255;return f<=.04045?f/12.92:Math.pow((f+.055)/1.055,2.4)});return .2126*c[0]+.7152*c[1]+.0722*c[2]},o=t(e),i=t(r),s=Math.max(o,i),a=Math.min(o,i);return(s+.05)/(a+.05)}catch{return 1}}function ce(e,r){if(!e||e[0]!=="#"||e.length<7)return"rgba(20,30,48,"+r+")";const t=parseInt(e.slice(1,3),16),o=parseInt(e.slice(3,5),16),i=parseInt(e.slice(5,7),16);return"rgba("+t+","+o+","+i+","+r+")"}function kr(e){const r=Se(e.primaryHex),t=Se(e.secondaryHex),o=e.mode==="dark",i=o?r[300]:e.primaryHex,s=o?t[300]:e.secondaryHex,a={pMain:i,pDark:r[700],pLight:r[300],highlight:e.highlightHex||"#ffd400",highlightSoft:ce(e.highlightHex||"#ffd400",.15),highlightBd:ce(e.highlightHex||"#ffd400",.34),pContrast:e.contrastMode==="light"?"#ffffff":e.contrastMode==="dark"?"rgba(0,0,0,0.87)":pr(i,"#ffffff")>=2.9?"#ffffff":"rgba(0,0,0,0.87)",pContainer:o?ce(e.primaryHex,.26):r[50],onPContainer:o?r[100]:r[800],sMain:s,sContrast:pr(s,"#ffffff")>=2.9?"#ffffff":"rgba(0,0,0,0.87)",bgDefault:o?"#121212":"#f3f5f8",paper:o?"#1e1e1e":"#ffffff",paper2:o?"#262630":"#f6f8fb",frameGutterBg:o?"#0a0a0a":"#e3e7ec",footerBg:o?"#17171c":"#eceef2",textPrimary:o?"rgba(255,255,255,0.92)":"rgba(0,0,0,0.87)",textSecondary:o?"rgba(255,255,255,0.62)":"rgba(0,0,0,0.6)",textDisabled:o?"rgba(255,255,255,0.4)":"rgba(0,0,0,0.38)",divider:o?"rgba(255,255,255,0.12)":"rgba(0,0,0,0.12)",outline:o?"rgba(255,255,255,0.23)":"rgba(0,0,0,0.23)"},l=e.statusBold,c=l?e.errorHex:ce(e.errorHex,o?.22:.13),g=l?e.warningHex:ce(e.warningHex,o?.22:.14),f=l?e.infoHex:ce(e.infoHex,o?.22:.13),x=l?e.successHex:ce(e.successHex,o?.22:.13),m=l?"#ffffff":o?Se(e.errorHex)[300]:e.errorHex,h=l?"#ffffff":o?Se(e.warningHex)[300]:Se(e.warningHex)[700],b=l?"#ffffff":o?Se(e.infoHex)[300]:e.infoHex,u=l?"#ffffff":o?Se(e.successHex)[300]:Se(e.successHex)[700],y=br(e.primaryHex)[0],v={neutral:[220,6],warm:[32,26],cool:[210,30],brand:[y,42],slate:[214,16],snow:[0,0]},E=v[e.surfaceTint]||v.neutral,H=e.tintIntensity>=0?e.tintIntensity:100,S=[E[0],Math.round(E[1]*H/100)];o?(a.bgDefault=le(S[0],Math.round(S[1]*.7),7),a.paper=le(S[0],Math.round(S[1]*.7),13),a.paper2=le(S[0],Math.round(S[1]*.85),19)):e.surfaceTint==="snow"&&!(e.tintIntensity>0)?(a.bgDefault="#ffffff",a.paper="#ffffff",a.paper2="#ffffff"):(a.bgDefault=le(S[0],Math.round(S[1]*.9),e.surfaceTint==="brand"?92:e.surfaceTint==="cool"?94:96),a.paper=le(S[0],Math.round(S[1]*.4),99),a.paper2=le(S[0],Math.round(S[1]*.85),e.surfaceTint==="brand"?95:96.5)),e.pageBgHex&&(a.bgDefault=e.pageBgHex),e.cardBgHex&&(a.paper=e.cardBgHex);const C={soft:0,standard:1,medium:2,high:3},B=C[e.contrast]!==void 0?C[e.contrast]:1,D=o?[["rgba(255,255,255,0.82)","rgba(255,255,255,0.55)","rgba(255,255,255,0.09)","rgba(255,255,255,0.16)"],["rgba(255,255,255,0.92)","rgba(255,255,255,0.62)","rgba(255,255,255,0.12)","rgba(255,255,255,0.23)"],["rgba(255,255,255,0.96)","rgba(255,255,255,0.74)","rgba(255,255,255,0.18)","rgba(255,255,255,0.34)"],["#ffffff","rgba(255,255,255,0.87)","rgba(255,255,255,0.26)","rgba(255,255,255,0.46)"]]:[["rgba(0,0,0,0.72)","rgba(0,0,0,0.5)","rgba(0,0,0,0.08)","rgba(0,0,0,0.16)"],["rgba(0,0,0,0.87)","rgba(0,0,0,0.6)","rgba(0,0,0,0.12)","rgba(0,0,0,0.23)"],["rgba(0,0,0,0.92)","rgba(0,0,0,0.7)","rgba(0,0,0,0.18)","rgba(0,0,0,0.34)"],["#000000","rgba(0,0,0,0.8)","rgba(0,0,0,0.24)","rgba(0,0,0,0.46)"]];a.textPrimary=D[B][0],a.textSecondary=D[B][1],a.divider=D[B][2],a.outline=D[B][3],e.textPrimaryHex&&(a.textPrimary=e.textPrimaryHex),e.textSecondaryHex&&(a.textSecondary=e.textSecondaryHex),e.dividerHex&&(a.divider=e.dividerHex),e.nestedStyle==="lighter"?a.paper2=o?le(S[0],Math.round(S[1]*.9),22):le(S[0],Math.max(Math.round(S[1]*.3),4),100):e.nestedStyle==="bordered"?a.paper2=a.paper:a.paper2=o?le(S[0],Math.round(S[1]*.9),Math.max(3,5)):le(S[0],Math.min(Math.round(S[1]*1.1),60),Math.max(88,94-S[1]*.18));const $=e.btnColorHex||i,X=e.accentGradient?"linear-gradient(135deg,"+$+","+(e.btnColorHex?Se(e.btnColorHex)[700]:r[o?500:700])+")":$,Q=e.btnTextHex||(pr($,"#ffffff")>=2.9?"#ffffff":"rgba(0,0,0,0.87)"),Y=e.h1Color||null,d=e.h2Color||null,I=e.h3Color||null,P=e.h4Color||null,W=e.h5Color||null,z=e.h6Color||null,q=[{key:"sm",px:13},{key:"df",px:12},{key:"lg",px:18}],U=q.find(me=>me.key===e.textSize)||q[1],G=e.baseFontPx>0?e.baseFontPx:U.px,R=e.bodyLineHeight>0?e.bodyLineHeight:1.5,O=e.h1Size>0?e.h1Size:20,J=Math.round(O*1.1),V=O,N=Math.max(Math.round(O*.9),11),M=Math.max(Math.round(O*.8),11),j=Math.max(Math.round(O*.7),10),A=Math.max(Math.round(O*.6),10),k=Math.max(Math.round(O*.5),9),T=G,K=Math.round(G*.92),se=Math.round(G*.8),F=Math.round(G*.72),fe=e.headingWeight,Oe=e.headingLH>0?e.headingLH:1.2,De=e.bodyWeight>0?e.bodyWeight:400,Ve=Math.min(900,De+200),Ue={compact:.82,default:1,comfortable:1.16},Be=e.densityScale>0?e.densityScale/100:Ue[e.density]??1,Xt=Math.round(20*Be),Me=Math.round(14*Be),St=e.cardGapPx>0?e.cardGapPx:Math.round(16*Be),Ge=Math.round(11*Be*({compact:.66,default:1,comfortable:1.32}[e.tableDensity]??1)),Fe=e.containerPadPx>0?e.containerPadPx:Math.round(10*Be),Z=e.radiusVal,ct=Z+"px",pt=Math.max(Math.round(Z*.6),2)+"px",We={0:"none",1:"0px 2px 1px -1px rgba(0,0,0,0.2),0px 1px 1px 0px rgba(0,0,0,0.14),0px 1px 3px 0px rgba(0,0,0,0.12)",2:"0px 3px 3px -2px rgba(0,0,0,0.2),0px 3px 4px 0px rgba(0,0,0,0.14),0px 1px 8px 0px rgba(0,0,0,0.12)",4:"0px 2px 4px -1px rgba(0,0,0,0.2),0px 4px 5px 0px rgba(0,0,0,0.14),0px 1px 10px 0px rgba(0,0,0,0.12)",8:"0px 5px 5px -3px rgba(0,0,0,0.2),0px 8px 10px 1px rgba(0,0,0,0.14),0px 3px 14px 2px rgba(0,0,0,0.12)"},Rr="1px solid rgba(255,255,255,0.06)";let ut,Ye,Ct;e.cardStyle==="outlined"?(ut="none",Ye="1.5px solid "+a.outline,Ct="none"):e.cardStyle==="soft"?(ut=We[1],Ye=o?Rr:"none",Ct=We[1]):(ut=We[8],Ye=o?Rr:"none",Ct=We[4]),e.cardShadowPx>=0&&(ut="0 "+Math.round(e.cardShadowPx*.45)+"px "+e.cardShadowPx+"px rgba(16,24,40,"+(o?.55:.16)+")");let jt="transparent",Er="1px solid "+a.divider,Qt="none";e.cardHeader==="plain"?Er="none":e.cardHeader==="tinted"?jt=a.pContainer:e.cardHeader==="accent"&&(Qt="inset 3px 0 0 "+i),e.headerStrength>=0&&(e.cardHeader==="tinted"?jt=ce(e.primaryHex,(o?.14:.08)*(e.headerStrength/100)):e.cardHeader==="accent"&&(Qt="inset "+Math.round(e.headerStrength*.06)+"px 0 0 "+i)),e.cardHdrHex&&(jt=e.cardHdrHex);const Gn=o?"none":We[4],Yn=o?"1px solid "+a.divider:"none",Jn=e.nestedStyle==="bordered"?"1.5px solid "+a.outline:"1px solid "+a.divider,qn=e.nestedDepth>0?"inset 3px 0 0 "+ce(e.primaryHex,.55)+", 0 "+Math.round(e.nestedDepth*.4)+"px "+e.nestedDepth+"px rgba(16,24,40,"+(o?.42:.1)+")":"none",Kn=(e.appName||"").trim().split(/\s+/).slice(0,2).map(me=>me[0]||"").join("").toUpperCase()||"AP",Xn=!!(e.logoMode==="image"&&e.logoUrl),Qn=!!e.loginImage,Hr=me=>{const be=me||"Roboto";return be.includes(" ")&&!be.startsWith('"')&&!be.startsWith("'")?`"${be}"`:be},Zn=Hr(e.headingFont||e.fontFamily),eo=Hr(e.fontFamily),ye=br(e.primaryHex)[0],xe=(me,be)=>le((me%360+360)%360,62,o?60:46),Pr={brand:[i,s,xe(ye+42),xe(ye+205),xe(ye+120)],categorical:[xe(ye),xe(ye+72),xe(ye+144),xe(ye+216),xe(ye+288)],sequential:[le(ye,55,o?40:78),le(ye,60,o?50:64),i,le(ye,70,o?70:38),le(ye,78,o?82:26)],cbsafe:["#0072B2","#E69F00","#009E73","#CC79A7","#56B4E9"],warm:[xe(8),xe(28),xe(45),xe(350),xe(18)],cool:[xe(200),xe(220),xe(255),xe(180),xe(235)]},to=Pr[e.chartScheme]||Pr.brand,ro=[r[600],t[600],le((ye+42)%360,55,46),le((ye+205)%360,50,46)],no={error:{cb:c,cc:m},success:{cb:x,cc:u},info:{cb:f,cc:b},warning:{cb:g,cc:h}},Zt=e.mapGlass==="light",oo=Zt?"rgba(255,255,255,0.84)":"rgba(15,20,28,0.74)",io=Zt?"#1c2733":"#f3f6fa",ao=Zt?"rgba(0,0,0,0.12)":"rgba(255,255,255,0.18)",so="repeating-linear-gradient(45deg, rgba(255,255,255,0.04) 0px, rgba(255,255,255,0.04) 11px, rgba(255,255,255,0) 11px, rgba(255,255,255,0) 22px), radial-gradient(circle at 50% 38%, "+ce(i,.22)+", rgba(0,0,0,0) 60%), "+"#0f141c",lo="linear-gradient(135deg,"+i+","+r[700]+")",co="linear-gradient(180deg,"+ce(r[900],.12)+","+ce(r[900],.55)+")",po="linear-gradient(135deg,"+r[700]+","+r[900]+")",uo="linear-gradient(135deg,"+ce(r[900],.55)+","+ce(e.primaryHex,.45)+")",$r={"top-right":{top:"14px",right:"14px"},"top-center":{top:"14px",left:"50%",transform:"translateX(-50%)"},"bottom-right":{bottom:"14px",right:"14px"},"bottom-left":{bottom:"14px",left:"14px"}},fo=$r[e.notifPosition]||$r["top-right"],Ir=e.notifAccent==="primary"?{bar:i,icbg:a.pContainer,icc:a.onPContainer,dot:i}:e.notifAccent==="mono"?{bar:a.textSecondary,icbg:a.paper2,icc:a.textPrimary,dot:a.textSecondary}:{bar:e.warningHex,icbg:g,icc:h,dot:e.warningHex};let wt;e.notifStyle==="toast"?wt={boxShadow:We[8],border:typeof Ye=="string"&&Ye!=="none"?Ye:"none"}:e.notifStyle==="banner"?wt={boxShadow:We[2],borderLeft:"4px solid "+Ir.bar}:wt={boxShadow:"none",border:"1px solid "+a.divider};const ho=e.notifCardHex||(o?"#1e1e1e":"#ffffff"),go={compact:"7px",default:"11px",comfortable:"16px"},xo={compact:"6px",default:"12px",comfortable:"22px"},mo={top:"flex-start",middle:"center",bottom:"flex-end"},yo={left:"flex-start",center:"center",right:"flex-end"},bo={plain:"transparent",tinted:a.paper2,accent:a.highlightSoft},vo={rowPy:go[e.tableDensity]||"11px",cellPx:xo[e.tableColDensity]||"12px",rowBorder:e.tableDividers?(e.tableRowDivW||1)+"px solid "+a.divider:"none",colBorder:e.tableColDividers?(e.tableColDivW||1)+"px solid "+a.divider:"none",headBg:bo[e.tableHeaderStyle]||a.paper2,cellAI:mo[e.tableCellAlignV]||"center",cellJC:yo[e.tableCellAlignH]||"flex-start",stripeBg:o?"rgba(255,255,255,0.035)":"rgba(0,0,0,0.028)",statusMap:{Delivered:{sb:x,sc:u},Processing:{sb:a.pContainer,sc:o?a.pLight:a.pDark},Pending:{sb:g,sc:h},Shipped:{sb:f,sc:b}},filters:["All","Delivered","Processing","Pending"].map((me,be)=>({label:me,bg:be===0?a.highlightSoft:"transparent",c:be===0?a.textPrimary:a.textSecondary,brd:be===0?a.highlightBd:a.outline}))},So={sm:"Small",df:"Default",lg:"Large"},Co={compact:"Compact",default:"Default",comfortable:"Comfortable"},jo={outlined:"Outlined",soft:"Soft",floating:"Floating"},wo={sharp:"Sharp",rounded:"Rounded",round:"Round"},To=[{key:"sidebar",label:"Sidebar",desc:"Full drawer",ic:"▤"},{key:"rail",label:"Rail",desc:"Icons only",ic:"▥"},{key:"topbar",label:"Top Bar",desc:"Horizontal",ic:"▦"}],ko=e.fontFamily+" · "+(So[e.textSize]||"Default"),Bo=(wo[e.radiusPreset]||"Custom")+" · "+(Co[e.density]||"Default")+" · "+(jo[e.cardStyle]||"Soft"),Ro=[{label:"General",ic:"◉"},{label:"Appearance",ic:"◧"},{label:"Modules",ic:"◫"},{label:"Team",ic:"◍"},{label:"Security",ic:"▣"},{label:"Billing",ic:"◳"}].map((me,be)=>({...me,on:be===1,bg:be===1?a.highlightSoft:"transparent",c:be===1?a.textPrimary:a.textSecondary,bar:be===1?"3px solid "+a.highlight:"3px solid transparent"})),Eo=To.map(me=>({...me,active:e.navPattern===me.key,brd:e.navPattern===me.key?i:a.divider,bg:e.navPattern===me.key?a.pContainer:a.paper,color:e.navPattern===me.key?a.onPContainer:a.textPrimary})),Ho=e.sidebarWidth,Po=e.appBarH>0?e.appBarH:56,$o=e.appBarH>0?e.appBarH+"px":"Auto (56px)";return{pal:r,spal:t,isDark:o,pMain:i,sMain:s,t:a,errSoft:c,warnSoft:g,infoSoft:f,sucSoft:x,errTxt:m,warnTxt:h,infoTxt:b,sucTxt:u,sevMap:no,accentBg:X,btnText:Q,hc1:Y,hc2:d,hc3:I,hc4:P,hc5:W,hc6:z,base:G,bodyLH:R,h1base:O,tDisplay:J,tH1:V,tH2:N,tTitle:M,tH4:j,tH5:A,tH6:k,tBody:T,tBodySm:K,tCaption:se,tOverline:F,wH1:fe,wH2:fe,wH3:fe,wH4:fe,wH5:fe,wH6:fe,headLH:Oe,bodyWeightEff:De,bwEmph:Ve,pad:Xt,padSm:Me,gap:St,rowPy:Ge,screenPad:Fe,r:Z,rad:ct,radSm:pt,SH:We,cardShadow:ut,cardBorder:Ye,btnShadow:Ct,cardHdrBg:jt,cardHdrBorder:Er,cardHdrAccent:Qt,appbarShadow:Gn,appbarBorder:Yn,nestBorder:Jn,nestShadow:qn,iconInitials:Kn,hasLogo:Xn,hasLoginImage:Qn,headFam:Zn,bodyFam:eo,chartHue:ye,chartPalette:to,avatarColors:ro,overlaySurface:oo,onOverlay:io,overlayBorder:ao,mediaBg:so,loginBrandGrad:lo,loginScrimGrad:co,loginCenteredGrad:po,loginScrimGradC:uo,npos:fo,nacc:Ir,toastDeco:wt,toastBg:ho,btnCase:e.btnCase!=="none"?"uppercase":"none",table:vo,typeSummary:ko,shapeSummary:Bo,settingsCats:Ro,navSettingsChips:Eo,sidebarWidth:Ho,appBarHEff:Po,appBarHLabel:$o}}function ks({icon:e,title:r,info:t,open:o,dimmed:i,onToggle:s,onPreviewMenu:a,children:l}){const c=L(v=>v.settings),g=c.mode==="dark",f=c.primaryHex||"#1565c0",x=He(c.mode),m=Se(f),h=kr(c),b=o?g?ce(f,.22):ce(f,.1):"transparent",u=o?g?m[200]:m[700]:x.text,y=o?f:x.chevron;return n.jsxs(p.Box,{sx:{background:b,opacity:i?.3:1,transform:o?"translateY(-2px)":"none",transition:"opacity .22s ease, transform .22s ease",borderBottom:`1px solid ${x.divider}`,overflow:"hidden"},children:[n.jsxs(p.Box,{component:"button",onClick:s,sx:{width:"100%",display:"flex",alignItems:"center",gap:"9px",p:"7px 11px",background:"transparent",border:"none",textAlign:"left",cursor:"pointer",fontFamily:"inherit"},children:[n.jsx(p.Box,{sx:{width:32,height:32,borderRadius:"10px",background:x.iconTile,color:x.body,display:"grid",placeItems:"center",flexShrink:0,position:"relative"},children:e}),n.jsx(p.Box,{sx:{flex:1,minWidth:0},children:n.jsx(p.Box,{sx:{fontSize:`${h.tH5}px`,fontWeight:h.wH5,fontFamily:`${h.headFam},sans-serif`,lineHeight:1.25,color:u,letterSpacing:"-.2px",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:r})}),a&&n.jsx(p.Box,{component:"span",title:"Change preview screen",onClick:v=>{v.stopPropagation(),a()},sx:{width:16,height:16,mr:"6px",flexShrink:0,cursor:"pointer",display:"grid",placeItems:"center",color:x.chevron,transition:"filter .15s ease, transform .1s ease","&:hover":{filter:"brightness(1.15)",transform:"scale(1.12)"}},children:n.jsxs("svg",{width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[n.jsx("rect",{x:"2",y:"3",width:"20",height:"14",rx:"2"}),n.jsx("path",{d:"M8 21h8M12 17v4"})]})}),t&&n.jsx(p.Box,{component:"span",title:t,sx:{width:15,height:15,borderRadius:"50%",border:`1.2px solid ${x.chevron}`,color:x.chevron,fontSize:"9px",fontWeight:800,fontStyle:"italic",fontFamily:"Georgia, serif",display:"grid",placeItems:"center",mr:"7px",flexShrink:0,cursor:"help"},children:"i"}),n.jsx(p.Box,{sx:{width:20,height:20,borderRadius:"6px",display:"grid",placeItems:"center",fontSize:"9px",color:y,flexShrink:0,transition:"background .18s, border-color .18s"},children:n.jsx(p.Box,{component:"span",sx:{display:"block",lineHeight:1,transform:o?"rotate(180deg)":"none",transition:"transform .2s"},children:"▼"})})]}),n.jsx(p.Collapse,{in:o,unmountOnExit:!0,timeout:280,children:n.jsx(p.Box,{sx:{p:"2px 13px 12px",borderTop:`1px solid ${x.divider}`},children:l})})]})}function ve(){const e=L(r=>r.settings);return _.useMemo(()=>kr(e),[e])}function tt({tabs:e,active:r,onChange:t}){const o=L(m=>m.settings.mode),i=L(m=>m.settings.primaryHex)||"#1565c0",s=L(m=>m.settings.highlightHex)||"#ffd400",a=L(m=>m.settings.bodyWeight)||400,l=o==="dark",c=Math.min(900,a+200),g=ve(),f=l?"#e6edf3":"#1c2127",x=l?"#cdd4de":"#5a6573";return n.jsx(p.Box,{sx:{display:"flex",gap:"2px",mb:"2px",px:"2px",borderBottom:"1.5px solid rgba(120,130,145,0.5)"},children:e.map(m=>{const h=m.key===r,b=n.jsx(p.Button,{onClick:()=>t(m.key),disableRipple:!0,sx:{flex:1,minWidth:0,px:"2px",pt:"9px",pb:"8px",minHeight:44,borderRadius:"6px 6px 0 0",mb:"-1px",fontSize:`${g.tBodySm}px`,fontFamily:`${g.headFam},sans-serif`,fontWeight:h?c:a,letterSpacing:0,textTransform:"none",whiteSpace:"normal",lineHeight:1.15,textAlign:"center",color:h?f:x,opacity:h?1:.3,bgcolor:h?ce(s,l?.26:.18):"transparent",borderBottom:h?`3px solid ${i}`:"2px solid transparent",transition:"color .16s ease, background .16s ease, border-color .16s ease, opacity .16s ease","&:hover":h?{bgcolor:ce(s,l?.26:.18)}:{opacity:1,bgcolor:"rgba(150,160,175,0.35)",borderRadius:"8px",boxShadow:"0 6px 18px rgba(0,0,0,0.35)",transform:"translateY(-2px)"}},children:m.label},m.key);return m.info?n.jsx(p.Tooltip,{title:m.info,arrow:!0,slotProps:{popper:{style:{pointerEvents:"none"}}},children:b},m.key):b})})}const Mt=[{id:"corporate",name:"Corporate Blue",snap:{primaryHex:"#1565c0",secondaryHex:"#00897b",iconColor:"#1565c0"}},{id:"emerald",name:"Emerald",snap:{primaryHex:"#2e7d32",secondaryHex:"#00897b",iconColor:"#2e7d32"}},{id:"indigo",name:"Indigo Violet",snap:{primaryHex:"#3949ab",secondaryHex:"#7c4dff",iconColor:"#3949ab"}},{id:"slate",name:"Graphite",snap:{primaryHex:"#455a64",secondaryHex:"#78909c",iconColor:"#455a64"}},{id:"teal",name:"Ocean Teal",snap:{primaryHex:"#00838f",secondaryHex:"#0277bd",iconColor:"#00838f"}},{id:"amber",name:"Amber",snap:{primaryHex:"#e65100",secondaryHex:"#d84315",iconColor:"#e65100"}}];function Bs(){var N,M;const[e,r]=_.useState("presets"),t=L(j=>j.settings),o=t.mode==="dark",i=t.highlightHex||"#ffd400",s=ce(i,o?.3:.18),a=o?"#e6edf3":"#1c2127",l=o?"rgba(255,255,255,0.82)":"#2c333d",c=L(j=>j.savedThemes),g=L(j=>j.applyPreset),f=L(j=>j.applySaved),x=L(j=>j.saveTheme),m=L(j=>j.updateSaved),h=L(j=>j.renameSaved),b=L(j=>j.deleteSaved),u=L(j=>j.importTheme),y=L(j=>j.set),v=L(j=>j.isDirty),E=L(j=>j.editingSavedId),H=L(j=>j.lastImportedId),S=c.find(j=>j.id===E),C=(j,A)=>{const k=new Blob([JSON.stringify({name:j,snap:A},null,2)],{type:"application/json"}),T=URL.createObjectURL(k),K=document.createElement("a");K.href=T,K.download=`${j.replace(/[^a-z0-9]+/gi,"-").toLowerCase()}.theme.json`,K.click(),URL.revokeObjectURL(T)},[B,D]=_.useState("");_.useEffect(()=>{if(!B)return;const j=setTimeout(()=>D(""),5e3);return()=>clearTimeout(j)},[B]);const[$,X]=_.useState(null),Q=j=>{const A=c.map(K=>K.name.toLowerCase());let k=j,T=2;for(;A.includes(k.toLowerCase());)k=`${j} ${T++}`;return k},Y=j=>{var T;const A=(T=j.target.files)==null?void 0:T[0];if(!A)return;const k=new FileReader;k.onload=()=>{try{const K=JSON.parse(k.result),se=K.snap??K;if(!Ts(se)){D("Invalid theme file. The selected file is not a valid Theme Studio export.");return}const F=K.name||"Imported Theme";if(c.some(fe=>fe.name.toLowerCase()===F.toLowerCase())){X({name:F,snap:se});return}D(""),u(F,se)}catch{D("Invalid theme file. The selected file is not a valid Theme Studio export.")}},k.readAsText(A),j.target.value=""},[d,I]=_.useState(null),[P,W]=_.useState(!1),[z,q]=_.useState(""),[U,G]=_.useState(null),[R,O]=_.useState(null),J=(S==null?void 0:S.name)||((N=Mt.find(j=>j.id===t.presetId))==null?void 0:N.name)||((M=c.find(j=>j.id===t.presetId))==null?void 0:M.name)||"Custom Theme",V=(j,A)=>{const k=j.trim();return k?c.some(T=>T.name.toLowerCase()===k.toLowerCase()&&T.id!==A)?"Name already exists":"":"Name required"};return n.jsxs(n.Fragment,{children:[n.jsx(tt,{active:e,onChange:r,tabs:[{key:"presets",label:"Presets",info:"Ready-made colour themes."},{key:"saved",label:"My Themes",info:"Your saved custom themes."},{key:"mode",label:"Mode",info:"Light / Dark."}]}),n.jsxs(p.Box,{sx:{p:"12px 2px 2px"},children:[e==="presets"&&n.jsx(p.Box,{sx:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:"9px"},children:Mt.map(j=>{const A=t.presetId===j.id;return n.jsxs(p.Box,{onClick:()=>g(j.id,j.snap),title:`${j.name} — applies this colour palette`,sx:{display:"flex",alignItems:"center",gap:"9px",p:"9px 10px",borderRadius:"11px",cursor:"pointer",textAlign:"left",border:`1px solid ${A?i:o?"#363d48":"#e3e8ee"}`,bgcolor:A?s:o?"#262b34":"#ffffff",transition:"all .14s ease"},children:[n.jsxs(p.Box,{sx:{display:"flex",flexDirection:"column",gap:"2px",flexShrink:0},children:[n.jsx(p.Box,{sx:{width:20,height:11,borderRadius:"3px",bgcolor:j.snap.primaryHex}}),n.jsx(p.Box,{sx:{width:20,height:7,borderRadius:"2px",bgcolor:j.snap.secondaryHex}})]}),n.jsx(p.Box,{component:"span",sx:{fontSize:"11px",fontWeight:600,color:A?a:l,lineHeight:1.3},children:j.name})]},j.id)})}),e==="saved"&&n.jsxs(p.Box,{sx:{display:"flex",flexDirection:"column",gap:1},children:[c.length===0&&n.jsx(p.Typography,{variant:"caption",sx:{color:"text.secondary",py:2,textAlign:"center"},children:"No saved themes yet."}),n.jsx(p.Box,{sx:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:.9},children:c.map(j=>{const A=E===j.id;return n.jsxs(p.Box,{onClick:()=>f(j),title:"Apply this saved theme",sx:{display:"flex",flexDirection:"column",gap:.9,p:"9px 10px",borderRadius:"11px",cursor:"pointer",position:"relative",border:`1px solid ${A?i:o?"#363d48":"#e3e8ee"}`,bgcolor:A?s:o?"#262b34":"#ffffff",transition:"all .14s ease"},children:[A&&H===j.id&&n.jsx(p.Tooltip,{title:"recently upload",arrow:!0,children:n.jsx(p.Box,{component:"span",sx:{position:"absolute",top:-2,right:0,width:6,height:6,borderRadius:"50%",bgcolor:"error.main",flexShrink:0}})}),n.jsxs(p.Box,{sx:{display:"flex",alignItems:"center",gap:1},children:[n.jsxs(p.Box,{sx:{display:"flex",flexDirection:"column",gap:"2px",flexShrink:0},children:[n.jsx(p.Box,{sx:{width:20,height:11,borderRadius:"3px",bgcolor:j.snap.primaryHex}}),n.jsx(p.Box,{sx:{width:20,height:7,borderRadius:"2px",bgcolor:j.snap.secondaryHex}})]}),n.jsx(p.Box,{component:"span",sx:{flex:1,minWidth:0,fontSize:"11px",fontWeight:600,color:A?a:l,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"normal"},children:j.name}),n.jsx(p.Box,{sx:{display:"flex",alignItems:"center",justifyContent:"flex-end"},children:n.jsx(p.Box,{component:"span",onClick:k=>{k.stopPropagation(),I({el:k.currentTarget,id:j.id})},sx:{cursor:"pointer",color:"text.muted",px:.5},children:"⋮"})})]})]},j.id)})}),B&&n.jsxs(p.Box,{sx:{display:"flex",alignItems:"flex-start",gap:1,bgcolor:"rgba(211,47,47,0.08)",border:"1px solid rgba(211,47,47,0.35)",borderRadius:"10px",px:1.5,py:1.25,color:"#b3261e"},children:[n.jsx(p.Box,{component:"span",sx:{fontWeight:900,fontSize:15,lineHeight:1.4},children:"!"}),n.jsx(p.Box,{sx:{fontSize:12.5,lineHeight:1.4},children:B})]}),n.jsxs(p.Box,{sx:{display:"flex",gap:1,mt:1},children:[n.jsxs(p.Button,{size:"small",variant:"outlined",component:"label",sx:{flex:1,textTransform:"none"},children:["↑ Import",n.jsx("input",{hidden:!0,type:"file",accept:".json,application/json",onChange:Y})]}),n.jsx(p.Button,{size:"small",variant:"outlined",onClick:()=>C(J,t),sx:{flex:1,textTransform:"none"},children:"⤓ Download"}),n.jsx(p.Button,{size:"small",variant:"contained",disabled:!v(),onClick:()=>{q(S?S.name:""),W(!0)},sx:{flex:1,textTransform:"none"},children:"+ Save"})]})]}),e==="mode"&&n.jsx(p.Box,{sx:{display:"flex",gap:1},children:["light","dark"].map(j=>n.jsx(p.Button,{onClick:()=>y({mode:j}),variant:t.mode===j?"contained":"outlined",sx:{flex:1,textTransform:"capitalize"},children:j},j))})]}),n.jsxs(p.Menu,{open:!!d,anchorEl:d==null?void 0:d.el,onClose:()=>I(null),children:[n.jsx(p.MenuItem,{onClick:()=>{const j=c.find(A=>A.id===d.id);f(j),I(null)},children:"✏️ Edit"}),n.jsx(p.MenuItem,{onClick:()=>{const j=c.find(A=>A.id===d.id);G({id:j.id,name:j.name}),I(null)},children:"✎ Rename"}),n.jsx(p.MenuItem,{onClick:()=>{const j=c.find(A=>A.id===d.id);O({id:j.id,name:j.name}),I(null)},children:"🗑 Delete"}),n.jsx(p.MenuItem,{onClick:()=>{const j=c.find(A=>A.id===d.id);C(j.name,j.snap),I(null)},children:"⤓ Download"})]}),n.jsxs(p.Dialog,{open:P,onClose:()=>W(!1),children:[n.jsx(p.DialogTitle,{children:S?`Save changes to “${S.name}”`:"Save theme"}),n.jsx(p.DialogContent,{children:n.jsx(p.TextField,{autoFocus:!0,fullWidth:!0,size:"small",label:"Theme name",value:z,onChange:j=>q(j.target.value),error:!!V(z,S==null?void 0:S.id),helperText:V(z,S==null?void 0:S.id),sx:{mt:1}})}),n.jsxs(p.DialogActions,{children:[n.jsx(p.Button,{onClick:()=>W(!1),children:"Cancel"}),S&&n.jsx(p.Button,{variant:"contained",disabled:!!V(z,S.id),onClick:()=>{m(S.id,z.trim(),t),W(!1)},children:"Update"}),n.jsx(p.Button,{variant:S?"outlined":"contained",disabled:!!V(z),onClick:()=>{x(z.trim()),W(!1)},children:S?"Save as New":"Save"})]})]}),n.jsxs(p.Dialog,{open:!!U,onClose:()=>G(null),children:[n.jsx(p.DialogTitle,{children:"Rename theme"}),n.jsx(p.DialogContent,{children:n.jsx(p.TextField,{autoFocus:!0,fullWidth:!0,size:"small",label:"New name",value:(U==null?void 0:U.name)??"",onChange:j=>G(A=>A&&{...A,name:j.target.value}),error:!!(U&&V(U.name,U.id)),helperText:U?V(U.name,U.id):"",sx:{mt:1}})}),n.jsxs(p.DialogActions,{children:[n.jsx(p.Button,{onClick:()=>G(null),children:"Cancel"}),n.jsx(p.Button,{variant:"contained",disabled:!!(U&&V(U.name,U.id)),onClick:()=>{h(U.id,U.name.trim()),G(null)},children:"Rename"})]})]}),n.jsxs(p.Dialog,{open:!!$,onClose:()=>X(null),children:[n.jsx(p.DialogTitle,{children:"Theme already exists"}),n.jsx(p.DialogContent,{children:n.jsxs(p.Typography,{variant:"body2",children:["A theme named “",$==null?void 0:$.name,"” is already in My Themes. Upload it anyway as a copy?"]})}),n.jsxs(p.DialogActions,{children:[n.jsx(p.Button,{onClick:()=>{X(null),D("You’ve selected a duplicate file — it already exists.")},children:"Cancel"}),n.jsx(p.Button,{variant:"contained",onClick:()=>{u(Q($.name),$.snap),X(null)},children:"Yes, continue"})]})]}),n.jsxs(p.Dialog,{open:!!R,onClose:()=>O(null),children:[n.jsx(p.DialogTitle,{children:"Delete theme"}),n.jsx(p.DialogContent,{children:n.jsxs(p.Typography,{variant:"body2",children:["Delete “",R==null?void 0:R.name,"”? This cannot be undone."]})}),n.jsxs(p.DialogActions,{children:[n.jsx(p.Button,{onClick:()=>O(null),children:"Cancel"}),n.jsx(p.Button,{color:"error",variant:"contained",onClick:()=>{b(R.id),O(null)},children:"Delete"})]})]})]})}function Rs({tip:e,sk:r}){return n.jsx(p.Box,{component:"span",title:e,sx:{width:13,height:13,borderRadius:"50%",border:`1.1px solid ${r.chevron}`,color:r.chevron,fontSize:8,fontWeight:800,fontStyle:"italic",fontFamily:"Georgia, serif",display:"inline-grid",placeItems:"center",flexShrink:0,cursor:"help",verticalAlign:"middle"},children:"i"})}function qe({children:e,tip:r,sk:t,mt:o}){const i=ve();return n.jsxs(p.Box,{sx:{fontSize:`${i.tCaption}px`,fontWeight:i.bwEmph,fontFamily:`${i.bodyFam},sans-serif`,color:t.label2,textTransform:"uppercase",letterSpacing:".5px",mb:"6px",mt:o?`${o}px`:0,display:"flex",alignItems:"center",gap:"5px"},children:[e,r&&n.jsx(Rs,{tip:r,sk:t})]})}function st({value:e,onChange:r,w:t=30,h:o=24,r:i=7,border:s,sk:a}){return n.jsx(p.Box,{sx:{width:t,height:o,borderRadius:`${i}px`,position:"relative",overflow:"hidden",flexShrink:0,background:e,border:s?`1px solid ${a.insetBd}`:"none"},children:n.jsx(p.Box,{component:"input",type:"color",value:e,onChange:l=>r(l.target.value),sx:{position:"absolute",top:-4,left:-4,width:t+10,height:o+10,opacity:0,cursor:"pointer",border:"none",p:0}})})}const Es=/^#[0-9a-fA-F]{6}$/;function Hs({value:e,onCommit:r,onWarnChange:t}){const[o,i]=_.useState(!1),[s,a]=_.useState(e),[l,c]=_.useState(""),g=_.useRef(void 0);_.useEffect(()=>{o||a(e)},[e,o]),_.useEffect(()=>()=>clearTimeout(g.current),[]);const f=m=>{clearTimeout(g.current),c(m),t==null||t(m),m&&(g.current=setTimeout(()=>{c(""),t==null||t("")},3e3))},x=m=>{const h=m.trim();return Es.test(h)?(f(""),r(h),!0):(f("Enter a valid hex colour, e.g. #1565c0"),!1)};return o?n.jsx(p.InputBase,{autoFocus:!0,value:s,title:l||void 0,onChange:m=>{a(m.target.value)},onBlur:()=>{x(s)||a(e),i(!1)},onKeyDown:m=>{m.key==="Enter"&&x(s)&&i(!1),m.key==="Escape"&&(a(e),f(""),i(!1))},sx:{color:l?"#ffcdd2":"#fff",fontSize:"12.5px",fontWeight:700,width:100,position:"relative",zIndex:1}}):n.jsxs(p.Box,{component:"span",title:l||void 0,onClick:()=>{a(e),i(!0)},sx:{color:l?"#ffcdd2":"rgba(255,255,255,.85)",fontSize:"12.5px",fontWeight:700,cursor:"text",position:"relative",zIndex:1},children:[e," · tap to change"]})}function Ps(){const[e,r]=_.useState("brand"),[t,o]=_.useState(""),i=L(v=>v.settings),s=L(v=>v.set),a=He(i.mode),l=ve(),c={fontSize:"11.5px",color:a.body,fontWeight:600},g={fontSize:`${l.tBodySm}px`,color:a.body,fontWeight:l.bodyWeightEff,fontFamily:`${l.bodyFam},sans-serif`,lineHeight:l.bodyLH},f=i.primaryHex||"#1565c0",x=Se(f),m=[50,100,200,300,400,500,600,700,800,900].map(v=>x[v]),h=v=>s({...v,presetId:"custom"}),b=[{key:"h1Color",label:"H1 · Page Title"},{key:"h2Color",label:"H2 · Metric"},{key:"h3Color",label:"H3 · Card Title"},{key:"h4Color",label:"H4 · Section Label"},{key:"h5Color",label:"H5 · Caption"},{key:"h6Color",label:"H6 · Overline"}],u=[{key:"successHex",label:"Success"},{key:"warningHex",label:"Warning"},{key:"infoHex",label:"Info"},{key:"errorHex",label:"Error"}],y=[{key:"cardBgHex",label:"Card background",fb:"#ffffff"},{key:"cardHdrHex",label:"Card header",fb:"#f6f8fb"},{key:"pageBgHex",label:"Page background",fb:"#f4f6f9"},{key:"notifCardHex",label:"Notification background",fb:"#ffffff"}];return n.jsxs(p.Box,{sx:{display:"flex",flexDirection:"column",gap:"11px"},children:[n.jsx(tt,{active:e,onChange:r,tabs:[{key:"brand",label:"Brand",info:"Core brand colours — primary, secondary and the selection highlight colour used across the app."},{key:"text",label:"Text",info:"Heading and body text colours"},{key:"status",label:"Status",info:"Status colours & surface overrides"}]}),n.jsxs(p.Box,{sx:{p:"12px 2px 2px",display:"flex",flexDirection:"column",gap:"11px"},children:[e==="brand"&&n.jsxs(p.Box,{sx:{display:"flex",flexDirection:"column",gap:"11px"},children:[n.jsxs(p.Box,{children:[n.jsx(qe,{sk:a,tip:"Primary brand colour — main/filled buttons, active sidebar item, links, focus rings, first chart series, and the login Sign-in button.",children:"Brand Color"}),n.jsxs(p.Box,{sx:{position:"relative",height:46,borderRadius:"11px",background:f,overflow:"hidden",display:"flex",alignItems:"center",px:"14px",boxShadow:`0 3px 10px ${f}44`},children:[n.jsx(Hs,{value:f,onCommit:v=>h({primaryHex:v}),onWarnChange:o}),n.jsx(p.Box,{component:"input",type:"color",value:f,onChange:v=>h({primaryHex:v.target.value}),sx:{position:"absolute",inset:0,width:"100%",height:"100%",opacity:0,cursor:"pointer",border:"none",p:0}})]}),n.jsx(p.Box,{sx:{display:"flex",gap:"2px",borderRadius:"7px",overflow:"hidden",height:14,mt:"7px"},children:m.map((v,E)=>n.jsx(p.Box,{sx:{flex:1,background:v}},E))}),t&&n.jsxs(p.Box,{sx:{display:"inline-flex",alignItems:"center",gap:"6px",mt:"8px",px:"10px",py:"6px",borderRadius:"8px",bgcolor:l.warnSoft,border:`1px solid ${l.warnTxt}`,color:l.warnTxt,fontSize:12,fontWeight:600},children:[n.jsx(p.Box,{component:"span",sx:{fontSize:13,lineHeight:1},children:"⚠"}),t]})]}),n.jsxs(p.Box,{children:[n.jsx(qe,{sk:a,tip:"Secondary accent — secondary/outlined buttons, switches & toggles, selected chips, and the second data series in charts.",children:"Secondary / Accent"}),n.jsx(p.Box,{sx:{position:"relative",height:34,borderRadius:"9px",background:i.secondaryHex,overflow:"hidden"},children:n.jsx(p.Box,{component:"input",type:"color",value:i.secondaryHex,onChange:v=>h({secondaryHex:v.target.value}),sx:{position:"absolute",inset:0,width:"100%",height:"100%",opacity:0,cursor:"pointer",border:"none",p:0}})})]}),n.jsxs(p.Box,{children:[n.jsx(qe,{sk:a,tip:"Accent colour used to draw attention — highlight panels, featured badges, callouts. Defaults to the brand colour.",children:"Highlight Colour"}),n.jsx(p.Box,{sx:{position:"relative",height:34,borderRadius:"8px",background:i.highlightHex||"#ffd400",overflow:"hidden",border:`1px solid ${a.insetBd}`},children:n.jsx(p.Box,{component:"input",type:"color",value:i.highlightHex||"#ffd400",onChange:v=>h({highlightHex:v.target.value}),sx:{position:"absolute",inset:0,width:"100%",height:"100%",opacity:0,cursor:"pointer",border:"none",p:0}})})]})]}),e==="text"&&n.jsxs(p.Box,{sx:{display:"flex",flexDirection:"column",gap:"11px"},children:[n.jsx(qe,{sk:a,children:"Heading Text Colors"}),n.jsx(p.Box,{sx:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:"9px"},children:b.map(v=>n.jsxs(p.Box,{sx:{display:"flex",alignItems:"center",gap:"9px"},children:[n.jsx(st,{sk:a,border:!0,value:i[v.key]||"#1c2127",onChange:E=>s({[v.key]:E})}),n.jsx(p.Box,{component:"span",sx:g,children:v.label})]},v.key))}),n.jsx(qe,{sk:a,children:"Body Text Colors"}),n.jsxs(p.Box,{sx:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:"7px"},children:[n.jsxs(p.Box,{sx:{display:"flex",alignItems:"center",gap:"9px"},children:[n.jsx(st,{sk:a,border:!0,value:i.textPrimaryHex||"#1c2127",onChange:v=>s({textPrimaryHex:v})}),n.jsx(p.Box,{component:"span",sx:c,title:"Main body text colour.",children:"Primary Text"})]}),n.jsxs(p.Box,{sx:{display:"flex",alignItems:"center",gap:"9px"},children:[n.jsx(st,{sk:a,border:!0,value:i.textSecondaryHex||"#5a6573",onChange:v=>s({textSecondaryHex:v})}),n.jsx(p.Box,{component:"span",sx:c,title:"Muted text colour.",children:"Secondary Text"})]}),n.jsxs(p.Box,{sx:{display:"flex",alignItems:"center",gap:"9px"},children:[n.jsx(st,{sk:a,border:!0,value:i.dividerHex||"#e3e8ee",onChange:v=>s({dividerHex:v})}),n.jsx(p.Box,{component:"span",sx:c,title:"Divider / border colour.",children:"Divider"})]})]})]}),e==="status"&&n.jsxs(p.Box,{sx:{display:"flex",flexDirection:"column",gap:"7px"},children:[n.jsxs(p.Box,{children:[n.jsx(qe,{sk:a,tip:"Success, warning, error & info colours — used for alerts, status pills, toasts and validation states.",children:"Status Colors"}),n.jsx(p.Box,{sx:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:"7px"},children:u.map(v=>n.jsxs(p.Box,{sx:{display:"flex",alignItems:"center",gap:"8px",background:a.card,border:`1px solid ${a.insetBd}`,borderRadius:"9px",px:"9px",py:"7px"},children:[n.jsx(st,{sk:a,w:22,h:22,r:6,value:i[v.key],onChange:E=>s({[v.key]:E})}),n.jsx(p.Box,{component:"span",sx:c,children:v.label})]},v.key))})]}),n.jsxs(p.Box,{children:[n.jsx(qe,{sk:a,tip:"Override the auto-generated surface colours. Leave on Auto to follow the surface tint & mode.",children:"Surfaces"}),n.jsx(p.Box,{sx:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:"7px"},children:y.map(v=>{const E=!!i[v.key];return n.jsxs(p.Box,{sx:{display:"flex",alignItems:"center",gap:"8px",background:a.card,border:`1px solid ${a.insetBd}`,borderRadius:"9px",px:"9px",py:"5px"},children:[n.jsx(st,{sk:a,w:22,h:22,r:6,border:!0,value:i[v.key]||v.fb,onChange:H=>s({[v.key]:H})}),n.jsx(p.Box,{component:"span",sx:{...c,flex:1},children:v.label}),E&&n.jsx(p.Box,{component:"button",title:"Reset to Auto",onClick:()=>s({[v.key]:""}),sx:{background:"transparent",border:`1px solid ${a.insetBd}`,borderRadius:"6px",color:a.muted,fontSize:"10px",fontWeight:700,px:"7px",py:"3px",cursor:"pointer"},children:"Auto"})]},v.key)})})]})]})]})]})}function ge(e){const{label:r,info:t,value:o,effective:i,min:s,max:a,step:l=1,unit:c="",autoLabel:g,autoValue:f=0,softMin:x,softMax:m,floorValue:h,floorReset:b,floorMessage:u,extra:y,onChange:v}=e,E=He(L(q=>q.settings.mode)),H=ve(),S=`${H.bodyFam},sans-serif`,[C,B]=_.useState(!1),[D,$]=_.useState(String(i)),[X,Q]=_.useState(""),Y=_.useRef(void 0);_.useEffect(()=>{C||$(String(i))},[i,C]),_.useEffect(()=>()=>clearTimeout(Y.current),[]);const d=q=>{clearTimeout(Y.current),Q(q),q&&(Y.current=setTimeout(()=>Q(""),3e3))},I=q=>x!=null&&q<x?`Below ${x}${c} may break the UI`:m!=null&&q>m?`Above ${m}${c} may break the UI`:"",P=()=>{d(u??`Minimum is ${b}${c} — reset`),v(b),$(String(b))},W=q=>{const U=parseFloat(q);if(isNaN(U)){d("Enter a number"),$(String(i));return}if(h!=null&&b!=null&&U<=h){P();return}const G=Math.min(a,Math.max(s,U));d(G!==U?`Must be between ${s}${c} and ${a}${c} — clamped to ${G}${c}`:I(G)),$(String(G)),v(G)},z=o===f&&g?g:`${i}${c}`;return n.jsxs(p.Box,{sx:{mb:1.5},children:[n.jsxs(p.Box,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",mb:"8px"},children:[n.jsxs(p.Typography,{sx:{fontSize:`${H.tBodySm}px`,fontWeight:H.bwEmph,fontFamily:S,lineHeight:H.bodyLH,color:E.label2,display:"flex",alignItems:"center",gap:"5px"},children:[r,t&&n.jsx(p.Tooltip,{title:t,arrow:!0,slotProps:{popper:{style:{pointerEvents:"none"}}},children:n.jsx(p.Box,{component:"span",sx:{width:13,height:13,borderRadius:"50%",border:`1.1px solid ${E.chevron}`,color:E.chevron,fontSize:8,fontWeight:800,fontStyle:"italic",fontFamily:"Georgia, serif",display:"inline-grid",placeItems:"center",cursor:"help"},children:"i"})})]}),n.jsxs(p.Box,{sx:{display:"flex",alignItems:"center",gap:"5px",flexShrink:0},children:[C?n.jsx(p.InputBase,{autoFocus:!0,value:D,onChange:q=>$(q.target.value),onBlur:()=>{W(D),B(!1)},onKeyDown:q=>{q.key==="Enter"&&(W(D),B(!1)),q.key==="Escape"&&B(!1)},sx:{width:56,fontSize:`${H.tBodySm}px`,fontWeight:700,fontFamily:S,border:"1.5px solid",borderColor:"primary.main",borderRadius:"6px",px:"6px",py:"3px","& input":{p:0,textAlign:"center"}}}):n.jsxs(p.Box,{component:"button",onClick:()=>{$(String(i)),B(!0)},sx:{display:"inline-flex",alignItems:"center",gap:"5px",fontFamily:S,fontSize:`${H.tBodySm}px`,fontWeight:800,color:E.body,bgcolor:"rgba(130,140,155,0.14)",border:"1px solid rgba(130,140,155,0.28)",borderRadius:"6px",px:"7px",py:"2px",cursor:"pointer",lineHeight:1.3,"&:hover":{bgcolor:"rgba(130,140,155,0.24)"}},children:[z,n.jsxs("svg",{width:"11",height:"11",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.2",strokeLinecap:"round",strokeLinejoin:"round",style:{display:"block",flexShrink:0},children:[n.jsx("path",{d:"M12 20h9"}),n.jsx("path",{d:"M16.5 3.5a2.1 2.1 0 0 1 3 3L7 19l-4 1 1-4z"})]})]}),y]})]}),n.jsx(p.Box,{component:"input",type:"range",min:s,max:a,step:l,value:i,onChange:q=>{const U=parseFloat(q.target.value);if(h!=null&&b!=null&&U<=h){P();return}d(I(U)),v(U)},sx:{WebkitAppearance:"none",appearance:"none",width:"100%",height:"4px",m:0,p:0,display:"block",borderRadius:"2px",outline:"none",cursor:"pointer",background:"#dde3ea",accentColor:"primary.main","&::-webkit-slider-thumb":{WebkitAppearance:"none",width:18,height:18,borderRadius:"50%",background:"#fff",cursor:"pointer",boxShadow:"0 1px 4px rgba(0,0,0,.25),0 0 0 1px rgba(0,0,0,.05)"},"&::-moz-range-thumb":{width:18,height:18,border:"none",borderRadius:"50%",background:"#fff",cursor:"pointer",boxShadow:"0 1px 4px rgba(0,0,0,.25),0 0 0 1px rgba(0,0,0,.05)"}}}),X&&n.jsxs(p.Box,{sx:{display:"inline-flex",alignItems:"center",gap:"6px",mt:"8px",px:"10px",py:"6px",borderRadius:"8px",bgcolor:H.warnSoft,border:`1px solid ${H.warnTxt}`,color:H.warnTxt,fontSize:12,fontWeight:600},children:[n.jsx(p.Box,{component:"span",sx:{fontSize:13,lineHeight:1},children:"⚠"}),X]})]})}const xn=new Set;function Vn(e,r){if(xn.has(e))return;xn.add(e);const t=document.createElement("style");t.textContent=`@font-face{font-family:'${e}';src:url('${r}');font-display:swap;}`,document.head.appendChild(t)}function mn(e){e.forEach(r=>Vn(r.name,r.dataUrl))}const $s=[{key:"Roboto",label:"Roboto",sub:"Material"},{key:"Inter",label:"Inter",sub:"Enterprise"},{key:"DM Sans",label:"DM Sans",sub:"Modern"},{key:"Manrope",label:"Manrope",sub:"Geometric"},{key:"Plus Jakarta Sans",label:"Jakarta",sub:"Friendly"},{key:"Nunito Sans",label:"Nunito",sub:"Rounded"}],Is=[{key:"Figtree",label:"Google Sans"},{key:"Roboto",label:"Roboto"},{key:"Inter",label:"Inter"},{key:"Arial",label:"Arial"},{key:"Manrope",label:"Manrope"},{key:"Plus Jakarta Sans",label:"Jakarta"}];function Et({label:e,fam:r,active:t,onClick:o}){const i=L(f=>f.settings.mode),s=L(f=>f.settings.primaryHex)||"#1565c0",a=L(f=>f.settings.highlightHex)||"#ffd400",l=i==="dark",c=Se(s),g=ce(a,l?.3:.18);return n.jsx(p.Box,{onClick:o,sx:{py:"17px",px:"4px",borderRadius:"10px",textAlign:"center",cursor:"pointer",border:`1px solid ${t?l?c[400]:s:l?"#363d48":"#e3e8ee"}`,bgcolor:t?g:l?"#262b34":"#ffffff",transition:"all .14s ease","&:hover":t?{}:{borderColor:l?"#4a5361":"#c9d0d9"}},children:n.jsx(p.Box,{sx:{fontFamily:`${r}, sans-serif`,fontSize:13,fontWeight:700,lineHeight:1,color:t?l?c[200]:c[700]:l?"#aeb6c0":"#5a6573"},children:e})})}const As=["woff2","woff","ttf","otf"],Os=10*1024*1024,Ds=e=>new Promise((r,t)=>{const o=new FileReader;o.onload=()=>r(o.result),o.onerror=()=>t(o.error),o.readAsDataURL(e)}),Ms=e=>new Promise(r=>{const t=setTimeout(()=>r(!1),5e3),o=new FileReader;o.onload=()=>{var a;clearTimeout(t);const i=new Uint8Array(o.result),s=((a=e.name.split(".").pop())==null?void 0:a.toLowerCase())||"";if(s==="woff2"&&i[0]===119&&i[1]===79&&i[2]===70&&i[3]===50||s==="woff"&&i[0]===119&&i[1]===79&&i[2]===70&&i[3]===70||s==="otf"&&i[0]===79&&i[1]===84&&i[2]===84&&i[3]===79||s==="ttf"&&i[0]===0&&i[1]===1&&i[2]===0&&i[3]===0||s==="ttf"&&i[0]===79&&i[1]===84&&i[2]===84&&i[3]===79)return r(!0);r(!1)},o.onerror=()=>{clearTimeout(t),r(!1)};try{o.readAsArrayBuffer(e.slice(0,4))}catch{clearTimeout(t),r(!1)}});function yn({label:e,list:r,onAdd:t}){const o=He(L(f=>f.settings.mode)),i=ve(),[s,a]=_.useState(""),l=_.useRef(void 0);_.useEffect(()=>()=>clearTimeout(l.current),[]);const c=f=>{clearTimeout(l.current),a(f),f&&(l.current=setTimeout(()=>a(""),3e3))},g=async f=>{var E;const x=Array.from(f.target.files??[]);if(f.target.value="",!x.length)return;const m=[],h=[],b=[],u=[],y=[];for(const H of x){const S=((E=H.name.split(".").pop())==null?void 0:E.toLowerCase())||"";if(!As.includes(S)){b.push(H.name);continue}if(H.size>Os){u.push(H.name);continue}if(!await Ms(H)){y.push(H.name);continue}const C=H.name.replace(/\.[^.]+$/,""),B=$=>$.toLowerCase()===C.toLowerCase();if(r.some($=>B($.name))||m.some($=>B($.name))){h.push(C);continue}const D=await Ds(H);Vn(C,D),m.push({name:C,dataUrl:D})}m.length&&t(m);const v=[];h.length&&v.push(`Already added: ${h.join(", ")}`),b.length&&v.push(`Unsupported file type: ${b.join(", ")}`),u.length&&v.push(`Too large (max 10MB): ${u.join(", ")}`),y.length&&v.push(`Invalid font file: ${y.join(", ")}`),c(v.join(" · "))};return n.jsxs(p.Box,{sx:{mt:1.5},children:[n.jsxs(p.Box,{component:"label",sx:{display:"flex",alignItems:"center",justifyContent:"center",gap:.75,bgcolor:o.inset,border:`1.5px dashed ${o.insetBd}`,borderRadius:"9px",p:1.5,cursor:"pointer",color:o.body,fontSize:11.5,fontWeight:600,fontFamily:`${i.bodyFam},sans-serif`,textAlign:"center"},children:["⬆ ",e,n.jsx(p.Box,{component:"span",sx:{color:o.muted},children:".woff2 / .ttf / .otf"}),n.jsx("input",{type:"file",accept:".woff2,.woff,.ttf,.otf",multiple:!0,onChange:g,style:{display:"none"}})]}),s&&n.jsxs(p.Box,{sx:{mt:.9,display:"flex",alignItems:"center",gap:.9,bgcolor:"error.main",borderRadius:2,px:1.4,py:.9,color:"error.contrastText",fontFamily:`${i.bodyFam},sans-serif`},children:[n.jsx(p.Box,{component:"span",sx:{fontWeight:900,fontSize:12},children:"✕"}),n.jsx(p.Box,{component:"span",sx:{fontSize:11.5},children:s})]})]})}const Fs={compact:1.15,default:1.25,airy:1.414};function Ws(){const e=L(f=>f.settings),r=L(f=>f.set),t=He(e.mode),o=ve(),[i,s]=_.useState(!1),a=e.scaleRatioCustom>0?e.scaleRatioCustom:Fs[e.scaleRatio]??1.25,[l,c]=_.useState(a.toFixed(2));_.useEffect(()=>{i||c(a.toFixed(2))},[a,i]);const g=()=>{const f=parseFloat(l);isNaN(f)||r({scaleRatioCustom:f}),s(!1)};return i?n.jsx(p.InputBase,{autoFocus:!0,value:l,onChange:f=>c(f.target.value),onBlur:g,onKeyDown:f=>{f.key==="Enter"&&g(),f.key==="Escape"&&s(!1)},sx:{width:56,fontSize:"11.5px",fontWeight:700,fontFamily:`${o.bodyFam},sans-serif`,border:"1.5px solid",borderColor:"primary.main",borderRadius:"6px",px:"6px",py:"3px","& input":{p:0,textAlign:"center"}}}):n.jsx(p.Box,{component:"button",title:"Configure scale ratio — each heading is the one above ÷ this value",onClick:()=>{c(a.toFixed(2)),s(!0)},sx:{display:"inline-grid",placeItems:"center",color:t.body,bgcolor:"rgba(130,140,155,0.14)",border:"1px solid rgba(130,140,155,0.28)",borderRadius:"6px",px:"6px",py:"3px",cursor:"pointer",fontFamily:`${o.bodyFam},sans-serif`,"&:hover":{bgcolor:"rgba(130,140,155,0.24)"}},children:n.jsxs("svg",{width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",style:{display:"block"},children:[n.jsx("circle",{cx:"12",cy:"12",r:"3"}),n.jsx("path",{d:"M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 1 1-2.83 2.83l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-4 0v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 1 1-2.83-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1 0-4h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 1 1 2.83-2.83l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 4 0v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 1 1 2.83 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 0 4h-.09a1.65 1.65 0 0 0-1.51 1z"})]})})}function zs(){const[e,r]=_.useState("bodyFont"),t=L(i=>i.settings),o=L(i=>i.set);return n.jsxs(n.Fragment,{children:[n.jsx(tt,{active:e,onChange:r,tabs:[{key:"bodyFont",label:"Body Font",info:"Typeface used for body / paragraph text (headings use the Heading Font)"},{key:"headFont",label:"Heading Font",info:"Choose a separate typeface for headings (or match the body font)"},{key:"headText",label:"Heading Text",info:"Fine-tune size & weight per heading level (H1–H4)"},{key:"bodyText",label:"Body Text",info:"Adjust base font size and line height for body copy"}]}),n.jsxs(p.Box,{sx:{p:"12px 2px 2px"},children:[e==="bodyFont"&&n.jsxs(n.Fragment,{children:[n.jsxs(p.Box,{sx:{display:"grid",gridTemplateColumns:"repeat(3,1fr)",gap:"10px"},children:[$s.map(i=>n.jsx(Et,{label:i.label,sub:i.sub,fam:i.key,active:t.fontFamily===i.key,onClick:()=>o({fontFamily:i.key})},i.key)),t.customFonts.map(i=>n.jsx(Et,{label:i.name,sub:"Custom",fam:i.name,active:t.fontFamily===i.name,onClick:()=>o({fontFamily:i.name})},i.name))]}),n.jsx(yn,{label:"Upload custom font",list:t.customFonts,onAdd:i=>o({customFonts:[...i,...t.customFonts],fontFamily:i[0].name})})]}),e==="headFont"&&n.jsxs(n.Fragment,{children:[n.jsxs(p.Box,{sx:{display:"grid",gridTemplateColumns:"repeat(3,1fr)",gap:"10px"},children:[Is.map(i=>n.jsx(Et,{label:i.label,fam:i.key,active:t.headingFont===i.key,onClick:()=>o({headingFont:i.key})},i.key)),t.customHeadFonts.map(i=>n.jsx(Et,{label:i.name,sub:"Custom",fam:i.name,active:t.headingFont===i.name,onClick:()=>o({headingFont:i.name})},i.name))]}),n.jsx(yn,{label:"Upload heading font",list:t.customHeadFonts,onAdd:i=>o({customHeadFonts:[...i,...t.customHeadFonts],headingFont:i[0].name})})]}),e==="headText"&&n.jsxs(n.Fragment,{children:[n.jsx(ge,{label:"H1 size",info:"All heading levels scale from H1 by a modular ratio (configurable via the gear icon).",value:t.h1Size,effective:t.h1Size||20,min:18,max:56,unit:"px",extra:n.jsx(Ws,{}),onChange:i=>o({h1Size:i})}),n.jsx(ge,{label:"Weight (all headings)",value:t.headingWeight,effective:t.headingWeight,min:300,max:900,step:100,onChange:i=>o({headingWeight:i})}),n.jsx(ge,{label:"Line height (all headings)",value:t.headingLH,effective:t.headingLH||1.2,min:.9,max:2,step:.05,autoLabel:"Auto (1.20)",onChange:i=>o({headingLH:i})})]}),e==="bodyText"&&n.jsxs(n.Fragment,{children:[n.jsx(ge,{label:"Base font size",info:"Root body text size.",value:t.baseFontPx,effective:t.baseFontPx||12,min:9,max:20,unit:"px",softMin:9,onChange:i=>o({baseFontPx:i})}),n.jsx(ge,{label:"Body weight",value:t.bodyWeight,effective:t.bodyWeight||400,min:300,max:900,step:100,autoLabel:"Auto (400)",onChange:i=>o({bodyWeight:i})}),n.jsx(ge,{label:"Body line height",value:t.bodyLineHeight,effective:t.bodyLineHeight||1.5,min:1.2,max:2,step:.05,autoLabel:"Auto (1.50)",onChange:i=>o({bodyLineHeight:i})})]})]})]})}function je({options:e,value:r,columns:t=3,onChange:o}){const i=L(v=>v.settings.mode),s=L(v=>v.settings.primaryHex)||"#1565c0",a=L(v=>v.settings.highlightHex)||"#ffd400",l=i==="dark",c=Se(s),g=ve(),f=`${g.bodyFam},sans-serif`,x=ce(a,l?.3:.18),m=l?c[400]:s,h=l?c[200]:c[700],b=l?"#262b34":"#ffffff",u=l?"#363d48":"#e3e8ee",y=l?"#aeb6c0":"#5a6573";return n.jsx(p.Box,{sx:{display:"grid",gridTemplateColumns:`repeat(${t}, 1fr)`,gap:"6px"},children:e.map(v=>{const E=v.key===r,H=n.jsx(p.Box,{onClick:()=>o(v.key),sx:{py:"9px",px:"4px",borderRadius:"10px",textAlign:"center",cursor:"pointer",userSelect:"none",fontSize:`${g.tCaption}px`,fontWeight:E?g.bwEmph:g.bodyWeightEff,fontFamily:f,border:`1px solid ${E?m:u}`,bgcolor:E?x:b,color:E?h:y,transition:"color .14s ease, background .14s ease, border-color .14s ease","&:hover":E?{}:{borderColor:l?"#4a5361":"#c9d0d9"}},children:v.label},v.key);return v.info?n.jsx(p.Tooltip,{title:v.info,arrow:!0,slotProps:{popper:{style:{pointerEvents:"none"}}},children:H},v.key):H})})}const Ht={outlined:0,soft:6,floating:24},Pt={plain:0,tinted:40,accent:60},_s={bordered:0,recessed:6,lighter:4};function Ls(){const[e,r]=_.useState("style"),t=L(c=>c.settings),o=L(c=>c.set),i=t.cardShadowPx>=0?t.cardShadowPx:Ht[t.cardStyle]??24,s=t.headerStrength>=0?t.headerStrength:Pt[t.cardHeader]??45,a=t.nestedDepth>=0?t.nestedDepth:_s[t.nestedStyle]??6,l=t.tintIntensity>=0?t.tintIntensity:100;return n.jsxs(n.Fragment,{children:[n.jsx(tt,{active:e,onChange:r,tabs:[{key:"style",label:"Style",info:"Card border vs shadow depth."},{key:"header",label:"Header",info:"Card header treatment."},{key:"nested",label:"Nested",info:"How cards-within-cards look."},{key:"tint",label:"Tint",info:"Overall surface tint colour & strength."}]}),n.jsxs(p.Box,{sx:{p:"12px 2px 2px"},children:[e==="style"&&n.jsxs(n.Fragment,{children:[n.jsx(je,{value:t.cardStyle,onChange:c=>{const g=c;o({cardStyle:g,cardShadowPx:Ht[g]})},options:[{key:"outlined",label:"Outlined"},{key:"soft",label:"Soft"},{key:"floating",label:"Floating"}]}),n.jsx(p.Box,{sx:{mt:1.5},children:n.jsx(ge,{label:"Shadow depth",info:"Card elevation (px).",value:t.cardShadowPx,effective:i,min:0,max:32,unit:"px",autoValue:-1,autoLabel:`Auto (${i}px)`,softMin:t.cardStyle==="outlined"?void 0:1,softMax:32,floorValue:t.cardStyle==="outlined"?void 0:0,floorReset:Ht[t.cardStyle],floorMessage:`${t.cardStyle==="soft"?"Soft":"Floating"} cards need shadow - reset to ${Ht[t.cardStyle]}px`,onChange:c=>o({cardShadowPx:c})})})]}),e==="header"&&n.jsxs(n.Fragment,{children:[n.jsx(je,{value:t.cardHeader,onChange:c=>{const g=c;o({cardHeader:g,headerStrength:Pt[g]})},options:[{key:"plain",label:"Plain"},{key:"tinted",label:"Tinted"},{key:"accent",label:"Accent"}]}),n.jsx(p.Box,{sx:{mt:1.5},children:n.jsx(ge,{label:"Header strength",info:"Header tint / accent intensity.",value:t.headerStrength,effective:s,min:0,max:100,unit:"%",autoValue:-1,autoLabel:`Auto (${s}%)`,softMin:t.cardHeader==="plain"?void 0:1,floorValue:t.cardHeader==="plain"?void 0:0,floorReset:Pt[t.cardHeader],floorMessage:`${t.cardHeader==="tinted"?"Tinted":"Accent"} headers need strength - reset to ${Pt[t.cardHeader]}%`,onChange:c=>o({headerStrength:c})})})]}),e==="nested"&&n.jsxs(n.Fragment,{children:[n.jsx(je,{value:t.nestedStyle,onChange:c=>o({nestedStyle:c}),options:[{key:"recessed",label:"Recessed"},{key:"lighter",label:"Lighter"},{key:"bordered",label:"Bordered"}]}),n.jsx(p.Box,{sx:{mt:1.5},children:n.jsx(ge,{label:"Nested depth",info:"Inset depth of cards-within-cards.",value:t.nestedDepth,effective:a,min:0,max:24,unit:"px",autoValue:-1,autoLabel:`Auto (${a}px)`,onChange:c=>o({nestedDepth:c})})})]}),e==="tint"&&n.jsxs(n.Fragment,{children:[n.jsx(je,{value:t.surfaceTint,onChange:c=>o({surfaceTint:c}),options:[{key:"snow",label:"None"},{key:"neutral",label:"Low"},{key:"brand",label:"High"}]}),n.jsx(p.Box,{sx:{mt:1.5},children:n.jsx(ge,{label:"Tint intensity",info:"Strength of the page surface tint.",value:t.tintIntensity,effective:l,min:0,max:100,unit:"%",autoValue:-1,autoLabel:`Auto (${l}%)`,onChange:c=>o({tintIntensity:c})})})]})]})]})}function Ns(){const[e,r]=_.useState("rows"),t=L(i=>i.settings),o=L(i=>i.set);return n.jsxs(n.Fragment,{children:[n.jsx(tt,{active:e,onChange:r,tabs:[{key:"rows",label:"Rows",info:"Row density & dividers."},{key:"cols",label:"Columns",info:"Column density & dividers."},{key:"cells",label:"Cells",info:"Cell text & vertical alignment."},{key:"styling",label:"Styling",info:"Header background & row striping."}]}),n.jsxs(p.Box,{sx:{p:"12px 2px 2px"},children:[e==="rows"&&n.jsxs(n.Fragment,{children:[n.jsx(je,{value:t.tableDensity,onChange:i=>o({tableDensity:i}),options:[{key:"compact",label:"Compact"},{key:"default",label:"Default"},{key:"comfortable",label:"Comfortable"}]}),n.jsx(p.FormControlLabel,{sx:{mt:1},control:n.jsx(p.Switch,{checked:t.tableDividers,onChange:i=>o({tableDividers:i.target.checked})}),label:"Row dividers"}),t.tableDividers&&n.jsx(ge,{label:"Divider width",value:t.tableRowDivW,effective:t.tableRowDivW,min:1,max:4,unit:"px",onChange:i=>o({tableRowDivW:i})})]}),e==="cols"&&n.jsxs(n.Fragment,{children:[n.jsx(je,{value:t.tableColDensity,onChange:i=>o({tableColDensity:i}),options:[{key:"compact",label:"Compact"},{key:"default",label:"Default"},{key:"comfortable",label:"Comfortable"}]}),n.jsx(p.FormControlLabel,{sx:{mt:1},control:n.jsx(p.Switch,{checked:t.tableColDividers,onChange:i=>o({tableColDividers:i.target.checked})}),label:"Column dividers"}),t.tableColDividers&&n.jsx(ge,{label:"Divider width",value:t.tableColDivW,effective:t.tableColDivW,min:1,max:4,unit:"px",onChange:i=>o({tableColDivW:i})})]}),e==="cells"&&n.jsxs(n.Fragment,{children:[n.jsx(je,{value:t.tableCellAlignH,onChange:i=>o({tableCellAlignH:i}),options:[{key:"left",label:"Left"},{key:"center",label:"Center"},{key:"right",label:"Right"}]}),n.jsx(p.Box,{sx:{mt:1},children:n.jsx(je,{value:t.tableCellAlignV,onChange:i=>o({tableCellAlignV:i}),options:[{key:"top",label:"Top"},{key:"middle",label:"Middle"},{key:"bottom",label:"Bottom"}]})})]}),e==="styling"&&n.jsxs(n.Fragment,{children:[n.jsx(je,{value:t.tableHeaderStyle,onChange:i=>o({tableHeaderStyle:i}),options:[{key:"plain",label:"Plain"},{key:"tinted",label:"Tinted"},{key:"accent",label:"Accent"}]}),n.jsx(p.FormControlLabel,{sx:{mt:1},control:n.jsx(p.Switch,{checked:t.tableStripe,onChange:i=>o({tableStripe:i.target.checked})}),label:"Striped rows"})]})]})]})}const ur={compact:.82,default:1,comfortable:1.16};function Vs(){const[e,r]=_.useState("shape"),t=L(c=>c.settings),o=L(c=>c.set),i=He(t.mode),s=t.densityScale>0?t.densityScale:Math.round((ur[t.density]??1)*100),a=t.cardGapPx>0?t.cardGapPx:Math.round(16*(ur[t.density]??1)),l=t.containerPadPx>0?t.containerPadPx:Math.round(10*(ur[t.density]??1));return n.jsxs(n.Fragment,{children:[n.jsx(tt,{active:e,onChange:r,tabs:[{key:"shape",label:"Shape",info:"Corner radius & layout density."},{key:"effects",label:"Effects",info:"Spacing, button case & status chips."}]}),n.jsxs(p.Box,{sx:{p:"12px 2px 2px"},children:[e==="shape"&&n.jsxs(n.Fragment,{children:[n.jsx(p.Typography,{variant:"caption",sx:{fontWeight:700,color:i.label2,textTransform:"uppercase",letterSpacing:".6px",display:"block",mb:.75},children:"Corner Radius"}),n.jsx(je,{value:t.radiusPreset,onChange:c=>o({radiusPreset:c,radiusVal:c==="sharp"?0:c==="round"?18:9}),options:[{key:"sharp",label:"Sharp"},{key:"rounded",label:"Rounded"},{key:"round",label:"Round"}]}),n.jsx(p.Box,{sx:{mt:1.25},children:n.jsx(ge,{label:"Exact radius",value:t.radiusVal,effective:t.radiusVal,min:0,max:28,unit:"px",onChange:c=>o({radiusVal:c,radiusPreset:"rounded"})})}),n.jsx(p.Typography,{variant:"caption",sx:{fontWeight:700,color:i.label2,textTransform:"uppercase",letterSpacing:".6px",display:"block",mb:.75,mt:.5},children:"Density"}),n.jsx(je,{value:t.densityScale>0?"":t.density,onChange:c=>o({density:c,densityScale:0}),options:[{key:"compact",label:"Compact"},{key:"default",label:"Default"},{key:"comfortable",label:"Comfortable"}]}),n.jsx(p.Box,{sx:{mt:1.25},children:n.jsx(ge,{label:"Exact density",info:"Fine-tune spacing scale (%).",value:t.densityScale,effective:s,min:60,max:140,unit:"%",onChange:c=>o({densityScale:c})})})]}),e==="effects"&&n.jsxs(n.Fragment,{children:[n.jsx(ge,{label:"Card-to-card gap",value:t.cardGapPx,effective:a,min:0,max:40,step:2,unit:"px",autoLabel:`Auto (${a}px)`,onChange:c=>o({cardGapPx:c})}),n.jsx(ge,{label:"Container padding",value:t.containerPadPx,effective:l,min:0,max:40,step:2,unit:"px",autoLabel:`Auto (${l}px)`,onChange:c=>o({containerPadPx:c})}),n.jsx(ge,{label:"Edge gap",info:"Space between the preview frame and the outer app card.",value:t.edgePadPx,effective:t.edgePadPx,min:0,max:40,step:2,unit:"px",autoLabel:"0px (flush)",onChange:c=>o({edgePadPx:c})}),n.jsxs(p.Box,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",mt:1},children:[n.jsx(p.Typography,{variant:"caption",sx:{fontWeight:700,color:i.label2},children:"Uppercase button labels"}),n.jsx(p.Switch,{size:"small",checked:t.btnCase==="upper",onChange:c=>o({btnCase:c.target.checked?"upper":"none"})})]}),n.jsxs(p.Box,{sx:{mt:1.25},children:[n.jsx(p.Typography,{variant:"caption",sx:{fontWeight:700,color:i.label2,textTransform:"uppercase",letterSpacing:".6px",display:"block",mb:.75},children:"Status Chips"}),n.jsx(je,{columns:2,value:t.statusBold?"bold":"soft",onChange:c=>o({statusBold:c==="bold"}),options:[{key:"soft",label:"Soft"},{key:"bold",label:"Bold"}]})]})]})]})]})}function Us(){const[e,r]=_.useState("placement"),t=L(i=>i.settings),o=L(i=>i.set);return n.jsxs(n.Fragment,{children:[n.jsx(tt,{active:e,onChange:r,tabs:[{key:"placement",label:"Placement",info:"Where toasts appear."},{key:"behaviour",label:"Behaviour",info:"Width & auto-dismiss."}]}),n.jsxs(p.Box,{sx:{p:"12px 2px 2px"},children:[e==="placement"&&n.jsx(je,{columns:2,value:t.notifPosition,onChange:i=>o({notifPosition:i}),options:[{key:"top-center",label:"Top Center"},{key:"top-right",label:"Top Right"},{key:"bottom-left",label:"Bottom Left"},{key:"bottom-right",label:"Bottom Right"}]}),e==="behaviour"&&n.jsxs(n.Fragment,{children:[n.jsx(ge,{label:"Toast width",value:t.toastW,effective:t.toastW||252,min:200,max:500,unit:"px",softMax:500,onChange:i=>o({toastW:i})}),n.jsx(p.FormControlLabel,{sx:{mt:.5},control:n.jsx(p.Switch,{checked:t.notifBadge,onChange:i=>o({notifBadge:i.target.checked})}),label:"Show unread badge"}),n.jsx(p.FormControlLabel,{sx:{mt:.5,display:"flex"},control:n.jsx(p.Switch,{checked:t.notifAutoDismiss,onChange:i=>o({notifAutoDismiss:i.target.checked})}),label:"Auto-dismiss toasts"}),t.notifAutoDismiss&&n.jsx(ge,{label:"Dismiss after",value:t.autoDismissSec,effective:t.autoDismissSec||5,min:5,max:30,unit:"s",onChange:i=>o({autoDismissSec:i})})]})]})]})}function Gs({label:e,info:r,value:t,fallback:o,onChange:i,onReset:s}){const a=He(L(f=>f.settings.mode)),[l,c]=_.useState(null),g=t||o;return n.jsxs(p.Box,{sx:{display:"flex",alignItems:"center",gap:1,py:.5},children:[n.jsx(p.Box,{onClick:f=>c(f.currentTarget),sx:{width:22,height:22,borderRadius:1.5,border:`1px solid ${a.insetBd}`,bgcolor:g,cursor:"pointer",flexShrink:0}}),n.jsxs(p.Typography,{variant:"caption",sx:{flex:1,color:a.body,display:"flex",alignItems:"center",gap:.5},children:[e,r&&n.jsx(p.Tooltip,{title:r,arrow:!0,slotProps:{popper:{style:{pointerEvents:"none"}}},children:n.jsx(p.Box,{component:"span",sx:{width:13,height:13,borderRadius:"50%",border:`1.1px solid ${a.chevron}`,color:a.chevron,fontSize:8,fontWeight:800,fontStyle:"italic",fontFamily:"Georgia, serif",display:"inline-grid",placeItems:"center",cursor:"help"},children:"i"})})]}),t&&s&&n.jsx(p.Box,{component:"span",onClick:s,title:"Reset to theme default",sx:{fontSize:13,color:a.muted,cursor:"pointer"},children:"↺"}),n.jsx(p.Popover,{open:!!l,anchorEl:l,onClose:()=>c(null),anchorOrigin:{vertical:"bottom",horizontal:"right"},children:n.jsx(p.Box,{sx:{p:1},children:n.jsx("input",{type:"color",value:g,onChange:f=>i(f.target.value),style:{width:160,height:40,border:"none",background:"none"}})})})]})}function Ys({src:e,aspect:r,onCancel:t,onConfirm:o}){const[i,s]=_.useState(1),[a,l]=_.useState({x:0,y:0}),c=_.useRef(null),g=_.useRef(null),f=_.useRef(null),x=_.useRef(null);_.useEffect(()=>{const b=y=>{x.current&&l({x:x.current.ox+(y.clientX-x.current.sx),y:x.current.oy+(y.clientY-x.current.sy)})},u=()=>{x.current=null};return document.addEventListener("pointermove",b),document.addEventListener("pointerup",u),()=>{document.removeEventListener("pointermove",b),document.removeEventListener("pointerup",u)}},[]);const m=b=>{b.preventDefault(),x.current={sx:b.clientX,sy:b.clientY,ox:a.x,oy:a.y}},h=()=>{const b=c.current,u=g.current,y=f.current;if(!b||!u){o(e);return}const v=(y||b).getBoundingClientRect(),E=1e3,H=Math.round(E*r),S=H/v.width,C=document.createElement("canvas");C.width=H,C.height=E;const B=C.getContext("2d");if(!B){o(e);return}const D=u.getBoundingClientRect(),$=(D.left-v.left)*S,X=(D.top-v.top)*S,Q=D.width*S,Y=D.height*S;try{B.drawImage(u,$,X,Q,Y),o(C.toDataURL("image/png"))}catch{o(e)}};return Ao.createPortal(n.jsx(p.Box,{sx:{position:"fixed",inset:0,zIndex:1400,bgcolor:"rgba(15,23,42,.6)",display:"flex",alignItems:"center",justifyContent:"center",p:2.25,overflow:"auto"},children:n.jsxs(p.Box,{sx:{width:"100%",maxWidth:320,bgcolor:"background.paper",border:"1px solid",borderColor:"divider",borderRadius:3,boxShadow:"0 20px 50px rgba(15,23,42,.4)",p:2},children:[n.jsx(p.Typography,{sx:{fontSize:14,fontWeight:800,mb:.5},children:"Adjust brand image"}),n.jsx(p.Typography,{sx:{fontSize:11.5,color:"text.secondary",mb:1.5,lineHeight:1.45},children:"Drag and zoom to fit your image inside the bright frame. Anything in the dimmed area is cropped out."}),n.jsxs(p.Box,{ref:c,onPointerDown:m,sx:{position:"relative",width:"100%",aspectRatio:"1.55",borderRadius:2.5,overflow:"hidden",bgcolor:"#e9edf2",cursor:"grab",touchAction:"none",display:"grid",placeItems:"center","&:active":{cursor:"grabbing"}},children:[n.jsx("img",{ref:g,src:e,alt:"",draggable:!1,style:{position:"absolute",left:"50%",top:"50%",transform:`translate(-50%,-50%) translate(${a.x}px,${a.y}px) scale(${i})`,transformOrigin:"center",maxWidth:"100%",maxHeight:"100%",width:"auto",height:"auto",userSelect:"none",pointerEvents:"none"}}),n.jsx(p.Box,{ref:f,sx:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%,-50%)",height:"72%",aspectRatio:String(r),maxWidth:"90%",boxShadow:"0 0 0 9999px rgba(10,15,25,.62)",border:"2px solid #fff",borderRadius:"3px",pointerEvents:"none"}})]}),n.jsxs(p.Box,{sx:{display:"flex",alignItems:"center",gap:1,my:1.5},children:[n.jsx(p.Typography,{sx:{fontSize:12,fontWeight:700,color:"text.secondary"},children:"Zoom"}),n.jsx(p.Slider,{size:"small",min:.3,max:4,step:.02,value:i,onChange:(b,u)=>s(u)})]}),n.jsxs(p.Box,{sx:{display:"flex",gap:1},children:[n.jsx(p.Box,{component:"button",onClick:t,sx:{flex:1,p:1.25,borderRadius:2.5,border:"1px solid",borderColor:"divider",bgcolor:"action.hover",color:"text.secondary",fontSize:12.5,fontWeight:700,cursor:"pointer"},children:"Cancel"}),n.jsx(p.Box,{component:"button",onClick:h,sx:{flex:1,p:1.25,borderRadius:2.5,border:"none",bgcolor:"primary.main",color:"primary.contrastText",fontSize:12.5,fontWeight:700,cursor:"pointer"},children:"Confirm"})]})]})}),document.body)}function Js(){const e=L(f=>f.settings),r=L(f=>f.set),t=He(e.mode),[o,i]=_.useState(null),s=(f,x)=>{var b;const m=(b=f.target.files)==null?void 0:b[0];if(!m)return;const h=new FileReader;h.onload=()=>i({src:h.result,aspect:x==="logoUrl"?3.5:1.55,target:x}),h.readAsDataURL(m),f.target.value=""},a=f=>{o&&(o.target==="logoUrl"?r({logoUrl:f,logoMode:"image"}):r({loginImage:f}),i(null))},l={fontSize:11,fontWeight:700,textTransform:"uppercase",letterSpacing:".6px"},c={display:"flex",alignItems:"center",justifyContent:"center",gap:1,border:`1.5px dashed ${t.insetBd}`,borderRadius:2.5,p:1.75,cursor:"pointer",color:t.body,fontSize:12.5,fontWeight:600,bgcolor:t.inset},g=(f,x)=>n.jsxs(p.Box,{sx:{display:"flex",alignItems:"center",gap:1,mt:1,p:.9,bgcolor:t.inset,border:`1px solid ${t.insetBd}`,borderRadius:2},children:[n.jsx(p.Typography,{variant:"caption",sx:{flex:1,minWidth:0,color:t.body,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:f}),n.jsx(p.Box,{component:"button",onClick:x,title:"Remove",sx:{border:"none",background:"transparent",color:t.muted,cursor:"pointer",fontSize:14},children:"✕"})]});return n.jsxs(p.Box,{sx:{display:"flex",flexDirection:"column",gap:1.75},children:[n.jsxs(p.Box,{children:[n.jsx(p.Typography,{variant:"caption",sx:{...l,color:t.label2,display:"block",mb:1},children:"Brand Image"}),n.jsxs(p.Box,{component:"label",sx:c,children:["⬆ Choose image",n.jsx("input",{hidden:!0,type:"file",accept:"image/*",onChange:f=>s(f,"loginImage")})]}),e.loginImage&&g("Uploaded image",()=>r({loginImage:""}))]}),n.jsxs(p.Box,{children:[n.jsx(p.Typography,{variant:"caption",sx:{...l,color:t.label2,display:"block",mb:1},children:"Logo"}),n.jsxs(p.Box,{component:"label",sx:c,children:["⬆ Choose logo file",n.jsx("input",{hidden:!0,type:"file",accept:"image/png,image/svg+xml,image/webp",onChange:f=>s(f,"logoUrl")})]}),e.logoMode==="image"&&e.logoUrl&&g("Uploaded logo",()=>r({logoUrl:"",logoMode:"icon"}))]}),n.jsxs(p.Box,{children:[n.jsx(p.Typography,{variant:"caption",sx:{...l,color:t.label2,display:"block",mb:.5},children:"Panel Colour"}),n.jsx(Gs,{label:"Login panel background",value:e.loginPanelColor,fallback:e.primaryHex,onChange:f=>r({loginPanelColor:f}),onReset:()=>r({loginPanelColor:""})})]}),o&&n.jsx(Ys,{src:o.src,aspect:o.aspect,onCancel:()=>i(null),onConfirm:a})]})}const qs=[{key:"dashboard",label:"Dashboard"},{key:"orders",label:"Orders"},{key:"reports",label:"Reports"},{key:"cameras",label:"Cameras"},{key:"operations",label:"Operations"},{key:"components",label:"Components"},{key:"login",label:"Login"}],Ks=[{key:"dashboard",label:"Dashboard"},{key:"operations",label:"Operations"},{key:"cameras",label:"Cameras"},{key:"reports",label:"Reports"},{key:"orders",label:"Orders"},{key:"components",label:"Components"}],Ke=Nn(e=>({openSection:"",setOpenSection:r=>e({openSection:r}),previewScreen:"dashboard",setPreviewScreen:r=>e({previewScreen:r}),previewMenuOpen:!1,setPreviewMenuOpen:r=>e({previewMenuOpen:r}),studioOpen:!0,setStudioOpen:r=>e({studioOpen:r})}));function Xs({onClose:e}){var M,j,A,k;const r=Ke(T=>T.openSection),t=Ke(T=>T.setOpenSection),o=Ke(T=>T.setPreviewScreen),i=Ke(T=>T.previewScreen),s=Ke(T=>T.previewMenuOpen),a=Ke(T=>T.setPreviewMenuOpen),l=L(T=>T.settings),c=L(T=>T.savedThemes),g=L(T=>T.editingSavedId),f=L(T=>T.isDirty),x=L(T=>T.set),m=L(T=>T.reset),h=He(l.mode),b=_.useRef("theme"),[u,y]=_.useState(!1),v=(T,K)=>{const se=r!==T;t(se?T:""),a(!1),se&&b.current!==T&&(o(K),b.current=T)},E=((M=c.find(T=>T.id===g))==null?void 0:M.name)||((j=Mt.find(T=>T.id===l.presetId))==null?void 0:j.name)||((A=c.find(T=>T.id===l.presetId))==null?void 0:A.name)||"Custom Theme",H=f(),S=((k=Mt.find(T=>T.id===Re.presetId))==null?void 0:k.name)??"default",C={fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},B=({children:T})=>n.jsx("svg",{width:"18",height:"18",viewBox:"0 0 24 24",...C,children:T}),D=n.jsxs(B,{children:[n.jsx("circle",{cx:"13.5",cy:"6.5",r:"2.5"}),n.jsx("circle",{cx:"17.5",cy:"10.5",r:"2.5"}),n.jsx("circle",{cx:"8.5",cy:"7.5",r:"2.5"}),n.jsx("circle",{cx:"6.5",cy:"12.5",r:"2.5"}),n.jsx("path",{d:"M12 2a10 10 0 0 0 0 20 3 3 0 0 0 0-6 2 2 0 0 1 0-4 4 4 0 0 0 4-4 6 6 0 0 0-4-6z"})]}),$=n.jsxs(p.Box,{sx:{display:"flex",gap:"2px",width:14,height:14},children:[n.jsx(p.Box,{sx:{flex:1,background:l.secondaryHex,borderRadius:"2px"}}),n.jsx(p.Box,{sx:{flex:1,background:l.errorHex,borderRadius:"2px"}}),n.jsx(p.Box,{sx:{flex:1,background:l.successHex,borderRadius:"2px"}})]}),X=n.jsxs(B,{children:[n.jsx("path",{d:"M4 20 9 5l5 15M6 14h6"}),n.jsx("path",{d:"M15 20l3-9 3 9M16.2 17h3.6"})]}),Q=n.jsxs(B,{children:[n.jsx("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2"}),n.jsx("path",{d:"M3 9h18"})]}),Y=n.jsxs(B,{children:[n.jsx("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2"}),n.jsx("path",{d:"M3 9h18M3 15h18M9 3v18"})]}),d=n.jsx(B,{children:n.jsx("rect",{x:"4",y:"4",width:"16",height:"16",rx:"4"})}),I=n.jsxs(n.Fragment,{children:[n.jsxs(B,{children:[n.jsx("path",{d:"M6 8a6 6 0 0 1 12 0c0 7 3 9 3 9H3s3-2 3-9"}),n.jsx("path",{d:"M10 21a2 2 0 0 0 4 0"})]}),n.jsx(p.Box,{sx:{position:"absolute",top:"6px",right:"6px",width:7,height:7,borderRadius:"50%",background:l.primaryHex,border:`1.5px solid ${h.iconTile}`}})]}),P=n.jsxs(B,{children:[n.jsx("path",{d:"M15 3h4a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2h-4"}),n.jsx("path",{d:"M10 17l5-5-5-5"}),n.jsx("path",{d:"M15 12H3"})]}),W=l.mode==="dark",z=T=>T.charAt(0).toUpperCase()+T.slice(1),q={sm:"Small",df:"Default",lg:"Large"},U={sharp:"Sharp",rounded:"Rounded",round:"Round"},G={compact:"Compact",default:"Default",comfortable:"Comfortable"},R={flat:"Flat",outlined:"Outlined",soft:"Soft",raised:"Raised",elevated:"Elevated",floating:"Floating"},O={split:"Split Brand",centered:"Centered Card"},J={"top-center":"Top Center","top-right":"Top Right","bottom-left":"Bottom Left","bottom-right":"Bottom Right"},V={theme:`${E} · ${W?"Dark":"Light"}`,color:"Secondary & status colours",type:`${l.fontFamily} · ${q[l.textSize]??"Default"}`,cards:"Card style, header, nesting & surface tint",tables:"Table row density, dividers, striping & header style — previewed on the Orders screen",shape:`${U[l.radiusPreset]??"Custom"} · ${G[l.density]??"Default"} · ${R[l.cardStyle]??""}`,notif:`${J[l.notifPosition]??""} · ${z(l.notifStyle)}`,login:`${O[l.loginLayout]??""}${l.loginImage?" · image":""}`},N=[{id:"theme",title:"Theme Settings",info:"Presets, saved themes & light/dark mode.",icon:D,screen:"dashboard",body:n.jsx(Bs,{})},{id:"color",title:"Colour Settings",info:"Brand, text & status colours.",icon:$,screen:"components",body:n.jsx(Ps,{})},{id:"type",title:"Typography",info:"Fonts, sizes, weight & line-height.",icon:X,screen:"components",body:n.jsx(zs,{})},{id:"cards",title:"Cards",info:"Card style, header, nesting & tint.",icon:Q,screen:"dashboard",body:n.jsx(Ls,{})},{id:"tables",title:"Tables",info:"Row/column density, dividers & alignment.",icon:Y,screen:"orders",body:n.jsx(Ns,{})},{id:"shape",title:"Surface & Shape",info:"Radius, density, elevation & spacing.",icon:d,screen:"dashboard",body:n.jsx(Vs,{})},{id:"notif",title:"Notifications",info:"Toast placement & behaviour.",icon:I,screen:"operations",body:n.jsx(Us,{})},{id:"login",title:"Login Screen",info:"Brand image, logo & panel colour.",icon:P,screen:"login",body:n.jsx(Js,{})}];return n.jsxs(p.Box,{sx:{display:"flex",flexDirection:"column",bgcolor:h.card},children:[n.jsxs(p.Box,{sx:{display:"flex",alignItems:"center",gap:1,px:1.5,py:1.1,borderBottom:`1px solid ${h.divider}`,bgcolor:h.card},children:[n.jsxs(p.Box,{sx:{display:"flex",gap:.5,flexShrink:0},children:[n.jsx(p.Box,{sx:{width:13,height:13,borderRadius:"3px",bgcolor:l.primaryHex}}),n.jsx(p.Box,{sx:{width:13,height:13,borderRadius:"3px",bgcolor:l.secondaryHex}})]}),n.jsxs(p.Box,{sx:{flex:1,minWidth:0,display:"flex",alignItems:"center",gap:"6px"},children:[n.jsx(p.Typography,{variant:"caption",sx:{minWidth:0,fontWeight:800,color:h.text,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:E}),H&&n.jsx(p.Tooltip,{title:"Unsaved changes",arrow:!0,slotProps:{popper:{style:{pointerEvents:"none"}}},children:n.jsx(p.Box,{component:"span",sx:{width:6,height:6,borderRadius:"50%",bgcolor:"error.main",flexShrink:0}})})]}),n.jsx(p.Tooltip,{title:"Reset to defaults",arrow:!0,slotProps:{popper:{style:{pointerEvents:"none"}}},children:n.jsx(p.IconButton,{size:"small",onClick:()=>y(!0),sx:{bgcolor:"action.selected"},children:n.jsx(xs,{sx:{fontSize:16}})})}),n.jsx(p.Tooltip,{title:l.mode==="dark"?"Switch to light":"Switch to dark",arrow:!0,slotProps:{popper:{style:{pointerEvents:"none"}}},children:n.jsx(p.IconButton,{size:"small",onClick:()=>x({mode:l.mode==="dark"?"light":"dark"}),sx:{bgcolor:"action.selected"},children:l.mode==="dark"?n.jsx(ys,{sx:{fontSize:16}}):n.jsx(ms,{sx:{fontSize:16}})})})]}),s&&n.jsxs(p.Box,{sx:{borderBottom:"1px solid",borderColor:"divider",borderLeft:"3px solid #eab308",bgcolor:T=>T.palette.mode==="dark"?"rgba(234,179,8,0.14)":"#fef9c3",px:1.6,py:1.5},children:[n.jsx(p.Typography,{sx:{fontSize:10,fontWeight:800,textTransform:"uppercase",letterSpacing:".6px",color:T=>T.palette.mode==="dark"?"#f2cd5c":"#854d0e",mb:1},children:"Previewing Screen"}),n.jsx(p.Box,{sx:{display:"grid",gridTemplateColumns:"1fr 1fr 1fr",gap:.75},children:Ks.map(T=>{const K=i===T.key;return n.jsx(p.Box,{component:"button",onClick:()=>{i!==T.key&&o(T.key),a(!1)},sx:{px:.75,py:1,borderRadius:2,cursor:"pointer",fontSize:11,fontWeight:K?800:600,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",border:"1.5px solid",borderColor:K?"#d4a915":"#e6dca8",bgcolor:K?"#fde68a":"background.paper",color:K?"#713f12":"text.secondary"},children:T.label},T.key)})})]}),N.map(T=>n.jsx(ks,{icon:T.icon,title:T.title,info:V[T.id]??T.info,open:r===T.id,dimmed:r!==""&&r!==T.id,onToggle:()=>v(T.id,T.screen),onPreviewMenu:()=>a(!s),children:T.body},T.id)),n.jsxs(p.Dialog,{open:u,onClose:()=>y(!1),PaperProps:{sx:{borderRadius:3,width:320,p:2.5}},children:[n.jsx(p.Typography,{sx:{fontSize:15,fontWeight:800,mb:.75},children:"Reset everything?"}),n.jsxs(p.Typography,{sx:{fontSize:12.5,color:"text.secondary",lineHeight:1.5,mb:2.25},children:["This reverts every change you've made — theme preset, light/dark mode, brand colours, logo, typography, cards, surface & shape, notifications and login screen — back to the default ",S," preset. This can't be undone."]}),n.jsxs(p.Box,{sx:{display:"flex",flexDirection:"column",gap:1},children:[n.jsx(p.Box,{component:"button",onClick:()=>{m(),y(!1)},sx:{p:1.4,borderRadius:2.5,border:"none",bgcolor:"error.main",color:"error.contrastText",fontSize:13,fontWeight:700,cursor:"pointer"},children:"Reset to defaults"}),n.jsx(p.Box,{component:"button",onClick:()=>y(!1),sx:{p:1.1,borderRadius:2.5,border:"none",bgcolor:"transparent",color:"text.secondary",fontSize:12.5,fontWeight:600,cursor:"pointer"},children:"Cancel"})]})]})]})}const Qs=vt(n.jsx("path",{d:"M21 2H3c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h7v2H8v2h8v-2h-2v-2h7c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2m0 14H3V4h18z"}),"DesktopWindowsOutlined");function Br(e,r,t){const o=_.useRef(null),[i,s]=_.useState(e);return _.useLayoutEffect(()=>{const a=o.current;if(!a)return;const l=()=>{const x=a.children.length;if(!x)return;const m=parseFloat(getComputedStyle(a).rowGap)||0;let h=0;for(const y of Array.from(a.children))h+=y.offsetHeight;const b=h/x,u=a.clientHeight;u<=0||b<=0||s(Math.max(r,Math.min(t,Math.floor((u+m)/(b+m)))))};l();const c=requestAnimationFrame(l),g=setTimeout(l,300),f=new ResizeObserver(l);return f.observe(a),()=>{cancelAnimationFrame(c),clearTimeout(g),f.disconnect()}},[r,t]),[o,i]}function Un(e,r,t){const o=_.useRef(null),i=_.useRef(null),[s,a]=_.useState(e);return _.useLayoutEffect(()=>{const l=i.current;if(!l)return;const c=()=>{var u;const m=Array.from(l.children).filter(y=>getComputedStyle(y).position!=="absolute"),h=m.length?m[0].offsetHeight:((u=o.current)==null?void 0:u.offsetHeight)||36,b=l.clientHeight;b<=0||h<=0||a(Math.max(r,Math.min(t,Math.floor(b/h))))};c();const g=requestAnimationFrame(c),f=setTimeout(c,300),x=new ResizeObserver(c);return x.observe(l),()=>{cancelAnimationFrame(g),clearTimeout(f),x.disconnect()}},[r,t]),[o,i,s]}const Zs=["Jan","Feb","Mar","Apr","May","Jun"],el=[44,60,50,74,88,96],tl=[24,32,30,42,52,60];function rl(){const e=ve(),r=L(M=>M.settings),{t,rad:o,radSm:i,pad:s,padSm:a,gap:l,screenPad:c,tH1:g,tH2:f,tTitle:x,tH4:m,wH1:h,headFam:b,headLH:u,accentBg:y,btnText:v,tBodySm:E,bwEmph:H,btnCase:S,bodyWeightEff:C,bodyLH:B,tCaption:D,pMain:$,sMain:X}=e,Q=b+",sans-serif",Y=r.fontFamily+",sans-serif",d=e.hc1||t.textPrimary,I=e.hc2||t.textPrimary,P=e.hc3||t.textPrimary,W=[{label:"Revenue",val:"$2.41M",chg:"+12.5%",up:!0},{label:"Open Orders",val:"1,284",chg:"+3.2%",up:!0},{label:"Inventory",val:"8,540",chg:"-1.8%",up:!1},{label:"Active Users",val:"342",chg:"+5",up:!0}].map(M=>({...M,cc:M.up?e.sucTxt:e.errTxt,cb:M.up?e.sucSoft:e.errSoft,arrow:M.up?"▲":"▼"})),z=M=>M==="✓"?{cb:e.sucSoft,cc:e.sucTxt}:M==="!"?{cb:e.warnSoft,cc:e.warnTxt}:M==="+"?{cb:e.infoSoft,cc:e.infoTxt}:{cb:t.pContainer,cc:e.isDark?t.pLight:t.pDark},q=[{title:"Order ORD-1042 delivered to Acme Corp",time:"2m ago",ic:"✓"},{title:"Invoice #4821 paid — $12,400",time:"18m ago",ic:"$"},{title:"Low stock alert: Widget Pro (12 left)",time:"1h ago",ic:"!"},{title:"New customer onboarded: Globex Ltd",time:"3h ago",ic:"+"},{title:'Report "Q2 Summary" exported to PDF',time:"5h ago",ic:"▤"},{title:"Shipment SHP-2093 dispatched — Initech",time:"6h ago",ic:"✓"},{title:"Refund processed — $840 to Umbrella Co",time:"7h ago",ic:"$"},{title:"Payment overdue: Waystar Royco",time:"8h ago",ic:"!"},{title:"New support ticket — Stark Industries",time:"9h ago",ic:"+"},{title:"Backup completed — 12,480 records",time:"11h ago",ic:"✓"},{title:"Purchase order PO-771 approved",time:"13h ago",ic:"$"},{title:"Inventory reconciled — Warehouse 3",time:"15h ago",ic:"▤"},{title:"SLA breach warning — Hooli Inc",time:"17h ago",ic:"!"},{title:"New user invited — M. Fernandez",time:"19h ago",ic:"+"},{title:"Quarterly report scheduled",time:"21h ago",ic:"▤"},{title:"Order ORD-1039 delivered to Oscorp",time:"23h ago",ic:"✓"}].map(M=>({...M,...z(M.ic)})),[U,G]=Br(5,4,q.length),R=q.slice(0,G),O=e.cardBorder==="none"?"none":e.cardBorder,J={background:t.paper,border:O,borderRadius:o,boxShadow:e.cardShadow,overflow:"hidden"},V={padding:`${a}px ${s}px`,background:e.cardHdrBg,borderBottom:e.cardHdrBorder,boxShadow:e.cardHdrAccent,display:"flex",alignItems:"center",justifyContent:"space-between"},N={fontSize:x,lineHeight:u,fontWeight:h,color:P,fontFamily:Q};return n.jsxs("div",{style:{display:"flex",flexDirection:"column",background:t.paper,border:O,borderRadius:o,boxShadow:e.cardShadow,overflow:"hidden",fontFamily:Y,fontWeight:C,color:t.textPrimary},children:[n.jsxs("div",{style:{padding:s,background:e.cardHdrBg,borderBottom:e.cardHdrBorder,boxShadow:e.cardHdrAccent,display:"flex",alignItems:"center",justifyContent:"space-between",gap:14},children:[n.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[n.jsx("div",{style:{fontSize:g,lineHeight:u,fontWeight:h,color:d,letterSpacing:"-.3px",fontFamily:Q},children:"Dashboard"}),n.jsx("span",{title:"Good morning, Admin · Jun 21, 2026",style:{width:16,height:16,borderRadius:"50%",border:"1.2px solid "+t.textSecondary,color:t.textSecondary,fontSize:9.5,fontWeight:H,fontStyle:"italic",fontFamily:"Georgia,serif",display:"grid",placeItems:"center",flexShrink:0,cursor:"help"},children:"i"})]}),n.jsx("button",{style:{padding:"10px 20px",borderRadius:i,border:"none",background:y,color:v,fontSize:E,fontWeight:H,textTransform:S,letterSpacing:".4px",boxShadow:e.btnShadow,whiteSpace:"nowrap",cursor:"pointer"},children:"+ New"})]}),n.jsxs("div",{style:{padding:c,background:t.bgDefault,display:"flex",flexDirection:"column",flex:1,minHeight:0},children:[n.jsxs("div",{style:{...J,marginBottom:l},children:[n.jsxs("div",{style:V,children:[n.jsx("span",{style:{...N},children:"Performance Overview"}),n.jsx("span",{style:{fontSize:D,color:t.textSecondary,fontWeight:H},children:"This month"})]}),n.jsx("div",{style:{padding:s,display:"grid",gridTemplateColumns:"repeat(4,1fr)",gap:l},children:W.map(M=>n.jsxs("div",{style:{background:t.paper2,border:e.nestBorder,borderRadius:i,boxShadow:e.nestShadow,padding:a},children:[n.jsx("div",{style:{fontSize:m,color:t.textSecondary,fontWeight:h,fontFamily:Q,textTransform:"uppercase",letterSpacing:".6px",marginBottom:8},children:M.label}),n.jsx("div",{style:{fontSize:f,fontWeight:h,color:I,letterSpacing:"-.8px",lineHeight:1,marginBottom:6},children:M.val}),n.jsxs("span",{style:{fontSize:D,fontWeight:H,color:M.cc,background:M.cb,padding:"3px 9px",borderRadius:999},children:[M.arrow," ",M.chg]})]},M.label))})]}),n.jsxs("div",{style:{display:"grid",gridTemplateColumns:"1fr 300px",gap:l,flex:1,minHeight:0},children:[n.jsxs("div",{style:{...J,display:"flex",flexDirection:"column",minHeight:0},children:[n.jsxs("div",{style:V,children:[n.jsx("span",{style:N,children:"Revenue Trend"}),n.jsx("div",{style:{display:"flex",gap:12},children:[["Revenue",$],["Profit",X]].map(([M,j])=>n.jsxs("div",{style:{display:"flex",alignItems:"center",gap:5},children:[n.jsx("div",{style:{width:10,height:10,borderRadius:2,background:j}}),n.jsx("span",{style:{fontSize:D,color:t.textSecondary},children:M})]},M))})]}),n.jsx("div",{style:{padding:`${a}px ${s}px`,display:"flex",alignItems:"flex-end",gap:12,flex:1,minHeight:200},children:Zs.map((M,j)=>n.jsxs("div",{style:{flex:1,display:"flex",flexDirection:"column",alignItems:"center",gap:6,height:"100%"},children:[n.jsxs("div",{style:{width:"100%",display:"flex",flexDirection:"column",justifyContent:"flex-end",gap:3,flex:1},children:[n.jsx("div",{style:{width:"100%",height:tl[j]+"%",background:X,opacity:.55,borderRadius:`${i} ${i} 0 0`}}),n.jsx("div",{style:{width:"100%",height:el[j]+"%",background:$,borderRadius:`${i} ${i} 0 0`}})]}),n.jsx("span",{style:{fontSize:D,color:t.textSecondary},children:M})]},M))})]}),n.jsxs("div",{style:{...J,display:"flex",flexDirection:"column",minHeight:0},children:[n.jsx("div",{style:{padding:`${a}px ${s}px`,background:e.cardHdrBg,borderBottom:e.cardHdrBorder,boxShadow:e.cardHdrAccent},children:n.jsx("span",{style:N,children:"Recent Activity"})}),n.jsx("div",{ref:U,style:{padding:a,display:"flex",flexDirection:"column",justifyContent:"space-between",gap:4,flex:1,minHeight:0},children:R.map((M,j)=>n.jsxs("div",{style:{display:"flex",gap:11,alignItems:"flex-start",padding:8,borderRadius:i},children:[n.jsx("div",{style:{width:28,height:28,borderRadius:i,background:M.cb,color:M.cc,display:"grid",placeItems:"center",flexShrink:0,fontSize:13,fontWeight:H},children:M.ic}),n.jsxs("div",{style:{flex:1,minWidth:0},children:[n.jsx("div",{style:{fontSize:E,color:t.textPrimary,fontFamily:Y,fontWeight:C,lineHeight:B,marginBottom:2},children:M.title}),n.jsx("div",{style:{fontSize:D,color:t.textSecondary,fontFamily:Y},children:M.time})]})]},j))})]})]})]})]})}const nl=[{id:"ORD-1042",cust:"Acme Corporation",status:"Delivered",amt:"$12,400",date:"Jun 18"},{id:"ORD-1041",cust:"Globex Ltd",status:"Processing",amt:"$8,750",date:"Jun 17"},{id:"ORD-1040",cust:"Initech",status:"Pending",amt:"$5,200",date:"Jun 16"},{id:"ORD-1039",cust:"Umbrella Co",status:"Shipped",amt:"$22,100",date:"Jun 15"},{id:"ORD-1038",cust:"Waystar Royco",status:"Delivered",amt:"$9,800",date:"Jun 14"},{id:"ORD-1037",cust:"Stark Industries",status:"Processing",amt:"$31,500",date:"Jun 13"},{id:"ORD-1036",cust:"Wayne Enterprises",status:"Delivered",amt:"$18,240",date:"Jun 12"},{id:"ORD-1035",cust:"Soylent Corp",status:"Pending",amt:"$4,120",date:"Jun 11"},{id:"ORD-1034",cust:"Hooli Inc",status:"Shipped",amt:"$27,900",date:"Jun 10"},{id:"ORD-1033",cust:"Cyberdyne Systems",status:"Delivered",amt:"$14,650",date:"Jun 09"},{id:"ORD-1032",cust:"Massive Dynamic",status:"Processing",amt:"$10,300",date:"Jun 08"},{id:"ORD-1031",cust:"Tyrell Corp",status:"Delivered",amt:"$16,780",date:"Jun 07"},{id:"ORD-1030",cust:"Oscorp",status:"Shipped",amt:"$7,940",date:"Jun 06"},{id:"ORD-1029",cust:"Nakatomi Trading",status:"Pending",amt:"$3,560",date:"Jun 05"},{id:"ORD-1028",cust:"Gekko & Co",status:"Delivered",amt:"$25,300",date:"Jun 04"},{id:"ORD-1027",cust:"Bluth Company",status:"Processing",amt:"$6,410",date:"Jun 03"}],fr="100px 1fr 120px 100px 80px 70px";function ol(){const e=ve(),r=L(G=>G.settings),{t,rad:o,radSm:i,pad:s,padSm:a,screenPad:l,rowPy:c,tH1:g,wH1:f,headFam:x,headLH:m,accentBg:h,btnText:b,btnShadow:u,tBody:y,tBodySm:v,tCaption:E,tOverline:H,bwEmph:S,btnCase:C,bodyWeightEff:B,pMain:D,table:$}=e,X=x+",sans-serif",Q=r.fontFamily+",sans-serif",Y=e.hc1||t.textPrimary,[d,I,P]=Un(12,3,16),W=nl.slice(0,P).map((G,R)=>({...G,...$.statusMap[G.status]||{sb:t.divider,sc:t.textSecondary},rowBg:r.tableStripe&&R%2===1?$.stripeBg:"transparent"})),z=e.cardBorder==="none"?"none":e.cardBorder,q=G=>({fontSize:H,fontWeight:S,color:t.textSecondary,textTransform:"uppercase",letterSpacing:".5px",borderRight:$.colBorder,alignSelf:"stretch",display:"flex",alignItems:$.cellAI,justifyContent:$.cellJC,padding:`${$.rowPy} ${$.cellPx}`}),U={alignSelf:"stretch",display:"flex",alignItems:$.cellAI,justifyContent:$.cellJC,padding:`${$.rowPy} ${$.cellPx}`};return n.jsxs("div",{style:{display:"flex",flexDirection:"column",background:t.paper,border:z,borderRadius:o,boxShadow:e.cardShadow,overflow:"hidden",fontFamily:Q,fontWeight:B,color:t.textPrimary},children:[n.jsxs("div",{style:{padding:s,background:e.cardHdrBg,borderBottom:e.cardHdrBorder,boxShadow:e.cardHdrAccent,display:"flex",alignItems:"flex-start",justifyContent:"space-between",gap:14},children:[n.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[n.jsx("div",{style:{fontSize:g,lineHeight:m,fontWeight:f,color:Y,letterSpacing:"-.3px",fontFamily:X},children:"Orders"}),n.jsx("span",{title:"1,284 orders · June 2026",style:{width:16,height:16,borderRadius:"50%",border:"1.2px solid "+t.textSecondary,color:t.textSecondary,fontSize:9.5,fontWeight:S,fontStyle:"italic",fontFamily:"Georgia,serif",display:"grid",placeItems:"center",flexShrink:0,cursor:"help"},children:"i"})]}),n.jsx("button",{style:{padding:"10px 20px",borderRadius:i,border:"none",background:h,color:b,fontSize:v,fontWeight:S,textTransform:C,letterSpacing:".4px",boxShadow:u,whiteSpace:"nowrap",cursor:"pointer"},children:"+ New Order"})]}),n.jsx("div",{style:{padding:l,background:t.bgDefault,display:"flex",flexDirection:"column",flex:1,minHeight:0},children:n.jsxs("div",{style:{display:"flex",flexDirection:"column",background:t.paper,border:z,borderRadius:o,boxShadow:e.cardShadow,overflow:"hidden",flex:1,minHeight:0},children:[n.jsxs("div",{style:{padding:`${a}px ${s}px`,background:e.cardHdrBg,borderBottom:e.cardHdrBorder,boxShadow:e.cardHdrAccent,display:"flex",gap:9,alignItems:"center",flexWrap:"wrap"},children:[n.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,background:t.paper,border:"1.5px solid "+t.divider,borderRadius:999,padding:"8px 15px",flex:1,minWidth:170},children:[n.jsx("span",{style:{color:t.textSecondary,fontSize:13},children:"⌕"}),n.jsx("span",{style:{fontSize:v,color:t.textSecondary},children:"Search orders…"})]}),$.filters.map(G=>n.jsx("button",{style:{padding:"7px 14px",borderRadius:999,border:"1px solid "+G.brd,background:G.bg,color:G.c,fontSize:E,fontWeight:S,whiteSpace:"nowrap",cursor:"pointer"},children:G.label},G.label))]}),n.jsxs("div",{ref:d,style:{display:"grid",gridTemplateColumns:fr,padding:`0 ${s}px`,borderBottom:$.rowBorder,background:$.headBg},children:[["Order ID","Customer","Status","Amount","Date"].map(G=>n.jsx("div",{style:q(),children:G},G)),n.jsx("div",{style:{alignSelf:"stretch",padding:`${$.rowPy} 0`}})]}),n.jsxs("div",{ref:I,style:{position:"relative",display:"flex",flexDirection:"column",flex:1,minHeight:0},children:[n.jsxs("div",{style:{position:"absolute",inset:0,padding:`0 ${s}px`,display:"grid",gridTemplateColumns:fr,pointerEvents:"none",zIndex:2},children:[n.jsx("div",{style:{borderRight:$.colBorder}}),n.jsx("div",{style:{borderRight:$.colBorder}}),n.jsx("div",{style:{borderRight:$.colBorder}}),n.jsx("div",{style:{borderRight:$.colBorder}}),n.jsx("div",{style:{borderRight:$.colBorder}}),n.jsx("div",{})]}),W.map(G=>n.jsxs("div",{style:{display:"grid",gridTemplateColumns:fr,padding:`0 ${s}px`,borderBottom:$.rowBorder,alignItems:"stretch",background:G.rowBg},children:[n.jsx("div",{style:{...U,fontSize:v,fontWeight:S,color:D,fontFamily:Q},children:G.id}),n.jsx("div",{style:{...U,fontSize:y,color:t.textPrimary,fontWeight:S},children:G.cust}),n.jsx("div",{style:U,children:n.jsx("span",{style:{padding:"4px 11px",borderRadius:999,fontSize:E,fontWeight:S,background:G.sb,color:G.sc,whiteSpace:"nowrap"},children:G.status})}),n.jsx("div",{style:{...U,fontSize:y,color:t.textPrimary,fontWeight:S},children:G.amt}),n.jsx("div",{style:{...U,fontSize:v,color:t.textSecondary},children:G.date}),n.jsx("div",{style:U,children:n.jsx("button",{style:{fontSize:E,color:D,background:t.pContainer,border:"none",fontWeight:S,padding:"5px 11px",borderRadius:i,cursor:"pointer"},children:"View"})})]},G.id))]}),n.jsxs("div",{style:{padding:`${c}px ${s}px`,display:"flex",alignItems:"center",gap:7,borderTop:"1px solid "+t.divider},children:[n.jsxs("span",{style:{fontSize:v,color:t.textSecondary,flex:1},children:["Showing 1–",W.length," of 1,284"]}),n.jsx("button",{style:{width:32,height:32,borderRadius:i,border:"1px solid "+t.outline,background:"transparent",color:t.textSecondary,cursor:"pointer"},children:"‹"}),n.jsx("button",{style:{width:32,height:32,borderRadius:i,border:"none",background:h,color:b,fontWeight:S,cursor:"pointer"},children:"1"}),n.jsx("button",{style:{width:32,height:32,borderRadius:i,border:"1px solid "+t.outline,background:"transparent",color:t.textSecondary,cursor:"pointer"},children:"2"}),n.jsx("button",{style:{width:32,height:32,borderRadius:i,border:"1px solid "+t.outline,background:"transparent",color:t.textSecondary,cursor:"pointer"},children:"›"})]})]})})]})}function il(){const e=ve(),r=L(Z=>Z.settings),{t,rad:o,radSm:i,pad:s,padSm:a,gap:l,screenPad:c,tH1:g,tH2:f,tTitle:x,tH4:m,tH5:h,tH6:b,tBody:u,tBodySm:y,tCaption:v,wH1:E,headFam:H,headLH:S,accentBg:C,btnText:B,btnShadow:D,bwEmph:$,btnCase:X,bodyWeightEff:Q,bodyLH:Y,pMain:d,errSoft:I,errTxt:P,warnSoft:W,warnTxt:z,infoSoft:q,infoTxt:U,sucSoft:G,sucTxt:R}=e,O=H+",sans-serif",J=r.fontFamily+",sans-serif",V=e.t.highlight,N=e.t.highlightSoft,M=e.t.highlightBd,j=t.pContainer,A=t.onPContainer,k=t.pContrast,T=e.hc1||t.textPrimary,K=e.hc2||t.textPrimary,se=e.hc3||t.textPrimary,F=e.hc4||t.textPrimary,fe=e.hc5||t.textPrimary,Oe=e.hc6||t.textPrimary,De=e.cardBorder==="none"?"none":e.cardBorder,Ve={display:"flex",flexDirection:"column",background:t.paper,border:De,borderRadius:o,boxShadow:e.cardShadow,overflow:"hidden",height:"100%"},Ue={padding:`${a}px ${s}px`,background:e.cardHdrBg,borderBottom:e.cardHdrBorder,boxShadow:e.cardHdrAccent},Be={fontSize:x,lineHeight:S,fontWeight:E,color:se,fontFamily:O},Xt=[{label:"Dashboard Overview",size:g,w:E,color:T,lh:1.1,ls:"-.5px",name:"H1",border:!0},{label:"Revenue Report",size:f,w:E,color:K,lh:1.1,ls:"-.4px",name:"H2",border:!0},{label:"Performance Overview",size:x,w:E,color:se,lh:1.15,name:"H3",border:!0},{label:"Active Users",size:m,w:E,color:F,lh:1.2,name:"H4",border:!0},{label:"Last updated 2m ago",size:h,w:E,color:fe,lh:1.25,name:"H5",border:!0},{label:"Status · Live",size:b,w:E,color:Oe,lh:1.3,name:"H6",border:!0}],Me=Z=>n.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10,padding:"11px 12px",borderBottom:"1px solid "+t.divider,background:Z?N:"transparent",boxShadow:Z?"inset 3px 0 0 "+V:"none"},children:[n.jsx("div",{style:{width:16,height:16,borderRadius:"50%",border:"2px solid "+(Z?V:t.outline),display:"grid",placeItems:"center",flexShrink:0},children:Z&&n.jsx("div",{style:{width:8,height:8,borderRadius:"50%",background:V}})}),n.jsx("span",{style:{flex:1,fontSize:y,fontFamily:J,fontWeight:Z?$:Q,color:t.textPrimary},children:Z?"Selected item":"Unselected item"}),Z&&n.jsx("span",{style:{fontSize:v,fontFamily:J,fontWeight:$,color:t.textSecondary},children:"Active"})]}),St=(Z,ct,pt)=>n.jsxs("div",{style:{position:"relative",border:Z?"2px solid "+d:"1.5px solid "+t.outline,borderRadius:i,padding:"12px 13px"},children:[n.jsx("span",{style:{position:"absolute",top:-8,left:10,background:t.paper,padding:"0 5px",fontSize:v,color:Z?d:t.textSecondary,fontWeight:Z?$:void 0},children:ct}),n.jsx("span",{style:{fontSize:u,color:Z?t.textPrimary:t.textSecondary},children:pt})]}),Ge=(Z,ct,pt)=>n.jsx("span",{style:{padding:"5px 13px",borderRadius:999,background:Z,color:ct,fontSize:v,fontWeight:$},children:pt}),Fe=Z=>({padding:"9px 20px",borderRadius:i,fontSize:y,fontWeight:$,textTransform:X,letterSpacing:".4px",cursor:"pointer",...Z});return n.jsxs("div",{style:{display:"flex",flexDirection:"column",background:t.paper,border:De,borderRadius:o,boxShadow:e.cardShadow,overflow:"hidden",fontFamily:J,fontWeight:Q,color:t.textPrimary},children:[n.jsx("div",{style:{padding:s,background:e.cardHdrBg,borderBottom:e.cardHdrBorder,boxShadow:e.cardHdrAccent},children:n.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[n.jsx("div",{style:{fontSize:g,lineHeight:S,fontWeight:E,color:T,letterSpacing:"-.3px",fontFamily:O},children:"Component Library"}),n.jsx("span",{title:"Every Material UI component reflects your live theme",style:{width:16,height:16,borderRadius:"50%",border:"1.2px solid "+t.textSecondary,color:t.textSecondary,fontSize:9.5,fontWeight:$,fontStyle:"italic",fontFamily:"Georgia,serif",display:"grid",placeItems:"center",flexShrink:0,cursor:"help"},children:"i"})]})}),n.jsxs("div",{style:{padding:c,background:t.bgDefault,display:"flex",flexDirection:"column",gap:l,flex:1,minHeight:0},children:[n.jsxs("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:l,alignItems:"stretch"},children:[n.jsxs("div",{style:Ve,children:[n.jsx("div",{style:Ue,children:n.jsx("span",{style:Be,children:"Typography Scale"})}),n.jsxs("div",{style:{padding:s,display:"flex",flexDirection:"column",justifyContent:"space-between",flex:1,minHeight:0,gap:6},children:[Xt.map(Z=>n.jsxs("div",{style:{display:"flex",alignItems:"baseline",justifyContent:"space-between",gap:12,borderBottom:"1px solid "+t.divider,paddingBottom:14},children:[n.jsx("span",{style:{fontSize:Z.size,lineHeight:Z.lh,fontWeight:Z.w,color:Z.color,fontFamily:O,letterSpacing:Z.ls},children:Z.label}),n.jsxs("span",{style:{fontSize:Z.size,color:t.textSecondary,fontWeight:Z.w,whiteSpace:"nowrap",flexShrink:0,fontFamily:O},children:[Z.name," · ",Z.size]})]},Z.name)),n.jsxs("div",{style:{display:"flex",alignItems:"baseline",justifyContent:"space-between",gap:12},children:[n.jsx("span",{style:{fontSize:u,lineHeight:Y,color:t.textPrimary,fontFamily:J,fontWeight:Q},children:"Body text — the quick brown fox jumps over the lazy dog."}),n.jsxs("span",{style:{fontSize:u,color:t.textSecondary,fontWeight:Q,whiteSpace:"nowrap",flexShrink:0,fontFamily:J},children:["Body · ",u]})]}),n.jsxs("div",{style:{display:"flex",alignItems:"baseline",justifyContent:"space-between",gap:12},children:[n.jsx("span",{style:{fontSize:v,lineHeight:Y,color:t.textSecondary,fontFamily:J,fontWeight:Q},children:"Caption & helper text style"}),n.jsxs("span",{style:{fontSize:v,color:t.textSecondary,fontWeight:Q,whiteSpace:"nowrap",flexShrink:0,fontFamily:J},children:["Caption · ",v]})]})]})]}),n.jsxs("div",{style:Ve,children:[n.jsx("div",{style:Ue,children:n.jsx("span",{style:Be,children:"Selection States"})}),n.jsxs("div",{style:{padding:s,display:"flex",flexDirection:"column",gap:14},children:[n.jsxs("div",{style:{display:"flex",gap:2,borderBottom:"1.5px solid "+t.divider},children:[n.jsx("div",{style:{flex:1,textAlign:"center",padding:"8px 4px",fontSize:y,fontWeight:$,color:t.textPrimary,background:N,borderBottom:"2.5px solid "+d,marginBottom:-1.5,borderRadius:"6px 6px 0 0"},children:"Overview"}),n.jsx("div",{style:{flex:1,textAlign:"center",padding:"8px 4px",fontSize:y,fontWeight:$,color:t.textSecondary},children:"Activity"}),n.jsx("div",{style:{flex:1,textAlign:"center",padding:"8px 4px",fontSize:y,fontWeight:$,color:t.textSecondary},children:"Settings"})]}),n.jsxs("div",{style:{display:"flex",flexDirection:"column",border:"1px solid "+t.divider,borderRadius:i,overflow:"hidden"},children:[Me(!0),Me(!1),Me(!1),Me(!1),Me(!0),Me(!1)]}),n.jsx("div",{style:{display:"inline-flex",alignSelf:"flex-start",padding:"6px 12px",borderRadius:i,background:N,border:"1px solid "+M},children:n.jsx("span",{style:{fontSize:v,fontWeight:$,color:V},children:"2 selected items"})})]})]})]}),n.jsxs("div",{style:{...Ve,height:"auto"},children:[n.jsx("div",{style:Ue,children:n.jsx("span",{style:Be,children:"Inputs & Selection"})}),n.jsxs("div",{style:{padding:s},children:[n.jsxs("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:l,marginBottom:l},children:[St(!1,"Outlined","Placeholder…"),St(!0,"Focused","Active value")]}),n.jsxs("div",{style:{display:"flex",gap:22,alignItems:"center",flexWrap:"wrap",paddingTop:a,borderTop:"1px solid "+t.divider},children:[n.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[n.jsx("div",{style:{width:18,height:18,borderRadius:4,background:d,display:"grid",placeItems:"center",color:k,fontSize:11,fontWeight:$},children:"✓"}),n.jsx("span",{style:{fontSize:y,color:t.textPrimary},children:"Checkbox"})]}),n.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[n.jsx("div",{style:{width:18,height:18,borderRadius:"50%",border:"2px solid "+d,display:"grid",placeItems:"center"},children:n.jsx("div",{style:{width:9,height:9,borderRadius:"50%",background:d}})}),n.jsx("span",{style:{fontSize:y,color:t.textPrimary},children:"Radio"})]}),n.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[n.jsx("div",{style:{width:38,height:22,borderRadius:999,background:d,position:"relative"},children:n.jsx("div",{style:{position:"absolute",top:3,right:3,width:16,height:16,borderRadius:"50%",background:"#fff"}})}),n.jsx("span",{style:{fontSize:y,color:t.textPrimary},children:"Switch"})]})]})]})]}),n.jsxs("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:l,alignItems:"stretch"},children:[n.jsxs("div",{style:Ve,children:[n.jsx("div",{style:Ue,children:n.jsx("span",{style:Be,children:"Buttons"})}),n.jsxs("div",{style:{padding:s,display:"flex",gap:10,flexWrap:"wrap",alignItems:"center"},children:[n.jsx("button",{style:Fe({border:"none",background:C,color:B,boxShadow:D}),children:"Contained"}),n.jsx("button",{style:Fe({border:"1.5px solid "+d,background:"transparent",color:d}),children:"Outlined"}),n.jsx("button",{style:Fe({border:"none",background:"transparent",color:d}),children:"Text"}),n.jsx("button",{style:Fe({border:"none",background:j,color:A}),children:"Tonal"}),n.jsx("button",{style:Fe({border:"none",background:C,color:B,boxShadow:D,borderRadius:999}),children:"Rounded"}),n.jsx("button",{style:Fe({border:"none",background:I,color:P}),children:"Error"})]})]}),n.jsxs("div",{style:Ve,children:[n.jsx("div",{style:Ue,children:n.jsx("span",{style:Be,children:"Chips, Alerts & Progress"})}),n.jsxs("div",{style:{padding:s},children:[n.jsxs("div",{style:{display:"flex",gap:8,flexWrap:"wrap",marginBottom:l},children:[Ge(j,A,"Primary"),Ge(G,R,"Success"),Ge(W,z,"Warning"),Ge(q,U,"Info"),Ge(I,P,"Error")]}),n.jsxs("div",{style:{display:"flex",justifyContent:"space-between",marginBottom:7},children:[n.jsx("span",{style:{fontSize:y,color:t.textPrimary,fontWeight:$},children:"Revenue goal"}),n.jsx("span",{style:{fontSize:y,color:d,fontWeight:$},children:"74%"})]}),n.jsx("div",{style:{height:8,background:t.paper2,border:"1px solid "+t.divider,borderRadius:999,overflow:"hidden"},children:n.jsx("div",{style:{height:"100%",width:"74%",background:d,borderRadius:999}})})]})]})]})]})]})}const al=[{label:"Cameras Online",val:"5 / 6"},{label:"Recording",val:"4"},{label:"Motion Alerts",val:"2"},{label:"Storage Used",val:"82%"}],sl=[{name:"CAM 01",loc:"Main Lobby",rec:!0,online:!0,time:"14:32:08"},{name:"CAM 02",loc:"North Gate",rec:!0,online:!0,time:"14:32:08"},{name:"CAM 03",loc:"Loading Bay",rec:!1,online:!0,time:"14:32:07"},{name:"CAM 04",loc:"Rooftop",rec:!0,online:!0,time:"14:32:08"},{name:"CAM 05",loc:"Parking Deck",rec:!1,online:!1,time:"—"},{name:"CAM 06",loc:"Server Room",rec:!0,online:!0,time:"14:32:08"}],ll=[{cam:"CAM 04",label:"Motion detected — Rooftop",time:"just now",sev:"error"},{cam:"CAM 02",label:"Person identified — North Gate",time:"6m ago",sev:"info"},{cam:"CAM 01",label:"Loitering cleared — Main Lobby",time:"22m ago",sev:"success"},{cam:"CAM 06",label:"Door forced — Server Room",time:"34m ago",sev:"error"},{cam:"CAM 03",label:"Vehicle detected — Loading Bay",time:"48m ago",sev:"info"},{cam:"CAM 05",label:"Signal restored — Parking Deck",time:"1h ago",sev:"success"},{cam:"CAM 02",label:"Tailgating flagged — North Gate",time:"1h ago",sev:"error"},{cam:"CAM 04",label:"Crowd density normal — Rooftop",time:"2h ago",sev:"success"},{cam:"CAM 01",label:"Object left behind — Main Lobby",time:"2h ago",sev:"info"},{cam:"CAM 03",label:"Motion detected — Loading Bay",time:"3h ago",sev:"error"},{cam:"CAM 06",label:"Access granted — Server Room",time:"3h ago",sev:"success"},{cam:"CAM 05",label:"Camera offline — Parking Deck",time:"4h ago",sev:"error"},{cam:"CAM 02",label:"Face match — North Gate",time:"5h ago",sev:"info"},{cam:"CAM 01",label:"Queue length normal — Main Lobby",time:"6h ago",sev:"success"},{cam:"CAM 04",label:"Perimeter breach — Rooftop",time:"7h ago",sev:"error"},{cam:"CAM 03",label:"Package scanned — Loading Bay",time:"8h ago",sev:"info"}];function dl(){const e=ve(),r=L(k=>k.settings),{t,rad:o,radSm:i,pad:s,padSm:a,gap:l,screenPad:c,tH1:g,tH2:f,tTitle:x,wH1:m,headFam:h,headLH:b,accentBg:u,btnText:y,btnShadow:v,tBodySm:E,tCaption:H,tOverline:S,bwEmph:C,btnCase:B,bodyWeightEff:D,errSoft:$,errTxt:X,mediaBg:Q,overlaySurface:Y,overlayBorder:d,onOverlay:I,sevMap:P}=e,W=h+",sans-serif",z=r.fontFamily+",sans-serif",q=e.hc1||t.textPrimary,U=e.hc2||t.textPrimary,G=e.hc3||t.textPrimary,R=e.cardBorder==="none"?"none":e.cardBorder,O=sl.map(k=>({...k,dotC:k.online?r.successHex:t.textDisabled})),[J,V]=Br(3,3,16),N=ll.slice(0,V).map(k=>({...k,...P[k.sev]})),M={background:t.paper,border:R,borderRadius:o,boxShadow:e.cardShadow,overflow:"hidden"},j={padding:`${a}px ${s}px`,background:e.cardHdrBg,borderBottom:e.cardHdrBorder,boxShadow:e.cardHdrAccent,display:"flex",alignItems:"center",justifyContent:"space-between"},A={fontSize:x,lineHeight:b,fontWeight:m,color:G,fontFamily:W};return n.jsxs("div",{style:{display:"flex",flexDirection:"column",background:t.paper,border:R,borderRadius:o,boxShadow:e.cardShadow,overflow:"hidden",fontFamily:z,fontWeight:D,color:t.textPrimary},children:[n.jsxs("div",{style:{padding:s,background:e.cardHdrBg,borderBottom:e.cardHdrBorder,boxShadow:e.cardHdrAccent,display:"flex",alignItems:"flex-start",justifyContent:"space-between",gap:14},children:[n.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[n.jsx("div",{style:{fontSize:g,lineHeight:b,fontWeight:m,color:q,letterSpacing:"-.3px",fontFamily:W},children:"Camera Surveillance"}),n.jsx("span",{title:"6 feeds · live monitoring & recording",style:{width:16,height:16,borderRadius:"50%",border:"1.2px solid "+t.textSecondary,color:t.textSecondary,fontSize:9.5,fontWeight:C,fontStyle:"italic",fontFamily:"Georgia,serif",display:"grid",placeItems:"center",flexShrink:0,cursor:"help"},children:"i"})]}),n.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[n.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:6,fontSize:H,fontWeight:C,color:X,background:$,padding:"6px 12px",borderRadius:999},children:[n.jsx("span",{style:{width:7,height:7,borderRadius:"50%",background:r.errorHex}}),"LIVE"]}),n.jsx("button",{style:{padding:"10px 18px",borderRadius:i,border:"none",background:u,color:y,fontSize:E,fontWeight:C,textTransform:B,letterSpacing:".4px",boxShadow:v,whiteSpace:"nowrap",cursor:"pointer"},children:"+ Add Camera"})]})]}),n.jsxs("div",{style:{padding:c,background:t.bgDefault,display:"flex",flexDirection:"column",flex:1,minHeight:0},children:[n.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(4,1fr)",gap:l,marginBottom:l},children:al.map(k=>n.jsxs("div",{style:M,children:[n.jsx("div",{style:{padding:`${a}px ${s}px`,background:e.cardHdrBg,borderBottom:e.cardHdrBorder,boxShadow:e.cardHdrAccent},children:n.jsx("span",{style:{fontSize:S,color:t.textSecondary,textTransform:"uppercase",letterSpacing:".6px",fontWeight:C},children:k.label})}),n.jsx("div",{style:{padding:`${a}px ${s}px`},children:n.jsx("div",{style:{fontSize:f,fontWeight:m,color:U,letterSpacing:"-.8px",lineHeight:1},children:k.val})})]},k.label))}),n.jsxs("div",{style:{display:"grid",gridTemplateColumns:"1fr 300px",gap:l,flex:1,minHeight:0},children:[n.jsxs("div",{style:{...M,display:"flex",flexDirection:"column"},children:[n.jsxs("div",{style:j,children:[n.jsx("span",{style:A,children:"Camera Wall"}),n.jsx("span",{style:{fontSize:H,color:t.textSecondary,fontWeight:C},children:"2 × 3 grid"})]}),n.jsx("div",{style:{padding:s,display:"grid",gridTemplateColumns:"1fr 1fr 1fr",gridAutoRows:"1fr",gap:l},children:O.map(k=>n.jsxs("div",{style:{position:"relative",borderRadius:i,overflow:"hidden",background:Q,minHeight:104,border:"1px solid "+t.divider},children:[n.jsx("div",{style:{position:"absolute",inset:0,display:"grid",placeItems:"center"},children:n.jsx("span",{style:{fontFamily:"monospace",fontSize:H,color:"rgba(255,255,255,.3)",letterSpacing:1},children:k.loc})}),n.jsxs("div",{style:{position:"absolute",top:7,left:7,display:"flex",alignItems:"center",gap:5,background:Y,border:"1px solid "+d,borderRadius:999,padding:"2px 8px"},children:[n.jsx("span",{style:{width:6,height:6,borderRadius:"50%",background:k.dotC}}),n.jsx("span",{style:{color:I,fontSize:H,fontWeight:700,letterSpacing:".4px"},children:k.name})]}),k.rec&&n.jsxs("div",{style:{position:"absolute",top:7,right:7,display:"flex",alignItems:"center",gap:4,background:Y,borderRadius:999,padding:"2px 7px"},children:[n.jsx("span",{style:{width:6,height:6,borderRadius:"50%",background:r.errorHex}}),n.jsx("span",{style:{color:I,fontSize:8,fontWeight:800,letterSpacing:".5px"},children:"REC"})]}),k.online&&n.jsx("div",{style:{position:"absolute",bottom:0,left:0,right:0,padding:"5px 8px",background:"linear-gradient(0deg,rgba(0,0,0,.7),rgba(0,0,0,0))",display:"flex",justifyContent:"space-between",alignItems:"center"},children:n.jsx("span",{style:{color:"#fff",fontSize:H,fontWeight:600,fontFamily:"monospace"},children:k.time})})]},k.name))})]}),n.jsxs("div",{style:{...M,display:"flex",flexDirection:"column"},children:[n.jsx("div",{style:{padding:`${a}px ${s}px`,background:e.cardHdrBg,borderBottom:e.cardHdrBorder,boxShadow:e.cardHdrAccent},children:n.jsx("span",{style:A,children:"Recent Detections"})}),n.jsx("div",{ref:J,style:{padding:a,display:"flex",flexDirection:"column",justifyContent:"space-between",gap:2,flex:1,minHeight:0},children:N.map((k,T)=>n.jsxs("div",{style:{display:"flex",gap:11,alignItems:"flex-start",padding:"9px 8px",borderRadius:i},children:[n.jsx("div",{style:{width:28,height:28,borderRadius:i,background:k.cb,color:k.cc,display:"grid",placeItems:"center",flexShrink:0,fontSize:11,fontWeight:800,fontFamily:"monospace"},children:"●"}),n.jsxs("div",{style:{flex:1,minWidth:0},children:[n.jsx("div",{style:{fontSize:E,color:t.textPrimary,fontWeight:D,lineHeight:1.35},children:k.label}),n.jsxs("div",{style:{fontSize:H,color:t.textSecondary,marginTop:2},children:[k.cam," · ",k.time]})]})]},T))})]})]})]})]})}const cl=[{ic:"!",label:"Camera 04 motion detected — Loading Bay",time:"just now",sev:"error",unread:!0},{ic:"✓",label:"Stream reconnected — North Gate feed",time:"4m ago",sev:"success",unread:!0},{ic:"i",label:"Access request — J. Okoro (Operator)",time:"22m ago",sev:"info",unread:!1},{ic:"!",label:"Report archive storage 82% full",time:"1h ago",sev:"warning",unread:!1},{ic:"✓",label:"Backup completed — 12,480 clips archived",time:"2h ago",sev:"success",unread:!1},{ic:"i",label:"Firmware update available — 3 devices",time:"3h ago",sev:"info",unread:!1},{ic:"!",label:"Camera 02 lens obstruction detected",time:"5h ago",sev:"error",unread:!1},{ic:"✓",label:"Nightly health check passed — all nodes",time:"6h ago",sev:"success",unread:!1},{ic:"i",label:"New operator invited — M. Fernandez",time:"7h ago",sev:"info",unread:!1},{ic:"!",label:"Bandwidth spike on West Wing uplink",time:"8h ago",sev:"warning",unread:!1},{ic:"✓",label:"Retention policy applied — 30 day window",time:"9h ago",sev:"success",unread:!1},{ic:"i",label:"Scheduled maintenance — Sat 02:00 UTC",time:"11h ago",sev:"info",unread:!1},{ic:"!",label:"Motion zone breach — Perimeter Gate 3",time:"12h ago",sev:"error",unread:!1},{ic:"✓",label:"Clip export finished — Incident #4821",time:"14h ago",sev:"success",unread:!1},{ic:"i",label:"Analytics model updated — v2.4.1",time:"16h ago",sev:"info",unread:!1},{ic:"!",label:"Disk latency elevated — NVR-02",time:"18h ago",sev:"warning",unread:!1}];function pl(){const e=ve(),r=L(A=>A.settings),{t,rad:o,radSm:i,pad:s,padSm:a,gap:l,screenPad:c,tH1:g,tTitle:f,wH1:x,headFam:m,headLH:h,accentBg:b,btnText:u,tBodySm:y,tCaption:v,tOverline:E,bwEmph:H,bodyWeightEff:S,bodyLH:C,errSoft:B,errTxt:D,pMain:$,mediaBg:X,overlaySurface:Q,overlayBorder:Y,onOverlay:d,sevMap:I}=e,P=m+",sans-serif",W=r.fontFamily+",sans-serif",z=e.hc1||t.textPrimary,q=e.hc3||t.textPrimary,U=e.cardBorder==="none"?"none":e.cardBorder,[G,R]=Br(7,4,16),O=cl.slice(0,R).map(A=>({...A,...I[A.sev],rowBg:A.unread?ce(r.primaryHex,e.isDark?.12:.05):"transparent"})),J=O.filter(A=>A.unread).length,V={display:"flex",flexDirection:"column",minHeight:0,background:t.paper,border:U,borderRadius:o,boxShadow:e.cardShadow,overflow:"hidden"},N={padding:`${a}px ${s}px`,background:e.cardHdrBg,borderBottom:e.cardHdrBorder,boxShadow:e.cardHdrAccent,display:"flex",alignItems:"center",justifyContent:"space-between"},M={fontSize:f,lineHeight:h,fontWeight:x,color:q,fontFamily:P},j={height:30,borderRadius:i,border:"none",background:"rgba(255,255,255,.14)",color:d,fontSize:v,fontWeight:H,cursor:"pointer",fontFamily:"inherit"};return n.jsxs("div",{style:{display:"flex",flexDirection:"column",background:t.paper,border:U,borderRadius:o,boxShadow:e.cardShadow,overflow:"hidden",fontFamily:W,fontWeight:S,color:t.textPrimary},children:[n.jsx("div",{style:{padding:s,background:e.cardHdrBg,borderBottom:e.cardHdrBorder,boxShadow:e.cardHdrAccent},children:n.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[n.jsx("div",{style:{fontSize:g,lineHeight:h,fontWeight:x,color:z,letterSpacing:"-.3px",fontFamily:P},children:"Operations Center"}),n.jsx("span",{title:"Live map, camera feeds, alerts & access — every module themed end to end",style:{width:16,height:16,borderRadius:"50%",border:"1.2px solid "+t.textSecondary,color:t.textSecondary,fontSize:9.5,fontWeight:H,fontStyle:"italic",fontFamily:"Georgia,serif",display:"grid",placeItems:"center",flexShrink:0,cursor:"help"},children:"i"})]})}),n.jsx("div",{style:{padding:c,background:t.bgDefault,display:"flex",flexDirection:"column",flex:1,minHeight:0},children:n.jsxs("div",{style:{display:"grid",gridTemplateColumns:"1fr 320px",gap:l,flex:1,minHeight:0},children:[n.jsxs("div",{style:V,children:[n.jsxs("div",{style:N,children:[n.jsx("span",{style:M,children:"Live Map · Street View"}),n.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:6,fontSize:v,fontWeight:H,color:D,background:B,padding:"3px 10px",borderRadius:999},children:[n.jsx("span",{style:{width:7,height:7,borderRadius:"50%",background:r.errorHex}}),"LIVE"]})]}),n.jsxs("div",{style:{position:"relative",flex:1,minHeight:320,background:X,display:"flex",alignItems:"center",justifyContent:"center"},children:[n.jsx("span",{style:{fontFamily:"monospace",fontSize:v,color:"rgba(255,255,255,.42)",letterSpacing:1.5},children:"◍ GOOGLE STREET VIEW / EARTH EMBED"}),n.jsx("div",{style:{position:"absolute",top:12,left:12,display:"flex",alignItems:"center",gap:7,background:Q,border:"1px solid "+Y,borderRadius:999,padding:"6px 12px"},children:n.jsx("span",{style:{color:d,fontSize:v,fontWeight:H},children:"◎ 40.7128, -74.0060 · Manhattan"})}),n.jsxs("div",{style:{position:"absolute",bottom:12,left:"50%",transform:"translateX(-50%)",display:"flex",alignItems:"center",gap:4,background:Q,border:"1px solid "+Y,borderRadius:i,padding:5},children:[n.jsx("button",{style:{width:30,height:30,borderRadius:i,border:"none",background:b,color:u,fontSize:16,fontWeight:H,cursor:"pointer"},children:"+"}),n.jsx("button",{style:{width:30,height:30,borderRadius:i,border:"none",background:"rgba(255,255,255,.14)",color:d,fontSize:16,fontWeight:H,cursor:"pointer"},children:"−"}),n.jsx("div",{style:{width:1,height:18,background:Y,margin:"0 3px"}}),n.jsx("button",{style:{...j,padding:"0 12px"},children:"Layers"}),n.jsx("button",{style:{...j,padding:"0 12px"},children:"◎ Locate"})]})]})]}),n.jsxs("div",{style:V,children:[n.jsxs("div",{style:N,children:[n.jsx("span",{style:M,children:"Notifications"}),n.jsxs("span",{style:{fontSize:E,fontWeight:H,color:t.pContrast,background:$,padding:"2px 9px",borderRadius:999},children:[J," NEW"]})]}),n.jsx("div",{ref:G,style:{padding:a,display:"flex",flexDirection:"column",gap:2,flex:1,minHeight:0},children:O.map((A,k)=>n.jsxs("div",{style:{display:"flex",gap:11,alignItems:"flex-start",padding:"9px 8px",borderRadius:i,background:A.rowBg},children:[n.jsx("div",{style:{width:26,height:26,borderRadius:i,background:A.cb,color:A.cc,display:"grid",placeItems:"center",flexShrink:0,fontSize:13,fontWeight:H},children:A.ic}),n.jsxs("div",{style:{flex:1,minWidth:0},children:[n.jsx("div",{style:{fontSize:y,color:t.textPrimary,fontWeight:S,lineHeight:C},children:A.label}),n.jsx("div",{style:{fontSize:v,color:t.textSecondary,marginTop:2},children:A.time})]}),A.unread&&n.jsx("div",{style:{width:8,height:8,borderRadius:"50%",background:$,flexShrink:0,marginTop:6}})]},k))})]})]})})]})}const ul=[{label:"Reports Generated",val:"248"},{label:"Avg Generation",val:"1.2s"},{label:"Data Points",val:"84.2K"},{label:"Scheduled",val:"12"}],fl=["Jan","Feb","Mar","Apr","May","Jun"],hl=[44,60,50,74,88,96],gl=[24,32,30,42,52,60],xl=[{l:"Reports",h:72},{l:"Cameras",h:92},{l:"Alerts",h:40},{l:"Users",h:58},{l:"Storage",h:80}],ml=[{name:"Q2 Revenue Summary",type:"Financial",date:"Jun 20",status:"Ready"},{name:"Camera Uptime Audit",type:"Operations",date:"Jun 19",status:"Ready"},{name:"User Access Log",type:"Security",date:"Jun 18",status:"Ready"},{name:"Inventory Forecast",type:"Analytics",date:"Jun 17",status:"Processing"},{name:"Monthly KPI Digest",type:"Executive",date:"Jun 15",status:"Ready"},{name:"Incident Response Log",type:"Security",date:"Jun 14",status:"Ready"},{name:"Storage Utilization Report",type:"Operations",date:"Jun 13",status:"Ready"},{name:"Weekly Traffic Analysis",type:"Analytics",date:"Jun 12",status:"Processing"},{name:"Vendor SLA Compliance",type:"Financial",date:"Jun 11",status:"Ready"},{name:"Motion Event Rollup",type:"Operations",date:"Jun 10",status:"Ready"},{name:"Quarterly Audit Trail",type:"Security",date:"Jun 09",status:"Ready"},{name:"Energy Consumption Digest",type:"Analytics",date:"Jun 08",status:"Processing"},{name:"Executive Board Pack",type:"Executive",date:"Jun 07",status:"Ready"},{name:"Device Firmware Ledger",type:"Operations",date:"Jun 06",status:"Ready"},{name:"Access Anomaly Report",type:"Security",date:"Jun 05",status:"Ready"},{name:"Cost Allocation Summary",type:"Financial",date:"Jun 04",status:"Ready"}],bn="1fr 130px 110px 90px 70px";function yl(){const e=ve(),r=L(k=>k.settings),{t,rad:o,radSm:i,pad:s,padSm:a,gap:l,screenPad:c,rowPy:g,tH1:f,tH2:x,tTitle:m,wH1:h,headFam:b,headLH:u,accentBg:y,btnText:v,btnShadow:E,tBody:H,tBodySm:S,tCaption:C,tOverline:B,bwEmph:D,btnCase:$,bodyWeightEff:X,pMain:Q,sMain:Y,chartPalette:d}=e,I=b+",sans-serif",P=r.fontFamily+",sans-serif",W=e.hc1||t.textPrimary,z=e.hc2||t.textPrimary,q=e.hc3||t.textPrimary,U=e.cardBorder==="none"?"none":e.cardBorder,[G,R,O]=Un(5,3,16),J=ml.slice(0,O).map(k=>({...k,sb:k.status==="Ready"?e.sucSoft:e.warnSoft,sc:k.status==="Ready"?e.sucTxt:e.warnTxt})),V=xl.map((k,T)=>({...k,c:d[T%d.length]})),N={background:t.paper,border:U,borderRadius:o,boxShadow:e.cardShadow,overflow:"hidden"},M={padding:`${a}px ${s}px`,background:e.cardHdrBg,borderBottom:e.cardHdrBorder,boxShadow:e.cardHdrAccent,display:"flex",alignItems:"center",justifyContent:"space-between"},j={fontSize:m,lineHeight:u,fontWeight:h,color:q,fontFamily:I},A={fontSize:B,fontWeight:D,color:t.textSecondary,textTransform:"uppercase",letterSpacing:".5px"};return n.jsxs("div",{style:{display:"flex",flexDirection:"column",background:t.paper,border:U,borderRadius:o,boxShadow:e.cardShadow,overflow:"hidden",fontFamily:P,fontWeight:X,color:t.textPrimary},children:[n.jsxs("div",{style:{padding:s,background:e.cardHdrBg,borderBottom:e.cardHdrBorder,boxShadow:e.cardHdrAccent,display:"flex",alignItems:"flex-start",justifyContent:"space-between",gap:14},children:[n.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[n.jsx("div",{style:{fontSize:f,lineHeight:u,fontWeight:h,color:W,letterSpacing:"-.3px",fontFamily:I},children:"Reports"}),n.jsx("span",{title:"Generated insights across every module",style:{width:16,height:16,borderRadius:"50%",border:"1.2px solid "+t.textSecondary,color:t.textSecondary,fontSize:9.5,fontWeight:D,fontStyle:"italic",fontFamily:"Georgia,serif",display:"grid",placeItems:"center",flexShrink:0,cursor:"help"},children:"i"})]}),n.jsx("button",{style:{padding:"10px 20px",borderRadius:i,border:"none",background:y,color:v,fontSize:S,fontWeight:D,textTransform:$,letterSpacing:".4px",boxShadow:E,whiteSpace:"nowrap",cursor:"pointer"},children:"↓ Export PDF"})]}),n.jsxs("div",{style:{padding:c,background:t.bgDefault,display:"flex",flexDirection:"column",flex:1,minHeight:0},children:[n.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(4,1fr)",gap:l,marginBottom:l},children:ul.map(k=>n.jsxs("div",{style:N,children:[n.jsx("div",{style:{padding:`${a}px ${s}px`,background:e.cardHdrBg,borderBottom:e.cardHdrBorder,boxShadow:e.cardHdrAccent},children:n.jsx("span",{style:{fontSize:B,color:t.textSecondary,textTransform:"uppercase",letterSpacing:".6px",fontWeight:D},children:k.label})}),n.jsx("div",{style:{padding:`${a}px ${s}px`},children:n.jsx("div",{style:{fontSize:x,fontWeight:h,color:z,letterSpacing:"-.8px",lineHeight:1},children:k.val})})]},k.label))}),n.jsxs("div",{style:{display:"grid",gridTemplateColumns:"1fr 300px",gap:l,marginBottom:l},children:[n.jsxs("div",{style:N,children:[n.jsxs("div",{style:M,children:[n.jsx("span",{style:j,children:"Revenue & Profit Trend"}),n.jsx("span",{style:{fontSize:C,color:t.textSecondary,fontWeight:D},children:"6 months"})]}),n.jsx("div",{style:{padding:s,display:"flex",alignItems:"flex-end",gap:12,height:160},children:fl.map((k,T)=>n.jsxs("div",{style:{flex:1,display:"flex",flexDirection:"column",alignItems:"center",gap:6,height:"100%"},children:[n.jsxs("div",{style:{width:"100%",display:"flex",flexDirection:"column",justifyContent:"flex-end",gap:3,flex:1},children:[n.jsx("div",{style:{width:"100%",height:gl[T]+"%",background:Y,opacity:.55,borderRadius:`${i} ${i} 0 0`}}),n.jsx("div",{style:{width:"100%",height:hl[T]+"%",background:Q,borderRadius:`${i} ${i} 0 0`}})]}),n.jsx("span",{style:{fontSize:C,color:t.textSecondary},children:k})]},k))})]}),n.jsxs("div",{style:N,children:[n.jsx("div",{style:{padding:`${a}px ${s}px`,background:e.cardHdrBg,borderBottom:e.cardHdrBorder,boxShadow:e.cardHdrAccent},children:n.jsx("span",{style:j,children:"By Module"})}),n.jsx("div",{style:{padding:s,display:"flex",alignItems:"flex-end",gap:10,height:128},children:V.map(k=>n.jsx("div",{style:{flex:1,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"flex-end",height:"100%"},children:n.jsx("div",{style:{width:"100%",height:k.h+"%",background:k.c,borderRadius:`${i} ${i} 0 0`}})},k.l))})]})]}),n.jsxs("div",{style:{...N,display:"flex",flexDirection:"column",flex:1,minHeight:0},children:[n.jsx("div",{style:{padding:`${a}px ${s}px`,background:e.cardHdrBg,borderBottom:e.cardHdrBorder,boxShadow:e.cardHdrAccent},children:n.jsx("span",{style:j,children:"Recent Reports"})}),n.jsxs("div",{ref:G,style:{display:"grid",gridTemplateColumns:bn,padding:`${g}px ${s}px`,borderBottom:"1px solid "+t.divider,background:t.paper2},children:[["Report","Type","Status","Date"].map(k=>n.jsx("div",{style:A,children:k},k)),n.jsx("div",{})]}),n.jsx("div",{ref:R,style:{display:"flex",flexDirection:"column",flex:1,minHeight:0},children:J.map(k=>n.jsxs("div",{style:{display:"grid",gridTemplateColumns:bn,padding:`${g}px ${s}px`,borderBottom:"1px solid "+t.divider,alignItems:"center"},children:[n.jsx("div",{style:{fontSize:H,color:t.textPrimary,fontWeight:D},children:k.name}),n.jsx("div",{style:{fontSize:S,color:t.textSecondary},children:k.type}),n.jsx("div",{children:n.jsx("span",{style:{padding:"4px 11px",borderRadius:999,fontSize:C,fontWeight:D,background:k.sb,color:k.sc,whiteSpace:"nowrap"},children:k.status})}),n.jsx("div",{style:{fontSize:S,color:t.textSecondary},children:k.date}),n.jsx("div",{children:n.jsx("button",{style:{fontSize:C,color:Q,background:t.pContainer,border:"none",fontWeight:D,padding:"5px 11px",borderRadius:i,cursor:"pointer"},children:"↓ PDF"})})]},k.name))})]})]})]})}const vn=({size:e})=>n.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.6,strokeLinecap:"round",strokeLinejoin:"round",children:[n.jsx("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2"}),n.jsx("circle",{cx:"8.5",cy:"8.5",r:"1.5"}),n.jsx("path",{d:"m21 15-5-5L5 21"})]});function bl(){const e=ve(),r=L(z=>z.settings),{t,rad:o,radSm:i,pad:s,tH1:a,tBody:l,tBodySm:c,tCaption:g,wH1:f,headLH:x,accentBg:m,btnText:h,btnShadow:b,bwEmph:u,pMain:y,iconInitials:v,hasLoginImage:E,loginCenteredGrad:H,loginScrimGradC:S}=e,C=r.fontFamily+",sans-serif",B=e.hc1||t.textPrimary,D=t.pContrast,$=e.cardBorder==="none"?"none":e.cardBorder,X=r.logoMode==="image"&&!!r.logoUrl,Q=e.isDark?t.paper2:"#ffffff",Y=r.loginPanelColor||t.bgDefault,d=r.loginImgOpacity>0?r.loginImgOpacity:1,I=E?n.jsx("img",{src:r.loginImage,alt:"",style:{position:"absolute",inset:0,width:"100%",height:"100%",objectFit:"cover",zIndex:0,opacity:d}}):null,P={background:t.paper,border:$,borderRadius:o,boxShadow:e.cardShadow,padding:s,display:"flex",flexDirection:"column",gap:20},W=z=>({position:"relative",background:t.paper2,border:"1.5px solid "+(z?y:t.outline),borderRadius:i});return r.loginLayout==="centered"?n.jsxs("div",{style:{minHeight:560,background:H,display:"flex",alignItems:"center",justifyContent:"center",padding:40,position:"relative",overflow:"hidden",fontFamily:C,borderRadius:o},children:[I,E&&n.jsx("div",{style:{position:"absolute",inset:0,background:S,zIndex:0}}),n.jsxs("div",{style:{position:"relative",zIndex:1,width:"100%",maxWidth:380,background:t.paper,border:$,borderRadius:o,boxShadow:"0 24px 60px rgba(0,0,0,.35)",padding:s,display:"flex",flexDirection:"column",gap:20,alignItems:"center"},children:[n.jsx("div",{style:{width:72,height:72,borderRadius:20,background:r.iconColor,display:"grid",placeItems:"center",boxShadow:"0 6px 18px "+r.iconColor+"55"},children:n.jsx("span",{style:{color:"#fff",fontSize:24,fontWeight:u,letterSpacing:"-1px"},children:v})}),n.jsxs("div",{style:{width:"100%",display:"flex",flexDirection:"column",gap:14},children:[n.jsxs("div",{style:{position:"relative",border:"1.5px solid "+t.outline,borderRadius:i,padding:"13px 14px"},children:[n.jsx("span",{style:{position:"absolute",top:-8,left:11,background:t.paper,padding:"0 5px",fontSize:11,color:t.textSecondary},children:"Email"}),n.jsx("span",{style:{fontSize:l,color:t.textPrimary},children:"admin@company.com"})]}),n.jsxs("div",{style:{position:"relative",border:"1.5px solid "+t.outline,borderRadius:i,padding:"13px 14px"},children:[n.jsx("span",{style:{position:"absolute",top:-8,left:11,background:t.paper,padding:"0 5px",fontSize:11,color:t.textSecondary},children:"Password"}),n.jsx("span",{style:{fontSize:l,color:t.textPrimary,letterSpacing:3},children:"••••••••"})]}),n.jsx("button",{style:{padding:13,borderRadius:i,border:"none",background:m,color:h,fontSize:l,fontWeight:u,textTransform:"uppercase",letterSpacing:".5px",boxShadow:b,cursor:"pointer"},children:"Sign in"})]})]})]}):n.jsxs("div",{style:{display:"grid",gridTemplateColumns:"3fr 1fr",minHeight:560,fontFamily:C,borderRadius:o,overflow:"hidden"},children:[n.jsxs("div",{style:{background:Q,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",padding:"48px 40px",gap:22,position:"relative",overflow:"hidden"},children:[I,!E&&n.jsxs("div",{style:{position:"absolute",inset:0,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:12,color:t.textSecondary,border:"1.5px dashed "+t.outline,padding:24,boxSizing:"border-box"},children:[n.jsx(vn,{size:46}),n.jsx("div",{style:{fontSize:14,fontWeight:u,color:t.textPrimary},children:"No brand image"}),n.jsx("div",{style:{fontSize:12,color:t.textSecondary,textAlign:"center",maxWidth:220},children:"Upload an image in the Login Screen settings to fill this panel."})]})]}),n.jsxs("div",{style:{background:Y,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:22,padding:"48px 40px"},children:[X?n.jsx("img",{src:r.logoUrl,alt:r.appName,style:{maxHeight:64,maxWidth:200,objectFit:"contain"}}):n.jsxs("div",{style:{display:"inline-flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:6,maxWidth:200,maxHeight:64,border:"1.5px dashed "+t.outline,borderRadius:i,boxSizing:"border-box",color:t.textSecondary,padding:"8px 16px"},children:[n.jsx(vn,{size:20}),n.jsx("span",{style:{fontSize:g,fontWeight:u,color:t.textSecondary,whiteSpace:"nowrap"},children:"No logo uploaded"})]}),n.jsxs("div",{style:{width:"100%",maxWidth:340,...P},children:[n.jsxs("div",{style:{textAlign:"center"},children:[n.jsx("div",{style:{fontSize:a,lineHeight:x,fontWeight:f,color:B,letterSpacing:"-.4px",marginBottom:5},children:"Welcome back"}),n.jsx("div",{style:{fontSize:c,color:t.textSecondary},children:"Sign in to continue"})]}),n.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:16},children:[n.jsxs("div",{children:[n.jsx("div",{style:{fontSize:g,fontWeight:u,color:t.textPrimary,marginBottom:7},children:"Email Address"}),n.jsxs("div",{style:{...W(!1),padding:"12px 14px 12px 40px"},children:[n.jsx("span",{style:{position:"absolute",left:13,top:"50%",transform:"translateY(-50%)",color:t.textSecondary,fontSize:14},children:"✉"}),n.jsx("span",{style:{fontSize:l,color:t.textPrimary},children:"admin@company.com"})]})]}),n.jsxs("div",{children:[n.jsx("div",{style:{fontSize:g,fontWeight:u,color:t.textPrimary,marginBottom:7},children:"Password"}),n.jsxs("div",{style:{...W(!0),padding:"12px 40px 12px 40px"},children:[n.jsx("span",{style:{position:"absolute",left:13,top:"50%",transform:"translateY(-50%)",color:t.textSecondary,fontSize:14},children:"🔒"}),n.jsx("span",{style:{fontSize:l,color:t.textPrimary,letterSpacing:3},children:"••••••••"}),n.jsx("span",{style:{position:"absolute",right:13,top:"50%",transform:"translateY(-50%)",color:t.textSecondary,fontSize:14},children:"👁"})]})]}),n.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between"},children:[n.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[n.jsx("div",{style:{width:17,height:17,borderRadius:4,background:y,display:"grid",placeItems:"center",color:D,fontSize:11,fontWeight:u},children:"✓"}),n.jsx("span",{style:{fontSize:c,color:t.textPrimary},children:"Remember me"})]}),n.jsx("span",{style:{fontSize:c,color:y,fontWeight:u},children:"Forgot password?"})]}),n.jsxs("button",{style:{padding:13,borderRadius:i,border:"none",background:m,color:h,fontSize:l,fontWeight:u,letterSpacing:".3px",boxShadow:b,marginTop:2,display:"flex",alignItems:"center",justifyContent:"center",gap:8,cursor:"pointer"},children:["Login ",n.jsx("span",{style:{fontSize:15},children:"→"})]})]}),n.jsxs("div",{style:{textAlign:"center",fontSize:g,color:t.textSecondary},children:["Powered by ",n.jsx("span",{style:{color:y,fontWeight:u},children:r.appName})," © 2026"]})]})]})]})}function vl(){const e=ve(),r=L(b=>b.settings),[t,o]=_.useState(!1);if(t)return null;const{t:i,npos:s,nacc:a,toastDeco:l,toastBg:c,rad:g,radSm:f,tBodySm:x,tCaption:m}=e,h=(r.toastW>0?r.toastW:252)+"px";return n.jsxs("div",{style:{position:"absolute",zIndex:40,width:h,maxWidth:"70%",boxSizing:"border-box",background:c,borderRadius:g,display:"flex",gap:"10px",alignItems:"flex-start",padding:"12px 13px",fontFamily:r.fontFamily+",sans-serif",...s,...l},children:[n.jsx("div",{style:{width:"30px",height:"30px",borderRadius:f,background:a.icbg,color:a.icc,display:"grid",placeItems:"center",flexShrink:0,fontSize:"15px",fontWeight:800},children:"!"}),n.jsxs("div",{style:{flex:1,minWidth:0},children:[n.jsx("div",{style:{fontSize:x+"px",fontWeight:700,color:i.textPrimary,marginBottom:"2px"},children:"Low stock alert"}),n.jsx("div",{style:{fontSize:m+"px",color:i.textSecondary,lineHeight:1.4},children:"Widget Pro is down to 12 units left."})]}),r.notifAutoDismiss&&n.jsx("div",{title:"Auto-dismiss countdown",style:{flexShrink:0,marginTop:"1px",minWidth:"26px",height:"20px",padding:"0 7px",borderRadius:"999px",background:ce(a.dot,.14),color:a.dot,fontSize:m-.5+"px",fontWeight:800,display:"grid",placeItems:"center",fontVariantNumeric:"tabular-nums"},children:(r.autoDismissSec>0?r.autoDismissSec:8)+"s"}),n.jsx("button",{title:"Dismiss notification",onClick:()=>o(!0),style:{flexShrink:0,width:"20px",height:"20px",marginTop:"1px",border:"none",background:"transparent",color:i.textSecondary,cursor:"pointer",borderRadius:"6px",display:"grid",placeItems:"center",padding:0,lineHeight:1},children:n.jsx("svg",{width:13,height:13,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2.4,strokeLinecap:"round",children:n.jsx("path",{d:"M18 6 6 18M6 6l12 12"})})})]})}const Sl=[75,90,100,125];function Cl(){var f;const e=Ke(x=>x.previewScreen),r=L(x=>x.settings.edgePadPx)||0,t=e==="operations"?0:r,[o,i]=_.useState("fit"),s=_.useRef(null),a=_.useRef(null),[l,c]=_.useState(100);_.useLayoutEffect(()=>{const x=s.current,m=a.current;if(!x||!m)return;const h=()=>{const E=getComputedStyle(x),H=(parseFloat(E.paddingTop)||0)+(parseFloat(E.paddingBottom)||0);if(o!=="fit"){const d=o/100;m.style.zoom=String(d);const I=x.clientHeight-H;m.style.minHeight=(I>0?Math.floor(I/d):0)+"px",c(o);return}m.style.zoom="1",m.style.minHeight="0px",m.offsetHeight;const S=(parseFloat(E.paddingLeft)||0)+(parseFloat(E.paddingRight)||0),C=x.clientWidth-S,B=x.clientHeight-H,D=m.scrollWidth,$=m.scrollHeight;if(D<=0||$<=0||C<=0||B<=0)return;const X=Math.min(C/D,B/$,1),Q=X<.985?Math.max(.36,X):1;m.style.zoom=String(Q);const Y=Math.min(C/D,1);m.style.minHeight=Math.floor(B/Math.max(Y,.36))+"px",c(Math.round(Q*100))};let b=0,u=0;const y=()=>{h(),++u<36&&(b=requestAnimationFrame(y))};y();const v=new ResizeObserver(h);return v.observe(x),v.observe(m),()=>{cancelAnimationFrame(b),v.disconnect()}},[o,t,e]);const g=((f=qs.find(x=>x.key===e))==null?void 0:f.label)??"";return n.jsxs(p.Box,{sx:{flex:1,minWidth:0,display:"flex",flexDirection:"column",bgcolor:"background.default"},children:[n.jsxs(p.Box,{sx:{px:2.5,py:1.25,borderBottom:"1px solid",borderColor:"divider",display:"flex",alignItems:"center",gap:1.5,bgcolor:"background.paper"},children:[n.jsx(Qs,{sx:{fontSize:22,color:"text.secondary"}}),n.jsxs(p.Typography,{variant:"h5",sx:{flex:1,fontSize:18,fontWeight:700,letterSpacing:"-.2px"},children:["Previewing ",g]}),n.jsxs(p.Select,{size:"small",value:o,onChange:x=>i(x.target.value==="fit"?"fit":Number(x.target.value)),sx:{minWidth:128,fontSize:13,fontWeight:600,"& .MuiSelect-select":{py:.75}},children:[n.jsxs(p.MenuItem,{value:"fit",children:["Fit (",l,"%)"]}),Sl.map(x=>n.jsxs(p.MenuItem,{value:x,children:[x,"%"]},x))]})]}),n.jsxs(p.Box,{ref:s,sx:{flex:1,overflow:"auto",p:`${t}px`,position:"relative",bgcolor:"background.default"},children:[n.jsxs(p.Box,{ref:a,sx:{width:"100%",display:"flex",flexDirection:"column","& > *":{flex:"1 1 0%",minHeight:0}},children:[e==="dashboard"&&n.jsx(rl,{}),e==="orders"&&n.jsx(ol,{}),e==="reports"&&n.jsx(yl,{}),e==="cameras"&&n.jsx(dl,{}),e==="operations"&&n.jsx(pl,{}),e==="components"&&n.jsx(il,{}),e==="login"&&n.jsx(bl,{})]}),e!=="login"&&n.jsx(vl,{})]})]})}const jl=300,wl=520;function Tl(){const[e,r]=_.useState(!0),[t,o]=_.useState(300),[i,s]=_.useState(!1),a=L(y=>y.isDirty),l=L(y=>y.captureBaseline),c=L(y=>y.restoreBaseline),g=He(L(y=>y.settings.mode)),f=L(y=>y.settings.customFonts),x=L(y=>y.settings.customHeadFonts),m=_.useRef(null);_.useEffect(()=>{mn(f),mn(x)},[f,x]);const h=y=>{y.preventDefault(),m.current={x:y.clientX,w:t};const v=H=>{if(!m.current)return;const S=Math.max(jl,Math.min(wl,m.current.w+(H.clientX-m.current.x)));o(S)},E=()=>{m.current=null,window.removeEventListener("mousemove",v),window.removeEventListener("mouseup",E)};window.addEventListener("mousemove",v),window.addEventListener("mouseup",E)},b=()=>{a()?s(!0):r(!1)},u=()=>{r(!0),l()};return n.jsxs(p.Box,{sx:{position:"relative",width:"100%",height:"100%",display:"flex",flexDirection:"column",bgcolor:"background.paper"},children:[n.jsx(p.Box,{sx:{flex:1,minHeight:0,display:"flex"},children:n.jsxs(p.Box,{sx:{flex:1,minWidth:0,display:"flex",bgcolor:"background.default",borderTop:"1px solid",borderColor:"divider"},children:[e?n.jsxs(p.Box,{sx:{display:"flex",flexShrink:0},children:[n.jsx(p.Box,{sx:{width:t,flexShrink:0,borderRight:`1px solid ${g.studioBd}`,display:"flex",flexDirection:"column",bgcolor:g.card,overflow:"auto",scrollbarWidth:"none",msOverflowStyle:"none","&::-webkit-scrollbar":{display:"none"}},children:n.jsx(Xs,{onClose:b})}),n.jsx(p.Box,{onMouseDown:h,sx:{width:5,cursor:"col-resize",flexShrink:0,bgcolor:"divider",opacity:.4,"&:hover":{opacity:1,bgcolor:"primary.main"}}})]}):n.jsx(p.Tooltip,{title:"Open Theme Studio",placement:"right",arrow:!0,slotProps:{popper:{style:{pointerEvents:"none"}}},children:n.jsx(p.IconButton,{onClick:u,sx:{position:"absolute",left:68,bottom:56,zIndex:10,bgcolor:"primary.main",color:"primary.contrastText",boxShadow:4,"&:hover":{bgcolor:"primary.dark"}},children:n.jsx(gs,{})})}),n.jsx(Cl,{})]})}),n.jsxs(p.Dialog,{open:i,onClose:()=>s(!1),PaperProps:{sx:{borderRadius:3,width:300,p:2.5}},children:[n.jsx(p.Typography,{sx:{fontSize:15,fontWeight:800,mb:.75},children:"Save changes?"}),n.jsx(p.Typography,{sx:{fontSize:12.5,color:"text.secondary",lineHeight:1.5,mb:2.25},children:"You've made changes to the theme. Do you want to save them before leaving?"}),n.jsxs(p.Box,{sx:{display:"flex",flexDirection:"column",gap:1},children:[n.jsx(p.Box,{component:"button",onClick:()=>{l(),s(!1),r(!1)},sx:{p:1.4,borderRadius:2.5,border:"none",bgcolor:"primary.main",color:"primary.contrastText",fontSize:13,fontWeight:700,cursor:"pointer"},children:"Save & exit"}),n.jsx(p.Box,{component:"button",onClick:()=>{c(),s(!1),r(!1)},sx:{p:1.4,borderRadius:2.5,border:"1px solid",borderColor:"divider",bgcolor:"action.hover",color:"text.secondary",fontSize:13,fontWeight:600,cursor:"pointer"},children:"Discard & exit"}),n.jsx(p.Box,{component:"button",onClick:()=>s(!1),sx:{p:1.1,borderRadius:2.5,border:"none",bgcolor:"transparent",color:"text.secondary",fontSize:12.5,fontWeight:600,cursor:"pointer"},children:"Keep editing"})]})]})]})}function kl(e){const r=kr(e),t=r.t,o=`${r.headFam},sans-serif`,i=`${r.bodyFam},sans-serif`,s=a=>({fontFamily:o,fontSize:a,fontWeight:r.wH1,lineHeight:r.headLH});if(typeof window<"u"&&typeof document<"u"){const a=["Roboto","Inter","DM Sans","Manrope","Plus Jakarta Sans","Nunito Sans","Figtree"],c=[e.fontFamily,e.headingFont].filter(Boolean).map(f=>f.replace(/"/g,"").replace(/'/g,"")),g=Array.from(new Set(c)).filter(f=>a.includes(f));if(g.length>0){const f="dynamic-google-fonts";let x=document.getElementById(f);const h=`https://fonts.googleapis.com/css2?${g.map(b=>`family=${b.replace(/ /g,"+")}:wght@300;400;500;600;700;800;900`).join("&")}&display=swap`;x||(x=document.createElement("link"),x.id=f,x.rel="stylesheet",document.head.appendChild(x)),x.href=h}}return Ln({palette:{mode:e.mode,primary:{main:r.pMain,dark:r.pal[700],light:r.pal[300],contrastText:t.pContrast},secondary:{main:r.sMain,dark:r.spal[700],light:r.spal[300],contrastText:t.sContrast},success:{main:e.successHex},warning:{main:e.warningHex},info:{main:e.infoHex},error:{main:e.errorHex},background:{default:t.bgDefault,paper:t.paper},text:{primary:t.textPrimary,secondary:t.textSecondary,disabled:t.textDisabled},divider:t.divider},shape:{borderRadius:r.r},typography:{fontFamily:i,fontSize:r.base,h1:s(r.tH1),h2:s(r.tH2),h3:s(r.tTitle),h4:s(r.tH4),h5:s(r.tH5),h6:s(r.tH6),body1:{fontFamily:i,fontSize:r.tBody,lineHeight:r.bodyLH,fontWeight:r.bodyWeightEff},body2:{fontFamily:i,fontSize:r.tBodySm,lineHeight:r.bodyLH,fontWeight:r.bodyWeightEff},caption:{fontFamily:i,fontSize:r.tCaption,lineHeight:r.bodyLH},button:{textTransform:r.btnCase,fontWeight:r.bwEmph}},components:{MuiCssBaseline:{styleOverrides:{"button, input, textarea, select":{fontFamily:"inherit"}}},MuiCard:{styleOverrides:{root:{borderRadius:r.r,border:r.cardBorder==="none"?"none":r.cardBorder,boxShadow:r.cardShadow,backgroundImage:"none"}}},MuiCardHeader:{styleOverrides:{root:{backgroundColor:r.cardHdrBg,borderBottom:r.cardHdrBorder,boxShadow:r.cardHdrAccent}}},MuiDialog:{styleOverrides:{paper:{borderRadius:r.r,border:r.cardBorder==="none"?"none":r.cardBorder,boxShadow:r.cardShadow,backgroundImage:"none"}}},MuiDialogTitle:{styleOverrides:{root:{backgroundColor:r.cardHdrBg,borderBottom:r.cardHdrBorder,boxShadow:r.cardHdrAccent}}},MuiButton:{styleOverrides:{root:{borderRadius:r.r,boxShadow:"none"}},defaultProps:{disableElevation:!0},variants:e.accentGradient?[{props:{variant:"contained"},style:{backgroundImage:r.accentBg}}]:[]},MuiChip:{styleOverrides:{root:{borderRadius:999,fontWeight:e.statusBold?700:500}}}},urmTable:{rowPaddingY:r.table.rowPy,cellPaddingX:r.table.cellPx,headerBg:r.table.headBg,rowDivider:r.table.rowBorder,colDivider:r.table.colBorder,cellAlignH:e.tableCellAlignH,cellAlignV:e.tableCellAlignV,striped:e.tableStripe,stripeBg:r.table.stripeBg},tokens:{toastW:e.toastW>0?e.toastW:void 0,cardBorder:r.toastDeco.border,cardShadow:r.toastDeco.boxShadow,cardBodyBorder:r.cardBorder==="none"?"none":r.cardBorder,cardBodyShadow:r.cardShadow,cardHdrBg:r.cardHdrBg,cardHdrBorder:r.cardHdrBorder,cardHdrAccent:r.cardHdrAccent,cardHeader:e.cardHeader,status:{errSoft:r.errSoft,warnSoft:r.warnSoft,infoSoft:r.infoSoft,sucSoft:r.sucSoft,errTxt:r.errTxt,warnTxt:r.warnTxt,infoTxt:r.infoTxt,sucTxt:r.sucTxt},notifPosition:e.notifPosition,notifStyle:e.notifStyle,notifAccent:e.notifAccent,notifAutoDismiss:e.notifAutoDismiss,toastBg:r.toastBg,autoDismissSec:e.autoDismissSec>0?e.autoDismissSec:void 0,statusBold:e.statusBold,cardHdrHex:e.cardHdrHex||void 0,containerPad:r.screenPad,cardGap:r.gap,edgePad:e.edgePadPx,highlight:t.highlight,highlightSoft:t.highlightSoft,highlightBd:t.highlightBd}})}exports.DEFAULT_SETTINGS=Re;exports.ThemeStudio=Tl;exports.buildMuiTheme=kl;exports.useThemeStore=L;
|