@malloy-publisher/sdk 0.9.11 → 0.9.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{RenderedResult-Cmx8sX8d.es.js → RenderedResult-CDiXJAh9.es.js} +2 -2
- package/dist/{RenderedResult-BlNoIiSi.cjs.js → RenderedResult-De51QvsZ.cjs.js} +1 -1
- package/dist/ServerProvider-DKrBcXL7.cjs.js +1 -0
- package/dist/{ServerProvider-azXLkk1q.es.js → ServerProvider-RvKSbvnL.es.js} +3 -1
- package/dist/builder/index.cjs.js +1 -1
- package/dist/builder/index.es.js +3 -3
- package/dist/client/api.d.ts +46 -1
- package/dist/client/index.cjs.js +1 -1
- package/dist/client/index.es.js +1 -1
- package/dist/components/Connections/common.d.ts +11 -3
- package/dist/index.cjs.js +9 -9
- package/dist/index.es.js +2541 -2400
- package/dist/{useCompiledDocument-7j5cBjQd.es.js → useCompiledDocument-Bf4RSfB6.es.js} +2 -2
- package/dist/{useCompiledDocument-B21sVbb4.cjs.js → useCompiledDocument-XsQz85Ri.cjs.js} +2 -2
- package/package.json +1 -1
- package/src/components/Connections/AddConnectionDialog.tsx +34 -2
- package/src/components/Connections/EditConnectionDialog.tsx +45 -3
- package/src/components/Connections/common.spec.ts +69 -0
- package/src/components/Connections/common.ts +132 -0
- package/src/components/Environment/Connections.tsx +1 -0
- package/dist/ServerProvider-BOgiW8MX.cjs.js +0 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as b, jsxs as ne, Fragment as Qt } from "react/jsx-runtime";
|
|
2
2
|
import { Box as ve, Dialog as hd, DialogTitle as md, IconButton as qn, DialogContent as gd, Typography as Ye, Stack as wt, DialogActions as yd, Button as rt, Tooltip as xn, TextField as fn, InputAdornment as $l, Alert as bd, Autocomplete as vd, CircularProgress as Ol, FormControl as Ni, Slider as Sd, FormHelperText as Bi, FormControlLabel as xd, Checkbox as wd, MenuItem as En, ButtonBase as El, Popover as Cd, Paper as Al, LinearProgress as Pd } from "@mui/material";
|
|
3
|
-
import { b4 as je, b8 as Xn, b9 as kd, b5 as Qn, b3 as Fl, bo as Md } from "./ServerProvider-
|
|
3
|
+
import { b4 as je, b8 as Xn, b9 as kd, b5 as Qn, b3 as Fl, bo as Md } from "./ServerProvider-RvKSbvnL.es.js";
|
|
4
4
|
import * as v from "react";
|
|
5
5
|
import xt, { useState as Xe, useEffect as ot, useRef as dt, useMemo as He, createContext as Gs, useContext as $o, useId as Ll, useCallback as tt, isValidElement as oo, cloneElement as so, Children as Dd, Suspense as Td, lazy as Rd } from "react";
|
|
6
6
|
import { useQueries as Nl, useQuery as Id, useMutation as $d, keepPreviousData as Od } from "@tanstack/react-query";
|
|
@@ -22817,7 +22817,7 @@ function aP(e) {
|
|
|
22817
22817
|
`)
|
|
22818
22818
|
};
|
|
22819
22819
|
}
|
|
22820
|
-
const lP = Rd(() => import("./RenderedResult-
|
|
22820
|
+
const lP = Rd(() => import("./RenderedResult-CDiXJAh9.es.js").then((e) => e.c));
|
|
22821
22821
|
function cP({
|
|
22822
22822
|
result: e,
|
|
22823
22823
|
maxHeight: t,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";var op=Object.create;var Yi=Object.defineProperty;var sp=Object.getOwnPropertyDescriptor;var ip=Object.getOwnPropertyNames;var ap=Object.getPrototypeOf,lp=Object.prototype.hasOwnProperty;var cp=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of ip(t))!lp.call(e,o)&&o!==n&&Yi(e,o,{get:()=>t[o],enumerable:!(r=sp(t,o))||r.enumerable});return e};var _r=(e,t,n)=>(n=e!=null?op(ap(e)):{},cp(t||!e||!e.__esModule?Yi(n,"default",{value:e,enumerable:!0}):n,e));const f=require("react/jsx-runtime"),W=require("@mui/material"),Se=require("./ServerProvider-
|
|
1
|
+
"use strict";var op=Object.create;var Yi=Object.defineProperty;var sp=Object.getOwnPropertyDescriptor;var ip=Object.getOwnPropertyNames;var ap=Object.getPrototypeOf,lp=Object.prototype.hasOwnProperty;var cp=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of ip(t))!lp.call(e,o)&&o!==n&&Yi(e,o,{get:()=>t[o],enumerable:!(r=sp(t,o))||r.enumerable});return e};var _r=(e,t,n)=>(n=e!=null?op(ap(e)):{},cp(t||!e||!e.__esModule?Yi(n,"default",{value:e,enumerable:!0}):n,e));const f=require("react/jsx-runtime"),W=require("@mui/material"),Se=require("./ServerProvider-DKrBcXL7.cjs.js"),ee=require("react"),Dr=require("@tanstack/react-query"),up=require("@emotion/react"),He=require("@mui/system"),ir=require("react-dom"),dp=require("markdown-to-jsx"),Ns=require("./text-entry-BJwltZiy.cjs.js"),pp=require("@emotion/styled"),tt=require("@malloydata/malloy-filter"),fp=require("@mui/icons-material"),hp=require("@malloydata/malloy-tag");function Ol(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const v=Ol(ee),mp=Ol(ir),$t={report:"publisher-report",header:"publisher-report-header",title:"publisher-report-title",filterRow:"publisher-filter-row",filter:"publisher-filter",filterPopover:"publisher-filter-popover",tile:"publisher-tile",tileHeading:"publisher-tile-heading",drillCell:"publisher-drill",builder:"publisher-builder",builderBar:"publisher-builder-bar",saveStatus:"publisher-save-status",builderTile:"publisher-builder-tile",widthHandle:"publisher-width-handle",menu:"publisher-menu",dialog:"publisher-dialog",addTileDialog:"publisher-add-tile-dialog",filterDialog:"publisher-filter-dialog",clickableCellsDialog:"publisher-clickable-cells-dialog",newReportDialog:"publisher-new-report-dialog"},Gi=e=>e,gp=()=>{let e=Gi;return{configure(t){e=t},generate(t){return e(t)},reset(){e=Gi}}},Al=gp();function Ot(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.`}function le(e){if(typeof e!="string")throw new Error(Ot(7));return e.charAt(0).toUpperCase()+e.slice(1)}function qi(...e){return e.reduce((t,n)=>n==null?t:function(...o){t.apply(this,o),n.apply(this,o)},()=>{})}function Nt(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function yp(e){if(Object.prototype.hasOwnProperty.call(e,"__esModule"))return e;var t=e.default;if(typeof t=="function"){var n=function r(){return this instanceof r?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(r){var o=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(n,r,o.get?o:{enumerable:!0,get:function(){return e[r]}})}),n}var Xo={exports:{}},Qo,Ki;function bp(){if(Ki)return Qo;Ki=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return Qo=e,Qo}var Zo,Xi;function vp(){if(Xi)return Zo;Xi=1;var e=bp();function t(){}function n(){}return n.resetWarningCache=t,Zo=function(){function r(i,a,l,c,u,p){if(p!==e){var m=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw m.name="Invariant Violation",m}}r.isRequired=r;function o(){return r}var s={array:r,bigint:r,bool:r,func:r,number:r,object:r,string:r,symbol:r,any:r,arrayOf:o,element:r,elementType:r,instanceOf:o,node:r,objectOf:o,oneOf:o,oneOfType:o,shape:o,exact:o,checkPropTypes:n,resetWarningCache:t};return s.PropTypes=s,s},Zo}var Qi;function xp(){return Qi||(Qi=1,Xo.exports=vp()()),Xo.exports}var Sp=xp();const _=Nt(Sp);function Fl(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(n=Fl(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function de(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=Fl(e))&&(r&&(r+=" "),r+=t);return r}function me(e,t,n=void 0){const r={};for(const o in e){const s=e[o];let i="",a=!0;for(let l=0;l<s.length;l+=1){const c=s[l];c&&(i+=(a===!0?"":" ")+t(c),a=!1,n&&n[c]&&(i+=" "+n[c]))}r[o]=i}return r}var Jo={exports:{}},Ie={};/**
|
|
2
2
|
* @license React
|
|
3
3
|
* react-is.production.js
|
|
4
4
|
*
|
|
@@ -134,7 +134,7 @@ ${t}`}function Qm(e){return e?.status===403}const Zm=1e3;function Bc(e){const t=
|
|
|
134
134
|
`));u&&R.current&&R.current.getSectionContent(P.startIndex).focus()},[]),{interactions:M,returnedValue:{autoFocus:u,readOnly:n,focused:c??$,sectionListRef:N,onBlur:X,onClick:O,onFocus:V,onInput:A,onPaste:L,enableAccessibleFieldDOMStructure:!0,elements:q,tabIndex:h===0?-1:0,contentEditable:H,value:J,onChange:te,areAllSectionsEmpty:k}}},Tn=e=>e.replace(/[\u2066\u2067\u2068\u2069]/g,""),QS=(e,t,n)=>{let r=0,o=n?1:0;const s=[];for(let i=0;i<e.length;i+=1){const a=e[i],l=ii(a,n?"input-rtl":"input-ltr",t),c=`${a.startSeparator}${l}${a.endSeparator}`,u=Tn(c).length,p=c.length,m=Tn(l),b=o+(m===""?0:l.indexOf(m[0]))+a.startSeparator.length,d=b+m.length;s.push(j({},a,{start:r,end:r+u,startInInput:b,endInInput:d})),r+=u,o+=p}return s},ZS=e=>{const t=vt(),n=v.useRef(void 0),r=v.useRef(void 0),{forwardedProps:{onFocus:o,onClick:s,onPaste:i,onBlur:a,inputRef:l,placeholder:c},internalProps:{readOnly:u=!1,disabled:p=!1},parsedSelectedSections:m,activeSectionIndex:b,state:d,fieldValueManager:h,valueManager:g,applyCharacterEditing:w,resetCharacterQuery:C,updateSectionValue:S,updateValueFromValueStr:x,clearActiveSection:P,clearValue:k,setTempAndroidValueStr:I,setSelectedSections:R,getSectionsFromValue:N,areAllSectionsEmpty:F,localizedDigits:E}=e,y=v.useRef(null),$=ke(l,y),D=v.useMemo(()=>QS(d.sections,E,t),[d.sections,E,t]),M=v.useMemo(()=>({syncSelectionToDOM:()=>{if(!y.current)return;if(m==null){y.current.scrollLeft&&(y.current.scrollLeft=0);return}if(y.current!==Ke(document))return;const Q=y.current.scrollTop;if(m==="all")y.current.select();else{const G=D[m],H=G.type==="empty"?G.startInInput-G.startSeparator.length:G.startInInput,q=G.type==="empty"?G.endInInput+G.endSeparator.length:G.endInInput;(H!==y.current.selectionStart||q!==y.current.selectionEnd)&&y.current===Ke(document)&&y.current.setSelectionRange(H,q),clearTimeout(r.current),r.current=setTimeout(()=>{y.current&&y.current===Ke(document)&&y.current.selectionStart===y.current.selectionEnd&&(y.current.selectionStart!==H||y.current.selectionEnd!==q)&&M.syncSelectionToDOM()})}y.current.scrollTop=Q},getActiveSectionIndexFromDOM:()=>{const Q=y.current.selectionStart??0,G=y.current.selectionEnd??0;if(Q===0&&G===0)return null;const H=Q<=D[0].startInInput?1:D.findIndex(q=>q.startInInput-q.startSeparator.length>Q);return H===-1?D.length-1:H-1},focusField:(Q=0)=>{Ke(document)!==y.current&&(y.current?.focus(),R(Q))},setSelectedSections:Q=>R(Q),isFieldFocused:()=>y.current===Ke(document)}),[y,m,D,R]),T=()=>{const Q=y.current.selectionStart??0;let G;Q<=D[0].startInInput||Q>=D[D.length-1].endInInput?G=1:G=D.findIndex(q=>q.startInInput-q.startSeparator.length>Q);const H=G===-1?D.length-1:G-1;R(H)},O=ue((...Q)=>{o?.(...Q);const G=y.current;clearTimeout(n.current),n.current=setTimeout(()=>{!G||G!==y.current||b==null&&(G.value.length&&Number(G.selectionEnd)-Number(G.selectionStart)===G.value.length?R("all"):T())})}),A=ue((Q,...G)=>{Q.isDefaultPrevented()||(s?.(Q,...G),T())}),L=ue(Q=>{if(i?.(Q),Q.preventDefault(),u||p)return;const G=Q.clipboardData.getData("text");if(typeof m=="number"){const H=d.sections[m],q=/^[a-zA-Z]+$/.test(G),te=/^[0-9]+$/.test(G),J=/^(([a-zA-Z]+)|)([0-9]+)(([a-zA-Z]+)|)$/.test(G);if(H.contentType==="letter"&&q||H.contentType==="digit"&&te||H.contentType==="digit-with-letter"&&J){C(),S({activeSection:H,newSectionValue:G,shouldGoToNextSection:!0});return}if(q||te)return}C(),x(G)}),V=ue((...Q)=>{a?.(...Q),R(null)}),X=ue(Q=>{if(u)return;const G=Q.target.value;if(G===""){C(),k();return}const H=Q.nativeEvent.data,q=H&&H.length>1,te=q?H:G,J=Tn(te);if(m==="all"&&R(b),b==null||q){x(q?H:J);return}let B;if(m==="all"&&J.length===1)B=J;else{const K=Tn(h.getV6InputValueFromSections(D,E,t));let oe=-1,ne=-1;for(let be=0;be<K.length;be+=1)oe===-1&&K[be]!==J[be]&&(oe=be),ne===-1&&K[K.length-be-1]!==J[J.length-be-1]&&(ne=be);const ce=D[b];if(oe<ce.start||K.length-ne-1>ce.end)return;const fe=J.length-K.length+ce.end-Tn(ce.endSeparator||"").length;B=J.slice(ce.start+Tn(ce.startSeparator||"").length,fe)}if(B.length===0){ty()&&I(te),C(),P();return}w({keyPressed:B,sectionIndex:b})}),re=v.useMemo(()=>c!==void 0?c:h.getV6InputValueFromSections(N(g.emptyValue),E,t),[c,h,N,g.emptyValue,E,t]),ae=v.useMemo(()=>d.tempValueStrAndroid??h.getV6InputValueFromSections(d.sections,E,t),[d.sections,h,d.tempValueStrAndroid,E,t]);v.useEffect(()=>(y.current&&y.current===Ke(document)&&R("all"),()=>{clearTimeout(n.current),clearTimeout(r.current)}),[]);const ie=v.useMemo(()=>b==null||d.sections[b].contentType==="letter"?"text":"numeric",[b,d.sections]),Z=!(y.current&&y.current===Ke(document))&&F;return{interactions:M,returnedValue:{readOnly:u,onBlur:V,onClick:A,onFocus:O,onPaste:L,inputRef:$,enableAccessibleFieldDOMStructure:!1,placeholder:re,inputMode:ie,autoComplete:"off",value:Z?"":ae,onChange:X}}},JS=e=>{const t=Le(),{internalProps:n,internalProps:{unstableFieldRef:r,minutesStep:o,enableAccessibleFieldDOMStructure:s=!1,disabled:i=!1,readOnly:a=!1},forwardedProps:{onKeyDown:l,error:c,clearable:u,onClear:p},fieldValueManager:m,valueManager:b,validator:d}=e,h=vt(),g=GS(e),{state:w,activeSectionIndex:C,parsedSelectedSections:S,setSelectedSections:x,clearValue:P,clearActiveSection:k,updateSectionValue:I,setTempAndroidValueStr:R,sectionsValueBoundaries:N,localizedDigits:F,timezone:E}=g,y=KS({sections:w.sections,updateSectionValue:I,sectionsValueBoundaries:N,localizedDigits:F,setTempAndroidValueStr:R,timezone:E}),{resetCharacterQuery:$}=y,D=b.areValuesEqual(t,w.value,b.emptyValue),M=s?XS:ZS,T=v.useMemo(()=>ny(w.sections,h&&!s),[w.sections,h,s]),{returnedValue:O,interactions:A}=M(j({},e,g,y,{areAllSectionsEmpty:D,sectionOrder:T})),L=ue(z=>{if(l?.(z),!i)switch(!0){case((z.ctrlKey||z.metaKey)&&String.fromCharCode(z.keyCode)==="A"&&!z.shiftKey&&!z.altKey):{z.preventDefault(),x("all");break}case z.key==="ArrowRight":{if(z.preventDefault(),S==null)x(T.startIndex);else if(S==="all")x(T.endIndex);else{const Z=T.neighbors[S].rightIndex;Z!==null&&x(Z)}break}case z.key==="ArrowLeft":{if(z.preventDefault(),S==null)x(T.endIndex);else if(S==="all")x(T.startIndex);else{const Z=T.neighbors[S].leftIndex;Z!==null&&x(Z)}break}case z.key==="Delete":{if(z.preventDefault(),a)break;S==null||S==="all"?P():k(),$();break}case["ArrowUp","ArrowDown","Home","End","PageUp","PageDown"].includes(z.key):{if(z.preventDefault(),a||C==null)break;S==="all"&&x(C);const Z=w.sections[C],Q=m.getActiveDateManager(t,w,Z),G=qg(t,E,Z,z.key,N,F,Q.date,{minutesStep:o});I({activeSection:Z,newSectionValue:G,shouldGoToNextSection:!1});break}}});Ue(()=>{A.syncSelectionToDOM()});const{hasValidationError:V}=au({props:n,validator:d,timezone:E,value:w.value,onError:n.onError}),X=v.useMemo(()=>c!==void 0?c:V,[V,c]);v.useEffect(()=>{!X&&C==null&&$()},[w.referenceValue,C,X]),v.useEffect(()=>{w.tempValueStrAndroid!=null&&C!=null&&($(),k())},[w.sections]),v.useImperativeHandle(r,()=>({getSections:()=>w.sections,getActiveSectionIndex:A.getActiveSectionIndexFromDOM,setSelectedSections:A.setSelectedSections,focusField:A.focusField,isFieldFocused:A.isFieldFocused}));const re=ue((z,...Z)=>{z.preventDefault(),p?.(z,...Z),P(),A.isFieldFocused()?x(T.startIndex):A.focusField(0)}),ae={onKeyDown:L,onClear:re,error:X,clearable:!!(u&&!D&&!a&&!i)},ie={disabled:i,readOnly:a};return j({},e.forwardedProps,ae,ie,O)},ew=["clearable","onClear","InputProps","sx","slots","slotProps"],tw=["ownerState"],nw=e=>{const t=jt(),{clearable:n,onClear:r,InputProps:o,sx:s,slots:i,slotProps:a}=e,l=ve(e,ew),c=i?.clearButton??Nr,u=Pe({elementType:c,externalSlotProps:a?.clearButton,ownerState:{},className:"clearButton",additionalProps:{title:t.fieldClearLabel}}),p=ve(u,tw),m=i?.clearIcon??d0,b=Pe({elementType:m,externalSlotProps:a?.clearIcon,ownerState:{}});return j({},l,{InputProps:j({},o,{endAdornment:f.jsxs(v.Fragment,{children:[n&&f.jsx(lu,{position:"end",sx:{marginRight:o?.endAdornment?-1:-1.5},children:f.jsx(c,j({},p,{onClick:r,children:f.jsx(m,j({fontSize:"small"},b))}))}),o?.endAdornment]})}),sx:[{"& .clearButton":{opacity:1},"@media (pointer: fine)":{"& .clearButton":{opacity:0},"&:hover, &:focus-within":{".clearButton":{opacity:1}}}},...Array.isArray(s)?s:[s]]})},rw=["value","defaultValue","referenceDate","format","formatDensity","onChange","timezone","onError","shouldRespectLeadingZeros","selectedSections","onSelectedSectionsChange","unstableFieldRef","enableAccessibleFieldDOMStructure","disabled","readOnly","dateSeparator"],ow=(e,t)=>v.useMemo(()=>{const n=j({},e),r={},o=s=>{n.hasOwnProperty(s)&&(r[s]=n[s],delete n[s])};return rw.forEach(o),su.forEach(o),{forwardedProps:n,internalProps:r}},[e,t]),sw=e=>{const t=Le(),n=Ar();return j({},e,{disablePast:e.disablePast??!1,disableFuture:e.disableFuture??!1,format:e.format??t.formats.keyboardDate,minDate:lt(t,e.minDate,n.minDate),maxDate:lt(t,e.maxDate,n.maxDate)})},iw=e=>{const t=sw(e),{forwardedProps:n,internalProps:r}=ow(t,"date");return JS({forwardedProps:n,internalProps:r,valueManager:Dt,fieldValueManager:iy,validator:Fr,valueType:"date"})};function aw(e){return ge("MuiPickersTextField",e)}he("MuiPickersTextField",["root","focused","disabled","error","required"]);function lw(e){return ge("MuiPickersInputBase",e)}const $n=he("MuiPickersInputBase",["root","focused","disabled","error","notchedOutline","sectionContent","sectionBefore","sectionAfter","adornedStart","adornedEnd","input"]);function cw(e){return ge("MuiPickersSectionList",e)}const tr=he("MuiPickersSectionList",["root","section","sectionContent"]),uw=["slots","slotProps","elements","sectionListRef"],Wu=Y("div",{name:"MuiPickersSectionList",slot:"Root",overridesResolver:(e,t)=>t.root})({direction:"ltr /*! @noflip */",outline:"none"}),Hu=Y("span",{name:"MuiPickersSectionList",slot:"Section",overridesResolver:(e,t)=>t.section})({}),Uu=Y("span",{name:"MuiPickersSectionList",slot:"SectionSeparator",overridesResolver:(e,t)=>t.sectionSeparator})({whiteSpace:"pre"}),Yu=Y("span",{name:"MuiPickersSectionList",slot:"SectionContent",overridesResolver:(e,t)=>t.sectionContent})({outline:"none"}),dw=e=>{const{classes:t}=e;return me({root:["root"],section:["section"],sectionContent:["sectionContent"]},cw,t)};function pw(e){const{slots:t,slotProps:n,element:r,classes:o}=e,s=t?.section??Hu,i=Pe({elementType:s,externalSlotProps:n?.section,externalForwardedProps:r.container,className:o.section,ownerState:{}}),a=t?.sectionContent??Yu,l=Pe({elementType:a,externalSlotProps:n?.sectionContent,externalForwardedProps:r.content,additionalProps:{suppressContentEditableWarning:!0},className:o.sectionContent,ownerState:{}}),c=t?.sectionSeparator??Uu,u=Pe({elementType:c,externalSlotProps:n?.sectionSeparator,externalForwardedProps:r.before,ownerState:{position:"before"}}),p=Pe({elementType:c,externalSlotProps:n?.sectionSeparator,externalForwardedProps:r.after,ownerState:{position:"after"}});return f.jsxs(s,j({},i,{children:[f.jsx(c,j({},u)),f.jsx(a,j({},l)),f.jsx(c,j({},p))]}))}const fw=v.forwardRef(function(t,n){const r=Fe({props:t,name:"MuiPickersSectionList"}),{slots:o,slotProps:s,elements:i,sectionListRef:a}=r,l=ve(r,uw),c=dw(r),u=v.useRef(null),p=ke(n,u),m=h=>{if(!u.current)throw new Error(`MUI X: Cannot call sectionListRef.${h} before the mount of the component.`);return u.current};v.useImperativeHandle(a,()=>({getRoot(){return m("getRoot")},getSectionContainer(h){return m("getSectionContainer").querySelector(`.${tr.section}[data-sectionindex="${h}"]`)},getSectionContent(h){return m("getSectionContent").querySelector(`.${tr.section}[data-sectionindex="${h}"] .${tr.sectionContent}`)},getSectionIndexFromDOMElement(h){const g=m("getSectionIndexFromDOMElement");if(h==null||!g.contains(h))return null;let w=null;return h.classList.contains(tr.section)?w=h:h.classList.contains(tr.sectionContent)&&(w=h.parentElement),w==null?null:Number(w.dataset.sectionindex)}}));const b=o?.root??Wu,d=Pe({elementType:b,externalSlotProps:s?.root,externalForwardedProps:l,additionalProps:{ref:p,suppressContentEditableWarning:!0},className:c.root,ownerState:{}});return f.jsx(b,j({},d,{children:d.contentEditable?i.map(({content:h,before:g,after:w})=>`${g.children}${h.children}${w.children}`).join(""):f.jsx(v.Fragment,{children:i.map((h,g)=>f.jsx(pw,{slots:o,slotProps:s,element:h,classes:c},g))})}))}),hw=["elements","areAllSectionsEmpty","defaultValue","label","value","onChange","id","autoFocus","endAdornment","startAdornment","renderSuffix","slots","slotProps","contentEditable","tabIndex","onInput","onPaste","onKeyDown","fullWidth","name","readOnly","inputProps","inputRef","sectionListRef"],mw=e=>Math.round(e*1e5)/1e5,qo=Y("div",{name:"MuiPickersInputBase",slot:"Root",overridesResolver:(e,t)=>t.root})(({theme:e})=>j({},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:`${mw(.15/16)}em`,variants:[{props:{fullWidth:!0},style:{width:"100%"}}]})),Ii=Y(Wu,{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}}]})),gw=Y(Hu,{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"})),yw=Y(Yu,{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"})),bw=Y(Uu,{name:"MuiPickersInputBase",slot:"Separator",overridesResolver:(e,t)=>t.separator})(()=>({whiteSpace:"pre",letterSpacing:"inherit"})),vw=Y("input",{name:"MuiPickersInputBase",slot:"Input",overridesResolver:(e,t)=>t.hiddenInput})(j({},Ag)),xw=e=>{const{focused:t,disabled:n,error:r,classes:o,fullWidth:s,readOnly:i,color:a,size:l,endAdornment:c,startAdornment:u}=e,p={root:["root",t&&!n&&"focused",n&&"disabled",i&&"readOnly",r&&"error",s&&"fullWidth",`color${le(a)}`,l==="small"&&"inputSizeSmall",!!u&&"adornedStart",!!c&&"adornedEnd"],notchedOutline:["notchedOutline"],input:["input"],sectionsContainer:["sectionsContainer"],sectionContent:["sectionContent"],sectionBefore:["sectionBefore"],sectionAfter:["sectionAfter"]};return me(p,lw,o)},Ei=v.forwardRef(function(t,n){const r=Fe({props:t,name:"MuiPickersInputBase"}),{elements:o,areAllSectionsEmpty:s,value:i,onChange:a,id:l,endAdornment:c,startAdornment:u,renderSuffix:p,slots:m,slotProps:b,contentEditable:d,tabIndex:h,onInput:g,onPaste:w,onKeyDown:C,name:S,readOnly:x,inputProps:P,inputRef:k,sectionListRef:I}=r,R=ve(r,hw),N=v.useRef(null),F=ke(n,N),E=ke(P?.ref,k),y=vt(),$=ft();if(!$)throw new Error("MUI X: PickersInputBase should always be used inside a PickersTextField component");const D=V=>{if($.disabled){V.stopPropagation();return}$.onFocus?.(V)};v.useEffect(()=>{$&&$.setAdornedStart(!!u)},[$,u]),v.useEffect(()=>{$&&(s?$.onEmpty():$.onFilled())},[$,s]);const M=j({},r,$,{isRtl:y}),T=xw(M),O=m?.root||qo,A=Pe({elementType:O,externalSlotProps:b?.root,externalForwardedProps:R,additionalProps:{"aria-invalid":$.error,ref:F},className:T.root,ownerState:M}),L=m?.input||Ii;return f.jsxs(O,j({},A,{children:[u,f.jsx(fw,{sectionListRef:I,elements:o,contentEditable:d,tabIndex:h,className:T.sectionsContainer,onFocus:D,onBlur:$.onBlur,onInput:g,onPaste:w,onKeyDown:C,slots:{root:L,section:gw,sectionContent:yw,sectionSeparator:bw},slotProps:{root:{ownerState:M},sectionContent:{className:$n.sectionContent},sectionSeparator:({position:V})=>({className:V==="before"?$n.sectionBefore:$n.sectionAfter})}}),c,p?p(j({},$)):null,f.jsx(vw,j({name:S,className:T.input,value:i,onChange:a,id:l,"aria-hidden":"true",tabIndex:-1,readOnly:x,required:$.required,disabled:$.disabled},P,{ref:E}))]}))});function Sw(e){return ge("MuiPickersOutlinedInput",e)}const yt=j({},$n,he("MuiPickersOutlinedInput",["root","notchedOutline","input"])),ww=["children","className","label","notched","shrink"],Cw=Y("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}}),Tl=Y("span")(({theme:e})=>({fontFamily:e.typography.fontFamily,fontSize:"inherit"})),Pw=Y("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 kw(e){const{className:t,label:n}=e,r=ve(e,ww),o=n!=null&&n!=="",s=j({},e,{withLabel:o});return f.jsx(Cw,j({"aria-hidden":!0,className:t},r,{ownerState:s,children:f.jsx(Pw,{ownerState:s,children:o?f.jsx(Tl,{children:n}):f.jsx(Tl,{className:"notranslate",children:""})})}))}const Mw=["label","autoFocus","ownerState","notched"],Tw=Y(qo,{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 .${yt.notchedOutline}`]:{borderColor:(e.vars||e).palette.text.primary},"@media (hover: none)":{[`&:hover .${yt.notchedOutline}`]:{borderColor:e.vars?`rgba(${e.vars.palette.common.onBackgroundChannel} / 0.23)`:t}},[`&.${yt.focused} .${yt.notchedOutline}`]:{borderStyle:"solid",borderWidth:2},[`&.${yt.disabled}`]:{[`& .${yt.notchedOutline}`]:{borderColor:(e.vars||e).palette.action.disabled},"*":{color:(e.vars||e).palette.action.disabled}},[`&.${yt.error} .${yt.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:{[`&.${yt.focused}:not(.${yt.error}) .${yt.notchedOutline}`]:{borderColor:(e.vars||e).palette[n].main}}}))}}),Dw=Y(Ii,{name:"MuiPickersOutlinedInput",slot:"SectionsContainer",overridesResolver:(e,t)=>t.sectionsContainer})({padding:"16.5px 0",variants:[{props:{size:"small"},style:{padding:"8.5px 0"}}]}),Rw=e=>{const{classes:t}=e,r=me({root:["root"],notchedOutline:["notchedOutline"],input:["input"]},Sw,t);return j({},t,r)},Gu=v.forwardRef(function(t,n){const r=Fe({props:t,name:"MuiPickersOutlinedInput"}),{label:o,ownerState:s,notched:i}=r,a=ve(r,Mw),l=ft(),c=j({},r,s,l,{color:l?.color||"primary"}),u=Rw(c);return f.jsx(Ei,j({slots:{root:Tw,input:Dw},renderSuffix:p=>f.jsx(kw,{shrink:!!(i||p.adornedStart||p.focused||p.filled),notched:!!(i||p.adornedStart||p.focused||p.filled),className:u.notchedOutline,label:o!=null&&o!==""&&l?.required?f.jsxs(v.Fragment,{children:[o," ","*"]}):o,ownerState:c})},a,{label:o,classes:u,ref:n}))});Gu.muiName="Input";function Iw(e){return ge("MuiPickersFilledInput",e)}const tn=j({},$n,he("MuiPickersFilledInput",["root","underline","input"])),Ew=["label","autoFocus","disableUnderline","ownerState"],$w=Y(qo,{name:"MuiPickersFilledInput",slot:"Root",overridesResolver:(e,t)=>t.root,shouldForwardProp:e=>He.shouldForwardProp(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)",s=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}},[`&.${tn.focused}`]:{backgroundColor:e.vars?e.vars.palette.FilledInput.bg:r},[`&.${tn.disabled}`]:{backgroundColor:e.vars?e.vars.palette.FilledInput.disabledBg:s},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"},[`&.${tn.focused}:after`]:{transform:"scaleX(1) translateX(0)"},[`&.${tn.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(.${tn.disabled}, .${tn.error}):before`]:{borderBottom:`1px solid ${(e.vars||e).palette.text.primary}`},[`&.${tn.disabled}:before`]:{borderBottomStyle:"dotted"}}},{props:({startAdornment:i})=>!!i,style:{paddingLeft:12}},{props:({endAdornment:i})=>!!i,style:{paddingRight:12}}]}}),Ow=Y(Ii,{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}}]}),Aw=e=>{const{classes:t,disableUnderline:n}=e,o=me({root:["root",!n&&"underline"],input:["input"]},Iw,t);return j({},t,o)},qu=v.forwardRef(function(t,n){const r=Fe({props:t,name:"MuiPickersFilledInput"}),{label:o,disableUnderline:s=!1,ownerState:i}=r,a=ve(r,Ew),l=ft(),c=j({},r,i,l,{color:l?.color||"primary"}),u=Aw(c);return f.jsx(Ei,j({slots:{root:$w,input:Ow},slotProps:{root:{disableUnderline:s}}},a,{label:o,classes:u,ref:n}))});qu.muiName="Input";function Fw(e){return ge("MuiPickersFilledInput",e)}const nr=j({},$n,he("MuiPickersInput",["root","input"])),Lw=["label","autoFocus","disableUnderline","ownerState"],Nw=Y(qo,{name:"MuiPickersInput",slot:"Root",overridesResolver:(e,t)=>t.root})(({theme:e})=>{let n=e.palette.mode==="light"?"rgba(0, 0, 0, 0.42)":"rgba(255, 255, 255, 0.7)";return e.vars&&(n=`rgba(${e.vars.palette.common.onBackgroundChannel} / ${e.vars.opacity.inputUnderline})`),{"label + &":{marginTop:16},variants:[...Object.keys((e.vars??e).palette).filter(r=>(e.vars??e).palette[r].main).map(r=>({props:{color:r},style:{"&::after":{borderBottom:`2px solid ${(e.vars||e).palette[r].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"},[`&.${nr.focused}:after`]:{transform:"scaleX(1) translateX(0)"},[`&.${nr.error}`]:{"&:before, &:after":{borderBottomColor:(e.vars||e).palette.error.main}},"&::before":{borderBottom:`1px solid ${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(.${nr.disabled}, .${nr.error}):before`]:{borderBottom:`2px solid ${(e.vars||e).palette.text.primary}`,"@media (hover: none)":{borderBottom:`1px solid ${n}`}},[`&.${nr.disabled}:before`]:{borderBottomStyle:"dotted"}}}]}}),jw=e=>{const{classes:t,disableUnderline:n}=e,o=me({root:["root",!n&&"underline"],input:["input"]},Fw,t);return j({},t,o)},Ku=v.forwardRef(function(t,n){const r=Fe({props:t,name:"MuiPickersInput"}),{label:o,disableUnderline:s=!1,ownerState:i}=r,a=ve(r,Lw),l=ft(),c=j({},r,i,l,{disableUnderline:s,color:l?.color||"primary"}),u=jw(c);return f.jsx(Ei,j({slots:{root:Nw}},a,{label:o,classes:u,ref:n}))});Ku.muiName="Input";const Bw=["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"],Vw={standard:Ku,filled:qu,outlined:Gu},zw=Y(Mi,{name:"MuiPickersTextField",slot:"Root",overridesResolver:(e,t)=>t.root})({maxWidth:"100%"}),_w=e=>{const{focused:t,disabled:n,classes:r,required:o}=e;return me({root:["root",t&&!n&&"focused",n&&"disabled",o&&"required"]},aw,r)},Ww=v.forwardRef(function(t,n){const r=Fe({props:t,name:"MuiPickersTextField"}),{onFocus:o,onBlur:s,className:i,color:a="primary",disabled:l=!1,error:c=!1,variant:u="outlined",required:p=!1,InputProps:m,inputProps:b,inputRef:d,sectionListRef:h,elements:g,areAllSectionsEmpty:w,onClick:C,onKeyDown:S,onKeyUp:x,onPaste:P,onInput:k,endAdornment:I,startAdornment:R,tabIndex:N,contentEditable:F,focused:E,value:y,onChange:$,fullWidth:D,id:M,name:T,helperText:O,FormHelperTextProps:A,label:L,InputLabelProps:V}=r,X=ve(r,Bw),re=v.useRef(null),ae=ke(n,re),ie=xt(M),z=O&&ie?`${ie}-helper-text`:void 0,Z=L&&ie?`${ie}-label`:void 0,Q=j({},r,{color:a,disabled:l,error:c,focused:E,required:p,variant:u}),G=_w(Q),H=Vw[u];return f.jsxs(zw,j({className:de(G.root,i),ref:ae,focused:E,onFocus:o,onBlur:s,disabled:l,variant:u,error:c,color:a,fullWidth:D,required:p,ownerState:Q},X,{children:[f.jsx(ki,j({htmlFor:ie,id:Z},V,{children:L})),f.jsx(H,j({elements:g,areAllSectionsEmpty:w,onClick:C,onKeyDown:S,onKeyUp:x,onInput:k,onPaste:P,endAdornment:I,startAdornment:R,tabIndex:N,contentEditable:F,value:y,onChange:$,id:ie,fullWidth:D,inputProps:b,inputRef:d,sectionListRef:h,label:L,name:T,role:"group","aria-labelledby":Z,"aria-describedby":z,"aria-live":z?"polite":void 0},m)),O&&f.jsx(Ou,j({id:z},A,{children:O}))]}))}),Hw=["enableAccessibleFieldDOMStructure"],Uw=["InputProps","readOnly"],Yw=["onPaste","onKeyDown","inputMode","readOnly","InputProps","inputProps","inputRef"],Gw=e=>{let{enableAccessibleFieldDOMStructure:t}=e,n=ve(e,Hw);if(t){const{InputProps:p,readOnly:m}=n,b=ve(n,Uw);return j({},b,{InputProps:j({},p??{},{readOnly:m})})}const{onPaste:r,onKeyDown:o,inputMode:s,readOnly:i,InputProps:a,inputProps:l,inputRef:c}=n,u=ve(n,Yw);return j({},u,{InputProps:j({},a??{},{readOnly:i}),inputProps:j({},l??{},{inputMode:s,onPaste:r,onKeyDown:o,ref:c})})},qw=["slots","slotProps","InputProps","inputProps"],Xu=v.forwardRef(function(t,n){const r=Fe({props:t,name:"MuiDateField"}),{slots:o,slotProps:s,InputProps:i,inputProps:a}=r,l=ve(r,qw),c=r,u=o?.textField??(t.enableAccessibleFieldDOMStructure?Ww:_u),p=Pe({elementType:u,externalSlotProps:s?.textField,externalForwardedProps:l,additionalProps:{ref:n},ownerState:c});p.inputProps=j({},a,p.inputProps),p.InputProps=j({},i,p.InputProps);const m=iw(p),b=Gw(m),d=nw(j({},b,{slots:o,slotProps:s}));return f.jsx(u,j({},d))}),Qu=({shouldDisableDate:e,shouldDisableMonth:t,shouldDisableYear:n,minDate:r,maxDate:o,disableFuture:s,disablePast:i,timezone:a})=>{const l=gn();return v.useCallback(c=>Fr({adapter:l,value:c,timezone:a,props:{shouldDisableDate:e,shouldDisableMonth:t,shouldDisableYear:n,minDate:r,maxDate:o,disableFuture:s,disablePast:i}})!==null,[l,e,t,n,r,o,s,i,a])},Kw=(e,t,n)=>(r,o)=>{switch(o.type){case"changeMonth":return j({},r,{slideDirection:o.direction,currentMonth:o.newMonth,isMonthSwitchingAnimating:!e});case"changeMonthTimezone":{const s=o.newTimezone;if(n.getTimezone(r.currentMonth)===s)return r;let i=n.setTimezone(r.currentMonth,s);return n.getMonth(i)!==n.getMonth(r.currentMonth)&&(i=n.setMonth(i,n.getMonth(r.currentMonth))),j({},r,{currentMonth:i})}case"finishMonthSwitchingAnimation":return j({},r,{isMonthSwitchingAnimating:!1});case"changeFocusedDay":{if(r.focusedDay!=null&&o.focusedDay!=null&&n.isSameDay(o.focusedDay,r.focusedDay))return r;const s=o.focusedDay!=null&&!t&&!n.isSameMonth(r.currentMonth,o.focusedDay);return j({},r,{focusedDay:o.focusedDay,isMonthSwitchingAnimating:s&&!e&&!o.withoutMonthSwitchingAnimation,currentMonth:s?n.startOfMonth(o.focusedDay):r.currentMonth,slideDirection:o.focusedDay!=null&&n.isAfterDay(o.focusedDay,r.currentMonth)?"left":"right"})}default:throw new Error("missing support")}},Xw=e=>{const{value:t,referenceDate:n,disableFuture:r,disablePast:o,disableSwitchToMonthOnDayFocus:s=!1,maxDate:i,minDate:a,onMonthChange:l,reduceAnimations:c,shouldDisableDate:u,timezone:p}=e,m=Le(),b=v.useRef(Kw(!!c,s,m)).current,d=v.useMemo(()=>Dt.getInitialReferenceValue({value:t,utils:m,timezone:p,props:e,referenceDate:n,granularity:Pt.day}),[n,p]),[h,g]=v.useReducer(b,{isMonthSwitchingAnimating:!1,focusedDay:d,currentMonth:m.startOfMonth(d),slideDirection:"left"});v.useEffect(()=>{g({type:"changeMonthTimezone",newTimezone:m.getTimezone(d)})},[d,m]);const w=v.useCallback(k=>{g(j({type:"changeMonth"},k)),l&&l(k.newMonth)},[l]),C=v.useCallback(k=>{const I=k;m.isSameMonth(I,h.currentMonth)||w({newMonth:m.startOfMonth(I),direction:m.isAfterDay(I,h.currentMonth)?"left":"right"})},[h.currentMonth,w,m]),S=Qu({shouldDisableDate:u,minDate:a,maxDate:i,disableFuture:r,disablePast:o,timezone:p}),x=v.useCallback(()=>{g({type:"finishMonthSwitchingAnimation"})},[]),P=ue((k,I)=>{S(k)||g({type:"changeFocusedDay",focusedDay:k,withoutMonthSwitchingAnimation:I})});return{referenceDate:d,calendarState:h,changeMonth:C,changeFocusedDay:P,isDateDisabled:S,onMonthSwitchingAnimationEnd:x,handleChangeMonth:w}},Qw=e=>ge("MuiPickersFadeTransitionGroup",e);he("MuiPickersFadeTransitionGroup",["root"]);const Zw=e=>{const{classes:t}=e;return me({root:["root"]},Qw,t)},Jw=Y(Lr,{name:"MuiPickersFadeTransitionGroup",slot:"Root",overridesResolver:(e,t)=>t.root})({display:"block",position:"relative"});function Zu(e){const t=Fe({props:e,name:"MuiPickersFadeTransitionGroup"}),{children:n,className:r,reduceAnimations:o,transKey:s}=t,i=Zw(t),a=mn();return o?n:f.jsx(Jw,{className:de(i.root,r),children:f.jsx(pn,{appear:!1,mountOnEnter:!0,unmountOnExit:!0,timeout:{appear:a.transitions.duration.enteringScreen,enter:a.transitions.duration.enteringScreen,exit:0},children:n},s)})}function eC(e){return ge("MuiPickersDay",e)}const nn=he("MuiPickersDay",["root","dayWithMargin","dayOutsideMonth","hiddenDaySpacingFiller","today","selected","disabled"]),tC=["autoFocus","className","day","disabled","disableHighlightToday","disableMargin","hidden","isAnimating","onClick","onDaySelect","onFocus","onBlur","onKeyDown","onMouseDown","onMouseEnter","outsideCurrentMonth","selected","showDaysOutsideCurrentMonth","children","today","isFirstVisibleCell","isLastVisibleCell"],nC=e=>{const{selected:t,disableMargin:n,disableHighlightToday:r,today:o,disabled:s,outsideCurrentMonth:i,showDaysOutsideCurrentMonth:a,classes:l}=e,c=i&&!a;return me({root:["root",t&&!c&&"selected",s&&"disabled",!n&&"dayWithMargin",!r&&o&&"today",i&&a&&"dayOutsideMonth",c&&"hiddenDaySpacingFiller"],hiddenDaySpacingFiller:["hiddenDaySpacingFiller"]},eC,l)},Ju=({theme:e})=>j({},e.typography.caption,{width:kr,height:kr,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})`:He.alpha(e.palette.primary.main,e.palette.action.hoverOpacity)}},"&:focus":{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / ${e.vars.palette.action.focusOpacity})`:He.alpha(e.palette.primary.main,e.palette.action.focusOpacity),[`&.${nn.selected}`]:{willChange:"background-color",backgroundColor:(e.vars||e).palette.primary.dark}},[`&.${nn.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}},[`&.${nn.disabled}:not(.${nn.selected})`]:{color:(e.vars||e).palette.text.disabled},[`&.${nn.disabled}&.${nn.selected}`]:{opacity:.6},variants:[{props:{disableMargin:!1},style:{margin:`0 ${_o}px`}},{props:{outsideCurrentMonth:!0,showDaysOutsideCurrentMonth:!0},style:{color:(e.vars||e).palette.text.secondary}},{props:{disableHighlightToday:!1,today:!0},style:{[`&:not(.${nn.selected})`]:{border:`1px solid ${(e.vars||e).palette.text.secondary}`}}}]}),ed=(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]},rC=Y(jn,{name:"MuiPickersDay",slot:"Root",overridesResolver:ed})(Ju),oC=Y("div",{name:"MuiPickersDay",slot:"Root",overridesResolver:ed})(({theme:e})=>j({},Ju({theme:e}),{opacity:0,pointerEvents:"none"})),rr=()=>{},sC=v.forwardRef(function(t,n){const r=Fe({props:t,name:"MuiPickersDay"}),{autoFocus:o=!1,className:s,day:i,disabled:a=!1,disableHighlightToday:l=!1,disableMargin:c=!1,isAnimating:u,onClick:p,onDaySelect:m,onFocus:b=rr,onBlur:d=rr,onKeyDown:h=rr,onMouseDown:g=rr,onMouseEnter:w=rr,outsideCurrentMonth:C,selected:S=!1,showDaysOutsideCurrentMonth:x=!1,children:P,today:k=!1}=r,I=ve(r,tC),R=j({},r,{autoFocus:o,disabled:a,disableHighlightToday:l,disableMargin:c,selected:S,showDaysOutsideCurrentMonth:x,today:k}),N=nC(R),F=Le(),E=v.useRef(null),y=ke(E,n);Ue(()=>{o&&!a&&!u&&!C&&E.current.focus()},[o,a,u,C]);const $=M=>{g(M),C&&M.preventDefault()},D=M=>{a||m(i),C&&M.currentTarget.focus(),p&&p(M)};return C&&!x?f.jsx(oC,{className:de(N.root,N.hiddenDaySpacingFiller,s),ownerState:R,role:I.role}):f.jsx(rC,j({className:de(N.root,s),ref:y,centerRipple:!0,disabled:a,tabIndex:S?0:-1,onKeyDown:M=>h(M,i),onFocus:M=>b(M,i),onBlur:M=>d(M,i),onMouseEnter:M=>w(M,i),onClick:D,onMouseDown:$},I,{ownerState:R,children:P||F.format(i,"dayOfMonth")}))}),iC=v.memo(sC),aC=e=>ge("MuiPickersSlideTransition",e),ot=he("MuiPickersSlideTransition",["root","slideEnter-left","slideEnter-right","slideEnterActive","slideExit","slideExitActiveLeft-left","slideExitActiveLeft-right"]),lC=["children","className","reduceAnimations","slideDirection","transKey","classes"],cC=e=>{const{classes:t,slideDirection:n}=e,r={root:["root"],exit:["slideExit"],enterActive:["slideEnterActive"],enter:[`slideEnter-${n}`],exitActive:[`slideExitActiveLeft-${n}`]};return me(r,aC,t)},uC=Y(Lr,{name:"MuiPickersSlideTransition",slot:"Root",overridesResolver:(e,t)=>[t.root,{[`.${ot["slideEnter-left"]}`]:t["slideEnter-left"]},{[`.${ot["slideEnter-right"]}`]:t["slideEnter-right"]},{[`.${ot.slideEnterActive}`]:t.slideEnterActive},{[`.${ot.slideExit}`]:t.slideExit},{[`.${ot["slideExitActiveLeft-left"]}`]:t["slideExitActiveLeft-left"]},{[`.${ot["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},[`& .${ot["slideEnter-left"]}`]:{willChange:"transform",transform:"translate(100%)",zIndex:1},[`& .${ot["slideEnter-right"]}`]:{willChange:"transform",transform:"translate(-100%)",zIndex:1},[`& .${ot.slideEnterActive}`]:{transform:"translate(0%)",transition:t},[`& .${ot.slideExit}`]:{transform:"translate(0%)"},[`& .${ot["slideExitActiveLeft-left"]}`]:{willChange:"transform",transform:"translate(-100%)",transition:t,zIndex:0},[`& .${ot["slideExitActiveLeft-right"]}`]:{willChange:"transform",transform:"translate(100%)",transition:t,zIndex:0}}});function dC(e){const t=Fe({props:e,name:"MuiPickersSlideTransition"}),{children:n,className:r,reduceAnimations:o,transKey:s}=t,i=ve(t,lC),a=cC(t),l=mn();if(o)return f.jsx("div",{className:de(a.root,r),children:n});const c={exit:a.exit,enterActive:a.enterActive,enter:a.enter,exitActive:a.exitActive};return f.jsx(uC,{className:de(a.root,r),childFactory:u=>v.cloneElement(u,{classNames:c}),role:"presentation",children:f.jsx(li,j({mountOnEnter:!0,unmountOnExit:!0,timeout:l.transitions.duration.complex,classNames:c},i,{children:n}),s)})}const pC=e=>ge("MuiDayCalendar",e);he("MuiDayCalendar",["root","header","weekDayLabel","loadingContainer","slideTransition","monthContainer","weekContainer","weekNumberLabel","weekNumber"]);const fC=["parentProps","day","focusableDay","selectedDays","isDateDisabled","currentMonthNumber","isViewFocused"],hC=["ownerState"],mC=e=>{const{classes:t}=e;return me({root:["root"],header:["header"],weekDayLabel:["weekDayLabel"],loadingContainer:["loadingContainer"],slideTransition:["slideTransition"],monthContainer:["monthContainer"],weekContainer:["weekContainer"],weekNumberLabel:["weekNumberLabel"],weekNumber:["weekNumber"]},pC,t)},td=(kr+_o*2)*6,gC=Y("div",{name:"MuiDayCalendar",slot:"Root",overridesResolver:(e,t)=>t.root})({}),yC=Y("div",{name:"MuiDayCalendar",slot:"Header",overridesResolver:(e,t)=>t.header})({display:"flex",justifyContent:"center",alignItems:"center"}),bC=Y(Xt,{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})),vC=Y(Xt,{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})),xC=Y(Xt,{name:"MuiDayCalendar",slot:"WeekNumber",overridesResolver:(e,t)=>t.weekNumber})(({theme:e})=>j({},e.typography.caption,{width:kr,height:kr,padding:0,margin:`0 ${_o}px`,color:e.palette.text.disabled,fontSize:"0.75rem",alignItems:"center",justifyContent:"center",display:"inline-flex"})),SC=Y("div",{name:"MuiDayCalendar",slot:"LoadingContainer",overridesResolver:(e,t)=>t.loadingContainer})({display:"flex",justifyContent:"center",alignItems:"center",minHeight:td}),wC=Y(dC,{name:"MuiDayCalendar",slot:"SlideTransition",overridesResolver:(e,t)=>t.slideTransition})({minHeight:td}),CC=Y("div",{name:"MuiDayCalendar",slot:"MonthContainer",overridesResolver:(e,t)=>t.monthContainer})({overflow:"hidden"}),PC=Y("div",{name:"MuiDayCalendar",slot:"WeekContainer",overridesResolver:(e,t)=>t.weekContainer})({margin:`${_o}px 0`,display:"flex",justifyContent:"center"});function kC(e){let{parentProps:t,day:n,focusableDay:r,selectedDays:o,isDateDisabled:s,currentMonthNumber:i,isViewFocused:a}=e,l=ve(e,fC);const{disabled:c,disableHighlightToday:u,isMonthSwitchingAnimating:p,showDaysOutsideCurrentMonth:m,slots:b,slotProps:d,timezone:h}=t,g=Le(),w=Bo(h),C=r!==null&&g.isSameDay(n,r),S=o.some(y=>g.isSameDay(y,n)),x=g.isSameDay(n,w),P=b?.day??iC,k=Pe({elementType:P,externalSlotProps:d?.day,additionalProps:j({disableHighlightToday:u,showDaysOutsideCurrentMonth:m,role:"gridcell",isAnimating:p,"data-timestamp":g.toJsDate(n).valueOf()},l),ownerState:j({},t,{day:n,selected:S})}),I=ve(k,hC),R=v.useMemo(()=>c||s(n),[c,s,n]),N=v.useMemo(()=>g.getMonth(n)!==i,[g,n,i]),F=v.useMemo(()=>{const y=g.startOfMonth(g.setMonth(n,i));return m?g.isSameDay(n,g.startOfWeek(y)):g.isSameDay(n,y)},[i,n,m,g]),E=v.useMemo(()=>{const y=g.endOfMonth(g.setMonth(n,i));return m?g.isSameDay(n,g.endOfWeek(y)):g.isSameDay(n,y)},[i,n,m,g]);return f.jsx(P,j({},I,{day:n,disabled:R,autoFocus:a&&C,today:x,outsideCurrentMonth:N,isFirstVisibleCell:F,isLastVisibleCell:E,selected:S,tabIndex:C?0:-1,"aria-selected":S,"aria-current":x?"date":void 0}))}function MC(e){const t=Fe({props:e,name:"MuiDayCalendar"}),n=Le(),{onFocusedDayChange:r,className:o,currentMonth:s,selectedDays:i,focusedDay:a,loading:l,onSelectedDaysChange:c,onMonthSwitchingAnimationEnd:u,readOnly:p,reduceAnimations:m,renderLoading:b=()=>f.jsx("span",{children:"..."}),slideDirection:d,TransitionProps:h,disablePast:g,disableFuture:w,minDate:C,maxDate:S,shouldDisableDate:x,shouldDisableMonth:P,shouldDisableYear:k,dayOfWeekFormatter:I=ne=>n.format(ne,"weekdayShort").charAt(0).toUpperCase(),hasFocus:R,onFocusedViewChange:N,gridLabelId:F,displayWeekNumber:E,fixedWeekNumber:y,autoFocus:$,timezone:D}=t,M=Bo(D),T=mC(t),O=vt(),A=Qu({shouldDisableDate:x,shouldDisableMonth:P,shouldDisableYear:k,minDate:C,maxDate:S,disablePast:g,disableFuture:w,timezone:D}),L=jt(),[V,X]=Tt({name:"DayCalendar",state:"hasFocus",controlled:R,default:$??!1}),[re,ae]=v.useState(()=>a||M),ie=ue(ne=>{p||c(ne)}),z=ne=>{A(ne)||(r(ne),ae(ne),N?.(!0),X(!0))},Z=ue((ne,ce)=>{switch(ne.key){case"ArrowUp":z(n.addDays(ce,-7)),ne.preventDefault();break;case"ArrowDown":z(n.addDays(ce,7)),ne.preventDefault();break;case"ArrowLeft":{const se=n.addDays(ce,O?1:-1),fe=n.addMonths(ce,O?1:-1),be=pr({utils:n,date:se,minDate:O?se:n.startOfMonth(fe),maxDate:O?n.endOfMonth(fe):se,isDateDisabled:A,timezone:D});z(be||se),ne.preventDefault();break}case"ArrowRight":{const se=n.addDays(ce,O?-1:1),fe=n.addMonths(ce,O?-1:1),be=pr({utils:n,date:se,minDate:O?n.startOfMonth(fe):se,maxDate:O?se:n.endOfMonth(fe),isDateDisabled:A,timezone:D});z(be||se),ne.preventDefault();break}case"Home":z(n.startOfWeek(ce)),ne.preventDefault();break;case"End":z(n.endOfWeek(ce)),ne.preventDefault();break;case"PageUp":z(n.addMonths(ce,1)),ne.preventDefault();break;case"PageDown":z(n.addMonths(ce,-1)),ne.preventDefault();break}}),Q=ue((ne,ce)=>z(ce)),G=ue((ne,ce)=>{V&&n.isSameDay(re,ce)&&N?.(!1)}),H=n.getMonth(s),q=n.getYear(s),te=v.useMemo(()=>i.filter(ne=>!!ne).map(ne=>n.startOfDay(ne)),[n,i]),J=`${q}-${H}`,B=v.useMemo(()=>v.createRef(),[J]),K=v.useMemo(()=>{const ne=n.startOfMonth(s),ce=n.endOfMonth(s);return A(re)||n.isAfterDay(re,ce)||n.isBeforeDay(re,ne)?pr({utils:n,date:re,minDate:ne,maxDate:ce,disablePast:g,disableFuture:w,isDateDisabled:A,timezone:D}):re},[s,w,g,re,A,n,D]),oe=v.useMemo(()=>{const ne=n.getWeekArray(s);let ce=n.addMonths(s,1);for(;y&&ne.length<y;){const se=n.getWeekArray(ce),fe=n.isSameDay(ne[ne.length-1][0],se[0][0]);se.slice(fe?1:0).forEach(be=>{ne.length<y&&ne.push(be)}),ce=n.addMonths(ce,1)}return ne},[s,y,n]);return f.jsxs(gC,{role:"grid","aria-labelledby":F,className:T.root,children:[f.jsxs(yC,{role:"row",className:T.header,children:[E&&f.jsx(vC,{variant:"caption",role:"columnheader","aria-label":L.calendarWeekNumberHeaderLabel,className:T.weekNumberLabel,children:L.calendarWeekNumberHeaderText}),Bg(n,M).map((ne,ce)=>f.jsx(bC,{variant:"caption",role:"columnheader","aria-label":n.format(ne,"weekday"),className:T.weekDayLabel,children:I(ne)},ce.toString()))]}),l?f.jsx(SC,{className:T.loadingContainer,children:b()}):f.jsx(wC,j({transKey:J,onExited:u,reduceAnimations:m,slideDirection:d,className:de(o,T.slideTransition)},h,{nodeRef:B,children:f.jsx(CC,{ref:B,role:"rowgroup",className:T.monthContainer,children:oe.map((ne,ce)=>f.jsxs(PC,{role:"row",className:T.weekContainer,"aria-rowindex":ce+1,children:[E&&f.jsx(xC,{className:T.weekNumber,role:"rowheader","aria-label":L.calendarWeekNumberAriaLabelText(n.getWeekNumber(ne[0])),children:L.calendarWeekNumberText(n.getWeekNumber(ne[0]))}),ne.map((se,fe)=>f.jsx(kC,{parentProps:t,day:se,selectedDays:te,focusableDay:K,onKeyDown:Z,onFocus:Q,onBlur:G,onDaySelect:ie,isDateDisabled:A,currentMonthNumber:H,isViewFocused:V,"aria-colindex":fe+1},se.toString()))]},`week-${ne[0]}`))})}))]})}function TC(e){return ge("MuiPickersMonth",e)}const qr=he("MuiPickersMonth",["root","monthButton","disabled","selected"]),DC=["autoFocus","className","children","disabled","selected","value","tabIndex","onClick","onKeyDown","onFocus","onBlur","aria-current","aria-label","monthsPerRow","slots","slotProps"],RC=e=>{const{disabled:t,selected:n,classes:r}=e;return me({root:["root"],monthButton:["monthButton",t&&"disabled",n&&"selected"]},TC,r)},IC=Y("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%"}}]}),EC=Y("button",{name:"MuiPickersMonth",slot:"MonthButton",overridesResolver:(e,t)=>[t.monthButton,{[`&.${qr.disabled}`]:t.disabled},{[`&.${qr.selected}`]:t.selected}]})(({theme:e})=>j({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})`:He.alpha(e.palette.action.active,e.palette.action.hoverOpacity)},"&:hover":{backgroundColor:e.vars?`rgba(${e.vars.palette.action.activeChannel} / ${e.vars.palette.action.hoverOpacity})`:He.alpha(e.palette.action.active,e.palette.action.hoverOpacity)},"&:disabled":{cursor:"auto",pointerEvents:"none"},[`&.${qr.disabled}`]:{color:(e.vars||e).palette.text.secondary},[`&.${qr.selected}`]:{color:(e.vars||e).palette.primary.contrastText,backgroundColor:(e.vars||e).palette.primary.main,"&:focus, &:hover":{backgroundColor:(e.vars||e).palette.primary.dark}}})),$C=v.memo(function(t){const n=Fe({props:t,name:"MuiPickersMonth"}),{autoFocus:r,className:o,children:s,disabled:i,selected:a,value:l,tabIndex:c,onClick:u,onKeyDown:p,onFocus:m,onBlur:b,"aria-current":d,"aria-label":h,slots:g,slotProps:w}=n,C=ve(n,DC),S=v.useRef(null),x=RC(n);Ue(()=>{r&&S.current?.focus()},[r]);const P=g?.monthButton??EC,k=Pe({elementType:P,externalSlotProps:w?.monthButton,additionalProps:{children:s,disabled:i,tabIndex:c,ref:S,type:"button",role:"radio","aria-current":d,"aria-checked":a,"aria-label":h,onClick:I=>u(I,l),onKeyDown:I=>p(I,l),onFocus:I=>m(I,l),onBlur:I=>b(I,l)},ownerState:n,className:x.monthButton});return f.jsx(IC,j({className:de(x.root,o),ownerState:n},C,{children:f.jsx(P,j({},k))}))});function OC(e){return ge("MuiMonthCalendar",e)}he("MuiMonthCalendar",["root"]);const AC=["className","value","defaultValue","referenceDate","disabled","disableFuture","disablePast","maxDate","minDate","onChange","shouldDisableMonth","readOnly","disableHighlightToday","autoFocus","onMonthFocus","hasFocus","onFocusedViewChange","monthsPerRow","timezone","gridLabelId","slots","slotProps"],FC=e=>{const{classes:t}=e;return me({root:["root"]},OC,t)};function LC(e,t){const n=Le(),r=Ar(),o=Fe({props:e,name:t});return j({disableFuture:!1,disablePast:!1},o,{minDate:lt(n,o.minDate,r.minDate),maxDate:lt(n,o.maxDate,r.maxDate)})}const NC=Y("div",{name:"MuiMonthCalendar",slot:"Root",overridesResolver:(e,t)=>t.root})({display:"flex",flexWrap:"wrap",alignContent:"stretch",padding:"0 4px",width:Wo,boxSizing:"border-box"}),jC=v.forwardRef(function(t,n){const r=LC(t,"MuiMonthCalendar"),{className:o,value:s,defaultValue:i,referenceDate:a,disabled:l,disableFuture:c,disablePast:u,maxDate:p,minDate:m,onChange:b,shouldDisableMonth:d,readOnly:h,autoFocus:g=!1,onMonthFocus:w,hasFocus:C,onFocusedViewChange:S,monthsPerRow:x=3,timezone:P,gridLabelId:k,slots:I,slotProps:R}=r,N=ve(r,AC),{value:F,handleValueChange:E,timezone:y}=vi({name:"MonthCalendar",timezone:P,value:s,defaultValue:i,referenceDate:a,onChange:b,valueManager:Dt}),$=Bo(y),D=vt(),M=Le(),T=v.useMemo(()=>Dt.getInitialReferenceValue({value:F,utils:M,props:r,timezone:y,referenceDate:a,granularity:Pt.month}),[]),O=r,A=FC(O),L=v.useMemo(()=>M.getMonth($),[M,$]),V=v.useMemo(()=>F!=null?M.getMonth(F):null,[F,M]),[X,re]=v.useState(()=>V||M.getMonth(T)),[ae,ie]=Tt({name:"MonthCalendar",state:"hasFocus",controlled:C,default:g??!1}),z=ue(J=>{ie(J),S&&S(J)}),Z=v.useCallback(J=>{const B=M.startOfMonth(u&&M.isAfter($,m)?$:m),K=M.startOfMonth(c&&M.isBefore($,p)?$:p),oe=M.startOfMonth(J);return M.isBefore(oe,B)||M.isAfter(oe,K)?!0:d?d(oe):!1},[c,u,p,m,$,d,M]),Q=ue((J,B)=>{if(h)return;const K=M.setMonth(F??T,B);E(K)}),G=ue(J=>{Z(M.setMonth(F??T,J))||(re(J),z(!0),w&&w(J))});v.useEffect(()=>{re(J=>V!==null&&J!==V?V:J)},[V]);const H=ue((J,B)=>{switch(J.key){case"ArrowUp":G((12+B-3)%12),J.preventDefault();break;case"ArrowDown":G((12+B+3)%12),J.preventDefault();break;case"ArrowLeft":G((12+B+(D?1:-1))%12),J.preventDefault();break;case"ArrowRight":G((12+B+(D?-1:1))%12),J.preventDefault();break}}),q=ue((J,B)=>{G(B)}),te=ue((J,B)=>{X===B&&z(!1)});return f.jsx(NC,j({ref:n,className:de(A.root,o),ownerState:O,role:"radiogroup","aria-labelledby":k},N,{children:ri(M,F??T).map(J=>{const B=M.getMonth(J),K=M.format(J,"monthShort"),oe=M.format(J,"month"),ne=B===V,ce=l||Z(J);return f.jsx($C,{selected:ne,value:B,onClick:Q,onKeyDown:H,autoFocus:ae&&B===X,disabled:ce,tabIndex:B===X&&!ce?0:-1,onFocus:q,onBlur:te,"aria-current":L===B?"date":void 0,"aria-label":oe,monthsPerRow:x,slots:I,slotProps:R,children:K},K)})}))});function BC(e){return ge("MuiPickersYear",e)}const Kr=he("MuiPickersYear",["root","yearButton","selected","disabled"]),VC=["autoFocus","className","children","disabled","selected","value","tabIndex","onClick","onKeyDown","onFocus","onBlur","aria-current","yearsPerRow","slots","slotProps"],zC=e=>{const{disabled:t,selected:n,classes:r}=e;return me({root:["root"],yearButton:["yearButton",t&&"disabled",n&&"selected"]},BC,r)},_C=Y("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%"}}]}),WC=Y("button",{name:"MuiPickersYear",slot:"YearButton",overridesResolver:(e,t)=>[t.yearButton,{[`&.${Kr.disabled}`]:t.disabled},{[`&.${Kr.selected}`]:t.selected}]})(({theme:e})=>j({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})`:He.alpha(e.palette.action.active,e.palette.action.focusOpacity)},"&:hover":{backgroundColor:e.vars?`rgba(${e.vars.palette.action.activeChannel} / ${e.vars.palette.action.hoverOpacity})`:He.alpha(e.palette.action.active,e.palette.action.hoverOpacity)},"&:disabled":{cursor:"auto",pointerEvents:"none"},[`&.${Kr.disabled}`]:{color:(e.vars||e).palette.text.secondary},[`&.${Kr.selected}`]:{color:(e.vars||e).palette.primary.contrastText,backgroundColor:(e.vars||e).palette.primary.main,"&:focus, &:hover":{backgroundColor:(e.vars||e).palette.primary.dark}}})),HC=v.memo(function(t){const n=Fe({props:t,name:"MuiPickersYear"}),{autoFocus:r,className:o,children:s,disabled:i,selected:a,value:l,tabIndex:c,onClick:u,onKeyDown:p,onFocus:m,onBlur:b,"aria-current":d,slots:h,slotProps:g}=n,w=ve(n,VC),C=v.useRef(null),S=zC(n);Ue(()=>{r&&C.current?.focus()},[r]);const x=h?.yearButton??WC,P=Pe({elementType:x,externalSlotProps:g?.yearButton,additionalProps:{children:s,disabled:i,tabIndex:c,ref:C,type:"button",role:"radio","aria-current":d,"aria-checked":a,onClick:k=>u(k,l),onKeyDown:k=>p(k,l),onFocus:k=>m(k,l),onBlur:k=>b(k,l)},ownerState:n,className:S.yearButton});return f.jsx(_C,j({className:de(S.root,o),ownerState:n},w,{children:f.jsx(x,j({},P))}))});function UC(e){return ge("MuiYearCalendar",e)}he("MuiYearCalendar",["root"]);const YC=["autoFocus","className","value","defaultValue","referenceDate","disabled","disableFuture","disablePast","maxDate","minDate","onChange","readOnly","shouldDisableYear","disableHighlightToday","onYearFocus","hasFocus","onFocusedViewChange","yearsOrder","yearsPerRow","timezone","gridLabelId","slots","slotProps"],GC=e=>{const{classes:t}=e;return me({root:["root"]},UC,t)};function qC(e,t){const n=Le(),r=Ar(),o=Fe({props:e,name:t});return j({disablePast:!1,disableFuture:!1},o,{yearsPerRow:o.yearsPerRow??3,minDate:lt(n,o.minDate,r.minDate),maxDate:lt(n,o.maxDate,r.maxDate)})}const KC=Y("div",{name:"MuiYearCalendar",slot:"Root",overridesResolver:(e,t)=>t.root})({display:"flex",flexDirection:"row",flexWrap:"wrap",overflowY:"auto",height:"100%",padding:"0 4px",width:Wo,maxHeight:Yx,boxSizing:"border-box",position:"relative"}),XC=v.forwardRef(function(t,n){const r=qC(t,"MuiYearCalendar"),{autoFocus:o,className:s,value:i,defaultValue:a,referenceDate:l,disabled:c,disableFuture:u,disablePast:p,maxDate:m,minDate:b,onChange:d,readOnly:h,shouldDisableYear:g,onYearFocus:w,hasFocus:C,onFocusedViewChange:S,yearsOrder:x="asc",yearsPerRow:P,timezone:k,gridLabelId:I,slots:R,slotProps:N}=r,F=ve(r,YC),{value:E,handleValueChange:y,timezone:$}=vi({name:"YearCalendar",timezone:k,value:i,defaultValue:a,referenceDate:l,onChange:d,valueManager:Dt}),D=Bo($),M=vt(),T=Le(),O=v.useMemo(()=>Dt.getInitialReferenceValue({value:E,utils:T,props:r,timezone:$,referenceDate:l,granularity:Pt.year}),[]),A=r,L=GC(A),V=v.useMemo(()=>T.getYear(D),[T,D]),X=v.useMemo(()=>E!=null?T.getYear(E):null,[E,T]),[re,ae]=v.useState(()=>X||T.getYear(O)),[ie,z]=Tt({name:"YearCalendar",state:"hasFocus",controlled:C,default:o??!1}),Z=ue(se=>{z(se),S&&S(se)}),Q=v.useCallback(se=>{if(p&&T.isBeforeYear(se,D)||u&&T.isAfterYear(se,D)||b&&T.isBeforeYear(se,b)||m&&T.isAfterYear(se,m))return!0;if(!g)return!1;const fe=T.startOfYear(se);return g(fe)},[u,p,m,b,D,g,T]),G=ue((se,fe)=>{if(h)return;const be=T.setYear(E??O,fe);y(be)}),H=ue(se=>{Q(T.setYear(E??O,se))||(ae(se),Z(!0),w?.(se))});v.useEffect(()=>{ae(se=>X!==null&&se!==X?X:se)},[X]);const q=x!=="desc"?P*1:P*-1,te=M&&x==="asc"||!M&&x==="desc"?-1:1,J=ue((se,fe)=>{switch(se.key){case"ArrowUp":H(fe-q),se.preventDefault();break;case"ArrowDown":H(fe+q),se.preventDefault();break;case"ArrowLeft":H(fe-te),se.preventDefault();break;case"ArrowRight":H(fe+te),se.preventDefault();break}}),B=ue((se,fe)=>{H(fe)}),K=ue((se,fe)=>{re===fe&&Z(!1)}),oe=v.useRef(null),ne=ke(n,oe);v.useEffect(()=>{if(o||oe.current===null)return;const se=oe.current.querySelector('[tabindex="0"]');if(!se)return;const fe=se.offsetHeight,be=se.offsetTop,we=oe.current.clientHeight,pe=oe.current.scrollTop,qe=be+fe;fe>we||be<pe||(oe.current.scrollTop=qe-we/2-fe/2)},[o]);const ce=T.getYearRange([b,m]);return x==="desc"&&ce.reverse(),f.jsx(KC,j({ref:ne,className:de(L.root,s),ownerState:A,role:"radiogroup","aria-labelledby":I},F,{children:ce.map(se=>{const fe=T.getYear(se),be=fe===X,we=c||Q(se);return f.jsx(HC,{selected:be,value:fe,onClick:G,onKeyDown:J,autoFocus:ie&&fe===re,disabled:we,tabIndex:fe===re&&!we?0:-1,onFocus:B,onBlur:K,"aria-current":V===fe?"date":void 0,yearsPerRow:P,slots:R,slotProps:N,children:T.format(se,"year")},T.format(se,"year"))})}))}),QC=e=>ge("MuiPickersCalendarHeader",e),ZC=he("MuiPickersCalendarHeader",["root","labelContainer","label","switchViewButton","switchViewIcon"]);function JC(e){return ge("MuiPickersArrowSwitcher",e)}he("MuiPickersArrowSwitcher",["root","spacer","button","previousIconButton","nextIconButton","leftArrowIcon","rightArrowIcon"]);const e1=["children","className","slots","slotProps","isNextDisabled","isNextHidden","onGoToNext","nextLabel","isPreviousDisabled","isPreviousHidden","onGoToPrevious","previousLabel","labelId"],t1=["ownerState"],n1=["ownerState"],r1=Y("div",{name:"MuiPickersArrowSwitcher",slot:"Root",overridesResolver:(e,t)=>t.root})({display:"flex"}),o1=Y("div",{name:"MuiPickersArrowSwitcher",slot:"Spacer",overridesResolver:(e,t)=>t.spacer})(({theme:e})=>({width:e.spacing(3)})),Dl=Y(Nr,{name:"MuiPickersArrowSwitcher",slot:"Button",overridesResolver:(e,t)=>t.button})({variants:[{props:{hidden:!0},style:{visibility:"hidden"}}]}),s1=e=>{const{classes:t}=e;return me({root:["root"],spacer:["spacer"],button:["button"],previousIconButton:["previousIconButton"],nextIconButton:["nextIconButton"],leftArrowIcon:["leftArrowIcon"],rightArrowIcon:["rightArrowIcon"]},JC,t)},i1=v.forwardRef(function(t,n){const r=vt(),o=Fe({props:t,name:"MuiPickersArrowSwitcher"}),{children:s,className:i,slots:a,slotProps:l,isNextDisabled:c,isNextHidden:u,onGoToNext:p,nextLabel:m,isPreviousDisabled:b,isPreviousHidden:d,onGoToPrevious:h,previousLabel:g,labelId:w}=o,C=ve(o,e1),S=o,x=s1(S),P={isDisabled:c,isHidden:u,goTo:p,label:m},k={isDisabled:b,isHidden:d,goTo:h,label:g},I=a?.previousIconButton??Dl,R=Pe({elementType:I,externalSlotProps:l?.previousIconButton,additionalProps:{size:"medium",title:k.label,"aria-label":k.label,disabled:k.isDisabled,edge:"end",onClick:k.goTo},ownerState:j({},S,{hidden:k.isHidden}),className:de(x.button,x.previousIconButton)}),N=a?.nextIconButton??Dl,F=Pe({elementType:N,externalSlotProps:l?.nextIconButton,additionalProps:{size:"medium",title:P.label,"aria-label":P.label,disabled:P.isDisabled,edge:"start",onClick:P.goTo},ownerState:j({},S,{hidden:P.isHidden}),className:de(x.button,x.nextIconButton)}),E=a?.leftArrowIcon??l0,y=Pe({elementType:E,externalSlotProps:l?.leftArrowIcon,additionalProps:{fontSize:"inherit"},ownerState:S,className:x.leftArrowIcon}),$=ve(y,t1),D=a?.rightArrowIcon??c0,M=Pe({elementType:D,externalSlotProps:l?.rightArrowIcon,additionalProps:{fontSize:"inherit"},ownerState:S,className:x.rightArrowIcon}),T=ve(M,n1);return f.jsxs(r1,j({ref:n,className:de(x.root,i),ownerState:S},C,{children:[f.jsx(I,j({},R,{children:r?f.jsx(D,j({},T)):f.jsx(E,j({},$))})),s?f.jsx(Xt,{variant:"subtitle1",component:"span",id:w,children:s}):f.jsx(o1,{className:x.spacer,ownerState:S}),f.jsx(N,j({},F,{children:r?f.jsx(E,j({},$)):f.jsx(D,j({},T))}))]}))});function a1(e,{disableFuture:t,maxDate:n,timezone:r}){const o=Le();return v.useMemo(()=>{const s=o.date(void 0,r),i=o.startOfMonth(t&&o.isBefore(s,n)?s:n);return!o.isAfter(i,e)},[t,n,e,o,r])}function l1(e,{disablePast:t,minDate:n,timezone:r}){const o=Le();return v.useMemo(()=>{const s=o.date(void 0,r),i=o.startOfMonth(t&&o.isAfter(s,n)?s:n);return!o.isBefore(i,e)},[t,n,e,o,r])}const c1=["slots","slotProps","currentMonth","disabled","disableFuture","disablePast","maxDate","minDate","onMonthChange","onViewChange","view","reduceAnimations","views","labelId","className","timezone","format"],u1=["ownerState"],d1=e=>{const{classes:t}=e;return me({root:["root"],labelContainer:["labelContainer"],label:["label"],switchViewButton:["switchViewButton"],switchViewIcon:["switchViewIcon"]},QC,t)},p1=Y("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}),f1=Y("div",{name:"MuiPickersCalendarHeader",slot:"LabelContainer",overridesResolver:(e,t)=>t.labelContainer})(({theme:e})=>j({display:"flex",overflow:"hidden",alignItems:"center",cursor:"pointer",marginRight:"auto"},e.typography.body1,{fontWeight:e.typography.fontWeightMedium})),h1=Y("div",{name:"MuiPickersCalendarHeader",slot:"Label",overridesResolver:(e,t)=>t.label})({marginRight:6}),m1=Y(Nr,{name:"MuiPickersCalendarHeader",slot:"SwitchViewButton",overridesResolver:(e,t)=>t.switchViewButton})({marginRight:"auto",variants:[{props:{view:"year"},style:{[`.${ZC.switchViewIcon}`]:{transform:"rotate(180deg)"}}}]}),g1=Y(a0,{name:"MuiPickersCalendarHeader",slot:"SwitchViewIcon",overridesResolver:(e,t)=>t.switchViewIcon})(({theme:e})=>({willChange:"transform",transition:e.transitions.create("transform"),transform:"rotate(0deg)"})),y1=v.forwardRef(function(t,n){const r=jt(),o=Le(),s=Fe({props:t,name:"MuiPickersCalendarHeader"}),{slots:i,slotProps:a,currentMonth:l,disabled:c,disableFuture:u,disablePast:p,maxDate:m,minDate:b,onMonthChange:d,onViewChange:h,view:g,reduceAnimations:w,views:C,labelId:S,className:x,timezone:P,format:k=`${o.formats.month} ${o.formats.year}`}=s,I=ve(s,c1),R=s,N=d1(s),F=i?.switchViewButton??m1,E=Pe({elementType:F,externalSlotProps:a?.switchViewButton,additionalProps:{size:"small","aria-label":r.calendarViewSwitchingButtonAriaLabel(g)},ownerState:R,className:N.switchViewButton}),y=i?.switchViewIcon??g1,$=Pe({elementType:y,externalSlotProps:a?.switchViewIcon,ownerState:R,className:N.switchViewIcon}),D=ve($,u1),M=()=>d(o.addMonths(l,1),"left"),T=()=>d(o.addMonths(l,-1),"right"),O=a1(l,{disableFuture:u,maxDate:m,timezone:P}),A=l1(l,{disablePast:p,minDate:b,timezone:P}),L=()=>{if(!(C.length===1||!h||c))if(C.length===2)h(C.find(X=>X!==g)||C[0]);else{const X=C.indexOf(g)!==0?0:1;h(C[X])}};if(C.length===1&&C[0]==="year")return null;const V=o.formatByString(l,k);return f.jsxs(p1,j({},I,{ownerState:R,className:de(N.root,x),ref:n,children:[f.jsxs(f1,{role:"presentation",onClick:L,ownerState:R,"aria-live":"polite",className:N.labelContainer,children:[f.jsx(Zu,{reduceAnimations:w,transKey:V,children:f.jsx(h1,{id:S,ownerState:R,className:N.label,children:V})}),C.length>1&&!c&&f.jsx(F,j({},E,{children:f.jsx(y,j({},D))}))]}),f.jsx(pn,{in:g==="day",appear:!w,enter:!w,children:f.jsx(i1,{slots:i,slotProps:a,onGoToPrevious:T,isPreviousDisabled:A,previousLabel:r.previousMonth,onGoToNext:M,isNextDisabled:O,nextLabel:r.nextMonth})})]}))}),b1=Y("div")({overflow:"hidden",width:Wo,maxHeight:xi,display:"flex",flexDirection:"column",margin:"0 auto"}),v1=e=>ge("MuiDateCalendar",e);he("MuiDateCalendar",["root","viewTransitionContainer"]);const x1=["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"],S1=e=>{const{classes:t}=e;return me({root:["root"],viewTransitionContainer:["viewTransitionContainer"]},v1,t)};function w1(e,t){const n=Le(),r=Ar(),o=Cu(),s=Fe({props:e,name:t});return j({},s,{loading:s.loading??!1,disablePast:s.disablePast??!1,disableFuture:s.disableFuture??!1,openTo:s.openTo??"day",views:s.views??["year","day"],reduceAnimations:s.reduceAnimations??o,renderLoading:s.renderLoading??(()=>f.jsx("span",{children:"..."})),minDate:lt(n,s.minDate,r.minDate),maxDate:lt(n,s.maxDate,r.maxDate)})}const C1=Y(b1,{name:"MuiDateCalendar",slot:"Root",overridesResolver:(e,t)=>t.root})({display:"flex",flexDirection:"column",height:xi}),P1=Y(Zu,{name:"MuiDateCalendar",slot:"ViewTransitionContainer",overridesResolver:(e,t)=>t.viewTransitionContainer})({}),k1=v.forwardRef(function(t,n){const r=Le(),o=xt(),s=w1(t,"MuiDateCalendar"),{autoFocus:i,onViewChange:a,value:l,defaultValue:c,referenceDate:u,disableFuture:p,disablePast:m,onChange:b,onYearChange:d,onMonthChange:h,reduceAnimations:g,shouldDisableDate:w,shouldDisableMonth:C,shouldDisableYear:S,view:x,views:P,openTo:k,className:I,disabled:R,readOnly:N,minDate:F,maxDate:E,disableHighlightToday:y,focusedView:$,onFocusedViewChange:D,showDaysOutsideCurrentMonth:M,fixedWeekNumber:T,dayOfWeekFormatter:O,slots:A,slotProps:L,loading:V,renderLoading:X,displayWeekNumber:re,yearsOrder:ae,yearsPerRow:ie,monthsPerRow:z,timezone:Z}=s,Q=ve(s,x1),{value:G,handleValueChange:H,timezone:q}=vi({name:"DateCalendar",timezone:Z,value:l,defaultValue:c,referenceDate:u,onChange:b,valueManager:Dt}),{view:te,setView:J,focusedView:B,setFocusedView:K,goToNextView:oe,setValueAndGoToNextView:ne}=Pu({view:x,views:P,openTo:k,onChange:H,onViewChange:a,autoFocus:i,focusedView:$,onFocusedViewChange:D}),{referenceDate:ce,calendarState:se,changeFocusedDay:fe,changeMonth:be,handleChangeMonth:we,isDateDisabled:pe,onMonthSwitchingAnimationEnd:qe}=Xw({value:G,referenceDate:u,reduceAnimations:g,onMonthChange:h,minDate:F,maxDate:E,shouldDisableDate:w,disablePast:m,disableFuture:p,timezone:q}),Be=R&&G||F,ht=R&&G||E,mt=`${o}-grid-label`,nt=B!==null,rt=A?.calendarHeader??y1,Bt=Pe({elementType:rt,externalSlotProps:L?.calendarHeader,additionalProps:{views:P,view:te,currentMonth:se.currentMonth,onViewChange:J,onMonthChange:(Ae,wt)=>we({newMonth:Ae,direction:wt}),minDate:Be,maxDate:ht,disabled:R,disablePast:m,disableFuture:p,reduceAnimations:g,timezone:q,labelId:mt},ownerState:s}),gt=ue(Ae=>{const wt=r.startOfMonth(Ae),qn=r.endOfMonth(Ae),Wt=pe(Ae)?pr({utils:r,date:Ae,minDate:r.isBefore(F,wt)?wt:F,maxDate:r.isAfter(E,qn)?qn:E,disablePast:m,disableFuture:p,isDateDisabled:pe,timezone:q}):Ae;Wt?(ne(Wt,"finish"),h?.(wt)):(oe(),be(wt)),fe(Wt,!0)}),Oe=ue(Ae=>{const wt=r.startOfYear(Ae),qn=r.endOfYear(Ae),Wt=pe(Ae)?pr({utils:r,date:Ae,minDate:r.isBefore(F,wt)?wt:F,maxDate:r.isAfter(E,qn)?qn:E,disablePast:m,disableFuture:p,isDateDisabled:pe,timezone:q}):Ae;Wt?(ne(Wt,"finish"),d?.(Wt)):(oe(),be(wt)),fe(Wt,!0)}),Vt=ue(Ae=>H(Ae&&go(r,Ae,G??ce),"finish",te));v.useEffect(()=>{G!=null&&r.isValid(G)&&be(G)},[G]);const zt=s,Gn=S1(zt),ye={disablePast:m,disableFuture:p,maxDate:E,minDate:F},Me={disableHighlightToday:y,readOnly:N,disabled:R,timezone:q,gridLabelId:mt,slots:A,slotProps:L},_e=v.useRef(te);v.useEffect(()=>{_e.current!==te&&(B===_e.current&&K(te,!0),_e.current=te)},[B,K,te]);const _t=v.useMemo(()=>[G],[G]);return f.jsxs(C1,j({ref:n,className:de(Gn.root,I),ownerState:zt},Q,{children:[f.jsx(rt,j({},Bt,{slots:A,slotProps:L})),f.jsx(P1,{reduceAnimations:g,className:Gn.viewTransitionContainer,transKey:te,ownerState:zt,children:f.jsxs("div",{children:[te==="year"&&f.jsx(XC,j({},ye,Me,{value:G,onChange:Oe,shouldDisableYear:S,hasFocus:nt,onFocusedViewChange:Ae=>K("year",Ae),yearsOrder:ae,yearsPerRow:ie,referenceDate:ce})),te==="month"&&f.jsx(jC,j({},ye,Me,{hasFocus:nt,className:I,value:G,onChange:gt,shouldDisableMonth:C,onFocusedViewChange:Ae=>K("month",Ae),monthsPerRow:z,referenceDate:ce})),te==="day"&&f.jsx(MC,j({},se,ye,Me,{onMonthSwitchingAnimationEnd:qe,onFocusedDayChange:fe,reduceAnimations:g,selectedDays:_t,onSelectedDaysChange:Vt,shouldDisableDate:w,shouldDisableMonth:C,shouldDisableYear:S,hasFocus:nt,onFocusedViewChange:Ae=>K("day",Ae),showDaysOutsideCurrentMonth:M,fixedWeekNumber:T,dayOfWeekFormatter:O,displayWeekNumber:re,loading:V,renderLoading:X}))]})})]}))}),On=({view:e,onViewChange:t,views:n,focusedView:r,onFocusedViewChange:o,value:s,defaultValue:i,referenceDate:a,onChange:l,className:c,classes:u,disableFuture:p,disablePast:m,minDate:b,maxDate:d,shouldDisableDate:h,shouldDisableMonth:g,shouldDisableYear:w,reduceAnimations:C,onMonthChange:S,monthsPerRow:x,onYearChange:P,yearsOrder:k,yearsPerRow:I,slots:R,slotProps:N,loading:F,renderLoading:E,disableHighlightToday:y,readOnly:$,disabled:D,showDaysOutsideCurrentMonth:M,dayOfWeekFormatter:T,sx:O,autoFocus:A,fixedWeekNumber:L,displayWeekNumber:V,timezone:X})=>f.jsx(k1,{view:e,onViewChange:t,views:n.filter(Na),focusedView:r&&Na(r)?r:null,onFocusedViewChange:o,value:s,defaultValue:i,referenceDate:a,onChange:l,className:c,classes:u,disableFuture:p,disablePast:m,minDate:b,maxDate:d,shouldDisableDate:h,shouldDisableMonth:g,shouldDisableYear:w,reduceAnimations:C,onMonthChange:S,monthsPerRow:x,onYearChange:P,yearsOrder:k,yearsPerRow:I,slots:R,slotProps:N,loading:F,renderLoading:E,disableHighlightToday:y,readOnly:$,disabled:D,showDaysOutsideCurrentMonth:M,dayOfWeekFormatter:T,sx:O,autoFocus:A,fixedWeekNumber:L,displayWeekNumber:V,timezone:X}),nd=v.forwardRef(function(t,n){const r=jt(),o=Le(),s=ou(t,"MuiDesktopDatePicker"),i=j({day:On,month:On,year:On},s.viewRenderers),a=j({},s,{viewRenderers:i,format:oi(o,s,!1),yearsPerRow:s.yearsPerRow??4,slots:j({openPickerIcon:u0,field:Xu},s.slots),slotProps:j({},s.slotProps,{field:c=>j({},No(s.slotProps?.field,c),iu(s),{ref:n}),toolbar:j({hidden:!0},s.slotProps?.toolbar)})}),{renderPicker:l}=i0({props:a,valueManager:Dt,valueType:"date",getOpenDialogAriaText:nu({utils:o,formatKey:"fullDate",contextTranslation:r.openDatePickerDialogue,propsTranslation:a.localeText?.openDatePickerDialogue}),validator:Fr});return l()});nd.propTypes={autoFocus:_.bool,className:_.string,closeOnSelect:_.bool,dayOfWeekFormatter:_.func,defaultValue:_.object,disabled:_.bool,disableFuture:_.bool,disableHighlightToday:_.bool,disableOpenPicker:_.bool,disablePast:_.bool,displayWeekNumber:_.bool,enableAccessibleFieldDOMStructure:_.any,fixedWeekNumber:_.number,format:_.string,formatDensity:_.oneOf(["dense","spacious"]),inputRef:Uc,label:_.node,loading:_.bool,localeText:_.object,maxDate:_.object,minDate:_.object,monthsPerRow:_.oneOf([3,4]),name:_.string,onAccept:_.func,onChange:_.func,onClose:_.func,onError:_.func,onMonthChange:_.func,onOpen:_.func,onSelectedSectionsChange:_.func,onViewChange:_.func,onYearChange:_.func,open:_.bool,openTo:_.oneOf(["day","month","year"]),orientation:_.oneOf(["landscape","portrait"]),readOnly:_.bool,reduceAnimations:_.bool,referenceDate:_.object,renderLoading:_.func,selectedSections:_.oneOfType([_.oneOf(["all","day","empty","hours","meridiem","minutes","month","seconds","weekDay","year"]),_.number]),shouldDisableDate:_.func,shouldDisableMonth:_.func,shouldDisableYear:_.func,showDaysOutsideCurrentMonth:_.bool,slotProps:_.object,slots:_.object,sx:_.oneOfType([_.arrayOf(_.oneOfType([_.func,_.object,_.bool])),_.func,_.object]),timezone:_.string,value:_.object,view:_.oneOf(["day","month","year"]),viewRenderers:_.shape({day:_.func,month:_.func,year:_.func}),views:_.arrayOf(_.oneOf(["day","month","year"]).isRequired),yearsOrder:_.oneOf(["asc","desc"]),yearsPerRow:_.oneOf([3,4])};function M1(e){return ge("MuiDialogContent",e)}he("MuiDialogContent",["root","dividers"]);const T1=he("MuiDialogTitle",["root"]),D1=e=>{const{classes:t,dividers:n}=e;return me({root:["root",n&&"dividers"]},M1,t)},R1=Y("div",{name:"MuiDialogContent",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.dividers&&t.dividers]}})(Ee(({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:{[`.${T1.root} + &`]:{paddingTop:0}}}]}))),I1=v.forwardRef(function(t,n){const r=Ce({props:t,name:"MuiDialogContent"}),{className:o,dividers:s=!1,...i}=r,a={...r,dividers:s},l=D1(a);return f.jsx(R1,{className:de(l.root,o),ownerState:a,ref:n,...i})});function E1(e){return ge("MuiDialog",e)}const yr=he("MuiDialog",["root","scrollPaper","scrollBody","container","paper","paperScrollPaper","paperScrollBody","paperWidthFalse","paperWidthXs","paperWidthSm","paperWidthMd","paperWidthLg","paperWidthXl","paperFullWidth","paperFullScreen"]),$1=v.createContext({}),O1=Y(Fu,{name:"MuiDialog",slot:"Backdrop",overrides:(e,t)=>t.backdrop})({zIndex:-1}),A1=e=>{const{classes:t,scroll:n,maxWidth:r,fullWidth:o,fullScreen:s}=e,i={root:["root"],container:["container",`scroll${le(n)}`],paper:["paper",`paperScroll${le(n)}`,`paperWidth${le(String(r))}`,o&&"paperFullWidth",s&&"paperFullScreen"]};return me(i,E1,t)},F1=Y(Lu,{name:"MuiDialog",slot:"Root"})({"@media print":{position:"absolute !important"}}),L1=Y("div",{name:"MuiDialog",slot:"Container",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.container,t[`scroll${le(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"}}}]}),N1=Y(jr,{name:"MuiDialog",slot:"Paper",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.paper,t[`scrollPaper${le(n.scroll)}`],t[`paperWidth${le(String(n.maxWidth))}`],n.fullWidth&&t.paperFullWidth,n.fullScreen&&t.paperFullScreen]}})(Ee(({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)`,[`&.${yr.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}`,[`&.${yr.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,[`&.${yr.paperScrollBody}`]:{margin:0,maxWidth:"100%"}}}]}))),j1=v.forwardRef(function(t,n){const r=Ce({props:t,name:"MuiDialog"}),o=mn(),s={enter:o.transitions.duration.enteringScreen,exit:o.transitions.duration.leavingScreen},{"aria-describedby":i,"aria-labelledby":a,"aria-modal":l=!0,BackdropComponent:c,BackdropProps:u,children:p,className:m,disableEscapeKeyDown:b=!1,fullScreen:d=!1,fullWidth:h=!1,maxWidth:g="sm",onClick:w,onClose:C,open:S,PaperComponent:x=jr,PaperProps:P={},scroll:k="paper",slots:I={},slotProps:R={},TransitionComponent:N=pn,transitionDuration:F=s,TransitionProps:E,...y}=r,$={...r,disableEscapeKeyDown:b,fullScreen:d,fullWidth:h,maxWidth:g,scroll:k},D=A1($),M=v.useRef(),T=B=>{M.current=B.target===B.currentTarget},O=B=>{w&&w(B),M.current&&(M.current=null,C&&C(B,"backdropClick"))},A=xt(a),L=v.useMemo(()=>({titleId:A}),[A]),V={transition:N,...I},X={transition:E,paper:P,backdrop:u,...R},re={slots:V,slotProps:X},[ae,ie]=je("root",{elementType:F1,shouldForwardComponentProp:!0,externalForwardedProps:re,ownerState:$,className:de(D.root,m),ref:n}),[z,Z]=je("backdrop",{elementType:O1,shouldForwardComponentProp:!0,externalForwardedProps:re,ownerState:$}),[Q,G]=je("paper",{elementType:N1,shouldForwardComponentProp:!0,externalForwardedProps:re,ownerState:$,className:de(D.paper,P.className)}),[H,q]=je("container",{elementType:L1,externalForwardedProps:re,ownerState:$,className:D.container}),[te,J]=je("transition",{elementType:pn,externalForwardedProps:re,ownerState:$,additionalProps:{appear:!0,in:S,timeout:F,role:"presentation"}});return f.jsx(ae,{closeAfterTransition:!0,slots:{backdrop:z},slotProps:{backdrop:{transitionDuration:F,as:c,...Z}},disableEscapeKeyDown:b,onClose:C,open:S,onClick:O,...ie,...y,children:f.jsx(te,{...J,children:f.jsx(H,{onMouseDown:T,...q,children:f.jsx(Q,{as:x,elevation:24,role:"dialog","aria-describedby":i,"aria-labelledby":A,"aria-modal":l,...G,children:f.jsx($1.Provider,{value:L,children:p})})})})})}),B1=Y(j1)({[`& .${yr.container}`]:{outline:0},[`& .${yr.paper}`]:{outline:0,minWidth:Wo}}),V1=Y(I1)({"&:first-of-type":{padding:0}});function z1(e){const{children:t,onDismiss:n,open:r,slots:o,slotProps:s}=e,i=o?.dialog??B1,a=o?.mobileTransition??pn;return f.jsx(i,j({open:r,onClose:n},s?.dialog,{TransitionComponent:a,TransitionProps:s?.mobileTransition,PaperComponent:o?.mobilePaper,PaperProps:s?.mobilePaper,children:f.jsx(V1,{children:t})}))}const _1=["props","getOpenDialogAriaText"],W1=e=>{let{props:t,getOpenDialogAriaText:n}=e,r=ve(e,_1);const{slots:o,slotProps:s,className:i,sx:a,format:l,formatDensity:c,enableAccessibleFieldDOMStructure:u,selectedSections:p,onSelectedSectionsChange:m,timezone:b,name:d,label:h,inputRef:g,readOnly:w,disabled:C,localeText:S}=t,x=v.useRef(null),P=xt(),k=s?.toolbar?.hidden??!1,{open:I,actions:R,layoutProps:N,renderCurrentView:F,fieldProps:E,contextValue:y}=ku(j({},r,{props:t,fieldRef:x,autoFocusView:!0,additionalViewProps:{},wrapperVariant:"mobile"})),$=o.field,D=Pe({elementType:$,externalSlotProps:s?.field,additionalProps:j({},E,k&&{id:P},!(C||w)&&{onClick:R.onOpen,onKeyDown:Yv(R.onOpen)},{readOnly:w??!0,disabled:C,className:i,sx:a,format:l,formatDensity:c,enableAccessibleFieldDOMStructure:u,selectedSections:p,onSelectedSectionsChange:m,timezone:b,label:h,name:d},g?{inputRef:g}:{}),ownerState:t});D.inputProps=j({},D.inputProps,{"aria-label":n(E.value)});const M=j({textField:o.textField},D.slots),T=o.layout??Eu;let O=P;k&&(h?O=`${P}-label`:O=void 0);const A=j({},s,{toolbar:j({},s?.toolbar,{titleId:P}),mobilePaper:j({"aria-labelledby":O},s?.mobilePaper)}),L=ke(x,D.unstableFieldRef);return{renderPicker:()=>f.jsxs($u,{contextValue:y,localeText:S,children:[f.jsx($,j({},D,{slots:M,slotProps:A,unstableFieldRef:L})),f.jsx(z1,j({},R,{open:I,slots:o,slotProps:A,children:f.jsx(T,j({},N,A?.layout,{slots:o,slotProps:A,children:F()}))}))]})}},rd=v.forwardRef(function(t,n){const r=jt(),o=Le(),s=ou(t,"MuiMobileDatePicker"),i=j({day:On,month:On,year:On},s.viewRenderers),a=j({},s,{viewRenderers:i,format:oi(o,s,!1),slots:j({field:Xu},s.slots),slotProps:j({},s.slotProps,{field:c=>j({},No(s.slotProps?.field,c),iu(s),{ref:n}),toolbar:j({hidden:!1},s.slotProps?.toolbar)})}),{renderPicker:l}=W1({props:a,valueManager:Dt,valueType:"date",getOpenDialogAriaText:nu({utils:o,formatKey:"fullDate",contextTranslation:r.openDatePickerDialogue,propsTranslation:a.localeText?.openDatePickerDialogue}),validator:Fr});return l()});rd.propTypes={autoFocus:_.bool,className:_.string,closeOnSelect:_.bool,dayOfWeekFormatter:_.func,defaultValue:_.object,disabled:_.bool,disableFuture:_.bool,disableHighlightToday:_.bool,disableOpenPicker:_.bool,disablePast:_.bool,displayWeekNumber:_.bool,enableAccessibleFieldDOMStructure:_.any,fixedWeekNumber:_.number,format:_.string,formatDensity:_.oneOf(["dense","spacious"]),inputRef:Uc,label:_.node,loading:_.bool,localeText:_.object,maxDate:_.object,minDate:_.object,monthsPerRow:_.oneOf([3,4]),name:_.string,onAccept:_.func,onChange:_.func,onClose:_.func,onError:_.func,onMonthChange:_.func,onOpen:_.func,onSelectedSectionsChange:_.func,onViewChange:_.func,onYearChange:_.func,open:_.bool,openTo:_.oneOf(["day","month","year"]),orientation:_.oneOf(["landscape","portrait"]),readOnly:_.bool,reduceAnimations:_.bool,referenceDate:_.object,renderLoading:_.func,selectedSections:_.oneOfType([_.oneOf(["all","day","empty","hours","meridiem","minutes","month","seconds","weekDay","year"]),_.number]),shouldDisableDate:_.func,shouldDisableMonth:_.func,shouldDisableYear:_.func,showDaysOutsideCurrentMonth:_.bool,slotProps:_.object,slots:_.object,sx:_.oneOfType([_.arrayOf(_.oneOfType([_.func,_.object,_.bool])),_.func,_.object]),timezone:_.string,value:_.object,view:_.oneOf(["day","month","year"]),viewRenderers:_.shape({day:_.func,month:_.func,year:_.func}),views:_.arrayOf(_.oneOf(["day","month","year"]).isRequired),yearsOrder:_.oneOf(["asc","desc"]),yearsPerRow:_.oneOf([3,4])};const H1=["desktopModeMediaQuery"],Mr=v.forwardRef(function(t,n){const r=Fe({props:t,name:"MuiDatePicker"}),{desktopModeMediaQuery:o=Gv}=r,s=ve(r,H1);return Hc(o,{defaultMatches:!0})?f.jsx(nd,j({ref:n},s)):f.jsx(rd,j({ref:n},s))});function $i(e,t){if(!t)return;const n=t.trim();if(!n)return;const r=e??"string";if(r==="date"||r==="timestamp"||r==="timestamptz")return n.replace(/^@/,"");if(r.startsWith("filter<")){const o=n.replace(/^f(?=['"])/,""),s=o.match(/^'([^'\\]*)'$/)??o.match(/^"([^"\\]*)"$/);return s?s[1]:o}return r==="string"?U1(n):n}function U1(e){const t=e[0];return e.length>=2&&(t==="'"||t==='"')&&e[e.length-1]===t?e.slice(1,-1).replace(/\\(["'\\ntr])/g,(n,r)=>r==="n"?`
|
|
135
135
|
`:r==="t"?" ":r==="r"?"\r":r):e}Re.extend(qs);const Rl=14,Y1=42;function G1(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(),s=o.match(/description="([^"]*)"/);if(s){n.push(s[1]);continue}const i=o.replace(/^#\(/,"").replace(/\)\s*$/,"").trim();i&&n.push(i)}return n.length>0?n.join(`
|
|
136
136
|
`):void 0}function Oi({given:e,value:t,onChange:n,options:r,optionsLoading:o,optionsFailed:s}){const i=e.label??e.name??"",{theme:a}=Se.usePublisherTheme(),l=e.type??"string",c=G1(e),u=$i(l,e.default),p=u!==void 0?`Default: ${u===""?"(empty)":u}`:void 0,m=c||p?f.jsxs(f.Fragment,{children:[c,c&&p?f.jsx("br",{}):null,p]}):void 0,b=l==="string"||qt(l)==="string",d=!Yt(l)||typeof t!="string"||xc(t),h=O=>f.jsx(W.TextField,{label:i,value:String(t),error:!0,inputProps:{readOnly:!0},helperText:f.jsxs(f.Fragment,{children:[`Not a ${O}. Clear it to pick one.`,m?f.jsx("br",{}):null,m]}),slotProps:{input:{endAdornment:f.jsx(us,{onClear:()=>n(null)})}},fullWidth:!0,size:"small"}),g=Yt(l),w=e.control==="multiselect"&&g,C=Yt(l),S=e.control==="select"||e.control==="multiselect",x=S?C?typeof t=="string"?vc(t):[]:typeof t=="string"&&t!==""?[t]:[]:[];if(S&&b&&d&&!(!w&&x.length>1)){const O=A=>{const L=C?Ks(A):void 0;if(A.length===0||L===""){n(null);return}n(C?L:A[0])};return f.jsx(W.Autocomplete,{multiple:w,disableCloseOnSelect:w,freeSolo:!0,forcePopupIcon:!0,autoSelect:!w,options:r??[],loading:o,noOptionsText:s?"Options unavailable":"No matching values",value:w?x:x[0]??null,onChange:(A,L)=>O(L===null?[]:Array.isArray(L)?L:[L]),renderInput:A=>f.jsx(W.TextField,{...A,label:i,size:"small",placeholder:x.length!==0?void 0:t===""?"All":u??"All",error:s,helperText:s?f.jsxs(f.Fragment,{children:["Could not load the options for this control. Type a value to filter anyway.",m?f.jsx("br",{}):null,m]}):m,slotProps:{input:{...A.InputProps,endAdornment:f.jsxs(f.Fragment,{children:[o&&f.jsx(W.CircularProgress,{size:16}),A.InputProps.endAdornment]})},htmlInput:{...A.inputProps,onBlur:L=>{if(A.inputProps.onBlur?.(L),!w)return;const V=L.target.value.trim();V!==""&&!x.includes(V)&&O([...x,V])}}}}),fullWidth:!0})}const P=Yt(l)&&qt(l)==="number",{rangeMin:k,rangeMax:I}=e,R=P&&typeof t=="string"?wc(t):void 0,N=P&&typeof t=="string"?Cc(t):void 0;if((P||l==="number")&&k!==void 0&&I!==void 0&&(!P||t===void 0||t===null||t===""||R!==void 0||N!==void 0)){const O=N??(R!==void 0?[R,I]:void 0),A=P?O?.[0]:typeof t=="number"?t:void 0;if(A===void 0&&t!==void 0&&t!==null&&t!=="")return h("number");const L=A??k,V=O??[k,I],X=V[1]>=I?`≥ ${V[0]}`:`${V[0]} to ${V[1]}`,re=P&&t==="",ae=A!==void 0||re;return f.jsxs(W.FormControl,{fullWidth:!0,children:[f.jsxs(W.Box,{component:"fieldset",sx:ie=>({m:0,minWidth:0,border:a.cardBorder,borderRadius:2,px:`${Rl}px`,pt:0,pb:.75,minHeight:Y1,transition:"border-color 120ms ease-in","&:hover":{borderColor:ie.palette.text.secondary},"&:focus-within":{borderColor:ie.palette.text.primary}}),children:[f.jsx(W.Typography,{component:"legend",variant:"caption",color:"text.secondary",sx:{px:.5,lineHeight:1},children:i}),f.jsxs(W.Stack,{direction:"row",alignItems:"center",spacing:1,children:[f.jsx(W.Typography,{variant:"body2",sx:{fontWeight:"fontWeightMedium"},children:ae?re?"Any":P?X:String(L):P?"Any":u??"Unset"}),ae&&f.jsx(Tr,{onClear:()=>n(null),sx:{p:0}})]}),f.jsx(W.Slider,{size:"small",min:k,max:I,value:P?V:L,disableSwap:P,valueLabelDisplay:"auto","aria-label":P?void 0:i,getAriaLabel:P?ie=>ie===0?`${i} from`:`${i} to`:void 0,sx:{py:0,mt:.5},onChange:(ie,z)=>{if(P){const[Z,Q]=Array.isArray(z)?[z[0],z[1]]:[z,z];if(Z<=k&&Q>=I){n(null);return}n(Q>=I?Nm(Z):jm(Z,Q));return}n(Array.isArray(z)?z[0]:z)}}),f.jsxs(W.Stack,{direction:"row",justifyContent:"space-between",children:[f.jsx(W.Typography,{variant:"caption",color:"text.secondary",children:k}),f.jsx(W.Typography,{variant:"caption",color:"text.secondary",children:I})]})]}),m&&f.jsx(W.FormHelperText,{sx:{mx:`${Rl}px`},children:m})]})}const E=Yt(l)?qt(l):void 0,y=E==="date"||E==="timestamp"||E==="timestamptz",$=typeof t=="string"&&/^\d{4}-\d{2}-\d{2}$/.test(t),D=t==null||$;if(y&&!$){const O=K1(t);if(O!==void 0)return f.jsx(X1,{label:i,state:O,onChange:n,helperNode:m,defaultDisplay:u})}if(y&&D){const O=$?Re.utc(t):null;return f.jsx(Sr,{dateAdapter:mo,children:f.jsx(Mr,{label:i,value:O?.isValid()?O:null,onChange:A=>n(A?A.format("YYYY-MM-DD"):null),slotProps:{textField:{fullWidth:!0,size:"small",helperText:m},field:{clearable:!0,onClear:()=>n(null)}}})})}if(qt(l)==="boolean"){const O=typeof t=="string"?Lm(t):void 0;if(t==null||t===""||O!==void 0)return f.jsx(q1,{label:i,picked:O,emptyOverride:t==="",onChange:n,helperNode:m,defaultDisplay:u})}if(l==="boolean"){const O=typeof t=="boolean";if(!O&&t!==void 0&&t!==null)return h("true or false");const A=e.default?.trim()==="true",L=O?t:A;return f.jsxs(W.FormControl,{children:[f.jsxs(W.Stack,{direction:"row",alignItems:"center",children:[f.jsx(W.FormControlLabel,{control:f.jsx(W.Checkbox,{checked:L,onChange:V=>n(V.target.checked)}),label:i}),O&&f.jsx(Tr,{onClear:()=>n(null),edge:"end"})]}),m&&f.jsx(W.FormHelperText,{children:m})]})}if(l==="number"){const O=typeof t=="number"?t:"",A=t!=null;return A&&t!==""&&typeof t!="number"?h("number"):f.jsx(W.TextField,{label:i,type:"number",value:O,onChange:L=>{const V=L.target.value;n(V===""?null:Number(V))},placeholder:u,helperText:m,slotProps:{input:{endAdornment:A&&f.jsx(us,{onClear:()=>n(null)})}},fullWidth:!0,size:"small"})}if(l==="date"||l==="timestamp"||l==="timestamptz"){const O=t instanceof Date?t:typeof t=="string"?(V=>V instanceof Date?V:null)(Fc(l,t)):null,A=O?Re.utc(O):null;return t!=null&&t!==""&&O===null?h("date"):f.jsx(Sr,{dateAdapter:mo,children:f.jsx(Mr,{label:i,value:A,onChange:V=>n(V?Hm(V,O??void 0):null),slotProps:{textField:{fullWidth:!0,size:"small",helperText:m},field:{clearable:!0,onClear:()=>n(null)}}})})}const M=typeof t=="string"?t:"",T=t!=null;return f.jsx(W.TextField,{label:i,value:M,onChange:O=>n(O.target.value),placeholder:T?void 0:u??(l.startsWith("filter<")?l:void 0),helperText:m,slotProps:{input:{endAdornment:T&&f.jsx(us,{onClear:()=>n(null)})}},fullWidth:!0,size:"small"})}function Tr({onClear:e,edge:t,sx:n}){return f.jsx(W.IconButton,{size:"small","aria-label":"Clear value",onClick:e,edge:t,sx:[{minWidth:24,minHeight:24},...Array.isArray(n)?n:[n]],children:f.jsx(og,{fontSize:"small"})})}function us({onClear:e}){return f.jsx(W.InputAdornment,{position:"end",children:f.jsx(Tr,{onClear:e,edge:"end"})})}const Xr="__any__";function q1({label:e,picked:t,emptyOverride:n,onChange:r,helperNode:o,defaultDisplay:s}){const i=t??(n?Xr:""),a=i!=="";return f.jsx(W.Box,{"data-testid":"boolean-filter",children:f.jsxs(W.TextField,{select:!0,label:e,value:i,size:"small",fullWidth:!0,helperText:o,slotProps:{select:{displayEmpty:!0,renderValue:l=>l==="true"||l==="false"?l:l===Xr?"Any":s||"Any"},input:{endAdornment:a?f.jsx(Tr,{onClear:()=>r(null),sx:{mr:2}}):void 0}},onChange:l=>{l.target.value!==Xr&&r(l.target.value)},children:[n&&f.jsx(W.MenuItem,{value:Xr,children:"Any"}),f.jsx(W.MenuItem,{value:"true",children:"true"}),f.jsx(W.MenuItem,{value:"false",children:"false"})]})})}function K1(e){if(e==null)return{kind:"unset"};if(typeof e!="string")return;if(e==="")return{kind:"any"};const t=Pc(e);if(t!==void 0)return{kind:"preset",key:t};const n=kc(e);if(n!==void 0)return{kind:"days",...n}}const Qr="__custom__",ds="__any__";function X1({label:e,state:t,onChange:n,helperNode:r,defaultDisplay:o}){const s=t.kind==="days"?`days:${t.firstDay}/${t.lastDay}`:t.kind==="preset"?`preset:${t.key}`:t.kind,[i,a]=ee.useState(t.kind==="days"),[l,c]=ee.useState(t.kind==="days"?{from:t.firstDay,to:t.lastDay}:{});ee.useEffect(()=>{t.kind==="days"?(a(!0),c({from:t.firstDay,to:t.lastDay})):t.kind!=="unset"&&a(!1)},[s]);const u=t.kind!=="unset",p=i?Qr:t.kind==="preset"?t.key:t.kind==="any"?ds:"",m=d=>{c(d),d.from&&d.to&&!Re.utc(d.to).isBefore(Re.utc(d.from))&&n(zm(d.from,d.to))},b=d=>{const h=d?Re.utc(d):null;return h?.isValid()?h:null};return f.jsxs(W.Stack,{direction:"row",spacing:1,"data-testid":"time-range",children:[f.jsxs(W.TextField,{select:!0,label:e,value:p,size:"small",fullWidth:!0,helperText:r,slotProps:{select:{displayEmpty:!0,renderValue:d=>{if(d===Qr)return"Custom range";if(d===ds)return"Any time";const h=xr.find(g=>g.key===d);return h?h.label:o??"Any time"}},input:{endAdornment:u?f.jsx(Tr,{onClear:()=>{a(!1),c({}),n(null)},sx:{mr:2}}):void 0}},onChange:d=>{const h=d.target.value;if(h===Qr){a(!0);return}a(!1);const g=Bm(h);g!==void 0&&n(g)},children:[t.kind==="any"&&f.jsx(W.MenuItem,{value:ds,children:"Any time"}),xr.map(d=>f.jsx(W.MenuItem,{value:d.key,children:d.label},d.key)),f.jsx(W.MenuItem,{value:Qr,children:"Custom range"})]}),i&&f.jsxs(Sr,{dateAdapter:mo,children:[f.jsx(Mr,{label:"From",value:b(l.from),onChange:d=>m({...l,from:d?d.format("YYYY-MM-DD"):void 0}),slotProps:{textField:{size:"small"}}}),f.jsx(Mr,{label:"To",value:b(l.to),minDate:b(l.from)??void 0,onChange:d=>m({...l,to:d?d.format("YYYY-MM-DD"):void 0}),slotProps:{textField:{size:"small"}}})]})]})}const od=ee.createContext(void 0),Yn=()=>ee.useContext(od),Dn="remove-badge",sd={[`& .${Dn}`]:{opacity:0},[`&:hover .${Dn}, &:focus-within .${Dn}`]:{opacity:1},"@media (hover: none)":{[`& .${Dn}`]:{opacity:1}}};function id({label:e,onRemove:t,disabledReason:n,inset:r=0}){const{theme:o}=Se.usePublisherTheme(),s=n!==void 0,i=f.jsx(W.IconButton,{className:Dn,"aria-label":e,"aria-disabled":s||void 0,...s?{"aria-description":n}:{},onClick:a=>{a.stopPropagation(),s||t()},onPointerDown:a=>a.stopPropagation(),sx:a=>({position:"absolute",top:-8-r,right:-8-r,zIndex:3,width:18,height:18,p:0,borderRadius:"50%",border:`1px solid ${Hn(o.cardBorder)}`,bgcolor:a.palette.background.paper,color:a.palette.text.secondary,cursor:s?"default":"pointer",transition:`opacity ${$r}`,...Or,"&:hover":{bgcolor:a.palette.background.paper,color:s?a.palette.text.secondary:a.palette.text.primary,borderColor:Gs(o.cardBorder,o.tileTitle)}}),children:f.jsx(Fo,{sx:{fontSize:12}})});return s?f.jsx(W.Tooltip,{title:n,children:i}):i}const Ai=e=>e.required===!0,Q1=(e,t)=>e==null||e===""&&!Ac(t);function Z1(e,t,n){return e.filter(r=>r.name!==void 0&&Ai(r)&&Q1(t.get(r.name),r.type)&&(n?.[r.name]===void 0||n[r.name]===null))}function J1(e,t){if(!t||e.length===0)return[];const n=new Set(t);return e.filter(r=>r.name&&n.has(r.name))}const ad=e=>e.label??e.name??"";function ld(e){return e.length<2?e.join(""):`${e.slice(0,-1).join(", ")} and ${e[e.length-1]}`}function eP(e){const t=e.map(ad);return`Pick a value for ${ld(t)} to see this report.`}function tP(e){return`Waiting for ${ld(e.map(ad))}.`}const Rs=28,nP=/^\d{4}-\d{2}-\d{2}$/,cd=new Intl.DateTimeFormat("en-US",{month:"short",day:"numeric",year:"numeric",timeZone:"UTC"});function ps(e){if(!nP.test(e))return e;const t=new Date(`${e}T00:00:00Z`);return Number.isNaN(t.getTime())?e:cd.format(t)}function rP(e){if(e.length===0)return"";const t=e.join(", ");return t.length<=Rs||e.length===1?wo(t):`${wo(e[0]??"")} +${e.length-1}`}function wo(e){return e.length>Rs?`${e.slice(0,Rs-1)}…`:e}function oP(e){if(Ai(e))return"Required";const t=e.type??"string",n=$i(t,e.default);if(n!==void 0&&n!=="")return ud(t,n);const r=qt(t)??t;return e.control==="select"||e.control==="multiselect"||r==="string"?"All":"Any"}function ud(e,t){if(!Yt(e))return wo(ps(t));const n=qt(e);if(n==="string"&&xc(t))return rP(vc(t));if(n==="number"){const r=Cc(t);if(r)return`${r[0]}–${r[1]}`;const o=wc(t);if(o!==void 0)return`≥ ${o}`}if(n==="date"||n==="timestamp"||n==="timestamptz"){const r=Pc(t);if(r)return xr.find(s=>s.key===r)?.label??t;const o=kc(t);if(o)return`${ps(o.firstDay)} – ${ps(o.lastDay)}`}return wo(t)}function sP(e,t){return t==null?oP(e):t instanceof Date?Number.isNaN(t.getTime())?"":cd.format(t):typeof t=="boolean"?t?"Yes":"No":typeof t=="number"?String(t):t===""?"(empty)":ud(e.type??"string",t)}function iP(e){const{given:t,value:n,onChange:r}=e,{theme:o}=Se.usePublisherTheme(),s=o.ui,i=Yn(),[a,l]=ee.useState(null),c=t.name??"",u=t.label??c,p=n!=null,m=sP(t,n),b=a!==null,d=i?.stateOf(c),h=d?.problem,g=d?.fixed,w=f.jsxs(dd,{name:c,set:p,open:b,problem:h,fixed:g!==void 0,required:!p&&Ai(t),children:[f.jsxs(W.ButtonBase,{"aria-haspopup":"dialog","aria-expanded":b,"aria-label":`${u}: ${m}`,onClick:C=>l(C.currentTarget),sx:C=>({height:"100%",borderRadius:s.radius.control,pl:"10px",pr:p?"4px":"8px",gap:"6px",fontFamily:"inherit",fontSize:s.type.control.fontSize,lineHeight:1,minWidth:0,color:C.palette.text.primary}),children:[f.jsx(W.Box,{component:"span",sx:C=>({color:p?o.accent:C.palette.text.secondary,whiteSpace:"nowrap"}),children:u}),f.jsx(W.Box,{component:"span",sx:{fontWeight:s.type.control.fontWeight,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:m}),!p&&f.jsx(hc,{"aria-hidden":!0,sx:C=>({fontSize:16,color:C.palette.text.secondary,transform:b?"rotate(180deg)":"none"})})]}),p&&f.jsx(W.IconButton,{"aria-label":`Clear ${u}`,onClick:()=>r(null),sx:{width:22,height:22,mr:"4px",borderRadius:"4px",color:o.accent},children:f.jsx(Fo,{sx:{fontSize:14}})})]});return f.jsxs(f.Fragment,{children:[h?f.jsx(W.Tooltip,{title:h,children:w}):w,f.jsxs(W.Popover,{className:$t.filterPopover,open:b,anchorEl:a,onClose:()=>l(null),anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},slotProps:{paper:{role:"dialog","aria-label":`${u} filter`,sx:{mt:.75,p:1.5,width:300,maxWidth:"calc(100vw - 32px)",boxSizing:"border-box",borderRadius:s.radius.tile,border:o.cardBorder,boxShadow:o.shadow.lift}}},children:[f.jsx(Oi,{...e}),i&&f.jsxs(W.Box,{sx:C=>({mt:1.5,pt:1,borderTop:`1px solid ${C.palette.divider}`,display:"flex",flexDirection:"column",alignItems:"flex-start",gap:.5}),children:[h&&f.jsx(W.Typography,{sx:{...s.type.caption,color:"warning.main"},children:h}),g!==void 0&&f.jsx(W.Typography,{sx:C=>({...s.type.caption,color:C.palette.text.secondary}),children:g}),f.jsx(cP,{name:c,type:t.type,text:aP(n,t.type)}),g===void 0?f.jsx(W.Button,{size:"small","aria-label":`Edit filter ${c}`,"aria-haspopup":"dialog",onClick:()=>{l(null),i.onEdit(c)},sx:{px:.75,minWidth:0,...s.type.control},children:"Filter settings…"}):d?.openModel&&f.jsx(W.Button,{size:"small",onClick:()=>{l(null),d.openModel?.()},sx:{px:.75,minWidth:0,...s.type.control},children:"Open the model"})]})]})]})}function aP(e,t){if(e!=null)return $c(e,t)}function lP(e,t){return e===void 0||!t?.startsWith("filter<")?e:/^f(['"])([\s\S]*)\1$/.exec(e)?.[2]??e}function cP({name:e,type:t,text:n}){const r=Yn(),o=Se.usePublisherTheme().theme.ui;if(!r?.setStartingValue)return null;const s=r.setStartingValue,i=lP(r.startingValueOf?.(e),t),a={px:.75,minWidth:0,...o.type.control};return f.jsxs(f.Fragment,{children:[i!==void 0&&i===n&&f.jsx(W.Typography,{sx:l=>({...o.type.caption,color:l.palette.text.secondary,px:.75}),children:"The report opens with this value."}),n!==void 0&&n!==i&&f.jsx(W.Button,{size:"small",onClick:()=>s(e,n),sx:a,children:"Open the report with this value"}),i!==void 0&&f.jsx(W.Button,{size:"small",onClick:()=>s(e,void 0),sx:a,children:"Open at the default instead"})]})}function dd({name:e,set:t=!1,open:n=!1,unused:r=!1,problem:o,fixed:s=!1,required:i=!1,children:a}){const{theme:l}=Se.usePublisherTheme(),c=l.ui,u=Yn();return f.jsxs(W.Box,{className:$t.filter,"data-filter":e,"data-set":t||void 0,"data-problem":o?!0:void 0,"data-required":i||void 0,sx:p=>({position:"relative",display:"inline-flex",alignItems:"center",height:c.size.control,boxSizing:"border-box",borderRadius:c.radius.control,border:"1px solid",borderStyle:r?"dashed":"solid",borderColor:o||i?p.palette.warning.main:t?`color-mix(in srgb, ${l.accent} 45%, transparent)`:n?l.accent:Hn(l.cardBorder),bgcolor:t?`color-mix(in srgb, ${l.accent} 8%, ${p.palette.background.paper})`:p.palette.background.paper,opacity:r?.75:1,transition:`border-color ${$r}`,...Or,"&:hover":{borderColor:t||n||o?void 0:Gs(l.cardBorder,l.tileTitle)},maxWidth:"100%",...sd}),children:[a,u&&!s&&f.jsx(id,{label:`Remove filter ${e}`,onRemove:()=>u.onRemove(e)})]})}function pd({name:e,label:t,unused:n=!0}){const r=Yn(),o=Se.usePublisherTheme().theme.ui;if(!r)return null;const s=r.stateOf(e)?.problem,i=f.jsx(dd,{name:e,unused:n,problem:s,children:f.jsxs(W.ButtonBase,{"aria-label":`Edit filter ${e}`,"aria-haspopup":"dialog",onClick:()=>r.onEdit(e),sx:a=>({height:"100%",borderRadius:o.radius.control,px:"10px",gap:"6px",fontFamily:"inherit",fontSize:o.type.control.fontSize,lineHeight:1,color:a.palette.text.secondary,whiteSpace:"nowrap"}),children:[f.jsx("span",{children:t}),n&&f.jsx(W.Box,{component:"span",sx:{fontStyle:"italic"},children:"Unused"})]})});return s?f.jsx(W.Tooltip,{title:s,children:i}):i}function fd(){const{theme:e}=Se.usePublisherTheme(),t=e.ui,n=Yn();if(!n)return null;const r=n.addDisabledReason!==void 0;return f.jsx(W.Tooltip,{title:n.addDisabledReason??"",children:f.jsx("span",{children:f.jsx(W.Button,{variant:"outlined",startIcon:f.jsx(Us,{}),"aria-label":"Add filter","aria-haspopup":"dialog",disabled:r,onClick:()=>n.onAdd(),sx:o=>({height:t.size.control,minHeight:t.size.control,px:1.25,borderRadius:t.radius.control,borderStyle:"dashed",borderColor:Hn(e.cardBorder),color:o.palette.text.secondary,boxShadow:"none",...t.type.control,"& .MuiButton-startIcon":{mr:.5},"& .MuiButton-startIcon svg":{fontSize:16}}),children:"Filter"})})})}function uP({givens:e,values:t,onChange:n,onReset:r,layout:o="panel",options:s,optionsLoading:i,optionsFailed:a,apply:l,title:c}){const u=Yn();if(e.length===0&&!(u&&o==="bar"))return null;const p=Array.from(t.values()).some(d=>d!==null),m=e.map(d=>f.jsx(W.Box,{children:f.jsx(Oi,{given:d,value:d.name?t.get(d.name):void 0,onChange:h=>d.name&&n(d.name,h),options:d.name?s?.get(d.name):void 0,optionsLoading:i,optionsFailed:d.name?a?.has(d.name):void 0})},d.name)),b=f.jsxs(W.Stack,{direction:"row",alignItems:"center",spacing:1,children:[l&&f.jsx(W.Button,{variant:"contained",size:"small",disableElevation:!0,onClick:l.onApply,disabled:!l.pending,children:"Apply"}),p&&f.jsx(W.Button,{variant:"text",size:"small",onClick:r,children:"Reset"})]});return o==="bar"?f.jsxs(W.Stack,{direction:"row",role:"group","aria-label":c??"Filters",useFlexGap:!0,sx:{flexWrap:"wrap",alignItems:"center",gap:1},children:[e.map(d=>f.jsx(iP,{given:d,value:d.name?t.get(d.name):void 0,onChange:h=>d.name&&n(d.name,h),options:d.name?s?.get(d.name):void 0,optionsLoading:i,optionsFailed:d.name?a?.has(d.name):void 0},d.name)),u?.unrendered.map(d=>f.jsx(pd,{name:d.name,label:d.label},d.name)),f.jsx(fd,{}),f.jsx(W.Box,{sx:{ml:"auto"},children:b})]}):f.jsxs(W.Paper,{elevation:0,sx:{p:3,backgroundColor:"transparent",border:"none",boxShadow:"none"},children:[f.jsxs(W.Stack,{direction:"row",alignItems:"center",justifyContent:"space-between",sx:{mb:2},children:[f.jsx(W.Typography,{variant:"subtitle2",sx:{fontWeight:"fontWeightMedium",color:"text.primary"},children:c??"Filters"}),b]}),f.jsx(W.Box,{sx:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(220px, 1fr))",alignItems:"start",columnGap:3,rowGap:2.5},children:m})]})}const dP=/^(https?|mailto|tel):/i,pP=/^[a-z][a-z0-9+.-]*:/i;function fP({href:e,title:t,children:n,context:r}){const o=!!e&&pP.test(e),s=!!e&&!o&&!e.startsWith("/")&&!e.startsWith("#");if(!e||!s||!r){const p=o&&!dP.test(e??"");return f.jsx("a",{href:p?void 0:e,title:t,...o?{target:"_blank",rel:"noopener noreferrer"}:{},children:n})}const i=r.sourcePath&&r.sourcePath.includes("/")?r.sourcePath.slice(0,r.sourcePath.lastIndexOf("/")+1):"",a=new URL(e,`https://malloy.invalid/${i}`),l=a.pathname.slice(1)+a.search+a.hash,c=`/${r.environmentName}/${r.packageName}/${l}`,{onNavigate:u}=r;return f.jsx("a",{href:c,title:t,onClick:u?p=>{p.preventDefault(),u(c,p)}:void 0,children:n})}const hP=e=>({document:{"& > :first-child, & > div:only-child > :first-child":{mt:0},"& > :last-child, & > div:only-child > :last-child":{mb:0},"& h1, & h2, & h3, & h4, & h5, & h6":{fontWeight:"fontWeightMedium",color:"text.primary",mb:1,mt:2},"& h1":{fontSize:"28px"},"& h2":{fontSize:"24px"},"& h3":{fontSize:"20px"},"& p, & ul, & ol":{color:"text.primary",...e.type.prose,mb:1,maxWidth:ac},"& li":{mb:.5}},caption:{color:"text.secondary",typography:"body2","& > :first-of-type":{mt:0},"& > :last-child":{mb:0},"& h1, & h2, & h3, & h4, & h5, & h6":{fontSize:"inherit",fontWeight:"fontWeightMedium",m:"0.5em 0 0.25em"},"& p":{m:"0.5em 0"},"& ul, & ol":{m:"0.5em 0",pl:3},"& code":{fontFamily:e.font.mono,fontSize:"0.9em"}}});function mP({alt:e}){return f.jsx(f.Fragment,{children:e})}function gP({children:e,variant:t="caption",links:n,sx:r}){const{theme:o}=Se.usePublisherTheme();return f.jsx(W.Box,{sx:[hP(o.ui)[t],{fontFamily:o.font.family},...Array.isArray(r)?r:[r]],children:f.jsx(dp,{options:{forceBlock:t==="document",disableParsingRawHTML:!0,overrides:{a:{component:fP,props:{context:n}},img:{component:mP}}},children:e})})}const yP=new Set(["bar","line","chart","scatter_chart"]),bP=new Set(["table","dashboard","shape_map","segment_map","list","list_detail","big_value","cell","link","image"]);function vP(e,t){return t==="fill"?"container":t==="fixed"||!e?"content":yP.has(e)?"container":"content"}function xP(e,t){return t==="fixed"?!0:t==="fill"?!1:e!==void 0&&bP.has(e)}function SP(e){return e==="dashboard"?3:2}function hd(e,t){let n=e.firstElementChild;for(let r=1;r<t&&n;r++)n=n.firstElementChild;return n}function wP(e,t){const n=hd(e,t);return n&&(n.scrollHeight||n.offsetHeight)||0}const CP=400,PP=700,kP=600,MP=800,md=400,Is=2e3;function gd(e){return e===void 0?Is:Math.min(e,Is)}function Es({sizing:e,contentHeight:t,maxHeight:n,fillHeight:r}){if(e==="container")return n??md;if(t===void 0||t<=0)return gd(n);const o=n===void 0?t:Math.min(n,t);return r===void 0?o:Math.max(o,r)}const Co={opening:e=>e?`Opening the ${e}…`:"Opening…",running:"Running…",loading:"Loading…"};function Fi({text:e,size:t=20,color:n="primary",thickness:r=3.6,centered:o=!0,spacing:s=2,textVariant:i="body2"}){const a=f.jsxs(W.Box,{sx:{display:"flex",flexDirection:"column",alignItems:"center",gap:s},children:[f.jsx(W.CircularProgress,{size:t,color:n,thickness:r}),e&&f.jsx(W.Typography,{variant:i,color:"text.secondary",children:e})]});return o?f.jsx(W.Box,{sx:{display:"flex",justifyContent:"center",alignItems:"center",minHeight:"200px",width:"100%"},children:a}):a}let or;function yd(){return or||(or=import("@malloydata/render"),or.catch(()=>{or=void 0})),or}function bd(){typeof window>"u"||yd().catch(()=>{})}const vd=$e(f.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 xd({sx:e,...t}){const{theme:n}=Se.usePublisherTheme();return f.jsx(W.IconButton,{size:"small",...t,sx:[{width:32,height:32,bgcolor:n.tile,border:n.border,color:n.tileTitle,"&:hover":{bgcolor:n.tile,color:n.drillLink},"& .MuiSvgIcon-root":{fontSize:18}},...Array.isArray(e)?e:[e]]})}const TP=new Set(["warn","error"]);function DP(e){if(!e?.length)return;const t=[];let n=!1;for(const r of e)!r.message||!TP.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(`
|
|
137
|
-
`)}}const RP=ee.lazy(()=>Promise.resolve().then(()=>require("./RenderedResult-BlNoIiSi.cjs.js")).then(e=>e.RenderedResult$1));function Sd({result:e,maxHeight:t,maxResultSize:n=0,renderLogs:r,drill:o,fill:s=!1}){const i=ee.useRef(null);ee.useEffect(()=>bd(),[]);const[a,l]=ee.useState(void 0),[c,u]=ee.useState(void 0),[p,m]=ee.useState(!1),[b,d]=ee.useState(void 0),h=DP(r),g=!!e;if(ee.useEffect(()=>{const P=i.current;if(!s||!P)return;const k=new ResizeObserver(([I])=>d(Math.round(I.contentRect.height)));return k.observe(P),()=>k.disconnect()},[s,g,p]),!e)return null;if(n>0&&e.length>n&&!p)return f.jsxs(W.Box,{sx:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:2,p:4,backgroundColor:"#fafafa",border:"1px solid",borderColor:"#e0e0e0",borderRadius:1},children:[f.jsx(fp.Warning,{sx:{fontSize:48,color:"#757575"}}),f.jsx(W.Typography,{variant:"h6",color:"text.secondary",align:"center",children:"Processing large results may cause browser performance issues. Proceed?"}),f.jsx(W.Button,{variant:"contained",color:"primary",onClick:()=>m(!0),children:"Proceed"})]});const C=f.jsx(Fi,{text:Co.loading,centered:!0,size:32}),S=Es({sizing:a,contentHeight:c,maxHeight:t,fillHeight:s?b:void 0}),x=f.jsx(ee.Suspense,{fallback:C,children:f.jsx(RP,{result:e,height:S,onSizeChange:u,onSizing:l,drill:o,fill:s})});return f.jsxs(W.Box,{ref:i,sx:{position:"relative",height:"auto",border:"0px",borderRadius:0,overflow:"hidden",...s&&{flex:`1 1 ${Es({sizing:a,contentHeight:c,maxHeight:t})}px`,minHeight:0}},children:[s?f.jsx(W.Box,{sx:{position:"absolute",inset:0},children:x}):x,h&&f.jsx(W.Box,{sx:{position:"absolute",top:4,right:4,zIndex:1},children:f.jsx(W.Tooltip,{title:h.title,slotProps:{tooltip:{sx:{whiteSpace:"pre-line"}}},children:f.jsx(xd,{"aria-label":"Render tag warnings",children:f.jsx(vd,{fontSize:"small",color:h.severity==="error"?"error":"warning"})})})})]})}function wd({state:e,context:t,loadingText:n=Co.running,maxHeight:r,maxResultSize:o,drill:s,fill:i,transform:a}){const{data:l,isSuccess:c,isError:u,error:p,fetchStatus:m,isPlaceholderData:b}=e,d=c||m==="fetching";ee.useEffect(()=>{d&&bd()},[d]);const h=l?.data.result,g=ee.useMemo(()=>h!==void 0&&a?a(h):h,[h,a]);if(u)return f.jsx(W.Box,{sx:{p:2},children:f.jsx(yc,{context:t,error:p})});if(!c)return f.jsx(Fi,{text:m==="idle"?Co.loading:n});const w=f.jsx(Sd,{result:g,maxHeight:r,maxResultSize:o,renderLogs:l.data.renderLogs,drill:s,fill:i});return f.jsxs(W.Box,{"aria-busy":b||void 0,sx:{position:"relative",display:"flex",flexDirection:"column",flex:"1 1 auto",minHeight:0,minWidth:0,...i?{height:"100%"}:{},"& > .result-body":{display:"flex",flexDirection:"column",flex:"1 1 auto",minHeight:0,minWidth:0,...i?{height:"100%"}:{},opacity:b?.55:1,transition:b?"opacity 160ms ease 200ms":"opacity 120ms ease","@media (prefers-reduced-motion: reduce)":{transition:"none"}}},children:[b&&f.jsx(W.LinearProgress,{"aria-label":n,sx:{position:"absolute",top:0,left:0,right:0,height:2,zIndex:1,bgcolor:"transparent",borderRadius:1}}),f.jsx(W.Box,{className:"result-body",children:w})]})}const $s=()=>typeof performance<"u"?performance.now():Date.now(),IP=$e(f.jsx("path",{d:"m16.95 6-3.57 4.55 1.43 1.43c1.03-1.31 4.98-6.37 4.98-6.37C20.3 4.95 19.83 4 19 4H6.83l2 2zM2.81 2.81 1.39 4.22 10 13v6c0 .55.45 1 1 1h2c.55 0 1-.45 1-1v-2.17l5.78 5.78 1.41-1.41z"})),EP=3;function $P(e,t){if(e===void 0)return[];const n=new Set(e);return t.flatMap(r=>r.name&&!n.has(r.name)?[r.label??r.name]:[])}function OP(e){return e.length<2?e.join(""):`${e.slice(0,-1).join(", ")} or ${e[e.length-1]}`}function Cd({ignored:e}){const{theme:t}=Se.usePublisherTheme();if(e.length===0)return null;const n=e.length>EP?`Doesn't respond to ${e.length} filters`:`Doesn't respond to ${e.join(", ")}`;return f.jsxs(W.Box,{"data-testid":"tile-filter-tag",title:`This tile's query never reads ${OP(e)}, so changing ${e.length===1?"it":"them"} won't change this tile`,sx:{display:"inline-flex",alignItems:"center",gap:.5,maxWidth:"100%",mb:1,alignSelf:"flex-start",px:.75,py:.125,border:1,borderColor:"warning.main",borderRadius:1,fontSize:11,lineHeight:1.6,color:"warning.main",fontFamily:t.font.family},children:[f.jsx(IP,{sx:{fontSize:12}}),f.jsx(W.Box,{component:"span",sx:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:n})]})}function AP(e,t){if(e==="linear")return{layout:"linear",columns:1,widths:!1,insertBetween:!0};const n=t??Hh;return{layout:"grid",columns:n,widths:n>1,insertBetween:!1}}const Li=20,FP={radius:"8px",padding:`${Li}px`};function LP(e,t=FP){return{"--malloy-render--font-family":e.font.family,"--malloy-render--table-font-size":`${e.font.size}px`,"--malloy-render--table-header-color":e.tableHeader,"--malloy-render--table-body-color":e.tableBody,"--malloy-render--table-border":e.border,"--malloy-render--table-pinned-border":e.pinnedBorder,"--malloy-render--tile-background":e.tile,"--publisher-dashboard-root":e.dashboardRoot,"--malloy-render--label-color":e.tileTitle,"--malloy-render--value-color":e.valueColor,"--publisher-drill-link":e.drillLink,"--publisher-dashboard-card-radius":t.radius,"--publisher-dashboard-card-padding":t.padding,"--publisher-dashboard-card-border":e.cardBorder}}const Pd={query:120,text:72};function Ni({borderless:e=!1,chrome:t="card",kind:n="query",sx:r,cardRef:o,children:s}){const{theme:i}=Se.usePublisherTheme(),a=i.ui,l=e||t==="none";return f.jsx(W.Paper,{ref:o,className:$t.tile,elevation:0,"data-chrome":t,"data-tile-kind":n,sx:[{border:l?"none":i.cardBorder,borderRadius:l?0:a.radius.tile,background:l?"none":i.tile,overflow:"hidden",display:"flex",flexDirection:"column",minWidth:0,minHeight:t==="none"?0:Pd[n],p:t==="none"?0:e?"12px 0":`${Li}px`},...Array.isArray(r)?r:[r]],children:s})}const kd=$t.tileHeading;function Md({title:e,subtitle:t,tooltip:n,action:r,quiet:o=!1}){const{theme:s}=Se.usePublisherTheme(),i=s.ui;return f.jsxs(W.Box,{className:kd,sx:{pb:o?.5:1.5,display:"flex",alignItems:"flex-start",gap:1},children:[f.jsxs(W.Box,{sx:{minWidth:0,flex:1},children:[f.jsx(W.Typography,{component:"div",sx:{...i.type.tileTitle,display:"block",color:s.tileTitle,fontFamily:s.font.family},title:n,children:e}),t!==void 0&&f.jsx(W.Typography,{component:"div",sx:{...i.type.caption,display:"block",mt:"2px",color:s.tileTitle,fontFamily:s.font.family,opacity:.75},children:t})]}),r]})}const NP=-1;function jP(){const[e,t]=ee.useState(!1),n=ee.useRef(null);return{stickyRef:ee.useCallback(o=>{n.current?.disconnect(),n.current=null,!(!o||typeof IntersectionObserver>"u")&&(n.current=new IntersectionObserver(([s])=>{if(!s)return;const i=s.boundingClientRect.top<(s.rootBounds?.height??window.innerHeight)/2;t(s.intersectionRatio<1&&i)},{threshold:[1]}),n.current.observe(o))},[]),stuck:e}}const Td=4,BP=2;function VP({layout:e,notice:t,header:n,controls:r,children:o,sx:s}){return f.jsxs(W.Stack,{className:$t.report,"data-layout":e,sx:[{gap:BP},...Array.isArray(s)?s:[s]],children:[t,n,r,o]})}function zP({title:e,description:t,actions:n}){const r=Se.usePublisherTheme().theme.ui;return f.jsxs(W.Stack,{className:$t.header,sx:{gap:1.5},children:[f.jsxs(W.Stack,{direction:"row",sx:{alignItems:"center",gap:2},children:[f.jsx(W.Typography,{component:"h1",className:$t.title,sx:{...r.type.pageTitle,m:0,flex:1,minWidth:0},children:e}),n&&f.jsx(W.Box,{sx:{my:"-4px"},children:n})]}),t]})}function _P({sx:e,children:t}){return f.jsx(Ni,{chrome:"none",kind:"text",...e?{sx:e}:{},children:t})}function WP({children:e}){const{theme:t}=Se.usePublisherTheme(),{stickyRef:n,stuck:r}=jP();return f.jsx(W.Box,{ref:n,className:$t.filterRow,"data-stuck":r||void 0,sx:{position:"sticky",top:`${NP}px`,zIndex:Td,bgcolor:"background.default",pb:1,pt:1,mt:-1,boxShadow:r?`0 1px 0 ${Hn(t.cardBorder)}`:"none",transition:`box-shadow ${$r}`,...Or},children:e})}const Dd=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 s=r[o];s==="environments"?n.environmentName=decodeURI(r[o+1])||void 0:s==="packages"?n.packageName=decodeURI(r[o+1])||void 0:s==="connections"?n.connectionName=decodeURI(r[o+1])||void 0:s==="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},Rd=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 ji(e,t){if(e[t])return e;const n=e.default;return n?.[t]?n:e}const HP=e=>ji(e,"MalloyTranslator"),UP=e=>ji(e,"parseAnnotation"),YP=e=>ji(e,"ASTQuery");async function GP(){return HP(await import("@malloydata/malloy"))}async function qP(){return UP(await import("@malloydata/malloy-tag"))}async function KP(){return YP(await import("@malloydata/malloy-query-builder"))}async function XP(e){const t=await crypto.subtle.digest("SHA-256",new TextEncoder().encode(e));return Array.from(new Uint8Array(t),n=>n.toString(16).padStart(2,"0")).join("")}function QP(e){return e.find(t=>t.authoritative)??e.find(t=>t.writeable)}function Id({authoritative:e,mutable:t,versionId:n,canStore:r,readFailed:o}){const s=e?"host":t?"package":"browser",i=n!==void 0&&s==="package";return{savesTo:s,pinnedPackageSave:i,writer:o?void 0:e?r?"storage":void 0:i?void 0:t?"package":r?"storage":void 0}}async function ZP(e,t){return e??(t===void 0?void 0:await XP(t))}function JP({authoritative:e,mutable:t,pinnedPackageSave:n,workspace:r,readFailure:o,versionId:s}){return o!==void 0?`The saved copy could not be read, so Save is off: ${o}`:e&&r?r.writeable?r.description:`${r.description}: you cannot save into it.`:n?`Reading version ${s}: a version is a fixed point in history, so Save is off.`:t?"Save writes the file into the package.":r?`${r.description}: this server does not take writes.`:"This server does not take writes."}function ek(e){return e instanceof Error?e.message:String(e)}function tk(e){const t=e.response?.data;return t?.message?t.message:e instanceof Error?e.message:String(e)}async function nk({apiClients:e,queryClient:t,environmentName:n,packageName:r,modelPath:o,source:s,expectedHash:i,invalidateOnError:a,invalidate:l,afterWrite:c}){let u;try{u=await e.models.updateModelSource(n,r,o,{source:s,expectedHash:i})}catch(m){for(const b of a)t.invalidateQueries({queryKey:b});throw new Error(tk(m))}const p=u.data.contentHash;await c?.(p);for(const{queryKey:m,refetchType:b,wait:d}of l){const h=t.invalidateQueries({queryKey:m,...b?{refetchType:b}:{}});d&&await h}return p}function rk(e,t){return t===void 0||!/\.(saved|save_undone)$/.test(e.type)||e.where==="package"?e:{...e,workspace:t}}function ok(e){if(!("resourceUri"in e))return{environmentName:e.environmentName,packageName:e.packageName,versionId:void 0,namesBoth:!0};let t;try{t=Dd(e.resourceUri)}catch{t=void 0}return{environmentName:t?.environmentName??"",packageName:t?.packageName??"",versionId:t?.versionId,namesBoth:!!t?.environmentName&&!!t?.packageName}}class Ed extends Error{constructor(t){super(t),this.name="DocumentNotFoundError"}}const $d=e=>e instanceof Ed||e instanceof Error&&e.name==="DocumentNotFoundError",sk=String.raw`##?\|?[ \t]*(?:[([{<][ \t]*)?(?:(?:(?:row|source)[-_]?)?authorize|access[-_]?filter)(?=[)\]}>]|[ \t]|$)`;function Bi(e,t){if(/[\r\n]/.test(t))return`A ${e} is one line; it cannot hold a line break.`;if(new RegExp(sk,"iu").test(t))return`A ${e} cannot contain what reads as an access-control tag (authorize, row_authorize, source_authorize or access_filter).`}const sr=e=>Ns.isBareName(e)?e:`\`${e}\``;function Vi(e){const{title:t,modelPath:n,source:r,view:o}=e;if(t.trim()==="")return"A title cannot be empty.";const s=Bi("title",t);if(s)return s;if(t.includes("|##"))return"A title cannot contain `|##`, which closes the report's artifact tag.";if(/["\\\r\n]/.test(n)||n.trim()==="")return`The model path ${JSON.stringify(n)} cannot be written as an import.`;for(const[i,a]of[["source",r],["view",o]])if(a.trim()===""||/[`\r\n\\]/.test(a))return`The ${i} name ${JSON.stringify(a)} cannot be written as a Malloy name.`}const ik=e=>{const t=e.replace(/[-_]+/g," ").trim();return t.charAt(0).toUpperCase()+t.slice(1)},Il=e=>`"${e.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}"`,ak="report.malloy";function zi(e,t,n=ak){const r=Vi(e);if(r)throw new Error(r);const{modelPath:o,source:s,view:i}=e,a=e.title.trim(),l=Il(a),c=sr(`${s}_tiles`),u=sr(`${i}_tile`),p=`"${c} -> ${u}"`;return["##! experimental.givens",`##| artifact { layout=${t} title=${l}`," tiles=[",` ${p}`," ]",t==="grid"?"} dashboard { columns=12 }":"}","|##",`import { ${sr(s)} } from "${fc(o,n)}"`,"",`source: ${c} is ${sr(s)} extend {`,` # label=${Il(ik(i))}`,` view: ${u} is ${sr(i)}`,"}",""].join(`
|
|
137
|
+
`)}}const RP=ee.lazy(()=>Promise.resolve().then(()=>require("./RenderedResult-De51QvsZ.cjs.js")).then(e=>e.RenderedResult$1));function Sd({result:e,maxHeight:t,maxResultSize:n=0,renderLogs:r,drill:o,fill:s=!1}){const i=ee.useRef(null);ee.useEffect(()=>bd(),[]);const[a,l]=ee.useState(void 0),[c,u]=ee.useState(void 0),[p,m]=ee.useState(!1),[b,d]=ee.useState(void 0),h=DP(r),g=!!e;if(ee.useEffect(()=>{const P=i.current;if(!s||!P)return;const k=new ResizeObserver(([I])=>d(Math.round(I.contentRect.height)));return k.observe(P),()=>k.disconnect()},[s,g,p]),!e)return null;if(n>0&&e.length>n&&!p)return f.jsxs(W.Box,{sx:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:2,p:4,backgroundColor:"#fafafa",border:"1px solid",borderColor:"#e0e0e0",borderRadius:1},children:[f.jsx(fp.Warning,{sx:{fontSize:48,color:"#757575"}}),f.jsx(W.Typography,{variant:"h6",color:"text.secondary",align:"center",children:"Processing large results may cause browser performance issues. Proceed?"}),f.jsx(W.Button,{variant:"contained",color:"primary",onClick:()=>m(!0),children:"Proceed"})]});const C=f.jsx(Fi,{text:Co.loading,centered:!0,size:32}),S=Es({sizing:a,contentHeight:c,maxHeight:t,fillHeight:s?b:void 0}),x=f.jsx(ee.Suspense,{fallback:C,children:f.jsx(RP,{result:e,height:S,onSizeChange:u,onSizing:l,drill:o,fill:s})});return f.jsxs(W.Box,{ref:i,sx:{position:"relative",height:"auto",border:"0px",borderRadius:0,overflow:"hidden",...s&&{flex:`1 1 ${Es({sizing:a,contentHeight:c,maxHeight:t})}px`,minHeight:0}},children:[s?f.jsx(W.Box,{sx:{position:"absolute",inset:0},children:x}):x,h&&f.jsx(W.Box,{sx:{position:"absolute",top:4,right:4,zIndex:1},children:f.jsx(W.Tooltip,{title:h.title,slotProps:{tooltip:{sx:{whiteSpace:"pre-line"}}},children:f.jsx(xd,{"aria-label":"Render tag warnings",children:f.jsx(vd,{fontSize:"small",color:h.severity==="error"?"error":"warning"})})})})]})}function wd({state:e,context:t,loadingText:n=Co.running,maxHeight:r,maxResultSize:o,drill:s,fill:i,transform:a}){const{data:l,isSuccess:c,isError:u,error:p,fetchStatus:m,isPlaceholderData:b}=e,d=c||m==="fetching";ee.useEffect(()=>{d&&bd()},[d]);const h=l?.data.result,g=ee.useMemo(()=>h!==void 0&&a?a(h):h,[h,a]);if(u)return f.jsx(W.Box,{sx:{p:2},children:f.jsx(yc,{context:t,error:p})});if(!c)return f.jsx(Fi,{text:m==="idle"?Co.loading:n});const w=f.jsx(Sd,{result:g,maxHeight:r,maxResultSize:o,renderLogs:l.data.renderLogs,drill:s,fill:i});return f.jsxs(W.Box,{"aria-busy":b||void 0,sx:{position:"relative",display:"flex",flexDirection:"column",flex:"1 1 auto",minHeight:0,minWidth:0,...i?{height:"100%"}:{},"& > .result-body":{display:"flex",flexDirection:"column",flex:"1 1 auto",minHeight:0,minWidth:0,...i?{height:"100%"}:{},opacity:b?.55:1,transition:b?"opacity 160ms ease 200ms":"opacity 120ms ease","@media (prefers-reduced-motion: reduce)":{transition:"none"}}},children:[b&&f.jsx(W.LinearProgress,{"aria-label":n,sx:{position:"absolute",top:0,left:0,right:0,height:2,zIndex:1,bgcolor:"transparent",borderRadius:1}}),f.jsx(W.Box,{className:"result-body",children:w})]})}const $s=()=>typeof performance<"u"?performance.now():Date.now(),IP=$e(f.jsx("path",{d:"m16.95 6-3.57 4.55 1.43 1.43c1.03-1.31 4.98-6.37 4.98-6.37C20.3 4.95 19.83 4 19 4H6.83l2 2zM2.81 2.81 1.39 4.22 10 13v6c0 .55.45 1 1 1h2c.55 0 1-.45 1-1v-2.17l5.78 5.78 1.41-1.41z"})),EP=3;function $P(e,t){if(e===void 0)return[];const n=new Set(e);return t.flatMap(r=>r.name&&!n.has(r.name)?[r.label??r.name]:[])}function OP(e){return e.length<2?e.join(""):`${e.slice(0,-1).join(", ")} or ${e[e.length-1]}`}function Cd({ignored:e}){const{theme:t}=Se.usePublisherTheme();if(e.length===0)return null;const n=e.length>EP?`Doesn't respond to ${e.length} filters`:`Doesn't respond to ${e.join(", ")}`;return f.jsxs(W.Box,{"data-testid":"tile-filter-tag",title:`This tile's query never reads ${OP(e)}, so changing ${e.length===1?"it":"them"} won't change this tile`,sx:{display:"inline-flex",alignItems:"center",gap:.5,maxWidth:"100%",mb:1,alignSelf:"flex-start",px:.75,py:.125,border:1,borderColor:"warning.main",borderRadius:1,fontSize:11,lineHeight:1.6,color:"warning.main",fontFamily:t.font.family},children:[f.jsx(IP,{sx:{fontSize:12}}),f.jsx(W.Box,{component:"span",sx:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:n})]})}function AP(e,t){if(e==="linear")return{layout:"linear",columns:1,widths:!1,insertBetween:!0};const n=t??Hh;return{layout:"grid",columns:n,widths:n>1,insertBetween:!1}}const Li=20,FP={radius:"8px",padding:`${Li}px`};function LP(e,t=FP){return{"--malloy-render--font-family":e.font.family,"--malloy-render--table-font-size":`${e.font.size}px`,"--malloy-render--table-header-color":e.tableHeader,"--malloy-render--table-body-color":e.tableBody,"--malloy-render--table-border":e.border,"--malloy-render--table-pinned-border":e.pinnedBorder,"--malloy-render--tile-background":e.tile,"--publisher-dashboard-root":e.dashboardRoot,"--malloy-render--label-color":e.tileTitle,"--malloy-render--value-color":e.valueColor,"--publisher-drill-link":e.drillLink,"--publisher-dashboard-card-radius":t.radius,"--publisher-dashboard-card-padding":t.padding,"--publisher-dashboard-card-border":e.cardBorder}}const Pd={query:120,text:72};function Ni({borderless:e=!1,chrome:t="card",kind:n="query",sx:r,cardRef:o,children:s}){const{theme:i}=Se.usePublisherTheme(),a=i.ui,l=e||t==="none";return f.jsx(W.Paper,{ref:o,className:$t.tile,elevation:0,"data-chrome":t,"data-tile-kind":n,sx:[{border:l?"none":i.cardBorder,borderRadius:l?0:a.radius.tile,background:l?"none":i.tile,overflow:"hidden",display:"flex",flexDirection:"column",minWidth:0,minHeight:t==="none"?0:Pd[n],p:t==="none"?0:e?"12px 0":`${Li}px`},...Array.isArray(r)?r:[r]],children:s})}const kd=$t.tileHeading;function Md({title:e,subtitle:t,tooltip:n,action:r,quiet:o=!1}){const{theme:s}=Se.usePublisherTheme(),i=s.ui;return f.jsxs(W.Box,{className:kd,sx:{pb:o?.5:1.5,display:"flex",alignItems:"flex-start",gap:1},children:[f.jsxs(W.Box,{sx:{minWidth:0,flex:1},children:[f.jsx(W.Typography,{component:"div",sx:{...i.type.tileTitle,display:"block",color:s.tileTitle,fontFamily:s.font.family},title:n,children:e}),t!==void 0&&f.jsx(W.Typography,{component:"div",sx:{...i.type.caption,display:"block",mt:"2px",color:s.tileTitle,fontFamily:s.font.family,opacity:.75},children:t})]}),r]})}const NP=-1;function jP(){const[e,t]=ee.useState(!1),n=ee.useRef(null);return{stickyRef:ee.useCallback(o=>{n.current?.disconnect(),n.current=null,!(!o||typeof IntersectionObserver>"u")&&(n.current=new IntersectionObserver(([s])=>{if(!s)return;const i=s.boundingClientRect.top<(s.rootBounds?.height??window.innerHeight)/2;t(s.intersectionRatio<1&&i)},{threshold:[1]}),n.current.observe(o))},[]),stuck:e}}const Td=4,BP=2;function VP({layout:e,notice:t,header:n,controls:r,children:o,sx:s}){return f.jsxs(W.Stack,{className:$t.report,"data-layout":e,sx:[{gap:BP},...Array.isArray(s)?s:[s]],children:[t,n,r,o]})}function zP({title:e,description:t,actions:n}){const r=Se.usePublisherTheme().theme.ui;return f.jsxs(W.Stack,{className:$t.header,sx:{gap:1.5},children:[f.jsxs(W.Stack,{direction:"row",sx:{alignItems:"center",gap:2},children:[f.jsx(W.Typography,{component:"h1",className:$t.title,sx:{...r.type.pageTitle,m:0,flex:1,minWidth:0},children:e}),n&&f.jsx(W.Box,{sx:{my:"-4px"},children:n})]}),t]})}function _P({sx:e,children:t}){return f.jsx(Ni,{chrome:"none",kind:"text",...e?{sx:e}:{},children:t})}function WP({children:e}){const{theme:t}=Se.usePublisherTheme(),{stickyRef:n,stuck:r}=jP();return f.jsx(W.Box,{ref:n,className:$t.filterRow,"data-stuck":r||void 0,sx:{position:"sticky",top:`${NP}px`,zIndex:Td,bgcolor:"background.default",pb:1,pt:1,mt:-1,boxShadow:r?`0 1px 0 ${Hn(t.cardBorder)}`:"none",transition:`box-shadow ${$r}`,...Or},children:e})}const Dd=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 s=r[o];s==="environments"?n.environmentName=decodeURI(r[o+1])||void 0:s==="packages"?n.packageName=decodeURI(r[o+1])||void 0:s==="connections"?n.connectionName=decodeURI(r[o+1])||void 0:s==="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},Rd=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 ji(e,t){if(e[t])return e;const n=e.default;return n?.[t]?n:e}const HP=e=>ji(e,"MalloyTranslator"),UP=e=>ji(e,"parseAnnotation"),YP=e=>ji(e,"ASTQuery");async function GP(){return HP(await import("@malloydata/malloy"))}async function qP(){return UP(await import("@malloydata/malloy-tag"))}async function KP(){return YP(await import("@malloydata/malloy-query-builder"))}async function XP(e){const t=await crypto.subtle.digest("SHA-256",new TextEncoder().encode(e));return Array.from(new Uint8Array(t),n=>n.toString(16).padStart(2,"0")).join("")}function QP(e){return e.find(t=>t.authoritative)??e.find(t=>t.writeable)}function Id({authoritative:e,mutable:t,versionId:n,canStore:r,readFailed:o}){const s=e?"host":t?"package":"browser",i=n!==void 0&&s==="package";return{savesTo:s,pinnedPackageSave:i,writer:o?void 0:e?r?"storage":void 0:i?void 0:t?"package":r?"storage":void 0}}async function ZP(e,t){return e??(t===void 0?void 0:await XP(t))}function JP({authoritative:e,mutable:t,pinnedPackageSave:n,workspace:r,readFailure:o,versionId:s}){return o!==void 0?`The saved copy could not be read, so Save is off: ${o}`:e&&r?r.writeable?r.description:`${r.description}: you cannot save into it.`:n?`Reading version ${s}: a version is a fixed point in history, so Save is off.`:t?"Save writes the file into the package.":r?`${r.description}: this server does not take writes.`:"This server does not take writes."}function ek(e){return e instanceof Error?e.message:String(e)}function tk(e){const t=e.response?.data;return t?.message?t.message:e instanceof Error?e.message:String(e)}async function nk({apiClients:e,queryClient:t,environmentName:n,packageName:r,modelPath:o,source:s,expectedHash:i,invalidateOnError:a,invalidate:l,afterWrite:c}){let u;try{u=await e.models.updateModelSource(n,r,o,{source:s,expectedHash:i})}catch(m){for(const b of a)t.invalidateQueries({queryKey:b});throw new Error(tk(m))}const p=u.data.contentHash;await c?.(p);for(const{queryKey:m,refetchType:b,wait:d}of l){const h=t.invalidateQueries({queryKey:m,...b?{refetchType:b}:{}});d&&await h}return p}function rk(e,t){return t===void 0||!/\.(saved|save_undone)$/.test(e.type)||e.where==="package"?e:{...e,workspace:t}}function ok(e){if(!("resourceUri"in e))return{environmentName:e.environmentName,packageName:e.packageName,versionId:void 0,namesBoth:!0};let t;try{t=Dd(e.resourceUri)}catch{t=void 0}return{environmentName:t?.environmentName??"",packageName:t?.packageName??"",versionId:t?.versionId,namesBoth:!!t?.environmentName&&!!t?.packageName}}class Ed extends Error{constructor(t){super(t),this.name="DocumentNotFoundError"}}const $d=e=>e instanceof Ed||e instanceof Error&&e.name==="DocumentNotFoundError",sk=String.raw`##?\|?[ \t]*(?:[([{<][ \t]*)?(?:(?:(?:row|source)[-_]?)?authorize|access[-_]?filter)(?=[)\]}>]|[ \t]|$)`;function Bi(e,t){if(/[\r\n]/.test(t))return`A ${e} is one line; it cannot hold a line break.`;if(new RegExp(sk,"iu").test(t))return`A ${e} cannot contain what reads as an access-control tag (authorize, row_authorize, source_authorize or access_filter).`}const sr=e=>Ns.isBareName(e)?e:`\`${e}\``;function Vi(e){const{title:t,modelPath:n,source:r,view:o}=e;if(t.trim()==="")return"A title cannot be empty.";const s=Bi("title",t);if(s)return s;if(t.includes("|##"))return"A title cannot contain `|##`, which closes the report's artifact tag.";if(/["\\\r\n]/.test(n)||n.trim()==="")return`The model path ${JSON.stringify(n)} cannot be written as an import.`;for(const[i,a]of[["source",r],["view",o]])if(a.trim()===""||/[`\r\n\\]/.test(a))return`The ${i} name ${JSON.stringify(a)} cannot be written as a Malloy name.`}const ik=e=>{const t=e.replace(/[-_]+/g," ").trim();return t.charAt(0).toUpperCase()+t.slice(1)},Il=e=>`"${e.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}"`,ak="report.malloy";function zi(e,t,n=ak){const r=Vi(e);if(r)throw new Error(r);const{modelPath:o,source:s,view:i}=e,a=e.title.trim(),l=Il(a),c=sr(`${s}_tiles`),u=sr(`${i}_tile`),p=`"${c} -> ${u}"`;return["##! experimental.givens",`##| artifact { layout=${t} title=${l}`," tiles=[",` ${p}`," ]",t==="grid"?"} dashboard { columns=12 }":"}","|##",`import { ${sr(s)} } from "${fc(o,n)}"`,"",`source: ${c} is ${sr(s)} extend {`,` # label=${Il(ik(i))}`,` view: ${u} is ${sr(i)}`,"}",""].join(`
|
|
138
138
|
`)}function lk(e,t){return zi(e,"linear",t)}function Od(e){return e.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"").slice(0,80)}function ck({title:e,modelPath:t,source:n,view:r}){for(const[o,s]of[["source",n],["view",r]])if(!Ns.isBareName(s))return`The ${o} name ${JSON.stringify(s)} cannot be written as a Malloy name.`;return/["\\\r\n]/.test(t)?`The model path ${JSON.stringify(t)} cannot be written into an import.`:Bi("title",e)}function uk(e,t){const n=ck(e);if(n)throw new Error(n);return zi(e,"grid",t)}const Ad=e=>(e??"").trim().replace(/\\/g,"/").split("/").filter(t=>t!=="").join("/");function Fd(e,t){const n=Ad(t);return`${n===""?"":`${n}/`}${e}.malloy`}function Ld(e){return Od(e)||"untitled"}function Nd(e,t=1,n){const r=Ld(e);return Fd(t>1?`${r}-${t}`:r,n)}const jd=(e,t,n)=>`${e}/${t}/${n}`,Bd=(e,t,n,r,o)=>({workspace:t,type:e,path:jd(n,r,o)}),_i=20;function dk(e){const{savesTo:t,writer:n}=Id({...e,readFailed:!1});return t==="browser"?void 0:n}const El=e=>e.slice(e.lastIndexOf("/")+1).replace(/\.malloy$/,"");function Vd(e){if(!e.endsWith(".malloy"))return"A report's file name ends in .malloy.";const t=e.split("/");if(t.some(n=>n===""||n==="."||n===".."))return"A location is a path inside the package, such as sales/q3.malloy.";if(t.at(-1)===".malloy")return"A report's file needs a name.";if(t[0].toLowerCase()==="public")return"A report cannot live under public/, which is served as plain files.";if(e.toLowerCase()==="index.malloy")return"The package's index.malloy is its surface, never a report."}async function pk(e){const t=e.layout??"linear",n=$s();let r;try{r=await fk(e,t)}catch(o){throw ho({path:e.path??"",layout:t},e.onEvent).emit({type:"report.create_refused",reason:o instanceof Error?o.message:String(o)}),o}return ho({path:r.path,layout:t},e.onEvent).emit({type:"report.created",where:e.target.route==="package"?"package":"host",durationMs:$s()-n}),e.onCreated?.(r),r}async function fk(e,t){const{document:n,target:r}=e,o=Vi(n);if(o)throw new Error(o);const s=Ad(e.directory),i=e.path!==void 0?[e.path]:Array.from({length:_i},(h,g)=>Nd(n.title,g+1,s));for(const h of i){const g=Vd(h);if(g)throw new Error(g)}const a=h=>zi(n,t,h);if(r.route==="package"){const h=new Set(r.existing);let g;for(const w of i)if(!h.has(w))try{await r.write(w,a(w)),g=w;break}catch(C){if(!hk(C))throw C}if(g===void 0)throw $l(n.title,e.path);return{layout:t,path:g,slug:El(g)}}const{storage:l,workspace:c,environmentName:u,packageName:p}=r,m=new Set(r.existing),b=new Set((await l.listDocuments(c)).map(h=>h.path));let d;for(const h of i){const g=Bd(t,c.name,u,p,h),w=await l.resolveDocumentPath?.(g)??h;if(b.has(g.path)||m.has(h)||m.has(w))continue;let C=!0;try{await l.getDocument(g)}catch(S){if(!$d(S))throw S;C=!1}if(!C){d={layout:t,path:w,slug:El(w),locator:g};break}}if(d===void 0)throw $l(n.title,e.path);return await l.saveDocument(d.locator,a(d.path)),d}const hk=e=>e?.response?.status===409,$l=(e,t)=>new Error(t!==void 0?`${t} already exists. Fix: choose a different location.`:`No free file name for "${e}" after ${_i} tries. Fix: choose a different title.`);function zd(e){try{const t=JSON.parse(e??"");return new Set((t.entries??[]).flatMap(n=>n.kind==="source"&&typeof n.name=="string"?[n.name]:[]))}catch{return new Set}}const _d=["bar_chart","line_chart","scatter_chart","shape_map","segment_map","big_value","sparkline"],Wd=["line_chart","bar_chart","big_value","scatter_chart","shape_map","segment_map"],Hd=e=>Wd.includes(e),Os=new Set([..._d,"viz"]);function zr(e){const t=e.trim();if(!/^#[ \t]/.test(t)||/[{=]/.test(t))return;const n=t.slice(1).trim().split(/[ \t]+/),r=[];let o;for(const s of n)if(s.startsWith("-")){if(o!==void 0)return;const i=s.slice(1);if(!Os.has(i))return;r.push(i)}else{if(o!==void 0||!Os.has(s))return;o=s}return{negated:r,...o!==void 0&&{pick:o}}}function Wi(e){const t=e.trim();return!/^#[ \t]/.test(t)||zr(t)?!1:(t.replace(/"(?:[^"\\]|\\.)*"/g,'""').match(/[A-Za-z_]+/g)??[]).some(r=>Os.has(r))}function mk(e,t){return["#",...Wd.filter(r=>r!==e&&(t===void 0||t.includes(r))).map(r=>`-${r}`),"-viz",...e==="none"?[]:[e]].join(" ")}function gk(e){return e.pick!==void 0?Hd(e.pick)?e.pick:"custom":e.negated.includes("viz")?"none":"custom"}function yk(e){if(e.length===0)return"default";if(e.length>1)return"custom";const t=zr(e[0]);return t?gk(t):"custom"}function bk(e){const t=e.filter(n=>zr(n));return e.some(Wi)?"custom":t.length===0?void 0:yk(t)}const vk=e=>e.filter(t=>zr(t)||Wi(t));function As(e){for(const t of e??[]){const n=/^#\(doc\)\s*(.*)$/s.exec(t.trim());if(n)return n[1].trim()}}function Ud(e){for(const t of e??[]){const n=/^#\s*(?:-[A-Za-z_]+\s+)*([a-z_]+)/.exec(t.trim())?.[1];if(n&&_d.includes(n))return n}}function xk({environmentName:e,packageName:t,versionId:n,models:r,enabled:o}){const{apiClients:s,server:i}=Se.useServer(),a=Dr.useQueries({queries:r.map(d=>({queryKey:["new-document-model",e,t,n,d,i],queryFn:async()=>(await s.models.getModel(e,t,d,n)).data,enabled:o,retry:!1,staleTime:300*1e3,refetchOnWindowFocus:!1}))}),l=a.map(d=>d.dataUpdatedAt).join(),c=ee.useMemo(()=>{const d=new Map;return a.forEach((h,g)=>{const w=[],C=zd(h.data?.modelInfo);for(const S of h.data?.sources??[]){if(typeof S.name!="string"||!C.has(S.name))continue;const x=As(S.annotations);for(const P of S.views??[])if(typeof P.name=="string"){const k=As(P.annotations),I=Ud(P.annotations);w.push({source:S.name,view:P.name,...k?{description:k}:{},...I?{chart:I}:{},...x?{sourceDescription:x}:{}})}}w.length>0&&d.set(r[g],w)}),d},[l,r]),u=a.some(d=>d.isLoading),p=u?[]:r.filter((d,h)=>a[h]?.isError),m=!u&&a.some(d=>d.isError&&Ns.canRetryRequest(d.error)),b=()=>{a.forEach(d=>{d.isError&&d.refetch()})};return{choices:c,isLoading:u,isSuccess:a.length>0&&a.every(d=>!d.isPending),failed:p,retry:b,canRetry:m}}const Hi=ee.createContext(void 0);function Sk({children:e,documentStorage:t}){const n=ee.useMemo(()=>({documentStorage:t}),[t]);return f.jsx(Hi.Provider,{value:n,children:e})}function wk(){const e=ee.useContext(Hi);if(!e)throw new Error("useDocumentStorage must be used within a DocumentStorageProvider");return e}function Ck(){return ee.useContext(Hi)}function Pk(e,{environmentName:t,packageName:n,path:r,versionId:o},s){return{queryKey:["report",t,n,o,r],queryFn:async({signal:i})=>(await e.reports.getReport(t,n,r,o,{signal:i})).data,...s===void 0?{}:{staleTime:s}}}const kk=1e4,Mk=e=>e==="notebook"?"linear":"grid",Tk=(e,t)=>`${e}s/${t}.malloy`,Dk=/\.malloy(nb)?$/,Rk=e=>e&&e.slice(e.lastIndexOf("/")+1).replace(Dk,"")||void 0,Yd=e=>e.replace(/\.malloy$/,"").split("/").map(encodeURIComponent).join("/"),Gd=(e,t,n)=>`/${encodeURIComponent(e)}/${encodeURIComponent(t)}/${Yd(n)}`,qd="edit",Ik=(e,t,n)=>`${Gd(e,t,n)}?${qd}`,Kd=e=>e.layout==="linear"?"linear":"grid",Xd=e=>({layout:Kd(e),path:e.path,editable:e.editable!==!1});function Ui(e,t){const n=t.find(r=>r.path===e);return n?.path?Xd({...n,path:n.path}):void 0}function Qd(e){return e===""||e.startsWith("/")?!1:e.split("/").every(t=>t!==""&&t!=="."&&t!=="..")}function Ek(e,t){if(!Qd(e))return{kind:"unresolved"};for(const n of[`${e}.malloy`,e]){const r=Ui(n,t);if(r)return{kind:"path",report:r}}return{kind:"unresolved"}}function $k(e,t,n){return[["dashboards"],["notebooks"],["dashboard"],...n===void 0?[]:[[Rd({environmentName:e,packageName:t,modelPath:n})]]]}function Ok(e,t,n,r){for(const o of[["report"],["reports"],...$k(t,n,r)])e.invalidateQueries({queryKey:o})}const Ak=(e,t,n)=>["reports",e,t,n];async function Fk(e,t,n,r){try{return(await e.reports.listReports(t,n,r)).data}catch(o){if(o?.response?.status===404)return[];throw o}}function Zd(e,t,n,r=!0){const{apiClients:o}=Se.useServer(),s=Ko({queryKey:Ak(e,t,n),queryFn:()=>Fk(o,e,t,n),enabled:r,staleTime:6e4});return{reports:s.data??[],settled:s.isSuccess||s.isError,isFetching:s.isFetching,isError:s.isError,error:s.error,refetch:s.refetch}}function Lk(e,t,n,r){const{reports:o,settled:s}=Zd(e,t,r);return{settled:s,reports:o,location:s?Ui(n,o):void 0}}function Ko(e){const{server:t}=Se.useServer(),n={...e,queryKey:[...e.queryKey,t],queryFn:async r=>{try{return await e.queryFn(r)}catch(o){if(o&&typeof o=="object"&&"response"in o){const s=o;if(s.response?.data){const i=new Error(s.response.data.message||s.message);throw i.status=s.response.status,i.data=s.response.data,i}}throw o}},retry:!1,throwOnError:!1};return Dr.useQuery(n,Se.globalQueryClient)}function Nk(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 s=new Error(o.response.data.message||o.message);throw s.status=o.response.status,s.data=o.response.data,s}}throw r}},retry:!1,throwOnError:!1};return Dr.useMutation(t,Se.globalQueryClient)}function Jd(e){return["queryResult",e.environmentName,e.packageName,e.versionId,e.modelPath,e.queryName,e.query,e.sourceName,JSON.stringify(e.givens??{})]}function jk(e){return["queryResult",e.environmentName,e.packageName,e.versionId,e.modelPath]}function ep(e,{enabled:t=!0}={}){const{apiClients:n}=Se.useServer(),r=Jd(e);return Ko({queryKey:r,queryFn:({signal:o})=>n.models.executeQueryModel(e.environmentName,e.packageName,e.modelPath,{queryName:e.queryName,query:e.query,sourceName:e.sourceName,givens:e.givens,versionId:e.versionId},void 0,{signal:o}),enabled:t,placeholderData:(o,s)=>s&&Vk(s.queryKey,r)?Dr.keepPreviousData(o):void 0,...Se.CHART_RESULT_QUERY_OPTIONS})}const Bk=8;function Vk(e,t){return e.every((n,r)=>r===Bk||r>=t.length||n===t[r])}const zk=/<\/?[A-Za-z][^>]*>|<!--|<![A-Za-z]/;function tp(e){let t=!1;for(const[n,r]of Array.from(e.entries())){if(r.deleted)continue;if(n==="image"||n==="link"){e.delete(n),t=!0;continue}if(n==="label"){let s;try{s=e.text("label")}catch{s=void 0}if(s!==void 0&&zk.test(s)){e.delete("label"),t=!0;continue}}const o=Array.isArray(r.eq)?r.eq:[];for(const s of[r,...o])tp(s)&&(t=!0)}return t}function _k(e){const t=e.trim();if(!/^#(?:\||[ \t\r\n]|$)/.test(t))return e;if(t.includes("@env."))return"";let n;try{n=hp.parseAnnotation(t)}catch{return""}return n.log.length>0?"":tp(n.tag)?`${n.tag.toString()}
|
|
139
139
|
`:e}function Fs(e){if(Array.isArray(e)){for(const n of e)Fs(n);return}if(e===null||typeof e!="object")return;const t=e;for(const[n,r]of Object.entries(t))if(n==="annotations"&&Array.isArray(r))for(const o of r){const s=o;typeof s?.value=="string"&&(s.value=_k(s.value))}else Fs(r)}function np(e){let t;try{t=JSON.parse(e)}catch{return e}const n=JSON.stringify(t);Fs(t);const r=JSON.stringify(t);return r===n?e:r}const Wk=new Set(["bar_chart","line_chart","scatter_chart","shape_map","segment_map","point_map","big_value","sparkline","list","list_detail","dashboard","transpose","table","json","image","link","text"]),Hk={value:`# big_value
|
|
140
140
|
`},Uk=/^#\(malloy\)[\s\S]*\bcalculation\b/;function Yk(e){return e?e.kind==="measure"?!0:(e.annotations??[]).some(t=>typeof t?.value=="string"&&Uk.test(t.value.trim())):!1}function Gk(e){const t=e.schema?.fields;if(!Array.isArray(t)||t.length===0||!t.every(Yk))return!1;const n=e.data;return n?n.kind==="record_cell"?!0:n.kind==="array_cell"&&Array.isArray(n.array_value)&&n.array_value.length===1:!1}function qk(e){for(const t of e){const n=t.trim();if(!n.startsWith("#")||n.startsWith("#(")||n.startsWith('#"'))continue;const r=n.slice(1).replace(/"(?:[^"\\]|\\.)*"/g,'""');for(const o of r.split(/[\s{}=.,[\]]+/))if(Wk.has(o))return!0}return!1}function rp(e){let t;try{t=JSON.parse(e)}catch{return e}if(!t||typeof t!="object"||!Gk(t))return e;const n=Array.isArray(t.annotations)?t.annotations:[],r=n.map(o=>o?.value).filter(o=>typeof o=="string");return qk(r)?e:JSON.stringify({...t,annotations:[Hk,...n]})}const Kk=e=>np(rp(e));function Ls(e){const t=e.split("->").at(-1)?.trim()??e;return/^[A-Za-z_][\w-]*$/.test(t)?Tc(t):e}function Xk({environmentName:e,packageName:t,versionId:n,modelPath:r,queryName:o,tile:s,annotation:i,label:a,subtitle:l,heading:c,borderless:u,givens:p,hostGivens:m,declaredTypes:b,givenNames:d,height:h,maxResultSize:g,drill:w,onExplore:C,chrome:S="card",ignoredFilters:x,preamble:P,restricted:k,waitingFor:I,index:R}){const{theme:N}=Se.usePublisherTheme(),[F,E]=bm(),y=ep({environmentName:e,packageName:t,modelPath:r,versionId:n,queryName:o,query:s!==void 0?Js(P??"",`${i?`${i}
|
package/package.json
CHANGED
|
@@ -25,6 +25,7 @@ import {
|
|
|
25
25
|
attachedDatabaseConnectionFieldName,
|
|
26
26
|
attributesFieldName,
|
|
27
27
|
connectionFieldsByType,
|
|
28
|
+
typedConnectionConfig,
|
|
28
29
|
gcsAttachedDatabaseFields,
|
|
29
30
|
getAttachedDatabaseFields,
|
|
30
31
|
s3AttachedDatabaseFields,
|
|
@@ -345,6 +346,22 @@ export default function AddConnectionDialog({
|
|
|
345
346
|
);
|
|
346
347
|
}
|
|
347
348
|
}
|
|
349
|
+
} else if (type === "sqlserver") {
|
|
350
|
+
const requiredFields = ["server", "database", "user", "password"];
|
|
351
|
+
// A named instance is located through SQL Browser and the port is
|
|
352
|
+
// then not used; otherwise the driver needs one.
|
|
353
|
+
if (!connectionConfig.instanceName && !connectionConfig.port) {
|
|
354
|
+
throw new Error(
|
|
355
|
+
"Port is required unless an instance name is given",
|
|
356
|
+
);
|
|
357
|
+
}
|
|
358
|
+
for (const fieldName of requiredFields) {
|
|
359
|
+
if (!connectionConfig[fieldName]) {
|
|
360
|
+
throw new Error(
|
|
361
|
+
`${fields.find((f) => f.name === fieldName)?.label || fieldName} is required`,
|
|
362
|
+
);
|
|
363
|
+
}
|
|
364
|
+
}
|
|
348
365
|
} else if (type === "motherduck") {
|
|
349
366
|
if (!connectionConfig.accessToken) {
|
|
350
367
|
throw new Error("Access Token is required");
|
|
@@ -369,7 +386,10 @@ export default function AddConnectionDialog({
|
|
|
369
386
|
connectionPayload = {
|
|
370
387
|
name,
|
|
371
388
|
type,
|
|
372
|
-
[attributesFieldName[type]]:
|
|
389
|
+
[attributesFieldName[type]]: typedConnectionConfig(
|
|
390
|
+
type,
|
|
391
|
+
connectionConfig,
|
|
392
|
+
),
|
|
373
393
|
} satisfies Connection;
|
|
374
394
|
}
|
|
375
395
|
|
|
@@ -814,7 +834,19 @@ export default function AddConnectionDialog({
|
|
|
814
834
|
fullWidth
|
|
815
835
|
size="small"
|
|
816
836
|
required={field.required}
|
|
817
|
-
|
|
837
|
+
select={!!field.selectOptions}
|
|
838
|
+
defaultValue={
|
|
839
|
+
field.selectOptions
|
|
840
|
+
? field.selectOptions[0]?.value
|
|
841
|
+
: undefined
|
|
842
|
+
}
|
|
843
|
+
>
|
|
844
|
+
{field.selectOptions?.map((option) => (
|
|
845
|
+
<MenuItem key={option.value} value={option.value}>
|
|
846
|
+
{option.label}
|
|
847
|
+
</MenuItem>
|
|
848
|
+
))}
|
|
849
|
+
</TextField>
|
|
818
850
|
))
|
|
819
851
|
)}
|
|
820
852
|
</Stack>
|
|
@@ -26,6 +26,7 @@ import {
|
|
|
26
26
|
attachedDatabaseConnectionFieldName,
|
|
27
27
|
attributesFieldName,
|
|
28
28
|
connectionFieldsByType,
|
|
29
|
+
typedConnectionConfig,
|
|
29
30
|
gcsAttachedDatabaseFields,
|
|
30
31
|
getAttachedDatabaseFields,
|
|
31
32
|
s3AttachedDatabaseFields,
|
|
@@ -429,6 +430,22 @@ export default function EditConnectionDialog({
|
|
|
429
430
|
);
|
|
430
431
|
}
|
|
431
432
|
}
|
|
433
|
+
} else if (type === "sqlserver") {
|
|
434
|
+
const requiredFields = ["server", "database", "user"];
|
|
435
|
+
// A named instance is located through SQL Browser and the port is
|
|
436
|
+
// then not used; otherwise the driver needs one.
|
|
437
|
+
if (!connectionConfig.instanceName && !connectionConfig.port) {
|
|
438
|
+
throw new Error(
|
|
439
|
+
"Port is required unless an instance name is given",
|
|
440
|
+
);
|
|
441
|
+
}
|
|
442
|
+
for (const fieldName of requiredFields) {
|
|
443
|
+
if (!connectionConfig[fieldName]) {
|
|
444
|
+
throw new Error(
|
|
445
|
+
`${fields.find((f) => f.name === fieldName)?.label || fieldName} is required`,
|
|
446
|
+
);
|
|
447
|
+
}
|
|
448
|
+
}
|
|
432
449
|
} else if (type === "databricks") {
|
|
433
450
|
if (!connectionConfig.host) {
|
|
434
451
|
throw new Error("Host is required");
|
|
@@ -441,7 +458,10 @@ export default function EditConnectionDialog({
|
|
|
441
458
|
connectionPayload = {
|
|
442
459
|
name,
|
|
443
460
|
type,
|
|
444
|
-
[attributesFieldName[type]]:
|
|
461
|
+
[attributesFieldName[type]]: typedConnectionConfig(
|
|
462
|
+
type,
|
|
463
|
+
connectionConfig,
|
|
464
|
+
),
|
|
445
465
|
} satisfies Connection;
|
|
446
466
|
}
|
|
447
467
|
|
|
@@ -987,6 +1007,14 @@ export default function EditConnectionDialog({
|
|
|
987
1007
|
const isStored = withheldFields.has(
|
|
988
1008
|
`${attributesFieldName[type] ?? ""}.${field.name}`,
|
|
989
1009
|
);
|
|
1010
|
+
// A select shows the stored value as the option it
|
|
1011
|
+
// names (a boolean reads back as `true`/`false`), and
|
|
1012
|
+
// the first option when nothing is stored.
|
|
1013
|
+
const selectValue = field.selectOptions
|
|
1014
|
+
? existingValue === "" || existingValue === undefined
|
|
1015
|
+
? field.selectOptions[0]?.value
|
|
1016
|
+
: String(existingValue)
|
|
1017
|
+
: undefined;
|
|
990
1018
|
return (
|
|
991
1019
|
<TextField
|
|
992
1020
|
key={field.name}
|
|
@@ -1001,7 +1029,12 @@ export default function EditConnectionDialog({
|
|
|
1001
1029
|
!isPasswordField &&
|
|
1002
1030
|
!existingValue
|
|
1003
1031
|
}
|
|
1004
|
-
|
|
1032
|
+
select={!!field.selectOptions}
|
|
1033
|
+
defaultValue={
|
|
1034
|
+
field.selectOptions
|
|
1035
|
+
? selectValue
|
|
1036
|
+
: existingValue
|
|
1037
|
+
}
|
|
1005
1038
|
placeholder={
|
|
1006
1039
|
isStored
|
|
1007
1040
|
? "Leave empty to keep existing"
|
|
@@ -1014,7 +1047,16 @@ export default function EditConnectionDialog({
|
|
|
1014
1047
|
: "No value stored."
|
|
1015
1048
|
: undefined
|
|
1016
1049
|
}
|
|
1017
|
-
|
|
1050
|
+
>
|
|
1051
|
+
{field.selectOptions?.map((option) => (
|
|
1052
|
+
<MenuItem
|
|
1053
|
+
key={option.value}
|
|
1054
|
+
value={option.value}
|
|
1055
|
+
>
|
|
1056
|
+
{option.label}
|
|
1057
|
+
</MenuItem>
|
|
1058
|
+
))}
|
|
1059
|
+
</TextField>
|
|
1018
1060
|
);
|
|
1019
1061
|
})
|
|
1020
1062
|
)}
|