@malloy-publisher/server 0.9.6 → 0.9.7

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.
Files changed (21) hide show
  1. package/dist/app/api-doc.yaml +140 -16
  2. package/dist/app/assets/{EnvironmentPage-wGTml4WZ.js → EnvironmentPage-V6cQ_Kpr.js} +1 -1
  3. package/dist/app/assets/{HomePage-BPFJHBxN.js → HomePage-BM31X4Y8.js} +1 -1
  4. package/dist/app/assets/{MainPage-CNLgQje2.js → MainPage-CQW3P4wB.js} +1 -1
  5. package/dist/app/assets/{ModelPage-Br6I_s4J.js → ModelPage-dBHaHb6u.js} +2 -2
  6. package/dist/app/assets/{PackagePage-B6lmG1Uq.js → PackagePage-B-ruDCyR.js} +1 -1
  7. package/dist/app/assets/{RenderedResult-BUb2Xvr2.es-17Y63pbB.js → RenderedResult-CkUS04tl.es-CNz9JsEK.js} +1 -1
  8. package/dist/app/assets/{RouteError-B4yUUZFj.js → RouteError-DLJlCtRG.js} +1 -1
  9. package/dist/app/assets/{ThemeEditorPage-CjK8EVnV.js → ThemeEditorPage-Ck4rJ1vv.js} +1 -1
  10. package/dist/app/assets/{ToggleButtonGroup-BKiI79mw.js → ToggleButtonGroup-Bwj7gIJm.js} +1 -1
  11. package/dist/app/assets/{documentRoutes-D_78AAbq.js → documentRoutes-DGm_-EUy.js} +1 -1
  12. package/dist/app/assets/{index-B3woRPfQ.js → index-BcsfsLm3.js} +1 -1
  13. package/dist/app/assets/{index-dQ3jNgKw.js → index-D3HZqxOW.js} +1 -1
  14. package/dist/app/assets/{index-BIqIsMFr.js → index-hnA8HjeH.js} +5 -5
  15. package/dist/app/assets/{index-CfX148tj.js → index-wawGd6k1.js} +1 -1
  16. package/dist/app/assets/{index.es-Bhhg6pWY.js → index.es-B2kJpnhe.js} +1 -1
  17. package/dist/app/index.html +1 -1
  18. package/dist/package_load_worker.mjs +113 -9
  19. package/dist/server.mjs +644 -165
  20. package/package.json +2 -2
  21. package/dist/sshcrypto-cqb52edz.node +0 -0
@@ -1,4 +1,4 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-dQ3jNgKw.js","assets/index-CRAwrhYM.js","assets/index-CfX148tj.js","assets/core-B8oMW4sm.es-hOkwvru5.js","assets/engine-oniguruma-C4vnmooL.es-jdkXmgTr.js","assets/index-B3woRPfQ.js","assets/index-sKcoT1e_.js","assets/MainPage-CNLgQje2.js","assets/documentRoutes-D_78AAbq.js","assets/ModelPage-Br6I_s4J.js","assets/PackagePage-B6lmG1Uq.js","assets/ThemeEditorPage-CjK8EVnV.js","assets/ToggleButtonGroup-BKiI79mw.js"])))=>i.map(i=>d[i]);
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-D3HZqxOW.js","assets/index-CRAwrhYM.js","assets/index-wawGd6k1.js","assets/core-B8oMW4sm.es-hOkwvru5.js","assets/engine-oniguruma-C4vnmooL.es-jdkXmgTr.js","assets/index-BcsfsLm3.js","assets/index-sKcoT1e_.js","assets/MainPage-CQW3P4wB.js","assets/documentRoutes-DGm_-EUy.js","assets/ModelPage-dBHaHb6u.js","assets/PackagePage-B-ruDCyR.js","assets/ThemeEditorPage-Ck4rJ1vv.js","assets/ToggleButtonGroup-Bwj7gIJm.js"])))=>i.map(i=>d[i]);
2
2
  function vj(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const o in r)if(o!=="default"&&!(o in e)){const a=Object.getOwnPropertyDescriptor(r,o);a&&Object.defineProperty(e,o,a.get?a:{enumerable:!0,get:()=>r[o]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))r(o);new MutationObserver(o=>{for(const a of o)if(a.type==="childList")for(const i of a.addedNodes)i.tagName==="LINK"&&i.rel==="modulepreload"&&r(i)}).observe(document,{childList:!0,subtree:!0});function n(o){const a={};return o.integrity&&(a.integrity=o.integrity),o.referrerPolicy&&(a.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?a.credentials="include":o.crossOrigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function r(o){if(o.ep)return;o.ep=!0;const a=n(o);fetch(o.href,a)}})();var rbe=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function IC(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var q1={exports:{}},_h={};/**
3
3
  * @license React
4
4
  * react-jsx-runtime.production.js
@@ -346,7 +346,7 @@ const theme = ${JSON.stringify(t,null,2)};
346
346
  theme.breakpoints = createBreakpoints(theme.breakpoints || {});
347
347
  theme.transitions = createTransitions(theme.transitions || {});
348
348
 
349
- export default theme;`}function oA(e){return typeof e=="number"?`${(e*100).toFixed(0)}%`:`calc((${e}) * 100%)`}const Dne=e=>{if(!Number.isNaN(+e))return+e;const t=e.match(/\d*\.?\d+/g);if(!t)return 0;let n=0;for(let r=0;r<t.length;r+=1)n+=+t[r];return n};function jne(e){Object.assign(e,{alpha(t,n){const r=this||e;return r.colorSpace?`oklch(from ${t} l c h / ${typeof n=="string"?`calc(${n})`:n})`:r.vars?`rgba(${t.replace(/var\(--([^,\s)]+)(?:,[^)]+)?\)+/g,"var(--$1Channel)")} / ${typeof n=="string"?`calc(${n})`:n})`:Db(t,Dne(n))},lighten(t,n){const r=this||e;return r.colorSpace?`color-mix(in ${r.colorSpace}, ${t}, #fff ${oA(n)})`:Z0(t,n)},darken(t,n){const r=this||e;return r.colorSpace?`color-mix(in ${r.colorSpace}, ${t}, #000 ${oA(n)})`:X0(t,n)}})}function nC(e={},...t){const{breakpoints:n,mixins:r={},spacing:o,palette:a={},transitions:i={},typography:l={},shape:c,colorSpace:f,...u}=e;if(e.vars&&e.generateThemeVars===void 0)throw new Error(Kl(20));const h=dE({...a,colorSpace:f}),m=fE(e);let v=ha(m,{mixins:xne(m.breakpoints,r),palette:h,shadows:Rne.slice(),typography:wne(h,l),transitions:$ne(i),zIndex:{...Pne}});return v=ha(v,u),v=t.reduce((b,x)=>ha(b,x),v),v.unstable_sxConfig={...ey,...u?.unstable_sxConfig},v.unstable_sx=function(b){return vp({sx:b,theme:this})},v.toRuntimeSource=sz,jne(v),v}function rC(e){let t;return e<1?t=5.11916*e**2:t=4.5*Math.log(e+1)+2,Math.round(t*10)/1e3}const Nne=[...Array(25)].map((e,t)=>{if(t===0)return"none";const n=rC(t);return`linear-gradient(rgba(255 255 255 / ${n}), rgba(255 255 255 / ${n}))`});function lz(e){return{inputPlaceholder:e==="dark"?.5:.42,inputUnderline:e==="dark"?.7:.42,switchTrackDisabled:e==="dark"?.2:.12,switchTrack:e==="dark"?.3:.38}}function cz(e){return e==="dark"?Nne:[]}function Ine(e){const{palette:t={mode:"light"},opacity:n,overlays:r,colorSpace:o,...a}=e,i=dE({...t,colorSpace:o});return{palette:i,opacity:{...lz(i.mode),...n},overlays:r||cz(i.mode),...a}}function Lne(e){return!!e[0].match(/(cssVarPrefix|colorSchemeSelector|modularCssLayers|rootSelector|typography|mixins|breakpoints|direction|transitions)/)||!!e[0].match(/sxConfig$/)||e[0]==="palette"&&!!e[1]?.match(/(mode|contrastThreshold|tonalOffset)/)}const zne=e=>[...[...Array(25)].map((t,n)=>`--${e?`${e}-`:""}overlays-${n}`),`--${e?`${e}-`:""}palette-AppBar-darkBg`,`--${e?`${e}-`:""}palette-AppBar-darkColor`],Fne=e=>(t,n)=>{const r=e.rootSelector||":root",o=e.colorSchemeSelector;let a=o;if(o==="class"&&(a=".%s"),o==="data"&&(a="[data-%s]"),o?.startsWith("data-")&&!o.includes("%s")&&(a=`[${o}="%s"]`),e.defaultColorScheme===t){if(t==="dark"){const i={};return zne(e.cssVarPrefix).forEach(l=>{i[l]=n[l],delete n[l]}),a==="media"?{[r]:n,"@media (prefers-color-scheme: dark)":{[r]:i}}:a?{[a.replace("%s",t)]:i,[`${r}, ${a.replace("%s",t)}`]:n}:{[r]:{...n,...i}}}if(a&&a!=="media")return`${r}, ${a.replace("%s",String(t))}`}else if(t){if(a==="media")return{[`@media (prefers-color-scheme: ${String(t)})`]:{[r]:n}};if(a)return a.replace("%s",String(t))}return r};function _ne(e,t){t.forEach(n=>{e[n]||(e[n]={})})}function ft(e,t,n){!e[t]&&n&&(e[t]=n)}function Fm(e){return typeof e!="string"||!e.startsWith("hsl")?e:tz(e)}function Ul(e,t){`${t}Channel`in e||(e[`${t}Channel`]=zm(Fm(e[t])))}function Une(e){return typeof e=="number"?`${e}px`:typeof e=="string"||typeof e=="function"||Array.isArray(e)?e:"8px"}const Ys=e=>{try{return e()}catch{}},Bne=(e="mui")=>zN(e);function BS(e,t,n,r,o){if(!n)return;n=n===!0?{}:n;const a=o==="dark"?"dark":"light";if(!r){t[o]=Ine({...n,palette:{mode:a,...n?.palette},colorSpace:e});return}const{palette:i,...l}=nC({...r,palette:{mode:a,...n?.palette},colorSpace:e});return t[o]={...n,palette:i,opacity:{...lz(a),...n?.opacity},overlays:n?.overlays||cz(a)},l}function Vne(e={},...t){const{colorSchemes:n={light:!0},defaultColorScheme:r,disableCssColorScheme:o=!1,cssVarPrefix:a="mui",nativeColor:i=!1,shouldSkipGeneratingVar:l=Lne,colorSchemeSelector:c=n.light&&n.dark?"media":void 0,rootSelector:f=":root",...u}=e,h=Object.keys(n)[0],m=r||(n.light&&h!=="light"?"light":h),v=Bne(a),{[m]:b,light:x,dark:w,...S}=n,R={...S};let E=b;if((m==="dark"&&!("dark"in n)||m==="light"&&!("light"in n))&&(E=!0),!E)throw new Error(Kl(21,m));let M;i&&(M="oklch");const $=BS(M,R,E,u,m);x&&!R.light&&BS(M,R,x,void 0,"light"),w&&!R.dark&&BS(M,R,w,void 0,"dark");let D={defaultColorScheme:m,...$,cssVarPrefix:a,colorSchemeSelector:c,rootSelector:f,getCssVar:v,colorSchemes:R,font:{...yne($.typography),...$.font},spacing:Une(u.spacing)};Object.keys(D.colorSchemes).forEach(L=>{const C=D.colorSchemes[L].palette,j=V=>{const A=V.split("-"),Y=A[1],W=A[2];return v(V,C[Y][W])};C.mode==="light"&&(ft(C.common,"background","#fff"),ft(C.common,"onBackground","#000")),C.mode==="dark"&&(ft(C.common,"background","#000"),ft(C.common,"onBackground","#fff"));function N(V,A,Y){if(M){let W;return V===Lu&&(W=`transparent ${((1-Y)*100).toFixed(0)}%`),V===Mr&&(W=`#000 ${(Y*100).toFixed(0)}%`),V===$r&&(W=`#fff ${(Y*100).toFixed(0)}%`),`color-mix(in ${M}, ${A}, ${W})`}return V(A,Y)}if(_ne(C,["Alert","AppBar","Avatar","Button","Chip","FilledInput","LinearProgress","Skeleton","Slider","SnackbarContent","SpeedDialAction","StepConnector","StepContent","Switch","TableCell","Tooltip"]),C.mode==="light"){ft(C.Alert,"errorColor",N(Mr,C.error.light,.6)),ft(C.Alert,"infoColor",N(Mr,C.info.light,.6)),ft(C.Alert,"successColor",N(Mr,C.success.light,.6)),ft(C.Alert,"warningColor",N(Mr,C.warning.light,.6)),ft(C.Alert,"errorFilledBg",j("palette-error-main")),ft(C.Alert,"infoFilledBg",j("palette-info-main")),ft(C.Alert,"successFilledBg",j("palette-success-main")),ft(C.Alert,"warningFilledBg",j("palette-warning-main")),ft(C.Alert,"errorFilledColor",Ys(()=>C.getContrastText(C.error.main))),ft(C.Alert,"infoFilledColor",Ys(()=>C.getContrastText(C.info.main))),ft(C.Alert,"successFilledColor",Ys(()=>C.getContrastText(C.success.main))),ft(C.Alert,"warningFilledColor",Ys(()=>C.getContrastText(C.warning.main))),ft(C.Alert,"errorStandardBg",N($r,C.error.light,.9)),ft(C.Alert,"infoStandardBg",N($r,C.info.light,.9)),ft(C.Alert,"successStandardBg",N($r,C.success.light,.9)),ft(C.Alert,"warningStandardBg",N($r,C.warning.light,.9)),ft(C.Alert,"errorIconColor",j("palette-error-main")),ft(C.Alert,"infoIconColor",j("palette-info-main")),ft(C.Alert,"successIconColor",j("palette-success-main")),ft(C.Alert,"warningIconColor",j("palette-warning-main")),ft(C.AppBar,"defaultBg",j("palette-grey-100")),ft(C.Avatar,"defaultBg",j("palette-grey-400")),ft(C.Button,"inheritContainedBg",j("palette-grey-300")),ft(C.Button,"inheritContainedHoverBg",j("palette-grey-A100")),ft(C.Chip,"defaultBorder",j("palette-grey-400")),ft(C.Chip,"defaultAvatarColor",j("palette-grey-700")),ft(C.Chip,"defaultIconColor",j("palette-grey-700")),ft(C.FilledInput,"bg","rgba(0, 0, 0, 0.06)"),ft(C.FilledInput,"hoverBg","rgba(0, 0, 0, 0.09)"),ft(C.FilledInput,"disabledBg","rgba(0, 0, 0, 0.12)"),ft(C.LinearProgress,"primaryBg",N($r,C.primary.main,.62)),ft(C.LinearProgress,"secondaryBg",N($r,C.secondary.main,.62)),ft(C.LinearProgress,"errorBg",N($r,C.error.main,.62)),ft(C.LinearProgress,"infoBg",N($r,C.info.main,.62)),ft(C.LinearProgress,"successBg",N($r,C.success.main,.62)),ft(C.LinearProgress,"warningBg",N($r,C.warning.main,.62)),ft(C.Skeleton,"bg",M?N(Lu,C.text.primary,.11):`rgba(${j("palette-text-primaryChannel")} / 0.11)`),ft(C.Slider,"primaryTrack",N($r,C.primary.main,.62)),ft(C.Slider,"secondaryTrack",N($r,C.secondary.main,.62)),ft(C.Slider,"errorTrack",N($r,C.error.main,.62)),ft(C.Slider,"infoTrack",N($r,C.info.main,.62)),ft(C.Slider,"successTrack",N($r,C.success.main,.62)),ft(C.Slider,"warningTrack",N($r,C.warning.main,.62));const V=M?N(Mr,C.background.default,.6825):Pv(C.background.default,.8);ft(C.SnackbarContent,"bg",V),ft(C.SnackbarContent,"color",Ys(()=>M?tC.text.primary:C.getContrastText(V))),ft(C.SpeedDialAction,"fabHoverBg",Pv(C.background.paper,.15)),ft(C.StepConnector,"border",j("palette-grey-400")),ft(C.StepContent,"border",j("palette-grey-400")),ft(C.Switch,"defaultColor",j("palette-common-white")),ft(C.Switch,"defaultDisabledColor",j("palette-grey-100")),ft(C.Switch,"primaryDisabledColor",N($r,C.primary.main,.62)),ft(C.Switch,"secondaryDisabledColor",N($r,C.secondary.main,.62)),ft(C.Switch,"errorDisabledColor",N($r,C.error.main,.62)),ft(C.Switch,"infoDisabledColor",N($r,C.info.main,.62)),ft(C.Switch,"successDisabledColor",N($r,C.success.main,.62)),ft(C.Switch,"warningDisabledColor",N($r,C.warning.main,.62)),ft(C.TableCell,"border",N($r,N(Lu,C.divider,1),.88)),ft(C.Tooltip,"bg",N(Lu,C.grey[700],.92))}if(C.mode==="dark"){ft(C.Alert,"errorColor",N($r,C.error.light,.6)),ft(C.Alert,"infoColor",N($r,C.info.light,.6)),ft(C.Alert,"successColor",N($r,C.success.light,.6)),ft(C.Alert,"warningColor",N($r,C.warning.light,.6)),ft(C.Alert,"errorFilledBg",j("palette-error-dark")),ft(C.Alert,"infoFilledBg",j("palette-info-dark")),ft(C.Alert,"successFilledBg",j("palette-success-dark")),ft(C.Alert,"warningFilledBg",j("palette-warning-dark")),ft(C.Alert,"errorFilledColor",Ys(()=>C.getContrastText(C.error.dark))),ft(C.Alert,"infoFilledColor",Ys(()=>C.getContrastText(C.info.dark))),ft(C.Alert,"successFilledColor",Ys(()=>C.getContrastText(C.success.dark))),ft(C.Alert,"warningFilledColor",Ys(()=>C.getContrastText(C.warning.dark))),ft(C.Alert,"errorStandardBg",N(Mr,C.error.light,.9)),ft(C.Alert,"infoStandardBg",N(Mr,C.info.light,.9)),ft(C.Alert,"successStandardBg",N(Mr,C.success.light,.9)),ft(C.Alert,"warningStandardBg",N(Mr,C.warning.light,.9)),ft(C.Alert,"errorIconColor",j("palette-error-main")),ft(C.Alert,"infoIconColor",j("palette-info-main")),ft(C.Alert,"successIconColor",j("palette-success-main")),ft(C.Alert,"warningIconColor",j("palette-warning-main")),ft(C.AppBar,"defaultBg",j("palette-grey-900")),ft(C.AppBar,"darkBg",j("palette-background-paper")),ft(C.AppBar,"darkColor",j("palette-text-primary")),ft(C.Avatar,"defaultBg",j("palette-grey-600")),ft(C.Button,"inheritContainedBg",j("palette-grey-800")),ft(C.Button,"inheritContainedHoverBg",j("palette-grey-700")),ft(C.Chip,"defaultBorder",j("palette-grey-700")),ft(C.Chip,"defaultAvatarColor",j("palette-grey-300")),ft(C.Chip,"defaultIconColor",j("palette-grey-300")),ft(C.FilledInput,"bg","rgba(255, 255, 255, 0.09)"),ft(C.FilledInput,"hoverBg","rgba(255, 255, 255, 0.13)"),ft(C.FilledInput,"disabledBg","rgba(255, 255, 255, 0.12)"),ft(C.LinearProgress,"primaryBg",N(Mr,C.primary.main,.5)),ft(C.LinearProgress,"secondaryBg",N(Mr,C.secondary.main,.5)),ft(C.LinearProgress,"errorBg",N(Mr,C.error.main,.5)),ft(C.LinearProgress,"infoBg",N(Mr,C.info.main,.5)),ft(C.LinearProgress,"successBg",N(Mr,C.success.main,.5)),ft(C.LinearProgress,"warningBg",N(Mr,C.warning.main,.5)),ft(C.Skeleton,"bg",M?N(Lu,C.text.primary,.13):`rgba(${j("palette-text-primaryChannel")} / 0.13)`),ft(C.Slider,"primaryTrack",N(Mr,C.primary.main,.5)),ft(C.Slider,"secondaryTrack",N(Mr,C.secondary.main,.5)),ft(C.Slider,"errorTrack",N(Mr,C.error.main,.5)),ft(C.Slider,"infoTrack",N(Mr,C.info.main,.5)),ft(C.Slider,"successTrack",N(Mr,C.success.main,.5)),ft(C.Slider,"warningTrack",N(Mr,C.warning.main,.5));const V=M?N($r,C.background.default,.985):Pv(C.background.default,.98);ft(C.SnackbarContent,"bg",V),ft(C.SnackbarContent,"color",Ys(()=>M?rz.text.primary:C.getContrastText(V))),ft(C.SpeedDialAction,"fabHoverBg",Pv(C.background.paper,.15)),ft(C.StepConnector,"border",j("palette-grey-600")),ft(C.StepContent,"border",j("palette-grey-600")),ft(C.Switch,"defaultColor",j("palette-grey-300")),ft(C.Switch,"defaultDisabledColor",j("palette-grey-600")),ft(C.Switch,"primaryDisabledColor",N(Mr,C.primary.main,.55)),ft(C.Switch,"secondaryDisabledColor",N(Mr,C.secondary.main,.55)),ft(C.Switch,"errorDisabledColor",N(Mr,C.error.main,.55)),ft(C.Switch,"infoDisabledColor",N(Mr,C.info.main,.55)),ft(C.Switch,"successDisabledColor",N(Mr,C.success.main,.55)),ft(C.Switch,"warningDisabledColor",N(Mr,C.warning.main,.55)),ft(C.TableCell,"border",N(Mr,N(Lu,C.divider,1),.68)),ft(C.Tooltip,"bg",N(Lu,C.grey[700],.92))}Ul(C.background,"default"),Ul(C.background,"paper"),Ul(C.common,"background"),Ul(C.common,"onBackground"),Ul(C,"divider"),Object.keys(C).forEach(V=>{const A=C[V];V!=="tonalOffset"&&A&&typeof A=="object"&&(A.main&&ft(C[V],"mainChannel",zm(Fm(A.main))),A.light&&ft(C[V],"lightChannel",zm(Fm(A.light))),A.dark&&ft(C[V],"darkChannel",zm(Fm(A.dark))),A.contrastText&&ft(C[V],"contrastTextChannel",zm(Fm(A.contrastText))),V==="text"&&(Ul(C[V],"primary"),Ul(C[V],"secondary")),V==="action"&&(A.active&&Ul(C[V],"active"),A.selected&&Ul(C[V],"selected")))})}),D=t.reduce((L,C)=>ha(L,C),D);const F={prefix:a,disableCssColorScheme:o,shouldSkipGeneratingVar:l,getSelector:Fne(D),enableContrastVars:i},{vars:I,generateThemeVars:U,generateStyleSheets:z}=gne(D,F);return D.vars=I,Object.entries(D.colorSchemes[D.defaultColorScheme]).forEach(([L,C])=>{D[L]=C}),D.generateThemeVars=U,D.generateStyleSheets=z,D.generateSpacing=function(){return ik(u.spacing,lE(this))},D.getColorSchemeSelector=vne(c),D.spacing=D.generateSpacing(),D.shouldSkipGeneratingVar=l,D.unstable_sxConfig={...ey,...u?.unstable_sxConfig},D.unstable_sx=function(L){return vp({sx:L,theme:this})},D.toRuntimeSource=sz,D}function aA(e,t,n){e.colorSchemes&&n&&(e.colorSchemes[t]={...n!==!0&&n,palette:dE({...n===!0?{}:n.palette,mode:t})})}function uz(e={},...t){const{palette:n,cssVariables:r=!1,colorSchemes:o=n?void 0:{light:!0},defaultColorScheme:a=n?.mode,...i}=e,l=a||"light",c=o?.[l],f={...o,...n?{[l]:{...typeof c!="boolean"&&c,palette:n}}:void 0};if(r===!1){if(!("colorSchemes"in e))return nC(e,...t);let u=n;"palette"in e||f[l]&&(f[l]!==!0?u=f[l].palette:l==="dark"&&(u={mode:"dark"}));const h=nC({...e,palette:u},...t);return h.defaultColorScheme=l,h.colorSchemes=f,h.palette.mode==="light"&&(h.colorSchemes.light={...f.light!==!0&&f.light,palette:h.palette},aA(h,"dark",f.dark)),h.palette.mode==="dark"&&(h.colorSchemes.dark={...f.dark!==!0&&f.dark,palette:h.palette},aA(h,"light",f.light)),h}return!n&&!("light"in f)&&l==="light"&&(f.light=!0),Vne({...i,colorSchemes:f,defaultColorScheme:l,...typeof r!="boolean"&&r},...t)}const J0=uz(),Ip="$$material";function Td(){const e=Mp(J0);return e[Ip]||e}function Hne(e){return g.jsx(lk,{...e,defaultTheme:J0,themeId:Ip})}function qne(e){const{variants:t,...n}=e,r={variants:t,style:id(n),isProcessed:!0};return r.style===n||t&&t.forEach(o=>{typeof o.style!="function"&&(o.style=id(o.style))}),r}const Wne=fE();function VS(e){return e!=="ownerState"&&e!=="theme"&&e!=="sx"&&e!=="as"}function td(e,t){return t&&e&&typeof e=="object"&&e.styles&&!e.styles.startsWith("@layer")&&(e.styles=`@layer ${t}{${String(e.styles)}}`),e}function Yne(e){return e?(t,n)=>n[e]:null}function Gne(e,t,n){e.theme=Qne(e.theme)?n:e.theme[t]||e.theme}function lb(e,t,n){const r=typeof t=="function"?t(e):t;if(Array.isArray(r))return r.flatMap(o=>lb(e,o,n));if(Array.isArray(r?.variants)){let o;if(r.isProcessed)o=n?td(r.style,n):r.style;else{const{variants:a,...i}=r;o=n?td(id(i),n):i}return dz(e,r.variants,[o],n)}return r?.isProcessed?n?td(id(r.style),n):r.style:n?td(id(r),n):r}function dz(e,t,n=[],r=void 0){let o;e:for(let a=0;a<t.length;a+=1){const i=t[a];if(typeof i.props=="function"){if(o??={...e,...e.ownerState,ownerState:e.ownerState},!i.props(o))continue}else for(const l in i.props)if(e[l]!==i.props[l]&&e.ownerState?.[l]!==i.props[l])continue e;typeof i.style=="function"?(o??={...e,...e.ownerState,ownerState:e.ownerState},n.push(r?td(id(i.style(o)),r):i.style(o))):n.push(r?td(id(i.style),r):i.style)}return n}function Kne(e={}){const{themeId:t,defaultTheme:n=Wne,rootShouldForwardProp:r=VS,slotShouldForwardProp:o=VS}=e;function a(i){Gne(i,t,n)}return(i,l={})=>{Jte(i,$=>$.filter(D=>D!==vp));const{name:c,slot:f,skipVariantsResolver:u,skipSx:h,overridesResolver:m=Yne(Zne(f)),...v}=l,b=c&&c.startsWith("Mui")||f?"components":"custom",x=u!==void 0?u:f&&f!=="Root"&&f!=="root"||!1,w=h||!1;let S=VS;f==="Root"||f==="root"?S=r:f?S=o:Xne(i)&&(S=void 0);const R=Zte(i,{shouldForwardProp:S,label:void 0,...v}),E=$=>{if($.__emotion_real===$)return $;if(typeof $=="function")return function(D){return lb(D,$,D.theme.modularCssLayers?b:void 0)};if(el($)){const D=qne($);return function(F){return D.variants?lb(F,D,F.theme.modularCssLayers?b:void 0):F.theme.modularCssLayers?td(D.style,b):D.style}}return $},M=(...$)=>{const D=[],F=$.map(E),I=[];if(D.push(a),c&&m&&I.push(function(L){const C=L.theme.components?.[c]?.styleOverrides;if(!C)return null;const j={};for(const N in C)j[N]=lb(L,C[N],L.theme.modularCssLayers?"theme":void 0);return m(L,j)}),c&&!x&&I.push(function(L){const C=L.theme?.components?.[c]?.variants;return C?dz(L,C,[],L.theme.modularCssLayers?"theme":void 0):null}),w||I.push(vp),Array.isArray(F[0])){const L=F.shift(),C=new Array(D.length).fill(""),j=new Array(I.length).fill("");let N;N=[...C,...L,...j],N.raw=[...C,...L.raw,...j],D.unshift(N)}const U=[...D,...F,...I],z=R(...U);return i.muiName&&(z.muiName=i.muiName),z};return R.withConfig&&(M.withConfig=R.withConfig),M}}function Qne(e){for(const t in e)return!1;return!0}function Xne(e){return typeof e=="string"&&e.charCodeAt(0)>96}function Zne(e){return e&&e.charAt(0).toLowerCase()+e.slice(1)}function fz(e){return e!=="ownerState"&&e!=="theme"&&e!=="sx"&&e!=="as"}const Ga=e=>fz(e)&&e!=="classes",Qe=Kne({themeId:Ip,defaultTheme:J0,rootShouldForwardProp:Ga});function Jne(e){return function(t){return g.jsx(Hne,{styles:typeof e=="function"?n=>e({theme:n,...t}):e})}}function ere(){return Ate}const qn=IN;function Wn(e){return one(e)}function tn(e,t,n="Mui"){const r={};return t.forEach(o=>{r[o]=cn(e,o,n)}),r}function tre(e){return cn("MuiSvgIcon",e)}tn("MuiSvgIcon",["root","colorPrimary","colorSecondary","colorAction","colorError","colorDisabled","fontSizeInherit","fontSizeSmall","fontSizeMedium","fontSizeLarge"]);const nre=e=>{const{color:t,fontSize:n,classes:r}=e,o={root:["root",t!=="inherit"&&`color${St(t)}`,`fontSize${St(n)}`]};return sn(o,tre,r)},rre=Qe("svg",{name:"MuiSvgIcon",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.color!=="inherit"&&t[`color${St(n.color)}`],t[`fontSize${St(n.fontSize)}`]]}})(qn(({theme:e})=>({userSelect:"none",width:"1em",height:"1em",display:"inline-block",flexShrink:0,transition:e.transitions?.create?.("fill",{duration:(e.vars??e).transitions?.duration?.shorter}),variants:[{props:t=>!t.hasSvgAsChild,style:{fill:"currentColor"}},{props:{fontSize:"inherit"},style:{fontSize:"inherit"}},{props:{fontSize:"small"},style:{fontSize:e.typography?.pxToRem?.(20)||"1.25rem"}},{props:{fontSize:"medium"},style:{fontSize:e.typography?.pxToRem?.(24)||"1.5rem"}},{props:{fontSize:"large"},style:{fontSize:e.typography?.pxToRem?.(35)||"2.1875rem"}},...Object.entries((e.vars??e).palette).filter(([,t])=>t&&t.main).map(([t])=>({props:{color:t},style:{color:(e.vars??e).palette?.[t]?.main}})),{props:{color:"action"},style:{color:(e.vars??e).palette?.action?.active}},{props:{color:"disabled"},style:{color:(e.vars??e).palette?.action?.disabled}},{props:{color:"inherit"},style:{color:void 0}}]}))),Nb=k.forwardRef(function(e,t){const n=Wn({props:e,name:"MuiSvgIcon"}),{children:r,className:o,color:a="inherit",component:i="svg",fontSize:l="medium",htmlColor:c,inheritViewBox:f=!1,titleAccess:u,viewBox:h="0 0 24 24",...m}=n,v=k.isValidElement(r)&&r.type==="svg",b={...n,color:a,component:i,fontSize:l,instanceFontSize:e.fontSize,inheritViewBox:f,viewBox:h,hasSvgAsChild:v},x={};f||(x.viewBox=h);const w=nre(b);return g.jsxs(rre,{as:i,className:zt(w.root,o),focusable:"false",color:c,"aria-hidden":u?void 0:!0,role:u?"img":void 0,ref:t,...x,...m,...v&&r.props,ownerState:b,children:[v?r.props.children:r,u?g.jsx("title",{children:u}):null]})});Nb.muiName="SvgIcon";function tr(e,t){function n(r,o){return g.jsx(Nb,{"data-testid":void 0,ref:o,...r,children:e})}return n.muiName=Nb.muiName,k.memo(k.forwardRef(n))}function pz(e,t=166){let n;function r(...o){const a=()=>{e.apply(this,o)};clearTimeout(n),n=setTimeout(a,t)}return r.clear=()=>{clearTimeout(n)},r}function cb(e,t){return k.isValidElement(e)&&t.indexOf(e.type.muiName??e.type?._payload?.value?.muiName)!==-1}function Io(e){return e&&e.ownerDocument||document}function Xl(e){return Io(e).defaultView||window}function oC(e,t){typeof e=="function"?e(t):e&&(e.current=t)}function vi(e){const{controlled:t,default:n,name:r,state:o="value"}=e,{current:a}=k.useRef(t!==void 0),[i,l]=k.useState(n),c=a?t:i,f=k.useCallback(u=>{a||l(u)},[]);return[c,f]}function Bt(e){const t=k.useRef(e);return zo(()=>{t.current=e}),k.useRef((...n)=>(0,t.current)(...n)).current}function mr(...e){const t=k.useRef(void 0),n=k.useCallback(r=>{const o=e.map(a=>{if(a==null)return null;if(typeof a=="function"){const i=a,l=i(r);return typeof l=="function"?l:()=>{i(null)}}return a.current=r,()=>{a.current=null}});return()=>{o.forEach(a=>a?.())}},e);return k.useMemo(()=>e.every(r=>r==null)?null:r=>{t.current&&(t.current(),t.current=void 0),r!=null&&(t.current=n(r))},e)}function ore(e,t){const n=e.charCodeAt(2);return e[0]==="o"&&e[1]==="n"&&n>=65&&n<=90&&typeof t=="function"}function hz(e,t){if(!e)return t;function n(i,l){const c={};return Object.keys(l).forEach(f=>{ore(f,l[f])&&typeof i[f]=="function"&&(c[f]=(...u)=>{i[f](...u),l[f](...u)})}),c}if(typeof e=="function"||typeof t=="function")return i=>{const l=typeof t=="function"?t(i):t,c=typeof e=="function"?e({...i,...l}):e,f=zt(i?.className,l?.className,c?.className),u=n(c,l);return{...l,...c,...u,...!!f&&{className:f},...l?.style&&c?.style&&{style:{...l.style,...c.style}},...l?.sx&&c?.sx&&{sx:[...Array.isArray(l.sx)?l.sx:[l.sx],...Array.isArray(c.sx)?c.sx:[c.sx]]}}};const r=t,o=n(e,r),a=zt(r?.className,e?.className);return{...t,...e,...o,...!!a&&{className:a},...r?.style&&e?.style&&{style:{...r.style,...e.style}},...r?.sx&&e?.sx&&{sx:[...Array.isArray(r.sx)?r.sx:[r.sx],...Array.isArray(e.sx)?e.sx:[e.sx]]}}}const pE=tr(g.jsx("path",{d:"M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6z"})),are=2,ire=24,Xbe=(e,t,n)=>Math.min(Math.max(e+t,1),Math.min(n,ire)),ap=16,sre=40,lre=12,cre=lre+8;function ure(e,t){const n=Math.min(e.colspan??1,t);return e.break?`1 / span ${n}`:`span ${n}`}function dre(e,t,n){if(!(t>0)||e<=1)return 1;const r=(t-(e-1)*ap)/e;return Math.min(e,Math.max(1,Math.ceil((n+ap)/(r+ap))))}function fre({tiles:e,columns:t,keyOf:n,renderTile:r,minTilePx:o,rowGapPx:a=ap}){const i=k.useRef(null),[l,c]=k.useState(0);k.useEffect(()=>{const u=i.current;if(o===void 0||!u||typeof ResizeObserver>"u")return;const h=new ResizeObserver(([m])=>c(m?.contentRect.width??0));return h.observe(u),()=>h.disconnect()},[o]);const f=o===void 0?1:dre(t,l,o);return g.jsx(Lt,{ref:i,sx:{display:"grid",gridTemplateColumns:{xs:"1fr",md:`repeat(${t}, minmax(0, 1fr))`},columnGap:`${ap}px`,rowGap:`${a}px`},children:e.map((u,h)=>g.jsx(Lt,{sx:{display:"grid",minWidth:0,gridColumn:{md:ure(u.colspan===void 0&&f>1?{...u,colspan:f}:u,t)}},children:r(u,h)},n(u,h)))})}const ex=tr(g.jsx("path",{d:"M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"}));function Yo({open:e,onClose:t,title:n,description:r,maxWidth:o="sm",showClose:a=!1,actions:i,children:l}){const c=k.useId();return g.jsxs(M0,{open:e,onClose:t,maxWidth:o,fullWidth:!0,"aria-labelledby":c,children:[g.jsxs(P0,{id:c,sx:{px:3,pt:3,pb:r?.5:1,display:"flex",alignItems:"center",justifyContent:"space-between",gap:1,fontSize:"1.25rem",fontWeight:"fontWeightMedium",letterSpacing:"-0.025em",lineHeight:1.2},children:[n,a&&g.jsx(Lo,{"aria-label":"Close",onClick:t,size:"small",sx:{color:"text.secondary",mr:-1},children:g.jsx(ex,{fontSize:"small"})})]}),g.jsxs($0,{sx:{px:3,pb:1,pt:1},children:[r&&g.jsx(It,{variant:"body2",color:"text.secondary",sx:{mb:2},children:r}),g.jsx(fr,{sx:{gap:2,pt:r?0:1},children:l})]}),i&&g.jsx(SI,{sx:{px:3,pb:3,pt:2,gap:1},children:i})]})}function Zbe({open:e,canSave:t,onKeepEditing:n,onDiscard:r,onSaveAndExit:o}){return g.jsx(Yo,{open:e,onClose:n,title:"Leave with unsaved changes?",description:t&&o?"Your edits have not been saved. Save them, or leave without them.":"Leaving now discards your unsaved edits.",actions:g.jsxs(g.Fragment,{children:[g.jsx(eo,{onClick:n,children:"Keep editing"}),g.jsx(eo,{color:"error",onClick:r,children:"Discard changes"}),t&&o&&g.jsx(eo,{variant:"contained",onClick:o,children:"Save and exit"})]}),children:null})}const pre=tr(g.jsx("path",{d:"M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6zM8 9h8v10H8zm7.5-5-1-1h-5l-1 1H5v2h14V4z"})),mz="120ms",gz={"@media (prefers-reduced-motion: reduce)":{transition:"none",animation:"none"}},Jbe=()=>typeof window<"u"&&window.matchMedia?.("(prefers-reduced-motion: reduce)").matches?"auto":"smooth",hre={"@media (hover: none)":{opacity:1}},e0e=e=>e.palette.mode==="dark"?e.palette.error.main:e.palette.error.dark,yz=20,mre={radius:"8px",padding:`${yz}px`};function t0e(e,t=mre){return{"--malloy-render--font-family":e.font.family,"--malloy-render--table-font-size":`${e.font.size}px`,"--malloy-render--table-header-color":e.tableHeader,"--malloy-render--table-body-color":e.tableBody,"--malloy-render--table-border":e.border,"--malloy-render--table-pinned-border":e.pinnedBorder,"--malloy-render--tile-background":e.tile,"--publisher-dashboard-root":e.dashboardRoot,"--malloy-render--label-color":e.tileTitle,"--malloy-render--value-color":e.valueColor,"--publisher-drill-link":e.drillLink,"--publisher-dashboard-card-radius":t.radius,"--publisher-dashboard-card-padding":t.padding,"--publisher-dashboard-card-border":e.cardBorder}}const gre={query:120,text:72};function vz({borderless:e=!1,chrome:t="card",kind:n="query",sx:r,cardRef:o,children:a}){const{theme:i}=is(),l=e||t==="none";return g.jsx(Wa,{ref:o,elevation:0,"data-chrome":t,sx:[{border:l?"none":i.cardBorder,borderRadius:l?0:1,background:l?"none":i.tile,overflow:"hidden",display:"flex",flexDirection:"column",minWidth:0,minHeight:t==="none"?0:gre[n],p:t==="none"?0:e?"12px 0":`${yz}px`},...Array.isArray(r)?r:[r]],children:a})}function yre({title:e,subtitle:t,tooltip:n,action:r,quiet:o=!1}){const{theme:a}=is();return g.jsxs(Lt,{sx:{pb:o?.5:1.5,display:"flex",alignItems:"flex-start",gap:1},children:[g.jsxs(Lt,{sx:{minWidth:0,flex:1},children:[g.jsx(It,{variant:o?"caption":"subtitle2",sx:{fontWeight:o?400:500,display:o?"block":void 0,opacity:o?.8:void 0,color:a.tileTitle,fontFamily:a.font.family},title:n,children:e}),t!==void 0&&g.jsx(It,{variant:"caption",sx:{display:"block",color:a.tileTitle,fontFamily:a.font.family,opacity:.8},children:t})]}),r]})}const vre=/^(https?|mailto|tel):/i,bre=/^[a-z][a-z0-9+.-]*:/i;function xre({href:e,title:t,children:n,context:r}){const o=!!e&&bre.test(e),a=!!e&&!o&&!e.startsWith("/")&&!e.startsWith("#");if(!e||!a||!r){const h=o&&!vre.test(e??"");return g.jsx("a",{href:h?void 0:e,title:t,...o?{target:"_blank",rel:"noopener noreferrer"}:{},children:n})}const i=r.sourcePath&&r.sourcePath.includes("/")?r.sourcePath.slice(0,r.sourcePath.lastIndexOf("/")+1):"",l=new URL(e,`https://malloy.invalid/${i}`),c=l.pathname.slice(1)+l.search+l.hash,f=`/${r.environmentName}/${r.packageName}/${c}`,{onNavigate:u}=r;return g.jsx("a",{href:f,title:t,onClick:u?h=>{h.preventDefault(),u(f,h)}:void 0,children:n})}const Sre={document:{"& > :first-child, & > div:only-child > :first-child":{mt:0},"& > :last-child, & > div:only-child > :last-child":{mb:0},"& h1, & h2, & h3, & h4, & h5, & h6":{fontWeight:"fontWeightMedium",color:"text.primary",mb:1,mt:2},"& h1":{fontSize:"28px"},"& h2":{fontSize:"24px"},"& h3":{fontSize:"20px"},"& p, & ul, & ol":{color:"text.primary",lineHeight:1.7,mb:1,fontSize:"16px"},"& li":{mb:.5}},caption:{color:"text.secondary",typography:"body2","& > :first-of-type":{mt:0},"& > :last-child":{mb:0},"& h1, & h2, & h3, & h4, & h5, & h6":{fontSize:"inherit",fontWeight:"fontWeightMedium",m:"0.5em 0 0.25em"},"& p":{m:"0.5em 0"},"& ul, & ol":{m:"0.5em 0",pl:3},"& code":{fontFamily:jo,fontSize:"0.9em"}}};function wre({alt:e}){return g.jsx(g.Fragment,{children:e})}function Jm({children:e,variant:t="caption",links:n,sx:r}){const{theme:o}=is();return g.jsx(Lt,{sx:[Sre[t],{fontFamily:o.font.family},...Array.isArray(r)?r:[r]],children:g.jsx(ree,{options:{forceBlock:t==="document",disableParsingRawHTML:!0,overrides:{a:{component:xre,props:{context:n}},img:{component:wre}}},children:e})})}const Cre=String.raw`##?\|?[ \t]*(?:[([{<][ \t]*)?(?:(?:(?:row|source)[-_]?)?authorize|access[-_]?filter)(?=[)\]}>]|[ \t]|$)`;function bz(e,t){if(/[\r\n]/.test(t))return`A ${e} is one line; it cannot hold a line break.`;if(new RegExp(Cre,"iu").test(t))return`A ${e} cannot contain what reads as an access-control tag (authorize, row_authorize, source_authorize or access_filter).`}function hE(e,t){if(e[t])return e;const n=e.default;return n?.[t]?n:e}const kre=e=>hE(e,"MalloyTranslator"),Ere=e=>hE(e,"parseAnnotation"),Rre=e=>hE(e,"ASTQuery");async function n0e(){return kre(await Co(()=>import("./index-dQ3jNgKw.js").then(e=>e.i),__vite__mapDeps([0,1])))}async function r0e(){return Ere(await Co(()=>Promise.resolve().then(()=>Aee),void 0))}async function Tre(){return Rre(await Co(()=>import("./index-CfX148tj.js").then(e=>e.i),__vite__mapDeps([2,1])))}const Ore=tr(g.jsx("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8m-5.5-2.5 7.51-3.49L17.5 6.5 9.99 9.99zm5.5-6.6c.61 0 1.1.49 1.1 1.1s-.49 1.1-1.1 1.1-1.1-.49-1.1-1.1.49-1.1 1.1-1.1"})),Mre=600,iA=()=>typeof IntersectionObserver>"u";function $re(e){for(let t=e.parentElement;t;t=t.parentElement){const{overflowY:n}=getComputedStyle(t);if((n==="auto"||n==="scroll")&&t.scrollHeight>t.clientHeight)return t}return null}function Pre(e=Mre){const[t,n]=k.useState(iA),r=k.useRef(t),o=k.useRef(null),a=k.useCallback(i=>{if(o.current?.disconnect(),o.current=null,!i||r.current||iA())return;const l=i.getBoundingClientRect(),c=$re(i),f=c?.getBoundingClientRect()??{top:0,bottom:window.innerHeight||document.documentElement.clientHeight};if(l.bottom>=f.top-e&&l.top<=f.bottom+e){r.current=!0,n(!0);return}const u=new IntersectionObserver(h=>{h.some(m=>m.isIntersecting)&&(r.current=!0,u.disconnect(),n(!0))},{root:c,rootMargin:`${e}px 0px`});u.observe(i),o.current=u},[e]);return k.useEffect(()=>()=>o.current?.disconnect(),[]),k.useEffect(()=>{if(t||typeof window>"u")return;const i=()=>{r.current=!0,o.current?.disconnect(),n(!0)};return window.addEventListener("beforeprint",i),()=>window.removeEventListener("beforeprint",i)},[t]),[a,t]}function xz({summary:e,detail:t}){return g.jsxs(qi,{severity:"error",sx:{"& .MuiAlert-message":{minWidth:0,flex:1}},children:[e!==void 0&&g.jsx(Lt,{sx:{mb:.5},children:e}),g.jsx(Lt,{component:"pre",sx:{m:0,whiteSpace:"pre-wrap",wordBreak:"break-word",fontFamily:jo,fontSize:"0.8125rem",color:"text.secondary"},children:t})]})}function Ta({error:e,context:t}){const n=e.data?.message||"Unknown error";return g.jsx(xz,{summary:t,detail:n})}function tx({label:e,onClick:t,disabled:n}){return g.jsx(eo,{variant:"contained",color:"primary",startIcon:g.jsx(pE,{}),onClick:t,disabled:n,"aria-label":`Add ${e.toLowerCase()}`,sx:{whiteSpace:"nowrap"},children:e})}function ty({label:e,icon:t,onClick:n,disabled:r,disabledReason:o,ariaLabel:a,ariaHasPopup:i}){const l=g.jsx("span",{children:g.jsx(eo,{variant:"outlined",startIcon:t,onClick:n,disabled:r,"aria-label":a,"aria-haspopup":i,sx:{whiteSpace:"nowrap"},children:e})});return r&&o?g.jsx(Zi,{title:o,children:l}):l}const ao=e=>{const t=new URL(e),n={};if(t.protocol!=="publisher:")throw new Error(`Failed to parse resource URI: ${e}`);const r=(t.hostname+t.pathname).split("/");for(let o=0;o<r.length;o+=2){const a=r[o];a==="environments"?n.environmentName=decodeURI(r[o+1])||void 0:a==="packages"?n.packageName=decodeURI(r[o+1])||void 0:a==="connections"?n.connectionName=decodeURI(r[o+1])||void 0:a==="models"&&(n.modelPath=decodeURI(r.slice(o+1).join("/"))||void 0)}if(n.versionId=t.searchParams.get("versionId")||void 0,!n.environmentName)throw new Error(`Failed to parse resource URI: ${e}`);return n},mE=e=>{if(!e.environmentName)throw new Error(`Failed to encode resource URI, missing environment name: ${e}`);let t=`publisher://environments/${e.environmentName}`;return e.packageName&&(t+=`/packages/${e.packageName}`),e.connectionName&&(t+=`/connections/${e.connectionName}`),e.modelPath&&(t+=`/models/${e.modelPath}`),e.packageName&&e.versionId&&(t+=`?versionId=${e.versionId}`),t},bp={opening:e=>e?`Opening the ${e}…`:"Opening…",running:"Running…",loading:"Loading…"};function ma({text:e,size:t=20,color:n="primary",thickness:r=3.6,centered:o=!0,spacing:a=2,textVariant:i="body2"}){const l=g.jsxs(Lt,{sx:{display:"flex",flexDirection:"column",alignItems:"center",gap:a},children:[g.jsx(Ug,{size:t,color:n,thickness:r}),e&&g.jsx(It,{variant:i,color:"text.secondary",children:e})]});return o?g.jsx(Lt,{sx:{display:"flex",justifyContent:"center",alignItems:"center",minHeight:"200px",width:"100%"},children:l}):l}var aC={exports:{}},Are=aC.exports,sA;function Dre(){return sA||(sA=1,(function(e,t){(function(n,r){e.exports=r()})(Are,(function(){var n=1e3,r=6e4,o=36e5,a="millisecond",i="second",l="minute",c="hour",f="day",u="week",h="month",m="quarter",v="year",b="date",x="Invalid Date",w=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,S=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,R={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(N){var V=["th","st","nd","rd"],A=N%100;return"["+N+(V[(A-20)%10]||V[A]||V[0])+"]"}},E=function(N,V,A){var Y=String(N);return!Y||Y.length>=V?N:""+Array(V+1-Y.length).join(A)+N},M={s:E,z:function(N){var V=-N.utcOffset(),A=Math.abs(V),Y=Math.floor(A/60),W=A%60;return(V<=0?"+":"-")+E(Y,2,"0")+":"+E(W,2,"0")},m:function N(V,A){if(V.date()<A.date())return-N(A,V);var Y=12*(A.year()-V.year())+(A.month()-V.month()),W=V.clone().add(Y,h),re=A-W<0,Q=V.clone().add(Y+(re?-1:1),h);return+(-(Y+(A-W)/(re?W-Q:Q-W))||0)},a:function(N){return N<0?Math.ceil(N)||0:Math.floor(N)},p:function(N){return{M:h,y:v,w:u,d:f,D:b,h:c,m:l,s:i,ms:a,Q:m}[N]||String(N||"").toLowerCase().replace(/s$/,"")},u:function(N){return N===void 0}},$="en",D={};D[$]=R;var F="$isDayjsObject",I=function(N){return N instanceof C||!(!N||!N[F])},U=function N(V,A,Y){var W;if(!V)return $;if(typeof V=="string"){var re=V.toLowerCase();D[re]&&(W=re),A&&(D[re]=A,W=re);var Q=V.split("-");if(!W&&Q.length>1)return N(Q[0])}else{var oe=V.name;D[oe]=V,W=oe}return!Y&&W&&($=W),W||!Y&&$},z=function(N,V){if(I(N))return N.clone();var A=typeof V=="object"?V:{};return A.date=N,A.args=arguments,new C(A)},L=M;L.l=U,L.i=I,L.w=function(N,V){return z(N,{locale:V.$L,utc:V.$u,x:V.$x,$offset:V.$offset})};var C=(function(){function N(A){this.$L=U(A.locale,null,!0),this.parse(A),this.$x=this.$x||A.x||{},this[F]=!0}var V=N.prototype;return V.parse=function(A){this.$d=(function(Y){var W=Y.date,re=Y.utc;if(W===null)return new Date(NaN);if(L.u(W))return new Date;if(W instanceof Date)return new Date(W);if(typeof W=="string"&&!/Z$/i.test(W)){var Q=W.match(w);if(Q){var oe=Q[2]-1||0,ce=(Q[7]||"0").substring(0,3);return re?new Date(Date.UTC(Q[1],oe,Q[3]||1,Q[4]||0,Q[5]||0,Q[6]||0,ce)):new Date(Q[1],oe,Q[3]||1,Q[4]||0,Q[5]||0,Q[6]||0,ce)}}return new Date(W)})(A),this.init()},V.init=function(){var A=this.$d;this.$y=A.getFullYear(),this.$M=A.getMonth(),this.$D=A.getDate(),this.$W=A.getDay(),this.$H=A.getHours(),this.$m=A.getMinutes(),this.$s=A.getSeconds(),this.$ms=A.getMilliseconds()},V.$utils=function(){return L},V.isValid=function(){return this.$d.toString()!==x},V.isSame=function(A,Y){var W=z(A);return this.startOf(Y)<=W&&W<=this.endOf(Y)},V.isAfter=function(A,Y){return z(A)<this.startOf(Y)},V.isBefore=function(A,Y){return this.endOf(Y)<z(A)},V.$g=function(A,Y,W){return L.u(A)?this[Y]:this.set(W,A)},V.unix=function(){return Math.floor(this.valueOf()/1e3)},V.valueOf=function(){return this.$d.getTime()},V.startOf=function(A,Y){var W=this,re=!!L.u(Y)||Y,Q=L.p(A),oe=function(pe,ye){var ie=L.w(W.$u?Date.UTC(W.$y,ye,pe):new Date(W.$y,ye,pe),W);return re?ie:ie.endOf(f)},ce=function(pe,ye){return L.w(W.toDate()[pe].apply(W.toDate("s"),(re?[0,0,0,0]:[23,59,59,999]).slice(ye)),W)},Z=this.$W,ae=this.$M,J=this.$D,ne="set"+(this.$u?"UTC":"");switch(Q){case v:return re?oe(1,0):oe(31,11);case h:return re?oe(1,ae):oe(0,ae+1);case u:var ee=this.$locale().weekStart||0,ue=(Z<ee?Z+7:Z)-ee;return oe(re?J-ue:J+(6-ue),ae);case f:case b:return ce(ne+"Hours",0);case c:return ce(ne+"Minutes",1);case l:return ce(ne+"Seconds",2);case i:return ce(ne+"Milliseconds",3);default:return this.clone()}},V.endOf=function(A){return this.startOf(A,!1)},V.$set=function(A,Y){var W,re=L.p(A),Q="set"+(this.$u?"UTC":""),oe=(W={},W[f]=Q+"Date",W[b]=Q+"Date",W[h]=Q+"Month",W[v]=Q+"FullYear",W[c]=Q+"Hours",W[l]=Q+"Minutes",W[i]=Q+"Seconds",W[a]=Q+"Milliseconds",W)[re],ce=re===f?this.$D+(Y-this.$W):Y;if(re===h||re===v){var Z=this.clone().set(b,1);Z.$d[oe](ce),Z.init(),this.$d=Z.set(b,Math.min(this.$D,Z.daysInMonth())).$d}else oe&&this.$d[oe](ce);return this.init(),this},V.set=function(A,Y){return this.clone().$set(A,Y)},V.get=function(A){return this[L.p(A)]()},V.add=function(A,Y){var W,re=this;A=Number(A);var Q=L.p(Y),oe=function(ae){var J=z(re);return L.w(J.date(J.date()+Math.round(ae*A)),re)};if(Q===h)return this.set(h,this.$M+A);if(Q===v)return this.set(v,this.$y+A);if(Q===f)return oe(1);if(Q===u)return oe(7);var ce=(W={},W[l]=r,W[c]=o,W[i]=n,W)[Q]||1,Z=this.$d.getTime()+A*ce;return L.w(Z,this)},V.subtract=function(A,Y){return this.add(-1*A,Y)},V.format=function(A){var Y=this,W=this.$locale();if(!this.isValid())return W.invalidDate||x;var re=A||"YYYY-MM-DDTHH:mm:ssZ",Q=L.z(this),oe=this.$H,ce=this.$m,Z=this.$M,ae=W.weekdays,J=W.months,ne=W.meridiem,ee=function(ye,ie,he,le){return ye&&(ye[ie]||ye(Y,re))||he[ie].slice(0,le)},ue=function(ye){return L.s(oe%12||12,ye,"0")},pe=ne||function(ye,ie,he){var le=ye<12?"AM":"PM";return he?le.toLowerCase():le};return re.replace(S,(function(ye,ie){return ie||(function(he){switch(he){case"YY":return String(Y.$y).slice(-2);case"YYYY":return L.s(Y.$y,4,"0");case"M":return Z+1;case"MM":return L.s(Z+1,2,"0");case"MMM":return ee(W.monthsShort,Z,J,3);case"MMMM":return ee(J,Z);case"D":return Y.$D;case"DD":return L.s(Y.$D,2,"0");case"d":return String(Y.$W);case"dd":return ee(W.weekdaysMin,Y.$W,ae,2);case"ddd":return ee(W.weekdaysShort,Y.$W,ae,3);case"dddd":return ae[Y.$W];case"H":return String(oe);case"HH":return L.s(oe,2,"0");case"h":return ue(1);case"hh":return ue(2);case"a":return pe(oe,ce,!0);case"A":return pe(oe,ce,!1);case"m":return String(ce);case"mm":return L.s(ce,2,"0");case"s":return String(Y.$s);case"ss":return L.s(Y.$s,2,"0");case"SSS":return L.s(Y.$ms,3,"0");case"Z":return Q}return null})(ye)||Q.replace(":","")}))},V.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},V.diff=function(A,Y,W){var re,Q=this,oe=L.p(Y),ce=z(A),Z=(ce.utcOffset()-this.utcOffset())*r,ae=this-ce,J=function(){return L.m(Q,ce)};switch(oe){case v:re=J()/12;break;case h:re=J();break;case m:re=J()/3;break;case u:re=(ae-Z)/6048e5;break;case f:re=(ae-Z)/864e5;break;case c:re=ae/o;break;case l:re=ae/r;break;case i:re=ae/n;break;default:re=ae}return W?re:L.a(re)},V.daysInMonth=function(){return this.endOf(h).$D},V.$locale=function(){return D[this.$L]},V.locale=function(A,Y){if(!A)return this.$L;var W=this.clone(),re=U(A,Y,!0);return re&&(W.$L=re),W},V.clone=function(){return L.w(this.$d,this)},V.toDate=function(){return new Date(this.valueOf())},V.toJSON=function(){return this.isValid()?this.toISOString():null},V.toISOString=function(){return this.$d.toISOString()},V.toString=function(){return this.$d.toUTCString()},N})(),j=C.prototype;return z.prototype=j,[["$ms",a],["$s",i],["$m",l],["$H",c],["$W",f],["$M",h],["$y",v],["$D",b]].forEach((function(N){j[N[1]]=function(V){return this.$g(V,N[0],N[1])}})),z.extend=function(N,V){return N.$i||(N(V,C,z),N.$i=!0),z},z.locale=U,z.isDayjs=I,z.unix=function(N){return z(1e3*N)},z.en=D[$],z.Ls=D,z.p={},z}))})(aC)),aC.exports}var jre=Dre();const Pr=Jl(jre);var iC={exports:{}},Nre=iC.exports,lA;function Ire(){return lA||(lA=1,(function(e,t){(function(n,r){e.exports=r()})(Nre,(function(){var n="minute",r=/[+-]\d\d(?::?\d\d)?/g,o=/([+-]|\d\d)/g;return function(a,i,l){var c=i.prototype;l.utc=function(x){var w={date:x,utc:!0,args:arguments};return new i(w)},c.utc=function(x){var w=l(this.toDate(),{locale:this.$L,utc:!0});return x?w.add(this.utcOffset(),n):w},c.local=function(){return l(this.toDate(),{locale:this.$L,utc:!1})};var f=c.parse;c.parse=function(x){x.utc&&(this.$u=!0),this.$utils().u(x.$offset)||(this.$offset=x.$offset),f.call(this,x)};var u=c.init;c.init=function(){if(this.$u){var x=this.$d;this.$y=x.getUTCFullYear(),this.$M=x.getUTCMonth(),this.$D=x.getUTCDate(),this.$W=x.getUTCDay(),this.$H=x.getUTCHours(),this.$m=x.getUTCMinutes(),this.$s=x.getUTCSeconds(),this.$ms=x.getUTCMilliseconds()}else u.call(this)};var h=c.utcOffset;c.utcOffset=function(x,w){var S=this.$utils().u;if(S(x))return this.$u?0:S(this.$offset)?h.call(this):this.$offset;if(typeof x=="string"&&(x=(function($){$===void 0&&($="");var D=$.match(r);if(!D)return null;var F=(""+D[0]).match(o)||["-",0,0],I=F[0],U=60*+F[1]+ +F[2];return U===0?0:I==="+"?U:-U})(x),x===null))return this;var R=Math.abs(x)<=16?60*x:x;if(R===0)return this.utc(w);var E=this.clone();if(w)return E.$offset=R,E.$u=!1,E;var M=this.$u?this.toDate().getTimezoneOffset():-1*this.utcOffset();return(E=this.local().add(R+M,n)).$offset=R,E.$x.$localOffset=M,E};var m=c.format;c.format=function(x){var w=x||(this.$u?"YYYY-MM-DDTHH:mm:ss[Z]":"");return m.call(this,w)},c.valueOf=function(){var x=this.$utils().u(this.$offset)?0:this.$offset+(this.$x.$localOffset||this.$d.getTimezoneOffset());return this.$d.valueOf()-6e4*x},c.isUTC=function(){return!!this.$u},c.toISOString=function(){return this.toDate().toISOString()},c.toString=function(){return this.toDate().toUTCString()};var v=c.toDate;c.toDate=function(x){return x==="s"&&this.$offset?l(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate():v.call(this)};var b=c.diff;c.diff=function(x,w,S){if(x&&this.$u===x.$u)return b.call(this,x,w,S);var R=this.local(),E=l(x).local();return b.call(R,E,w,S)}}}))})(iC)),iC.exports}var Lre=Ire();const gE=Jl(Lre);Pr.extend(gE);function Gu(e){return(e??"").startsWith("filter<")}function zre(e){const{parsed:t}=Ci.BooleanFilterExpression.parse(e);if(!(!t||t.not))return t.operator==="true"||t.operator==="false"?t.operator:void 0}function Qf(e){const t=/^filter<(.+)>$/.exec(e??"");return t?t[1]:void 0}function yE(e){const t=e.filter(n=>n.trim()!=="");return t.length===0?"":Ci.StringFilterExpression.unparse({operator:"=",values:[...t]})}function Fre(e){if(e.trim()==="")return[];const{parsed:t}=Ci.StringFilterExpression.parse(e);return Sz(t)?t.values:[e]}function _re(e){return e===void 0||e.trim()===""?!0:Sz(Ci.StringFilterExpression.parse(e).parsed)}function Sz(e){return e!==null&&Ci.isStringCondition(e)&&e.operator==="="&&e.not!==!0}function Ure(e){return Ci.NumberFilterExpression.unparse({operator:">=",values:[String(e)]})}function Bre(e){const t=e.trim();if(t==="")return;const{parsed:n}=Ci.NumberFilterExpression.parse(t);if(n===null||n.operator!==">="||n.not===!0||n.values?.length!==1)return;const r=Number(n.values[0]);return Number.isFinite(r)?r:void 0}function Vre(e,t){return Ci.NumberFilterExpression.unparse({operator:"range",startOperator:">=",startValue:String(e),endOperator:"<=",endValue:String(t)})}function Hre(e){const t=e.trim();if(t==="")return;const{parsed:n}=Ci.NumberFilterExpression.parse(t);if(n===null||n.operator!=="range"||n.not===!0||n.startOperator!==">="||n.endOperator!=="<=")return;const r=Number(n.startValue),o=Number(n.endValue);return Number.isFinite(r)&&Number.isFinite(o)&&r<=o?[r,o]:void 0}const Ib=[{key:"today",label:"Today",clause:{operator:"in",in:{moment:"today"}}},{key:"7d",label:"Last 7 days",clause:{operator:"in_last",units:"day",n:"7"}},{key:"30d",label:"Last 30 days",clause:{operator:"in_last",units:"day",n:"30"}},{key:"90d",label:"Last 90 days",clause:{operator:"in_last",units:"day",n:"90"}},{key:"12m",label:"Last 12 months",clause:{operator:"in_last",units:"month",n:"12"}}];function qre(e){const t=Ib.find(n=>n.key===e);return t?Ci.TemporalFilterExpression.unparse(t.clause):void 0}function Wre(e){const t=e.trim();if(t==="")return;const{parsed:n}=Ci.TemporalFilterExpression.parse(t);if(n!==null)for(const r of Ib){const o=r.clause;if(o.operator===n.operator&&(o.operator==="in"&&n.operator==="in"&&n.not!==!0&&n.in.moment===o.in.moment||o.operator==="in_last"&&n.operator==="in_last"&&n.not!==!0&&n.units===o.units&&Number(n.n)===Number(o.n)))return r.key}}const Yre=/^\d{4}-\d{2}-\d{2}$/;function Gre(e,t){const n=Pr.utc(t,"YYYY-MM-DD").add(1,"day");return Ci.TemporalFilterExpression.unparse({operator:"to",fromMoment:{moment:"literal",literal:e,units:"day"},toMoment:{moment:"literal",literal:n.format("YYYY-MM-DD"),units:"day"}})}function Kre(e){const t=e.trim();if(t==="")return;const{parsed:n}=Ci.TemporalFilterExpression.parse(t);if(n===null||n.operator!=="to"||n.not===!0)return;const r=cA(n.fromMoment),o=cA(n.toMoment);if(r===void 0||o===void 0)return;const a=Pr.utc(o,"YYYY-MM-DD").subtract(1,"day");if(!(!a.isValid()||a.isBefore(Pr.utc(r,"YYYY-MM-DD"))))return{firstDay:r,lastDay:a.format("YYYY-MM-DD")}}function cA(e){return e.moment==="literal"&&Yre.test(e.literal)?e.literal:void 0}const HS="self";function wz(e){if(!e)return[];if(e.wasDimension&&!e.wasDimension())return[];const t=e.tag?.tag("drill");return t?(t.textArray("to")??[t.text("to")].filter(uA)).filter(uA):[]}function Cz(e){const t=e.replace(/[-_]+/g," ").trim();return t.charAt(0).toUpperCase()+t.slice(1)}function kz(e){return e.tag?.tag("drill")?.text("given")??e.name}function nx(e){if(typeof e=="string"){const t=yE([e]);return t===""?void 0:t}if(typeof e=="boolean")return String(e);if(typeof e=="number")return Number.isFinite(e)?String(e):void 0;if(e instanceof Date){const t=e.toISOString();return t.slice(0,t.indexOf("T"))}}function Ez(e){return e instanceof Date?nx(e)??"":String(e)}function Qre(e){if(!e||e.isHeader)return;const t=e.field;if(!t)return;const n=wz(t);if(n.length===0)return;const r=nx(e.value);if(r!==void 0)return{to:n,given:kz(t),value:r,rawValue:e.value,label:Ez(e.value)}}function uA(e){return typeof e=="string"&&e!==""}function Xre(e,t){if(t!==void 0&&!Gu(t)){if(t==="number"){if(typeof e=="number")return Number.isFinite(e)?e:void 0;if(typeof e!="string"||e.trim()==="")return;const n=Number(e);return Number.isFinite(n)?n:void 0}if(t==="date"||t==="timestamp"||t==="timestamptz")return e instanceof Date?e:void 0;if(t==="boolean")return typeof e=="boolean"?e:e==="true"?!0:e==="false"?!1:void 0;if(typeof e=="string")return e.trim()===""?void 0:e;if(typeof e=="number")return Number.isFinite(e)?String(e):void 0;if(typeof e=="boolean")return String(e)}return Qf(t)==="string"&&typeof e=="number"?Number.isFinite(e)?yE([String(e)]):void 0:Qf(t)==="number"?typeof e=="number"?Number.isFinite(e)?String(e):void 0:typeof e!="string"||e.trim()===""?void 0:Number.isFinite(Number(e))?e.trim():void 0:nx(e)}function Zre({declaredTypes:e,setGiven:t,documentName:n}){const r=k.useMemo(()=>{const l=new Map;for(const c of e.keys())l.has(c.toLowerCase())||l.set(c.toLowerCase(),c);return l},[e]),o=k.useCallback(l=>e.has(l)?l:r.get(l.toLowerCase()),[e,r]),a=k.useCallback(l=>o(l)!==void 0,[o]),i=k.useCallback((l,c)=>{const f=o(l);if(f===void 0){console.warn(`# drill { to=self } tried to set '${l}', which '${n}' does not declare as a given. Name the given with 'given=' on the drill tag.`);return}const u=e.get(f),h=Xre(c,u);if(h===void 0){console.warn(`Drill declined: ${JSON.stringify(c)} cannot be a value for given "${f}"`+(u?` of type ${u}`:""));return}t(f,h)},[e,n,o,t]);return{resolveGiven:o,canSelf:a,onSelf:i}}function Jre(e,t){if(e!=null){if(e instanceof Date)return vE(e,t);if(!Array.isArray(e))return String(e)}}function eoe(e,t){return new Date(Date.UTC(e.year(),e.month(),e.date(),t?.getUTCHours()??0,t?.getUTCMinutes()??0,t?.getUTCSeconds()??0,t?.getUTCMilliseconds()??0))}const toe=/^(\d{4})-(\d{1,2})-(\d{1,2})(?:[T\s]+(\d{1,2}):(\d{2})(?::(\d{2}))?(?:\.(\d{1,9}))?)?\s*(Z|[+-]\d{2}:?\d{2}|[+-]\d{2}|UTC|GMT)?$/i;function Rz(e){const t=e.trim();return t===""?e:t.replace(/^(\d{4}-\d{1,2}-\d{1,2}[T\s]+\d{1,2}:\d{2}(?::\d{2})?(?:\.\d{1,9})?)\s+(\d{2}:?\d{2}|\d{2})$/,"$1+$2")}function noe(e,t=!1){const n=Rz(e);if(n==="")return;const r=toe.exec(n);if(!r)return;const[,o,a,i,l,c,f,u,h]=r,m={year:Number(o),month:Number(a),day:Number(i),hour:Number(l??0),minute:Number(c??0),second:Number(f??0),milli:Number((u??"").slice(0,3).padEnd(3,"0")||0)},v=Date.UTC(m.year,m.month-1,m.day,m.hour,m.minute,m.second,m.milli),b=new Date(v);if(!(b.getUTCFullYear()===m.year&&b.getUTCMonth()===m.month-1&&b.getUTCDate()===m.day&&b.getUTCHours()===m.hour&&b.getUTCMinutes()===m.minute&&b.getUTCSeconds()===m.second)||h!==void 0&&l===void 0)return;const x=roe(h);if(x===void 0)return;const w=new Date(v-x*6e4);if(!(t&&h!==void 0&&w.getUTCDate()!==m.day))return w}function roe(e){if(e===void 0)return 0;const t=e.toUpperCase();if(t==="Z"||t==="UTC"||t==="GMT")return 0;const n=/^([+-])(\d{2}):?(\d{2})?$/.exec(t);if(!n)return;const r=Number(n[3]??0);if(r>59)return;const o=Number(n[2])*60+r,a=n[1]!=="-";if(!(o>(a?840:720)))return a?o:-o}function ooe(e){return!aoe.has(e??"")}const aoe=new Set(["boolean","number","date","timestamp","timestamptz"]);function Tz(e,t){if(t===""&&!ooe(e))return null;if(Gu(e))return t;switch(e){case"number":{const n=t.trim()===""?NaN:Number(t);return Number.isFinite(n)?n:t}case"boolean":return t==="true"?!0:t==="false"?!1:t;case"date":case"timestamp":case"timestamptz":{const n=Rz(t);return noe(n,e==="date")??n}default:return t}}function Oz(e,t){const n={};for(const[r,o]of e){const a=Jre(o,t.get(r));a!==void 0&&(n[r]=a)}return n}function vE(e,t){const n=e.toISOString();switch(t){case"timestamptz":return n;case"timestamp":return n.slice(0,-1);default:return n.slice(0,10)}}function ny(e,t,n){const r=n?new Set(n):void 0,o={};for(const[a,i]of e)r&&!r.has(a)||i!=null&&(Array.isArray(i)||(o[a]=i instanceof Date?vE(i,t.get(a)):i));return o}function bE(e,t,n){if(!t)return e;const r=n?new Set(n):void 0,o={...e};for(const[a,i]of Object.entries(t))r&&!r.has(a)||a in o||i===null||i===void 0||(o[a]=Array.isArray(i)?[...i]:i instanceof Date?vE(i,void 0):i);return o}function dA(e,t){const n=new Map;for(const[r,o]of Object.entries(e))t.has(r)&&n.set(r,Tz(t.get(r),o));return n}function fA(e,t){const n=Array.from(e.keys()).filter(o=>!t.has(o));if(n.length===0)return e;const r=new Map(e);for(const o of n)r.delete(o);return r}function pA(e){return Object.entries(e??{}).sort(([t],[n])=>t<n?-1:1)}function ioe(e,t,n){for(const r of n.keys())if(e[r]!==t[r])return!1;return!0}function hA(e,t){const n=Object.keys(e);return n.length!==Object.keys(t).length?!1:n.every(r=>e[r]===t[r])}function soe({declaredTypes:e,startingValues:t,params:n,onParamsChange:r,documentKey:o,autorun:a}){const i=k.useMemo(()=>dA(t??{},e),[e,JSON.stringify(t)]),l=k.useRef(null),c=k.useRef(null),f=k.useRef({documentKey:o,params:n}),u=L=>L!==null&&ioe(n??{},L,e);u(l.current)&&(c.current=null),(f.current.documentKey!==o||!hA(n??{},f.current.params??{})&&!u(l.current)&&!u(c.current))&&(f.current={documentKey:o,params:n});const h=f.current.params,m=JSON.stringify(t),v=JSON.stringify(h),b=k.useMemo(()=>dA({...t??{},...h??{}},e),[e,m,v]),x=k.useMemo(()=>JSON.stringify([o??null,pA(t),pA(h)]),[o,m,v]),[w,S]=k.useState(null),R=w?.key===x?w:null;k.useEffect(()=>{w!==null&&w.key!==x&&S(null)},[w,x]);const E=k.useMemo(()=>fA(R?.draft??b,e),[R,b,e]),M=k.useMemo(()=>fA(R?.applied??b,e),[R,b,e]),$=k.useCallback(L=>L?.key===x?L:{key:x,draft:b,applied:b},[x,b]),D=k.useMemo(()=>Oz(M,e),[M,e]);l.current===null&&(l.current=D),k.useEffect(()=>{r&&(hA(l.current??{},D)||(c.current=l.current,l.current=D,r(D)))},[D,r]);const F=k.useCallback((L,C)=>{S(j=>{const N=$(j),V=new Map(N.draft);return C===null?V.delete(L):V.set(L,C),{key:N.key,draft:V,applied:a?V:N.applied}})},[a,$]),I=k.useCallback(()=>{S(L=>({key:$(L).key,draft:i,applied:i}))},[$,i]),U=k.useCallback(()=>{S(L=>{const C=$(L);return{key:C.key,draft:C.draft,applied:C.draft}})},[$]),z=k.useMemo(()=>{if(a)return!1;if(E.size!==M.size)return!0;for(const[L,C]of E){const j=M.get(L);if(C instanceof Date&&j instanceof Date){if(C.getTime()!==j.getTime())return!0}else if(Array.isArray(C)&&Array.isArray(j)){if(String(C)!==String(j))return!0}else if(C!==j)return!0}return!1},[a,E,M]);return{draft:E,applied:M,setGiven:F,reset:I,apply:U,pending:z}}const loe="You don't have access to this data";function o0e(e){return(e??[]).filter(t=>t.kind==="definition"&&!t.restricted).map(t=>t.text??"").join(`
349
+ export default theme;`}function oA(e){return typeof e=="number"?`${(e*100).toFixed(0)}%`:`calc((${e}) * 100%)`}const Dne=e=>{if(!Number.isNaN(+e))return+e;const t=e.match(/\d*\.?\d+/g);if(!t)return 0;let n=0;for(let r=0;r<t.length;r+=1)n+=+t[r];return n};function jne(e){Object.assign(e,{alpha(t,n){const r=this||e;return r.colorSpace?`oklch(from ${t} l c h / ${typeof n=="string"?`calc(${n})`:n})`:r.vars?`rgba(${t.replace(/var\(--([^,\s)]+)(?:,[^)]+)?\)+/g,"var(--$1Channel)")} / ${typeof n=="string"?`calc(${n})`:n})`:Db(t,Dne(n))},lighten(t,n){const r=this||e;return r.colorSpace?`color-mix(in ${r.colorSpace}, ${t}, #fff ${oA(n)})`:Z0(t,n)},darken(t,n){const r=this||e;return r.colorSpace?`color-mix(in ${r.colorSpace}, ${t}, #000 ${oA(n)})`:X0(t,n)}})}function nC(e={},...t){const{breakpoints:n,mixins:r={},spacing:o,palette:a={},transitions:i={},typography:l={},shape:c,colorSpace:f,...u}=e;if(e.vars&&e.generateThemeVars===void 0)throw new Error(Kl(20));const h=dE({...a,colorSpace:f}),m=fE(e);let v=ha(m,{mixins:xne(m.breakpoints,r),palette:h,shadows:Rne.slice(),typography:wne(h,l),transitions:$ne(i),zIndex:{...Pne}});return v=ha(v,u),v=t.reduce((b,x)=>ha(b,x),v),v.unstable_sxConfig={...ey,...u?.unstable_sxConfig},v.unstable_sx=function(b){return vp({sx:b,theme:this})},v.toRuntimeSource=sz,jne(v),v}function rC(e){let t;return e<1?t=5.11916*e**2:t=4.5*Math.log(e+1)+2,Math.round(t*10)/1e3}const Nne=[...Array(25)].map((e,t)=>{if(t===0)return"none";const n=rC(t);return`linear-gradient(rgba(255 255 255 / ${n}), rgba(255 255 255 / ${n}))`});function lz(e){return{inputPlaceholder:e==="dark"?.5:.42,inputUnderline:e==="dark"?.7:.42,switchTrackDisabled:e==="dark"?.2:.12,switchTrack:e==="dark"?.3:.38}}function cz(e){return e==="dark"?Nne:[]}function Ine(e){const{palette:t={mode:"light"},opacity:n,overlays:r,colorSpace:o,...a}=e,i=dE({...t,colorSpace:o});return{palette:i,opacity:{...lz(i.mode),...n},overlays:r||cz(i.mode),...a}}function Lne(e){return!!e[0].match(/(cssVarPrefix|colorSchemeSelector|modularCssLayers|rootSelector|typography|mixins|breakpoints|direction|transitions)/)||!!e[0].match(/sxConfig$/)||e[0]==="palette"&&!!e[1]?.match(/(mode|contrastThreshold|tonalOffset)/)}const zne=e=>[...[...Array(25)].map((t,n)=>`--${e?`${e}-`:""}overlays-${n}`),`--${e?`${e}-`:""}palette-AppBar-darkBg`,`--${e?`${e}-`:""}palette-AppBar-darkColor`],Fne=e=>(t,n)=>{const r=e.rootSelector||":root",o=e.colorSchemeSelector;let a=o;if(o==="class"&&(a=".%s"),o==="data"&&(a="[data-%s]"),o?.startsWith("data-")&&!o.includes("%s")&&(a=`[${o}="%s"]`),e.defaultColorScheme===t){if(t==="dark"){const i={};return zne(e.cssVarPrefix).forEach(l=>{i[l]=n[l],delete n[l]}),a==="media"?{[r]:n,"@media (prefers-color-scheme: dark)":{[r]:i}}:a?{[a.replace("%s",t)]:i,[`${r}, ${a.replace("%s",t)}`]:n}:{[r]:{...n,...i}}}if(a&&a!=="media")return`${r}, ${a.replace("%s",String(t))}`}else if(t){if(a==="media")return{[`@media (prefers-color-scheme: ${String(t)})`]:{[r]:n}};if(a)return a.replace("%s",String(t))}return r};function _ne(e,t){t.forEach(n=>{e[n]||(e[n]={})})}function ft(e,t,n){!e[t]&&n&&(e[t]=n)}function Fm(e){return typeof e!="string"||!e.startsWith("hsl")?e:tz(e)}function Ul(e,t){`${t}Channel`in e||(e[`${t}Channel`]=zm(Fm(e[t])))}function Une(e){return typeof e=="number"?`${e}px`:typeof e=="string"||typeof e=="function"||Array.isArray(e)?e:"8px"}const Ys=e=>{try{return e()}catch{}},Bne=(e="mui")=>zN(e);function BS(e,t,n,r,o){if(!n)return;n=n===!0?{}:n;const a=o==="dark"?"dark":"light";if(!r){t[o]=Ine({...n,palette:{mode:a,...n?.palette},colorSpace:e});return}const{palette:i,...l}=nC({...r,palette:{mode:a,...n?.palette},colorSpace:e});return t[o]={...n,palette:i,opacity:{...lz(a),...n?.opacity},overlays:n?.overlays||cz(a)},l}function Vne(e={},...t){const{colorSchemes:n={light:!0},defaultColorScheme:r,disableCssColorScheme:o=!1,cssVarPrefix:a="mui",nativeColor:i=!1,shouldSkipGeneratingVar:l=Lne,colorSchemeSelector:c=n.light&&n.dark?"media":void 0,rootSelector:f=":root",...u}=e,h=Object.keys(n)[0],m=r||(n.light&&h!=="light"?"light":h),v=Bne(a),{[m]:b,light:x,dark:w,...S}=n,R={...S};let E=b;if((m==="dark"&&!("dark"in n)||m==="light"&&!("light"in n))&&(E=!0),!E)throw new Error(Kl(21,m));let M;i&&(M="oklch");const $=BS(M,R,E,u,m);x&&!R.light&&BS(M,R,x,void 0,"light"),w&&!R.dark&&BS(M,R,w,void 0,"dark");let D={defaultColorScheme:m,...$,cssVarPrefix:a,colorSchemeSelector:c,rootSelector:f,getCssVar:v,colorSchemes:R,font:{...yne($.typography),...$.font},spacing:Une(u.spacing)};Object.keys(D.colorSchemes).forEach(L=>{const C=D.colorSchemes[L].palette,j=V=>{const A=V.split("-"),Y=A[1],W=A[2];return v(V,C[Y][W])};C.mode==="light"&&(ft(C.common,"background","#fff"),ft(C.common,"onBackground","#000")),C.mode==="dark"&&(ft(C.common,"background","#000"),ft(C.common,"onBackground","#fff"));function N(V,A,Y){if(M){let W;return V===Lu&&(W=`transparent ${((1-Y)*100).toFixed(0)}%`),V===Mr&&(W=`#000 ${(Y*100).toFixed(0)}%`),V===$r&&(W=`#fff ${(Y*100).toFixed(0)}%`),`color-mix(in ${M}, ${A}, ${W})`}return V(A,Y)}if(_ne(C,["Alert","AppBar","Avatar","Button","Chip","FilledInput","LinearProgress","Skeleton","Slider","SnackbarContent","SpeedDialAction","StepConnector","StepContent","Switch","TableCell","Tooltip"]),C.mode==="light"){ft(C.Alert,"errorColor",N(Mr,C.error.light,.6)),ft(C.Alert,"infoColor",N(Mr,C.info.light,.6)),ft(C.Alert,"successColor",N(Mr,C.success.light,.6)),ft(C.Alert,"warningColor",N(Mr,C.warning.light,.6)),ft(C.Alert,"errorFilledBg",j("palette-error-main")),ft(C.Alert,"infoFilledBg",j("palette-info-main")),ft(C.Alert,"successFilledBg",j("palette-success-main")),ft(C.Alert,"warningFilledBg",j("palette-warning-main")),ft(C.Alert,"errorFilledColor",Ys(()=>C.getContrastText(C.error.main))),ft(C.Alert,"infoFilledColor",Ys(()=>C.getContrastText(C.info.main))),ft(C.Alert,"successFilledColor",Ys(()=>C.getContrastText(C.success.main))),ft(C.Alert,"warningFilledColor",Ys(()=>C.getContrastText(C.warning.main))),ft(C.Alert,"errorStandardBg",N($r,C.error.light,.9)),ft(C.Alert,"infoStandardBg",N($r,C.info.light,.9)),ft(C.Alert,"successStandardBg",N($r,C.success.light,.9)),ft(C.Alert,"warningStandardBg",N($r,C.warning.light,.9)),ft(C.Alert,"errorIconColor",j("palette-error-main")),ft(C.Alert,"infoIconColor",j("palette-info-main")),ft(C.Alert,"successIconColor",j("palette-success-main")),ft(C.Alert,"warningIconColor",j("palette-warning-main")),ft(C.AppBar,"defaultBg",j("palette-grey-100")),ft(C.Avatar,"defaultBg",j("palette-grey-400")),ft(C.Button,"inheritContainedBg",j("palette-grey-300")),ft(C.Button,"inheritContainedHoverBg",j("palette-grey-A100")),ft(C.Chip,"defaultBorder",j("palette-grey-400")),ft(C.Chip,"defaultAvatarColor",j("palette-grey-700")),ft(C.Chip,"defaultIconColor",j("palette-grey-700")),ft(C.FilledInput,"bg","rgba(0, 0, 0, 0.06)"),ft(C.FilledInput,"hoverBg","rgba(0, 0, 0, 0.09)"),ft(C.FilledInput,"disabledBg","rgba(0, 0, 0, 0.12)"),ft(C.LinearProgress,"primaryBg",N($r,C.primary.main,.62)),ft(C.LinearProgress,"secondaryBg",N($r,C.secondary.main,.62)),ft(C.LinearProgress,"errorBg",N($r,C.error.main,.62)),ft(C.LinearProgress,"infoBg",N($r,C.info.main,.62)),ft(C.LinearProgress,"successBg",N($r,C.success.main,.62)),ft(C.LinearProgress,"warningBg",N($r,C.warning.main,.62)),ft(C.Skeleton,"bg",M?N(Lu,C.text.primary,.11):`rgba(${j("palette-text-primaryChannel")} / 0.11)`),ft(C.Slider,"primaryTrack",N($r,C.primary.main,.62)),ft(C.Slider,"secondaryTrack",N($r,C.secondary.main,.62)),ft(C.Slider,"errorTrack",N($r,C.error.main,.62)),ft(C.Slider,"infoTrack",N($r,C.info.main,.62)),ft(C.Slider,"successTrack",N($r,C.success.main,.62)),ft(C.Slider,"warningTrack",N($r,C.warning.main,.62));const V=M?N(Mr,C.background.default,.6825):Pv(C.background.default,.8);ft(C.SnackbarContent,"bg",V),ft(C.SnackbarContent,"color",Ys(()=>M?tC.text.primary:C.getContrastText(V))),ft(C.SpeedDialAction,"fabHoverBg",Pv(C.background.paper,.15)),ft(C.StepConnector,"border",j("palette-grey-400")),ft(C.StepContent,"border",j("palette-grey-400")),ft(C.Switch,"defaultColor",j("palette-common-white")),ft(C.Switch,"defaultDisabledColor",j("palette-grey-100")),ft(C.Switch,"primaryDisabledColor",N($r,C.primary.main,.62)),ft(C.Switch,"secondaryDisabledColor",N($r,C.secondary.main,.62)),ft(C.Switch,"errorDisabledColor",N($r,C.error.main,.62)),ft(C.Switch,"infoDisabledColor",N($r,C.info.main,.62)),ft(C.Switch,"successDisabledColor",N($r,C.success.main,.62)),ft(C.Switch,"warningDisabledColor",N($r,C.warning.main,.62)),ft(C.TableCell,"border",N($r,N(Lu,C.divider,1),.88)),ft(C.Tooltip,"bg",N(Lu,C.grey[700],.92))}if(C.mode==="dark"){ft(C.Alert,"errorColor",N($r,C.error.light,.6)),ft(C.Alert,"infoColor",N($r,C.info.light,.6)),ft(C.Alert,"successColor",N($r,C.success.light,.6)),ft(C.Alert,"warningColor",N($r,C.warning.light,.6)),ft(C.Alert,"errorFilledBg",j("palette-error-dark")),ft(C.Alert,"infoFilledBg",j("palette-info-dark")),ft(C.Alert,"successFilledBg",j("palette-success-dark")),ft(C.Alert,"warningFilledBg",j("palette-warning-dark")),ft(C.Alert,"errorFilledColor",Ys(()=>C.getContrastText(C.error.dark))),ft(C.Alert,"infoFilledColor",Ys(()=>C.getContrastText(C.info.dark))),ft(C.Alert,"successFilledColor",Ys(()=>C.getContrastText(C.success.dark))),ft(C.Alert,"warningFilledColor",Ys(()=>C.getContrastText(C.warning.dark))),ft(C.Alert,"errorStandardBg",N(Mr,C.error.light,.9)),ft(C.Alert,"infoStandardBg",N(Mr,C.info.light,.9)),ft(C.Alert,"successStandardBg",N(Mr,C.success.light,.9)),ft(C.Alert,"warningStandardBg",N(Mr,C.warning.light,.9)),ft(C.Alert,"errorIconColor",j("palette-error-main")),ft(C.Alert,"infoIconColor",j("palette-info-main")),ft(C.Alert,"successIconColor",j("palette-success-main")),ft(C.Alert,"warningIconColor",j("palette-warning-main")),ft(C.AppBar,"defaultBg",j("palette-grey-900")),ft(C.AppBar,"darkBg",j("palette-background-paper")),ft(C.AppBar,"darkColor",j("palette-text-primary")),ft(C.Avatar,"defaultBg",j("palette-grey-600")),ft(C.Button,"inheritContainedBg",j("palette-grey-800")),ft(C.Button,"inheritContainedHoverBg",j("palette-grey-700")),ft(C.Chip,"defaultBorder",j("palette-grey-700")),ft(C.Chip,"defaultAvatarColor",j("palette-grey-300")),ft(C.Chip,"defaultIconColor",j("palette-grey-300")),ft(C.FilledInput,"bg","rgba(255, 255, 255, 0.09)"),ft(C.FilledInput,"hoverBg","rgba(255, 255, 255, 0.13)"),ft(C.FilledInput,"disabledBg","rgba(255, 255, 255, 0.12)"),ft(C.LinearProgress,"primaryBg",N(Mr,C.primary.main,.5)),ft(C.LinearProgress,"secondaryBg",N(Mr,C.secondary.main,.5)),ft(C.LinearProgress,"errorBg",N(Mr,C.error.main,.5)),ft(C.LinearProgress,"infoBg",N(Mr,C.info.main,.5)),ft(C.LinearProgress,"successBg",N(Mr,C.success.main,.5)),ft(C.LinearProgress,"warningBg",N(Mr,C.warning.main,.5)),ft(C.Skeleton,"bg",M?N(Lu,C.text.primary,.13):`rgba(${j("palette-text-primaryChannel")} / 0.13)`),ft(C.Slider,"primaryTrack",N(Mr,C.primary.main,.5)),ft(C.Slider,"secondaryTrack",N(Mr,C.secondary.main,.5)),ft(C.Slider,"errorTrack",N(Mr,C.error.main,.5)),ft(C.Slider,"infoTrack",N(Mr,C.info.main,.5)),ft(C.Slider,"successTrack",N(Mr,C.success.main,.5)),ft(C.Slider,"warningTrack",N(Mr,C.warning.main,.5));const V=M?N($r,C.background.default,.985):Pv(C.background.default,.98);ft(C.SnackbarContent,"bg",V),ft(C.SnackbarContent,"color",Ys(()=>M?rz.text.primary:C.getContrastText(V))),ft(C.SpeedDialAction,"fabHoverBg",Pv(C.background.paper,.15)),ft(C.StepConnector,"border",j("palette-grey-600")),ft(C.StepContent,"border",j("palette-grey-600")),ft(C.Switch,"defaultColor",j("palette-grey-300")),ft(C.Switch,"defaultDisabledColor",j("palette-grey-600")),ft(C.Switch,"primaryDisabledColor",N(Mr,C.primary.main,.55)),ft(C.Switch,"secondaryDisabledColor",N(Mr,C.secondary.main,.55)),ft(C.Switch,"errorDisabledColor",N(Mr,C.error.main,.55)),ft(C.Switch,"infoDisabledColor",N(Mr,C.info.main,.55)),ft(C.Switch,"successDisabledColor",N(Mr,C.success.main,.55)),ft(C.Switch,"warningDisabledColor",N(Mr,C.warning.main,.55)),ft(C.TableCell,"border",N(Mr,N(Lu,C.divider,1),.68)),ft(C.Tooltip,"bg",N(Lu,C.grey[700],.92))}Ul(C.background,"default"),Ul(C.background,"paper"),Ul(C.common,"background"),Ul(C.common,"onBackground"),Ul(C,"divider"),Object.keys(C).forEach(V=>{const A=C[V];V!=="tonalOffset"&&A&&typeof A=="object"&&(A.main&&ft(C[V],"mainChannel",zm(Fm(A.main))),A.light&&ft(C[V],"lightChannel",zm(Fm(A.light))),A.dark&&ft(C[V],"darkChannel",zm(Fm(A.dark))),A.contrastText&&ft(C[V],"contrastTextChannel",zm(Fm(A.contrastText))),V==="text"&&(Ul(C[V],"primary"),Ul(C[V],"secondary")),V==="action"&&(A.active&&Ul(C[V],"active"),A.selected&&Ul(C[V],"selected")))})}),D=t.reduce((L,C)=>ha(L,C),D);const F={prefix:a,disableCssColorScheme:o,shouldSkipGeneratingVar:l,getSelector:Fne(D),enableContrastVars:i},{vars:I,generateThemeVars:U,generateStyleSheets:z}=gne(D,F);return D.vars=I,Object.entries(D.colorSchemes[D.defaultColorScheme]).forEach(([L,C])=>{D[L]=C}),D.generateThemeVars=U,D.generateStyleSheets=z,D.generateSpacing=function(){return ik(u.spacing,lE(this))},D.getColorSchemeSelector=vne(c),D.spacing=D.generateSpacing(),D.shouldSkipGeneratingVar=l,D.unstable_sxConfig={...ey,...u?.unstable_sxConfig},D.unstable_sx=function(L){return vp({sx:L,theme:this})},D.toRuntimeSource=sz,D}function aA(e,t,n){e.colorSchemes&&n&&(e.colorSchemes[t]={...n!==!0&&n,palette:dE({...n===!0?{}:n.palette,mode:t})})}function uz(e={},...t){const{palette:n,cssVariables:r=!1,colorSchemes:o=n?void 0:{light:!0},defaultColorScheme:a=n?.mode,...i}=e,l=a||"light",c=o?.[l],f={...o,...n?{[l]:{...typeof c!="boolean"&&c,palette:n}}:void 0};if(r===!1){if(!("colorSchemes"in e))return nC(e,...t);let u=n;"palette"in e||f[l]&&(f[l]!==!0?u=f[l].palette:l==="dark"&&(u={mode:"dark"}));const h=nC({...e,palette:u},...t);return h.defaultColorScheme=l,h.colorSchemes=f,h.palette.mode==="light"&&(h.colorSchemes.light={...f.light!==!0&&f.light,palette:h.palette},aA(h,"dark",f.dark)),h.palette.mode==="dark"&&(h.colorSchemes.dark={...f.dark!==!0&&f.dark,palette:h.palette},aA(h,"light",f.light)),h}return!n&&!("light"in f)&&l==="light"&&(f.light=!0),Vne({...i,colorSchemes:f,defaultColorScheme:l,...typeof r!="boolean"&&r},...t)}const J0=uz(),Ip="$$material";function Td(){const e=Mp(J0);return e[Ip]||e}function Hne(e){return g.jsx(lk,{...e,defaultTheme:J0,themeId:Ip})}function qne(e){const{variants:t,...n}=e,r={variants:t,style:id(n),isProcessed:!0};return r.style===n||t&&t.forEach(o=>{typeof o.style!="function"&&(o.style=id(o.style))}),r}const Wne=fE();function VS(e){return e!=="ownerState"&&e!=="theme"&&e!=="sx"&&e!=="as"}function td(e,t){return t&&e&&typeof e=="object"&&e.styles&&!e.styles.startsWith("@layer")&&(e.styles=`@layer ${t}{${String(e.styles)}}`),e}function Yne(e){return e?(t,n)=>n[e]:null}function Gne(e,t,n){e.theme=Qne(e.theme)?n:e.theme[t]||e.theme}function lb(e,t,n){const r=typeof t=="function"?t(e):t;if(Array.isArray(r))return r.flatMap(o=>lb(e,o,n));if(Array.isArray(r?.variants)){let o;if(r.isProcessed)o=n?td(r.style,n):r.style;else{const{variants:a,...i}=r;o=n?td(id(i),n):i}return dz(e,r.variants,[o],n)}return r?.isProcessed?n?td(id(r.style),n):r.style:n?td(id(r),n):r}function dz(e,t,n=[],r=void 0){let o;e:for(let a=0;a<t.length;a+=1){const i=t[a];if(typeof i.props=="function"){if(o??={...e,...e.ownerState,ownerState:e.ownerState},!i.props(o))continue}else for(const l in i.props)if(e[l]!==i.props[l]&&e.ownerState?.[l]!==i.props[l])continue e;typeof i.style=="function"?(o??={...e,...e.ownerState,ownerState:e.ownerState},n.push(r?td(id(i.style(o)),r):i.style(o))):n.push(r?td(id(i.style),r):i.style)}return n}function Kne(e={}){const{themeId:t,defaultTheme:n=Wne,rootShouldForwardProp:r=VS,slotShouldForwardProp:o=VS}=e;function a(i){Gne(i,t,n)}return(i,l={})=>{Jte(i,$=>$.filter(D=>D!==vp));const{name:c,slot:f,skipVariantsResolver:u,skipSx:h,overridesResolver:m=Yne(Zne(f)),...v}=l,b=c&&c.startsWith("Mui")||f?"components":"custom",x=u!==void 0?u:f&&f!=="Root"&&f!=="root"||!1,w=h||!1;let S=VS;f==="Root"||f==="root"?S=r:f?S=o:Xne(i)&&(S=void 0);const R=Zte(i,{shouldForwardProp:S,label:void 0,...v}),E=$=>{if($.__emotion_real===$)return $;if(typeof $=="function")return function(D){return lb(D,$,D.theme.modularCssLayers?b:void 0)};if(el($)){const D=qne($);return function(F){return D.variants?lb(F,D,F.theme.modularCssLayers?b:void 0):F.theme.modularCssLayers?td(D.style,b):D.style}}return $},M=(...$)=>{const D=[],F=$.map(E),I=[];if(D.push(a),c&&m&&I.push(function(L){const C=L.theme.components?.[c]?.styleOverrides;if(!C)return null;const j={};for(const N in C)j[N]=lb(L,C[N],L.theme.modularCssLayers?"theme":void 0);return m(L,j)}),c&&!x&&I.push(function(L){const C=L.theme?.components?.[c]?.variants;return C?dz(L,C,[],L.theme.modularCssLayers?"theme":void 0):null}),w||I.push(vp),Array.isArray(F[0])){const L=F.shift(),C=new Array(D.length).fill(""),j=new Array(I.length).fill("");let N;N=[...C,...L,...j],N.raw=[...C,...L.raw,...j],D.unshift(N)}const U=[...D,...F,...I],z=R(...U);return i.muiName&&(z.muiName=i.muiName),z};return R.withConfig&&(M.withConfig=R.withConfig),M}}function Qne(e){for(const t in e)return!1;return!0}function Xne(e){return typeof e=="string"&&e.charCodeAt(0)>96}function Zne(e){return e&&e.charAt(0).toLowerCase()+e.slice(1)}function fz(e){return e!=="ownerState"&&e!=="theme"&&e!=="sx"&&e!=="as"}const Ga=e=>fz(e)&&e!=="classes",Qe=Kne({themeId:Ip,defaultTheme:J0,rootShouldForwardProp:Ga});function Jne(e){return function(t){return g.jsx(Hne,{styles:typeof e=="function"?n=>e({theme:n,...t}):e})}}function ere(){return Ate}const qn=IN;function Wn(e){return one(e)}function tn(e,t,n="Mui"){const r={};return t.forEach(o=>{r[o]=cn(e,o,n)}),r}function tre(e){return cn("MuiSvgIcon",e)}tn("MuiSvgIcon",["root","colorPrimary","colorSecondary","colorAction","colorError","colorDisabled","fontSizeInherit","fontSizeSmall","fontSizeMedium","fontSizeLarge"]);const nre=e=>{const{color:t,fontSize:n,classes:r}=e,o={root:["root",t!=="inherit"&&`color${St(t)}`,`fontSize${St(n)}`]};return sn(o,tre,r)},rre=Qe("svg",{name:"MuiSvgIcon",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.color!=="inherit"&&t[`color${St(n.color)}`],t[`fontSize${St(n.fontSize)}`]]}})(qn(({theme:e})=>({userSelect:"none",width:"1em",height:"1em",display:"inline-block",flexShrink:0,transition:e.transitions?.create?.("fill",{duration:(e.vars??e).transitions?.duration?.shorter}),variants:[{props:t=>!t.hasSvgAsChild,style:{fill:"currentColor"}},{props:{fontSize:"inherit"},style:{fontSize:"inherit"}},{props:{fontSize:"small"},style:{fontSize:e.typography?.pxToRem?.(20)||"1.25rem"}},{props:{fontSize:"medium"},style:{fontSize:e.typography?.pxToRem?.(24)||"1.5rem"}},{props:{fontSize:"large"},style:{fontSize:e.typography?.pxToRem?.(35)||"2.1875rem"}},...Object.entries((e.vars??e).palette).filter(([,t])=>t&&t.main).map(([t])=>({props:{color:t},style:{color:(e.vars??e).palette?.[t]?.main}})),{props:{color:"action"},style:{color:(e.vars??e).palette?.action?.active}},{props:{color:"disabled"},style:{color:(e.vars??e).palette?.action?.disabled}},{props:{color:"inherit"},style:{color:void 0}}]}))),Nb=k.forwardRef(function(e,t){const n=Wn({props:e,name:"MuiSvgIcon"}),{children:r,className:o,color:a="inherit",component:i="svg",fontSize:l="medium",htmlColor:c,inheritViewBox:f=!1,titleAccess:u,viewBox:h="0 0 24 24",...m}=n,v=k.isValidElement(r)&&r.type==="svg",b={...n,color:a,component:i,fontSize:l,instanceFontSize:e.fontSize,inheritViewBox:f,viewBox:h,hasSvgAsChild:v},x={};f||(x.viewBox=h);const w=nre(b);return g.jsxs(rre,{as:i,className:zt(w.root,o),focusable:"false",color:c,"aria-hidden":u?void 0:!0,role:u?"img":void 0,ref:t,...x,...m,...v&&r.props,ownerState:b,children:[v?r.props.children:r,u?g.jsx("title",{children:u}):null]})});Nb.muiName="SvgIcon";function tr(e,t){function n(r,o){return g.jsx(Nb,{"data-testid":void 0,ref:o,...r,children:e})}return n.muiName=Nb.muiName,k.memo(k.forwardRef(n))}function pz(e,t=166){let n;function r(...o){const a=()=>{e.apply(this,o)};clearTimeout(n),n=setTimeout(a,t)}return r.clear=()=>{clearTimeout(n)},r}function cb(e,t){return k.isValidElement(e)&&t.indexOf(e.type.muiName??e.type?._payload?.value?.muiName)!==-1}function Io(e){return e&&e.ownerDocument||document}function Xl(e){return Io(e).defaultView||window}function oC(e,t){typeof e=="function"?e(t):e&&(e.current=t)}function vi(e){const{controlled:t,default:n,name:r,state:o="value"}=e,{current:a}=k.useRef(t!==void 0),[i,l]=k.useState(n),c=a?t:i,f=k.useCallback(u=>{a||l(u)},[]);return[c,f]}function Bt(e){const t=k.useRef(e);return zo(()=>{t.current=e}),k.useRef((...n)=>(0,t.current)(...n)).current}function mr(...e){const t=k.useRef(void 0),n=k.useCallback(r=>{const o=e.map(a=>{if(a==null)return null;if(typeof a=="function"){const i=a,l=i(r);return typeof l=="function"?l:()=>{i(null)}}return a.current=r,()=>{a.current=null}});return()=>{o.forEach(a=>a?.())}},e);return k.useMemo(()=>e.every(r=>r==null)?null:r=>{t.current&&(t.current(),t.current=void 0),r!=null&&(t.current=n(r))},e)}function ore(e,t){const n=e.charCodeAt(2);return e[0]==="o"&&e[1]==="n"&&n>=65&&n<=90&&typeof t=="function"}function hz(e,t){if(!e)return t;function n(i,l){const c={};return Object.keys(l).forEach(f=>{ore(f,l[f])&&typeof i[f]=="function"&&(c[f]=(...u)=>{i[f](...u),l[f](...u)})}),c}if(typeof e=="function"||typeof t=="function")return i=>{const l=typeof t=="function"?t(i):t,c=typeof e=="function"?e({...i,...l}):e,f=zt(i?.className,l?.className,c?.className),u=n(c,l);return{...l,...c,...u,...!!f&&{className:f},...l?.style&&c?.style&&{style:{...l.style,...c.style}},...l?.sx&&c?.sx&&{sx:[...Array.isArray(l.sx)?l.sx:[l.sx],...Array.isArray(c.sx)?c.sx:[c.sx]]}}};const r=t,o=n(e,r),a=zt(r?.className,e?.className);return{...t,...e,...o,...!!a&&{className:a},...r?.style&&e?.style&&{style:{...r.style,...e.style}},...r?.sx&&e?.sx&&{sx:[...Array.isArray(r.sx)?r.sx:[r.sx],...Array.isArray(e.sx)?e.sx:[e.sx]]}}}const pE=tr(g.jsx("path",{d:"M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6z"})),are=2,ire=24,Xbe=(e,t,n)=>Math.min(Math.max(e+t,1),Math.min(n,ire)),ap=16,sre=40,lre=12,cre=lre+8;function ure(e,t){const n=Math.min(e.colspan??1,t);return e.break?`1 / span ${n}`:`span ${n}`}function dre(e,t,n){if(!(t>0)||e<=1)return 1;const r=(t-(e-1)*ap)/e;return Math.min(e,Math.max(1,Math.ceil((n+ap)/(r+ap))))}function fre({tiles:e,columns:t,keyOf:n,renderTile:r,minTilePx:o,rowGapPx:a=ap}){const i=k.useRef(null),[l,c]=k.useState(0);k.useEffect(()=>{const u=i.current;if(o===void 0||!u||typeof ResizeObserver>"u")return;const h=new ResizeObserver(([m])=>c(m?.contentRect.width??0));return h.observe(u),()=>h.disconnect()},[o]);const f=o===void 0?1:dre(t,l,o);return g.jsx(Lt,{ref:i,sx:{display:"grid",gridTemplateColumns:{xs:"1fr",md:`repeat(${t}, minmax(0, 1fr))`},columnGap:`${ap}px`,rowGap:`${a}px`},children:e.map((u,h)=>g.jsx(Lt,{sx:{display:"grid",minWidth:0,gridColumn:{md:ure(u.colspan===void 0&&f>1?{...u,colspan:f}:u,t)}},children:r(u,h)},n(u,h)))})}const ex=tr(g.jsx("path",{d:"M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"}));function Yo({open:e,onClose:t,title:n,description:r,maxWidth:o="sm",showClose:a=!1,actions:i,children:l}){const c=k.useId();return g.jsxs(M0,{open:e,onClose:t,maxWidth:o,fullWidth:!0,"aria-labelledby":c,children:[g.jsxs(P0,{id:c,sx:{px:3,pt:3,pb:r?.5:1,display:"flex",alignItems:"center",justifyContent:"space-between",gap:1,fontSize:"1.25rem",fontWeight:"fontWeightMedium",letterSpacing:"-0.025em",lineHeight:1.2},children:[n,a&&g.jsx(Lo,{"aria-label":"Close",onClick:t,size:"small",sx:{color:"text.secondary",mr:-1},children:g.jsx(ex,{fontSize:"small"})})]}),g.jsxs($0,{sx:{px:3,pb:1,pt:1},children:[r&&g.jsx(It,{variant:"body2",color:"text.secondary",sx:{mb:2},children:r}),g.jsx(fr,{sx:{gap:2,pt:r?0:1},children:l})]}),i&&g.jsx(SI,{sx:{px:3,pb:3,pt:2,gap:1},children:i})]})}function Zbe({open:e,canSave:t,onKeepEditing:n,onDiscard:r,onSaveAndExit:o}){return g.jsx(Yo,{open:e,onClose:n,title:"Leave with unsaved changes?",description:t&&o?"Your edits have not been saved. Save them, or leave without them.":"Leaving now discards your unsaved edits.",actions:g.jsxs(g.Fragment,{children:[g.jsx(eo,{onClick:n,children:"Keep editing"}),g.jsx(eo,{color:"error",onClick:r,children:"Discard changes"}),t&&o&&g.jsx(eo,{variant:"contained",onClick:o,children:"Save and exit"})]}),children:null})}const pre=tr(g.jsx("path",{d:"M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6zM8 9h8v10H8zm7.5-5-1-1h-5l-1 1H5v2h14V4z"})),mz="120ms",gz={"@media (prefers-reduced-motion: reduce)":{transition:"none",animation:"none"}},Jbe=()=>typeof window<"u"&&window.matchMedia?.("(prefers-reduced-motion: reduce)").matches?"auto":"smooth",hre={"@media (hover: none)":{opacity:1}},e0e=e=>e.palette.mode==="dark"?e.palette.error.main:e.palette.error.dark,yz=20,mre={radius:"8px",padding:`${yz}px`};function t0e(e,t=mre){return{"--malloy-render--font-family":e.font.family,"--malloy-render--table-font-size":`${e.font.size}px`,"--malloy-render--table-header-color":e.tableHeader,"--malloy-render--table-body-color":e.tableBody,"--malloy-render--table-border":e.border,"--malloy-render--table-pinned-border":e.pinnedBorder,"--malloy-render--tile-background":e.tile,"--publisher-dashboard-root":e.dashboardRoot,"--malloy-render--label-color":e.tileTitle,"--malloy-render--value-color":e.valueColor,"--publisher-drill-link":e.drillLink,"--publisher-dashboard-card-radius":t.radius,"--publisher-dashboard-card-padding":t.padding,"--publisher-dashboard-card-border":e.cardBorder}}const gre={query:120,text:72};function vz({borderless:e=!1,chrome:t="card",kind:n="query",sx:r,cardRef:o,children:a}){const{theme:i}=is(),l=e||t==="none";return g.jsx(Wa,{ref:o,elevation:0,"data-chrome":t,sx:[{border:l?"none":i.cardBorder,borderRadius:l?0:1,background:l?"none":i.tile,overflow:"hidden",display:"flex",flexDirection:"column",minWidth:0,minHeight:t==="none"?0:gre[n],p:t==="none"?0:e?"12px 0":`${yz}px`},...Array.isArray(r)?r:[r]],children:a})}function yre({title:e,subtitle:t,tooltip:n,action:r,quiet:o=!1}){const{theme:a}=is();return g.jsxs(Lt,{sx:{pb:o?.5:1.5,display:"flex",alignItems:"flex-start",gap:1},children:[g.jsxs(Lt,{sx:{minWidth:0,flex:1},children:[g.jsx(It,{variant:o?"caption":"subtitle2",sx:{fontWeight:o?400:500,display:o?"block":void 0,opacity:o?.8:void 0,color:a.tileTitle,fontFamily:a.font.family},title:n,children:e}),t!==void 0&&g.jsx(It,{variant:"caption",sx:{display:"block",color:a.tileTitle,fontFamily:a.font.family,opacity:.8},children:t})]}),r]})}const vre=/^(https?|mailto|tel):/i,bre=/^[a-z][a-z0-9+.-]*:/i;function xre({href:e,title:t,children:n,context:r}){const o=!!e&&bre.test(e),a=!!e&&!o&&!e.startsWith("/")&&!e.startsWith("#");if(!e||!a||!r){const h=o&&!vre.test(e??"");return g.jsx("a",{href:h?void 0:e,title:t,...o?{target:"_blank",rel:"noopener noreferrer"}:{},children:n})}const i=r.sourcePath&&r.sourcePath.includes("/")?r.sourcePath.slice(0,r.sourcePath.lastIndexOf("/")+1):"",l=new URL(e,`https://malloy.invalid/${i}`),c=l.pathname.slice(1)+l.search+l.hash,f=`/${r.environmentName}/${r.packageName}/${c}`,{onNavigate:u}=r;return g.jsx("a",{href:f,title:t,onClick:u?h=>{h.preventDefault(),u(f,h)}:void 0,children:n})}const Sre={document:{"& > :first-child, & > div:only-child > :first-child":{mt:0},"& > :last-child, & > div:only-child > :last-child":{mb:0},"& h1, & h2, & h3, & h4, & h5, & h6":{fontWeight:"fontWeightMedium",color:"text.primary",mb:1,mt:2},"& h1":{fontSize:"28px"},"& h2":{fontSize:"24px"},"& h3":{fontSize:"20px"},"& p, & ul, & ol":{color:"text.primary",lineHeight:1.7,mb:1,fontSize:"16px"},"& li":{mb:.5}},caption:{color:"text.secondary",typography:"body2","& > :first-of-type":{mt:0},"& > :last-child":{mb:0},"& h1, & h2, & h3, & h4, & h5, & h6":{fontSize:"inherit",fontWeight:"fontWeightMedium",m:"0.5em 0 0.25em"},"& p":{m:"0.5em 0"},"& ul, & ol":{m:"0.5em 0",pl:3},"& code":{fontFamily:jo,fontSize:"0.9em"}}};function wre({alt:e}){return g.jsx(g.Fragment,{children:e})}function Jm({children:e,variant:t="caption",links:n,sx:r}){const{theme:o}=is();return g.jsx(Lt,{sx:[Sre[t],{fontFamily:o.font.family},...Array.isArray(r)?r:[r]],children:g.jsx(ree,{options:{forceBlock:t==="document",disableParsingRawHTML:!0,overrides:{a:{component:xre,props:{context:n}},img:{component:wre}}},children:e})})}const Cre=String.raw`##?\|?[ \t]*(?:[([{<][ \t]*)?(?:(?:(?:row|source)[-_]?)?authorize|access[-_]?filter)(?=[)\]}>]|[ \t]|$)`;function bz(e,t){if(/[\r\n]/.test(t))return`A ${e} is one line; it cannot hold a line break.`;if(new RegExp(Cre,"iu").test(t))return`A ${e} cannot contain what reads as an access-control tag (authorize, row_authorize, source_authorize or access_filter).`}function hE(e,t){if(e[t])return e;const n=e.default;return n?.[t]?n:e}const kre=e=>hE(e,"MalloyTranslator"),Ere=e=>hE(e,"parseAnnotation"),Rre=e=>hE(e,"ASTQuery");async function n0e(){return kre(await Co(()=>import("./index-D3HZqxOW.js").then(e=>e.i),__vite__mapDeps([0,1])))}async function r0e(){return Ere(await Co(()=>Promise.resolve().then(()=>Aee),void 0))}async function Tre(){return Rre(await Co(()=>import("./index-wawGd6k1.js").then(e=>e.i),__vite__mapDeps([2,1])))}const Ore=tr(g.jsx("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8m-5.5-2.5 7.51-3.49L17.5 6.5 9.99 9.99zm5.5-6.6c.61 0 1.1.49 1.1 1.1s-.49 1.1-1.1 1.1-1.1-.49-1.1-1.1.49-1.1 1.1-1.1"})),Mre=600,iA=()=>typeof IntersectionObserver>"u";function $re(e){for(let t=e.parentElement;t;t=t.parentElement){const{overflowY:n}=getComputedStyle(t);if((n==="auto"||n==="scroll")&&t.scrollHeight>t.clientHeight)return t}return null}function Pre(e=Mre){const[t,n]=k.useState(iA),r=k.useRef(t),o=k.useRef(null),a=k.useCallback(i=>{if(o.current?.disconnect(),o.current=null,!i||r.current||iA())return;const l=i.getBoundingClientRect(),c=$re(i),f=c?.getBoundingClientRect()??{top:0,bottom:window.innerHeight||document.documentElement.clientHeight};if(l.bottom>=f.top-e&&l.top<=f.bottom+e){r.current=!0,n(!0);return}const u=new IntersectionObserver(h=>{h.some(m=>m.isIntersecting)&&(r.current=!0,u.disconnect(),n(!0))},{root:c,rootMargin:`${e}px 0px`});u.observe(i),o.current=u},[e]);return k.useEffect(()=>()=>o.current?.disconnect(),[]),k.useEffect(()=>{if(t||typeof window>"u")return;const i=()=>{r.current=!0,o.current?.disconnect(),n(!0)};return window.addEventListener("beforeprint",i),()=>window.removeEventListener("beforeprint",i)},[t]),[a,t]}function xz({summary:e,detail:t}){return g.jsxs(qi,{severity:"error",sx:{"& .MuiAlert-message":{minWidth:0,flex:1}},children:[e!==void 0&&g.jsx(Lt,{sx:{mb:.5},children:e}),g.jsx(Lt,{component:"pre",sx:{m:0,whiteSpace:"pre-wrap",wordBreak:"break-word",fontFamily:jo,fontSize:"0.8125rem",color:"text.secondary"},children:t})]})}function Ta({error:e,context:t}){const n=e.data?.message||"Unknown error";return g.jsx(xz,{summary:t,detail:n})}function tx({label:e,onClick:t,disabled:n}){return g.jsx(eo,{variant:"contained",color:"primary",startIcon:g.jsx(pE,{}),onClick:t,disabled:n,"aria-label":`Add ${e.toLowerCase()}`,sx:{whiteSpace:"nowrap"},children:e})}function ty({label:e,icon:t,onClick:n,disabled:r,disabledReason:o,ariaLabel:a,ariaHasPopup:i}){const l=g.jsx("span",{children:g.jsx(eo,{variant:"outlined",startIcon:t,onClick:n,disabled:r,"aria-label":a,"aria-haspopup":i,sx:{whiteSpace:"nowrap"},children:e})});return r&&o?g.jsx(Zi,{title:o,children:l}):l}const ao=e=>{const t=new URL(e),n={};if(t.protocol!=="publisher:")throw new Error(`Failed to parse resource URI: ${e}`);const r=(t.hostname+t.pathname).split("/");for(let o=0;o<r.length;o+=2){const a=r[o];a==="environments"?n.environmentName=decodeURI(r[o+1])||void 0:a==="packages"?n.packageName=decodeURI(r[o+1])||void 0:a==="connections"?n.connectionName=decodeURI(r[o+1])||void 0:a==="models"&&(n.modelPath=decodeURI(r.slice(o+1).join("/"))||void 0)}if(n.versionId=t.searchParams.get("versionId")||void 0,!n.environmentName)throw new Error(`Failed to parse resource URI: ${e}`);return n},mE=e=>{if(!e.environmentName)throw new Error(`Failed to encode resource URI, missing environment name: ${e}`);let t=`publisher://environments/${e.environmentName}`;return e.packageName&&(t+=`/packages/${e.packageName}`),e.connectionName&&(t+=`/connections/${e.connectionName}`),e.modelPath&&(t+=`/models/${e.modelPath}`),e.packageName&&e.versionId&&(t+=`?versionId=${e.versionId}`),t},bp={opening:e=>e?`Opening the ${e}…`:"Opening…",running:"Running…",loading:"Loading…"};function ma({text:e,size:t=20,color:n="primary",thickness:r=3.6,centered:o=!0,spacing:a=2,textVariant:i="body2"}){const l=g.jsxs(Lt,{sx:{display:"flex",flexDirection:"column",alignItems:"center",gap:a},children:[g.jsx(Ug,{size:t,color:n,thickness:r}),e&&g.jsx(It,{variant:i,color:"text.secondary",children:e})]});return o?g.jsx(Lt,{sx:{display:"flex",justifyContent:"center",alignItems:"center",minHeight:"200px",width:"100%"},children:l}):l}var aC={exports:{}},Are=aC.exports,sA;function Dre(){return sA||(sA=1,(function(e,t){(function(n,r){e.exports=r()})(Are,(function(){var n=1e3,r=6e4,o=36e5,a="millisecond",i="second",l="minute",c="hour",f="day",u="week",h="month",m="quarter",v="year",b="date",x="Invalid Date",w=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,S=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,R={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(N){var V=["th","st","nd","rd"],A=N%100;return"["+N+(V[(A-20)%10]||V[A]||V[0])+"]"}},E=function(N,V,A){var Y=String(N);return!Y||Y.length>=V?N:""+Array(V+1-Y.length).join(A)+N},M={s:E,z:function(N){var V=-N.utcOffset(),A=Math.abs(V),Y=Math.floor(A/60),W=A%60;return(V<=0?"+":"-")+E(Y,2,"0")+":"+E(W,2,"0")},m:function N(V,A){if(V.date()<A.date())return-N(A,V);var Y=12*(A.year()-V.year())+(A.month()-V.month()),W=V.clone().add(Y,h),re=A-W<0,Q=V.clone().add(Y+(re?-1:1),h);return+(-(Y+(A-W)/(re?W-Q:Q-W))||0)},a:function(N){return N<0?Math.ceil(N)||0:Math.floor(N)},p:function(N){return{M:h,y:v,w:u,d:f,D:b,h:c,m:l,s:i,ms:a,Q:m}[N]||String(N||"").toLowerCase().replace(/s$/,"")},u:function(N){return N===void 0}},$="en",D={};D[$]=R;var F="$isDayjsObject",I=function(N){return N instanceof C||!(!N||!N[F])},U=function N(V,A,Y){var W;if(!V)return $;if(typeof V=="string"){var re=V.toLowerCase();D[re]&&(W=re),A&&(D[re]=A,W=re);var Q=V.split("-");if(!W&&Q.length>1)return N(Q[0])}else{var oe=V.name;D[oe]=V,W=oe}return!Y&&W&&($=W),W||!Y&&$},z=function(N,V){if(I(N))return N.clone();var A=typeof V=="object"?V:{};return A.date=N,A.args=arguments,new C(A)},L=M;L.l=U,L.i=I,L.w=function(N,V){return z(N,{locale:V.$L,utc:V.$u,x:V.$x,$offset:V.$offset})};var C=(function(){function N(A){this.$L=U(A.locale,null,!0),this.parse(A),this.$x=this.$x||A.x||{},this[F]=!0}var V=N.prototype;return V.parse=function(A){this.$d=(function(Y){var W=Y.date,re=Y.utc;if(W===null)return new Date(NaN);if(L.u(W))return new Date;if(W instanceof Date)return new Date(W);if(typeof W=="string"&&!/Z$/i.test(W)){var Q=W.match(w);if(Q){var oe=Q[2]-1||0,ce=(Q[7]||"0").substring(0,3);return re?new Date(Date.UTC(Q[1],oe,Q[3]||1,Q[4]||0,Q[5]||0,Q[6]||0,ce)):new Date(Q[1],oe,Q[3]||1,Q[4]||0,Q[5]||0,Q[6]||0,ce)}}return new Date(W)})(A),this.init()},V.init=function(){var A=this.$d;this.$y=A.getFullYear(),this.$M=A.getMonth(),this.$D=A.getDate(),this.$W=A.getDay(),this.$H=A.getHours(),this.$m=A.getMinutes(),this.$s=A.getSeconds(),this.$ms=A.getMilliseconds()},V.$utils=function(){return L},V.isValid=function(){return this.$d.toString()!==x},V.isSame=function(A,Y){var W=z(A);return this.startOf(Y)<=W&&W<=this.endOf(Y)},V.isAfter=function(A,Y){return z(A)<this.startOf(Y)},V.isBefore=function(A,Y){return this.endOf(Y)<z(A)},V.$g=function(A,Y,W){return L.u(A)?this[Y]:this.set(W,A)},V.unix=function(){return Math.floor(this.valueOf()/1e3)},V.valueOf=function(){return this.$d.getTime()},V.startOf=function(A,Y){var W=this,re=!!L.u(Y)||Y,Q=L.p(A),oe=function(pe,ye){var ie=L.w(W.$u?Date.UTC(W.$y,ye,pe):new Date(W.$y,ye,pe),W);return re?ie:ie.endOf(f)},ce=function(pe,ye){return L.w(W.toDate()[pe].apply(W.toDate("s"),(re?[0,0,0,0]:[23,59,59,999]).slice(ye)),W)},Z=this.$W,ae=this.$M,J=this.$D,ne="set"+(this.$u?"UTC":"");switch(Q){case v:return re?oe(1,0):oe(31,11);case h:return re?oe(1,ae):oe(0,ae+1);case u:var ee=this.$locale().weekStart||0,ue=(Z<ee?Z+7:Z)-ee;return oe(re?J-ue:J+(6-ue),ae);case f:case b:return ce(ne+"Hours",0);case c:return ce(ne+"Minutes",1);case l:return ce(ne+"Seconds",2);case i:return ce(ne+"Milliseconds",3);default:return this.clone()}},V.endOf=function(A){return this.startOf(A,!1)},V.$set=function(A,Y){var W,re=L.p(A),Q="set"+(this.$u?"UTC":""),oe=(W={},W[f]=Q+"Date",W[b]=Q+"Date",W[h]=Q+"Month",W[v]=Q+"FullYear",W[c]=Q+"Hours",W[l]=Q+"Minutes",W[i]=Q+"Seconds",W[a]=Q+"Milliseconds",W)[re],ce=re===f?this.$D+(Y-this.$W):Y;if(re===h||re===v){var Z=this.clone().set(b,1);Z.$d[oe](ce),Z.init(),this.$d=Z.set(b,Math.min(this.$D,Z.daysInMonth())).$d}else oe&&this.$d[oe](ce);return this.init(),this},V.set=function(A,Y){return this.clone().$set(A,Y)},V.get=function(A){return this[L.p(A)]()},V.add=function(A,Y){var W,re=this;A=Number(A);var Q=L.p(Y),oe=function(ae){var J=z(re);return L.w(J.date(J.date()+Math.round(ae*A)),re)};if(Q===h)return this.set(h,this.$M+A);if(Q===v)return this.set(v,this.$y+A);if(Q===f)return oe(1);if(Q===u)return oe(7);var ce=(W={},W[l]=r,W[c]=o,W[i]=n,W)[Q]||1,Z=this.$d.getTime()+A*ce;return L.w(Z,this)},V.subtract=function(A,Y){return this.add(-1*A,Y)},V.format=function(A){var Y=this,W=this.$locale();if(!this.isValid())return W.invalidDate||x;var re=A||"YYYY-MM-DDTHH:mm:ssZ",Q=L.z(this),oe=this.$H,ce=this.$m,Z=this.$M,ae=W.weekdays,J=W.months,ne=W.meridiem,ee=function(ye,ie,he,le){return ye&&(ye[ie]||ye(Y,re))||he[ie].slice(0,le)},ue=function(ye){return L.s(oe%12||12,ye,"0")},pe=ne||function(ye,ie,he){var le=ye<12?"AM":"PM";return he?le.toLowerCase():le};return re.replace(S,(function(ye,ie){return ie||(function(he){switch(he){case"YY":return String(Y.$y).slice(-2);case"YYYY":return L.s(Y.$y,4,"0");case"M":return Z+1;case"MM":return L.s(Z+1,2,"0");case"MMM":return ee(W.monthsShort,Z,J,3);case"MMMM":return ee(J,Z);case"D":return Y.$D;case"DD":return L.s(Y.$D,2,"0");case"d":return String(Y.$W);case"dd":return ee(W.weekdaysMin,Y.$W,ae,2);case"ddd":return ee(W.weekdaysShort,Y.$W,ae,3);case"dddd":return ae[Y.$W];case"H":return String(oe);case"HH":return L.s(oe,2,"0");case"h":return ue(1);case"hh":return ue(2);case"a":return pe(oe,ce,!0);case"A":return pe(oe,ce,!1);case"m":return String(ce);case"mm":return L.s(ce,2,"0");case"s":return String(Y.$s);case"ss":return L.s(Y.$s,2,"0");case"SSS":return L.s(Y.$ms,3,"0");case"Z":return Q}return null})(ye)||Q.replace(":","")}))},V.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},V.diff=function(A,Y,W){var re,Q=this,oe=L.p(Y),ce=z(A),Z=(ce.utcOffset()-this.utcOffset())*r,ae=this-ce,J=function(){return L.m(Q,ce)};switch(oe){case v:re=J()/12;break;case h:re=J();break;case m:re=J()/3;break;case u:re=(ae-Z)/6048e5;break;case f:re=(ae-Z)/864e5;break;case c:re=ae/o;break;case l:re=ae/r;break;case i:re=ae/n;break;default:re=ae}return W?re:L.a(re)},V.daysInMonth=function(){return this.endOf(h).$D},V.$locale=function(){return D[this.$L]},V.locale=function(A,Y){if(!A)return this.$L;var W=this.clone(),re=U(A,Y,!0);return re&&(W.$L=re),W},V.clone=function(){return L.w(this.$d,this)},V.toDate=function(){return new Date(this.valueOf())},V.toJSON=function(){return this.isValid()?this.toISOString():null},V.toISOString=function(){return this.$d.toISOString()},V.toString=function(){return this.$d.toUTCString()},N})(),j=C.prototype;return z.prototype=j,[["$ms",a],["$s",i],["$m",l],["$H",c],["$W",f],["$M",h],["$y",v],["$D",b]].forEach((function(N){j[N[1]]=function(V){return this.$g(V,N[0],N[1])}})),z.extend=function(N,V){return N.$i||(N(V,C,z),N.$i=!0),z},z.locale=U,z.isDayjs=I,z.unix=function(N){return z(1e3*N)},z.en=D[$],z.Ls=D,z.p={},z}))})(aC)),aC.exports}var jre=Dre();const Pr=Jl(jre);var iC={exports:{}},Nre=iC.exports,lA;function Ire(){return lA||(lA=1,(function(e,t){(function(n,r){e.exports=r()})(Nre,(function(){var n="minute",r=/[+-]\d\d(?::?\d\d)?/g,o=/([+-]|\d\d)/g;return function(a,i,l){var c=i.prototype;l.utc=function(x){var w={date:x,utc:!0,args:arguments};return new i(w)},c.utc=function(x){var w=l(this.toDate(),{locale:this.$L,utc:!0});return x?w.add(this.utcOffset(),n):w},c.local=function(){return l(this.toDate(),{locale:this.$L,utc:!1})};var f=c.parse;c.parse=function(x){x.utc&&(this.$u=!0),this.$utils().u(x.$offset)||(this.$offset=x.$offset),f.call(this,x)};var u=c.init;c.init=function(){if(this.$u){var x=this.$d;this.$y=x.getUTCFullYear(),this.$M=x.getUTCMonth(),this.$D=x.getUTCDate(),this.$W=x.getUTCDay(),this.$H=x.getUTCHours(),this.$m=x.getUTCMinutes(),this.$s=x.getUTCSeconds(),this.$ms=x.getUTCMilliseconds()}else u.call(this)};var h=c.utcOffset;c.utcOffset=function(x,w){var S=this.$utils().u;if(S(x))return this.$u?0:S(this.$offset)?h.call(this):this.$offset;if(typeof x=="string"&&(x=(function($){$===void 0&&($="");var D=$.match(r);if(!D)return null;var F=(""+D[0]).match(o)||["-",0,0],I=F[0],U=60*+F[1]+ +F[2];return U===0?0:I==="+"?U:-U})(x),x===null))return this;var R=Math.abs(x)<=16?60*x:x;if(R===0)return this.utc(w);var E=this.clone();if(w)return E.$offset=R,E.$u=!1,E;var M=this.$u?this.toDate().getTimezoneOffset():-1*this.utcOffset();return(E=this.local().add(R+M,n)).$offset=R,E.$x.$localOffset=M,E};var m=c.format;c.format=function(x){var w=x||(this.$u?"YYYY-MM-DDTHH:mm:ss[Z]":"");return m.call(this,w)},c.valueOf=function(){var x=this.$utils().u(this.$offset)?0:this.$offset+(this.$x.$localOffset||this.$d.getTimezoneOffset());return this.$d.valueOf()-6e4*x},c.isUTC=function(){return!!this.$u},c.toISOString=function(){return this.toDate().toISOString()},c.toString=function(){return this.toDate().toUTCString()};var v=c.toDate;c.toDate=function(x){return x==="s"&&this.$offset?l(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate():v.call(this)};var b=c.diff;c.diff=function(x,w,S){if(x&&this.$u===x.$u)return b.call(this,x,w,S);var R=this.local(),E=l(x).local();return b.call(R,E,w,S)}}}))})(iC)),iC.exports}var Lre=Ire();const gE=Jl(Lre);Pr.extend(gE);function Gu(e){return(e??"").startsWith("filter<")}function zre(e){const{parsed:t}=Ci.BooleanFilterExpression.parse(e);if(!(!t||t.not))return t.operator==="true"||t.operator==="false"?t.operator:void 0}function Qf(e){const t=/^filter<(.+)>$/.exec(e??"");return t?t[1]:void 0}function yE(e){const t=e.filter(n=>n.trim()!=="");return t.length===0?"":Ci.StringFilterExpression.unparse({operator:"=",values:[...t]})}function Fre(e){if(e.trim()==="")return[];const{parsed:t}=Ci.StringFilterExpression.parse(e);return Sz(t)?t.values:[e]}function _re(e){return e===void 0||e.trim()===""?!0:Sz(Ci.StringFilterExpression.parse(e).parsed)}function Sz(e){return e!==null&&Ci.isStringCondition(e)&&e.operator==="="&&e.not!==!0}function Ure(e){return Ci.NumberFilterExpression.unparse({operator:">=",values:[String(e)]})}function Bre(e){const t=e.trim();if(t==="")return;const{parsed:n}=Ci.NumberFilterExpression.parse(t);if(n===null||n.operator!==">="||n.not===!0||n.values?.length!==1)return;const r=Number(n.values[0]);return Number.isFinite(r)?r:void 0}function Vre(e,t){return Ci.NumberFilterExpression.unparse({operator:"range",startOperator:">=",startValue:String(e),endOperator:"<=",endValue:String(t)})}function Hre(e){const t=e.trim();if(t==="")return;const{parsed:n}=Ci.NumberFilterExpression.parse(t);if(n===null||n.operator!=="range"||n.not===!0||n.startOperator!==">="||n.endOperator!=="<=")return;const r=Number(n.startValue),o=Number(n.endValue);return Number.isFinite(r)&&Number.isFinite(o)&&r<=o?[r,o]:void 0}const Ib=[{key:"today",label:"Today",clause:{operator:"in",in:{moment:"today"}}},{key:"7d",label:"Last 7 days",clause:{operator:"in_last",units:"day",n:"7"}},{key:"30d",label:"Last 30 days",clause:{operator:"in_last",units:"day",n:"30"}},{key:"90d",label:"Last 90 days",clause:{operator:"in_last",units:"day",n:"90"}},{key:"12m",label:"Last 12 months",clause:{operator:"in_last",units:"month",n:"12"}}];function qre(e){const t=Ib.find(n=>n.key===e);return t?Ci.TemporalFilterExpression.unparse(t.clause):void 0}function Wre(e){const t=e.trim();if(t==="")return;const{parsed:n}=Ci.TemporalFilterExpression.parse(t);if(n!==null)for(const r of Ib){const o=r.clause;if(o.operator===n.operator&&(o.operator==="in"&&n.operator==="in"&&n.not!==!0&&n.in.moment===o.in.moment||o.operator==="in_last"&&n.operator==="in_last"&&n.not!==!0&&n.units===o.units&&Number(n.n)===Number(o.n)))return r.key}}const Yre=/^\d{4}-\d{2}-\d{2}$/;function Gre(e,t){const n=Pr.utc(t,"YYYY-MM-DD").add(1,"day");return Ci.TemporalFilterExpression.unparse({operator:"to",fromMoment:{moment:"literal",literal:e,units:"day"},toMoment:{moment:"literal",literal:n.format("YYYY-MM-DD"),units:"day"}})}function Kre(e){const t=e.trim();if(t==="")return;const{parsed:n}=Ci.TemporalFilterExpression.parse(t);if(n===null||n.operator!=="to"||n.not===!0)return;const r=cA(n.fromMoment),o=cA(n.toMoment);if(r===void 0||o===void 0)return;const a=Pr.utc(o,"YYYY-MM-DD").subtract(1,"day");if(!(!a.isValid()||a.isBefore(Pr.utc(r,"YYYY-MM-DD"))))return{firstDay:r,lastDay:a.format("YYYY-MM-DD")}}function cA(e){return e.moment==="literal"&&Yre.test(e.literal)?e.literal:void 0}const HS="self";function wz(e){if(!e)return[];if(e.wasDimension&&!e.wasDimension())return[];const t=e.tag?.tag("drill");return t?(t.textArray("to")??[t.text("to")].filter(uA)).filter(uA):[]}function Cz(e){const t=e.replace(/[-_]+/g," ").trim();return t.charAt(0).toUpperCase()+t.slice(1)}function kz(e){return e.tag?.tag("drill")?.text("given")??e.name}function nx(e){if(typeof e=="string"){const t=yE([e]);return t===""?void 0:t}if(typeof e=="boolean")return String(e);if(typeof e=="number")return Number.isFinite(e)?String(e):void 0;if(e instanceof Date){const t=e.toISOString();return t.slice(0,t.indexOf("T"))}}function Ez(e){return e instanceof Date?nx(e)??"":String(e)}function Qre(e){if(!e||e.isHeader)return;const t=e.field;if(!t)return;const n=wz(t);if(n.length===0)return;const r=nx(e.value);if(r!==void 0)return{to:n,given:kz(t),value:r,rawValue:e.value,label:Ez(e.value)}}function uA(e){return typeof e=="string"&&e!==""}function Xre(e,t){if(t!==void 0&&!Gu(t)){if(t==="number"){if(typeof e=="number")return Number.isFinite(e)?e:void 0;if(typeof e!="string"||e.trim()==="")return;const n=Number(e);return Number.isFinite(n)?n:void 0}if(t==="date"||t==="timestamp"||t==="timestamptz")return e instanceof Date?e:void 0;if(t==="boolean")return typeof e=="boolean"?e:e==="true"?!0:e==="false"?!1:void 0;if(typeof e=="string")return e.trim()===""?void 0:e;if(typeof e=="number")return Number.isFinite(e)?String(e):void 0;if(typeof e=="boolean")return String(e)}return Qf(t)==="string"&&typeof e=="number"?Number.isFinite(e)?yE([String(e)]):void 0:Qf(t)==="number"?typeof e=="number"?Number.isFinite(e)?String(e):void 0:typeof e!="string"||e.trim()===""?void 0:Number.isFinite(Number(e))?e.trim():void 0:nx(e)}function Zre({declaredTypes:e,setGiven:t,documentName:n}){const r=k.useMemo(()=>{const l=new Map;for(const c of e.keys())l.has(c.toLowerCase())||l.set(c.toLowerCase(),c);return l},[e]),o=k.useCallback(l=>e.has(l)?l:r.get(l.toLowerCase()),[e,r]),a=k.useCallback(l=>o(l)!==void 0,[o]),i=k.useCallback((l,c)=>{const f=o(l);if(f===void 0){console.warn(`# drill { to=self } tried to set '${l}', which '${n}' does not declare as a given. Name the given with 'given=' on the drill tag.`);return}const u=e.get(f),h=Xre(c,u);if(h===void 0){console.warn(`Drill declined: ${JSON.stringify(c)} cannot be a value for given "${f}"`+(u?` of type ${u}`:""));return}t(f,h)},[e,n,o,t]);return{resolveGiven:o,canSelf:a,onSelf:i}}function Jre(e,t){if(e!=null){if(e instanceof Date)return vE(e,t);if(!Array.isArray(e))return String(e)}}function eoe(e,t){return new Date(Date.UTC(e.year(),e.month(),e.date(),t?.getUTCHours()??0,t?.getUTCMinutes()??0,t?.getUTCSeconds()??0,t?.getUTCMilliseconds()??0))}const toe=/^(\d{4})-(\d{1,2})-(\d{1,2})(?:[T\s]+(\d{1,2}):(\d{2})(?::(\d{2}))?(?:\.(\d{1,9}))?)?\s*(Z|[+-]\d{2}:?\d{2}|[+-]\d{2}|UTC|GMT)?$/i;function Rz(e){const t=e.trim();return t===""?e:t.replace(/^(\d{4}-\d{1,2}-\d{1,2}[T\s]+\d{1,2}:\d{2}(?::\d{2})?(?:\.\d{1,9})?)\s+(\d{2}:?\d{2}|\d{2})$/,"$1+$2")}function noe(e,t=!1){const n=Rz(e);if(n==="")return;const r=toe.exec(n);if(!r)return;const[,o,a,i,l,c,f,u,h]=r,m={year:Number(o),month:Number(a),day:Number(i),hour:Number(l??0),minute:Number(c??0),second:Number(f??0),milli:Number((u??"").slice(0,3).padEnd(3,"0")||0)},v=Date.UTC(m.year,m.month-1,m.day,m.hour,m.minute,m.second,m.milli),b=new Date(v);if(!(b.getUTCFullYear()===m.year&&b.getUTCMonth()===m.month-1&&b.getUTCDate()===m.day&&b.getUTCHours()===m.hour&&b.getUTCMinutes()===m.minute&&b.getUTCSeconds()===m.second)||h!==void 0&&l===void 0)return;const x=roe(h);if(x===void 0)return;const w=new Date(v-x*6e4);if(!(t&&h!==void 0&&w.getUTCDate()!==m.day))return w}function roe(e){if(e===void 0)return 0;const t=e.toUpperCase();if(t==="Z"||t==="UTC"||t==="GMT")return 0;const n=/^([+-])(\d{2}):?(\d{2})?$/.exec(t);if(!n)return;const r=Number(n[3]??0);if(r>59)return;const o=Number(n[2])*60+r,a=n[1]!=="-";if(!(o>(a?840:720)))return a?o:-o}function ooe(e){return!aoe.has(e??"")}const aoe=new Set(["boolean","number","date","timestamp","timestamptz"]);function Tz(e,t){if(t===""&&!ooe(e))return null;if(Gu(e))return t;switch(e){case"number":{const n=t.trim()===""?NaN:Number(t);return Number.isFinite(n)?n:t}case"boolean":return t==="true"?!0:t==="false"?!1:t;case"date":case"timestamp":case"timestamptz":{const n=Rz(t);return noe(n,e==="date")??n}default:return t}}function Oz(e,t){const n={};for(const[r,o]of e){const a=Jre(o,t.get(r));a!==void 0&&(n[r]=a)}return n}function vE(e,t){const n=e.toISOString();switch(t){case"timestamptz":return n;case"timestamp":return n.slice(0,-1);default:return n.slice(0,10)}}function ny(e,t,n){const r=n?new Set(n):void 0,o={};for(const[a,i]of e)r&&!r.has(a)||i!=null&&(Array.isArray(i)||(o[a]=i instanceof Date?vE(i,t.get(a)):i));return o}function bE(e,t,n){if(!t)return e;const r=n?new Set(n):void 0,o={...e};for(const[a,i]of Object.entries(t))r&&!r.has(a)||a in o||i===null||i===void 0||(o[a]=Array.isArray(i)?[...i]:i instanceof Date?vE(i,void 0):i);return o}function dA(e,t){const n=new Map;for(const[r,o]of Object.entries(e))t.has(r)&&n.set(r,Tz(t.get(r),o));return n}function fA(e,t){const n=Array.from(e.keys()).filter(o=>!t.has(o));if(n.length===0)return e;const r=new Map(e);for(const o of n)r.delete(o);return r}function pA(e){return Object.entries(e??{}).sort(([t],[n])=>t<n?-1:1)}function ioe(e,t,n){for(const r of n.keys())if(e[r]!==t[r])return!1;return!0}function hA(e,t){const n=Object.keys(e);return n.length!==Object.keys(t).length?!1:n.every(r=>e[r]===t[r])}function soe({declaredTypes:e,startingValues:t,params:n,onParamsChange:r,documentKey:o,autorun:a}){const i=k.useMemo(()=>dA(t??{},e),[e,JSON.stringify(t)]),l=k.useRef(null),c=k.useRef(null),f=k.useRef({documentKey:o,params:n}),u=L=>L!==null&&ioe(n??{},L,e);u(l.current)&&(c.current=null),(f.current.documentKey!==o||!hA(n??{},f.current.params??{})&&!u(l.current)&&!u(c.current))&&(f.current={documentKey:o,params:n});const h=f.current.params,m=JSON.stringify(t),v=JSON.stringify(h),b=k.useMemo(()=>dA({...t??{},...h??{}},e),[e,m,v]),x=k.useMemo(()=>JSON.stringify([o??null,pA(t),pA(h)]),[o,m,v]),[w,S]=k.useState(null),R=w?.key===x?w:null;k.useEffect(()=>{w!==null&&w.key!==x&&S(null)},[w,x]);const E=k.useMemo(()=>fA(R?.draft??b,e),[R,b,e]),M=k.useMemo(()=>fA(R?.applied??b,e),[R,b,e]),$=k.useCallback(L=>L?.key===x?L:{key:x,draft:b,applied:b},[x,b]),D=k.useMemo(()=>Oz(M,e),[M,e]);l.current===null&&(l.current=D),k.useEffect(()=>{r&&(hA(l.current??{},D)||(c.current=l.current,l.current=D,r(D)))},[D,r]);const F=k.useCallback((L,C)=>{S(j=>{const N=$(j),V=new Map(N.draft);return C===null?V.delete(L):V.set(L,C),{key:N.key,draft:V,applied:a?V:N.applied}})},[a,$]),I=k.useCallback(()=>{S(L=>({key:$(L).key,draft:i,applied:i}))},[$,i]),U=k.useCallback(()=>{S(L=>{const C=$(L);return{key:C.key,draft:C.draft,applied:C.draft}})},[$]),z=k.useMemo(()=>{if(a)return!1;if(E.size!==M.size)return!0;for(const[L,C]of E){const j=M.get(L);if(C instanceof Date&&j instanceof Date){if(C.getTime()!==j.getTime())return!0}else if(Array.isArray(C)&&Array.isArray(j)){if(String(C)!==String(j))return!0}else if(C!==j)return!0}return!1},[a,E,M]);return{draft:E,applied:M,setGiven:F,reset:I,apply:U,pending:z}}const loe="You don't have access to this data";function o0e(e){return(e??[]).filter(t=>t.kind==="definition"&&!t.restricted).map(t=>t.text??"").join(`
350
350
 
351
351
  `)}function Mz(e,t){return e===""?t:`${e}
352
352
 
@@ -467,7 +467,7 @@ ${t}`}function coe(e){return e?.status===403}const uoe=1e3;function $z(e){const
467
467
  `));u&&I.current&&I.current.getSectionContent($.startIndex).focus()},[]),{interactions:V,returnedValue:{autoFocus:u,readOnly:n,focused:f??j,sectionListRef:U,onBlur:oe,onClick:Y,onFocus:Q,onInput:W,onPaste:re,enableAccessibleFieldDOMStructure:!0,elements:ye,tabIndex:x===0?-1:0,contentEditable:pe,value:he,onChange:ie,areAllSectionsEmpty:D}}},Xf=e=>e.replace(/[\u2066\u2067\u2068\u2069]/g,""),ude=(e,t,n)=>{let r=0,o=n?1:0;const a=[];for(let i=0;i<e.length;i+=1){const l=e[i],c=EE(l,n?"input-rtl":"input-ltr",t),f=`${l.startSeparator}${c}${l.endSeparator}`,u=Xf(f).length,h=f.length,m=Xf(c),v=o+(m===""?0:c.indexOf(m[0]))+l.startSeparator.length,b=v+m.length;a.push(Ie({},l,{start:r,end:r+u,startInInput:v,endInInput:b})),r+=u,o+=h}return a},dde=e=>{const t=Os(),n=k.useRef(void 0),r=k.useRef(void 0),{forwardedProps:{onFocus:o,onClick:a,onPaste:i,onBlur:l,inputRef:c,placeholder:f},internalProps:{readOnly:u=!1,disabled:h=!1},parsedSelectedSections:m,activeSectionIndex:v,state:b,fieldValueManager:x,valueManager:w,applyCharacterEditing:S,resetCharacterQuery:R,updateSectionValue:E,updateValueFromValueStr:M,clearActiveSection:$,clearValue:D,setTempAndroidValueStr:F,setSelectedSections:I,getSectionsFromValue:U,areAllSectionsEmpty:z,localizedDigits:L}=e,C=k.useRef(null),j=mr(c,C),N=k.useMemo(()=>ude(b.sections,L,t),[b.sections,L,t]),V=k.useMemo(()=>({syncSelectionToDOM:()=>{if(!C.current)return;if(m==null){C.current.scrollLeft&&(C.current.scrollLeft=0);return}if(C.current!==La(document))return;const ne=C.current.scrollTop;if(m==="all")C.current.select();else{const ee=N[m],ue=ee.type==="empty"?ee.startInInput-ee.startSeparator.length:ee.startInInput,pe=ee.type==="empty"?ee.endInInput+ee.endSeparator.length:ee.endInInput;(ue!==C.current.selectionStart||pe!==C.current.selectionEnd)&&C.current===La(document)&&C.current.setSelectionRange(ue,pe),clearTimeout(r.current),r.current=setTimeout(()=>{C.current&&C.current===La(document)&&C.current.selectionStart===C.current.selectionEnd&&(C.current.selectionStart!==ue||C.current.selectionEnd!==pe)&&V.syncSelectionToDOM()})}C.current.scrollTop=ne},getActiveSectionIndexFromDOM:()=>{const ne=C.current.selectionStart??0,ee=C.current.selectionEnd??0;if(ne===0&&ee===0)return null;const ue=ne<=N[0].startInInput?1:N.findIndex(pe=>pe.startInInput-pe.startSeparator.length>ne);return ue===-1?N.length-1:ue-1},focusField:(ne=0)=>{La(document)!==C.current&&(C.current?.focus(),I(ne))},setSelectedSections:ne=>I(ne),isFieldFocused:()=>C.current===La(document)}),[C,m,N,I]),A=()=>{const ne=C.current.selectionStart??0;let ee;ne<=N[0].startInInput||ne>=N[N.length-1].endInInput?ee=1:ee=N.findIndex(pe=>pe.startInInput-pe.startSeparator.length>ne);const ue=ee===-1?N.length-1:ee-1;I(ue)},Y=Bt((...ne)=>{o?.(...ne);const ee=C.current;clearTimeout(n.current),n.current=setTimeout(()=>{!ee||ee!==C.current||v==null&&(ee.value.length&&Number(ee.selectionEnd)-Number(ee.selectionStart)===ee.value.length?I("all"):A())})}),W=Bt((ne,...ee)=>{ne.isDefaultPrevented()||(a?.(ne,...ee),A())}),re=Bt(ne=>{if(i?.(ne),ne.preventDefault(),u||h)return;const ee=ne.clipboardData.getData("text");if(typeof m=="number"){const ue=b.sections[m],pe=/^[a-zA-Z]+$/.test(ee),ye=/^[0-9]+$/.test(ee),ie=/^(([a-zA-Z]+)|)([0-9]+)(([a-zA-Z]+)|)$/.test(ee);if(ue.contentType==="letter"&&pe||ue.contentType==="digit"&&ye||ue.contentType==="digit-with-letter"&&ie){R(),E({activeSection:ue,newSectionValue:ee,shouldGoToNextSection:!0});return}if(pe||ye)return}R(),M(ee)}),Q=Bt((...ne)=>{l?.(...ne),I(null)}),oe=Bt(ne=>{if(u)return;const ee=ne.target.value;if(ee===""){R(),D();return}const ue=ne.nativeEvent.data,pe=ue&&ue.length>1,ye=pe?ue:ee,ie=Xf(ye);if(m==="all"&&I(v),v==null||pe){M(pe?ue:ie);return}let he;if(m==="all"&&ie.length===1)he=ie;else{const le=Xf(x.getV6InputValueFromSections(N,L,t));let be=-1,Ve=-1;for(let de=0;de<le.length;de+=1)be===-1&&le[de]!==ie[de]&&(be=de),Ve===-1&&le[le.length-de-1]!==ie[ie.length-de-1]&&(Ve=de);const Re=N[v];if(be<Re.start||le.length-Ve-1>Re.end)return;const Oe=ie.length-le.length+Re.end-Xf(Re.endSeparator||"").length;he=ie.slice(Re.start+Xf(Re.startSeparator||"").length,Oe)}if(he.length===0){hae()&&F(ye),R(),$();return}S({keyPressed:he,sectionIndex:v})}),ce=k.useMemo(()=>f!==void 0?f:x.getV6InputValueFromSections(U(w.emptyValue),L,t),[f,x,U,w.emptyValue,L,t]),Z=k.useMemo(()=>b.tempValueStrAndroid??x.getV6InputValueFromSections(b.sections,L,t),[b.sections,x,b.tempValueStrAndroid,L,t]);k.useEffect(()=>(C.current&&C.current===La(document)&&I("all"),()=>{clearTimeout(n.current),clearTimeout(r.current)}),[]);const ae=k.useMemo(()=>v==null||b.sections[v].contentType==="letter"?"text":"numeric",[v,b.sections]),J=!(C.current&&C.current===La(document))&&z;return{interactions:V,returnedValue:{readOnly:u,onBlur:Q,onClick:W,onFocus:Y,onPaste:re,inputRef:j,enableAccessibleFieldDOMStructure:!1,placeholder:ce,inputMode:ae,autoComplete:"off",value:J?"":Z,onChange:oe}}},fde=e=>{const t=Yr(),{internalProps:n,internalProps:{unstableFieldRef:r,minutesStep:o,enableAccessibleFieldDOMStructure:a=!1,disabled:i=!1,readOnly:l=!1},forwardedProps:{onKeyDown:c,error:f,clearable:u,onClear:h},fieldValueManager:m,valueManager:v,validator:b}=e,x=Os(),w=ide(e),{state:S,activeSectionIndex:R,parsedSelectedSections:E,setSelectedSections:M,clearValue:$,clearActiveSection:D,updateSectionValue:F,setTempAndroidValueStr:I,sectionsValueBoundaries:U,localizedDigits:z,timezone:L}=w,C=lde({sections:S.sections,updateSectionValue:F,sectionsValueBoundaries:U,localizedDigits:z,setTempAndroidValueStr:I,timezone:L}),{resetCharacterQuery:j}=C,N=v.areValuesEqual(t,S.value,v.emptyValue),V=a?cde:dde,A=k.useMemo(()=>mae(S.sections,x&&!a),[S.sections,x,a]),{returnedValue:Y,interactions:W}=V(Ie({},e,w,C,{areAllSectionsEmpty:N,sectionOrder:A})),re=Bt(J=>{if(c?.(J),!i)switch(!0){case((J.ctrlKey||J.metaKey)&&String.fromCharCode(J.keyCode)==="A"&&!J.shiftKey&&!J.altKey):{J.preventDefault(),M("all");break}case J.key==="ArrowRight":{if(J.preventDefault(),E==null)M(A.startIndex);else if(E==="all")M(A.endIndex);else{const ne=A.neighbors[E].rightIndex;ne!==null&&M(ne)}break}case J.key==="ArrowLeft":{if(J.preventDefault(),E==null)M(A.endIndex);else if(E==="all")M(A.startIndex);else{const ne=A.neighbors[E].leftIndex;ne!==null&&M(ne)}break}case J.key==="Delete":{if(J.preventDefault(),l)break;E==null||E==="all"?$():D(),j();break}case["ArrowUp","ArrowDown","Home","End","PageUp","PageDown"].includes(J.key):{if(J.preventDefault(),l||R==null)break;E==="all"&&M(R);const ne=S.sections[R],ee=m.getActiveDateManager(t,S,ne),ue=sae(t,L,ne,J.key,U,z,ee.date,{minutesStep:o});F({activeSection:ne,newSectionValue:ue,shouldGoToNextSection:!1});break}}});zo(()=>{W.syncSelectionToDOM()});const{hasValidationError:Q}=Jz({props:n,validator:b,timezone:L,value:S.value,onError:n.onError}),oe=k.useMemo(()=>f!==void 0?f:Q,[Q,f]);k.useEffect(()=>{!oe&&R==null&&j()},[S.referenceValue,R,oe]),k.useEffect(()=>{S.tempValueStrAndroid!=null&&R!=null&&(j(),D())},[S.sections]),k.useImperativeHandle(r,()=>({getSections:()=>S.sections,getActiveSectionIndex:W.getActiveSectionIndexFromDOM,setSelectedSections:W.setSelectedSections,focusField:W.focusField,isFieldFocused:W.isFieldFocused}));const ce=Bt((J,...ne)=>{J.preventDefault(),h?.(J,...ne),$(),W.isFieldFocused()?M(A.startIndex):W.focusField(0)}),Z={onKeyDown:re,onClear:ce,error:oe,clearable:!!(u&&!N&&!l&&!i)},ae={disabled:i,readOnly:l};return Ie({},e.forwardedProps,Z,ae,Y)},pde=["clearable","onClear","InputProps","sx","slots","slotProps"],hde=["ownerState"],mde=e=>{const t=ec(),{clearable:n,onClear:r,InputProps:o,sx:a,slots:i,slotProps:l}=e,c=Un(e,pde),f=i?.clearButton??ou,u=xr({elementType:f,externalSlotProps:l?.clearButton,ownerState:{},className:"clearButton",additionalProps:{title:t.fieldClearLabel}}),h=Un(u,hde),m=i?.clearIcon??kce,v=xr({elementType:m,externalSlotProps:l?.clearIcon,ownerState:{}});return Ie({},c,{InputProps:Ie({},o,{endAdornment:g.jsxs(k.Fragment,{children:[n&&g.jsx(e5,{position:"end",sx:{marginRight:o?.endAdornment?-1:-1.5},children:g.jsx(f,Ie({},h,{onClick:r,children:g.jsx(m,Ie({fontSize:"small"},v))}))}),o?.endAdornment]})}),sx:[{"& .clearButton":{opacity:1},"@media (pointer: fine)":{"& .clearButton":{opacity:0},"&:hover, &:focus-within":{".clearButton":{opacity:1}}}},...Array.isArray(a)?a:[a]]})},gde=["value","defaultValue","referenceDate","format","formatDensity","onChange","timezone","onError","shouldRespectLeadingZeros","selectedSections","onSelectedSectionsChange","unstableFieldRef","enableAccessibleFieldDOMStructure","disabled","readOnly","dateSeparator"],yde=(e,t)=>k.useMemo(()=>{const n=Ie({},e),r={},o=a=>{n.hasOwnProperty(a)&&(r[a]=n[a],delete n[a])};return gde.forEach(o),Xz.forEach(o),{forwardedProps:n,internalProps:r}},[e,t]),vde=e=>{const t=Yr(),n=ry();return Ie({},e,{disablePast:e.disablePast??!1,disableFuture:e.disableFuture??!1,format:e.format??t.formats.keyboardDate,minDate:Ji(t,e.minDate,n.minDate),maxDate:Ji(t,e.maxDate,n.maxDate)})},bde=e=>{const t=vde(e),{forwardedProps:n,internalProps:r}=yde(t,"date");return fde({forwardedProps:n,internalProps:r,valueManager:cl,fieldValueManager:bae,validator:oy,valueType:"date"})};function xde(e){return cn("MuiPickersTextField",e)}tn("MuiPickersTextField",["root","focused","disabled","error","required"]);function Sde(e){return cn("MuiPickersInputBase",e)}const sp=tn("MuiPickersInputBase",["root","focused","disabled","error","notchedOutline","sectionContent","sectionBefore","sectionAfter","adornedStart","adornedEnd","input"]);function wde(e){return cn("MuiPickersSectionList",e)}const hm=tn("MuiPickersSectionList",["root","section","sectionContent"]),Cde=["slots","slotProps","elements","sectionListRef"],L5=Qe("div",{name:"MuiPickersSectionList",slot:"Root",overridesResolver:(e,t)=>t.root})({direction:"ltr /*! @noflip */",outline:"none"}),z5=Qe("span",{name:"MuiPickersSectionList",slot:"Section",overridesResolver:(e,t)=>t.section})({}),F5=Qe("span",{name:"MuiPickersSectionList",slot:"SectionSeparator",overridesResolver:(e,t)=>t.sectionSeparator})({whiteSpace:"pre"}),_5=Qe("span",{name:"MuiPickersSectionList",slot:"SectionContent",overridesResolver:(e,t)=>t.sectionContent})({outline:"none"}),kde=e=>{const{classes:t}=e;return sn({root:["root"],section:["section"],sectionContent:["sectionContent"]},wde,t)};function Ede(e){const{slots:t,slotProps:n,element:r,classes:o}=e,a=t?.section??z5,i=xr({elementType:a,externalSlotProps:n?.section,externalForwardedProps:r.container,className:o.section,ownerState:{}}),l=t?.sectionContent??_5,c=xr({elementType:l,externalSlotProps:n?.sectionContent,externalForwardedProps:r.content,additionalProps:{suppressContentEditableWarning:!0},className:o.sectionContent,ownerState:{}}),f=t?.sectionSeparator??F5,u=xr({elementType:f,externalSlotProps:n?.sectionSeparator,externalForwardedProps:r.before,ownerState:{position:"before"}}),h=xr({elementType:f,externalSlotProps:n?.sectionSeparator,externalForwardedProps:r.after,ownerState:{position:"after"}});return g.jsxs(a,Ie({},i,{children:[g.jsx(f,Ie({},u)),g.jsx(l,Ie({},c)),g.jsx(f,Ie({},h))]}))}const Rde=k.forwardRef(function(e,t){const n=Wr({props:e,name:"MuiPickersSectionList"}),{slots:r,slotProps:o,elements:a,sectionListRef:i}=n,l=Un(n,Cde),c=kde(n),f=k.useRef(null),u=mr(t,f),h=b=>{if(!f.current)throw new Error(`MUI X: Cannot call sectionListRef.${b} before the mount of the component.`);return f.current};k.useImperativeHandle(i,()=>({getRoot(){return h("getRoot")},getSectionContainer(b){return h("getSectionContainer").querySelector(`.${hm.section}[data-sectionindex="${b}"]`)},getSectionContent(b){return h("getSectionContent").querySelector(`.${hm.section}[data-sectionindex="${b}"] .${hm.sectionContent}`)},getSectionIndexFromDOMElement(b){const x=h("getSectionIndexFromDOMElement");if(b==null||!x.contains(b))return null;let w=null;return b.classList.contains(hm.section)?w=b:b.classList.contains(hm.sectionContent)&&(w=b.parentElement),w==null?null:Number(w.dataset.sectionindex)}}));const m=r?.root??L5,v=xr({elementType:m,externalSlotProps:o?.root,externalForwardedProps:l,additionalProps:{ref:u,suppressContentEditableWarning:!0},className:c.root,ownerState:{}});return g.jsx(m,Ie({},v,{children:v.contentEditable?a.map(({content:b,before:x,after:w})=>`${x.children}${b.children}${w.children}`).join(""):g.jsx(k.Fragment,{children:a.map((b,x)=>g.jsx(Ede,{slots:r,slotProps:o,element:b,classes:c},x))})}))}),Tde=["elements","areAllSectionsEmpty","defaultValue","label","value","onChange","id","autoFocus","endAdornment","startAdornment","renderSuffix","slots","slotProps","contentEditable","tabIndex","onInput","onPaste","onKeyDown","fullWidth","name","readOnly","inputProps","inputRef","sectionListRef"],Ode=e=>Math.round(e*1e5)/1e5,hx=Qe("div",{name:"MuiPickersInputBase",slot:"Root",overridesResolver:(e,t)=>t.root})(({theme:e})=>Ie({},e.typography.body1,{color:(e.vars||e).palette.text.primary,cursor:"text",padding:0,display:"flex",justifyContent:"flex-start",alignItems:"center",position:"relative",boxSizing:"border-box",letterSpacing:`${Ode(.15/16)}em`,variants:[{props:{fullWidth:!0},style:{width:"100%"}}]})),WE=Qe(L5,{name:"MuiPickersInputBase",slot:"SectionsContainer",overridesResolver:(e,t)=>t.sectionsContainer})(({theme:e})=>({padding:"4px 0 5px",fontFamily:e.typography.fontFamily,fontSize:"inherit",lineHeight:"1.4375em",flexGrow:1,outline:"none",display:"flex",flexWrap:"nowrap",overflow:"hidden",letterSpacing:"inherit",width:"182px",variants:[{props:{isRtl:!0},style:{textAlign:"right /*! @noflip */"}},{props:{size:"small"},style:{paddingTop:1}},{props:{adornedStart:!1,focused:!1,filled:!1},style:{color:"currentColor",opacity:0}},{props:({adornedStart:t,focused:n,filled:r,label:o})=>!t&&!n&&!r&&o==null,style:e.vars?{opacity:e.vars.opacity.inputPlaceholder}:{opacity:e.palette.mode==="light"?.42:.5}}]})),Mde=Qe(z5,{name:"MuiPickersInputBase",slot:"Section",overridesResolver:(e,t)=>t.section})(({theme:e})=>({fontFamily:e.typography.fontFamily,fontSize:"inherit",letterSpacing:"inherit",lineHeight:"1.4375em",display:"inline-block",whiteSpace:"nowrap"})),$de=Qe(_5,{name:"MuiPickersInputBase",slot:"SectionContent",overridesResolver:(e,t)=>t.content})(({theme:e})=>({fontFamily:e.typography.fontFamily,lineHeight:"1.4375em",letterSpacing:"inherit",width:"fit-content",outline:"none"})),Pde=Qe(F5,{name:"MuiPickersInputBase",slot:"Separator",overridesResolver:(e,t)=>t.separator})(()=>({whiteSpace:"pre",letterSpacing:"inherit"})),Ade=Qe("input",{name:"MuiPickersInputBase",slot:"Input",overridesResolver:(e,t)=>t.hiddenInput})(Ie({},Yoe)),Dde=e=>{const{focused:t,disabled:n,error:r,classes:o,fullWidth:a,readOnly:i,color:l,size:c,endAdornment:f,startAdornment:u}=e,h={root:["root",t&&!n&&"focused",n&&"disabled",i&&"readOnly",r&&"error",a&&"fullWidth",`color${St(l)}`,c==="small"&&"inputSizeSmall",!!u&&"adornedStart",!!f&&"adornedEnd"],notchedOutline:["notchedOutline"],input:["input"],sectionsContainer:["sectionsContainer"],sectionContent:["sectionContent"],sectionBefore:["sectionBefore"],sectionAfter:["sectionAfter"]};return sn(h,Sde,o)},YE=k.forwardRef(function(e,t){const n=Wr({props:e,name:"MuiPickersInputBase"}),{elements:r,areAllSectionsEmpty:o,value:a,onChange:i,id:l,endAdornment:c,startAdornment:f,renderSuffix:u,slots:h,slotProps:m,contentEditable:v,tabIndex:b,onInput:x,onPaste:w,onKeyDown:S,name:R,readOnly:E,inputProps:M,inputRef:$,sectionListRef:D}=n,F=Un(n,Tde),I=k.useRef(null),U=mr(t,I),z=mr(M?.ref,$),L=Os(),C=ki();if(!C)throw new Error("MUI X: PickersInputBase should always be used inside a PickersTextField component");const j=re=>{if(C.disabled){re.stopPropagation();return}C.onFocus?.(re)};k.useEffect(()=>{C&&C.setAdornedStart(!!f)},[C,f]),k.useEffect(()=>{C&&(o?C.onEmpty():C.onFilled())},[C,o]);const N=Ie({},n,C,{isRtl:L}),V=Dde(N),A=h?.root||hx,Y=xr({elementType:A,externalSlotProps:m?.root,externalForwardedProps:F,additionalProps:{"aria-invalid":C.error,ref:U},className:V.root,ownerState:N}),W=h?.input||WE;return g.jsxs(A,Ie({},Y,{children:[f,g.jsx(Rde,{sectionListRef:D,elements:r,contentEditable:v,tabIndex:b,className:V.sectionsContainer,onFocus:j,onBlur:C.onBlur,onInput:x,onPaste:w,onKeyDown:S,slots:{root:W,section:Mde,sectionContent:$de,sectionSeparator:Pde},slotProps:{root:{ownerState:N},sectionContent:{className:sp.sectionContent},sectionSeparator:({position:re})=>({className:re==="before"?sp.sectionBefore:sp.sectionAfter})}}),c,u?u(Ie({},C)):null,g.jsx(Ade,Ie({name:R,className:V.input,value:a,onChange:i,id:l,"aria-hidden":"true",tabIndex:-1,readOnly:E,required:C.required,disabled:C.disabled},M,{ref:z}))]}))});function jde(e){return cn("MuiPickersOutlinedInput",e)}const ws=Ie({},sp,tn("MuiPickersOutlinedInput",["root","notchedOutline","input"])),Nde=["children","className","label","notched","shrink"],Ide=Qe("fieldset",{name:"MuiPickersOutlinedInput",slot:"NotchedOutline",overridesResolver:(e,t)=>t.notchedOutline})(({theme:e})=>{const t=e.palette.mode==="light"?"rgba(0, 0, 0, 0.23)":"rgba(255, 255, 255, 0.23)";return{textAlign:"left",position:"absolute",bottom:0,right:0,top:-5,left:0,margin:0,padding:"0 8px",pointerEvents:"none",borderRadius:"inherit",borderStyle:"solid",borderWidth:1,overflow:"hidden",minWidth:"0%",borderColor:e.vars?`rgba(${e.vars.palette.common.onBackgroundChannel} / 0.23)`:t}}),mD=Qe("span")(({theme:e})=>({fontFamily:e.typography.fontFamily,fontSize:"inherit"})),Lde=Qe("legend")(({theme:e})=>({float:"unset",width:"auto",overflow:"hidden",variants:[{props:{withLabel:!1},style:{padding:0,lineHeight:"11px",transition:e.transitions.create("width",{duration:150,easing:e.transitions.easing.easeOut})}},{props:{withLabel:!0},style:{display:"block",padding:0,height:11,fontSize:"0.75em",visibility:"hidden",maxWidth:.01,transition:e.transitions.create("max-width",{duration:50,easing:e.transitions.easing.easeOut}),whiteSpace:"nowrap","& > span":{paddingLeft:5,paddingRight:5,display:"inline-block",opacity:0,visibility:"visible"}}},{props:{withLabel:!0,notched:!0},style:{maxWidth:"100%",transition:e.transitions.create("max-width",{duration:100,easing:e.transitions.easing.easeOut,delay:50})}}]}));function zde(e){const{className:t,label:n}=e,r=Un(e,Nde),o=n!=null&&n!=="",a=Ie({},e,{withLabel:o});return g.jsx(Ide,Ie({"aria-hidden":!0,className:t},r,{ownerState:a,children:g.jsx(Lde,{ownerState:a,children:o?g.jsx(mD,{children:n}):g.jsx(mD,{className:"notranslate",children:"​"})})}))}const Fde=["label","autoFocus","ownerState","notched"],_de=Qe(hx,{name:"MuiPickersOutlinedInput",slot:"Root",overridesResolver:(e,t)=>t.root})(({theme:e})=>{const t=e.palette.mode==="light"?"rgba(0, 0, 0, 0.23)":"rgba(255, 255, 255, 0.23)";return{padding:"0 14px",borderRadius:(e.vars||e).shape.borderRadius,[`&:hover .${ws.notchedOutline}`]:{borderColor:(e.vars||e).palette.text.primary},"@media (hover: none)":{[`&:hover .${ws.notchedOutline}`]:{borderColor:e.vars?`rgba(${e.vars.palette.common.onBackgroundChannel} / 0.23)`:t}},[`&.${ws.focused} .${ws.notchedOutline}`]:{borderStyle:"solid",borderWidth:2},[`&.${ws.disabled}`]:{[`& .${ws.notchedOutline}`]:{borderColor:(e.vars||e).palette.action.disabled},"*":{color:(e.vars||e).palette.action.disabled}},[`&.${ws.error} .${ws.notchedOutline}`]:{borderColor:(e.vars||e).palette.error.main},variants:Object.keys((e.vars??e).palette).filter(n=>(e.vars??e).palette[n]?.main??!1).map(n=>({props:{color:n},style:{[`&.${ws.focused}:not(.${ws.error}) .${ws.notchedOutline}`]:{borderColor:(e.vars||e).palette[n].main}}}))}}),Ude=Qe(WE,{name:"MuiPickersOutlinedInput",slot:"SectionsContainer",overridesResolver:(e,t)=>t.sectionsContainer})({padding:"16.5px 0",variants:[{props:{size:"small"},style:{padding:"8.5px 0"}}]}),Bde=e=>{const{classes:t}=e,n=sn({root:["root"],notchedOutline:["notchedOutline"],input:["input"]},jde,t);return Ie({},t,n)},U5=k.forwardRef(function(e,t){const n=Wr({props:e,name:"MuiPickersOutlinedInput"}),{label:r,ownerState:o,notched:a}=n,i=Un(n,Fde),l=ki(),c=Ie({},n,o,l,{color:l?.color||"primary"}),f=Bde(c);return g.jsx(YE,Ie({slots:{root:_de,input:Ude},renderSuffix:u=>g.jsx(zde,{shrink:!!(a||u.adornedStart||u.focused||u.filled),notched:!!(a||u.adornedStart||u.focused||u.filled),className:f.notchedOutline,label:r!=null&&r!==""&&l?.required?g.jsxs(k.Fragment,{children:[r," ","*"]}):r,ownerState:c})},i,{label:r,classes:f,ref:t}))});U5.muiName="Input";function Vde(e){return cn("MuiPickersFilledInput",e)}const _u=Ie({},sp,tn("MuiPickersFilledInput",["root","underline","input"])),Hde=["label","autoFocus","disableUnderline","ownerState"],qde=Qe(hx,{name:"MuiPickersFilledInput",slot:"Root",overridesResolver:(e,t)=>t.root,shouldForwardProp:e=>Xv(e)&&e!=="disableUnderline"})(({theme:e})=>{const t=e.palette.mode==="light",n=t?"rgba(0, 0, 0, 0.42)":"rgba(255, 255, 255, 0.7)",r=t?"rgba(0, 0, 0, 0.06)":"rgba(255, 255, 255, 0.09)",o=t?"rgba(0, 0, 0, 0.09)":"rgba(255, 255, 255, 0.13)",a=t?"rgba(0, 0, 0, 0.12)":"rgba(255, 255, 255, 0.12)";return{backgroundColor:e.vars?e.vars.palette.FilledInput.bg:r,borderTopLeftRadius:(e.vars||e).shape.borderRadius,borderTopRightRadius:(e.vars||e).shape.borderRadius,transition:e.transitions.create("background-color",{duration:e.transitions.duration.shorter,easing:e.transitions.easing.easeOut}),"&:hover":{backgroundColor:e.vars?e.vars.palette.FilledInput.hoverBg:o,"@media (hover: none)":{backgroundColor:e.vars?e.vars.palette.FilledInput.bg:r}},[`&.${_u.focused}`]:{backgroundColor:e.vars?e.vars.palette.FilledInput.bg:r},[`&.${_u.disabled}`]:{backgroundColor:e.vars?e.vars.palette.FilledInput.disabledBg:a},variants:[...Object.keys((e.vars??e).palette).filter(i=>(e.vars??e).palette[i].main).map(i=>({props:{color:i,disableUnderline:!1},style:{"&::after":{borderBottom:`2px solid ${(e.vars||e).palette[i]?.main}`}}})),{props:{disableUnderline:!1},style:{"&::after":{left:0,bottom:0,content:'""',position:"absolute",right:0,transform:"scaleX(0)",transition:e.transitions.create("transform",{duration:e.transitions.duration.shorter,easing:e.transitions.easing.easeOut}),pointerEvents:"none"},[`&.${_u.focused}:after`]:{transform:"scaleX(1) translateX(0)"},[`&.${_u.error}`]:{"&:before, &:after":{borderBottomColor:(e.vars||e).palette.error.main}},"&::before":{borderBottom:`1px solid ${e.vars?`rgba(${e.vars.palette.common.onBackgroundChannel} / ${e.vars.opacity.inputUnderline})`:n}`,left:0,bottom:0,content:'"\\00a0"',position:"absolute",right:0,transition:e.transitions.create("border-bottom-color",{duration:e.transitions.duration.shorter}),pointerEvents:"none"},[`&:hover:not(.${_u.disabled}, .${_u.error}):before`]:{borderBottom:`1px solid ${(e.vars||e).palette.text.primary}`},[`&.${_u.disabled}:before`]:{borderBottomStyle:"dotted"}}},{props:({startAdornment:i})=>!!i,style:{paddingLeft:12}},{props:({endAdornment:i})=>!!i,style:{paddingRight:12}}]}}),Wde=Qe(WE,{name:"MuiPickersFilledInput",slot:"sectionsContainer",overridesResolver:(e,t)=>t.sectionsContainer})({paddingTop:25,paddingRight:12,paddingBottom:8,paddingLeft:12,variants:[{props:{size:"small"},style:{paddingTop:21,paddingBottom:4}},{props:({startAdornment:e})=>!!e,style:{paddingLeft:0}},{props:({endAdornment:e})=>!!e,style:{paddingRight:0}},{props:{hiddenLabel:!0},style:{paddingTop:16,paddingBottom:17}},{props:{hiddenLabel:!0,size:"small"},style:{paddingTop:8,paddingBottom:9}}]}),Yde=e=>{const{classes:t,disableUnderline:n}=e,r=sn({root:["root",!n&&"underline"],input:["input"]},Vde,t);return Ie({},t,r)},B5=k.forwardRef(function(e,t){const n=Wr({props:e,name:"MuiPickersFilledInput"}),{label:r,disableUnderline:o=!1,ownerState:a}=n,i=Un(n,Hde),l=ki(),c=Ie({},n,a,l,{color:l?.color||"primary"}),f=Yde(c);return g.jsx(YE,Ie({slots:{root:qde,input:Wde},slotProps:{root:{disableUnderline:o}}},i,{label:r,classes:f,ref:t}))});B5.muiName="Input";function Gde(e){return cn("MuiPickersFilledInput",e)}const mm=Ie({},sp,tn("MuiPickersInput",["root","input"])),Kde=["label","autoFocus","disableUnderline","ownerState"],Qde=Qe(hx,{name:"MuiPickersInput",slot:"Root",overridesResolver:(e,t)=>t.root})(({theme:e})=>{let t=e.palette.mode==="light"?"rgba(0, 0, 0, 0.42)":"rgba(255, 255, 255, 0.7)";return e.vars&&(t=`rgba(${e.vars.palette.common.onBackgroundChannel} / ${e.vars.opacity.inputUnderline})`),{"label + &":{marginTop:16},variants:[...Object.keys((e.vars??e).palette).filter(n=>(e.vars??e).palette[n].main).map(n=>({props:{color:n},style:{"&::after":{borderBottom:`2px solid ${(e.vars||e).palette[n].main}`}}})),{props:{disableUnderline:!1},style:{"&::after":{background:"red",left:0,bottom:0,content:'""',position:"absolute",right:0,transform:"scaleX(0)",transition:e.transitions.create("transform",{duration:e.transitions.duration.shorter,easing:e.transitions.easing.easeOut}),pointerEvents:"none"},[`&.${mm.focused}:after`]:{transform:"scaleX(1) translateX(0)"},[`&.${mm.error}`]:{"&:before, &:after":{borderBottomColor:(e.vars||e).palette.error.main}},"&::before":{borderBottom:`1px solid ${t}`,left:0,bottom:0,content:'"\\00a0"',position:"absolute",right:0,transition:e.transitions.create("border-bottom-color",{duration:e.transitions.duration.shorter}),pointerEvents:"none"},[`&:hover:not(.${mm.disabled}, .${mm.error}):before`]:{borderBottom:`2px solid ${(e.vars||e).palette.text.primary}`,"@media (hover: none)":{borderBottom:`1px solid ${t}`}},[`&.${mm.disabled}:before`]:{borderBottomStyle:"dotted"}}}]}}),Xde=e=>{const{classes:t,disableUnderline:n}=e,r=sn({root:["root",!n&&"underline"],input:["input"]},Gde,t);return Ie({},t,r)},V5=k.forwardRef(function(e,t){const n=Wr({props:e,name:"MuiPickersInput"}),{label:r,disableUnderline:o=!1,ownerState:a}=n,i=Un(n,Kde),l=ki(),c=Ie({},n,a,l,{disableUnderline:o,color:l?.color||"primary"}),f=Xde(c);return g.jsx(YE,Ie({slots:{root:Qde}},i,{label:r,classes:f,ref:t}))});V5.muiName="Input";const Zde=["onFocus","onBlur","className","color","disabled","error","variant","required","InputProps","inputProps","inputRef","sectionListRef","elements","areAllSectionsEmpty","onClick","onKeyDown","onKeyUp","onPaste","onInput","endAdornment","startAdornment","tabIndex","contentEditable","focused","value","onChange","fullWidth","id","name","helperText","FormHelperTextProps","label","InputLabelProps"],Jde={standard:V5,filled:B5,outlined:U5},efe=Qe(R5,{name:"MuiPickersTextField",slot:"Root",overridesResolver:(e,t)=>t.root})({maxWidth:"100%"}),tfe=e=>{const{focused:t,disabled:n,classes:r,required:o}=e;return sn({root:["root",t&&!n&&"focused",n&&"disabled",o&&"required"]},xde,r)},nfe=k.forwardRef(function(e,t){const n=Wr({props:e,name:"MuiPickersTextField"}),{onFocus:r,onBlur:o,className:a,color:i="primary",disabled:l=!1,error:c=!1,variant:f="outlined",required:u=!1,InputProps:h,inputProps:m,inputRef:v,sectionListRef:b,elements:x,areAllSectionsEmpty:w,onClick:S,onKeyDown:R,onKeyUp:E,onPaste:M,onInput:$,endAdornment:D,startAdornment:F,tabIndex:I,contentEditable:U,focused:z,value:L,onChange:C,fullWidth:j,id:N,name:V,helperText:A,FormHelperTextProps:Y,label:W,InputLabelProps:re}=n,Q=Un(n,Zde),oe=k.useRef(null),ce=mr(t,oe),Z=Ms(N),ae=A&&Z?`${Z}-helper-text`:void 0,J=W&&Z?`${Z}-label`:void 0,ne=Ie({},n,{color:i,disabled:l,error:c,focused:z,required:u,variant:f}),ee=tfe(ne),ue=Jde[f];return g.jsxs(efe,Ie({className:zt(ee.root,a),ref:ce,focused:z,onFocus:r,onBlur:o,disabled:l,variant:f,error:c,color:i,fullWidth:j,required:u,ownerState:ne},Q,{children:[g.jsx(E5,Ie({htmlFor:Z,id:J},re,{children:W})),g.jsx(ue,Ie({elements:x,areAllSectionsEmpty:w,onClick:S,onKeyDown:R,onKeyUp:E,onInput:$,onPaste:M,endAdornment:D,startAdornment:F,tabIndex:I,contentEditable:U,value:L,onChange:C,id:Z,fullWidth:j,inputProps:m,inputRef:v,sectionListRef:b,label:W,name:V,role:"group","aria-labelledby":J,"aria-describedby":ae,"aria-live":ae?"polite":void 0},h)),A&&g.jsx(T5,Ie({id:ae},Y,{children:A}))]}))}),rfe=["enableAccessibleFieldDOMStructure"],ofe=["InputProps","readOnly"],afe=["onPaste","onKeyDown","inputMode","readOnly","InputProps","inputProps","inputRef"],ife=e=>{let{enableAccessibleFieldDOMStructure:t}=e,n=Un(e,rfe);if(t){const{InputProps:h,readOnly:m}=n,v=Un(n,ofe);return Ie({},v,{InputProps:Ie({},h??{},{readOnly:m})})}const{onPaste:r,onKeyDown:o,inputMode:a,readOnly:i,InputProps:l,inputProps:c,inputRef:f}=n,u=Un(n,afe);return Ie({},u,{InputProps:Ie({},l??{},{readOnly:i}),inputProps:Ie({},c??{},{inputMode:a,onPaste:r,onKeyDown:o,ref:f})})},sfe=["slots","slotProps","InputProps","inputProps"],H5=k.forwardRef(function(e,t){const n=Wr({props:e,name:"MuiDateField"}),{slots:r,slotProps:o,InputProps:a,inputProps:i}=n,l=Un(n,sfe),c=n,f=r?.textField??(e.enableAccessibleFieldDOMStructure?nfe:hr),u=xr({elementType:f,externalSlotProps:o?.textField,externalForwardedProps:l,additionalProps:{ref:t},ownerState:c});u.inputProps=Ie({},i,u.inputProps),u.InputProps=Ie({},a,u.InputProps);const h=bde(u),m=ife(h),v=mde(Ie({},m,{slots:r,slotProps:o}));return g.jsx(f,Ie({},v))}),q5=({shouldDisableDate:e,shouldDisableMonth:t,shouldDisableYear:n,minDate:r,maxDate:o,disableFuture:a,disablePast:i,timezone:l})=>{const c=Od();return k.useCallback(f=>oy({adapter:c,value:f,timezone:l,props:{shouldDisableDate:e,shouldDisableMonth:t,shouldDisableYear:n,minDate:r,maxDate:o,disableFuture:a,disablePast:i}})!==null,[c,e,t,n,r,o,a,i,l])},lfe=(e,t,n)=>(r,o)=>{switch(o.type){case"changeMonth":return Ie({},r,{slideDirection:o.direction,currentMonth:o.newMonth,isMonthSwitchingAnimating:!e});case"changeMonthTimezone":{const a=o.newTimezone;if(n.getTimezone(r.currentMonth)===a)return r;let i=n.setTimezone(r.currentMonth,a);return n.getMonth(i)!==n.getMonth(r.currentMonth)&&(i=n.setMonth(i,n.getMonth(r.currentMonth))),Ie({},r,{currentMonth:i})}case"finishMonthSwitchingAnimation":return Ie({},r,{isMonthSwitchingAnimating:!1});case"changeFocusedDay":{if(r.focusedDay!=null&&o.focusedDay!=null&&n.isSameDay(o.focusedDay,r.focusedDay))return r;const a=o.focusedDay!=null&&!t&&!n.isSameMonth(r.currentMonth,o.focusedDay);return Ie({},r,{focusedDay:o.focusedDay,isMonthSwitchingAnimating:a&&!e&&!o.withoutMonthSwitchingAnimation,currentMonth:a?n.startOfMonth(o.focusedDay):r.currentMonth,slideDirection:o.focusedDay!=null&&n.isAfterDay(o.focusedDay,r.currentMonth)?"left":"right"})}default:throw new Error("missing support")}},cfe=e=>{const{value:t,referenceDate:n,disableFuture:r,disablePast:o,disableSwitchToMonthOnDayFocus:a=!1,maxDate:i,minDate:l,onMonthChange:c,reduceAnimations:f,shouldDisableDate:u,timezone:h}=e,m=Yr(),v=k.useRef(lfe(!!f,a,m)).current,b=k.useMemo(()=>cl.getInitialReferenceValue({value:t,utils:m,timezone:h,props:e,referenceDate:n,granularity:Zs.day}),[n,h]),[x,w]=k.useReducer(v,{isMonthSwitchingAnimating:!1,focusedDay:b,currentMonth:m.startOfMonth(b),slideDirection:"left"});k.useEffect(()=>{w({type:"changeMonthTimezone",newTimezone:m.getTimezone(b)})},[b,m]);const S=k.useCallback(D=>{w(Ie({type:"changeMonth"},D)),c&&c(D.newMonth)},[c]),R=k.useCallback(D=>{const F=D;m.isSameMonth(F,x.currentMonth)||S({newMonth:m.startOfMonth(F),direction:m.isAfterDay(F,x.currentMonth)?"left":"right"})},[x.currentMonth,S,m]),E=q5({shouldDisableDate:u,minDate:l,maxDate:i,disableFuture:r,disablePast:o,timezone:h}),M=k.useCallback(()=>{w({type:"finishMonthSwitchingAnimation"})},[]),$=Bt((D,F)=>{E(D)||w({type:"changeFocusedDay",focusedDay:D,withoutMonthSwitchingAnimation:F})});return{referenceDate:b,calendarState:x,changeMonth:R,changeFocusedDay:$,isDateDisabled:E,onMonthSwitchingAnimationEnd:M,handleChangeMonth:S}},ufe=e=>cn("MuiPickersFadeTransitionGroup",e);tn("MuiPickersFadeTransitionGroup",["root"]);const dfe=e=>{const{classes:t}=e;return sn({root:["root"]},ufe,t)},ffe=Qe(ay,{name:"MuiPickersFadeTransitionGroup",slot:"Root",overridesResolver:(e,t)=>t.root})({display:"block",position:"relative"});function W5(e){const t=Wr({props:e,name:"MuiPickersFadeTransitionGroup"}),{children:n,className:r,reduceAnimations:o,transKey:a}=t,i=dfe(t),l=Td();return o?n:g.jsx(ffe,{className:zt(i.root,r),children:g.jsx(xd,{appear:!1,mountOnEnter:!0,unmountOnExit:!0,timeout:{appear:l.transitions.duration.enteringScreen,enter:l.transitions.duration.enteringScreen,exit:0},children:n},a)})}function pfe(e){return cn("MuiPickersDay",e)}const Uu=tn("MuiPickersDay",["root","dayWithMargin","dayOutsideMonth","hiddenDaySpacingFiller","today","selected","disabled"]),hfe=["autoFocus","className","day","disabled","disableHighlightToday","disableMargin","hidden","isAnimating","onClick","onDaySelect","onFocus","onBlur","onKeyDown","onMouseDown","onMouseEnter","outsideCurrentMonth","selected","showDaysOutsideCurrentMonth","children","today","isFirstVisibleCell","isLastVisibleCell"],mfe=e=>{const{selected:t,disableMargin:n,disableHighlightToday:r,today:o,disabled:a,outsideCurrentMonth:i,showDaysOutsideCurrentMonth:l,classes:c}=e,f=i&&!l;return sn({root:["root",t&&!f&&"selected",a&&"disabled",!n&&"dayWithMargin",!r&&o&&"today",i&&l&&"dayOutsideMonth",f&&"hiddenDaySpacingFiller"],hiddenDaySpacingFiller:["hiddenDaySpacingFiller"]},pfe,c)},Y5=({theme:e})=>Ie({},e.typography.caption,{width:Rg,height:Rg,borderRadius:"50%",padding:0,backgroundColor:"transparent",transition:e.transitions.create("background-color",{duration:e.transitions.duration.short}),color:(e.vars||e).palette.text.primary,"@media (pointer: fine)":{"&:hover":{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / ${e.vars.palette.action.hoverOpacity})`:il(e.palette.primary.main,e.palette.action.hoverOpacity)}},"&:focus":{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / ${e.vars.palette.action.focusOpacity})`:il(e.palette.primary.main,e.palette.action.focusOpacity),[`&.${Uu.selected}`]:{willChange:"background-color",backgroundColor:(e.vars||e).palette.primary.dark}},[`&.${Uu.selected}`]:{color:(e.vars||e).palette.primary.contrastText,backgroundColor:(e.vars||e).palette.primary.main,fontWeight:e.typography.fontWeightMedium,"&:hover":{willChange:"background-color",backgroundColor:(e.vars||e).palette.primary.dark}},[`&.${Uu.disabled}:not(.${Uu.selected})`]:{color:(e.vars||e).palette.text.disabled},[`&.${Uu.disabled}&.${Uu.selected}`]:{opacity:.6},variants:[{props:{disableMargin:!1},style:{margin:`0 ${lx}px`}},{props:{outsideCurrentMonth:!0,showDaysOutsideCurrentMonth:!0},style:{color:(e.vars||e).palette.text.secondary}},{props:{disableHighlightToday:!1,today:!0},style:{[`&:not(.${Uu.selected})`]:{border:`1px solid ${(e.vars||e).palette.text.secondary}`}}}]}),G5=(e,t)=>{const{ownerState:n}=e;return[t.root,!n.disableMargin&&t.dayWithMargin,!n.disableHighlightToday&&n.today&&t.today,!n.outsideCurrentMonth&&n.showDaysOutsideCurrentMonth&&t.dayOutsideMonth,n.outsideCurrentMonth&&!n.showDaysOutsideCurrentMonth&&t.hiddenDaySpacingFiller]},gfe=Qe(bd,{name:"MuiPickersDay",slot:"Root",overridesResolver:G5})(Y5),yfe=Qe("div",{name:"MuiPickersDay",slot:"Root",overridesResolver:G5})(({theme:e})=>Ie({},Y5({theme:e}),{opacity:0,pointerEvents:"none"})),gm=()=>{},vfe=k.forwardRef(function(e,t){const n=Wr({props:e,name:"MuiPickersDay"}),{autoFocus:r=!1,className:o,day:a,disabled:i=!1,disableHighlightToday:l=!1,disableMargin:c=!1,isAnimating:f,onClick:u,onDaySelect:h,onFocus:m=gm,onBlur:v=gm,onKeyDown:b=gm,onMouseDown:x=gm,onMouseEnter:w=gm,outsideCurrentMonth:S,selected:R=!1,showDaysOutsideCurrentMonth:E=!1,children:M,today:$=!1}=n,D=Un(n,hfe),F=Ie({},n,{autoFocus:r,disabled:i,disableHighlightToday:l,disableMargin:c,selected:R,showDaysOutsideCurrentMonth:E,today:$}),I=mfe(F),U=Yr(),z=k.useRef(null),L=mr(z,t);zo(()=>{r&&!i&&!f&&!S&&z.current.focus()},[r,i,f,S]);const C=N=>{x(N),S&&N.preventDefault()},j=N=>{i||h(a),S&&N.currentTarget.focus(),u&&u(N)};return S&&!E?g.jsx(yfe,{className:zt(I.root,I.hiddenDaySpacingFiller,o),ownerState:F,role:D.role}):g.jsx(gfe,Ie({className:zt(I.root,o),ref:L,centerRipple:!0,disabled:i,tabIndex:R?0:-1,onKeyDown:N=>b(N,a),onFocus:N=>m(N,a),onBlur:N=>v(N,a),onMouseEnter:N=>w(N,a),onClick:j,onMouseDown:C},D,{ownerState:F,children:M||U.format(a,"dayOfMonth")}))}),bfe=k.memo(vfe),xfe=e=>cn("MuiPickersSlideTransition",e),Ni=tn("MuiPickersSlideTransition",["root","slideEnter-left","slideEnter-right","slideEnterActive","slideExit","slideExitActiveLeft-left","slideExitActiveLeft-right"]),Sfe=["children","className","reduceAnimations","slideDirection","transKey","classes"],wfe=e=>{const{classes:t,slideDirection:n}=e,r={root:["root"],exit:["slideExit"],enterActive:["slideEnterActive"],enter:[`slideEnter-${n}`],exitActive:[`slideExitActiveLeft-${n}`]};return sn(r,xfe,t)},Cfe=Qe(ay,{name:"MuiPickersSlideTransition",slot:"Root",overridesResolver:(e,t)=>[t.root,{[`.${Ni["slideEnter-left"]}`]:t["slideEnter-left"]},{[`.${Ni["slideEnter-right"]}`]:t["slideEnter-right"]},{[`.${Ni.slideEnterActive}`]:t.slideEnterActive},{[`.${Ni.slideExit}`]:t.slideExit},{[`.${Ni["slideExitActiveLeft-left"]}`]:t["slideExitActiveLeft-left"]},{[`.${Ni["slideExitActiveLeft-right"]}`]:t["slideExitActiveLeft-right"]}]})(({theme:e})=>{const t=e.transitions.create("transform",{duration:e.transitions.duration.complex,easing:"cubic-bezier(0.35, 0.8, 0.4, 1)"});return{display:"block",position:"relative",overflowX:"hidden","& > *":{position:"absolute",top:0,right:0,left:0},[`& .${Ni["slideEnter-left"]}`]:{willChange:"transform",transform:"translate(100%)",zIndex:1},[`& .${Ni["slideEnter-right"]}`]:{willChange:"transform",transform:"translate(-100%)",zIndex:1},[`& .${Ni.slideEnterActive}`]:{transform:"translate(0%)",transition:t},[`& .${Ni.slideExit}`]:{transform:"translate(0%)"},[`& .${Ni["slideExitActiveLeft-left"]}`]:{willChange:"transform",transform:"translate(-100%)",transition:t,zIndex:0},[`& .${Ni["slideExitActiveLeft-right"]}`]:{willChange:"transform",transform:"translate(100%)",transition:t,zIndex:0}}});function kfe(e){const t=Wr({props:e,name:"MuiPickersSlideTransition"}),{children:n,className:r,reduceAnimations:o,transKey:a}=t,i=Un(t,Sfe),l=wfe(t),c=Td();if(o)return g.jsx("div",{className:zt(l.root,r),children:n});const f={exit:l.exit,enterActive:l.enterActive,enter:l.enter,exitActive:l.exitActive};return g.jsx(Cfe,{className:zt(l.root,r),childFactory:u=>k.cloneElement(u,{classNames:f}),role:"presentation",children:g.jsx(TE,Ie({mountOnEnter:!0,unmountOnExit:!0,timeout:c.transitions.duration.complex,classNames:f},i,{children:n}),a)})}const Efe=e=>cn("MuiDayCalendar",e);tn("MuiDayCalendar",["root","header","weekDayLabel","loadingContainer","slideTransition","monthContainer","weekContainer","weekNumberLabel","weekNumber"]);const Rfe=["parentProps","day","focusableDay","selectedDays","isDateDisabled","currentMonthNumber","isViewFocused"],Tfe=["ownerState"],Ofe=e=>{const{classes:t}=e;return sn({root:["root"],header:["header"],weekDayLabel:["weekDayLabel"],loadingContainer:["loadingContainer"],slideTransition:["slideTransition"],monthContainer:["monthContainer"],weekContainer:["weekContainer"],weekNumberLabel:["weekNumberLabel"],weekNumber:["weekNumber"]},Efe,t)},K5=(Rg+lx*2)*6,Mfe=Qe("div",{name:"MuiDayCalendar",slot:"Root",overridesResolver:(e,t)=>t.root})({}),$fe=Qe("div",{name:"MuiDayCalendar",slot:"Header",overridesResolver:(e,t)=>t.header})({display:"flex",justifyContent:"center",alignItems:"center"}),Pfe=Qe(br,{name:"MuiDayCalendar",slot:"WeekDayLabel",overridesResolver:(e,t)=>t.weekDayLabel})(({theme:e})=>({width:36,height:40,margin:"0 2px",textAlign:"center",display:"flex",justifyContent:"center",alignItems:"center",color:(e.vars||e).palette.text.secondary})),Afe=Qe(br,{name:"MuiDayCalendar",slot:"WeekNumberLabel",overridesResolver:(e,t)=>t.weekNumberLabel})(({theme:e})=>({width:36,height:40,margin:"0 2px",textAlign:"center",display:"flex",justifyContent:"center",alignItems:"center",color:e.palette.text.disabled})),Dfe=Qe(br,{name:"MuiDayCalendar",slot:"WeekNumber",overridesResolver:(e,t)=>t.weekNumber})(({theme:e})=>Ie({},e.typography.caption,{width:Rg,height:Rg,padding:0,margin:`0 ${lx}px`,color:e.palette.text.disabled,fontSize:"0.75rem",alignItems:"center",justifyContent:"center",display:"inline-flex"})),jfe=Qe("div",{name:"MuiDayCalendar",slot:"LoadingContainer",overridesResolver:(e,t)=>t.loadingContainer})({display:"flex",justifyContent:"center",alignItems:"center",minHeight:K5}),Nfe=Qe(kfe,{name:"MuiDayCalendar",slot:"SlideTransition",overridesResolver:(e,t)=>t.slideTransition})({minHeight:K5}),Ife=Qe("div",{name:"MuiDayCalendar",slot:"MonthContainer",overridesResolver:(e,t)=>t.monthContainer})({overflow:"hidden"}),Lfe=Qe("div",{name:"MuiDayCalendar",slot:"WeekContainer",overridesResolver:(e,t)=>t.weekContainer})({margin:`${lx}px 0`,display:"flex",justifyContent:"center"});function zfe(e){let{parentProps:t,day:n,focusableDay:r,selectedDays:o,isDateDisabled:a,currentMonthNumber:i,isViewFocused:l}=e,c=Un(e,Rfe);const{disabled:f,disableHighlightToday:u,isMonthSwitchingAnimating:h,showDaysOutsideCurrentMonth:m,slots:v,slotProps:b,timezone:x}=t,w=Yr(),S=ax(x),R=r!==null&&w.isSameDay(n,r),E=o.some(C=>w.isSameDay(C,n)),M=w.isSameDay(n,S),$=v?.day??bfe,D=xr({elementType:$,externalSlotProps:b?.day,additionalProps:Ie({disableHighlightToday:u,showDaysOutsideCurrentMonth:m,role:"gridcell",isAnimating:h,"data-timestamp":w.toJsDate(n).valueOf()},c),ownerState:Ie({},t,{day:n,selected:E})}),F=Un(D,Tfe),I=k.useMemo(()=>f||a(n),[f,a,n]),U=k.useMemo(()=>w.getMonth(n)!==i,[w,n,i]),z=k.useMemo(()=>{const C=w.startOfMonth(w.setMonth(n,i));return m?w.isSameDay(n,w.startOfWeek(C)):w.isSameDay(n,C)},[i,n,m,w]),L=k.useMemo(()=>{const C=w.endOfMonth(w.setMonth(n,i));return m?w.isSameDay(n,w.endOfWeek(C)):w.isSameDay(n,C)},[i,n,m,w]);return g.jsx($,Ie({},F,{day:n,disabled:I,autoFocus:l&&R,today:M,outsideCurrentMonth:U,isFirstVisibleCell:z,isLastVisibleCell:L,selected:E,tabIndex:R?0:-1,"aria-selected":E,"aria-current":M?"date":void 0}))}function Ffe(e){const t=Wr({props:e,name:"MuiDayCalendar"}),n=Yr(),{onFocusedDayChange:r,className:o,currentMonth:a,selectedDays:i,focusedDay:l,loading:c,onSelectedDaysChange:f,onMonthSwitchingAnimationEnd:u,readOnly:h,reduceAnimations:m,renderLoading:v=()=>g.jsx("span",{children:"..."}),slideDirection:b,TransitionProps:x,disablePast:w,disableFuture:S,minDate:R,maxDate:E,shouldDisableDate:M,shouldDisableMonth:$,shouldDisableYear:D,dayOfWeekFormatter:F=Re=>n.format(Re,"weekdayShort").charAt(0).toUpperCase(),hasFocus:I,onFocusedViewChange:U,gridLabelId:z,displayWeekNumber:L,fixedWeekNumber:C,autoFocus:j,timezone:N}=t,V=ax(N),A=Ofe(t),Y=Os(),W=q5({shouldDisableDate:M,shouldDisableMonth:$,shouldDisableYear:D,minDate:R,maxDate:E,disablePast:w,disableFuture:S,timezone:N}),re=ec(),[Q,oe]=vi({name:"DayCalendar",state:"hasFocus",controlled:I,default:j??!1}),[ce,Z]=k.useState(()=>l||V),ae=Bt(Re=>{h||f(Re)}),J=Re=>{W(Re)||(r(Re),Z(Re),U?.(!0),oe(!0))},ne=Bt((Re,Oe)=>{switch(Re.key){case"ArrowUp":J(n.addDays(Oe,-7)),Re.preventDefault();break;case"ArrowDown":J(n.addDays(Oe,7)),Re.preventDefault();break;case"ArrowLeft":{const de=n.addDays(Oe,Y?1:-1),at=n.addMonths(Oe,Y?1:-1),Ne=eg({utils:n,date:de,minDate:Y?de:n.startOfMonth(at),maxDate:Y?n.endOfMonth(at):de,isDateDisabled:W,timezone:N});J(Ne||de),Re.preventDefault();break}case"ArrowRight":{const de=n.addDays(Oe,Y?-1:1),at=n.addMonths(Oe,Y?-1:1),Ne=eg({utils:n,date:de,minDate:Y?n.startOfMonth(at):de,maxDate:Y?de:n.endOfMonth(at),isDateDisabled:W,timezone:N});J(Ne||de),Re.preventDefault();break}case"Home":J(n.startOfWeek(Oe)),Re.preventDefault();break;case"End":J(n.endOfWeek(Oe)),Re.preventDefault();break;case"PageUp":J(n.addMonths(Oe,1)),Re.preventDefault();break;case"PageDown":J(n.addMonths(Oe,-1)),Re.preventDefault();break}}),ee=Bt((Re,Oe)=>J(Oe)),ue=Bt((Re,Oe)=>{Q&&n.isSameDay(ce,Oe)&&U?.(!1)}),pe=n.getMonth(a),ye=n.getYear(a),ie=k.useMemo(()=>i.filter(Re=>!!Re).map(Re=>n.startOfDay(Re)),[n,i]),he=`${ye}-${pe}`,le=k.useMemo(()=>k.createRef(),[he]),be=k.useMemo(()=>{const Re=n.startOfMonth(a),Oe=n.endOfMonth(a);return W(ce)||n.isAfterDay(ce,Oe)||n.isBeforeDay(ce,Re)?eg({utils:n,date:ce,minDate:Re,maxDate:Oe,disablePast:w,disableFuture:S,isDateDisabled:W,timezone:N}):ce},[a,S,w,ce,W,n,N]),Ve=k.useMemo(()=>{const Re=n.getWeekArray(a);let Oe=n.addMonths(a,1);for(;C&&Re.length<C;){const de=n.getWeekArray(Oe),at=n.isSameDay(Re[Re.length-1][0],de[0][0]);de.slice(at?1:0).forEach(Ne=>{Re.length<C&&Re.push(Ne)}),Oe=n.addMonths(Oe,1)}return Re},[a,C,n]);return g.jsxs(Mfe,{role:"grid","aria-labelledby":z,className:A.root,children:[g.jsxs($fe,{role:"row",className:A.header,children:[L&&g.jsx(Afe,{variant:"caption",role:"columnheader","aria-label":re.calendarWeekNumberHeaderLabel,className:A.weekNumberLabel,children:re.calendarWeekNumberHeaderText}),Zoe(n,V).map((Re,Oe)=>g.jsx(Pfe,{variant:"caption",role:"columnheader","aria-label":n.format(Re,"weekday"),className:A.weekDayLabel,children:F(Re)},Oe.toString()))]}),c?g.jsx(jfe,{className:A.loadingContainer,children:v()}):g.jsx(Nfe,Ie({transKey:he,onExited:u,reduceAnimations:m,slideDirection:b,className:zt(o,A.slideTransition)},x,{nodeRef:le,children:g.jsx(Ife,{ref:le,role:"rowgroup",className:A.monthContainer,children:Ve.map((Re,Oe)=>g.jsxs(Lfe,{role:"row",className:A.weekContainer,"aria-rowindex":Oe+1,children:[L&&g.jsx(Dfe,{className:A.weekNumber,role:"rowheader","aria-label":re.calendarWeekNumberAriaLabelText(n.getWeekNumber(Re[0])),children:re.calendarWeekNumberText(n.getWeekNumber(Re[0]))}),Re.map((de,at)=>g.jsx(zfe,{parentProps:t,day:de,selectedDays:ie,focusableDay:be,onKeyDown:ne,onFocus:ee,onBlur:ue,onDaySelect:ae,isDateDisabled:W,currentMonthNumber:pe,isViewFocused:Q,"aria-colindex":at+1},de.toString()))]},`week-${Re[0]}`))})}))]})}function _fe(e){return cn("MuiPickersMonth",e)}const Iv=tn("MuiPickersMonth",["root","monthButton","disabled","selected"]),Ufe=["autoFocus","className","children","disabled","selected","value","tabIndex","onClick","onKeyDown","onFocus","onBlur","aria-current","aria-label","monthsPerRow","slots","slotProps"],Bfe=e=>{const{disabled:t,selected:n,classes:r}=e;return sn({root:["root"],monthButton:["monthButton",t&&"disabled",n&&"selected"]},_fe,r)},Vfe=Qe("div",{name:"MuiPickersMonth",slot:"Root",overridesResolver:(e,t)=>[t.root]})({display:"flex",alignItems:"center",justifyContent:"center",flexBasis:"33.3%",variants:[{props:{monthsPerRow:4},style:{flexBasis:"25%"}}]}),Hfe=Qe("button",{name:"MuiPickersMonth",slot:"MonthButton",overridesResolver:(e,t)=>[t.monthButton,{[`&.${Iv.disabled}`]:t.disabled},{[`&.${Iv.selected}`]:t.selected}]})(({theme:e})=>Ie({color:"unset",backgroundColor:"transparent",border:0,outline:0},e.typography.subtitle1,{margin:"8px 0",height:36,width:72,borderRadius:18,cursor:"pointer","&:focus":{backgroundColor:e.vars?`rgba(${e.vars.palette.action.activeChannel} / ${e.vars.palette.action.hoverOpacity})`:il(e.palette.action.active,e.palette.action.hoverOpacity)},"&:hover":{backgroundColor:e.vars?`rgba(${e.vars.palette.action.activeChannel} / ${e.vars.palette.action.hoverOpacity})`:il(e.palette.action.active,e.palette.action.hoverOpacity)},"&:disabled":{cursor:"auto",pointerEvents:"none"},[`&.${Iv.disabled}`]:{color:(e.vars||e).palette.text.secondary},[`&.${Iv.selected}`]:{color:(e.vars||e).palette.primary.contrastText,backgroundColor:(e.vars||e).palette.primary.main,"&:focus, &:hover":{backgroundColor:(e.vars||e).palette.primary.dark}}})),qfe=k.memo(function(e){const t=Wr({props:e,name:"MuiPickersMonth"}),{autoFocus:n,className:r,children:o,disabled:a,selected:i,value:l,tabIndex:c,onClick:f,onKeyDown:u,onFocus:h,onBlur:m,"aria-current":v,"aria-label":b,slots:x,slotProps:w}=t,S=Un(t,Ufe),R=k.useRef(null),E=Bfe(t);zo(()=>{n&&R.current?.focus()},[n]);const M=x?.monthButton??Hfe,$=xr({elementType:M,externalSlotProps:w?.monthButton,additionalProps:{children:o,disabled:a,tabIndex:c,ref:R,type:"button",role:"radio","aria-current":v,"aria-checked":i,"aria-label":b,onClick:D=>f(D,l),onKeyDown:D=>u(D,l),onFocus:D=>h(D,l),onBlur:D=>m(D,l)},ownerState:t,className:E.monthButton});return g.jsx(Vfe,Ie({className:zt(E.root,r),ownerState:t},S,{children:g.jsx(M,Ie({},$))}))});function Wfe(e){return cn("MuiMonthCalendar",e)}tn("MuiMonthCalendar",["root"]);const Yfe=["className","value","defaultValue","referenceDate","disabled","disableFuture","disablePast","maxDate","minDate","onChange","shouldDisableMonth","readOnly","disableHighlightToday","autoFocus","onMonthFocus","hasFocus","onFocusedViewChange","monthsPerRow","timezone","gridLabelId","slots","slotProps"],Gfe=e=>{const{classes:t}=e;return sn({root:["root"]},Wfe,t)};function Kfe(e,t){const n=Yr(),r=ry(),o=Wr({props:e,name:t});return Ie({disableFuture:!1,disablePast:!1},o,{minDate:Ji(n,o.minDate,r.minDate),maxDate:Ji(n,o.maxDate,r.maxDate)})}const Qfe=Qe("div",{name:"MuiMonthCalendar",slot:"Root",overridesResolver:(e,t)=>t.root})({display:"flex",flexWrap:"wrap",alignContent:"stretch",padding:"0 4px",width:cx,boxSizing:"border-box"}),Xfe=k.forwardRef(function(e,t){const n=Kfe(e,"MuiMonthCalendar"),{className:r,value:o,defaultValue:a,referenceDate:i,disabled:l,disableFuture:c,disablePast:f,maxDate:u,minDate:h,onChange:m,shouldDisableMonth:v,readOnly:b,autoFocus:x=!1,onMonthFocus:w,hasFocus:S,onFocusedViewChange:R,monthsPerRow:E=3,timezone:M,gridLabelId:$,slots:D,slotProps:F}=n,I=Un(n,Yfe),{value:U,handleValueChange:z,timezone:L}=zE({name:"MonthCalendar",timezone:M,value:o,defaultValue:a,referenceDate:i,onChange:m,valueManager:cl}),C=ax(L),j=Os(),N=Yr(),V=k.useMemo(()=>cl.getInitialReferenceValue({value:U,utils:N,props:n,timezone:L,referenceDate:i,granularity:Zs.month}),[]),A=n,Y=Gfe(A),W=k.useMemo(()=>N.getMonth(C),[N,C]),re=k.useMemo(()=>U!=null?N.getMonth(U):null,[U,N]),[Q,oe]=k.useState(()=>re||N.getMonth(V)),[ce,Z]=vi({name:"MonthCalendar",state:"hasFocus",controlled:S,default:x??!1}),ae=Bt(ie=>{Z(ie),R&&R(ie)}),J=k.useCallback(ie=>{const he=N.startOfMonth(f&&N.isAfter(C,h)?C:h),le=N.startOfMonth(c&&N.isBefore(C,u)?C:u),be=N.startOfMonth(ie);return N.isBefore(be,he)||N.isAfter(be,le)?!0:v?v(be):!1},[c,f,u,h,C,v,N]),ne=Bt((ie,he)=>{if(b)return;const le=N.setMonth(U??V,he);z(le)}),ee=Bt(ie=>{J(N.setMonth(U??V,ie))||(oe(ie),ae(!0),w&&w(ie))});k.useEffect(()=>{oe(ie=>re!==null&&ie!==re?re:ie)},[re]);const ue=Bt((ie,he)=>{switch(ie.key){case"ArrowUp":ee((12+he-3)%12),ie.preventDefault();break;case"ArrowDown":ee((12+he+3)%12),ie.preventDefault();break;case"ArrowLeft":ee((12+he+(j?1:-1))%12),ie.preventDefault();break;case"ArrowRight":ee((12+he+(j?-1:1))%12),ie.preventDefault();break}}),pe=Bt((ie,he)=>{ee(he)}),ye=Bt((ie,he)=>{Q===he&&ae(!1)});return g.jsx(Qfe,Ie({ref:t,className:zt(Y.root,r),ownerState:A,role:"radiogroup","aria-labelledby":$},I,{children:wE(N,U??V).map(ie=>{const he=N.getMonth(ie),le=N.format(ie,"monthShort"),be=N.format(ie,"month"),Ve=he===re,Re=l||J(ie);return g.jsx(qfe,{selected:Ve,value:he,onClick:ne,onKeyDown:ue,autoFocus:ce&&he===Q,disabled:Re,tabIndex:he===Q&&!Re?0:-1,onFocus:pe,onBlur:ye,"aria-current":W===he?"date":void 0,"aria-label":be,monthsPerRow:E,slots:D,slotProps:F,children:le},le)})}))});function Zfe(e){return cn("MuiPickersYear",e)}const Lv=tn("MuiPickersYear",["root","yearButton","selected","disabled"]),Jfe=["autoFocus","className","children","disabled","selected","value","tabIndex","onClick","onKeyDown","onFocus","onBlur","aria-current","yearsPerRow","slots","slotProps"],epe=e=>{const{disabled:t,selected:n,classes:r}=e;return sn({root:["root"],yearButton:["yearButton",t&&"disabled",n&&"selected"]},Zfe,r)},tpe=Qe("div",{name:"MuiPickersYear",slot:"Root",overridesResolver:(e,t)=>[t.root]})({display:"flex",alignItems:"center",justifyContent:"center",flexBasis:"33.3%",variants:[{props:{yearsPerRow:4},style:{flexBasis:"25%"}}]}),npe=Qe("button",{name:"MuiPickersYear",slot:"YearButton",overridesResolver:(e,t)=>[t.yearButton,{[`&.${Lv.disabled}`]:t.disabled},{[`&.${Lv.selected}`]:t.selected}]})(({theme:e})=>Ie({color:"unset",backgroundColor:"transparent",border:0,outline:0},e.typography.subtitle1,{margin:"6px 0",height:36,width:72,borderRadius:18,cursor:"pointer","&:focus":{backgroundColor:e.vars?`rgba(${e.vars.palette.action.activeChannel} / ${e.vars.palette.action.focusOpacity})`:il(e.palette.action.active,e.palette.action.focusOpacity)},"&:hover":{backgroundColor:e.vars?`rgba(${e.vars.palette.action.activeChannel} / ${e.vars.palette.action.hoverOpacity})`:il(e.palette.action.active,e.palette.action.hoverOpacity)},"&:disabled":{cursor:"auto",pointerEvents:"none"},[`&.${Lv.disabled}`]:{color:(e.vars||e).palette.text.secondary},[`&.${Lv.selected}`]:{color:(e.vars||e).palette.primary.contrastText,backgroundColor:(e.vars||e).palette.primary.main,"&:focus, &:hover":{backgroundColor:(e.vars||e).palette.primary.dark}}})),rpe=k.memo(function(e){const t=Wr({props:e,name:"MuiPickersYear"}),{autoFocus:n,className:r,children:o,disabled:a,selected:i,value:l,tabIndex:c,onClick:f,onKeyDown:u,onFocus:h,onBlur:m,"aria-current":v,slots:b,slotProps:x}=t,w=Un(t,Jfe),S=k.useRef(null),R=epe(t);zo(()=>{n&&S.current?.focus()},[n]);const E=b?.yearButton??npe,M=xr({elementType:E,externalSlotProps:x?.yearButton,additionalProps:{children:o,disabled:a,tabIndex:c,ref:S,type:"button",role:"radio","aria-current":v,"aria-checked":i,onClick:$=>f($,l),onKeyDown:$=>u($,l),onFocus:$=>h($,l),onBlur:$=>m($,l)},ownerState:t,className:R.yearButton});return g.jsx(tpe,Ie({className:zt(R.root,r),ownerState:t},w,{children:g.jsx(E,Ie({},M))}))});function ope(e){return cn("MuiYearCalendar",e)}tn("MuiYearCalendar",["root"]);const ape=["autoFocus","className","value","defaultValue","referenceDate","disabled","disableFuture","disablePast","maxDate","minDate","onChange","readOnly","shouldDisableYear","disableHighlightToday","onYearFocus","hasFocus","onFocusedViewChange","yearsOrder","yearsPerRow","timezone","gridLabelId","slots","slotProps"],ipe=e=>{const{classes:t}=e;return sn({root:["root"]},ope,t)};function spe(e,t){const n=Yr(),r=ry(),o=Wr({props:e,name:t});return Ie({disablePast:!1,disableFuture:!1},o,{yearsPerRow:o.yearsPerRow??3,minDate:Ji(n,o.minDate,r.minDate),maxDate:Ji(n,o.maxDate,r.maxDate)})}const lpe=Qe("div",{name:"MuiYearCalendar",slot:"Root",overridesResolver:(e,t)=>t.root})({display:"flex",flexDirection:"row",flexWrap:"wrap",overflowY:"auto",height:"100%",padding:"0 4px",width:cx,maxHeight:ace,boxSizing:"border-box",position:"relative"}),cpe=k.forwardRef(function(e,t){const n=spe(e,"MuiYearCalendar"),{autoFocus:r,className:o,value:a,defaultValue:i,referenceDate:l,disabled:c,disableFuture:f,disablePast:u,maxDate:h,minDate:m,onChange:v,readOnly:b,shouldDisableYear:x,onYearFocus:w,hasFocus:S,onFocusedViewChange:R,yearsOrder:E="asc",yearsPerRow:M,timezone:$,gridLabelId:D,slots:F,slotProps:I}=n,U=Un(n,ape),{value:z,handleValueChange:L,timezone:C}=zE({name:"YearCalendar",timezone:$,value:a,defaultValue:i,referenceDate:l,onChange:v,valueManager:cl}),j=ax(C),N=Os(),V=Yr(),A=k.useMemo(()=>cl.getInitialReferenceValue({value:z,utils:V,props:n,timezone:C,referenceDate:l,granularity:Zs.year}),[]),Y=n,W=ipe(Y),re=k.useMemo(()=>V.getYear(j),[V,j]),Q=k.useMemo(()=>z!=null?V.getYear(z):null,[z,V]),[oe,ce]=k.useState(()=>Q||V.getYear(A)),[Z,ae]=vi({name:"YearCalendar",state:"hasFocus",controlled:S,default:r??!1}),J=Bt(Oe=>{ae(Oe),R&&R(Oe)}),ne=k.useCallback(Oe=>{if(u&&V.isBeforeYear(Oe,j)||f&&V.isAfterYear(Oe,j)||m&&V.isBeforeYear(Oe,m)||h&&V.isAfterYear(Oe,h))return!0;if(!x)return!1;const de=V.startOfYear(Oe);return x(de)},[f,u,h,m,j,x,V]),ee=Bt((Oe,de)=>{if(b)return;const at=V.setYear(z??A,de);L(at)}),ue=Bt(Oe=>{ne(V.setYear(z??A,Oe))||(ce(Oe),J(!0),w?.(Oe))});k.useEffect(()=>{ce(Oe=>Q!==null&&Oe!==Q?Q:Oe)},[Q]);const pe=E!=="desc"?M*1:M*-1,ye=N&&E==="asc"||!N&&E==="desc"?-1:1,ie=Bt((Oe,de)=>{switch(Oe.key){case"ArrowUp":ue(de-pe),Oe.preventDefault();break;case"ArrowDown":ue(de+pe),Oe.preventDefault();break;case"ArrowLeft":ue(de-ye),Oe.preventDefault();break;case"ArrowRight":ue(de+ye),Oe.preventDefault();break}}),he=Bt((Oe,de)=>{ue(de)}),le=Bt((Oe,de)=>{oe===de&&J(!1)}),be=k.useRef(null),Ve=mr(t,be);k.useEffect(()=>{if(r||be.current===null)return;const Oe=be.current.querySelector('[tabindex="0"]');if(!Oe)return;const de=Oe.offsetHeight,at=Oe.offsetTop,Ne=be.current.clientHeight,Je=be.current.scrollTop,tt=at+de;de>Ne||at<Je||(be.current.scrollTop=tt-Ne/2-de/2)},[r]);const Re=V.getYearRange([m,h]);return E==="desc"&&Re.reverse(),g.jsx(lpe,Ie({ref:Ve,className:zt(W.root,o),ownerState:Y,role:"radiogroup","aria-labelledby":D},U,{children:Re.map(Oe=>{const de=V.getYear(Oe),at=de===Q,Ne=c||ne(Oe);return g.jsx(rpe,{selected:at,value:de,onClick:ee,onKeyDown:ie,autoFocus:Z&&de===oe,disabled:Ne,tabIndex:de===oe&&!Ne?0:-1,onFocus:he,onBlur:le,"aria-current":re===de?"date":void 0,yearsPerRow:M,slots:F,slotProps:I,children:V.format(Oe,"year")},V.format(Oe,"year"))})}))}),upe=e=>cn("MuiPickersCalendarHeader",e),dpe=tn("MuiPickersCalendarHeader",["root","labelContainer","label","switchViewButton","switchViewIcon"]);function fpe(e){return cn("MuiPickersArrowSwitcher",e)}tn("MuiPickersArrowSwitcher",["root","spacer","button","previousIconButton","nextIconButton","leftArrowIcon","rightArrowIcon"]);const ppe=["children","className","slots","slotProps","isNextDisabled","isNextHidden","onGoToNext","nextLabel","isPreviousDisabled","isPreviousHidden","onGoToPrevious","previousLabel","labelId"],hpe=["ownerState"],mpe=["ownerState"],gpe=Qe("div",{name:"MuiPickersArrowSwitcher",slot:"Root",overridesResolver:(e,t)=>t.root})({display:"flex"}),ype=Qe("div",{name:"MuiPickersArrowSwitcher",slot:"Spacer",overridesResolver:(e,t)=>t.spacer})(({theme:e})=>({width:e.spacing(3)})),gD=Qe(ou,{name:"MuiPickersArrowSwitcher",slot:"Button",overridesResolver:(e,t)=>t.button})({variants:[{props:{hidden:!0},style:{visibility:"hidden"}}]}),vpe=e=>{const{classes:t}=e;return sn({root:["root"],spacer:["spacer"],button:["button"],previousIconButton:["previousIconButton"],nextIconButton:["nextIconButton"],leftArrowIcon:["leftArrowIcon"],rightArrowIcon:["rightArrowIcon"]},fpe,t)},bpe=k.forwardRef(function(e,t){const n=Os(),r=Wr({props:e,name:"MuiPickersArrowSwitcher"}),{children:o,className:a,slots:i,slotProps:l,isNextDisabled:c,isNextHidden:f,onGoToNext:u,nextLabel:h,isPreviousDisabled:m,isPreviousHidden:v,onGoToPrevious:b,previousLabel:x,labelId:w}=r,S=Un(r,ppe),R=r,E=vpe(R),M={isDisabled:c,isHidden:f,goTo:u,label:h},$={isDisabled:m,isHidden:v,goTo:b,label:x},D=i?.previousIconButton??gD,F=xr({elementType:D,externalSlotProps:l?.previousIconButton,additionalProps:{size:"medium",title:$.label,"aria-label":$.label,disabled:$.isDisabled,edge:"end",onClick:$.goTo},ownerState:Ie({},R,{hidden:$.isHidden}),className:zt(E.button,E.previousIconButton)}),I=i?.nextIconButton??gD,U=xr({elementType:I,externalSlotProps:l?.nextIconButton,additionalProps:{size:"medium",title:M.label,"aria-label":M.label,disabled:M.isDisabled,edge:"start",onClick:M.goTo},ownerState:Ie({},R,{hidden:M.isHidden}),className:zt(E.button,E.nextIconButton)}),z=i?.leftArrowIcon??Sce,L=xr({elementType:z,externalSlotProps:l?.leftArrowIcon,additionalProps:{fontSize:"inherit"},ownerState:R,className:E.leftArrowIcon}),C=Un(L,hpe),j=i?.rightArrowIcon??wce,N=xr({elementType:j,externalSlotProps:l?.rightArrowIcon,additionalProps:{fontSize:"inherit"},ownerState:R,className:E.rightArrowIcon}),V=Un(N,mpe);return g.jsxs(gpe,Ie({ref:t,className:zt(E.root,a),ownerState:R},S,{children:[g.jsx(D,Ie({},F,{children:n?g.jsx(j,Ie({},V)):g.jsx(z,Ie({},C))})),o?g.jsx(br,{variant:"subtitle1",component:"span",id:w,children:o}):g.jsx(ype,{className:E.spacer,ownerState:R}),g.jsx(I,Ie({},U,{children:n?g.jsx(z,Ie({},C)):g.jsx(j,Ie({},V))}))]}))});function xpe(e,{disableFuture:t,maxDate:n,timezone:r}){const o=Yr();return k.useMemo(()=>{const a=o.date(void 0,r),i=o.startOfMonth(t&&o.isBefore(a,n)?a:n);return!o.isAfter(i,e)},[t,n,e,o,r])}function Spe(e,{disablePast:t,minDate:n,timezone:r}){const o=Yr();return k.useMemo(()=>{const a=o.date(void 0,r),i=o.startOfMonth(t&&o.isAfter(a,n)?a:n);return!o.isBefore(i,e)},[t,n,e,o,r])}const wpe=["slots","slotProps","currentMonth","disabled","disableFuture","disablePast","maxDate","minDate","onMonthChange","onViewChange","view","reduceAnimations","views","labelId","className","timezone","format"],Cpe=["ownerState"],kpe=e=>{const{classes:t}=e;return sn({root:["root"],labelContainer:["labelContainer"],label:["label"],switchViewButton:["switchViewButton"],switchViewIcon:["switchViewIcon"]},upe,t)},Epe=Qe("div",{name:"MuiPickersCalendarHeader",slot:"Root",overridesResolver:(e,t)=>t.root})({display:"flex",alignItems:"center",marginTop:12,marginBottom:4,paddingLeft:24,paddingRight:12,maxHeight:40,minHeight:40}),Rpe=Qe("div",{name:"MuiPickersCalendarHeader",slot:"LabelContainer",overridesResolver:(e,t)=>t.labelContainer})(({theme:e})=>Ie({display:"flex",overflow:"hidden",alignItems:"center",cursor:"pointer",marginRight:"auto"},e.typography.body1,{fontWeight:e.typography.fontWeightMedium})),Tpe=Qe("div",{name:"MuiPickersCalendarHeader",slot:"Label",overridesResolver:(e,t)=>t.label})({marginRight:6}),Ope=Qe(ou,{name:"MuiPickersCalendarHeader",slot:"SwitchViewButton",overridesResolver:(e,t)=>t.switchViewButton})({marginRight:"auto",variants:[{props:{view:"year"},style:{[`.${dpe.switchViewIcon}`]:{transform:"rotate(180deg)"}}}]}),Mpe=Qe(xce,{name:"MuiPickersCalendarHeader",slot:"SwitchViewIcon",overridesResolver:(e,t)=>t.switchViewIcon})(({theme:e})=>({willChange:"transform",transition:e.transitions.create("transform"),transform:"rotate(0deg)"})),$pe=k.forwardRef(function(e,t){const n=ec(),r=Yr(),o=Wr({props:e,name:"MuiPickersCalendarHeader"}),{slots:a,slotProps:i,currentMonth:l,disabled:c,disableFuture:f,disablePast:u,maxDate:h,minDate:m,onMonthChange:v,onViewChange:b,view:x,reduceAnimations:w,views:S,labelId:R,className:E,timezone:M,format:$=`${r.formats.month} ${r.formats.year}`}=o,D=Un(o,wpe),F=o,I=kpe(o),U=a?.switchViewButton??Ope,z=xr({elementType:U,externalSlotProps:i?.switchViewButton,additionalProps:{size:"small","aria-label":n.calendarViewSwitchingButtonAriaLabel(x)},ownerState:F,className:I.switchViewButton}),L=a?.switchViewIcon??Mpe,C=xr({elementType:L,externalSlotProps:i?.switchViewIcon,ownerState:F,className:I.switchViewIcon}),j=Un(C,Cpe),N=()=>v(r.addMonths(l,1),"left"),V=()=>v(r.addMonths(l,-1),"right"),A=xpe(l,{disableFuture:f,maxDate:h,timezone:M}),Y=Spe(l,{disablePast:u,minDate:m,timezone:M}),W=()=>{if(!(S.length===1||!b||c))if(S.length===2)b(S.find(Q=>Q!==x)||S[0]);else{const Q=S.indexOf(x)!==0?0:1;b(S[Q])}};if(S.length===1&&S[0]==="year")return null;const re=r.formatByString(l,$);return g.jsxs(Epe,Ie({},D,{ownerState:F,className:zt(I.root,E),ref:t,children:[g.jsxs(Rpe,{role:"presentation",onClick:W,ownerState:F,"aria-live":"polite",className:I.labelContainer,children:[g.jsx(W5,{reduceAnimations:w,transKey:re,children:g.jsx(Tpe,{id:R,ownerState:F,className:I.label,children:re})}),S.length>1&&!c&&g.jsx(U,Ie({},z,{children:g.jsx(L,Ie({},j))}))]}),g.jsx(xd,{in:x==="day",appear:!w,enter:!w,children:g.jsx(bpe,{slots:a,slotProps:i,onGoToPrevious:V,isPreviousDisabled:Y,previousLabel:n.previousMonth,onGoToNext:N,isNextDisabled:A,nextLabel:n.nextMonth})})]}))}),Ppe=Qe("div")({overflow:"hidden",width:cx,maxHeight:FE,display:"flex",flexDirection:"column",margin:"0 auto"}),Ape=e=>cn("MuiDateCalendar",e);tn("MuiDateCalendar",["root","viewTransitionContainer"]);const Dpe=["autoFocus","onViewChange","value","defaultValue","referenceDate","disableFuture","disablePast","onChange","onYearChange","onMonthChange","reduceAnimations","shouldDisableDate","shouldDisableMonth","shouldDisableYear","view","views","openTo","className","disabled","readOnly","minDate","maxDate","disableHighlightToday","focusedView","onFocusedViewChange","showDaysOutsideCurrentMonth","fixedWeekNumber","dayOfWeekFormatter","slots","slotProps","loading","renderLoading","displayWeekNumber","yearsOrder","yearsPerRow","monthsPerRow","timezone"],jpe=e=>{const{classes:t}=e;return sn({root:["root"],viewTransitionContainer:["viewTransitionContainer"]},Ape,t)};function Npe(e,t){const n=Yr(),r=ry(),o=m5(),a=Wr({props:e,name:t});return Ie({},a,{loading:a.loading??!1,disablePast:a.disablePast??!1,disableFuture:a.disableFuture??!1,openTo:a.openTo??"day",views:a.views??["year","day"],reduceAnimations:a.reduceAnimations??o,renderLoading:a.renderLoading??(()=>g.jsx("span",{children:"..."})),minDate:Ji(n,a.minDate,r.minDate),maxDate:Ji(n,a.maxDate,r.maxDate)})}const Ipe=Qe(Ppe,{name:"MuiDateCalendar",slot:"Root",overridesResolver:(e,t)=>t.root})({display:"flex",flexDirection:"column",height:FE}),Lpe=Qe(W5,{name:"MuiDateCalendar",slot:"ViewTransitionContainer",overridesResolver:(e,t)=>t.viewTransitionContainer})({}),zpe=k.forwardRef(function(e,t){const n=Yr(),r=Ms(),o=Npe(e,"MuiDateCalendar"),{autoFocus:a,onViewChange:i,value:l,defaultValue:c,referenceDate:f,disableFuture:u,disablePast:h,onChange:m,onYearChange:v,onMonthChange:b,reduceAnimations:x,shouldDisableDate:w,shouldDisableMonth:S,shouldDisableYear:R,view:E,views:M,openTo:$,className:D,disabled:F,readOnly:I,minDate:U,maxDate:z,disableHighlightToday:L,focusedView:C,onFocusedViewChange:j,showDaysOutsideCurrentMonth:N,fixedWeekNumber:V,dayOfWeekFormatter:A,slots:Y,slotProps:W,loading:re,renderLoading:Q,displayWeekNumber:oe,yearsOrder:ce,yearsPerRow:Z,monthsPerRow:ae,timezone:J}=o,ne=Un(o,Dpe),{value:ee,handleValueChange:ue,timezone:pe}=zE({name:"DateCalendar",timezone:J,value:l,defaultValue:c,referenceDate:f,onChange:m,valueManager:cl}),{view:ye,setView:ie,focusedView:he,setFocusedView:le,goToNextView:be,setValueAndGoToNextView:Ve}=g5({view:E,views:M,openTo:$,onChange:ue,onViewChange:i,autoFocus:a,focusedView:C,onFocusedViewChange:j}),{referenceDate:Re,calendarState:Oe,changeFocusedDay:de,changeMonth:at,handleChangeMonth:Ne,isDateDisabled:Je,onMonthSwitchingAnimationEnd:tt}=cfe({value:ee,referenceDate:f,reduceAnimations:x,onMonthChange:b,minDate:U,maxDate:z,shouldDisableDate:w,disablePast:h,disableFuture:u,timezone:pe}),qt=F&&ee||U,Ft=F&&ee||z,nt=`${r}-grid-label`,et=he!==null,ut=Y?.calendarHeader??$pe,Le=xr({elementType:ut,externalSlotProps:W?.calendarHeader,additionalProps:{views:M,view:ye,currentMonth:Oe.currentMonth,onViewChange:ie,onMonthChange:(fn,$n)=>Ne({newMonth:fn,direction:$n}),minDate:qt,maxDate:Ft,disabled:F,disablePast:h,disableFuture:u,reduceAnimations:x,timezone:pe,labelId:nt},ownerState:o}),ve=Bt(fn=>{const $n=n.startOfMonth(fn),_n=n.endOfMonth(fn),Bn=Je(fn)?eg({utils:n,date:fn,minDate:n.isBefore(U,$n)?$n:U,maxDate:n.isAfter(z,_n)?_n:z,disablePast:h,disableFuture:u,isDateDisabled:Je,timezone:pe}):fn;Bn?(Ve(Bn,"finish"),b?.($n)):(be(),at($n)),de(Bn,!0)}),Ye=Bt(fn=>{const $n=n.startOfYear(fn),_n=n.endOfYear(fn),Bn=Je(fn)?eg({utils:n,date:fn,minDate:n.isBefore(U,$n)?$n:U,maxDate:n.isAfter(z,_n)?_n:z,disablePast:h,disableFuture:u,isDateDisabled:Je,timezone:pe}):fn;Bn?(Ve(Bn,"finish"),v?.(Bn)):(be(),at($n)),de(Bn,!0)}),je=Bt(fn=>ue(fn&&zb(n,fn,ee??Re),"finish",ye));k.useEffect(()=>{ee!=null&&n.isValid(ee)&&at(ee)},[ee]);const wt=o,Ct=jpe(wt),yt={disablePast:h,disableFuture:u,maxDate:z,minDate:U},ct={disableHighlightToday:L,readOnly:I,disabled:F,timezone:pe,gridLabelId:nt,slots:Y,slotProps:W},jt=k.useRef(ye);k.useEffect(()=>{jt.current!==ye&&(he===jt.current&&le(ye,!0),jt.current=ye)},[he,le,ye]);const Wt=k.useMemo(()=>[ee],[ee]);return g.jsxs(Ipe,Ie({ref:t,className:zt(Ct.root,D),ownerState:wt},ne,{children:[g.jsx(ut,Ie({},Le,{slots:Y,slotProps:W})),g.jsx(Lpe,{reduceAnimations:x,className:Ct.viewTransitionContainer,transKey:ye,ownerState:wt,children:g.jsxs("div",{children:[ye==="year"&&g.jsx(cpe,Ie({},yt,ct,{value:ee,onChange:Ye,shouldDisableYear:R,hasFocus:et,onFocusedViewChange:fn=>le("year",fn),yearsOrder:ce,yearsPerRow:Z,referenceDate:Re})),ye==="month"&&g.jsx(Xfe,Ie({},yt,ct,{hasFocus:et,className:D,value:ee,onChange:ve,shouldDisableMonth:S,onFocusedViewChange:fn=>le("month",fn),monthsPerRow:ae,referenceDate:Re})),ye==="day"&&g.jsx(Ffe,Ie({},Oe,yt,ct,{onMonthSwitchingAnimationEnd:tt,onFocusedDayChange:de,reduceAnimations:x,selectedDays:Wt,onSelectedDaysChange:je,shouldDisableDate:w,shouldDisableMonth:S,shouldDisableYear:R,hasFocus:et,onFocusedViewChange:fn=>le("day",fn),showDaysOutsideCurrentMonth:N,fixedWeekNumber:V,dayOfWeekFormatter:A,displayWeekNumber:oe,loading:re,renderLoading:Q}))]})})]}))}),lp=({view:e,onViewChange:t,views:n,focusedView:r,onFocusedViewChange:o,value:a,defaultValue:i,referenceDate:l,onChange:c,className:f,classes:u,disableFuture:h,disablePast:m,minDate:v,maxDate:b,shouldDisableDate:x,shouldDisableMonth:w,shouldDisableYear:S,reduceAnimations:R,onMonthChange:E,monthsPerRow:M,onYearChange:$,yearsOrder:D,yearsPerRow:F,slots:I,slotProps:U,loading:z,renderLoading:L,disableHighlightToday:C,readOnly:j,disabled:N,showDaysOutsideCurrentMonth:V,dayOfWeekFormatter:A,sx:Y,autoFocus:W,fixedWeekNumber:re,displayWeekNumber:Q,timezone:oe})=>g.jsx(zpe,{view:e,onViewChange:t,views:n.filter(kA),focusedView:r&&kA(r)?r:null,onFocusedViewChange:o,value:a,defaultValue:i,referenceDate:l,onChange:c,className:f,classes:u,disableFuture:h,disablePast:m,minDate:v,maxDate:b,shouldDisableDate:x,shouldDisableMonth:w,shouldDisableYear:S,reduceAnimations:R,onMonthChange:E,monthsPerRow:M,onYearChange:$,yearsOrder:D,yearsPerRow:F,slots:I,slotProps:U,loading:z,renderLoading:L,disableHighlightToday:C,readOnly:j,disabled:N,showDaysOutsideCurrentMonth:V,dayOfWeekFormatter:A,sx:Y,autoFocus:W,fixedWeekNumber:re,displayWeekNumber:Q,timezone:oe}),Q5=k.forwardRef(function(e,t){const n=ec(),r=Yr(),o=Qz(e,"MuiDesktopDatePicker"),a=Ie({day:lp,month:lp,year:lp},o.viewRenderers),i=Ie({},o,{viewRenderers:a,format:CE(r,o,!1),yearsPerRow:o.yearsPerRow??4,slots:Ie({openPickerIcon:Cce,field:H5},o.slots),slotProps:Ie({},o.slotProps,{field:c=>Ie({},rx(o.slotProps?.field,c),Zz(o),{ref:t}),toolbar:Ie({hidden:!0},o.slotProps?.toolbar)})}),{renderPicker:l}=bce({props:i,valueManager:cl,valueType:"date",getOpenDialogAriaText:Gz({utils:r,formatKey:"fullDate",contextTranslation:n.openDatePickerDialogue,propsTranslation:i.localeText?.openDatePickerDialogue}),validator:oy});return l()});Q5.propTypes={autoFocus:ot.bool,className:ot.string,closeOnSelect:ot.bool,dayOfWeekFormatter:ot.func,defaultValue:ot.object,disabled:ot.bool,disableFuture:ot.bool,disableHighlightToday:ot.bool,disableOpenPicker:ot.bool,disablePast:ot.bool,displayWeekNumber:ot.bool,enableAccessibleFieldDOMStructure:ot.any,fixedWeekNumber:ot.number,format:ot.string,formatDensity:ot.oneOf(["dense","spacious"]),inputRef:Iz,label:ot.node,loading:ot.bool,localeText:ot.object,maxDate:ot.object,minDate:ot.object,monthsPerRow:ot.oneOf([3,4]),name:ot.string,onAccept:ot.func,onChange:ot.func,onClose:ot.func,onError:ot.func,onMonthChange:ot.func,onOpen:ot.func,onSelectedSectionsChange:ot.func,onViewChange:ot.func,onYearChange:ot.func,open:ot.bool,openTo:ot.oneOf(["day","month","year"]),orientation:ot.oneOf(["landscape","portrait"]),readOnly:ot.bool,reduceAnimations:ot.bool,referenceDate:ot.object,renderLoading:ot.func,selectedSections:ot.oneOfType([ot.oneOf(["all","day","empty","hours","meridiem","minutes","month","seconds","weekDay","year"]),ot.number]),shouldDisableDate:ot.func,shouldDisableMonth:ot.func,shouldDisableYear:ot.func,showDaysOutsideCurrentMonth:ot.bool,slotProps:ot.object,slots:ot.object,sx:ot.oneOfType([ot.arrayOf(ot.oneOfType([ot.func,ot.object,ot.bool])),ot.func,ot.object]),timezone:ot.string,value:ot.object,view:ot.oneOf(["day","month","year"]),viewRenderers:ot.shape({day:ot.func,month:ot.func,year:ot.func}),views:ot.arrayOf(ot.oneOf(["day","month","year"]).isRequired),yearsOrder:ot.oneOf(["asc","desc"]),yearsPerRow:ot.oneOf([3,4])};function Fpe(e){return cn("MuiDialogContent",e)}tn("MuiDialogContent",["root","dividers"]);const _pe=tn("MuiDialogTitle",["root"]),Upe=e=>{const{classes:t,dividers:n}=e;return sn({root:["root",n&&"dividers"]},Fpe,t)},Bpe=Qe("div",{name:"MuiDialogContent",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.dividers&&t.dividers]}})(qn(({theme:e})=>({flex:"1 1 auto",WebkitOverflowScrolling:"touch",overflowY:"auto",padding:"20px 24px",variants:[{props:({ownerState:t})=>t.dividers,style:{padding:"16px 24px",borderTop:`1px solid ${(e.vars||e).palette.divider}`,borderBottom:`1px solid ${(e.vars||e).palette.divider}`}},{props:({ownerState:t})=>!t.dividers,style:{[`.${_pe.root} + &`]:{paddingTop:0}}}]}))),Vpe=k.forwardRef(function(e,t){const n=Wn({props:e,name:"MuiDialogContent"}),{className:r,dividers:o=!1,...a}=n,i={...n,dividers:o},l=Upe(i);return g.jsx(Bpe,{className:zt(l.root,r),ownerState:i,ref:t,...a})});function Hpe(e){return cn("MuiDialog",e)}const ag=tn("MuiDialog",["root","scrollPaper","scrollBody","container","paper","paperScrollPaper","paperScrollBody","paperWidthFalse","paperWidthXs","paperWidthSm","paperWidthMd","paperWidthLg","paperWidthXl","paperFullWidth","paperFullScreen"]),qpe=k.createContext({}),Wpe=Qe(M5,{name:"MuiDialog",slot:"Backdrop",overrides:(e,t)=>t.backdrop})({zIndex:-1}),Ype=e=>{const{classes:t,scroll:n,maxWidth:r,fullWidth:o,fullScreen:a}=e,i={root:["root"],container:["container",`scroll${St(n)}`],paper:["paper",`paperScroll${St(n)}`,`paperWidth${St(String(r))}`,o&&"paperFullWidth",a&&"paperFullScreen"]};return sn(i,Hpe,t)},Gpe=Qe($5,{name:"MuiDialog",slot:"Root"})({"@media print":{position:"absolute !important"}}),Kpe=Qe("div",{name:"MuiDialog",slot:"Container",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.container,t[`scroll${St(n.scroll)}`]]}})({height:"100%","@media print":{height:"auto"},outline:0,variants:[{props:{scroll:"paper"},style:{display:"flex",justifyContent:"center",alignItems:"center"}},{props:{scroll:"body"},style:{overflowY:"auto",overflowX:"hidden",textAlign:"center","&::after":{content:'""',display:"inline-block",verticalAlign:"middle",height:"100%",width:"0"}}}]}),Qpe=Qe(Md,{name:"MuiDialog",slot:"Paper",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.paper,t[`scrollPaper${St(n.scroll)}`],t[`paperWidth${St(String(n.maxWidth))}`],n.fullWidth&&t.paperFullWidth,n.fullScreen&&t.paperFullScreen]}})(qn(({theme:e})=>({margin:32,position:"relative",overflowY:"auto","@media print":{overflowY:"visible",boxShadow:"none"},variants:[{props:{scroll:"paper"},style:{display:"flex",flexDirection:"column",maxHeight:"calc(100% - 64px)"}},{props:{scroll:"body"},style:{display:"inline-block",verticalAlign:"middle",textAlign:"initial"}},{props:({ownerState:t})=>!t.maxWidth,style:{maxWidth:"calc(100% - 64px)"}},{props:{maxWidth:"xs"},style:{maxWidth:e.breakpoints.unit==="px"?Math.max(e.breakpoints.values.xs,444):`max(${e.breakpoints.values.xs}${e.breakpoints.unit}, 444px)`,[`&.${ag.paperScrollBody}`]:{[e.breakpoints.down(Math.max(e.breakpoints.values.xs,444)+64)]:{maxWidth:"calc(100% - 64px)"}}}},...Object.keys(e.breakpoints.values).filter(t=>t!=="xs").map(t=>({props:{maxWidth:t},style:{maxWidth:`${e.breakpoints.values[t]}${e.breakpoints.unit}`,[`&.${ag.paperScrollBody}`]:{[e.breakpoints.down(e.breakpoints.values[t]+64)]:{maxWidth:"calc(100% - 64px)"}}}})),{props:({ownerState:t})=>t.fullWidth,style:{width:"calc(100% - 64px)"}},{props:({ownerState:t})=>t.fullScreen,style:{margin:0,width:"100%",maxWidth:"100%",height:"100%",maxHeight:"none",borderRadius:0,[`&.${ag.paperScrollBody}`]:{margin:0,maxWidth:"100%"}}}]}))),Xpe=k.forwardRef(function(e,t){const n=Wn({props:e,name:"MuiDialog"}),r=Td(),o={enter:r.transitions.duration.enteringScreen,exit:r.transitions.duration.leavingScreen},{"aria-describedby":a,"aria-labelledby":i,"aria-modal":l=!0,BackdropComponent:c,BackdropProps:f,children:u,className:h,disableEscapeKeyDown:m=!1,fullScreen:v=!1,fullWidth:b=!1,maxWidth:x="sm",onClick:w,onClose:S,open:R,PaperComponent:E=Md,PaperProps:M={},scroll:$="paper",slots:D={},slotProps:F={},TransitionComponent:I=xd,transitionDuration:U=o,TransitionProps:z,...L}=n,C={...n,disableEscapeKeyDown:m,fullScreen:v,fullWidth:b,maxWidth:x,scroll:$},j=Ype(C),N=k.useRef(),V=he=>{N.current=he.target===he.currentTarget},A=he=>{w&&w(he),N.current&&(N.current=null,S&&S(he,"backdropClick"))},Y=Ms(i),W=k.useMemo(()=>({titleId:Y}),[Y]),re={transition:I,...D},Q={transition:z,paper:M,backdrop:f,...F},oe={slots:re,slotProps:Q},[ce,Z]=lr("root",{elementType:Gpe,shouldForwardComponentProp:!0,externalForwardedProps:oe,ownerState:C,className:zt(j.root,h),ref:t}),[ae,J]=lr("backdrop",{elementType:Wpe,shouldForwardComponentProp:!0,externalForwardedProps:oe,ownerState:C}),[ne,ee]=lr("paper",{elementType:Qpe,shouldForwardComponentProp:!0,externalForwardedProps:oe,ownerState:C,className:zt(j.paper,M.className)}),[ue,pe]=lr("container",{elementType:Kpe,externalForwardedProps:oe,ownerState:C,className:j.container}),[ye,ie]=lr("transition",{elementType:xd,externalForwardedProps:oe,ownerState:C,additionalProps:{appear:!0,in:R,timeout:U,role:"presentation"}});return g.jsx(ce,{closeAfterTransition:!0,slots:{backdrop:ae},slotProps:{backdrop:{transitionDuration:U,as:c,...J}},disableEscapeKeyDown:m,onClose:S,open:R,onClick:A,...Z,...L,children:g.jsx(ye,{...ie,children:g.jsx(ue,{onMouseDown:V,...pe,children:g.jsx(ne,{as:E,elevation:24,role:"dialog","aria-describedby":a,"aria-labelledby":Y,"aria-modal":l,...ee,children:g.jsx(qpe.Provider,{value:W,children:u})})})})})}),Zpe=Qe(Xpe)({[`& .${ag.container}`]:{outline:0},[`& .${ag.paper}`]:{outline:0,minWidth:cx}}),Jpe=Qe(Vpe)({"&:first-of-type":{padding:0}});function ehe(e){const{children:t,onDismiss:n,open:r,slots:o,slotProps:a}=e,i=o?.dialog??Zpe,l=o?.mobileTransition??xd;return g.jsx(i,Ie({open:r,onClose:n},a?.dialog,{TransitionComponent:l,TransitionProps:a?.mobileTransition,PaperComponent:o?.mobilePaper,PaperProps:a?.mobilePaper,children:g.jsx(Jpe,{children:t})}))}const the=["props","getOpenDialogAriaText"],nhe=e=>{let{props:t,getOpenDialogAriaText:n}=e,r=Un(e,the);const{slots:o,slotProps:a,className:i,sx:l,format:c,formatDensity:f,enableAccessibleFieldDOMStructure:u,selectedSections:h,onSelectedSectionsChange:m,timezone:v,name:b,label:x,inputRef:w,readOnly:S,disabled:R,localeText:E}=t,M=k.useRef(null),$=Ms(),D=a?.toolbar?.hidden??!1,{open:F,actions:I,layoutProps:U,renderCurrentView:z,fieldProps:L,contextValue:C}=y5(Ie({},r,{props:t,fieldRef:M,autoFocusView:!0,additionalViewProps:{},wrapperVariant:"mobile"})),j=o.field,N=xr({elementType:j,externalSlotProps:a?.field,additionalProps:Ie({},L,D&&{id:$},!(R||S)&&{onClick:I.onOpen,onKeyDown:ale(I.onOpen)},{readOnly:S??!0,disabled:R,className:i,sx:l,format:c,formatDensity:f,enableAccessibleFieldDOMStructure:u,selectedSections:h,onSelectedSectionsChange:m,timezone:v,label:x,name:b},w?{inputRef:w}:{}),ownerState:t});N.inputProps=Ie({},N.inputProps,{"aria-label":n(L.value)});const V=Ie({textField:o.textField},N.slots),A=o.layout??C5;let Y=$;D&&(x?Y=`${$}-label`:Y=void 0);const W=Ie({},a,{toolbar:Ie({},a?.toolbar,{titleId:$}),mobilePaper:Ie({"aria-labelledby":Y},a?.mobilePaper)}),re=mr(M,N.unstableFieldRef);return{renderPicker:()=>g.jsxs(k5,{contextValue:C,localeText:E,children:[g.jsx(j,Ie({},N,{slots:V,slotProps:W,unstableFieldRef:re})),g.jsx(ehe,Ie({},I,{open:F,slots:o,slotProps:W,children:g.jsx(A,Ie({},U,W?.layout,{slots:o,slotProps:W,children:z()}))}))]})}},X5=k.forwardRef(function(e,t){const n=ec(),r=Yr(),o=Qz(e,"MuiMobileDatePicker"),a=Ie({day:lp,month:lp,year:lp},o.viewRenderers),i=Ie({},o,{viewRenderers:a,format:CE(r,o,!1),slots:Ie({field:H5},o.slots),slotProps:Ie({},o.slotProps,{field:c=>Ie({},rx(o.slotProps?.field,c),Zz(o),{ref:t}),toolbar:Ie({hidden:!1},o.slotProps?.toolbar)})}),{renderPicker:l}=nhe({props:i,valueManager:cl,valueType:"date",getOpenDialogAriaText:Gz({utils:r,formatKey:"fullDate",contextTranslation:n.openDatePickerDialogue,propsTranslation:i.localeText?.openDatePickerDialogue}),validator:oy});return l()});X5.propTypes={autoFocus:ot.bool,className:ot.string,closeOnSelect:ot.bool,dayOfWeekFormatter:ot.func,defaultValue:ot.object,disabled:ot.bool,disableFuture:ot.bool,disableHighlightToday:ot.bool,disableOpenPicker:ot.bool,disablePast:ot.bool,displayWeekNumber:ot.bool,enableAccessibleFieldDOMStructure:ot.any,fixedWeekNumber:ot.number,format:ot.string,formatDensity:ot.oneOf(["dense","spacious"]),inputRef:Iz,label:ot.node,loading:ot.bool,localeText:ot.object,maxDate:ot.object,minDate:ot.object,monthsPerRow:ot.oneOf([3,4]),name:ot.string,onAccept:ot.func,onChange:ot.func,onClose:ot.func,onError:ot.func,onMonthChange:ot.func,onOpen:ot.func,onSelectedSectionsChange:ot.func,onViewChange:ot.func,onYearChange:ot.func,open:ot.bool,openTo:ot.oneOf(["day","month","year"]),orientation:ot.oneOf(["landscape","portrait"]),readOnly:ot.bool,reduceAnimations:ot.bool,referenceDate:ot.object,renderLoading:ot.func,selectedSections:ot.oneOfType([ot.oneOf(["all","day","empty","hours","meridiem","minutes","month","seconds","weekDay","year"]),ot.number]),shouldDisableDate:ot.func,shouldDisableMonth:ot.func,shouldDisableYear:ot.func,showDaysOutsideCurrentMonth:ot.bool,slotProps:ot.object,slots:ot.object,sx:ot.oneOfType([ot.arrayOf(ot.oneOfType([ot.func,ot.object,ot.bool])),ot.func,ot.object]),timezone:ot.string,value:ot.object,view:ot.oneOf(["day","month","year"]),viewRenderers:ot.shape({day:ot.func,month:ot.func,year:ot.func}),views:ot.arrayOf(ot.oneOf(["day","month","year"]).isRequired),yearsOrder:ot.oneOf(["asc","desc"]),yearsPerRow:ot.oneOf([3,4])};const rhe=["desktopModeMediaQuery"],Hb=k.forwardRef(function(e,t){const n=Wr({props:e,name:"MuiDatePicker"}),{desktopModeMediaQuery:r=ile}=n,o=Un(n,rhe);return Nz(r,{defaultMatches:!0})?g.jsx(Q5,Ie({ref:t},o)):g.jsx(X5,Ie({ref:t},o))});function Z5(e,t){if(!t)return;const n=t.trim();if(!n)return;const r=e??"string";if(r==="date"||r==="timestamp"||r==="timestamptz")return n.replace(/^@/,"");if(r.startsWith("filter<")){const o=n.replace(/^f(?=['"])/,""),a=o.match(/^'([^'\\]*)'$/)??o.match(/^"([^"\\]*)"$/);return a?a[1]:o}return r==="string"?ohe(n):n}function ohe(e){const t=e[0];return e.length>=2&&(t==="'"||t==='"')&&e[e.length-1]===t?e.slice(1,-1).replace(/\\(["'\\ntr])/g,(n,r)=>r==="n"?`
468
468
  `:r==="t"?" ":r==="r"?"\r":r):e}Pr.extend(gE);const yD=14,ahe=42;function ihe(e){const t=(e.annotations??[]).filter(r=>r.trim().startsWith("#("));if(t.length===0)return;const n=[];for(const r of t){const o=r.trim(),a=o.match(/description="([^"]*)"/);if(a){n.push(a[1]);continue}const i=o.replace(/^#\(/,"").replace(/\)\s*$/,"").trim();i&&n.push(i)}return n.length>0?n.join(`
469
469
  `):void 0}function she({given:e,value:t,onChange:n,options:r,optionsLoading:o,optionsFailed:a}){const i=e.label??e.name??"",{theme:l}=is(),c=e.type??"string",f=ihe(e),u=Z5(c,e.default),h=u!==void 0?`Default: ${u===""?"(empty)":u}`:void 0,m=f||h?g.jsxs(g.Fragment,{children:[f,f&&h?g.jsx("br",{}):null,h]}):void 0,v=c==="string"||Qf(c)==="string",b=!Gu(c)||typeof t!="string"||_re(t),x=A=>g.jsx(Ca,{label:i,value:String(t),error:!0,inputProps:{readOnly:!0},helperText:g.jsxs(g.Fragment,{children:[`Not a ${A}. Clear it to pick one.`,m?g.jsx("br",{}):null,m]}),slotProps:{input:{endAdornment:g.jsx(QS,{onClear:()=>n(null)})}},fullWidth:!0,size:"small"}),w=Gu(c),S=e.control==="multiselect"&&w,R=Gu(c),E=e.control==="select"||e.control==="multiselect",M=E?R?typeof t=="string"?Fre(t):[]:typeof t=="string"&&t!==""?[t]:[]:[];if(E&&v&&b&&!(!S&&M.length>1)){const A=Y=>{const W=R?yE(Y):void 0;if(Y.length===0||W===""){n(null);return}n(R?W:Y[0])};return g.jsx(PW,{multiple:S,disableCloseOnSelect:S,freeSolo:!0,forcePopupIcon:!0,autoSelect:!0,options:r??[],loading:o,noOptionsText:a?"Options unavailable":"No matching values",value:S?M:M[0]??null,onChange:(Y,W)=>A(W===null?[]:Array.isArray(W)?W:[W]),renderInput:Y=>g.jsx(Ca,{...Y,label:i,size:"small",placeholder:M.length!==0?void 0:t===""?"All":u??"All",error:a,helperText:a?g.jsxs(g.Fragment,{children:["Could not load the options for this control. Type a value to filter anyway.",m?g.jsx("br",{}):null,m]}):m,slotProps:{input:{...Y.InputProps,endAdornment:g.jsxs(g.Fragment,{children:[o&&g.jsx(Ug,{size:16}),Y.InputProps.endAdornment]})}}}),fullWidth:!0})}const $=Gu(c)&&Qf(c)==="number",{rangeMin:D,rangeMax:F}=e,I=$&&typeof t=="string"?Bre(t):void 0,U=$&&typeof t=="string"?Hre(t):void 0;if(($||c==="number")&&D!==void 0&&F!==void 0&&(!$||t===void 0||t===null||t===""||I!==void 0||U!==void 0)){const A=U??(I!==void 0?[I,F]:void 0),Y=$?A?.[0]:typeof t=="number"?t:void 0;if(Y===void 0&&t!==void 0&&t!==null&&t!=="")return x("number");const W=Y??D,re=A??[D,F],Q=re[1]>=F?`≥ ${re[0]}`:`${re[0]} to ${re[1]}`,oe=$&&t==="",ce=Y!==void 0||oe;return g.jsxs($w,{fullWidth:!0,children:[g.jsxs(Lt,{component:"fieldset",sx:Z=>({m:0,minWidth:0,border:l.cardBorder,borderRadius:2,px:`${yD}px`,pt:0,pb:.75,minHeight:ahe,transition:"border-color 120ms ease-in","&:hover":{borderColor:Z.palette.text.secondary},"&:focus-within":{borderColor:Z.palette.text.primary}}),children:[g.jsx(It,{component:"legend",variant:"caption",color:"text.secondary",sx:{px:.5,lineHeight:1},children:i}),g.jsxs(fr,{direction:"row",alignItems:"center",spacing:1,children:[g.jsx(It,{variant:"body2",sx:{fontWeight:"fontWeightMedium"},children:ce?oe?"Any":$?Q:String(W):$?"Any":u??"Unset"}),ce&&g.jsx(Tg,{onClear:()=>n(null),sx:{p:0}})]}),g.jsx(wG,{size:"small",min:D,max:F,value:$?re:W,disableSwap:$,valueLabelDisplay:"auto","aria-label":$?void 0:i,getAriaLabel:$?Z=>Z===0?`${i} from`:`${i} to`:void 0,sx:{py:0,mt:.5},onChange:(Z,ae)=>{if($){const[J,ne]=Array.isArray(ae)?[ae[0],ae[1]]:[ae,ae];if(J<=D&&ne>=F){n(null);return}n(ne>=F?Ure(J):Vre(J,ne));return}n(Array.isArray(ae)?ae[0]:ae)}}),g.jsxs(fr,{direction:"row",justifyContent:"space-between",children:[g.jsx(It,{variant:"caption",color:"text.secondary",children:D}),g.jsx(It,{variant:"caption",color:"text.secondary",children:F})]})]}),m&&g.jsx(Pw,{sx:{mx:`${yD}px`},children:m})]})}const z=Gu(c)?Qf(c):void 0,L=z==="date"||z==="timestamp"||z==="timestamptz",C=typeof t=="string"&&/^\d{4}-\d{2}-\d{2}$/.test(t),j=t==null||C;if(L&&!C){const A=che(t);if(A!==void 0)return g.jsx(uhe,{label:i,state:A,onChange:n,helperNode:m,defaultDisplay:u})}if(L&&j){const A=C?Pr.utc(t):null;return g.jsx(Fb,{dateAdapter:fC,children:g.jsx(Hb,{label:i,value:A?.isValid()?A:null,onChange:Y=>n(Y?Y.format("YYYY-MM-DD"):null),slotProps:{textField:{fullWidth:!0,size:"small",helperText:m},field:{clearable:!0,onClear:()=>n(null)}}})})}if(Qf(c)==="boolean"){const A=typeof t=="string"?zre(t):void 0;if(t==null||t===""||A!==void 0)return g.jsx(lhe,{label:i,picked:A,emptyOverride:t==="",onChange:n,helperNode:m,defaultDisplay:u})}if(c==="boolean"){const A=typeof t=="boolean";if(!A&&t!==void 0&&t!==null)return x("true or false");const Y=e.default?.trim()==="true";return g.jsxs($w,{children:[g.jsxs(fr,{direction:"row",alignItems:"center",children:[g.jsx(Dk,{control:g.jsx(b9,{checked:A?t:Y,onChange:W=>n(W.target.checked)}),label:i}),A&&g.jsx(Tg,{onClear:()=>n(null),edge:"end"})]}),m&&g.jsx(Pw,{children:m})]})}if(c==="number"){const A=typeof t=="number"?t:"",Y=t!=null;return Y&&t!==""&&typeof t!="number"?x("number"):g.jsx(Ca,{label:i,type:"number",value:A,onChange:W=>{const re=W.target.value;n(re===""?null:Number(re))},placeholder:u,helperText:m,slotProps:{input:{endAdornment:Y&&g.jsx(QS,{onClear:()=>n(null)})}},fullWidth:!0,size:"small"})}if(c==="date"||c==="timestamp"||c==="timestamptz"){const A=t instanceof Date?t:typeof t=="string"?(W=>W instanceof Date?W:null)(Tz(c,t)):null,Y=A?Pr.utc(A):null;return t!=null&&t!==""&&A===null?x("date"):g.jsx(Fb,{dateAdapter:fC,children:g.jsx(Hb,{label:i,value:Y,onChange:W=>n(W?eoe(W,A??void 0):null),slotProps:{textField:{fullWidth:!0,size:"small",helperText:m},field:{clearable:!0,onClear:()=>n(null)}}})})}const N=typeof t=="string"?t:"",V=t!=null;return g.jsx(Ca,{label:i,value:N,onChange:A=>n(A.target.value),placeholder:V?void 0:u??(c.startsWith("filter<")?c:void 0),helperText:m,slotProps:{input:{endAdornment:V&&g.jsx(QS,{onClear:()=>n(null)})}},fullWidth:!0,size:"small"})}function Tg({onClear:e,edge:t,sx:n}){return g.jsx(Lo,{size:"small","aria-label":"Clear value",onClick:e,edge:t,sx:[{minWidth:24,minHeight:24},...Array.isArray(n)?n:[n]],children:g.jsx(goe,{fontSize:"small"})})}function QS({onClear:e}){return g.jsx(B7,{position:"end",children:g.jsx(Tg,{onClear:e,edge:"end"})})}const zv="__any__";function lhe({label:e,picked:t,emptyOverride:n,onChange:r,helperNode:o,defaultDisplay:a}){const i=t??(n?zv:"");return g.jsx(Lt,{"data-testid":"boolean-filter",children:g.jsxs(Ca,{select:!0,label:e,value:i,size:"small",fullWidth:!0,helperText:o,slotProps:{select:{displayEmpty:!0,renderValue:l=>l==="true"||l==="false"?l:l===zv?"Any":a||"Any"},input:{endAdornment:i!==""?g.jsx(Tg,{onClear:()=>r(null),sx:{mr:2}}):void 0}},onChange:l=>{l.target.value!==zv&&r(l.target.value)},children:[n&&g.jsx(na,{value:zv,children:"Any"}),g.jsx(na,{value:"true",children:"true"}),g.jsx(na,{value:"false",children:"false"})]})})}function che(e){if(e==null)return{kind:"unset"};if(typeof e!="string")return;if(e==="")return{kind:"any"};const t=Wre(e);if(t!==void 0)return{kind:"preset",key:t};const n=Kre(e);if(n!==void 0)return{kind:"days",...n}}const Fv="__custom__",XS="__any__";function uhe({label:e,state:t,onChange:n,helperNode:r,defaultDisplay:o}){const a=t.kind==="days"?`days:${t.firstDay}/${t.lastDay}`:t.kind==="preset"?`preset:${t.key}`:t.kind,[i,l]=k.useState(t.kind==="days"),[c,f]=k.useState(t.kind==="days"?{from:t.firstDay,to:t.lastDay}:{});k.useEffect(()=>{t.kind==="days"?(l(!0),f({from:t.firstDay,to:t.lastDay})):t.kind!=="unset"&&l(!1)},[a]);const u=t.kind!=="unset",h=i?Fv:t.kind==="preset"?t.key:t.kind==="any"?XS:"",m=b=>{f(b),b.from&&b.to&&!Pr.utc(b.to).isBefore(Pr.utc(b.from))&&n(Gre(b.from,b.to))},v=b=>{const x=b?Pr.utc(b):null;return x?.isValid()?x:null};return g.jsxs(fr,{direction:"row",spacing:1,"data-testid":"time-range",children:[g.jsxs(Ca,{select:!0,label:e,value:h,size:"small",fullWidth:!0,helperText:r,slotProps:{select:{displayEmpty:!0,renderValue:b=>{if(b===Fv)return"Custom range";if(b===XS)return"Any time";const x=Ib.find(w=>w.key===b);return x?x.label:o??"Any time"}},input:{endAdornment:u?g.jsx(Tg,{onClear:()=>{l(!1),f({}),n(null)},sx:{mr:2}}):void 0}},onChange:b=>{const x=b.target.value;if(x===Fv){l(!0);return}l(!1);const w=qre(x);w!==void 0&&n(w)},children:[t.kind==="any"&&g.jsx(na,{value:XS,children:"Any time"}),Ib.map(b=>g.jsx(na,{value:b.key,children:b.label},b.key)),g.jsx(na,{value:Fv,children:"Custom range"})]}),i&&g.jsxs(Fb,{dateAdapter:fC,children:[g.jsx(Hb,{label:"From",value:v(c.from),onChange:b=>m({...c,from:b?b.format("YYYY-MM-DD"):void 0}),slotProps:{textField:{size:"small"}}}),g.jsx(Hb,{label:"To",value:v(c.to),minDate:v(c.from)??void 0,onChange:b=>m({...c,to:b?b.format("YYYY-MM-DD"):void 0}),slotProps:{textField:{size:"small"}}})]})]})}function GE({givens:e,values:t,onChange:n,onReset:r,layout:o="panel",options:a,optionsLoading:i,optionsFailed:l,apply:c,title:f}){const{theme:u}=is();if(e.length===0)return null;const h=Array.from(t.values()).some(b=>b!==null),m=e.map(b=>g.jsx(Lt,{sx:o==="bar"?{minWidth:200,flex:"1 1 200px",maxWidth:320}:void 0,children:g.jsx(she,{given:b,value:b.name?t.get(b.name):void 0,onChange:x=>b.name&&n(b.name,x),options:b.name?a?.get(b.name):void 0,optionsLoading:i,optionsFailed:b.name?l?.has(b.name):void 0})},b.name)),v=g.jsxs(fr,{direction:"row",alignItems:"center",spacing:1,children:[c&&g.jsx(eo,{variant:"contained",size:"small",disableElevation:!0,onClick:c.onApply,disabled:!c.pending,children:"Apply"}),h&&g.jsx(eo,{variant:"text",size:"small",onClick:r,children:"Reset"})]});return o==="bar"?g.jsx(Wa,{elevation:0,sx:{p:2,border:u.cardBorder,borderRadius:1,backgroundColor:"transparent"},children:g.jsxs(fr,{direction:"row",alignItems:"flex-start",spacing:2,useFlexGap:!0,sx:{flexWrap:"wrap"},children:[m,g.jsx(Lt,{sx:{flex:"0 0 auto",ml:"auto",pt:.5},children:v})]})}):g.jsxs(Wa,{elevation:0,sx:{p:3,backgroundColor:"transparent",border:"none",boxShadow:"none"},children:[g.jsxs(fr,{direction:"row",alignItems:"center",justifyContent:"space-between",sx:{mb:2},children:[g.jsx(It,{variant:"subtitle2",sx:{fontWeight:"fontWeightMedium",color:"text.primary"},children:f??"Filters"}),v]}),g.jsx(Lt,{sx:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(220px, 1fr))",alignItems:"start",columnGap:3,rowGap:2.5},children:m})]})}const dhe=new Set(["bar","line","chart","scatter_chart"]),fhe=new Set(["table","dashboard","shape_map","segment_map","list","list_detail","big_value","cell","link","image"]);function a0e(e,t){return t==="fill"?"container":t==="fixed"||!e?"content":dhe.has(e)?"container":"content"}function i0e(e,t){return t==="fixed"?!0:t==="fill"?!1:e!==void 0&&fhe.has(e)}function s0e(e){return e==="dashboard"?3:2}function phe(e,t){let n=e.firstElementChild;for(let r=1;r<t&&n;r++)n=n.firstElementChild;return n}function l0e(e,t){const n=phe(e,t);return n&&(n.scrollHeight||n.offsetHeight)||0}const hhe=400,mhe=700,ghe=600,yhe=800,vhe=400,vD=2e3;function bhe(e){return e===void 0?vD:Math.min(e,vD)}function bD({sizing:e,contentHeight:t,maxHeight:n,fillHeight:r}){if(e==="container")return n??vhe;if(t===void 0||t<=0)return bhe(n);const o=n===void 0?t:Math.min(n,t);return r===void 0?o:Math.max(o,r)}function xhe(e){return e.replace(/\\/g,"\\\\").replace(/'/g,"\\'")}function She(e,t){if(e==null||e==="")return;const n=r=>`'${xhe(r)}'`;switch(t===void 0?whe(e):t.startsWith("filter<")?"filter":t){case"filter":return`f${n(String(e))}`;case"string":return n(String(e));case"number":{const r=typeof e=="number"?e:Number(e);return Number.isFinite(r)?String(r):void 0}case"boolean":return e===!0||e==="true"?"true":"false";case"date":{const r=xD(e);return r&&`@${r}`}case"timestamp":{const r=xD(e);if(!r)return;const o=e instanceof Date?e.toISOString().slice(11,19):/[T ](\d{2}:\d{2}(?::\d{2})?)/.exec(String(e))?.[1]??"00:00:00";return`@${r} ${o}`}default:return}}function whe(e){if(typeof e=="string")return"string";if(typeof e=="number")return"number";if(typeof e=="boolean")return"boolean";if(e instanceof Date&&!Number.isNaN(e.getTime()))return e.toISOString().slice(11,19)==="00:00:00"?"date":"timestamp"}function xD(e){return e instanceof Date?Number.isNaN(e.getTime())?void 0:e.toISOString().slice(0,10):/^(\d{4}-\d{2}-\d{2})/.exec(String(e))?.[1]}let ym;function Che(){return ym||(ym=Co(()=>import("./index-sKcoT1e_.js"),[]),ym.catch(()=>{ym=void 0})),ym}function J5(){typeof window>"u"||Che().catch(()=>{})}const eF=tr(g.jsx("path",{d:"M11 7h2v2h-2zm0 4h2v6h-2zm1-9C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8"}));function cp({sx:e,...t}){const{theme:n}=is();return g.jsx(Lo,{size:"small",...t,sx:[{width:32,height:32,bgcolor:n.tile,border:n.border,color:n.tileTitle,"&:hover":{bgcolor:n.tile,color:n.drillLink},"& .MuiSvgIcon-root":{fontSize:18}},...Array.isArray(e)?e:[e]]})}const khe=new Set(["warn","error"]);function Ehe(e){if(!e?.length)return;const t=[];let n=!1;for(const r of e)!r.message||!khe.has(r.severity??"")||(r.severity==="error"&&(n=!0),t.includes(r.message)||t.push(r.message));if(t.length)return{severity:n?"error":"warn",title:t.join(`
470
- `)}}const Rhe=k.lazy(()=>Co(()=>import("./RenderedResult-BUb2Xvr2.es-17Y63pbB.js"),[]).then(e=>e.c));function KE({result:e,maxHeight:t,maxResultSize:n=0,renderLogs:r,drill:o,fill:a=!1}){const i=k.useRef(null);k.useEffect(()=>J5(),[]);const[l,c]=k.useState(void 0),[f,u]=k.useState(void 0),[h,m]=k.useState(!1),[v,b]=k.useState(void 0),x=Ehe(r);if(k.useEffect(()=>{const E=i.current;if(!a||!E)return;const M=new ResizeObserver(([$])=>b(Math.round($.contentRect.height)));return M.observe(E),()=>M.disconnect()},[a,!!e,h]),!e)return null;if(n>0&&e.length>n&&!h)return g.jsxs(Lt,{sx:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:2,p:4,backgroundColor:"#fafafa",border:"1px solid",borderColor:"#e0e0e0",borderRadius:1},children:[g.jsx(wee,{sx:{fontSize:48,color:"#757575"}}),g.jsx(It,{variant:"h6",color:"text.secondary",align:"center",children:"Processing large results may cause browser performance issues. Proceed?"}),g.jsx(eo,{variant:"contained",color:"primary",onClick:()=>m(!0),children:"Proceed"})]});const w=g.jsx(ma,{text:bp.loading,centered:!0,size:32}),S=bD({sizing:l,contentHeight:f,maxHeight:t,fillHeight:a?v:void 0}),R=g.jsx(k.Suspense,{fallback:w,children:g.jsx(Rhe,{result:e,height:S,onSizeChange:u,onSizing:c,drill:o,fill:a})});return g.jsxs(Lt,{ref:i,sx:{position:"relative",height:"auto",border:"0px",borderRadius:0,overflow:"hidden",...a&&{flex:`1 1 ${bD({sizing:l,contentHeight:f,maxHeight:t})}px`,minHeight:0}},children:[a?g.jsx(Lt,{sx:{position:"absolute",inset:0},children:R}):R,x&&g.jsx(Lt,{sx:{position:"absolute",top:4,right:4,zIndex:1},children:g.jsx(Zi,{title:x.title,slotProps:{tooltip:{sx:{whiteSpace:"pre-line"}}},children:g.jsx(cp,{"aria-label":"Render tag warnings",children:g.jsx(eF,{fontSize:"small",color:x.severity==="error"?"error":"warning"})})})})]})}function QE({state:e,context:t,loadingText:n=bp.running,maxHeight:r,maxResultSize:o,drill:a,fill:i,transform:l}){const{data:c,isSuccess:f,isError:u,error:h,fetchStatus:m}=e,v=f||m==="fetching";k.useEffect(()=>{v&&J5()},[v]);const b=c?.data.result,x=k.useMemo(()=>b!==void 0&&l?l(b):b,[b,l]);return u?g.jsx(Lt,{sx:{p:2},children:g.jsx(Ta,{context:t,error:h})}):f?g.jsx(KE,{result:x,maxHeight:r,maxResultSize:o,renderLogs:c.data.renderLogs,drill:a,fill:i}):g.jsx(ma,{text:m==="idle"?bp.loading:n})}const SD=()=>typeof performance<"u"?performance.now():Date.now(),tF=200;function The(e){const t=She(e.rawValue);if(t!==void 0)return`run: ${e.source} -> { drill: ${e.view}.${e.field} = ${t}; select: *; limit: ${tF} }`}function Ohe(e){const t=fee(e);if(!(!t||t.refinement!==void 0||!Pb(t.source)||!Pb(t.view)))return{source:t.source,view:t.view}}function Mhe({request:e,environmentName:t,packageName:n,versionId:r,modelPath:o,givens:a,onClose:i,onDone:l}){const{theme:c}=is(),f=e?The(e):void 0;return g.jsxs(M0,{open:e!==void 0,onClose:i,maxWidth:"lg",fullWidth:!0,children:[g.jsxs(P0,{sx:{display:"flex",alignItems:"flex-start",justifyContent:"space-between",pb:.5},children:[g.jsxs(Lt,{children:[e?g.jsxs(g.Fragment,{children:["Rows where"," ",g.jsx(Lt,{component:"code",sx:{fontSize:"0.9em"},children:e.field})," ","is ",e.label]}):"Rows",g.jsx(It,{component:"div",variant:"caption",sx:{color:c.tileTitle,mt:.25},children:e?`The first ${tF} rows of ${e.source} behind this value, with the tile's own filters and the controls applied.`:""})]}),g.jsx(Lo,{onClick:i,"aria-label":"Close",size:"small",sx:{color:"text.secondary",ml:1},children:g.jsx(ex,{fontSize:"small"})})]}),g.jsxs($0,{dividers:!0,sx:{p:0,minHeight:240},children:[f===void 0&&e&&g.jsx(It,{variant:"body2",sx:{p:2},children:"This value cannot be written as a filter, so its rows cannot be fetched."}),f!==void 0&&g.jsx($he,{query:f,environmentName:t,packageName:n,...r===void 0?{}:{versionId:r},modelPath:o,givens:a,...l?{onDone:l}:{}})]}),g.jsxs(SI,{sx:{px:3,py:1.5},children:[f!==void 0&&g.jsx(It,{variant:"caption",sx:{mr:"auto",color:c.tileTitle,fontFamily:jo,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},title:f,children:f}),g.jsx(eo,{onClick:i,children:"Close"})]})]})}function $he({query:e,environmentName:t,packageName:n,versionId:r,modelPath:o,givens:a,onDone:i}){const l=ZE({environmentName:t,packageName:n,modelPath:o,...r===void 0?{}:{versionId:r},query:e,givens:a}),{isSuccess:c,isError:f}=l,u=k.useRef(void 0);return k.useEffect(()=>{u.current=SD()},[e]),k.useEffect(()=>{u.current===void 0||!c&&!f||(i?.(c,SD()-u.current),u.current=void 0)},[c,f,i]),g.jsx(Lt,{sx:{p:1},children:g.jsx(QE,{state:l,context:e})})}const Phe=tr(g.jsx("path",{d:"m16.95 6-3.57 4.55 1.43 1.43c1.03-1.31 4.98-6.37 4.98-6.37C20.3 4.95 19.83 4 19 4H6.83l2 2zM2.81 2.81 1.39 4.22 10 13v6c0 .55.45 1 1 1h2c.55 0 1-.45 1-1v-2.17l5.78 5.78 1.41-1.41z"})),Ahe=3;function Dhe(e,t){if(e===void 0)return[];const n=new Set(e);return t.flatMap(r=>r.name&&!n.has(r.name)?[r.label??r.name]:[])}function jhe(e){return e.length<2?e.join(""):`${e.slice(0,-1).join(", ")} or ${e[e.length-1]}`}function Nhe({ignored:e}){const{theme:t}=is();if(e.length===0)return null;const n=e.length>Ahe?`Doesn't respond to ${e.length} filters`:`Doesn't respond to ${e.join(", ")}`;return g.jsxs(Lt,{"data-testid":"tile-filter-tag",title:`This tile's query never reads ${jhe(e)}, so changing ${e.length===1?"it":"them"} won't change this tile`,sx:{display:"inline-flex",alignItems:"center",gap:.5,maxWidth:"100%",mb:1,alignSelf:"flex-start",px:.75,py:.125,border:1,borderColor:"warning.main",borderRadius:1,fontSize:11,lineHeight:1.6,color:"warning.main",fontFamily:t.font.family},children:[g.jsx(Phe,{sx:{fontSize:12}}),g.jsx(Lt,{component:"span",sx:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:n})]})}const Ihe=240,Lhe=4;function nF({manifest:e,environmentName:t,packageName:n,versionId:r,documentName:o,givens:a,onGivensChange:i,onNavigate:l,height:c,maxResultSize:f,onEvent:u,chrome:h="card",controlsLayout:m="bar",preamble:v,runModelPath:b,hiddenGivens:x}){const w=k.useMemo(()=>(e.givens??[]).filter(W=>!(v!==void 0&&W.secure===!0)&&!(W.name!==void 0&&x?.includes(W.name))),[e,x,v]),S=k.useMemo(()=>a===void 0?void 0:Object.fromEntries(Object.entries(a).filter(([,W])=>typeof W=="string")),[a]),R=xE({specs:w,loaded:!0,startingValues:e.startingGivens,params:S,onGivensChange:i,documentKey:`${t}/${n}/${r??""}/${o}`,autorun:e.autorun!==!1,environmentName:t,packageName:n,modelPath:b??e.path,versionId:r,documentName:o,...v!==void 0?{preamble:v}:{},...a?{hostGivens:a}:{}}),{applied:E,declaredTypes:M,canSelf:$,onSelf:D}=R,F=k.useMemo(()=>{const W=new Set((e.tiles??[]).flatMap(re=>re.givenNames??[]));return Object.fromEntries(Object.entries(a??{}).filter(([re])=>W.has(re)&&!M.has(re)))},[e,a,M]),[I,U]=k.useState(void 0),z=k.useCallback(W=>{const re=Ohe(W.context);re!==void 0&&U({...re,field:W.field,rawValue:W.rawValue,label:W.label})},[]),L=k.useMemo(()=>bE(ny(E,M),F),[E,M,F]),{drill:C,drillMenu:j}=Pz({onNavigate:l,onSelf:D,canSelf:$,selfLabel:"Filter this dashboard",...v===void 0?{onRows:z}:{}}),N=k.useCallback(W=>({canDrill:C.canDrill,onClick:re=>C.onClick({...re,context:W})}),[C]);if(e.error)return g.jsxs(fr,{spacing:2,children:[g.jsx(wD,{manifest:e,chrome:h}),g.jsx(qi,{severity:"error",children:e.error})]});const V=b??e.path,A=e.tiles??[],Y=e.dashboardColumns??are;return g.jsxs(fr,{spacing:2,children:[h==="card"&&g.jsx(wD,{manifest:e,chrome:h}),w.length>0&&g.jsx(Lt,{sx:{position:"sticky",top:0,zIndex:Lhe,bgcolor:"background.default"},children:g.jsx(GE,{...R.panel,layout:m})}),V===void 0?g.jsx(qi,{severity:"error",children:"This dashboard has no model path, so there is nothing to run."}):e.query!==void 0?g.jsx(RD,{environmentName:t,packageName:n,versionId:r,modelPath:V,queryName:e.query,givens:E,declaredTypes:M,height:c,maxResultSize:f,drill:C,chrome:h}):A.length>0?g.jsx(fre,{tiles:A,columns:Y,minTilePx:Ihe,rowGapPx:h==="none"?sre:ap,keyOf:(W,re)=>`${re}:${W.kind==="text"?`text:${W.name}`:W.query}`,renderTile:W=>W.kind==="text"||W.query===void 0?g.jsx(rF,{markdown:W.markdown??"",chrome:h}):g.jsx(RD,{environmentName:t,packageName:n,versionId:r,modelPath:V,tile:W.query,label:W.label,subtitle:W.subtitle,borderless:W.borderless,givens:E,hostGivens:F,declaredTypes:M,givenNames:W.givenNames,height:c??hhe,maxResultSize:f,drill:N(W.query),chrome:h,ignoredFilters:Dhe(W.givenNames,w),...v!==void 0?{preamble:v,restricted:W.restricted}:{}})}):g.jsx(qi,{severity:"warning",children:"This dashboard names neither a query nor any tiles."}),j,V!==void 0&&g.jsx(Mhe,{request:I,environmentName:t,packageName:n,...r===void 0?{}:{versionId:r},modelPath:V,givens:L,onClose:()=>U(void 0),onDone:(W,re)=>{I&&u?.({type:"dashboard.rows_shown",source:I.source,view:I.view,field:I.field,ok:W,durationMs:re})}})]})}function rF({markdown:e,chrome:t}){return g.jsx(vz,{chrome:t,kind:"text",children:g.jsx(Jm,{variant:"document",children:e})})}function wD({manifest:e,chrome:t}){return g.jsx(oF,{chrome:t,title:e.title??e.name,...e.description?{description:e.description}:{}})}function oF({title:e,description:t,chrome:n="card"}){return g.jsxs(fr,{sx:{gap:2},children:[g.jsx(It,{variant:"h5",children:e}),t&&g.jsx(Lt,{sx:n==="none"?{my:`${cre}px`}:void 0,children:g.jsx(rF,{markdown:t,chrome:n})})]})}const zhe=tr(g.jsx("path",{d:"M9 16.17 4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z"}));async function Fhe(e){const t=await crypto.subtle.digest("SHA-256",new TextEncoder().encode(e));return Array.from(new Uint8Array(t),n=>n.toString(16).padStart(2,"0")).join("")}function _he(e){return e.find(t=>t.authoritative)??e.find(t=>t.writeable)}function Uhe({authoritative:e,mutable:t,versionId:n,canStore:r,readFailed:o}){const a=e?"host":t?"package":"browser",i=n!==void 0&&a==="package";return{savesTo:a,pinnedPackageSave:i,writer:o?void 0:e?r?"storage":void 0:i?void 0:t?"package":r?"storage":void 0}}async function c0e(e,t){return e??(t===void 0?void 0:await Fhe(t))}function u0e({authoritative:e,mutable:t,pinnedPackageSave:n,workspace:r,readFailure:o,versionId:a}){return o!==void 0?`The saved copy could not be read, so Save is off: ${o}`:e&&r?r.writeable?r.description:`${r.description}: you cannot save into it.`:n?`Reading version ${a}: a version is a fixed point in history, so Save is off.`:t?"Save writes the file into the package.":r?`${r.description}: this server does not take writes.`:"This server does not take writes."}function d0e(e){return e instanceof Error?e.message:String(e)}function Bhe(e){const t=e.response?.data;return t?.message?t.message:e instanceof Error?e.message:String(e)}async function f0e({apiClients:e,queryClient:t,environmentName:n,packageName:r,modelPath:o,source:a,expectedHash:i,invalidateOnError:l,invalidate:c,afterWrite:f}){let u;try{u=await e.models.updateModelSource(n,r,o,{source:a,expectedHash:i})}catch(m){for(const v of l)t.invalidateQueries({queryKey:v});throw new Error(Bhe(m))}const h=u.data.contentHash;await f?.(h);for(const{queryKey:m,refetchType:v,wait:b}of c){const x=t.invalidateQueries({queryKey:m,...v?{refetchType:v}:{}});b&&await x}return h}function p0e(e,t){return t===void 0||!/\.(saved|save_undone)$/.test(e.type)||e.where==="package"?e:{...e,workspace:t}}function h0e(e){if(!("resourceUri"in e))return{environmentName:e.environmentName,packageName:e.packageName,versionId:void 0,namesBoth:!0};let t;try{t=ao(e.resourceUri)}catch{t=void 0}return{environmentName:t?.environmentName??"",packageName:t?.packageName??"",versionId:t?.versionId,namesBoth:!!t?.environmentName&&!!t?.packageName}}function Vhe(e){return e.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"").slice(0,80)}function Hhe({title:e,modelPath:t,source:n,view:r}){for(const[o,a]of[["source",n],["view",r]])if(!Xg(a))return`The ${o} name ${JSON.stringify(a)} cannot be written as a Malloy name.`;return/["\\\r\n]/.test(t)?`The model path ${JSON.stringify(t)} cannot be written into an import.`:bz("title",e)}function qhe(e){const t=Hhe(e);if(t)throw new Error(t);return Whe(e)}function Whe({title:e,modelPath:t,source:n,view:r}){const o=`${n}_tiles`,a=`${r}_tile`;return["##! experimental.givens",`## artifact { title=${`"${e.trim().replace(/\\/g,"\\\\").replace(/"/g,'\\"')}"`} tiles=["${o} -> ${a}"] } dashboard { columns=12 }`,`import { ${n} } from "../${t}"`,"",`source: ${o} is ${n} extend {`," # colspan=6",` view: ${a} is ${r}`,"}",""].join(`
470
+ `)}}const Rhe=k.lazy(()=>Co(()=>import("./RenderedResult-CkUS04tl.es-CNz9JsEK.js"),[]).then(e=>e.c));function KE({result:e,maxHeight:t,maxResultSize:n=0,renderLogs:r,drill:o,fill:a=!1}){const i=k.useRef(null);k.useEffect(()=>J5(),[]);const[l,c]=k.useState(void 0),[f,u]=k.useState(void 0),[h,m]=k.useState(!1),[v,b]=k.useState(void 0),x=Ehe(r);if(k.useEffect(()=>{const E=i.current;if(!a||!E)return;const M=new ResizeObserver(([$])=>b(Math.round($.contentRect.height)));return M.observe(E),()=>M.disconnect()},[a,!!e,h]),!e)return null;if(n>0&&e.length>n&&!h)return g.jsxs(Lt,{sx:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:2,p:4,backgroundColor:"#fafafa",border:"1px solid",borderColor:"#e0e0e0",borderRadius:1},children:[g.jsx(wee,{sx:{fontSize:48,color:"#757575"}}),g.jsx(It,{variant:"h6",color:"text.secondary",align:"center",children:"Processing large results may cause browser performance issues. Proceed?"}),g.jsx(eo,{variant:"contained",color:"primary",onClick:()=>m(!0),children:"Proceed"})]});const w=g.jsx(ma,{text:bp.loading,centered:!0,size:32}),S=bD({sizing:l,contentHeight:f,maxHeight:t,fillHeight:a?v:void 0}),R=g.jsx(k.Suspense,{fallback:w,children:g.jsx(Rhe,{result:e,height:S,onSizeChange:u,onSizing:c,drill:o,fill:a})});return g.jsxs(Lt,{ref:i,sx:{position:"relative",height:"auto",border:"0px",borderRadius:0,overflow:"hidden",...a&&{flex:`1 1 ${bD({sizing:l,contentHeight:f,maxHeight:t})}px`,minHeight:0}},children:[a?g.jsx(Lt,{sx:{position:"absolute",inset:0},children:R}):R,x&&g.jsx(Lt,{sx:{position:"absolute",top:4,right:4,zIndex:1},children:g.jsx(Zi,{title:x.title,slotProps:{tooltip:{sx:{whiteSpace:"pre-line"}}},children:g.jsx(cp,{"aria-label":"Render tag warnings",children:g.jsx(eF,{fontSize:"small",color:x.severity==="error"?"error":"warning"})})})})]})}function QE({state:e,context:t,loadingText:n=bp.running,maxHeight:r,maxResultSize:o,drill:a,fill:i,transform:l}){const{data:c,isSuccess:f,isError:u,error:h,fetchStatus:m}=e,v=f||m==="fetching";k.useEffect(()=>{v&&J5()},[v]);const b=c?.data.result,x=k.useMemo(()=>b!==void 0&&l?l(b):b,[b,l]);return u?g.jsx(Lt,{sx:{p:2},children:g.jsx(Ta,{context:t,error:h})}):f?g.jsx(KE,{result:x,maxHeight:r,maxResultSize:o,renderLogs:c.data.renderLogs,drill:a,fill:i}):g.jsx(ma,{text:m==="idle"?bp.loading:n})}const SD=()=>typeof performance<"u"?performance.now():Date.now(),tF=200;function The(e){const t=She(e.rawValue);if(t!==void 0)return`run: ${e.source} -> { drill: ${e.view}.${e.field} = ${t}; select: *; limit: ${tF} }`}function Ohe(e){const t=fee(e);if(!(!t||t.refinement!==void 0||!Pb(t.source)||!Pb(t.view)))return{source:t.source,view:t.view}}function Mhe({request:e,environmentName:t,packageName:n,versionId:r,modelPath:o,givens:a,onClose:i,onDone:l}){const{theme:c}=is(),f=e?The(e):void 0;return g.jsxs(M0,{open:e!==void 0,onClose:i,maxWidth:"lg",fullWidth:!0,children:[g.jsxs(P0,{sx:{display:"flex",alignItems:"flex-start",justifyContent:"space-between",pb:.5},children:[g.jsxs(Lt,{children:[e?g.jsxs(g.Fragment,{children:["Rows where"," ",g.jsx(Lt,{component:"code",sx:{fontSize:"0.9em"},children:e.field})," ","is ",e.label]}):"Rows",g.jsx(It,{component:"div",variant:"caption",sx:{color:c.tileTitle,mt:.25},children:e?`The first ${tF} rows of ${e.source} behind this value, with the tile's own filters and the controls applied.`:""})]}),g.jsx(Lo,{onClick:i,"aria-label":"Close",size:"small",sx:{color:"text.secondary",ml:1},children:g.jsx(ex,{fontSize:"small"})})]}),g.jsxs($0,{dividers:!0,sx:{p:0,minHeight:240},children:[f===void 0&&e&&g.jsx(It,{variant:"body2",sx:{p:2},children:"This value cannot be written as a filter, so its rows cannot be fetched."}),f!==void 0&&g.jsx($he,{query:f,environmentName:t,packageName:n,...r===void 0?{}:{versionId:r},modelPath:o,givens:a,...l?{onDone:l}:{}})]}),g.jsxs(SI,{sx:{px:3,py:1.5},children:[f!==void 0&&g.jsx(It,{variant:"caption",sx:{mr:"auto",color:c.tileTitle,fontFamily:jo,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},title:f,children:f}),g.jsx(eo,{onClick:i,children:"Close"})]})]})}function $he({query:e,environmentName:t,packageName:n,versionId:r,modelPath:o,givens:a,onDone:i}){const l=ZE({environmentName:t,packageName:n,modelPath:o,...r===void 0?{}:{versionId:r},query:e,givens:a}),{isSuccess:c,isError:f}=l,u=k.useRef(void 0);return k.useEffect(()=>{u.current=SD()},[e]),k.useEffect(()=>{u.current===void 0||!c&&!f||(i?.(c,SD()-u.current),u.current=void 0)},[c,f,i]),g.jsx(Lt,{sx:{p:1},children:g.jsx(QE,{state:l,context:e})})}const Phe=tr(g.jsx("path",{d:"m16.95 6-3.57 4.55 1.43 1.43c1.03-1.31 4.98-6.37 4.98-6.37C20.3 4.95 19.83 4 19 4H6.83l2 2zM2.81 2.81 1.39 4.22 10 13v6c0 .55.45 1 1 1h2c.55 0 1-.45 1-1v-2.17l5.78 5.78 1.41-1.41z"})),Ahe=3;function Dhe(e,t){if(e===void 0)return[];const n=new Set(e);return t.flatMap(r=>r.name&&!n.has(r.name)?[r.label??r.name]:[])}function jhe(e){return e.length<2?e.join(""):`${e.slice(0,-1).join(", ")} or ${e[e.length-1]}`}function Nhe({ignored:e}){const{theme:t}=is();if(e.length===0)return null;const n=e.length>Ahe?`Doesn't respond to ${e.length} filters`:`Doesn't respond to ${e.join(", ")}`;return g.jsxs(Lt,{"data-testid":"tile-filter-tag",title:`This tile's query never reads ${jhe(e)}, so changing ${e.length===1?"it":"them"} won't change this tile`,sx:{display:"inline-flex",alignItems:"center",gap:.5,maxWidth:"100%",mb:1,alignSelf:"flex-start",px:.75,py:.125,border:1,borderColor:"warning.main",borderRadius:1,fontSize:11,lineHeight:1.6,color:"warning.main",fontFamily:t.font.family},children:[g.jsx(Phe,{sx:{fontSize:12}}),g.jsx(Lt,{component:"span",sx:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:n})]})}const Ihe=240,Lhe=4;function nF({manifest:e,environmentName:t,packageName:n,versionId:r,documentName:o,givens:a,onGivensChange:i,onNavigate:l,height:c,maxResultSize:f,onEvent:u,chrome:h="card",controlsLayout:m="bar",preamble:v,runModelPath:b,hiddenGivens:x}){const w=k.useMemo(()=>(e.givens??[]).filter(W=>!(v!==void 0&&W.secure===!0)&&!(W.name!==void 0&&x?.includes(W.name))),[e,x,v]),S=k.useMemo(()=>a===void 0?void 0:Object.fromEntries(Object.entries(a).filter(([,W])=>typeof W=="string")),[a]),R=xE({specs:w,loaded:!0,startingValues:e.startingGivens,params:S,onGivensChange:i,documentKey:`${t}/${n}/${r??""}/${o}`,autorun:e.autorun!==!1,environmentName:t,packageName:n,modelPath:b??e.path,versionId:r,documentName:o,...v!==void 0?{preamble:v}:{},...a?{hostGivens:a}:{}}),{applied:E,declaredTypes:M,canSelf:$,onSelf:D}=R,F=k.useMemo(()=>{const W=new Set((e.tiles??[]).flatMap(re=>re.givenNames??[]));return Object.fromEntries(Object.entries(a??{}).filter(([re])=>W.has(re)&&!M.has(re)))},[e,a,M]),[I,U]=k.useState(void 0),z=k.useCallback(W=>{const re=Ohe(W.context);re!==void 0&&U({...re,field:W.field,rawValue:W.rawValue,label:W.label})},[]),L=k.useMemo(()=>bE(ny(E,M),F),[E,M,F]),{drill:C,drillMenu:j}=Pz({onNavigate:l,onSelf:D,canSelf:$,selfLabel:"Filter this dashboard",...v===void 0?{onRows:z}:{}}),N=k.useCallback(W=>({canDrill:C.canDrill,onClick:re=>C.onClick({...re,context:W})}),[C]);if(e.error)return g.jsxs(fr,{spacing:2,children:[g.jsx(wD,{manifest:e,chrome:h}),g.jsx(qi,{severity:"error",children:e.error})]});const V=b??e.path,A=e.tiles??[],Y=e.dashboardColumns??are;return g.jsxs(fr,{spacing:2,children:[h==="card"&&g.jsx(wD,{manifest:e,chrome:h}),w.length>0&&g.jsx(Lt,{sx:{position:"sticky",top:0,zIndex:Lhe,bgcolor:"background.default"},children:g.jsx(GE,{...R.panel,layout:m})}),V===void 0?g.jsx(qi,{severity:"error",children:"This dashboard has no model path, so there is nothing to run."}):e.query!==void 0?g.jsx(RD,{environmentName:t,packageName:n,versionId:r,modelPath:V,queryName:e.query,givens:E,declaredTypes:M,height:c,maxResultSize:f,drill:C,chrome:h}):A.length>0?g.jsx(fre,{tiles:A,columns:Y,minTilePx:Ihe,rowGapPx:h==="none"?sre:ap,keyOf:(W,re)=>`${re}:${W.kind==="text"?`text:${W.name}`:W.query}`,renderTile:W=>W.kind==="text"||W.query===void 0?g.jsx(rF,{markdown:W.markdown??"",chrome:h}):g.jsx(RD,{environmentName:t,packageName:n,versionId:r,modelPath:V,tile:W.query,label:W.label,subtitle:W.subtitle,borderless:W.borderless,givens:E,hostGivens:F,declaredTypes:M,givenNames:W.givenNames,height:c??hhe,maxResultSize:f,drill:N(W.query),chrome:h,ignoredFilters:Dhe(W.givenNames,w),...v!==void 0?{preamble:v,restricted:W.restricted}:{}})}):g.jsx(qi,{severity:"warning",children:"This dashboard names neither a query nor any tiles."}),j,V!==void 0&&g.jsx(Mhe,{request:I,environmentName:t,packageName:n,...r===void 0?{}:{versionId:r},modelPath:V,givens:L,onClose:()=>U(void 0),onDone:(W,re)=>{I&&u?.({type:"dashboard.rows_shown",source:I.source,view:I.view,field:I.field,ok:W,durationMs:re})}})]})}function rF({markdown:e,chrome:t}){return g.jsx(vz,{chrome:t,kind:"text",children:g.jsx(Jm,{variant:"document",children:e})})}function wD({manifest:e,chrome:t}){return g.jsx(oF,{chrome:t,title:e.title??e.name,...e.description?{description:e.description}:{}})}function oF({title:e,description:t,chrome:n="card"}){return g.jsxs(fr,{sx:{gap:2},children:[g.jsx(It,{variant:"h5",children:e}),t&&g.jsx(Lt,{sx:n==="none"?{my:`${cre}px`}:void 0,children:g.jsx(rF,{markdown:t,chrome:n})})]})}const zhe=tr(g.jsx("path",{d:"M9 16.17 4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z"}));async function Fhe(e){const t=await crypto.subtle.digest("SHA-256",new TextEncoder().encode(e));return Array.from(new Uint8Array(t),n=>n.toString(16).padStart(2,"0")).join("")}function _he(e){return e.find(t=>t.authoritative)??e.find(t=>t.writeable)}function Uhe({authoritative:e,mutable:t,versionId:n,canStore:r,readFailed:o}){const a=e?"host":t?"package":"browser",i=n!==void 0&&a==="package";return{savesTo:a,pinnedPackageSave:i,writer:o?void 0:e?r?"storage":void 0:i?void 0:t?"package":r?"storage":void 0}}async function c0e(e,t){return e??(t===void 0?void 0:await Fhe(t))}function u0e({authoritative:e,mutable:t,pinnedPackageSave:n,workspace:r,readFailure:o,versionId:a}){return o!==void 0?`The saved copy could not be read, so Save is off: ${o}`:e&&r?r.writeable?r.description:`${r.description}: you cannot save into it.`:n?`Reading version ${a}: a version is a fixed point in history, so Save is off.`:t?"Save writes the file into the package.":r?`${r.description}: this server does not take writes.`:"This server does not take writes."}function d0e(e){return e instanceof Error?e.message:String(e)}function Bhe(e){const t=e.response?.data;return t?.message?t.message:e instanceof Error?e.message:String(e)}async function f0e({apiClients:e,queryClient:t,environmentName:n,packageName:r,modelPath:o,source:a,expectedHash:i,invalidateOnError:l,invalidate:c,afterWrite:f}){let u;try{u=await e.models.updateModelSource(n,r,o,{source:a,expectedHash:i})}catch(m){for(const v of l)t.invalidateQueries({queryKey:v});throw new Error(Bhe(m))}const h=u.data.contentHash;await f?.(h);for(const{queryKey:m,refetchType:v,wait:b}of c){const x=t.invalidateQueries({queryKey:m,...v?{refetchType:v}:{}});b&&await x}return h}function p0e(e,t){return t===void 0||!/\.(saved|save_undone)$/.test(e.type)||e.where==="package"?e:{...e,workspace:t}}function h0e(e){if(!("resourceUri"in e))return{environmentName:e.environmentName,packageName:e.packageName,versionId:void 0,namesBoth:!0};let t;try{t=ao(e.resourceUri)}catch{t=void 0}return{environmentName:t?.environmentName??"",packageName:t?.packageName??"",versionId:t?.versionId,namesBoth:!!t?.environmentName&&!!t?.packageName}}function Vhe(e){return e.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"").slice(0,80)}function Hhe({title:e,modelPath:t,source:n,view:r}){for(const[o,a]of[["source",n],["view",r]])if(!Xg(a))return`The ${o} name ${JSON.stringify(a)} cannot be written as a Malloy name.`;return/["\\\r\n]/.test(t)?`The model path ${JSON.stringify(t)} cannot be written into an import.`:bz("title",e)}function qhe(e){const t=Hhe(e);if(t)throw new Error(t);return Whe(e)}function Whe({title:e,modelPath:t,source:n,view:r}){const o=`${n}_tiles`,a=`${r}_tile`;return["##! experimental.givens",`## artifact { title=${`"${e.trim().replace(/\\/g,"\\\\").replace(/"/g,'\\"')}"`} tiles=["${o} -> ${a}"] } dashboard { columns=12 }`,`import { ${n} } from "../${t}"`,"",`source: ${o} is ${n} extend {`," # colspan=6",` view: ${a} is ${r}`,"}",""].join(`
471
471
  `)}class aF extends Error{constructor(t){super(t),this.name="DocumentNotFoundError"}}const Yhe=e=>e instanceof aF||e instanceof Error&&e.name==="DocumentNotFoundError";function Ghe(e,t){return`${e}s/${t}.malloy`}function Khe(e){return Vhe(e)||"untitled"}function EC(e,t,n=1){const r=Khe(t);return Ghe(e,n>1?`${r}-${n}`:r)}const Qhe=(e,t,n,r,o)=>({workspace:t,type:e,path:`${n}/${r}/${o}`}),vm=e=>Xg(e)?e:`\`${e}\``;function XE(e,t){const{title:n,modelPath:r,source:o,view:a}=t;if(n.trim()==="")return"A title cannot be empty.";const i=bz("title",n);if(i)return i;if(e==="notebook"&&n.includes("|##"))return"A title cannot contain `|##`, which closes a notebook's text cell.";if(/["\\\r\n]/.test(r)||r.trim()==="")return`The model path ${JSON.stringify(r)} cannot be written as an import.`;for(const[l,c]of[["source",o],["view",a]])if(c.trim()===""||/[`\r\n\\]/.test(c)||e==="dashboard"&&!Xg(c))return`The ${l} name ${JSON.stringify(c)} cannot be written as a Malloy name.`}function Xhe(e){const t=XE("notebook",e);if(t)throw new Error(t);const{modelPath:n,source:r,view:o}=e,a=e.title.trim(),i=`"${a.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}"`,l=vm(`${r}_tiles`),c=vm(`${o}_tile`),f=`"${l} -> ${c}"`;return["##! experimental.givens",`##| artifact { kind=notebook title=${i}`," tiles=["," intro { kind=text },",` ${f}`," ]","}","|##",`import { ${vm(r)} } from "../${n}"`,"","##|(markdown) intro",`# ${a}`,"Say what this notebook is for, then let the queries below answer it.","|##","",`source: ${l} is ${vm(r)} extend {`,` view: ${c} is ${vm(o)}`,"}",""].join(`
472
472
  `)}const qb=20;function Zhe(e){const{savesTo:t,writer:n}=Uhe({...e,readFailed:!1});return t==="browser"?void 0:n}const CD=e=>e.slice(e.indexOf("/")+1,-7);async function Jhe(e){const{kind:t,document:n,target:r,onCreated:o,onEvent:a}=e,i=XE(t,n);if(i)throw new Error(i);const l=t==="dashboard"?qhe(n):Xhe(n);let c;if(r.route==="package"){const f=new Set(r.existing);let u;for(let h=1;h<=qb&&u===void 0;h++){const m=EC(t,n.title,h);if(!f.has(m))try{await r.write(m,l),u=m}catch(v){if(!eme(v))throw v}}if(u===void 0)throw kD(n.title);c={kind:t,path:u,slug:CD(u)}}else{const{storage:f,workspace:u,environmentName:h,packageName:m}=r,v=new Set(r.existing),b=new Set((await f.listDocuments(u,t)).map(w=>w.path));let x;for(let w=1;w<=qb&&x===void 0;w++){const S=EC(t,n.title,w),R=Qhe(t,u.name,h,m,S);if(b.has(R.path)||v.has(S))continue;let E=!0;try{await f.getDocument(R)}catch(M){if(!Yhe(M))throw M;E=!1}E||(x={kind:t,path:S,slug:CD(S),locator:R})}if(x===void 0)throw kD(n.title);await f.saveDocument(x.locator,l),c=x}return a?.({type:`${t}.created`,where:r.route==="package"?"package":"host"}),o?.(c),c}const eme=e=>e?.response?.status===409,kD=e=>new Error(`No free file name for "${e}" after ${qb} tries. Fix: choose a different title.`);function tme(e){try{const t=JSON.parse(e??"");return new Set((t.entries??[]).flatMap(n=>n.kind==="source"&&typeof n.name=="string"?[n.name]:[]))}catch{return new Set}}function nme({environmentName:e,packageName:t,versionId:n,models:r,enabled:o}){const{apiClients:a,server:i}=wr(),l=KI({queries:r.map(b=>({queryKey:["new-document-model",e,t,n,b,i],queryFn:async()=>(await a.models.getModel(e,t,b,n)).data,enabled:o,retry:!1,staleTime:300*1e3,refetchOnWindowFocus:!1}))}),c=l.map(b=>b.dataUpdatedAt).join(),f=k.useMemo(()=>{const b=new Map;return l.forEach((x,w)=>{const S=[],R=tme(x.data?.modelInfo);for(const E of x.data?.sources??[])if(!(typeof E.name!="string"||!R.has(E.name)))for(const M of E.views??[])typeof M.name=="string"&&S.push({source:E.name,view:M.name});S.length>0&&b.set(r[w],S)}),b},[c,r]),u=l.some(b=>b.isLoading),h=u?[]:r.filter((b,x)=>l[x]?.isError),m=!u&&l.some(b=>b.isError&&WL(b.error)),v=()=>{l.forEach(b=>{b.isError&&b.refetch()})};return{choices:f,isLoading:u,isSuccess:l.length>0&&l.every(b=>!b.isPending),failed:h,retry:v,canRetry:m}}const iF=k.createContext(void 0);function rme({children:e,documentStorage:t}){const n=k.useMemo(()=>({documentStorage:t}),[t]);return g.jsx(iF.Provider,{value:n,children:e})}function ome(){return k.useContext(iF)}function Jr(e){const{server:t}=wr(),n={...e,queryKey:[...e.queryKey,t],queryFn:async r=>{try{return await e.queryFn(r)}catch(o){if(o&&typeof o=="object"&&"response"in o){const a=o;if(a.response?.data){const i=new Error(a.response.data.message||a.message);throw i.status=a.response.status,i.data=a.response.data,i}}throw o}},retry:!1,throwOnError:!1};return QI(n,eE)}function tl(e){const t={...e,mutationFn:async n=>{try{return await e.mutationFn(n)}catch(r){if(r&&typeof r=="object"&&"response"in r){const o=r;if(o.response?.data){const a=new Error(o.response.data.message||o.message);throw a.status=o.response.status,a.data=o.response.data,a}}throw r}},retry:!1,throwOnError:!1};return WK(t,eE)}function ame(e){return["queryResult",e.environmentName,e.packageName,e.versionId,e.modelPath,e.queryName,e.query,e.sourceName,JSON.stringify(e.givens??{})]}function m0e(e){return["queryResult",e.environmentName,e.packageName,e.versionId,e.modelPath]}function ZE(e,{enabled:t=!0}={}){const{apiClients:n}=wr();return Jr({queryKey:ame(e),queryFn:({signal:r})=>n.models.executeQueryModel(e.environmentName,e.packageName,e.modelPath,{queryName:e.queryName,query:e.query,sourceName:e.sourceName,givens:e.givens,versionId:e.versionId},void 0,{signal:r}),enabled:t,...VZ})}const ime=/<\/?[A-Za-z][^>]*>|<!--|<![A-Za-z]/;function sF(e){let t=!1;for(const[n,r]of Array.from(e.entries())){if(r.deleted)continue;if(n==="image"||n==="link"){e.delete(n),t=!0;continue}if(n==="label"){let a;try{a=e.text("label")}catch{a=void 0}if(a!==void 0&&ime.test(a)){e.delete("label"),t=!0;continue}}const o=Array.isArray(r.eq)?r.eq:[];for(const a of[r,...o])sF(a)&&(t=!0)}return t}function sme(e){const t=e.trim();if(!/^#(?:\||[ \t\r\n]|$)/.test(t))return e;if(t.includes("@env."))return"";let n;try{n=aE.parseAnnotation(t)}catch{return""}return n.log.length>0?"":sF(n.tag)?`${n.tag.toString()}
473
473
  `:e}function RC(e){if(Array.isArray(e)){for(const n of e)RC(n);return}if(e===null||typeof e!="object")return;const t=e;for(const[n,r]of Object.entries(t))if(n==="annotations"&&Array.isArray(r))for(const o of r){const a=o;typeof a?.value=="string"&&(a.value=sme(a.value))}else RC(r)}function lF(e){let t;try{t=JSON.parse(e)}catch{return e}const n=JSON.stringify(t);RC(t);const r=JSON.stringify(t);return r===n?e:r}const lme=new Set(["bar_chart","line_chart","scatter_chart","shape_map","segment_map","point_map","big_value","sparkline","list","list_detail","dashboard","transpose","table","json","image","link","text"]),cme={value:`# big_value
@@ -476,9 +476,9 @@ ${t}`}function coe(e){return e?.status===403}const uoe=1e3;function $z(e){const
476
476
  `)??[];return n.length===0&&(n.push(`# ${e.name}`),n.push("")),(e.readme?.length??0)>0&&t?n.splice(2,1,t):t&&n.push(t),n.join(`
477
477
  `)};function BD(){const[e,t]=k.useState(!1),{apiClients:n}=wr(),r=()=>{t(!0)},o=()=>{t(!1)},a=zp({mutationFn(l){return n.environments.createEnvironment({name:l.name,readme:yF({name:l.name,readme:""},l.description)})},success:"Environment created",invalidates:[["environments"]],closeDialog:o,resource:"environment",action:"create"}),i=async l=>{l.preventDefault();const c=new FormData(l.currentTarget),f=c.get("name")?.toString(),u=c.get("description")?.toString();if(!f)throw new Error("Name is required");a.mutate({name:f,description:u})};return g.jsxs(pn.Fragment,{children:[g.jsx(tx,{label:"Environment",onClick:r}),g.jsx(Yo,{open:e,onClose:o,title:"New environment",description:"An environment holds packages and the connections they query through.",actions:g.jsxs(g.Fragment,{children:[g.jsx(go,{disabled:a.isPending,onClick:o,children:"Cancel"}),g.jsx(go,{type:"submit",form:"environment-form",variant:"contained",loading:a.isPending,children:"Create environment"})]}),children:g.jsx("form",{onSubmit:i,id:"environment-form",children:g.jsxs(gx,{sx:{gap:2},children:[g.jsx(hr,{autoFocus:!0,required:!0,id:"name",name:"name",label:"Name",type:"text",fullWidth:!0,size:"small",InputLabelProps:{shrink:!0}}),g.jsx(hr,{id:"description",name:"description",label:"Description",placeholder:"Explore semantic models, run queries, and build dashboards",type:"text",fullWidth:!0,size:"small",InputLabelProps:{shrink:!0}})]})})}),a.notice]})}function Fge({environment:e,onCloseDialog:t}){const[n,r]=k.useState(!1),{apiClients:o}=wr(),a=()=>{r(!0)},i=()=>{r(!1),t()},l=zp({mutationFn:()=>o.environments.deleteEnvironment(e.name),success:"Environment deleted",invalidates:[["environments"]],closeDialog:i,resource:"environment",action:"delete"});return g.jsxs(pn.Fragment,{children:[g.jsxs(na,{onClick:a,children:[g.jsx(Pp,{children:g.jsx(U0,{fontSize:"small"})}),g.jsx(nu,{children:"Delete"})]}),g.jsx(Yo,{open:n,onClose:i,title:"Delete environment",actions:g.jsxs(g.Fragment,{children:[g.jsx(go,{onClick:i,children:"Cancel"}),g.jsx(go,{variant:"contained",color:"error",autoFocus:!0,onClick:()=>l.mutate(),loading:l.isPending,children:"Delete environment"})]}),children:g.jsxs(br,{variant:"body2",children:["Delete ",g.jsx("strong",{children:e.name}),"? Its packages stop being served and this cannot be undone."]})}),l.notice]})}function _ge({environment:e,onCloseDialog:t}){const[n,r]=k.useState(!1),{apiClients:o}=wr(),a=()=>{r(!0)},i=()=>{r(!1),t()},l=zp({mutationFn(f){return o.environments.updateEnvironment(e.name,{name:e.name,readme:yF({name:e.name,readme:e.readme},f.description)})},success:"Environment updated",invalidates:[["environments"]],closeDialog:i,resource:"environment",action:"update"}),c=f=>{f.preventDefault();const u=new FormData(f.currentTarget).get("description")?.toString();l.mutate({description:u})};return g.jsxs(pn.Fragment,{children:[g.jsxs(na,{onClick:a,children:[g.jsx(Pp,{children:g.jsx(oE,{fontSize:"small"})}),g.jsx(nu,{children:"Edit"})]}),g.jsx(Yo,{open:n,onClose:i,title:"Edit environment",description:"What this environment is, for the people who open it.",actions:g.jsxs(g.Fragment,{children:[g.jsx(go,{disabled:l.isPending,onClick:i,children:"Cancel"}),g.jsx(go,{type:"submit",form:"environment-form",variant:"contained",loading:l.isPending,children:"Save changes"})]}),children:g.jsx("form",{onSubmit:c,id:"environment-form",children:g.jsxs(gx,{sx:{gap:2},children:[g.jsx(hr,{autoFocus:!0,required:!0,id:"name",name:"name",label:"Name",disabled:!0,type:"text",fullWidth:!0,size:"small",defaultValue:e.name,InputLabelProps:{shrink:!0}}),g.jsx(hr,{id:"description",name:"description",label:"Description",type:"text",fullWidth:!0,size:"small",defaultValue:gF(e.readme),InputLabelProps:{shrink:!0}})]})})}),l.notice]})}const Uge=[{title:"Model",body:"An agent writes what the data means in Malloy — sources, joins, measures — from a warehouse or a file, and validates each edit without a restart.",href:Ic.publishing},{title:"Analyze",body:"Claude, Cursor, Codex or an agent you build asks over MCP; applications and BI tools use REST. Every question runs against the model, never the raw tables.",href:Ic.mcpAgents},{title:"Surface",body:"Dashboards declared in Malloy, notebooks, and no-build HTML data apps, all shipped inside the package, plus this Console for browsing them.",href:Ic.surfaces},{title:"Govern",body:"Runtime parameters, row-level filters and per-source gates are declared in the model, so every surface reads the same rules rather than writing its own.",href:Ic.givens},{title:"Optimize",body:"One annotation materializes an expensive source into a table, and another rolls a measure up to a coarser grain, rebuilt on demand or on a schedule.",href:Ic.materialization},{title:"Run anywhere",body:"DuckDB is built in for CSV, Parquet, JSON and Excel; BigQuery, Snowflake, Postgres, Databricks, MotherDuck and more connect by configuration.",href:Ic.connections}];function Bge({href:e,children:t}){return g.jsx(Lt,{component:"a",href:e,target:"_blank",rel:"noopener noreferrer",sx:{color:"text.primary",textDecoration:"underline"},children:t})}function C0e({onClickEnvironment:e}){const{apiClients:t,mutable:n}=wr(),{data:r,isSuccess:o,isError:a,error:i}=Jr({queryKey:["environments"],queryFn:()=>t.environments.listEnvironments()});if(a)return g.jsx(Ta,{error:i,context:"Environments List"});if(!o)return g.jsx(ma,{text:"Loading environments..."});const l=r.data??[];return g.jsxs(Pk,{maxWidth:"md",sx:{py:6},children:[g.jsxs(Lt,{sx:{mb:5},children:[g.jsx(It,{variant:"h3",component:"h1",sx:{fontWeight:500,letterSpacing:"-0.025em",mb:1},children:"Publisher"}),g.jsx(It,{variant:"body1",color:"text.secondary",sx:{mb:3},children:"The analytics engine for Malloy."}),g.jsx(It,{variant:"body2",color:"text.secondary",sx:{maxWidth:720,lineHeight:1.6},children:"One data model, served over MCP and REST to AI agents, applications and BI tools. Write down what your data means — the sources, the joins, the measures, who may see what — and every surface asks the same model, so the same question returns the same numbers tomorrow."})]}),g.jsx(Gf,{container:!0,spacing:4,sx:{mb:5},children:Uge.map(c=>g.jsx(Gf,{size:{xs:12,sm:6},children:g.jsxs(fr,{spacing:1,children:[g.jsx(It,{variant:"body2",component:"a",href:c.href,target:"_blank",rel:"noopener noreferrer",sx:{fontWeight:500,color:"text.primary",textDecoration:"none","&:hover":{textDecoration:"underline"}},children:c.title}),g.jsx(It,{variant:"body2",color:"text.secondary",sx:{lineHeight:1.6},children:c.body})]})},c.title))}),g.jsx(Kc,{sx:{my:4}}),l.length>0?g.jsx(nl,{title:"Environments",count:l.length,description:"Published environments available on this server",...n?{action:g.jsx(BD,{})}:{},children:g.jsx(fr,{children:l.map(c=>g.jsx(Vge,{environment:c,...e?{onClickEnvironment:e}:{}},c.name))})}):g.jsxs(Lt,{sx:{mb:4},children:[g.jsx(It,{variant:"h5",sx:{fontWeight:500,letterSpacing:"-0.025em",mb:1},children:"Get started"}),g.jsx(It,{variant:"body2",color:"text.secondary",sx:{mb:3,maxWidth:600},children:"Create your first Malloy environment to start exploring semantic models and building data experiences."}),n?g.jsx(BD,{}):g.jsx(eo,{variant:"contained",color:"primary",href:Ic.publishing,target:"_blank",rel:"noopener noreferrer",children:"Learn how to create models"})]}),g.jsx(Kc,{sx:{my:4}}),g.jsxs(It,{variant:"body2",color:"text.secondary",sx:{maxWidth:720,lineHeight:1.6,mt:2},children:["Join the"," ",g.jsx(Bge,{href:"https://join.slack.com/t/malloy-community/shared_invite/zt-1kgfwgi5g-CrsdaRqs81QY67QW0~t_uw",children:"Malloy Slack community"})," ","to ask questions, share ideas, and contribute."]})]})}function Vge({environment:e,onClickEnvironment:t}){const{mutable:n}=wr(),[r,o]=k.useState(null),a=!!r,i=gF(e.readme),l=f=>{f.stopPropagation(),o(f.currentTarget)},c=()=>o(null);return g.jsx(mx,{icon:g.jsx(zge,{sx:{fontSize:18}}),tint:Jk.environment,label:e.name??"",ariaLabel:e.name??"",...i?{description:i}:{},...e.name&&t?{onClick:f=>t(`/${e.name}/`,f)}:{},...n?{trailingAction:g.jsxs(g.Fragment,{children:[g.jsx(Lo,{size:"small",onClick:l,"aria-label":`Environment actions for ${e.name}`,children:g.jsx(B0,{fontSize:"small"})}),g.jsxs(ru,{anchorEl:r,open:a,onClose:c,onClick:f=>f.stopPropagation(),anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},children:[g.jsx(_ge,{environment:e,onCloseDialog:c}),g.jsx(Fge,{environment:e,onCloseDialog:c})]})]})}:{}})}var zf={},li={},xm={},Ff={},VD={},HD;function Hge(){return HD||(HD=1,Object.defineProperty(VD,"__esModule",{value:!0})),VD}var Sm={},wm={},qD;function Pd(){if(qD)return wm;qD=1,Object.defineProperty(wm,"__esModule",{value:!0}),wm.CronField=void 0;let e=class vF{#e=!1;#t=!1;#n=!1;#o=[];options={rawValue:""};static get min(){throw new Error("min must be overridden")}static get max(){throw new Error("max must be overridden")}static get chars(){return Object.freeze([])}static get validChars(){return/^[?,*\dH/-]+$|^.*H\(\d+-\d+\)\/\d+.*$|^.*H\(\d+-\d+\).*$|^.*H\/\d+.*$/}static get constraints(){return{min:this.min,max:this.max,chars:this.chars,validChars:this.validChars}}constructor(n,r={rawValue:""}){if(!Array.isArray(n))throw new Error(`${this.constructor.name} Validation error, values is not an array`);if(!(n.length>0))throw new Error(`${this.constructor.name} Validation error, values contains no values`);this.options={...r,rawValue:r.rawValue??""},this.#o=n.sort(vF.sorter),this.#n=this.options.wildcard!==void 0?this.options.wildcard:this.#r(),this.#e=this.options.rawValue.includes("L")||n.includes("L"),this.#t=this.options.rawValue.includes("?")||n.includes("?")}get min(){return this.constructor.min}get max(){return this.constructor.max}get chars(){return this.constructor.chars}get hasLastChar(){return this.#e}get hasQuestionMarkChar(){return this.#t}get isWildcard(){return this.#n}get values(){return this.#o}static sorter(n,r){const o=typeof n=="number",a=typeof r=="number";return o&&a?n-r:!o&&!a?n.localeCompare(r):o?-1:1}static findNearestValueInList(n,r,o){if(o){for(let a=n.length-1;a>=0;a--)if(n[a]<r)return n[a];return null}for(let a=0;a<n.length;a++)if(n[a]>r)return n[a];return null}findNearestValue(n,r){return this.constructor.findNearestValueInList(this.values,n,r)}serialize(){return{wildcard:this.#n,values:this.#o}}validate(){let n;const r=this.chars.length>0?` or chars ${this.chars.join("")}`:"",o=l=>c=>new RegExp(`^\\d{0,2}${c}$`).test(l),a=l=>(n=l,typeof l=="number"?l>=this.min&&l<=this.max:this.chars.some(o(l)));if(!this.#o.every(a))throw new Error(`${this.constructor.name} Validation error, got value ${n} expected range ${this.min}-${this.max}${r}`);const i=this.#o.find((l,c)=>this.#o.indexOf(l)!==c);if(i)throw new Error(`${this.constructor.name} Validation error, duplicate values found: ${i}`)}#r(){return this.options.rawValue.length>0?["*","?"].includes(this.options.rawValue):Array.from({length:this.max-this.min+1},(n,r)=>r+this.min).every(n=>this.#o.includes(n))}};return wm.CronField=e,wm}var WD;function qge(){if(WD)return Sm;WD=1,Object.defineProperty(Sm,"__esModule",{value:!0}),Sm.CronDayOfMonth=void 0;const e=Pd(),t=1,n=31,r=Object.freeze(["L"]);let o=class extends e.CronField{static get min(){return t}static get max(){return n}static get chars(){return r}static get validChars(){return/^[?,*\dLH/-]+$|^.*H\(\d+-\d+\)\/\d+.*$|^.*H\(\d+-\d+\).*$|^.*H\/\d+.*$/}constructor(a,i){super(a,i),this.validate()}get values(){return super.values}};return Sm.CronDayOfMonth=o,Sm}var Cm={},YD;function Wge(){if(YD)return Cm;YD=1,Object.defineProperty(Cm,"__esModule",{value:!0}),Cm.CronDayOfWeek=void 0;const e=Pd(),t=0,n=7,r=Object.freeze(["L"]);let o=class extends e.CronField{static get min(){return t}static get max(){return n}static get chars(){return r}static get validChars(){return/^[?,*\dLH#/-]+$|^.*H\(\d+-\d+\)\/\d+.*$|^.*H\(\d+-\d+\).*$|^.*H\/\d+.*$/}constructor(a,i){super(a,i),this.validate()}get values(){return super.values}get nthDay(){return this.options.nthDayOfWeek??0}};return Cm.CronDayOfWeek=o,Cm}var km={},GD;function Yge(){if(GD)return km;GD=1,Object.defineProperty(km,"__esModule",{value:!0}),km.CronHour=void 0;const e=Pd(),t=0,n=23,r=Object.freeze([]);let o=class extends e.CronField{static get min(){return t}static get max(){return n}static get chars(){return r}constructor(a,i){super(a,i),this.validate()}get values(){return super.values}};return km.CronHour=o,km}var Em={},KD;function Gge(){if(KD)return Em;KD=1,Object.defineProperty(Em,"__esModule",{value:!0}),Em.CronMinute=void 0;const e=Pd(),t=0,n=59,r=Object.freeze([]);let o=class extends e.CronField{static get min(){return t}static get max(){return n}static get chars(){return r}constructor(a,i){super(a,i),this.validate()}get values(){return super.values}};return Em.CronMinute=o,Em}var Rm={},QD={},Ia={},XD;function Kge(){if(XD)return Ia;XD=1,Object.defineProperty(Ia,"__esModule",{value:!0});class e extends Error{}class t extends e{constructor(O){super(`Invalid DateTime: ${O.toMessage()}`)}}class n extends e{constructor(O){super(`Invalid Interval: ${O.toMessage()}`)}}class r extends e{constructor(O){super(`Invalid Duration: ${O.toMessage()}`)}}class o extends e{}class a extends e{constructor(O){super(`Invalid unit ${O}`)}}class i extends e{}class l extends e{constructor(){super("Zone is an abstract class")}}const c="numeric",f="short",u="long",h={year:c,month:c,day:c},m={year:c,month:f,day:c},v={year:c,month:f,day:c,weekday:f},b={year:c,month:u,day:c},x={year:c,month:u,day:c,weekday:u},w={hour:c,minute:c},S={hour:c,minute:c,second:c},R={hour:c,minute:c,second:c,timeZoneName:f},E={hour:c,minute:c,second:c,timeZoneName:u},M={hour:c,minute:c,hourCycle:"h23"},$={hour:c,minute:c,second:c,hourCycle:"h23"},D={hour:c,minute:c,second:c,hourCycle:"h23",timeZoneName:f},F={hour:c,minute:c,second:c,hourCycle:"h23",timeZoneName:u},I={year:c,month:c,day:c,hour:c,minute:c},U={year:c,month:c,day:c,hour:c,minute:c,second:c},z={year:c,month:f,day:c,hour:c,minute:c},L={year:c,month:f,day:c,hour:c,minute:c,second:c},C={year:c,month:f,day:c,weekday:f,hour:c,minute:c},j={year:c,month:u,day:c,hour:c,minute:c,timeZoneName:f},N={year:c,month:u,day:c,hour:c,minute:c,second:c,timeZoneName:f},V={year:c,month:u,day:c,weekday:u,hour:c,minute:c,timeZoneName:u},A={year:c,month:u,day:c,weekday:u,hour:c,minute:c,second:c,timeZoneName:u};class Y{get type(){throw new l}get name(){throw new l}get ianaName(){return this.name}get isUniversal(){throw new l}offsetName(O,B){throw new l}formatOffset(O,B){throw new l}offset(O){throw new l}equals(O){throw new l}get isValid(){throw new l}}let W=null;class re extends Y{static get instance(){return W===null&&(W=new re),W}get type(){return"system"}get name(){return new Intl.DateTimeFormat().resolvedOptions().timeZone}get isUniversal(){return!1}offsetName(O,{format:B,locale:K}){return iu(O,B,K)}formatOffset(O,B){return Ps(this.offset(O),B)}offset(O){return-new Date(O).getTimezoneOffset()}equals(O){return O.type==="system"}get isValid(){return!0}}const Q=new Map;function oe(q){let O=Q.get(q);return O===void 0&&(O=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:q,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",era:"short"}),Q.set(q,O)),O}const ce={year:0,month:1,day:2,era:3,hour:4,minute:5,second:6};function Z(q,O){const B=q.format(O).replace(/\u200E/g,""),K=/(\d+)\/(\d+)\/(\d+) (AD|BC),? (\d+):(\d+):(\d+)/.exec(B),[,se,we,Ae,_e,We,Ot,vn]=K;return[Ae,se,we,_e,We,Ot,vn]}function ae(q,O){const B=q.formatToParts(O),K=[];for(let se=0;se<B.length;se++){const{type:we,value:Ae}=B[se],_e=ce[we];we==="era"?K[_e]=Ae:Be(_e)||(K[_e]=parseInt(Ae,10))}return K}const J=new Map;class ne extends Y{static create(O){let B=J.get(O);return B===void 0&&J.set(O,B=new ne(O)),B}static resetCache(){J.clear(),Q.clear()}static isValidSpecifier(O){return this.isValidZone(O)}static isValidZone(O){if(!O)return!1;try{return new Intl.DateTimeFormat("en-US",{timeZone:O}).format(),!0}catch{return!1}}constructor(O){super(),this.zoneName=O,this.valid=ne.isValidZone(O)}get type(){return"iana"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(O,{format:B,locale:K}){return iu(O,B,K,this.name)}formatOffset(O,B){return Ps(this.offset(O),B)}offset(O){if(!this.valid)return NaN;const B=new Date(O);if(isNaN(B))return NaN;const K=oe(this.name);let[se,we,Ae,_e,We,Ot,vn]=K.formatToParts?ae(K,B):Z(K,B);_e==="BC"&&(se=-Math.abs(se)+1);const Nn=Ka({year:se,month:we,day:Ae,hour:We===24?0:We,minute:Ot,second:vn,millisecond:0});let ur=+B;const Sn=ur%1e3;return ur-=Sn>=0?Sn:1e3+Sn,(Nn-ur)/(60*1e3)}equals(O){return O.type==="iana"&&O.name===this.name}get isValid(){return this.valid}}let ee={};function ue(q,O={}){const B=JSON.stringify([q,O]);let K=ee[B];return K||(K=new Intl.ListFormat(q,O),ee[B]=K),K}const pe=new Map;function ye(q,O={}){const B=JSON.stringify([q,O]);let K=pe.get(B);return K===void 0&&(K=new Intl.DateTimeFormat(q,O),pe.set(B,K)),K}const ie=new Map;function he(q,O={}){const B=JSON.stringify([q,O]);let K=ie.get(B);return K===void 0&&(K=new Intl.NumberFormat(q,O),ie.set(B,K)),K}const le=new Map;function be(q,O={}){const{base:B,...K}=O,se=JSON.stringify([q,K]);let we=le.get(se);return we===void 0&&(we=new Intl.RelativeTimeFormat(q,O),le.set(se,we)),we}let Ve=null;function Re(){return Ve||(Ve=new Intl.DateTimeFormat().resolvedOptions().locale,Ve)}const Oe=new Map;function de(q){let O=Oe.get(q);return O===void 0&&(O=new Intl.DateTimeFormat(q).resolvedOptions(),Oe.set(q,O)),O}const at=new Map;function Ne(q){let O=at.get(q);if(!O){const B=new Intl.Locale(q);O="getWeekInfo"in B?B.getWeekInfo():B.weekInfo,"minimalDays"in O||(O={...Ye,...O}),at.set(q,O)}return O}function Je(q){const O=q.indexOf("-x-");O!==-1&&(q=q.substring(0,O));const B=q.indexOf("-u-");if(B===-1)return[q];{let K,se;try{K=ye(q).resolvedOptions(),se=q}catch{const _e=q.substring(0,B);K=ye(_e).resolvedOptions(),se=_e}const{numberingSystem:we,calendar:Ae}=K;return[se,we,Ae]}}function tt(q,O,B){return(B||O)&&(q.includes("-u-")||(q+="-u"),B&&(q+=`-ca-${B}`),O&&(q+=`-nu-${O}`)),q}function qt(q){const O=[];for(let B=1;B<=12;B++){const K=yn.utc(2009,B,1);O.push(q(K))}return O}function Ft(q){const O=[];for(let B=1;B<=7;B++){const K=yn.utc(2016,11,13+B);O.push(q(K))}return O}function nt(q,O,B,K){const se=q.listingMode();return se==="error"?null:se==="en"?B(O):K(O)}function et(q){return q.numberingSystem&&q.numberingSystem!=="latn"?!1:q.numberingSystem==="latn"||!q.locale||q.locale.startsWith("en")||de(q.locale).numberingSystem==="latn"}class ut{constructor(O,B,K){this.padTo=K.padTo||0,this.floor=K.floor||!1;const{padTo:se,floor:we,...Ae}=K;if(!B||Object.keys(Ae).length>0){const _e={useGrouping:!1,...K};K.padTo>0&&(_e.minimumIntegerDigits=K.padTo),this.inf=he(O,_e)}}format(O){if(this.inf){const B=this.floor?Math.floor(O):O;return this.inf.format(B)}else{const B=this.floor?Math.floor(O):ls(O,3);return Xt(B,this.padTo)}}}class Le{constructor(O,B,K){this.opts=K,this.originalZone=void 0;let se;if(this.opts.timeZone)this.dt=O;else if(O.zone.type==="fixed"){const Ae=-1*(O.offset/60),_e=Ae>=0?`Etc/GMT+${Ae}`:`Etc/GMT${Ae}`;O.offset!==0&&ne.create(_e).valid?(se=_e,this.dt=O):(se="UTC",this.dt=O.offset===0?O:O.setZone("UTC").plus({minutes:O.offset}),this.originalZone=O.zone)}else O.zone.type==="system"?this.dt=O:O.zone.type==="iana"?(this.dt=O,se=O.zone.name):(se="UTC",this.dt=O.setZone("UTC").plus({minutes:O.offset}),this.originalZone=O.zone);const we={...this.opts};we.timeZone=we.timeZone||se,this.dtf=ye(B,we)}format(){return this.originalZone?this.formatToParts().map(({value:O})=>O).join(""):this.dtf.format(this.dt.toJSDate())}formatToParts(){const O=this.dtf.formatToParts(this.dt.toJSDate());return this.originalZone?O.map(B=>{if(B.type==="timeZoneName"){const K=this.originalZone.offsetName(this.dt.ts,{locale:this.dt.locale,format:this.opts.timeZoneName});return{...B,value:K}}else return B}):O}resolvedOptions(){return this.dtf.resolvedOptions()}}class ve{constructor(O,B,K){this.opts={style:"long",...K},!B&&Me()&&(this.rtf=be(O,K))}format(O,B){return this.rtf?this.rtf.format(O,B):oc(B,O,this.opts.numeric,this.opts.style!=="long")}formatToParts(O,B){return this.rtf?this.rtf.formatToParts(O,B):[]}}const Ye={firstDay:1,minimalDays:4,weekend:[6,7]};class je{static fromOpts(O){return je.create(O.locale,O.numberingSystem,O.outputCalendar,O.weekSettings,O.defaultToEN)}static create(O,B,K,se,we=!1){const Ae=O||rn.defaultLocale,_e=Ae||(we?"en-US":Re()),We=B||rn.defaultNumberingSystem,Ot=K||rn.defaultOutputCalendar,vn=Zt(se)||rn.defaultWeekSettings;return new je(_e,We,Ot,vn,Ae)}static resetCache(){Ve=null,pe.clear(),ie.clear(),le.clear(),Oe.clear(),at.clear()}static fromObject({locale:O,numberingSystem:B,outputCalendar:K,weekSettings:se}={}){return je.create(O,B,K,se)}constructor(O,B,K,se,we){const[Ae,_e,We]=Je(O);this.locale=Ae,this.numberingSystem=B||_e||null,this.outputCalendar=K||We||null,this.weekSettings=se,this.intl=tt(this.locale,this.numberingSystem,this.outputCalendar),this.weekdaysCache={format:{},standalone:{}},this.monthsCache={format:{},standalone:{}},this.meridiemCache=null,this.eraCache={},this.specifiedLocale=we,this.fastNumbersCached=null}get fastNumbers(){return this.fastNumbersCached==null&&(this.fastNumbersCached=et(this)),this.fastNumbersCached}listingMode(){const O=this.isEnglish(),B=(this.numberingSystem===null||this.numberingSystem==="latn")&&(this.outputCalendar===null||this.outputCalendar==="gregory");return O&&B?"en":"intl"}clone(O){return!O||Object.getOwnPropertyNames(O).length===0?this:je.create(O.locale||this.specifiedLocale,O.numberingSystem||this.numberingSystem,O.outputCalendar||this.outputCalendar,Zt(O.weekSettings)||this.weekSettings,O.defaultToEN||!1)}redefaultToEN(O={}){return this.clone({...O,defaultToEN:!0})}redefaultToSystem(O={}){return this.clone({...O,defaultToEN:!1})}months(O,B=!1){return nt(this,O,yl,()=>{const K=this.intl==="ja"||this.intl.startsWith("ja-");B&=!K;const se=B?{month:O,day:"numeric"}:{month:O},we=B?"format":"standalone";if(!this.monthsCache[we][O]){const Ae=K?_e=>this.dtFormatter(_e,se).format():_e=>this.extract(_e,se,"month");this.monthsCache[we][O]=qt(Ae)}return this.monthsCache[we][O]})}weekdays(O,B=!1){return nt(this,O,ds,()=>{const K=B?{weekday:O,year:"numeric",month:"long",day:"numeric"}:{weekday:O},se=B?"format":"standalone";return this.weekdaysCache[se][O]||(this.weekdaysCache[se][O]=Ft(we=>this.extract(we,K,"weekday"))),this.weekdaysCache[se][O]})}meridiems(){return nt(this,void 0,()=>lu,()=>{if(!this.meridiemCache){const O={hour:"numeric",hourCycle:"h12"};this.meridiemCache=[yn.utc(2016,11,13,9),yn.utc(2016,11,13,19)].map(B=>this.extract(B,O,"dayperiod"))}return this.meridiemCache})}eras(O){return nt(this,O,Ma,()=>{const B={era:O};return this.eraCache[O]||(this.eraCache[O]=[yn.utc(-40,1,1),yn.utc(2017,1,1)].map(K=>this.extract(K,B,"era"))),this.eraCache[O]})}extract(O,B,K){const se=this.dtFormatter(O,B),we=se.formatToParts(),Ae=we.find(_e=>_e.type.toLowerCase()===K);return Ae?Ae.value:null}numberFormatter(O={}){return new ut(this.intl,O.forceSimple||this.fastNumbers,O)}dtFormatter(O,B={}){return new Le(O,this.intl,B)}relFormatter(O={}){return new ve(this.intl,this.isEnglish(),O)}listFormatter(O={}){return ue(this.intl,O)}isEnglish(){return this.locale==="en"||this.locale.toLowerCase()==="en-us"||de(this.intl).locale.startsWith("en-us")}getWeekSettings(){return this.weekSettings?this.weekSettings:lt()?Ne(this.locale):Ye}getStartOfWeek(){return this.getWeekSettings().firstDay}getMinDaysInFirstWeek(){return this.getWeekSettings().minimalDays}getWeekendDays(){return this.getWeekSettings().weekend}equals(O){return this.locale===O.locale&&this.numberingSystem===O.numberingSystem&&this.outputCalendar===O.outputCalendar}toString(){return`Locale(${this.locale}, ${this.numberingSystem}, ${this.outputCalendar})`}}let wt=null;class Ct extends Y{static get utcInstance(){return wt===null&&(wt=new Ct(0)),wt}static instance(O){return O===0?Ct.utcInstance:new Ct(O)}static parseSpecifier(O){if(O){const B=O.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);if(B)return new Ct(ml(B[1],B[2]))}return null}constructor(O){super(),this.fixed=O}get type(){return"fixed"}get name(){return this.fixed===0?"UTC":`UTC${Ps(this.fixed,"narrow")}`}get ianaName(){return this.fixed===0?"Etc/UTC":`Etc/GMT${Ps(-this.fixed,"narrow")}`}offsetName(){return this.name}formatOffset(O,B){return Ps(this.fixed,B)}get isUniversal(){return!0}offset(){return this.fixed}equals(O){return O.type==="fixed"&&O.fixed===this.fixed}get isValid(){return!0}}class yt extends Y{constructor(O){super(),this.zoneName=O}get type(){return"invalid"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(){return null}formatOffset(){return""}offset(){return NaN}equals(){return!1}get isValid(){return!1}}function ct(q,O){if(Be(q)||q===null)return O;if(q instanceof Y)return q;if(nn(q)){const B=q.toLowerCase();return B==="default"?O:B==="local"||B==="system"?re.instance:B==="utc"||B==="gmt"?Ct.utcInstance:Ct.parseSpecifier(B)||ne.create(q)}else return Mt(q)?Ct.instance(q):typeof q=="object"&&"offset"in q&&typeof q.offset=="function"?q:new yt(q)}const jt={arab:"[٠-٩]",arabext:"[۰-۹]",bali:"[᭐-᭙]",beng:"[০-৯]",deva:"[०-९]",fullwide:"[0-9]",gujr:"[૦-૯]",hanidec:"[〇|一|二|三|四|五|六|七|八|九]",khmr:"[០-៩]",knda:"[೦-೯]",laoo:"[໐-໙]",limb:"[᥆-᥏]",mlym:"[൦-൯]",mong:"[᠐-᠙]",mymr:"[၀-၉]",orya:"[୦-୯]",tamldec:"[௦-௯]",telu:"[౦-౯]",thai:"[๐-๙]",tibt:"[༠-༩]",latn:"\\d"},Wt={arab:[1632,1641],arabext:[1776,1785],bali:[6992,7001],beng:[2534,2543],deva:[2406,2415],fullwide:[65296,65303],gujr:[2790,2799],khmr:[6112,6121],knda:[3302,3311],laoo:[3792,3801],limb:[6470,6479],mlym:[3430,3439],mong:[6160,6169],mymr:[4160,4169],orya:[2918,2927],tamldec:[3046,3055],telu:[3174,3183],thai:[3664,3673],tibt:[3872,3881]},fn=jt.hanidec.replace(/[\[|\]]/g,"").split("");function $n(q){let O=parseInt(q,10);if(isNaN(O)){O="";for(let B=0;B<q.length;B++){const K=q.charCodeAt(B);if(q[B].search(jt.hanidec)!==-1)O+=fn.indexOf(q[B]);else for(const se in Wt){const[we,Ae]=Wt[se];K>=we&&K<=Ae&&(O+=K-we)}}return parseInt(O,10)}else return O}const _n=new Map;function Bn(){_n.clear()}function Jt({numberingSystem:q},O=""){const B=q||"latn";let K=_n.get(B);K===void 0&&(K=new Map,_n.set(B,K));let se=K.get(O);return se===void 0&&(se=new RegExp(`${jt[B]}${O}`),K.set(O,se)),se}let Dn=()=>Date.now(),ke="system",Vn=null,Tn=null,en=null,$t=60,zr,Fn=null;class rn{static get now(){return Dn}static set now(O){Dn=O}static set defaultZone(O){ke=O}static get defaultZone(){return ct(ke,re.instance)}static get defaultLocale(){return Vn}static set defaultLocale(O){Vn=O}static get defaultNumberingSystem(){return Tn}static set defaultNumberingSystem(O){Tn=O}static get defaultOutputCalendar(){return en}static set defaultOutputCalendar(O){en=O}static get defaultWeekSettings(){return Fn}static set defaultWeekSettings(O){Fn=Zt(O)}static get twoDigitCutoffYear(){return $t}static set twoDigitCutoffYear(O){$t=O%100}static get throwOnInvalid(){return zr}static set throwOnInvalid(O){zr=O}static resetCaches(){je.resetCache(),ne.resetCache(),yn.resetCache(),Bn()}}class Ln{constructor(O,B){this.reason=O,this.explanation=B}toMessage(){return this.explanation?`${this.reason}: ${this.explanation}`:this.reason}}const xe=[0,31,59,90,120,151,181,212,243,273,304,334],Te=[0,31,60,91,121,152,182,213,244,274,305,335];function ze(q,O){return new Ln("unit out of range",`you specified ${O} (of type ${typeof O}) as a ${q}, which is invalid`)}function He(q,O,B){const K=new Date(Date.UTC(q,O-1,B));q<100&&q>=0&&K.setUTCFullYear(K.getUTCFullYear()-1900);const se=K.getUTCDay();return se===0?7:se}function rt(q,O,B){return B+(ra(q)?Te:xe)[O-1]}function kt(q,O){const B=ra(q)?Te:xe,K=B.findIndex(we=>we<O),se=O-B[K];return{month:K+1,day:se}}function bt(q,O){return(q-O+7)%7+1}function Et(q,O=4,B=1){const{year:K,month:se,day:we}=q,Ae=rt(K,se,we),_e=bt(He(K,se,we),B);let We=Math.floor((Ae-_e+14-O)/7),Ot;return We<1?(Ot=K-1,We=cs(Ot,O,B)):We>cs(K,O,B)?(Ot=K+1,We=1):Ot=K,{weekYear:Ot,weekNumber:We,weekday:_e,...gl(q)}}function Pt(q,O=4,B=1){const{weekYear:K,weekNumber:se,weekday:we}=q,Ae=bt(He(K,1,O),B),_e=cr(K);let We=se*7+we-Ae-7+O,Ot;We<1?(Ot=K-1,We+=cr(Ot)):We>_e?(Ot=K+1,We-=cr(K)):Ot=K;const{month:vn,day:Nn}=kt(Ot,We);return{year:Ot,month:vn,day:Nn,...gl(q)}}function Kt(q){const{year:O,month:B,day:K}=q,se=rt(O,B,K);return{year:O,ordinal:se,...gl(q)}}function At(q){const{year:O,ordinal:B}=q,{month:K,day:se}=kt(O,B);return{year:O,month:K,day:se,...gl(q)}}function _t(q,O){if(!Be(q.localWeekday)||!Be(q.localWeekNumber)||!Be(q.localWeekYear)){if(!Be(q.weekday)||!Be(q.weekNumber)||!Be(q.weekYear))throw new o("Cannot mix locale-based week fields with ISO-based week fields");return Be(q.localWeekday)||(q.weekday=q.localWeekday),Be(q.localWeekNumber)||(q.weekNumber=q.localWeekNumber),Be(q.localWeekYear)||(q.weekYear=q.localWeekYear),delete q.localWeekday,delete q.localWeekNumber,delete q.localWeekYear,{minDaysInFirstWeek:O.getMinDaysInFirstWeek(),startOfWeek:O.getStartOfWeek()}}else return{minDaysInFirstWeek:4,startOfWeek:1}}function me(q,O=4,B=1){const K=Yt(q.weekYear),se=bn(q.weekNumber,1,cs(q.weekYear,O,B)),we=bn(q.weekday,1,7);return K?se?we?!1:ze("weekday",q.weekday):ze("week",q.weekNumber):ze("weekYear",q.weekYear)}function ge(q){const O=Yt(q.year),B=bn(q.ordinal,1,cr(q.year));return O?B?!1:ze("ordinal",q.ordinal):ze("year",q.year)}function Fe(q){const O=Yt(q.year),B=bn(q.month,1,12),K=bn(q.day,1,Fr(q.year,q.month));return O?B?K?!1:ze("day",q.day):ze("month",q.month):ze("year",q.year)}function pt(q){const{hour:O,minute:B,second:K,millisecond:se}=q,we=bn(O,0,23)||O===24&&B===0&&K===0&&se===0,Ae=bn(B,0,59),_e=bn(K,0,59),We=bn(se,0,999);return we?Ae?_e?We?!1:ze("millisecond",se):ze("second",K):ze("minute",B):ze("hour",O)}function Be(q){return typeof q>"u"}function Mt(q){return typeof q=="number"}function Yt(q){return typeof q=="number"&&q%1===0}function nn(q){return typeof q=="string"}function Se(q){return Object.prototype.toString.call(q)==="[object Date]"}function Me(){try{return typeof Intl<"u"&&!!Intl.RelativeTimeFormat}catch{return!1}}function lt(){try{return typeof Intl<"u"&&!!Intl.Locale&&("weekInfo"in Intl.Locale.prototype||"getWeekInfo"in Intl.Locale.prototype)}catch{return!1}}function xt(q){return Array.isArray(q)?q:[q]}function Rt(q,O,B){if(q.length!==0)return q.reduce((K,se)=>{const we=[O(se),se];return K&&B(K[0],we[0])===K[0]?K:we},null)[1]}function Tt(q,O){return O.reduce((B,K)=>(B[K]=q[K],B),{})}function Dt(q,O){return Object.prototype.hasOwnProperty.call(q,O)}function Zt(q){if(q==null)return null;if(typeof q!="object")throw new i("Week settings must be an object");if(!bn(q.firstDay,1,7)||!bn(q.minimalDays,1,7)||!Array.isArray(q.weekend)||q.weekend.some(O=>!bn(O,1,7)))throw new i("Invalid week settings");return{firstDay:q.firstDay,minimalDays:q.minimalDays,weekend:Array.from(q.weekend)}}function bn(q,O,B){return Yt(q)&&q>=O&&q<=B}function nr(q,O){return q-O*Math.floor(q/O)}function Xt(q,O=2){const B=q<0;let K;return B?K="-"+(""+-q).padStart(O,"0"):K=(""+q).padStart(O,"0"),K}function Ar(q){if(!(Be(q)||q===null||q===""))return parseInt(q,10)}function io(q){if(!(Be(q)||q===null||q===""))return parseFloat(q)}function Ro(q){if(!(Be(q)||q===null||q==="")){const O=parseFloat("0."+q)*1e3;return Math.floor(O)}}function ls(q,O,B="round"){const K=10**O;switch(B){case"expand":return q>0?Math.ceil(q*K)/K:Math.floor(q*K)/K;case"trunc":return Math.trunc(q*K)/K;case"round":return Math.round(q*K)/K;case"floor":return Math.floor(q*K)/K;case"ceil":return Math.ceil(q*K)/K;default:throw new RangeError(`Value rounding ${B} is out of range`)}}function ra(q){return q%4===0&&(q%100!==0||q%400===0)}function cr(q){return ra(q)?366:365}function Fr(q,O){const B=nr(O-1,12)+1,K=q+(O-B)/12;return B===2?ra(K)?29:28:[31,null,31,30,31,30,31,31,30,31,30,31][B-1]}function Ka(q){let O=Date.UTC(q.year,q.month-1,q.day,q.hour,q.minute,q.second,q.millisecond);return q.year<100&&q.year>=0&&(O=new Date(O),O.setUTCFullYear(q.year,q.month-1,q.day)),+O}function hl(q,O,B){return-bt(He(q,1,O),B)+O-1}function cs(q,O=4,B=1){const K=hl(q,O,B),se=hl(q+1,O,B);return(cr(q)-K+se)/7}function Ei(q){return q>99?q:q>rn.twoDigitCutoffYear?1900+q:2e3+q}function iu(q,O,B,K=null){const se=new Date(q),we={hourCycle:"h23",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"};K&&(we.timeZone=K);const Ae={timeZoneName:O,...we},_e=new Intl.DateTimeFormat(B,Ae).formatToParts(se).find(We=>We.type.toLowerCase()==="timezonename");return _e?_e.value:null}function ml(q,O){let B=parseInt(q,10);Number.isNaN(B)&&(B=0);const K=parseInt(O,10)||0,se=B<0||Object.is(B,-0)?-K:K;return B*60+se}function us(q){const O=Number(q);if(typeof q=="boolean"||q===""||!Number.isFinite(O))throw new i(`Invalid unit value ${q}`);return O}function tc(q,O){const B={};for(const K in q)if(Dt(q,K)){const se=q[K];if(se==null)continue;B[O(K)]=us(se)}return B}function Ps(q,O){const B=Math.trunc(Math.abs(q/60)),K=Math.trunc(Math.abs(q%60)),se=q>=0?"+":"-";switch(O){case"short":return`${se}${Xt(B,2)}:${Xt(K,2)}`;case"narrow":return`${se}${B}${K>0?`:${K}`:""}`;case"techie":return`${se}${Xt(B,2)}${Xt(K,2)}`;default:throw new RangeError(`Value format ${O} is out of range for property format`)}}function gl(q){return Tt(q,["hour","minute","second","millisecond"])}const su=["January","February","March","April","May","June","July","August","September","October","November","December"],Ad=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],Fp=["J","F","M","A","M","J","J","A","S","O","N","D"];function yl(q){switch(q){case"narrow":return[...Fp];case"short":return[...Ad];case"long":return[...su];case"numeric":return["1","2","3","4","5","6","7","8","9","10","11","12"];case"2-digit":return["01","02","03","04","05","06","07","08","09","10","11","12"];default:return null}}const nc=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],rc=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],As=["M","T","W","T","F","S","S"];function ds(q){switch(q){case"narrow":return[...As];case"short":return[...rc];case"long":return[...nc];case"numeric":return["1","2","3","4","5","6","7"];default:return null}}const lu=["AM","PM"],cu=["Before Christ","Anno Domini"],Dd=["BC","AD"],vl=["B","A"];function Ma(q){switch(q){case"narrow":return[...vl];case"short":return[...Dd];case"long":return[...cu];default:return null}}function uu(q){return lu[q.hour<12?0:1]}function bl(q,O){return ds(O)[q.weekday-1]}function Ri(q,O){return yl(O)[q.month-1]}function du(q,O){return Ma(O)[q.year<0?0:1]}function oc(q,O,B="always",K=!1){const se={years:["year","yr."],quarters:["quarter","qtr."],months:["month","mo."],weeks:["week","wk."],days:["day","day","days"],hours:["hour","hr."],minutes:["minute","min."],seconds:["second","sec."]},we=["hours","minutes","seconds"].indexOf(q)===-1;if(B==="auto"&&we){const Nn=q==="days";switch(O){case 1:return Nn?"tomorrow":`next ${se[q][0]}`;case-1:return Nn?"yesterday":`last ${se[q][0]}`;case 0:return Nn?"today":`this ${se[q][0]}`}}const Ae=Object.is(O,-0)||O<0,_e=Math.abs(O),We=_e===1,Ot=se[q],vn=K?We?Ot[1]:Ot[2]||Ot[1]:We?se[q][0]:q;return Ae?`${_e} ${vn} ago`:`in ${_e} ${vn}`}function fu(q,O){let B="";for(const K of q)K.literal?B+=K.val:B+=O(K.val);return B}const ac={D:h,DD:m,DDD:b,DDDD:x,t:w,tt:S,ttt:R,tttt:E,T:M,TT:$,TTT:D,TTTT:F,f:I,ff:z,fff:j,ffff:V,F:U,FF:L,FFF:N,FFFF:A};class to{static create(O,B={}){return new to(O,B)}static parseFormat(O){let B=null,K="",se=!1;const we=[];for(let Ae=0;Ae<O.length;Ae++){const _e=O.charAt(Ae);_e==="'"?((K.length>0||se)&&we.push({literal:se||/^\s+$/.test(K),val:K===""?"'":K}),B=null,K="",se=!se):se||_e===B?K+=_e:(K.length>0&&we.push({literal:/^\s+$/.test(K),val:K}),K=_e,B=_e)}return K.length>0&&we.push({literal:se||/^\s+$/.test(K),val:K}),we}static macroTokenToFormatOpts(O){return ac[O]}constructor(O,B){this.opts=B,this.loc=O,this.systemLoc=null}formatWithSystemDefault(O,B){return this.systemLoc===null&&(this.systemLoc=this.loc.redefaultToSystem()),this.systemLoc.dtFormatter(O,{...this.opts,...B}).format()}dtFormatter(O,B={}){return this.loc.dtFormatter(O,{...this.opts,...B})}formatDateTime(O,B){return this.dtFormatter(O,B).format()}formatDateTimeParts(O,B){return this.dtFormatter(O,B).formatToParts()}formatInterval(O,B){return this.dtFormatter(O.start,B).dtf.formatRange(O.start.toJSDate(),O.end.toJSDate())}resolvedOptions(O,B){return this.dtFormatter(O,B).resolvedOptions()}num(O,B=0,K=void 0){if(this.opts.forceSimple)return Xt(O,B);const se={...this.opts};return B>0&&(se.padTo=B),K&&(se.signDisplay=K),this.loc.numberFormatter(se).format(O)}formatDateTimeFromString(O,B){const K=this.loc.listingMode()==="en",se=this.loc.outputCalendar&&this.loc.outputCalendar!=="gregory",we=(Sn,Kr)=>this.loc.extract(O,Sn,Kr),Ae=Sn=>O.isOffsetFixed&&O.offset===0&&Sn.allowZ?"Z":O.isValid?O.zone.formatOffset(O.ts,Sn.format):"",_e=()=>K?uu(O):we({hour:"numeric",hourCycle:"h12"},"dayperiod"),We=(Sn,Kr)=>K?Ri(O,Sn):we(Kr?{month:Sn}:{month:Sn,day:"numeric"},"month"),Ot=(Sn,Kr)=>K?bl(O,Sn):we(Kr?{weekday:Sn}:{weekday:Sn,month:"long",day:"numeric"},"weekday"),vn=Sn=>{const Kr=to.macroTokenToFormatOpts(Sn);return Kr?this.formatWithSystemDefault(O,Kr):Sn},Nn=Sn=>K?du(O,Sn):we({era:Sn},"era"),ur=Sn=>{switch(Sn){case"S":return this.num(O.millisecond);case"u":case"SSS":return this.num(O.millisecond,3);case"s":return this.num(O.second);case"ss":return this.num(O.second,2);case"uu":return this.num(Math.floor(O.millisecond/10),2);case"uuu":return this.num(Math.floor(O.millisecond/100));case"m":return this.num(O.minute);case"mm":return this.num(O.minute,2);case"h":return this.num(O.hour%12===0?12:O.hour%12);case"hh":return this.num(O.hour%12===0?12:O.hour%12,2);case"H":return this.num(O.hour);case"HH":return this.num(O.hour,2);case"Z":return Ae({format:"narrow",allowZ:this.opts.allowZ});case"ZZ":return Ae({format:"short",allowZ:this.opts.allowZ});case"ZZZ":return Ae({format:"techie",allowZ:this.opts.allowZ});case"ZZZZ":return O.zone.offsetName(O.ts,{format:"short",locale:this.loc.locale});case"ZZZZZ":return O.zone.offsetName(O.ts,{format:"long",locale:this.loc.locale});case"z":return O.zoneName;case"a":return _e();case"d":return se?we({day:"numeric"},"day"):this.num(O.day);case"dd":return se?we({day:"2-digit"},"day"):this.num(O.day,2);case"c":return this.num(O.weekday);case"ccc":return Ot("short",!0);case"cccc":return Ot("long",!0);case"ccccc":return Ot("narrow",!0);case"E":return this.num(O.weekday);case"EEE":return Ot("short",!1);case"EEEE":return Ot("long",!1);case"EEEEE":return Ot("narrow",!1);case"L":return se?we({month:"numeric",day:"numeric"},"month"):this.num(O.month);case"LL":return se?we({month:"2-digit",day:"numeric"},"month"):this.num(O.month,2);case"LLL":return We("short",!0);case"LLLL":return We("long",!0);case"LLLLL":return We("narrow",!0);case"M":return se?we({month:"numeric"},"month"):this.num(O.month);case"MM":return se?we({month:"2-digit"},"month"):this.num(O.month,2);case"MMM":return We("short",!1);case"MMMM":return We("long",!1);case"MMMMM":return We("narrow",!1);case"y":return se?we({year:"numeric"},"year"):this.num(O.year);case"yy":return se?we({year:"2-digit"},"year"):this.num(O.year.toString().slice(-2),2);case"yyyy":return se?we({year:"numeric"},"year"):this.num(O.year,4);case"yyyyyy":return se?we({year:"numeric"},"year"):this.num(O.year,6);case"G":return Nn("short");case"GG":return Nn("long");case"GGGGG":return Nn("narrow");case"kk":return this.num(O.weekYear.toString().slice(-2),2);case"kkkk":return this.num(O.weekYear,4);case"W":return this.num(O.weekNumber);case"WW":return this.num(O.weekNumber,2);case"n":return this.num(O.localWeekNumber);case"nn":return this.num(O.localWeekNumber,2);case"ii":return this.num(O.localWeekYear.toString().slice(-2),2);case"iiii":return this.num(O.localWeekYear,4);case"o":return this.num(O.ordinal);case"ooo":return this.num(O.ordinal,3);case"q":return this.num(O.quarter);case"qq":return this.num(O.quarter,2);case"X":return this.num(Math.floor(O.ts/1e3));case"x":return this.num(O.ts);default:return vn(Sn)}};return fu(to.parseFormat(B),ur)}formatDurationFromString(O,B){const K=this.opts.signMode==="negativeLargestOnly"?-1:1,se=vn=>{switch(vn[0]){case"S":return"milliseconds";case"s":return"seconds";case"m":return"minutes";case"h":return"hours";case"d":return"days";case"w":return"weeks";case"M":return"months";case"y":return"years";default:return null}},we=(vn,Nn)=>ur=>{const Sn=se(ur);if(Sn){const Kr=Nn.isNegativeDuration&&Sn!==Nn.largestUnit?K:1;let _o;return this.opts.signMode==="negativeLargestOnly"&&Sn!==Nn.largestUnit?_o="never":this.opts.signMode==="all"?_o="always":_o="auto",this.num(vn.get(Sn)*Kr,ur.length,_o)}else return ur},Ae=to.parseFormat(B),_e=Ae.reduce((vn,{literal:Nn,val:ur})=>Nn?vn:vn.concat(ur),[]),We=O.shiftTo(..._e.map(se).filter(vn=>vn)),Ot={isNegativeDuration:We<0,largestUnit:Object.keys(We.values)[0]};return fu(Ae,we(We,Ot))}}const pu=/[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/;function _(...q){const O=q.reduce((B,K)=>B+K.source,"");return RegExp(`^${O}$`)}function bo(...q){return O=>q.reduce(([B,K,se],we)=>{const[Ae,_e,We]=we(O,se);return[{...B,...Ae},_e||K,We]},[{},null,1]).slice(0,2)}function no(q,...O){if(q==null)return[null,null];for(const[B,K]of O){const se=B.exec(q);if(se)return K(se)}return[null,null]}function Qa(...q){return(O,B)=>{const K={};let se;for(se=0;se<q.length;se++)K[q[se]]=Ar(O[B+se]);return[K,null,B+se]}}const $e=/(?:([Zz])|([+-]\d\d)(?::?(\d\d))?)/,fs=`(?:${$e.source}?(?:\\[(${pu.source})\\])?)?`,jn=/(\d\d)(?::?(\d\d)(?::?(\d\d)(?:[.,](\d{1,30}))?)?)?/,Fo=RegExp(`${jn.source}${fs}`),Ds=RegExp(`(?:[Tt]${Fo.source})?`),hu=/([+-]\d{6}|\d{4})(?:-?(\d\d)(?:-?(\d\d))?)?/,jd=/(\d{4})-?W(\d\d)(?:-?(\d))?/,Nd=/(\d{4})-?(\d{3})/,Ze=Qa("weekYear","weekNumber","weekDay"),mu=Qa("year","ordinal"),gu=/(\d{4})-(\d\d)-(\d\d)/,ic=RegExp(`${jn.source} ?(?:${$e.source}|(${pu.source}))?`),Id=RegExp(`(?: ${ic.source})?`);function js(q,O,B){const K=q[O];return Be(K)?B:Ar(K)}function xl(q,O){return[{year:js(q,O),month:js(q,O+1,1),day:js(q,O+2,1)},null,O+3]}function ps(q,O){return[{hours:js(q,O,0),minutes:js(q,O+1,0),seconds:js(q,O+2,0),milliseconds:Ro(q[O+3])},null,O+4]}function Ns(q,O){const B=!q[O]&&!q[O+1],K=ml(q[O+1],q[O+2]),se=B?null:Ct.instance(K);return[{},se,O+3]}function oa(q,O){const B=q[O]?ne.create(q[O]):null;return[{},B,O+1]}const _p=RegExp(`^T?${jn.source}$`),Up=/^-?P(?:(?:(-?\d{1,20}(?:\.\d{1,20})?)Y)?(?:(-?\d{1,20}(?:\.\d{1,20})?)M)?(?:(-?\d{1,20}(?:\.\d{1,20})?)W)?(?:(-?\d{1,20}(?:\.\d{1,20})?)D)?(?:T(?:(-?\d{1,20}(?:\.\d{1,20})?)H)?(?:(-?\d{1,20}(?:\.\d{1,20})?)M)?(?:(-?\d{1,20})(?:[.,](-?\d{1,20}))?S)?)?)$/;function Sl(q){const[O,B,K,se,we,Ae,_e,We,Ot]=q,vn=O[0]==="-",Nn=We&&We[0]==="-",ur=(Sn,Kr=!1)=>Sn!==void 0&&(Kr||Sn&&vn)?-Sn:Sn;return[{years:ur(io(B)),months:ur(io(K)),weeks:ur(io(se)),days:ur(io(we)),hours:ur(io(Ae)),minutes:ur(io(_e)),seconds:ur(io(We),We==="-0"),milliseconds:ur(Ro(Ot),Nn)}]}const Ld={GMT:0,EDT:-240,EST:-300,CDT:-300,CST:-360,MDT:-360,MST:-420,PDT:-420,PST:-480};function yu(q,O,B,K,se,we,Ae){const _e={year:O.length===2?Ei(Ar(O)):Ar(O),month:Ad.indexOf(B)+1,day:Ar(K),hour:Ar(se),minute:Ar(we)};return Ae&&(_e.second=Ar(Ae)),q&&(_e.weekday=q.length>3?nc.indexOf(q)+1:rc.indexOf(q)+1),_e}const Bp=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|(?:([+-]\d\d)(\d\d)))$/;function zd(q){const[,O,B,K,se,we,Ae,_e,We,Ot,vn,Nn]=q,ur=yu(O,se,K,B,we,Ae,_e);let Sn;return We?Sn=Ld[We]:Ot?Sn=0:Sn=ml(vn,Nn),[ur,new Ct(Sn)]}function Vp(q){return q.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").trim()}const Fd=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\d\d) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{4}) (\d\d):(\d\d):(\d\d) GMT$/,vu=/^(Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (\d\d)-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\d\d) (\d\d):(\d\d):(\d\d) GMT$/,Hp=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( \d|\d\d) (\d\d):(\d\d):(\d\d) (\d{4})$/;function sc(q){const[,O,B,K,se,we,Ae,_e]=q;return[yu(O,se,K,B,we,Ae,_e),Ct.utcInstance]}function qp(q){const[,O,B,K,se,we,Ae,_e]=q;return[yu(O,_e,B,K,se,we,Ae),Ct.utcInstance]}const Wp=_(hu,Ds),Yp=_(jd,Ds),Gp=_(Nd,Ds),bu=_(Fo),Is=bo(xl,ps,Ns,oa),Kp=bo(Ze,ps,Ns,oa),_d=bo(mu,ps,Ns,oa),Ud=bo(ps,Ns,oa);function Bd(q){return no(q,[Wp,Is],[Yp,Kp],[Gp,_d],[bu,Ud])}function Vd(q){return no(Vp(q),[Bp,zd])}function Hd(q){return no(q,[Fd,sc],[vu,sc],[Hp,qp])}function Ls(q){return no(q,[Up,Sl])}const Qp=bo(ps);function Xp(q){return no(q,[_p,Qp])}const Zp=_(gu,Id),qd=_(ic),Wd=bo(ps,Ns,oa);function wl(q){return no(q,[Zp,Is],[qd,Wd])}const rr="Invalid Duration",hs={weeks:{days:7,hours:168,minutes:10080,seconds:10080*60,milliseconds:10080*60*1e3},days:{hours:24,minutes:1440,seconds:1440*60,milliseconds:1440*60*1e3},hours:{minutes:60,seconds:3600,milliseconds:3600*1e3},minutes:{seconds:60,milliseconds:60*1e3},seconds:{milliseconds:1e3}},Gr={years:{quarters:4,months:12,weeks:52,days:365,hours:365*24,minutes:365*24*60,seconds:365*24*60*60,milliseconds:365*24*60*60*1e3},quarters:{months:3,weeks:13,days:91,hours:2184,minutes:2184*60,seconds:2184*60*60,milliseconds:2184*60*60*1e3},months:{weeks:4,days:30,hours:720,minutes:720*60,seconds:720*60*60,milliseconds:720*60*60*1e3},...hs},H=146097/400,X=146097/4800,G={years:{quarters:4,months:12,weeks:H/7,days:H,hours:H*24,minutes:H*24*60,seconds:H*24*60*60,milliseconds:H*24*60*60*1e3},quarters:{months:3,weeks:H/28,days:H/4,hours:H*24/4,minutes:H*24*60/4,seconds:H*24*60*60/4,milliseconds:H*24*60*60*1e3/4},months:{weeks:X/7,days:X,hours:X*24,minutes:X*24*60,seconds:X*24*60*60,milliseconds:X*24*60*60*1e3},...hs},Ee=["years","quarters","months","weeks","days","hours","minutes","seconds","milliseconds"],Qt=Ee.slice(0).reverse();function Ht(q,O,B=!1){const K={values:B?O.values:{...q.values,...O.values||{}},loc:q.loc.clone(O.loc),conversionAccuracy:O.conversionAccuracy||q.conversionAccuracy,matrix:O.matrix||q.matrix};return new Gt(K)}function On(q,O){var B;let K=(B=O.milliseconds)!=null?B:0;for(const se of Qt.slice(1))O[se]&&(K+=O[se]*q[se].milliseconds);return K}function Yn(q,O){const B=On(q,O)<0?-1:1;Ee.reduceRight((K,se)=>{if(Be(O[se]))return K;if(K){const we=O[K]*B,Ae=q[se][K],_e=Math.floor(we/Ae);O[se]+=_e*B,O[K]-=_e*Ae*B}return se},null),Ee.reduce((K,se)=>{if(Be(O[se]))return K;if(K){const we=O[K]%1;O[K]-=we,O[se]+=we*q[K][se]}return se},null)}function Gn(q){const O={};for(const[B,K]of Object.entries(q))K!==0&&(O[B]=K);return O}class Gt{constructor(O){const B=O.conversionAccuracy==="longterm"||!1;let K=B?G:Gr;O.matrix&&(K=O.matrix),this.values=O.values,this.loc=O.loc||je.create(),this.conversionAccuracy=B?"longterm":"casual",this.invalid=O.invalid||null,this.matrix=K,this.isLuxonDuration=!0}static fromMillis(O,B){return Gt.fromObject({milliseconds:O},B)}static fromObject(O,B={}){if(O==null||typeof O!="object")throw new i(`Duration.fromObject: argument expected to be an object, got ${O===null?"null":typeof O}`);return new Gt({values:tc(O,Gt.normalizeUnit),loc:je.fromObject(B),conversionAccuracy:B.conversionAccuracy,matrix:B.matrix})}static fromDurationLike(O){if(Mt(O))return Gt.fromMillis(O);if(Gt.isDuration(O))return O;if(typeof O=="object")return Gt.fromObject(O);throw new i(`Unknown duration argument ${O} of type ${typeof O}`)}static fromISO(O,B){const[K]=Ls(O);return K?Gt.fromObject(K,B):Gt.invalid("unparsable",`the input "${O}" can't be parsed as ISO 8601`)}static fromISOTime(O,B){const[K]=Xp(O);return K?Gt.fromObject(K,B):Gt.invalid("unparsable",`the input "${O}" can't be parsed as ISO 8601`)}static invalid(O,B=null){if(!O)throw new i("need to specify a reason the Duration is invalid");const K=O instanceof Ln?O:new Ln(O,B);if(rn.throwOnInvalid)throw new r(K);return new Gt({invalid:K})}static normalizeUnit(O){const B={year:"years",years:"years",quarter:"quarters",quarters:"quarters",month:"months",months:"months",week:"weeks",weeks:"weeks",day:"days",days:"days",hour:"hours",hours:"hours",minute:"minutes",minutes:"minutes",second:"seconds",seconds:"seconds",millisecond:"milliseconds",milliseconds:"milliseconds"}[O&&O.toLowerCase()];if(!B)throw new a(O);return B}static isDuration(O){return O&&O.isLuxonDuration||!1}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}toFormat(O,B={}){const K={...B,floor:B.round!==!1&&B.floor!==!1};return this.isValid?to.create(this.loc,K).formatDurationFromString(this,O):rr}toHuman(O={}){if(!this.isValid)return rr;const B=O.showZeros!==!1,K=Ee.map(se=>{const we=this.values[se];return Be(we)||we===0&&!B?null:this.loc.numberFormatter({style:"unit",unitDisplay:"long",...O,unit:se.slice(0,-1)}).format(we)}).filter(se=>se);return this.loc.listFormatter({type:"conjunction",style:O.listStyle||"narrow",...O}).format(K)}toObject(){return this.isValid?{...this.values}:{}}toISO(){if(!this.isValid)return null;let O="P";return this.years!==0&&(O+=this.years+"Y"),(this.months!==0||this.quarters!==0)&&(O+=this.months+this.quarters*3+"M"),this.weeks!==0&&(O+=this.weeks+"W"),this.days!==0&&(O+=this.days+"D"),(this.hours!==0||this.minutes!==0||this.seconds!==0||this.milliseconds!==0)&&(O+="T"),this.hours!==0&&(O+=this.hours+"H"),this.minutes!==0&&(O+=this.minutes+"M"),(this.seconds!==0||this.milliseconds!==0)&&(O+=ls(this.seconds+this.milliseconds/1e3,3)+"S"),O==="P"&&(O+="T0S"),O}toISOTime(O={}){if(!this.isValid)return null;const B=this.toMillis();return B<0||B>=864e5?null:(O={suppressMilliseconds:!1,suppressSeconds:!1,includePrefix:!1,format:"extended",...O,includeOffset:!1},yn.fromMillis(B,{zone:"UTC"}).toISOTime(O))}toJSON(){return this.toISO()}toString(){return this.toISO()}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`Duration { values: ${JSON.stringify(this.values)} }`:`Duration { Invalid, reason: ${this.invalidReason} }`}toMillis(){return this.isValid?On(this.matrix,this.values):NaN}valueOf(){return this.toMillis()}plus(O){if(!this.isValid)return this;const B=Gt.fromDurationLike(O),K={};for(const se of Ee)(Dt(B.values,se)||Dt(this.values,se))&&(K[se]=B.get(se)+this.get(se));return Ht(this,{values:K},!0)}minus(O){if(!this.isValid)return this;const B=Gt.fromDurationLike(O);return this.plus(B.negate())}mapUnits(O){if(!this.isValid)return this;const B={};for(const K of Object.keys(this.values))B[K]=us(O(this.values[K],K));return Ht(this,{values:B},!0)}get(O){return this[Gt.normalizeUnit(O)]}set(O){if(!this.isValid)return this;const B={...this.values,...tc(O,Gt.normalizeUnit)};return Ht(this,{values:B})}reconfigure({locale:O,numberingSystem:B,conversionAccuracy:K,matrix:se}={}){const we={loc:this.loc.clone({locale:O,numberingSystem:B}),matrix:se,conversionAccuracy:K};return Ht(this,we)}as(O){return this.isValid?this.shiftTo(O).get(O):NaN}normalize(){if(!this.isValid)return this;const O=this.toObject();return Yn(this.matrix,O),Ht(this,{values:O},!0)}rescale(){if(!this.isValid)return this;const O=Gn(this.normalize().shiftToAll().toObject());return Ht(this,{values:O},!0)}shiftTo(...O){if(!this.isValid)return this;if(O.length===0)return this;O=O.map(Ae=>Gt.normalizeUnit(Ae));const B={},K={},se=this.toObject();let we;for(const Ae of Ee)if(O.indexOf(Ae)>=0){we=Ae;let _e=0;for(const Ot in K)_e+=this.matrix[Ot][Ae]*K[Ot],K[Ot]=0;Mt(se[Ae])&&(_e+=se[Ae]);const We=Math.trunc(_e);B[Ae]=We,K[Ae]=(_e*1e3-We*1e3)/1e3}else Mt(se[Ae])&&(K[Ae]=se[Ae]);for(const Ae in K)K[Ae]!==0&&(B[we]+=Ae===we?K[Ae]:K[Ae]/this.matrix[we][Ae]);return Yn(this.matrix,B),Ht(this,{values:B},!0)}shiftToAll(){return this.isValid?this.shiftTo("years","months","weeks","days","hours","minutes","seconds","milliseconds"):this}negate(){if(!this.isValid)return this;const O={};for(const B of Object.keys(this.values))O[B]=this.values[B]===0?0:-this.values[B];return Ht(this,{values:O},!0)}removeZeros(){if(!this.isValid)return this;const O=Gn(this.values);return Ht(this,{values:O},!0)}get years(){return this.isValid?this.values.years||0:NaN}get quarters(){return this.isValid?this.values.quarters||0:NaN}get months(){return this.isValid?this.values.months||0:NaN}get weeks(){return this.isValid?this.values.weeks||0:NaN}get days(){return this.isValid?this.values.days||0:NaN}get hours(){return this.isValid?this.values.hours||0:NaN}get minutes(){return this.isValid?this.values.minutes||0:NaN}get seconds(){return this.isValid?this.values.seconds||0:NaN}get milliseconds(){return this.isValid?this.values.milliseconds||0:NaN}get isValid(){return this.invalid===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}equals(O){if(!this.isValid||!O.isValid||!this.loc.equals(O.loc))return!1;function B(K,se){return K===void 0||K===0?se===void 0||se===0:K===se}for(const K of Ee)if(!B(this.values[K],O.values[K]))return!1;return!0}}const Cr="Invalid Interval";function kr(q,O){return!q||!q.isValid?ln.invalid("missing or invalid start"):!O||!O.isValid?ln.invalid("missing or invalid end"):O<q?ln.invalid("end before start",`The end of an interval must be after its start, but you had start=${q.toISO()} and end=${O.toISO()}`):null}class ln{constructor(O){this.s=O.start,this.e=O.end,this.invalid=O.invalid||null,this.isLuxonInterval=!0}static invalid(O,B=null){if(!O)throw new i("need to specify a reason the Interval is invalid");const K=O instanceof Ln?O:new Ln(O,B);if(rn.throwOnInvalid)throw new n(K);return new ln({invalid:K})}static fromDateTimes(O,B){const K=ni(O),se=ni(B);return kr(K,se)??new ln({start:K,end:se})}static after(O,B){const K=Gt.fromDurationLike(B),se=ni(O);return ln.fromDateTimes(se,se.plus(K))}static before(O,B){const K=Gt.fromDurationLike(B),se=ni(O);return ln.fromDateTimes(se.minus(K),se)}static fromISO(O,B){const[K,se]=(O||"").split("/",2);if(K&&se){let we,Ae;try{we=yn.fromISO(K,B),Ae=we.isValid}catch{Ae=!1}let _e,We;try{_e=yn.fromISO(se,B),We=_e.isValid}catch{We=!1}if(Ae&&We)return ln.fromDateTimes(we,_e);if(Ae){const Ot=Gt.fromISO(se,B);if(Ot.isValid)return ln.after(we,Ot)}else if(We){const Ot=Gt.fromISO(K,B);if(Ot.isValid)return ln.before(_e,Ot)}}return ln.invalid("unparsable",`the input "${O}" can't be parsed as ISO 8601`)}static isInterval(O){return O&&O.isLuxonInterval||!1}get start(){return this.isValid?this.s:null}get end(){return this.isValid?this.e:null}get lastDateTime(){return this.isValid&&this.e?this.e.minus(1):null}get isValid(){return this.invalidReason===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}length(O="milliseconds"){return this.isValid?this.toDuration(O).get(O):NaN}count(O="milliseconds",B){if(!this.isValid)return NaN;const K=this.start.startOf(O,B);let se;return B!=null&&B.useLocaleWeeks?se=this.end.reconfigure({locale:K.locale}):se=this.end,se=se.startOf(O,B),Math.floor(se.diff(K,O).get(O))+(se.valueOf()!==this.end.valueOf())}hasSame(O){return this.isValid?this.isEmpty()||this.e.minus(1).hasSame(this.s,O):!1}isEmpty(){return this.s.valueOf()===this.e.valueOf()}isAfter(O){return this.isValid?this.s>O:!1}isBefore(O){return this.isValid?this.e<=O:!1}contains(O){return this.isValid?this.s<=O&&this.e>O:!1}set({start:O,end:B}={}){return this.isValid?ln.fromDateTimes(O||this.s,B||this.e):this}splitAt(...O){if(!this.isValid)return[];const B=O.map(ni).filter(Ae=>this.contains(Ae)).sort((Ae,_e)=>Ae.toMillis()-_e.toMillis()),K=[];let{s:se}=this,we=0;for(;se<this.e;){const Ae=B[we]||this.e,_e=+Ae>+this.e?this.e:Ae;K.push(ln.fromDateTimes(se,_e)),se=_e,we+=1}return K}splitBy(O){const B=Gt.fromDurationLike(O);if(!this.isValid||!B.isValid||B.as("milliseconds")===0)return[];let{s:K}=this,se=1,we;const Ae=[];for(;K<this.e;){const _e=this.start.plus(B.mapUnits(We=>We*se));we=+_e>+this.e?this.e:_e,Ae.push(ln.fromDateTimes(K,we)),K=we,se+=1}return Ae}divideEqually(O){return this.isValid?this.splitBy(this.length()/O).slice(0,O):[]}overlaps(O){return this.e>O.s&&this.s<O.e}abutsStart(O){return this.isValid?+this.e==+O.s:!1}abutsEnd(O){return this.isValid?+O.e==+this.s:!1}engulfs(O){return this.isValid?this.s<=O.s&&this.e>=O.e:!1}equals(O){return!this.isValid||!O.isValid?!1:this.s.equals(O.s)&&this.e.equals(O.e)}intersection(O){if(!this.isValid)return this;const B=this.s>O.s?this.s:O.s,K=this.e<O.e?this.e:O.e;return B>=K?null:ln.fromDateTimes(B,K)}union(O){if(!this.isValid)return this;const B=this.s<O.s?this.s:O.s,K=this.e>O.e?this.e:O.e;return ln.fromDateTimes(B,K)}static merge(O){const[B,K]=O.sort((se,we)=>se.s-we.s).reduce(([se,we],Ae)=>we?we.overlaps(Ae)||we.abutsStart(Ae)?[se,we.union(Ae)]:[se.concat([we]),Ae]:[se,Ae],[[],null]);return K&&B.push(K),B}static xor(O){let B=null,K=0;const se=[],we=O.map(We=>[{time:We.s,type:"s"},{time:We.e,type:"e"}]),Ae=Array.prototype.concat(...we),_e=Ae.sort((We,Ot)=>We.time-Ot.time);for(const We of _e)K+=We.type==="s"?1:-1,K===1?B=We.time:(B&&+B!=+We.time&&se.push(ln.fromDateTimes(B,We.time)),B=null);return ln.merge(se)}difference(...O){return ln.xor([this].concat(O)).map(B=>this.intersection(B)).filter(B=>B&&!B.isEmpty())}toString(){return this.isValid?`[${this.s.toISO()} – ${this.e.toISO()})`:Cr}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`Interval { start: ${this.s.toISO()}, end: ${this.e.toISO()} }`:`Interval { Invalid, reason: ${this.invalidReason} }`}toLocaleString(O=h,B={}){return this.isValid?to.create(this.s.loc.clone(B),O).formatInterval(this):Cr}toISO(O){return this.isValid?`${this.s.toISO(O)}/${this.e.toISO(O)}`:Cr}toISODate(){return this.isValid?`${this.s.toISODate()}/${this.e.toISODate()}`:Cr}toISOTime(O){return this.isValid?`${this.s.toISOTime(O)}/${this.e.toISOTime(O)}`:Cr}toFormat(O,{separator:B=" – "}={}){return this.isValid?`${this.s.toFormat(O)}${B}${this.e.toFormat(O)}`:Cr}toDuration(O,B){return this.isValid?this.e.diff(this.s,O,B):Gt.invalid(this.invalidReason)}mapEndpoints(O){return ln.fromDateTimes(O(this.s),O(this.e))}}class gr{static hasDST(O=rn.defaultZone){const B=yn.now().setZone(O).set({month:12});return!O.isUniversal&&B.offset!==B.set({month:6}).offset}static isValidIANAZone(O){return ne.isValidZone(O)}static normalizeZone(O){return ct(O,rn.defaultZone)}static getStartOfWeek({locale:O=null,locObj:B=null}={}){return(B||je.create(O)).getStartOfWeek()}static getMinimumDaysInFirstWeek({locale:O=null,locObj:B=null}={}){return(B||je.create(O)).getMinDaysInFirstWeek()}static getWeekendWeekdays({locale:O=null,locObj:B=null}={}){return(B||je.create(O)).getWeekendDays().slice()}static months(O="long",{locale:B=null,numberingSystem:K=null,locObj:se=null,outputCalendar:we="gregory"}={}){return(se||je.create(B,K,we)).months(O)}static monthsFormat(O="long",{locale:B=null,numberingSystem:K=null,locObj:se=null,outputCalendar:we="gregory"}={}){return(se||je.create(B,K,we)).months(O,!0)}static weekdays(O="long",{locale:B=null,numberingSystem:K=null,locObj:se=null}={}){return(se||je.create(B,K,null)).weekdays(O)}static weekdaysFormat(O="long",{locale:B=null,numberingSystem:K=null,locObj:se=null}={}){return(se||je.create(B,K,null)).weekdays(O,!0)}static meridiems({locale:O=null}={}){return je.create(O).meridiems()}static eras(O="short",{locale:B=null}={}){return je.create(B,null,"gregory").eras(O)}static features(){return{relative:Me(),localeWeek:lt()}}}function Br(q,O){const B=se=>se.toUTC(0,{keepLocalTime:!0}).startOf("day").valueOf(),K=B(O)-B(q);return Math.floor(Gt.fromMillis(K).as("days"))}function Hr(q,O,B){const K=[["years",(We,Ot)=>Ot.year-We.year],["quarters",(We,Ot)=>Ot.quarter-We.quarter+(Ot.year-We.year)*4],["months",(We,Ot)=>Ot.month-We.month+(Ot.year-We.year)*12],["weeks",(We,Ot)=>{const vn=Br(We,Ot);return(vn-vn%7)/7}],["days",Br]],se={},we=q;let Ae,_e;for(const[We,Ot]of K)B.indexOf(We)>=0&&(Ae=We,se[We]=Ot(q,O),_e=we.plus(se),_e>O?(se[We]--,q=we.plus(se),q>O&&(_e=q,se[We]--,q=we.plus(se))):q=_e);return[q,se,_e,Ae]}function Xa(q,O,B,K){let[se,we,Ae,_e]=Hr(q,O,B);const We=O-se,Ot=B.filter(Nn=>["hours","minutes","seconds","milliseconds"].indexOf(Nn)>=0);Ot.length===0&&(Ae<O&&(Ae=se.plus({[_e]:1})),Ae!==se&&(we[_e]=(we[_e]||0)+We/(Ae-se)));const vn=Gt.fromObject(we,K);return Ot.length>0?Gt.fromMillis(We,K).shiftTo(...Ot).plus(vn):vn}const ga="missing Intl.DateTimeFormat.formatToParts support";function zn(q,O=B=>B){return{regex:q,deser:([B])=>O($n(B))}}const Cl="[  ]",ya=new RegExp(Cl,"g");function ms(q){return q.replace(/\./g,"\\.?").replace(ya,Cl)}function aa(q){return q.replace(/\./g,"").replace(ya," ").toLowerCase()}function ro(q,O){return q===null?null:{regex:RegExp(q.map(ms).join("|")),deser:([B])=>q.findIndex(K=>aa(B)===aa(K))+O}}function kl(q,O){return{regex:q,deser:([,B,K])=>ml(B,K),groups:O}}function xo(q){return{regex:q,deser:([O])=>O}}function lc(q){return q.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function Jp(q,O){const B=Jt(O),K=Jt(O,"{2}"),se=Jt(O,"{3}"),we=Jt(O,"{4}"),Ae=Jt(O,"{6}"),_e=Jt(O,"{1,2}"),We=Jt(O,"{1,3}"),Ot=Jt(O,"{1,6}"),vn=Jt(O,"{1,9}"),Nn=Jt(O,"{2,4}"),ur=Jt(O,"{4,6}"),Sn=_o=>({regex:RegExp(lc(_o.val)),deser:([$a])=>$a,literal:!0}),Kr=(_o=>{if(q.literal)return Sn(_o);switch(_o.val){case"G":return ro(O.eras("short"),0);case"GG":return ro(O.eras("long"),0);case"y":return zn(Ot);case"yy":return zn(Nn,Ei);case"yyyy":return zn(we);case"yyyyy":return zn(ur);case"yyyyyy":return zn(Ae);case"M":return zn(_e);case"MM":return zn(K);case"MMM":return ro(O.months("short",!0),1);case"MMMM":return ro(O.months("long",!0),1);case"L":return zn(_e);case"LL":return zn(K);case"LLL":return ro(O.months("short",!1),1);case"LLLL":return ro(O.months("long",!1),1);case"d":return zn(_e);case"dd":return zn(K);case"o":return zn(We);case"ooo":return zn(se);case"HH":return zn(K);case"H":return zn(_e);case"hh":return zn(K);case"h":return zn(_e);case"mm":return zn(K);case"m":return zn(_e);case"q":return zn(_e);case"qq":return zn(K);case"s":return zn(_e);case"ss":return zn(K);case"S":return zn(We);case"SSS":return zn(se);case"u":return xo(vn);case"uu":return xo(_e);case"uuu":return zn(B);case"a":return ro(O.meridiems(),0);case"kkkk":return zn(we);case"kk":return zn(Nn,Ei);case"W":return zn(_e);case"WW":return zn(K);case"E":case"c":return zn(B);case"EEE":return ro(O.weekdays("short",!1),1);case"EEEE":return ro(O.weekdays("long",!1),1);case"ccc":return ro(O.weekdays("short",!0),1);case"cccc":return ro(O.weekdays("long",!0),1);case"Z":case"ZZ":return kl(new RegExp(`([+-]${_e.source})(?::(${K.source}))?`),2);case"ZZZ":return kl(new RegExp(`([+-]${_e.source})(${K.source})?`),2);case"z":return xo(/[a-z_+-/]{1,256}?/i);case" ":return xo(/[^\S\n\r]/);default:return Sn(_o)}})(q)||{invalidReason:ga};return Kr.token=q,Kr}const ly={year:{"2-digit":"yy",numeric:"yyyyy"},month:{numeric:"M","2-digit":"MM",short:"MMM",long:"MMMM"},day:{numeric:"d","2-digit":"dd"},weekday:{short:"EEE",long:"EEEE"},dayperiod:"a",dayPeriod:"a",hour12:{numeric:"h","2-digit":"hh"},hour24:{numeric:"H","2-digit":"HH"},minute:{numeric:"m","2-digit":"mm"},second:{numeric:"s","2-digit":"ss"},timeZoneName:{long:"ZZZZZ",short:"ZZZ"}};function El(q,O,B){const{type:K,value:se}=q;if(K==="literal"){const We=/^\s+$/.test(se);return{literal:!We,val:We?" ":se}}const we=O[K];let Ae=K;K==="hour"&&(O.hour12!=null?Ae=O.hour12?"hour12":"hour24":O.hourCycle!=null?O.hourCycle==="h11"||O.hourCycle==="h12"?Ae="hour12":Ae="hour24":Ae=B.hour12?"hour12":"hour24");let _e=ly[Ae];if(typeof _e=="object"&&(_e=_e[we]),_e)return{literal:!1,val:_e}}function cy(q){return[`^${q.map(O=>O.regex).reduce((O,B)=>`${O}(${B.source})`,"")}$`,q]}function uy(q,O,B){const K=q.match(O);if(K){const se={};let we=1;for(const Ae in B)if(Dt(B,Ae)){const _e=B[Ae],We=_e.groups?_e.groups+1:1;!_e.literal&&_e.token&&(se[_e.token.val[0]]=_e.deser(K.slice(we,we+We))),we+=We}return[K,se]}else return[K,{}]}function dy(q){const O=se=>{switch(se){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":case"H":return"hour";case"d":return"day";case"o":return"ordinal";case"L":case"M":return"month";case"y":return"year";case"E":case"c":return"weekday";case"W":return"weekNumber";case"k":return"weekYear";case"q":return"quarter";default:return null}};let B=null,K;return Be(q.z)||(B=ne.create(q.z)),Be(q.Z)||(B||(B=new Ct(q.Z)),K=q.Z),Be(q.q)||(q.M=(q.q-1)*3+1),Be(q.h)||(q.h<12&&q.a===1?q.h+=12:q.h===12&&q.a===0&&(q.h=0)),q.G===0&&q.y&&(q.y=-q.y),Be(q.u)||(q.S=Ro(q.u)),[Object.keys(q).reduce((se,we)=>{const Ae=O(we);return Ae&&(se[Ae]=q[we]),se},{}),B,K]}let eh=null;function yx(){return eh||(eh=yn.fromMillis(1555555555555)),eh}function vx(q,O){if(q.literal)return q;const B=to.macroTokenToFormatOpts(q.val),K=rh(B,O);return K==null||K.includes(void 0)?q:K}function th(q,O){return Array.prototype.concat(...q.map(B=>vx(B,O)))}class nh{constructor(O,B){if(this.locale=O,this.format=B,this.tokens=th(to.parseFormat(B),O),this.units=this.tokens.map(K=>Jp(K,O)),this.disqualifyingUnit=this.units.find(K=>K.invalidReason),!this.disqualifyingUnit){const[K,se]=cy(this.units);this.regex=RegExp(K,"i"),this.handlers=se}}explainFromTokens(O){if(this.isValid){const[B,K]=uy(O,this.regex,this.handlers),[se,we,Ae]=K?dy(K):[null,null,void 0];if(Dt(K,"a")&&Dt(K,"H"))throw new o("Can't include meridiem when specifying 24-hour format");return{input:O,tokens:this.tokens,regex:this.regex,rawMatches:B,matches:K,result:se,zone:we,specificOffset:Ae}}else return{input:O,tokens:this.tokens,invalidReason:this.invalidReason}}get isValid(){return!this.disqualifyingUnit}get invalidReason(){return this.disqualifyingUnit?this.disqualifyingUnit.invalidReason:null}}function Yd(q,O,B){return new nh(q,B).explainFromTokens(O)}function Za(q,O,B){const{result:K,zone:se,specificOffset:we,invalidReason:Ae}=Yd(q,O,B);return[K,se,we,Ae]}function rh(q,O){if(!q)return null;const B=to.create(O,q).dtFormatter(yx()),K=B.formatToParts(),se=B.resolvedOptions();return K.map(we=>El(we,q,se))}const ia="Invalid DateTime",va=864e13;function Ti(q){return new Ln("unsupported zone",`the zone "${q.name}" is not supported`)}function xu(q){return q.weekData===null&&(q.weekData=Et(q.c)),q.weekData}function cc(q){return q.localWeekData===null&&(q.localWeekData=Et(q.c,q.loc.getMinDaysInFirstWeek(),q.loc.getStartOfWeek())),q.localWeekData}function Oi(q,O){const B={ts:q.ts,zone:q.zone,c:q.c,o:q.o,loc:q.loc,invalid:q.invalid};return new yn({...B,...O,old:B})}function Gd(q,O,B){let K=q-O*60*1e3;const se=B.offset(K);if(O===se)return[K,O];K-=(se-O)*60*1e3;const we=B.offset(K);return se===we?[K,se]:[q-Math.min(se,we)*60*1e3,Math.max(se,we)]}function gs(q,O){q+=O*60*1e3;const B=new Date(q);return{year:B.getUTCFullYear(),month:B.getUTCMonth()+1,day:B.getUTCDate(),hour:B.getUTCHours(),minute:B.getUTCMinutes(),second:B.getUTCSeconds(),millisecond:B.getUTCMilliseconds()}}function Su(q,O,B){return Gd(Ka(q),O,B)}function wu(q,O){const B=q.o,K=q.c.year+Math.trunc(O.years),se=q.c.month+Math.trunc(O.months)+Math.trunc(O.quarters)*3,we={...q.c,year:K,month:se,day:Math.min(q.c.day,Fr(K,se))+Math.trunc(O.days)+Math.trunc(O.weeks)*7},Ae=Gt.fromObject({years:O.years-Math.trunc(O.years),quarters:O.quarters-Math.trunc(O.quarters),months:O.months-Math.trunc(O.months),weeks:O.weeks-Math.trunc(O.weeks),days:O.days-Math.trunc(O.days),hours:O.hours,minutes:O.minutes,seconds:O.seconds,milliseconds:O.milliseconds}).as("milliseconds"),_e=Ka(we);let[We,Ot]=Gd(_e,B,q.zone);return Ae!==0&&(We+=Ae,Ot=q.zone.offset(We)),{ts:We,o:Ot}}function Ja(q,O,B,K,se,we){const{setZone:Ae,zone:_e}=B;if(q&&Object.keys(q).length!==0||O){const We=O||_e,Ot=yn.fromObject(q,{...B,zone:We,specificOffset:we});return Ae?Ot:Ot.setZone(_e)}else return yn.invalid(new Ln("unparsable",`the input "${se}" can't be parsed as ${K}`))}function Kd(q,O,B=!0){return q.isValid?to.create(je.create("en-US"),{allowZ:B,forceSimple:!0}).formatDateTimeFromString(q,O):null}function Go(q,O,B){const K=q.c.year>9999||q.c.year<0;let se="";if(K&&q.c.year>=0&&(se+="+"),se+=Xt(q.c.year,K?6:4),B==="year")return se;if(O){if(se+="-",se+=Xt(q.c.month),B==="month")return se;se+="-"}else if(se+=Xt(q.c.month),B==="month")return se;return se+=Xt(q.c.day),se}function Qd(q,O,B,K,se,we,Ae){let _e=!B||q.c.millisecond!==0||q.c.second!==0,We="";switch(Ae){case"day":case"month":case"year":break;default:if(We+=Xt(q.c.hour),Ae==="hour")break;if(O){if(We+=":",We+=Xt(q.c.minute),Ae==="minute")break;_e&&(We+=":",We+=Xt(q.c.second))}else{if(We+=Xt(q.c.minute),Ae==="minute")break;_e&&(We+=Xt(q.c.second))}if(Ae==="second")break;_e&&(!K||q.c.millisecond!==0)&&(We+=".",We+=Xt(q.c.millisecond,3))}return se&&(q.isOffsetFixed&&q.offset===0&&!we?We+="Z":q.o<0?(We+="-",We+=Xt(Math.trunc(-q.o/60)),We+=":",We+=Xt(Math.trunc(-q.o%60))):(We+="+",We+=Xt(Math.trunc(q.o/60)),We+=":",We+=Xt(Math.trunc(q.o%60)))),we&&(We+="["+q.zone.ianaName+"]"),We}const Mi={month:1,day:1,hour:0,minute:0,second:0,millisecond:0},fy={weekNumber:1,weekday:1,hour:0,minute:0,second:0,millisecond:0},Xd={ordinal:1,hour:0,minute:0,second:0,millisecond:0},$i=["year","month","day","hour","minute","second","millisecond"],oh=["weekYear","weekNumber","weekday","hour","minute","second","millisecond"],ah=["year","ordinal","hour","minute","second","millisecond"];function ys(q){const O={year:"year",years:"year",month:"month",months:"month",day:"day",days:"day",hour:"hour",hours:"hour",minute:"minute",minutes:"minute",quarter:"quarter",quarters:"quarter",second:"second",seconds:"second",millisecond:"millisecond",milliseconds:"millisecond",weekday:"weekday",weekdays:"weekday",weeknumber:"weekNumber",weeksnumber:"weekNumber",weeknumbers:"weekNumber",weekyear:"weekYear",weekyears:"weekYear",ordinal:"ordinal"}[q.toLowerCase()];if(!O)throw new a(q);return O}function Rl(q){switch(q.toLowerCase()){case"localweekday":case"localweekdays":return"localWeekday";case"localweeknumber":case"localweeknumbers":return"localWeekNumber";case"localweekyear":case"localweekyears":return"localWeekYear";default:return ys(q)}}function Zd(q){if(ei===void 0&&(ei=rn.now()),q.type!=="iana")return q.offset(ei);const O=q.name;let B=ti.get(O);return B===void 0&&(B=q.offset(ei),ti.set(O,B)),B}function Cu(q,O){const B=ct(O.zone,rn.defaultZone);if(!B.isValid)return yn.invalid(Ti(B));const K=je.fromObject(O);let se,we;if(Be(q.year))se=rn.now();else{for(const We of $i)Be(q[We])&&(q[We]=Mi[We]);const Ae=Fe(q)||pt(q);if(Ae)return yn.invalid(Ae);const _e=Zd(B);[se,we]=Su(q,_e,B)}return new yn({ts:se,zone:B,loc:K,o:we})}function ba(q,O,B){const K=Be(B.round)?!0:B.round,se=Be(B.rounding)?"trunc":B.rounding,we=(_e,We)=>(_e=ls(_e,K||B.calendary?0:2,B.calendary?"round":se),O.loc.clone(B).relFormatter(B).format(_e,We)),Ae=_e=>B.calendary?O.hasSame(q,_e)?0:O.startOf(_e).diff(q.startOf(_e),_e).get(_e):O.diff(q,_e).get(_e);if(B.unit)return we(Ae(B.unit),B.unit);for(const _e of B.units){const We=Ae(_e);if(Math.abs(We)>=1)return we(We,_e)}return we(q>O?-0:0,B.units[B.units.length-1])}function xa(q){let O={},B;return q.length>0&&typeof q[q.length-1]=="object"?(O=q[q.length-1],B=Array.from(q).slice(0,q.length-1)):B=Array.from(q),[O,B]}let ei;const ti=new Map;class yn{constructor(O){const B=O.zone||rn.defaultZone;let K=O.invalid||(Number.isNaN(O.ts)?new Ln("invalid input"):null)||(B.isValid?null:Ti(B));this.ts=Be(O.ts)?rn.now():O.ts;let se=null,we=null;if(!K)if(O.old&&O.old.ts===this.ts&&O.old.zone.equals(B))[se,we]=[O.old.c,O.old.o];else{const Ae=Mt(O.o)&&!O.old?O.o:B.offset(this.ts);se=gs(this.ts,Ae),K=Number.isNaN(se.year)?new Ln("invalid input"):null,se=K?null:se,we=K?null:Ae}this._zone=B,this.loc=O.loc||je.create(),this.invalid=K,this.weekData=null,this.localWeekData=null,this.c=se,this.o=we,this.isLuxonDateTime=!0}static now(){return new yn({})}static local(){const[O,B]=xa(arguments),[K,se,we,Ae,_e,We,Ot]=B;return Cu({year:K,month:se,day:we,hour:Ae,minute:_e,second:We,millisecond:Ot},O)}static utc(){const[O,B]=xa(arguments),[K,se,we,Ae,_e,We,Ot]=B;return O.zone=Ct.utcInstance,Cu({year:K,month:se,day:we,hour:Ae,minute:_e,second:We,millisecond:Ot},O)}static fromJSDate(O,B={}){const K=Se(O)?O.valueOf():NaN;if(Number.isNaN(K))return yn.invalid("invalid input");const se=ct(B.zone,rn.defaultZone);return se.isValid?new yn({ts:K,zone:se,loc:je.fromObject(B)}):yn.invalid(Ti(se))}static fromMillis(O,B={}){if(Mt(O))return O<-va||O>va?yn.invalid("Timestamp out of range"):new yn({ts:O,zone:ct(B.zone,rn.defaultZone),loc:je.fromObject(B)});throw new i(`fromMillis requires a numerical input, but received a ${typeof O} with value ${O}`)}static fromSeconds(O,B={}){if(Mt(O))return new yn({ts:O*1e3,zone:ct(B.zone,rn.defaultZone),loc:je.fromObject(B)});throw new i("fromSeconds requires a numerical input")}static fromObject(O,B={}){O=O||{};const K=ct(B.zone,rn.defaultZone);if(!K.isValid)return yn.invalid(Ti(K));const se=je.fromObject(B),we=tc(O,Rl),{minDaysInFirstWeek:Ae,startOfWeek:_e}=_t(we,se),We=rn.now(),Ot=Be(B.specificOffset)?K.offset(We):B.specificOffset,vn=!Be(we.ordinal),Nn=!Be(we.year),ur=!Be(we.month)||!Be(we.day),Sn=Nn||ur,Kr=we.weekYear||we.weekNumber;if((Sn||vn)&&Kr)throw new o("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(ur&&vn)throw new o("Can't mix ordinal dates with month/day");const _o=Kr||we.weekday&&!Sn;let $a,Pa,Aa=gs(We,Ot);_o?($a=oh,Pa=fy,Aa=Et(Aa,Ae,_e)):vn?($a=ah,Pa=Xd,Aa=Kt(Aa)):($a=$i,Pa=Mi);let Pi=!1;for(const zs of $a){const hy=we[zs];Be(hy)?Pi?we[zs]=Pa[zs]:we[zs]=Aa[zs]:Pi=!0}const ih=_o?me(we,Ae,_e):vn?ge(we):Fe(we),Jd=ih||pt(we);if(Jd)return yn.invalid(Jd);const ku=_o?Pt(we,Ae,_e):vn?At(we):we,[ef,Tl]=Su(ku,Ot,K),so=new yn({ts:ef,zone:K,o:Tl,loc:se});return we.weekday&&Sn&&O.weekday!==so.weekday?yn.invalid("mismatched weekday",`you can't specify both a weekday of ${we.weekday} and a date of ${so.toISO()}`):so.isValid?so:yn.invalid(so.invalid)}static fromISO(O,B={}){const[K,se]=Bd(O);return Ja(K,se,B,"ISO 8601",O)}static fromRFC2822(O,B={}){const[K,se]=Vd(O);return Ja(K,se,B,"RFC 2822",O)}static fromHTTP(O,B={}){const[K,se]=Hd(O);return Ja(K,se,B,"HTTP",B)}static fromFormat(O,B,K={}){if(Be(O)||Be(B))throw new i("fromFormat requires an input string and a format");const{locale:se=null,numberingSystem:we=null}=K,Ae=je.fromOpts({locale:se,numberingSystem:we,defaultToEN:!0}),[_e,We,Ot,vn]=Za(Ae,O,B);return vn?yn.invalid(vn):Ja(_e,We,K,`format ${B}`,O,Ot)}static fromString(O,B,K={}){return yn.fromFormat(O,B,K)}static fromSQL(O,B={}){const[K,se]=wl(O);return Ja(K,se,B,"SQL",O)}static invalid(O,B=null){if(!O)throw new i("need to specify a reason the DateTime is invalid");const K=O instanceof Ln?O:new Ln(O,B);if(rn.throwOnInvalid)throw new t(K);return new yn({invalid:K})}static isDateTime(O){return O&&O.isLuxonDateTime||!1}static parseFormatForOpts(O,B={}){const K=rh(O,je.fromObject(B));return K?K.map(se=>se?se.val:null).join(""):null}static expandFormat(O,B={}){return th(to.parseFormat(O),je.fromObject(B)).map(K=>K.val).join("")}static resetCache(){ei=void 0,ti.clear()}get(O){return this[O]}get isValid(){return this.invalid===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}get outputCalendar(){return this.isValid?this.loc.outputCalendar:null}get zone(){return this._zone}get zoneName(){return this.isValid?this.zone.name:null}get year(){return this.isValid?this.c.year:NaN}get quarter(){return this.isValid?Math.ceil(this.c.month/3):NaN}get month(){return this.isValid?this.c.month:NaN}get day(){return this.isValid?this.c.day:NaN}get hour(){return this.isValid?this.c.hour:NaN}get minute(){return this.isValid?this.c.minute:NaN}get second(){return this.isValid?this.c.second:NaN}get millisecond(){return this.isValid?this.c.millisecond:NaN}get weekYear(){return this.isValid?xu(this).weekYear:NaN}get weekNumber(){return this.isValid?xu(this).weekNumber:NaN}get weekday(){return this.isValid?xu(this).weekday:NaN}get isWeekend(){return this.isValid&&this.loc.getWeekendDays().includes(this.weekday)}get localWeekday(){return this.isValid?cc(this).weekday:NaN}get localWeekNumber(){return this.isValid?cc(this).weekNumber:NaN}get localWeekYear(){return this.isValid?cc(this).weekYear:NaN}get ordinal(){return this.isValid?Kt(this.c).ordinal:NaN}get monthShort(){return this.isValid?gr.months("short",{locObj:this.loc})[this.month-1]:null}get monthLong(){return this.isValid?gr.months("long",{locObj:this.loc})[this.month-1]:null}get weekdayShort(){return this.isValid?gr.weekdays("short",{locObj:this.loc})[this.weekday-1]:null}get weekdayLong(){return this.isValid?gr.weekdays("long",{locObj:this.loc})[this.weekday-1]:null}get offset(){return this.isValid?+this.o:NaN}get offsetNameShort(){return this.isValid?this.zone.offsetName(this.ts,{format:"short",locale:this.locale}):null}get offsetNameLong(){return this.isValid?this.zone.offsetName(this.ts,{format:"long",locale:this.locale}):null}get isOffsetFixed(){return this.isValid?this.zone.isUniversal:null}get isInDST(){return this.isOffsetFixed?!1:this.offset>this.set({month:1,day:1}).offset||this.offset>this.set({month:5}).offset}getPossibleOffsets(){if(!this.isValid||this.isOffsetFixed)return[this];const O=864e5,B=6e4,K=Ka(this.c),se=this.zone.offset(K-O),we=this.zone.offset(K+O),Ae=this.zone.offset(K-se*B),_e=this.zone.offset(K-we*B);if(Ae===_e)return[this];const We=K-Ae*B,Ot=K-_e*B,vn=gs(We,Ae),Nn=gs(Ot,_e);return vn.hour===Nn.hour&&vn.minute===Nn.minute&&vn.second===Nn.second&&vn.millisecond===Nn.millisecond?[Oi(this,{ts:We}),Oi(this,{ts:Ot})]:[this]}get isInLeapYear(){return ra(this.year)}get daysInMonth(){return Fr(this.year,this.month)}get daysInYear(){return this.isValid?cr(this.year):NaN}get weeksInWeekYear(){return this.isValid?cs(this.weekYear):NaN}get weeksInLocalWeekYear(){return this.isValid?cs(this.localWeekYear,this.loc.getMinDaysInFirstWeek(),this.loc.getStartOfWeek()):NaN}resolvedLocaleOptions(O={}){const{locale:B,numberingSystem:K,calendar:se}=to.create(this.loc.clone(O),O).resolvedOptions(this);return{locale:B,numberingSystem:K,outputCalendar:se}}toUTC(O=0,B={}){return this.setZone(Ct.instance(O),B)}toLocal(){return this.setZone(rn.defaultZone)}setZone(O,{keepLocalTime:B=!1,keepCalendarTime:K=!1}={}){if(O=ct(O,rn.defaultZone),O.equals(this.zone))return this;if(O.isValid){let se=this.ts;if(B||K){const we=O.offset(this.ts),Ae=this.toObject();[se]=Su(Ae,we,O)}return Oi(this,{ts:se,zone:O})}else return yn.invalid(Ti(O))}reconfigure({locale:O,numberingSystem:B,outputCalendar:K}={}){const se=this.loc.clone({locale:O,numberingSystem:B,outputCalendar:K});return Oi(this,{loc:se})}setLocale(O){return this.reconfigure({locale:O})}set(O){if(!this.isValid)return this;const B=tc(O,Rl),{minDaysInFirstWeek:K,startOfWeek:se}=_t(B,this.loc),we=!Be(B.weekYear)||!Be(B.weekNumber)||!Be(B.weekday),Ae=!Be(B.ordinal),_e=!Be(B.year),We=!Be(B.month)||!Be(B.day),Ot=_e||We,vn=B.weekYear||B.weekNumber;if((Ot||Ae)&&vn)throw new o("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(We&&Ae)throw new o("Can't mix ordinal dates with month/day");let Nn;we?Nn=Pt({...Et(this.c,K,se),...B},K,se):Be(B.ordinal)?(Nn={...this.toObject(),...B},Be(B.day)&&(Nn.day=Math.min(Fr(Nn.year,Nn.month),Nn.day))):Nn=At({...Kt(this.c),...B});const[ur,Sn]=Su(Nn,this.o,this.zone);return Oi(this,{ts:ur,o:Sn})}plus(O){if(!this.isValid)return this;const B=Gt.fromDurationLike(O);return Oi(this,wu(this,B))}minus(O){if(!this.isValid)return this;const B=Gt.fromDurationLike(O).negate();return Oi(this,wu(this,B))}startOf(O,{useLocaleWeeks:B=!1}={}){if(!this.isValid)return this;const K={},se=Gt.normalizeUnit(O);switch(se){case"years":K.month=1;case"quarters":case"months":K.day=1;case"weeks":case"days":K.hour=0;case"hours":K.minute=0;case"minutes":K.second=0;case"seconds":K.millisecond=0;break}if(se==="weeks")if(B){const we=this.loc.getStartOfWeek(),{weekday:Ae}=this;Ae<we&&(K.weekNumber=this.weekNumber-1),K.weekday=we}else K.weekday=1;if(se==="quarters"){const we=Math.ceil(this.month/3);K.month=(we-1)*3+1}return this.set(K)}endOf(O,B){return this.isValid?this.plus({[O]:1}).startOf(O,B).minus(1):this}toFormat(O,B={}){return this.isValid?to.create(this.loc.redefaultToEN(B)).formatDateTimeFromString(this,O):ia}toLocaleString(O=h,B={}){return this.isValid?to.create(this.loc.clone(B),O).formatDateTime(this):ia}toLocaleParts(O={}){return this.isValid?to.create(this.loc.clone(O),O).formatDateTimeParts(this):[]}toISO({format:O="extended",suppressSeconds:B=!1,suppressMilliseconds:K=!1,includeOffset:se=!0,extendedZone:we=!1,precision:Ae="milliseconds"}={}){if(!this.isValid)return null;Ae=ys(Ae);const _e=O==="extended";let We=Go(this,_e,Ae);return $i.indexOf(Ae)>=3&&(We+="T"),We+=Qd(this,_e,B,K,se,we,Ae),We}toISODate({format:O="extended",precision:B="day"}={}){return this.isValid?Go(this,O==="extended",ys(B)):null}toISOWeekDate(){return Kd(this,"kkkk-'W'WW-c")}toISOTime({suppressMilliseconds:O=!1,suppressSeconds:B=!1,includeOffset:K=!0,includePrefix:se=!1,extendedZone:we=!1,format:Ae="extended",precision:_e="milliseconds"}={}){return this.isValid?(_e=ys(_e),(se&&$i.indexOf(_e)>=3?"T":"")+Qd(this,Ae==="extended",B,O,K,we,_e)):null}toRFC2822(){return Kd(this,"EEE, dd LLL yyyy HH:mm:ss ZZZ",!1)}toHTTP(){return Kd(this.toUTC(),"EEE, dd LLL yyyy HH:mm:ss 'GMT'")}toSQLDate(){return this.isValid?Go(this,!0):null}toSQLTime({includeOffset:O=!0,includeZone:B=!1,includeOffsetSpace:K=!0}={}){let se="HH:mm:ss.SSS";return(B||O)&&(K&&(se+=" "),B?se+="z":O&&(se+="ZZ")),Kd(this,se,!0)}toSQL(O={}){return this.isValid?`${this.toSQLDate()} ${this.toSQLTime(O)}`:null}toString(){return this.isValid?this.toISO():ia}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`DateTime { ts: ${this.toISO()}, zone: ${this.zone.name}, locale: ${this.locale} }`:`DateTime { Invalid, reason: ${this.invalidReason} }`}valueOf(){return this.toMillis()}toMillis(){return this.isValid?this.ts:NaN}toSeconds(){return this.isValid?this.ts/1e3:NaN}toUnixInteger(){return this.isValid?Math.floor(this.ts/1e3):NaN}toJSON(){return this.toISO()}toBSON(){return this.toJSDate()}toObject(O={}){if(!this.isValid)return{};const B={...this.c};return O.includeConfig&&(B.outputCalendar=this.outputCalendar,B.numberingSystem=this.loc.numberingSystem,B.locale=this.loc.locale),B}toJSDate(){return new Date(this.isValid?this.ts:NaN)}diff(O,B="milliseconds",K={}){if(!this.isValid||!O.isValid)return Gt.invalid("created by diffing an invalid DateTime");const se={locale:this.locale,numberingSystem:this.numberingSystem,...K},we=xt(B).map(Gt.normalizeUnit),Ae=O.valueOf()>this.valueOf(),_e=Ae?this:O,We=Ae?O:this,Ot=Xa(_e,We,we,se);return Ae?Ot.negate():Ot}diffNow(O="milliseconds",B={}){return this.diff(yn.now(),O,B)}until(O){return this.isValid?ln.fromDateTimes(this,O):this}hasSame(O,B,K){if(!this.isValid)return!1;const se=O.valueOf(),we=this.setZone(O.zone,{keepLocalTime:!0});return we.startOf(B,K)<=se&&se<=we.endOf(B,K)}equals(O){return this.isValid&&O.isValid&&this.valueOf()===O.valueOf()&&this.zone.equals(O.zone)&&this.loc.equals(O.loc)}toRelative(O={}){if(!this.isValid)return null;const B=O.base||yn.fromObject({},{zone:this.zone}),K=O.padding?this<B?-O.padding:O.padding:0;let se=["years","months","days","hours","minutes","seconds"],we=O.unit;return Array.isArray(O.unit)&&(se=O.unit,we=void 0),ba(B,this.plus(K),{...O,numeric:"always",units:se,unit:we})}toRelativeCalendar(O={}){return this.isValid?ba(O.base||yn.fromObject({},{zone:this.zone}),this,{...O,numeric:"auto",units:["years","months","days"],calendary:!0}):null}static min(...O){if(!O.every(yn.isDateTime))throw new i("min requires all arguments be DateTimes");return Rt(O,B=>B.valueOf(),Math.min)}static max(...O){if(!O.every(yn.isDateTime))throw new i("max requires all arguments be DateTimes");return Rt(O,B=>B.valueOf(),Math.max)}static fromFormatExplain(O,B,K={}){const{locale:se=null,numberingSystem:we=null}=K,Ae=je.fromOpts({locale:se,numberingSystem:we,defaultToEN:!0});return Yd(Ae,O,B)}static fromStringExplain(O,B,K={}){return yn.fromFormatExplain(O,B,K)}static buildFormatParser(O,B={}){const{locale:K=null,numberingSystem:se=null}=B,we=je.fromOpts({locale:K,numberingSystem:se,defaultToEN:!0});return new nh(we,O)}static fromFormatParser(O,B,K={}){if(Be(O)||Be(B))throw new i("fromFormatParser requires an input string and a format parser");const{locale:se=null,numberingSystem:we=null}=K,Ae=je.fromOpts({locale:se,numberingSystem:we,defaultToEN:!0});if(!Ae.equals(B.locale))throw new i(`fromFormatParser called with a locale of ${Ae}, but the format parser was created for ${B.locale}`);const{result:_e,zone:We,specificOffset:Ot,invalidReason:vn}=B.explainFromTokens(O);return vn?yn.invalid(vn):Ja(_e,We,K,`format ${B.format}`,O,Ot)}static get DATE_SHORT(){return h}static get DATE_MED(){return m}static get DATE_MED_WITH_WEEKDAY(){return v}static get DATE_FULL(){return b}static get DATE_HUGE(){return x}static get TIME_SIMPLE(){return w}static get TIME_WITH_SECONDS(){return S}static get TIME_WITH_SHORT_OFFSET(){return R}static get TIME_WITH_LONG_OFFSET(){return E}static get TIME_24_SIMPLE(){return M}static get TIME_24_WITH_SECONDS(){return $}static get TIME_24_WITH_SHORT_OFFSET(){return D}static get TIME_24_WITH_LONG_OFFSET(){return F}static get DATETIME_SHORT(){return I}static get DATETIME_SHORT_WITH_SECONDS(){return U}static get DATETIME_MED(){return z}static get DATETIME_MED_WITH_SECONDS(){return L}static get DATETIME_MED_WITH_WEEKDAY(){return C}static get DATETIME_FULL(){return j}static get DATETIME_FULL_WITH_SECONDS(){return N}static get DATETIME_HUGE(){return V}static get DATETIME_HUGE_WITH_SECONDS(){return A}}function ni(q){if(yn.isDateTime(q))return q;if(q&&q.valueOf&&Mt(q.valueOf()))return yn.fromJSDate(q);if(q&&typeof q=="object")return yn.fromObject(q);throw new i(`Unknown datetime argument: ${q}, of type ${typeof q}`)}const py="3.7.2";return Ia.DateTime=yn,Ia.Duration=Gt,Ia.FixedOffsetZone=Ct,Ia.IANAZone=ne,Ia.Info=gr,Ia.Interval=ln,Ia.InvalidZone=yt,Ia.Settings=rn,Ia.SystemZone=re,Ia.VERSION=py,Ia.Zone=Y,Ia}var ZD;function tR(){return ZD||(ZD=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.CronDate=e.DAYS_IN_MONTH=e.DateMathOp=e.TimeUnit=void 0;const t=Kge();var n;(function(a){a.Second="Second",a.Minute="Minute",a.Hour="Hour",a.Day="Day",a.Month="Month",a.Year="Year"})(n||(e.TimeUnit=n={}));var r;(function(a){a.Add="Add",a.Subtract="Subtract"})(r||(e.DateMathOp=r={})),e.DAYS_IN_MONTH=Object.freeze([31,29,31,30,31,30,31,31,30,31,30,31]);class o{#e;#t=null;#n=null;constructor(i,l){const c={zone:l};if(i?i instanceof o?(this.#e=i.#e,this.#t=i.#t,this.#n=i.#n):i instanceof Date?this.#e=t.DateTime.fromJSDate(i,c):typeof i=="number"?this.#e=t.DateTime.fromMillis(i,c):(this.#e=t.DateTime.fromISO(i,c),this.#e.isValid||(this.#e=t.DateTime.fromRFC2822(i,c)),this.#e.isValid||(this.#e=t.DateTime.fromSQL(i,c)),this.#e.isValid||(this.#e=t.DateTime.fromFormat(i,"EEE, d MMM yyyy HH:mm:ss",c))):this.#e=t.DateTime.local(),!this.#e.isValid)throw new Error(`CronDate: unhandled timestamp: ${i}`);l&&l!==this.#e.zoneName&&(this.#e=this.#e.setZone(l))}static#o(i){return i%4===0&&i%100!==0||i%400===0}get dstStart(){return this.#t}set dstStart(i){this.#t=i}get dstEnd(){return this.#n}set dstEnd(i){this.#n=i}addYear(){this.#e=this.#e.plus({years:1})}addMonth(){this.#e=this.#e.plus({months:1}).startOf("month")}addDay(){this.#e=this.#e.plus({days:1}).startOf("day")}addHour(){this.#e=this.#e.plus({hours:1}).startOf("hour")}addMinute(){this.#e=this.#e.plus({minutes:1}).startOf("minute")}addSecond(){this.#e=this.#e.plus({seconds:1})}subtractYear(){this.#e=this.#e.minus({years:1})}subtractMonth(){this.#e=this.#e.minus({months:1}).endOf("month").startOf("second")}subtractDay(){this.#e=this.#e.minus({days:1}).endOf("day").startOf("second")}subtractHour(){this.#e=this.#e.minus({hours:1}).endOf("hour").startOf("second")}subtractMinute(){this.#e=this.#e.minus({minutes:1}).endOf("minute").startOf("second")}subtractSecond(){this.#e=this.#e.minus({seconds:1})}addUnit(i){switch(i){case n.Year:return this.addYear();case n.Month:return this.addMonth();case n.Day:return this.addDay();case n.Hour:return this.addHour();case n.Minute:return this.addMinute();case n.Second:return this.addSecond()}}subtractUnit(i){switch(i){case n.Year:return this.subtractYear();case n.Month:return this.subtractMonth();case n.Day:return this.subtractDay();case n.Hour:return this.subtractHour();case n.Minute:return this.subtractMinute();case n.Second:return this.subtractSecond()}}invokeDateOperation(i,l){if(i===r.Add){this.addUnit(l);return}if(i===r.Subtract){this.subtractUnit(l);return}throw new Error(`Invalid verb: ${i}`)}getDate(){return this.#e.day}getFullYear(){return this.#e.year}getDay(){const i=this.#e.weekday;return i===7?0:i}getMonth(){return this.#e.month-1}getHours(){return this.#e.hour}getMinutes(){return this.#e.minute}getSeconds(){return this.#e.second}getMilliseconds(){return this.#e.millisecond}getUTCOffset(){return this.#e.offset}setStartOfDay(){this.#e=this.#e.startOf("day")}setEndOfDay(){this.#e=this.#e.endOf("day")}getTime(){return this.#e.valueOf()}getUTCDate(){return this.#r().day}getUTCFullYear(){return this.#r().year}getUTCDay(){const i=this.#r().weekday;return i===7?0:i}getUTCMonth(){return this.#r().month-1}getUTCHours(){return this.#r().hour}getUTCMinutes(){return this.#r().minute}getUTCSeconds(){return this.#r().second}toISOString(){return this.#e.toUTC().toISO()}toJSON(){return this.#e.toJSON()}setDate(i){this.#e=this.#e.set({day:i})}setFullYear(i){this.#e=this.#e.set({year:i})}setDay(i){this.#e=this.#e.set({weekday:i})}setMonth(i){this.#e=this.#e.set({month:i+1})}setHours(i){this.#e=this.#e.set({hour:i})}setMinutes(i){this.#e=this.#e.set({minute:i})}setSeconds(i){this.#e=this.#e.set({second:i})}setMilliseconds(i){this.#e=this.#e.set({millisecond:i})}toString(){return this.toDate().toString()}toDate(){return this.#e.toJSDate()}isLastDayOfMonth(){const{day:i,month:l}=this.#e;if(l===2){const c=o.#o(this.#e.year);return i===e.DAYS_IN_MONTH[l-1]-(c?0:1)}return i===e.DAYS_IN_MONTH[l-1]}isLastWeekdayOfMonth(){const{day:i,month:l}=this.#e;let c;return l===2?c=e.DAYS_IN_MONTH[l-1]-(o.#o(this.#e.year)?0:1):c=e.DAYS_IN_MONTH[l-1],i>c-7}applyDateOperation(i,l,c){if(l===n.Month||l===n.Day){this.invokeDateOperation(i,l);return}const f=this.getHours();this.invokeDateOperation(i,l);const u=this.getHours(),h=u-f;h===2?c!==24&&(this.dstStart=f+1):h===0&&this.getMinutes()===0&&this.getSeconds()===0&&c!==24&&(this.dstEnd=u)}#r(){return this.#e.toUTC()}}e.CronDate=o,e.default=o})(QD)),QD}var JD;function Qge(){if(JD)return Rm;JD=1,Object.defineProperty(Rm,"__esModule",{value:!0}),Rm.CronMonth=void 0;const e=tR(),t=Pd(),n=1,r=12,o=Object.freeze([]);let a=class extends t.CronField{static get min(){return n}static get max(){return r}static get chars(){return o}static get daysInMonth(){return e.DAYS_IN_MONTH}constructor(i,l){super(i,l),this.validate()}get values(){return super.values}};return Rm.CronMonth=a,Rm}var Tm={},ej;function Xge(){if(ej)return Tm;ej=1,Object.defineProperty(Tm,"__esModule",{value:!0}),Tm.CronSecond=void 0;const e=Pd(),t=0,n=59,r=Object.freeze([]);let o=class extends e.CronField{static get min(){return t}static get max(){return n}static get chars(){return r}constructor(a,i){super(a,i),this.validate()}get values(){return super.values}};return Tm.CronSecond=o,Tm}var tj;function nR(){return tj||(tj=1,(function(e){var t=Ff&&Ff.__createBinding||(Object.create?(function(r,o,a,i){i===void 0&&(i=a);var l=Object.getOwnPropertyDescriptor(o,a);(!l||("get"in l?!o.__esModule:l.writable||l.configurable))&&(l={enumerable:!0,get:function(){return o[a]}}),Object.defineProperty(r,i,l)}):(function(r,o,a,i){i===void 0&&(i=a),r[i]=o[a]})),n=Ff&&Ff.__exportStar||function(r,o){for(var a in r)a!=="default"&&!Object.prototype.hasOwnProperty.call(o,a)&&t(o,r,a)};Object.defineProperty(e,"__esModule",{value:!0}),n(Hge(),e),n(qge(),e),n(Wge(),e),n(Pd(),e),n(Yge(),e),n(Gge(),e),n(Qge(),e),n(Xge(),e)})(Ff)),Ff}var nj;function bF(){if(nj)return xm;nj=1,Object.defineProperty(xm,"__esModule",{value:!0}),xm.CronFieldCollection=void 0;const e=nR();let t=class Bm{#e;#t;#n;#o;#r;#a;static from(r,o){return new Bm({second:this.resolveField(e.CronSecond,r.second,o.second),minute:this.resolveField(e.CronMinute,r.minute,o.minute),hour:this.resolveField(e.CronHour,r.hour,o.hour),dayOfMonth:this.resolveField(e.CronDayOfMonth,r.dayOfMonth,o.dayOfMonth),month:this.resolveField(e.CronMonth,r.month,o.month),dayOfWeek:this.resolveField(e.CronDayOfWeek,r.dayOfWeek,o.dayOfWeek)})}static resolveField(r,o,a){return a?a instanceof e.CronField?a:new r(a):o}constructor({second:r,minute:o,hour:a,dayOfMonth:i,month:l,dayOfWeek:c}){if(!r)throw new Error("Validation error, Field second is missing");if(!o)throw new Error("Validation error, Field minute is missing");if(!a)throw new Error("Validation error, Field hour is missing");if(!i)throw new Error("Validation error, Field dayOfMonth is missing");if(!l)throw new Error("Validation error, Field month is missing");if(!c)throw new Error("Validation error, Field dayOfWeek is missing");if(l.values.length===1&&!i.hasLastChar&&c.isWildcard&&!(parseInt(i.values[0],10)<=e.CronMonth.daysInMonth[l.values[0]-1]))throw new Error("Invalid explicit day of month definition");this.#e=r,this.#t=o,this.#n=a,this.#r=l,this.#a=c,this.#o=i}get second(){return this.#e}get minute(){return this.#t}get hour(){return this.#n}get dayOfMonth(){return this.#o}get month(){return this.#r}get dayOfWeek(){return this.#a}static compactField(r){if(r.length===0)return[];const o=[];let a;return r.forEach((i,l,c)=>{if(a===void 0){a={start:i,count:1};return}const f=c[l-1]||a.start,u=c[l+1];if(i==="L"||i==="W"){o.push(a),o.push({start:i,count:1}),a=void 0;return}if(a.step===void 0&&u!==void 0){const h=i-f,m=u-i;if(h<=m){a={...a,count:2,end:i,step:h};return}a.step=1}i-(a.end??0)===a.step?(a.count++,a.end=i):(a.count===1?o.push({start:a.start,count:1}):a.count===2?(o.push({start:a.start,count:1}),o.push({start:a.end??f,count:1})):o.push(a),a={start:i,count:1})}),a&&o.push(a),o}static#s(r,o,a){const i=o.step;return i?i===1&&o.start===r.min&&o.end&&o.end>=a?r.hasQuestionMarkChar?"?":"*":i!==1&&o.start===r.min&&o.end&&o.end>=a-i+1?`*/${i}`:null:null}static#i(r,o){const a=r.step;if(a===1)return`${r.start}-${r.end}`;const i=r.start===0?r.count-1:r.count;if(!a)throw new Error("Unexpected range step");if(!r.end)throw new Error("Unexpected range end");if(a*i>r.end){const l=(f,u)=>{if(typeof r.start!="number")throw new Error("Unexpected range start");return u%a===0?r.start+u:null};if(typeof r.start!="number")throw new Error("Unexpected range start");const c={length:r.end-r.start+1};return Array.from(c,l).filter(f=>f!==null).join(",")}return r.end===o-a+1?`${r.start}/${a}`:`${r.start}-${r.end}/${a}`}stringifyField(r){let o=r.max,a=r.values;if(r instanceof e.CronDayOfWeek){o=6;const l=this.#a.values;a=l[l.length-1]===7?l.slice(0,-1):l}r instanceof e.CronDayOfMonth&&(o=this.#r.values.length===1?e.CronMonth.daysInMonth[this.#r.values[0]-1]:r.max);const i=Bm.compactField(a);if(i.length===1){const l=Bm.#s(r,i[0],o);if(l)return l}return i.map(l=>{const c=l.count===1?l.start.toString():Bm.#i(l,o);return r instanceof e.CronDayOfWeek&&r.nthDay>0?`${c}#${r.nthDay}`:c}).join(",")}stringify(r=!1){const o=[];return r&&o.push(this.stringifyField(this.#e)),o.push(this.stringifyField(this.#t),this.stringifyField(this.#n),this.stringifyField(this.#o),this.stringifyField(this.#r),this.stringifyField(this.#a)),o.join(" ")}serialize(){return{second:this.#e.serialize(),minute:this.#t.serialize(),hour:this.#n.serialize(),dayOfMonth:this.#o.serialize(),month:this.#r.serialize(),dayOfWeek:this.#a.serialize()}}};return xm.CronFieldCollection=t,xm}var rj={},oj;function xF(){return oj||(oj=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.CronExpression=e.LOOPS_LIMIT_EXCEEDED_ERROR_MESSAGE=e.TIME_SPAN_OUT_OF_BOUNDS_ERROR_MESSAGE=void 0;const t=tR();e.TIME_SPAN_OUT_OF_BOUNDS_ERROR_MESSAGE="Out of the time span range",e.LOOPS_LIMIT_EXCEEDED_ERROR_MESSAGE="Invalid expression, loop limit exceeded";const n=1e4;class r{#e;#t;#n;#o;#r;#a;#s=null;#i=!1;constructor(a,i){this.#e=i,this.#t=i.tz,this.#o=i.startDate?new t.CronDate(i.startDate,this.#t):null,this.#r=i.endDate?new t.CronDate(i.endDate,this.#t):null;let l=i.currentDate??i.startDate;if(l){const c=new t.CronDate(l,this.#t);this.#o&&c.getTime()<this.#o.getTime()?l=this.#o:this.#r&&c.getTime()>this.#r.getTime()&&(l=this.#r)}this.#n=new t.CronDate(l,this.#t),this.#a=a}get fields(){return this.#a}static fieldsToExpression(a,i){return new r(a,i||{})}static#c(a,i){return i.some(l=>l===a)}#l(a,i){return a[i?a.length-1:0]}#d(a){const i=`${a.getFullYear()}-${a.getMonth()+1}-${a.getDate()}`;if(this.#s===i)return this.#i;const l=new t.CronDate(a);l.setStartOfDay();const c=new t.CronDate(a);return c.setEndOfDay(),this.#s=i,this.#i=l.getUTCOffset()!==c.getUTCOffset(),this.#i}#u(a,i,l){const c=this.#a.second.values,f=a.getSeconds(),u=this.#a.second.findNearestValue(f,l);if(u!==null){a.setSeconds(u);return}a.applyDateOperation(i,t.TimeUnit.Minute,this.#a.hour.values.length),a.setSeconds(this.#l(c,l))}#p(a,i,l){const c=this.#a.minute.values,f=this.#a.second.values,u=a.getMinutes(),h=this.#a.minute.findNearestValue(u,l);if(h!==null){a.setMinutes(h),a.setSeconds(this.#l(f,l));return}a.applyDateOperation(i,t.TimeUnit.Hour,this.#a.hour.values.length),a.setMinutes(this.#l(c,l)),a.setSeconds(this.#l(f,l))}static#f(a,i){const l=i.isLastWeekdayOfMonth();return a.some(c=>{const f=parseInt(c.toString().charAt(0),10)%7;if(Number.isNaN(f))throw new Error(`Invalid last weekday of the month expression: ${c}`);return i.getDay()===f&&l})}next(){return this.#h()}prev(){return this.#h(!0)}hasNext(){const a=this.#n;try{return this.#h(),!0}catch{return!1}finally{this.#n=a}}hasPrev(){const a=this.#n;try{return this.#h(!0),!0}catch{return!1}finally{this.#n=a}}take(a){const i=[];if(a>=0)for(let l=0;l<a;l++)try{i.push(this.next())}catch{return i}else for(let l=0;l>a;l--)try{i.push(this.prev())}catch{return i}return i}reset(a){this.#n=new t.CronDate(a||this.#e.currentDate,this.#t)}stringify(a=!1){return this.#a.stringify(a)}includesDate(a){const{second:i,minute:l,hour:c,month:f}=this.#a,u=new t.CronDate(a,this.#t);return!(!i.values.includes(u.getSeconds())||!l.values.includes(u.getMinutes())||!c.values.includes(u.getHours())||!f.values.includes(u.getMonth()+1)||!this.#m(u)||this.#a.dayOfWeek.nthDay>0&&Math.ceil(u.getDate()/7)!==this.#a.dayOfWeek.nthDay)}toString(){return this.#e.expression||this.stringify(!0)}#m(a){const i=this.#a.dayOfMonth.isWildcard,l=!i,c=this.#a.dayOfWeek.isWildcard,f=!c,u=r.#c(a.getDate(),this.#a.dayOfMonth.values)||this.#a.dayOfMonth.hasLastChar&&a.isLastDayOfMonth(),h=r.#c(a.getDay(),this.#a.dayOfWeek.values)||this.#a.dayOfWeek.hasLastChar&&r.#f(this.#a.dayOfWeek.values,a);return!!(l&&f&&(u||h)||u&&!f||i&&!c&&h)}#g(a,i,l){const c=this.#a.hour.values,f=c,u=a.getHours(),h=r.#c(u,c),m=a.dstEnd===u;if(a.dstStart!==null&&a.dstStart===u-1&&r.#c(a.dstStart,c))return!0;if(m&&!l)return a.dstEnd=null,a.applyDateOperation(t.DateMathOp.Add,t.TimeUnit.Hour,f.length),!1;if(h)return!0;a.dstStart=null;const v=this.#a.hour.findNearestValue(u,l);if(v===null)return a.applyDateOperation(i,t.TimeUnit.Day,f.length),!1;if(this.#d(a)){const b=l?u-v:v-u;for(let x=0;x<b&&(a.applyDateOperation(i,t.TimeUnit.Hour,f.length),!(!l&&a.getHours()>=v||l&&a.getHours()<=v));x++);}else a.setHours(v);return a.setMinutes(this.#l(this.#a.minute.values,l)),a.setSeconds(this.#l(this.#a.second.values,l)),!1}#y(a){if(!this.#o&&!this.#r)return;const i=a.getTime();if(this.#o&&i<this.#o.getTime())throw new Error(e.TIME_SPAN_OUT_OF_BOUNDS_ERROR_MESSAGE);if(this.#r&&i>this.#r.getTime())throw new Error(e.TIME_SPAN_OUT_OF_BOUNDS_ERROR_MESSAGE)}#h(a=!1){const i=a?t.DateMathOp.Subtract:t.DateMathOp.Add,l=new t.CronDate(this.#n),c=l.getTime();let f=0;for(;++f<n;){if(this.#y(l),!this.#m(l)){l.applyDateOperation(i,t.TimeUnit.Day,this.#a.hour.values.length);continue}if(!(this.#a.dayOfWeek.nthDay<=0||Math.ceil(l.getDate()/7)===this.#a.dayOfWeek.nthDay)){l.applyDateOperation(i,t.TimeUnit.Day,this.#a.hour.values.length);continue}if(!r.#c(l.getMonth()+1,this.#a.month.values)){l.applyDateOperation(i,t.TimeUnit.Month,this.#a.hour.values.length);continue}if(this.#g(l,i,a)){if(!r.#c(l.getMinutes(),this.#a.minute.values)){this.#p(l,i,a);continue}if(!r.#c(l.getSeconds(),this.#a.second.values)){this.#u(l,i,a);continue}if(c===l.getTime()){(i==="Add"||l.getMilliseconds()===0)&&l.applyDateOperation(i,t.TimeUnit.Second,this.#a.hour.values.length);continue}break}}if(f>n)throw new Error(e.LOOPS_LIMIT_EXCEEDED_ERROR_MESSAGE);return l.getMilliseconds()!==0&&l.setMilliseconds(0),this.#n=l,l}[Symbol.iterator](){return{next:()=>{try{return{value:this.#h(),done:!1}}catch{return{value:void 0,done:!0}}}}}}e.CronExpression=r,e.default=r})(rj)),rj}var Uv={},aj;function Zge(){if(aj)return Uv;aj=1,Object.defineProperty(Uv,"__esModule",{value:!0}),Uv.seededRandom=n;function e(r){let o=2166136261;for(let a=0;a<r.length;a++)o^=r.charCodeAt(a),o=Math.imul(o,16777619);return()=>o>>>0}function t(r){return()=>{let o=r+=1831565813;return o=Math.imul(o^o>>>15,o|1),o^=o+Math.imul(o^o>>>7,o|61),((o^o>>>14)>>>0)/4294967296}}function n(r){const o=r?e(r)():Math.floor(Math.random()*1e10);return t(o)}return Uv}var ij;function $C(){if(ij)return li;ij=1,Object.defineProperty(li,"__esModule",{value:!0}),li.CronExpressionParser=li.DayOfWeek=li.Months=li.CronUnit=li.PredefinedExpressions=void 0;const e=bF(),t=xF(),n=Zge(),r=nR();var o;(function(f){f["@yearly"]="0 0 0 1 1 *",f["@annually"]="0 0 0 1 1 *",f["@monthly"]="0 0 0 1 * *",f["@weekly"]="0 0 0 * * 0",f["@daily"]="0 0 0 * * *",f["@hourly"]="0 0 * * * *",f["@minutely"]="0 * * * * *",f["@secondly"]="* * * * * *",f["@weekdays"]="0 0 0 * * 1-5",f["@weekends"]="0 0 0 * * 0,6"})(o||(li.PredefinedExpressions=o={}));var a;(function(f){f.Second="Second",f.Minute="Minute",f.Hour="Hour",f.DayOfMonth="DayOfMonth",f.Month="Month",f.DayOfWeek="DayOfWeek"})(a||(li.CronUnit=a={}));var i;(function(f){f[f.jan=1]="jan",f[f.feb=2]="feb",f[f.mar=3]="mar",f[f.apr=4]="apr",f[f.may=5]="may",f[f.jun=6]="jun",f[f.jul=7]="jul",f[f.aug=8]="aug",f[f.sep=9]="sep",f[f.oct=10]="oct",f[f.nov=11]="nov",f[f.dec=12]="dec"})(i||(li.Months=i={}));var l;(function(f){f[f.sun=0]="sun",f[f.mon=1]="mon",f[f.tue=2]="tue",f[f.wed=3]="wed",f[f.thu=4]="thu",f[f.fri=5]="fri",f[f.sat=6]="sat"})(l||(li.DayOfWeek=l={}));let c=class ci{static parse(u,h={}){const{strict:m=!1,hashSeed:v}=h,b=(0,n.seededRandom)(v);u=o[u]||u;const x=ci.#e(u,m);if(!(x.dayOfMonth==="*"||x.dayOfWeek==="*"||!m))throw new Error("Cannot use both dayOfMonth and dayOfWeek together in strict mode!");const w=ci.#t(a.Second,x.second,r.CronSecond.constraints,b),S=ci.#t(a.Minute,x.minute,r.CronMinute.constraints,b),R=ci.#t(a.Hour,x.hour,r.CronHour.constraints,b),E=ci.#t(a.Month,x.month,r.CronMonth.constraints,b),M=ci.#t(a.DayOfMonth,x.dayOfMonth,r.CronDayOfMonth.constraints,b),{dayOfWeek:$,nthDayOfWeek:D}=ci.#d(x.dayOfWeek),F=ci.#t(a.DayOfWeek,$,r.CronDayOfWeek.constraints,b),I=new e.CronFieldCollection({second:new r.CronSecond(w,{rawValue:x.second}),minute:new r.CronMinute(S,{rawValue:x.minute}),hour:new r.CronHour(R,{rawValue:x.hour}),dayOfMonth:new r.CronDayOfMonth(M,{rawValue:x.dayOfMonth}),month:new r.CronMonth(E,{rawValue:x.month}),dayOfWeek:new r.CronDayOfWeek(F,{rawValue:x.dayOfWeek,nthDayOfWeek:D})});return new t.CronExpression(I,{...h,expression:u})}static#e(u,h){if(h&&!u.length)throw new Error("Invalid cron expression");u=u||"0 * * * * *";const m=u.trim().split(/\s+/);if(h&&m.length<6)throw new Error("Invalid cron expression, expected 6 fields");if(m.length>6)throw new Error("Invalid cron expression, too many fields");const v=["*","*","*","*","*","0"];m.length<v.length&&m.unshift(...v.slice(m.length));const[b,x,w,S,R,E]=m;return{second:b,minute:x,hour:w,dayOfMonth:S,month:R,dayOfWeek:E}}static#t(u,h,m,v){if((u===a.Month||u===a.DayOfWeek)&&(h=h.replace(/[a-z]{3}/gi,b=>{b=b.toLowerCase();const x=i[b]||l[b];if(x===void 0)throw new Error(`Validation error, cannot resolve alias "${b}"`);return x.toString()})),!m.validChars.test(h))throw new Error(`Invalid characters, got value: ${h}`);return h=this.#n(h,m),h=this.#o(h,m,v),this.#r(u,h,m)}static#n(u,h){return u.replace(/[*?]/g,h.min+"-"+h.max)}static#o(u,h,m){const v=m();return u.replace(/H(?:\((\d+)-(\d+)\))?(?:\/(\d+))?/g,(b,x,w,S)=>{if(x&&w&&S){const R=parseInt(x,10),E=parseInt(w,10),M=parseInt(S,10);if(R>E)throw new Error(`Invalid range: ${R}-${E}, min > max`);if(M<=0)throw new Error(`Invalid step: ${M}, must be positive`);const $=Math.max(R,h.min),D=Math.floor(v*M),F=[];for(let I=Math.floor($/M)*M+D;I<=E;I+=M)I>=$&&F.push(I);return F.join(",")}else if(x&&w){const R=parseInt(x,10),E=parseInt(w,10);if(R>E)throw new Error(`Invalid range: ${R}-${E}, min > max`);return String(Math.floor(v*(E-R+1))+R)}else if(S){const R=parseInt(S,10);if(R<=0)throw new Error(`Invalid step: ${R}, must be positive`);const E=Math.floor(v*R),M=[];for(let $=Math.floor(h.min/R)*R+E;$<=h.max;$+=R)$>=h.min&&M.push($);return M.join(",")}else return String(Math.floor(v*(h.max-h.min+1)+h.min))})}static#r(u,h,m){const v=[];function b(x,w){if(Array.isArray(x))v.push(...x);else if(ci.#u(w,x))v.push(x);else{const S=parseInt(x.toString(),10);if(!(S>=w.min&&S<=w.max))throw new Error(`Constraint error, got value ${x} expected range ${w.min}-${w.max}`);v.push(u===a.DayOfWeek?S%7:x)}}return h.split(",").forEach(x=>{if(!(x.length>0))throw new Error("Invalid list value format");b(ci.#a(u,x,m),m)}),v}static#a(u,h,m){const v=h.split("/");if(v.length>2)throw new Error(`Invalid repeat: ${h}`);return v.length===2?(v[0].includes("-")||(v[0]=`${v[0]}-${m.max}`),ci.#l(u,v[0],parseInt(v[1],10),m)):ci.#l(u,h,1,m)}static#s(u,h,m){if(!(!isNaN(u)&&!isNaN(h)&&u>=m.min&&h<=m.max))throw new Error(`Constraint error, got range ${u}-${h} expected range ${m.min}-${m.max}`);if(u>h)throw new Error(`Invalid range: ${u}-${h}, min(${u}) > max(${h})`)}static#i(u){if(!(!isNaN(u)&&u>0))throw new Error(`Constraint error, cannot repeat at every ${u} time.`)}static#c(u,h,m,v){const b=[];u===a.DayOfWeek&&m%7===0&&b.push(0);for(let x=h;x<=m;x+=v)b.indexOf(x)===-1&&b.push(x);return b}static#l(u,h,m,v){const b=h.split("-");if(b.length<=1)return isNaN(+h)?h:+h;const[x,w]=b.map(S=>parseInt(S,10));return this.#s(x,w,v),this.#i(m),this.#c(u,x,w,m)}static#d(u){const h=u.split("#");if(h.length<=1)return{dayOfWeek:h[0]};const m=+h[h.length-1],v=u.match(/([,-/])/);if(v!==null)throw new Error(`Constraint error, invalid dayOfWeek \`#\` and \`${v?.[0]}\` special characters are incompatible`);if(!(h.length<=2&&!isNaN(m)&&m>=1&&m<=5))throw new Error("Constraint error, invalid dayOfWeek occurrence number (#)");return{dayOfWeek:h[0],nthDayOfWeek:m}}static#u(u,h){return u.chars.some(m=>h.toString().includes(m))}};return li.CronExpressionParser=c,li}var Cs={};const Jge={},eye=Object.freeze(Object.defineProperty({__proto__:null,default:Jge},Symbol.toStringTag,{value:"Module"})),sj=jee(eye);var lj;function tye(){if(lj)return Cs;lj=1;var e=Cs&&Cs.__createBinding||(Object.create?(function(a,i,l,c){c===void 0&&(c=l);var f=Object.getOwnPropertyDescriptor(i,l);(!f||("get"in f?!i.__esModule:f.writable||f.configurable))&&(f={enumerable:!0,get:function(){return i[l]}}),Object.defineProperty(a,c,f)}):(function(a,i,l,c){c===void 0&&(c=l),a[c]=i[l]})),t=Cs&&Cs.__setModuleDefault||(Object.create?(function(a,i){Object.defineProperty(a,"default",{enumerable:!0,value:i})}):function(a,i){a.default=i}),n=Cs&&Cs.__importStar||(function(){var a=function(i){return a=Object.getOwnPropertyNames||function(l){var c=[];for(var f in l)Object.prototype.hasOwnProperty.call(l,f)&&(c[c.length]=f);return c},a(i)};return function(i){if(i&&i.__esModule)return i;var l={};if(i!=null)for(var c=a(i),f=0;f<c.length;f++)c[f]!=="default"&&e(l,i,c[f]);return t(l,i),l}})();Object.defineProperty(Cs,"__esModule",{value:!0}),Cs.CronFileParser=void 0;const r=$C();let o=class db{static async parseFile(i){const{readFile:l}=await Promise.resolve().then(()=>n(sj)),c=await l(i,"utf8");return db.#e(c)}static parseFileSync(i){const{readFileSync:l}=sj,c=l(i,"utf8");return db.#e(c)}static#e(i){const l=i.split(`
478
478
  `),c={variables:{},expressions:[],errors:{}};for(const f of l){const u=f.trim();if(u.length===0||u.startsWith("#"))continue;const h=u.match(/^(.*)=(.*)$/);if(h){const[,m,v]=h;c.variables[m]=v.replace(/["']/g,"");continue}try{const m=db.#t(u);c.expressions.push(m.interval)}catch(m){c.errors[u]=m}}return c}static#t(i){const l=i.split(" ");return{interval:r.CronExpressionParser.parse(l.slice(0,5).join(" ")),command:l.slice(5,l.length)}}};return Cs.CronFileParser=o,Cs}var cj;function nye(){return cj||(cj=1,(function(e){var t=zf&&zf.__createBinding||(Object.create?(function(f,u,h,m){m===void 0&&(m=h);var v=Object.getOwnPropertyDescriptor(u,h);(!v||("get"in v?!u.__esModule:v.writable||v.configurable))&&(v={enumerable:!0,get:function(){return u[h]}}),Object.defineProperty(f,m,v)}):(function(f,u,h,m){m===void 0&&(m=h),f[m]=u[h]})),n=zf&&zf.__exportStar||function(f,u){for(var h in f)h!=="default"&&!Object.prototype.hasOwnProperty.call(u,h)&&t(u,f,h)};Object.defineProperty(e,"__esModule",{value:!0}),e.CronFileParser=e.CronExpressionParser=e.CronExpression=e.CronFieldCollection=e.CronDate=void 0;const r=$C();var o=tR();Object.defineProperty(e,"CronDate",{enumerable:!0,get:function(){return o.CronDate}});var a=bF();Object.defineProperty(e,"CronFieldCollection",{enumerable:!0,get:function(){return a.CronFieldCollection}});var i=xF();Object.defineProperty(e,"CronExpression",{enumerable:!0,get:function(){return i.CronExpression}});var l=$C();Object.defineProperty(e,"CronExpressionParser",{enumerable:!0,get:function(){return l.CronExpressionParser}});var c=tye();Object.defineProperty(e,"CronFileParser",{enumerable:!0,get:function(){return c.CronFileParser}}),n(nR(),e),e.default=r.CronExpressionParser})(zf)),zf}var rye=nye(),uj={exports:{}},dj;function oye(){return dj||(dj=1,(function(e,t){(function(n,r){e.exports=r()})(globalThis,()=>(()=>{var n={949:((i,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.CronParser=void 0;var f=c(515),u=(function(){function h(m,v,b){v===void 0&&(v=!0),b===void 0&&(b=!1),this.expression=m,this.dayOfWeekStartIndexZero=v,this.monthStartIndexZero=b}return h.prototype.parse=function(){var m,v,b=(m=this.expression)!==null&&m!==void 0?m:"";if(b==="@reboot")return v=["@reboot","","","","","",""],v;if(b.startsWith("@")){var x=this.parseSpecial(this.expression);v=this.extractParts(x)}else v=this.extractParts(this.expression);return this.normalize(v),this.validate(v),v},h.prototype.parseSpecial=function(m){var v={"@yearly":"0 0 1 1 *","@annually":"0 0 1 1 *","@monthly":"0 0 1 * *","@weekly":"0 0 * * 0","@daily":"0 0 * * *","@midnight":"0 0 * * *","@hourly":"0 * * * *","@reboot":"@reboot"},b=v[m];if(!b)throw new Error("Unknown special expression.");return b},h.prototype.extractParts=function(m){if(!this.expression)throw new Error("cron expression is empty");for(var v=m.trim().split(/[ ]+/),b=0;b<v.length;b++)if(v[b].includes(",")){var x=v[b].split(",").map(function(S){return S.trim()}).filter(function(S){return S!==""}).map(function(S){return isNaN(Number(S))?S:Number(S)}).filter(function(S){return S!==null&&S!==""});x.length===0&&x.push("*"),x.sort(function(S,R){return S!==null&&R!==null?S-R:0}),v[b]=x.map(function(S){return S!==null?S.toString():""}).join(",")}if(v.length<5)throw new Error("Expression has only ".concat(v.length," part").concat(v.length==1?"":"s",". At least 5 parts are required."));if(v.length==5)v.unshift(""),v.push("");else if(v.length==6){var w=/\d{4}$/.test(v[5])||v[4]=="?"||v[2]=="?";w?v.unshift(""):v.push("")}else if(v.length>7)throw new Error("Expression has ".concat(v.length," parts; too many!"));return v},h.prototype.normalize=function(m){var v=this;if(m[3]=m[3].replace("?","*"),m[5]=m[5].replace("?","*"),m[2]=m[2].replace("?","*"),m[0].indexOf("0/")==0&&(m[0]=m[0].replace("0/","*/")),m[1].indexOf("0/")==0&&(m[1]=m[1].replace("0/","*/")),m[2].indexOf("0/")==0&&(m[2]=m[2].replace("0/","*/")),m[3].indexOf("1/")==0&&(m[3]=m[3].replace("1/","*/")),m[4].indexOf("1/")==0&&(m[4]=m[4].replace("1/","*/")),m[6].indexOf("1/")==0&&(m[6]=m[6].replace("1/","*/")),m[5]=m[5].replace(/(^\d)|([^#/\s]\d)/g,function($){var D=$.replace(/\D/,""),F=D;return v.dayOfWeekStartIndexZero?D=="7"&&(F="0"):F=(parseInt(D)-1).toString(),$.replace(D,F)}),m[5]=="L"&&(m[5]="6"),m[3]=="?"&&(m[3]="*"),m[3].indexOf("W")>-1&&(m[3].indexOf(",")>-1||m[3].indexOf("-")>-1))throw new Error("The 'W' character can be specified only when the day-of-month is a single day, not a range or list of days.");var b={SUN:0,MON:1,TUE:2,WED:3,THU:4,FRI:5,SAT:6};for(var x in b)m[5]=m[5].replace(new RegExp(x,"gi"),b[x].toString());m[4]=m[4].replace(/(^\d{1,2})|([^#/\s]\d{1,2})/g,function($){var D=$.replace(/\D/,""),F=D;return v.monthStartIndexZero&&(F=(parseInt(D)+1).toString()),$.replace(D,F)});var w={JAN:1,FEB:2,MAR:3,APR:4,MAY:5,JUN:6,JUL:7,AUG:8,SEP:9,OCT:10,NOV:11,DEC:12};for(var S in w)m[4]=m[4].replace(new RegExp(S,"gi"),w[S].toString());m[0]=="0"&&(m[0]=""),!/\*|\-|\,|\//.test(m[2])&&(/\*|\//.test(m[1])||/\*|\//.test(m[0]))&&(m[2]+="-".concat(m[2]));for(var R=0;R<m.length;R++)if(m[R].indexOf(",")!=-1&&(m[R]=m[R].split(",").filter(function($){return $!==""}).join(",")||"*"),m[R]=="*/1"&&(m[R]="*"),m[R].indexOf("/")>-1&&!/^\*|\-|\,/.test(m[R])){var E=null;switch(R){case 4:E="12";break;case 5:E="6";break;case 6:E="9999";break;default:E=null;break}if(E!==null){var M=m[R].split("/");m[R]="".concat(M[0],"-").concat(E,"/").concat(M[1])}}},h.prototype.validate=function(m){var v="0-9,\\-*/";this.validateOnlyExpectedCharactersFound(m[0],v),this.validateOnlyExpectedCharactersFound(m[1],v),this.validateOnlyExpectedCharactersFound(m[2],v),this.validateOnlyExpectedCharactersFound(m[3],"0-9,\\-*/LW"),this.validateOnlyExpectedCharactersFound(m[4],v),this.validateOnlyExpectedCharactersFound(m[5],"0-9,\\-*/L#"),this.validateOnlyExpectedCharactersFound(m[6],v),this.validateAnyRanges(m)},h.prototype.validateAnyRanges=function(m){f.default.secondRange(m[0]),f.default.minuteRange(m[1]),f.default.hourRange(m[2]),f.default.dayOfMonthRange(m[3]),f.default.monthRange(m[4],this.monthStartIndexZero),f.default.dayOfWeekRange(m[5],this.dayOfWeekStartIndexZero)},h.prototype.validateOnlyExpectedCharactersFound=function(m,v){var b=m.match(new RegExp("[^".concat(v,"]+"),"gi"));if(b&&b.length)throw new Error("Expression contains invalid values: '".concat(b.toString(),"'"))},h})();l.CronParser=u}),333:((i,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.ExpressionDescriptor=void 0;var f=c(823),u=c(949),h=(function(){function m(v,b){if(this.expression=v,this.options=b,this.expressionParts=new Array(5),!this.options.locale&&m.defaultLocale&&(this.options.locale=m.defaultLocale),!m.locales[this.options.locale]){var x=Object.keys(m.locales)[0];console.warn("Locale '".concat(this.options.locale,"' could not be found; falling back to '").concat(x,"'.")),this.options.locale=x}this.i18n=m.locales[this.options.locale],b.use24HourTimeFormat===void 0&&(b.use24HourTimeFormat=this.i18n.use24HourTimeFormatByDefault())}return m.toString=function(v,b){var x=b===void 0?{}:b,w=x.throwExceptionOnParseError,S=w===void 0?!0:w,R=x.verbose,E=R===void 0?!1:R,M=x.dayOfWeekStartIndexZero,$=M===void 0?!0:M,D=x.monthStartIndexZero,F=D===void 0?!1:D,I=x.use24HourTimeFormat,U=x.locale,z=U===void 0?null:U,L={throwExceptionOnParseError:S,verbose:E,dayOfWeekStartIndexZero:$,monthStartIndexZero:F,use24HourTimeFormat:I,locale:z};L.tzOffset&&console.warn("'tzOffset' option has been deprecated and is no longer supported.");var C=new m(v,L);return C.getFullDescription()},m.initialize=function(v,b){b===void 0&&(b="en"),m.specialCharacters=["/","-",",","*"],m.defaultLocale=b,v.load(m.locales)},m.prototype.getFullDescription=function(){var v,b,x="";try{var w=new u.CronParser(this.expression,this.options.dayOfWeekStartIndexZero,this.options.monthStartIndexZero);if(this.expressionParts=w.parse(),this.expressionParts[0]==="@reboot")return((b=(v=this.i18n).atReboot)===null||b===void 0?void 0:b.call(v))||"Run once, at startup";var S=this.getTimeOfDayDescription(),R=this.getDayOfMonthDescription(),E=this.getMonthDescription(),M=this.getDayOfWeekDescription(),$=this.getYearDescription();x+=S+R+M+E+$,x=this.transformVerbosity(x,!!this.options.verbose),x=x.charAt(0).toLocaleUpperCase()+x.substr(1)}catch(D){if(!this.options.throwExceptionOnParseError)x=this.i18n.anErrorOccuredWhenGeneratingTheExpressionD();else throw"".concat(D)}return x},m.prototype.getTimeOfDayDescription=function(){var v=this.expressionParts[0],b=this.expressionParts[1],x=this.expressionParts[2],w="";if(!f.StringUtilities.containsAny(b,m.specialCharacters)&&!f.StringUtilities.containsAny(x,m.specialCharacters)&&!f.StringUtilities.containsAny(v,m.specialCharacters))w+=this.i18n.atSpace()+this.formatTime(x,b,v);else if(!v&&b.indexOf("-")>-1&&!(b.indexOf(",")>-1)&&!(b.indexOf("/")>-1)&&!f.StringUtilities.containsAny(x,m.specialCharacters)){var S=b.split("-");w+=f.StringUtilities.format(this.i18n.everyMinuteBetweenX0AndX1(),this.formatTime(x,S[0],""),this.formatTime(x,S[1],""))}else if(!v&&x.indexOf(",")>-1&&x.indexOf("-")==-1&&x.indexOf("/")==-1&&!f.StringUtilities.containsAny(b,m.specialCharacters)){var R=x.split(",");w+=this.i18n.at();for(var E=0;E<R.length;E++)w+=" ",w+=this.formatTime(R[E],b,""),E<R.length-2&&(w+=","),E==R.length-2&&(w+=this.i18n.spaceAnd())}else{var M=this.getSecondsDescription(),$=this.getMinutesDescription(),D=this.getHoursDescription();if(w+=M,w&&$&&(w+=", "),w+=$,$===D)return w;w&&D&&(w+=", "),w+=D}return w},m.prototype.getSecondsDescription=function(){var v=this,b=this.getSegmentDescription(this.expressionParts[0],this.i18n.everySecond(),function(x){return x},function(x){return f.StringUtilities.format(v.i18n.everyX0Seconds(x),x)},function(x){return v.i18n.secondsX0ThroughX1PastTheMinute()},function(x){return x=="0"?"":parseInt(x)<20?v.i18n.atX0SecondsPastTheMinute(x):v.i18n.atX0SecondsPastTheMinuteGt20()||v.i18n.atX0SecondsPastTheMinute(x)});return b},m.prototype.getMinutesDescription=function(){var v=this,b=this.expressionParts[0],x=this.expressionParts[2],w=this.getSegmentDescription(this.expressionParts[1],this.i18n.everyMinute(),function(S){return S},function(S){return f.StringUtilities.format(v.i18n.everyX0Minutes(S),S)},function(S){return v.i18n.minutesX0ThroughX1PastTheHour()},function(S){try{return S=="0"&&x.indexOf("/")==-1&&b==""?v.i18n.everyHour():parseInt(S)<20?v.i18n.atX0MinutesPastTheHour(S):v.i18n.atX0MinutesPastTheHourGt20()||v.i18n.atX0MinutesPastTheHour(S)}catch{return v.i18n.atX0MinutesPastTheHour(S)}});return w},m.prototype.getHoursDescription=function(){var v=this,b=this.expressionParts[2],x=0,w=[];b.split("/")[0].split(",").forEach(function(E){var M=E.split("-");M.length===2&&w.push({value:M[1],index:x+1}),x+=M.length});var S=0,R=this.getSegmentDescription(b,this.i18n.everyHour(),function(E){var M=w.find(function(D){return D.value===E&&D.index===S}),$=M&&v.expressionParts[1]!=="0";return S++,$?v.formatTime(E,"59",""):v.formatTime(E,"0","")},function(E){return f.StringUtilities.format(v.i18n.everyX0Hours(E),E)},function(E){return v.i18n.betweenX0AndX1()},function(E){return v.i18n.atX0()});return R},m.prototype.getDayOfWeekDescription=function(){var v=this,b=this.i18n.daysOfTheWeek(),x=null;return this.expressionParts[5]=="*"?x="":x=this.getSegmentDescription(this.expressionParts[5],this.i18n.commaEveryDay(),function(w,S){var R=w;w.indexOf("#")>-1?R=w.substring(0,w.indexOf("#")):w.indexOf("L")>-1&&(R=R.replace("L",""));var E=parseInt(R),M=v.i18n.daysOfTheWeekInCase?v.i18n.daysOfTheWeekInCase(S)[E]:b[E];if(w.indexOf("#")>-1){var $=null,D=w.substring(w.indexOf("#")+1),F=w.substring(0,w.indexOf("#"));switch(D){case"1":$=v.i18n.first(F);break;case"2":$=v.i18n.second(F);break;case"3":$=v.i18n.third(F);break;case"4":$=v.i18n.fourth(F);break;case"5":$=v.i18n.fifth(F);break}M=$+" "+M}return M},function(w){return parseInt(w)==1?"":f.StringUtilities.format(v.i18n.commaEveryX0DaysOfTheWeek(w),w)},function(w){var S=w.substring(0,w.indexOf("-")),R=v.expressionParts[3]!="*";return R?v.i18n.commaAndX0ThroughX1(S):v.i18n.commaX0ThroughX1(S)},function(w){var S=null;if(w.indexOf("#")>-1){var R=w.substring(w.indexOf("#")+1),E=w.substring(0,w.indexOf("#"));S=v.i18n.commaOnThe(R,E).trim()+v.i18n.spaceX0OfTheMonth()}else if(w.indexOf("L")>-1)S=v.i18n.commaOnTheLastX0OfTheMonth(w.replace("L",""));else{var M=v.expressionParts[3]!="*";S=M?v.i18n.commaAndOnX0():v.i18n.commaOnlyOnX0(w)}return S}),x},m.prototype.getMonthDescription=function(){var v=this,b=this.i18n.monthsOfTheYear(),x=this.getSegmentDescription(this.expressionParts[4],"",function(w,S){return S&&v.i18n.monthsOfTheYearInCase?v.i18n.monthsOfTheYearInCase(S)[parseInt(w)-1]:b[parseInt(w)-1]},function(w){return parseInt(w)==1?"":f.StringUtilities.format(v.i18n.commaEveryX0Months(w),w)},function(w){return v.i18n.commaMonthX0ThroughMonthX1()||v.i18n.commaX0ThroughX1()},function(w){return v.i18n.commaOnlyInMonthX0?v.i18n.commaOnlyInMonthX0():v.i18n.commaOnlyInX0()});return x},m.prototype.getDayOfMonthDescription=function(){var v=this,b=null,x=this.expressionParts[3];switch(x){case"L":b=this.i18n.commaOnTheLastDayOfTheMonth();break;case"WL":case"LW":b=this.i18n.commaOnTheLastWeekdayOfTheMonth();break;default:var w=x.match(/(\d{1,2}W)|(W\d{1,2})/);if(w){var S=parseInt(w[0].replace("W","")),R=S==1?this.i18n.firstWeekday():f.StringUtilities.format(this.i18n.weekdayNearestDayX0(),S.toString());b=f.StringUtilities.format(this.i18n.commaOnTheX0OfTheMonth(),R);break}else{var E=x.match(/L-(\d{1,2})/);if(E){var M=E[1];b=f.StringUtilities.format(this.i18n.commaDaysBeforeTheLastDayOfTheMonth(M),M);break}else{if(x=="*"&&this.expressionParts[5]!="*")return"";b=this.getSegmentDescription(x,this.i18n.commaEveryDay(),function($){return $=="L"?v.i18n.lastDay():v.i18n.dayX0?f.StringUtilities.format(v.i18n.dayX0(),$):$},function($){return $=="1"?v.i18n.commaEveryDay():v.i18n.commaEveryX0Days($)},function($){return v.i18n.commaBetweenDayX0AndX1OfTheMonth($)},function($){return v.i18n.commaOnDayX0OfTheMonth($)})}break}}return b},m.prototype.getYearDescription=function(){var v=this,b=this.getSegmentDescription(this.expressionParts[6],"",function(x){return/^\d+$/.test(x)?new Date(parseInt(x),1).getFullYear().toString():x},function(x){return f.StringUtilities.format(v.i18n.commaEveryX0Years(x),x)},function(x){return v.i18n.commaYearX0ThroughYearX1()||v.i18n.commaX0ThroughX1()},function(x){return v.i18n.commaOnlyInYearX0?v.i18n.commaOnlyInYearX0():v.i18n.commaOnlyInX0()});return b},m.prototype.getSegmentDescription=function(v,b,x,w,S,R){var E=null,M=v.indexOf("/")>-1,$=v.indexOf("-")>-1,D=v.indexOf(",")>-1;if(!v)E="";else if(v==="*")E=b;else if(!M&&!$&&!D)E=f.StringUtilities.format(R(v),x(v));else if(D){for(var F=v.split(","),I="",U=0;U<F.length;U++)if(U>0&&F.length>2&&(I+=",",U<F.length-1&&(I+=" ")),U>0&&F.length>1&&(U==F.length-1||F.length==2)&&(I+="".concat(this.i18n.spaceAnd()," ")),F[U].indexOf("/")>-1||F[U].indexOf("-")>-1){var z=F[U].indexOf("-")>-1&&F[U].indexOf("/")==-1,L=this.getSegmentDescription(F[U],b,x,w,z?this.i18n.commaX0ThroughX1:S,R);z&&(L=L.replace(", ","")),I+=L}else M?I+=this.getSegmentDescription(F[U],b,x,w,S,R):I+=x(F[U]);M?E=I:E=f.StringUtilities.format(R(v),I)}else if(M){var F=v.split("/");if(E=f.StringUtilities.format(w(F[1]),F[1]),F[0].indexOf("-")>-1){var C=this.generateRangeSegmentDescription(F[0],S,x);C.indexOf(", ")!=0&&(E+=", "),E+=C}else if(F[0].indexOf("*")==-1){var j=f.StringUtilities.format(R(F[0]),x(F[0]));j=j.replace(", ",""),E+=f.StringUtilities.format(this.i18n.commaStartingX0(),j)}}else $&&(E=this.generateRangeSegmentDescription(v,S,x));return E},m.prototype.generateRangeSegmentDescription=function(v,b,x){var w="",S=v.split("-"),R=x(S[0],1),E=x(S[1],2),M=b(v);return w+=f.StringUtilities.format(M,R,E),w},m.prototype.formatTime=function(v,b,x){var w=0,S=0,R=parseInt(v)+w,E=parseInt(b)+S;E>=60?(E-=60,R+=1):E<0&&(E+=60,R-=1),R>=24?R=R-24:R<0&&(R=24+R);var M="",$=!1;this.options.use24HourTimeFormat||($=!!(this.i18n.setPeriodBeforeTime&&this.i18n.setPeriodBeforeTime()),M=$?"".concat(this.getPeriod(R)," "):" ".concat(this.getPeriod(R)),R>12&&(R-=12),R===0&&(R=12));var D="";return x&&(D=":".concat(("00"+x).substring(x.length))),"".concat($?M:"").concat(("00"+R.toString()).substring(R.toString().length),":").concat(("00"+E.toString()).substring(E.toString().length)).concat(D).concat($?"":M)},m.prototype.transformVerbosity=function(v,b){if(!b&&(v=v.replace(new RegExp(", ".concat(this.i18n.everyMinute()),"g"),""),v=v.replace(new RegExp(", ".concat(this.i18n.everyHour()),"g"),""),v=v.replace(new RegExp(this.i18n.commaEveryDay(),"g"),""),v=v.replace(/\, ?$/,""),this.i18n.conciseVerbosityReplacements))for(var x=0,w=Object.entries(this.i18n.conciseVerbosityReplacements());x<w.length;x++){var S=w[x],R=S[0],E=S[1];v=v.replace(new RegExp(R,"g"),E)}return v},m.prototype.getPeriod=function(v){return v>=12?this.i18n.pm&&this.i18n.pm()||"PM":this.i18n.am&&this.i18n.am()||"AM"},m.locales={},m})();l.ExpressionDescriptor=h}),747:((i,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.enLocaleLoader=void 0;var f=c(486),u=(function(){function h(){}return h.prototype.load=function(m){m.en=new f.en},h})();l.enLocaleLoader=u}),486:((i,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.en=void 0;var c=(function(){function f(){}return f.prototype.atX0SecondsPastTheMinuteGt20=function(){return null},f.prototype.atX0MinutesPastTheHourGt20=function(){return null},f.prototype.commaMonthX0ThroughMonthX1=function(){return null},f.prototype.commaYearX0ThroughYearX1=function(){return null},f.prototype.use24HourTimeFormatByDefault=function(){return!1},f.prototype.anErrorOccuredWhenGeneratingTheExpressionD=function(){return"An error occurred when generating the expression description. Check the cron expression syntax."},f.prototype.everyMinute=function(){return"every minute"},f.prototype.everyHour=function(){return"every hour"},f.prototype.atSpace=function(){return"At "},f.prototype.everyMinuteBetweenX0AndX1=function(){return"Every minute between %s and %s"},f.prototype.at=function(){return"At"},f.prototype.spaceAnd=function(){return" and"},f.prototype.everySecond=function(){return"every second"},f.prototype.everyX0Seconds=function(){return"every %s seconds"},f.prototype.secondsX0ThroughX1PastTheMinute=function(){return"seconds %s through %s past the minute"},f.prototype.atX0SecondsPastTheMinute=function(){return"at %s seconds past the minute"},f.prototype.everyX0Minutes=function(){return"every %s minutes"},f.prototype.minutesX0ThroughX1PastTheHour=function(){return"minutes %s through %s past the hour"},f.prototype.atX0MinutesPastTheHour=function(){return"at %s minutes past the hour"},f.prototype.everyX0Hours=function(){return"every %s hours"},f.prototype.betweenX0AndX1=function(){return"between %s and %s"},f.prototype.atX0=function(){return"at %s"},f.prototype.commaEveryDay=function(){return", every day"},f.prototype.commaEveryX0DaysOfTheWeek=function(){return", every %s days of the week"},f.prototype.commaX0ThroughX1=function(){return", %s through %s"},f.prototype.commaAndX0ThroughX1=function(){return", %s through %s"},f.prototype.first=function(){return"first"},f.prototype.second=function(){return"second"},f.prototype.third=function(){return"third"},f.prototype.fourth=function(){return"fourth"},f.prototype.fifth=function(){return"fifth"},f.prototype.commaOnThe=function(){return", on the "},f.prototype.spaceX0OfTheMonth=function(){return" %s of the month"},f.prototype.lastDay=function(){return"the last day"},f.prototype.commaOnTheLastX0OfTheMonth=function(){return", on the last %s of the month"},f.prototype.commaOnlyOnX0=function(){return", only on %s"},f.prototype.commaAndOnX0=function(){return", and on %s"},f.prototype.commaEveryX0Months=function(){return", every %s months"},f.prototype.commaOnlyInX0=function(){return", only in %s"},f.prototype.commaOnTheLastDayOfTheMonth=function(){return", on the last day of the month"},f.prototype.commaOnTheLastWeekdayOfTheMonth=function(){return", on the last weekday of the month"},f.prototype.commaDaysBeforeTheLastDayOfTheMonth=function(){return", %s days before the last day of the month"},f.prototype.firstWeekday=function(){return"first weekday"},f.prototype.weekdayNearestDayX0=function(){return"weekday nearest day %s"},f.prototype.commaOnTheX0OfTheMonth=function(){return", on the %s of the month"},f.prototype.commaEveryX0Days=function(){return", every %s days"},f.prototype.commaBetweenDayX0AndX1OfTheMonth=function(){return", between day %s and %s of the month"},f.prototype.commaOnDayX0OfTheMonth=function(){return", on day %s of the month"},f.prototype.commaEveryHour=function(){return", every hour"},f.prototype.commaEveryX0Years=function(){return", every %s years"},f.prototype.commaStartingX0=function(){return", starting %s"},f.prototype.daysOfTheWeek=function(){return["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},f.prototype.monthsOfTheYear=function(){return["January","February","March","April","May","June","July","August","September","October","November","December"]},f.prototype.atReboot=function(){return"Run once, at startup"},f})();l.en=c}),515:((i,l)=>{Object.defineProperty(l,"__esModule",{value:!0});function c(u,h){if(!u)throw new Error(h)}var f=(function(){function u(){}return u.secondRange=function(h){for(var m=h.split(","),v=0;v<m.length;v++)if(!isNaN(parseInt(m[v],10))){var b=parseInt(m[v],10);c(b>=0&&b<=59,"seconds part must be >= 0 and <= 59")}},u.minuteRange=function(h){for(var m=h.split(","),v=0;v<m.length;v++)if(!isNaN(parseInt(m[v],10))){var b=parseInt(m[v],10);c(b>=0&&b<=59,"minutes part must be >= 0 and <= 59")}},u.hourRange=function(h){for(var m=h.split(","),v=0;v<m.length;v++)if(!isNaN(parseInt(m[v],10))){var b=parseInt(m[v],10);c(b>=0&&b<=23,"hours part must be >= 0 and <= 23")}},u.dayOfMonthRange=function(h){for(var m=h.split(","),v=0;v<m.length;v++)if(!isNaN(parseInt(m[v],10))){var b=parseInt(m[v],10);c(b>=1&&b<=31,"DOM part must be >= 1 and <= 31")}},u.monthRange=function(h,m){for(var v=h.split(","),b=0;b<v.length;b++)if(!isNaN(parseInt(v[b],10))){var x=parseInt(v[b],10);c(x>=1&&x<=12,m?"month part must be >= 0 and <= 11":"month part must be >= 1 and <= 12")}},u.dayOfWeekRange=function(h,m){for(var v=h.split(","),b=0;b<v.length;b++)if(!isNaN(parseInt(v[b],10))){var x=parseInt(v[b],10);c(x>=0&&x<=6,m?"DOW part must be >= 0 and <= 6":"DOW part must be >= 1 and <= 7")}},u})();l.default=f}),823:((i,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.StringUtilities=void 0;var c=(function(){function f(){}return f.format=function(u){for(var h=[],m=1;m<arguments.length;m++)h[m-1]=arguments[m];return u.replace(/%s/g,function(v){return h.shift()})},f.containsAny=function(u,h){return h.some(function(m){return u.indexOf(m)>-1})},f})();l.StringUtilities=c})},r={};function o(i){var l=r[i];if(l!==void 0)return l.exports;var c=r[i]={exports:{}};return n[i](c,c.exports,o),c.exports}var a={};return(()=>{var i=a;Object.defineProperty(i,"__esModule",{value:!0}),i.toString=void 0;var l=o(333),c=o(747);l.ExpressionDescriptor.initialize(new c.enLocaleLoader),i.default=l.ExpressionDescriptor;var f=l.ExpressionDescriptor.toString;i.toString=f})(),a})())})(uj)),uj.exports}var aye=oye();const iye=Jl(aye),sye=new Set(["JAN","FEB","MAR","APR","MAY","JUN","JUL","AUG","SEP","OCT","NOV","DEC","SUN","MON","TUE","WED","THU","FRI","SAT"]);function lye(e){for(const t of e.trim().split(/\s+/)){if(/[#?]/.test(t))return!1;for(const n of t.split(/[,\-/]/))if(!(n===""||n==="*")&&/[A-Za-z]/.test(n)&&!sye.has(n.toUpperCase()))return!1}return!0}function SF(e){const t=(e??"").trim();if(t.split(/\s+/).filter(Boolean).length!==5)return{valid:!1,description:"",nextRun:null,error:"Expected a 5-field UNIX cron: minute hour day-of-month month day-of-week."};if(!lye(t))return{valid:!1,description:"",nextRun:null,error:"Unsupported cron syntax: L, W, #, and ? extensions are not allowed (plain 5-field UNIX cron only)."};try{const n=iye.toString(t,{use24HourTimeFormat:!0,verbose:!1}),r=rye.CronExpressionParser.parse(t,{tz:"UTC"}).next().toDate();return{valid:!0,description:n,nextRun:r}}catch(n){return{valid:!1,description:"",nextRun:null,error:n instanceof Error?n.message:"Invalid cron expression."}}}function wF(e){return e?e.toLocaleString(void 0,{year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit",timeZone:"UTC",hour12:!1})+" UTC":"—"}function cye({onSubmit:e,isSubmitting:t,disabled:n,disabledReason:r}){const[o,a]=k.useState(!1),[i,l]=k.useState(!1),c=()=>a(!1),f=async()=>{try{await e({forceRefresh:i}),a(!1)}catch{}},u=g.jsx("span",{children:g.jsx(tx,{label:"Materialization",onClick:()=>a(!0),disabled:n})});return g.jsxs(g.Fragment,{children:[n&&r?g.jsx(Zi,{title:r,children:u}):u,g.jsx(Yo,{open:o,onClose:c,title:"New materialization",description:"Compile the package, build a table for every persist source, and load them so queries serve from the tables.",actions:g.jsxs(g.Fragment,{children:[g.jsx(eo,{onClick:c,children:"Cancel"}),g.jsx(eo,{variant:"contained",loading:t,onClick:f,children:"Materialize"})]}),children:g.jsx(E7,{children:g.jsx(Dk,{control:g.jsx($I,{checked:i,onChange:h=>l(h.target.checked)}),label:"Force refresh (rebuild even if unchanged)"})})})]})}function fb({children:e}){return g.jsx(It,{variant:"caption",component:"h6",sx:{display:"block",textTransform:"uppercase",letterSpacing:"0.06em",fontWeight:600,color:"text.secondary",mb:1},children:e})}function Yb(e){return e===wa.Pending||e===wa.ManifestRowsReady}function uye(e){return e===wa.ManifestFileReady||e===wa.Failed||e===wa.Cancelled}function CF(e){switch(e){case wa.ManifestFileReady:return"Done";case wa.Failed:return"Failed";case wa.Cancelled:return"Cancelled";case wa.Pending:case wa.ManifestRowsReady:return"Pending";default:return"Unknown"}}function PC(e){switch(e){case wa.ManifestRowsReady:return"info";case wa.ManifestFileReady:return"success";case wa.Failed:return"error";case wa.Cancelled:return"warning";case wa.Pending:default:return"default"}}function dye(e){const t=Object.values(rR(e).refusedSources??{}).map(r=>({name:r.name,message:r.message})),n=Object.values(e.manifest?.failures??{}).filter(r=>r.refused).map(r=>({name:r.sourceName??r.sourceEntityId,message:r.reason}));return[...t,...n].sort((r,o)=>r.name.localeCompare(o.name))}function kF(e,t){const n=[`${e.sourcesBuilt??0} built`,`${e.sourcesReused??0} reused`];return e.sourcesRefused&&n.push(`${e.sourcesRefused} refused`),n.join(t)}function rR(e){return e.metadata??{}}function fye(e){return e.trigger==="SCHEDULER"?"Scheduled":"Manual"}function EF(e,t){if(!e)return"-";const n=new Date(e).getTime(),r=t?new Date(t).getTime():Date.now(),o=Math.max(0,r-n);if(o<1e3)return`${o}ms`;const a=Math.round(o/1e3);if(a<60)return`${a}s`;const i=Math.floor(a/60),l=a%60;if(i<60)return`${i}m ${l}s`;const c=Math.floor(i/60),f=i%60;return`${c}h ${f}m`}function AC(e){if(!e)return"—";const t=new Date(e);return Number.isNaN(t.getTime())?"—":t.toLocaleString(void 0,{year:"numeric",month:"short",day:"numeric",hour:"numeric",minute:"2-digit"})}function pye(e){if(!e)return"-";const t=new Date(e).getTime(),n=Math.round((Date.now()-t)/1e3);if(n<60)return"just now";const r=Math.floor(n/60);if(r<60)return`${r}m ago`;const o=Math.floor(r/60);return o<24?`${o}h ago`:`${Math.floor(o/24)}d ago`}function hye({entries:e,builtAt:t}){const n=Object.entries(e??{});return g.jsxs(Lt,{children:[g.jsxs(fr,{direction:"row",alignItems:"baseline",justifyContent:"space-between",children:[g.jsx(fb,{children:"Build manifest"}),t&&g.jsxs(It,{variant:"caption",color:"text.secondary",children:["Built ",AC(t)]})]}),n.length===0?g.jsx(It,{variant:"body2",color:"text.secondary",sx:{fontStyle:"italic"},children:"No materialized tables yet."}):g.jsxs(Hg,{size:"small",children:[g.jsx(Wg,{children:g.jsxs(ll,{children:[g.jsx(Xn,{children:"Source"}),g.jsx(Xn,{children:"Table name"}),g.jsx(Xn,{children:"Connection"}),g.jsx(Xn,{children:"Realization"}),g.jsx(Xn,{align:"right",children:"Rows"})]})}),g.jsx(qg,{children:n.map(([r,o])=>g.jsxs(ll,{children:[g.jsx(Xn,{sx:{fontFamily:jo},children:o.sourceName??r}),g.jsx(Xn,{sx:{fontFamily:jo},children:o.physicalTableName??"-"}),g.jsx(Xn,{sx:{fontFamily:jo},children:o.connectionName??"-"}),g.jsx(Xn,{children:o.realization??"-"}),g.jsx(Xn,{align:"right",children:o.rowCount??"-"})]},r))})]})]})}function RF({meta:e}){const t=e.trigger==="SCHEDULER";return g.jsx(Zi,{title:t?"Fired by the materialization schedule":"Triggered manually",children:g.jsx(It,{variant:"body2",color:"text.secondary",children:fye(e)})})}function mye({materialization:e,buildPlan:t,onClose:n}){const r=e?rR(e):{},o=e?dye(e):[],a=Object.values(t?.sources??{});return g.jsx(M0,{open:e!==null,onClose:n,maxWidth:"md",fullWidth:!0,"aria-labelledby":"materialization-detail-title",children:e&&g.jsxs(g.Fragment,{children:[g.jsxs(P0,{sx:{pr:6,pb:1.5},id:"materialization-detail-title",children:[g.jsxs(fr,{direction:"row",alignItems:"center",spacing:1,sx:{mb:.75},children:[g.jsx(fI,{size:"small",label:CF(e.status),color:PC(e.status),variant:Yb(e.status)?"filled":"outlined"}),g.jsx(RF,{meta:r})]}),g.jsx(It,{variant:"subtitle1",sx:{fontWeight:600},children:e.packageName??"Materialization"}),g.jsx(It,{variant:"caption",color:"text.secondary",sx:{fontFamily:jo,wordBreak:"break-all"},children:e.id}),g.jsx(Lo,{"aria-label":"close",onClick:n,sx:{position:"absolute",right:8,top:8},children:g.jsx(ex,{fontSize:"small"})})]}),g.jsxs($0,{dividers:!0,children:[g.jsxs(Lt,{sx:{bgcolor:"action.hover",borderRadius:2,p:2,mb:3,display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(140px, 1fr))",gap:2},children:[g.jsx(Om,{label:"Started",value:AC(e.startedAt??e.createdAt)}),g.jsx(Om,{label:"Completed",value:AC(e.completedAt)}),g.jsx(Om,{label:"Duration",value:EF(e.startedAt,e.completedAt)}),g.jsx(Om,{label:"Sources",value:kF(r," · ")}),g.jsx(Om,{label:"Force refresh",value:r.forceRefresh?"Yes":"No"})]}),e.error&&g.jsxs(Lt,{sx:{borderRadius:2,p:2,mb:3,border:"1px solid",borderColor:"error.main"},children:[g.jsx(fb,{children:g.jsx(Lt,{component:"span",sx:{color:"error.main"},children:"Error"})}),g.jsx(It,{variant:"body2",sx:{fontFamily:jo,whiteSpace:"pre-wrap"},children:e.error})]}),o.length>0&&g.jsxs(Lt,{sx:{borderRadius:2,p:2,mb:3,border:"1px solid",borderColor:"warning.main"},children:[g.jsx(fb,{children:g.jsx(Lt,{component:"span",sx:{color:"warning.main"},children:"Refused sources"})}),g.jsx(It,{variant:"body2",color:"text.secondary",sx:{mb:1},children:"Not built, because materializing them would be unsafe. They serve live until the model changes."}),o.map(i=>g.jsxs(Lt,{sx:{mt:1},children:[g.jsx(It,{variant:"body2",sx:{fontFamily:jo},children:i.name}),g.jsx(It,{variant:"body2",color:"text.secondary",sx:{whiteSpace:"pre-wrap"},children:i.message})]},i.name))]}),g.jsxs(Lt,{sx:{mb:3},children:[g.jsx(fb,{children:"Build plan"}),a.length===0?g.jsx(It,{variant:"body2",color:"text.secondary",sx:{fontStyle:"italic"},children:"This package has no persist sources."}):g.jsxs(Hg,{size:"small",children:[g.jsx(Wg,{children:g.jsxs(ll,{children:[g.jsx(Xn,{children:"Source"}),g.jsx(Xn,{children:"Connection"}),g.jsx(Xn,{children:"Dialect"}),g.jsx(Xn,{align:"right",children:"Columns"}),g.jsx(Xn,{children:"Source Entity ID"})]})}),g.jsx(qg,{children:a.map(i=>g.jsxs(ll,{children:[g.jsx(Xn,{sx:{fontFamily:jo},children:i.name}),g.jsx(Xn,{sx:{fontFamily:jo},children:i.connectionName}),g.jsx(Xn,{children:i.dialect??"-"}),g.jsx(Xn,{align:"right",children:i.columns?.length??0}),g.jsx(Xn,{sx:{fontFamily:jo,fontSize:"0.75rem",wordBreak:"break-all",maxWidth:220},children:i.sourceEntityId})]},i.sourceID))})]})]}),g.jsx(hye,{entries:e.manifest?.entries,builtAt:e.manifest?.builtAt})]})]})})}function Om({label:e,value:t}){return g.jsxs(Lt,{children:[g.jsx(It,{variant:"caption",color:"text.secondary",display:"block",children:e}),g.jsx(It,{variant:"body2",children:t})]})}const gye=tr(g.jsx("path",{d:"M6 6h12v12H6z"}));function yye(e){return cn("PrivateSwitchBase",e)}tn("PrivateSwitchBase",["root","checked","disabled","input","edgeStart","edgeEnd"]);const vye=e=>{const{classes:t,checked:n,disabled:r,edge:o}=e,a={root:["root",n&&"checked",r&&"disabled",o&&`edge${St(o)}`],input:["input"]};return sn(a,yye,t)},bye=Qe(bd,{name:"MuiSwitchBase"})({padding:9,borderRadius:"50%",variants:[{props:{edge:"start",size:"small"},style:{marginLeft:-3}},{props:({edge:e,ownerState:t})=>e==="start"&&t.size!=="small",style:{marginLeft:-12}},{props:{edge:"end",size:"small"},style:{marginRight:-3}},{props:({edge:e,ownerState:t})=>e==="end"&&t.size!=="small",style:{marginRight:-12}}]}),xye=Qe("input",{name:"MuiSwitchBase",shouldForwardProp:Ga})({cursor:"inherit",position:"absolute",opacity:0,width:"100%",height:"100%",top:0,left:0,margin:0,padding:0,zIndex:1}),Sye=k.forwardRef(function(e,t){const{autoFocus:n,checked:r,checkedIcon:o,defaultChecked:a,disabled:i,disableFocusRipple:l=!1,edge:c=!1,icon:f,id:u,inputProps:h,inputRef:m,name:v,onBlur:b,onChange:x,onFocus:w,readOnly:S,required:R=!1,tabIndex:E,type:M,value:$,slots:D={},slotProps:F={},...I}=e,[U,z]=vi({controlled:r,default:!!a,name:"SwitchBase",state:"checked"}),L=ki(),C=ae=>{w&&w(ae),L&&L.onFocus&&L.onFocus(ae)},j=ae=>{b&&b(ae),L&&L.onBlur&&L.onBlur(ae)},N=ae=>{if(ae.nativeEvent.defaultPrevented)return;const J=ae.target.checked;z(J),x&&x(ae,J)};let V=i;L&&typeof V>"u"&&(V=L.disabled);const A=M==="checkbox"||M==="radio",Y={...e,checked:U,disabled:V,disableFocusRipple:l,edge:c},W=vye(Y),re={slots:D,slotProps:{input:h,...F}},[Q,oe]=lr("root",{ref:t,elementType:bye,className:W.root,shouldForwardComponentProp:!0,externalForwardedProps:{...re,component:"span",...I},getSlotProps:ae=>({...ae,onFocus:J=>{ae.onFocus?.(J),C(J)},onBlur:J=>{ae.onBlur?.(J),j(J)}}),ownerState:Y,additionalProps:{centerRipple:!0,focusRipple:!l,disabled:V,role:void 0,tabIndex:null}}),[ce,Z]=lr("input",{ref:m,elementType:xye,className:W.input,externalForwardedProps:re,getSlotProps:ae=>({...ae,onChange:J=>{ae.onChange?.(J),N(J)}}),ownerState:Y,additionalProps:{autoFocus:n,checked:r,defaultChecked:a,disabled:V,id:A?u:void 0,name:v,readOnly:S,required:R,tabIndex:E,type:M,...M==="checkbox"&&$===void 0?{}:{value:$}}});return g.jsxs(Q,{...oe,children:[g.jsx(ce,{...Z}),U?o:f]})}),wye=tr(g.jsx("path",{d:"M19 5v14H5V5h14m0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2z"})),Cye=tr(g.jsx("path",{d:"M19 3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.11 0 2-.9 2-2V5c0-1.1-.89-2-2-2zm-9 14l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"})),kye=tr(g.jsx("path",{d:"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-2 10H7v-2h10v2z"}));function Eye(e){return cn("MuiCheckbox",e)}const ZS=tn("MuiCheckbox",["root","checked","disabled","indeterminate","colorPrimary","colorSecondary","sizeSmall","sizeMedium"]),Rye=e=>{const{classes:t,indeterminate:n,color:r,size:o}=e,a={root:["root",n&&"indeterminate",`color${St(r)}`,`size${St(o)}`]},i=sn(a,Eye,t);return{...t,...i}},Tye=Qe(Sye,{shouldForwardProp:e=>Ga(e)||e==="classes",name:"MuiCheckbox",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.indeterminate&&t.indeterminate,t[`size${St(n.size)}`],n.color!=="default"&&t[`color${St(n.color)}`]]}})(qn(({theme:e})=>({color:(e.vars||e).palette.text.secondary,variants:[{props:{color:"default",disableRipple:!1},style:{"&:hover":{backgroundColor:e.alpha((e.vars||e).palette.action.active,(e.vars||e).palette.action.hoverOpacity)}}},...Object.entries(e.palette).filter(ka()).map(([t])=>({props:{color:t,disableRipple:!1},style:{"&:hover":{backgroundColor:e.alpha((e.vars||e).palette[t].main,(e.vars||e).palette.action.hoverOpacity)}}})),...Object.entries(e.palette).filter(ka()).map(([t])=>({props:{color:t},style:{[`&.${ZS.checked}, &.${ZS.indeterminate}`]:{color:(e.vars||e).palette[t].main},[`&.${ZS.disabled}`]:{color:(e.vars||e).palette.action.disabled}}})),{props:{disableRipple:!1},style:{"&:hover":{"@media (hover: none)":{backgroundColor:"transparent"}}}}]}))),Oye=g.jsx(Cye,{}),Mye=g.jsx(wye,{}),$ye=g.jsx(kye,{}),Pye=k.forwardRef(function(e,t){const n=Wn({props:e,name:"MuiCheckbox"}),{checkedIcon:r=Oye,color:o="primary",icon:a=Mye,indeterminate:i=!1,indeterminateIcon:l=$ye,inputProps:c,size:f="medium",disableRipple:u=!1,className:h,slots:m={},slotProps:v={},...b}=n,x=i?l:a,w=i?l:r,S={...n,disableRipple:u,color:o,indeterminate:i,size:f},R=Rye(S),E=v.input??c,[M,$]=lr("root",{ref:t,elementType:Tye,className:zt(R.root,h),shouldForwardComponentProp:!0,externalForwardedProps:{slots:m,slotProps:v,...b},ownerState:S,additionalProps:{type:"checkbox",icon:k.cloneElement(x,{fontSize:x.props.fontSize??f}),checkedIcon:k.cloneElement(w,{fontSize:w.props.fontSize??f}),disableRipple:u,slots:m,slotProps:{input:hz(typeof E=="function"?E(S):E,{"data-indeterminate":i})}}});return g.jsx(M,{...$,classes:R})});function Aye(e){return cn("MuiFormControlLabel",e)}const Vm=tn("MuiFormControlLabel",["root","labelPlacementStart","labelPlacementTop","labelPlacementBottom","disabled","label","error","required","asterisk"]),Dye=e=>{const{classes:t,disabled:n,labelPlacement:r,error:o,required:a}=e,i={root:["root",n&&"disabled",`labelPlacement${St(r)}`,o&&"error",a&&"required"],label:["label",n&&"disabled"],asterisk:["asterisk",o&&"error"]};return sn(i,Aye,t)},jye=Qe("label",{name:"MuiFormControlLabel",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[{[`& .${Vm.label}`]:t.label},t.root,t[`labelPlacement${St(n.labelPlacement)}`]]}})(qn(({theme:e})=>({display:"inline-flex",alignItems:"center",cursor:"pointer",verticalAlign:"middle",WebkitTapHighlightColor:"transparent",marginLeft:-11,marginRight:16,[`&.${Vm.disabled}`]:{cursor:"default"},[`& .${Vm.label}`]:{[`&.${Vm.disabled}`]:{color:(e.vars||e).palette.text.disabled}},variants:[{props:{labelPlacement:"start"},style:{flexDirection:"row-reverse",marginRight:-11}},{props:{labelPlacement:"top"},style:{flexDirection:"column-reverse"}},{props:{labelPlacement:"bottom"},style:{flexDirection:"column"}},{props:({labelPlacement:t})=>t==="start"||t==="top"||t==="bottom",style:{marginLeft:16}}]}))),Nye=Qe("span",{name:"MuiFormControlLabel",slot:"Asterisk"})(qn(({theme:e})=>({[`&.${Vm.error}`]:{color:(e.vars||e).palette.error.main}}))),Iye=k.forwardRef(function(e,t){const n=Wn({props:e,name:"MuiFormControlLabel"}),{checked:r,className:o,componentsProps:a={},control:i,disabled:l,disableTypography:c,inputRef:f,label:u,labelPlacement:h="end",name:m,onChange:v,required:b,slots:x={},slotProps:w={},value:S,...R}=n,E=ki(),M=l??i.props.disabled??E?.disabled,$=b??i.props.required,D={disabled:M,required:$};["checked","name","onChange","value","inputRef"].forEach(N=>{typeof i.props[N]>"u"&&typeof n[N]<"u"&&(D[N]=n[N])});const F=$d({props:n,muiFormControl:E,states:["error"]}),I={...n,disabled:M,labelPlacement:h,required:$,error:F.error},U=Dye(I),z={slots:x,slotProps:{...a,...w}},[L,C]=lr("typography",{elementType:br,externalForwardedProps:z,ownerState:I});let j=u;return j!=null&&j.type!==br&&!c&&(j=g.jsx(L,{component:"span",...C,className:zt(U.label,C?.className),children:j})),g.jsxs(jye,{className:zt(U.root,o),ownerState:I,ref:t,...R,children:[k.cloneElement(i,D),$?g.jsxs("div",{children:[j,g.jsxs(Nye,{ownerState:I,"aria-hidden":!0,className:U.asterisk,children:[" ","*"]})]}):j]})});function Lye({materialization:e,onCloseDialog:t,isMutating:n,onDelete:r}){const[o,a]=k.useState(!1),[i,l]=k.useState(!1),c=()=>a(!0),f=()=>{a(!1),l(!1),t()};return g.jsxs(pn.Fragment,{children:[g.jsxs(ea,{"aria-label":`Delete materialization ${e?.id??""}`.trim(),onClick:u=>{u.stopPropagation(),c()},sx:{color:"error.main"},children:[g.jsx(JE,{sx:{color:"inherit"},children:g.jsx(U0,{fontSize:"small"})}),g.jsx(eR,{children:"Delete"})]}),g.jsxs(Yo,{open:o,onClose:f,title:"Delete materialization",actions:g.jsxs(g.Fragment,{children:[g.jsx(go,{onClick:f,children:"Cancel"}),g.jsx(go,{variant:"contained",color:"error",autoFocus:!0,onClick:()=>r(i),loading:n,children:"Delete run"})]}),children:[g.jsx(br,{variant:"body2",children:"Delete this run's record? This cannot be undone."}),g.jsx(Iye,{control:g.jsx(Pye,{checked:i,onChange:u=>l(u.target.checked)}),label:"Also drop the materialized tables this run produced"})]})]})}function zye({materializations:e,mutable:t,isMutating:n,onStop:r,onDelete:o,onViewDetails:a}){return e.length===0?g.jsx(It,{variant:"body2",color:"text.secondary",sx:{py:1,fontStyle:"italic"},children:"No materializations yet."}):g.jsxs(Hg,{size:"small",sx:{"& td, & th":{borderColor:"divider"},"& td:first-of-type, & th:first-of-type":{pl:0},"& td:last-of-type, & th:last-of-type":{pr:0},"& th":{color:"text.secondary",fontWeight:600}},children:[g.jsx(Wg,{children:g.jsxs(ll,{children:[g.jsx(Xn,{children:"Status"}),g.jsx(Xn,{children:"Trigger"}),g.jsx(Xn,{children:"Started"}),g.jsx(Xn,{children:"Duration"}),g.jsx(Xn,{children:"Sources"}),g.jsx(Xn,{align:"right",children:"Actions"})]})}),g.jsx(qg,{children:e.map(i=>g.jsx(Fye,{materialization:i,mutable:t,isMutating:n,onStop:r,onDelete:o,onViewDetails:a},i.id))})]})}function Fye({materialization:e,mutable:t,isMutating:n,onStop:r,onDelete:o,onViewDetails:a}){const[i,l]=k.useState(null),c=!!i,f=()=>l(null),u=rR(e),h=u.sourcesBuilt!==void 0||u.sourcesReused!==void 0?kF(u,", "):"-",m=Yb(e.status),v=uye(e.status),b=e.error??void 0,x=t&&(m||v);return g.jsxs(ll,{hover:!0,sx:{cursor:"pointer","&:focus-visible":{outline:"2px solid",outlineColor:"primary.main",outlineOffset:"-2px"}},onClick:()=>a(e),onKeyDown:w=>{(w.key==="Enter"||w.key===" ")&&(w.preventDefault(),a(e))},role:"button",tabIndex:0,"aria-label":`View materialization ${e.id??""} details`.trim(),children:[g.jsx(Xn,{children:g.jsxs(Lt,{sx:{display:"flex",alignItems:"center",gap:.5},children:[g.jsx(It,{variant:"body2",sx:{fontWeight:500,color:PC(e.status)==="default"?"text.primary":`${PC(e.status)}.main`},children:CF(e.status)}),b&&g.jsx(Zi,{title:b,children:g.jsx(eF,{fontSize:"small",color:"error"})})]})}),g.jsx(Xn,{children:g.jsx(RF,{meta:u})}),g.jsx(Xn,{children:pye(e.startedAt??e.createdAt)}),g.jsx(Xn,{children:EF(e.startedAt,e.completedAt)}),g.jsx(Xn,{children:h}),g.jsx(Xn,{align:"right",onClick:w=>w.stopPropagation(),children:x&&g.jsxs(g.Fragment,{children:[g.jsx(Lo,{size:"small","aria-label":`Materialization actions for ${e.id??""}`.trim(),onClick:w=>l(w.currentTarget),children:g.jsx(B0,{fontSize:"small"})}),g.jsxs(ru,{anchorEl:i,open:c,onClose:f,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},children:[t&&m&&g.jsxs(na,{"aria-label":`Stop materialization ${e.id??""}`.trim(),disabled:n,onClick:()=>{f(),r(e)},children:[g.jsx(Pp,{children:g.jsx(gye,{fontSize:"small"})}),g.jsx(nu,{children:"Stop"})]}),t&&v&&g.jsx(Lye,{materialization:e,isMutating:n,onCloseDialog:f,onDelete:w=>o(e,w)})]})]})})]})}const _ye=tr(g.jsx("path",{d:"m11.99 18.54-7.37-5.73L3 14.07l9 7 9-7-1.63-1.27zM12 16l7.36-5.73L21 9l-9-7-9 7 1.63 1.27zm0-11.47L17.74 9 12 13.47 6.26 9z"})),Uye={package:"Materialized artifacts are shared across versions",version:"Materialized artifacts are per published version"};function Bye({scope:e,disabled:t,disabledReason:n,isSubmitting:r,onChange:o}){const[a,i]=k.useState(null),l=async c=>{i(null),c!==e&&await o(c).catch(()=>{})};return g.jsxs(g.Fragment,{children:[g.jsx(ty,{label:"Scope",icon:g.jsx(_ye,{}),onClick:c=>i(c.currentTarget),disabled:t||r,...n?{disabledReason:n}:{},ariaHasPopup:"menu",ariaLabel:`Scope: ${e}`}),g.jsx(ru,{anchorEl:a,open:!!a,onClose:()=>i(null),anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},children:["package","version"].map(c=>g.jsxs(na,{selected:c===e,onClick:()=>void l(c),children:[g.jsx(Pp,{sx:{minWidth:32},children:c===e&&g.jsx(zhe,{fontSize:"small"})}),g.jsx(nu,{primary:c,secondary:Uye[c]})]},c))})]})}const Vye=tr([g.jsx("path",{d:"M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2M12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8"},"0"),g.jsx("path",{d:"M12.5 7H11v6l5.25 3.15.75-1.23-4.5-2.67z"},"1")]),fj="0 6 * * *";function Hye({currentSchedule:e,isSubmitting:t,disabled:n,disabledReason:r,onSubmit:o}){const[a,i]=k.useState(!1),[l,c]=k.useState(e??fj),f=()=>{c(e??fj),i(!0)},u=()=>i(!1),h=SF(l),m=async v=>{try{await o(v),i(!1)}catch{}};return g.jsxs(g.Fragment,{children:[g.jsx(ty,{label:"Schedule",icon:g.jsx(Vye,{}),onClick:f,disabled:n,...r?{disabledReason:r}:{},ariaHasPopup:"dialog",ariaLabel:e?"Edit schedule":"Set schedule"}),g.jsxs(Yo,{open:a,onClose:u,title:e?"Edit schedule":"Set schedule",description:"The publisher rebuilds this package's materializations on this cadence: a 5-field UNIX cron, in UTC. In a hosted deployment the change takes effect on your next publish.",actions:g.jsxs(g.Fragment,{children:[e&&g.jsx(eo,{color:"error",loading:t,onClick:()=>m(null),sx:{mr:"auto"},children:"Clear schedule"}),g.jsx(eo,{onClick:u,children:"Cancel"}),g.jsx(eo,{variant:"contained",loading:t,disabled:!h.valid,onClick:()=>m(l.trim()),children:"Save schedule"})]}),children:[g.jsx(Ca,{autoFocus:!0,fullWidth:!0,size:"small",label:"Cron expression",value:l,onChange:v=>c(v.target.value),error:l.trim()!==""&&!h.valid,helperText:h.valid?`${h.description} · next run ${wF(h.nextRun)}`:h.error,slotProps:{htmlInput:{style:{fontFamily:jo}}}}),g.jsxs(qi,{severity:"info",children:["A schedule runs only on version-scoped packages, so saving one sets ",g.jsx("code",{children:"scope: version"})," for this package."]})]})]})}const qye=3e3;function Wye({resourceUri:e}){const{apiClients:t,mutable:n}=wr(),r=Rd(),{environmentName:o,packageName:a}=ao(e),[i,l]=k.useState(""),[c,f]=k.useState(null);if(!a)throw new Error("Materializations requires a package in the resource URI");const u=Jr({queryKey:["materializations",o,a],queryFn:()=>t.materializations.listMaterializations(o,a),refetchInterval:j=>(j.state.data?.data??[]).some(N=>Yb(N.status))?qye:!1}),h=Jr({queryKey:["package",o,a],queryFn:()=>t.packages.getPackage(o,a)}),m=()=>r.invalidateQueries({queryKey:["materializations",o,a]}),v=tl({mutationFn:Vl("materialization","create",j=>t.materializations.createMaterialization(o,a,{forceRefresh:j.forceRefresh})),onSuccess(){l("Materialization requested"),m()},onError(j){l(j.message),m()}}),b=tl({mutationFn:Vl("materialization","update",j=>t.materializations.materializationAction(o,a,j.id,PZ.Stop)),onSuccess(){l("Materialization stopped"),m()},onError(j){l(j.message)}}),x=tl({mutationFn:Vl("materialization","delete",({materialization:j,dropTables:N})=>t.materializations.deleteMaterialization(o,a,j.id,N)),onSuccess(){l("Materialization deleted"),m()},onError(j){l(j.message)}}),w=h.data?.data,S=tl({mutationFn:Vl("schedule","update",j=>t.packages.updatePackage(o,a,{name:a,description:w?.description,...j?{scope:kv.Version}:{},materialization:{schedule:j}})),onSuccess(j,N){l(N?"Schedule updated":"Schedule cleared"),r.invalidateQueries({queryKey:["package",o,a]})},onError(j){l(j.message)}}),R=tl({mutationFn:Vl("scope","update",j=>t.packages.updatePackage(o,a,{name:a,description:w?.description,scope:j})),onSuccess(){l("Scope updated"),r.invalidateQueries({queryKey:["package",o,a]})},onError(j){l(j.message)}}),E=u.data?.data??[],M=E.find(j=>j.id===c)??null,$=E.some(j=>Yb(j.status)),D=v.isPending||b.isPending||x.isPending,F=w?.materialization?.schedule??null,I=w?.scope===kv.Version?"version":"package",U=!!w?.manifestLocation,z=!!w?.materialization?.freshness,L=F?SF(F):null,C=U?"Control-plane managed: refresh is driven by the control plane, not the built-in scheduler.":[L?L.valid?`${L.description} (${F}), next run ${wF(L.nextRun)}`:`Unrecognized cron expression (${F})`:z?"Refreshed by a freshness policy; a cron schedule does not apply":"On demand only, no schedule set",`scope: ${I}`].join(" · ");return g.jsxs(g.Fragment,{children:[g.jsxs(nl,{title:"Materializations",count:u.isSuccess?E.length:void 0,action:n&&g.jsxs(fr,{direction:"row",spacing:1,alignItems:"center",children:[!U&&g.jsx(Bye,{scope:I,disabled:!!F,disabledReason:"A schedule requires version scope. Clear the schedule to change it.",isSubmitting:R.isPending,onChange:j=>R.mutateAsync(j==="version"?kv.Version:kv.Package)}),!U&&g.jsx(Hye,{currentSchedule:F,isSubmitting:S.isPending,disabled:z,disabledReason:"This package declares a freshness policy; a schedule and freshness are mutually exclusive.",onSubmit:j=>S.mutateAsync(j)}),g.jsx(cye,{onSubmit:j=>v.mutateAsync(j),isSubmitting:v.isPending,disabled:$,disabledReason:"A materialization is already pending or running for this package."})]}),children:[h.isSuccess&&g.jsx(It,{variant:"body2",color:"text.secondary",sx:{mb:1.5},children:C}),u.isError&&g.jsx(Ta,{error:u.error,context:`${o} > ${a} > Materializations`}),!u.isSuccess&&!u.isError&&g.jsx(ma,{text:"Loading materializations..."}),u.isSuccess&&g.jsx(zye,{materializations:E,mutable:n,isMutating:D,onStop:j=>b.mutate(j),onDelete:(j,N)=>x.mutate({materialization:j,dropTables:N}),onViewDetails:j=>f(j.id??null)})]}),g.jsx(mye,{materialization:M,buildPlan:h.data?.data?.buildPlan??null,onClose:()=>f(null)}),g.jsx(A0,{open:i!=="",autoHideDuration:6e3,onClose:()=>l(""),message:i})]})}const TF=tr(g.jsx("path",{d:"M17 7h-4v2h4c1.65 0 3 1.35 3 3s-1.35 3-3 3h-4v2h4c2.76 0 5-2.24 5-5s-2.24-5-5-5m-6 8H7c-1.65 0-3-1.35-3-3s1.35-3 3-3h4V7H7c-2.76 0-5 2.24-5 5s2.24 5 5 5h4zm-3-4h8v2H8z"})),Gb=tr(g.jsx("path",{d:"M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14"})),Yye=tr(g.jsx("path",{d:"M8 5v14l11-7z"})),JS={scopeName:"source.malloy",patterns:[{include:"#malloy-language"}],repository:{"malloy-language":{patterns:[{include:"#sql-string"},{include:"#comments"},{include:"#tags"},{include:"#strings"},{include:"#numbers"},{include:"#keywords"},{include:"#properties"},{include:"#functions"},{include:"#datetimes"},{include:"#identifiers-quoted"},{include:"#types"},{include:"#constants"},{include:"#timeframes"},{include:"#identifiers-unquoted"}]},"malloy-matched":{begin:"{",end:"}",patterns:[{include:"#malloy-matched"},{include:"#malloy-language"}]},"malloy-in-sql":{begin:"%{",name:"source.malloy-in-sql",end:"}%?",patterns:[{include:"#malloy-matched"},{include:"#malloy-language"}]},"sql-string":{patterns:[{begin:'(\\b[A-Za-z_][A-Za-z_0-9]*)(\\s*\\.\\s*)(sql)(\\s*\\(\\s*)(""")',end:'"""',beginCaptures:{1:{name:"variable.other"},3:{name:"keyword.control.sql"},5:{name:"punctuation.sql-block.open"}},endCaptures:{0:{name:"punctuation.sql-block.close"}},name:"source.sql",patterns:[{include:"#malloy-in-sql"},{include:"source.sql"}]}]},functions:{patterns:[{match:"(?i)\\b(count)(\\s*\\()(distinct)",captures:{1:{name:"entity.name.function"},3:{name:"entity.name.function.modifier"}}},{match:"(?i)\\b(AVG|COUNT|FIRST|FORMAT|LAST|LCASE|LEN|MAX|MID|MIN|MOD|NOW|ROUND|SUM|UCASE|UNGROUPED)(\\s*\\()",captures:{1:{name:"entity.name.function"}}},{match:"(?i)\\b([a-zA-Z_][a-zA-Z_0-9]*)(\\s*\\()",captures:{1:{name:"entity.name.function"}}},{match:"(?i)\\b([a-zA-Z_][a-zA-Z_0-9]*)(!)(timestamp|number|string|boolean|date)?(\\s*\\()",captures:{1:{name:"entity.name.function"},3:{name:"entity.name.type"}}}]},datetimes:{patterns:[{match:"(?i)@[0-9]{4}-[0-9]{2}-[0-9]{2}[ T][0-9]{2}:[0-9]{2}((:[0-9]{2})(([\\.,][0-9]+)(\\[[A-Za-z_/]+\\])?)?)?",name:"constant.numeric.timestamp"},{match:"(?i)@[0-9]{4}(-Q[1-4]|-[0-9]{2}(-[0-9]{2}(-WK)?)?)?",name:"constant.numeric.date"}]},"identifiers-quoted":{patterns:[{match:"`[^`]*`",name:"variable.other.quoted"}]},"identifiers-unquoted":{patterns:[{match:"(?i)\\b[A-Za-z_][A-Za-z_0-9]*\\b",name:"variable.other"}]},timeframes:{patterns:[{match:"(?i)\\b((year|quarter|month|week|day|hour|minute|second)s?)\\b",name:"keyword.other.timeframe"},{match:"(?i)\\b(day_of_year|day_of_month)\\b",name:"keyword.other.timeframe"}]},comments:{patterns:[{begin:"/\\*",end:"\\*/",beginCaptures:{0:{name:"punctuation.definition.comment.begin"}},endCaptures:{0:{name:"punctuation.definition.comment.end"}},name:"comment.block"},{begin:"//",end:"\\n",beginCaptures:{0:{name:"punctuation.definition.comment"}},name:"comment.line.double-slash"},{begin:"--",end:"\\n",beginCaptures:{0:{name:"punctuation.definition.comment"}},name:"comment.line.double-hyphen"}]},tags:{patterns:[{match:"##\\n",name:"string.quoted",captures:{0:{name:"string.quoted"}}},{begin:'#"',end:"\\n",beginCaptures:{0:{name:"punctuation.definition.comment"}},name:"comment.line.double-slash"},{match:"#\\n",name:"string.quoted",captures:{0:{name:"string.quoted"}}},{begin:"#\\s",end:"\\n",beginCaptures:{0:{name:"support.type.property-name.json"}},name:"comment.line.double-slash",patterns:[{include:"#tag-values"}]},{begin:"##\\s",end:"\\n",beginCaptures:{0:{name:"support.type.property-name.json"}},name:"comment.line.double-slash",patterns:[{include:"#tag-values"}]},{begin:"#",end:"\\n",beginCaptures:{0:{name:"string.quoted"}},name:"string.quoted"}],repository:{"tag-values":{name:"support.type.property-name.json",match:'(-)?((?:[^\\s=#]+)|(?:"[^#]+"))(?:\\s*(=)\\s*((?:[^\\s=#]+)|(?:"[^#]+")))?',captures:{1:{name:"keyword.control.negate"},2:{name:"support.type.property-name.json"},3:{name:"keyword.operator.comparison.ts"},4:{name:"string.quoted"}}}}},strings:{patterns:[{begin:"'",end:"'",beginCaptures:{0:{name:"punctuation.definition.string.begin"}},endCaptures:{0:{name:"punctuation.definition.string.end"}},name:"string.quoted.single",patterns:[{include:"#escapes"}]},{begin:'"',end:'"',beginCaptures:{0:{name:"punctuation.definition.string.begin"}},endCaptures:{0:{name:"punctuation.definition.string.end"}},name:"string.quoted.double",patterns:[{include:"#escapes"}]},{begin:'"""',end:'"""',beginCaptures:{0:{name:"punctuation.definition.string.begin"}},endCaptures:{0:{name:"punctuation.definition.string.end"}},name:"string.quoted.triple"},{begin:"(?i)[r|/]'",end:"'",name:"string.regexp",patterns:[{include:"#regex-escapes"}]}],repository:{escapes:{name:"constant.character.escape",match:"\\\\(u[A-Fa-f0-9]{4}|.)",captures:{0:{name:"constant.character.escape"}}},"regex-escapes":{name:"constant.character.escape",match:"\\\\.",captures:{0:{name:"constant.character.escape"}}}}},numbers:{match:"(?i)(\\b((0|[1-9][0-9]*)(E[+-]?[0-9]+|\\.[0-9]*)?)|\\.[0-9]+)",name:"constant.numeric"},constants:{patterns:[{match:"(?i)\\bnull\\b",name:"constant.language.null"},{match:"(?i)\\btrue\\b",name:"constant.language.true"},{match:"(?i)\\bfalse\\b",name:"constant.language.false"}]},types:{patterns:[{match:"(?i)\\bstring\\b",name:"entity.name.type.string"},{match:"(?i)\\bnumber\\b",name:"entity.name.type.number"},{match:"(?i)\\bdate\\b",name:"entity.name.type.date"},{match:"(?i)\\btimestamp\\b",name:"entity.name.type.timestamp"},{match:"(?i)\\bboolean\\b",name:"entity.name.type.boolean"}]},properties:{patterns:[{match:"(?i)\\baccept\\b",name:"keyword.control.accept"},{match:"(?i)\\bselect\\b",name:"keyword.control.select"},{match:"(?i)\\bconnection\\b",name:"keyword.control.connection"},{match:"(?i)\\brun\\b",name:"keyword.control.run"},{match:"(?i)\\bextend\\b",name:"keyword.control.extend"},{match:"(?i)\\brefine\\b",name:"keyword.control.refine"},{match:"(?i)\\baggregate\\b",name:"keyword.control.aggregate"},{match:"(?i)\\bsample\\b",name:"keyword.control.sample"},{match:"(?i)\\bcalculate\\b",name:"keyword.control.calculate"},{match:"(?i)\\btimezone\\b",name:"keyword.control.timezone"},{match:"(?i)\\bdimension\\b",name:"keyword.control.dimension"},{match:"(?i)\\bexcept\\b",name:"keyword.control.except"},{match:"(?i)\\bsource\\b",name:"keyword.control.source"},{match:"(?i)\\bgroup_by\\b",name:"keyword.control.group_by"},{match:"(?i)\\bhaving\\b",name:"keyword.control.having"},{match:"(?i)\\bindex\\b",name:"keyword.control.index"},{match:"(?i)\\bjoin_one\\b",name:"keyword.control.join_one"},{match:"(?i)\\bwith\\b",name:"keyword.control.with"},{match:"(?i)\\bjoin_many\\b",name:"keyword.control.join_many"},{match:"(?i)\\bjoin_cross\\b",name:"keyword.control.join_cross"},{match:"(?i)\\blimit\\b",name:"keyword.control.limit"},{match:"(?i)\\bmeasure\\b",name:"keyword.control.measure"},{match:"(?i)\\bnest\\b",name:"keyword.control.nest"},{match:"(?i)\\border_by\\b",name:"keyword.control.order_by"},{match:"(?i)\\bpartition_by\\b",name:"keyword.control.partition_by"},{match:"(?i)\\bprimary_key\\b",name:"keyword.control.primary_key"},{match:"(?i)\\bproject\\b",name:"keyword.control.project"},{match:"(?i)\\bquery\\b",name:"keyword.control.query"},{match:"(?i)\\brename\\b",name:"keyword.control.rename"},{match:"(?i)\\btop\\b",name:"keyword.control.top"},{match:"(?i)\\bview\\b",name:"keyword.control.view"},{match:"(?i)\\bwhere\\b",name:"keyword.control.where"},{match:"(?i)\\bdeclare\\b",name:"keyword.control.declare"}]},keywords:{patterns:[{match:"(?i)\\bis\\b",name:"keyword.control.is"},{match:"(?i)\\bon\\b",name:"keyword.control.on"},{match:"(?i)\\bnot\\b",name:"keyword.other.not"},{match:"(?i)\\bor\\b",name:"keyword.other.or"},{match:"(?i)\\bdesc\\b",name:"keyword.control.desc"},{match:"(?i)\\bby\\b",name:"keyword.control.by"},{match:"(?i)\\band\\b",name:"keyword.other.and"},{match:"(?i)\\basc\\b",name:"keyword.control.asc"},{match:"(?i)\\bfor\\b",name:"keyword.other.for"},{match:"(?i)\\belse\\b",name:"keyword.other.else"},{match:"(?i)\\bto\\b",name:"keyword.other.to"},{match:"(?i)\\bwhen\\b",name:"keyword.other.when"},{match:"(?i)\\bpick\\b",name:"keyword.other.pick"},{match:"(?i)\\bimport\\b",name:"keyword.control.import"}]}}},Gye={...JS,patterns:[...JS.patterns,{include:"#docvar"}],repository:{...JS.repository,docvar:{patterns:[{match:"\\<\\<[^(\\>\\>)]*\\>\\>",beginCaptures:{0:{name:"punctuation.definition.comment.begin"}},endCaptures:{0:{name:"punctuation.definition.comment.end"}},name:"markup.italic.markdown"}]}}},Kye={name:"Malloy SQL",scopeName:"source.malloy-sql",patterns:[{include:"#malloysql-sql"}],repository:{"malloysql-sql":{beginCaptures:{0:{name:"entity.other.attribute.malloy-sql"},1:{name:"entity.other.attribute.malloy-sql"},3:{name:"comment.line.double-slash"}},name:"meta.embedded.block.malloysql.sql",patterns:[{include:"#comments"},{begin:"%{",end:"}%",beginCaptures:{0:{name:"punctuation.definition.malloy-sql"}},endCaptures:{0:{name:"punctuation.definition.malloy-sql"}},name:"meta.embedded.block.malloy",patterns:[{include:"source.malloy"}]},{include:"source.sql"}]},comments:{patterns:[{begin:"/\\*",end:"\\*/",beginCaptures:{0:{name:"punctuation.definition.comment.begin"}},endCaptures:{0:{name:"punctuation.definition.comment.end"}},name:"comment.block"},{begin:"//",end:"\\n",beginCaptures:{0:{name:"punctuation.definition.comment"}},name:"comment.line.double-slash"},{begin:"--",end:"\\n",beginCaptures:{0:{name:"punctuation.definition.comment"}},name:"comment.line.double-hyphen"}]}}},Qye="github-light",Xye="github-dark";let ew;function Zye(){return ew||(ew=(async()=>{const[{createHighlighterCore:e},{createOnigurumaEngine:t},{default:n},{default:r},{default:o},{default:a},{default:i}]=await Promise.all([Co(()=>import("./core-B8oMW4sm.es-hOkwvru5.js"),__vite__mapDeps([3,4])),Co(()=>import("./engine-oniguruma-C4vnmooL.es-jdkXmgTr.js"),[]),Co(()=>import("./sql-DCkt643-.es-COK4E0Yg.js"),[]),Co(()=>import("./json-71t8ZF9g.es-BQoSv7ci.js"),[]),Co(()=>import("./typescript-buWNZFwO.es-Dj6nwHGl.js"),[]),Co(()=>import("./github-light-JYsPkUQd.es-DAi9KRSo.js"),[]),Co(()=>import("./github-dark-DenFmJkN.es-DHJKELXO.js"),[])]);return e({engine:t(Co(()=>import("./wasm-DQxwEHae.es-CG6Dc4jp.js"),[])),themes:[a,i],langs:[n,r,o,{name:"malloy",scopeName:"source.malloy",embeddedLangs:["sql"],...Gye},{name:"malloysql",scopeName:"source.malloy-sql",embeddedLangs:["sql"],...Kye}]})})()),ew}async function OF(e,t,n="light"){return(await Zye()).codeToHtml(e,{lang:t,theme:n==="dark"?Xye:Qye})}function MF({open:e,onClose:t,result:n,title:r="Results",renderLogs:o,drill:a}){return g.jsx(Yo,{open:e,onClose:t,title:r,maxWidth:!1,showClose:!0,children:g.jsx(Lt,{sx:{height:"70vh",overflow:"auto"},children:g.jsx(KE,{result:n,maxHeight:yhe,maxResultSize:1e6,renderLogs:o,drill:a})})})}function Jye({queryName:e,annotations:t,resourceUri:n,runOnDemand:r=!1,maxResultSize:o=0}){const[a,i]=pn.useState(),[l,c]=pn.useState(!1),[f,u]=pn.useState(!1),{packageName:h,environmentName:m,versionId:v,modelPath:b}=ao(n),x=!r||f,w=ZE({environmentName:m,packageName:h,modelPath:b,versionId:v,queryName:e},{enabled:x}),S=w.data,{mode:R}=is();return k.useEffect(()=>{if(t&&t.length>0){const E=t.map(M=>`// ${M}`).join(`
479
- `);OF(E,"typescript",R).then(M=>{i(M)})}},[t,R]),g.jsxs(Lt,{children:[a&&g.jsx(Lt,{sx:{marginBottom:"16px"},children:g.jsx(It,{fontSize:"12px",sx:{fontSize:"12px","& .line":{textWrap:"wrap"}},children:g.jsx("div",{className:"content",dangerouslySetInnerHTML:{__html:a}})})}),g.jsxs(Lt,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"8px"},children:[g.jsx(It,{variant:"body2",sx:{fontSize:"15px",fontWeight:600,color:"text.primary",px:2,py:1,bgcolor:"action.hover",borderRadius:1.5,border:1,borderColor:"divider"},children:e}),g.jsx(cp,{"aria-label":"Expand results",onClick:()=>c(!0),children:g.jsx(Gb,{})})]}),g.jsxs(Lm,{sx:{position:"relative"},children:[r&&!f&&g.jsxs(Lt,{sx:{padding:"40px 20px",textAlign:"center",display:"flex",flexDirection:"column",alignItems:"center",gap:"16px"},children:[g.jsx(It,{variant:"body2",color:"text.secondary",children:"Click Run to execute the query"}),g.jsx(eo,{variant:"contained",startIcon:g.jsx(Yye,{}),onClick:()=>u(!0),children:"Run Query"})]}),x&&g.jsx(QE,{state:w,context:e,maxHeight:ghe,maxResultSize:o})]}),g.jsx(MF,{open:l,onClose:()=>c(!1),result:S?.data?.result||"",renderLogs:S?.data?.renderLogs,title:`Query: ${e}`})]})}function eve(e){return e!=null}function tve(e,t){const n=[],r=[];for(const a of e){if(a.name===void 0||eve(t.get(a.name)))continue;if(a.default==null){n.push(a.name);continue}const i=Z5(a.type??"string",a.default);i&&r.push(`${a.name} = ${i}`)}const o={missing:n};return r.length>0&&(o.defaultsNote=r.length===1?`Ran with the default ${r[0]}`:`Ran with defaults ${r.join(", ")}`),o}function nve(e){return e.length===1?`This source may need a value for the given ${e[0]}. Set it in the parameters above.`:`This source may need values for the givens ${e.join(", ")}. Set them in the parameters above.`}function rve({sourceAndPaths:e,selectedSourceIndex:t,existingQuery:n,onQueryChange:r,onSourceChange:o,resourceUri:a,givens:i,gate:l}){return pn.useEffect(()=>{o&&o(t)},[t,o]),g.jsx(OL,{children:g.jsxs(WV,{spacing:2,component:"section",children:[g.jsx(ave,{sourceAndPath:e[t],existingQuery:n,onChange:c=>{r&&r(c)},resourceUri:a,givens:i,gate:l}),g.jsx(kN,{height:"5px"})]})})}function tw(){return{query:void 0,malloyQuery:void 0,malloyResult:void 0}}function ove({sourceAndPath:e,onChange:t,existingQuery:n,explorerComponents:r,QueryBuilder:o,resourceUri:a,givens:i,gate:l}){const[c,f]=pn.useState(n||tw()),[u,h]=pn.useState(void 0);pn.useEffect(()=>{n&&f(n)},[n]);const[m,v]=pn.useState([]),{MalloyExplorerProvider:b,QueryPanel:x,ResizableCollapsiblePanel:w,ResultPanel:S,SourcePanel:R}=r;pn.useEffect(()=>{t&&t(c)},[t,c]);const{environmentName:E,packageName:M,versionId:$}=ao(a),{apiClients:D}=wr(),F=pn.useRef(void 0),I=tl({mutationFn:()=>{F.current=l,h({executionState:"running",query:c?.malloyQuery,queryResolutionStartMillis:Date.now(),onCancel:()=>{I.reset(),h(void 0)},response:{}});const C=typeof c?.malloyQuery=="string"?c.malloyQuery:new o.ASTQuery({source:e.sourceInfo,query:c?.malloyQuery}).toMalloy();return f({...c,query:C}),D.models.executeQueryModel(E,M,e.modelPath,{query:C,sourceName:void 0,queryName:void 0,versionId:$,...i&&Object.keys(i).length>0?{givens:i}:{}})},onSuccess:C=>{if(C){const j=JSON.parse(C.data.result);f({...c,malloyResult:j});const N=F.current;h(V=>V?{...V,executionState:"finished",response:{result:j,...N?.defaultsNote?{messages:[{severity:"INFO",title:N.defaultsNote}]}:{}}}:void 0)}},onError:C=>{console.error("Query execution error:",C);const j=C?.data?.message??C?.message??"The query could not be run.",N=[{severity:"ERROR",title:j}],V=F.current?.missing??[];(C?.status===403||/Access denied for source/i.test(j))&&V.length>0&&N.push({severity:"WARN",title:nve(V)}),h(A=>A?{...A,executionState:"finished",response:{messages:N}}:void 0)}}),[U,z]=pn.useState(e.sourceInfo.name);pn.useEffect(()=>{U!==e.sourceInfo.name&&(z(e.sourceInfo.name),f(tw()),h(void 0))},[e,U]);const L=pn.useCallback(C=>{f({...c,malloyQuery:C,malloyResult:void 0})},[c]);return U!==e.sourceInfo.name?g.jsx("div",{children:"Loading..."}):g.jsx(PL,{sx:{border:"1px solid #e0e0e0",borderRadius:"8px",overflow:"hidden"},children:g.jsx(b,{source:e.sourceInfo,query:c?.malloyQuery,topValues:[],onFocusedNestViewPathChange:v,focusedNestViewPath:m,onQueryChange:L,children:g.jsxs("div",{style:{display:"flex",height:"100%",overflowY:"auto"},children:[g.jsx(w,{isInitiallyExpanded:!0,initialWidth:180,minWidth:180,icon:"database",title:e.sourceInfo.name,children:g.jsx(R,{onRefresh:()=>f(tw())})}),g.jsx(w,{isInitiallyExpanded:!0,initialWidth:280,minWidth:280,icon:"filterSliders",title:"Query",children:g.jsx(x,{runQuery:()=>{console.log(`running query with: ${c?.malloyQuery}`);try{I.mutate()}catch(C){console.error("Error running query:",C)}}})}),g.jsx(S,{source:e.sourceInfo,draftQuery:c?.malloyQuery,setDraftQuery:C=>f({...c,malloyQuery:C}),submittedQuery:u,options:{showRawQuery:!0}})]})})},e.sourceInfo.name)}function ave(e){const[t,n]=k.useState(null),[r,o]=k.useState(null),[a,i]=k.useState(!0);return k.useEffect(()=>{let l=!0;return Promise.all([Co(()=>import("./index-B3woRPfQ.js"),__vite__mapDeps([5,0,1,2,6])),Tre()]).then(([c,f])=>{l&&(n(c),o(f),i(!1))}).catch(c=>{console.error("Failed to load Malloy components:",c),l&&i(!1)}),()=>{l=!1}},[]),a||!t||!r?g.jsx(aZ,{children:g.jsx(PL,{children:g.jsx(kN,{sx:{alignItems:"center",justifyContent:"center",height:"200px",color:"text.secondary"},children:"Loading explorer..."})})}):g.jsx(ove,{...e,explorerComponents:t,QueryBuilder:r,resourceUri:e.resourceUri})}function $F(e,t=!0){const{modelPath:n,environmentName:r,packageName:o,versionId:a}=ao(e),{apiClients:i}=wr();return Jr({queryKey:["package",r,o,n,a],queryFn:async()=>(await i.models.getModel(r,o,n,a)).data,enabled:t})}function PF({data:e,onChange:t,existingQuery:n,initialSelectedSourceIndex:r=0,onSourceChange:o,resourceUri:a,givens:i,onGivensChange:l,startingGivens:c}){const[f,u]=pn.useState(r);pn.useEffect(()=>{u(r)},[r]);const{data:h,isError:m,isLoading:v,error:b}=$F(a,!e),{environmentName:x,packageName:w,modelPath:S,versionId:R}=ao(a),E=e||h,M=pn.useMemo(()=>E?.givens??[],[E]),$=xE({specs:M,loaded:!!E,params:i,onGivensChange:l,startingValues:c,documentKey:a,autorun:!0,environmentName:x??"",packageName:w??"",modelPath:S,versionId:R,documentName:S}),D=k.useMemo(()=>ny($.applied,$.declaredTypes),[$.applied,$.declaredTypes]),F=k.useMemo(()=>tve(M,$.applied),[M,$.applied]);if(v&&!e)return g.jsx(ma,{text:"Fetching Model..."});if(m&&!e)return console.log("error",b),g.jsx(Ta,{error:b,context:`ModelExplorer > ${S}`});if(!E)return g.jsx(ma,{text:bp.loading});const I=(E?.sourceInfos||[]).map((z,L)=>{try{return JSON.parse(z)?.name||`Source ${L+1}`}catch{return`Source ${L+1}`}}),U=I[f]||"";return g.jsxs(rZ,{variant:"outlined",children:[g.jsx(oZ,{children:g.jsx(fr,{sx:{flexDirection:"row"},children:g.jsx(Lge,{size:"small",id:"size-small-standard",disablePortal:!0,options:I,value:U,onChange:(z,L)=>{if(!L)return;const C=I.indexOf(L);C>=0&&(u(C),o?.(C))},renderInput:z=>g.jsx(hr,{...z}),style:{width:350,marginTop:"3px",marginLeft:"6px",marginBottom:"8px"}})})}),g.jsx(GE,{...$.panel}),g.jsx(OL,{children:g.jsxs(fr,{spacing:2,component:"section",children:[Array.isArray(E.sourceInfos)&&E.sourceInfos.length>0&&g.jsx(rve,{sourceAndPaths:E.sourceInfos.map(z=>({sourceInfo:JSON.parse(z),modelPath:S})),selectedSourceIndex:f,existingQuery:n,onQueryChange:t,resourceUri:a,givens:D,gate:F}),g.jsx(Lt,{height:"5px"})]})})]})}function AF({open:e,onClose:t,resourceUri:n,data:r,title:o="Data Sources",hasValidImport:a=!0,existingQuery:i,initialSelectedSourceIndex:l,onChange:c,onSourceChange:f,givens:u,onGivensChange:h,startingGivens:m}){return g.jsxs(M0,{open:e,onClose:t,fullScreen:!0,children:[g.jsxs(P0,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[o,g.jsx(Lo,{onClick:t,sx:{color:"text.secondary"},children:g.jsx(ex,{})})]}),g.jsx($0,{children:a?g.jsx(PF,{resourceUri:n,data:r,existingQuery:i,initialSelectedSourceIndex:l,onChange:c,onSourceChange:f,givens:u,onGivensChange:h,startingGivens:m}):g.jsx("div",{children:"No valid import statement found in cell"})})]})}function k0e({onChange:e,resourceUri:t,runOnDemand:n=!1,maxResultSize:r=0,givens:o,onGivensChange:a}){const{modelPath:i}=ao(t),{data:l,isError:c,isLoading:f,error:u}=$F(t),[h,m]=pn.useState(!1),[v,b]=pn.useState(),[x,w]=pn.useState(0),[S,R]=k.useState(""),[E,M]=pn.useState({}),$=o??E,D=a??(C=>M(C)),F=l?.modelDef,I=pn.useMemo(()=>{if(!F)return!1;try{const C=JSON.parse(F);return Array.isArray(C.imports)&&C.imports.length>0}catch{return!1}},[F]);if(f)return g.jsx(ma,{text:"Fetching Model..."});if(c)return console.log("error",u),g.jsx(Ta,{error:u,context:`Model > ${i}`});const U=C=>{b(C),e&&e(C)},z=C=>{w(C)},L=()=>{const C=window.location.href;navigator.clipboard.writeText(C).then(()=>R("URL copied to clipboard!")).catch(()=>R("Failed to copy URL"))};return g.jsxs(g.Fragment,{children:[g.jsxs(Lt,{sx:{position:"relative",maxWidth:"1200px",margin:"0 auto",paddingTop:"24px"},children:[Array.isArray(l?.sourceInfos)&&l.sourceInfos.length>0&&g.jsxs(fr,{spacing:2,component:"section",children:[g.jsxs(Lt,{sx:{padding:"0 0 16px 0",display:"flex",alignItems:"center",justifyContent:"space-between"},children:[g.jsx(It,{variant:"h1",sx:{fontSize:"28px",fontWeight:"600",color:"#1a1a1a",marginBottom:"8px",marginTop:"0",paddingLeft:"0"},children:"Sources"}),g.jsx(Zi,{title:"Copy link",children:g.jsx(Lo,{size:"small","aria-label":"Copy link",onClick:L,sx:{color:"text.secondary"},children:g.jsx(TF,{fontSize:"small"})})})]}),g.jsx(PF,{data:l,onChange:U,onSourceChange:z,existingQuery:v,initialSelectedSourceIndex:x,resourceUri:t,givens:$,onGivensChange:D}),g.jsx(cp,{"aria-label":"Expand results",sx:{position:"absolute",top:"90px",right:"4px",zIndex:2},onClick:()=>m(!0),children:g.jsx(Gb,{})})]}),l?.queries?.length>0&&g.jsxs(fr,{spacing:2,component:"section",sx:{marginTop:"24px"},children:[g.jsx(Lt,{sx:{padding:"0 0 16px 0"},children:g.jsx(It,{variant:"h2",sx:{fontSize:"24px",fontWeight:"600",color:"#1a1a1a",marginBottom:"0",marginTop:"8px",paddingLeft:"0"},children:"Named Queries"})}),l.queries.map(C=>g.jsx(Jye,{queryName:C.name,annotations:C.annotations,resourceUri:t,runOnDemand:n,maxResultSize:r},C.name))]}),(!Array.isArray(l?.sourceInfos)||l.sourceInfos.length===0)&&!(l?.queries&&l.queries.length>0)&&g.jsxs(Lt,{sx:{textAlign:"center",py:6},children:[g.jsx(It,{variant:"body1",sx:{color:"text.secondary",marginBottom:"8px"},children:"This model exposes no sources or queries."}),I&&g.jsxs(It,{variant:"body2",color:"text.secondary",children:["It imports other files but re-exports nothing. Add"," ",g.jsxs("code",{children:["export ","{ source_name }"]})," to surface imported sources here."]})]}),g.jsx(AF,{open:h,onClose:()=>m(!1),resourceUri:t,data:l,title:`Model: ${i.split("/").pop()}`,existingQuery:v,initialSelectedSourceIndex:x,onChange:U,onSourceChange:z,givens:$,onGivensChange:D})]}),g.jsx(A0,{open:S!=="",autoHideDuration:6e3,onClose:()=>R(""),message:S})]})}function ive({ready:e,lastRunKey:t,pendingKey:n,runKey:r,documentKey:o}){if(!e)return{cancelPending:n!==void 0,dispatch:"none"};const a=n!==void 0&&n!==r;if(t===r)return{cancelPending:a,dispatch:"none"};if(n===r)return{cancelPending:a,dispatch:"none"};const i=t===null||!t.startsWith(`${o}|`);return{cancelPending:a,dispatch:i?"now":"settle"}}function sve(e){return k.useMemo(()=>{if(!e?.sources?.length)return[];const t=new Map;for(const n of e.sources)if(n.givens?.length)for(const r of n.givens)r.name&&!t.has(r.name)&&t.set(r.name,r);return Array.from(t.values())},[e])}const lve=400;function cve(e){return e.kind?e.kind==="query":e.type==="code"}const DF=e=>e.proseLines!==void 0;function oR({text:e,proseLines:t}){return(e??"").split(`
479
+ `);OF(E,"typescript",R).then(M=>{i(M)})}},[t,R]),g.jsxs(Lt,{children:[a&&g.jsx(Lt,{sx:{marginBottom:"16px"},children:g.jsx(It,{fontSize:"12px",sx:{fontSize:"12px","& .line":{textWrap:"wrap"}},children:g.jsx("div",{className:"content",dangerouslySetInnerHTML:{__html:a}})})}),g.jsxs(Lt,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"8px"},children:[g.jsx(It,{variant:"body2",sx:{fontSize:"15px",fontWeight:600,color:"text.primary",px:2,py:1,bgcolor:"action.hover",borderRadius:1.5,border:1,borderColor:"divider"},children:e}),g.jsx(cp,{"aria-label":"Expand results",onClick:()=>c(!0),children:g.jsx(Gb,{})})]}),g.jsxs(Lm,{sx:{position:"relative"},children:[r&&!f&&g.jsxs(Lt,{sx:{padding:"40px 20px",textAlign:"center",display:"flex",flexDirection:"column",alignItems:"center",gap:"16px"},children:[g.jsx(It,{variant:"body2",color:"text.secondary",children:"Click Run to execute the query"}),g.jsx(eo,{variant:"contained",startIcon:g.jsx(Yye,{}),onClick:()=>u(!0),children:"Run Query"})]}),x&&g.jsx(QE,{state:w,context:e,maxHeight:ghe,maxResultSize:o})]}),g.jsx(MF,{open:l,onClose:()=>c(!1),result:S?.data?.result||"",renderLogs:S?.data?.renderLogs,title:`Query: ${e}`})]})}function eve(e){return e!=null}function tve(e,t){const n=[],r=[];for(const a of e){if(a.name===void 0||eve(t.get(a.name)))continue;if(a.default==null){n.push(a.name);continue}const i=Z5(a.type??"string",a.default);i&&r.push(`${a.name} = ${i}`)}const o={missing:n};return r.length>0&&(o.defaultsNote=r.length===1?`Ran with the default ${r[0]}`:`Ran with defaults ${r.join(", ")}`),o}function nve(e){return e.length===1?`This source may need a value for the given ${e[0]}. Set it in the parameters above.`:`This source may need values for the givens ${e.join(", ")}. Set them in the parameters above.`}function rve({sourceAndPaths:e,selectedSourceIndex:t,existingQuery:n,onQueryChange:r,onSourceChange:o,resourceUri:a,givens:i,gate:l}){return pn.useEffect(()=>{o&&o(t)},[t,o]),g.jsx(OL,{children:g.jsxs(WV,{spacing:2,component:"section",children:[g.jsx(ave,{sourceAndPath:e[t],existingQuery:n,onChange:c=>{r&&r(c)},resourceUri:a,givens:i,gate:l}),g.jsx(kN,{height:"5px"})]})})}function tw(){return{query:void 0,malloyQuery:void 0,malloyResult:void 0}}function ove({sourceAndPath:e,onChange:t,existingQuery:n,explorerComponents:r,QueryBuilder:o,resourceUri:a,givens:i,gate:l}){const[c,f]=pn.useState(n||tw()),[u,h]=pn.useState(void 0);pn.useEffect(()=>{n&&f(n)},[n]);const[m,v]=pn.useState([]),{MalloyExplorerProvider:b,QueryPanel:x,ResizableCollapsiblePanel:w,ResultPanel:S,SourcePanel:R}=r;pn.useEffect(()=>{t&&t(c)},[t,c]);const{environmentName:E,packageName:M,versionId:$}=ao(a),{apiClients:D}=wr(),F=pn.useRef(void 0),I=tl({mutationFn:()=>{F.current=l,h({executionState:"running",query:c?.malloyQuery,queryResolutionStartMillis:Date.now(),onCancel:()=>{I.reset(),h(void 0)},response:{}});const C=typeof c?.malloyQuery=="string"?c.malloyQuery:new o.ASTQuery({source:e.sourceInfo,query:c?.malloyQuery}).toMalloy();return f({...c,query:C}),D.models.executeQueryModel(E,M,e.modelPath,{query:C,sourceName:void 0,queryName:void 0,versionId:$,...i&&Object.keys(i).length>0?{givens:i}:{}})},onSuccess:C=>{if(C){const j=JSON.parse(C.data.result);f({...c,malloyResult:j});const N=F.current;h(V=>V?{...V,executionState:"finished",response:{result:j,...N?.defaultsNote?{messages:[{severity:"INFO",title:N.defaultsNote}]}:{}}}:void 0)}},onError:C=>{console.error("Query execution error:",C);const j=C?.data?.message??C?.message??"The query could not be run.",N=[{severity:"ERROR",title:j}],V=F.current?.missing??[];(C?.status===403||/Access denied for source/i.test(j))&&V.length>0&&N.push({severity:"WARN",title:nve(V)}),h(A=>A?{...A,executionState:"finished",response:{messages:N}}:void 0)}}),[U,z]=pn.useState(e.sourceInfo.name);pn.useEffect(()=>{U!==e.sourceInfo.name&&(z(e.sourceInfo.name),f(tw()),h(void 0))},[e,U]);const L=pn.useCallback(C=>{f({...c,malloyQuery:C,malloyResult:void 0})},[c]);return U!==e.sourceInfo.name?g.jsx("div",{children:"Loading..."}):g.jsx(PL,{sx:{border:"1px solid #e0e0e0",borderRadius:"8px",overflow:"hidden"},children:g.jsx(b,{source:e.sourceInfo,query:c?.malloyQuery,topValues:[],onFocusedNestViewPathChange:v,focusedNestViewPath:m,onQueryChange:L,children:g.jsxs("div",{style:{display:"flex",height:"100%",overflowY:"auto"},children:[g.jsx(w,{isInitiallyExpanded:!0,initialWidth:180,minWidth:180,icon:"database",title:e.sourceInfo.name,children:g.jsx(R,{onRefresh:()=>f(tw())})}),g.jsx(w,{isInitiallyExpanded:!0,initialWidth:280,minWidth:280,icon:"filterSliders",title:"Query",children:g.jsx(x,{runQuery:()=>{console.log(`running query with: ${c?.malloyQuery}`);try{I.mutate()}catch(C){console.error("Error running query:",C)}}})}),g.jsx(S,{source:e.sourceInfo,draftQuery:c?.malloyQuery,setDraftQuery:C=>f({...c,malloyQuery:C}),submittedQuery:u,options:{showRawQuery:!0}})]})})},e.sourceInfo.name)}function ave(e){const[t,n]=k.useState(null),[r,o]=k.useState(null),[a,i]=k.useState(!0);return k.useEffect(()=>{let l=!0;return Promise.all([Co(()=>import("./index-BcsfsLm3.js"),__vite__mapDeps([5,0,1,2,6])),Tre()]).then(([c,f])=>{l&&(n(c),o(f),i(!1))}).catch(c=>{console.error("Failed to load Malloy components:",c),l&&i(!1)}),()=>{l=!1}},[]),a||!t||!r?g.jsx(aZ,{children:g.jsx(PL,{children:g.jsx(kN,{sx:{alignItems:"center",justifyContent:"center",height:"200px",color:"text.secondary"},children:"Loading explorer..."})})}):g.jsx(ove,{...e,explorerComponents:t,QueryBuilder:r,resourceUri:e.resourceUri})}function $F(e,t=!0){const{modelPath:n,environmentName:r,packageName:o,versionId:a}=ao(e),{apiClients:i}=wr();return Jr({queryKey:["package",r,o,n,a],queryFn:async()=>(await i.models.getModel(r,o,n,a)).data,enabled:t})}function PF({data:e,onChange:t,existingQuery:n,initialSelectedSourceIndex:r=0,onSourceChange:o,resourceUri:a,givens:i,onGivensChange:l,startingGivens:c}){const[f,u]=pn.useState(r);pn.useEffect(()=>{u(r)},[r]);const{data:h,isError:m,isLoading:v,error:b}=$F(a,!e),{environmentName:x,packageName:w,modelPath:S,versionId:R}=ao(a),E=e||h,M=pn.useMemo(()=>E?.givens??[],[E]),$=xE({specs:M,loaded:!!E,params:i,onGivensChange:l,startingValues:c,documentKey:a,autorun:!0,environmentName:x??"",packageName:w??"",modelPath:S,versionId:R,documentName:S}),D=k.useMemo(()=>ny($.applied,$.declaredTypes),[$.applied,$.declaredTypes]),F=k.useMemo(()=>tve(M,$.applied),[M,$.applied]);if(v&&!e)return g.jsx(ma,{text:"Fetching Model..."});if(m&&!e)return console.log("error",b),g.jsx(Ta,{error:b,context:`ModelExplorer > ${S}`});if(!E)return g.jsx(ma,{text:bp.loading});const I=(E?.sourceInfos||[]).map((z,L)=>{try{return JSON.parse(z)?.name||`Source ${L+1}`}catch{return`Source ${L+1}`}}),U=I[f]||"";return g.jsxs(rZ,{variant:"outlined",children:[g.jsx(oZ,{children:g.jsx(fr,{sx:{flexDirection:"row"},children:g.jsx(Lge,{size:"small",id:"size-small-standard",disablePortal:!0,options:I,value:U,onChange:(z,L)=>{if(!L)return;const C=I.indexOf(L);C>=0&&(u(C),o?.(C))},renderInput:z=>g.jsx(hr,{...z}),style:{width:350,marginTop:"3px",marginLeft:"6px",marginBottom:"8px"}})})}),g.jsx(GE,{...$.panel}),g.jsx(OL,{children:g.jsxs(fr,{spacing:2,component:"section",children:[Array.isArray(E.sourceInfos)&&E.sourceInfos.length>0&&g.jsx(rve,{sourceAndPaths:E.sourceInfos.map(z=>({sourceInfo:JSON.parse(z),modelPath:S})),selectedSourceIndex:f,existingQuery:n,onQueryChange:t,resourceUri:a,givens:D,gate:F}),g.jsx(Lt,{height:"5px"})]})})]})}function AF({open:e,onClose:t,resourceUri:n,data:r,title:o="Data Sources",hasValidImport:a=!0,existingQuery:i,initialSelectedSourceIndex:l,onChange:c,onSourceChange:f,givens:u,onGivensChange:h,startingGivens:m}){return g.jsxs(M0,{open:e,onClose:t,fullScreen:!0,children:[g.jsxs(P0,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[o,g.jsx(Lo,{onClick:t,sx:{color:"text.secondary"},children:g.jsx(ex,{})})]}),g.jsx($0,{children:a?g.jsx(PF,{resourceUri:n,data:r,existingQuery:i,initialSelectedSourceIndex:l,onChange:c,onSourceChange:f,givens:u,onGivensChange:h,startingGivens:m}):g.jsx("div",{children:"No valid import statement found in cell"})})]})}function k0e({onChange:e,resourceUri:t,runOnDemand:n=!1,maxResultSize:r=0,givens:o,onGivensChange:a}){const{modelPath:i}=ao(t),{data:l,isError:c,isLoading:f,error:u}=$F(t),[h,m]=pn.useState(!1),[v,b]=pn.useState(),[x,w]=pn.useState(0),[S,R]=k.useState(""),[E,M]=pn.useState({}),$=o??E,D=a??(C=>M(C)),F=l?.modelDef,I=pn.useMemo(()=>{if(!F)return!1;try{const C=JSON.parse(F);return Array.isArray(C.imports)&&C.imports.length>0}catch{return!1}},[F]);if(f)return g.jsx(ma,{text:"Fetching Model..."});if(c)return console.log("error",u),g.jsx(Ta,{error:u,context:`Model > ${i}`});const U=C=>{b(C),e&&e(C)},z=C=>{w(C)},L=()=>{const C=window.location.href;navigator.clipboard.writeText(C).then(()=>R("URL copied to clipboard!")).catch(()=>R("Failed to copy URL"))};return g.jsxs(g.Fragment,{children:[g.jsxs(Lt,{sx:{position:"relative",maxWidth:"1200px",margin:"0 auto",paddingTop:"24px"},children:[Array.isArray(l?.sourceInfos)&&l.sourceInfos.length>0&&g.jsxs(fr,{spacing:2,component:"section",children:[g.jsxs(Lt,{sx:{padding:"0 0 16px 0",display:"flex",alignItems:"center",justifyContent:"space-between"},children:[g.jsx(It,{variant:"h1",sx:{fontSize:"28px",fontWeight:"600",color:"#1a1a1a",marginBottom:"8px",marginTop:"0",paddingLeft:"0"},children:"Sources"}),g.jsx(Zi,{title:"Copy link",children:g.jsx(Lo,{size:"small","aria-label":"Copy link",onClick:L,sx:{color:"text.secondary"},children:g.jsx(TF,{fontSize:"small"})})})]}),g.jsx(PF,{data:l,onChange:U,onSourceChange:z,existingQuery:v,initialSelectedSourceIndex:x,resourceUri:t,givens:$,onGivensChange:D}),g.jsx(cp,{"aria-label":"Expand results",sx:{position:"absolute",top:"90px",right:"4px",zIndex:2},onClick:()=>m(!0),children:g.jsx(Gb,{})})]}),l?.queries?.length>0&&g.jsxs(fr,{spacing:2,component:"section",sx:{marginTop:"24px"},children:[g.jsx(Lt,{sx:{padding:"0 0 16px 0"},children:g.jsx(It,{variant:"h2",sx:{fontSize:"24px",fontWeight:"600",color:"#1a1a1a",marginBottom:"0",marginTop:"8px",paddingLeft:"0"},children:"Named Queries"})}),l.queries.map(C=>g.jsx(Jye,{queryName:C.name,annotations:C.annotations,resourceUri:t,runOnDemand:n,maxResultSize:r},C.name))]}),(!Array.isArray(l?.sourceInfos)||l.sourceInfos.length===0)&&!(l?.queries&&l.queries.length>0)&&g.jsxs(Lt,{sx:{textAlign:"center",py:6},children:[g.jsx(It,{variant:"body1",sx:{color:"text.secondary",marginBottom:"8px"},children:"This model exposes no sources or queries."}),I&&g.jsxs(It,{variant:"body2",color:"text.secondary",children:["It imports other files but re-exports nothing. Add"," ",g.jsxs("code",{children:["export ","{ source_name }"]})," to surface imported sources here."]})]}),g.jsx(AF,{open:h,onClose:()=>m(!1),resourceUri:t,data:l,title:`Model: ${i.split("/").pop()}`,existingQuery:v,initialSelectedSourceIndex:x,onChange:U,onSourceChange:z,givens:$,onGivensChange:D})]}),g.jsx(A0,{open:S!=="",autoHideDuration:6e3,onClose:()=>R(""),message:S})]})}function ive({ready:e,lastRunKey:t,pendingKey:n,runKey:r,documentKey:o}){if(!e)return{cancelPending:n!==void 0,dispatch:"none"};const a=n!==void 0&&n!==r;if(t===r)return{cancelPending:a,dispatch:"none"};if(n===r)return{cancelPending:a,dispatch:"none"};const i=t===null||!t.startsWith(`${o}|`);return{cancelPending:a,dispatch:i?"now":"settle"}}function sve(e){return k.useMemo(()=>{if(!e?.sources?.length)return[];const t=new Map;for(const n of e.sources)if(n.givens?.length)for(const r of n.givens)r.name&&!t.has(r.name)&&t.set(r.name,r);return Array.from(t.values())},[e])}const lve=400;function cve(e){return e.kind?e.kind==="query":e.type==="code"}const DF=e=>e.proseLines!==void 0;function oR({text:e,proseLines:t}){return(e??"").split(`
480
480
  `).filter((n,r)=>!t?.some(([o,a])=>r>=o&&r<=a))}function uve(e){if(DF(e)||e.caption!==void 0)return e.caption;const t=[];for(const n of oR(e)){const r=n.trim();if(!r.startsWith("//")){if(!r.startsWith("#"))break;r.startsWith('#"')&&t.push(r.slice(2).trim())}}return t.length>0?t.join(" "):void 0}function dve(e){return DF(e)?oR(e).join(`
481
481
  `):e.text.split(`
482
482
  `).filter(t=>!t.trimStart().startsWith("##")).join(`
483
483
  `)}function fve(e){const t=e.codeLine!==void 0?(e.text.split(`
484
- `)[e.codeLine]??"").trim():oR(e).map(o=>o.trim()).find(o=>o&&!o.startsWith("#")&&!o.startsWith("//"))??"",n=/^(source|query|given|type):?\s+([A-Za-z_]\w*)/.exec(t);if(n)return`${n[1]}: ${n[2]}`;const r=/^(import|export)\b/.exec(t);return r?r[1]:t}const pve=tr(g.jsx("path",{d:"M10 6 8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z"})),hve=tr(g.jsx("path",{d:"M16.59 8.59 12 13.17 7.41 8.59 6 10l6 6 6-6z"})),mve=tr(g.jsx("path",{d:"M9.4 16.6 4.8 12l4.6-4.6L8 6l-6 6 6 6zm5.2 0 4.6-4.6-4.6-4.6L16 6l6 6-6 6z"}));function gve({cell:e,resourceUri:t,showCopyLink:n,maxResultSize:r,isExecuting:o,pendingRerun:a,onNavigate:i,onDrillSelf:l,canDrillSelf:c,onDrillNavigate:f,givens:u,givenSpecs:h}){const[m,v]=pn.useState(!1),[b,x]=pn.useState(!1),[w,S]=pn.useState(),[R,E]=pn.useState(!1),[M,$]=k.useState(!1),D=k.useId(),[F,I]=k.useState(""),{environmentName:U,packageName:z,modelPath:L}=ao(t),C={environmentName:U,packageName:z,sourcePath:L,onNavigate:i},{drill:j,drillMenu:N}=Pz({onNavigate:f,onSelf:l,canSelf:c,selfLabel:"Filter this notebook"}),V=/import\s*\{([^}]+)\}\s*from\s*['"`][^'"`]+['"`]/,A=/import\s*(?:\{[^}]*\}\s*from\s*)?['"`]([^'"`]+)['"`]/,Y=!!e.text&&(V.test(e.text)||A.test(e.text)),W=()=>{if(!e.newSources||e.newSources.length===0)return 0;let J=[],ne="";if(e.text){const ee=e.text.match(V);ee&&(J=ee[1].split(",").map(pe=>pe.trim()));const ue=e.text.match(A);ue&&(ne=ue[1].trim())}for(let ee=0;ee<e.newSources.length;ee++)try{const ue=JSON.parse(e.newSources[ee]);if(J.length>0&&J.includes(ue.name)||ne&&ne===ue.path)return ee}catch{continue}return 0},re=pn.useMemo(()=>e.newSources&&e.newSources.length>0?{sourceInfos:e.newSources,resource:t,givens:h}:void 0,[e.newSources,t,h]),{mode:Q}=is();k.useEffect(()=>{e.type==="code"&&OF(dve(e),"malloy",Q).then(J=>{S(J)})},[e,Q]);const oe=e.kind==="query"?uve(e):void 0,ce=e.markdown?g.jsx(Jm,{variant:"document",links:C,children:e.markdown}):null,Z=()=>{const J=window.location.href;navigator.clipboard.writeText(J).then(()=>I("URL copied to clipboard!")).catch(()=>I("Failed to copy URL"))},ae=g.jsx(Yo,{open:m,onClose:()=>v(!1),title:"Malloy code",maxWidth:"lg",showClose:!0,children:g.jsx(Lt,{sx:J=>({border:`1px solid ${J.palette.divider}`,borderRadius:"8px",padding:"16px",fontFamily:jo,fontSize:"14px",lineHeight:"1.5",overflow:"auto",maxHeight:"70vh",backgroundColor:J.palette.background.paper,color:J.palette.text.primary}),children:g.jsx("pre",{className:"code-display",style:{margin:0},dangerouslySetInnerHTML:{__html:w}})})});return e.type==="markdown"&&g.jsx(Lt,{children:g.jsxs(Lt,{children:[n?g.jsxs(fr,{direction:"row",alignItems:"flex-start",justifyContent:"space-between",children:[g.jsx(Jm,{variant:"document",links:C,children:e.text}),g.jsx(Zi,{title:"Copy link",children:g.jsx(Lo,{"aria-label":"Copy link",onClick:Z,sx:{color:"text.secondary",mt:"18px"},children:g.jsx(TF,{sx:{fontSize:"24px"}})})})]}):g.jsx(Jm,{variant:"document",links:C,children:e.text}),g.jsx(A0,{open:F!=="",autoHideDuration:6e3,onClose:()=>I(""),message:F})]})})||e.kind==="definition"&&g.jsxs(Lt,{children:[ce,g.jsxs(Lt,{component:"button",type:"button","aria-expanded":M,"aria-controls":D,onClick:()=>$(J=>!J),sx:{display:"flex",alignItems:"center",gap:"4px",p:0,border:0,background:"none",cursor:"pointer",fontFamily:jo,fontSize:"13px",color:"text.secondary"},children:[M?g.jsx(hve,{fontSize:"small"}):g.jsx(pve,{fontSize:"small"}),fve(e)]}),M&&g.jsx(Lm,{id:D,sx:{mt:1,padding:"12px 24px"},children:g.jsx("pre",{className:"code-display",style:{margin:0,overflow:"auto"},dangerouslySetInnerHTML:{__html:w??""}})})]})||e.type==="code"&&g.jsxs(Lt,{children:[ce,oe&&g.jsx(It,{variant:"body2",sx:{color:"text.secondary",mb:1},children:oe}),e.newSources&&e.newSources.length>0&&g.jsx(fr,{sx:{flexDirection:"column",gap:"8px",marginBottom:"2px"},children:g.jsx(Lm,{sx:{position:"relative",padding:"0"},children:g.jsxs(Lt,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",paddingLeft:"24px",paddingRight:"8px"},children:[w&&g.jsx("span",{dangerouslySetInnerHTML:{__html:w},style:{fontFamily:jo,fontSize:"14px",flex:1,marginRight:"8px"}}),Y&&g.jsx(cp,{"aria-label":"Data sources",sx:{flexShrink:0},onClick:()=>E(!0),children:g.jsx(Gb,{})})]})})}),g.jsx(AF,{open:R,onClose:()=>E(!1),title:"Data Sources",hasValidImport:Y,resourceUri:t,data:re,initialSelectedSourceIndex:W(),startingGivens:u}),ae,g.jsx(MF,{open:b,onClose:()=>x(!1),result:e.result||"",title:"Results",drill:j}),o&&!e.result&&!e.error&&!Y&&!(e.newSources&&e.newSources.length>0)&&g.jsx(Lm,{sx:{display:"flex",justifyContent:"center",alignItems:"center",minHeight:200},children:g.jsx(Ug,{size:32})}),!e.result&&e.error&&g.jsx(xz,{summary:"This cell could not be run.",detail:e.error}),e.result&&a&&g.jsx(nY,{"aria-label":"Re-run pending",sx:{mb:1,height:2,borderRadius:1}}),e.result&&g.jsxs(Lm,{sx:{position:"relative"},children:[g.jsx(Lt,{sx:{paddingTop:"24px"},children:g.jsx(KE,{result:e.result,maxHeight:mhe,maxResultSize:r,drill:j})}),N,g.jsxs(fr,{sx:{position:"absolute",top:"-12px",right:"8px",flexDirection:"row",gap:"8px",alignItems:"center",zIndex:2},children:[g.jsx(cp,{"aria-label":"Malloy code",onClick:J=>{J.stopPropagation(),v(!0)},children:g.jsx(mve,{})}),g.jsx(cp,{"aria-label":"Expand results",onClick:()=>x(!0),children:g.jsx(Gb,{})})]})]})]})}const yve=4;function vve(e){const t=e?.response?.data?.message;return typeof t=="string"&&t!==""?t:e instanceof Error&&e.message!==""?e.message:"The server did not say why."}function jF(e){const{apiClients:t}=wr(),{environmentName:n,packageName:r,versionId:o,modelPath:a}=ao(e);return Jr({queryKey:[e],queryFn:async()=>(await t.notebooks.getNotebook(n,r,a,o)).data})}function bve(e){const{data:t}=jF(e.resourceUri);if(t?.dashboard){const{environmentName:n,packageName:r,versionId:o,modelPath:a}=ao(e.resourceUri),{title:i,description:l}=t.dashboard;return g.jsx(ML,{children:g.jsxs($L,{children:[(i||l)&&g.jsx(Lt,{sx:{mb:2},children:g.jsx(oF,{chrome:"none",title:i??"",...l?{description:l}:{}})}),g.jsx(nF,{manifest:t.dashboard,environmentName:n,packageName:r,versionId:o,documentName:a,givens:e.givens,onGivensChange:e.onGivensChange,onNavigate:e.onDrillNavigate,maxResultSize:e.maxResultSize,chrome:"none",controlsLayout:"panel"})]})})}return g.jsx(xve,{...e})}function xve({resourceUri:e,maxResultSize:t=0,givens:n,onGivensChange:r,onNavigate:o,onDrillNavigate:a}){const{apiClients:i}=wr(),{environmentName:l,packageName:c,versionId:f,modelPath:u}=ao(e),{data:h,isSuccess:m,isError:v,error:b}=jF(e),[x,w]=k.useState([]),[S,R]=k.useState(!1),[E,M]=k.useState(!1),$=k.useRef(void 0),[D,F]=k.useState(null),I=sve(h),U=h?.autorun!==!1,z=xE({specs:I,loaded:m,startingValues:h?.startingGivens,params:n,onGivensChange:r,documentKey:e,autorun:U,environmentName:l,packageName:c,modelPath:u,versionId:f,documentName:u}),{applied:L,declaredTypes:C,canSelf:j,onSelf:N}=z,V=k.useCallback(ee=>{const ue=ny(ee,C);return Object.keys(ue).length>0?JSON.stringify(ue):void 0},[C]),A=k.useMemo(()=>Oz(L,C),[L,C]),Y=k.useRef(0),W=k.useRef(null),re=k.useRef(null),Q=k.useRef(void 0);k.useEffect(()=>()=>{W.current?.abort(),re.current=null,clearTimeout(Q.current?.timer),Q.current=void 0},[]);const oe=k.useCallback(async(ee=new Map)=>{if(!m||!h?.notebookCells)return;const ue=++Y.current;W.current?.abort();const pe=new AbortController;W.current=pe,w(h.notebookCells.map(ie=>({...ie}))),R(!0),F(null);const ye=V(ee);try{const ie=[];for(let le=0;le<h.notebookCells.length;le++){const be=h.notebookCells[le];if(!cve(be))continue;const Ve=le,Re=async()=>{try{const Oe=await i.notebooks.executeNotebookCell(l,c,u,Ve,f,void 0,void 0,ye,{signal:pe.signal});if(Y.current!==ue)return;const de=Oe.data,at=de.result,Ne=be.newSources||de.newSources;w(Je=>{const tt=[...Je];return tt[Ve]||(tt[Ve]={...be}),tt[Ve]={...tt[Ve],result:at,newSources:Ne},tt})}catch(Oe){if(pe.signal.aborted||Y.current!==ue)return;console.error(`Error executing cell ${Ve}:`,Oe);const de=vve(Oe);w(at=>{const Ne=[...at];return Ne[Ve]||(Ne[Ve]={...be}),Ne[Ve]={...Ne[Ve],error:de},Ne})}};ie.push(Re)}const he=[];for(const le of ie){const be=le().then(()=>{he.splice(he.indexOf(be),1)});he.push(be),he.length>=yve&&await Promise.race(he)}await Promise.all(he)}catch(ie){if(pe.signal.aborted||Y.current!==ue)return;console.error("Error executing notebook cells:",ie),F(ie)}finally{Y.current===ue&&(R(!1),W.current=null)}},[m,h,V,l,c,u,f,i.notebooks]),ce=k.useRef(0),Z=k.useRef(void 0);Z.current!==h&&(Z.current=h,ce.current+=1);const ae=ce.current;k.useEffect(()=>{const ee=`${e}|${ae}`,ue=`${ee}|${V(L)??""}`;$.current!==void 0&&$.current!==ee&&(W.current?.abort(),W.current=null),$.current=ee;const pe=ive({ready:m&&!!h?.notebookCells,lastRunKey:re.current,pendingKey:Q.current?.key,runKey:ue,documentKey:ee});if(pe.cancelPending&&(clearTimeout(Q.current?.timer),Q.current=void 0,M(!1)),pe.dispatch==="none")return;const ye=()=>{Q.current=void 0,M(!1),re.current=ue,oe(L)};if(pe.dispatch==="now"){ye();return}M(!0),Q.current={key:ue,timer:setTimeout(ye,lve)}},[m,h,ae,e,L,V,oe]);const J=x.length>0?x:h?.notebookCells||[],ne=h?.format==="malloy"?J.findIndex(ee=>ee.type==="markdown"):0;return g.jsx(ML,{children:g.jsx($L,{children:g.jsxs(fr,{spacing:3,component:"section",children:[g.jsx(GE,{...z.panel}),!m&&!v&&g.jsx(ma,{text:bp.opening("notebook")}),m&&J.map((ee,ue)=>g.jsx(gve,{cell:ee,showCopyLink:ue===ne,resourceUri:e,maxResultSize:t,isExecuting:S,givens:A,givenSpecs:I,pendingRerun:E,onNavigate:o,onDrillNavigate:a,onDrillSelf:I.length>0?N:void 0,canDrillSelf:j},ue)),v&&b.status===404&&g.jsxs(It,{variant:"body2",sx:{color:"text.secondary"},children:[g.jsx("code",{children:`${l} > ${c} > ${u}`})," ","not found."]}),v&&b.status!==404&&g.jsx(Ta,{error:b,context:`${l} > ${c} > ${u}`}),D&&g.jsx(Ta,{error:{message:D.message,status:500,name:"ExecutionError"},context:"Notebook Execution"})]})})})}const Sve=tr(g.jsx("path",{d:"m7 10 5 5 5-5z"})),Bv={dashboard:"Dashboard",notebook:"Notebook"};function wve({open:e,kind:t,allowKindChange:n=!0,environmentName:r,packageName:o,versionId:a,models:i,modelsLoading:l=!1,modelsError:c,onRetryModels:f,target:u,savedAs:h,onClose:m,onCreated:v,onEvent:b}){const[x,w]=k.useState(t),[S,R]=k.useState(""),[E,M]=k.useState(""),[$,D]=k.useState(""),[F,I]=k.useState(!1),[U,z]=k.useState(!1),[L,C]=k.useState(!1),[j,N]=k.useState(void 0),V=c!=null,{choices:A,isLoading:Y,isSuccess:W,failed:re,retry:Q,canRetry:oe}=nme({environmentName:r,packageName:o,...a!==void 0?{versionId:a}:{},models:i,enabled:e&&i.length>0}),ce=k.useMemo(()=>A.get(S)??[],[A,S]),Z=ce.find(Re=>`${Re.source}::${Re.view}`===E);k.useEffect(()=>{e&&w(t)},[e,t]),k.useEffect(()=>{if(!e)return;const Re=[...A.keys()];S===""&&Re.length>0&&R(Re[0])},[e,A,S]),k.useEffect(()=>{!e||ce.length===0||E!==""||M(`${ce[0].source}::${ce[0].view}`)},[e,ce,E]),k.useEffect(()=>{!e||F||Z===void 0||D(Z.view.replace(/_/g," "))},[e,F,Z]),k.useEffect(()=>{e||(R(""),M(""),D(""),I(!1),z(!1),N(void 0))},[e]);const ae=k.useMemo(()=>{if($.trim()!=="")for(let Re=1;Re<=qb;Re++){const Oe=EC(x,$,Re);if(!u.existing?.includes(Oe))return Oe}},[x,$,u]),J=(Z===void 0?void 0:XE(x,{title:$,modelPath:S,source:Z.source,view:Z.view}))??($.trim()!==""&&ae===void 0?"No free file name for this title; choose another.":void 0),ne=J!==void 0&&(U||$.trim()!==""),ee=l||Y,ue=A.size===0&&(V||re.length>0),pe=ee?"Loading model views":ue?"Couldn't read the model views to start from":A.size===0?"No model view to start from yet":Z===void 0?"Pick a view to start from":void 0,ye=Bv[x].toLowerCase(),ie=L?`Creating ${ye}…`:`Create ${ye}`,he=x==="dashboard"?"First tile":"First query",le=E!==""&&Z===void 0&&ce.length>0,be=async()=>{if(!(pe!==void 0||Z===void 0||L)){if(J!==void 0){z(!0);return}C(!0),N(void 0);try{const Re=await Jhe({kind:x,document:{title:$,modelPath:S,source:Z.source,view:Z.view},target:u,...b?{onEvent:b}:{}});v(Re)}catch(Re){const Oe=Re.response?.data?.message;N(Oe??(Re instanceof Error?Re.message:String(Re)))}finally{C(!1)}}},Ve=Re=>g.jsx(eo,{color:"inherit",size:"small",onClick:Re,children:"Retry"});return g.jsx(Yo,{open:e,onClose:L?()=>{}:m,title:`New ${ye}`,description:x==="dashboard"?"A dashboard is a Malloy file in the package. Pick what its first tile shows; the rest is the builder.":"A notebook is a Malloy file in the package that mixes text and queries. Pick what its first query runs; the rest is the builder.",actions:g.jsxs(g.Fragment,{children:[g.jsx(eo,{onClick:m,disabled:L,children:"Cancel"}),g.jsx(Zi,{title:L?"":pe??"",children:g.jsx("span",{children:g.jsx(eo,{variant:"contained",disabled:L||pe!==void 0,"aria-label":!L&&pe!==void 0?`${ie}: ${pe}`:ie,onClick:()=>void be(),children:ie})})})]}),children:g.jsxs(fr,{sx:{gap:2,pt:1},children:[V?g.jsx(qi,{severity:"error",action:f&&WL(c)?Ve(f):void 0,children:"Couldn't read this package's models, so no view is listed to start from."}):i.length===0?!l&&g.jsxs(qi,{severity:"info",children:["This package has no models yet. Add a .malloy file that declares a source with a view, then create a ",ye," from it."]}):re.length>0?g.jsxs(qi,{severity:"warning",action:oe?Ve(Q):void 0,children:["Couldn't read ",re.join(", "),", so"," ",re.length===1?"its":"their"," views aren't listed."]}):W&&A.size===0&&g.jsxs(qi,{severity:"info",children:["A ",ye," starts from a view of a source, and no model in this package declares one yet. Add a view to a source in a model file and this list fills in."]}),n&&g.jsx(Ca,{select:!0,size:"small",label:"Type",value:x,disabled:L,onChange:Re=>w(Re.target.value),inputProps:{"aria-label":"Type"},children:Object.keys(Bv).map(Re=>g.jsx(na,{value:Re,children:Bv[Re]},Re))}),g.jsx(Ca,{select:!0,size:"small",label:"Model",value:A.has(S)?S:"",disabled:A.size===0||L,onChange:Re=>{R(Re.target.value),M("")},inputProps:{"aria-label":"Model"},helperText:ee?"Reading the package's models…":A.size===1?"The only model with a view to start from.":"Models with a view to start from.",children:[...A.keys()].map(Re=>g.jsx(na,{value:Re,children:Re},Re))}),g.jsx(Ca,{select:!0,size:"small",label:he,value:Z?E:"",disabled:ce.length===0||L,onChange:Re=>M(Re.target.value),inputProps:{"aria-label":he},error:le,helperText:le?"The view you picked is no longer in this model; pick another.":ce.length===1?"The only view this model offers; more are added in the builder.":"A view of a source; more are added in the builder.",children:ce.map(Re=>g.jsxs(na,{value:`${Re.source}::${Re.view}`,children:[Re.source," → ",Re.view]},`${Re.source}::${Re.view}`))}),g.jsx(Ca,{size:"small",label:"Title",value:$,disabled:L,onChange:Re=>{I(!0),D(Re.target.value)},inputProps:{"aria-label":`${Bv[x]} title`},error:ne,helperText:ne?J:ae?u.route==="package"?`Written as ${ae}, and opened in the builder.`:h??`Saved as a new ${ye} in the host's store, and opened in the builder.`:"Names the file too."}),j&&g.jsx(qi,{severity:"error",children:j})]})})}const Cve={dashboard:qr.blue,report:qr.violet,model:qr.cyan,dataApp:qr.pink,data:qr.lime,materialization:qr.amber};function kve({type:e,size:t=18,sx:n,...r}){return g.jsx(Nb,{...r,viewBox:"0 0 24 24",sx:{width:t,height:t,fill:"none",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round",...n},children:Eve[e]()})}const Eve={report:Rve,model:Tve,data:Ove,materialization:Mve,dataApp:Pve,dashboard:$ve};function Rve(){return g.jsxs(g.Fragment,{children:[g.jsx("path",{d:"M14 3 H6 a2 2 0 0 0 -2 2 v14 a2 2 0 0 0 2 2 h12 a2 2 0 0 0 2 -2 V9 z"}),g.jsx("path",{d:"M14 3 v4 a2 2 0 0 0 2 2 h4"}),g.jsx("path",{d:"M8 17 v-3"}),g.jsx("path",{d:"M12 17 v-6"}),g.jsx("path",{d:"M16 17 v-4"})]})}function Tve(){return g.jsxs(g.Fragment,{children:[g.jsx("path",{d:"M12 3 L4 7 v10 l8 4 l8 -4 V7 z"}),g.jsx("path",{d:"M4 7 l8 4 l8 -4"}),g.jsx("path",{d:"M12 11 v10"})]})}function Ove(){return g.jsxs(g.Fragment,{children:[g.jsx("rect",{x:"3.5",y:"3.5",width:"17",height:"17",rx:"2"}),g.jsx("path",{d:"M3.5 9.5 H20.5"}),g.jsx("path",{d:"M9.5 3.5 V20.5"})]})}function Mve(){return g.jsxs(g.Fragment,{children:[g.jsx("path",{d:"M12 3 L21 7.5 L12 12 L3 7.5 Z"}),g.jsx("path",{d:"M3 12 L12 16.5 L21 12"}),g.jsx("path",{d:"M3 16.5 L12 21 L21 16.5"})]})}function $ve(){return g.jsxs(g.Fragment,{children:[g.jsx("rect",{x:"3.5",y:"3.5",width:"17",height:"17",rx:"2"}),g.jsx("path",{d:"M3.5 9.5 H20.5"}),g.jsx("path",{d:"M12 9.5 V20.5"}),g.jsx("path",{d:"M12 15 H20.5"})]})}function Pve(){return g.jsxs(g.Fragment,{children:[g.jsx("rect",{x:"3.5",y:"4.5",width:"17",height:"15",rx:"2"}),g.jsx("path",{d:"M3.5 9.5 H20.5"}),g.jsx("path",{d:"M7 13.5 H17"}),g.jsx("path",{d:"M7 16.5 H13"})]})}const Ave=/^(?:dashboards|notebooks)\/([^/]+)\.malloy$/,DC=e=>Ave.exec(e??"")?.[1],Dve=(e,t,n,r)=>`/${e}/${t}/${n}s/${encodeURIComponent(r)}`;function jve({kind:e,slug:t,dashboards:n,notebooks:r}){const o=()=>{const i=n.find(l=>l.name===t&&l.path);return i?.path?{kind:"dashboard",path:i.path}:void 0},a=()=>{const i=r.find(l=>DC(l.path)===t);return i?.path?{kind:"notebook",path:i.path}:void 0};return e==="dashboard"?o()??a():a()??o()}const Nve="README.malloynb",Ive=e=>e?.toLowerCase()==="notebooks/readme.malloy",pj=(e,t,n)=>`${e}/${t}/${n}s/`;function E0e({onClickPackageFile:e,onOpenDocument:t,resourceUri:n}){const{apiClients:r,server:o,mutable:a}=wr(),i=Rd(),l=e??(ie=>{window.location.href=ie}),{environmentName:c,packageName:f,versionId:u}=ao(n),h=t??((ie,he)=>{const le=`${Dve(c,f,ie.kind,ie.slug)}${ie.mode==="edit"?"/edit":""}`;he?l(le,he):l(le)}),[m,v]=k.useState(null),[b,x]=k.useState(void 0),[w,S]=k.useState(null),R=mme(),E=ome()?.documentStorage,[M,$]=k.useState([]),[D,F]=k.useState({state:E?"pending":"ready"}),I=k.useCallback(async()=>{if(!E)return;let ie;try{ie=await E.listWorkspaces(!1)}catch{F({state:"failed"});return}F({state:"ready",chosen:_he(ie)});const he=[];for(const le of ie.filter(be=>be.writeable))for(const be of["dashboard","notebook"])for(const Ve of await E.listDocuments(le,be))Ve.path.startsWith(pj(c,f,be))&&he.push({locator:Ve,where:le.description});$(he)},[E,c,f]);k.useEffect(()=>{I()},[I]);const U=ie=>ie.path.slice(pj(c,f,ie.type).length).replace(/\.malloy$/,""),z=Jr({queryKey:["package",c,f,u],queryFn:()=>r.packages.getPackage(c,f,u,!1)}),L=Jr({queryKey:["notebooks",c,f,u],queryFn:async()=>{try{return await r.notebooks.listNotebooks(c,f,u)}catch(ie){const he=ie?.response?.status;if(he===404||he===void 0)return{data:[]};throw ie}}}),C=Jr({queryKey:["models",c,f,u],queryFn:()=>r.models.listModels(c,f,u)}),j=Jr({queryKey:["databases",c,f,u],queryFn:()=>r.databases.listDatabases(c,f,u)}),N=Jr({queryKey:["data-apps",c,f],queryFn:async()=>{try{return await r.dataApps.listDataApps(c,f)}catch(ie){const he=ie?.response?.status;if(he===404||he===void 0)return{data:[]};throw ie}}}).data?.data??[],V=Jr({queryKey:["dashboards",c,f,u],queryFn:async()=>{try{return await r.dashboards.listDashboards(c,f,u)}catch(ie){const he=ie?.response?.status;if(he===404||he===void 0)return{data:[]};throw ie}}}),A=V.data?.data??[],Y=(L.data?.data??[]).slice().sort((ie,he)=>(ie.path??"").localeCompare(he.path??"")),W=Lve(A,Y),re=new Set(A.map(ie=>ie.path).filter(ie=>ie!==void 0)),Q=(C.data?.data??[]).slice().filter(ie=>!re.has(ie.path)).sort((ie,he)=>ie.path.localeCompare(he.path)),oe=(j.data?.data??[]).slice().sort((ie,he)=>ie.path.localeCompare(he.path)),ce=D.state==="ready"?Zhe({authoritative:D.chosen?.authoritative===!0,mutable:a,canStore:D.chosen?.writeable===!0,...u===void 0?{}:{versionId:u}}):void 0,Z=[V,L,C].every(ie=>ie.isSuccess||ie.isError),ae=ce!==void 0&&Z,J=ae&&!R,ne=k.useMemo(()=>{if(!ae)return;const ie=[...(V.data?.data??[]).flatMap(he=>he.path?[he.path]:[]),...(L.data?.data??[]).flatMap(he=>he.path?[he.path]:[]),...(C.data?.data??[]).flatMap(he=>he.path?[he.path]:[])];if(ce==="storage"&&E&&D.state==="ready")return D.chosen?{route:ce,storage:E,workspace:D.chosen,environmentName:c,packageName:f,existing:ie}:void 0;if(ce==="package")return{route:ce,existing:ie,write:async(he,le)=>{await r.models.updateModelSource(c,f,he,{source:le})}}},[ae,ce,E,D,c,f,r,V.data,L.data,C.data]),ee=z.data?.data?.description??"",ue=(Y.find(ie=>ie.path===Nve)??Y.find(ie=>Ive(ie.path)))?.path,pe=mE({environmentName:c,packageName:f,versionId:u,modelPath:ue}),ye=!L.isSuccess&&!L.isError||!V.isSuccess&&!V.isError;return z.isError?g.jsx(Ta,{error:z.error,context:`${c} > ${f}`}):g.jsxs(Pk,{maxWidth:!1,sx:{maxWidth:1024,mx:"auto",px:3,py:6},children:[g.jsxs(Lt,{sx:{mb:4},children:[g.jsx(It,{variant:"h4",component:"h1",sx:{fontWeight:600,letterSpacing:"-0.025em",mb:.5},children:f}),ee&&g.jsx(It,{variant:"body2",color:"text.secondary",children:ee})]}),ye&&g.jsx(ma,{text:"Loading package..."}),g.jsx(ru,{anchorEl:w,open:w!==null,onClose:()=>S(null),children:["dashboard","notebook"].map(ie=>g.jsx(na,{onClick:()=>{S(null),x(ie)},children:ie==="dashboard"?"Dashboard":"Notebook"},ie))}),ne&&g.jsx(wve,{open:b!==void 0,kind:b??"dashboard",environmentName:c,packageName:f,...u!==void 0?{versionId:u}:{},models:Q.map(ie=>ie.path).filter(ie=>typeof ie=="string"&&ie.endsWith(".malloy")&&!ie.startsWith("dashboards/")&&!ie.startsWith("notebooks/")),modelsLoading:C.isPending,...C.isError?{modelsError:C.error}:{},onRetryModels:()=>void C.refetch(),target:ne,onClose:()=>x(void 0),onCreated:ie=>{x(void 0);for(const he of["dashboards","notebooks","models"])i.invalidateQueries({queryKey:[he]});h({kind:ie.kind,slug:ie.slug,mode:"edit"})}}),!ye&&g.jsxs(g.Fragment,{children:[(V.isError||L.isError)&&g.jsx(Lt,{sx:{mb:4},children:g.jsx(qi,{severity:"warning",children:"Could not list some artifacts, so any this package has are missing from this page."})}),(W.length>0||ae)&&g.jsxs(nl,{title:"Artifacts",count:W.length,...J?{action:g.jsx(eo,{variant:"outlined",size:"small",endIcon:g.jsx(Sve,{}),"aria-haspopup":"menu","aria-label":"New",onClick:ie=>S(ie.currentTarget),children:"New"})}:{},children:[W.length===0&&g.jsx(nw,{label:"No artifacts yet",...J?{action:{label:"New artifact",onClick:ie=>S(ie.currentTarget)}}:{}}),W.map(ie=>g.jsx(Mm,{type:ie.kind==="dashboard"?"dashboard":"report",label:ie.label,...ie.secondary===void 0?{}:{description:ie.secondary},onClick:he=>ie.slug===void 0?l(`/${c}/${f}/${ie.path}`,he):h({kind:ie.kind,slug:ie.slug,mode:"view"},he)},`${ie.kind}:${ie.path}`))]}),M.length>0&&g.jsx(nl,{title:"Drafts",count:M.length,children:M.map(({locator:ie,where:he})=>g.jsx(Mm,{type:ie.type==="dashboard"?"dashboard":"report",label:U(ie),rightLabel:he,onClick:le=>h({kind:ie.type,slug:U(ie),mode:"edit"},le),trailingAction:g.jsx(Zi,{title:"Delete this draft",children:g.jsx(Lo,{size:"small","aria-label":`Delete draft ${U(ie)}`,onClick:le=>{le.stopPropagation(),E?.deleteDocument(ie).then(I)},children:g.jsx(pre,{fontSize:"small"})})})},`${ie.type}:${ie.path}`))}),N.length>0&&g.jsx(nl,{title:"Data Apps",count:N.length,children:N.map(ie=>{const he=!!ie.title&&ie.title!==ie.path,le=`${fF(o)}${ie.resource}`;return g.jsx(Mm,{type:"dataApp",label:he?ie.title:ie.path,rightLabel:he?ie.path:void 0,onClick:be=>{e?e(`/${c}/${f}/data-apps/${ie.path}`,be):be&&(be.metaKey||be.ctrlKey)?window.open(le,"_blank"):window.location.href=le},trailingAction:g.jsx(Zi,{title:"Open standalone in new tab",children:g.jsx(Lo,{size:"small",href:le,target:"_blank",rel:"noopener noreferrer","aria-label":"Open standalone in new tab",onClick:be=>be.stopPropagation(),sx:{color:"text.secondary"},children:g.jsx(dF,{fontSize:"small"})})})},ie.path)})}),g.jsxs(nl,{title:"Semantic Models",count:Q.length,children:[Q.map(ie=>g.jsx(Mm,{type:"model",label:ie.path,onClick:he=>l(`/${c}/${f}/${ie.path}`,he)},ie.path)),Q.length===0&&g.jsx(nw,{label:"No models"})]}),g.jsxs(nl,{title:"Package Data",count:oe.length,children:[oe.map(ie=>g.jsx(Mm,{type:"data",label:ie.path,rightLabel:ie.info?zve(ie.info.rowCount):"Unreadable",onClick:()=>v(ie)},ie.path)),oe.length===0&&g.jsx(nw,{label:"No data files"})]}),g.jsx(Wye,{resourceUri:n}),ue&&g.jsx(Lt,{sx:{mt:6},children:g.jsx(bve,{resourceUri:pe,onNavigate:l})})]}),g.jsxs(Yo,{open:m!==null,onClose:()=>v(null),title:m?.path??"Columns",showClose:!0,children:[m?.error&&g.jsx(It,{variant:"body2",color:"error",children:m.error}),m?.info?.columns&&g.jsxs(Hg,{size:"small",children:[g.jsx(Wg,{children:g.jsxs(ll,{children:[g.jsx(Xn,{children:"Column"}),g.jsx(Xn,{children:"Type"})]})}),g.jsx(qg,{children:m.info.columns.map(ie=>g.jsxs(ll,{children:[g.jsx(Xn,{component:"th",scope:"row",children:ie.name}),g.jsx(Xn,{children:ie.type})]},ie.name))})]})]})]})}function Mm({type:e,label:t,description:n,rightLabel:r,onClick:o,trailingAction:a}){return g.jsx(mx,{icon:g.jsx(kve,{type:e}),tint:Cve[e],label:t,mono:!0,...n===void 0?{}:{description:n},...r===void 0?{}:{rightLabel:r},...o===void 0?{}:{onClick:o},...a===void 0?{}:{trailingAction:a}})}function Lve(e,t){const n=[...e.map(o=>({kind:"dashboard",path:o.path??"",slug:o.name??DC(o.path),title:o.title})),...t.map(o=>({kind:"notebook",path:o.path??"",slug:DC(o.path),title:o.title}))],r=new Map;for(const o of n)o.slug!==void 0&&r.set(o.slug,(r.get(o.slug)??0)+1);return n.map(({title:o,...a})=>{const i=!!o&&o!==a.slug&&o!==a.path,l=a.slug!==void 0&&(r.get(a.slug)??0)>1;return{...a,label:i?o:a.slug??a.path,secondary:(a.slug===void 0?i:l)?a.path:void 0}}).sort((o,a)=>o.label.localeCompare(a.label)||o.path.localeCompare(a.path))}function nw({label:e,action:t}){return g.jsxs(fr,{direction:"row",sx:{alignItems:"center",gap:1,py:1},children:[g.jsx(It,{variant:"body2",color:"text.secondary",sx:{fontStyle:"italic"},children:e}),t&&g.jsx(eo,{size:"small",onClick:t.onClick,children:t.label})]})}function zve(e){return e>=1e9?`${(e/1e9).toFixed(1)} B rows`:e>=1e6?`${(e/1e6).toFixed(1)} M rows`:e>=1e3?`${(e/1e3).toFixed(1)} K rows`:`${e} rows`}function R0e(e,t,n,r,o){const{apiClients:a}=wr(),i=Jr({queryKey:["dashboards",e,t,o],queryFn:()=>a.dashboards.listDashboards(e,t,o)}),l=Jr({queryKey:["notebooks",e,t,o],queryFn:()=>a.notebooks.listNotebooks(e,t,o)}),c=[i,l].every(f=>f.isSuccess||f.isError);return{settled:c,location:c?jve({kind:n,slug:r,dashboards:i.data?.data??[],notebooks:l.data?.data??[]}):void 0}}const jC={name:"Local",description:"Stored in this browser only",writeable:!0},NC="publisher:document:";class Fve{async listWorkspaces(t){return[jC]}async listDocuments(t,n){if(t.name!==jC.name)return[];const r=[];for(let o=0;o<localStorage.length;o++){const a=localStorage.key(o),i=a===null?void 0:_ve(a);i&&(n===void 0||i.type===n)&&r.push(i)}return r}async getDocument(t){const n=localStorage.getItem($m(t));if(n===null)throw hj(t);return n}async saveDocument(t,n){localStorage.setItem($m(t),n)}async deleteDocument(t){const n=$m(t);if(localStorage.getItem(n)===null)throw hj(t);localStorage.removeItem(n)}async moveDocument(t,n){const r=await this.getDocument(t);localStorage.setItem($m(n),r),localStorage.removeItem($m(t))}}function $m(e){return`${NC}${e.type}:${e.path}`}function _ve(e){if(!e.startsWith(NC))return;const t=e.slice(NC.length),n=t.indexOf(":");if(n<=0)return;const r=t.slice(0,n);if(!(r!=="dashboard"&&r!=="notebook"))return{workspace:jC.name,type:r,path:t.slice(n+1)}}function hj(e){return new aF(`No ${e.type} at ${e.workspace}/${e.path}`)}const mj="[publisher.dashboard]",gj="[publisher.notebook]",yj="[publisher.console]";function T0e(e){return t=>{const n=t.type.endsWith("_refused")||t.type==="dashboard.rows_shown"&&!t.ok,r={...e,...t,at:new Date().toISOString()};n?console.warn(mj,r):console.info(mj,r)}}function O0e(e){return t=>{const n={...e,...t,at:new Date().toISOString()};t.type.endsWith("_refused")?console.warn(gj,n):console.info(gj,n)}}function Uve(e){const t={...e,at:new Date().toISOString()};e.ok?console.info(yj,t):console.warn(yj,t)}const Mo={white:"#FFFFFF",offWhite:"#F8FAFC",grey:{light:"#E2E8F0",mid:"#64748B"},black:"#0F172A",semantic:{success:{main:qr.emerald,light:"#D1FAE5",dark:"#047857"},warning:{main:qr.amber,light:"#FEF3C7",dark:"#92400E"},error:{main:qr.red,light:"#FEE2E2",dark:"#B91C1C"},info:{main:qr.blue,light:"#DBEAFE",dark:"#1D4ED8"}}},Vv='"Inter", "Helvetica Neue", "Arial", sans-serif',Jo={50:Mo.offWhite,100:"#F1F5F9",200:Mo.grey.light,300:"#CBD5E1",400:"#94A3B8",500:Mo.grey.mid,600:"#475569",700:"#334155",800:"#1E293B",900:Mo.black},M0e={headerHeight:56},rw="0 1px 3px rgba(0, 0, 0, 0.1)",Bve="#0f172a",Vve="#1e293b",Hve="#f1f5f9",qve="#cbd5e1",Wve="#334155",NF=(e="light",t)=>{const n=e==="dark",r=n?Bve:Mo.white,o=n?Vve:Mo.white,a=n?Hve:Mo.black,i=n?qve:Mo.grey.mid,l=n?Wve:Mo.grey.light,{accent:c,accentHover:f,accentContrast:u}=t??Qw(void 0,e);return b0({cssVariables:{nativeColor:!0},palette:{mode:e,primary:{main:c,light:Mo.grey.light,dark:f,contrastText:u},secondary:{main:Mo.grey.mid,light:Mo.grey.light,dark:Mo.black},grey:Jo,success:Mo.semantic.success,warning:Mo.semantic.warning,error:Mo.semantic.error,info:Mo.semantic.info,background:{default:r,paper:o},text:{primary:a,secondary:i},divider:l},typography:{fontFamily:Vv,h1:{fontWeight:500,letterSpacing:"-0.025em"},h2:{fontWeight:500,letterSpacing:"-0.025em"},h3:{fontWeight:500,letterSpacing:"-0.025em"},h4:{fontWeight:500,letterSpacing:"-0.025em"},h5:{fontWeight:500,letterSpacing:"-0.025em"},h6:{fontWeight:500,letterSpacing:"-0.025em"},subtitle1:{fontWeight:500,letterSpacing:"-0.025em"},subtitle2:{fontWeight:500,letterSpacing:"-0.025em"},body1:{letterSpacing:"-0.025em"},body2:{letterSpacing:"-0.025em"},button:{fontWeight:500,letterSpacing:"-0.025em",textTransform:"none"}},shape:{borderRadius:4},components:{MuiButtonBase:{defaultProps:{disableRipple:!0,disableTouchRipple:!0},styleOverrides:{root:{"&:focus-visible":{outline:`2px solid ${c}`,outlineOffset:2}}}},MuiCssBaseline:{styleOverrides:{"*":{scrollbarWidth:"thin",scrollbarColor:n?"#475569 #1e293b":`${Jo[300]} ${Jo[100]}`,"&::-webkit-scrollbar":{width:"8px",height:"8px"},"&::-webkit-scrollbar-track":{background:n?"#1e293b":Jo[100],borderRadius:"4px"},"&::-webkit-scrollbar-thumb":{background:n?"#475569":Jo[300],borderRadius:"4px","&:hover":{background:n?"#64748b":Jo[400]}},"&::-webkit-scrollbar-corner":{background:n?"#1e293b":Jo[100]}},"div[data-radix-popper-content-wrapper]":{zIndex:"1300 !important"}}},MuiButton:{styleOverrides:{root:{borderRadius:20,textTransform:"none",fontWeight:500,boxShadow:"none","&:hover":{boxShadow:rw}},contained:{"&:hover":{boxShadow:"0 2px 4px rgba(0, 0, 0, 0.1)"},"&.Mui-disabled":{backgroundColor:n?"rgba(255, 255, 255, 0.06)":Jo[200],color:n?"#64748b":Jo[500]}},outlined:{color:a,borderColor:n?"#475569":Jo[300],"&:hover":{borderColor:n?"#64748b":Jo[400],backgroundColor:n?"rgba(255, 255, 255, 0.06)":"rgba(0, 0, 0, 0.04)"}}}},MuiCard:{styleOverrides:{root:{borderRadius:4,boxShadow:rw,border:"1px solid",borderColor:l,backgroundColor:o}}},MuiChip:{styleOverrides:{root:{borderRadius:4,fontWeight:500}}},MuiTextField:{styleOverrides:{root:{"& .MuiOutlinedInput-root":{borderRadius:4},"& .MuiInputLabel-outlined":{backgroundColor:o,paddingLeft:4,paddingRight:4,"&.MuiInputLabel-shrink":{transform:"translate(14px, -9px) scale(0.75)"}}}}},MuiPaper:{styleOverrides:{root:{backgroundImage:"none"}}},MuiDialog:{styleOverrides:{paper:{borderRadius:4,backgroundColor:o,boxShadow:"0px 20px 25px -5px rgba(0, 0, 0, 0.1), 0px 10px 10px -5px rgba(0, 0, 0, 0.04)"}}},MuiSelect:{styleOverrides:{select:{fontFamily:Vv,fontSize:"0.875rem",color:a}}},MuiInputLabel:{styleOverrides:{root:{"&.MuiInputLabel-outlined":{backgroundColor:o,paddingLeft:4,paddingRight:4}}}},MuiOutlinedInput:{styleOverrides:{notchedOutline:{border:"none"},root:{border:`1px solid ${n?Jo[600]:Jo[300]}`,borderRadius:8,transition:`border-color ${mz} ease-in`,...gz,backgroundColor:o,"&:hover":{borderColor:n?"#64748b":Jo[400]},"&.Mui-focused":{borderColor:n?Jo[400]:Jo[500],outline:"none"}}}},MuiMenuItem:{styleOverrides:{root:{fontFamily:Vv,fontSize:"0.875rem"}}},MuiInputBase:{styleOverrides:{root:{fontFamily:Vv}}},MuiMenu:{styleOverrides:{paper:{borderRadius:4,boxShadow:"0px 10px 15px -3px rgba(0, 0, 0, 0.1), 0px 4px 6px -2px rgba(0, 0, 0, 0.05)",border:`1px solid ${l}`,backgroundColor:o,color:a}}},MuiBreadcrumbs:{styleOverrides:{root:{"& .MuiBreadcrumbs-separator":{margin:"0 6px",color:Jo[400]}}}},MuiDivider:{styleOverrides:{root:{borderColor:l}},defaultProps:{sx:{my:1}}},MuiListItemButton:{styleOverrides:{root:{borderRadius:28,margin:"2px 8px",padding:"8px 16px","&:hover":{backgroundColor:n?"rgba(255, 255, 255, 0.08)":Mo.offWhite},"&.Mui-selected":{backgroundColor:n?"rgba(255, 255, 255, 0.12)":Mo.offWhite,color:a,"& .MuiListItemIcon-root":{color:a},"& .MuiListItemText-primary":{color:a},"&:hover":{backgroundColor:n?"rgba(255, 255, 255, 0.16)":Mo.grey.light}}}}},MuiAppBar:{styleOverrides:{root:{backgroundColor:o,color:a,boxShadow:rw}}}}})};NF("light");function Yve({children:e}){const{mode:t,theme:n}=is(),{accent:r,accentHover:o,accentContrast:a}=n,i=k.useMemo(()=>NF(t,{accent:r,accentHover:o,accentContrast:a}),[t,r,o,a]);return g.jsxs(TH,{theme:i,children:[g.jsx(R9,{}),e]})}const Gve=k.lazy(()=>Co(()=>import("./HomePage-BPFJHBxN.js"),[])),Kve=k.lazy(()=>Co(()=>import("./MainPage-CNLgQje2.js"),__vite__mapDeps([7,8]))),Qve=k.lazy(()=>Co(()=>import("./ModelPage-Br6I_s4J.js"),__vite__mapDeps([9,8]))),Xve=k.lazy(()=>Co(()=>import("./PackagePage-B6lmG1Uq.js"),__vite__mapDeps([10,8]))),Zve=k.lazy(()=>Co(()=>import("./EnvironmentPage-wGTml4WZ.js"),[])),Jve=k.lazy(()=>Co(()=>import("./RouteError-B4yUUZFj.js"),[])),ebe=k.lazy(()=>Co(()=>import("./ThemeEditorPage-CjK8EVnV.js"),__vite__mapDeps([11,12]))),tbe=(e="/",t=new Fve,n)=>(Ime(Uve),vU([{path:e,element:g.jsx(GZ,{children:g.jsx(rme,{documentStorage:t,children:g.jsx(Yve,{children:g.jsx(k.Suspense,{fallback:g.jsx(ma,{}),children:g.jsx(Kve,{headerProps:n})})})})}),errorElement:g.jsx(Jve,{}),children:[{index:!0,element:g.jsx(Gve,{})},{path:"settings/theme",element:g.jsx(ebe,{})},{path:"settings",element:g.jsx(W_,{to:"/settings/theme",replace:!0})},{path:":environmentName",element:g.jsx(Zve,{})},{path:":environmentName/:packageName",element:g.jsx(Xve,{})},{path:":environmentName/:packageName/*",element:g.jsx(Qve,{})}]}])),nbe=tbe("/");o3.createRoot(document.getElementById("root")).render(g.jsx(k.StrictMode,{children:g.jsx(PU,{router:nbe})}));export{i0 as $,rs as A,ud as B,jg as C,mme as D,obe as E,Lt as F,fI as G,Lo as H,ty as I,C0e as J,Zi as K,Ik as L,bI as M,wr as N,QI as O,Wa as P,Ic as Q,is as R,vw as S,It as T,wI as U,Pp as V,nu as W,yK as X,M0e as Y,ibe as Z,ma as _,hn as a,SD as a$,il as a0,Ur as a1,fp as a2,b0e as a3,bve as a4,mE as a5,Co as a6,abe as a7,Zbe as a8,T0e as a9,JW as aA,A0 as aB,Yo as aC,eo as aD,Uc as aE,t0 as aF,ld as aG,Ci as aH,aE as aI,See as aJ,$ee as aK,rbe as aL,IC as aM,fZ as aN,yz as aO,a0e as aP,r0e as aQ,Che as aR,t0e as aS,i0e as aT,l0e as aU,phe as aV,s0e as aW,are as aX,Xbe as aY,pE as aZ,h0e as a_,O0e as aa,y0e as ab,bp as ac,pn as ad,x0e as ae,R0e as af,S0e as ag,k0e as ah,xme as ai,jo as aj,E0e as ak,Dve as al,w0e as am,j_ as an,Pk as ao,fr as ap,x$ as aq,Ca as ar,xY as as,DL as at,W2 as au,na as av,Rd as aw,WK as ax,qi as ay,KW as az,Ks as b,Jhe as b$,ome as b0,Jr as b1,p0e as b2,u0e as b3,Ta as b4,tme as b5,Jbe as b6,ap as b7,cre as b8,vz as b9,fee as bA,$k as bB,Jm as bC,lre as bD,Kc as bE,zhe as bF,tr as bG,b9 as bH,e0e as bI,pre as bJ,Xg as bK,Uhe as bL,ED as bM,Vbe as bN,She as bO,Hbe as bP,F0 as bQ,Qbe as bR,bz as bS,cee as bT,PW as bU,n0e as bV,Kbe as bW,Pb as bX,Bbe as bY,lP as bZ,qb as b_,Lhe as ba,gz as bb,mz as bc,fre as bd,sre as be,_he as bf,Qhe as bg,Yhe as bh,d0e as bi,c0e as bj,f0e as bk,m0e as bl,g0e as bm,o0e as bn,xE as bo,yre as bp,RD as bq,hhe as br,Dhe as bs,GE as bt,Ube as bu,Gbe as bv,lee as bw,qbe as bx,Wbe as by,Ybe as bz,Ya as c,Zhe as c0,Ghe as c1,EC as c2,qhe as c3,XE as c4,Xhe as c5,Vhe as c6,Khe as c7,nme as c8,pg as c9,Nt as d,hw as e,dn as f,un as g,Cd as h,fl as i,g as j,vo as k,kd as l,an as m,WN as n,Yl as o,XN as p,v0e as q,k as r,st as s,xb as t,mn as u,_g as v,YN as w,An as x,it as y,Oa as z};
484
+ `)[e.codeLine]??"").trim():oR(e).map(o=>o.trim()).find(o=>o&&!o.startsWith("#")&&!o.startsWith("//"))??"",n=/^(source|query|given|type):?\s+([A-Za-z_]\w*)/.exec(t);if(n)return`${n[1]}: ${n[2]}`;const r=/^(import|export)\b/.exec(t);return r?r[1]:t}const pve=tr(g.jsx("path",{d:"M10 6 8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z"})),hve=tr(g.jsx("path",{d:"M16.59 8.59 12 13.17 7.41 8.59 6 10l6 6 6-6z"})),mve=tr(g.jsx("path",{d:"M9.4 16.6 4.8 12l4.6-4.6L8 6l-6 6 6 6zm5.2 0 4.6-4.6-4.6-4.6L16 6l6 6-6 6z"}));function gve({cell:e,resourceUri:t,showCopyLink:n,maxResultSize:r,isExecuting:o,pendingRerun:a,onNavigate:i,onDrillSelf:l,canDrillSelf:c,onDrillNavigate:f,givens:u,givenSpecs:h}){const[m,v]=pn.useState(!1),[b,x]=pn.useState(!1),[w,S]=pn.useState(),[R,E]=pn.useState(!1),[M,$]=k.useState(!1),D=k.useId(),[F,I]=k.useState(""),{environmentName:U,packageName:z,modelPath:L}=ao(t),C={environmentName:U,packageName:z,sourcePath:L,onNavigate:i},{drill:j,drillMenu:N}=Pz({onNavigate:f,onSelf:l,canSelf:c,selfLabel:"Filter this notebook"}),V=/import\s*\{([^}]+)\}\s*from\s*['"`][^'"`]+['"`]/,A=/import\s*(?:\{[^}]*\}\s*from\s*)?['"`]([^'"`]+)['"`]/,Y=!!e.text&&(V.test(e.text)||A.test(e.text)),W=()=>{if(!e.newSources||e.newSources.length===0)return 0;let J=[],ne="";if(e.text){const ee=e.text.match(V);ee&&(J=ee[1].split(",").map(pe=>pe.trim()));const ue=e.text.match(A);ue&&(ne=ue[1].trim())}for(let ee=0;ee<e.newSources.length;ee++)try{const ue=JSON.parse(e.newSources[ee]);if(J.length>0&&J.includes(ue.name)||ne&&ne===ue.path)return ee}catch{continue}return 0},re=pn.useMemo(()=>e.newSources&&e.newSources.length>0?{sourceInfos:e.newSources,resource:t,givens:h}:void 0,[e.newSources,t,h]),{mode:Q}=is();k.useEffect(()=>{e.type==="code"&&OF(dve(e),"malloy",Q).then(J=>{S(J)})},[e,Q]);const oe=e.kind==="query"?uve(e):void 0,ce=e.markdown?g.jsx(Jm,{variant:"document",links:C,children:e.markdown}):null,Z=()=>{const J=window.location.href;navigator.clipboard.writeText(J).then(()=>I("URL copied to clipboard!")).catch(()=>I("Failed to copy URL"))},ae=g.jsx(Yo,{open:m,onClose:()=>v(!1),title:"Malloy code",maxWidth:"lg",showClose:!0,children:g.jsx(Lt,{sx:J=>({border:`1px solid ${J.palette.divider}`,borderRadius:"8px",padding:"16px",fontFamily:jo,fontSize:"14px",lineHeight:"1.5",overflow:"auto",maxHeight:"70vh",backgroundColor:J.palette.background.paper,color:J.palette.text.primary}),children:g.jsx("pre",{className:"code-display",style:{margin:0},dangerouslySetInnerHTML:{__html:w}})})});return e.type==="markdown"&&g.jsx(Lt,{children:g.jsxs(Lt,{children:[n?g.jsxs(fr,{direction:"row",alignItems:"flex-start",justifyContent:"space-between",children:[g.jsx(Jm,{variant:"document",links:C,children:e.text}),g.jsx(Zi,{title:"Copy link",children:g.jsx(Lo,{"aria-label":"Copy link",onClick:Z,sx:{color:"text.secondary",mt:"18px"},children:g.jsx(TF,{sx:{fontSize:"24px"}})})})]}):g.jsx(Jm,{variant:"document",links:C,children:e.text}),g.jsx(A0,{open:F!=="",autoHideDuration:6e3,onClose:()=>I(""),message:F})]})})||e.kind==="definition"&&g.jsxs(Lt,{children:[ce,g.jsxs(Lt,{component:"button",type:"button","aria-expanded":M,"aria-controls":D,onClick:()=>$(J=>!J),sx:{display:"flex",alignItems:"center",gap:"4px",p:0,border:0,background:"none",cursor:"pointer",fontFamily:jo,fontSize:"13px",color:"text.secondary"},children:[M?g.jsx(hve,{fontSize:"small"}):g.jsx(pve,{fontSize:"small"}),fve(e)]}),M&&g.jsx(Lm,{id:D,sx:{mt:1,padding:"12px 24px"},children:g.jsx("pre",{className:"code-display",style:{margin:0,overflow:"auto"},dangerouslySetInnerHTML:{__html:w??""}})})]})||e.type==="code"&&g.jsxs(Lt,{children:[ce,oe&&g.jsx(It,{variant:"body2",sx:{color:"text.secondary",mb:1},children:oe}),e.newSources&&e.newSources.length>0&&g.jsx(fr,{sx:{flexDirection:"column",gap:"8px",marginBottom:"2px"},children:g.jsx(Lm,{sx:{position:"relative",padding:"0"},children:g.jsxs(Lt,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",paddingLeft:"24px",paddingRight:"8px"},children:[w&&g.jsx("span",{dangerouslySetInnerHTML:{__html:w},style:{fontFamily:jo,fontSize:"14px",flex:1,marginRight:"8px"}}),Y&&g.jsx(cp,{"aria-label":"Data sources",sx:{flexShrink:0},onClick:()=>E(!0),children:g.jsx(Gb,{})})]})})}),g.jsx(AF,{open:R,onClose:()=>E(!1),title:"Data Sources",hasValidImport:Y,resourceUri:t,data:re,initialSelectedSourceIndex:W(),startingGivens:u}),ae,g.jsx(MF,{open:b,onClose:()=>x(!1),result:e.result||"",title:"Results",drill:j}),o&&!e.result&&!e.error&&!Y&&!(e.newSources&&e.newSources.length>0)&&g.jsx(Lm,{sx:{display:"flex",justifyContent:"center",alignItems:"center",minHeight:200},children:g.jsx(Ug,{size:32})}),!e.result&&e.error&&g.jsx(xz,{summary:"This cell could not be run.",detail:e.error}),e.result&&a&&g.jsx(nY,{"aria-label":"Re-run pending",sx:{mb:1,height:2,borderRadius:1}}),e.result&&g.jsxs(Lm,{sx:{position:"relative"},children:[g.jsx(Lt,{sx:{paddingTop:"24px"},children:g.jsx(KE,{result:e.result,maxHeight:mhe,maxResultSize:r,drill:j})}),N,g.jsxs(fr,{sx:{position:"absolute",top:"-12px",right:"8px",flexDirection:"row",gap:"8px",alignItems:"center",zIndex:2},children:[g.jsx(cp,{"aria-label":"Malloy code",onClick:J=>{J.stopPropagation(),v(!0)},children:g.jsx(mve,{})}),g.jsx(cp,{"aria-label":"Expand results",onClick:()=>x(!0),children:g.jsx(Gb,{})})]})]})]})}const yve=4;function vve(e){const t=e?.response?.data?.message;return typeof t=="string"&&t!==""?t:e instanceof Error&&e.message!==""?e.message:"The server did not say why."}function jF(e){const{apiClients:t}=wr(),{environmentName:n,packageName:r,versionId:o,modelPath:a}=ao(e);return Jr({queryKey:[e],queryFn:async()=>(await t.notebooks.getNotebook(n,r,a,o)).data})}function bve(e){const{data:t}=jF(e.resourceUri);if(t?.dashboard){const{environmentName:n,packageName:r,versionId:o,modelPath:a}=ao(e.resourceUri),{title:i,description:l}=t.dashboard;return g.jsx(ML,{children:g.jsxs($L,{children:[(i||l)&&g.jsx(Lt,{sx:{mb:2},children:g.jsx(oF,{chrome:"none",title:i??"",...l?{description:l}:{}})}),g.jsx(nF,{manifest:t.dashboard,environmentName:n,packageName:r,versionId:o,documentName:a,givens:e.givens,onGivensChange:e.onGivensChange,onNavigate:e.onDrillNavigate,maxResultSize:e.maxResultSize,chrome:"none",controlsLayout:"panel"})]})})}return g.jsx(xve,{...e})}function xve({resourceUri:e,maxResultSize:t=0,givens:n,onGivensChange:r,onNavigate:o,onDrillNavigate:a}){const{apiClients:i}=wr(),{environmentName:l,packageName:c,versionId:f,modelPath:u}=ao(e),{data:h,isSuccess:m,isError:v,error:b}=jF(e),[x,w]=k.useState([]),[S,R]=k.useState(!1),[E,M]=k.useState(!1),$=k.useRef(void 0),[D,F]=k.useState(null),I=sve(h),U=h?.autorun!==!1,z=xE({specs:I,loaded:m,startingValues:h?.startingGivens,params:n,onGivensChange:r,documentKey:e,autorun:U,environmentName:l,packageName:c,modelPath:u,versionId:f,documentName:u}),{applied:L,declaredTypes:C,canSelf:j,onSelf:N}=z,V=k.useCallback(ee=>{const ue=ny(ee,C);return Object.keys(ue).length>0?JSON.stringify(ue):void 0},[C]),A=k.useMemo(()=>Oz(L,C),[L,C]),Y=k.useRef(0),W=k.useRef(null),re=k.useRef(null),Q=k.useRef(void 0);k.useEffect(()=>()=>{W.current?.abort(),re.current=null,clearTimeout(Q.current?.timer),Q.current=void 0},[]);const oe=k.useCallback(async(ee=new Map)=>{if(!m||!h?.notebookCells)return;const ue=++Y.current;W.current?.abort();const pe=new AbortController;W.current=pe,w(h.notebookCells.map(ie=>({...ie}))),R(!0),F(null);const ye=V(ee);try{const ie=[];for(let le=0;le<h.notebookCells.length;le++){const be=h.notebookCells[le];if(!cve(be))continue;const Ve=le,Re=async()=>{try{const Oe=await i.notebooks.executeNotebookCell(l,c,u,Ve,f,void 0,void 0,ye,{signal:pe.signal});if(Y.current!==ue)return;const de=Oe.data,at=de.result,Ne=be.newSources||de.newSources;w(Je=>{const tt=[...Je];return tt[Ve]||(tt[Ve]={...be}),tt[Ve]={...tt[Ve],result:at,newSources:Ne},tt})}catch(Oe){if(pe.signal.aborted||Y.current!==ue)return;console.error(`Error executing cell ${Ve}:`,Oe);const de=vve(Oe);w(at=>{const Ne=[...at];return Ne[Ve]||(Ne[Ve]={...be}),Ne[Ve]={...Ne[Ve],error:de},Ne})}};ie.push(Re)}const he=[];for(const le of ie){const be=le().then(()=>{he.splice(he.indexOf(be),1)});he.push(be),he.length>=yve&&await Promise.race(he)}await Promise.all(he)}catch(ie){if(pe.signal.aborted||Y.current!==ue)return;console.error("Error executing notebook cells:",ie),F(ie)}finally{Y.current===ue&&(R(!1),W.current=null)}},[m,h,V,l,c,u,f,i.notebooks]),ce=k.useRef(0),Z=k.useRef(void 0);Z.current!==h&&(Z.current=h,ce.current+=1);const ae=ce.current;k.useEffect(()=>{const ee=`${e}|${ae}`,ue=`${ee}|${V(L)??""}`;$.current!==void 0&&$.current!==ee&&(W.current?.abort(),W.current=null),$.current=ee;const pe=ive({ready:m&&!!h?.notebookCells,lastRunKey:re.current,pendingKey:Q.current?.key,runKey:ue,documentKey:ee});if(pe.cancelPending&&(clearTimeout(Q.current?.timer),Q.current=void 0,M(!1)),pe.dispatch==="none")return;const ye=()=>{Q.current=void 0,M(!1),re.current=ue,oe(L)};if(pe.dispatch==="now"){ye();return}M(!0),Q.current={key:ue,timer:setTimeout(ye,lve)}},[m,h,ae,e,L,V,oe]);const J=x.length>0?x:h?.notebookCells||[],ne=h?.format==="malloy"?J.findIndex(ee=>ee.type==="markdown"):0;return g.jsx(ML,{children:g.jsx($L,{children:g.jsxs(fr,{spacing:3,component:"section",children:[g.jsx(GE,{...z.panel}),!m&&!v&&g.jsx(ma,{text:bp.opening("notebook")}),m&&J.map((ee,ue)=>g.jsx(gve,{cell:ee,showCopyLink:ue===ne,resourceUri:e,maxResultSize:t,isExecuting:S,givens:A,givenSpecs:I,pendingRerun:E,onNavigate:o,onDrillNavigate:a,onDrillSelf:I.length>0?N:void 0,canDrillSelf:j},ue)),v&&b.status===404&&g.jsxs(It,{variant:"body2",sx:{color:"text.secondary"},children:[g.jsx("code",{children:`${l} > ${c} > ${u}`})," ","not found."]}),v&&b.status!==404&&g.jsx(Ta,{error:b,context:`${l} > ${c} > ${u}`}),D&&g.jsx(Ta,{error:{message:D.message,status:500,name:"ExecutionError"},context:"Notebook Execution"})]})})})}const Sve=tr(g.jsx("path",{d:"m7 10 5 5 5-5z"})),Bv={dashboard:"Dashboard",notebook:"Notebook"};function wve({open:e,kind:t,allowKindChange:n=!0,environmentName:r,packageName:o,versionId:a,models:i,modelsLoading:l=!1,modelsError:c,onRetryModels:f,target:u,savedAs:h,onClose:m,onCreated:v,onEvent:b}){const[x,w]=k.useState(t),[S,R]=k.useState(""),[E,M]=k.useState(""),[$,D]=k.useState(""),[F,I]=k.useState(!1),[U,z]=k.useState(!1),[L,C]=k.useState(!1),[j,N]=k.useState(void 0),V=c!=null,{choices:A,isLoading:Y,isSuccess:W,failed:re,retry:Q,canRetry:oe}=nme({environmentName:r,packageName:o,...a!==void 0?{versionId:a}:{},models:i,enabled:e&&i.length>0}),ce=k.useMemo(()=>A.get(S)??[],[A,S]),Z=ce.find(Re=>`${Re.source}::${Re.view}`===E);k.useEffect(()=>{e&&w(t)},[e,t]),k.useEffect(()=>{if(!e)return;const Re=[...A.keys()];S===""&&Re.length>0&&R(Re[0])},[e,A,S]),k.useEffect(()=>{!e||ce.length===0||E!==""||M(`${ce[0].source}::${ce[0].view}`)},[e,ce,E]),k.useEffect(()=>{!e||F||Z===void 0||D(Z.view.replace(/_/g," "))},[e,F,Z]),k.useEffect(()=>{e||(R(""),M(""),D(""),I(!1),z(!1),N(void 0))},[e]);const ae=k.useMemo(()=>{if($.trim()!=="")for(let Re=1;Re<=qb;Re++){const Oe=EC(x,$,Re);if(!u.existing?.includes(Oe))return Oe}},[x,$,u]),J=(Z===void 0?void 0:XE(x,{title:$,modelPath:S,source:Z.source,view:Z.view}))??($.trim()!==""&&ae===void 0?"No free file name for this title; choose another.":void 0),ne=J!==void 0&&(U||$.trim()!==""),ee=l||Y,ue=A.size===0&&(V||re.length>0),pe=ee?"Loading model views":ue?"Couldn't read the model views to start from":A.size===0?"No model view to start from yet":Z===void 0?"Pick a view to start from":void 0,ye=Bv[x].toLowerCase(),ie=L?`Creating ${ye}…`:`Create ${ye}`,he=x==="dashboard"?"First tile":"First query",le=E!==""&&Z===void 0&&ce.length>0,be=async()=>{if(!(pe!==void 0||Z===void 0||L)){if(J!==void 0){z(!0);return}C(!0),N(void 0);try{const Re=await Jhe({kind:x,document:{title:$,modelPath:S,source:Z.source,view:Z.view},target:u,...b?{onEvent:b}:{}});v(Re)}catch(Re){const Oe=Re.response?.data?.message;N(Oe??(Re instanceof Error?Re.message:String(Re)))}finally{C(!1)}}},Ve=Re=>g.jsx(eo,{color:"inherit",size:"small",onClick:Re,children:"Retry"});return g.jsx(Yo,{open:e,onClose:L?()=>{}:m,title:`New ${ye}`,description:x==="dashboard"?"A dashboard is a Malloy file in the package. Pick what its first tile shows; the rest is the builder.":"A notebook is a Malloy file in the package that mixes text and queries. Pick what its first query runs; the rest is the builder.",actions:g.jsxs(g.Fragment,{children:[g.jsx(eo,{onClick:m,disabled:L,children:"Cancel"}),g.jsx(Zi,{title:L?"":pe??"",children:g.jsx("span",{children:g.jsx(eo,{variant:"contained",disabled:L||pe!==void 0,"aria-label":!L&&pe!==void 0?`${ie}: ${pe}`:ie,onClick:()=>void be(),children:ie})})})]}),children:g.jsxs(fr,{sx:{gap:2,pt:1},children:[V?g.jsx(qi,{severity:"error",action:f&&WL(c)?Ve(f):void 0,children:"Couldn't read this package's models, so no view is listed to start from."}):i.length===0?!l&&g.jsxs(qi,{severity:"info",children:["This package has no models yet. Add a .malloy file that declares a source with a view, then create a ",ye," from it."]}):re.length>0?g.jsxs(qi,{severity:"warning",action:oe?Ve(Q):void 0,children:["Couldn't read ",re.join(", "),", so"," ",re.length===1?"its":"their"," views aren't listed."]}):W&&A.size===0&&g.jsxs(qi,{severity:"info",children:["A ",ye," starts from a view of a source, and no model in this package declares one yet. Add a view to a source in a model file and this list fills in."]}),n&&g.jsx(Ca,{select:!0,size:"small",label:"Type",value:x,disabled:L,onChange:Re=>w(Re.target.value),inputProps:{"aria-label":"Type"},children:Object.keys(Bv).map(Re=>g.jsx(na,{value:Re,children:Bv[Re]},Re))}),g.jsx(Ca,{select:!0,size:"small",label:"Model",value:A.has(S)?S:"",disabled:A.size===0||L,onChange:Re=>{R(Re.target.value),M("")},inputProps:{"aria-label":"Model"},helperText:ee?"Reading the package's models…":A.size===1?"The only model with a view to start from.":"Models with a view to start from.",children:[...A.keys()].map(Re=>g.jsx(na,{value:Re,children:Re},Re))}),g.jsx(Ca,{select:!0,size:"small",label:he,value:Z?E:"",disabled:ce.length===0||L,onChange:Re=>M(Re.target.value),inputProps:{"aria-label":he},error:le,helperText:le?"The view you picked is no longer in this model; pick another.":ce.length===1?"The only view this model offers; more are added in the builder.":"A view of a source; more are added in the builder.",children:ce.map(Re=>g.jsxs(na,{value:`${Re.source}::${Re.view}`,children:[Re.source," → ",Re.view]},`${Re.source}::${Re.view}`))}),g.jsx(Ca,{size:"small",label:"Title",value:$,disabled:L,onChange:Re=>{I(!0),D(Re.target.value)},inputProps:{"aria-label":`${Bv[x]} title`},error:ne,helperText:ne?J:ae?u.route==="package"?`Written as ${ae}, and opened in the builder.`:h??`Saved as a new ${ye} in the host's store, and opened in the builder.`:"Names the file too."}),j&&g.jsx(qi,{severity:"error",children:j})]})})}const Cve={dashboard:qr.blue,report:qr.violet,model:qr.cyan,dataApp:qr.pink,data:qr.lime,materialization:qr.amber};function kve({type:e,size:t=18,sx:n,...r}){return g.jsx(Nb,{...r,viewBox:"0 0 24 24",sx:{width:t,height:t,fill:"none",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round",...n},children:Eve[e]()})}const Eve={report:Rve,model:Tve,data:Ove,materialization:Mve,dataApp:Pve,dashboard:$ve};function Rve(){return g.jsxs(g.Fragment,{children:[g.jsx("path",{d:"M14 3 H6 a2 2 0 0 0 -2 2 v14 a2 2 0 0 0 2 2 h12 a2 2 0 0 0 2 -2 V9 z"}),g.jsx("path",{d:"M14 3 v4 a2 2 0 0 0 2 2 h4"}),g.jsx("path",{d:"M8 17 v-3"}),g.jsx("path",{d:"M12 17 v-6"}),g.jsx("path",{d:"M16 17 v-4"})]})}function Tve(){return g.jsxs(g.Fragment,{children:[g.jsx("path",{d:"M12 3 L4 7 v10 l8 4 l8 -4 V7 z"}),g.jsx("path",{d:"M4 7 l8 4 l8 -4"}),g.jsx("path",{d:"M12 11 v10"})]})}function Ove(){return g.jsxs(g.Fragment,{children:[g.jsx("rect",{x:"3.5",y:"3.5",width:"17",height:"17",rx:"2"}),g.jsx("path",{d:"M3.5 9.5 H20.5"}),g.jsx("path",{d:"M9.5 3.5 V20.5"})]})}function Mve(){return g.jsxs(g.Fragment,{children:[g.jsx("path",{d:"M12 3 L21 7.5 L12 12 L3 7.5 Z"}),g.jsx("path",{d:"M3 12 L12 16.5 L21 12"}),g.jsx("path",{d:"M3 16.5 L12 21 L21 16.5"})]})}function $ve(){return g.jsxs(g.Fragment,{children:[g.jsx("rect",{x:"3.5",y:"3.5",width:"17",height:"17",rx:"2"}),g.jsx("path",{d:"M3.5 9.5 H20.5"}),g.jsx("path",{d:"M12 9.5 V20.5"}),g.jsx("path",{d:"M12 15 H20.5"})]})}function Pve(){return g.jsxs(g.Fragment,{children:[g.jsx("rect",{x:"3.5",y:"4.5",width:"17",height:"15",rx:"2"}),g.jsx("path",{d:"M3.5 9.5 H20.5"}),g.jsx("path",{d:"M7 13.5 H17"}),g.jsx("path",{d:"M7 16.5 H13"})]})}const Ave=/^(?:dashboards|notebooks)\/([^/]+)\.malloy$/,DC=e=>Ave.exec(e??"")?.[1],Dve=(e,t,n,r)=>`/${e}/${t}/${n}s/${encodeURIComponent(r)}`;function jve({kind:e,slug:t,dashboards:n,notebooks:r}){const o=()=>{const i=n.find(l=>l.name===t&&l.path);return i?.path?{kind:"dashboard",path:i.path}:void 0},a=()=>{const i=r.find(l=>DC(l.path)===t);return i?.path?{kind:"notebook",path:i.path}:void 0};return e==="dashboard"?o()??a():a()??o()}const Nve="README.malloynb",Ive=e=>e?.toLowerCase()==="notebooks/readme.malloy",pj=(e,t,n)=>`${e}/${t}/${n}s/`;function E0e({onClickPackageFile:e,onOpenDocument:t,resourceUri:n}){const{apiClients:r,server:o,mutable:a}=wr(),i=Rd(),l=e??(ie=>{window.location.href=ie}),{environmentName:c,packageName:f,versionId:u}=ao(n),h=t??((ie,he)=>{const le=`${Dve(c,f,ie.kind,ie.slug)}${ie.mode==="edit"?"/edit":""}`;he?l(le,he):l(le)}),[m,v]=k.useState(null),[b,x]=k.useState(void 0),[w,S]=k.useState(null),R=mme(),E=ome()?.documentStorage,[M,$]=k.useState([]),[D,F]=k.useState({state:E?"pending":"ready"}),I=k.useCallback(async()=>{if(!E)return;let ie;try{ie=await E.listWorkspaces(!1)}catch{F({state:"failed"});return}F({state:"ready",chosen:_he(ie)});const he=[];for(const le of ie.filter(be=>be.writeable))for(const be of["dashboard","notebook"])for(const Ve of await E.listDocuments(le,be))Ve.path.startsWith(pj(c,f,be))&&he.push({locator:Ve,where:le.description});$(he)},[E,c,f]);k.useEffect(()=>{I()},[I]);const U=ie=>ie.path.slice(pj(c,f,ie.type).length).replace(/\.malloy$/,""),z=Jr({queryKey:["package",c,f,u],queryFn:()=>r.packages.getPackage(c,f,u,!1)}),L=Jr({queryKey:["notebooks",c,f,u],queryFn:async()=>{try{return await r.notebooks.listNotebooks(c,f,u)}catch(ie){const he=ie?.response?.status;if(he===404||he===void 0)return{data:[]};throw ie}}}),C=Jr({queryKey:["models",c,f,u],queryFn:()=>r.models.listModels(c,f,u)}),j=Jr({queryKey:["databases",c,f,u],queryFn:()=>r.databases.listDatabases(c,f,u)}),N=Jr({queryKey:["data-apps",c,f],queryFn:async()=>{try{return await r.dataApps.listDataApps(c,f)}catch(ie){const he=ie?.response?.status;if(he===404||he===void 0)return{data:[]};throw ie}}}).data?.data??[],V=Jr({queryKey:["dashboards",c,f,u],queryFn:async()=>{try{return await r.dashboards.listDashboards(c,f,u)}catch(ie){const he=ie?.response?.status;if(he===404||he===void 0)return{data:[]};throw ie}}}),A=V.data?.data??[],Y=(L.data?.data??[]).slice().sort((ie,he)=>(ie.path??"").localeCompare(he.path??"")),W=Lve(A,Y),re=new Set(A.map(ie=>ie.path).filter(ie=>ie!==void 0)),Q=(C.data?.data??[]).slice().filter(ie=>!re.has(ie.path)).sort((ie,he)=>ie.path.localeCompare(he.path)),oe=(j.data?.data??[]).slice().sort((ie,he)=>ie.path.localeCompare(he.path)),ce=D.state==="ready"?Zhe({authoritative:D.chosen?.authoritative===!0,mutable:a,canStore:D.chosen?.writeable===!0,...u===void 0?{}:{versionId:u}}):void 0,Z=[V,L,C].every(ie=>ie.isSuccess||ie.isError),ae=ce!==void 0&&Z,J=ae&&!R,ne=k.useMemo(()=>{if(!ae)return;const ie=[...(V.data?.data??[]).flatMap(he=>he.path?[he.path]:[]),...(L.data?.data??[]).flatMap(he=>he.path?[he.path]:[]),...(C.data?.data??[]).flatMap(he=>he.path?[he.path]:[])];if(ce==="storage"&&E&&D.state==="ready")return D.chosen?{route:ce,storage:E,workspace:D.chosen,environmentName:c,packageName:f,existing:ie}:void 0;if(ce==="package")return{route:ce,existing:ie,write:async(he,le)=>{await r.models.updateModelSource(c,f,he,{source:le})}}},[ae,ce,E,D,c,f,r,V.data,L.data,C.data]),ee=z.data?.data?.description??"",ue=(Y.find(ie=>ie.path===Nve)??Y.find(ie=>Ive(ie.path)))?.path,pe=mE({environmentName:c,packageName:f,versionId:u,modelPath:ue}),ye=!L.isSuccess&&!L.isError||!V.isSuccess&&!V.isError;return z.isError?g.jsx(Ta,{error:z.error,context:`${c} > ${f}`}):g.jsxs(Pk,{maxWidth:!1,sx:{maxWidth:1024,mx:"auto",px:3,py:6},children:[g.jsxs(Lt,{sx:{mb:4},children:[g.jsx(It,{variant:"h4",component:"h1",sx:{fontWeight:600,letterSpacing:"-0.025em",mb:.5},children:f}),ee&&g.jsx(It,{variant:"body2",color:"text.secondary",children:ee})]}),ye&&g.jsx(ma,{text:"Loading package..."}),g.jsx(ru,{anchorEl:w,open:w!==null,onClose:()=>S(null),children:["dashboard","notebook"].map(ie=>g.jsx(na,{onClick:()=>{S(null),x(ie)},children:ie==="dashboard"?"Dashboard":"Notebook"},ie))}),ne&&g.jsx(wve,{open:b!==void 0,kind:b??"dashboard",environmentName:c,packageName:f,...u!==void 0?{versionId:u}:{},models:Q.map(ie=>ie.path).filter(ie=>typeof ie=="string"&&ie.endsWith(".malloy")&&!ie.startsWith("dashboards/")&&!ie.startsWith("notebooks/")),modelsLoading:C.isPending,...C.isError?{modelsError:C.error}:{},onRetryModels:()=>void C.refetch(),target:ne,onClose:()=>x(void 0),onCreated:ie=>{x(void 0);for(const he of["dashboards","notebooks","models"])i.invalidateQueries({queryKey:[he]});h({kind:ie.kind,slug:ie.slug,mode:"edit"})}}),!ye&&g.jsxs(g.Fragment,{children:[(V.isError||L.isError)&&g.jsx(Lt,{sx:{mb:4},children:g.jsx(qi,{severity:"warning",children:"Could not list some artifacts, so any this package has are missing from this page."})}),(W.length>0||ae)&&g.jsxs(nl,{title:"Artifacts",count:W.length,...J?{action:g.jsx(eo,{variant:"outlined",size:"small",endIcon:g.jsx(Sve,{}),"aria-haspopup":"menu","aria-label":"New",onClick:ie=>S(ie.currentTarget),children:"New"})}:{},children:[W.length===0&&g.jsx(nw,{label:"No artifacts yet",...J?{action:{label:"New artifact",onClick:ie=>S(ie.currentTarget)}}:{}}),W.map(ie=>g.jsx(Mm,{type:ie.kind==="dashboard"?"dashboard":"report",label:ie.label,...ie.secondary===void 0?{}:{description:ie.secondary},onClick:he=>ie.slug===void 0?l(`/${c}/${f}/${ie.path}`,he):h({kind:ie.kind,slug:ie.slug,mode:"view"},he)},`${ie.kind}:${ie.path}`))]}),M.length>0&&g.jsx(nl,{title:"Drafts",count:M.length,children:M.map(({locator:ie,where:he})=>g.jsx(Mm,{type:ie.type==="dashboard"?"dashboard":"report",label:U(ie),rightLabel:he,onClick:le=>h({kind:ie.type,slug:U(ie),mode:"edit"},le),trailingAction:g.jsx(Zi,{title:"Delete this draft",children:g.jsx(Lo,{size:"small","aria-label":`Delete draft ${U(ie)}`,onClick:le=>{le.stopPropagation(),E?.deleteDocument(ie).then(I)},children:g.jsx(pre,{fontSize:"small"})})})},`${ie.type}:${ie.path}`))}),N.length>0&&g.jsx(nl,{title:"Data Apps",count:N.length,children:N.map(ie=>{const he=!!ie.title&&ie.title!==ie.path,le=`${fF(o)}${ie.resource}`;return g.jsx(Mm,{type:"dataApp",label:he?ie.title:ie.path,rightLabel:he?ie.path:void 0,onClick:be=>{e?e(`/${c}/${f}/data-apps/${ie.path}`,be):be&&(be.metaKey||be.ctrlKey)?window.open(le,"_blank"):window.location.href=le},trailingAction:g.jsx(Zi,{title:"Open standalone in new tab",children:g.jsx(Lo,{size:"small",href:le,target:"_blank",rel:"noopener noreferrer","aria-label":"Open standalone in new tab",onClick:be=>be.stopPropagation(),sx:{color:"text.secondary"},children:g.jsx(dF,{fontSize:"small"})})})},ie.path)})}),g.jsxs(nl,{title:"Semantic Models",count:Q.length,children:[Q.map(ie=>g.jsx(Mm,{type:"model",label:ie.path,onClick:he=>l(`/${c}/${f}/${ie.path}`,he)},ie.path)),Q.length===0&&g.jsx(nw,{label:"No models"})]}),g.jsxs(nl,{title:"Package Data",count:oe.length,children:[oe.map(ie=>g.jsx(Mm,{type:"data",label:ie.path,rightLabel:ie.info?zve(ie.info.rowCount):"Unreadable",onClick:()=>v(ie)},ie.path)),oe.length===0&&g.jsx(nw,{label:"No data files"})]}),g.jsx(Wye,{resourceUri:n}),ue&&g.jsx(Lt,{sx:{mt:6},children:g.jsx(bve,{resourceUri:pe,onNavigate:l})})]}),g.jsxs(Yo,{open:m!==null,onClose:()=>v(null),title:m?.path??"Columns",showClose:!0,children:[m?.error&&g.jsx(It,{variant:"body2",color:"error",children:m.error}),m?.info?.columns&&g.jsxs(Hg,{size:"small",children:[g.jsx(Wg,{children:g.jsxs(ll,{children:[g.jsx(Xn,{children:"Column"}),g.jsx(Xn,{children:"Type"})]})}),g.jsx(qg,{children:m.info.columns.map(ie=>g.jsxs(ll,{children:[g.jsx(Xn,{component:"th",scope:"row",children:ie.name}),g.jsx(Xn,{children:ie.type})]},ie.name))})]})]})]})}function Mm({type:e,label:t,description:n,rightLabel:r,onClick:o,trailingAction:a}){return g.jsx(mx,{icon:g.jsx(kve,{type:e}),tint:Cve[e],label:t,mono:!0,...n===void 0?{}:{description:n},...r===void 0?{}:{rightLabel:r},...o===void 0?{}:{onClick:o},...a===void 0?{}:{trailingAction:a}})}function Lve(e,t){const n=[...e.map(o=>({kind:"dashboard",path:o.path??"",slug:o.name??DC(o.path),title:o.title})),...t.map(o=>({kind:"notebook",path:o.path??"",slug:DC(o.path),title:o.title}))],r=new Map;for(const o of n)o.slug!==void 0&&r.set(o.slug,(r.get(o.slug)??0)+1);return n.map(({title:o,...a})=>{const i=!!o&&o!==a.slug&&o!==a.path,l=a.slug!==void 0&&(r.get(a.slug)??0)>1;return{...a,label:i?o:a.slug??a.path,secondary:(a.slug===void 0?i:l)?a.path:void 0}}).sort((o,a)=>o.label.localeCompare(a.label)||o.path.localeCompare(a.path))}function nw({label:e,action:t}){return g.jsxs(fr,{direction:"row",sx:{alignItems:"center",gap:1,py:1},children:[g.jsx(It,{variant:"body2",color:"text.secondary",sx:{fontStyle:"italic"},children:e}),t&&g.jsx(eo,{size:"small",onClick:t.onClick,children:t.label})]})}function zve(e){return e>=1e9?`${(e/1e9).toFixed(1)} B rows`:e>=1e6?`${(e/1e6).toFixed(1)} M rows`:e>=1e3?`${(e/1e3).toFixed(1)} K rows`:`${e} rows`}function R0e(e,t,n,r,o){const{apiClients:a}=wr(),i=Jr({queryKey:["dashboards",e,t,o],queryFn:()=>a.dashboards.listDashboards(e,t,o)}),l=Jr({queryKey:["notebooks",e,t,o],queryFn:()=>a.notebooks.listNotebooks(e,t,o)}),c=[i,l].every(f=>f.isSuccess||f.isError);return{settled:c,location:c?jve({kind:n,slug:r,dashboards:i.data?.data??[],notebooks:l.data?.data??[]}):void 0}}const jC={name:"Local",description:"Stored in this browser only",writeable:!0},NC="publisher:document:";class Fve{async listWorkspaces(t){return[jC]}async listDocuments(t,n){if(t.name!==jC.name)return[];const r=[];for(let o=0;o<localStorage.length;o++){const a=localStorage.key(o),i=a===null?void 0:_ve(a);i&&(n===void 0||i.type===n)&&r.push(i)}return r}async getDocument(t){const n=localStorage.getItem($m(t));if(n===null)throw hj(t);return n}async saveDocument(t,n){localStorage.setItem($m(t),n)}async deleteDocument(t){const n=$m(t);if(localStorage.getItem(n)===null)throw hj(t);localStorage.removeItem(n)}async moveDocument(t,n){const r=await this.getDocument(t);localStorage.setItem($m(n),r),localStorage.removeItem($m(t))}}function $m(e){return`${NC}${e.type}:${e.path}`}function _ve(e){if(!e.startsWith(NC))return;const t=e.slice(NC.length),n=t.indexOf(":");if(n<=0)return;const r=t.slice(0,n);if(!(r!=="dashboard"&&r!=="notebook"))return{workspace:jC.name,type:r,path:t.slice(n+1)}}function hj(e){return new aF(`No ${e.type} at ${e.workspace}/${e.path}`)}const mj="[publisher.dashboard]",gj="[publisher.notebook]",yj="[publisher.console]";function T0e(e){return t=>{const n=t.type.endsWith("_refused")||t.type==="dashboard.rows_shown"&&!t.ok,r={...e,...t,at:new Date().toISOString()};n?console.warn(mj,r):console.info(mj,r)}}function O0e(e){return t=>{const n={...e,...t,at:new Date().toISOString()};t.type.endsWith("_refused")?console.warn(gj,n):console.info(gj,n)}}function Uve(e){const t={...e,at:new Date().toISOString()};e.ok?console.info(yj,t):console.warn(yj,t)}const Mo={white:"#FFFFFF",offWhite:"#F8FAFC",grey:{light:"#E2E8F0",mid:"#64748B"},black:"#0F172A",semantic:{success:{main:qr.emerald,light:"#D1FAE5",dark:"#047857"},warning:{main:qr.amber,light:"#FEF3C7",dark:"#92400E"},error:{main:qr.red,light:"#FEE2E2",dark:"#B91C1C"},info:{main:qr.blue,light:"#DBEAFE",dark:"#1D4ED8"}}},Vv='"Inter", "Helvetica Neue", "Arial", sans-serif',Jo={50:Mo.offWhite,100:"#F1F5F9",200:Mo.grey.light,300:"#CBD5E1",400:"#94A3B8",500:Mo.grey.mid,600:"#475569",700:"#334155",800:"#1E293B",900:Mo.black},M0e={headerHeight:56},rw="0 1px 3px rgba(0, 0, 0, 0.1)",Bve="#0f172a",Vve="#1e293b",Hve="#f1f5f9",qve="#cbd5e1",Wve="#334155",NF=(e="light",t)=>{const n=e==="dark",r=n?Bve:Mo.white,o=n?Vve:Mo.white,a=n?Hve:Mo.black,i=n?qve:Mo.grey.mid,l=n?Wve:Mo.grey.light,{accent:c,accentHover:f,accentContrast:u}=t??Qw(void 0,e);return b0({cssVariables:{nativeColor:!0},palette:{mode:e,primary:{main:c,light:Mo.grey.light,dark:f,contrastText:u},secondary:{main:Mo.grey.mid,light:Mo.grey.light,dark:Mo.black},grey:Jo,success:Mo.semantic.success,warning:Mo.semantic.warning,error:Mo.semantic.error,info:Mo.semantic.info,background:{default:r,paper:o},text:{primary:a,secondary:i},divider:l},typography:{fontFamily:Vv,h1:{fontWeight:500,letterSpacing:"-0.025em"},h2:{fontWeight:500,letterSpacing:"-0.025em"},h3:{fontWeight:500,letterSpacing:"-0.025em"},h4:{fontWeight:500,letterSpacing:"-0.025em"},h5:{fontWeight:500,letterSpacing:"-0.025em"},h6:{fontWeight:500,letterSpacing:"-0.025em"},subtitle1:{fontWeight:500,letterSpacing:"-0.025em"},subtitle2:{fontWeight:500,letterSpacing:"-0.025em"},body1:{letterSpacing:"-0.025em"},body2:{letterSpacing:"-0.025em"},button:{fontWeight:500,letterSpacing:"-0.025em",textTransform:"none"}},shape:{borderRadius:4},components:{MuiButtonBase:{defaultProps:{disableRipple:!0,disableTouchRipple:!0},styleOverrides:{root:{"&:focus-visible":{outline:`2px solid ${c}`,outlineOffset:2}}}},MuiCssBaseline:{styleOverrides:{"*":{scrollbarWidth:"thin",scrollbarColor:n?"#475569 #1e293b":`${Jo[300]} ${Jo[100]}`,"&::-webkit-scrollbar":{width:"8px",height:"8px"},"&::-webkit-scrollbar-track":{background:n?"#1e293b":Jo[100],borderRadius:"4px"},"&::-webkit-scrollbar-thumb":{background:n?"#475569":Jo[300],borderRadius:"4px","&:hover":{background:n?"#64748b":Jo[400]}},"&::-webkit-scrollbar-corner":{background:n?"#1e293b":Jo[100]}},"div[data-radix-popper-content-wrapper]":{zIndex:"1300 !important"}}},MuiButton:{styleOverrides:{root:{borderRadius:20,textTransform:"none",fontWeight:500,boxShadow:"none","&:hover":{boxShadow:rw}},contained:{"&:hover":{boxShadow:"0 2px 4px rgba(0, 0, 0, 0.1)"},"&.Mui-disabled":{backgroundColor:n?"rgba(255, 255, 255, 0.06)":Jo[200],color:n?"#64748b":Jo[500]}},outlined:{color:a,borderColor:n?"#475569":Jo[300],"&:hover":{borderColor:n?"#64748b":Jo[400],backgroundColor:n?"rgba(255, 255, 255, 0.06)":"rgba(0, 0, 0, 0.04)"}}}},MuiCard:{styleOverrides:{root:{borderRadius:4,boxShadow:rw,border:"1px solid",borderColor:l,backgroundColor:o}}},MuiChip:{styleOverrides:{root:{borderRadius:4,fontWeight:500}}},MuiTextField:{styleOverrides:{root:{"& .MuiOutlinedInput-root":{borderRadius:4},"& .MuiInputLabel-outlined":{backgroundColor:o,paddingLeft:4,paddingRight:4,"&.MuiInputLabel-shrink":{transform:"translate(14px, -9px) scale(0.75)"}}}}},MuiPaper:{styleOverrides:{root:{backgroundImage:"none"}}},MuiDialog:{styleOverrides:{paper:{borderRadius:4,backgroundColor:o,boxShadow:"0px 20px 25px -5px rgba(0, 0, 0, 0.1), 0px 10px 10px -5px rgba(0, 0, 0, 0.04)"}}},MuiSelect:{styleOverrides:{select:{fontFamily:Vv,fontSize:"0.875rem",color:a}}},MuiInputLabel:{styleOverrides:{root:{"&.MuiInputLabel-outlined":{backgroundColor:o,paddingLeft:4,paddingRight:4}}}},MuiOutlinedInput:{styleOverrides:{notchedOutline:{border:"none"},root:{border:`1px solid ${n?Jo[600]:Jo[300]}`,borderRadius:8,transition:`border-color ${mz} ease-in`,...gz,backgroundColor:o,"&:hover":{borderColor:n?"#64748b":Jo[400]},"&.Mui-focused":{borderColor:n?Jo[400]:Jo[500],outline:"none"}}}},MuiMenuItem:{styleOverrides:{root:{fontFamily:Vv,fontSize:"0.875rem"}}},MuiInputBase:{styleOverrides:{root:{fontFamily:Vv}}},MuiMenu:{styleOverrides:{paper:{borderRadius:4,boxShadow:"0px 10px 15px -3px rgba(0, 0, 0, 0.1), 0px 4px 6px -2px rgba(0, 0, 0, 0.05)",border:`1px solid ${l}`,backgroundColor:o,color:a}}},MuiBreadcrumbs:{styleOverrides:{root:{"& .MuiBreadcrumbs-separator":{margin:"0 6px",color:Jo[400]}}}},MuiDivider:{styleOverrides:{root:{borderColor:l}},defaultProps:{sx:{my:1}}},MuiListItemButton:{styleOverrides:{root:{borderRadius:28,margin:"2px 8px",padding:"8px 16px","&:hover":{backgroundColor:n?"rgba(255, 255, 255, 0.08)":Mo.offWhite},"&.Mui-selected":{backgroundColor:n?"rgba(255, 255, 255, 0.12)":Mo.offWhite,color:a,"& .MuiListItemIcon-root":{color:a},"& .MuiListItemText-primary":{color:a},"&:hover":{backgroundColor:n?"rgba(255, 255, 255, 0.16)":Mo.grey.light}}}}},MuiAppBar:{styleOverrides:{root:{backgroundColor:o,color:a,boxShadow:rw}}}}})};NF("light");function Yve({children:e}){const{mode:t,theme:n}=is(),{accent:r,accentHover:o,accentContrast:a}=n,i=k.useMemo(()=>NF(t,{accent:r,accentHover:o,accentContrast:a}),[t,r,o,a]);return g.jsxs(TH,{theme:i,children:[g.jsx(R9,{}),e]})}const Gve=k.lazy(()=>Co(()=>import("./HomePage-BM31X4Y8.js"),[])),Kve=k.lazy(()=>Co(()=>import("./MainPage-CQW3P4wB.js"),__vite__mapDeps([7,8]))),Qve=k.lazy(()=>Co(()=>import("./ModelPage-dBHaHb6u.js"),__vite__mapDeps([9,8]))),Xve=k.lazy(()=>Co(()=>import("./PackagePage-B-ruDCyR.js"),__vite__mapDeps([10,8]))),Zve=k.lazy(()=>Co(()=>import("./EnvironmentPage-V6cQ_Kpr.js"),[])),Jve=k.lazy(()=>Co(()=>import("./RouteError-DLJlCtRG.js"),[])),ebe=k.lazy(()=>Co(()=>import("./ThemeEditorPage-Ck4rJ1vv.js"),__vite__mapDeps([11,12]))),tbe=(e="/",t=new Fve,n)=>(Ime(Uve),vU([{path:e,element:g.jsx(GZ,{children:g.jsx(rme,{documentStorage:t,children:g.jsx(Yve,{children:g.jsx(k.Suspense,{fallback:g.jsx(ma,{}),children:g.jsx(Kve,{headerProps:n})})})})}),errorElement:g.jsx(Jve,{}),children:[{index:!0,element:g.jsx(Gve,{})},{path:"settings/theme",element:g.jsx(ebe,{})},{path:"settings",element:g.jsx(W_,{to:"/settings/theme",replace:!0})},{path:":environmentName",element:g.jsx(Zve,{})},{path:":environmentName/:packageName",element:g.jsx(Xve,{})},{path:":environmentName/:packageName/*",element:g.jsx(Qve,{})}]}])),nbe=tbe("/");o3.createRoot(document.getElementById("root")).render(g.jsx(k.StrictMode,{children:g.jsx(PU,{router:nbe})}));export{i0 as $,rs as A,ud as B,jg as C,mme as D,obe as E,Lt as F,fI as G,Lo as H,ty as I,C0e as J,Zi as K,Ik as L,bI as M,wr as N,QI as O,Wa as P,Ic as Q,is as R,vw as S,It as T,wI as U,Pp as V,nu as W,yK as X,M0e as Y,ibe as Z,ma as _,hn as a,SD as a$,il as a0,Ur as a1,fp as a2,b0e as a3,bve as a4,mE as a5,Co as a6,abe as a7,Zbe as a8,T0e as a9,JW as aA,A0 as aB,Yo as aC,eo as aD,Uc as aE,t0 as aF,ld as aG,Ci as aH,aE as aI,See as aJ,$ee as aK,rbe as aL,IC as aM,fZ as aN,yz as aO,a0e as aP,r0e as aQ,Che as aR,t0e as aS,i0e as aT,l0e as aU,phe as aV,s0e as aW,are as aX,Xbe as aY,pE as aZ,h0e as a_,O0e as aa,y0e as ab,bp as ac,pn as ad,x0e as ae,R0e as af,S0e as ag,k0e as ah,xme as ai,jo as aj,E0e as ak,Dve as al,w0e as am,j_ as an,Pk as ao,fr as ap,x$ as aq,Ca as ar,xY as as,DL as at,W2 as au,na as av,Rd as aw,WK as ax,qi as ay,KW as az,Ks as b,Jhe as b$,ome as b0,Jr as b1,p0e as b2,u0e as b3,Ta as b4,tme as b5,Jbe as b6,ap as b7,cre as b8,vz as b9,fee as bA,$k as bB,Jm as bC,lre as bD,Kc as bE,zhe as bF,tr as bG,b9 as bH,e0e as bI,pre as bJ,Xg as bK,Uhe as bL,ED as bM,Vbe as bN,She as bO,Hbe as bP,F0 as bQ,Qbe as bR,bz as bS,cee as bT,PW as bU,n0e as bV,Kbe as bW,Pb as bX,Bbe as bY,lP as bZ,qb as b_,Lhe as ba,gz as bb,mz as bc,fre as bd,sre as be,_he as bf,Qhe as bg,Yhe as bh,d0e as bi,c0e as bj,f0e as bk,m0e as bl,g0e as bm,o0e as bn,xE as bo,yre as bp,RD as bq,hhe as br,Dhe as bs,GE as bt,Ube as bu,Gbe as bv,lee as bw,qbe as bx,Wbe as by,Ybe as bz,Ya as c,Zhe as c0,Ghe as c1,EC as c2,qhe as c3,XE as c4,Xhe as c5,Vhe as c6,Khe as c7,nme as c8,pg as c9,Nt as d,hw as e,dn as f,un as g,Cd as h,fl as i,g as j,vo as k,kd as l,an as m,WN as n,Yl as o,XN as p,v0e as q,k as r,st as s,xb as t,mn as u,_g as v,YN as w,An as x,it as y,Oa as z};