@malloy-publisher/server 0.0.236 → 0.0.237

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,5 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/core-Rj_4rRnA.es-BZyvITuO.js","assets/engine-oniguruma-C4vnmooL.es-jdkXmgTr.js","assets/index-DQa463gC.js","assets/index-VBbcc8s6.js","assets/index-w_0OQJgZ.js","assets/index-DQpV7MyA.js","assets/index-DzaYbhnD.js","assets/MainPage-CO3pRlnV.js","assets/LightMode-Cfh7KzN8.js","assets/ThemeEditorPage-CciagFTq.js"])))=>i.map(i=>d[i]);
2
- function Zz(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 IPe=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function v4(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var UC={exports:{}},Pm={};/**
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/core-BSRgt1mG.es-Bc_D2Lq4.js","assets/engine-oniguruma-C4vnmooL.es-jdkXmgTr.js","assets/index-BX4D94xw.js","assets/index-Cvy0xtb7.js","assets/index-w_0OQJgZ.js","assets/index-DMAhIJNC.js","assets/index-DzaYbhnD.js","assets/MainPage-J_rU2SgI.js","assets/LightMode-Be4-G-dX.js","assets/ThemeEditorPage-Btxnmhtk.js"])))=>i.map(i=>d[i]);
2
+ function Zz(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 _Pe=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function v4(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var UC={exports:{}},Pm={};/**
3
3
  * @license React
4
4
  * react-jsx-runtime.production.js
5
5
  *
@@ -57,9 +57,9 @@ Error generating stack: `+h.message+`
57
57
  *
58
58
  * @license MIT
59
59
  */var S4=e=>{throw TypeError(e)},lH=(e,t,n)=>t.has(e)||S4("Cannot "+n),KC=(e,t,n)=>(lH(e,t,"read from private field"),n?n.call(e):t.get(e)),cH=(e,t,n)=>t.has(e)?S4("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),sN="popstate";function uH(e={}){function t(r,o){let{pathname:a,search:i,hash:s}=r.location;return by("",{pathname:a,search:i,hash:s},o.state&&o.state.usr||null,o.state&&o.state.key||"default")}function n(r,o){return typeof o=="string"?o:Tu(o)}return fH(t,n,null,e)}function qn(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function vo(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function dH(){return Math.random().toString(36).substring(2,10)}function lN(e,t){return{usr:e.state,key:e.key,idx:t}}function by(e,t,n=null,r){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?Ru(t):t,state:n,key:t&&t.key||r||dH()}}function Tu({pathname:e="/",search:t="",hash:n=""}){return t&&t!=="?"&&(e+=t.charAt(0)==="?"?t:"?"+t),n&&n!=="#"&&(e+=n.charAt(0)==="#"?n:"#"+n),e}function Ru(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substring(n),e=e.substring(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substring(r),e=e.substring(0,r)),e&&(t.pathname=e)}return t}function fH(e,t,n,r={}){let{window:o=document.defaultView,v5Compat:a=!1}=r,i=o.history,s="POP",c=null,u=f();u==null&&(u=0,i.replaceState({...i.state,idx:u},""));function f(){return(i.state||{idx:null}).idx}function p(){s="POP";let E=f(),S=E==null?null:E-u;u=E,c&&c({action:s,location:x.location,delta:S})}function y(E,S){s="PUSH";let w=by(x.location,E,S);u=f()+1;let C=lN(w,u),R=x.createHref(w);try{i.pushState(C,"",R)}catch(M){if(M instanceof DOMException&&M.name==="DataCloneError")throw M;o.location.assign(R)}a&&c&&c({action:s,location:x.location,delta:1})}function g(E,S){s="REPLACE";let w=by(x.location,E,S);u=f();let C=lN(w,u),R=x.createHref(w);i.replaceState(C,"",R),a&&c&&c({action:s,location:x.location,delta:0})}function b(E){return E4(E)}let x={get action(){return s},get location(){return e(o,i)},listen(E){if(c)throw new Error("A history only accepts one active listener");return o.addEventListener(sN,p),c=E,()=>{o.removeEventListener(sN,p),c=null}},createHref(E){return t(o,E)},createURL:b,encodeLocation(E){let S=b(E);return{pathname:S.pathname,search:S.search,hash:S.hash}},push:y,replace:g,go(E){return i.go(E)}};return x}function E4(e,t=!1){let n="http://localhost";typeof window<"u"&&(n=window.location.origin!=="null"?window.location.origin:window.location.href),qn(n,"No window.location.(origin|href) available to create URL");let r=typeof e=="string"?e:Tu(e);return r=r.replace(/ $/,"%20"),!t&&r.startsWith("//")&&(r=n+r),new URL(r,n)}var Og,cN=class{constructor(e){if(cH(this,Og,new Map),e)for(let[t,n]of e)this.set(t,n)}get(e){if(KC(this,Og).has(e))return KC(this,Og).get(e);if(e.defaultValue!==void 0)return e.defaultValue;throw new Error("No value found for context")}set(e,t){KC(this,Og).set(e,t)}};Og=new WeakMap;var pH=new Set(["lazy","caseSensitive","path","id","index","children"]);function hH(e){return pH.has(e)}var mH=new Set(["lazy","caseSensitive","path","id","index","middleware","children"]);function gH(e){return mH.has(e)}function yH(e){return e.index===!0}function vy(e,t,n=[],r={},o=!1){return e.map((a,i)=>{let s=[...n,String(i)],c=typeof a.id=="string"?a.id:s.join("-");if(qn(a.index!==!0||!a.children,"Cannot specify children on an index route"),qn(o||!r[c],`Found a route id collision on id "${c}". Route id's must be globally unique within Data Router usages`),yH(a)){let u={...a,...t(a),id:c};return r[c]=u,u}else{let u={...a,...t(a),id:c,children:void 0};return r[c]=u,a.children&&(u.children=vy(a.children,t,s,r,o)),u}})}function cu(e,t,n="/"){return B0(e,t,n,!1)}function B0(e,t,n,r){let o=typeof t=="string"?Ru(t):t,a=os(o.pathname||"/",n);if(a==null)return null;let i=C4(e);vH(i);let s=null;for(let c=0;s==null&&c<i.length;++c){let u=RH(a);s=DH(i[c],u,r)}return s}function bH(e,t){let{route:n,pathname:r,params:o}=e;return{id:n.id,pathname:r,params:o,data:t[n.id],loaderData:t[n.id],handle:n.handle}}function C4(e,t=[],n=[],r="",o=!1){let a=(i,s,c=o,u)=>{let f={relativePath:u===void 0?i.path||"":u,caseSensitive:i.caseSensitive===!0,childrenIndex:s,route:i};if(f.relativePath.startsWith("/")){if(!f.relativePath.startsWith(r)&&c)return;qn(f.relativePath.startsWith(r),`Absolute route path "${f.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),f.relativePath=f.relativePath.slice(r.length)}let p=ul([r,f.relativePath]),y=n.concat(f);i.children&&i.children.length>0&&(qn(i.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${p}".`),C4(i.children,t,y,p,c)),!(i.path==null&&!i.index)&&t.push({path:p,score:kH(p,i.index),routesMeta:y})};return e.forEach((i,s)=>{if(i.path===""||!i.path?.includes("?"))a(i,s);else for(let c of T4(i.path))a(i,s,!0,c)}),t}function T4(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,o=n.endsWith("?"),a=n.replace(/\?$/,"");if(r.length===0)return o?[a,""]:[a];let i=T4(r.join("/")),s=[];return s.push(...i.map(c=>c===""?a:[a,c].join("/"))),o&&s.push(...i),s.map(c=>e.startsWith("/")&&c===""?"/":c)}function vH(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:AH(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}var xH=/^:[\w-]+$/,SH=3,EH=2,CH=1,TH=10,wH=-2,uN=e=>e==="*";function kH(e,t){let n=e.split("/"),r=n.length;return n.some(uN)&&(r+=wH),t&&(r+=EH),n.filter(o=>!uN(o)).reduce((o,a)=>o+(xH.test(a)?SH:a===""?CH:TH),r)}function AH(e,t){return e.length===t.length&&e.slice(0,-1).every((r,o)=>r===t[o])?e[e.length-1]-t[t.length-1]:0}function DH(e,t,n=!1){let{routesMeta:r}=e,o={},a="/",i=[];for(let s=0;s<r.length;++s){let c=r[s],u=s===r.length-1,f=a==="/"?t:t.slice(a.length)||"/",p=b1({path:c.relativePath,caseSensitive:c.caseSensitive,end:u},f),y=c.route;if(!p&&u&&n&&!r[r.length-1].route.index&&(p=b1({path:c.relativePath,caseSensitive:c.caseSensitive,end:!1},f)),!p)return null;Object.assign(o,p.params),i.push({params:o,pathname:ul([a,p.pathname]),pathnameBase:IH(ul([a,p.pathnameBase])),route:y}),p.pathnameBase!=="/"&&(a=ul([a,p.pathnameBase]))}return i}function b1(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=OH(e.path,e.caseSensitive,e.end),o=t.match(n);if(!o)return null;let a=o[0],i=a.replace(/(.)\/+$/,"$1"),s=o.slice(1);return{params:r.reduce((u,{paramName:f,isOptional:p},y)=>{if(f==="*"){let b=s[y]||"";i=a.slice(0,a.length-b.length).replace(/(.)\/+$/,"$1")}const g=s[y];return p&&!g?u[f]=void 0:u[f]=(g||"").replace(/%2F/g,"/"),u},{}),pathname:a,pathnameBase:i,pattern:e}}function OH(e,t=!1,n=!0){vo(e==="*"||!e.endsWith("*")||e.endsWith("/*"),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,"/*")}".`);let r=[],o="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(i,s,c)=>(r.push({paramName:s,isOptional:c!=null}),c?"/?([^\\/]+)?":"/([^\\/]+)")).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return e.endsWith("*")?(r.push({paramName:"*"}),o+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?o+="\\/*$":e!==""&&e!=="/"&&(o+="(?:(?=\\/|$))"),[new RegExp(o,t?void 0:"i"),r]}function RH(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return vo(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function os(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&r!=="/"?null:e.slice(n)||"/"}function MH({basename:e,pathname:t}){return t==="/"?e:ul([e,t])}function NH(e,t="/"){let{pathname:n,search:r="",hash:o=""}=typeof e=="string"?Ru(e):e;return{pathname:n?n.startsWith("/")?n:PH(n,t):t,search:_H(r),hash:LH(o)}}function PH(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(o=>{o===".."?n.length>1&&n.pop():o!=="."&&n.push(o)}),n.length>1?n.join("/"):"/"}function QC(e,t,n,r){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(r)}]. Please separate it out to the \`to.${n}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function w4(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function hx(e){let t=w4(e);return t.map((n,r)=>r===t.length-1?n.pathname:n.pathnameBase)}function mx(e,t,n,r=!1){let o;typeof e=="string"?o=Ru(e):(o={...e},qn(!o.pathname||!o.pathname.includes("?"),QC("?","pathname","search",o)),qn(!o.pathname||!o.pathname.includes("#"),QC("#","pathname","hash",o)),qn(!o.search||!o.search.includes("#"),QC("#","search","hash",o)));let a=e===""||o.pathname==="",i=a?"/":o.pathname,s;if(i==null)s=n;else{let p=t.length-1;if(!r&&i.startsWith("..")){let y=i.split("/");for(;y[0]==="..";)y.shift(),p-=1;o.pathname=y.join("/")}s=p>=0?t[p]:"/"}let c=NH(o,s),u=i&&i!=="/"&&i.endsWith("/"),f=(a||i===".")&&n.endsWith("/");return!c.pathname.endsWith("/")&&(u||f)&&(c.pathname+="/"),c}var ul=e=>e.join("/").replace(/\/\/+/g,"/"),IH=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),_H=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,LH=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,v1=class{constructor(e,t,n,r=!1){this.status=e,this.statusText=t||"",this.internal=r,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}};function xy(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}var k4=["POST","PUT","PATCH","DELETE"],FH=new Set(k4),jH=["GET",...k4],BH=new Set(jH),$H=new Set([301,302,303,307,308]),zH=new Set([307,308]),XC={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},HH={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},_m={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},UH=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,b2=e=>UH.test(e),VH=e=>({hasErrorBoundary:!!e.hasErrorBoundary}),A4="remix-router-transitions",D4=Symbol("ResetLoaderData");function WH(e){const t=e.window?e.window:typeof window<"u"?window:void 0,n=typeof t<"u"&&typeof t.document<"u"&&typeof t.document.createElement<"u";qn(e.routes.length>0,"You must provide a non-empty routes array to createRouter");let r=e.hydrationRouteProperties||[],o=e.mapRouteProperties||VH,a={},i=vy(e.routes,o,void 0,a),s,c=e.basename||"/";c.startsWith("/")||(c=`/${c}`);let u=e.dataStrategy||QH,f={...e.future},p=null,y=new Set,g=null,b=null,x=null,E=e.hydrationData!=null,S=cu(i,e.history.location,c),w=!1,C=null,R;if(S==null&&!e.patchRoutesOnNavigation){let he=Wi(404,{pathname:e.history.location.pathname}),{matches:Ae,route:Ie}=t0(i);R=!0,S=Ae,C={[Ie.id]:he}}else if(S&&!e.hydrationData&&Hn(S,i,e.history.location.pathname).active&&(S=null),S)if(S.some(he=>he.route.lazy))R=!1;else if(!S.some(he=>he.route.loader))R=!0;else{let he=e.hydrationData?e.hydrationData.loaderData:null,Ae=e.hydrationData?e.hydrationData.errors:null;if(Ae){let Ie=S.findIndex(Ve=>Ae[Ve.route.id]!==void 0);R=S.slice(0,Ie+1).every(Ve=>!Sw(Ve.route,he,Ae))}else R=S.every(Ie=>!Sw(Ie.route,he,Ae))}else{R=!1,S=[];let he=Hn(null,i,e.history.location.pathname);he.active&&he.matches&&(w=!0,S=he.matches)}let M,D={historyAction:e.history.action,location:e.history.location,matches:S,initialized:R,navigation:XC,restoreScrollPosition:e.hydrationData!=null?!1:null,preventScrollReset:!1,revalidation:"idle",loaderData:e.hydrationData&&e.hydrationData.loaderData||{},actionData:e.hydrationData&&e.hydrationData.actionData||null,errors:e.hydrationData&&e.hydrationData.errors||C,fetchers:new Map,blockers:new Map},I="POP",L=!1,F,B=!1,U=new Map,k=null,$=!1,j=!1,V=new Set,z=new Map,K=0,Y=-1,te=new Map,_=new Set,Z=new Map,J=new Map,W=new Set,re=new Map,ne,X=null;function ie(){if(p=e.history.listen(({action:he,location:Ae,delta:Ie})=>{if(ne){ne(),ne=void 0;return}vo(re.size===0||Ie!=null,"You are trying to use a blocker on a POP navigation to a location that was not created by @remix-run/router. This will fail silently in production. This can happen if you are navigating outside the router via `window.history.pushState`/`window.location.hash` instead of using router navigation APIs. This can also happen if you are using createHashRouter and the user manually changes the URL.");let Ve=ht({currentLocation:D.location,nextLocation:Ae,historyAction:he});if(Ve&&Ie!=null){let ot=new Promise(It=>{ne=It});e.history.go(Ie*-1),yt(Ve,{state:"blocked",location:Ae,proceed(){yt(Ve,{state:"proceeding",proceed:void 0,reset:void 0,location:Ae}),ot.then(()=>e.history.go(Ie))},reset(){let It=new Map(D.blockers);It.set(Ve,_m),xe({blockers:It})}});return}return me(he,Ae)}),n){dU(t,U);let he=()=>fU(t,U);t.addEventListener("pagehide",he),k=()=>t.removeEventListener("pagehide",he)}return D.initialized||me("POP",D.location,{initialHydration:!0}),M}function ae(){p&&p(),k&&k(),y.clear(),F&&F.abort(),D.fetchers.forEach((he,Ae)=>St(Ae)),D.blockers.forEach((he,Ae)=>Ue(Ae))}function fe(he){return y.add(he),()=>y.delete(he)}function xe(he,Ae={}){he.matches&&(he.matches=he.matches.map(ot=>{let It=a[ot.route.id],Ft=ot.route;return Ft.element!==It.element||Ft.errorElement!==It.errorElement||Ft.hydrateFallbackElement!==It.hydrateFallbackElement?{...ot,route:It}:ot})),D={...D,...he};let Ie=[],Ve=[];D.fetchers.forEach((ot,It)=>{ot.state==="idle"&&(W.has(It)?Ie.push(It):Ve.push(It))}),W.forEach(ot=>{!D.fetchers.has(ot)&&!z.has(ot)&&Ie.push(ot)}),[...y].forEach(ot=>ot(D,{deletedFetchers:Ie,viewTransitionOpts:Ae.viewTransitionOpts,flushSync:Ae.flushSync===!0})),Ie.forEach(ot=>St(ot)),Ve.forEach(ot=>D.fetchers.delete(ot))}function ge(he,Ae,{flushSync:Ie}={}){let Ve=D.actionData!=null&&D.navigation.formMethod!=null&&La(D.navigation.formMethod)&&D.navigation.state==="loading"&&he.state?._isRedirect!==!0,ot;Ae.actionData?Object.keys(Ae.actionData).length>0?ot=Ae.actionData:ot=null:Ve?ot=D.actionData:ot=null;let It=Ae.loaderData?xN(D.loaderData,Ae.loaderData,Ae.matches||[],Ae.errors):D.loaderData,Ft=D.blockers;Ft.size>0&&(Ft=new Map(Ft),Ft.forEach((kt,Et)=>Ft.set(Et,_m)));let Rt=$?!1:Gn(he,Ae.matches||D.matches),jt=L===!0||D.navigation.formMethod!=null&&La(D.navigation.formMethod)&&he.state?._isRedirect!==!0;s&&(i=s,s=void 0),$||I==="POP"||(I==="PUSH"?e.history.push(he,he.state):I==="REPLACE"&&e.history.replace(he,he.state));let Nt;if(I==="POP"){let kt=U.get(D.location.pathname);kt&&kt.has(he.pathname)?Nt={currentLocation:D.location,nextLocation:he}:U.has(he.pathname)&&(Nt={currentLocation:he,nextLocation:D.location})}else if(B){let kt=U.get(D.location.pathname);kt?kt.add(he.pathname):(kt=new Set([he.pathname]),U.set(D.location.pathname,kt)),Nt={currentLocation:D.location,nextLocation:he}}xe({...Ae,actionData:ot,loaderData:It,historyAction:I,location:he,initialized:!0,navigation:XC,revalidation:"idle",restoreScrollPosition:Rt,preventScrollReset:jt,blockers:Ft},{viewTransitionOpts:Nt,flushSync:Ie===!0}),I="POP",L=!1,B=!1,$=!1,j=!1,X?.resolve(),X=null}async function Re(he,Ae){if(typeof he=="number"){e.history.go(he);return}let Ie=xw(D.location,D.matches,c,he,Ae?.fromRouteId,Ae?.relative),{path:Ve,submission:ot,error:It}=dN(!1,Ie,Ae),Ft=D.location,Rt=by(D.location,Ve,Ae&&Ae.state);Rt={...Rt,...e.history.encodeLocation(Rt)};let jt=Ae&&Ae.replace!=null?Ae.replace:void 0,Nt="PUSH";jt===!0?Nt="REPLACE":jt===!1||ot!=null&&La(ot.formMethod)&&ot.formAction===D.location.pathname+D.location.search&&(Nt="REPLACE");let kt=Ae&&"preventScrollReset"in Ae?Ae.preventScrollReset===!0:void 0,Et=(Ae&&Ae.flushSync)===!0,Bt=ht({currentLocation:Ft,nextLocation:Rt,historyAction:Nt});if(Bt){yt(Bt,{state:"blocked",location:Rt,proceed(){yt(Bt,{state:"proceeding",proceed:void 0,reset:void 0,location:Rt}),Re(he,Ae)},reset(){let Tn=new Map(D.blockers);Tn.set(Bt,_m),xe({blockers:Tn})}});return}await me(Nt,Rt,{submission:ot,pendingError:It,preventScrollReset:kt,replace:Ae&&Ae.replace,enableViewTransition:Ae&&Ae.viewTransition,flushSync:Et})}function de(){X||(X=pU()),Mt(),xe({revalidation:"loading"});let he=X.promise;return D.navigation.state==="submitting"?he:D.navigation.state==="idle"?(me(D.historyAction,D.location,{startUninterruptedRevalidation:!0}),he):(me(I||D.historyAction,D.navigation.location,{overrideNavigation:D.navigation,enableViewTransition:B===!0}),he)}async function me(he,Ae,Ie){F&&F.abort(),F=null,I=he,$=(Ie&&Ie.startUninterruptedRevalidation)===!0,pn(D.location,D.matches),L=(Ie&&Ie.preventScrollReset)===!0,B=(Ie&&Ie.enableViewTransition)===!0;let Ve=s||i,ot=Ie&&Ie.overrideNavigation,It=Ie?.initialHydration&&D.matches&&D.matches.length>0&&!w?D.matches:cu(Ve,Ae,c),Ft=(Ie&&Ie.flushSync)===!0;if(It&&D.initialized&&!j&&oU(D.location,Ae)&&!(Ie&&Ie.submission&&La(Ie.submission.formMethod))){ge(Ae,{matches:It},{flushSync:Ft});return}let Rt=Hn(It,Ve,Ae.pathname);if(Rt.active&&Rt.matches&&(It=Rt.matches),!It){let{error:Yn,notFoundMatches:rn,route:le}=Cn(Ae.pathname);ge(Ae,{matches:rn,loaderData:{},errors:{[le.id]:Yn}},{flushSync:Ft});return}F=new AbortController;let jt=fp(e.history,Ae,F.signal,Ie&&Ie.submission),Nt=e.getContext?await e.getContext():new cN,kt;if(Ie&&Ie.pendingError)kt=[uu(It).route.id,{type:"error",error:Ie.pendingError}];else if(Ie&&Ie.submission&&La(Ie.submission.formMethod)){let Yn=await Qe(jt,Ae,Ie.submission,It,Nt,Rt.active,Ie&&Ie.initialHydration===!0,{replace:Ie.replace,flushSync:Ft});if(Yn.shortCircuited)return;if(Yn.pendingActionResult){let[rn,le]=Yn.pendingActionResult;if(ui(le)&&xy(le.error)&&le.error.status===404){F=null,ge(Ae,{matches:Yn.matches,loaderData:{},errors:{[rn]:le.error}});return}}It=Yn.matches||It,kt=Yn.pendingActionResult,ot=ZC(Ae,Ie.submission),Ft=!1,Rt.active=!1,jt=fp(e.history,jt.url,jt.signal)}let{shortCircuited:Et,matches:Bt,loaderData:Tn,errors:nr}=await Me(jt,Ae,It,Nt,Rt.active,ot,Ie&&Ie.submission,Ie&&Ie.fetcherSubmission,Ie&&Ie.replace,Ie&&Ie.initialHydration===!0,Ft,kt);Et||(F=null,ge(Ae,{matches:Bt||It,...SN(kt),loaderData:Tn,errors:nr}))}async function Qe(he,Ae,Ie,Ve,ot,It,Ft,Rt={}){Mt();let jt=cU(Ae,Ie);if(xe({navigation:jt},{flushSync:Rt.flushSync===!0}),It){let Et=await wn(Ve,Ae.pathname,he.signal);if(Et.type==="aborted")return{shortCircuited:!0};if(Et.type==="error"){if(Et.partialMatches.length===0){let{matches:Tn,route:nr}=t0(i);return{matches:Tn,pendingActionResult:[nr.id,{type:"error",error:Et.error}]}}let Bt=uu(Et.partialMatches).route.id;return{matches:Et.partialMatches,pendingActionResult:[Bt,{type:"error",error:Et.error}]}}else if(Et.matches)Ve=Et.matches;else{let{notFoundMatches:Bt,error:Tn,route:nr}=Cn(Ae.pathname);return{matches:Bt,pendingActionResult:[nr.id,{type:"error",error:Tn}]}}}let Nt,kt=$0(Ve,Ae);if(!kt.route.action&&!kt.route.lazy)Nt={type:"error",error:Wi(405,{method:he.method,pathname:Ae.pathname,routeId:kt.route.id})};else{let Et=xp(o,a,he,Ve,kt,Ft?[]:r,ot),Bt=await qt(he,Et,ot,null);if(Nt=Bt[kt.route.id],!Nt){for(let Tn of Ve)if(Bt[Tn.route.id]){Nt=Bt[Tn.route.id];break}}if(he.signal.aborted)return{shortCircuited:!0}}if(bd(Nt)){let Et;return Rt&&Rt.replace!=null?Et=Rt.replace:Et=yN(Nt.response.headers.get("Location"),new URL(he.url),c)===D.location.pathname+D.location.search,await Ze(he,Nt,!0,{submission:Ie,replace:Et}),{shortCircuited:!0}}if(ui(Nt)){let Et=uu(Ve,kt.route.id);return(Rt&&Rt.replace)!==!0&&(I="PUSH"),{matches:Ve,pendingActionResult:[Et.route.id,Nt,kt.route.id]}}return{matches:Ve,pendingActionResult:[kt.route.id,Nt]}}async function Me(he,Ae,Ie,Ve,ot,It,Ft,Rt,jt,Nt,kt,Et){let Bt=It||ZC(Ae,Ft),Tn=Ft||Rt||CN(Bt),nr=!$&&!Nt;if(ot){if(nr){let gr=we(Et);xe({navigation:Bt,...gr!==void 0?{actionData:gr}:{}},{flushSync:kt})}let en=await wn(Ie,Ae.pathname,he.signal);if(en.type==="aborted")return{shortCircuited:!0};if(en.type==="error"){if(en.partialMatches.length===0){let{matches:kn,route:zr}=t0(i);return{matches:kn,loaderData:{},errors:{[zr.id]:en.error}}}let gr=uu(en.partialMatches).route.id;return{matches:en.partialMatches,loaderData:{},errors:{[gr]:en.error}}}else if(en.matches)Ie=en.matches;else{let{error:gr,notFoundMatches:kn,route:zr}=Cn(Ae.pathname);return{matches:kn,loaderData:{},errors:{[zr.id]:gr}}}}let Yn=s||i,{dsMatches:rn,revalidatingFetchers:le}=fN(he,Ve,o,a,e.history,D,Ie,Tn,Ae,Nt?[]:r,Nt===!0,j,V,W,Z,_,Yn,c,e.patchRoutesOnNavigation!=null,Et);if(Y=++K,!e.dataStrategy&&!rn.some(en=>en.shouldLoad)&&!rn.some(en=>en.route.middleware)&&le.length===0){let en=$t();return ge(Ae,{matches:Ie,loaderData:{},errors:Et&&ui(Et[1])?{[Et[0]]:Et[1].error}:null,...SN(Et),...en?{fetchers:new Map(D.fetchers)}:{}},{flushSync:kt}),{shortCircuited:!0}}if(nr){let en={};if(!ot){en.navigation=Bt;let gr=we(Et);gr!==void 0&&(en.actionData=gr)}le.length>0&&(en.fetchers=Se(le)),xe(en,{flushSync:kt})}le.forEach(en=>{$e(en.key),en.controller&&z.set(en.key,en.controller)});let ce=()=>le.forEach(en=>$e(en.key));F&&F.signal.addEventListener("abort",ce);let{loaderResults:Be,fetcherResults:ut}=await Vt(rn,le,he,Ve);if(he.signal.aborted)return{shortCircuited:!0};F&&F.signal.removeEventListener("abort",ce),le.forEach(en=>z.delete(en.key));let qe=n0(Be);if(qe)return await Ze(he,qe.result,!0,{replace:jt}),{shortCircuited:!0};if(qe=n0(ut),qe)return _.add(qe.key),await Ze(he,qe.result,!0,{replace:jt}),{shortCircuited:!0};let{loaderData:Zt,errors:an}=vN(D,Ie,Be,Et,le,ut);Nt&&D.errors&&(an={...D.errors,...an});let vr=$t(),sn=pt(Y),qr=vr||sn||le.length>0;return{matches:Ie,loaderData:Zt,errors:an,...qr?{fetchers:new Map(D.fetchers)}:{}}}function we(he){if(he&&!ui(he[1]))return{[he[0]]:he[1].data};if(D.actionData)return Object.keys(D.actionData).length===0?null:D.actionData}function Se(he){return he.forEach(Ae=>{let Ie=D.fetchers.get(Ae.key),Ve=Lm(void 0,Ie?Ie.data:void 0);D.fetchers.set(Ae.key,Ve)}),new Map(D.fetchers)}async function dt(he,Ae,Ie,Ve){$e(he);let ot=(Ve&&Ve.flushSync)===!0,It=s||i,Ft=xw(D.location,D.matches,c,Ie,Ae,Ve?.relative),Rt=cu(It,Ft,c),jt=Hn(Rt,It,Ft);if(jt.active&&jt.matches&&(Rt=jt.matches),!Rt){Ne(he,Ae,Wi(404,{pathname:Ft}),{flushSync:ot});return}let{path:Nt,submission:kt,error:Et}=dN(!0,Ft,Ve);if(Et){Ne(he,Ae,Et,{flushSync:ot});return}let Bt=e.getContext?await e.getContext():new cN,Tn=(Ve&&Ve.preventScrollReset)===!0;if(kt&&La(kt.formMethod)){await ze(he,Ae,Nt,Rt,Bt,jt.active,ot,Tn,kt);return}Z.set(he,{routeId:Ae,path:Nt}),await tt(he,Ae,Nt,Rt,Bt,jt.active,ot,Tn,kt)}async function ze(he,Ae,Ie,Ve,ot,It,Ft,Rt,jt){Mt(),Z.delete(he);let Nt=D.fetchers.get(he);ke(he,uU(jt,Nt),{flushSync:Ft});let kt=new AbortController,Et=fp(e.history,Ie,kt.signal,jt);if(It){let $n=await wn(Ve,new URL(Et.url).pathname,Et.signal,he);if($n.type==="aborted")return;if($n.type==="error"){Ne(he,Ae,$n.error,{flushSync:Ft});return}else if($n.matches)Ve=$n.matches;else{Ne(he,Ae,Wi(404,{pathname:Ie}),{flushSync:Ft});return}}let Bt=$0(Ve,Ie);if(!Bt.route.action&&!Bt.route.lazy){let $n=Wi(405,{method:jt.formMethod,pathname:Ie,routeId:Ae});Ne(he,Ae,$n,{flushSync:Ft});return}z.set(he,kt);let Tn=K,nr=xp(o,a,Et,Ve,Bt,r,ot),rn=(await qt(Et,nr,ot,he))[Bt.route.id];if(Et.signal.aborted){z.get(he)===kt&&z.delete(he);return}if(W.has(he)){if(bd(rn)||ui(rn)){ke(he,iu(void 0));return}}else{if(bd(rn))if(z.delete(he),Y>Tn){ke(he,iu(void 0));return}else return _.add(he),ke(he,Lm(jt)),Ze(Et,rn,!1,{fetcherSubmission:jt,preventScrollReset:Rt});if(ui(rn)){Ne(he,Ae,rn.error);return}}let le=D.navigation.location||D.location,ce=fp(e.history,le,kt.signal),Be=s||i,ut=D.navigation.state!=="idle"?cu(Be,D.navigation.location,c):D.matches;qn(ut,"Didn't find any matches after fetcher action");let qe=++K;te.set(he,qe);let Zt=Lm(jt,rn.data);D.fetchers.set(he,Zt);let{dsMatches:an,revalidatingFetchers:vr}=fN(ce,ot,o,a,e.history,D,ut,jt,le,r,!1,j,V,W,Z,_,Be,c,e.patchRoutesOnNavigation!=null,[Bt.route.id,rn]);vr.filter($n=>$n.key!==he).forEach($n=>{let _o=$n.key,Vo=D.fetchers.get(_o),lf=Lm(void 0,Vo?Vo.data:void 0);D.fetchers.set(_o,lf),$e(_o),$n.controller&&z.set(_o,$n.controller)}),xe({fetchers:new Map(D.fetchers)});let sn=()=>vr.forEach($n=>$e($n.key));kt.signal.addEventListener("abort",sn);let{loaderResults:qr,fetcherResults:en}=await Vt(an,vr,ce,ot);if(kt.signal.aborted)return;if(kt.signal.removeEventListener("abort",sn),te.delete(he),z.delete(he),vr.forEach($n=>z.delete($n.key)),D.fetchers.has(he)){let $n=iu(rn.data);D.fetchers.set(he,$n)}let gr=n0(qr);if(gr)return Ze(ce,gr.result,!1,{preventScrollReset:Rt});if(gr=n0(en),gr)return _.add(gr.key),Ze(ce,gr.result,!1,{preventScrollReset:Rt});let{loaderData:kn,errors:zr}=vN(D,ut,qr,void 0,vr,en);pt(qe),D.navigation.state==="loading"&&qe>Y?(qn(I,"Expected pending action"),F&&F.abort(),ge(D.navigation.location,{matches:ut,loaderData:kn,errors:zr,fetchers:new Map(D.fetchers)})):(xe({errors:zr,loaderData:xN(D.loaderData,kn,ut,zr),fetchers:new Map(D.fetchers)}),j=!1)}async function tt(he,Ae,Ie,Ve,ot,It,Ft,Rt,jt){let Nt=D.fetchers.get(he);ke(he,Lm(jt,Nt?Nt.data:void 0),{flushSync:Ft});let kt=new AbortController,Et=fp(e.history,Ie,kt.signal);if(It){let le=await wn(Ve,new URL(Et.url).pathname,Et.signal,he);if(le.type==="aborted")return;if(le.type==="error"){Ne(he,Ae,le.error,{flushSync:Ft});return}else if(le.matches)Ve=le.matches;else{Ne(he,Ae,Wi(404,{pathname:Ie}),{flushSync:Ft});return}}let Bt=$0(Ve,Ie);z.set(he,kt);let Tn=K,nr=xp(o,a,Et,Ve,Bt,r,ot),rn=(await qt(Et,nr,ot,he))[Bt.route.id];if(z.get(he)===kt&&z.delete(he),!Et.signal.aborted){if(W.has(he)){ke(he,iu(void 0));return}if(bd(rn))if(Y>Tn){ke(he,iu(void 0));return}else{_.add(he),await Ze(Et,rn,!1,{preventScrollReset:Rt});return}if(ui(rn)){Ne(he,Ae,rn.error);return}ke(he,iu(rn.data))}}async function Ze(he,Ae,Ie,{submission:Ve,fetcherSubmission:ot,preventScrollReset:It,replace:Ft}={}){Ae.response.headers.has("X-Remix-Revalidate")&&(j=!0);let Rt=Ae.response.headers.get("Location");qn(Rt,"Expected a Location header on the redirect Response"),Rt=yN(Rt,new URL(he.url),c);let jt=by(D.location,Rt,{_isRedirect:!0});if(n){let nr=!1;if(Ae.response.headers.has("X-Remix-Reload-Document"))nr=!0;else if(b2(Rt)){const Yn=E4(Rt,!0);nr=Yn.origin!==t.location.origin||os(Yn.pathname,c)==null}if(nr){Ft?t.location.replace(Rt):t.location.assign(Rt);return}}F=null;let Nt=Ft===!0||Ae.response.headers.has("X-Remix-Replace")?"REPLACE":"PUSH",{formMethod:kt,formAction:Et,formEncType:Bt}=D.navigation;!Ve&&!ot&&kt&&Et&&Bt&&(Ve=CN(D.navigation));let Tn=Ve||ot;if(zH.has(Ae.response.status)&&Tn&&La(Tn.formMethod))await me(Nt,jt,{submission:{...Tn,formAction:Rt},preventScrollReset:It||L,enableViewTransition:Ie?B:void 0});else{let nr=ZC(jt,Ve);await me(Nt,jt,{overrideNavigation:nr,fetcherSubmission:ot,preventScrollReset:It||L,enableViewTransition:Ie?B:void 0})}}async function qt(he,Ae,Ie,Ve){let ot,It={};try{ot=await ZH(u,he,Ae,Ve,Ie,!1)}catch(Ft){return Ae.filter(Rt=>Rt.shouldLoad).forEach(Rt=>{It[Rt.route.id]={type:"error",error:Ft}}),It}if(he.signal.aborted)return It;for(let[Ft,Rt]of Object.entries(ot))if(sU(Rt)){let jt=Rt.result;It[Ft]={type:"redirect",response:nU(jt,he,Ft,Ae,c)}}else It[Ft]=await tU(Rt);return It}async function Vt(he,Ae,Ie,Ve){let ot=qt(Ie,he,Ve,null),It=Promise.all(Ae.map(async jt=>{if(jt.matches&&jt.match&&jt.request&&jt.controller){let kt=(await qt(jt.request,jt.matches,Ve,jt.key))[jt.match.route.id];return{[jt.key]:kt}}else return Promise.resolve({[jt.key]:{type:"error",error:Wi(404,{pathname:jt.path})}})})),Ft=await ot,Rt=(await It).reduce((jt,Nt)=>Object.assign(jt,Nt),{});return{loaderResults:Ft,fetcherResults:Rt}}function Mt(){j=!0,Z.forEach((he,Ae)=>{z.has(Ae)&&V.add(Ae),$e(Ae)})}function ke(he,Ae,Ie={}){D.fetchers.set(he,Ae),xe({fetchers:new Map(D.fetchers)},{flushSync:(Ie&&Ie.flushSync)===!0})}function Ne(he,Ae,Ie,Ve={}){let ot=uu(D.matches,Ae);St(he),xe({errors:{[ot.route.id]:Ie},fetchers:new Map(D.fetchers)},{flushSync:(Ve&&Ve.flushSync)===!0})}function lt(he){return J.set(he,(J.get(he)||0)+1),W.has(he)&&W.delete(he),D.fetchers.get(he)||HH}function St(he){let Ae=D.fetchers.get(he);z.has(he)&&!(Ae&&Ae.state==="loading"&&te.has(he))&&$e(he),Z.delete(he),te.delete(he),_.delete(he),W.delete(he),V.delete(he),D.fetchers.delete(he)}function ft(he){let Ae=(J.get(he)||0)-1;Ae<=0?(J.delete(he),W.add(he)):J.set(he,Ae),xe({fetchers:new Map(D.fetchers)})}function $e(he){let Ae=z.get(he);Ae&&(Ae.abort(),z.delete(he))}function Ht(he){for(let Ae of he){let Ie=lt(Ae),Ve=iu(Ie.data);D.fetchers.set(Ae,Ve)}}function $t(){let he=[],Ae=!1;for(let Ie of _){let Ve=D.fetchers.get(Ie);qn(Ve,`Expected fetcher: ${Ie}`),Ve.state==="loading"&&(_.delete(Ie),he.push(Ie),Ae=!0)}return Ht(he),Ae}function pt(he){let Ae=[];for(let[Ie,Ve]of te)if(Ve<he){let ot=D.fetchers.get(Ie);qn(ot,`Expected fetcher: ${Ie}`),ot.state==="loading"&&($e(Ie),te.delete(Ie),Ae.push(Ie))}return Ht(Ae),Ae.length>0}function Te(he,Ae){let Ie=D.blockers.get(he)||_m;return re.get(he)!==Ae&&re.set(he,Ae),Ie}function Ue(he){D.blockers.delete(he),re.delete(he)}function yt(he,Ae){let Ie=D.blockers.get(he)||_m;qn(Ie.state==="unblocked"&&Ae.state==="blocked"||Ie.state==="blocked"&&Ae.state==="blocked"||Ie.state==="blocked"&&Ae.state==="proceeding"||Ie.state==="blocked"&&Ae.state==="unblocked"||Ie.state==="proceeding"&&Ae.state==="unblocked",`Invalid blocker state transition: ${Ie.state} -> ${Ae.state}`);let Ve=new Map(D.blockers);Ve.set(he,Ae),xe({blockers:Ve})}function ht({currentLocation:he,nextLocation:Ae,historyAction:Ie}){if(re.size===0)return;re.size>1&&vo(!1,"A router only supports one blocker at a time");let Ve=Array.from(re.entries()),[ot,It]=Ve[Ve.length-1],Ft=D.blockers.get(ot);if(!(Ft&&Ft.state==="proceeding")&&It({currentLocation:he,nextLocation:Ae,historyAction:Ie}))return ot}function Cn(he){let Ae=Wi(404,{pathname:he}),Ie=s||i,{matches:Ve,route:ot}=t0(Ie);return{notFoundMatches:Ve,route:ot,error:Ae}}function On(he,Ae,Ie){if(g=he,x=Ae,b=Ie||null,!E&&D.navigation===XC){E=!0;let Ve=Gn(D.location,D.matches);Ve!=null&&xe({restoreScrollPosition:Ve})}return()=>{g=null,x=null,b=null}}function In(he,Ae){return b&&b(he,Ae.map(Ve=>bH(Ve,D.loaderData)))||he.key}function pn(he,Ae){if(g&&x){let Ie=In(he,Ae);g[Ie]=x()}}function Gn(he,Ae){if(g){let Ie=In(he,Ae),Ve=g[Ie];if(typeof Ve=="number")return Ve}return null}function Hn(he,Ae,Ie){if(e.patchRoutesOnNavigation)if(he){if(Object.keys(he[0].params).length>0)return{active:!0,matches:B0(Ae,Ie,c,!0)}}else return{active:!0,matches:B0(Ae,Ie,c,!0)||[]};return{active:!1,matches:null}}async function wn(he,Ae,Ie,Ve){if(!e.patchRoutesOnNavigation)return{type:"success",matches:he};let ot=he;for(;;){let It=s==null,Ft=s||i,Rt=a;try{await e.patchRoutesOnNavigation({signal:Ie,path:Ae,matches:ot,fetcherKey:Ve,patch:(kt,Et)=>{Ie.aborted||pN(kt,Et,Ft,Rt,o,!1)}})}catch(kt){return{type:"error",error:kt,partialMatches:ot}}finally{It&&!Ie.aborted&&(i=[...i])}if(Ie.aborted)return{type:"aborted"};let jt=cu(Ft,Ae,c);if(jt)return{type:"success",matches:jt};let Nt=B0(Ft,Ae,c,!0);if(!Nt||ot.length===Nt.length&&ot.every((kt,Et)=>kt.route.id===Nt[Et].route.id))return{type:"success",matches:null};ot=Nt}}function or(he){a={},s=vy(he,o,void 0,a)}function Wt(he,Ae,Ie=!1){let Ve=s==null;pN(he,Ae,s||i,a,o,Ie),Ve&&(i=[...i],xe({}))}return M={get basename(){return c},get future(){return f},get state(){return D},get routes(){return i},get window(){return t},initialize:ie,subscribe:fe,enableScrollRestoration:On,navigate:Re,fetch:dt,revalidate:de,createHref:he=>e.history.createHref(he),encodeLocation:he=>e.history.encodeLocation(he),getFetcher:lt,deleteFetcher:ft,dispose:ae,getBlocker:Te,deleteBlocker:Ue,patchRoutes:Wt,_internalFetchControllers:z,_internalSetRoutes:or,_internalSetStateDoNotUseOrYouWillBreakYourApp(he){xe(he)}},M}function qH(e){return e!=null&&("formData"in e&&e.formData!=null||"body"in e&&e.body!==void 0)}function xw(e,t,n,r,o,a){let i,s;if(o){i=[];for(let u of t)if(i.push(u),u.route.id===o){s=u;break}}else i=t,s=t[t.length-1];let c=mx(r||".",hx(i),os(e.pathname,n)||e.pathname,a==="path");if(r==null&&(c.search=e.search,c.hash=e.hash),(r==null||r===""||r===".")&&s){let u=v2(c.search);if(s.route.index&&!u)c.search=c.search?c.search.replace(/^\?/,"?index&"):"?index";else if(!s.route.index&&u){let f=new URLSearchParams(c.search),p=f.getAll("index");f.delete("index"),p.filter(g=>g).forEach(g=>f.append("index",g));let y=f.toString();c.search=y?`?${y}`:""}}return n!=="/"&&(c.pathname=MH({basename:n,pathname:c.pathname})),Tu(c)}function dN(e,t,n){if(!n||!qH(n))return{path:t};if(n.formMethod&&!lU(n.formMethod))return{path:t,error:Wi(405,{method:n.formMethod})};let r=()=>({path:t,error:Wi(400,{type:"invalid-body"})}),a=(n.formMethod||"get").toUpperCase(),i=I4(t);if(n.body!==void 0){if(n.formEncType==="text/plain"){if(!La(a))return r();let p=typeof n.body=="string"?n.body:n.body instanceof FormData||n.body instanceof URLSearchParams?Array.from(n.body.entries()).reduce((y,[g,b])=>`${y}${g}=${b}
60
- `,""):String(n.body);return{path:t,submission:{formMethod:a,formAction:i,formEncType:n.formEncType,formData:void 0,json:void 0,text:p}}}else if(n.formEncType==="application/json"){if(!La(a))return r();try{let p=typeof n.body=="string"?JSON.parse(n.body):n.body;return{path:t,submission:{formMethod:a,formAction:i,formEncType:n.formEncType,formData:void 0,json:p,text:void 0}}}catch{return r()}}}qn(typeof FormData=="function","FormData is not available in this environment");let s,c;if(n.formData)s=Cw(n.formData),c=n.formData;else if(n.body instanceof FormData)s=Cw(n.body),c=n.body;else if(n.body instanceof URLSearchParams)s=n.body,c=bN(s);else if(n.body==null)s=new URLSearchParams,c=new FormData;else try{s=new URLSearchParams(n.body),c=bN(s)}catch{return r()}let u={formMethod:a,formAction:i,formEncType:n&&n.formEncType||"application/x-www-form-urlencoded",formData:c,json:void 0,text:void 0};if(La(u.formMethod))return{path:t,submission:u};let f=Ru(t);return e&&f.search&&v2(f.search)&&s.append("index",""),f.search=`?${s}`,{path:Tu(f),submission:u}}function fN(e,t,n,r,o,a,i,s,c,u,f,p,y,g,b,x,E,S,w,C){let R=C?ui(C[1])?C[1].error:C[1].data:void 0,M=o.createURL(a.location),D=o.createURL(c),I;if(f&&a.errors){let $=Object.keys(a.errors)[0];I=i.findIndex(j=>j.route.id===$)}else if(C&&ui(C[1])){let $=C[0];I=i.findIndex(j=>j.route.id===$)-1}let L=C?C[1].statusCode:void 0,F=L&&L>=400,B={currentUrl:M,currentParams:a.matches[0]?.params||{},nextUrl:D,nextParams:i[0].params,...s,actionResult:R,actionStatus:L},U=i.map(($,j)=>{let{route:V}=$,z=null;if(I!=null&&j>I?z=!1:V.lazy?z=!0:V.loader==null?z=!1:f?z=Sw(V,a.loaderData,a.errors):GH(a.loaderData,a.matches[j],$)&&(z=!0),z!==null)return Ew(n,r,e,$,u,t,z);let K=F?!1:p||M.pathname+M.search===D.pathname+D.search||M.search!==D.search||YH(a.matches[j],$),Y={...B,defaultShouldRevalidate:K},te=x1($,Y);return Ew(n,r,e,$,u,t,te,Y)}),k=[];return b.forEach(($,j)=>{if(f||!i.some(J=>J.route.id===$.routeId)||g.has(j))return;let V=a.fetchers.get(j),z=V&&V.state!=="idle"&&V.data===void 0,K=cu(E,$.path,S);if(!K){if(w&&z)return;k.push({key:j,routeId:$.routeId,path:$.path,matches:null,match:null,request:null,controller:null});return}if(x.has(j))return;let Y=$0(K,$.path),te=new AbortController,_=fp(o,$.path,te.signal),Z=null;if(y.has(j))y.delete(j),Z=xp(n,r,_,K,Y,u,t);else if(z)p&&(Z=xp(n,r,_,K,Y,u,t));else{let J={...B,defaultShouldRevalidate:F?!1:p};x1(Y,J)&&(Z=xp(n,r,_,K,Y,u,t,J))}Z&&k.push({key:j,routeId:$.routeId,path:$.path,matches:Z,match:Y,request:_,controller:te})}),{dsMatches:U,revalidatingFetchers:k}}function Sw(e,t,n){if(e.lazy)return!0;if(!e.loader)return!1;let r=t!=null&&e.id in t,o=n!=null&&n[e.id]!==void 0;return!r&&o?!1:typeof e.loader=="function"&&e.loader.hydrate===!0?!0:!r&&!o}function GH(e,t,n){let r=!t||n.route.id!==t.route.id,o=!e.hasOwnProperty(n.route.id);return r||o}function YH(e,t){let n=e.route.path;return e.pathname!==t.pathname||n!=null&&n.endsWith("*")&&e.params["*"]!==t.params["*"]}function x1(e,t){if(e.route.shouldRevalidate){let n=e.route.shouldRevalidate(t);if(typeof n=="boolean")return n}return t.defaultShouldRevalidate}function pN(e,t,n,r,o,a){let i;if(e){let u=r[e];qn(u,`No route found to patch children into: routeId = ${e}`),u.children||(u.children=[]),i=u.children}else i=n;let s=[],c=[];if(t.forEach(u=>{let f=i.find(p=>O4(u,p));f?c.push({existingRoute:f,newRoute:u}):s.push(u)}),s.length>0){let u=vy(s,o,[e||"_","patch",String(i?.length||"0")],r);i.push(...u)}if(a&&c.length>0)for(let u=0;u<c.length;u++){let{existingRoute:f,newRoute:p}=c[u],y=f,[g]=vy([p],o,[],{},!0);Object.assign(y,{element:g.element?g.element:y.element,errorElement:g.errorElement?g.errorElement:y.errorElement,hydrateFallbackElement:g.hydrateFallbackElement?g.hydrateFallbackElement:y.hydrateFallbackElement})}}function O4(e,t){return"id"in e&&"id"in t&&e.id===t.id?!0:e.index===t.index&&e.path===t.path&&e.caseSensitive===t.caseSensitive?(!e.children||e.children.length===0)&&(!t.children||t.children.length===0)?!0:e.children.every((n,r)=>t.children?.some(o=>O4(n,o))):!1}var hN=new WeakMap,R4=({key:e,route:t,manifest:n,mapRouteProperties:r})=>{let o=n[t.id];if(qn(o,"No route found in manifest"),!o.lazy||typeof o.lazy!="object")return;let a=o.lazy[e];if(!a)return;let i=hN.get(o);i||(i={},hN.set(o,i));let s=i[e];if(s)return s;let c=(async()=>{let u=hH(e),p=o[e]!==void 0&&e!=="hasErrorBoundary";if(u)vo(!u,"Route property "+e+" is not a supported lazy route property. This property will be ignored."),i[e]=Promise.resolve();else if(p)vo(!1,`Route "${o.id}" has a static property "${e}" defined. The lazy property will be ignored.`);else{let y=await a();y!=null&&(Object.assign(o,{[e]:y}),Object.assign(o,r(o)))}typeof o.lazy=="object"&&(o.lazy[e]=void 0,Object.values(o.lazy).every(y=>y===void 0)&&(o.lazy=void 0))})();return i[e]=c,c},mN=new WeakMap;function KH(e,t,n,r,o){let a=n[e.id];if(qn(a,"No route found in manifest"),!e.lazy)return{lazyRoutePromise:void 0,lazyHandlerPromise:void 0};if(typeof e.lazy=="function"){let f=mN.get(a);if(f)return{lazyRoutePromise:f,lazyHandlerPromise:f};let p=(async()=>{qn(typeof e.lazy=="function","No lazy route function found");let y=await e.lazy(),g={};for(let b in y){let x=y[b];if(x===void 0)continue;let E=gH(b),w=a[b]!==void 0&&b!=="hasErrorBoundary";E?vo(!E,"Route property "+b+" is not a supported property to be returned from a lazy route function. This property will be ignored."):w?vo(!w,`Route "${a.id}" has a static property "${b}" defined but its lazy function is also returning a value for this property. The lazy route property "${b}" will be ignored.`):g[b]=x}Object.assign(a,g),Object.assign(a,{...r(a),lazy:void 0})})();return mN.set(a,p),p.catch(()=>{}),{lazyRoutePromise:p,lazyHandlerPromise:p}}let i=Object.keys(e.lazy),s=[],c;for(let f of i){if(o&&o.includes(f))continue;let p=R4({key:f,route:e,manifest:n,mapRouteProperties:r});p&&(s.push(p),f===t&&(c=p))}let u=s.length>0?Promise.all(s).then(()=>{}):void 0;return u?.catch(()=>{}),c?.catch(()=>{}),{lazyRoutePromise:u,lazyHandlerPromise:c}}async function gN(e){let t=e.matches.filter(o=>o.shouldLoad),n={};return(await Promise.all(t.map(o=>o.resolve()))).forEach((o,a)=>{n[t[a].route.id]=o}),n}async function QH(e){return e.matches.some(t=>t.route.middleware)?M4(e,()=>gN(e)):gN(e)}function M4(e,t){return XH(e,t,r=>r,aU,n);function n(r,o,a){if(a)return Promise.resolve(Object.assign(a.value,{[o]:{type:"error",result:r}}));{let{matches:i}=e,s=Math.min(i.findIndex(u=>u.route.id===o)||0,i.findIndex(u=>u.unstable_shouldCallHandler())||0),c=uu(i,i[s].route.id).route.id;return Promise.resolve({[c]:{type:"error",result:r}})}}}async function XH(e,t,n,r,o){let{matches:a,request:i,params:s,context:c}=e,u=a.flatMap(p=>p.route.middleware?p.route.middleware.map(y=>[p.route.id,y]):[]);return await N4({request:i,params:s,context:c},u,t,n,r,o)}async function N4(e,t,n,r,o,a,i=0){let{request:s}=e;if(s.signal.aborted)throw s.signal.reason??new Error(`Request aborted: ${s.method} ${s.url}`);let c=t[i];if(!c)return await n();let[u,f]=c,p,y=async()=>{if(p)throw new Error("You may only call `next()` once per middleware");try{return p={value:await N4(e,t,n,r,o,a,i+1)},p.value}catch(g){return p={value:await a(g,u,p)},p.value}};try{let g=await f(e,y),b=g!=null?r(g):void 0;return o(b)?b:p?b??p.value:(p={value:await y()},p.value)}catch(g){return await a(g,u,p)}}function P4(e,t,n,r,o){let a=R4({key:"middleware",route:r.route,manifest:t,mapRouteProperties:e}),i=KH(r.route,La(n.method)?"action":"loader",t,e,o);return{middleware:a,route:i.lazyRoutePromise,handler:i.lazyHandlerPromise}}function Ew(e,t,n,r,o,a,i,s=null){let c=!1,u=P4(e,t,n,r,o);return{...r,_lazyPromises:u,shouldLoad:i,unstable_shouldRevalidateArgs:s,unstable_shouldCallHandler(f){return c=!0,s?typeof f=="boolean"?x1(r,{...s,defaultShouldRevalidate:f}):x1(r,s):i},resolve(f){return c||i||f&&!La(n.method)&&(r.route.lazy||r.route.loader)?JH({request:n,match:r,lazyHandlerPromise:u?.handler,lazyRoutePromise:u?.route,handlerOverride:f,scopedContext:a}):Promise.resolve({type:"data",result:void 0})}}}function xp(e,t,n,r,o,a,i,s=null){return r.map(c=>c.route.id!==o.route.id?{...c,shouldLoad:!1,unstable_shouldRevalidateArgs:s,unstable_shouldCallHandler:()=>!1,_lazyPromises:P4(e,t,n,c,a),resolve:()=>Promise.resolve({type:"data",result:void 0})}:Ew(e,t,n,c,a,i,!0,s))}async function ZH(e,t,n,r,o,a){n.some(u=>u._lazyPromises?.middleware)&&await Promise.all(n.map(u=>u._lazyPromises?.middleware));let i={request:t,params:n[0].params,context:o,matches:n},c=await e({...i,fetcherKey:r,runClientMiddleware:u=>{let f=i;return M4(f,()=>u({...f,fetcherKey:r,runClientMiddleware:()=>{throw new Error("Cannot call `runClientMiddleware()` from within an `runClientMiddleware` handler")}}))}});try{await Promise.all(n.flatMap(u=>[u._lazyPromises?.handler,u._lazyPromises?.route]))}catch{}return c}async function JH({request:e,match:t,lazyHandlerPromise:n,lazyRoutePromise:r,handlerOverride:o,scopedContext:a}){let i,s,c=La(e.method),u=c?"action":"loader",f=p=>{let y,g=new Promise((E,S)=>y=S);s=()=>y(),e.signal.addEventListener("abort",s);let b=E=>typeof p!="function"?Promise.reject(new Error(`You cannot call the handler for a route which defines a boolean "${u}" [routeId: ${t.route.id}]`)):p({request:e,params:t.params,context:a},...E!==void 0?[E]:[]),x=(async()=>{try{return{type:"data",result:await(o?o(S=>b(S)):b())}}catch(E){return{type:"error",result:E}}})();return Promise.race([x,g])};try{let p=c?t.route.action:t.route.loader;if(n||r)if(p){let y,[g]=await Promise.all([f(p).catch(b=>{y=b}),n,r]);if(y!==void 0)throw y;i=g}else{await n;let y=c?t.route.action:t.route.loader;if(y)[i]=await Promise.all([f(y),r]);else if(u==="action"){let g=new URL(e.url),b=g.pathname+g.search;throw Wi(405,{method:e.method,pathname:b,routeId:t.route.id})}else return{type:"data",result:void 0}}else if(p)i=await f(p);else{let y=new URL(e.url),g=y.pathname+y.search;throw Wi(404,{pathname:g})}}catch(p){return{type:"error",result:p}}finally{s&&e.signal.removeEventListener("abort",s)}return i}async function eU(e){let t=e.headers.get("Content-Type");return t&&/\bapplication\/json\b/.test(t)?e.body==null?null:e.json():e.text()}async function tU(e){let{result:t,type:n}=e;if(_4(t)){let r;try{r=await eU(t)}catch(o){return{type:"error",error:o}}return n==="error"?{type:"error",error:new v1(t.status,t.statusText,r),statusCode:t.status,headers:t.headers}:{type:"data",data:r,statusCode:t.status,headers:t.headers}}return n==="error"?EN(t)?t.data instanceof Error?{type:"error",error:t.data,statusCode:t.init?.status,headers:t.init?.headers?new Headers(t.init.headers):void 0}:{type:"error",error:new v1(t.init?.status||500,void 0,t.data),statusCode:xy(t)?t.status:void 0,headers:t.init?.headers?new Headers(t.init.headers):void 0}:{type:"error",error:t,statusCode:xy(t)?t.status:void 0}:EN(t)?{type:"data",data:t.data,statusCode:t.init?.status,headers:t.init?.headers?new Headers(t.init.headers):void 0}:{type:"data",data:t}}function nU(e,t,n,r,o){let a=e.headers.get("Location");if(qn(a,"Redirects returned/thrown from loaders/actions must have a Location header"),!b2(a)){let i=r.slice(0,r.findIndex(s=>s.route.id===n)+1);a=xw(new URL(t.url),i,o,a),e.headers.set("Location",a)}return e}function yN(e,t,n){if(b2(e)){let r=e,o=r.startsWith("//")?new URL(t.protocol+r):new URL(r),a=os(o.pathname,n)!=null;if(o.origin===t.origin&&a)return o.pathname+o.search+o.hash}return e}function fp(e,t,n,r){let o=e.createURL(I4(t)).toString(),a={signal:n};if(r&&La(r.formMethod)){let{formMethod:i,formEncType:s}=r;a.method=i.toUpperCase(),s==="application/json"?(a.headers=new Headers({"Content-Type":s}),a.body=JSON.stringify(r.json)):s==="text/plain"?a.body=r.text:s==="application/x-www-form-urlencoded"&&r.formData?a.body=Cw(r.formData):a.body=r.formData}return new Request(o,a)}function Cw(e){let t=new URLSearchParams;for(let[n,r]of e.entries())t.append(n,typeof r=="string"?r:r.name);return t}function bN(e){let t=new FormData;for(let[n,r]of e.entries())t.append(n,r);return t}function rU(e,t,n,r=!1,o=!1){let a={},i=null,s,c=!1,u={},f=n&&ui(n[1])?n[1].error:void 0;return e.forEach(p=>{if(!(p.route.id in t))return;let y=p.route.id,g=t[y];if(qn(!bd(g),"Cannot handle redirect results in processLoaderData"),ui(g)){let b=g.error;if(f!==void 0&&(b=f,f=void 0),i=i||{},o)i[y]=b;else{let x=uu(e,y);i[x.route.id]==null&&(i[x.route.id]=b)}r||(a[y]=D4),c||(c=!0,s=xy(g.error)?g.error.status:500),g.headers&&(u[y]=g.headers)}else a[y]=g.data,g.statusCode&&g.statusCode!==200&&!c&&(s=g.statusCode),g.headers&&(u[y]=g.headers)}),f!==void 0&&n&&(i={[n[0]]:f},n[2]&&(a[n[2]]=void 0)),{loaderData:a,errors:i,statusCode:s||200,loaderHeaders:u}}function vN(e,t,n,r,o,a){let{loaderData:i,errors:s}=rU(t,n,r);return o.filter(c=>!c.matches||c.matches.some(u=>u.shouldLoad)).forEach(c=>{let{key:u,match:f,controller:p}=c;if(p&&p.signal.aborted)return;let y=a[u];if(qn(y,"Did not find corresponding fetcher result"),ui(y)){let g=uu(e.matches,f?.route.id);s&&s[g.route.id]||(s={...s,[g.route.id]:y.error}),e.fetchers.delete(u)}else if(bd(y))qn(!1,"Unhandled fetcher revalidation redirect");else{let g=iu(y.data);e.fetchers.set(u,g)}}),{loaderData:i,errors:s}}function xN(e,t,n,r){let o=Object.entries(t).filter(([,a])=>a!==D4).reduce((a,[i,s])=>(a[i]=s,a),{});for(let a of n){let i=a.route.id;if(!t.hasOwnProperty(i)&&e.hasOwnProperty(i)&&a.route.loader&&(o[i]=e[i]),r&&r.hasOwnProperty(i))break}return o}function SN(e){return e?ui(e[1])?{actionData:{}}:{actionData:{[e[0]]:e[1].data}}:{}}function uu(e,t){return(t?e.slice(0,e.findIndex(r=>r.route.id===t)+1):[...e]).reverse().find(r=>r.route.hasErrorBoundary===!0)||e[0]}function t0(e){let t=e.length===1?e[0]:e.find(n=>n.index||!n.path||n.path==="/")||{id:"__shim-error-route__"};return{matches:[{params:{},pathname:"",pathnameBase:"",route:t}],route:t}}function Wi(e,{pathname:t,routeId:n,method:r,type:o,message:a}={}){let i="Unknown Server Error",s="Unknown @remix-run/router error";return e===400?(i="Bad Request",r&&t&&n?s=`You made a ${r} request to "${t}" but did not provide a \`loader\` for route "${n}", so there is no way to handle the request.`:o==="invalid-body"&&(s="Unable to encode submission body")):e===403?(i="Forbidden",s=`Route "${n}" does not match URL "${t}"`):e===404?(i="Not Found",s=`No route matches URL "${t}"`):e===405&&(i="Method Not Allowed",r&&t&&n?s=`You made a ${r.toUpperCase()} request to "${t}" but did not provide an \`action\` for route "${n}", so there is no way to handle the request.`:r&&(s=`Invalid request method "${r.toUpperCase()}"`)),new v1(e||500,i,new Error(s),!0)}function n0(e){let t=Object.entries(e);for(let n=t.length-1;n>=0;n--){let[r,o]=t[n];if(bd(o))return{key:r,result:o}}}function I4(e){let t=typeof e=="string"?Ru(e):e;return Tu({...t,hash:""})}function oU(e,t){return e.pathname!==t.pathname||e.search!==t.search?!1:e.hash===""?t.hash!=="":e.hash===t.hash?!0:t.hash!==""}function aU(e){return e!=null&&typeof e=="object"&&Object.entries(e).every(([t,n])=>typeof t=="string"&&iU(n))}function iU(e){return e!=null&&typeof e=="object"&&"type"in e&&"result"in e&&(e.type==="data"||e.type==="error")}function sU(e){return _4(e.result)&&$H.has(e.result.status)}function ui(e){return e.type==="error"}function bd(e){return(e&&e.type)==="redirect"}function EN(e){return typeof e=="object"&&e!=null&&"type"in e&&"data"in e&&"init"in e&&e.type==="DataWithResponseInit"}function _4(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.headers=="object"&&typeof e.body<"u"}function lU(e){return BH.has(e.toUpperCase())}function La(e){return FH.has(e.toUpperCase())}function v2(e){return new URLSearchParams(e).getAll("index").some(t=>t==="")}function $0(e,t){let n=typeof t=="string"?Ru(t).search:t.search;if(e[e.length-1].route.index&&v2(n||""))return e[e.length-1];let r=w4(e);return r[r.length-1]}function CN(e){let{formMethod:t,formAction:n,formEncType:r,text:o,formData:a,json:i}=e;if(!(!t||!n||!r)){if(o!=null)return{formMethod:t,formAction:n,formEncType:r,formData:void 0,json:void 0,text:o};if(a!=null)return{formMethod:t,formAction:n,formEncType:r,formData:a,json:void 0,text:void 0};if(i!==void 0)return{formMethod:t,formAction:n,formEncType:r,formData:void 0,json:i,text:void 0}}}function ZC(e,t){return t?{state:"loading",location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text}:{state:"loading",location:e,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0}}function cU(e,t){return{state:"submitting",location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text}}function Lm(e,t){return e?{state:"loading",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t}:{state:"loading",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:t}}function uU(e,t){return{state:"submitting",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t?t.data:void 0}}function iu(e){return{state:"idle",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:e}}function dU(e,t){try{let n=e.sessionStorage.getItem(A4);if(n){let r=JSON.parse(n);for(let[o,a]of Object.entries(r||{}))a&&Array.isArray(a)&&t.set(o,new Set(a||[]))}}catch{}}function fU(e,t){if(t.size>0){let n={};for(let[r,o]of t)n[r]=[...o];try{e.sessionStorage.setItem(A4,JSON.stringify(n))}catch(r){vo(!1,`Failed to save applied view transitions in sessionStorage (${r}).`)}}}function pU(){let e,t,n=new Promise((r,o)=>{e=async a=>{r(a);try{await n}catch{}},t=async a=>{o(a);try{await n}catch{}}});return{promise:n,resolve:e,reject:t}}var Kd=T.createContext(null);Kd.displayName="DataRouter";var Xy=T.createContext(null);Xy.displayName="DataRouterState";T.createContext(!1);var x2=T.createContext({isTransitioning:!1});x2.displayName="ViewTransition";var L4=T.createContext(new Map);L4.displayName="Fetchers";var hU=T.createContext(null);hU.displayName="Await";var Ps=T.createContext(null);Ps.displayName="Navigation";var gx=T.createContext(null);gx.displayName="Location";var us=T.createContext({outlet:null,matches:[],isDataRoute:!1});us.displayName="Route";var S2=T.createContext(null);S2.displayName="RouteError";function mU(e,{relative:t}={}){qn(rh(),"useHref() may be used only in the context of a <Router> component.");let{basename:n,navigator:r}=T.useContext(Ps),{hash:o,pathname:a,search:i}=Zy(e,{relative:t}),s=a;return n!=="/"&&(s=a==="/"?n:ul([n,a])),r.createHref({pathname:s,search:i,hash:o})}function rh(){return T.useContext(gx)!=null}function Mu(){return qn(rh(),"useLocation() may be used only in the context of a <Router> component."),T.useContext(gx).location}var F4="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function j4(e){T.useContext(Ps).static||T.useLayoutEffect(e)}function E2(){let{isDataRoute:e}=T.useContext(us);return e?RU():gU()}function gU(){qn(rh(),"useNavigate() may be used only in the context of a <Router> component.");let e=T.useContext(Kd),{basename:t,navigator:n}=T.useContext(Ps),{matches:r}=T.useContext(us),{pathname:o}=Mu(),a=JSON.stringify(hx(r)),i=T.useRef(!1);return j4(()=>{i.current=!0}),T.useCallback((c,u={})=>{if(vo(i.current,F4),!i.current)return;if(typeof c=="number"){n.go(c);return}let f=mx(c,JSON.parse(a),o,u.relative==="path");e==null&&t!=="/"&&(f.pathname=f.pathname==="/"?t:ul([t,f.pathname])),(u.replace?n.replace:n.push)(f,u.state,u)},[t,n,a,o,e])}var yU=T.createContext(null);function bU(e){let t=T.useContext(us).outlet;return t&&T.createElement(yU.Provider,{value:e},t)}function _Pe(){let{matches:e}=T.useContext(us),t=e[e.length-1];return t?t.params:{}}function Zy(e,{relative:t}={}){let{matches:n}=T.useContext(us),{pathname:r}=Mu(),o=JSON.stringify(hx(n));return T.useMemo(()=>mx(e,JSON.parse(o),r,t==="path"),[e,o,r,t])}function vU(e,t,n,r,o){qn(rh(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:a}=T.useContext(Ps),{matches:i}=T.useContext(us),s=i[i.length-1],c=s?s.params:{},u=s?s.pathname:"/",f=s?s.pathnameBase:"/",p=s&&s.route;{let w=p&&p.path||"";B4(u,!p||w.endsWith("*")||w.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${u}" (under <Route path="${w}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
60
+ `,""):String(n.body);return{path:t,submission:{formMethod:a,formAction:i,formEncType:n.formEncType,formData:void 0,json:void 0,text:p}}}else if(n.formEncType==="application/json"){if(!La(a))return r();try{let p=typeof n.body=="string"?JSON.parse(n.body):n.body;return{path:t,submission:{formMethod:a,formAction:i,formEncType:n.formEncType,formData:void 0,json:p,text:void 0}}}catch{return r()}}}qn(typeof FormData=="function","FormData is not available in this environment");let s,c;if(n.formData)s=Cw(n.formData),c=n.formData;else if(n.body instanceof FormData)s=Cw(n.body),c=n.body;else if(n.body instanceof URLSearchParams)s=n.body,c=bN(s);else if(n.body==null)s=new URLSearchParams,c=new FormData;else try{s=new URLSearchParams(n.body),c=bN(s)}catch{return r()}let u={formMethod:a,formAction:i,formEncType:n&&n.formEncType||"application/x-www-form-urlencoded",formData:c,json:void 0,text:void 0};if(La(u.formMethod))return{path:t,submission:u};let f=Ru(t);return e&&f.search&&v2(f.search)&&s.append("index",""),f.search=`?${s}`,{path:Tu(f),submission:u}}function fN(e,t,n,r,o,a,i,s,c,u,f,p,y,g,b,x,E,S,w,C){let R=C?ui(C[1])?C[1].error:C[1].data:void 0,M=o.createURL(a.location),D=o.createURL(c),I;if(f&&a.errors){let $=Object.keys(a.errors)[0];I=i.findIndex(j=>j.route.id===$)}else if(C&&ui(C[1])){let $=C[0];I=i.findIndex(j=>j.route.id===$)-1}let L=C?C[1].statusCode:void 0,F=L&&L>=400,B={currentUrl:M,currentParams:a.matches[0]?.params||{},nextUrl:D,nextParams:i[0].params,...s,actionResult:R,actionStatus:L},U=i.map(($,j)=>{let{route:V}=$,z=null;if(I!=null&&j>I?z=!1:V.lazy?z=!0:V.loader==null?z=!1:f?z=Sw(V,a.loaderData,a.errors):GH(a.loaderData,a.matches[j],$)&&(z=!0),z!==null)return Ew(n,r,e,$,u,t,z);let K=F?!1:p||M.pathname+M.search===D.pathname+D.search||M.search!==D.search||YH(a.matches[j],$),Y={...B,defaultShouldRevalidate:K},te=x1($,Y);return Ew(n,r,e,$,u,t,te,Y)}),k=[];return b.forEach(($,j)=>{if(f||!i.some(J=>J.route.id===$.routeId)||g.has(j))return;let V=a.fetchers.get(j),z=V&&V.state!=="idle"&&V.data===void 0,K=cu(E,$.path,S);if(!K){if(w&&z)return;k.push({key:j,routeId:$.routeId,path:$.path,matches:null,match:null,request:null,controller:null});return}if(x.has(j))return;let Y=$0(K,$.path),te=new AbortController,_=fp(o,$.path,te.signal),Z=null;if(y.has(j))y.delete(j),Z=xp(n,r,_,K,Y,u,t);else if(z)p&&(Z=xp(n,r,_,K,Y,u,t));else{let J={...B,defaultShouldRevalidate:F?!1:p};x1(Y,J)&&(Z=xp(n,r,_,K,Y,u,t,J))}Z&&k.push({key:j,routeId:$.routeId,path:$.path,matches:Z,match:Y,request:_,controller:te})}),{dsMatches:U,revalidatingFetchers:k}}function Sw(e,t,n){if(e.lazy)return!0;if(!e.loader)return!1;let r=t!=null&&e.id in t,o=n!=null&&n[e.id]!==void 0;return!r&&o?!1:typeof e.loader=="function"&&e.loader.hydrate===!0?!0:!r&&!o}function GH(e,t,n){let r=!t||n.route.id!==t.route.id,o=!e.hasOwnProperty(n.route.id);return r||o}function YH(e,t){let n=e.route.path;return e.pathname!==t.pathname||n!=null&&n.endsWith("*")&&e.params["*"]!==t.params["*"]}function x1(e,t){if(e.route.shouldRevalidate){let n=e.route.shouldRevalidate(t);if(typeof n=="boolean")return n}return t.defaultShouldRevalidate}function pN(e,t,n,r,o,a){let i;if(e){let u=r[e];qn(u,`No route found to patch children into: routeId = ${e}`),u.children||(u.children=[]),i=u.children}else i=n;let s=[],c=[];if(t.forEach(u=>{let f=i.find(p=>O4(u,p));f?c.push({existingRoute:f,newRoute:u}):s.push(u)}),s.length>0){let u=vy(s,o,[e||"_","patch",String(i?.length||"0")],r);i.push(...u)}if(a&&c.length>0)for(let u=0;u<c.length;u++){let{existingRoute:f,newRoute:p}=c[u],y=f,[g]=vy([p],o,[],{},!0);Object.assign(y,{element:g.element?g.element:y.element,errorElement:g.errorElement?g.errorElement:y.errorElement,hydrateFallbackElement:g.hydrateFallbackElement?g.hydrateFallbackElement:y.hydrateFallbackElement})}}function O4(e,t){return"id"in e&&"id"in t&&e.id===t.id?!0:e.index===t.index&&e.path===t.path&&e.caseSensitive===t.caseSensitive?(!e.children||e.children.length===0)&&(!t.children||t.children.length===0)?!0:e.children.every((n,r)=>t.children?.some(o=>O4(n,o))):!1}var hN=new WeakMap,R4=({key:e,route:t,manifest:n,mapRouteProperties:r})=>{let o=n[t.id];if(qn(o,"No route found in manifest"),!o.lazy||typeof o.lazy!="object")return;let a=o.lazy[e];if(!a)return;let i=hN.get(o);i||(i={},hN.set(o,i));let s=i[e];if(s)return s;let c=(async()=>{let u=hH(e),p=o[e]!==void 0&&e!=="hasErrorBoundary";if(u)vo(!u,"Route property "+e+" is not a supported lazy route property. This property will be ignored."),i[e]=Promise.resolve();else if(p)vo(!1,`Route "${o.id}" has a static property "${e}" defined. The lazy property will be ignored.`);else{let y=await a();y!=null&&(Object.assign(o,{[e]:y}),Object.assign(o,r(o)))}typeof o.lazy=="object"&&(o.lazy[e]=void 0,Object.values(o.lazy).every(y=>y===void 0)&&(o.lazy=void 0))})();return i[e]=c,c},mN=new WeakMap;function KH(e,t,n,r,o){let a=n[e.id];if(qn(a,"No route found in manifest"),!e.lazy)return{lazyRoutePromise:void 0,lazyHandlerPromise:void 0};if(typeof e.lazy=="function"){let f=mN.get(a);if(f)return{lazyRoutePromise:f,lazyHandlerPromise:f};let p=(async()=>{qn(typeof e.lazy=="function","No lazy route function found");let y=await e.lazy(),g={};for(let b in y){let x=y[b];if(x===void 0)continue;let E=gH(b),w=a[b]!==void 0&&b!=="hasErrorBoundary";E?vo(!E,"Route property "+b+" is not a supported property to be returned from a lazy route function. This property will be ignored."):w?vo(!w,`Route "${a.id}" has a static property "${b}" defined but its lazy function is also returning a value for this property. The lazy route property "${b}" will be ignored.`):g[b]=x}Object.assign(a,g),Object.assign(a,{...r(a),lazy:void 0})})();return mN.set(a,p),p.catch(()=>{}),{lazyRoutePromise:p,lazyHandlerPromise:p}}let i=Object.keys(e.lazy),s=[],c;for(let f of i){if(o&&o.includes(f))continue;let p=R4({key:f,route:e,manifest:n,mapRouteProperties:r});p&&(s.push(p),f===t&&(c=p))}let u=s.length>0?Promise.all(s).then(()=>{}):void 0;return u?.catch(()=>{}),c?.catch(()=>{}),{lazyRoutePromise:u,lazyHandlerPromise:c}}async function gN(e){let t=e.matches.filter(o=>o.shouldLoad),n={};return(await Promise.all(t.map(o=>o.resolve()))).forEach((o,a)=>{n[t[a].route.id]=o}),n}async function QH(e){return e.matches.some(t=>t.route.middleware)?M4(e,()=>gN(e)):gN(e)}function M4(e,t){return XH(e,t,r=>r,aU,n);function n(r,o,a){if(a)return Promise.resolve(Object.assign(a.value,{[o]:{type:"error",result:r}}));{let{matches:i}=e,s=Math.min(i.findIndex(u=>u.route.id===o)||0,i.findIndex(u=>u.unstable_shouldCallHandler())||0),c=uu(i,i[s].route.id).route.id;return Promise.resolve({[c]:{type:"error",result:r}})}}}async function XH(e,t,n,r,o){let{matches:a,request:i,params:s,context:c}=e,u=a.flatMap(p=>p.route.middleware?p.route.middleware.map(y=>[p.route.id,y]):[]);return await N4({request:i,params:s,context:c},u,t,n,r,o)}async function N4(e,t,n,r,o,a,i=0){let{request:s}=e;if(s.signal.aborted)throw s.signal.reason??new Error(`Request aborted: ${s.method} ${s.url}`);let c=t[i];if(!c)return await n();let[u,f]=c,p,y=async()=>{if(p)throw new Error("You may only call `next()` once per middleware");try{return p={value:await N4(e,t,n,r,o,a,i+1)},p.value}catch(g){return p={value:await a(g,u,p)},p.value}};try{let g=await f(e,y),b=g!=null?r(g):void 0;return o(b)?b:p?b??p.value:(p={value:await y()},p.value)}catch(g){return await a(g,u,p)}}function P4(e,t,n,r,o){let a=R4({key:"middleware",route:r.route,manifest:t,mapRouteProperties:e}),i=KH(r.route,La(n.method)?"action":"loader",t,e,o);return{middleware:a,route:i.lazyRoutePromise,handler:i.lazyHandlerPromise}}function Ew(e,t,n,r,o,a,i,s=null){let c=!1,u=P4(e,t,n,r,o);return{...r,_lazyPromises:u,shouldLoad:i,unstable_shouldRevalidateArgs:s,unstable_shouldCallHandler(f){return c=!0,s?typeof f=="boolean"?x1(r,{...s,defaultShouldRevalidate:f}):x1(r,s):i},resolve(f){return c||i||f&&!La(n.method)&&(r.route.lazy||r.route.loader)?JH({request:n,match:r,lazyHandlerPromise:u?.handler,lazyRoutePromise:u?.route,handlerOverride:f,scopedContext:a}):Promise.resolve({type:"data",result:void 0})}}}function xp(e,t,n,r,o,a,i,s=null){return r.map(c=>c.route.id!==o.route.id?{...c,shouldLoad:!1,unstable_shouldRevalidateArgs:s,unstable_shouldCallHandler:()=>!1,_lazyPromises:P4(e,t,n,c,a),resolve:()=>Promise.resolve({type:"data",result:void 0})}:Ew(e,t,n,c,a,i,!0,s))}async function ZH(e,t,n,r,o,a){n.some(u=>u._lazyPromises?.middleware)&&await Promise.all(n.map(u=>u._lazyPromises?.middleware));let i={request:t,params:n[0].params,context:o,matches:n},c=await e({...i,fetcherKey:r,runClientMiddleware:u=>{let f=i;return M4(f,()=>u({...f,fetcherKey:r,runClientMiddleware:()=>{throw new Error("Cannot call `runClientMiddleware()` from within an `runClientMiddleware` handler")}}))}});try{await Promise.all(n.flatMap(u=>[u._lazyPromises?.handler,u._lazyPromises?.route]))}catch{}return c}async function JH({request:e,match:t,lazyHandlerPromise:n,lazyRoutePromise:r,handlerOverride:o,scopedContext:a}){let i,s,c=La(e.method),u=c?"action":"loader",f=p=>{let y,g=new Promise((E,S)=>y=S);s=()=>y(),e.signal.addEventListener("abort",s);let b=E=>typeof p!="function"?Promise.reject(new Error(`You cannot call the handler for a route which defines a boolean "${u}" [routeId: ${t.route.id}]`)):p({request:e,params:t.params,context:a},...E!==void 0?[E]:[]),x=(async()=>{try{return{type:"data",result:await(o?o(S=>b(S)):b())}}catch(E){return{type:"error",result:E}}})();return Promise.race([x,g])};try{let p=c?t.route.action:t.route.loader;if(n||r)if(p){let y,[g]=await Promise.all([f(p).catch(b=>{y=b}),n,r]);if(y!==void 0)throw y;i=g}else{await n;let y=c?t.route.action:t.route.loader;if(y)[i]=await Promise.all([f(y),r]);else if(u==="action"){let g=new URL(e.url),b=g.pathname+g.search;throw Wi(405,{method:e.method,pathname:b,routeId:t.route.id})}else return{type:"data",result:void 0}}else if(p)i=await f(p);else{let y=new URL(e.url),g=y.pathname+y.search;throw Wi(404,{pathname:g})}}catch(p){return{type:"error",result:p}}finally{s&&e.signal.removeEventListener("abort",s)}return i}async function eU(e){let t=e.headers.get("Content-Type");return t&&/\bapplication\/json\b/.test(t)?e.body==null?null:e.json():e.text()}async function tU(e){let{result:t,type:n}=e;if(_4(t)){let r;try{r=await eU(t)}catch(o){return{type:"error",error:o}}return n==="error"?{type:"error",error:new v1(t.status,t.statusText,r),statusCode:t.status,headers:t.headers}:{type:"data",data:r,statusCode:t.status,headers:t.headers}}return n==="error"?EN(t)?t.data instanceof Error?{type:"error",error:t.data,statusCode:t.init?.status,headers:t.init?.headers?new Headers(t.init.headers):void 0}:{type:"error",error:new v1(t.init?.status||500,void 0,t.data),statusCode:xy(t)?t.status:void 0,headers:t.init?.headers?new Headers(t.init.headers):void 0}:{type:"error",error:t,statusCode:xy(t)?t.status:void 0}:EN(t)?{type:"data",data:t.data,statusCode:t.init?.status,headers:t.init?.headers?new Headers(t.init.headers):void 0}:{type:"data",data:t}}function nU(e,t,n,r,o){let a=e.headers.get("Location");if(qn(a,"Redirects returned/thrown from loaders/actions must have a Location header"),!b2(a)){let i=r.slice(0,r.findIndex(s=>s.route.id===n)+1);a=xw(new URL(t.url),i,o,a),e.headers.set("Location",a)}return e}function yN(e,t,n){if(b2(e)){let r=e,o=r.startsWith("//")?new URL(t.protocol+r):new URL(r),a=os(o.pathname,n)!=null;if(o.origin===t.origin&&a)return o.pathname+o.search+o.hash}return e}function fp(e,t,n,r){let o=e.createURL(I4(t)).toString(),a={signal:n};if(r&&La(r.formMethod)){let{formMethod:i,formEncType:s}=r;a.method=i.toUpperCase(),s==="application/json"?(a.headers=new Headers({"Content-Type":s}),a.body=JSON.stringify(r.json)):s==="text/plain"?a.body=r.text:s==="application/x-www-form-urlencoded"&&r.formData?a.body=Cw(r.formData):a.body=r.formData}return new Request(o,a)}function Cw(e){let t=new URLSearchParams;for(let[n,r]of e.entries())t.append(n,typeof r=="string"?r:r.name);return t}function bN(e){let t=new FormData;for(let[n,r]of e.entries())t.append(n,r);return t}function rU(e,t,n,r=!1,o=!1){let a={},i=null,s,c=!1,u={},f=n&&ui(n[1])?n[1].error:void 0;return e.forEach(p=>{if(!(p.route.id in t))return;let y=p.route.id,g=t[y];if(qn(!bd(g),"Cannot handle redirect results in processLoaderData"),ui(g)){let b=g.error;if(f!==void 0&&(b=f,f=void 0),i=i||{},o)i[y]=b;else{let x=uu(e,y);i[x.route.id]==null&&(i[x.route.id]=b)}r||(a[y]=D4),c||(c=!0,s=xy(g.error)?g.error.status:500),g.headers&&(u[y]=g.headers)}else a[y]=g.data,g.statusCode&&g.statusCode!==200&&!c&&(s=g.statusCode),g.headers&&(u[y]=g.headers)}),f!==void 0&&n&&(i={[n[0]]:f},n[2]&&(a[n[2]]=void 0)),{loaderData:a,errors:i,statusCode:s||200,loaderHeaders:u}}function vN(e,t,n,r,o,a){let{loaderData:i,errors:s}=rU(t,n,r);return o.filter(c=>!c.matches||c.matches.some(u=>u.shouldLoad)).forEach(c=>{let{key:u,match:f,controller:p}=c;if(p&&p.signal.aborted)return;let y=a[u];if(qn(y,"Did not find corresponding fetcher result"),ui(y)){let g=uu(e.matches,f?.route.id);s&&s[g.route.id]||(s={...s,[g.route.id]:y.error}),e.fetchers.delete(u)}else if(bd(y))qn(!1,"Unhandled fetcher revalidation redirect");else{let g=iu(y.data);e.fetchers.set(u,g)}}),{loaderData:i,errors:s}}function xN(e,t,n,r){let o=Object.entries(t).filter(([,a])=>a!==D4).reduce((a,[i,s])=>(a[i]=s,a),{});for(let a of n){let i=a.route.id;if(!t.hasOwnProperty(i)&&e.hasOwnProperty(i)&&a.route.loader&&(o[i]=e[i]),r&&r.hasOwnProperty(i))break}return o}function SN(e){return e?ui(e[1])?{actionData:{}}:{actionData:{[e[0]]:e[1].data}}:{}}function uu(e,t){return(t?e.slice(0,e.findIndex(r=>r.route.id===t)+1):[...e]).reverse().find(r=>r.route.hasErrorBoundary===!0)||e[0]}function t0(e){let t=e.length===1?e[0]:e.find(n=>n.index||!n.path||n.path==="/")||{id:"__shim-error-route__"};return{matches:[{params:{},pathname:"",pathnameBase:"",route:t}],route:t}}function Wi(e,{pathname:t,routeId:n,method:r,type:o,message:a}={}){let i="Unknown Server Error",s="Unknown @remix-run/router error";return e===400?(i="Bad Request",r&&t&&n?s=`You made a ${r} request to "${t}" but did not provide a \`loader\` for route "${n}", so there is no way to handle the request.`:o==="invalid-body"&&(s="Unable to encode submission body")):e===403?(i="Forbidden",s=`Route "${n}" does not match URL "${t}"`):e===404?(i="Not Found",s=`No route matches URL "${t}"`):e===405&&(i="Method Not Allowed",r&&t&&n?s=`You made a ${r.toUpperCase()} request to "${t}" but did not provide an \`action\` for route "${n}", so there is no way to handle the request.`:r&&(s=`Invalid request method "${r.toUpperCase()}"`)),new v1(e||500,i,new Error(s),!0)}function n0(e){let t=Object.entries(e);for(let n=t.length-1;n>=0;n--){let[r,o]=t[n];if(bd(o))return{key:r,result:o}}}function I4(e){let t=typeof e=="string"?Ru(e):e;return Tu({...t,hash:""})}function oU(e,t){return e.pathname!==t.pathname||e.search!==t.search?!1:e.hash===""?t.hash!=="":e.hash===t.hash?!0:t.hash!==""}function aU(e){return e!=null&&typeof e=="object"&&Object.entries(e).every(([t,n])=>typeof t=="string"&&iU(n))}function iU(e){return e!=null&&typeof e=="object"&&"type"in e&&"result"in e&&(e.type==="data"||e.type==="error")}function sU(e){return _4(e.result)&&$H.has(e.result.status)}function ui(e){return e.type==="error"}function bd(e){return(e&&e.type)==="redirect"}function EN(e){return typeof e=="object"&&e!=null&&"type"in e&&"data"in e&&"init"in e&&e.type==="DataWithResponseInit"}function _4(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.headers=="object"&&typeof e.body<"u"}function lU(e){return BH.has(e.toUpperCase())}function La(e){return FH.has(e.toUpperCase())}function v2(e){return new URLSearchParams(e).getAll("index").some(t=>t==="")}function $0(e,t){let n=typeof t=="string"?Ru(t).search:t.search;if(e[e.length-1].route.index&&v2(n||""))return e[e.length-1];let r=w4(e);return r[r.length-1]}function CN(e){let{formMethod:t,formAction:n,formEncType:r,text:o,formData:a,json:i}=e;if(!(!t||!n||!r)){if(o!=null)return{formMethod:t,formAction:n,formEncType:r,formData:void 0,json:void 0,text:o};if(a!=null)return{formMethod:t,formAction:n,formEncType:r,formData:a,json:void 0,text:void 0};if(i!==void 0)return{formMethod:t,formAction:n,formEncType:r,formData:void 0,json:i,text:void 0}}}function ZC(e,t){return t?{state:"loading",location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text}:{state:"loading",location:e,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0}}function cU(e,t){return{state:"submitting",location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text}}function Lm(e,t){return e?{state:"loading",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t}:{state:"loading",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:t}}function uU(e,t){return{state:"submitting",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t?t.data:void 0}}function iu(e){return{state:"idle",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:e}}function dU(e,t){try{let n=e.sessionStorage.getItem(A4);if(n){let r=JSON.parse(n);for(let[o,a]of Object.entries(r||{}))a&&Array.isArray(a)&&t.set(o,new Set(a||[]))}}catch{}}function fU(e,t){if(t.size>0){let n={};for(let[r,o]of t)n[r]=[...o];try{e.sessionStorage.setItem(A4,JSON.stringify(n))}catch(r){vo(!1,`Failed to save applied view transitions in sessionStorage (${r}).`)}}}function pU(){let e,t,n=new Promise((r,o)=>{e=async a=>{r(a);try{await n}catch{}},t=async a=>{o(a);try{await n}catch{}}});return{promise:n,resolve:e,reject:t}}var Kd=T.createContext(null);Kd.displayName="DataRouter";var Xy=T.createContext(null);Xy.displayName="DataRouterState";T.createContext(!1);var x2=T.createContext({isTransitioning:!1});x2.displayName="ViewTransition";var L4=T.createContext(new Map);L4.displayName="Fetchers";var hU=T.createContext(null);hU.displayName="Await";var Ps=T.createContext(null);Ps.displayName="Navigation";var gx=T.createContext(null);gx.displayName="Location";var us=T.createContext({outlet:null,matches:[],isDataRoute:!1});us.displayName="Route";var S2=T.createContext(null);S2.displayName="RouteError";function mU(e,{relative:t}={}){qn(rh(),"useHref() may be used only in the context of a <Router> component.");let{basename:n,navigator:r}=T.useContext(Ps),{hash:o,pathname:a,search:i}=Zy(e,{relative:t}),s=a;return n!=="/"&&(s=a==="/"?n:ul([n,a])),r.createHref({pathname:s,search:i,hash:o})}function rh(){return T.useContext(gx)!=null}function Mu(){return qn(rh(),"useLocation() may be used only in the context of a <Router> component."),T.useContext(gx).location}var F4="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function j4(e){T.useContext(Ps).static||T.useLayoutEffect(e)}function E2(){let{isDataRoute:e}=T.useContext(us);return e?RU():gU()}function gU(){qn(rh(),"useNavigate() may be used only in the context of a <Router> component.");let e=T.useContext(Kd),{basename:t,navigator:n}=T.useContext(Ps),{matches:r}=T.useContext(us),{pathname:o}=Mu(),a=JSON.stringify(hx(r)),i=T.useRef(!1);return j4(()=>{i.current=!0}),T.useCallback((c,u={})=>{if(vo(i.current,F4),!i.current)return;if(typeof c=="number"){n.go(c);return}let f=mx(c,JSON.parse(a),o,u.relative==="path");e==null&&t!=="/"&&(f.pathname=f.pathname==="/"?t:ul([t,f.pathname])),(u.replace?n.replace:n.push)(f,u.state,u)},[t,n,a,o,e])}var yU=T.createContext(null);function bU(e){let t=T.useContext(us).outlet;return t&&T.createElement(yU.Provider,{value:e},t)}function LPe(){let{matches:e}=T.useContext(us),t=e[e.length-1];return t?t.params:{}}function Zy(e,{relative:t}={}){let{matches:n}=T.useContext(us),{pathname:r}=Mu(),o=JSON.stringify(hx(n));return T.useMemo(()=>mx(e,JSON.parse(o),r,t==="path"),[e,o,r,t])}function vU(e,t,n,r,o){qn(rh(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:a}=T.useContext(Ps),{matches:i}=T.useContext(us),s=i[i.length-1],c=s?s.params:{},u=s?s.pathname:"/",f=s?s.pathnameBase:"/",p=s&&s.route;{let w=p&&p.path||"";B4(u,!p||w.endsWith("*")||w.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${u}" (under <Route path="${w}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
61
61
 
62
- Please change the parent <Route path="${w}"> to <Route path="${w==="/"?"*":`${w}/*`}">.`)}let y=Mu(),g;g=y;let b=g.pathname||"/",x=b;if(f!=="/"){let w=f.replace(/^\//,"").split("/");x="/"+b.replace(/^\//,"").split("/").slice(w.length).join("/")}let E=cu(e,{pathname:x});return vo(p||E!=null,`No routes matched location "${g.pathname}${g.search}${g.hash}" `),vo(E==null||E[E.length-1].route.element!==void 0||E[E.length-1].route.Component!==void 0||E[E.length-1].route.lazy!==void 0,`Matched leaf route at location "${g.pathname}${g.search}${g.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`),TU(E&&E.map(w=>Object.assign({},w,{params:Object.assign({},c,w.params),pathname:ul([f,a.encodeLocation?a.encodeLocation(w.pathname).pathname:w.pathname]),pathnameBase:w.pathnameBase==="/"?f:ul([f,a.encodeLocation?a.encodeLocation(w.pathnameBase).pathname:w.pathnameBase])})),i,n,r,o)}function xU(){let e=OU(),t=xy(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,r="rgba(200,200,200, 0.5)",o={padding:"0.5rem",backgroundColor:r},a={padding:"2px 4px",backgroundColor:r},i=null;return console.error("Error handled by React Router default ErrorBoundary:",e),i=T.createElement(T.Fragment,null,T.createElement("p",null,"💿 Hey developer 👋"),T.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",T.createElement("code",{style:a},"ErrorBoundary")," or"," ",T.createElement("code",{style:a},"errorElement")," prop on your route.")),T.createElement(T.Fragment,null,T.createElement("h2",null,"Unexpected Application Error!"),T.createElement("h3",{style:{fontStyle:"italic"}},t),n?T.createElement("pre",{style:o},n):null,i)}var SU=T.createElement(xU,null),EU=class extends T.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.unstable_onError?this.props.unstable_onError(e,t):console.error("React Router caught the following error during render",e)}render(){return this.state.error!==void 0?T.createElement(us.Provider,{value:this.props.routeContext},T.createElement(S2.Provider,{value:this.state.error,children:this.props.component})):this.props.children}};function CU({routeContext:e,match:t,children:n}){let r=T.useContext(Kd);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),T.createElement(us.Provider,{value:e},n)}function TU(e,t=[],n=null,r=null,o=null){if(e==null){if(!n)return null;if(n.errors)e=n.matches;else if(t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let a=e,i=n?.errors;if(i!=null){let u=a.findIndex(f=>f.route.id&&i?.[f.route.id]!==void 0);qn(u>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(i).join(",")}`),a=a.slice(0,Math.min(a.length,u+1))}let s=!1,c=-1;if(n)for(let u=0;u<a.length;u++){let f=a[u];if((f.route.HydrateFallback||f.route.hydrateFallbackElement)&&(c=u),f.route.id){let{loaderData:p,errors:y}=n,g=f.route.loader&&!p.hasOwnProperty(f.route.id)&&(!y||y[f.route.id]===void 0);if(f.route.lazy||g){s=!0,c>=0?a=a.slice(0,c+1):a=[a[0]];break}}}return a.reduceRight((u,f,p)=>{let y,g=!1,b=null,x=null;n&&(y=i&&f.route.id?i[f.route.id]:void 0,b=f.route.errorElement||SU,s&&(c<0&&p===0?(B4("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),g=!0,x=null):c===p&&(g=!0,x=f.route.hydrateFallbackElement||null)));let E=t.concat(a.slice(0,p+1)),S=()=>{let w;return y?w=b:g?w=x:f.route.Component?w=T.createElement(f.route.Component,null):f.route.element?w=f.route.element:w=u,T.createElement(CU,{match:f,routeContext:{outlet:u,matches:E,isDataRoute:n!=null},children:w})};return n&&(f.route.ErrorBoundary||f.route.errorElement||p===0)?T.createElement(EU,{location:n.location,revalidation:n.revalidation,component:b,error:y,children:S(),routeContext:{outlet:null,matches:E,isDataRoute:!0},unstable_onError:r}):S()},null)}function C2(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function wU(e){let t=T.useContext(Kd);return qn(t,C2(e)),t}function kU(e){let t=T.useContext(Xy);return qn(t,C2(e)),t}function AU(e){let t=T.useContext(us);return qn(t,C2(e)),t}function T2(e){let t=AU(e),n=t.matches[t.matches.length-1];return qn(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function DU(){return T2("useRouteId")}function OU(){let e=T.useContext(S2),t=kU("useRouteError"),n=T2("useRouteError");return e!==void 0?e:t.errors?.[n]}function RU(){let{router:e}=wU("useNavigate"),t=T2("useNavigate"),n=T.useRef(!1);return j4(()=>{n.current=!0}),T.useCallback(async(o,a={})=>{vo(n.current,F4),n.current&&(typeof o=="number"?e.navigate(o):await e.navigate(o,{fromRouteId:t,...a}))},[e,t])}var TN={};function B4(e,t,n){!t&&!TN[e]&&(TN[e]=!0,vo(!1,n))}var wN={};function kN(e,t){!e&&!wN[t]&&(wN[t]=!0,console.warn(t))}function MU(e){let t={hasErrorBoundary:e.hasErrorBoundary||e.ErrorBoundary!=null||e.errorElement!=null};return e.Component&&(e.element&&vo(!1,"You should not include both `Component` and `element` on your route - `Component` will be used."),Object.assign(t,{element:T.createElement(e.Component),Component:void 0})),e.HydrateFallback&&(e.hydrateFallbackElement&&vo(!1,"You should not include both `HydrateFallback` and `hydrateFallbackElement` on your route - `HydrateFallback` will be used."),Object.assign(t,{hydrateFallbackElement:T.createElement(e.HydrateFallback),HydrateFallback:void 0})),e.ErrorBoundary&&(e.errorElement&&vo(!1,"You should not include both `ErrorBoundary` and `errorElement` on your route - `ErrorBoundary` will be used."),Object.assign(t,{errorElement:T.createElement(e.ErrorBoundary),ErrorBoundary:void 0})),t}var NU=["HydrateFallback","hydrateFallbackElement"],PU=class{constructor(){this.status="pending",this.promise=new Promise((e,t)=>{this.resolve=n=>{this.status==="pending"&&(this.status="resolved",e(n))},this.reject=n=>{this.status==="pending"&&(this.status="rejected",t(n))}})}};function IU({router:e,flushSync:t,unstable_onError:n}){let[r,o]=T.useState(e.state),[a,i]=T.useState(),[s,c]=T.useState({isTransitioning:!1}),[u,f]=T.useState(),[p,y]=T.useState(),[g,b]=T.useState(),x=T.useRef(new Map),E=T.useCallback(M=>{o(D=>(M.errors&&n&&Object.entries(M.errors).forEach(([I,L])=>{D.errors?.[I]!==L&&n(L)}),M))},[n]),S=T.useCallback((M,{deletedFetchers:D,flushSync:I,viewTransitionOpts:L})=>{M.fetchers.forEach((B,U)=>{B.data!==void 0&&x.current.set(U,B.data)}),D.forEach(B=>x.current.delete(B)),kN(I===!1||t!=null,'You provided the `flushSync` option to a router update, but you are not using the `<RouterProvider>` from `react-router/dom` so `ReactDOM.flushSync()` is unavailable. Please update your app to `import { RouterProvider } from "react-router/dom"` and ensure you have `react-dom` installed as a dependency to use the `flushSync` option.');let F=e.window!=null&&e.window.document!=null&&typeof e.window.document.startViewTransition=="function";if(kN(L==null||F,"You provided the `viewTransition` option to a router update, but you do not appear to be running in a DOM environment as `window.startViewTransition` is not available."),!L||!F){t&&I?t(()=>E(M)):T.startTransition(()=>E(M));return}if(t&&I){t(()=>{p&&(u&&u.resolve(),p.skipTransition()),c({isTransitioning:!0,flushSync:!0,currentLocation:L.currentLocation,nextLocation:L.nextLocation})});let B=e.window.document.startViewTransition(()=>{t(()=>E(M))});B.finished.finally(()=>{t(()=>{f(void 0),y(void 0),i(void 0),c({isTransitioning:!1})})}),t(()=>y(B));return}p?(u&&u.resolve(),p.skipTransition(),b({state:M,currentLocation:L.currentLocation,nextLocation:L.nextLocation})):(i(M),c({isTransitioning:!0,flushSync:!1,currentLocation:L.currentLocation,nextLocation:L.nextLocation}))},[e.window,t,p,u,E]);T.useLayoutEffect(()=>e.subscribe(S),[e,S]),T.useEffect(()=>{s.isTransitioning&&!s.flushSync&&f(new PU)},[s]),T.useEffect(()=>{if(u&&a&&e.window){let M=a,D=u.promise,I=e.window.document.startViewTransition(async()=>{T.startTransition(()=>E(M)),await D});I.finished.finally(()=>{f(void 0),y(void 0),i(void 0),c({isTransitioning:!1})}),y(I)}},[a,u,e.window,E]),T.useEffect(()=>{u&&a&&r.location.key===a.location.key&&u.resolve()},[u,p,r.location,a]),T.useEffect(()=>{!s.isTransitioning&&g&&(i(g.state),c({isTransitioning:!0,flushSync:!1,currentLocation:g.currentLocation,nextLocation:g.nextLocation}),b(void 0))},[s.isTransitioning,g]);let w=T.useMemo(()=>({createHref:e.createHref,encodeLocation:e.encodeLocation,go:M=>e.navigate(M),push:(M,D,I)=>e.navigate(M,{state:D,preventScrollReset:I?.preventScrollReset}),replace:(M,D,I)=>e.navigate(M,{replace:!0,state:D,preventScrollReset:I?.preventScrollReset})}),[e]),C=e.basename||"/",R=T.useMemo(()=>({router:e,navigator:w,static:!1,basename:C,unstable_onError:n}),[e,w,C,n]);return T.createElement(T.Fragment,null,T.createElement(Kd.Provider,{value:R},T.createElement(Xy.Provider,{value:r},T.createElement(L4.Provider,{value:x.current},T.createElement(x2.Provider,{value:s},T.createElement(jU,{basename:C,location:r.location,navigationType:r.historyAction,navigator:w},T.createElement(_U,{routes:e.routes,future:e.future,state:r,unstable_onError:n})))))),null)}var _U=T.memo(LU);function LU({routes:e,future:t,state:n,unstable_onError:r}){return vU(e,void 0,n,r,t)}function FU({to:e,replace:t,state:n,relative:r}){qn(rh(),"<Navigate> may be used only in the context of a <Router> component.");let{static:o}=T.useContext(Ps);vo(!o,"<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.");let{matches:a}=T.useContext(us),{pathname:i}=Mu(),s=E2(),c=mx(e,hx(a),i,r==="path"),u=JSON.stringify(c);return T.useEffect(()=>{s(JSON.parse(u),{replace:t,state:n,relative:r})},[s,u,r,t,n]),null}function LPe(e){return bU(e.context)}function jU({basename:e="/",children:t=null,location:n,navigationType:r="POP",navigator:o,static:a=!1}){qn(!rh(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let i=e.replace(/^\/*/,"/"),s=T.useMemo(()=>({basename:i,navigator:o,static:a,future:{}}),[i,o,a]);typeof n=="string"&&(n=Ru(n));let{pathname:c="/",search:u="",hash:f="",state:p=null,key:y="default"}=n,g=T.useMemo(()=>{let b=os(c,i);return b==null?null:{location:{pathname:b,search:u,hash:f,state:p,key:y},navigationType:r}},[i,c,u,f,p,y,r]);return vo(g!=null,`<Router basename="${i}"> is not able to match the URL "${c}${u}${f}" because it does not start with the basename, so the <Router> won't render anything.`),g==null?null:T.createElement(Ps.Provider,{value:s},T.createElement(gx.Provider,{children:t,value:g}))}var z0="get",H0="application/x-www-form-urlencoded";function yx(e){return e!=null&&typeof e.tagName=="string"}function BU(e){return yx(e)&&e.tagName.toLowerCase()==="button"}function $U(e){return yx(e)&&e.tagName.toLowerCase()==="form"}function zU(e){return yx(e)&&e.tagName.toLowerCase()==="input"}function HU(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function UU(e,t){return e.button===0&&(!t||t==="_self")&&!HU(e)}var r0=null;function VU(){if(r0===null)try{new FormData(document.createElement("form"),0),r0=!1}catch{r0=!0}return r0}var WU=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function JC(e){return e!=null&&!WU.has(e)?(vo(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${H0}"`),null):e}function qU(e,t){let n,r,o,a,i;if($U(e)){let s=e.getAttribute("action");r=s?os(s,t):null,n=e.getAttribute("method")||z0,o=JC(e.getAttribute("enctype"))||H0,a=new FormData(e)}else if(BU(e)||zU(e)&&(e.type==="submit"||e.type==="image")){let s=e.form;if(s==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let c=e.getAttribute("formaction")||s.getAttribute("action");if(r=c?os(c,t):null,n=e.getAttribute("formmethod")||s.getAttribute("method")||z0,o=JC(e.getAttribute("formenctype"))||JC(s.getAttribute("enctype"))||H0,a=new FormData(s,e),!VU()){let{name:u,type:f,value:p}=e;if(f==="image"){let y=u?`${u}.`:"";a.append(`${y}x`,"0"),a.append(`${y}y`,"0")}else u&&a.append(u,p)}}else{if(yx(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=z0,r=null,o=H0,i=e}return a&&o==="text/plain"&&(i=a,a=void 0),{action:r,method:n.toLowerCase(),encType:o,formData:a,body:i}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function w2(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function GU(e,t,n){let r=typeof e=="string"?new URL(e,typeof window>"u"?"server://singlefetch/":window.location.origin):e;return r.pathname==="/"?r.pathname=`_root.${n}`:t&&os(r.pathname,t)==="/"?r.pathname=`${t.replace(/\/$/,"")}/_root.${n}`:r.pathname=`${r.pathname.replace(/\/$/,"")}.${n}`,r}async function YU(e,t){if(e.id in t)return t[e.id];try{let n=await import(e.module);return t[e.id]=n,n}catch(n){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(n),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function KU(e){return e==null?!1:e.href==null?e.rel==="preload"&&typeof e.imageSrcSet=="string"&&typeof e.imageSizes=="string":typeof e.rel=="string"&&typeof e.href=="string"}async function QU(e,t,n){let r=await Promise.all(e.map(async o=>{let a=t.routes[o.route.id];if(a){let i=await YU(a,n);return i.links?i.links():[]}return[]}));return eV(r.flat(1).filter(KU).filter(o=>o.rel==="stylesheet"||o.rel==="preload").map(o=>o.rel==="stylesheet"?{...o,rel:"prefetch",as:"style"}:{...o,rel:"prefetch"}))}function AN(e,t,n,r,o,a){let i=(c,u)=>n[u]?c.route.id!==n[u].route.id:!0,s=(c,u)=>n[u].pathname!==c.pathname||n[u].route.path?.endsWith("*")&&n[u].params["*"]!==c.params["*"];return a==="assets"?t.filter((c,u)=>i(c,u)||s(c,u)):a==="data"?t.filter((c,u)=>{let f=r.routes[c.route.id];if(!f||!f.hasLoader)return!1;if(i(c,u)||s(c,u))return!0;if(c.route.shouldRevalidate){let p=c.route.shouldRevalidate({currentUrl:new URL(o.pathname+o.search+o.hash,window.origin),currentParams:n[0]?.params||{},nextUrl:new URL(e,window.origin),nextParams:c.params,defaultShouldRevalidate:!0});if(typeof p=="boolean")return p}return!0}):[]}function XU(e,t,{includeHydrateFallback:n}={}){return ZU(e.map(r=>{let o=t.routes[r.route.id];if(!o)return[];let a=[o.module];return o.clientActionModule&&(a=a.concat(o.clientActionModule)),o.clientLoaderModule&&(a=a.concat(o.clientLoaderModule)),n&&o.hydrateFallbackModule&&(a=a.concat(o.hydrateFallbackModule)),o.imports&&(a=a.concat(o.imports)),a}).flat(1))}function ZU(e){return[...new Set(e)]}function JU(e){let t={},n=Object.keys(e).sort();for(let r of n)t[r]=e[r];return t}function eV(e,t){let n=new Set;return new Set(t),e.reduce((r,o)=>{let a=JSON.stringify(JU(o));return n.has(a)||(n.add(a),r.push({key:a,link:o})),r},[])}function $4(){let e=T.useContext(Kd);return w2(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function tV(){let e=T.useContext(Xy);return w2(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var k2=T.createContext(void 0);k2.displayName="FrameworkContext";function z4(){let e=T.useContext(k2);return w2(e,"You must render this element inside a <HydratedRouter> element"),e}function nV(e,t){let n=T.useContext(k2),[r,o]=T.useState(!1),[a,i]=T.useState(!1),{onFocus:s,onBlur:c,onMouseEnter:u,onMouseLeave:f,onTouchStart:p}=t,y=T.useRef(null);T.useEffect(()=>{if(e==="render"&&i(!0),e==="viewport"){let x=S=>{S.forEach(w=>{i(w.isIntersecting)})},E=new IntersectionObserver(x,{threshold:.5});return y.current&&E.observe(y.current),()=>{E.disconnect()}}},[e]),T.useEffect(()=>{if(r){let x=setTimeout(()=>{i(!0)},100);return()=>{clearTimeout(x)}}},[r]);let g=()=>{o(!0)},b=()=>{o(!1),i(!1)};return n?e!=="intent"?[a,y,{}]:[a,y,{onFocus:Fm(s,g),onBlur:Fm(c,b),onMouseEnter:Fm(u,g),onMouseLeave:Fm(f,b),onTouchStart:Fm(p,g)}]:[!1,y,{}]}function Fm(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function rV({page:e,...t}){let{router:n}=$4(),r=T.useMemo(()=>cu(n.routes,e,n.basename),[n.routes,e,n.basename]);return r?T.createElement(aV,{page:e,matches:r,...t}):null}function oV(e){let{manifest:t,routeModules:n}=z4(),[r,o]=T.useState([]);return T.useEffect(()=>{let a=!1;return QU(e,t,n).then(i=>{a||o(i)}),()=>{a=!0}},[e,t,n]),r}function aV({page:e,matches:t,...n}){let r=Mu(),{manifest:o,routeModules:a}=z4(),{basename:i}=$4(),{loaderData:s,matches:c}=tV(),u=T.useMemo(()=>AN(e,t,c,o,r,"data"),[e,t,c,o,r]),f=T.useMemo(()=>AN(e,t,c,o,r,"assets"),[e,t,c,o,r]),p=T.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let b=new Set,x=!1;if(t.forEach(S=>{let w=o.routes[S.route.id];!w||!w.hasLoader||(!u.some(C=>C.route.id===S.route.id)&&S.route.id in s&&a[S.route.id]?.shouldRevalidate||w.hasClientLoader?x=!0:b.add(S.route.id))}),b.size===0)return[];let E=GU(e,i,"data");return x&&b.size>0&&E.searchParams.set("_routes",t.filter(S=>b.has(S.route.id)).map(S=>S.route.id).join(",")),[E.pathname+E.search]},[i,s,r,o,u,t,e,a]),y=T.useMemo(()=>XU(f,o),[f,o]),g=oV(f);return T.createElement(T.Fragment,null,p.map(b=>T.createElement("link",{key:b,rel:"prefetch",as:"fetch",href:b,...n})),y.map(b=>T.createElement("link",{key:b,rel:"modulepreload",href:b,...n})),g.map(({key:b,link:x})=>T.createElement("link",{key:b,nonce:n.nonce,...x})))}function iV(...e){return t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})}}var H4=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{H4&&(window.__reactRouterVersion="7.9.1")}catch{}function sV(e,t){return WH({basename:t?.basename,getContext:t?.getContext,future:t?.future,history:uH({window:t?.window}),hydrationData:lV(),routes:e,mapRouteProperties:MU,hydrationRouteProperties:NU,dataStrategy:t?.dataStrategy,patchRoutesOnNavigation:t?.patchRoutesOnNavigation,window:t?.window}).initialize()}function lV(){let e=window?.__staticRouterHydrationData;return e&&e.errors&&(e={...e,errors:cV(e.errors)}),e}function cV(e){if(!e)return null;let t=Object.entries(e),n={};for(let[r,o]of t)if(o&&o.__type==="RouteErrorResponse")n[r]=new v1(o.status,o.statusText,o.data,o.internal===!0);else if(o&&o.__type==="Error"){if(o.__subType){let a=window[o.__subType];if(typeof a=="function")try{let i=new a(o.message);i.stack="",n[r]=i}catch{}}if(n[r]==null){let a=new Error(o.message);a.stack="",n[r]=a}}else n[r]=o;return n}var U4=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,V4=T.forwardRef(function({onClick:t,discover:n="render",prefetch:r="none",relative:o,reloadDocument:a,replace:i,state:s,target:c,to:u,preventScrollReset:f,viewTransition:p,...y},g){let{basename:b}=T.useContext(Ps),x=typeof u=="string"&&U4.test(u),E,S=!1;if(typeof u=="string"&&x&&(E=u,H4))try{let F=new URL(window.location.href),B=u.startsWith("//")?new URL(F.protocol+u):new URL(u),U=os(B.pathname,b);B.origin===F.origin&&U!=null?u=U+B.search+B.hash:S=!0}catch{vo(!1,`<Link to="${u}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}let w=mU(u,{relative:o}),[C,R,M]=nV(r,y),D=pV(u,{replace:i,state:s,target:c,preventScrollReset:f,relative:o,viewTransition:p});function I(F){t&&t(F),F.defaultPrevented||D(F)}let L=T.createElement("a",{...y,...M,href:E||w,onClick:S||a?t:I,ref:iV(g,R),target:c,"data-discover":!x&&n==="render"?"true":void 0});return C&&!x?T.createElement(T.Fragment,null,L,T.createElement(rV,{page:w})):L});V4.displayName="Link";var uV=T.forwardRef(function({"aria-current":t="page",caseSensitive:n=!1,className:r="",end:o=!1,style:a,to:i,viewTransition:s,children:c,...u},f){let p=Zy(i,{relative:u.relative}),y=Mu(),g=T.useContext(Xy),{navigator:b,basename:x}=T.useContext(Ps),E=g!=null&&bV(p)&&s===!0,S=b.encodeLocation?b.encodeLocation(p).pathname:p.pathname,w=y.pathname,C=g&&g.navigation&&g.navigation.location?g.navigation.location.pathname:null;n||(w=w.toLowerCase(),C=C?C.toLowerCase():null,S=S.toLowerCase()),C&&x&&(C=os(C,x)||C);const R=S!=="/"&&S.endsWith("/")?S.length-1:S.length;let M=w===S||!o&&w.startsWith(S)&&w.charAt(R)==="/",D=C!=null&&(C===S||!o&&C.startsWith(S)&&C.charAt(S.length)==="/"),I={isActive:M,isPending:D,isTransitioning:E},L=M?t:void 0,F;typeof r=="function"?F=r(I):F=[r,M?"active":null,D?"pending":null,E?"transitioning":null].filter(Boolean).join(" ");let B=typeof a=="function"?a(I):a;return T.createElement(V4,{...u,"aria-current":L,className:F,ref:f,style:B,to:i,viewTransition:s},typeof c=="function"?c(I):c)});uV.displayName="NavLink";var dV=T.forwardRef(({discover:e="render",fetcherKey:t,navigate:n,reloadDocument:r,replace:o,state:a,method:i=z0,action:s,onSubmit:c,relative:u,preventScrollReset:f,viewTransition:p,...y},g)=>{let b=gV(),x=yV(s,{relative:u}),E=i.toLowerCase()==="get"?"get":"post",S=typeof s=="string"&&U4.test(s),w=C=>{if(c&&c(C),C.defaultPrevented)return;C.preventDefault();let R=C.nativeEvent.submitter,M=R?.getAttribute("formmethod")||i;b(R||C.currentTarget,{fetcherKey:t,method:M,navigate:n,replace:o,state:a,relative:u,preventScrollReset:f,viewTransition:p})};return T.createElement("form",{ref:g,method:E,action:x,onSubmit:r?c:w,...y,"data-discover":!S&&e==="render"?"true":void 0})});dV.displayName="Form";function fV(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function W4(e){let t=T.useContext(Kd);return qn(t,fV(e)),t}function pV(e,{target:t,replace:n,state:r,preventScrollReset:o,relative:a,viewTransition:i}={}){let s=E2(),c=Mu(),u=Zy(e,{relative:a});return T.useCallback(f=>{if(UU(f,t)){f.preventDefault();let p=n!==void 0?n:Tu(c)===Tu(u);s(e,{replace:p,state:r,preventScrollReset:o,relative:a,viewTransition:i})}},[c,s,u,n,r,t,e,o,a,i])}var hV=0,mV=()=>`__${String(++hV)}__`;function gV(){let{router:e}=W4("useSubmit"),{basename:t}=T.useContext(Ps),n=DU();return T.useCallback(async(r,o={})=>{let{action:a,method:i,encType:s,formData:c,body:u}=qU(r,t);if(o.navigate===!1){let f=o.fetcherKey||mV();await e.fetch(f,n,o.action||a,{preventScrollReset:o.preventScrollReset,formData:c,body:u,formMethod:o.method||i,formEncType:o.encType||s,flushSync:o.flushSync})}else await e.navigate(o.action||a,{preventScrollReset:o.preventScrollReset,formData:c,body:u,formMethod:o.method||i,formEncType:o.encType||s,replace:o.replace,state:o.state,fromRouteId:n,flushSync:o.flushSync,viewTransition:o.viewTransition})},[e,t,n])}function yV(e,{relative:t}={}){let{basename:n}=T.useContext(Ps),r=T.useContext(us);qn(r,"useFormAction must be used inside a RouteContext");let[o]=r.matches.slice(-1),a={...Zy(e||".",{relative:t})},i=Mu();if(e==null){a.search=i.search;let s=new URLSearchParams(a.search),c=s.getAll("index");if(c.some(f=>f==="")){s.delete("index"),c.filter(p=>p).forEach(p=>s.append("index",p));let f=s.toString();a.search=f?`?${f}`:""}}return(!e||e===".")&&o.route.index&&(a.search=a.search?a.search.replace(/^\?/,"?index&"):"?index"),n!=="/"&&(a.pathname=a.pathname==="/"?n:ul([n,a.pathname])),Tu(a)}function bV(e,{relative:t}={}){let n=T.useContext(x2);qn(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=W4("useViewTransitionState"),o=Zy(e,{relative:t});if(!n.isTransitioning)return!1;let a=os(n.currentLocation.pathname,r)||n.currentLocation.pathname,i=os(n.nextLocation.pathname,r)||n.nextLocation.pathname;return b1(o.pathname,i)!=null||b1(o.pathname,a)!=null}var Jy=x4();const pu=v4(Jy);function vV(e){return T.createElement(IU,{flushSync:Jy.flushSync,...e})}const xV="modulepreload",SV=function(e){return"/"+e},DN={},co=function(t,n,r){let o=Promise.resolve();if(n&&n.length>0){let i=function(u){return Promise.all(u.map(f=>Promise.resolve(f).then(p=>({status:"fulfilled",value:p}),p=>({status:"rejected",reason:p}))))};document.getElementsByTagName("link");const s=document.querySelector("meta[property=csp-nonce]"),c=s?.nonce||s?.getAttribute("nonce");o=i(n.map(u=>{if(u=SV(u),u in DN)return;DN[u]=!0;const f=u.endsWith(".css"),p=f?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${u}"]${p}`))return;const y=document.createElement("link");if(y.rel=f?"stylesheet":xV,f||(y.as="script"),y.crossOrigin="",y.href=u,c&&y.setAttribute("nonce",c),document.head.appendChild(y),f)return new Promise((g,b)=>{y.addEventListener("load",g),y.addEventListener("error",()=>b(new Error(`Unable to preload CSS for ${u}`)))})}))}function a(i){const s=new Event("vite:preloadError",{cancelable:!0});if(s.payload=i,window.dispatchEvent(s),!s.defaultPrevented)throw i}return o.then(i=>{for(const s of i||[])s.status==="rejected"&&a(s.reason);return t().catch(a)})},Sy={black:"#000",white:"#fff"},Wf={300:"#e57373",400:"#ef5350",500:"#f44336",700:"#d32f2f",800:"#c62828"},qf={50:"#f3e5f5",200:"#ce93d8",300:"#ba68c8",400:"#ab47bc",500:"#9c27b0",700:"#7b1fa2"},Gf={50:"#e3f2fd",200:"#90caf9",400:"#42a5f5",700:"#1976d2",800:"#1565c0"},Yf={300:"#4fc3f7",400:"#29b6f6",500:"#03a9f4",700:"#0288d1",900:"#01579b"},Kf={300:"#81c784",400:"#66bb6a",500:"#4caf50",700:"#388e3c",800:"#2e7d32",900:"#1b5e20"},jm={300:"#ffb74d",400:"#ffa726",500:"#ff9800",700:"#f57c00",900:"#e65100"},EV={50:"#fafafa",100:"#f5f5f5",200:"#eeeeee",300:"#e0e0e0",400:"#bdbdbd",500:"#9e9e9e",600:"#757575",700:"#616161",800:"#424242",900:"#212121",A100:"#f5f5f5",A200:"#eeeeee",A400:"#bdbdbd",A700:"#616161"};function ic(e,...t){const n=new URL(`https://mui.com/production-error/?code=${e}`);return t.forEach(r=>n.searchParams.append("args[]",r)),`Minified MUI error #${e}; visit ${n} for the full message.`}const dl="$$material";function S1(){return S1=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},S1.apply(null,arguments)}function CV(e){if(e.sheet)return e.sheet;for(var t=0;t<document.styleSheets.length;t++)if(document.styleSheets[t].ownerNode===e)return document.styleSheets[t]}function TV(e){var t=document.createElement("style");return t.setAttribute("data-emotion",e.key),e.nonce!==void 0&&t.setAttribute("nonce",e.nonce),t.appendChild(document.createTextNode("")),t.setAttribute("data-s",""),t}var wV=(function(){function e(n){var r=this;this._insertTag=function(o){var a;r.tags.length===0?r.insertionPoint?a=r.insertionPoint.nextSibling:r.prepend?a=r.container.firstChild:a=r.before:a=r.tags[r.tags.length-1].nextSibling,r.container.insertBefore(o,a),r.tags.push(o)},this.isSpeedy=n.speedy===void 0?!0:n.speedy,this.tags=[],this.ctr=0,this.nonce=n.nonce,this.key=n.key,this.container=n.container,this.prepend=n.prepend,this.insertionPoint=n.insertionPoint,this.before=null}var t=e.prototype;return t.hydrate=function(r){r.forEach(this._insertTag)},t.insert=function(r){this.ctr%(this.isSpeedy?65e3:1)===0&&this._insertTag(TV(this));var o=this.tags[this.tags.length-1];if(this.isSpeedy){var a=CV(o);try{a.insertRule(r,a.cssRules.length)}catch{}}else o.appendChild(document.createTextNode(r));this.ctr++},t.flush=function(){this.tags.forEach(function(r){var o;return(o=r.parentNode)==null?void 0:o.removeChild(r)}),this.tags=[],this.ctr=0},e})(),na="-ms-",E1="-moz-",yr="-webkit-",q4="comm",A2="rule",D2="decl",kV="@import",G4="@keyframes",AV="@layer",DV=Math.abs,bx=String.fromCharCode,OV=Object.assign;function RV(e,t){return Zo(e,0)^45?(((t<<2^Zo(e,0))<<2^Zo(e,1))<<2^Zo(e,2))<<2^Zo(e,3):0}function Y4(e){return e.trim()}function MV(e,t){return(e=t.exec(e))?e[0]:e}function br(e,t,n){return e.replace(t,n)}function Tw(e,t){return e.indexOf(t)}function Zo(e,t){return e.charCodeAt(t)|0}function Ey(e,t,n){return e.slice(t,n)}function rl(e){return e.length}function O2(e){return e.length}function o0(e,t){return t.push(e),e}function NV(e,t){return e.map(t).join("")}var vx=1,_p=1,K4=0,qa=0,Ao=0,oh="";function xx(e,t,n,r,o,a,i){return{value:e,root:t,parent:n,type:r,props:o,children:a,line:vx,column:_p,length:i,return:""}}function Bm(e,t){return OV(xx("",null,null,"",null,null,0),e,{length:-e.length},t)}function PV(){return Ao}function IV(){return Ao=qa>0?Zo(oh,--qa):0,_p--,Ao===10&&(_p=1,vx--),Ao}function vi(){return Ao=qa<K4?Zo(oh,qa++):0,_p++,Ao===10&&(_p=1,vx++),Ao}function fl(){return Zo(oh,qa)}function U0(){return qa}function eb(e,t){return Ey(oh,e,t)}function Cy(e){switch(e){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function Q4(e){return vx=_p=1,K4=rl(oh=e),qa=0,[]}function X4(e){return oh="",e}function V0(e){return Y4(eb(qa-1,ww(e===91?e+2:e===40?e+1:e)))}function _V(e){for(;(Ao=fl())&&Ao<33;)vi();return Cy(e)>2||Cy(Ao)>3?"":" "}function LV(e,t){for(;--t&&vi()&&!(Ao<48||Ao>102||Ao>57&&Ao<65||Ao>70&&Ao<97););return eb(e,U0()+(t<6&&fl()==32&&vi()==32))}function ww(e){for(;vi();)switch(Ao){case e:return qa;case 34:case 39:e!==34&&e!==39&&ww(Ao);break;case 40:e===41&&ww(e);break;case 92:vi();break}return qa}function FV(e,t){for(;vi()&&e+Ao!==57;)if(e+Ao===84&&fl()===47)break;return"/*"+eb(t,qa-1)+"*"+bx(e===47?e:vi())}function jV(e){for(;!Cy(fl());)vi();return eb(e,qa)}function BV(e){return X4(W0("",null,null,null,[""],e=Q4(e),0,[0],e))}function W0(e,t,n,r,o,a,i,s,c){for(var u=0,f=0,p=i,y=0,g=0,b=0,x=1,E=1,S=1,w=0,C="",R=o,M=a,D=r,I=C;E;)switch(b=w,w=vi()){case 40:if(b!=108&&Zo(I,p-1)==58){Tw(I+=br(V0(w),"&","&\f"),"&\f")!=-1&&(S=-1);break}case 34:case 39:case 91:I+=V0(w);break;case 9:case 10:case 13:case 32:I+=_V(b);break;case 92:I+=LV(U0()-1,7);continue;case 47:switch(fl()){case 42:case 47:o0($V(FV(vi(),U0()),t,n),c);break;default:I+="/"}break;case 123*x:s[u++]=rl(I)*S;case 125*x:case 59:case 0:switch(w){case 0:case 125:E=0;case 59+f:S==-1&&(I=br(I,/\f/g,"")),g>0&&rl(I)-p&&o0(g>32?RN(I+";",r,n,p-1):RN(br(I," ","")+";",r,n,p-2),c);break;case 59:I+=";";default:if(o0(D=ON(I,t,n,u,f,o,s,C,R=[],M=[],p),a),w===123)if(f===0)W0(I,t,D,D,R,a,p,s,M);else switch(y===99&&Zo(I,3)===110?100:y){case 100:case 108:case 109:case 115:W0(e,D,D,r&&o0(ON(e,D,D,0,0,o,s,C,o,R=[],p),M),o,M,p,s,r?R:M);break;default:W0(I,D,D,D,[""],M,0,s,M)}}u=f=g=0,x=S=1,C=I="",p=i;break;case 58:p=1+rl(I),g=b;default:if(x<1){if(w==123)--x;else if(w==125&&x++==0&&IV()==125)continue}switch(I+=bx(w),w*x){case 38:S=f>0?1:(I+="\f",-1);break;case 44:s[u++]=(rl(I)-1)*S,S=1;break;case 64:fl()===45&&(I+=V0(vi())),y=fl(),f=p=rl(C=I+=jV(U0())),w++;break;case 45:b===45&&rl(I)==2&&(x=0)}}return a}function ON(e,t,n,r,o,a,i,s,c,u,f){for(var p=o-1,y=o===0?a:[""],g=O2(y),b=0,x=0,E=0;b<r;++b)for(var S=0,w=Ey(e,p+1,p=DV(x=i[b])),C=e;S<g;++S)(C=Y4(x>0?y[S]+" "+w:br(w,/&\f/g,y[S])))&&(c[E++]=C);return xx(e,t,n,o===0?A2:s,c,u,f)}function $V(e,t,n){return xx(e,t,n,q4,bx(PV()),Ey(e,2,-2),0)}function RN(e,t,n,r){return xx(e,t,n,D2,Ey(e,0,r),Ey(e,r+1,-1),r)}function Sp(e,t){for(var n="",r=O2(e),o=0;o<r;o++)n+=t(e[o],o,e,t)||"";return n}function zV(e,t,n,r){switch(e.type){case AV:if(e.children.length)break;case kV:case D2:return e.return=e.return||e.value;case q4:return"";case G4:return e.return=e.value+"{"+Sp(e.children,r)+"}";case A2:e.value=e.props.join(",")}return rl(n=Sp(e.children,r))?e.return=e.value+"{"+n+"}":""}function HV(e){var t=O2(e);return function(n,r,o,a){for(var i="",s=0;s<t;s++)i+=e[s](n,r,o,a)||"";return i}}function UV(e){return function(t){t.root||(t=t.return)&&e(t)}}function Z4(e){var t=Object.create(null);return function(n){return t[n]===void 0&&(t[n]=e(n)),t[n]}}var VV=function(t,n,r){for(var o=0,a=0;o=a,a=fl(),o===38&&a===12&&(n[r]=1),!Cy(a);)vi();return eb(t,qa)},WV=function(t,n){var r=-1,o=44;do switch(Cy(o)){case 0:o===38&&fl()===12&&(n[r]=1),t[r]+=VV(qa-1,n,r);break;case 2:t[r]+=V0(o);break;case 4:if(o===44){t[++r]=fl()===58?"&\f":"",n[r]=t[r].length;break}default:t[r]+=bx(o)}while(o=vi());return t},qV=function(t,n){return X4(WV(Q4(t),n))},MN=new WeakMap,GV=function(t){if(!(t.type!=="rule"||!t.parent||t.length<1)){for(var n=t.value,r=t.parent,o=t.column===r.column&&t.line===r.line;r.type!=="rule";)if(r=r.parent,!r)return;if(!(t.props.length===1&&n.charCodeAt(0)!==58&&!MN.get(r))&&!o){MN.set(t,!0);for(var a=[],i=qV(n,a),s=r.props,c=0,u=0;c<i.length;c++)for(var f=0;f<s.length;f++,u++)t.props[u]=a[c]?i[c].replace(/&\f/g,s[f]):s[f]+" "+i[c]}}},YV=function(t){if(t.type==="decl"){var n=t.value;n.charCodeAt(0)===108&&n.charCodeAt(2)===98&&(t.return="",t.value="")}};function J4(e,t){switch(RV(e,t)){case 5103:return yr+"print-"+e+e;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 6391:case 5879:case 5623:case 6135:case 4599:case 4855:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:return yr+e+e;case 5349:case 4246:case 4810:case 6968:case 2756:return yr+e+E1+e+na+e+e;case 6828:case 4268:return yr+e+na+e+e;case 6165:return yr+e+na+"flex-"+e+e;case 5187:return yr+e+br(e,/(\w+).+(:[^]+)/,yr+"box-$1$2"+na+"flex-$1$2")+e;case 5443:return yr+e+na+"flex-item-"+br(e,/flex-|-self/,"")+e;case 4675:return yr+e+na+"flex-line-pack"+br(e,/align-content|flex-|-self/,"")+e;case 5548:return yr+e+na+br(e,"shrink","negative")+e;case 5292:return yr+e+na+br(e,"basis","preferred-size")+e;case 6060:return yr+"box-"+br(e,"-grow","")+yr+e+na+br(e,"grow","positive")+e;case 4554:return yr+br(e,/([^-])(transform)/g,"$1"+yr+"$2")+e;case 6187:return br(br(br(e,/(zoom-|grab)/,yr+"$1"),/(image-set)/,yr+"$1"),e,"")+e;case 5495:case 3959:return br(e,/(image-set\([^]*)/,yr+"$1$`$1");case 4968:return br(br(e,/(.+:)(flex-)?(.*)/,yr+"box-pack:$3"+na+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+yr+e+e;case 4095:case 3583:case 4068:case 2532:return br(e,/(.+)-inline(.+)/,yr+"$1$2")+e;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(rl(e)-1-t>6)switch(Zo(e,t+1)){case 109:if(Zo(e,t+4)!==45)break;case 102:return br(e,/(.+:)(.+)-([^]+)/,"$1"+yr+"$2-$3$1"+E1+(Zo(e,t+3)==108?"$3":"$2-$3"))+e;case 115:return~Tw(e,"stretch")?J4(br(e,"stretch","fill-available"),t)+e:e}break;case 4949:if(Zo(e,t+1)!==115)break;case 6444:switch(Zo(e,rl(e)-3-(~Tw(e,"!important")&&10))){case 107:return br(e,":",":"+yr)+e;case 101:return br(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+yr+(Zo(e,14)===45?"inline-":"")+"box$3$1"+yr+"$2$3$1"+na+"$2box$3")+e}break;case 5936:switch(Zo(e,t+11)){case 114:return yr+e+na+br(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return yr+e+na+br(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return yr+e+na+br(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return yr+e+na+e+e}return e}var KV=function(t,n,r,o){if(t.length>-1&&!t.return)switch(t.type){case D2:t.return=J4(t.value,t.length);break;case G4:return Sp([Bm(t,{value:br(t.value,"@","@"+yr)})],o);case A2:if(t.length)return NV(t.props,function(a){switch(MV(a,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return Sp([Bm(t,{props:[br(a,/:(read-\w+)/,":"+E1+"$1")]})],o);case"::placeholder":return Sp([Bm(t,{props:[br(a,/:(plac\w+)/,":"+yr+"input-$1")]}),Bm(t,{props:[br(a,/:(plac\w+)/,":"+E1+"$1")]}),Bm(t,{props:[br(a,/:(plac\w+)/,na+"input-$1")]})],o)}return""})}},QV=[KV],XV=function(t){var n=t.key;if(n==="css"){var r=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(r,function(x){var E=x.getAttribute("data-emotion");E.indexOf(" ")!==-1&&(document.head.appendChild(x),x.setAttribute("data-s",""))})}var o=t.stylisPlugins||QV,a={},i,s=[];i=t.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+n+' "]'),function(x){for(var E=x.getAttribute("data-emotion").split(" "),S=1;S<E.length;S++)a[E[S]]=!0;s.push(x)});var c,u=[GV,YV];{var f,p=[zV,UV(function(x){f.insert(x)})],y=HV(u.concat(o,p)),g=function(E){return Sp(BV(E),y)};c=function(E,S,w,C){f=w,g(E?E+"{"+S.styles+"}":S.styles),C&&(b.inserted[S.name]=!0)}}var b={key:n,sheet:new wV({key:n,container:i,nonce:t.nonce,speedy:t.speedy,prepend:t.prepend,insertionPoint:t.insertionPoint}),nonce:t.nonce,inserted:a,registered:{},insert:c};return b.sheet.hydrate(s),b},eT={exports:{}},xr={};/** @license React v16.13.1
62
+ Please change the parent <Route path="${w}"> to <Route path="${w==="/"?"*":`${w}/*`}">.`)}let y=Mu(),g;g=y;let b=g.pathname||"/",x=b;if(f!=="/"){let w=f.replace(/^\//,"").split("/");x="/"+b.replace(/^\//,"").split("/").slice(w.length).join("/")}let E=cu(e,{pathname:x});return vo(p||E!=null,`No routes matched location "${g.pathname}${g.search}${g.hash}" `),vo(E==null||E[E.length-1].route.element!==void 0||E[E.length-1].route.Component!==void 0||E[E.length-1].route.lazy!==void 0,`Matched leaf route at location "${g.pathname}${g.search}${g.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`),TU(E&&E.map(w=>Object.assign({},w,{params:Object.assign({},c,w.params),pathname:ul([f,a.encodeLocation?a.encodeLocation(w.pathname).pathname:w.pathname]),pathnameBase:w.pathnameBase==="/"?f:ul([f,a.encodeLocation?a.encodeLocation(w.pathnameBase).pathname:w.pathnameBase])})),i,n,r,o)}function xU(){let e=OU(),t=xy(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,r="rgba(200,200,200, 0.5)",o={padding:"0.5rem",backgroundColor:r},a={padding:"2px 4px",backgroundColor:r},i=null;return console.error("Error handled by React Router default ErrorBoundary:",e),i=T.createElement(T.Fragment,null,T.createElement("p",null,"💿 Hey developer 👋"),T.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",T.createElement("code",{style:a},"ErrorBoundary")," or"," ",T.createElement("code",{style:a},"errorElement")," prop on your route.")),T.createElement(T.Fragment,null,T.createElement("h2",null,"Unexpected Application Error!"),T.createElement("h3",{style:{fontStyle:"italic"}},t),n?T.createElement("pre",{style:o},n):null,i)}var SU=T.createElement(xU,null),EU=class extends T.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.unstable_onError?this.props.unstable_onError(e,t):console.error("React Router caught the following error during render",e)}render(){return this.state.error!==void 0?T.createElement(us.Provider,{value:this.props.routeContext},T.createElement(S2.Provider,{value:this.state.error,children:this.props.component})):this.props.children}};function CU({routeContext:e,match:t,children:n}){let r=T.useContext(Kd);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),T.createElement(us.Provider,{value:e},n)}function TU(e,t=[],n=null,r=null,o=null){if(e==null){if(!n)return null;if(n.errors)e=n.matches;else if(t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let a=e,i=n?.errors;if(i!=null){let u=a.findIndex(f=>f.route.id&&i?.[f.route.id]!==void 0);qn(u>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(i).join(",")}`),a=a.slice(0,Math.min(a.length,u+1))}let s=!1,c=-1;if(n)for(let u=0;u<a.length;u++){let f=a[u];if((f.route.HydrateFallback||f.route.hydrateFallbackElement)&&(c=u),f.route.id){let{loaderData:p,errors:y}=n,g=f.route.loader&&!p.hasOwnProperty(f.route.id)&&(!y||y[f.route.id]===void 0);if(f.route.lazy||g){s=!0,c>=0?a=a.slice(0,c+1):a=[a[0]];break}}}return a.reduceRight((u,f,p)=>{let y,g=!1,b=null,x=null;n&&(y=i&&f.route.id?i[f.route.id]:void 0,b=f.route.errorElement||SU,s&&(c<0&&p===0?(B4("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),g=!0,x=null):c===p&&(g=!0,x=f.route.hydrateFallbackElement||null)));let E=t.concat(a.slice(0,p+1)),S=()=>{let w;return y?w=b:g?w=x:f.route.Component?w=T.createElement(f.route.Component,null):f.route.element?w=f.route.element:w=u,T.createElement(CU,{match:f,routeContext:{outlet:u,matches:E,isDataRoute:n!=null},children:w})};return n&&(f.route.ErrorBoundary||f.route.errorElement||p===0)?T.createElement(EU,{location:n.location,revalidation:n.revalidation,component:b,error:y,children:S(),routeContext:{outlet:null,matches:E,isDataRoute:!0},unstable_onError:r}):S()},null)}function C2(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function wU(e){let t=T.useContext(Kd);return qn(t,C2(e)),t}function kU(e){let t=T.useContext(Xy);return qn(t,C2(e)),t}function AU(e){let t=T.useContext(us);return qn(t,C2(e)),t}function T2(e){let t=AU(e),n=t.matches[t.matches.length-1];return qn(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function DU(){return T2("useRouteId")}function OU(){let e=T.useContext(S2),t=kU("useRouteError"),n=T2("useRouteError");return e!==void 0?e:t.errors?.[n]}function RU(){let{router:e}=wU("useNavigate"),t=T2("useNavigate"),n=T.useRef(!1);return j4(()=>{n.current=!0}),T.useCallback(async(o,a={})=>{vo(n.current,F4),n.current&&(typeof o=="number"?e.navigate(o):await e.navigate(o,{fromRouteId:t,...a}))},[e,t])}var TN={};function B4(e,t,n){!t&&!TN[e]&&(TN[e]=!0,vo(!1,n))}var wN={};function kN(e,t){!e&&!wN[t]&&(wN[t]=!0,console.warn(t))}function MU(e){let t={hasErrorBoundary:e.hasErrorBoundary||e.ErrorBoundary!=null||e.errorElement!=null};return e.Component&&(e.element&&vo(!1,"You should not include both `Component` and `element` on your route - `Component` will be used."),Object.assign(t,{element:T.createElement(e.Component),Component:void 0})),e.HydrateFallback&&(e.hydrateFallbackElement&&vo(!1,"You should not include both `HydrateFallback` and `hydrateFallbackElement` on your route - `HydrateFallback` will be used."),Object.assign(t,{hydrateFallbackElement:T.createElement(e.HydrateFallback),HydrateFallback:void 0})),e.ErrorBoundary&&(e.errorElement&&vo(!1,"You should not include both `ErrorBoundary` and `errorElement` on your route - `ErrorBoundary` will be used."),Object.assign(t,{errorElement:T.createElement(e.ErrorBoundary),ErrorBoundary:void 0})),t}var NU=["HydrateFallback","hydrateFallbackElement"],PU=class{constructor(){this.status="pending",this.promise=new Promise((e,t)=>{this.resolve=n=>{this.status==="pending"&&(this.status="resolved",e(n))},this.reject=n=>{this.status==="pending"&&(this.status="rejected",t(n))}})}};function IU({router:e,flushSync:t,unstable_onError:n}){let[r,o]=T.useState(e.state),[a,i]=T.useState(),[s,c]=T.useState({isTransitioning:!1}),[u,f]=T.useState(),[p,y]=T.useState(),[g,b]=T.useState(),x=T.useRef(new Map),E=T.useCallback(M=>{o(D=>(M.errors&&n&&Object.entries(M.errors).forEach(([I,L])=>{D.errors?.[I]!==L&&n(L)}),M))},[n]),S=T.useCallback((M,{deletedFetchers:D,flushSync:I,viewTransitionOpts:L})=>{M.fetchers.forEach((B,U)=>{B.data!==void 0&&x.current.set(U,B.data)}),D.forEach(B=>x.current.delete(B)),kN(I===!1||t!=null,'You provided the `flushSync` option to a router update, but you are not using the `<RouterProvider>` from `react-router/dom` so `ReactDOM.flushSync()` is unavailable. Please update your app to `import { RouterProvider } from "react-router/dom"` and ensure you have `react-dom` installed as a dependency to use the `flushSync` option.');let F=e.window!=null&&e.window.document!=null&&typeof e.window.document.startViewTransition=="function";if(kN(L==null||F,"You provided the `viewTransition` option to a router update, but you do not appear to be running in a DOM environment as `window.startViewTransition` is not available."),!L||!F){t&&I?t(()=>E(M)):T.startTransition(()=>E(M));return}if(t&&I){t(()=>{p&&(u&&u.resolve(),p.skipTransition()),c({isTransitioning:!0,flushSync:!0,currentLocation:L.currentLocation,nextLocation:L.nextLocation})});let B=e.window.document.startViewTransition(()=>{t(()=>E(M))});B.finished.finally(()=>{t(()=>{f(void 0),y(void 0),i(void 0),c({isTransitioning:!1})})}),t(()=>y(B));return}p?(u&&u.resolve(),p.skipTransition(),b({state:M,currentLocation:L.currentLocation,nextLocation:L.nextLocation})):(i(M),c({isTransitioning:!0,flushSync:!1,currentLocation:L.currentLocation,nextLocation:L.nextLocation}))},[e.window,t,p,u,E]);T.useLayoutEffect(()=>e.subscribe(S),[e,S]),T.useEffect(()=>{s.isTransitioning&&!s.flushSync&&f(new PU)},[s]),T.useEffect(()=>{if(u&&a&&e.window){let M=a,D=u.promise,I=e.window.document.startViewTransition(async()=>{T.startTransition(()=>E(M)),await D});I.finished.finally(()=>{f(void 0),y(void 0),i(void 0),c({isTransitioning:!1})}),y(I)}},[a,u,e.window,E]),T.useEffect(()=>{u&&a&&r.location.key===a.location.key&&u.resolve()},[u,p,r.location,a]),T.useEffect(()=>{!s.isTransitioning&&g&&(i(g.state),c({isTransitioning:!0,flushSync:!1,currentLocation:g.currentLocation,nextLocation:g.nextLocation}),b(void 0))},[s.isTransitioning,g]);let w=T.useMemo(()=>({createHref:e.createHref,encodeLocation:e.encodeLocation,go:M=>e.navigate(M),push:(M,D,I)=>e.navigate(M,{state:D,preventScrollReset:I?.preventScrollReset}),replace:(M,D,I)=>e.navigate(M,{replace:!0,state:D,preventScrollReset:I?.preventScrollReset})}),[e]),C=e.basename||"/",R=T.useMemo(()=>({router:e,navigator:w,static:!1,basename:C,unstable_onError:n}),[e,w,C,n]);return T.createElement(T.Fragment,null,T.createElement(Kd.Provider,{value:R},T.createElement(Xy.Provider,{value:r},T.createElement(L4.Provider,{value:x.current},T.createElement(x2.Provider,{value:s},T.createElement(jU,{basename:C,location:r.location,navigationType:r.historyAction,navigator:w},T.createElement(_U,{routes:e.routes,future:e.future,state:r,unstable_onError:n})))))),null)}var _U=T.memo(LU);function LU({routes:e,future:t,state:n,unstable_onError:r}){return vU(e,void 0,n,r,t)}function FU({to:e,replace:t,state:n,relative:r}){qn(rh(),"<Navigate> may be used only in the context of a <Router> component.");let{static:o}=T.useContext(Ps);vo(!o,"<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.");let{matches:a}=T.useContext(us),{pathname:i}=Mu(),s=E2(),c=mx(e,hx(a),i,r==="path"),u=JSON.stringify(c);return T.useEffect(()=>{s(JSON.parse(u),{replace:t,state:n,relative:r})},[s,u,r,t,n]),null}function FPe(e){return bU(e.context)}function jU({basename:e="/",children:t=null,location:n,navigationType:r="POP",navigator:o,static:a=!1}){qn(!rh(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let i=e.replace(/^\/*/,"/"),s=T.useMemo(()=>({basename:i,navigator:o,static:a,future:{}}),[i,o,a]);typeof n=="string"&&(n=Ru(n));let{pathname:c="/",search:u="",hash:f="",state:p=null,key:y="default"}=n,g=T.useMemo(()=>{let b=os(c,i);return b==null?null:{location:{pathname:b,search:u,hash:f,state:p,key:y},navigationType:r}},[i,c,u,f,p,y,r]);return vo(g!=null,`<Router basename="${i}"> is not able to match the URL "${c}${u}${f}" because it does not start with the basename, so the <Router> won't render anything.`),g==null?null:T.createElement(Ps.Provider,{value:s},T.createElement(gx.Provider,{children:t,value:g}))}var z0="get",H0="application/x-www-form-urlencoded";function yx(e){return e!=null&&typeof e.tagName=="string"}function BU(e){return yx(e)&&e.tagName.toLowerCase()==="button"}function $U(e){return yx(e)&&e.tagName.toLowerCase()==="form"}function zU(e){return yx(e)&&e.tagName.toLowerCase()==="input"}function HU(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function UU(e,t){return e.button===0&&(!t||t==="_self")&&!HU(e)}var r0=null;function VU(){if(r0===null)try{new FormData(document.createElement("form"),0),r0=!1}catch{r0=!0}return r0}var WU=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function JC(e){return e!=null&&!WU.has(e)?(vo(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${H0}"`),null):e}function qU(e,t){let n,r,o,a,i;if($U(e)){let s=e.getAttribute("action");r=s?os(s,t):null,n=e.getAttribute("method")||z0,o=JC(e.getAttribute("enctype"))||H0,a=new FormData(e)}else if(BU(e)||zU(e)&&(e.type==="submit"||e.type==="image")){let s=e.form;if(s==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let c=e.getAttribute("formaction")||s.getAttribute("action");if(r=c?os(c,t):null,n=e.getAttribute("formmethod")||s.getAttribute("method")||z0,o=JC(e.getAttribute("formenctype"))||JC(s.getAttribute("enctype"))||H0,a=new FormData(s,e),!VU()){let{name:u,type:f,value:p}=e;if(f==="image"){let y=u?`${u}.`:"";a.append(`${y}x`,"0"),a.append(`${y}y`,"0")}else u&&a.append(u,p)}}else{if(yx(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=z0,r=null,o=H0,i=e}return a&&o==="text/plain"&&(i=a,a=void 0),{action:r,method:n.toLowerCase(),encType:o,formData:a,body:i}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function w2(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function GU(e,t,n){let r=typeof e=="string"?new URL(e,typeof window>"u"?"server://singlefetch/":window.location.origin):e;return r.pathname==="/"?r.pathname=`_root.${n}`:t&&os(r.pathname,t)==="/"?r.pathname=`${t.replace(/\/$/,"")}/_root.${n}`:r.pathname=`${r.pathname.replace(/\/$/,"")}.${n}`,r}async function YU(e,t){if(e.id in t)return t[e.id];try{let n=await import(e.module);return t[e.id]=n,n}catch(n){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(n),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function KU(e){return e==null?!1:e.href==null?e.rel==="preload"&&typeof e.imageSrcSet=="string"&&typeof e.imageSizes=="string":typeof e.rel=="string"&&typeof e.href=="string"}async function QU(e,t,n){let r=await Promise.all(e.map(async o=>{let a=t.routes[o.route.id];if(a){let i=await YU(a,n);return i.links?i.links():[]}return[]}));return eV(r.flat(1).filter(KU).filter(o=>o.rel==="stylesheet"||o.rel==="preload").map(o=>o.rel==="stylesheet"?{...o,rel:"prefetch",as:"style"}:{...o,rel:"prefetch"}))}function AN(e,t,n,r,o,a){let i=(c,u)=>n[u]?c.route.id!==n[u].route.id:!0,s=(c,u)=>n[u].pathname!==c.pathname||n[u].route.path?.endsWith("*")&&n[u].params["*"]!==c.params["*"];return a==="assets"?t.filter((c,u)=>i(c,u)||s(c,u)):a==="data"?t.filter((c,u)=>{let f=r.routes[c.route.id];if(!f||!f.hasLoader)return!1;if(i(c,u)||s(c,u))return!0;if(c.route.shouldRevalidate){let p=c.route.shouldRevalidate({currentUrl:new URL(o.pathname+o.search+o.hash,window.origin),currentParams:n[0]?.params||{},nextUrl:new URL(e,window.origin),nextParams:c.params,defaultShouldRevalidate:!0});if(typeof p=="boolean")return p}return!0}):[]}function XU(e,t,{includeHydrateFallback:n}={}){return ZU(e.map(r=>{let o=t.routes[r.route.id];if(!o)return[];let a=[o.module];return o.clientActionModule&&(a=a.concat(o.clientActionModule)),o.clientLoaderModule&&(a=a.concat(o.clientLoaderModule)),n&&o.hydrateFallbackModule&&(a=a.concat(o.hydrateFallbackModule)),o.imports&&(a=a.concat(o.imports)),a}).flat(1))}function ZU(e){return[...new Set(e)]}function JU(e){let t={},n=Object.keys(e).sort();for(let r of n)t[r]=e[r];return t}function eV(e,t){let n=new Set;return new Set(t),e.reduce((r,o)=>{let a=JSON.stringify(JU(o));return n.has(a)||(n.add(a),r.push({key:a,link:o})),r},[])}function $4(){let e=T.useContext(Kd);return w2(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function tV(){let e=T.useContext(Xy);return w2(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var k2=T.createContext(void 0);k2.displayName="FrameworkContext";function z4(){let e=T.useContext(k2);return w2(e,"You must render this element inside a <HydratedRouter> element"),e}function nV(e,t){let n=T.useContext(k2),[r,o]=T.useState(!1),[a,i]=T.useState(!1),{onFocus:s,onBlur:c,onMouseEnter:u,onMouseLeave:f,onTouchStart:p}=t,y=T.useRef(null);T.useEffect(()=>{if(e==="render"&&i(!0),e==="viewport"){let x=S=>{S.forEach(w=>{i(w.isIntersecting)})},E=new IntersectionObserver(x,{threshold:.5});return y.current&&E.observe(y.current),()=>{E.disconnect()}}},[e]),T.useEffect(()=>{if(r){let x=setTimeout(()=>{i(!0)},100);return()=>{clearTimeout(x)}}},[r]);let g=()=>{o(!0)},b=()=>{o(!1),i(!1)};return n?e!=="intent"?[a,y,{}]:[a,y,{onFocus:Fm(s,g),onBlur:Fm(c,b),onMouseEnter:Fm(u,g),onMouseLeave:Fm(f,b),onTouchStart:Fm(p,g)}]:[!1,y,{}]}function Fm(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function rV({page:e,...t}){let{router:n}=$4(),r=T.useMemo(()=>cu(n.routes,e,n.basename),[n.routes,e,n.basename]);return r?T.createElement(aV,{page:e,matches:r,...t}):null}function oV(e){let{manifest:t,routeModules:n}=z4(),[r,o]=T.useState([]);return T.useEffect(()=>{let a=!1;return QU(e,t,n).then(i=>{a||o(i)}),()=>{a=!0}},[e,t,n]),r}function aV({page:e,matches:t,...n}){let r=Mu(),{manifest:o,routeModules:a}=z4(),{basename:i}=$4(),{loaderData:s,matches:c}=tV(),u=T.useMemo(()=>AN(e,t,c,o,r,"data"),[e,t,c,o,r]),f=T.useMemo(()=>AN(e,t,c,o,r,"assets"),[e,t,c,o,r]),p=T.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let b=new Set,x=!1;if(t.forEach(S=>{let w=o.routes[S.route.id];!w||!w.hasLoader||(!u.some(C=>C.route.id===S.route.id)&&S.route.id in s&&a[S.route.id]?.shouldRevalidate||w.hasClientLoader?x=!0:b.add(S.route.id))}),b.size===0)return[];let E=GU(e,i,"data");return x&&b.size>0&&E.searchParams.set("_routes",t.filter(S=>b.has(S.route.id)).map(S=>S.route.id).join(",")),[E.pathname+E.search]},[i,s,r,o,u,t,e,a]),y=T.useMemo(()=>XU(f,o),[f,o]),g=oV(f);return T.createElement(T.Fragment,null,p.map(b=>T.createElement("link",{key:b,rel:"prefetch",as:"fetch",href:b,...n})),y.map(b=>T.createElement("link",{key:b,rel:"modulepreload",href:b,...n})),g.map(({key:b,link:x})=>T.createElement("link",{key:b,nonce:n.nonce,...x})))}function iV(...e){return t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})}}var H4=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{H4&&(window.__reactRouterVersion="7.9.1")}catch{}function sV(e,t){return WH({basename:t?.basename,getContext:t?.getContext,future:t?.future,history:uH({window:t?.window}),hydrationData:lV(),routes:e,mapRouteProperties:MU,hydrationRouteProperties:NU,dataStrategy:t?.dataStrategy,patchRoutesOnNavigation:t?.patchRoutesOnNavigation,window:t?.window}).initialize()}function lV(){let e=window?.__staticRouterHydrationData;return e&&e.errors&&(e={...e,errors:cV(e.errors)}),e}function cV(e){if(!e)return null;let t=Object.entries(e),n={};for(let[r,o]of t)if(o&&o.__type==="RouteErrorResponse")n[r]=new v1(o.status,o.statusText,o.data,o.internal===!0);else if(o&&o.__type==="Error"){if(o.__subType){let a=window[o.__subType];if(typeof a=="function")try{let i=new a(o.message);i.stack="",n[r]=i}catch{}}if(n[r]==null){let a=new Error(o.message);a.stack="",n[r]=a}}else n[r]=o;return n}var U4=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,V4=T.forwardRef(function({onClick:t,discover:n="render",prefetch:r="none",relative:o,reloadDocument:a,replace:i,state:s,target:c,to:u,preventScrollReset:f,viewTransition:p,...y},g){let{basename:b}=T.useContext(Ps),x=typeof u=="string"&&U4.test(u),E,S=!1;if(typeof u=="string"&&x&&(E=u,H4))try{let F=new URL(window.location.href),B=u.startsWith("//")?new URL(F.protocol+u):new URL(u),U=os(B.pathname,b);B.origin===F.origin&&U!=null?u=U+B.search+B.hash:S=!0}catch{vo(!1,`<Link to="${u}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}let w=mU(u,{relative:o}),[C,R,M]=nV(r,y),D=pV(u,{replace:i,state:s,target:c,preventScrollReset:f,relative:o,viewTransition:p});function I(F){t&&t(F),F.defaultPrevented||D(F)}let L=T.createElement("a",{...y,...M,href:E||w,onClick:S||a?t:I,ref:iV(g,R),target:c,"data-discover":!x&&n==="render"?"true":void 0});return C&&!x?T.createElement(T.Fragment,null,L,T.createElement(rV,{page:w})):L});V4.displayName="Link";var uV=T.forwardRef(function({"aria-current":t="page",caseSensitive:n=!1,className:r="",end:o=!1,style:a,to:i,viewTransition:s,children:c,...u},f){let p=Zy(i,{relative:u.relative}),y=Mu(),g=T.useContext(Xy),{navigator:b,basename:x}=T.useContext(Ps),E=g!=null&&bV(p)&&s===!0,S=b.encodeLocation?b.encodeLocation(p).pathname:p.pathname,w=y.pathname,C=g&&g.navigation&&g.navigation.location?g.navigation.location.pathname:null;n||(w=w.toLowerCase(),C=C?C.toLowerCase():null,S=S.toLowerCase()),C&&x&&(C=os(C,x)||C);const R=S!=="/"&&S.endsWith("/")?S.length-1:S.length;let M=w===S||!o&&w.startsWith(S)&&w.charAt(R)==="/",D=C!=null&&(C===S||!o&&C.startsWith(S)&&C.charAt(S.length)==="/"),I={isActive:M,isPending:D,isTransitioning:E},L=M?t:void 0,F;typeof r=="function"?F=r(I):F=[r,M?"active":null,D?"pending":null,E?"transitioning":null].filter(Boolean).join(" ");let B=typeof a=="function"?a(I):a;return T.createElement(V4,{...u,"aria-current":L,className:F,ref:f,style:B,to:i,viewTransition:s},typeof c=="function"?c(I):c)});uV.displayName="NavLink";var dV=T.forwardRef(({discover:e="render",fetcherKey:t,navigate:n,reloadDocument:r,replace:o,state:a,method:i=z0,action:s,onSubmit:c,relative:u,preventScrollReset:f,viewTransition:p,...y},g)=>{let b=gV(),x=yV(s,{relative:u}),E=i.toLowerCase()==="get"?"get":"post",S=typeof s=="string"&&U4.test(s),w=C=>{if(c&&c(C),C.defaultPrevented)return;C.preventDefault();let R=C.nativeEvent.submitter,M=R?.getAttribute("formmethod")||i;b(R||C.currentTarget,{fetcherKey:t,method:M,navigate:n,replace:o,state:a,relative:u,preventScrollReset:f,viewTransition:p})};return T.createElement("form",{ref:g,method:E,action:x,onSubmit:r?c:w,...y,"data-discover":!S&&e==="render"?"true":void 0})});dV.displayName="Form";function fV(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function W4(e){let t=T.useContext(Kd);return qn(t,fV(e)),t}function pV(e,{target:t,replace:n,state:r,preventScrollReset:o,relative:a,viewTransition:i}={}){let s=E2(),c=Mu(),u=Zy(e,{relative:a});return T.useCallback(f=>{if(UU(f,t)){f.preventDefault();let p=n!==void 0?n:Tu(c)===Tu(u);s(e,{replace:p,state:r,preventScrollReset:o,relative:a,viewTransition:i})}},[c,s,u,n,r,t,e,o,a,i])}var hV=0,mV=()=>`__${String(++hV)}__`;function gV(){let{router:e}=W4("useSubmit"),{basename:t}=T.useContext(Ps),n=DU();return T.useCallback(async(r,o={})=>{let{action:a,method:i,encType:s,formData:c,body:u}=qU(r,t);if(o.navigate===!1){let f=o.fetcherKey||mV();await e.fetch(f,n,o.action||a,{preventScrollReset:o.preventScrollReset,formData:c,body:u,formMethod:o.method||i,formEncType:o.encType||s,flushSync:o.flushSync})}else await e.navigate(o.action||a,{preventScrollReset:o.preventScrollReset,formData:c,body:u,formMethod:o.method||i,formEncType:o.encType||s,replace:o.replace,state:o.state,fromRouteId:n,flushSync:o.flushSync,viewTransition:o.viewTransition})},[e,t,n])}function yV(e,{relative:t}={}){let{basename:n}=T.useContext(Ps),r=T.useContext(us);qn(r,"useFormAction must be used inside a RouteContext");let[o]=r.matches.slice(-1),a={...Zy(e||".",{relative:t})},i=Mu();if(e==null){a.search=i.search;let s=new URLSearchParams(a.search),c=s.getAll("index");if(c.some(f=>f==="")){s.delete("index"),c.filter(p=>p).forEach(p=>s.append("index",p));let f=s.toString();a.search=f?`?${f}`:""}}return(!e||e===".")&&o.route.index&&(a.search=a.search?a.search.replace(/^\?/,"?index&"):"?index"),n!=="/"&&(a.pathname=a.pathname==="/"?n:ul([n,a.pathname])),Tu(a)}function bV(e,{relative:t}={}){let n=T.useContext(x2);qn(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=W4("useViewTransitionState"),o=Zy(e,{relative:t});if(!n.isTransitioning)return!1;let a=os(n.currentLocation.pathname,r)||n.currentLocation.pathname,i=os(n.nextLocation.pathname,r)||n.nextLocation.pathname;return b1(o.pathname,i)!=null||b1(o.pathname,a)!=null}var Jy=x4();const pu=v4(Jy);function vV(e){return T.createElement(IU,{flushSync:Jy.flushSync,...e})}const xV="modulepreload",SV=function(e){return"/"+e},DN={},co=function(t,n,r){let o=Promise.resolve();if(n&&n.length>0){let i=function(u){return Promise.all(u.map(f=>Promise.resolve(f).then(p=>({status:"fulfilled",value:p}),p=>({status:"rejected",reason:p}))))};document.getElementsByTagName("link");const s=document.querySelector("meta[property=csp-nonce]"),c=s?.nonce||s?.getAttribute("nonce");o=i(n.map(u=>{if(u=SV(u),u in DN)return;DN[u]=!0;const f=u.endsWith(".css"),p=f?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${u}"]${p}`))return;const y=document.createElement("link");if(y.rel=f?"stylesheet":xV,f||(y.as="script"),y.crossOrigin="",y.href=u,c&&y.setAttribute("nonce",c),document.head.appendChild(y),f)return new Promise((g,b)=>{y.addEventListener("load",g),y.addEventListener("error",()=>b(new Error(`Unable to preload CSS for ${u}`)))})}))}function a(i){const s=new Event("vite:preloadError",{cancelable:!0});if(s.payload=i,window.dispatchEvent(s),!s.defaultPrevented)throw i}return o.then(i=>{for(const s of i||[])s.status==="rejected"&&a(s.reason);return t().catch(a)})},Sy={black:"#000",white:"#fff"},Wf={300:"#e57373",400:"#ef5350",500:"#f44336",700:"#d32f2f",800:"#c62828"},qf={50:"#f3e5f5",200:"#ce93d8",300:"#ba68c8",400:"#ab47bc",500:"#9c27b0",700:"#7b1fa2"},Gf={50:"#e3f2fd",200:"#90caf9",400:"#42a5f5",700:"#1976d2",800:"#1565c0"},Yf={300:"#4fc3f7",400:"#29b6f6",500:"#03a9f4",700:"#0288d1",900:"#01579b"},Kf={300:"#81c784",400:"#66bb6a",500:"#4caf50",700:"#388e3c",800:"#2e7d32",900:"#1b5e20"},jm={300:"#ffb74d",400:"#ffa726",500:"#ff9800",700:"#f57c00",900:"#e65100"},EV={50:"#fafafa",100:"#f5f5f5",200:"#eeeeee",300:"#e0e0e0",400:"#bdbdbd",500:"#9e9e9e",600:"#757575",700:"#616161",800:"#424242",900:"#212121",A100:"#f5f5f5",A200:"#eeeeee",A400:"#bdbdbd",A700:"#616161"};function ic(e,...t){const n=new URL(`https://mui.com/production-error/?code=${e}`);return t.forEach(r=>n.searchParams.append("args[]",r)),`Minified MUI error #${e}; visit ${n} for the full message.`}const dl="$$material";function S1(){return S1=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},S1.apply(null,arguments)}function CV(e){if(e.sheet)return e.sheet;for(var t=0;t<document.styleSheets.length;t++)if(document.styleSheets[t].ownerNode===e)return document.styleSheets[t]}function TV(e){var t=document.createElement("style");return t.setAttribute("data-emotion",e.key),e.nonce!==void 0&&t.setAttribute("nonce",e.nonce),t.appendChild(document.createTextNode("")),t.setAttribute("data-s",""),t}var wV=(function(){function e(n){var r=this;this._insertTag=function(o){var a;r.tags.length===0?r.insertionPoint?a=r.insertionPoint.nextSibling:r.prepend?a=r.container.firstChild:a=r.before:a=r.tags[r.tags.length-1].nextSibling,r.container.insertBefore(o,a),r.tags.push(o)},this.isSpeedy=n.speedy===void 0?!0:n.speedy,this.tags=[],this.ctr=0,this.nonce=n.nonce,this.key=n.key,this.container=n.container,this.prepend=n.prepend,this.insertionPoint=n.insertionPoint,this.before=null}var t=e.prototype;return t.hydrate=function(r){r.forEach(this._insertTag)},t.insert=function(r){this.ctr%(this.isSpeedy?65e3:1)===0&&this._insertTag(TV(this));var o=this.tags[this.tags.length-1];if(this.isSpeedy){var a=CV(o);try{a.insertRule(r,a.cssRules.length)}catch{}}else o.appendChild(document.createTextNode(r));this.ctr++},t.flush=function(){this.tags.forEach(function(r){var o;return(o=r.parentNode)==null?void 0:o.removeChild(r)}),this.tags=[],this.ctr=0},e})(),na="-ms-",E1="-moz-",yr="-webkit-",q4="comm",A2="rule",D2="decl",kV="@import",G4="@keyframes",AV="@layer",DV=Math.abs,bx=String.fromCharCode,OV=Object.assign;function RV(e,t){return Zo(e,0)^45?(((t<<2^Zo(e,0))<<2^Zo(e,1))<<2^Zo(e,2))<<2^Zo(e,3):0}function Y4(e){return e.trim()}function MV(e,t){return(e=t.exec(e))?e[0]:e}function br(e,t,n){return e.replace(t,n)}function Tw(e,t){return e.indexOf(t)}function Zo(e,t){return e.charCodeAt(t)|0}function Ey(e,t,n){return e.slice(t,n)}function rl(e){return e.length}function O2(e){return e.length}function o0(e,t){return t.push(e),e}function NV(e,t){return e.map(t).join("")}var vx=1,_p=1,K4=0,qa=0,Ao=0,oh="";function xx(e,t,n,r,o,a,i){return{value:e,root:t,parent:n,type:r,props:o,children:a,line:vx,column:_p,length:i,return:""}}function Bm(e,t){return OV(xx("",null,null,"",null,null,0),e,{length:-e.length},t)}function PV(){return Ao}function IV(){return Ao=qa>0?Zo(oh,--qa):0,_p--,Ao===10&&(_p=1,vx--),Ao}function vi(){return Ao=qa<K4?Zo(oh,qa++):0,_p++,Ao===10&&(_p=1,vx++),Ao}function fl(){return Zo(oh,qa)}function U0(){return qa}function eb(e,t){return Ey(oh,e,t)}function Cy(e){switch(e){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function Q4(e){return vx=_p=1,K4=rl(oh=e),qa=0,[]}function X4(e){return oh="",e}function V0(e){return Y4(eb(qa-1,ww(e===91?e+2:e===40?e+1:e)))}function _V(e){for(;(Ao=fl())&&Ao<33;)vi();return Cy(e)>2||Cy(Ao)>3?"":" "}function LV(e,t){for(;--t&&vi()&&!(Ao<48||Ao>102||Ao>57&&Ao<65||Ao>70&&Ao<97););return eb(e,U0()+(t<6&&fl()==32&&vi()==32))}function ww(e){for(;vi();)switch(Ao){case e:return qa;case 34:case 39:e!==34&&e!==39&&ww(Ao);break;case 40:e===41&&ww(e);break;case 92:vi();break}return qa}function FV(e,t){for(;vi()&&e+Ao!==57;)if(e+Ao===84&&fl()===47)break;return"/*"+eb(t,qa-1)+"*"+bx(e===47?e:vi())}function jV(e){for(;!Cy(fl());)vi();return eb(e,qa)}function BV(e){return X4(W0("",null,null,null,[""],e=Q4(e),0,[0],e))}function W0(e,t,n,r,o,a,i,s,c){for(var u=0,f=0,p=i,y=0,g=0,b=0,x=1,E=1,S=1,w=0,C="",R=o,M=a,D=r,I=C;E;)switch(b=w,w=vi()){case 40:if(b!=108&&Zo(I,p-1)==58){Tw(I+=br(V0(w),"&","&\f"),"&\f")!=-1&&(S=-1);break}case 34:case 39:case 91:I+=V0(w);break;case 9:case 10:case 13:case 32:I+=_V(b);break;case 92:I+=LV(U0()-1,7);continue;case 47:switch(fl()){case 42:case 47:o0($V(FV(vi(),U0()),t,n),c);break;default:I+="/"}break;case 123*x:s[u++]=rl(I)*S;case 125*x:case 59:case 0:switch(w){case 0:case 125:E=0;case 59+f:S==-1&&(I=br(I,/\f/g,"")),g>0&&rl(I)-p&&o0(g>32?RN(I+";",r,n,p-1):RN(br(I," ","")+";",r,n,p-2),c);break;case 59:I+=";";default:if(o0(D=ON(I,t,n,u,f,o,s,C,R=[],M=[],p),a),w===123)if(f===0)W0(I,t,D,D,R,a,p,s,M);else switch(y===99&&Zo(I,3)===110?100:y){case 100:case 108:case 109:case 115:W0(e,D,D,r&&o0(ON(e,D,D,0,0,o,s,C,o,R=[],p),M),o,M,p,s,r?R:M);break;default:W0(I,D,D,D,[""],M,0,s,M)}}u=f=g=0,x=S=1,C=I="",p=i;break;case 58:p=1+rl(I),g=b;default:if(x<1){if(w==123)--x;else if(w==125&&x++==0&&IV()==125)continue}switch(I+=bx(w),w*x){case 38:S=f>0?1:(I+="\f",-1);break;case 44:s[u++]=(rl(I)-1)*S,S=1;break;case 64:fl()===45&&(I+=V0(vi())),y=fl(),f=p=rl(C=I+=jV(U0())),w++;break;case 45:b===45&&rl(I)==2&&(x=0)}}return a}function ON(e,t,n,r,o,a,i,s,c,u,f){for(var p=o-1,y=o===0?a:[""],g=O2(y),b=0,x=0,E=0;b<r;++b)for(var S=0,w=Ey(e,p+1,p=DV(x=i[b])),C=e;S<g;++S)(C=Y4(x>0?y[S]+" "+w:br(w,/&\f/g,y[S])))&&(c[E++]=C);return xx(e,t,n,o===0?A2:s,c,u,f)}function $V(e,t,n){return xx(e,t,n,q4,bx(PV()),Ey(e,2,-2),0)}function RN(e,t,n,r){return xx(e,t,n,D2,Ey(e,0,r),Ey(e,r+1,-1),r)}function Sp(e,t){for(var n="",r=O2(e),o=0;o<r;o++)n+=t(e[o],o,e,t)||"";return n}function zV(e,t,n,r){switch(e.type){case AV:if(e.children.length)break;case kV:case D2:return e.return=e.return||e.value;case q4:return"";case G4:return e.return=e.value+"{"+Sp(e.children,r)+"}";case A2:e.value=e.props.join(",")}return rl(n=Sp(e.children,r))?e.return=e.value+"{"+n+"}":""}function HV(e){var t=O2(e);return function(n,r,o,a){for(var i="",s=0;s<t;s++)i+=e[s](n,r,o,a)||"";return i}}function UV(e){return function(t){t.root||(t=t.return)&&e(t)}}function Z4(e){var t=Object.create(null);return function(n){return t[n]===void 0&&(t[n]=e(n)),t[n]}}var VV=function(t,n,r){for(var o=0,a=0;o=a,a=fl(),o===38&&a===12&&(n[r]=1),!Cy(a);)vi();return eb(t,qa)},WV=function(t,n){var r=-1,o=44;do switch(Cy(o)){case 0:o===38&&fl()===12&&(n[r]=1),t[r]+=VV(qa-1,n,r);break;case 2:t[r]+=V0(o);break;case 4:if(o===44){t[++r]=fl()===58?"&\f":"",n[r]=t[r].length;break}default:t[r]+=bx(o)}while(o=vi());return t},qV=function(t,n){return X4(WV(Q4(t),n))},MN=new WeakMap,GV=function(t){if(!(t.type!=="rule"||!t.parent||t.length<1)){for(var n=t.value,r=t.parent,o=t.column===r.column&&t.line===r.line;r.type!=="rule";)if(r=r.parent,!r)return;if(!(t.props.length===1&&n.charCodeAt(0)!==58&&!MN.get(r))&&!o){MN.set(t,!0);for(var a=[],i=qV(n,a),s=r.props,c=0,u=0;c<i.length;c++)for(var f=0;f<s.length;f++,u++)t.props[u]=a[c]?i[c].replace(/&\f/g,s[f]):s[f]+" "+i[c]}}},YV=function(t){if(t.type==="decl"){var n=t.value;n.charCodeAt(0)===108&&n.charCodeAt(2)===98&&(t.return="",t.value="")}};function J4(e,t){switch(RV(e,t)){case 5103:return yr+"print-"+e+e;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 6391:case 5879:case 5623:case 6135:case 4599:case 4855:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:return yr+e+e;case 5349:case 4246:case 4810:case 6968:case 2756:return yr+e+E1+e+na+e+e;case 6828:case 4268:return yr+e+na+e+e;case 6165:return yr+e+na+"flex-"+e+e;case 5187:return yr+e+br(e,/(\w+).+(:[^]+)/,yr+"box-$1$2"+na+"flex-$1$2")+e;case 5443:return yr+e+na+"flex-item-"+br(e,/flex-|-self/,"")+e;case 4675:return yr+e+na+"flex-line-pack"+br(e,/align-content|flex-|-self/,"")+e;case 5548:return yr+e+na+br(e,"shrink","negative")+e;case 5292:return yr+e+na+br(e,"basis","preferred-size")+e;case 6060:return yr+"box-"+br(e,"-grow","")+yr+e+na+br(e,"grow","positive")+e;case 4554:return yr+br(e,/([^-])(transform)/g,"$1"+yr+"$2")+e;case 6187:return br(br(br(e,/(zoom-|grab)/,yr+"$1"),/(image-set)/,yr+"$1"),e,"")+e;case 5495:case 3959:return br(e,/(image-set\([^]*)/,yr+"$1$`$1");case 4968:return br(br(e,/(.+:)(flex-)?(.*)/,yr+"box-pack:$3"+na+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+yr+e+e;case 4095:case 3583:case 4068:case 2532:return br(e,/(.+)-inline(.+)/,yr+"$1$2")+e;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(rl(e)-1-t>6)switch(Zo(e,t+1)){case 109:if(Zo(e,t+4)!==45)break;case 102:return br(e,/(.+:)(.+)-([^]+)/,"$1"+yr+"$2-$3$1"+E1+(Zo(e,t+3)==108?"$3":"$2-$3"))+e;case 115:return~Tw(e,"stretch")?J4(br(e,"stretch","fill-available"),t)+e:e}break;case 4949:if(Zo(e,t+1)!==115)break;case 6444:switch(Zo(e,rl(e)-3-(~Tw(e,"!important")&&10))){case 107:return br(e,":",":"+yr)+e;case 101:return br(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+yr+(Zo(e,14)===45?"inline-":"")+"box$3$1"+yr+"$2$3$1"+na+"$2box$3")+e}break;case 5936:switch(Zo(e,t+11)){case 114:return yr+e+na+br(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return yr+e+na+br(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return yr+e+na+br(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return yr+e+na+e+e}return e}var KV=function(t,n,r,o){if(t.length>-1&&!t.return)switch(t.type){case D2:t.return=J4(t.value,t.length);break;case G4:return Sp([Bm(t,{value:br(t.value,"@","@"+yr)})],o);case A2:if(t.length)return NV(t.props,function(a){switch(MV(a,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return Sp([Bm(t,{props:[br(a,/:(read-\w+)/,":"+E1+"$1")]})],o);case"::placeholder":return Sp([Bm(t,{props:[br(a,/:(plac\w+)/,":"+yr+"input-$1")]}),Bm(t,{props:[br(a,/:(plac\w+)/,":"+E1+"$1")]}),Bm(t,{props:[br(a,/:(plac\w+)/,na+"input-$1")]})],o)}return""})}},QV=[KV],XV=function(t){var n=t.key;if(n==="css"){var r=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(r,function(x){var E=x.getAttribute("data-emotion");E.indexOf(" ")!==-1&&(document.head.appendChild(x),x.setAttribute("data-s",""))})}var o=t.stylisPlugins||QV,a={},i,s=[];i=t.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+n+' "]'),function(x){for(var E=x.getAttribute("data-emotion").split(" "),S=1;S<E.length;S++)a[E[S]]=!0;s.push(x)});var c,u=[GV,YV];{var f,p=[zV,UV(function(x){f.insert(x)})],y=HV(u.concat(o,p)),g=function(E){return Sp(BV(E),y)};c=function(E,S,w,C){f=w,g(E?E+"{"+S.styles+"}":S.styles),C&&(b.inserted[S.name]=!0)}}var b={key:n,sheet:new wV({key:n,container:i,nonce:t.nonce,speedy:t.speedy,prepend:t.prepend,insertionPoint:t.insertionPoint}),nonce:t.nonce,inserted:a,registered:{},insert:c};return b.sheet.hydrate(s),b},eT={exports:{}},xr={};/** @license React v16.13.1
63
63
  * react-is.production.min.js
64
64
  *
65
65
  * Copyright (c) Facebook, Inc. and its affiliates.
@@ -216,7 +216,7 @@ export default theme;`}function lP(e){return typeof e=="number"?`${(e*100).toFix
216
216
  `)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...n){const r=new this(t);return n.forEach(o=>r.set(o)),r}static accessor(t){const r=(this[wI]=this[wI]={accessors:{}}).accessors,o=this.prototype;function a(i){const s=qm(i);r[s]||(Mre(o,i),r[s]=!0)}return Ge.isArray(t)?t.forEach(a):a(t),this}};Ua.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);Ge.reduceDescriptors(Ua.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(r){this[n]=r}}});Ge.freezeMethods(Ua);function mT(e,t){const n=this||hb,r=t||n,o=Ua.from(r.headers);let a=r.data;return Ge.forEach(e,function(s){a=s.call(n,a,o.normalize(),t?t.status:void 0)}),o.normalize(),a}function GF(e){return!!(e&&e.__CANCEL__)}function hh(e,t,n){Nn.call(this,e??"canceled",Nn.ERR_CANCELED,t,n),this.name="CanceledError"}Ge.inherits(hh,Nn,{__CANCEL__:!0});function YF(e,t,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?e(n):t(new Nn("Request failed with status code "+n.status,[Nn.ERR_BAD_REQUEST,Nn.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function Nre(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function Pre(e,t){e=e||10;const n=new Array(e),r=new Array(e);let o=0,a=0,i;return t=t!==void 0?t:1e3,function(c){const u=Date.now(),f=r[a];i||(i=u),n[o]=c,r[o]=u;let p=a,y=0;for(;p!==o;)y+=n[p++],p=p%e;if(o=(o+1)%e,o===a&&(a=(a+1)%e),u-i<t)return;const g=f&&u-f;return g?Math.round(y*1e3/g):void 0}}function Ire(e,t){let n=0,r=1e3/t,o,a;const i=(u,f=Date.now())=>{n=f,o=null,a&&(clearTimeout(a),a=null),e(...u)};return[(...u)=>{const f=Date.now(),p=f-n;p>=r?i(u,f):(o=u,a||(a=setTimeout(()=>{a=null,i(o)},r-p)))},()=>o&&i(o)]}const _1=(e,t,n=3)=>{let r=0;const o=Pre(50,250);return Ire(a=>{const i=a.loaded,s=a.lengthComputable?a.total:void 0,c=i-r,u=o(c),f=i<=s;r=i;const p={loaded:i,total:s,progress:s?i/s:void 0,bytes:c,rate:u||void 0,estimated:u&&s&&f?(s-i)/u:void 0,event:a,lengthComputable:s!=null,[t?"download":"upload"]:!0};e(p)},n)},kI=(e,t)=>{const n=e!=null;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},AI=e=>(...t)=>Ge.asap(()=>e(...t)),_re=ra.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,ra.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(ra.origin),ra.navigator&&/(msie|trident)/i.test(ra.navigator.userAgent)):()=>!0,Lre=ra.hasStandardBrowserEnv?{write(e,t,n,r,o,a){const i=[e+"="+encodeURIComponent(t)];Ge.isNumber(n)&&i.push("expires="+new Date(n).toGMTString()),Ge.isString(r)&&i.push("path="+r),Ge.isString(o)&&i.push("domain="+o),a===!0&&i.push("secure"),document.cookie=i.join("; ")},read(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function Fre(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function jre(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function KF(e,t,n){let r=!Fre(t);return e&&(r||n==!1)?jre(e,t):t}const DI=e=>e instanceof Ua?{...e}:e;function $d(e,t){t=t||{};const n={};function r(u,f,p,y){return Ge.isPlainObject(u)&&Ge.isPlainObject(f)?Ge.merge.call({caseless:y},u,f):Ge.isPlainObject(f)?Ge.merge({},f):Ge.isArray(f)?f.slice():f}function o(u,f,p,y){if(Ge.isUndefined(f)){if(!Ge.isUndefined(u))return r(void 0,u,p,y)}else return r(u,f,p,y)}function a(u,f){if(!Ge.isUndefined(f))return r(void 0,f)}function i(u,f){if(Ge.isUndefined(f)){if(!Ge.isUndefined(u))return r(void 0,u)}else return r(void 0,f)}function s(u,f,p){if(p in t)return r(u,f);if(p in e)return r(void 0,u)}const c={url:a,method:a,data:a,baseURL:i,transformRequest:i,transformResponse:i,paramsSerializer:i,timeout:i,timeoutMessage:i,withCredentials:i,withXSRFToken:i,adapter:i,responseType:i,xsrfCookieName:i,xsrfHeaderName:i,onUploadProgress:i,onDownloadProgress:i,decompress:i,maxContentLength:i,maxBodyLength:i,beforeRedirect:i,transport:i,httpAgent:i,httpsAgent:i,cancelToken:i,socketPath:i,responseEncoding:i,validateStatus:s,headers:(u,f,p)=>o(DI(u),DI(f),p,!0)};return Ge.forEach(Object.keys({...e,...t}),function(f){const p=c[f]||o,y=p(e[f],t[f],f);Ge.isUndefined(y)&&p!==s||(n[f]=y)}),n}const QF=e=>{const t=$d({},e);let{data:n,withXSRFToken:r,xsrfHeaderName:o,xsrfCookieName:a,headers:i,auth:s}=t;if(t.headers=i=Ua.from(i),t.url=VF(KF(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),s&&i.set("Authorization","Basic "+btoa((s.username||"")+":"+(s.password?unescape(encodeURIComponent(s.password)):""))),Ge.isFormData(n)){if(ra.hasStandardBrowserEnv||ra.hasStandardBrowserWebWorkerEnv)i.setContentType(void 0);else if(Ge.isFunction(n.getHeaders)){const c=n.getHeaders(),u=["content-type","content-length"];Object.entries(c).forEach(([f,p])=>{u.includes(f.toLowerCase())&&i.set(f,p)})}}if(ra.hasStandardBrowserEnv&&(r&&Ge.isFunction(r)&&(r=r(t)),r||r!==!1&&_re(t.url))){const c=o&&a&&Lre.read(a);c&&i.set(o,c)}return t},Bre=typeof XMLHttpRequest<"u",$re=Bre&&function(e){return new Promise(function(n,r){const o=QF(e);let a=o.data;const i=Ua.from(o.headers).normalize();let{responseType:s,onUploadProgress:c,onDownloadProgress:u}=o,f,p,y,g,b;function x(){g&&g(),b&&b(),o.cancelToken&&o.cancelToken.unsubscribe(f),o.signal&&o.signal.removeEventListener("abort",f)}let E=new XMLHttpRequest;E.open(o.method.toUpperCase(),o.url,!0),E.timeout=o.timeout;function S(){if(!E)return;const C=Ua.from("getAllResponseHeaders"in E&&E.getAllResponseHeaders()),M={data:!s||s==="text"||s==="json"?E.responseText:E.response,status:E.status,statusText:E.statusText,headers:C,config:e,request:E};YF(function(I){n(I),x()},function(I){r(I),x()},M),E=null}"onloadend"in E?E.onloadend=S:E.onreadystatechange=function(){!E||E.readyState!==4||E.status===0&&!(E.responseURL&&E.responseURL.indexOf("file:")===0)||setTimeout(S)},E.onabort=function(){E&&(r(new Nn("Request aborted",Nn.ECONNABORTED,e,E)),E=null)},E.onerror=function(R){const M=R&&R.message?R.message:"Network Error",D=new Nn(M,Nn.ERR_NETWORK,e,E);D.event=R||null,r(D),E=null},E.ontimeout=function(){let R=o.timeout?"timeout of "+o.timeout+"ms exceeded":"timeout exceeded";const M=o.transitional||WF;o.timeoutErrorMessage&&(R=o.timeoutErrorMessage),r(new Nn(R,M.clarifyTimeoutError?Nn.ETIMEDOUT:Nn.ECONNABORTED,e,E)),E=null},a===void 0&&i.setContentType(null),"setRequestHeader"in E&&Ge.forEach(i.toJSON(),function(R,M){E.setRequestHeader(M,R)}),Ge.isUndefined(o.withCredentials)||(E.withCredentials=!!o.withCredentials),s&&s!=="json"&&(E.responseType=o.responseType),u&&([y,b]=_1(u,!0),E.addEventListener("progress",y)),c&&E.upload&&([p,g]=_1(c),E.upload.addEventListener("progress",p),E.upload.addEventListener("loadend",g)),(o.cancelToken||o.signal)&&(f=C=>{E&&(r(!C||C.type?new hh(null,e,E):C),E.abort(),E=null)},o.cancelToken&&o.cancelToken.subscribe(f),o.signal&&(o.signal.aborted?f():o.signal.addEventListener("abort",f)));const w=Nre(o.url);if(w&&ra.protocols.indexOf(w)===-1){r(new Nn("Unsupported protocol "+w+":",Nn.ERR_BAD_REQUEST,e));return}E.send(a||null)})},zre=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let r=new AbortController,o;const a=function(u){if(!o){o=!0,s();const f=u instanceof Error?u:this.reason;r.abort(f instanceof Nn?f:new hh(f instanceof Error?f.message:f))}};let i=t&&setTimeout(()=>{i=null,a(new Nn(`timeout ${t} of ms exceeded`,Nn.ETIMEDOUT))},t);const s=()=>{e&&(i&&clearTimeout(i),i=null,e.forEach(u=>{u.unsubscribe?u.unsubscribe(a):u.removeEventListener("abort",a)}),e=null)};e.forEach(u=>u.addEventListener("abort",a));const{signal:c}=r;return c.unsubscribe=()=>Ge.asap(s),c}},Hre=function*(e,t){let n=e.byteLength;if(n<t){yield e;return}let r=0,o;for(;r<n;)o=r+t,yield e.slice(r,o),r=o},Ure=async function*(e,t){for await(const n of Vre(e))yield*Hre(n,t)},Vre=async function*(e){if(e[Symbol.asyncIterator]){yield*e;return}const t=e.getReader();try{for(;;){const{done:n,value:r}=await t.read();if(n)break;yield r}}finally{await t.cancel()}},OI=(e,t,n,r)=>{const o=Ure(e,t);let a=0,i,s=c=>{i||(i=!0,r&&r(c))};return new ReadableStream({async pull(c){try{const{done:u,value:f}=await o.next();if(u){s(),c.close();return}let p=f.byteLength;if(n){let y=a+=p;n(y)}c.enqueue(new Uint8Array(f))}catch(u){throw s(u),u}},cancel(c){return s(c),o.return()}},{highWaterMark:2})},RI=64*1024,{isFunction:h0}=Ge,Wre=(({Request:e,Response:t})=>({Request:e,Response:t}))(Ge.global),{ReadableStream:MI,TextEncoder:NI}=Ge.global,PI=(e,...t)=>{try{return!!e(...t)}catch{return!1}},qre=e=>{e=Ge.merge.call({skipUndefined:!0},Wre,e);const{fetch:t,Request:n,Response:r}=e,o=t?h0(t):typeof fetch=="function",a=h0(n),i=h0(r);if(!o)return!1;const s=o&&h0(MI),c=o&&(typeof NI=="function"?(b=>x=>b.encode(x))(new NI):async b=>new Uint8Array(await new n(b).arrayBuffer())),u=a&&s&&PI(()=>{let b=!1;const x=new n(ra.origin,{body:new MI,method:"POST",get duplex(){return b=!0,"half"}}).headers.has("Content-Type");return b&&!x}),f=i&&s&&PI(()=>Ge.isReadableStream(new r("").body)),p={stream:f&&(b=>b.body)};o&&["text","arrayBuffer","blob","formData","stream"].forEach(b=>{!p[b]&&(p[b]=(x,E)=>{let S=x&&x[b];if(S)return S.call(x);throw new Nn(`Response type '${b}' is not supported`,Nn.ERR_NOT_SUPPORT,E)})});const y=async b=>{if(b==null)return 0;if(Ge.isBlob(b))return b.size;if(Ge.isSpecCompliantForm(b))return(await new n(ra.origin,{method:"POST",body:b}).arrayBuffer()).byteLength;if(Ge.isArrayBufferView(b)||Ge.isArrayBuffer(b))return b.byteLength;if(Ge.isURLSearchParams(b)&&(b=b+""),Ge.isString(b))return(await c(b)).byteLength},g=async(b,x)=>{const E=Ge.toFiniteNumber(b.getContentLength());return E??y(x)};return async b=>{let{url:x,method:E,data:S,signal:w,cancelToken:C,timeout:R,onDownloadProgress:M,onUploadProgress:D,responseType:I,headers:L,withCredentials:F="same-origin",fetchOptions:B}=QF(b),U=t||fetch;I=I?(I+"").toLowerCase():"text";let k=zre([w,C&&C.toAbortSignal()],R),$=null;const j=k&&k.unsubscribe&&(()=>{k.unsubscribe()});let V;try{if(D&&u&&E!=="get"&&E!=="head"&&(V=await g(L,S))!==0){let Z=new n(x,{method:"POST",body:S,duplex:"half"}),J;if(Ge.isFormData(S)&&(J=Z.headers.get("content-type"))&&L.setContentType(J),Z.body){const[W,re]=kI(V,_1(AI(D)));S=OI(Z.body,RI,W,re)}}Ge.isString(F)||(F=F?"include":"omit");const z=a&&"credentials"in n.prototype,K={...B,signal:k,method:E.toUpperCase(),headers:L.normalize().toJSON(),body:S,duplex:"half",credentials:z?F:void 0};$=a&&new n(x,K);let Y=await(a?U($,B):U(x,K));const te=f&&(I==="stream"||I==="response");if(f&&(M||te&&j)){const Z={};["status","statusText","headers"].forEach(ne=>{Z[ne]=Y[ne]});const J=Ge.toFiniteNumber(Y.headers.get("content-length")),[W,re]=M&&kI(J,_1(AI(M),!0))||[];Y=new r(OI(Y.body,RI,W,()=>{re&&re(),j&&j()}),Z)}I=I||"text";let _=await p[Ge.findKey(p,I)||"text"](Y,b);return!te&&j&&j(),await new Promise((Z,J)=>{YF(Z,J,{data:_,headers:Ua.from(Y.headers),status:Y.status,statusText:Y.statusText,config:b,request:$})})}catch(z){throw j&&j(),z&&z.name==="TypeError"&&/Load failed|fetch/i.test(z.message)?Object.assign(new Nn("Network Error",Nn.ERR_NETWORK,b,$),{cause:z.cause||z}):Nn.from(z,z&&z.code,b,$)}}},Gre=new Map,XF=e=>{let t=e?e.env:{};const{fetch:n,Request:r,Response:o}=t,a=[r,o,n];let i=a.length,s=i,c,u,f=Gre;for(;s--;)c=a[s],u=f.get(c),u===void 0&&f.set(c,u=s?new Map:qre(t)),f=u;return u};XF();const rk={http:ure,xhr:$re,fetch:{get:XF}};Ge.forEach(rk,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const II=e=>`- ${e}`,Yre=e=>Ge.isFunction(e)||e===null||e===!1,ZF={getAdapter:(e,t)=>{e=Ge.isArray(e)?e:[e];const{length:n}=e;let r,o;const a={};for(let i=0;i<n;i++){r=e[i];let s;if(o=r,!Yre(r)&&(o=rk[(s=String(r)).toLowerCase()],o===void 0))throw new Nn(`Unknown adapter '${s}'`);if(o&&(Ge.isFunction(o)||(o=o.get(t))))break;a[s||"#"+i]=o}if(!o){const i=Object.entries(a).map(([c,u])=>`adapter ${c} `+(u===!1?"is not supported by the environment":"is not available in the build"));let s=n?i.length>1?`since :
217
217
  `+i.map(II).join(`
218
218
  `):" "+II(i[0]):"as no adapter specified";throw new Nn("There is no suitable adapter to dispatch the request "+s,"ERR_NOT_SUPPORT")}return o},adapters:rk};function gT(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new hh(null,e)}function _I(e){return gT(e),e.headers=Ua.from(e.headers),e.data=mT.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),ZF.getAdapter(e.adapter||hb.adapter,e)(e).then(function(r){return gT(e),r.data=mT.call(e,e.transformResponse,r),r.headers=Ua.from(r.headers),r},function(r){return GF(r)||(gT(e),r&&r.response&&(r.response.data=mT.call(e,e.transformResponse,r.response),r.response.headers=Ua.from(r.response.headers))),Promise.reject(r)})}const JF="1.12.2",Qx={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{Qx[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});const LI={};Qx.transitional=function(t,n,r){function o(a,i){return"[Axios v"+JF+"] Transitional option '"+a+"'"+i+(r?". "+r:"")}return(a,i,s)=>{if(t===!1)throw new Nn(o(i," has been removed"+(n?" in "+n:"")),Nn.ERR_DEPRECATED);return n&&!LI[i]&&(LI[i]=!0,console.warn(o(i," has been deprecated since v"+n+" and will be removed in the near future"))),t?t(a,i,s):!0}};Qx.spelling=function(t){return(n,r)=>(console.warn(`${r} is likely a misspelling of ${t}`),!0)};function Kre(e,t,n){if(typeof e!="object")throw new Nn("options must be an object",Nn.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let o=r.length;for(;o-- >0;){const a=r[o],i=t[a];if(i){const s=e[a],c=s===void 0||i(s,a,e);if(c!==!0)throw new Nn("option "+a+" must be "+c,Nn.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new Nn("Unknown option "+a,Nn.ERR_BAD_OPTION)}}const Z0={assertOptions:Kre,validators:Qx},Qs=Z0.validators;let Od=class{constructor(t){this.defaults=t||{},this.interceptors={request:new TI,response:new TI}}async request(t,n){try{return await this._request(t,n)}catch(r){if(r instanceof Error){let o={};Error.captureStackTrace?Error.captureStackTrace(o):o=new Error;const a=o.stack?o.stack.replace(/^.+\n/,""):"";try{r.stack?a&&!String(r.stack).endsWith(a.replace(/^.+\n.+\n/,""))&&(r.stack+=`
219
- `+a):r.stack=a}catch{}}throw r}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=$d(this.defaults,n);const{transitional:r,paramsSerializer:o,headers:a}=n;r!==void 0&&Z0.assertOptions(r,{silentJSONParsing:Qs.transitional(Qs.boolean),forcedJSONParsing:Qs.transitional(Qs.boolean),clarifyTimeoutError:Qs.transitional(Qs.boolean)},!1),o!=null&&(Ge.isFunction(o)?n.paramsSerializer={serialize:o}:Z0.assertOptions(o,{encode:Qs.function,serialize:Qs.function},!0)),n.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),Z0.assertOptions(n,{baseUrl:Qs.spelling("baseURL"),withXsrfToken:Qs.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let i=a&&Ge.merge(a.common,a[n.method]);a&&Ge.forEach(["delete","get","head","post","put","patch","common"],b=>{delete a[b]}),n.headers=Ua.concat(i,a);const s=[];let c=!0;this.interceptors.request.forEach(function(x){typeof x.runWhen=="function"&&x.runWhen(n)===!1||(c=c&&x.synchronous,s.unshift(x.fulfilled,x.rejected))});const u=[];this.interceptors.response.forEach(function(x){u.push(x.fulfilled,x.rejected)});let f,p=0,y;if(!c){const b=[_I.bind(this),void 0];for(b.unshift(...s),b.push(...u),y=b.length,f=Promise.resolve(n);p<y;)f=f.then(b[p++],b[p++]);return f}y=s.length;let g=n;for(;p<y;){const b=s[p++],x=s[p++];try{g=b(g)}catch(E){x.call(this,E);break}}try{f=_I.call(this,g)}catch(b){return Promise.reject(b)}for(p=0,y=u.length;p<y;)f=f.then(u[p++],u[p++]);return f}getUri(t){t=$d(this.defaults,t);const n=KF(t.baseURL,t.url,t.allowAbsoluteUrls);return VF(n,t.params,t.paramsSerializer)}};Ge.forEach(["delete","get","head","options"],function(t){Od.prototype[t]=function(n,r){return this.request($d(r||{},{method:t,url:n,data:(r||{}).data}))}});Ge.forEach(["post","put","patch"],function(t){function n(r){return function(a,i,s){return this.request($d(s||{},{method:t,headers:r?{"Content-Type":"multipart/form-data"}:{},url:a,data:i}))}}Od.prototype[t]=n(),Od.prototype[t+"Form"]=n(!0)});let Qre=class ej{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(a){n=a});const r=this;this.promise.then(o=>{if(!r._listeners)return;let a=r._listeners.length;for(;a-- >0;)r._listeners[a](o);r._listeners=null}),this.promise.then=o=>{let a;const i=new Promise(s=>{r.subscribe(s),a=s}).then(o);return i.cancel=function(){r.unsubscribe(a)},i},t(function(a,i,s){r.reason||(r.reason=new hh(a,i,s),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const t=new AbortController,n=r=>{t.abort(r)};return this.subscribe(n),t.signal.unsubscribe=()=>this.unsubscribe(n),t.signal}static source(){let t;return{token:new ej(function(o){t=o}),cancel:t}}};function Xre(e){return function(n){return e.apply(null,n)}}function Zre(e){return Ge.isObject(e)&&e.isAxiosError===!0}const ok={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(ok).forEach(([e,t])=>{ok[t]=e});function tj(e){const t=new Od(e),n=NF(Od.prototype.request,t);return Ge.extend(n,Od.prototype,t,{allOwnKeys:!0}),Ge.extend(n,t,null,{allOwnKeys:!0}),n.create=function(o){return tj($d(e,o))},n}const _t=tj(hb);_t.Axios=Od;_t.CanceledError=hh;_t.CancelToken=Qre;_t.isCancel=GF;_t.VERSION=JF;_t.toFormData=Kx;_t.AxiosError=Nn;_t.Cancel=_t.CanceledError;_t.all=function(t){return Promise.all(t)};_t.spread=Xre;_t.isAxiosError=Zre;_t.mergeConfig=$d;_t.AxiosHeaders=Ua;_t.formToJSON=e=>qF(Ge.isHTMLForm(e)?new FormData(e):e);_t.getAdapter=ZF.getAdapter;_t.HttpStatusCode=ok;_t.default=_t;const{Axios:$Pe,AxiosError:zPe,CanceledError:HPe,isCancel:UPe,CancelToken:VPe,VERSION:WPe,all:qPe,Cancel:GPe,isAxiosError:YPe,spread:KPe,toFormData:QPe,AxiosHeaders:XPe,HttpStatusCode:ZPe,formToJSON:JPe,getAdapter:eIe,mergeConfig:tIe}=_t,dn="http://localhost/api/v0".replace(/\/+$/,"");let Tl=class{constructor(t,n=dn,r=_t){this.basePath=n,this.axios=r,t&&(this.configuration=t,this.basePath=t.basePath??n)}configuration},Jre=class extends Error{constructor(t,n){super(n),this.field=t,this.name="RequiredError"}};const mn={},gn="https://example.com",st=function(e,t,n){if(n==null)throw new Jre(t,`Required parameter ${t} was null or undefined when calling ${e}.`)};function ak(e,t,n=""){t!=null&&(typeof t=="object"?Array.isArray(t)?t.forEach(r=>ak(e,r,n)):Object.keys(t).forEach(r=>ak(e,t[r],`${n}${n!==""?".":""}${r}`)):e.has(n)?e.append(n,t):e.set(n,t))}const yn=function(e,...t){const n=new URLSearchParams(e.search);ak(n,t),e.search=n.toString()},Xo=function(e,t,n){const r=typeof e!="string";return(r&&n&&n.isJsonMime?n.isJsonMime(t.headers["Content-Type"]):r)?JSON.stringify(e!==void 0?e:{}):e||""},bn=function(e){return e.pathname+e.search+e.hash},vn=function(e,t,n,r){return(o=t,a=n)=>{const i={...e.options,url:(o.defaults.baseURL?"":r?.basePath??a)+e.url};return o.request(i)}},nj={Bigquery:"bigquery",Snowflake:"snowflake",Postgres:"postgres",Gcs:"gcs",S3:"s3",Azure:"azure"},FI={Postgres:"postgres",Bigquery:"bigquery",Snowflake:"snowflake",Trino:"trino",Databricks:"databricks",Mysql:"mysql",Duckdb:"duckdb",Motherduck:"motherduck",Ducklake:"ducklake",Publisher:"publisher"},va={Pending:"PENDING",ManifestRowsReady:"MANIFEST_ROWS_READY",ManifestFileReady:"MANIFEST_FILE_READY",Failed:"FAILED",Cancelled:"CANCELLED"},m0={Version:"version",Package:"package"},eoe=function(e){return{createConnection:async(t,n,r,o={})=>{st("createConnection","environmentName",t),st("createConnection","connectionName",n),st("createConnection","connection",r);const a="/environments/{environmentName}/connections/{connectionName}".replace("{environmentName}",encodeURIComponent(String(t))).replace("{connectionName}",encodeURIComponent(String(n))),i=new URL(a,gn);let s;e&&(s=e.baseOptions);const c={method:"POST",...s,...o},u={},f={};u["Content-Type"]="application/json",yn(i,f);let p=s&&s.headers?s.headers:{};return c.headers={...u,...p,...o.headers},c.data=Xo(r,c,e),{url:bn(i),options:c}},deleteConnection:async(t,n,r={})=>{st("deleteConnection","environmentName",t),st("deleteConnection","connectionName",n);const o="/environments/{environmentName}/connections/{connectionName}".replace("{environmentName}",encodeURIComponent(String(t))).replace("{connectionName}",encodeURIComponent(String(n))),a=new URL(o,gn);let i;e&&(i=e.baseOptions);const s={method:"DELETE",...i,...r},c={};yn(a,{});let u=i&&i.headers?i.headers:{};return s.headers={...c,...u,...r.headers},{url:bn(a),options:s}},getConnection:async(t,n,r={})=>{st("getConnection","environmentName",t),st("getConnection","connectionName",n);const o="/environments/{environmentName}/connections/{connectionName}".replace("{environmentName}",encodeURIComponent(String(t))).replace("{connectionName}",encodeURIComponent(String(n))),a=new URL(o,gn);let i;e&&(i=e.baseOptions);const s={method:"GET",...i,...r},c={};yn(a,{});let u=i&&i.headers?i.headers:{};return s.headers={...c,...u,...r.headers},{url:bn(a),options:s}},getTable:async(t,n,r,o,a={})=>{st("getTable","environmentName",t),st("getTable","connectionName",n),st("getTable","schemaName",r),st("getTable","tablePath",o);const i="/environments/{environmentName}/connections/{connectionName}/schemas/{schemaName}/tables/{tablePath}".replace("{environmentName}",encodeURIComponent(String(t))).replace("{connectionName}",encodeURIComponent(String(n))).replace("{schemaName}",encodeURIComponent(String(r))).replace("{tablePath}",encodeURIComponent(String(o))),s=new URL(i,gn);let c;e&&(c=e.baseOptions);const u={method:"GET",...c,...a},f={};yn(s,{});let p=c&&c.headers?c.headers:{};return u.headers={...f,...p,...a.headers},{url:bn(s),options:u}},getTableInPackage:async(t,n,r,o,a,i={})=>{st("getTableInPackage","environmentName",t),st("getTableInPackage","packageName",n),st("getTableInPackage","connectionName",r),st("getTableInPackage","schemaName",o),st("getTableInPackage","tablePath",a);const s="/environments/{environmentName}/packages/{packageName}/connections/{connectionName}/schemas/{schemaName}/tables/{tablePath}".replace("{environmentName}",encodeURIComponent(String(t))).replace("{packageName}",encodeURIComponent(String(n))).replace("{connectionName}",encodeURIComponent(String(r))).replace("{schemaName}",encodeURIComponent(String(o))).replace("{tablePath}",encodeURIComponent(String(a))),c=new URL(s,gn);let u;e&&(u=e.baseOptions);const f={method:"GET",...u,...i},p={};yn(c,{});let y=u&&u.headers?u.headers:{};return f.headers={...p,...y,...i.headers},{url:bn(c),options:f}},listConnections:async(t,n={})=>{st("listConnections","environmentName",t);const r="/environments/{environmentName}/connections".replace("{environmentName}",encodeURIComponent(String(t))),o=new URL(r,gn);let a;e&&(a=e.baseOptions);const i={method:"GET",...a,...n},s={};yn(o,{});let c=a&&a.headers?a.headers:{};return i.headers={...s,...c,...n.headers},{url:bn(o),options:i}},listSchemas:async(t,n,r={})=>{st("listSchemas","environmentName",t),st("listSchemas","connectionName",n);const o="/environments/{environmentName}/connections/{connectionName}/schemas".replace("{environmentName}",encodeURIComponent(String(t))).replace("{connectionName}",encodeURIComponent(String(n))),a=new URL(o,gn);let i;e&&(i=e.baseOptions);const s={method:"GET",...i,...r},c={};yn(a,{});let u=i&&i.headers?i.headers:{};return s.headers={...c,...u,...r.headers},{url:bn(a),options:s}},listSchemasInPackage:async(t,n,r,o={})=>{st("listSchemasInPackage","environmentName",t),st("listSchemasInPackage","packageName",n),st("listSchemasInPackage","connectionName",r);const a="/environments/{environmentName}/packages/{packageName}/connections/{connectionName}/schemas".replace("{environmentName}",encodeURIComponent(String(t))).replace("{packageName}",encodeURIComponent(String(n))).replace("{connectionName}",encodeURIComponent(String(r))),i=new URL(a,gn);let s;e&&(s=e.baseOptions);const c={method:"GET",...s,...o},u={};yn(i,{});let f=s&&s.headers?s.headers:{};return c.headers={...u,...f,...o.headers},{url:bn(i),options:c}},listTables:async(t,n,r,o,a={})=>{st("listTables","environmentName",t),st("listTables","connectionName",n),st("listTables","schemaName",r);const i="/environments/{environmentName}/connections/{connectionName}/schemas/{schemaName}/tables".replace("{environmentName}",encodeURIComponent(String(t))).replace("{connectionName}",encodeURIComponent(String(n))).replace("{schemaName}",encodeURIComponent(String(r))),s=new URL(i,gn);let c;e&&(c=e.baseOptions);const u={method:"GET",...c,...a},f={},p={};o&&(p.tableNames=o),yn(s,p);let y=c&&c.headers?c.headers:{};return u.headers={...f,...y,...a.headers},{url:bn(s),options:u}},listTablesInPackage:async(t,n,r,o,a,i={})=>{st("listTablesInPackage","environmentName",t),st("listTablesInPackage","packageName",n),st("listTablesInPackage","connectionName",r),st("listTablesInPackage","schemaName",o);const s="/environments/{environmentName}/packages/{packageName}/connections/{connectionName}/schemas/{schemaName}/tables".replace("{environmentName}",encodeURIComponent(String(t))).replace("{packageName}",encodeURIComponent(String(n))).replace("{connectionName}",encodeURIComponent(String(r))).replace("{schemaName}",encodeURIComponent(String(o))),c=new URL(s,gn);let u;e&&(u=e.baseOptions);const f={method:"GET",...u,...i},p={},y={};a&&(y.tableNames=a),yn(c,y);let g=u&&u.headers?u.headers:{};return f.headers={...p,...g,...i.headers},{url:bn(c),options:f}},postQuerydata:async(t,n,r,o={})=>{st("postQuerydata","environmentName",t),st("postQuerydata","connectionName",n),st("postQuerydata","postQuerydataRequest",r);const a="/environments/{environmentName}/connections/{connectionName}/sqlQuery".replace("{environmentName}",encodeURIComponent(String(t))).replace("{connectionName}",encodeURIComponent(String(n))),i=new URL(a,gn);let s;e&&(s=e.baseOptions);const c={method:"POST",...s,...o},u={},f={};u["Content-Type"]="application/json",yn(i,f);let p=s&&s.headers?s.headers:{};return c.headers={...u,...p,...o.headers},c.data=Xo(r,c,e),{url:bn(i),options:c}},postQuerydataInPackage:async(t,n,r,o,a={})=>{st("postQuerydataInPackage","environmentName",t),st("postQuerydataInPackage","packageName",n),st("postQuerydataInPackage","connectionName",r),st("postQuerydataInPackage","postQuerydataRequest",o);const i="/environments/{environmentName}/packages/{packageName}/connections/{connectionName}/sqlQuery".replace("{environmentName}",encodeURIComponent(String(t))).replace("{packageName}",encodeURIComponent(String(n))).replace("{connectionName}",encodeURIComponent(String(r))),s=new URL(i,gn);let c;e&&(c=e.baseOptions);const u={method:"POST",...c,...a},f={},p={};f["Content-Type"]="application/json",yn(s,p);let y=c&&c.headers?c.headers:{};return u.headers={...f,...y,...a.headers},u.data=Xo(o,u,e),{url:bn(s),options:u}},postSqlsource:async(t,n,r,o={})=>{st("postSqlsource","environmentName",t),st("postSqlsource","connectionName",n),st("postSqlsource","postSqlsourceRequest",r);const a="/environments/{environmentName}/connections/{connectionName}/sqlSource".replace("{environmentName}",encodeURIComponent(String(t))).replace("{connectionName}",encodeURIComponent(String(n))),i=new URL(a,gn);let s;e&&(s=e.baseOptions);const c={method:"POST",...s,...o},u={},f={};u["Content-Type"]="application/json",yn(i,f);let p=s&&s.headers?s.headers:{};return c.headers={...u,...p,...o.headers},c.data=Xo(r,c,e),{url:bn(i),options:c}},postSqlsourceInPackage:async(t,n,r,o,a={})=>{st("postSqlsourceInPackage","environmentName",t),st("postSqlsourceInPackage","packageName",n),st("postSqlsourceInPackage","connectionName",r),st("postSqlsourceInPackage","postSqlsourceRequest",o);const i="/environments/{environmentName}/packages/{packageName}/connections/{connectionName}/sqlSource".replace("{environmentName}",encodeURIComponent(String(t))).replace("{packageName}",encodeURIComponent(String(n))).replace("{connectionName}",encodeURIComponent(String(r))),s=new URL(i,gn);let c;e&&(c=e.baseOptions);const u={method:"POST",...c,...a},f={},p={};f["Content-Type"]="application/json",yn(s,p);let y=c&&c.headers?c.headers:{};return u.headers={...f,...y,...a.headers},u.data=Xo(o,u,e),{url:bn(s),options:u}},postTemporarytable:async(t,n,r,o={})=>{st("postTemporarytable","environmentName",t),st("postTemporarytable","connectionName",n),st("postTemporarytable","postSqlsourceRequest",r);const a="/environments/{environmentName}/connections/{connectionName}/sqlTemporaryTable".replace("{environmentName}",encodeURIComponent(String(t))).replace("{connectionName}",encodeURIComponent(String(n))),i=new URL(a,gn);let s;e&&(s=e.baseOptions);const c={method:"POST",...s,...o},u={},f={};u["Content-Type"]="application/json",yn(i,f);let p=s&&s.headers?s.headers:{};return c.headers={...u,...p,...o.headers},c.data=Xo(r,c,e),{url:bn(i),options:c}},postTemporarytableInPackage:async(t,n,r,o,a={})=>{st("postTemporarytableInPackage","environmentName",t),st("postTemporarytableInPackage","packageName",n),st("postTemporarytableInPackage","connectionName",r),st("postTemporarytableInPackage","postSqlsourceRequest",o);const i="/environments/{environmentName}/packages/{packageName}/connections/{connectionName}/sqlTemporaryTable".replace("{environmentName}",encodeURIComponent(String(t))).replace("{packageName}",encodeURIComponent(String(n))).replace("{connectionName}",encodeURIComponent(String(r))),s=new URL(i,gn);let c;e&&(c=e.baseOptions);const u={method:"POST",...c,...a},f={},p={};f["Content-Type"]="application/json",yn(s,p);let y=c&&c.headers?c.headers:{};return u.headers={...f,...y,...a.headers},u.data=Xo(o,u,e),{url:bn(s),options:u}},updateConnection:async(t,n,r,o={})=>{st("updateConnection","environmentName",t),st("updateConnection","connectionName",n),st("updateConnection","updateConnectionRequest",r);const a="/environments/{environmentName}/connections/{connectionName}".replace("{environmentName}",encodeURIComponent(String(t))).replace("{connectionName}",encodeURIComponent(String(n))),i=new URL(a,gn);let s;e&&(s=e.baseOptions);const c={method:"PATCH",...s,...o},u={},f={};u["Content-Type"]="application/json",yn(i,f);let p=s&&s.headers?s.headers:{};return c.headers={...u,...p,...o.headers},c.data=Xo(r,c,e),{url:bn(i),options:c}}}},Qo=function(e){const t=eoe(e);return{async createConnection(n,r,o,a){const i=await t.createConnection(n,r,o,a),s=e?.serverIndex??0,c=mn["ConnectionsApi.createConnection"]?.[s]?.url;return(u,f)=>vn(i,_t,dn,e)(u,c||f)},async deleteConnection(n,r,o){const a=await t.deleteConnection(n,r,o),i=e?.serverIndex??0,s=mn["ConnectionsApi.deleteConnection"]?.[i]?.url;return(c,u)=>vn(a,_t,dn,e)(c,s||u)},async getConnection(n,r,o){const a=await t.getConnection(n,r,o),i=e?.serverIndex??0,s=mn["ConnectionsApi.getConnection"]?.[i]?.url;return(c,u)=>vn(a,_t,dn,e)(c,s||u)},async getTable(n,r,o,a,i){const s=await t.getTable(n,r,o,a,i),c=e?.serverIndex??0,u=mn["ConnectionsApi.getTable"]?.[c]?.url;return(f,p)=>vn(s,_t,dn,e)(f,u||p)},async getTableInPackage(n,r,o,a,i,s){const c=await t.getTableInPackage(n,r,o,a,i,s),u=e?.serverIndex??0,f=mn["ConnectionsApi.getTableInPackage"]?.[u]?.url;return(p,y)=>vn(c,_t,dn,e)(p,f||y)},async listConnections(n,r){const o=await t.listConnections(n,r),a=e?.serverIndex??0,i=mn["ConnectionsApi.listConnections"]?.[a]?.url;return(s,c)=>vn(o,_t,dn,e)(s,i||c)},async listSchemas(n,r,o){const a=await t.listSchemas(n,r,o),i=e?.serverIndex??0,s=mn["ConnectionsApi.listSchemas"]?.[i]?.url;return(c,u)=>vn(a,_t,dn,e)(c,s||u)},async listSchemasInPackage(n,r,o,a){const i=await t.listSchemasInPackage(n,r,o,a),s=e?.serverIndex??0,c=mn["ConnectionsApi.listSchemasInPackage"]?.[s]?.url;return(u,f)=>vn(i,_t,dn,e)(u,c||f)},async listTables(n,r,o,a,i){const s=await t.listTables(n,r,o,a,i),c=e?.serverIndex??0,u=mn["ConnectionsApi.listTables"]?.[c]?.url;return(f,p)=>vn(s,_t,dn,e)(f,u||p)},async listTablesInPackage(n,r,o,a,i,s){const c=await t.listTablesInPackage(n,r,o,a,i,s),u=e?.serverIndex??0,f=mn["ConnectionsApi.listTablesInPackage"]?.[u]?.url;return(p,y)=>vn(c,_t,dn,e)(p,f||y)},async postQuerydata(n,r,o,a){const i=await t.postQuerydata(n,r,o,a),s=e?.serverIndex??0,c=mn["ConnectionsApi.postQuerydata"]?.[s]?.url;return(u,f)=>vn(i,_t,dn,e)(u,c||f)},async postQuerydataInPackage(n,r,o,a,i){const s=await t.postQuerydataInPackage(n,r,o,a,i),c=e?.serverIndex??0,u=mn["ConnectionsApi.postQuerydataInPackage"]?.[c]?.url;return(f,p)=>vn(s,_t,dn,e)(f,u||p)},async postSqlsource(n,r,o,a){const i=await t.postSqlsource(n,r,o,a),s=e?.serverIndex??0,c=mn["ConnectionsApi.postSqlsource"]?.[s]?.url;return(u,f)=>vn(i,_t,dn,e)(u,c||f)},async postSqlsourceInPackage(n,r,o,a,i){const s=await t.postSqlsourceInPackage(n,r,o,a,i),c=e?.serverIndex??0,u=mn["ConnectionsApi.postSqlsourceInPackage"]?.[c]?.url;return(f,p)=>vn(s,_t,dn,e)(f,u||p)},async postTemporarytable(n,r,o,a){const i=await t.postTemporarytable(n,r,o,a),s=e?.serverIndex??0,c=mn["ConnectionsApi.postTemporarytable"]?.[s]?.url;return(u,f)=>vn(i,_t,dn,e)(u,c||f)},async postTemporarytableInPackage(n,r,o,a,i){const s=await t.postTemporarytableInPackage(n,r,o,a,i),c=e?.serverIndex??0,u=mn["ConnectionsApi.postTemporarytableInPackage"]?.[c]?.url;return(f,p)=>vn(s,_t,dn,e)(f,u||p)},async updateConnection(n,r,o,a){const i=await t.updateConnection(n,r,o,a),s=e?.serverIndex??0,c=mn["ConnectionsApi.updateConnection"]?.[s]?.url;return(u,f)=>vn(i,_t,dn,e)(u,c||f)}}};let toe=class extends Tl{createConnection(t,n,r,o){return Qo(this.configuration).createConnection(t,n,r,o).then(a=>a(this.axios,this.basePath))}deleteConnection(t,n,r){return Qo(this.configuration).deleteConnection(t,n,r).then(o=>o(this.axios,this.basePath))}getConnection(t,n,r){return Qo(this.configuration).getConnection(t,n,r).then(o=>o(this.axios,this.basePath))}getTable(t,n,r,o,a){return Qo(this.configuration).getTable(t,n,r,o,a).then(i=>i(this.axios,this.basePath))}getTableInPackage(t,n,r,o,a,i){return Qo(this.configuration).getTableInPackage(t,n,r,o,a,i).then(s=>s(this.axios,this.basePath))}listConnections(t,n){return Qo(this.configuration).listConnections(t,n).then(r=>r(this.axios,this.basePath))}listSchemas(t,n,r){return Qo(this.configuration).listSchemas(t,n,r).then(o=>o(this.axios,this.basePath))}listSchemasInPackage(t,n,r,o){return Qo(this.configuration).listSchemasInPackage(t,n,r,o).then(a=>a(this.axios,this.basePath))}listTables(t,n,r,o,a){return Qo(this.configuration).listTables(t,n,r,o,a).then(i=>i(this.axios,this.basePath))}listTablesInPackage(t,n,r,o,a,i){return Qo(this.configuration).listTablesInPackage(t,n,r,o,a,i).then(s=>s(this.axios,this.basePath))}postQuerydata(t,n,r,o){return Qo(this.configuration).postQuerydata(t,n,r,o).then(a=>a(this.axios,this.basePath))}postQuerydataInPackage(t,n,r,o,a){return Qo(this.configuration).postQuerydataInPackage(t,n,r,o,a).then(i=>i(this.axios,this.basePath))}postSqlsource(t,n,r,o){return Qo(this.configuration).postSqlsource(t,n,r,o).then(a=>a(this.axios,this.basePath))}postSqlsourceInPackage(t,n,r,o,a){return Qo(this.configuration).postSqlsourceInPackage(t,n,r,o,a).then(i=>i(this.axios,this.basePath))}postTemporarytable(t,n,r,o){return Qo(this.configuration).postTemporarytable(t,n,r,o).then(a=>a(this.axios,this.basePath))}postTemporarytableInPackage(t,n,r,o,a){return Qo(this.configuration).postTemporarytableInPackage(t,n,r,o,a).then(i=>i(this.axios,this.basePath))}updateConnection(t,n,r,o){return Qo(this.configuration).updateConnection(t,n,r,o).then(a=>a(this.axios,this.basePath))}};const noe=function(e){return{listDatabases:async(t,n,r,o={})=>{st("listDatabases","environmentName",t),st("listDatabases","packageName",n);const a="/environments/{environmentName}/packages/{packageName}/databases".replace("{environmentName}",encodeURIComponent(String(t))).replace("{packageName}",encodeURIComponent(String(n))),i=new URL(a,gn);let s;e&&(s=e.baseOptions);const c={method:"GET",...s,...o},u={},f={};r!==void 0&&(f.versionId=r),yn(i,f);let p=s&&s.headers?s.headers:{};return c.headers={...u,...p,...o.headers},{url:bn(i),options:c}}}},roe=function(e){const t=noe(e);return{async listDatabases(n,r,o,a){const i=await t.listDatabases(n,r,o,a),s=e?.serverIndex??0,c=mn["DatabasesApi.listDatabases"]?.[s]?.url;return(u,f)=>vn(i,_t,dn,e)(u,c||f)}}};let ooe=class extends Tl{listDatabases(t,n,r,o){return roe(this.configuration).listDatabases(t,n,r,o).then(a=>a(this.axios,this.basePath))}};const aoe=function(e){return{createEnvironment:async(t,n={})=>{st("createEnvironment","environment",t);const r="/environments",o=new URL(r,gn);let a;e&&(a=e.baseOptions);const i={method:"POST",...a,...n},s={},c={};s["Content-Type"]="application/json",yn(o,c);let u=a&&a.headers?a.headers:{};return i.headers={...s,...u,...n.headers},i.data=Xo(t,i,e),{url:bn(o),options:i}},deleteEnvironment:async(t,n={})=>{st("deleteEnvironment","environmentName",t);const r="/environments/{environmentName}".replace("{environmentName}",encodeURIComponent(String(t))),o=new URL(r,gn);let a;e&&(a=e.baseOptions);const i={method:"DELETE",...a,...n},s={};yn(o,{});let c=a&&a.headers?a.headers:{};return i.headers={...s,...c,...n.headers},{url:bn(o),options:i}},getEnvironment:async(t,n,r={})=>{st("getEnvironment","environmentName",t);const o="/environments/{environmentName}".replace("{environmentName}",encodeURIComponent(String(t))),a=new URL(o,gn);let i;e&&(i=e.baseOptions);const s={method:"GET",...i,...r},c={},u={};n!==void 0&&(u.reload=n),yn(a,u);let f=i&&i.headers?i.headers:{};return s.headers={...c,...f,...r.headers},{url:bn(a),options:s}},listEnvironments:async(t={})=>{const n="/environments",r=new URL(n,gn);let o;e&&(o=e.baseOptions);const a={method:"GET",...o,...t},i={};yn(r,{});let s=o&&o.headers?o.headers:{};return a.headers={...i,...s,...t.headers},{url:bn(r),options:a}},updateEnvironment:async(t,n,r={})=>{st("updateEnvironment","environmentName",t),st("updateEnvironment","environment",n);const o="/environments/{environmentName}".replace("{environmentName}",encodeURIComponent(String(t))),a=new URL(o,gn);let i;e&&(i=e.baseOptions);const s={method:"PATCH",...i,...r},c={},u={};c["Content-Type"]="application/json",yn(a,u);let f=i&&i.headers?i.headers:{};return s.headers={...c,...f,...r.headers},s.data=Xo(n,s,e),{url:bn(a),options:s}}}},Gm=function(e){const t=aoe(e);return{async createEnvironment(n,r){const o=await t.createEnvironment(n,r),a=e?.serverIndex??0,i=mn["EnvironmentsApi.createEnvironment"]?.[a]?.url;return(s,c)=>vn(o,_t,dn,e)(s,i||c)},async deleteEnvironment(n,r){const o=await t.deleteEnvironment(n,r),a=e?.serverIndex??0,i=mn["EnvironmentsApi.deleteEnvironment"]?.[a]?.url;return(s,c)=>vn(o,_t,dn,e)(s,i||c)},async getEnvironment(n,r,o){const a=await t.getEnvironment(n,r,o),i=e?.serverIndex??0,s=mn["EnvironmentsApi.getEnvironment"]?.[i]?.url;return(c,u)=>vn(a,_t,dn,e)(c,s||u)},async listEnvironments(n){const r=await t.listEnvironments(n),o=e?.serverIndex??0,a=mn["EnvironmentsApi.listEnvironments"]?.[o]?.url;return(i,s)=>vn(r,_t,dn,e)(i,a||s)},async updateEnvironment(n,r,o){const a=await t.updateEnvironment(n,r,o),i=e?.serverIndex??0,s=mn["EnvironmentsApi.updateEnvironment"]?.[i]?.url;return(c,u)=>vn(a,_t,dn,e)(c,s||u)}}};let ioe=class extends Tl{createEnvironment(t,n){return Gm(this.configuration).createEnvironment(t,n).then(r=>r(this.axios,this.basePath))}deleteEnvironment(t,n){return Gm(this.configuration).deleteEnvironment(t,n).then(r=>r(this.axios,this.basePath))}getEnvironment(t,n,r){return Gm(this.configuration).getEnvironment(t,n,r).then(o=>o(this.axios,this.basePath))}listEnvironments(t){return Gm(this.configuration).listEnvironments(t).then(n=>n(this.axios,this.basePath))}updateEnvironment(t,n,r){return Gm(this.configuration).updateEnvironment(t,n,r).then(o=>o(this.axios,this.basePath))}};const soe=function(e){return{createMaterialization:async(t,n,r,o={})=>{st("createMaterialization","environmentName",t),st("createMaterialization","packageName",n);const a="/environments/{environmentName}/packages/{packageName}/materializations".replace("{environmentName}",encodeURIComponent(String(t))).replace("{packageName}",encodeURIComponent(String(n))),i=new URL(a,gn);let s;e&&(s=e.baseOptions);const c={method:"POST",...s,...o},u={},f={};u["Content-Type"]="application/json",yn(i,f);let p=s&&s.headers?s.headers:{};return c.headers={...u,...p,...o.headers},c.data=Xo(r,c,e),{url:bn(i),options:c}},deleteMaterialization:async(t,n,r,o,a={})=>{st("deleteMaterialization","environmentName",t),st("deleteMaterialization","packageName",n),st("deleteMaterialization","materializationId",r);const i="/environments/{environmentName}/packages/{packageName}/materializations/{materializationId}".replace("{environmentName}",encodeURIComponent(String(t))).replace("{packageName}",encodeURIComponent(String(n))).replace("{materializationId}",encodeURIComponent(String(r))),s=new URL(i,gn);let c;e&&(c=e.baseOptions);const u={method:"DELETE",...c,...a},f={},p={};o!==void 0&&(p.dropTables=o),yn(s,p);let y=c&&c.headers?c.headers:{};return u.headers={...f,...y,...a.headers},{url:bn(s),options:u}},getMaterialization:async(t,n,r,o={})=>{st("getMaterialization","environmentName",t),st("getMaterialization","packageName",n),st("getMaterialization","materializationId",r);const a="/environments/{environmentName}/packages/{packageName}/materializations/{materializationId}".replace("{environmentName}",encodeURIComponent(String(t))).replace("{packageName}",encodeURIComponent(String(n))).replace("{materializationId}",encodeURIComponent(String(r))),i=new URL(a,gn);let s;e&&(s=e.baseOptions);const c={method:"GET",...s,...o},u={};yn(i,{});let f=s&&s.headers?s.headers:{};return c.headers={...u,...f,...o.headers},{url:bn(i),options:c}},listEnvironmentMaterializations:async(t,n,r,o={})=>{st("listEnvironmentMaterializations","environmentName",t);const a="/environments/{environmentName}/packages/materializations".replace("{environmentName}",encodeURIComponent(String(t))),i=new URL(a,gn);let s;e&&(s=e.baseOptions);const c={method:"GET",...s,...o},u={},f={};n!==void 0&&(f.limit=n),r!==void 0&&(f.offset=r),yn(i,f);let p=s&&s.headers?s.headers:{};return c.headers={...u,...p,...o.headers},{url:bn(i),options:c}},listMaterializations:async(t,n,r,o,a={})=>{st("listMaterializations","environmentName",t),st("listMaterializations","packageName",n);const i="/environments/{environmentName}/packages/{packageName}/materializations".replace("{environmentName}",encodeURIComponent(String(t))).replace("{packageName}",encodeURIComponent(String(n))),s=new URL(i,gn);let c;e&&(c=e.baseOptions);const u={method:"GET",...c,...a},f={},p={};r!==void 0&&(p.limit=r),o!==void 0&&(p.offset=o),yn(s,p);let y=c&&c.headers?c.headers:{};return u.headers={...f,...y,...a.headers},{url:bn(s),options:u}},materializationAction:async(t,n,r,o,a={})=>{st("materializationAction","environmentName",t),st("materializationAction","packageName",n),st("materializationAction","materializationId",r),st("materializationAction","action",o);const i="/environments/{environmentName}/packages/{packageName}/materializations/{materializationId}".replace("{environmentName}",encodeURIComponent(String(t))).replace("{packageName}",encodeURIComponent(String(n))).replace("{materializationId}",encodeURIComponent(String(r))),s=new URL(i,gn);let c;e&&(c=e.baseOptions);const u={method:"POST",...c,...a},f={},p={};o!==void 0&&(p.action=o),yn(s,p);let y=c&&c.headers?c.headers:{};return u.headers={...f,...y,...a.headers},{url:bn(s),options:u}}}},Xf=function(e){const t=soe(e);return{async createMaterialization(n,r,o,a){const i=await t.createMaterialization(n,r,o,a),s=e?.serverIndex??0,c=mn["MaterializationsApi.createMaterialization"]?.[s]?.url;return(u,f)=>vn(i,_t,dn,e)(u,c||f)},async deleteMaterialization(n,r,o,a,i){const s=await t.deleteMaterialization(n,r,o,a,i),c=e?.serverIndex??0,u=mn["MaterializationsApi.deleteMaterialization"]?.[c]?.url;return(f,p)=>vn(s,_t,dn,e)(f,u||p)},async getMaterialization(n,r,o,a){const i=await t.getMaterialization(n,r,o,a),s=e?.serverIndex??0,c=mn["MaterializationsApi.getMaterialization"]?.[s]?.url;return(u,f)=>vn(i,_t,dn,e)(u,c||f)},async listEnvironmentMaterializations(n,r,o,a){const i=await t.listEnvironmentMaterializations(n,r,o,a),s=e?.serverIndex??0,c=mn["MaterializationsApi.listEnvironmentMaterializations"]?.[s]?.url;return(u,f)=>vn(i,_t,dn,e)(u,c||f)},async listMaterializations(n,r,o,a,i){const s=await t.listMaterializations(n,r,o,a,i),c=e?.serverIndex??0,u=mn["MaterializationsApi.listMaterializations"]?.[c]?.url;return(f,p)=>vn(s,_t,dn,e)(f,u||p)},async materializationAction(n,r,o,a,i){const s=await t.materializationAction(n,r,o,a,i),c=e?.serverIndex??0,u=mn["MaterializationsApi.materializationAction"]?.[c]?.url;return(f,p)=>vn(s,_t,dn,e)(f,u||p)}}};let loe=class extends Tl{createMaterialization(t,n,r,o){return Xf(this.configuration).createMaterialization(t,n,r,o).then(a=>a(this.axios,this.basePath))}deleteMaterialization(t,n,r,o,a){return Xf(this.configuration).deleteMaterialization(t,n,r,o,a).then(i=>i(this.axios,this.basePath))}getMaterialization(t,n,r,o){return Xf(this.configuration).getMaterialization(t,n,r,o).then(a=>a(this.axios,this.basePath))}listEnvironmentMaterializations(t,n,r,o){return Xf(this.configuration).listEnvironmentMaterializations(t,n,r,o).then(a=>a(this.axios,this.basePath))}listMaterializations(t,n,r,o,a){return Xf(this.configuration).listMaterializations(t,n,r,o,a).then(i=>i(this.axios,this.basePath))}materializationAction(t,n,r,o,a){return Xf(this.configuration).materializationAction(t,n,r,o,a).then(i=>i(this.axios,this.basePath))}};const rj={Stop:"stop"},coe=function(e){return{compileModelSource:async(t,n,r,o,a={})=>{st("compileModelSource","environmentName",t),st("compileModelSource","packageName",n),st("compileModelSource","path",r),st("compileModelSource","compileRequest",o);const i="/environments/{environmentName}/packages/{packageName}/models/{path}/compile".replace("{environmentName}",encodeURIComponent(String(t))).replace("{packageName}",encodeURIComponent(String(n))).replace("{path}",encodeURIComponent(String(r))),s=new URL(i,gn);let c;e&&(c=e.baseOptions);const u={method:"POST",...c,...a},f={},p={};f["Content-Type"]="application/json",yn(s,p);let y=c&&c.headers?c.headers:{};return u.headers={...f,...y,...a.headers},u.data=Xo(o,u,e),{url:bn(s),options:u}},executeQueryModel:async(t,n,r,o,a={})=>{st("executeQueryModel","environmentName",t),st("executeQueryModel","packageName",n),st("executeQueryModel","path",r),st("executeQueryModel","queryRequest",o);const i="/environments/{environmentName}/packages/{packageName}/models/{path}/query".replace("{environmentName}",encodeURIComponent(String(t))).replace("{packageName}",encodeURIComponent(String(n))).replace("{path}",encodeURIComponent(String(r))),s=new URL(i,gn);let c;e&&(c=e.baseOptions);const u={method:"POST",...c,...a},f={},p={};f["Content-Type"]="application/json",yn(s,p);let y=c&&c.headers?c.headers:{};return u.headers={...f,...y,...a.headers},u.data=Xo(o,u,e),{url:bn(s),options:u}},getModel:async(t,n,r,o,a={})=>{st("getModel","environmentName",t),st("getModel","packageName",n),st("getModel","path",r);const i="/environments/{environmentName}/packages/{packageName}/models/{path}".replace("{environmentName}",encodeURIComponent(String(t))).replace("{packageName}",encodeURIComponent(String(n))).replace("{path}",encodeURIComponent(String(r))),s=new URL(i,gn);let c;e&&(c=e.baseOptions);const u={method:"GET",...c,...a},f={},p={};o!==void 0&&(p.versionId=o),yn(s,p);let y=c&&c.headers?c.headers:{};return u.headers={...f,...y,...a.headers},{url:bn(s),options:u}},listModels:async(t,n,r,o={})=>{st("listModels","environmentName",t),st("listModels","packageName",n);const a="/environments/{environmentName}/packages/{packageName}/models".replace("{environmentName}",encodeURIComponent(String(t))).replace("{packageName}",encodeURIComponent(String(n))),i=new URL(a,gn);let s;e&&(s=e.baseOptions);const c={method:"GET",...s,...o},u={},f={};r!==void 0&&(f.versionId=r),yn(i,f);let p=s&&s.headers?s.headers:{};return c.headers={...u,...p,...o.headers},{url:bn(i),options:c}}}},g0=function(e){const t=coe(e);return{async compileModelSource(n,r,o,a,i){const s=await t.compileModelSource(n,r,o,a,i),c=e?.serverIndex??0,u=mn["ModelsApi.compileModelSource"]?.[c]?.url;return(f,p)=>vn(s,_t,dn,e)(f,u||p)},async executeQueryModel(n,r,o,a,i){const s=await t.executeQueryModel(n,r,o,a,i),c=e?.serverIndex??0,u=mn["ModelsApi.executeQueryModel"]?.[c]?.url;return(f,p)=>vn(s,_t,dn,e)(f,u||p)},async getModel(n,r,o,a,i){const s=await t.getModel(n,r,o,a,i),c=e?.serverIndex??0,u=mn["ModelsApi.getModel"]?.[c]?.url;return(f,p)=>vn(s,_t,dn,e)(f,u||p)},async listModels(n,r,o,a){const i=await t.listModels(n,r,o,a),s=e?.serverIndex??0,c=mn["ModelsApi.listModels"]?.[s]?.url;return(u,f)=>vn(i,_t,dn,e)(u,c||f)}}};let uoe=class extends Tl{compileModelSource(t,n,r,o,a){return g0(this.configuration).compileModelSource(t,n,r,o,a).then(i=>i(this.axios,this.basePath))}executeQueryModel(t,n,r,o,a){return g0(this.configuration).executeQueryModel(t,n,r,o,a).then(i=>i(this.axios,this.basePath))}getModel(t,n,r,o,a){return g0(this.configuration).getModel(t,n,r,o,a).then(i=>i(this.axios,this.basePath))}listModels(t,n,r,o){return g0(this.configuration).listModels(t,n,r,o).then(a=>a(this.axios,this.basePath))}};const doe=function(e){return{executeNotebookCell:async(t,n,r,o,a,i,s,c,u={})=>{st("executeNotebookCell","environmentName",t),st("executeNotebookCell","packageName",n),st("executeNotebookCell","path",r),st("executeNotebookCell","cellIndex",o);const f="/environments/{environmentName}/packages/{packageName}/notebooks/{path}/cells/{cellIndex}".replace("{environmentName}",encodeURIComponent(String(t))).replace("{packageName}",encodeURIComponent(String(n))).replace("{path}",encodeURIComponent(String(r))).replace("{cellIndex}",encodeURIComponent(String(o))),p=new URL(f,gn);let y;e&&(y=e.baseOptions);const g={method:"GET",...y,...u},b={},x={};a!==void 0&&(x.versionId=a),i!==void 0&&(x.filter_params=i),s!==void 0&&(x.bypass_filters=s),c!==void 0&&(x.givens=c),yn(p,x);let E=y&&y.headers?y.headers:{};return g.headers={...b,...E,...u.headers},{url:bn(p),options:g}},getNotebook:async(t,n,r,o,a={})=>{st("getNotebook","environmentName",t),st("getNotebook","packageName",n),st("getNotebook","path",r);const i="/environments/{environmentName}/packages/{packageName}/notebooks/{path}".replace("{environmentName}",encodeURIComponent(String(t))).replace("{packageName}",encodeURIComponent(String(n))).replace("{path}",encodeURIComponent(String(r))),s=new URL(i,gn);let c;e&&(c=e.baseOptions);const u={method:"GET",...c,...a},f={},p={};o!==void 0&&(p.versionId=o),yn(s,p);let y=c&&c.headers?c.headers:{};return u.headers={...f,...y,...a.headers},{url:bn(s),options:u}},listNotebooks:async(t,n,r,o={})=>{st("listNotebooks","environmentName",t),st("listNotebooks","packageName",n);const a="/environments/{environmentName}/packages/{packageName}/notebooks".replace("{environmentName}",encodeURIComponent(String(t))).replace("{packageName}",encodeURIComponent(String(n))),i=new URL(a,gn);let s;e&&(s=e.baseOptions);const c={method:"GET",...s,...o},u={},f={};r!==void 0&&(f.versionId=r),yn(i,f);let p=s&&s.headers?s.headers:{};return c.headers={...u,...p,...o.headers},{url:bn(i),options:c}}}},yT=function(e){const t=doe(e);return{async executeNotebookCell(n,r,o,a,i,s,c,u,f){const p=await t.executeNotebookCell(n,r,o,a,i,s,c,u,f),y=e?.serverIndex??0,g=mn["NotebooksApi.executeNotebookCell"]?.[y]?.url;return(b,x)=>vn(p,_t,dn,e)(b,g||x)},async getNotebook(n,r,o,a,i){const s=await t.getNotebook(n,r,o,a,i),c=e?.serverIndex??0,u=mn["NotebooksApi.getNotebook"]?.[c]?.url;return(f,p)=>vn(s,_t,dn,e)(f,u||p)},async listNotebooks(n,r,o,a){const i=await t.listNotebooks(n,r,o,a),s=e?.serverIndex??0,c=mn["NotebooksApi.listNotebooks"]?.[s]?.url;return(u,f)=>vn(i,_t,dn,e)(u,c||f)}}};let foe=class extends Tl{executeNotebookCell(t,n,r,o,a,i,s,c,u){return yT(this.configuration).executeNotebookCell(t,n,r,o,a,i,s,c,u).then(f=>f(this.axios,this.basePath))}getNotebook(t,n,r,o,a){return yT(this.configuration).getNotebook(t,n,r,o,a).then(i=>i(this.axios,this.basePath))}listNotebooks(t,n,r,o){return yT(this.configuration).listNotebooks(t,n,r,o).then(a=>a(this.axios,this.basePath))}};const poe=function(e){return{createPackage:async(t,n,r={})=>{st("createPackage","environmentName",t),st("createPackage","_package",n);const o="/environments/{environmentName}/packages".replace("{environmentName}",encodeURIComponent(String(t))),a=new URL(o,gn);let i;e&&(i=e.baseOptions);const s={method:"POST",...i,...r},c={},u={};c["Content-Type"]="application/json",yn(a,u);let f=i&&i.headers?i.headers:{};return s.headers={...c,...f,...r.headers},s.data=Xo(n,s,e),{url:bn(a),options:s}},deletePackage:async(t,n,r={})=>{st("deletePackage","environmentName",t),st("deletePackage","packageName",n);const o="/environments/{environmentName}/packages/{packageName}".replace("{environmentName}",encodeURIComponent(String(t))).replace("{packageName}",encodeURIComponent(String(n))),a=new URL(o,gn);let i;e&&(i=e.baseOptions);const s={method:"DELETE",...i,...r},c={};yn(a,{});let u=i&&i.headers?i.headers:{};return s.headers={...c,...u,...r.headers},{url:bn(a),options:s}},getPackage:async(t,n,r,o,a={})=>{st("getPackage","environmentName",t),st("getPackage","packageName",n);const i="/environments/{environmentName}/packages/{packageName}".replace("{environmentName}",encodeURIComponent(String(t))).replace("{packageName}",encodeURIComponent(String(n))),s=new URL(i,gn);let c;e&&(c=e.baseOptions);const u={method:"GET",...c,...a},f={},p={};r!==void 0&&(p.versionId=r),o!==void 0&&(p.reload=o),yn(s,p);let y=c&&c.headers?c.headers:{};return u.headers={...f,...y,...a.headers},{url:bn(s),options:u}},listPackages:async(t,n={})=>{st("listPackages","environmentName",t);const r="/environments/{environmentName}/packages".replace("{environmentName}",encodeURIComponent(String(t))),o=new URL(r,gn);let a;e&&(a=e.baseOptions);const i={method:"GET",...a,...n},s={};yn(o,{});let c=a&&a.headers?a.headers:{};return i.headers={...s,...c,...n.headers},{url:bn(o),options:i}},updatePackage:async(t,n,r,o={})=>{st("updatePackage","environmentName",t),st("updatePackage","packageName",n),st("updatePackage","_package",r);const a="/environments/{environmentName}/packages/{packageName}".replace("{environmentName}",encodeURIComponent(String(t))).replace("{packageName}",encodeURIComponent(String(n))),i=new URL(a,gn);let s;e&&(s=e.baseOptions);const c={method:"PATCH",...s,...o},u={},f={};u["Content-Type"]="application/json",yn(i,f);let p=s&&s.headers?s.headers:{};return c.headers={...u,...p,...o.headers},c.data=Xo(r,c,e),{url:bn(i),options:c}}}},Ym=function(e){const t=poe(e);return{async createPackage(n,r,o){const a=await t.createPackage(n,r,o),i=e?.serverIndex??0,s=mn["PackagesApi.createPackage"]?.[i]?.url;return(c,u)=>vn(a,_t,dn,e)(c,s||u)},async deletePackage(n,r,o){const a=await t.deletePackage(n,r,o),i=e?.serverIndex??0,s=mn["PackagesApi.deletePackage"]?.[i]?.url;return(c,u)=>vn(a,_t,dn,e)(c,s||u)},async getPackage(n,r,o,a,i){const s=await t.getPackage(n,r,o,a,i),c=e?.serverIndex??0,u=mn["PackagesApi.getPackage"]?.[c]?.url;return(f,p)=>vn(s,_t,dn,e)(f,u||p)},async listPackages(n,r){const o=await t.listPackages(n,r),a=e?.serverIndex??0,i=mn["PackagesApi.listPackages"]?.[a]?.url;return(s,c)=>vn(o,_t,dn,e)(s,i||c)},async updatePackage(n,r,o,a){const i=await t.updatePackage(n,r,o,a),s=e?.serverIndex??0,c=mn["PackagesApi.updatePackage"]?.[s]?.url;return(u,f)=>vn(i,_t,dn,e)(u,c||f)}}};let hoe=class extends Tl{createPackage(t,n,r){return Ym(this.configuration).createPackage(t,n,r).then(o=>o(this.axios,this.basePath))}deletePackage(t,n,r){return Ym(this.configuration).deletePackage(t,n,r).then(o=>o(this.axios,this.basePath))}getPackage(t,n,r,o,a){return Ym(this.configuration).getPackage(t,n,r,o,a).then(i=>i(this.axios,this.basePath))}listPackages(t,n){return Ym(this.configuration).listPackages(t,n).then(r=>r(this.axios,this.basePath))}updatePackage(t,n,r,o){return Ym(this.configuration).updatePackage(t,n,r,o).then(a=>a(this.axios,this.basePath))}};const moe=function(e){return{listPages:async(t,n,r={})=>{st("listPages","environmentName",t),st("listPages","packageName",n);const o="/environments/{environmentName}/packages/{packageName}/pages".replace("{environmentName}",encodeURIComponent(String(t))).replace("{packageName}",encodeURIComponent(String(n))),a=new URL(o,gn);let i;e&&(i=e.baseOptions);const s={method:"GET",...i,...r},c={};yn(a,{});let u=i&&i.headers?i.headers:{};return s.headers={...c,...u,...r.headers},{url:bn(a),options:s}}}},goe=function(e){const t=moe(e);return{async listPages(n,r,o){const a=await t.listPages(n,r,o),i=e?.serverIndex??0,s=mn["PagesApi.listPages"]?.[i]?.url;return(c,u)=>vn(a,_t,dn,e)(c,s||u)}}};let yoe=class extends Tl{listPages(t,n,r){return goe(this.configuration).listPages(t,n,r).then(o=>o(this.axios,this.basePath))}};const boe=function(e){return{deleteTheme:async(t={})=>{const n="/theme",r=new URL(n,gn);let o;e&&(o=e.baseOptions);const a={method:"DELETE",...o,...t},i={};yn(r,{});let s=o&&o.headers?o.headers:{};return a.headers={...i,...s,...t.headers},{url:bn(r),options:a}},getStatus:async(t={})=>{const n="/status",r=new URL(n,gn);let o;e&&(o=e.baseOptions);const a={method:"GET",...o,...t},i={};yn(r,{});let s=o&&o.headers?o.headers:{};return a.headers={...i,...s,...t.headers},{url:bn(r),options:a}},getTheme:async(t={})=>{const n="/theme",r=new URL(n,gn);let o;e&&(o=e.baseOptions);const a={method:"GET",...o,...t},i={};yn(r,{});let s=o&&o.headers?o.headers:{};return a.headers={...i,...s,...t.headers},{url:bn(r),options:a}},updateTheme:async(t,n={})=>{st("updateTheme","theme",t);const r="/theme",o=new URL(r,gn);let a;e&&(a=e.baseOptions);const i={method:"PUT",...a,...n},s={},c={};s["Content-Type"]="application/json",yn(o,c);let u=a&&a.headers?a.headers:{};return i.headers={...s,...u,...n.headers},i.data=Xo(t,i,e),{url:bn(o),options:i}}}},y0=function(e){const t=boe(e);return{async deleteTheme(n){const r=await t.deleteTheme(n),o=e?.serverIndex??0,a=mn["PublisherApi.deleteTheme"]?.[o]?.url;return(i,s)=>vn(r,_t,dn,e)(i,a||s)},async getStatus(n){const r=await t.getStatus(n),o=e?.serverIndex??0,a=mn["PublisherApi.getStatus"]?.[o]?.url;return(i,s)=>vn(r,_t,dn,e)(i,a||s)},async getTheme(n){const r=await t.getTheme(n),o=e?.serverIndex??0,a=mn["PublisherApi.getTheme"]?.[o]?.url;return(i,s)=>vn(r,_t,dn,e)(i,a||s)},async updateTheme(n,r){const o=await t.updateTheme(n,r),a=e?.serverIndex??0,i=mn["PublisherApi.updateTheme"]?.[a]?.url;return(s,c)=>vn(o,_t,dn,e)(s,i||c)}}};let voe=class extends Tl{deleteTheme(t){return y0(this.configuration).deleteTheme(t).then(n=>n(this.axios,this.basePath))}getStatus(t){return y0(this.configuration).getStatus(t).then(n=>n(this.axios,this.basePath))}getTheme(t){return y0(this.configuration).getTheme(t).then(n=>n(this.axios,this.basePath))}updateTheme(t,n){return y0(this.configuration).updateTheme(t,n).then(r=>r(this.axios,this.basePath))}};const xoe=function(e){return{getWatchStatus:async(t={})=>{const n="/watch-mode/status",r=new URL(n,gn);let o;e&&(o=e.baseOptions);const a={method:"GET",...o,...t},i={};yn(r,{});let s=o&&o.headers?o.headers:{};return a.headers={...i,...s,...t.headers},{url:bn(r),options:a}},startWatching:async(t,n={})=>{st("startWatching","startWatchRequest",t);const r="/watch-mode/start",o=new URL(r,gn);let a;e&&(a=e.baseOptions);const i={method:"POST",...a,...n},s={},c={};s["Content-Type"]="application/json",yn(o,c);let u=a&&a.headers?a.headers:{};return i.headers={...s,...u,...n.headers},i.data=Xo(t,i,e),{url:bn(o),options:i}},stopWatching:async(t={})=>{const n="/watch-mode/stop",r=new URL(n,gn);let o;e&&(o=e.baseOptions);const a={method:"POST",...o,...t},i={};yn(r,{});let s=o&&o.headers?o.headers:{};return a.headers={...i,...s,...t.headers},{url:bn(r),options:a}},streamPackageEvents:async(t,n,r={})=>{st("streamPackageEvents","environmentName",t),st("streamPackageEvents","packageName",n);const o="/environments/{environmentName}/packages/{packageName}/events".replace("{environmentName}",encodeURIComponent(String(t))).replace("{packageName}",encodeURIComponent(String(n))),a=new URL(o,gn);let i;e&&(i=e.baseOptions);const s={method:"GET",...i,...r},c={};yn(a,{});let u=i&&i.headers?i.headers:{};return s.headers={...c,...u,...r.headers},{url:bn(a),options:s}}}},b0=function(e){const t=xoe(e);return{async getWatchStatus(n){const r=await t.getWatchStatus(n),o=e?.serverIndex??0,a=mn["WatchModeApi.getWatchStatus"]?.[o]?.url;return(i,s)=>vn(r,_t,dn,e)(i,a||s)},async startWatching(n,r){const o=await t.startWatching(n,r),a=e?.serverIndex??0,i=mn["WatchModeApi.startWatching"]?.[a]?.url;return(s,c)=>vn(o,_t,dn,e)(s,i||c)},async stopWatching(n){const r=await t.stopWatching(n),o=e?.serverIndex??0,a=mn["WatchModeApi.stopWatching"]?.[o]?.url;return(i,s)=>vn(r,_t,dn,e)(i,a||s)},async streamPackageEvents(n,r,o){const a=await t.streamPackageEvents(n,r,o),i=e?.serverIndex??0,s=mn["WatchModeApi.streamPackageEvents"]?.[i]?.url;return(c,u)=>vn(a,_t,dn,e)(c,s||u)}}};let Soe=class extends Tl{getWatchStatus(t){return b0(this.configuration).getWatchStatus(t).then(n=>n(this.axios,this.basePath))}startWatching(t,n){return b0(this.configuration).startWatching(t,n).then(r=>r(this.axios,this.basePath))}stopWatching(t){return b0(this.configuration).stopWatching(t).then(n=>n(this.axios,this.basePath))}streamPackageEvents(t,n,r){return b0(this.configuration).streamPackageEvents(t,n,r).then(o=>o(this.axios,this.basePath))}},Eoe=class{apiKey;username;password;accessToken;basePath;serverIndex;baseOptions;formDataCtor;constructor(t={}){this.apiKey=t.apiKey,this.username=t.username,this.password=t.password,this.accessToken=t.accessToken,this.basePath=t.basePath,this.serverIndex=t.serverIndex,this.baseOptions={...t.baseOptions,headers:{...t.baseOptions?.headers}},this.formDataCtor=t.formDataCtor}isJsonMime(t){const n=new RegExp("^(application/json|[^;/ ]+/[^;/ ]+[+]json)[ ]*(;.*)?$","i");return t!==null&&(n.test(t)||t.toLowerCase()==="application/json-patch+json")}};const Ba={teal:"#14b3cb",orange:"#e47404",darkBlue:"#1474a4"},gi='"JetBrains Mono", "ui-monospace", "SFMono-Regular", "Menlo", monospace',L1=Ye(ch)({display:"flex",flexDirection:"column",height:"100%",boxShadow:"none",border:"none",backgroundColor:"transparent"}),oj=Ye(uh)({display:"flex",flexDirection:"column",padding:"0",flexGrow:1}),wA=Ye(QX)({padding:"0"}),Coe=Ye("div")(({theme:e})=>({backgroundColor:e.palette.background.default,padding:"0 8px 0px 8px",borderRadius:"12px",boxShadow:"none",border:"none",maxWidth:"1200px",margin:"0 auto"}));Ye("div")(({theme:e})=>({marginBottom:"40px",paddingBottom:"24px",borderBottom:`1px solid ${e.palette.divider}`}));const Toe=Ye("div")({marginBottom:"48px",padding:"0",backgroundColor:"transparent",border:"none",boxShadow:"none"}),ik=Ye("div")({marginBottom:"0",padding:"0",backgroundColor:"transparent",border:"none",boxShadow:"none"}),J0=Ye("div")({backgroundColor:"transparent",paddingTop:"12px",paddingBottom:"2px",borderRadius:"8px",border:"none",boxShadow:"none",marginBottom:"0"});Ye("div")(({theme:e})=>({backgroundColor:e.palette.mode==="dark"?"#1e293b":"#f8f9fa",padding:"16px",borderRadius:"8px",border:`1px solid ${e.palette.divider}`,fontFamily:"'Monaco', 'Menlo', 'Ubuntu Mono', monospace",fontSize:"13px",lineHeight:"1.5",overflowX:"auto",color:e.palette.text.primary}));Ye("div")(({theme:e})=>({backgroundColor:e.palette.mode==="dark"?"#1e293b":"#f8f9fa",padding:"12px 16px",borderRadius:"8px",border:`1px solid ${e.palette.divider}`,marginBottom:"16px",display:"flex",justifyContent:"space-between",alignItems:"center"}));const woe=Ye("div")({height:"100%"});Ye("div")({height:"30px",backgroundColor:"rgba(225, 240, 255, 1)",display:"flex",padding:"4px",alignItems:"center"});const aj=Ye("div")({height:"75vh",width:"100%",overflowY:"auto"});Ye("div")({position:"relative",height:"100%",flex:"0 0 auto"});const koe=Ye(ch)(({theme:e})=>({backgroundColor:e.palette.background.paper,padding:"24px",borderRadius:"8px",border:`1px solid ${e.palette.divider}`,boxShadow:"0 1px 3px rgba(0, 0, 0, 0.04)",height:"100%",transition:"box-shadow 0.2s ease-in-out","&:hover":{boxShadow:"0 2px 6px rgba(0, 0, 0, 0.08)"}})),Aoe=Ye(uh)({padding:"0","&:last-child":{paddingBottom:"0"}}),Doe=Ye("div")(({theme:e})=>({fontSize:"0.875rem",fontWeight:500,color:e.palette.text.secondary,marginBottom:"16px",paddingBottom:"8px",borderBottom:`1px solid ${e.palette.divider}`}));Ye("div")({padding:"32px",maxWidth:"1400px",margin:"0 auto",minHeight:"100vh"});const Ooe=[Ba.teal,Ba.orange,Ba.darkBlue,"#66cedc","#ec72b8","#f9c85b","#aacd85","#b87ced"],Roe="Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif",jI={palette:{series:Ooe,background:{light:"#ffffff",dark:"#1e293b"},tableHeader:{light:"#5d626b",dark:"#cbd5e1"},tableHeaderBackground:{light:"#f5fafc",dark:"#1e293b"},tableBody:{light:"#727883",dark:"#e2e8f0"},tile:{light:"#f5fafc",dark:"#0f172a"},tileTitle:{light:"#5d626b",dark:"#94a3b8"},mapColor:{light:Ba.teal,dark:Ba.teal}},font:{family:Roe,size:12}},ij=["background","tableHeader","tableHeaderBackground","tableBody","tile","tileTitle","mapColor"];function kA(e,t){const n=jI.palette??{},r=jI.font??{family:"sans-serif",size:12};let o=[...n.series??[]],a=r.family??"sans-serif",i=r.size??12;const s={background:{...n.background??{}},tableHeader:{...n.tableHeader??{}},tableHeaderBackground:{...n.tableHeaderBackground??{}},tableBody:{...n.tableBody??{}},tile:{...n.tile??{}},tileTitle:{...n.tileTitle??{}},mapColor:{...n.mapColor??{}}};for(const p of e)if(p){Array.isArray(p.palette?.series)&&(o=[...p.palette.series]);for(const y of ij){const g=p.palette?.[y];g&&(s[y]={...s[y],...g})}typeof p.font?.family=="string"&&(a=p.font.family),typeof p.font?.size=="number"&&(i=p.font.size)}const c=t==="dark",u=p=>s[p][t]??n[p]?.[t],f=u("background");return{mode:t,series:o,font:{family:a,size:i},background:f,tableHeader:u("tableHeader"),tableHeaderBackground:u("tableHeaderBackground"),tableBody:u("tableBody"),tile:u("tile"),tileTitle:u("tileTitle"),mapColor:u("mapColor"),tableBackground:f,border:c?"1px solid #334155":"1px solid #e5e7eb",pinnedBorder:c?"1px solid #475569":"1px solid #daedf3",valueColor:c?"#f1f5f9":"#1f2937",foreground:c?"#e2e8f0":"#1f2937",axisFaint:c?"#475569":"#d1d5db",dashboardRoot:c?"#1e293b":"#ffffff"}}function Moe(e,t,n){const r=t??e??"light";return r==="auto"?n?"dark":"light":r}const sj=T.createContext(void 0);function Noe({layers:e,mode:t,userChoice:n,setMode:r,allowUserToggle:o=!0,children:a}){const i=T.useMemo(()=>kA(e,t),[e,t]),s=T.useMemo(()=>({theme:i,layers:e,mode:t,userChoice:n,setMode:r,allowUserToggle:o}),[i,e,t,n,r,o]);return m.jsx(sj.Provider,{value:s,children:a})}function mb(){return T.useContext(sj)||{theme:kA([],"light"),layers:[],mode:"light",userChoice:void 0,setMode:()=>{},allowUserToggle:!1}}const AA=new dne({defaultOptions:{queries:{retry:!1,throwOnError:!1},mutations:{retry:!1,throwOnError:!1}}}),Poe={staleTime:300*1e3,refetchOnWindowFocus:!1,refetchOnReconnect:!1},sk="publisher:themeMode";function Ioe(){if(!(typeof window>"u"))try{const e=window.localStorage.getItem(sk);if(e==="light"||e==="dark"||e==="auto")return e}catch{}}function _oe(e){if(!(typeof window>"u"))try{e===void 0?window.localStorage.removeItem(sk):window.localStorage.setItem(sk,e)}catch{}}function Loe(){return typeof window>"u"||!window.matchMedia?!1:window.matchMedia("(prefers-color-scheme: dark)").matches}_t.defaults.baseURL||(_t.defaults.baseURL="IfYouAreSeeingThis_baseURL_IsNotSet");const lj=T.createContext(void 0),Foe=(e,t)=>{const n=`${window.location.protocol}//${window.location.host}/api/v0`,r=_t.create({baseURL:e||n,withCredentials:!0,timeout:6e5});r.interceptors.request.use(async a=>{const i=await t?.();return a.headers.Authorization=i||"",a});const o=new Eoe({basePath:n});return{models:new uoe(o,n,r),publisher:new voe(o,n,r),environments:new ioe(o,n,r),packages:new hoe(o,n,r),pages:new yoe(o,n,r),notebooks:new foe(o,n,r),connections:new toe(o,n,r),databases:new ooe(o,n,r),materializations:new loe(o,n,r),watchMode:new Soe(o,n,r)}},joe=e=>m.jsx(fne,{client:AA,children:m.jsx(Boe,{...e})}),Boe=({children:e,getAccessToken:t,baseURL:n,mutable:r,theme:o})=>{const a=T.useMemo(()=>Foe(n,t),[n,t]),i=n||`${window.location.protocol}//${window.location.host}/api/v0`,s=MF({queryKey:["status"],queryFn:async()=>(await a.publisher.getStatus()).data});s.error&&console.error("Failed to fetch publisher status:",s.error);const c=s.data?.frozenConfig,u=s.data?.theme,f=s.isLoading;let p;s.isLoading||s.error?p=r:c?p=!1:p=r??!0;const y=T.useMemo(()=>[u,o],[u,o]),[g,b]=T.useState(Ioe),[x,E]=T.useState(Loe);T.useEffect(()=>{if(typeof window>"u"||!window.matchMedia)return;const D=window.matchMedia("(prefers-color-scheme: dark)"),I=L=>E(L.matches);return D.addEventListener("change",I),()=>D.removeEventListener("change",I)},[]);const S=T.useCallback(D=>{b(D),_oe(D)},[]),w=u?.allowUserToggle??!0,C=w?g:void 0,R=T.useMemo(()=>Moe(u?.defaultMode,C,x),[u?.defaultMode,C,x]),M={server:i,getAccessToken:t,apiClients:a,mutable:p,isLoadingStatus:f,instanceTheme:u};return m.jsx(lj.Provider,{value:M,children:m.jsx(Noe,{layers:y,mode:R,userChoice:C,setMode:S,allowUserToggle:w,children:e})})},Dr=()=>{const e=T.useContext(lj);if(e===void 0)throw new Error("useServer must be used within a ServerProvider");return e};function gd(){return gd=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},gd.apply(this,arguments)}const $oe=["children","options"],BI=["allowFullScreen","allowTransparency","autoComplete","autoFocus","autoPlay","cellPadding","cellSpacing","charSet","classId","colSpan","contentEditable","contextMenu","crossOrigin","encType","formAction","formEncType","formMethod","formNoValidate","formTarget","frameBorder","hrefLang","inputMode","keyParams","keyType","marginHeight","marginWidth","maxLength","mediaGroup","minLength","noValidate","radioGroup","readOnly","rowSpan","spellCheck","srcDoc","srcLang","srcSet","tabIndex","useMap"].reduce((e,t)=>(e[t.toLowerCase()]=t,e),{class:"className",for:"htmlFor"}),$I={amp:"&",apos:"'",gt:">",lt:"<",nbsp:" ",quot:"“"},zoe=["style","script","pre"],Hoe=["src","href","data","formAction","srcDoc","action"],Uoe=/([-A-Z0-9_:]+)(?:\s*=\s*(?:(?:"((?:\\.|[^"])*)")|(?:'((?:\\.|[^'])*)')|(?:\{((?:\\.|{[^}]*?}|[^}])*)\})))?/gi,Voe=/mailto:/i,Woe=/\n{2,}$/,zI=/^(\s*>[\s\S]*?)(?=\n\n|$)/,qoe=/^ *> ?/gm,Goe=/^(?:\[!([^\]]*)\]\n)?([\s\S]*)/,Yoe=/^ {2,}\n/,Koe=/^(?:( *[-*_])){3,} *(?:\n *)+\n/,HI=/^(?: {1,3})?(`{3,}|~{3,}) *(\S+)? *([^\n]*?)?\n([\s\S]*?)(?:\1\n?|$)/,UI=/^(?: {4}[^\n]+\n*)+(?:\n *)+\n?/,Qoe=/^(`+)((?:\\`|(?!\1)`|[^`])+)\1/,Xoe=/^(?:\n *)*\n/,Zoe=/\r\n?/g,Joe=/^\[\^([^\]]+)](:(.*)((\n+ {4,}.*)|(\n(?!\[\^).+))*)/,eae=/^\[\^([^\]]+)]/,tae=/\f/g,nae=/^---[ \t]*\n(.|\n)*\n---[ \t]*\n/,rae=/^\s*?\[(x|\s)\]/,VI=/^ *(#{1,6}) *([^\n]+?)(?: +#*)?(?:\n *)*(?:\n|$)/,WI=/^ *(#{1,6}) +([^\n]+?)(?: +#*)?(?:\n *)*(?:\n|$)/,qI=/^([^\n]+)\n *(=|-){3,} *\n/,bT=/^ *(?!<[a-z][^ >/]* ?\/>)<([a-z][^ >/]*) ?((?:[^>]*[^/])?)>\n?(\s*(?:<\1[^>]*?>[\s\S]*?<\/\1>|(?!<\1\b)[\s\S])*?)<\/\1>(?!<\/\1>)\n*/i,oae=/&([a-z0-9]+|#[0-9]{1,6}|#x[0-9a-fA-F]{1,6});/gi,GI=/^<!--[\s\S]*?(?:-->)/,aae=/^(data|aria|x)-[a-z_][a-z\d_.-]*$/,vT=/^ *<([a-z][a-z0-9:]*)(?:\s+((?:<.*?>|[^>])*))?\/?>(?!<\/\1>)(\s*\n)?/i,iae=/^\{.*\}$/,sae=/^(https?:\/\/[^\s<]+[^<.,:;"')\]\s])/,lae=/^<([^ >]+@[^ >]+)>/,cae=/^<([^ >]+:\/[^ >]+)>/,uae=/-([a-z])?/gi,YI=/^(\|.*)\n(?: *(\|? *[-:]+ *\|[-| :]*)\n((?:.*\|.*\n)*))?\n?/,dae=/^[^\n]+(?: \n|\n{2,})/,fae=/^\[([^\]]*)\]:\s+<?([^\s>]+)>?\s*("([^"]*)")?/,pae=/^!\[([^\]]*)\] ?\[([^\]]*)\]/,hae=/^\[([^\]]*)\] ?\[([^\]]*)\]/,mae=/(\n|^[-*]\s|^#|^ {2,}|^-{2,}|^>\s)/,gae=/\t/g,yae=/(^ *\||\| *$)/g,bae=/^ *:-+: *$/,vae=/^ *:-+ *$/,xae=/^ *-+: *$/,Xx=e=>`(?=[\\s\\S]+?\\1${e?"\\1":""})`,Zx="((?:\\[.*?\\][([].*?[)\\]]|<.*?>(?:.*?<.*?>)?|`.*?`|\\\\\\1|[\\s\\S])+?)",Sae=RegExp(`^([*_])\\1${Xx(1)}${Zx}\\1\\1(?!\\1)`),Eae=RegExp(`^([*_])${Xx(0)}${Zx}\\1(?!\\1)`),Cae=RegExp(`^(==)${Xx(0)}${Zx}\\1`),Tae=RegExp(`^(~~)${Xx(0)}${Zx}\\1`),wae=/^(:[a-zA-Z0-9-_]+:)/,kae=/^\\([^0-9A-Za-z\s])/,Aae=/\\([^0-9A-Za-z\s])/g,Dae=/^[\s\S](?:(?! \n|[0-9]\.|http)[^=*_~\-\n:<`\\\[!])*/,Oae=/^\n+/,Rae=/^([ \t]*)/,Mae=/(?:^|\n)( *)$/,DA="(?:\\d+\\.)",OA="(?:[*+-])";function cj(e){return"( *)("+(e===1?DA:OA)+") +"}const uj=cj(1),dj=cj(2);function fj(e){return RegExp("^"+(e===1?uj:dj))}const Nae=fj(1),Pae=fj(2);function pj(e){return RegExp("^"+(e===1?uj:dj)+"[^\\n]*(?:\\n(?!\\1"+(e===1?DA:OA)+" )[^\\n]*)*(\\n|$)","gm")}const Iae=pj(1),_ae=pj(2);function hj(e){const t=e===1?DA:OA;return RegExp("^( *)("+t+") [\\s\\S]+?(?:\\n{2,}(?! )(?!\\1"+t+" (?!"+t+" ))\\n*|\\s*\\n*$)")}const mj=hj(1),gj=hj(2);function KI(e,t){const n=t===1,r=n?mj:gj,o=n?Iae:_ae,a=n?Nae:Pae;return{t:i=>a.test(i),o:Vp(function(i,s){const c=Mae.exec(s.prevCapture);return c&&(s.list||!s.inline&&!s.simple)?r.exec(i=c[1]+i):null}),i:1,u(i,s,c){const u=n?+i[2]:void 0,f=i[0].replace(Woe,`
219
+ `+a):r.stack=a}catch{}}throw r}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=$d(this.defaults,n);const{transitional:r,paramsSerializer:o,headers:a}=n;r!==void 0&&Z0.assertOptions(r,{silentJSONParsing:Qs.transitional(Qs.boolean),forcedJSONParsing:Qs.transitional(Qs.boolean),clarifyTimeoutError:Qs.transitional(Qs.boolean)},!1),o!=null&&(Ge.isFunction(o)?n.paramsSerializer={serialize:o}:Z0.assertOptions(o,{encode:Qs.function,serialize:Qs.function},!0)),n.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),Z0.assertOptions(n,{baseUrl:Qs.spelling("baseURL"),withXsrfToken:Qs.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let i=a&&Ge.merge(a.common,a[n.method]);a&&Ge.forEach(["delete","get","head","post","put","patch","common"],b=>{delete a[b]}),n.headers=Ua.concat(i,a);const s=[];let c=!0;this.interceptors.request.forEach(function(x){typeof x.runWhen=="function"&&x.runWhen(n)===!1||(c=c&&x.synchronous,s.unshift(x.fulfilled,x.rejected))});const u=[];this.interceptors.response.forEach(function(x){u.push(x.fulfilled,x.rejected)});let f,p=0,y;if(!c){const b=[_I.bind(this),void 0];for(b.unshift(...s),b.push(...u),y=b.length,f=Promise.resolve(n);p<y;)f=f.then(b[p++],b[p++]);return f}y=s.length;let g=n;for(;p<y;){const b=s[p++],x=s[p++];try{g=b(g)}catch(E){x.call(this,E);break}}try{f=_I.call(this,g)}catch(b){return Promise.reject(b)}for(p=0,y=u.length;p<y;)f=f.then(u[p++],u[p++]);return f}getUri(t){t=$d(this.defaults,t);const n=KF(t.baseURL,t.url,t.allowAbsoluteUrls);return VF(n,t.params,t.paramsSerializer)}};Ge.forEach(["delete","get","head","options"],function(t){Od.prototype[t]=function(n,r){return this.request($d(r||{},{method:t,url:n,data:(r||{}).data}))}});Ge.forEach(["post","put","patch"],function(t){function n(r){return function(a,i,s){return this.request($d(s||{},{method:t,headers:r?{"Content-Type":"multipart/form-data"}:{},url:a,data:i}))}}Od.prototype[t]=n(),Od.prototype[t+"Form"]=n(!0)});let Qre=class ej{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(a){n=a});const r=this;this.promise.then(o=>{if(!r._listeners)return;let a=r._listeners.length;for(;a-- >0;)r._listeners[a](o);r._listeners=null}),this.promise.then=o=>{let a;const i=new Promise(s=>{r.subscribe(s),a=s}).then(o);return i.cancel=function(){r.unsubscribe(a)},i},t(function(a,i,s){r.reason||(r.reason=new hh(a,i,s),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const t=new AbortController,n=r=>{t.abort(r)};return this.subscribe(n),t.signal.unsubscribe=()=>this.unsubscribe(n),t.signal}static source(){let t;return{token:new ej(function(o){t=o}),cancel:t}}};function Xre(e){return function(n){return e.apply(null,n)}}function Zre(e){return Ge.isObject(e)&&e.isAxiosError===!0}const ok={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(ok).forEach(([e,t])=>{ok[t]=e});function tj(e){const t=new Od(e),n=NF(Od.prototype.request,t);return Ge.extend(n,Od.prototype,t,{allOwnKeys:!0}),Ge.extend(n,t,null,{allOwnKeys:!0}),n.create=function(o){return tj($d(e,o))},n}const _t=tj(hb);_t.Axios=Od;_t.CanceledError=hh;_t.CancelToken=Qre;_t.isCancel=GF;_t.VERSION=JF;_t.toFormData=Kx;_t.AxiosError=Nn;_t.Cancel=_t.CanceledError;_t.all=function(t){return Promise.all(t)};_t.spread=Xre;_t.isAxiosError=Zre;_t.mergeConfig=$d;_t.AxiosHeaders=Ua;_t.formToJSON=e=>qF(Ge.isHTMLForm(e)?new FormData(e):e);_t.getAdapter=ZF.getAdapter;_t.HttpStatusCode=ok;_t.default=_t;const{Axios:zPe,AxiosError:HPe,CanceledError:UPe,isCancel:VPe,CancelToken:WPe,VERSION:qPe,all:GPe,Cancel:YPe,isAxiosError:KPe,spread:QPe,toFormData:XPe,AxiosHeaders:ZPe,HttpStatusCode:JPe,formToJSON:eIe,getAdapter:tIe,mergeConfig:nIe}=_t,dn="http://localhost/api/v0".replace(/\/+$/,"");let Tl=class{constructor(t,n=dn,r=_t){this.basePath=n,this.axios=r,t&&(this.configuration=t,this.basePath=t.basePath??n)}configuration},Jre=class extends Error{constructor(t,n){super(n),this.field=t,this.name="RequiredError"}};const mn={},gn="https://example.com",st=function(e,t,n){if(n==null)throw new Jre(t,`Required parameter ${t} was null or undefined when calling ${e}.`)};function ak(e,t,n=""){t!=null&&(typeof t=="object"?Array.isArray(t)?t.forEach(r=>ak(e,r,n)):Object.keys(t).forEach(r=>ak(e,t[r],`${n}${n!==""?".":""}${r}`)):e.has(n)?e.append(n,t):e.set(n,t))}const yn=function(e,...t){const n=new URLSearchParams(e.search);ak(n,t),e.search=n.toString()},Xo=function(e,t,n){const r=typeof e!="string";return(r&&n&&n.isJsonMime?n.isJsonMime(t.headers["Content-Type"]):r)?JSON.stringify(e!==void 0?e:{}):e||""},bn=function(e){return e.pathname+e.search+e.hash},vn=function(e,t,n,r){return(o=t,a=n)=>{const i={...e.options,url:(o.defaults.baseURL?"":r?.basePath??a)+e.url};return o.request(i)}},nj={Bigquery:"bigquery",Snowflake:"snowflake",Postgres:"postgres",Gcs:"gcs",S3:"s3",Azure:"azure"},FI={Postgres:"postgres",Bigquery:"bigquery",Snowflake:"snowflake",Trino:"trino",Databricks:"databricks",Mysql:"mysql",Duckdb:"duckdb",Motherduck:"motherduck",Ducklake:"ducklake",Publisher:"publisher"},va={Pending:"PENDING",ManifestRowsReady:"MANIFEST_ROWS_READY",ManifestFileReady:"MANIFEST_FILE_READY",Failed:"FAILED",Cancelled:"CANCELLED"},m0={Version:"version",Package:"package"},eoe=function(e){return{createConnection:async(t,n,r,o={})=>{st("createConnection","environmentName",t),st("createConnection","connectionName",n),st("createConnection","connection",r);const a="/environments/{environmentName}/connections/{connectionName}".replace("{environmentName}",encodeURIComponent(String(t))).replace("{connectionName}",encodeURIComponent(String(n))),i=new URL(a,gn);let s;e&&(s=e.baseOptions);const c={method:"POST",...s,...o},u={},f={};u["Content-Type"]="application/json",yn(i,f);let p=s&&s.headers?s.headers:{};return c.headers={...u,...p,...o.headers},c.data=Xo(r,c,e),{url:bn(i),options:c}},deleteConnection:async(t,n,r={})=>{st("deleteConnection","environmentName",t),st("deleteConnection","connectionName",n);const o="/environments/{environmentName}/connections/{connectionName}".replace("{environmentName}",encodeURIComponent(String(t))).replace("{connectionName}",encodeURIComponent(String(n))),a=new URL(o,gn);let i;e&&(i=e.baseOptions);const s={method:"DELETE",...i,...r},c={};yn(a,{});let u=i&&i.headers?i.headers:{};return s.headers={...c,...u,...r.headers},{url:bn(a),options:s}},getConnection:async(t,n,r={})=>{st("getConnection","environmentName",t),st("getConnection","connectionName",n);const o="/environments/{environmentName}/connections/{connectionName}".replace("{environmentName}",encodeURIComponent(String(t))).replace("{connectionName}",encodeURIComponent(String(n))),a=new URL(o,gn);let i;e&&(i=e.baseOptions);const s={method:"GET",...i,...r},c={};yn(a,{});let u=i&&i.headers?i.headers:{};return s.headers={...c,...u,...r.headers},{url:bn(a),options:s}},getTable:async(t,n,r,o,a={})=>{st("getTable","environmentName",t),st("getTable","connectionName",n),st("getTable","schemaName",r),st("getTable","tablePath",o);const i="/environments/{environmentName}/connections/{connectionName}/schemas/{schemaName}/tables/{tablePath}".replace("{environmentName}",encodeURIComponent(String(t))).replace("{connectionName}",encodeURIComponent(String(n))).replace("{schemaName}",encodeURIComponent(String(r))).replace("{tablePath}",encodeURIComponent(String(o))),s=new URL(i,gn);let c;e&&(c=e.baseOptions);const u={method:"GET",...c,...a},f={};yn(s,{});let p=c&&c.headers?c.headers:{};return u.headers={...f,...p,...a.headers},{url:bn(s),options:u}},getTableInPackage:async(t,n,r,o,a,i={})=>{st("getTableInPackage","environmentName",t),st("getTableInPackage","packageName",n),st("getTableInPackage","connectionName",r),st("getTableInPackage","schemaName",o),st("getTableInPackage","tablePath",a);const s="/environments/{environmentName}/packages/{packageName}/connections/{connectionName}/schemas/{schemaName}/tables/{tablePath}".replace("{environmentName}",encodeURIComponent(String(t))).replace("{packageName}",encodeURIComponent(String(n))).replace("{connectionName}",encodeURIComponent(String(r))).replace("{schemaName}",encodeURIComponent(String(o))).replace("{tablePath}",encodeURIComponent(String(a))),c=new URL(s,gn);let u;e&&(u=e.baseOptions);const f={method:"GET",...u,...i},p={};yn(c,{});let y=u&&u.headers?u.headers:{};return f.headers={...p,...y,...i.headers},{url:bn(c),options:f}},listConnections:async(t,n={})=>{st("listConnections","environmentName",t);const r="/environments/{environmentName}/connections".replace("{environmentName}",encodeURIComponent(String(t))),o=new URL(r,gn);let a;e&&(a=e.baseOptions);const i={method:"GET",...a,...n},s={};yn(o,{});let c=a&&a.headers?a.headers:{};return i.headers={...s,...c,...n.headers},{url:bn(o),options:i}},listSchemas:async(t,n,r={})=>{st("listSchemas","environmentName",t),st("listSchemas","connectionName",n);const o="/environments/{environmentName}/connections/{connectionName}/schemas".replace("{environmentName}",encodeURIComponent(String(t))).replace("{connectionName}",encodeURIComponent(String(n))),a=new URL(o,gn);let i;e&&(i=e.baseOptions);const s={method:"GET",...i,...r},c={};yn(a,{});let u=i&&i.headers?i.headers:{};return s.headers={...c,...u,...r.headers},{url:bn(a),options:s}},listSchemasInPackage:async(t,n,r,o={})=>{st("listSchemasInPackage","environmentName",t),st("listSchemasInPackage","packageName",n),st("listSchemasInPackage","connectionName",r);const a="/environments/{environmentName}/packages/{packageName}/connections/{connectionName}/schemas".replace("{environmentName}",encodeURIComponent(String(t))).replace("{packageName}",encodeURIComponent(String(n))).replace("{connectionName}",encodeURIComponent(String(r))),i=new URL(a,gn);let s;e&&(s=e.baseOptions);const c={method:"GET",...s,...o},u={};yn(i,{});let f=s&&s.headers?s.headers:{};return c.headers={...u,...f,...o.headers},{url:bn(i),options:c}},listTables:async(t,n,r,o,a={})=>{st("listTables","environmentName",t),st("listTables","connectionName",n),st("listTables","schemaName",r);const i="/environments/{environmentName}/connections/{connectionName}/schemas/{schemaName}/tables".replace("{environmentName}",encodeURIComponent(String(t))).replace("{connectionName}",encodeURIComponent(String(n))).replace("{schemaName}",encodeURIComponent(String(r))),s=new URL(i,gn);let c;e&&(c=e.baseOptions);const u={method:"GET",...c,...a},f={},p={};o&&(p.tableNames=o),yn(s,p);let y=c&&c.headers?c.headers:{};return u.headers={...f,...y,...a.headers},{url:bn(s),options:u}},listTablesInPackage:async(t,n,r,o,a,i={})=>{st("listTablesInPackage","environmentName",t),st("listTablesInPackage","packageName",n),st("listTablesInPackage","connectionName",r),st("listTablesInPackage","schemaName",o);const s="/environments/{environmentName}/packages/{packageName}/connections/{connectionName}/schemas/{schemaName}/tables".replace("{environmentName}",encodeURIComponent(String(t))).replace("{packageName}",encodeURIComponent(String(n))).replace("{connectionName}",encodeURIComponent(String(r))).replace("{schemaName}",encodeURIComponent(String(o))),c=new URL(s,gn);let u;e&&(u=e.baseOptions);const f={method:"GET",...u,...i},p={},y={};a&&(y.tableNames=a),yn(c,y);let g=u&&u.headers?u.headers:{};return f.headers={...p,...g,...i.headers},{url:bn(c),options:f}},postQuerydata:async(t,n,r,o={})=>{st("postQuerydata","environmentName",t),st("postQuerydata","connectionName",n),st("postQuerydata","postQuerydataRequest",r);const a="/environments/{environmentName}/connections/{connectionName}/sqlQuery".replace("{environmentName}",encodeURIComponent(String(t))).replace("{connectionName}",encodeURIComponent(String(n))),i=new URL(a,gn);let s;e&&(s=e.baseOptions);const c={method:"POST",...s,...o},u={},f={};u["Content-Type"]="application/json",yn(i,f);let p=s&&s.headers?s.headers:{};return c.headers={...u,...p,...o.headers},c.data=Xo(r,c,e),{url:bn(i),options:c}},postQuerydataInPackage:async(t,n,r,o,a={})=>{st("postQuerydataInPackage","environmentName",t),st("postQuerydataInPackage","packageName",n),st("postQuerydataInPackage","connectionName",r),st("postQuerydataInPackage","postQuerydataRequest",o);const i="/environments/{environmentName}/packages/{packageName}/connections/{connectionName}/sqlQuery".replace("{environmentName}",encodeURIComponent(String(t))).replace("{packageName}",encodeURIComponent(String(n))).replace("{connectionName}",encodeURIComponent(String(r))),s=new URL(i,gn);let c;e&&(c=e.baseOptions);const u={method:"POST",...c,...a},f={},p={};f["Content-Type"]="application/json",yn(s,p);let y=c&&c.headers?c.headers:{};return u.headers={...f,...y,...a.headers},u.data=Xo(o,u,e),{url:bn(s),options:u}},postSqlsource:async(t,n,r,o={})=>{st("postSqlsource","environmentName",t),st("postSqlsource","connectionName",n),st("postSqlsource","postSqlsourceRequest",r);const a="/environments/{environmentName}/connections/{connectionName}/sqlSource".replace("{environmentName}",encodeURIComponent(String(t))).replace("{connectionName}",encodeURIComponent(String(n))),i=new URL(a,gn);let s;e&&(s=e.baseOptions);const c={method:"POST",...s,...o},u={},f={};u["Content-Type"]="application/json",yn(i,f);let p=s&&s.headers?s.headers:{};return c.headers={...u,...p,...o.headers},c.data=Xo(r,c,e),{url:bn(i),options:c}},postSqlsourceInPackage:async(t,n,r,o,a={})=>{st("postSqlsourceInPackage","environmentName",t),st("postSqlsourceInPackage","packageName",n),st("postSqlsourceInPackage","connectionName",r),st("postSqlsourceInPackage","postSqlsourceRequest",o);const i="/environments/{environmentName}/packages/{packageName}/connections/{connectionName}/sqlSource".replace("{environmentName}",encodeURIComponent(String(t))).replace("{packageName}",encodeURIComponent(String(n))).replace("{connectionName}",encodeURIComponent(String(r))),s=new URL(i,gn);let c;e&&(c=e.baseOptions);const u={method:"POST",...c,...a},f={},p={};f["Content-Type"]="application/json",yn(s,p);let y=c&&c.headers?c.headers:{};return u.headers={...f,...y,...a.headers},u.data=Xo(o,u,e),{url:bn(s),options:u}},postTemporarytable:async(t,n,r,o={})=>{st("postTemporarytable","environmentName",t),st("postTemporarytable","connectionName",n),st("postTemporarytable","postSqlsourceRequest",r);const a="/environments/{environmentName}/connections/{connectionName}/sqlTemporaryTable".replace("{environmentName}",encodeURIComponent(String(t))).replace("{connectionName}",encodeURIComponent(String(n))),i=new URL(a,gn);let s;e&&(s=e.baseOptions);const c={method:"POST",...s,...o},u={},f={};u["Content-Type"]="application/json",yn(i,f);let p=s&&s.headers?s.headers:{};return c.headers={...u,...p,...o.headers},c.data=Xo(r,c,e),{url:bn(i),options:c}},postTemporarytableInPackage:async(t,n,r,o,a={})=>{st("postTemporarytableInPackage","environmentName",t),st("postTemporarytableInPackage","packageName",n),st("postTemporarytableInPackage","connectionName",r),st("postTemporarytableInPackage","postSqlsourceRequest",o);const i="/environments/{environmentName}/packages/{packageName}/connections/{connectionName}/sqlTemporaryTable".replace("{environmentName}",encodeURIComponent(String(t))).replace("{packageName}",encodeURIComponent(String(n))).replace("{connectionName}",encodeURIComponent(String(r))),s=new URL(i,gn);let c;e&&(c=e.baseOptions);const u={method:"POST",...c,...a},f={},p={};f["Content-Type"]="application/json",yn(s,p);let y=c&&c.headers?c.headers:{};return u.headers={...f,...y,...a.headers},u.data=Xo(o,u,e),{url:bn(s),options:u}},updateConnection:async(t,n,r,o={})=>{st("updateConnection","environmentName",t),st("updateConnection","connectionName",n),st("updateConnection","updateConnectionRequest",r);const a="/environments/{environmentName}/connections/{connectionName}".replace("{environmentName}",encodeURIComponent(String(t))).replace("{connectionName}",encodeURIComponent(String(n))),i=new URL(a,gn);let s;e&&(s=e.baseOptions);const c={method:"PATCH",...s,...o},u={},f={};u["Content-Type"]="application/json",yn(i,f);let p=s&&s.headers?s.headers:{};return c.headers={...u,...p,...o.headers},c.data=Xo(r,c,e),{url:bn(i),options:c}}}},Qo=function(e){const t=eoe(e);return{async createConnection(n,r,o,a){const i=await t.createConnection(n,r,o,a),s=e?.serverIndex??0,c=mn["ConnectionsApi.createConnection"]?.[s]?.url;return(u,f)=>vn(i,_t,dn,e)(u,c||f)},async deleteConnection(n,r,o){const a=await t.deleteConnection(n,r,o),i=e?.serverIndex??0,s=mn["ConnectionsApi.deleteConnection"]?.[i]?.url;return(c,u)=>vn(a,_t,dn,e)(c,s||u)},async getConnection(n,r,o){const a=await t.getConnection(n,r,o),i=e?.serverIndex??0,s=mn["ConnectionsApi.getConnection"]?.[i]?.url;return(c,u)=>vn(a,_t,dn,e)(c,s||u)},async getTable(n,r,o,a,i){const s=await t.getTable(n,r,o,a,i),c=e?.serverIndex??0,u=mn["ConnectionsApi.getTable"]?.[c]?.url;return(f,p)=>vn(s,_t,dn,e)(f,u||p)},async getTableInPackage(n,r,o,a,i,s){const c=await t.getTableInPackage(n,r,o,a,i,s),u=e?.serverIndex??0,f=mn["ConnectionsApi.getTableInPackage"]?.[u]?.url;return(p,y)=>vn(c,_t,dn,e)(p,f||y)},async listConnections(n,r){const o=await t.listConnections(n,r),a=e?.serverIndex??0,i=mn["ConnectionsApi.listConnections"]?.[a]?.url;return(s,c)=>vn(o,_t,dn,e)(s,i||c)},async listSchemas(n,r,o){const a=await t.listSchemas(n,r,o),i=e?.serverIndex??0,s=mn["ConnectionsApi.listSchemas"]?.[i]?.url;return(c,u)=>vn(a,_t,dn,e)(c,s||u)},async listSchemasInPackage(n,r,o,a){const i=await t.listSchemasInPackage(n,r,o,a),s=e?.serverIndex??0,c=mn["ConnectionsApi.listSchemasInPackage"]?.[s]?.url;return(u,f)=>vn(i,_t,dn,e)(u,c||f)},async listTables(n,r,o,a,i){const s=await t.listTables(n,r,o,a,i),c=e?.serverIndex??0,u=mn["ConnectionsApi.listTables"]?.[c]?.url;return(f,p)=>vn(s,_t,dn,e)(f,u||p)},async listTablesInPackage(n,r,o,a,i,s){const c=await t.listTablesInPackage(n,r,o,a,i,s),u=e?.serverIndex??0,f=mn["ConnectionsApi.listTablesInPackage"]?.[u]?.url;return(p,y)=>vn(c,_t,dn,e)(p,f||y)},async postQuerydata(n,r,o,a){const i=await t.postQuerydata(n,r,o,a),s=e?.serverIndex??0,c=mn["ConnectionsApi.postQuerydata"]?.[s]?.url;return(u,f)=>vn(i,_t,dn,e)(u,c||f)},async postQuerydataInPackage(n,r,o,a,i){const s=await t.postQuerydataInPackage(n,r,o,a,i),c=e?.serverIndex??0,u=mn["ConnectionsApi.postQuerydataInPackage"]?.[c]?.url;return(f,p)=>vn(s,_t,dn,e)(f,u||p)},async postSqlsource(n,r,o,a){const i=await t.postSqlsource(n,r,o,a),s=e?.serverIndex??0,c=mn["ConnectionsApi.postSqlsource"]?.[s]?.url;return(u,f)=>vn(i,_t,dn,e)(u,c||f)},async postSqlsourceInPackage(n,r,o,a,i){const s=await t.postSqlsourceInPackage(n,r,o,a,i),c=e?.serverIndex??0,u=mn["ConnectionsApi.postSqlsourceInPackage"]?.[c]?.url;return(f,p)=>vn(s,_t,dn,e)(f,u||p)},async postTemporarytable(n,r,o,a){const i=await t.postTemporarytable(n,r,o,a),s=e?.serverIndex??0,c=mn["ConnectionsApi.postTemporarytable"]?.[s]?.url;return(u,f)=>vn(i,_t,dn,e)(u,c||f)},async postTemporarytableInPackage(n,r,o,a,i){const s=await t.postTemporarytableInPackage(n,r,o,a,i),c=e?.serverIndex??0,u=mn["ConnectionsApi.postTemporarytableInPackage"]?.[c]?.url;return(f,p)=>vn(s,_t,dn,e)(f,u||p)},async updateConnection(n,r,o,a){const i=await t.updateConnection(n,r,o,a),s=e?.serverIndex??0,c=mn["ConnectionsApi.updateConnection"]?.[s]?.url;return(u,f)=>vn(i,_t,dn,e)(u,c||f)}}};let toe=class extends Tl{createConnection(t,n,r,o){return Qo(this.configuration).createConnection(t,n,r,o).then(a=>a(this.axios,this.basePath))}deleteConnection(t,n,r){return Qo(this.configuration).deleteConnection(t,n,r).then(o=>o(this.axios,this.basePath))}getConnection(t,n,r){return Qo(this.configuration).getConnection(t,n,r).then(o=>o(this.axios,this.basePath))}getTable(t,n,r,o,a){return Qo(this.configuration).getTable(t,n,r,o,a).then(i=>i(this.axios,this.basePath))}getTableInPackage(t,n,r,o,a,i){return Qo(this.configuration).getTableInPackage(t,n,r,o,a,i).then(s=>s(this.axios,this.basePath))}listConnections(t,n){return Qo(this.configuration).listConnections(t,n).then(r=>r(this.axios,this.basePath))}listSchemas(t,n,r){return Qo(this.configuration).listSchemas(t,n,r).then(o=>o(this.axios,this.basePath))}listSchemasInPackage(t,n,r,o){return Qo(this.configuration).listSchemasInPackage(t,n,r,o).then(a=>a(this.axios,this.basePath))}listTables(t,n,r,o,a){return Qo(this.configuration).listTables(t,n,r,o,a).then(i=>i(this.axios,this.basePath))}listTablesInPackage(t,n,r,o,a,i){return Qo(this.configuration).listTablesInPackage(t,n,r,o,a,i).then(s=>s(this.axios,this.basePath))}postQuerydata(t,n,r,o){return Qo(this.configuration).postQuerydata(t,n,r,o).then(a=>a(this.axios,this.basePath))}postQuerydataInPackage(t,n,r,o,a){return Qo(this.configuration).postQuerydataInPackage(t,n,r,o,a).then(i=>i(this.axios,this.basePath))}postSqlsource(t,n,r,o){return Qo(this.configuration).postSqlsource(t,n,r,o).then(a=>a(this.axios,this.basePath))}postSqlsourceInPackage(t,n,r,o,a){return Qo(this.configuration).postSqlsourceInPackage(t,n,r,o,a).then(i=>i(this.axios,this.basePath))}postTemporarytable(t,n,r,o){return Qo(this.configuration).postTemporarytable(t,n,r,o).then(a=>a(this.axios,this.basePath))}postTemporarytableInPackage(t,n,r,o,a){return Qo(this.configuration).postTemporarytableInPackage(t,n,r,o,a).then(i=>i(this.axios,this.basePath))}updateConnection(t,n,r,o){return Qo(this.configuration).updateConnection(t,n,r,o).then(a=>a(this.axios,this.basePath))}};const noe=function(e){return{listDatabases:async(t,n,r,o={})=>{st("listDatabases","environmentName",t),st("listDatabases","packageName",n);const a="/environments/{environmentName}/packages/{packageName}/databases".replace("{environmentName}",encodeURIComponent(String(t))).replace("{packageName}",encodeURIComponent(String(n))),i=new URL(a,gn);let s;e&&(s=e.baseOptions);const c={method:"GET",...s,...o},u={},f={};r!==void 0&&(f.versionId=r),yn(i,f);let p=s&&s.headers?s.headers:{};return c.headers={...u,...p,...o.headers},{url:bn(i),options:c}}}},roe=function(e){const t=noe(e);return{async listDatabases(n,r,o,a){const i=await t.listDatabases(n,r,o,a),s=e?.serverIndex??0,c=mn["DatabasesApi.listDatabases"]?.[s]?.url;return(u,f)=>vn(i,_t,dn,e)(u,c||f)}}};let ooe=class extends Tl{listDatabases(t,n,r,o){return roe(this.configuration).listDatabases(t,n,r,o).then(a=>a(this.axios,this.basePath))}};const aoe=function(e){return{createEnvironment:async(t,n={})=>{st("createEnvironment","environment",t);const r="/environments",o=new URL(r,gn);let a;e&&(a=e.baseOptions);const i={method:"POST",...a,...n},s={},c={};s["Content-Type"]="application/json",yn(o,c);let u=a&&a.headers?a.headers:{};return i.headers={...s,...u,...n.headers},i.data=Xo(t,i,e),{url:bn(o),options:i}},deleteEnvironment:async(t,n={})=>{st("deleteEnvironment","environmentName",t);const r="/environments/{environmentName}".replace("{environmentName}",encodeURIComponent(String(t))),o=new URL(r,gn);let a;e&&(a=e.baseOptions);const i={method:"DELETE",...a,...n},s={};yn(o,{});let c=a&&a.headers?a.headers:{};return i.headers={...s,...c,...n.headers},{url:bn(o),options:i}},getEnvironment:async(t,n,r={})=>{st("getEnvironment","environmentName",t);const o="/environments/{environmentName}".replace("{environmentName}",encodeURIComponent(String(t))),a=new URL(o,gn);let i;e&&(i=e.baseOptions);const s={method:"GET",...i,...r},c={},u={};n!==void 0&&(u.reload=n),yn(a,u);let f=i&&i.headers?i.headers:{};return s.headers={...c,...f,...r.headers},{url:bn(a),options:s}},listEnvironments:async(t={})=>{const n="/environments",r=new URL(n,gn);let o;e&&(o=e.baseOptions);const a={method:"GET",...o,...t},i={};yn(r,{});let s=o&&o.headers?o.headers:{};return a.headers={...i,...s,...t.headers},{url:bn(r),options:a}},updateEnvironment:async(t,n,r={})=>{st("updateEnvironment","environmentName",t),st("updateEnvironment","environment",n);const o="/environments/{environmentName}".replace("{environmentName}",encodeURIComponent(String(t))),a=new URL(o,gn);let i;e&&(i=e.baseOptions);const s={method:"PATCH",...i,...r},c={},u={};c["Content-Type"]="application/json",yn(a,u);let f=i&&i.headers?i.headers:{};return s.headers={...c,...f,...r.headers},s.data=Xo(n,s,e),{url:bn(a),options:s}}}},Gm=function(e){const t=aoe(e);return{async createEnvironment(n,r){const o=await t.createEnvironment(n,r),a=e?.serverIndex??0,i=mn["EnvironmentsApi.createEnvironment"]?.[a]?.url;return(s,c)=>vn(o,_t,dn,e)(s,i||c)},async deleteEnvironment(n,r){const o=await t.deleteEnvironment(n,r),a=e?.serverIndex??0,i=mn["EnvironmentsApi.deleteEnvironment"]?.[a]?.url;return(s,c)=>vn(o,_t,dn,e)(s,i||c)},async getEnvironment(n,r,o){const a=await t.getEnvironment(n,r,o),i=e?.serverIndex??0,s=mn["EnvironmentsApi.getEnvironment"]?.[i]?.url;return(c,u)=>vn(a,_t,dn,e)(c,s||u)},async listEnvironments(n){const r=await t.listEnvironments(n),o=e?.serverIndex??0,a=mn["EnvironmentsApi.listEnvironments"]?.[o]?.url;return(i,s)=>vn(r,_t,dn,e)(i,a||s)},async updateEnvironment(n,r,o){const a=await t.updateEnvironment(n,r,o),i=e?.serverIndex??0,s=mn["EnvironmentsApi.updateEnvironment"]?.[i]?.url;return(c,u)=>vn(a,_t,dn,e)(c,s||u)}}};let ioe=class extends Tl{createEnvironment(t,n){return Gm(this.configuration).createEnvironment(t,n).then(r=>r(this.axios,this.basePath))}deleteEnvironment(t,n){return Gm(this.configuration).deleteEnvironment(t,n).then(r=>r(this.axios,this.basePath))}getEnvironment(t,n,r){return Gm(this.configuration).getEnvironment(t,n,r).then(o=>o(this.axios,this.basePath))}listEnvironments(t){return Gm(this.configuration).listEnvironments(t).then(n=>n(this.axios,this.basePath))}updateEnvironment(t,n,r){return Gm(this.configuration).updateEnvironment(t,n,r).then(o=>o(this.axios,this.basePath))}};const soe=function(e){return{createMaterialization:async(t,n,r,o={})=>{st("createMaterialization","environmentName",t),st("createMaterialization","packageName",n);const a="/environments/{environmentName}/packages/{packageName}/materializations".replace("{environmentName}",encodeURIComponent(String(t))).replace("{packageName}",encodeURIComponent(String(n))),i=new URL(a,gn);let s;e&&(s=e.baseOptions);const c={method:"POST",...s,...o},u={},f={};u["Content-Type"]="application/json",yn(i,f);let p=s&&s.headers?s.headers:{};return c.headers={...u,...p,...o.headers},c.data=Xo(r,c,e),{url:bn(i),options:c}},deleteMaterialization:async(t,n,r,o,a={})=>{st("deleteMaterialization","environmentName",t),st("deleteMaterialization","packageName",n),st("deleteMaterialization","materializationId",r);const i="/environments/{environmentName}/packages/{packageName}/materializations/{materializationId}".replace("{environmentName}",encodeURIComponent(String(t))).replace("{packageName}",encodeURIComponent(String(n))).replace("{materializationId}",encodeURIComponent(String(r))),s=new URL(i,gn);let c;e&&(c=e.baseOptions);const u={method:"DELETE",...c,...a},f={},p={};o!==void 0&&(p.dropTables=o),yn(s,p);let y=c&&c.headers?c.headers:{};return u.headers={...f,...y,...a.headers},{url:bn(s),options:u}},getMaterialization:async(t,n,r,o={})=>{st("getMaterialization","environmentName",t),st("getMaterialization","packageName",n),st("getMaterialization","materializationId",r);const a="/environments/{environmentName}/packages/{packageName}/materializations/{materializationId}".replace("{environmentName}",encodeURIComponent(String(t))).replace("{packageName}",encodeURIComponent(String(n))).replace("{materializationId}",encodeURIComponent(String(r))),i=new URL(a,gn);let s;e&&(s=e.baseOptions);const c={method:"GET",...s,...o},u={};yn(i,{});let f=s&&s.headers?s.headers:{};return c.headers={...u,...f,...o.headers},{url:bn(i),options:c}},listEnvironmentMaterializations:async(t,n,r,o={})=>{st("listEnvironmentMaterializations","environmentName",t);const a="/environments/{environmentName}/packages/materializations".replace("{environmentName}",encodeURIComponent(String(t))),i=new URL(a,gn);let s;e&&(s=e.baseOptions);const c={method:"GET",...s,...o},u={},f={};n!==void 0&&(f.limit=n),r!==void 0&&(f.offset=r),yn(i,f);let p=s&&s.headers?s.headers:{};return c.headers={...u,...p,...o.headers},{url:bn(i),options:c}},listMaterializations:async(t,n,r,o,a={})=>{st("listMaterializations","environmentName",t),st("listMaterializations","packageName",n);const i="/environments/{environmentName}/packages/{packageName}/materializations".replace("{environmentName}",encodeURIComponent(String(t))).replace("{packageName}",encodeURIComponent(String(n))),s=new URL(i,gn);let c;e&&(c=e.baseOptions);const u={method:"GET",...c,...a},f={},p={};r!==void 0&&(p.limit=r),o!==void 0&&(p.offset=o),yn(s,p);let y=c&&c.headers?c.headers:{};return u.headers={...f,...y,...a.headers},{url:bn(s),options:u}},materializationAction:async(t,n,r,o,a={})=>{st("materializationAction","environmentName",t),st("materializationAction","packageName",n),st("materializationAction","materializationId",r),st("materializationAction","action",o);const i="/environments/{environmentName}/packages/{packageName}/materializations/{materializationId}".replace("{environmentName}",encodeURIComponent(String(t))).replace("{packageName}",encodeURIComponent(String(n))).replace("{materializationId}",encodeURIComponent(String(r))),s=new URL(i,gn);let c;e&&(c=e.baseOptions);const u={method:"POST",...c,...a},f={},p={};o!==void 0&&(p.action=o),yn(s,p);let y=c&&c.headers?c.headers:{};return u.headers={...f,...y,...a.headers},{url:bn(s),options:u}}}},Xf=function(e){const t=soe(e);return{async createMaterialization(n,r,o,a){const i=await t.createMaterialization(n,r,o,a),s=e?.serverIndex??0,c=mn["MaterializationsApi.createMaterialization"]?.[s]?.url;return(u,f)=>vn(i,_t,dn,e)(u,c||f)},async deleteMaterialization(n,r,o,a,i){const s=await t.deleteMaterialization(n,r,o,a,i),c=e?.serverIndex??0,u=mn["MaterializationsApi.deleteMaterialization"]?.[c]?.url;return(f,p)=>vn(s,_t,dn,e)(f,u||p)},async getMaterialization(n,r,o,a){const i=await t.getMaterialization(n,r,o,a),s=e?.serverIndex??0,c=mn["MaterializationsApi.getMaterialization"]?.[s]?.url;return(u,f)=>vn(i,_t,dn,e)(u,c||f)},async listEnvironmentMaterializations(n,r,o,a){const i=await t.listEnvironmentMaterializations(n,r,o,a),s=e?.serverIndex??0,c=mn["MaterializationsApi.listEnvironmentMaterializations"]?.[s]?.url;return(u,f)=>vn(i,_t,dn,e)(u,c||f)},async listMaterializations(n,r,o,a,i){const s=await t.listMaterializations(n,r,o,a,i),c=e?.serverIndex??0,u=mn["MaterializationsApi.listMaterializations"]?.[c]?.url;return(f,p)=>vn(s,_t,dn,e)(f,u||p)},async materializationAction(n,r,o,a,i){const s=await t.materializationAction(n,r,o,a,i),c=e?.serverIndex??0,u=mn["MaterializationsApi.materializationAction"]?.[c]?.url;return(f,p)=>vn(s,_t,dn,e)(f,u||p)}}};let loe=class extends Tl{createMaterialization(t,n,r,o){return Xf(this.configuration).createMaterialization(t,n,r,o).then(a=>a(this.axios,this.basePath))}deleteMaterialization(t,n,r,o,a){return Xf(this.configuration).deleteMaterialization(t,n,r,o,a).then(i=>i(this.axios,this.basePath))}getMaterialization(t,n,r,o){return Xf(this.configuration).getMaterialization(t,n,r,o).then(a=>a(this.axios,this.basePath))}listEnvironmentMaterializations(t,n,r,o){return Xf(this.configuration).listEnvironmentMaterializations(t,n,r,o).then(a=>a(this.axios,this.basePath))}listMaterializations(t,n,r,o,a){return Xf(this.configuration).listMaterializations(t,n,r,o,a).then(i=>i(this.axios,this.basePath))}materializationAction(t,n,r,o,a){return Xf(this.configuration).materializationAction(t,n,r,o,a).then(i=>i(this.axios,this.basePath))}};const rj={Stop:"stop"},coe=function(e){return{compileModelSource:async(t,n,r,o,a={})=>{st("compileModelSource","environmentName",t),st("compileModelSource","packageName",n),st("compileModelSource","path",r),st("compileModelSource","compileRequest",o);const i="/environments/{environmentName}/packages/{packageName}/models/{path}/compile".replace("{environmentName}",encodeURIComponent(String(t))).replace("{packageName}",encodeURIComponent(String(n))).replace("{path}",encodeURIComponent(String(r))),s=new URL(i,gn);let c;e&&(c=e.baseOptions);const u={method:"POST",...c,...a},f={},p={};f["Content-Type"]="application/json",yn(s,p);let y=c&&c.headers?c.headers:{};return u.headers={...f,...y,...a.headers},u.data=Xo(o,u,e),{url:bn(s),options:u}},executeQueryModel:async(t,n,r,o,a={})=>{st("executeQueryModel","environmentName",t),st("executeQueryModel","packageName",n),st("executeQueryModel","path",r),st("executeQueryModel","queryRequest",o);const i="/environments/{environmentName}/packages/{packageName}/models/{path}/query".replace("{environmentName}",encodeURIComponent(String(t))).replace("{packageName}",encodeURIComponent(String(n))).replace("{path}",encodeURIComponent(String(r))),s=new URL(i,gn);let c;e&&(c=e.baseOptions);const u={method:"POST",...c,...a},f={},p={};f["Content-Type"]="application/json",yn(s,p);let y=c&&c.headers?c.headers:{};return u.headers={...f,...y,...a.headers},u.data=Xo(o,u,e),{url:bn(s),options:u}},getModel:async(t,n,r,o,a={})=>{st("getModel","environmentName",t),st("getModel","packageName",n),st("getModel","path",r);const i="/environments/{environmentName}/packages/{packageName}/models/{path}".replace("{environmentName}",encodeURIComponent(String(t))).replace("{packageName}",encodeURIComponent(String(n))).replace("{path}",encodeURIComponent(String(r))),s=new URL(i,gn);let c;e&&(c=e.baseOptions);const u={method:"GET",...c,...a},f={},p={};o!==void 0&&(p.versionId=o),yn(s,p);let y=c&&c.headers?c.headers:{};return u.headers={...f,...y,...a.headers},{url:bn(s),options:u}},listModels:async(t,n,r,o={})=>{st("listModels","environmentName",t),st("listModels","packageName",n);const a="/environments/{environmentName}/packages/{packageName}/models".replace("{environmentName}",encodeURIComponent(String(t))).replace("{packageName}",encodeURIComponent(String(n))),i=new URL(a,gn);let s;e&&(s=e.baseOptions);const c={method:"GET",...s,...o},u={},f={};r!==void 0&&(f.versionId=r),yn(i,f);let p=s&&s.headers?s.headers:{};return c.headers={...u,...p,...o.headers},{url:bn(i),options:c}}}},g0=function(e){const t=coe(e);return{async compileModelSource(n,r,o,a,i){const s=await t.compileModelSource(n,r,o,a,i),c=e?.serverIndex??0,u=mn["ModelsApi.compileModelSource"]?.[c]?.url;return(f,p)=>vn(s,_t,dn,e)(f,u||p)},async executeQueryModel(n,r,o,a,i){const s=await t.executeQueryModel(n,r,o,a,i),c=e?.serverIndex??0,u=mn["ModelsApi.executeQueryModel"]?.[c]?.url;return(f,p)=>vn(s,_t,dn,e)(f,u||p)},async getModel(n,r,o,a,i){const s=await t.getModel(n,r,o,a,i),c=e?.serverIndex??0,u=mn["ModelsApi.getModel"]?.[c]?.url;return(f,p)=>vn(s,_t,dn,e)(f,u||p)},async listModels(n,r,o,a){const i=await t.listModels(n,r,o,a),s=e?.serverIndex??0,c=mn["ModelsApi.listModels"]?.[s]?.url;return(u,f)=>vn(i,_t,dn,e)(u,c||f)}}};let uoe=class extends Tl{compileModelSource(t,n,r,o,a){return g0(this.configuration).compileModelSource(t,n,r,o,a).then(i=>i(this.axios,this.basePath))}executeQueryModel(t,n,r,o,a){return g0(this.configuration).executeQueryModel(t,n,r,o,a).then(i=>i(this.axios,this.basePath))}getModel(t,n,r,o,a){return g0(this.configuration).getModel(t,n,r,o,a).then(i=>i(this.axios,this.basePath))}listModels(t,n,r,o){return g0(this.configuration).listModels(t,n,r,o).then(a=>a(this.axios,this.basePath))}};const doe=function(e){return{executeNotebookCell:async(t,n,r,o,a,i,s,c,u={})=>{st("executeNotebookCell","environmentName",t),st("executeNotebookCell","packageName",n),st("executeNotebookCell","path",r),st("executeNotebookCell","cellIndex",o);const f="/environments/{environmentName}/packages/{packageName}/notebooks/{path}/cells/{cellIndex}".replace("{environmentName}",encodeURIComponent(String(t))).replace("{packageName}",encodeURIComponent(String(n))).replace("{path}",encodeURIComponent(String(r))).replace("{cellIndex}",encodeURIComponent(String(o))),p=new URL(f,gn);let y;e&&(y=e.baseOptions);const g={method:"GET",...y,...u},b={},x={};a!==void 0&&(x.versionId=a),i!==void 0&&(x.filter_params=i),s!==void 0&&(x.bypass_filters=s),c!==void 0&&(x.givens=c),yn(p,x);let E=y&&y.headers?y.headers:{};return g.headers={...b,...E,...u.headers},{url:bn(p),options:g}},getNotebook:async(t,n,r,o,a={})=>{st("getNotebook","environmentName",t),st("getNotebook","packageName",n),st("getNotebook","path",r);const i="/environments/{environmentName}/packages/{packageName}/notebooks/{path}".replace("{environmentName}",encodeURIComponent(String(t))).replace("{packageName}",encodeURIComponent(String(n))).replace("{path}",encodeURIComponent(String(r))),s=new URL(i,gn);let c;e&&(c=e.baseOptions);const u={method:"GET",...c,...a},f={},p={};o!==void 0&&(p.versionId=o),yn(s,p);let y=c&&c.headers?c.headers:{};return u.headers={...f,...y,...a.headers},{url:bn(s),options:u}},listNotebooks:async(t,n,r,o={})=>{st("listNotebooks","environmentName",t),st("listNotebooks","packageName",n);const a="/environments/{environmentName}/packages/{packageName}/notebooks".replace("{environmentName}",encodeURIComponent(String(t))).replace("{packageName}",encodeURIComponent(String(n))),i=new URL(a,gn);let s;e&&(s=e.baseOptions);const c={method:"GET",...s,...o},u={},f={};r!==void 0&&(f.versionId=r),yn(i,f);let p=s&&s.headers?s.headers:{};return c.headers={...u,...p,...o.headers},{url:bn(i),options:c}}}},yT=function(e){const t=doe(e);return{async executeNotebookCell(n,r,o,a,i,s,c,u,f){const p=await t.executeNotebookCell(n,r,o,a,i,s,c,u,f),y=e?.serverIndex??0,g=mn["NotebooksApi.executeNotebookCell"]?.[y]?.url;return(b,x)=>vn(p,_t,dn,e)(b,g||x)},async getNotebook(n,r,o,a,i){const s=await t.getNotebook(n,r,o,a,i),c=e?.serverIndex??0,u=mn["NotebooksApi.getNotebook"]?.[c]?.url;return(f,p)=>vn(s,_t,dn,e)(f,u||p)},async listNotebooks(n,r,o,a){const i=await t.listNotebooks(n,r,o,a),s=e?.serverIndex??0,c=mn["NotebooksApi.listNotebooks"]?.[s]?.url;return(u,f)=>vn(i,_t,dn,e)(u,c||f)}}};let foe=class extends Tl{executeNotebookCell(t,n,r,o,a,i,s,c,u){return yT(this.configuration).executeNotebookCell(t,n,r,o,a,i,s,c,u).then(f=>f(this.axios,this.basePath))}getNotebook(t,n,r,o,a){return yT(this.configuration).getNotebook(t,n,r,o,a).then(i=>i(this.axios,this.basePath))}listNotebooks(t,n,r,o){return yT(this.configuration).listNotebooks(t,n,r,o).then(a=>a(this.axios,this.basePath))}};const poe=function(e){return{createPackage:async(t,n,r={})=>{st("createPackage","environmentName",t),st("createPackage","_package",n);const o="/environments/{environmentName}/packages".replace("{environmentName}",encodeURIComponent(String(t))),a=new URL(o,gn);let i;e&&(i=e.baseOptions);const s={method:"POST",...i,...r},c={},u={};c["Content-Type"]="application/json",yn(a,u);let f=i&&i.headers?i.headers:{};return s.headers={...c,...f,...r.headers},s.data=Xo(n,s,e),{url:bn(a),options:s}},deletePackage:async(t,n,r={})=>{st("deletePackage","environmentName",t),st("deletePackage","packageName",n);const o="/environments/{environmentName}/packages/{packageName}".replace("{environmentName}",encodeURIComponent(String(t))).replace("{packageName}",encodeURIComponent(String(n))),a=new URL(o,gn);let i;e&&(i=e.baseOptions);const s={method:"DELETE",...i,...r},c={};yn(a,{});let u=i&&i.headers?i.headers:{};return s.headers={...c,...u,...r.headers},{url:bn(a),options:s}},getPackage:async(t,n,r,o,a={})=>{st("getPackage","environmentName",t),st("getPackage","packageName",n);const i="/environments/{environmentName}/packages/{packageName}".replace("{environmentName}",encodeURIComponent(String(t))).replace("{packageName}",encodeURIComponent(String(n))),s=new URL(i,gn);let c;e&&(c=e.baseOptions);const u={method:"GET",...c,...a},f={},p={};r!==void 0&&(p.versionId=r),o!==void 0&&(p.reload=o),yn(s,p);let y=c&&c.headers?c.headers:{};return u.headers={...f,...y,...a.headers},{url:bn(s),options:u}},listPackages:async(t,n={})=>{st("listPackages","environmentName",t);const r="/environments/{environmentName}/packages".replace("{environmentName}",encodeURIComponent(String(t))),o=new URL(r,gn);let a;e&&(a=e.baseOptions);const i={method:"GET",...a,...n},s={};yn(o,{});let c=a&&a.headers?a.headers:{};return i.headers={...s,...c,...n.headers},{url:bn(o),options:i}},updatePackage:async(t,n,r,o={})=>{st("updatePackage","environmentName",t),st("updatePackage","packageName",n),st("updatePackage","_package",r);const a="/environments/{environmentName}/packages/{packageName}".replace("{environmentName}",encodeURIComponent(String(t))).replace("{packageName}",encodeURIComponent(String(n))),i=new URL(a,gn);let s;e&&(s=e.baseOptions);const c={method:"PATCH",...s,...o},u={},f={};u["Content-Type"]="application/json",yn(i,f);let p=s&&s.headers?s.headers:{};return c.headers={...u,...p,...o.headers},c.data=Xo(r,c,e),{url:bn(i),options:c}}}},Ym=function(e){const t=poe(e);return{async createPackage(n,r,o){const a=await t.createPackage(n,r,o),i=e?.serverIndex??0,s=mn["PackagesApi.createPackage"]?.[i]?.url;return(c,u)=>vn(a,_t,dn,e)(c,s||u)},async deletePackage(n,r,o){const a=await t.deletePackage(n,r,o),i=e?.serverIndex??0,s=mn["PackagesApi.deletePackage"]?.[i]?.url;return(c,u)=>vn(a,_t,dn,e)(c,s||u)},async getPackage(n,r,o,a,i){const s=await t.getPackage(n,r,o,a,i),c=e?.serverIndex??0,u=mn["PackagesApi.getPackage"]?.[c]?.url;return(f,p)=>vn(s,_t,dn,e)(f,u||p)},async listPackages(n,r){const o=await t.listPackages(n,r),a=e?.serverIndex??0,i=mn["PackagesApi.listPackages"]?.[a]?.url;return(s,c)=>vn(o,_t,dn,e)(s,i||c)},async updatePackage(n,r,o,a){const i=await t.updatePackage(n,r,o,a),s=e?.serverIndex??0,c=mn["PackagesApi.updatePackage"]?.[s]?.url;return(u,f)=>vn(i,_t,dn,e)(u,c||f)}}};let hoe=class extends Tl{createPackage(t,n,r){return Ym(this.configuration).createPackage(t,n,r).then(o=>o(this.axios,this.basePath))}deletePackage(t,n,r){return Ym(this.configuration).deletePackage(t,n,r).then(o=>o(this.axios,this.basePath))}getPackage(t,n,r,o,a){return Ym(this.configuration).getPackage(t,n,r,o,a).then(i=>i(this.axios,this.basePath))}listPackages(t,n){return Ym(this.configuration).listPackages(t,n).then(r=>r(this.axios,this.basePath))}updatePackage(t,n,r,o){return Ym(this.configuration).updatePackage(t,n,r,o).then(a=>a(this.axios,this.basePath))}};const moe=function(e){return{listPages:async(t,n,r={})=>{st("listPages","environmentName",t),st("listPages","packageName",n);const o="/environments/{environmentName}/packages/{packageName}/pages".replace("{environmentName}",encodeURIComponent(String(t))).replace("{packageName}",encodeURIComponent(String(n))),a=new URL(o,gn);let i;e&&(i=e.baseOptions);const s={method:"GET",...i,...r},c={};yn(a,{});let u=i&&i.headers?i.headers:{};return s.headers={...c,...u,...r.headers},{url:bn(a),options:s}}}},goe=function(e){const t=moe(e);return{async listPages(n,r,o){const a=await t.listPages(n,r,o),i=e?.serverIndex??0,s=mn["PagesApi.listPages"]?.[i]?.url;return(c,u)=>vn(a,_t,dn,e)(c,s||u)}}};let yoe=class extends Tl{listPages(t,n,r){return goe(this.configuration).listPages(t,n,r).then(o=>o(this.axios,this.basePath))}};const boe=function(e){return{deleteTheme:async(t={})=>{const n="/theme",r=new URL(n,gn);let o;e&&(o=e.baseOptions);const a={method:"DELETE",...o,...t},i={};yn(r,{});let s=o&&o.headers?o.headers:{};return a.headers={...i,...s,...t.headers},{url:bn(r),options:a}},getStatus:async(t={})=>{const n="/status",r=new URL(n,gn);let o;e&&(o=e.baseOptions);const a={method:"GET",...o,...t},i={};yn(r,{});let s=o&&o.headers?o.headers:{};return a.headers={...i,...s,...t.headers},{url:bn(r),options:a}},getTheme:async(t={})=>{const n="/theme",r=new URL(n,gn);let o;e&&(o=e.baseOptions);const a={method:"GET",...o,...t},i={};yn(r,{});let s=o&&o.headers?o.headers:{};return a.headers={...i,...s,...t.headers},{url:bn(r),options:a}},updateTheme:async(t,n={})=>{st("updateTheme","theme",t);const r="/theme",o=new URL(r,gn);let a;e&&(a=e.baseOptions);const i={method:"PUT",...a,...n},s={},c={};s["Content-Type"]="application/json",yn(o,c);let u=a&&a.headers?a.headers:{};return i.headers={...s,...u,...n.headers},i.data=Xo(t,i,e),{url:bn(o),options:i}}}},y0=function(e){const t=boe(e);return{async deleteTheme(n){const r=await t.deleteTheme(n),o=e?.serverIndex??0,a=mn["PublisherApi.deleteTheme"]?.[o]?.url;return(i,s)=>vn(r,_t,dn,e)(i,a||s)},async getStatus(n){const r=await t.getStatus(n),o=e?.serverIndex??0,a=mn["PublisherApi.getStatus"]?.[o]?.url;return(i,s)=>vn(r,_t,dn,e)(i,a||s)},async getTheme(n){const r=await t.getTheme(n),o=e?.serverIndex??0,a=mn["PublisherApi.getTheme"]?.[o]?.url;return(i,s)=>vn(r,_t,dn,e)(i,a||s)},async updateTheme(n,r){const o=await t.updateTheme(n,r),a=e?.serverIndex??0,i=mn["PublisherApi.updateTheme"]?.[a]?.url;return(s,c)=>vn(o,_t,dn,e)(s,i||c)}}};let voe=class extends Tl{deleteTheme(t){return y0(this.configuration).deleteTheme(t).then(n=>n(this.axios,this.basePath))}getStatus(t){return y0(this.configuration).getStatus(t).then(n=>n(this.axios,this.basePath))}getTheme(t){return y0(this.configuration).getTheme(t).then(n=>n(this.axios,this.basePath))}updateTheme(t,n){return y0(this.configuration).updateTheme(t,n).then(r=>r(this.axios,this.basePath))}};const xoe=function(e){return{getWatchStatus:async(t={})=>{const n="/watch-mode/status",r=new URL(n,gn);let o;e&&(o=e.baseOptions);const a={method:"GET",...o,...t},i={};yn(r,{});let s=o&&o.headers?o.headers:{};return a.headers={...i,...s,...t.headers},{url:bn(r),options:a}},startWatching:async(t,n={})=>{st("startWatching","startWatchRequest",t);const r="/watch-mode/start",o=new URL(r,gn);let a;e&&(a=e.baseOptions);const i={method:"POST",...a,...n},s={},c={};s["Content-Type"]="application/json",yn(o,c);let u=a&&a.headers?a.headers:{};return i.headers={...s,...u,...n.headers},i.data=Xo(t,i,e),{url:bn(o),options:i}},stopWatching:async(t={})=>{const n="/watch-mode/stop",r=new URL(n,gn);let o;e&&(o=e.baseOptions);const a={method:"POST",...o,...t},i={};yn(r,{});let s=o&&o.headers?o.headers:{};return a.headers={...i,...s,...t.headers},{url:bn(r),options:a}},streamPackageEvents:async(t,n,r={})=>{st("streamPackageEvents","environmentName",t),st("streamPackageEvents","packageName",n);const o="/environments/{environmentName}/packages/{packageName}/events".replace("{environmentName}",encodeURIComponent(String(t))).replace("{packageName}",encodeURIComponent(String(n))),a=new URL(o,gn);let i;e&&(i=e.baseOptions);const s={method:"GET",...i,...r},c={};yn(a,{});let u=i&&i.headers?i.headers:{};return s.headers={...c,...u,...r.headers},{url:bn(a),options:s}}}},b0=function(e){const t=xoe(e);return{async getWatchStatus(n){const r=await t.getWatchStatus(n),o=e?.serverIndex??0,a=mn["WatchModeApi.getWatchStatus"]?.[o]?.url;return(i,s)=>vn(r,_t,dn,e)(i,a||s)},async startWatching(n,r){const o=await t.startWatching(n,r),a=e?.serverIndex??0,i=mn["WatchModeApi.startWatching"]?.[a]?.url;return(s,c)=>vn(o,_t,dn,e)(s,i||c)},async stopWatching(n){const r=await t.stopWatching(n),o=e?.serverIndex??0,a=mn["WatchModeApi.stopWatching"]?.[o]?.url;return(i,s)=>vn(r,_t,dn,e)(i,a||s)},async streamPackageEvents(n,r,o){const a=await t.streamPackageEvents(n,r,o),i=e?.serverIndex??0,s=mn["WatchModeApi.streamPackageEvents"]?.[i]?.url;return(c,u)=>vn(a,_t,dn,e)(c,s||u)}}};let Soe=class extends Tl{getWatchStatus(t){return b0(this.configuration).getWatchStatus(t).then(n=>n(this.axios,this.basePath))}startWatching(t,n){return b0(this.configuration).startWatching(t,n).then(r=>r(this.axios,this.basePath))}stopWatching(t){return b0(this.configuration).stopWatching(t).then(n=>n(this.axios,this.basePath))}streamPackageEvents(t,n,r){return b0(this.configuration).streamPackageEvents(t,n,r).then(o=>o(this.axios,this.basePath))}},Eoe=class{apiKey;username;password;accessToken;basePath;serverIndex;baseOptions;formDataCtor;constructor(t={}){this.apiKey=t.apiKey,this.username=t.username,this.password=t.password,this.accessToken=t.accessToken,this.basePath=t.basePath,this.serverIndex=t.serverIndex,this.baseOptions={...t.baseOptions,headers:{...t.baseOptions?.headers}},this.formDataCtor=t.formDataCtor}isJsonMime(t){const n=new RegExp("^(application/json|[^;/ ]+/[^;/ ]+[+]json)[ ]*(;.*)?$","i");return t!==null&&(n.test(t)||t.toLowerCase()==="application/json-patch+json")}};const Ba={teal:"#14b3cb",orange:"#e47404",darkBlue:"#1474a4"},gi='"JetBrains Mono", "ui-monospace", "SFMono-Regular", "Menlo", monospace',L1=Ye(ch)({display:"flex",flexDirection:"column",height:"100%",boxShadow:"none",border:"none",backgroundColor:"transparent"}),oj=Ye(uh)({display:"flex",flexDirection:"column",padding:"0",flexGrow:1}),wA=Ye(QX)({padding:"0"}),Coe=Ye("div")(({theme:e})=>({backgroundColor:e.palette.background.default,padding:"0 8px 0px 8px",borderRadius:"12px",boxShadow:"none",border:"none",maxWidth:"1200px",margin:"0 auto"}));Ye("div")(({theme:e})=>({marginBottom:"40px",paddingBottom:"24px",borderBottom:`1px solid ${e.palette.divider}`}));const Toe=Ye("div")({marginBottom:"48px",padding:"0",backgroundColor:"transparent",border:"none",boxShadow:"none"}),ik=Ye("div")({marginBottom:"0",padding:"0",backgroundColor:"transparent",border:"none",boxShadow:"none"}),J0=Ye("div")({backgroundColor:"transparent",paddingTop:"12px",paddingBottom:"2px",borderRadius:"8px",border:"none",boxShadow:"none",marginBottom:"0"});Ye("div")(({theme:e})=>({backgroundColor:e.palette.mode==="dark"?"#1e293b":"#f8f9fa",padding:"16px",borderRadius:"8px",border:`1px solid ${e.palette.divider}`,fontFamily:"'Monaco', 'Menlo', 'Ubuntu Mono', monospace",fontSize:"13px",lineHeight:"1.5",overflowX:"auto",color:e.palette.text.primary}));Ye("div")(({theme:e})=>({backgroundColor:e.palette.mode==="dark"?"#1e293b":"#f8f9fa",padding:"12px 16px",borderRadius:"8px",border:`1px solid ${e.palette.divider}`,marginBottom:"16px",display:"flex",justifyContent:"space-between",alignItems:"center"}));const woe=Ye("div")({height:"100%"});Ye("div")({height:"30px",backgroundColor:"rgba(225, 240, 255, 1)",display:"flex",padding:"4px",alignItems:"center"});const aj=Ye("div")({height:"75vh",width:"100%",overflowY:"auto"});Ye("div")({position:"relative",height:"100%",flex:"0 0 auto"});const koe=Ye(ch)(({theme:e})=>({backgroundColor:e.palette.background.paper,padding:"24px",borderRadius:"8px",border:`1px solid ${e.palette.divider}`,boxShadow:"0 1px 3px rgba(0, 0, 0, 0.04)",height:"100%",transition:"box-shadow 0.2s ease-in-out","&:hover":{boxShadow:"0 2px 6px rgba(0, 0, 0, 0.08)"}})),Aoe=Ye(uh)({padding:"0","&:last-child":{paddingBottom:"0"}}),Doe=Ye("div")(({theme:e})=>({fontSize:"0.875rem",fontWeight:500,color:e.palette.text.secondary,marginBottom:"16px",paddingBottom:"8px",borderBottom:`1px solid ${e.palette.divider}`}));Ye("div")({padding:"32px",maxWidth:"1400px",margin:"0 auto",minHeight:"100vh"});const Ooe=[Ba.teal,Ba.orange,Ba.darkBlue,"#66cedc","#ec72b8","#f9c85b","#aacd85","#b87ced"],Roe="Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif",jI={palette:{series:Ooe,background:{light:"#ffffff",dark:"#1e293b"},tableHeader:{light:"#5d626b",dark:"#cbd5e1"},tableHeaderBackground:{light:"#f5fafc",dark:"#1e293b"},tableBody:{light:"#727883",dark:"#e2e8f0"},tile:{light:"#f5fafc",dark:"#0f172a"},tileTitle:{light:"#5d626b",dark:"#94a3b8"},mapColor:{light:Ba.teal,dark:Ba.teal}},font:{family:Roe,size:12}},ij=["background","tableHeader","tableHeaderBackground","tableBody","tile","tileTitle","mapColor"];function kA(e,t){const n=jI.palette??{},r=jI.font??{family:"sans-serif",size:12};let o=[...n.series??[]],a=r.family??"sans-serif",i=r.size??12;const s={background:{...n.background??{}},tableHeader:{...n.tableHeader??{}},tableHeaderBackground:{...n.tableHeaderBackground??{}},tableBody:{...n.tableBody??{}},tile:{...n.tile??{}},tileTitle:{...n.tileTitle??{}},mapColor:{...n.mapColor??{}}};for(const p of e)if(p){Array.isArray(p.palette?.series)&&(o=[...p.palette.series]);for(const y of ij){const g=p.palette?.[y];g&&(s[y]={...s[y],...g})}typeof p.font?.family=="string"&&(a=p.font.family),typeof p.font?.size=="number"&&(i=p.font.size)}const c=t==="dark",u=p=>s[p][t]??n[p]?.[t],f=u("background");return{mode:t,series:o,font:{family:a,size:i},background:f,tableHeader:u("tableHeader"),tableHeaderBackground:u("tableHeaderBackground"),tableBody:u("tableBody"),tile:u("tile"),tileTitle:u("tileTitle"),mapColor:u("mapColor"),tableBackground:f,border:c?"1px solid #334155":"1px solid #e5e7eb",pinnedBorder:c?"1px solid #475569":"1px solid #daedf3",valueColor:c?"#f1f5f9":"#1f2937",foreground:c?"#e2e8f0":"#1f2937",axisFaint:c?"#475569":"#d1d5db",dashboardRoot:c?"#1e293b":"#ffffff"}}function Moe(e,t,n){const r=t??e??"light";return r==="auto"?n?"dark":"light":r}const sj=T.createContext(void 0);function Noe({layers:e,mode:t,userChoice:n,setMode:r,allowUserToggle:o=!0,children:a}){const i=T.useMemo(()=>kA(e,t),[e,t]),s=T.useMemo(()=>({theme:i,layers:e,mode:t,userChoice:n,setMode:r,allowUserToggle:o}),[i,e,t,n,r,o]);return m.jsx(sj.Provider,{value:s,children:a})}function mb(){return T.useContext(sj)||{theme:kA([],"light"),layers:[],mode:"light",userChoice:void 0,setMode:()=>{},allowUserToggle:!1}}const AA=new dne({defaultOptions:{queries:{retry:!1,throwOnError:!1},mutations:{retry:!1,throwOnError:!1}}}),Poe={staleTime:300*1e3,refetchOnWindowFocus:!1,refetchOnReconnect:!1},sk="publisher:themeMode";function Ioe(){if(!(typeof window>"u"))try{const e=window.localStorage.getItem(sk);if(e==="light"||e==="dark"||e==="auto")return e}catch{}}function _oe(e){if(!(typeof window>"u"))try{e===void 0?window.localStorage.removeItem(sk):window.localStorage.setItem(sk,e)}catch{}}function Loe(){return typeof window>"u"||!window.matchMedia?!1:window.matchMedia("(prefers-color-scheme: dark)").matches}_t.defaults.baseURL||(_t.defaults.baseURL="IfYouAreSeeingThis_baseURL_IsNotSet");const lj=T.createContext(void 0),Foe=(e,t)=>{const n=`${window.location.protocol}//${window.location.host}/api/v0`,r=_t.create({baseURL:e||n,withCredentials:!0,timeout:6e5});r.interceptors.request.use(async a=>{const i=await t?.();return a.headers.Authorization=i||"",a});const o=new Eoe({basePath:n});return{models:new uoe(o,n,r),publisher:new voe(o,n,r),environments:new ioe(o,n,r),packages:new hoe(o,n,r),pages:new yoe(o,n,r),notebooks:new foe(o,n,r),connections:new toe(o,n,r),databases:new ooe(o,n,r),materializations:new loe(o,n,r),watchMode:new Soe(o,n,r)}},joe=e=>m.jsx(fne,{client:AA,children:m.jsx(Boe,{...e})}),Boe=({children:e,getAccessToken:t,baseURL:n,mutable:r,theme:o})=>{const a=T.useMemo(()=>Foe(n,t),[n,t]),i=n||`${window.location.protocol}//${window.location.host}/api/v0`,s=MF({queryKey:["status"],queryFn:async()=>(await a.publisher.getStatus()).data});s.error&&console.error("Failed to fetch publisher status:",s.error);const c=s.data?.frozenConfig,u=s.data?.theme,f=s.isLoading;let p;s.isLoading||s.error?p=r:c?p=!1:p=r??!0;const y=T.useMemo(()=>[u,o],[u,o]),[g,b]=T.useState(Ioe),[x,E]=T.useState(Loe);T.useEffect(()=>{if(typeof window>"u"||!window.matchMedia)return;const D=window.matchMedia("(prefers-color-scheme: dark)"),I=L=>E(L.matches);return D.addEventListener("change",I),()=>D.removeEventListener("change",I)},[]);const S=T.useCallback(D=>{b(D),_oe(D)},[]),w=u?.allowUserToggle??!0,C=w?g:void 0,R=T.useMemo(()=>Moe(u?.defaultMode,C,x),[u?.defaultMode,C,x]),M={server:i,getAccessToken:t,apiClients:a,mutable:p,isLoadingStatus:f,instanceTheme:u};return m.jsx(lj.Provider,{value:M,children:m.jsx(Noe,{layers:y,mode:R,userChoice:C,setMode:S,allowUserToggle:w,children:e})})},Dr=()=>{const e=T.useContext(lj);if(e===void 0)throw new Error("useServer must be used within a ServerProvider");return e};function gd(){return gd=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},gd.apply(this,arguments)}const $oe=["children","options"],BI=["allowFullScreen","allowTransparency","autoComplete","autoFocus","autoPlay","cellPadding","cellSpacing","charSet","classId","colSpan","contentEditable","contextMenu","crossOrigin","encType","formAction","formEncType","formMethod","formNoValidate","formTarget","frameBorder","hrefLang","inputMode","keyParams","keyType","marginHeight","marginWidth","maxLength","mediaGroup","minLength","noValidate","radioGroup","readOnly","rowSpan","spellCheck","srcDoc","srcLang","srcSet","tabIndex","useMap"].reduce((e,t)=>(e[t.toLowerCase()]=t,e),{class:"className",for:"htmlFor"}),$I={amp:"&",apos:"'",gt:">",lt:"<",nbsp:" ",quot:"“"},zoe=["style","script","pre"],Hoe=["src","href","data","formAction","srcDoc","action"],Uoe=/([-A-Z0-9_:]+)(?:\s*=\s*(?:(?:"((?:\\.|[^"])*)")|(?:'((?:\\.|[^'])*)')|(?:\{((?:\\.|{[^}]*?}|[^}])*)\})))?/gi,Voe=/mailto:/i,Woe=/\n{2,}$/,zI=/^(\s*>[\s\S]*?)(?=\n\n|$)/,qoe=/^ *> ?/gm,Goe=/^(?:\[!([^\]]*)\]\n)?([\s\S]*)/,Yoe=/^ {2,}\n/,Koe=/^(?:( *[-*_])){3,} *(?:\n *)+\n/,HI=/^(?: {1,3})?(`{3,}|~{3,}) *(\S+)? *([^\n]*?)?\n([\s\S]*?)(?:\1\n?|$)/,UI=/^(?: {4}[^\n]+\n*)+(?:\n *)+\n?/,Qoe=/^(`+)((?:\\`|(?!\1)`|[^`])+)\1/,Xoe=/^(?:\n *)*\n/,Zoe=/\r\n?/g,Joe=/^\[\^([^\]]+)](:(.*)((\n+ {4,}.*)|(\n(?!\[\^).+))*)/,eae=/^\[\^([^\]]+)]/,tae=/\f/g,nae=/^---[ \t]*\n(.|\n)*\n---[ \t]*\n/,rae=/^\s*?\[(x|\s)\]/,VI=/^ *(#{1,6}) *([^\n]+?)(?: +#*)?(?:\n *)*(?:\n|$)/,WI=/^ *(#{1,6}) +([^\n]+?)(?: +#*)?(?:\n *)*(?:\n|$)/,qI=/^([^\n]+)\n *(=|-){3,} *\n/,bT=/^ *(?!<[a-z][^ >/]* ?\/>)<([a-z][^ >/]*) ?((?:[^>]*[^/])?)>\n?(\s*(?:<\1[^>]*?>[\s\S]*?<\/\1>|(?!<\1\b)[\s\S])*?)<\/\1>(?!<\/\1>)\n*/i,oae=/&([a-z0-9]+|#[0-9]{1,6}|#x[0-9a-fA-F]{1,6});/gi,GI=/^<!--[\s\S]*?(?:-->)/,aae=/^(data|aria|x)-[a-z_][a-z\d_.-]*$/,vT=/^ *<([a-z][a-z0-9:]*)(?:\s+((?:<.*?>|[^>])*))?\/?>(?!<\/\1>)(\s*\n)?/i,iae=/^\{.*\}$/,sae=/^(https?:\/\/[^\s<]+[^<.,:;"')\]\s])/,lae=/^<([^ >]+@[^ >]+)>/,cae=/^<([^ >]+:\/[^ >]+)>/,uae=/-([a-z])?/gi,YI=/^(\|.*)\n(?: *(\|? *[-:]+ *\|[-| :]*)\n((?:.*\|.*\n)*))?\n?/,dae=/^[^\n]+(?: \n|\n{2,})/,fae=/^\[([^\]]*)\]:\s+<?([^\s>]+)>?\s*("([^"]*)")?/,pae=/^!\[([^\]]*)\] ?\[([^\]]*)\]/,hae=/^\[([^\]]*)\] ?\[([^\]]*)\]/,mae=/(\n|^[-*]\s|^#|^ {2,}|^-{2,}|^>\s)/,gae=/\t/g,yae=/(^ *\||\| *$)/g,bae=/^ *:-+: *$/,vae=/^ *:-+ *$/,xae=/^ *-+: *$/,Xx=e=>`(?=[\\s\\S]+?\\1${e?"\\1":""})`,Zx="((?:\\[.*?\\][([].*?[)\\]]|<.*?>(?:.*?<.*?>)?|`.*?`|\\\\\\1|[\\s\\S])+?)",Sae=RegExp(`^([*_])\\1${Xx(1)}${Zx}\\1\\1(?!\\1)`),Eae=RegExp(`^([*_])${Xx(0)}${Zx}\\1(?!\\1)`),Cae=RegExp(`^(==)${Xx(0)}${Zx}\\1`),Tae=RegExp(`^(~~)${Xx(0)}${Zx}\\1`),wae=/^(:[a-zA-Z0-9-_]+:)/,kae=/^\\([^0-9A-Za-z\s])/,Aae=/\\([^0-9A-Za-z\s])/g,Dae=/^[\s\S](?:(?! \n|[0-9]\.|http)[^=*_~\-\n:<`\\\[!])*/,Oae=/^\n+/,Rae=/^([ \t]*)/,Mae=/(?:^|\n)( *)$/,DA="(?:\\d+\\.)",OA="(?:[*+-])";function cj(e){return"( *)("+(e===1?DA:OA)+") +"}const uj=cj(1),dj=cj(2);function fj(e){return RegExp("^"+(e===1?uj:dj))}const Nae=fj(1),Pae=fj(2);function pj(e){return RegExp("^"+(e===1?uj:dj)+"[^\\n]*(?:\\n(?!\\1"+(e===1?DA:OA)+" )[^\\n]*)*(\\n|$)","gm")}const Iae=pj(1),_ae=pj(2);function hj(e){const t=e===1?DA:OA;return RegExp("^( *)("+t+") [\\s\\S]+?(?:\\n{2,}(?! )(?!\\1"+t+" (?!"+t+" ))\\n*|\\s*\\n*$)")}const mj=hj(1),gj=hj(2);function KI(e,t){const n=t===1,r=n?mj:gj,o=n?Iae:_ae,a=n?Nae:Pae;return{t:i=>a.test(i),o:Vp(function(i,s){const c=Mae.exec(s.prevCapture);return c&&(s.list||!s.inline&&!s.simple)?r.exec(i=c[1]+i):null}),i:1,u(i,s,c){const u=n?+i[2]:void 0,f=i[0].replace(Woe,`
220
220
  `).match(o);let p=!1;return{items:f.map(function(y,g){const b=a.exec(y)[0].length,x=RegExp("^ {1,"+b+"}","gm"),E=y.replace(x,"").replace(a,""),S=g===f.length-1,w=E.indexOf(`
221
221
 
222
222
  `)!==-1||S&&p;p=w;const C=c.inline,R=c.list;let M;c.list=!0,w?(c.inline=!1,M=Gg(E)+`
@@ -323,8 +323,8 @@ import {${t.sourceName}}" from '${t.modelPath}'"
323
323
  - [ ] `),/^\d+.\s/.test(i)&&(C=`
324
324
  `+(parseInt(i)+1)+". "),Rp(r,C)}else if(e.code&&e.code.toLowerCase()==="keyd"&&e.ctrlKey){f1(e);var R={start:r.selectionStart,end:r.selectionEnd},M=R;R=cy({text:r.value,selection:R});var D=r.value.slice(R.start,R.end);s.setSelectionRange({start:R.end,end:R.end}),Rp(r,`
325
325
  `+D),s.setSelectionRange({start:M.start,end:M.end})}else e.code&&e.code.toLowerCase()==="arrowup"&&e.altKey?C_(e,-1):e.code&&e.code.toLowerCase()==="arrowdown"&&e.altKey&&C_(e,1)}var txe=["prefixCls","onChange"],nxe=["markdown","commands","fullscreen","preview","highlightEnable","extraCommands","tabSize","defaultTabEnable","autoFocusEnd","textareaWarp","dispatch"];function rxe(e){var{prefixCls:t,onChange:n}=e,r=fn(e,txe),o=T.useContext(Ch),{markdown:a,commands:i,fullscreen:s,preview:c,highlightEnable:u,extraCommands:f,tabSize:p,defaultTabEnable:y,autoFocusEnd:g,textareaWarp:b,dispatch:x}=o;fn(o,nxe);var E=vt.useRef(null),S=vt.useRef(),w=vt.useRef({fullscreen:s,preview:c});T.useEffect(()=>{w.current={fullscreen:s,preview:c,highlightEnable:u}},[s,c,u]),T.useEffect(()=>{if(E.current&&x){var R=new RD(E.current);S.current=R,x({textarea:E.current,commandOrchestrator:R})}},[]),T.useEffect(()=>{if(g&&E.current&&b){E.current.focus();var R=E.current.value.length;E.current.setSelectionRange(R,R),setTimeout(()=>{b&&(b.scrollTop=b.scrollHeight),E.current&&(E.current.scrollTop=E.current.scrollHeight)},0)}},[b]);var C=R=>{exe(R,p,y),I7(R,[...i||[],...f||[]],S.current,x,w.current)};return T.useEffect(()=>(E.current&&E.current.addEventListener("keydown",C),()=>{E.current&&E.current.removeEventListener("keydown",C)}),[]),m.jsx("textarea",pe({autoComplete:"off",autoCorrect:"off",autoCapitalize:"off",spellCheck:!1},r,{ref:E,className:t+"-text-input "+(r.className?r.className:""),value:a,onChange:R=>{x&&x({markdown:R.target.value}),n&&n(R)}}))}var oxe=["prefixCls","className","onScroll","renderTextarea"];function axe(e){var t=e||{},{prefixCls:n,className:r,onScroll:o,renderTextarea:a}=t,i=fn(t,oxe),{markdown:s,scrollTop:c,commands:u,extraCommands:f,dispatch:p}=T.useContext(Ch),y=vt.useRef(null),g=vt.useRef(),b=vt.createRef();T.useEffect(()=>{var E={};b.current&&(E.textareaWarp=b.current||void 0,b.current.scrollTop=c||0),p&&p(pe({},E))},[]),T.useEffect(()=>{if(y.current&&p){var E=new RD(y.current);g.current=E,p({textarea:y.current,commandOrchestrator:E})}},[]);var x={WebkitTextFillColor:"initial",overflow:"auto"};return m.jsx("div",{ref:b,className:n+"-area "+(r||""),onScroll:o,children:m.jsx("div",{className:n+"-text",children:a?vt.cloneElement(a(pe({},i,{value:s,autoComplete:"off",autoCorrect:"off",spellCheck:"false",autoCapitalize:"off",className:n+"-text-input",style:{WebkitTextFillColor:"inherit",overflow:"auto"}}),{dispatch:p,onChange:i.onChange,shortcuts:I7,useContext:{commands:u,extraCommands:f,commandOrchestrator:g.current}}),{ref:y}):m.jsx(T.Fragment,{children:m.jsx(rxe,pe({prefixCls:n},i,{style:x}))})})})}function ixe(e){var{prefixCls:t,groupName:n,commands:r,children:o}=e||{},{barPopup:a={}}=T.useContext(Ch);return T.useMemo(()=>m.jsx("div",{className:t+"-toolbar-child "+(n&&a[n]?"active":""),onClick:i=>i.stopPropagation(),children:Array.isArray(r)?m.jsx(B7,pe({commands:r},e,{isChild:!0})):o}),[r,a,n,t])}function T_(e){var{prefixCls:t,overflow:n}=e,{fullscreen:r,preview:o,barPopup:a={},components:i,commandOrchestrator:s,dispatch:c}=T.useContext(Ch),u=T.useRef("");function f(p,y){if(c){var g={barPopup:pe({},a)};p.keyCommand==="preview"&&(g.preview=p.value),p.keyCommand==="fullscreen"&&(g.fullscreen=!r),e.commands&&p.keyCommand==="group"?e.commands.forEach(b=>{y===b.groupName?g.barPopup[y]=!0:b.keyCommand&&(g.barPopup[b.groupName]=!1)}):(y||p.parent)&&Object.keys(g.barPopup||{}).forEach(b=>{g.barPopup[b]=!1}),Object.keys(g).length&&c(pe({},g)),s&&s.executeCommand(p)}}return T.useEffect(()=>{document&&n&&(r?document.body.style.overflow="hidden":(u.current||(u.current=window.getComputedStyle(document.body,null).overflow),document.body.style.overflow=u.current))},[r,u,n]),m.jsx("ul",{children:(e.commands||[]).map((p,y)=>{if(p.keyCommand==="divider")return m.jsx("li",pe({},p.liProps,{className:t+"-toolbar-divider"}),y);if(!p.keyCommand)return m.jsx(T.Fragment,{},y);var g=r&&p.keyCommand==="fullscreen"||p.keyCommand==="preview"&&o===p.value,b=p.children&&typeof p.children=="function"?p.children({getState:()=>s.getState(),textApi:s?s.textApi:void 0,close:()=>f({},p.groupName),execute:()=>f({execute:p.execute}),dispatch:c}):void 0,x=a&&o&&o==="preview"&&!/(preview|fullscreen)/.test(p.keyCommand),E=i?.toolbar||p.render,S=E&&typeof E=="function"?E(p,!!x,f,y):null;return m.jsxs("li",pe({},p.liProps,{className:g?"active":"",children:[S&&vt.isValidElement(S)&&S,!S&&!p.buttonProps&&p.icon,!S&&p.buttonProps&&vt.createElement("button",pe({type:"button",key:y,disabled:x,"data-name":p.name},p.buttonProps,{onClick:w=>{w.stopPropagation(),f(p,p.groupName)}}),p.icon),p.children&&m.jsx(ixe,{overflow:n,groupName:p.groupName,prefixCls:t,children:b,commands:Array.isArray(p.children)?p.children:void 0})]}),y)})})}function B7(e){e===void 0&&(e={});var{prefixCls:t,isChild:n,className:r}=e,{commands:o,extraCommands:a}=T.useContext(Ch);return m.jsxs("div",{className:t+"-toolbar "+r,children:[m.jsx(T_,pe({},e,{commands:e.commands||o||[]})),!n&&m.jsx(T_,pe({},e,{commands:a||[]}))]})}function w_(e){var{hideToolbar:t,toolbarBottom:n,placement:r,overflow:o,prefixCls:a}=e;if(t||r==="bottom"&&!n||r==="top"&&n)return null;var i=n?"bottom":"";return m.jsx(B7,{prefixCls:a,overflow:o,className:i})}var sxe=e=>{var{prefixCls:t,onChange:n}=e||{},r=T.useRef(null),o=T.useRef(),a=T.useRef(e.height);T.useEffect(()=>{a.current!==e.height&&(a.current=e.height)},[e.height]);function i(f){if(o.current){var p,y=f.clientY||((p=f.changedTouches[0])==null?void 0:p.clientY),g=o.current.height+y-o.current.dragY;g>=e.minHeight&&g<=e.maxHeight&&n&&n(o.current.height+(y-o.current.dragY))}}function s(){var f,p;o.current=void 0,document.removeEventListener("mousemove",i),document.removeEventListener("mouseup",s),(f=r.current)==null||f.removeEventListener("touchmove",i),(p=r.current)==null||p.removeEventListener("touchend",s)}function c(f){var p,y,g;f.preventDefault();var b=f.clientY||((p=f.changedTouches[0])==null?void 0:p.clientY);o.current={height:a.current,dragY:b},document.addEventListener("mousemove",i),document.addEventListener("mouseup",s),(y=r.current)==null||y.addEventListener("touchmove",i,{passive:!1}),(g=r.current)==null||g.addEventListener("touchend",s,{passive:!1})}T.useEffect(()=>{if(document){var f,p;(f=r.current)==null||f.addEventListener("touchstart",c,{passive:!1}),(p=r.current)==null||p.addEventListener("mousedown",c)}return()=>{if(document){var y;(y=r.current)==null||y.removeEventListener("touchstart",c),document.removeEventListener("mousemove",i)}}},[]);var u=T.useMemo(()=>m.jsx("svg",{viewBox:"0 0 512 512",height:"100%",children:m.jsx("path",{fill:"currentColor",d:"M304 256c0 26.5-21.5 48-48 48s-48-21.5-48-48 21.5-48 48-48 48 21.5 48 48zm120-48c-26.5 0-48 21.5-48 48s21.5 48 48 48 48-21.5 48-48-21.5-48-48-48zm-336 0c-26.5 0-48 21.5-48 48s21.5 48 48 48 48-21.5 48-48-21.5-48-48-48z"})}),[]);return m.jsx("div",{className:t+"-bar",ref:r,children:u})},lxe=["prefixCls","className","value","commands","commandsFilter","direction","extraCommands","height","enableScroll","visibleDragbar","highlightEnable","preview","fullscreen","overflow","previewOptions","textareaProps","maxHeight","minHeight","autoFocus","autoFocusEnd","tabSize","defaultTabEnable","onChange","onStatistics","onHeightChange","hideToolbar","toolbarBottom","components","renderTextarea"];function cxe(e){return e===void 0&&(e={}),Object.keys(e).forEach(t=>{e[t]=!1}),e}var uxe=vt.forwardRef((e,t)=>{var n=e||{},{prefixCls:r="w-md-editor",className:o,value:a,commands:i=Z1e(),commandsFilter:s,direction:c,extraCommands:u=J1e(),height:f=200,enableScroll:p=!0,visibleDragbar:y=typeof e.visiableDragbar=="boolean"?e.visiableDragbar:!0,highlightEnable:g=!0,preview:b="live",fullscreen:x=!1,overflow:E=!0,previewOptions:S={},textareaProps:w,maxHeight:C=1200,minHeight:R=100,autoFocus:M,autoFocusEnd:D=!1,tabSize:I=2,defaultTabEnable:L=!1,onChange:F,onStatistics:B,onHeightChange:U,hideToolbar:k,toolbarBottom:$=!1,components:j,renderTextarea:V}=n,z=fn(n,lxe),K=i.map(we=>s?s(we,!1):we).filter(Boolean),Y=u.map(we=>s?s(we,!0):we).filter(Boolean),[te,_]=T.useReducer(v1e,{markdown:a,preview:b,components:j,height:f,minHeight:R,highlightEnable:g,tabSize:I,defaultTabEnable:L,scrollTop:0,scrollTopPreview:0,commands:K,extraCommands:Y,fullscreen:x,barPopup:{}}),Z=T.useRef(null),J=T.useRef(null),W=T.useRef(p);T.useImperativeHandle(t,()=>pe({},te,{container:Z.current,dispatch:_})),T.useMemo(()=>W.current=p,[p]),T.useEffect(()=>{var we={};Z.current&&(we.container=Z.current||void 0),we.markdown=a||"",we.barPopup={},_&&_(pe({},te,we))},[]);var re=[o,"wmde-markdown-var",c?r+"-"+c:null,r,te.preview?r+"-show-"+te.preview:null,te.fullscreen?r+"-fullscreen":null].filter(Boolean).join(" ").trim();T.useMemo(()=>a!==te.markdown&&_({markdown:a||""}),[a,te.markdown]),T.useMemo(()=>b!==te.preview&&_({preview:b}),[b]),T.useMemo(()=>I!==te.tabSize&&_({tabSize:I}),[I]),T.useMemo(()=>g!==te.highlightEnable&&_({highlightEnable:g}),[g]),T.useMemo(()=>M!==te.autoFocus&&_({autoFocus:M}),[M]),T.useMemo(()=>D!==te.autoFocusEnd&&_({autoFocusEnd:D}),[D]),T.useMemo(()=>x!==te.fullscreen&&_({fullscreen:x}),[x]),T.useMemo(()=>f!==te.height&&_({height:f}),[f]),T.useMemo(()=>f!==te.height&&U&&U(te.height,f,te),[f,U,te]),T.useMemo(()=>i!==te.commands&&_({commands:K}),[e.commands]),T.useMemo(()=>u!==te.extraCommands&&_({extraCommands:Y}),[e.extraCommands]);var ne=T.useRef(),X=T.useRef("preview"),ie=T.useRef(!1);T.useMemo(()=>{ne.current=te.textareaWarp,te.textareaWarp&&(te.textareaWarp.addEventListener("mouseover",()=>{X.current="text"}),te.textareaWarp.addEventListener("mouseleave",()=>{X.current="preview"}))},[te.textareaWarp]);var ae=(we,Se)=>{if(W.current){var dt=ne.current,ze=J.current?J.current:void 0;if(ie.current||(X.current=Se,ie.current=!0),dt&&ze){var tt=(dt.scrollHeight-dt.offsetHeight)/(ze.scrollHeight-ze.offsetHeight);we.target===dt&&X.current==="text"&&(ze.scrollTop=dt.scrollTop/tt),we.target===ze&&X.current==="preview"&&(dt.scrollTop=ze.scrollTop*tt);var Ze=0;X.current==="text"?Ze=dt.scrollTop||0:X.current==="preview"&&(Ze=ze.scrollTop||0),_({scrollTop:Ze})}}},fe=r+"-preview "+(S.className||""),xe=we=>ae(we,"preview"),ge=T.useMemo(()=>m.jsx("div",{ref:J,className:fe,children:m.jsx(N7,pe({},S,{onScroll:xe,source:te.markdown||""}))}),[fe,S,te.markdown]),Re=j?.preview&&j?.preview(te.markdown||"",te,_);Re&&vt.isValidElement(Re)&&(ge=m.jsx("div",{className:fe,ref:J,onScroll:xe,children:Re}));var de=pe({},z.style,{height:te.height||"100%"}),me=()=>_({barPopup:pe({},cxe(te.barPopup))}),Qe=we=>_({height:we}),Me=we=>{if(F&&F(we.target.value,we,te),w&&w.onChange&&w.onChange(we),te.textarea&&te.textarea instanceof HTMLTextAreaElement&&B){var Se=new RD(te.textarea),dt=Se.getState()||{};B(pe({},dt,{lineCount:we.target.value.split(`
326
- `).length,length:we.target.value.length}))}};return m.jsx(Ch.Provider,{value:pe({},te,{dispatch:_}),children:m.jsxs("div",pe({ref:Z,className:re},z,{onClick:me,style:de,children:[m.jsx(w_,{hideToolbar:k,toolbarBottom:$,prefixCls:r,overflow:E,placement:"top"}),m.jsxs("div",{className:r+"-content",children:[/(edit|live)/.test(te.preview||"")&&m.jsx(axe,pe({className:r+"-input",prefixCls:r,autoFocus:M},w,{onChange:Me,renderTextarea:j?.textarea||V,onScroll:we=>ae(we,"text")})),/(live|preview)/.test(te.preview||"")&&ge]}),y&&!te.fullscreen&&m.jsx(sxe,{prefixCls:r,height:te.height,maxHeight:C,minHeight:R,onChange:Qe}),m.jsx(w_,{hideToolbar:k,toolbarBottom:$,prefixCls:r,overflow:E,placement:"bottom"})]}))})}),$7=uxe;$7.Markdown=N7;const sw={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"}]}}},dxe={...sw,patterns:[...sw.patterns,{include:"#docvar"}],repository:{...sw.repository,docvar:{patterns:[{match:"\\<\\<[^(\\>\\>)]*\\>\\>",beginCaptures:{0:{name:"punctuation.definition.comment.begin"}},endCaptures:{0:{name:"punctuation.definition.comment.end"}},name:"markup.italic.markdown"}]}}},fxe={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"}]}}},pxe="github-light",hxe="github-dark";let lw;function mxe(){return lw||(lw=(async()=>{const[{createHighlighterCore:e},{createOnigurumaEngine:t},{default:n},{default:r},{default:o},{default:a},{default:i}]=await Promise.all([co(()=>import("./core-Rj_4rRnA.es-BZyvITuO.js"),__vite__mapDeps([0,1])),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"],...dxe},{name:"malloysql",scopeName:"source.malloy-sql",embeddedLangs:["sql"],...fxe}]})})()),lw}async function tx(e,t,n="light"){return(await mxe()).codeToHtml(e,{lang:t,theme:n==="dark"?hxe:pxe})}function uo(e){const{server:t}=Dr(),n={...e,queryKey:[...e.queryKey,t],queryFn:async()=>{try{return await e.queryFn()}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 MF(n,AA)}function Ho(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 Tne(t,AA)}const to=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},MD=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};function z7({sourceAndPaths:e,selectedSourceIndex:t,existingQuery:n,onQueryChange:r,onSourceChange:o,resourceUri:a}){return vt.useEffect(()=>{o&&o(t)},[t,o]),m.jsx(wA,{children:m.jsxs(PG,{spacing:2,component:"section",children:[m.jsx(yxe,{sourceAndPath:e[t],existingQuery:n,onChange:i=>{r&&r(i)},resourceUri:a}),m.jsx(f6,{height:"5px"})]})})}function p1(){return{query:void 0,malloyQuery:void 0,malloyResult:void 0}}function gxe({sourceAndPath:e,onChange:t,existingQuery:n,explorerComponents:r,QueryBuilder:o,resourceUri:a}){const[i,s]=vt.useState(n||p1()),[c,u]=vt.useState(void 0);vt.useEffect(()=>{n&&s(n)},[n]);const[f,p]=vt.useState([]),{MalloyExplorerProvider:y,QueryPanel:g,ResizableCollapsiblePanel:b,ResultPanel:x,SourcePanel:E}=r;vt.useEffect(()=>{t&&t(i)},[t,i]);const{environmentName:S,packageName:w,versionId:C}=to(a),{apiClients:R}=Dr(),M=Ho({mutationFn:()=>{const F=typeof i?.malloyQuery=="string"?i.malloyQuery:new o.ASTQuery({source:e.sourceInfo,query:i?.malloyQuery}).toMalloy();return u({executionState:"running",query:i?.malloyQuery,queryResolutionStartMillis:Date.now(),onCancel:()=>{M.reset(),u(void 0)},response:{result:{}}}),s({...i,query:F}),R.models.executeQueryModel(S,w,e.modelPath,{query:F,sourceName:void 0,queryName:void 0,versionId:C})},onSuccess:F=>{if(F){const B=JSON.parse(F.data.result);s({...i,malloyResult:B}),u(U=>U?{...U,executionState:"finished",response:{result:B}}:void 0)}},onError:F=>{u(void 0),console.error("Query execution error:",F)}}),[D,I]=vt.useState(e.sourceInfo.name);vt.useEffect(()=>{D!==e.sourceInfo.name&&(I(e.sourceInfo.name),s(p1()),u(void 0))},[e,D]);const L=vt.useCallback(F=>{s({...i,malloyQuery:F,malloyResult:void 0})},[i]);return D!==e.sourceInfo.name?m.jsx("div",{children:"Loading..."}):m.jsx(aj,{sx:{border:"1px solid #e0e0e0",borderRadius:"8px",overflow:"hidden"},children:m.jsx(y,{source:e.sourceInfo,query:i?.malloyQuery,topValues:[],onFocusedNestViewPathChange:p,focusedNestViewPath:f,onQueryChange:L,children:m.jsxs("div",{style:{display:"flex",height:"100%",overflowY:"auto"},children:[m.jsx(b,{isInitiallyExpanded:!0,initialWidth:180,minWidth:180,icon:"database",title:e.sourceInfo.name,children:m.jsx(E,{onRefresh:()=>s(p1())})}),m.jsx(b,{isInitiallyExpanded:!0,initialWidth:280,minWidth:280,icon:"filterSliders",title:"Query",children:m.jsx(g,{runQuery:()=>{console.log(`running query with: ${i?.malloyQuery}`);try{M.mutate()}catch(F){console.error("Error running query:",F)}}})}),m.jsx(x,{source:e.sourceInfo,draftQuery:i?.malloyQuery,setDraftQuery:F=>s({...i,malloyQuery:F}),submittedQuery:c,options:{showRawQuery:!0}})]})})},e.sourceInfo.name)}function yxe(e){const[t,n]=T.useState(null),[r,o]=T.useState(null),[a,i]=T.useState(!0);return T.useEffect(()=>{let s=!0;return Promise.all([co(()=>import("./index-DQa463gC.js"),__vite__mapDeps([2,3,4,5,6])),co(()=>import("./index-VBbcc8s6.js").then(c=>c.i),__vite__mapDeps([3,4]))]).then(([c,u])=>{s&&(n(c),o(u),i(!1))}).catch(c=>{console.error("Failed to load Malloy components:",c),s&&i(!1)}),()=>{s=!1}},[]),a||!t||!r?m.jsx(woe,{children:m.jsx(aj,{children:m.jsx(f6,{sx:{alignItems:"center",justifyContent:"center",height:"200px",color:"text.secondary"},children:"Loading explorer..."})})}):m.jsx(gxe,{...e,explorerComponents:t,QueryBuilder:r,resourceUri:e.resourceUri})}const H7=Fn(m.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 Ca({text:e,size:t=20,color:n="primary",thickness:r=3.6,centered:o=!0,spacing:a=2,textVariant:i="body2"}){const s=m.jsxs(gt,{sx:{display:"flex",flexDirection:"column",alignItems:"center",gap:a},children:[m.jsx(_x,{size:t,color:n,thickness:r}),e&&m.jsx(at,{variant:i,color:"text.secondary",children:e})]});return o?m.jsx(gt,{sx:{display:"flex",justifyContent:"center",alignItems:"center",minHeight:"200px",width:"100%"},children:s}):s}const bxe=new Set(["warn","error"]);function vxe(e){if(!e?.length)return;const t=[];let n=!1;for(const r of e)!r.message||!bxe.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(`
327
- `)}}const xxe=T.lazy(()=>Promise.resolve().then(()=>gPe));function NS({result:e,maxHeight:t,maxResultSize:n=0,renderLogs:r}){const o=T.useRef(null),[a,i]=T.useState(t),[s,c]=T.useState(!1),u=vxe(r);if(!e)return null;if(n>0&&e.length>n&&!s)return m.jsxs(gt,{sx:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:2,p:4,backgroundColor:"#fafafa",border:"1px solid",borderColor:"#e0e0e0",borderRadius:1},children:[m.jsx(Kae,{sx:{fontSize:48,color:"#757575"}}),m.jsx(at,{variant:"h6",color:"text.secondary",align:"center",children:"Processing large results may cause browser performance issues. Proceed?"}),m.jsx(_r,{variant:"contained",color:"primary",onClick:()=>c(!0),children:"Proceed"})]});const f=m.jsx(Ca,{text:"Loading...",centered:!0,size:32}),p=Math.min(t,a);return m.jsxs(gt,{ref:o,sx:{position:"relative",height:"auto",border:"0px",borderRadius:0,overflow:"hidden"},children:[e&&m.jsx(T.Suspense,{fallback:f,children:m.jsx(xxe,{result:e,height:p,onSizeChange:i})}),u&&m.jsx(gt,{sx:{position:"absolute",top:4,right:4,zIndex:1},children:m.jsx(eo,{title:u.title,slotProps:{tooltip:{sx:{whiteSpace:"pre-line"}}},children:m.jsx(dr,{size:"small","aria-label":"Render tag warnings",sx:{backgroundColor:"rgba(255, 255, 255, 0.9)","&:hover":{backgroundColor:"rgba(255, 255, 255, 1)"}},children:m.jsx(H7,{fontSize:"small",color:u.severity==="error"?"error":"warning"})})})})]})}function Sxe({cell:e,sourceAndPaths:t,resourceUri:n,onQueryChange:r,onSourceChange:o}){const a={query:e.value,malloyResult:e.result?JSON.parse(e.result):void 0,malloyQuery:e.queryInfo?JSON.parse(e.queryInfo):void 0},i=t.findIndex(s=>s.sourceInfo.name===e.sourceName);return m.jsx(z7,{resourceUri:n,sourceAndPaths:t,selectedSourceIndex:i>=0?i:0,existingQuery:a,onQueryChange:r,onSourceChange:o})}function Exe({cell:e,editingMalloy:t,editingMarkdown:n,sourceAndPaths:r,resourceUri:o,onCellChange:a,onClose:i,onEdit:s,onDelete:c,addButtonCallback:u}){const[f,p]=T.useState(e.value),[y,g]=vt.useState(!1),[b,x]=vt.useState(!1),[E,S]=vt.useState(),[w]=vt.useState(),[C,R]=vt.useState(p1()),[M,D]=vt.useState(!1),[I,L]=vt.useState(e.sourceName?r.findIndex(J=>J.sourceInfo.name===e.sourceName):0),{mode:F}=mb();T.useEffect(()=>{e.isMarkdown||tx(e.value,"malloy",F).then(J=>{S(J)})},[e,F]),vt.useEffect(()=>{document.documentElement.setAttribute("data-color-mode","light")});const[B,U]=T.useState(!1),k=()=>{c(),U(!1)},$=r.length===0,j=vt.useCallback(()=>{const J=r[I],W=J?.modelPath||e.modelPath||"",re=J?.sourceInfo.name||e.sourceName||"";a({...e,value:e.isMarkdown?f:C.query,result:C.malloyResult?JSON.stringify(C.malloyResult):void 0,queryInfo:C.malloyQuery?JSON.stringify(C.malloyQuery):void 0,sourceName:re,modelPath:W})},[e,f,C,a,I,r]),V=m.jsx(eo,{title:"Delete Cell",children:m.jsx(dr,{size:"small",onClick:()=>U(!0),children:m.jsx("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:m.jsx("path",{d:"M3 6h18M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2m2 0v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6h14zM10 11v6M14 11v6",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})})}),z=m.jsxs(wi,{open:B,onClose:()=>U(!1),children:[m.jsx(Ai,{children:"Confirm Delete"}),m.jsx(ki,{children:m.jsx(at,{children:"Are you sure you want to delete this cell?"})}),m.jsxs(dh,{children:[m.jsx(_r,{onClick:()=>U(!1),children:"Cancel"}),m.jsx(_r,{onClick:k,color:"error",children:"Delete"})]})]}),K=()=>{j(),i()},Y=e.isMarkdown?m.jsxs(m.Fragment,{children:[n?m.jsx(eo,{title:"Save",children:m.jsx(dr,{size:"small",onClick:K,children:m.jsx(E0,{})})}):m.jsx(eo,{title:"Edit",children:m.jsx(dr,{size:"small",onClick:s,children:m.jsx(q5,{})})}),!n&&V]}):m.jsxs(m.Fragment,{children:[!t&&m.jsx(eo,{title:y?"Hide Code":"View Code",children:m.jsx(dr,{size:"small",onClick:()=>{g(!y)},children:m.jsx(yB,{})})}),!t&&e.result&&m.jsx(eo,{title:b?"Hide Embedding":"View Embedding",children:m.jsx(dr,{size:"small",onClick:()=>{x(!b)},children:m.jsx(ZA,{})})}),t&&m.jsx(eo,{title:"Save",children:m.jsx(dr,{size:"small",onClick:K,children:m.jsx(E0,{})})}),!t&&m.jsx(eo,{title:"Edit",children:m.jsx(dr,{size:"small",onClick:s,children:m.jsx(q5,{})})}),!t&&V]}),te=t||n,_=n?m.jsx(eo,{title:"Save",children:m.jsx(dr,{size:"small",onClick:K,children:m.jsx(E0,{})})}):t?m.jsx(eo,{title:"Save",children:m.jsx(dr,{size:"small",onClick:K,children:m.jsx(E0,{})})}):null,Z=M&&m.jsx(gt,{sx:{position:"absolute",top:"4px",right:"4px",display:"flex",gap:"8px",backgroundColor:"background.paper",border:"1px solid",borderColor:"divider",borderRadius:"8px",padding:"2px 4px",boxShadow:1,zIndex:10},children:!te&&m.jsxs(m.Fragment,{children:[u(!0),u(!1),Y]})||_});return m.jsxs(L1,{sx:J=>({position:"relative",marginTop:"5px",marginBottom:"5px",borderWidth:"1.5px",backgroundColor:J.palette.background.paper,minHeight:"50px"}),onMouseEnter:()=>D(!0),onMouseLeave:()=>{D(!1)},children:[Z,e.isMarkdown?m.jsx(m.Fragment,{children:n?m.jsx($7,{value:f,preview:"edit",autoFocus:!0,onChange:J=>{p(J),a({...e,value:J})},onBlur:()=>{j(),M||K()}}):m.jsx(gt,{sx:{px:.5,pt:0,mt:0,"& h1, & h2, & h3, & h4, & h5, & h6":{mt:.5,mb:.5},"& p":{mt:.5,mb:.5},"& ul, & ol":{mt:.5,mb:.5},"& li":{mt:0,mb:0},"& pre, & code":{mt:.5,mb:.5},"& blockquote":{mt:.5,mb:.5}},children:e.value?m.jsx(gt,{onClick:s,sx:{cursor:"pointer"},children:m.jsx(F1,{children:e.value})}):m.jsxs(gt,{onClick:s,sx:{cursor:"pointer"},children:[m.jsx(at,{sx:{p:2,textAlign:"center",variant:"subtitle2",fontWeight:"medium"},children:"Markdown is empty"}),m.jsx(at,{sx:{mb:2,textAlign:"center",variant:"body2"},children:"Click to edit."})]})})}):m.jsxs(m.Fragment,{children:[m.jsx(A1,{in:b,timeout:"auto",unmountOnExit:!0,children:m.jsx(Lr,{sx:{p:"10px",borderRadius:0,flexDirection:"row",justifyContent:"space-between"},children:m.jsx(at,{component:"div",sx:{fontSize:"12px","& .line":{textWrap:"wrap"}},dangerouslySetInnerHTML:{__html:w}})})}),m.jsx(A1,{in:y,timeout:"auto",unmountOnExit:!0,children:m.jsx(Lr,{sx:{p:"10px",borderRadius:0,flexDirection:"row",justifyContent:"space-between"},children:m.jsx(at,{component:"div",className:"content",sx:{fontSize:"12px","& .line":{textWrap:"wrap"}},dangerouslySetInnerHTML:{__html:E}})})}),t&&($?m.jsxs(m.Fragment,{children:[m.jsx(at,{sx:{p:2,textAlign:"center",variant:"subtitle2",fontWeight:"medium"},children:"No Model Imports"}),m.jsx(at,{sx:{mb:2,textAlign:"center",variant:"body2"},children:"Please add a model import above."})]}):m.jsx(Sxe,{sourceAndPaths:r,resourceUri:o,onQueryChange:J=>{R(J)},onSourceChange:J=>{L(J)},cell:e})),!t&&e.result&&m.jsx(L1,{variant:"outlined",sx:{borderRadius:0},children:m.jsx(NS,{result:e.result,maxHeight:800})}),!t&&!e.result&&m.jsxs(gt,{onClick:s,sx:{cursor:"pointer"},children:[m.jsx(at,{sx:{p:2,textAlign:"center",variant:"subtitle2",fontWeight:"medium"},children:"Explore is empty"}),m.jsx(at,{sx:{mb:2,textAlign:"center",variant:"body2"},children:"Click to edit."})]})]}),B&&z]})}const U7=T.createContext(void 0);function Cxe({children:e,workbookStorage:t}){const n=T.useMemo(()=>({workbookStorage:t}),[t]);return m.jsx(U7.Provider,{value:n,children:e})}function Txe(){const e=T.useContext(U7);if(!e)throw new Error("useWorkbookStorage must be used within a WorkbookStorageProvider");return e}const Ns=Fn(m.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"})),wxe=Fn(m.jsx("path",{d:"M18 15v3H6v-3H4v3c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2v-3zM7 9l1.41 1.41L11 7.83V16h2V7.83l2.59 2.58L17 9l-5-5z"}));function Ta({error:e,context:t}){const n=e.data?.message||"Unknown Error";return m.jsxs(m.Fragment,{children:[t&&m.jsx(at,{variant:"body2",sx:{p:"10px",m:"auto"},children:t}),m.jsx("pre",{style:{whiteSpace:"pre-wrap",color:"red",padding:"10px",margin:"auto"},children:n})]})}function kxe({initialSelectedModels:e,onModelChange:t,resourceUri:n}){const{environmentName:r,packageName:o,versionId:a}=to(n),{apiClients:i}=Dr(),{data:s,isLoading:c,isSuccess:u,isError:f,error:p}=uo({queryKey:["models",r,o,a],queryFn:()=>i.models.listModels(r,o,a)}),[y,g]=vt.useState(e||[]),[b,x]=vt.useState(null);vt.useEffect(()=>{g(e||[])},[e]);const E=C=>{const R=y.filter(M=>M!==C);g(R),t(R)},S=C=>{const R=[...y,C];g(R),t(R),x(null)};let w=[];return u&&s?.data&&(w=s.data.filter(C=>!y.includes(C.path)).map(C=>C.path)),f?m.jsx(Ta,{error:p,context:`${r} > ${o} > Model Picker`}):m.jsxs(m.Fragment,{children:[m.jsxs(uA,{fullWidth:!0,children:[c&&m.jsx(at,{children:"Loading..."}),m.jsxs(Lr,{direction:"row",spacing:1,children:[y.map(C=>m.jsx(Ld,{label:C,onDelete:()=>E(C),deleteIcon:m.jsx(Ns,{}),sx:{marginBottom:"5px"}},C)),m.jsx(_r,{size:"small",startIcon:m.jsx(wxe,{}),onClick:C=>x(C.currentTarget),disabled:c||f||w.length===0,children:"Add Model"})]})]}),m.jsxs(Zd,{anchorEl:b,open:!!b,onClose:()=>x(null),children:[m.jsx(at,{variant:"subtitle2",sx:{ml:1},children:"Models"}),m.jsx(yl,{}),w.length===0?m.jsx(cc,{disabled:!0,children:"No models available"}):w.map(C=>m.jsx(cc,{onClick:()=>S(C),children:m.jsx(at,{variant:"body2",children:C})},C))]})]})}function Axe(){const e=E2();return(t,n)=>{if(!n||!n.metaKey&&!n.ctrlKey&&!n.shiftKey&&n.button!==1){e(t);return}const r=new URL(t,window.location.href).href;(n.metaKey||n.ctrlKey||n.button===1||n.shiftKey)&&window.open(r,"_blank")}}function mIe({workbookPath:e,resourceUri:t}){const n=Axe(),{server:r,getAccessToken:o}=Dr(),{apiClients:a}=Dr(),{workbookStorage:i}=Txe(),{environmentName:s,packageName:c}=to(t),[u,f]=vt.useState(void 0),[p,y]=vt.useState(void 0);if(!i)throw new Error("Workbook storage be provided via WorkbookStorageProvider");const[g,b]=vt.useState(),[x,E]=vt.useState(),[S,w]=vt.useState(),[C,R]=vt.useState([]),[M,D]=vt.useState(null),[I,L]=vt.useState(null),F=!!M,B=()=>{D(null),L(null)},U=(Z,J)=>{g&&(b(g.insertCell(J,{isMarkdown:Z,value:""})),Z?w(J):E(J),B(),console.log("handleAddCell",Z,J))},[k,$]=vt.useState(!1),j=()=>{$(!0)},V=async()=>{e&&i&&await i.deleteWorkbook(e).then(()=>{y(void 0),f(void 0)}).catch(Z=>{y(`Error deleting workbook: ${Z.message}`),f(void 0)}),$(!1),n(`/${s}/${c}`)},z=()=>{$(!1)},K=vt.useCallback(async()=>{if(!g){console.log("No workbook data ref");return}try{b(await g.saveWorkbook()),y(void 0),f("Workbook saved")}catch(Z){y(`Error saving workbook: ${Z.message}`),f(void 0)}},[g]);if(vt.useEffect(()=>{g&&(async()=>{const Z=new Map(C.map(({modelPath:re,sourceInfos:ne})=>[re,ne])),J=[],W=[];for(const re of g.getModels())Z.has(re)?J.push({modelPath:re,sourceInfos:Z.get(re)}):(console.log("Fetching model from Publisher",re),W.push(a.models.getModel(s,c,re,void 0).then(ne=>({modelPath:re,sourceInfos:ne.data.sourceInfos.map(X=>JSON.parse(X))}))));if(W.length>0){const re=await Promise.all(W);R([...J,...re])}else R(J)})()},[o,g,c,s,r]),vt.useEffect(()=>{e&&Jg.loadWorkbook(i,e).then(Z=>{b(Z)})},[e,i]),!g)return m.jsx("div",{children:"Loading..."});const Y=Z=>{const J=[];for(const W of Z)for(const re of W.sourceInfos)J.push({modelPath:W.modelPath,sourceInfo:re});return J},te=(Z,J)=>m.jsx(_r,{size:"small",startIcon:m.jsx(Sb,{}),onClick:()=>U(Z,J),variant:"contained",sx:{backgroundColor:W=>W.palette.background.paper,color:W=>W.palette.mode==="dark"?W.palette.grey[100]:W.palette.grey[700],boxShadow:"none","&:hover":{backgroundColor:W=>W.palette.mode==="dark"?W.palette.grey[500]:W.palette.grey[300],boxShadow:"none"}},children:Z?"Markdown":"Explore"}),_=m.jsxs(gt,{sx:{display:"flex",gap:1,justifyContent:"center",flex:2},children:[te(!1,g.getCells().length),te(!0,g.getCells().length)]});return m.jsxs(L1,{variant:"outlined",children:[m.jsxs(oj,{children:[m.jsx(gt,{sx:{mb:2},children:m.jsx(gt,{sx:{minHeight:"24px"},children:p?m.jsx(at,{color:"error",variant:"body2",children:p}):u?m.jsx(at,{color:"success",variant:"body2",children:u}):m.jsx("span",{children:" "})})}),m.jsxs(op,{sx:{flexDirection:"row",justifyContent:"space-between",alignItems:"center"},children:[m.jsxs(op,{direction:"row",spacing:1,alignItems:"center",children:[m.jsx(at,{variant:"overline",sx:{fontSize:"13px",fontWeight:"bold",verticalAlign:"middle"},children:"Workbook"}),m.jsx(at,{variant:"subtitle2",sx:{fontSize:"13px",fontWeight:"normal",verticalAlign:"middle",ml:1},children:`${e.workspace} > ${e.path}`})]}),m.jsxs(op,{sx:{display:"flex",flexDirection:"row",gap:1},children:[m.jsx(gt,{sx:{display:"flex",alignItems:"center",mt:1,mb:1},children:m.jsx(Dxe,{workbookData:g})}),m.jsxs(gt,{sx:{display:"flex",alignItems:"center",mt:1,mb:1},children:[m.jsx(_r,{color:"error",onClick:j,size:"small",children:"Delete"}),m.jsxs(wi,{open:k,onClose:z,children:[m.jsx(Ai,{children:"Delete Workbook"}),m.jsx(ki,{children:m.jsxs(Vx,{children:['Are you sure you want to delete the workbook "',e.path,'"? This action cannot be undone.']})}),m.jsxs(dh,{children:[m.jsx(_r,{onClick:z,color:"primary",size:"small",children:"Cancel"}),m.jsx(_r,{onClick:V,color:"error",autoFocus:!0,size:"small",children:"Delete"})]})]})]})]})]}),m.jsx(yl,{}),m.jsxs(op,{sx:{display:"flex",flexDirection:"row",width:"100%",mt:2},children:[m.jsx(gt,{sx:{flex:1},children:m.jsx(kxe,{initialSelectedModels:g.getModels(),onModelChange:Z=>{b(g.setModels(Z)),K()},resourceUri:t})}),m.jsx(gt,{sx:{flex:1}})]})]}),m.jsx(wA,{children:m.jsxs(op,{children:[g.getCells().length===0&&m.jsxs(m.Fragment,{children:[m.jsx(at,{sx:{textAlign:"center",p:2,variant:"subtitle2",fontWeight:"medium"},children:"Workbook is empty"}),m.jsx(at,{variant:"body2",sx:{textAlign:"center",mb:2,variant:"body2"},children:"Click the + buttons to add a markdown or code cell."})]}),g.getCells().map((Z,J)=>m.jsx(vt.Fragment,{children:m.jsx(Exe,{cell:Z,resourceUri:t,addButtonCallback:W=>te(W,J),sourceAndPaths:Y(C),editingMarkdown:S===J,editingMalloy:x===J,onDelete:()=>{b(g.deleteCell(J)),K()},onCellChange:W=>{b(g.setCell(J,W))},onEdit:()=>{Z.isMarkdown?w(J):E(J)},onClose:()=>{Z.isMarkdown?w(void 0):E(void 0),K()}},`${J}-${Z.isMarkdown}-${e.workspace}-${e.path}`)},`${J}-${g.getCells().length}`)),_,m.jsxs(Zd,{anchorEl:M,open:F,onClose:B,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},children:[m.jsx(cc,{onClick:()=>U(!0,I??0),children:"Add Markdown"}),m.jsx(cc,{onClick:()=>U(!1,I??0),children:"Add Malloy"})]}),m.jsx(op,{sx:{flexDirection:"row",justifyContent:"flex-end",p:1}})]})})]})}function Dxe({workbookData:e}){const[t,n]=vt.useState(!1);return m.jsx(_r,{color:"primary",onClick:async()=>{if(!e)return;const r=e.toMalloyWorkbook();try{await navigator.clipboard.writeText(r),n(!0),setTimeout(()=>n(!1),1500)}catch{n(!1),alert("Failed to copy to clipboard")}},size:"small",children:t?"Copied!":"Export"})}const k_="Local";class Oxe{async listWorkspaces(t){return Promise.resolve([{name:k_,description:"Stored locally- only accessible to this browser",writeable:!0}])}async listWorkbooks(t){const n=[];for(let r=0;r<localStorage.length;r++){const o=localStorage.key(r);n.push({path:o,workspace:k_})}return n}async getWorkbook(t){const n=localStorage.getItem(t.path);if(n===null)throw new Error(`Notebook not found at path: ${t}`);return n}async deleteWorkbook(t){if(localStorage.getItem(t.path)===null)throw new Error(`Notebook not found at path: ${t}`);localStorage.removeItem(t.path)}async saveWorkbook(t,n){localStorage.setItem(t.path,n)}async moveWorkbook(t,n){const r=localStorage.getItem(t.path);if(r===null)throw new Error(`Notebook not found at path: ${t.path}`);localStorage.setItem(n.path,r),localStorage.removeItem(t.path)}}const V7=Fn(m.jsx("path",{d:"M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20z"}));function Rxe({onSubmit:e,isSubmitting:t,disabled:n,disabledReason:r}){const[o,a]=T.useState(!1),[i,s]=T.useState(!1),c=()=>a(!1),u=async()=>{try{await e({forceRefresh:i}),a(!1)}catch{}},f=m.jsx("span",{children:m.jsx(_r,{variant:"contained",startIcon:m.jsx(Sb,{}),onClick:()=>a(!0),disabled:n,"aria-label":"New materialization",children:"New materialization"})});return m.jsxs(m.Fragment,{children:[n&&r?m.jsx(eo,{title:r,children:f}):f,m.jsxs(wi,{open:o,onClose:c,maxWidth:"xs",fullWidth:!0,"aria-labelledby":"create-materialization-title",children:[m.jsx(Ai,{id:"create-materialization-title",children:"New materialization"}),m.jsxs(ki,{children:[m.jsx(Vx,{sx:{mb:2},children:"Materialize every persist source in this package: compile, build the tables, and load them so queries serve from the materialized tables."}),m.jsx(lF,{children:m.jsx(Tp,{control:m.jsx(yA,{checked:i,onChange:p=>s(p.target.checked)}),label:"Force refresh (rebuild even if unchanged)"})})]}),m.jsxs(dh,{children:[m.jsx(_r,{onClick:c,children:"Cancel"}),m.jsx(_r,{variant:"contained",loading:t,onClick:u,children:"Materialize"})]})]})]})}function qk({children:e}){return m.jsx(at,{variant:"caption",component:"h6",sx:{display:"block",textTransform:"uppercase",letterSpacing:"0.06em",fontWeight:600,color:"text.secondary",mb:1},children:e})}function Uy(e){return e===va.Pending||e===va.ManifestRowsReady}function Mxe(e){return e===va.ManifestFileReady||e===va.Failed||e===va.Cancelled}function W7(e){switch(e){case va.ManifestFileReady:return"Done";case va.Failed:return"Failed";case va.Cancelled:return"Cancelled";case va.Pending:case va.ManifestRowsReady:return"Pending";default:return"Unknown"}}function q7(e){switch(e){case va.ManifestRowsReady:return"info";case va.ManifestFileReady:return"success";case va.Failed:return"error";case va.Cancelled:return"warning";case va.Pending:default:return"default"}}function G7(e){return e.metadata??{}}function Nxe(e){return e.trigger==="SCHEDULER"?"Scheduled":"Manual"}function Y7(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),s=a%60;if(i<60)return`${i}m ${s}s`;const c=Math.floor(i/60),u=i%60;return`${c}h ${u}m`}function Gk(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 Pxe(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 Ixe({entries:e,builtAt:t}){const n=Object.entries(e??{});return m.jsxs(gt,{children:[m.jsxs(Lr,{direction:"row",alignItems:"baseline",justifyContent:"space-between",children:[m.jsx(qk,{children:"Build manifest"}),t&&m.jsxs(at,{variant:"caption",color:"text.secondary",children:["Built ",Gk(t)]})]}),n.length===0?m.jsx(at,{variant:"body2",color:"text.secondary",sx:{fontStyle:"italic"},children:"No materialized tables yet."}):m.jsxs(lb,{size:"small",children:[m.jsx(ub,{children:m.jsxs(bl,{children:[m.jsx(Mn,{children:"Source"}),m.jsx(Mn,{children:"Table name"}),m.jsx(Mn,{children:"Connection"}),m.jsx(Mn,{children:"Realization"}),m.jsx(Mn,{align:"right",children:"Rows"})]})}),m.jsx(cb,{children:n.map(([r,o])=>m.jsxs(bl,{children:[m.jsx(Mn,{sx:{fontFamily:gi},children:o.sourceName??r}),m.jsx(Mn,{sx:{fontFamily:gi},children:o.physicalTableName??"-"}),m.jsx(Mn,{sx:{fontFamily:gi},children:o.connectionName??"-"}),m.jsx(Mn,{children:o.realization??"-"}),m.jsx(Mn,{align:"right",children:o.rowCount??"-"})]},r))})]})]})}const nx=Fn([m.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"),m.jsx("path",{d:"M12.5 7H11v6l5.25 3.15.75-1.23-4.5-2.67z"},"1")]),_xe=Fn(m.jsx("path",{d:"M9 11.24V7.5C9 6.12 10.12 5 11.5 5S14 6.12 14 7.5v3.74c1.21-.81 2-2.18 2-3.74C16 5.01 13.99 3 11.5 3S7 5.01 7 7.5c0 1.56.79 2.93 2 3.74m9.84 4.63-4.54-2.26c-.17-.07-.35-.11-.54-.11H13v-6c0-.83-.67-1.5-1.5-1.5S10 6.67 10 7.5v10.74c-3.6-.76-3.54-.75-3.67-.75-.31 0-.59.13-.79.33l-.79.8 4.94 4.94c.27.27.65.44 1.06.44h6.79c.75 0 1.33-.55 1.44-1.28l.75-5.27c.01-.07.02-.14.02-.2 0-.62-.38-1.16-.91-1.38"}));function K7({meta:e}){const t=e.trigger==="SCHEDULER";return m.jsx(eo,{title:t?"Fired by the materialization schedule":"Triggered manually",children:m.jsx(Ld,{size:"small",variant:"outlined",color:t?"info":"default",icon:t?m.jsx(nx,{fontSize:"small"}):m.jsx(_xe,{fontSize:"small"}),label:Nxe(e)})})}function Q7({materialization:e,buildPlan:t,showBuildPlan:n=!0,onClose:r}){const o=e?G7(e):{},a=Object.values(t?.sources??{});return m.jsx(wi,{open:e!==null,onClose:r,maxWidth:"md",fullWidth:!0,"aria-labelledby":"materialization-detail-title",children:e&&m.jsxs(m.Fragment,{children:[m.jsxs(Ai,{sx:{pr:6,pb:1.5},id:"materialization-detail-title",children:[m.jsxs(Lr,{direction:"row",alignItems:"center",spacing:1,sx:{mb:.75},children:[m.jsx(Ld,{size:"small",label:W7(e.status),color:q7(e.status),variant:Uy(e.status)?"filled":"outlined"}),m.jsx(K7,{meta:o})]}),m.jsx(at,{variant:"subtitle1",sx:{fontWeight:600},children:e.packageName??"Materialization"}),m.jsx(at,{variant:"caption",color:"text.secondary",sx:{fontFamily:gi,wordBreak:"break-all"},children:e.id}),m.jsx(dr,{"aria-label":"close",onClick:r,sx:{position:"absolute",right:8,top:8},children:m.jsx(Ns,{fontSize:"small"})})]}),m.jsxs(ki,{dividers:!0,children:[m.jsxs(gt,{sx:{bgcolor:"action.hover",borderRadius:2,p:2,mb:3,display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(140px, 1fr))",gap:2},children:[m.jsx(lg,{label:"Started",value:Gk(e.startedAt??e.createdAt)}),m.jsx(lg,{label:"Completed",value:Gk(e.completedAt)}),m.jsx(lg,{label:"Duration",value:Y7(e.startedAt,e.completedAt)}),m.jsx(lg,{label:"Sources",value:`${o.sourcesBuilt??0} built · ${o.sourcesReused??0} reused`}),m.jsx(lg,{label:"Force refresh",value:o.forceRefresh?"Yes":"No"})]}),e.error&&m.jsxs(gt,{sx:{borderRadius:2,p:2,mb:3,border:"1px solid",borderColor:"error.main"},children:[m.jsx(qk,{children:m.jsx(gt,{component:"span",sx:{color:"error.main"},children:"Error"})}),m.jsx(at,{variant:"body2",sx:{fontFamily:gi,whiteSpace:"pre-wrap"},children:e.error})]}),n&&m.jsxs(gt,{sx:{mb:3},children:[m.jsx(qk,{children:"Build plan"}),a.length===0?m.jsx(at,{variant:"body2",color:"text.secondary",sx:{fontStyle:"italic"},children:"This package has no persist sources."}):m.jsxs(lb,{size:"small",children:[m.jsx(ub,{children:m.jsxs(bl,{children:[m.jsx(Mn,{children:"Source"}),m.jsx(Mn,{children:"Connection"}),m.jsx(Mn,{children:"Dialect"}),m.jsx(Mn,{align:"right",children:"Columns"}),m.jsx(Mn,{children:"Source Entity ID"})]})}),m.jsx(cb,{children:a.map(i=>m.jsxs(bl,{children:[m.jsx(Mn,{sx:{fontFamily:gi},children:i.name}),m.jsx(Mn,{sx:{fontFamily:gi},children:i.connectionName}),m.jsx(Mn,{children:i.dialect??"-"}),m.jsx(Mn,{align:"right",children:i.columns?.length??0}),m.jsx(Mn,{sx:{fontFamily:gi,fontSize:"0.75rem",wordBreak:"break-all",maxWidth:220},children:i.sourceEntityId})]},i.sourceID))})]})]}),m.jsx(Ixe,{entries:e.manifest?.entries,builtAt:e.manifest?.builtAt})]})]})})}function lg({label:e,value:t}){return m.jsxs(gt,{children:[m.jsx(at,{variant:"caption",color:"text.secondary",display:"block",children:e}),m.jsx(at,{variant:"body2",children:t})]})}const Lxe=Fn(m.jsx("path",{d:"M6 6h12v12H6z"})),X7=Ke.oneOfType([Ke.func,Ke.object]);function A_(e){try{return e.matches(":focus-visible")}catch{}return!1}const D_={};function Z7(e,t){const n=T.useRef(D_);return n.current===D_&&(n.current=e(t)),n}class rx{static create(){return new rx}static use(){const t=Z7(rx.create).current,[n,r]=T.useState(!1);return t.shouldMount=n,t.setShouldMount=r,T.useEffect(t.mountEffect,[n]),t}constructor(){this.ref={current:null},this.mounted=null,this.didMount=!1,this.shouldMount=!1,this.setShouldMount=null}mount(){return this.mounted||(this.mounted=jxe(),this.shouldMount=!0,this.setShouldMount(this.shouldMount)),this.mounted}mountEffect=()=>{this.shouldMount&&!this.didMount&&this.ref.current!==null&&(this.didMount=!0,this.mounted.resolve())};start(...t){this.mount().then(()=>this.ref.current?.start(...t))}stop(...t){this.mount().then(()=>this.ref.current?.stop(...t))}pulsate(...t){this.mount().then(()=>this.ref.current?.pulsate(...t))}}function Fxe(){return rx.use()}function jxe(){let e,t;const n=new Promise((r,o)=>{e=r,t=o});return n.resolve=e,n.reject=t,n}function Yk(e,t){return Yk=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,r){return n.__proto__=r,n},Yk(e,t)}function ND(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,Yk(e,t)}function Bxe(e,t){return e.classList?!!t&&e.classList.contains(t):(" "+(e.className.baseVal||e.className)+" ").indexOf(" "+t+" ")!==-1}function $xe(e,t){e.classList?e.classList.add(t):Bxe(e,t)||(typeof e.className=="string"?e.className=e.className+" "+t:e.setAttribute("class",(e.className&&e.className.baseVal||"")+" "+t))}function O_(e,t){return e.replace(new RegExp("(^|\\s)"+t+"(?:\\s|$)","g"),"$1").replace(/\s+/g," ").replace(/^\s*|\s*$/g,"")}function zxe(e,t){e.classList?e.classList.remove(t):typeof e.className=="string"?e.className=O_(e.className,t):e.setAttribute("class",O_(e.className&&e.className.baseVal||"",t))}const R_={disabled:!1},ox=vt.createContext(null);var J7=function(e){return e.scrollTop},jg="unmounted",hd="exited",md="entering",mp="entered",Kk="exiting",ms=(function(e){ND(t,e);function t(r,o){var a;a=e.call(this,r,o)||this;var i=o,s=i&&!i.isMounting?r.enter:r.appear,c;return a.appearStatus=null,r.in?s?(c=hd,a.appearStatus=md):c=mp:r.unmountOnExit||r.mountOnEnter?c=jg:c=hd,a.state={status:c},a.nextCallback=null,a}t.getDerivedStateFromProps=function(r,o){var a=r.in;return a&&o.status===jg?{status:hd}:null};var n=t.prototype;return n.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},n.componentDidUpdate=function(r){var o=null;if(r!==this.props){var a=this.state.status;this.props.in?a!==md&&a!==mp&&(o=md):(a===md||a===mp)&&(o=Kk)}this.updateStatus(!1,o)},n.componentWillUnmount=function(){this.cancelNextCallback()},n.getTimeouts=function(){var r=this.props.timeout,o,a,i;return o=a=i=r,r!=null&&typeof r!="number"&&(o=r.exit,a=r.enter,i=r.appear!==void 0?r.appear:a),{exit:o,enter:a,appear:i}},n.updateStatus=function(r,o){if(r===void 0&&(r=!1),o!==null)if(this.cancelNextCallback(),o===md){if(this.props.unmountOnExit||this.props.mountOnEnter){var a=this.props.nodeRef?this.props.nodeRef.current:pu.findDOMNode(this);a&&J7(a)}this.performEnter(r)}else this.performExit();else this.props.unmountOnExit&&this.state.status===hd&&this.setState({status:jg})},n.performEnter=function(r){var o=this,a=this.props.enter,i=this.context?this.context.isMounting:r,s=this.props.nodeRef?[i]:[pu.findDOMNode(this),i],c=s[0],u=s[1],f=this.getTimeouts(),p=i?f.appear:f.enter;if(!r&&!a||R_.disabled){this.safeSetState({status:mp},function(){o.props.onEntered(c)});return}this.props.onEnter(c,u),this.safeSetState({status:md},function(){o.props.onEntering(c,u),o.onTransitionEnd(p,function(){o.safeSetState({status:mp},function(){o.props.onEntered(c,u)})})})},n.performExit=function(){var r=this,o=this.props.exit,a=this.getTimeouts(),i=this.props.nodeRef?void 0:pu.findDOMNode(this);if(!o||R_.disabled){this.safeSetState({status:hd},function(){r.props.onExited(i)});return}this.props.onExit(i),this.safeSetState({status:Kk},function(){r.props.onExiting(i),r.onTransitionEnd(a.exit,function(){r.safeSetState({status:hd},function(){r.props.onExited(i)})})})},n.cancelNextCallback=function(){this.nextCallback!==null&&(this.nextCallback.cancel(),this.nextCallback=null)},n.safeSetState=function(r,o){o=this.setNextCallback(o),this.setState(r,o)},n.setNextCallback=function(r){var o=this,a=!0;return this.nextCallback=function(i){a&&(a=!1,o.nextCallback=null,r(i))},this.nextCallback.cancel=function(){a=!1},this.nextCallback},n.onTransitionEnd=function(r,o){this.setNextCallback(o);var a=this.props.nodeRef?this.props.nodeRef.current:pu.findDOMNode(this),i=r==null&&!this.props.addEndListener;if(!a||i){setTimeout(this.nextCallback,0);return}if(this.props.addEndListener){var s=this.props.nodeRef?[this.nextCallback]:[a,this.nextCallback],c=s[0],u=s[1];this.props.addEndListener(c,u)}r!=null&&setTimeout(this.nextCallback,r)},n.render=function(){var r=this.state.status;if(r===jg)return null;var o=this.props,a=o.children;o.in,o.mountOnEnter,o.unmountOnExit,o.appear,o.enter,o.exit,o.timeout,o.addEndListener,o.onEnter,o.onEntering,o.onEntered,o.onExit,o.onExiting,o.onExited,o.nodeRef;var i=fn(o,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]);return vt.createElement(ox.Provider,{value:null},typeof a=="function"?a(r,i):vt.cloneElement(vt.Children.only(a),i))},t})(vt.Component);ms.contextType=ox;ms.propTypes={};function lp(){}ms.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:lp,onEntering:lp,onEntered:lp,onExit:lp,onExiting:lp,onExited:lp};ms.UNMOUNTED=jg;ms.EXITED=hd;ms.ENTERING=md;ms.ENTERED=mp;ms.EXITING=Kk;var Hxe=function(e,t){return e&&t&&t.split(" ").forEach(function(n){return $xe(e,n)})},cw=function(e,t){return e&&t&&t.split(" ").forEach(function(n){return zxe(e,n)})},PD=(function(e){ND(t,e);function t(){for(var r,o=arguments.length,a=new Array(o),i=0;i<o;i++)a[i]=arguments[i];return r=e.call.apply(e,[this].concat(a))||this,r.appliedClasses={appear:{},enter:{},exit:{}},r.onEnter=function(s,c){var u=r.resolveArguments(s,c),f=u[0],p=u[1];r.removeClasses(f,"exit"),r.addClass(f,p?"appear":"enter","base"),r.props.onEnter&&r.props.onEnter(s,c)},r.onEntering=function(s,c){var u=r.resolveArguments(s,c),f=u[0],p=u[1],y=p?"appear":"enter";r.addClass(f,y,"active"),r.props.onEntering&&r.props.onEntering(s,c)},r.onEntered=function(s,c){var u=r.resolveArguments(s,c),f=u[0],p=u[1],y=p?"appear":"enter";r.removeClasses(f,y),r.addClass(f,y,"done"),r.props.onEntered&&r.props.onEntered(s,c)},r.onExit=function(s){var c=r.resolveArguments(s),u=c[0];r.removeClasses(u,"appear"),r.removeClasses(u,"enter"),r.addClass(u,"exit","base"),r.props.onExit&&r.props.onExit(s)},r.onExiting=function(s){var c=r.resolveArguments(s),u=c[0];r.addClass(u,"exit","active"),r.props.onExiting&&r.props.onExiting(s)},r.onExited=function(s){var c=r.resolveArguments(s),u=c[0];r.removeClasses(u,"exit"),r.addClass(u,"exit","done"),r.props.onExited&&r.props.onExited(s)},r.resolveArguments=function(s,c){return r.props.nodeRef?[r.props.nodeRef.current,s]:[s,c]},r.getClassNames=function(s){var c=r.props.classNames,u=typeof c=="string",f=u&&c?c+"-":"",p=u?""+f+s:c[s],y=u?p+"-active":c[s+"Active"],g=u?p+"-done":c[s+"Done"];return{baseClassName:p,activeClassName:y,doneClassName:g}},r}var n=t.prototype;return n.addClass=function(r,o,a){var i=this.getClassNames(o)[a+"ClassName"],s=this.getClassNames("enter"),c=s.doneClassName;o==="appear"&&a==="done"&&c&&(i+=" "+c),a==="active"&&r&&J7(r),i&&(this.appliedClasses[o][a]=i,Hxe(r,i))},n.removeClasses=function(r,o){var a=this.appliedClasses[o],i=a.base,s=a.active,c=a.done;this.appliedClasses[o]={},i&&cw(r,i),s&&cw(r,s),c&&cw(r,c)},n.render=function(){var r=this.props;r.classNames;var o=fn(r,["classNames"]);return vt.createElement(ms,pe({},o,{onEnter:this.onEnter,onEntered:this.onEntered,onEntering:this.onEntering,onExit:this.onExit,onExiting:this.onExiting,onExited:this.onExited}))},t})(vt.Component);PD.defaultProps={classNames:""};PD.propTypes={};function Uxe(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function ID(e,t){var n=function(o){return t&&T.isValidElement(o)?t(o):o},r=Object.create(null);return e&&T.Children.map(e,function(o){return o}).forEach(function(o){r[o.key]=n(o)}),r}function Vxe(e,t){e=e||{},t=t||{};function n(f){return f in t?t[f]:e[f]}var r=Object.create(null),o=[];for(var a in e)a in t?o.length&&(r[a]=o,o=[]):o.push(a);var i,s={};for(var c in t){if(r[c])for(i=0;i<r[c].length;i++){var u=r[c][i];s[r[c][i]]=n(u)}s[c]=n(c)}for(i=0;i<o.length;i++)s[o[i]]=n(o[i]);return s}function kd(e,t,n){return n[t]!=null?n[t]:e.props[t]}function Wxe(e,t){return ID(e.children,function(n){return T.cloneElement(n,{onExited:t.bind(null,n),in:!0,appear:kd(n,"appear",e),enter:kd(n,"enter",e),exit:kd(n,"exit",e)})})}function qxe(e,t,n){var r=ID(e.children),o=Vxe(t,r);return Object.keys(o).forEach(function(a){var i=o[a];if(T.isValidElement(i)){var s=a in t,c=a in r,u=t[a],f=T.isValidElement(u)&&!u.props.in;c&&(!s||f)?o[a]=T.cloneElement(i,{onExited:n.bind(null,i),in:!0,exit:kd(i,"exit",e),enter:kd(i,"enter",e)}):!c&&s&&!f?o[a]=T.cloneElement(i,{in:!1}):c&&s&&T.isValidElement(u)&&(o[a]=T.cloneElement(i,{onExited:n.bind(null,i),in:u.props.in,exit:kd(i,"exit",e),enter:kd(i,"enter",e)}))}}),o}var Gxe=Object.values||function(e){return Object.keys(e).map(function(t){return e[t]})},Yxe={component:"div",childFactory:function(e){return e}},Ob=(function(e){ND(t,e);function t(r,o){var a;a=e.call(this,r,o)||this;var i=a.handleExited.bind(Uxe(a));return a.state={contextValue:{isMounting:!0},handleExited:i,firstRender:!0},a}var n=t.prototype;return n.componentDidMount=function(){this.mounted=!0,this.setState({contextValue:{isMounting:!1}})},n.componentWillUnmount=function(){this.mounted=!1},t.getDerivedStateFromProps=function(r,o){var a=o.children,i=o.handleExited,s=o.firstRender;return{children:s?Wxe(r,i):qxe(r,a,i),firstRender:!1}},n.handleExited=function(r,o){var a=ID(this.props.children);r.key in a||(r.props.onExited&&r.props.onExited(o),this.mounted&&this.setState(function(i){var s=pe({},i.children);return delete s[r.key],{children:s}}))},n.render=function(){var r=this.props,o=r.component,a=r.childFactory,i=fn(r,["component","childFactory"]),s=this.state.contextValue,c=Gxe(this.state.children).map(a);return delete i.appear,delete i.enter,delete i.exit,o===null?vt.createElement(ox.Provider,{value:s},c):vt.createElement(ox.Provider,{value:s},vt.createElement(o,i,c))},t})(vt.Component);Ob.propTypes={};Ob.defaultProps=Yxe;const Kxe=[];function Qxe(e){T.useEffect(e,Kxe)}class _D{static create(){return new _D}currentId=null;start(t,n){this.clear(),this.currentId=setTimeout(()=>{this.currentId=null,n()},t)}clear=()=>{this.currentId!==null&&(clearTimeout(this.currentId),this.currentId=null)};disposeEffect=()=>this.clear}function PS(){const e=Z7(_D.create).current;return Qxe(e.disposeEffect),e}function Xxe(e){const{className:t,classes:n,pulsate:r=!1,rippleX:o,rippleY:a,rippleSize:i,in:s,onExited:c,timeout:u}=e,[f,p]=T.useState(!1),y=Ot(t,n.ripple,n.rippleVisible,r&&n.ripplePulsate),g={width:i,height:i,top:-(i/2)+a,left:-(i/2)+o},b=Ot(n.child,f&&n.childLeaving,r&&n.childPulsate);return!s&&!f&&p(!0),T.useEffect(()=>{if(!s&&c!=null){const x=setTimeout(c,u);return()=>{clearTimeout(x)}}},[c,s,u]),m.jsx("span",{className:y,style:g,children:m.jsx("span",{className:b})})}const Yi=Lt("MuiTouchRipple",["root","ripple","rippleVisible","ripplePulsate","child","childLeaving","childPulsate"]),Qk=550,Zxe=80,Jxe=El`
326
+ `).length,length:we.target.value.length}))}};return m.jsx(Ch.Provider,{value:pe({},te,{dispatch:_}),children:m.jsxs("div",pe({ref:Z,className:re},z,{onClick:me,style:de,children:[m.jsx(w_,{hideToolbar:k,toolbarBottom:$,prefixCls:r,overflow:E,placement:"top"}),m.jsxs("div",{className:r+"-content",children:[/(edit|live)/.test(te.preview||"")&&m.jsx(axe,pe({className:r+"-input",prefixCls:r,autoFocus:M},w,{onChange:Me,renderTextarea:j?.textarea||V,onScroll:we=>ae(we,"text")})),/(live|preview)/.test(te.preview||"")&&ge]}),y&&!te.fullscreen&&m.jsx(sxe,{prefixCls:r,height:te.height,maxHeight:C,minHeight:R,onChange:Qe}),m.jsx(w_,{hideToolbar:k,toolbarBottom:$,prefixCls:r,overflow:E,placement:"bottom"})]}))})}),$7=uxe;$7.Markdown=N7;const sw={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"}]}}},dxe={...sw,patterns:[...sw.patterns,{include:"#docvar"}],repository:{...sw.repository,docvar:{patterns:[{match:"\\<\\<[^(\\>\\>)]*\\>\\>",beginCaptures:{0:{name:"punctuation.definition.comment.begin"}},endCaptures:{0:{name:"punctuation.definition.comment.end"}},name:"markup.italic.markdown"}]}}},fxe={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"}]}}},pxe="github-light",hxe="github-dark";let lw;function mxe(){return lw||(lw=(async()=>{const[{createHighlighterCore:e},{createOnigurumaEngine:t},{default:n},{default:r},{default:o},{default:a},{default:i}]=await Promise.all([co(()=>import("./core-BSRgt1mG.es-Bc_D2Lq4.js"),__vite__mapDeps([0,1])),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"],...dxe},{name:"malloysql",scopeName:"source.malloy-sql",embeddedLangs:["sql"],...fxe}]})})()),lw}async function tx(e,t,n="light"){return(await mxe()).codeToHtml(e,{lang:t,theme:n==="dark"?hxe:pxe})}function uo(e){const{server:t}=Dr(),n={...e,queryKey:[...e.queryKey,t],queryFn:async()=>{try{return await e.queryFn()}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 MF(n,AA)}function Ho(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 Tne(t,AA)}const to=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},MD=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};function z7({sourceAndPaths:e,selectedSourceIndex:t,existingQuery:n,onQueryChange:r,onSourceChange:o,resourceUri:a}){return vt.useEffect(()=>{o&&o(t)},[t,o]),m.jsx(wA,{children:m.jsxs(PG,{spacing:2,component:"section",children:[m.jsx(yxe,{sourceAndPath:e[t],existingQuery:n,onChange:i=>{r&&r(i)},resourceUri:a}),m.jsx(f6,{height:"5px"})]})})}function p1(){return{query:void 0,malloyQuery:void 0,malloyResult:void 0}}function gxe({sourceAndPath:e,onChange:t,existingQuery:n,explorerComponents:r,QueryBuilder:o,resourceUri:a}){const[i,s]=vt.useState(n||p1()),[c,u]=vt.useState(void 0);vt.useEffect(()=>{n&&s(n)},[n]);const[f,p]=vt.useState([]),{MalloyExplorerProvider:y,QueryPanel:g,ResizableCollapsiblePanel:b,ResultPanel:x,SourcePanel:E}=r;vt.useEffect(()=>{t&&t(i)},[t,i]);const{environmentName:S,packageName:w,versionId:C}=to(a),{apiClients:R}=Dr(),M=Ho({mutationFn:()=>{const F=typeof i?.malloyQuery=="string"?i.malloyQuery:new o.ASTQuery({source:e.sourceInfo,query:i?.malloyQuery}).toMalloy();return u({executionState:"running",query:i?.malloyQuery,queryResolutionStartMillis:Date.now(),onCancel:()=>{M.reset(),u(void 0)},response:{result:{}}}),s({...i,query:F}),R.models.executeQueryModel(S,w,e.modelPath,{query:F,sourceName:void 0,queryName:void 0,versionId:C})},onSuccess:F=>{if(F){const B=JSON.parse(F.data.result);s({...i,malloyResult:B}),u(U=>U?{...U,executionState:"finished",response:{result:B}}:void 0)}},onError:F=>{u(void 0),console.error("Query execution error:",F)}}),[D,I]=vt.useState(e.sourceInfo.name);vt.useEffect(()=>{D!==e.sourceInfo.name&&(I(e.sourceInfo.name),s(p1()),u(void 0))},[e,D]);const L=vt.useCallback(F=>{s({...i,malloyQuery:F,malloyResult:void 0})},[i]);return D!==e.sourceInfo.name?m.jsx("div",{children:"Loading..."}):m.jsx(aj,{sx:{border:"1px solid #e0e0e0",borderRadius:"8px",overflow:"hidden"},children:m.jsx(y,{source:e.sourceInfo,query:i?.malloyQuery,topValues:[],onFocusedNestViewPathChange:p,focusedNestViewPath:f,onQueryChange:L,children:m.jsxs("div",{style:{display:"flex",height:"100%",overflowY:"auto"},children:[m.jsx(b,{isInitiallyExpanded:!0,initialWidth:180,minWidth:180,icon:"database",title:e.sourceInfo.name,children:m.jsx(E,{onRefresh:()=>s(p1())})}),m.jsx(b,{isInitiallyExpanded:!0,initialWidth:280,minWidth:280,icon:"filterSliders",title:"Query",children:m.jsx(g,{runQuery:()=>{console.log(`running query with: ${i?.malloyQuery}`);try{M.mutate()}catch(F){console.error("Error running query:",F)}}})}),m.jsx(x,{source:e.sourceInfo,draftQuery:i?.malloyQuery,setDraftQuery:F=>s({...i,malloyQuery:F}),submittedQuery:c,options:{showRawQuery:!0}})]})})},e.sourceInfo.name)}function yxe(e){const[t,n]=T.useState(null),[r,o]=T.useState(null),[a,i]=T.useState(!0);return T.useEffect(()=>{let s=!0;return Promise.all([co(()=>import("./index-BX4D94xw.js"),__vite__mapDeps([2,3,4,5,6])),co(()=>import("./index-Cvy0xtb7.js").then(c=>c.i),__vite__mapDeps([3,4]))]).then(([c,u])=>{s&&(n(c),o(u),i(!1))}).catch(c=>{console.error("Failed to load Malloy components:",c),s&&i(!1)}),()=>{s=!1}},[]),a||!t||!r?m.jsx(woe,{children:m.jsx(aj,{children:m.jsx(f6,{sx:{alignItems:"center",justifyContent:"center",height:"200px",color:"text.secondary"},children:"Loading explorer..."})})}):m.jsx(gxe,{...e,explorerComponents:t,QueryBuilder:r,resourceUri:e.resourceUri})}const H7=Fn(m.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 Ca({text:e,size:t=20,color:n="primary",thickness:r=3.6,centered:o=!0,spacing:a=2,textVariant:i="body2"}){const s=m.jsxs(gt,{sx:{display:"flex",flexDirection:"column",alignItems:"center",gap:a},children:[m.jsx(_x,{size:t,color:n,thickness:r}),e&&m.jsx(at,{variant:i,color:"text.secondary",children:e})]});return o?m.jsx(gt,{sx:{display:"flex",justifyContent:"center",alignItems:"center",minHeight:"200px",width:"100%"},children:s}):s}const bxe=new Set(["warn","error"]);function vxe(e){if(!e?.length)return;const t=[];let n=!1;for(const r of e)!r.message||!bxe.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(`
327
+ `)}}const xxe=T.lazy(()=>Promise.resolve().then(()=>yPe));function NS({result:e,maxHeight:t,maxResultSize:n=0,renderLogs:r}){const o=T.useRef(null),[a,i]=T.useState(t),[s,c]=T.useState(!1),u=vxe(r);if(!e)return null;if(n>0&&e.length>n&&!s)return m.jsxs(gt,{sx:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:2,p:4,backgroundColor:"#fafafa",border:"1px solid",borderColor:"#e0e0e0",borderRadius:1},children:[m.jsx(Kae,{sx:{fontSize:48,color:"#757575"}}),m.jsx(at,{variant:"h6",color:"text.secondary",align:"center",children:"Processing large results may cause browser performance issues. Proceed?"}),m.jsx(_r,{variant:"contained",color:"primary",onClick:()=>c(!0),children:"Proceed"})]});const f=m.jsx(Ca,{text:"Loading...",centered:!0,size:32}),p=Math.min(t,a);return m.jsxs(gt,{ref:o,sx:{position:"relative",height:"auto",border:"0px",borderRadius:0,overflow:"hidden"},children:[e&&m.jsx(T.Suspense,{fallback:f,children:m.jsx(xxe,{result:e,height:p,onSizeChange:i})}),u&&m.jsx(gt,{sx:{position:"absolute",top:4,right:4,zIndex:1},children:m.jsx(eo,{title:u.title,slotProps:{tooltip:{sx:{whiteSpace:"pre-line"}}},children:m.jsx(dr,{size:"small","aria-label":"Render tag warnings",sx:{backgroundColor:"rgba(255, 255, 255, 0.9)","&:hover":{backgroundColor:"rgba(255, 255, 255, 1)"}},children:m.jsx(H7,{fontSize:"small",color:u.severity==="error"?"error":"warning"})})})})]})}function Sxe({cell:e,sourceAndPaths:t,resourceUri:n,onQueryChange:r,onSourceChange:o}){const a={query:e.value,malloyResult:e.result?JSON.parse(e.result):void 0,malloyQuery:e.queryInfo?JSON.parse(e.queryInfo):void 0},i=t.findIndex(s=>s.sourceInfo.name===e.sourceName);return m.jsx(z7,{resourceUri:n,sourceAndPaths:t,selectedSourceIndex:i>=0?i:0,existingQuery:a,onQueryChange:r,onSourceChange:o})}function Exe({cell:e,editingMalloy:t,editingMarkdown:n,sourceAndPaths:r,resourceUri:o,onCellChange:a,onClose:i,onEdit:s,onDelete:c,addButtonCallback:u}){const[f,p]=T.useState(e.value),[y,g]=vt.useState(!1),[b,x]=vt.useState(!1),[E,S]=vt.useState(),[w]=vt.useState(),[C,R]=vt.useState(p1()),[M,D]=vt.useState(!1),[I,L]=vt.useState(e.sourceName?r.findIndex(J=>J.sourceInfo.name===e.sourceName):0),{mode:F}=mb();T.useEffect(()=>{e.isMarkdown||tx(e.value,"malloy",F).then(J=>{S(J)})},[e,F]),vt.useEffect(()=>{document.documentElement.setAttribute("data-color-mode","light")});const[B,U]=T.useState(!1),k=()=>{c(),U(!1)},$=r.length===0,j=vt.useCallback(()=>{const J=r[I],W=J?.modelPath||e.modelPath||"",re=J?.sourceInfo.name||e.sourceName||"";a({...e,value:e.isMarkdown?f:C.query,result:C.malloyResult?JSON.stringify(C.malloyResult):void 0,queryInfo:C.malloyQuery?JSON.stringify(C.malloyQuery):void 0,sourceName:re,modelPath:W})},[e,f,C,a,I,r]),V=m.jsx(eo,{title:"Delete Cell",children:m.jsx(dr,{size:"small",onClick:()=>U(!0),children:m.jsx("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:m.jsx("path",{d:"M3 6h18M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2m2 0v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6h14zM10 11v6M14 11v6",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})})}),z=m.jsxs(wi,{open:B,onClose:()=>U(!1),children:[m.jsx(Ai,{children:"Confirm Delete"}),m.jsx(ki,{children:m.jsx(at,{children:"Are you sure you want to delete this cell?"})}),m.jsxs(dh,{children:[m.jsx(_r,{onClick:()=>U(!1),children:"Cancel"}),m.jsx(_r,{onClick:k,color:"error",children:"Delete"})]})]}),K=()=>{j(),i()},Y=e.isMarkdown?m.jsxs(m.Fragment,{children:[n?m.jsx(eo,{title:"Save",children:m.jsx(dr,{size:"small",onClick:K,children:m.jsx(E0,{})})}):m.jsx(eo,{title:"Edit",children:m.jsx(dr,{size:"small",onClick:s,children:m.jsx(q5,{})})}),!n&&V]}):m.jsxs(m.Fragment,{children:[!t&&m.jsx(eo,{title:y?"Hide Code":"View Code",children:m.jsx(dr,{size:"small",onClick:()=>{g(!y)},children:m.jsx(yB,{})})}),!t&&e.result&&m.jsx(eo,{title:b?"Hide Embedding":"View Embedding",children:m.jsx(dr,{size:"small",onClick:()=>{x(!b)},children:m.jsx(ZA,{})})}),t&&m.jsx(eo,{title:"Save",children:m.jsx(dr,{size:"small",onClick:K,children:m.jsx(E0,{})})}),!t&&m.jsx(eo,{title:"Edit",children:m.jsx(dr,{size:"small",onClick:s,children:m.jsx(q5,{})})}),!t&&V]}),te=t||n,_=n?m.jsx(eo,{title:"Save",children:m.jsx(dr,{size:"small",onClick:K,children:m.jsx(E0,{})})}):t?m.jsx(eo,{title:"Save",children:m.jsx(dr,{size:"small",onClick:K,children:m.jsx(E0,{})})}):null,Z=M&&m.jsx(gt,{sx:{position:"absolute",top:"4px",right:"4px",display:"flex",gap:"8px",backgroundColor:"background.paper",border:"1px solid",borderColor:"divider",borderRadius:"8px",padding:"2px 4px",boxShadow:1,zIndex:10},children:!te&&m.jsxs(m.Fragment,{children:[u(!0),u(!1),Y]})||_});return m.jsxs(L1,{sx:J=>({position:"relative",marginTop:"5px",marginBottom:"5px",borderWidth:"1.5px",backgroundColor:J.palette.background.paper,minHeight:"50px"}),onMouseEnter:()=>D(!0),onMouseLeave:()=>{D(!1)},children:[Z,e.isMarkdown?m.jsx(m.Fragment,{children:n?m.jsx($7,{value:f,preview:"edit",autoFocus:!0,onChange:J=>{p(J),a({...e,value:J})},onBlur:()=>{j(),M||K()}}):m.jsx(gt,{sx:{px:.5,pt:0,mt:0,"& h1, & h2, & h3, & h4, & h5, & h6":{mt:.5,mb:.5},"& p":{mt:.5,mb:.5},"& ul, & ol":{mt:.5,mb:.5},"& li":{mt:0,mb:0},"& pre, & code":{mt:.5,mb:.5},"& blockquote":{mt:.5,mb:.5}},children:e.value?m.jsx(gt,{onClick:s,sx:{cursor:"pointer"},children:m.jsx(F1,{children:e.value})}):m.jsxs(gt,{onClick:s,sx:{cursor:"pointer"},children:[m.jsx(at,{sx:{p:2,textAlign:"center",variant:"subtitle2",fontWeight:"medium"},children:"Markdown is empty"}),m.jsx(at,{sx:{mb:2,textAlign:"center",variant:"body2"},children:"Click to edit."})]})})}):m.jsxs(m.Fragment,{children:[m.jsx(A1,{in:b,timeout:"auto",unmountOnExit:!0,children:m.jsx(Lr,{sx:{p:"10px",borderRadius:0,flexDirection:"row",justifyContent:"space-between"},children:m.jsx(at,{component:"div",sx:{fontSize:"12px","& .line":{textWrap:"wrap"}},dangerouslySetInnerHTML:{__html:w}})})}),m.jsx(A1,{in:y,timeout:"auto",unmountOnExit:!0,children:m.jsx(Lr,{sx:{p:"10px",borderRadius:0,flexDirection:"row",justifyContent:"space-between"},children:m.jsx(at,{component:"div",className:"content",sx:{fontSize:"12px","& .line":{textWrap:"wrap"}},dangerouslySetInnerHTML:{__html:E}})})}),t&&($?m.jsxs(m.Fragment,{children:[m.jsx(at,{sx:{p:2,textAlign:"center",variant:"subtitle2",fontWeight:"medium"},children:"No Model Imports"}),m.jsx(at,{sx:{mb:2,textAlign:"center",variant:"body2"},children:"Please add a model import above."})]}):m.jsx(Sxe,{sourceAndPaths:r,resourceUri:o,onQueryChange:J=>{R(J)},onSourceChange:J=>{L(J)},cell:e})),!t&&e.result&&m.jsx(L1,{variant:"outlined",sx:{borderRadius:0},children:m.jsx(NS,{result:e.result,maxHeight:800})}),!t&&!e.result&&m.jsxs(gt,{onClick:s,sx:{cursor:"pointer"},children:[m.jsx(at,{sx:{p:2,textAlign:"center",variant:"subtitle2",fontWeight:"medium"},children:"Explore is empty"}),m.jsx(at,{sx:{mb:2,textAlign:"center",variant:"body2"},children:"Click to edit."})]})]}),B&&z]})}const U7=T.createContext(void 0);function Cxe({children:e,workbookStorage:t}){const n=T.useMemo(()=>({workbookStorage:t}),[t]);return m.jsx(U7.Provider,{value:n,children:e})}function Txe(){const e=T.useContext(U7);if(!e)throw new Error("useWorkbookStorage must be used within a WorkbookStorageProvider");return e}const Ns=Fn(m.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"})),wxe=Fn(m.jsx("path",{d:"M18 15v3H6v-3H4v3c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2v-3zM7 9l1.41 1.41L11 7.83V16h2V7.83l2.59 2.58L17 9l-5-5z"}));function Ta({error:e,context:t}){const n=e.data?.message||"Unknown Error";return m.jsxs(m.Fragment,{children:[t&&m.jsx(at,{variant:"body2",sx:{p:"10px",m:"auto"},children:t}),m.jsx("pre",{style:{whiteSpace:"pre-wrap",color:"red",padding:"10px",margin:"auto"},children:n})]})}function kxe({initialSelectedModels:e,onModelChange:t,resourceUri:n}){const{environmentName:r,packageName:o,versionId:a}=to(n),{apiClients:i}=Dr(),{data:s,isLoading:c,isSuccess:u,isError:f,error:p}=uo({queryKey:["models",r,o,a],queryFn:()=>i.models.listModels(r,o,a)}),[y,g]=vt.useState(e||[]),[b,x]=vt.useState(null);vt.useEffect(()=>{g(e||[])},[e]);const E=C=>{const R=y.filter(M=>M!==C);g(R),t(R)},S=C=>{const R=[...y,C];g(R),t(R),x(null)};let w=[];return u&&s?.data&&(w=s.data.filter(C=>!y.includes(C.path)).map(C=>C.path)),f?m.jsx(Ta,{error:p,context:`${r} > ${o} > Model Picker`}):m.jsxs(m.Fragment,{children:[m.jsxs(uA,{fullWidth:!0,children:[c&&m.jsx(at,{children:"Loading..."}),m.jsxs(Lr,{direction:"row",spacing:1,children:[y.map(C=>m.jsx(Ld,{label:C,onDelete:()=>E(C),deleteIcon:m.jsx(Ns,{}),sx:{marginBottom:"5px"}},C)),m.jsx(_r,{size:"small",startIcon:m.jsx(wxe,{}),onClick:C=>x(C.currentTarget),disabled:c||f||w.length===0,children:"Add Model"})]})]}),m.jsxs(Zd,{anchorEl:b,open:!!b,onClose:()=>x(null),children:[m.jsx(at,{variant:"subtitle2",sx:{ml:1},children:"Models"}),m.jsx(yl,{}),w.length===0?m.jsx(cc,{disabled:!0,children:"No models available"}):w.map(C=>m.jsx(cc,{onClick:()=>S(C),children:m.jsx(at,{variant:"body2",children:C})},C))]})]})}function Axe(){const e=E2();return(t,n)=>{if(!n||!n.metaKey&&!n.ctrlKey&&!n.shiftKey&&n.button!==1){e(t);return}const r=new URL(t,window.location.href).href;(n.metaKey||n.ctrlKey||n.button===1||n.shiftKey)&&window.open(r,"_blank")}}function gIe({workbookPath:e,resourceUri:t}){const n=Axe(),{server:r,getAccessToken:o}=Dr(),{apiClients:a}=Dr(),{workbookStorage:i}=Txe(),{environmentName:s,packageName:c}=to(t),[u,f]=vt.useState(void 0),[p,y]=vt.useState(void 0);if(!i)throw new Error("Workbook storage be provided via WorkbookStorageProvider");const[g,b]=vt.useState(),[x,E]=vt.useState(),[S,w]=vt.useState(),[C,R]=vt.useState([]),[M,D]=vt.useState(null),[I,L]=vt.useState(null),F=!!M,B=()=>{D(null),L(null)},U=(Z,J)=>{g&&(b(g.insertCell(J,{isMarkdown:Z,value:""})),Z?w(J):E(J),B(),console.log("handleAddCell",Z,J))},[k,$]=vt.useState(!1),j=()=>{$(!0)},V=async()=>{e&&i&&await i.deleteWorkbook(e).then(()=>{y(void 0),f(void 0)}).catch(Z=>{y(`Error deleting workbook: ${Z.message}`),f(void 0)}),$(!1),n(`/${s}/${c}`)},z=()=>{$(!1)},K=vt.useCallback(async()=>{if(!g){console.log("No workbook data ref");return}try{b(await g.saveWorkbook()),y(void 0),f("Workbook saved")}catch(Z){y(`Error saving workbook: ${Z.message}`),f(void 0)}},[g]);if(vt.useEffect(()=>{g&&(async()=>{const Z=new Map(C.map(({modelPath:re,sourceInfos:ne})=>[re,ne])),J=[],W=[];for(const re of g.getModels())Z.has(re)?J.push({modelPath:re,sourceInfos:Z.get(re)}):(console.log("Fetching model from Publisher",re),W.push(a.models.getModel(s,c,re,void 0).then(ne=>({modelPath:re,sourceInfos:ne.data.sourceInfos.map(X=>JSON.parse(X))}))));if(W.length>0){const re=await Promise.all(W);R([...J,...re])}else R(J)})()},[o,g,c,s,r]),vt.useEffect(()=>{e&&Jg.loadWorkbook(i,e).then(Z=>{b(Z)})},[e,i]),!g)return m.jsx("div",{children:"Loading..."});const Y=Z=>{const J=[];for(const W of Z)for(const re of W.sourceInfos)J.push({modelPath:W.modelPath,sourceInfo:re});return J},te=(Z,J)=>m.jsx(_r,{size:"small",startIcon:m.jsx(Sb,{}),onClick:()=>U(Z,J),variant:"contained",sx:{backgroundColor:W=>W.palette.background.paper,color:W=>W.palette.mode==="dark"?W.palette.grey[100]:W.palette.grey[700],boxShadow:"none","&:hover":{backgroundColor:W=>W.palette.mode==="dark"?W.palette.grey[500]:W.palette.grey[300],boxShadow:"none"}},children:Z?"Markdown":"Explore"}),_=m.jsxs(gt,{sx:{display:"flex",gap:1,justifyContent:"center",flex:2},children:[te(!1,g.getCells().length),te(!0,g.getCells().length)]});return m.jsxs(L1,{variant:"outlined",children:[m.jsxs(oj,{children:[m.jsx(gt,{sx:{mb:2},children:m.jsx(gt,{sx:{minHeight:"24px"},children:p?m.jsx(at,{color:"error",variant:"body2",children:p}):u?m.jsx(at,{color:"success",variant:"body2",children:u}):m.jsx("span",{children:" "})})}),m.jsxs(op,{sx:{flexDirection:"row",justifyContent:"space-between",alignItems:"center"},children:[m.jsxs(op,{direction:"row",spacing:1,alignItems:"center",children:[m.jsx(at,{variant:"overline",sx:{fontSize:"13px",fontWeight:"bold",verticalAlign:"middle"},children:"Workbook"}),m.jsx(at,{variant:"subtitle2",sx:{fontSize:"13px",fontWeight:"normal",verticalAlign:"middle",ml:1},children:`${e.workspace} > ${e.path}`})]}),m.jsxs(op,{sx:{display:"flex",flexDirection:"row",gap:1},children:[m.jsx(gt,{sx:{display:"flex",alignItems:"center",mt:1,mb:1},children:m.jsx(Dxe,{workbookData:g})}),m.jsxs(gt,{sx:{display:"flex",alignItems:"center",mt:1,mb:1},children:[m.jsx(_r,{color:"error",onClick:j,size:"small",children:"Delete"}),m.jsxs(wi,{open:k,onClose:z,children:[m.jsx(Ai,{children:"Delete Workbook"}),m.jsx(ki,{children:m.jsxs(Vx,{children:['Are you sure you want to delete the workbook "',e.path,'"? This action cannot be undone.']})}),m.jsxs(dh,{children:[m.jsx(_r,{onClick:z,color:"primary",size:"small",children:"Cancel"}),m.jsx(_r,{onClick:V,color:"error",autoFocus:!0,size:"small",children:"Delete"})]})]})]})]})]}),m.jsx(yl,{}),m.jsxs(op,{sx:{display:"flex",flexDirection:"row",width:"100%",mt:2},children:[m.jsx(gt,{sx:{flex:1},children:m.jsx(kxe,{initialSelectedModels:g.getModels(),onModelChange:Z=>{b(g.setModels(Z)),K()},resourceUri:t})}),m.jsx(gt,{sx:{flex:1}})]})]}),m.jsx(wA,{children:m.jsxs(op,{children:[g.getCells().length===0&&m.jsxs(m.Fragment,{children:[m.jsx(at,{sx:{textAlign:"center",p:2,variant:"subtitle2",fontWeight:"medium"},children:"Workbook is empty"}),m.jsx(at,{variant:"body2",sx:{textAlign:"center",mb:2,variant:"body2"},children:"Click the + buttons to add a markdown or code cell."})]}),g.getCells().map((Z,J)=>m.jsx(vt.Fragment,{children:m.jsx(Exe,{cell:Z,resourceUri:t,addButtonCallback:W=>te(W,J),sourceAndPaths:Y(C),editingMarkdown:S===J,editingMalloy:x===J,onDelete:()=>{b(g.deleteCell(J)),K()},onCellChange:W=>{b(g.setCell(J,W))},onEdit:()=>{Z.isMarkdown?w(J):E(J)},onClose:()=>{Z.isMarkdown?w(void 0):E(void 0),K()}},`${J}-${Z.isMarkdown}-${e.workspace}-${e.path}`)},`${J}-${g.getCells().length}`)),_,m.jsxs(Zd,{anchorEl:M,open:F,onClose:B,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},children:[m.jsx(cc,{onClick:()=>U(!0,I??0),children:"Add Markdown"}),m.jsx(cc,{onClick:()=>U(!1,I??0),children:"Add Malloy"})]}),m.jsx(op,{sx:{flexDirection:"row",justifyContent:"flex-end",p:1}})]})})]})}function Dxe({workbookData:e}){const[t,n]=vt.useState(!1);return m.jsx(_r,{color:"primary",onClick:async()=>{if(!e)return;const r=e.toMalloyWorkbook();try{await navigator.clipboard.writeText(r),n(!0),setTimeout(()=>n(!1),1500)}catch{n(!1),alert("Failed to copy to clipboard")}},size:"small",children:t?"Copied!":"Export"})}const k_="Local";class Oxe{async listWorkspaces(t){return Promise.resolve([{name:k_,description:"Stored locally- only accessible to this browser",writeable:!0}])}async listWorkbooks(t){const n=[];for(let r=0;r<localStorage.length;r++){const o=localStorage.key(r);n.push({path:o,workspace:k_})}return n}async getWorkbook(t){const n=localStorage.getItem(t.path);if(n===null)throw new Error(`Notebook not found at path: ${t}`);return n}async deleteWorkbook(t){if(localStorage.getItem(t.path)===null)throw new Error(`Notebook not found at path: ${t}`);localStorage.removeItem(t.path)}async saveWorkbook(t,n){localStorage.setItem(t.path,n)}async moveWorkbook(t,n){const r=localStorage.getItem(t.path);if(r===null)throw new Error(`Notebook not found at path: ${t.path}`);localStorage.setItem(n.path,r),localStorage.removeItem(t.path)}}const V7=Fn(m.jsx("path",{d:"M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20z"}));function Rxe({onSubmit:e,isSubmitting:t,disabled:n,disabledReason:r}){const[o,a]=T.useState(!1),[i,s]=T.useState(!1),c=()=>a(!1),u=async()=>{try{await e({forceRefresh:i}),a(!1)}catch{}},f=m.jsx("span",{children:m.jsx(_r,{variant:"contained",startIcon:m.jsx(Sb,{}),onClick:()=>a(!0),disabled:n,"aria-label":"New materialization",children:"New materialization"})});return m.jsxs(m.Fragment,{children:[n&&r?m.jsx(eo,{title:r,children:f}):f,m.jsxs(wi,{open:o,onClose:c,maxWidth:"xs",fullWidth:!0,"aria-labelledby":"create-materialization-title",children:[m.jsx(Ai,{id:"create-materialization-title",children:"New materialization"}),m.jsxs(ki,{children:[m.jsx(Vx,{sx:{mb:2},children:"Materialize every persist source in this package: compile, build the tables, and load them so queries serve from the materialized tables."}),m.jsx(lF,{children:m.jsx(Tp,{control:m.jsx(yA,{checked:i,onChange:p=>s(p.target.checked)}),label:"Force refresh (rebuild even if unchanged)"})})]}),m.jsxs(dh,{children:[m.jsx(_r,{onClick:c,children:"Cancel"}),m.jsx(_r,{variant:"contained",loading:t,onClick:u,children:"Materialize"})]})]})]})}function qk({children:e}){return m.jsx(at,{variant:"caption",component:"h6",sx:{display:"block",textTransform:"uppercase",letterSpacing:"0.06em",fontWeight:600,color:"text.secondary",mb:1},children:e})}function Uy(e){return e===va.Pending||e===va.ManifestRowsReady}function Mxe(e){return e===va.ManifestFileReady||e===va.Failed||e===va.Cancelled}function W7(e){switch(e){case va.ManifestFileReady:return"Done";case va.Failed:return"Failed";case va.Cancelled:return"Cancelled";case va.Pending:case va.ManifestRowsReady:return"Pending";default:return"Unknown"}}function q7(e){switch(e){case va.ManifestRowsReady:return"info";case va.ManifestFileReady:return"success";case va.Failed:return"error";case va.Cancelled:return"warning";case va.Pending:default:return"default"}}function G7(e){return e.metadata??{}}function Nxe(e){return e.trigger==="SCHEDULER"?"Scheduled":"Manual"}function Y7(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),s=a%60;if(i<60)return`${i}m ${s}s`;const c=Math.floor(i/60),u=i%60;return`${c}h ${u}m`}function Gk(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 Pxe(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 Ixe({entries:e,builtAt:t}){const n=Object.entries(e??{});return m.jsxs(gt,{children:[m.jsxs(Lr,{direction:"row",alignItems:"baseline",justifyContent:"space-between",children:[m.jsx(qk,{children:"Build manifest"}),t&&m.jsxs(at,{variant:"caption",color:"text.secondary",children:["Built ",Gk(t)]})]}),n.length===0?m.jsx(at,{variant:"body2",color:"text.secondary",sx:{fontStyle:"italic"},children:"No materialized tables yet."}):m.jsxs(lb,{size:"small",children:[m.jsx(ub,{children:m.jsxs(bl,{children:[m.jsx(Mn,{children:"Source"}),m.jsx(Mn,{children:"Table name"}),m.jsx(Mn,{children:"Connection"}),m.jsx(Mn,{children:"Realization"}),m.jsx(Mn,{align:"right",children:"Rows"})]})}),m.jsx(cb,{children:n.map(([r,o])=>m.jsxs(bl,{children:[m.jsx(Mn,{sx:{fontFamily:gi},children:o.sourceName??r}),m.jsx(Mn,{sx:{fontFamily:gi},children:o.physicalTableName??"-"}),m.jsx(Mn,{sx:{fontFamily:gi},children:o.connectionName??"-"}),m.jsx(Mn,{children:o.realization??"-"}),m.jsx(Mn,{align:"right",children:o.rowCount??"-"})]},r))})]})]})}const nx=Fn([m.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"),m.jsx("path",{d:"M12.5 7H11v6l5.25 3.15.75-1.23-4.5-2.67z"},"1")]),_xe=Fn(m.jsx("path",{d:"M9 11.24V7.5C9 6.12 10.12 5 11.5 5S14 6.12 14 7.5v3.74c1.21-.81 2-2.18 2-3.74C16 5.01 13.99 3 11.5 3S7 5.01 7 7.5c0 1.56.79 2.93 2 3.74m9.84 4.63-4.54-2.26c-.17-.07-.35-.11-.54-.11H13v-6c0-.83-.67-1.5-1.5-1.5S10 6.67 10 7.5v10.74c-3.6-.76-3.54-.75-3.67-.75-.31 0-.59.13-.79.33l-.79.8 4.94 4.94c.27.27.65.44 1.06.44h6.79c.75 0 1.33-.55 1.44-1.28l.75-5.27c.01-.07.02-.14.02-.2 0-.62-.38-1.16-.91-1.38"}));function K7({meta:e}){const t=e.trigger==="SCHEDULER";return m.jsx(eo,{title:t?"Fired by the materialization schedule":"Triggered manually",children:m.jsx(Ld,{size:"small",variant:"outlined",color:t?"info":"default",icon:t?m.jsx(nx,{fontSize:"small"}):m.jsx(_xe,{fontSize:"small"}),label:Nxe(e)})})}function Q7({materialization:e,buildPlan:t,showBuildPlan:n=!0,onClose:r}){const o=e?G7(e):{},a=Object.values(t?.sources??{});return m.jsx(wi,{open:e!==null,onClose:r,maxWidth:"md",fullWidth:!0,"aria-labelledby":"materialization-detail-title",children:e&&m.jsxs(m.Fragment,{children:[m.jsxs(Ai,{sx:{pr:6,pb:1.5},id:"materialization-detail-title",children:[m.jsxs(Lr,{direction:"row",alignItems:"center",spacing:1,sx:{mb:.75},children:[m.jsx(Ld,{size:"small",label:W7(e.status),color:q7(e.status),variant:Uy(e.status)?"filled":"outlined"}),m.jsx(K7,{meta:o})]}),m.jsx(at,{variant:"subtitle1",sx:{fontWeight:600},children:e.packageName??"Materialization"}),m.jsx(at,{variant:"caption",color:"text.secondary",sx:{fontFamily:gi,wordBreak:"break-all"},children:e.id}),m.jsx(dr,{"aria-label":"close",onClick:r,sx:{position:"absolute",right:8,top:8},children:m.jsx(Ns,{fontSize:"small"})})]}),m.jsxs(ki,{dividers:!0,children:[m.jsxs(gt,{sx:{bgcolor:"action.hover",borderRadius:2,p:2,mb:3,display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(140px, 1fr))",gap:2},children:[m.jsx(lg,{label:"Started",value:Gk(e.startedAt??e.createdAt)}),m.jsx(lg,{label:"Completed",value:Gk(e.completedAt)}),m.jsx(lg,{label:"Duration",value:Y7(e.startedAt,e.completedAt)}),m.jsx(lg,{label:"Sources",value:`${o.sourcesBuilt??0} built · ${o.sourcesReused??0} reused`}),m.jsx(lg,{label:"Force refresh",value:o.forceRefresh?"Yes":"No"})]}),e.error&&m.jsxs(gt,{sx:{borderRadius:2,p:2,mb:3,border:"1px solid",borderColor:"error.main"},children:[m.jsx(qk,{children:m.jsx(gt,{component:"span",sx:{color:"error.main"},children:"Error"})}),m.jsx(at,{variant:"body2",sx:{fontFamily:gi,whiteSpace:"pre-wrap"},children:e.error})]}),n&&m.jsxs(gt,{sx:{mb:3},children:[m.jsx(qk,{children:"Build plan"}),a.length===0?m.jsx(at,{variant:"body2",color:"text.secondary",sx:{fontStyle:"italic"},children:"This package has no persist sources."}):m.jsxs(lb,{size:"small",children:[m.jsx(ub,{children:m.jsxs(bl,{children:[m.jsx(Mn,{children:"Source"}),m.jsx(Mn,{children:"Connection"}),m.jsx(Mn,{children:"Dialect"}),m.jsx(Mn,{align:"right",children:"Columns"}),m.jsx(Mn,{children:"Source Entity ID"})]})}),m.jsx(cb,{children:a.map(i=>m.jsxs(bl,{children:[m.jsx(Mn,{sx:{fontFamily:gi},children:i.name}),m.jsx(Mn,{sx:{fontFamily:gi},children:i.connectionName}),m.jsx(Mn,{children:i.dialect??"-"}),m.jsx(Mn,{align:"right",children:i.columns?.length??0}),m.jsx(Mn,{sx:{fontFamily:gi,fontSize:"0.75rem",wordBreak:"break-all",maxWidth:220},children:i.sourceEntityId})]},i.sourceID))})]})]}),m.jsx(Ixe,{entries:e.manifest?.entries,builtAt:e.manifest?.builtAt})]})]})})}function lg({label:e,value:t}){return m.jsxs(gt,{children:[m.jsx(at,{variant:"caption",color:"text.secondary",display:"block",children:e}),m.jsx(at,{variant:"body2",children:t})]})}const Lxe=Fn(m.jsx("path",{d:"M6 6h12v12H6z"})),X7=Ke.oneOfType([Ke.func,Ke.object]);function A_(e){try{return e.matches(":focus-visible")}catch{}return!1}const D_={};function Z7(e,t){const n=T.useRef(D_);return n.current===D_&&(n.current=e(t)),n}class rx{static create(){return new rx}static use(){const t=Z7(rx.create).current,[n,r]=T.useState(!1);return t.shouldMount=n,t.setShouldMount=r,T.useEffect(t.mountEffect,[n]),t}constructor(){this.ref={current:null},this.mounted=null,this.didMount=!1,this.shouldMount=!1,this.setShouldMount=null}mount(){return this.mounted||(this.mounted=jxe(),this.shouldMount=!0,this.setShouldMount(this.shouldMount)),this.mounted}mountEffect=()=>{this.shouldMount&&!this.didMount&&this.ref.current!==null&&(this.didMount=!0,this.mounted.resolve())};start(...t){this.mount().then(()=>this.ref.current?.start(...t))}stop(...t){this.mount().then(()=>this.ref.current?.stop(...t))}pulsate(...t){this.mount().then(()=>this.ref.current?.pulsate(...t))}}function Fxe(){return rx.use()}function jxe(){let e,t;const n=new Promise((r,o)=>{e=r,t=o});return n.resolve=e,n.reject=t,n}function Yk(e,t){return Yk=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,r){return n.__proto__=r,n},Yk(e,t)}function ND(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,Yk(e,t)}function Bxe(e,t){return e.classList?!!t&&e.classList.contains(t):(" "+(e.className.baseVal||e.className)+" ").indexOf(" "+t+" ")!==-1}function $xe(e,t){e.classList?e.classList.add(t):Bxe(e,t)||(typeof e.className=="string"?e.className=e.className+" "+t:e.setAttribute("class",(e.className&&e.className.baseVal||"")+" "+t))}function O_(e,t){return e.replace(new RegExp("(^|\\s)"+t+"(?:\\s|$)","g"),"$1").replace(/\s+/g," ").replace(/^\s*|\s*$/g,"")}function zxe(e,t){e.classList?e.classList.remove(t):typeof e.className=="string"?e.className=O_(e.className,t):e.setAttribute("class",O_(e.className&&e.className.baseVal||"",t))}const R_={disabled:!1},ox=vt.createContext(null);var J7=function(e){return e.scrollTop},jg="unmounted",hd="exited",md="entering",mp="entered",Kk="exiting",ms=(function(e){ND(t,e);function t(r,o){var a;a=e.call(this,r,o)||this;var i=o,s=i&&!i.isMounting?r.enter:r.appear,c;return a.appearStatus=null,r.in?s?(c=hd,a.appearStatus=md):c=mp:r.unmountOnExit||r.mountOnEnter?c=jg:c=hd,a.state={status:c},a.nextCallback=null,a}t.getDerivedStateFromProps=function(r,o){var a=r.in;return a&&o.status===jg?{status:hd}:null};var n=t.prototype;return n.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},n.componentDidUpdate=function(r){var o=null;if(r!==this.props){var a=this.state.status;this.props.in?a!==md&&a!==mp&&(o=md):(a===md||a===mp)&&(o=Kk)}this.updateStatus(!1,o)},n.componentWillUnmount=function(){this.cancelNextCallback()},n.getTimeouts=function(){var r=this.props.timeout,o,a,i;return o=a=i=r,r!=null&&typeof r!="number"&&(o=r.exit,a=r.enter,i=r.appear!==void 0?r.appear:a),{exit:o,enter:a,appear:i}},n.updateStatus=function(r,o){if(r===void 0&&(r=!1),o!==null)if(this.cancelNextCallback(),o===md){if(this.props.unmountOnExit||this.props.mountOnEnter){var a=this.props.nodeRef?this.props.nodeRef.current:pu.findDOMNode(this);a&&J7(a)}this.performEnter(r)}else this.performExit();else this.props.unmountOnExit&&this.state.status===hd&&this.setState({status:jg})},n.performEnter=function(r){var o=this,a=this.props.enter,i=this.context?this.context.isMounting:r,s=this.props.nodeRef?[i]:[pu.findDOMNode(this),i],c=s[0],u=s[1],f=this.getTimeouts(),p=i?f.appear:f.enter;if(!r&&!a||R_.disabled){this.safeSetState({status:mp},function(){o.props.onEntered(c)});return}this.props.onEnter(c,u),this.safeSetState({status:md},function(){o.props.onEntering(c,u),o.onTransitionEnd(p,function(){o.safeSetState({status:mp},function(){o.props.onEntered(c,u)})})})},n.performExit=function(){var r=this,o=this.props.exit,a=this.getTimeouts(),i=this.props.nodeRef?void 0:pu.findDOMNode(this);if(!o||R_.disabled){this.safeSetState({status:hd},function(){r.props.onExited(i)});return}this.props.onExit(i),this.safeSetState({status:Kk},function(){r.props.onExiting(i),r.onTransitionEnd(a.exit,function(){r.safeSetState({status:hd},function(){r.props.onExited(i)})})})},n.cancelNextCallback=function(){this.nextCallback!==null&&(this.nextCallback.cancel(),this.nextCallback=null)},n.safeSetState=function(r,o){o=this.setNextCallback(o),this.setState(r,o)},n.setNextCallback=function(r){var o=this,a=!0;return this.nextCallback=function(i){a&&(a=!1,o.nextCallback=null,r(i))},this.nextCallback.cancel=function(){a=!1},this.nextCallback},n.onTransitionEnd=function(r,o){this.setNextCallback(o);var a=this.props.nodeRef?this.props.nodeRef.current:pu.findDOMNode(this),i=r==null&&!this.props.addEndListener;if(!a||i){setTimeout(this.nextCallback,0);return}if(this.props.addEndListener){var s=this.props.nodeRef?[this.nextCallback]:[a,this.nextCallback],c=s[0],u=s[1];this.props.addEndListener(c,u)}r!=null&&setTimeout(this.nextCallback,r)},n.render=function(){var r=this.state.status;if(r===jg)return null;var o=this.props,a=o.children;o.in,o.mountOnEnter,o.unmountOnExit,o.appear,o.enter,o.exit,o.timeout,o.addEndListener,o.onEnter,o.onEntering,o.onEntered,o.onExit,o.onExiting,o.onExited,o.nodeRef;var i=fn(o,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]);return vt.createElement(ox.Provider,{value:null},typeof a=="function"?a(r,i):vt.cloneElement(vt.Children.only(a),i))},t})(vt.Component);ms.contextType=ox;ms.propTypes={};function lp(){}ms.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:lp,onEntering:lp,onEntered:lp,onExit:lp,onExiting:lp,onExited:lp};ms.UNMOUNTED=jg;ms.EXITED=hd;ms.ENTERING=md;ms.ENTERED=mp;ms.EXITING=Kk;var Hxe=function(e,t){return e&&t&&t.split(" ").forEach(function(n){return $xe(e,n)})},cw=function(e,t){return e&&t&&t.split(" ").forEach(function(n){return zxe(e,n)})},PD=(function(e){ND(t,e);function t(){for(var r,o=arguments.length,a=new Array(o),i=0;i<o;i++)a[i]=arguments[i];return r=e.call.apply(e,[this].concat(a))||this,r.appliedClasses={appear:{},enter:{},exit:{}},r.onEnter=function(s,c){var u=r.resolveArguments(s,c),f=u[0],p=u[1];r.removeClasses(f,"exit"),r.addClass(f,p?"appear":"enter","base"),r.props.onEnter&&r.props.onEnter(s,c)},r.onEntering=function(s,c){var u=r.resolveArguments(s,c),f=u[0],p=u[1],y=p?"appear":"enter";r.addClass(f,y,"active"),r.props.onEntering&&r.props.onEntering(s,c)},r.onEntered=function(s,c){var u=r.resolveArguments(s,c),f=u[0],p=u[1],y=p?"appear":"enter";r.removeClasses(f,y),r.addClass(f,y,"done"),r.props.onEntered&&r.props.onEntered(s,c)},r.onExit=function(s){var c=r.resolveArguments(s),u=c[0];r.removeClasses(u,"appear"),r.removeClasses(u,"enter"),r.addClass(u,"exit","base"),r.props.onExit&&r.props.onExit(s)},r.onExiting=function(s){var c=r.resolveArguments(s),u=c[0];r.addClass(u,"exit","active"),r.props.onExiting&&r.props.onExiting(s)},r.onExited=function(s){var c=r.resolveArguments(s),u=c[0];r.removeClasses(u,"exit"),r.addClass(u,"exit","done"),r.props.onExited&&r.props.onExited(s)},r.resolveArguments=function(s,c){return r.props.nodeRef?[r.props.nodeRef.current,s]:[s,c]},r.getClassNames=function(s){var c=r.props.classNames,u=typeof c=="string",f=u&&c?c+"-":"",p=u?""+f+s:c[s],y=u?p+"-active":c[s+"Active"],g=u?p+"-done":c[s+"Done"];return{baseClassName:p,activeClassName:y,doneClassName:g}},r}var n=t.prototype;return n.addClass=function(r,o,a){var i=this.getClassNames(o)[a+"ClassName"],s=this.getClassNames("enter"),c=s.doneClassName;o==="appear"&&a==="done"&&c&&(i+=" "+c),a==="active"&&r&&J7(r),i&&(this.appliedClasses[o][a]=i,Hxe(r,i))},n.removeClasses=function(r,o){var a=this.appliedClasses[o],i=a.base,s=a.active,c=a.done;this.appliedClasses[o]={},i&&cw(r,i),s&&cw(r,s),c&&cw(r,c)},n.render=function(){var r=this.props;r.classNames;var o=fn(r,["classNames"]);return vt.createElement(ms,pe({},o,{onEnter:this.onEnter,onEntered:this.onEntered,onEntering:this.onEntering,onExit:this.onExit,onExiting:this.onExiting,onExited:this.onExited}))},t})(vt.Component);PD.defaultProps={classNames:""};PD.propTypes={};function Uxe(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function ID(e,t){var n=function(o){return t&&T.isValidElement(o)?t(o):o},r=Object.create(null);return e&&T.Children.map(e,function(o){return o}).forEach(function(o){r[o.key]=n(o)}),r}function Vxe(e,t){e=e||{},t=t||{};function n(f){return f in t?t[f]:e[f]}var r=Object.create(null),o=[];for(var a in e)a in t?o.length&&(r[a]=o,o=[]):o.push(a);var i,s={};for(var c in t){if(r[c])for(i=0;i<r[c].length;i++){var u=r[c][i];s[r[c][i]]=n(u)}s[c]=n(c)}for(i=0;i<o.length;i++)s[o[i]]=n(o[i]);return s}function kd(e,t,n){return n[t]!=null?n[t]:e.props[t]}function Wxe(e,t){return ID(e.children,function(n){return T.cloneElement(n,{onExited:t.bind(null,n),in:!0,appear:kd(n,"appear",e),enter:kd(n,"enter",e),exit:kd(n,"exit",e)})})}function qxe(e,t,n){var r=ID(e.children),o=Vxe(t,r);return Object.keys(o).forEach(function(a){var i=o[a];if(T.isValidElement(i)){var s=a in t,c=a in r,u=t[a],f=T.isValidElement(u)&&!u.props.in;c&&(!s||f)?o[a]=T.cloneElement(i,{onExited:n.bind(null,i),in:!0,exit:kd(i,"exit",e),enter:kd(i,"enter",e)}):!c&&s&&!f?o[a]=T.cloneElement(i,{in:!1}):c&&s&&T.isValidElement(u)&&(o[a]=T.cloneElement(i,{onExited:n.bind(null,i),in:u.props.in,exit:kd(i,"exit",e),enter:kd(i,"enter",e)}))}}),o}var Gxe=Object.values||function(e){return Object.keys(e).map(function(t){return e[t]})},Yxe={component:"div",childFactory:function(e){return e}},Ob=(function(e){ND(t,e);function t(r,o){var a;a=e.call(this,r,o)||this;var i=a.handleExited.bind(Uxe(a));return a.state={contextValue:{isMounting:!0},handleExited:i,firstRender:!0},a}var n=t.prototype;return n.componentDidMount=function(){this.mounted=!0,this.setState({contextValue:{isMounting:!1}})},n.componentWillUnmount=function(){this.mounted=!1},t.getDerivedStateFromProps=function(r,o){var a=o.children,i=o.handleExited,s=o.firstRender;return{children:s?Wxe(r,i):qxe(r,a,i),firstRender:!1}},n.handleExited=function(r,o){var a=ID(this.props.children);r.key in a||(r.props.onExited&&r.props.onExited(o),this.mounted&&this.setState(function(i){var s=pe({},i.children);return delete s[r.key],{children:s}}))},n.render=function(){var r=this.props,o=r.component,a=r.childFactory,i=fn(r,["component","childFactory"]),s=this.state.contextValue,c=Gxe(this.state.children).map(a);return delete i.appear,delete i.enter,delete i.exit,o===null?vt.createElement(ox.Provider,{value:s},c):vt.createElement(ox.Provider,{value:s},vt.createElement(o,i,c))},t})(vt.Component);Ob.propTypes={};Ob.defaultProps=Yxe;const Kxe=[];function Qxe(e){T.useEffect(e,Kxe)}class _D{static create(){return new _D}currentId=null;start(t,n){this.clear(),this.currentId=setTimeout(()=>{this.currentId=null,n()},t)}clear=()=>{this.currentId!==null&&(clearTimeout(this.currentId),this.currentId=null)};disposeEffect=()=>this.clear}function PS(){const e=Z7(_D.create).current;return Qxe(e.disposeEffect),e}function Xxe(e){const{className:t,classes:n,pulsate:r=!1,rippleX:o,rippleY:a,rippleSize:i,in:s,onExited:c,timeout:u}=e,[f,p]=T.useState(!1),y=Ot(t,n.ripple,n.rippleVisible,r&&n.ripplePulsate),g={width:i,height:i,top:-(i/2)+a,left:-(i/2)+o},b=Ot(n.child,f&&n.childLeaving,r&&n.childPulsate);return!s&&!f&&p(!0),T.useEffect(()=>{if(!s&&c!=null){const x=setTimeout(c,u);return()=>{clearTimeout(x)}}},[c,s,u]),m.jsx("span",{className:y,style:g,children:m.jsx("span",{className:b})})}const Yi=Lt("MuiTouchRipple",["root","ripple","rippleVisible","ripplePulsate","child","childLeaving","childPulsate"]),Qk=550,Zxe=80,Jxe=El`
328
328
  0% {
329
329
  transform: scale(0);
330
330
  opacity: 0.1;
@@ -425,9 +425,9 @@ import {${t.sourceName}}" from '${t.modelPath}'"
425
425
  `:null,pSe=typeof Zk!="string"?nb`
426
426
  animation: ${Zk} 1.4s ease-in-out infinite;
427
427
  `:null,hSe=e=>{const{classes:t,variant:n,color:r,disableShrink:o}=e,a={root:["root",n,`color${bt(r)}`],svg:["svg"],circle:["circle",`circle${bt(n)}`,o&&"circleDisableShrink"]};return zt(a,dSe,t)},mSe=Pe("span",{name:"MuiCircularProgress",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,t[n.variant],t[`color${bt(n.color)}`]]}})(Pn(({theme:e})=>({display:"inline-block",variants:[{props:{variant:"determinate"},style:{transition:e.transitions.create("transform")}},{props:{variant:"indeterminate"},style:fSe||{animation:`${Xk} 1.4s linear infinite`}},...Object.entries(e.palette).filter(Sa()).map(([t])=>({props:{color:t},style:{color:(e.vars||e).palette[t].main}}))]}))),gSe=Pe("svg",{name:"MuiCircularProgress",slot:"Svg"})({display:"block"}),ySe=Pe("circle",{name:"MuiCircularProgress",slot:"Circle",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.circle,t[`circle${bt(n.variant)}`],n.disableShrink&&t.circleDisableShrink]}})(Pn(({theme:e})=>({stroke:"currentColor",variants:[{props:{variant:"determinate"},style:{transition:e.transitions.create("stroke-dashoffset")}},{props:{variant:"indeterminate"},style:{strokeDasharray:"80px, 200px",strokeDashoffset:0}},{props:({ownerState:t})=>t.variant==="indeterminate"&&!t.disableShrink,style:pSe||{animation:`${Zk} 1.4s ease-in-out infinite`}}]}))),LD=T.forwardRef(function(e,t){const n=An({props:e,name:"MuiCircularProgress"}),{className:r,color:o="primary",disableShrink:a=!1,size:i=40,style:s,thickness:c=3.6,value:u=0,variant:f="indeterminate",...p}=n,y={...n,color:o,disableShrink:a,size:i,thickness:c,value:u,variant:f},g=hSe(y),b={},x={},E={};if(f==="determinate"){const S=2*Math.PI*((au-c)/2);b.strokeDasharray=S.toFixed(3),E["aria-valuenow"]=Math.round(u),b.strokeDashoffset=`${((100-u)/100*S).toFixed(3)}px`,x.transform="rotate(-90deg)"}return m.jsx(mSe,{className:Ot(g.root,r),style:{width:i,height:i,...x,...s},ownerState:y,ref:t,role:"progressbar",...E,...p,children:m.jsx(gSe,{className:g.svg,ownerState:y,viewBox:`${au/2} ${au/2} ${au} ${au}`,children:m.jsx(ySe,{className:g.circle,style:b,ownerState:y,cx:au,cy:au,r:(au-c)/2,fill:"none",strokeWidth:c})})})});function bSe(e){return Ut("MuiButton",e)}const ld=Lt("MuiButton",["root","text","textInherit","textPrimary","textSecondary","textSuccess","textError","textInfo","textWarning","outlined","outlinedInherit","outlinedPrimary","outlinedSecondary","outlinedSuccess","outlinedError","outlinedInfo","outlinedWarning","contained","containedInherit","containedPrimary","containedSecondary","containedSuccess","containedError","containedInfo","containedWarning","disableElevation","focusVisible","disabled","colorInherit","colorPrimary","colorSecondary","colorSuccess","colorError","colorInfo","colorWarning","textSizeSmall","textSizeMedium","textSizeLarge","outlinedSizeSmall","outlinedSizeMedium","outlinedSizeLarge","containedSizeSmall","containedSizeMedium","containedSizeLarge","sizeMedium","sizeSmall","sizeLarge","fullWidth","startIcon","endIcon","icon","iconSizeSmall","iconSizeMedium","iconSizeLarge","loading","loadingWrapper","loadingIconPlaceholder","loadingIndicator","loadingPositionCenter","loadingPositionStart","loadingPositionEnd"]),vSe=T.createContext({}),xSe=T.createContext(void 0),SSe=e=>{const{color:t,disableElevation:n,fullWidth:r,size:o,variant:a,loading:i,loadingPosition:s,classes:c}=e,u={root:["root",i&&"loading",a,`${a}${bt(t)}`,`size${bt(o)}`,`${a}Size${bt(o)}`,`color${bt(t)}`,n&&"disableElevation",r&&"fullWidth",i&&`loadingPosition${bt(s)}`],startIcon:["icon","startIcon",`iconSize${bt(o)}`],endIcon:["icon","endIcon",`iconSize${bt(o)}`],loadingIndicator:["loadingIndicator"],loadingWrapper:["loadingWrapper"]},f=zt(u,bSe,c);return{...c,...f}},e$=[{props:{size:"small"},style:{"& > *:nth-of-type(1)":{fontSize:18}}},{props:{size:"medium"},style:{"& > *:nth-of-type(1)":{fontSize:20}}},{props:{size:"large"},style:{"& > *:nth-of-type(1)":{fontSize:22}}}],ESe=Pe(Wd,{shouldForwardProp:e=>wa(e)||e==="classes",name:"MuiButton",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,t[n.variant],t[`${n.variant}${bt(n.color)}`],t[`size${bt(n.size)}`],t[`${n.variant}Size${bt(n.size)}`],n.color==="inherit"&&t.colorInherit,n.disableElevation&&t.disableElevation,n.fullWidth&&t.fullWidth,n.loading&&t.loading]}})(Pn(({theme:e})=>{const t=e.palette.mode==="light"?e.palette.grey[300]:e.palette.grey[800],n=e.palette.mode==="light"?e.palette.grey.A100:e.palette.grey[700];return{...e.typography.button,minWidth:64,padding:"6px 16px",border:0,borderRadius:(e.vars||e).shape.borderRadius,transition:e.transitions.create(["background-color","box-shadow","border-color","color"],{duration:e.transitions.duration.short}),"&:hover":{textDecoration:"none"},[`&.${ld.disabled}`]:{color:(e.vars||e).palette.action.disabled},variants:[{props:{variant:"contained"},style:{color:"var(--variant-containedColor)",backgroundColor:"var(--variant-containedBg)",boxShadow:(e.vars||e).shadows[2],"&:hover":{boxShadow:(e.vars||e).shadows[4],"@media (hover: none)":{boxShadow:(e.vars||e).shadows[2]}},"&:active":{boxShadow:(e.vars||e).shadows[8]},[`&.${ld.focusVisible}`]:{boxShadow:(e.vars||e).shadows[6]},[`&.${ld.disabled}`]:{color:(e.vars||e).palette.action.disabled,boxShadow:(e.vars||e).shadows[0],backgroundColor:(e.vars||e).palette.action.disabledBackground}}},{props:{variant:"outlined"},style:{padding:"5px 15px",border:"1px solid currentColor",borderColor:"var(--variant-outlinedBorder, currentColor)",backgroundColor:"var(--variant-outlinedBg)",color:"var(--variant-outlinedColor)",[`&.${ld.disabled}`]:{border:`1px solid ${(e.vars||e).palette.action.disabledBackground}`}}},{props:{variant:"text"},style:{padding:"6px 8px",color:"var(--variant-textColor)",backgroundColor:"var(--variant-textBg)"}},...Object.entries(e.palette).filter(Sa()).map(([r])=>({props:{color:r},style:{"--variant-textColor":(e.vars||e).palette[r].main,"--variant-outlinedColor":(e.vars||e).palette[r].main,"--variant-outlinedBorder":e.alpha((e.vars||e).palette[r].main,.5),"--variant-containedColor":(e.vars||e).palette[r].contrastText,"--variant-containedBg":(e.vars||e).palette[r].main,"@media (hover: hover)":{"&:hover":{"--variant-containedBg":(e.vars||e).palette[r].dark,"--variant-textBg":e.alpha((e.vars||e).palette[r].main,(e.vars||e).palette.action.hoverOpacity),"--variant-outlinedBorder":(e.vars||e).palette[r].main,"--variant-outlinedBg":e.alpha((e.vars||e).palette[r].main,(e.vars||e).palette.action.hoverOpacity)}}}})),{props:{color:"inherit"},style:{color:"inherit",borderColor:"currentColor","--variant-containedBg":e.vars?e.vars.palette.Button.inheritContainedBg:t,"@media (hover: hover)":{"&:hover":{"--variant-containedBg":e.vars?e.vars.palette.Button.inheritContainedHoverBg:n,"--variant-textBg":e.alpha((e.vars||e).palette.text.primary,(e.vars||e).palette.action.hoverOpacity),"--variant-outlinedBg":e.alpha((e.vars||e).palette.text.primary,(e.vars||e).palette.action.hoverOpacity)}}}},{props:{size:"small",variant:"text"},style:{padding:"4px 5px",fontSize:e.typography.pxToRem(13)}},{props:{size:"large",variant:"text"},style:{padding:"8px 11px",fontSize:e.typography.pxToRem(15)}},{props:{size:"small",variant:"outlined"},style:{padding:"3px 9px",fontSize:e.typography.pxToRem(13)}},{props:{size:"large",variant:"outlined"},style:{padding:"7px 21px",fontSize:e.typography.pxToRem(15)}},{props:{size:"small",variant:"contained"},style:{padding:"4px 10px",fontSize:e.typography.pxToRem(13)}},{props:{size:"large",variant:"contained"},style:{padding:"8px 22px",fontSize:e.typography.pxToRem(15)}},{props:{disableElevation:!0},style:{boxShadow:"none","&:hover":{boxShadow:"none"},[`&.${ld.focusVisible}`]:{boxShadow:"none"},"&:active":{boxShadow:"none"},[`&.${ld.disabled}`]:{boxShadow:"none"}}},{props:{fullWidth:!0},style:{width:"100%"}},{props:{loadingPosition:"center"},style:{transition:e.transitions.create(["background-color","box-shadow","border-color"],{duration:e.transitions.duration.short}),[`&.${ld.loading}`]:{color:"transparent"}}}]}})),CSe=Pe("span",{name:"MuiButton",slot:"StartIcon",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.startIcon,n.loading&&t.startIconLoadingStart,t[`iconSize${bt(n.size)}`]]}})(({theme:e})=>({display:"inherit",marginRight:8,marginLeft:-4,variants:[{props:{size:"small"},style:{marginLeft:-2}},{props:{loadingPosition:"start",loading:!0},style:{transition:e.transitions.create(["opacity"],{duration:e.transitions.duration.short}),opacity:0}},{props:{loadingPosition:"start",loading:!0,fullWidth:!0},style:{marginRight:-8}},...e$]})),TSe=Pe("span",{name:"MuiButton",slot:"EndIcon",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.endIcon,n.loading&&t.endIconLoadingEnd,t[`iconSize${bt(n.size)}`]]}})(({theme:e})=>({display:"inherit",marginRight:-4,marginLeft:8,variants:[{props:{size:"small"},style:{marginRight:-2}},{props:{loadingPosition:"end",loading:!0},style:{transition:e.transitions.create(["opacity"],{duration:e.transitions.duration.short}),opacity:0}},{props:{loadingPosition:"end",loading:!0,fullWidth:!0},style:{marginLeft:-8}},...e$]})),wSe=Pe("span",{name:"MuiButton",slot:"LoadingIndicator"})(({theme:e})=>({display:"none",position:"absolute",visibility:"visible",variants:[{props:{loading:!0},style:{display:"flex"}},{props:{loadingPosition:"start"},style:{left:14}},{props:{loadingPosition:"start",size:"small"},style:{left:10}},{props:{variant:"text",loadingPosition:"start"},style:{left:6}},{props:{loadingPosition:"center"},style:{left:"50%",transform:"translate(-50%)",color:(e.vars||e).palette.action.disabled}},{props:{loadingPosition:"end"},style:{right:14}},{props:{loadingPosition:"end",size:"small"},style:{right:10}},{props:{variant:"text",loadingPosition:"end"},style:{right:6}},{props:{loadingPosition:"start",fullWidth:!0},style:{position:"relative",left:-10}},{props:{loadingPosition:"end",fullWidth:!0},style:{position:"relative",right:-10}}]})),M_=Pe("span",{name:"MuiButton",slot:"LoadingIconPlaceholder"})({display:"inline-block",width:"1em",height:"1em"}),Zr=T.forwardRef(function(e,t){const n=T.useContext(vSe),r=T.useContext(xSe),o=jy(n,e),a=An({props:o,name:"MuiButton"}),{children:i,color:s="primary",component:c="button",className:u,disabled:f=!1,disableElevation:p=!1,disableFocusRipple:y=!1,endIcon:g,focusVisibleClassName:b,fullWidth:x=!1,id:E,loading:S=null,loadingIndicator:w,loadingPosition:C="center",size:R="medium",startIcon:M,type:D,variant:I="text",...L}=a,F=Bs(E),B=w??m.jsx(LD,{"aria-labelledby":F,color:"inherit",size:16}),U={...a,color:s,component:c,disabled:f,disableElevation:p,disableFocusRipple:y,fullWidth:x,loading:S,loadingIndicator:B,loadingPosition:C,size:R,type:D,variant:I},k=SSe(U),$=(M||S&&C==="start")&&m.jsx(CSe,{className:k.startIcon,ownerState:U,children:M||m.jsx(M_,{className:k.loadingIconPlaceholder,ownerState:U})}),j=(g||S&&C==="end")&&m.jsx(TSe,{className:k.endIcon,ownerState:U,children:g||m.jsx(M_,{className:k.loadingIconPlaceholder,ownerState:U})}),V=r||"",z=typeof S=="boolean"?m.jsx("span",{className:k.loadingWrapper,style:{display:"contents"},children:S&&m.jsx(wSe,{className:k.loadingIndicator,ownerState:U,children:B})}):null;return m.jsxs(ESe,{ownerState:U,className:Ot(n.className,k.root,u,V),component:c,disabled:f||S,focusRipple:!y,focusVisibleClassName:Ot(k.focusVisible,b),ref:t,type:D,id:S?F:E,...L,classes:k,children:[$,C!=="end"&&z,i,C==="end"&&z,j]})}),IS=T.createContext(void 0);function Oi(){return T.useContext(IS)}function kSe(e){return Ut("PrivateSwitchBase",e)}Lt("PrivateSwitchBase",["root","checked","disabled","input","edgeStart","edgeEnd"]);function Qp(e){return typeof e=="string"}function t$(e,t,n){return e===void 0||Qp(e)?t:{...t,ownerState:{...t.ownerState,...n}}}function Xp(e,t,n){return typeof e=="function"?e(t,n):e}function ci(e,t=[]){if(e===void 0)return{};const n={};return Object.keys(e).filter(r=>r.match(/^on[A-Z]/)&&typeof e[r]=="function"&&!t.includes(r)).forEach(r=>{n[r]=e[r]}),n}function N_(e){if(e===void 0)return{};const t={};return Object.keys(e).filter(n=>!(n.match(/^on[A-Z]/)&&typeof e[n]=="function")).forEach(n=>{t[n]=e[n]}),t}function n$(e){const{getSlotProps:t,additionalProps:n,externalSlotProps:r,externalForwardedProps:o,className:a}=e;if(!t){const g=Ot(n?.className,a,o?.className,r?.className),b={...n?.style,...o?.style,...r?.style},x={...n,...o,...r};return g.length>0&&(x.className=g),Object.keys(b).length>0&&(x.style=b),{props:x,internalRef:void 0}}const i=ci({...o,...r}),s=N_(r),c=N_(o),u=t(i),f=Ot(u?.className,n?.className,a,o?.className,r?.className),p={...u?.style,...n?.style,...o?.style,...r?.style},y={...u,...n,...c,...s};return f.length>0&&(y.className=f),Object.keys(p).length>0&&(y.style=p),{props:y,internalRef:u.ref}}function tr(e,t){const{className:n,elementType:r,ownerState:o,externalForwardedProps:a,internalForwardedProps:i,shouldForwardComponentProp:s=!1,...c}=t,{component:u,slots:f={[e]:void 0},slotProps:p={[e]:void 0},...y}=a,g=f[e]||r,b=Xp(p[e],o),{props:{component:x,...E},internalRef:S}=n$({className:n,...c,externalForwardedProps:e==="root"?y:void 0,externalSlotProps:b}),w=cr(S,b?.ref,t.ref),C=e==="root"?x||u:x,R=t$(g,{...e==="root"&&!u&&!f[e]&&i,...e!=="root"&&!f[e]&&i,...E,...C&&!s&&{as:C},...C&&s&&{component:C},ref:w},o);return[g,R]}const ASe=e=>{const{classes:t,checked:n,disabled:r,edge:o}=e,a={root:["root",n&&"checked",r&&"disabled",o&&`edge${bt(o)}`],input:["input"]};return zt(a,kSe,t)},DSe=Pe(Wd,{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}}]}),OSe=Pe("input",{name:"MuiSwitchBase",shouldForwardProp:wa})({cursor:"inherit",position:"absolute",opacity:0,width:"100%",height:"100%",top:0,left:0,margin:0,padding:0,zIndex:1}),RSe=T.forwardRef(function(e,t){const{autoFocus:n,checked:r,checkedIcon:o,defaultChecked:a,disabled:i,disableFocusRipple:s=!1,edge:c=!1,icon:u,id:f,inputProps:p,inputRef:y,name:g,onBlur:b,onChange:x,onFocus:E,readOnly:S,required:w=!1,tabIndex:C,type:R,value:M,slots:D={},slotProps:I={},...L}=e,[F,B]=xi({controlled:r,default:!!a,name:"SwitchBase",state:"checked"}),U=Oi(),k=re=>{E&&E(re),U&&U.onFocus&&U.onFocus(re)},$=re=>{b&&b(re),U&&U.onBlur&&U.onBlur(re)},j=re=>{if(re.nativeEvent.defaultPrevented)return;const ne=re.target.checked;B(ne),x&&x(re,ne)};let V=i;U&&typeof V>"u"&&(V=U.disabled);const z=R==="checkbox"||R==="radio",K={...e,checked:F,disabled:V,disableFocusRipple:s,edge:c},Y=ASe(K),te={slots:D,slotProps:{input:p,...I}},[_,Z]=tr("root",{ref:t,elementType:DSe,className:Y.root,shouldForwardComponentProp:!0,externalForwardedProps:{...te,component:"span",...L},getSlotProps:re=>({...re,onFocus:ne=>{re.onFocus?.(ne),k(ne)},onBlur:ne=>{re.onBlur?.(ne),$(ne)}}),ownerState:K,additionalProps:{centerRipple:!0,focusRipple:!s,disabled:V,role:void 0,tabIndex:null}}),[J,W]=tr("input",{ref:y,elementType:OSe,className:Y.input,externalForwardedProps:te,getSlotProps:re=>({...re,onChange:ne=>{re.onChange?.(ne),j(ne)}}),ownerState:K,additionalProps:{autoFocus:n,checked:r,defaultChecked:a,disabled:V,id:z?f:void 0,name:g,readOnly:S,required:w,tabIndex:C,type:R,...R==="checkbox"&&M===void 0?{}:{value:M}}});return m.jsxs(_,{...Z,children:[m.jsx(J,{...W}),F?o:u]})}),MSe=Fn(m.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"})),NSe=Fn(m.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"})),PSe=Fn(m.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 ISe(e){return Ut("MuiCheckbox",e)}const uw=Lt("MuiCheckbox",["root","checked","disabled","indeterminate","colorPrimary","colorSecondary","sizeSmall","sizeMedium"]),_Se=e=>{const{classes:t,indeterminate:n,color:r,size:o}=e,a={root:["root",n&&"indeterminate",`color${bt(r)}`,`size${bt(o)}`]},i=zt(a,ISe,t);return{...t,...i}},LSe=Pe(RSe,{shouldForwardProp:e=>wa(e)||e==="classes",name:"MuiCheckbox",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.indeterminate&&t.indeterminate,t[`size${bt(n.size)}`],n.color!=="default"&&t[`color${bt(n.color)}`]]}})(Pn(({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(Sa()).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(Sa()).map(([t])=>({props:{color:t},style:{[`&.${uw.checked}, &.${uw.indeterminate}`]:{color:(e.vars||e).palette[t].main},[`&.${uw.disabled}`]:{color:(e.vars||e).palette.action.disabled}}})),{props:{disableRipple:!1},style:{"&:hover":{"@media (hover: none)":{backgroundColor:"transparent"}}}}]}))),FSe=m.jsx(NSe,{}),jSe=m.jsx(MSe,{}),BSe=m.jsx(PSe,{}),FD=T.forwardRef(function(e,t){const n=An({props:e,name:"MuiCheckbox"}),{checkedIcon:r=FSe,color:o="primary",icon:a=jSe,indeterminate:i=!1,indeterminateIcon:s=BSe,inputProps:c,size:u="medium",disableRipple:f=!1,className:p,slots:y={},slotProps:g={},...b}=n,x=i?s:a,E=i?s:r,S={...n,disableRipple:f,color:o,indeterminate:i,size:u},w=_Se(S),C=g.input??c,[R,M]=tr("root",{ref:t,elementType:LSe,className:Ot(w.root,p),shouldForwardComponentProp:!0,externalForwardedProps:{slots:y,slotProps:g,...b},ownerState:S,additionalProps:{type:"checkbox",icon:T.cloneElement(x,{fontSize:x.props.fontSize??u}),checkedIcon:T.cloneElement(E,{fontSize:E.props.fontSize??u}),disableRipple:f,slots:y,slotProps:{input:gB(typeof C=="function"?C(S):C,{"data-indeterminate":i})}}});return m.jsx(R,{...M,classes:w})});function r$(e=window){const t=e.document.documentElement.clientWidth;return e.innerWidth-t}function $Se(e){const t=Po(e);return t.body===e?fc(e).innerWidth>t.documentElement.clientWidth:e.scrollHeight>e.clientHeight}function uy(e,t){t?e.setAttribute("aria-hidden","true"):e.removeAttribute("aria-hidden")}function P_(e){return parseInt(fc(e).getComputedStyle(e).paddingRight,10)||0}function zSe(e){const t=["TEMPLATE","SCRIPT","STYLE","LINK","MAP","META","NOSCRIPT","PICTURE","COL","COLGROUP","PARAM","SLOT","SOURCE","TRACK"].includes(e.tagName),n=e.tagName==="INPUT"&&e.getAttribute("type")==="hidden";return t||n}function I_(e,t,n,r,o){const a=[t,n,...r];[].forEach.call(e.children,i=>{const s=!a.includes(i),c=!zSe(i);s&&c&&uy(i,o)})}function dw(e,t){let n=-1;return e.some((r,o)=>t(r)?(n=o,!0):!1),n}function HSe(e,t){const n=[],r=e.container;if(!t.disableScrollLock){if($Se(r)){const a=r$(fc(r));n.push({value:r.style.paddingRight,property:"padding-right",el:r}),r.style.paddingRight=`${P_(r)+a}px`;const i=Po(r).querySelectorAll(".mui-fixed");[].forEach.call(i,s=>{n.push({value:s.style.paddingRight,property:"padding-right",el:s}),s.style.paddingRight=`${P_(s)+a}px`})}let o;if(r.parentNode instanceof DocumentFragment)o=Po(r).body;else{const a=r.parentElement,i=fc(r);o=a?.nodeName==="HTML"&&i.getComputedStyle(a).overflowY==="scroll"?a:r}n.push({value:o.style.overflow,property:"overflow",el:o},{value:o.style.overflowX,property:"overflow-x",el:o},{value:o.style.overflowY,property:"overflow-y",el:o}),o.style.overflow="hidden"}return()=>{n.forEach(({value:o,el:a,property:i})=>{o?a.style.setProperty(i,o):a.style.removeProperty(i)})}}function USe(e){const t=[];return[].forEach.call(e.children,n=>{n.getAttribute("aria-hidden")==="true"&&t.push(n)}),t}class VSe{constructor(){this.modals=[],this.containers=[]}add(t,n){let r=this.modals.indexOf(t);if(r!==-1)return r;r=this.modals.length,this.modals.push(t),t.modalRef&&uy(t.modalRef,!1);const o=USe(n);I_(n,t.mount,t.modalRef,o,!0);const a=dw(this.containers,i=>i.container===n);return a!==-1?(this.containers[a].modals.push(t),r):(this.containers.push({modals:[t],container:n,restore:null,hiddenSiblings:o}),r)}mount(t,n){const r=dw(this.containers,a=>a.modals.includes(t)),o=this.containers[r];o.restore||(o.restore=HSe(o,n))}remove(t,n=!0){const r=this.modals.indexOf(t);if(r===-1)return r;const o=dw(this.containers,i=>i.modals.includes(t)),a=this.containers[o];if(a.modals.splice(a.modals.indexOf(t),1),this.modals.splice(r,1),a.modals.length===0)a.restore&&a.restore(),t.modalRef&&uy(t.modalRef,n),I_(a.container,t.mount,t.modalRef,a.hiddenSiblings,!1),this.containers.splice(o,1);else{const i=a.modals[a.modals.length-1];i.modalRef&&uy(i.modalRef,!1)}return r}isTopModal(t){return this.modals.length>0&&this.modals[this.modals.length-1]===t}}function wh(e){return parseInt(T.version,10)>=19?e?.props?.ref||null:e?.ref||null}const WSe=["input","select","textarea","a[href]","button","[tabindex]","audio[controls]","video[controls]",'[contenteditable]:not([contenteditable="false"])'].join(",");function qSe(e){const t=parseInt(e.getAttribute("tabindex")||"",10);return Number.isNaN(t)?e.contentEditable==="true"||(e.nodeName==="AUDIO"||e.nodeName==="VIDEO"||e.nodeName==="DETAILS")&&e.getAttribute("tabindex")===null?0:e.tabIndex:t}function GSe(e){if(e.tagName!=="INPUT"||e.type!=="radio"||!e.name)return!1;const t=r=>e.ownerDocument.querySelector(`input[type="radio"]${r}`);let n=t(`[name="${e.name}"]:checked`);return n||(n=t(`[name="${e.name}"]`)),n!==e}function YSe(e){return!(e.disabled||e.tagName==="INPUT"&&e.type==="hidden"||GSe(e))}function KSe(e){const t=[],n=[];return Array.from(e.querySelectorAll(WSe)).forEach((r,o)=>{const a=qSe(r);a===-1||!YSe(r)||(a===0?t.push(r):n.push({documentOrder:o,tabIndex:a,node:r}))}),n.sort((r,o)=>r.tabIndex===o.tabIndex?r.documentOrder-o.documentOrder:r.tabIndex-o.tabIndex).map(r=>r.node).concat(t)}function QSe(){return!0}function o$(e){const{children:t,disableAutoFocus:n=!1,disableEnforceFocus:r=!1,disableRestoreFocus:o=!1,getTabbable:a=KSe,isEnabled:i=QSe,open:s}=e,c=T.useRef(!1),u=T.useRef(null),f=T.useRef(null),p=T.useRef(null),y=T.useRef(null),g=T.useRef(!1),b=T.useRef(null),x=cr(wh(t),b),E=T.useRef(null);T.useEffect(()=>{!s||!b.current||(g.current=!n)},[n,s]),T.useEffect(()=>{if(!s||!b.current)return;const C=Po(b.current);return b.current.contains(C.activeElement)||(b.current.hasAttribute("tabIndex")||b.current.setAttribute("tabIndex","-1"),g.current&&b.current.focus()),()=>{o||(p.current&&p.current.focus&&(c.current=!0,p.current.focus()),p.current=null)}},[s]),T.useEffect(()=>{if(!s||!b.current)return;const C=Po(b.current),R=I=>{E.current=I,!(r||!i()||I.key!=="Tab")&&C.activeElement===b.current&&I.shiftKey&&(c.current=!0,f.current&&f.current.focus())},M=()=>{const I=b.current;if(I===null)return;if(!C.hasFocus()||!i()||c.current){c.current=!1;return}if(I.contains(C.activeElement)||r&&C.activeElement!==u.current&&C.activeElement!==f.current)return;if(C.activeElement!==y.current)y.current=null;else if(y.current!==null)return;if(!g.current)return;let L=[];if((C.activeElement===u.current||C.activeElement===f.current)&&(L=a(b.current)),L.length>0){const F=!!(E.current?.shiftKey&&E.current?.key==="Tab"),B=L[0],U=L[L.length-1];typeof B!="string"&&typeof U!="string"&&(F?U.focus():B.focus())}else I.focus()};C.addEventListener("focusin",M),C.addEventListener("keydown",R,!0);const D=setInterval(()=>{C.activeElement&&C.activeElement.tagName==="BODY"&&M()},50);return()=>{clearInterval(D),C.removeEventListener("focusin",M),C.removeEventListener("keydown",R,!0)}},[n,r,o,i,s,a]);const S=C=>{p.current===null&&(p.current=C.relatedTarget),g.current=!0,y.current=C.target;const R=t.props.onFocus;R&&R(C)},w=C=>{p.current===null&&(p.current=C.relatedTarget),g.current=!0};return m.jsxs(T.Fragment,{children:[m.jsx("div",{tabIndex:s?0:-1,onFocus:w,ref:u,"data-testid":"sentinelStart"}),T.cloneElement(t,{ref:x,onFocus:S}),m.jsx("div",{tabIndex:s?0:-1,onFocus:w,ref:f,"data-testid":"sentinelEnd"})]})}function XSe(e){return typeof e=="function"?e():e}const a$=T.forwardRef(function(e,t){const{children:n,container:r,disablePortal:o=!1}=e,[a,i]=T.useState(null),s=cr(T.isValidElement(n)?wh(n):null,t);if(Io(()=>{o||i(XSe(r)||document.body)},[r,o]),Io(()=>{if(a&&!o)return Ck(t,a),()=>{Ck(t,null)}},[t,a,o]),o){if(T.isValidElement(n)){const c={ref:s};return T.cloneElement(n,c)}return n}return a&&Jy.createPortal(n,a)}),i$=e=>e.scrollTop;function Zp(e,t){const{timeout:n,easing:r,style:o={}}=e;return{duration:o.transitionDuration??(typeof n=="number"?n:n[t.mode]||0),easing:o.transitionTimingFunction??(typeof r=="object"?r[t.mode]:r),delay:o.transitionDelay}}const ZSe={entering:{opacity:1},entered:{opacity:1}},qd=T.forwardRef(function(e,t){const n=_u(),r={enter:n.transitions.duration.enteringScreen,exit:n.transitions.duration.leavingScreen},{addEndListener:o,appear:a=!0,children:i,easing:s,in:c,onEnter:u,onEntered:f,onEntering:p,onExit:y,onExited:g,onExiting:b,style:x,timeout:E=r,TransitionComponent:S=ms,...w}=e,C=T.useRef(null),R=cr(C,wh(i),t),M=k=>$=>{if(k){const j=C.current;$===void 0?k(j):k(j,$)}},D=M(p),I=M((k,$)=>{i$(k);const j=Zp({style:x,timeout:E,easing:s},{mode:"enter"});k.style.webkitTransition=n.transitions.create("opacity",j),k.style.transition=n.transitions.create("opacity",j),u&&u(k,$)}),L=M(f),F=M(b),B=M(k=>{const $=Zp({style:x,timeout:E,easing:s},{mode:"exit"});k.style.webkitTransition=n.transitions.create("opacity",$),k.style.transition=n.transitions.create("opacity",$),y&&y(k)}),U=M(g);return m.jsx(S,{appear:a,in:c,nodeRef:C,onEnter:I,onEntered:L,onEntering:D,onExit:B,onExited:U,onExiting:F,addEndListener:k=>{o&&o(C.current,k)},timeout:E,...w,children:(k,{ownerState:$,...j})=>T.cloneElement(i,{style:{opacity:0,visibility:k==="exited"&&!c?"hidden":void 0,...ZSe[k],...x,...i.props.style},ref:R,...j})})});function JSe(e){return Ut("MuiBackdrop",e)}Lt("MuiBackdrop",["root","invisible"]);const eEe=e=>{const{classes:t,invisible:n}=e;return zt({root:["root",n&&"invisible"]},JSe,t)},tEe=Pe("div",{name:"MuiBackdrop",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.invisible&&t.invisible]}})({position:"fixed",display:"flex",alignItems:"center",justifyContent:"center",right:0,bottom:0,top:0,left:0,backgroundColor:"rgba(0, 0, 0, 0.5)",WebkitTapHighlightColor:"transparent",variants:[{props:{invisible:!0},style:{backgroundColor:"transparent"}}]}),s$=T.forwardRef(function(e,t){const n=An({props:e,name:"MuiBackdrop"}),{children:r,className:o,component:a="div",invisible:i=!1,open:s,components:c={},componentsProps:u={},slotProps:f={},slots:p={},TransitionComponent:y,transitionDuration:g,...b}=n,x={...n,component:a,invisible:i},E=eEe(x),S={transition:y,root:c.Root,...p},w={...u,...f},C={component:a,slots:S,slotProps:w},[R,M]=tr("root",{elementType:tEe,externalForwardedProps:C,className:Ot(E.root,o),ownerState:x}),[D,I]=tr("transition",{elementType:qd,externalForwardedProps:C,ownerState:x});return m.jsx(D,{in:s,timeout:g,...b,...I,children:m.jsx(R,{"aria-hidden":!0,...M,classes:E,ref:t,children:r})})});function nEe(e){return typeof e=="function"?e():e}function rEe(e){return e?e.props.hasOwnProperty("in"):!1}const __=()=>{},M0=new VSe;function oEe(e){const{container:t,disableEscapeKeyDown:n=!1,disableScrollLock:r=!1,closeAfterTransition:o=!1,onTransitionEnter:a,onTransitionExited:i,children:s,onClose:c,open:u,rootRef:f}=e,p=T.useRef({}),y=T.useRef(null),g=T.useRef(null),b=cr(g,f),[x,E]=T.useState(!u),S=rEe(s);let w=!0;(e["aria-hidden"]==="false"||e["aria-hidden"]===!1)&&(w=!1);const C=()=>Po(y.current),R=()=>(p.current.modalRef=g.current,p.current.mount=y.current,p.current),M=()=>{M0.mount(R(),{disableScrollLock:r}),g.current&&(g.current.scrollTop=0)},D=Pt(()=>{const k=nEe(t)||C().body;M0.add(R(),k),g.current&&M()}),I=()=>M0.isTopModal(R()),L=Pt(k=>{y.current=k,k&&(u&&I()?M():g.current&&uy(g.current,w))}),F=T.useCallback(()=>{M0.remove(R(),w)},[w]);T.useEffect(()=>()=>{F()},[F]),T.useEffect(()=>{u?D():(!S||!o)&&F()},[u,F,S,o,D]);const B=k=>$=>{k.onKeyDown?.($),!($.key!=="Escape"||$.which===229||!I())&&(n||($.stopPropagation(),c&&c($,"escapeKeyDown")))},U=k=>$=>{k.onClick?.($),$.target===$.currentTarget&&c&&c($,"backdropClick")};return{getRootProps:(k={})=>{const $=ci(e);delete $.onTransitionEnter,delete $.onTransitionExited;const j={...$,...k};return{role:"presentation",...j,onKeyDown:B(j),ref:b}},getBackdropProps:(k={})=>{const $=k;return{"aria-hidden":!0,...$,onClick:U($),open:u}},getTransitionProps:()=>{const k=()=>{E(!1),a&&a()},$=()=>{E(!0),i&&i(),o&&F()};return{onEnter:x5(k,s?.props.onEnter??__),onExited:x5($,s?.props.onExited??__)}},rootRef:b,portalRef:L,isTopModal:I,exited:x,hasTransition:S}}function aEe(e){return Ut("MuiModal",e)}Lt("MuiModal",["root","hidden","backdrop"]);const iEe=e=>{const{open:t,exited:n,classes:r}=e;return zt({root:["root",!t&&n&&"hidden"],backdrop:["backdrop"]},aEe,r)},sEe=Pe("div",{name:"MuiModal",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,!n.open&&n.exited&&t.hidden]}})(Pn(({theme:e})=>({position:"fixed",zIndex:(e.vars||e).zIndex.modal,right:0,bottom:0,top:0,left:0,variants:[{props:({ownerState:t})=>!t.open&&t.exited,style:{visibility:"hidden"}}]}))),lEe=Pe(s$,{name:"MuiModal",slot:"Backdrop"})({zIndex:-1}),l$=T.forwardRef(function(e,t){const n=An({name:"MuiModal",props:e}),{BackdropComponent:r=lEe,BackdropProps:o,classes:a,className:i,closeAfterTransition:s=!1,children:c,container:u,component:f,components:p={},componentsProps:y={},disableAutoFocus:g=!1,disableEnforceFocus:b=!1,disableEscapeKeyDown:x=!1,disablePortal:E=!1,disableRestoreFocus:S=!1,disableScrollLock:w=!1,hideBackdrop:C=!1,keepMounted:R=!1,onClose:M,onTransitionEnter:D,onTransitionExited:I,open:L,slotProps:F={},slots:B={},theme:U,...k}=n,$={...n,closeAfterTransition:s,disableAutoFocus:g,disableEnforceFocus:b,disableEscapeKeyDown:x,disablePortal:E,disableRestoreFocus:S,disableScrollLock:w,hideBackdrop:C,keepMounted:R},{getRootProps:j,getBackdropProps:V,getTransitionProps:z,portalRef:K,isTopModal:Y,exited:te,hasTransition:_}=oEe({...$,rootRef:t}),Z={...$,exited:te},J=iEe(Z),W={};if(c.props.tabIndex===void 0&&(W.tabIndex="-1"),_){const{onEnter:fe,onExited:xe}=z();W.onEnter=fe,W.onExited=xe}const re={slots:{root:p.Root,backdrop:p.Backdrop,...B},slotProps:{...y,...F}},[ne,X]=tr("root",{ref:t,elementType:sEe,externalForwardedProps:{...re,...k,component:f},getSlotProps:j,ownerState:Z,className:Ot(i,J?.root,!Z.open&&Z.exited&&J?.hidden)}),[ie,ae]=tr("backdrop",{ref:o?.ref,elementType:r,externalForwardedProps:re,shouldForwardComponentProp:!0,additionalProps:o,getSlotProps:fe=>V({...fe,onClick:xe=>{fe?.onClick&&fe.onClick(xe)}}),className:Ot(o?.className,J?.backdrop),ownerState:Z});return!R&&!L&&(!_||te)?null:m.jsx(a$,{ref:K,container:u,disablePortal:E,children:m.jsxs(ne,{...X,children:[!C&&r?m.jsx(ie,{...ae}):null,m.jsx(o$,{disableEnforceFocus:b,disableAutoFocus:g,disableRestoreFocus:S,isEnabled:Y,open:L,children:T.cloneElement(c,W)})]})})});function cEe(e){return Ut("MuiPaper",e)}Lt("MuiPaper",["root","rounded","outlined","elevation","elevation0","elevation1","elevation2","elevation3","elevation4","elevation5","elevation6","elevation7","elevation8","elevation9","elevation10","elevation11","elevation12","elevation13","elevation14","elevation15","elevation16","elevation17","elevation18","elevation19","elevation20","elevation21","elevation22","elevation23","elevation24"]);const uEe=e=>{const{square:t,elevation:n,variant:r,classes:o}=e,a={root:["root",r,!t&&"rounded",r==="elevation"&&`elevation${n}`]};return zt(a,cEe,o)},dEe=Pe("div",{name:"MuiPaper",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,t[n.variant],!n.square&&t.rounded,n.variant==="elevation"&&t[`elevation${n.elevation}`]]}})(Pn(({theme:e})=>({backgroundColor:(e.vars||e).palette.background.paper,color:(e.vars||e).palette.text.primary,transition:e.transitions.create("box-shadow"),variants:[{props:({ownerState:t})=>!t.square,style:{borderRadius:e.shape.borderRadius}},{props:{variant:"outlined"},style:{border:`1px solid ${(e.vars||e).palette.divider}`}},{props:{variant:"elevation"},style:{boxShadow:"var(--Paper-shadow)",backgroundImage:"var(--Paper-overlay)"}}]}))),rf=T.forwardRef(function(e,t){const n=An({props:e,name:"MuiPaper"}),r=_u(),{className:o,component:a="div",elevation:i=1,square:s=!1,variant:c="elevation",...u}=n,f={...n,component:a,elevation:i,square:s,variant:c},p=uEe(f);return m.jsx(dEe,{as:a,ownerState:f,className:Ot(p.root,o),ref:t,...u,style:{...c==="elevation"&&{"--Paper-shadow":(r.vars||r).shadows[i],...r.vars&&{"--Paper-overlay":r.vars.overlays?.[i]},...!r.vars&&r.palette.mode==="dark"&&{"--Paper-overlay":`linear-gradient(${U1("#fff",Ek(i))}, ${U1("#fff",Ek(i))})`}},...u.style}})});function fEe(e){return Ut("MuiDialog",e)}const dy=Lt("MuiDialog",["root","scrollPaper","scrollBody","container","paper","paperScrollPaper","paperScrollBody","paperWidthFalse","paperWidthXs","paperWidthSm","paperWidthMd","paperWidthLg","paperWidthXl","paperFullWidth","paperFullScreen"]),c$=T.createContext({}),pEe=Pe(s$,{name:"MuiDialog",slot:"Backdrop",overrides:(e,t)=>t.backdrop})({zIndex:-1}),hEe=e=>{const{classes:t,scroll:n,maxWidth:r,fullWidth:o,fullScreen:a}=e,i={root:["root"],container:["container",`scroll${bt(n)}`],paper:["paper",`paperScroll${bt(n)}`,`paperWidth${bt(String(r))}`,o&&"paperFullWidth",a&&"paperFullScreen"]};return zt(i,fEe,t)},mEe=Pe(l$,{name:"MuiDialog",slot:"Root"})({"@media print":{position:"absolute !important"}}),gEe=Pe("div",{name:"MuiDialog",slot:"Container",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.container,t[`scroll${bt(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"}}}]}),yEe=Pe(rf,{name:"MuiDialog",slot:"Paper",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.paper,t[`scrollPaper${bt(n.scroll)}`],t[`paperWidth${bt(String(n.maxWidth))}`],n.fullWidth&&t.paperFullWidth,n.fullScreen&&t.paperFullScreen]}})(Pn(({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)`,[`&.${dy.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}`,[`&.${dy.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,[`&.${dy.paperScrollBody}`]:{margin:0,maxWidth:"100%"}}}]}))),Dl=T.forwardRef(function(e,t){const n=An({props:e,name:"MuiDialog"}),r=_u(),o={enter:r.transitions.duration.enteringScreen,exit:r.transitions.duration.leavingScreen},{"aria-describedby":a,"aria-labelledby":i,"aria-modal":s=!0,BackdropComponent:c,BackdropProps:u,children:f,className:p,disableEscapeKeyDown:y=!1,fullScreen:g=!1,fullWidth:b=!1,maxWidth:x="sm",onClick:E,onClose:S,open:w,PaperComponent:C=rf,PaperProps:R={},scroll:M="paper",slots:D={},slotProps:I={},TransitionComponent:L=qd,transitionDuration:F=o,TransitionProps:B,...U}=n,k={...n,disableEscapeKeyDown:y,fullScreen:g,fullWidth:b,maxWidth:x,scroll:M},$=hEe(k),j=T.useRef(),V=Re=>{j.current=Re.target===Re.currentTarget},z=Re=>{E&&E(Re),j.current&&(j.current=null,S&&S(Re,"backdropClick"))},K=Bs(i),Y=T.useMemo(()=>({titleId:K}),[K]),te={transition:L,...D},_={transition:B,paper:R,backdrop:u,...I},Z={slots:te,slotProps:_},[J,W]=tr("root",{elementType:mEe,shouldForwardComponentProp:!0,externalForwardedProps:Z,ownerState:k,className:Ot($.root,p),ref:t}),[re,ne]=tr("backdrop",{elementType:pEe,shouldForwardComponentProp:!0,externalForwardedProps:Z,ownerState:k}),[X,ie]=tr("paper",{elementType:yEe,shouldForwardComponentProp:!0,externalForwardedProps:Z,ownerState:k,className:Ot($.paper,R.className)}),[ae,fe]=tr("container",{elementType:gEe,externalForwardedProps:Z,ownerState:k,className:$.container}),[xe,ge]=tr("transition",{elementType:qd,externalForwardedProps:Z,ownerState:k,additionalProps:{appear:!0,in:w,timeout:F,role:"presentation"}});return m.jsx(J,{closeAfterTransition:!0,slots:{backdrop:re},slotProps:{backdrop:{transitionDuration:F,as:c,...ne}},disableEscapeKeyDown:y,onClose:S,open:w,onClick:z,...W,...U,children:m.jsx(xe,{...ge,children:m.jsx(ae,{onMouseDown:V,...fe,children:m.jsx(X,{as:C,elevation:24,role:"dialog","aria-describedby":a,"aria-labelledby":K,"aria-modal":s,...ie,children:m.jsx(c$.Provider,{value:Y,children:f})})})})})});function bEe(e){return Ut("MuiDialogActions",e)}Lt("MuiDialogActions",["root","spacing"]);const vEe=e=>{const{classes:t,disableSpacing:n}=e;return zt({root:["root",!n&&"spacing"]},bEe,t)},xEe=Pe("div",{name:"MuiDialogActions",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,!n.disableSpacing&&t.spacing]}})({display:"flex",alignItems:"center",padding:8,justifyContent:"flex-end",flex:"0 0 auto",variants:[{props:({ownerState:e})=>!e.disableSpacing,style:{"& > :not(style) ~ :not(style)":{marginLeft:8}}}]}),Ol=T.forwardRef(function(e,t){const n=An({props:e,name:"MuiDialogActions"}),{className:r,disableSpacing:o=!1,...a}=n,i={...n,disableSpacing:o},s=vEe(i);return m.jsx(xEe,{className:Ot(s.root,r),ownerState:i,ref:t,...a})});function SEe(e){return Ut("MuiDialogContent",e)}Lt("MuiDialogContent",["root","dividers"]);function EEe(e){return Ut("MuiDialogTitle",e)}const CEe=Lt("MuiDialogTitle",["root"]),TEe=e=>{const{classes:t,dividers:n}=e;return zt({root:["root",n&&"dividers"]},SEe,t)},wEe=Pe("div",{name:"MuiDialogContent",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.dividers&&t.dividers]}})(Pn(({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:{[`.${CEe.root} + &`]:{paddingTop:0}}}]}))),Rl=T.forwardRef(function(e,t){const n=An({props:e,name:"MuiDialogContent"}),{className:r,dividers:o=!1,...a}=n,i={...n,dividers:o},s=TEe(i);return m.jsx(wEe,{className:Ot(s.root,r),ownerState:i,ref:t,...a})});function kEe(e){return Ut("MuiTypography",e)}const L_=Lt("MuiTypography",["root","h1","h2","h3","h4","h5","h6","subtitle1","subtitle2","body1","body2","inherit","button","caption","overline","alignLeft","alignRight","alignCenter","alignJustify","noWrap","gutterBottom","paragraph"]),AEe={primary:!0,secondary:!0,error:!0,info:!0,success:!0,warning:!0,textPrimary:!0,textSecondary:!0,textDisabled:!0},DEe=Fce(),OEe=e=>{const{align:t,gutterBottom:n,noWrap:r,paragraph:o,variant:a,classes:i}=e,s={root:["root",a,e.align!=="inherit"&&`align${bt(t)}`,n&&"gutterBottom",r&&"noWrap",o&&"paragraph"]};return zt(s,kEe,i)},REe=Pe("span",{name:"MuiTypography",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.variant&&t[n.variant],n.align!=="inherit"&&t[`align${bt(n.align)}`],n.noWrap&&t.noWrap,n.gutterBottom&&t.gutterBottom,n.paragraph&&t.paragraph]}})(Pn(({theme:e})=>({margin:0,variants:[{props:{variant:"inherit"},style:{font:"inherit",lineHeight:"inherit",letterSpacing:"inherit"}},...Object.entries(e.typography).filter(([t,n])=>t!=="inherit"&&n&&typeof n=="object").map(([t,n])=>({props:{variant:t},style:n})),...Object.entries(e.palette).filter(Sa()).map(([t])=>({props:{color:t},style:{color:(e.vars||e).palette[t].main}})),...Object.entries(e.palette?.text||{}).filter(([,t])=>typeof t=="string").map(([t])=>({props:{color:`text${bt(t)}`},style:{color:(e.vars||e).palette.text[t]}})),{props:({ownerState:t})=>t.align!=="inherit",style:{textAlign:"var(--Typography-textAlign)"}},{props:({ownerState:t})=>t.noWrap,style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}},{props:({ownerState:t})=>t.gutterBottom,style:{marginBottom:"0.35em"}},{props:({ownerState:t})=>t.paragraph,style:{marginBottom:16}}]}))),F_={h1:"h1",h2:"h2",h3:"h3",h4:"h4",h5:"h5",h6:"h6",subtitle1:"h6",subtitle2:"h6",body1:"p",body2:"p",inherit:"p"},lr=T.forwardRef(function(e,t){const{color:n,...r}=An({props:e,name:"MuiTypography"}),o=!AEe[n],a=DEe({...r,...o&&{color:n}}),{align:i="inherit",className:s,component:c,gutterBottom:u=!1,noWrap:f=!1,paragraph:p=!1,variant:y="body1",variantMapping:g=F_,...b}=a,x={...a,align:i,color:n,className:s,component:c,gutterBottom:u,noWrap:f,paragraph:p,variant:y,variantMapping:g},E=c||(p?"p":g[y]||F_[y])||"span",S=OEe(x);return m.jsx(REe,{as:E,ref:t,className:Ot(S.root,s),...b,ownerState:x,style:{...i!=="inherit"&&{"--Typography-textAlign":i},...b.style}})}),MEe=e=>{const{classes:t}=e;return zt({root:["root"]},EEe,t)},NEe=Pe(lr,{name:"MuiDialogTitle",slot:"Root"})({padding:"16px 24px",flex:"0 0 auto"}),gc=T.forwardRef(function(e,t){const n=An({props:e,name:"MuiDialogTitle"}),{className:r,id:o,...a}=n,i=n,s=MEe(i),{titleId:c=o}=T.useContext(c$);return m.jsx(NEe,{component:"h2",className:Ot(s.root,r),ownerState:i,ref:t,variant:"h6",id:o??c,...a})});function j_(e){return e!=null&&!(Array.isArray(e)&&e.length===0)}function ax(e,t=!1){return e&&(j_(e.value)&&e.value!==""||t&&j_(e.defaultValue)&&e.defaultValue!=="")}function PEe(e){return e.startAdornment}function IEe(e){return Ut("MuiFormControl",e)}Lt("MuiFormControl",["root","marginNone","marginNormal","marginDense","fullWidth","disabled"]);const _Ee=e=>{const{classes:t,margin:n,fullWidth:r}=e,o={root:["root",n!=="none"&&`margin${bt(n)}`,r&&"fullWidth"]};return zt(o,IEe,t)},LEe=Pe("div",{name:"MuiFormControl",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,t[`margin${bt(n.margin)}`],n.fullWidth&&t.fullWidth]}})({display:"inline-flex",flexDirection:"column",position:"relative",minWidth:0,padding:0,margin:0,border:0,verticalAlign:"top",variants:[{props:{margin:"normal"},style:{marginTop:16,marginBottom:8}},{props:{margin:"dense"},style:{marginTop:8,marginBottom:4}},{props:{fullWidth:!0},style:{width:"100%"}}]}),ix=T.forwardRef(function(e,t){const n=An({props:e,name:"MuiFormControl"}),{children:r,className:o,color:a="primary",component:i="div",disabled:s=!1,error:c=!1,focused:u,fullWidth:f=!1,hiddenLabel:p=!1,margin:y="none",required:g=!1,size:b="medium",variant:x="outlined",...E}=n,S={...n,color:a,component:i,disabled:s,error:c,fullWidth:f,hiddenLabel:p,margin:y,required:g,size:b,variant:x},w=_Ee(S),[C,R]=T.useState(()=>{let j=!1;return r&&T.Children.forEach(r,V=>{if(!a1(V,["Input","Select"]))return;const z=a1(V,["Select"])?V.props.input:V;z&&PEe(z.props)&&(j=!0)}),j}),[M,D]=T.useState(()=>{let j=!1;return r&&T.Children.forEach(r,V=>{a1(V,["Input","Select"])&&(ax(V.props,!0)||ax(V.props.inputProps,!0))&&(j=!0)}),j}),[I,L]=T.useState(!1);s&&I&&L(!1);const F=u!==void 0&&!s?u:I;let B;T.useRef(!1);const U=T.useCallback(()=>{D(!0)},[]),k=T.useCallback(()=>{D(!1)},[]),$=T.useMemo(()=>({adornedStart:C,setAdornedStart:R,color:a,disabled:s,error:c,filled:M,focused:F,fullWidth:f,hiddenLabel:p,size:b,onBlur:()=>{L(!1)},onFocus:()=>{L(!0)},onEmpty:k,onFilled:U,registerEffect:B,required:g,variant:x}),[C,a,s,c,M,F,f,p,B,k,U,g,b,x]);return m.jsx(IS.Provider,{value:$,children:m.jsx(LEe,{as:i,ownerState:S,className:Ot(w.root,o),ref:t,...E,children:r})})});function FEe(e){return Ut("MuiFormControlLabel",e)}const Bg=Lt("MuiFormControlLabel",["root","labelPlacementStart","labelPlacementTop","labelPlacementBottom","disabled","label","error","required","asterisk"]);function of({props:e,states:t,muiFormControl:n}){return t.reduce((r,o)=>(r[o]=e[o],n&&typeof e[o]>"u"&&(r[o]=n[o]),r),{})}const jEe=e=>{const{classes:t,disabled:n,labelPlacement:r,error:o,required:a}=e,i={root:["root",n&&"disabled",`labelPlacement${bt(r)}`,o&&"error",a&&"required"],label:["label",n&&"disabled"],asterisk:["asterisk",o&&"error"]};return zt(i,FEe,t)},BEe=Pe("label",{name:"MuiFormControlLabel",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[{[`& .${Bg.label}`]:t.label},t.root,t[`labelPlacement${bt(n.labelPlacement)}`]]}})(Pn(({theme:e})=>({display:"inline-flex",alignItems:"center",cursor:"pointer",verticalAlign:"middle",WebkitTapHighlightColor:"transparent",marginLeft:-11,marginRight:16,[`&.${Bg.disabled}`]:{cursor:"default"},[`& .${Bg.label}`]:{[`&.${Bg.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}}]}))),$Ee=Pe("span",{name:"MuiFormControlLabel",slot:"Asterisk"})(Pn(({theme:e})=>({[`&.${Bg.error}`]:{color:(e.vars||e).palette.error.main}}))),zEe=T.forwardRef(function(e,t){const n=An({props:e,name:"MuiFormControlLabel"}),{checked:r,className:o,componentsProps:a={},control:i,disabled:s,disableTypography:c,inputRef:u,label:f,labelPlacement:p="end",name:y,onChange:g,required:b,slots:x={},slotProps:E={},value:S,...w}=n,C=Oi(),R=s??i.props.disabled??C?.disabled,M=b??i.props.required,D={disabled:R,required:M};["checked","name","onChange","value","inputRef"].forEach(j=>{typeof i.props[j]>"u"&&typeof n[j]<"u"&&(D[j]=n[j])});const I=of({props:n,muiFormControl:C,states:["error"]}),L={...n,disabled:R,labelPlacement:p,required:M,error:I.error},F=jEe(L),B={slots:x,slotProps:{...a,...E}},[U,k]=tr("typography",{elementType:lr,externalForwardedProps:B,ownerState:L});let $=f;return $!=null&&$.type!==lr&&!c&&($=m.jsx(U,{component:"span",...k,className:Ot(F.label,k?.className),children:$})),m.jsxs(BEe,{className:Ot(F.root,o),ownerState:L,ref:t,...w,children:[T.cloneElement(i,D),M?m.jsxs("div",{children:[$,m.jsxs($Ee,{ownerState:L,"aria-hidden":!0,className:F.asterisk,children:[" ","*"]})]}):$]})});function HEe(e){return Ut("MuiIconButton",e)}const B_=Lt("MuiIconButton",["root","disabled","colorInherit","colorPrimary","colorSecondary","colorError","colorInfo","colorSuccess","colorWarning","edgeStart","edgeEnd","sizeSmall","sizeMedium","sizeLarge","loading","loadingIndicator","loadingWrapper"]),UEe=e=>{const{classes:t,disabled:n,color:r,edge:o,size:a,loading:i}=e,s={root:["root",i&&"loading",n&&"disabled",r!=="default"&&`color${bt(r)}`,o&&`edge${bt(o)}`,`size${bt(a)}`],loadingIndicator:["loadingIndicator"],loadingWrapper:["loadingWrapper"]};return zt(s,HEe,t)},VEe=Pe(Wd,{name:"MuiIconButton",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.loading&&t.loading,n.color!=="default"&&t[`color${bt(n.color)}`],n.edge&&t[`edge${bt(n.edge)}`],t[`size${bt(n.size)}`]]}})(Pn(({theme:e})=>({textAlign:"center",flex:"0 0 auto",fontSize:e.typography.pxToRem(24),padding:8,borderRadius:"50%",color:(e.vars||e).palette.action.active,transition:e.transitions.create("background-color",{duration:e.transitions.duration.shortest}),variants:[{props:t=>!t.disableRipple,style:{"--IconButton-hoverBg":e.alpha((e.vars||e).palette.action.active,(e.vars||e).palette.action.hoverOpacity),"&:hover":{backgroundColor:"var(--IconButton-hoverBg)","@media (hover: none)":{backgroundColor:"transparent"}}}},{props:{edge:"start"},style:{marginLeft:-12}},{props:{edge:"start",size:"small"},style:{marginLeft:-3}},{props:{edge:"end"},style:{marginRight:-12}},{props:{edge:"end",size:"small"},style:{marginRight:-3}}]})),Pn(({theme:e})=>({variants:[{props:{color:"inherit"},style:{color:"inherit"}},...Object.entries(e.palette).filter(Sa()).map(([t])=>({props:{color:t},style:{color:(e.vars||e).palette[t].main}})),...Object.entries(e.palette).filter(Sa()).map(([t])=>({props:{color:t},style:{"--IconButton-hoverBg":e.alpha((e.vars||e).palette[t].main,(e.vars||e).palette.action.hoverOpacity)}})),{props:{size:"small"},style:{padding:5,fontSize:e.typography.pxToRem(18)}},{props:{size:"large"},style:{padding:12,fontSize:e.typography.pxToRem(28)}}],[`&.${B_.disabled}`]:{backgroundColor:"transparent",color:(e.vars||e).palette.action.disabled},[`&.${B_.loading}`]:{color:"transparent"}}))),WEe=Pe("span",{name:"MuiIconButton",slot:"LoadingIndicator"})(({theme:e})=>({display:"none",position:"absolute",visibility:"visible",top:"50%",left:"50%",transform:"translate(-50%, -50%)",color:(e.vars||e).palette.action.disabled,variants:[{props:{loading:!0},style:{display:"flex"}}]})),gs=T.forwardRef(function(e,t){const n=An({props:e,name:"MuiIconButton"}),{edge:r=!1,children:o,className:a,color:i="default",disabled:s=!1,disableFocusRipple:c=!1,size:u="medium",id:f,loading:p=null,loadingIndicator:y,...g}=n,b=Bs(f),x=y??m.jsx(LD,{"aria-labelledby":b,color:"inherit",size:16}),E={...n,edge:r,color:i,disabled:s,disableFocusRipple:c,loading:p,loadingIndicator:x,size:u},S=UEe(E);return m.jsxs(VEe,{id:p?b:f,className:Ot(S.root,a),centerRipple:!0,focusRipple:!c,disabled:s||p,ref:t,...g,ownerState:E,children:[typeof p=="boolean"&&m.jsx("span",{className:S.loadingWrapper,style:{display:"contents"},children:m.jsx(WEe,{className:S.loadingIndicator,ownerState:E,children:p&&x})}),o]})});function qEe(e){return Ut("MuiListItemIcon",e)}const $_=Lt("MuiListItemIcon",["root","alignItemsFlexStart"]),ac=T.createContext({}),GEe=e=>{const{alignItems:t,classes:n}=e;return zt({root:["root",t==="flex-start"&&"alignItemsFlexStart"]},qEe,n)},YEe=Pe("div",{name:"MuiListItemIcon",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.alignItems==="flex-start"&&t.alignItemsFlexStart]}})(Pn(({theme:e})=>({minWidth:56,color:(e.vars||e).palette.action.active,flexShrink:0,display:"inline-flex",variants:[{props:{alignItems:"flex-start"},style:{marginTop:8}}]}))),jD=T.forwardRef(function(e,t){const n=An({props:e,name:"MuiListItemIcon"}),{className:r,...o}=n,a=T.useContext(ac),i={...n,alignItems:a.alignItems},s=GEe(i);return m.jsx(YEe,{className:Ot(s.root,r),ownerState:i,ref:t,...o})});function KEe(e){return Ut("MuiListItemText",e)}const bp=Lt("MuiListItemText",["root","multiline","dense","inset","primary","secondary"]),QEe=e=>{const{classes:t,inset:n,primary:r,secondary:o,dense:a}=e;return zt({root:["root",n&&"inset",a&&"dense",r&&o&&"multiline"],primary:["primary"],secondary:["secondary"]},KEe,t)},XEe=Pe("div",{name:"MuiListItemText",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[{[`& .${bp.primary}`]:t.primary},{[`& .${bp.secondary}`]:t.secondary},t.root,n.inset&&t.inset,n.primary&&n.secondary&&t.multiline,n.dense&&t.dense]}})({flex:"1 1 auto",minWidth:0,marginTop:4,marginBottom:4,[`.${L_.root}:where(& .${bp.primary})`]:{display:"block"},[`.${L_.root}:where(& .${bp.secondary})`]:{display:"block"},variants:[{props:({ownerState:e})=>e.primary&&e.secondary,style:{marginTop:6,marginBottom:6}},{props:({ownerState:e})=>e.inset,style:{paddingLeft:56}}]}),BD=T.forwardRef(function(e,t){const n=An({props:e,name:"MuiListItemText"}),{children:r,className:o,disableTypography:a=!1,inset:i=!1,primary:s,primaryTypographyProps:c,secondary:u,secondaryTypographyProps:f,slots:p={},slotProps:y={},...g}=n,{dense:b}=T.useContext(ac);let x=s??r,E=u;const S={...n,disableTypography:a,inset:i,primary:!!x,secondary:!!E,dense:b},w=QEe(S),C={slots:p,slotProps:{primary:c,secondary:f,...y}},[R,M]=tr("root",{className:Ot(w.root,o),elementType:XEe,externalForwardedProps:{...C,...g},ownerState:S,ref:t}),[D,I]=tr("primary",{className:w.primary,elementType:lr,externalForwardedProps:C,ownerState:S}),[L,F]=tr("secondary",{className:w.secondary,elementType:lr,externalForwardedProps:C,ownerState:S});return x!=null&&x.type!==lr&&!a&&(x=m.jsx(D,{variant:b?"body2":"body1",component:I?.variant?void 0:"span",...I,children:x})),E!=null&&E.type!==lr&&!a&&(E=m.jsx(L,{variant:"body2",color:"textSecondary",...F,children:E})),m.jsxs(R,{...M,children:[x,E]})}),z_=Lt("MuiDivider",["root","absolute","fullWidth","inset","middle","flexItem","light","vertical","withChildren","withChildrenVertical","textAlignRight","textAlignLeft","wrapper","wrapperVertical"]);function ZEe(e){return Ut("MuiMenuItem",e)}const cg=Lt("MuiMenuItem",["root","focusVisible","dense","disabled","divider","gutters","selected"]),JEe=(e,t)=>{const{ownerState:n}=e;return[t.root,n.dense&&t.dense,n.divider&&t.divider,!n.disableGutters&&t.gutters]},eCe=e=>{const{disabled:t,dense:n,divider:r,disableGutters:o,selected:a,classes:i}=e,s=zt({root:["root",n&&"dense",t&&"disabled",!o&&"gutters",r&&"divider",a&&"selected"]},ZEe,i);return{...i,...s}},tCe=Pe(Wd,{shouldForwardProp:e=>wa(e)||e==="classes",name:"MuiMenuItem",slot:"Root",overridesResolver:JEe})(Pn(({theme:e})=>({...e.typography.body1,display:"flex",justifyContent:"flex-start",alignItems:"center",position:"relative",textDecoration:"none",minHeight:48,paddingTop:6,paddingBottom:6,boxSizing:"border-box",whiteSpace:"nowrap","&:hover":{textDecoration:"none",backgroundColor:(e.vars||e).palette.action.hover,"@media (hover: none)":{backgroundColor:"transparent"}},[`&.${cg.selected}`]:{backgroundColor:e.alpha((e.vars||e).palette.primary.main,(e.vars||e).palette.action.selectedOpacity),[`&.${cg.focusVisible}`]:{backgroundColor:e.alpha((e.vars||e).palette.primary.main,`${(e.vars||e).palette.action.selectedOpacity} + ${(e.vars||e).palette.action.focusOpacity}`)}},[`&.${cg.selected}:hover`]:{backgroundColor:e.alpha((e.vars||e).palette.primary.main,`${(e.vars||e).palette.action.selectedOpacity} + ${(e.vars||e).palette.action.hoverOpacity}`),"@media (hover: none)":{backgroundColor:e.alpha((e.vars||e).palette.primary.main,(e.vars||e).palette.action.selectedOpacity)}},[`&.${cg.focusVisible}`]:{backgroundColor:(e.vars||e).palette.action.focus},[`&.${cg.disabled}`]:{opacity:(e.vars||e).palette.action.disabledOpacity},[`& + .${z_.root}`]:{marginTop:e.spacing(1),marginBottom:e.spacing(1)},[`& + .${z_.inset}`]:{marginLeft:52},[`& .${bp.root}`]:{marginTop:0,marginBottom:0},[`& .${bp.inset}`]:{paddingLeft:36},[`& .${$_.root}`]:{minWidth:36},variants:[{props:({ownerState:t})=>!t.disableGutters,style:{paddingLeft:16,paddingRight:16}},{props:({ownerState:t})=>t.divider,style:{borderBottom:`1px solid ${(e.vars||e).palette.divider}`,backgroundClip:"padding-box"}},{props:({ownerState:t})=>!t.dense,style:{[e.breakpoints.up("sm")]:{minHeight:"auto"}}},{props:({ownerState:t})=>t.dense,style:{minHeight:32,paddingTop:4,paddingBottom:4,...e.typography.body2,[`& .${$_.root} svg`]:{fontSize:"1.25rem"}}}]}))),Mo=T.forwardRef(function(e,t){const n=An({props:e,name:"MuiMenuItem"}),{autoFocus:r=!1,component:o="li",dense:a=!1,divider:i=!1,disableGutters:s=!1,focusVisibleClassName:c,role:u="menuitem",tabIndex:f,className:p,...y}=n,g=T.useContext(ac),b=T.useMemo(()=>({dense:a||g.dense||!1,disableGutters:s}),[g.dense,a,s]),x=T.useRef(null);Io(()=>{r&&x.current&&x.current.focus()},[r]);const E={...n,dense:b.dense,divider:i,disableGutters:s},S=eCe(n),w=cr(x,t);let C;return n.disabled||(C=f!==void 0?f:-1),m.jsx(ac.Provider,{value:b,children:m.jsx(tCe,{ref:w,role:u,tabIndex:C,component:o,focusVisibleClassName:Ot(S.focusVisible,c),className:Ot(S.root,p),...y,ownerState:E,classes:S})})});function nCe({materialization:e,onCloseDialog:t,isMutating:n,onDelete:r}){const[o,a]=T.useState(!1),[i,s]=T.useState(!1),c=()=>a(!0),u=()=>{a(!1),s(!1),t()};return m.jsxs(vt.Fragment,{children:[m.jsxs(Mo,{"aria-label":`Delete materialization ${e?.id??""}`.trim(),onClick:f=>{f.stopPropagation(),c()},sx:{color:"error.main"},children:[m.jsx(jD,{sx:{color:"inherit"},children:m.jsx(Jx,{fontSize:"small"})}),m.jsx(BD,{children:"Delete"})]}),m.jsxs(Dl,{onClose:u,open:o,"aria-labelledby":"delete-materialization-title",children:[m.jsx(gc,{sx:{m:0,p:2},id:"delete-materialization-title",children:"Delete Materialization"}),m.jsx(gs,{"aria-label":"close",onClick:u,sx:f=>({position:"absolute",right:8,top:8,color:f.palette.grey[500]}),children:m.jsx(Ns,{})}),m.jsxs(Rl,{dividers:!0,children:[m.jsx(lr,{gutterBottom:!0,children:"Are you sure you want to delete this materialization record? This action cannot be undone."}),m.jsx(zEe,{control:m.jsx(FD,{checked:i,onChange:f=>s(f.target.checked)}),label:"Also drop the materialized table(s) this run produced"})]}),m.jsx(Ol,{children:m.jsx(Zr,{loading:n,variant:"contained",autoFocus:!0,onClick:()=>r(i),color:"error",children:"Delete"})})]})]})}function u$({materializations:e,mutable:t,isMutating:n,showPackage:r=!1,onClickPackage:o,onStop:a,onDelete:i,onViewDetails:s}){return e.length===0?m.jsx(at,{variant:"body2",color:"text.secondary",sx:{py:1,fontStyle:"italic"},children:"No materializations yet."}):m.jsxs(lb,{size:"small",children:[m.jsx(ub,{children:m.jsxs(bl,{children:[r&&m.jsx(Mn,{children:"Package"}),m.jsx(Mn,{children:"Status"}),m.jsx(Mn,{children:"Trigger"}),m.jsx(Mn,{children:"Started"}),m.jsx(Mn,{children:"Duration"}),m.jsx(Mn,{children:"Sources"}),m.jsx(Mn,{align:"right",children:"Actions"})]})}),m.jsx(cb,{children:e.map(c=>m.jsx(rCe,{materialization:c,mutable:t,isMutating:n,showPackage:r,onClickPackage:o,onStop:a,onDelete:i,onViewDetails:s},c.id))})]})}function rCe({materialization:e,mutable:t,isMutating:n,showPackage:r,onClickPackage:o,onStop:a,onDelete:i,onViewDetails:s}){const[c,u]=T.useState(null),f=!!c,p=()=>u(null),y=G7(e),g=y.sourcesBuilt!==void 0||y.sourcesReused!==void 0?`${y.sourcesBuilt??0} built, ${y.sourcesReused??0} reused`:"-",b=Uy(e.status),x=Mxe(e.status),E=e.error??void 0,S=t&&(b||x);return m.jsxs(bl,{hover:!0,sx:{cursor:"pointer","&:focus-visible":{outline:"2px solid",outlineColor:"primary.main",outlineOffset:"-2px"}},onClick:()=>s(e),onKeyDown:w=>{(w.key==="Enter"||w.key===" ")&&(w.preventDefault(),s(e))},role:"button",tabIndex:0,"aria-label":`View materialization ${e.id??""} details`.trim(),children:[r&&m.jsx(Mn,{onClick:w=>w.stopPropagation(),children:o?m.jsx(fA,{component:"button",underline:"hover",onClick:()=>o(e.packageName??""),sx:{fontWeight:500},children:e.packageName}):e.packageName}),m.jsx(Mn,{children:m.jsxs(gt,{sx:{display:"flex",alignItems:"center",gap:.5},children:[m.jsx(Ld,{size:"small",label:W7(e.status),color:q7(e.status),variant:b?"filled":"outlined"}),E&&m.jsx(eo,{title:E,children:m.jsx(H7,{fontSize:"small",color:"error"})})]})}),m.jsx(Mn,{children:m.jsx(K7,{meta:y})}),m.jsx(Mn,{children:Pxe(e.startedAt??e.createdAt)}),m.jsx(Mn,{children:Y7(e.startedAt,e.completedAt)}),m.jsx(Mn,{children:g}),m.jsx(Mn,{align:"right",onClick:w=>w.stopPropagation(),children:S&&m.jsxs(m.Fragment,{children:[m.jsx(dr,{size:"small","aria-label":`Materialization actions for ${e.id??""}`.trim(),onClick:w=>u(w.currentTarget),children:m.jsx(eS,{fontSize:"small"})}),m.jsxs(Zd,{anchorEl:c,open:f,onClose:p,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},children:[t&&b&&m.jsxs(cc,{"aria-label":`Stop materialization ${e.id??""}`.trim(),disabled:n,onClick:()=>{p(),a(e)},children:[m.jsx(sb,{children:m.jsx(Lxe,{fontSize:"small"})}),m.jsx(Xd,{children:"Stop"})]}),t&&x&&m.jsx(nCe,{materialization:e,isMutating:n,onCloseDialog:p,onDelete:w=>i(e,w)})]})]})})]})}var cp={},ai={},ug={},up={},H_={},U_;function oCe(){return U_||(U_=1,Object.defineProperty(H_,"__esModule",{value:!0})),H_}var dg={},fg={},V_;function af(){if(V_)return fg;V_=1,Object.defineProperty(fg,"__esModule",{value:!0}),fg.CronField=void 0;let e=class d${#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(d$.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=s=>c=>new RegExp(`^\\d{0,2}${c}$`).test(s),a=s=>(n=s,typeof s=="number"?s>=this.min&&s<=this.max:this.chars.some(o(s)));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((s,c)=>this.#o.indexOf(s)!==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 fg.CronField=e,fg}var W_;function aCe(){if(W_)return dg;W_=1,Object.defineProperty(dg,"__esModule",{value:!0}),dg.CronDayOfMonth=void 0;const e=af(),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 dg.CronDayOfMonth=o,dg}var pg={},q_;function iCe(){if(q_)return pg;q_=1,Object.defineProperty(pg,"__esModule",{value:!0}),pg.CronDayOfWeek=void 0;const e=af(),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 pg.CronDayOfWeek=o,pg}var hg={},G_;function sCe(){if(G_)return hg;G_=1,Object.defineProperty(hg,"__esModule",{value:!0}),hg.CronHour=void 0;const e=af(),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 hg.CronHour=o,hg}var mg={},Y_;function lCe(){if(Y_)return mg;Y_=1,Object.defineProperty(mg,"__esModule",{value:!0}),mg.CronMinute=void 0;const e=af(),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 mg.CronMinute=o,mg}var gg={},K_={},Ia={},Q_;function cCe(){if(Q_)return Ia;Q_=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 s extends e{constructor(){super("Zone is an abstract class")}}const c="numeric",u="short",f="long",p={year:c,month:c,day:c},y={year:c,month:u,day:c},g={year:c,month:u,day:c,weekday:u},b={year:c,month:f,day:c},x={year:c,month:f,day:c,weekday:f},E={hour:c,minute:c},S={hour:c,minute:c,second:c},w={hour:c,minute:c,second:c,timeZoneName:u},C={hour:c,minute:c,second:c,timeZoneName:f},R={hour:c,minute:c,hourCycle:"h23"},M={hour:c,minute:c,second:c,hourCycle:"h23"},D={hour:c,minute:c,second:c,hourCycle:"h23",timeZoneName:u},I={hour:c,minute:c,second:c,hourCycle:"h23",timeZoneName:f},L={year:c,month:c,day:c,hour:c,minute:c},F={year:c,month:c,day:c,hour:c,minute:c,second:c},B={year:c,month:u,day:c,hour:c,minute:c},U={year:c,month:u,day:c,hour:c,minute:c,second:c},k={year:c,month:u,day:c,weekday:u,hour:c,minute:c},$={year:c,month:f,day:c,hour:c,minute:c,timeZoneName:u},j={year:c,month:f,day:c,hour:c,minute:c,second:c,timeZoneName:u},V={year:c,month:f,day:c,weekday:f,hour:c,minute:c,timeZoneName:f},z={year:c,month:f,day:c,weekday:f,hour:c,minute:c,second:c,timeZoneName:f};class K{get type(){throw new s}get name(){throw new s}get ianaName(){return this.name}get isUniversal(){throw new s}offsetName(O,H){throw new s}formatOffset(O,H){throw new s}offset(O){throw new s}equals(O){throw new s}get isValid(){throw new s}}let Y=null;class te extends K{static get instance(){return Y===null&&(Y=new te),Y}get type(){return"system"}get name(){return new Intl.DateTimeFormat().resolvedOptions().timeZone}get isUniversal(){return!1}offsetName(O,{format:H,locale:G}){return Dh(O,H,G)}formatOffset(O,H){return Sc(this.offset(O),H)}offset(O){return-new Date(O).getTimezoneOffset()}equals(O){return O.type==="system"}get isValid(){return!0}}const _=new Map;function Z(q){let O=_.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"}),_.set(q,O)),O}const J={year:0,month:1,day:2,era:3,hour:4,minute:5,second:6};function W(q,O){const H=q.format(O).replace(/\u200E/g,""),G=/(\d+)\/(\d+)\/(\d+) (AD|BC),? (\d+):(\d+):(\d+)/.exec(H),[,ee,ye,Ee,De,Le,Ct,on]=G;return[Ee,ee,ye,De,Le,Ct,on]}function re(q,O){const H=q.formatToParts(O),G=[];for(let ee=0;ee<H.length;ee++){const{type:ye,value:Ee}=H[ee],De=J[ye];ye==="era"?G[De]=Ee:qe(De)||(G[De]=parseInt(Ee,10))}return G}const ne=new Map;class X extends K{static create(O){let H=ne.get(O);return H===void 0&&ne.set(O,H=new X(O)),H}static resetCache(){ne.clear(),_.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=X.isValidZone(O)}get type(){return"iana"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(O,{format:H,locale:G}){return Dh(O,H,G,this.name)}formatOffset(O,H){return Sc(this.offset(O),H)}offset(O){if(!this.valid)return NaN;const H=new Date(O);if(isNaN(H))return NaN;const G=Z(this.name);let[ee,ye,Ee,De,Le,Ct,on]=G.formatToParts?re(G,H):W(G,H);De==="BC"&&(ee=-Math.abs(ee)+1);const Sn=xc({year:ee,month:ye,day:Ee,hour:Le===24?0:Le,minute:Ct,second:on,millisecond:0});let ir=+H;const ln=ir%1e3;return ir-=ln>=0?ln:1e3+ln,(Sn-ir)/(60*1e3)}equals(O){return O.type==="iana"&&O.name===this.name}get isValid(){return this.valid}}let ie={};function ae(q,O={}){const H=JSON.stringify([q,O]);let G=ie[H];return G||(G=new Intl.ListFormat(q,O),ie[H]=G),G}const fe=new Map;function xe(q,O={}){const H=JSON.stringify([q,O]);let G=fe.get(H);return G===void 0&&(G=new Intl.DateTimeFormat(q,O),fe.set(H,G)),G}const ge=new Map;function Re(q,O={}){const H=JSON.stringify([q,O]);let G=ge.get(H);return G===void 0&&(G=new Intl.NumberFormat(q,O),ge.set(H,G)),G}const de=new Map;function me(q,O={}){const{base:H,...G}=O,ee=JSON.stringify([q,G]);let ye=de.get(ee);return ye===void 0&&(ye=new Intl.RelativeTimeFormat(q,O),de.set(ee,ye)),ye}let Qe=null;function Me(){return Qe||(Qe=new Intl.DateTimeFormat().resolvedOptions().locale,Qe)}const we=new Map;function Se(q){let O=we.get(q);return O===void 0&&(O=new Intl.DateTimeFormat(q).resolvedOptions(),we.set(q,O)),O}const dt=new Map;function ze(q){let O=dt.get(q);if(!O){const H=new Intl.Locale(q);O="getWeekInfo"in H?H.getWeekInfo():H.weekInfo,"minimalDays"in O||(O={...ft,...O}),dt.set(q,O)}return O}function tt(q){const O=q.indexOf("-x-");O!==-1&&(q=q.substring(0,O));const H=q.indexOf("-u-");if(H===-1)return[q];{let G,ee;try{G=xe(q).resolvedOptions(),ee=q}catch{const De=q.substring(0,H);G=xe(De).resolvedOptions(),ee=De}const{numberingSystem:ye,calendar:Ee}=G;return[ee,ye,Ee]}}function Ze(q,O,H){return(H||O)&&(q.includes("-u-")||(q+="-u"),H&&(q+=`-ca-${H}`),O&&(q+=`-nu-${O}`)),q}function qt(q){const O=[];for(let H=1;H<=12;H++){const G=nn.utc(2009,H,1);O.push(q(G))}return O}function Vt(q){const O=[];for(let H=1;H<=7;H++){const G=nn.utc(2016,11,13+H);O.push(q(G))}return O}function Mt(q,O,H,G){const ee=q.listingMode();return ee==="error"?null:ee==="en"?H(O):G(O)}function ke(q){return q.numberingSystem&&q.numberingSystem!=="latn"?!1:q.numberingSystem==="latn"||!q.locale||q.locale.startsWith("en")||Se(q.locale).numberingSystem==="latn"}class Ne{constructor(O,H,G){this.padTo=G.padTo||0,this.floor=G.floor||!1;const{padTo:ee,floor:ye,...Ee}=G;if(!H||Object.keys(Ee).length>0){const De={useGrouping:!1,...G};G.padTo>0&&(De.minimumIntegerDigits=G.padTo),this.inf=Re(O,De)}}format(O){if(this.inf){const H=this.floor?Math.floor(O):O;return this.inf.format(H)}else{const H=this.floor?Math.floor(O):cf(O,3);return pr(H,this.padTo)}}}class lt{constructor(O,H,G){this.opts=G,this.originalZone=void 0;let ee;if(this.opts.timeZone)this.dt=O;else if(O.zone.type==="fixed"){const Ee=-1*(O.offset/60),De=Ee>=0?`Etc/GMT+${Ee}`:`Etc/GMT${Ee}`;O.offset!==0&&X.create(De).valid?(ee=De,this.dt=O):(ee="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,ee=O.zone.name):(ee="UTC",this.dt=O.setZone("UTC").plus({minutes:O.offset}),this.originalZone=O.zone);const ye={...this.opts};ye.timeZone=ye.timeZone||ee,this.dtf=xe(H,ye)}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(H=>{if(H.type==="timeZoneName"){const G=this.originalZone.offsetName(this.dt.ts,{locale:this.dt.locale,format:this.opts.timeZoneName});return{...H,value:G}}else return H}):O}resolvedOptions(){return this.dtf.resolvedOptions()}}class St{constructor(O,H,G){this.opts={style:"long",...G},!H&&qr()&&(this.rtf=me(O,G))}format(O,H){return this.rtf?this.rtf.format(O,H):pf(H,O,this.opts.numeric,this.opts.style!=="long")}formatToParts(O,H){return this.rtf?this.rtf.formatToParts(O,H):[]}}const ft={firstDay:1,minimalDays:4,weekend:[6,7]};class $e{static fromOpts(O){return $e.create(O.locale,O.numberingSystem,O.outputCalendar,O.weekSettings,O.defaultToEN)}static create(O,H,G,ee,ye=!1){const Ee=O||Ve.defaultLocale,De=Ee||(ye?"en-US":Me()),Le=H||Ve.defaultNumberingSystem,Ct=G||Ve.defaultOutputCalendar,on=_o(ee)||Ve.defaultWeekSettings;return new $e(De,Le,Ct,on,Ee)}static resetCache(){Qe=null,fe.clear(),ge.clear(),de.clear(),we.clear(),dt.clear()}static fromObject({locale:O,numberingSystem:H,outputCalendar:G,weekSettings:ee}={}){return $e.create(O,H,G,ee)}constructor(O,H,G,ee,ye){const[Ee,De,Le]=tt(O);this.locale=Ee,this.numberingSystem=H||De||null,this.outputCalendar=G||Le||null,this.weekSettings=ee,this.intl=Ze(this.locale,this.numberingSystem,this.outputCalendar),this.weekdaysCache={format:{},standalone:{}},this.monthsCache={format:{},standalone:{}},this.meridiemCache=null,this.eraCache={},this.specifiedLocale=ye,this.fastNumbersCached=null}get fastNumbers(){return this.fastNumbersCached==null&&(this.fastNumbersCached=ke(this)),this.fastNumbersCached}listingMode(){const O=this.isEnglish(),H=(this.numberingSystem===null||this.numberingSystem==="latn")&&(this.outputCalendar===null||this.outputCalendar==="gregory");return O&&H?"en":"intl"}clone(O){return!O||Object.getOwnPropertyNames(O).length===0?this:$e.create(O.locale||this.specifiedLocale,O.numberingSystem||this.numberingSystem,O.outputCalendar||this.outputCalendar,_o(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,H=!1){return Mt(this,O,$u,()=>{const G=this.intl==="ja"||this.intl.startsWith("ja-");H&=!G;const ee=H?{month:O,day:"numeric"}:{month:O},ye=H?"format":"standalone";if(!this.monthsCache[ye][O]){const Ee=G?De=>this.dtFormatter(De,ee).format():De=>this.extract(De,ee,"month");this.monthsCache[ye][O]=qt(Ee)}return this.monthsCache[ye][O]})}weekdays(O,H=!1){return Mt(this,O,Il,()=>{const G=H?{weekday:O,year:"numeric",month:"long",day:"numeric"}:{weekday:O},ee=H?"format":"standalone";return this.weekdaysCache[ee][O]||(this.weekdaysCache[ee][O]=Vt(ye=>this.extract(ye,G,"weekday"))),this.weekdaysCache[ee][O]})}meridiems(){return Mt(this,void 0,()=>Rh,()=>{if(!this.meridiemCache){const O={hour:"numeric",hourCycle:"h12"};this.meridiemCache=[nn.utc(2016,11,13,9),nn.utc(2016,11,13,19)].map(H=>this.extract(H,O,"dayperiod"))}return this.meridiemCache})}eras(O){return Mt(this,O,Ri,()=>{const H={era:O};return this.eraCache[O]||(this.eraCache[O]=[nn.utc(-40,1,1),nn.utc(2017,1,1)].map(G=>this.extract(G,H,"era"))),this.eraCache[O]})}extract(O,H,G){const ee=this.dtFormatter(O,H),ye=ee.formatToParts(),Ee=ye.find(De=>De.type.toLowerCase()===G);return Ee?Ee.value:null}numberFormatter(O={}){return new Ne(this.intl,O.forceSimple||this.fastNumbers,O)}dtFormatter(O,H={}){return new lt(O,this.intl,H)}relFormatter(O={}){return new St(this.intl,this.isEnglish(),O)}listFormatter(O={}){return ae(this.intl,O)}isEnglish(){return this.locale==="en"||this.locale.toLowerCase()==="en-us"||Se(this.intl).locale.startsWith("en-us")}getWeekSettings(){return this.weekSettings?this.weekSettings:en()?ze(this.locale):ft}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 Ht=null;class $t extends K{static get utcInstance(){return Ht===null&&(Ht=new $t(0)),Ht}static instance(O){return O===0?$t.utcInstance:new $t(O)}static parseSpecifier(O){if(O){const H=O.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);if(H)return new $t(ju(H[1],H[2]))}return null}constructor(O){super(),this.fixed=O}get type(){return"fixed"}get name(){return this.fixed===0?"UTC":`UTC${Sc(this.fixed,"narrow")}`}get ianaName(){return this.fixed===0?"Etc/UTC":`Etc/GMT${Sc(-this.fixed,"narrow")}`}offsetName(){return this.name}formatOffset(O,H){return Sc(this.fixed,H)}get isUniversal(){return!0}offset(){return this.fixed}equals(O){return O.type==="fixed"&&O.fixed===this.fixed}get isValid(){return!0}}class pt extends K{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 Te(q,O){if(qe(q)||q===null)return O;if(q instanceof K)return q;if(vr(q)){const H=q.toLowerCase();return H==="default"?O:H==="local"||H==="system"?te.instance:H==="utc"||H==="gmt"?$t.utcInstance:$t.parseSpecifier(H)||X.create(q)}else return Zt(q)?$t.instance(q):typeof q=="object"&&"offset"in q&&typeof q.offset=="function"?q:new pt(q)}const Ue={arab:"[٠-٩]",arabext:"[۰-۹]",bali:"[᭐-᭙]",beng:"[০-৯]",deva:"[०-९]",fullwide:"[0-9]",gujr:"[૦-૯]",hanidec:"[〇|一|二|三|四|五|六|七|八|九]",khmr:"[០-៩]",knda:"[೦-೯]",laoo:"[໐-໙]",limb:"[᥆-᥏]",mlym:"[൦-൯]",mong:"[᠐-᠙]",mymr:"[၀-၉]",orya:"[୦-୯]",tamldec:"[௦-௯]",telu:"[౦-౯]",thai:"[๐-๙]",tibt:"[༠-༩]",latn:"\\d"},yt={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]},ht=Ue.hanidec.replace(/[\[|\]]/g,"").split("");function Cn(q){let O=parseInt(q,10);if(isNaN(O)){O="";for(let H=0;H<q.length;H++){const G=q.charCodeAt(H);if(q[H].search(Ue.hanidec)!==-1)O+=ht.indexOf(q[H]);else for(const ee in yt){const[ye,Ee]=yt[ee];G>=ye&&G<=Ee&&(O+=G-ye)}}return parseInt(O,10)}else return O}const On=new Map;function In(){On.clear()}function pn({numberingSystem:q},O=""){const H=q||"latn";let G=On.get(H);G===void 0&&(G=new Map,On.set(H,G));let ee=G.get(O);return ee===void 0&&(ee=new RegExp(`${Ue[H]}${O}`),G.set(O,ee)),ee}let Gn=()=>Date.now(),Hn="system",wn=null,or=null,Wt=null,he=60,Ae,Ie=null;class Ve{static get now(){return Gn}static set now(O){Gn=O}static set defaultZone(O){Hn=O}static get defaultZone(){return Te(Hn,te.instance)}static get defaultLocale(){return wn}static set defaultLocale(O){wn=O}static get defaultNumberingSystem(){return or}static set defaultNumberingSystem(O){or=O}static get defaultOutputCalendar(){return Wt}static set defaultOutputCalendar(O){Wt=O}static get defaultWeekSettings(){return Ie}static set defaultWeekSettings(O){Ie=_o(O)}static get twoDigitCutoffYear(){return he}static set twoDigitCutoffYear(O){he=O%100}static get throwOnInvalid(){return Ae}static set throwOnInvalid(O){Ae=O}static resetCaches(){$e.resetCache(),X.resetCache(),nn.resetCache(),In()}}class ot{constructor(O,H){this.reason=O,this.explanation=H}toMessage(){return this.explanation?`${this.reason}: ${this.explanation}`:this.reason}}const It=[0,31,59,90,120,151,181,212,243,273,304,334],Ft=[0,31,60,91,121,152,182,213,244,274,305,335];function Rt(q,O){return new ot("unit out of range",`you specified ${O} (of type ${typeof O}) as a ${q}, which is invalid`)}function jt(q,O,H){const G=new Date(Date.UTC(q,O-1,H));q<100&&q>=0&&G.setUTCFullYear(G.getUTCFullYear()-1900);const ee=G.getUTCDay();return ee===0?7:ee}function Nt(q,O,H){return H+(zs(q)?Ft:It)[O-1]}function kt(q,O){const H=zs(q)?Ft:It,G=H.findIndex(ye=>ye<O),ee=O-H[G];return{month:G+1,day:ee}}function Et(q,O){return(q-O+7)%7+1}function Bt(q,O=4,H=1){const{year:G,month:ee,day:ye}=q,Ee=Nt(G,ee,ye),De=Et(jt(G,ee,ye),H);let Le=Math.floor((Ee-De+14-O)/7),Ct;return Le<1?(Ct=G-1,Le=Nl(Ct,O,H)):Le>Nl(G,O,H)?(Ct=G+1,Le=1):Ct=G,{weekYear:Ct,weekNumber:Le,weekday:De,...Bu(q)}}function Tn(q,O=4,H=1){const{weekYear:G,weekNumber:ee,weekday:ye}=q,Ee=Et(jt(G,1,O),H),De=vc(G);let Le=ee*7+ye-Ee-7+O,Ct;Le<1?(Ct=G-1,Le+=vc(Ct)):Le>De?(Ct=G+1,Le-=vc(G)):Ct=G;const{month:on,day:Sn}=kt(Ct,Le);return{year:Ct,month:on,day:Sn,...Bu(q)}}function nr(q){const{year:O,month:H,day:G}=q,ee=Nt(O,H,G);return{year:O,ordinal:ee,...Bu(q)}}function Yn(q){const{year:O,ordinal:H}=q,{month:G,day:ee}=kt(O,H);return{year:O,month:G,day:ee,...Bu(q)}}function rn(q,O){if(!qe(q.localWeekday)||!qe(q.localWeekNumber)||!qe(q.localWeekYear)){if(!qe(q.weekday)||!qe(q.weekNumber)||!qe(q.weekYear))throw new o("Cannot mix locale-based week fields with ISO-based week fields");return qe(q.localWeekday)||(q.weekday=q.localWeekday),qe(q.localWeekNumber)||(q.weekNumber=q.localWeekNumber),qe(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 le(q,O=4,H=1){const G=an(q.weekYear),ee=Vo(q.weekNumber,1,Nl(q.weekYear,O,H)),ye=Vo(q.weekday,1,7);return G?ee?ye?!1:Rt("weekday",q.weekday):Rt("week",q.weekNumber):Rt("weekYear",q.weekYear)}function ce(q){const O=an(q.year),H=Vo(q.ordinal,1,vc(q.year));return O?H?!1:Rt("ordinal",q.ordinal):Rt("year",q.year)}function Be(q){const O=an(q.year),H=Vo(q.month,1,12),G=Vo(q.day,1,Wo(q.year,q.month));return O?H?G?!1:Rt("day",q.day):Rt("month",q.month):Rt("year",q.year)}function ut(q){const{hour:O,minute:H,second:G,millisecond:ee}=q,ye=Vo(O,0,23)||O===24&&H===0&&G===0&&ee===0,Ee=Vo(H,0,59),De=Vo(G,0,59),Le=Vo(ee,0,999);return ye?Ee?De?Le?!1:Rt("millisecond",ee):Rt("second",G):Rt("minute",H):Rt("hour",O)}function qe(q){return typeof q>"u"}function Zt(q){return typeof q=="number"}function an(q){return typeof q=="number"&&q%1===0}function vr(q){return typeof q=="string"}function sn(q){return Object.prototype.toString.call(q)==="[object Date]"}function qr(){try{return typeof Intl<"u"&&!!Intl.RelativeTimeFormat}catch{return!1}}function en(){try{return typeof Intl<"u"&&!!Intl.Locale&&("weekInfo"in Intl.Locale.prototype||"getWeekInfo"in Intl.Locale.prototype)}catch{return!1}}function gr(q){return Array.isArray(q)?q:[q]}function kn(q,O,H){if(q.length!==0)return q.reduce((G,ee)=>{const ye=[O(ee),ee];return G&&H(G[0],ye[0])===G[0]?G:ye},null)[1]}function zr(q,O){return O.reduce((H,G)=>(H[G]=q[G],H),{})}function $n(q,O){return Object.prototype.hasOwnProperty.call(q,O)}function _o(q){if(q==null)return null;if(typeof q!="object")throw new i("Week settings must be an object");if(!Vo(q.firstDay,1,7)||!Vo(q.minimalDays,1,7)||!Array.isArray(q.weekend)||q.weekend.some(O=>!Vo(O,1,7)))throw new i("Invalid week settings");return{firstDay:q.firstDay,minimalDays:q.minimalDays,weekend:Array.from(q.weekend)}}function Vo(q,O,H){return an(q)&&q>=O&&q<=H}function lf(q,O){return q-O*Math.floor(q/O)}function pr(q,O=2){const H=q<0;let G;return H?G="-"+(""+-q).padStart(O,"0"):G=(""+q).padStart(O,"0"),G}function ys(q){if(!(qe(q)||q===null||q===""))return parseInt(q,10)}function Ml(q){if(!(qe(q)||q===null||q===""))return parseFloat(q)}function bc(q){if(!(qe(q)||q===null||q==="")){const O=parseFloat("0."+q)*1e3;return Math.floor(O)}}function cf(q,O,H="round"){const G=10**O;switch(H){case"expand":return q>0?Math.ceil(q*G)/G:Math.floor(q*G)/G;case"trunc":return Math.trunc(q*G)/G;case"round":return Math.round(q*G)/G;case"floor":return Math.floor(q*G)/G;case"ceil":return Math.ceil(q*G)/G;default:throw new RangeError(`Value rounding ${H} is out of range`)}}function zs(q){return q%4===0&&(q%100!==0||q%400===0)}function vc(q){return zs(q)?366:365}function Wo(q,O){const H=lf(O-1,12)+1,G=q+(O-H)/12;return H===2?zs(G)?29:28:[31,null,31,30,31,30,31,31,30,31,30,31][H-1]}function xc(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 Ah(q,O,H){return-Et(jt(q,1,O),H)+O-1}function Nl(q,O=4,H=1){const G=Ah(q,O,H),ee=Ah(q+1,O,H);return(vc(q)-G+ee)/7}function Hs(q){return q>99?q:q>Ve.twoDigitCutoffYear?1900+q:2e3+q}function Dh(q,O,H,G=null){const ee=new Date(q),ye={hourCycle:"h23",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"};G&&(ye.timeZone=G);const Ee={timeZoneName:O,...ye},De=new Intl.DateTimeFormat(H,Ee).formatToParts(ee).find(Le=>Le.type.toLowerCase()==="timezonename");return De?De.value:null}function ju(q,O){let H=parseInt(q,10);Number.isNaN(H)&&(H=0);const G=parseInt(O,10)||0,ee=H<0||Object.is(H,-0)?-G:G;return H*60+ee}function Pl(q){const O=Number(q);if(typeof q=="boolean"||q===""||!Number.isFinite(O))throw new i(`Invalid unit value ${q}`);return O}function uf(q,O){const H={};for(const G in q)if($n(q,G)){const ee=q[G];if(ee==null)continue;H[O(G)]=Pl(ee)}return H}function Sc(q,O){const H=Math.trunc(Math.abs(q/60)),G=Math.trunc(Math.abs(q%60)),ee=q>=0?"+":"-";switch(O){case"short":return`${ee}${pr(H,2)}:${pr(G,2)}`;case"narrow":return`${ee}${H}${G>0?`:${G}`:""}`;case"techie":return`${ee}${pr(H,2)}${pr(G,2)}`;default:throw new RangeError(`Value format ${O} is out of range for property format`)}}function Bu(q){return zr(q,["hour","minute","second","millisecond"])}const Oh=["January","February","March","April","May","June","July","August","September","October","November","December"],_b=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],WS=["J","F","M","A","M","J","J","A","S","O","N","D"];function $u(q){switch(q){case"narrow":return[...WS];case"short":return[..._b];case"long":return[...Oh];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 df=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],ff=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],Ec=["M","T","W","T","F","S","S"];function Il(q){switch(q){case"narrow":return[...Ec];case"short":return[...ff];case"long":return[...df];case"numeric":return["1","2","3","4","5","6","7"];default:return null}}const Rh=["AM","PM"],Mh=["Before Christ","Anno Domini"],Lb=["BC","AD"],zu=["B","A"];function Ri(q){switch(q){case"narrow":return[...zu];case"short":return[...Lb];case"long":return[...Mh];default:return null}}function Nh(q){return Rh[q.hour<12?0:1]}function Hu(q,O){return Il(O)[q.weekday-1]}function Us(q,O){return $u(O)[q.month-1]}function Ph(q,O){return Ri(O)[q.year<0?0:1]}function pf(q,O,H="always",G=!1){const ee={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."]},ye=["hours","minutes","seconds"].indexOf(q)===-1;if(H==="auto"&&ye){const Sn=q==="days";switch(O){case 1:return Sn?"tomorrow":`next ${ee[q][0]}`;case-1:return Sn?"yesterday":`last ${ee[q][0]}`;case 0:return Sn?"today":`this ${ee[q][0]}`}}const Ee=Object.is(O,-0)||O<0,De=Math.abs(O),Le=De===1,Ct=ee[q],on=G?Le?Ct[1]:Ct[2]||Ct[1]:Le?ee[q][0]:q;return Ee?`${De} ${on} ago`:`in ${De} ${on}`}function Ih(q,O){let H="";for(const G of q)G.literal?H+=G.val:H+=O(G.val);return H}const hf={D:p,DD:y,DDD:b,DDDD:x,t:E,tt:S,ttt:w,tttt:C,T:R,TT:M,TTT:D,TTTT:I,f:L,ff:B,fff:$,ffff:V,F,FF:U,FFF:j,FFFF:z};class po{static create(O,H={}){return new po(O,H)}static parseFormat(O){let H=null,G="",ee=!1;const ye=[];for(let Ee=0;Ee<O.length;Ee++){const De=O.charAt(Ee);De==="'"?((G.length>0||ee)&&ye.push({literal:ee||/^\s+$/.test(G),val:G===""?"'":G}),H=null,G="",ee=!ee):ee||De===H?G+=De:(G.length>0&&ye.push({literal:/^\s+$/.test(G),val:G}),G=De,H=De)}return G.length>0&&ye.push({literal:ee||/^\s+$/.test(G),val:G}),ye}static macroTokenToFormatOpts(O){return hf[O]}constructor(O,H){this.opts=H,this.loc=O,this.systemLoc=null}formatWithSystemDefault(O,H){return this.systemLoc===null&&(this.systemLoc=this.loc.redefaultToSystem()),this.systemLoc.dtFormatter(O,{...this.opts,...H}).format()}dtFormatter(O,H={}){return this.loc.dtFormatter(O,{...this.opts,...H})}formatDateTime(O,H){return this.dtFormatter(O,H).format()}formatDateTimeParts(O,H){return this.dtFormatter(O,H).formatToParts()}formatInterval(O,H){return this.dtFormatter(O.start,H).dtf.formatRange(O.start.toJSDate(),O.end.toJSDate())}resolvedOptions(O,H){return this.dtFormatter(O,H).resolvedOptions()}num(O,H=0,G=void 0){if(this.opts.forceSimple)return pr(O,H);const ee={...this.opts};return H>0&&(ee.padTo=H),G&&(ee.signDisplay=G),this.loc.numberFormatter(ee).format(O)}formatDateTimeFromString(O,H){const G=this.loc.listingMode()==="en",ee=this.loc.outputCalendar&&this.loc.outputCalendar!=="gregory",ye=(ln,Gr)=>this.loc.extract(O,ln,Gr),Ee=ln=>O.isOffsetFixed&&O.offset===0&&ln.allowZ?"Z":O.isValid?O.zone.formatOffset(O.ts,ln.format):"",De=()=>G?Nh(O):ye({hour:"numeric",hourCycle:"h12"},"dayperiod"),Le=(ln,Gr)=>G?Us(O,ln):ye(Gr?{month:ln}:{month:ln,day:"numeric"},"month"),Ct=(ln,Gr)=>G?Hu(O,ln):ye(Gr?{weekday:ln}:{weekday:ln,month:"long",day:"numeric"},"weekday"),on=ln=>{const Gr=po.macroTokenToFormatOpts(ln);return Gr?this.formatWithSystemDefault(O,Gr):ln},Sn=ln=>G?Ph(O,ln):ye({era:ln},"era"),ir=ln=>{switch(ln){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 Ee({format:"narrow",allowZ:this.opts.allowZ});case"ZZ":return Ee({format:"short",allowZ:this.opts.allowZ});case"ZZZ":return Ee({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 De();case"d":return ee?ye({day:"numeric"},"day"):this.num(O.day);case"dd":return ee?ye({day:"2-digit"},"day"):this.num(O.day,2);case"c":return this.num(O.weekday);case"ccc":return Ct("short",!0);case"cccc":return Ct("long",!0);case"ccccc":return Ct("narrow",!0);case"E":return this.num(O.weekday);case"EEE":return Ct("short",!1);case"EEEE":return Ct("long",!1);case"EEEEE":return Ct("narrow",!1);case"L":return ee?ye({month:"numeric",day:"numeric"},"month"):this.num(O.month);case"LL":return ee?ye({month:"2-digit",day:"numeric"},"month"):this.num(O.month,2);case"LLL":return Le("short",!0);case"LLLL":return Le("long",!0);case"LLLLL":return Le("narrow",!0);case"M":return ee?ye({month:"numeric"},"month"):this.num(O.month);case"MM":return ee?ye({month:"2-digit"},"month"):this.num(O.month,2);case"MMM":return Le("short",!1);case"MMMM":return Le("long",!1);case"MMMMM":return Le("narrow",!1);case"y":return ee?ye({year:"numeric"},"year"):this.num(O.year);case"yy":return ee?ye({year:"2-digit"},"year"):this.num(O.year.toString().slice(-2),2);case"yyyy":return ee?ye({year:"numeric"},"year"):this.num(O.year,4);case"yyyyyy":return ee?ye({year:"numeric"},"year"):this.num(O.year,6);case"G":return Sn("short");case"GG":return Sn("long");case"GGGGG":return Sn("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 on(ln)}};return Ih(po.parseFormat(H),ir)}formatDurationFromString(O,H){const G=this.opts.signMode==="negativeLargestOnly"?-1:1,ee=on=>{switch(on[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}},ye=(on,Sn)=>ir=>{const ln=ee(ir);if(ln){const Gr=Sn.isNegativeDuration&&ln!==Sn.largestUnit?G:1;let Lo;return this.opts.signMode==="negativeLargestOnly"&&ln!==Sn.largestUnit?Lo="never":this.opts.signMode==="all"?Lo="always":Lo="auto",this.num(on.get(ln)*Gr,ir.length,Lo)}else return ir},Ee=po.parseFormat(H),De=Ee.reduce((on,{literal:Sn,val:ir})=>Sn?on:on.concat(ir),[]),Le=O.shiftTo(...De.map(ee).filter(on=>on)),Ct={isNegativeDuration:Le<0,largestUnit:Object.keys(Le.values)[0]};return Ih(Ee,ye(Le,Ct))}}const _h=/[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/;function ho(...q){const O=q.reduce((H,G)=>H+G.source,"");return RegExp(`^${O}$`)}function ka(...q){return O=>q.reduce(([H,G,ee],ye)=>{const[Ee,De,Le]=ye(O,ee);return[{...H,...Ee},De||G,Le]},[{},null,1]).slice(0,2)}function bs(q,...O){if(q==null)return[null,null];for(const[H,G]of O){const ee=H.exec(q);if(ee)return G(ee)}return[null,null]}function Cc(...q){return(O,H)=>{const G={};let ee;for(ee=0;ee<q.length;ee++)G[q[ee]]=ys(O[H+ee]);return[G,null,H+ee]}}const Fb=/(?:([Zz])|([+-]\d\d)(?::?(\d\d))?)/,Lh=`(?:${Fb.source}?(?:\\[(${_h.source})\\])?)?`,Uu=/(\d\d)(?::?(\d\d)(?::?(\d\d)(?:[.,](\d{1,30}))?)?)?/,Tc=RegExp(`${Uu.source}${Lh}`),wc=RegExp(`(?:[Tt]${Tc.source})?`),jb=/([+-]\d{6}|\d{4})(?:-?(\d\d)(?:-?(\d\d))?)?/,qS=/(\d{4})-?W(\d\d)(?:-?(\d))?/,GS=/(\d{4})-?(\d{3})/,YS=Cc("weekYear","weekNumber","weekDay"),Fh=Cc("year","ordinal"),KS=/(\d{4})-(\d\d)-(\d\d)/,Bb=RegExp(`${Uu.source} ?(?:${Fb.source}|(${_h.source}))?`),QS=RegExp(`(?: ${Bb.source})?`);function kc(q,O,H){const G=q[O];return qe(G)?H:ys(G)}function XS(q,O){return[{year:kc(q,O),month:kc(q,O+1,1),day:kc(q,O+2,1)},null,O+3]}function _l(q,O){return[{hours:kc(q,O,0),minutes:kc(q,O+1,0),seconds:kc(q,O+2,0),milliseconds:bc(q[O+3])},null,O+4]}function Vu(q,O){const H=!q[O]&&!q[O+1],G=ju(q[O+1],q[O+2]),ee=H?null:$t.instance(G);return[{},ee,O+3]}function Wu(q,O){const H=q[O]?X.create(q[O]):null;return[{},H,O+1]}const ZS=RegExp(`^T?${Uu.source}$`),JS=/^-?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 jh(q){const[O,H,G,ee,ye,Ee,De,Le,Ct]=q,on=O[0]==="-",Sn=Le&&Le[0]==="-",ir=(ln,Gr=!1)=>ln!==void 0&&(Gr||ln&&on)?-ln:ln;return[{years:ir(Ml(H)),months:ir(Ml(G)),weeks:ir(Ml(ee)),days:ir(Ml(ye)),hours:ir(Ml(Ee)),minutes:ir(Ml(De)),seconds:ir(Ml(Le),Le==="-0"),milliseconds:ir(bc(Ct),Sn)}]}const eE={GMT:0,EDT:-240,EST:-300,CDT:-300,CST:-360,MDT:-360,MST:-420,PDT:-420,PST:-480};function Bh(q,O,H,G,ee,ye,Ee){const De={year:O.length===2?Hs(ys(O)):ys(O),month:_b.indexOf(H)+1,day:ys(G),hour:ys(ee),minute:ys(ye)};return Ee&&(De.second=ys(Ee)),q&&(De.weekday=q.length>3?df.indexOf(q)+1:ff.indexOf(q)+1),De}const tE=/^(?:(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 $b(q){const[,O,H,G,ee,ye,Ee,De,Le,Ct,on,Sn]=q,ir=Bh(O,ee,G,H,ye,Ee,De);let ln;return Le?ln=eE[Le]:Ct?ln=0:ln=ju(on,Sn),[ir,new $t(ln)]}function nE(q){return q.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").trim()}const rE=/^(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$/,oE=/^(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$/,aE=/^(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 zb(q){const[,O,H,G,ee,ye,Ee,De]=q;return[Bh(O,ee,G,H,ye,Ee,De),$t.utcInstance]}function iE(q){const[,O,H,G,ee,ye,Ee,De]=q;return[Bh(O,De,H,G,ee,ye,Ee),$t.utcInstance]}const sE=ho(jb,wc),lE=ho(qS,wc),cE=ho(GS,wc),$h=ho(Tc),Ac=ka(XS,_l,Vu,Wu),uE=ka(YS,_l,Vu,Wu),Hb=ka(Fh,_l,Vu,Wu),Ub=ka(_l,Vu,Wu);function Vb(q){return bs(q,[sE,Ac],[lE,uE],[cE,Hb],[$h,Ub])}function Wb(q){return bs(nE(q),[tE,$b])}function qb(q){return bs(q,[rE,zb],[oE,zb],[aE,iE])}function Dc(q){return bs(q,[JS,jh])}const dE=ka(_l);function fE(q){return bs(q,[ZS,dE])}const pE=ho(KS,QS),Gb=ho(Bb),Yb=ka(_l,Vu,Wu);function qu(q){return bs(q,[pE,Ac],[Gb,Yb])}const Oc="Invalid Duration",Kb={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}},mf={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},...Kb},fa=146097/400,Ll=146097/4800,zh={years:{quarters:4,months:12,weeks:fa/7,days:fa,hours:fa*24,minutes:fa*24*60,seconds:fa*24*60*60,milliseconds:fa*24*60*60*1e3},quarters:{months:3,weeks:fa/28,days:fa/4,hours:fa*24/4,minutes:fa*24*60/4,seconds:fa*24*60*60/4,milliseconds:fa*24*60*60*1e3/4},months:{weeks:Ll/7,days:Ll,hours:Ll*24,minutes:Ll*24*60,seconds:Ll*24*60*60,milliseconds:Ll*24*60*60*1e3},...Kb},vs=["years","quarters","months","weeks","days","hours","minutes","seconds","milliseconds"],Qb=vs.slice(0).reverse();function Mi(q,O,H=!1){const G={values:H?O.values:{...q.values,...O.values||{}},loc:q.loc.clone(O.loc),conversionAccuracy:O.conversionAccuracy||q.conversionAccuracy,matrix:O.matrix||q.matrix};return new rr(G)}function Hh(q,O){var H;let G=(H=O.milliseconds)!=null?H:0;for(const ee of Qb.slice(1))O[ee]&&(G+=O[ee]*q[ee].milliseconds);return G}function Xb(q,O){const H=Hh(q,O)<0?-1:1;vs.reduceRight((G,ee)=>{if(qe(O[ee]))return G;if(G){const ye=O[G]*H,Ee=q[ee][G],De=Math.floor(ye/Ee);O[ee]+=De*H,O[G]-=De*Ee*H}return ee},null),vs.reduce((G,ee)=>{if(qe(O[ee]))return G;if(G){const ye=O[G]%1;O[G]-=ye,O[ee]+=ye*q[G][ee]}return ee},null)}function Zb(q){const O={};for(const[H,G]of Object.entries(q))G!==0&&(O[H]=G);return O}class rr{constructor(O){const H=O.conversionAccuracy==="longterm"||!1;let G=H?zh:mf;O.matrix&&(G=O.matrix),this.values=O.values,this.loc=O.loc||$e.create(),this.conversionAccuracy=H?"longterm":"casual",this.invalid=O.invalid||null,this.matrix=G,this.isLuxonDuration=!0}static fromMillis(O,H){return rr.fromObject({milliseconds:O},H)}static fromObject(O,H={}){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 rr({values:uf(O,rr.normalizeUnit),loc:$e.fromObject(H),conversionAccuracy:H.conversionAccuracy,matrix:H.matrix})}static fromDurationLike(O){if(Zt(O))return rr.fromMillis(O);if(rr.isDuration(O))return O;if(typeof O=="object")return rr.fromObject(O);throw new i(`Unknown duration argument ${O} of type ${typeof O}`)}static fromISO(O,H){const[G]=Dc(O);return G?rr.fromObject(G,H):rr.invalid("unparsable",`the input "${O}" can't be parsed as ISO 8601`)}static fromISOTime(O,H){const[G]=fE(O);return G?rr.fromObject(G,H):rr.invalid("unparsable",`the input "${O}" can't be parsed as ISO 8601`)}static invalid(O,H=null){if(!O)throw new i("need to specify a reason the Duration is invalid");const G=O instanceof ot?O:new ot(O,H);if(Ve.throwOnInvalid)throw new r(G);return new rr({invalid:G})}static normalizeUnit(O){const H={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(!H)throw new a(O);return H}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,H={}){const G={...H,floor:H.round!==!1&&H.floor!==!1};return this.isValid?po.create(this.loc,G).formatDurationFromString(this,O):Oc}toHuman(O={}){if(!this.isValid)return Oc;const H=O.showZeros!==!1,G=vs.map(ee=>{const ye=this.values[ee];return qe(ye)||ye===0&&!H?null:this.loc.numberFormatter({style:"unit",unitDisplay:"long",...O,unit:ee.slice(0,-1)}).format(ye)}).filter(ee=>ee);return this.loc.listFormatter({type:"conjunction",style:O.listStyle||"narrow",...O}).format(G)}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+=cf(this.seconds+this.milliseconds/1e3,3)+"S"),O==="P"&&(O+="T0S"),O}toISOTime(O={}){if(!this.isValid)return null;const H=this.toMillis();return H<0||H>=864e5?null:(O={suppressMilliseconds:!1,suppressSeconds:!1,includePrefix:!1,format:"extended",...O,includeOffset:!1},nn.fromMillis(H,{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?Hh(this.matrix,this.values):NaN}valueOf(){return this.toMillis()}plus(O){if(!this.isValid)return this;const H=rr.fromDurationLike(O),G={};for(const ee of vs)($n(H.values,ee)||$n(this.values,ee))&&(G[ee]=H.get(ee)+this.get(ee));return Mi(this,{values:G},!0)}minus(O){if(!this.isValid)return this;const H=rr.fromDurationLike(O);return this.plus(H.negate())}mapUnits(O){if(!this.isValid)return this;const H={};for(const G of Object.keys(this.values))H[G]=Pl(O(this.values[G],G));return Mi(this,{values:H},!0)}get(O){return this[rr.normalizeUnit(O)]}set(O){if(!this.isValid)return this;const H={...this.values,...uf(O,rr.normalizeUnit)};return Mi(this,{values:H})}reconfigure({locale:O,numberingSystem:H,conversionAccuracy:G,matrix:ee}={}){const ye={loc:this.loc.clone({locale:O,numberingSystem:H}),matrix:ee,conversionAccuracy:G};return Mi(this,ye)}as(O){return this.isValid?this.shiftTo(O).get(O):NaN}normalize(){if(!this.isValid)return this;const O=this.toObject();return Xb(this.matrix,O),Mi(this,{values:O},!0)}rescale(){if(!this.isValid)return this;const O=Zb(this.normalize().shiftToAll().toObject());return Mi(this,{values:O},!0)}shiftTo(...O){if(!this.isValid)return this;if(O.length===0)return this;O=O.map(Ee=>rr.normalizeUnit(Ee));const H={},G={},ee=this.toObject();let ye;for(const Ee of vs)if(O.indexOf(Ee)>=0){ye=Ee;let De=0;for(const Ct in G)De+=this.matrix[Ct][Ee]*G[Ct],G[Ct]=0;Zt(ee[Ee])&&(De+=ee[Ee]);const Le=Math.trunc(De);H[Ee]=Le,G[Ee]=(De*1e3-Le*1e3)/1e3}else Zt(ee[Ee])&&(G[Ee]=ee[Ee]);for(const Ee in G)G[Ee]!==0&&(H[ye]+=Ee===ye?G[Ee]:G[Ee]/this.matrix[ye][Ee]);return Xb(this.matrix,H),Mi(this,{values:H},!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 H of Object.keys(this.values))O[H]=this.values[H]===0?0:-this.values[H];return Mi(this,{values:O},!0)}removeZeros(){if(!this.isValid)return this;const O=Zb(this.values);return Mi(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 H(G,ee){return G===void 0||G===0?ee===void 0||ee===0:G===ee}for(const G of vs)if(!H(this.values[G],O.values[G]))return!1;return!0}}const Rc="Invalid Interval";function hE(q,O){return!q||!q.isValid?Kn.invalid("missing or invalid start"):!O||!O.isValid?Kn.invalid("missing or invalid end"):O<q?Kn.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 Kn{constructor(O){this.s=O.start,this.e=O.end,this.invalid=O.invalid||null,this.isLuxonInterval=!0}static invalid(O,H=null){if(!O)throw new i("need to specify a reason the Interval is invalid");const G=O instanceof ot?O:new ot(O,H);if(Ve.throwOnInvalid)throw new n(G);return new Kn({invalid:G})}static fromDateTimes(O,H){const G=Ja(O),ee=Ja(H);return hE(G,ee)??new Kn({start:G,end:ee})}static after(O,H){const G=rr.fromDurationLike(H),ee=Ja(O);return Kn.fromDateTimes(ee,ee.plus(G))}static before(O,H){const G=rr.fromDurationLike(H),ee=Ja(O);return Kn.fromDateTimes(ee.minus(G),ee)}static fromISO(O,H){const[G,ee]=(O||"").split("/",2);if(G&&ee){let ye,Ee;try{ye=nn.fromISO(G,H),Ee=ye.isValid}catch{Ee=!1}let De,Le;try{De=nn.fromISO(ee,H),Le=De.isValid}catch{Le=!1}if(Ee&&Le)return Kn.fromDateTimes(ye,De);if(Ee){const Ct=rr.fromISO(ee,H);if(Ct.isValid)return Kn.after(ye,Ct)}else if(Le){const Ct=rr.fromISO(G,H);if(Ct.isValid)return Kn.before(De,Ct)}}return Kn.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",H){if(!this.isValid)return NaN;const G=this.start.startOf(O,H);let ee;return H!=null&&H.useLocaleWeeks?ee=this.end.reconfigure({locale:G.locale}):ee=this.end,ee=ee.startOf(O,H),Math.floor(ee.diff(G,O).get(O))+(ee.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:H}={}){return this.isValid?Kn.fromDateTimes(O||this.s,H||this.e):this}splitAt(...O){if(!this.isValid)return[];const H=O.map(Ja).filter(Ee=>this.contains(Ee)).sort((Ee,De)=>Ee.toMillis()-De.toMillis()),G=[];let{s:ee}=this,ye=0;for(;ee<this.e;){const Ee=H[ye]||this.e,De=+Ee>+this.e?this.e:Ee;G.push(Kn.fromDateTimes(ee,De)),ee=De,ye+=1}return G}splitBy(O){const H=rr.fromDurationLike(O);if(!this.isValid||!H.isValid||H.as("milliseconds")===0)return[];let{s:G}=this,ee=1,ye;const Ee=[];for(;G<this.e;){const De=this.start.plus(H.mapUnits(Le=>Le*ee));ye=+De>+this.e?this.e:De,Ee.push(Kn.fromDateTimes(G,ye)),G=ye,ee+=1}return Ee}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 H=this.s>O.s?this.s:O.s,G=this.e<O.e?this.e:O.e;return H>=G?null:Kn.fromDateTimes(H,G)}union(O){if(!this.isValid)return this;const H=this.s<O.s?this.s:O.s,G=this.e>O.e?this.e:O.e;return Kn.fromDateTimes(H,G)}static merge(O){const[H,G]=O.sort((ee,ye)=>ee.s-ye.s).reduce(([ee,ye],Ee)=>ye?ye.overlaps(Ee)||ye.abutsStart(Ee)?[ee,ye.union(Ee)]:[ee.concat([ye]),Ee]:[ee,Ee],[[],null]);return G&&H.push(G),H}static xor(O){let H=null,G=0;const ee=[],ye=O.map(Le=>[{time:Le.s,type:"s"},{time:Le.e,type:"e"}]),Ee=Array.prototype.concat(...ye),De=Ee.sort((Le,Ct)=>Le.time-Ct.time);for(const Le of De)G+=Le.type==="s"?1:-1,G===1?H=Le.time:(H&&+H!=+Le.time&&ee.push(Kn.fromDateTimes(H,Le.time)),H=null);return Kn.merge(ee)}difference(...O){return Kn.xor([this].concat(O)).map(H=>this.intersection(H)).filter(H=>H&&!H.isEmpty())}toString(){return this.isValid?`[${this.s.toISO()} – ${this.e.toISO()})`:Rc}[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=p,H={}){return this.isValid?po.create(this.s.loc.clone(H),O).formatInterval(this):Rc}toISO(O){return this.isValid?`${this.s.toISO(O)}/${this.e.toISO(O)}`:Rc}toISODate(){return this.isValid?`${this.s.toISODate()}/${this.e.toISODate()}`:Rc}toISOTime(O){return this.isValid?`${this.s.toISOTime(O)}/${this.e.toISOTime(O)}`:Rc}toFormat(O,{separator:H=" – "}={}){return this.isValid?`${this.s.toFormat(O)}${H}${this.e.toFormat(O)}`:Rc}toDuration(O,H){return this.isValid?this.e.diff(this.s,O,H):rr.invalid(this.invalidReason)}mapEndpoints(O){return Kn.fromDateTimes(O(this.s),O(this.e))}}class xs{static hasDST(O=Ve.defaultZone){const H=nn.now().setZone(O).set({month:12});return!O.isUniversal&&H.offset!==H.set({month:6}).offset}static isValidIANAZone(O){return X.isValidZone(O)}static normalizeZone(O){return Te(O,Ve.defaultZone)}static getStartOfWeek({locale:O=null,locObj:H=null}={}){return(H||$e.create(O)).getStartOfWeek()}static getMinimumDaysInFirstWeek({locale:O=null,locObj:H=null}={}){return(H||$e.create(O)).getMinDaysInFirstWeek()}static getWeekendWeekdays({locale:O=null,locObj:H=null}={}){return(H||$e.create(O)).getWeekendDays().slice()}static months(O="long",{locale:H=null,numberingSystem:G=null,locObj:ee=null,outputCalendar:ye="gregory"}={}){return(ee||$e.create(H,G,ye)).months(O)}static monthsFormat(O="long",{locale:H=null,numberingSystem:G=null,locObj:ee=null,outputCalendar:ye="gregory"}={}){return(ee||$e.create(H,G,ye)).months(O,!0)}static weekdays(O="long",{locale:H=null,numberingSystem:G=null,locObj:ee=null}={}){return(ee||$e.create(H,G,null)).weekdays(O)}static weekdaysFormat(O="long",{locale:H=null,numberingSystem:G=null,locObj:ee=null}={}){return(ee||$e.create(H,G,null)).weekdays(O,!0)}static meridiems({locale:O=null}={}){return $e.create(O).meridiems()}static eras(O="short",{locale:H=null}={}){return $e.create(H,null,"gregory").eras(O)}static features(){return{relative:qr(),localeWeek:en()}}}function Uh(q,O){const H=ee=>ee.toUTC(0,{keepLocalTime:!0}).startOf("day").valueOf(),G=H(O)-H(q);return Math.floor(rr.fromMillis(G).as("days"))}function Jb(q,O,H){const G=[["years",(Le,Ct)=>Ct.year-Le.year],["quarters",(Le,Ct)=>Ct.quarter-Le.quarter+(Ct.year-Le.year)*4],["months",(Le,Ct)=>Ct.month-Le.month+(Ct.year-Le.year)*12],["weeks",(Le,Ct)=>{const on=Uh(Le,Ct);return(on-on%7)/7}],["days",Uh]],ee={},ye=q;let Ee,De;for(const[Le,Ct]of G)H.indexOf(Le)>=0&&(Ee=Le,ee[Le]=Ct(q,O),De=ye.plus(ee),De>O?(ee[Le]--,q=ye.plus(ee),q>O&&(De=q,ee[Le]--,q=ye.plus(ee))):q=De);return[q,ee,De,Ee]}function ev(q,O,H,G){let[ee,ye,Ee,De]=Jb(q,O,H);const Le=O-ee,Ct=H.filter(Sn=>["hours","minutes","seconds","milliseconds"].indexOf(Sn)>=0);Ct.length===0&&(Ee<O&&(Ee=ee.plus({[De]:1})),Ee!==ee&&(ye[De]=(ye[De]||0)+Le/(Ee-ee)));const on=rr.fromObject(ye,G);return Ct.length>0?rr.fromMillis(Le,G).shiftTo(...Ct).plus(on):on}const tv="missing Intl.DateTimeFormat.formatToParts support";function ar(q,O=H=>H){return{regex:q,deser:([H])=>O(Cn(H))}}const nv="[  ]",Fl=new RegExp(nv,"g");function Vh(q){return q.replace(/\./g,"\\.?").replace(Fl,nv)}function Mc(q){return q.replace(/\./g,"").replace(Fl," ").toLowerCase()}function pa(q,O){return q===null?null:{regex:RegExp(q.map(Vh).join("|")),deser:([H])=>q.findIndex(G=>Mc(H)===Mc(G))+O}}function Wh(q,O){return{regex:q,deser:([,H,G])=>ju(H,G),groups:O}}function Ni(q){return{regex:q,deser:([O])=>O}}function Nc(q){return q.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function qh(q,O){const H=pn(O),G=pn(O,"{2}"),ee=pn(O,"{3}"),ye=pn(O,"{4}"),Ee=pn(O,"{6}"),De=pn(O,"{1,2}"),Le=pn(O,"{1,3}"),Ct=pn(O,"{1,6}"),on=pn(O,"{1,9}"),Sn=pn(O,"{2,4}"),ir=pn(O,"{4,6}"),ln=Lo=>({regex:RegExp(Nc(Lo.val)),deser:([Aa])=>Aa,literal:!0}),Gr=(Lo=>{if(q.literal)return ln(Lo);switch(Lo.val){case"G":return pa(O.eras("short"),0);case"GG":return pa(O.eras("long"),0);case"y":return ar(Ct);case"yy":return ar(Sn,Hs);case"yyyy":return ar(ye);case"yyyyy":return ar(ir);case"yyyyyy":return ar(Ee);case"M":return ar(De);case"MM":return ar(G);case"MMM":return pa(O.months("short",!0),1);case"MMMM":return pa(O.months("long",!0),1);case"L":return ar(De);case"LL":return ar(G);case"LLL":return pa(O.months("short",!1),1);case"LLLL":return pa(O.months("long",!1),1);case"d":return ar(De);case"dd":return ar(G);case"o":return ar(Le);case"ooo":return ar(ee);case"HH":return ar(G);case"H":return ar(De);case"hh":return ar(G);case"h":return ar(De);case"mm":return ar(G);case"m":return ar(De);case"q":return ar(De);case"qq":return ar(G);case"s":return ar(De);case"ss":return ar(G);case"S":return ar(Le);case"SSS":return ar(ee);case"u":return Ni(on);case"uu":return Ni(De);case"uuu":return ar(H);case"a":return pa(O.meridiems(),0);case"kkkk":return ar(ye);case"kk":return ar(Sn,Hs);case"W":return ar(De);case"WW":return ar(G);case"E":case"c":return ar(H);case"EEE":return pa(O.weekdays("short",!1),1);case"EEEE":return pa(O.weekdays("long",!1),1);case"ccc":return pa(O.weekdays("short",!0),1);case"cccc":return pa(O.weekdays("long",!0),1);case"Z":case"ZZ":return Wh(new RegExp(`([+-]${De.source})(?::(${G.source}))?`),2);case"ZZZ":return Wh(new RegExp(`([+-]${De.source})(${G.source})?`),2);case"z":return Ni(/[a-z_+-/]{1,256}?/i);case" ":return Ni(/[^\S\n\r]/);default:return ln(Lo)}})(q)||{invalidReason:tv};return Gr.token=q,Gr}const rv={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 jl(q,O,H){const{type:G,value:ee}=q;if(G==="literal"){const Le=/^\s+$/.test(ee);return{literal:!Le,val:Le?" ":ee}}const ye=O[G];let Ee=G;G==="hour"&&(O.hour12!=null?Ee=O.hour12?"hour12":"hour24":O.hourCycle!=null?O.hourCycle==="h11"||O.hourCycle==="h12"?Ee="hour12":Ee="hour24":Ee=H.hour12?"hour12":"hour24");let De=rv[Ee];if(typeof De=="object"&&(De=De[ye]),De)return{literal:!1,val:De}}function ov(q){return[`^${q.map(O=>O.regex).reduce((O,H)=>`${O}(${H.source})`,"")}$`,q]}function av(q,O,H){const G=q.match(O);if(G){const ee={};let ye=1;for(const Ee in H)if($n(H,Ee)){const De=H[Ee],Le=De.groups?De.groups+1:1;!De.literal&&De.token&&(ee[De.token.val[0]]=De.deser(G.slice(ye,ye+Le))),ye+=Le}return[G,ee]}else return[G,{}]}function iv(q){const O=ee=>{switch(ee){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 H=null,G;return qe(q.z)||(H=X.create(q.z)),qe(q.Z)||(H||(H=new $t(q.Z)),G=q.Z),qe(q.q)||(q.M=(q.q-1)*3+1),qe(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),qe(q.u)||(q.S=bc(q.u)),[Object.keys(q).reduce((ee,ye)=>{const Ee=O(ye);return Ee&&(ee[Ee]=q[ye]),ee},{}),H,G]}let Gh=null;function mE(){return Gh||(Gh=nn.fromMillis(1555555555555)),Gh}function gE(q,O){if(q.literal)return q;const H=po.macroTokenToFormatOpts(q.val),G=Qh(H,O);return G==null||G.includes(void 0)?q:G}function Yh(q,O){return Array.prototype.concat(...q.map(H=>gE(H,O)))}class Kh{constructor(O,H){if(this.locale=O,this.format=H,this.tokens=Yh(po.parseFormat(H),O),this.units=this.tokens.map(G=>qh(G,O)),this.disqualifyingUnit=this.units.find(G=>G.invalidReason),!this.disqualifyingUnit){const[G,ee]=ov(this.units);this.regex=RegExp(G,"i"),this.handlers=ee}}explainFromTokens(O){if(this.isValid){const[H,G]=av(O,this.regex,this.handlers),[ee,ye,Ee]=G?iv(G):[null,null,void 0];if($n(G,"a")&&$n(G,"H"))throw new o("Can't include meridiem when specifying 24-hour format");return{input:O,tokens:this.tokens,regex:this.regex,rawMatches:H,matches:G,result:ee,zone:ye,specificOffset:Ee}}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 gf(q,O,H){return new Kh(q,H).explainFromTokens(O)}function Ka(q,O,H){const{result:G,zone:ee,specificOffset:ye,invalidReason:Ee}=gf(q,O,H);return[G,ee,ye,Ee]}function Qh(q,O){if(!q)return null;const H=po.create(O,q).dtFormatter(mE()),G=H.formatToParts(),ee=H.resolvedOptions();return G.map(ye=>jl(ye,q,ee))}const ea="Invalid DateTime",ha=864e13;function Pi(q){return new ot("unsupported zone",`the zone "${q.name}" is not supported`)}function Gu(q){return q.weekData===null&&(q.weekData=Bt(q.c)),q.weekData}function Pc(q){return q.localWeekData===null&&(q.localWeekData=Bt(q.c,q.loc.getMinDaysInFirstWeek(),q.loc.getStartOfWeek())),q.localWeekData}function Ii(q,O){const H={ts:q.ts,zone:q.zone,c:q.c,o:q.o,loc:q.loc,invalid:q.invalid};return new nn({...H,...O,old:H})}function yf(q,O,H){let G=q-O*60*1e3;const ee=H.offset(G);if(O===ee)return[G,O];G-=(ee-O)*60*1e3;const ye=H.offset(G);return ee===ye?[G,ee]:[q-Math.min(ee,ye)*60*1e3,Math.max(ee,ye)]}function Ss(q,O){q+=O*60*1e3;const H=new Date(q);return{year:H.getUTCFullYear(),month:H.getUTCMonth()+1,day:H.getUTCDate(),hour:H.getUTCHours(),minute:H.getUTCMinutes(),second:H.getUTCSeconds(),millisecond:H.getUTCMilliseconds()}}function Yu(q,O,H){return yf(xc(q),O,H)}function Ku(q,O){const H=q.o,G=q.c.year+Math.trunc(O.years),ee=q.c.month+Math.trunc(O.months)+Math.trunc(O.quarters)*3,ye={...q.c,year:G,month:ee,day:Math.min(q.c.day,Wo(G,ee))+Math.trunc(O.days)+Math.trunc(O.weeks)*7},Ee=rr.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"),De=xc(ye);let[Le,Ct]=yf(De,H,q.zone);return Ee!==0&&(Le+=Ee,Ct=q.zone.offset(Le)),{ts:Le,o:Ct}}function Qa(q,O,H,G,ee,ye){const{setZone:Ee,zone:De}=H;if(q&&Object.keys(q).length!==0||O){const Le=O||De,Ct=nn.fromObject(q,{...H,zone:Le,specificOffset:ye});return Ee?Ct:Ct.setZone(De)}else return nn.invalid(new ot("unparsable",`the input "${ee}" can't be parsed as ${G}`))}function bf(q,O,H=!0){return q.isValid?po.create($e.create("en-US"),{allowZ:H,forceSimple:!0}).formatDateTimeFromString(q,O):null}function qo(q,O,H){const G=q.c.year>9999||q.c.year<0;let ee="";if(G&&q.c.year>=0&&(ee+="+"),ee+=pr(q.c.year,G?6:4),H==="year")return ee;if(O){if(ee+="-",ee+=pr(q.c.month),H==="month")return ee;ee+="-"}else if(ee+=pr(q.c.month),H==="month")return ee;return ee+=pr(q.c.day),ee}function vf(q,O,H,G,ee,ye,Ee){let De=!H||q.c.millisecond!==0||q.c.second!==0,Le="";switch(Ee){case"day":case"month":case"year":break;default:if(Le+=pr(q.c.hour),Ee==="hour")break;if(O){if(Le+=":",Le+=pr(q.c.minute),Ee==="minute")break;De&&(Le+=":",Le+=pr(q.c.second))}else{if(Le+=pr(q.c.minute),Ee==="minute")break;De&&(Le+=pr(q.c.second))}if(Ee==="second")break;De&&(!G||q.c.millisecond!==0)&&(Le+=".",Le+=pr(q.c.millisecond,3))}return ee&&(q.isOffsetFixed&&q.offset===0&&!ye?Le+="Z":q.o<0?(Le+="-",Le+=pr(Math.trunc(-q.o/60)),Le+=":",Le+=pr(Math.trunc(-q.o%60))):(Le+="+",Le+=pr(Math.trunc(q.o/60)),Le+=":",Le+=pr(Math.trunc(q.o%60)))),ye&&(Le+="["+q.zone.ianaName+"]"),Le}const _i={month:1,day:1,hour:0,minute:0,second:0,millisecond:0},sv={weekNumber:1,weekday:1,hour:0,minute:0,second:0,millisecond:0},xf={ordinal:1,hour:0,minute:0,second:0,millisecond:0},Li=["year","month","day","hour","minute","second","millisecond"],Xh=["weekYear","weekNumber","weekday","hour","minute","second","millisecond"],Zh=["year","ordinal","hour","minute","second","millisecond"];function Es(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 Bl(q){switch(q.toLowerCase()){case"localweekday":case"localweekdays":return"localWeekday";case"localweeknumber":case"localweeknumbers":return"localWeekNumber";case"localweekyear":case"localweekyears":return"localWeekYear";default:return Es(q)}}function Sf(q){if(Xa===void 0&&(Xa=Ve.now()),q.type!=="iana")return q.offset(Xa);const O=q.name;let H=Za.get(O);return H===void 0&&(H=q.offset(Xa),Za.set(O,H)),H}function Qu(q,O){const H=Te(O.zone,Ve.defaultZone);if(!H.isValid)return nn.invalid(Pi(H));const G=$e.fromObject(O);let ee,ye;if(qe(q.year))ee=Ve.now();else{for(const Le of Li)qe(q[Le])&&(q[Le]=_i[Le]);const Ee=Be(q)||ut(q);if(Ee)return nn.invalid(Ee);const De=Sf(H);[ee,ye]=Yu(q,De,H)}return new nn({ts:ee,zone:H,loc:G,o:ye})}function ma(q,O,H){const G=qe(H.round)?!0:H.round,ee=qe(H.rounding)?"trunc":H.rounding,ye=(De,Le)=>(De=cf(De,G||H.calendary?0:2,H.calendary?"round":ee),O.loc.clone(H).relFormatter(H).format(De,Le)),Ee=De=>H.calendary?O.hasSame(q,De)?0:O.startOf(De).diff(q.startOf(De),De).get(De):O.diff(q,De).get(De);if(H.unit)return ye(Ee(H.unit),H.unit);for(const De of H.units){const Le=Ee(De);if(Math.abs(Le)>=1)return ye(Le,De)}return ye(q>O?-0:0,H.units[H.units.length-1])}function ga(q){let O={},H;return q.length>0&&typeof q[q.length-1]=="object"?(O=q[q.length-1],H=Array.from(q).slice(0,q.length-1)):H=Array.from(q),[O,H]}let Xa;const Za=new Map;class nn{constructor(O){const H=O.zone||Ve.defaultZone;let G=O.invalid||(Number.isNaN(O.ts)?new ot("invalid input"):null)||(H.isValid?null:Pi(H));this.ts=qe(O.ts)?Ve.now():O.ts;let ee=null,ye=null;if(!G)if(O.old&&O.old.ts===this.ts&&O.old.zone.equals(H))[ee,ye]=[O.old.c,O.old.o];else{const Ee=Zt(O.o)&&!O.old?O.o:H.offset(this.ts);ee=Ss(this.ts,Ee),G=Number.isNaN(ee.year)?new ot("invalid input"):null,ee=G?null:ee,ye=G?null:Ee}this._zone=H,this.loc=O.loc||$e.create(),this.invalid=G,this.weekData=null,this.localWeekData=null,this.c=ee,this.o=ye,this.isLuxonDateTime=!0}static now(){return new nn({})}static local(){const[O,H]=ga(arguments),[G,ee,ye,Ee,De,Le,Ct]=H;return Qu({year:G,month:ee,day:ye,hour:Ee,minute:De,second:Le,millisecond:Ct},O)}static utc(){const[O,H]=ga(arguments),[G,ee,ye,Ee,De,Le,Ct]=H;return O.zone=$t.utcInstance,Qu({year:G,month:ee,day:ye,hour:Ee,minute:De,second:Le,millisecond:Ct},O)}static fromJSDate(O,H={}){const G=sn(O)?O.valueOf():NaN;if(Number.isNaN(G))return nn.invalid("invalid input");const ee=Te(H.zone,Ve.defaultZone);return ee.isValid?new nn({ts:G,zone:ee,loc:$e.fromObject(H)}):nn.invalid(Pi(ee))}static fromMillis(O,H={}){if(Zt(O))return O<-ha||O>ha?nn.invalid("Timestamp out of range"):new nn({ts:O,zone:Te(H.zone,Ve.defaultZone),loc:$e.fromObject(H)});throw new i(`fromMillis requires a numerical input, but received a ${typeof O} with value ${O}`)}static fromSeconds(O,H={}){if(Zt(O))return new nn({ts:O*1e3,zone:Te(H.zone,Ve.defaultZone),loc:$e.fromObject(H)});throw new i("fromSeconds requires a numerical input")}static fromObject(O,H={}){O=O||{};const G=Te(H.zone,Ve.defaultZone);if(!G.isValid)return nn.invalid(Pi(G));const ee=$e.fromObject(H),ye=uf(O,Bl),{minDaysInFirstWeek:Ee,startOfWeek:De}=rn(ye,ee),Le=Ve.now(),Ct=qe(H.specificOffset)?G.offset(Le):H.specificOffset,on=!qe(ye.ordinal),Sn=!qe(ye.year),ir=!qe(ye.month)||!qe(ye.day),ln=Sn||ir,Gr=ye.weekYear||ye.weekNumber;if((ln||on)&&Gr)throw new o("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(ir&&on)throw new o("Can't mix ordinal dates with month/day");const Lo=Gr||ye.weekday&&!ln;let Aa,Da,Oa=Ss(Le,Ct);Lo?(Aa=Xh,Da=sv,Oa=Bt(Oa,Ee,De)):on?(Aa=Zh,Da=xf,Oa=nr(Oa)):(Aa=Li,Da=_i);let Fi=!1;for(const Vs of Aa){const cv=ye[Vs];qe(cv)?Fi?ye[Vs]=Da[Vs]:ye[Vs]=Oa[Vs]:Fi=!0}const Jh=Lo?le(ye,Ee,De):on?ce(ye):Be(ye),Ef=Jh||ut(ye);if(Ef)return nn.invalid(Ef);const Xu=Lo?Tn(ye,Ee,De):on?Yn(ye):ye,[Cf,$l]=Yu(Xu,Ct,G),no=new nn({ts:Cf,zone:G,o:$l,loc:ee});return ye.weekday&&ln&&O.weekday!==no.weekday?nn.invalid("mismatched weekday",`you can't specify both a weekday of ${ye.weekday} and a date of ${no.toISO()}`):no.isValid?no:nn.invalid(no.invalid)}static fromISO(O,H={}){const[G,ee]=Vb(O);return Qa(G,ee,H,"ISO 8601",O)}static fromRFC2822(O,H={}){const[G,ee]=Wb(O);return Qa(G,ee,H,"RFC 2822",O)}static fromHTTP(O,H={}){const[G,ee]=qb(O);return Qa(G,ee,H,"HTTP",H)}static fromFormat(O,H,G={}){if(qe(O)||qe(H))throw new i("fromFormat requires an input string and a format");const{locale:ee=null,numberingSystem:ye=null}=G,Ee=$e.fromOpts({locale:ee,numberingSystem:ye,defaultToEN:!0}),[De,Le,Ct,on]=Ka(Ee,O,H);return on?nn.invalid(on):Qa(De,Le,G,`format ${H}`,O,Ct)}static fromString(O,H,G={}){return nn.fromFormat(O,H,G)}static fromSQL(O,H={}){const[G,ee]=qu(O);return Qa(G,ee,H,"SQL",O)}static invalid(O,H=null){if(!O)throw new i("need to specify a reason the DateTime is invalid");const G=O instanceof ot?O:new ot(O,H);if(Ve.throwOnInvalid)throw new t(G);return new nn({invalid:G})}static isDateTime(O){return O&&O.isLuxonDateTime||!1}static parseFormatForOpts(O,H={}){const G=Qh(O,$e.fromObject(H));return G?G.map(ee=>ee?ee.val:null).join(""):null}static expandFormat(O,H={}){return Yh(po.parseFormat(O),$e.fromObject(H)).map(G=>G.val).join("")}static resetCache(){Xa=void 0,Za.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?Gu(this).weekYear:NaN}get weekNumber(){return this.isValid?Gu(this).weekNumber:NaN}get weekday(){return this.isValid?Gu(this).weekday:NaN}get isWeekend(){return this.isValid&&this.loc.getWeekendDays().includes(this.weekday)}get localWeekday(){return this.isValid?Pc(this).weekday:NaN}get localWeekNumber(){return this.isValid?Pc(this).weekNumber:NaN}get localWeekYear(){return this.isValid?Pc(this).weekYear:NaN}get ordinal(){return this.isValid?nr(this.c).ordinal:NaN}get monthShort(){return this.isValid?xs.months("short",{locObj:this.loc})[this.month-1]:null}get monthLong(){return this.isValid?xs.months("long",{locObj:this.loc})[this.month-1]:null}get weekdayShort(){return this.isValid?xs.weekdays("short",{locObj:this.loc})[this.weekday-1]:null}get weekdayLong(){return this.isValid?xs.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,H=6e4,G=xc(this.c),ee=this.zone.offset(G-O),ye=this.zone.offset(G+O),Ee=this.zone.offset(G-ee*H),De=this.zone.offset(G-ye*H);if(Ee===De)return[this];const Le=G-Ee*H,Ct=G-De*H,on=Ss(Le,Ee),Sn=Ss(Ct,De);return on.hour===Sn.hour&&on.minute===Sn.minute&&on.second===Sn.second&&on.millisecond===Sn.millisecond?[Ii(this,{ts:Le}),Ii(this,{ts:Ct})]:[this]}get isInLeapYear(){return zs(this.year)}get daysInMonth(){return Wo(this.year,this.month)}get daysInYear(){return this.isValid?vc(this.year):NaN}get weeksInWeekYear(){return this.isValid?Nl(this.weekYear):NaN}get weeksInLocalWeekYear(){return this.isValid?Nl(this.localWeekYear,this.loc.getMinDaysInFirstWeek(),this.loc.getStartOfWeek()):NaN}resolvedLocaleOptions(O={}){const{locale:H,numberingSystem:G,calendar:ee}=po.create(this.loc.clone(O),O).resolvedOptions(this);return{locale:H,numberingSystem:G,outputCalendar:ee}}toUTC(O=0,H={}){return this.setZone($t.instance(O),H)}toLocal(){return this.setZone(Ve.defaultZone)}setZone(O,{keepLocalTime:H=!1,keepCalendarTime:G=!1}={}){if(O=Te(O,Ve.defaultZone),O.equals(this.zone))return this;if(O.isValid){let ee=this.ts;if(H||G){const ye=O.offset(this.ts),Ee=this.toObject();[ee]=Yu(Ee,ye,O)}return Ii(this,{ts:ee,zone:O})}else return nn.invalid(Pi(O))}reconfigure({locale:O,numberingSystem:H,outputCalendar:G}={}){const ee=this.loc.clone({locale:O,numberingSystem:H,outputCalendar:G});return Ii(this,{loc:ee})}setLocale(O){return this.reconfigure({locale:O})}set(O){if(!this.isValid)return this;const H=uf(O,Bl),{minDaysInFirstWeek:G,startOfWeek:ee}=rn(H,this.loc),ye=!qe(H.weekYear)||!qe(H.weekNumber)||!qe(H.weekday),Ee=!qe(H.ordinal),De=!qe(H.year),Le=!qe(H.month)||!qe(H.day),Ct=De||Le,on=H.weekYear||H.weekNumber;if((Ct||Ee)&&on)throw new o("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(Le&&Ee)throw new o("Can't mix ordinal dates with month/day");let Sn;ye?Sn=Tn({...Bt(this.c,G,ee),...H},G,ee):qe(H.ordinal)?(Sn={...this.toObject(),...H},qe(H.day)&&(Sn.day=Math.min(Wo(Sn.year,Sn.month),Sn.day))):Sn=Yn({...nr(this.c),...H});const[ir,ln]=Yu(Sn,this.o,this.zone);return Ii(this,{ts:ir,o:ln})}plus(O){if(!this.isValid)return this;const H=rr.fromDurationLike(O);return Ii(this,Ku(this,H))}minus(O){if(!this.isValid)return this;const H=rr.fromDurationLike(O).negate();return Ii(this,Ku(this,H))}startOf(O,{useLocaleWeeks:H=!1}={}){if(!this.isValid)return this;const G={},ee=rr.normalizeUnit(O);switch(ee){case"years":G.month=1;case"quarters":case"months":G.day=1;case"weeks":case"days":G.hour=0;case"hours":G.minute=0;case"minutes":G.second=0;case"seconds":G.millisecond=0;break}if(ee==="weeks")if(H){const ye=this.loc.getStartOfWeek(),{weekday:Ee}=this;Ee<ye&&(G.weekNumber=this.weekNumber-1),G.weekday=ye}else G.weekday=1;if(ee==="quarters"){const ye=Math.ceil(this.month/3);G.month=(ye-1)*3+1}return this.set(G)}endOf(O,H){return this.isValid?this.plus({[O]:1}).startOf(O,H).minus(1):this}toFormat(O,H={}){return this.isValid?po.create(this.loc.redefaultToEN(H)).formatDateTimeFromString(this,O):ea}toLocaleString(O=p,H={}){return this.isValid?po.create(this.loc.clone(H),O).formatDateTime(this):ea}toLocaleParts(O={}){return this.isValid?po.create(this.loc.clone(O),O).formatDateTimeParts(this):[]}toISO({format:O="extended",suppressSeconds:H=!1,suppressMilliseconds:G=!1,includeOffset:ee=!0,extendedZone:ye=!1,precision:Ee="milliseconds"}={}){if(!this.isValid)return null;Ee=Es(Ee);const De=O==="extended";let Le=qo(this,De,Ee);return Li.indexOf(Ee)>=3&&(Le+="T"),Le+=vf(this,De,H,G,ee,ye,Ee),Le}toISODate({format:O="extended",precision:H="day"}={}){return this.isValid?qo(this,O==="extended",Es(H)):null}toISOWeekDate(){return bf(this,"kkkk-'W'WW-c")}toISOTime({suppressMilliseconds:O=!1,suppressSeconds:H=!1,includeOffset:G=!0,includePrefix:ee=!1,extendedZone:ye=!1,format:Ee="extended",precision:De="milliseconds"}={}){return this.isValid?(De=Es(De),(ee&&Li.indexOf(De)>=3?"T":"")+vf(this,Ee==="extended",H,O,G,ye,De)):null}toRFC2822(){return bf(this,"EEE, dd LLL yyyy HH:mm:ss ZZZ",!1)}toHTTP(){return bf(this.toUTC(),"EEE, dd LLL yyyy HH:mm:ss 'GMT'")}toSQLDate(){return this.isValid?qo(this,!0):null}toSQLTime({includeOffset:O=!0,includeZone:H=!1,includeOffsetSpace:G=!0}={}){let ee="HH:mm:ss.SSS";return(H||O)&&(G&&(ee+=" "),H?ee+="z":O&&(ee+="ZZ")),bf(this,ee,!0)}toSQL(O={}){return this.isValid?`${this.toSQLDate()} ${this.toSQLTime(O)}`:null}toString(){return this.isValid?this.toISO():ea}[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 H={...this.c};return O.includeConfig&&(H.outputCalendar=this.outputCalendar,H.numberingSystem=this.loc.numberingSystem,H.locale=this.loc.locale),H}toJSDate(){return new Date(this.isValid?this.ts:NaN)}diff(O,H="milliseconds",G={}){if(!this.isValid||!O.isValid)return rr.invalid("created by diffing an invalid DateTime");const ee={locale:this.locale,numberingSystem:this.numberingSystem,...G},ye=gr(H).map(rr.normalizeUnit),Ee=O.valueOf()>this.valueOf(),De=Ee?this:O,Le=Ee?O:this,Ct=ev(De,Le,ye,ee);return Ee?Ct.negate():Ct}diffNow(O="milliseconds",H={}){return this.diff(nn.now(),O,H)}until(O){return this.isValid?Kn.fromDateTimes(this,O):this}hasSame(O,H,G){if(!this.isValid)return!1;const ee=O.valueOf(),ye=this.setZone(O.zone,{keepLocalTime:!0});return ye.startOf(H,G)<=ee&&ee<=ye.endOf(H,G)}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 H=O.base||nn.fromObject({},{zone:this.zone}),G=O.padding?this<H?-O.padding:O.padding:0;let ee=["years","months","days","hours","minutes","seconds"],ye=O.unit;return Array.isArray(O.unit)&&(ee=O.unit,ye=void 0),ma(H,this.plus(G),{...O,numeric:"always",units:ee,unit:ye})}toRelativeCalendar(O={}){return this.isValid?ma(O.base||nn.fromObject({},{zone:this.zone}),this,{...O,numeric:"auto",units:["years","months","days"],calendary:!0}):null}static min(...O){if(!O.every(nn.isDateTime))throw new i("min requires all arguments be DateTimes");return kn(O,H=>H.valueOf(),Math.min)}static max(...O){if(!O.every(nn.isDateTime))throw new i("max requires all arguments be DateTimes");return kn(O,H=>H.valueOf(),Math.max)}static fromFormatExplain(O,H,G={}){const{locale:ee=null,numberingSystem:ye=null}=G,Ee=$e.fromOpts({locale:ee,numberingSystem:ye,defaultToEN:!0});return gf(Ee,O,H)}static fromStringExplain(O,H,G={}){return nn.fromFormatExplain(O,H,G)}static buildFormatParser(O,H={}){const{locale:G=null,numberingSystem:ee=null}=H,ye=$e.fromOpts({locale:G,numberingSystem:ee,defaultToEN:!0});return new Kh(ye,O)}static fromFormatParser(O,H,G={}){if(qe(O)||qe(H))throw new i("fromFormatParser requires an input string and a format parser");const{locale:ee=null,numberingSystem:ye=null}=G,Ee=$e.fromOpts({locale:ee,numberingSystem:ye,defaultToEN:!0});if(!Ee.equals(H.locale))throw new i(`fromFormatParser called with a locale of ${Ee}, but the format parser was created for ${H.locale}`);const{result:De,zone:Le,specificOffset:Ct,invalidReason:on}=H.explainFromTokens(O);return on?nn.invalid(on):Qa(De,Le,G,`format ${H.format}`,O,Ct)}static get DATE_SHORT(){return p}static get DATE_MED(){return y}static get DATE_MED_WITH_WEEKDAY(){return g}static get DATE_FULL(){return b}static get DATE_HUGE(){return x}static get TIME_SIMPLE(){return E}static get TIME_WITH_SECONDS(){return S}static get TIME_WITH_SHORT_OFFSET(){return w}static get TIME_WITH_LONG_OFFSET(){return C}static get TIME_24_SIMPLE(){return R}static get TIME_24_WITH_SECONDS(){return M}static get TIME_24_WITH_SHORT_OFFSET(){return D}static get TIME_24_WITH_LONG_OFFSET(){return I}static get DATETIME_SHORT(){return L}static get DATETIME_SHORT_WITH_SECONDS(){return F}static get DATETIME_MED(){return B}static get DATETIME_MED_WITH_SECONDS(){return U}static get DATETIME_MED_WITH_WEEKDAY(){return k}static get DATETIME_FULL(){return $}static get DATETIME_FULL_WITH_SECONDS(){return j}static get DATETIME_HUGE(){return V}static get DATETIME_HUGE_WITH_SECONDS(){return z}}function Ja(q){if(nn.isDateTime(q))return q;if(q&&q.valueOf&&Zt(q.valueOf()))return nn.fromJSDate(q);if(q&&typeof q=="object")return nn.fromObject(q);throw new i(`Unknown datetime argument: ${q}, of type ${typeof q}`)}const lv="3.7.2";return Ia.DateTime=nn,Ia.Duration=rr,Ia.FixedOffsetZone=$t,Ia.IANAZone=X,Ia.Info=xs,Ia.Interval=Kn,Ia.InvalidZone=pt,Ia.Settings=Ve,Ia.SystemZone=te,Ia.VERSION=lv,Ia.Zone=K,Ia}var X_;function $D(){return X_||(X_=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.CronDate=e.DAYS_IN_MONTH=e.DateMathOp=e.TimeUnit=void 0;const t=cCe();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,s){const c={zone:s};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}`);s&&s!==this.#e.zoneName&&(this.#e=this.#e.setZone(s))}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,s){if(i===r.Add){this.addUnit(s);return}if(i===r.Subtract){this.subtractUnit(s);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:s}=this.#e;if(s===2){const c=o.#o(this.#e.year);return i===e.DAYS_IN_MONTH[s-1]-(c?0:1)}return i===e.DAYS_IN_MONTH[s-1]}isLastWeekdayOfMonth(){const{day:i,month:s}=this.#e;let c;return s===2?c=e.DAYS_IN_MONTH[s-1]-(o.#o(this.#e.year)?0:1):c=e.DAYS_IN_MONTH[s-1],i>c-7}applyDateOperation(i,s,c){if(s===n.Month||s===n.Day){this.invokeDateOperation(i,s);return}const u=this.getHours();this.invokeDateOperation(i,s);const f=this.getHours(),p=f-u;p===2?c!==24&&(this.dstStart=u+1):p===0&&this.getMinutes()===0&&this.getSeconds()===0&&c!==24&&(this.dstEnd=f)}#r(){return this.#e.toUTC()}}e.CronDate=o,e.default=o})(K_)),K_}var Z_;function uCe(){if(Z_)return gg;Z_=1,Object.defineProperty(gg,"__esModule",{value:!0}),gg.CronMonth=void 0;const e=$D(),t=af(),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,s){super(i,s),this.validate()}get values(){return super.values}};return gg.CronMonth=a,gg}var yg={},J_;function dCe(){if(J_)return yg;J_=1,Object.defineProperty(yg,"__esModule",{value:!0}),yg.CronSecond=void 0;const e=af(),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 yg.CronSecond=o,yg}var eL;function zD(){return eL||(eL=1,(function(e){var t=up&&up.__createBinding||(Object.create?(function(r,o,a,i){i===void 0&&(i=a);var s=Object.getOwnPropertyDescriptor(o,a);(!s||("get"in s?!o.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return o[a]}}),Object.defineProperty(r,i,s)}):(function(r,o,a,i){i===void 0&&(i=a),r[i]=o[a]})),n=up&&up.__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(oCe(),e),n(aCe(),e),n(iCe(),e),n(af(),e),n(sCe(),e),n(lCe(),e),n(uCe(),e),n(dCe(),e)})(up)),up}var tL;function f$(){if(tL)return ug;tL=1,Object.defineProperty(ug,"__esModule",{value:!0}),ug.CronFieldCollection=void 0;const e=zD();let t=class $g{#e;#t;#n;#o;#r;#a;static from(r,o){return new $g({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:s,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(!s)throw new Error("Validation error, Field month is missing");if(!c)throw new Error("Validation error, Field dayOfWeek is missing");if(s.values.length===1&&!i.hasLastChar&&c.isWildcard&&!(parseInt(i.values[0],10)<=e.CronMonth.daysInMonth[s.values[0]-1]))throw new Error("Invalid explicit day of month definition");this.#e=r,this.#t=o,this.#n=a,this.#r=s,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,s,c)=>{if(a===void 0){a={start:i,count:1};return}const u=c[s-1]||a.start,f=c[s+1];if(i==="L"||i==="W"){o.push(a),o.push({start:i,count:1}),a=void 0;return}if(a.step===void 0&&f!==void 0){const p=i-u,y=f-i;if(p<=y){a={...a,count:2,end:i,step:p};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??u,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 s=(u,f)=>{if(typeof r.start!="number")throw new Error("Unexpected range start");return f%a===0?r.start+f:null};if(typeof r.start!="number")throw new Error("Unexpected range start");const c={length:r.end-r.start+1};return Array.from(c,s).filter(u=>u!==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 s=this.#a.values;a=s[s.length-1]===7?s.slice(0,-1):s}r instanceof e.CronDayOfMonth&&(o=this.#r.values.length===1?e.CronMonth.daysInMonth[this.#r.values[0]-1]:r.max);const i=$g.compactField(a);if(i.length===1){const s=$g.#s(r,i[0],o);if(s)return s}return i.map(s=>{const c=s.count===1?s.start.toString():$g.#i(s,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 ug.CronFieldCollection=t,ug}var nL={},rL;function p$(){return rL||(rL=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=$D();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 s=i.currentDate??i.startDate;if(s){const c=new t.CronDate(s,this.#t);this.#o&&c.getTime()<this.#o.getTime()?s=this.#o:this.#r&&c.getTime()>this.#r.getTime()&&(s=this.#r)}this.#n=new t.CronDate(s,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(s=>s===a)}#l(a,i){return a[i?a.length-1:0]}#f(a){const i=`${a.getFullYear()}-${a.getMonth()+1}-${a.getDate()}`;if(this.#s===i)return this.#i;const s=new t.CronDate(a);s.setStartOfDay();const c=new t.CronDate(a);return c.setEndOfDay(),this.#s=i,this.#i=s.getUTCOffset()!==c.getUTCOffset(),this.#i}#u(a,i,s){const c=this.#a.second.values,u=a.getSeconds(),f=this.#a.second.findNearestValue(u,s);if(f!==null){a.setSeconds(f);return}a.applyDateOperation(i,t.TimeUnit.Minute,this.#a.hour.values.length),a.setSeconds(this.#l(c,s))}#h(a,i,s){const c=this.#a.minute.values,u=this.#a.second.values,f=a.getMinutes(),p=this.#a.minute.findNearestValue(f,s);if(p!==null){a.setMinutes(p),a.setSeconds(this.#l(u,s));return}a.applyDateOperation(i,t.TimeUnit.Hour,this.#a.hour.values.length),a.setMinutes(this.#l(c,s)),a.setSeconds(this.#l(u,s))}static#p(a,i){const s=i.isLastWeekdayOfMonth();return a.some(c=>{const u=parseInt(c.toString().charAt(0),10)%7;if(Number.isNaN(u))throw new Error(`Invalid last weekday of the month expression: ${c}`);return i.getDay()===u&&s})}next(){return this.#d()}prev(){return this.#d(!0)}hasNext(){const a=this.#n;try{return this.#d(),!0}catch{return!1}finally{this.#n=a}}hasPrev(){const a=this.#n;try{return this.#d(!0),!0}catch{return!1}finally{this.#n=a}}take(a){const i=[];if(a>=0)for(let s=0;s<a;s++)try{i.push(this.next())}catch{return i}else for(let s=0;s>a;s--)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:s,hour:c,month:u}=this.#a,f=new t.CronDate(a,this.#t);return!(!i.values.includes(f.getSeconds())||!s.values.includes(f.getMinutes())||!c.values.includes(f.getHours())||!u.values.includes(f.getMonth()+1)||!this.#m(f)||this.#a.dayOfWeek.nthDay>0&&Math.ceil(f.getDate()/7)!==this.#a.dayOfWeek.nthDay)}toString(){return this.#e.expression||this.stringify(!0)}#m(a){const i=this.#a.dayOfMonth.isWildcard,s=!i,c=this.#a.dayOfWeek.isWildcard,u=!c,f=r.#c(a.getDate(),this.#a.dayOfMonth.values)||this.#a.dayOfMonth.hasLastChar&&a.isLastDayOfMonth(),p=r.#c(a.getDay(),this.#a.dayOfWeek.values)||this.#a.dayOfWeek.hasLastChar&&r.#p(this.#a.dayOfWeek.values,a);return!!(s&&u&&(f||p)||f&&!u||i&&!c&&p)}#g(a,i,s){const c=this.#a.hour.values,u=c,f=a.getHours(),p=r.#c(f,c),y=a.dstEnd===f;if(a.dstStart!==null&&a.dstStart===f-1&&r.#c(a.dstStart,c))return!0;if(y&&!s)return a.dstEnd=null,a.applyDateOperation(t.DateMathOp.Add,t.TimeUnit.Hour,u.length),!1;if(p)return!0;a.dstStart=null;const g=this.#a.hour.findNearestValue(f,s);if(g===null)return a.applyDateOperation(i,t.TimeUnit.Day,u.length),!1;if(this.#f(a)){const b=s?f-g:g-f;for(let x=0;x<b&&(a.applyDateOperation(i,t.TimeUnit.Hour,u.length),!(!s&&a.getHours()>=g||s&&a.getHours()<=g));x++);}else a.setHours(g);return a.setMinutes(this.#l(this.#a.minute.values,s)),a.setSeconds(this.#l(this.#a.second.values,s)),!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)}#d(a=!1){const i=a?t.DateMathOp.Subtract:t.DateMathOp.Add,s=new t.CronDate(this.#n),c=s.getTime();let u=0;for(;++u<n;){if(this.#y(s),!this.#m(s)){s.applyDateOperation(i,t.TimeUnit.Day,this.#a.hour.values.length);continue}if(!(this.#a.dayOfWeek.nthDay<=0||Math.ceil(s.getDate()/7)===this.#a.dayOfWeek.nthDay)){s.applyDateOperation(i,t.TimeUnit.Day,this.#a.hour.values.length);continue}if(!r.#c(s.getMonth()+1,this.#a.month.values)){s.applyDateOperation(i,t.TimeUnit.Month,this.#a.hour.values.length);continue}if(this.#g(s,i,a)){if(!r.#c(s.getMinutes(),this.#a.minute.values)){this.#h(s,i,a);continue}if(!r.#c(s.getSeconds(),this.#a.second.values)){this.#u(s,i,a);continue}if(c===s.getTime()){(i==="Add"||s.getMilliseconds()===0)&&s.applyDateOperation(i,t.TimeUnit.Second,this.#a.hour.values.length);continue}break}}if(u>n)throw new Error(e.LOOPS_LIMIT_EXCEEDED_ERROR_MESSAGE);return s.getMilliseconds()!==0&&s.setMilliseconds(0),this.#n=s,s}[Symbol.iterator](){return{next:()=>{try{return{value:this.#d(),done:!1}}catch{return{value:void 0,done:!0}}}}}}e.CronExpression=r,e.default=r})(nL)),nL}var N0={},oL;function fCe(){if(oL)return N0;oL=1,Object.defineProperty(N0,"__esModule",{value:!0}),N0.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 N0}var aL;function Jk(){if(aL)return ai;aL=1,Object.defineProperty(ai,"__esModule",{value:!0}),ai.CronExpressionParser=ai.DayOfWeek=ai.Months=ai.CronUnit=ai.PredefinedExpressions=void 0;const e=f$(),t=p$(),n=fCe(),r=zD();var o;(function(u){u["@yearly"]="0 0 0 1 1 *",u["@annually"]="0 0 0 1 1 *",u["@monthly"]="0 0 0 1 * *",u["@weekly"]="0 0 0 * * 0",u["@daily"]="0 0 0 * * *",u["@hourly"]="0 0 * * * *",u["@minutely"]="0 * * * * *",u["@secondly"]="* * * * * *",u["@weekdays"]="0 0 0 * * 1-5",u["@weekends"]="0 0 0 * * 0,6"})(o||(ai.PredefinedExpressions=o={}));var a;(function(u){u.Second="Second",u.Minute="Minute",u.Hour="Hour",u.DayOfMonth="DayOfMonth",u.Month="Month",u.DayOfWeek="DayOfWeek"})(a||(ai.CronUnit=a={}));var i;(function(u){u[u.jan=1]="jan",u[u.feb=2]="feb",u[u.mar=3]="mar",u[u.apr=4]="apr",u[u.may=5]="may",u[u.jun=6]="jun",u[u.jul=7]="jul",u[u.aug=8]="aug",u[u.sep=9]="sep",u[u.oct=10]="oct",u[u.nov=11]="nov",u[u.dec=12]="dec"})(i||(ai.Months=i={}));var s;(function(u){u[u.sun=0]="sun",u[u.mon=1]="mon",u[u.tue=2]="tue",u[u.wed=3]="wed",u[u.thu=4]="thu",u[u.fri=5]="fri",u[u.sat=6]="sat"})(s||(ai.DayOfWeek=s={}));let c=class li{static parse(f,p={}){const{strict:y=!1,hashSeed:g}=p,b=(0,n.seededRandom)(g);f=o[f]||f;const x=li.#e(f,y);if(!(x.dayOfMonth==="*"||x.dayOfWeek==="*"||!y))throw new Error("Cannot use both dayOfMonth and dayOfWeek together in strict mode!");const E=li.#t(a.Second,x.second,r.CronSecond.constraints,b),S=li.#t(a.Minute,x.minute,r.CronMinute.constraints,b),w=li.#t(a.Hour,x.hour,r.CronHour.constraints,b),C=li.#t(a.Month,x.month,r.CronMonth.constraints,b),R=li.#t(a.DayOfMonth,x.dayOfMonth,r.CronDayOfMonth.constraints,b),{dayOfWeek:M,nthDayOfWeek:D}=li.#f(x.dayOfWeek),I=li.#t(a.DayOfWeek,M,r.CronDayOfWeek.constraints,b),L=new e.CronFieldCollection({second:new r.CronSecond(E,{rawValue:x.second}),minute:new r.CronMinute(S,{rawValue:x.minute}),hour:new r.CronHour(w,{rawValue:x.hour}),dayOfMonth:new r.CronDayOfMonth(R,{rawValue:x.dayOfMonth}),month:new r.CronMonth(C,{rawValue:x.month}),dayOfWeek:new r.CronDayOfWeek(I,{rawValue:x.dayOfWeek,nthDayOfWeek:D})});return new t.CronExpression(L,{...p,expression:f})}static#e(f,p){if(p&&!f.length)throw new Error("Invalid cron expression");f=f||"0 * * * * *";const y=f.trim().split(/\s+/);if(p&&y.length<6)throw new Error("Invalid cron expression, expected 6 fields");if(y.length>6)throw new Error("Invalid cron expression, too many fields");const g=["*","*","*","*","*","0"];y.length<g.length&&y.unshift(...g.slice(y.length));const[b,x,E,S,w,C]=y;return{second:b,minute:x,hour:E,dayOfMonth:S,month:w,dayOfWeek:C}}static#t(f,p,y,g){if((f===a.Month||f===a.DayOfWeek)&&(p=p.replace(/[a-z]{3}/gi,b=>{b=b.toLowerCase();const x=i[b]||s[b];if(x===void 0)throw new Error(`Validation error, cannot resolve alias "${b}"`);return x.toString()})),!y.validChars.test(p))throw new Error(`Invalid characters, got value: ${p}`);return p=this.#n(p,y),p=this.#o(p,y,g),this.#r(f,p,y)}static#n(f,p){return f.replace(/[*?]/g,p.min+"-"+p.max)}static#o(f,p,y){const g=y();return f.replace(/H(?:\((\d+)-(\d+)\))?(?:\/(\d+))?/g,(b,x,E,S)=>{if(x&&E&&S){const w=parseInt(x,10),C=parseInt(E,10),R=parseInt(S,10);if(w>C)throw new Error(`Invalid range: ${w}-${C}, min > max`);if(R<=0)throw new Error(`Invalid step: ${R}, must be positive`);const M=Math.max(w,p.min),D=Math.floor(g*R),I=[];for(let L=Math.floor(M/R)*R+D;L<=C;L+=R)L>=M&&I.push(L);return I.join(",")}else if(x&&E){const w=parseInt(x,10),C=parseInt(E,10);if(w>C)throw new Error(`Invalid range: ${w}-${C}, min > max`);return String(Math.floor(g*(C-w+1))+w)}else if(S){const w=parseInt(S,10);if(w<=0)throw new Error(`Invalid step: ${w}, must be positive`);const C=Math.floor(g*w),R=[];for(let M=Math.floor(p.min/w)*w+C;M<=p.max;M+=w)M>=p.min&&R.push(M);return R.join(",")}else return String(Math.floor(g*(p.max-p.min+1)+p.min))})}static#r(f,p,y){const g=[];function b(x,E){if(Array.isArray(x))g.push(...x);else if(li.#u(E,x))g.push(x);else{const S=parseInt(x.toString(),10);if(!(S>=E.min&&S<=E.max))throw new Error(`Constraint error, got value ${x} expected range ${E.min}-${E.max}`);g.push(f===a.DayOfWeek?S%7:x)}}return p.split(",").forEach(x=>{if(!(x.length>0))throw new Error("Invalid list value format");b(li.#a(f,x,y),y)}),g}static#a(f,p,y){const g=p.split("/");if(g.length>2)throw new Error(`Invalid repeat: ${p}`);return g.length===2?(g[0].includes("-")||(g[0]=`${g[0]}-${y.max}`),li.#l(f,g[0],parseInt(g[1],10),y)):li.#l(f,p,1,y)}static#s(f,p,y){if(!(!isNaN(f)&&!isNaN(p)&&f>=y.min&&p<=y.max))throw new Error(`Constraint error, got range ${f}-${p} expected range ${y.min}-${y.max}`);if(f>p)throw new Error(`Invalid range: ${f}-${p}, min(${f}) > max(${p})`)}static#i(f){if(!(!isNaN(f)&&f>0))throw new Error(`Constraint error, cannot repeat at every ${f} time.`)}static#c(f,p,y,g){const b=[];f===a.DayOfWeek&&y%7===0&&b.push(0);for(let x=p;x<=y;x+=g)b.indexOf(x)===-1&&b.push(x);return b}static#l(f,p,y,g){const b=p.split("-");if(b.length<=1)return isNaN(+p)?p:+p;const[x,E]=b.map(S=>parseInt(S,10));return this.#s(x,E,g),this.#i(y),this.#c(f,x,E,y)}static#f(f){const p=f.split("#");if(p.length<=1)return{dayOfWeek:p[0]};const y=+p[p.length-1],g=f.match(/([,-/])/);if(g!==null)throw new Error(`Constraint error, invalid dayOfWeek \`#\` and \`${g?.[0]}\` special characters are incompatible`);if(!(p.length<=2&&!isNaN(y)&&y>=1&&y<=5))throw new Error("Constraint error, invalid dayOfWeek occurrence number (#)");return{dayOfWeek:p[0],nthDayOfWeek:y}}static#u(f,p){return f.chars.some(y=>p.toString().includes(y))}};return ai.CronExpressionParser=c,ai}var ws={};const pCe={},hCe=Object.freeze(Object.defineProperty({__proto__:null,default:pCe},Symbol.toStringTag,{value:"Module"})),iL=bse(hCe);var sL;function mCe(){if(sL)return ws;sL=1;var e=ws&&ws.__createBinding||(Object.create?(function(a,i,s,c){c===void 0&&(c=s);var u=Object.getOwnPropertyDescriptor(i,s);(!u||("get"in u?!i.__esModule:u.writable||u.configurable))&&(u={enumerable:!0,get:function(){return i[s]}}),Object.defineProperty(a,c,u)}):(function(a,i,s,c){c===void 0&&(c=s),a[c]=i[s]})),t=ws&&ws.__setModuleDefault||(Object.create?(function(a,i){Object.defineProperty(a,"default",{enumerable:!0,value:i})}):function(a,i){a.default=i}),n=ws&&ws.__importStar||(function(){var a=function(i){return a=Object.getOwnPropertyNames||function(s){var c=[];for(var u in s)Object.prototype.hasOwnProperty.call(s,u)&&(c[c.length]=u);return c},a(i)};return function(i){if(i&&i.__esModule)return i;var s={};if(i!=null)for(var c=a(i),u=0;u<c.length;u++)c[u]!=="default"&&e(s,i,c[u]);return t(s,i),s}})();Object.defineProperty(ws,"__esModule",{value:!0}),ws.CronFileParser=void 0;const r=Jk();let o=class h1{static async parseFile(i){const{readFile:s}=await Promise.resolve().then(()=>n(iL)),c=await s(i,"utf8");return h1.#e(c)}static parseFileSync(i){const{readFileSync:s}=iL,c=s(i,"utf8");return h1.#e(c)}static#e(i){const s=i.split(`
428
- `),c={variables:{},expressions:[],errors:{}};for(const u of s){const f=u.trim();if(f.length===0||f.startsWith("#"))continue;const p=f.match(/^(.*)=(.*)$/);if(p){const[,y,g]=p;c.variables[y]=g.replace(/["']/g,"");continue}try{const y=h1.#t(f);c.expressions.push(y.interval)}catch(y){c.errors[f]=y}}return c}static#t(i){const s=i.split(" ");return{interval:r.CronExpressionParser.parse(s.slice(0,5).join(" ")),command:s.slice(5,s.length)}}};return ws.CronFileParser=o,ws}var lL;function gCe(){return lL||(lL=1,(function(e){var t=cp&&cp.__createBinding||(Object.create?(function(u,f,p,y){y===void 0&&(y=p);var g=Object.getOwnPropertyDescriptor(f,p);(!g||("get"in g?!f.__esModule:g.writable||g.configurable))&&(g={enumerable:!0,get:function(){return f[p]}}),Object.defineProperty(u,y,g)}):(function(u,f,p,y){y===void 0&&(y=p),u[y]=f[p]})),n=cp&&cp.__exportStar||function(u,f){for(var p in u)p!=="default"&&!Object.prototype.hasOwnProperty.call(f,p)&&t(f,u,p)};Object.defineProperty(e,"__esModule",{value:!0}),e.CronFileParser=e.CronExpressionParser=e.CronExpression=e.CronFieldCollection=e.CronDate=void 0;const r=Jk();var o=$D();Object.defineProperty(e,"CronDate",{enumerable:!0,get:function(){return o.CronDate}});var a=f$();Object.defineProperty(e,"CronFieldCollection",{enumerable:!0,get:function(){return a.CronFieldCollection}});var i=p$();Object.defineProperty(e,"CronExpression",{enumerable:!0,get:function(){return i.CronExpression}});var s=Jk();Object.defineProperty(e,"CronExpressionParser",{enumerable:!0,get:function(){return s.CronExpressionParser}});var c=mCe();Object.defineProperty(e,"CronFileParser",{enumerable:!0,get:function(){return c.CronFileParser}}),n(zD(),e),e.default=r.CronExpressionParser})(cp)),cp}var yCe=gCe(),cL={exports:{}},uL;function bCe(){return uL||(uL=1,(function(e,t){(function(n,r){e.exports=r()})(globalThis,()=>(()=>{var n={949:((i,s,c)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.CronParser=void 0;var u=c(515),f=(function(){function p(y,g,b){g===void 0&&(g=!0),b===void 0&&(b=!1),this.expression=y,this.dayOfWeekStartIndexZero=g,this.monthStartIndexZero=b}return p.prototype.parse=function(){var y,g,b=(y=this.expression)!==null&&y!==void 0?y:"";if(b==="@reboot")return g=["@reboot","","","","","",""],g;if(b.startsWith("@")){var x=this.parseSpecial(this.expression);g=this.extractParts(x)}else g=this.extractParts(this.expression);return this.normalize(g),this.validate(g),g},p.prototype.parseSpecial=function(y){var g={"@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=g[y];if(!b)throw new Error("Unknown special expression.");return b},p.prototype.extractParts=function(y){if(!this.expression)throw new Error("cron expression is empty");for(var g=y.trim().split(/[ ]+/),b=0;b<g.length;b++)if(g[b].includes(",")){var x=g[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,w){return S!==null&&w!==null?S-w:0}),g[b]=x.map(function(S){return S!==null?S.toString():""}).join(",")}if(g.length<5)throw new Error("Expression has only ".concat(g.length," part").concat(g.length==1?"":"s",". At least 5 parts are required."));if(g.length==5)g.unshift(""),g.push("");else if(g.length==6){var E=/\d{4}$/.test(g[5])||g[4]=="?"||g[2]=="?";E?g.unshift(""):g.push("")}else if(g.length>7)throw new Error("Expression has ".concat(g.length," parts; too many!"));return g},p.prototype.normalize=function(y){var g=this;if(y[3]=y[3].replace("?","*"),y[5]=y[5].replace("?","*"),y[2]=y[2].replace("?","*"),y[0].indexOf("0/")==0&&(y[0]=y[0].replace("0/","*/")),y[1].indexOf("0/")==0&&(y[1]=y[1].replace("0/","*/")),y[2].indexOf("0/")==0&&(y[2]=y[2].replace("0/","*/")),y[3].indexOf("1/")==0&&(y[3]=y[3].replace("1/","*/")),y[4].indexOf("1/")==0&&(y[4]=y[4].replace("1/","*/")),y[6].indexOf("1/")==0&&(y[6]=y[6].replace("1/","*/")),y[5]=y[5].replace(/(^\d)|([^#/\s]\d)/g,function(M){var D=M.replace(/\D/,""),I=D;return g.dayOfWeekStartIndexZero?D=="7"&&(I="0"):I=(parseInt(D)-1).toString(),M.replace(D,I)}),y[5]=="L"&&(y[5]="6"),y[3]=="?"&&(y[3]="*"),y[3].indexOf("W")>-1&&(y[3].indexOf(",")>-1||y[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)y[5]=y[5].replace(new RegExp(x,"gi"),b[x].toString());y[4]=y[4].replace(/(^\d{1,2})|([^#/\s]\d{1,2})/g,function(M){var D=M.replace(/\D/,""),I=D;return g.monthStartIndexZero&&(I=(parseInt(D)+1).toString()),M.replace(D,I)});var E={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 E)y[4]=y[4].replace(new RegExp(S,"gi"),E[S].toString());y[0]=="0"&&(y[0]=""),!/\*|\-|\,|\//.test(y[2])&&(/\*|\//.test(y[1])||/\*|\//.test(y[0]))&&(y[2]+="-".concat(y[2]));for(var w=0;w<y.length;w++)if(y[w].indexOf(",")!=-1&&(y[w]=y[w].split(",").filter(function(M){return M!==""}).join(",")||"*"),y[w]=="*/1"&&(y[w]="*"),y[w].indexOf("/")>-1&&!/^\*|\-|\,/.test(y[w])){var C=null;switch(w){case 4:C="12";break;case 5:C="6";break;case 6:C="9999";break;default:C=null;break}if(C!==null){var R=y[w].split("/");y[w]="".concat(R[0],"-").concat(C,"/").concat(R[1])}}},p.prototype.validate=function(y){var g="0-9,\\-*/";this.validateOnlyExpectedCharactersFound(y[0],g),this.validateOnlyExpectedCharactersFound(y[1],g),this.validateOnlyExpectedCharactersFound(y[2],g),this.validateOnlyExpectedCharactersFound(y[3],"0-9,\\-*/LW"),this.validateOnlyExpectedCharactersFound(y[4],g),this.validateOnlyExpectedCharactersFound(y[5],"0-9,\\-*/L#"),this.validateOnlyExpectedCharactersFound(y[6],g),this.validateAnyRanges(y)},p.prototype.validateAnyRanges=function(y){u.default.secondRange(y[0]),u.default.minuteRange(y[1]),u.default.hourRange(y[2]),u.default.dayOfMonthRange(y[3]),u.default.monthRange(y[4],this.monthStartIndexZero),u.default.dayOfWeekRange(y[5],this.dayOfWeekStartIndexZero)},p.prototype.validateOnlyExpectedCharactersFound=function(y,g){var b=y.match(new RegExp("[^".concat(g,"]+"),"gi"));if(b&&b.length)throw new Error("Expression contains invalid values: '".concat(b.toString(),"'"))},p})();s.CronParser=f}),333:((i,s,c)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.ExpressionDescriptor=void 0;var u=c(823),f=c(949),p=(function(){function y(g,b){if(this.expression=g,this.options=b,this.expressionParts=new Array(5),!this.options.locale&&y.defaultLocale&&(this.options.locale=y.defaultLocale),!y.locales[this.options.locale]){var x=Object.keys(y.locales)[0];console.warn("Locale '".concat(this.options.locale,"' could not be found; falling back to '").concat(x,"'.")),this.options.locale=x}this.i18n=y.locales[this.options.locale],b.use24HourTimeFormat===void 0&&(b.use24HourTimeFormat=this.i18n.use24HourTimeFormatByDefault())}return y.toString=function(g,b){var x=b===void 0?{}:b,E=x.throwExceptionOnParseError,S=E===void 0?!0:E,w=x.verbose,C=w===void 0?!1:w,R=x.dayOfWeekStartIndexZero,M=R===void 0?!0:R,D=x.monthStartIndexZero,I=D===void 0?!1:D,L=x.use24HourTimeFormat,F=x.locale,B=F===void 0?null:F,U={throwExceptionOnParseError:S,verbose:C,dayOfWeekStartIndexZero:M,monthStartIndexZero:I,use24HourTimeFormat:L,locale:B};U.tzOffset&&console.warn("'tzOffset' option has been deprecated and is no longer supported.");var k=new y(g,U);return k.getFullDescription()},y.initialize=function(g,b){b===void 0&&(b="en"),y.specialCharacters=["/","-",",","*"],y.defaultLocale=b,g.load(y.locales)},y.prototype.getFullDescription=function(){var g,b,x="";try{var E=new f.CronParser(this.expression,this.options.dayOfWeekStartIndexZero,this.options.monthStartIndexZero);if(this.expressionParts=E.parse(),this.expressionParts[0]==="@reboot")return((b=(g=this.i18n).atReboot)===null||b===void 0?void 0:b.call(g))||"Run once, at startup";var S=this.getTimeOfDayDescription(),w=this.getDayOfMonthDescription(),C=this.getMonthDescription(),R=this.getDayOfWeekDescription(),M=this.getYearDescription();x+=S+w+R+C+M,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},y.prototype.getTimeOfDayDescription=function(){var g=this.expressionParts[0],b=this.expressionParts[1],x=this.expressionParts[2],E="";if(!u.StringUtilities.containsAny(b,y.specialCharacters)&&!u.StringUtilities.containsAny(x,y.specialCharacters)&&!u.StringUtilities.containsAny(g,y.specialCharacters))E+=this.i18n.atSpace()+this.formatTime(x,b,g);else if(!g&&b.indexOf("-")>-1&&!(b.indexOf(",")>-1)&&!(b.indexOf("/")>-1)&&!u.StringUtilities.containsAny(x,y.specialCharacters)){var S=b.split("-");E+=u.StringUtilities.format(this.i18n.everyMinuteBetweenX0AndX1(),this.formatTime(x,S[0],""),this.formatTime(x,S[1],""))}else if(!g&&x.indexOf(",")>-1&&x.indexOf("-")==-1&&x.indexOf("/")==-1&&!u.StringUtilities.containsAny(b,y.specialCharacters)){var w=x.split(",");E+=this.i18n.at();for(var C=0;C<w.length;C++)E+=" ",E+=this.formatTime(w[C],b,""),C<w.length-2&&(E+=","),C==w.length-2&&(E+=this.i18n.spaceAnd())}else{var R=this.getSecondsDescription(),M=this.getMinutesDescription(),D=this.getHoursDescription();if(E+=R,E&&M&&(E+=", "),E+=M,M===D)return E;E&&D&&(E+=", "),E+=D}return E},y.prototype.getSecondsDescription=function(){var g=this,b=this.getSegmentDescription(this.expressionParts[0],this.i18n.everySecond(),function(x){return x},function(x){return u.StringUtilities.format(g.i18n.everyX0Seconds(x),x)},function(x){return g.i18n.secondsX0ThroughX1PastTheMinute()},function(x){return x=="0"?"":parseInt(x)<20?g.i18n.atX0SecondsPastTheMinute(x):g.i18n.atX0SecondsPastTheMinuteGt20()||g.i18n.atX0SecondsPastTheMinute(x)});return b},y.prototype.getMinutesDescription=function(){var g=this,b=this.expressionParts[0],x=this.expressionParts[2],E=this.getSegmentDescription(this.expressionParts[1],this.i18n.everyMinute(),function(S){return S},function(S){return u.StringUtilities.format(g.i18n.everyX0Minutes(S),S)},function(S){return g.i18n.minutesX0ThroughX1PastTheHour()},function(S){try{return S=="0"&&x.indexOf("/")==-1&&b==""?g.i18n.everyHour():parseInt(S)<20?g.i18n.atX0MinutesPastTheHour(S):g.i18n.atX0MinutesPastTheHourGt20()||g.i18n.atX0MinutesPastTheHour(S)}catch{return g.i18n.atX0MinutesPastTheHour(S)}});return E},y.prototype.getHoursDescription=function(){var g=this,b=this.expressionParts[2],x=0,E=[];b.split("/")[0].split(",").forEach(function(C){var R=C.split("-");R.length===2&&E.push({value:R[1],index:x+1}),x+=R.length});var S=0,w=this.getSegmentDescription(b,this.i18n.everyHour(),function(C){var R=E.find(function(D){return D.value===C&&D.index===S}),M=R&&g.expressionParts[1]!=="0";return S++,M?g.formatTime(C,"59",""):g.formatTime(C,"0","")},function(C){return u.StringUtilities.format(g.i18n.everyX0Hours(C),C)},function(C){return g.i18n.betweenX0AndX1()},function(C){return g.i18n.atX0()});return w},y.prototype.getDayOfWeekDescription=function(){var g=this,b=this.i18n.daysOfTheWeek(),x=null;return this.expressionParts[5]=="*"?x="":x=this.getSegmentDescription(this.expressionParts[5],this.i18n.commaEveryDay(),function(E,S){var w=E;E.indexOf("#")>-1?w=E.substring(0,E.indexOf("#")):E.indexOf("L")>-1&&(w=w.replace("L",""));var C=parseInt(w),R=g.i18n.daysOfTheWeekInCase?g.i18n.daysOfTheWeekInCase(S)[C]:b[C];if(E.indexOf("#")>-1){var M=null,D=E.substring(E.indexOf("#")+1),I=E.substring(0,E.indexOf("#"));switch(D){case"1":M=g.i18n.first(I);break;case"2":M=g.i18n.second(I);break;case"3":M=g.i18n.third(I);break;case"4":M=g.i18n.fourth(I);break;case"5":M=g.i18n.fifth(I);break}R=M+" "+R}return R},function(E){return parseInt(E)==1?"":u.StringUtilities.format(g.i18n.commaEveryX0DaysOfTheWeek(E),E)},function(E){var S=E.substring(0,E.indexOf("-")),w=g.expressionParts[3]!="*";return w?g.i18n.commaAndX0ThroughX1(S):g.i18n.commaX0ThroughX1(S)},function(E){var S=null;if(E.indexOf("#")>-1){var w=E.substring(E.indexOf("#")+1),C=E.substring(0,E.indexOf("#"));S=g.i18n.commaOnThe(w,C).trim()+g.i18n.spaceX0OfTheMonth()}else if(E.indexOf("L")>-1)S=g.i18n.commaOnTheLastX0OfTheMonth(E.replace("L",""));else{var R=g.expressionParts[3]!="*";S=R?g.i18n.commaAndOnX0():g.i18n.commaOnlyOnX0(E)}return S}),x},y.prototype.getMonthDescription=function(){var g=this,b=this.i18n.monthsOfTheYear(),x=this.getSegmentDescription(this.expressionParts[4],"",function(E,S){return S&&g.i18n.monthsOfTheYearInCase?g.i18n.monthsOfTheYearInCase(S)[parseInt(E)-1]:b[parseInt(E)-1]},function(E){return parseInt(E)==1?"":u.StringUtilities.format(g.i18n.commaEveryX0Months(E),E)},function(E){return g.i18n.commaMonthX0ThroughMonthX1()||g.i18n.commaX0ThroughX1()},function(E){return g.i18n.commaOnlyInMonthX0?g.i18n.commaOnlyInMonthX0():g.i18n.commaOnlyInX0()});return x},y.prototype.getDayOfMonthDescription=function(){var g=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 E=x.match(/(\d{1,2}W)|(W\d{1,2})/);if(E){var S=parseInt(E[0].replace("W","")),w=S==1?this.i18n.firstWeekday():u.StringUtilities.format(this.i18n.weekdayNearestDayX0(),S.toString());b=u.StringUtilities.format(this.i18n.commaOnTheX0OfTheMonth(),w);break}else{var C=x.match(/L-(\d{1,2})/);if(C){var R=C[1];b=u.StringUtilities.format(this.i18n.commaDaysBeforeTheLastDayOfTheMonth(R),R);break}else{if(x=="*"&&this.expressionParts[5]!="*")return"";b=this.getSegmentDescription(x,this.i18n.commaEveryDay(),function(M){return M=="L"?g.i18n.lastDay():g.i18n.dayX0?u.StringUtilities.format(g.i18n.dayX0(),M):M},function(M){return M=="1"?g.i18n.commaEveryDay():g.i18n.commaEveryX0Days(M)},function(M){return g.i18n.commaBetweenDayX0AndX1OfTheMonth(M)},function(M){return g.i18n.commaOnDayX0OfTheMonth(M)})}break}}return b},y.prototype.getYearDescription=function(){var g=this,b=this.getSegmentDescription(this.expressionParts[6],"",function(x){return/^\d+$/.test(x)?new Date(parseInt(x),1).getFullYear().toString():x},function(x){return u.StringUtilities.format(g.i18n.commaEveryX0Years(x),x)},function(x){return g.i18n.commaYearX0ThroughYearX1()||g.i18n.commaX0ThroughX1()},function(x){return g.i18n.commaOnlyInYearX0?g.i18n.commaOnlyInYearX0():g.i18n.commaOnlyInX0()});return b},y.prototype.getSegmentDescription=function(g,b,x,E,S,w){var C=null,R=g.indexOf("/")>-1,M=g.indexOf("-")>-1,D=g.indexOf(",")>-1;if(!g)C="";else if(g==="*")C=b;else if(!R&&!M&&!D)C=u.StringUtilities.format(w(g),x(g));else if(D){for(var I=g.split(","),L="",F=0;F<I.length;F++)if(F>0&&I.length>2&&(L+=",",F<I.length-1&&(L+=" ")),F>0&&I.length>1&&(F==I.length-1||I.length==2)&&(L+="".concat(this.i18n.spaceAnd()," ")),I[F].indexOf("/")>-1||I[F].indexOf("-")>-1){var B=I[F].indexOf("-")>-1&&I[F].indexOf("/")==-1,U=this.getSegmentDescription(I[F],b,x,E,B?this.i18n.commaX0ThroughX1:S,w);B&&(U=U.replace(", ","")),L+=U}else R?L+=this.getSegmentDescription(I[F],b,x,E,S,w):L+=x(I[F]);R?C=L:C=u.StringUtilities.format(w(g),L)}else if(R){var I=g.split("/");if(C=u.StringUtilities.format(E(I[1]),I[1]),I[0].indexOf("-")>-1){var k=this.generateRangeSegmentDescription(I[0],S,x);k.indexOf(", ")!=0&&(C+=", "),C+=k}else if(I[0].indexOf("*")==-1){var $=u.StringUtilities.format(w(I[0]),x(I[0]));$=$.replace(", ",""),C+=u.StringUtilities.format(this.i18n.commaStartingX0(),$)}}else M&&(C=this.generateRangeSegmentDescription(g,S,x));return C},y.prototype.generateRangeSegmentDescription=function(g,b,x){var E="",S=g.split("-"),w=x(S[0],1),C=x(S[1],2),R=b(g);return E+=u.StringUtilities.format(R,w,C),E},y.prototype.formatTime=function(g,b,x){var E=0,S=0,w=parseInt(g)+E,C=parseInt(b)+S;C>=60?(C-=60,w+=1):C<0&&(C+=60,w-=1),w>=24?w=w-24:w<0&&(w=24+w);var R="",M=!1;this.options.use24HourTimeFormat||(M=!!(this.i18n.setPeriodBeforeTime&&this.i18n.setPeriodBeforeTime()),R=M?"".concat(this.getPeriod(w)," "):" ".concat(this.getPeriod(w)),w>12&&(w-=12),w===0&&(w=12));var D="";return x&&(D=":".concat(("00"+x).substring(x.length))),"".concat(M?R:"").concat(("00"+w.toString()).substring(w.toString().length),":").concat(("00"+C.toString()).substring(C.toString().length)).concat(D).concat(M?"":R)},y.prototype.transformVerbosity=function(g,b){if(!b&&(g=g.replace(new RegExp(", ".concat(this.i18n.everyMinute()),"g"),""),g=g.replace(new RegExp(", ".concat(this.i18n.everyHour()),"g"),""),g=g.replace(new RegExp(this.i18n.commaEveryDay(),"g"),""),g=g.replace(/\, ?$/,""),this.i18n.conciseVerbosityReplacements))for(var x=0,E=Object.entries(this.i18n.conciseVerbosityReplacements());x<E.length;x++){var S=E[x],w=S[0],C=S[1];g=g.replace(new RegExp(w,"g"),C)}return g},y.prototype.getPeriod=function(g){return g>=12?this.i18n.pm&&this.i18n.pm()||"PM":this.i18n.am&&this.i18n.am()||"AM"},y.locales={},y})();s.ExpressionDescriptor=p}),747:((i,s,c)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.enLocaleLoader=void 0;var u=c(486),f=(function(){function p(){}return p.prototype.load=function(y){y.en=new u.en},p})();s.enLocaleLoader=f}),486:((i,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.en=void 0;var c=(function(){function u(){}return u.prototype.atX0SecondsPastTheMinuteGt20=function(){return null},u.prototype.atX0MinutesPastTheHourGt20=function(){return null},u.prototype.commaMonthX0ThroughMonthX1=function(){return null},u.prototype.commaYearX0ThroughYearX1=function(){return null},u.prototype.use24HourTimeFormatByDefault=function(){return!1},u.prototype.anErrorOccuredWhenGeneratingTheExpressionD=function(){return"An error occurred when generating the expression description. Check the cron expression syntax."},u.prototype.everyMinute=function(){return"every minute"},u.prototype.everyHour=function(){return"every hour"},u.prototype.atSpace=function(){return"At "},u.prototype.everyMinuteBetweenX0AndX1=function(){return"Every minute between %s and %s"},u.prototype.at=function(){return"At"},u.prototype.spaceAnd=function(){return" and"},u.prototype.everySecond=function(){return"every second"},u.prototype.everyX0Seconds=function(){return"every %s seconds"},u.prototype.secondsX0ThroughX1PastTheMinute=function(){return"seconds %s through %s past the minute"},u.prototype.atX0SecondsPastTheMinute=function(){return"at %s seconds past the minute"},u.prototype.everyX0Minutes=function(){return"every %s minutes"},u.prototype.minutesX0ThroughX1PastTheHour=function(){return"minutes %s through %s past the hour"},u.prototype.atX0MinutesPastTheHour=function(){return"at %s minutes past the hour"},u.prototype.everyX0Hours=function(){return"every %s hours"},u.prototype.betweenX0AndX1=function(){return"between %s and %s"},u.prototype.atX0=function(){return"at %s"},u.prototype.commaEveryDay=function(){return", every day"},u.prototype.commaEveryX0DaysOfTheWeek=function(){return", every %s days of the week"},u.prototype.commaX0ThroughX1=function(){return", %s through %s"},u.prototype.commaAndX0ThroughX1=function(){return", %s through %s"},u.prototype.first=function(){return"first"},u.prototype.second=function(){return"second"},u.prototype.third=function(){return"third"},u.prototype.fourth=function(){return"fourth"},u.prototype.fifth=function(){return"fifth"},u.prototype.commaOnThe=function(){return", on the "},u.prototype.spaceX0OfTheMonth=function(){return" %s of the month"},u.prototype.lastDay=function(){return"the last day"},u.prototype.commaOnTheLastX0OfTheMonth=function(){return", on the last %s of the month"},u.prototype.commaOnlyOnX0=function(){return", only on %s"},u.prototype.commaAndOnX0=function(){return", and on %s"},u.prototype.commaEveryX0Months=function(){return", every %s months"},u.prototype.commaOnlyInX0=function(){return", only in %s"},u.prototype.commaOnTheLastDayOfTheMonth=function(){return", on the last day of the month"},u.prototype.commaOnTheLastWeekdayOfTheMonth=function(){return", on the last weekday of the month"},u.prototype.commaDaysBeforeTheLastDayOfTheMonth=function(){return", %s days before the last day of the month"},u.prototype.firstWeekday=function(){return"first weekday"},u.prototype.weekdayNearestDayX0=function(){return"weekday nearest day %s"},u.prototype.commaOnTheX0OfTheMonth=function(){return", on the %s of the month"},u.prototype.commaEveryX0Days=function(){return", every %s days"},u.prototype.commaBetweenDayX0AndX1OfTheMonth=function(){return", between day %s and %s of the month"},u.prototype.commaOnDayX0OfTheMonth=function(){return", on day %s of the month"},u.prototype.commaEveryHour=function(){return", every hour"},u.prototype.commaEveryX0Years=function(){return", every %s years"},u.prototype.commaStartingX0=function(){return", starting %s"},u.prototype.daysOfTheWeek=function(){return["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},u.prototype.monthsOfTheYear=function(){return["January","February","March","April","May","June","July","August","September","October","November","December"]},u.prototype.atReboot=function(){return"Run once, at startup"},u})();s.en=c}),515:((i,s)=>{Object.defineProperty(s,"__esModule",{value:!0});function c(f,p){if(!f)throw new Error(p)}var u=(function(){function f(){}return f.secondRange=function(p){for(var y=p.split(","),g=0;g<y.length;g++)if(!isNaN(parseInt(y[g],10))){var b=parseInt(y[g],10);c(b>=0&&b<=59,"seconds part must be >= 0 and <= 59")}},f.minuteRange=function(p){for(var y=p.split(","),g=0;g<y.length;g++)if(!isNaN(parseInt(y[g],10))){var b=parseInt(y[g],10);c(b>=0&&b<=59,"minutes part must be >= 0 and <= 59")}},f.hourRange=function(p){for(var y=p.split(","),g=0;g<y.length;g++)if(!isNaN(parseInt(y[g],10))){var b=parseInt(y[g],10);c(b>=0&&b<=23,"hours part must be >= 0 and <= 23")}},f.dayOfMonthRange=function(p){for(var y=p.split(","),g=0;g<y.length;g++)if(!isNaN(parseInt(y[g],10))){var b=parseInt(y[g],10);c(b>=1&&b<=31,"DOM part must be >= 1 and <= 31")}},f.monthRange=function(p,y){for(var g=p.split(","),b=0;b<g.length;b++)if(!isNaN(parseInt(g[b],10))){var x=parseInt(g[b],10);c(x>=1&&x<=12,y?"month part must be >= 0 and <= 11":"month part must be >= 1 and <= 12")}},f.dayOfWeekRange=function(p,y){for(var g=p.split(","),b=0;b<g.length;b++)if(!isNaN(parseInt(g[b],10))){var x=parseInt(g[b],10);c(x>=0&&x<=6,y?"DOW part must be >= 0 and <= 6":"DOW part must be >= 1 and <= 7")}},f})();s.default=u}),823:((i,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.StringUtilities=void 0;var c=(function(){function u(){}return u.format=function(f){for(var p=[],y=1;y<arguments.length;y++)p[y-1]=arguments[y];return f.replace(/%s/g,function(g){return p.shift()})},u.containsAny=function(f,p){return p.some(function(y){return f.indexOf(y)>-1})},u})();s.StringUtilities=c})},r={};function o(i){var s=r[i];if(s!==void 0)return s.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 s=o(333),c=o(747);s.ExpressionDescriptor.initialize(new c.enLocaleLoader),i.default=s.ExpressionDescriptor;var u=s.ExpressionDescriptor.toString;i.toString=u})(),a})())})(cL)),cL.exports}var vCe=bCe();const xCe=fs(vCe),SCe=new Set(["JAN","FEB","MAR","APR","MAY","JUN","JUL","AUG","SEP","OCT","NOV","DEC","SUN","MON","TUE","WED","THU","FRI","SAT"]);function ECe(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)&&!SCe.has(n.toUpperCase()))return!1}return!0}function h$(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(!ECe(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=xCe.toString(t,{use24HourTimeFormat:!0,verbose:!1}),r=yCe.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 m$(e){return e?e.toLocaleString(void 0,{year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit",timeZone:"UTC",hour12:!1})+" UTC":"—"}const dL="0 6 * * *";function CCe({currentSchedule:e,isSubmitting:t,disabled:n,disabledReason:r,onSubmit:o}){const[a,i]=T.useState(!1),[s,c]=T.useState(e??dL),u=()=>{c(e??dL),i(!0)},f=()=>i(!1),p=h$(s),y=async b=>{try{await o(b),i(!1)}catch{}},g=m.jsx("span",{children:m.jsx(_r,{variant:"outlined",size:"small",startIcon:m.jsx(nx,{}),onClick:u,disabled:n,"aria-label":e?"Edit schedule":"Set schedule",children:e?"Edit schedule":"Set schedule"})});return m.jsxs(m.Fragment,{children:[n&&r?m.jsx(eo,{title:r,children:g}):g,m.jsxs(wi,{open:a,onClose:f,maxWidth:"xs",fullWidth:!0,"aria-labelledby":"set-schedule-title",children:[m.jsx(Ai,{id:"set-schedule-title",children:e?"Edit schedule":"Set schedule"}),m.jsxs(ki,{children:[m.jsx(Vx,{sx:{mb:2},children:"The publisher rebuilds the materializations in this package on this cadence. Enter a 5-field UNIX cron, evaluated in UTC. In a hosted deployment, the change takes effect on your next publish."}),m.jsx(xu,{autoFocus:!0,fullWidth:!0,label:"Cron expression",value:s,onChange:b=>c(b.target.value),error:s.trim()!==""&&!p.valid,slotProps:{htmlInput:{style:{fontFamily:gi}}}}),m.jsx(gt,{sx:{mt:1.5,minHeight:48},children:p.valid?m.jsxs(m.Fragment,{children:[m.jsx(at,{variant:"body2",children:p.description}),m.jsxs(at,{variant:"body2",color:"text.secondary",children:["Next run: ",m$(p.nextRun)]})]}):m.jsx(at,{variant:"body2",color:"error",children:p.error})}),m.jsxs(xK,{severity:"info",sx:{mt:2},children:["A schedule runs only on version-scoped packages, so saving one sets ",m.jsx("code",{children:"scope: version"})," for this package."]})]}),m.jsxs(dh,{sx:{justifyContent:"space-between",px:3},children:[m.jsx(gt,{children:e&&m.jsx(_r,{color:"error",loading:t,onClick:()=>y(null),children:"Clear schedule"})}),m.jsxs(gt,{children:[m.jsx(_r,{onClick:f,children:"Cancel"}),m.jsx(_r,{variant:"contained",loading:t,disabled:!p.valid,onClick:()=>y(s.trim()),sx:{ml:1},children:"Save"})]})]})]})]})}function TCe({schedule:e,scope:t,manifestLocation:n,hasFreshness:r,mutable:o,isSubmitting:a,isScopeMutating:i,onSubmit:s,onScopeChange:c}){const u=!!n,f=e?h$(e):null,p=!!e;return m.jsx(ch,{variant:"outlined",sx:{borderRadius:2,mb:6},children:m.jsx(uh,{children:m.jsxs(Lr,{direction:"row",justifyContent:"space-between",alignItems:"flex-start",spacing:2,children:[m.jsxs(gt,{sx:{minWidth:0},children:[m.jsxs(Lr,{direction:"row",alignItems:"center",spacing:1,sx:{mb:1},children:[m.jsx(nx,{fontSize:"small",color:"action"}),m.jsx(at,{variant:"h6",sx:{fontWeight:600,letterSpacing:"-0.025em"},children:"Schedule"})]}),u?m.jsxs(gt,{children:[m.jsx(Ld,{size:"small",color:"default",variant:"outlined",label:"Control-plane managed",sx:{mb:1}}),m.jsx(at,{variant:"body2",color:"text.secondary",children:"Refresh is driven by the control plane; the built-in scheduler does not fire this package."})]}):f?m.jsxs(gt,{children:[m.jsxs(Lr,{direction:"row",alignItems:"center",spacing:1,sx:{mb:.5,flexWrap:"wrap"},children:[m.jsx(Ld,{size:"small",color:"success",variant:"outlined",icon:m.jsx(nx,{fontSize:"small"}),label:"Active"}),m.jsx(gt,{component:"code",sx:{fontFamily:gi,fontSize:"0.8125rem",px:.75,py:.25,borderRadius:1,bgcolor:"action.hover"},children:e})]}),m.jsx(at,{variant:"body2",children:f.valid?f.description:"Unrecognized cron expression."}),f.valid&&m.jsxs(at,{variant:"body2",color:"text.secondary",children:["Next run: ",m$(f.nextRun)]})]}):r?m.jsx(at,{variant:"body2",color:"text.secondary",children:"This package uses a freshness policy; a cron schedule is not applicable."}):m.jsx(at,{variant:"body2",color:"text.secondary",children:"On-demand only — no schedule set."}),!u&&m.jsxs(gt,{sx:{mt:2},children:[m.jsx(at,{variant:"caption",color:"text.secondary",sx:{display:"block",mb:.5},children:"Scope"}),m.jsx(eo,{title:p?"A schedule requires version scope. Clear the schedule to change it.":"",children:m.jsx("span",{children:m.jsxs(Hte,{size:"small",exclusive:!0,value:t,disabled:!o||!c||p||!!i,onChange:(y,g)=>{g&&g!==t&&c?.(g)},children:[m.jsx(uI,{value:"package",children:"package"}),m.jsx(uI,{value:"version",children:"version"})]})})}),m.jsx(at,{variant:"caption",color:"text.secondary",sx:{display:"block",mt:.5},children:t==="version"?"Materialized artifacts are per version (required for a schedule).":"Materialized artifacts are shared across versions."})]}),m.jsxs(at,{variant:"caption",color:"text.secondary",sx:{display:"block",mt:1.5},children:["Declared in ",m.jsx("code",{children:"publisher.json"}),".",!u&&m.jsxs(m.Fragment,{children:[" ","In a hosted deployment, a change takes effect on your next publish."]})]})]}),o&&!u&&m.jsx(CCe,{currentSchedule:e,isSubmitting:a,disabled:r,disabledReason:"This package declares a freshness policy; a schedule and freshness are mutually exclusive.",onSubmit:s})]})})})}const wCe=3e3;function gIe({resourceUri:e,onClickPackageFile:t}){const{apiClients:n,mutable:r}=Dr(),o=Ls(),{environmentName:a,packageName:i}=to(e),[s,c]=T.useState(""),[u,f]=T.useState(null),p=t??(F=>{window.location.href=F});if(!i)throw new Error("Materializations requires a package in the resource URI");const y=uo({queryKey:["materializations",a,i],queryFn:()=>n.materializations.listMaterializations(a,i),refetchInterval:F=>(F.state.data?.data??[]).some(B=>Uy(B.status))?wCe:!1}),g=uo({queryKey:["package",a,i],queryFn:()=>n.packages.getPackage(a,i)}),b=()=>o.invalidateQueries({queryKey:["materializations",a,i]}),x=Ho({mutationFn:F=>n.materializations.createMaterialization(a,i,{forceRefresh:F.forceRefresh}),onSuccess(){c("Materialization requested"),b()},onError(F){c(F.message),b()}}),E=Ho({mutationFn:F=>n.materializations.materializationAction(a,i,F.id,rj.Stop),onSuccess(){c("Materialization stopped"),b()},onError(F){c(F.message)}}),S=Ho({mutationFn:({materialization:F,dropTables:B})=>n.materializations.deleteMaterialization(a,i,F.id,B),onSuccess(){c("Materialization deleted"),b()},onError(F){c(F.message)}}),w=g.data?.data,C=Ho({mutationFn:F=>n.packages.updatePackage(a,i,{name:i,description:w?.description,...F?{scope:m0.Version}:{},materialization:{schedule:F}}),onSuccess(F,B){c(B?"Schedule updated":"Schedule cleared"),o.invalidateQueries({queryKey:["package",a,i]})},onError(F){c(F.message)}}),R=Ho({mutationFn:F=>n.packages.updatePackage(a,i,{name:i,description:w?.description,scope:F}),onSuccess(){c("Scope updated"),o.invalidateQueries({queryKey:["package",a,i]})},onError(F){c(F.message)}}),M=y.data?.data??[],D=M.find(F=>F.id===u)??null,I=M.some(F=>Uy(F.status)),L=x.isPending||E.isPending||S.isPending;return m.jsxs(Ux,{maxWidth:!1,sx:{maxWidth:1024,mx:"auto",px:3,py:6},children:[m.jsxs(gt,{sx:{mb:4},children:[m.jsxs(fA,{onClick:F=>p(`/${a}/${i}`,F),underline:"none",sx:{display:"inline-flex",alignItems:"center",gap:.5,cursor:"pointer",color:"text.secondary",fontSize:"0.875rem",mb:2,"&:hover":{color:"primary.main"}},children:[m.jsx(V7,{sx:{fontSize:18}}),"Back to ",i]}),m.jsxs(Lr,{direction:"row",alignItems:"flex-start",justifyContent:"space-between",children:[m.jsxs(gt,{children:[m.jsx(at,{variant:"h4",component:"h1",sx:{fontWeight:600,letterSpacing:"-0.025em",mb:.5},children:"Materializations"}),m.jsxs(at,{variant:"body2",color:"text.secondary",children:["Materialize the persist sources in ",i," into tables and serve queries from them"]})]}),r&&m.jsx(Rxe,{onSubmit:F=>x.mutateAsync(F),isSubmitting:x.isPending,disabled:I,disabledReason:"A materialization is already pending or running for this package."})]})]}),g.isSuccess&&m.jsx(TCe,{schedule:w?.materialization?.schedule??null,scope:w?.scope===m0.Version?"version":"package",manifestLocation:w?.manifestLocation??null,hasFreshness:!!w?.materialization?.freshness,mutable:r,isSubmitting:C.isPending,isScopeMutating:R.isPending,onSubmit:F=>C.mutateAsync(F),onScopeChange:F=>R.mutateAsync(F==="version"?m0.Version:m0.Package)}),m.jsxs(gt,{sx:{mb:6},children:[m.jsx(at,{variant:"h6",sx:{fontWeight:600,letterSpacing:"-0.025em",mb:1},children:"Runs"}),y.isError&&m.jsx(Ta,{error:y.error,context:`${a} > ${i} > Materializations`}),!y.isSuccess&&!y.isError&&m.jsx(Ca,{text:"Loading materializations..."}),y.isSuccess&&m.jsx(u$,{materializations:M,mutable:r,isMutating:L,onStop:F=>E.mutate(F),onDelete:(F,B)=>S.mutate({materialization:F,dropTables:B}),onViewDetails:F=>f(F.id??null)})]}),m.jsx(Q7,{materialization:D,buildPlan:g.data?.data?.buildPlan??null,onClose:()=>f(null)}),m.jsx(_s,{open:s!=="",autoHideDuration:6e3,onClose:()=>c(""),message:s})]})}function kCe({packages:e,onSubmit:t,isSubmitting:n,disabled:r}){const[o,a]=T.useState(!1),[i,s]=T.useState({}),[c,u]=T.useState(!1),f=()=>{s({}),u(!1),a(!0)},p=()=>a(!1),y=e.map(E=>E.name).filter(E=>i[E]),g=E=>s(S=>({...S,[E]:!S[E]})),b=e.length>0&&y.length===e.length,x=async()=>{try{await t({packageNames:y,forceRefresh:c}),a(!1)}catch{}};return m.jsxs(m.Fragment,{children:[m.jsx(_r,{variant:"contained",startIcon:m.jsx(Sb,{}),onClick:f,disabled:r,"aria-label":"New materialization",children:"New materialization"}),m.jsxs(wi,{open:o,onClose:p,maxWidth:"xs",fullWidth:!0,"aria-labelledby":"create-env-materialization-title",children:[m.jsx(Ai,{id:"create-env-materialization-title",children:"New materialization"}),m.jsxs(ki,{children:[m.jsx(Vx,{sx:{mb:1},children:"Pick the packages to materialize. Each runs an independent build of every persist source in that package."}),e.length===0?m.jsx(at,{variant:"body2",color:"text.secondary",children:"No packages in this environment."}):m.jsxs(m.Fragment,{children:[m.jsx(Tp,{control:m.jsx(Ww,{checked:b,indeterminate:y.length>0&&!b,onChange:E=>{const S={};E.target.checked&&e.forEach(w=>S[w.name]=!0),s(S)}}),label:m.jsx(at,{variant:"body2",children:"Select all"})}),m.jsx(gt,{sx:{maxHeight:240,overflowY:"auto",pl:1,borderLeft:"2px solid",borderColor:"divider"},children:m.jsx(lF,{children:e.map(E=>m.jsx(Tp,{control:m.jsx(Ww,{checked:!!i[E.name],onChange:()=>g(E.name)}),label:E.name},E.name))})}),m.jsx(Tp,{sx:{mt:1},control:m.jsx(yA,{checked:c,onChange:E=>u(E.target.checked)}),label:"Force refresh (rebuild even if unchanged)"})]})]}),m.jsxs(dh,{children:[m.jsx(_r,{onClick:p,children:"Cancel"}),m.jsxs(_r,{variant:"contained",loading:n,disabled:y.length===0,onClick:x,children:["Materialize",y.length>0?` (${y.length})`:""]})]})]})]})}const ACe=3e3,fL=10;function DCe({resourceUri:e,onClickPackageFile:t}){const{apiClients:n,mutable:r}=Dr(),o=Ls(),{environmentName:a}=to(e),[i,s]=T.useState(""),[c,u]=T.useState(null),[f,p]=T.useState(fL),y=t??(L=>{window.location.href=L}),g=uo({queryKey:["env-materializations",a,f],queryFn:()=>n.materializations.listEnvironmentMaterializations(a,f),placeholderData:L=>L,refetchInterval:L=>(L.state.data?.data??[]).some(F=>Uy(F.status))?ACe:!1}),b=uo({queryKey:["packages",a],queryFn:()=>n.packages.listPackages(a)}),x=()=>o.invalidateQueries({queryKey:["env-materializations",a]}),E=Ho({mutationFn:async L=>{const F=(await Promise.allSettled(L.packageNames.map(B=>n.materializations.createMaterialization(a,B,{forceRefresh:L.forceRefresh})))).filter(B=>B.status==="rejected").length;return{total:L.packageNames.length,failed:F}},onSuccess(L){const F=L.total-L.failed;s(L.failed===0?`Started ${F} materialization${F===1?"":"s"}`:`Started ${F} of ${L.total} (${L.failed} could not start — a build may already be active)`),x()},onError(L){s(L.message),x()}}),S=Ho({mutationFn:L=>n.materializations.materializationAction(a,L.packageName,L.id,rj.Stop),onSuccess(){s("Materialization stopped"),x()},onError(L){s(L.message)}}),w=Ho({mutationFn:({materialization:L,dropTables:F})=>n.materializations.deleteMaterialization(a,L.packageName,L.id,F),onSuccess(){s("Materialization deleted"),x()},onError(L){s(L.message)}}),C=g.data?.data??[],R=b.data?.data??[],M=C.find(L=>L.id===c)??null,D=E.isPending||S.isPending||w.isPending,I=C.length>=f;return m.jsxs(gt,{children:[m.jsxs(gt,{sx:{display:"flex",alignItems:"flex-start",justifyContent:"space-between",mb:3},children:[m.jsxs(gt,{children:[m.jsx(at,{variant:"h6",sx:{fontWeight:600,letterSpacing:"-0.025em"},children:"Materializations"}),m.jsx(at,{variant:"body2",color:"text.secondary",children:"All materialization builds across the packages in this environment"})]}),r&&m.jsx(kCe,{packages:R,onSubmit:L=>E.mutateAsync(L),isSubmitting:E.isPending})]}),g.isError&&m.jsx(Ta,{error:g.error,context:`${a} > Materializations`}),!g.isSuccess&&!g.isError&&m.jsx(Ca,{text:"Loading materializations..."}),g.isSuccess&&m.jsx(u$,{materializations:C,mutable:r,isMutating:D,showPackage:!0,onClickPackage:L=>y(`/${a}/${L}/materializations`),onStop:L=>S.mutate(L),onDelete:(L,F)=>w.mutate({materialization:L,dropTables:F}),onViewDetails:L=>u(L.id??null)}),g.isSuccess&&C.length>0&&m.jsxs(Lr,{direction:"row",alignItems:"center",justifyContent:"center",spacing:2,sx:{mt:2},children:[m.jsx(at,{variant:"caption",color:"text.secondary",children:I?`Showing ${C.length} most recent`:`${C.length} materialization${C.length===1?"":"s"}`}),I&&m.jsx(_r,{size:"small",onClick:()=>p(L=>L+fL),disabled:g.isFetching,children:"Show more"})]}),m.jsx(Q7,{materialization:M,buildPlan:null,showBuildPlan:!1,onClose:()=>u(null)}),m.jsx(_s,{open:i!=="",autoHideDuration:6e3,onClose:()=>s(""),message:i})]})}function OCe({resourceUri:e}){const{environmentName:t}=to(e),{apiClients:n}=Dr(),[r,o]=T.useState(!1),a=90,{data:i,isSuccess:s,isError:c,error:u}=uo({queryKey:["about",t],queryFn:()=>n.environments.getEnvironment(t,!1)}),f=i?.data?.readme||"",p=f.split(/\s+/),y=p.length>a,g=p.slice(0,a).join(" ");return m.jsxs(m.Fragment,{children:[!s&&!c&&m.jsx(Ca,{text:"Fetching About..."}),s&&f&&m.jsx(koe,{children:m.jsxs(Aoe,{children:[m.jsx(Doe,{children:"Readme"}),m.jsxs(gt,{sx:{mt:1,fontSize:"0.875rem",lineHeight:1.6},children:[m.jsx(F1,{options:{overrides:{h1:{component:"p",props:{style:{fontSize:"inherit",fontWeight:"italic"}}},h2:{component:"p",props:{style:{fontSize:"inherit",fontWeight:"italic"}}},h3:{component:"p",props:{style:{fontSize:"inherit",fontWeight:"italic"}}}}},children:r||!y?f:g}),y&&m.jsxs(gt,{sx:{mt:1},children:[" ",m.jsx(_r,{variant:"text",size:"small",onClick:()=>o(!r),children:r?"Read less":"Read more"})]})]})]})}),c&&m.jsx(Ta,{error:u,context:`${t} > About`})]})}const g$="https://docs.malloydata.dev/documentation",fw=`${g$}/user_guides/publishing`,fy={docsHome:`${g$}/`,publishing:`${fw}/publishing`,explorer:`${fw}/explorer`,mcpAgents:`${fw}/mcp_agents`};function RCe({resourceUri:e}){const[t,n]=T.useState(!1),{apiClients:r}=Dr(),o=Ls(),[a,i]=T.useState(""),{environmentName:s}=to(e),c=Ho({async mutationFn(f){return r.packages.createPackage(s,{name:f.name,description:f.description,location:f.location})},onSuccess(){n(!1),i("Package created successfully"),o.invalidateQueries({queryKey:["packages",s]})},onError(f){i(f instanceof Error?f.message:"An unknown error occurred")}}),u=f=>{f.preventDefault();const p=new FormData(f.currentTarget),y=p.get("name")?.toString(),g=p.get("description")?.toString(),b=p.get("location")?.toString();c.mutate({name:y,description:g,location:b})};return m.jsxs(m.Fragment,{children:[m.jsx(_r,{onClick:()=>n(!0),variant:"contained",color:"primary",startIcon:m.jsx(Gae,{}),children:"Add Package"}),m.jsxs(wi,{open:t,onClose:()=>n(!1),maxWidth:"sm",fullWidth:!0,PaperProps:{sx:{borderRadius:2}},children:[m.jsx(Ai,{sx:{fontSize:"1.25rem",fontWeight:600,letterSpacing:"-0.025em",pt:3,pb:1,px:3},children:"Create New Package"}),m.jsxs(ki,{sx:{px:3,pb:0},children:[m.jsxs(gt,{sx:{mb:3},children:[m.jsx(at,{variant:"body2",color:"text.secondary",sx:{mb:1.5},children:"Create a new Malloy package to start exploring your data."}),m.jsx(at,{variant:"body2",color:"text.secondary",sx:{mb:1.5},children:"The location can be a GitHub/S3/GCP URL containing a package (zipped or unzipped), or an absolute path to a directory the publisher server has access to."}),m.jsxs(at,{variant:"body2",color:"text.secondary",children:["Make sure to conform to the"," ",m.jsx(gt,{component:"a",href:fy.publishing,target:"_blank",rel:"noopener noreferrer",sx:{color:"text.primary",textDecoration:"underline"},children:"Malloy Package Format"}),"."]})]}),m.jsx("form",{onSubmit:u,id:"package-form",children:m.jsxs(Lr,{spacing:2.5,children:[m.jsx(xu,{autoFocus:!0,required:!0,id:"name",name:"name",label:"Package Name",type:"text",fullWidth:!0,variant:"outlined",size:"small",InputLabelProps:{shrink:!0}}),m.jsx(xu,{id:"description",name:"description",label:"Description",multiline:!0,rows:3,fullWidth:!0,variant:"outlined",size:"small",InputLabelProps:{shrink:!0}}),m.jsx(xu,{id:"location",name:"location",label:"Location",type:"text",placeholder:"e.g. s3://my-bucket/my-package.zip",fullWidth:!0,variant:"outlined",size:"small",InputLabelProps:{shrink:!0}})]})})]}),m.jsxs(dh,{sx:{px:3,pt:2,pb:3,gap:1},children:[m.jsx(_r,{variant:"outlined",disabled:c.isPending,onClick:()=>n(!1),children:"Cancel"}),m.jsx(_r,{type:"submit",form:"package-form",variant:"contained",loading:c.isPending,children:"Save Changes"})]})]}),m.jsx(_s,{open:a!=="",autoHideDuration:6e3,onClose:()=>i(""),message:a})]})}const MCe=Fn(m.jsx("path",{d:"M2 20h20v-4H2zm2-3h2v2H4zM2 4v4h20V4zm4 3H4V5h2zm-4 7h20v-4H2zm2-3h2v2H4z"})),y$=Fn(m.jsx("path",{d:"M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6zM19 4h-3.5l-1-1h-5l-1 1H5v2h14z"}));function b$(e){const{theme:t,name:n,props:r}=e;return!t||!t.components||!t.components[n]||!t.components[n].defaultProps?r:jy(t.components[n].defaultProps,r)}function NCe({props:e,name:t,defaultTheme:n,themeId:r}){let o=Xle(n);return o=o[r]||o,b$({theme:o,name:t,props:e})}function Vr({props:e,name:t}){return NCe({props:e,name:t,defaultTheme:vS,themeId:gh})}const PCe=Lt("MuiBox",["root"]),ICe=fB(),Ur=z2({themeId:gh,defaultTheme:ICe,defaultClassName:PCe.root,generateClassName:Xj.generate});function _Ce(e){return Ut("MuiDialogContentText",e)}Lt("MuiDialogContentText",["root"]);const LCe=e=>{const{classes:t}=e,n=zt({root:["root"]},_Ce,t);return{...t,...n}},FCe=Pe(lr,{shouldForwardProp:e=>wa(e)||e==="classes",name:"MuiDialogContentText",slot:"Root"})({}),Rb=T.forwardRef(function(e,t){const n=An({props:e,name:"MuiDialogContentText"}),{children:r,className:o,...a}=n,i=LCe(a);return m.jsx(FCe,{component:"p",variant:"body1",color:"textSecondary",ref:t,ownerState:a,className:Ot(i.root,o),...n,classes:i})});function P0(e){return parseInt(e,10)||0}const jCe={shadow:{visibility:"hidden",position:"absolute",overflow:"hidden",height:0,top:0,left:0,transform:"translateZ(0)"}};function BCe(e){for(const t in e)return!1;return!0}function pL(e){return BCe(e)||e.outerHeightStyle===0&&!e.overflowing}const $Ce=T.forwardRef(function(e,t){const{onChange:n,maxRows:r,minRows:o=1,style:a,value:i,...s}=e,{current:c}=T.useRef(i!=null),u=T.useRef(null),f=cr(t,u),p=T.useRef(null),y=T.useRef(null),g=T.useCallback(()=>{const w=u.current,C=y.current;if(!w||!C)return;const R=fc(w).getComputedStyle(w);if(R.width==="0px")return{outerHeightStyle:0,overflowing:!1};C.style.width=R.width,C.value=w.value||e.placeholder||"x",C.value.slice(-1)===`
428
+ `),c={variables:{},expressions:[],errors:{}};for(const u of s){const f=u.trim();if(f.length===0||f.startsWith("#"))continue;const p=f.match(/^(.*)=(.*)$/);if(p){const[,y,g]=p;c.variables[y]=g.replace(/["']/g,"");continue}try{const y=h1.#t(f);c.expressions.push(y.interval)}catch(y){c.errors[f]=y}}return c}static#t(i){const s=i.split(" ");return{interval:r.CronExpressionParser.parse(s.slice(0,5).join(" ")),command:s.slice(5,s.length)}}};return ws.CronFileParser=o,ws}var lL;function gCe(){return lL||(lL=1,(function(e){var t=cp&&cp.__createBinding||(Object.create?(function(u,f,p,y){y===void 0&&(y=p);var g=Object.getOwnPropertyDescriptor(f,p);(!g||("get"in g?!f.__esModule:g.writable||g.configurable))&&(g={enumerable:!0,get:function(){return f[p]}}),Object.defineProperty(u,y,g)}):(function(u,f,p,y){y===void 0&&(y=p),u[y]=f[p]})),n=cp&&cp.__exportStar||function(u,f){for(var p in u)p!=="default"&&!Object.prototype.hasOwnProperty.call(f,p)&&t(f,u,p)};Object.defineProperty(e,"__esModule",{value:!0}),e.CronFileParser=e.CronExpressionParser=e.CronExpression=e.CronFieldCollection=e.CronDate=void 0;const r=Jk();var o=$D();Object.defineProperty(e,"CronDate",{enumerable:!0,get:function(){return o.CronDate}});var a=f$();Object.defineProperty(e,"CronFieldCollection",{enumerable:!0,get:function(){return a.CronFieldCollection}});var i=p$();Object.defineProperty(e,"CronExpression",{enumerable:!0,get:function(){return i.CronExpression}});var s=Jk();Object.defineProperty(e,"CronExpressionParser",{enumerable:!0,get:function(){return s.CronExpressionParser}});var c=mCe();Object.defineProperty(e,"CronFileParser",{enumerable:!0,get:function(){return c.CronFileParser}}),n(zD(),e),e.default=r.CronExpressionParser})(cp)),cp}var yCe=gCe(),cL={exports:{}},uL;function bCe(){return uL||(uL=1,(function(e,t){(function(n,r){e.exports=r()})(globalThis,()=>(()=>{var n={949:((i,s,c)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.CronParser=void 0;var u=c(515),f=(function(){function p(y,g,b){g===void 0&&(g=!0),b===void 0&&(b=!1),this.expression=y,this.dayOfWeekStartIndexZero=g,this.monthStartIndexZero=b}return p.prototype.parse=function(){var y,g,b=(y=this.expression)!==null&&y!==void 0?y:"";if(b==="@reboot")return g=["@reboot","","","","","",""],g;if(b.startsWith("@")){var x=this.parseSpecial(this.expression);g=this.extractParts(x)}else g=this.extractParts(this.expression);return this.normalize(g),this.validate(g),g},p.prototype.parseSpecial=function(y){var g={"@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=g[y];if(!b)throw new Error("Unknown special expression.");return b},p.prototype.extractParts=function(y){if(!this.expression)throw new Error("cron expression is empty");for(var g=y.trim().split(/[ ]+/),b=0;b<g.length;b++)if(g[b].includes(",")){var x=g[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,w){return S!==null&&w!==null?S-w:0}),g[b]=x.map(function(S){return S!==null?S.toString():""}).join(",")}if(g.length<5)throw new Error("Expression has only ".concat(g.length," part").concat(g.length==1?"":"s",". At least 5 parts are required."));if(g.length==5)g.unshift(""),g.push("");else if(g.length==6){var E=/\d{4}$/.test(g[5])||g[4]=="?"||g[2]=="?";E?g.unshift(""):g.push("")}else if(g.length>7)throw new Error("Expression has ".concat(g.length," parts; too many!"));return g},p.prototype.normalize=function(y){var g=this;if(y[3]=y[3].replace("?","*"),y[5]=y[5].replace("?","*"),y[2]=y[2].replace("?","*"),y[0].indexOf("0/")==0&&(y[0]=y[0].replace("0/","*/")),y[1].indexOf("0/")==0&&(y[1]=y[1].replace("0/","*/")),y[2].indexOf("0/")==0&&(y[2]=y[2].replace("0/","*/")),y[3].indexOf("1/")==0&&(y[3]=y[3].replace("1/","*/")),y[4].indexOf("1/")==0&&(y[4]=y[4].replace("1/","*/")),y[6].indexOf("1/")==0&&(y[6]=y[6].replace("1/","*/")),y[5]=y[5].replace(/(^\d)|([^#/\s]\d)/g,function(M){var D=M.replace(/\D/,""),I=D;return g.dayOfWeekStartIndexZero?D=="7"&&(I="0"):I=(parseInt(D)-1).toString(),M.replace(D,I)}),y[5]=="L"&&(y[5]="6"),y[3]=="?"&&(y[3]="*"),y[3].indexOf("W")>-1&&(y[3].indexOf(",")>-1||y[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)y[5]=y[5].replace(new RegExp(x,"gi"),b[x].toString());y[4]=y[4].replace(/(^\d{1,2})|([^#/\s]\d{1,2})/g,function(M){var D=M.replace(/\D/,""),I=D;return g.monthStartIndexZero&&(I=(parseInt(D)+1).toString()),M.replace(D,I)});var E={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 E)y[4]=y[4].replace(new RegExp(S,"gi"),E[S].toString());y[0]=="0"&&(y[0]=""),!/\*|\-|\,|\//.test(y[2])&&(/\*|\//.test(y[1])||/\*|\//.test(y[0]))&&(y[2]+="-".concat(y[2]));for(var w=0;w<y.length;w++)if(y[w].indexOf(",")!=-1&&(y[w]=y[w].split(",").filter(function(M){return M!==""}).join(",")||"*"),y[w]=="*/1"&&(y[w]="*"),y[w].indexOf("/")>-1&&!/^\*|\-|\,/.test(y[w])){var C=null;switch(w){case 4:C="12";break;case 5:C="6";break;case 6:C="9999";break;default:C=null;break}if(C!==null){var R=y[w].split("/");y[w]="".concat(R[0],"-").concat(C,"/").concat(R[1])}}},p.prototype.validate=function(y){var g="0-9,\\-*/";this.validateOnlyExpectedCharactersFound(y[0],g),this.validateOnlyExpectedCharactersFound(y[1],g),this.validateOnlyExpectedCharactersFound(y[2],g),this.validateOnlyExpectedCharactersFound(y[3],"0-9,\\-*/LW"),this.validateOnlyExpectedCharactersFound(y[4],g),this.validateOnlyExpectedCharactersFound(y[5],"0-9,\\-*/L#"),this.validateOnlyExpectedCharactersFound(y[6],g),this.validateAnyRanges(y)},p.prototype.validateAnyRanges=function(y){u.default.secondRange(y[0]),u.default.minuteRange(y[1]),u.default.hourRange(y[2]),u.default.dayOfMonthRange(y[3]),u.default.monthRange(y[4],this.monthStartIndexZero),u.default.dayOfWeekRange(y[5],this.dayOfWeekStartIndexZero)},p.prototype.validateOnlyExpectedCharactersFound=function(y,g){var b=y.match(new RegExp("[^".concat(g,"]+"),"gi"));if(b&&b.length)throw new Error("Expression contains invalid values: '".concat(b.toString(),"'"))},p})();s.CronParser=f}),333:((i,s,c)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.ExpressionDescriptor=void 0;var u=c(823),f=c(949),p=(function(){function y(g,b){if(this.expression=g,this.options=b,this.expressionParts=new Array(5),!this.options.locale&&y.defaultLocale&&(this.options.locale=y.defaultLocale),!y.locales[this.options.locale]){var x=Object.keys(y.locales)[0];console.warn("Locale '".concat(this.options.locale,"' could not be found; falling back to '").concat(x,"'.")),this.options.locale=x}this.i18n=y.locales[this.options.locale],b.use24HourTimeFormat===void 0&&(b.use24HourTimeFormat=this.i18n.use24HourTimeFormatByDefault())}return y.toString=function(g,b){var x=b===void 0?{}:b,E=x.throwExceptionOnParseError,S=E===void 0?!0:E,w=x.verbose,C=w===void 0?!1:w,R=x.dayOfWeekStartIndexZero,M=R===void 0?!0:R,D=x.monthStartIndexZero,I=D===void 0?!1:D,L=x.use24HourTimeFormat,F=x.locale,B=F===void 0?null:F,U={throwExceptionOnParseError:S,verbose:C,dayOfWeekStartIndexZero:M,monthStartIndexZero:I,use24HourTimeFormat:L,locale:B};U.tzOffset&&console.warn("'tzOffset' option has been deprecated and is no longer supported.");var k=new y(g,U);return k.getFullDescription()},y.initialize=function(g,b){b===void 0&&(b="en"),y.specialCharacters=["/","-",",","*"],y.defaultLocale=b,g.load(y.locales)},y.prototype.getFullDescription=function(){var g,b,x="";try{var E=new f.CronParser(this.expression,this.options.dayOfWeekStartIndexZero,this.options.monthStartIndexZero);if(this.expressionParts=E.parse(),this.expressionParts[0]==="@reboot")return((b=(g=this.i18n).atReboot)===null||b===void 0?void 0:b.call(g))||"Run once, at startup";var S=this.getTimeOfDayDescription(),w=this.getDayOfMonthDescription(),C=this.getMonthDescription(),R=this.getDayOfWeekDescription(),M=this.getYearDescription();x+=S+w+R+C+M,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},y.prototype.getTimeOfDayDescription=function(){var g=this.expressionParts[0],b=this.expressionParts[1],x=this.expressionParts[2],E="";if(!u.StringUtilities.containsAny(b,y.specialCharacters)&&!u.StringUtilities.containsAny(x,y.specialCharacters)&&!u.StringUtilities.containsAny(g,y.specialCharacters))E+=this.i18n.atSpace()+this.formatTime(x,b,g);else if(!g&&b.indexOf("-")>-1&&!(b.indexOf(",")>-1)&&!(b.indexOf("/")>-1)&&!u.StringUtilities.containsAny(x,y.specialCharacters)){var S=b.split("-");E+=u.StringUtilities.format(this.i18n.everyMinuteBetweenX0AndX1(),this.formatTime(x,S[0],""),this.formatTime(x,S[1],""))}else if(!g&&x.indexOf(",")>-1&&x.indexOf("-")==-1&&x.indexOf("/")==-1&&!u.StringUtilities.containsAny(b,y.specialCharacters)){var w=x.split(",");E+=this.i18n.at();for(var C=0;C<w.length;C++)E+=" ",E+=this.formatTime(w[C],b,""),C<w.length-2&&(E+=","),C==w.length-2&&(E+=this.i18n.spaceAnd())}else{var R=this.getSecondsDescription(),M=this.getMinutesDescription(),D=this.getHoursDescription();if(E+=R,E&&M&&(E+=", "),E+=M,M===D)return E;E&&D&&(E+=", "),E+=D}return E},y.prototype.getSecondsDescription=function(){var g=this,b=this.getSegmentDescription(this.expressionParts[0],this.i18n.everySecond(),function(x){return x},function(x){return u.StringUtilities.format(g.i18n.everyX0Seconds(x),x)},function(x){return g.i18n.secondsX0ThroughX1PastTheMinute()},function(x){return x=="0"?"":parseInt(x)<20?g.i18n.atX0SecondsPastTheMinute(x):g.i18n.atX0SecondsPastTheMinuteGt20()||g.i18n.atX0SecondsPastTheMinute(x)});return b},y.prototype.getMinutesDescription=function(){var g=this,b=this.expressionParts[0],x=this.expressionParts[2],E=this.getSegmentDescription(this.expressionParts[1],this.i18n.everyMinute(),function(S){return S},function(S){return u.StringUtilities.format(g.i18n.everyX0Minutes(S),S)},function(S){return g.i18n.minutesX0ThroughX1PastTheHour()},function(S){try{return S=="0"&&x.indexOf("/")==-1&&b==""?g.i18n.everyHour():parseInt(S)<20?g.i18n.atX0MinutesPastTheHour(S):g.i18n.atX0MinutesPastTheHourGt20()||g.i18n.atX0MinutesPastTheHour(S)}catch{return g.i18n.atX0MinutesPastTheHour(S)}});return E},y.prototype.getHoursDescription=function(){var g=this,b=this.expressionParts[2],x=0,E=[];b.split("/")[0].split(",").forEach(function(C){var R=C.split("-");R.length===2&&E.push({value:R[1],index:x+1}),x+=R.length});var S=0,w=this.getSegmentDescription(b,this.i18n.everyHour(),function(C){var R=E.find(function(D){return D.value===C&&D.index===S}),M=R&&g.expressionParts[1]!=="0";return S++,M?g.formatTime(C,"59",""):g.formatTime(C,"0","")},function(C){return u.StringUtilities.format(g.i18n.everyX0Hours(C),C)},function(C){return g.i18n.betweenX0AndX1()},function(C){return g.i18n.atX0()});return w},y.prototype.getDayOfWeekDescription=function(){var g=this,b=this.i18n.daysOfTheWeek(),x=null;return this.expressionParts[5]=="*"?x="":x=this.getSegmentDescription(this.expressionParts[5],this.i18n.commaEveryDay(),function(E,S){var w=E;E.indexOf("#")>-1?w=E.substring(0,E.indexOf("#")):E.indexOf("L")>-1&&(w=w.replace("L",""));var C=parseInt(w),R=g.i18n.daysOfTheWeekInCase?g.i18n.daysOfTheWeekInCase(S)[C]:b[C];if(E.indexOf("#")>-1){var M=null,D=E.substring(E.indexOf("#")+1),I=E.substring(0,E.indexOf("#"));switch(D){case"1":M=g.i18n.first(I);break;case"2":M=g.i18n.second(I);break;case"3":M=g.i18n.third(I);break;case"4":M=g.i18n.fourth(I);break;case"5":M=g.i18n.fifth(I);break}R=M+" "+R}return R},function(E){return parseInt(E)==1?"":u.StringUtilities.format(g.i18n.commaEveryX0DaysOfTheWeek(E),E)},function(E){var S=E.substring(0,E.indexOf("-")),w=g.expressionParts[3]!="*";return w?g.i18n.commaAndX0ThroughX1(S):g.i18n.commaX0ThroughX1(S)},function(E){var S=null;if(E.indexOf("#")>-1){var w=E.substring(E.indexOf("#")+1),C=E.substring(0,E.indexOf("#"));S=g.i18n.commaOnThe(w,C).trim()+g.i18n.spaceX0OfTheMonth()}else if(E.indexOf("L")>-1)S=g.i18n.commaOnTheLastX0OfTheMonth(E.replace("L",""));else{var R=g.expressionParts[3]!="*";S=R?g.i18n.commaAndOnX0():g.i18n.commaOnlyOnX0(E)}return S}),x},y.prototype.getMonthDescription=function(){var g=this,b=this.i18n.monthsOfTheYear(),x=this.getSegmentDescription(this.expressionParts[4],"",function(E,S){return S&&g.i18n.monthsOfTheYearInCase?g.i18n.monthsOfTheYearInCase(S)[parseInt(E)-1]:b[parseInt(E)-1]},function(E){return parseInt(E)==1?"":u.StringUtilities.format(g.i18n.commaEveryX0Months(E),E)},function(E){return g.i18n.commaMonthX0ThroughMonthX1()||g.i18n.commaX0ThroughX1()},function(E){return g.i18n.commaOnlyInMonthX0?g.i18n.commaOnlyInMonthX0():g.i18n.commaOnlyInX0()});return x},y.prototype.getDayOfMonthDescription=function(){var g=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 E=x.match(/(\d{1,2}W)|(W\d{1,2})/);if(E){var S=parseInt(E[0].replace("W","")),w=S==1?this.i18n.firstWeekday():u.StringUtilities.format(this.i18n.weekdayNearestDayX0(),S.toString());b=u.StringUtilities.format(this.i18n.commaOnTheX0OfTheMonth(),w);break}else{var C=x.match(/L-(\d{1,2})/);if(C){var R=C[1];b=u.StringUtilities.format(this.i18n.commaDaysBeforeTheLastDayOfTheMonth(R),R);break}else{if(x=="*"&&this.expressionParts[5]!="*")return"";b=this.getSegmentDescription(x,this.i18n.commaEveryDay(),function(M){return M=="L"?g.i18n.lastDay():g.i18n.dayX0?u.StringUtilities.format(g.i18n.dayX0(),M):M},function(M){return M=="1"?g.i18n.commaEveryDay():g.i18n.commaEveryX0Days(M)},function(M){return g.i18n.commaBetweenDayX0AndX1OfTheMonth(M)},function(M){return g.i18n.commaOnDayX0OfTheMonth(M)})}break}}return b},y.prototype.getYearDescription=function(){var g=this,b=this.getSegmentDescription(this.expressionParts[6],"",function(x){return/^\d+$/.test(x)?new Date(parseInt(x),1).getFullYear().toString():x},function(x){return u.StringUtilities.format(g.i18n.commaEveryX0Years(x),x)},function(x){return g.i18n.commaYearX0ThroughYearX1()||g.i18n.commaX0ThroughX1()},function(x){return g.i18n.commaOnlyInYearX0?g.i18n.commaOnlyInYearX0():g.i18n.commaOnlyInX0()});return b},y.prototype.getSegmentDescription=function(g,b,x,E,S,w){var C=null,R=g.indexOf("/")>-1,M=g.indexOf("-")>-1,D=g.indexOf(",")>-1;if(!g)C="";else if(g==="*")C=b;else if(!R&&!M&&!D)C=u.StringUtilities.format(w(g),x(g));else if(D){for(var I=g.split(","),L="",F=0;F<I.length;F++)if(F>0&&I.length>2&&(L+=",",F<I.length-1&&(L+=" ")),F>0&&I.length>1&&(F==I.length-1||I.length==2)&&(L+="".concat(this.i18n.spaceAnd()," ")),I[F].indexOf("/")>-1||I[F].indexOf("-")>-1){var B=I[F].indexOf("-")>-1&&I[F].indexOf("/")==-1,U=this.getSegmentDescription(I[F],b,x,E,B?this.i18n.commaX0ThroughX1:S,w);B&&(U=U.replace(", ","")),L+=U}else R?L+=this.getSegmentDescription(I[F],b,x,E,S,w):L+=x(I[F]);R?C=L:C=u.StringUtilities.format(w(g),L)}else if(R){var I=g.split("/");if(C=u.StringUtilities.format(E(I[1]),I[1]),I[0].indexOf("-")>-1){var k=this.generateRangeSegmentDescription(I[0],S,x);k.indexOf(", ")!=0&&(C+=", "),C+=k}else if(I[0].indexOf("*")==-1){var $=u.StringUtilities.format(w(I[0]),x(I[0]));$=$.replace(", ",""),C+=u.StringUtilities.format(this.i18n.commaStartingX0(),$)}}else M&&(C=this.generateRangeSegmentDescription(g,S,x));return C},y.prototype.generateRangeSegmentDescription=function(g,b,x){var E="",S=g.split("-"),w=x(S[0],1),C=x(S[1],2),R=b(g);return E+=u.StringUtilities.format(R,w,C),E},y.prototype.formatTime=function(g,b,x){var E=0,S=0,w=parseInt(g)+E,C=parseInt(b)+S;C>=60?(C-=60,w+=1):C<0&&(C+=60,w-=1),w>=24?w=w-24:w<0&&(w=24+w);var R="",M=!1;this.options.use24HourTimeFormat||(M=!!(this.i18n.setPeriodBeforeTime&&this.i18n.setPeriodBeforeTime()),R=M?"".concat(this.getPeriod(w)," "):" ".concat(this.getPeriod(w)),w>12&&(w-=12),w===0&&(w=12));var D="";return x&&(D=":".concat(("00"+x).substring(x.length))),"".concat(M?R:"").concat(("00"+w.toString()).substring(w.toString().length),":").concat(("00"+C.toString()).substring(C.toString().length)).concat(D).concat(M?"":R)},y.prototype.transformVerbosity=function(g,b){if(!b&&(g=g.replace(new RegExp(", ".concat(this.i18n.everyMinute()),"g"),""),g=g.replace(new RegExp(", ".concat(this.i18n.everyHour()),"g"),""),g=g.replace(new RegExp(this.i18n.commaEveryDay(),"g"),""),g=g.replace(/\, ?$/,""),this.i18n.conciseVerbosityReplacements))for(var x=0,E=Object.entries(this.i18n.conciseVerbosityReplacements());x<E.length;x++){var S=E[x],w=S[0],C=S[1];g=g.replace(new RegExp(w,"g"),C)}return g},y.prototype.getPeriod=function(g){return g>=12?this.i18n.pm&&this.i18n.pm()||"PM":this.i18n.am&&this.i18n.am()||"AM"},y.locales={},y})();s.ExpressionDescriptor=p}),747:((i,s,c)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.enLocaleLoader=void 0;var u=c(486),f=(function(){function p(){}return p.prototype.load=function(y){y.en=new u.en},p})();s.enLocaleLoader=f}),486:((i,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.en=void 0;var c=(function(){function u(){}return u.prototype.atX0SecondsPastTheMinuteGt20=function(){return null},u.prototype.atX0MinutesPastTheHourGt20=function(){return null},u.prototype.commaMonthX0ThroughMonthX1=function(){return null},u.prototype.commaYearX0ThroughYearX1=function(){return null},u.prototype.use24HourTimeFormatByDefault=function(){return!1},u.prototype.anErrorOccuredWhenGeneratingTheExpressionD=function(){return"An error occurred when generating the expression description. Check the cron expression syntax."},u.prototype.everyMinute=function(){return"every minute"},u.prototype.everyHour=function(){return"every hour"},u.prototype.atSpace=function(){return"At "},u.prototype.everyMinuteBetweenX0AndX1=function(){return"Every minute between %s and %s"},u.prototype.at=function(){return"At"},u.prototype.spaceAnd=function(){return" and"},u.prototype.everySecond=function(){return"every second"},u.prototype.everyX0Seconds=function(){return"every %s seconds"},u.prototype.secondsX0ThroughX1PastTheMinute=function(){return"seconds %s through %s past the minute"},u.prototype.atX0SecondsPastTheMinute=function(){return"at %s seconds past the minute"},u.prototype.everyX0Minutes=function(){return"every %s minutes"},u.prototype.minutesX0ThroughX1PastTheHour=function(){return"minutes %s through %s past the hour"},u.prototype.atX0MinutesPastTheHour=function(){return"at %s minutes past the hour"},u.prototype.everyX0Hours=function(){return"every %s hours"},u.prototype.betweenX0AndX1=function(){return"between %s and %s"},u.prototype.atX0=function(){return"at %s"},u.prototype.commaEveryDay=function(){return", every day"},u.prototype.commaEveryX0DaysOfTheWeek=function(){return", every %s days of the week"},u.prototype.commaX0ThroughX1=function(){return", %s through %s"},u.prototype.commaAndX0ThroughX1=function(){return", %s through %s"},u.prototype.first=function(){return"first"},u.prototype.second=function(){return"second"},u.prototype.third=function(){return"third"},u.prototype.fourth=function(){return"fourth"},u.prototype.fifth=function(){return"fifth"},u.prototype.commaOnThe=function(){return", on the "},u.prototype.spaceX0OfTheMonth=function(){return" %s of the month"},u.prototype.lastDay=function(){return"the last day"},u.prototype.commaOnTheLastX0OfTheMonth=function(){return", on the last %s of the month"},u.prototype.commaOnlyOnX0=function(){return", only on %s"},u.prototype.commaAndOnX0=function(){return", and on %s"},u.prototype.commaEveryX0Months=function(){return", every %s months"},u.prototype.commaOnlyInX0=function(){return", only in %s"},u.prototype.commaOnTheLastDayOfTheMonth=function(){return", on the last day of the month"},u.prototype.commaOnTheLastWeekdayOfTheMonth=function(){return", on the last weekday of the month"},u.prototype.commaDaysBeforeTheLastDayOfTheMonth=function(){return", %s days before the last day of the month"},u.prototype.firstWeekday=function(){return"first weekday"},u.prototype.weekdayNearestDayX0=function(){return"weekday nearest day %s"},u.prototype.commaOnTheX0OfTheMonth=function(){return", on the %s of the month"},u.prototype.commaEveryX0Days=function(){return", every %s days"},u.prototype.commaBetweenDayX0AndX1OfTheMonth=function(){return", between day %s and %s of the month"},u.prototype.commaOnDayX0OfTheMonth=function(){return", on day %s of the month"},u.prototype.commaEveryHour=function(){return", every hour"},u.prototype.commaEveryX0Years=function(){return", every %s years"},u.prototype.commaStartingX0=function(){return", starting %s"},u.prototype.daysOfTheWeek=function(){return["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},u.prototype.monthsOfTheYear=function(){return["January","February","March","April","May","June","July","August","September","October","November","December"]},u.prototype.atReboot=function(){return"Run once, at startup"},u})();s.en=c}),515:((i,s)=>{Object.defineProperty(s,"__esModule",{value:!0});function c(f,p){if(!f)throw new Error(p)}var u=(function(){function f(){}return f.secondRange=function(p){for(var y=p.split(","),g=0;g<y.length;g++)if(!isNaN(parseInt(y[g],10))){var b=parseInt(y[g],10);c(b>=0&&b<=59,"seconds part must be >= 0 and <= 59")}},f.minuteRange=function(p){for(var y=p.split(","),g=0;g<y.length;g++)if(!isNaN(parseInt(y[g],10))){var b=parseInt(y[g],10);c(b>=0&&b<=59,"minutes part must be >= 0 and <= 59")}},f.hourRange=function(p){for(var y=p.split(","),g=0;g<y.length;g++)if(!isNaN(parseInt(y[g],10))){var b=parseInt(y[g],10);c(b>=0&&b<=23,"hours part must be >= 0 and <= 23")}},f.dayOfMonthRange=function(p){for(var y=p.split(","),g=0;g<y.length;g++)if(!isNaN(parseInt(y[g],10))){var b=parseInt(y[g],10);c(b>=1&&b<=31,"DOM part must be >= 1 and <= 31")}},f.monthRange=function(p,y){for(var g=p.split(","),b=0;b<g.length;b++)if(!isNaN(parseInt(g[b],10))){var x=parseInt(g[b],10);c(x>=1&&x<=12,y?"month part must be >= 0 and <= 11":"month part must be >= 1 and <= 12")}},f.dayOfWeekRange=function(p,y){for(var g=p.split(","),b=0;b<g.length;b++)if(!isNaN(parseInt(g[b],10))){var x=parseInt(g[b],10);c(x>=0&&x<=6,y?"DOW part must be >= 0 and <= 6":"DOW part must be >= 1 and <= 7")}},f})();s.default=u}),823:((i,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.StringUtilities=void 0;var c=(function(){function u(){}return u.format=function(f){for(var p=[],y=1;y<arguments.length;y++)p[y-1]=arguments[y];return f.replace(/%s/g,function(g){return p.shift()})},u.containsAny=function(f,p){return p.some(function(y){return f.indexOf(y)>-1})},u})();s.StringUtilities=c})},r={};function o(i){var s=r[i];if(s!==void 0)return s.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 s=o(333),c=o(747);s.ExpressionDescriptor.initialize(new c.enLocaleLoader),i.default=s.ExpressionDescriptor;var u=s.ExpressionDescriptor.toString;i.toString=u})(),a})())})(cL)),cL.exports}var vCe=bCe();const xCe=fs(vCe),SCe=new Set(["JAN","FEB","MAR","APR","MAY","JUN","JUL","AUG","SEP","OCT","NOV","DEC","SUN","MON","TUE","WED","THU","FRI","SAT"]);function ECe(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)&&!SCe.has(n.toUpperCase()))return!1}return!0}function h$(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(!ECe(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=xCe.toString(t,{use24HourTimeFormat:!0,verbose:!1}),r=yCe.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 m$(e){return e?e.toLocaleString(void 0,{year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit",timeZone:"UTC",hour12:!1})+" UTC":"—"}const dL="0 6 * * *";function CCe({currentSchedule:e,isSubmitting:t,disabled:n,disabledReason:r,onSubmit:o}){const[a,i]=T.useState(!1),[s,c]=T.useState(e??dL),u=()=>{c(e??dL),i(!0)},f=()=>i(!1),p=h$(s),y=async b=>{try{await o(b),i(!1)}catch{}},g=m.jsx("span",{children:m.jsx(_r,{variant:"outlined",size:"small",startIcon:m.jsx(nx,{}),onClick:u,disabled:n,"aria-label":e?"Edit schedule":"Set schedule",children:e?"Edit schedule":"Set schedule"})});return m.jsxs(m.Fragment,{children:[n&&r?m.jsx(eo,{title:r,children:g}):g,m.jsxs(wi,{open:a,onClose:f,maxWidth:"xs",fullWidth:!0,"aria-labelledby":"set-schedule-title",children:[m.jsx(Ai,{id:"set-schedule-title",children:e?"Edit schedule":"Set schedule"}),m.jsxs(ki,{children:[m.jsx(Vx,{sx:{mb:2},children:"The publisher rebuilds the materializations in this package on this cadence. Enter a 5-field UNIX cron, evaluated in UTC. In a hosted deployment, the change takes effect on your next publish."}),m.jsx(xu,{autoFocus:!0,fullWidth:!0,label:"Cron expression",value:s,onChange:b=>c(b.target.value),error:s.trim()!==""&&!p.valid,slotProps:{htmlInput:{style:{fontFamily:gi}}}}),m.jsx(gt,{sx:{mt:1.5,minHeight:48},children:p.valid?m.jsxs(m.Fragment,{children:[m.jsx(at,{variant:"body2",children:p.description}),m.jsxs(at,{variant:"body2",color:"text.secondary",children:["Next run: ",m$(p.nextRun)]})]}):m.jsx(at,{variant:"body2",color:"error",children:p.error})}),m.jsxs(xK,{severity:"info",sx:{mt:2},children:["A schedule runs only on version-scoped packages, so saving one sets ",m.jsx("code",{children:"scope: version"})," for this package."]})]}),m.jsxs(dh,{sx:{justifyContent:"space-between",px:3},children:[m.jsx(gt,{children:e&&m.jsx(_r,{color:"error",loading:t,onClick:()=>y(null),children:"Clear schedule"})}),m.jsxs(gt,{children:[m.jsx(_r,{onClick:f,children:"Cancel"}),m.jsx(_r,{variant:"contained",loading:t,disabled:!p.valid,onClick:()=>y(s.trim()),sx:{ml:1},children:"Save"})]})]})]})]})}function TCe({schedule:e,scope:t,manifestLocation:n,hasFreshness:r,mutable:o,isSubmitting:a,isScopeMutating:i,onSubmit:s,onScopeChange:c}){const u=!!n,f=e?h$(e):null,p=!!e;return m.jsx(ch,{variant:"outlined",sx:{borderRadius:2,mb:6},children:m.jsx(uh,{children:m.jsxs(Lr,{direction:"row",justifyContent:"space-between",alignItems:"flex-start",spacing:2,children:[m.jsxs(gt,{sx:{minWidth:0},children:[m.jsxs(Lr,{direction:"row",alignItems:"center",spacing:1,sx:{mb:1},children:[m.jsx(nx,{fontSize:"small",color:"action"}),m.jsx(at,{variant:"h6",sx:{fontWeight:600,letterSpacing:"-0.025em"},children:"Schedule"})]}),u?m.jsxs(gt,{children:[m.jsx(Ld,{size:"small",color:"default",variant:"outlined",label:"Control-plane managed",sx:{mb:1}}),m.jsx(at,{variant:"body2",color:"text.secondary",children:"Refresh is driven by the control plane; the built-in scheduler does not fire this package."})]}):f?m.jsxs(gt,{children:[m.jsxs(Lr,{direction:"row",alignItems:"center",spacing:1,sx:{mb:.5,flexWrap:"wrap"},children:[m.jsx(Ld,{size:"small",color:"success",variant:"outlined",icon:m.jsx(nx,{fontSize:"small"}),label:"Active"}),m.jsx(gt,{component:"code",sx:{fontFamily:gi,fontSize:"0.8125rem",px:.75,py:.25,borderRadius:1,bgcolor:"action.hover"},children:e})]}),m.jsx(at,{variant:"body2",children:f.valid?f.description:"Unrecognized cron expression."}),f.valid&&m.jsxs(at,{variant:"body2",color:"text.secondary",children:["Next run: ",m$(f.nextRun)]})]}):r?m.jsx(at,{variant:"body2",color:"text.secondary",children:"This package uses a freshness policy; a cron schedule is not applicable."}):m.jsx(at,{variant:"body2",color:"text.secondary",children:"On-demand only — no schedule set."}),!u&&m.jsxs(gt,{sx:{mt:2},children:[m.jsx(at,{variant:"caption",color:"text.secondary",sx:{display:"block",mb:.5},children:"Scope"}),m.jsx(eo,{title:p?"A schedule requires version scope. Clear the schedule to change it.":"",children:m.jsx("span",{children:m.jsxs(Hte,{size:"small",exclusive:!0,value:t,disabled:!o||!c||p||!!i,onChange:(y,g)=>{g&&g!==t&&c?.(g)},children:[m.jsx(uI,{value:"package",children:"package"}),m.jsx(uI,{value:"version",children:"version"})]})})}),m.jsx(at,{variant:"caption",color:"text.secondary",sx:{display:"block",mt:.5},children:t==="version"?"Materialized artifacts are per version (required for a schedule).":"Materialized artifacts are shared across versions."})]}),m.jsxs(at,{variant:"caption",color:"text.secondary",sx:{display:"block",mt:1.5},children:["Declared in ",m.jsx("code",{children:"publisher.json"}),".",!u&&m.jsxs(m.Fragment,{children:[" ","In a hosted deployment, a change takes effect on your next publish."]})]})]}),o&&!u&&m.jsx(CCe,{currentSchedule:e,isSubmitting:a,disabled:r,disabledReason:"This package declares a freshness policy; a schedule and freshness are mutually exclusive.",onSubmit:s})]})})})}const wCe=3e3;function yIe({resourceUri:e,onClickPackageFile:t}){const{apiClients:n,mutable:r}=Dr(),o=Ls(),{environmentName:a,packageName:i}=to(e),[s,c]=T.useState(""),[u,f]=T.useState(null),p=t??(F=>{window.location.href=F});if(!i)throw new Error("Materializations requires a package in the resource URI");const y=uo({queryKey:["materializations",a,i],queryFn:()=>n.materializations.listMaterializations(a,i),refetchInterval:F=>(F.state.data?.data??[]).some(B=>Uy(B.status))?wCe:!1}),g=uo({queryKey:["package",a,i],queryFn:()=>n.packages.getPackage(a,i)}),b=()=>o.invalidateQueries({queryKey:["materializations",a,i]}),x=Ho({mutationFn:F=>n.materializations.createMaterialization(a,i,{forceRefresh:F.forceRefresh}),onSuccess(){c("Materialization requested"),b()},onError(F){c(F.message),b()}}),E=Ho({mutationFn:F=>n.materializations.materializationAction(a,i,F.id,rj.Stop),onSuccess(){c("Materialization stopped"),b()},onError(F){c(F.message)}}),S=Ho({mutationFn:({materialization:F,dropTables:B})=>n.materializations.deleteMaterialization(a,i,F.id,B),onSuccess(){c("Materialization deleted"),b()},onError(F){c(F.message)}}),w=g.data?.data,C=Ho({mutationFn:F=>n.packages.updatePackage(a,i,{name:i,description:w?.description,...F?{scope:m0.Version}:{},materialization:{schedule:F}}),onSuccess(F,B){c(B?"Schedule updated":"Schedule cleared"),o.invalidateQueries({queryKey:["package",a,i]})},onError(F){c(F.message)}}),R=Ho({mutationFn:F=>n.packages.updatePackage(a,i,{name:i,description:w?.description,scope:F}),onSuccess(){c("Scope updated"),o.invalidateQueries({queryKey:["package",a,i]})},onError(F){c(F.message)}}),M=y.data?.data??[],D=M.find(F=>F.id===u)??null,I=M.some(F=>Uy(F.status)),L=x.isPending||E.isPending||S.isPending;return m.jsxs(Ux,{maxWidth:!1,sx:{maxWidth:1024,mx:"auto",px:3,py:6},children:[m.jsxs(gt,{sx:{mb:4},children:[m.jsxs(fA,{onClick:F=>p(`/${a}/${i}`,F),underline:"none",sx:{display:"inline-flex",alignItems:"center",gap:.5,cursor:"pointer",color:"text.secondary",fontSize:"0.875rem",mb:2,"&:hover":{color:"primary.main"}},children:[m.jsx(V7,{sx:{fontSize:18}}),"Back to ",i]}),m.jsxs(Lr,{direction:"row",alignItems:"flex-start",justifyContent:"space-between",children:[m.jsxs(gt,{children:[m.jsx(at,{variant:"h4",component:"h1",sx:{fontWeight:600,letterSpacing:"-0.025em",mb:.5},children:"Materializations"}),m.jsxs(at,{variant:"body2",color:"text.secondary",children:["Materialize the persist sources in ",i," into tables and serve queries from them"]})]}),r&&m.jsx(Rxe,{onSubmit:F=>x.mutateAsync(F),isSubmitting:x.isPending,disabled:I,disabledReason:"A materialization is already pending or running for this package."})]})]}),g.isSuccess&&m.jsx(TCe,{schedule:w?.materialization?.schedule??null,scope:w?.scope===m0.Version?"version":"package",manifestLocation:w?.manifestLocation??null,hasFreshness:!!w?.materialization?.freshness,mutable:r,isSubmitting:C.isPending,isScopeMutating:R.isPending,onSubmit:F=>C.mutateAsync(F),onScopeChange:F=>R.mutateAsync(F==="version"?m0.Version:m0.Package)}),m.jsxs(gt,{sx:{mb:6},children:[m.jsx(at,{variant:"h6",sx:{fontWeight:600,letterSpacing:"-0.025em",mb:1},children:"Runs"}),y.isError&&m.jsx(Ta,{error:y.error,context:`${a} > ${i} > Materializations`}),!y.isSuccess&&!y.isError&&m.jsx(Ca,{text:"Loading materializations..."}),y.isSuccess&&m.jsx(u$,{materializations:M,mutable:r,isMutating:L,onStop:F=>E.mutate(F),onDelete:(F,B)=>S.mutate({materialization:F,dropTables:B}),onViewDetails:F=>f(F.id??null)})]}),m.jsx(Q7,{materialization:D,buildPlan:g.data?.data?.buildPlan??null,onClose:()=>f(null)}),m.jsx(_s,{open:s!=="",autoHideDuration:6e3,onClose:()=>c(""),message:s})]})}function kCe({packages:e,onSubmit:t,isSubmitting:n,disabled:r}){const[o,a]=T.useState(!1),[i,s]=T.useState({}),[c,u]=T.useState(!1),f=()=>{s({}),u(!1),a(!0)},p=()=>a(!1),y=e.map(E=>E.name).filter(E=>i[E]),g=E=>s(S=>({...S,[E]:!S[E]})),b=e.length>0&&y.length===e.length,x=async()=>{try{await t({packageNames:y,forceRefresh:c}),a(!1)}catch{}};return m.jsxs(m.Fragment,{children:[m.jsx(_r,{variant:"contained",startIcon:m.jsx(Sb,{}),onClick:f,disabled:r,"aria-label":"New materialization",children:"New materialization"}),m.jsxs(wi,{open:o,onClose:p,maxWidth:"xs",fullWidth:!0,"aria-labelledby":"create-env-materialization-title",children:[m.jsx(Ai,{id:"create-env-materialization-title",children:"New materialization"}),m.jsxs(ki,{children:[m.jsx(Vx,{sx:{mb:1},children:"Pick the packages to materialize. Each runs an independent build of every persist source in that package."}),e.length===0?m.jsx(at,{variant:"body2",color:"text.secondary",children:"No packages in this environment."}):m.jsxs(m.Fragment,{children:[m.jsx(Tp,{control:m.jsx(Ww,{checked:b,indeterminate:y.length>0&&!b,onChange:E=>{const S={};E.target.checked&&e.forEach(w=>S[w.name]=!0),s(S)}}),label:m.jsx(at,{variant:"body2",children:"Select all"})}),m.jsx(gt,{sx:{maxHeight:240,overflowY:"auto",pl:1,borderLeft:"2px solid",borderColor:"divider"},children:m.jsx(lF,{children:e.map(E=>m.jsx(Tp,{control:m.jsx(Ww,{checked:!!i[E.name],onChange:()=>g(E.name)}),label:E.name},E.name))})}),m.jsx(Tp,{sx:{mt:1},control:m.jsx(yA,{checked:c,onChange:E=>u(E.target.checked)}),label:"Force refresh (rebuild even if unchanged)"})]})]}),m.jsxs(dh,{children:[m.jsx(_r,{onClick:p,children:"Cancel"}),m.jsxs(_r,{variant:"contained",loading:n,disabled:y.length===0,onClick:x,children:["Materialize",y.length>0?` (${y.length})`:""]})]})]})]})}const ACe=3e3,fL=10;function DCe({resourceUri:e,onClickPackageFile:t}){const{apiClients:n,mutable:r}=Dr(),o=Ls(),{environmentName:a}=to(e),[i,s]=T.useState(""),[c,u]=T.useState(null),[f,p]=T.useState(fL),y=t??(L=>{window.location.href=L}),g=uo({queryKey:["env-materializations",a,f],queryFn:()=>n.materializations.listEnvironmentMaterializations(a,f),placeholderData:L=>L,refetchInterval:L=>(L.state.data?.data??[]).some(F=>Uy(F.status))?ACe:!1}),b=uo({queryKey:["packages",a],queryFn:()=>n.packages.listPackages(a)}),x=()=>o.invalidateQueries({queryKey:["env-materializations",a]}),E=Ho({mutationFn:async L=>{const F=(await Promise.allSettled(L.packageNames.map(B=>n.materializations.createMaterialization(a,B,{forceRefresh:L.forceRefresh})))).filter(B=>B.status==="rejected").length;return{total:L.packageNames.length,failed:F}},onSuccess(L){const F=L.total-L.failed;s(L.failed===0?`Started ${F} materialization${F===1?"":"s"}`:`Started ${F} of ${L.total} (${L.failed} could not start — a build may already be active)`),x()},onError(L){s(L.message),x()}}),S=Ho({mutationFn:L=>n.materializations.materializationAction(a,L.packageName,L.id,rj.Stop),onSuccess(){s("Materialization stopped"),x()},onError(L){s(L.message)}}),w=Ho({mutationFn:({materialization:L,dropTables:F})=>n.materializations.deleteMaterialization(a,L.packageName,L.id,F),onSuccess(){s("Materialization deleted"),x()},onError(L){s(L.message)}}),C=g.data?.data??[],R=b.data?.data??[],M=C.find(L=>L.id===c)??null,D=E.isPending||S.isPending||w.isPending,I=C.length>=f;return m.jsxs(gt,{children:[m.jsxs(gt,{sx:{display:"flex",alignItems:"flex-start",justifyContent:"space-between",mb:3},children:[m.jsxs(gt,{children:[m.jsx(at,{variant:"h6",sx:{fontWeight:600,letterSpacing:"-0.025em"},children:"Materializations"}),m.jsx(at,{variant:"body2",color:"text.secondary",children:"All materialization builds across the packages in this environment"})]}),r&&m.jsx(kCe,{packages:R,onSubmit:L=>E.mutateAsync(L),isSubmitting:E.isPending})]}),g.isError&&m.jsx(Ta,{error:g.error,context:`${a} > Materializations`}),!g.isSuccess&&!g.isError&&m.jsx(Ca,{text:"Loading materializations..."}),g.isSuccess&&m.jsx(u$,{materializations:C,mutable:r,isMutating:D,showPackage:!0,onClickPackage:L=>y(`/${a}/${L}/materializations`),onStop:L=>S.mutate(L),onDelete:(L,F)=>w.mutate({materialization:L,dropTables:F}),onViewDetails:L=>u(L.id??null)}),g.isSuccess&&C.length>0&&m.jsxs(Lr,{direction:"row",alignItems:"center",justifyContent:"center",spacing:2,sx:{mt:2},children:[m.jsx(at,{variant:"caption",color:"text.secondary",children:I?`Showing ${C.length} most recent`:`${C.length} materialization${C.length===1?"":"s"}`}),I&&m.jsx(_r,{size:"small",onClick:()=>p(L=>L+fL),disabled:g.isFetching,children:"Show more"})]}),m.jsx(Q7,{materialization:M,buildPlan:null,showBuildPlan:!1,onClose:()=>u(null)}),m.jsx(_s,{open:i!=="",autoHideDuration:6e3,onClose:()=>s(""),message:i})]})}function OCe({resourceUri:e}){const{environmentName:t}=to(e),{apiClients:n}=Dr(),[r,o]=T.useState(!1),a=90,{data:i,isSuccess:s,isError:c,error:u}=uo({queryKey:["about",t],queryFn:()=>n.environments.getEnvironment(t,!1)}),f=i?.data?.readme||"",p=f.split(/\s+/),y=p.length>a,g=p.slice(0,a).join(" ");return m.jsxs(m.Fragment,{children:[!s&&!c&&m.jsx(Ca,{text:"Fetching About..."}),s&&f&&m.jsx(koe,{children:m.jsxs(Aoe,{children:[m.jsx(Doe,{children:"Readme"}),m.jsxs(gt,{sx:{mt:1,fontSize:"0.875rem",lineHeight:1.6},children:[m.jsx(F1,{options:{overrides:{h1:{component:"p",props:{style:{fontSize:"inherit",fontWeight:"italic"}}},h2:{component:"p",props:{style:{fontSize:"inherit",fontWeight:"italic"}}},h3:{component:"p",props:{style:{fontSize:"inherit",fontWeight:"italic"}}}}},children:r||!y?f:g}),y&&m.jsxs(gt,{sx:{mt:1},children:[" ",m.jsx(_r,{variant:"text",size:"small",onClick:()=>o(!r),children:r?"Read less":"Read more"})]})]})]})}),c&&m.jsx(Ta,{error:u,context:`${t} > About`})]})}const g$="https://docs.malloydata.dev/documentation",fw=`${g$}/user_guides/publishing`,fy={docsHome:`${g$}/`,publishing:`${fw}/publishing`,explorer:`${fw}/explorer`,mcpAgents:`${fw}/mcp_agents`};function RCe({resourceUri:e}){const[t,n]=T.useState(!1),{apiClients:r}=Dr(),o=Ls(),[a,i]=T.useState(""),{environmentName:s}=to(e),c=Ho({async mutationFn(f){return r.packages.createPackage(s,{name:f.name,description:f.description,location:f.location})},onSuccess(){n(!1),i("Package created successfully"),o.invalidateQueries({queryKey:["packages",s]})},onError(f){i(f instanceof Error?f.message:"An unknown error occurred")}}),u=f=>{f.preventDefault();const p=new FormData(f.currentTarget),y=p.get("name")?.toString(),g=p.get("description")?.toString(),b=p.get("location")?.toString();c.mutate({name:y,description:g,location:b})};return m.jsxs(m.Fragment,{children:[m.jsx(_r,{onClick:()=>n(!0),variant:"contained",color:"primary",startIcon:m.jsx(Gae,{}),children:"Add Package"}),m.jsxs(wi,{open:t,onClose:()=>n(!1),maxWidth:"sm",fullWidth:!0,PaperProps:{sx:{borderRadius:2}},children:[m.jsx(Ai,{sx:{fontSize:"1.25rem",fontWeight:600,letterSpacing:"-0.025em",pt:3,pb:1,px:3},children:"Create New Package"}),m.jsxs(ki,{sx:{px:3,pb:0},children:[m.jsxs(gt,{sx:{mb:3},children:[m.jsx(at,{variant:"body2",color:"text.secondary",sx:{mb:1.5},children:"Create a new Malloy package to start exploring your data."}),m.jsx(at,{variant:"body2",color:"text.secondary",sx:{mb:1.5},children:"The location can be a GitHub/S3/GCP URL containing a package (zipped or unzipped), or an absolute path to a directory the publisher server has access to."}),m.jsxs(at,{variant:"body2",color:"text.secondary",children:["Make sure to conform to the"," ",m.jsx(gt,{component:"a",href:fy.publishing,target:"_blank",rel:"noopener noreferrer",sx:{color:"text.primary",textDecoration:"underline"},children:"Malloy Package Format"}),"."]})]}),m.jsx("form",{onSubmit:u,id:"package-form",children:m.jsxs(Lr,{spacing:2.5,children:[m.jsx(xu,{autoFocus:!0,required:!0,id:"name",name:"name",label:"Package Name",type:"text",fullWidth:!0,variant:"outlined",size:"small",InputLabelProps:{shrink:!0}}),m.jsx(xu,{id:"description",name:"description",label:"Description",multiline:!0,rows:3,fullWidth:!0,variant:"outlined",size:"small",InputLabelProps:{shrink:!0}}),m.jsx(xu,{id:"location",name:"location",label:"Location",type:"text",placeholder:"e.g. s3://my-bucket/my-package.zip",fullWidth:!0,variant:"outlined",size:"small",InputLabelProps:{shrink:!0}})]})})]}),m.jsxs(dh,{sx:{px:3,pt:2,pb:3,gap:1},children:[m.jsx(_r,{variant:"outlined",disabled:c.isPending,onClick:()=>n(!1),children:"Cancel"}),m.jsx(_r,{type:"submit",form:"package-form",variant:"contained",loading:c.isPending,children:"Save Changes"})]})]}),m.jsx(_s,{open:a!=="",autoHideDuration:6e3,onClose:()=>i(""),message:a})]})}const MCe=Fn(m.jsx("path",{d:"M2 20h20v-4H2zm2-3h2v2H4zM2 4v4h20V4zm4 3H4V5h2zm-4 7h20v-4H2zm2-3h2v2H4z"})),y$=Fn(m.jsx("path",{d:"M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6zM19 4h-3.5l-1-1h-5l-1 1H5v2h14z"}));function b$(e){const{theme:t,name:n,props:r}=e;return!t||!t.components||!t.components[n]||!t.components[n].defaultProps?r:jy(t.components[n].defaultProps,r)}function NCe({props:e,name:t,defaultTheme:n,themeId:r}){let o=Xle(n);return o=o[r]||o,b$({theme:o,name:t,props:e})}function Vr({props:e,name:t}){return NCe({props:e,name:t,defaultTheme:vS,themeId:gh})}const PCe=Lt("MuiBox",["root"]),ICe=fB(),Ur=z2({themeId:gh,defaultTheme:ICe,defaultClassName:PCe.root,generateClassName:Xj.generate});function _Ce(e){return Ut("MuiDialogContentText",e)}Lt("MuiDialogContentText",["root"]);const LCe=e=>{const{classes:t}=e,n=zt({root:["root"]},_Ce,t);return{...t,...n}},FCe=Pe(lr,{shouldForwardProp:e=>wa(e)||e==="classes",name:"MuiDialogContentText",slot:"Root"})({}),Rb=T.forwardRef(function(e,t){const n=An({props:e,name:"MuiDialogContentText"}),{children:r,className:o,...a}=n,i=LCe(a);return m.jsx(FCe,{component:"p",variant:"body1",color:"textSecondary",ref:t,ownerState:a,className:Ot(i.root,o),...n,classes:i})});function P0(e){return parseInt(e,10)||0}const jCe={shadow:{visibility:"hidden",position:"absolute",overflow:"hidden",height:0,top:0,left:0,transform:"translateZ(0)"}};function BCe(e){for(const t in e)return!1;return!0}function pL(e){return BCe(e)||e.outerHeightStyle===0&&!e.overflowing}const $Ce=T.forwardRef(function(e,t){const{onChange:n,maxRows:r,minRows:o=1,style:a,value:i,...s}=e,{current:c}=T.useRef(i!=null),u=T.useRef(null),f=cr(t,u),p=T.useRef(null),y=T.useRef(null),g=T.useCallback(()=>{const w=u.current,C=y.current;if(!w||!C)return;const R=fc(w).getComputedStyle(w);if(R.width==="0px")return{outerHeightStyle:0,overflowing:!1};C.style.width=R.width,C.value=w.value||e.placeholder||"x",C.value.slice(-1)===`
429
429
  `&&(C.value+=" ");const M=R.boxSizing,D=P0(R.paddingBottom)+P0(R.paddingTop),I=P0(R.borderBottomWidth)+P0(R.borderTopWidth),L=C.scrollHeight;C.value="x";const F=C.scrollHeight;let B=L;o&&(B=Math.max(Number(o)*F,B)),r&&(B=Math.min(Number(r)*F,B)),B=Math.max(B,F);const U=B+(M==="border-box"?D+I:0),k=Math.abs(B-L)<=1;return{outerHeightStyle:U,overflowing:k}},[r,o,e.placeholder]),b=Pt(()=>{const w=u.current,C=g();if(!w||!C||pL(C))return!1;const R=C.outerHeightStyle;return p.current!=null&&p.current!==R}),x=T.useCallback(()=>{const w=u.current,C=g();if(!w||!C||pL(C))return;const R=C.outerHeightStyle;p.current!==R&&(p.current=R,w.style.height=`${R}px`),w.style.overflow=C.overflowing?"hidden":""},[g]),E=T.useRef(-1);Io(()=>{const w=mB(x),C=u?.current;if(!C)return;const R=fc(C);R.addEventListener("resize",w);let M;return typeof ResizeObserver<"u"&&(M=new ResizeObserver(()=>{b()&&(M.unobserve(C),cancelAnimationFrame(E.current),x(),E.current=requestAnimationFrame(()=>{M.observe(C)}))}),M.observe(C)),()=>{w.clear(),cancelAnimationFrame(E.current),R.removeEventListener("resize",w),M&&M.disconnect()}},[g,x,b]),Io(()=>{x()});const S=w=>{c||x();const C=w.target,R=C.value.length,M=C.value.endsWith(`
430
- `),D=C.selectionStart===R;M&&D&&C.setSelectionRange(R,R),n&&n(w)};return m.jsxs(T.Fragment,{children:[m.jsx("textarea",{value:i,onChange:S,ref:f,rows:o,style:a,...s}),m.jsx("textarea",{"aria-hidden":!0,className:e.className,readOnly:!0,ref:y,tabIndex:-1,style:{...jCe.shadow,...a,paddingTop:0,paddingBottom:0}})]})});function zCe(e){return Ut("MuiInputBase",e)}const pi=Lt("MuiInputBase",["root","formControl","focused","disabled","adornedStart","adornedEnd","error","sizeSmall","multiline","colorSecondary","fullWidth","hiddenLabel","readOnly","input","inputSizeSmall","inputMultiline","inputTypeSearch","inputAdornedStart","inputAdornedEnd","inputHiddenLabel"]);var hL;const _S=(e,t)=>{const{ownerState:n}=e;return[t.root,n.formControl&&t.formControl,n.startAdornment&&t.adornedStart,n.endAdornment&&t.adornedEnd,n.error&&t.error,n.size==="small"&&t.sizeSmall,n.multiline&&t.multiline,n.color&&t[`color${bt(n.color)}`],n.fullWidth&&t.fullWidth,n.hiddenLabel&&t.hiddenLabel]},LS=(e,t)=>{const{ownerState:n}=e;return[t.input,n.size==="small"&&t.inputSizeSmall,n.multiline&&t.inputMultiline,n.type==="search"&&t.inputTypeSearch,n.startAdornment&&t.inputAdornedStart,n.endAdornment&&t.inputAdornedEnd,n.hiddenLabel&&t.inputHiddenLabel]},HCe=e=>{const{classes:t,color:n,disabled:r,error:o,endAdornment:a,focused:i,formControl:s,fullWidth:c,hiddenLabel:u,multiline:f,readOnly:p,size:y,startAdornment:g,type:b}=e,x={root:["root",`color${bt(n)}`,r&&"disabled",o&&"error",c&&"fullWidth",i&&"focused",s&&"formControl",y&&y!=="medium"&&`size${bt(y)}`,f&&"multiline",g&&"adornedStart",a&&"adornedEnd",u&&"hiddenLabel",p&&"readOnly"],input:["input",r&&"disabled",b==="search"&&"inputTypeSearch",f&&"inputMultiline",y==="small"&&"inputSizeSmall",u&&"inputHiddenLabel",g&&"inputAdornedStart",a&&"inputAdornedEnd",p&&"readOnly"]};return zt(x,zCe,t)},FS=Pe("div",{name:"MuiInputBase",slot:"Root",overridesResolver:_S})(Pn(({theme:e})=>({...e.typography.body1,color:(e.vars||e).palette.text.primary,lineHeight:"1.4375em",boxSizing:"border-box",position:"relative",cursor:"text",display:"inline-flex",alignItems:"center",[`&.${pi.disabled}`]:{color:(e.vars||e).palette.text.disabled,cursor:"default"},variants:[{props:({ownerState:t})=>t.multiline,style:{padding:"4px 0 5px"}},{props:({ownerState:t,size:n})=>t.multiline&&n==="small",style:{paddingTop:1}},{props:({ownerState:t})=>t.fullWidth,style:{width:"100%"}}]}))),jS=Pe("input",{name:"MuiInputBase",slot:"Input",overridesResolver:LS})(Pn(({theme:e})=>{const t=e.palette.mode==="light",n={color:"currentColor",...e.vars?{opacity:e.vars.opacity.inputPlaceholder}:{opacity:t?.42:.5},transition:e.transitions.create("opacity",{duration:e.transitions.duration.shorter})},r={opacity:"0 !important"},o=e.vars?{opacity:e.vars.opacity.inputPlaceholder}:{opacity:t?.42:.5};return{font:"inherit",letterSpacing:"inherit",color:"currentColor",padding:"4px 0 5px",border:0,boxSizing:"content-box",background:"none",height:"1.4375em",margin:0,WebkitTapHighlightColor:"transparent",display:"block",minWidth:0,width:"100%","&::-webkit-input-placeholder":n,"&::-moz-placeholder":n,"&::-ms-input-placeholder":n,"&:focus":{outline:0},"&:invalid":{boxShadow:"none"},"&::-webkit-search-decoration":{WebkitAppearance:"none"},[`label[data-shrink=false] + .${pi.formControl} &`]:{"&::-webkit-input-placeholder":r,"&::-moz-placeholder":r,"&::-ms-input-placeholder":r,"&:focus::-webkit-input-placeholder":o,"&:focus::-moz-placeholder":o,"&:focus::-ms-input-placeholder":o},[`&.${pi.disabled}`]:{opacity:1,WebkitTextFillColor:(e.vars||e).palette.text.disabled},variants:[{props:({ownerState:a})=>!a.disableInjectingGlobalStyles,style:{animationName:"mui-auto-fill-cancel",animationDuration:"10ms","&:-webkit-autofill":{animationDuration:"5000s",animationName:"mui-auto-fill"}}},{props:{size:"small"},style:{paddingTop:1}},{props:({ownerState:a})=>a.multiline,style:{height:"auto",resize:"none",padding:0,paddingTop:0}},{props:{type:"search"},style:{MozAppearance:"textfield"}}]}})),mL=Lce({"@keyframes mui-auto-fill":{from:{display:"block"}},"@keyframes mui-auto-fill-cancel":{from:{display:"block"}}}),HD=T.forwardRef(function(e,t){const n=An({props:e,name:"MuiInputBase"}),{"aria-describedby":r,autoComplete:o,autoFocus:a,className:i,color:s,components:c={},componentsProps:u={},defaultValue:f,disabled:p,disableInjectingGlobalStyles:y,endAdornment:g,error:b,fullWidth:x=!1,id:E,inputComponent:S="input",inputProps:w={},inputRef:C,margin:R,maxRows:M,minRows:D,multiline:I=!1,name:L,onBlur:F,onChange:B,onClick:U,onFocus:k,onKeyDown:$,onKeyUp:j,placeholder:V,readOnly:z,renderSuffix:K,rows:Y,size:te,slotProps:_={},slots:Z={},startAdornment:J,type:W="text",value:re,...ne}=n,X=w.value!=null?w.value:re,{current:ie}=T.useRef(X!=null),ae=T.useRef(),fe=T.useCallback(ft=>{},[]),xe=cr(ae,C,w.ref,fe),[ge,Re]=T.useState(!1),de=Oi(),me=of({props:n,muiFormControl:de,states:["color","disabled","error","hiddenLabel","size","required","filled"]});me.focused=de?de.focused:ge,T.useEffect(()=>{!de&&p&&ge&&(Re(!1),F&&F())},[de,p,ge,F]);const Qe=de&&de.onFilled,Me=de&&de.onEmpty,we=T.useCallback(ft=>{ax(ft)?Qe&&Qe():Me&&Me()},[Qe,Me]);Io(()=>{ie&&we({value:X})},[X,we,ie]);const Se=ft=>{k&&k(ft),w.onFocus&&w.onFocus(ft),de&&de.onFocus?de.onFocus(ft):Re(!0)},dt=ft=>{F&&F(ft),w.onBlur&&w.onBlur(ft),de&&de.onBlur?de.onBlur(ft):Re(!1)},ze=(ft,...$e)=>{if(!ie){const Ht=ft.target||ae.current;if(Ht==null)throw new Error(uc(1));we({value:Ht.value})}w.onChange&&w.onChange(ft,...$e),B&&B(ft,...$e)};T.useEffect(()=>{we(ae.current)},[]);const tt=ft=>{ae.current&&ft.currentTarget===ft.target&&ae.current.focus(),U&&U(ft)};let Ze=S,qt=w;I&&Ze==="input"&&(Y?qt={type:void 0,minRows:Y,maxRows:Y,...qt}:qt={type:void 0,maxRows:M,minRows:D,...qt},Ze=$Ce);const Vt=ft=>{we(ft.animationName==="mui-auto-fill-cancel"?ae.current:{value:"x"})};T.useEffect(()=>{de&&de.setAdornedStart(!!J)},[de,J]);const Mt={...n,color:me.color||"primary",disabled:me.disabled,endAdornment:g,error:me.error,focused:me.focused,formControl:de,fullWidth:x,hiddenLabel:me.hiddenLabel,multiline:I,size:me.size,startAdornment:J,type:W},ke=HCe(Mt),Ne=Z.root||c.Root||FS,lt=_.root||u.root||{},St=Z.input||c.Input||jS;return qt={...qt,..._.input??u.input},m.jsxs(T.Fragment,{children:[!y&&typeof mL=="function"&&(hL||(hL=m.jsx(mL,{}))),m.jsxs(Ne,{...lt,ref:t,onClick:tt,...ne,...!Qp(Ne)&&{ownerState:{...Mt,...lt.ownerState}},className:Ot(ke.root,lt.className,i,z&&"MuiInputBase-readOnly"),children:[J,m.jsx(IS.Provider,{value:null,children:m.jsx(St,{"aria-invalid":me.error,"aria-describedby":r,autoComplete:o,autoFocus:a,defaultValue:f,disabled:me.disabled,id:E,onAnimationStart:Vt,name:L,placeholder:V,readOnly:z,required:me.required,rows:Y,value:X,onKeyDown:$,onKeyUp:j,type:W,...qt,...!Qp(St)&&{as:Ze,ownerState:{...Mt,...qt.ownerState}},ref:xe,className:Ot(ke.input,qt.className,z&&"MuiInputBase-readOnly"),onBlur:dt,onChange:ze,onFocus:Se})}),g,K?K({...me,startAdornment:J}):null]})]})});function UCe(e){return Ut("MuiInput",e)}const fu={...pi,...Lt("MuiInput",["root","underline","input"])},VCe=e=>{const{classes:t,disableUnderline:n}=e,r=zt({root:["root",!n&&"underline"],input:["input"]},UCe,t);return{...t,...r}},WCe=Pe(FS,{shouldForwardProp:e=>wa(e)||e==="classes",name:"MuiInput",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[..._S(e,t),!n.disableUnderline&&t.underline]}})(Pn(({theme:e})=>{let t=e.palette.mode==="light"?"rgba(0, 0, 0, 0.42)":"rgba(255, 255, 255, 0.7)";return e.vars&&(t=e.alpha(e.vars.palette.common.onBackground,e.vars.opacity.inputUnderline)),{position:"relative",variants:[{props:({ownerState:n})=>n.formControl,style:{"label + &":{marginTop:16}}},{props:({ownerState:n})=>!n.disableUnderline,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"},[`&.${fu.focused}:after`]:{transform:"scaleX(1) translateX(0)"},[`&.${fu.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(.${fu.disabled}, .${fu.error}):before`]:{borderBottom:`2px solid ${(e.vars||e).palette.text.primary}`,"@media (hover: none)":{borderBottom:`1px solid ${t}`}},[`&.${fu.disabled}:before`]:{borderBottomStyle:"dotted"}}},...Object.entries(e.palette).filter(Sa()).map(([n])=>({props:{color:n,disableUnderline:!1},style:{"&::after":{borderBottom:`2px solid ${(e.vars||e).palette[n].main}`}}}))]}})),qCe=Pe(jS,{name:"MuiInput",slot:"Input",overridesResolver:LS})({}),UD=T.forwardRef(function(e,t){const n=An({props:e,name:"MuiInput"}),{disableUnderline:r=!1,components:o={},componentsProps:a,fullWidth:i=!1,inputComponent:s="input",multiline:c=!1,slotProps:u,slots:f={},type:p="text",...y}=n,g=VCe(n),b={root:{ownerState:{disableUnderline:r}}},x=u??a?sa(u??a,b):b,E=f.root??o.Root??WCe,S=f.input??o.Input??qCe;return m.jsx(HD,{slots:{root:E,input:S},slotProps:x,fullWidth:i,inputComponent:s,multiline:c,ref:t,type:p,...y,classes:g})});UD.muiName="Input";function GCe(e){return Ut("MuiFilledInput",e)}const hi={...pi,...Lt("MuiFilledInput",["root","underline","input","adornedStart","adornedEnd","sizeSmall","multiline","hiddenLabel"])},YCe=e=>{const{classes:t,disableUnderline:n,startAdornment:r,endAdornment:o,size:a,hiddenLabel:i,multiline:s}=e,c={root:["root",!n&&"underline",r&&"adornedStart",o&&"adornedEnd",a==="small"&&`size${bt(a)}`,i&&"hiddenLabel",s&&"multiline"],input:["input"]},u=zt(c,GCe,t);return{...t,...u}},KCe=Pe(FS,{shouldForwardProp:e=>wa(e)||e==="classes",name:"MuiFilledInput",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[..._S(e,t),!n.disableUnderline&&t.underline]}})(Pn(({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{position:"relative",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}},[`&.${hi.focused}`]:{backgroundColor:e.vars?e.vars.palette.FilledInput.bg:r},[`&.${hi.disabled}`]:{backgroundColor:e.vars?e.vars.palette.FilledInput.disabledBg:a},variants:[{props:({ownerState:i})=>!i.disableUnderline,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"},[`&.${hi.focused}:after`]:{transform:"scaleX(1) translateX(0)"},[`&.${hi.error}`]:{"&::before, &::after":{borderBottomColor:(e.vars||e).palette.error.main}},"&::before":{borderBottom:`1px solid ${e.vars?e.alpha(e.vars.palette.common.onBackground,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(.${hi.disabled}, .${hi.error}):before`]:{borderBottom:`1px solid ${(e.vars||e).palette.text.primary}`},[`&.${hi.disabled}:before`]:{borderBottomStyle:"dotted"}}},...Object.entries(e.palette).filter(Sa()).map(([i])=>({props:{disableUnderline:!1,color:i},style:{"&::after":{borderBottom:`2px solid ${(e.vars||e).palette[i]?.main}`}}})),{props:({ownerState:i})=>i.startAdornment,style:{paddingLeft:12}},{props:({ownerState:i})=>i.endAdornment,style:{paddingRight:12}},{props:({ownerState:i})=>i.multiline,style:{padding:"25px 12px 8px"}},{props:({ownerState:i,size:s})=>i.multiline&&s==="small",style:{paddingTop:21,paddingBottom:4}},{props:({ownerState:i})=>i.multiline&&i.hiddenLabel,style:{paddingTop:16,paddingBottom:17}},{props:({ownerState:i})=>i.multiline&&i.hiddenLabel&&i.size==="small",style:{paddingTop:8,paddingBottom:9}}]}})),QCe=Pe(jS,{name:"MuiFilledInput",slot:"Input",overridesResolver:LS})(Pn(({theme:e})=>({paddingTop:25,paddingRight:12,paddingBottom:8,paddingLeft:12,...!e.vars&&{"&:-webkit-autofill":{WebkitBoxShadow:e.palette.mode==="light"?null:"0 0 0 100px #266798 inset",WebkitTextFillColor:e.palette.mode==="light"?null:"#fff",caretColor:e.palette.mode==="light"?null:"#fff",borderTopLeftRadius:"inherit",borderTopRightRadius:"inherit"}},...e.vars&&{"&:-webkit-autofill":{borderTopLeftRadius:"inherit",borderTopRightRadius:"inherit"},[e.getColorSchemeSelector("dark")]:{"&:-webkit-autofill":{WebkitBoxShadow:"0 0 0 100px #266798 inset",WebkitTextFillColor:"#fff",caretColor:"#fff"}}},variants:[{props:{size:"small"},style:{paddingTop:21,paddingBottom:4}},{props:({ownerState:t})=>t.hiddenLabel,style:{paddingTop:16,paddingBottom:17}},{props:({ownerState:t})=>t.startAdornment,style:{paddingLeft:0}},{props:({ownerState:t})=>t.endAdornment,style:{paddingRight:0}},{props:({ownerState:t})=>t.hiddenLabel&&t.size==="small",style:{paddingTop:8,paddingBottom:9}},{props:({ownerState:t})=>t.multiline,style:{paddingTop:0,paddingBottom:0,paddingLeft:0,paddingRight:0}}]}))),VD=T.forwardRef(function(e,t){const n=An({props:e,name:"MuiFilledInput"}),{disableUnderline:r=!1,components:o={},componentsProps:a,fullWidth:i=!1,hiddenLabel:s,inputComponent:c="input",multiline:u=!1,slotProps:f,slots:p={},type:y="text",...g}=n,b={...n,disableUnderline:r,fullWidth:i,inputComponent:c,multiline:u,type:y},x=YCe(n),E={root:{ownerState:b},input:{ownerState:b}},S=f??a?sa(E,f??a):E,w=p.root??o.Root??KCe,C=p.input??o.Input??QCe;return m.jsx(HD,{slots:{root:w,input:C},slotProps:S,fullWidth:i,inputComponent:c,multiline:u,ref:t,type:y,...g,classes:x})});VD.muiName="Input";var gL;const XCe=Pe("fieldset",{name:"MuiNotchedOutlined",shouldForwardProp:wa})({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%"}),ZCe=Pe("legend",{name:"MuiNotchedOutlined",shouldForwardProp:wa})(Pn(({theme:e})=>({float:"unset",width:"auto",overflow:"hidden",variants:[{props:({ownerState:t})=>!t.withLabel,style:{padding:0,lineHeight:"11px",transition:e.transitions.create("width",{duration:150,easing:e.transitions.easing.easeOut})}},{props:({ownerState:t})=>t.withLabel,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:({ownerState:t})=>t.withLabel&&t.notched,style:{maxWidth:"100%",transition:e.transitions.create("max-width",{duration:100,easing:e.transitions.easing.easeOut,delay:50})}}]})));function JCe(e){const{children:t,classes:n,className:r,label:o,notched:a,...i}=e,s=o!=null&&o!=="",c={...e,notched:a,withLabel:s};return m.jsx(XCe,{"aria-hidden":!0,className:r,ownerState:c,...i,children:m.jsx(ZCe,{ownerState:c,children:s?m.jsx("span",{children:o}):gL||(gL=m.jsx("span",{className:"notranslate","aria-hidden":!0,children:"​"}))})})}function eTe(e){return Ut("MuiOutlinedInput",e)}const Vi={...pi,...Lt("MuiOutlinedInput",["root","notchedOutline","input"])},tTe=e=>{const{classes:t}=e,n=zt({root:["root"],notchedOutline:["notchedOutline"],input:["input"]},eTe,t);return{...t,...n}},nTe=Pe(FS,{shouldForwardProp:e=>wa(e)||e==="classes",name:"MuiOutlinedInput",slot:"Root",overridesResolver:_S})(Pn(({theme:e})=>{const t=e.palette.mode==="light"?"rgba(0, 0, 0, 0.23)":"rgba(255, 255, 255, 0.23)";return{position:"relative",borderRadius:(e.vars||e).shape.borderRadius,[`&:hover .${Vi.notchedOutline}`]:{borderColor:(e.vars||e).palette.text.primary},"@media (hover: none)":{[`&:hover .${Vi.notchedOutline}`]:{borderColor:e.vars?e.alpha(e.vars.palette.common.onBackground,.23):t}},[`&.${Vi.focused} .${Vi.notchedOutline}`]:{borderWidth:2},variants:[...Object.entries(e.palette).filter(Sa()).map(([n])=>({props:{color:n},style:{[`&.${Vi.focused} .${Vi.notchedOutline}`]:{borderColor:(e.vars||e).palette[n].main}}})),{props:{},style:{[`&.${Vi.error} .${Vi.notchedOutline}`]:{borderColor:(e.vars||e).palette.error.main},[`&.${Vi.disabled} .${Vi.notchedOutline}`]:{borderColor:(e.vars||e).palette.action.disabled}}},{props:({ownerState:n})=>n.startAdornment,style:{paddingLeft:14}},{props:({ownerState:n})=>n.endAdornment,style:{paddingRight:14}},{props:({ownerState:n})=>n.multiline,style:{padding:"16.5px 14px"}},{props:({ownerState:n,size:r})=>n.multiline&&r==="small",style:{padding:"8.5px 14px"}}]}})),rTe=Pe(JCe,{name:"MuiOutlinedInput",slot:"NotchedOutline"})(Pn(({theme:e})=>{const t=e.palette.mode==="light"?"rgba(0, 0, 0, 0.23)":"rgba(255, 255, 255, 0.23)";return{borderColor:e.vars?e.alpha(e.vars.palette.common.onBackground,.23):t}})),oTe=Pe(jS,{name:"MuiOutlinedInput",slot:"Input",overridesResolver:LS})(Pn(({theme:e})=>({padding:"16.5px 14px",...!e.vars&&{"&:-webkit-autofill":{WebkitBoxShadow:e.palette.mode==="light"?null:"0 0 0 100px #266798 inset",WebkitTextFillColor:e.palette.mode==="light"?null:"#fff",caretColor:e.palette.mode==="light"?null:"#fff",borderRadius:"inherit"}},...e.vars&&{"&:-webkit-autofill":{borderRadius:"inherit"},[e.getColorSchemeSelector("dark")]:{"&:-webkit-autofill":{WebkitBoxShadow:"0 0 0 100px #266798 inset",WebkitTextFillColor:"#fff",caretColor:"#fff"}}},variants:[{props:{size:"small"},style:{padding:"8.5px 14px"}},{props:({ownerState:t})=>t.multiline,style:{padding:0}},{props:({ownerState:t})=>t.startAdornment,style:{paddingLeft:0}},{props:({ownerState:t})=>t.endAdornment,style:{paddingRight:0}}]}))),WD=T.forwardRef(function(e,t){const n=An({props:e,name:"MuiOutlinedInput"}),{components:r={},fullWidth:o=!1,inputComponent:a="input",label:i,multiline:s=!1,notched:c,slots:u={},slotProps:f={},type:p="text",...y}=n,g=tTe(n),b=Oi(),x=of({props:n,muiFormControl:b,states:["color","disabled","error","focused","hiddenLabel","size","required"]}),E={...n,color:x.color||"primary",disabled:x.disabled,error:x.error,focused:x.focused,formControl:b,fullWidth:o,hiddenLabel:x.hiddenLabel,multiline:s,size:x.size,type:p},S=u.root??r.Root??nTe,w=u.input??r.Input??oTe,[C,R]=tr("notchedOutline",{elementType:rTe,className:g.notchedOutline,shouldForwardComponentProp:!0,ownerState:E,externalForwardedProps:{slots:u,slotProps:f},additionalProps:{label:i!=null&&i!==""&&x.required?m.jsxs(T.Fragment,{children:[i," ","*"]}):i}});return m.jsx(HD,{slots:{root:S,input:w},slotProps:f,renderSuffix:M=>m.jsx(C,{...R,notched:typeof c<"u"?c:!!(M.startAdornment||M.filled||M.focused)}),fullWidth:o,inputComponent:a,multiline:s,ref:t,type:p,...y,classes:{...g,notchedOutline:null}})});WD.muiName="Input";function aTe(e){return Ut("MuiFormLabel",e)}const py=Lt("MuiFormLabel",["root","colorSecondary","focused","disabled","error","filled","required","asterisk"]),iTe=e=>{const{classes:t,color:n,focused:r,disabled:o,error:a,filled:i,required:s}=e,c={root:["root",`color${bt(n)}`,o&&"disabled",a&&"error",i&&"filled",r&&"focused",s&&"required"],asterisk:["asterisk",a&&"error"]};return zt(c,aTe,t)},sTe=Pe("label",{name:"MuiFormLabel",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.color==="secondary"&&t.colorSecondary,n.filled&&t.filled]}})(Pn(({theme:e})=>({color:(e.vars||e).palette.text.secondary,...e.typography.body1,lineHeight:"1.4375em",padding:0,position:"relative",variants:[...Object.entries(e.palette).filter(Sa()).map(([t])=>({props:{color:t},style:{[`&.${py.focused}`]:{color:(e.vars||e).palette[t].main}}})),{props:{},style:{[`&.${py.disabled}`]:{color:(e.vars||e).palette.text.disabled},[`&.${py.error}`]:{color:(e.vars||e).palette.error.main}}}]}))),lTe=Pe("span",{name:"MuiFormLabel",slot:"Asterisk"})(Pn(({theme:e})=>({[`&.${py.error}`]:{color:(e.vars||e).palette.error.main}}))),cTe=T.forwardRef(function(e,t){const n=An({props:e,name:"MuiFormLabel"}),{children:r,className:o,color:a,component:i="label",disabled:s,error:c,filled:u,focused:f,required:p,...y}=n,g=Oi(),b=of({props:n,muiFormControl:g,states:["color","required","focused","disabled","error","filled"]}),x={...n,color:b.color||"primary",component:i,disabled:b.disabled,error:b.error,filled:b.filled,focused:b.focused,required:b.required},E=iTe(x);return m.jsxs(sTe,{as:i,ownerState:x,className:Ot(E.root,o),ref:t,...y,children:[r,b.required&&m.jsxs(lTe,{ownerState:x,"aria-hidden":!0,className:E.asterisk,children:[" ","*"]})]})});function uTe(e){return Ut("MuiInputLabel",e)}Lt("MuiInputLabel",["root","focused","disabled","error","required","asterisk","formControl","sizeSmall","shrink","animated","standard","filled","outlined"]);const dTe=e=>{const{classes:t,formControl:n,size:r,shrink:o,disableAnimation:a,variant:i,required:s}=e,c={root:["root",n&&"formControl",!a&&"animated",o&&"shrink",r&&r!=="medium"&&`size${bt(r)}`,i],asterisk:[s&&"asterisk"]},u=zt(c,uTe,t);return{...t,...u}},fTe=Pe(cTe,{shouldForwardProp:e=>wa(e)||e==="classes",name:"MuiInputLabel",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[{[`& .${py.asterisk}`]:t.asterisk},t.root,n.formControl&&t.formControl,n.size==="small"&&t.sizeSmall,n.shrink&&t.shrink,!n.disableAnimation&&t.animated,n.focused&&t.focused,t[n.variant]]}})(Pn(({theme:e})=>({display:"block",transformOrigin:"top left",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",maxWidth:"100%",variants:[{props:({ownerState:t})=>t.formControl,style:{position:"absolute",left:0,top:0,transform:"translate(0, 20px) scale(1)"}},{props:{size:"small"},style:{transform:"translate(0, 17px) scale(1)"}},{props:({ownerState:t})=>t.shrink,style:{transform:"translate(0, -1.5px) scale(0.75)",transformOrigin:"top left",maxWidth:"133%"}},{props:({ownerState:t})=>!t.disableAnimation,style:{transition:e.transitions.create(["color","transform","max-width"],{duration:e.transitions.duration.shorter,easing:e.transitions.easing.easeOut})}},{props:{variant:"filled"},style:{zIndex:1,pointerEvents:"none",transform:"translate(12px, 16px) scale(1)",maxWidth:"calc(100% - 24px)"}},{props:{variant:"filled",size:"small"},style:{transform:"translate(12px, 13px) scale(1)"}},{props:({variant:t,ownerState:n})=>t==="filled"&&n.shrink,style:{userSelect:"none",pointerEvents:"auto",transform:"translate(12px, 7px) scale(0.75)",maxWidth:"calc(133% - 24px)"}},{props:({variant:t,ownerState:n,size:r})=>t==="filled"&&n.shrink&&r==="small",style:{transform:"translate(12px, 4px) scale(0.75)"}},{props:{variant:"outlined"},style:{zIndex:1,pointerEvents:"none",transform:"translate(14px, 16px) scale(1)",maxWidth:"calc(100% - 24px)"}},{props:{variant:"outlined",size:"small"},style:{transform:"translate(14px, 9px) scale(1)"}},{props:({variant:t,ownerState:n})=>t==="outlined"&&n.shrink,style:{userSelect:"none",pointerEvents:"auto",maxWidth:"calc(133% - 32px)",transform:"translate(14px, -9px) scale(0.75)"}}]}))),sx=T.forwardRef(function(e,t){const n=An({name:"MuiInputLabel",props:e}),{disableAnimation:r=!1,margin:o,shrink:a,variant:i,className:s,...c}=n,u=Oi();let f=a;typeof f>"u"&&u&&(f=u.filled||u.focused||u.adornedStart);const p=of({props:n,muiFormControl:u,states:["size","variant","required","focused"]}),y={...n,disableAnimation:r,formControl:u,shrink:f,size:p.size,variant:p.variant,required:p.required,focused:p.focused},g=dTe(y);return m.jsx(fTe,{"data-shrink":f,ref:t,className:Ot(g.root,s),...c,ownerState:y,classes:g})});function pTe(e){return Ut("MuiFormHelperText",e)}const yL=Lt("MuiFormHelperText",["root","error","disabled","sizeSmall","sizeMedium","contained","focused","filled","required"]);var bL;const hTe=e=>{const{classes:t,contained:n,size:r,disabled:o,error:a,filled:i,focused:s,required:c}=e,u={root:["root",o&&"disabled",a&&"error",r&&`size${bt(r)}`,n&&"contained",s&&"focused",i&&"filled",c&&"required"]};return zt(u,pTe,t)},mTe=Pe("p",{name:"MuiFormHelperText",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.size&&t[`size${bt(n.size)}`],n.contained&&t.contained,n.filled&&t.filled]}})(Pn(({theme:e})=>({color:(e.vars||e).palette.text.secondary,...e.typography.caption,textAlign:"left",marginTop:3,marginRight:0,marginBottom:0,marginLeft:0,[`&.${yL.disabled}`]:{color:(e.vars||e).palette.text.disabled},[`&.${yL.error}`]:{color:(e.vars||e).palette.error.main},variants:[{props:{size:"small"},style:{marginTop:4}},{props:({ownerState:t})=>t.contained,style:{marginLeft:14,marginRight:14}}]}))),v$=T.forwardRef(function(e,t){const n=An({props:e,name:"MuiFormHelperText"}),{children:r,className:o,component:a="p",disabled:i,error:s,filled:c,focused:u,margin:f,required:p,variant:y,...g}=n,b=Oi(),x=of({props:n,muiFormControl:b,states:["variant","size","disabled","error","filled","focused","required"]}),E={...n,component:a,contained:x.variant==="filled"||x.variant==="outlined",variant:x.variant,size:x.size,disabled:x.disabled,error:x.error,filled:x.filled,focused:x.focused,required:x.required};delete E.ownerState;const S=hTe(E);return m.jsx(mTe,{as:a,className:Ot(S.root,o),ref:t,...g,ownerState:E,children:r===" "?bL||(bL=m.jsx("span",{className:"notranslate","aria-hidden":!0,children:"​"})):r})});function mr(e){const{elementType:t,externalSlotProps:n,ownerState:r,skipResolvingSlotProps:o=!1,...a}=e,i=o?{}:Xp(n,r),{props:s,internalRef:c}=n$({...a,externalSlotProps:i}),u=cr(c,i?.ref,e.additionalProps?.ref);return t$(t,{...s,ref:u},r)}function gTe(e){return Ut("MuiList",e)}Lt("MuiList",["root","padding","dense","subheader"]);const yTe=e=>{const{classes:t,disablePadding:n,dense:r,subheader:o}=e;return zt({root:["root",!n&&"padding",r&&"dense",o&&"subheader"]},gTe,t)},bTe=Pe("ul",{name:"MuiList",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,!n.disablePadding&&t.padding,n.dense&&t.dense,n.subheader&&t.subheader]}})({listStyle:"none",margin:0,padding:0,position:"relative",variants:[{props:({ownerState:e})=>!e.disablePadding,style:{paddingTop:8,paddingBottom:8}},{props:({ownerState:e})=>e.subheader,style:{paddingTop:0}}]}),x$=T.forwardRef(function(e,t){const n=An({props:e,name:"MuiList"}),{children:r,className:o,component:a="ul",dense:i=!1,disablePadding:s=!1,subheader:c,...u}=n,f=T.useMemo(()=>({dense:i}),[i]),p={...n,component:a,dense:i,disablePadding:s},y=yTe(p);return m.jsx(ac.Provider,{value:f,children:m.jsxs(bTe,{as:a,className:Ot(y.root,o),ref:t,ownerState:p,...u,children:[c,r]})})});function pw(e,t,n){return e===t?e.firstChild:t&&t.nextElementSibling?t.nextElementSibling:n?null:e.firstChild}function vL(e,t,n){return e===t?n?e.firstChild:e.lastChild:t&&t.previousElementSibling?t.previousElementSibling:n?null:e.lastChild}function S$(e,t){if(t===void 0)return!0;let n=e.innerText;return n===void 0&&(n=e.textContent),n=n.trim().toLowerCase(),n.length===0?!1:t.repeating?n[0]===t.keys[0]:n.startsWith(t.keys.join(""))}function bg(e,t,n,r,o,a){let i=!1,s=o(e,t,t?n:!1);for(;s;){if(s===e.firstChild){if(i)return!1;i=!0}const c=r?!1:s.disabled||s.getAttribute("aria-disabled")==="true";if(!s.hasAttribute("tabindex")||!S$(s,a)||c)s=o(e,s,n);else return s.focus(),!0}return!1}const vTe=T.forwardRef(function(e,t){const{actions:n,autoFocus:r=!1,autoFocusItem:o=!1,children:a,className:i,disabledItemsFocusable:s=!1,disableListWrap:c=!1,onKeyDown:u,variant:f="selectedMenu",...p}=e,y=T.useRef(null),g=T.useRef({keys:[],repeating:!0,previousKeyMatched:!0,lastTime:null});Io(()=>{r&&y.current.focus()},[r]),T.useImperativeHandle(n,()=>({adjustStyleForScrollbar:(w,{direction:C})=>{const R=!y.current.style.width;if(w.clientHeight<y.current.clientHeight&&R){const M=`${r$(fc(w))}px`;y.current.style[C==="rtl"?"paddingLeft":"paddingRight"]=M,y.current.style.width=`calc(100% + ${M})`}return y.current}}),[]);const b=w=>{const C=y.current,R=w.key;if(w.ctrlKey||w.metaKey||w.altKey){u&&u(w);return}const M=Po(C).activeElement;if(R==="ArrowDown")w.preventDefault(),bg(C,M,c,s,pw);else if(R==="ArrowUp")w.preventDefault(),bg(C,M,c,s,vL);else if(R==="Home")w.preventDefault(),bg(C,null,c,s,pw);else if(R==="End")w.preventDefault(),bg(C,null,c,s,vL);else if(R.length===1){const D=g.current,I=R.toLowerCase(),L=performance.now();D.keys.length>0&&(L-D.lastTime>500?(D.keys=[],D.repeating=!0,D.previousKeyMatched=!0):D.repeating&&I!==D.keys[0]&&(D.repeating=!1)),D.lastTime=L,D.keys.push(I);const F=M&&!D.repeating&&S$(M,D);D.previousKeyMatched&&(F||bg(C,M,!1,s,pw,D))?w.preventDefault():D.previousKeyMatched=!1}u&&u(w)},x=cr(y,t);let E=-1;T.Children.forEach(a,(w,C)=>{if(!T.isValidElement(w)){E===C&&(E+=1,E>=a.length&&(E=-1));return}w.props.disabled||(f==="selectedMenu"&&w.props.selected||E===-1)&&(E=C),E===C&&(w.props.disabled||w.props.muiSkipListHighlight||w.type.muiSkipListHighlight)&&(E+=1,E>=a.length&&(E=-1))});const S=T.Children.map(a,(w,C)=>{if(C===E){const R={};return o&&(R.autoFocus=!0),w.props.tabIndex===void 0&&f==="selectedMenu"&&(R.tabIndex=0),T.cloneElement(w,R)}return w});return m.jsx(x$,{role:"menu",ref:x,className:i,onKeyDown:b,tabIndex:r?0:-1,...p,children:S})});function e2(e){return`scale(${e}, ${e**2})`}const xTe={entering:{opacity:1,transform:e2(1)},entered:{opacity:1,transform:"none"}},hw=typeof navigator<"u"&&/^((?!chrome|android).)*(safari|mobile)/i.test(navigator.userAgent)&&/(os |version\/)15(.|_)4/i.test(navigator.userAgent),Vy=T.forwardRef(function(e,t){const{addEndListener:n,appear:r=!0,children:o,easing:a,in:i,onEnter:s,onEntered:c,onEntering:u,onExit:f,onExited:p,onExiting:y,style:g,timeout:b="auto",TransitionComponent:x=ms,...E}=e,S=PS(),w=T.useRef(),C=_u(),R=T.useRef(null),M=cr(R,wh(o),t),D=$=>j=>{if($){const V=R.current;j===void 0?$(V):$(V,j)}},I=D(u),L=D(($,j)=>{i$($);const{duration:V,delay:z,easing:K}=Zp({style:g,timeout:b,easing:a},{mode:"enter"});let Y;b==="auto"?(Y=C.transitions.getAutoHeightDuration($.clientHeight),w.current=Y):Y=V,$.style.transition=[C.transitions.create("opacity",{duration:Y,delay:z}),C.transitions.create("transform",{duration:hw?Y:Y*.666,delay:z,easing:K})].join(","),s&&s($,j)}),F=D(c),B=D(y),U=D($=>{const{duration:j,delay:V,easing:z}=Zp({style:g,timeout:b,easing:a},{mode:"exit"});let K;b==="auto"?(K=C.transitions.getAutoHeightDuration($.clientHeight),w.current=K):K=j,$.style.transition=[C.transitions.create("opacity",{duration:K,delay:V}),C.transitions.create("transform",{duration:hw?K:K*.666,delay:hw?V:V||K*.333,easing:z})].join(","),$.style.opacity=0,$.style.transform=e2(.75),f&&f($)}),k=D(p);return m.jsx(x,{appear:r,in:i,nodeRef:R,onEnter:L,onEntered:F,onEntering:I,onExit:U,onExited:k,onExiting:B,addEndListener:$=>{b==="auto"&&S.start(w.current||0,$),n&&n(R.current,$)},timeout:b==="auto"?null:b,...E,children:($,{ownerState:j,...V})=>T.cloneElement(o,{style:{opacity:0,transform:e2(.75),visibility:$==="exited"&&!i?"hidden":void 0,...xTe[$],...g,...o.props.style},ref:M,...V})})});Vy&&(Vy.muiSupportAuto=!0);function STe(e){return Ut("MuiPopover",e)}Lt("MuiPopover",["root","paper"]);function xL(e,t){let n=0;return typeof t=="number"?n=t:t==="center"?n=e.height/2:t==="bottom"&&(n=e.height),n}function SL(e,t){let n=0;return typeof t=="number"?n=t:t==="center"?n=e.width/2:t==="right"&&(n=e.width),n}function EL(e){return[e.horizontal,e.vertical].map(t=>typeof t=="number"?`${t}px`:t).join(" ")}function I0(e){return typeof e=="function"?e():e}const ETe=e=>{const{classes:t}=e;return zt({root:["root"],paper:["paper"]},STe,t)},CTe=Pe(l$,{name:"MuiPopover",slot:"Root"})({}),E$=Pe(rf,{name:"MuiPopover",slot:"Paper"})({position:"absolute",overflowY:"auto",overflowX:"hidden",minWidth:16,minHeight:16,maxWidth:"calc(100% - 32px)",maxHeight:"calc(100% - 32px)",outline:0}),TTe=T.forwardRef(function(e,t){const n=An({props:e,name:"MuiPopover"}),{action:r,anchorEl:o,anchorOrigin:a={vertical:"top",horizontal:"left"},anchorPosition:i,anchorReference:s="anchorEl",children:c,className:u,container:f,elevation:p=8,marginThreshold:y=16,open:g,PaperProps:b={},slots:x={},slotProps:E={},transformOrigin:S={vertical:"top",horizontal:"left"},TransitionComponent:w,transitionDuration:C="auto",TransitionProps:R={},disableScrollLock:M=!1,...D}=n,I=T.useRef(),L={...n,anchorOrigin:a,anchorReference:s,elevation:p,marginThreshold:y,transformOrigin:S,TransitionComponent:w,transitionDuration:C,TransitionProps:R},F=ETe(L),B=T.useCallback(()=>{if(s==="anchorPosition")return i;const fe=I0(o),xe=(fe&&fe.nodeType===1?fe:Po(I.current).body).getBoundingClientRect();return{top:xe.top+xL(xe,a.vertical),left:xe.left+SL(xe,a.horizontal)}},[o,a.horizontal,a.vertical,i,s]),U=T.useCallback(fe=>({vertical:xL(fe,S.vertical),horizontal:SL(fe,S.horizontal)}),[S.horizontal,S.vertical]),k=T.useCallback(fe=>{const xe={width:fe.offsetWidth,height:fe.offsetHeight},ge=U(xe);if(s==="none")return{top:null,left:null,transformOrigin:EL(ge)};const Re=B();let de=Re.top-ge.vertical,me=Re.left-ge.horizontal;const Qe=de+xe.height,Me=me+xe.width,we=fc(I0(o)),Se=we.innerHeight-y,dt=we.innerWidth-y;if(y!==null&&de<y){const ze=de-y;de-=ze,ge.vertical+=ze}else if(y!==null&&Qe>Se){const ze=Qe-Se;de-=ze,ge.vertical+=ze}if(y!==null&&me<y){const ze=me-y;me-=ze,ge.horizontal+=ze}else if(Me>dt){const ze=Me-dt;me-=ze,ge.horizontal+=ze}return{top:`${Math.round(de)}px`,left:`${Math.round(me)}px`,transformOrigin:EL(ge)}},[o,s,B,U,y]),[$,j]=T.useState(g),V=T.useCallback(()=>{const fe=I.current;if(!fe)return;const xe=k(fe);xe.top!==null&&fe.style.setProperty("top",xe.top),xe.left!==null&&(fe.style.left=xe.left),fe.style.transformOrigin=xe.transformOrigin,j(!0)},[k]);T.useEffect(()=>(M&&window.addEventListener("scroll",V),()=>window.removeEventListener("scroll",V)),[o,M,V]);const z=()=>{V()},K=()=>{j(!1)};T.useEffect(()=>{g&&V()}),T.useImperativeHandle(r,()=>g?{updatePosition:()=>{V()}}:null,[g,V]),T.useEffect(()=>{if(!g)return;const fe=mB(()=>{V()}),xe=fc(I0(o));return xe.addEventListener("resize",fe),()=>{fe.clear(),xe.removeEventListener("resize",fe)}},[o,g,V]);let Y=C;const te={slots:{transition:w,...x},slotProps:{transition:R,paper:b,...E}},[_,Z]=tr("transition",{elementType:Vy,externalForwardedProps:te,ownerState:L,getSlotProps:fe=>({...fe,onEntering:(xe,ge)=>{fe.onEntering?.(xe,ge),z()},onExited:xe=>{fe.onExited?.(xe),K()}}),additionalProps:{appear:!0,in:g}});C==="auto"&&!_.muiSupportAuto&&(Y=void 0);const J=f||(o?Po(I0(o)).body:void 0),[W,{slots:re,slotProps:ne,...X}]=tr("root",{ref:t,elementType:CTe,externalForwardedProps:{...te,...D},shouldForwardComponentProp:!0,additionalProps:{slots:{backdrop:x.backdrop},slotProps:{backdrop:gB(typeof E.backdrop=="function"?E.backdrop(L):E.backdrop,{invisible:!0})},container:J,open:g},ownerState:L,className:Ot(F.root,u)}),[ie,ae]=tr("paper",{ref:I,className:F.paper,elementType:E$,externalForwardedProps:te,shouldForwardComponentProp:!0,additionalProps:{elevation:p,style:$?void 0:{opacity:0}},ownerState:L});return m.jsx(W,{...X,...!Qp(W)&&{slots:re,slotProps:ne,disableScrollLock:M},children:m.jsx(_,{...Z,timeout:Y,children:m.jsx(ie,{...ae,children:c})})})});function wTe(e){return Ut("MuiMenu",e)}Lt("MuiMenu",["root","paper","list"]);const kTe={vertical:"top",horizontal:"right"},ATe={vertical:"top",horizontal:"left"},DTe=e=>{const{classes:t}=e;return zt({root:["root"],paper:["paper"],list:["list"]},wTe,t)},OTe=Pe(TTe,{shouldForwardProp:e=>wa(e)||e==="classes",name:"MuiMenu",slot:"Root"})({}),RTe=Pe(E$,{name:"MuiMenu",slot:"Paper"})({maxHeight:"calc(100% - 96px)",WebkitOverflowScrolling:"touch"}),MTe=Pe(vTe,{name:"MuiMenu",slot:"List"})({outline:0}),NTe=T.forwardRef(function(e,t){const n=An({props:e,name:"MuiMenu"}),{autoFocus:r=!0,children:o,className:a,disableAutoFocusItem:i=!1,MenuListProps:s={},onClose:c,open:u,PaperProps:f={},PopoverClasses:p,transitionDuration:y="auto",TransitionProps:{onEntering:g,...b}={},variant:x="selectedMenu",slots:E={},slotProps:S={},...w}=n,C=js(),R={...n,autoFocus:r,disableAutoFocusItem:i,MenuListProps:s,onEntering:g,PaperProps:f,transitionDuration:y,TransitionProps:b,variant:x},M=DTe(R),D=r&&!i&&u,I=T.useRef(null),L=(Y,te)=>{I.current&&I.current.adjustStyleForScrollbar(Y,{direction:C?"rtl":"ltr"}),g&&g(Y,te)},F=Y=>{Y.key==="Tab"&&(Y.preventDefault(),c&&c(Y,"tabKeyDown"))};let B=-1;T.Children.map(o,(Y,te)=>{T.isValidElement(Y)&&(Y.props.disabled||(x==="selectedMenu"&&Y.props.selected||B===-1)&&(B=te))});const U={slots:E,slotProps:{list:s,transition:b,paper:f,...S}},k=mr({elementType:E.root,externalSlotProps:S.root,ownerState:R,className:[M.root,a]}),[$,j]=tr("paper",{className:M.paper,elementType:RTe,externalForwardedProps:U,shouldForwardComponentProp:!0,ownerState:R}),[V,z]=tr("list",{className:Ot(M.list,s.className),elementType:MTe,shouldForwardComponentProp:!0,externalForwardedProps:U,getSlotProps:Y=>({...Y,onKeyDown:te=>{F(te),Y.onKeyDown?.(te)}}),ownerState:R}),K=typeof U.slotProps.transition=="function"?U.slotProps.transition(R):U.slotProps.transition;return m.jsx(OTe,{onClose:c,anchorOrigin:{vertical:"bottom",horizontal:C?"right":"left"},transformOrigin:C?kTe:ATe,slots:{root:E.root,paper:$,backdrop:E.backdrop,...E.transition&&{transition:E.transition}},slotProps:{root:k,paper:j,backdrop:typeof S.backdrop=="function"?S.backdrop(R):S.backdrop,transition:{...K,onEntering:(...Y)=>{L(...Y),K?.onEntering?.(...Y)}}},open:u,ref:t,transitionDuration:y,ownerState:R,...w,classes:p,children:m.jsx(V,{actions:I,autoFocus:r&&(B===-1||i),autoFocusItem:D,variant:x,...z,children:o})})});function PTe(e){return Ut("MuiNativeSelect",e)}const qD=Lt("MuiNativeSelect",["root","select","multiple","filled","outlined","standard","disabled","icon","iconOpen","iconFilled","iconOutlined","iconStandard","nativeInput","error"]),ITe=e=>{const{classes:t,variant:n,disabled:r,multiple:o,open:a,error:i}=e,s={select:["select",n,r&&"disabled",o&&"multiple",i&&"error"],icon:["icon",`icon${bt(n)}`,a&&"iconOpen",r&&"disabled"]};return zt(s,PTe,t)},C$=Pe("select",{name:"MuiNativeSelect"})(({theme:e})=>({MozAppearance:"none",WebkitAppearance:"none",userSelect:"none",borderRadius:0,cursor:"pointer","&:focus":{borderRadius:0},[`&.${qD.disabled}`]:{cursor:"default"},"&[multiple]":{height:"auto"},"&:not([multiple]) option, &:not([multiple]) optgroup":{backgroundColor:(e.vars||e).palette.background.paper},variants:[{props:({ownerState:t})=>t.variant!=="filled"&&t.variant!=="outlined",style:{"&&&":{paddingRight:24,minWidth:16}}},{props:{variant:"filled"},style:{"&&&":{paddingRight:32}}},{props:{variant:"outlined"},style:{borderRadius:(e.vars||e).shape.borderRadius,"&:focus":{borderRadius:(e.vars||e).shape.borderRadius},"&&&":{paddingRight:32}}}]})),_Te=Pe(C$,{name:"MuiNativeSelect",slot:"Select",shouldForwardProp:wa,overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.select,t[n.variant],n.error&&t.error,{[`&.${qD.multiple}`]:t.multiple}]}})({}),T$=Pe("svg",{name:"MuiNativeSelect"})(({theme:e})=>({position:"absolute",right:0,top:"calc(50% - .5em)",pointerEvents:"none",color:(e.vars||e).palette.action.active,[`&.${qD.disabled}`]:{color:(e.vars||e).palette.action.disabled},variants:[{props:({ownerState:t})=>t.open,style:{transform:"rotate(180deg)"}},{props:{variant:"filled"},style:{right:7}},{props:{variant:"outlined"},style:{right:7}}]})),LTe=Pe(T$,{name:"MuiNativeSelect",slot:"Icon",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.icon,n.variant&&t[`icon${bt(n.variant)}`],n.open&&t.iconOpen]}})({}),FTe=T.forwardRef(function(e,t){const{className:n,disabled:r,error:o,IconComponent:a,inputRef:i,variant:s="standard",...c}=e,u={...e,disabled:r,variant:s,error:o},f=ITe(u);return m.jsxs(T.Fragment,{children:[m.jsx(_Te,{ownerState:u,className:Ot(f.select,n),disabled:r,ref:i||t,...c}),e.multiple?null:m.jsx(LTe,{as:a,ownerState:u,className:f.icon})]})});function w$(e){return Ut("MuiSelect",e)}const vg=Lt("MuiSelect",["root","select","multiple","filled","outlined","standard","disabled","focused","icon","iconOpen","iconFilled","iconOutlined","iconStandard","nativeInput","error"]);var CL;const jTe=Pe(C$,{name:"MuiSelect",slot:"Select",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[{[`&.${vg.select}`]:t.select},{[`&.${vg.select}`]:t[n.variant]},{[`&.${vg.error}`]:t.error},{[`&.${vg.multiple}`]:t.multiple}]}})({[`&.${vg.select}`]:{height:"auto",minHeight:"1.4375em",textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden"}}),BTe=Pe(T$,{name:"MuiSelect",slot:"Icon",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.icon,n.variant&&t[`icon${bt(n.variant)}`],n.open&&t.iconOpen]}})({}),$Te=Pe("input",{shouldForwardProp:e=>hB(e)&&e!=="classes",name:"MuiSelect",slot:"NativeInput"})({bottom:0,left:0,position:"absolute",opacity:0,pointerEvents:"none",width:"100%",boxSizing:"border-box"});function TL(e,t){return typeof t=="object"&&t!==null?e===t:String(e)===String(t)}function zTe(e){return e==null||typeof e=="string"&&!e.trim()}const HTe=e=>{const{classes:t,variant:n,disabled:r,multiple:o,open:a,error:i}=e,s={select:["select",n,r&&"disabled",o&&"multiple",i&&"error"],icon:["icon",`icon${bt(n)}`,a&&"iconOpen",r&&"disabled"],nativeInput:["nativeInput"]};return zt(s,w$,t)},UTe=T.forwardRef(function(e,t){const{"aria-describedby":n,"aria-label":r,autoFocus:o,autoWidth:a,children:i,className:s,defaultOpen:c,defaultValue:u,disabled:f,displayEmpty:p,error:y=!1,IconComponent:g,inputRef:b,labelId:x,MenuProps:E={},multiple:S,name:w,onBlur:C,onChange:R,onClose:M,onFocus:D,onOpen:I,open:L,readOnly:F,renderValue:B,required:U,SelectDisplayProps:k={},tabIndex:$,type:j,value:V,variant:z="standard",...K}=e,[Y,te]=xi({controlled:V,default:u,name:"Select"}),[_,Z]=xi({controlled:L,default:c,name:"Select"}),J=T.useRef(null),W=T.useRef(null),[re,ne]=T.useState(null),{current:X}=T.useRef(L!=null),[ie,ae]=T.useState(),fe=cr(t,b),xe=T.useCallback(pt=>{W.current=pt,pt&&ne(pt)},[]),ge=re?.parentNode;T.useImperativeHandle(fe,()=>({focus:()=>{W.current.focus()},node:J.current,value:Y}),[Y]),T.useEffect(()=>{c&&_&&re&&!X&&(ae(a?null:ge.clientWidth),W.current.focus())},[re,a]),T.useEffect(()=>{o&&W.current.focus()},[o]),T.useEffect(()=>{if(!x)return;const pt=Po(W.current).getElementById(x);if(pt){const Te=()=>{getSelection().isCollapsed&&W.current.focus()};return pt.addEventListener("click",Te),()=>{pt.removeEventListener("click",Te)}}},[x]);const Re=(pt,Te)=>{pt?I&&I(Te):M&&M(Te),X||(ae(a?null:ge.clientWidth),Z(pt))},de=pt=>{pt.button===0&&(pt.preventDefault(),W.current.focus(),Re(!0,pt))},me=pt=>{Re(!1,pt)},Qe=T.Children.toArray(i),Me=pt=>{const Te=Qe.find(Ue=>Ue.props.value===pt.target.value);Te!==void 0&&(te(Te.props.value),R&&R(pt,Te))},we=pt=>Te=>{let Ue;if(Te.currentTarget.hasAttribute("tabindex")){if(S){Ue=Array.isArray(Y)?Y.slice():[];const yt=Y.indexOf(pt.props.value);yt===-1?Ue.push(pt.props.value):Ue.splice(yt,1)}else Ue=pt.props.value;if(pt.props.onClick&&pt.props.onClick(Te),Y!==Ue&&(te(Ue),R)){const yt=Te.nativeEvent||Te,ht=new yt.constructor(yt.type,yt);Object.defineProperty(ht,"target",{writable:!0,value:{value:Ue,name:w}}),R(ht,pt)}S||Re(!1,Te)}},Se=pt=>{F||[" ","ArrowUp","ArrowDown","Enter"].includes(pt.key)&&(pt.preventDefault(),Re(!0,pt))},dt=re!==null&&_,ze=pt=>{!dt&&C&&(Object.defineProperty(pt,"target",{writable:!0,value:{value:Y,name:w}}),C(pt))};delete K["aria-invalid"];let tt,Ze;const qt=[];let Vt=!1;(ax({value:Y})||p)&&(B?tt=B(Y):Vt=!0);const Mt=Qe.map(pt=>{if(!T.isValidElement(pt))return null;let Te;if(S){if(!Array.isArray(Y))throw new Error(uc(2));Te=Y.some(Ue=>TL(Ue,pt.props.value)),Te&&Vt&&qt.push(pt.props.children)}else Te=TL(Y,pt.props.value),Te&&Vt&&(Ze=pt.props.children);return T.cloneElement(pt,{"aria-selected":Te?"true":"false",onClick:we(pt),onKeyUp:Ue=>{Ue.key===" "&&Ue.preventDefault(),pt.props.onKeyUp&&pt.props.onKeyUp(Ue)},role:"option",selected:Te,value:void 0,"data-value":pt.props.value})});Vt&&(S?qt.length===0?tt=null:tt=qt.reduce((pt,Te,Ue)=>(pt.push(Te),Ue<qt.length-1&&pt.push(", "),pt),[]):tt=Ze);let ke=ie;!a&&X&&re&&(ke=ge.clientWidth);let Ne;typeof $<"u"?Ne=$:Ne=f?null:0;const lt=k.id||(w?`mui-component-select-${w}`:void 0),St={...e,variant:z,value:Y,open:dt,error:y},ft=HTe(St),$e={...E.PaperProps,...typeof E.slotProps?.paper=="function"?E.slotProps.paper(St):E.slotProps?.paper},Ht={...E.MenuListProps,...typeof E.slotProps?.list=="function"?E.slotProps.list(St):E.slotProps?.list},$t=Bs();return m.jsxs(T.Fragment,{children:[m.jsx(jTe,{as:"div",ref:xe,tabIndex:Ne,role:"combobox","aria-controls":dt?$t:void 0,"aria-disabled":f?"true":void 0,"aria-expanded":dt?"true":"false","aria-haspopup":"listbox","aria-label":r,"aria-labelledby":[x,lt].filter(Boolean).join(" ")||void 0,"aria-describedby":n,"aria-required":U?"true":void 0,"aria-invalid":y?"true":void 0,onKeyDown:Se,onMouseDown:f||F?null:de,onBlur:ze,onFocus:D,...k,ownerState:St,className:Ot(k.className,ft.select,s),id:lt,children:zTe(tt)?CL||(CL=m.jsx("span",{className:"notranslate","aria-hidden":!0,children:"​"})):tt}),m.jsx($Te,{"aria-invalid":y,value:Array.isArray(Y)?Y.join(","):Y,name:w,ref:J,"aria-hidden":!0,onChange:Me,tabIndex:-1,disabled:f,className:ft.nativeInput,autoFocus:o,required:U,...K,ownerState:St}),m.jsx(BTe,{as:g,className:ft.icon,ownerState:St}),m.jsx(NTe,{id:`menu-${w||""}`,anchorEl:ge,open:dt,onClose:me,anchorOrigin:{vertical:"bottom",horizontal:"center"},transformOrigin:{vertical:"top",horizontal:"center"},...E,slotProps:{...E.slotProps,list:{"aria-labelledby":x,role:"listbox","aria-multiselectable":S?"true":void 0,disableListWrap:!0,id:$t,...Ht},paper:{...$e,style:{minWidth:ke,...$e!=null?$e.style:null}}},children:Mt})]})}),k$=Fn(m.jsx("path",{d:"M7 10l5 5 5-5z"})),VTe=e=>{const{classes:t}=e,n=zt({root:["root"]},w$,t);return{...t,...n}},GD={name:"MuiSelect",slot:"Root",shouldForwardProp:e=>wa(e)&&e!=="variant"},WTe=Pe(UD,GD)(""),qTe=Pe(WD,GD)(""),GTe=Pe(VD,GD)(""),lx=T.forwardRef(function(e,t){const n=An({name:"MuiSelect",props:e}),{autoWidth:r=!1,children:o,classes:a={},className:i,defaultOpen:s=!1,displayEmpty:c=!1,IconComponent:u=k$,id:f,input:p,inputProps:y,label:g,labelId:b,MenuProps:x,multiple:E=!1,native:S=!1,onClose:w,onOpen:C,open:R,renderValue:M,SelectDisplayProps:D,variant:I="outlined",...L}=n,F=S?FTe:UTe,B=Oi(),U=of({props:n,muiFormControl:B,states:["variant","error"]}),k=U.variant||I,$={...n,variant:k,classes:a},j=VTe($),{root:V,...z}=j,K=p||{standard:m.jsx(WTe,{ownerState:$}),outlined:m.jsx(qTe,{label:g,ownerState:$}),filled:m.jsx(GTe,{ownerState:$})}[k],Y=cr(t,wh(K));return m.jsx(T.Fragment,{children:T.cloneElement(K,{inputComponent:F,inputProps:{children:o,error:U.error,IconComponent:u,variant:k,type:void 0,multiple:E,...S?{id:f}:{autoWidth:r,defaultOpen:s,displayEmpty:c,labelId:b,MenuProps:x,onClose:w,onOpen:C,open:R,renderValue:M,SelectDisplayProps:{id:f,...D}},...y,classes:y?sa(z,y.classes):z,...p?p.props.inputProps:{}},...(E&&S||c)&&k==="outlined"?{notched:!0}:{},ref:Y,className:Ot(K.props.className,i,j.root),...!p&&{variant:k},...L})})});lx.muiName="Select";function YTe(e){return Ut("MuiTextField",e)}Lt("MuiTextField",["root"]);const KTe={standard:UD,filled:VD,outlined:WD},QTe=e=>{const{classes:t}=e;return zt({root:["root"]},YTe,t)},XTe=Pe(ix,{name:"MuiTextField",slot:"Root"})({}),Wn=T.forwardRef(function(e,t){const n=An({props:e,name:"MuiTextField"}),{autoComplete:r,autoFocus:o=!1,children:a,className:i,color:s="primary",defaultValue:c,disabled:u=!1,error:f=!1,FormHelperTextProps:p,fullWidth:y=!1,helperText:g,id:b,InputLabelProps:x,inputProps:E,InputProps:S,inputRef:w,label:C,maxRows:R,minRows:M,multiline:D=!1,name:I,onBlur:L,onChange:F,onFocus:B,placeholder:U,required:k=!1,rows:$,select:j=!1,SelectProps:V,slots:z={},slotProps:K={},type:Y,value:te,variant:_="outlined",...Z}=n,J={...n,autoFocus:o,color:s,disabled:u,error:f,fullWidth:y,multiline:D,required:k,select:j,variant:_},W=QTe(J),re=Bs(b),ne=g&&re?`${re}-helper-text`:void 0,X=C&&re?`${re}-label`:void 0,ie=KTe[_],ae={slots:z,slotProps:{input:S,inputLabel:x,htmlInput:E,formHelperText:p,select:V,...K}},fe={},xe=ae.slotProps.inputLabel;_==="outlined"&&(xe&&typeof xe.shrink<"u"&&(fe.notched=xe.shrink),fe.label=C),j&&((!V||!V.native)&&(fe.id=void 0),fe["aria-describedby"]=void 0);const[ge,Re]=tr("root",{elementType:XTe,shouldForwardComponentProp:!0,externalForwardedProps:{...ae,...Z},ownerState:J,className:Ot(W.root,i),ref:t,additionalProps:{disabled:u,error:f,fullWidth:y,required:k,color:s,variant:_}}),[de,me]=tr("input",{elementType:ie,externalForwardedProps:ae,additionalProps:fe,ownerState:J}),[Qe,Me]=tr("inputLabel",{elementType:sx,externalForwardedProps:ae,ownerState:J}),[we,Se]=tr("htmlInput",{elementType:"input",externalForwardedProps:ae,ownerState:J}),[dt,ze]=tr("formHelperText",{elementType:v$,externalForwardedProps:ae,ownerState:J}),[tt,Ze]=tr("select",{elementType:lx,externalForwardedProps:ae,ownerState:J}),qt=m.jsx(de,{"aria-describedby":ne,autoComplete:r,autoFocus:o,defaultValue:c,fullWidth:y,multiline:D,name:I,rows:$,maxRows:R,minRows:M,type:Y,value:te,id:re,inputRef:w,onBlur:L,onChange:F,onFocus:B,placeholder:U,inputProps:Se,slots:{input:z.htmlInput?we:void 0},...me});return m.jsxs(ge,{...Re,children:[C!=null&&C!==""&&m.jsx(Qe,{htmlFor:re,id:X,...Me,children:C}),j?m.jsx(tt,{"aria-describedby":ne,id:re,labelId:X,value:te,input:qt,...Ze,children:a}):qt,g&&m.jsx(dt,{id:ne,...ze,children:g})]})}),oc={postgres:[{label:"Host",name:"host",type:"text",required:!1},{label:"Port",name:"port",type:"number",required:!1},{label:"Database Name",name:"databaseName",type:"text",required:!1},{label:"User Name",name:"userName",type:"text",required:!1},{label:"Password",name:"password",type:"password",required:!1},{label:"Connection String",name:"connectionString",type:"text",required:!1}],bigquery:[{label:"Project ID",name:"defaultProjectId",type:"text",required:!1},{label:"Billing Project ID",name:"billingProjectId",type:"text",required:!1},{label:"Location",name:"location",type:"text",required:!1},{label:"Service Account Key JSON",name:"serviceAccountKeyJson",type:"text",required:!0},{label:"Maximum Bytes Billed",name:"maximumBytesBilled",type:"text",required:!1},{label:"Query Timeout Milliseconds",name:"queryTimeoutMilliseconds",type:"text",required:!1}],snowflake:[{label:"Account",name:"account",type:"text",required:!0},{label:"Username",name:"username",type:"text",required:!0},{label:"Password",name:"password",type:"password",required:!1},{label:"Role",name:"role",type:"text",required:!1},{label:"Warehouse",name:"warehouse",type:"text",required:!0},{label:"Database",name:"database",type:"text",required:!1},{label:"Schema",name:"schema",type:"text",required:!1},{label:"Response Timeout Milliseconds",name:"responseTimeoutMilliseconds",type:"text",required:!1},{label:"Private Key",name:"privateKey",type:"password",required:!1},{label:"Private Key Passphrase",name:"privateKeyPass",type:"password",required:!1}],trino:[{label:"Server",name:"server",type:"text",required:!0},{label:"Port",name:"port",type:"number",required:!1},{label:"Catalog",name:"catalog",type:"text",required:!1},{label:"Schema",name:"schema",type:"text",required:!1},{label:"User",name:"user",type:"text",required:!0},{label:"Password",name:"password",type:"password",required:!1},{label:"Peaka Key",name:"peakaKey",type:"password",required:!1}],databricks:[{label:"Host",name:"host",type:"text",required:!0},{label:"HTTP Path",name:"path",type:"text",required:!0},{label:"Access Token",name:"token",type:"password",required:!1},{label:"OAuth Client ID",name:"oauthClientId",type:"text",required:!1},{label:"OAuth Client Secret",name:"oauthClientSecret",type:"password",required:!1},{label:"Default Catalog",name:"defaultCatalog",type:"text",required:!1},{label:"Default Schema",name:"defaultSchema",type:"text",required:!1}],mysql:[{label:"Host",name:"host",type:"text",required:!0},{label:"Port",name:"port",type:"number",required:!0},{label:"User",name:"user",type:"text",required:!0},{label:"Password",name:"password",type:"password",required:!0},{label:"Database",name:"database",type:"text",required:!0}],duckdb:[],motherduck:[{label:"Access Token",name:"accessToken",type:"text",required:!0},{label:"Database",name:"database",type:"text",required:!1}],ducklake:[],publisher:[]},m1={postgres:"postgresConnection",bigquery:"bigqueryConnection",snowflake:"snowflakeConnection",trino:"trinoConnection",databricks:"databricksConnection",mysql:"mysqlConnection",duckdb:"duckdbConnection",motherduck:"motherduckConnection",ducklake:"ducklakeConnection",publisher:"publisherConnection"},A$=Object.values(FI).filter(e=>e!==FI.Publisher),t2={postgres:"postgresConnection",bigquery:"bigqueryConnection",snowflake:"snowflakeConnection",gcs:"gcsConnection",s3:"s3Connection",azure:"azureConnection"},Wy=[{label:"Access Key ID",name:"accessKeyId",type:"text",required:!0},{label:"Secret Access Key",name:"secretAccessKey",type:"password",required:!0},{label:"Region",name:"region",type:"text",required:!1},{label:"Endpoint",name:"endpoint",type:"text",required:!1},{label:"Session Token",name:"sessionToken",type:"password",required:!1}],qy=[{label:"Key ID",name:"keyId",type:"text",required:!0},{label:"Secret",name:"secret",type:"password",required:!0}],ZTe=[{label:"Auth Type",name:"authType",type:"text",required:!0,selectOptions:[{label:"SAS Token",value:"sas_token"},{label:"Service Principal (SPN)",value:"service_principal"}]},{label:"SAS URL (e.g. https://account.blob.core.windows.net/container/file.parquet?sp=r&st=...)",name:"sasUrl",type:"text",required:!1,visibleWhen:{field:"authType",value:"sas_token"}},{label:"Tenant ID",name:"tenantId",type:"text",required:!1,visibleWhen:{field:"authType",value:"service_principal"}},{label:"Client ID",name:"clientId",type:"text",required:!1,visibleWhen:{field:"authType",value:"service_principal"}},{label:"Client Secret",name:"clientSecret",type:"password",required:!1,visibleWhen:{field:"authType",value:"service_principal"}},{label:"Account Name",name:"accountName",type:"text",required:!1,visibleWhen:{field:"authType",value:"service_principal"}},{label:"File URL (e.g. abfss://container/path/file.parquet)",name:"fileUrl",type:"text",required:!1,visibleWhen:{field:"authType",value:"service_principal"}}];function cx(e){return e==="postgres"||e==="bigquery"||e==="snowflake"?oc[e]||[]:e==="s3"?Wy:e==="gcs"?qy:e==="azure"?ZTe:[]}function JTe({onSubmit:e,isSubmitting:t}){const[n,r]=T.useState(!1),[o,a]=T.useState("postgres"),[i,s]=T.useState([]),[c,u]=T.useState("postgres"),[f,p]=T.useState("s3"),y=()=>{r(!0)},g=()=>{r(!1),s([]),a("postgres"),u("postgres"),p("s3")},b=async w=>{w.preventDefault();const C=new FormData(w.currentTarget),R=C.get("name")?.toString(),M=C.get("type")?.toString(),D=oc[M];if(!R)throw new Error("Name is required");if(!M)throw new Error("Type is required");let I;if(M==="ducklake"){const L={};if(c==="postgres"){const U=oc.postgres,k={};if(U.forEach($=>{const j=C.get(`ducklake_pg_${$.name}`)?.toString();j&&(k[$.name]=j)}),Object.keys(k).length===0)throw new Error("DuckLake requires catalog connection");L.postgresConnection=k}const F=C.get("ducklake_bucketUrl")?.toString();if(!F)throw new Error("DuckLake requires a bucket URL");const B={bucketUrl:F};if(f==="s3"){const U={};if(Wy.forEach(k=>{const $=C.get(`ducklake_s3_${k.name}`)?.toString();$&&(U[k.name]=$)}),!U.accessKeyId)throw new Error("S3 Access Key ID is required");if(!U.secretAccessKey)throw new Error("S3 Secret Access Key is required");Object.keys(U).length>0&&(B.s3Connection=U)}else if(f==="gcs"){const U={};if(qy.forEach(k=>{const $=C.get(`ducklake_gcs_${k.name}`)?.toString();$&&(U[k.name]=$)}),!U.keyId)throw new Error("GCS Key ID is required");if(!U.secret)throw new Error("GCS Secret is required");Object.keys(U).length>0&&(B.gcsConnection=U)}I={name:R,type:M,ducklakeConnection:{catalog:L,storage:B}}}else if(M==="duckdb"){if(i.length===0)throw new Error("DuckDB connection must have at least one attached database");const L=i.map((F,B)=>{const U=F.dbType,k=C.get(`attachedDb_${B}_name`)?.toString();if(!k)throw new Error(`Attached database at index ${B} must have a name`);const $={name:k,type:U},j=cx(U);if(j&&j.length>0){const V={};j.forEach(K=>{const Y=C.get(`attachedDb_${B}_${K.name}`)?.toString();Y&&(V[K.name]=Y)});const z=t2[U];z&&($[z]=V)}return $});I={name:R,type:M,duckdbConnection:{attachedDatabases:L}}}else{const L={};if(D.forEach(F=>{const B=C.get(F.name)?.toString();B&&(L[F.name]=B)}),M==="postgres"){if(!L.connectionString?.trim()){const F=["host","port","databaseName","userName","password"];for(const B of F)if(!L[B])throw new Error(`${D.find(U=>U.name===B)?.label||B} is required`)}}else if(M==="bigquery"){if(!L.serviceAccountKeyJson)throw new Error("Service Account Key JSON is required")}else if(M==="snowflake"){if(!L.account)throw new Error("Account is required");if(!L.username)throw new Error("Username is required");if(!L.warehouse)throw new Error("Warehouse is required");if(!L.password&&!L.privateKey)throw new Error("Either password or private key is required")}else if(M==="trino"){if(!L.server)throw new Error("Server is required");if(!L.user)throw new Error("User is required");if(L.server.trim().startsWith("https://")&&!L.password&&!L.peakaKey)throw new Error("Password is required for HTTPS connections (or use Peaka Key)")}else if(M==="mysql"){const F=["host","port","database","user","password"];for(const B of F)if(!L[B])throw new Error(`${D.find(U=>U.name===B)?.label||B} is required`)}else if(M==="motherduck"){if(!L.accessToken)throw new Error("Access Token is required")}else if(M==="databricks"){if(!L.host)throw new Error("Host is required");if(!L.path)throw new Error("HTTP Path is required");const F=L.oauthClientId&&L.oauthClientSecret;if(!L.token&&!F)throw new Error("Either Access Token or OAuth Client ID + Secret is required")}I={name:R,type:M,[m1[M]]:L}}await e(I),g()},x=()=>{s([...i,{name:"",dbType:"postgres"}])},E=w=>{s(i.filter((C,R)=>R!==w))},S=(w,C)=>{const R=[...i];R[w]={...R[w],dbType:C},s(R)};return m.jsxs(vt.Fragment,{children:[m.jsx(Zr,{variant:"outlined",onClick:y,children:"Add Connection"}),m.jsxs(Dl,{open:n,onClose:g,children:[m.jsx(gc,{children:"Create New Connection"}),m.jsxs(Rl,{children:[m.jsx(Rb,{children:"Add a new connection to query your data database using Malloy."}),m.jsxs("form",{onSubmit:b,id:"connection-form",children:[m.jsx(Wn,{autoFocus:!0,required:!0,margin:"dense",id:"name",name:"name",label:"Connection Name",type:"text",fullWidth:!0,variant:"standard"}),m.jsx(Wn,{margin:"dense",id:"type",name:"type",label:"Connection Type",fullWidth:!0,variant:"standard",value:o,select:!0,onChange:w=>a(w.target.value),children:A$.map(w=>m.jsx(Mo,{value:w,children:w},w))}),o==="ducklake"?m.jsxs(Ur,{sx:{mt:2},children:[m.jsxs(Ur,{sx:{mb:3,p:2,border:"1px solid",borderColor:"divider",borderRadius:1},children:[m.jsx(lr,{variant:"subtitle2",sx:{mb:2},fontWeight:500,children:"Catalog"}),m.jsx(Wn,{margin:"dense",id:"ducklake_catalogType",label:"Catalog Type",fullWidth:!0,variant:"standard",value:c,select:!0,onChange:w=>u(w.target.value),children:m.jsx(Mo,{value:"postgres",children:"PostgreSQL"})}),c==="postgres"&&m.jsx(m.Fragment,{children:oc.postgres.map(w=>m.jsx(Wn,{margin:"dense",id:`ducklake_pg_${w.name}`,name:`ducklake_pg_${w.name}`,label:w.label,type:w.type,fullWidth:!0,variant:"standard"},`pg_${w.name}`))})]}),m.jsxs(Ur,{sx:{mb:3,p:2,border:"1px solid",borderColor:"divider",borderRadius:1},children:[m.jsx(lr,{variant:"subtitle2",sx:{mb:2},fontWeight:500,children:"Storage"}),m.jsxs(Wn,{margin:"dense",id:"ducklake_storageType",label:"Storage Type",fullWidth:!0,variant:"standard",value:f,select:!0,onChange:w=>p(w.target.value),children:[m.jsx(Mo,{value:"s3",children:"S3"}),m.jsx(Mo,{value:"gcs",children:"GCS"})]}),m.jsx(Wn,{margin:"dense",required:!0,id:"ducklake_bucketUrl",name:"ducklake_bucketUrl",label:f==="s3"?"Bucket URL (e.g. s3://my-bucket/path)":"Bucket URL (e.g. gs://my-bucket/path)",type:"text",fullWidth:!0,variant:"standard"}),f==="s3"&&m.jsxs(m.Fragment,{children:[m.jsx(lr,{variant:"caption",sx:{mt:2,mb:1,display:"block"},color:"text.secondary",children:"S3 Credentials"}),Wy.map(w=>m.jsx(Wn,{margin:"dense",id:`ducklake_s3_${w.name}`,name:`ducklake_s3_${w.name}`,label:w.label,type:w.type,fullWidth:!0,variant:"standard",required:w.required,placeholder:w.name==="region"?"us-east-1":void 0},`s3_${w.name}`))]}),f==="gcs"&&m.jsxs(m.Fragment,{children:[m.jsx(lr,{variant:"caption",sx:{mt:2,mb:1,display:"block"},color:"text.secondary",children:"GCS Credentials"}),qy.map(w=>m.jsx(Wn,{margin:"dense",id:`ducklake_gcs_${w.name}`,name:`ducklake_gcs_${w.name}`,label:w.label,type:w.type,fullWidth:!0,variant:"standard",required:w.required},`gcs_${w.name}`))]})]})]}):o==="duckdb"?m.jsxs(Ur,{sx:{mt:2},children:[m.jsxs(Ur,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",mb:2},children:[m.jsx(lr,{variant:"subtitle1",fontWeight:500,children:"Attached Databases"}),m.jsx(Zr,{startIcon:m.jsx(Sb,{}),onClick:x,size:"small",variant:"outlined",children:"Add Database"})]}),i.length===0&&m.jsx(lr,{variant:"body2",color:"text.secondary",sx:{mb:2},children:'DuckDB connections require at least one attached database. Click "Add Database" to get started.'}),i.map((w,C)=>{const R=cx(w.dbType);return m.jsxs(Ur,{sx:{mb:3,p:2,border:"1px solid",borderColor:"divider",borderRadius:1},children:[m.jsxs(Ur,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",mb:2},children:[m.jsxs(lr,{variant:"subtitle2",children:["Database ",C+1]}),m.jsx(gs,{onClick:()=>E(C),size:"small",color:"error",children:m.jsx(y$,{fontSize:"small"})})]}),m.jsx(Wn,{margin:"dense",required:!0,id:`attachedDb_${C}_name`,name:`attachedDb_${C}_name`,label:"Database Name",type:"text",fullWidth:!0,variant:"standard",defaultValue:w.name}),m.jsx(Wn,{margin:"dense",id:`attachedDb_${C}_type`,name:`attachedDb_${C}_type`,label:"Database Type",fullWidth:!0,variant:"standard",value:w.dbType,select:!0,onChange:M=>S(C,M.target.value),children:Object.values(nj).map(M=>m.jsx(Mo,{value:M,children:M},M))}),R.filter(M=>M.visibleWhen?(w[M.visibleWhen.field]||R.find(D=>D.name===M.visibleWhen?.field)?.selectOptions?.[0]?.value)===M.visibleWhen.value:!0).map(M=>m.jsx(Wn,{margin:"dense",id:`attachedDb_${C}_${M.name}`,name:`attachedDb_${C}_${M.name}`,label:M.label,type:M.selectOptions?void 0:M.type,fullWidth:!0,variant:"standard",required:M.required,select:!!M.selectOptions,defaultValue:M.selectOptions?.[0]?.value,onChange:M.selectOptions?D=>{const I=[...i];I[C]={...I[C],[M.name]:D.target.value},s(I)}:void 0,children:M.selectOptions?.map(D=>m.jsx(Mo,{value:D.value,children:D.label},D.value))},M.name))]},C)})]}):oc[o].map(w=>m.jsx(Wn,{margin:"dense",id:w.name,name:w.name,label:w.label,type:w.type,fullWidth:!0,variant:"standard",required:w.required},w.name))]})]}),m.jsxs(Ol,{children:[m.jsx(Zr,{disabled:t,onClick:g,children:"Cancel"}),m.jsx(Zr,{type:"submit",form:"connection-form",loading:t,children:"Create Connection"})]})]})]})}function ewe({connection:e,onCloseDialog:t,isMutating:n,onDelete:r}){const[o,a]=T.useState(!1),[i,s]=T.useState(""),c=()=>{a(!0)},u=()=>{a(!1),t()};return m.jsxs(vt.Fragment,{children:[m.jsxs(Mo,{"aria-label":`Delete connection ${e?.name??""}`.trim(),onClick:f=>{f.stopPropagation(),c()},sx:{color:"error.main"},children:[m.jsx(jD,{sx:{color:"inherit"},children:m.jsx(Jx,{fontSize:"small"})}),m.jsx(BD,{children:"Delete"})]}),m.jsxs(Dl,{onClose:u,"aria-labelledby":"customized-dialog-title",open:o,children:[m.jsx(gc,{sx:{m:0,p:2},id:"customized-dialog-title",children:"Delete Connection"}),m.jsx(gs,{"aria-label":"close",onClick:u,sx:f=>({position:"absolute",right:8,top:8,color:f.palette.grey[500]}),children:m.jsx(Ns,{})}),m.jsx(Rl,{dividers:!0,children:m.jsxs(lr,{gutterBottom:!0,children:['Are you sure you want to delete "',e.name,'"? This action cannot be undone.']})}),m.jsx(Ol,{children:m.jsx(Zr,{loading:n,variant:"contained",autoFocus:!0,onClick:()=>r(),color:"error",children:"Delete"})}),m.jsx(_s,{open:i!=="",autoHideDuration:6e3,onClose:()=>s(""),message:i})]})]})}function wL(e){const t=e.duckdbConnection?.attachedDatabases;return!t||t.length===0?[]:t.map(n=>({name:n.name||"",dbType:n.type||"postgres"}))}function kL(e){const t=e.ducklakeConnection;return t&&t.storage?.gcsConnection?"gcs":"s3"}function twe({connection:e,onSubmit:t,isSubmitting:n,onCloseDialog:r}){const[o,a]=T.useState(!1),[i,s]=T.useState(e.type),[c,u]=T.useState(()=>wL(e)),[f,p]=T.useState("postgres"),[y,g]=T.useState(()=>kL(e)),b=()=>{u(wL(e)),s(e.type),p("postgres"),g(kL(e)),a(!0)},x=()=>{a(!1),r?.()},E=async D=>{D.preventDefault();const I=new FormData(D.currentTarget),L=I.get("name")?.toString(),F=I.get("type")?.toString(),B=oc[F];if(!L)throw new Error("Name is required");if(!F)throw new Error("Type is required");let U;if(F==="ducklake"){const k={};if(f==="postgres"){const V=oc.postgres,z={};if(V.forEach(K=>{const Y=I.get(`ducklake_pg_${K.name}`)?.toString();Y&&(z[K.name]=Y)}),Object.keys(z).length===0)throw new Error("DuckLake requires catalog connection");k.postgresConnection=z}const $=I.get("ducklake_bucketUrl")?.toString();if(!$)throw new Error("DuckLake requires a bucket URL");const j={bucketUrl:$};if(y==="s3"){const V={};Wy.forEach(K=>{const Y=I.get(`ducklake_s3_${K.name}`)?.toString();Y&&(V[K.name]=Y)});const z=e.ducklakeConnection?.storage?.s3Connection;if(z&&(!V.accessKeyId&&z.accessKeyId&&(V.accessKeyId=z.accessKeyId),!V.secretAccessKey&&z.secretAccessKey&&(V.secretAccessKey=z.secretAccessKey)),!V.accessKeyId)throw new Error("S3 Access Key ID is required");if(!V.secretAccessKey)throw new Error("S3 Secret Access Key is required");Object.keys(V).length>0&&(j.s3Connection=V)}else if(y==="gcs"){const V={};qy.forEach(K=>{const Y=I.get(`ducklake_gcs_${K.name}`)?.toString();Y&&(V[K.name]=Y)});const z=e.ducklakeConnection?.storage?.gcsConnection;if(z&&(!V.keyId&&z.keyId&&(V.keyId=z.keyId),!V.secret&&z.secret&&(V.secret=z.secret)),!V.keyId)throw new Error("GCS Key ID is required");if(!V.secret)throw new Error("GCS Secret is required");Object.keys(V).length>0&&(j.gcsConnection=V)}U={name:L,type:F,ducklakeConnection:{catalog:k,storage:j}}}else if(F==="duckdb"){if(c.length===0)throw new Error("DuckDB connection must have at least one attached database");const k=c.map(($,j)=>{const V=$.dbType,z=I.get(`attachedDb_${j}_name`)?.toString();if(!z)throw new Error(`Attached database at index ${j} must have a name`);const K={name:z,type:V},Y=cx(V);if(Y&&Y.length>0){const te={};Y.forEach(Z=>{const J=I.get(`attachedDb_${j}_${Z.name}`)?.toString();J&&(te[Z.name]=J)});const _=t2[V];_&&(K[_]=te)}return K});U={name:L,type:F,duckdbConnection:{attachedDatabases:k}}}else{const k=e[m1[F]]||{},$={};if(B.forEach(j=>{const V=I.get(j.name)?.toString(),z=k[j.name],K=j.type==="password"||j.name==="password"||j.name==="secretAccessKey"||j.name==="secret"||j.name==="accessToken"||j.name==="privateKey";V?$[j.name]=V:K&&z?$[j.name]=z:V!==void 0?$[j.name]=V:z&&($[j.name]=z)}),F==="postgres"){if(!$.connectionString?.trim()){const j=["host","port","databaseName","userName","password"];for(const V of j)if(!$[V])throw new Error(`${B.find(z=>z.name===V)?.label||V} is required`)}}else if(F==="bigquery"){if(!$.serviceAccountKeyJson)throw new Error("Service Account Key JSON is required")}else if(F==="snowflake"){if(!$.account)throw new Error("Account is required");if(!$.username)throw new Error("Username is required");if(!$.warehouse)throw new Error("Warehouse is required");if(!$.password&&!$.privateKey)throw new Error("Either password or private key is required")}else if(F==="trino"){if(!$.server)throw new Error("Server is required");if(!$.user)throw new Error("User is required");if($.server.trim().startsWith("https://")&&!$.password&&!$.peakaKey)throw new Error("Password is required for HTTPS connections (or use Peaka Key)")}else if(F==="mysql"){const j=["host","port","database","user","password"];for(const V of j)if(!$[V])throw new Error(`${B.find(z=>z.name===V)?.label||V} is required`)}else if(F==="motherduck"){if(!$.accessToken)throw new Error("Access Token is required")}else if(F==="databricks"){if(!$.host)throw new Error("Host is required");if(!$.path)throw new Error("HTTP Path is required");const j=$.oauthClientId&&$.oauthClientSecret;if(!$.token&&!j)throw new Error("Either Access Token or OAuth Client ID + Secret is required")}U={name:L,type:F,[m1[F]]:$}}await t(U),x()},S=()=>{u([...c,{name:"",dbType:"postgres"}])},w=D=>{u(c.filter((I,L)=>L!==D))},C=(D,I)=>{const L=[...c];L[D]={...L[D],dbType:I},u(L)},R=(D,I)=>{const L=e.duckdbConnection?.attachedDatabases;if(!L||!L[D])return"";const F=L[D],B=t2[F.type||""];return B&&F[B]?F[B][I]??"":""},M=D=>{const I=e.ducklakeConnection;if(!I)return"";if(D.startsWith("pg_")){const L=D.replace("pg_","");return I.catalog?.postgresConnection?.[L]??""}if(D==="bucketUrl")return I.storage?.bucketUrl??"";if(D.startsWith("s3_")){const L=D.replace("s3_","");return I.storage?.s3Connection?.[L]??""}if(D.startsWith("gcs_")){const L=D.replace("gcs_","");return I.storage?.gcsConnection?.[L]??""}return""};return m.jsxs(vt.Fragment,{children:[m.jsxs(Mo,{"aria-label":`Edit connection ${e?.name??""}`.trim(),onClick:D=>{D.preventDefault(),D.stopPropagation(),b()},children:[m.jsx(jD,{children:m.jsx(RA,{fontSize:"small"})}),m.jsx(BD,{children:"Edit"})]}),m.jsxs(Dl,{open:o,onClose:x,children:[m.jsx(gc,{onClick:D=>{D.stopPropagation()},children:"Edit Connection"}),m.jsxs(Rl,{onClick:D=>{D.stopPropagation()},children:[m.jsx(Rb,{children:"Edit a connection to query your data database using Malloy."}),m.jsxs("form",{onSubmit:E,id:"connection-form",children:[m.jsx(Wn,{autoFocus:!0,required:!0,margin:"dense",id:"name",name:"name",label:"Connection Name",type:"text",fullWidth:!0,variant:"standard",defaultValue:e.name}),m.jsx(Wn,{margin:"dense",id:"type",name:"type",label:"Connection Type",fullWidth:!0,variant:"standard",value:i,select:!0,onChange:D=>s(D.target.value),children:A$.map(D=>m.jsx(Mo,{value:D,children:D},D))}),i==="ducklake"?m.jsxs(Ur,{sx:{mt:2},children:[m.jsxs(Ur,{sx:{mb:3,p:2,border:"1px solid",borderColor:"divider",borderRadius:1},children:[m.jsx(lr,{variant:"subtitle2",sx:{mb:2},fontWeight:500,children:"Catalog"}),m.jsx(Wn,{margin:"dense",id:"ducklake_catalogType",label:"Catalog Type",fullWidth:!0,variant:"standard",value:f,select:!0,onChange:D=>p(D.target.value),children:m.jsx(Mo,{value:"postgres",children:"PostgreSQL"})}),f==="postgres"&&m.jsx(m.Fragment,{children:oc.postgres.map(D=>m.jsx(Wn,{margin:"dense",id:`ducklake_pg_${D.name}`,name:`ducklake_pg_${D.name}`,label:D.label,type:D.type,fullWidth:!0,variant:"standard",defaultValue:M(`pg_${D.name}`)},`pg_${D.name}`))})]}),m.jsxs(Ur,{sx:{mb:3,p:2,border:"1px solid",borderColor:"divider",borderRadius:1},children:[m.jsx(lr,{variant:"subtitle2",sx:{mb:2},fontWeight:500,children:"Storage"}),m.jsxs(Wn,{margin:"dense",id:"ducklake_storageType",label:"Storage Type",fullWidth:!0,variant:"standard",value:y,select:!0,onChange:D=>g(D.target.value),children:[m.jsx(Mo,{value:"s3",children:"S3"}),m.jsx(Mo,{value:"gcs",children:"GCS"})]}),m.jsx(Wn,{margin:"dense",required:!0,id:"ducklake_bucketUrl",name:"ducklake_bucketUrl",label:y==="s3"?"Bucket URL (e.g. s3://my-bucket/path)":"Bucket URL (e.g. gs://my-bucket/path)",type:"text",fullWidth:!0,variant:"standard",defaultValue:M("bucketUrl")}),y==="s3"&&m.jsxs(m.Fragment,{children:[m.jsx(lr,{variant:"caption",sx:{mt:2,mb:1,display:"block"},color:"text.secondary",children:"S3 Credentials"}),Wy.map(D=>m.jsx(Wn,{margin:"dense",id:`ducklake_s3_${D.name}`,name:`ducklake_s3_${D.name}`,label:D.label,type:D.type,fullWidth:!0,variant:"standard",required:D.required&&D.name!=="secretAccessKey",defaultValue:M(`s3_${D.name}`),placeholder:D.name==="region"?"us-east-1":D.name==="secretAccessKey"?"Leave empty to keep existing":void 0},`s3_${D.name}`))]}),y==="gcs"&&m.jsxs(m.Fragment,{children:[m.jsx(lr,{variant:"caption",sx:{mt:2,mb:1,display:"block"},color:"text.secondary",children:"GCS Credentials"}),qy.map(D=>m.jsx(Wn,{margin:"dense",id:`ducklake_gcs_${D.name}`,name:`ducklake_gcs_${D.name}`,label:D.label,type:D.type,fullWidth:!0,variant:"standard",required:D.required&&D.name!=="secret",defaultValue:M(`gcs_${D.name}`),placeholder:D.name==="secret"?"Leave empty to keep existing":void 0},`gcs_${D.name}`))]})]})]}):i==="duckdb"?m.jsxs(Ur,{sx:{mt:2},children:[m.jsxs(Ur,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",mb:2},children:[m.jsx(lr,{variant:"subtitle1",fontWeight:500,children:"Attached Databases"}),m.jsx(Zr,{startIcon:m.jsx(Sb,{}),onClick:S,size:"small",variant:"outlined",children:"Add Database"})]}),c.length===0&&m.jsx(lr,{variant:"body2",color:"text.secondary",sx:{mb:2},children:'DuckDB connections require at least one attached database. Click "Add Database" to get started.'}),c.map((D,I)=>{const L=cx(D.dbType);return m.jsxs(Ur,{sx:{mb:3,p:2,border:"1px solid",borderColor:"divider",borderRadius:1},children:[m.jsxs(Ur,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",mb:2},children:[m.jsxs(lr,{variant:"subtitle2",children:["Database ",I+1]}),m.jsx(gs,{"aria-label":`Remove attached database ${I+1}`,onClick:()=>w(I),size:"small",color:"error",children:m.jsx(y$,{fontSize:"small"})})]}),m.jsx(Wn,{margin:"dense",required:!0,id:`attachedDb_${I}_name`,name:`attachedDb_${I}_name`,label:"Database Name",type:"text",fullWidth:!0,variant:"standard",defaultValue:D.name}),m.jsx(Wn,{margin:"dense",id:`attachedDb_${I}_type`,name:`attachedDb_${I}_type`,label:"Database Type",fullWidth:!0,variant:"standard",value:D.dbType,select:!0,onChange:F=>C(I,F.target.value),children:Object.values(nj).map(F=>m.jsx(Mo,{value:F,children:F},F))}),L.filter(F=>F.visibleWhen?(D[F.visibleWhen.field]||R(I,F.visibleWhen.field)||L.find(B=>B.name===F.visibleWhen?.field)?.selectOptions?.[0]?.value)===F.visibleWhen.value:!0).map(F=>m.jsx(Wn,{margin:"dense",id:`attachedDb_${I}_${F.name}`,name:`attachedDb_${I}_${F.name}`,label:F.label,type:F.selectOptions?void 0:F.type,fullWidth:!0,variant:"standard",required:F.required,select:!!F.selectOptions,defaultValue:R(I,F.name)||F.selectOptions?.[0]?.value,onChange:F.selectOptions?B=>{const U=[...c];U[I]={...U[I],[F.name]:B.target.value},u(U)}:void 0,children:F.selectOptions?.map(B=>m.jsx(Mo,{value:B.value,children:B.label},B.value))},F.name))]},I)})]}):oc[i].map(D=>{const I=e?.[m1[i]??""]?.[D.name??""]??"",L=D.type==="password"||D.name==="password"||D.name==="secretAccessKey"||D.name==="secret"||D.name==="accessToken"||D.name==="privateKey";return m.jsx(Wn,{margin:"dense",id:D.name,name:D.name,label:D.label,type:D.type,fullWidth:!0,variant:"standard",required:D.required&&!L&&!I,defaultValue:I,placeholder:L&&I?"Leave empty to keep existing":void 0},D.name)})]})]}),m.jsxs(Ol,{onClick:D=>{D.stopPropagation()},children:[m.jsx(Zr,{disabled:n,onClick:x,children:"Cancel"}),m.jsx(Zr,{type:"submit",form:"connection-form",loading:n,children:"Edit Connection"})]})]})]})}function AL(e,t){return!e||e.type!=="duckdb"?!1:(e.duckdbConnection?.attachedDatabases||[]).some(n=>n.type==="azure"&&n.name===t)}function nwe(e){return e.startsWith("gs://")||e.startsWith("s3://")||e.startsWith("https://")||e.startsWith("abfss://")||e.startsWith("az://")}function rwe({connectionName:e,resourceUri:t,schema:n,connection:r}){const{apiClients:o}=Dr(),{environmentName:a}=to(t),[i,s]=vt.useState(null),[c,u]=vt.useState(n||null),[f,p]=vt.useState(!1),{data:y,isError:g,isLoading:b,error:x}=uo({queryKey:["schemas",a,e],queryFn:()=>o.connections.listSchemas(a,e)}),E=y?.data||[];return m.jsxs(ts,{container:!0,spacing:1,children:[!n&&m.jsx(ts,{size:{xs:12,md:4},children:m.jsxs(Ci,{sx:{p:1,m:0},children:[m.jsxs(gt,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",mb:0},children:[m.jsx(at,{variant:"overline",fontWeight:"bold",children:"Table Paths"}),m.jsx(Tp,{control:m.jsx(yA,{checked:f,onChange:S=>p(S.target.checked)}),label:"Hidden Schemas"})]}),m.jsx(yl,{sx:{mt:"2px"}}),m.jsxs(gt,{sx:{mt:"2px",maxHeight:"600px",overflowY:"auto"},children:[b&&m.jsx(Ca,{text:"Loading schemas..."}),g&&m.jsx(Ta,{error:x,context:`${a} > ${e} > Schemas`}),!b&&!g&&E.length===0&&m.jsx(at,{variant:"body2",children:"No Schemas"}),!b&&!g&&E.length>0&&m.jsx(pA,{dense:!0,disablePadding:!0,children:E.map(S=>{const w=S.name;return S.isHidden&&!f?null:m.jsx(uF,{selected:c===w,onClick:()=>{u(w),s(null)},children:m.jsx(Xd,{primary:w})},w)})})]})]})}),m.jsx(ts,{size:{xs:12,md:n?6:4},children:c&&m.jsx(Ci,{sx:{p:1,m:0},children:m.jsx(iwe,{connectionName:e,schemaName:c,onTableSelect:S=>{s(S)},resourceUri:t,connection:r})})}),m.jsx(ts,{size:{xs:12,md:n?6:4},children:c&&i&&m.jsx(owe,{environmentName:a,connectionName:e,schemaName:c,tableResource:i})})]})}function owe({environmentName:e,connectionName:t,schemaName:n,tableResource:r}){const{apiClients:o}=Dr(),{data:a,isLoading:i,isError:s,error:c}=uo({queryKey:["connectionTableDetail",e,t,n,r],queryFn:()=>o.connections.getTable(e,t,n,r),enabled:!!n&&!!r}),u={resource:a?.data?.resource??r,columns:a?.data?.columns??[]};return m.jsxs(Ci,{sx:{p:1,m:0},children:[s&&m.jsx(Ta,{error:c,context:`${e} > ${t} > ${n} > ${r}`}),!s&&m.jsx(awe,{table:u,loading:i})]})}function awe({table:e,loading:t}){return t?m.jsx(Ca,{text:"Loading columns..."}):m.jsxs(m.Fragment,{children:[m.jsxs(at,{variant:"overline",fontWeight:"bold",sx:{display:"block",wordBreak:"break-all"},children:[e.resource.includes("://")||/\.(parquet|csv|json|tsv|ndjson)$/i.test(e.resource)?"File":"Table",": ",e.resource]}),m.jsx(yl,{}),m.jsx(gt,{sx:{mt:"10px",maxHeight:"600px",overflowY:"auto"},children:m.jsx(Cte,{children:m.jsxs(lb,{size:"small",sx:{"& .MuiTableCell-root":{padding:"10px"}},children:[m.jsx(ub,{children:m.jsxs(bl,{children:[m.jsx(Mn,{children:"NAME"}),m.jsx(Mn,{children:"TYPE"})]})}),m.jsx(cb,{children:e.columns?.sort((n,r)=>n.name.localeCompare(r.name))?.map(n=>m.jsxs(bl,{children:[m.jsx(Mn,{children:n.name}),m.jsx(Mn,{children:n.type})]},n.name))})]})})})]})}function iwe({connectionName:e,schemaName:t,onTableSelect:n,resourceUri:r,connection:o}){const{environmentName:a}=to(r),{apiClients:i}=Dr(),[s,c]=T.useState(""),{data:u,isSuccess:f,isError:p,error:y,isLoading:g}=uo({queryKey:["tablesInSchema",a,e,t],queryFn:()=>i.connections.listTables(a,e,t)}),b=AL(o,t),x=S=>b?S:S.split(".").pop()||S,E=f&&u?.data?u.data.filter(S=>x(S.resource).toLowerCase().includes(s.toLowerCase())).sort((S,w)=>x(S.resource).localeCompare(x(w.resource))):[];return m.jsxs(m.Fragment,{children:[m.jsx(at,{variant:"overline",fontWeight:"bold",children:nwe(t)||AL(o,t)?`Files in ${t}`:`Tables in ${t}`}),m.jsx(yl,{}),m.jsx(gt,{sx:{mt:1,mb:1},children:m.jsx(xu,{size:"small",fullWidth:!0,placeholder:"Search tables...",value:s,onChange:S=>c(S.target.value),variant:"outlined"})}),m.jsx(yl,{}),m.jsxs(gt,{sx:{mt:"2px",maxHeight:"600px",overflowY:"auto"},children:[g&&m.jsx(Ca,{text:"Fetching Tables..."}),p&&m.jsx(Ta,{error:y,context:`${a} > ${e} > ${t}`}),f&&E.length===0&&m.jsx(at,{variant:"body2",children:"No Tables"}),f&&u?.data&&u.data.length>0&&m.jsx(pA,{dense:!0,disablePadding:!0,children:E.map(S=>{let w=x(S.resource);return!b&&S.resource.includes("://")&&(w=S.resource.split("/").pop()||S.resource),m.jsx(uF,{onClick:()=>n(S.resource),children:m.jsx(Xd,{primary:w,secondary:S.columns.length>0?`${S.columns.length} columns`:void 0})},S.resource)})})]})]})}const swe={bigquery:"BigQuery",snowflake:"Snowflake",postgres:"PostgreSQL",mysql:"MySQL",trino:"Trino",databricks:"Databricks",duckdb:"DuckDB",ducklake:"DuckLake",s3:"S3",gcs:"GCS",azure:"Azure"};function lwe(e){return e?swe[e]??e:""}function cwe({resourceUri:e}){const{apiClients:t,mutable:n}=Dr(),r=Ls(),{environmentName:o}=to(e),[a,i]=T.useState(""),[s,c]=T.useState(null),u=MD({environmentName:o,connectionName:s}),{data:f,isSuccess:p,isError:y,error:g}=uo({queryKey:["connections",o],queryFn:()=>t.connections.listConnections(o)}),b=()=>{c(null)},x=Ho({mutationFn:R=>t.environments.updateEnvironment(o,{name:o,connections:[...f.data,R]}),onSuccess(){i("Connection added successfully"),r.invalidateQueries({queryKey:["connections",o]})},onError(R){i(R.message)}}),E=Ho({mutationFn:R=>t.environments.updateEnvironment(o,{name:o,connections:f.data.map(M=>M.name===R.name?R:M)}),onSuccess(R,M){i(`Connection ${M.name} updated successfully`),r.invalidateQueries({queryKey:["connections",o]})},onError(R){i(R.message)}}),S=Ho({mutationFn:R=>t.environments.updateEnvironment(o,{name:o,connections:f.data.filter(M=>M.name!==R.name)}),onSuccess(R,M){i(`Connection ${M.name} deleted successfully`),r.invalidateQueries({queryKey:["connections",o]})},onError(R){i(R.message)}}),w=p?[...f.data].sort((R,M)=>(R.name??"").localeCompare(M.name??"")):[],C=x.isPending||E.isPending||S.isPending;return m.jsxs(gt,{children:[m.jsxs(gt,{sx:{display:"flex",alignItems:"flex-start",justifyContent:"space-between",mb:3},children:[m.jsxs(gt,{children:[m.jsx(at,{variant:"h6",sx:{fontWeight:600,letterSpacing:"-0.025em"},children:"Connections"}),m.jsx(at,{variant:"body2",color:"text.secondary",children:"Database connections available to packages in this environment"})]}),n&&p&&m.jsx(JTe,{onSubmit:R=>x.mutateAsync(R),isSubmitting:x.isPending})]}),!p&&!y&&m.jsx(at,{variant:"body2",color:"text.secondary",children:"Fetching Connections..."}),y&&m.jsx(Ta,{error:g,context:`${o} > Connections`}),p&&w.length===0&&m.jsx(at,{variant:"body2",color:"text.secondary",children:"No connections yet."}),p&&w.length>0&&m.jsx(ts,{container:!0,spacing:2,children:w.map(R=>m.jsx(ts,{size:{xs:12,sm:6,md:4},children:m.jsx(uwe,{connection:R,mutable:n,isMutating:C,onOpenExplorer:()=>c(R.name??null),onEdit:M=>E.mutateAsync(M),onDelete:M=>{R.resource?i("Cannot delete this connection"):S.mutateAsync(M)}})},R.name))}),m.jsx(_s,{open:a!=="",autoHideDuration:6e3,onClose:()=>i(""),message:a}),m.jsxs(wi,{open:s!==null,onClose:b,maxWidth:"lg",fullWidth:!0,children:[m.jsxs(Ai,{children:["Connection Explorer: ",s,m.jsx(dr,{"aria-label":"close",onClick:b,sx:{position:"absolute",right:8,top:8},children:m.jsx(gt,{sx:{width:24,height:24,display:"flex",alignItems:"center",justifyContent:"center"},children:"X"})})]}),m.jsx(ki,{children:s&&m.jsx(rwe,{resourceUri:u,connectionName:s,connection:f?.data?.find(R=>R.name===s)})})]})]})}function uwe({connection:e,mutable:t,isMutating:n,onOpenExplorer:r,onEdit:o,onDelete:a}){const[i,s]=T.useState(null),c=!!i,u=p=>{p.stopPropagation(),s(p.currentTarget)},f=()=>{s(null)};return m.jsx(ch,{variant:"outlined",onClick:r,sx:{height:"100%",cursor:"pointer",borderRadius:3,borderColor:"divider",boxShadow:"none",transition:"all 0.2s ease-in-out","&:hover":{boxShadow:2,borderColor:"primary.main"}},children:m.jsx(uh,{sx:{p:2.5,"&:last-child":{pb:2.5}},children:m.jsxs(gt,{sx:{display:"flex",alignItems:"flex-start",gap:1.5},children:[m.jsx(gt,{sx:{width:36,height:36,borderRadius:1.5,bgcolor:"warning.light",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0,color:"warning.main"},children:m.jsx(MCe,{sx:{fontSize:20}})}),m.jsxs(gt,{sx:{flex:1,minWidth:0},children:[m.jsx(at,{variant:"subtitle1",component:"h6",noWrap:!0,sx:{fontWeight:600,mb:.5},children:e.name}),m.jsx(at,{variant:"body2",color:"text.secondary",noWrap:!0,children:lwe(e.type)})]}),t&&m.jsxs(m.Fragment,{children:[m.jsx(dr,{size:"small",onClick:u,"aria-label":`Connection actions for ${e.name??""}`.trim(),sx:{flexShrink:0,mt:-.5,mr:-.5},children:m.jsx(eS,{fontSize:"small"})}),m.jsxs(Zd,{anchorEl:i,open:c,onClose:f,onClick:p=>p.stopPropagation(),anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},children:[m.jsx(twe,{connection:e,onSubmit:o,isSubmitting:n,onCloseDialog:f}),m.jsx(ewe,{connection:e,onCloseDialog:f,isMutating:n,onDelete:()=>a(e)})]})]})]})})})}const dwe=Fn([m.jsx("path",{d:"M20 2H4c-1 0-2 .9-2 2v3.01c0 .72.43 1.34 1 1.69V20c0 1.1 1.1 2 2 2h14c.9 0 2-.9 2-2V8.7c.57-.35 1-.97 1-1.69V4c0-1.1-1-2-2-2m-1 18H5V9h14zm1-13H4V4h16z"},"0"),m.jsx("path",{d:"M9 12h6v2H9z"},"1")]);function fwe({resourceUri:e,onCloseDialog:t}){const[n,r]=T.useState(!1),{apiClients:o}=Dr(),a=Ls(),[i,s]=T.useState(""),c=()=>{r(!0)},u=()=>{r(!1),t()},{environmentName:f,packageName:p}=to(e),y=Ho({mutationFn:()=>o.packages.deletePackage(f,p),onSuccess(){u(),a.invalidateQueries({queryKey:["packages"]}),s("Package deleted successfully")},onError(g){s(g instanceof Error?g.message:"An unknown error occurred")}});return m.jsxs(vt.Fragment,{children:[m.jsxs(cc,{onClick:c,children:[m.jsx(sb,{children:m.jsx(Jx,{fontSize:"small"})}),m.jsx(Xd,{children:"Delete"})]}),m.jsxs(Dl,{onClose:u,"aria-labelledby":"customized-dialog-title",open:n,children:[m.jsx(gc,{sx:{m:0,p:2},id:"customized-dialog-title",children:"Delete Package"}),m.jsx(gs,{"aria-label":"close",onClick:u,sx:g=>({position:"absolute",right:8,top:8,color:g.palette.grey[500]}),children:m.jsx(Ns,{})}),m.jsx(Rl,{dividers:!0,children:m.jsxs(lr,{gutterBottom:!0,children:['Are you sure you want to delete "',p,'"? This action cannot be undone.']})}),m.jsxs(Ol,{children:[m.jsx(Zr,{variant:"outlined",onClick:u,style:{borderColor:Ba.teal,color:Ba.teal},children:"Cancel"}),m.jsx(Zr,{variant:"contained",autoFocus:!0,onClick:()=>y.mutate(),color:"error",loading:y.isPending,children:"Delete"})]}),m.jsx(_s,{open:i!=="",autoHideDuration:6e3,onClose:()=>s(""),message:i})]})]})}function pwe({package:e,resourceUri:t,onCloseDialog:n}){const[r,o]=T.useState(!1),{apiClients:a}=Dr(),i=Ls(),[s,c]=T.useState(""),u=()=>{o(!0)},f=()=>{o(!1),n()},{packageName:p,environmentName:y}=to(t),g=Ho({async mutationFn(x){return a.packages.updatePackage(y,p,{name:p,description:x.description})},onSuccess(){f(),c("Package updated successfully"),i.invalidateQueries({queryKey:["packages",y]})},onError(x){c(x instanceof Error?x.message:"An unknown error occurred")}}),b=x=>{x.preventDefault();const E=new FormData(x.currentTarget).get("description")?.toString();g.mutate({description:E})};return m.jsxs(vt.Fragment,{children:[m.jsxs(cc,{onClick:u,children:[m.jsx(sb,{children:m.jsx(RA,{fontSize:"small"})}),m.jsx(Xd,{children:"Edit"})]}),m.jsxs(Dl,{open:r,onClose:f,children:[m.jsx(gc,{children:"Edit Package"}),m.jsxs(Rl,{children:[m.jsxs(Rb,{children:['Update the details for "',e.name,'".']}),m.jsxs("form",{onSubmit:b,id:"package-form",children:[m.jsx(Wn,{autoFocus:!0,required:!0,margin:"dense",id:"name",name:"name",label:"Package Name",disabled:!0,type:"text",fullWidth:!0,variant:"standard",defaultValue:e.name}),m.jsx(Wn,{id:"description",name:"description",label:"Description",multiline:!0,fullWidth:!0,rows:4,defaultValue:e.description,variant:"standard"})]})]}),m.jsxs(Ol,{children:[m.jsx(Zr,{disabled:g.isPending,onClick:f,children:"Cancel"}),m.jsx(Zr,{type:"submit",form:"package-form",loading:g.isPending,children:"Save Changes"})]})]}),m.jsx(_s,{open:s!=="",autoHideDuration:6e3,onClose:()=>c(""),message:s})]})}function hwe({onSelectPackage:e,resourceUri:t}){const{apiClients:n}=Dr(),{environmentName:r}=to(t),{data:o,isSuccess:a,isError:i,error:s}=uo({queryKey:["packages",r],queryFn:()=>n.packages.listPackages(r)});if(i)return m.jsx(Ta,{error:s,context:`${r} > Packages`});if(!a)return m.jsx(Ca,{text:"Fetching Packages..."});const c=[...o.data].sort((u,f)=>u.name.localeCompare(f.name));return m.jsx(ts,{container:!0,spacing:2,children:c.map(u=>{const f=MD({environmentName:r,packageName:u.name});return m.jsx(ts,{size:{xs:12,sm:6,md:4},children:m.jsx(mwe,{pkg:u,packageResourceUri:f,onSelectPackage:e})},u.name)})})}function mwe({pkg:e,packageResourceUri:t,onSelectPackage:n}){const{mutable:r}=Dr(),[o,a]=T.useState(null),i=!!o,s=p=>{n(e.name,p)},c=p=>{p.stopPropagation(),a(p.currentTarget)},u=()=>{a(null)},f=e.description??"";return m.jsx(ch,{variant:"outlined",onClick:s,sx:{height:"100%",cursor:"pointer",borderRadius:3,borderColor:"divider",boxShadow:"none",transition:"all 0.2s ease-in-out","&:hover":{boxShadow:2,borderColor:"primary.main"}},children:m.jsx(uh,{sx:{p:2.5,"&:last-child":{pb:2.5}},children:m.jsxs(gt,{sx:{display:"flex",alignItems:"flex-start",gap:1.5},children:[m.jsx(gt,{sx:p=>({width:36,height:36,borderRadius:1.5,bgcolor:p.palette.mode==="dark"?"rgba(255, 255, 255, 0.08)":"grey.100",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0,color:"text.primary"}),children:m.jsx(dwe,{sx:{fontSize:20}})}),m.jsxs(gt,{sx:{flex:1,minWidth:0},children:[m.jsx(at,{variant:"subtitle1",component:"h6",noWrap:!0,sx:{fontWeight:600,mb:.5},children:e.name}),m.jsx(eo,{title:f,followCursor:!0,enterDelay:1e3,children:m.jsx(at,{variant:"body2",color:"text.secondary",sx:{overflow:"hidden",textOverflow:"ellipsis",display:"-webkit-box",WebkitLineClamp:2,WebkitBoxOrient:"vertical",lineHeight:1.5},children:f})})]}),r&&m.jsxs(m.Fragment,{children:[m.jsx(dr,{size:"small",onClick:c,"aria-label":`Package actions for ${e.name}`,sx:{flexShrink:0,mt:-.5,mr:-.5},children:m.jsx(eS,{fontSize:"small"})}),m.jsxs(Zd,{anchorEl:o,open:i,onClose:u,onClick:p=>p.stopPropagation(),anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},children:[m.jsx(pwe,{package:e,resourceUri:t,onCloseDialog:u}),m.jsx(fwe,{resourceUri:t,onCloseDialog:u})]})]})]})})})}function yIe({onSelectPackage:e,resourceUri:t}){const{mutable:n}=Dr(),{environmentName:r}=to(t);return T.useEffect(()=>{window.scrollTo({top:0,behavior:"auto"})},[]),m.jsxs(Ux,{maxWidth:!1,sx:{maxWidth:1024,mx:"auto",px:4,py:3},children:[m.jsxs(gt,{sx:{mb:5},children:[m.jsx(at,{variant:"h4",component:"h1",sx:{fontWeight:600,letterSpacing:"-0.025em",mb:.5},children:r}),m.jsx(at,{variant:"body2",color:"text.secondary",children:"Manage packages and database connections in this environment. Open a package to explore its models and notebooks."})]}),m.jsxs(gt,{sx:{mb:5},children:[m.jsxs(Lr,{direction:"row",justifyContent:"space-between",alignItems:"flex-start",sx:{mb:3},children:[m.jsxs(gt,{children:[m.jsx(at,{variant:"h6",sx:{fontWeight:600,letterSpacing:"-0.025em"},children:"Packages"}),m.jsx(at,{variant:"body2",color:"text.secondary",children:"Published packages available for use in this environment"})]}),n&&m.jsx(RCe,{resourceUri:t})]}),m.jsx(hwe,{onSelectPackage:e,resourceUri:t})]}),m.jsx(gt,{sx:{mb:5},children:m.jsx(cwe,{resourceUri:t})}),m.jsx(gt,{sx:{mb:5},children:m.jsx(DCe,{resourceUri:t,onClickPackageFile:e})}),m.jsx(OCe,{resourceUri:t})]})}const gwe=e=>{const t=T.useRef({});return T.useEffect(()=>{t.current=e}),t.current};function DL({array1:e,array2:t,parser:n=r=>r}){return e&&t&&e.length===t.length&&e.every((r,o)=>n(r)===n(t[o]))}function OL(e){return e.normalize("NFD").replace(/[\u0300-\u036f]/g,"")}function ywe(e={}){const{ignoreAccents:t=!0,ignoreCase:n=!0,limit:r,matchFrom:o="any",stringify:a,trim:i=!1}=e;return(s,{inputValue:c,getOptionLabel:u})=>{let f=i?c.trim():c;n&&(f=f.toLowerCase()),t&&(f=OL(f));const p=f?s.filter(y=>{let g=(a||u)(y);return n&&(g=g.toLowerCase()),t&&(g=OL(g)),o==="start"?g.startsWith(f):g.includes(f)}):s;return typeof r=="number"?p.slice(0,r):p}}const bwe=ywe(),RL=5,vwe=e=>e.current!==null&&e.current.parentElement?.contains(document.activeElement),xwe=[];function ML(e,t,n,r){if(t||e==null||r)return"";const o=n(e);return typeof o=="string"?o:""}function Swe(e){const{unstable_isActiveElementInListbox:t=vwe,unstable_classNamePrefix:n="Mui",autoComplete:r=!1,autoHighlight:o=!1,autoSelect:a=!1,blurOnSelect:i=!1,clearOnBlur:s=!e.freeSolo,clearOnEscape:c=!1,componentName:u="useAutocomplete",defaultValue:f=e.multiple?xwe:null,disableClearable:p=!1,disableCloseOnSelect:y=!1,disabled:g,disabledItemsFocusable:b=!1,disableListWrap:x=!1,filterOptions:E=bwe,filterSelectedOptions:S=!1,freeSolo:w=!1,getOptionDisabled:C,getOptionKey:R,getOptionLabel:M=le=>le.label??le,groupBy:D,handleHomeEndKeys:I=!e.freeSolo,id:L,includeInputInList:F=!1,inputValue:B,isOptionEqualToValue:U=(le,ce)=>le===ce,multiple:k=!1,onChange:$,onClose:j,onHighlightChange:V,onInputChange:z,onOpen:K,open:Y,openOnFocus:te=!1,options:_,readOnly:Z=!1,renderValue:J,selectOnFocus:W=!e.freeSolo,value:re}=e,ne=Bs(L);let X=M;X=le=>{const ce=M(le);return typeof ce!="string"?String(ce):ce};const ie=T.useRef(!1),ae=T.useRef(!0),fe=T.useRef(null),xe=T.useRef(null),[ge,Re]=T.useState(null),[de,me]=T.useState(-1),Qe=o?0:-1,Me=T.useRef(Qe),we=T.useRef(ML(f??re,k,X)).current,[Se,dt]=xi({controlled:re,default:f,name:u}),[ze,tt]=xi({controlled:B,default:we,name:u,state:"inputValue"}),[Ze,qt]=T.useState(!1),Vt=T.useCallback((le,ce,Be)=>{if(!(k?Se.length<ce.length:ce!==null)&&!s)return;const ut=ML(ce,k,X,J);ze!==ut&&(tt(ut),z&&z(le,ut,Be))},[X,ze,k,z,tt,s,Se,J]),[Mt,ke]=xi({controlled:Y,default:!1,name:u,state:"open"}),[Ne,lt]=T.useState(!0),St=!k&&Se!=null&&ze===X(Se),ft=Mt&&!Z,$e=ft?E(_.filter(le=>!(S&&(k?Se:[Se]).some(ce=>ce!==null&&U(le,ce)))),{inputValue:St&&Ne?"":ze,getOptionLabel:X}):[],Ht=gwe({filteredOptions:$e,value:Se,inputValue:ze});T.useEffect(()=>{const le=Se!==Ht.value;Ze&&!le||w&&!le||Vt(null,Se,"reset")},[Se,Vt,Ze,Ht.value,w]);const $t=Mt&&$e.length>0&&!Z,pt=Pt(le=>{if(le===-1)fe.current.focus();else{const ce=J?"data-item-index":"data-tag-index";ge.querySelector(`[${ce}="${le}"]`).focus()}});T.useEffect(()=>{k&&de>Se.length-1&&(me(-1),pt(-1))},[Se,k,de,pt]);function Te(le,ce){if(!xe.current||le<0||le>=$e.length)return-1;let Be=le;for(;;){const ut=xe.current.querySelector(`[data-option-index="${Be}"]`),qe=b?!1:!ut||ut.disabled||ut.getAttribute("aria-disabled")==="true";if(ut&&ut.hasAttribute("tabindex")&&!qe)return Be;if(ce==="next"?Be=(Be+1)%$e.length:Be=(Be-1+$e.length)%$e.length,Be===le)return-1}}const Ue=Pt(({event:le,index:ce,reason:Be})=>{if(Me.current=ce,ce===-1?fe.current.removeAttribute("aria-activedescendant"):fe.current.setAttribute("aria-activedescendant",`${ne}-option-${ce}`),V&&["mouse","keyboard","touch"].includes(Be)&&V(le,ce===-1?null:$e[ce],Be),!xe.current)return;const ut=xe.current.querySelector(`[role="option"].${n}-focused`);ut&&(ut.classList.remove(`${n}-focused`),ut.classList.remove(`${n}-focusVisible`));let qe=xe.current;if(xe.current.getAttribute("role")!=="listbox"&&(qe=xe.current.parentElement.querySelector('[role="listbox"]')),!qe)return;if(ce===-1){qe.scrollTop=0;return}const Zt=xe.current.querySelector(`[data-option-index="${ce}"]`);if(Zt&&(Zt.classList.add(`${n}-focused`),Be==="keyboard"&&Zt.classList.add(`${n}-focusVisible`),qe.scrollHeight>qe.clientHeight&&Be!=="mouse"&&Be!=="touch")){const an=Zt,vr=qe.clientHeight+qe.scrollTop,sn=an.offsetTop+an.offsetHeight;sn>vr?qe.scrollTop=sn-qe.clientHeight:an.offsetTop-an.offsetHeight*(D?1.3:0)<qe.scrollTop&&(qe.scrollTop=an.offsetTop-an.offsetHeight*(D?1.3:0))}}),yt=Pt(({event:le,diff:ce,direction:Be="next",reason:ut})=>{if(!ft)return;const qe=Te((()=>{const Zt=$e.length-1;if(ce==="reset")return Qe;if(ce==="start")return 0;if(ce==="end")return Zt;const an=Me.current+ce;return an<0?an===-1&&F?-1:x&&Me.current!==-1||Math.abs(ce)>1?0:Zt:an>Zt?an===Zt+1&&F?-1:x||Math.abs(ce)>1?Zt:0:an})(),Be);if(Ue({index:qe,reason:ut,event:le}),r&&ce!=="reset")if(qe===-1)fe.current.value=ze;else{const Zt=X($e[qe]);fe.current.value=Zt,Zt.toLowerCase().indexOf(ze.toLowerCase())===0&&ze.length>0&&fe.current.setSelectionRange(ze.length,Zt.length)}}),ht=!DL({array1:Ht.filteredOptions,array2:$e,parser:X}),Cn=()=>{const le=(ce,Be)=>{const ut=ce?X(ce):"",qe=Be?X(Be):"";return ut===qe};if(Me.current!==-1&&!DL({array1:Ht.filteredOptions,array2:$e,parser:X})&&Ht.inputValue===ze&&(k?Se.length===Ht.value.length&&Ht.value.every((ce,Be)=>X(Se[Be])===X(ce)):le(Ht.value,Se))){const ce=Ht.filteredOptions[Me.current];if(ce)return $e.findIndex(Be=>X(Be)===X(ce))}return-1},On=T.useCallback(()=>{if(!ft)return;const le=Cn();if(le!==-1){Me.current=le;return}const ce=k?Se[0]:Se;if($e.length===0||ce==null){yt({diff:"reset"});return}if(xe.current){if(ce!=null){const Be=$e[Me.current];if(k&&Be&&Se.findIndex(qe=>U(Be,qe))!==-1)return;const ut=$e.findIndex(qe=>U(qe,ce));ut===-1?yt({diff:"reset"}):Ue({index:ut});return}if(Me.current>=$e.length-1){Ue({index:$e.length-1});return}Ue({index:Me.current})}},[$e.length,k?!1:Se,S,yt,Ue,ft,ze,k]),In=Pt(le=>{Ck(xe,le),le&&On()});T.useEffect(()=>{ht&&On()},[On,ht]);const pn=le=>{Mt||(ke(!0),lt(!0),K&&K(le))},Gn=(le,ce)=>{Mt&&(ke(!1),j&&j(le,ce))},Hn=(le,ce,Be,ut)=>{if(k){if(Se.length===ce.length&&Se.every((qe,Zt)=>qe===ce[Zt]))return}else if(Se===ce)return;$&&$(le,ce,Be,ut),dt(ce)},wn=T.useRef(!1),or=(le,ce,Be="selectOption",ut="options")=>{let qe=Be,Zt=ce;if(k){Zt=Array.isArray(Se)?Se.slice():[];const an=Zt.findIndex(vr=>U(ce,vr));an===-1?Zt.push(ce):ut!=="freeSolo"&&(Zt.splice(an,1),qe="removeOption")}Vt(le,Zt,qe),Hn(le,Zt,qe,{option:ce}),!y&&(!le||!le.ctrlKey&&!le.metaKey)&&Gn(le,qe),(i===!0||i==="touch"&&wn.current||i==="mouse"&&!wn.current)&&fe.current.blur()};function Wt(le,ce){if(le===-1)return-1;let Be=le;for(;;){if(ce==="next"&&Be===Se.length||ce==="previous"&&Be===-1)return-1;const ut=J?"data-item-index":"data-tag-index",qe=ge.querySelector(`[${ut}="${Be}"]`);if(!qe||!qe.hasAttribute("tabindex")||qe.disabled||qe.getAttribute("aria-disabled")==="true")Be+=ce==="next"?1:-1;else return Be}}const he=(le,ce)=>{if(!k)return;ze===""&&Gn(le,"toggleInput");let Be=de;de===-1?ze===""&&ce==="previous"&&(Be=Se.length-1):(Be+=ce==="next"?1:-1,Be<0&&(Be=0),Be===Se.length&&(Be=-1)),Be=Wt(Be,ce),me(Be),pt(Be)},Ae=le=>{ie.current=!0,tt(""),z&&z(le,"","clear"),Hn(le,k?[]:null,"clear")},Ie=le=>ce=>{if(le.onKeyDown&&le.onKeyDown(ce),!ce.defaultMuiPrevented&&(de!==-1&&!["ArrowLeft","ArrowRight"].includes(ce.key)&&(me(-1),pt(-1)),ce.which!==229))switch(ce.key){case"Home":ft&&I&&(ce.preventDefault(),yt({diff:"start",direction:"next",reason:"keyboard",event:ce}));break;case"End":ft&&I&&(ce.preventDefault(),yt({diff:"end",direction:"previous",reason:"keyboard",event:ce}));break;case"PageUp":ce.preventDefault(),yt({diff:-RL,direction:"previous",reason:"keyboard",event:ce}),pn(ce);break;case"PageDown":ce.preventDefault(),yt({diff:RL,direction:"next",reason:"keyboard",event:ce}),pn(ce);break;case"ArrowDown":ce.preventDefault(),yt({diff:1,direction:"next",reason:"keyboard",event:ce}),pn(ce);break;case"ArrowUp":ce.preventDefault(),yt({diff:-1,direction:"previous",reason:"keyboard",event:ce}),pn(ce);break;case"ArrowLeft":!k&&J?pt(0):he(ce,"previous");break;case"ArrowRight":!k&&J?pt(-1):he(ce,"next");break;case"Enter":if(Me.current!==-1&&ft){const Be=$e[Me.current],ut=C?C(Be):!1;if(ce.preventDefault(),ut)return;or(ce,Be,"selectOption"),r&&fe.current.setSelectionRange(fe.current.value.length,fe.current.value.length)}else w&&ze!==""&&St===!1&&(k&&ce.preventDefault(),or(ce,ze,"createOption","freeSolo"));break;case"Escape":ft?(ce.preventDefault(),ce.stopPropagation(),Gn(ce,"escape")):c&&(ze!==""||k&&Se.length>0||J)&&(ce.preventDefault(),ce.stopPropagation(),Ae(ce));break;case"Backspace":if(k&&!Z&&ze===""&&Se.length>0){const Be=de===-1?Se.length-1:de,ut=Se.slice();ut.splice(Be,1),Hn(ce,ut,"removeOption",{option:Se[Be]})}!k&&J&&!Z&&(dt(null),pt(-1));break;case"Delete":if(k&&!Z&&ze===""&&Se.length>0&&de!==-1){const Be=de,ut=Se.slice();ut.splice(Be,1),Hn(ce,ut,"removeOption",{option:Se[Be]})}!k&&J&&!Z&&(dt(null),pt(-1));break}},Ve=le=>{qt(!0),te&&!ie.current&&pn(le)},ot=le=>{if(t(xe)){fe.current.focus();return}qt(!1),ae.current=!0,ie.current=!1,a&&Me.current!==-1&&ft?or(le,$e[Me.current],"blur"):a&&w&&ze!==""?or(le,ze,"blur","freeSolo"):s&&Vt(le,Se,"blur"),Gn(le,"blur")},It=le=>{const ce=le.target.value;ze!==ce&&(tt(ce),lt(!1),z&&z(le,ce,"input")),ce===""?!p&&!k&&Hn(le,null,"clear"):pn(le)},Ft=le=>{const ce=Number(le.currentTarget.getAttribute("data-option-index"));Me.current!==ce&&Ue({event:le,index:ce,reason:"mouse"})},Rt=le=>{Ue({event:le,index:Number(le.currentTarget.getAttribute("data-option-index")),reason:"touch"}),wn.current=!0},jt=le=>{const ce=Number(le.currentTarget.getAttribute("data-option-index"));or(le,$e[ce],"selectOption"),wn.current=!1},Nt=le=>ce=>{const Be=Se.slice();Be.splice(le,1),Hn(ce,Be,"removeOption",{option:Se[le]})},kt=le=>{Hn(le,null,"removeOption",{option:Se})},Et=le=>{Mt?Gn(le,"toggleInput"):pn(le)},Bt=le=>{le.currentTarget.contains(le.target)&&le.target.getAttribute("id")!==ne&&le.preventDefault()},Tn=le=>{le.currentTarget.contains(le.target)&&(fe.current.focus(),W&&ae.current&&fe.current.selectionEnd-fe.current.selectionStart===0&&fe.current.select(),ae.current=!1)},nr=le=>{!g&&(ze===""||!Mt)&&Et(le)};let Yn=w&&ze.length>0;Yn=Yn||(k?Se.length>0:Se!==null);let rn=$e;return D&&(rn=$e.reduce((le,ce,Be)=>{const ut=D(ce);return le.length>0&&le[le.length-1].group===ut?le[le.length-1].options.push(ce):le.push({key:Be,index:Be,group:ut,options:[ce]}),le},[])),g&&Ze&&ot(),{getRootProps:(le={})=>({...le,onKeyDown:Ie(le),onMouseDown:Bt,onClick:Tn}),getInputLabelProps:()=>({id:`${ne}-label`,htmlFor:ne}),getInputProps:()=>({id:ne,value:ze,onBlur:ot,onFocus:Ve,onChange:It,onMouseDown:nr,"aria-activedescendant":ft?"":null,"aria-autocomplete":r?"both":"list","aria-controls":$t?`${ne}-listbox`:void 0,"aria-expanded":$t,autoComplete:"off",ref:fe,autoCapitalize:"none",spellCheck:"false",role:"combobox",disabled:g}),getClearProps:()=>({tabIndex:-1,type:"button",onClick:Ae}),getItemProps:({index:le=0}={})=>({...k&&{key:le},...J?{"data-item-index":le}:{"data-tag-index":le},tabIndex:-1,...!Z&&{onDelete:k?Nt(le):kt}}),getPopupIndicatorProps:()=>({tabIndex:-1,type:"button",onClick:Et}),getTagProps:({index:le})=>({key:le,"data-tag-index":le,tabIndex:-1,...!Z&&{onDelete:Nt(le)}}),getListboxProps:()=>({role:"listbox",id:`${ne}-listbox`,"aria-labelledby":`${ne}-label`,ref:In,onMouseDown:le=>{le.preventDefault()}}),getOptionProps:({index:le,option:ce})=>{const Be=(k?Se:[Se]).some(qe=>qe!=null&&U(ce,qe)),ut=C?C(ce):!1;return{key:R?.(ce)??X(ce),tabIndex:-1,role:"option",id:`${ne}-option-${le}`,onMouseMove:Ft,onClick:jt,onTouchStart:Rt,"data-option-index":le,"aria-disabled":ut,"aria-selected":Be}},id:ne,inputValue:ze,value:Se,dirty:Yn,expanded:ft&&ge,popupOpen:ft,focused:Ze||de!==-1,anchorEl:ge,setAnchorEl:Re,focusedItem:de,focusedTag:de,groupedOptions:rn}}var Va="top",ss="bottom",ls="right",Wa="left",YD="auto",Mb=[Va,ss,ls,Wa],Jp="start",Gy="end",Ewe="clippingParents",D$="viewport",xg="popper",Cwe="reference",NL=Mb.reduce(function(e,t){return e.concat([t+"-"+Jp,t+"-"+Gy])},[]),O$=[].concat(Mb,[YD]).reduce(function(e,t){return e.concat([t,t+"-"+Jp,t+"-"+Gy])},[]),Twe="beforeRead",wwe="read",kwe="afterRead",Awe="beforeMain",Dwe="main",Owe="afterMain",Rwe="beforeWrite",Mwe="write",Nwe="afterWrite",Pwe=[Twe,wwe,kwe,Awe,Dwe,Owe,Rwe,Mwe,Nwe];function xl(e){return e?(e.nodeName||"").toLowerCase():null}function Di(e){if(e==null)return window;if(e.toString()!=="[object Window]"){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function Gd(e){var t=Di(e).Element;return e instanceof t||e instanceof Element}function rs(e){var t=Di(e).HTMLElement;return e instanceof t||e instanceof HTMLElement}function KD(e){if(typeof ShadowRoot>"u")return!1;var t=Di(e).ShadowRoot;return e instanceof t||e instanceof ShadowRoot}function Iwe(e){var t=e.state;Object.keys(t.elements).forEach(function(n){var r=t.styles[n]||{},o=t.attributes[n]||{},a=t.elements[n];!rs(a)||!xl(a)||(Object.assign(a.style,r),Object.keys(o).forEach(function(i){var s=o[i];s===!1?a.removeAttribute(i):a.setAttribute(i,s===!0?"":s)}))})}function _we(e){var t=e.state,n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow),function(){Object.keys(t.elements).forEach(function(r){var o=t.elements[r],a=t.attributes[r]||{},i=Object.keys(t.styles.hasOwnProperty(r)?t.styles[r]:n[r]),s=i.reduce(function(c,u){return c[u]="",c},{});!rs(o)||!xl(o)||(Object.assign(o.style,s),Object.keys(a).forEach(function(c){o.removeAttribute(c)}))})}}const Lwe={name:"applyStyles",enabled:!0,phase:"write",fn:Iwe,effect:_we,requires:["computeStyles"]};function hl(e){return e.split("-")[0]}var Pd=Math.max,ux=Math.min,eh=Math.round;function n2(){var e=navigator.userAgentData;return e!=null&&e.brands&&Array.isArray(e.brands)?e.brands.map(function(t){return t.brand+"/"+t.version}).join(" "):navigator.userAgent}function R$(){return!/^((?!chrome|android).)*safari/i.test(n2())}function th(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!1);var r=e.getBoundingClientRect(),o=1,a=1;t&&rs(e)&&(o=e.offsetWidth>0&&eh(r.width)/e.offsetWidth||1,a=e.offsetHeight>0&&eh(r.height)/e.offsetHeight||1);var i=Gd(e)?Di(e):window,s=i.visualViewport,c=!R$()&&n,u=(r.left+(c&&s?s.offsetLeft:0))/o,f=(r.top+(c&&s?s.offsetTop:0))/a,p=r.width/o,y=r.height/a;return{width:p,height:y,top:f,right:u+p,bottom:f+y,left:u,x:u,y:f}}function QD(e){var t=th(e),n=e.offsetWidth,r=e.offsetHeight;return Math.abs(t.width-n)<=1&&(n=t.width),Math.abs(t.height-r)<=1&&(r=t.height),{x:e.offsetLeft,y:e.offsetTop,width:n,height:r}}function M$(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&KD(n)){var r=t;do{if(r&&e.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function pc(e){return Di(e).getComputedStyle(e)}function Fwe(e){return["table","td","th"].indexOf(xl(e))>=0}function Fu(e){return((Gd(e)?e.ownerDocument:e.document)||window.document).documentElement}function BS(e){return xl(e)==="html"?e:e.assignedSlot||e.parentNode||(KD(e)?e.host:null)||Fu(e)}function PL(e){return!rs(e)||pc(e).position==="fixed"?null:e.offsetParent}function jwe(e){var t=/firefox/i.test(n2()),n=/Trident/i.test(n2());if(n&&rs(e)){var r=pc(e);if(r.position==="fixed")return null}var o=BS(e);for(KD(o)&&(o=o.host);rs(o)&&["html","body"].indexOf(xl(o))<0;){var a=pc(o);if(a.transform!=="none"||a.perspective!=="none"||a.contain==="paint"||["transform","perspective"].indexOf(a.willChange)!==-1||t&&a.willChange==="filter"||t&&a.filter&&a.filter!=="none")return o;o=o.parentNode}return null}function Nb(e){for(var t=Di(e),n=PL(e);n&&Fwe(n)&&pc(n).position==="static";)n=PL(n);return n&&(xl(n)==="html"||xl(n)==="body"&&pc(n).position==="static")?t:n||jwe(e)||t}function XD(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function hy(e,t,n){return Pd(e,ux(t,n))}function Bwe(e,t,n){var r=hy(e,t,n);return r>n?n:r}function N$(){return{top:0,right:0,bottom:0,left:0}}function P$(e){return Object.assign({},N$(),e)}function I$(e,t){return t.reduce(function(n,r){return n[r]=e,n},{})}var $we=function(e,t){return e=typeof e=="function"?e(Object.assign({},t.rects,{placement:t.placement})):e,P$(typeof e!="number"?e:I$(e,Mb))};function zwe(e){var t,n=e.state,r=e.name,o=e.options,a=n.elements.arrow,i=n.modifiersData.popperOffsets,s=hl(n.placement),c=XD(s),u=[Wa,ls].indexOf(s)>=0,f=u?"height":"width";if(!(!a||!i)){var p=$we(o.padding,n),y=QD(a),g=c==="y"?Va:Wa,b=c==="y"?ss:ls,x=n.rects.reference[f]+n.rects.reference[c]-i[c]-n.rects.popper[f],E=i[c]-n.rects.reference[c],S=Nb(a),w=S?c==="y"?S.clientHeight||0:S.clientWidth||0:0,C=x/2-E/2,R=p[g],M=w-y[f]-p[b],D=w/2-y[f]/2+C,I=hy(R,D,M),L=c;n.modifiersData[r]=(t={},t[L]=I,t.centerOffset=I-D,t)}}function Hwe(e){var t=e.state,n=e.options,r=n.element,o=r===void 0?"[data-popper-arrow]":r;o!=null&&(typeof o=="string"&&(o=t.elements.popper.querySelector(o),!o)||M$(t.elements.popper,o)&&(t.elements.arrow=o))}const Uwe={name:"arrow",enabled:!0,phase:"main",fn:zwe,effect:Hwe,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function nh(e){return e.split("-")[1]}var Vwe={top:"auto",right:"auto",bottom:"auto",left:"auto"};function Wwe(e,t){var n=e.x,r=e.y,o=t.devicePixelRatio||1;return{x:eh(n*o)/o||0,y:eh(r*o)/o||0}}function IL(e){var t,n=e.popper,r=e.popperRect,o=e.placement,a=e.variation,i=e.offsets,s=e.position,c=e.gpuAcceleration,u=e.adaptive,f=e.roundOffsets,p=e.isFixed,y=i.x,g=y===void 0?0:y,b=i.y,x=b===void 0?0:b,E=typeof f=="function"?f({x:g,y:x}):{x:g,y:x};g=E.x,x=E.y;var S=i.hasOwnProperty("x"),w=i.hasOwnProperty("y"),C=Wa,R=Va,M=window;if(u){var D=Nb(n),I="clientHeight",L="clientWidth";if(D===Di(n)&&(D=Fu(n),pc(D).position!=="static"&&s==="absolute"&&(I="scrollHeight",L="scrollWidth")),D=D,o===Va||(o===Wa||o===ls)&&a===Gy){R=ss;var F=p&&D===M&&M.visualViewport?M.visualViewport.height:D[I];x-=F-r.height,x*=c?1:-1}if(o===Wa||(o===Va||o===ss)&&a===Gy){C=ls;var B=p&&D===M&&M.visualViewport?M.visualViewport.width:D[L];g-=B-r.width,g*=c?1:-1}}var U=Object.assign({position:s},u&&Vwe),k=f===!0?Wwe({x:g,y:x},Di(n)):{x:g,y:x};if(g=k.x,x=k.y,c){var $;return Object.assign({},U,($={},$[R]=w?"0":"",$[C]=S?"0":"",$.transform=(M.devicePixelRatio||1)<=1?"translate("+g+"px, "+x+"px)":"translate3d("+g+"px, "+x+"px, 0)",$))}return Object.assign({},U,(t={},t[R]=w?x+"px":"",t[C]=S?g+"px":"",t.transform="",t))}function qwe(e){var t=e.state,n=e.options,r=n.gpuAcceleration,o=r===void 0?!0:r,a=n.adaptive,i=a===void 0?!0:a,s=n.roundOffsets,c=s===void 0?!0:s,u={placement:hl(t.placement),variation:nh(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:o,isFixed:t.options.strategy==="fixed"};t.modifiersData.popperOffsets!=null&&(t.styles.popper=Object.assign({},t.styles.popper,IL(Object.assign({},u,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:i,roundOffsets:c})))),t.modifiersData.arrow!=null&&(t.styles.arrow=Object.assign({},t.styles.arrow,IL(Object.assign({},u,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:c})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})}const Gwe={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:qwe,data:{}};var _0={passive:!0};function Ywe(e){var t=e.state,n=e.instance,r=e.options,o=r.scroll,a=o===void 0?!0:o,i=r.resize,s=i===void 0?!0:i,c=Di(t.elements.popper),u=[].concat(t.scrollParents.reference,t.scrollParents.popper);return a&&u.forEach(function(f){f.addEventListener("scroll",n.update,_0)}),s&&c.addEventListener("resize",n.update,_0),function(){a&&u.forEach(function(f){f.removeEventListener("scroll",n.update,_0)}),s&&c.removeEventListener("resize",n.update,_0)}}const Kwe={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:Ywe,data:{}};var Qwe={left:"right",right:"left",bottom:"top",top:"bottom"};function g1(e){return e.replace(/left|right|bottom|top/g,function(t){return Qwe[t]})}var Xwe={start:"end",end:"start"};function _L(e){return e.replace(/start|end/g,function(t){return Xwe[t]})}function ZD(e){var t=Di(e),n=t.pageXOffset,r=t.pageYOffset;return{scrollLeft:n,scrollTop:r}}function JD(e){return th(Fu(e)).left+ZD(e).scrollLeft}function Zwe(e,t){var n=Di(e),r=Fu(e),o=n.visualViewport,a=r.clientWidth,i=r.clientHeight,s=0,c=0;if(o){a=o.width,i=o.height;var u=R$();(u||!u&&t==="fixed")&&(s=o.offsetLeft,c=o.offsetTop)}return{width:a,height:i,x:s+JD(e),y:c}}function Jwe(e){var t,n=Fu(e),r=ZD(e),o=(t=e.ownerDocument)==null?void 0:t.body,a=Pd(n.scrollWidth,n.clientWidth,o?o.scrollWidth:0,o?o.clientWidth:0),i=Pd(n.scrollHeight,n.clientHeight,o?o.scrollHeight:0,o?o.clientHeight:0),s=-r.scrollLeft+JD(e),c=-r.scrollTop;return pc(o||n).direction==="rtl"&&(s+=Pd(n.clientWidth,o?o.clientWidth:0)-a),{width:a,height:i,x:s,y:c}}function eO(e){var t=pc(e),n=t.overflow,r=t.overflowX,o=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+o+r)}function _$(e){return["html","body","#document"].indexOf(xl(e))>=0?e.ownerDocument.body:rs(e)&&eO(e)?e:_$(BS(e))}function my(e,t){var n;t===void 0&&(t=[]);var r=_$(e),o=r===((n=e.ownerDocument)==null?void 0:n.body),a=Di(r),i=o?[a].concat(a.visualViewport||[],eO(r)?r:[]):r,s=t.concat(i);return o?s:s.concat(my(BS(i)))}function r2(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function eke(e,t){var n=th(e,!1,t==="fixed");return n.top=n.top+e.clientTop,n.left=n.left+e.clientLeft,n.bottom=n.top+e.clientHeight,n.right=n.left+e.clientWidth,n.width=e.clientWidth,n.height=e.clientHeight,n.x=n.left,n.y=n.top,n}function LL(e,t,n){return t===D$?r2(Zwe(e,n)):Gd(t)?eke(t,n):r2(Jwe(Fu(e)))}function tke(e){var t=my(BS(e)),n=["absolute","fixed"].indexOf(pc(e).position)>=0,r=n&&rs(e)?Nb(e):e;return Gd(r)?t.filter(function(o){return Gd(o)&&M$(o,r)&&xl(o)!=="body"}):[]}function nke(e,t,n,r){var o=t==="clippingParents"?tke(e):[].concat(t),a=[].concat(o,[n]),i=a[0],s=a.reduce(function(c,u){var f=LL(e,u,r);return c.top=Pd(f.top,c.top),c.right=ux(f.right,c.right),c.bottom=ux(f.bottom,c.bottom),c.left=Pd(f.left,c.left),c},LL(e,i,r));return s.width=s.right-s.left,s.height=s.bottom-s.top,s.x=s.left,s.y=s.top,s}function L$(e){var t=e.reference,n=e.element,r=e.placement,o=r?hl(r):null,a=r?nh(r):null,i=t.x+t.width/2-n.width/2,s=t.y+t.height/2-n.height/2,c;switch(o){case Va:c={x:i,y:t.y-n.height};break;case ss:c={x:i,y:t.y+t.height};break;case ls:c={x:t.x+t.width,y:s};break;case Wa:c={x:t.x-n.width,y:s};break;default:c={x:t.x,y:t.y}}var u=o?XD(o):null;if(u!=null){var f=u==="y"?"height":"width";switch(a){case Jp:c[u]=c[u]-(t[f]/2-n[f]/2);break;case Gy:c[u]=c[u]+(t[f]/2-n[f]/2);break}}return c}function Yy(e,t){t===void 0&&(t={});var n=t,r=n.placement,o=r===void 0?e.placement:r,a=n.strategy,i=a===void 0?e.strategy:a,s=n.boundary,c=s===void 0?Ewe:s,u=n.rootBoundary,f=u===void 0?D$:u,p=n.elementContext,y=p===void 0?xg:p,g=n.altBoundary,b=g===void 0?!1:g,x=n.padding,E=x===void 0?0:x,S=P$(typeof E!="number"?E:I$(E,Mb)),w=y===xg?Cwe:xg,C=e.rects.popper,R=e.elements[b?w:y],M=nke(Gd(R)?R:R.contextElement||Fu(e.elements.popper),c,f,i),D=th(e.elements.reference),I=L$({reference:D,element:C,placement:o}),L=r2(Object.assign({},C,I)),F=y===xg?L:D,B={top:M.top-F.top+S.top,bottom:F.bottom-M.bottom+S.bottom,left:M.left-F.left+S.left,right:F.right-M.right+S.right},U=e.modifiersData.offset;if(y===xg&&U){var k=U[o];Object.keys(B).forEach(function($){var j=[ls,ss].indexOf($)>=0?1:-1,V=[Va,ss].indexOf($)>=0?"y":"x";B[$]+=k[V]*j})}return B}function rke(e,t){t===void 0&&(t={});var n=t,r=n.placement,o=n.boundary,a=n.rootBoundary,i=n.padding,s=n.flipVariations,c=n.allowedAutoPlacements,u=c===void 0?O$:c,f=nh(r),p=f?s?NL:NL.filter(function(b){return nh(b)===f}):Mb,y=p.filter(function(b){return u.indexOf(b)>=0});y.length===0&&(y=p);var g=y.reduce(function(b,x){return b[x]=Yy(e,{placement:x,boundary:o,rootBoundary:a,padding:i})[hl(x)],b},{});return Object.keys(g).sort(function(b,x){return g[b]-g[x]})}function oke(e){if(hl(e)===YD)return[];var t=g1(e);return[_L(e),t,_L(t)]}function ake(e){var t=e.state,n=e.options,r=e.name;if(!t.modifiersData[r]._skip){for(var o=n.mainAxis,a=o===void 0?!0:o,i=n.altAxis,s=i===void 0?!0:i,c=n.fallbackPlacements,u=n.padding,f=n.boundary,p=n.rootBoundary,y=n.altBoundary,g=n.flipVariations,b=g===void 0?!0:g,x=n.allowedAutoPlacements,E=t.options.placement,S=hl(E),w=S===E,C=c||(w||!b?[g1(E)]:oke(E)),R=[E].concat(C).reduce(function(re,ne){return re.concat(hl(ne)===YD?rke(t,{placement:ne,boundary:f,rootBoundary:p,padding:u,flipVariations:b,allowedAutoPlacements:x}):ne)},[]),M=t.rects.reference,D=t.rects.popper,I=new Map,L=!0,F=R[0],B=0;B<R.length;B++){var U=R[B],k=hl(U),$=nh(U)===Jp,j=[Va,ss].indexOf(k)>=0,V=j?"width":"height",z=Yy(t,{placement:U,boundary:f,rootBoundary:p,altBoundary:y,padding:u}),K=j?$?ls:Wa:$?ss:Va;M[V]>D[V]&&(K=g1(K));var Y=g1(K),te=[];if(a&&te.push(z[k]<=0),s&&te.push(z[K]<=0,z[Y]<=0),te.every(function(re){return re})){F=U,L=!1;break}I.set(U,te)}if(L)for(var _=b?3:1,Z=function(re){var ne=R.find(function(X){var ie=I.get(X);if(ie)return ie.slice(0,re).every(function(ae){return ae})});if(ne)return F=ne,"break"},J=_;J>0;J--){var W=Z(J);if(W==="break")break}t.placement!==F&&(t.modifiersData[r]._skip=!0,t.placement=F,t.reset=!0)}}const ike={name:"flip",enabled:!0,phase:"main",fn:ake,requiresIfExists:["offset"],data:{_skip:!1}};function FL(e,t,n){return n===void 0&&(n={x:0,y:0}),{top:e.top-t.height-n.y,right:e.right-t.width+n.x,bottom:e.bottom-t.height+n.y,left:e.left-t.width-n.x}}function jL(e){return[Va,ls,ss,Wa].some(function(t){return e[t]>=0})}function ske(e){var t=e.state,n=e.name,r=t.rects.reference,o=t.rects.popper,a=t.modifiersData.preventOverflow,i=Yy(t,{elementContext:"reference"}),s=Yy(t,{altBoundary:!0}),c=FL(i,r),u=FL(s,o,a),f=jL(c),p=jL(u);t.modifiersData[n]={referenceClippingOffsets:c,popperEscapeOffsets:u,isReferenceHidden:f,hasPopperEscaped:p},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":f,"data-popper-escaped":p})}const lke={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:ske};function cke(e,t,n){var r=hl(e),o=[Wa,Va].indexOf(r)>=0?-1:1,a=typeof n=="function"?n(Object.assign({},t,{placement:e})):n,i=a[0],s=a[1];return i=i||0,s=(s||0)*o,[Wa,ls].indexOf(r)>=0?{x:s,y:i}:{x:i,y:s}}function uke(e){var t=e.state,n=e.options,r=e.name,o=n.offset,a=o===void 0?[0,0]:o,i=O$.reduce(function(f,p){return f[p]=cke(p,t.rects,a),f},{}),s=i[t.placement],c=s.x,u=s.y;t.modifiersData.popperOffsets!=null&&(t.modifiersData.popperOffsets.x+=c,t.modifiersData.popperOffsets.y+=u),t.modifiersData[r]=i}const dke={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:uke};function fke(e){var t=e.state,n=e.name;t.modifiersData[n]=L$({reference:t.rects.reference,element:t.rects.popper,placement:t.placement})}const pke={name:"popperOffsets",enabled:!0,phase:"read",fn:fke,data:{}};function hke(e){return e==="x"?"y":"x"}function mke(e){var t=e.state,n=e.options,r=e.name,o=n.mainAxis,a=o===void 0?!0:o,i=n.altAxis,s=i===void 0?!1:i,c=n.boundary,u=n.rootBoundary,f=n.altBoundary,p=n.padding,y=n.tether,g=y===void 0?!0:y,b=n.tetherOffset,x=b===void 0?0:b,E=Yy(t,{boundary:c,rootBoundary:u,padding:p,altBoundary:f}),S=hl(t.placement),w=nh(t.placement),C=!w,R=XD(S),M=hke(R),D=t.modifiersData.popperOffsets,I=t.rects.reference,L=t.rects.popper,F=typeof x=="function"?x(Object.assign({},t.rects,{placement:t.placement})):x,B=typeof F=="number"?{mainAxis:F,altAxis:F}:Object.assign({mainAxis:0,altAxis:0},F),U=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,k={x:0,y:0};if(D){if(a){var $,j=R==="y"?Va:Wa,V=R==="y"?ss:ls,z=R==="y"?"height":"width",K=D[R],Y=K+E[j],te=K-E[V],_=g?-L[z]/2:0,Z=w===Jp?I[z]:L[z],J=w===Jp?-L[z]:-I[z],W=t.elements.arrow,re=g&&W?QD(W):{width:0,height:0},ne=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:N$(),X=ne[j],ie=ne[V],ae=hy(0,I[z],re[z]),fe=C?I[z]/2-_-ae-X-B.mainAxis:Z-ae-X-B.mainAxis,xe=C?-I[z]/2+_+ae+ie+B.mainAxis:J+ae+ie+B.mainAxis,ge=t.elements.arrow&&Nb(t.elements.arrow),Re=ge?R==="y"?ge.clientTop||0:ge.clientLeft||0:0,de=($=U?.[R])!=null?$:0,me=K+fe-de-Re,Qe=K+xe-de,Me=hy(g?ux(Y,me):Y,K,g?Pd(te,Qe):te);D[R]=Me,k[R]=Me-K}if(s){var we,Se=R==="x"?Va:Wa,dt=R==="x"?ss:ls,ze=D[M],tt=M==="y"?"height":"width",Ze=ze+E[Se],qt=ze-E[dt],Vt=[Va,Wa].indexOf(S)!==-1,Mt=(we=U?.[M])!=null?we:0,ke=Vt?Ze:ze-I[tt]-L[tt]-Mt+B.altAxis,Ne=Vt?ze+I[tt]+L[tt]-Mt-B.altAxis:qt,lt=g&&Vt?Bwe(ke,ze,Ne):hy(g?ke:Ze,ze,g?Ne:qt);D[M]=lt,k[M]=lt-ze}t.modifiersData[r]=k}}const gke={name:"preventOverflow",enabled:!0,phase:"main",fn:mke,requiresIfExists:["offset"]};function yke(e){return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}}function bke(e){return e===Di(e)||!rs(e)?ZD(e):yke(e)}function vke(e){var t=e.getBoundingClientRect(),n=eh(t.width)/e.offsetWidth||1,r=eh(t.height)/e.offsetHeight||1;return n!==1||r!==1}function xke(e,t,n){n===void 0&&(n=!1);var r=rs(t),o=rs(t)&&vke(t),a=Fu(t),i=th(e,o,n),s={scrollLeft:0,scrollTop:0},c={x:0,y:0};return(r||!r&&!n)&&((xl(t)!=="body"||eO(a))&&(s=bke(t)),rs(t)?(c=th(t,!0),c.x+=t.clientLeft,c.y+=t.clientTop):a&&(c.x=JD(a))),{x:i.left+s.scrollLeft-c.x,y:i.top+s.scrollTop-c.y,width:i.width,height:i.height}}function Ske(e){var t=new Map,n=new Set,r=[];e.forEach(function(a){t.set(a.name,a)});function o(a){n.add(a.name);var i=[].concat(a.requires||[],a.requiresIfExists||[]);i.forEach(function(s){if(!n.has(s)){var c=t.get(s);c&&o(c)}}),r.push(a)}return e.forEach(function(a){n.has(a.name)||o(a)}),r}function Eke(e){var t=Ske(e);return Pwe.reduce(function(n,r){return n.concat(t.filter(function(o){return o.phase===r}))},[])}function Cke(e){var t;return function(){return t||(t=new Promise(function(n){Promise.resolve().then(function(){t=void 0,n(e())})})),t}}function Tke(e){var t=e.reduce(function(n,r){var o=n[r.name];return n[r.name]=o?Object.assign({},o,r,{options:Object.assign({},o.options,r.options),data:Object.assign({},o.data,r.data)}):r,n},{});return Object.keys(t).map(function(n){return t[n]})}var BL={placement:"bottom",modifiers:[],strategy:"absolute"};function $L(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return!t.some(function(r){return!(r&&typeof r.getBoundingClientRect=="function")})}function wke(e){e===void 0&&(e={});var t=e,n=t.defaultModifiers,r=n===void 0?[]:n,o=t.defaultOptions,a=o===void 0?BL:o;return function(i,s,c){c===void 0&&(c=a);var u={placement:"bottom",orderedModifiers:[],options:Object.assign({},BL,a),modifiersData:{},elements:{reference:i,popper:s},attributes:{},styles:{}},f=[],p=!1,y={state:u,setOptions:function(x){var E=typeof x=="function"?x(u.options):x;b(),u.options=Object.assign({},a,u.options,E),u.scrollParents={reference:Gd(i)?my(i):i.contextElement?my(i.contextElement):[],popper:my(s)};var S=Eke(Tke([].concat(r,u.options.modifiers)));return u.orderedModifiers=S.filter(function(w){return w.enabled}),g(),y.update()},forceUpdate:function(){if(!p){var x=u.elements,E=x.reference,S=x.popper;if($L(E,S)){u.rects={reference:xke(E,Nb(S),u.options.strategy==="fixed"),popper:QD(S)},u.reset=!1,u.placement=u.options.placement,u.orderedModifiers.forEach(function(L){return u.modifiersData[L.name]=Object.assign({},L.data)});for(var w=0;w<u.orderedModifiers.length;w++){if(u.reset===!0){u.reset=!1,w=-1;continue}var C=u.orderedModifiers[w],R=C.fn,M=C.options,D=M===void 0?{}:M,I=C.name;typeof R=="function"&&(u=R({state:u,options:D,name:I,instance:y})||u)}}}},update:Cke(function(){return new Promise(function(x){y.forceUpdate(),x(u)})}),destroy:function(){b(),p=!0}};if(!$L(i,s))return y;y.setOptions(c).then(function(x){!p&&c.onFirstUpdate&&c.onFirstUpdate(x)});function g(){u.orderedModifiers.forEach(function(x){var E=x.name,S=x.options,w=S===void 0?{}:S,C=x.effect;if(typeof C=="function"){var R=C({state:u,name:E,instance:y,options:w}),M=function(){};f.push(R||M)}})}function b(){f.forEach(function(x){return x()}),f=[]}return y}}var kke=[Kwe,pke,Gwe,Lwe,dke,ike,gke,Uwe,lke],Ake=wke({defaultModifiers:kke});function Dke(e){return Ut("MuiPopper",e)}Lt("MuiPopper",["root"]);function Oke(e,t){if(t==="ltr")return e;switch(e){case"bottom-end":return"bottom-start";case"bottom-start":return"bottom-end";case"top-end":return"top-start";case"top-start":return"top-end";default:return e}}function o2(e){return typeof e=="function"?e():e}function Rke(e){return e.nodeType!==void 0}const Mke=e=>{const{classes:t}=e;return zt({root:["root"]},Dke,t)},Nke={},Pke=T.forwardRef(function(e,t){const{anchorEl:n,children:r,direction:o,disablePortal:a,modifiers:i,open:s,placement:c,popperOptions:u,popperRef:f,slotProps:p={},slots:y={},TransitionProps:g,ownerState:b,...x}=e,E=T.useRef(null),S=cr(E,t),w=T.useRef(null),C=cr(w,f),R=T.useRef(C);Io(()=>{R.current=C},[C]),T.useImperativeHandle(f,()=>w.current,[]);const M=Oke(c,o),[D,I]=T.useState(M),[L,F]=T.useState(o2(n));T.useEffect(()=>{w.current&&w.current.forceUpdate()}),T.useEffect(()=>{n&&F(o2(n))},[n]),Io(()=>{if(!L||!s)return;const j=K=>{I(K.placement)};let V=[{name:"preventOverflow",options:{altBoundary:a}},{name:"flip",options:{altBoundary:a}},{name:"onUpdate",enabled:!0,phase:"afterWrite",fn:({state:K})=>{j(K)}}];i!=null&&(V=V.concat(i)),u&&u.modifiers!=null&&(V=V.concat(u.modifiers));const z=Ake(L,E.current,{placement:M,...u,modifiers:V});return R.current(z),()=>{z.destroy(),R.current(null)}},[L,a,i,s,u,M]);const B={placement:D};g!==null&&(B.TransitionProps=g);const U=Mke(e),k=y.root??"div",$=mr({elementType:k,externalSlotProps:p.root,externalForwardedProps:x,additionalProps:{role:"tooltip",ref:S},ownerState:e,className:U.root});return m.jsx(k,{...$,children:typeof r=="function"?r(B):r})}),Ike=T.forwardRef(function(e,t){const{anchorEl:n,children:r,container:o,direction:a="ltr",disablePortal:i=!1,keepMounted:s=!1,modifiers:c,open:u,placement:f="bottom",popperOptions:p=Nke,popperRef:y,style:g,transition:b=!1,slotProps:x={},slots:E={},...S}=e,[w,C]=T.useState(!0),R=()=>{C(!1)},M=()=>{C(!0)};if(!s&&!u&&(!b||w))return null;let D;if(o)D=o;else if(n){const F=o2(n);D=F&&Rke(F)?Po(F).body:Po(null).body}const I=!u&&s&&(!b||w)?"none":void 0,L=b?{in:u,onEnter:R,onExited:M}:void 0;return m.jsx(a$,{disablePortal:i,container:D,children:m.jsx(Pke,{anchorEl:n,direction:a,disablePortal:i,modifiers:c,ref:t,open:b?!w:u,placement:f,popperOptions:p,popperRef:y,slotProps:x,slots:E,...S,style:{position:"fixed",top:0,left:0,display:I,...g},TransitionProps:L,children:r})})}),_ke=Pe(Ike,{name:"MuiPopper",slot:"Root"})({}),tO=T.forwardRef(function(e,t){const n=js(),r=An({props:e,name:"MuiPopper"}),{anchorEl:o,component:a,components:i,componentsProps:s,container:c,disablePortal:u,keepMounted:f,modifiers:p,open:y,placement:g,popperOptions:b,popperRef:x,transition:E,slots:S,slotProps:w,...C}=r,R=S?.root??i?.Root,M={anchorEl:o,container:c,disablePortal:u,keepMounted:f,modifiers:p,open:y,placement:g,popperOptions:b,popperRef:x,transition:E,...C};return m.jsx(_ke,{as:a,direction:n?"rtl":"ltr",slots:{root:R},slotProps:w??s,...M,ref:t})});function Lke(e){return Ut("MuiListSubheader",e)}Lt("MuiListSubheader",["root","colorPrimary","colorInherit","gutters","inset","sticky"]);const Fke=e=>{const{classes:t,color:n,disableGutters:r,inset:o,disableSticky:a}=e,i={root:["root",n!=="default"&&`color${bt(n)}`,!r&&"gutters",o&&"inset",!a&&"sticky"]};return zt(i,Lke,t)},jke=Pe("li",{name:"MuiListSubheader",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.color!=="default"&&t[`color${bt(n.color)}`],!n.disableGutters&&t.gutters,n.inset&&t.inset,!n.disableSticky&&t.sticky]}})(Pn(({theme:e})=>({boxSizing:"border-box",lineHeight:"48px",listStyle:"none",color:(e.vars||e).palette.text.secondary,fontFamily:e.typography.fontFamily,fontWeight:e.typography.fontWeightMedium,fontSize:e.typography.pxToRem(14),variants:[{props:{color:"primary"},style:{color:(e.vars||e).palette.primary.main}},{props:{color:"inherit"},style:{color:"inherit"}},{props:({ownerState:t})=>!t.disableGutters,style:{paddingLeft:16,paddingRight:16}},{props:({ownerState:t})=>t.inset,style:{paddingLeft:72}},{props:({ownerState:t})=>!t.disableSticky,style:{position:"sticky",top:0,zIndex:1,backgroundColor:(e.vars||e).palette.background.paper}}]}))),a2=T.forwardRef(function(e,t){const n=An({props:e,name:"MuiListSubheader"}),{className:r,color:o="default",component:a="li",disableGutters:i=!1,disableSticky:s=!1,inset:c=!1,...u}=n,f={...n,color:o,component:a,disableGutters:i,disableSticky:s,inset:c},p=Fke(f);return m.jsx(jke,{as:a,className:Ot(p.root,r),ref:t,ownerState:f,...u})});a2&&(a2.muiSkipListHighlight=!0);const Bke=Fn(m.jsx("path",{d:"M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2zm5 13.59L15.59 17 12 13.41 8.41 17 7 15.59 10.59 12 7 8.41 8.41 7 12 10.59 15.59 7 17 8.41 13.41 12 17 15.59z"}));function $ke(e){return Ut("MuiChip",e)}const Jn=Lt("MuiChip",["root","sizeSmall","sizeMedium","colorDefault","colorError","colorInfo","colorPrimary","colorSecondary","colorSuccess","colorWarning","disabled","clickable","clickableColorPrimary","clickableColorSecondary","deletable","deletableColorPrimary","deletableColorSecondary","outlined","filled","outlinedPrimary","outlinedSecondary","filledPrimary","filledSecondary","avatar","avatarSmall","avatarMedium","avatarColorPrimary","avatarColorSecondary","icon","iconSmall","iconMedium","iconColorPrimary","iconColorSecondary","label","labelSmall","labelMedium","deleteIcon","deleteIconSmall","deleteIconMedium","deleteIconColorPrimary","deleteIconColorSecondary","deleteIconOutlinedColorPrimary","deleteIconOutlinedColorSecondary","deleteIconFilledColorPrimary","deleteIconFilledColorSecondary","focusVisible"]),zke=e=>{const{classes:t,disabled:n,size:r,color:o,iconColor:a,onDelete:i,clickable:s,variant:c}=e,u={root:["root",c,n&&"disabled",`size${bt(r)}`,`color${bt(o)}`,s&&"clickable",s&&`clickableColor${bt(o)}`,i&&"deletable",i&&`deletableColor${bt(o)}`,`${c}${bt(o)}`],label:["label",`label${bt(r)}`],avatar:["avatar",`avatar${bt(r)}`,`avatarColor${bt(o)}`],icon:["icon",`icon${bt(r)}`,`iconColor${bt(a)}`],deleteIcon:["deleteIcon",`deleteIcon${bt(r)}`,`deleteIconColor${bt(o)}`,`deleteIcon${bt(c)}Color${bt(o)}`]};return zt(u,$ke,t)},Hke=Pe("div",{name:"MuiChip",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e,{color:r,iconColor:o,clickable:a,onDelete:i,size:s,variant:c}=n;return[{[`& .${Jn.avatar}`]:t.avatar},{[`& .${Jn.avatar}`]:t[`avatar${bt(s)}`]},{[`& .${Jn.avatar}`]:t[`avatarColor${bt(r)}`]},{[`& .${Jn.icon}`]:t.icon},{[`& .${Jn.icon}`]:t[`icon${bt(s)}`]},{[`& .${Jn.icon}`]:t[`iconColor${bt(o)}`]},{[`& .${Jn.deleteIcon}`]:t.deleteIcon},{[`& .${Jn.deleteIcon}`]:t[`deleteIcon${bt(s)}`]},{[`& .${Jn.deleteIcon}`]:t[`deleteIconColor${bt(r)}`]},{[`& .${Jn.deleteIcon}`]:t[`deleteIcon${bt(c)}Color${bt(r)}`]},t.root,t[`size${bt(s)}`],t[`color${bt(r)}`],a&&t.clickable,a&&r!=="default"&&t[`clickableColor${bt(r)})`],i&&t.deletable,i&&r!=="default"&&t[`deletableColor${bt(r)}`],t[c],t[`${c}${bt(r)}`]]}})(Pn(({theme:e})=>{const t=e.palette.mode==="light"?e.palette.grey[700]:e.palette.grey[300];return{maxWidth:"100%",fontFamily:e.typography.fontFamily,fontSize:e.typography.pxToRem(13),display:"inline-flex",alignItems:"center",justifyContent:"center",height:32,lineHeight:1.5,color:(e.vars||e).palette.text.primary,backgroundColor:(e.vars||e).palette.action.selected,borderRadius:32/2,whiteSpace:"nowrap",transition:e.transitions.create(["background-color","box-shadow"]),cursor:"unset",outline:0,textDecoration:"none",border:0,padding:0,verticalAlign:"middle",boxSizing:"border-box",[`&.${Jn.disabled}`]:{opacity:(e.vars||e).palette.action.disabledOpacity,pointerEvents:"none"},[`& .${Jn.avatar}`]:{marginLeft:5,marginRight:-6,width:24,height:24,color:e.vars?e.vars.palette.Chip.defaultAvatarColor:t,fontSize:e.typography.pxToRem(12)},[`& .${Jn.avatarColorPrimary}`]:{color:(e.vars||e).palette.primary.contrastText,backgroundColor:(e.vars||e).palette.primary.dark},[`& .${Jn.avatarColorSecondary}`]:{color:(e.vars||e).palette.secondary.contrastText,backgroundColor:(e.vars||e).palette.secondary.dark},[`& .${Jn.avatarSmall}`]:{marginLeft:4,marginRight:-4,width:18,height:18,fontSize:e.typography.pxToRem(10)},[`& .${Jn.icon}`]:{marginLeft:5,marginRight:-6},[`& .${Jn.deleteIcon}`]:{WebkitTapHighlightColor:"transparent",color:e.alpha((e.vars||e).palette.text.primary,.26),fontSize:22,cursor:"pointer",margin:"0 5px 0 -6px","&:hover":{color:e.alpha((e.vars||e).palette.text.primary,.4)}},variants:[{props:{size:"small"},style:{height:24,[`& .${Jn.icon}`]:{fontSize:18,marginLeft:4,marginRight:-4},[`& .${Jn.deleteIcon}`]:{fontSize:16,marginRight:4,marginLeft:-4}}},...Object.entries(e.palette).filter(Sa(["contrastText"])).map(([n])=>({props:{color:n},style:{backgroundColor:(e.vars||e).palette[n].main,color:(e.vars||e).palette[n].contrastText,[`& .${Jn.deleteIcon}`]:{color:e.alpha((e.vars||e).palette[n].contrastText,.7),"&:hover, &:active":{color:(e.vars||e).palette[n].contrastText}}}})),{props:n=>n.iconColor===n.color,style:{[`& .${Jn.icon}`]:{color:e.vars?e.vars.palette.Chip.defaultIconColor:t}}},{props:n=>n.iconColor===n.color&&n.color!=="default",style:{[`& .${Jn.icon}`]:{color:"inherit"}}},{props:{onDelete:!0},style:{[`&.${Jn.focusVisible}`]:{backgroundColor:e.alpha((e.vars||e).palette.action.selected,`${(e.vars||e).palette.action.selectedOpacity} + ${(e.vars||e).palette.action.focusOpacity}`)}}},...Object.entries(e.palette).filter(Sa(["dark"])).map(([n])=>({props:{color:n,onDelete:!0},style:{[`&.${Jn.focusVisible}`]:{background:(e.vars||e).palette[n].dark}}})),{props:{clickable:!0},style:{userSelect:"none",WebkitTapHighlightColor:"transparent",cursor:"pointer","&:hover":{backgroundColor:e.alpha((e.vars||e).palette.action.selected,`${(e.vars||e).palette.action.selectedOpacity} + ${(e.vars||e).palette.action.hoverOpacity}`)},[`&.${Jn.focusVisible}`]:{backgroundColor:e.alpha((e.vars||e).palette.action.selected,`${(e.vars||e).palette.action.selectedOpacity} + ${(e.vars||e).palette.action.focusOpacity}`)},"&:active":{boxShadow:(e.vars||e).shadows[1]}}},...Object.entries(e.palette).filter(Sa(["dark"])).map(([n])=>({props:{color:n,clickable:!0},style:{[`&:hover, &.${Jn.focusVisible}`]:{backgroundColor:(e.vars||e).palette[n].dark}}})),{props:{variant:"outlined"},style:{backgroundColor:"transparent",border:e.vars?`1px solid ${e.vars.palette.Chip.defaultBorder}`:`1px solid ${e.palette.mode==="light"?e.palette.grey[400]:e.palette.grey[700]}`,[`&.${Jn.clickable}:hover`]:{backgroundColor:(e.vars||e).palette.action.hover},[`&.${Jn.focusVisible}`]:{backgroundColor:(e.vars||e).palette.action.focus},[`& .${Jn.avatar}`]:{marginLeft:4},[`& .${Jn.avatarSmall}`]:{marginLeft:2},[`& .${Jn.icon}`]:{marginLeft:4},[`& .${Jn.iconSmall}`]:{marginLeft:2},[`& .${Jn.deleteIcon}`]:{marginRight:5},[`& .${Jn.deleteIconSmall}`]:{marginRight:3}}},...Object.entries(e.palette).filter(Sa()).map(([n])=>({props:{variant:"outlined",color:n},style:{color:(e.vars||e).palette[n].main,border:`1px solid ${e.alpha((e.vars||e).palette[n].main,.7)}`,[`&.${Jn.clickable}:hover`]:{backgroundColor:e.alpha((e.vars||e).palette[n].main,(e.vars||e).palette.action.hoverOpacity)},[`&.${Jn.focusVisible}`]:{backgroundColor:e.alpha((e.vars||e).palette[n].main,(e.vars||e).palette.action.focusOpacity)},[`& .${Jn.deleteIcon}`]:{color:e.alpha((e.vars||e).palette[n].main,.7),"&:hover, &:active":{color:(e.vars||e).palette[n].main}}}}))]}})),Uke=Pe("span",{name:"MuiChip",slot:"Label",overridesResolver:(e,t)=>{const{ownerState:n}=e,{size:r}=n;return[t.label,t[`label${bt(r)}`]]}})({overflow:"hidden",textOverflow:"ellipsis",paddingLeft:12,paddingRight:12,whiteSpace:"nowrap",variants:[{props:{variant:"outlined"},style:{paddingLeft:11,paddingRight:11}},{props:{size:"small"},style:{paddingLeft:8,paddingRight:8}},{props:{size:"small",variant:"outlined"},style:{paddingLeft:7,paddingRight:7}}]});function zL(e){return e.key==="Backspace"||e.key==="Delete"}const F$=T.forwardRef(function(e,t){const n=An({props:e,name:"MuiChip"}),{avatar:r,className:o,clickable:a,color:i="default",component:s,deleteIcon:c,disabled:u=!1,icon:f,label:p,onClick:y,onDelete:g,onKeyDown:b,onKeyUp:x,size:E="medium",variant:S="filled",tabIndex:w,skipFocusWhenDisabled:C=!1,slots:R={},slotProps:M={},...D}=n,I=T.useRef(null),L=cr(I,t),F=ne=>{ne.stopPropagation(),g&&g(ne)},B=ne=>{ne.currentTarget===ne.target&&zL(ne)&&ne.preventDefault(),b&&b(ne)},U=ne=>{ne.currentTarget===ne.target&&g&&zL(ne)&&g(ne),x&&x(ne)},k=a!==!1&&y?!0:a,$=k||g?Wd:s||"div",j={...n,component:$,disabled:u,size:E,color:i,iconColor:T.isValidElement(f)&&f.props.color||i,onDelete:!!g,clickable:k,variant:S},V=zke(j),z=$===Wd?{component:s||"div",focusVisibleClassName:V.focusVisible,...g&&{disableRipple:!0}}:{};let K=null;g&&(K=c&&T.isValidElement(c)?T.cloneElement(c,{className:Ot(c.props.className,V.deleteIcon),onClick:F}):m.jsx(Bke,{className:V.deleteIcon,onClick:F}));let Y=null;r&&T.isValidElement(r)&&(Y=T.cloneElement(r,{className:Ot(V.avatar,r.props.className)}));let te=null;f&&T.isValidElement(f)&&(te=T.cloneElement(f,{className:Ot(V.icon,f.props.className)}));const _={slots:R,slotProps:M},[Z,J]=tr("root",{elementType:Hke,externalForwardedProps:{..._,...D},ownerState:j,shouldForwardComponentProp:!0,ref:L,className:Ot(V.root,o),additionalProps:{disabled:k&&u?!0:void 0,tabIndex:C&&u?-1:w,...z},getSlotProps:ne=>({...ne,onClick:X=>{ne.onClick?.(X),y?.(X)},onKeyDown:X=>{ne.onKeyDown?.(X),B(X)},onKeyUp:X=>{ne.onKeyUp?.(X),U(X)}})}),[W,re]=tr("label",{elementType:Uke,externalForwardedProps:_,ownerState:j,className:V.label});return m.jsxs(Z,{as:$,...J,children:[Y||te,m.jsx(W,{...re,children:p}),K]})}),Vke=Fn(m.jsx("path",{d:"M19 6.41L17.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 Wke(e){return Ut("MuiAutocomplete",e)}const Bn=Lt("MuiAutocomplete",["root","expanded","fullWidth","focused","focusVisible","tag","tagSizeSmall","tagSizeMedium","hasPopupIcon","hasClearIcon","inputRoot","input","inputFocused","endAdornment","clearIndicator","popupIndicator","popupIndicatorOpen","popper","popperDisablePortal","paper","listbox","loading","noOptions","option","groupLabel","groupUl"]);var HL,UL;const qke=e=>{const{classes:t,disablePortal:n,expanded:r,focused:o,fullWidth:a,hasClearIcon:i,hasPopupIcon:s,inputFocused:c,popupOpen:u,size:f}=e,p={root:["root",r&&"expanded",o&&"focused",a&&"fullWidth",i&&"hasClearIcon",s&&"hasPopupIcon"],inputRoot:["inputRoot"],input:["input",c&&"inputFocused"],tag:["tag",`tagSize${bt(f)}`],endAdornment:["endAdornment"],clearIndicator:["clearIndicator"],popupIndicator:["popupIndicator",u&&"popupIndicatorOpen"],popper:["popper",n&&"popperDisablePortal"],paper:["paper"],listbox:["listbox"],loading:["loading"],noOptions:["noOptions"],option:["option"],groupLabel:["groupLabel"],groupUl:["groupUl"]};return zt(p,Wke,t)},Gke=Pe("div",{name:"MuiAutocomplete",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e,{fullWidth:r,hasClearIcon:o,hasPopupIcon:a,inputFocused:i,size:s}=n;return[{[`& .${Bn.tag}`]:t.tag},{[`& .${Bn.tag}`]:t[`tagSize${bt(s)}`]},{[`& .${Bn.inputRoot}`]:t.inputRoot},{[`& .${Bn.input}`]:t.input},{[`& .${Bn.input}`]:i&&t.inputFocused},t.root,r&&t.fullWidth,a&&t.hasPopupIcon,o&&t.hasClearIcon]}})({[`&.${Bn.focused} .${Bn.clearIndicator}`]:{visibility:"visible"},"@media (pointer: fine)":{[`&:hover .${Bn.clearIndicator}`]:{visibility:"visible"}},[`& .${Bn.tag}`]:{margin:3,maxWidth:"calc(100% - 6px)"},[`& .${Bn.inputRoot}`]:{[`.${Bn.hasPopupIcon}&, .${Bn.hasClearIcon}&`]:{paddingRight:30},[`.${Bn.hasPopupIcon}.${Bn.hasClearIcon}&`]:{paddingRight:56},[`& .${Bn.input}`]:{width:0,minWidth:30}},[`& .${fu.root}`]:{paddingBottom:1,"& .MuiInput-input":{padding:"4px 4px 4px 0px"}},[`& .${fu.root}.${pi.sizeSmall}`]:{[`& .${fu.input}`]:{padding:"2px 4px 3px 0"}},[`& .${Vi.root}`]:{padding:9,[`.${Bn.hasPopupIcon}&, .${Bn.hasClearIcon}&`]:{paddingRight:39},[`.${Bn.hasPopupIcon}.${Bn.hasClearIcon}&`]:{paddingRight:65},[`& .${Bn.input}`]:{padding:"7.5px 4px 7.5px 5px"},[`& .${Bn.endAdornment}`]:{right:9}},[`& .${Vi.root}.${pi.sizeSmall}`]:{paddingTop:6,paddingBottom:6,paddingLeft:6,[`& .${Bn.input}`]:{padding:"2.5px 4px 2.5px 8px"}},[`& .${hi.root}`]:{paddingTop:19,paddingLeft:8,[`.${Bn.hasPopupIcon}&, .${Bn.hasClearIcon}&`]:{paddingRight:39},[`.${Bn.hasPopupIcon}.${Bn.hasClearIcon}&`]:{paddingRight:65},[`& .${hi.input}`]:{padding:"7px 4px"},[`& .${Bn.endAdornment}`]:{right:9}},[`& .${hi.root}.${pi.sizeSmall}`]:{paddingBottom:1,[`& .${hi.input}`]:{padding:"2.5px 4px"}},[`& .${pi.hiddenLabel}`]:{paddingTop:8},[`& .${hi.root}.${pi.hiddenLabel}`]:{paddingTop:0,paddingBottom:0,[`& .${Bn.input}`]:{paddingTop:16,paddingBottom:17}},[`& .${hi.root}.${pi.hiddenLabel}.${pi.sizeSmall}`]:{[`& .${Bn.input}`]:{paddingTop:8,paddingBottom:9}},[`& .${Bn.input}`]:{flexGrow:1,textOverflow:"ellipsis",opacity:0},variants:[{props:{fullWidth:!0},style:{width:"100%"}},{props:{size:"small"},style:{[`& .${Bn.tag}`]:{margin:2,maxWidth:"calc(100% - 4px)"}}},{props:{inputFocused:!0},style:{[`& .${Bn.input}`]:{opacity:1}}},{props:{multiple:!0},style:{[`& .${Bn.inputRoot}`]:{flexWrap:"wrap"}}}]}),Yke=Pe("div",{name:"MuiAutocomplete",slot:"EndAdornment"})({position:"absolute",right:0,top:"50%",transform:"translate(0, -50%)"}),Kke=Pe(gs,{name:"MuiAutocomplete",slot:"ClearIndicator"})({marginRight:-2,padding:4,visibility:"hidden"}),Qke=Pe(gs,{name:"MuiAutocomplete",slot:"PopupIndicator",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.popupIndicator,n.popupOpen&&t.popupIndicatorOpen]}})({padding:2,marginRight:-2,variants:[{props:{popupOpen:!0},style:{transform:"rotate(180deg)"}}]}),Xke=Pe(tO,{name:"MuiAutocomplete",slot:"Popper",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[{[`& .${Bn.option}`]:t.option},t.popper,n.disablePortal&&t.popperDisablePortal]}})(Pn(({theme:e})=>({zIndex:(e.vars||e).zIndex.modal,variants:[{props:{disablePortal:!0},style:{position:"absolute"}}]}))),Zke=Pe(rf,{name:"MuiAutocomplete",slot:"Paper"})(Pn(({theme:e})=>({...e.typography.body1,overflow:"auto"}))),Jke=Pe("div",{name:"MuiAutocomplete",slot:"Loading"})(Pn(({theme:e})=>({color:(e.vars||e).palette.text.secondary,padding:"14px 16px"}))),e2e=Pe("div",{name:"MuiAutocomplete",slot:"NoOptions"})(Pn(({theme:e})=>({color:(e.vars||e).palette.text.secondary,padding:"14px 16px"}))),t2e=Pe("ul",{name:"MuiAutocomplete",slot:"Listbox"})(Pn(({theme:e})=>({listStyle:"none",margin:0,padding:"8px 0",maxHeight:"40vh",overflow:"auto",position:"relative",[`& .${Bn.option}`]:{minHeight:48,display:"flex",overflow:"hidden",justifyContent:"flex-start",alignItems:"center",cursor:"pointer",paddingTop:6,boxSizing:"border-box",outline:"0",WebkitTapHighlightColor:"transparent",paddingBottom:6,paddingLeft:16,paddingRight:16,[e.breakpoints.up("sm")]:{minHeight:"auto"},[`&.${Bn.focused}`]:{backgroundColor:(e.vars||e).palette.action.hover,"@media (hover: none)":{backgroundColor:"transparent"}},'&[aria-disabled="true"]':{opacity:(e.vars||e).palette.action.disabledOpacity,pointerEvents:"none"},[`&.${Bn.focusVisible}`]:{backgroundColor:(e.vars||e).palette.action.focus},'&[aria-selected="true"]':{backgroundColor:e.alpha((e.vars||e).palette.primary.main,(e.vars||e).palette.action.selectedOpacity),[`&.${Bn.focused}`]:{backgroundColor:e.alpha((e.vars||e).palette.primary.main,`${(e.vars||e).palette.action.selectedOpacity} + ${(e.vars||e).palette.action.hoverOpacity}`),"@media (hover: none)":{backgroundColor:(e.vars||e).palette.action.selected}},[`&.${Bn.focusVisible}`]:{backgroundColor:e.alpha((e.vars||e).palette.primary.main,`${(e.vars||e).palette.action.selectedOpacity} + ${(e.vars||e).palette.action.focusOpacity}`)}}}}))),n2e=Pe(a2,{name:"MuiAutocomplete",slot:"GroupLabel"})(Pn(({theme:e})=>({backgroundColor:(e.vars||e).palette.background.paper,top:-8}))),r2e=Pe("ul",{name:"MuiAutocomplete",slot:"GroupUl"})({padding:0,[`& .${Bn.option}`]:{paddingLeft:24}}),i2=T.forwardRef(function(e,t){const n=An({props:e,name:"MuiAutocomplete"}),{autoComplete:r=!1,autoHighlight:o=!1,autoSelect:a=!1,blurOnSelect:i=!1,ChipProps:s,className:c,clearIcon:u=HL||(HL=m.jsx(Vke,{fontSize:"small"})),clearOnBlur:f=!n.freeSolo,clearOnEscape:p=!1,clearText:y="Clear",closeText:g="Close",componentsProps:b,defaultValue:x=n.multiple?[]:null,disableClearable:E=!1,disableCloseOnSelect:S=!1,disabled:w=!1,disabledItemsFocusable:C=!1,disableListWrap:R=!1,disablePortal:M=!1,filterOptions:D,filterSelectedOptions:I=!1,forcePopupIcon:L="auto",freeSolo:F=!1,fullWidth:B=!1,getLimitTagsText:U=sn=>`+${sn}`,getOptionDisabled:k,getOptionKey:$,getOptionLabel:j,isOptionEqualToValue:V,groupBy:z,handleHomeEndKeys:K=!n.freeSolo,id:Y,includeInputInList:te=!1,inputValue:_,limitTags:Z=-1,ListboxComponent:J,ListboxProps:W,loading:re=!1,loadingText:ne="Loading…",multiple:X=!1,noOptionsText:ie="No options",onChange:ae,onClose:fe,onHighlightChange:xe,onInputChange:ge,onOpen:Re,open:de,openOnFocus:me=!1,openText:Qe="Open",options:Me,PaperComponent:we,PopperComponent:Se,popupIcon:dt=UL||(UL=m.jsx(k$,{})),readOnly:ze=!1,renderGroup:tt,renderInput:Ze,renderOption:qt,renderTags:Vt,renderValue:Mt,selectOnFocus:ke=!n.freeSolo,size:Ne="medium",slots:lt={},slotProps:St={},value:ft,...$e}=n,{getRootProps:Ht,getInputProps:$t,getInputLabelProps:pt,getPopupIndicatorProps:Te,getClearProps:Ue,getItemProps:yt,getListboxProps:ht,getOptionProps:Cn,value:On,dirty:In,expanded:pn,id:Gn,popupOpen:Hn,focused:wn,focusedItem:or,anchorEl:Wt,setAnchorEl:he,inputValue:Ae,groupedOptions:Ie}=Swe({...n,componentName:"Autocomplete"}),Ve=!E&&!w&&In&&!ze,ot=(!F||L===!0)&&L!==!1,{onMouseDown:It}=$t(),{ref:Ft,...Rt}=ht(),jt=j||(sn=>sn.label??sn),Nt={...n,disablePortal:M,expanded:pn,focused:wn,fullWidth:B,getOptionLabel:jt,hasClearIcon:Ve,hasPopupIcon:ot,inputFocused:or===-1,popupOpen:Hn,size:Ne},kt=qke(Nt),Et={slots:{paper:we,popper:Se,...lt},slotProps:{chip:s,listbox:W,...b,...St}},[Bt,Tn]=tr("listbox",{elementType:t2e,externalForwardedProps:Et,ownerState:Nt,className:kt.listbox,additionalProps:Rt,ref:Ft}),[nr,Yn]=tr("paper",{elementType:rf,externalForwardedProps:Et,ownerState:Nt,className:kt.paper}),[rn,le]=tr("popper",{elementType:tO,externalForwardedProps:Et,ownerState:Nt,className:kt.popper,additionalProps:{disablePortal:M,style:{width:Wt?Wt.clientWidth:null},role:"presentation",anchorEl:Wt,open:Hn}});let ce;const Be=sn=>({className:kt.tag,disabled:w,...yt(sn)});if(X?On.length>0&&(Vt?ce=Vt(On,Be,Nt):Mt?ce=Mt(On,Be,Nt):ce=On.map((sn,qr)=>{const{key:en,...gr}=Be({index:qr});return m.jsx(F$,{label:jt(sn),size:Ne,...gr,...Et.slotProps.chip},en)})):Mt&&On!=null&&(ce=Mt(On,Be,Nt)),Z>-1&&Array.isArray(ce)){const sn=ce.length-Z;!wn&&sn>0&&(ce=ce.splice(0,Z),ce.push(m.jsx("span",{className:kt.tag,children:U(sn)},ce.length)))}const ut=tt||(sn=>m.jsxs("li",{children:[m.jsx(n2e,{className:kt.groupLabel,ownerState:Nt,component:"div",children:sn.group}),m.jsx(r2e,{className:kt.groupUl,ownerState:Nt,children:sn.children})]},sn.key)),qe=qt||((sn,qr)=>{const{key:en,...gr}=sn;return m.jsx("li",{...gr,children:jt(qr)},en)}),Zt=(sn,qr)=>{const en=Cn({option:sn,index:qr});return qe({...en,className:kt.option},sn,{selected:en["aria-selected"],index:qr,inputValue:Ae},Nt)},an=Et.slotProps.clearIndicator,vr=Et.slotProps.popupIndicator;return m.jsxs(T.Fragment,{children:[m.jsx(Gke,{ref:t,className:Ot(kt.root,c),ownerState:Nt,...Ht($e),children:Ze({id:Gn,disabled:w,fullWidth:!0,size:Ne==="small"?"small":void 0,InputLabelProps:pt(),InputProps:{ref:he,className:kt.inputRoot,startAdornment:ce,onMouseDown:sn=>{sn.target===sn.currentTarget&&It(sn)},...(Ve||ot)&&{endAdornment:m.jsxs(Yke,{className:kt.endAdornment,ownerState:Nt,children:[Ve?m.jsx(Kke,{...Ue(),"aria-label":y,title:y,ownerState:Nt,...an,className:Ot(kt.clearIndicator,an?.className),children:u}):null,ot?m.jsx(Qke,{...Te(),disabled:w,"aria-label":Hn?g:Qe,title:Hn?g:Qe,ownerState:Nt,...vr,className:Ot(kt.popupIndicator,vr?.className),children:dt}):null]})}},inputProps:{className:kt.input,disabled:w,readOnly:ze,...$t()}})}),Wt?m.jsx(Xke,{as:rn,...le,children:m.jsxs(Zke,{as:nr,...Yn,children:[re&&Ie.length===0?m.jsx(Jke,{className:kt.loading,ownerState:Nt,children:ne}):null,Ie.length===0&&!F&&!re?m.jsx(e2e,{className:kt.noOptions,ownerState:Nt,role:"presentation",onMouseDown:sn=>{sn.preventDefault()},children:ie}):null,Ie.length>0?m.jsx(Bt,{as:J,...Tn,children:Ie.map((sn,qr)=>z?ut({key:sn.key,group:sn.group,children:sn.options.map((en,gr)=>Zt(en,sn.index+gr))}):Zt(sn,qr))}):null]})}):null]})});var s2={exports:{}},o2e=s2.exports,VL;function a2e(){return VL||(VL=1,(function(e,t){(function(n,r){e.exports=r()})(o2e,(function(){var n=1e3,r=6e4,o=36e5,a="millisecond",i="second",s="minute",c="hour",u="day",f="week",p="month",y="quarter",g="year",b="date",x="Invalid Date",E=/^(\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,w={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(j){var V=["th","st","nd","rd"],z=j%100;return"["+j+(V[(z-20)%10]||V[z]||V[0])+"]"}},C=function(j,V,z){var K=String(j);return!K||K.length>=V?j:""+Array(V+1-K.length).join(z)+j},R={s:C,z:function(j){var V=-j.utcOffset(),z=Math.abs(V),K=Math.floor(z/60),Y=z%60;return(V<=0?"+":"-")+C(K,2,"0")+":"+C(Y,2,"0")},m:function j(V,z){if(V.date()<z.date())return-j(z,V);var K=12*(z.year()-V.year())+(z.month()-V.month()),Y=V.clone().add(K,p),te=z-Y<0,_=V.clone().add(K+(te?-1:1),p);return+(-(K+(z-Y)/(te?Y-_:_-Y))||0)},a:function(j){return j<0?Math.ceil(j)||0:Math.floor(j)},p:function(j){return{M:p,y:g,w:f,d:u,D:b,h:c,m:s,s:i,ms:a,Q:y}[j]||String(j||"").toLowerCase().replace(/s$/,"")},u:function(j){return j===void 0}},M="en",D={};D[M]=w;var I="$isDayjsObject",L=function(j){return j instanceof k||!(!j||!j[I])},F=function j(V,z,K){var Y;if(!V)return M;if(typeof V=="string"){var te=V.toLowerCase();D[te]&&(Y=te),z&&(D[te]=z,Y=te);var _=V.split("-");if(!Y&&_.length>1)return j(_[0])}else{var Z=V.name;D[Z]=V,Y=Z}return!K&&Y&&(M=Y),Y||!K&&M},B=function(j,V){if(L(j))return j.clone();var z=typeof V=="object"?V:{};return z.date=j,z.args=arguments,new k(z)},U=R;U.l=F,U.i=L,U.w=function(j,V){return B(j,{locale:V.$L,utc:V.$u,x:V.$x,$offset:V.$offset})};var k=(function(){function j(z){this.$L=F(z.locale,null,!0),this.parse(z),this.$x=this.$x||z.x||{},this[I]=!0}var V=j.prototype;return V.parse=function(z){this.$d=(function(K){var Y=K.date,te=K.utc;if(Y===null)return new Date(NaN);if(U.u(Y))return new Date;if(Y instanceof Date)return new Date(Y);if(typeof Y=="string"&&!/Z$/i.test(Y)){var _=Y.match(E);if(_){var Z=_[2]-1||0,J=(_[7]||"0").substring(0,3);return te?new Date(Date.UTC(_[1],Z,_[3]||1,_[4]||0,_[5]||0,_[6]||0,J)):new Date(_[1],Z,_[3]||1,_[4]||0,_[5]||0,_[6]||0,J)}}return new Date(Y)})(z),this.init()},V.init=function(){var z=this.$d;this.$y=z.getFullYear(),this.$M=z.getMonth(),this.$D=z.getDate(),this.$W=z.getDay(),this.$H=z.getHours(),this.$m=z.getMinutes(),this.$s=z.getSeconds(),this.$ms=z.getMilliseconds()},V.$utils=function(){return U},V.isValid=function(){return this.$d.toString()!==x},V.isSame=function(z,K){var Y=B(z);return this.startOf(K)<=Y&&Y<=this.endOf(K)},V.isAfter=function(z,K){return B(z)<this.startOf(K)},V.isBefore=function(z,K){return this.endOf(K)<B(z)},V.$g=function(z,K,Y){return U.u(z)?this[K]:this.set(Y,z)},V.unix=function(){return Math.floor(this.valueOf()/1e3)},V.valueOf=function(){return this.$d.getTime()},V.startOf=function(z,K){var Y=this,te=!!U.u(K)||K,_=U.p(z),Z=function(fe,xe){var ge=U.w(Y.$u?Date.UTC(Y.$y,xe,fe):new Date(Y.$y,xe,fe),Y);return te?ge:ge.endOf(u)},J=function(fe,xe){return U.w(Y.toDate()[fe].apply(Y.toDate("s"),(te?[0,0,0,0]:[23,59,59,999]).slice(xe)),Y)},W=this.$W,re=this.$M,ne=this.$D,X="set"+(this.$u?"UTC":"");switch(_){case g:return te?Z(1,0):Z(31,11);case p:return te?Z(1,re):Z(0,re+1);case f:var ie=this.$locale().weekStart||0,ae=(W<ie?W+7:W)-ie;return Z(te?ne-ae:ne+(6-ae),re);case u:case b:return J(X+"Hours",0);case c:return J(X+"Minutes",1);case s:return J(X+"Seconds",2);case i:return J(X+"Milliseconds",3);default:return this.clone()}},V.endOf=function(z){return this.startOf(z,!1)},V.$set=function(z,K){var Y,te=U.p(z),_="set"+(this.$u?"UTC":""),Z=(Y={},Y[u]=_+"Date",Y[b]=_+"Date",Y[p]=_+"Month",Y[g]=_+"FullYear",Y[c]=_+"Hours",Y[s]=_+"Minutes",Y[i]=_+"Seconds",Y[a]=_+"Milliseconds",Y)[te],J=te===u?this.$D+(K-this.$W):K;if(te===p||te===g){var W=this.clone().set(b,1);W.$d[Z](J),W.init(),this.$d=W.set(b,Math.min(this.$D,W.daysInMonth())).$d}else Z&&this.$d[Z](J);return this.init(),this},V.set=function(z,K){return this.clone().$set(z,K)},V.get=function(z){return this[U.p(z)]()},V.add=function(z,K){var Y,te=this;z=Number(z);var _=U.p(K),Z=function(re){var ne=B(te);return U.w(ne.date(ne.date()+Math.round(re*z)),te)};if(_===p)return this.set(p,this.$M+z);if(_===g)return this.set(g,this.$y+z);if(_===u)return Z(1);if(_===f)return Z(7);var J=(Y={},Y[s]=r,Y[c]=o,Y[i]=n,Y)[_]||1,W=this.$d.getTime()+z*J;return U.w(W,this)},V.subtract=function(z,K){return this.add(-1*z,K)},V.format=function(z){var K=this,Y=this.$locale();if(!this.isValid())return Y.invalidDate||x;var te=z||"YYYY-MM-DDTHH:mm:ssZ",_=U.z(this),Z=this.$H,J=this.$m,W=this.$M,re=Y.weekdays,ne=Y.months,X=Y.meridiem,ie=function(xe,ge,Re,de){return xe&&(xe[ge]||xe(K,te))||Re[ge].slice(0,de)},ae=function(xe){return U.s(Z%12||12,xe,"0")},fe=X||function(xe,ge,Re){var de=xe<12?"AM":"PM";return Re?de.toLowerCase():de};return te.replace(S,(function(xe,ge){return ge||(function(Re){switch(Re){case"YY":return String(K.$y).slice(-2);case"YYYY":return U.s(K.$y,4,"0");case"M":return W+1;case"MM":return U.s(W+1,2,"0");case"MMM":return ie(Y.monthsShort,W,ne,3);case"MMMM":return ie(ne,W);case"D":return K.$D;case"DD":return U.s(K.$D,2,"0");case"d":return String(K.$W);case"dd":return ie(Y.weekdaysMin,K.$W,re,2);case"ddd":return ie(Y.weekdaysShort,K.$W,re,3);case"dddd":return re[K.$W];case"H":return String(Z);case"HH":return U.s(Z,2,"0");case"h":return ae(1);case"hh":return ae(2);case"a":return fe(Z,J,!0);case"A":return fe(Z,J,!1);case"m":return String(J);case"mm":return U.s(J,2,"0");case"s":return String(K.$s);case"ss":return U.s(K.$s,2,"0");case"SSS":return U.s(K.$ms,3,"0");case"Z":return _}return null})(xe)||_.replace(":","")}))},V.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},V.diff=function(z,K,Y){var te,_=this,Z=U.p(K),J=B(z),W=(J.utcOffset()-this.utcOffset())*r,re=this-J,ne=function(){return U.m(_,J)};switch(Z){case g:te=ne()/12;break;case p:te=ne();break;case y:te=ne()/3;break;case f:te=(re-W)/6048e5;break;case u:te=(re-W)/864e5;break;case c:te=re/o;break;case s:te=re/r;break;case i:te=re/n;break;default:te=re}return Y?te:U.a(te)},V.daysInMonth=function(){return this.endOf(p).$D},V.$locale=function(){return D[this.$L]},V.locale=function(z,K){if(!z)return this.$L;var Y=this.clone(),te=F(z,K,!0);return te&&(Y.$L=te),Y},V.clone=function(){return U.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()},j})(),$=k.prototype;return B.prototype=$,[["$ms",a],["$s",i],["$m",s],["$H",c],["$W",u],["$M",p],["$y",g],["$D",b]].forEach((function(j){$[j[1]]=function(V){return this.$g(V,j[0],j[1])}})),B.extend=function(j,V){return j.$i||(j(V,k,B),j.$i=!0),B},B.locale=F,B.isDayjs=L,B.unix=function(j){return B(1e3*j)},B.en=D[M],B.Ls=D,B.p={},B}))})(s2)),s2.exports}var i2e=a2e();const Ar=fs(i2e);var l2={exports:{}},s2e=l2.exports,WL;function l2e(){return WL||(WL=1,(function(e,t){(function(n,r){e.exports=r()})(s2e,(function(){var n="week",r="year";return function(o,a,i){var s=a.prototype;s.week=function(c){if(c===void 0&&(c=null),c!==null)return this.add(7*(c-this.week()),"day");var u=this.$locale().yearStart||1;if(this.month()===11&&this.date()>25){var f=i(this).startOf(r).add(1,r).date(u),p=i(this).endOf(n);if(f.isBefore(p))return 1}var y=i(this).startOf(r).date(u).startOf(n).subtract(1,"millisecond"),g=this.diff(y,n,!0);return g<0?i(this).startOf("week").week():Math.ceil(g)},s.weeks=function(c){return c===void 0&&(c=null),this.week(c)}}}))})(l2)),l2.exports}var c2e=l2e();const u2e=fs(c2e);var c2={exports:{}},d2e=c2.exports,qL;function f2e(){return qL||(qL=1,(function(e,t){(function(n,r){e.exports=r()})(d2e,(function(){var n={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},r=/(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|Q|YYYY|YY?|ww?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g,o=/\d/,a=/\d\d/,i=/\d\d?/,s=/\d*[^-_:/,()\s\d]+/,c={},u=function(E){return(E=+E)+(E>68?1900:2e3)},f=function(E){return function(S){this[E]=+S}},p=[/[+-]\d\d:?(\d\d)?|Z/,function(E){(this.zone||(this.zone={})).offset=(function(S){if(!S||S==="Z")return 0;var w=S.match(/([+-]|\d\d)/g),C=60*w[1]+(+w[2]||0);return C===0?0:w[0]==="+"?-C:C})(E)}],y=function(E){var S=c[E];return S&&(S.indexOf?S:S.s.concat(S.f))},g=function(E,S){var w,C=c.meridiem;if(C){for(var R=1;R<=24;R+=1)if(E.indexOf(C(R,0,S))>-1){w=R>12;break}}else w=E===(S?"pm":"PM");return w},b={A:[s,function(E){this.afternoon=g(E,!1)}],a:[s,function(E){this.afternoon=g(E,!0)}],Q:[o,function(E){this.month=3*(E-1)+1}],S:[o,function(E){this.milliseconds=100*+E}],SS:[a,function(E){this.milliseconds=10*+E}],SSS:[/\d{3}/,function(E){this.milliseconds=+E}],s:[i,f("seconds")],ss:[i,f("seconds")],m:[i,f("minutes")],mm:[i,f("minutes")],H:[i,f("hours")],h:[i,f("hours")],HH:[i,f("hours")],hh:[i,f("hours")],D:[i,f("day")],DD:[a,f("day")],Do:[s,function(E){var S=c.ordinal,w=E.match(/\d+/);if(this.day=w[0],S)for(var C=1;C<=31;C+=1)S(C).replace(/\[|\]/g,"")===E&&(this.day=C)}],w:[i,f("week")],ww:[a,f("week")],M:[i,f("month")],MM:[a,f("month")],MMM:[s,function(E){var S=y("months"),w=(y("monthsShort")||S.map((function(C){return C.slice(0,3)}))).indexOf(E)+1;if(w<1)throw new Error;this.month=w%12||w}],MMMM:[s,function(E){var S=y("months").indexOf(E)+1;if(S<1)throw new Error;this.month=S%12||S}],Y:[/[+-]?\d+/,f("year")],YY:[a,function(E){this.year=u(E)}],YYYY:[/\d{4}/,f("year")],Z:p,ZZ:p};function x(E){var S,w;S=E,w=c&&c.formats;for(var C=(E=S.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,(function(B,U,k){var $=k&&k.toUpperCase();return U||w[k]||n[k]||w[$].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,(function(j,V,z){return V||z.slice(1)}))}))).match(r),R=C.length,M=0;M<R;M+=1){var D=C[M],I=b[D],L=I&&I[0],F=I&&I[1];C[M]=F?{regex:L,parser:F}:D.replace(/^\[|\]$/g,"")}return function(B){for(var U={},k=0,$=0;k<R;k+=1){var j=C[k];if(typeof j=="string")$+=j.length;else{var V=j.regex,z=j.parser,K=B.slice($),Y=V.exec(K)[0];z.call(U,Y),B=B.replace(Y,"")}}return(function(te){var _=te.afternoon;if(_!==void 0){var Z=te.hours;_?Z<12&&(te.hours+=12):Z===12&&(te.hours=0),delete te.afternoon}})(U),U}}return function(E,S,w){w.p.customParseFormat=!0,E&&E.parseTwoDigitYear&&(u=E.parseTwoDigitYear);var C=S.prototype,R=C.parse;C.parse=function(M){var D=M.date,I=M.utc,L=M.args;this.$u=I;var F=L[1];if(typeof F=="string"){var B=L[2]===!0,U=L[3]===!0,k=B||U,$=L[2];U&&($=L[2]),c=this.$locale(),!B&&$&&(c=w.Ls[$]),this.$d=(function(K,Y,te,_){try{if(["x","X"].indexOf(Y)>-1)return new Date((Y==="X"?1e3:1)*K);var Z=x(Y)(K),J=Z.year,W=Z.month,re=Z.day,ne=Z.hours,X=Z.minutes,ie=Z.seconds,ae=Z.milliseconds,fe=Z.zone,xe=Z.week,ge=new Date,Re=re||(J||W?1:ge.getDate()),de=J||ge.getFullYear(),me=0;J&&!W||(me=W>0?W-1:ge.getMonth());var Qe,Me=ne||0,we=X||0,Se=ie||0,dt=ae||0;return fe?new Date(Date.UTC(de,me,Re,Me,we,Se,dt+60*fe.offset*1e3)):te?new Date(Date.UTC(de,me,Re,Me,we,Se,dt)):(Qe=new Date(de,me,Re,Me,we,Se,dt),xe&&(Qe=_(Qe).week(xe).toDate()),Qe)}catch{return new Date("")}})(D,F,I,w),this.init(),$&&$!==!0&&(this.$L=this.locale($).$L),k&&D!=this.format(F)&&(this.$d=new Date("")),c={}}else if(F instanceof Array)for(var j=F.length,V=1;V<=j;V+=1){L[1]=F[V-1];var z=w.apply(this,L);if(z.isValid()){this.$d=z.$d,this.$L=z.$L,this.init();break}V===j&&(this.$d=new Date(""))}else R.call(this,M)}}}))})(c2)),c2.exports}var p2e=f2e();const h2e=fs(p2e);var u2={exports:{}},m2e=u2.exports,GL;function g2e(){return GL||(GL=1,(function(e,t){(function(n,r){e.exports=r()})(m2e,(function(){var n={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"};return function(r,o,a){var i=o.prototype,s=i.format;a.en.formats=n,i.format=function(c){c===void 0&&(c="YYYY-MM-DDTHH:mm:ssZ");var u=this.$locale().formats,f=(function(p,y){return p.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,(function(g,b,x){var E=x&&x.toUpperCase();return b||y[x]||n[x]||y[E].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,(function(S,w,C){return w||C.slice(1)}))}))})(c,u===void 0?{}:u);return s.call(this,f)}}}))})(u2)),u2.exports}var y2e=g2e();const b2e=fs(y2e);var d2={exports:{}},v2e=d2.exports,YL;function x2e(){return YL||(YL=1,(function(e,t){(function(n,r){e.exports=r()})(v2e,(function(){return function(n,r,o){r.prototype.isBetween=function(a,i,s,c){var u=o(a),f=o(i),p=(c=c||"()")[0]==="(",y=c[1]===")";return(p?this.isAfter(u,s):!this.isBefore(u,s))&&(y?this.isBefore(f,s):!this.isAfter(f,s))||(p?this.isBefore(u,s):!this.isAfter(u,s))&&(y?this.isAfter(f,s):!this.isBefore(f,s))}}}))})(d2)),d2.exports}var S2e=x2e();const E2e=fs(S2e);var f2={exports:{}},C2e=f2.exports,KL;function T2e(){return KL||(KL=1,(function(e,t){(function(n,r){e.exports=r()})(C2e,(function(){return function(n,r){var o=r.prototype,a=o.format;o.format=function(i){var s=this,c=this.$locale();if(!this.isValid())return a.bind(this)(i);var u=this.$utils(),f=(i||"YYYY-MM-DDTHH:mm:ssZ").replace(/\[([^\]]+)]|Q|wo|ww|w|WW|W|zzz|z|gggg|GGGG|Do|X|x|k{1,2}|S/g,(function(p){switch(p){case"Q":return Math.ceil((s.$M+1)/3);case"Do":return c.ordinal(s.$D);case"gggg":return s.weekYear();case"GGGG":return s.isoWeekYear();case"wo":return c.ordinal(s.week(),"W");case"w":case"ww":return u.s(s.week(),p==="w"?1:2,"0");case"W":case"WW":return u.s(s.isoWeek(),p==="W"?1:2,"0");case"k":case"kk":return u.s(String(s.$H===0?24:s.$H),p==="k"?1:2,"0");case"X":return Math.floor(s.$d.getTime()/1e3);case"x":return s.$d.getTime();case"z":return"["+s.offsetName()+"]";case"zzz":return"["+s.offsetName("long")+"]";default:return p}}));return a.bind(this)(f)}}}))})(f2)),f2.exports}var w2e=T2e();const k2e=fs(w2e);Ar.extend(b2e);Ar.extend(u2e);Ar.extend(E2e);Ar.extend(k2e);const A2e={YY:"year",YYYY:{sectionType:"year",contentType:"digit",maxLength:4},M:{sectionType:"month",contentType:"digit",maxLength:2},MM:"month",MMM:{sectionType:"month",contentType:"letter"},MMMM:{sectionType:"month",contentType:"letter"},D:{sectionType:"day",contentType:"digit",maxLength:2},DD:"day",Do:{sectionType:"day",contentType:"digit-with-letter"},d:{sectionType:"weekDay",contentType:"digit",maxLength:2},dd:{sectionType:"weekDay",contentType:"letter"},ddd:{sectionType:"weekDay",contentType:"letter"},dddd:{sectionType:"weekDay",contentType:"letter"},A:"meridiem",a:"meridiem",H:{sectionType:"hours",contentType:"digit",maxLength:2},HH:"hours",h:{sectionType:"hours",contentType:"digit",maxLength:2},hh:"hours",m:{sectionType:"minutes",contentType:"digit",maxLength:2},mm:"minutes",s:{sectionType:"seconds",contentType:"digit",maxLength:2},ss:"seconds"},D2e={year:"YYYY",month:"MMMM",monthShort:"MMM",dayOfMonth:"D",dayOfMonthFull:"Do",weekday:"dddd",weekdayShort:"dd",hours24h:"HH",hours12h:"hh",meridiem:"A",minutes:"mm",seconds:"ss",fullDate:"ll",keyboardDate:"L",shortDate:"MMM D",normalDate:"D MMMM",normalDateWithWeekday:"ddd, MMM D",fullTime:"LT",fullTime12h:"hh:mm A",fullTime24h:"HH:mm",keyboardDateTime:"L LT",keyboardDateTime12h:"L hh:mm A",keyboardDateTime24h:"L HH:mm"},mw=["Missing UTC plugin","To be able to use UTC or timezones, you have to enable the `utc` plugin","Find more information on https://mui.com/x/react-date-pickers/timezone/#day-js-and-utc"].join(`
430
+ `),D=C.selectionStart===R;M&&D&&C.setSelectionRange(R,R),n&&n(w)};return m.jsxs(T.Fragment,{children:[m.jsx("textarea",{value:i,onChange:S,ref:f,rows:o,style:a,...s}),m.jsx("textarea",{"aria-hidden":!0,className:e.className,readOnly:!0,ref:y,tabIndex:-1,style:{...jCe.shadow,...a,paddingTop:0,paddingBottom:0}})]})});function zCe(e){return Ut("MuiInputBase",e)}const pi=Lt("MuiInputBase",["root","formControl","focused","disabled","adornedStart","adornedEnd","error","sizeSmall","multiline","colorSecondary","fullWidth","hiddenLabel","readOnly","input","inputSizeSmall","inputMultiline","inputTypeSearch","inputAdornedStart","inputAdornedEnd","inputHiddenLabel"]);var hL;const _S=(e,t)=>{const{ownerState:n}=e;return[t.root,n.formControl&&t.formControl,n.startAdornment&&t.adornedStart,n.endAdornment&&t.adornedEnd,n.error&&t.error,n.size==="small"&&t.sizeSmall,n.multiline&&t.multiline,n.color&&t[`color${bt(n.color)}`],n.fullWidth&&t.fullWidth,n.hiddenLabel&&t.hiddenLabel]},LS=(e,t)=>{const{ownerState:n}=e;return[t.input,n.size==="small"&&t.inputSizeSmall,n.multiline&&t.inputMultiline,n.type==="search"&&t.inputTypeSearch,n.startAdornment&&t.inputAdornedStart,n.endAdornment&&t.inputAdornedEnd,n.hiddenLabel&&t.inputHiddenLabel]},HCe=e=>{const{classes:t,color:n,disabled:r,error:o,endAdornment:a,focused:i,formControl:s,fullWidth:c,hiddenLabel:u,multiline:f,readOnly:p,size:y,startAdornment:g,type:b}=e,x={root:["root",`color${bt(n)}`,r&&"disabled",o&&"error",c&&"fullWidth",i&&"focused",s&&"formControl",y&&y!=="medium"&&`size${bt(y)}`,f&&"multiline",g&&"adornedStart",a&&"adornedEnd",u&&"hiddenLabel",p&&"readOnly"],input:["input",r&&"disabled",b==="search"&&"inputTypeSearch",f&&"inputMultiline",y==="small"&&"inputSizeSmall",u&&"inputHiddenLabel",g&&"inputAdornedStart",a&&"inputAdornedEnd",p&&"readOnly"]};return zt(x,zCe,t)},FS=Pe("div",{name:"MuiInputBase",slot:"Root",overridesResolver:_S})(Pn(({theme:e})=>({...e.typography.body1,color:(e.vars||e).palette.text.primary,lineHeight:"1.4375em",boxSizing:"border-box",position:"relative",cursor:"text",display:"inline-flex",alignItems:"center",[`&.${pi.disabled}`]:{color:(e.vars||e).palette.text.disabled,cursor:"default"},variants:[{props:({ownerState:t})=>t.multiline,style:{padding:"4px 0 5px"}},{props:({ownerState:t,size:n})=>t.multiline&&n==="small",style:{paddingTop:1}},{props:({ownerState:t})=>t.fullWidth,style:{width:"100%"}}]}))),jS=Pe("input",{name:"MuiInputBase",slot:"Input",overridesResolver:LS})(Pn(({theme:e})=>{const t=e.palette.mode==="light",n={color:"currentColor",...e.vars?{opacity:e.vars.opacity.inputPlaceholder}:{opacity:t?.42:.5},transition:e.transitions.create("opacity",{duration:e.transitions.duration.shorter})},r={opacity:"0 !important"},o=e.vars?{opacity:e.vars.opacity.inputPlaceholder}:{opacity:t?.42:.5};return{font:"inherit",letterSpacing:"inherit",color:"currentColor",padding:"4px 0 5px",border:0,boxSizing:"content-box",background:"none",height:"1.4375em",margin:0,WebkitTapHighlightColor:"transparent",display:"block",minWidth:0,width:"100%","&::-webkit-input-placeholder":n,"&::-moz-placeholder":n,"&::-ms-input-placeholder":n,"&:focus":{outline:0},"&:invalid":{boxShadow:"none"},"&::-webkit-search-decoration":{WebkitAppearance:"none"},[`label[data-shrink=false] + .${pi.formControl} &`]:{"&::-webkit-input-placeholder":r,"&::-moz-placeholder":r,"&::-ms-input-placeholder":r,"&:focus::-webkit-input-placeholder":o,"&:focus::-moz-placeholder":o,"&:focus::-ms-input-placeholder":o},[`&.${pi.disabled}`]:{opacity:1,WebkitTextFillColor:(e.vars||e).palette.text.disabled},variants:[{props:({ownerState:a})=>!a.disableInjectingGlobalStyles,style:{animationName:"mui-auto-fill-cancel",animationDuration:"10ms","&:-webkit-autofill":{animationDuration:"5000s",animationName:"mui-auto-fill"}}},{props:{size:"small"},style:{paddingTop:1}},{props:({ownerState:a})=>a.multiline,style:{height:"auto",resize:"none",padding:0,paddingTop:0}},{props:{type:"search"},style:{MozAppearance:"textfield"}}]}})),mL=Lce({"@keyframes mui-auto-fill":{from:{display:"block"}},"@keyframes mui-auto-fill-cancel":{from:{display:"block"}}}),HD=T.forwardRef(function(e,t){const n=An({props:e,name:"MuiInputBase"}),{"aria-describedby":r,autoComplete:o,autoFocus:a,className:i,color:s,components:c={},componentsProps:u={},defaultValue:f,disabled:p,disableInjectingGlobalStyles:y,endAdornment:g,error:b,fullWidth:x=!1,id:E,inputComponent:S="input",inputProps:w={},inputRef:C,margin:R,maxRows:M,minRows:D,multiline:I=!1,name:L,onBlur:F,onChange:B,onClick:U,onFocus:k,onKeyDown:$,onKeyUp:j,placeholder:V,readOnly:z,renderSuffix:K,rows:Y,size:te,slotProps:_={},slots:Z={},startAdornment:J,type:W="text",value:re,...ne}=n,X=w.value!=null?w.value:re,{current:ie}=T.useRef(X!=null),ae=T.useRef(),fe=T.useCallback(ft=>{},[]),xe=cr(ae,C,w.ref,fe),[ge,Re]=T.useState(!1),de=Oi(),me=of({props:n,muiFormControl:de,states:["color","disabled","error","hiddenLabel","size","required","filled"]});me.focused=de?de.focused:ge,T.useEffect(()=>{!de&&p&&ge&&(Re(!1),F&&F())},[de,p,ge,F]);const Qe=de&&de.onFilled,Me=de&&de.onEmpty,we=T.useCallback(ft=>{ax(ft)?Qe&&Qe():Me&&Me()},[Qe,Me]);Io(()=>{ie&&we({value:X})},[X,we,ie]);const Se=ft=>{k&&k(ft),w.onFocus&&w.onFocus(ft),de&&de.onFocus?de.onFocus(ft):Re(!0)},dt=ft=>{F&&F(ft),w.onBlur&&w.onBlur(ft),de&&de.onBlur?de.onBlur(ft):Re(!1)},ze=(ft,...$e)=>{if(!ie){const Ht=ft.target||ae.current;if(Ht==null)throw new Error(uc(1));we({value:Ht.value})}w.onChange&&w.onChange(ft,...$e),B&&B(ft,...$e)};T.useEffect(()=>{we(ae.current)},[]);const tt=ft=>{ae.current&&ft.currentTarget===ft.target&&ae.current.focus(),U&&U(ft)};let Ze=S,qt=w;I&&Ze==="input"&&(Y?qt={type:void 0,minRows:Y,maxRows:Y,...qt}:qt={type:void 0,maxRows:M,minRows:D,...qt},Ze=$Ce);const Vt=ft=>{we(ft.animationName==="mui-auto-fill-cancel"?ae.current:{value:"x"})};T.useEffect(()=>{de&&de.setAdornedStart(!!J)},[de,J]);const Mt={...n,color:me.color||"primary",disabled:me.disabled,endAdornment:g,error:me.error,focused:me.focused,formControl:de,fullWidth:x,hiddenLabel:me.hiddenLabel,multiline:I,size:me.size,startAdornment:J,type:W},ke=HCe(Mt),Ne=Z.root||c.Root||FS,lt=_.root||u.root||{},St=Z.input||c.Input||jS;return qt={...qt,..._.input??u.input},m.jsxs(T.Fragment,{children:[!y&&typeof mL=="function"&&(hL||(hL=m.jsx(mL,{}))),m.jsxs(Ne,{...lt,ref:t,onClick:tt,...ne,...!Qp(Ne)&&{ownerState:{...Mt,...lt.ownerState}},className:Ot(ke.root,lt.className,i,z&&"MuiInputBase-readOnly"),children:[J,m.jsx(IS.Provider,{value:null,children:m.jsx(St,{"aria-invalid":me.error,"aria-describedby":r,autoComplete:o,autoFocus:a,defaultValue:f,disabled:me.disabled,id:E,onAnimationStart:Vt,name:L,placeholder:V,readOnly:z,required:me.required,rows:Y,value:X,onKeyDown:$,onKeyUp:j,type:W,...qt,...!Qp(St)&&{as:Ze,ownerState:{...Mt,...qt.ownerState}},ref:xe,className:Ot(ke.input,qt.className,z&&"MuiInputBase-readOnly"),onBlur:dt,onChange:ze,onFocus:Se})}),g,K?K({...me,startAdornment:J}):null]})]})});function UCe(e){return Ut("MuiInput",e)}const fu={...pi,...Lt("MuiInput",["root","underline","input"])},VCe=e=>{const{classes:t,disableUnderline:n}=e,r=zt({root:["root",!n&&"underline"],input:["input"]},UCe,t);return{...t,...r}},WCe=Pe(FS,{shouldForwardProp:e=>wa(e)||e==="classes",name:"MuiInput",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[..._S(e,t),!n.disableUnderline&&t.underline]}})(Pn(({theme:e})=>{let t=e.palette.mode==="light"?"rgba(0, 0, 0, 0.42)":"rgba(255, 255, 255, 0.7)";return e.vars&&(t=e.alpha(e.vars.palette.common.onBackground,e.vars.opacity.inputUnderline)),{position:"relative",variants:[{props:({ownerState:n})=>n.formControl,style:{"label + &":{marginTop:16}}},{props:({ownerState:n})=>!n.disableUnderline,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"},[`&.${fu.focused}:after`]:{transform:"scaleX(1) translateX(0)"},[`&.${fu.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(.${fu.disabled}, .${fu.error}):before`]:{borderBottom:`2px solid ${(e.vars||e).palette.text.primary}`,"@media (hover: none)":{borderBottom:`1px solid ${t}`}},[`&.${fu.disabled}:before`]:{borderBottomStyle:"dotted"}}},...Object.entries(e.palette).filter(Sa()).map(([n])=>({props:{color:n,disableUnderline:!1},style:{"&::after":{borderBottom:`2px solid ${(e.vars||e).palette[n].main}`}}}))]}})),qCe=Pe(jS,{name:"MuiInput",slot:"Input",overridesResolver:LS})({}),UD=T.forwardRef(function(e,t){const n=An({props:e,name:"MuiInput"}),{disableUnderline:r=!1,components:o={},componentsProps:a,fullWidth:i=!1,inputComponent:s="input",multiline:c=!1,slotProps:u,slots:f={},type:p="text",...y}=n,g=VCe(n),b={root:{ownerState:{disableUnderline:r}}},x=u??a?sa(u??a,b):b,E=f.root??o.Root??WCe,S=f.input??o.Input??qCe;return m.jsx(HD,{slots:{root:E,input:S},slotProps:x,fullWidth:i,inputComponent:s,multiline:c,ref:t,type:p,...y,classes:g})});UD.muiName="Input";function GCe(e){return Ut("MuiFilledInput",e)}const hi={...pi,...Lt("MuiFilledInput",["root","underline","input","adornedStart","adornedEnd","sizeSmall","multiline","hiddenLabel"])},YCe=e=>{const{classes:t,disableUnderline:n,startAdornment:r,endAdornment:o,size:a,hiddenLabel:i,multiline:s}=e,c={root:["root",!n&&"underline",r&&"adornedStart",o&&"adornedEnd",a==="small"&&`size${bt(a)}`,i&&"hiddenLabel",s&&"multiline"],input:["input"]},u=zt(c,GCe,t);return{...t,...u}},KCe=Pe(FS,{shouldForwardProp:e=>wa(e)||e==="classes",name:"MuiFilledInput",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[..._S(e,t),!n.disableUnderline&&t.underline]}})(Pn(({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{position:"relative",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}},[`&.${hi.focused}`]:{backgroundColor:e.vars?e.vars.palette.FilledInput.bg:r},[`&.${hi.disabled}`]:{backgroundColor:e.vars?e.vars.palette.FilledInput.disabledBg:a},variants:[{props:({ownerState:i})=>!i.disableUnderline,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"},[`&.${hi.focused}:after`]:{transform:"scaleX(1) translateX(0)"},[`&.${hi.error}`]:{"&::before, &::after":{borderBottomColor:(e.vars||e).palette.error.main}},"&::before":{borderBottom:`1px solid ${e.vars?e.alpha(e.vars.palette.common.onBackground,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(.${hi.disabled}, .${hi.error}):before`]:{borderBottom:`1px solid ${(e.vars||e).palette.text.primary}`},[`&.${hi.disabled}:before`]:{borderBottomStyle:"dotted"}}},...Object.entries(e.palette).filter(Sa()).map(([i])=>({props:{disableUnderline:!1,color:i},style:{"&::after":{borderBottom:`2px solid ${(e.vars||e).palette[i]?.main}`}}})),{props:({ownerState:i})=>i.startAdornment,style:{paddingLeft:12}},{props:({ownerState:i})=>i.endAdornment,style:{paddingRight:12}},{props:({ownerState:i})=>i.multiline,style:{padding:"25px 12px 8px"}},{props:({ownerState:i,size:s})=>i.multiline&&s==="small",style:{paddingTop:21,paddingBottom:4}},{props:({ownerState:i})=>i.multiline&&i.hiddenLabel,style:{paddingTop:16,paddingBottom:17}},{props:({ownerState:i})=>i.multiline&&i.hiddenLabel&&i.size==="small",style:{paddingTop:8,paddingBottom:9}}]}})),QCe=Pe(jS,{name:"MuiFilledInput",slot:"Input",overridesResolver:LS})(Pn(({theme:e})=>({paddingTop:25,paddingRight:12,paddingBottom:8,paddingLeft:12,...!e.vars&&{"&:-webkit-autofill":{WebkitBoxShadow:e.palette.mode==="light"?null:"0 0 0 100px #266798 inset",WebkitTextFillColor:e.palette.mode==="light"?null:"#fff",caretColor:e.palette.mode==="light"?null:"#fff",borderTopLeftRadius:"inherit",borderTopRightRadius:"inherit"}},...e.vars&&{"&:-webkit-autofill":{borderTopLeftRadius:"inherit",borderTopRightRadius:"inherit"},[e.getColorSchemeSelector("dark")]:{"&:-webkit-autofill":{WebkitBoxShadow:"0 0 0 100px #266798 inset",WebkitTextFillColor:"#fff",caretColor:"#fff"}}},variants:[{props:{size:"small"},style:{paddingTop:21,paddingBottom:4}},{props:({ownerState:t})=>t.hiddenLabel,style:{paddingTop:16,paddingBottom:17}},{props:({ownerState:t})=>t.startAdornment,style:{paddingLeft:0}},{props:({ownerState:t})=>t.endAdornment,style:{paddingRight:0}},{props:({ownerState:t})=>t.hiddenLabel&&t.size==="small",style:{paddingTop:8,paddingBottom:9}},{props:({ownerState:t})=>t.multiline,style:{paddingTop:0,paddingBottom:0,paddingLeft:0,paddingRight:0}}]}))),VD=T.forwardRef(function(e,t){const n=An({props:e,name:"MuiFilledInput"}),{disableUnderline:r=!1,components:o={},componentsProps:a,fullWidth:i=!1,hiddenLabel:s,inputComponent:c="input",multiline:u=!1,slotProps:f,slots:p={},type:y="text",...g}=n,b={...n,disableUnderline:r,fullWidth:i,inputComponent:c,multiline:u,type:y},x=YCe(n),E={root:{ownerState:b},input:{ownerState:b}},S=f??a?sa(E,f??a):E,w=p.root??o.Root??KCe,C=p.input??o.Input??QCe;return m.jsx(HD,{slots:{root:w,input:C},slotProps:S,fullWidth:i,inputComponent:c,multiline:u,ref:t,type:y,...g,classes:x})});VD.muiName="Input";var gL;const XCe=Pe("fieldset",{name:"MuiNotchedOutlined",shouldForwardProp:wa})({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%"}),ZCe=Pe("legend",{name:"MuiNotchedOutlined",shouldForwardProp:wa})(Pn(({theme:e})=>({float:"unset",width:"auto",overflow:"hidden",variants:[{props:({ownerState:t})=>!t.withLabel,style:{padding:0,lineHeight:"11px",transition:e.transitions.create("width",{duration:150,easing:e.transitions.easing.easeOut})}},{props:({ownerState:t})=>t.withLabel,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:({ownerState:t})=>t.withLabel&&t.notched,style:{maxWidth:"100%",transition:e.transitions.create("max-width",{duration:100,easing:e.transitions.easing.easeOut,delay:50})}}]})));function JCe(e){const{children:t,classes:n,className:r,label:o,notched:a,...i}=e,s=o!=null&&o!=="",c={...e,notched:a,withLabel:s};return m.jsx(XCe,{"aria-hidden":!0,className:r,ownerState:c,...i,children:m.jsx(ZCe,{ownerState:c,children:s?m.jsx("span",{children:o}):gL||(gL=m.jsx("span",{className:"notranslate","aria-hidden":!0,children:"​"}))})})}function eTe(e){return Ut("MuiOutlinedInput",e)}const Vi={...pi,...Lt("MuiOutlinedInput",["root","notchedOutline","input"])},tTe=e=>{const{classes:t}=e,n=zt({root:["root"],notchedOutline:["notchedOutline"],input:["input"]},eTe,t);return{...t,...n}},nTe=Pe(FS,{shouldForwardProp:e=>wa(e)||e==="classes",name:"MuiOutlinedInput",slot:"Root",overridesResolver:_S})(Pn(({theme:e})=>{const t=e.palette.mode==="light"?"rgba(0, 0, 0, 0.23)":"rgba(255, 255, 255, 0.23)";return{position:"relative",borderRadius:(e.vars||e).shape.borderRadius,[`&:hover .${Vi.notchedOutline}`]:{borderColor:(e.vars||e).palette.text.primary},"@media (hover: none)":{[`&:hover .${Vi.notchedOutline}`]:{borderColor:e.vars?e.alpha(e.vars.palette.common.onBackground,.23):t}},[`&.${Vi.focused} .${Vi.notchedOutline}`]:{borderWidth:2},variants:[...Object.entries(e.palette).filter(Sa()).map(([n])=>({props:{color:n},style:{[`&.${Vi.focused} .${Vi.notchedOutline}`]:{borderColor:(e.vars||e).palette[n].main}}})),{props:{},style:{[`&.${Vi.error} .${Vi.notchedOutline}`]:{borderColor:(e.vars||e).palette.error.main},[`&.${Vi.disabled} .${Vi.notchedOutline}`]:{borderColor:(e.vars||e).palette.action.disabled}}},{props:({ownerState:n})=>n.startAdornment,style:{paddingLeft:14}},{props:({ownerState:n})=>n.endAdornment,style:{paddingRight:14}},{props:({ownerState:n})=>n.multiline,style:{padding:"16.5px 14px"}},{props:({ownerState:n,size:r})=>n.multiline&&r==="small",style:{padding:"8.5px 14px"}}]}})),rTe=Pe(JCe,{name:"MuiOutlinedInput",slot:"NotchedOutline"})(Pn(({theme:e})=>{const t=e.palette.mode==="light"?"rgba(0, 0, 0, 0.23)":"rgba(255, 255, 255, 0.23)";return{borderColor:e.vars?e.alpha(e.vars.palette.common.onBackground,.23):t}})),oTe=Pe(jS,{name:"MuiOutlinedInput",slot:"Input",overridesResolver:LS})(Pn(({theme:e})=>({padding:"16.5px 14px",...!e.vars&&{"&:-webkit-autofill":{WebkitBoxShadow:e.palette.mode==="light"?null:"0 0 0 100px #266798 inset",WebkitTextFillColor:e.palette.mode==="light"?null:"#fff",caretColor:e.palette.mode==="light"?null:"#fff",borderRadius:"inherit"}},...e.vars&&{"&:-webkit-autofill":{borderRadius:"inherit"},[e.getColorSchemeSelector("dark")]:{"&:-webkit-autofill":{WebkitBoxShadow:"0 0 0 100px #266798 inset",WebkitTextFillColor:"#fff",caretColor:"#fff"}}},variants:[{props:{size:"small"},style:{padding:"8.5px 14px"}},{props:({ownerState:t})=>t.multiline,style:{padding:0}},{props:({ownerState:t})=>t.startAdornment,style:{paddingLeft:0}},{props:({ownerState:t})=>t.endAdornment,style:{paddingRight:0}}]}))),WD=T.forwardRef(function(e,t){const n=An({props:e,name:"MuiOutlinedInput"}),{components:r={},fullWidth:o=!1,inputComponent:a="input",label:i,multiline:s=!1,notched:c,slots:u={},slotProps:f={},type:p="text",...y}=n,g=tTe(n),b=Oi(),x=of({props:n,muiFormControl:b,states:["color","disabled","error","focused","hiddenLabel","size","required"]}),E={...n,color:x.color||"primary",disabled:x.disabled,error:x.error,focused:x.focused,formControl:b,fullWidth:o,hiddenLabel:x.hiddenLabel,multiline:s,size:x.size,type:p},S=u.root??r.Root??nTe,w=u.input??r.Input??oTe,[C,R]=tr("notchedOutline",{elementType:rTe,className:g.notchedOutline,shouldForwardComponentProp:!0,ownerState:E,externalForwardedProps:{slots:u,slotProps:f},additionalProps:{label:i!=null&&i!==""&&x.required?m.jsxs(T.Fragment,{children:[i," ","*"]}):i}});return m.jsx(HD,{slots:{root:S,input:w},slotProps:f,renderSuffix:M=>m.jsx(C,{...R,notched:typeof c<"u"?c:!!(M.startAdornment||M.filled||M.focused)}),fullWidth:o,inputComponent:a,multiline:s,ref:t,type:p,...y,classes:{...g,notchedOutline:null}})});WD.muiName="Input";function aTe(e){return Ut("MuiFormLabel",e)}const py=Lt("MuiFormLabel",["root","colorSecondary","focused","disabled","error","filled","required","asterisk"]),iTe=e=>{const{classes:t,color:n,focused:r,disabled:o,error:a,filled:i,required:s}=e,c={root:["root",`color${bt(n)}`,o&&"disabled",a&&"error",i&&"filled",r&&"focused",s&&"required"],asterisk:["asterisk",a&&"error"]};return zt(c,aTe,t)},sTe=Pe("label",{name:"MuiFormLabel",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.color==="secondary"&&t.colorSecondary,n.filled&&t.filled]}})(Pn(({theme:e})=>({color:(e.vars||e).palette.text.secondary,...e.typography.body1,lineHeight:"1.4375em",padding:0,position:"relative",variants:[...Object.entries(e.palette).filter(Sa()).map(([t])=>({props:{color:t},style:{[`&.${py.focused}`]:{color:(e.vars||e).palette[t].main}}})),{props:{},style:{[`&.${py.disabled}`]:{color:(e.vars||e).palette.text.disabled},[`&.${py.error}`]:{color:(e.vars||e).palette.error.main}}}]}))),lTe=Pe("span",{name:"MuiFormLabel",slot:"Asterisk"})(Pn(({theme:e})=>({[`&.${py.error}`]:{color:(e.vars||e).palette.error.main}}))),cTe=T.forwardRef(function(e,t){const n=An({props:e,name:"MuiFormLabel"}),{children:r,className:o,color:a,component:i="label",disabled:s,error:c,filled:u,focused:f,required:p,...y}=n,g=Oi(),b=of({props:n,muiFormControl:g,states:["color","required","focused","disabled","error","filled"]}),x={...n,color:b.color||"primary",component:i,disabled:b.disabled,error:b.error,filled:b.filled,focused:b.focused,required:b.required},E=iTe(x);return m.jsxs(sTe,{as:i,ownerState:x,className:Ot(E.root,o),ref:t,...y,children:[r,b.required&&m.jsxs(lTe,{ownerState:x,"aria-hidden":!0,className:E.asterisk,children:[" ","*"]})]})});function uTe(e){return Ut("MuiInputLabel",e)}Lt("MuiInputLabel",["root","focused","disabled","error","required","asterisk","formControl","sizeSmall","shrink","animated","standard","filled","outlined"]);const dTe=e=>{const{classes:t,formControl:n,size:r,shrink:o,disableAnimation:a,variant:i,required:s}=e,c={root:["root",n&&"formControl",!a&&"animated",o&&"shrink",r&&r!=="medium"&&`size${bt(r)}`,i],asterisk:[s&&"asterisk"]},u=zt(c,uTe,t);return{...t,...u}},fTe=Pe(cTe,{shouldForwardProp:e=>wa(e)||e==="classes",name:"MuiInputLabel",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[{[`& .${py.asterisk}`]:t.asterisk},t.root,n.formControl&&t.formControl,n.size==="small"&&t.sizeSmall,n.shrink&&t.shrink,!n.disableAnimation&&t.animated,n.focused&&t.focused,t[n.variant]]}})(Pn(({theme:e})=>({display:"block",transformOrigin:"top left",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",maxWidth:"100%",variants:[{props:({ownerState:t})=>t.formControl,style:{position:"absolute",left:0,top:0,transform:"translate(0, 20px) scale(1)"}},{props:{size:"small"},style:{transform:"translate(0, 17px) scale(1)"}},{props:({ownerState:t})=>t.shrink,style:{transform:"translate(0, -1.5px) scale(0.75)",transformOrigin:"top left",maxWidth:"133%"}},{props:({ownerState:t})=>!t.disableAnimation,style:{transition:e.transitions.create(["color","transform","max-width"],{duration:e.transitions.duration.shorter,easing:e.transitions.easing.easeOut})}},{props:{variant:"filled"},style:{zIndex:1,pointerEvents:"none",transform:"translate(12px, 16px) scale(1)",maxWidth:"calc(100% - 24px)"}},{props:{variant:"filled",size:"small"},style:{transform:"translate(12px, 13px) scale(1)"}},{props:({variant:t,ownerState:n})=>t==="filled"&&n.shrink,style:{userSelect:"none",pointerEvents:"auto",transform:"translate(12px, 7px) scale(0.75)",maxWidth:"calc(133% - 24px)"}},{props:({variant:t,ownerState:n,size:r})=>t==="filled"&&n.shrink&&r==="small",style:{transform:"translate(12px, 4px) scale(0.75)"}},{props:{variant:"outlined"},style:{zIndex:1,pointerEvents:"none",transform:"translate(14px, 16px) scale(1)",maxWidth:"calc(100% - 24px)"}},{props:{variant:"outlined",size:"small"},style:{transform:"translate(14px, 9px) scale(1)"}},{props:({variant:t,ownerState:n})=>t==="outlined"&&n.shrink,style:{userSelect:"none",pointerEvents:"auto",maxWidth:"calc(133% - 32px)",transform:"translate(14px, -9px) scale(0.75)"}}]}))),sx=T.forwardRef(function(e,t){const n=An({name:"MuiInputLabel",props:e}),{disableAnimation:r=!1,margin:o,shrink:a,variant:i,className:s,...c}=n,u=Oi();let f=a;typeof f>"u"&&u&&(f=u.filled||u.focused||u.adornedStart);const p=of({props:n,muiFormControl:u,states:["size","variant","required","focused"]}),y={...n,disableAnimation:r,formControl:u,shrink:f,size:p.size,variant:p.variant,required:p.required,focused:p.focused},g=dTe(y);return m.jsx(fTe,{"data-shrink":f,ref:t,className:Ot(g.root,s),...c,ownerState:y,classes:g})});function pTe(e){return Ut("MuiFormHelperText",e)}const yL=Lt("MuiFormHelperText",["root","error","disabled","sizeSmall","sizeMedium","contained","focused","filled","required"]);var bL;const hTe=e=>{const{classes:t,contained:n,size:r,disabled:o,error:a,filled:i,focused:s,required:c}=e,u={root:["root",o&&"disabled",a&&"error",r&&`size${bt(r)}`,n&&"contained",s&&"focused",i&&"filled",c&&"required"]};return zt(u,pTe,t)},mTe=Pe("p",{name:"MuiFormHelperText",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.size&&t[`size${bt(n.size)}`],n.contained&&t.contained,n.filled&&t.filled]}})(Pn(({theme:e})=>({color:(e.vars||e).palette.text.secondary,...e.typography.caption,textAlign:"left",marginTop:3,marginRight:0,marginBottom:0,marginLeft:0,[`&.${yL.disabled}`]:{color:(e.vars||e).palette.text.disabled},[`&.${yL.error}`]:{color:(e.vars||e).palette.error.main},variants:[{props:{size:"small"},style:{marginTop:4}},{props:({ownerState:t})=>t.contained,style:{marginLeft:14,marginRight:14}}]}))),v$=T.forwardRef(function(e,t){const n=An({props:e,name:"MuiFormHelperText"}),{children:r,className:o,component:a="p",disabled:i,error:s,filled:c,focused:u,margin:f,required:p,variant:y,...g}=n,b=Oi(),x=of({props:n,muiFormControl:b,states:["variant","size","disabled","error","filled","focused","required"]}),E={...n,component:a,contained:x.variant==="filled"||x.variant==="outlined",variant:x.variant,size:x.size,disabled:x.disabled,error:x.error,filled:x.filled,focused:x.focused,required:x.required};delete E.ownerState;const S=hTe(E);return m.jsx(mTe,{as:a,className:Ot(S.root,o),ref:t,...g,ownerState:E,children:r===" "?bL||(bL=m.jsx("span",{className:"notranslate","aria-hidden":!0,children:"​"})):r})});function mr(e){const{elementType:t,externalSlotProps:n,ownerState:r,skipResolvingSlotProps:o=!1,...a}=e,i=o?{}:Xp(n,r),{props:s,internalRef:c}=n$({...a,externalSlotProps:i}),u=cr(c,i?.ref,e.additionalProps?.ref);return t$(t,{...s,ref:u},r)}function gTe(e){return Ut("MuiList",e)}Lt("MuiList",["root","padding","dense","subheader"]);const yTe=e=>{const{classes:t,disablePadding:n,dense:r,subheader:o}=e;return zt({root:["root",!n&&"padding",r&&"dense",o&&"subheader"]},gTe,t)},bTe=Pe("ul",{name:"MuiList",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,!n.disablePadding&&t.padding,n.dense&&t.dense,n.subheader&&t.subheader]}})({listStyle:"none",margin:0,padding:0,position:"relative",variants:[{props:({ownerState:e})=>!e.disablePadding,style:{paddingTop:8,paddingBottom:8}},{props:({ownerState:e})=>e.subheader,style:{paddingTop:0}}]}),x$=T.forwardRef(function(e,t){const n=An({props:e,name:"MuiList"}),{children:r,className:o,component:a="ul",dense:i=!1,disablePadding:s=!1,subheader:c,...u}=n,f=T.useMemo(()=>({dense:i}),[i]),p={...n,component:a,dense:i,disablePadding:s},y=yTe(p);return m.jsx(ac.Provider,{value:f,children:m.jsxs(bTe,{as:a,className:Ot(y.root,o),ref:t,ownerState:p,...u,children:[c,r]})})});function pw(e,t,n){return e===t?e.firstChild:t&&t.nextElementSibling?t.nextElementSibling:n?null:e.firstChild}function vL(e,t,n){return e===t?n?e.firstChild:e.lastChild:t&&t.previousElementSibling?t.previousElementSibling:n?null:e.lastChild}function S$(e,t){if(t===void 0)return!0;let n=e.innerText;return n===void 0&&(n=e.textContent),n=n.trim().toLowerCase(),n.length===0?!1:t.repeating?n[0]===t.keys[0]:n.startsWith(t.keys.join(""))}function bg(e,t,n,r,o,a){let i=!1,s=o(e,t,t?n:!1);for(;s;){if(s===e.firstChild){if(i)return!1;i=!0}const c=r?!1:s.disabled||s.getAttribute("aria-disabled")==="true";if(!s.hasAttribute("tabindex")||!S$(s,a)||c)s=o(e,s,n);else return s.focus(),!0}return!1}const vTe=T.forwardRef(function(e,t){const{actions:n,autoFocus:r=!1,autoFocusItem:o=!1,children:a,className:i,disabledItemsFocusable:s=!1,disableListWrap:c=!1,onKeyDown:u,variant:f="selectedMenu",...p}=e,y=T.useRef(null),g=T.useRef({keys:[],repeating:!0,previousKeyMatched:!0,lastTime:null});Io(()=>{r&&y.current.focus()},[r]),T.useImperativeHandle(n,()=>({adjustStyleForScrollbar:(w,{direction:C})=>{const R=!y.current.style.width;if(w.clientHeight<y.current.clientHeight&&R){const M=`${r$(fc(w))}px`;y.current.style[C==="rtl"?"paddingLeft":"paddingRight"]=M,y.current.style.width=`calc(100% + ${M})`}return y.current}}),[]);const b=w=>{const C=y.current,R=w.key;if(w.ctrlKey||w.metaKey||w.altKey){u&&u(w);return}const M=Po(C).activeElement;if(R==="ArrowDown")w.preventDefault(),bg(C,M,c,s,pw);else if(R==="ArrowUp")w.preventDefault(),bg(C,M,c,s,vL);else if(R==="Home")w.preventDefault(),bg(C,null,c,s,pw);else if(R==="End")w.preventDefault(),bg(C,null,c,s,vL);else if(R.length===1){const D=g.current,I=R.toLowerCase(),L=performance.now();D.keys.length>0&&(L-D.lastTime>500?(D.keys=[],D.repeating=!0,D.previousKeyMatched=!0):D.repeating&&I!==D.keys[0]&&(D.repeating=!1)),D.lastTime=L,D.keys.push(I);const F=M&&!D.repeating&&S$(M,D);D.previousKeyMatched&&(F||bg(C,M,!1,s,pw,D))?w.preventDefault():D.previousKeyMatched=!1}u&&u(w)},x=cr(y,t);let E=-1;T.Children.forEach(a,(w,C)=>{if(!T.isValidElement(w)){E===C&&(E+=1,E>=a.length&&(E=-1));return}w.props.disabled||(f==="selectedMenu"&&w.props.selected||E===-1)&&(E=C),E===C&&(w.props.disabled||w.props.muiSkipListHighlight||w.type.muiSkipListHighlight)&&(E+=1,E>=a.length&&(E=-1))});const S=T.Children.map(a,(w,C)=>{if(C===E){const R={};return o&&(R.autoFocus=!0),w.props.tabIndex===void 0&&f==="selectedMenu"&&(R.tabIndex=0),T.cloneElement(w,R)}return w});return m.jsx(x$,{role:"menu",ref:x,className:i,onKeyDown:b,tabIndex:r?0:-1,...p,children:S})});function e2(e){return`scale(${e}, ${e**2})`}const xTe={entering:{opacity:1,transform:e2(1)},entered:{opacity:1,transform:"none"}},hw=typeof navigator<"u"&&/^((?!chrome|android).)*(safari|mobile)/i.test(navigator.userAgent)&&/(os |version\/)15(.|_)4/i.test(navigator.userAgent),Vy=T.forwardRef(function(e,t){const{addEndListener:n,appear:r=!0,children:o,easing:a,in:i,onEnter:s,onEntered:c,onEntering:u,onExit:f,onExited:p,onExiting:y,style:g,timeout:b="auto",TransitionComponent:x=ms,...E}=e,S=PS(),w=T.useRef(),C=_u(),R=T.useRef(null),M=cr(R,wh(o),t),D=$=>j=>{if($){const V=R.current;j===void 0?$(V):$(V,j)}},I=D(u),L=D(($,j)=>{i$($);const{duration:V,delay:z,easing:K}=Zp({style:g,timeout:b,easing:a},{mode:"enter"});let Y;b==="auto"?(Y=C.transitions.getAutoHeightDuration($.clientHeight),w.current=Y):Y=V,$.style.transition=[C.transitions.create("opacity",{duration:Y,delay:z}),C.transitions.create("transform",{duration:hw?Y:Y*.666,delay:z,easing:K})].join(","),s&&s($,j)}),F=D(c),B=D(y),U=D($=>{const{duration:j,delay:V,easing:z}=Zp({style:g,timeout:b,easing:a},{mode:"exit"});let K;b==="auto"?(K=C.transitions.getAutoHeightDuration($.clientHeight),w.current=K):K=j,$.style.transition=[C.transitions.create("opacity",{duration:K,delay:V}),C.transitions.create("transform",{duration:hw?K:K*.666,delay:hw?V:V||K*.333,easing:z})].join(","),$.style.opacity=0,$.style.transform=e2(.75),f&&f($)}),k=D(p);return m.jsx(x,{appear:r,in:i,nodeRef:R,onEnter:L,onEntered:F,onEntering:I,onExit:U,onExited:k,onExiting:B,addEndListener:$=>{b==="auto"&&S.start(w.current||0,$),n&&n(R.current,$)},timeout:b==="auto"?null:b,...E,children:($,{ownerState:j,...V})=>T.cloneElement(o,{style:{opacity:0,transform:e2(.75),visibility:$==="exited"&&!i?"hidden":void 0,...xTe[$],...g,...o.props.style},ref:M,...V})})});Vy&&(Vy.muiSupportAuto=!0);function STe(e){return Ut("MuiPopover",e)}Lt("MuiPopover",["root","paper"]);function xL(e,t){let n=0;return typeof t=="number"?n=t:t==="center"?n=e.height/2:t==="bottom"&&(n=e.height),n}function SL(e,t){let n=0;return typeof t=="number"?n=t:t==="center"?n=e.width/2:t==="right"&&(n=e.width),n}function EL(e){return[e.horizontal,e.vertical].map(t=>typeof t=="number"?`${t}px`:t).join(" ")}function I0(e){return typeof e=="function"?e():e}const ETe=e=>{const{classes:t}=e;return zt({root:["root"],paper:["paper"]},STe,t)},CTe=Pe(l$,{name:"MuiPopover",slot:"Root"})({}),E$=Pe(rf,{name:"MuiPopover",slot:"Paper"})({position:"absolute",overflowY:"auto",overflowX:"hidden",minWidth:16,minHeight:16,maxWidth:"calc(100% - 32px)",maxHeight:"calc(100% - 32px)",outline:0}),TTe=T.forwardRef(function(e,t){const n=An({props:e,name:"MuiPopover"}),{action:r,anchorEl:o,anchorOrigin:a={vertical:"top",horizontal:"left"},anchorPosition:i,anchorReference:s="anchorEl",children:c,className:u,container:f,elevation:p=8,marginThreshold:y=16,open:g,PaperProps:b={},slots:x={},slotProps:E={},transformOrigin:S={vertical:"top",horizontal:"left"},TransitionComponent:w,transitionDuration:C="auto",TransitionProps:R={},disableScrollLock:M=!1,...D}=n,I=T.useRef(),L={...n,anchorOrigin:a,anchorReference:s,elevation:p,marginThreshold:y,transformOrigin:S,TransitionComponent:w,transitionDuration:C,TransitionProps:R},F=ETe(L),B=T.useCallback(()=>{if(s==="anchorPosition")return i;const fe=I0(o),xe=(fe&&fe.nodeType===1?fe:Po(I.current).body).getBoundingClientRect();return{top:xe.top+xL(xe,a.vertical),left:xe.left+SL(xe,a.horizontal)}},[o,a.horizontal,a.vertical,i,s]),U=T.useCallback(fe=>({vertical:xL(fe,S.vertical),horizontal:SL(fe,S.horizontal)}),[S.horizontal,S.vertical]),k=T.useCallback(fe=>{const xe={width:fe.offsetWidth,height:fe.offsetHeight},ge=U(xe);if(s==="none")return{top:null,left:null,transformOrigin:EL(ge)};const Re=B();let de=Re.top-ge.vertical,me=Re.left-ge.horizontal;const Qe=de+xe.height,Me=me+xe.width,we=fc(I0(o)),Se=we.innerHeight-y,dt=we.innerWidth-y;if(y!==null&&de<y){const ze=de-y;de-=ze,ge.vertical+=ze}else if(y!==null&&Qe>Se){const ze=Qe-Se;de-=ze,ge.vertical+=ze}if(y!==null&&me<y){const ze=me-y;me-=ze,ge.horizontal+=ze}else if(Me>dt){const ze=Me-dt;me-=ze,ge.horizontal+=ze}return{top:`${Math.round(de)}px`,left:`${Math.round(me)}px`,transformOrigin:EL(ge)}},[o,s,B,U,y]),[$,j]=T.useState(g),V=T.useCallback(()=>{const fe=I.current;if(!fe)return;const xe=k(fe);xe.top!==null&&fe.style.setProperty("top",xe.top),xe.left!==null&&(fe.style.left=xe.left),fe.style.transformOrigin=xe.transformOrigin,j(!0)},[k]);T.useEffect(()=>(M&&window.addEventListener("scroll",V),()=>window.removeEventListener("scroll",V)),[o,M,V]);const z=()=>{V()},K=()=>{j(!1)};T.useEffect(()=>{g&&V()}),T.useImperativeHandle(r,()=>g?{updatePosition:()=>{V()}}:null,[g,V]),T.useEffect(()=>{if(!g)return;const fe=mB(()=>{V()}),xe=fc(I0(o));return xe.addEventListener("resize",fe),()=>{fe.clear(),xe.removeEventListener("resize",fe)}},[o,g,V]);let Y=C;const te={slots:{transition:w,...x},slotProps:{transition:R,paper:b,...E}},[_,Z]=tr("transition",{elementType:Vy,externalForwardedProps:te,ownerState:L,getSlotProps:fe=>({...fe,onEntering:(xe,ge)=>{fe.onEntering?.(xe,ge),z()},onExited:xe=>{fe.onExited?.(xe),K()}}),additionalProps:{appear:!0,in:g}});C==="auto"&&!_.muiSupportAuto&&(Y=void 0);const J=f||(o?Po(I0(o)).body:void 0),[W,{slots:re,slotProps:ne,...X}]=tr("root",{ref:t,elementType:CTe,externalForwardedProps:{...te,...D},shouldForwardComponentProp:!0,additionalProps:{slots:{backdrop:x.backdrop},slotProps:{backdrop:gB(typeof E.backdrop=="function"?E.backdrop(L):E.backdrop,{invisible:!0})},container:J,open:g},ownerState:L,className:Ot(F.root,u)}),[ie,ae]=tr("paper",{ref:I,className:F.paper,elementType:E$,externalForwardedProps:te,shouldForwardComponentProp:!0,additionalProps:{elevation:p,style:$?void 0:{opacity:0}},ownerState:L});return m.jsx(W,{...X,...!Qp(W)&&{slots:re,slotProps:ne,disableScrollLock:M},children:m.jsx(_,{...Z,timeout:Y,children:m.jsx(ie,{...ae,children:c})})})});function wTe(e){return Ut("MuiMenu",e)}Lt("MuiMenu",["root","paper","list"]);const kTe={vertical:"top",horizontal:"right"},ATe={vertical:"top",horizontal:"left"},DTe=e=>{const{classes:t}=e;return zt({root:["root"],paper:["paper"],list:["list"]},wTe,t)},OTe=Pe(TTe,{shouldForwardProp:e=>wa(e)||e==="classes",name:"MuiMenu",slot:"Root"})({}),RTe=Pe(E$,{name:"MuiMenu",slot:"Paper"})({maxHeight:"calc(100% - 96px)",WebkitOverflowScrolling:"touch"}),MTe=Pe(vTe,{name:"MuiMenu",slot:"List"})({outline:0}),NTe=T.forwardRef(function(e,t){const n=An({props:e,name:"MuiMenu"}),{autoFocus:r=!0,children:o,className:a,disableAutoFocusItem:i=!1,MenuListProps:s={},onClose:c,open:u,PaperProps:f={},PopoverClasses:p,transitionDuration:y="auto",TransitionProps:{onEntering:g,...b}={},variant:x="selectedMenu",slots:E={},slotProps:S={},...w}=n,C=js(),R={...n,autoFocus:r,disableAutoFocusItem:i,MenuListProps:s,onEntering:g,PaperProps:f,transitionDuration:y,TransitionProps:b,variant:x},M=DTe(R),D=r&&!i&&u,I=T.useRef(null),L=(Y,te)=>{I.current&&I.current.adjustStyleForScrollbar(Y,{direction:C?"rtl":"ltr"}),g&&g(Y,te)},F=Y=>{Y.key==="Tab"&&(Y.preventDefault(),c&&c(Y,"tabKeyDown"))};let B=-1;T.Children.map(o,(Y,te)=>{T.isValidElement(Y)&&(Y.props.disabled||(x==="selectedMenu"&&Y.props.selected||B===-1)&&(B=te))});const U={slots:E,slotProps:{list:s,transition:b,paper:f,...S}},k=mr({elementType:E.root,externalSlotProps:S.root,ownerState:R,className:[M.root,a]}),[$,j]=tr("paper",{className:M.paper,elementType:RTe,externalForwardedProps:U,shouldForwardComponentProp:!0,ownerState:R}),[V,z]=tr("list",{className:Ot(M.list,s.className),elementType:MTe,shouldForwardComponentProp:!0,externalForwardedProps:U,getSlotProps:Y=>({...Y,onKeyDown:te=>{F(te),Y.onKeyDown?.(te)}}),ownerState:R}),K=typeof U.slotProps.transition=="function"?U.slotProps.transition(R):U.slotProps.transition;return m.jsx(OTe,{onClose:c,anchorOrigin:{vertical:"bottom",horizontal:C?"right":"left"},transformOrigin:C?kTe:ATe,slots:{root:E.root,paper:$,backdrop:E.backdrop,...E.transition&&{transition:E.transition}},slotProps:{root:k,paper:j,backdrop:typeof S.backdrop=="function"?S.backdrop(R):S.backdrop,transition:{...K,onEntering:(...Y)=>{L(...Y),K?.onEntering?.(...Y)}}},open:u,ref:t,transitionDuration:y,ownerState:R,...w,classes:p,children:m.jsx(V,{actions:I,autoFocus:r&&(B===-1||i),autoFocusItem:D,variant:x,...z,children:o})})});function PTe(e){return Ut("MuiNativeSelect",e)}const qD=Lt("MuiNativeSelect",["root","select","multiple","filled","outlined","standard","disabled","icon","iconOpen","iconFilled","iconOutlined","iconStandard","nativeInput","error"]),ITe=e=>{const{classes:t,variant:n,disabled:r,multiple:o,open:a,error:i}=e,s={select:["select",n,r&&"disabled",o&&"multiple",i&&"error"],icon:["icon",`icon${bt(n)}`,a&&"iconOpen",r&&"disabled"]};return zt(s,PTe,t)},C$=Pe("select",{name:"MuiNativeSelect"})(({theme:e})=>({MozAppearance:"none",WebkitAppearance:"none",userSelect:"none",borderRadius:0,cursor:"pointer","&:focus":{borderRadius:0},[`&.${qD.disabled}`]:{cursor:"default"},"&[multiple]":{height:"auto"},"&:not([multiple]) option, &:not([multiple]) optgroup":{backgroundColor:(e.vars||e).palette.background.paper},variants:[{props:({ownerState:t})=>t.variant!=="filled"&&t.variant!=="outlined",style:{"&&&":{paddingRight:24,minWidth:16}}},{props:{variant:"filled"},style:{"&&&":{paddingRight:32}}},{props:{variant:"outlined"},style:{borderRadius:(e.vars||e).shape.borderRadius,"&:focus":{borderRadius:(e.vars||e).shape.borderRadius},"&&&":{paddingRight:32}}}]})),_Te=Pe(C$,{name:"MuiNativeSelect",slot:"Select",shouldForwardProp:wa,overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.select,t[n.variant],n.error&&t.error,{[`&.${qD.multiple}`]:t.multiple}]}})({}),T$=Pe("svg",{name:"MuiNativeSelect"})(({theme:e})=>({position:"absolute",right:0,top:"calc(50% - .5em)",pointerEvents:"none",color:(e.vars||e).palette.action.active,[`&.${qD.disabled}`]:{color:(e.vars||e).palette.action.disabled},variants:[{props:({ownerState:t})=>t.open,style:{transform:"rotate(180deg)"}},{props:{variant:"filled"},style:{right:7}},{props:{variant:"outlined"},style:{right:7}}]})),LTe=Pe(T$,{name:"MuiNativeSelect",slot:"Icon",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.icon,n.variant&&t[`icon${bt(n.variant)}`],n.open&&t.iconOpen]}})({}),FTe=T.forwardRef(function(e,t){const{className:n,disabled:r,error:o,IconComponent:a,inputRef:i,variant:s="standard",...c}=e,u={...e,disabled:r,variant:s,error:o},f=ITe(u);return m.jsxs(T.Fragment,{children:[m.jsx(_Te,{ownerState:u,className:Ot(f.select,n),disabled:r,ref:i||t,...c}),e.multiple?null:m.jsx(LTe,{as:a,ownerState:u,className:f.icon})]})});function w$(e){return Ut("MuiSelect",e)}const vg=Lt("MuiSelect",["root","select","multiple","filled","outlined","standard","disabled","focused","icon","iconOpen","iconFilled","iconOutlined","iconStandard","nativeInput","error"]);var CL;const jTe=Pe(C$,{name:"MuiSelect",slot:"Select",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[{[`&.${vg.select}`]:t.select},{[`&.${vg.select}`]:t[n.variant]},{[`&.${vg.error}`]:t.error},{[`&.${vg.multiple}`]:t.multiple}]}})({[`&.${vg.select}`]:{height:"auto",minHeight:"1.4375em",textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden"}}),BTe=Pe(T$,{name:"MuiSelect",slot:"Icon",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.icon,n.variant&&t[`icon${bt(n.variant)}`],n.open&&t.iconOpen]}})({}),$Te=Pe("input",{shouldForwardProp:e=>hB(e)&&e!=="classes",name:"MuiSelect",slot:"NativeInput"})({bottom:0,left:0,position:"absolute",opacity:0,pointerEvents:"none",width:"100%",boxSizing:"border-box"});function TL(e,t){return typeof t=="object"&&t!==null?e===t:String(e)===String(t)}function zTe(e){return e==null||typeof e=="string"&&!e.trim()}const HTe=e=>{const{classes:t,variant:n,disabled:r,multiple:o,open:a,error:i}=e,s={select:["select",n,r&&"disabled",o&&"multiple",i&&"error"],icon:["icon",`icon${bt(n)}`,a&&"iconOpen",r&&"disabled"],nativeInput:["nativeInput"]};return zt(s,w$,t)},UTe=T.forwardRef(function(e,t){const{"aria-describedby":n,"aria-label":r,autoFocus:o,autoWidth:a,children:i,className:s,defaultOpen:c,defaultValue:u,disabled:f,displayEmpty:p,error:y=!1,IconComponent:g,inputRef:b,labelId:x,MenuProps:E={},multiple:S,name:w,onBlur:C,onChange:R,onClose:M,onFocus:D,onOpen:I,open:L,readOnly:F,renderValue:B,required:U,SelectDisplayProps:k={},tabIndex:$,type:j,value:V,variant:z="standard",...K}=e,[Y,te]=xi({controlled:V,default:u,name:"Select"}),[_,Z]=xi({controlled:L,default:c,name:"Select"}),J=T.useRef(null),W=T.useRef(null),[re,ne]=T.useState(null),{current:X}=T.useRef(L!=null),[ie,ae]=T.useState(),fe=cr(t,b),xe=T.useCallback(pt=>{W.current=pt,pt&&ne(pt)},[]),ge=re?.parentNode;T.useImperativeHandle(fe,()=>({focus:()=>{W.current.focus()},node:J.current,value:Y}),[Y]),T.useEffect(()=>{c&&_&&re&&!X&&(ae(a?null:ge.clientWidth),W.current.focus())},[re,a]),T.useEffect(()=>{o&&W.current.focus()},[o]),T.useEffect(()=>{if(!x)return;const pt=Po(W.current).getElementById(x);if(pt){const Te=()=>{getSelection().isCollapsed&&W.current.focus()};return pt.addEventListener("click",Te),()=>{pt.removeEventListener("click",Te)}}},[x]);const Re=(pt,Te)=>{pt?I&&I(Te):M&&M(Te),X||(ae(a?null:ge.clientWidth),Z(pt))},de=pt=>{pt.button===0&&(pt.preventDefault(),W.current.focus(),Re(!0,pt))},me=pt=>{Re(!1,pt)},Qe=T.Children.toArray(i),Me=pt=>{const Te=Qe.find(Ue=>Ue.props.value===pt.target.value);Te!==void 0&&(te(Te.props.value),R&&R(pt,Te))},we=pt=>Te=>{let Ue;if(Te.currentTarget.hasAttribute("tabindex")){if(S){Ue=Array.isArray(Y)?Y.slice():[];const yt=Y.indexOf(pt.props.value);yt===-1?Ue.push(pt.props.value):Ue.splice(yt,1)}else Ue=pt.props.value;if(pt.props.onClick&&pt.props.onClick(Te),Y!==Ue&&(te(Ue),R)){const yt=Te.nativeEvent||Te,ht=new yt.constructor(yt.type,yt);Object.defineProperty(ht,"target",{writable:!0,value:{value:Ue,name:w}}),R(ht,pt)}S||Re(!1,Te)}},Se=pt=>{F||[" ","ArrowUp","ArrowDown","Enter"].includes(pt.key)&&(pt.preventDefault(),Re(!0,pt))},dt=re!==null&&_,ze=pt=>{!dt&&C&&(Object.defineProperty(pt,"target",{writable:!0,value:{value:Y,name:w}}),C(pt))};delete K["aria-invalid"];let tt,Ze;const qt=[];let Vt=!1;(ax({value:Y})||p)&&(B?tt=B(Y):Vt=!0);const Mt=Qe.map(pt=>{if(!T.isValidElement(pt))return null;let Te;if(S){if(!Array.isArray(Y))throw new Error(uc(2));Te=Y.some(Ue=>TL(Ue,pt.props.value)),Te&&Vt&&qt.push(pt.props.children)}else Te=TL(Y,pt.props.value),Te&&Vt&&(Ze=pt.props.children);return T.cloneElement(pt,{"aria-selected":Te?"true":"false",onClick:we(pt),onKeyUp:Ue=>{Ue.key===" "&&Ue.preventDefault(),pt.props.onKeyUp&&pt.props.onKeyUp(Ue)},role:"option",selected:Te,value:void 0,"data-value":pt.props.value})});Vt&&(S?qt.length===0?tt=null:tt=qt.reduce((pt,Te,Ue)=>(pt.push(Te),Ue<qt.length-1&&pt.push(", "),pt),[]):tt=Ze);let ke=ie;!a&&X&&re&&(ke=ge.clientWidth);let Ne;typeof $<"u"?Ne=$:Ne=f?null:0;const lt=k.id||(w?`mui-component-select-${w}`:void 0),St={...e,variant:z,value:Y,open:dt,error:y},ft=HTe(St),$e={...E.PaperProps,...typeof E.slotProps?.paper=="function"?E.slotProps.paper(St):E.slotProps?.paper},Ht={...E.MenuListProps,...typeof E.slotProps?.list=="function"?E.slotProps.list(St):E.slotProps?.list},$t=Bs();return m.jsxs(T.Fragment,{children:[m.jsx(jTe,{as:"div",ref:xe,tabIndex:Ne,role:"combobox","aria-controls":dt?$t:void 0,"aria-disabled":f?"true":void 0,"aria-expanded":dt?"true":"false","aria-haspopup":"listbox","aria-label":r,"aria-labelledby":[x,lt].filter(Boolean).join(" ")||void 0,"aria-describedby":n,"aria-required":U?"true":void 0,"aria-invalid":y?"true":void 0,onKeyDown:Se,onMouseDown:f||F?null:de,onBlur:ze,onFocus:D,...k,ownerState:St,className:Ot(k.className,ft.select,s),id:lt,children:zTe(tt)?CL||(CL=m.jsx("span",{className:"notranslate","aria-hidden":!0,children:"​"})):tt}),m.jsx($Te,{"aria-invalid":y,value:Array.isArray(Y)?Y.join(","):Y,name:w,ref:J,"aria-hidden":!0,onChange:Me,tabIndex:-1,disabled:f,className:ft.nativeInput,autoFocus:o,required:U,...K,ownerState:St}),m.jsx(BTe,{as:g,className:ft.icon,ownerState:St}),m.jsx(NTe,{id:`menu-${w||""}`,anchorEl:ge,open:dt,onClose:me,anchorOrigin:{vertical:"bottom",horizontal:"center"},transformOrigin:{vertical:"top",horizontal:"center"},...E,slotProps:{...E.slotProps,list:{"aria-labelledby":x,role:"listbox","aria-multiselectable":S?"true":void 0,disableListWrap:!0,id:$t,...Ht},paper:{...$e,style:{minWidth:ke,...$e!=null?$e.style:null}}},children:Mt})]})}),k$=Fn(m.jsx("path",{d:"M7 10l5 5 5-5z"})),VTe=e=>{const{classes:t}=e,n=zt({root:["root"]},w$,t);return{...t,...n}},GD={name:"MuiSelect",slot:"Root",shouldForwardProp:e=>wa(e)&&e!=="variant"},WTe=Pe(UD,GD)(""),qTe=Pe(WD,GD)(""),GTe=Pe(VD,GD)(""),lx=T.forwardRef(function(e,t){const n=An({name:"MuiSelect",props:e}),{autoWidth:r=!1,children:o,classes:a={},className:i,defaultOpen:s=!1,displayEmpty:c=!1,IconComponent:u=k$,id:f,input:p,inputProps:y,label:g,labelId:b,MenuProps:x,multiple:E=!1,native:S=!1,onClose:w,onOpen:C,open:R,renderValue:M,SelectDisplayProps:D,variant:I="outlined",...L}=n,F=S?FTe:UTe,B=Oi(),U=of({props:n,muiFormControl:B,states:["variant","error"]}),k=U.variant||I,$={...n,variant:k,classes:a},j=VTe($),{root:V,...z}=j,K=p||{standard:m.jsx(WTe,{ownerState:$}),outlined:m.jsx(qTe,{label:g,ownerState:$}),filled:m.jsx(GTe,{ownerState:$})}[k],Y=cr(t,wh(K));return m.jsx(T.Fragment,{children:T.cloneElement(K,{inputComponent:F,inputProps:{children:o,error:U.error,IconComponent:u,variant:k,type:void 0,multiple:E,...S?{id:f}:{autoWidth:r,defaultOpen:s,displayEmpty:c,labelId:b,MenuProps:x,onClose:w,onOpen:C,open:R,renderValue:M,SelectDisplayProps:{id:f,...D}},...y,classes:y?sa(z,y.classes):z,...p?p.props.inputProps:{}},...(E&&S||c)&&k==="outlined"?{notched:!0}:{},ref:Y,className:Ot(K.props.className,i,j.root),...!p&&{variant:k},...L})})});lx.muiName="Select";function YTe(e){return Ut("MuiTextField",e)}Lt("MuiTextField",["root"]);const KTe={standard:UD,filled:VD,outlined:WD},QTe=e=>{const{classes:t}=e;return zt({root:["root"]},YTe,t)},XTe=Pe(ix,{name:"MuiTextField",slot:"Root"})({}),Wn=T.forwardRef(function(e,t){const n=An({props:e,name:"MuiTextField"}),{autoComplete:r,autoFocus:o=!1,children:a,className:i,color:s="primary",defaultValue:c,disabled:u=!1,error:f=!1,FormHelperTextProps:p,fullWidth:y=!1,helperText:g,id:b,InputLabelProps:x,inputProps:E,InputProps:S,inputRef:w,label:C,maxRows:R,minRows:M,multiline:D=!1,name:I,onBlur:L,onChange:F,onFocus:B,placeholder:U,required:k=!1,rows:$,select:j=!1,SelectProps:V,slots:z={},slotProps:K={},type:Y,value:te,variant:_="outlined",...Z}=n,J={...n,autoFocus:o,color:s,disabled:u,error:f,fullWidth:y,multiline:D,required:k,select:j,variant:_},W=QTe(J),re=Bs(b),ne=g&&re?`${re}-helper-text`:void 0,X=C&&re?`${re}-label`:void 0,ie=KTe[_],ae={slots:z,slotProps:{input:S,inputLabel:x,htmlInput:E,formHelperText:p,select:V,...K}},fe={},xe=ae.slotProps.inputLabel;_==="outlined"&&(xe&&typeof xe.shrink<"u"&&(fe.notched=xe.shrink),fe.label=C),j&&((!V||!V.native)&&(fe.id=void 0),fe["aria-describedby"]=void 0);const[ge,Re]=tr("root",{elementType:XTe,shouldForwardComponentProp:!0,externalForwardedProps:{...ae,...Z},ownerState:J,className:Ot(W.root,i),ref:t,additionalProps:{disabled:u,error:f,fullWidth:y,required:k,color:s,variant:_}}),[de,me]=tr("input",{elementType:ie,externalForwardedProps:ae,additionalProps:fe,ownerState:J}),[Qe,Me]=tr("inputLabel",{elementType:sx,externalForwardedProps:ae,ownerState:J}),[we,Se]=tr("htmlInput",{elementType:"input",externalForwardedProps:ae,ownerState:J}),[dt,ze]=tr("formHelperText",{elementType:v$,externalForwardedProps:ae,ownerState:J}),[tt,Ze]=tr("select",{elementType:lx,externalForwardedProps:ae,ownerState:J}),qt=m.jsx(de,{"aria-describedby":ne,autoComplete:r,autoFocus:o,defaultValue:c,fullWidth:y,multiline:D,name:I,rows:$,maxRows:R,minRows:M,type:Y,value:te,id:re,inputRef:w,onBlur:L,onChange:F,onFocus:B,placeholder:U,inputProps:Se,slots:{input:z.htmlInput?we:void 0},...me});return m.jsxs(ge,{...Re,children:[C!=null&&C!==""&&m.jsx(Qe,{htmlFor:re,id:X,...Me,children:C}),j?m.jsx(tt,{"aria-describedby":ne,id:re,labelId:X,value:te,input:qt,...Ze,children:a}):qt,g&&m.jsx(dt,{id:ne,...ze,children:g})]})}),oc={postgres:[{label:"Host",name:"host",type:"text",required:!1},{label:"Port",name:"port",type:"number",required:!1},{label:"Database Name",name:"databaseName",type:"text",required:!1},{label:"User Name",name:"userName",type:"text",required:!1},{label:"Password",name:"password",type:"password",required:!1},{label:"Connection String",name:"connectionString",type:"text",required:!1}],bigquery:[{label:"Project ID",name:"defaultProjectId",type:"text",required:!1},{label:"Billing Project ID",name:"billingProjectId",type:"text",required:!1},{label:"Location",name:"location",type:"text",required:!1},{label:"Service Account Key JSON",name:"serviceAccountKeyJson",type:"text",required:!0},{label:"Maximum Bytes Billed",name:"maximumBytesBilled",type:"text",required:!1},{label:"Query Timeout Milliseconds",name:"queryTimeoutMilliseconds",type:"text",required:!1}],snowflake:[{label:"Account",name:"account",type:"text",required:!0},{label:"Username",name:"username",type:"text",required:!0},{label:"Password",name:"password",type:"password",required:!1},{label:"Role",name:"role",type:"text",required:!1},{label:"Warehouse",name:"warehouse",type:"text",required:!0},{label:"Database",name:"database",type:"text",required:!1},{label:"Schema",name:"schema",type:"text",required:!1},{label:"Response Timeout Milliseconds",name:"responseTimeoutMilliseconds",type:"text",required:!1},{label:"Private Key",name:"privateKey",type:"password",required:!1},{label:"Private Key Passphrase",name:"privateKeyPass",type:"password",required:!1}],trino:[{label:"Server",name:"server",type:"text",required:!0},{label:"Port",name:"port",type:"number",required:!1},{label:"Catalog",name:"catalog",type:"text",required:!1},{label:"Schema",name:"schema",type:"text",required:!1},{label:"User",name:"user",type:"text",required:!0},{label:"Password",name:"password",type:"password",required:!1},{label:"Peaka Key",name:"peakaKey",type:"password",required:!1}],databricks:[{label:"Host",name:"host",type:"text",required:!0},{label:"HTTP Path",name:"path",type:"text",required:!0},{label:"Access Token",name:"token",type:"password",required:!1},{label:"OAuth Client ID",name:"oauthClientId",type:"text",required:!1},{label:"OAuth Client Secret",name:"oauthClientSecret",type:"password",required:!1},{label:"Default Catalog",name:"defaultCatalog",type:"text",required:!1},{label:"Default Schema",name:"defaultSchema",type:"text",required:!1}],mysql:[{label:"Host",name:"host",type:"text",required:!0},{label:"Port",name:"port",type:"number",required:!0},{label:"User",name:"user",type:"text",required:!0},{label:"Password",name:"password",type:"password",required:!0},{label:"Database",name:"database",type:"text",required:!0}],duckdb:[],motherduck:[{label:"Access Token",name:"accessToken",type:"text",required:!0},{label:"Database",name:"database",type:"text",required:!1}],ducklake:[],publisher:[]},m1={postgres:"postgresConnection",bigquery:"bigqueryConnection",snowflake:"snowflakeConnection",trino:"trinoConnection",databricks:"databricksConnection",mysql:"mysqlConnection",duckdb:"duckdbConnection",motherduck:"motherduckConnection",ducklake:"ducklakeConnection",publisher:"publisherConnection"},A$=Object.values(FI).filter(e=>e!==FI.Publisher),t2={postgres:"postgresConnection",bigquery:"bigqueryConnection",snowflake:"snowflakeConnection",gcs:"gcsConnection",s3:"s3Connection",azure:"azureConnection"},Wy=[{label:"Access Key ID",name:"accessKeyId",type:"text",required:!0},{label:"Secret Access Key",name:"secretAccessKey",type:"password",required:!0},{label:"Region",name:"region",type:"text",required:!1},{label:"Endpoint",name:"endpoint",type:"text",required:!1},{label:"Session Token",name:"sessionToken",type:"password",required:!1}],qy=[{label:"Key ID",name:"keyId",type:"text",required:!0},{label:"Secret",name:"secret",type:"password",required:!0}],ZTe=[{label:"Auth Type",name:"authType",type:"text",required:!0,selectOptions:[{label:"SAS Token",value:"sas_token"},{label:"Service Principal (SPN)",value:"service_principal"}]},{label:"SAS URL (e.g. https://account.blob.core.windows.net/container/file.parquet?sp=r&st=...)",name:"sasUrl",type:"text",required:!1,visibleWhen:{field:"authType",value:"sas_token"}},{label:"Tenant ID",name:"tenantId",type:"text",required:!1,visibleWhen:{field:"authType",value:"service_principal"}},{label:"Client ID",name:"clientId",type:"text",required:!1,visibleWhen:{field:"authType",value:"service_principal"}},{label:"Client Secret",name:"clientSecret",type:"password",required:!1,visibleWhen:{field:"authType",value:"service_principal"}},{label:"Account Name",name:"accountName",type:"text",required:!1,visibleWhen:{field:"authType",value:"service_principal"}},{label:"File URL (e.g. abfss://container/path/file.parquet)",name:"fileUrl",type:"text",required:!1,visibleWhen:{field:"authType",value:"service_principal"}}];function cx(e){return e==="postgres"||e==="bigquery"||e==="snowflake"?oc[e]||[]:e==="s3"?Wy:e==="gcs"?qy:e==="azure"?ZTe:[]}function JTe({onSubmit:e,isSubmitting:t}){const[n,r]=T.useState(!1),[o,a]=T.useState("postgres"),[i,s]=T.useState([]),[c,u]=T.useState("postgres"),[f,p]=T.useState("s3"),y=()=>{r(!0)},g=()=>{r(!1),s([]),a("postgres"),u("postgres"),p("s3")},b=async w=>{w.preventDefault();const C=new FormData(w.currentTarget),R=C.get("name")?.toString(),M=C.get("type")?.toString(),D=oc[M];if(!R)throw new Error("Name is required");if(!M)throw new Error("Type is required");let I;if(M==="ducklake"){const L={};if(c==="postgres"){const U=oc.postgres,k={};if(U.forEach($=>{const j=C.get(`ducklake_pg_${$.name}`)?.toString();j&&(k[$.name]=j)}),Object.keys(k).length===0)throw new Error("DuckLake requires catalog connection");L.postgresConnection=k}const F=C.get("ducklake_bucketUrl")?.toString();if(!F)throw new Error("DuckLake requires a bucket URL");const B={bucketUrl:F};if(f==="s3"){const U={};if(Wy.forEach(k=>{const $=C.get(`ducklake_s3_${k.name}`)?.toString();$&&(U[k.name]=$)}),!U.accessKeyId)throw new Error("S3 Access Key ID is required");if(!U.secretAccessKey)throw new Error("S3 Secret Access Key is required");Object.keys(U).length>0&&(B.s3Connection=U)}else if(f==="gcs"){const U={};if(qy.forEach(k=>{const $=C.get(`ducklake_gcs_${k.name}`)?.toString();$&&(U[k.name]=$)}),!U.keyId)throw new Error("GCS Key ID is required");if(!U.secret)throw new Error("GCS Secret is required");Object.keys(U).length>0&&(B.gcsConnection=U)}I={name:R,type:M,ducklakeConnection:{catalog:L,storage:B}}}else if(M==="duckdb"){if(i.length===0)throw new Error("DuckDB connection must have at least one attached database");const L=i.map((F,B)=>{const U=F.dbType,k=C.get(`attachedDb_${B}_name`)?.toString();if(!k)throw new Error(`Attached database at index ${B} must have a name`);const $={name:k,type:U},j=cx(U);if(j&&j.length>0){const V={};j.forEach(K=>{const Y=C.get(`attachedDb_${B}_${K.name}`)?.toString();Y&&(V[K.name]=Y)});const z=t2[U];z&&($[z]=V)}return $});I={name:R,type:M,duckdbConnection:{attachedDatabases:L}}}else{const L={};if(D.forEach(F=>{const B=C.get(F.name)?.toString();B&&(L[F.name]=B)}),M==="postgres"){if(!L.connectionString?.trim()){const F=["host","port","databaseName","userName","password"];for(const B of F)if(!L[B])throw new Error(`${D.find(U=>U.name===B)?.label||B} is required`)}}else if(M==="bigquery"){if(!L.serviceAccountKeyJson)throw new Error("Service Account Key JSON is required")}else if(M==="snowflake"){if(!L.account)throw new Error("Account is required");if(!L.username)throw new Error("Username is required");if(!L.warehouse)throw new Error("Warehouse is required");if(!L.password&&!L.privateKey)throw new Error("Either password or private key is required")}else if(M==="trino"){if(!L.server)throw new Error("Server is required");if(!L.user)throw new Error("User is required");if(L.server.trim().startsWith("https://")&&!L.password&&!L.peakaKey)throw new Error("Password is required for HTTPS connections (or use Peaka Key)")}else if(M==="mysql"){const F=["host","port","database","user","password"];for(const B of F)if(!L[B])throw new Error(`${D.find(U=>U.name===B)?.label||B} is required`)}else if(M==="motherduck"){if(!L.accessToken)throw new Error("Access Token is required")}else if(M==="databricks"){if(!L.host)throw new Error("Host is required");if(!L.path)throw new Error("HTTP Path is required");const F=L.oauthClientId&&L.oauthClientSecret;if(!L.token&&!F)throw new Error("Either Access Token or OAuth Client ID + Secret is required")}I={name:R,type:M,[m1[M]]:L}}await e(I),g()},x=()=>{s([...i,{name:"",dbType:"postgres"}])},E=w=>{s(i.filter((C,R)=>R!==w))},S=(w,C)=>{const R=[...i];R[w]={...R[w],dbType:C},s(R)};return m.jsxs(vt.Fragment,{children:[m.jsx(Zr,{variant:"outlined",onClick:y,children:"Add Connection"}),m.jsxs(Dl,{open:n,onClose:g,children:[m.jsx(gc,{children:"Create New Connection"}),m.jsxs(Rl,{children:[m.jsx(Rb,{children:"Add a new connection to query your data database using Malloy."}),m.jsxs("form",{onSubmit:b,id:"connection-form",children:[m.jsx(Wn,{autoFocus:!0,required:!0,margin:"dense",id:"name",name:"name",label:"Connection Name",type:"text",fullWidth:!0,variant:"standard"}),m.jsx(Wn,{margin:"dense",id:"type",name:"type",label:"Connection Type",fullWidth:!0,variant:"standard",value:o,select:!0,onChange:w=>a(w.target.value),children:A$.map(w=>m.jsx(Mo,{value:w,children:w},w))}),o==="ducklake"?m.jsxs(Ur,{sx:{mt:2},children:[m.jsxs(Ur,{sx:{mb:3,p:2,border:"1px solid",borderColor:"divider",borderRadius:1},children:[m.jsx(lr,{variant:"subtitle2",sx:{mb:2},fontWeight:500,children:"Catalog"}),m.jsx(Wn,{margin:"dense",id:"ducklake_catalogType",label:"Catalog Type",fullWidth:!0,variant:"standard",value:c,select:!0,onChange:w=>u(w.target.value),children:m.jsx(Mo,{value:"postgres",children:"PostgreSQL"})}),c==="postgres"&&m.jsx(m.Fragment,{children:oc.postgres.map(w=>m.jsx(Wn,{margin:"dense",id:`ducklake_pg_${w.name}`,name:`ducklake_pg_${w.name}`,label:w.label,type:w.type,fullWidth:!0,variant:"standard"},`pg_${w.name}`))})]}),m.jsxs(Ur,{sx:{mb:3,p:2,border:"1px solid",borderColor:"divider",borderRadius:1},children:[m.jsx(lr,{variant:"subtitle2",sx:{mb:2},fontWeight:500,children:"Storage"}),m.jsxs(Wn,{margin:"dense",id:"ducklake_storageType",label:"Storage Type",fullWidth:!0,variant:"standard",value:f,select:!0,onChange:w=>p(w.target.value),children:[m.jsx(Mo,{value:"s3",children:"S3"}),m.jsx(Mo,{value:"gcs",children:"GCS"})]}),m.jsx(Wn,{margin:"dense",required:!0,id:"ducklake_bucketUrl",name:"ducklake_bucketUrl",label:f==="s3"?"Bucket URL (e.g. s3://my-bucket/path)":"Bucket URL (e.g. gs://my-bucket/path)",type:"text",fullWidth:!0,variant:"standard"}),f==="s3"&&m.jsxs(m.Fragment,{children:[m.jsx(lr,{variant:"caption",sx:{mt:2,mb:1,display:"block"},color:"text.secondary",children:"S3 Credentials"}),Wy.map(w=>m.jsx(Wn,{margin:"dense",id:`ducklake_s3_${w.name}`,name:`ducklake_s3_${w.name}`,label:w.label,type:w.type,fullWidth:!0,variant:"standard",required:w.required,placeholder:w.name==="region"?"us-east-1":void 0},`s3_${w.name}`))]}),f==="gcs"&&m.jsxs(m.Fragment,{children:[m.jsx(lr,{variant:"caption",sx:{mt:2,mb:1,display:"block"},color:"text.secondary",children:"GCS Credentials"}),qy.map(w=>m.jsx(Wn,{margin:"dense",id:`ducklake_gcs_${w.name}`,name:`ducklake_gcs_${w.name}`,label:w.label,type:w.type,fullWidth:!0,variant:"standard",required:w.required},`gcs_${w.name}`))]})]})]}):o==="duckdb"?m.jsxs(Ur,{sx:{mt:2},children:[m.jsxs(Ur,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",mb:2},children:[m.jsx(lr,{variant:"subtitle1",fontWeight:500,children:"Attached Databases"}),m.jsx(Zr,{startIcon:m.jsx(Sb,{}),onClick:x,size:"small",variant:"outlined",children:"Add Database"})]}),i.length===0&&m.jsx(lr,{variant:"body2",color:"text.secondary",sx:{mb:2},children:'DuckDB connections require at least one attached database. Click "Add Database" to get started.'}),i.map((w,C)=>{const R=cx(w.dbType);return m.jsxs(Ur,{sx:{mb:3,p:2,border:"1px solid",borderColor:"divider",borderRadius:1},children:[m.jsxs(Ur,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",mb:2},children:[m.jsxs(lr,{variant:"subtitle2",children:["Database ",C+1]}),m.jsx(gs,{onClick:()=>E(C),size:"small",color:"error",children:m.jsx(y$,{fontSize:"small"})})]}),m.jsx(Wn,{margin:"dense",required:!0,id:`attachedDb_${C}_name`,name:`attachedDb_${C}_name`,label:"Database Name",type:"text",fullWidth:!0,variant:"standard",defaultValue:w.name}),m.jsx(Wn,{margin:"dense",id:`attachedDb_${C}_type`,name:`attachedDb_${C}_type`,label:"Database Type",fullWidth:!0,variant:"standard",value:w.dbType,select:!0,onChange:M=>S(C,M.target.value),children:Object.values(nj).map(M=>m.jsx(Mo,{value:M,children:M},M))}),R.filter(M=>M.visibleWhen?(w[M.visibleWhen.field]||R.find(D=>D.name===M.visibleWhen?.field)?.selectOptions?.[0]?.value)===M.visibleWhen.value:!0).map(M=>m.jsx(Wn,{margin:"dense",id:`attachedDb_${C}_${M.name}`,name:`attachedDb_${C}_${M.name}`,label:M.label,type:M.selectOptions?void 0:M.type,fullWidth:!0,variant:"standard",required:M.required,select:!!M.selectOptions,defaultValue:M.selectOptions?.[0]?.value,onChange:M.selectOptions?D=>{const I=[...i];I[C]={...I[C],[M.name]:D.target.value},s(I)}:void 0,children:M.selectOptions?.map(D=>m.jsx(Mo,{value:D.value,children:D.label},D.value))},M.name))]},C)})]}):oc[o].map(w=>m.jsx(Wn,{margin:"dense",id:w.name,name:w.name,label:w.label,type:w.type,fullWidth:!0,variant:"standard",required:w.required},w.name))]})]}),m.jsxs(Ol,{children:[m.jsx(Zr,{disabled:t,onClick:g,children:"Cancel"}),m.jsx(Zr,{type:"submit",form:"connection-form",loading:t,children:"Create Connection"})]})]})]})}function ewe({connection:e,onCloseDialog:t,isMutating:n,onDelete:r}){const[o,a]=T.useState(!1),[i,s]=T.useState(""),c=()=>{a(!0)},u=()=>{a(!1),t()};return m.jsxs(vt.Fragment,{children:[m.jsxs(Mo,{"aria-label":`Delete connection ${e?.name??""}`.trim(),onClick:f=>{f.stopPropagation(),c()},sx:{color:"error.main"},children:[m.jsx(jD,{sx:{color:"inherit"},children:m.jsx(Jx,{fontSize:"small"})}),m.jsx(BD,{children:"Delete"})]}),m.jsxs(Dl,{onClose:u,"aria-labelledby":"customized-dialog-title",open:o,children:[m.jsx(gc,{sx:{m:0,p:2},id:"customized-dialog-title",children:"Delete Connection"}),m.jsx(gs,{"aria-label":"close",onClick:u,sx:f=>({position:"absolute",right:8,top:8,color:f.palette.grey[500]}),children:m.jsx(Ns,{})}),m.jsx(Rl,{dividers:!0,children:m.jsxs(lr,{gutterBottom:!0,children:['Are you sure you want to delete "',e.name,'"? This action cannot be undone.']})}),m.jsx(Ol,{children:m.jsx(Zr,{loading:n,variant:"contained",autoFocus:!0,onClick:()=>r(),color:"error",children:"Delete"})}),m.jsx(_s,{open:i!=="",autoHideDuration:6e3,onClose:()=>s(""),message:i})]})]})}function wL(e){const t=e.duckdbConnection?.attachedDatabases;return!t||t.length===0?[]:t.map(n=>({name:n.name||"",dbType:n.type||"postgres"}))}function kL(e){const t=e.ducklakeConnection;return t&&t.storage?.gcsConnection?"gcs":"s3"}function twe({connection:e,onSubmit:t,isSubmitting:n,onCloseDialog:r}){const[o,a]=T.useState(!1),[i,s]=T.useState(e.type),[c,u]=T.useState(()=>wL(e)),[f,p]=T.useState("postgres"),[y,g]=T.useState(()=>kL(e)),b=()=>{u(wL(e)),s(e.type),p("postgres"),g(kL(e)),a(!0)},x=()=>{a(!1),r?.()},E=async D=>{D.preventDefault();const I=new FormData(D.currentTarget),L=I.get("name")?.toString(),F=I.get("type")?.toString(),B=oc[F];if(!L)throw new Error("Name is required");if(!F)throw new Error("Type is required");let U;if(F==="ducklake"){const k={};if(f==="postgres"){const V=oc.postgres,z={};if(V.forEach(K=>{const Y=I.get(`ducklake_pg_${K.name}`)?.toString();Y&&(z[K.name]=Y)}),Object.keys(z).length===0)throw new Error("DuckLake requires catalog connection");k.postgresConnection=z}const $=I.get("ducklake_bucketUrl")?.toString();if(!$)throw new Error("DuckLake requires a bucket URL");const j={bucketUrl:$};if(y==="s3"){const V={};Wy.forEach(K=>{const Y=I.get(`ducklake_s3_${K.name}`)?.toString();Y&&(V[K.name]=Y)});const z=e.ducklakeConnection?.storage?.s3Connection;if(z&&(!V.accessKeyId&&z.accessKeyId&&(V.accessKeyId=z.accessKeyId),!V.secretAccessKey&&z.secretAccessKey&&(V.secretAccessKey=z.secretAccessKey)),!V.accessKeyId)throw new Error("S3 Access Key ID is required");if(!V.secretAccessKey)throw new Error("S3 Secret Access Key is required");Object.keys(V).length>0&&(j.s3Connection=V)}else if(y==="gcs"){const V={};qy.forEach(K=>{const Y=I.get(`ducklake_gcs_${K.name}`)?.toString();Y&&(V[K.name]=Y)});const z=e.ducklakeConnection?.storage?.gcsConnection;if(z&&(!V.keyId&&z.keyId&&(V.keyId=z.keyId),!V.secret&&z.secret&&(V.secret=z.secret)),!V.keyId)throw new Error("GCS Key ID is required");if(!V.secret)throw new Error("GCS Secret is required");Object.keys(V).length>0&&(j.gcsConnection=V)}U={name:L,type:F,ducklakeConnection:{catalog:k,storage:j}}}else if(F==="duckdb"){if(c.length===0)throw new Error("DuckDB connection must have at least one attached database");const k=c.map(($,j)=>{const V=$.dbType,z=I.get(`attachedDb_${j}_name`)?.toString();if(!z)throw new Error(`Attached database at index ${j} must have a name`);const K={name:z,type:V},Y=cx(V);if(Y&&Y.length>0){const te={};Y.forEach(Z=>{const J=I.get(`attachedDb_${j}_${Z.name}`)?.toString();J&&(te[Z.name]=J)});const _=t2[V];_&&(K[_]=te)}return K});U={name:L,type:F,duckdbConnection:{attachedDatabases:k}}}else{const k=e[m1[F]]||{},$={};if(B.forEach(j=>{const V=I.get(j.name)?.toString(),z=k[j.name],K=j.type==="password"||j.name==="password"||j.name==="secretAccessKey"||j.name==="secret"||j.name==="accessToken"||j.name==="privateKey";V?$[j.name]=V:K&&z?$[j.name]=z:V!==void 0?$[j.name]=V:z&&($[j.name]=z)}),F==="postgres"){if(!$.connectionString?.trim()){const j=["host","port","databaseName","userName","password"];for(const V of j)if(!$[V])throw new Error(`${B.find(z=>z.name===V)?.label||V} is required`)}}else if(F==="bigquery"){if(!$.serviceAccountKeyJson)throw new Error("Service Account Key JSON is required")}else if(F==="snowflake"){if(!$.account)throw new Error("Account is required");if(!$.username)throw new Error("Username is required");if(!$.warehouse)throw new Error("Warehouse is required");if(!$.password&&!$.privateKey)throw new Error("Either password or private key is required")}else if(F==="trino"){if(!$.server)throw new Error("Server is required");if(!$.user)throw new Error("User is required");if($.server.trim().startsWith("https://")&&!$.password&&!$.peakaKey)throw new Error("Password is required for HTTPS connections (or use Peaka Key)")}else if(F==="mysql"){const j=["host","port","database","user","password"];for(const V of j)if(!$[V])throw new Error(`${B.find(z=>z.name===V)?.label||V} is required`)}else if(F==="motherduck"){if(!$.accessToken)throw new Error("Access Token is required")}else if(F==="databricks"){if(!$.host)throw new Error("Host is required");if(!$.path)throw new Error("HTTP Path is required");const j=$.oauthClientId&&$.oauthClientSecret;if(!$.token&&!j)throw new Error("Either Access Token or OAuth Client ID + Secret is required")}U={name:L,type:F,[m1[F]]:$}}await t(U),x()},S=()=>{u([...c,{name:"",dbType:"postgres"}])},w=D=>{u(c.filter((I,L)=>L!==D))},C=(D,I)=>{const L=[...c];L[D]={...L[D],dbType:I},u(L)},R=(D,I)=>{const L=e.duckdbConnection?.attachedDatabases;if(!L||!L[D])return"";const F=L[D],B=t2[F.type||""];return B&&F[B]?F[B][I]??"":""},M=D=>{const I=e.ducklakeConnection;if(!I)return"";if(D.startsWith("pg_")){const L=D.replace("pg_","");return I.catalog?.postgresConnection?.[L]??""}if(D==="bucketUrl")return I.storage?.bucketUrl??"";if(D.startsWith("s3_")){const L=D.replace("s3_","");return I.storage?.s3Connection?.[L]??""}if(D.startsWith("gcs_")){const L=D.replace("gcs_","");return I.storage?.gcsConnection?.[L]??""}return""};return m.jsxs(vt.Fragment,{children:[m.jsxs(Mo,{"aria-label":`Edit connection ${e?.name??""}`.trim(),onClick:D=>{D.preventDefault(),D.stopPropagation(),b()},children:[m.jsx(jD,{children:m.jsx(RA,{fontSize:"small"})}),m.jsx(BD,{children:"Edit"})]}),m.jsxs(Dl,{open:o,onClose:x,children:[m.jsx(gc,{onClick:D=>{D.stopPropagation()},children:"Edit Connection"}),m.jsxs(Rl,{onClick:D=>{D.stopPropagation()},children:[m.jsx(Rb,{children:"Edit a connection to query your data database using Malloy."}),m.jsxs("form",{onSubmit:E,id:"connection-form",children:[m.jsx(Wn,{autoFocus:!0,required:!0,margin:"dense",id:"name",name:"name",label:"Connection Name",type:"text",fullWidth:!0,variant:"standard",defaultValue:e.name}),m.jsx(Wn,{margin:"dense",id:"type",name:"type",label:"Connection Type",fullWidth:!0,variant:"standard",value:i,select:!0,onChange:D=>s(D.target.value),children:A$.map(D=>m.jsx(Mo,{value:D,children:D},D))}),i==="ducklake"?m.jsxs(Ur,{sx:{mt:2},children:[m.jsxs(Ur,{sx:{mb:3,p:2,border:"1px solid",borderColor:"divider",borderRadius:1},children:[m.jsx(lr,{variant:"subtitle2",sx:{mb:2},fontWeight:500,children:"Catalog"}),m.jsx(Wn,{margin:"dense",id:"ducklake_catalogType",label:"Catalog Type",fullWidth:!0,variant:"standard",value:f,select:!0,onChange:D=>p(D.target.value),children:m.jsx(Mo,{value:"postgres",children:"PostgreSQL"})}),f==="postgres"&&m.jsx(m.Fragment,{children:oc.postgres.map(D=>m.jsx(Wn,{margin:"dense",id:`ducklake_pg_${D.name}`,name:`ducklake_pg_${D.name}`,label:D.label,type:D.type,fullWidth:!0,variant:"standard",defaultValue:M(`pg_${D.name}`)},`pg_${D.name}`))})]}),m.jsxs(Ur,{sx:{mb:3,p:2,border:"1px solid",borderColor:"divider",borderRadius:1},children:[m.jsx(lr,{variant:"subtitle2",sx:{mb:2},fontWeight:500,children:"Storage"}),m.jsxs(Wn,{margin:"dense",id:"ducklake_storageType",label:"Storage Type",fullWidth:!0,variant:"standard",value:y,select:!0,onChange:D=>g(D.target.value),children:[m.jsx(Mo,{value:"s3",children:"S3"}),m.jsx(Mo,{value:"gcs",children:"GCS"})]}),m.jsx(Wn,{margin:"dense",required:!0,id:"ducklake_bucketUrl",name:"ducklake_bucketUrl",label:y==="s3"?"Bucket URL (e.g. s3://my-bucket/path)":"Bucket URL (e.g. gs://my-bucket/path)",type:"text",fullWidth:!0,variant:"standard",defaultValue:M("bucketUrl")}),y==="s3"&&m.jsxs(m.Fragment,{children:[m.jsx(lr,{variant:"caption",sx:{mt:2,mb:1,display:"block"},color:"text.secondary",children:"S3 Credentials"}),Wy.map(D=>m.jsx(Wn,{margin:"dense",id:`ducklake_s3_${D.name}`,name:`ducklake_s3_${D.name}`,label:D.label,type:D.type,fullWidth:!0,variant:"standard",required:D.required&&D.name!=="secretAccessKey",defaultValue:M(`s3_${D.name}`),placeholder:D.name==="region"?"us-east-1":D.name==="secretAccessKey"?"Leave empty to keep existing":void 0},`s3_${D.name}`))]}),y==="gcs"&&m.jsxs(m.Fragment,{children:[m.jsx(lr,{variant:"caption",sx:{mt:2,mb:1,display:"block"},color:"text.secondary",children:"GCS Credentials"}),qy.map(D=>m.jsx(Wn,{margin:"dense",id:`ducklake_gcs_${D.name}`,name:`ducklake_gcs_${D.name}`,label:D.label,type:D.type,fullWidth:!0,variant:"standard",required:D.required&&D.name!=="secret",defaultValue:M(`gcs_${D.name}`),placeholder:D.name==="secret"?"Leave empty to keep existing":void 0},`gcs_${D.name}`))]})]})]}):i==="duckdb"?m.jsxs(Ur,{sx:{mt:2},children:[m.jsxs(Ur,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",mb:2},children:[m.jsx(lr,{variant:"subtitle1",fontWeight:500,children:"Attached Databases"}),m.jsx(Zr,{startIcon:m.jsx(Sb,{}),onClick:S,size:"small",variant:"outlined",children:"Add Database"})]}),c.length===0&&m.jsx(lr,{variant:"body2",color:"text.secondary",sx:{mb:2},children:'DuckDB connections require at least one attached database. Click "Add Database" to get started.'}),c.map((D,I)=>{const L=cx(D.dbType);return m.jsxs(Ur,{sx:{mb:3,p:2,border:"1px solid",borderColor:"divider",borderRadius:1},children:[m.jsxs(Ur,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",mb:2},children:[m.jsxs(lr,{variant:"subtitle2",children:["Database ",I+1]}),m.jsx(gs,{"aria-label":`Remove attached database ${I+1}`,onClick:()=>w(I),size:"small",color:"error",children:m.jsx(y$,{fontSize:"small"})})]}),m.jsx(Wn,{margin:"dense",required:!0,id:`attachedDb_${I}_name`,name:`attachedDb_${I}_name`,label:"Database Name",type:"text",fullWidth:!0,variant:"standard",defaultValue:D.name}),m.jsx(Wn,{margin:"dense",id:`attachedDb_${I}_type`,name:`attachedDb_${I}_type`,label:"Database Type",fullWidth:!0,variant:"standard",value:D.dbType,select:!0,onChange:F=>C(I,F.target.value),children:Object.values(nj).map(F=>m.jsx(Mo,{value:F,children:F},F))}),L.filter(F=>F.visibleWhen?(D[F.visibleWhen.field]||R(I,F.visibleWhen.field)||L.find(B=>B.name===F.visibleWhen?.field)?.selectOptions?.[0]?.value)===F.visibleWhen.value:!0).map(F=>m.jsx(Wn,{margin:"dense",id:`attachedDb_${I}_${F.name}`,name:`attachedDb_${I}_${F.name}`,label:F.label,type:F.selectOptions?void 0:F.type,fullWidth:!0,variant:"standard",required:F.required,select:!!F.selectOptions,defaultValue:R(I,F.name)||F.selectOptions?.[0]?.value,onChange:F.selectOptions?B=>{const U=[...c];U[I]={...U[I],[F.name]:B.target.value},u(U)}:void 0,children:F.selectOptions?.map(B=>m.jsx(Mo,{value:B.value,children:B.label},B.value))},F.name))]},I)})]}):oc[i].map(D=>{const I=e?.[m1[i]??""]?.[D.name??""]??"",L=D.type==="password"||D.name==="password"||D.name==="secretAccessKey"||D.name==="secret"||D.name==="accessToken"||D.name==="privateKey";return m.jsx(Wn,{margin:"dense",id:D.name,name:D.name,label:D.label,type:D.type,fullWidth:!0,variant:"standard",required:D.required&&!L&&!I,defaultValue:I,placeholder:L&&I?"Leave empty to keep existing":void 0},D.name)})]})]}),m.jsxs(Ol,{onClick:D=>{D.stopPropagation()},children:[m.jsx(Zr,{disabled:n,onClick:x,children:"Cancel"}),m.jsx(Zr,{type:"submit",form:"connection-form",loading:n,children:"Edit Connection"})]})]})]})}function AL(e,t){return!e||e.type!=="duckdb"?!1:(e.duckdbConnection?.attachedDatabases||[]).some(n=>n.type==="azure"&&n.name===t)}function nwe(e){return e.startsWith("gs://")||e.startsWith("s3://")||e.startsWith("https://")||e.startsWith("abfss://")||e.startsWith("az://")}function rwe({connectionName:e,resourceUri:t,schema:n,connection:r}){const{apiClients:o}=Dr(),{environmentName:a}=to(t),[i,s]=vt.useState(null),[c,u]=vt.useState(n||null),[f,p]=vt.useState(!1),{data:y,isError:g,isLoading:b,error:x}=uo({queryKey:["schemas",a,e],queryFn:()=>o.connections.listSchemas(a,e)}),E=y?.data||[];return m.jsxs(ts,{container:!0,spacing:1,children:[!n&&m.jsx(ts,{size:{xs:12,md:4},children:m.jsxs(Ci,{sx:{p:1,m:0},children:[m.jsxs(gt,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",mb:0},children:[m.jsx(at,{variant:"overline",fontWeight:"bold",children:"Table Paths"}),m.jsx(Tp,{control:m.jsx(yA,{checked:f,onChange:S=>p(S.target.checked)}),label:"Hidden Schemas"})]}),m.jsx(yl,{sx:{mt:"2px"}}),m.jsxs(gt,{sx:{mt:"2px",maxHeight:"600px",overflowY:"auto"},children:[b&&m.jsx(Ca,{text:"Loading schemas..."}),g&&m.jsx(Ta,{error:x,context:`${a} > ${e} > Schemas`}),!b&&!g&&E.length===0&&m.jsx(at,{variant:"body2",children:"No Schemas"}),!b&&!g&&E.length>0&&m.jsx(pA,{dense:!0,disablePadding:!0,children:E.map(S=>{const w=S.name;return S.isHidden&&!f?null:m.jsx(uF,{selected:c===w,onClick:()=>{u(w),s(null)},children:m.jsx(Xd,{primary:w})},w)})})]})]})}),m.jsx(ts,{size:{xs:12,md:n?6:4},children:c&&m.jsx(Ci,{sx:{p:1,m:0},children:m.jsx(iwe,{connectionName:e,schemaName:c,onTableSelect:S=>{s(S)},resourceUri:t,connection:r})})}),m.jsx(ts,{size:{xs:12,md:n?6:4},children:c&&i&&m.jsx(owe,{environmentName:a,connectionName:e,schemaName:c,tableResource:i})})]})}function owe({environmentName:e,connectionName:t,schemaName:n,tableResource:r}){const{apiClients:o}=Dr(),{data:a,isLoading:i,isError:s,error:c}=uo({queryKey:["connectionTableDetail",e,t,n,r],queryFn:()=>o.connections.getTable(e,t,n,r),enabled:!!n&&!!r}),u={resource:a?.data?.resource??r,columns:a?.data?.columns??[]};return m.jsxs(Ci,{sx:{p:1,m:0},children:[s&&m.jsx(Ta,{error:c,context:`${e} > ${t} > ${n} > ${r}`}),!s&&m.jsx(awe,{table:u,loading:i})]})}function awe({table:e,loading:t}){return t?m.jsx(Ca,{text:"Loading columns..."}):m.jsxs(m.Fragment,{children:[m.jsxs(at,{variant:"overline",fontWeight:"bold",sx:{display:"block",wordBreak:"break-all"},children:[e.resource.includes("://")||/\.(parquet|csv|json|tsv|ndjson)$/i.test(e.resource)?"File":"Table",": ",e.resource]}),m.jsx(yl,{}),m.jsx(gt,{sx:{mt:"10px",maxHeight:"600px",overflowY:"auto"},children:m.jsx(Cte,{children:m.jsxs(lb,{size:"small",sx:{"& .MuiTableCell-root":{padding:"10px"}},children:[m.jsx(ub,{children:m.jsxs(bl,{children:[m.jsx(Mn,{children:"NAME"}),m.jsx(Mn,{children:"TYPE"})]})}),m.jsx(cb,{children:e.columns?.sort((n,r)=>n.name.localeCompare(r.name))?.map(n=>m.jsxs(bl,{children:[m.jsx(Mn,{children:n.name}),m.jsx(Mn,{children:n.type})]},n.name))})]})})})]})}function iwe({connectionName:e,schemaName:t,onTableSelect:n,resourceUri:r,connection:o}){const{environmentName:a}=to(r),{apiClients:i}=Dr(),[s,c]=T.useState(""),{data:u,isSuccess:f,isError:p,error:y,isLoading:g}=uo({queryKey:["tablesInSchema",a,e,t],queryFn:()=>i.connections.listTables(a,e,t)}),b=AL(o,t),x=S=>b?S:S.split(".").pop()||S,E=f&&u?.data?u.data.filter(S=>x(S.resource).toLowerCase().includes(s.toLowerCase())).sort((S,w)=>x(S.resource).localeCompare(x(w.resource))):[];return m.jsxs(m.Fragment,{children:[m.jsx(at,{variant:"overline",fontWeight:"bold",children:nwe(t)||AL(o,t)?`Files in ${t}`:`Tables in ${t}`}),m.jsx(yl,{}),m.jsx(gt,{sx:{mt:1,mb:1},children:m.jsx(xu,{size:"small",fullWidth:!0,placeholder:"Search tables...",value:s,onChange:S=>c(S.target.value),variant:"outlined"})}),m.jsx(yl,{}),m.jsxs(gt,{sx:{mt:"2px",maxHeight:"600px",overflowY:"auto"},children:[g&&m.jsx(Ca,{text:"Fetching Tables..."}),p&&m.jsx(Ta,{error:y,context:`${a} > ${e} > ${t}`}),f&&E.length===0&&m.jsx(at,{variant:"body2",children:"No Tables"}),f&&u?.data&&u.data.length>0&&m.jsx(pA,{dense:!0,disablePadding:!0,children:E.map(S=>{let w=x(S.resource);return!b&&S.resource.includes("://")&&(w=S.resource.split("/").pop()||S.resource),m.jsx(uF,{onClick:()=>n(S.resource),children:m.jsx(Xd,{primary:w,secondary:S.columns.length>0?`${S.columns.length} columns`:void 0})},S.resource)})})]})]})}const swe={bigquery:"BigQuery",snowflake:"Snowflake",postgres:"PostgreSQL",mysql:"MySQL",trino:"Trino",databricks:"Databricks",duckdb:"DuckDB",ducklake:"DuckLake",s3:"S3",gcs:"GCS",azure:"Azure"};function lwe(e){return e?swe[e]??e:""}function cwe({resourceUri:e}){const{apiClients:t,mutable:n}=Dr(),r=Ls(),{environmentName:o}=to(e),[a,i]=T.useState(""),[s,c]=T.useState(null),u=MD({environmentName:o,connectionName:s}),{data:f,isSuccess:p,isError:y,error:g}=uo({queryKey:["connections",o],queryFn:()=>t.connections.listConnections(o)}),b=()=>{c(null)},x=Ho({mutationFn:R=>t.environments.updateEnvironment(o,{name:o,connections:[...f.data,R]}),onSuccess(){i("Connection added successfully"),r.invalidateQueries({queryKey:["connections",o]})},onError(R){i(R.message)}}),E=Ho({mutationFn:R=>t.environments.updateEnvironment(o,{name:o,connections:f.data.map(M=>M.name===R.name?R:M)}),onSuccess(R,M){i(`Connection ${M.name} updated successfully`),r.invalidateQueries({queryKey:["connections",o]})},onError(R){i(R.message)}}),S=Ho({mutationFn:R=>t.environments.updateEnvironment(o,{name:o,connections:f.data.filter(M=>M.name!==R.name)}),onSuccess(R,M){i(`Connection ${M.name} deleted successfully`),r.invalidateQueries({queryKey:["connections",o]})},onError(R){i(R.message)}}),w=p?[...f.data].sort((R,M)=>(R.name??"").localeCompare(M.name??"")):[],C=x.isPending||E.isPending||S.isPending;return m.jsxs(gt,{children:[m.jsxs(gt,{sx:{display:"flex",alignItems:"flex-start",justifyContent:"space-between",mb:3},children:[m.jsxs(gt,{children:[m.jsx(at,{variant:"h6",sx:{fontWeight:600,letterSpacing:"-0.025em"},children:"Connections"}),m.jsx(at,{variant:"body2",color:"text.secondary",children:"Database connections available to packages in this environment"})]}),n&&p&&m.jsx(JTe,{onSubmit:R=>x.mutateAsync(R),isSubmitting:x.isPending})]}),!p&&!y&&m.jsx(at,{variant:"body2",color:"text.secondary",children:"Fetching Connections..."}),y&&m.jsx(Ta,{error:g,context:`${o} > Connections`}),p&&w.length===0&&m.jsx(at,{variant:"body2",color:"text.secondary",children:"No connections yet."}),p&&w.length>0&&m.jsx(ts,{container:!0,spacing:2,children:w.map(R=>m.jsx(ts,{size:{xs:12,sm:6,md:4},children:m.jsx(uwe,{connection:R,mutable:n,isMutating:C,onOpenExplorer:()=>c(R.name??null),onEdit:M=>E.mutateAsync(M),onDelete:M=>{R.resource?i("Cannot delete this connection"):S.mutateAsync(M)}})},R.name))}),m.jsx(_s,{open:a!=="",autoHideDuration:6e3,onClose:()=>i(""),message:a}),m.jsxs(wi,{open:s!==null,onClose:b,maxWidth:"lg",fullWidth:!0,children:[m.jsxs(Ai,{children:["Connection Explorer: ",s,m.jsx(dr,{"aria-label":"close",onClick:b,sx:{position:"absolute",right:8,top:8},children:m.jsx(gt,{sx:{width:24,height:24,display:"flex",alignItems:"center",justifyContent:"center"},children:"X"})})]}),m.jsx(ki,{children:s&&m.jsx(rwe,{resourceUri:u,connectionName:s,connection:f?.data?.find(R=>R.name===s)})})]})]})}function uwe({connection:e,mutable:t,isMutating:n,onOpenExplorer:r,onEdit:o,onDelete:a}){const[i,s]=T.useState(null),c=!!i,u=p=>{p.stopPropagation(),s(p.currentTarget)},f=()=>{s(null)};return m.jsx(ch,{variant:"outlined",onClick:r,sx:{height:"100%",cursor:"pointer",borderRadius:3,borderColor:"divider",boxShadow:"none",transition:"all 0.2s ease-in-out","&:hover":{boxShadow:2,borderColor:"primary.main"}},children:m.jsx(uh,{sx:{p:2.5,"&:last-child":{pb:2.5}},children:m.jsxs(gt,{sx:{display:"flex",alignItems:"flex-start",gap:1.5},children:[m.jsx(gt,{sx:{width:36,height:36,borderRadius:1.5,bgcolor:"warning.light",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0,color:"warning.main"},children:m.jsx(MCe,{sx:{fontSize:20}})}),m.jsxs(gt,{sx:{flex:1,minWidth:0},children:[m.jsx(at,{variant:"subtitle1",component:"h6",noWrap:!0,sx:{fontWeight:600,mb:.5},children:e.name}),m.jsx(at,{variant:"body2",color:"text.secondary",noWrap:!0,children:lwe(e.type)})]}),t&&m.jsxs(m.Fragment,{children:[m.jsx(dr,{size:"small",onClick:u,"aria-label":`Connection actions for ${e.name??""}`.trim(),sx:{flexShrink:0,mt:-.5,mr:-.5},children:m.jsx(eS,{fontSize:"small"})}),m.jsxs(Zd,{anchorEl:i,open:c,onClose:f,onClick:p=>p.stopPropagation(),anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},children:[m.jsx(twe,{connection:e,onSubmit:o,isSubmitting:n,onCloseDialog:f}),m.jsx(ewe,{connection:e,onCloseDialog:f,isMutating:n,onDelete:()=>a(e)})]})]})]})})})}const dwe=Fn([m.jsx("path",{d:"M20 2H4c-1 0-2 .9-2 2v3.01c0 .72.43 1.34 1 1.69V20c0 1.1 1.1 2 2 2h14c.9 0 2-.9 2-2V8.7c.57-.35 1-.97 1-1.69V4c0-1.1-1-2-2-2m-1 18H5V9h14zm1-13H4V4h16z"},"0"),m.jsx("path",{d:"M9 12h6v2H9z"},"1")]);function fwe({resourceUri:e,onCloseDialog:t}){const[n,r]=T.useState(!1),{apiClients:o}=Dr(),a=Ls(),[i,s]=T.useState(""),c=()=>{r(!0)},u=()=>{r(!1),t()},{environmentName:f,packageName:p}=to(e),y=Ho({mutationFn:()=>o.packages.deletePackage(f,p),onSuccess(){u(),a.invalidateQueries({queryKey:["packages"]}),s("Package deleted successfully")},onError(g){s(g instanceof Error?g.message:"An unknown error occurred")}});return m.jsxs(vt.Fragment,{children:[m.jsxs(cc,{onClick:c,children:[m.jsx(sb,{children:m.jsx(Jx,{fontSize:"small"})}),m.jsx(Xd,{children:"Delete"})]}),m.jsxs(Dl,{onClose:u,"aria-labelledby":"customized-dialog-title",open:n,children:[m.jsx(gc,{sx:{m:0,p:2},id:"customized-dialog-title",children:"Delete Package"}),m.jsx(gs,{"aria-label":"close",onClick:u,sx:g=>({position:"absolute",right:8,top:8,color:g.palette.grey[500]}),children:m.jsx(Ns,{})}),m.jsx(Rl,{dividers:!0,children:m.jsxs(lr,{gutterBottom:!0,children:['Are you sure you want to delete "',p,'"? This action cannot be undone.']})}),m.jsxs(Ol,{children:[m.jsx(Zr,{variant:"outlined",onClick:u,style:{borderColor:Ba.teal,color:Ba.teal},children:"Cancel"}),m.jsx(Zr,{variant:"contained",autoFocus:!0,onClick:()=>y.mutate(),color:"error",loading:y.isPending,children:"Delete"})]}),m.jsx(_s,{open:i!=="",autoHideDuration:6e3,onClose:()=>s(""),message:i})]})]})}function pwe({package:e,resourceUri:t,onCloseDialog:n}){const[r,o]=T.useState(!1),{apiClients:a}=Dr(),i=Ls(),[s,c]=T.useState(""),u=()=>{o(!0)},f=()=>{o(!1),n()},{packageName:p,environmentName:y}=to(t),g=Ho({async mutationFn(x){return a.packages.updatePackage(y,p,{name:p,description:x.description})},onSuccess(){f(),c("Package updated successfully"),i.invalidateQueries({queryKey:["packages",y]})},onError(x){c(x instanceof Error?x.message:"An unknown error occurred")}}),b=x=>{x.preventDefault();const E=new FormData(x.currentTarget).get("description")?.toString();g.mutate({description:E})};return m.jsxs(vt.Fragment,{children:[m.jsxs(cc,{onClick:u,children:[m.jsx(sb,{children:m.jsx(RA,{fontSize:"small"})}),m.jsx(Xd,{children:"Edit"})]}),m.jsxs(Dl,{open:r,onClose:f,children:[m.jsx(gc,{children:"Edit Package"}),m.jsxs(Rl,{children:[m.jsxs(Rb,{children:['Update the details for "',e.name,'".']}),m.jsxs("form",{onSubmit:b,id:"package-form",children:[m.jsx(Wn,{autoFocus:!0,required:!0,margin:"dense",id:"name",name:"name",label:"Package Name",disabled:!0,type:"text",fullWidth:!0,variant:"standard",defaultValue:e.name}),m.jsx(Wn,{id:"description",name:"description",label:"Description",multiline:!0,fullWidth:!0,rows:4,defaultValue:e.description,variant:"standard"})]})]}),m.jsxs(Ol,{children:[m.jsx(Zr,{disabled:g.isPending,onClick:f,children:"Cancel"}),m.jsx(Zr,{type:"submit",form:"package-form",loading:g.isPending,children:"Save Changes"})]})]}),m.jsx(_s,{open:s!=="",autoHideDuration:6e3,onClose:()=>c(""),message:s})]})}function hwe({onSelectPackage:e,resourceUri:t}){const{apiClients:n}=Dr(),{environmentName:r}=to(t),{data:o,isSuccess:a,isError:i,error:s}=uo({queryKey:["packages",r],queryFn:()=>n.packages.listPackages(r)});if(i)return m.jsx(Ta,{error:s,context:`${r} > Packages`});if(!a)return m.jsx(Ca,{text:"Fetching Packages..."});const c=[...o.data].sort((u,f)=>u.name.localeCompare(f.name));return m.jsx(ts,{container:!0,spacing:2,children:c.map(u=>{const f=MD({environmentName:r,packageName:u.name});return m.jsx(ts,{size:{xs:12,sm:6,md:4},children:m.jsx(mwe,{pkg:u,packageResourceUri:f,onSelectPackage:e})},u.name)})})}function mwe({pkg:e,packageResourceUri:t,onSelectPackage:n}){const{mutable:r}=Dr(),[o,a]=T.useState(null),i=!!o,s=p=>{n(e.name,p)},c=p=>{p.stopPropagation(),a(p.currentTarget)},u=()=>{a(null)},f=e.description??"";return m.jsx(ch,{variant:"outlined",onClick:s,sx:{height:"100%",cursor:"pointer",borderRadius:3,borderColor:"divider",boxShadow:"none",transition:"all 0.2s ease-in-out","&:hover":{boxShadow:2,borderColor:"primary.main"}},children:m.jsx(uh,{sx:{p:2.5,"&:last-child":{pb:2.5}},children:m.jsxs(gt,{sx:{display:"flex",alignItems:"flex-start",gap:1.5},children:[m.jsx(gt,{sx:p=>({width:36,height:36,borderRadius:1.5,bgcolor:p.palette.mode==="dark"?"rgba(255, 255, 255, 0.08)":"grey.100",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0,color:"text.primary"}),children:m.jsx(dwe,{sx:{fontSize:20}})}),m.jsxs(gt,{sx:{flex:1,minWidth:0},children:[m.jsx(at,{variant:"subtitle1",component:"h6",noWrap:!0,sx:{fontWeight:600,mb:.5},children:e.name}),m.jsx(eo,{title:f,followCursor:!0,enterDelay:1e3,children:m.jsx(at,{variant:"body2",color:"text.secondary",sx:{overflow:"hidden",textOverflow:"ellipsis",display:"-webkit-box",WebkitLineClamp:2,WebkitBoxOrient:"vertical",lineHeight:1.5},children:f})})]}),r&&m.jsxs(m.Fragment,{children:[m.jsx(dr,{size:"small",onClick:c,"aria-label":`Package actions for ${e.name}`,sx:{flexShrink:0,mt:-.5,mr:-.5},children:m.jsx(eS,{fontSize:"small"})}),m.jsxs(Zd,{anchorEl:o,open:i,onClose:u,onClick:p=>p.stopPropagation(),anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},children:[m.jsx(pwe,{package:e,resourceUri:t,onCloseDialog:u}),m.jsx(fwe,{resourceUri:t,onCloseDialog:u})]})]})]})})})}function bIe({onSelectPackage:e,resourceUri:t}){const{mutable:n}=Dr(),{environmentName:r}=to(t);return T.useEffect(()=>{window.scrollTo({top:0,behavior:"auto"})},[]),m.jsxs(Ux,{maxWidth:!1,sx:{maxWidth:1024,mx:"auto",px:4,py:3},children:[m.jsxs(gt,{sx:{mb:5},children:[m.jsx(at,{variant:"h4",component:"h1",sx:{fontWeight:600,letterSpacing:"-0.025em",mb:.5},children:r}),m.jsx(at,{variant:"body2",color:"text.secondary",children:"Manage packages and database connections in this environment. Open a package to explore its models and notebooks."})]}),m.jsxs(gt,{sx:{mb:5},children:[m.jsxs(Lr,{direction:"row",justifyContent:"space-between",alignItems:"flex-start",sx:{mb:3},children:[m.jsxs(gt,{children:[m.jsx(at,{variant:"h6",sx:{fontWeight:600,letterSpacing:"-0.025em"},children:"Packages"}),m.jsx(at,{variant:"body2",color:"text.secondary",children:"Published packages available for use in this environment"})]}),n&&m.jsx(RCe,{resourceUri:t})]}),m.jsx(hwe,{onSelectPackage:e,resourceUri:t})]}),m.jsx(gt,{sx:{mb:5},children:m.jsx(cwe,{resourceUri:t})}),m.jsx(gt,{sx:{mb:5},children:m.jsx(DCe,{resourceUri:t,onClickPackageFile:e})}),m.jsx(OCe,{resourceUri:t})]})}const gwe=e=>{const t=T.useRef({});return T.useEffect(()=>{t.current=e}),t.current};function DL({array1:e,array2:t,parser:n=r=>r}){return e&&t&&e.length===t.length&&e.every((r,o)=>n(r)===n(t[o]))}function OL(e){return e.normalize("NFD").replace(/[\u0300-\u036f]/g,"")}function ywe(e={}){const{ignoreAccents:t=!0,ignoreCase:n=!0,limit:r,matchFrom:o="any",stringify:a,trim:i=!1}=e;return(s,{inputValue:c,getOptionLabel:u})=>{let f=i?c.trim():c;n&&(f=f.toLowerCase()),t&&(f=OL(f));const p=f?s.filter(y=>{let g=(a||u)(y);return n&&(g=g.toLowerCase()),t&&(g=OL(g)),o==="start"?g.startsWith(f):g.includes(f)}):s;return typeof r=="number"?p.slice(0,r):p}}const bwe=ywe(),RL=5,vwe=e=>e.current!==null&&e.current.parentElement?.contains(document.activeElement),xwe=[];function ML(e,t,n,r){if(t||e==null||r)return"";const o=n(e);return typeof o=="string"?o:""}function Swe(e){const{unstable_isActiveElementInListbox:t=vwe,unstable_classNamePrefix:n="Mui",autoComplete:r=!1,autoHighlight:o=!1,autoSelect:a=!1,blurOnSelect:i=!1,clearOnBlur:s=!e.freeSolo,clearOnEscape:c=!1,componentName:u="useAutocomplete",defaultValue:f=e.multiple?xwe:null,disableClearable:p=!1,disableCloseOnSelect:y=!1,disabled:g,disabledItemsFocusable:b=!1,disableListWrap:x=!1,filterOptions:E=bwe,filterSelectedOptions:S=!1,freeSolo:w=!1,getOptionDisabled:C,getOptionKey:R,getOptionLabel:M=le=>le.label??le,groupBy:D,handleHomeEndKeys:I=!e.freeSolo,id:L,includeInputInList:F=!1,inputValue:B,isOptionEqualToValue:U=(le,ce)=>le===ce,multiple:k=!1,onChange:$,onClose:j,onHighlightChange:V,onInputChange:z,onOpen:K,open:Y,openOnFocus:te=!1,options:_,readOnly:Z=!1,renderValue:J,selectOnFocus:W=!e.freeSolo,value:re}=e,ne=Bs(L);let X=M;X=le=>{const ce=M(le);return typeof ce!="string"?String(ce):ce};const ie=T.useRef(!1),ae=T.useRef(!0),fe=T.useRef(null),xe=T.useRef(null),[ge,Re]=T.useState(null),[de,me]=T.useState(-1),Qe=o?0:-1,Me=T.useRef(Qe),we=T.useRef(ML(f??re,k,X)).current,[Se,dt]=xi({controlled:re,default:f,name:u}),[ze,tt]=xi({controlled:B,default:we,name:u,state:"inputValue"}),[Ze,qt]=T.useState(!1),Vt=T.useCallback((le,ce,Be)=>{if(!(k?Se.length<ce.length:ce!==null)&&!s)return;const ut=ML(ce,k,X,J);ze!==ut&&(tt(ut),z&&z(le,ut,Be))},[X,ze,k,z,tt,s,Se,J]),[Mt,ke]=xi({controlled:Y,default:!1,name:u,state:"open"}),[Ne,lt]=T.useState(!0),St=!k&&Se!=null&&ze===X(Se),ft=Mt&&!Z,$e=ft?E(_.filter(le=>!(S&&(k?Se:[Se]).some(ce=>ce!==null&&U(le,ce)))),{inputValue:St&&Ne?"":ze,getOptionLabel:X}):[],Ht=gwe({filteredOptions:$e,value:Se,inputValue:ze});T.useEffect(()=>{const le=Se!==Ht.value;Ze&&!le||w&&!le||Vt(null,Se,"reset")},[Se,Vt,Ze,Ht.value,w]);const $t=Mt&&$e.length>0&&!Z,pt=Pt(le=>{if(le===-1)fe.current.focus();else{const ce=J?"data-item-index":"data-tag-index";ge.querySelector(`[${ce}="${le}"]`).focus()}});T.useEffect(()=>{k&&de>Se.length-1&&(me(-1),pt(-1))},[Se,k,de,pt]);function Te(le,ce){if(!xe.current||le<0||le>=$e.length)return-1;let Be=le;for(;;){const ut=xe.current.querySelector(`[data-option-index="${Be}"]`),qe=b?!1:!ut||ut.disabled||ut.getAttribute("aria-disabled")==="true";if(ut&&ut.hasAttribute("tabindex")&&!qe)return Be;if(ce==="next"?Be=(Be+1)%$e.length:Be=(Be-1+$e.length)%$e.length,Be===le)return-1}}const Ue=Pt(({event:le,index:ce,reason:Be})=>{if(Me.current=ce,ce===-1?fe.current.removeAttribute("aria-activedescendant"):fe.current.setAttribute("aria-activedescendant",`${ne}-option-${ce}`),V&&["mouse","keyboard","touch"].includes(Be)&&V(le,ce===-1?null:$e[ce],Be),!xe.current)return;const ut=xe.current.querySelector(`[role="option"].${n}-focused`);ut&&(ut.classList.remove(`${n}-focused`),ut.classList.remove(`${n}-focusVisible`));let qe=xe.current;if(xe.current.getAttribute("role")!=="listbox"&&(qe=xe.current.parentElement.querySelector('[role="listbox"]')),!qe)return;if(ce===-1){qe.scrollTop=0;return}const Zt=xe.current.querySelector(`[data-option-index="${ce}"]`);if(Zt&&(Zt.classList.add(`${n}-focused`),Be==="keyboard"&&Zt.classList.add(`${n}-focusVisible`),qe.scrollHeight>qe.clientHeight&&Be!=="mouse"&&Be!=="touch")){const an=Zt,vr=qe.clientHeight+qe.scrollTop,sn=an.offsetTop+an.offsetHeight;sn>vr?qe.scrollTop=sn-qe.clientHeight:an.offsetTop-an.offsetHeight*(D?1.3:0)<qe.scrollTop&&(qe.scrollTop=an.offsetTop-an.offsetHeight*(D?1.3:0))}}),yt=Pt(({event:le,diff:ce,direction:Be="next",reason:ut})=>{if(!ft)return;const qe=Te((()=>{const Zt=$e.length-1;if(ce==="reset")return Qe;if(ce==="start")return 0;if(ce==="end")return Zt;const an=Me.current+ce;return an<0?an===-1&&F?-1:x&&Me.current!==-1||Math.abs(ce)>1?0:Zt:an>Zt?an===Zt+1&&F?-1:x||Math.abs(ce)>1?Zt:0:an})(),Be);if(Ue({index:qe,reason:ut,event:le}),r&&ce!=="reset")if(qe===-1)fe.current.value=ze;else{const Zt=X($e[qe]);fe.current.value=Zt,Zt.toLowerCase().indexOf(ze.toLowerCase())===0&&ze.length>0&&fe.current.setSelectionRange(ze.length,Zt.length)}}),ht=!DL({array1:Ht.filteredOptions,array2:$e,parser:X}),Cn=()=>{const le=(ce,Be)=>{const ut=ce?X(ce):"",qe=Be?X(Be):"";return ut===qe};if(Me.current!==-1&&!DL({array1:Ht.filteredOptions,array2:$e,parser:X})&&Ht.inputValue===ze&&(k?Se.length===Ht.value.length&&Ht.value.every((ce,Be)=>X(Se[Be])===X(ce)):le(Ht.value,Se))){const ce=Ht.filteredOptions[Me.current];if(ce)return $e.findIndex(Be=>X(Be)===X(ce))}return-1},On=T.useCallback(()=>{if(!ft)return;const le=Cn();if(le!==-1){Me.current=le;return}const ce=k?Se[0]:Se;if($e.length===0||ce==null){yt({diff:"reset"});return}if(xe.current){if(ce!=null){const Be=$e[Me.current];if(k&&Be&&Se.findIndex(qe=>U(Be,qe))!==-1)return;const ut=$e.findIndex(qe=>U(qe,ce));ut===-1?yt({diff:"reset"}):Ue({index:ut});return}if(Me.current>=$e.length-1){Ue({index:$e.length-1});return}Ue({index:Me.current})}},[$e.length,k?!1:Se,S,yt,Ue,ft,ze,k]),In=Pt(le=>{Ck(xe,le),le&&On()});T.useEffect(()=>{ht&&On()},[On,ht]);const pn=le=>{Mt||(ke(!0),lt(!0),K&&K(le))},Gn=(le,ce)=>{Mt&&(ke(!1),j&&j(le,ce))},Hn=(le,ce,Be,ut)=>{if(k){if(Se.length===ce.length&&Se.every((qe,Zt)=>qe===ce[Zt]))return}else if(Se===ce)return;$&&$(le,ce,Be,ut),dt(ce)},wn=T.useRef(!1),or=(le,ce,Be="selectOption",ut="options")=>{let qe=Be,Zt=ce;if(k){Zt=Array.isArray(Se)?Se.slice():[];const an=Zt.findIndex(vr=>U(ce,vr));an===-1?Zt.push(ce):ut!=="freeSolo"&&(Zt.splice(an,1),qe="removeOption")}Vt(le,Zt,qe),Hn(le,Zt,qe,{option:ce}),!y&&(!le||!le.ctrlKey&&!le.metaKey)&&Gn(le,qe),(i===!0||i==="touch"&&wn.current||i==="mouse"&&!wn.current)&&fe.current.blur()};function Wt(le,ce){if(le===-1)return-1;let Be=le;for(;;){if(ce==="next"&&Be===Se.length||ce==="previous"&&Be===-1)return-1;const ut=J?"data-item-index":"data-tag-index",qe=ge.querySelector(`[${ut}="${Be}"]`);if(!qe||!qe.hasAttribute("tabindex")||qe.disabled||qe.getAttribute("aria-disabled")==="true")Be+=ce==="next"?1:-1;else return Be}}const he=(le,ce)=>{if(!k)return;ze===""&&Gn(le,"toggleInput");let Be=de;de===-1?ze===""&&ce==="previous"&&(Be=Se.length-1):(Be+=ce==="next"?1:-1,Be<0&&(Be=0),Be===Se.length&&(Be=-1)),Be=Wt(Be,ce),me(Be),pt(Be)},Ae=le=>{ie.current=!0,tt(""),z&&z(le,"","clear"),Hn(le,k?[]:null,"clear")},Ie=le=>ce=>{if(le.onKeyDown&&le.onKeyDown(ce),!ce.defaultMuiPrevented&&(de!==-1&&!["ArrowLeft","ArrowRight"].includes(ce.key)&&(me(-1),pt(-1)),ce.which!==229))switch(ce.key){case"Home":ft&&I&&(ce.preventDefault(),yt({diff:"start",direction:"next",reason:"keyboard",event:ce}));break;case"End":ft&&I&&(ce.preventDefault(),yt({diff:"end",direction:"previous",reason:"keyboard",event:ce}));break;case"PageUp":ce.preventDefault(),yt({diff:-RL,direction:"previous",reason:"keyboard",event:ce}),pn(ce);break;case"PageDown":ce.preventDefault(),yt({diff:RL,direction:"next",reason:"keyboard",event:ce}),pn(ce);break;case"ArrowDown":ce.preventDefault(),yt({diff:1,direction:"next",reason:"keyboard",event:ce}),pn(ce);break;case"ArrowUp":ce.preventDefault(),yt({diff:-1,direction:"previous",reason:"keyboard",event:ce}),pn(ce);break;case"ArrowLeft":!k&&J?pt(0):he(ce,"previous");break;case"ArrowRight":!k&&J?pt(-1):he(ce,"next");break;case"Enter":if(Me.current!==-1&&ft){const Be=$e[Me.current],ut=C?C(Be):!1;if(ce.preventDefault(),ut)return;or(ce,Be,"selectOption"),r&&fe.current.setSelectionRange(fe.current.value.length,fe.current.value.length)}else w&&ze!==""&&St===!1&&(k&&ce.preventDefault(),or(ce,ze,"createOption","freeSolo"));break;case"Escape":ft?(ce.preventDefault(),ce.stopPropagation(),Gn(ce,"escape")):c&&(ze!==""||k&&Se.length>0||J)&&(ce.preventDefault(),ce.stopPropagation(),Ae(ce));break;case"Backspace":if(k&&!Z&&ze===""&&Se.length>0){const Be=de===-1?Se.length-1:de,ut=Se.slice();ut.splice(Be,1),Hn(ce,ut,"removeOption",{option:Se[Be]})}!k&&J&&!Z&&(dt(null),pt(-1));break;case"Delete":if(k&&!Z&&ze===""&&Se.length>0&&de!==-1){const Be=de,ut=Se.slice();ut.splice(Be,1),Hn(ce,ut,"removeOption",{option:Se[Be]})}!k&&J&&!Z&&(dt(null),pt(-1));break}},Ve=le=>{qt(!0),te&&!ie.current&&pn(le)},ot=le=>{if(t(xe)){fe.current.focus();return}qt(!1),ae.current=!0,ie.current=!1,a&&Me.current!==-1&&ft?or(le,$e[Me.current],"blur"):a&&w&&ze!==""?or(le,ze,"blur","freeSolo"):s&&Vt(le,Se,"blur"),Gn(le,"blur")},It=le=>{const ce=le.target.value;ze!==ce&&(tt(ce),lt(!1),z&&z(le,ce,"input")),ce===""?!p&&!k&&Hn(le,null,"clear"):pn(le)},Ft=le=>{const ce=Number(le.currentTarget.getAttribute("data-option-index"));Me.current!==ce&&Ue({event:le,index:ce,reason:"mouse"})},Rt=le=>{Ue({event:le,index:Number(le.currentTarget.getAttribute("data-option-index")),reason:"touch"}),wn.current=!0},jt=le=>{const ce=Number(le.currentTarget.getAttribute("data-option-index"));or(le,$e[ce],"selectOption"),wn.current=!1},Nt=le=>ce=>{const Be=Se.slice();Be.splice(le,1),Hn(ce,Be,"removeOption",{option:Se[le]})},kt=le=>{Hn(le,null,"removeOption",{option:Se})},Et=le=>{Mt?Gn(le,"toggleInput"):pn(le)},Bt=le=>{le.currentTarget.contains(le.target)&&le.target.getAttribute("id")!==ne&&le.preventDefault()},Tn=le=>{le.currentTarget.contains(le.target)&&(fe.current.focus(),W&&ae.current&&fe.current.selectionEnd-fe.current.selectionStart===0&&fe.current.select(),ae.current=!1)},nr=le=>{!g&&(ze===""||!Mt)&&Et(le)};let Yn=w&&ze.length>0;Yn=Yn||(k?Se.length>0:Se!==null);let rn=$e;return D&&(rn=$e.reduce((le,ce,Be)=>{const ut=D(ce);return le.length>0&&le[le.length-1].group===ut?le[le.length-1].options.push(ce):le.push({key:Be,index:Be,group:ut,options:[ce]}),le},[])),g&&Ze&&ot(),{getRootProps:(le={})=>({...le,onKeyDown:Ie(le),onMouseDown:Bt,onClick:Tn}),getInputLabelProps:()=>({id:`${ne}-label`,htmlFor:ne}),getInputProps:()=>({id:ne,value:ze,onBlur:ot,onFocus:Ve,onChange:It,onMouseDown:nr,"aria-activedescendant":ft?"":null,"aria-autocomplete":r?"both":"list","aria-controls":$t?`${ne}-listbox`:void 0,"aria-expanded":$t,autoComplete:"off",ref:fe,autoCapitalize:"none",spellCheck:"false",role:"combobox",disabled:g}),getClearProps:()=>({tabIndex:-1,type:"button",onClick:Ae}),getItemProps:({index:le=0}={})=>({...k&&{key:le},...J?{"data-item-index":le}:{"data-tag-index":le},tabIndex:-1,...!Z&&{onDelete:k?Nt(le):kt}}),getPopupIndicatorProps:()=>({tabIndex:-1,type:"button",onClick:Et}),getTagProps:({index:le})=>({key:le,"data-tag-index":le,tabIndex:-1,...!Z&&{onDelete:Nt(le)}}),getListboxProps:()=>({role:"listbox",id:`${ne}-listbox`,"aria-labelledby":`${ne}-label`,ref:In,onMouseDown:le=>{le.preventDefault()}}),getOptionProps:({index:le,option:ce})=>{const Be=(k?Se:[Se]).some(qe=>qe!=null&&U(ce,qe)),ut=C?C(ce):!1;return{key:R?.(ce)??X(ce),tabIndex:-1,role:"option",id:`${ne}-option-${le}`,onMouseMove:Ft,onClick:jt,onTouchStart:Rt,"data-option-index":le,"aria-disabled":ut,"aria-selected":Be}},id:ne,inputValue:ze,value:Se,dirty:Yn,expanded:ft&&ge,popupOpen:ft,focused:Ze||de!==-1,anchorEl:ge,setAnchorEl:Re,focusedItem:de,focusedTag:de,groupedOptions:rn}}var Va="top",ss="bottom",ls="right",Wa="left",YD="auto",Mb=[Va,ss,ls,Wa],Jp="start",Gy="end",Ewe="clippingParents",D$="viewport",xg="popper",Cwe="reference",NL=Mb.reduce(function(e,t){return e.concat([t+"-"+Jp,t+"-"+Gy])},[]),O$=[].concat(Mb,[YD]).reduce(function(e,t){return e.concat([t,t+"-"+Jp,t+"-"+Gy])},[]),Twe="beforeRead",wwe="read",kwe="afterRead",Awe="beforeMain",Dwe="main",Owe="afterMain",Rwe="beforeWrite",Mwe="write",Nwe="afterWrite",Pwe=[Twe,wwe,kwe,Awe,Dwe,Owe,Rwe,Mwe,Nwe];function xl(e){return e?(e.nodeName||"").toLowerCase():null}function Di(e){if(e==null)return window;if(e.toString()!=="[object Window]"){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function Gd(e){var t=Di(e).Element;return e instanceof t||e instanceof Element}function rs(e){var t=Di(e).HTMLElement;return e instanceof t||e instanceof HTMLElement}function KD(e){if(typeof ShadowRoot>"u")return!1;var t=Di(e).ShadowRoot;return e instanceof t||e instanceof ShadowRoot}function Iwe(e){var t=e.state;Object.keys(t.elements).forEach(function(n){var r=t.styles[n]||{},o=t.attributes[n]||{},a=t.elements[n];!rs(a)||!xl(a)||(Object.assign(a.style,r),Object.keys(o).forEach(function(i){var s=o[i];s===!1?a.removeAttribute(i):a.setAttribute(i,s===!0?"":s)}))})}function _we(e){var t=e.state,n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow),function(){Object.keys(t.elements).forEach(function(r){var o=t.elements[r],a=t.attributes[r]||{},i=Object.keys(t.styles.hasOwnProperty(r)?t.styles[r]:n[r]),s=i.reduce(function(c,u){return c[u]="",c},{});!rs(o)||!xl(o)||(Object.assign(o.style,s),Object.keys(a).forEach(function(c){o.removeAttribute(c)}))})}}const Lwe={name:"applyStyles",enabled:!0,phase:"write",fn:Iwe,effect:_we,requires:["computeStyles"]};function hl(e){return e.split("-")[0]}var Pd=Math.max,ux=Math.min,eh=Math.round;function n2(){var e=navigator.userAgentData;return e!=null&&e.brands&&Array.isArray(e.brands)?e.brands.map(function(t){return t.brand+"/"+t.version}).join(" "):navigator.userAgent}function R$(){return!/^((?!chrome|android).)*safari/i.test(n2())}function th(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!1);var r=e.getBoundingClientRect(),o=1,a=1;t&&rs(e)&&(o=e.offsetWidth>0&&eh(r.width)/e.offsetWidth||1,a=e.offsetHeight>0&&eh(r.height)/e.offsetHeight||1);var i=Gd(e)?Di(e):window,s=i.visualViewport,c=!R$()&&n,u=(r.left+(c&&s?s.offsetLeft:0))/o,f=(r.top+(c&&s?s.offsetTop:0))/a,p=r.width/o,y=r.height/a;return{width:p,height:y,top:f,right:u+p,bottom:f+y,left:u,x:u,y:f}}function QD(e){var t=th(e),n=e.offsetWidth,r=e.offsetHeight;return Math.abs(t.width-n)<=1&&(n=t.width),Math.abs(t.height-r)<=1&&(r=t.height),{x:e.offsetLeft,y:e.offsetTop,width:n,height:r}}function M$(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&KD(n)){var r=t;do{if(r&&e.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function pc(e){return Di(e).getComputedStyle(e)}function Fwe(e){return["table","td","th"].indexOf(xl(e))>=0}function Fu(e){return((Gd(e)?e.ownerDocument:e.document)||window.document).documentElement}function BS(e){return xl(e)==="html"?e:e.assignedSlot||e.parentNode||(KD(e)?e.host:null)||Fu(e)}function PL(e){return!rs(e)||pc(e).position==="fixed"?null:e.offsetParent}function jwe(e){var t=/firefox/i.test(n2()),n=/Trident/i.test(n2());if(n&&rs(e)){var r=pc(e);if(r.position==="fixed")return null}var o=BS(e);for(KD(o)&&(o=o.host);rs(o)&&["html","body"].indexOf(xl(o))<0;){var a=pc(o);if(a.transform!=="none"||a.perspective!=="none"||a.contain==="paint"||["transform","perspective"].indexOf(a.willChange)!==-1||t&&a.willChange==="filter"||t&&a.filter&&a.filter!=="none")return o;o=o.parentNode}return null}function Nb(e){for(var t=Di(e),n=PL(e);n&&Fwe(n)&&pc(n).position==="static";)n=PL(n);return n&&(xl(n)==="html"||xl(n)==="body"&&pc(n).position==="static")?t:n||jwe(e)||t}function XD(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function hy(e,t,n){return Pd(e,ux(t,n))}function Bwe(e,t,n){var r=hy(e,t,n);return r>n?n:r}function N$(){return{top:0,right:0,bottom:0,left:0}}function P$(e){return Object.assign({},N$(),e)}function I$(e,t){return t.reduce(function(n,r){return n[r]=e,n},{})}var $we=function(e,t){return e=typeof e=="function"?e(Object.assign({},t.rects,{placement:t.placement})):e,P$(typeof e!="number"?e:I$(e,Mb))};function zwe(e){var t,n=e.state,r=e.name,o=e.options,a=n.elements.arrow,i=n.modifiersData.popperOffsets,s=hl(n.placement),c=XD(s),u=[Wa,ls].indexOf(s)>=0,f=u?"height":"width";if(!(!a||!i)){var p=$we(o.padding,n),y=QD(a),g=c==="y"?Va:Wa,b=c==="y"?ss:ls,x=n.rects.reference[f]+n.rects.reference[c]-i[c]-n.rects.popper[f],E=i[c]-n.rects.reference[c],S=Nb(a),w=S?c==="y"?S.clientHeight||0:S.clientWidth||0:0,C=x/2-E/2,R=p[g],M=w-y[f]-p[b],D=w/2-y[f]/2+C,I=hy(R,D,M),L=c;n.modifiersData[r]=(t={},t[L]=I,t.centerOffset=I-D,t)}}function Hwe(e){var t=e.state,n=e.options,r=n.element,o=r===void 0?"[data-popper-arrow]":r;o!=null&&(typeof o=="string"&&(o=t.elements.popper.querySelector(o),!o)||M$(t.elements.popper,o)&&(t.elements.arrow=o))}const Uwe={name:"arrow",enabled:!0,phase:"main",fn:zwe,effect:Hwe,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function nh(e){return e.split("-")[1]}var Vwe={top:"auto",right:"auto",bottom:"auto",left:"auto"};function Wwe(e,t){var n=e.x,r=e.y,o=t.devicePixelRatio||1;return{x:eh(n*o)/o||0,y:eh(r*o)/o||0}}function IL(e){var t,n=e.popper,r=e.popperRect,o=e.placement,a=e.variation,i=e.offsets,s=e.position,c=e.gpuAcceleration,u=e.adaptive,f=e.roundOffsets,p=e.isFixed,y=i.x,g=y===void 0?0:y,b=i.y,x=b===void 0?0:b,E=typeof f=="function"?f({x:g,y:x}):{x:g,y:x};g=E.x,x=E.y;var S=i.hasOwnProperty("x"),w=i.hasOwnProperty("y"),C=Wa,R=Va,M=window;if(u){var D=Nb(n),I="clientHeight",L="clientWidth";if(D===Di(n)&&(D=Fu(n),pc(D).position!=="static"&&s==="absolute"&&(I="scrollHeight",L="scrollWidth")),D=D,o===Va||(o===Wa||o===ls)&&a===Gy){R=ss;var F=p&&D===M&&M.visualViewport?M.visualViewport.height:D[I];x-=F-r.height,x*=c?1:-1}if(o===Wa||(o===Va||o===ss)&&a===Gy){C=ls;var B=p&&D===M&&M.visualViewport?M.visualViewport.width:D[L];g-=B-r.width,g*=c?1:-1}}var U=Object.assign({position:s},u&&Vwe),k=f===!0?Wwe({x:g,y:x},Di(n)):{x:g,y:x};if(g=k.x,x=k.y,c){var $;return Object.assign({},U,($={},$[R]=w?"0":"",$[C]=S?"0":"",$.transform=(M.devicePixelRatio||1)<=1?"translate("+g+"px, "+x+"px)":"translate3d("+g+"px, "+x+"px, 0)",$))}return Object.assign({},U,(t={},t[R]=w?x+"px":"",t[C]=S?g+"px":"",t.transform="",t))}function qwe(e){var t=e.state,n=e.options,r=n.gpuAcceleration,o=r===void 0?!0:r,a=n.adaptive,i=a===void 0?!0:a,s=n.roundOffsets,c=s===void 0?!0:s,u={placement:hl(t.placement),variation:nh(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:o,isFixed:t.options.strategy==="fixed"};t.modifiersData.popperOffsets!=null&&(t.styles.popper=Object.assign({},t.styles.popper,IL(Object.assign({},u,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:i,roundOffsets:c})))),t.modifiersData.arrow!=null&&(t.styles.arrow=Object.assign({},t.styles.arrow,IL(Object.assign({},u,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:c})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})}const Gwe={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:qwe,data:{}};var _0={passive:!0};function Ywe(e){var t=e.state,n=e.instance,r=e.options,o=r.scroll,a=o===void 0?!0:o,i=r.resize,s=i===void 0?!0:i,c=Di(t.elements.popper),u=[].concat(t.scrollParents.reference,t.scrollParents.popper);return a&&u.forEach(function(f){f.addEventListener("scroll",n.update,_0)}),s&&c.addEventListener("resize",n.update,_0),function(){a&&u.forEach(function(f){f.removeEventListener("scroll",n.update,_0)}),s&&c.removeEventListener("resize",n.update,_0)}}const Kwe={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:Ywe,data:{}};var Qwe={left:"right",right:"left",bottom:"top",top:"bottom"};function g1(e){return e.replace(/left|right|bottom|top/g,function(t){return Qwe[t]})}var Xwe={start:"end",end:"start"};function _L(e){return e.replace(/start|end/g,function(t){return Xwe[t]})}function ZD(e){var t=Di(e),n=t.pageXOffset,r=t.pageYOffset;return{scrollLeft:n,scrollTop:r}}function JD(e){return th(Fu(e)).left+ZD(e).scrollLeft}function Zwe(e,t){var n=Di(e),r=Fu(e),o=n.visualViewport,a=r.clientWidth,i=r.clientHeight,s=0,c=0;if(o){a=o.width,i=o.height;var u=R$();(u||!u&&t==="fixed")&&(s=o.offsetLeft,c=o.offsetTop)}return{width:a,height:i,x:s+JD(e),y:c}}function Jwe(e){var t,n=Fu(e),r=ZD(e),o=(t=e.ownerDocument)==null?void 0:t.body,a=Pd(n.scrollWidth,n.clientWidth,o?o.scrollWidth:0,o?o.clientWidth:0),i=Pd(n.scrollHeight,n.clientHeight,o?o.scrollHeight:0,o?o.clientHeight:0),s=-r.scrollLeft+JD(e),c=-r.scrollTop;return pc(o||n).direction==="rtl"&&(s+=Pd(n.clientWidth,o?o.clientWidth:0)-a),{width:a,height:i,x:s,y:c}}function eO(e){var t=pc(e),n=t.overflow,r=t.overflowX,o=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+o+r)}function _$(e){return["html","body","#document"].indexOf(xl(e))>=0?e.ownerDocument.body:rs(e)&&eO(e)?e:_$(BS(e))}function my(e,t){var n;t===void 0&&(t=[]);var r=_$(e),o=r===((n=e.ownerDocument)==null?void 0:n.body),a=Di(r),i=o?[a].concat(a.visualViewport||[],eO(r)?r:[]):r,s=t.concat(i);return o?s:s.concat(my(BS(i)))}function r2(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function eke(e,t){var n=th(e,!1,t==="fixed");return n.top=n.top+e.clientTop,n.left=n.left+e.clientLeft,n.bottom=n.top+e.clientHeight,n.right=n.left+e.clientWidth,n.width=e.clientWidth,n.height=e.clientHeight,n.x=n.left,n.y=n.top,n}function LL(e,t,n){return t===D$?r2(Zwe(e,n)):Gd(t)?eke(t,n):r2(Jwe(Fu(e)))}function tke(e){var t=my(BS(e)),n=["absolute","fixed"].indexOf(pc(e).position)>=0,r=n&&rs(e)?Nb(e):e;return Gd(r)?t.filter(function(o){return Gd(o)&&M$(o,r)&&xl(o)!=="body"}):[]}function nke(e,t,n,r){var o=t==="clippingParents"?tke(e):[].concat(t),a=[].concat(o,[n]),i=a[0],s=a.reduce(function(c,u){var f=LL(e,u,r);return c.top=Pd(f.top,c.top),c.right=ux(f.right,c.right),c.bottom=ux(f.bottom,c.bottom),c.left=Pd(f.left,c.left),c},LL(e,i,r));return s.width=s.right-s.left,s.height=s.bottom-s.top,s.x=s.left,s.y=s.top,s}function L$(e){var t=e.reference,n=e.element,r=e.placement,o=r?hl(r):null,a=r?nh(r):null,i=t.x+t.width/2-n.width/2,s=t.y+t.height/2-n.height/2,c;switch(o){case Va:c={x:i,y:t.y-n.height};break;case ss:c={x:i,y:t.y+t.height};break;case ls:c={x:t.x+t.width,y:s};break;case Wa:c={x:t.x-n.width,y:s};break;default:c={x:t.x,y:t.y}}var u=o?XD(o):null;if(u!=null){var f=u==="y"?"height":"width";switch(a){case Jp:c[u]=c[u]-(t[f]/2-n[f]/2);break;case Gy:c[u]=c[u]+(t[f]/2-n[f]/2);break}}return c}function Yy(e,t){t===void 0&&(t={});var n=t,r=n.placement,o=r===void 0?e.placement:r,a=n.strategy,i=a===void 0?e.strategy:a,s=n.boundary,c=s===void 0?Ewe:s,u=n.rootBoundary,f=u===void 0?D$:u,p=n.elementContext,y=p===void 0?xg:p,g=n.altBoundary,b=g===void 0?!1:g,x=n.padding,E=x===void 0?0:x,S=P$(typeof E!="number"?E:I$(E,Mb)),w=y===xg?Cwe:xg,C=e.rects.popper,R=e.elements[b?w:y],M=nke(Gd(R)?R:R.contextElement||Fu(e.elements.popper),c,f,i),D=th(e.elements.reference),I=L$({reference:D,element:C,placement:o}),L=r2(Object.assign({},C,I)),F=y===xg?L:D,B={top:M.top-F.top+S.top,bottom:F.bottom-M.bottom+S.bottom,left:M.left-F.left+S.left,right:F.right-M.right+S.right},U=e.modifiersData.offset;if(y===xg&&U){var k=U[o];Object.keys(B).forEach(function($){var j=[ls,ss].indexOf($)>=0?1:-1,V=[Va,ss].indexOf($)>=0?"y":"x";B[$]+=k[V]*j})}return B}function rke(e,t){t===void 0&&(t={});var n=t,r=n.placement,o=n.boundary,a=n.rootBoundary,i=n.padding,s=n.flipVariations,c=n.allowedAutoPlacements,u=c===void 0?O$:c,f=nh(r),p=f?s?NL:NL.filter(function(b){return nh(b)===f}):Mb,y=p.filter(function(b){return u.indexOf(b)>=0});y.length===0&&(y=p);var g=y.reduce(function(b,x){return b[x]=Yy(e,{placement:x,boundary:o,rootBoundary:a,padding:i})[hl(x)],b},{});return Object.keys(g).sort(function(b,x){return g[b]-g[x]})}function oke(e){if(hl(e)===YD)return[];var t=g1(e);return[_L(e),t,_L(t)]}function ake(e){var t=e.state,n=e.options,r=e.name;if(!t.modifiersData[r]._skip){for(var o=n.mainAxis,a=o===void 0?!0:o,i=n.altAxis,s=i===void 0?!0:i,c=n.fallbackPlacements,u=n.padding,f=n.boundary,p=n.rootBoundary,y=n.altBoundary,g=n.flipVariations,b=g===void 0?!0:g,x=n.allowedAutoPlacements,E=t.options.placement,S=hl(E),w=S===E,C=c||(w||!b?[g1(E)]:oke(E)),R=[E].concat(C).reduce(function(re,ne){return re.concat(hl(ne)===YD?rke(t,{placement:ne,boundary:f,rootBoundary:p,padding:u,flipVariations:b,allowedAutoPlacements:x}):ne)},[]),M=t.rects.reference,D=t.rects.popper,I=new Map,L=!0,F=R[0],B=0;B<R.length;B++){var U=R[B],k=hl(U),$=nh(U)===Jp,j=[Va,ss].indexOf(k)>=0,V=j?"width":"height",z=Yy(t,{placement:U,boundary:f,rootBoundary:p,altBoundary:y,padding:u}),K=j?$?ls:Wa:$?ss:Va;M[V]>D[V]&&(K=g1(K));var Y=g1(K),te=[];if(a&&te.push(z[k]<=0),s&&te.push(z[K]<=0,z[Y]<=0),te.every(function(re){return re})){F=U,L=!1;break}I.set(U,te)}if(L)for(var _=b?3:1,Z=function(re){var ne=R.find(function(X){var ie=I.get(X);if(ie)return ie.slice(0,re).every(function(ae){return ae})});if(ne)return F=ne,"break"},J=_;J>0;J--){var W=Z(J);if(W==="break")break}t.placement!==F&&(t.modifiersData[r]._skip=!0,t.placement=F,t.reset=!0)}}const ike={name:"flip",enabled:!0,phase:"main",fn:ake,requiresIfExists:["offset"],data:{_skip:!1}};function FL(e,t,n){return n===void 0&&(n={x:0,y:0}),{top:e.top-t.height-n.y,right:e.right-t.width+n.x,bottom:e.bottom-t.height+n.y,left:e.left-t.width-n.x}}function jL(e){return[Va,ls,ss,Wa].some(function(t){return e[t]>=0})}function ske(e){var t=e.state,n=e.name,r=t.rects.reference,o=t.rects.popper,a=t.modifiersData.preventOverflow,i=Yy(t,{elementContext:"reference"}),s=Yy(t,{altBoundary:!0}),c=FL(i,r),u=FL(s,o,a),f=jL(c),p=jL(u);t.modifiersData[n]={referenceClippingOffsets:c,popperEscapeOffsets:u,isReferenceHidden:f,hasPopperEscaped:p},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":f,"data-popper-escaped":p})}const lke={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:ske};function cke(e,t,n){var r=hl(e),o=[Wa,Va].indexOf(r)>=0?-1:1,a=typeof n=="function"?n(Object.assign({},t,{placement:e})):n,i=a[0],s=a[1];return i=i||0,s=(s||0)*o,[Wa,ls].indexOf(r)>=0?{x:s,y:i}:{x:i,y:s}}function uke(e){var t=e.state,n=e.options,r=e.name,o=n.offset,a=o===void 0?[0,0]:o,i=O$.reduce(function(f,p){return f[p]=cke(p,t.rects,a),f},{}),s=i[t.placement],c=s.x,u=s.y;t.modifiersData.popperOffsets!=null&&(t.modifiersData.popperOffsets.x+=c,t.modifiersData.popperOffsets.y+=u),t.modifiersData[r]=i}const dke={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:uke};function fke(e){var t=e.state,n=e.name;t.modifiersData[n]=L$({reference:t.rects.reference,element:t.rects.popper,placement:t.placement})}const pke={name:"popperOffsets",enabled:!0,phase:"read",fn:fke,data:{}};function hke(e){return e==="x"?"y":"x"}function mke(e){var t=e.state,n=e.options,r=e.name,o=n.mainAxis,a=o===void 0?!0:o,i=n.altAxis,s=i===void 0?!1:i,c=n.boundary,u=n.rootBoundary,f=n.altBoundary,p=n.padding,y=n.tether,g=y===void 0?!0:y,b=n.tetherOffset,x=b===void 0?0:b,E=Yy(t,{boundary:c,rootBoundary:u,padding:p,altBoundary:f}),S=hl(t.placement),w=nh(t.placement),C=!w,R=XD(S),M=hke(R),D=t.modifiersData.popperOffsets,I=t.rects.reference,L=t.rects.popper,F=typeof x=="function"?x(Object.assign({},t.rects,{placement:t.placement})):x,B=typeof F=="number"?{mainAxis:F,altAxis:F}:Object.assign({mainAxis:0,altAxis:0},F),U=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,k={x:0,y:0};if(D){if(a){var $,j=R==="y"?Va:Wa,V=R==="y"?ss:ls,z=R==="y"?"height":"width",K=D[R],Y=K+E[j],te=K-E[V],_=g?-L[z]/2:0,Z=w===Jp?I[z]:L[z],J=w===Jp?-L[z]:-I[z],W=t.elements.arrow,re=g&&W?QD(W):{width:0,height:0},ne=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:N$(),X=ne[j],ie=ne[V],ae=hy(0,I[z],re[z]),fe=C?I[z]/2-_-ae-X-B.mainAxis:Z-ae-X-B.mainAxis,xe=C?-I[z]/2+_+ae+ie+B.mainAxis:J+ae+ie+B.mainAxis,ge=t.elements.arrow&&Nb(t.elements.arrow),Re=ge?R==="y"?ge.clientTop||0:ge.clientLeft||0:0,de=($=U?.[R])!=null?$:0,me=K+fe-de-Re,Qe=K+xe-de,Me=hy(g?ux(Y,me):Y,K,g?Pd(te,Qe):te);D[R]=Me,k[R]=Me-K}if(s){var we,Se=R==="x"?Va:Wa,dt=R==="x"?ss:ls,ze=D[M],tt=M==="y"?"height":"width",Ze=ze+E[Se],qt=ze-E[dt],Vt=[Va,Wa].indexOf(S)!==-1,Mt=(we=U?.[M])!=null?we:0,ke=Vt?Ze:ze-I[tt]-L[tt]-Mt+B.altAxis,Ne=Vt?ze+I[tt]+L[tt]-Mt-B.altAxis:qt,lt=g&&Vt?Bwe(ke,ze,Ne):hy(g?ke:Ze,ze,g?Ne:qt);D[M]=lt,k[M]=lt-ze}t.modifiersData[r]=k}}const gke={name:"preventOverflow",enabled:!0,phase:"main",fn:mke,requiresIfExists:["offset"]};function yke(e){return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}}function bke(e){return e===Di(e)||!rs(e)?ZD(e):yke(e)}function vke(e){var t=e.getBoundingClientRect(),n=eh(t.width)/e.offsetWidth||1,r=eh(t.height)/e.offsetHeight||1;return n!==1||r!==1}function xke(e,t,n){n===void 0&&(n=!1);var r=rs(t),o=rs(t)&&vke(t),a=Fu(t),i=th(e,o,n),s={scrollLeft:0,scrollTop:0},c={x:0,y:0};return(r||!r&&!n)&&((xl(t)!=="body"||eO(a))&&(s=bke(t)),rs(t)?(c=th(t,!0),c.x+=t.clientLeft,c.y+=t.clientTop):a&&(c.x=JD(a))),{x:i.left+s.scrollLeft-c.x,y:i.top+s.scrollTop-c.y,width:i.width,height:i.height}}function Ske(e){var t=new Map,n=new Set,r=[];e.forEach(function(a){t.set(a.name,a)});function o(a){n.add(a.name);var i=[].concat(a.requires||[],a.requiresIfExists||[]);i.forEach(function(s){if(!n.has(s)){var c=t.get(s);c&&o(c)}}),r.push(a)}return e.forEach(function(a){n.has(a.name)||o(a)}),r}function Eke(e){var t=Ske(e);return Pwe.reduce(function(n,r){return n.concat(t.filter(function(o){return o.phase===r}))},[])}function Cke(e){var t;return function(){return t||(t=new Promise(function(n){Promise.resolve().then(function(){t=void 0,n(e())})})),t}}function Tke(e){var t=e.reduce(function(n,r){var o=n[r.name];return n[r.name]=o?Object.assign({},o,r,{options:Object.assign({},o.options,r.options),data:Object.assign({},o.data,r.data)}):r,n},{});return Object.keys(t).map(function(n){return t[n]})}var BL={placement:"bottom",modifiers:[],strategy:"absolute"};function $L(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return!t.some(function(r){return!(r&&typeof r.getBoundingClientRect=="function")})}function wke(e){e===void 0&&(e={});var t=e,n=t.defaultModifiers,r=n===void 0?[]:n,o=t.defaultOptions,a=o===void 0?BL:o;return function(i,s,c){c===void 0&&(c=a);var u={placement:"bottom",orderedModifiers:[],options:Object.assign({},BL,a),modifiersData:{},elements:{reference:i,popper:s},attributes:{},styles:{}},f=[],p=!1,y={state:u,setOptions:function(x){var E=typeof x=="function"?x(u.options):x;b(),u.options=Object.assign({},a,u.options,E),u.scrollParents={reference:Gd(i)?my(i):i.contextElement?my(i.contextElement):[],popper:my(s)};var S=Eke(Tke([].concat(r,u.options.modifiers)));return u.orderedModifiers=S.filter(function(w){return w.enabled}),g(),y.update()},forceUpdate:function(){if(!p){var x=u.elements,E=x.reference,S=x.popper;if($L(E,S)){u.rects={reference:xke(E,Nb(S),u.options.strategy==="fixed"),popper:QD(S)},u.reset=!1,u.placement=u.options.placement,u.orderedModifiers.forEach(function(L){return u.modifiersData[L.name]=Object.assign({},L.data)});for(var w=0;w<u.orderedModifiers.length;w++){if(u.reset===!0){u.reset=!1,w=-1;continue}var C=u.orderedModifiers[w],R=C.fn,M=C.options,D=M===void 0?{}:M,I=C.name;typeof R=="function"&&(u=R({state:u,options:D,name:I,instance:y})||u)}}}},update:Cke(function(){return new Promise(function(x){y.forceUpdate(),x(u)})}),destroy:function(){b(),p=!0}};if(!$L(i,s))return y;y.setOptions(c).then(function(x){!p&&c.onFirstUpdate&&c.onFirstUpdate(x)});function g(){u.orderedModifiers.forEach(function(x){var E=x.name,S=x.options,w=S===void 0?{}:S,C=x.effect;if(typeof C=="function"){var R=C({state:u,name:E,instance:y,options:w}),M=function(){};f.push(R||M)}})}function b(){f.forEach(function(x){return x()}),f=[]}return y}}var kke=[Kwe,pke,Gwe,Lwe,dke,ike,gke,Uwe,lke],Ake=wke({defaultModifiers:kke});function Dke(e){return Ut("MuiPopper",e)}Lt("MuiPopper",["root"]);function Oke(e,t){if(t==="ltr")return e;switch(e){case"bottom-end":return"bottom-start";case"bottom-start":return"bottom-end";case"top-end":return"top-start";case"top-start":return"top-end";default:return e}}function o2(e){return typeof e=="function"?e():e}function Rke(e){return e.nodeType!==void 0}const Mke=e=>{const{classes:t}=e;return zt({root:["root"]},Dke,t)},Nke={},Pke=T.forwardRef(function(e,t){const{anchorEl:n,children:r,direction:o,disablePortal:a,modifiers:i,open:s,placement:c,popperOptions:u,popperRef:f,slotProps:p={},slots:y={},TransitionProps:g,ownerState:b,...x}=e,E=T.useRef(null),S=cr(E,t),w=T.useRef(null),C=cr(w,f),R=T.useRef(C);Io(()=>{R.current=C},[C]),T.useImperativeHandle(f,()=>w.current,[]);const M=Oke(c,o),[D,I]=T.useState(M),[L,F]=T.useState(o2(n));T.useEffect(()=>{w.current&&w.current.forceUpdate()}),T.useEffect(()=>{n&&F(o2(n))},[n]),Io(()=>{if(!L||!s)return;const j=K=>{I(K.placement)};let V=[{name:"preventOverflow",options:{altBoundary:a}},{name:"flip",options:{altBoundary:a}},{name:"onUpdate",enabled:!0,phase:"afterWrite",fn:({state:K})=>{j(K)}}];i!=null&&(V=V.concat(i)),u&&u.modifiers!=null&&(V=V.concat(u.modifiers));const z=Ake(L,E.current,{placement:M,...u,modifiers:V});return R.current(z),()=>{z.destroy(),R.current(null)}},[L,a,i,s,u,M]);const B={placement:D};g!==null&&(B.TransitionProps=g);const U=Mke(e),k=y.root??"div",$=mr({elementType:k,externalSlotProps:p.root,externalForwardedProps:x,additionalProps:{role:"tooltip",ref:S},ownerState:e,className:U.root});return m.jsx(k,{...$,children:typeof r=="function"?r(B):r})}),Ike=T.forwardRef(function(e,t){const{anchorEl:n,children:r,container:o,direction:a="ltr",disablePortal:i=!1,keepMounted:s=!1,modifiers:c,open:u,placement:f="bottom",popperOptions:p=Nke,popperRef:y,style:g,transition:b=!1,slotProps:x={},slots:E={},...S}=e,[w,C]=T.useState(!0),R=()=>{C(!1)},M=()=>{C(!0)};if(!s&&!u&&(!b||w))return null;let D;if(o)D=o;else if(n){const F=o2(n);D=F&&Rke(F)?Po(F).body:Po(null).body}const I=!u&&s&&(!b||w)?"none":void 0,L=b?{in:u,onEnter:R,onExited:M}:void 0;return m.jsx(a$,{disablePortal:i,container:D,children:m.jsx(Pke,{anchorEl:n,direction:a,disablePortal:i,modifiers:c,ref:t,open:b?!w:u,placement:f,popperOptions:p,popperRef:y,slotProps:x,slots:E,...S,style:{position:"fixed",top:0,left:0,display:I,...g},TransitionProps:L,children:r})})}),_ke=Pe(Ike,{name:"MuiPopper",slot:"Root"})({}),tO=T.forwardRef(function(e,t){const n=js(),r=An({props:e,name:"MuiPopper"}),{anchorEl:o,component:a,components:i,componentsProps:s,container:c,disablePortal:u,keepMounted:f,modifiers:p,open:y,placement:g,popperOptions:b,popperRef:x,transition:E,slots:S,slotProps:w,...C}=r,R=S?.root??i?.Root,M={anchorEl:o,container:c,disablePortal:u,keepMounted:f,modifiers:p,open:y,placement:g,popperOptions:b,popperRef:x,transition:E,...C};return m.jsx(_ke,{as:a,direction:n?"rtl":"ltr",slots:{root:R},slotProps:w??s,...M,ref:t})});function Lke(e){return Ut("MuiListSubheader",e)}Lt("MuiListSubheader",["root","colorPrimary","colorInherit","gutters","inset","sticky"]);const Fke=e=>{const{classes:t,color:n,disableGutters:r,inset:o,disableSticky:a}=e,i={root:["root",n!=="default"&&`color${bt(n)}`,!r&&"gutters",o&&"inset",!a&&"sticky"]};return zt(i,Lke,t)},jke=Pe("li",{name:"MuiListSubheader",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.color!=="default"&&t[`color${bt(n.color)}`],!n.disableGutters&&t.gutters,n.inset&&t.inset,!n.disableSticky&&t.sticky]}})(Pn(({theme:e})=>({boxSizing:"border-box",lineHeight:"48px",listStyle:"none",color:(e.vars||e).palette.text.secondary,fontFamily:e.typography.fontFamily,fontWeight:e.typography.fontWeightMedium,fontSize:e.typography.pxToRem(14),variants:[{props:{color:"primary"},style:{color:(e.vars||e).palette.primary.main}},{props:{color:"inherit"},style:{color:"inherit"}},{props:({ownerState:t})=>!t.disableGutters,style:{paddingLeft:16,paddingRight:16}},{props:({ownerState:t})=>t.inset,style:{paddingLeft:72}},{props:({ownerState:t})=>!t.disableSticky,style:{position:"sticky",top:0,zIndex:1,backgroundColor:(e.vars||e).palette.background.paper}}]}))),a2=T.forwardRef(function(e,t){const n=An({props:e,name:"MuiListSubheader"}),{className:r,color:o="default",component:a="li",disableGutters:i=!1,disableSticky:s=!1,inset:c=!1,...u}=n,f={...n,color:o,component:a,disableGutters:i,disableSticky:s,inset:c},p=Fke(f);return m.jsx(jke,{as:a,className:Ot(p.root,r),ref:t,ownerState:f,...u})});a2&&(a2.muiSkipListHighlight=!0);const Bke=Fn(m.jsx("path",{d:"M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2zm5 13.59L15.59 17 12 13.41 8.41 17 7 15.59 10.59 12 7 8.41 8.41 7 12 10.59 15.59 7 17 8.41 13.41 12 17 15.59z"}));function $ke(e){return Ut("MuiChip",e)}const Jn=Lt("MuiChip",["root","sizeSmall","sizeMedium","colorDefault","colorError","colorInfo","colorPrimary","colorSecondary","colorSuccess","colorWarning","disabled","clickable","clickableColorPrimary","clickableColorSecondary","deletable","deletableColorPrimary","deletableColorSecondary","outlined","filled","outlinedPrimary","outlinedSecondary","filledPrimary","filledSecondary","avatar","avatarSmall","avatarMedium","avatarColorPrimary","avatarColorSecondary","icon","iconSmall","iconMedium","iconColorPrimary","iconColorSecondary","label","labelSmall","labelMedium","deleteIcon","deleteIconSmall","deleteIconMedium","deleteIconColorPrimary","deleteIconColorSecondary","deleteIconOutlinedColorPrimary","deleteIconOutlinedColorSecondary","deleteIconFilledColorPrimary","deleteIconFilledColorSecondary","focusVisible"]),zke=e=>{const{classes:t,disabled:n,size:r,color:o,iconColor:a,onDelete:i,clickable:s,variant:c}=e,u={root:["root",c,n&&"disabled",`size${bt(r)}`,`color${bt(o)}`,s&&"clickable",s&&`clickableColor${bt(o)}`,i&&"deletable",i&&`deletableColor${bt(o)}`,`${c}${bt(o)}`],label:["label",`label${bt(r)}`],avatar:["avatar",`avatar${bt(r)}`,`avatarColor${bt(o)}`],icon:["icon",`icon${bt(r)}`,`iconColor${bt(a)}`],deleteIcon:["deleteIcon",`deleteIcon${bt(r)}`,`deleteIconColor${bt(o)}`,`deleteIcon${bt(c)}Color${bt(o)}`]};return zt(u,$ke,t)},Hke=Pe("div",{name:"MuiChip",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e,{color:r,iconColor:o,clickable:a,onDelete:i,size:s,variant:c}=n;return[{[`& .${Jn.avatar}`]:t.avatar},{[`& .${Jn.avatar}`]:t[`avatar${bt(s)}`]},{[`& .${Jn.avatar}`]:t[`avatarColor${bt(r)}`]},{[`& .${Jn.icon}`]:t.icon},{[`& .${Jn.icon}`]:t[`icon${bt(s)}`]},{[`& .${Jn.icon}`]:t[`iconColor${bt(o)}`]},{[`& .${Jn.deleteIcon}`]:t.deleteIcon},{[`& .${Jn.deleteIcon}`]:t[`deleteIcon${bt(s)}`]},{[`& .${Jn.deleteIcon}`]:t[`deleteIconColor${bt(r)}`]},{[`& .${Jn.deleteIcon}`]:t[`deleteIcon${bt(c)}Color${bt(r)}`]},t.root,t[`size${bt(s)}`],t[`color${bt(r)}`],a&&t.clickable,a&&r!=="default"&&t[`clickableColor${bt(r)})`],i&&t.deletable,i&&r!=="default"&&t[`deletableColor${bt(r)}`],t[c],t[`${c}${bt(r)}`]]}})(Pn(({theme:e})=>{const t=e.palette.mode==="light"?e.palette.grey[700]:e.palette.grey[300];return{maxWidth:"100%",fontFamily:e.typography.fontFamily,fontSize:e.typography.pxToRem(13),display:"inline-flex",alignItems:"center",justifyContent:"center",height:32,lineHeight:1.5,color:(e.vars||e).palette.text.primary,backgroundColor:(e.vars||e).palette.action.selected,borderRadius:32/2,whiteSpace:"nowrap",transition:e.transitions.create(["background-color","box-shadow"]),cursor:"unset",outline:0,textDecoration:"none",border:0,padding:0,verticalAlign:"middle",boxSizing:"border-box",[`&.${Jn.disabled}`]:{opacity:(e.vars||e).palette.action.disabledOpacity,pointerEvents:"none"},[`& .${Jn.avatar}`]:{marginLeft:5,marginRight:-6,width:24,height:24,color:e.vars?e.vars.palette.Chip.defaultAvatarColor:t,fontSize:e.typography.pxToRem(12)},[`& .${Jn.avatarColorPrimary}`]:{color:(e.vars||e).palette.primary.contrastText,backgroundColor:(e.vars||e).palette.primary.dark},[`& .${Jn.avatarColorSecondary}`]:{color:(e.vars||e).palette.secondary.contrastText,backgroundColor:(e.vars||e).palette.secondary.dark},[`& .${Jn.avatarSmall}`]:{marginLeft:4,marginRight:-4,width:18,height:18,fontSize:e.typography.pxToRem(10)},[`& .${Jn.icon}`]:{marginLeft:5,marginRight:-6},[`& .${Jn.deleteIcon}`]:{WebkitTapHighlightColor:"transparent",color:e.alpha((e.vars||e).palette.text.primary,.26),fontSize:22,cursor:"pointer",margin:"0 5px 0 -6px","&:hover":{color:e.alpha((e.vars||e).palette.text.primary,.4)}},variants:[{props:{size:"small"},style:{height:24,[`& .${Jn.icon}`]:{fontSize:18,marginLeft:4,marginRight:-4},[`& .${Jn.deleteIcon}`]:{fontSize:16,marginRight:4,marginLeft:-4}}},...Object.entries(e.palette).filter(Sa(["contrastText"])).map(([n])=>({props:{color:n},style:{backgroundColor:(e.vars||e).palette[n].main,color:(e.vars||e).palette[n].contrastText,[`& .${Jn.deleteIcon}`]:{color:e.alpha((e.vars||e).palette[n].contrastText,.7),"&:hover, &:active":{color:(e.vars||e).palette[n].contrastText}}}})),{props:n=>n.iconColor===n.color,style:{[`& .${Jn.icon}`]:{color:e.vars?e.vars.palette.Chip.defaultIconColor:t}}},{props:n=>n.iconColor===n.color&&n.color!=="default",style:{[`& .${Jn.icon}`]:{color:"inherit"}}},{props:{onDelete:!0},style:{[`&.${Jn.focusVisible}`]:{backgroundColor:e.alpha((e.vars||e).palette.action.selected,`${(e.vars||e).palette.action.selectedOpacity} + ${(e.vars||e).palette.action.focusOpacity}`)}}},...Object.entries(e.palette).filter(Sa(["dark"])).map(([n])=>({props:{color:n,onDelete:!0},style:{[`&.${Jn.focusVisible}`]:{background:(e.vars||e).palette[n].dark}}})),{props:{clickable:!0},style:{userSelect:"none",WebkitTapHighlightColor:"transparent",cursor:"pointer","&:hover":{backgroundColor:e.alpha((e.vars||e).palette.action.selected,`${(e.vars||e).palette.action.selectedOpacity} + ${(e.vars||e).palette.action.hoverOpacity}`)},[`&.${Jn.focusVisible}`]:{backgroundColor:e.alpha((e.vars||e).palette.action.selected,`${(e.vars||e).palette.action.selectedOpacity} + ${(e.vars||e).palette.action.focusOpacity}`)},"&:active":{boxShadow:(e.vars||e).shadows[1]}}},...Object.entries(e.palette).filter(Sa(["dark"])).map(([n])=>({props:{color:n,clickable:!0},style:{[`&:hover, &.${Jn.focusVisible}`]:{backgroundColor:(e.vars||e).palette[n].dark}}})),{props:{variant:"outlined"},style:{backgroundColor:"transparent",border:e.vars?`1px solid ${e.vars.palette.Chip.defaultBorder}`:`1px solid ${e.palette.mode==="light"?e.palette.grey[400]:e.palette.grey[700]}`,[`&.${Jn.clickable}:hover`]:{backgroundColor:(e.vars||e).palette.action.hover},[`&.${Jn.focusVisible}`]:{backgroundColor:(e.vars||e).palette.action.focus},[`& .${Jn.avatar}`]:{marginLeft:4},[`& .${Jn.avatarSmall}`]:{marginLeft:2},[`& .${Jn.icon}`]:{marginLeft:4},[`& .${Jn.iconSmall}`]:{marginLeft:2},[`& .${Jn.deleteIcon}`]:{marginRight:5},[`& .${Jn.deleteIconSmall}`]:{marginRight:3}}},...Object.entries(e.palette).filter(Sa()).map(([n])=>({props:{variant:"outlined",color:n},style:{color:(e.vars||e).palette[n].main,border:`1px solid ${e.alpha((e.vars||e).palette[n].main,.7)}`,[`&.${Jn.clickable}:hover`]:{backgroundColor:e.alpha((e.vars||e).palette[n].main,(e.vars||e).palette.action.hoverOpacity)},[`&.${Jn.focusVisible}`]:{backgroundColor:e.alpha((e.vars||e).palette[n].main,(e.vars||e).palette.action.focusOpacity)},[`& .${Jn.deleteIcon}`]:{color:e.alpha((e.vars||e).palette[n].main,.7),"&:hover, &:active":{color:(e.vars||e).palette[n].main}}}}))]}})),Uke=Pe("span",{name:"MuiChip",slot:"Label",overridesResolver:(e,t)=>{const{ownerState:n}=e,{size:r}=n;return[t.label,t[`label${bt(r)}`]]}})({overflow:"hidden",textOverflow:"ellipsis",paddingLeft:12,paddingRight:12,whiteSpace:"nowrap",variants:[{props:{variant:"outlined"},style:{paddingLeft:11,paddingRight:11}},{props:{size:"small"},style:{paddingLeft:8,paddingRight:8}},{props:{size:"small",variant:"outlined"},style:{paddingLeft:7,paddingRight:7}}]});function zL(e){return e.key==="Backspace"||e.key==="Delete"}const F$=T.forwardRef(function(e,t){const n=An({props:e,name:"MuiChip"}),{avatar:r,className:o,clickable:a,color:i="default",component:s,deleteIcon:c,disabled:u=!1,icon:f,label:p,onClick:y,onDelete:g,onKeyDown:b,onKeyUp:x,size:E="medium",variant:S="filled",tabIndex:w,skipFocusWhenDisabled:C=!1,slots:R={},slotProps:M={},...D}=n,I=T.useRef(null),L=cr(I,t),F=ne=>{ne.stopPropagation(),g&&g(ne)},B=ne=>{ne.currentTarget===ne.target&&zL(ne)&&ne.preventDefault(),b&&b(ne)},U=ne=>{ne.currentTarget===ne.target&&g&&zL(ne)&&g(ne),x&&x(ne)},k=a!==!1&&y?!0:a,$=k||g?Wd:s||"div",j={...n,component:$,disabled:u,size:E,color:i,iconColor:T.isValidElement(f)&&f.props.color||i,onDelete:!!g,clickable:k,variant:S},V=zke(j),z=$===Wd?{component:s||"div",focusVisibleClassName:V.focusVisible,...g&&{disableRipple:!0}}:{};let K=null;g&&(K=c&&T.isValidElement(c)?T.cloneElement(c,{className:Ot(c.props.className,V.deleteIcon),onClick:F}):m.jsx(Bke,{className:V.deleteIcon,onClick:F}));let Y=null;r&&T.isValidElement(r)&&(Y=T.cloneElement(r,{className:Ot(V.avatar,r.props.className)}));let te=null;f&&T.isValidElement(f)&&(te=T.cloneElement(f,{className:Ot(V.icon,f.props.className)}));const _={slots:R,slotProps:M},[Z,J]=tr("root",{elementType:Hke,externalForwardedProps:{..._,...D},ownerState:j,shouldForwardComponentProp:!0,ref:L,className:Ot(V.root,o),additionalProps:{disabled:k&&u?!0:void 0,tabIndex:C&&u?-1:w,...z},getSlotProps:ne=>({...ne,onClick:X=>{ne.onClick?.(X),y?.(X)},onKeyDown:X=>{ne.onKeyDown?.(X),B(X)},onKeyUp:X=>{ne.onKeyUp?.(X),U(X)}})}),[W,re]=tr("label",{elementType:Uke,externalForwardedProps:_,ownerState:j,className:V.label});return m.jsxs(Z,{as:$,...J,children:[Y||te,m.jsx(W,{...re,children:p}),K]})}),Vke=Fn(m.jsx("path",{d:"M19 6.41L17.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 Wke(e){return Ut("MuiAutocomplete",e)}const Bn=Lt("MuiAutocomplete",["root","expanded","fullWidth","focused","focusVisible","tag","tagSizeSmall","tagSizeMedium","hasPopupIcon","hasClearIcon","inputRoot","input","inputFocused","endAdornment","clearIndicator","popupIndicator","popupIndicatorOpen","popper","popperDisablePortal","paper","listbox","loading","noOptions","option","groupLabel","groupUl"]);var HL,UL;const qke=e=>{const{classes:t,disablePortal:n,expanded:r,focused:o,fullWidth:a,hasClearIcon:i,hasPopupIcon:s,inputFocused:c,popupOpen:u,size:f}=e,p={root:["root",r&&"expanded",o&&"focused",a&&"fullWidth",i&&"hasClearIcon",s&&"hasPopupIcon"],inputRoot:["inputRoot"],input:["input",c&&"inputFocused"],tag:["tag",`tagSize${bt(f)}`],endAdornment:["endAdornment"],clearIndicator:["clearIndicator"],popupIndicator:["popupIndicator",u&&"popupIndicatorOpen"],popper:["popper",n&&"popperDisablePortal"],paper:["paper"],listbox:["listbox"],loading:["loading"],noOptions:["noOptions"],option:["option"],groupLabel:["groupLabel"],groupUl:["groupUl"]};return zt(p,Wke,t)},Gke=Pe("div",{name:"MuiAutocomplete",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e,{fullWidth:r,hasClearIcon:o,hasPopupIcon:a,inputFocused:i,size:s}=n;return[{[`& .${Bn.tag}`]:t.tag},{[`& .${Bn.tag}`]:t[`tagSize${bt(s)}`]},{[`& .${Bn.inputRoot}`]:t.inputRoot},{[`& .${Bn.input}`]:t.input},{[`& .${Bn.input}`]:i&&t.inputFocused},t.root,r&&t.fullWidth,a&&t.hasPopupIcon,o&&t.hasClearIcon]}})({[`&.${Bn.focused} .${Bn.clearIndicator}`]:{visibility:"visible"},"@media (pointer: fine)":{[`&:hover .${Bn.clearIndicator}`]:{visibility:"visible"}},[`& .${Bn.tag}`]:{margin:3,maxWidth:"calc(100% - 6px)"},[`& .${Bn.inputRoot}`]:{[`.${Bn.hasPopupIcon}&, .${Bn.hasClearIcon}&`]:{paddingRight:30},[`.${Bn.hasPopupIcon}.${Bn.hasClearIcon}&`]:{paddingRight:56},[`& .${Bn.input}`]:{width:0,minWidth:30}},[`& .${fu.root}`]:{paddingBottom:1,"& .MuiInput-input":{padding:"4px 4px 4px 0px"}},[`& .${fu.root}.${pi.sizeSmall}`]:{[`& .${fu.input}`]:{padding:"2px 4px 3px 0"}},[`& .${Vi.root}`]:{padding:9,[`.${Bn.hasPopupIcon}&, .${Bn.hasClearIcon}&`]:{paddingRight:39},[`.${Bn.hasPopupIcon}.${Bn.hasClearIcon}&`]:{paddingRight:65},[`& .${Bn.input}`]:{padding:"7.5px 4px 7.5px 5px"},[`& .${Bn.endAdornment}`]:{right:9}},[`& .${Vi.root}.${pi.sizeSmall}`]:{paddingTop:6,paddingBottom:6,paddingLeft:6,[`& .${Bn.input}`]:{padding:"2.5px 4px 2.5px 8px"}},[`& .${hi.root}`]:{paddingTop:19,paddingLeft:8,[`.${Bn.hasPopupIcon}&, .${Bn.hasClearIcon}&`]:{paddingRight:39},[`.${Bn.hasPopupIcon}.${Bn.hasClearIcon}&`]:{paddingRight:65},[`& .${hi.input}`]:{padding:"7px 4px"},[`& .${Bn.endAdornment}`]:{right:9}},[`& .${hi.root}.${pi.sizeSmall}`]:{paddingBottom:1,[`& .${hi.input}`]:{padding:"2.5px 4px"}},[`& .${pi.hiddenLabel}`]:{paddingTop:8},[`& .${hi.root}.${pi.hiddenLabel}`]:{paddingTop:0,paddingBottom:0,[`& .${Bn.input}`]:{paddingTop:16,paddingBottom:17}},[`& .${hi.root}.${pi.hiddenLabel}.${pi.sizeSmall}`]:{[`& .${Bn.input}`]:{paddingTop:8,paddingBottom:9}},[`& .${Bn.input}`]:{flexGrow:1,textOverflow:"ellipsis",opacity:0},variants:[{props:{fullWidth:!0},style:{width:"100%"}},{props:{size:"small"},style:{[`& .${Bn.tag}`]:{margin:2,maxWidth:"calc(100% - 4px)"}}},{props:{inputFocused:!0},style:{[`& .${Bn.input}`]:{opacity:1}}},{props:{multiple:!0},style:{[`& .${Bn.inputRoot}`]:{flexWrap:"wrap"}}}]}),Yke=Pe("div",{name:"MuiAutocomplete",slot:"EndAdornment"})({position:"absolute",right:0,top:"50%",transform:"translate(0, -50%)"}),Kke=Pe(gs,{name:"MuiAutocomplete",slot:"ClearIndicator"})({marginRight:-2,padding:4,visibility:"hidden"}),Qke=Pe(gs,{name:"MuiAutocomplete",slot:"PopupIndicator",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.popupIndicator,n.popupOpen&&t.popupIndicatorOpen]}})({padding:2,marginRight:-2,variants:[{props:{popupOpen:!0},style:{transform:"rotate(180deg)"}}]}),Xke=Pe(tO,{name:"MuiAutocomplete",slot:"Popper",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[{[`& .${Bn.option}`]:t.option},t.popper,n.disablePortal&&t.popperDisablePortal]}})(Pn(({theme:e})=>({zIndex:(e.vars||e).zIndex.modal,variants:[{props:{disablePortal:!0},style:{position:"absolute"}}]}))),Zke=Pe(rf,{name:"MuiAutocomplete",slot:"Paper"})(Pn(({theme:e})=>({...e.typography.body1,overflow:"auto"}))),Jke=Pe("div",{name:"MuiAutocomplete",slot:"Loading"})(Pn(({theme:e})=>({color:(e.vars||e).palette.text.secondary,padding:"14px 16px"}))),e2e=Pe("div",{name:"MuiAutocomplete",slot:"NoOptions"})(Pn(({theme:e})=>({color:(e.vars||e).palette.text.secondary,padding:"14px 16px"}))),t2e=Pe("ul",{name:"MuiAutocomplete",slot:"Listbox"})(Pn(({theme:e})=>({listStyle:"none",margin:0,padding:"8px 0",maxHeight:"40vh",overflow:"auto",position:"relative",[`& .${Bn.option}`]:{minHeight:48,display:"flex",overflow:"hidden",justifyContent:"flex-start",alignItems:"center",cursor:"pointer",paddingTop:6,boxSizing:"border-box",outline:"0",WebkitTapHighlightColor:"transparent",paddingBottom:6,paddingLeft:16,paddingRight:16,[e.breakpoints.up("sm")]:{minHeight:"auto"},[`&.${Bn.focused}`]:{backgroundColor:(e.vars||e).palette.action.hover,"@media (hover: none)":{backgroundColor:"transparent"}},'&[aria-disabled="true"]':{opacity:(e.vars||e).palette.action.disabledOpacity,pointerEvents:"none"},[`&.${Bn.focusVisible}`]:{backgroundColor:(e.vars||e).palette.action.focus},'&[aria-selected="true"]':{backgroundColor:e.alpha((e.vars||e).palette.primary.main,(e.vars||e).palette.action.selectedOpacity),[`&.${Bn.focused}`]:{backgroundColor:e.alpha((e.vars||e).palette.primary.main,`${(e.vars||e).palette.action.selectedOpacity} + ${(e.vars||e).palette.action.hoverOpacity}`),"@media (hover: none)":{backgroundColor:(e.vars||e).palette.action.selected}},[`&.${Bn.focusVisible}`]:{backgroundColor:e.alpha((e.vars||e).palette.primary.main,`${(e.vars||e).palette.action.selectedOpacity} + ${(e.vars||e).palette.action.focusOpacity}`)}}}}))),n2e=Pe(a2,{name:"MuiAutocomplete",slot:"GroupLabel"})(Pn(({theme:e})=>({backgroundColor:(e.vars||e).palette.background.paper,top:-8}))),r2e=Pe("ul",{name:"MuiAutocomplete",slot:"GroupUl"})({padding:0,[`& .${Bn.option}`]:{paddingLeft:24}}),i2=T.forwardRef(function(e,t){const n=An({props:e,name:"MuiAutocomplete"}),{autoComplete:r=!1,autoHighlight:o=!1,autoSelect:a=!1,blurOnSelect:i=!1,ChipProps:s,className:c,clearIcon:u=HL||(HL=m.jsx(Vke,{fontSize:"small"})),clearOnBlur:f=!n.freeSolo,clearOnEscape:p=!1,clearText:y="Clear",closeText:g="Close",componentsProps:b,defaultValue:x=n.multiple?[]:null,disableClearable:E=!1,disableCloseOnSelect:S=!1,disabled:w=!1,disabledItemsFocusable:C=!1,disableListWrap:R=!1,disablePortal:M=!1,filterOptions:D,filterSelectedOptions:I=!1,forcePopupIcon:L="auto",freeSolo:F=!1,fullWidth:B=!1,getLimitTagsText:U=sn=>`+${sn}`,getOptionDisabled:k,getOptionKey:$,getOptionLabel:j,isOptionEqualToValue:V,groupBy:z,handleHomeEndKeys:K=!n.freeSolo,id:Y,includeInputInList:te=!1,inputValue:_,limitTags:Z=-1,ListboxComponent:J,ListboxProps:W,loading:re=!1,loadingText:ne="Loading…",multiple:X=!1,noOptionsText:ie="No options",onChange:ae,onClose:fe,onHighlightChange:xe,onInputChange:ge,onOpen:Re,open:de,openOnFocus:me=!1,openText:Qe="Open",options:Me,PaperComponent:we,PopperComponent:Se,popupIcon:dt=UL||(UL=m.jsx(k$,{})),readOnly:ze=!1,renderGroup:tt,renderInput:Ze,renderOption:qt,renderTags:Vt,renderValue:Mt,selectOnFocus:ke=!n.freeSolo,size:Ne="medium",slots:lt={},slotProps:St={},value:ft,...$e}=n,{getRootProps:Ht,getInputProps:$t,getInputLabelProps:pt,getPopupIndicatorProps:Te,getClearProps:Ue,getItemProps:yt,getListboxProps:ht,getOptionProps:Cn,value:On,dirty:In,expanded:pn,id:Gn,popupOpen:Hn,focused:wn,focusedItem:or,anchorEl:Wt,setAnchorEl:he,inputValue:Ae,groupedOptions:Ie}=Swe({...n,componentName:"Autocomplete"}),Ve=!E&&!w&&In&&!ze,ot=(!F||L===!0)&&L!==!1,{onMouseDown:It}=$t(),{ref:Ft,...Rt}=ht(),jt=j||(sn=>sn.label??sn),Nt={...n,disablePortal:M,expanded:pn,focused:wn,fullWidth:B,getOptionLabel:jt,hasClearIcon:Ve,hasPopupIcon:ot,inputFocused:or===-1,popupOpen:Hn,size:Ne},kt=qke(Nt),Et={slots:{paper:we,popper:Se,...lt},slotProps:{chip:s,listbox:W,...b,...St}},[Bt,Tn]=tr("listbox",{elementType:t2e,externalForwardedProps:Et,ownerState:Nt,className:kt.listbox,additionalProps:Rt,ref:Ft}),[nr,Yn]=tr("paper",{elementType:rf,externalForwardedProps:Et,ownerState:Nt,className:kt.paper}),[rn,le]=tr("popper",{elementType:tO,externalForwardedProps:Et,ownerState:Nt,className:kt.popper,additionalProps:{disablePortal:M,style:{width:Wt?Wt.clientWidth:null},role:"presentation",anchorEl:Wt,open:Hn}});let ce;const Be=sn=>({className:kt.tag,disabled:w,...yt(sn)});if(X?On.length>0&&(Vt?ce=Vt(On,Be,Nt):Mt?ce=Mt(On,Be,Nt):ce=On.map((sn,qr)=>{const{key:en,...gr}=Be({index:qr});return m.jsx(F$,{label:jt(sn),size:Ne,...gr,...Et.slotProps.chip},en)})):Mt&&On!=null&&(ce=Mt(On,Be,Nt)),Z>-1&&Array.isArray(ce)){const sn=ce.length-Z;!wn&&sn>0&&(ce=ce.splice(0,Z),ce.push(m.jsx("span",{className:kt.tag,children:U(sn)},ce.length)))}const ut=tt||(sn=>m.jsxs("li",{children:[m.jsx(n2e,{className:kt.groupLabel,ownerState:Nt,component:"div",children:sn.group}),m.jsx(r2e,{className:kt.groupUl,ownerState:Nt,children:sn.children})]},sn.key)),qe=qt||((sn,qr)=>{const{key:en,...gr}=sn;return m.jsx("li",{...gr,children:jt(qr)},en)}),Zt=(sn,qr)=>{const en=Cn({option:sn,index:qr});return qe({...en,className:kt.option},sn,{selected:en["aria-selected"],index:qr,inputValue:Ae},Nt)},an=Et.slotProps.clearIndicator,vr=Et.slotProps.popupIndicator;return m.jsxs(T.Fragment,{children:[m.jsx(Gke,{ref:t,className:Ot(kt.root,c),ownerState:Nt,...Ht($e),children:Ze({id:Gn,disabled:w,fullWidth:!0,size:Ne==="small"?"small":void 0,InputLabelProps:pt(),InputProps:{ref:he,className:kt.inputRoot,startAdornment:ce,onMouseDown:sn=>{sn.target===sn.currentTarget&&It(sn)},...(Ve||ot)&&{endAdornment:m.jsxs(Yke,{className:kt.endAdornment,ownerState:Nt,children:[Ve?m.jsx(Kke,{...Ue(),"aria-label":y,title:y,ownerState:Nt,...an,className:Ot(kt.clearIndicator,an?.className),children:u}):null,ot?m.jsx(Qke,{...Te(),disabled:w,"aria-label":Hn?g:Qe,title:Hn?g:Qe,ownerState:Nt,...vr,className:Ot(kt.popupIndicator,vr?.className),children:dt}):null]})}},inputProps:{className:kt.input,disabled:w,readOnly:ze,...$t()}})}),Wt?m.jsx(Xke,{as:rn,...le,children:m.jsxs(Zke,{as:nr,...Yn,children:[re&&Ie.length===0?m.jsx(Jke,{className:kt.loading,ownerState:Nt,children:ne}):null,Ie.length===0&&!F&&!re?m.jsx(e2e,{className:kt.noOptions,ownerState:Nt,role:"presentation",onMouseDown:sn=>{sn.preventDefault()},children:ie}):null,Ie.length>0?m.jsx(Bt,{as:J,...Tn,children:Ie.map((sn,qr)=>z?ut({key:sn.key,group:sn.group,children:sn.options.map((en,gr)=>Zt(en,sn.index+gr))}):Zt(sn,qr))}):null]})}):null]})});var s2={exports:{}},o2e=s2.exports,VL;function a2e(){return VL||(VL=1,(function(e,t){(function(n,r){e.exports=r()})(o2e,(function(){var n=1e3,r=6e4,o=36e5,a="millisecond",i="second",s="minute",c="hour",u="day",f="week",p="month",y="quarter",g="year",b="date",x="Invalid Date",E=/^(\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,w={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(j){var V=["th","st","nd","rd"],z=j%100;return"["+j+(V[(z-20)%10]||V[z]||V[0])+"]"}},C=function(j,V,z){var K=String(j);return!K||K.length>=V?j:""+Array(V+1-K.length).join(z)+j},R={s:C,z:function(j){var V=-j.utcOffset(),z=Math.abs(V),K=Math.floor(z/60),Y=z%60;return(V<=0?"+":"-")+C(K,2,"0")+":"+C(Y,2,"0")},m:function j(V,z){if(V.date()<z.date())return-j(z,V);var K=12*(z.year()-V.year())+(z.month()-V.month()),Y=V.clone().add(K,p),te=z-Y<0,_=V.clone().add(K+(te?-1:1),p);return+(-(K+(z-Y)/(te?Y-_:_-Y))||0)},a:function(j){return j<0?Math.ceil(j)||0:Math.floor(j)},p:function(j){return{M:p,y:g,w:f,d:u,D:b,h:c,m:s,s:i,ms:a,Q:y}[j]||String(j||"").toLowerCase().replace(/s$/,"")},u:function(j){return j===void 0}},M="en",D={};D[M]=w;var I="$isDayjsObject",L=function(j){return j instanceof k||!(!j||!j[I])},F=function j(V,z,K){var Y;if(!V)return M;if(typeof V=="string"){var te=V.toLowerCase();D[te]&&(Y=te),z&&(D[te]=z,Y=te);var _=V.split("-");if(!Y&&_.length>1)return j(_[0])}else{var Z=V.name;D[Z]=V,Y=Z}return!K&&Y&&(M=Y),Y||!K&&M},B=function(j,V){if(L(j))return j.clone();var z=typeof V=="object"?V:{};return z.date=j,z.args=arguments,new k(z)},U=R;U.l=F,U.i=L,U.w=function(j,V){return B(j,{locale:V.$L,utc:V.$u,x:V.$x,$offset:V.$offset})};var k=(function(){function j(z){this.$L=F(z.locale,null,!0),this.parse(z),this.$x=this.$x||z.x||{},this[I]=!0}var V=j.prototype;return V.parse=function(z){this.$d=(function(K){var Y=K.date,te=K.utc;if(Y===null)return new Date(NaN);if(U.u(Y))return new Date;if(Y instanceof Date)return new Date(Y);if(typeof Y=="string"&&!/Z$/i.test(Y)){var _=Y.match(E);if(_){var Z=_[2]-1||0,J=(_[7]||"0").substring(0,3);return te?new Date(Date.UTC(_[1],Z,_[3]||1,_[4]||0,_[5]||0,_[6]||0,J)):new Date(_[1],Z,_[3]||1,_[4]||0,_[5]||0,_[6]||0,J)}}return new Date(Y)})(z),this.init()},V.init=function(){var z=this.$d;this.$y=z.getFullYear(),this.$M=z.getMonth(),this.$D=z.getDate(),this.$W=z.getDay(),this.$H=z.getHours(),this.$m=z.getMinutes(),this.$s=z.getSeconds(),this.$ms=z.getMilliseconds()},V.$utils=function(){return U},V.isValid=function(){return this.$d.toString()!==x},V.isSame=function(z,K){var Y=B(z);return this.startOf(K)<=Y&&Y<=this.endOf(K)},V.isAfter=function(z,K){return B(z)<this.startOf(K)},V.isBefore=function(z,K){return this.endOf(K)<B(z)},V.$g=function(z,K,Y){return U.u(z)?this[K]:this.set(Y,z)},V.unix=function(){return Math.floor(this.valueOf()/1e3)},V.valueOf=function(){return this.$d.getTime()},V.startOf=function(z,K){var Y=this,te=!!U.u(K)||K,_=U.p(z),Z=function(fe,xe){var ge=U.w(Y.$u?Date.UTC(Y.$y,xe,fe):new Date(Y.$y,xe,fe),Y);return te?ge:ge.endOf(u)},J=function(fe,xe){return U.w(Y.toDate()[fe].apply(Y.toDate("s"),(te?[0,0,0,0]:[23,59,59,999]).slice(xe)),Y)},W=this.$W,re=this.$M,ne=this.$D,X="set"+(this.$u?"UTC":"");switch(_){case g:return te?Z(1,0):Z(31,11);case p:return te?Z(1,re):Z(0,re+1);case f:var ie=this.$locale().weekStart||0,ae=(W<ie?W+7:W)-ie;return Z(te?ne-ae:ne+(6-ae),re);case u:case b:return J(X+"Hours",0);case c:return J(X+"Minutes",1);case s:return J(X+"Seconds",2);case i:return J(X+"Milliseconds",3);default:return this.clone()}},V.endOf=function(z){return this.startOf(z,!1)},V.$set=function(z,K){var Y,te=U.p(z),_="set"+(this.$u?"UTC":""),Z=(Y={},Y[u]=_+"Date",Y[b]=_+"Date",Y[p]=_+"Month",Y[g]=_+"FullYear",Y[c]=_+"Hours",Y[s]=_+"Minutes",Y[i]=_+"Seconds",Y[a]=_+"Milliseconds",Y)[te],J=te===u?this.$D+(K-this.$W):K;if(te===p||te===g){var W=this.clone().set(b,1);W.$d[Z](J),W.init(),this.$d=W.set(b,Math.min(this.$D,W.daysInMonth())).$d}else Z&&this.$d[Z](J);return this.init(),this},V.set=function(z,K){return this.clone().$set(z,K)},V.get=function(z){return this[U.p(z)]()},V.add=function(z,K){var Y,te=this;z=Number(z);var _=U.p(K),Z=function(re){var ne=B(te);return U.w(ne.date(ne.date()+Math.round(re*z)),te)};if(_===p)return this.set(p,this.$M+z);if(_===g)return this.set(g,this.$y+z);if(_===u)return Z(1);if(_===f)return Z(7);var J=(Y={},Y[s]=r,Y[c]=o,Y[i]=n,Y)[_]||1,W=this.$d.getTime()+z*J;return U.w(W,this)},V.subtract=function(z,K){return this.add(-1*z,K)},V.format=function(z){var K=this,Y=this.$locale();if(!this.isValid())return Y.invalidDate||x;var te=z||"YYYY-MM-DDTHH:mm:ssZ",_=U.z(this),Z=this.$H,J=this.$m,W=this.$M,re=Y.weekdays,ne=Y.months,X=Y.meridiem,ie=function(xe,ge,Re,de){return xe&&(xe[ge]||xe(K,te))||Re[ge].slice(0,de)},ae=function(xe){return U.s(Z%12||12,xe,"0")},fe=X||function(xe,ge,Re){var de=xe<12?"AM":"PM";return Re?de.toLowerCase():de};return te.replace(S,(function(xe,ge){return ge||(function(Re){switch(Re){case"YY":return String(K.$y).slice(-2);case"YYYY":return U.s(K.$y,4,"0");case"M":return W+1;case"MM":return U.s(W+1,2,"0");case"MMM":return ie(Y.monthsShort,W,ne,3);case"MMMM":return ie(ne,W);case"D":return K.$D;case"DD":return U.s(K.$D,2,"0");case"d":return String(K.$W);case"dd":return ie(Y.weekdaysMin,K.$W,re,2);case"ddd":return ie(Y.weekdaysShort,K.$W,re,3);case"dddd":return re[K.$W];case"H":return String(Z);case"HH":return U.s(Z,2,"0");case"h":return ae(1);case"hh":return ae(2);case"a":return fe(Z,J,!0);case"A":return fe(Z,J,!1);case"m":return String(J);case"mm":return U.s(J,2,"0");case"s":return String(K.$s);case"ss":return U.s(K.$s,2,"0");case"SSS":return U.s(K.$ms,3,"0");case"Z":return _}return null})(xe)||_.replace(":","")}))},V.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},V.diff=function(z,K,Y){var te,_=this,Z=U.p(K),J=B(z),W=(J.utcOffset()-this.utcOffset())*r,re=this-J,ne=function(){return U.m(_,J)};switch(Z){case g:te=ne()/12;break;case p:te=ne();break;case y:te=ne()/3;break;case f:te=(re-W)/6048e5;break;case u:te=(re-W)/864e5;break;case c:te=re/o;break;case s:te=re/r;break;case i:te=re/n;break;default:te=re}return Y?te:U.a(te)},V.daysInMonth=function(){return this.endOf(p).$D},V.$locale=function(){return D[this.$L]},V.locale=function(z,K){if(!z)return this.$L;var Y=this.clone(),te=F(z,K,!0);return te&&(Y.$L=te),Y},V.clone=function(){return U.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()},j})(),$=k.prototype;return B.prototype=$,[["$ms",a],["$s",i],["$m",s],["$H",c],["$W",u],["$M",p],["$y",g],["$D",b]].forEach((function(j){$[j[1]]=function(V){return this.$g(V,j[0],j[1])}})),B.extend=function(j,V){return j.$i||(j(V,k,B),j.$i=!0),B},B.locale=F,B.isDayjs=L,B.unix=function(j){return B(1e3*j)},B.en=D[M],B.Ls=D,B.p={},B}))})(s2)),s2.exports}var i2e=a2e();const Ar=fs(i2e);var l2={exports:{}},s2e=l2.exports,WL;function l2e(){return WL||(WL=1,(function(e,t){(function(n,r){e.exports=r()})(s2e,(function(){var n="week",r="year";return function(o,a,i){var s=a.prototype;s.week=function(c){if(c===void 0&&(c=null),c!==null)return this.add(7*(c-this.week()),"day");var u=this.$locale().yearStart||1;if(this.month()===11&&this.date()>25){var f=i(this).startOf(r).add(1,r).date(u),p=i(this).endOf(n);if(f.isBefore(p))return 1}var y=i(this).startOf(r).date(u).startOf(n).subtract(1,"millisecond"),g=this.diff(y,n,!0);return g<0?i(this).startOf("week").week():Math.ceil(g)},s.weeks=function(c){return c===void 0&&(c=null),this.week(c)}}}))})(l2)),l2.exports}var c2e=l2e();const u2e=fs(c2e);var c2={exports:{}},d2e=c2.exports,qL;function f2e(){return qL||(qL=1,(function(e,t){(function(n,r){e.exports=r()})(d2e,(function(){var n={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},r=/(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|Q|YYYY|YY?|ww?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g,o=/\d/,a=/\d\d/,i=/\d\d?/,s=/\d*[^-_:/,()\s\d]+/,c={},u=function(E){return(E=+E)+(E>68?1900:2e3)},f=function(E){return function(S){this[E]=+S}},p=[/[+-]\d\d:?(\d\d)?|Z/,function(E){(this.zone||(this.zone={})).offset=(function(S){if(!S||S==="Z")return 0;var w=S.match(/([+-]|\d\d)/g),C=60*w[1]+(+w[2]||0);return C===0?0:w[0]==="+"?-C:C})(E)}],y=function(E){var S=c[E];return S&&(S.indexOf?S:S.s.concat(S.f))},g=function(E,S){var w,C=c.meridiem;if(C){for(var R=1;R<=24;R+=1)if(E.indexOf(C(R,0,S))>-1){w=R>12;break}}else w=E===(S?"pm":"PM");return w},b={A:[s,function(E){this.afternoon=g(E,!1)}],a:[s,function(E){this.afternoon=g(E,!0)}],Q:[o,function(E){this.month=3*(E-1)+1}],S:[o,function(E){this.milliseconds=100*+E}],SS:[a,function(E){this.milliseconds=10*+E}],SSS:[/\d{3}/,function(E){this.milliseconds=+E}],s:[i,f("seconds")],ss:[i,f("seconds")],m:[i,f("minutes")],mm:[i,f("minutes")],H:[i,f("hours")],h:[i,f("hours")],HH:[i,f("hours")],hh:[i,f("hours")],D:[i,f("day")],DD:[a,f("day")],Do:[s,function(E){var S=c.ordinal,w=E.match(/\d+/);if(this.day=w[0],S)for(var C=1;C<=31;C+=1)S(C).replace(/\[|\]/g,"")===E&&(this.day=C)}],w:[i,f("week")],ww:[a,f("week")],M:[i,f("month")],MM:[a,f("month")],MMM:[s,function(E){var S=y("months"),w=(y("monthsShort")||S.map((function(C){return C.slice(0,3)}))).indexOf(E)+1;if(w<1)throw new Error;this.month=w%12||w}],MMMM:[s,function(E){var S=y("months").indexOf(E)+1;if(S<1)throw new Error;this.month=S%12||S}],Y:[/[+-]?\d+/,f("year")],YY:[a,function(E){this.year=u(E)}],YYYY:[/\d{4}/,f("year")],Z:p,ZZ:p};function x(E){var S,w;S=E,w=c&&c.formats;for(var C=(E=S.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,(function(B,U,k){var $=k&&k.toUpperCase();return U||w[k]||n[k]||w[$].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,(function(j,V,z){return V||z.slice(1)}))}))).match(r),R=C.length,M=0;M<R;M+=1){var D=C[M],I=b[D],L=I&&I[0],F=I&&I[1];C[M]=F?{regex:L,parser:F}:D.replace(/^\[|\]$/g,"")}return function(B){for(var U={},k=0,$=0;k<R;k+=1){var j=C[k];if(typeof j=="string")$+=j.length;else{var V=j.regex,z=j.parser,K=B.slice($),Y=V.exec(K)[0];z.call(U,Y),B=B.replace(Y,"")}}return(function(te){var _=te.afternoon;if(_!==void 0){var Z=te.hours;_?Z<12&&(te.hours+=12):Z===12&&(te.hours=0),delete te.afternoon}})(U),U}}return function(E,S,w){w.p.customParseFormat=!0,E&&E.parseTwoDigitYear&&(u=E.parseTwoDigitYear);var C=S.prototype,R=C.parse;C.parse=function(M){var D=M.date,I=M.utc,L=M.args;this.$u=I;var F=L[1];if(typeof F=="string"){var B=L[2]===!0,U=L[3]===!0,k=B||U,$=L[2];U&&($=L[2]),c=this.$locale(),!B&&$&&(c=w.Ls[$]),this.$d=(function(K,Y,te,_){try{if(["x","X"].indexOf(Y)>-1)return new Date((Y==="X"?1e3:1)*K);var Z=x(Y)(K),J=Z.year,W=Z.month,re=Z.day,ne=Z.hours,X=Z.minutes,ie=Z.seconds,ae=Z.milliseconds,fe=Z.zone,xe=Z.week,ge=new Date,Re=re||(J||W?1:ge.getDate()),de=J||ge.getFullYear(),me=0;J&&!W||(me=W>0?W-1:ge.getMonth());var Qe,Me=ne||0,we=X||0,Se=ie||0,dt=ae||0;return fe?new Date(Date.UTC(de,me,Re,Me,we,Se,dt+60*fe.offset*1e3)):te?new Date(Date.UTC(de,me,Re,Me,we,Se,dt)):(Qe=new Date(de,me,Re,Me,we,Se,dt),xe&&(Qe=_(Qe).week(xe).toDate()),Qe)}catch{return new Date("")}})(D,F,I,w),this.init(),$&&$!==!0&&(this.$L=this.locale($).$L),k&&D!=this.format(F)&&(this.$d=new Date("")),c={}}else if(F instanceof Array)for(var j=F.length,V=1;V<=j;V+=1){L[1]=F[V-1];var z=w.apply(this,L);if(z.isValid()){this.$d=z.$d,this.$L=z.$L,this.init();break}V===j&&(this.$d=new Date(""))}else R.call(this,M)}}}))})(c2)),c2.exports}var p2e=f2e();const h2e=fs(p2e);var u2={exports:{}},m2e=u2.exports,GL;function g2e(){return GL||(GL=1,(function(e,t){(function(n,r){e.exports=r()})(m2e,(function(){var n={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"};return function(r,o,a){var i=o.prototype,s=i.format;a.en.formats=n,i.format=function(c){c===void 0&&(c="YYYY-MM-DDTHH:mm:ssZ");var u=this.$locale().formats,f=(function(p,y){return p.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,(function(g,b,x){var E=x&&x.toUpperCase();return b||y[x]||n[x]||y[E].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,(function(S,w,C){return w||C.slice(1)}))}))})(c,u===void 0?{}:u);return s.call(this,f)}}}))})(u2)),u2.exports}var y2e=g2e();const b2e=fs(y2e);var d2={exports:{}},v2e=d2.exports,YL;function x2e(){return YL||(YL=1,(function(e,t){(function(n,r){e.exports=r()})(v2e,(function(){return function(n,r,o){r.prototype.isBetween=function(a,i,s,c){var u=o(a),f=o(i),p=(c=c||"()")[0]==="(",y=c[1]===")";return(p?this.isAfter(u,s):!this.isBefore(u,s))&&(y?this.isBefore(f,s):!this.isAfter(f,s))||(p?this.isBefore(u,s):!this.isAfter(u,s))&&(y?this.isAfter(f,s):!this.isBefore(f,s))}}}))})(d2)),d2.exports}var S2e=x2e();const E2e=fs(S2e);var f2={exports:{}},C2e=f2.exports,KL;function T2e(){return KL||(KL=1,(function(e,t){(function(n,r){e.exports=r()})(C2e,(function(){return function(n,r){var o=r.prototype,a=o.format;o.format=function(i){var s=this,c=this.$locale();if(!this.isValid())return a.bind(this)(i);var u=this.$utils(),f=(i||"YYYY-MM-DDTHH:mm:ssZ").replace(/\[([^\]]+)]|Q|wo|ww|w|WW|W|zzz|z|gggg|GGGG|Do|X|x|k{1,2}|S/g,(function(p){switch(p){case"Q":return Math.ceil((s.$M+1)/3);case"Do":return c.ordinal(s.$D);case"gggg":return s.weekYear();case"GGGG":return s.isoWeekYear();case"wo":return c.ordinal(s.week(),"W");case"w":case"ww":return u.s(s.week(),p==="w"?1:2,"0");case"W":case"WW":return u.s(s.isoWeek(),p==="W"?1:2,"0");case"k":case"kk":return u.s(String(s.$H===0?24:s.$H),p==="k"?1:2,"0");case"X":return Math.floor(s.$d.getTime()/1e3);case"x":return s.$d.getTime();case"z":return"["+s.offsetName()+"]";case"zzz":return"["+s.offsetName("long")+"]";default:return p}}));return a.bind(this)(f)}}}))})(f2)),f2.exports}var w2e=T2e();const k2e=fs(w2e);Ar.extend(b2e);Ar.extend(u2e);Ar.extend(E2e);Ar.extend(k2e);const A2e={YY:"year",YYYY:{sectionType:"year",contentType:"digit",maxLength:4},M:{sectionType:"month",contentType:"digit",maxLength:2},MM:"month",MMM:{sectionType:"month",contentType:"letter"},MMMM:{sectionType:"month",contentType:"letter"},D:{sectionType:"day",contentType:"digit",maxLength:2},DD:"day",Do:{sectionType:"day",contentType:"digit-with-letter"},d:{sectionType:"weekDay",contentType:"digit",maxLength:2},dd:{sectionType:"weekDay",contentType:"letter"},ddd:{sectionType:"weekDay",contentType:"letter"},dddd:{sectionType:"weekDay",contentType:"letter"},A:"meridiem",a:"meridiem",H:{sectionType:"hours",contentType:"digit",maxLength:2},HH:"hours",h:{sectionType:"hours",contentType:"digit",maxLength:2},hh:"hours",m:{sectionType:"minutes",contentType:"digit",maxLength:2},mm:"minutes",s:{sectionType:"seconds",contentType:"digit",maxLength:2},ss:"seconds"},D2e={year:"YYYY",month:"MMMM",monthShort:"MMM",dayOfMonth:"D",dayOfMonthFull:"Do",weekday:"dddd",weekdayShort:"dd",hours24h:"HH",hours12h:"hh",meridiem:"A",minutes:"mm",seconds:"ss",fullDate:"ll",keyboardDate:"L",shortDate:"MMM D",normalDate:"D MMMM",normalDateWithWeekday:"ddd, MMM D",fullTime:"LT",fullTime12h:"hh:mm A",fullTime24h:"HH:mm",keyboardDateTime:"L LT",keyboardDateTime12h:"L hh:mm A",keyboardDateTime24h:"L HH:mm"},mw=["Missing UTC plugin","To be able to use UTC or timezones, you have to enable the `utc` plugin","Find more information on https://mui.com/x/react-date-pickers/timezone/#day-js-and-utc"].join(`
431
431
  `),QL=["Missing timezone plugin","To be able to use timezones, you have to enable both the `utc` and the `timezone` plugin","Find more information on https://mui.com/x/react-date-pickers/timezone/#day-js-and-timezone"].join(`
432
432
  `),O2e=(e,t)=>t?(...n)=>e(...n).locale(t):e;class p2{constructor({locale:t,formats:n}={}){this.isMUIAdapter=!0,this.isTimezoneCompatible=!0,this.lib="dayjs",this.dayjs=void 0,this.locale=void 0,this.formats=void 0,this.escapedCharacters={start:"[",end:"]"},this.formatTokenMap=A2e,this.setLocaleToValue=r=>{const o=this.getCurrentLocaleCode();return o===r.locale()?r:r.locale(o)},this.hasUTCPlugin=()=>typeof Ar.utc<"u",this.hasTimezonePlugin=()=>typeof Ar.tz<"u",this.isSame=(r,o,a)=>{const i=this.setTimezone(o,this.getTimezone(r));return r.format(a)===i.format(a)},this.cleanTimezone=r=>{switch(r){case"default":return;case"system":return Ar.tz.guess();default:return r}},this.createSystemDate=r=>{if(this.hasUTCPlugin()&&this.hasTimezonePlugin()){const o=Ar.tz.guess();return o!=="UTC"?Ar.tz(r,o):Ar(r)}return Ar(r)},this.createUTCDate=r=>{if(!this.hasUTCPlugin())throw new Error(mw);return Ar.utc(r)},this.createTZDate=(r,o)=>{if(!this.hasUTCPlugin())throw new Error(mw);if(!this.hasTimezonePlugin())throw new Error(QL);const a=r!==void 0&&!r.endsWith("Z");return Ar(r).tz(this.cleanTimezone(o),a)},this.getLocaleFormats=()=>{const r=Ar.Ls,o=this.locale||"en";let a=r[o];return a===void 0&&(a=r.en),a.formats},this.adjustOffset=r=>{if(!this.hasTimezonePlugin())return r;const o=this.getTimezone(r);if(o!=="UTC"){const a=r.tz(this.cleanTimezone(o),!0);if(a.$offset===(r.$offset??0))return r;r.$offset=a.$offset}return r},this.date=(r,o="default")=>{if(r===null)return null;let a;return o==="UTC"?a=this.createUTCDate(r):o==="system"||o==="default"&&!this.hasTimezonePlugin()?a=this.createSystemDate(r):a=this.createTZDate(r,o),this.locale===void 0?a:a.locale(this.locale)},this.getInvalidDate=()=>Ar(new Date("Invalid date")),this.getTimezone=r=>{if(this.hasTimezonePlugin()){const o=r.$x?.$timezone;if(o)return o}return this.hasUTCPlugin()&&r.isUTC()?"UTC":"system"},this.setTimezone=(r,o)=>{if(this.getTimezone(r)===o)return r;if(o==="UTC"){if(!this.hasUTCPlugin())throw new Error(mw);return r.utc()}if(o==="system")return r.local();if(!this.hasTimezonePlugin()){if(o==="default")return r;throw new Error(QL)}return Ar.tz(r,this.cleanTimezone(o))},this.toJsDate=r=>r.toDate(),this.parse=(r,o)=>r===""?null:this.dayjs(r,o,this.locale,!0),this.getCurrentLocaleCode=()=>this.locale||"en",this.is12HourCycleInCurrentLocale=()=>/A|a/.test(this.getLocaleFormats().LT||""),this.expandFormat=r=>{const o=this.getLocaleFormats(),a=i=>i.replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,(s,c,u)=>c||u.slice(1));return r.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,(i,s,c)=>{const u=c&&c.toUpperCase();return s||o[c]||a(o[u])})},this.isValid=r=>r==null?!1:r.isValid(),this.format=(r,o)=>this.formatByString(r,this.formats[o]),this.formatByString=(r,o)=>this.dayjs(r).format(o),this.formatNumber=r=>r,this.isEqual=(r,o)=>r===null&&o===null?!0:r===null||o===null?!1:r.toDate().getTime()===o.toDate().getTime(),this.isSameYear=(r,o)=>this.isSame(r,o,"YYYY"),this.isSameMonth=(r,o)=>this.isSame(r,o,"YYYY-MM"),this.isSameDay=(r,o)=>this.isSame(r,o,"YYYY-MM-DD"),this.isSameHour=(r,o)=>r.isSame(o,"hour"),this.isAfter=(r,o)=>r>o,this.isAfterYear=(r,o)=>this.hasUTCPlugin()?!this.isSameYear(r,o)&&r.utc()>o.utc():r.isAfter(o,"year"),this.isAfterDay=(r,o)=>this.hasUTCPlugin()?!this.isSameDay(r,o)&&r.utc()>o.utc():r.isAfter(o,"day"),this.isBefore=(r,o)=>r<o,this.isBeforeYear=(r,o)=>this.hasUTCPlugin()?!this.isSameYear(r,o)&&r.utc()<o.utc():r.isBefore(o,"year"),this.isBeforeDay=(r,o)=>this.hasUTCPlugin()?!this.isSameDay(r,o)&&r.utc()<o.utc():r.isBefore(o,"day"),this.isWithinRange=(r,[o,a])=>r>=o&&r<=a,this.startOfYear=r=>this.adjustOffset(r.startOf("year")),this.startOfMonth=r=>this.adjustOffset(r.startOf("month")),this.startOfWeek=r=>this.adjustOffset(this.setLocaleToValue(r).startOf("week")),this.startOfDay=r=>this.adjustOffset(r.startOf("day")),this.endOfYear=r=>this.adjustOffset(r.endOf("year")),this.endOfMonth=r=>this.adjustOffset(r.endOf("month")),this.endOfWeek=r=>this.adjustOffset(this.setLocaleToValue(r).endOf("week")),this.endOfDay=r=>this.adjustOffset(r.endOf("day")),this.addYears=(r,o)=>this.adjustOffset(o<0?r.subtract(Math.abs(o),"year"):r.add(o,"year")),this.addMonths=(r,o)=>this.adjustOffset(o<0?r.subtract(Math.abs(o),"month"):r.add(o,"month")),this.addWeeks=(r,o)=>this.adjustOffset(o<0?r.subtract(Math.abs(o),"week"):r.add(o,"week")),this.addDays=(r,o)=>this.adjustOffset(o<0?r.subtract(Math.abs(o),"day"):r.add(o,"day")),this.addHours=(r,o)=>this.adjustOffset(o<0?r.subtract(Math.abs(o),"hour"):r.add(o,"hour")),this.addMinutes=(r,o)=>this.adjustOffset(o<0?r.subtract(Math.abs(o),"minute"):r.add(o,"minute")),this.addSeconds=(r,o)=>this.adjustOffset(o<0?r.subtract(Math.abs(o),"second"):r.add(o,"second")),this.getYear=r=>r.year(),this.getMonth=r=>r.month(),this.getDate=r=>r.date(),this.getHours=r=>r.hour(),this.getMinutes=r=>r.minute(),this.getSeconds=r=>r.second(),this.getMilliseconds=r=>r.millisecond(),this.setYear=(r,o)=>this.adjustOffset(r.set("year",o)),this.setMonth=(r,o)=>this.adjustOffset(r.set("month",o)),this.setDate=(r,o)=>this.adjustOffset(r.set("date",o)),this.setHours=(r,o)=>this.adjustOffset(r.set("hour",o)),this.setMinutes=(r,o)=>this.adjustOffset(r.set("minute",o)),this.setSeconds=(r,o)=>this.adjustOffset(r.set("second",o)),this.setMilliseconds=(r,o)=>this.adjustOffset(r.set("millisecond",o)),this.getDaysInMonth=r=>r.daysInMonth(),this.getWeekArray=r=>{const o=this.startOfWeek(this.startOfMonth(r)),a=this.endOfWeek(this.endOfMonth(r));let i=0,s=o;const c=[];for(;s<a;){const u=Math.floor(i/7);c[u]=c[u]||[],c[u].push(s),s=this.addDays(s,1),i+=1}return c},this.getWeekNumber=r=>r.week(),this.getYearRange=([r,o])=>{const a=this.startOfYear(r),i=this.endOfYear(o),s=[];let c=a;for(;this.isBefore(c,i);)s.push(c),c=this.addYears(c,1);return s},this.dayjs=O2e(Ar,t),this.locale=t,this.formats=pe({},D2e,n),Ar.extend(h2e)}getDayOfWeek(t){return t.day()+1}}function R2e(e,t,n,r,o){const[a,i]=T.useState(()=>o&&n?n(e).matches:r?r(e).matches:t);return Io(()=>{if(!n)return;const s=n(e),c=()=>{i(s.matches)};return c(),s.addEventListener("change",c),()=>{s.removeEventListener("change",c)}},[e,n]),a}const M2e={...yy},j$=M2e.useSyncExternalStore;function N2e(e,t,n,r,o){const a=T.useCallback(()=>t,[t]),i=T.useMemo(()=>{if(o&&n)return()=>n(e).matches;if(r!==null){const{matches:u}=r(e);return()=>u}return a},[a,e,r,o,n]),[s,c]=T.useMemo(()=>{if(n===null)return[a,()=>()=>{}];const u=n(e);return[()=>u.matches,f=>(u.addEventListener("change",f),()=>{u.removeEventListener("change",f)})]},[a,n,e]);return j$(c,s,i)}function B$(e={}){const{themeId:t}=e;return function(n,r={}){let o=sB();o&&t&&(o=o[t]||o);const a=typeof window<"u"&&typeof window.matchMedia<"u",{defaultMatches:i=!1,matchMedia:s=a?window.matchMedia:null,ssrMatchMedia:c=null,noSsr:u=!1}=b$({name:"MuiUseMediaQuery",props:r,theme:o});let f=typeof n=="function"?n(o):n;return f=f.replace(/^@media( ?)/m,""),f.includes("print")&&console.warn(["MUI: You have provided a `print` query to the `useMediaQuery` hook.","Using the print media query to modify print styles can lead to unexpected results.","Consider using the `displayPrint` field in the `sx` prop instead.","More information about `displayPrint` on our docs: https://mui.com/system/display/#display-in-print."].join(`
433
433
  `)),(j$!==void 0?N2e:R2e)(f,i,s,c,u)}}B$();const $$=B$({themeId:gh}),P2e={border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"absolute",whiteSpace:"nowrap",width:"1px"},Sg=(e,t)=>e.length!==t.length?!1:t.every(n=>e.includes(n)),I2e=({openTo:e,defaultOpenTo:t,views:n,defaultViews:r})=>{const o=n??r;let a;if(e!=null)a=e;else if(o.includes(t))a=t;else if(o.length>0)a=o[0];else throw new Error("MUI X: The `views` prop must contain at least one view.");return{views:o,openTo:a}},dx=(e,t,n)=>{let r=t;return r=e.setHours(r,e.getHours(n)),r=e.setMinutes(r,e.getMinutes(n)),r=e.setSeconds(r,e.getSeconds(n)),r=e.setMilliseconds(r,e.getMilliseconds(n)),r},gy=({date:e,disableFuture:t,disablePast:n,maxDate:r,minDate:o,isDateDisabled:a,utils:i,timezone:s})=>{const c=dx(i,i.date(void 0,s),e);n&&i.isBefore(o,c)&&(o=c),t&&i.isAfter(r,c)&&(r=c);let u=e,f=e;for(i.isBefore(e,o)&&(u=o,f=null),i.isAfter(e,r)&&(f&&(f=r),u=null);u||f;){if(u&&i.isAfter(u,r)&&(u=null),f&&i.isBefore(f,o)&&(f=null),u){if(!a(u))return u;u=i.addDays(u,1)}if(f){if(!a(f))return f;f=i.addDays(f,-1)}}return null},_2e=(e,t)=>t==null||!e.isValid(t)?null:t,cs=(e,t,n)=>t==null||!e.isValid(t)?n:t,L2e=(e,t,n)=>!e.isValid(t)&&t!=null&&!e.isValid(n)&&n!=null?!0:e.isEqual(t,n),nO=(e,t)=>{const n=[e.startOfYear(t)];for(;n.length<12;){const r=n[n.length-1];n.push(e.addMonths(r,1))}return n},z$=(e,t,n)=>n==="date"?e.startOfDay(e.date(void 0,t)):e.date(void 0,t),F2e=["year","month","day"],XL=e=>F2e.includes(e),rO=(e,{format:t,views:n},r)=>{if(t!=null)return t;const o=e.formats;return Sg(n,["year"])?o.year:Sg(n,["month"])?o.month:Sg(n,["day"])?o.dayOfMonth:Sg(n,["month","year"])?`${o.month} ${o.year}`:Sg(n,["day","month"])?`${o.month} ${o.dayOfMonth}`:r?/en/.test(e.getCurrentLocaleCode())?o.normalDateWithWeekday:o.normalDate:o.keyboardDate},j2e=(e,t)=>{const n=e.startOfWeek(t);return[0,1,2,3,4,5,6].map(r=>e.addDays(n,r))},B2e=["hours","minutes","seconds"],$2e=e=>B2e.includes(e),ZL=(e,t)=>t.getHours(e)*3600+t.getMinutes(e)*60+t.getSeconds(e),z2e=(e,t)=>(n,r)=>e?t.isAfter(n,r):ZL(n,t)>ZL(r,t),sl={year:1,month:2,day:3,hours:4,minutes:5,seconds:6,milliseconds:7},H2e=e=>Math.max(...e.map(t=>sl[t.type]??1)),Eg=(e,t,n)=>{if(t===sl.year)return e.startOfYear(n);if(t===sl.month)return e.startOfMonth(n);if(t===sl.day)return e.startOfDay(n);let r=n;return t<sl.minutes&&(r=e.setMinutes(r,0)),t<sl.seconds&&(r=e.setSeconds(r,0)),t<sl.milliseconds&&(r=e.setMilliseconds(r,0)),r},U2e=({props:e,utils:t,granularity:n,timezone:r,getTodayDate:o})=>{let a=o?o():Eg(t,n,z$(t,r));e.minDate!=null&&t.isAfterDay(e.minDate,a)&&(a=Eg(t,n,e.minDate)),e.maxDate!=null&&t.isBeforeDay(e.maxDate,a)&&(a=Eg(t,n,e.maxDate));const i=z2e(e.disableIgnoringDatePartForTimeValidation??!1,t);return e.minTime!=null&&i(e.minTime,a)&&(a=Eg(t,n,e.disableIgnoringDatePartForTimeValidation?e.minTime:dx(t,a,e.minTime))),e.maxTime!=null&&i(a,e.maxTime)&&(a=Eg(t,n,e.disableIgnoringDatePartForTimeValidation?e.maxTime:dx(t,a,e.maxTime))),a},H$=(e,t)=>{const n=e.formatTokenMap[t];if(n==null)throw new Error([`MUI X: The token "${t}" is not supported by the Date and Time Pickers.`,"Please try using another token or open an issue on https://github.com/mui/mui-x/issues/new/choose if you think it should be supported."].join(`
@@ -437,8 +437,8 @@ import {${t.sourceName}}" from '${t.modelPath}'"
437
437
  `));const t=T.useMemo(()=>pe({},lAe,e.localeText),[e.localeText]);return T.useMemo(()=>pe({},e,{localeText:t}),[e,t])},Wr=()=>sf().utils,Pb=()=>sf().defaultDates,zS=e=>{const t=Wr(),n=T.useRef(void 0);return n.current===void 0&&(n.current=t.date(void 0,e)),n.current};function cAe(e){return Ut("MuiPickersToolbar",e)}Lt("MuiPickersToolbar",["root","content"]);const uAe=["children","className","toolbarTitle","hidden","titleId","isLandscape","classes","landscapeDirection"],dAe=e=>{const{classes:t}=e;return zt({root:["root"],content:["content"]},cAe,t)},fAe=Pe("div",{name:"MuiPickersToolbar",slot:"Root",overridesResolver:(e,t)=>t.root})(({theme:e})=>({display:"flex",flexDirection:"column",alignItems:"flex-start",justifyContent:"space-between",padding:e.spacing(2,3),variants:[{props:{isLandscape:!0},style:{height:"auto",maxWidth:160,padding:16,justifyContent:"flex-start",flexWrap:"wrap"}}]})),pAe=Pe("div",{name:"MuiPickersToolbar",slot:"Content",overridesResolver:(e,t)=>t.content})({display:"flex",flexWrap:"wrap",width:"100%",flex:1,justifyContent:"space-between",alignItems:"center",flexDirection:"row",variants:[{props:{isLandscape:!0},style:{justifyContent:"flex-start",alignItems:"flex-start",flexDirection:"column"}},{props:{isLandscape:!0,landscapeDirection:"row"},style:{flexDirection:"row"}}]}),hAe=T.forwardRef(function(e,t){const n=Vr({props:e,name:"MuiPickersToolbar"}),{children:r,className:o,toolbarTitle:a,hidden:i,titleId:s}=n,c=fn(n,uAe),u=n,f=dAe(u);return i?null:m.jsxs(fAe,pe({ref:t,className:Ot(f.root,o),ownerState:u},c,{children:[m.jsx(lr,{color:"text.secondary",variant:"overline",id:s,children:a}),m.jsx(pAe,{className:f.content,ownerState:u,children:r})]}))}),yc=()=>sf().localeText;function mAe(e){return Ut("MuiDatePickerToolbar",e)}Lt("MuiDatePickerToolbar",["root","title"]);const gAe=["value","isLandscape","onChange","toolbarFormat","toolbarPlaceholder","views","className","onViewChange","view"],yAe=e=>{const{classes:t}=e;return zt({root:["root"],title:["title"]},mAe,t)},bAe=Pe(hAe,{name:"MuiDatePickerToolbar",slot:"Root",overridesResolver:(e,t)=>t.root})({}),vAe=Pe(lr,{name:"MuiDatePickerToolbar",slot:"Title",overridesResolver:(e,t)=>t.title})({variants:[{props:{isLandscape:!0},style:{margin:"auto 16px auto auto"}}]}),xAe=T.forwardRef(function(e,t){const n=Vr({props:e,name:"MuiDatePickerToolbar"}),{value:r,isLandscape:o,toolbarFormat:a,toolbarPlaceholder:i="––",views:s,className:c}=n,u=fn(n,gAe),f=Wr(),p=yc(),y=yAe(n),g=T.useMemo(()=>{if(!r)return i;const x=rO(f,{format:a,views:s},!0);return f.formatByString(r,x)},[r,a,i,f,s]),b=n;return m.jsx(bAe,pe({ref:t,toolbarTitle:p.datePickerToolbarTitle,isLandscape:o,className:Ot(y.root,c)},u,{children:m.jsx(vAe,{variant:"h4",align:o?"left":"center",ownerState:b,className:y.title,children:g})}))});function K$(e,t){const n=Wr(),r=Pb(),o=Vr({props:e,name:t}),a=T.useMemo(()=>o.localeText?.toolbarTitle==null?o.localeText:pe({},o.localeText,{datePickerToolbarTitle:o.localeText.toolbarTitle}),[o.localeText]);return pe({},o,{localeText:a},I2e({views:o.views,openTo:o.openTo,defaultViews:["year","day"],defaultOpenTo:"day"}),{disableFuture:o.disableFuture??!1,disablePast:o.disablePast??!1,minDate:cs(n,o.minDate,r.minDate),maxDate:cs(n,o.maxDate,r.maxDate),slots:pe({toolbar:xAe},o.slots)})}const Ib=({props:e,value:t,timezone:n,adapter:r})=>{if(t===null)return null;const{shouldDisableDate:o,shouldDisableMonth:a,shouldDisableYear:i,disablePast:s,disableFuture:c}=e,u=r.utils.date(void 0,n),f=cs(r.utils,e.minDate,r.defaultDates.minDate),p=cs(r.utils,e.maxDate,r.defaultDates.maxDate);switch(!0){case!r.utils.isValid(t):return"invalidDate";case!!(o&&o(t)):return"shouldDisableDate";case!!(a&&a(t)):return"shouldDisableMonth";case!!(i&&i(t)):return"shouldDisableYear";case!!(c&&r.utils.isAfterDay(t,u)):return"disableFuture";case!!(s&&r.utils.isBeforeDay(t,u)):return"disablePast";case!!(f&&r.utils.isBeforeDay(t,f)):return"minDate";case!!(p&&r.utils.isAfterDay(t,p)):return"maxDate";default:return null}};Ib.valueManager=Sl;const Q$=["disablePast","disableFuture","minDate","maxDate","shouldDisableDate","shouldDisableMonth","shouldDisableYear"],SAe=["disablePast","disableFuture","minTime","maxTime","shouldDisableTime","minutesStep","ampm","disableIgnoringDatePartForTimeValidation"],EAe=["minDateTime","maxDateTime"],CAe=[...Q$,...SAe,...EAe],X$=e=>CAe.reduce((t,n)=>(e.hasOwnProperty(n)&&(t[n]=e[n]),t),{});function Z$(e){const{props:t,validator:n,value:r,timezone:o,onError:a}=e,i=sf(),s=T.useRef(n.valueManager.defaultErrorState),c=n({adapter:i,value:r,timezone:o,props:t}),u=n.valueManager.hasError(c);T.useEffect(()=>{a&&!n.valueManager.isSameError(c,s.current)&&a(c,r),s.current=c},[n,a,c,r]);const f=Pt(p=>n({adapter:i,value:p,timezone:o,props:t}));return{validationError:c,hasValidationError:u,getValidationErrorForNewValue:f}}function TAe(e){return Ut("MuiInputAdornment",e)}const o4=Lt("MuiInputAdornment",["root","filled","standard","outlined","positionStart","positionEnd","disablePointerEvents","hiddenLabel","sizeSmall"]);var a4;const wAe=(e,t)=>{const{ownerState:n}=e;return[t.root,t[`position${bt(n.position)}`],n.disablePointerEvents===!0&&t.disablePointerEvents,t[n.variant]]},kAe=e=>{const{classes:t,disablePointerEvents:n,hiddenLabel:r,position:o,size:a,variant:i}=e,s={root:["root",n&&"disablePointerEvents",o&&`position${bt(o)}`,i,r&&"hiddenLabel",a&&`size${bt(a)}`]};return zt(s,TAe,t)},AAe=Pe("div",{name:"MuiInputAdornment",slot:"Root",overridesResolver:wAe})(Pn(({theme:e})=>({display:"flex",maxHeight:"2em",alignItems:"center",whiteSpace:"nowrap",color:(e.vars||e).palette.action.active,variants:[{props:{variant:"filled"},style:{[`&.${o4.positionStart}&:not(.${o4.hiddenLabel})`]:{marginTop:16}}},{props:{position:"start"},style:{marginRight:8}},{props:{position:"end"},style:{marginLeft:8}},{props:{disablePointerEvents:!0},style:{pointerEvents:"none"}}]}))),J$=T.forwardRef(function(e,t){const n=An({props:e,name:"MuiInputAdornment"}),{children:r,className:o,component:a="div",disablePointerEvents:i=!1,disableTypography:s=!1,position:c,variant:u,...f}=n,p=Oi()||{};let y=u;u&&p.variant,p&&!y&&(y=p.variant);const g={...n,hiddenLabel:p.hiddenLabel,size:p.size,disablePointerEvents:i,position:c,variant:y},b=kAe(g);return m.jsx(IS.Provider,{value:null,children:m.jsx(AAe,{as:a,ownerState:g,className:Ot(b.root,o),ref:t,...f,children:typeof r=="string"&&!s?m.jsx(lr,{color:"textSecondary",children:r}):m.jsxs(T.Fragment,{children:[c==="start"?a4||(a4=m.jsx("span",{className:"notranslate","aria-hidden":!0,children:"​"})):null,r]})})})});function DAe(e){return Ut("MuiPickersPopper",e)}Lt("MuiPickersPopper",["root","paper"]);function OAe(e,t){return Array.isArray(t)?t.every(n=>e.indexOf(n)!==-1):e.indexOf(t)!==-1}const RAe=(e,t)=>n=>{(n.key==="Enter"||n.key===" ")&&(e(n),n.preventDefault(),n.stopPropagation())},ja=(e=document)=>{const t=e.activeElement;return t?t.shadowRoot?ja(t.shadowRoot):t:null},MAe="@media (pointer: fine)",NAe="@media (prefers-reduced-motion: reduce)",Mp=typeof navigator<"u"&&navigator.userAgent.match(/android\s(\d+)|OS\s(\d+)/i),i4=Mp&&Mp[1]?parseInt(Mp[1],10):null,s4=Mp&&Mp[2]?parseInt(Mp[2],10):null,PAe=i4&&i4<10||s4&&s4<13||!1,e9=()=>$$(NAe,{defaultMatches:!1})||PAe,IAe=["PaperComponent","popperPlacement","ownerState","children","paperSlotProps","paperClasses","onPaperClick","onPaperTouchStart"],_Ae=e=>{const{classes:t}=e;return zt({root:["root"],paper:["paper"]},DAe,t)},LAe=Pe(tO,{name:"MuiPickersPopper",slot:"Root",overridesResolver:(e,t)=>t.root})(({theme:e})=>({zIndex:e.zIndex.modal})),FAe=Pe(rf,{name:"MuiPickersPopper",slot:"Paper",overridesResolver:(e,t)=>t.paper})({outline:0,transformOrigin:"top center",variants:[{props:({placement:e})=>["top","top-start","top-end"].includes(e),style:{transformOrigin:"bottom center"}}]});function jAe(e,t){return t.documentElement.clientWidth<e.clientX||t.documentElement.clientHeight<e.clientY}function BAe(e,t){const n=T.useRef(!1),r=T.useRef(!1),o=T.useRef(null),a=T.useRef(!1);T.useEffect(()=>{if(!e)return;function c(){a.current=!0}return document.addEventListener("mousedown",c,!0),document.addEventListener("touchstart",c,!0),()=>{document.removeEventListener("mousedown",c,!0),document.removeEventListener("touchstart",c,!0),a.current=!1}},[e]);const i=Pt(c=>{if(!a.current)return;const u=r.current;r.current=!1;const f=Po(o.current);if(!o.current||"clientX"in c&&jAe(c,f))return;if(n.current){n.current=!1;return}let p;c.composedPath?p=c.composedPath().indexOf(o.current)>-1:p=!f.documentElement.contains(c.target)||o.current.contains(c.target),!p&&!u&&t(c)}),s=()=>{r.current=!0};return T.useEffect(()=>{if(e){const c=Po(o.current),u=()=>{n.current=!0};return c.addEventListener("touchstart",i),c.addEventListener("touchmove",u),()=>{c.removeEventListener("touchstart",i),c.removeEventListener("touchmove",u)}}},[e,i]),T.useEffect(()=>{if(e){const c=Po(o.current);return c.addEventListener("click",i),()=>{c.removeEventListener("click",i),r.current=!1}}},[e,i]),[o,s,s]}const $Ae=T.forwardRef((e,t)=>{const{PaperComponent:n,popperPlacement:r,ownerState:o,children:a,paperSlotProps:i,paperClasses:s,onPaperClick:c,onPaperTouchStart:u}=e,f=fn(e,IAe),p=pe({},o,{placement:r}),y=mr({elementType:n,externalSlotProps:i,additionalProps:{tabIndex:-1,elevation:8,ref:t},className:s,ownerState:p});return m.jsx(n,pe({},f,y,{onClick:g=>{c(g),y.onClick?.(g)},onTouchStart:g=>{u(g),y.onTouchStart?.(g)},ownerState:p,children:a}))});function zAe(e){const t=Vr({props:e,name:"MuiPickersPopper"}),{anchorEl:n,children:r,containerRef:o=null,shouldRestoreFocus:a,onBlur:i,onDismiss:s,open:c,role:u,placement:f,slots:p,slotProps:y,reduceAnimations:g}=t;T.useEffect(()=>{function V(z){c&&z.key==="Escape"&&s()}return document.addEventListener("keydown",V),()=>{document.removeEventListener("keydown",V)}},[s,c]);const b=T.useRef(null);T.useEffect(()=>{u==="tooltip"||a&&!a()||(c?b.current=ja(document):b.current&&b.current instanceof HTMLElement&&setTimeout(()=>{b.current instanceof HTMLElement&&b.current.focus()}))},[c,u,a]);const[x,E,S]=BAe(c,i??s),w=T.useRef(null),C=cr(w,o),R=cr(C,x),M=t,D=_Ae(M),I=e9(),L=g??I,F=V=>{V.key==="Escape"&&(V.stopPropagation(),s())},B=p?.desktopTransition??L?qd:Vy,U=p?.desktopTrapFocus??o$,k=p?.desktopPaper??FAe,$=p?.popper??LAe,j=mr({elementType:$,externalSlotProps:y?.popper,additionalProps:{transition:!0,role:u,open:c,anchorEl:n,placement:f,onKeyDown:F},className:D.root,ownerState:t});return m.jsx($,pe({},j,{children:({TransitionProps:V,placement:z})=>m.jsx(U,pe({open:c,disableAutoFocus:!0,disableRestoreFocus:!0,disableEnforceFocus:u==="tooltip",isEnabled:()=>!0},y?.desktopTrapFocus,{children:m.jsx(B,pe({},V,y?.desktopTransition,{children:m.jsx($Ae,{PaperComponent:k,ownerState:M,popperPlacement:z,ref:R,onPaperClick:E,onPaperTouchStart:S,paperClasses:D.paper,paperSlotProps:y?.desktopPaper,children:r})}))}))}))}const HAe=({open:e,onOpen:t,onClose:n})=>{const r=T.useRef(typeof e=="boolean").current,[o,a]=T.useState(!1);T.useEffect(()=>{if(r){if(typeof e!="boolean")throw new Error("You must not mix controlling and uncontrolled mode for `open` prop");a(e)}},[r,e]);const i=T.useCallback(s=>{r||a(s),s&&t&&t(),!s&&n&&n()},[r,t,n]);return{isOpen:o,setIsOpen:i}},iO=({timezone:e,value:t,defaultValue:n,referenceDate:r,onChange:o,valueManager:a})=>{const i=Wr(),s=T.useRef(n),c=t??s.current??a.emptyValue,u=T.useMemo(()=>a.getTimezone(i,c),[i,a,c]),f=Pt(b=>u==null?b:a.setTimezone(i,u,b));let p;e?p=e:u?p=u:r?p=i.getTimezone(r):p="default";const y=T.useMemo(()=>a.setTimezone(i,p,c),[a,i,p,c]),g=Pt((b,...x)=>{const E=f(b);o?.(E,...x)});return{value:y,handleValueChange:g,timezone:p}},sO=({name:e,timezone:t,value:n,defaultValue:r,referenceDate:o,onChange:a,valueManager:i})=>{const[s,c]=xi({name:e,state:"value",controlled:n,default:r??i.emptyValue}),u=Pt((f,...p)=>{c(f),a?.(f,...p)});return iO({timezone:t,value:s,defaultValue:void 0,referenceDate:o,onChange:u,valueManager:i})},UAe=e=>{const{action:t,hasChanged:n,dateState:r,isControlled:o}=e,a=!o&&!r.hasBeenModifiedSinceMount;return t.name==="setValueFromField"?!0:t.name==="setValueFromAction"?a&&["accept","today","clear"].includes(t.pickerAction)?!0:n(r.lastPublishedValue):t.name==="setValueFromView"&&t.selectionState!=="shallow"||t.name==="setValueFromShortcut"?a?!0:n(r.lastPublishedValue):!1},VAe=e=>{const{action:t,hasChanged:n,dateState:r,isControlled:o,closeOnSelect:a}=e,i=!o&&!r.hasBeenModifiedSinceMount;return t.name==="setValueFromAction"?i&&["accept","today","clear"].includes(t.pickerAction)?!0:n(r.lastCommittedValue):t.name==="setValueFromView"&&t.selectionState==="finish"&&a?i?!0:n(r.lastCommittedValue):t.name==="setValueFromShortcut"?t.changeImportance==="accept"&&n(r.lastCommittedValue):!1},WAe=e=>{const{action:t,closeOnSelect:n}=e;return t.name==="setValueFromAction"?!0:t.name==="setValueFromView"?t.selectionState==="finish"&&n:t.name==="setValueFromShortcut"?t.changeImportance==="accept":!1},qAe=({props:e,valueManager:t,valueType:n,wrapperVariant:r,validator:o})=>{const{onAccept:a,onChange:i,value:s,defaultValue:c,closeOnSelect:u=r==="desktop",timezone:f,referenceDate:p}=e,{current:y}=T.useRef(c),{current:g}=T.useRef(s!==void 0),[b,x]=T.useState(f),E=Wr(),S=sf(),{isOpen:w,setIsOpen:C}=HAe(e),{timezone:R,value:M,handleValueChange:D}=iO({timezone:f,value:s,defaultValue:y,referenceDate:p,onChange:i,valueManager:t}),[I,L]=T.useState(()=>{let ae;return M!==void 0?ae=M:y!==void 0?ae=y:ae=t.emptyValue,{draft:ae,lastPublishedValue:ae,lastCommittedValue:ae,lastControlledValue:s,hasBeenModifiedSinceMount:!1}}),F=t.getTimezone(E,I.draft);b!==f&&(x(f),f&&F&&f!==F&&L(ae=>pe({},ae,{draft:t.setTimezone(E,f,ae.draft)})));const{getValidationErrorForNewValue:B}=Z$({props:e,validator:o,timezone:R,value:I.draft,onError:e.onError}),U=Pt(ae=>{const fe={action:ae,dateState:I,hasChanged:Qe=>!t.areValuesEqual(E,ae.value,Qe),isControlled:g,closeOnSelect:u},xe=UAe(fe),ge=VAe(fe),Re=WAe(fe);L(Qe=>pe({},Qe,{draft:ae.value,lastPublishedValue:xe?ae.value:Qe.lastPublishedValue,lastCommittedValue:ge?ae.value:Qe.lastCommittedValue,hasBeenModifiedSinceMount:!0}));let de=null;const me=()=>(de||(de={validationError:ae.name==="setValueFromField"?ae.context.validationError:B(ae.value)},ae.name==="setValueFromShortcut"&&(de.shortcut=ae.shortcut)),de);xe&&D(ae.value,me()),ge&&a&&a(ae.value,me()),Re&&C(!1)});if(I.lastControlledValue!==s){const ae=t.areValuesEqual(E,I.draft,M);L(fe=>pe({},fe,{lastControlledValue:s},ae?{}:{lastCommittedValue:M,lastPublishedValue:M,draft:M,hasBeenModifiedSinceMount:!0}))}const k=Pt(()=>{U({value:t.emptyValue,name:"setValueFromAction",pickerAction:"clear"})}),$=Pt(()=>{U({value:I.lastPublishedValue,name:"setValueFromAction",pickerAction:"accept"})}),j=Pt(()=>{U({value:I.lastPublishedValue,name:"setValueFromAction",pickerAction:"dismiss"})}),V=Pt(()=>{U({value:I.lastCommittedValue,name:"setValueFromAction",pickerAction:"cancel"})}),z=Pt(()=>{U({value:t.getTodayValue(E,R,n),name:"setValueFromAction",pickerAction:"today"})}),K=Pt(ae=>{ae.preventDefault(),C(!0)}),Y=Pt(ae=>{ae?.preventDefault(),C(!1)}),te=Pt((ae,fe="partial")=>U({name:"setValueFromView",value:ae,selectionState:fe})),_=Pt((ae,fe,xe)=>U({name:"setValueFromShortcut",value:ae,changeImportance:fe,shortcut:xe})),Z=Pt((ae,fe)=>U({name:"setValueFromField",value:ae,context:fe})),J={onClear:k,onAccept:$,onDismiss:j,onCancel:V,onSetToday:z,onOpen:K,onClose:Y},W={value:I.draft,onChange:Z},re=T.useMemo(()=>t.cleanValue(E,I.draft),[E,t,I.draft]),ne={value:re,onChange:te,onClose:Y,open:w},X=pe({},J,{value:re,onChange:te,onSelectShortcut:_,isValid:ae=>{const fe=o({adapter:S,value:ae,timezone:R,props:e});return!t.hasError(fe)}}),ie=T.useMemo(()=>({onOpen:K,onClose:Y,open:w}),[w,Y,K]);return{open:w,fieldProps:W,viewProps:ne,layoutProps:X,actions:J,contextValue:ie}};function t9({onChange:e,onViewChange:t,openTo:n,view:r,views:o,autoFocus:a,focusedView:i,onFocusedViewChange:s}){const c=T.useRef(n),u=T.useRef(o),f=T.useRef(o.includes(n)?n:o[0]),[p,y]=xi({name:"useViews",state:"view",controlled:r,default:f.current}),g=T.useRef(a?p:null),[b,x]=xi({name:"useViews",state:"focusedView",controlled:i,default:g.current});T.useEffect(()=>{(c.current&&c.current!==n||u.current&&u.current.some(I=>!o.includes(I)))&&(y(o.includes(n)?n:o[0]),u.current=o,c.current=n)},[n,y,p,o]);const E=o.indexOf(p),S=o[E-1]??null,w=o[E+1]??null,C=Pt((I,L)=>{x(L?I:F=>I===F?null:F),s?.(I,L)}),R=Pt(I=>{C(I,!0),I!==p&&(y(I),t&&t(I))}),M=Pt(()=>{w&&R(w)}),D=Pt((I,L,F)=>{const B=L==="finish",U=F?o.indexOf(F)<o.length-1:!!w;if(e(I,B&&U?"partial":L,F),F&&F!==p){const k=o[o.indexOf(F)+1];k&&R(k)}else B&&M()});return{view:p,setView:R,focusedView:b,setFocusedView:C,nextView:w,previousView:S,defaultView:o.includes(n)?n:o[0],goToNextView:M,setValueAndGoToNextView:D}}const GAe=["className","sx"],YAe=({props:e,propsFromPickerValue:t,additionalViewProps:n,autoFocusView:r,rendererInterceptor:o,fieldRef:a})=>{const{onChange:i,open:s,onClose:c}=t,{view:u,views:f,openTo:p,onViewChange:y,viewRenderers:g,timezone:b}=e,x=fn(e,GAe),{view:E,setView:S,defaultView:w,focusedView:C,setFocusedView:R,setValueAndGoToNextView:M}=t9({view:u,views:f,openTo:p,onChange:i,onViewChange:y,autoFocus:r}),{hasUIView:D,viewModeLookup:I}=T.useMemo(()=>f.reduce(($,j)=>{let V;return g[j]!=null?V="UI":V="field",$.viewModeLookup[j]=V,V==="UI"&&($.hasUIView=!0),$},{hasUIView:!1,viewModeLookup:{}}),[g,f]),L=T.useMemo(()=>f.reduce(($,j)=>g[j]!=null&&$2e(j)?$+1:$,0),[g,f]),F=I[E],B=Pt(()=>F==="UI"),[U,k]=T.useState(F==="UI"?E:null);return U!==E&&I[E]==="UI"&&k(E),Io(()=>{F==="field"&&s&&(c(),setTimeout(()=>{a?.current?.setSelectedSections(E),a?.current?.focusField(E)}))},[E]),Io(()=>{if(!s)return;let $=E;F==="field"&&U!=null&&($=U),$!==w&&I[$]==="UI"&&I[w]==="UI"&&($=w),$!==E&&S($),R($,!0)},[s]),{hasUIView:D,shouldRestoreFocus:B,layoutProps:{views:f,view:U,onViewChange:S},renderCurrentView:()=>{if(U==null)return null;const $=g[U];if($==null)return null;const j=pe({},x,n,t,{views:f,timezone:b,onChange:M,view:U,onViewChange:S,focusedView:C,onFocusedViewChange:R,showViewSwitcher:L>1,timeViewsCount:L});return o?o(g,U,j):$(j)}}};function l4(){return typeof window>"u"?"portrait":window.screen&&window.screen.orientation&&window.screen.orientation.angle?Math.abs(window.screen.orientation.angle)===90?"landscape":"portrait":window.orientation&&Math.abs(Number(window.orientation))===90?"landscape":"portrait"}const KAe=(e,t)=>{const[n,r]=T.useState(l4);return Io(()=>{const o=()=>{r(l4())};return window.addEventListener("orientationchange",o),()=>{window.removeEventListener("orientationchange",o)}},[]),OAe(e,["hours","minutes","seconds"])?!1:(t||n)==="landscape"},QAe=({props:e,propsFromPickerValue:t,propsFromPickerViews:n,wrapperVariant:r})=>{const{orientation:o}=e,a=KAe(n.views,o),i=js();return{layoutProps:pe({},n,t,{isLandscape:a,isRtl:i,wrapperVariant:r,disabled:e.disabled,readOnly:e.readOnly})}};function XAe(e){const{props:t,pickerValueResponse:n}=e;return T.useMemo(()=>({value:n.viewProps.value,open:n.open,disabled:t.disabled??!1,readOnly:t.readOnly??!1}),[n.viewProps.value,n.open,t.disabled,t.readOnly])}const n9=({props:e,valueManager:t,valueType:n,wrapperVariant:r,additionalViewProps:o,validator:a,autoFocusView:i,rendererInterceptor:s,fieldRef:c})=>{const u=qAe({props:e,valueManager:t,valueType:n,wrapperVariant:r,validator:a}),f=YAe({props:e,additionalViewProps:o,autoFocusView:i,fieldRef:c,propsFromPickerValue:u.viewProps,rendererInterceptor:s}),p=QAe({props:e,wrapperVariant:r,propsFromPickerValue:u.layoutProps,propsFromPickerViews:f.layoutProps}),y=XAe({props:e,pickerValueResponse:u});return{open:u.open,actions:u.actions,fieldProps:u.fieldProps,renderCurrentView:f.renderCurrentView,hasUIView:f.hasUIView,shouldRestoreFocus:f.shouldRestoreFocus,layoutProps:p.layoutProps,contextValue:u.contextValue,ownerState:y}};function r9(e){return Ut("MuiPickersLayout",e)}const cd=Lt("MuiPickersLayout",["root","landscape","contentWrapper","toolbar","actionBar","tabs","shortcuts"]),ZAe=["onAccept","onClear","onCancel","onSetToday","actions"];function JAe(e){const{onAccept:t,onClear:n,onCancel:r,onSetToday:o,actions:a}=e,i=fn(e,ZAe),s=yc();if(a==null||a.length===0)return null;const c=a?.map(u=>{switch(u){case"clear":return m.jsx(Zr,{onClick:n,children:s.clearButtonLabel},u);case"cancel":return m.jsx(Zr,{onClick:r,children:s.cancelButtonLabel},u);case"accept":return m.jsx(Zr,{onClick:t,children:s.okButtonLabel},u);case"today":return m.jsx(Zr,{onClick:o,children:s.todayButtonLabel},u);default:return null}});return m.jsx(Ol,pe({},i,{children:c}))}function eDe(e){return Ut("MuiListItem",e)}Lt("MuiListItem",["root","container","dense","alignItemsFlexStart","divider","gutters","padding","secondaryAction"]);const tDe=Lt("MuiListItemButton",["root","focusVisible","dense","alignItemsFlexStart","disabled","divider","gutters","selected"]);function nDe(e){return Ut("MuiListItemSecondaryAction",e)}Lt("MuiListItemSecondaryAction",["root","disableGutters"]);const rDe=e=>{const{disableGutters:t,classes:n}=e;return zt({root:["root",t&&"disableGutters"]},nDe,n)},oDe=Pe("div",{name:"MuiListItemSecondaryAction",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.disableGutters&&t.disableGutters]}})({position:"absolute",right:16,top:"50%",transform:"translateY(-50%)",variants:[{props:({ownerState:e})=>e.disableGutters,style:{right:0}}]}),o9=T.forwardRef(function(e,t){const n=An({props:e,name:"MuiListItemSecondaryAction"}),{className:r,...o}=n,a=T.useContext(ac),i={...n,disableGutters:a.disableGutters},s=rDe(i);return m.jsx(oDe,{className:Ot(s.root,r),ownerState:i,ref:t,...o})});o9.muiName="ListItemSecondaryAction";const aDe=(e,t)=>{const{ownerState:n}=e;return[t.root,n.dense&&t.dense,n.alignItems==="flex-start"&&t.alignItemsFlexStart,n.divider&&t.divider,!n.disableGutters&&t.gutters,!n.disablePadding&&t.padding,n.hasSecondaryAction&&t.secondaryAction]},iDe=e=>{const{alignItems:t,classes:n,dense:r,disableGutters:o,disablePadding:a,divider:i,hasSecondaryAction:s}=e;return zt({root:["root",r&&"dense",!o&&"gutters",!a&&"padding",i&&"divider",t==="flex-start"&&"alignItemsFlexStart",s&&"secondaryAction"],container:["container"]},eDe,n)},sDe=Pe("div",{name:"MuiListItem",slot:"Root",overridesResolver:aDe})(Pn(({theme:e})=>({display:"flex",justifyContent:"flex-start",alignItems:"center",position:"relative",textDecoration:"none",width:"100%",boxSizing:"border-box",textAlign:"left",variants:[{props:({ownerState:t})=>!t.disablePadding,style:{paddingTop:8,paddingBottom:8}},{props:({ownerState:t})=>!t.disablePadding&&t.dense,style:{paddingTop:4,paddingBottom:4}},{props:({ownerState:t})=>!t.disablePadding&&!t.disableGutters,style:{paddingLeft:16,paddingRight:16}},{props:({ownerState:t})=>!t.disablePadding&&!!t.secondaryAction,style:{paddingRight:48}},{props:({ownerState:t})=>!!t.secondaryAction,style:{[`& > .${tDe.root}`]:{paddingRight:48}}},{props:{alignItems:"flex-start"},style:{alignItems:"flex-start"}},{props:({ownerState:t})=>t.divider,style:{borderBottom:`1px solid ${(e.vars||e).palette.divider}`,backgroundClip:"padding-box"}},{props:({ownerState:t})=>t.button,style:{transition:e.transitions.create("background-color",{duration:e.transitions.duration.shortest}),"&:hover":{textDecoration:"none",backgroundColor:(e.vars||e).palette.action.hover,"@media (hover: none)":{backgroundColor:"transparent"}}}},{props:({ownerState:t})=>t.hasSecondaryAction,style:{paddingRight:48}}]}))),lDe=Pe("li",{name:"MuiListItem",slot:"Container"})({position:"relative"}),cDe=T.forwardRef(function(e,t){const n=An({props:e,name:"MuiListItem"}),{alignItems:r="center",children:o,className:a,component:i,components:s={},componentsProps:c={},ContainerComponent:u="li",ContainerProps:{className:f,...p}={},dense:y=!1,disableGutters:g=!1,disablePadding:b=!1,divider:x=!1,secondaryAction:E,slotProps:S={},slots:w={},...C}=n,R=T.useContext(ac),M=T.useMemo(()=>({dense:y||R.dense||!1,alignItems:r,disableGutters:g}),[r,R.dense,y,g]),D=T.useRef(null),I=T.Children.toArray(o),L=I.length&&a1(I[I.length-1],["ListItemSecondaryAction"]),F={...n,alignItems:r,dense:M.dense,disableGutters:g,disablePadding:b,divider:x,hasSecondaryAction:L},B=iDe(F),U=cr(D,t),k=w.root||s.Root||sDe,$=S.root||c.root||{},j={className:Ot(B.root,$.className,a),...C};let V=i||"li";return L?(V=!j.component&&!i?"div":V,u==="li"&&(V==="li"?V="div":j.component==="li"&&(j.component="div")),m.jsx(ac.Provider,{value:M,children:m.jsxs(lDe,{as:u,className:Ot(B.container,f),ref:U,ownerState:F,...p,children:[m.jsx(k,{...$,...!Qp(k)&&{as:V,ownerState:{...F,...$.ownerState}},...j,children:I}),I.pop()]})})):m.jsx(ac.Provider,{value:M,children:m.jsxs(k,{...$,as:V,ref:U,...!Qp(k)&&{ownerState:{...F,...$.ownerState}},...j,children:[I,E&&m.jsx(o9,{children:E})]})})}),Ky=36,HS=2,US=320,uDe=280,lO=336,dDe=["items","changeImportance","isLandscape","onChange","isValid"],fDe=["getValue"];function pDe(e){const{items:t,changeImportance:n="accept",onChange:r,isValid:o}=e,a=fn(e,dDe);if(t==null||t.length===0)return null;const i=t.map(s=>{let{getValue:c}=s,u=fn(s,fDe);const f=c({isValid:o});return pe({},u,{label:u.label,onClick:()=>{r(f,n,u)},disabled:!o(f)})});return m.jsx(x$,pe({dense:!0,sx:[{maxHeight:lO,maxWidth:200,overflow:"auto"},...Array.isArray(a.sx)?a.sx:[a.sx]]},a,{children:i.map(s=>m.jsx(cDe,{children:m.jsx(F$,pe({},s))},s.id??s.label))}))}function hDe(e){return e.view!==null}const mDe=e=>{const{classes:t,isLandscape:n}=e;return zt({root:["root",n&&"landscape"],contentWrapper:["contentWrapper"],toolbar:["toolbar"],actionBar:["actionBar"],tabs:["tabs"],landscape:["landscape"],shortcuts:["shortcuts"]},r9,t)},gDe=e=>{const{wrapperVariant:t,onAccept:n,onClear:r,onCancel:o,onSetToday:a,view:i,views:s,onViewChange:c,value:u,onChange:f,onSelectShortcut:p,isValid:y,isLandscape:g,disabled:b,readOnly:x,children:E,slots:S,slotProps:w}=e,C=mDe(e),R=S?.actionBar??JAe,M=mr({elementType:R,externalSlotProps:w?.actionBar,additionalProps:{onAccept:n,onClear:r,onCancel:o,onSetToday:a,actions:t==="desktop"?[]:["cancel","accept"]},className:C.actionBar,ownerState:pe({},e,{wrapperVariant:t})}),D=m.jsx(R,pe({},M)),I=S?.toolbar,L=mr({elementType:I,externalSlotProps:w?.toolbar,additionalProps:{isLandscape:g,onChange:f,value:u,view:i,onViewChange:c,views:s,disabled:b,readOnly:x},className:C.toolbar,ownerState:pe({},e,{wrapperVariant:t})}),F=hDe(L)&&I?m.jsx(I,pe({},L)):null,B=E,U=S?.tabs,k=i&&U?m.jsx(U,pe({view:i,onViewChange:c,className:C.tabs},w?.tabs)):null,$=S?.shortcuts??pDe,j=mr({elementType:$,externalSlotProps:w?.shortcuts,additionalProps:{isValid:y,isLandscape:g,onChange:p},className:C.shortcuts,ownerState:{isValid:y,isLandscape:g,onChange:p,wrapperVariant:t}}),V=i&&$?m.jsx($,pe({},j)):null;return{toolbar:F,content:B,tabs:k,actionBar:D,shortcuts:V}},yDe=e=>{const{isLandscape:t,classes:n}=e;return zt({root:["root",t&&"landscape"],contentWrapper:["contentWrapper"]},r9,n)},bDe=Pe("div",{name:"MuiPickersLayout",slot:"Root",overridesResolver:(e,t)=>t.root})({display:"grid",gridAutoColumns:"max-content auto max-content",gridAutoRows:"max-content auto max-content",[`& .${cd.actionBar}`]:{gridColumn:"1 / 4",gridRow:3},variants:[{props:{isLandscape:!0},style:{[`& .${cd.toolbar}`]:{gridColumn:1,gridRow:"2 / 3"},[`.${cd.shortcuts}`]:{gridColumn:"2 / 4",gridRow:1}}},{props:{isLandscape:!0,isRtl:!0},style:{[`& .${cd.toolbar}`]:{gridColumn:3}}},{props:{isLandscape:!1},style:{[`& .${cd.toolbar}`]:{gridColumn:"2 / 4",gridRow:1},[`& .${cd.shortcuts}`]:{gridColumn:1,gridRow:"2 / 3"}}},{props:{isLandscape:!1,isRtl:!0},style:{[`& .${cd.shortcuts}`]:{gridColumn:3}}}]}),vDe=Pe("div",{name:"MuiPickersLayout",slot:"ContentWrapper",overridesResolver:(e,t)=>t.contentWrapper})({gridColumn:2,gridRow:2,display:"flex",flexDirection:"column"}),a9=T.forwardRef(function(e,t){const n=Vr({props:e,name:"MuiPickersLayout"}),{toolbar:r,content:o,tabs:a,actionBar:i,shortcuts:s}=gDe(n),{sx:c,className:u,isLandscape:f,wrapperVariant:p}=n,y=yDe(n);return m.jsxs(bDe,{ref:t,sx:c,className:Ot(y.root,u),ownerState:n,children:[f?s:r,f?r:s,m.jsx(vDe,{className:y.contentWrapper,children:p==="desktop"?m.jsxs(T.Fragment,{children:[o,a]}):m.jsxs(T.Fragment,{children:[a,o]})}),i]})}),xDe=T.createContext(null);function i9(e){const{contextValue:t,localeText:n,children:r}=e;return m.jsx(xDe.Provider,{value:t,children:m.jsx(fx,{localeText:n,children:r})})}const SDe=["props","getOpenDialogAriaText"],EDe=["ownerState"],CDe=["ownerState"],TDe=e=>{let{props:t,getOpenDialogAriaText:n}=e,r=fn(e,SDe);const{slots:o,slotProps:a,className:i,sx:s,format:c,formatDensity:u,enableAccessibleFieldDOMStructure:f,selectedSections:p,onSelectedSectionsChange:y,timezone:g,name:b,label:x,inputRef:E,readOnly:S,disabled:w,autoFocus:C,localeText:R,reduceAnimations:M}=t,D=T.useRef(null),I=T.useRef(null),L=Bs(),F=a?.toolbar?.hidden??!1,{open:B,actions:U,hasUIView:k,layoutProps:$,renderCurrentView:j,shouldRestoreFocus:V,fieldProps:z,contextValue:K,ownerState:Y}=n9(pe({},r,{props:t,fieldRef:I,autoFocusView:!0,additionalViewProps:{},wrapperVariant:"desktop"})),te=o.inputAdornment??J$,_=mr({elementType:te,externalSlotProps:a?.inputAdornment,additionalProps:{position:"end"},ownerState:t}),Z=fn(_,EDe),J=o.openPickerButton??gs,W=mr({elementType:J,externalSlotProps:a?.openPickerButton,additionalProps:{disabled:w||S,onClick:B?U.onClose:U.onOpen,"aria-label":n(z.value),edge:Z.position},ownerState:t}),re=fn(W,CDe),ne=o.openPickerIcon,X=mr({elementType:ne,externalSlotProps:a?.openPickerIcon,ownerState:Y}),ie=o.field,ae=mr({elementType:ie,externalSlotProps:a?.field,additionalProps:pe({},z,F&&{id:L},{readOnly:S,disabled:w,className:i,sx:s,format:c,formatDensity:u,enableAccessibleFieldDOMStructure:f,selectedSections:p,onSelectedSectionsChange:y,timezone:g,label:x,name:b,autoFocus:C&&!t.open,focused:B?!0:void 0},E?{inputRef:E}:{}),ownerState:t});k&&(ae.InputProps=pe({},ae.InputProps,{ref:D},!t.disableOpenPicker&&{[`${Z.position}Adornment`]:m.jsx(te,pe({},Z,{children:m.jsx(J,pe({},re,{children:m.jsx(ne,pe({},X))}))}))}));const fe=pe({textField:o.textField,clearIcon:o.clearIcon,clearButton:o.clearButton},ae.slots),xe=o.layout??a9;let ge=L;F&&(x?ge=`${L}-label`:ge=void 0);const Re=pe({},a,{toolbar:pe({},a?.toolbar,{titleId:L}),popper:pe({"aria-labelledby":ge},a?.popper)}),de=cr(I,ae.unstableFieldRef);return{renderPicker:()=>m.jsxs(i9,{contextValue:K,localeText:R,children:[m.jsx(ie,pe({},ae,{slots:fe,slotProps:Re,unstableFieldRef:de})),m.jsx(zAe,pe({role:"dialog",placement:"bottom-start",anchorEl:D.current},U,{open:B,slots:o,slotProps:Re,shouldRestoreFocus:V,reduceAnimations:M,children:m.jsx(xe,pe({},$,Re?.layout,{slots:o,slotProps:Re,children:j()}))}))]})}},wDe=Fn(m.jsx("path",{d:"M7 10l5 5 5-5z"})),kDe=Fn(m.jsx("path",{d:"M15.41 16.59L10.83 12l4.58-4.59L14 6l-6 6 6 6 1.41-1.41z"})),ADe=Fn(m.jsx("path",{d:"M8.59 16.59L13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.41z"})),DDe=Fn(m.jsx("path",{d:"M17 12h-5v5h5v-5zM16 1v2H8V1H6v2H5c-1.11 0-1.99.9-1.99 2L3 19c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2h-1V1h-2zm3 18H5V8h14v11z"}));Fn(m.jsxs(T.Fragment,{children:[m.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 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"}),m.jsx("path",{d:"M12.5 7H11v6l5.25 3.15.75-1.23-4.5-2.67z"})]}));Fn(m.jsx("path",{d:"M9 11H7v2h2v-2zm4 0h-2v2h2v-2zm4 0h-2v2h2v-2zm2-7h-1V2h-2v2H8V2H6v2H5c-1.11 0-1.99.9-1.99 2L3 20c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm0 16H5V9h14v11z"}));Fn(m.jsxs(T.Fragment,{children:[m.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 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"}),m.jsx("path",{d:"M12.5 7H11v6l5.25 3.15.75-1.23-4.5-2.67z"})]}));const ODe=Fn(m.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"})),RDe=({utils:e,format:t})=>{let n=10,r=t,o=e.expandFormat(t);for(;o!==r;)if(r=o,o=e.expandFormat(r),n-=1,n<0)throw new Error("MUI X: The format expansion seems to be in an infinite loop. Please open an issue with the format passed to the picker component.");return o},MDe=({utils:e,expandedFormat:t})=>{const n=[],{start:r,end:o}=e.escapedCharacters,a=new RegExp(`(\\${r}[^\\${o}]*\\${o})+`,"g");let i=null;for(;i=a.exec(t);)n.push({start:i.index,end:a.lastIndex-1});return n},NDe=(e,t,n,r)=>{switch(n.type){case"year":return t.fieldYearPlaceholder({digitAmount:e.formatByString(e.date(void 0,"default"),r).length,format:r});case"month":return t.fieldMonthPlaceholder({contentType:n.contentType,format:r});case"day":return t.fieldDayPlaceholder({format:r});case"weekDay":return t.fieldWeekDayPlaceholder({contentType:n.contentType,format:r});case"hours":return t.fieldHoursPlaceholder({format:r});case"minutes":return t.fieldMinutesPlaceholder({format:r});case"seconds":return t.fieldSecondsPlaceholder({format:r});case"meridiem":return t.fieldMeridiemPlaceholder({format:r});default:return r}},PDe=({utils:e,date:t,shouldRespectLeadingZeros:n,localeText:r,localizedDigits:o,now:a,token:i,startSeparator:s})=>{if(i==="")throw new Error("MUI X: Should not call `commitToken` with an empty token");const c=H$(e,i),u=q$(e,c.contentType,c.type,i),f=n?u:c.contentType==="digit",p=t!=null&&e.isValid(t);let y=p?e.formatByString(t,i):"",g=null;if(f)if(u)g=y===""?e.formatByString(a,i).length:y.length;else{if(c.maxLength==null)throw new Error(`MUI X: The token ${i} should have a 'maxDigitNumber' property on it's adapter`);g=c.maxLength,p&&(y=oO(V$(Yd(y,o),g),o))}return pe({},c,{format:i,maxLength:g,value:y,placeholder:NDe(e,r,c,i),hasLeadingZerosInFormat:u,hasLeadingZerosInInput:f,startSeparator:s,endSeparator:"",modified:!1})},IDe=e=>{const{utils:t,expandedFormat:n,escapedParts:r}=e,o=t.date(void 0),a=[];let i="";const s=Object.keys(t.formatTokenMap).sort((g,b)=>b.length-g.length),c=/^([a-zA-Z]+)/,u=new RegExp(`^(${s.join("|")})*$`),f=new RegExp(`^(${s.join("|")})`),p=g=>r.find(b=>b.start<=g&&b.end>=g);let y=0;for(;y<n.length;){const g=p(y),b=g!=null,x=c.exec(n.slice(y))?.[1];if(!b&&x!=null&&u.test(x)){let E=x;for(;E.length>0;){const S=f.exec(E)[1];E=E.slice(S.length),a.push(PDe(pe({},e,{now:o,token:S,startSeparator:i}))),i=""}y+=x.length}else{const E=n[y];b&&g?.start===y||g?.end===y||(a.length===0?i+=E:a[a.length-1].endSeparator+=E),y+=1}}return a.length===0&&i.length>0&&a.push({type:"empty",contentType:"letter",maxLength:null,format:"",value:"",placeholder:"",hasLeadingZerosInFormat:!1,hasLeadingZerosInInput:!1,startSeparator:i,endSeparator:"",modified:!1}),a},_De=({isRtl:e,formatDensity:t,sections:n})=>n.map(r=>{const o=a=>{let i=a;return e&&i!==null&&i.includes(" ")&&(i=`⁩${i}⁦`),t==="spacious"&&["/",".","-"].includes(i)&&(i=` ${i} `),i};return r.startSeparator=o(r.startSeparator),r.endSeparator=o(r.endSeparator),r}),c4=e=>{let t=RDe(e);e.isRtl&&e.enableAccessibleFieldDOMStructure&&(t=t.split(" ").reverse().join(" "));const n=MDe(pe({},e,{expandedFormat:t})),r=IDe(pe({},e,{expandedFormat:t,escapedParts:n}));return _De(pe({},e,{sections:r}))},LDe=e=>{const t=Wr(),n=yc(),r=sf(),o=js(),{valueManager:a,fieldValueManager:i,valueType:s,validator:c,internalProps:u,internalProps:{value:f,defaultValue:p,referenceDate:y,onChange:g,format:b,formatDensity:x="dense",selectedSections:E,onSelectedSectionsChange:S,shouldRespectLeadingZeros:w=!1,timezone:C,enableAccessibleFieldDOMStructure:R=!1}}=e,{timezone:M,value:D,handleValueChange:I}=iO({timezone:C,value:f,defaultValue:p,referenceDate:y,onChange:g,valueManager:a}),L=T.useMemo(()=>q2e(t),[t]),F=T.useMemo(()=>Z2e(t,L,M),[t,L,M]),B=T.useCallback((ne,X=null)=>i.getSectionsFromValue(t,ne,X,ie=>c4({utils:t,localeText:n,localizedDigits:L,format:b,date:ie,formatDensity:x,shouldRespectLeadingZeros:w,enableAccessibleFieldDOMStructure:R,isRtl:o})),[i,b,n,L,o,w,t,x,R]),[U,k]=T.useState(()=>{const ne=B(D),X={sections:ne,value:D,referenceValue:a.emptyValue,tempValueStrAndroid:null},ie=H2e(ne),ae=a.getInitialReferenceValue({referenceDate:y,value:D,utils:t,props:u,granularity:ie,timezone:M});return pe({},X,{referenceValue:ae})}),[$,j]=xi({controlled:E,default:null,name:"useField",state:"selectedSections"}),V=ne=>{j(ne),S?.(ne)},z=T.useMemo(()=>h2($,U.sections),[$,U.sections]),K=z==="all"?0:z,Y=({value:ne,referenceValue:X,sections:ie})=>{if(k(fe=>pe({},fe,{sections:ie,value:ne,referenceValue:X,tempValueStrAndroid:null})),a.areValuesEqual(t,U.value,ne))return;const ae={validationError:c({adapter:r,value:ne,timezone:M,props:u})};I(ne,ae)},te=(ne,X)=>{const ie=[...U.sections];return ie[ne]=pe({},ie[ne],{value:X,modified:!0}),ie},_=()=>{Y({value:a.emptyValue,referenceValue:U.referenceValue,sections:B(a.emptyValue)})},Z=()=>{if(K==null)return;const ne=U.sections[K],X=i.getActiveDateManager(t,U,ne),ie=X.getSections(U.sections).filter(ge=>ge.value!=="").length===(ne.value===""?0:1),ae=te(K,""),fe=ie?null:t.getInvalidDate(),xe=X.getNewValuesFromNewActiveDate(fe);Y(pe({},xe,{sections:ae}))},J=ne=>{const X=(fe,xe)=>{const ge=t.parse(fe,b);if(ge==null||!t.isValid(ge))return null;const Re=c4({utils:t,localeText:n,localizedDigits:L,format:b,date:ge,formatDensity:x,shouldRespectLeadingZeros:w,enableAccessibleFieldDOMStructure:R,isRtl:o});return r4(t,ge,Re,xe,!1)},ie=i.parseValueStr(ne,U.referenceValue,X),ae=i.updateReferenceValue(t,ie,U.referenceValue);Y({value:ie,referenceValue:ae,sections:B(ie,U.sections)})},W=({activeSection:ne,newSectionValue:X,shouldGoToNextSection:ie})=>{ie&&K<U.sections.length-1&&V(K+1);const ae=i.getActiveDateManager(t,U,ne),fe=te(K,X),xe=ae.getSections(fe),ge=K2e(t,xe,L);let Re,de;if(ge!=null&&t.isValid(ge)){const me=r4(t,ge,xe,ae.referenceDate,!0);Re=ae.getNewValuesFromNewActiveDate(me),de=!0}else Re=ae.getNewValuesFromNewActiveDate(ge),de=(ge!=null&&!t.isValid(ge))!=(ae.date!=null&&!t.isValid(ae.date));return de?Y(pe({},Re,{sections:fe})):k(me=>pe({},me,Re,{sections:fe,tempValueStrAndroid:null}))},re=ne=>k(X=>pe({},X,{tempValueStrAndroid:ne}));return T.useEffect(()=>{const ne=B(U.value);k(X=>pe({},X,{sections:ne}))},[b,t.locale,o]),T.useEffect(()=>{let ne;a.areValuesEqual(t,U.value,D)?ne=a.getTimezone(t,U.value)!==a.getTimezone(t,D):ne=!0,ne&&k(X=>pe({},X,{value:D,referenceValue:i.updateReferenceValue(t,D,X.referenceValue),sections:B(D)}))},[D]),{state:U,activeSectionIndex:K,parsedSelectedSections:z,setSelectedSections:V,clearValue:_,clearActiveSection:Z,updateSectionValue:W,updateValueFromValueStr:J,setTempAndroidValueStr:re,getSectionsFromValue:B,sectionsValueBoundaries:F,localizedDigits:L,timezone:M}},FDe=5e3,dp=e=>e.saveQuery!=null,jDe=({sections:e,updateSectionValue:t,sectionsValueBoundaries:n,localizedDigits:r,setTempAndroidValueStr:o,timezone:a})=>{const i=Wr(),[s,c]=T.useState(null),u=Pt(()=>c(null));T.useEffect(()=>{s!=null&&e[s.sectionIndex]?.type!==s.sectionType&&u()},[e,s,u]),T.useEffect(()=>{if(s!=null){const g=setTimeout(()=>u(),FDe);return()=>{clearTimeout(g)}}return()=>{}},[s,u]);const f=({keyPressed:g,sectionIndex:b},x,E)=>{const S=g.toLowerCase(),w=e[b];if(s!=null&&(!E||E(s.value))&&s.sectionIndex===b){const R=`${s.value}${S}`,M=x(R,w);if(!dp(M))return c({sectionIndex:b,value:R,sectionType:w.type}),M}const C=x(S,w);return dp(C)&&!C.saveQuery?(u(),null):(c({sectionIndex:b,value:S,sectionType:w.type}),dp(C)?null:C)},p=g=>{const b=(E,S,w)=>{const C=S.filter(R=>R.toLowerCase().startsWith(w));return C.length===0?{saveQuery:!1}:{sectionValue:C[0],shouldGoToNextSection:C.length===1}},x=(E,S,w,C)=>{const R=M=>U$(i,a,S.type,M);if(S.contentType==="letter")return b(S.format,R(S.format),E);if(w&&C!=null&&H$(i,w).contentType==="letter"){const M=R(w),D=b(w,M,E);return dp(D)?{saveQuery:!1}:pe({},D,{sectionValue:C(D.sectionValue,M)})}return{saveQuery:!1}};return f(g,(E,S)=>{switch(S.type){case"month":{const w=C=>t4(i,C,i.formats.month,S.format);return x(E,S,i.formats.month,w)}case"weekDay":{const w=(C,R)=>R.indexOf(C).toString();return x(E,S,i.formats.weekday,w)}case"meridiem":return x(E,S);default:return{saveQuery:!1}}})},y=g=>{const b=(x,E)=>{const S=Yd(x,r),w=Number(S),C=n[E.type]({currentDate:null,format:E.format,contentType:E.contentType});if(w>C.maximum)return{saveQuery:!1};if(w<C.minimum)return{saveQuery:!0};const R=w*10>C.maximum||S.length===C.maximum.toString().length;return{sectionValue:W$(i,w,C,r,E),shouldGoToNextSection:R}};return f(g,(x,E)=>{if(E.contentType==="digit"||E.contentType==="digit-with-letter")return b(x,E);if(E.type==="month"){q$(i,"digit","month","MM");const S=b(x,{type:E.type,format:"MM",hasLeadingZerosInInput:!0,contentType:"digit",maxLength:2});if(dp(S))return S;const w=t4(i,S.sectionValue,"MM",E.format);return pe({},S,{sectionValue:w})}if(E.type==="weekDay"){const S=b(x,E);if(dp(S))return S;const w=$S(i,E.format)[Number(S.sectionValue)-1];return pe({},S,{sectionValue:w})}return{saveQuery:!1}},x=>e4(x,r))};return{applyCharacterEditing:Pt(g=>{const b=e[g.sectionIndex],x=e4(g.keyPressed,r)?y(pe({},g,{keyPressed:oO(g.keyPressed,r)})):p(g);if(x==null){o(null);return}t({activeSection:b,newSectionValue:x.sectionValue,shouldGoToNextSection:x.shouldGoToNextSection})}),resetCharacterQuery:u}},BDe=e=>{const{internalProps:{disabled:t,readOnly:n=!1},forwardedProps:{sectionListRef:r,onBlur:o,onClick:a,onFocus:i,onInput:s,onPaste:c,focused:u,autoFocus:f=!1},fieldValueManager:p,applyCharacterEditing:y,resetCharacterQuery:g,setSelectedSections:b,parsedSelectedSections:x,state:E,clearActiveSection:S,clearValue:w,updateSectionValue:C,updateValueFromValueStr:R,sectionOrder:M,areAllSectionsEmpty:D,sectionsValueBoundaries:I}=e,L=T.useRef(null),F=cr(r,L),B=yc(),U=Wr(),k=Bs(),[$,j]=T.useState(!1),V=T.useMemo(()=>({syncSelectionToDOM:()=>{if(!L.current)return;const de=document.getSelection();if(!de)return;if(x==null){de.rangeCount>0&&L.current.getRoot().contains(de.getRangeAt(0).startContainer)&&de.removeAllRanges(),$&&L.current.getRoot().blur();return}if(!L.current.getRoot().contains(ja(document)))return;const me=new window.Range;let Qe;x==="all"?Qe=L.current.getRoot():E.sections[x].type==="empty"?Qe=L.current.getSectionContainer(x):Qe=L.current.getSectionContent(x),me.selectNodeContents(Qe),Qe.focus(),de.removeAllRanges(),de.addRange(me)},getActiveSectionIndexFromDOM:()=>{const de=ja(document);return!de||!L.current||!L.current.getRoot().contains(de)?null:L.current.getSectionIndexFromDOMElement(de)},focusField:(de=0)=>{if(!L.current||V.getActiveSectionIndexFromDOM()!=null)return;const me=h2(de,E.sections);j(!0),L.current.getSectionContent(me).focus()},setSelectedSections:de=>{if(!L.current)return;const me=h2(de,E.sections);j((me==="all"?0:me)!==null),b(de)},isFieldFocused:()=>{const de=ja(document);return!!L.current&&L.current.getRoot().contains(de)}}),[x,b,E.sections,$]),z=Pt(de=>{if(!L.current)return;const me=E.sections[de];L.current.getSectionContent(de).innerHTML=me.value||me.placeholder,V.syncSelectionToDOM()}),K=Pt((de,...me)=>{de.isDefaultPrevented()||!L.current||(j(!0),a?.(de,...me),x==="all"?setTimeout(()=>{const Qe=document.getSelection().getRangeAt(0).startOffset;if(Qe===0){b(M.startIndex);return}let Me=0,we=0;for(;we<Qe&&Me<E.sections.length;){const Se=E.sections[Me];Me+=1,we+=`${Se.startSeparator}${Se.value||Se.placeholder}${Se.endSeparator}`.length}b(Me-1)}):$?L.current.getRoot().contains(de.target)||b(M.startIndex):(j(!0),b(M.startIndex)))}),Y=Pt(de=>{if(s?.(de),!L.current||x!=="all")return;const me=de.target.textContent??"";L.current.getRoot().innerHTML=E.sections.map(Qe=>`${Qe.startSeparator}${Qe.value||Qe.placeholder}${Qe.endSeparator}`).join(""),V.syncSelectionToDOM(),me.length===0||me.charCodeAt(0)===10?(g(),w(),b("all")):me.length>1?R(me):(x==="all"&&b(0),y({keyPressed:me,sectionIndex:0}))}),te=Pt(de=>{if(c?.(de),n||x!=="all"){de.preventDefault();return}const me=de.clipboardData.getData("text");de.preventDefault(),g(),R(me)}),_=Pt((...de)=>{i?.(...de),!($||!L.current)&&(j(!0),L.current.getSectionIndexFromDOMElement(ja(document))!=null||b(M.startIndex))}),Z=Pt((...de)=>{o?.(...de),setTimeout(()=>{if(!L.current)return;const me=ja(document);!L.current.getRoot().contains(me)&&(j(!1),b(null))})}),J=Pt(de=>me=>{me.isDefaultPrevented()||b(de)}),W=Pt(de=>{de.preventDefault()}),re=Pt(de=>()=>{b(de)}),ne=Pt(de=>{if(de.preventDefault(),n||t||typeof x!="number")return;const me=E.sections[x],Qe=de.clipboardData.getData("text"),Me=/^[a-zA-Z]+$/.test(Qe),we=/^[0-9]+$/.test(Qe),Se=/^(([a-zA-Z]+)|)([0-9]+)(([a-zA-Z]+)|)$/.test(Qe);me.contentType==="letter"&&Me||me.contentType==="digit"&&we||me.contentType==="digit-with-letter"&&Se?(g(),C({activeSection:me,newSectionValue:Qe,shouldGoToNextSection:!0})):!Me&&!we&&(g(),R(Qe))}),X=Pt(de=>{de.preventDefault(),de.dataTransfer.dropEffect="none"}),ie=Pt(de=>{if(!L.current)return;const me=de.target,Qe=me.textContent??"",Me=L.current.getSectionIndexFromDOMElement(me),we=E.sections[Me];if(n||!L.current){z(Me);return}if(Qe.length===0){if(we.value===""){z(Me);return}const Se=de.nativeEvent.inputType;if(Se==="insertParagraph"||Se==="insertLineBreak"){z(Me);return}g(),S();return}y({keyPressed:Qe,sectionIndex:Me}),z(Me)});Io(()=>{if(!(!$||!L.current)){if(x==="all")L.current.getRoot().focus();else if(typeof x=="number"){const de=L.current.getSectionContent(x);de&&de.focus()}}},[x,$]);const ae=T.useMemo(()=>E.sections.reduce((de,me)=>(de[me.type]=I[me.type]({currentDate:null,contentType:me.contentType,format:me.format}),de),{}),[I,E.sections]),fe=x==="all",xe=T.useMemo(()=>E.sections.map((de,me)=>{const Qe=!fe&&!t&&!n;return{container:{"data-sectionindex":me,onClick:J(me)},content:{tabIndex:fe||me>0?-1:0,contentEditable:!fe&&!t&&!n,role:"spinbutton",id:`${k}-${de.type}`,"aria-labelledby":`${k}-${de.type}`,"aria-readonly":n,"aria-valuenow":rAe(de,U),"aria-valuemin":ae[de.type].minimum,"aria-valuemax":ae[de.type].maximum,"aria-valuetext":de.value?nAe(de,U):B.empty,"aria-label":B[de.type],"aria-disabled":t,spellCheck:Qe?!1:void 0,autoCapitalize:Qe?"off":void 0,autoCorrect:Qe?"off":void 0,[parseInt(T.version,10)>=17?"enterKeyHint":"enterkeyhint"]:Qe?"next":void 0,children:de.value||de.placeholder,onInput:ie,onPaste:ne,onFocus:re(me),onDragOver:X,onMouseUp:W,inputMode:de.contentType==="letter"?"text":"numeric"},before:{children:de.startSeparator},after:{children:de.endSeparator}}}),[E.sections,re,ne,X,ie,J,W,t,n,fe,B,U,ae,k]),ge=Pt(de=>{R(de.target.value)}),Re=T.useMemo(()=>D?"":p.getV7HiddenInputValueFromSections(E.sections),[D,E.sections,p]);return T.useEffect(()=>{if(L.current==null)throw new Error(["MUI X: The `sectionListRef` prop has not been initialized by `PickersSectionList`","You probably tried to pass a component to the `textField` slot that contains an `<input />` element instead of a `PickersSectionList`.","","If you want to keep using an `<input />` HTML element for the editing, please remove the `enableAccessibleFieldDOMStructure` prop from your picker or field component:","","<DatePicker slots={{ textField: MyCustomTextField }} />","","Learn more about the field accessible DOM structure on the MUI documentation: https://mui.com/x/react-date-pickers/fields/#fields-to-edit-a-single-element"].join(`
438
438
  `));f&&L.current&&L.current.getSectionContent(M.startIndex).focus()},[]),{interactions:V,returnedValue:{autoFocus:f,readOnly:n,focused:u??$,sectionListRef:F,onBlur:Z,onClick:K,onFocus:_,onInput:Y,onPaste:te,enableAccessibleFieldDOMStructure:!0,elements:xe,tabIndex:x===0?-1:0,contentEditable:fe,value:Re,onChange:ge,areAllSectionsEmpty:D}}},vp=e=>e.replace(/[\u2066\u2067\u2068\u2069]/g,""),$De=(e,t,n)=>{let r=0,o=n?1:0;const a=[];for(let i=0;i<e.length;i+=1){const s=e[i],c=aO(s,n?"input-rtl":"input-ltr",t),u=`${s.startSeparator}${c}${s.endSeparator}`,f=vp(u).length,p=u.length,y=vp(c),g=o+(y===""?0:c.indexOf(y[0]))+s.startSeparator.length,b=g+y.length;a.push(pe({},s,{start:r,end:r+f,startInInput:g,endInInput:b})),r+=f,o+=p}return a},zDe=e=>{const t=js(),n=T.useRef(void 0),r=T.useRef(void 0),{forwardedProps:{onFocus:o,onClick:a,onPaste:i,onBlur:s,inputRef:c,placeholder:u},internalProps:{readOnly:f=!1,disabled:p=!1},parsedSelectedSections:y,activeSectionIndex:g,state:b,fieldValueManager:x,valueManager:E,applyCharacterEditing:S,resetCharacterQuery:w,updateSectionValue:C,updateValueFromValueStr:R,clearActiveSection:M,clearValue:D,setTempAndroidValueStr:I,setSelectedSections:L,getSectionsFromValue:F,areAllSectionsEmpty:B,localizedDigits:U}=e,k=T.useRef(null),$=cr(c,k),j=T.useMemo(()=>$De(b.sections,U,t),[b.sections,U,t]),V=T.useMemo(()=>({syncSelectionToDOM:()=>{if(!k.current)return;if(y==null){k.current.scrollLeft&&(k.current.scrollLeft=0);return}if(k.current!==ja(document))return;const X=k.current.scrollTop;if(y==="all")k.current.select();else{const ie=j[y],ae=ie.type==="empty"?ie.startInInput-ie.startSeparator.length:ie.startInInput,fe=ie.type==="empty"?ie.endInInput+ie.endSeparator.length:ie.endInInput;(ae!==k.current.selectionStart||fe!==k.current.selectionEnd)&&k.current===ja(document)&&k.current.setSelectionRange(ae,fe),clearTimeout(r.current),r.current=setTimeout(()=>{k.current&&k.current===ja(document)&&k.current.selectionStart===k.current.selectionEnd&&(k.current.selectionStart!==ae||k.current.selectionEnd!==fe)&&V.syncSelectionToDOM()})}k.current.scrollTop=X},getActiveSectionIndexFromDOM:()=>{const X=k.current.selectionStart??0,ie=k.current.selectionEnd??0;if(X===0&&ie===0)return null;const ae=X<=j[0].startInInput?1:j.findIndex(fe=>fe.startInInput-fe.startSeparator.length>X);return ae===-1?j.length-1:ae-1},focusField:(X=0)=>{ja(document)!==k.current&&(k.current?.focus(),L(X))},setSelectedSections:X=>L(X),isFieldFocused:()=>k.current===ja(document)}),[k,y,j,L]),z=()=>{const X=k.current.selectionStart??0;let ie;X<=j[0].startInInput||X>=j[j.length-1].endInInput?ie=1:ie=j.findIndex(fe=>fe.startInInput-fe.startSeparator.length>X);const ae=ie===-1?j.length-1:ie-1;L(ae)},K=Pt((...X)=>{o?.(...X);const ie=k.current;clearTimeout(n.current),n.current=setTimeout(()=>{!ie||ie!==k.current||g==null&&(ie.value.length&&Number(ie.selectionEnd)-Number(ie.selectionStart)===ie.value.length?L("all"):z())})}),Y=Pt((X,...ie)=>{X.isDefaultPrevented()||(a?.(X,...ie),z())}),te=Pt(X=>{if(i?.(X),X.preventDefault(),f||p)return;const ie=X.clipboardData.getData("text");if(typeof y=="number"){const ae=b.sections[y],fe=/^[a-zA-Z]+$/.test(ie),xe=/^[0-9]+$/.test(ie),ge=/^(([a-zA-Z]+)|)([0-9]+)(([a-zA-Z]+)|)$/.test(ie);if(ae.contentType==="letter"&&fe||ae.contentType==="digit"&&xe||ae.contentType==="digit-with-letter"&&ge){w(),C({activeSection:ae,newSectionValue:ie,shouldGoToNextSection:!0});return}if(fe||xe)return}w(),R(ie)}),_=Pt((...X)=>{s?.(...X),L(null)}),Z=Pt(X=>{if(f)return;const ie=X.target.value;if(ie===""){w(),D();return}const ae=X.nativeEvent.data,fe=ae&&ae.length>1,xe=fe?ae:ie,ge=vp(xe);if(y==="all"&&L(g),g==null||fe){R(fe?ae:ge);return}let Re;if(y==="all"&&ge.length===1)Re=ge;else{const de=vp(x.getV6InputValueFromSections(j,U,t));let me=-1,Qe=-1;for(let Se=0;Se<de.length;Se+=1)me===-1&&de[Se]!==ge[Se]&&(me=Se),Qe===-1&&de[de.length-Se-1]!==ge[ge.length-Se-1]&&(Qe=Se);const Me=j[g];if(me<Me.start||de.length-Qe-1>Me.end)return;const we=ge.length-de.length+Me.end-vp(Me.endSeparator||"").length;Re=ge.slice(Me.start+vp(Me.startSeparator||"").length,we)}if(Re.length===0){eAe()&&I(xe),w(),M();return}S({keyPressed:Re,sectionIndex:g})}),J=T.useMemo(()=>u!==void 0?u:x.getV6InputValueFromSections(F(E.emptyValue),U,t),[u,x,F,E.emptyValue,U,t]),W=T.useMemo(()=>b.tempValueStrAndroid??x.getV6InputValueFromSections(b.sections,U,t),[b.sections,x,b.tempValueStrAndroid,U,t]);T.useEffect(()=>(k.current&&k.current===ja(document)&&L("all"),()=>{clearTimeout(n.current),clearTimeout(r.current)}),[]);const re=T.useMemo(()=>g==null||b.sections[g].contentType==="letter"?"text":"numeric",[g,b.sections]),ne=!(k.current&&k.current===ja(document))&&B;return{interactions:V,returnedValue:{readOnly:f,onBlur:_,onClick:Y,onFocus:K,onPaste:te,inputRef:$,enableAccessibleFieldDOMStructure:!1,placeholder:J,inputMode:re,autoComplete:"off",value:ne?"":W,onChange:Z}}},HDe=e=>{const t=Wr(),{internalProps:n,internalProps:{unstableFieldRef:r,minutesStep:o,enableAccessibleFieldDOMStructure:a=!1,disabled:i=!1,readOnly:s=!1},forwardedProps:{onKeyDown:c,error:u,clearable:f,onClear:p},fieldValueManager:y,valueManager:g,validator:b}=e,x=js(),E=LDe(e),{state:S,activeSectionIndex:w,parsedSelectedSections:C,setSelectedSections:R,clearValue:M,clearActiveSection:D,updateSectionValue:I,setTempAndroidValueStr:L,sectionsValueBoundaries:F,localizedDigits:B,timezone:U}=E,k=jDe({sections:S.sections,updateSectionValue:I,sectionsValueBoundaries:F,localizedDigits:B,setTempAndroidValueStr:L,timezone:U}),{resetCharacterQuery:$}=k,j=g.areValuesEqual(t,S.value,g.emptyValue),V=a?BDe:zDe,z=T.useMemo(()=>tAe(S.sections,x&&!a),[S.sections,x,a]),{returnedValue:K,interactions:Y}=V(pe({},e,E,k,{areAllSectionsEmpty:j,sectionOrder:z})),te=Pt(ne=>{if(c?.(ne),!i)switch(!0){case((ne.ctrlKey||ne.metaKey)&&String.fromCharCode(ne.keyCode)==="A"&&!ne.shiftKey&&!ne.altKey):{ne.preventDefault(),R("all");break}case ne.key==="ArrowRight":{if(ne.preventDefault(),C==null)R(z.startIndex);else if(C==="all")R(z.endIndex);else{const X=z.neighbors[C].rightIndex;X!==null&&R(X)}break}case ne.key==="ArrowLeft":{if(ne.preventDefault(),C==null)R(z.endIndex);else if(C==="all")R(z.startIndex);else{const X=z.neighbors[C].leftIndex;X!==null&&R(X)}break}case ne.key==="Delete":{if(ne.preventDefault(),s)break;C==null||C==="all"?M():D(),$();break}case["ArrowUp","ArrowDown","Home","End","PageUp","PageDown"].includes(ne.key):{if(ne.preventDefault(),s||w==null)break;C==="all"&&R(w);const X=S.sections[w],ie=y.getActiveDateManager(t,S,X),ae=G2e(t,U,X,ne.key,F,B,ie.date,{minutesStep:o});I({activeSection:X,newSectionValue:ae,shouldGoToNextSection:!1});break}}});Io(()=>{Y.syncSelectionToDOM()});const{hasValidationError:_}=Z$({props:n,validator:b,timezone:U,value:S.value,onError:n.onError}),Z=T.useMemo(()=>u!==void 0?u:_,[_,u]);T.useEffect(()=>{!Z&&w==null&&$()},[S.referenceValue,w,Z]),T.useEffect(()=>{S.tempValueStrAndroid!=null&&w!=null&&($(),D())},[S.sections]),T.useImperativeHandle(r,()=>({getSections:()=>S.sections,getActiveSectionIndex:Y.getActiveSectionIndexFromDOM,setSelectedSections:Y.setSelectedSections,focusField:Y.focusField,isFieldFocused:Y.isFieldFocused}));const J=Pt((ne,...X)=>{ne.preventDefault(),p?.(ne,...X),M(),Y.isFieldFocused()?R(z.startIndex):Y.focusField(0)}),W={onKeyDown:te,onClear:J,error:Z,clearable:!!(f&&!j&&!s&&!i)},re={disabled:i,readOnly:s};return pe({},e.forwardedProps,W,re,K)},UDe=["clearable","onClear","InputProps","sx","slots","slotProps"],VDe=["ownerState"],WDe=e=>{const t=yc(),{clearable:n,onClear:r,InputProps:o,sx:a,slots:i,slotProps:s}=e,c=fn(e,UDe),u=i?.clearButton??gs,f=mr({elementType:u,externalSlotProps:s?.clearButton,ownerState:{},className:"clearButton",additionalProps:{title:t.fieldClearLabel}}),p=fn(f,VDe),y=i?.clearIcon??ODe,g=mr({elementType:y,externalSlotProps:s?.clearIcon,ownerState:{}});return pe({},c,{InputProps:pe({},o,{endAdornment:m.jsxs(T.Fragment,{children:[n&&m.jsx(J$,{position:"end",sx:{marginRight:o?.endAdornment?-1:-1.5},children:m.jsx(u,pe({},p,{onClick:r,children:m.jsx(y,pe({fontSize:"small"},g))}))}),o?.endAdornment]})}),sx:[{"& .clearButton":{opacity:1},"@media (pointer: fine)":{"& .clearButton":{opacity:0},"&:hover, &:focus-within":{".clearButton":{opacity:1}}}},...Array.isArray(a)?a:[a]]})},qDe=["value","defaultValue","referenceDate","format","formatDensity","onChange","timezone","onError","shouldRespectLeadingZeros","selectedSections","onSelectedSectionsChange","unstableFieldRef","enableAccessibleFieldDOMStructure","disabled","readOnly","dateSeparator"],GDe=(e,t)=>T.useMemo(()=>{const n=pe({},e),r={},o=a=>{n.hasOwnProperty(a)&&(r[a]=n[a],delete n[a])};return qDe.forEach(o),Q$.forEach(o),{forwardedProps:n,internalProps:r}},[e,t]),YDe=e=>{const t=Wr(),n=Pb();return pe({},e,{disablePast:e.disablePast??!1,disableFuture:e.disableFuture??!1,format:e.format??t.formats.keyboardDate,minDate:cs(t,e.minDate,n.minDate),maxDate:cs(t,e.maxDate,n.maxDate)})},KDe=e=>{const t=YDe(e),{forwardedProps:n,internalProps:r}=GDe(t,"date");return HDe({forwardedProps:n,internalProps:r,valueManager:Sl,fieldValueManager:aAe,validator:Ib,valueType:"date"})};function QDe(e){return Ut("MuiPickersTextField",e)}Lt("MuiPickersTextField",["root","focused","disabled","error","required"]);function XDe(e){return Ut("MuiPickersInputBase",e)}const Np=Lt("MuiPickersInputBase",["root","focused","disabled","error","notchedOutline","sectionContent","sectionBefore","sectionAfter","adornedStart","adornedEnd","input"]);function ZDe(e){return Ut("MuiPickersSectionList",e)}const Cg=Lt("MuiPickersSectionList",["root","section","sectionContent"]),JDe=["slots","slotProps","elements","sectionListRef"],s9=Pe("div",{name:"MuiPickersSectionList",slot:"Root",overridesResolver:(e,t)=>t.root})({direction:"ltr /*! @noflip */",outline:"none"}),l9=Pe("span",{name:"MuiPickersSectionList",slot:"Section",overridesResolver:(e,t)=>t.section})({}),c9=Pe("span",{name:"MuiPickersSectionList",slot:"SectionSeparator",overridesResolver:(e,t)=>t.sectionSeparator})({whiteSpace:"pre"}),u9=Pe("span",{name:"MuiPickersSectionList",slot:"SectionContent",overridesResolver:(e,t)=>t.sectionContent})({outline:"none"}),eOe=e=>{const{classes:t}=e;return zt({root:["root"],section:["section"],sectionContent:["sectionContent"]},ZDe,t)};function tOe(e){const{slots:t,slotProps:n,element:r,classes:o}=e,a=t?.section??l9,i=mr({elementType:a,externalSlotProps:n?.section,externalForwardedProps:r.container,className:o.section,ownerState:{}}),s=t?.sectionContent??u9,c=mr({elementType:s,externalSlotProps:n?.sectionContent,externalForwardedProps:r.content,additionalProps:{suppressContentEditableWarning:!0},className:o.sectionContent,ownerState:{}}),u=t?.sectionSeparator??c9,f=mr({elementType:u,externalSlotProps:n?.sectionSeparator,externalForwardedProps:r.before,ownerState:{position:"before"}}),p=mr({elementType:u,externalSlotProps:n?.sectionSeparator,externalForwardedProps:r.after,ownerState:{position:"after"}});return m.jsxs(a,pe({},i,{children:[m.jsx(u,pe({},f)),m.jsx(s,pe({},c)),m.jsx(u,pe({},p))]}))}const nOe=T.forwardRef(function(e,t){const n=Vr({props:e,name:"MuiPickersSectionList"}),{slots:r,slotProps:o,elements:a,sectionListRef:i}=n,s=fn(n,JDe),c=eOe(n),u=T.useRef(null),f=cr(t,u),p=b=>{if(!u.current)throw new Error(`MUI X: Cannot call sectionListRef.${b} before the mount of the component.`);return u.current};T.useImperativeHandle(i,()=>({getRoot(){return p("getRoot")},getSectionContainer(b){return p("getSectionContainer").querySelector(`.${Cg.section}[data-sectionindex="${b}"]`)},getSectionContent(b){return p("getSectionContent").querySelector(`.${Cg.section}[data-sectionindex="${b}"] .${Cg.sectionContent}`)},getSectionIndexFromDOMElement(b){const x=p("getSectionIndexFromDOMElement");if(b==null||!x.contains(b))return null;let E=null;return b.classList.contains(Cg.section)?E=b:b.classList.contains(Cg.sectionContent)&&(E=b.parentElement),E==null?null:Number(E.dataset.sectionindex)}}));const y=r?.root??s9,g=mr({elementType:y,externalSlotProps:o?.root,externalForwardedProps:s,additionalProps:{ref:f,suppressContentEditableWarning:!0},className:c.root,ownerState:{}});return m.jsx(y,pe({},g,{children:g.contentEditable?a.map(({content:b,before:x,after:E})=>`${x.children}${b.children}${E.children}`).join(""):m.jsx(T.Fragment,{children:a.map((b,x)=>m.jsx(tOe,{slots:r,slotProps:o,element:b,classes:c},x))})}))}),rOe=["elements","areAllSectionsEmpty","defaultValue","label","value","onChange","id","autoFocus","endAdornment","startAdornment","renderSuffix","slots","slotProps","contentEditable","tabIndex","onInput","onPaste","onKeyDown","fullWidth","name","readOnly","inputProps","inputRef","sectionListRef"],oOe=e=>Math.round(e*1e5)/1e5,VS=Pe("div",{name:"MuiPickersInputBase",slot:"Root",overridesResolver:(e,t)=>t.root})(({theme:e})=>pe({},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:`${oOe(.15/16)}em`,variants:[{props:{fullWidth:!0},style:{width:"100%"}}]})),cO=Pe(s9,{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}}]})),aOe=Pe(l9,{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"})),iOe=Pe(u9,{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"})),sOe=Pe(c9,{name:"MuiPickersInputBase",slot:"Separator",overridesResolver:(e,t)=>t.separator})(()=>({whiteSpace:"pre",letterSpacing:"inherit"})),lOe=Pe("input",{name:"MuiPickersInputBase",slot:"Input",overridesResolver:(e,t)=>t.hiddenInput})(pe({},P2e)),cOe=e=>{const{focused:t,disabled:n,error:r,classes:o,fullWidth:a,readOnly:i,color:s,size:c,endAdornment:u,startAdornment:f}=e,p={root:["root",t&&!n&&"focused",n&&"disabled",i&&"readOnly",r&&"error",a&&"fullWidth",`color${bt(s)}`,c==="small"&&"inputSizeSmall",!!f&&"adornedStart",!!u&&"adornedEnd"],notchedOutline:["notchedOutline"],input:["input"],sectionsContainer:["sectionsContainer"],sectionContent:["sectionContent"],sectionBefore:["sectionBefore"],sectionAfter:["sectionAfter"]};return zt(p,XDe,o)},uO=T.forwardRef(function(e,t){const n=Vr({props:e,name:"MuiPickersInputBase"}),{elements:r,areAllSectionsEmpty:o,value:a,onChange:i,id:s,endAdornment:c,startAdornment:u,renderSuffix:f,slots:p,slotProps:y,contentEditable:g,tabIndex:b,onInput:x,onPaste:E,onKeyDown:S,name:w,readOnly:C,inputProps:R,inputRef:M,sectionListRef:D}=n,I=fn(n,rOe),L=T.useRef(null),F=cr(t,L),B=cr(R?.ref,M),U=js(),k=Oi();if(!k)throw new Error("MUI X: PickersInputBase should always be used inside a PickersTextField component");const $=te=>{if(k.disabled){te.stopPropagation();return}k.onFocus?.(te)};T.useEffect(()=>{k&&k.setAdornedStart(!!u)},[k,u]),T.useEffect(()=>{k&&(o?k.onEmpty():k.onFilled())},[k,o]);const j=pe({},n,k,{isRtl:U}),V=cOe(j),z=p?.root||VS,K=mr({elementType:z,externalSlotProps:y?.root,externalForwardedProps:I,additionalProps:{"aria-invalid":k.error,ref:F},className:V.root,ownerState:j}),Y=p?.input||cO;return m.jsxs(z,pe({},K,{children:[u,m.jsx(nOe,{sectionListRef:D,elements:r,contentEditable:g,tabIndex:b,className:V.sectionsContainer,onFocus:$,onBlur:k.onBlur,onInput:x,onPaste:E,onKeyDown:S,slots:{root:Y,section:aOe,sectionContent:iOe,sectionSeparator:sOe},slotProps:{root:{ownerState:j},sectionContent:{className:Np.sectionContent},sectionSeparator:({position:te})=>({className:te==="before"?Np.sectionBefore:Np.sectionAfter})}}),c,f?f(pe({},k)):null,m.jsx(lOe,pe({name:w,className:V.input,value:a,onChange:i,id:s,"aria-hidden":"true",tabIndex:-1,readOnly:C,required:k.required,disabled:k.disabled},R,{ref:B}))]}))});function uOe(e){return Ut("MuiPickersOutlinedInput",e)}const ks=pe({},Np,Lt("MuiPickersOutlinedInput",["root","notchedOutline","input"])),dOe=["children","className","label","notched","shrink"],fOe=Pe("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}}),u4=Pe("span")(({theme:e})=>({fontFamily:e.typography.fontFamily,fontSize:"inherit"})),pOe=Pe("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 hOe(e){const{className:t,label:n}=e,r=fn(e,dOe),o=n!=null&&n!=="",a=pe({},e,{withLabel:o});return m.jsx(fOe,pe({"aria-hidden":!0,className:t},r,{ownerState:a,children:m.jsx(pOe,{ownerState:a,children:o?m.jsx(u4,{children:n}):m.jsx(u4,{className:"notranslate",children:"​"})})}))}const mOe=["label","autoFocus","ownerState","notched"],gOe=Pe(VS,{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 .${ks.notchedOutline}`]:{borderColor:(e.vars||e).palette.text.primary},"@media (hover: none)":{[`&:hover .${ks.notchedOutline}`]:{borderColor:e.vars?`rgba(${e.vars.palette.common.onBackgroundChannel} / 0.23)`:t}},[`&.${ks.focused} .${ks.notchedOutline}`]:{borderStyle:"solid",borderWidth:2},[`&.${ks.disabled}`]:{[`& .${ks.notchedOutline}`]:{borderColor:(e.vars||e).palette.action.disabled},"*":{color:(e.vars||e).palette.action.disabled}},[`&.${ks.error} .${ks.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:{[`&.${ks.focused}:not(.${ks.error}) .${ks.notchedOutline}`]:{borderColor:(e.vars||e).palette[n].main}}}))}}),yOe=Pe(cO,{name:"MuiPickersOutlinedInput",slot:"SectionsContainer",overridesResolver:(e,t)=>t.sectionsContainer})({padding:"16.5px 0",variants:[{props:{size:"small"},style:{padding:"8.5px 0"}}]}),bOe=e=>{const{classes:t}=e,n=zt({root:["root"],notchedOutline:["notchedOutline"],input:["input"]},uOe,t);return pe({},t,n)},d9=T.forwardRef(function(e,t){const n=Vr({props:e,name:"MuiPickersOutlinedInput"}),{label:r,ownerState:o,notched:a}=n,i=fn(n,mOe),s=Oi(),c=pe({},n,o,s,{color:s?.color||"primary"}),u=bOe(c);return m.jsx(uO,pe({slots:{root:gOe,input:yOe},renderSuffix:f=>m.jsx(hOe,{shrink:!!(a||f.adornedStart||f.focused||f.filled),notched:!!(a||f.adornedStart||f.focused||f.filled),className:u.notchedOutline,label:r!=null&&r!==""&&s?.required?m.jsxs(T.Fragment,{children:[r," ","*"]}):r,ownerState:c})},i,{label:r,classes:u,ref:t}))});d9.muiName="Input";function vOe(e){return Ut("MuiPickersFilledInput",e)}const ud=pe({},Np,Lt("MuiPickersFilledInput",["root","underline","input"])),xOe=["label","autoFocus","disableUnderline","ownerState"],SOe=Pe(VS,{name:"MuiPickersFilledInput",slot:"Root",overridesResolver:(e,t)=>t.root,shouldForwardProp:e=>Hg(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}},[`&.${ud.focused}`]:{backgroundColor:e.vars?e.vars.palette.FilledInput.bg:r},[`&.${ud.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"},[`&.${ud.focused}:after`]:{transform:"scaleX(1) translateX(0)"},[`&.${ud.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(.${ud.disabled}, .${ud.error}):before`]:{borderBottom:`1px solid ${(e.vars||e).palette.text.primary}`},[`&.${ud.disabled}:before`]:{borderBottomStyle:"dotted"}}},{props:({startAdornment:i})=>!!i,style:{paddingLeft:12}},{props:({endAdornment:i})=>!!i,style:{paddingRight:12}}]}}),EOe=Pe(cO,{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}}]}),COe=e=>{const{classes:t,disableUnderline:n}=e,r=zt({root:["root",!n&&"underline"],input:["input"]},vOe,t);return pe({},t,r)},f9=T.forwardRef(function(e,t){const n=Vr({props:e,name:"MuiPickersFilledInput"}),{label:r,disableUnderline:o=!1,ownerState:a}=n,i=fn(n,xOe),s=Oi(),c=pe({},n,a,s,{color:s?.color||"primary"}),u=COe(c);return m.jsx(uO,pe({slots:{root:SOe,input:EOe},slotProps:{root:{disableUnderline:o}}},i,{label:r,classes:u,ref:t}))});f9.muiName="Input";function TOe(e){return Ut("MuiPickersFilledInput",e)}const Tg=pe({},Np,Lt("MuiPickersInput",["root","input"])),wOe=["label","autoFocus","disableUnderline","ownerState"],kOe=Pe(VS,{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"},[`&.${Tg.focused}:after`]:{transform:"scaleX(1) translateX(0)"},[`&.${Tg.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(.${Tg.disabled}, .${Tg.error}):before`]:{borderBottom:`2px solid ${(e.vars||e).palette.text.primary}`,"@media (hover: none)":{borderBottom:`1px solid ${t}`}},[`&.${Tg.disabled}:before`]:{borderBottomStyle:"dotted"}}}]}}),AOe=e=>{const{classes:t,disableUnderline:n}=e,r=zt({root:["root",!n&&"underline"],input:["input"]},TOe,t);return pe({},t,r)},p9=T.forwardRef(function(e,t){const n=Vr({props:e,name:"MuiPickersInput"}),{label:r,disableUnderline:o=!1,ownerState:a}=n,i=fn(n,wOe),s=Oi(),c=pe({},n,a,s,{disableUnderline:o,color:s?.color||"primary"}),u=AOe(c);return m.jsx(uO,pe({slots:{root:kOe}},i,{label:r,classes:u,ref:t}))});p9.muiName="Input";const DOe=["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"],OOe={standard:p9,filled:f9,outlined:d9},ROe=Pe(ix,{name:"MuiPickersTextField",slot:"Root",overridesResolver:(e,t)=>t.root})({maxWidth:"100%"}),MOe=e=>{const{focused:t,disabled:n,classes:r,required:o}=e;return zt({root:["root",t&&!n&&"focused",n&&"disabled",o&&"required"]},QDe,r)},NOe=T.forwardRef(function(e,t){const n=Vr({props:e,name:"MuiPickersTextField"}),{onFocus:r,onBlur:o,className:a,color:i="primary",disabled:s=!1,error:c=!1,variant:u="outlined",required:f=!1,InputProps:p,inputProps:y,inputRef:g,sectionListRef:b,elements:x,areAllSectionsEmpty:E,onClick:S,onKeyDown:w,onKeyUp:C,onPaste:R,onInput:M,endAdornment:D,startAdornment:I,tabIndex:L,contentEditable:F,focused:B,value:U,onChange:k,fullWidth:$,id:j,name:V,helperText:z,FormHelperTextProps:K,label:Y,InputLabelProps:te}=n,_=fn(n,DOe),Z=T.useRef(null),J=cr(t,Z),W=Bs(j),re=z&&W?`${W}-helper-text`:void 0,ne=Y&&W?`${W}-label`:void 0,X=pe({},n,{color:i,disabled:s,error:c,focused:B,required:f,variant:u}),ie=MOe(X),ae=OOe[u];return m.jsxs(ROe,pe({className:Ot(ie.root,a),ref:J,focused:B,onFocus:r,onBlur:o,disabled:s,variant:u,error:c,color:i,fullWidth:$,required:f,ownerState:X},_,{children:[m.jsx(sx,pe({htmlFor:W,id:ne},te,{children:Y})),m.jsx(ae,pe({elements:x,areAllSectionsEmpty:E,onClick:S,onKeyDown:w,onKeyUp:C,onInput:M,onPaste:R,endAdornment:D,startAdornment:I,tabIndex:L,contentEditable:F,value:U,onChange:k,id:W,fullWidth:$,inputProps:y,inputRef:g,sectionListRef:b,label:Y,name:V,role:"group","aria-labelledby":ne,"aria-describedby":re,"aria-live":re?"polite":void 0},p)),z&&m.jsx(v$,pe({id:re},K,{children:z}))]}))}),POe=["enableAccessibleFieldDOMStructure"],IOe=["InputProps","readOnly"],_Oe=["onPaste","onKeyDown","inputMode","readOnly","InputProps","inputProps","inputRef"],LOe=e=>{let{enableAccessibleFieldDOMStructure:t}=e,n=fn(e,POe);if(t){const{InputProps:p,readOnly:y}=n,g=fn(n,IOe);return pe({},g,{InputProps:pe({},p??{},{readOnly:y})})}const{onPaste:r,onKeyDown:o,inputMode:a,readOnly:i,InputProps:s,inputProps:c,inputRef:u}=n,f=fn(n,_Oe);return pe({},f,{InputProps:pe({},s??{},{readOnly:i}),inputProps:pe({},c??{},{inputMode:a,onPaste:r,onKeyDown:o,ref:u})})},FOe=["slots","slotProps","InputProps","inputProps"],h9=T.forwardRef(function(e,t){const n=Vr({props:e,name:"MuiDateField"}),{slots:r,slotProps:o,InputProps:a,inputProps:i}=n,s=fn(n,FOe),c=n,u=r?.textField??(e.enableAccessibleFieldDOMStructure?NOe:Wn),f=mr({elementType:u,externalSlotProps:o?.textField,externalForwardedProps:s,additionalProps:{ref:t},ownerState:c});f.inputProps=pe({},i,f.inputProps),f.InputProps=pe({},a,f.InputProps);const p=KDe(f),y=LOe(p),g=WDe(pe({},y,{slots:r,slotProps:o}));return m.jsx(u,pe({},g))}),m9=({shouldDisableDate:e,shouldDisableMonth:t,shouldDisableYear:n,minDate:r,maxDate:o,disableFuture:a,disablePast:i,timezone:s})=>{const c=sf();return T.useCallback(u=>Ib({adapter:c,value:u,timezone:s,props:{shouldDisableDate:e,shouldDisableMonth:t,shouldDisableYear:n,minDate:r,maxDate:o,disableFuture:a,disablePast:i}})!==null,[c,e,t,n,r,o,a,i,s])},jOe=(e,t,n)=>(r,o)=>{switch(o.type){case"changeMonth":return pe({},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))),pe({},r,{currentMonth:i})}case"finishMonthSwitchingAnimation":return pe({},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 pe({},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")}},BOe=e=>{const{value:t,referenceDate:n,disableFuture:r,disablePast:o,disableSwitchToMonthOnDayFocus:a=!1,maxDate:i,minDate:s,onMonthChange:c,reduceAnimations:u,shouldDisableDate:f,timezone:p}=e,y=Wr(),g=T.useRef(jOe(!!u,a,y)).current,b=T.useMemo(()=>Sl.getInitialReferenceValue({value:t,utils:y,timezone:p,props:e,referenceDate:n,granularity:sl.day}),[n,p]),[x,E]=T.useReducer(g,{isMonthSwitchingAnimating:!1,focusedDay:b,currentMonth:y.startOfMonth(b),slideDirection:"left"});T.useEffect(()=>{E({type:"changeMonthTimezone",newTimezone:y.getTimezone(b)})},[b,y]);const S=T.useCallback(D=>{E(pe({type:"changeMonth"},D)),c&&c(D.newMonth)},[c]),w=T.useCallback(D=>{const I=D;y.isSameMonth(I,x.currentMonth)||S({newMonth:y.startOfMonth(I),direction:y.isAfterDay(I,x.currentMonth)?"left":"right"})},[x.currentMonth,S,y]),C=m9({shouldDisableDate:f,minDate:s,maxDate:i,disableFuture:r,disablePast:o,timezone:p}),R=T.useCallback(()=>{E({type:"finishMonthSwitchingAnimation"})},[]),M=Pt((D,I)=>{C(D)||E({type:"changeFocusedDay",focusedDay:D,withoutMonthSwitchingAnimation:I})});return{referenceDate:b,calendarState:x,changeMonth:w,changeFocusedDay:M,isDateDisabled:C,onMonthSwitchingAnimationEnd:R,handleChangeMonth:S}},$Oe=e=>Ut("MuiPickersFadeTransitionGroup",e);Lt("MuiPickersFadeTransitionGroup",["root"]);const zOe=e=>{const{classes:t}=e;return zt({root:["root"]},$Oe,t)},HOe=Pe(Ob,{name:"MuiPickersFadeTransitionGroup",slot:"Root",overridesResolver:(e,t)=>t.root})({display:"block",position:"relative"});function g9(e){const t=Vr({props:e,name:"MuiPickersFadeTransitionGroup"}),{children:n,className:r,reduceAnimations:o,transKey:a}=t,i=zOe(t),s=_u();return o?n:m.jsx(HOe,{className:Ot(i.root,r),children:m.jsx(qd,{appear:!1,mountOnEnter:!0,unmountOnExit:!0,timeout:{appear:s.transitions.duration.enteringScreen,enter:s.transitions.duration.enteringScreen,exit:0},children:n},a)})}function UOe(e){return Ut("MuiPickersDay",e)}const dd=Lt("MuiPickersDay",["root","dayWithMargin","dayOutsideMonth","hiddenDaySpacingFiller","today","selected","disabled"]),VOe=["autoFocus","className","day","disabled","disableHighlightToday","disableMargin","hidden","isAnimating","onClick","onDaySelect","onFocus","onBlur","onKeyDown","onMouseDown","onMouseEnter","outsideCurrentMonth","selected","showDaysOutsideCurrentMonth","children","today","isFirstVisibleCell","isLastVisibleCell"],WOe=e=>{const{selected:t,disableMargin:n,disableHighlightToday:r,today:o,disabled:a,outsideCurrentMonth:i,showDaysOutsideCurrentMonth:s,classes:c}=e,u=i&&!s;return zt({root:["root",t&&!u&&"selected",a&&"disabled",!n&&"dayWithMargin",!r&&o&&"today",i&&s&&"dayOutsideMonth",u&&"hiddenDaySpacingFiller"],hiddenDaySpacingFiller:["hiddenDaySpacingFiller"]},UOe,c)},y9=({theme:e})=>pe({},e.typography.caption,{width:Ky,height:Ky,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})`:Do(e.palette.primary.main,e.palette.action.hoverOpacity)}},"&:focus":{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / ${e.vars.palette.action.focusOpacity})`:Do(e.palette.primary.main,e.palette.action.focusOpacity),[`&.${dd.selected}`]:{willChange:"background-color",backgroundColor:(e.vars||e).palette.primary.dark}},[`&.${dd.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}},[`&.${dd.disabled}:not(.${dd.selected})`]:{color:(e.vars||e).palette.text.disabled},[`&.${dd.disabled}&.${dd.selected}`]:{opacity:.6},variants:[{props:{disableMargin:!1},style:{margin:`0 ${HS}px`}},{props:{outsideCurrentMonth:!0,showDaysOutsideCurrentMonth:!0},style:{color:(e.vars||e).palette.text.secondary}},{props:{disableHighlightToday:!1,today:!0},style:{[`&:not(.${dd.selected})`]:{border:`1px solid ${(e.vars||e).palette.text.secondary}`}}}]}),b9=(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]},qOe=Pe(Wd,{name:"MuiPickersDay",slot:"Root",overridesResolver:b9})(y9),GOe=Pe("div",{name:"MuiPickersDay",slot:"Root",overridesResolver:b9})(({theme:e})=>pe({},y9({theme:e}),{opacity:0,pointerEvents:"none"})),wg=()=>{},YOe=T.forwardRef(function(e,t){const n=Vr({props:e,name:"MuiPickersDay"}),{autoFocus:r=!1,className:o,day:a,disabled:i=!1,disableHighlightToday:s=!1,disableMargin:c=!1,isAnimating:u,onClick:f,onDaySelect:p,onFocus:y=wg,onBlur:g=wg,onKeyDown:b=wg,onMouseDown:x=wg,onMouseEnter:E=wg,outsideCurrentMonth:S,selected:w=!1,showDaysOutsideCurrentMonth:C=!1,children:R,today:M=!1}=n,D=fn(n,VOe),I=pe({},n,{autoFocus:r,disabled:i,disableHighlightToday:s,disableMargin:c,selected:w,showDaysOutsideCurrentMonth:C,today:M}),L=WOe(I),F=Wr(),B=T.useRef(null),U=cr(B,t);Io(()=>{r&&!i&&!u&&!S&&B.current.focus()},[r,i,u,S]);const k=j=>{x(j),S&&j.preventDefault()},$=j=>{i||p(a),S&&j.currentTarget.focus(),f&&f(j)};return S&&!C?m.jsx(GOe,{className:Ot(L.root,L.hiddenDaySpacingFiller,o),ownerState:I,role:D.role}):m.jsx(qOe,pe({className:Ot(L.root,o),ref:U,centerRipple:!0,disabled:i,tabIndex:w?0:-1,onKeyDown:j=>b(j,a),onFocus:j=>y(j,a),onBlur:j=>g(j,a),onMouseEnter:j=>E(j,a),onClick:$,onMouseDown:k},D,{ownerState:I,children:R||F.format(a,"dayOfMonth")}))}),KOe=T.memo(YOe),QOe=e=>Ut("MuiPickersSlideTransition",e),zi=Lt("MuiPickersSlideTransition",["root","slideEnter-left","slideEnter-right","slideEnterActive","slideExit","slideExitActiveLeft-left","slideExitActiveLeft-right"]),XOe=["children","className","reduceAnimations","slideDirection","transKey","classes"],ZOe=e=>{const{classes:t,slideDirection:n}=e,r={root:["root"],exit:["slideExit"],enterActive:["slideEnterActive"],enter:[`slideEnter-${n}`],exitActive:[`slideExitActiveLeft-${n}`]};return zt(r,QOe,t)},JOe=Pe(Ob,{name:"MuiPickersSlideTransition",slot:"Root",overridesResolver:(e,t)=>[t.root,{[`.${zi["slideEnter-left"]}`]:t["slideEnter-left"]},{[`.${zi["slideEnter-right"]}`]:t["slideEnter-right"]},{[`.${zi.slideEnterActive}`]:t.slideEnterActive},{[`.${zi.slideExit}`]:t.slideExit},{[`.${zi["slideExitActiveLeft-left"]}`]:t["slideExitActiveLeft-left"]},{[`.${zi["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},[`& .${zi["slideEnter-left"]}`]:{willChange:"transform",transform:"translate(100%)",zIndex:1},[`& .${zi["slideEnter-right"]}`]:{willChange:"transform",transform:"translate(-100%)",zIndex:1},[`& .${zi.slideEnterActive}`]:{transform:"translate(0%)",transition:t},[`& .${zi.slideExit}`]:{transform:"translate(0%)"},[`& .${zi["slideExitActiveLeft-left"]}`]:{willChange:"transform",transform:"translate(-100%)",transition:t,zIndex:0},[`& .${zi["slideExitActiveLeft-right"]}`]:{willChange:"transform",transform:"translate(100%)",transition:t,zIndex:0}}});function eRe(e){const t=Vr({props:e,name:"MuiPickersSlideTransition"}),{children:n,className:r,reduceAnimations:o,transKey:a}=t,i=fn(t,XOe),s=ZOe(t),c=_u();if(o)return m.jsx("div",{className:Ot(s.root,r),children:n});const u={exit:s.exit,enterActive:s.enterActive,enter:s.enter,exitActive:s.exitActive};return m.jsx(JOe,{className:Ot(s.root,r),childFactory:f=>T.cloneElement(f,{classNames:u}),role:"presentation",children:m.jsx(PD,pe({mountOnEnter:!0,unmountOnExit:!0,timeout:c.transitions.duration.complex,classNames:u},i,{children:n}),a)})}const tRe=e=>Ut("MuiDayCalendar",e);Lt("MuiDayCalendar",["root","header","weekDayLabel","loadingContainer","slideTransition","monthContainer","weekContainer","weekNumberLabel","weekNumber"]);const nRe=["parentProps","day","focusableDay","selectedDays","isDateDisabled","currentMonthNumber","isViewFocused"],rRe=["ownerState"],oRe=e=>{const{classes:t}=e;return zt({root:["root"],header:["header"],weekDayLabel:["weekDayLabel"],loadingContainer:["loadingContainer"],slideTransition:["slideTransition"],monthContainer:["monthContainer"],weekContainer:["weekContainer"],weekNumberLabel:["weekNumberLabel"],weekNumber:["weekNumber"]},tRe,t)},v9=(Ky+HS*2)*6,aRe=Pe("div",{name:"MuiDayCalendar",slot:"Root",overridesResolver:(e,t)=>t.root})({}),iRe=Pe("div",{name:"MuiDayCalendar",slot:"Header",overridesResolver:(e,t)=>t.header})({display:"flex",justifyContent:"center",alignItems:"center"}),sRe=Pe(lr,{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})),lRe=Pe(lr,{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})),cRe=Pe(lr,{name:"MuiDayCalendar",slot:"WeekNumber",overridesResolver:(e,t)=>t.weekNumber})(({theme:e})=>pe({},e.typography.caption,{width:Ky,height:Ky,padding:0,margin:`0 ${HS}px`,color:e.palette.text.disabled,fontSize:"0.75rem",alignItems:"center",justifyContent:"center",display:"inline-flex"})),uRe=Pe("div",{name:"MuiDayCalendar",slot:"LoadingContainer",overridesResolver:(e,t)=>t.loadingContainer})({display:"flex",justifyContent:"center",alignItems:"center",minHeight:v9}),dRe=Pe(eRe,{name:"MuiDayCalendar",slot:"SlideTransition",overridesResolver:(e,t)=>t.slideTransition})({minHeight:v9}),fRe=Pe("div",{name:"MuiDayCalendar",slot:"MonthContainer",overridesResolver:(e,t)=>t.monthContainer})({overflow:"hidden"}),pRe=Pe("div",{name:"MuiDayCalendar",slot:"WeekContainer",overridesResolver:(e,t)=>t.weekContainer})({margin:`${HS}px 0`,display:"flex",justifyContent:"center"});function hRe(e){let{parentProps:t,day:n,focusableDay:r,selectedDays:o,isDateDisabled:a,currentMonthNumber:i,isViewFocused:s}=e,c=fn(e,nRe);const{disabled:u,disableHighlightToday:f,isMonthSwitchingAnimating:p,showDaysOutsideCurrentMonth:y,slots:g,slotProps:b,timezone:x}=t,E=Wr(),S=zS(x),w=r!==null&&E.isSameDay(n,r),C=o.some(k=>E.isSameDay(k,n)),R=E.isSameDay(n,S),M=g?.day??KOe,D=mr({elementType:M,externalSlotProps:b?.day,additionalProps:pe({disableHighlightToday:f,showDaysOutsideCurrentMonth:y,role:"gridcell",isAnimating:p,"data-timestamp":E.toJsDate(n).valueOf()},c),ownerState:pe({},t,{day:n,selected:C})}),I=fn(D,rRe),L=T.useMemo(()=>u||a(n),[u,a,n]),F=T.useMemo(()=>E.getMonth(n)!==i,[E,n,i]),B=T.useMemo(()=>{const k=E.startOfMonth(E.setMonth(n,i));return y?E.isSameDay(n,E.startOfWeek(k)):E.isSameDay(n,k)},[i,n,y,E]),U=T.useMemo(()=>{const k=E.endOfMonth(E.setMonth(n,i));return y?E.isSameDay(n,E.endOfWeek(k)):E.isSameDay(n,k)},[i,n,y,E]);return m.jsx(M,pe({},I,{day:n,disabled:L,autoFocus:s&&w,today:R,outsideCurrentMonth:F,isFirstVisibleCell:B,isLastVisibleCell:U,selected:C,tabIndex:w?0:-1,"aria-selected":C,"aria-current":R?"date":void 0}))}function mRe(e){const t=Vr({props:e,name:"MuiDayCalendar"}),n=Wr(),{onFocusedDayChange:r,className:o,currentMonth:a,selectedDays:i,focusedDay:s,loading:c,onSelectedDaysChange:u,onMonthSwitchingAnimationEnd:f,readOnly:p,reduceAnimations:y,renderLoading:g=()=>m.jsx("span",{children:"..."}),slideDirection:b,TransitionProps:x,disablePast:E,disableFuture:S,minDate:w,maxDate:C,shouldDisableDate:R,shouldDisableMonth:M,shouldDisableYear:D,dayOfWeekFormatter:I=Me=>n.format(Me,"weekdayShort").charAt(0).toUpperCase(),hasFocus:L,onFocusedViewChange:F,gridLabelId:B,displayWeekNumber:U,fixedWeekNumber:k,autoFocus:$,timezone:j}=t,V=zS(j),z=oRe(t),K=js(),Y=m9({shouldDisableDate:R,shouldDisableMonth:M,shouldDisableYear:D,minDate:w,maxDate:C,disablePast:E,disableFuture:S,timezone:j}),te=yc(),[_,Z]=xi({name:"DayCalendar",state:"hasFocus",controlled:L,default:$??!1}),[J,W]=T.useState(()=>s||V),re=Pt(Me=>{p||u(Me)}),ne=Me=>{Y(Me)||(r(Me),W(Me),F?.(!0),Z(!0))},X=Pt((Me,we)=>{switch(Me.key){case"ArrowUp":ne(n.addDays(we,-7)),Me.preventDefault();break;case"ArrowDown":ne(n.addDays(we,7)),Me.preventDefault();break;case"ArrowLeft":{const Se=n.addDays(we,K?1:-1),dt=n.addMonths(we,K?1:-1),ze=gy({utils:n,date:Se,minDate:K?Se:n.startOfMonth(dt),maxDate:K?n.endOfMonth(dt):Se,isDateDisabled:Y,timezone:j});ne(ze||Se),Me.preventDefault();break}case"ArrowRight":{const Se=n.addDays(we,K?-1:1),dt=n.addMonths(we,K?-1:1),ze=gy({utils:n,date:Se,minDate:K?n.startOfMonth(dt):Se,maxDate:K?Se:n.endOfMonth(dt),isDateDisabled:Y,timezone:j});ne(ze||Se),Me.preventDefault();break}case"Home":ne(n.startOfWeek(we)),Me.preventDefault();break;case"End":ne(n.endOfWeek(we)),Me.preventDefault();break;case"PageUp":ne(n.addMonths(we,1)),Me.preventDefault();break;case"PageDown":ne(n.addMonths(we,-1)),Me.preventDefault();break}}),ie=Pt((Me,we)=>ne(we)),ae=Pt((Me,we)=>{_&&n.isSameDay(J,we)&&F?.(!1)}),fe=n.getMonth(a),xe=n.getYear(a),ge=T.useMemo(()=>i.filter(Me=>!!Me).map(Me=>n.startOfDay(Me)),[n,i]),Re=`${xe}-${fe}`,de=T.useMemo(()=>T.createRef(),[Re]),me=T.useMemo(()=>{const Me=n.startOfMonth(a),we=n.endOfMonth(a);return Y(J)||n.isAfterDay(J,we)||n.isBeforeDay(J,Me)?gy({utils:n,date:J,minDate:Me,maxDate:we,disablePast:E,disableFuture:S,isDateDisabled:Y,timezone:j}):J},[a,S,E,J,Y,n,j]),Qe=T.useMemo(()=>{const Me=n.getWeekArray(a);let we=n.addMonths(a,1);for(;k&&Me.length<k;){const Se=n.getWeekArray(we),dt=n.isSameDay(Me[Me.length-1][0],Se[0][0]);Se.slice(dt?1:0).forEach(ze=>{Me.length<k&&Me.push(ze)}),we=n.addMonths(we,1)}return Me},[a,k,n]);return m.jsxs(aRe,{role:"grid","aria-labelledby":B,className:z.root,children:[m.jsxs(iRe,{role:"row",className:z.header,children:[U&&m.jsx(lRe,{variant:"caption",role:"columnheader","aria-label":te.calendarWeekNumberHeaderLabel,className:z.weekNumberLabel,children:te.calendarWeekNumberHeaderText}),j2e(n,V).map((Me,we)=>m.jsx(sRe,{variant:"caption",role:"columnheader","aria-label":n.format(Me,"weekday"),className:z.weekDayLabel,children:I(Me)},we.toString()))]}),c?m.jsx(uRe,{className:z.loadingContainer,children:g()}):m.jsx(dRe,pe({transKey:Re,onExited:f,reduceAnimations:y,slideDirection:b,className:Ot(o,z.slideTransition)},x,{nodeRef:de,children:m.jsx(fRe,{ref:de,role:"rowgroup",className:z.monthContainer,children:Qe.map((Me,we)=>m.jsxs(pRe,{role:"row",className:z.weekContainer,"aria-rowindex":we+1,children:[U&&m.jsx(cRe,{className:z.weekNumber,role:"rowheader","aria-label":te.calendarWeekNumberAriaLabelText(n.getWeekNumber(Me[0])),children:te.calendarWeekNumberText(n.getWeekNumber(Me[0]))}),Me.map((Se,dt)=>m.jsx(hRe,{parentProps:t,day:Se,selectedDays:ge,focusableDay:me,onKeyDown:X,onFocus:ie,onBlur:ae,onDaySelect:re,isDateDisabled:Y,currentMonthNumber:fe,isViewFocused:_,"aria-colindex":dt+1},Se.toString()))]},`week-${Me[0]}`))})}))]})}function gRe(e){return Ut("MuiPickersMonth",e)}const L0=Lt("MuiPickersMonth",["root","monthButton","disabled","selected"]),yRe=["autoFocus","className","children","disabled","selected","value","tabIndex","onClick","onKeyDown","onFocus","onBlur","aria-current","aria-label","monthsPerRow","slots","slotProps"],bRe=e=>{const{disabled:t,selected:n,classes:r}=e;return zt({root:["root"],monthButton:["monthButton",t&&"disabled",n&&"selected"]},gRe,r)},vRe=Pe("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%"}}]}),xRe=Pe("button",{name:"MuiPickersMonth",slot:"MonthButton",overridesResolver:(e,t)=>[t.monthButton,{[`&.${L0.disabled}`]:t.disabled},{[`&.${L0.selected}`]:t.selected}]})(({theme:e})=>pe({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})`:Do(e.palette.action.active,e.palette.action.hoverOpacity)},"&:hover":{backgroundColor:e.vars?`rgba(${e.vars.palette.action.activeChannel} / ${e.vars.palette.action.hoverOpacity})`:Do(e.palette.action.active,e.palette.action.hoverOpacity)},"&:disabled":{cursor:"auto",pointerEvents:"none"},[`&.${L0.disabled}`]:{color:(e.vars||e).palette.text.secondary},[`&.${L0.selected}`]:{color:(e.vars||e).palette.primary.contrastText,backgroundColor:(e.vars||e).palette.primary.main,"&:focus, &:hover":{backgroundColor:(e.vars||e).palette.primary.dark}}})),SRe=T.memo(function(e){const t=Vr({props:e,name:"MuiPickersMonth"}),{autoFocus:n,className:r,children:o,disabled:a,selected:i,value:s,tabIndex:c,onClick:u,onKeyDown:f,onFocus:p,onBlur:y,"aria-current":g,"aria-label":b,slots:x,slotProps:E}=t,S=fn(t,yRe),w=T.useRef(null),C=bRe(t);Io(()=>{n&&w.current?.focus()},[n]);const R=x?.monthButton??xRe,M=mr({elementType:R,externalSlotProps:E?.monthButton,additionalProps:{children:o,disabled:a,tabIndex:c,ref:w,type:"button",role:"radio","aria-current":g,"aria-checked":i,"aria-label":b,onClick:D=>u(D,s),onKeyDown:D=>f(D,s),onFocus:D=>p(D,s),onBlur:D=>y(D,s)},ownerState:t,className:C.monthButton});return m.jsx(vRe,pe({className:Ot(C.root,r),ownerState:t},S,{children:m.jsx(R,pe({},M))}))});function ERe(e){return Ut("MuiMonthCalendar",e)}Lt("MuiMonthCalendar",["root"]);const CRe=["className","value","defaultValue","referenceDate","disabled","disableFuture","disablePast","maxDate","minDate","onChange","shouldDisableMonth","readOnly","disableHighlightToday","autoFocus","onMonthFocus","hasFocus","onFocusedViewChange","monthsPerRow","timezone","gridLabelId","slots","slotProps"],TRe=e=>{const{classes:t}=e;return zt({root:["root"]},ERe,t)};function wRe(e,t){const n=Wr(),r=Pb(),o=Vr({props:e,name:t});return pe({disableFuture:!1,disablePast:!1},o,{minDate:cs(n,o.minDate,r.minDate),maxDate:cs(n,o.maxDate,r.maxDate)})}const kRe=Pe("div",{name:"MuiMonthCalendar",slot:"Root",overridesResolver:(e,t)=>t.root})({display:"flex",flexWrap:"wrap",alignContent:"stretch",padding:"0 4px",width:US,boxSizing:"border-box"}),ARe=T.forwardRef(function(e,t){const n=wRe(e,"MuiMonthCalendar"),{className:r,value:o,defaultValue:a,referenceDate:i,disabled:s,disableFuture:c,disablePast:u,maxDate:f,minDate:p,onChange:y,shouldDisableMonth:g,readOnly:b,autoFocus:x=!1,onMonthFocus:E,hasFocus:S,onFocusedViewChange:w,monthsPerRow:C=3,timezone:R,gridLabelId:M,slots:D,slotProps:I}=n,L=fn(n,CRe),{value:F,handleValueChange:B,timezone:U}=sO({name:"MonthCalendar",timezone:R,value:o,defaultValue:a,referenceDate:i,onChange:y,valueManager:Sl}),k=zS(U),$=js(),j=Wr(),V=T.useMemo(()=>Sl.getInitialReferenceValue({value:F,utils:j,props:n,timezone:U,referenceDate:i,granularity:sl.month}),[]),z=n,K=TRe(z),Y=T.useMemo(()=>j.getMonth(k),[j,k]),te=T.useMemo(()=>F!=null?j.getMonth(F):null,[F,j]),[_,Z]=T.useState(()=>te||j.getMonth(V)),[J,W]=xi({name:"MonthCalendar",state:"hasFocus",controlled:S,default:x??!1}),re=Pt(ge=>{W(ge),w&&w(ge)}),ne=T.useCallback(ge=>{const Re=j.startOfMonth(u&&j.isAfter(k,p)?k:p),de=j.startOfMonth(c&&j.isBefore(k,f)?k:f),me=j.startOfMonth(ge);return j.isBefore(me,Re)||j.isAfter(me,de)?!0:g?g(me):!1},[c,u,f,p,k,g,j]),X=Pt((ge,Re)=>{if(b)return;const de=j.setMonth(F??V,Re);B(de)}),ie=Pt(ge=>{ne(j.setMonth(F??V,ge))||(Z(ge),re(!0),E&&E(ge))});T.useEffect(()=>{Z(ge=>te!==null&&ge!==te?te:ge)},[te]);const ae=Pt((ge,Re)=>{switch(ge.key){case"ArrowUp":ie((12+Re-3)%12),ge.preventDefault();break;case"ArrowDown":ie((12+Re+3)%12),ge.preventDefault();break;case"ArrowLeft":ie((12+Re+($?1:-1))%12),ge.preventDefault();break;case"ArrowRight":ie((12+Re+($?-1:1))%12),ge.preventDefault();break}}),fe=Pt((ge,Re)=>{ie(Re)}),xe=Pt((ge,Re)=>{_===Re&&re(!1)});return m.jsx(kRe,pe({ref:t,className:Ot(K.root,r),ownerState:z,role:"radiogroup","aria-labelledby":M},L,{children:nO(j,F??V).map(ge=>{const Re=j.getMonth(ge),de=j.format(ge,"monthShort"),me=j.format(ge,"month"),Qe=Re===te,Me=s||ne(ge);return m.jsx(SRe,{selected:Qe,value:Re,onClick:X,onKeyDown:ae,autoFocus:J&&Re===_,disabled:Me,tabIndex:Re===_&&!Me?0:-1,onFocus:fe,onBlur:xe,"aria-current":Y===Re?"date":void 0,"aria-label":me,monthsPerRow:C,slots:D,slotProps:I,children:de},de)})}))});function DRe(e){return Ut("MuiPickersYear",e)}const F0=Lt("MuiPickersYear",["root","yearButton","selected","disabled"]),ORe=["autoFocus","className","children","disabled","selected","value","tabIndex","onClick","onKeyDown","onFocus","onBlur","aria-current","yearsPerRow","slots","slotProps"],RRe=e=>{const{disabled:t,selected:n,classes:r}=e;return zt({root:["root"],yearButton:["yearButton",t&&"disabled",n&&"selected"]},DRe,r)},MRe=Pe("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%"}}]}),NRe=Pe("button",{name:"MuiPickersYear",slot:"YearButton",overridesResolver:(e,t)=>[t.yearButton,{[`&.${F0.disabled}`]:t.disabled},{[`&.${F0.selected}`]:t.selected}]})(({theme:e})=>pe({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})`:Do(e.palette.action.active,e.palette.action.focusOpacity)},"&:hover":{backgroundColor:e.vars?`rgba(${e.vars.palette.action.activeChannel} / ${e.vars.palette.action.hoverOpacity})`:Do(e.palette.action.active,e.palette.action.hoverOpacity)},"&:disabled":{cursor:"auto",pointerEvents:"none"},[`&.${F0.disabled}`]:{color:(e.vars||e).palette.text.secondary},[`&.${F0.selected}`]:{color:(e.vars||e).palette.primary.contrastText,backgroundColor:(e.vars||e).palette.primary.main,"&:focus, &:hover":{backgroundColor:(e.vars||e).palette.primary.dark}}})),PRe=T.memo(function(e){const t=Vr({props:e,name:"MuiPickersYear"}),{autoFocus:n,className:r,children:o,disabled:a,selected:i,value:s,tabIndex:c,onClick:u,onKeyDown:f,onFocus:p,onBlur:y,"aria-current":g,slots:b,slotProps:x}=t,E=fn(t,ORe),S=T.useRef(null),w=RRe(t);Io(()=>{n&&S.current?.focus()},[n]);const C=b?.yearButton??NRe,R=mr({elementType:C,externalSlotProps:x?.yearButton,additionalProps:{children:o,disabled:a,tabIndex:c,ref:S,type:"button",role:"radio","aria-current":g,"aria-checked":i,onClick:M=>u(M,s),onKeyDown:M=>f(M,s),onFocus:M=>p(M,s),onBlur:M=>y(M,s)},ownerState:t,className:w.yearButton});return m.jsx(MRe,pe({className:Ot(w.root,r),ownerState:t},E,{children:m.jsx(C,pe({},R))}))});function IRe(e){return Ut("MuiYearCalendar",e)}Lt("MuiYearCalendar",["root"]);const _Re=["autoFocus","className","value","defaultValue","referenceDate","disabled","disableFuture","disablePast","maxDate","minDate","onChange","readOnly","shouldDisableYear","disableHighlightToday","onYearFocus","hasFocus","onFocusedViewChange","yearsOrder","yearsPerRow","timezone","gridLabelId","slots","slotProps"],LRe=e=>{const{classes:t}=e;return zt({root:["root"]},IRe,t)};function FRe(e,t){const n=Wr(),r=Pb(),o=Vr({props:e,name:t});return pe({disablePast:!1,disableFuture:!1},o,{yearsPerRow:o.yearsPerRow??3,minDate:cs(n,o.minDate,r.minDate),maxDate:cs(n,o.maxDate,r.maxDate)})}const jRe=Pe("div",{name:"MuiYearCalendar",slot:"Root",overridesResolver:(e,t)=>t.root})({display:"flex",flexDirection:"row",flexWrap:"wrap",overflowY:"auto",height:"100%",padding:"0 4px",width:US,maxHeight:uDe,boxSizing:"border-box",position:"relative"}),BRe=T.forwardRef(function(e,t){const n=FRe(e,"MuiYearCalendar"),{autoFocus:r,className:o,value:a,defaultValue:i,referenceDate:s,disabled:c,disableFuture:u,disablePast:f,maxDate:p,minDate:y,onChange:g,readOnly:b,shouldDisableYear:x,onYearFocus:E,hasFocus:S,onFocusedViewChange:w,yearsOrder:C="asc",yearsPerRow:R,timezone:M,gridLabelId:D,slots:I,slotProps:L}=n,F=fn(n,_Re),{value:B,handleValueChange:U,timezone:k}=sO({name:"YearCalendar",timezone:M,value:a,defaultValue:i,referenceDate:s,onChange:g,valueManager:Sl}),$=zS(k),j=js(),V=Wr(),z=T.useMemo(()=>Sl.getInitialReferenceValue({value:B,utils:V,props:n,timezone:k,referenceDate:s,granularity:sl.year}),[]),K=n,Y=LRe(K),te=T.useMemo(()=>V.getYear($),[V,$]),_=T.useMemo(()=>B!=null?V.getYear(B):null,[B,V]),[Z,J]=T.useState(()=>_||V.getYear(z)),[W,re]=xi({name:"YearCalendar",state:"hasFocus",controlled:S,default:r??!1}),ne=Pt(we=>{re(we),w&&w(we)}),X=T.useCallback(we=>{if(f&&V.isBeforeYear(we,$)||u&&V.isAfterYear(we,$)||y&&V.isBeforeYear(we,y)||p&&V.isAfterYear(we,p))return!0;if(!x)return!1;const Se=V.startOfYear(we);return x(Se)},[u,f,p,y,$,x,V]),ie=Pt((we,Se)=>{if(b)return;const dt=V.setYear(B??z,Se);U(dt)}),ae=Pt(we=>{X(V.setYear(B??z,we))||(J(we),ne(!0),E?.(we))});T.useEffect(()=>{J(we=>_!==null&&we!==_?_:we)},[_]);const fe=C!=="desc"?R*1:R*-1,xe=j&&C==="asc"||!j&&C==="desc"?-1:1,ge=Pt((we,Se)=>{switch(we.key){case"ArrowUp":ae(Se-fe),we.preventDefault();break;case"ArrowDown":ae(Se+fe),we.preventDefault();break;case"ArrowLeft":ae(Se-xe),we.preventDefault();break;case"ArrowRight":ae(Se+xe),we.preventDefault();break}}),Re=Pt((we,Se)=>{ae(Se)}),de=Pt((we,Se)=>{Z===Se&&ne(!1)}),me=T.useRef(null),Qe=cr(t,me);T.useEffect(()=>{if(r||me.current===null)return;const we=me.current.querySelector('[tabindex="0"]');if(!we)return;const Se=we.offsetHeight,dt=we.offsetTop,ze=me.current.clientHeight,tt=me.current.scrollTop,Ze=dt+Se;Se>ze||dt<tt||(me.current.scrollTop=Ze-ze/2-Se/2)},[r]);const Me=V.getYearRange([y,p]);return C==="desc"&&Me.reverse(),m.jsx(jRe,pe({ref:Qe,className:Ot(Y.root,o),ownerState:K,role:"radiogroup","aria-labelledby":D},F,{children:Me.map(we=>{const Se=V.getYear(we),dt=Se===_,ze=c||X(we);return m.jsx(PRe,{selected:dt,value:Se,onClick:ie,onKeyDown:ge,autoFocus:W&&Se===Z,disabled:ze,tabIndex:Se===Z&&!ze?0:-1,onFocus:Re,onBlur:de,"aria-current":te===Se?"date":void 0,yearsPerRow:R,slots:I,slotProps:L,children:V.format(we,"year")},V.format(we,"year"))})}))}),$Re=e=>Ut("MuiPickersCalendarHeader",e),zRe=Lt("MuiPickersCalendarHeader",["root","labelContainer","label","switchViewButton","switchViewIcon"]);function HRe(e){return Ut("MuiPickersArrowSwitcher",e)}Lt("MuiPickersArrowSwitcher",["root","spacer","button","previousIconButton","nextIconButton","leftArrowIcon","rightArrowIcon"]);const URe=["children","className","slots","slotProps","isNextDisabled","isNextHidden","onGoToNext","nextLabel","isPreviousDisabled","isPreviousHidden","onGoToPrevious","previousLabel","labelId"],VRe=["ownerState"],WRe=["ownerState"],qRe=Pe("div",{name:"MuiPickersArrowSwitcher",slot:"Root",overridesResolver:(e,t)=>t.root})({display:"flex"}),GRe=Pe("div",{name:"MuiPickersArrowSwitcher",slot:"Spacer",overridesResolver:(e,t)=>t.spacer})(({theme:e})=>({width:e.spacing(3)})),d4=Pe(gs,{name:"MuiPickersArrowSwitcher",slot:"Button",overridesResolver:(e,t)=>t.button})({variants:[{props:{hidden:!0},style:{visibility:"hidden"}}]}),YRe=e=>{const{classes:t}=e;return zt({root:["root"],spacer:["spacer"],button:["button"],previousIconButton:["previousIconButton"],nextIconButton:["nextIconButton"],leftArrowIcon:["leftArrowIcon"],rightArrowIcon:["rightArrowIcon"]},HRe,t)},KRe=T.forwardRef(function(e,t){const n=js(),r=Vr({props:e,name:"MuiPickersArrowSwitcher"}),{children:o,className:a,slots:i,slotProps:s,isNextDisabled:c,isNextHidden:u,onGoToNext:f,nextLabel:p,isPreviousDisabled:y,isPreviousHidden:g,onGoToPrevious:b,previousLabel:x,labelId:E}=r,S=fn(r,URe),w=r,C=YRe(w),R={isDisabled:c,isHidden:u,goTo:f,label:p},M={isDisabled:y,isHidden:g,goTo:b,label:x},D=i?.previousIconButton??d4,I=mr({elementType:D,externalSlotProps:s?.previousIconButton,additionalProps:{size:"medium",title:M.label,"aria-label":M.label,disabled:M.isDisabled,edge:"end",onClick:M.goTo},ownerState:pe({},w,{hidden:M.isHidden}),className:Ot(C.button,C.previousIconButton)}),L=i?.nextIconButton??d4,F=mr({elementType:L,externalSlotProps:s?.nextIconButton,additionalProps:{size:"medium",title:R.label,"aria-label":R.label,disabled:R.isDisabled,edge:"start",onClick:R.goTo},ownerState:pe({},w,{hidden:R.isHidden}),className:Ot(C.button,C.nextIconButton)}),B=i?.leftArrowIcon??kDe,U=mr({elementType:B,externalSlotProps:s?.leftArrowIcon,additionalProps:{fontSize:"inherit"},ownerState:w,className:C.leftArrowIcon}),k=fn(U,VRe),$=i?.rightArrowIcon??ADe,j=mr({elementType:$,externalSlotProps:s?.rightArrowIcon,additionalProps:{fontSize:"inherit"},ownerState:w,className:C.rightArrowIcon}),V=fn(j,WRe);return m.jsxs(qRe,pe({ref:t,className:Ot(C.root,a),ownerState:w},S,{children:[m.jsx(D,pe({},I,{children:n?m.jsx($,pe({},V)):m.jsx(B,pe({},k))})),o?m.jsx(lr,{variant:"subtitle1",component:"span",id:E,children:o}):m.jsx(GRe,{className:C.spacer,ownerState:w}),m.jsx(L,pe({},F,{children:n?m.jsx(B,pe({},k)):m.jsx($,pe({},V))}))]}))});function QRe(e,{disableFuture:t,maxDate:n,timezone:r}){const o=Wr();return T.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 XRe(e,{disablePast:t,minDate:n,timezone:r}){const o=Wr();return T.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 ZRe=["slots","slotProps","currentMonth","disabled","disableFuture","disablePast","maxDate","minDate","onMonthChange","onViewChange","view","reduceAnimations","views","labelId","className","timezone","format"],JRe=["ownerState"],eMe=e=>{const{classes:t}=e;return zt({root:["root"],labelContainer:["labelContainer"],label:["label"],switchViewButton:["switchViewButton"],switchViewIcon:["switchViewIcon"]},$Re,t)},tMe=Pe("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}),nMe=Pe("div",{name:"MuiPickersCalendarHeader",slot:"LabelContainer",overridesResolver:(e,t)=>t.labelContainer})(({theme:e})=>pe({display:"flex",overflow:"hidden",alignItems:"center",cursor:"pointer",marginRight:"auto"},e.typography.body1,{fontWeight:e.typography.fontWeightMedium})),rMe=Pe("div",{name:"MuiPickersCalendarHeader",slot:"Label",overridesResolver:(e,t)=>t.label})({marginRight:6}),oMe=Pe(gs,{name:"MuiPickersCalendarHeader",slot:"SwitchViewButton",overridesResolver:(e,t)=>t.switchViewButton})({marginRight:"auto",variants:[{props:{view:"year"},style:{[`.${zRe.switchViewIcon}`]:{transform:"rotate(180deg)"}}}]}),aMe=Pe(wDe,{name:"MuiPickersCalendarHeader",slot:"SwitchViewIcon",overridesResolver:(e,t)=>t.switchViewIcon})(({theme:e})=>({willChange:"transform",transition:e.transitions.create("transform"),transform:"rotate(0deg)"})),iMe=T.forwardRef(function(e,t){const n=yc(),r=Wr(),o=Vr({props:e,name:"MuiPickersCalendarHeader"}),{slots:a,slotProps:i,currentMonth:s,disabled:c,disableFuture:u,disablePast:f,maxDate:p,minDate:y,onMonthChange:g,onViewChange:b,view:x,reduceAnimations:E,views:S,labelId:w,className:C,timezone:R,format:M=`${r.formats.month} ${r.formats.year}`}=o,D=fn(o,ZRe),I=o,L=eMe(o),F=a?.switchViewButton??oMe,B=mr({elementType:F,externalSlotProps:i?.switchViewButton,additionalProps:{size:"small","aria-label":n.calendarViewSwitchingButtonAriaLabel(x)},ownerState:I,className:L.switchViewButton}),U=a?.switchViewIcon??aMe,k=mr({elementType:U,externalSlotProps:i?.switchViewIcon,ownerState:I,className:L.switchViewIcon}),$=fn(k,JRe),j=()=>g(r.addMonths(s,1),"left"),V=()=>g(r.addMonths(s,-1),"right"),z=QRe(s,{disableFuture:u,maxDate:p,timezone:R}),K=XRe(s,{disablePast:f,minDate:y,timezone:R}),Y=()=>{if(!(S.length===1||!b||c))if(S.length===2)b(S.find(_=>_!==x)||S[0]);else{const _=S.indexOf(x)!==0?0:1;b(S[_])}};if(S.length===1&&S[0]==="year")return null;const te=r.formatByString(s,M);return m.jsxs(tMe,pe({},D,{ownerState:I,className:Ot(L.root,C),ref:t,children:[m.jsxs(nMe,{role:"presentation",onClick:Y,ownerState:I,"aria-live":"polite",className:L.labelContainer,children:[m.jsx(g9,{reduceAnimations:E,transKey:te,children:m.jsx(rMe,{id:w,ownerState:I,className:L.label,children:te})}),S.length>1&&!c&&m.jsx(F,pe({},B,{children:m.jsx(U,pe({},$))}))]}),m.jsx(qd,{in:x==="day",appear:!E,enter:!E,children:m.jsx(KRe,{slots:a,slotProps:i,onGoToPrevious:V,isPreviousDisabled:K,previousLabel:n.previousMonth,onGoToNext:j,isNextDisabled:z,nextLabel:n.nextMonth})})]}))}),sMe=Pe("div")({overflow:"hidden",width:US,maxHeight:lO,display:"flex",flexDirection:"column",margin:"0 auto"}),lMe=e=>Ut("MuiDateCalendar",e);Lt("MuiDateCalendar",["root","viewTransitionContainer"]);const cMe=["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"],uMe=e=>{const{classes:t}=e;return zt({root:["root"],viewTransitionContainer:["viewTransitionContainer"]},lMe,t)};function dMe(e,t){const n=Wr(),r=Pb(),o=e9(),a=Vr({props:e,name:t});return pe({},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??(()=>m.jsx("span",{children:"..."})),minDate:cs(n,a.minDate,r.minDate),maxDate:cs(n,a.maxDate,r.maxDate)})}const fMe=Pe(sMe,{name:"MuiDateCalendar",slot:"Root",overridesResolver:(e,t)=>t.root})({display:"flex",flexDirection:"column",height:lO}),pMe=Pe(g9,{name:"MuiDateCalendar",slot:"ViewTransitionContainer",overridesResolver:(e,t)=>t.viewTransitionContainer})({}),hMe=T.forwardRef(function(e,t){const n=Wr(),r=Bs(),o=dMe(e,"MuiDateCalendar"),{autoFocus:a,onViewChange:i,value:s,defaultValue:c,referenceDate:u,disableFuture:f,disablePast:p,onChange:y,onYearChange:g,onMonthChange:b,reduceAnimations:x,shouldDisableDate:E,shouldDisableMonth:S,shouldDisableYear:w,view:C,views:R,openTo:M,className:D,disabled:I,readOnly:L,minDate:F,maxDate:B,disableHighlightToday:U,focusedView:k,onFocusedViewChange:$,showDaysOutsideCurrentMonth:j,fixedWeekNumber:V,dayOfWeekFormatter:z,slots:K,slotProps:Y,loading:te,renderLoading:_,displayWeekNumber:Z,yearsOrder:J,yearsPerRow:W,monthsPerRow:re,timezone:ne}=o,X=fn(o,cMe),{value:ie,handleValueChange:ae,timezone:fe}=sO({name:"DateCalendar",timezone:ne,value:s,defaultValue:c,referenceDate:u,onChange:y,valueManager:Sl}),{view:xe,setView:ge,focusedView:Re,setFocusedView:de,goToNextView:me,setValueAndGoToNextView:Qe}=t9({view:C,views:R,openTo:M,onChange:ae,onViewChange:i,autoFocus:a,focusedView:k,onFocusedViewChange:$}),{referenceDate:Me,calendarState:we,changeFocusedDay:Se,changeMonth:dt,handleChangeMonth:ze,isDateDisabled:tt,onMonthSwitchingAnimationEnd:Ze}=BOe({value:ie,referenceDate:u,reduceAnimations:x,onMonthChange:b,minDate:F,maxDate:B,shouldDisableDate:E,disablePast:p,disableFuture:f,timezone:fe}),qt=I&&ie||F,Vt=I&&ie||B,Mt=`${r}-grid-label`,ke=Re!==null,Ne=K?.calendarHeader??iMe,lt=mr({elementType:Ne,externalSlotProps:Y?.calendarHeader,additionalProps:{views:R,view:xe,currentMonth:we.currentMonth,onViewChange:ge,onMonthChange:(ht,Cn)=>ze({newMonth:ht,direction:Cn}),minDate:qt,maxDate:Vt,disabled:I,disablePast:p,disableFuture:f,reduceAnimations:x,timezone:fe,labelId:Mt},ownerState:o}),St=Pt(ht=>{const Cn=n.startOfMonth(ht),On=n.endOfMonth(ht),In=tt(ht)?gy({utils:n,date:ht,minDate:n.isBefore(F,Cn)?Cn:F,maxDate:n.isAfter(B,On)?On:B,disablePast:p,disableFuture:f,isDateDisabled:tt,timezone:fe}):ht;In?(Qe(In,"finish"),b?.(Cn)):(me(),dt(Cn)),Se(In,!0)}),ft=Pt(ht=>{const Cn=n.startOfYear(ht),On=n.endOfYear(ht),In=tt(ht)?gy({utils:n,date:ht,minDate:n.isBefore(F,Cn)?Cn:F,maxDate:n.isAfter(B,On)?On:B,disablePast:p,disableFuture:f,isDateDisabled:tt,timezone:fe}):ht;In?(Qe(In,"finish"),g?.(In)):(me(),dt(Cn)),Se(In,!0)}),$e=Pt(ht=>ae(ht&&dx(n,ht,ie??Me),"finish",xe));T.useEffect(()=>{ie!=null&&n.isValid(ie)&&dt(ie)},[ie]);const Ht=o,$t=uMe(Ht),pt={disablePast:p,disableFuture:f,maxDate:B,minDate:F},Te={disableHighlightToday:U,readOnly:L,disabled:I,timezone:fe,gridLabelId:Mt,slots:K,slotProps:Y},Ue=T.useRef(xe);T.useEffect(()=>{Ue.current!==xe&&(Re===Ue.current&&de(xe,!0),Ue.current=xe)},[Re,de,xe]);const yt=T.useMemo(()=>[ie],[ie]);return m.jsxs(fMe,pe({ref:t,className:Ot($t.root,D),ownerState:Ht},X,{children:[m.jsx(Ne,pe({},lt,{slots:K,slotProps:Y})),m.jsx(pMe,{reduceAnimations:x,className:$t.viewTransitionContainer,transKey:xe,ownerState:Ht,children:m.jsxs("div",{children:[xe==="year"&&m.jsx(BRe,pe({},pt,Te,{value:ie,onChange:ft,shouldDisableYear:w,hasFocus:ke,onFocusedViewChange:ht=>de("year",ht),yearsOrder:J,yearsPerRow:W,referenceDate:Me})),xe==="month"&&m.jsx(ARe,pe({},pt,Te,{hasFocus:ke,className:D,value:ie,onChange:St,shouldDisableMonth:S,onFocusedViewChange:ht=>de("month",ht),monthsPerRow:re,referenceDate:Me})),xe==="day"&&m.jsx(mRe,pe({},we,pt,Te,{onMonthSwitchingAnimationEnd:Ze,onFocusedDayChange:Se,reduceAnimations:x,selectedDays:yt,onSelectedDaysChange:$e,shouldDisableDate:E,shouldDisableMonth:S,shouldDisableYear:w,hasFocus:ke,onFocusedViewChange:ht=>de("day",ht),showDaysOutsideCurrentMonth:j,fixedWeekNumber:V,dayOfWeekFormatter:z,displayWeekNumber:Z,loading:te,renderLoading:_}))]})})]}))}),Pp=({view:e,onViewChange:t,views:n,focusedView:r,onFocusedViewChange:o,value:a,defaultValue:i,referenceDate:s,onChange:c,className:u,classes:f,disableFuture:p,disablePast:y,minDate:g,maxDate:b,shouldDisableDate:x,shouldDisableMonth:E,shouldDisableYear:S,reduceAnimations:w,onMonthChange:C,monthsPerRow:R,onYearChange:M,yearsOrder:D,yearsPerRow:I,slots:L,slotProps:F,loading:B,renderLoading:U,disableHighlightToday:k,readOnly:$,disabled:j,showDaysOutsideCurrentMonth:V,dayOfWeekFormatter:z,sx:K,autoFocus:Y,fixedWeekNumber:te,displayWeekNumber:_,timezone:Z})=>m.jsx(hMe,{view:e,onViewChange:t,views:n.filter(XL),focusedView:r&&XL(r)?r:null,onFocusedViewChange:o,value:a,defaultValue:i,referenceDate:s,onChange:c,className:u,classes:f,disableFuture:p,disablePast:y,minDate:g,maxDate:b,shouldDisableDate:x,shouldDisableMonth:E,shouldDisableYear:S,reduceAnimations:w,onMonthChange:C,monthsPerRow:R,onYearChange:M,yearsOrder:D,yearsPerRow:I,slots:L,slotProps:F,loading:B,renderLoading:U,disableHighlightToday:k,readOnly:$,disabled:j,showDaysOutsideCurrentMonth:V,dayOfWeekFormatter:z,sx:K,autoFocus:Y,fixedWeekNumber:te,displayWeekNumber:_,timezone:Z}),x9=T.forwardRef(function(e,t){const n=yc(),r=Wr(),o=K$(e,"MuiDesktopDatePicker"),a=pe({day:Pp,month:Pp,year:Pp},o.viewRenderers),i=pe({},o,{viewRenderers:a,format:rO(r,o,!1),yearsPerRow:o.yearsPerRow??4,slots:pe({openPickerIcon:DDe,field:h9},o.slots),slotProps:pe({},o.slotProps,{field:c=>pe({},Xp(o.slotProps?.field,c),X$(o),{ref:t}),toolbar:pe({hidden:!0},o.slotProps?.toolbar)})}),{renderPicker:s}=TDe({props:i,valueManager:Sl,valueType:"date",getOpenDialogAriaText:G$({utils:r,formatKey:"fullDate",contextTranslation:n.openDatePickerDialogue,propsTranslation:i.localeText?.openDatePickerDialogue}),validator:Ib});return s()});x9.propTypes={autoFocus:Ke.bool,className:Ke.string,closeOnSelect:Ke.bool,dayOfWeekFormatter:Ke.func,defaultValue:Ke.object,disabled:Ke.bool,disableFuture:Ke.bool,disableHighlightToday:Ke.bool,disableOpenPicker:Ke.bool,disablePast:Ke.bool,displayWeekNumber:Ke.bool,enableAccessibleFieldDOMStructure:Ke.any,fixedWeekNumber:Ke.number,format:Ke.string,formatDensity:Ke.oneOf(["dense","spacious"]),inputRef:X7,label:Ke.node,loading:Ke.bool,localeText:Ke.object,maxDate:Ke.object,minDate:Ke.object,monthsPerRow:Ke.oneOf([3,4]),name:Ke.string,onAccept:Ke.func,onChange:Ke.func,onClose:Ke.func,onError:Ke.func,onMonthChange:Ke.func,onOpen:Ke.func,onSelectedSectionsChange:Ke.func,onViewChange:Ke.func,onYearChange:Ke.func,open:Ke.bool,openTo:Ke.oneOf(["day","month","year"]),orientation:Ke.oneOf(["landscape","portrait"]),readOnly:Ke.bool,reduceAnimations:Ke.bool,referenceDate:Ke.object,renderLoading:Ke.func,selectedSections:Ke.oneOfType([Ke.oneOf(["all","day","empty","hours","meridiem","minutes","month","seconds","weekDay","year"]),Ke.number]),shouldDisableDate:Ke.func,shouldDisableMonth:Ke.func,shouldDisableYear:Ke.func,showDaysOutsideCurrentMonth:Ke.bool,slotProps:Ke.object,slots:Ke.object,sx:Ke.oneOfType([Ke.arrayOf(Ke.oneOfType([Ke.func,Ke.object,Ke.bool])),Ke.func,Ke.object]),timezone:Ke.string,value:Ke.object,view:Ke.oneOf(["day","month","year"]),viewRenderers:Ke.shape({day:Ke.func,month:Ke.func,year:Ke.func}),views:Ke.arrayOf(Ke.oneOf(["day","month","year"]).isRequired),yearsOrder:Ke.oneOf(["asc","desc"]),yearsPerRow:Ke.oneOf([3,4])};const mMe=Pe(Dl)({[`& .${dy.container}`]:{outline:0},[`& .${dy.paper}`]:{outline:0,minWidth:US}}),gMe=Pe(Rl)({"&:first-of-type":{padding:0}});function yMe(e){const{children:t,onDismiss:n,open:r,slots:o,slotProps:a}=e,i=o?.dialog??mMe,s=o?.mobileTransition??qd;return m.jsx(i,pe({open:r,onClose:n},a?.dialog,{TransitionComponent:s,TransitionProps:a?.mobileTransition,PaperComponent:o?.mobilePaper,PaperProps:a?.mobilePaper,children:m.jsx(gMe,{children:t})}))}const bMe=["props","getOpenDialogAriaText"],vMe=e=>{let{props:t,getOpenDialogAriaText:n}=e,r=fn(e,bMe);const{slots:o,slotProps:a,className:i,sx:s,format:c,formatDensity:u,enableAccessibleFieldDOMStructure:f,selectedSections:p,onSelectedSectionsChange:y,timezone:g,name:b,label:x,inputRef:E,readOnly:S,disabled:w,localeText:C}=t,R=T.useRef(null),M=Bs(),D=a?.toolbar?.hidden??!1,{open:I,actions:L,layoutProps:F,renderCurrentView:B,fieldProps:U,contextValue:k}=n9(pe({},r,{props:t,fieldRef:R,autoFocusView:!0,additionalViewProps:{},wrapperVariant:"mobile"})),$=o.field,j=mr({elementType:$,externalSlotProps:a?.field,additionalProps:pe({},U,D&&{id:M},!(w||S)&&{onClick:L.onOpen,onKeyDown:RAe(L.onOpen)},{readOnly:S??!0,disabled:w,className:i,sx:s,format:c,formatDensity:u,enableAccessibleFieldDOMStructure:f,selectedSections:p,onSelectedSectionsChange:y,timezone:g,label:x,name:b},E?{inputRef:E}:{}),ownerState:t});j.inputProps=pe({},j.inputProps,{"aria-label":n(U.value)});const V=pe({textField:o.textField},j.slots),z=o.layout??a9;let K=M;D&&(x?K=`${M}-label`:K=void 0);const Y=pe({},a,{toolbar:pe({},a?.toolbar,{titleId:M}),mobilePaper:pe({"aria-labelledby":K},a?.mobilePaper)}),te=cr(R,j.unstableFieldRef);return{renderPicker:()=>m.jsxs(i9,{contextValue:k,localeText:C,children:[m.jsx($,pe({},j,{slots:V,slotProps:Y,unstableFieldRef:te})),m.jsx(yMe,pe({},L,{open:I,slots:o,slotProps:Y,children:m.jsx(z,pe({},F,Y?.layout,{slots:o,slotProps:Y,children:B()}))}))]})}},S9=T.forwardRef(function(e,t){const n=yc(),r=Wr(),o=K$(e,"MuiMobileDatePicker"),a=pe({day:Pp,month:Pp,year:Pp},o.viewRenderers),i=pe({},o,{viewRenderers:a,format:rO(r,o,!1),slots:pe({field:h9},o.slots),slotProps:pe({},o.slotProps,{field:c=>pe({},Xp(o.slotProps?.field,c),X$(o),{ref:t}),toolbar:pe({hidden:!1},o.slotProps?.toolbar)})}),{renderPicker:s}=vMe({props:i,valueManager:Sl,valueType:"date",getOpenDialogAriaText:G$({utils:r,formatKey:"fullDate",contextTranslation:n.openDatePickerDialogue,propsTranslation:i.localeText?.openDatePickerDialogue}),validator:Ib});return s()});S9.propTypes={autoFocus:Ke.bool,className:Ke.string,closeOnSelect:Ke.bool,dayOfWeekFormatter:Ke.func,defaultValue:Ke.object,disabled:Ke.bool,disableFuture:Ke.bool,disableHighlightToday:Ke.bool,disableOpenPicker:Ke.bool,disablePast:Ke.bool,displayWeekNumber:Ke.bool,enableAccessibleFieldDOMStructure:Ke.any,fixedWeekNumber:Ke.number,format:Ke.string,formatDensity:Ke.oneOf(["dense","spacious"]),inputRef:X7,label:Ke.node,loading:Ke.bool,localeText:Ke.object,maxDate:Ke.object,minDate:Ke.object,monthsPerRow:Ke.oneOf([3,4]),name:Ke.string,onAccept:Ke.func,onChange:Ke.func,onClose:Ke.func,onError:Ke.func,onMonthChange:Ke.func,onOpen:Ke.func,onSelectedSectionsChange:Ke.func,onViewChange:Ke.func,onYearChange:Ke.func,open:Ke.bool,openTo:Ke.oneOf(["day","month","year"]),orientation:Ke.oneOf(["landscape","portrait"]),readOnly:Ke.bool,reduceAnimations:Ke.bool,referenceDate:Ke.object,renderLoading:Ke.func,selectedSections:Ke.oneOfType([Ke.oneOf(["all","day","empty","hours","meridiem","minutes","month","seconds","weekDay","year"]),Ke.number]),shouldDisableDate:Ke.func,shouldDisableMonth:Ke.func,shouldDisableYear:Ke.func,showDaysOutsideCurrentMonth:Ke.bool,slotProps:Ke.object,slots:Ke.object,sx:Ke.oneOfType([Ke.arrayOf(Ke.oneOfType([Ke.func,Ke.object,Ke.bool])),Ke.func,Ke.object]),timezone:Ke.string,value:Ke.object,view:Ke.oneOf(["day","month","year"]),viewRenderers:Ke.shape({day:Ke.func,month:Ke.func,year:Ke.func}),views:Ke.arrayOf(Ke.oneOf(["day","month","year"]).isRequired),yearsOrder:Ke.oneOf(["asc","desc"]),yearsPerRow:Ke.oneOf([3,4])};const xMe=["desktopModeMediaQuery"],y1=T.forwardRef(function(e,t){const n=Vr({props:e,name:"MuiDatePicker"}),{desktopModeMediaQuery:r=MAe}=n,o=fn(n,xMe);return $$(r,{defaultMatches:!0})?m.jsx(x9,pe({ref:t},o)):m.jsx(S9,pe({ref:t},o))});var g2={exports:{}},SMe=g2.exports,f4;function EMe(){return f4||(f4=1,(function(e,t){(function(n,r){e.exports=r()})(SMe,(function(){var n="minute",r=/[+-]\d\d(?::?\d\d)?/g,o=/([+-]|\d\d)/g;return function(a,i,s){var c=i.prototype;s.utc=function(x){var E={date:x,utc:!0,args:arguments};return new i(E)},c.utc=function(x){var E=s(this.toDate(),{locale:this.$L,utc:!0});return x?E.add(this.utcOffset(),n):E},c.local=function(){return s(this.toDate(),{locale:this.$L,utc:!1})};var u=c.parse;c.parse=function(x){x.utc&&(this.$u=!0),this.$utils().u(x.$offset)||(this.$offset=x.$offset),u.call(this,x)};var f=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 f.call(this)};var p=c.utcOffset;c.utcOffset=function(x,E){var S=this.$utils().u;if(S(x))return this.$u?0:S(this.$offset)?p.call(this):this.$offset;if(typeof x=="string"&&(x=(function(M){M===void 0&&(M="");var D=M.match(r);if(!D)return null;var I=(""+D[0]).match(o)||["-",0,0],L=I[0],F=60*+I[1]+ +I[2];return F===0?0:L==="+"?F:-F})(x),x===null))return this;var w=Math.abs(x)<=16?60*x:x;if(w===0)return this.utc(E);var C=this.clone();if(E)return C.$offset=w,C.$u=!1,C;var R=this.$u?this.toDate().getTimezoneOffset():-1*this.utcOffset();return(C=this.local().add(w+R,n)).$offset=w,C.$x.$localOffset=R,C};var y=c.format;c.format=function(x){var E=x||(this.$u?"YYYY-MM-DDTHH:mm:ss[Z]":"");return y.call(this,E)},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 g=c.toDate;c.toDate=function(x){return x==="s"&&this.$offset?s(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate():g.call(this)};var b=c.diff;c.diff=function(x,E,S){if(x&&this.$u===x.$u)return b.call(this,x,E,S);var w=this.local(),C=s(x).local();return b.call(w,C,E,S)}}}))})(g2)),g2.exports}var CMe=EMe();const E9=fs(CMe);Ar.extend(E9);function gw(e){switch(e){case"Star":return["Equals","Contains"];case"MinMax":return["Equals","Less Than","Greater Than","Between"];case"DateMinMax":return["Equals","Before","After","Between"];case"Retrieval":return["Semantic Search"];case"Boolean":return["Equals"];case"NONE":default:return[]}}function TMe(e){return e==="DateMinMax"}function yw(e){return e==="Between"}function wMe({spec:e,values:t,selection:n,onChange:r,retrievalFn:o}){const a=()=>n?.matchType?n.matchType:e.defaultMatchType?e.defaultMatchType:e.filterType==="DateMinMax"?"Between":gw(e.filterType)[0]||"Equals",[i,s]=T.useState(a()),[c,u]=T.useState(n?.value??""),[f,p]=T.useState(n?.value2??""),[y,g]=T.useState([]),[b,x]=T.useState(!1),[E,S]=T.useState(""),[w,C]=T.useState(!1),[R,M]=T.useState(!1),D=T.useRef(null),I=T.useRef(0),[L,F]=T.useState(!1);T.useEffect(()=>{if(e.filterType!=="Retrieval"||!o)return;const _=E.trim();if(_.length<=2){g([]),C(!1);return}return D.current&&clearTimeout(D.current),D.current=setTimeout(async()=>{I.current+=1;const Z=I.current;x(!0);try{const J=await o(_,e);Z===I.current&&g(J)}catch(J){Z===I.current&&(console.error("Retrieval failed",J),g([]))}finally{Z===I.current&&(x(!1),C(!0))}},500),()=>{D.current&&clearTimeout(D.current)}},[E,e,o]),T.useEffect(()=>{n===null?(u(""),p(""),s(e.defaultMatchType??(e.filterType==="DateMinMax"?"Between":gw(e.filterType)[0]||"Equals"))):n&&(s(n.matchType),u(n.value??""),p(n.value2??""))},[n,e.filterType,e.defaultMatchType]);const B=gw(e.filterType),U=TMe(e.filterType),k=yw(i),$=U&&t.length>=2&&t[0].value instanceof Date?Ar.utc(t[0].value):void 0,j=U&&t.length>=2&&t[1].value instanceof Date?Ar.utc(t[1].value):void 0,V=e.filterType==="MinMax"&&t.length>=2&&typeof t[0].value=="number"?t[0].value:void 0,z=e.filterType==="MinMax"&&t.length>=2&&typeof t[1].value=="number"?t[1].value:void 0;if(B.length===0)return null;const K=_=>{const Z=_.target.value;s(Z),yw(Z)||p(""),c&&r({dimensionName:e.dimensionName,source:e.source,filterName:e.filterName,matchType:Z,value:c,...yw(Z)&&f&&{value2:f}})},Y=(_,Z)=>{u(_??""),Z!==void 0&&p(Z??"");const J=Array.isArray(_)&&_.length===0;r(!J&&_!==""&&_!==null&&_!==void 0?{dimensionName:e.dimensionName,source:e.source,filterName:e.filterName,matchType:i,value:_,...k&&Z&&{value2:Z}}:null)},te=()=>{u(""),p(""),r(null)};return m.jsxs(Ur,{sx:{display:"flex",flexDirection:"column",gap:1.5,fontSize:"0.75rem","& .MuiInputBase-root":{fontSize:"0.75rem"},"& .MuiInputBase-input":{padding:"6px 10px"},"& .MuiSelect-select":{padding:"6px 10px !important"},"& .MuiAutocomplete-input":{padding:"0 !important"},"& .MuiAutocomplete-root .MuiInputBase-root":{padding:"5px 10px",minHeight:"29.5px",boxSizing:"border-box",flexWrap:"wrap"},"& .MuiChip-root":{height:"16px",margin:"0 2px 0 0"},"& .MuiChip-label":{fontSize:"0.7rem",padding:"0 6px"},"& .MuiChip-deleteIcon":{fontSize:"14px",margin:"0 2px 0 -4px"},"& .MuiInputLabel-root":{fontSize:"0.75rem",transform:"translate(10px, 6px) scale(1)"},"& .MuiInputLabel-shrink":{fontSize:"0.85rem",transform:"translate(14px, -9px) scale(0.75)"},"& .MuiOutlinedInput-notchedOutline legend":{fontSize:"0.65rem"},"& .MuiFormHelperText-root":{fontSize:"0.65rem",marginTop:"2px"},"& .MuiSvgIcon-root":{fontSize:"1.25rem"}},children:[m.jsxs(Ur,{sx:{fontWeight:600,color:e.required&&!n?"error.main":"text.primary"},children:[e.label??e.dimensionName,e.required&&m.jsx(Ur,{component:"span",sx:{color:n?"text.secondary":"error.main",fontWeight:400,fontSize:"0.7rem",ml:.5},children:"(required)"})]}),e.filterType!=="Boolean"&&!e.defaultMatchType&&B.length>1&&m.jsxs(ix,{size:"small",fullWidth:!0,children:[m.jsx(sx,{children:"Match Type"}),m.jsx(lx,{value:i,label:"Match Type",onChange:K,MenuProps:{PaperProps:{sx:{"& .MuiMenuItem-root":{fontSize:"0.75rem",minHeight:"auto",padding:"4px 10px"}}}},children:B.map(_=>m.jsx(Mo,{value:_,children:_},_))})]}),e.filterType==="Star"&&i==="Equals"&&m.jsx(i2,{multiple:!0,size:"small",options:t,getOptionLabel:_=>typeof _=="string"?_:typeof _=="object"&&_!==null&&"value"in _?String(_.value):String(_),value:Array.isArray(c)?c.map(_=>t.find(Z=>Z.value===_)||_):c?[t.find(_=>_.value===c)||c]:[],onChange:(_,Z)=>{const J=Z.map(W=>typeof W=="string"?W:W&&typeof W=="object"&&"value"in W?W.value:W);Y(J)},noOptionsText:"No matches found",renderInput:_=>m.jsx(Wn,{..._,size:"small",label:"Values",placeholder:"Select values..."}),freeSolo:!e.values||e.values.length===0,slotProps:{paper:{sx:{"& .MuiAutocomplete-option":{fontSize:"0.75rem",minHeight:"auto",padding:"4px 10px"}}}}}),e.filterType==="Star"&&i==="Contains"&&m.jsx(Wn,{size:"small",label:"Search Text",value:c,onChange:_=>u(_.target.value),onBlur:()=>Y(c),onKeyDown:_=>{_.key==="Enter"&&Y(c)},placeholder:"Enter text to search...",fullWidth:!0}),e.filterType==="Boolean"&&m.jsxs(ix,{size:"small",fullWidth:!0,children:[m.jsx(sx,{children:"Value"}),m.jsxs(lx,{value:c===!0?"true":c===!1?"false":"",label:"Value",onChange:_=>{const Z=_.target.value;Z==="true"?Y(!0):Z==="false"?Y(!1):te()},MenuProps:{PaperProps:{sx:{"& .MuiMenuItem-root":{fontSize:"0.75rem",minHeight:"auto",padding:"4px 10px"}}}},children:[m.jsx(Mo,{value:"",children:m.jsx("em",{children:"Blank"})}),m.jsx(Mo,{value:"true",children:"True"}),m.jsx(Mo,{value:"false",children:"False"})]})]}),e.filterType==="Retrieval"&&i==="Semantic Search"&&m.jsx(i2,{multiple:!0,size:"small",options:y,loading:b,getOptionLabel:_=>typeof _=="string"?_:typeof _=="object"&&_!==null&&"value"in _?String(_.value):String(_),value:Array.isArray(c)?c.map(_=>y.find(Z=>Z.value===_)||{value:_}):c?[{value:c}]:[],onInputChange:(_,Z)=>{S(Z)},onChange:(_,Z)=>{const J=Z.map(W=>typeof W=="string"?W:W&&typeof W=="object"&&"value"in W?W.value:W);Y(J)},noOptionsText:E.trim().length<=2?"Type at least 3 characters to search":"No matches found",renderInput:_=>m.jsx(Wn,{..._,size:"small",label:"Search Values",placeholder:"Type to search...",onFocus:()=>M(!0),onBlur:()=>M(!1),helperText:R&&!b&&w&&y.length===0?"No matches found":void 0,InputProps:{..._.InputProps,endAdornment:m.jsxs(m.Fragment,{children:[b?m.jsx(LD,{color:"inherit",size:20}):null,_.InputProps.endAdornment]})}}),freeSolo:!0,filterOptions:_=>_,slotProps:{paper:{sx:{"& .MuiAutocomplete-option":{fontSize:"0.75rem",minHeight:"auto",padding:"4px 10px"}}}}}),e.filterType==="MinMax"&&!k&&m.jsx(Wn,{size:"small",type:"number",label:"Value",value:c,onChange:_=>Y(parseFloat(_.target.value)||""),onFocus:()=>F(!0),onBlur:()=>F(!1),placeholder:"Enter number...",fullWidth:!0,inputProps:{min:V,max:z},helperText:L&&V!==void 0&&z!==void 0?`Valid range: [${V} - ${z}]`:void 0}),e.filterType==="MinMax"&&k&&m.jsxs(Ur,{sx:{display:"flex",flexDirection:"column",gap:1},children:[m.jsxs(Ur,{sx:{display:"flex",gap:1,alignItems:"center"},children:[m.jsx(Wn,{size:"small",type:"number",label:"From",value:c,onChange:_=>Y(parseFloat(_.target.value)||"",f),onFocus:()=>F(!0),onBlur:()=>F(!1),placeholder:"Min...",fullWidth:!0,inputProps:{min:V,max:f||z}}),m.jsx(Ur,{children:"to"}),m.jsx(Wn,{size:"small",type:"number",label:"To",value:f,onChange:_=>Y(c,parseFloat(_.target.value)||""),onFocus:()=>F(!0),onBlur:()=>F(!1),placeholder:"Max...",fullWidth:!0,inputProps:{min:c||V,max:z}})]}),L&&V!==void 0&&z!==void 0&&m.jsxs(lr,{variant:"caption",color:"text.secondary",sx:{mt:-.5,ml:1.5},children:["Valid range: [",V," - ",z,"]"]})]}),U&&!k&&m.jsx(fx,{dateAdapter:p2,children:m.jsx(y1,{label:"Date",value:c instanceof Date?Ar.utc(c):null,onChange:_=>{_===null?Y(null):_.isValid()&&Y(_.utc().toDate())},timezone:"UTC",minDate:c instanceof Date?void 0:$,maxDate:c instanceof Date?void 0:j,referenceDate:i==="After"&&$?$:void 0,slotProps:{textField:{size:"small",fullWidth:!0,sx:{minWidth:150},onFocus:()=>F(!0),onBlur:()=>F(!1),helperText:L&&$&&j?`Valid range: [${$.format("YYYY-MM-DD")} - ${j.format("YYYY-MM-DD")}]`:void 0},openPickerButton:{sx:{backgroundColor:"transparent"}}}})}),U&&k&&m.jsx(fx,{dateAdapter:p2,children:m.jsxs(Ur,{sx:{display:"flex",flexDirection:"column",gap:1},children:[m.jsxs(Ur,{sx:{display:"flex",gap:1,alignItems:"center"},children:[m.jsx(Ur,{sx:{flex:1,minWidth:0},children:m.jsx(y1,{label:"From",value:c instanceof Date?Ar.utc(c):null,onChange:_=>{_===null?Y(null,f):_.isValid()&&Y(_.utc().toDate(),f)},timezone:"UTC",minDate:c instanceof Date?void 0:$,maxDate:f instanceof Date?Ar.utc(f):c instanceof Date?void 0:j,referenceDate:$,slotProps:{textField:{size:"small",fullWidth:!0,onFocus:()=>F(!0),onBlur:()=>F(!1)},openPickerButton:{sx:{backgroundColor:"transparent"}}}})}),m.jsx(Ur,{children:"to"}),m.jsx(Ur,{sx:{flex:1,minWidth:0},children:m.jsx(y1,{label:"To",value:f instanceof Date?Ar.utc(f):null,onChange:_=>{_===null?Y(c,null):_.isValid()&&Y(c,_.utc().toDate())},timezone:"UTC",minDate:c instanceof Date?Ar.utc(c):f instanceof Date?void 0:$,maxDate:f instanceof Date?void 0:j,referenceDate:c instanceof Date?Ar.utc(c):$,slotProps:{textField:{size:"small",fullWidth:!0,onFocus:()=>F(!0),onBlur:()=>F(!1)},openPickerButton:{sx:{backgroundColor:"transparent"}}}})})]}),L&&$&&j&&m.jsxs(lr,{variant:"caption",color:"text.secondary",sx:{mt:-.5,ml:1.5},children:["Valid range: [",$.format("YYYY-MM-DD")," -"," ",j.format("YYYY-MM-DD"),"]"]})]})})]})}function kMe(e){if(!e)return null;for(const t of e)if(t.startsWith("##(filters)")){const n=t.slice(11).trim();try{const r=JSON.parse(n);if(Array.isArray(r)){const o=[];for(const a of r)if(typeof a=="string"){const i=a.indexOf(".");i>0&&i<a.length-1&&o.push({source:a.substring(0,i),dimension:a.substring(i+1)})}if(o.length>0)return{filters:o}}}catch(r){console.error(`Failed to parse "${t}" annotation:`,r)}}return null}function AMe(e){if(e.startsWith("#(filter)")){const t=e.slice(9).trim();try{const n=JSON.parse(t);if(n.type)return n}catch(n){console.error(`Failed to parse "${e}" annotation:`,n)}}return null}function DMe(e){const t=e.match(/^#\s*label\s*=\s*"([^"]+)"/);return t?t[1]:null}function OMe(e){const t=new Map;let n="";for(const r of e)if(r.type==="code"){if(!n&&r.text){const o=r.text.match(/import\s+(?:\{[^}]*\}\s+from\s+)?['"]([^'"]+)['"]/);o&&(n=o[1])}if(r.newSources&&r.newSources.length>0)for(const o of r.newSources)try{const a=JSON.parse(o);a.name&&t.set(a.name,a)}catch(a){console.error("Failed to parse SourceInfo:",a)}}return{sourceInfoMap:t,modelPath:n}}function RMe(e,t,n){const r=[];for(const{source:o,dimension:a}of t){const i=e.get(o);if(!i){console.warn(`Source "${o}" not found in notebook sources`),r.push({source:o,model:n,dimensionName:a,filterType:"Star"});continue}const s=i.schema?.fields;if(!s){r.push({source:o,model:n,dimensionName:a,filterType:"Star"});continue}const c=s.find(p=>p.name===a);if(!c){console.warn(`Dimension "${a}" not found in source "${o}"`),r.push({source:o,model:n,dimensionName:a,filterType:"Star"});continue}let u="Star",f;if("annotations"in c&&c.annotations){for(const p of c.annotations)if(p.value){const y=AMe(p.value);y&&(u=y.type);const g=DMe(p.value);g&&(f=g)}}r.push({source:o,model:n,dimensionName:a,filterType:u,label:f})}return r}const C9=Fn(m.jsx("path",{d:"m9.17 6 2 2H20v10H4V6zM10 4H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2h-8z"})),T9=e=>{if(!e)return"Explore semantic models, run queries, and build dashboards";const t=e.replace(/^#+\s+/gm,"").replace(/\*\*(.*?)\*\*/g,"$1").replace(/\*(.*?)\*/g,"$1").replace(/\[([^\]]+)\]\([^)]+\)/g,"$1").replace(/`([^`]+)`/g,"$1").trim(),n=t.split(/\n\s*\n/)[1]||t;if(n.length<=120)return n;const r=n.substring(0,120).split(" ");return r.pop(),r.join(" ")+"..."},w9=(e,t)=>{const n=(e.readme||void 0)?.split(`
439
439
  `)??[];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(`
440
- `)};function MMe(e={}){const{autoHideDuration:t=null,disableWindowBlurListener:n=!1,onClose:r,open:o,resumeHideDuration:a}=e,i=PS();T.useEffect(()=>{if(!o)return;function E(S){S.defaultPrevented||S.key==="Escape"&&r?.(S,"escapeKeyDown")}return document.addEventListener("keydown",E),()=>{document.removeEventListener("keydown",E)}},[o,r]);const s=Pt((E,S)=>{r?.(E,S)}),c=Pt(E=>{!r||E==null||i.start(E,()=>{s(null,"timeout")})});T.useEffect(()=>(o&&c(t),i.clear),[o,t,c,i]);const u=E=>{r?.(E,"clickaway")},f=i.clear,p=T.useCallback(()=>{t!=null&&c(a??t*.5)},[t,a,c]),y=E=>S=>{const w=E.onBlur;w?.(S),p()},g=E=>S=>{const w=E.onFocus;w?.(S),f()},b=E=>S=>{const w=E.onMouseEnter;w?.(S),f()},x=E=>S=>{const w=E.onMouseLeave;w?.(S),p()};return T.useEffect(()=>{if(!n&&o)return window.addEventListener("focus",p),window.addEventListener("blur",f),()=>{window.removeEventListener("focus",p),window.removeEventListener("blur",f)}},[n,o,p,f]),{getRootProps:(E={})=>{const S={...ci(e),...ci(E)};return{role:"presentation",...E,...S,onBlur:y(S),onFocus:g(S),onMouseEnter:b(S),onMouseLeave:x(S)}},onClickAway:u}}function p4(e){return e.substring(2).toLowerCase()}function NMe(e,t){return t.documentElement.clientWidth<e.clientX||t.documentElement.clientHeight<e.clientY}function PMe(e){const{children:t,disableReactTree:n=!1,mouseEvent:r="onClick",onClickAway:o,touchEvent:a="onTouchEnd"}=e,i=T.useRef(!1),s=T.useRef(null),c=T.useRef(!1),u=T.useRef(!1);T.useEffect(()=>(setTimeout(()=>{c.current=!0},0),()=>{c.current=!1}),[]);const f=cr(wh(t),s),p=Pt(b=>{const x=u.current;u.current=!1;const E=Po(s.current);if(!c.current||!s.current||"clientX"in b&&NMe(b,E))return;if(i.current){i.current=!1;return}let S;b.composedPath?S=b.composedPath().includes(s.current):S=!E.documentElement.contains(b.target)||s.current.contains(b.target),!S&&(n||!x)&&o(b)}),y=b=>x=>{u.current=!0;const E=t.props[b];E&&E(x)},g={ref:f};return a!==!1&&(g[a]=y(a)),T.useEffect(()=>{if(a!==!1){const b=p4(a),x=Po(s.current),E=()=>{i.current=!0};return x.addEventListener(b,p),x.addEventListener("touchmove",E),()=>{x.removeEventListener(b,p),x.removeEventListener("touchmove",E)}}},[p,a]),r!==!1&&(g[r]=y(r)),T.useEffect(()=>{if(r!==!1){const b=p4(r),x=Po(s.current);return x.addEventListener(b,p),()=>{x.removeEventListener(b,p)}}},[p,r]),T.cloneElement(t,g)}function IMe(e){return Ut("MuiSnackbarContent",e)}Lt("MuiSnackbarContent",["root","message","action"]);const _Me=e=>{const{classes:t}=e;return zt({root:["root"],action:["action"],message:["message"]},IMe,t)},LMe=Pe(rf,{name:"MuiSnackbarContent",slot:"Root"})(Pn(({theme:e})=>{const t=e.palette.mode==="light"?.8:.98;return{...e.typography.body2,color:e.vars?e.vars.palette.SnackbarContent.color:e.palette.getContrastText(vk(e.palette.background.default,t)),backgroundColor:e.vars?e.vars.palette.SnackbarContent.bg:vk(e.palette.background.default,t),display:"flex",alignItems:"center",flexWrap:"wrap",padding:"6px 16px",flexGrow:1,[e.breakpoints.up("sm")]:{flexGrow:"initial",minWidth:288}}})),FMe=Pe("div",{name:"MuiSnackbarContent",slot:"Message"})({padding:"8px 0"}),jMe=Pe("div",{name:"MuiSnackbarContent",slot:"Action"})({display:"flex",alignItems:"center",marginLeft:"auto",paddingLeft:16,marginRight:-8}),BMe=T.forwardRef(function(e,t){const n=An({props:e,name:"MuiSnackbarContent"}),{action:r,className:o,message:a,role:i="alert",...s}=n,c=n,u=_Me(c);return m.jsxs(LMe,{role:i,elevation:6,className:Ot(u.root,o),ownerState:c,ref:t,...s,children:[m.jsx(FMe,{className:u.message,ownerState:c,children:a}),r?m.jsx(jMe,{className:u.action,ownerState:c,children:r}):null]})});function $Me(e){return Ut("MuiSnackbar",e)}Lt("MuiSnackbar",["root","anchorOriginTopCenter","anchorOriginBottomCenter","anchorOriginTopRight","anchorOriginBottomRight","anchorOriginTopLeft","anchorOriginBottomLeft"]);const zMe=e=>{const{classes:t,anchorOrigin:n}=e,r={root:["root",`anchorOrigin${bt(n.vertical)}${bt(n.horizontal)}`]};return zt(r,$Me,t)},HMe=Pe("div",{name:"MuiSnackbar",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,t[`anchorOrigin${bt(n.anchorOrigin.vertical)}${bt(n.anchorOrigin.horizontal)}`]]}})(Pn(({theme:e})=>({zIndex:(e.vars||e).zIndex.snackbar,position:"fixed",display:"flex",left:8,right:8,justifyContent:"center",alignItems:"center",variants:[{props:({ownerState:t})=>t.anchorOrigin.vertical==="top",style:{top:8,[e.breakpoints.up("sm")]:{top:24}}},{props:({ownerState:t})=>t.anchorOrigin.vertical!=="top",style:{bottom:8,[e.breakpoints.up("sm")]:{bottom:24}}},{props:({ownerState:t})=>t.anchorOrigin.horizontal==="left",style:{justifyContent:"flex-start",[e.breakpoints.up("sm")]:{left:24,right:"auto"}}},{props:({ownerState:t})=>t.anchorOrigin.horizontal==="right",style:{justifyContent:"flex-end",[e.breakpoints.up("sm")]:{right:24,left:"auto"}}},{props:({ownerState:t})=>t.anchorOrigin.horizontal==="center",style:{[e.breakpoints.up("sm")]:{left:"50%",right:"auto",transform:"translateX(-50%)"}}}]}))),UMe=T.forwardRef(function(e,t){const n=An({props:e,name:"MuiSnackbar"}),r=_u(),o={enter:r.transitions.duration.enteringScreen,exit:r.transitions.duration.leavingScreen},{action:a,anchorOrigin:{vertical:i,horizontal:s}={vertical:"bottom",horizontal:"left"},autoHideDuration:c=null,children:u,className:f,ClickAwayListenerProps:p,ContentProps:y,disableWindowBlurListener:g=!1,message:b,onBlur:x,onClose:E,onFocus:S,onMouseEnter:w,onMouseLeave:C,open:R,resumeHideDuration:M,slots:D={},slotProps:I={},TransitionComponent:L,transitionDuration:F=o,TransitionProps:{onEnter:B,onExited:U,...k}={},...$}=n,j={...n,anchorOrigin:{vertical:i,horizontal:s},autoHideDuration:c,disableWindowBlurListener:g,TransitionComponent:L,transitionDuration:F},V=zMe(j),{getRootProps:z,onClickAway:K}=MMe({...j}),[Y,te]=T.useState(!0),_=Re=>{te(!0),U&&U(Re)},Z=(Re,de)=>{te(!1),B&&B(Re,de)},J={slots:{transition:L,...D},slotProps:{content:y,clickAwayListener:p,transition:k,...I}},[W,re]=tr("root",{ref:t,className:[V.root,f],elementType:HMe,getSlotProps:z,externalForwardedProps:{...J,...$},ownerState:j}),[ne,{ownerState:X,...ie}]=tr("clickAwayListener",{elementType:PMe,externalForwardedProps:J,getSlotProps:Re=>({onClickAway:(...de)=>{const me=de[0];Re.onClickAway?.(...de),!me?.defaultMuiPrevented&&K(...de)}}),ownerState:j}),[ae,fe]=tr("content",{elementType:BMe,shouldForwardComponentProp:!0,externalForwardedProps:J,additionalProps:{message:b,action:a},ownerState:j}),[xe,ge]=tr("transition",{elementType:Vy,externalForwardedProps:J,getSlotProps:Re=>({onEnter:(...de)=>{Re.onEnter?.(...de),Z(...de)},onExited:(...de)=>{Re.onExited?.(...de),_(...de)}}),additionalProps:{appear:!0,in:R,timeout:F,direction:i==="top"?"down":"up"},ownerState:j});return!R&&Y?null:m.jsx(ne,{...ie,...D.clickAwayListener&&{ownerState:X},children:m.jsx(W,{...re,children:m.jsx(xe,{...ge,children:u||m.jsx(ae,{...fe})})})})});function h4(){const[e,t]=T.useState(!1),{apiClients:n}=Dr(),[r,o]=T.useState(""),a=()=>{t(!0)},i=()=>{t(!1)},s=Ls(),c=Ho({async mutationFn(f){return n.environments.createEnvironment({name:f.name,readme:w9({name:f.name,readme:""},f.description)})},onSuccess(){i(),s.invalidateQueries({queryKey:["environments"]}),o("Environment created successfully")},onError(f){o(f instanceof Error?f.message:"An unknown error occurred")}}),u=async f=>{f.preventDefault();const p=new FormData(f.currentTarget),y=p.get("name")?.toString(),g=p.get("description")?.toString();if(!y)throw new Error("Name is required");c.mutate({name:y,description:g})};return m.jsxs(vt.Fragment,{children:[m.jsx(Zr,{variant:"contained",onClick:a,startIcon:m.jsx(Yae,{}),sx:{mt:2},children:"Create New Environment"}),m.jsxs(Dl,{open:e,onClose:i,children:[m.jsx(gc,{children:"Create New Environment"}),m.jsxs(Rl,{children:[m.jsx(Rb,{children:"Add a new environment to start exploring semantic models and analyzing data."}),m.jsxs("form",{onSubmit:u,id:"environment-form",children:[m.jsx(Wn,{autoFocus:!0,required:!0,margin:"dense",id:"name",name:"name",label:"Environment Name",type:"text",fullWidth:!0,variant:"standard"}),m.jsx(Wn,{margin:"dense",id:"description",name:"description",label:"Environment Description",placeholder:"Explore semantic models, run queries, and build dashboards",type:"text",fullWidth:!0,variant:"standard"})]})]}),m.jsxs(Ol,{children:[m.jsx(Zr,{disabled:c.isPending,onClick:i,children:"Cancel"}),m.jsx(Zr,{type:"submit",form:"environment-form",loading:c.isPending,children:"Create Environment"})]})]}),m.jsx(UMe,{open:r!=="",autoHideDuration:6e3,onClose:()=>o(""),message:r})]})}function VMe({environment:e,onCloseDialog:t}){const[n,r]=T.useState(!1),{apiClients:o}=Dr(),a=Ls(),[i,s]=T.useState(""),c=()=>{r(!0)},u=()=>{r(!1),t()},f=Ho({mutationFn:()=>o.environments.deleteEnvironment(e.name),onSuccess(){u(),a.invalidateQueries({queryKey:["environments"]}),s("Environment deleted successfully")},onError(p){s(p instanceof Error?p.message:"An unknown error occurred")}});return m.jsxs(vt.Fragment,{children:[m.jsxs(cc,{onClick:c,children:[m.jsx(sb,{children:m.jsx(Jx,{fontSize:"small"})}),m.jsx(Xd,{children:"Delete"})]}),m.jsxs(Dl,{onClose:u,"aria-labelledby":"customized-dialog-title",open:n,children:[m.jsx(gc,{sx:{m:0,p:2},id:"customized-dialog-title",children:"Delete Environment"}),m.jsx(gs,{"aria-label":"close",onClick:u,sx:p=>({position:"absolute",right:8,top:8,color:p.palette.grey[500]}),children:m.jsx(Ns,{})}),m.jsx(Rl,{dividers:!0,children:m.jsxs(lr,{gutterBottom:!0,children:['Are you sure you want to delete "',e.name,'"? This action cannot be undone.']})}),m.jsxs(Ol,{children:[m.jsx(Zr,{variant:"outlined",onClick:u,style:{borderColor:Ba.teal,color:Ba.teal},children:"Cancel"}),m.jsx(Zr,{loading:f.isPending,variant:"contained",autoFocus:!0,onClick:()=>f.mutate(),color:"error",children:"Delete"})]}),m.jsx(_s,{open:i!=="",autoHideDuration:6e3,onClose:()=>s(""),message:i})]})]})}function WMe({environment:e,onCloseDialog:t}){const[n,r]=T.useState(!1),{apiClients:o}=Dr(),a=Ls(),[i,s]=T.useState(""),c=()=>{r(!0)},u=()=>{r(!1),t()},f=Ho({async mutationFn(y){return o.environments.updateEnvironment(e.name,{name:e.name,readme:w9({name:e.name,readme:e.readme},y.description)})},onSuccess(){u(),a.invalidateQueries({queryKey:["environments"]}),s("Environment updated successfully")},onError(y){s(y instanceof Error?y.message:"An unknown error occurred")}}),p=y=>{y.preventDefault();const g=new FormData(y.currentTarget).get("description")?.toString();f.mutate({description:g})};return m.jsxs(vt.Fragment,{children:[m.jsxs(cc,{onClick:c,children:[m.jsx(sb,{children:m.jsx(RA,{fontSize:"small"})}),m.jsx(Xd,{children:"Edit"})]}),m.jsxs(Dl,{open:n,onClose:u,children:[m.jsx(gc,{children:"Edit Environment"}),m.jsxs(Rl,{children:[m.jsx(Rb,{children:"Edit this environment's description."}),m.jsxs("form",{onSubmit:p,id:"environment-form",children:[m.jsx(Wn,{autoFocus:!0,required:!0,margin:"dense",id:"name",name:"name",label:"Environment Name",disabled:!0,type:"text",fullWidth:!0,variant:"standard",defaultValue:e.name}),m.jsx(Wn,{margin:"dense",id:"description",name:"description",label:"Environment Description",type:"text",fullWidth:!0,variant:"standard",defaultValue:T9(e.readme)})]})]}),m.jsxs(Ol,{children:[m.jsx(Zr,{disabled:f.isPending,onClick:u,children:"Cancel"}),m.jsx(Zr,{type:"submit",form:"environment-form",loading:f.isPending,children:"Save Changes"})]})]}),m.jsx(_s,{open:i!=="",autoHideDuration:6e3,onClose:()=>s(""),message:i})]})}const qMe=[{title:"Ad-hoc analysis",body:"Browse semantic sources, build queries, and run nested logic in Explorer — no code.",href:fy.explorer},{title:"Notebook dashboards",body:"Code-first dashboards using Malloy notebooks. Versioned alongside your models.",href:fy.publishing},{title:"AI data agents",body:"Expose models via MCP so agents can discover sources and ask well-formed questions.",href:fy.mcpAgents}];function bIe({onClickEnvironment:e}){const{apiClients:t,mutable:n}=Dr(),{data:r,isSuccess:o,isError:a,error:i}=uo({queryKey:["environments"],queryFn:()=>t.environments.listEnvironments()});if(a)return m.jsx(Ta,{error:i,context:"Environments List"});if(!o)return m.jsx(Ca,{text:"Loading environments..."});const s=r.data??[];return m.jsxs(Ux,{maxWidth:"md",sx:{py:6},children:[m.jsxs(gt,{sx:{mb:5},children:[m.jsx(at,{variant:"h3",component:"h1",sx:{fontWeight:500,letterSpacing:"-0.025em",mb:1},children:"Publisher"}),m.jsx(at,{variant:"body1",color:"text.secondary",sx:{mb:3},children:"The open-source semantic model server for the Malloy data language."}),m.jsx(at,{variant:"body2",color:"text.secondary",sx:{maxWidth:720,lineHeight:1.6},children:"Define semantic models once — and use them everywhere. Publisher serves Malloy models through clean APIs, enabling consistent, interpretable, and AI-ready data access for tools, applications, and agents."})]}),m.jsx(ts,{container:!0,spacing:4,sx:{mb:5},children:qMe.map(c=>m.jsx(ts,{size:{xs:12,md:4},children:m.jsxs(Lr,{spacing:1,children:[m.jsx(at,{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}),m.jsx(at,{variant:"body2",color:"text.secondary",sx:{lineHeight:1.6},children:c.body})]})},c.title))}),m.jsx(yl,{sx:{my:4}}),s.length>0?m.jsxs(gt,{sx:{mb:4},children:[m.jsxs(Lr,{direction:"row",justifyContent:"space-between",alignItems:"flex-start",sx:{mb:3},children:[m.jsxs(gt,{children:[m.jsx(at,{variant:"h5",sx:{fontWeight:500,letterSpacing:"-0.025em",mb:.5},children:"Environments"}),m.jsx(at,{variant:"body2",color:"text.secondary",children:"Published environments available on this server"})]}),n&&m.jsx(h4,{})]}),m.jsx(ts,{container:!0,spacing:2,children:s.map(c=>m.jsx(ts,{size:{xs:12,sm:6,md:4},children:m.jsx(GMe,{environment:c,onClickEnvironment:e})},c.name))})]}):m.jsxs(gt,{sx:{mb:4},children:[m.jsx(at,{variant:"h5",sx:{fontWeight:500,letterSpacing:"-0.025em",mb:1},children:"Get started"}),m.jsx(at,{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?m.jsx(h4,{}):m.jsx(_r,{variant:"contained",color:"primary",href:fy.publishing,target:"_blank",rel:"noopener noreferrer",children:"Learn how to create models"})]}),m.jsx(yl,{sx:{my:4}}),m.jsxs(at,{variant:"body2",color:"text.secondary",children:["Publisher is built on fully open infrastructure and designed for the AI era. Join the"," ",m.jsx(gt,{component:"a",href:"https://join.slack.com/t/malloy-community/shared_invite/zt-1kgfwgi5g-CrsdaRqs81QY67QW0~t_uw",target:"_blank",rel:"noopener noreferrer",sx:{color:"text.primary",textDecoration:"underline"},children:"Malloy Slack community"})," ","to ask questions, share ideas, and contribute."]})]})}function GMe({environment:e,onClickEnvironment:t}){const{mutable:n}=Dr(),[r,o]=T.useState(null),a=!!r,i=T9(e.readme),s=f=>{e.name&&t&&t(`/${e.name}/`,f)},c=f=>{f.stopPropagation(),o(f.currentTarget)},u=()=>{o(null)};return m.jsx(ch,{variant:"outlined",onClick:s,sx:{height:"100%",cursor:"pointer",borderRadius:3,borderColor:"divider",boxShadow:"none",transition:"all 0.2s ease-in-out","&:hover":{boxShadow:2,borderColor:"primary.main"}},children:m.jsx(uh,{sx:{p:2.5,"&:last-child":{pb:2.5}},children:m.jsxs(gt,{sx:{display:"flex",alignItems:"flex-start",gap:1.5},children:[m.jsx(gt,{sx:f=>({width:36,height:36,borderRadius:1.5,bgcolor:f.palette.mode==="dark"?"rgba(255, 255, 255, 0.08)":"grey.100",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0,color:"text.primary"}),children:m.jsx(C9,{sx:{fontSize:20}})}),m.jsxs(gt,{sx:{flex:1,minWidth:0},children:[m.jsx(at,{variant:"subtitle1",component:"h6",noWrap:!0,sx:{fontWeight:600,mb:.5},children:e.name}),m.jsx(eo,{title:i,followCursor:!0,enterDelay:1e3,children:m.jsx(at,{variant:"body2",color:"text.secondary",sx:{overflow:"hidden",textOverflow:"ellipsis",display:"-webkit-box",WebkitLineClamp:2,WebkitBoxOrient:"vertical",lineHeight:1.5},children:i})})]}),n&&m.jsxs(m.Fragment,{children:[m.jsx(dr,{size:"small",onClick:c,"aria-label":`Environment actions for ${e.name}`,sx:{flexShrink:0,mt:-.5,mr:-.5},children:m.jsx(eS,{fontSize:"small"})}),m.jsxs(Zd,{anchorEl:r,open:a,onClose:u,onClick:f=>f.stopPropagation(),anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},children:[m.jsx(WMe,{environment:e,onCloseDialog:u}),m.jsx(VMe,{environment:e,onCloseDialog:u})]})]})]})})})}const px=Fn(m.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"})),YMe=Fn(m.jsx("path",{d:"M8 5v14l11-7z"}));function k9({open:e,onClose:t,result:n,title:r="Results",renderLogs:o}){return m.jsxs(wi,{open:e,onClose:t,maxWidth:!1,fullWidth:!0,sx:{"& .MuiDialog-paper":{width:"95vw",height:"95vh",maxWidth:"none"}},children:[m.jsxs(Ai,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[r,m.jsx(dr,{onClick:t,sx:{color:"text.secondary"},children:m.jsx(Ns,{})})]}),m.jsx(ki,{sx:{height:"calc(95vh - 120px)",overflow:"auto",padding:"0 16px"},children:m.jsx(NS,{result:n,maxHeight:800,maxResultSize:1e6,renderLogs:o})})]})}function KMe({queryName:e,annotations:t,resourceUri:n,runOnDemand:r=!1,maxResultSize:o=0}){const[a,i]=vt.useState(),[s,c]=vt.useState(!1),[u,f]=vt.useState(!1),{packageName:p,environmentName:y,versionId:g,modelPath:b}=to(n),{apiClients:x}=Dr(),{data:E,isSuccess:S,isLoading:w}=uo({queryKey:["namedQueryResult",n,e],queryFn:()=>x.models.executeQueryModel(y,p,b,{query:void 0,sourceName:void 0,queryName:e,versionId:g}),enabled:r?u:!0,...Poe}),{mode:C}=mb();return T.useEffect(()=>{if(t&&t.length>0){const R=t.map(M=>`// ${M}`).join(`
441
- `);tx(R,"typescript",C).then(M=>{i(M)})}},[t,C]),m.jsxs(ik,{children:[a&&m.jsx(gt,{sx:{marginBottom:"16px"},children:m.jsx(at,{fontSize:"12px",sx:{fontSize:"12px","& .line":{textWrap:"wrap"}},children:m.jsx("div",{className:"content",dangerouslySetInnerHTML:{__html:a}})})}),m.jsxs(gt,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"8px"},children:[m.jsx(at,{variant:"body2",sx:{fontSize:"15px",fontWeight:"600",color:"#495057",padding:"8px 16px",backgroundColor:"#f8f9fa",borderRadius:"6px",border:"1px solid #e9ecef"},children:e}),m.jsx(dr,{sx:{backgroundColor:"rgba(255, 255, 255, 0.9)","&:hover":{backgroundColor:"rgba(255, 255, 255, 1)"},width:"32px",height:"32px"},onClick:()=>c(!0),children:m.jsx(px,{sx:{fontSize:"18px",color:"text.secondary"}})})]}),m.jsxs(J0,{sx:{position:"relative"},children:[r&&!u&&m.jsxs(gt,{sx:{padding:"40px 20px",textAlign:"center",display:"flex",flexDirection:"column",alignItems:"center",gap:"16px"},children:[m.jsx(at,{variant:"body2",color:"text.secondary",children:"Click Run to execute the query"}),m.jsx(_r,{variant:"contained",startIcon:m.jsx(YMe,{}),onClick:()=>f(!0),sx:{backgroundColor:"#1976d2","&:hover":{backgroundColor:"#1565c0"},textTransform:"none",fontSize:"14px",fontWeight:600,padding:"8px 24px"},children:"Run Query"})]}),(!r||u)&&w&&m.jsx(gt,{sx:{padding:"20px",textAlign:"center"},children:m.jsx(at,{children:"Loading results..."})}),(!r||u)&&S&&E?.data?.result&&m.jsx(NS,{result:E.data.result,maxHeight:600,maxResultSize:o,renderLogs:E.data.renderLogs})]}),m.jsx(k9,{open:s,onClose:()=>c(!1),result:E?.data?.result||"",renderLogs:E?.data?.renderLogs,title:`Query: ${e}`})]})}function A9(e,t=!0){const{modelPath:n,environmentName:r,packageName:o,versionId:a}=to(e),{apiClients:i}=Dr();return uo({queryKey:["package",r,o,n,a],queryFn:async()=>(await i.models.getModel(r,o,n,a)).data,enabled:t})}function D9({data:e,onChange:t,existingQuery:n,initialSelectedSourceIndex:r=0,onSourceChange:o,resourceUri:a}){const[i,s]=vt.useState(r);vt.useEffect(()=>{s(r)},[r]);const{data:c,isError:u,isLoading:f,error:p}=A9(a,!e),{modelPath:y}=to(a),g=e||c;if(f&&!e)return m.jsx(Ca,{text:"Fetching Model..."});if(u&&!e)return console.log("error",p),m.jsx(Ta,{error:p,context:`ModelExplorer > ${y}`});if(!g)return m.jsx(Ca,{text:"Loading..."});const b=(g?.sourceInfos||[]).map((E,S)=>{try{return JSON.parse(E)?.name||`Source ${S+1}`}catch{return`Source ${S+1}`}}),x=b[i]||"";return m.jsxs(L1,{variant:"outlined",children:[m.jsx(oj,{children:m.jsx(Lr,{sx:{flexDirection:"row"},children:m.jsx(i2,{size:"small",id:"size-small-standard",disablePortal:!0,options:b,value:x,onChange:(E,S)=>{if(!S)return;const w=b.indexOf(S);w>=0&&(s(w),o?.(w))},renderInput:E=>m.jsx(Wn,{...E}),style:{width:350,marginTop:"3px",marginLeft:"6px",marginBottom:"8px"}})})}),m.jsx(wA,{children:m.jsxs(Lr,{spacing:2,component:"section",children:[Array.isArray(g.sourceInfos)&&g.sourceInfos.length>0&&m.jsx(z7,{sourceAndPaths:g.sourceInfos.map(E=>({sourceInfo:JSON.parse(E),modelPath:y})),selectedSourceIndex:i,existingQuery:n,onQueryChange:t,resourceUri:a}),m.jsx(gt,{height:"5px"})]})})]})}function O9({open:e,onClose:t,resourceUri:n,data:r,title:o="Data Sources",hasValidImport:a=!0,existingQuery:i,initialSelectedSourceIndex:s,onChange:c,onSourceChange:u}){return m.jsxs(wi,{open:e,onClose:t,fullScreen:!0,children:[m.jsxs(Ai,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[o,m.jsx(dr,{onClick:t,sx:{color:"text.secondary"},children:m.jsx(Ns,{})})]}),m.jsx(ki,{children:a?m.jsx(D9,{resourceUri:n,data:r,existingQuery:i,initialSelectedSourceIndex:s,onChange:c,onSourceChange:u}):m.jsx("div",{children:"No valid import statement found in cell"})})]})}function vIe({onChange:e,resourceUri:t,runOnDemand:n=!1,maxResultSize:r=0}){const{modelPath:o}=to(t),{data:a,isError:i,isLoading:s,error:c}=A9(t),[u,f]=vt.useState(!1),[p,y]=vt.useState(),[g,b]=vt.useState(0),[x,E]=T.useState(""),S=a?.modelDef,w=vt.useMemo(()=>{if(!S)return!1;try{const D=JSON.parse(S);return Array.isArray(D.imports)&&D.imports.length>0}catch{return!1}},[S]);if(s)return m.jsx(Ca,{text:"Fetching Model..."});if(i)return console.log("error",c),m.jsx(Ta,{error:c,context:`Model > ${o}`});const C=D=>{y(D),e&&e(D)},R=D=>{b(D)},M=()=>{const D=window.location.href;navigator.clipboard.writeText(D).then(()=>E("URL copied to clipboard!")).catch(()=>E("Failed to copy URL"))};return m.jsxs(m.Fragment,{children:[m.jsxs(gt,{sx:{position:"relative",maxWidth:"1200px",margin:"0 auto",paddingTop:"24px"},children:[Array.isArray(a?.sourceInfos)&&a.sourceInfos.length>0&&m.jsxs(Lr,{spacing:2,component:"section",children:[m.jsxs(gt,{sx:{padding:"0 0 16px 0",display:"flex",alignItems:"center",justifyContent:"space-between"},children:[m.jsx(at,{variant:"h1",sx:{fontSize:"28px",fontWeight:"600",color:"#1a1a1a",marginBottom:"8px",marginTop:"0",paddingLeft:"0"},children:"Sources"}),m.jsx(eo,{title:"Click to copy link",children:m.jsx(ZA,{sx:{fontSize:"24px",color:"text.secondary",cursor:"pointer"},onClick:M})})]}),m.jsx(D9,{data:a,onChange:C,onSourceChange:R,existingQuery:p,initialSelectedSourceIndex:g,resourceUri:t}),m.jsx(dr,{sx:{position:"absolute",top:"90px",right:"4px",backgroundColor:"rgba(255, 255, 255, 0.9)","&:hover":{backgroundColor:"rgba(255, 255, 255, 1)"},width:"32px",height:"32px",zIndex:2},onClick:()=>f(!0),children:m.jsx(px,{sx:{fontSize:"18px",color:"text.secondary",marginBottom:"5px"}})})]}),a?.queries?.length>0&&m.jsxs(Lr,{spacing:2,component:"section",sx:{marginTop:"24px"},children:[m.jsx(gt,{sx:{padding:"0 0 16px 0"},children:m.jsx(at,{variant:"h2",sx:{fontSize:"24px",fontWeight:"600",color:"#1a1a1a",marginBottom:"0",marginTop:"8px",paddingLeft:"0"},children:"Named Queries"})}),a.queries.map(D=>m.jsx(KMe,{queryName:D.name,annotations:D.annotations,resourceUri:t,runOnDemand:n,maxResultSize:r},D.name))]}),(!Array.isArray(a?.sourceInfos)||a.sourceInfos.length===0)&&!(a?.queries&&a.queries.length>0)&&m.jsxs(gt,{sx:{textAlign:"center",py:6},children:[m.jsx(at,{variant:"body1",sx:{color:"text.secondary",marginBottom:"8px"},children:"This model exposes no sources or queries."}),w&&m.jsxs(at,{variant:"body2",color:"text.secondary",children:["It imports other files but re-exports nothing. Add"," ",m.jsxs("code",{children:["export ","{ source_name }"]})," to surface imported sources here."]})]}),m.jsx(O9,{open:u,onClose:()=>f(!1),resourceUri:t,data:a,title:`Model: ${o.split("/").pop()}`,existingQuery:p,initialSelectedSourceIndex:g,onChange:C,onSourceChange:R})]}),m.jsx(_s,{open:x!=="",autoHideDuration:6e3,onClose:()=>E(""),message:x})]})}function QMe(e,t){return`${e}:${t}`}function Ou(e){return QMe(e.source,e.filterName??e.dimensionName)}function R9(e){return e.replace(/'/g,"\\'").replace(/\\/g,"\\\\")}function Js(e,t=!1){return e==null?"null":t?e instanceof Date?`@${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,"0")}-${String(e.getDate()).padStart(2,"0")}`:`@${e}`:typeof e=="string"?`'${R9(e)}'`:typeof e=="number"?String(e):typeof e=="boolean"?e?"true":"false":String(e)}function XMe(e){const{dimensionName:t,matchType:n,value:r,value2:o}=e,a=`\`${t}\``,i=r instanceof Date;switch(n){case"Equals":case"Semantic Search":return Array.isArray(r)&&r.length>0?`(${r.map(s=>`${a} = ${Js(s,i)}`).join(" or ")})`:Array.isArray(r)?"":`${a} = ${Js(r,i)}`;case"Contains":return typeof r=="string"?`${a} ~ f'%${R9(r)}%'`:Array.isArray(r)?"":`${a} = ${Js(r)}`;case"After":return Array.isArray(r)?"":`${a} > ${Js(r,i)}`;case"Before":return Array.isArray(r)?"":`${a} < ${Js(r,i)}`;case"Greater Than":return Array.isArray(r)?"":`${a} > ${Js(r)}`;case"Less Than":return Array.isArray(r)?"":`${a} < ${Js(r)}`;case"Between":return Array.isArray(r)?"":o!==void 0?`${a} >= ${Js(r,i)} and ${a} <= ${Js(o,i)}`:`${a} >= ${Js(r,i)}`;default:return""}}function ZMe(e){const t=new Map;for(const n of e){const r=`${n.source}|${n.model}`,o=t.get(r)||[];o.push(n),t.set(r,o)}return t}function JMe(e,t,n,r){const o=t.filter(c=>(c.filterType==="Star"||c.filterType==="MinMax"||c.filterType==="DateMinMax")&&!c.values);if(o.length===0)return"";const a=[...new Set(o.map(c=>c.dimensionName))].map(c=>`\`${c}\``).join(", "),i=r?.filter(c=>c.source===e)||[],s=i.length>0?i.map(c=>XMe(c)).filter(c=>c.length>0).join(" and "):"";return`
440
+ `)};function MMe(e={}){const{autoHideDuration:t=null,disableWindowBlurListener:n=!1,onClose:r,open:o,resumeHideDuration:a}=e,i=PS();T.useEffect(()=>{if(!o)return;function E(S){S.defaultPrevented||S.key==="Escape"&&r?.(S,"escapeKeyDown")}return document.addEventListener("keydown",E),()=>{document.removeEventListener("keydown",E)}},[o,r]);const s=Pt((E,S)=>{r?.(E,S)}),c=Pt(E=>{!r||E==null||i.start(E,()=>{s(null,"timeout")})});T.useEffect(()=>(o&&c(t),i.clear),[o,t,c,i]);const u=E=>{r?.(E,"clickaway")},f=i.clear,p=T.useCallback(()=>{t!=null&&c(a??t*.5)},[t,a,c]),y=E=>S=>{const w=E.onBlur;w?.(S),p()},g=E=>S=>{const w=E.onFocus;w?.(S),f()},b=E=>S=>{const w=E.onMouseEnter;w?.(S),f()},x=E=>S=>{const w=E.onMouseLeave;w?.(S),p()};return T.useEffect(()=>{if(!n&&o)return window.addEventListener("focus",p),window.addEventListener("blur",f),()=>{window.removeEventListener("focus",p),window.removeEventListener("blur",f)}},[n,o,p,f]),{getRootProps:(E={})=>{const S={...ci(e),...ci(E)};return{role:"presentation",...E,...S,onBlur:y(S),onFocus:g(S),onMouseEnter:b(S),onMouseLeave:x(S)}},onClickAway:u}}function p4(e){return e.substring(2).toLowerCase()}function NMe(e,t){return t.documentElement.clientWidth<e.clientX||t.documentElement.clientHeight<e.clientY}function PMe(e){const{children:t,disableReactTree:n=!1,mouseEvent:r="onClick",onClickAway:o,touchEvent:a="onTouchEnd"}=e,i=T.useRef(!1),s=T.useRef(null),c=T.useRef(!1),u=T.useRef(!1);T.useEffect(()=>(setTimeout(()=>{c.current=!0},0),()=>{c.current=!1}),[]);const f=cr(wh(t),s),p=Pt(b=>{const x=u.current;u.current=!1;const E=Po(s.current);if(!c.current||!s.current||"clientX"in b&&NMe(b,E))return;if(i.current){i.current=!1;return}let S;b.composedPath?S=b.composedPath().includes(s.current):S=!E.documentElement.contains(b.target)||s.current.contains(b.target),!S&&(n||!x)&&o(b)}),y=b=>x=>{u.current=!0;const E=t.props[b];E&&E(x)},g={ref:f};return a!==!1&&(g[a]=y(a)),T.useEffect(()=>{if(a!==!1){const b=p4(a),x=Po(s.current),E=()=>{i.current=!0};return x.addEventListener(b,p),x.addEventListener("touchmove",E),()=>{x.removeEventListener(b,p),x.removeEventListener("touchmove",E)}}},[p,a]),r!==!1&&(g[r]=y(r)),T.useEffect(()=>{if(r!==!1){const b=p4(r),x=Po(s.current);return x.addEventListener(b,p),()=>{x.removeEventListener(b,p)}}},[p,r]),T.cloneElement(t,g)}function IMe(e){return Ut("MuiSnackbarContent",e)}Lt("MuiSnackbarContent",["root","message","action"]);const _Me=e=>{const{classes:t}=e;return zt({root:["root"],action:["action"],message:["message"]},IMe,t)},LMe=Pe(rf,{name:"MuiSnackbarContent",slot:"Root"})(Pn(({theme:e})=>{const t=e.palette.mode==="light"?.8:.98;return{...e.typography.body2,color:e.vars?e.vars.palette.SnackbarContent.color:e.palette.getContrastText(vk(e.palette.background.default,t)),backgroundColor:e.vars?e.vars.palette.SnackbarContent.bg:vk(e.palette.background.default,t),display:"flex",alignItems:"center",flexWrap:"wrap",padding:"6px 16px",flexGrow:1,[e.breakpoints.up("sm")]:{flexGrow:"initial",minWidth:288}}})),FMe=Pe("div",{name:"MuiSnackbarContent",slot:"Message"})({padding:"8px 0"}),jMe=Pe("div",{name:"MuiSnackbarContent",slot:"Action"})({display:"flex",alignItems:"center",marginLeft:"auto",paddingLeft:16,marginRight:-8}),BMe=T.forwardRef(function(e,t){const n=An({props:e,name:"MuiSnackbarContent"}),{action:r,className:o,message:a,role:i="alert",...s}=n,c=n,u=_Me(c);return m.jsxs(LMe,{role:i,elevation:6,className:Ot(u.root,o),ownerState:c,ref:t,...s,children:[m.jsx(FMe,{className:u.message,ownerState:c,children:a}),r?m.jsx(jMe,{className:u.action,ownerState:c,children:r}):null]})});function $Me(e){return Ut("MuiSnackbar",e)}Lt("MuiSnackbar",["root","anchorOriginTopCenter","anchorOriginBottomCenter","anchorOriginTopRight","anchorOriginBottomRight","anchorOriginTopLeft","anchorOriginBottomLeft"]);const zMe=e=>{const{classes:t,anchorOrigin:n}=e,r={root:["root",`anchorOrigin${bt(n.vertical)}${bt(n.horizontal)}`]};return zt(r,$Me,t)},HMe=Pe("div",{name:"MuiSnackbar",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,t[`anchorOrigin${bt(n.anchorOrigin.vertical)}${bt(n.anchorOrigin.horizontal)}`]]}})(Pn(({theme:e})=>({zIndex:(e.vars||e).zIndex.snackbar,position:"fixed",display:"flex",left:8,right:8,justifyContent:"center",alignItems:"center",variants:[{props:({ownerState:t})=>t.anchorOrigin.vertical==="top",style:{top:8,[e.breakpoints.up("sm")]:{top:24}}},{props:({ownerState:t})=>t.anchorOrigin.vertical!=="top",style:{bottom:8,[e.breakpoints.up("sm")]:{bottom:24}}},{props:({ownerState:t})=>t.anchorOrigin.horizontal==="left",style:{justifyContent:"flex-start",[e.breakpoints.up("sm")]:{left:24,right:"auto"}}},{props:({ownerState:t})=>t.anchorOrigin.horizontal==="right",style:{justifyContent:"flex-end",[e.breakpoints.up("sm")]:{right:24,left:"auto"}}},{props:({ownerState:t})=>t.anchorOrigin.horizontal==="center",style:{[e.breakpoints.up("sm")]:{left:"50%",right:"auto",transform:"translateX(-50%)"}}}]}))),UMe=T.forwardRef(function(e,t){const n=An({props:e,name:"MuiSnackbar"}),r=_u(),o={enter:r.transitions.duration.enteringScreen,exit:r.transitions.duration.leavingScreen},{action:a,anchorOrigin:{vertical:i,horizontal:s}={vertical:"bottom",horizontal:"left"},autoHideDuration:c=null,children:u,className:f,ClickAwayListenerProps:p,ContentProps:y,disableWindowBlurListener:g=!1,message:b,onBlur:x,onClose:E,onFocus:S,onMouseEnter:w,onMouseLeave:C,open:R,resumeHideDuration:M,slots:D={},slotProps:I={},TransitionComponent:L,transitionDuration:F=o,TransitionProps:{onEnter:B,onExited:U,...k}={},...$}=n,j={...n,anchorOrigin:{vertical:i,horizontal:s},autoHideDuration:c,disableWindowBlurListener:g,TransitionComponent:L,transitionDuration:F},V=zMe(j),{getRootProps:z,onClickAway:K}=MMe({...j}),[Y,te]=T.useState(!0),_=Re=>{te(!0),U&&U(Re)},Z=(Re,de)=>{te(!1),B&&B(Re,de)},J={slots:{transition:L,...D},slotProps:{content:y,clickAwayListener:p,transition:k,...I}},[W,re]=tr("root",{ref:t,className:[V.root,f],elementType:HMe,getSlotProps:z,externalForwardedProps:{...J,...$},ownerState:j}),[ne,{ownerState:X,...ie}]=tr("clickAwayListener",{elementType:PMe,externalForwardedProps:J,getSlotProps:Re=>({onClickAway:(...de)=>{const me=de[0];Re.onClickAway?.(...de),!me?.defaultMuiPrevented&&K(...de)}}),ownerState:j}),[ae,fe]=tr("content",{elementType:BMe,shouldForwardComponentProp:!0,externalForwardedProps:J,additionalProps:{message:b,action:a},ownerState:j}),[xe,ge]=tr("transition",{elementType:Vy,externalForwardedProps:J,getSlotProps:Re=>({onEnter:(...de)=>{Re.onEnter?.(...de),Z(...de)},onExited:(...de)=>{Re.onExited?.(...de),_(...de)}}),additionalProps:{appear:!0,in:R,timeout:F,direction:i==="top"?"down":"up"},ownerState:j});return!R&&Y?null:m.jsx(ne,{...ie,...D.clickAwayListener&&{ownerState:X},children:m.jsx(W,{...re,children:m.jsx(xe,{...ge,children:u||m.jsx(ae,{...fe})})})})});function h4(){const[e,t]=T.useState(!1),{apiClients:n}=Dr(),[r,o]=T.useState(""),a=()=>{t(!0)},i=()=>{t(!1)},s=Ls(),c=Ho({async mutationFn(f){return n.environments.createEnvironment({name:f.name,readme:w9({name:f.name,readme:""},f.description)})},onSuccess(){i(),s.invalidateQueries({queryKey:["environments"]}),o("Environment created successfully")},onError(f){o(f instanceof Error?f.message:"An unknown error occurred")}}),u=async f=>{f.preventDefault();const p=new FormData(f.currentTarget),y=p.get("name")?.toString(),g=p.get("description")?.toString();if(!y)throw new Error("Name is required");c.mutate({name:y,description:g})};return m.jsxs(vt.Fragment,{children:[m.jsx(Zr,{variant:"contained",onClick:a,startIcon:m.jsx(Yae,{}),sx:{mt:2},children:"Create New Environment"}),m.jsxs(Dl,{open:e,onClose:i,children:[m.jsx(gc,{children:"Create New Environment"}),m.jsxs(Rl,{children:[m.jsx(Rb,{children:"Add a new environment to start exploring semantic models and analyzing data."}),m.jsxs("form",{onSubmit:u,id:"environment-form",children:[m.jsx(Wn,{autoFocus:!0,required:!0,margin:"dense",id:"name",name:"name",label:"Environment Name",type:"text",fullWidth:!0,variant:"standard"}),m.jsx(Wn,{margin:"dense",id:"description",name:"description",label:"Environment Description",placeholder:"Explore semantic models, run queries, and build dashboards",type:"text",fullWidth:!0,variant:"standard"})]})]}),m.jsxs(Ol,{children:[m.jsx(Zr,{disabled:c.isPending,onClick:i,children:"Cancel"}),m.jsx(Zr,{type:"submit",form:"environment-form",loading:c.isPending,children:"Create Environment"})]})]}),m.jsx(UMe,{open:r!=="",autoHideDuration:6e3,onClose:()=>o(""),message:r})]})}function VMe({environment:e,onCloseDialog:t}){const[n,r]=T.useState(!1),{apiClients:o}=Dr(),a=Ls(),[i,s]=T.useState(""),c=()=>{r(!0)},u=()=>{r(!1),t()},f=Ho({mutationFn:()=>o.environments.deleteEnvironment(e.name),onSuccess(){u(),a.invalidateQueries({queryKey:["environments"]}),s("Environment deleted successfully")},onError(p){s(p instanceof Error?p.message:"An unknown error occurred")}});return m.jsxs(vt.Fragment,{children:[m.jsxs(cc,{onClick:c,children:[m.jsx(sb,{children:m.jsx(Jx,{fontSize:"small"})}),m.jsx(Xd,{children:"Delete"})]}),m.jsxs(Dl,{onClose:u,"aria-labelledby":"customized-dialog-title",open:n,children:[m.jsx(gc,{sx:{m:0,p:2},id:"customized-dialog-title",children:"Delete Environment"}),m.jsx(gs,{"aria-label":"close",onClick:u,sx:p=>({position:"absolute",right:8,top:8,color:p.palette.grey[500]}),children:m.jsx(Ns,{})}),m.jsx(Rl,{dividers:!0,children:m.jsxs(lr,{gutterBottom:!0,children:['Are you sure you want to delete "',e.name,'"? This action cannot be undone.']})}),m.jsxs(Ol,{children:[m.jsx(Zr,{variant:"outlined",onClick:u,style:{borderColor:Ba.teal,color:Ba.teal},children:"Cancel"}),m.jsx(Zr,{loading:f.isPending,variant:"contained",autoFocus:!0,onClick:()=>f.mutate(),color:"error",children:"Delete"})]}),m.jsx(_s,{open:i!=="",autoHideDuration:6e3,onClose:()=>s(""),message:i})]})]})}function WMe({environment:e,onCloseDialog:t}){const[n,r]=T.useState(!1),{apiClients:o}=Dr(),a=Ls(),[i,s]=T.useState(""),c=()=>{r(!0)},u=()=>{r(!1),t()},f=Ho({async mutationFn(y){return o.environments.updateEnvironment(e.name,{name:e.name,readme:w9({name:e.name,readme:e.readme},y.description)})},onSuccess(){u(),a.invalidateQueries({queryKey:["environments"]}),s("Environment updated successfully")},onError(y){s(y instanceof Error?y.message:"An unknown error occurred")}}),p=y=>{y.preventDefault();const g=new FormData(y.currentTarget).get("description")?.toString();f.mutate({description:g})};return m.jsxs(vt.Fragment,{children:[m.jsxs(cc,{onClick:c,children:[m.jsx(sb,{children:m.jsx(RA,{fontSize:"small"})}),m.jsx(Xd,{children:"Edit"})]}),m.jsxs(Dl,{open:n,onClose:u,children:[m.jsx(gc,{children:"Edit Environment"}),m.jsxs(Rl,{children:[m.jsx(Rb,{children:"Edit this environment's description."}),m.jsxs("form",{onSubmit:p,id:"environment-form",children:[m.jsx(Wn,{autoFocus:!0,required:!0,margin:"dense",id:"name",name:"name",label:"Environment Name",disabled:!0,type:"text",fullWidth:!0,variant:"standard",defaultValue:e.name}),m.jsx(Wn,{margin:"dense",id:"description",name:"description",label:"Environment Description",type:"text",fullWidth:!0,variant:"standard",defaultValue:T9(e.readme)})]})]}),m.jsxs(Ol,{children:[m.jsx(Zr,{disabled:f.isPending,onClick:u,children:"Cancel"}),m.jsx(Zr,{type:"submit",form:"environment-form",loading:f.isPending,children:"Save Changes"})]})]}),m.jsx(_s,{open:i!=="",autoHideDuration:6e3,onClose:()=>s(""),message:i})]})}const qMe=[{title:"Ad-hoc analysis",body:"Browse semantic sources, build queries, and run nested logic in Explorer — no code.",href:fy.explorer},{title:"Notebook dashboards",body:"Code-first dashboards using Malloy notebooks. Versioned alongside your models.",href:fy.publishing},{title:"AI data agents",body:"Expose models via MCP so agents can discover sources and ask well-formed questions.",href:fy.mcpAgents}];function vIe({onClickEnvironment:e}){const{apiClients:t,mutable:n}=Dr(),{data:r,isSuccess:o,isError:a,error:i}=uo({queryKey:["environments"],queryFn:()=>t.environments.listEnvironments()});if(a)return m.jsx(Ta,{error:i,context:"Environments List"});if(!o)return m.jsx(Ca,{text:"Loading environments..."});const s=r.data??[];return m.jsxs(Ux,{maxWidth:"md",sx:{py:6},children:[m.jsxs(gt,{sx:{mb:5},children:[m.jsx(at,{variant:"h3",component:"h1",sx:{fontWeight:500,letterSpacing:"-0.025em",mb:1},children:"Publisher"}),m.jsx(at,{variant:"body1",color:"text.secondary",sx:{mb:3},children:"The open-source semantic model server for the Malloy data language."}),m.jsx(at,{variant:"body2",color:"text.secondary",sx:{maxWidth:720,lineHeight:1.6},children:"Define semantic models once — and use them everywhere. Publisher serves Malloy models through clean APIs, enabling consistent, interpretable, and AI-ready data access for tools, applications, and agents."})]}),m.jsx(ts,{container:!0,spacing:4,sx:{mb:5},children:qMe.map(c=>m.jsx(ts,{size:{xs:12,md:4},children:m.jsxs(Lr,{spacing:1,children:[m.jsx(at,{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}),m.jsx(at,{variant:"body2",color:"text.secondary",sx:{lineHeight:1.6},children:c.body})]})},c.title))}),m.jsx(yl,{sx:{my:4}}),s.length>0?m.jsxs(gt,{sx:{mb:4},children:[m.jsxs(Lr,{direction:"row",justifyContent:"space-between",alignItems:"flex-start",sx:{mb:3},children:[m.jsxs(gt,{children:[m.jsx(at,{variant:"h5",sx:{fontWeight:500,letterSpacing:"-0.025em",mb:.5},children:"Environments"}),m.jsx(at,{variant:"body2",color:"text.secondary",children:"Published environments available on this server"})]}),n&&m.jsx(h4,{})]}),m.jsx(ts,{container:!0,spacing:2,children:s.map(c=>m.jsx(ts,{size:{xs:12,sm:6,md:4},children:m.jsx(GMe,{environment:c,onClickEnvironment:e})},c.name))})]}):m.jsxs(gt,{sx:{mb:4},children:[m.jsx(at,{variant:"h5",sx:{fontWeight:500,letterSpacing:"-0.025em",mb:1},children:"Get started"}),m.jsx(at,{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?m.jsx(h4,{}):m.jsx(_r,{variant:"contained",color:"primary",href:fy.publishing,target:"_blank",rel:"noopener noreferrer",children:"Learn how to create models"})]}),m.jsx(yl,{sx:{my:4}}),m.jsxs(at,{variant:"body2",color:"text.secondary",children:["Publisher is built on fully open infrastructure and designed for the AI era. Join the"," ",m.jsx(gt,{component:"a",href:"https://join.slack.com/t/malloy-community/shared_invite/zt-1kgfwgi5g-CrsdaRqs81QY67QW0~t_uw",target:"_blank",rel:"noopener noreferrer",sx:{color:"text.primary",textDecoration:"underline"},children:"Malloy Slack community"})," ","to ask questions, share ideas, and contribute."]})]})}function GMe({environment:e,onClickEnvironment:t}){const{mutable:n}=Dr(),[r,o]=T.useState(null),a=!!r,i=T9(e.readme),s=f=>{e.name&&t&&t(`/${e.name}/`,f)},c=f=>{f.stopPropagation(),o(f.currentTarget)},u=()=>{o(null)};return m.jsx(ch,{variant:"outlined",onClick:s,sx:{height:"100%",cursor:"pointer",borderRadius:3,borderColor:"divider",boxShadow:"none",transition:"all 0.2s ease-in-out","&:hover":{boxShadow:2,borderColor:"primary.main"}},children:m.jsx(uh,{sx:{p:2.5,"&:last-child":{pb:2.5}},children:m.jsxs(gt,{sx:{display:"flex",alignItems:"flex-start",gap:1.5},children:[m.jsx(gt,{sx:f=>({width:36,height:36,borderRadius:1.5,bgcolor:f.palette.mode==="dark"?"rgba(255, 255, 255, 0.08)":"grey.100",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0,color:"text.primary"}),children:m.jsx(C9,{sx:{fontSize:20}})}),m.jsxs(gt,{sx:{flex:1,minWidth:0},children:[m.jsx(at,{variant:"subtitle1",component:"h6",noWrap:!0,sx:{fontWeight:600,mb:.5},children:e.name}),m.jsx(eo,{title:i,followCursor:!0,enterDelay:1e3,children:m.jsx(at,{variant:"body2",color:"text.secondary",sx:{overflow:"hidden",textOverflow:"ellipsis",display:"-webkit-box",WebkitLineClamp:2,WebkitBoxOrient:"vertical",lineHeight:1.5},children:i})})]}),n&&m.jsxs(m.Fragment,{children:[m.jsx(dr,{size:"small",onClick:c,"aria-label":`Environment actions for ${e.name}`,sx:{flexShrink:0,mt:-.5,mr:-.5},children:m.jsx(eS,{fontSize:"small"})}),m.jsxs(Zd,{anchorEl:r,open:a,onClose:u,onClick:f=>f.stopPropagation(),anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},children:[m.jsx(WMe,{environment:e,onCloseDialog:u}),m.jsx(VMe,{environment:e,onCloseDialog:u})]})]})]})})})}const px=Fn(m.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"})),YMe=Fn(m.jsx("path",{d:"M8 5v14l11-7z"}));function k9({open:e,onClose:t,result:n,title:r="Results",renderLogs:o}){return m.jsxs(wi,{open:e,onClose:t,maxWidth:!1,fullWidth:!0,sx:{"& .MuiDialog-paper":{width:"95vw",height:"95vh",maxWidth:"none"}},children:[m.jsxs(Ai,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[r,m.jsx(dr,{onClick:t,sx:{color:"text.secondary"},children:m.jsx(Ns,{})})]}),m.jsx(ki,{sx:{height:"calc(95vh - 120px)",overflow:"auto",padding:"0 16px"},children:m.jsx(NS,{result:n,maxHeight:800,maxResultSize:1e6,renderLogs:o})})]})}function KMe({queryName:e,annotations:t,resourceUri:n,runOnDemand:r=!1,maxResultSize:o=0}){const[a,i]=vt.useState(),[s,c]=vt.useState(!1),[u,f]=vt.useState(!1),{packageName:p,environmentName:y,versionId:g,modelPath:b}=to(n),{apiClients:x}=Dr(),{data:E,isSuccess:S,isLoading:w}=uo({queryKey:["namedQueryResult",n,e],queryFn:()=>x.models.executeQueryModel(y,p,b,{query:void 0,sourceName:void 0,queryName:e,versionId:g}),enabled:r?u:!0,...Poe}),{mode:C}=mb();return T.useEffect(()=>{if(t&&t.length>0){const R=t.map(M=>`// ${M}`).join(`
441
+ `);tx(R,"typescript",C).then(M=>{i(M)})}},[t,C]),m.jsxs(ik,{children:[a&&m.jsx(gt,{sx:{marginBottom:"16px"},children:m.jsx(at,{fontSize:"12px",sx:{fontSize:"12px","& .line":{textWrap:"wrap"}},children:m.jsx("div",{className:"content",dangerouslySetInnerHTML:{__html:a}})})}),m.jsxs(gt,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"8px"},children:[m.jsx(at,{variant:"body2",sx:{fontSize:"15px",fontWeight:"600",color:"#495057",padding:"8px 16px",backgroundColor:"#f8f9fa",borderRadius:"6px",border:"1px solid #e9ecef"},children:e}),m.jsx(dr,{sx:{backgroundColor:"rgba(255, 255, 255, 0.9)","&:hover":{backgroundColor:"rgba(255, 255, 255, 1)"},width:"32px",height:"32px"},onClick:()=>c(!0),children:m.jsx(px,{sx:{fontSize:"18px",color:"text.secondary"}})})]}),m.jsxs(J0,{sx:{position:"relative"},children:[r&&!u&&m.jsxs(gt,{sx:{padding:"40px 20px",textAlign:"center",display:"flex",flexDirection:"column",alignItems:"center",gap:"16px"},children:[m.jsx(at,{variant:"body2",color:"text.secondary",children:"Click Run to execute the query"}),m.jsx(_r,{variant:"contained",startIcon:m.jsx(YMe,{}),onClick:()=>f(!0),sx:{backgroundColor:"#1976d2","&:hover":{backgroundColor:"#1565c0"},textTransform:"none",fontSize:"14px",fontWeight:600,padding:"8px 24px"},children:"Run Query"})]}),(!r||u)&&w&&m.jsx(gt,{sx:{padding:"20px",textAlign:"center"},children:m.jsx(at,{children:"Loading results..."})}),(!r||u)&&S&&E?.data?.result&&m.jsx(NS,{result:E.data.result,maxHeight:600,maxResultSize:o,renderLogs:E.data.renderLogs})]}),m.jsx(k9,{open:s,onClose:()=>c(!1),result:E?.data?.result||"",renderLogs:E?.data?.renderLogs,title:`Query: ${e}`})]})}function A9(e,t=!0){const{modelPath:n,environmentName:r,packageName:o,versionId:a}=to(e),{apiClients:i}=Dr();return uo({queryKey:["package",r,o,n,a],queryFn:async()=>(await i.models.getModel(r,o,n,a)).data,enabled:t})}function D9({data:e,onChange:t,existingQuery:n,initialSelectedSourceIndex:r=0,onSourceChange:o,resourceUri:a}){const[i,s]=vt.useState(r);vt.useEffect(()=>{s(r)},[r]);const{data:c,isError:u,isLoading:f,error:p}=A9(a,!e),{modelPath:y}=to(a),g=e||c;if(f&&!e)return m.jsx(Ca,{text:"Fetching Model..."});if(u&&!e)return console.log("error",p),m.jsx(Ta,{error:p,context:`ModelExplorer > ${y}`});if(!g)return m.jsx(Ca,{text:"Loading..."});const b=(g?.sourceInfos||[]).map((E,S)=>{try{return JSON.parse(E)?.name||`Source ${S+1}`}catch{return`Source ${S+1}`}}),x=b[i]||"";return m.jsxs(L1,{variant:"outlined",children:[m.jsx(oj,{children:m.jsx(Lr,{sx:{flexDirection:"row"},children:m.jsx(i2,{size:"small",id:"size-small-standard",disablePortal:!0,options:b,value:x,onChange:(E,S)=>{if(!S)return;const w=b.indexOf(S);w>=0&&(s(w),o?.(w))},renderInput:E=>m.jsx(Wn,{...E}),style:{width:350,marginTop:"3px",marginLeft:"6px",marginBottom:"8px"}})})}),m.jsx(wA,{children:m.jsxs(Lr,{spacing:2,component:"section",children:[Array.isArray(g.sourceInfos)&&g.sourceInfos.length>0&&m.jsx(z7,{sourceAndPaths:g.sourceInfos.map(E=>({sourceInfo:JSON.parse(E),modelPath:y})),selectedSourceIndex:i,existingQuery:n,onQueryChange:t,resourceUri:a}),m.jsx(gt,{height:"5px"})]})})]})}function O9({open:e,onClose:t,resourceUri:n,data:r,title:o="Data Sources",hasValidImport:a=!0,existingQuery:i,initialSelectedSourceIndex:s,onChange:c,onSourceChange:u}){return m.jsxs(wi,{open:e,onClose:t,fullScreen:!0,children:[m.jsxs(Ai,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[o,m.jsx(dr,{onClick:t,sx:{color:"text.secondary"},children:m.jsx(Ns,{})})]}),m.jsx(ki,{children:a?m.jsx(D9,{resourceUri:n,data:r,existingQuery:i,initialSelectedSourceIndex:s,onChange:c,onSourceChange:u}):m.jsx("div",{children:"No valid import statement found in cell"})})]})}function xIe({onChange:e,resourceUri:t,runOnDemand:n=!1,maxResultSize:r=0}){const{modelPath:o}=to(t),{data:a,isError:i,isLoading:s,error:c}=A9(t),[u,f]=vt.useState(!1),[p,y]=vt.useState(),[g,b]=vt.useState(0),[x,E]=T.useState(""),S=a?.modelDef,w=vt.useMemo(()=>{if(!S)return!1;try{const D=JSON.parse(S);return Array.isArray(D.imports)&&D.imports.length>0}catch{return!1}},[S]);if(s)return m.jsx(Ca,{text:"Fetching Model..."});if(i)return console.log("error",c),m.jsx(Ta,{error:c,context:`Model > ${o}`});const C=D=>{y(D),e&&e(D)},R=D=>{b(D)},M=()=>{const D=window.location.href;navigator.clipboard.writeText(D).then(()=>E("URL copied to clipboard!")).catch(()=>E("Failed to copy URL"))};return m.jsxs(m.Fragment,{children:[m.jsxs(gt,{sx:{position:"relative",maxWidth:"1200px",margin:"0 auto",paddingTop:"24px"},children:[Array.isArray(a?.sourceInfos)&&a.sourceInfos.length>0&&m.jsxs(Lr,{spacing:2,component:"section",children:[m.jsxs(gt,{sx:{padding:"0 0 16px 0",display:"flex",alignItems:"center",justifyContent:"space-between"},children:[m.jsx(at,{variant:"h1",sx:{fontSize:"28px",fontWeight:"600",color:"#1a1a1a",marginBottom:"8px",marginTop:"0",paddingLeft:"0"},children:"Sources"}),m.jsx(eo,{title:"Click to copy link",children:m.jsx(ZA,{sx:{fontSize:"24px",color:"text.secondary",cursor:"pointer"},onClick:M})})]}),m.jsx(D9,{data:a,onChange:C,onSourceChange:R,existingQuery:p,initialSelectedSourceIndex:g,resourceUri:t}),m.jsx(dr,{sx:{position:"absolute",top:"90px",right:"4px",backgroundColor:"rgba(255, 255, 255, 0.9)","&:hover":{backgroundColor:"rgba(255, 255, 255, 1)"},width:"32px",height:"32px",zIndex:2},onClick:()=>f(!0),children:m.jsx(px,{sx:{fontSize:"18px",color:"text.secondary",marginBottom:"5px"}})})]}),a?.queries?.length>0&&m.jsxs(Lr,{spacing:2,component:"section",sx:{marginTop:"24px"},children:[m.jsx(gt,{sx:{padding:"0 0 16px 0"},children:m.jsx(at,{variant:"h2",sx:{fontSize:"24px",fontWeight:"600",color:"#1a1a1a",marginBottom:"0",marginTop:"8px",paddingLeft:"0"},children:"Named Queries"})}),a.queries.map(D=>m.jsx(KMe,{queryName:D.name,annotations:D.annotations,resourceUri:t,runOnDemand:n,maxResultSize:r},D.name))]}),(!Array.isArray(a?.sourceInfos)||a.sourceInfos.length===0)&&!(a?.queries&&a.queries.length>0)&&m.jsxs(gt,{sx:{textAlign:"center",py:6},children:[m.jsx(at,{variant:"body1",sx:{color:"text.secondary",marginBottom:"8px"},children:"This model exposes no sources or queries."}),w&&m.jsxs(at,{variant:"body2",color:"text.secondary",children:["It imports other files but re-exports nothing. Add"," ",m.jsxs("code",{children:["export ","{ source_name }"]})," to surface imported sources here."]})]}),m.jsx(O9,{open:u,onClose:()=>f(!1),resourceUri:t,data:a,title:`Model: ${o.split("/").pop()}`,existingQuery:p,initialSelectedSourceIndex:g,onChange:C,onSourceChange:R})]}),m.jsx(_s,{open:x!=="",autoHideDuration:6e3,onClose:()=>E(""),message:x})]})}function QMe(e,t){return`${e}:${t}`}function Ou(e){return QMe(e.source,e.filterName??e.dimensionName)}function R9(e){return e.replace(/'/g,"\\'").replace(/\\/g,"\\\\")}function Js(e,t=!1){return e==null?"null":t?e instanceof Date?`@${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,"0")}-${String(e.getDate()).padStart(2,"0")}`:`@${e}`:typeof e=="string"?`'${R9(e)}'`:typeof e=="number"?String(e):typeof e=="boolean"?e?"true":"false":String(e)}function XMe(e){const{dimensionName:t,matchType:n,value:r,value2:o}=e,a=`\`${t}\``,i=r instanceof Date;switch(n){case"Equals":case"Semantic Search":return Array.isArray(r)&&r.length>0?`(${r.map(s=>`${a} = ${Js(s,i)}`).join(" or ")})`:Array.isArray(r)?"":`${a} = ${Js(r,i)}`;case"Contains":return typeof r=="string"?`${a} ~ f'%${R9(r)}%'`:Array.isArray(r)?"":`${a} = ${Js(r)}`;case"After":return Array.isArray(r)?"":`${a} > ${Js(r,i)}`;case"Before":return Array.isArray(r)?"":`${a} < ${Js(r,i)}`;case"Greater Than":return Array.isArray(r)?"":`${a} > ${Js(r)}`;case"Less Than":return Array.isArray(r)?"":`${a} < ${Js(r)}`;case"Between":return Array.isArray(r)?"":o!==void 0?`${a} >= ${Js(r,i)} and ${a} <= ${Js(o,i)}`:`${a} >= ${Js(r,i)}`;default:return""}}function ZMe(e){const t=new Map;for(const n of e){const r=`${n.source}|${n.model}`,o=t.get(r)||[];o.push(n),t.set(r,o)}return t}function JMe(e,t,n,r){const o=t.filter(c=>(c.filterType==="Star"||c.filterType==="MinMax"||c.filterType==="DateMinMax")&&!c.values);if(o.length===0)return"";const a=[...new Set(o.map(c=>c.dimensionName))].map(c=>`\`${c}\``).join(", "),i=r?.filter(c=>c.source===e)||[],s=i.length>0?i.map(c=>XMe(c)).filter(c=>c.length>0).join(" and "):"";return`
442
442
  run: ${e} -> {
443
443
  ${s?`where: ${s}`:""}
444
444
  index: ${a}
@@ -452,9 +452,9 @@ import {${t.sourceName}}" from '${t.modelPath}'"
452
452
  `:r==="t"?" ":r==="r"?"\r":r):e}Ar.extend(E9);function lNe(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(`
453
453
  `):void 0}function cNe({given:e,value:t,onChange:n}){const r=e.name??"",o=e.type??"string",a=lNe(e),i=iNe(o,e.default),s=i!==void 0?`Default: ${i===""?"(empty)":i}`:void 0,c=a||s?m.jsxs(m.Fragment,{children:[a,a&&s?m.jsx("br",{}):null,s]}):void 0;if(o==="boolean"){const p=typeof t=="boolean",y=e.default?.trim()==="true";return m.jsxs(uA,{children:[m.jsxs(Lr,{direction:"row",alignItems:"center",children:[m.jsx(Tp,{control:m.jsx(Ww,{checked:p?t:y,onChange:g=>n(g.target.checked)}),label:r}),p&&m.jsx(dr,{size:"small","aria-label":"clear value",onClick:()=>n(null),edge:"end",children:m.jsx(N9,{fontSize:"small"})})]}),c&&m.jsx(cF,{children:c})]})}if(o==="number"){const p=typeof t=="number"?t:"";return m.jsx(xu,{label:r,type:"number",value:p,onChange:y=>{const g=y.target.value;n(g===""?null:Number(g))},placeholder:i,helperText:c,slotProps:{input:{endAdornment:p!==""&&m.jsx(m4,{onClear:()=>n(null)})}},fullWidth:!0,size:"small"})}if(o==="date"||o==="timestamp"||o==="timestamptz"){const p=t instanceof Date?Ar.utc(t):null;return m.jsx(fx,{dateAdapter:p2,children:m.jsx(y1,{label:r,value:p,onChange:y=>n(y?y.toDate():null),slotProps:{textField:{fullWidth:!0,size:"small",helperText:c},field:{clearable:!0,onClear:()=>n(null)}}})})}if(o.startsWith("array<")){const p=Array.isArray(t)?t.map(String):[];return m.jsx(CX,{multiple:!0,freeSolo:!0,options:[],value:p,onChange:(y,g)=>n(g.length===0?null:g),renderInput:y=>m.jsx(xu,{...y,label:r,size:"small",placeholder:p.length===0?i:void 0,helperText:c}),fullWidth:!0})}const u=typeof t=="string"?t:"",f=t!=null;return m.jsx(xu,{label:r,value:u,onChange:p=>n(p.target.value),placeholder:f?void 0:i??(o.startsWith("filter<")?o:void 0),helperText:c,slotProps:{input:{endAdornment:f&&m.jsx(m4,{onClear:()=>n(null)})}},fullWidth:!0,size:"small"})}function m4({onClear:e}){return m.jsx(IJ,{position:"end",children:m.jsx(dr,{size:"small","aria-label":"clear value",onClick:e,edge:"end",children:m.jsx(N9,{fontSize:"small"})})})}function uNe({givens:e,values:t,onChange:n,onClearAll:r}){if(e.length===0)return null;const o=t.size>0;return m.jsxs(Ci,{elevation:0,sx:{p:3,backgroundColor:"transparent",border:"none",boxShadow:"none"},children:[m.jsxs(Lr,{direction:"row",alignItems:"center",justifyContent:"space-between",sx:{mb:2},children:[m.jsx(at,{variant:"subtitle2",sx:{fontWeight:600,color:"#333"},children:"Parameters"}),o&&m.jsx(_r,{variant:"text",size:"small",onClick:r,sx:{textTransform:"none"},children:"Reset"})]}),m.jsx(gt,{sx:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(250px, 1fr))",gap:3},children:e.map(a=>m.jsx(gt,{children:m.jsx(cNe,{given:a,value:a.name?t.get(a.name):void 0,onChange:i=>a.name&&n(a.name,i)})},a.name))})]})}const dNe=Fn(m.jsx("path",{d:"M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12zm3 4H8c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h11c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2m0 16H8V7h11z"}));function fNe(e){const{environmentName:t,packageName:n}=to(e.resourceUri);if(!t||!n)throw new Error("Environment and Package name must be provided for query embedding.");return JSON.stringify({...e})}function pNe({href:e,title:t,children:n,envName:r,pkgName:o,sourceDir:a,onNavigate:i}){const s=!!e&&/^[a-z][a-z0-9+.-]*:/i.test(e);if(!(e&&!s&&!e.startsWith("/")&&!e.startsWith("#"))||!e){const p=s&&!/^(https?|mailto|tel):/i.test(e??"");return m.jsx("a",{href:p?void 0:e,title:t,...s?{target:"_blank",rel:"noopener noreferrer"}:{},children:n})}const c=new URL(e,`https://malloy.invalid/${a}`),u=c.pathname.slice(1)+c.search+c.hash,f=`/${r}/${o}/${u}`;return m.jsx("a",{href:f,title:t,onClick:i?p=>{p.preventDefault(),i(f,p)}:void 0,children:n})}function hNe({cell:e,hideCodeCellIcon:t,hideEmbeddingIcon:n,resourceUri:r,index:o,maxResultSize:a,isExecuting:i,onNavigate:s}){const[c,u]=vt.useState(!1),[f,p]=vt.useState(!1),[y,g]=vt.useState(!1),[b,x]=vt.useState(),[E,S]=vt.useState(),[w,C]=vt.useState(!1),[R,M]=T.useState(""),{environmentName:D,packageName:I,modelPath:L}=to(r),F=L&&L.includes("/")?L.slice(0,L.lastIndexOf("/")+1):"",B={overrides:{a:{component:pNe,props:{envName:D,pkgName:I,sourceDir:F,onNavigate:s}}}},U=/import\s*\{([^}]+)\}\s*from\s*['"`][^'"`]+['"`]/,k=/import\s*(?:\{[^}]*\}\s*from\s*)?['"`]([^'"`]+)['"`]/,$=_=>_.split(`
454
454
  `).filter(Z=>!Z.trimStart().startsWith("##")).join(`
455
- `),j=!!e.text&&(U.test(e.text)||k.test(e.text)),V=()=>{if(!e.newSources||e.newSources.length===0)return 0;let _=[],Z="";if(e.text){const J=e.text.match(U);J&&(_=J[1].split(",").map(re=>re.trim()));const W=e.text.match(k);W&&(Z=W[1].trim())}for(let J=0;J<e.newSources.length;J++)try{const W=JSON.parse(e.newSources[J]);if(_.length>0&&_.includes(W.name)||Z&&Z===W.path)return J}catch{continue}return 0},z=e.newSources&&e.newSources.length>0?{sourceInfos:e.newSources,resource:r}:void 0,K=fNe({query:e.text,resourceUri:r}),{mode:Y}=mb();T.useEffect(()=>{e.type==="code"&&tx($(e.text),"malloy",Y).then(_=>{x(_)})},[e,Y]),T.useEffect(()=>{tx(K,"typescript",Y).then(_=>{S(_)})},[K,Y]);const te=()=>{const _=window.location.href;navigator.clipboard.writeText(_).then(()=>M("URL copied to clipboard!")).catch(()=>M("Failed to copy URL"))};return e.type==="markdown"&&m.jsx(ik,{children:m.jsxs(gt,{sx:_=>({"& h1, & h2, & h3, & h4, & h5, & h6":{fontWeight:"600",color:_.palette.text.primary,marginBottom:"8px",marginTop:"16px"},"& h1":{fontSize:"28px"},"& h2":{fontSize:"24px"},"& h3":{fontSize:"20px"},"& p":{color:_.palette.text.primary,lineHeight:"1.7",marginBottom:"8px",fontSize:"16px"},"& ul, & ol":{color:_.palette.text.primary,lineHeight:"1.7",marginBottom:"8px",fontSize:"16px"},"& li":{marginBottom:"4px"}}),children:[o===0?m.jsxs(Lr,{direction:"row",alignItems:"flex-start",justifyContent:"space-between",children:[m.jsx(F1,{options:B,children:e.text}),m.jsx(eo,{title:"Click to copy link",children:m.jsx(ZA,{sx:{fontSize:"24px",color:"text.secondary",cursor:"pointer",marginTop:"26px"},onClick:te})})]}):m.jsx(F1,{options:B,children:e.text}),m.jsx(_s,{open:R!=="",autoHideDuration:6e3,onClose:()=>M(""),message:R})]})})||e.type==="code"&&m.jsxs(ik,{children:[(!t||!n&&e.result||e.newSources&&e.newSources.length>0)&&m.jsx(Lr,{sx:{flexDirection:"column",gap:"8px",marginBottom:"2px"},children:e.newSources&&e.newSources.length>0&&m.jsx(J0,{sx:{position:"relative",padding:"0"},children:m.jsxs(gt,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",paddingLeft:"24px",paddingRight:"8px"},children:[b&&m.jsx("span",{dangerouslySetInnerHTML:{__html:b},style:{fontFamily:"monospace",fontSize:"14px",flex:1,marginRight:"8px"}}),j&&m.jsx(dr,{sx:{backgroundColor:"rgba(255, 255, 255, 0.9)","&:hover":{backgroundColor:"rgba(255, 255, 255, 1)"},width:"32px",height:"32px",flexShrink:0},onClick:()=>C(!0),children:m.jsx(px,{sx:{fontSize:"18px",color:"grey.700"}})})]})})}),m.jsx(O9,{open:w,onClose:()=>C(!1),title:"Data Sources",hasValidImport:j,resourceUri:r,data:z,initialSelectedSourceIndex:V()}),m.jsxs(wi,{open:c,onClose:()=>u(!1),maxWidth:"lg",fullWidth:!0,children:[m.jsxs(Ai,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:["Malloy Code",m.jsx(dr,{onClick:()=>u(!1),sx:{color:"text.secondary"},children:m.jsx(Ns,{})})]}),m.jsx(ki,{children:m.jsx(gt,{sx:_=>({border:`1px solid ${_.palette.divider}`,borderRadius:"8px",padding:"16px",fontFamily:"monospace",fontSize:"14px",lineHeight:"1.5",overflow:"auto",maxHeight:"70vh",backgroundColor:_.palette.background.paper,color:_.palette.text.primary}),children:m.jsx("pre",{className:"code-display",style:{margin:0},dangerouslySetInnerHTML:{__html:b}})})})]}),m.jsxs(wi,{open:f,onClose:()=>p(!1),maxWidth:"lg",fullWidth:!0,children:[m.jsxs(Ai,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:["Embeddable Code",m.jsx(dr,{onClick:()=>p(!1),sx:{color:"text.secondary"},children:m.jsx(Ns,{})})]}),m.jsx(ki,{children:m.jsxs(Lr,{sx:{flexDirection:"row",justifyContent:"space-between",alignItems:"flex-start"},children:[m.jsx(at,{component:"div",sx:{fontSize:"12px",fontFamily:"monospace","& .line":{textWrap:"wrap"},flex:1},dangerouslySetInnerHTML:{__html:E}}),m.jsx(eo,{title:"Copy Embeddable Code",children:m.jsx(dr,{sx:{width:"24px",height:"24px",marginLeft:"8px",color:"text.secondary"},onClick:()=>{navigator.clipboard.writeText(K)},children:m.jsx(dNe,{})})})]})})]}),m.jsx(k9,{open:y,onClose:()=>g(!1),result:e.result||"",title:"Results"}),i&&!e.result&&!j&&!(e.newSources&&e.newSources.length>0)&&m.jsx(J0,{sx:{display:"flex",justifyContent:"center",alignItems:"center",minHeight:200},children:m.jsx(_x,{size:32})}),e.result&&m.jsxs(J0,{sx:{position:"relative"},children:[m.jsx(gt,{sx:{paddingTop:"24px"},children:m.jsx(NS,{result:e.result,maxHeight:700,maxResultSize:a})}),m.jsxs(Lr,{sx:{position:"absolute",top:"-12px",right:"8px",flexDirection:"row",gap:"8px",alignItems:"center",zIndex:2},children:[!t&&m.jsx(dr,{sx:{backgroundColor:"rgba(255, 255, 255, 0.9)","&:hover":{backgroundColor:"rgba(255, 255, 255, 1)"},width:"32px",height:"32px"},onClick:_=>{_.stopPropagation(),u(!0)},children:m.jsx(yB,{sx:{fontSize:"18px",color:"grey.700"}})}),m.jsx(dr,{sx:{backgroundColor:"rgba(255, 255, 255, 0.9)","&:hover":{backgroundColor:"rgba(255, 255, 255, 1)"},width:"32px",height:"32px"},onClick:()=>g(!0),children:m.jsx(px,{sx:{fontSize:"18px",color:"grey.700"}})})]})]})]})}const mNe=4;function gNe({resourceUri:e,maxResultSize:t=0,retrievalFn:n,onNavigate:r}){const{apiClients:o}=Dr(),{environmentName:a,packageName:i,versionId:s,modelPath:c}=to(e),{data:u,isSuccess:f,isError:p,error:y}=uo({queryKey:[e],queryFn:async()=>(await o.notebooks.getNotebook(a,i,c,s)).data}),[g,b]=T.useState([]),[x,E]=T.useState(!1),[S,w]=T.useState(null),C=T.useMemo(()=>u?kMe(u.annotations):null,[u]),R=T.useMemo(()=>u?.notebookCells?OMe(u.notebookCells):null,[u]),M=T.useMemo(()=>R?.sourceInfoMap??new Map,[R]),D=R?.modelPath??null,I=T.useMemo(()=>{const re=new Map;if(!u?.sources)return re;for(const ne of u.sources)if(ne.name&&ne.filters&&ne.filters.length>0){const X=ne.filters.filter(ie=>!ie.implicit);X.length>0&&re.set(ne.name,X)}return re},[u]),L=I.size>0,F=T.useMemo(()=>{if(L&&D){const re=[];for(const[ne,X]of I)for(const ie of X??[]){if(!ie.dimension||!ie.type)continue;let ae;const fe=ie.dimensionType;fe==="boolean"?ae="Boolean":fe==="date"||fe==="timestamp"||fe==="timestamptz"?ae="DateMinMax":fe==="number"?ae=ie.type==="equal"||ie.type==="in"?"Star":"MinMax":ae={equal:"Star",in:"Star",like:"Star",greater_than:"MinMax",less_than:"MinMax"}[ie.type]??"Star";const xe={equal:"Equals",in:"Equals",like:"Contains",greater_than:ae==="DateMinMax"?"After":"Greater Than",less_than:ae==="DateMinMax"?"Before":"Less Than"}[ie.type],ge=ie.name!==ie.dimension?ie.name:void 0;re.push({source:ne,model:D,dimensionName:ie.dimension,filterType:ae,label:ge,filterName:ie.name??ie.dimension,defaultMatchType:xe,required:ie.required??!1})}return re}return!C||M.size===0||!D?[]:RMe(M,C.filters,D)},[L,I,C,M,D]),{filterStates:B,updateFilter:U,getActiveFilters:k}=rNe({dimensionSpecs:F}),$=T.useMemo(()=>k(),[B,k]),j=aNe(u),{givenValues:V,updateGiven:z,clearAll:K}=oNe(j);T.useMemo(()=>{const re=new Map;for(const ne of F){const X=Ou(ne);re.set(X,ne.source)}return re},[F]);const{data:Y}=tNe({environment:a,package:i,dimensionSpecs:F,versionId:s,enabled:F.length>0}),te=T.useCallback(re=>{if(re.length===0)return;const ne=ie=>ie instanceof Date?ie.toISOString().slice(0,10):String(ie),X={};for(const ie of re){const ae=ie.filterName??ie.dimensionName,fe=ie.value;Array.isArray(fe)?X[ae]=fe.map(ne):fe!=null&&(X[ae]=ne(fe))}return Object.keys(X).length>0?JSON.stringify(X):void 0},[]),_=T.useCallback(re=>{if(re.size===0)return;const ne=ie=>ie instanceof Date?ie.toISOString().slice(0,10):Array.isArray(ie)?ie.map(ae=>ne(ae)):ie,X={};return re.forEach((ie,ae)=>{ie!=null&&(X[ae]=ne(ie))}),Object.keys(X).length>0?JSON.stringify(X):void 0},[]),Z=T.useCallback(async(re=[],ne=new Map)=>{if(!f||!u?.notebookCells)return;b(ae=>ae.length===0?u.notebookCells.map(fe=>({...fe})):ae.map(fe=>({...fe,result:void 0}))),E(!0),w(null);const X=L?te(re):void 0,ie=_(ne);try{const ae=[];for(let xe=0;xe<u.notebookCells.length;xe++){const ge=u.notebookCells[xe];if(ge.type==="markdown")continue;const Re=xe,de=async()=>{try{const me=(await o.notebooks.executeNotebookCell(a,i,c,Re,s,X,void 0,ie)).data,Qe=me.result,Me=ge.newSources||me.newSources;b(we=>{const Se=[...we];return Se[Re]||(Se[Re]={...ge}),Se[Re]={...Se[Re],result:Qe,newSources:Me},Se})}catch(me){console.error(`Error executing cell ${Re}:`,me)}};ae.push(de)}const fe=[];for(const xe of ae){const ge=xe().then(()=>{fe.splice(fe.indexOf(ge),1)});fe.push(ge),fe.length>=mNe&&await Promise.race(fe)}await Promise.all(fe)}catch(ae){console.error("Error executing notebook cells:",ae),w(ae)}finally{E(!1)}},[f,u,L,te,_,a,i,c,s,o.notebooks]);T.useEffect(()=>{!f||!u?.notebookCells||Z([],new Map)},[f,u,Z]);const J=T.useRef("");T.useEffect(()=>{const re=JSON.stringify({filters:$.map(ne=>({dim:ne.dimensionName,type:ne.matchType,val:ne.value,val2:ne.value2})),givens:Array.from(V.entries()).sort(([ne],[X])=>ne.localeCompare(X)).map(([ne,X])=>[ne,X instanceof Date?X.toISOString().slice(0,10):X])});if(re!==J.current){if(J.current===""&&$.length===0&&V.size===0){J.current=re;return}x||(J.current=re,Z($,V))}},[$,V,x,Z]);const W=T.useCallback(re=>ne=>{U(re,ne)},[U]);return F.some(re=>re.filterType==="Retrieval"),m.jsx(Coe,{children:m.jsx(Toe,{children:m.jsxs(Lr,{spacing:3,component:"section",children:[m.jsx(uNe,{givens:j,values:V,onChange:z,onClearAll:K}),F.length>0&&Y&&m.jsxs(Ci,{elevation:0,sx:{p:3,backgroundColor:"transparent",border:"none",boxShadow:"none"},children:[m.jsx(at,{variant:"subtitle2",sx:{fontWeight:600,mb:2,color:"#333"},children:"Filters"}),m.jsx(gt,{sx:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(250px, 1fr))",gap:3},children:F.map(re=>{const ne=Ou(re),X=Y.get(ne)||[],ie=B.get(ne);return re.filterType==="Retrieval"&&!n?null:m.jsx(gt,{children:m.jsx(wMe,{spec:re,values:X,selection:ie?.selection,onChange:W(ne),retrievalFn:n})},ne)})})]}),!f&&!p&&m.jsx(Ca,{text:"Fetching Notebook..."}),f&&(g.length>0?g:u?.notebookCells||[]).map((re,ne)=>m.jsx(hNe,{cell:re,index:ne,resourceUri:e,maxResultSize:t,isExecuting:x,onNavigate:r},ne)),p&&y.status===404&&m.jsxs(at,{variant:"body2",sx:{color:"text.secondary"},children:[m.jsx("code",{children:`${a} > ${i} > ${c}`})," ","not found."]}),p&&y.status!==404&&m.jsx(Ta,{error:y,context:`${a} > ${i} > ${c}`}),S&&m.jsx(Ta,{error:{message:S.message,status:500,name:"ExecutionError"},context:"Notebook Execution"})]})})})}const P9=Fn(m.jsx("path",{d:"M19 19H5V5h7V3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2v-7h-2zM14 3v2h3.59l-9.83 9.83 1.41 1.41L19 6.41V10h2V3z"})),yNe="publisher:resize";function bNe(e){return typeof e=="object"&&e!==null&&e.type===yNe&&typeof e.height=="number"}function I9(e){return e.replace(/\/api\/v0\/?$/,"")}function kg({type:e,size:t=18,sx:n,...r}){return m.jsxs(W1,{...r,viewBox:"0 0 24 24",sx:{width:t,height:t,fill:"none",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round",...n},children:[e==="report"&&m.jsx(vNe,{}),e==="model"&&m.jsx(xNe,{}),e==="data"&&m.jsx(SNe,{}),e==="materialization"&&m.jsx(ENe,{}),e==="page"&&m.jsx(CNe,{})]})}function vNe(){return m.jsxs(m.Fragment,{children:[m.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"}),m.jsx("path",{d:"M14 3 v4 a2 2 0 0 0 2 2 h4"}),m.jsx("path",{d:"M8 17 v-3"}),m.jsx("path",{d:"M12 17 v-6"}),m.jsx("path",{d:"M16 17 v-4"})]})}function xNe(){return m.jsxs(m.Fragment,{children:[m.jsx("path",{d:"M12 3 L4 7 v10 l8 4 l8 -4 V7 z"}),m.jsx("path",{d:"M4 7 l8 4 l8 -4"}),m.jsx("path",{d:"M12 11 v10"})]})}function SNe(){return m.jsxs(m.Fragment,{children:[m.jsx("rect",{x:"3.5",y:"3.5",width:"17",height:"17",rx:"2"}),m.jsx("path",{d:"M3.5 9.5 H20.5"}),m.jsx("path",{d:"M9.5 3.5 V20.5"})]})}function ENe(){return m.jsxs(m.Fragment,{children:[m.jsx("path",{d:"M12 3 L21 7.5 L12 12 L3 7.5 Z"}),m.jsx("path",{d:"M3 12 L12 16.5 L21 12"}),m.jsx("path",{d:"M3 16.5 L12 21 L21 16.5"})]})}function CNe(){return m.jsxs(m.Fragment,{children:[m.jsx("rect",{x:"3.5",y:"4.5",width:"17",height:"15",rx:"2"}),m.jsx("path",{d:"M3.5 9.5 H20.5"}),m.jsx("path",{d:"M7 13.5 H17"}),m.jsx("path",{d:"M7 16.5 H13"})]})}const g4="README.malloynb";function xIe({onClickPackageFile:e,resourceUri:t,retrievalFn:n}){const{apiClients:r,server:o}=Dr(),a=e??(I=>{window.location.href=I}),{environmentName:i,packageName:s,versionId:c}=to(t),[u,f]=T.useState(null),p=uo({queryKey:["package",i,s,c],queryFn:()=>r.packages.getPackage(i,s,c,!1)}),y=uo({queryKey:["notebooks",i,s,c],queryFn:()=>r.notebooks.listNotebooks(i,s,c)}),g=uo({queryKey:["models",i,s,c],queryFn:()=>r.models.listModels(i,s,c)}),b=uo({queryKey:["databases",i,s,c],queryFn:()=>r.databases.listDatabases(i,s,c)}),x=uo({queryKey:["pages",i,s],queryFn:async()=>{try{return await r.pages.listPages(i,s)}catch(I){const L=I?.response?.status;if(L===404||L===void 0)return{data:[]};throw I}}}).data?.data??[],E=(y.data?.data??[]).slice().sort((I,L)=>I.path.localeCompare(L.path)),S=(g.data?.data??[]).slice().sort((I,L)=>I.path.localeCompare(L.path)),w=(b.data?.data??[]).slice().sort((I,L)=>I.path.localeCompare(L.path)),C=p.data?.data?.description??"",R=E.some(I=>I.path===g4),M=MD({environmentName:i,packageName:s,versionId:c,modelPath:g4}),D=!y.isSuccess&&!y.isError;return p.isError?m.jsx(Ta,{error:p.error,context:`${i} > ${s}`}):m.jsxs(Ux,{maxWidth:!1,sx:{maxWidth:1024,mx:"auto",px:3,py:6},children:[m.jsxs(gt,{sx:{mb:4},children:[m.jsxs(fA,{onClick:I=>a(`/${i}/`,I),underline:"none",sx:{display:"inline-flex",alignItems:"center",gap:.5,cursor:"pointer",color:"text.secondary",fontSize:"0.875rem",mb:2,"&:hover":{color:"primary.main"}},children:[m.jsx(V7,{sx:{fontSize:18}}),"Back to ",i]}),m.jsx(at,{variant:"h4",component:"h1",sx:{fontWeight:600,letterSpacing:"-0.025em",mb:.5},children:s}),C&&m.jsx(at,{variant:"body2",color:"text.secondary",children:C})]}),D&&m.jsx(Ca,{text:"Loading package..."}),!D&&m.jsxs(m.Fragment,{children:[m.jsxs(Ag,{title:"Governed Reports",count:E.length,children:[E.map(I=>m.jsx(Dg,{icon:m.jsx(kg,{type:"report"}),tint:Ba.teal,label:I.path,onClick:L=>a(`/${i}/${s}/${I.path}`,L)},I.path)),E.length===0&&m.jsx(bw,{label:"No notebooks"})]}),x.length>0&&m.jsx(Ag,{title:"Pages",count:x.length,children:x.map(I=>{const L=!!I.title&&I.title!==I.path,F=`${I9(o)}${I.resource}`;return m.jsx(Dg,{icon:m.jsx(kg,{type:"page"}),tint:Ba.teal,label:L?I.title:I.path,rightLabel:L?I.path:void 0,onClick:B=>{e?e(`/${i}/${s}/pages/${I.path}`,B):B&&(B.metaKey||B.ctrlKey)?window.open(F,"_blank"):window.location.href=F},trailingAction:m.jsx(eo,{title:"Open standalone in new tab",children:m.jsx(dr,{size:"small",href:F,target:"_blank",rel:"noopener noreferrer","aria-label":"Open standalone in new tab",onClick:B=>B.stopPropagation(),sx:{color:"text.secondary"},children:m.jsx(P9,{fontSize:"small"})})})},I.path)})}),m.jsxs(Ag,{title:"Semantic Models",count:S.length,children:[S.map(I=>m.jsx(Dg,{icon:m.jsx(kg,{type:"model"}),tint:Ba.orange,label:I.path,onClick:L=>a(`/${i}/${s}/${I.path}`,L)},I.path)),S.length===0&&m.jsx(bw,{label:"No models"})]}),m.jsxs(Ag,{title:"Package Data",count:w.length,children:[w.map(I=>m.jsx(Dg,{icon:m.jsx(kg,{type:"data"}),tint:Ba.darkBlue,label:I.path,rightLabel:I.info?TNe(I.info.rowCount):"Unreadable",onClick:()=>f(I)},I.path)),w.length===0&&m.jsx(bw,{label:"No data files"})]}),m.jsx(Ag,{title:"Materializations",children:m.jsx(Dg,{icon:m.jsx(kg,{type:"materialization"}),tint:Ba.teal,label:"Materializations",onClick:I=>a(`/${i}/${s}/materializations`,I)})}),R&&m.jsx(gt,{sx:{mt:6},children:m.jsx(gNe,{resourceUri:M,retrievalFn:n,onNavigate:a})})]}),m.jsxs(wi,{open:u!==null,onClose:()=>f(null),maxWidth:"sm",fullWidth:!0,children:[m.jsxs(Ai,{sx:{pr:6},children:[u?.path,m.jsx(dr,{"aria-label":"close",onClick:()=>f(null),sx:{position:"absolute",right:8,top:8},children:m.jsx(Ns,{fontSize:"small"})})]}),m.jsxs(ki,{children:[u?.error&&m.jsx(at,{variant:"body2",color:"error",children:u.error}),u?.info?.columns&&m.jsxs(lb,{size:"small",children:[m.jsx(ub,{children:m.jsxs(bl,{children:[m.jsx(Mn,{children:"Column"}),m.jsx(Mn,{children:"Type"})]})}),m.jsx(cb,{children:u.info.columns.map(I=>m.jsxs(bl,{children:[m.jsx(Mn,{component:"th",scope:"row",children:I.name}),m.jsx(Mn,{children:I.type})]},I.name))})]})]})]})]})}function Ag({title:e,count:t,children:n}){return m.jsxs(gt,{sx:{mb:4},children:[m.jsxs(Lr,{direction:"row",alignItems:"baseline",spacing:1,sx:{mb:1},children:[m.jsx(at,{variant:"h6",sx:{fontWeight:600,letterSpacing:"-0.025em"},children:e}),t!==void 0&&m.jsxs(at,{variant:"caption",color:"text.secondary",children:["(",t,")"]})]}),m.jsx(gt,{children:n})]})}function Dg({icon:e,tint:t,label:n,rightLabel:r,onClick:o,trailingAction:a}){const i=!!o;return m.jsxs(gt,{onClick:o,onKeyDown:i?s=>{o&&(s.key==="Enter"||s.key===" ")&&(s.preventDefault(),o(s))}:void 0,role:i?"button":void 0,tabIndex:i?0:void 0,sx:s=>({display:"flex",alignItems:"center",gap:1.5,py:1,px:1,mx:-1,cursor:i?"pointer":"default",borderRadius:1.5,transition:"background-color 0.1s","&:hover":i?{backgroundColor:s.palette.mode==="dark"?"rgba(255, 255, 255, 0.08)":"grey.100"}:void 0,"&:focus-visible":i?{outline:"2px solid",outlineColor:"primary.main",outlineOffset:2}:void 0}),children:[m.jsx(gt,{sx:{width:32,height:32,borderRadius:1,bgcolor:t,color:"#FFFFFF",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0},children:e}),m.jsx(at,{variant:"body2",sx:{fontFamily:gi,flex:1,minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:n}),r&&m.jsx(at,{variant:"caption",color:"text.secondary",sx:{flexShrink:0},children:r}),a&&m.jsx(gt,{sx:{flexShrink:0,display:"flex",alignItems:"center"},children:a})]})}function bw({label:e}){return m.jsx(at,{variant:"body2",color:"text.secondary",sx:{py:1,fontStyle:"italic"},children:e})}function TNe(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 wNe(e){return Ut("MuiCollapse",e)}Lt("MuiCollapse",["root","horizontal","vertical","entered","hidden","wrapper","wrapperInner"]);const kNe=e=>{const{orientation:t,classes:n}=e,r={root:["root",`${t}`],entered:["entered"],hidden:["hidden"],wrapper:["wrapper",`${t}`],wrapperInner:["wrapperInner",`${t}`]};return zt(r,wNe,n)},ANe=Pe("div",{name:"MuiCollapse",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,t[n.orientation],n.state==="entered"&&t.entered,n.state==="exited"&&!n.in&&n.collapsedSize==="0px"&&t.hidden]}})(Pn(({theme:e})=>({height:0,overflow:"hidden",transition:e.transitions.create("height"),variants:[{props:{orientation:"horizontal"},style:{height:"auto",width:0,transition:e.transitions.create("width")}},{props:{state:"entered"},style:{height:"auto",overflow:"visible"}},{props:{state:"entered",orientation:"horizontal"},style:{width:"auto"}},{props:({ownerState:t})=>t.state==="exited"&&!t.in&&t.collapsedSize==="0px",style:{visibility:"hidden"}}]}))),DNe=Pe("div",{name:"MuiCollapse",slot:"Wrapper"})({display:"flex",width:"100%",variants:[{props:{orientation:"horizontal"},style:{width:"auto",height:"100%"}}]}),ONe=Pe("div",{name:"MuiCollapse",slot:"WrapperInner"})({width:"100%",variants:[{props:{orientation:"horizontal"},style:{width:"auto",height:"100%"}}]}),Qy=T.forwardRef(function(e,t){const n=An({props:e,name:"MuiCollapse"}),{addEndListener:r,children:o,className:a,collapsedSize:i="0px",component:s,easing:c,in:u,onEnter:f,onEntered:p,onEntering:y,onExit:g,onExited:b,onExiting:x,orientation:E="vertical",style:S,timeout:w=lB.standard,TransitionComponent:C=ms,...R}=n,M={...n,orientation:E,collapsedSize:i},D=kNe(M),I=_u(),L=PS(),F=T.useRef(null),B=T.useRef(),U=typeof i=="number"?`${i}px`:i,k=E==="horizontal",$=k?"width":"height",j=T.useRef(null),V=cr(t,j),z=re=>ne=>{if(re){const X=j.current;ne===void 0?re(X):re(X,ne)}},K=()=>F.current?F.current[k?"clientWidth":"clientHeight"]:0,Y=z((re,ne)=>{F.current&&k&&(F.current.style.position="absolute"),re.style[$]=U,f&&f(re,ne)}),te=z((re,ne)=>{const X=K();F.current&&k&&(F.current.style.position="");const{duration:ie,easing:ae}=Zp({style:S,timeout:w,easing:c},{mode:"enter"});if(w==="auto"){const fe=I.transitions.getAutoHeightDuration(X);re.style.transitionDuration=`${fe}ms`,B.current=fe}else re.style.transitionDuration=typeof ie=="string"?ie:`${ie}ms`;re.style[$]=`${X}px`,re.style.transitionTimingFunction=ae,y&&y(re,ne)}),_=z((re,ne)=>{re.style[$]="auto",p&&p(re,ne)}),Z=z(re=>{re.style[$]=`${K()}px`,g&&g(re)}),J=z(b),W=z(re=>{const ne=K(),{duration:X,easing:ie}=Zp({style:S,timeout:w,easing:c},{mode:"exit"});if(w==="auto"){const ae=I.transitions.getAutoHeightDuration(ne);re.style.transitionDuration=`${ae}ms`,B.current=ae}else re.style.transitionDuration=typeof X=="string"?X:`${X}ms`;re.style[$]=U,re.style.transitionTimingFunction=ie,x&&x(re)});return m.jsx(C,{in:u,onEnter:Y,onEntered:_,onEntering:te,onExit:Z,onExited:J,onExiting:W,addEndListener:re=>{w==="auto"&&L.start(B.current||0,re),r&&r(j.current,re)},nodeRef:j,timeout:w==="auto"?null:w,...R,children:(re,{ownerState:ne,...X})=>m.jsx(ANe,{as:s,className:Ot(D.root,a,{entered:D.entered,exited:!u&&U==="0px"&&D.hidden}[re]),style:{[k?"minWidth":"minHeight"]:U,...S},ref:V,ownerState:{...M,state:re},...X,children:m.jsx(DNe,{ownerState:{...M,state:re},className:D.wrapper,ref:F,children:m.jsx(ONe,{ownerState:{...M,state:re},className:D.wrapperInner,children:o})})})})});Qy&&(Qy.muiSupportAuto=!0);const RNe=T.createContext(null),kh=()=>{const e=T.useContext(RNe);if(e==null)throw new Error(["MUI X: Could not find the Tree View context.","It looks like you rendered your component outside of a SimpleTreeView or RichTreeView parent component.","This can also happen if you are bundling multiple versions of the Tree View."].join(`
456
- `));return e},MNe=({props:e})=>{const{instance:t}=kh(),{label:n,itemId:r}=e,[o,a]=T.useState(n),i=t.isItemBeingEdited(r);return T.useEffect(()=>{i||a(n)},[i,n]),{propsEnhancers:{labelInput:({externalEventHandlers:s,interactions:c})=>t.isItemEditable(r)?{value:o??"","data-element":"labelInput",onChange:u=>{s.onChange?.(u),a(u.target.value)},onKeyDown:u=>{if(s.onKeyDown?.(u),u.defaultMuiPrevented)return;const f=u.target;u.key==="Enter"&&f.value?c.handleSaveItemLabel(u,f.value):u.key==="Escape"&&c.handleCancelItemLabelEditing(u)},onBlur:u=>{s.onBlur?.(u),!u.defaultMuiPrevented&&u.target.value&&c.handleSaveItemLabel(u,u.target.value)},autoFocus:!0,type:"text"}:{}}}},ml=({instance:e,state:t,setState:n,params:r})=>{const o=T.useRef(t.editedItemId),a=p=>o.current===p,i=p=>{n(y=>pe({},y,{editedItemId:p})),o.current=p},s=p=>p===t.editedItemId,c=!!r.isItemEditable,u=p=>{if(p==null||!c)return!1;const y=e.getItem(p);return y?typeof r.isItemEditable=="function"?r.isItemEditable(y):!!r.isItemEditable:!1},f=(p,y)=>{if(!y)throw new Error(["MUI X: The Tree View component requires all items to have a `label` property.","The label of an item cannot be empty.",p].join(`
457
- `));n(g=>{const b=g.items.itemMetaMap[p];return b.label!==y?pe({},g,{items:pe({},g.items,{itemMetaMap:pe({},g.items.itemMetaMap,{[p]:pe({},b,{label:y})})})}):g}),r.onItemLabelChange&&r.onItemLabelChange(p,y)};return{instance:{setEditedItemId:i,isItemBeingEdited:s,updateItemLabel:f,isItemEditable:u,isTreeViewEditable:c,isItemBeingEditedRef:a},publicAPI:{updateItemLabel:f}}};ml.itemPlugin=MNe;ml.getDefaultizedParams=({params:e,experimentalFeatures:t})=>{const n=t?.labelEditing;return pe({},e,{isItemEditable:n?e.isItemEditable??!1:!1})};ml.getInitialState=()=>({editedItemId:null});ml.params={onItemLabelChange:!0,isItemEditable:!0};const Ip=(e,t)=>e.getAvailablePlugins().has(t),_9=e=>Array.isArray(e)?e.length>0&&e.some(_9):!!e,NNe=({itemId:e,children:t})=>{const{instance:n,selection:{multiSelect:r},publicAPI:o}=kh(),a={expandable:_9(t),expanded:n.isItemExpanded(e),focused:n.isItemFocused(e),selected:n.isItemSelected(e),disabled:n.isItemDisabled(e),editing:n?.isItemBeingEdited?n?.isItemBeingEdited(e):!1,editable:n.isItemEditable?n.isItemEditable(e):!1},i=f=>{if(a.disabled)return;a.focused||n.focusItem(f,e);const p=r&&(f.shiftKey||f.ctrlKey||f.metaKey);a.expandable&&!(p&&n.isItemExpanded(e))&&n.toggleItemExpansion(f,e)},s=f=>{a.disabled||(!a.focused&&!a.editing&&n.focusItem(f,e),r&&(f.shiftKey||f.ctrlKey||f.metaKey)?f.shiftKey?n.expandSelectionRange(f,e):n.selectItem({event:f,itemId:e,keepExistingSelection:!0}):n.selectItem({event:f,itemId:e,shouldBeSelected:!0}))},c=f=>{const p=f.nativeEvent.shiftKey;r&&p?n.expandSelectionRange(f,e):n.selectItem({event:f,itemId:e,keepExistingSelection:r,shouldBeSelected:f.target.checked})},u=()=>{Ip(n,ml)&&n.isItemEditable(e)&&(n.isItemBeingEdited(e)?n.setEditedItemId(null):n.setEditedItemId(e))};return{interactions:{handleExpansion:i,handleSelection:s,handleCheckboxSelection:c,toggleItemEditing:u,handleSaveItemLabel:(f,p)=>{Ip(n,ml)&&n.isItemBeingEditedRef(e)&&(n.updateItemLabel(e,p),u(),n.focusItem(f,e))},handleCancelItemLabelEditing:f=>{Ip(n,ml)&&n.isItemBeingEditedRef(e)&&(u(),n.focusItem(f,e))}},status:a,publicAPI:o}},PNe=T.createContext(()=>-1),y4=(e,t)=>t!==e.closest('*[role="treeitem"]'),INe=({id:e,treeId:t="",itemId:n})=>e??`${t}-${n}`,_Ne=e=>{const{runItemPlugins:t,items:{onItemClick:n,disabledItemsFocusable:r,indentationAtItemLevel:o},selection:{disableSelection:a,checkboxSelection:i},expansion:{expansionTrigger:s},treeId:c,instance:u,publicAPI:f}=kh(),p=T.useContext(PNe),{id:y,itemId:g,label:b,children:x,rootRef:E}=e,{rootRef:S,contentRef:w,propsEnhancers:C}=t(e),{interactions:R,status:M}=NNe({itemId:g,children:x}),D=T.useRef(null),I=T.useRef(null),L=cr(E,S,D),F=cr(w,I),B=T.useRef(null),U=INe({itemId:g,treeId:c,id:y}),k=u.canItemBeTabbed(g)?0:-1,$={rootRefObject:D,contentRefObject:I,interactions:R},j=J=>W=>{if(J.onFocus?.(W),W.defaultMuiPrevented)return;const re=!M.disabled||r;!M.focused&&re&&W.currentTarget===W.target&&u.focusItem(W,g)},V=J=>W=>{if(J.onBlur?.(W),W.defaultMuiPrevented)return;const re=u.getItemDOMElement(g);M.editing||W.relatedTarget&&y4(W.relatedTarget,re)&&(W.target&&W.target?.dataset?.element==="labelInput"&&y4(W.target,re)||W.relatedTarget?.dataset?.element==="labelInput")||u.removeFocusedItem()},z=J=>W=>{J.onKeyDown?.(W),!(W.defaultMuiPrevented||W.target?.dataset?.element==="labelInput")&&u.handleItemKeyDown(W,g)},K=J=>W=>{J.onDoubleClick?.(W),!W.defaultMuiPrevented&&R.toggleItemEditing()},Y=J=>W=>{J.onClick?.(W),n?.(W,g),!(W.defaultMuiPrevented||B.current?.contains(W.target))&&(s==="content"&&R.handleExpansion(W),i||R.handleSelection(W))},te=J=>W=>{J.onMouseDown?.(W),!W.defaultMuiPrevented&&(W.shiftKey||W.ctrlKey||W.metaKey||M.disabled)&&W.preventDefault()},_=J=>W=>{J.onChange?.(W),!W.defaultMuiPrevented&&(a||M.disabled||R.handleCheckboxSelection(W))},Z=J=>W=>{J.onClick?.(W),!W.defaultMuiPrevented&&s==="iconContainer"&&R.handleExpansion(W)};return{getRootProps:(J={})=>{const W=pe({},ci(e),ci(J));let re;M.selected?re=!0:a||M.disabled?re=void 0:re=!1;const ne=pe({},W,{ref:L,role:"treeitem",tabIndex:k,id:U,"aria-expanded":M.expandable?M.expanded:void 0,"aria-selected":re,"aria-disabled":M.disabled||void 0},J,{onFocus:j(W),onBlur:V(W),onKeyDown:z(W)});o&&(ne.style={"--TreeView-itemDepth":typeof p=="function"?p(g):p});const X=C.root?.(pe({},$,{externalEventHandlers:W}))??{};return pe({},ne,X)},getContentProps:(J={})=>{const W=ci(J),re=pe({},W,J,{ref:F,onClick:Y(W),onMouseDown:te(W),status:M});o&&(re.indentationAtItemLevel=!0);const ne=C.content?.(pe({},$,{externalEventHandlers:W}))??{};return pe({},re,ne)},getGroupTransitionProps:(J={})=>{const W=ci(J),re=pe({},W,{unmountOnExit:!0,component:"ul",role:"group",in:M.expanded,children:x},J);return o&&(re.indentationAtItemLevel=!0),re},getIconContainerProps:(J={})=>{const W=ci(J);return pe({},W,J,{onClick:Z(W)})},getCheckboxProps:(J={})=>{const W=ci(J);return pe({},W,{visible:i,ref:B,checked:M.selected,disabled:a||M.disabled,tabIndex:-1},J,{onChange:_(W)})},getLabelProps:(J={})=>{const W=pe({},ci(J)),re=pe({},W,{children:b},J,{onDoubleClick:K(W)});return u.isTreeViewEditable&&(re.editable=M.editable),re},getLabelInputProps:(J={})=>{const W=ci(J),re=C.labelInput?.({rootRefObject:D,contentRefObject:I,externalEventHandlers:W,interactions:R})??{};return pe({},J,re)},getDragAndDropOverlayProps:(J={})=>{const W=ci(J),re=C.dragAndDropOverlay?.(pe({},$,{externalEventHandlers:W}))??{};return pe({},J,re)},rootRef:L,status:M,publicAPI:f}},LNe=_Ne;function FNe(e){const{instance:t,items:{onItemClick:n},selection:{multiSelect:r,checkboxSelection:o,disableSelection:a},expansion:{expansionTrigger:i}}=kh(),s=t.isItemExpandable(e),c=t.isItemExpanded(e),u=t.isItemFocused(e),f=t.isItemSelected(e),p=t.isItemDisabled(e),y=t?.isItemBeingEdited?t?.isItemBeingEdited(e):!1,g=t.isItemEditable?t.isItemEditable(e):!1,b=C=>{if(!p){u||t.focusItem(C,e);const R=r&&(C.shiftKey||C.ctrlKey||C.metaKey);s&&!(R&&t.isItemExpanded(e))&&t.toggleItemExpansion(C,e)}},x=C=>{p||(!u&&!y&&t.focusItem(C,e),r&&(C.shiftKey||C.ctrlKey||C.metaKey)?C.shiftKey?t.expandSelectionRange(C,e):t.selectItem({event:C,itemId:e,keepExistingSelection:!0}):t.selectItem({event:C,itemId:e,shouldBeSelected:!0}))},E=C=>{if(a||p)return;const R=C.nativeEvent.shiftKey;r&&R?t.expandSelectionRange(C,e):t.selectItem({event:C,itemId:e,keepExistingSelection:r,shouldBeSelected:C.target.checked})},S=C=>{(C.shiftKey||C.ctrlKey||C.metaKey||p)&&C.preventDefault()},w=()=>{Ip(t,ml)&&t.isItemEditable(e)&&(t.isItemBeingEdited(e)?t.setEditedItemId(null):t.setEditedItemId(e))};return{disabled:p,expanded:c,selected:f,focused:u,editable:g,editing:y,disableSelection:a,checkboxSelection:o,handleExpansion:b,handleSelection:x,handleCheckboxSelection:E,handleContentClick:n,preventSelection:S,expansionTrigger:i,toggleItemEditing:w,handleSaveItemLabel:(C,R)=>{Ip(t,ml)&&t.isItemBeingEditedRef(e)&&(t.updateItemLabel(e,R),w(),t.focusItem(C,e))},handleCancelItemLabelEditing:C=>{Ip(t,ml)&&t.isItemBeingEditedRef(e)&&(w(),t.focusItem(C,e))}}}const jNe=Pe("div",{name:"MuiTreeItem2DragAndDropOverlay",slot:"Root",overridesResolver:(e,t)=>t.root,shouldForwardProp:e=>Hg(e)&&e!=="action"})(({theme:e})=>({position:"absolute",left:0,display:"flex",top:0,bottom:0,right:0,pointerEvents:"none",variants:[{props:{action:"make-child"},style:{marginLeft:"calc(var(--TreeView-indentMultiplier) * var(--TreeView-itemDepth))",borderRadius:e.shape.borderRadius,backgroundColor:e.vars?`rgba(${e.vars.palette.primary.darkChannel} / ${e.vars.palette.action.focusOpacity})`:Do(e.palette.primary.dark,e.palette.action.focusOpacity)}},{props:{action:"reorder-above"},style:{marginLeft:"calc(var(--TreeView-indentMultiplier) * var(--TreeView-itemDepth))",borderTop:`1px solid ${(e.vars||e).palette.action.active}`}},{props:{action:"reorder-below"},style:{marginLeft:"calc(var(--TreeView-indentMultiplier) * var(--TreeView-itemDepth))",borderBottom:`1px solid ${(e.vars||e).palette.action.active}`}},{props:{action:"move-to-parent"},style:{marginLeft:"calc(var(--TreeView-indentMultiplier) * calc(var(--TreeView-itemDepth) - 1))",borderBottom:`1px solid ${(e.vars||e).palette.action.active}`}}]}));function BNe(e){return e.action==null?null:m.jsx(jNe,pe({},e))}const $Ne=Pe("input",{name:"MuiTreeItem2",slot:"LabelInput",overridesResolver:(e,t)=>t.labelInput})(({theme:e})=>pe({},e.typography.body1,{width:"100%",backgroundColor:e.palette.background.paper,borderRadius:e.shape.borderRadius,border:"none",padding:"0 2px",boxSizing:"border-box","&:focus":{outline:`1px solid ${e.palette.primary.main}`}})),zNe=["classes","className","displayIcon","expansionIcon","icon","label","itemId","onClick","onMouseDown","dragAndDropOverlayProps","labelInputProps"],HNe=T.forwardRef(function(e,t){const{classes:n,className:r,displayIcon:o,expansionIcon:a,icon:i,label:s,itemId:c,onClick:u,onMouseDown:f,dragAndDropOverlayProps:p,labelInputProps:y}=e,g=fn(e,zNe),{disabled:b,expanded:x,selected:E,focused:S,editing:w,editable:C,disableSelection:R,checkboxSelection:M,handleExpansion:D,handleSelection:I,handleCheckboxSelection:L,handleContentClick:F,preventSelection:B,expansionTrigger:U,toggleItemEditing:k}=FNe(c),$=i||a||o,j=T.useRef(null),V=Y=>{B(Y),f&&f(Y)},z=Y=>{F?.(Y,c),!j.current?.contains(Y.target)&&(U==="content"&&D(Y),M||I(Y),u&&u(Y))},K=Y=>{Y.defaultMuiPrevented||k()};return m.jsxs("div",pe({},g,{className:Ot(n.root,r,x&&n.expanded,E&&n.selected,S&&n.focused,b&&n.disabled,w&&n.editing,C&&n.editable),onClick:z,onMouseDown:V,ref:t,children:[m.jsx("div",{className:n.iconContainer,children:$}),M&&m.jsx(FD,{className:n.checkbox,checked:E,onChange:L,disabled:b||R,ref:j,tabIndex:-1}),w?m.jsx($Ne,pe({},y,{className:n.labelInput})):m.jsx("div",pe({className:n.label},C&&{onDoubleClick:K},{children:s})),p&&m.jsx(BNe,pe({},p))]}))}),tc=Lt("MuiTreeItem",["root","groupTransition","content","expanded","selected","focused","disabled","iconContainer","label","checkbox","labelInput","editable","editing","dragAndDropOverlay"]),UNe=Fn(m.jsx("path",{d:"M10 6 8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z"})),VNe=Fn(m.jsx("path",{d:"M16.59 8.59 12 13.17 7.41 8.59 6 10l6 6 6-6z"}));function L9(e){const{children:t,itemId:n}=e,{wrapItem:r,instance:o}=kh();return r({children:t,itemId:n,instance:o})}L9.propTypes={children:Ke.node,itemId:Ke.string.isRequired};Pe("li",{name:"MuiTreeItem",slot:"Root",overridesResolver:(e,t)=>t.root})({listStyle:"none",margin:0,padding:0,outline:0});Pe(HNe,{name:"MuiTreeItem",slot:"Content",overridesResolver:(e,t)=>[t.content,t.iconContainer&&{[`& .${tc.iconContainer}`]:t.iconContainer},t.label&&{[`& .${tc.label}`]:t.label}],shouldForwardProp:e=>Cu(e)&&e!=="indentationAtItemLevel"})(({theme:e})=>({padding:e.spacing(.5,1),borderRadius:e.shape.borderRadius,width:"100%",boxSizing:"border-box",position:"relative",display:"flex",alignItems:"center",gap:e.spacing(1),cursor:"pointer",WebkitTapHighlightColor:"transparent","&:hover":{backgroundColor:(e.vars||e).palette.action.hover,"@media (hover: none)":{backgroundColor:"transparent"}},[`&.${tc.disabled}`]:{opacity:(e.vars||e).palette.action.disabledOpacity,backgroundColor:"transparent"},[`&.${tc.focused}`]:{backgroundColor:(e.vars||e).palette.action.focus},[`&.${tc.selected}`]:{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / ${e.vars.palette.action.selectedOpacity})`:Do(e.palette.primary.main,e.palette.action.selectedOpacity),"&:hover":{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.hoverOpacity}))`:Do(e.palette.primary.main,e.palette.action.selectedOpacity+e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / ${e.vars.palette.action.selectedOpacity})`:Do(e.palette.primary.main,e.palette.action.selectedOpacity)}},[`&.${tc.focused}`]:{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.focusOpacity}))`:Do(e.palette.primary.main,e.palette.action.selectedOpacity+e.palette.action.focusOpacity)}},[`& .${tc.iconContainer}`]:{width:16,display:"flex",flexShrink:0,justifyContent:"center","& svg":{fontSize:18}},[`& .${tc.label}`]:pe({width:"100%",boxSizing:"border-box",minWidth:0,position:"relative"},e.typography.body1),[`& .${tc.checkbox}`]:{padding:0},variants:[{props:{indentationAtItemLevel:!0},style:{paddingLeft:`calc(${e.spacing(1)} + var(--TreeView-itemChildrenIndentation) * var(--TreeView-itemDepth))`}}]}));Pe(Qy,{name:"MuiTreeItem",slot:"GroupTransition",overridesResolver:(e,t)=>t.groupTransition,shouldForwardProp:e=>Cu(e)&&e!=="indentationAtItemLevel"})({margin:0,padding:0,paddingLeft:"var(--TreeView-itemChildrenIndentation)",variants:[{props:{indentationAtItemLevel:!0},style:{paddingLeft:0}}]});function WNe(e){const{slots:t,slotProps:n,status:r}=e,o=kh(),a=pe({},o.icons.slots,{expandIcon:o.icons.slots.expandIcon??UNe,collapseIcon:o.icons.slots.collapseIcon??VNe}),i=o.icons.slotProps;let s;t?.icon?s="icon":r.expandable?r.expanded?s="collapseIcon":s="expandIcon":s="endIcon";const c=t?.[s]??a[s],u=mr({elementType:c,externalSlotProps:f=>pe({},Xp(i[s],f),Xp(n?.[s],f)),ownerState:{}});return c?m.jsx(c,pe({},u)):null}const qNe=["visible"],GNe=Pe("li",{name:"MuiTreeItem2",slot:"Root",overridesResolver:(e,t)=>t.root})({listStyle:"none",margin:0,padding:0,outline:0}),YNe=Pe("div",{name:"MuiTreeItem2",slot:"Content",overridesResolver:(e,t)=>t.content,shouldForwardProp:e=>Cu(e)&&e!=="status"&&e!=="indentationAtItemLevel"})(({theme:e})=>({padding:e.spacing(.5,1),borderRadius:e.shape.borderRadius,width:"100%",boxSizing:"border-box",position:"relative",display:"flex",alignItems:"center",gap:e.spacing(1),cursor:"pointer",WebkitTapHighlightColor:"transparent","&:hover":{backgroundColor:(e.vars||e).palette.action.hover,"@media (hover: none)":{backgroundColor:"transparent"}},variants:[{props:{indentationAtItemLevel:!0},style:{paddingLeft:`calc(${e.spacing(1)} + var(--TreeView-itemChildrenIndentation) * var(--TreeView-itemDepth))`}},{props:({status:t})=>t.disabled,style:{opacity:(e.vars||e).palette.action.disabledOpacity,backgroundColor:"transparent"}},{props:({status:t})=>t.focused,style:{backgroundColor:(e.vars||e).palette.action.focus}},{props:({status:t})=>t.selected,style:{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / ${e.vars.palette.action.selectedOpacity})`:Do(e.palette.primary.main,e.palette.action.selectedOpacity),"&:hover":{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.hoverOpacity}))`:Do(e.palette.primary.main,e.palette.action.selectedOpacity+e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / ${e.vars.palette.action.selectedOpacity})`:Do(e.palette.primary.main,e.palette.action.selectedOpacity)}}}},{props:({status:t})=>t.selected&&t.focused,style:{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.focusOpacity}))`:Do(e.palette.primary.main,e.palette.action.selectedOpacity+e.palette.action.focusOpacity)}}]})),KNe=Pe("div",{name:"MuiTreeItem2",slot:"Label",overridesResolver:(e,t)=>t.label,shouldForwardProp:e=>Cu(e)&&e!=="editable"})(({theme:e})=>pe({width:"100%",boxSizing:"border-box",minWidth:0,position:"relative",overflow:"hidden"},e.typography.body1,{variants:[{props:({editable:t})=>t,style:{paddingLeft:"2px"}}]})),QNe=Pe("div",{name:"MuiTreeItem2",slot:"IconContainer",overridesResolver:(e,t)=>t.iconContainer})({width:16,display:"flex",flexShrink:0,justifyContent:"center","& svg":{fontSize:18}});Pe(Qy,{name:"MuiTreeItem2",slot:"GroupTransition",overridesResolver:(e,t)=>t.groupTransition,shouldForwardProp:e=>Cu(e)&&e!=="indentationAtItemLevel"})({margin:0,padding:0,paddingLeft:"var(--TreeView-itemChildrenIndentation)",variants:[{props:{indentationAtItemLevel:!0},style:{paddingLeft:0}}]});Pe(T.forwardRef((e,t)=>{const{visible:n}=e,r=fn(e,qNe);return n?m.jsx(FD,pe({},r,{ref:t})):null}),{name:"MuiTreeItem2",slot:"Checkbox",overridesResolver:(e,t)=>t.checkbox})({padding:0});Lt("MuiRichTreeView",["root"]);Pe("ul",{name:"MuiRichTreeView",slot:"Root",overridesResolver:(e,t)=>t.root})({padding:0,margin:0,listStyle:"none",outline:0,position:"relative"});const XNe=Fn([m.jsx("path",{d:"M19 5v14H5V5zm0-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-2"},"0"),m.jsx("path",{d:"M14 17H7v-2h7zm3-4H7v-2h10zm0-4H7V7h10z"},"1")]),ZNe=Fn(m.jsx("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m1 15h-2v-2h2zm0-4h-2V7h2z"})),JNe=Fn(m.jsx("path",{d:"M19 15v4H5v-4zm1-2H4c-.55 0-1 .45-1 1v6c0 .55.45 1 1 1h16c.55 0 1-.45 1-1v-6c0-.55-.45-1-1-1M7 18.5c-.82 0-1.5-.67-1.5-1.5s.68-1.5 1.5-1.5 1.5.67 1.5 1.5-.67 1.5-1.5 1.5M19 5v4H5V5zm1-2H4c-.55 0-1 .45-1 1v6c0 .55.45 1 1 1h16c.55 0 1-.45 1-1V4c0-.55-.45-1-1-1M7 8.5c-.82 0-1.5-.67-1.5-1.5S6.18 5.5 7 5.5s1.5.68 1.5 1.5S7.83 8.5 7 8.5"})),ePe=Fn(m.jsx("path",{d:"M15 4v2h3v12h-3v2h5V4zM4 20h5v-2H6V6h3V4H4z"})),tPe=gse(Qy);function nPe(e){const t=nse({to:{opacity:e.in?1:0,transform:`translate3d(0,${e.in?0:20}px,0)`}});return m.jsx(tPe,{style:t,...e})}function rPe({item:e,...t}){const n=m.jsxs(KNe,{...t,sx:{display:"flex",alignItems:"center",color:e.error?"error.main":"grey.600"},children:[e.fileType==="directory"&&m.jsx(C9,{})||e.fileType==="notebook"&&m.jsx(XNe,{})||e.fileType==="model"&&m.jsx(ePe,{})||e.fileType=="database"&&m.jsx(JNe,{})||m.jsx(ZNe,{}),m.jsx(at,{variant:"body2",sx:{marginLeft:"5px"},color:e.error?"error.main":e.link?"primary.main":"grey.600",children:e.label})]});return e.error?m.jsx(eo,{title:e.error,placement:"right",children:n}):n}T.forwardRef(function(e,t){const{id:n,itemId:r,label:o,children:a,disabled:i,...s}=e,{getRootProps:c,getContentProps:u,getLabelProps:f,getIconContainerProps:p,getGroupTransitionProps:y,status:g,publicAPI:b}=LNe({id:n,itemId:r,children:a,label:o,disabled:i,rootRef:t}),x=b.getItem(r);return g.selected=!1,g.focused=!1,m.jsx(L9,{itemId:r,children:m.jsxs(GNe,{...c(s),children:[m.jsxs(YNe,{...u(),...x.link&&{onClick:E=>x.link(E)},sx:{pointerEvents:!x.selectable&&"none"},children:[m.jsx(QNe,{...p(),children:m.jsx(WNe,{status:g})}),m.jsx(rPe,{...f({item:x})})]}),a&&m.jsx(nPe,{...y()})]})})});function oPe(e){try{const{environmentName:t,packageName:n,modelPath:r}=to(e);return!t||!n||!r?null:{environmentName:t,packageName:n,pagePath:r}}catch{return null}}function SIe({resourceUri:e}){const{server:t,apiClients:n}=Dr(),r=oPe(e),o=r?.environmentName??"",a=r?.packageName??"",i=r?.pagePath??"",s=T.useMemo(()=>`${I9(t)}/environments/${encodeURIComponent(o)}/packages/${encodeURIComponent(a)}/${i}`,[t,o,a,i]),c=uo({queryKey:["pages",o,a],queryFn:()=>n.pages.listPages(o,a),enabled:!!r}).data?.data?.find(b=>b.path===i),u=c?.title??i,f=c?.fit==="viewport",p=T.useRef(null),[y,g]=T.useState(120);return T.useEffect(()=>{if(f)return;function b(x){bNe(x.data)&&x.source===p.current?.contentWindow&&x.data.height>0&&g(Math.ceil(x.data.height))}return window.addEventListener("message",b),()=>window.removeEventListener("message",b)},[f]),r?m.jsxs(gt,{sx:{p:3,...f?{height:"100%",display:"flex",flexDirection:"column"}:{maxWidth:1200,mx:"auto"}},children:[m.jsxs(Lr,{direction:"row",alignItems:"baseline",spacing:1,sx:{mb:1,flexShrink:0},children:[m.jsx(at,{variant:"h6",sx:{fontWeight:600,letterSpacing:"-0.025em"},children:u}),m.jsx(at,{variant:"caption",color:"text.secondary",sx:{fontFamily:gi},children:i}),m.jsx(gt,{sx:{flex:1}}),m.jsx(eo,{title:"Open standalone in new tab",children:m.jsx(dr,{size:"small",href:s,target:"_blank",rel:"noopener noreferrer","aria-label":"Open standalone in new tab",sx:{color:"text.secondary"},children:m.jsx(P9,{fontSize:"small"})})})]}),m.jsx(gt,{sx:{border:"1px solid",borderColor:"divider",borderRadius:1.5,overflow:"hidden",backgroundColor:"background.paper",...f?{flex:1,minHeight:0}:{}},children:m.jsx("iframe",{ref:p,src:s,title:u,sandbox:"allow-scripts allow-same-origin allow-forms",style:{display:"block",width:"100%",height:f?"100%":y,border:0}})})]}):m.jsxs(gt,{sx:{p:3,maxWidth:1200,mx:"auto"},children:[m.jsx(at,{variant:"h6",sx:{fontWeight:600},children:"Can't open page"}),m.jsxs(at,{variant:"body2",color:"text.secondary",sx:{mt:1},children:["This page link is missing an environment, package, or path:",m.jsx(gt,{component:"span",sx:{fontFamily:gi,ml:1},children:e})]})]})}function aPe(e){return{background:e.dashboardRoot,tableBackground:e.tableBackground,tableHeaderColor:e.tableHeader,tableBodyColor:e.tableBody,tableBorder:e.border,tablePinnedBackground:e.tableHeaderBackground,tablePinnedBorder:e.pinnedBorder,tableFontSize:`${e.font.size}px`,fontFamily:e.font.family,mapColor:e.mapColor}}function iPe(e){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}}function sPe(e){const{foreground:t,axisFaint:n,font:r}=e,o={background:e.background,font:r.family,title:{color:t,font:r.family},axis:{labelColor:t,titleColor:t,domainColor:n,tickColor:n,gridColor:n,labelFont:r.family,titleFont:r.family},legend:{labelColor:t,titleColor:t,labelFont:r.family,titleFont:r.family},header:{labelColor:t,titleColor:t},range:{category:e.series}};return a=>o}function lPe(e){if(!e)return;const t=e.tag("theme");if(!t)return;const n={},r=t.tag("palette");if(r){const a={},i=r.textArray("series");i&&i.length>0&&(a.series=i);for(const s of ij){const c=r.tag(s);if(!c)continue;const u={},f=c.text("light"),p=c.text("dark");f&&(u.light=f),p&&(u.dark=p),Object.keys(u).length>0&&(a[s]=u)}Object.keys(a).length>0&&(n.palette=a)}const o=t.tag("font");if(o){const a={},i=o.text("family");i&&(a.family=i);const s=o.numeric("size");typeof s=="number"&&Number.isFinite(s)&&(a.size=s),Object.keys(a).length>0&&(n.font=a)}return Object.keys(n).length>0?n:void 0}const cPe=async(e,t)=>{if(typeof window>"u")throw new Error("MalloyRenderer can only be used in browser environment");const{MalloyRenderer:n}=await co(async()=>{const{MalloyRenderer:r}=await import("./index-DzaYbhnD.js");return{MalloyRenderer:r}},[]);return new n({onClick:t,vegaConfigOverride:sPe(e),theme:aPe(e),onError:r=>{console.error("Error rendering visualization:",typeof r,r)}}).createViz()};typeof window<"u"&&co(()=>import("./index-DzaYbhnD.js"),[]);async function uPe(e){if(!e||typeof e!="object")return;const t=e,n=[...Array.isArray(t.model_annotations)?t.model_annotations:[],...Array.isArray(t.source_annotations)?t.source_annotations:[],...Array.isArray(t.annotations)?t.annotations:[]].map(o=>typeof o?.value=="string"?o.value:void 0).filter(o=>!!o);if(n.length===0)return;let r;try{({parseAnnotation:r}=await co(()=>import("./index-DQpV7MyA.js").then(o=>o.i),__vite__mapDeps([5,4])))}catch{return}try{const{tag:o}=r(n);return lPe(o)}catch(o){console.warn("Failed to parse # theme.* annotations; chart will render with the shell theme.",{error:o,lines:n});return}}function dPe(e,t){const n=iPe(t);for(const[r,o]of Object.entries(n))e.style.setProperty(r,o)}const fPe=`
455
+ `),j=!!e.text&&(U.test(e.text)||k.test(e.text)),V=()=>{if(!e.newSources||e.newSources.length===0)return 0;let _=[],Z="";if(e.text){const J=e.text.match(U);J&&(_=J[1].split(",").map(re=>re.trim()));const W=e.text.match(k);W&&(Z=W[1].trim())}for(let J=0;J<e.newSources.length;J++)try{const W=JSON.parse(e.newSources[J]);if(_.length>0&&_.includes(W.name)||Z&&Z===W.path)return J}catch{continue}return 0},z=e.newSources&&e.newSources.length>0?{sourceInfos:e.newSources,resource:r}:void 0,K=fNe({query:e.text,resourceUri:r}),{mode:Y}=mb();T.useEffect(()=>{e.type==="code"&&tx($(e.text),"malloy",Y).then(_=>{x(_)})},[e,Y]),T.useEffect(()=>{tx(K,"typescript",Y).then(_=>{S(_)})},[K,Y]);const te=()=>{const _=window.location.href;navigator.clipboard.writeText(_).then(()=>M("URL copied to clipboard!")).catch(()=>M("Failed to copy URL"))};return e.type==="markdown"&&m.jsx(ik,{children:m.jsxs(gt,{sx:_=>({"& h1, & h2, & h3, & h4, & h5, & h6":{fontWeight:"600",color:_.palette.text.primary,marginBottom:"8px",marginTop:"16px"},"& h1":{fontSize:"28px"},"& h2":{fontSize:"24px"},"& h3":{fontSize:"20px"},"& p":{color:_.palette.text.primary,lineHeight:"1.7",marginBottom:"8px",fontSize:"16px"},"& ul, & ol":{color:_.palette.text.primary,lineHeight:"1.7",marginBottom:"8px",fontSize:"16px"},"& li":{marginBottom:"4px"}}),children:[o===0?m.jsxs(Lr,{direction:"row",alignItems:"flex-start",justifyContent:"space-between",children:[m.jsx(F1,{options:B,children:e.text}),m.jsx(eo,{title:"Click to copy link",children:m.jsx(ZA,{sx:{fontSize:"24px",color:"text.secondary",cursor:"pointer",marginTop:"26px"},onClick:te})})]}):m.jsx(F1,{options:B,children:e.text}),m.jsx(_s,{open:R!=="",autoHideDuration:6e3,onClose:()=>M(""),message:R})]})})||e.type==="code"&&m.jsxs(ik,{children:[(!t||!n&&e.result||e.newSources&&e.newSources.length>0)&&m.jsx(Lr,{sx:{flexDirection:"column",gap:"8px",marginBottom:"2px"},children:e.newSources&&e.newSources.length>0&&m.jsx(J0,{sx:{position:"relative",padding:"0"},children:m.jsxs(gt,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",paddingLeft:"24px",paddingRight:"8px"},children:[b&&m.jsx("span",{dangerouslySetInnerHTML:{__html:b},style:{fontFamily:"monospace",fontSize:"14px",flex:1,marginRight:"8px"}}),j&&m.jsx(dr,{sx:{backgroundColor:"rgba(255, 255, 255, 0.9)","&:hover":{backgroundColor:"rgba(255, 255, 255, 1)"},width:"32px",height:"32px",flexShrink:0},onClick:()=>C(!0),children:m.jsx(px,{sx:{fontSize:"18px",color:"grey.700"}})})]})})}),m.jsx(O9,{open:w,onClose:()=>C(!1),title:"Data Sources",hasValidImport:j,resourceUri:r,data:z,initialSelectedSourceIndex:V()}),m.jsxs(wi,{open:c,onClose:()=>u(!1),maxWidth:"lg",fullWidth:!0,children:[m.jsxs(Ai,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:["Malloy Code",m.jsx(dr,{onClick:()=>u(!1),sx:{color:"text.secondary"},children:m.jsx(Ns,{})})]}),m.jsx(ki,{children:m.jsx(gt,{sx:_=>({border:`1px solid ${_.palette.divider}`,borderRadius:"8px",padding:"16px",fontFamily:"monospace",fontSize:"14px",lineHeight:"1.5",overflow:"auto",maxHeight:"70vh",backgroundColor:_.palette.background.paper,color:_.palette.text.primary}),children:m.jsx("pre",{className:"code-display",style:{margin:0},dangerouslySetInnerHTML:{__html:b}})})})]}),m.jsxs(wi,{open:f,onClose:()=>p(!1),maxWidth:"lg",fullWidth:!0,children:[m.jsxs(Ai,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:["Embeddable Code",m.jsx(dr,{onClick:()=>p(!1),sx:{color:"text.secondary"},children:m.jsx(Ns,{})})]}),m.jsx(ki,{children:m.jsxs(Lr,{sx:{flexDirection:"row",justifyContent:"space-between",alignItems:"flex-start"},children:[m.jsx(at,{component:"div",sx:{fontSize:"12px",fontFamily:"monospace","& .line":{textWrap:"wrap"},flex:1},dangerouslySetInnerHTML:{__html:E}}),m.jsx(eo,{title:"Copy Embeddable Code",children:m.jsx(dr,{sx:{width:"24px",height:"24px",marginLeft:"8px",color:"text.secondary"},onClick:()=>{navigator.clipboard.writeText(K)},children:m.jsx(dNe,{})})})]})})]}),m.jsx(k9,{open:y,onClose:()=>g(!1),result:e.result||"",title:"Results"}),i&&!e.result&&!j&&!(e.newSources&&e.newSources.length>0)&&m.jsx(J0,{sx:{display:"flex",justifyContent:"center",alignItems:"center",minHeight:200},children:m.jsx(_x,{size:32})}),e.result&&m.jsxs(J0,{sx:{position:"relative"},children:[m.jsx(gt,{sx:{paddingTop:"24px"},children:m.jsx(NS,{result:e.result,maxHeight:700,maxResultSize:a})}),m.jsxs(Lr,{sx:{position:"absolute",top:"-12px",right:"8px",flexDirection:"row",gap:"8px",alignItems:"center",zIndex:2},children:[!t&&m.jsx(dr,{sx:{backgroundColor:"rgba(255, 255, 255, 0.9)","&:hover":{backgroundColor:"rgba(255, 255, 255, 1)"},width:"32px",height:"32px"},onClick:_=>{_.stopPropagation(),u(!0)},children:m.jsx(yB,{sx:{fontSize:"18px",color:"grey.700"}})}),m.jsx(dr,{sx:{backgroundColor:"rgba(255, 255, 255, 0.9)","&:hover":{backgroundColor:"rgba(255, 255, 255, 1)"},width:"32px",height:"32px"},onClick:()=>g(!0),children:m.jsx(px,{sx:{fontSize:"18px",color:"grey.700"}})})]})]})]})}const mNe=4;function gNe({resourceUri:e,maxResultSize:t=0,retrievalFn:n,onNavigate:r}){const{apiClients:o}=Dr(),{environmentName:a,packageName:i,versionId:s,modelPath:c}=to(e),{data:u,isSuccess:f,isError:p,error:y}=uo({queryKey:[e],queryFn:async()=>(await o.notebooks.getNotebook(a,i,c,s)).data}),[g,b]=T.useState([]),[x,E]=T.useState(!1),[S,w]=T.useState(null),C=T.useMemo(()=>u?kMe(u.annotations):null,[u]),R=T.useMemo(()=>u?.notebookCells?OMe(u.notebookCells):null,[u]),M=T.useMemo(()=>R?.sourceInfoMap??new Map,[R]),D=R?.modelPath??null,I=T.useMemo(()=>{const re=new Map;if(!u?.sources)return re;for(const ne of u.sources)if(ne.name&&ne.filters&&ne.filters.length>0){const X=ne.filters.filter(ie=>!ie.implicit);X.length>0&&re.set(ne.name,X)}return re},[u]),L=I.size>0,F=T.useMemo(()=>{if(L&&D){const re=[];for(const[ne,X]of I)for(const ie of X??[]){if(!ie.dimension||!ie.type)continue;let ae;const fe=ie.dimensionType;fe==="boolean"?ae="Boolean":fe==="date"||fe==="timestamp"||fe==="timestamptz"?ae="DateMinMax":fe==="number"?ae=ie.type==="equal"||ie.type==="in"?"Star":"MinMax":ae={equal:"Star",in:"Star",like:"Star",greater_than:"MinMax",less_than:"MinMax"}[ie.type]??"Star";const xe={equal:"Equals",in:"Equals",like:"Contains",greater_than:ae==="DateMinMax"?"After":"Greater Than",less_than:ae==="DateMinMax"?"Before":"Less Than"}[ie.type],ge=ie.name!==ie.dimension?ie.name:void 0;re.push({source:ne,model:D,dimensionName:ie.dimension,filterType:ae,label:ge,filterName:ie.name??ie.dimension,defaultMatchType:xe,required:ie.required??!1})}return re}return!C||M.size===0||!D?[]:RMe(M,C.filters,D)},[L,I,C,M,D]),{filterStates:B,updateFilter:U,getActiveFilters:k}=rNe({dimensionSpecs:F}),$=T.useMemo(()=>k(),[B,k]),j=aNe(u),{givenValues:V,updateGiven:z,clearAll:K}=oNe(j);T.useMemo(()=>{const re=new Map;for(const ne of F){const X=Ou(ne);re.set(X,ne.source)}return re},[F]);const{data:Y}=tNe({environment:a,package:i,dimensionSpecs:F,versionId:s,enabled:F.length>0}),te=T.useCallback(re=>{if(re.length===0)return;const ne=ie=>ie instanceof Date?ie.toISOString().slice(0,10):String(ie),X={};for(const ie of re){const ae=ie.filterName??ie.dimensionName,fe=ie.value;Array.isArray(fe)?X[ae]=fe.map(ne):fe!=null&&(X[ae]=ne(fe))}return Object.keys(X).length>0?JSON.stringify(X):void 0},[]),_=T.useCallback(re=>{if(re.size===0)return;const ne=ie=>ie instanceof Date?ie.toISOString().slice(0,10):Array.isArray(ie)?ie.map(ae=>ne(ae)):ie,X={};return re.forEach((ie,ae)=>{ie!=null&&(X[ae]=ne(ie))}),Object.keys(X).length>0?JSON.stringify(X):void 0},[]),Z=T.useCallback(async(re=[],ne=new Map)=>{if(!f||!u?.notebookCells)return;b(ae=>ae.length===0?u.notebookCells.map(fe=>({...fe})):ae.map(fe=>({...fe,result:void 0}))),E(!0),w(null);const X=L?te(re):void 0,ie=_(ne);try{const ae=[];for(let xe=0;xe<u.notebookCells.length;xe++){const ge=u.notebookCells[xe];if(ge.type==="markdown")continue;const Re=xe,de=async()=>{try{const me=(await o.notebooks.executeNotebookCell(a,i,c,Re,s,X,void 0,ie)).data,Qe=me.result,Me=ge.newSources||me.newSources;b(we=>{const Se=[...we];return Se[Re]||(Se[Re]={...ge}),Se[Re]={...Se[Re],result:Qe,newSources:Me},Se})}catch(me){console.error(`Error executing cell ${Re}:`,me)}};ae.push(de)}const fe=[];for(const xe of ae){const ge=xe().then(()=>{fe.splice(fe.indexOf(ge),1)});fe.push(ge),fe.length>=mNe&&await Promise.race(fe)}await Promise.all(fe)}catch(ae){console.error("Error executing notebook cells:",ae),w(ae)}finally{E(!1)}},[f,u,L,te,_,a,i,c,s,o.notebooks]);T.useEffect(()=>{!f||!u?.notebookCells||Z([],new Map)},[f,u,Z]);const J=T.useRef("");T.useEffect(()=>{const re=JSON.stringify({filters:$.map(ne=>({dim:ne.dimensionName,type:ne.matchType,val:ne.value,val2:ne.value2})),givens:Array.from(V.entries()).sort(([ne],[X])=>ne.localeCompare(X)).map(([ne,X])=>[ne,X instanceof Date?X.toISOString().slice(0,10):X])});if(re!==J.current){if(J.current===""&&$.length===0&&V.size===0){J.current=re;return}x||(J.current=re,Z($,V))}},[$,V,x,Z]);const W=T.useCallback(re=>ne=>{U(re,ne)},[U]);return F.some(re=>re.filterType==="Retrieval"),m.jsx(Coe,{children:m.jsx(Toe,{children:m.jsxs(Lr,{spacing:3,component:"section",children:[m.jsx(uNe,{givens:j,values:V,onChange:z,onClearAll:K}),F.length>0&&Y&&m.jsxs(Ci,{elevation:0,sx:{p:3,backgroundColor:"transparent",border:"none",boxShadow:"none"},children:[m.jsx(at,{variant:"subtitle2",sx:{fontWeight:600,mb:2,color:"#333"},children:"Filters"}),m.jsx(gt,{sx:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(250px, 1fr))",gap:3},children:F.map(re=>{const ne=Ou(re),X=Y.get(ne)||[],ie=B.get(ne);return re.filterType==="Retrieval"&&!n?null:m.jsx(gt,{children:m.jsx(wMe,{spec:re,values:X,selection:ie?.selection,onChange:W(ne),retrievalFn:n})},ne)})})]}),!f&&!p&&m.jsx(Ca,{text:"Fetching Notebook..."}),f&&(g.length>0?g:u?.notebookCells||[]).map((re,ne)=>m.jsx(hNe,{cell:re,index:ne,resourceUri:e,maxResultSize:t,isExecuting:x,onNavigate:r},ne)),p&&y.status===404&&m.jsxs(at,{variant:"body2",sx:{color:"text.secondary"},children:[m.jsx("code",{children:`${a} > ${i} > ${c}`})," ","not found."]}),p&&y.status!==404&&m.jsx(Ta,{error:y,context:`${a} > ${i} > ${c}`}),S&&m.jsx(Ta,{error:{message:S.message,status:500,name:"ExecutionError"},context:"Notebook Execution"})]})})})}const P9=Fn(m.jsx("path",{d:"M19 19H5V5h7V3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2v-7h-2zM14 3v2h3.59l-9.83 9.83 1.41 1.41L19 6.41V10h2V3z"})),yNe="publisher:resize";function bNe(e){return typeof e=="object"&&e!==null&&e.type===yNe&&typeof e.height=="number"}function I9(e){return e.replace(/\/api\/v0\/?$/,"")}function vNe({server:e,environmentName:t,packageName:n,path:r}){const o=r.startsWith("public/")?r.slice(7):r;return`${I9(e)}/environments/${encodeURIComponent(t)}/packages/${encodeURIComponent(n)}/`+o}function kg({type:e,size:t=18,sx:n,...r}){return m.jsxs(W1,{...r,viewBox:"0 0 24 24",sx:{width:t,height:t,fill:"none",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round",...n},children:[e==="report"&&m.jsx(xNe,{}),e==="model"&&m.jsx(SNe,{}),e==="data"&&m.jsx(ENe,{}),e==="materialization"&&m.jsx(CNe,{}),e==="page"&&m.jsx(TNe,{})]})}function xNe(){return m.jsxs(m.Fragment,{children:[m.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"}),m.jsx("path",{d:"M14 3 v4 a2 2 0 0 0 2 2 h4"}),m.jsx("path",{d:"M8 17 v-3"}),m.jsx("path",{d:"M12 17 v-6"}),m.jsx("path",{d:"M16 17 v-4"})]})}function SNe(){return m.jsxs(m.Fragment,{children:[m.jsx("path",{d:"M12 3 L4 7 v10 l8 4 l8 -4 V7 z"}),m.jsx("path",{d:"M4 7 l8 4 l8 -4"}),m.jsx("path",{d:"M12 11 v10"})]})}function ENe(){return m.jsxs(m.Fragment,{children:[m.jsx("rect",{x:"3.5",y:"3.5",width:"17",height:"17",rx:"2"}),m.jsx("path",{d:"M3.5 9.5 H20.5"}),m.jsx("path",{d:"M9.5 3.5 V20.5"})]})}function CNe(){return m.jsxs(m.Fragment,{children:[m.jsx("path",{d:"M12 3 L21 7.5 L12 12 L3 7.5 Z"}),m.jsx("path",{d:"M3 12 L12 16.5 L21 12"}),m.jsx("path",{d:"M3 16.5 L12 21 L21 16.5"})]})}function TNe(){return m.jsxs(m.Fragment,{children:[m.jsx("rect",{x:"3.5",y:"4.5",width:"17",height:"15",rx:"2"}),m.jsx("path",{d:"M3.5 9.5 H20.5"}),m.jsx("path",{d:"M7 13.5 H17"}),m.jsx("path",{d:"M7 16.5 H13"})]})}const g4="README.malloynb";function SIe({onClickPackageFile:e,resourceUri:t,retrievalFn:n}){const{apiClients:r,server:o}=Dr(),a=e??(I=>{window.location.href=I}),{environmentName:i,packageName:s,versionId:c}=to(t),[u,f]=T.useState(null),p=uo({queryKey:["package",i,s,c],queryFn:()=>r.packages.getPackage(i,s,c,!1)}),y=uo({queryKey:["notebooks",i,s,c],queryFn:()=>r.notebooks.listNotebooks(i,s,c)}),g=uo({queryKey:["models",i,s,c],queryFn:()=>r.models.listModels(i,s,c)}),b=uo({queryKey:["databases",i,s,c],queryFn:()=>r.databases.listDatabases(i,s,c)}),x=uo({queryKey:["pages",i,s],queryFn:async()=>{try{return await r.pages.listPages(i,s)}catch(I){const L=I?.response?.status;if(L===404||L===void 0)return{data:[]};throw I}}}).data?.data??[],E=(y.data?.data??[]).slice().sort((I,L)=>I.path.localeCompare(L.path)),S=(g.data?.data??[]).slice().sort((I,L)=>I.path.localeCompare(L.path)),w=(b.data?.data??[]).slice().sort((I,L)=>I.path.localeCompare(L.path)),C=p.data?.data?.description??"",R=E.some(I=>I.path===g4),M=MD({environmentName:i,packageName:s,versionId:c,modelPath:g4}),D=!y.isSuccess&&!y.isError;return p.isError?m.jsx(Ta,{error:p.error,context:`${i} > ${s}`}):m.jsxs(Ux,{maxWidth:!1,sx:{maxWidth:1024,mx:"auto",px:3,py:6},children:[m.jsxs(gt,{sx:{mb:4},children:[m.jsxs(fA,{onClick:I=>a(`/${i}/`,I),underline:"none",sx:{display:"inline-flex",alignItems:"center",gap:.5,cursor:"pointer",color:"text.secondary",fontSize:"0.875rem",mb:2,"&:hover":{color:"primary.main"}},children:[m.jsx(V7,{sx:{fontSize:18}}),"Back to ",i]}),m.jsx(at,{variant:"h4",component:"h1",sx:{fontWeight:600,letterSpacing:"-0.025em",mb:.5},children:s}),C&&m.jsx(at,{variant:"body2",color:"text.secondary",children:C})]}),D&&m.jsx(Ca,{text:"Loading package..."}),!D&&m.jsxs(m.Fragment,{children:[m.jsxs(Ag,{title:"Governed Reports",count:E.length,children:[E.map(I=>m.jsx(Dg,{icon:m.jsx(kg,{type:"report"}),tint:Ba.teal,label:I.path,onClick:L=>a(`/${i}/${s}/${I.path}`,L)},I.path)),E.length===0&&m.jsx(bw,{label:"No notebooks"})]}),x.length>0&&m.jsx(Ag,{title:"Pages",count:x.length,children:x.map(I=>{const L=!!I.title&&I.title!==I.path,F=`${I9(o)}${I.resource}`;return m.jsx(Dg,{icon:m.jsx(kg,{type:"page"}),tint:Ba.teal,label:L?I.title:I.path,rightLabel:L?I.path:void 0,onClick:B=>{e?e(`/${i}/${s}/pages/${I.path}`,B):B&&(B.metaKey||B.ctrlKey)?window.open(F,"_blank"):window.location.href=F},trailingAction:m.jsx(eo,{title:"Open standalone in new tab",children:m.jsx(dr,{size:"small",href:F,target:"_blank",rel:"noopener noreferrer","aria-label":"Open standalone in new tab",onClick:B=>B.stopPropagation(),sx:{color:"text.secondary"},children:m.jsx(P9,{fontSize:"small"})})})},I.path)})}),m.jsxs(Ag,{title:"Semantic Models",count:S.length,children:[S.map(I=>m.jsx(Dg,{icon:m.jsx(kg,{type:"model"}),tint:Ba.orange,label:I.path,onClick:L=>a(`/${i}/${s}/${I.path}`,L)},I.path)),S.length===0&&m.jsx(bw,{label:"No models"})]}),m.jsxs(Ag,{title:"Package Data",count:w.length,children:[w.map(I=>m.jsx(Dg,{icon:m.jsx(kg,{type:"data"}),tint:Ba.darkBlue,label:I.path,rightLabel:I.info?wNe(I.info.rowCount):"Unreadable",onClick:()=>f(I)},I.path)),w.length===0&&m.jsx(bw,{label:"No data files"})]}),m.jsx(Ag,{title:"Materializations",children:m.jsx(Dg,{icon:m.jsx(kg,{type:"materialization"}),tint:Ba.teal,label:"Materializations",onClick:I=>a(`/${i}/${s}/materializations`,I)})}),R&&m.jsx(gt,{sx:{mt:6},children:m.jsx(gNe,{resourceUri:M,retrievalFn:n,onNavigate:a})})]}),m.jsxs(wi,{open:u!==null,onClose:()=>f(null),maxWidth:"sm",fullWidth:!0,children:[m.jsxs(Ai,{sx:{pr:6},children:[u?.path,m.jsx(dr,{"aria-label":"close",onClick:()=>f(null),sx:{position:"absolute",right:8,top:8},children:m.jsx(Ns,{fontSize:"small"})})]}),m.jsxs(ki,{children:[u?.error&&m.jsx(at,{variant:"body2",color:"error",children:u.error}),u?.info?.columns&&m.jsxs(lb,{size:"small",children:[m.jsx(ub,{children:m.jsxs(bl,{children:[m.jsx(Mn,{children:"Column"}),m.jsx(Mn,{children:"Type"})]})}),m.jsx(cb,{children:u.info.columns.map(I=>m.jsxs(bl,{children:[m.jsx(Mn,{component:"th",scope:"row",children:I.name}),m.jsx(Mn,{children:I.type})]},I.name))})]})]})]})]})}function Ag({title:e,count:t,children:n}){return m.jsxs(gt,{sx:{mb:4},children:[m.jsxs(Lr,{direction:"row",alignItems:"baseline",spacing:1,sx:{mb:1},children:[m.jsx(at,{variant:"h6",sx:{fontWeight:600,letterSpacing:"-0.025em"},children:e}),t!==void 0&&m.jsxs(at,{variant:"caption",color:"text.secondary",children:["(",t,")"]})]}),m.jsx(gt,{children:n})]})}function Dg({icon:e,tint:t,label:n,rightLabel:r,onClick:o,trailingAction:a}){const i=!!o;return m.jsxs(gt,{onClick:o,onKeyDown:i?s=>{o&&(s.key==="Enter"||s.key===" ")&&(s.preventDefault(),o(s))}:void 0,role:i?"button":void 0,tabIndex:i?0:void 0,sx:s=>({display:"flex",alignItems:"center",gap:1.5,py:1,px:1,mx:-1,cursor:i?"pointer":"default",borderRadius:1.5,transition:"background-color 0.1s","&:hover":i?{backgroundColor:s.palette.mode==="dark"?"rgba(255, 255, 255, 0.08)":"grey.100"}:void 0,"&:focus-visible":i?{outline:"2px solid",outlineColor:"primary.main",outlineOffset:2}:void 0}),children:[m.jsx(gt,{sx:{width:32,height:32,borderRadius:1,bgcolor:t,color:"#FFFFFF",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0},children:e}),m.jsx(at,{variant:"body2",sx:{fontFamily:gi,flex:1,minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:n}),r&&m.jsx(at,{variant:"caption",color:"text.secondary",sx:{flexShrink:0},children:r}),a&&m.jsx(gt,{sx:{flexShrink:0,display:"flex",alignItems:"center"},children:a})]})}function bw({label:e}){return m.jsx(at,{variant:"body2",color:"text.secondary",sx:{py:1,fontStyle:"italic"},children:e})}function wNe(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 kNe(e){return Ut("MuiCollapse",e)}Lt("MuiCollapse",["root","horizontal","vertical","entered","hidden","wrapper","wrapperInner"]);const ANe=e=>{const{orientation:t,classes:n}=e,r={root:["root",`${t}`],entered:["entered"],hidden:["hidden"],wrapper:["wrapper",`${t}`],wrapperInner:["wrapperInner",`${t}`]};return zt(r,kNe,n)},DNe=Pe("div",{name:"MuiCollapse",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,t[n.orientation],n.state==="entered"&&t.entered,n.state==="exited"&&!n.in&&n.collapsedSize==="0px"&&t.hidden]}})(Pn(({theme:e})=>({height:0,overflow:"hidden",transition:e.transitions.create("height"),variants:[{props:{orientation:"horizontal"},style:{height:"auto",width:0,transition:e.transitions.create("width")}},{props:{state:"entered"},style:{height:"auto",overflow:"visible"}},{props:{state:"entered",orientation:"horizontal"},style:{width:"auto"}},{props:({ownerState:t})=>t.state==="exited"&&!t.in&&t.collapsedSize==="0px",style:{visibility:"hidden"}}]}))),ONe=Pe("div",{name:"MuiCollapse",slot:"Wrapper"})({display:"flex",width:"100%",variants:[{props:{orientation:"horizontal"},style:{width:"auto",height:"100%"}}]}),RNe=Pe("div",{name:"MuiCollapse",slot:"WrapperInner"})({width:"100%",variants:[{props:{orientation:"horizontal"},style:{width:"auto",height:"100%"}}]}),Qy=T.forwardRef(function(e,t){const n=An({props:e,name:"MuiCollapse"}),{addEndListener:r,children:o,className:a,collapsedSize:i="0px",component:s,easing:c,in:u,onEnter:f,onEntered:p,onEntering:y,onExit:g,onExited:b,onExiting:x,orientation:E="vertical",style:S,timeout:w=lB.standard,TransitionComponent:C=ms,...R}=n,M={...n,orientation:E,collapsedSize:i},D=ANe(M),I=_u(),L=PS(),F=T.useRef(null),B=T.useRef(),U=typeof i=="number"?`${i}px`:i,k=E==="horizontal",$=k?"width":"height",j=T.useRef(null),V=cr(t,j),z=re=>ne=>{if(re){const X=j.current;ne===void 0?re(X):re(X,ne)}},K=()=>F.current?F.current[k?"clientWidth":"clientHeight"]:0,Y=z((re,ne)=>{F.current&&k&&(F.current.style.position="absolute"),re.style[$]=U,f&&f(re,ne)}),te=z((re,ne)=>{const X=K();F.current&&k&&(F.current.style.position="");const{duration:ie,easing:ae}=Zp({style:S,timeout:w,easing:c},{mode:"enter"});if(w==="auto"){const fe=I.transitions.getAutoHeightDuration(X);re.style.transitionDuration=`${fe}ms`,B.current=fe}else re.style.transitionDuration=typeof ie=="string"?ie:`${ie}ms`;re.style[$]=`${X}px`,re.style.transitionTimingFunction=ae,y&&y(re,ne)}),_=z((re,ne)=>{re.style[$]="auto",p&&p(re,ne)}),Z=z(re=>{re.style[$]=`${K()}px`,g&&g(re)}),J=z(b),W=z(re=>{const ne=K(),{duration:X,easing:ie}=Zp({style:S,timeout:w,easing:c},{mode:"exit"});if(w==="auto"){const ae=I.transitions.getAutoHeightDuration(ne);re.style.transitionDuration=`${ae}ms`,B.current=ae}else re.style.transitionDuration=typeof X=="string"?X:`${X}ms`;re.style[$]=U,re.style.transitionTimingFunction=ie,x&&x(re)});return m.jsx(C,{in:u,onEnter:Y,onEntered:_,onEntering:te,onExit:Z,onExited:J,onExiting:W,addEndListener:re=>{w==="auto"&&L.start(B.current||0,re),r&&r(j.current,re)},nodeRef:j,timeout:w==="auto"?null:w,...R,children:(re,{ownerState:ne,...X})=>m.jsx(DNe,{as:s,className:Ot(D.root,a,{entered:D.entered,exited:!u&&U==="0px"&&D.hidden}[re]),style:{[k?"minWidth":"minHeight"]:U,...S},ref:V,ownerState:{...M,state:re},...X,children:m.jsx(ONe,{ownerState:{...M,state:re},className:D.wrapper,ref:F,children:m.jsx(RNe,{ownerState:{...M,state:re},className:D.wrapperInner,children:o})})})})});Qy&&(Qy.muiSupportAuto=!0);const MNe=T.createContext(null),kh=()=>{const e=T.useContext(MNe);if(e==null)throw new Error(["MUI X: Could not find the Tree View context.","It looks like you rendered your component outside of a SimpleTreeView or RichTreeView parent component.","This can also happen if you are bundling multiple versions of the Tree View."].join(`
456
+ `));return e},NNe=({props:e})=>{const{instance:t}=kh(),{label:n,itemId:r}=e,[o,a]=T.useState(n),i=t.isItemBeingEdited(r);return T.useEffect(()=>{i||a(n)},[i,n]),{propsEnhancers:{labelInput:({externalEventHandlers:s,interactions:c})=>t.isItemEditable(r)?{value:o??"","data-element":"labelInput",onChange:u=>{s.onChange?.(u),a(u.target.value)},onKeyDown:u=>{if(s.onKeyDown?.(u),u.defaultMuiPrevented)return;const f=u.target;u.key==="Enter"&&f.value?c.handleSaveItemLabel(u,f.value):u.key==="Escape"&&c.handleCancelItemLabelEditing(u)},onBlur:u=>{s.onBlur?.(u),!u.defaultMuiPrevented&&u.target.value&&c.handleSaveItemLabel(u,u.target.value)},autoFocus:!0,type:"text"}:{}}}},ml=({instance:e,state:t,setState:n,params:r})=>{const o=T.useRef(t.editedItemId),a=p=>o.current===p,i=p=>{n(y=>pe({},y,{editedItemId:p})),o.current=p},s=p=>p===t.editedItemId,c=!!r.isItemEditable,u=p=>{if(p==null||!c)return!1;const y=e.getItem(p);return y?typeof r.isItemEditable=="function"?r.isItemEditable(y):!!r.isItemEditable:!1},f=(p,y)=>{if(!y)throw new Error(["MUI X: The Tree View component requires all items to have a `label` property.","The label of an item cannot be empty.",p].join(`
457
+ `));n(g=>{const b=g.items.itemMetaMap[p];return b.label!==y?pe({},g,{items:pe({},g.items,{itemMetaMap:pe({},g.items.itemMetaMap,{[p]:pe({},b,{label:y})})})}):g}),r.onItemLabelChange&&r.onItemLabelChange(p,y)};return{instance:{setEditedItemId:i,isItemBeingEdited:s,updateItemLabel:f,isItemEditable:u,isTreeViewEditable:c,isItemBeingEditedRef:a},publicAPI:{updateItemLabel:f}}};ml.itemPlugin=NNe;ml.getDefaultizedParams=({params:e,experimentalFeatures:t})=>{const n=t?.labelEditing;return pe({},e,{isItemEditable:n?e.isItemEditable??!1:!1})};ml.getInitialState=()=>({editedItemId:null});ml.params={onItemLabelChange:!0,isItemEditable:!0};const Ip=(e,t)=>e.getAvailablePlugins().has(t),_9=e=>Array.isArray(e)?e.length>0&&e.some(_9):!!e,PNe=({itemId:e,children:t})=>{const{instance:n,selection:{multiSelect:r},publicAPI:o}=kh(),a={expandable:_9(t),expanded:n.isItemExpanded(e),focused:n.isItemFocused(e),selected:n.isItemSelected(e),disabled:n.isItemDisabled(e),editing:n?.isItemBeingEdited?n?.isItemBeingEdited(e):!1,editable:n.isItemEditable?n.isItemEditable(e):!1},i=f=>{if(a.disabled)return;a.focused||n.focusItem(f,e);const p=r&&(f.shiftKey||f.ctrlKey||f.metaKey);a.expandable&&!(p&&n.isItemExpanded(e))&&n.toggleItemExpansion(f,e)},s=f=>{a.disabled||(!a.focused&&!a.editing&&n.focusItem(f,e),r&&(f.shiftKey||f.ctrlKey||f.metaKey)?f.shiftKey?n.expandSelectionRange(f,e):n.selectItem({event:f,itemId:e,keepExistingSelection:!0}):n.selectItem({event:f,itemId:e,shouldBeSelected:!0}))},c=f=>{const p=f.nativeEvent.shiftKey;r&&p?n.expandSelectionRange(f,e):n.selectItem({event:f,itemId:e,keepExistingSelection:r,shouldBeSelected:f.target.checked})},u=()=>{Ip(n,ml)&&n.isItemEditable(e)&&(n.isItemBeingEdited(e)?n.setEditedItemId(null):n.setEditedItemId(e))};return{interactions:{handleExpansion:i,handleSelection:s,handleCheckboxSelection:c,toggleItemEditing:u,handleSaveItemLabel:(f,p)=>{Ip(n,ml)&&n.isItemBeingEditedRef(e)&&(n.updateItemLabel(e,p),u(),n.focusItem(f,e))},handleCancelItemLabelEditing:f=>{Ip(n,ml)&&n.isItemBeingEditedRef(e)&&(u(),n.focusItem(f,e))}},status:a,publicAPI:o}},INe=T.createContext(()=>-1),y4=(e,t)=>t!==e.closest('*[role="treeitem"]'),_Ne=({id:e,treeId:t="",itemId:n})=>e??`${t}-${n}`,LNe=e=>{const{runItemPlugins:t,items:{onItemClick:n,disabledItemsFocusable:r,indentationAtItemLevel:o},selection:{disableSelection:a,checkboxSelection:i},expansion:{expansionTrigger:s},treeId:c,instance:u,publicAPI:f}=kh(),p=T.useContext(INe),{id:y,itemId:g,label:b,children:x,rootRef:E}=e,{rootRef:S,contentRef:w,propsEnhancers:C}=t(e),{interactions:R,status:M}=PNe({itemId:g,children:x}),D=T.useRef(null),I=T.useRef(null),L=cr(E,S,D),F=cr(w,I),B=T.useRef(null),U=_Ne({itemId:g,treeId:c,id:y}),k=u.canItemBeTabbed(g)?0:-1,$={rootRefObject:D,contentRefObject:I,interactions:R},j=J=>W=>{if(J.onFocus?.(W),W.defaultMuiPrevented)return;const re=!M.disabled||r;!M.focused&&re&&W.currentTarget===W.target&&u.focusItem(W,g)},V=J=>W=>{if(J.onBlur?.(W),W.defaultMuiPrevented)return;const re=u.getItemDOMElement(g);M.editing||W.relatedTarget&&y4(W.relatedTarget,re)&&(W.target&&W.target?.dataset?.element==="labelInput"&&y4(W.target,re)||W.relatedTarget?.dataset?.element==="labelInput")||u.removeFocusedItem()},z=J=>W=>{J.onKeyDown?.(W),!(W.defaultMuiPrevented||W.target?.dataset?.element==="labelInput")&&u.handleItemKeyDown(W,g)},K=J=>W=>{J.onDoubleClick?.(W),!W.defaultMuiPrevented&&R.toggleItemEditing()},Y=J=>W=>{J.onClick?.(W),n?.(W,g),!(W.defaultMuiPrevented||B.current?.contains(W.target))&&(s==="content"&&R.handleExpansion(W),i||R.handleSelection(W))},te=J=>W=>{J.onMouseDown?.(W),!W.defaultMuiPrevented&&(W.shiftKey||W.ctrlKey||W.metaKey||M.disabled)&&W.preventDefault()},_=J=>W=>{J.onChange?.(W),!W.defaultMuiPrevented&&(a||M.disabled||R.handleCheckboxSelection(W))},Z=J=>W=>{J.onClick?.(W),!W.defaultMuiPrevented&&s==="iconContainer"&&R.handleExpansion(W)};return{getRootProps:(J={})=>{const W=pe({},ci(e),ci(J));let re;M.selected?re=!0:a||M.disabled?re=void 0:re=!1;const ne=pe({},W,{ref:L,role:"treeitem",tabIndex:k,id:U,"aria-expanded":M.expandable?M.expanded:void 0,"aria-selected":re,"aria-disabled":M.disabled||void 0},J,{onFocus:j(W),onBlur:V(W),onKeyDown:z(W)});o&&(ne.style={"--TreeView-itemDepth":typeof p=="function"?p(g):p});const X=C.root?.(pe({},$,{externalEventHandlers:W}))??{};return pe({},ne,X)},getContentProps:(J={})=>{const W=ci(J),re=pe({},W,J,{ref:F,onClick:Y(W),onMouseDown:te(W),status:M});o&&(re.indentationAtItemLevel=!0);const ne=C.content?.(pe({},$,{externalEventHandlers:W}))??{};return pe({},re,ne)},getGroupTransitionProps:(J={})=>{const W=ci(J),re=pe({},W,{unmountOnExit:!0,component:"ul",role:"group",in:M.expanded,children:x},J);return o&&(re.indentationAtItemLevel=!0),re},getIconContainerProps:(J={})=>{const W=ci(J);return pe({},W,J,{onClick:Z(W)})},getCheckboxProps:(J={})=>{const W=ci(J);return pe({},W,{visible:i,ref:B,checked:M.selected,disabled:a||M.disabled,tabIndex:-1},J,{onChange:_(W)})},getLabelProps:(J={})=>{const W=pe({},ci(J)),re=pe({},W,{children:b},J,{onDoubleClick:K(W)});return u.isTreeViewEditable&&(re.editable=M.editable),re},getLabelInputProps:(J={})=>{const W=ci(J),re=C.labelInput?.({rootRefObject:D,contentRefObject:I,externalEventHandlers:W,interactions:R})??{};return pe({},J,re)},getDragAndDropOverlayProps:(J={})=>{const W=ci(J),re=C.dragAndDropOverlay?.(pe({},$,{externalEventHandlers:W}))??{};return pe({},J,re)},rootRef:L,status:M,publicAPI:f}},FNe=LNe;function jNe(e){const{instance:t,items:{onItemClick:n},selection:{multiSelect:r,checkboxSelection:o,disableSelection:a},expansion:{expansionTrigger:i}}=kh(),s=t.isItemExpandable(e),c=t.isItemExpanded(e),u=t.isItemFocused(e),f=t.isItemSelected(e),p=t.isItemDisabled(e),y=t?.isItemBeingEdited?t?.isItemBeingEdited(e):!1,g=t.isItemEditable?t.isItemEditable(e):!1,b=C=>{if(!p){u||t.focusItem(C,e);const R=r&&(C.shiftKey||C.ctrlKey||C.metaKey);s&&!(R&&t.isItemExpanded(e))&&t.toggleItemExpansion(C,e)}},x=C=>{p||(!u&&!y&&t.focusItem(C,e),r&&(C.shiftKey||C.ctrlKey||C.metaKey)?C.shiftKey?t.expandSelectionRange(C,e):t.selectItem({event:C,itemId:e,keepExistingSelection:!0}):t.selectItem({event:C,itemId:e,shouldBeSelected:!0}))},E=C=>{if(a||p)return;const R=C.nativeEvent.shiftKey;r&&R?t.expandSelectionRange(C,e):t.selectItem({event:C,itemId:e,keepExistingSelection:r,shouldBeSelected:C.target.checked})},S=C=>{(C.shiftKey||C.ctrlKey||C.metaKey||p)&&C.preventDefault()},w=()=>{Ip(t,ml)&&t.isItemEditable(e)&&(t.isItemBeingEdited(e)?t.setEditedItemId(null):t.setEditedItemId(e))};return{disabled:p,expanded:c,selected:f,focused:u,editable:g,editing:y,disableSelection:a,checkboxSelection:o,handleExpansion:b,handleSelection:x,handleCheckboxSelection:E,handleContentClick:n,preventSelection:S,expansionTrigger:i,toggleItemEditing:w,handleSaveItemLabel:(C,R)=>{Ip(t,ml)&&t.isItemBeingEditedRef(e)&&(t.updateItemLabel(e,R),w(),t.focusItem(C,e))},handleCancelItemLabelEditing:C=>{Ip(t,ml)&&t.isItemBeingEditedRef(e)&&(w(),t.focusItem(C,e))}}}const BNe=Pe("div",{name:"MuiTreeItem2DragAndDropOverlay",slot:"Root",overridesResolver:(e,t)=>t.root,shouldForwardProp:e=>Hg(e)&&e!=="action"})(({theme:e})=>({position:"absolute",left:0,display:"flex",top:0,bottom:0,right:0,pointerEvents:"none",variants:[{props:{action:"make-child"},style:{marginLeft:"calc(var(--TreeView-indentMultiplier) * var(--TreeView-itemDepth))",borderRadius:e.shape.borderRadius,backgroundColor:e.vars?`rgba(${e.vars.palette.primary.darkChannel} / ${e.vars.palette.action.focusOpacity})`:Do(e.palette.primary.dark,e.palette.action.focusOpacity)}},{props:{action:"reorder-above"},style:{marginLeft:"calc(var(--TreeView-indentMultiplier) * var(--TreeView-itemDepth))",borderTop:`1px solid ${(e.vars||e).palette.action.active}`}},{props:{action:"reorder-below"},style:{marginLeft:"calc(var(--TreeView-indentMultiplier) * var(--TreeView-itemDepth))",borderBottom:`1px solid ${(e.vars||e).palette.action.active}`}},{props:{action:"move-to-parent"},style:{marginLeft:"calc(var(--TreeView-indentMultiplier) * calc(var(--TreeView-itemDepth) - 1))",borderBottom:`1px solid ${(e.vars||e).palette.action.active}`}}]}));function $Ne(e){return e.action==null?null:m.jsx(BNe,pe({},e))}const zNe=Pe("input",{name:"MuiTreeItem2",slot:"LabelInput",overridesResolver:(e,t)=>t.labelInput})(({theme:e})=>pe({},e.typography.body1,{width:"100%",backgroundColor:e.palette.background.paper,borderRadius:e.shape.borderRadius,border:"none",padding:"0 2px",boxSizing:"border-box","&:focus":{outline:`1px solid ${e.palette.primary.main}`}})),HNe=["classes","className","displayIcon","expansionIcon","icon","label","itemId","onClick","onMouseDown","dragAndDropOverlayProps","labelInputProps"],UNe=T.forwardRef(function(e,t){const{classes:n,className:r,displayIcon:o,expansionIcon:a,icon:i,label:s,itemId:c,onClick:u,onMouseDown:f,dragAndDropOverlayProps:p,labelInputProps:y}=e,g=fn(e,HNe),{disabled:b,expanded:x,selected:E,focused:S,editing:w,editable:C,disableSelection:R,checkboxSelection:M,handleExpansion:D,handleSelection:I,handleCheckboxSelection:L,handleContentClick:F,preventSelection:B,expansionTrigger:U,toggleItemEditing:k}=jNe(c),$=i||a||o,j=T.useRef(null),V=Y=>{B(Y),f&&f(Y)},z=Y=>{F?.(Y,c),!j.current?.contains(Y.target)&&(U==="content"&&D(Y),M||I(Y),u&&u(Y))},K=Y=>{Y.defaultMuiPrevented||k()};return m.jsxs("div",pe({},g,{className:Ot(n.root,r,x&&n.expanded,E&&n.selected,S&&n.focused,b&&n.disabled,w&&n.editing,C&&n.editable),onClick:z,onMouseDown:V,ref:t,children:[m.jsx("div",{className:n.iconContainer,children:$}),M&&m.jsx(FD,{className:n.checkbox,checked:E,onChange:L,disabled:b||R,ref:j,tabIndex:-1}),w?m.jsx(zNe,pe({},y,{className:n.labelInput})):m.jsx("div",pe({className:n.label},C&&{onDoubleClick:K},{children:s})),p&&m.jsx($Ne,pe({},p))]}))}),tc=Lt("MuiTreeItem",["root","groupTransition","content","expanded","selected","focused","disabled","iconContainer","label","checkbox","labelInput","editable","editing","dragAndDropOverlay"]),VNe=Fn(m.jsx("path",{d:"M10 6 8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z"})),WNe=Fn(m.jsx("path",{d:"M16.59 8.59 12 13.17 7.41 8.59 6 10l6 6 6-6z"}));function L9(e){const{children:t,itemId:n}=e,{wrapItem:r,instance:o}=kh();return r({children:t,itemId:n,instance:o})}L9.propTypes={children:Ke.node,itemId:Ke.string.isRequired};Pe("li",{name:"MuiTreeItem",slot:"Root",overridesResolver:(e,t)=>t.root})({listStyle:"none",margin:0,padding:0,outline:0});Pe(UNe,{name:"MuiTreeItem",slot:"Content",overridesResolver:(e,t)=>[t.content,t.iconContainer&&{[`& .${tc.iconContainer}`]:t.iconContainer},t.label&&{[`& .${tc.label}`]:t.label}],shouldForwardProp:e=>Cu(e)&&e!=="indentationAtItemLevel"})(({theme:e})=>({padding:e.spacing(.5,1),borderRadius:e.shape.borderRadius,width:"100%",boxSizing:"border-box",position:"relative",display:"flex",alignItems:"center",gap:e.spacing(1),cursor:"pointer",WebkitTapHighlightColor:"transparent","&:hover":{backgroundColor:(e.vars||e).palette.action.hover,"@media (hover: none)":{backgroundColor:"transparent"}},[`&.${tc.disabled}`]:{opacity:(e.vars||e).palette.action.disabledOpacity,backgroundColor:"transparent"},[`&.${tc.focused}`]:{backgroundColor:(e.vars||e).palette.action.focus},[`&.${tc.selected}`]:{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / ${e.vars.palette.action.selectedOpacity})`:Do(e.palette.primary.main,e.palette.action.selectedOpacity),"&:hover":{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.hoverOpacity}))`:Do(e.palette.primary.main,e.palette.action.selectedOpacity+e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / ${e.vars.palette.action.selectedOpacity})`:Do(e.palette.primary.main,e.palette.action.selectedOpacity)}},[`&.${tc.focused}`]:{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.focusOpacity}))`:Do(e.palette.primary.main,e.palette.action.selectedOpacity+e.palette.action.focusOpacity)}},[`& .${tc.iconContainer}`]:{width:16,display:"flex",flexShrink:0,justifyContent:"center","& svg":{fontSize:18}},[`& .${tc.label}`]:pe({width:"100%",boxSizing:"border-box",minWidth:0,position:"relative"},e.typography.body1),[`& .${tc.checkbox}`]:{padding:0},variants:[{props:{indentationAtItemLevel:!0},style:{paddingLeft:`calc(${e.spacing(1)} + var(--TreeView-itemChildrenIndentation) * var(--TreeView-itemDepth))`}}]}));Pe(Qy,{name:"MuiTreeItem",slot:"GroupTransition",overridesResolver:(e,t)=>t.groupTransition,shouldForwardProp:e=>Cu(e)&&e!=="indentationAtItemLevel"})({margin:0,padding:0,paddingLeft:"var(--TreeView-itemChildrenIndentation)",variants:[{props:{indentationAtItemLevel:!0},style:{paddingLeft:0}}]});function qNe(e){const{slots:t,slotProps:n,status:r}=e,o=kh(),a=pe({},o.icons.slots,{expandIcon:o.icons.slots.expandIcon??VNe,collapseIcon:o.icons.slots.collapseIcon??WNe}),i=o.icons.slotProps;let s;t?.icon?s="icon":r.expandable?r.expanded?s="collapseIcon":s="expandIcon":s="endIcon";const c=t?.[s]??a[s],u=mr({elementType:c,externalSlotProps:f=>pe({},Xp(i[s],f),Xp(n?.[s],f)),ownerState:{}});return c?m.jsx(c,pe({},u)):null}const GNe=["visible"],YNe=Pe("li",{name:"MuiTreeItem2",slot:"Root",overridesResolver:(e,t)=>t.root})({listStyle:"none",margin:0,padding:0,outline:0}),KNe=Pe("div",{name:"MuiTreeItem2",slot:"Content",overridesResolver:(e,t)=>t.content,shouldForwardProp:e=>Cu(e)&&e!=="status"&&e!=="indentationAtItemLevel"})(({theme:e})=>({padding:e.spacing(.5,1),borderRadius:e.shape.borderRadius,width:"100%",boxSizing:"border-box",position:"relative",display:"flex",alignItems:"center",gap:e.spacing(1),cursor:"pointer",WebkitTapHighlightColor:"transparent","&:hover":{backgroundColor:(e.vars||e).palette.action.hover,"@media (hover: none)":{backgroundColor:"transparent"}},variants:[{props:{indentationAtItemLevel:!0},style:{paddingLeft:`calc(${e.spacing(1)} + var(--TreeView-itemChildrenIndentation) * var(--TreeView-itemDepth))`}},{props:({status:t})=>t.disabled,style:{opacity:(e.vars||e).palette.action.disabledOpacity,backgroundColor:"transparent"}},{props:({status:t})=>t.focused,style:{backgroundColor:(e.vars||e).palette.action.focus}},{props:({status:t})=>t.selected,style:{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / ${e.vars.palette.action.selectedOpacity})`:Do(e.palette.primary.main,e.palette.action.selectedOpacity),"&:hover":{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.hoverOpacity}))`:Do(e.palette.primary.main,e.palette.action.selectedOpacity+e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / ${e.vars.palette.action.selectedOpacity})`:Do(e.palette.primary.main,e.palette.action.selectedOpacity)}}}},{props:({status:t})=>t.selected&&t.focused,style:{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.focusOpacity}))`:Do(e.palette.primary.main,e.palette.action.selectedOpacity+e.palette.action.focusOpacity)}}]})),QNe=Pe("div",{name:"MuiTreeItem2",slot:"Label",overridesResolver:(e,t)=>t.label,shouldForwardProp:e=>Cu(e)&&e!=="editable"})(({theme:e})=>pe({width:"100%",boxSizing:"border-box",minWidth:0,position:"relative",overflow:"hidden"},e.typography.body1,{variants:[{props:({editable:t})=>t,style:{paddingLeft:"2px"}}]})),XNe=Pe("div",{name:"MuiTreeItem2",slot:"IconContainer",overridesResolver:(e,t)=>t.iconContainer})({width:16,display:"flex",flexShrink:0,justifyContent:"center","& svg":{fontSize:18}});Pe(Qy,{name:"MuiTreeItem2",slot:"GroupTransition",overridesResolver:(e,t)=>t.groupTransition,shouldForwardProp:e=>Cu(e)&&e!=="indentationAtItemLevel"})({margin:0,padding:0,paddingLeft:"var(--TreeView-itemChildrenIndentation)",variants:[{props:{indentationAtItemLevel:!0},style:{paddingLeft:0}}]});Pe(T.forwardRef((e,t)=>{const{visible:n}=e,r=fn(e,GNe);return n?m.jsx(FD,pe({},r,{ref:t})):null}),{name:"MuiTreeItem2",slot:"Checkbox",overridesResolver:(e,t)=>t.checkbox})({padding:0});Lt("MuiRichTreeView",["root"]);Pe("ul",{name:"MuiRichTreeView",slot:"Root",overridesResolver:(e,t)=>t.root})({padding:0,margin:0,listStyle:"none",outline:0,position:"relative"});const ZNe=Fn([m.jsx("path",{d:"M19 5v14H5V5zm0-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-2"},"0"),m.jsx("path",{d:"M14 17H7v-2h7zm3-4H7v-2h10zm0-4H7V7h10z"},"1")]),JNe=Fn(m.jsx("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m1 15h-2v-2h2zm0-4h-2V7h2z"})),ePe=Fn(m.jsx("path",{d:"M19 15v4H5v-4zm1-2H4c-.55 0-1 .45-1 1v6c0 .55.45 1 1 1h16c.55 0 1-.45 1-1v-6c0-.55-.45-1-1-1M7 18.5c-.82 0-1.5-.67-1.5-1.5s.68-1.5 1.5-1.5 1.5.67 1.5 1.5-.67 1.5-1.5 1.5M19 5v4H5V5zm1-2H4c-.55 0-1 .45-1 1v6c0 .55.45 1 1 1h16c.55 0 1-.45 1-1V4c0-.55-.45-1-1-1M7 8.5c-.82 0-1.5-.67-1.5-1.5S6.18 5.5 7 5.5s1.5.68 1.5 1.5S7.83 8.5 7 8.5"})),tPe=Fn(m.jsx("path",{d:"M15 4v2h3v12h-3v2h5V4zM4 20h5v-2H6V6h3V4H4z"})),nPe=gse(Qy);function rPe(e){const t=nse({to:{opacity:e.in?1:0,transform:`translate3d(0,${e.in?0:20}px,0)`}});return m.jsx(nPe,{style:t,...e})}function oPe({item:e,...t}){const n=m.jsxs(QNe,{...t,sx:{display:"flex",alignItems:"center",color:e.error?"error.main":"grey.600"},children:[e.fileType==="directory"&&m.jsx(C9,{})||e.fileType==="notebook"&&m.jsx(ZNe,{})||e.fileType==="model"&&m.jsx(tPe,{})||e.fileType=="database"&&m.jsx(ePe,{})||m.jsx(JNe,{}),m.jsx(at,{variant:"body2",sx:{marginLeft:"5px"},color:e.error?"error.main":e.link?"primary.main":"grey.600",children:e.label})]});return e.error?m.jsx(eo,{title:e.error,placement:"right",children:n}):n}T.forwardRef(function(e,t){const{id:n,itemId:r,label:o,children:a,disabled:i,...s}=e,{getRootProps:c,getContentProps:u,getLabelProps:f,getIconContainerProps:p,getGroupTransitionProps:y,status:g,publicAPI:b}=FNe({id:n,itemId:r,children:a,label:o,disabled:i,rootRef:t}),x=b.getItem(r);return g.selected=!1,g.focused=!1,m.jsx(L9,{itemId:r,children:m.jsxs(YNe,{...c(s),children:[m.jsxs(KNe,{...u(),...x.link&&{onClick:E=>x.link(E)},sx:{pointerEvents:!x.selectable&&"none"},children:[m.jsx(XNe,{...p(),children:m.jsx(qNe,{status:g})}),m.jsx(oPe,{...f({item:x})})]}),a&&m.jsx(rPe,{...y()})]})})});function aPe(e){try{const{environmentName:t,packageName:n,modelPath:r}=to(e);return!t||!n||!r?null:{environmentName:t,packageName:n,pagePath:r}}catch{return null}}function EIe({resourceUri:e}){const{server:t,apiClients:n}=Dr(),r=aPe(e),o=r?.environmentName??"",a=r?.packageName??"",i=r?.pagePath??"",s=T.useMemo(()=>vNe({server:t,environmentName:o,packageName:a,path:i}),[t,o,a,i]),c=uo({queryKey:["pages",o,a],queryFn:()=>n.pages.listPages(o,a),enabled:!!r}).data?.data?.find(b=>b.path===i),u=c?.title??i,f=c?.fit==="viewport",p=T.useRef(null),[y,g]=T.useState(120);return T.useEffect(()=>{if(f)return;function b(x){bNe(x.data)&&x.source===p.current?.contentWindow&&x.data.height>0&&g(Math.ceil(x.data.height))}return window.addEventListener("message",b),()=>window.removeEventListener("message",b)},[f]),r?m.jsxs(gt,{sx:{p:3,...f?{height:"100%",display:"flex",flexDirection:"column"}:{maxWidth:1200,mx:"auto"}},children:[m.jsxs(Lr,{direction:"row",alignItems:"baseline",spacing:1,sx:{mb:1,flexShrink:0},children:[m.jsx(at,{variant:"h6",sx:{fontWeight:600,letterSpacing:"-0.025em"},children:u}),m.jsx(at,{variant:"caption",color:"text.secondary",sx:{fontFamily:gi},children:i}),m.jsx(gt,{sx:{flex:1}}),m.jsx(eo,{title:"Open standalone in new tab",children:m.jsx(dr,{size:"small",href:s,target:"_blank",rel:"noopener noreferrer","aria-label":"Open standalone in new tab",sx:{color:"text.secondary"},children:m.jsx(P9,{fontSize:"small"})})})]}),m.jsx(gt,{sx:{border:"1px solid",borderColor:"divider",borderRadius:1.5,overflow:"hidden",backgroundColor:"background.paper",...f?{flex:1,minHeight:0}:{}},children:m.jsx("iframe",{ref:p,src:s,title:u,sandbox:"allow-scripts allow-same-origin allow-forms",style:{display:"block",width:"100%",height:f?"100%":y,border:0}})})]}):m.jsxs(gt,{sx:{p:3,maxWidth:1200,mx:"auto"},children:[m.jsx(at,{variant:"h6",sx:{fontWeight:600},children:"Can't open page"}),m.jsxs(at,{variant:"body2",color:"text.secondary",sx:{mt:1},children:["This page link is missing an environment, package, or path:",m.jsx(gt,{component:"span",sx:{fontFamily:gi,ml:1},children:e})]})]})}function iPe(e){return{background:e.dashboardRoot,tableBackground:e.tableBackground,tableHeaderColor:e.tableHeader,tableBodyColor:e.tableBody,tableBorder:e.border,tablePinnedBackground:e.tableHeaderBackground,tablePinnedBorder:e.pinnedBorder,tableFontSize:`${e.font.size}px`,fontFamily:e.font.family,mapColor:e.mapColor}}function sPe(e){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}}function lPe(e){const{foreground:t,axisFaint:n,font:r}=e,o={background:e.background,font:r.family,title:{color:t,font:r.family},axis:{labelColor:t,titleColor:t,domainColor:n,tickColor:n,gridColor:n,labelFont:r.family,titleFont:r.family},legend:{labelColor:t,titleColor:t,labelFont:r.family,titleFont:r.family},header:{labelColor:t,titleColor:t},range:{category:e.series}};return a=>o}function cPe(e){if(!e)return;const t=e.tag("theme");if(!t)return;const n={},r=t.tag("palette");if(r){const a={},i=r.textArray("series");i&&i.length>0&&(a.series=i);for(const s of ij){const c=r.tag(s);if(!c)continue;const u={},f=c.text("light"),p=c.text("dark");f&&(u.light=f),p&&(u.dark=p),Object.keys(u).length>0&&(a[s]=u)}Object.keys(a).length>0&&(n.palette=a)}const o=t.tag("font");if(o){const a={},i=o.text("family");i&&(a.family=i);const s=o.numeric("size");typeof s=="number"&&Number.isFinite(s)&&(a.size=s),Object.keys(a).length>0&&(n.font=a)}return Object.keys(n).length>0?n:void 0}const uPe=async(e,t)=>{if(typeof window>"u")throw new Error("MalloyRenderer can only be used in browser environment");const{MalloyRenderer:n}=await co(async()=>{const{MalloyRenderer:r}=await import("./index-DzaYbhnD.js");return{MalloyRenderer:r}},[]);return new n({onClick:t,vegaConfigOverride:lPe(e),theme:iPe(e),onError:r=>{console.error("Error rendering visualization:",typeof r,r)}}).createViz()};typeof window<"u"&&co(()=>import("./index-DzaYbhnD.js"),[]);async function dPe(e){if(!e||typeof e!="object")return;const t=e,n=[...Array.isArray(t.model_annotations)?t.model_annotations:[],...Array.isArray(t.source_annotations)?t.source_annotations:[],...Array.isArray(t.annotations)?t.annotations:[]].map(o=>typeof o?.value=="string"?o.value:void 0).filter(o=>!!o);if(n.length===0)return;let r;try{({parseAnnotation:r}=await co(()=>import("./index-DMAhIJNC.js").then(o=>o.i),__vite__mapDeps([5,4])))}catch{return}try{const{tag:o}=r(n);return cPe(o)}catch(o){console.warn("Failed to parse # theme.* annotations; chart will render with the shell theme.",{error:o,lines:n});return}}function fPe(e,t){const n=sPe(t);for(const[r,o]of Object.entries(n))e.style.setProperty(r,o)}const pPe=`
458
458
  /* dashboard.css hardcodes background: #f7f9fc on .malloy-dashboard
459
459
  and .dashboard-row-header, which would paint light grey in dark
460
460
  mode and also bleed an operator-picked palette.background across
@@ -526,4 +526,4 @@ div.malloy-render .malloy-dashboard .dashboard-row-header {
526
526
  .malloy-render .cell-content.header {
527
527
  color: var(--malloy-render--table-header-color) !important;
528
528
  }
529
- `,b4="publisher-malloy-renderer-overrides";function pPe(){if(typeof document>"u"||document.getElementById(b4))return;const e=document.createElement("style");e.id=b4,e.textContent=fPe,document.head.appendChild(e)}function hPe({result:e,height:t,onDrill:n,onSizeChange:r}){const o=T.useRef(null),a=T.useRef(!1),i=T.useRef(null),s=T.useRef(0),{theme:c,layers:u,mode:f}=mb();return T.useEffect(()=>()=>{s.current+=1,i.current?.viz.remove(),i.current=null},[]),T.useLayoutEffect(()=>{if(!o.current||!e)return;pPe();const p=o.current,y=s.current+=1;let g=!1;const b=()=>!g&&y===s.current;let x,E,S=null,w=null,C=null;a.current=!1;const R=M=>{if(a.current||g||!M.firstElementChild)return;const D=M.firstElementChild.firstElementChild;if(!D)return;const I=D.firstElementChild;let L=D.scrollHeight||D.offsetHeight||0;I&&D.classList.contains("malloy-dashboard")&&(L=I.scrollHeight||I.offsetHeight||0),L>0&&(a.current=!0,r&&r(L))};return(async()=>{let M;try{M=JSON.parse(e)}catch($){console.error("Error parsing visualization result:",$);return}const D=await uPe(M),I=D?kA([...u,D],f):c;if(!b())return;try{E=await cPe(I,n)}catch($){console.error("Failed to create renderer:",$);return}if(!b()){E.remove(),E=void 0;return}const L=i.current;x=document.createElement("div"),x.style.width="100%",x.style.height="100%",dPe(x,I),L&&(p.style.position="relative",x.style.position="absolute",x.style.inset="0",x.style.visibility="hidden"),p.appendChild(x);const F=x;S=new MutationObserver(()=>{w&&clearTimeout(w),w=setTimeout(()=>{R(F),S?.disconnect()},100)}),S.observe(x,{childList:!0,subtree:!0,attributes:!0});const B=E;let U=!1;const k=()=>{U||!b()||(U=!0,C&&(clearTimeout(C),C=null),L&&(L.viz.remove(),L.node.parentNode===p&&p.removeChild(L.node)),F.style.position="",F.style.inset="",F.style.visibility="",p.style.position="",i.current={viz:B,node:F},R(F))};try{E.setResult(M),E.render(x),E.onReady(k),C=setTimeout(k,1e4)}catch($){console.error("Error rendering visualization:",$),S?.disconnect(),E.remove(),E=void 0,F.parentNode===p&&p.removeChild(F)}})(),()=>{g=!0,S?.disconnect(),w&&clearTimeout(w),C&&clearTimeout(C),x&&i.current?.node!==x&&(E?.remove(),x.parentNode===p&&p.removeChild(x),p.style.position="")}},[e,n,r,c,u,f]),m.jsx("div",{ref:o,style:{width:"100%",height:t?`${t}px`:"400px"}})}function mPe(e){return typeof window>"u"?m.jsx(gt,{sx:{width:"100%",height:e.height?`${e.height}px`:"100%",display:"flex",alignItems:"center",justifyContent:"center",color:"text.secondary"},children:"Loading..."}):m.jsx(T.Suspense,{fallback:m.jsx(gt,{sx:{width:"100%",height:e.height?`${e.height}px`:"100%",display:"flex",alignItems:"center",justifyContent:"center",color:"text.secondary"},children:"Loading visualization..."}),children:m.jsx(hPe,{...e})})}const gPe=Object.freeze(Object.defineProperty({__proto__:null,default:mPe},Symbol.toStringTag,{value:"Module"})),To={white:"#FFFFFF",offWhite:"#F8F8F6",grey:{light:"#E6E4E1",mid:"#91908F"},black:"#30302E",semantic:{success:{main:"#7A9461",light:"#E8EDDF",dark:"#5F7A4B"},warning:{main:"#B5943A",light:"#F3ECDA",dark:"#8E7430"},error:{main:"#BF6050",light:"#F2DDD9",dark:"#9C4D40"},info:{main:"#628698",light:"#DDE6EA",dark:"#4D6B79"}}},j0='"Inter", "Helvetica Neue", "Arial", sans-serif',Hi={50:To.offWhite,100:"#F4F3F1",200:To.grey.light,300:"#D4D2CF",400:"#B3B1AF",500:To.grey.mid,600:"#73726F",700:"#555450",800:"#424140",900:To.black},EIe={headerHeight:56},vw="0 1px 3px rgba(0, 0, 0, 0.1)",yPe="#0f172a",bPe="#1e293b",vPe="#f1f5f9",xPe="#cbd5e1",SPe="#334155",F9=(e="light")=>{const t=e==="dark",n=t?yPe:To.white,r=t?bPe:To.white,o=t?vPe:To.black,a=t?xPe:To.grey.mid,i=t?SPe:To.grey.light,s=t?"#334155":"#555450",c=t?"#475569":"#73726f";return Px({cssVariables:{nativeColor:!0},palette:{mode:e,primary:{main:s,light:To.grey.light,dark:c,contrastText:"#ffffff"},secondary:{main:To.grey.mid,light:To.grey.light,dark:To.black},grey:Hi,success:To.semantic.success,warning:To.semantic.warning,error:To.semantic.error,info:To.semantic.info,background:{default:n,paper:r},text:{primary:o,secondary:a},divider:i},typography:{fontFamily:j0,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}},MuiCssBaseline:{styleOverrides:{"*":{scrollbarWidth:"thin",scrollbarColor:t?"#475569 #1e293b":`${Hi[300]} ${Hi[100]}`,"&::-webkit-scrollbar":{width:"8px",height:"8px"},"&::-webkit-scrollbar-track":{background:t?"#1e293b":Hi[100],borderRadius:"4px"},"&::-webkit-scrollbar-thumb":{background:t?"#475569":Hi[300],borderRadius:"4px","&:hover":{background:t?"#64748b":Hi[400]}},"&::-webkit-scrollbar-corner":{background:t?"#1e293b":Hi[100]}},"div[data-radix-popper-content-wrapper]":{zIndex:"1300 !important"}}},MuiButton:{styleOverrides:{root:{borderRadius:20,textTransform:"none",fontWeight:500,boxShadow:"none","&:hover":{boxShadow:vw}},contained:{"&:hover":{boxShadow:"0 2px 4px rgba(0, 0, 0, 0.1)"}},outlined:{color:o,borderColor:t?"#475569":Hi[300],"&:hover":{borderColor:t?"#64748b":Hi[400],backgroundColor:t?"rgba(255, 255, 255, 0.06)":"rgba(0, 0, 0, 0.04)"}}}},MuiCard:{styleOverrides:{root:{borderRadius:4,boxShadow:vw,border:"1px solid",borderColor:i,backgroundColor:r}}},MuiChip:{styleOverrides:{root:{borderRadius:4,fontWeight:500}}},MuiTextField:{styleOverrides:{root:{"& .MuiOutlinedInput-root":{borderRadius:4},"& .MuiInputLabel-outlined":{backgroundColor:r,paddingLeft:4,paddingRight:4,"&.MuiInputLabel-shrink":{transform:"translate(14px, -9px) scale(0.75)"}}}}},MuiDialog:{styleOverrides:{paper:{borderRadius:4,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:j0,fontSize:"0.875rem",color:a}}},MuiInputLabel:{styleOverrides:{root:{"&.MuiInputLabel-outlined":{backgroundColor:r,paddingLeft:4,paddingRight:4}}}},MuiOutlinedInput:{styleOverrides:{notchedOutline:{border:"none"},root:{border:`1px solid ${i}`,borderRadius:8,transition:"border-color 120ms ease-in",backgroundColor:r,"&:hover":{borderColor:t?"#475569":Hi[300]},"&.Mui-focused":{borderColor:t?"#64748b":Hi[400],outline:"none"}}}},MuiMenuItem:{styleOverrides:{root:{fontFamily:j0,fontSize:"0.875rem"}}},MuiInputBase:{styleOverrides:{root:{fontFamily:j0}}},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 ${i}`,backgroundColor:r,color:o}}},MuiBreadcrumbs:{styleOverrides:{root:{"& .MuiBreadcrumbs-separator":{margin:"0 6px",color:Hi[400]}}}},MuiDivider:{styleOverrides:{root:{borderColor:i}},defaultProps:{sx:{my:1}}},MuiListItemButton:{styleOverrides:{root:{borderRadius:28,margin:"2px 8px",padding:"8px 16px","&:hover":{backgroundColor:t?"rgba(255, 255, 255, 0.08)":To.offWhite},"&.Mui-selected":{backgroundColor:t?"rgba(255, 255, 255, 0.12)":To.offWhite,color:o,"& .MuiListItemIcon-root":{color:o},"& .MuiListItemText-primary":{color:o},"&:hover":{backgroundColor:t?"rgba(255, 255, 255, 0.16)":To.grey.light}}}}},MuiAppBar:{styleOverrides:{root:{backgroundColor:r,color:o,boxShadow:vw}}}}})};F9("light");function EPe({children:e}){const{mode:t}=mb(),n=T.useMemo(()=>F9(t),[t]);return m.jsxs(pY,{theme:n,children:[m.jsx(gZ,{}),e]})}const CPe=T.lazy(()=>co(()=>import("./HomePage-CADE138j.js"),[])),TPe=T.lazy(()=>co(()=>import("./MainPage-CO3pRlnV.js"),__vite__mapDeps([7,8]))),wPe=T.lazy(()=>co(()=>import("./ModelPage-C1OSTv-x.js"),[])),kPe=T.lazy(()=>co(()=>import("./PackagePage-e4kN75YR.js"),[])),APe=T.lazy(()=>co(()=>import("./MaterializationsPage-p9YjkRXZ.js"),[])),DPe=T.lazy(()=>co(()=>import("./EnvironmentPage-BsAnavYN.js"),[])),OPe=T.lazy(()=>co(()=>import("./RouteError-CzbfOkng.js"),[])),RPe=T.lazy(()=>co(()=>import("./WorkbookPage-DNWmkCXa.js"),[])),MPe=T.lazy(()=>co(()=>import("./ThemeEditorPage-CciagFTq.js"),__vite__mapDeps([9,8]))),NPe=(e="/",t,n)=>sV([{path:e,element:m.jsx(joe,{children:m.jsx(Cxe,{workbookStorage:t,children:m.jsx(EPe,{children:m.jsx(T.Suspense,{fallback:m.jsx(Ca,{}),children:m.jsx(TPe,{headerProps:n})})})})}),errorElement:m.jsx(OPe,{}),children:[{index:!0,element:m.jsx(CPe,{})},{path:"settings/theme",element:m.jsx(MPe,{})},{path:"settings",element:m.jsx(FU,{to:"/settings/theme",replace:!0})},{path:":environmentName",element:m.jsx(DPe,{})},{path:":environmentName/:packageName",element:m.jsx(kPe,{})},{path:":environmentName/:packageName/materializations",element:m.jsx(APe,{})},{path:":environmentName/:packageName/*",element:m.jsx(wPe,{})},{path:":environmentName/:packageName/workbook/:workspace/:workbookPath",element:m.jsx(RPe,{})}]}]),PPe=NPe("/",new Oxe,void 0);sH.createRoot(document.getElementById("root")).render(m.jsx(T.StrictMode,{children:m.jsx(vV,{router:PPe})}));export{Axe as $,nt as A,Au as B,la as C,dl as D,eo as E,_Pe as F,gt as G,Ld as H,dr as I,Mu as J,Dr as K,pA as L,iF as M,MF as N,fy as O,Ci as P,uF as Q,yy as R,Pw as S,at as T,sb as U,Xd as V,EIe as W,mb as X,LPe as Y,bIe as Z,Ca as _,Ei as a,MD as a0,SIe as a1,vIe as a2,gNe as a3,xIe as a4,gIe as a5,yIe as a6,OU as a7,Ux as a8,Lr as a9,pD as aA,xS as aB,JA as aC,tD as aD,O3 as aE,bB as aF,IPe as aG,pu as aH,Jy as aI,v4 as aJ,mIe as aa,yP as ab,vt as ac,xu as ad,see as ae,kA as af,_r as ag,Gae as ah,jI as ai,cc as aj,Ls as ak,Tne as al,xK as am,Hte as an,uI as ao,ch as ap,uh as aq,_s as ar,wi as as,Ai as at,ki as au,Vx as av,dh as aw,ef as ax,Cb as ay,Lge as az,Qt as b,ca as c,Yt as d,Ow as e,Xt as f,Nq as g,Z6 as h,Dt as i,m as j,Kt as k,hc as l,Jt as m,Is as n,fo as o,Qd as p,sc as q,T as r,Ye as s,P6 as t,j2 as u,Fp as v,j6 as w,q2 as x,I6 as y,xn as z};
529
+ `,b4="publisher-malloy-renderer-overrides";function hPe(){if(typeof document>"u"||document.getElementById(b4))return;const e=document.createElement("style");e.id=b4,e.textContent=pPe,document.head.appendChild(e)}function mPe({result:e,height:t,onDrill:n,onSizeChange:r}){const o=T.useRef(null),a=T.useRef(!1),i=T.useRef(null),s=T.useRef(0),{theme:c,layers:u,mode:f}=mb();return T.useEffect(()=>()=>{s.current+=1,i.current?.viz.remove(),i.current=null},[]),T.useLayoutEffect(()=>{if(!o.current||!e)return;hPe();const p=o.current,y=s.current+=1;let g=!1;const b=()=>!g&&y===s.current;let x,E,S=null,w=null,C=null;a.current=!1;const R=M=>{if(a.current||g||!M.firstElementChild)return;const D=M.firstElementChild.firstElementChild;if(!D)return;const I=D.firstElementChild;let L=D.scrollHeight||D.offsetHeight||0;I&&D.classList.contains("malloy-dashboard")&&(L=I.scrollHeight||I.offsetHeight||0),L>0&&(a.current=!0,r&&r(L))};return(async()=>{let M;try{M=JSON.parse(e)}catch($){console.error("Error parsing visualization result:",$);return}const D=await dPe(M),I=D?kA([...u,D],f):c;if(!b())return;try{E=await uPe(I,n)}catch($){console.error("Failed to create renderer:",$);return}if(!b()){E.remove(),E=void 0;return}const L=i.current;x=document.createElement("div"),x.style.width="100%",x.style.height="100%",fPe(x,I),L&&(p.style.position="relative",x.style.position="absolute",x.style.inset="0",x.style.visibility="hidden"),p.appendChild(x);const F=x;S=new MutationObserver(()=>{w&&clearTimeout(w),w=setTimeout(()=>{R(F),S?.disconnect()},100)}),S.observe(x,{childList:!0,subtree:!0,attributes:!0});const B=E;let U=!1;const k=()=>{U||!b()||(U=!0,C&&(clearTimeout(C),C=null),L&&(L.viz.remove(),L.node.parentNode===p&&p.removeChild(L.node)),F.style.position="",F.style.inset="",F.style.visibility="",p.style.position="",i.current={viz:B,node:F},R(F))};try{E.setResult(M),E.render(x),E.onReady(k),C=setTimeout(k,1e4)}catch($){console.error("Error rendering visualization:",$),S?.disconnect(),E.remove(),E=void 0,F.parentNode===p&&p.removeChild(F)}})(),()=>{g=!0,S?.disconnect(),w&&clearTimeout(w),C&&clearTimeout(C),x&&i.current?.node!==x&&(E?.remove(),x.parentNode===p&&p.removeChild(x),p.style.position="")}},[e,n,r,c,u,f]),m.jsx("div",{ref:o,style:{width:"100%",height:t?`${t}px`:"400px"}})}function gPe(e){return typeof window>"u"?m.jsx(gt,{sx:{width:"100%",height:e.height?`${e.height}px`:"100%",display:"flex",alignItems:"center",justifyContent:"center",color:"text.secondary"},children:"Loading..."}):m.jsx(T.Suspense,{fallback:m.jsx(gt,{sx:{width:"100%",height:e.height?`${e.height}px`:"100%",display:"flex",alignItems:"center",justifyContent:"center",color:"text.secondary"},children:"Loading visualization..."}),children:m.jsx(mPe,{...e})})}const yPe=Object.freeze(Object.defineProperty({__proto__:null,default:gPe},Symbol.toStringTag,{value:"Module"})),To={white:"#FFFFFF",offWhite:"#F8F8F6",grey:{light:"#E6E4E1",mid:"#91908F"},black:"#30302E",semantic:{success:{main:"#7A9461",light:"#E8EDDF",dark:"#5F7A4B"},warning:{main:"#B5943A",light:"#F3ECDA",dark:"#8E7430"},error:{main:"#BF6050",light:"#F2DDD9",dark:"#9C4D40"},info:{main:"#628698",light:"#DDE6EA",dark:"#4D6B79"}}},CIe='"JetBrains Mono", "ui-monospace", "SFMono-Regular", "Menlo", monospace',j0='"Inter", "Helvetica Neue", "Arial", sans-serif',Hi={50:To.offWhite,100:"#F4F3F1",200:To.grey.light,300:"#D4D2CF",400:"#B3B1AF",500:To.grey.mid,600:"#73726F",700:"#555450",800:"#424140",900:To.black},TIe={headerHeight:56},vw="0 1px 3px rgba(0, 0, 0, 0.1)",bPe="#0f172a",vPe="#1e293b",xPe="#f1f5f9",SPe="#cbd5e1",EPe="#334155",F9=(e="light")=>{const t=e==="dark",n=t?bPe:To.white,r=t?vPe:To.white,o=t?xPe:To.black,a=t?SPe:To.grey.mid,i=t?EPe:To.grey.light,s=t?"#334155":"#555450",c=t?"#475569":"#73726f";return Px({cssVariables:{nativeColor:!0},palette:{mode:e,primary:{main:s,light:To.grey.light,dark:c,contrastText:"#ffffff"},secondary:{main:To.grey.mid,light:To.grey.light,dark:To.black},grey:Hi,success:To.semantic.success,warning:To.semantic.warning,error:To.semantic.error,info:To.semantic.info,background:{default:n,paper:r},text:{primary:o,secondary:a},divider:i},typography:{fontFamily:j0,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}},MuiCssBaseline:{styleOverrides:{"*":{scrollbarWidth:"thin",scrollbarColor:t?"#475569 #1e293b":`${Hi[300]} ${Hi[100]}`,"&::-webkit-scrollbar":{width:"8px",height:"8px"},"&::-webkit-scrollbar-track":{background:t?"#1e293b":Hi[100],borderRadius:"4px"},"&::-webkit-scrollbar-thumb":{background:t?"#475569":Hi[300],borderRadius:"4px","&:hover":{background:t?"#64748b":Hi[400]}},"&::-webkit-scrollbar-corner":{background:t?"#1e293b":Hi[100]}},"div[data-radix-popper-content-wrapper]":{zIndex:"1300 !important"}}},MuiButton:{styleOverrides:{root:{borderRadius:20,textTransform:"none",fontWeight:500,boxShadow:"none","&:hover":{boxShadow:vw}},contained:{"&:hover":{boxShadow:"0 2px 4px rgba(0, 0, 0, 0.1)"}},outlined:{color:o,borderColor:t?"#475569":Hi[300],"&:hover":{borderColor:t?"#64748b":Hi[400],backgroundColor:t?"rgba(255, 255, 255, 0.06)":"rgba(0, 0, 0, 0.04)"}}}},MuiCard:{styleOverrides:{root:{borderRadius:4,boxShadow:vw,border:"1px solid",borderColor:i,backgroundColor:r}}},MuiChip:{styleOverrides:{root:{borderRadius:4,fontWeight:500}}},MuiTextField:{styleOverrides:{root:{"& .MuiOutlinedInput-root":{borderRadius:4},"& .MuiInputLabel-outlined":{backgroundColor:r,paddingLeft:4,paddingRight:4,"&.MuiInputLabel-shrink":{transform:"translate(14px, -9px) scale(0.75)"}}}}},MuiDialog:{styleOverrides:{paper:{borderRadius:4,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:j0,fontSize:"0.875rem",color:a}}},MuiInputLabel:{styleOverrides:{root:{"&.MuiInputLabel-outlined":{backgroundColor:r,paddingLeft:4,paddingRight:4}}}},MuiOutlinedInput:{styleOverrides:{notchedOutline:{border:"none"},root:{border:`1px solid ${i}`,borderRadius:8,transition:"border-color 120ms ease-in",backgroundColor:r,"&:hover":{borderColor:t?"#475569":Hi[300]},"&.Mui-focused":{borderColor:t?"#64748b":Hi[400],outline:"none"}}}},MuiMenuItem:{styleOverrides:{root:{fontFamily:j0,fontSize:"0.875rem"}}},MuiInputBase:{styleOverrides:{root:{fontFamily:j0}}},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 ${i}`,backgroundColor:r,color:o}}},MuiBreadcrumbs:{styleOverrides:{root:{"& .MuiBreadcrumbs-separator":{margin:"0 6px",color:Hi[400]}}}},MuiDivider:{styleOverrides:{root:{borderColor:i}},defaultProps:{sx:{my:1}}},MuiListItemButton:{styleOverrides:{root:{borderRadius:28,margin:"2px 8px",padding:"8px 16px","&:hover":{backgroundColor:t?"rgba(255, 255, 255, 0.08)":To.offWhite},"&.Mui-selected":{backgroundColor:t?"rgba(255, 255, 255, 0.12)":To.offWhite,color:o,"& .MuiListItemIcon-root":{color:o},"& .MuiListItemText-primary":{color:o},"&:hover":{backgroundColor:t?"rgba(255, 255, 255, 0.16)":To.grey.light}}}}},MuiAppBar:{styleOverrides:{root:{backgroundColor:r,color:o,boxShadow:vw}}}}})};F9("light");function CPe({children:e}){const{mode:t}=mb(),n=T.useMemo(()=>F9(t),[t]);return m.jsxs(pY,{theme:n,children:[m.jsx(gZ,{}),e]})}const TPe=T.lazy(()=>co(()=>import("./HomePage-C9yNw3iu.js"),[])),wPe=T.lazy(()=>co(()=>import("./MainPage-J_rU2SgI.js"),__vite__mapDeps([7,8]))),kPe=T.lazy(()=>co(()=>import("./ModelPage-BzXfjTu5.js"),[])),APe=T.lazy(()=>co(()=>import("./PackagePage-ByoSTLJ4.js"),[])),DPe=T.lazy(()=>co(()=>import("./MaterializationsPage-DHgPI4MO.js"),[])),OPe=T.lazy(()=>co(()=>import("./EnvironmentPage-DaP6CpgK.js"),[])),RPe=T.lazy(()=>co(()=>import("./RouteError-CrSeKN2r.js"),[])),MPe=T.lazy(()=>co(()=>import("./WorkbookPage-D6JLPnWO.js"),[])),NPe=T.lazy(()=>co(()=>import("./ThemeEditorPage-Btxnmhtk.js"),__vite__mapDeps([9,8]))),PPe=(e="/",t,n)=>sV([{path:e,element:m.jsx(joe,{children:m.jsx(Cxe,{workbookStorage:t,children:m.jsx(CPe,{children:m.jsx(T.Suspense,{fallback:m.jsx(Ca,{}),children:m.jsx(wPe,{headerProps:n})})})})}),errorElement:m.jsx(RPe,{}),children:[{index:!0,element:m.jsx(TPe,{})},{path:"settings/theme",element:m.jsx(NPe,{})},{path:"settings",element:m.jsx(FU,{to:"/settings/theme",replace:!0})},{path:":environmentName",element:m.jsx(OPe,{})},{path:":environmentName/:packageName",element:m.jsx(APe,{})},{path:":environmentName/:packageName/materializations",element:m.jsx(DPe,{})},{path:":environmentName/:packageName/*",element:m.jsx(kPe,{})},{path:":environmentName/:packageName/workbook/:workspace/:workbookPath",element:m.jsx(MPe,{})}]}]),IPe=PPe("/",new Oxe,void 0);sH.createRoot(document.getElementById("root")).render(m.jsx(T.StrictMode,{children:m.jsx(vV,{router:IPe})}));export{Axe as $,nt as A,Au as B,la as C,dl as D,eo as E,LPe as F,gt as G,Ld as H,dr as I,vIe as J,Mu as K,pA as L,iF as M,Dr as N,MF as O,Ci as P,fy as Q,yy as R,Pw as S,at as T,uF as U,sb as V,Xd as W,mb as X,TIe as Y,FPe as Z,Ca as _,Ei as a,MD as a0,EIe as a1,xIe as a2,gNe as a3,vNe as a4,CIe as a5,fA as a6,SIe as a7,yIe as a8,bIe as a9,ef as aA,Cb as aB,Lge as aC,pD as aD,xS as aE,JA as aF,tD as aG,O3 as aH,bB as aI,_Pe as aJ,pu as aK,Jy as aL,v4 as aM,OU as aa,Ux as ab,Lr as ac,gIe as ad,yP as ae,vt as af,xu as ag,see as ah,kA as ai,_r as aj,Gae as ak,jI as al,cc as am,Ls as an,Tne as ao,xK as ap,Hte as aq,uI as ar,ch as as,uh as at,_s as au,wi as av,Ai as aw,ki as ax,Vx as ay,dh as az,Qt as b,ca as c,Yt as d,Ow as e,Xt as f,Nq as g,Z6 as h,Dt as i,m as j,Kt as k,hc as l,Jt as m,Is as n,fo as o,Qd as p,sc as q,T as r,Ye as s,P6 as t,j2 as u,Fp as v,j6 as w,q2 as x,I6 as y,xn as z};