@malloy-publisher/sdk 0.2.6 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (100) hide show
  1. package/README.md +172 -204
  2. package/dist/ServerProvider-CGnLjzag.cjs.js +1 -0
  3. package/dist/{ServerProvider-ksC5Su_x.es.js → ServerProvider-DSK9rfSY.es.js} +245 -245
  4. package/dist/client/api.d.ts +13 -1
  5. package/dist/client/index.cjs.js +1 -1
  6. package/dist/client/index.es.js +1 -1
  7. package/dist/components/ApiErrorDisplay.d.ts +1 -2
  8. package/dist/components/Dashboard/Dashboard.d.ts +4 -2
  9. package/dist/components/Dashboard/promoteMeasureRow.d.ts +36 -0
  10. package/dist/components/DocumentStorage/BrowserDocumentStorage.d.ts +14 -0
  11. package/dist/components/DocumentStorage/DocumentStorage.d.ts +58 -0
  12. package/dist/components/DocumentStorage/DocumentStorageProvider.d.ts +18 -0
  13. package/dist/components/DocumentStorage/index.d.ts +3 -0
  14. package/dist/components/Model/index.d.ts +0 -1
  15. package/dist/components/RenderedResult/RenderedResult.d.ts +12 -0
  16. package/dist/components/RenderedResult/ResultContainer.d.ts +7 -1
  17. package/dist/components/RenderedResult/index.d.ts +1 -0
  18. package/dist/components/RenderedResult/resultSizing.d.ts +183 -0
  19. package/dist/components/drill/index.d.ts +1 -0
  20. package/dist/components/drill/useDrillSelf.d.ts +46 -0
  21. package/dist/components/given/filterValue.d.ts +63 -0
  22. package/dist/components/given/index.d.ts +1 -0
  23. package/dist/components/given/useGivenUrlParams.d.ts +39 -0
  24. package/dist/components/index.d.ts +2 -3
  25. package/dist/components/styles.d.ts +3 -3
  26. package/dist/core-8NVBCLZh.cjs.js +148 -0
  27. package/dist/{core-xdZbLgaF.es.js → core-B8oMW4sm.es.js} +3540 -2335
  28. package/dist/hooks/index.d.ts +1 -1
  29. package/dist/hooks/useSuggestOptions.d.ts +28 -12
  30. package/dist/index.cjs.js +281 -1
  31. package/dist/index.es.js +45803 -79
  32. package/dist/sdk.css +1 -1
  33. package/dist/styles.css +0 -1
  34. package/package.json +2 -6
  35. package/src/components/ApiErrorDisplay.tsx +1 -1
  36. package/src/components/Connections/EditConnectionDialog.tsx +96 -86
  37. package/src/components/Dashboard/Dashboard.tsx +60 -95
  38. package/src/components/Dashboard/DashboardTile.tsx +25 -2
  39. package/src/components/Dashboard/promoteMeasureRow.spec.ts +137 -0
  40. package/src/components/Dashboard/promoteMeasureRow.ts +129 -0
  41. package/src/components/DocumentStorage/BrowserDocumentStorage.spec.ts +81 -0
  42. package/src/components/DocumentStorage/BrowserDocumentStorage.ts +105 -0
  43. package/src/components/DocumentStorage/DocumentStorage.ts +73 -0
  44. package/src/components/DocumentStorage/DocumentStorageProvider.tsx +46 -0
  45. package/src/components/DocumentStorage/index.ts +15 -0
  46. package/src/components/Environment/Connections.tsx +15 -15
  47. package/src/components/Model/ModelCell.tsx +2 -1
  48. package/src/components/Model/index.ts +0 -1
  49. package/src/components/Notebook/Notebook.tsx +10 -76
  50. package/src/components/Notebook/NotebookCell.tsx +2 -8
  51. package/src/components/RenderedResult/RenderedResult.tsx +86 -76
  52. package/src/components/RenderedResult/ResultContainer.tsx +21 -24
  53. package/src/components/RenderedResult/index.ts +15 -0
  54. package/src/components/RenderedResult/resultSizing.spec.ts +249 -0
  55. package/src/components/RenderedResult/resultSizing.ts +308 -0
  56. package/src/components/ResultsDialog.tsx +2 -1
  57. package/src/components/drill/index.ts +5 -0
  58. package/src/components/drill/useDrillSelf.spec.tsx +64 -0
  59. package/src/components/drill/useDrillSelf.ts +110 -0
  60. package/src/components/given/GivenInput.spec.tsx +196 -2
  61. package/src/components/given/GivenInput.tsx +300 -25
  62. package/src/components/given/filterValue.spec.ts +112 -0
  63. package/src/components/given/filterValue.ts +188 -0
  64. package/src/components/given/index.ts +4 -0
  65. package/src/components/given/useGivenUrlParams.spec.tsx +74 -0
  66. package/src/components/given/useGivenUrlParams.ts +87 -0
  67. package/src/components/index.ts +5 -3
  68. package/src/hooks/index.ts +0 -1
  69. package/src/hooks/useGivensState.spec.ts +158 -0
  70. package/src/hooks/useGivensState.ts +114 -23
  71. package/src/hooks/useSuggestOptions.dom.spec.ts +60 -1
  72. package/src/hooks/useSuggestOptions.ts +94 -51
  73. package/vite.config.ts +0 -1
  74. package/dist/ServerProvider-xXW1HJOJ.cjs.js +0 -1
  75. package/dist/components/AnalyzePackageButton.d.ts +0 -6
  76. package/dist/components/Workbook/BrowserWorkbookStorage.d.ts +0 -9
  77. package/dist/components/Workbook/EditableMalloyCell.d.ts +0 -11
  78. package/dist/components/Workbook/ModelPicker.d.ts +0 -11
  79. package/dist/components/Workbook/MutableCell.d.ts +0 -17
  80. package/dist/components/Workbook/Workbook.d.ts +0 -7
  81. package/dist/components/Workbook/WorkbookList.d.ts +0 -7
  82. package/dist/components/Workbook/WorkbookManager.d.ts +0 -84
  83. package/dist/components/Workbook/WorkbookStorage.d.ts +0 -17
  84. package/dist/components/Workbook/WorkbookStorageProvider.d.ts +0 -12
  85. package/dist/components/Workbook/index.d.ts +0 -7
  86. package/dist/core-RvrkY1Ss.cjs.js +0 -148
  87. package/dist/index-B3scIDRd.cjs.js +0 -356
  88. package/dist/index-Bda7HuZc.es.js +0 -66409
  89. package/dist/markdown-editor.css +0 -341
  90. package/src/components/AnalyzePackageButton.tsx +0 -319
  91. package/src/components/Workbook/BrowserWorkbookStorage.ts +0 -64
  92. package/src/components/Workbook/EditableMalloyCell.tsx +0 -49
  93. package/src/components/Workbook/ModelPicker.tsx +0 -134
  94. package/src/components/Workbook/MutableCell.tsx +0 -458
  95. package/src/components/Workbook/Workbook.tsx +0 -501
  96. package/src/components/Workbook/WorkbookList.tsx +0 -110
  97. package/src/components/Workbook/WorkbookManager.ts +0 -214
  98. package/src/components/Workbook/WorkbookStorage.ts +0 -35
  99. package/src/components/Workbook/WorkbookStorageProvider.tsx +0 -40
  100. package/src/components/Workbook/index.ts +0 -10
package/dist/index.cjs.js CHANGED
@@ -1 +1,281 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-B3scIDRd.cjs.js"),r=require("./ServerProvider-xXW1HJOJ.cjs.js");exports.AnalyzePackageButton=e.AnalyzePackageButton;exports.BrowserWorkbookStorage=e.BrowserWorkbookStorage;exports.ConnectionExplorer=e.ConnectionExplorer;exports.DOC_LINKS=e.DOC_LINKS;exports.DRILL_CELL_CLASS=e.DRILL_CELL_CLASS;exports.DRILL_SELF=e.DRILL_SELF;exports.Dashboard=e.Dashboard;exports.DashboardTile=e.DashboardTile;exports.DataAppViewer=e.DataAppViewer;exports.DimensionFilter=e.DimensionFilter;exports.EmbeddedQueryResult=e.EmbeddedQueryResult;exports.Environment=e.Environment;exports.EnvironmentMaterializations=e.EnvironmentMaterializations;exports.GivenInput=e.GivenInput;exports.GivensPanel=e.GivensPanel;exports.Home=e.Home;exports.Loading=e.Loading;exports.Materializations=e.Materializations;exports.Model=e.Model;exports.ModelExplorer=e.ModelExplorer;exports.ModelExplorerDialog=e.ModelExplorerDialog;exports.Models=e.Models;exports.Notebook=e.Notebook;exports.Package=e.Package;exports.Packages=e.Packages;exports.QueryResult=e.QueryResult;exports.RenderedResult=e.RenderedResult;exports.ResultContainer=e.ResultContainer;exports.SourceExplorerComponent=e.SourceExplorerComponent;exports.SourcesExplorer=e.SourcesExplorer;exports.Workbook=e.Workbook;exports.WorkbookList=e.WorkbookList;exports.WorkbookManager=e.WorkbookManager;exports.WorkbookStorageProvider=e.WorkbookStorageProvider;exports.buildMalloyExplicitTheme=e.buildMalloyExplicitTheme;exports.buildTableCssVars=e.buildTableCssVars;exports.buildVegaThemeOverride=e.buildVegaThemeOverride;exports.createEmbeddedQueryResult=e.createEmbeddedQueryResult;exports.drillDestinations=e.drillDestinations;exports.drillValueToFilter=e.drillValueToFilter;exports.drillableFieldNames=e.drillableFieldNames;exports.encodeDrillValue=e.encodeDrillValue;exports.encodeResourceUri=e.encodeResourceUri;exports.extractDimensionSpecs=e.extractDimensionSpecs;exports.extractSourceFromQuery=e.extractSourceFromQuery;exports.generateFilterClause=e.generateFilterClause;exports.getDimensionKey=e.getDimensionKey;exports.getJoinedSources=e.getJoinedSources;exports.humanizeSlug=e.humanizeSlug;exports.injectWhereClause=e.injectWhereClause;exports.makeDimensionKey=e.makeDimensionKey;exports.markDrillableCells=e.markDrillableCells;exports.packageFileUrl=e.packageFileUrl;exports.parseAllSourceInfos=e.parseAllSourceInfos;exports.parseDimensionFilterAnnotation=e.parseDimensionFilterAnnotation;exports.parseNotebookFilterAnnotation=e.parseNotebookFilterAnnotation;exports.parseResourceUri=e.parseResourceUri;exports.readChartAnnotations=e.readChartAnnotations;exports.resolveDrill=e.resolveDrill;exports.useDimensionFilters=e.useDimensionFilters;exports.useDimensionFiltersFromSpec=e.useDimensionFiltersFromSpec;exports.useDimensionFiltersQuery=e.useDimensionFiltersQuery;exports.useDimensionalFilterRangeData=e.useDimensionalFilterRangeData;exports.useDrill=e.useDrill;exports.useGivensState=e.useGivensState;exports.useModelData=e.useModelData;exports.useModelGivens=e.useModelGivens;exports.useRawQueryData=e.useRawQueryData;exports.useRouterClickHandler=e.useRouterClickHandler;exports.useSuggestOptions=e.useSuggestOptions;exports.DEFAULT_THEME=r.DEFAULT_THEME;exports.ServerProvider=r.ServerProvider;exports.ThemeProvider=r.ThemeProvider;exports.resolveMode=r.resolveMode;exports.resolveTheme=r.resolveTheme;exports.usePublisherTheme=r.usePublisherTheme;exports.useServer=r.useServer;
1
+ "use strict";var vb=Object.create;var pd=Object.defineProperty;var Sb=Object.getOwnPropertyDescriptor;var Cb=Object.getOwnPropertyNames;var wb=Object.getPrototypeOf,kb=Object.prototype.hasOwnProperty;var Tb=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of Cb(t))!kb.call(e,o)&&o!==n&&pd(e,o,{get:()=>t[o],enumerable:!(r=Sb(t,o))||r.enumerable});return e};var vs=(e,t,n)=>(n=e!=null?vb(wb(e)):{},Tb(t||!e||!e.__esModule?pd(n,"default",{value:e,enumerable:!0}):n,e));Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("react/jsx-runtime"),I=require("@mui/material"),Y=require("react"),Rn=require("@tanstack/react-query"),xe=require("./ServerProvider-CGnLjzag.cjs.js"),st=require("@mui/system"),Ib=require("@emotion/styled"),Mb=require("@emotion/react"),pa=require("markdown-to-jsx"),ln=require("@mui/icons-material"),zs=require("react-dom"),jn=require("@malloydata/malloy-filter"),Lf=require("@react-spring/web"),Zi=require("react-router-dom");function Bf(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 D=Bf(Y),Db=Bf(zs);function _t({error:e,context:t}){const n=e.data?.message||"Unknown Error";return a.jsxs(a.Fragment,{children:[t&&a.jsx(I.Typography,{variant:"body2",sx:{p:"10px",m:"auto"},children:t}),a.jsx("pre",{style:{whiteSpace:"pre-wrap",color:"red",padding:"10px",margin:"auto"},children:n})]})}function Pb(){const e=Zi.useNavigate();return(t,n)=>{if(!n||!n.metaKey&&!n.ctrlKey&&!n.shiftKey&&n.button!==1){e(t);return}const r=new URL(t,window.location.href).href;(n.metaKey||n.ctrlKey||n.button===1||n.shiftKey)&&window.open(r,"_blank")}}function Sr(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function Eb(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 Xi={exports:{}},Ob=Xi.exports,fd;function Rb(){return fd||(fd=1,(function(e,t){(function(n,r){e.exports=r()})(Ob,(function(){var n=1e3,r=6e4,o=36e5,s="millisecond",i="second",l="minute",c="hour",u="day",d="week",f="month",m="quarter",h="year",g="date",y="Invalid Date",b=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,x=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,C={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(A){var $=["th","st","nd","rd"],R=A%100;return"["+A+($[(R-20)%10]||$[R]||$[0])+"]"}},T=function(A,$,R){var _=String(A);return!_||_.length>=$?A:""+Array($+1-_.length).join(R)+A},w={s:T,z:function(A){var $=-A.utcOffset(),R=Math.abs($),_=Math.floor(R/60),z=R%60;return($<=0?"+":"-")+T(_,2,"0")+":"+T(z,2,"0")},m:function A($,R){if($.date()<R.date())return-A(R,$);var _=12*(R.year()-$.year())+(R.month()-$.month()),z=$.clone().add(_,f),W=R-z<0,H=$.clone().add(_+(W?-1:1),f);return+(-(_+(R-z)/(W?z-H:H-z))||0)},a:function(A){return A<0?Math.ceil(A)||0:Math.floor(A)},p:function(A){return{M:f,y:h,w:d,d:u,D:g,h:c,m:l,s:i,ms:s,Q:m}[A]||String(A||"").toLowerCase().replace(/s$/,"")},u:function(A){return A===void 0}},M="en",E={};E[M]=C;var j="$isDayjsObject",F=function(A){return A instanceof v||!(!A||!A[j])},O=function A($,R,_){var z;if(!$)return M;if(typeof $=="string"){var W=$.toLowerCase();E[W]&&(z=W),R&&(E[W]=R,z=W);var H=$.split("-");if(!z&&H.length>1)return A(H[0])}else{var G=$.name;E[G]=$,z=G}return!_&&z&&(M=z),z||!_&&M},V=function(A,$){if(F(A))return A.clone();var R=typeof $=="object"?$:{};return R.date=A,R.args=arguments,new v(R)},L=w;L.l=O,L.i=F,L.w=function(A,$){return V(A,{locale:$.$L,utc:$.$u,x:$.$x,$offset:$.$offset})};var v=(function(){function A(R){this.$L=O(R.locale,null,!0),this.parse(R),this.$x=this.$x||R.x||{},this[j]=!0}var $=A.prototype;return $.parse=function(R){this.$d=(function(_){var z=_.date,W=_.utc;if(z===null)return new Date(NaN);if(L.u(z))return new Date;if(z instanceof Date)return new Date(z);if(typeof z=="string"&&!/Z$/i.test(z)){var H=z.match(b);if(H){var G=H[2]-1||0,se=(H[7]||"0").substring(0,3);return W?new Date(Date.UTC(H[1],G,H[3]||1,H[4]||0,H[5]||0,H[6]||0,se)):new Date(H[1],G,H[3]||1,H[4]||0,H[5]||0,H[6]||0,se)}}return new Date(z)})(R),this.init()},$.init=function(){var R=this.$d;this.$y=R.getFullYear(),this.$M=R.getMonth(),this.$D=R.getDate(),this.$W=R.getDay(),this.$H=R.getHours(),this.$m=R.getMinutes(),this.$s=R.getSeconds(),this.$ms=R.getMilliseconds()},$.$utils=function(){return L},$.isValid=function(){return this.$d.toString()!==y},$.isSame=function(R,_){var z=V(R);return this.startOf(_)<=z&&z<=this.endOf(_)},$.isAfter=function(R,_){return V(R)<this.startOf(_)},$.isBefore=function(R,_){return this.endOf(_)<V(R)},$.$g=function(R,_,z){return L.u(R)?this[_]:this.set(z,R)},$.unix=function(){return Math.floor(this.valueOf()/1e3)},$.valueOf=function(){return this.$d.getTime()},$.startOf=function(R,_){var z=this,W=!!L.u(_)||_,H=L.p(R),G=function(te,Z){var J=L.w(z.$u?Date.UTC(z.$y,Z,te):new Date(z.$y,Z,te),z);return W?J:J.endOf(u)},se=function(te,Z){return L.w(z.toDate()[te].apply(z.toDate("s"),(W?[0,0,0,0]:[23,59,59,999]).slice(Z)),z)},pe=this.$W,me=this.$M,X=this.$D,K="set"+(this.$u?"UTC":"");switch(H){case h:return W?G(1,0):G(31,11);case f:return W?G(1,me):G(0,me+1);case d:var le=this.$locale().weekStart||0,oe=(pe<le?pe+7:pe)-le;return G(W?X-oe:X+(6-oe),me);case u:case g:return se(K+"Hours",0);case c:return se(K+"Minutes",1);case l:return se(K+"Seconds",2);case i:return se(K+"Milliseconds",3);default:return this.clone()}},$.endOf=function(R){return this.startOf(R,!1)},$.$set=function(R,_){var z,W=L.p(R),H="set"+(this.$u?"UTC":""),G=(z={},z[u]=H+"Date",z[g]=H+"Date",z[f]=H+"Month",z[h]=H+"FullYear",z[c]=H+"Hours",z[l]=H+"Minutes",z[i]=H+"Seconds",z[s]=H+"Milliseconds",z)[W],se=W===u?this.$D+(_-this.$W):_;if(W===f||W===h){var pe=this.clone().set(g,1);pe.$d[G](se),pe.init(),this.$d=pe.set(g,Math.min(this.$D,pe.daysInMonth())).$d}else G&&this.$d[G](se);return this.init(),this},$.set=function(R,_){return this.clone().$set(R,_)},$.get=function(R){return this[L.p(R)]()},$.add=function(R,_){var z,W=this;R=Number(R);var H=L.p(_),G=function(me){var X=V(W);return L.w(X.date(X.date()+Math.round(me*R)),W)};if(H===f)return this.set(f,this.$M+R);if(H===h)return this.set(h,this.$y+R);if(H===u)return G(1);if(H===d)return G(7);var se=(z={},z[l]=r,z[c]=o,z[i]=n,z)[H]||1,pe=this.$d.getTime()+R*se;return L.w(pe,this)},$.subtract=function(R,_){return this.add(-1*R,_)},$.format=function(R){var _=this,z=this.$locale();if(!this.isValid())return z.invalidDate||y;var W=R||"YYYY-MM-DDTHH:mm:ssZ",H=L.z(this),G=this.$H,se=this.$m,pe=this.$M,me=z.weekdays,X=z.months,K=z.meridiem,le=function(Z,J,ae,Q){return Z&&(Z[J]||Z(_,W))||ae[J].slice(0,Q)},oe=function(Z){return L.s(G%12||12,Z,"0")},te=K||function(Z,J,ae){var Q=Z<12?"AM":"PM";return ae?Q.toLowerCase():Q};return W.replace(x,(function(Z,J){return J||(function(ae){switch(ae){case"YY":return String(_.$y).slice(-2);case"YYYY":return L.s(_.$y,4,"0");case"M":return pe+1;case"MM":return L.s(pe+1,2,"0");case"MMM":return le(z.monthsShort,pe,X,3);case"MMMM":return le(X,pe);case"D":return _.$D;case"DD":return L.s(_.$D,2,"0");case"d":return String(_.$W);case"dd":return le(z.weekdaysMin,_.$W,me,2);case"ddd":return le(z.weekdaysShort,_.$W,me,3);case"dddd":return me[_.$W];case"H":return String(G);case"HH":return L.s(G,2,"0");case"h":return oe(1);case"hh":return oe(2);case"a":return te(G,se,!0);case"A":return te(G,se,!1);case"m":return String(se);case"mm":return L.s(se,2,"0");case"s":return String(_.$s);case"ss":return L.s(_.$s,2,"0");case"SSS":return L.s(_.$ms,3,"0");case"Z":return H}return null})(Z)||H.replace(":","")}))},$.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},$.diff=function(R,_,z){var W,H=this,G=L.p(_),se=V(R),pe=(se.utcOffset()-this.utcOffset())*r,me=this-se,X=function(){return L.m(H,se)};switch(G){case h:W=X()/12;break;case f:W=X();break;case m:W=X()/3;break;case d:W=(me-pe)/6048e5;break;case u:W=(me-pe)/864e5;break;case c:W=me/o;break;case l:W=me/r;break;case i:W=me/n;break;default:W=me}return z?W:L.a(W)},$.daysInMonth=function(){return this.endOf(f).$D},$.$locale=function(){return E[this.$L]},$.locale=function(R,_){if(!R)return this.$L;var z=this.clone(),W=O(R,_,!0);return W&&(z.$L=W),z},$.clone=function(){return L.w(this.$d,this)},$.toDate=function(){return new Date(this.valueOf())},$.toJSON=function(){return this.isValid()?this.toISOString():null},$.toISOString=function(){return this.$d.toISOString()},$.toString=function(){return this.$d.toUTCString()},A})(),N=v.prototype;return V.prototype=N,[["$ms",s],["$s",i],["$m",l],["$H",c],["$W",u],["$M",f],["$y",h],["$D",g]].forEach((function(A){N[A[1]]=function($){return this.$g($,A[0],A[1])}})),V.extend=function(A,$){return A.$i||(A($,v,V),A.$i=!0),V},V.locale=O,V.isDayjs=F,V.unix=function(A){return V(1e3*A)},V.en=E[M],V.Ls=E,V.p={},V}))})(Xi)),Xi.exports}var jb=Rb();const Je=Sr(jb);var Qi={exports:{}},$b=Qi.exports,hd;function Ab(){return hd||(hd=1,(function(e,t){(function(n,r){e.exports=r()})($b,(function(){var n="minute",r=/[+-]\d\d(?::?\d\d)?/g,o=/([+-]|\d\d)/g;return function(s,i,l){var c=i.prototype;l.utc=function(y){var b={date:y,utc:!0,args:arguments};return new i(b)},c.utc=function(y){var b=l(this.toDate(),{locale:this.$L,utc:!0});return y?b.add(this.utcOffset(),n):b},c.local=function(){return l(this.toDate(),{locale:this.$L,utc:!1})};var u=c.parse;c.parse=function(y){y.utc&&(this.$u=!0),this.$utils().u(y.$offset)||(this.$offset=y.$offset),u.call(this,y)};var d=c.init;c.init=function(){if(this.$u){var y=this.$d;this.$y=y.getUTCFullYear(),this.$M=y.getUTCMonth(),this.$D=y.getUTCDate(),this.$W=y.getUTCDay(),this.$H=y.getUTCHours(),this.$m=y.getUTCMinutes(),this.$s=y.getUTCSeconds(),this.$ms=y.getUTCMilliseconds()}else d.call(this)};var f=c.utcOffset;c.utcOffset=function(y,b){var x=this.$utils().u;if(x(y))return this.$u?0:x(this.$offset)?f.call(this):this.$offset;if(typeof y=="string"&&(y=(function(M){M===void 0&&(M="");var E=M.match(r);if(!E)return null;var j=(""+E[0]).match(o)||["-",0,0],F=j[0],O=60*+j[1]+ +j[2];return O===0?0:F==="+"?O:-O})(y),y===null))return this;var C=Math.abs(y)<=16?60*y:y;if(C===0)return this.utc(b);var T=this.clone();if(b)return T.$offset=C,T.$u=!1,T;var w=this.$u?this.toDate().getTimezoneOffset():-1*this.utcOffset();return(T=this.local().add(C+w,n)).$offset=C,T.$x.$localOffset=w,T};var m=c.format;c.format=function(y){var b=y||(this.$u?"YYYY-MM-DDTHH:mm:ss[Z]":"");return m.call(this,b)},c.valueOf=function(){var y=this.$utils().u(this.$offset)?0:this.$offset+(this.$x.$localOffset||this.$d.getTimezoneOffset());return this.$d.valueOf()-6e4*y},c.isUTC=function(){return!!this.$u},c.toISOString=function(){return this.toDate().toISOString()},c.toString=function(){return this.toDate().toUTCString()};var h=c.toDate;c.toDate=function(y){return y==="s"&&this.$offset?l(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate():h.call(this)};var g=c.diff;c.diff=function(y,b,x){if(y&&this.$u===y.$u)return g.call(this,y,b,x);var C=this.local(),T=l(y).local();return g.call(C,T,b,x)}}}))})(Qi)),Qi.exports}var Fb=Ab();const gc=Sr(Fb);Je.extend(gc);function Qr(e){return(e??"").startsWith("filter<")}function Ks(e){const t=/^filter<(.+)>$/.exec(e??"");return t?t[1]:void 0}function yc(e){const t=e.filter(n=>n.trim()!=="");return t.length===0?"":jn.StringFilterExpression.unparse({operator:"=",values:[...t]})}function Nb(e){if(e.trim()==="")return[];const{parsed:t}=jn.StringFilterExpression.parse(e);return Vf(t)?t.values:[e]}function Lb(e){return e===void 0||e.trim()===""?!0:Vf(jn.StringFilterExpression.parse(e).parsed)}function Vf(e){return e!==null&&jn.isStringCondition(e)&&e.operator==="="&&e.not!==!0}function Bb(e){return jn.NumberFilterExpression.unparse({operator:">=",values:[String(e)]})}function Vb(e){const t=e.trim();if(t==="")return;const{parsed:n}=jn.NumberFilterExpression.parse(t);if(n===null||n.operator!==">="||n.not===!0||n.values?.length!==1)return;const r=Number(n.values[0]);return Number.isFinite(r)?r:void 0}function zb(e,t){return jn.NumberFilterExpression.unparse({operator:"range",startOperator:">=",startValue:String(e),endOperator:"<=",endValue:String(t)})}function _b(e){const t=e.trim();if(t==="")return;const{parsed:n}=jn.NumberFilterExpression.parse(t);if(n===null||n.operator!=="range"||n.not===!0||n.startOperator!==">="||n.endOperator!=="<=")return;const r=Number(n.startValue),o=Number(n.endValue);return Number.isFinite(r)&&Number.isFinite(o)&&r<=o?[r,o]:void 0}const fa=[{key:"today",label:"Today",clause:{operator:"in",in:{moment:"today"}}},{key:"7d",label:"Last 7 days",clause:{operator:"in_last",units:"day",n:"7"}},{key:"30d",label:"Last 30 days",clause:{operator:"in_last",units:"day",n:"30"}},{key:"90d",label:"Last 90 days",clause:{operator:"in_last",units:"day",n:"90"}},{key:"12m",label:"Last 12 months",clause:{operator:"in_last",units:"month",n:"12"}}];function Wb(e){const t=fa.find(n=>n.key===e);return t?jn.TemporalFilterExpression.unparse(t.clause):void 0}function Hb(e){const t=e.trim();if(t==="")return;const{parsed:n}=jn.TemporalFilterExpression.parse(t);if(n!==null)for(const r of fa){const o=r.clause;if(o.operator===n.operator&&(o.operator==="in"&&n.operator==="in"&&n.not!==!0&&n.in.moment===o.in.moment||o.operator==="in_last"&&n.operator==="in_last"&&n.not!==!0&&n.units===o.units&&Number(n.n)===Number(o.n)))return r.key}}const Ub=/^\d{4}-\d{2}-\d{2}$/;function qb(e,t){const n=Je.utc(t,"YYYY-MM-DD").add(1,"day");return jn.TemporalFilterExpression.unparse({operator:"to",fromMoment:{moment:"literal",literal:e,units:"day"},toMoment:{moment:"literal",literal:n.format("YYYY-MM-DD"),units:"day"}})}function Yb(e){const t=e.trim();if(t==="")return;const{parsed:n}=jn.TemporalFilterExpression.parse(t);if(n===null||n.operator!=="to"||n.not===!0)return;const r=md(n.fromMoment),o=md(n.toMoment);if(r===void 0||o===void 0)return;const s=Je.utc(o,"YYYY-MM-DD").subtract(1,"day");if(!(!s.isValid()||s.isBefore(Je.utc(r,"YYYY-MM-DD"))))return{firstDay:r,lastDay:s.format("YYYY-MM-DD")}}function md(e){return e.moment==="literal"&&Ub.test(e.literal)?e.literal:void 0}function Kb(e,t){if(e!=null){if(e instanceof Date)return Wf(e,t);if(!Array.isArray(e))return String(e)}}function Gb(e,t){return new Date(Date.UTC(e.year(),e.month(),e.date(),t?.getUTCHours()??0,t?.getUTCMinutes()??0,t?.getUTCSeconds()??0,t?.getUTCMilliseconds()??0))}const Zb=/^(\d{4})-(\d{1,2})-(\d{1,2})(?:[T\s]+(\d{1,2}):(\d{2})(?::(\d{2}))?(?:\.(\d{1,9}))?)?\s*(Z|[+-]\d{2}:?\d{2}|[+-]\d{2}|UTC|GMT)?$/i;function zf(e){const t=e.trim();return t===""?e:t.replace(/^(\d{4}-\d{1,2}-\d{1,2}[T\s]+\d{1,2}:\d{2}(?::\d{2})?(?:\.\d{1,9})?)\s+(\d{2}:?\d{2}|\d{2})$/,"$1+$2")}function Xb(e,t=!1){const n=zf(e);if(n==="")return;const r=Zb.exec(n);if(!r)return;const[,o,s,i,l,c,u,d,f]=r,m={year:Number(o),month:Number(s),day:Number(i),hour:Number(l??0),minute:Number(c??0),second:Number(u??0),milli:Number((d??"").slice(0,3).padEnd(3,"0")||0)},h=Date.UTC(m.year,m.month-1,m.day,m.hour,m.minute,m.second,m.milli),g=new Date(h);if(!(g.getUTCFullYear()===m.year&&g.getUTCMonth()===m.month-1&&g.getUTCDate()===m.day&&g.getUTCHours()===m.hour&&g.getUTCMinutes()===m.minute&&g.getUTCSeconds()===m.second)||f!==void 0&&l===void 0)return;const b=Qb(f);if(b===void 0)return;const x=new Date(h-b*6e4);if(!(t&&f!==void 0&&x.getUTCDate()!==m.day))return x}function Qb(e){if(e===void 0)return 0;const t=e.toUpperCase();if(t==="Z"||t==="UTC"||t==="GMT")return 0;const n=/^([+-])(\d{2}):?(\d{2})?$/.exec(t);if(!n)return;const r=Number(n[3]??0);if(r>59)return;const o=Number(n[2])*60+r,s=n[1]!=="-";if(!(o>(s?840:720)))return s?o:-o}function Jb(e){return!ex.has(e??"")}const ex=new Set(["boolean","number","date","timestamp","timestamptz"]);function _f(e,t){if(t===""&&!Jb(e))return null;if(Qr(e))return t;switch(e){case"number":{const n=t.trim()===""?NaN:Number(t);return Number.isFinite(n)?n:t}case"boolean":return t==="true"?!0:t==="false"?!1:t;case"date":case"timestamp":case"timestamptz":{const n=zf(t);return Xb(n,e==="date")??n}default:return t}}function tx(e,t){const n={};for(const[r,o]of e){const s=Kb(o,t.get(r));s!==void 0&&(n[r]=s)}return n}function Wf(e,t){const n=e.toISOString();switch(t){case"timestamptz":return n;case"timestamp":return n.slice(0,-1);default:return n.slice(0,10)}}function bc(e,t,n){const r=n?new Set(n):void 0,o={};for(const[s,i]of e)r&&!r.has(s)||i!=null&&(Array.isArray(i)||(o[s]=i instanceof Date?Wf(i,t.get(s)):i));return o}function gd(e,t){const n=new Map;for(const[r,o]of Object.entries(e))t.has(r)&&n.set(r,_f(t.get(r),o));return n}function yd(e,t){const n=Array.from(e.keys()).filter(o=>!t.has(o));if(n.length===0)return e;const r=new Map(e);for(const o of n)r.delete(o);return r}function bd(e){return Object.entries(e??{}).sort(([t],[n])=>t<n?-1:1)}function nx(e,t,n){for(const r of n.keys())if(e[r]!==t[r])return!1;return!0}function xd(e,t){const n=Object.keys(e);return n.length!==Object.keys(t).length?!1:n.every(r=>e[r]===t[r])}function xc({declaredTypes:e,startingValues:t,params:n,onParamsChange:r,documentKey:o,autorun:s}){const i=Y.useMemo(()=>gd(t??{},e),[e,JSON.stringify(t)]),l=Y.useRef(null),c=Y.useRef(null),u=Y.useRef({documentKey:o,params:n}),d=L=>L!==null&&nx(n??{},L,e);d(l.current)&&(c.current=null),(u.current.documentKey!==o||!xd(n??{},u.current.params??{})&&!d(l.current)&&!d(c.current))&&(u.current={documentKey:o,params:n});const f=u.current.params,m=JSON.stringify(t),h=JSON.stringify(f),g=Y.useMemo(()=>gd({...t??{},...f??{}},e),[e,m,h]),y=Y.useMemo(()=>JSON.stringify([o??null,bd(t),bd(f)]),[o,m,h]),[b,x]=Y.useState(null),C=b?.key===y?b:null;Y.useEffect(()=>{b!==null&&b.key!==y&&x(null)},[b,y]);const T=Y.useMemo(()=>yd(C?.draft??g,e),[C,g,e]),w=Y.useMemo(()=>yd(C?.applied??g,e),[C,g,e]),M=Y.useCallback(L=>L?.key===y?L:{key:y,draft:g,applied:g},[y,g]),E=Y.useMemo(()=>tx(w,e),[w,e]);l.current===null&&(l.current=E),Y.useEffect(()=>{r&&(xd(l.current??{},E)||(c.current=l.current,l.current=E,r(E)))},[E,r]);const j=Y.useCallback((L,v)=>{x(N=>{const A=M(N),$=new Map(A.draft);return v===null?$.delete(L):$.set(L,v),{key:A.key,draft:$,applied:s?$:A.applied}})},[s,M]),F=Y.useCallback(()=>{x(L=>({key:M(L).key,draft:i,applied:i}))},[M,i]),O=Y.useCallback(()=>{x(L=>{const v=M(L);return{key:v.key,draft:v.draft,applied:v.draft}})},[M]),V=Y.useMemo(()=>{if(s)return!1;if(T.size!==w.size)return!0;for(const[L,v]of T){const N=w.get(L);if(v instanceof Date&&N instanceof Date){if(v.getTime()!==N.getTime())return!0}else if(Array.isArray(v)&&Array.isArray(N)){if(String(v)!==String(N))return!0}else if(v!==N)return!0}return!1},[s,T,w]);return{draft:T,applied:w,setGiven:j,reset:F,apply:O,pending:V}}function vt(e){const{server:t}=xe.useServer(),n={...e,queryKey:[...e.queryKey,t],queryFn:async()=>{try{return await e.queryFn()}catch(r){if(r&&typeof r=="object"&&"response"in r){const o=r;if(o.response?.data){const 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 Rn.useQuery(n,xe.globalQueryClient)}function qt(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 Rn.useMutation(t,xe.globalQueryClient)}const rx=1e3;function Hf(e){const t=e.split(".");return t[t.length-1]}function ox(e,t){return`run: ${e} -> {
2
+ group_by: ${t}
3
+ order_by: ${Hf(t)} asc
4
+ limit: ${rx}
5
+ }`}function sx(e,t){const n=e.suggest?.givenNames;if(!t||!n||n.length===0)return;const r=bc(t.values,t.declaredTypes,n);return Object.keys(r).length>0?r:void 0}function vc(e,t,n,r,o,s){const{apiClients:i}=xe.useServer(),l=Y.useMemo(()=>r.filter(f=>f.name!==void 0&&(f.control==="select"||f.control==="multiselect")&&(f.suggest?.query!==void 0||f.suggest?.source!==void 0&&f.suggest?.dimension!==void 0)),[r]),c=Rn.useQueries({queries:l.map(f=>{const m=sx(f,s);return{queryKey:["givenSuggest",e,t,o,n,f.name,f.suggest?.query,f.suggest?.source,f.suggest?.dimension,m===void 0?null:JSON.stringify(m)],enabled:n!==void 0,staleTime:300*1e3,refetchOnWindowFocus:!1,queryFn:async()=>{const h=f.suggest??{},g=await i.models.executeQueryModel(e,t,n,h.query!==void 0?{queryName:h.query,compactJson:!0,versionId:o,givens:m}:{query:ox(h.source,h.dimension),compactJson:!0,versionId:o,givens:m});return ix(g.data.result,h.dimension===void 0?void 0:Hf(h.dimension))}}})}),u=Y.useMemo(()=>{const f=new Map;return l.forEach((m,h)=>{const g=c[h]?.data;m.name&&g&&f.set(m.name,g)}),f},[l,JSON.stringify(c.map(f=>f.data))]),d=Y.useMemo(()=>{const f=new Set;return l.forEach((m,h)=>{m.name&&c[h]?.isError&&f.add(m.name)}),f},[l,c.map(f=>f.isError).join("|")]);return{options:u,isLoading:c.some(f=>f.isLoading),failed:d}}function ix(e,t){if(!e)return[];let n;try{n=JSON.parse(e)}catch{throw new Error("Suggest query returned a result that is not JSON.")}if(!Array.isArray(n))throw new Error("Suggest query returned JSON that is not a list of rows.");const r=[],o=new Set;for(const s of n){if(s===null||typeof s!="object")continue;const i=s,l=Object.keys(i),c=t!==void 0&&Object.prototype.hasOwnProperty.call(i,t)?t:l[0],u=c===void 0?void 0:i[c];if(u==null)continue;const d=String(u);o.has(d)||(o.add(d),r.push(d))}return r}const St=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},yi=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},nr="publisher-drill";function Uf(e,t){const n=new Set;let r;try{r=e.getMetadata()?.getAllFields()??[]}catch{return n}const o=new Set;for(const s of r)!s||t(s)||s.tag?.tag("hidden")===void 0&&o.add(s.tag?.text("label")??s.name);for(const s of r){if(!s||!t(s))continue;const i=s.tag?.text("label")??s.name;o.has(i)||n.add(i)}return n}function Gs(e){const t=/^\s*(\d+)/.exec(e.style?.gridColumn??"");return t?t[1]:void 0}function qf(e,t){if(t.size!==0)for(const n of e.querySelectorAll(".malloy-table")){const r=i=>i.closest(".malloy-table")===n,o=new Set;for(const i of n.querySelectorAll(".column-cell.th")){if(!r(i))continue;const l=(i.textContent??"").replace(/\u200b/g,"").trim(),c=Gs(i);c&&t.has(l)&&o.add(c)}if(o.size===0)continue;const s=new Set;for(const i of n.querySelectorAll(`.${nr}[tabindex="0"]`)){if(!r(i))continue;const l=Gs(i);l&&(s.has(l)?i.tabIndex=-1:s.add(l))}for(const i of n.querySelectorAll(".column-cell.td")){if(!r(i))continue;const l=Gs(i),c=!i.querySelector(".value-null")&&(i.textContent??"").trim()!=="";if(l&&c&&o.has(l)&&!i.querySelector(".malloy-table")){if(i.classList.add(nr),i.tabIndex===0)s.add(l);else{const u=s.has(l);u||s.add(l),i.tabIndex=u?-1:0}i.setAttribute("role","button")}}}}function ax(e){const t=e.closest(".malloy-table"),n=Gs(e);return!t||!n?[]:Array.from(t.querySelectorAll(`.${nr}`)).filter(r=>r.closest(".malloy-table")===t&&Gs(r)===n)}function vd(e,t){const n=ax(e),r=n.indexOf(e);if(r===-1)return;const o=t==="first"?n[0]:t==="last"?n[n.length-1]:n[Math.min(Math.max(r+t,0),n.length-1)];if(o){for(const s of n)s.tabIndex=s===o?0:-1;return o}}const Ji="self";function Sc(e){if(!e)return[];if(e.wasDimension&&!e.wasDimension())return[];const t=e.tag?.tag("drill");return t?(t.textArray("to")??[t.text("to")].filter(Sd)).filter(Sd):[]}function Cc(e){const t=e.replace(/[-_]+/g," ").trim();return t.charAt(0).toUpperCase()+t.slice(1)}function Yf(e){return e.tag?.tag("drill")?.text("given")??e.name}function Ea(e){if(typeof e=="string"){const t=yc([e]);return t===""?void 0:t}if(typeof e=="boolean")return String(e);if(typeof e=="number")return Number.isFinite(e)?String(e):void 0;if(e instanceof Date){const t=e.toISOString();return t.slice(0,t.indexOf("T"))}}function lx(e){return e instanceof Date?Ea(e)??"":String(e)}function Kf(e){if(!e||e.isHeader)return;const t=e.field;if(!t)return;const n=Sc(t);if(n.length===0)return;const r=Ea(e.value);if(r!==void 0)return{to:n,given:Yf(t),value:r,rawValue:e.value,label:lx(e.value)}}function Sd(e){return typeof e=="string"&&e!==""}function Gf(e,t){if(t!==void 0&&!Qr(t)){if(t==="number"){if(typeof e=="number")return Number.isFinite(e)?e:void 0;if(typeof e!="string"||e.trim()==="")return;const n=Number(e);return Number.isFinite(n)?n:void 0}if(t==="date"||t==="timestamp"||t==="timestamptz")return e instanceof Date?e:void 0;if(t==="boolean")return typeof e=="boolean"?e:e==="true"?!0:e==="false"?!1:void 0;if(typeof e=="string")return e.trim()===""?void 0:e;if(typeof e=="number")return Number.isFinite(e)?String(e):void 0;if(typeof e=="boolean")return String(e)}return Ks(t)==="string"&&typeof e=="number"?Number.isFinite(e)?yc([String(e)]):void 0:Ks(t)==="number"?typeof e=="number"?Number.isFinite(e)?String(e):void 0:typeof e!="string"||e.trim()===""?void 0:Number.isFinite(Number(e))?e.trim():void 0:Ea(e)}function wc({onNavigate:e,onSelf:t,selfLabel:n="Filter this view",canSelf:r}){const[o,s]=Y.useState(null),i=Y.useCallback((m,h)=>m.filter(g=>g===Ji?t!==void 0&&(r?.(h)??!0):e!==void 0),[e,t,r]),l=Y.useCallback((m,h,g)=>{if(h===Ji){t?.(m.given,m.rawValue);return}e?.({dashboard:h,givens:{[m.given]:m.value}},g)},[e,t]),c=Y.useCallback(m=>{const h=Kf(m);if(!h)return;const g=i(h.to,h.given);if(g.length!==0){if(g.length===1){l(h,g[0],m.event);return}s({intent:h,destinations:g,event:m.event,top:m.event?.clientY??0,left:m.event?.clientX??0})}},[l,i]),u=Y.useCallback(m=>i(Sc(m),Yf(m)).length>0,[i]),d=Y.useMemo(()=>({onClick:c,canDrill:u}),[c,u]),f=Y.useCallback(()=>s(null),[]);return{drill:d,drillMenu:a.jsxs(I.Menu,{open:o!==null,onClose:f,anchorReference:"anchorPosition",anchorPosition:{top:o?.top??0,left:o?.left??0},children:[a.jsx(I.ListSubheader,{sx:{lineHeight:"32px"},children:o?`${o.intent.label} →`:""}),Array.from(new Set(o?.destinations??[])).map(m=>a.jsx(I.MenuItem,{onClick:()=>{f(),o&&l(o.intent,m,o.event)},children:m===Ji?n:Cc(m)},m))]})}}function kc({declaredTypes:e,setGiven:t,documentName:n}){const r=Y.useMemo(()=>{const l=new Map;for(const c of e.keys())l.has(c.toLowerCase())||l.set(c.toLowerCase(),c);return l},[e]),o=Y.useCallback(l=>e.has(l)?l:r.get(l.toLowerCase()),[e,r]),s=Y.useCallback(l=>o(l)!==void 0,[o]),i=Y.useCallback((l,c)=>{const u=o(l);if(u===void 0){console.warn(`# drill { to=self } tried to set '${l}', which '${n}' does not declare as a given. Name the given with 'given=' on the drill tag.`);return}const d=e.get(u),f=Gf(c,d);if(f===void 0){console.warn(`Drill declined: ${JSON.stringify(c)} cannot be a value for given "${u}"`+(d?` of type ${d}`:""));return}t(u,f)},[e,n,o,t]);return{resolveGiven:o,canSelf:s,onSelf:i}}const Cd=e=>e,cx=()=>{let e=Cd;return{configure(t){e=t},generate(t){return e(t)},reset(){e=Cd}}},Zf=cx();function yr(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 ve(e){if(typeof e!="string")throw new Error(yr(7));return e.charAt(0).toUpperCase()+e.slice(1)}function wd(...e){return e.reduce((t,n)=>n==null?t:function(...o){t.apply(this,o),n.apply(this,o)},()=>{})}var hl={exports:{}},ml,kd;function ux(){if(kd)return ml;kd=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return ml=e,ml}var gl,Td;function dx(){if(Td)return gl;Td=1;var e=ux();function t(){}function n(){}return n.resetWarningCache=t,gl=function(){function r(i,l,c,u,d,f){if(f!==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},gl}var Id;function px(){return Id||(Id=1,hl.exports=dx()()),hl.exports}var fx=px();const fe=Sr(fx);function Xf(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=Xf(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function Te(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=Xf(e))&&(r&&(r+=" "),r+=t);return r}function Re(e,t,n=void 0){const r={};for(const o in e){const s=e[o];let i="",l=!0;for(let c=0;c<s.length;c+=1){const u=s[c];u&&(i+=(l===!0?"":" ")+t(u),l=!1,n&&n[u]&&(i+=" "+n[u]))}r[o]=i}return r}var yl={exports:{}},yt={};/**
6
+ * @license React
7
+ * react-is.production.js
8
+ *
9
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
10
+ *
11
+ * This source code is licensed under the MIT license found in the
12
+ * LICENSE file in the root directory of this source tree.
13
+ */var Md;function hx(){if(Md)return yt;Md=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),s=Symbol.for("react.consumer"),i=Symbol.for("react.context"),l=Symbol.for("react.forward_ref"),c=Symbol.for("react.suspense"),u=Symbol.for("react.suspense_list"),d=Symbol.for("react.memo"),f=Symbol.for("react.lazy"),m=Symbol.for("react.view_transition"),h=Symbol.for("react.client.reference");function g(y){if(typeof y=="object"&&y!==null){var b=y.$$typeof;switch(b){case e:switch(y=y.type,y){case n:case o:case r:case c:case u:case m:return y;default:switch(y=y&&y.$$typeof,y){case i:case l:case f:case d:return y;case s:return y;default:return b}}case t:return b}}}return yt.ContextConsumer=s,yt.ContextProvider=i,yt.Element=e,yt.ForwardRef=l,yt.Fragment=n,yt.Lazy=f,yt.Memo=d,yt.Portal=t,yt.Profiler=o,yt.StrictMode=r,yt.Suspense=c,yt.SuspenseList=u,yt.isContextConsumer=function(y){return g(y)===s},yt.isContextProvider=function(y){return g(y)===i},yt.isElement=function(y){return typeof y=="object"&&y!==null&&y.$$typeof===e},yt.isForwardRef=function(y){return g(y)===l},yt.isFragment=function(y){return g(y)===n},yt.isLazy=function(y){return g(y)===f},yt.isMemo=function(y){return g(y)===d},yt.isPortal=function(y){return g(y)===t},yt.isProfiler=function(y){return g(y)===o},yt.isStrictMode=function(y){return g(y)===r},yt.isSuspense=function(y){return g(y)===c},yt.isSuspenseList=function(y){return g(y)===u},yt.isValidElementType=function(y){return typeof y=="string"||typeof y=="function"||y===n||y===o||y===r||y===c||y===u||typeof y=="object"&&y!==null&&(y.$$typeof===f||y.$$typeof===d||y.$$typeof===i||y.$$typeof===s||y.$$typeof===l||y.$$typeof===h||y.getModuleId!==void 0)},yt.typeOf=g,yt}var Dd;function mx(){return Dd||(Dd=1,yl.exports=hx()),yl.exports}var Qf=mx();function tr(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function Jf(e){if(D.isValidElement(e)||Qf.isValidElementType(e)||!tr(e))return e;const t={};return Object.keys(e).forEach(n=>{t[n]=Jf(e[n])}),t}function Qt(e,t,n={clone:!0}){const r=n.clone?{...e}:e;return tr(e)&&tr(t)&&Object.keys(t).forEach(o=>{D.isValidElement(t[o])||Qf.isValidElementType(t[o])?r[o]=t[o]:tr(t[o])&&Object.prototype.hasOwnProperty.call(e,o)&&tr(e[o])?r[o]=Qt(e[o],t[o],n):n.clone?r[o]=tr(t[o])?Jf(t[o]):t[o]:r[o]=t[o]}),r}function Zs(e,t){return t?Qt(e,t,{clone:!1}):e}function Pd(e,t){if(!e.containerQueries)return t;const n=Object.keys(t).filter(r=>r.startsWith("@container")).sort((r,o)=>{const s=/min-width:\s*([0-9.]+)/;return+(r.match(s)?.[1]||0)-+(o.match(s)?.[1]||0)});return n.length?n.reduce((r,o)=>{const s=t[o];return delete r[o],r[o]=s,r},{...t}):t}function gx(e,t){return t==="@"||t.startsWith("@")&&(e.some(n=>t.startsWith(`@${n}`))||!!t.match(/^@\d/))}function yx(e,t){const n=t.match(/^@([^/]+)?\/?(.+)?$/);if(!n)return null;const[,r,o]=n,s=Number.isNaN(+r)?r||0:+r;return e.containerQueries(o).up(s)}function bx(e){const t=(s,i)=>s.replace("@media",i?`@container ${i}`:"@container");function n(s,i){s.up=(...l)=>t(e.breakpoints.up(...l),i),s.down=(...l)=>t(e.breakpoints.down(...l),i),s.between=(...l)=>t(e.breakpoints.between(...l),i),s.only=(...l)=>t(e.breakpoints.only(...l),i),s.not=(...l)=>{const c=t(e.breakpoints.not(...l),i);return c.includes("not all and")?c.replace("not all and ","").replace("min-width:","width<").replace("max-width:","width>").replace("and","or"):c}}const r={},o=s=>(n(r,s),r);return n(o),{...e,containerQueries:o}}const Oa={xs:0,sm:600,md:900,lg:1200,xl:1536},Ed={keys:["xs","sm","md","lg","xl"],up:e=>`@media (min-width:${Oa[e]}px)`},xx={containerQueries:e=>({up:t=>{let n=typeof t=="number"?t:Oa[t]||t;return typeof n=="number"&&(n=`${n}px`),e?`@container ${e} (min-width:${n})`:`@container (min-width:${n})`}})};function br(e,t,n){const r=e.theme||{};if(Array.isArray(t)){const s=r.breakpoints||Ed;return t.reduce((i,l,c)=>(i[s.up(s.keys[c])]=n(t[c]),i),{})}if(typeof t=="object"){const s=r.breakpoints||Ed;return Object.keys(t).reduce((i,l)=>{if(gx(s.keys,l)){const c=yx(r.containerQueries?r:xx,l);c&&(i[c]=n(t[l],l))}else if(Object.keys(s.values||Oa).includes(l)){const c=s.up(l);i[c]=n(t[l],l)}else{const c=l;i[c]=t[c]}return i},{})}return n(t)}function vx(e={}){return e.keys?.reduce((n,r)=>{const o=e.up(r);return n[o]={},n},{})||{}}function Od(e,t){return e.reduce((n,r)=>{const o=n[r];return(!o||Object.keys(o).length===0)&&delete n[r],n},t)}function Ra(e,t,n=!0){if(!t||typeof t!="string")return null;if(e&&e.vars&&n){const r=`vars.${t}`.split(".").reduce((o,s)=>o&&o[s]?o[s]:null,e);if(r!=null)return r}return t.split(".").reduce((r,o)=>r&&r[o]!=null?r[o]:null,e)}function ha(e,t,n,r=n){let o;return typeof e=="function"?o=e(n):Array.isArray(e)?o=e[n]||r:o=Ra(e,n)||r,t&&(o=t(o,r,e)),o}function Nt(e){const{prop:t,cssProperty:n=e.prop,themeKey:r,transform:o}=e,s=i=>{if(i[t]==null)return null;const l=i[t],c=i.theme,u=Ra(c,r)||{};return br(i,l,f=>{let m=ha(u,o,f);return f===m&&typeof f=="string"&&(m=ha(u,o,`${t}${f==="default"?"":ve(f)}`,f)),n===!1?m:{[n]:m}})};return s.propTypes={},s.filterProps=[t],s}function Sx(e){const t={};return n=>(t[n]===void 0&&(t[n]=e(n)),t[n])}const Cx={m:"margin",p:"padding"},wx={t:"Top",r:"Right",b:"Bottom",l:"Left",x:["Left","Right"],y:["Top","Bottom"]},Rd={marginX:"mx",marginY:"my",paddingX:"px",paddingY:"py"},kx=Sx(e=>{if(e.length>2)if(Rd[e])e=Rd[e];else return[e];const[t,n]=e.split(""),r=Cx[t],o=wx[n]||"";return Array.isArray(o)?o.map(s=>r+s):[r+o]}),Tc=["m","mt","mr","mb","ml","mx","my","margin","marginTop","marginRight","marginBottom","marginLeft","marginX","marginY","marginInline","marginInlineStart","marginInlineEnd","marginBlock","marginBlockStart","marginBlockEnd"],Ic=["p","pt","pr","pb","pl","px","py","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","paddingX","paddingY","paddingInline","paddingInlineStart","paddingInlineEnd","paddingBlock","paddingBlockStart","paddingBlockEnd"];[...Tc,...Ic];function bi(e,t,n,r){const o=Ra(e,t,!0)??n;return typeof o=="number"||typeof o=="string"?s=>typeof s=="string"?s:typeof o=="string"?o.startsWith("var(")&&s===0?0:o.startsWith("var(")&&s===1?o:`calc(${s} * ${o})`:o*s:Array.isArray(o)?s=>{if(typeof s=="string")return s;const i=Math.abs(s),l=o[i];return s>=0?l:typeof l=="number"?-l:typeof l=="string"&&l.startsWith("var(")?`calc(-1 * ${l})`:`-${l}`}:typeof o=="function"?o:()=>{}}function Mc(e){return bi(e,"spacing",8)}function xi(e,t){return typeof t=="string"||t==null?t:e(t)}function Tx(e,t){return n=>e.reduce((r,o)=>(r[o]=xi(t,n),r),{})}function Ix(e,t,n,r){if(!t.includes(n))return null;const o=kx(n),s=Tx(o,r),i=e[n];return br(e,i,s)}function eh(e,t){const n=Mc(e.theme);return Object.keys(e).map(r=>Ix(e,t,r,n)).reduce(Zs,{})}function $t(e){return eh(e,Tc)}$t.propTypes={};$t.filterProps=Tc;function At(e){return eh(e,Ic)}At.propTypes={};At.filterProps=Ic;function ja(...e){const t=e.reduce((r,o)=>(o.filterProps.forEach(s=>{r[s]=o}),r),{}),n=r=>Object.keys(r).reduce((o,s)=>t[s]?Zs(o,t[s](r)):o,{});return n.propTypes={},n.filterProps=e.reduce((r,o)=>r.concat(o.filterProps),[]),n}function Tn(e){return typeof e!="number"?e:`${e}px solid`}function $n(e,t){return Nt({prop:e,themeKey:"borders",transform:t})}const Mx=$n("border",Tn),Dx=$n("borderTop",Tn),Px=$n("borderRight",Tn),Ex=$n("borderBottom",Tn),Ox=$n("borderLeft",Tn),Rx=$n("borderColor"),jx=$n("borderTopColor"),$x=$n("borderRightColor"),Ax=$n("borderBottomColor"),Fx=$n("borderLeftColor"),Nx=$n("outline",Tn),Lx=$n("outlineColor"),$a=e=>{if(e.borderRadius!==void 0&&e.borderRadius!==null){const t=bi(e.theme,"shape.borderRadius",4),n=r=>({borderRadius:xi(t,r)});return br(e,e.borderRadius,n)}return null};$a.propTypes={};$a.filterProps=["borderRadius"];ja(Mx,Dx,Px,Ex,Ox,Rx,jx,$x,Ax,Fx,$a,Nx,Lx);const Aa=e=>{if(e.gap!==void 0&&e.gap!==null){const t=bi(e.theme,"spacing",8),n=r=>({gap:xi(t,r)});return br(e,e.gap,n)}return null};Aa.propTypes={};Aa.filterProps=["gap"];const Fa=e=>{if(e.columnGap!==void 0&&e.columnGap!==null){const t=bi(e.theme,"spacing",8),n=r=>({columnGap:xi(t,r)});return br(e,e.columnGap,n)}return null};Fa.propTypes={};Fa.filterProps=["columnGap"];const Na=e=>{if(e.rowGap!==void 0&&e.rowGap!==null){const t=bi(e.theme,"spacing",8),n=r=>({rowGap:xi(t,r)});return br(e,e.rowGap,n)}return null};Na.propTypes={};Na.filterProps=["rowGap"];const Bx=Nt({prop:"gridColumn"}),Vx=Nt({prop:"gridRow"}),zx=Nt({prop:"gridAutoFlow"}),_x=Nt({prop:"gridAutoColumns"}),Wx=Nt({prop:"gridAutoRows"}),Hx=Nt({prop:"gridTemplateColumns"}),Ux=Nt({prop:"gridTemplateRows"}),qx=Nt({prop:"gridTemplateAreas"}),Yx=Nt({prop:"gridArea"});ja(Aa,Fa,Na,Bx,Vx,zx,_x,Wx,Hx,Ux,qx,Yx);function Uo(e,t){return t==="grey"?t:e}const Kx=Nt({prop:"color",themeKey:"palette",transform:Uo}),Gx=Nt({prop:"bgcolor",cssProperty:"backgroundColor",themeKey:"palette",transform:Uo}),Zx=Nt({prop:"backgroundColor",themeKey:"palette",transform:Uo});ja(Kx,Gx,Zx);function hn(e){return e<=1&&e!==0?`${e*100}%`:e}const Xx=Nt({prop:"width",transform:hn}),Dc=e=>{if(e.maxWidth!==void 0&&e.maxWidth!==null){const t=n=>{const r=e.theme?.breakpoints?.values?.[n]||Oa[n];return r?e.theme?.breakpoints?.unit!=="px"?{maxWidth:`${r}${e.theme.breakpoints.unit}`}:{maxWidth:r}:{maxWidth:hn(n)}};return br(e,e.maxWidth,t)}return null};Dc.filterProps=["maxWidth"];const Qx=Nt({prop:"minWidth",transform:hn}),Jx=Nt({prop:"height",transform:hn}),ev=Nt({prop:"maxHeight",transform:hn}),tv=Nt({prop:"minHeight",transform:hn});Nt({prop:"size",cssProperty:"width",transform:hn});Nt({prop:"size",cssProperty:"height",transform:hn});const nv=Nt({prop:"boxSizing"});ja(Xx,Dc,Qx,Jx,ev,tv,nv);const vi={border:{themeKey:"borders",transform:Tn},borderTop:{themeKey:"borders",transform:Tn},borderRight:{themeKey:"borders",transform:Tn},borderBottom:{themeKey:"borders",transform:Tn},borderLeft:{themeKey:"borders",transform:Tn},borderColor:{themeKey:"palette"},borderTopColor:{themeKey:"palette"},borderRightColor:{themeKey:"palette"},borderBottomColor:{themeKey:"palette"},borderLeftColor:{themeKey:"palette"},outline:{themeKey:"borders",transform:Tn},outlineColor:{themeKey:"palette"},borderRadius:{themeKey:"shape.borderRadius",style:$a},color:{themeKey:"palette",transform:Uo},bgcolor:{themeKey:"palette",cssProperty:"backgroundColor",transform:Uo},backgroundColor:{themeKey:"palette",transform:Uo},p:{style:At},pt:{style:At},pr:{style:At},pb:{style:At},pl:{style:At},px:{style:At},py:{style:At},padding:{style:At},paddingTop:{style:At},paddingRight:{style:At},paddingBottom:{style:At},paddingLeft:{style:At},paddingX:{style:At},paddingY:{style:At},paddingInline:{style:At},paddingInlineStart:{style:At},paddingInlineEnd:{style:At},paddingBlock:{style:At},paddingBlockStart:{style:At},paddingBlockEnd:{style:At},m:{style:$t},mt:{style:$t},mr:{style:$t},mb:{style:$t},ml:{style:$t},mx:{style:$t},my:{style:$t},margin:{style:$t},marginTop:{style:$t},marginRight:{style:$t},marginBottom:{style:$t},marginLeft:{style:$t},marginX:{style:$t},marginY:{style:$t},marginInline:{style:$t},marginInlineStart:{style:$t},marginInlineEnd:{style:$t},marginBlock:{style:$t},marginBlockStart:{style:$t},marginBlockEnd:{style:$t},displayPrint:{cssProperty:!1,transform:e=>({"@media print":{display:e}})},display:{},overflow:{},textOverflow:{},visibility:{},whiteSpace:{},flexBasis:{},flexDirection:{},flexWrap:{},justifyContent:{},alignItems:{},alignContent:{},order:{},flex:{},flexGrow:{},flexShrink:{},alignSelf:{},justifyItems:{},justifySelf:{},gap:{style:Aa},rowGap:{style:Na},columnGap:{style:Fa},gridColumn:{},gridRow:{},gridAutoFlow:{},gridAutoColumns:{},gridAutoRows:{},gridTemplateColumns:{},gridTemplateRows:{},gridTemplateAreas:{},gridArea:{},position:{},zIndex:{themeKey:"zIndex"},top:{},right:{},bottom:{},left:{},boxShadow:{themeKey:"shadows"},width:{transform:hn},maxWidth:{style:Dc},minWidth:{transform:hn},height:{transform:hn},maxHeight:{transform:hn},minHeight:{transform:hn},boxSizing:{},font:{themeKey:"font"},fontFamily:{themeKey:"typography"},fontSize:{themeKey:"typography"},fontStyle:{themeKey:"typography"},fontWeight:{themeKey:"typography"},letterSpacing:{},textTransform:{},lineHeight:{},textAlign:{},typography:{cssProperty:!1,themeKey:"typography"}};function rv(...e){const t=e.reduce((r,o)=>r.concat(Object.keys(o)),[]),n=new Set(t);return e.every(r=>n.size===Object.keys(r).length)}function ov(e,t){return typeof e=="function"?e(t):e}function sv(){function e(n,r,o,s){const i={[n]:r,theme:o},l=s[n];if(!l)return{[n]:r};const{cssProperty:c=n,themeKey:u,transform:d,style:f}=l;if(r==null)return null;if(u==="typography"&&r==="inherit")return{[n]:r};const m=Ra(o,u)||{};return f?f(i):br(i,r,g=>{let y=ha(m,d,g);return g===y&&typeof g=="string"&&(y=ha(m,d,`${n}${g==="default"?"":ve(g)}`,g)),c===!1?y:{[c]:y}})}function t(n){const{sx:r,theme:o={},nested:s}=n||{};if(!r)return null;const i=o.unstable_sxConfig??vi;function l(c){let u=c;if(typeof c=="function")u=c(o);else if(typeof c!="object")return c;if(!u)return null;const d=vx(o.breakpoints),f=Object.keys(d);let m=d;return Object.keys(u).forEach(h=>{const g=ov(u[h],o);if(g!=null)if(typeof g=="object")if(i[h])m=Zs(m,e(h,g,o,i));else{const y=br({theme:o},g,b=>({[h]:b}));rv(y,g)?m[h]=t({sx:g,theme:o,nested:!0}):m=Zs(m,y)}else m=Zs(m,e(h,g,o,i))}),!s&&o.modularCssLayers?{"@layer sx":Pd(o,Od(f,m))}:Pd(o,Od(f,m))}return Array.isArray(r)?r.map(l):l(r)}return t}const Go=sv();Go.filterProps=["sx"];const iv=e=>{const t={systemProps:{},otherProps:{}},n=e?.theme?.unstable_sxConfig??vi;return Object.keys(e).forEach(r=>{n[r]?t.systemProps[r]=e[r]:t.otherProps[r]=e[r]}),t};function av(e){const{sx:t,...n}=e,{systemProps:r,otherProps:o}=iv(n);let s;return Array.isArray(t)?s=[r,...t]:typeof t=="function"?s=(...i)=>{const l=t(...i);return tr(l)?{...r,...l}:r}:s={...r,...t},{...o,sx:s}}function lv(e,t=Number.MIN_SAFE_INTEGER,n=Number.MAX_SAFE_INTEGER){return Math.max(t,Math.min(e,n))}function Pc(e,t=0,n=1){return lv(e,t,n)}function cv(e){e=e.slice(1);const t=new RegExp(`.{1,${e.length>=6?2:1}}`,"g");let n=e.match(t);return n&&n[0].length===1&&(n=n.map(r=>r+r)),n?`rgb${n.length===4?"a":""}(${n.map((r,o)=>o<3?parseInt(r,16):Math.round(parseInt(r,16)/255*1e3)/1e3).join(", ")})`:""}function Rr(e){if(e.type)return e;if(e.charAt(0)==="#")return Rr(cv(e));const t=e.indexOf("("),n=e.substring(0,t);if(!["rgb","rgba","hsl","hsla","color"].includes(n))throw new Error(yr(9,e));let r=e.substring(t+1,e.length-1),o;if(n==="color"){if(r=r.split(" "),o=r.shift(),r.length===4&&r[3].charAt(0)==="/"&&(r[3]=r[3].slice(1)),!["srgb","display-p3","a98-rgb","prophoto-rgb","rec-2020"].includes(o))throw new Error(yr(10,o))}else r=r.split(",");return r=r.map(s=>parseFloat(s)),{type:n,values:r,colorSpace:o}}const uv=e=>{const t=Rr(e);return t.values.slice(0,3).map((n,r)=>t.type.includes("hsl")&&r!==0?`${n}%`:n).join(" ")},_s=(e,t)=>{try{return uv(e)}catch{return e}};function La(e){const{type:t,colorSpace:n}=e;let{values:r}=e;return t.includes("rgb")?r=r.map((o,s)=>s<3?parseInt(o,10):o):t.includes("hsl")&&(r[1]=`${r[1]}%`,r[2]=`${r[2]}%`),t.includes("color")?r=`${n} ${r.join(" ")}`:r=`${r.join(", ")}`,`${t}(${r})`}function th(e){e=Rr(e);const{values:t}=e,n=t[0],r=t[1]/100,o=t[2]/100,s=r*Math.min(o,1-o),i=(u,d=(u+n/30)%12)=>o-s*Math.max(Math.min(d-3,9-d,1),-1);let l="rgb";const c=[Math.round(i(0)*255),Math.round(i(8)*255),Math.round(i(4)*255)];return e.type==="hsla"&&(l+="a",c.push(t[3])),La({type:l,values:c})}function zl(e){e=Rr(e);let t=e.type==="hsl"||e.type==="hsla"?Rr(th(e)).values:e.values;return t=t.map(n=>(e.type!=="color"&&(n/=255),n<=.03928?n/12.92:((n+.055)/1.055)**2.4)),Number((.2126*t[0]+.7152*t[1]+.0722*t[2]).toFixed(3))}function dv(e,t){const n=zl(e),r=zl(t);return(Math.max(n,r)+.05)/(Math.min(n,r)+.05)}function ma(e,t){return e=Rr(e),t=Pc(t),(e.type==="rgb"||e.type==="hsl")&&(e.type+="a"),e.type==="color"?e.values[3]=`/${t}`:e.values[3]=t,La(e)}function Wr(e,t,n){try{return ma(e,t)}catch{return e}}function Ba(e,t){if(e=Rr(e),t=Pc(t),e.type.includes("hsl"))e.values[2]*=1-t;else if(e.type.includes("rgb")||e.type.includes("color"))for(let n=0;n<3;n+=1)e.values[n]*=1-t;return La(e)}function ht(e,t,n){try{return Ba(e,t)}catch{return e}}function Va(e,t){if(e=Rr(e),t=Pc(t),e.type.includes("hsl"))e.values[2]+=(100-e.values[2])*t;else if(e.type.includes("rgb"))for(let n=0;n<3;n+=1)e.values[n]+=(255-e.values[n])*t;else if(e.type.includes("color"))for(let n=0;n<3;n+=1)e.values[n]+=(1-e.values[n])*t;return La(e)}function mt(e,t,n){try{return Va(e,t)}catch{return e}}function _l(e,t=.15){return zl(e)>.5?Ba(e,t):Va(e,t)}function Vi(e,t,n){try{return _l(e,t)}catch{return e}}const ri={black:"#000",white:"#fff"},pv={50:"#fafafa",100:"#f5f5f5",200:"#eeeeee",300:"#e0e0e0",400:"#bdbdbd",500:"#9e9e9e",600:"#757575",700:"#616161",800:"#424242",900:"#212121",A100:"#f5f5f5",A200:"#eeeeee",A400:"#bdbdbd",A700:"#616161"},Oo={50:"#f3e5f5",200:"#ce93d8",300:"#ba68c8",400:"#ab47bc",500:"#9c27b0",700:"#7b1fa2"},Ro={300:"#e57373",400:"#ef5350",500:"#f44336",700:"#d32f2f",800:"#c62828"},Ss={300:"#ffb74d",400:"#ffa726",500:"#ff9800",700:"#f57c00",900:"#e65100"},jo={50:"#e3f2fd",200:"#90caf9",400:"#42a5f5",700:"#1976d2",800:"#1565c0"},$o={300:"#4fc3f7",400:"#29b6f6",500:"#03a9f4",700:"#0288d1",900:"#01579b"},Ao={300:"#81c784",400:"#66bb6a",500:"#4caf50",700:"#388e3c",800:"#2e7d32",900:"#1b5e20"};function nh(){return{text:{primary:"rgba(0, 0, 0, 0.87)",secondary:"rgba(0, 0, 0, 0.6)",disabled:"rgba(0, 0, 0, 0.38)"},divider:"rgba(0, 0, 0, 0.12)",background:{paper:ri.white,default:ri.white},action:{active:"rgba(0, 0, 0, 0.54)",hover:"rgba(0, 0, 0, 0.04)",hoverOpacity:.04,selected:"rgba(0, 0, 0, 0.08)",selectedOpacity:.08,disabled:"rgba(0, 0, 0, 0.26)",disabledBackground:"rgba(0, 0, 0, 0.12)",disabledOpacity:.38,focus:"rgba(0, 0, 0, 0.12)",focusOpacity:.12,activatedOpacity:.12}}}const rh=nh();function oh(){return{text:{primary:ri.white,secondary:"rgba(255, 255, 255, 0.7)",disabled:"rgba(255, 255, 255, 0.5)",icon:"rgba(255, 255, 255, 0.5)"},divider:"rgba(255, 255, 255, 0.12)",background:{paper:"#121212",default:"#121212"},action:{active:ri.white,hover:"rgba(255, 255, 255, 0.08)",hoverOpacity:.08,selected:"rgba(255, 255, 255, 0.16)",selectedOpacity:.16,disabled:"rgba(255, 255, 255, 0.3)",disabledBackground:"rgba(255, 255, 255, 0.12)",disabledOpacity:.38,focus:"rgba(255, 255, 255, 0.12)",focusOpacity:.12,activatedOpacity:.24}}}const Wl=oh();function jd(e,t,n,r){const o=r.light||r,s=r.dark||r*1.5;e[t]||(e.hasOwnProperty(n)?e[t]=e[n]:t==="light"?e.light=Va(e.main,o):t==="dark"&&(e.dark=Ba(e.main,s)))}function $d(e,t,n,r,o){const s=o.light||o,i=o.dark||o*1.5;t[n]||(t.hasOwnProperty(r)?t[n]=t[r]:n==="light"?t.light=`color-mix(in ${e}, ${t.main}, #fff ${(s*100).toFixed(0)}%)`:n==="dark"&&(t.dark=`color-mix(in ${e}, ${t.main}, #000 ${(i*100).toFixed(0)}%)`))}function fv(e="light"){return e==="dark"?{main:jo[200],light:jo[50],dark:jo[400]}:{main:jo[700],light:jo[400],dark:jo[800]}}function hv(e="light"){return e==="dark"?{main:Oo[200],light:Oo[50],dark:Oo[400]}:{main:Oo[500],light:Oo[300],dark:Oo[700]}}function mv(e="light"){return e==="dark"?{main:Ro[500],light:Ro[300],dark:Ro[700]}:{main:Ro[700],light:Ro[400],dark:Ro[800]}}function gv(e="light"){return e==="dark"?{main:$o[400],light:$o[300],dark:$o[700]}:{main:$o[700],light:$o[500],dark:$o[900]}}function yv(e="light"){return e==="dark"?{main:Ao[400],light:Ao[300],dark:Ao[700]}:{main:Ao[800],light:Ao[500],dark:Ao[900]}}function bv(e="light"){return e==="dark"?{main:Ss[400],light:Ss[300],dark:Ss[700]}:{main:"#ed6c02",light:Ss[500],dark:Ss[900]}}function xv(e){return`oklch(from ${e} var(--__l) 0 h / var(--__a))`}function Ec(e){const{mode:t="light",contrastThreshold:n=3,tonalOffset:r=.2,colorSpace:o,...s}=e,i=e.primary||fv(t),l=e.secondary||hv(t),c=e.error||mv(t),u=e.info||gv(t),d=e.success||yv(t),f=e.warning||bv(t);function m(b){return o?xv(b):dv(b,Wl.text.primary)>=n?Wl.text.primary:rh.text.primary}const h=({color:b,name:x,mainShade:C=500,lightShade:T=300,darkShade:w=700})=>{if(b={...b},!b.main&&b[C]&&(b.main=b[C]),!b.hasOwnProperty("main"))throw new Error(yr(11,x?` (${x})`:"",C));if(typeof b.main!="string")throw new Error(yr(12,x?` (${x})`:"",JSON.stringify(b.main)));return o?($d(o,b,"light",T,r),$d(o,b,"dark",w,r)):(jd(b,"light",T,r),jd(b,"dark",w,r)),b.contrastText||(b.contrastText=m(b.main)),b};let g;return t==="light"?g=nh():t==="dark"&&(g=oh()),Qt({common:{...ri},mode:t,primary:h({color:i,name:"primary"}),secondary:h({color:l,name:"secondary",mainShade:"A400",lightShade:"A200",darkShade:"A700"}),error:h({color:c,name:"error"}),warning:h({color:f,name:"warning"}),info:h({color:u,name:"info"}),success:h({color:d,name:"success"}),grey:pv,contrastThreshold:n,getContrastText:m,augmentColor:h,tonalOffset:r,...g},s)}function vv(e){for(var t=0,n,r=0,o=e.length;o>=4;++r,o-=4)n=e.charCodeAt(r)&255|(e.charCodeAt(++r)&255)<<8|(e.charCodeAt(++r)&255)<<16|(e.charCodeAt(++r)&255)<<24,n=(n&65535)*1540483477+((n>>>16)*59797<<16),n^=n>>>24,t=(n&65535)*1540483477+((n>>>16)*59797<<16)^(t&65535)*1540483477+((t>>>16)*59797<<16);switch(o){case 3:t^=(e.charCodeAt(r+2)&255)<<16;case 2:t^=(e.charCodeAt(r+1)&255)<<8;case 1:t^=e.charCodeAt(r)&255,t=(t&65535)*1540483477+((t>>>16)*59797<<16)}return t^=t>>>13,t=(t&65535)*1540483477+((t>>>16)*59797<<16),((t^t>>>15)>>>0).toString(36)}var Sv={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,scale:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1};function Cv(e){var t=Object.create(null);return function(n){return t[n]===void 0&&(t[n]=e(n)),t[n]}}var wv=/[A-Z]|^ms/g,kv=/_EMO_([^_]+?)_([^]*?)_EMO_/g,sh=function(t){return t.charCodeAt(1)===45},Ad=function(t){return t!=null&&typeof t!="boolean"},bl=Cv(function(e){return sh(e)?e:e.replace(wv,"-$&").toLowerCase()}),Fd=function(t,n){switch(t){case"animation":case"animationName":if(typeof n=="string")return n.replace(kv,function(r,o,s){return Er={name:o,styles:s,next:Er},o})}return Sv[t]!==1&&!sh(t)&&typeof n=="number"&&n!==0?n+"px":n};function ga(e,t,n){if(n==null)return"";var r=n;if(r.__emotion_styles!==void 0)return r;switch(typeof n){case"boolean":return"";case"object":{var o=n;if(o.anim===1)return Er={name:o.name,styles:o.styles,next:Er},o.name;var s=n;if(s.styles!==void 0){var i=s.next;if(i!==void 0)for(;i!==void 0;)Er={name:i.name,styles:i.styles,next:Er},i=i.next;var l=s.styles+";";return l}return Tv(e,t,n)}}var c=n;return c}function Tv(e,t,n){var r="";if(Array.isArray(n))for(var o=0;o<n.length;o++)r+=ga(e,t,n[o])+";";else for(var s in n){var i=n[s];if(typeof i!="object"){var l=i;Ad(l)&&(r+=bl(s)+":"+Fd(s,l)+";")}else if(Array.isArray(i)&&typeof i[0]=="string"&&t==null)for(var c=0;c<i.length;c++)Ad(i[c])&&(r+=bl(s)+":"+Fd(s,i[c])+";");else{var u=ga(e,t,i);switch(s){case"animation":case"animationName":{r+=bl(s)+":"+u+";";break}default:r+=s+"{"+u+"}"}}}return r}var Nd=/label:\s*([^\s;{]+)\s*(;|$)/g,Er;function Iv(e,t,n){if(e.length===1&&typeof e[0]=="object"&&e[0]!==null&&e[0].styles!==void 0)return e[0];var r=!0,o="";Er=void 0;var s=e[0];if(s==null||s.raw===void 0)r=!1,o+=ga(n,t,s);else{var i=s;o+=i[0]}for(var l=1;l<e.length;l++)if(o+=ga(n,t,e[l]),r){var c=s;o+=c[l]}Nd.lastIndex=0;for(var u="",d;(d=Nd.exec(o))!==null;)u+="-"+d[1];var f=vv(o)+u;return{name:f,styles:o,next:Er}}function Mv(e,t){return Ib(e,t)}function Dv(e,t){Array.isArray(e.__emotion_styles)&&(e.__emotion_styles=t(e.__emotion_styles))}const Ld=[];function to(e){return Ld[0]=e,Iv(Ld)}const Wt=typeof window<"u"?D.useLayoutEffect:D.useEffect;function Pv(e){return Object.keys(e).length===0}function ih(e=null){const t=D.useContext(Mb.ThemeContext);return!t||Pv(t)?e:t}const Ev=D.createContext(),An=()=>D.useContext(Ev)??!1;function oi(e,t,n=!1){const r={...t};for(const o in e)if(Object.prototype.hasOwnProperty.call(e,o)){const s=o;if(s==="components"||s==="slots")r[s]={...e[s],...r[s]};else if(s==="componentsProps"||s==="slotProps"){const i=e[s],l=t[s];if(!l)r[s]=i||{};else if(!i)r[s]=l;else{r[s]={...l};for(const c in i)if(Object.prototype.hasOwnProperty.call(i,c)){const u=c;r[s][u]=oi(i[u],l[u],n)}}}else s==="className"&&n&&t.className?r.className=Te(e?.className,t?.className):s==="style"&&n&&t.style?r.style={...e?.style,...t?.style}:r[s]===void 0&&(r[s]=e[s])}return r}const Ov=D.createContext(void 0);function Rv(e){const{theme:t,name:n,props:r}=e;if(!t||!t.components||!t.components[n])return r;const o=t.components[n];return o.defaultProps?oi(o.defaultProps,r,t.components.mergeClassNameAndStyle):!o.styleOverrides&&!o.variants?oi(o,r,t.components.mergeClassNameAndStyle):r}function jv({props:e,name:t}){const n=D.useContext(Ov);return Rv({props:e,name:t,theme:{components:n}})}let Bd=0;function $v(e){const[t,n]=D.useState(e),r=e||t;return D.useEffect(()=>{t==null&&(Bd+=1,n(`mui-${Bd}`))},[t]),r}const Av={...D},Vd=Av.useId;function Un(e){if(Vd!==void 0){const t=Vd();return e??t}return $v(e)}const Fv=e=>{const t=Object.keys(e).map(n=>({key:n,val:e[n]}))||[];return t.sort((n,r)=>n.val-r.val),t.reduce((n,r)=>({...n,[r.key]:r.val}),{})};function Nv(e){const{values:t={xs:0,sm:600,md:900,lg:1200,xl:1536},unit:n="px",step:r=5,...o}=e,s=Fv(t),i=Object.keys(s);function l(m){return`@media (min-width:${typeof t[m]=="number"?t[m]:m}${n})`}function c(m){return`@media (max-width:${(typeof t[m]=="number"?t[m]:m)-r/100}${n})`}function u(m,h){const g=i.indexOf(h);return`@media (min-width:${typeof t[m]=="number"?t[m]:m}${n}) and (max-width:${(g!==-1&&typeof t[i[g]]=="number"?t[i[g]]:h)-r/100}${n})`}function d(m){return i.indexOf(m)+1<i.length?u(m,i[i.indexOf(m)+1]):l(m)}function f(m){const h=i.indexOf(m);return h===0?l(i[1]):h===i.length-1?c(i[h]):u(m,i[i.indexOf(m)+1]).replace("@media","@media not all and")}return{keys:i,values:s,up:l,down:c,between:u,only:d,not:f,unit:n,...o}}const Lv={borderRadius:4};function Bv(e=8,t=Mc({spacing:e})){if(e.mui)return e;const n=(...r)=>(r.length===0?[1]:r).map(s=>{const i=t(s);return typeof i=="number"?`${i}px`:i}).join(" ");return n.mui=!0,n}function Vv(e,t){const n=this;if(n.vars){if(!n.colorSchemes?.[e]||typeof n.getColorSchemeSelector!="function")return{};let r=n.getColorSchemeSelector(e);return r==="&"?t:((r.includes("data-")||r.includes("."))&&(r=`*:where(${r.replace(/\s*&$/,"")}) &`),{[r]:t})}return n.palette.mode===e?t:{}}function Oc(e={},...t){const{breakpoints:n={},palette:r={},spacing:o,shape:s={},...i}=e,l=Nv(n),c=Bv(o);let u=Qt({breakpoints:l,direction:"ltr",components:{},palette:{mode:"light",...r},spacing:c,shape:{...Lv,...s}},i);return u=bx(u),u.applyStyles=Vv,u=t.reduce((d,f)=>Qt(d,f),u),u.unstable_sxConfig={...vi,...i?.unstable_sxConfig},u.unstable_sx=function(f){return Go({sx:f,theme:this})},u}const zv=Oc();function _v(e=zv){return ih(e)}const zd=(e,t,n,r=[])=>{let o=e;t.forEach((s,i)=>{i===t.length-1?Array.isArray(o)?o[Number(s)]=n:o&&typeof o=="object"&&(o[s]=n):o&&typeof o=="object"&&(o[s]||(o[s]=r.includes(s)?[]:{}),o=o[s])})},Wv=(e,t,n)=>{function r(o,s=[],i=[]){Object.entries(o).forEach(([l,c])=>{(!n||n&&!n([...s,l]))&&c!=null&&(typeof c=="object"&&Object.keys(c).length>0?r(c,[...s,l],Array.isArray(c)?[...i,l]:i):t([...s,l],c,i))})}r(e)},Hv=(e,t)=>typeof t=="number"?["lineHeight","fontWeight","opacity","zIndex"].some(r=>e.includes(r))||e[e.length-1].toLowerCase().includes("opacity")?t:`${t}px`:t;function xl(e,t){const{prefix:n,shouldSkipGeneratingVar:r}=t||{},o={},s={},i={};return Wv(e,(l,c,u)=>{if((typeof c=="string"||typeof c=="number")&&(!r||!r(l,c))){const d=`--${n?`${n}-`:""}${l.join("-")}`,f=Hv(l,c);Object.assign(o,{[d]:f}),zd(s,l,`var(${d})`,u),zd(i,l,`var(${d}, ${f})`,u)}},l=>l[0]==="vars"),{css:o,vars:s,varsWithDefaults:i}}function Uv(e,t={}){const{getSelector:n=x,disableCssColorScheme:r,colorSchemeSelector:o,enableContrastVars:s}=t,{colorSchemes:i={},components:l,defaultColorScheme:c="light",...u}=e,{vars:d,css:f,varsWithDefaults:m}=xl(u,t);let h=m;const g={},{[c]:y,...b}=i;if(Object.entries(b||{}).forEach(([w,M])=>{const{vars:E,css:j,varsWithDefaults:F}=xl(M,t);h=Qt(h,F),g[w]={css:j,vars:E}}),y){const{css:w,vars:M,varsWithDefaults:E}=xl(y,t);h=Qt(h,E),g[c]={css:w,vars:M}}function x(w,M){let E=o;if(o==="class"&&(E=".%s"),o==="data"&&(E="[data-%s]"),o?.startsWith("data-")&&!o.includes("%s")&&(E=`[${o}="%s"]`),w){if(E==="media")return e.defaultColorScheme===w?":root":{[`@media (prefers-color-scheme: ${i[w]?.palette?.mode||w})`]:{":root":M}};if(E)return e.defaultColorScheme===w?`:root, ${E.replace("%s",String(w))}`:E.replace("%s",String(w))}return":root"}return{vars:h,generateThemeVars:()=>{let w={...d};return Object.entries(g).forEach(([,{vars:M}])=>{w=Qt(w,M)}),w},generateStyleSheets:()=>{const w=[],M=e.defaultColorScheme||"light";function E(O,V){Object.keys(V).length&&w.push(typeof O=="string"?{[O]:{...V}}:O)}E(n(void 0,{...f}),f);const{[M]:j,...F}=g;if(j){const{css:O}=j,V=i[M]?.palette?.mode,L=!r&&V?{colorScheme:V,...O}:{...O};E(n(M,{...L}),L)}return Object.entries(F).forEach(([O,{css:V}])=>{const L=i[O]?.palette?.mode,v=!r&&L?{colorScheme:L,...V}:{...V};E(n(O,{...v}),v)}),s&&w.push({":root":{"--__l-threshold":"0.7","--__l":"clamp(0, (l / var(--__l-threshold) - 1) * -infinity, 1)","--__a":"clamp(0.87, (l / var(--__l-threshold) - 1) * -infinity, 1)"}}),w}}}function qv(e){const t={};return Object.entries(e).forEach(r=>{const[o,s]=r;typeof s=="object"&&(t[o]=`${s.fontStyle?`${s.fontStyle} `:""}${s.fontVariant?`${s.fontVariant} `:""}${s.fontWeight?`${s.fontWeight} `:""}${s.fontStretch?`${s.fontStretch} `:""}${s.fontSize||""}${s.lineHeight?`/${s.lineHeight} `:""}${s.fontFamily||""}`)}),t}function Yv(e){return function(n){return e==="media"?`@media (prefers-color-scheme: ${n})`:e?e.startsWith("data-")&&!e.includes("%s")?`[${e}="${n}"] &`:e==="class"?`.${n} &`:e==="data"?`[data-${n}] &`:`${e.replace("%s",n)} &`:"&"}}const Kv={active:"active",checked:"checked",completed:"completed",disabled:"disabled",error:"error",expanded:"expanded",focused:"focused",focusVisible:"focusVisible",open:"open",readOnly:"readOnly",required:"required",selected:"selected"};function $e(e,t,n="Mui"){const r=Kv[t];return r?`${n}-${r}`:`${Zf.generate(e)}-${t}`}function Gv(e,t){return{toolbar:{minHeight:56,[e.up("xs")]:{"@media (orientation: landscape)":{minHeight:48}},[e.up("sm")]:{minHeight:64}},...t}}function Zv(e){return Math.round(e*1e5)/1e5}const _d={textTransform:"uppercase"},Wd='"Roboto", "Helvetica", "Arial", sans-serif';function Xv(e,t){const{fontFamily:n=Wd,fontSize:r=14,fontWeightLight:o=300,fontWeightRegular:s=400,fontWeightMedium:i=500,fontWeightBold:l=700,htmlFontSize:c=16,allVariants:u,pxToRem:d,...f}=typeof t=="function"?t(e):t,m=r/14,h=d||(b=>`${b/c*m}rem`),g=(b,x,C,T,w)=>({fontFamily:n,fontWeight:b,fontSize:h(x),lineHeight:C,...n===Wd?{letterSpacing:`${Zv(T/x)}em`}:{},...w,...u}),y={h1:g(o,96,1.167,-1.5),h2:g(o,60,1.2,-.5),h3:g(s,48,1.167,0),h4:g(s,34,1.235,.25),h5:g(s,24,1.334,0),h6:g(i,20,1.6,.15),subtitle1:g(s,16,1.75,.15),subtitle2:g(i,14,1.57,.1),body1:g(s,16,1.5,.15),body2:g(s,14,1.43,.15),button:g(i,14,1.75,.4,_d),caption:g(s,12,1.66,.4),overline:g(s,12,2.66,1,_d),inherit:{fontFamily:"inherit",fontWeight:"inherit",fontSize:"inherit",lineHeight:"inherit",letterSpacing:"inherit"}};return Qt({htmlFontSize:c,pxToRem:h,fontFamily:n,fontSize:r,fontWeightLight:o,fontWeightRegular:s,fontWeightMedium:i,fontWeightBold:l,...y},f,{clone:!1})}const Qv=.2,Jv=.14,e0=.12;function Mt(...e){return[`${e[0]}px ${e[1]}px ${e[2]}px ${e[3]}px rgba(0,0,0,${Qv})`,`${e[4]}px ${e[5]}px ${e[6]}px ${e[7]}px rgba(0,0,0,${Jv})`,`${e[8]}px ${e[9]}px ${e[10]}px ${e[11]}px rgba(0,0,0,${e0})`].join(",")}const t0=["none",Mt(0,2,1,-1,0,1,1,0,0,1,3,0),Mt(0,3,1,-2,0,2,2,0,0,1,5,0),Mt(0,3,3,-2,0,3,4,0,0,1,8,0),Mt(0,2,4,-1,0,4,5,0,0,1,10,0),Mt(0,3,5,-1,0,5,8,0,0,1,14,0),Mt(0,3,5,-1,0,6,10,0,0,1,18,0),Mt(0,4,5,-2,0,7,10,1,0,2,16,1),Mt(0,5,5,-3,0,8,10,1,0,3,14,2),Mt(0,5,6,-3,0,9,12,1,0,3,16,2),Mt(0,6,6,-3,0,10,14,1,0,4,18,3),Mt(0,6,7,-4,0,11,15,1,0,4,20,3),Mt(0,7,8,-4,0,12,17,2,0,5,22,4),Mt(0,7,8,-4,0,13,19,2,0,5,24,4),Mt(0,7,9,-4,0,14,21,2,0,5,26,4),Mt(0,8,9,-5,0,15,22,2,0,6,28,5),Mt(0,8,10,-5,0,16,24,2,0,6,30,5),Mt(0,8,11,-5,0,17,26,2,0,6,32,5),Mt(0,9,11,-5,0,18,28,2,0,7,34,6),Mt(0,9,12,-6,0,19,29,2,0,7,36,6),Mt(0,10,13,-6,0,20,31,3,0,8,38,7),Mt(0,10,13,-6,0,21,33,3,0,8,40,7),Mt(0,10,14,-6,0,22,35,3,0,8,42,7),Mt(0,11,14,-7,0,23,36,3,0,9,44,8),Mt(0,11,15,-7,0,24,38,3,0,9,46,8)],n0={easeInOut:"cubic-bezier(0.4, 0, 0.2, 1)",easeOut:"cubic-bezier(0.0, 0, 0.2, 1)",easeIn:"cubic-bezier(0.4, 0, 1, 1)",sharp:"cubic-bezier(0.4, 0, 0.6, 1)"},ah={shortest:150,shorter:200,short:250,standard:300,complex:375,enteringScreen:225,leavingScreen:195};function Hd(e){return`${Math.round(e)}ms`}function r0(e){if(!e)return 0;const t=e/36;return Math.min(Math.round((4+15*t**.25+t/5)*10),3e3)}function o0(e){const t={...n0,...e.easing},n={...ah,...e.duration};return{getAutoHeightDuration:r0,create:(o=["all"],s={})=>{const{duration:i=n.standard,easing:l=t.easeInOut,delay:c=0,...u}=s;return(Array.isArray(o)?o:[o]).map(d=>`${d} ${typeof i=="string"?i:Hd(i)} ${l} ${typeof c=="string"?c:Hd(c)}`).join(",")},...e,easing:t,duration:n}}const s0={mobileStepper:1e3,fab:1050,speedDial:1050,appBar:1100,drawer:1200,modal:1300,snackbar:1400,tooltip:1500};function i0(e){return tr(e)||typeof e>"u"||typeof e=="string"||typeof e=="boolean"||typeof e=="number"||Array.isArray(e)}function lh(e={}){const t={...e};function n(r){const o=Object.entries(r);for(let s=0;s<o.length;s++){const[i,l]=o[s];!i0(l)||i.startsWith("unstable_")?delete r[i]:tr(l)&&(r[i]={...l},n(r[i]))}}return n(t),`import { unstable_createBreakpoints as createBreakpoints, createTransitions } from '@mui/material/styles';
14
+
15
+ const theme = ${JSON.stringify(t,null,2)};
16
+
17
+ theme.breakpoints = createBreakpoints(theme.breakpoints || {});
18
+ theme.transitions = createTransitions(theme.transitions || {});
19
+
20
+ export default theme;`}function Ud(e){return typeof e=="number"?`${(e*100).toFixed(0)}%`:`calc((${e}) * 100%)`}const a0=e=>{if(!Number.isNaN(+e))return+e;const t=e.match(/\d*\.?\d+/g);if(!t)return 0;let n=0;for(let r=0;r<t.length;r+=1)n+=+t[r];return n};function l0(e){Object.assign(e,{alpha(t,n){const r=this||e;return r.colorSpace?`oklch(from ${t} l c h / ${typeof n=="string"?`calc(${n})`:n})`:r.vars?`rgba(${t.replace(/var\(--([^,\s)]+)(?:,[^)]+)?\)+/g,"var(--$1Channel)")} / ${typeof n=="string"?`calc(${n})`:n})`:ma(t,a0(n))},lighten(t,n){const r=this||e;return r.colorSpace?`color-mix(in ${r.colorSpace}, ${t}, #fff ${Ud(n)})`:Va(t,n)},darken(t,n){const r=this||e;return r.colorSpace?`color-mix(in ${r.colorSpace}, ${t}, #000 ${Ud(n)})`:Ba(t,n)}})}function Hl(e={},...t){const{breakpoints:n,mixins:r={},spacing:o,palette:s={},transitions:i={},typography:l={},shape:c,colorSpace:u,...d}=e;if(e.vars&&e.generateThemeVars===void 0)throw new Error(yr(20));const f=Ec({...s,colorSpace:u}),m=Oc(e);let h=Qt(m,{mixins:Gv(m.breakpoints,r),palette:f,shadows:t0.slice(),typography:Xv(f,l),transitions:o0(i),zIndex:{...s0}});return h=Qt(h,d),h=t.reduce((g,y)=>Qt(g,y),h),h.unstable_sxConfig={...vi,...d?.unstable_sxConfig},h.unstable_sx=function(y){return Go({sx:y,theme:this})},h.toRuntimeSource=lh,l0(h),h}function Ul(e){let t;return e<1?t=5.11916*e**2:t=4.5*Math.log(e+1)+2,Math.round(t*10)/1e3}const c0=[...Array(25)].map((e,t)=>{if(t===0)return"none";const n=Ul(t);return`linear-gradient(rgba(255 255 255 / ${n}), rgba(255 255 255 / ${n}))`});function ch(e){return{inputPlaceholder:e==="dark"?.5:.42,inputUnderline:e==="dark"?.7:.42,switchTrackDisabled:e==="dark"?.2:.12,switchTrack:e==="dark"?.3:.38}}function uh(e){return e==="dark"?c0:[]}function u0(e){const{palette:t={mode:"light"},opacity:n,overlays:r,colorSpace:o,...s}=e,i=Ec({...t,colorSpace:o});return{palette:i,opacity:{...ch(i.mode),...n},overlays:r||uh(i.mode),...s}}function d0(e){return!!e[0].match(/(cssVarPrefix|colorSchemeSelector|modularCssLayers|rootSelector|typography|mixins|breakpoints|direction|transitions)/)||!!e[0].match(/sxConfig$/)||e[0]==="palette"&&!!e[1]?.match(/(mode|contrastThreshold|tonalOffset)/)}const p0=e=>[...[...Array(25)].map((t,n)=>`--${e?`${e}-`:""}overlays-${n}`),`--${e?`${e}-`:""}palette-AppBar-darkBg`,`--${e?`${e}-`:""}palette-AppBar-darkColor`],f0=e=>(t,n)=>{const r=e.rootSelector||":root",o=e.colorSchemeSelector;let s=o;if(o==="class"&&(s=".%s"),o==="data"&&(s="[data-%s]"),o?.startsWith("data-")&&!o.includes("%s")&&(s=`[${o}="%s"]`),e.defaultColorScheme===t){if(t==="dark"){const i={};return p0(e.cssVarPrefix).forEach(l=>{i[l]=n[l],delete n[l]}),s==="media"?{[r]:n,"@media (prefers-color-scheme: dark)":{[r]:i}}:s?{[s.replace("%s",t)]:i,[`${r}, ${s.replace("%s",t)}`]:n}:{[r]:{...n,...i}}}if(s&&s!=="media")return`${r}, ${s.replace("%s",String(t))}`}else if(t){if(s==="media")return{[`@media (prefers-color-scheme: ${String(t)})`]:{[r]:n}};if(s)return s.replace("%s",String(t))}return r};function h0(e,t){t.forEach(n=>{e[n]||(e[n]={})})}function ye(e,t,n){!e[t]&&n&&(e[t]=n)}function Ws(e){return typeof e!="string"||!e.startsWith("hsl")?e:th(e)}function pr(e,t){`${t}Channel`in e||(e[`${t}Channel`]=_s(Ws(e[t])))}function m0(e){return typeof e=="number"?`${e}px`:typeof e=="string"||typeof e=="function"||Array.isArray(e)?e:"8px"}const Zn=e=>{try{return e()}catch{}},g0=(e="mui")=>st.unstable_createGetCssVar(e);function vl(e,t,n,r,o){if(!n)return;n=n===!0?{}:n;const s=o==="dark"?"dark":"light";if(!r){t[o]=u0({...n,palette:{mode:s,...n?.palette},colorSpace:e});return}const{palette:i,...l}=Hl({...r,palette:{mode:s,...n?.palette},colorSpace:e});return t[o]={...n,palette:i,opacity:{...ch(s),...n?.opacity},overlays:n?.overlays||uh(s)},l}function y0(e={},...t){const{colorSchemes:n={light:!0},defaultColorScheme:r,disableCssColorScheme:o=!1,cssVarPrefix:s="mui",nativeColor:i=!1,shouldSkipGeneratingVar:l=d0,colorSchemeSelector:c=n.light&&n.dark?"media":void 0,rootSelector:u=":root",...d}=e,f=Object.keys(n)[0],m=r||(n.light&&f!=="light"?"light":f),h=g0(s),{[m]:g,light:y,dark:b,...x}=n,C={...x};let T=g;if((m==="dark"&&!("dark"in n)||m==="light"&&!("light"in n))&&(T=!0),!T)throw new Error(yr(21,m));let w;i&&(w="oklch");const M=vl(w,C,T,d,m);y&&!C.light&&vl(w,C,y,void 0,"light"),b&&!C.dark&&vl(w,C,b,void 0,"dark");let E={defaultColorScheme:m,...M,cssVarPrefix:s,colorSchemeSelector:c,rootSelector:u,getCssVar:h,colorSchemes:C,font:{...qv(M.typography),...M.font},spacing:m0(d.spacing)};Object.keys(E.colorSchemes).forEach(L=>{const v=E.colorSchemes[L].palette,N=$=>{const R=$.split("-"),_=R[1],z=R[2];return h($,v[_][z])};v.mode==="light"&&(ye(v.common,"background","#fff"),ye(v.common,"onBackground","#000")),v.mode==="dark"&&(ye(v.common,"background","#000"),ye(v.common,"onBackground","#fff"));function A($,R,_){if(w){let z;return $===Wr&&(z=`transparent ${((1-_)*100).toFixed(0)}%`),$===ht&&(z=`#000 ${(_*100).toFixed(0)}%`),$===mt&&(z=`#fff ${(_*100).toFixed(0)}%`),`color-mix(in ${w}, ${R}, ${z})`}return $(R,_)}if(h0(v,["Alert","AppBar","Avatar","Button","Chip","FilledInput","LinearProgress","Skeleton","Slider","SnackbarContent","SpeedDialAction","StepConnector","StepContent","Switch","TableCell","Tooltip"]),v.mode==="light"){ye(v.Alert,"errorColor",A(ht,v.error.light,.6)),ye(v.Alert,"infoColor",A(ht,v.info.light,.6)),ye(v.Alert,"successColor",A(ht,v.success.light,.6)),ye(v.Alert,"warningColor",A(ht,v.warning.light,.6)),ye(v.Alert,"errorFilledBg",N("palette-error-main")),ye(v.Alert,"infoFilledBg",N("palette-info-main")),ye(v.Alert,"successFilledBg",N("palette-success-main")),ye(v.Alert,"warningFilledBg",N("palette-warning-main")),ye(v.Alert,"errorFilledColor",Zn(()=>v.getContrastText(v.error.main))),ye(v.Alert,"infoFilledColor",Zn(()=>v.getContrastText(v.info.main))),ye(v.Alert,"successFilledColor",Zn(()=>v.getContrastText(v.success.main))),ye(v.Alert,"warningFilledColor",Zn(()=>v.getContrastText(v.warning.main))),ye(v.Alert,"errorStandardBg",A(mt,v.error.light,.9)),ye(v.Alert,"infoStandardBg",A(mt,v.info.light,.9)),ye(v.Alert,"successStandardBg",A(mt,v.success.light,.9)),ye(v.Alert,"warningStandardBg",A(mt,v.warning.light,.9)),ye(v.Alert,"errorIconColor",N("palette-error-main")),ye(v.Alert,"infoIconColor",N("palette-info-main")),ye(v.Alert,"successIconColor",N("palette-success-main")),ye(v.Alert,"warningIconColor",N("palette-warning-main")),ye(v.AppBar,"defaultBg",N("palette-grey-100")),ye(v.Avatar,"defaultBg",N("palette-grey-400")),ye(v.Button,"inheritContainedBg",N("palette-grey-300")),ye(v.Button,"inheritContainedHoverBg",N("palette-grey-A100")),ye(v.Chip,"defaultBorder",N("palette-grey-400")),ye(v.Chip,"defaultAvatarColor",N("palette-grey-700")),ye(v.Chip,"defaultIconColor",N("palette-grey-700")),ye(v.FilledInput,"bg","rgba(0, 0, 0, 0.06)"),ye(v.FilledInput,"hoverBg","rgba(0, 0, 0, 0.09)"),ye(v.FilledInput,"disabledBg","rgba(0, 0, 0, 0.12)"),ye(v.LinearProgress,"primaryBg",A(mt,v.primary.main,.62)),ye(v.LinearProgress,"secondaryBg",A(mt,v.secondary.main,.62)),ye(v.LinearProgress,"errorBg",A(mt,v.error.main,.62)),ye(v.LinearProgress,"infoBg",A(mt,v.info.main,.62)),ye(v.LinearProgress,"successBg",A(mt,v.success.main,.62)),ye(v.LinearProgress,"warningBg",A(mt,v.warning.main,.62)),ye(v.Skeleton,"bg",w?A(Wr,v.text.primary,.11):`rgba(${N("palette-text-primaryChannel")} / 0.11)`),ye(v.Slider,"primaryTrack",A(mt,v.primary.main,.62)),ye(v.Slider,"secondaryTrack",A(mt,v.secondary.main,.62)),ye(v.Slider,"errorTrack",A(mt,v.error.main,.62)),ye(v.Slider,"infoTrack",A(mt,v.info.main,.62)),ye(v.Slider,"successTrack",A(mt,v.success.main,.62)),ye(v.Slider,"warningTrack",A(mt,v.warning.main,.62));const $=w?A(ht,v.background.default,.6825):Vi(v.background.default,.8);ye(v.SnackbarContent,"bg",$),ye(v.SnackbarContent,"color",Zn(()=>w?Wl.text.primary:v.getContrastText($))),ye(v.SpeedDialAction,"fabHoverBg",Vi(v.background.paper,.15)),ye(v.StepConnector,"border",N("palette-grey-400")),ye(v.StepContent,"border",N("palette-grey-400")),ye(v.Switch,"defaultColor",N("palette-common-white")),ye(v.Switch,"defaultDisabledColor",N("palette-grey-100")),ye(v.Switch,"primaryDisabledColor",A(mt,v.primary.main,.62)),ye(v.Switch,"secondaryDisabledColor",A(mt,v.secondary.main,.62)),ye(v.Switch,"errorDisabledColor",A(mt,v.error.main,.62)),ye(v.Switch,"infoDisabledColor",A(mt,v.info.main,.62)),ye(v.Switch,"successDisabledColor",A(mt,v.success.main,.62)),ye(v.Switch,"warningDisabledColor",A(mt,v.warning.main,.62)),ye(v.TableCell,"border",A(mt,A(Wr,v.divider,1),.88)),ye(v.Tooltip,"bg",A(Wr,v.grey[700],.92))}if(v.mode==="dark"){ye(v.Alert,"errorColor",A(mt,v.error.light,.6)),ye(v.Alert,"infoColor",A(mt,v.info.light,.6)),ye(v.Alert,"successColor",A(mt,v.success.light,.6)),ye(v.Alert,"warningColor",A(mt,v.warning.light,.6)),ye(v.Alert,"errorFilledBg",N("palette-error-dark")),ye(v.Alert,"infoFilledBg",N("palette-info-dark")),ye(v.Alert,"successFilledBg",N("palette-success-dark")),ye(v.Alert,"warningFilledBg",N("palette-warning-dark")),ye(v.Alert,"errorFilledColor",Zn(()=>v.getContrastText(v.error.dark))),ye(v.Alert,"infoFilledColor",Zn(()=>v.getContrastText(v.info.dark))),ye(v.Alert,"successFilledColor",Zn(()=>v.getContrastText(v.success.dark))),ye(v.Alert,"warningFilledColor",Zn(()=>v.getContrastText(v.warning.dark))),ye(v.Alert,"errorStandardBg",A(ht,v.error.light,.9)),ye(v.Alert,"infoStandardBg",A(ht,v.info.light,.9)),ye(v.Alert,"successStandardBg",A(ht,v.success.light,.9)),ye(v.Alert,"warningStandardBg",A(ht,v.warning.light,.9)),ye(v.Alert,"errorIconColor",N("palette-error-main")),ye(v.Alert,"infoIconColor",N("palette-info-main")),ye(v.Alert,"successIconColor",N("palette-success-main")),ye(v.Alert,"warningIconColor",N("palette-warning-main")),ye(v.AppBar,"defaultBg",N("palette-grey-900")),ye(v.AppBar,"darkBg",N("palette-background-paper")),ye(v.AppBar,"darkColor",N("palette-text-primary")),ye(v.Avatar,"defaultBg",N("palette-grey-600")),ye(v.Button,"inheritContainedBg",N("palette-grey-800")),ye(v.Button,"inheritContainedHoverBg",N("palette-grey-700")),ye(v.Chip,"defaultBorder",N("palette-grey-700")),ye(v.Chip,"defaultAvatarColor",N("palette-grey-300")),ye(v.Chip,"defaultIconColor",N("palette-grey-300")),ye(v.FilledInput,"bg","rgba(255, 255, 255, 0.09)"),ye(v.FilledInput,"hoverBg","rgba(255, 255, 255, 0.13)"),ye(v.FilledInput,"disabledBg","rgba(255, 255, 255, 0.12)"),ye(v.LinearProgress,"primaryBg",A(ht,v.primary.main,.5)),ye(v.LinearProgress,"secondaryBg",A(ht,v.secondary.main,.5)),ye(v.LinearProgress,"errorBg",A(ht,v.error.main,.5)),ye(v.LinearProgress,"infoBg",A(ht,v.info.main,.5)),ye(v.LinearProgress,"successBg",A(ht,v.success.main,.5)),ye(v.LinearProgress,"warningBg",A(ht,v.warning.main,.5)),ye(v.Skeleton,"bg",w?A(Wr,v.text.primary,.13):`rgba(${N("palette-text-primaryChannel")} / 0.13)`),ye(v.Slider,"primaryTrack",A(ht,v.primary.main,.5)),ye(v.Slider,"secondaryTrack",A(ht,v.secondary.main,.5)),ye(v.Slider,"errorTrack",A(ht,v.error.main,.5)),ye(v.Slider,"infoTrack",A(ht,v.info.main,.5)),ye(v.Slider,"successTrack",A(ht,v.success.main,.5)),ye(v.Slider,"warningTrack",A(ht,v.warning.main,.5));const $=w?A(mt,v.background.default,.985):Vi(v.background.default,.98);ye(v.SnackbarContent,"bg",$),ye(v.SnackbarContent,"color",Zn(()=>w?rh.text.primary:v.getContrastText($))),ye(v.SpeedDialAction,"fabHoverBg",Vi(v.background.paper,.15)),ye(v.StepConnector,"border",N("palette-grey-600")),ye(v.StepContent,"border",N("palette-grey-600")),ye(v.Switch,"defaultColor",N("palette-grey-300")),ye(v.Switch,"defaultDisabledColor",N("palette-grey-600")),ye(v.Switch,"primaryDisabledColor",A(ht,v.primary.main,.55)),ye(v.Switch,"secondaryDisabledColor",A(ht,v.secondary.main,.55)),ye(v.Switch,"errorDisabledColor",A(ht,v.error.main,.55)),ye(v.Switch,"infoDisabledColor",A(ht,v.info.main,.55)),ye(v.Switch,"successDisabledColor",A(ht,v.success.main,.55)),ye(v.Switch,"warningDisabledColor",A(ht,v.warning.main,.55)),ye(v.TableCell,"border",A(ht,A(Wr,v.divider,1),.68)),ye(v.Tooltip,"bg",A(Wr,v.grey[700],.92))}pr(v.background,"default"),pr(v.background,"paper"),pr(v.common,"background"),pr(v.common,"onBackground"),pr(v,"divider"),Object.keys(v).forEach($=>{const R=v[$];$!=="tonalOffset"&&R&&typeof R=="object"&&(R.main&&ye(v[$],"mainChannel",_s(Ws(R.main))),R.light&&ye(v[$],"lightChannel",_s(Ws(R.light))),R.dark&&ye(v[$],"darkChannel",_s(Ws(R.dark))),R.contrastText&&ye(v[$],"contrastTextChannel",_s(Ws(R.contrastText))),$==="text"&&(pr(v[$],"primary"),pr(v[$],"secondary")),$==="action"&&(R.active&&pr(v[$],"active"),R.selected&&pr(v[$],"selected")))})}),E=t.reduce((L,v)=>Qt(L,v),E);const j={prefix:s,disableCssColorScheme:o,shouldSkipGeneratingVar:l,getSelector:f0(E),enableContrastVars:i},{vars:F,generateThemeVars:O,generateStyleSheets:V}=Uv(E,j);return E.vars=F,Object.entries(E.colorSchemes[E.defaultColorScheme]).forEach(([L,v])=>{E[L]=v}),E.generateThemeVars=O,E.generateStyleSheets=V,E.generateSpacing=function(){return st.createSpacing(d.spacing,Mc(this))},E.getColorSchemeSelector=Yv(c),E.spacing=E.generateSpacing(),E.shouldSkipGeneratingVar=l,E.unstable_sxConfig={...vi,...d?.unstable_sxConfig},E.unstable_sx=function(v){return Go({sx:v,theme:this})},E.toRuntimeSource=lh,E}function qd(e,t,n){e.colorSchemes&&n&&(e.colorSchemes[t]={...n!==!0&&n,palette:Ec({...n===!0?{}:n.palette,mode:t})})}function dh(e={},...t){const{palette:n,cssVariables:r=!1,colorSchemes:o=n?void 0:{light:!0},defaultColorScheme:s=n?.mode,...i}=e,l=s||"light",c=o?.[l],u={...o,...n?{[l]:{...typeof c!="boolean"&&c,palette:n}}:void 0};if(r===!1){if(!("colorSchemes"in e))return Hl(e,...t);let d=n;"palette"in e||u[l]&&(u[l]!==!0?d=u[l].palette:l==="dark"&&(d={mode:"dark"}));const f=Hl({...e,palette:d},...t);return f.defaultColorScheme=l,f.colorSchemes=u,f.palette.mode==="light"&&(f.colorSchemes.light={...u.light!==!0&&u.light,palette:f.palette},qd(f,"dark",u.dark)),f.palette.mode==="dark"&&(f.colorSchemes.dark={...u.dark!==!0&&u.dark,palette:f.palette},qd(f,"light",u.light)),f}return!n&&!("light"in u)&&l==="light"&&(u.light=!0),y0({...i,colorSchemes:u,defaultColorScheme:l,...typeof r!="boolean"&&r},...t)}const za=dh(),rs="$$material";function $r(){const e=st.useTheme(za);return e[rs]||e}function b0(e){return a.jsx(st.GlobalStyles,{...e,defaultTheme:za,themeId:rs})}function x0(e){const{variants:t,...n}=e,r={variants:t,style:to(n),isProcessed:!0};return r.style===n||t&&t.forEach(o=>{typeof o.style!="function"&&(o.style=to(o.style))}),r}const v0=Oc();function Or(e){return e!=="ownerState"&&e!=="theme"&&e!=="sx"&&e!=="as"}function Jr(e,t){return t&&e&&typeof e=="object"&&e.styles&&!e.styles.startsWith("@layer")&&(e.styles=`@layer ${t}{${String(e.styles)}}`),e}function S0(e){return e?(t,n)=>n[e]:null}function C0(e,t,n){e.theme=T0(e.theme)?n:e.theme[t]||e.theme}function ea(e,t,n){const r=typeof t=="function"?t(e):t;if(Array.isArray(r))return r.flatMap(o=>ea(e,o,n));if(Array.isArray(r?.variants)){let o;if(r.isProcessed)o=n?Jr(r.style,n):r.style;else{const{variants:s,...i}=r;o=n?Jr(to(i),n):i}return ph(e,r.variants,[o],n)}return r?.isProcessed?n?Jr(to(r.style),n):r.style:n?Jr(to(r),n):r}function ph(e,t,n=[],r=void 0){let o;e:for(let s=0;s<t.length;s+=1){const i=t[s];if(typeof i.props=="function"){if(o??={...e,...e.ownerState,ownerState:e.ownerState},!i.props(o))continue}else for(const l in i.props)if(e[l]!==i.props[l]&&e.ownerState?.[l]!==i.props[l])continue e;typeof i.style=="function"?(o??={...e,...e.ownerState,ownerState:e.ownerState},n.push(r?Jr(to(i.style(o)),r):i.style(o))):n.push(r?Jr(to(i.style),r):i.style)}return n}function w0(e={}){const{themeId:t,defaultTheme:n=v0,rootShouldForwardProp:r=Or,slotShouldForwardProp:o=Or}=e;function s(l){C0(l,t,n)}return(l,c={})=>{Dv(l,E=>E.filter(j=>j!==Go));const{name:u,slot:d,skipVariantsResolver:f,skipSx:m,overridesResolver:h=S0(M0(d)),...g}=c,y=u&&u.startsWith("Mui")||d?"components":"custom",b=f!==void 0?f:d&&d!=="Root"&&d!=="root"||!1,x=m||!1;let C=Or;d==="Root"||d==="root"?C=r:d?C=o:I0(l)&&(C=void 0);const T=Mv(l,{shouldForwardProp:C,label:k0(),...g}),w=E=>{if(E.__emotion_real===E)return E;if(typeof E=="function")return function(F){return ea(F,E,F.theme.modularCssLayers?y:void 0)};if(tr(E)){const j=x0(E);return function(O){return j.variants?ea(O,j,O.theme.modularCssLayers?y:void 0):O.theme.modularCssLayers?Jr(j.style,y):j.style}}return E},M=(...E)=>{const j=[],F=E.map(w),O=[];if(j.push(s),u&&h&&O.push(function(N){const $=N.theme.components?.[u]?.styleOverrides;if(!$)return null;const R={};for(const _ in $)R[_]=ea(N,$[_],N.theme.modularCssLayers?"theme":void 0);return h(N,R)}),u&&!b&&O.push(function(N){const $=N.theme?.components?.[u]?.variants;return $?ph(N,$,[],N.theme.modularCssLayers?"theme":void 0):null}),x||O.push(Go),Array.isArray(F[0])){const v=F.shift(),N=new Array(j.length).fill(""),A=new Array(O.length).fill("");let $;$=[...N,...v,...A],$.raw=[...N,...v.raw,...A],j.unshift($)}const V=[...j,...F,...O],L=T(...V);return l.muiName&&(L.muiName=l.muiName),L};return T.withConfig&&(M.withConfig=T.withConfig),M}}function k0(e,t){return void 0}function T0(e){for(const t in e)return!1;return!0}function I0(e){return typeof e=="string"&&e.charCodeAt(0)>96}function M0(e){return e&&e.charAt(0).toLowerCase()+e.slice(1)}function fh(e){return e!=="ownerState"&&e!=="theme"&&e!=="sx"&&e!=="as"}const nn=e=>fh(e)&&e!=="classes",re=w0({themeId:rs,defaultTheme:za,rootShouldForwardProp:nn});function D0(e){return function(n){return a.jsx(b0,{styles:typeof e=="function"?r=>e({theme:r,...n}):e})}}function P0(){return av}const He=st.unstable_memoTheme;function We(e){return jv(e)}function Ee(e,t,n="Mui"){const r={};return t.forEach(o=>{r[o]=$e(e,o,n)}),r}function E0(e){return $e("MuiSvgIcon",e)}Ee("MuiSvgIcon",["root","colorPrimary","colorSecondary","colorAction","colorError","colorDisabled","fontSizeInherit","fontSizeSmall","fontSizeMedium","fontSizeLarge"]);const O0=e=>{const{color:t,fontSize:n,classes:r}=e,o={root:["root",t!=="inherit"&&`color${ve(t)}`,`fontSize${ve(n)}`]};return Re(o,E0,r)},R0=re("svg",{name:"MuiSvgIcon",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.color!=="inherit"&&t[`color${ve(n.color)}`],t[`fontSize${ve(n.fontSize)}`]]}})(He(({theme:e})=>({userSelect:"none",width:"1em",height:"1em",display:"inline-block",flexShrink:0,transition:e.transitions?.create?.("fill",{duration:(e.vars??e).transitions?.duration?.shorter}),variants:[{props:t=>!t.hasSvgAsChild,style:{fill:"currentColor"}},{props:{fontSize:"inherit"},style:{fontSize:"inherit"}},{props:{fontSize:"small"},style:{fontSize:e.typography?.pxToRem?.(20)||"1.25rem"}},{props:{fontSize:"medium"},style:{fontSize:e.typography?.pxToRem?.(24)||"1.5rem"}},{props:{fontSize:"large"},style:{fontSize:e.typography?.pxToRem?.(35)||"2.1875rem"}},...Object.entries((e.vars??e).palette).filter(([,t])=>t&&t.main).map(([t])=>({props:{color:t},style:{color:(e.vars??e).palette?.[t]?.main}})),{props:{color:"action"},style:{color:(e.vars??e).palette?.action?.active}},{props:{color:"disabled"},style:{color:(e.vars??e).palette?.action?.disabled}},{props:{color:"inherit"},style:{color:void 0}}]}))),ya=D.forwardRef(function(t,n){const r=We({props:t,name:"MuiSvgIcon"}),{children:o,className:s,color:i="inherit",component:l="svg",fontSize:c="medium",htmlColor:u,inheritViewBox:d=!1,titleAccess:f,viewBox:m="0 0 24 24",...h}=r,g=D.isValidElement(o)&&o.type==="svg",y={...r,color:i,component:l,fontSize:c,instanceFontSize:t.fontSize,inheritViewBox:d,viewBox:m,hasSvgAsChild:g},b={};d||(b.viewBox=m);const x=O0(y);return a.jsxs(R0,{as:l,className:Te(x.root,s),focusable:"false",color:u,"aria-hidden":f?void 0:!0,role:f?"img":void 0,ref:n,...b,...h,...g&&o.props,ownerState:y,children:[g?o.props.children:o,f?a.jsx("title",{children:f}):null]})});ya.muiName="SvgIcon";function Xe(e,t){function n(r,o){return a.jsx(ya,{"data-testid":void 0,ref:o,...r,children:e})}return n.muiName=ya.muiName,D.memo(D.forwardRef(n))}function hh(e,t=166){let n;function r(...o){const s=()=>{e.apply(this,o)};clearTimeout(n),n=setTimeout(s,t)}return r.clear=()=>{clearTimeout(n)},r}function ta(e,t){return D.isValidElement(e)&&t.indexOf(e.type.muiName??e.type?._payload?.value?.muiName)!==-1}function zt(e){return e&&e.ownerDocument||document}function xr(e){return zt(e).defaultView||window}function ql(e,t){typeof e=="function"?e(t):e&&(e.current=t)}function mn(e){const{controlled:t,default:n,name:r,state:o="value"}=e,{current:s}=D.useRef(t!==void 0),[i,l]=D.useState(n),c=s?t:i,u=D.useCallback(d=>{s||l(d)},[]);return[c,u]}function Me(e){const t=D.useRef(e);return Wt(()=>{t.current=e}),D.useRef((...n)=>(0,t.current)(...n)).current}function Ze(...e){const t=D.useRef(void 0),n=D.useCallback(r=>{const o=e.map(s=>{if(s==null)return null;if(typeof s=="function"){const i=s,l=i(r);return typeof l=="function"?l:()=>{i(null)}}return s.current=r,()=>{s.current=null}});return()=>{o.forEach(s=>s?.())}},e);return D.useMemo(()=>e.every(r=>r==null)?null:r=>{t.current&&(t.current(),t.current=void 0),r!=null&&(t.current=n(r))},e)}function j0(e,t){const n=e.charCodeAt(2);return e[0]==="o"&&e[1]==="n"&&n>=65&&n<=90&&typeof t=="function"}function mh(e,t){if(!e)return t;function n(i,l){const c={};return Object.keys(l).forEach(u=>{j0(u,l[u])&&typeof i[u]=="function"&&(c[u]=(...d)=>{i[u](...d),l[u](...d)})}),c}if(typeof e=="function"||typeof t=="function")return i=>{const l=typeof t=="function"?t(i):t,c=typeof e=="function"?e({...i,...l}):e,u=Te(i?.className,l?.className,c?.className),d=n(c,l);return{...l,...c,...d,...!!u&&{className:u},...l?.style&&c?.style&&{style:{...l.style,...c.style}},...l?.sx&&c?.sx&&{sx:[...Array.isArray(l.sx)?l.sx:[l.sx],...Array.isArray(c.sx)?c.sx:[c.sx]]}}};const r=t,o=n(e,r),s=Te(r?.className,e?.className);return{...t,...e,...o,...!!s&&{className:s},...r?.style&&e?.style&&{style:{...r.style,...e.style}},...r?.sx&&e?.sx&&{sx:[...Array.isArray(r.sx)?r.sx:[r.sx],...Array.isArray(e.sx)?e.sx:[e.sx]]}}}const ba=Xe(a.jsx("path",{d:"M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"}));function U(){return U=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},U.apply(null,arguments)}var na={exports:{}},$0=na.exports,Yd;function A0(){return Yd||(Yd=1,(function(e,t){(function(n,r){e.exports=r()})($0,(function(){var n="week",r="year";return function(o,s,i){var l=s.prototype;l.week=function(c){if(c===void 0&&(c=null),c!==null)return this.add(7*(c-this.week()),"day");var u=this.$locale().yearStart||1;if(this.month()===11&&this.date()>25){var d=i(this).startOf(r).add(1,r).date(u),f=i(this).endOf(n);if(d.isBefore(f))return 1}var m=i(this).startOf(r).date(u).startOf(n).subtract(1,"millisecond"),h=this.diff(m,n,!0);return h<0?i(this).startOf("week").week():Math.ceil(h)},l.weeks=function(c){return c===void 0&&(c=null),this.week(c)}}}))})(na)),na.exports}var F0=A0();const N0=Sr(F0);var ra={exports:{}},L0=ra.exports,Kd;function B0(){return Kd||(Kd=1,(function(e,t){(function(n,r){e.exports=r()})(L0,(function(){var n={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},r=/(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|Q|YYYY|YY?|ww?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g,o=/\d/,s=/\d\d/,i=/\d\d?/,l=/\d*[^-_:/,()\s\d]+/,c={},u=function(b){return(b=+b)+(b>68?1900:2e3)},d=function(b){return function(x){this[b]=+x}},f=[/[+-]\d\d:?(\d\d)?|Z/,function(b){(this.zone||(this.zone={})).offset=(function(x){if(!x||x==="Z")return 0;var C=x.match(/([+-]|\d\d)/g),T=60*C[1]+(+C[2]||0);return T===0?0:C[0]==="+"?-T:T})(b)}],m=function(b){var x=c[b];return x&&(x.indexOf?x:x.s.concat(x.f))},h=function(b,x){var C,T=c.meridiem;if(T){for(var w=1;w<=24;w+=1)if(b.indexOf(T(w,0,x))>-1){C=w>12;break}}else C=b===(x?"pm":"PM");return C},g={A:[l,function(b){this.afternoon=h(b,!1)}],a:[l,function(b){this.afternoon=h(b,!0)}],Q:[o,function(b){this.month=3*(b-1)+1}],S:[o,function(b){this.milliseconds=100*+b}],SS:[s,function(b){this.milliseconds=10*+b}],SSS:[/\d{3}/,function(b){this.milliseconds=+b}],s:[i,d("seconds")],ss:[i,d("seconds")],m:[i,d("minutes")],mm:[i,d("minutes")],H:[i,d("hours")],h:[i,d("hours")],HH:[i,d("hours")],hh:[i,d("hours")],D:[i,d("day")],DD:[s,d("day")],Do:[l,function(b){var x=c.ordinal,C=b.match(/\d+/);if(this.day=C[0],x)for(var T=1;T<=31;T+=1)x(T).replace(/\[|\]/g,"")===b&&(this.day=T)}],w:[i,d("week")],ww:[s,d("week")],M:[i,d("month")],MM:[s,d("month")],MMM:[l,function(b){var x=m("months"),C=(m("monthsShort")||x.map((function(T){return T.slice(0,3)}))).indexOf(b)+1;if(C<1)throw new Error;this.month=C%12||C}],MMMM:[l,function(b){var x=m("months").indexOf(b)+1;if(x<1)throw new Error;this.month=x%12||x}],Y:[/[+-]?\d+/,d("year")],YY:[s,function(b){this.year=u(b)}],YYYY:[/\d{4}/,d("year")],Z:f,ZZ:f};function y(b){var x,C;x=b,C=c&&c.formats;for(var T=(b=x.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,(function(V,L,v){var N=v&&v.toUpperCase();return L||C[v]||n[v]||C[N].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,(function(A,$,R){return $||R.slice(1)}))}))).match(r),w=T.length,M=0;M<w;M+=1){var E=T[M],j=g[E],F=j&&j[0],O=j&&j[1];T[M]=O?{regex:F,parser:O}:E.replace(/^\[|\]$/g,"")}return function(V){for(var L={},v=0,N=0;v<w;v+=1){var A=T[v];if(typeof A=="string")N+=A.length;else{var $=A.regex,R=A.parser,_=V.slice(N),z=$.exec(_)[0];R.call(L,z),V=V.replace(z,"")}}return(function(W){var H=W.afternoon;if(H!==void 0){var G=W.hours;H?G<12&&(W.hours+=12):G===12&&(W.hours=0),delete W.afternoon}})(L),L}}return function(b,x,C){C.p.customParseFormat=!0,b&&b.parseTwoDigitYear&&(u=b.parseTwoDigitYear);var T=x.prototype,w=T.parse;T.parse=function(M){var E=M.date,j=M.utc,F=M.args;this.$u=j;var O=F[1];if(typeof O=="string"){var V=F[2]===!0,L=F[3]===!0,v=V||L,N=F[2];L&&(N=F[2]),c=this.$locale(),!V&&N&&(c=C.Ls[N]),this.$d=(function(_,z,W,H){try{if(["x","X"].indexOf(z)>-1)return new Date((z==="X"?1e3:1)*_);var G=y(z)(_),se=G.year,pe=G.month,me=G.day,X=G.hours,K=G.minutes,le=G.seconds,oe=G.milliseconds,te=G.zone,Z=G.week,J=new Date,ae=me||(se||pe?1:J.getDate()),Q=se||J.getFullYear(),ue=0;se&&!pe||(ue=pe>0?pe-1:J.getMonth());var he,de=X||0,Se=K||0,ce=le||0,Pe=oe||0;return te?new Date(Date.UTC(Q,ue,ae,de,Se,ce,Pe+60*te.offset*1e3)):W?new Date(Date.UTC(Q,ue,ae,de,Se,ce,Pe)):(he=new Date(Q,ue,ae,de,Se,ce,Pe),Z&&(he=H(he).week(Z).toDate()),he)}catch{return new Date("")}})(E,O,j,C),this.init(),N&&N!==!0&&(this.$L=this.locale(N).$L),v&&E!=this.format(O)&&(this.$d=new Date("")),c={}}else if(O instanceof Array)for(var A=O.length,$=1;$<=A;$+=1){F[1]=O[$-1];var R=C.apply(this,F);if(R.isValid()){this.$d=R.$d,this.$L=R.$L,this.init();break}$===A&&(this.$d=new Date(""))}else w.call(this,M)}}}))})(ra)),ra.exports}var V0=B0();const z0=Sr(V0);var oa={exports:{}},_0=oa.exports,Gd;function W0(){return Gd||(Gd=1,(function(e,t){(function(n,r){e.exports=r()})(_0,(function(){var n={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"};return function(r,o,s){var i=o.prototype,l=i.format;s.en.formats=n,i.format=function(c){c===void 0&&(c="YYYY-MM-DDTHH:mm:ssZ");var u=this.$locale().formats,d=(function(f,m){return f.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,(function(h,g,y){var b=y&&y.toUpperCase();return g||m[y]||n[y]||m[b].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,(function(x,C,T){return C||T.slice(1)}))}))})(c,u===void 0?{}:u);return l.call(this,d)}}}))})(oa)),oa.exports}var H0=W0();const U0=Sr(H0);var sa={exports:{}},q0=sa.exports,Zd;function Y0(){return Zd||(Zd=1,(function(e,t){(function(n,r){e.exports=r()})(q0,(function(){return function(n,r,o){r.prototype.isBetween=function(s,i,l,c){var u=o(s),d=o(i),f=(c=c||"()")[0]==="(",m=c[1]===")";return(f?this.isAfter(u,l):!this.isBefore(u,l))&&(m?this.isBefore(d,l):!this.isAfter(d,l))||(f?this.isBefore(u,l):!this.isAfter(u,l))&&(m?this.isAfter(d,l):!this.isBefore(d,l))}}}))})(sa)),sa.exports}var K0=Y0();const G0=Sr(K0);var ia={exports:{}},Z0=ia.exports,Xd;function X0(){return Xd||(Xd=1,(function(e,t){(function(n,r){e.exports=r()})(Z0,(function(){return function(n,r){var o=r.prototype,s=o.format;o.format=function(i){var l=this,c=this.$locale();if(!this.isValid())return s.bind(this)(i);var u=this.$utils(),d=(i||"YYYY-MM-DDTHH:mm:ssZ").replace(/\[([^\]]+)]|Q|wo|ww|w|WW|W|zzz|z|gggg|GGGG|Do|X|x|k{1,2}|S/g,(function(f){switch(f){case"Q":return Math.ceil((l.$M+1)/3);case"Do":return c.ordinal(l.$D);case"gggg":return l.weekYear();case"GGGG":return l.isoWeekYear();case"wo":return c.ordinal(l.week(),"W");case"w":case"ww":return u.s(l.week(),f==="w"?1:2,"0");case"W":case"WW":return u.s(l.isoWeek(),f==="W"?1:2,"0");case"k":case"kk":return u.s(String(l.$H===0?24:l.$H),f==="k"?1:2,"0");case"X":return Math.floor(l.$d.getTime()/1e3);case"x":return l.$d.getTime();case"z":return"["+l.offsetName()+"]";case"zzz":return"["+l.offsetName("long")+"]";default:return f}}));return s.bind(this)(d)}}}))})(ia)),ia.exports}var Q0=X0();const J0=Sr(Q0);Je.extend(U0);Je.extend(N0);Je.extend(G0);Je.extend(J0);const eS={YY:"year",YYYY:{sectionType:"year",contentType:"digit",maxLength:4},M:{sectionType:"month",contentType:"digit",maxLength:2},MM:"month",MMM:{sectionType:"month",contentType:"letter"},MMMM:{sectionType:"month",contentType:"letter"},D:{sectionType:"day",contentType:"digit",maxLength:2},DD:"day",Do:{sectionType:"day",contentType:"digit-with-letter"},d:{sectionType:"weekDay",contentType:"digit",maxLength:2},dd:{sectionType:"weekDay",contentType:"letter"},ddd:{sectionType:"weekDay",contentType:"letter"},dddd:{sectionType:"weekDay",contentType:"letter"},A:"meridiem",a:"meridiem",H:{sectionType:"hours",contentType:"digit",maxLength:2},HH:"hours",h:{sectionType:"hours",contentType:"digit",maxLength:2},hh:"hours",m:{sectionType:"minutes",contentType:"digit",maxLength:2},mm:"minutes",s:{sectionType:"seconds",contentType:"digit",maxLength:2},ss:"seconds"},tS={year:"YYYY",month:"MMMM",monthShort:"MMM",dayOfMonth:"D",dayOfMonthFull:"Do",weekday:"dddd",weekdayShort:"dd",hours24h:"HH",hours12h:"hh",meridiem:"A",minutes:"mm",seconds:"ss",fullDate:"ll",keyboardDate:"L",shortDate:"MMM D",normalDate:"D MMMM",normalDateWithWeekday:"ddd, MMM D",fullTime:"LT",fullTime12h:"hh:mm A",fullTime24h:"HH:mm",keyboardDateTime:"L LT",keyboardDateTime12h:"L hh:mm A",keyboardDateTime24h:"L HH:mm"},Sl=["Missing UTC plugin","To be able to use UTC or timezones, you have to enable the `utc` plugin","Find more information on https://mui.com/x/react-date-pickers/timezone/#day-js-and-utc"].join(`
21
+ `),Qd=["Missing timezone plugin","To be able to use timezones, you have to enable both the `utc` and the `timezone` plugin","Find more information on https://mui.com/x/react-date-pickers/timezone/#day-js-and-timezone"].join(`
22
+ `),nS=(e,t)=>t?(...n)=>e(...n).locale(t):e;class si{constructor({locale:t,formats:n}={}){this.isMUIAdapter=!0,this.isTimezoneCompatible=!0,this.lib="dayjs",this.dayjs=void 0,this.locale=void 0,this.formats=void 0,this.escapedCharacters={start:"[",end:"]"},this.formatTokenMap=eS,this.setLocaleToValue=r=>{const o=this.getCurrentLocaleCode();return o===r.locale()?r:r.locale(o)},this.hasUTCPlugin=()=>typeof Je.utc<"u",this.hasTimezonePlugin=()=>typeof Je.tz<"u",this.isSame=(r,o,s)=>{const i=this.setTimezone(o,this.getTimezone(r));return r.format(s)===i.format(s)},this.cleanTimezone=r=>{switch(r){case"default":return;case"system":return Je.tz.guess();default:return r}},this.createSystemDate=r=>{if(this.hasUTCPlugin()&&this.hasTimezonePlugin()){const o=Je.tz.guess();return o!=="UTC"?Je.tz(r,o):Je(r)}return Je(r)},this.createUTCDate=r=>{if(!this.hasUTCPlugin())throw new Error(Sl);return Je.utc(r)},this.createTZDate=(r,o)=>{if(!this.hasUTCPlugin())throw new Error(Sl);if(!this.hasTimezonePlugin())throw new Error(Qd);const s=r!==void 0&&!r.endsWith("Z");return Je(r).tz(this.cleanTimezone(o),s)},this.getLocaleFormats=()=>{const r=Je.Ls,o=this.locale||"en";let s=r[o];return s===void 0&&(s=r.en),s.formats},this.adjustOffset=r=>{if(!this.hasTimezonePlugin())return r;const o=this.getTimezone(r);if(o!=="UTC"){const s=r.tz(this.cleanTimezone(o),!0);if(s.$offset===(r.$offset??0))return r;r.$offset=s.$offset}return r},this.date=(r,o="default")=>{if(r===null)return null;let s;return o==="UTC"?s=this.createUTCDate(r):o==="system"||o==="default"&&!this.hasTimezonePlugin()?s=this.createSystemDate(r):s=this.createTZDate(r,o),this.locale===void 0?s:s.locale(this.locale)},this.getInvalidDate=()=>Je(new Date("Invalid date")),this.getTimezone=r=>{if(this.hasTimezonePlugin()){const o=r.$x?.$timezone;if(o)return o}return this.hasUTCPlugin()&&r.isUTC()?"UTC":"system"},this.setTimezone=(r,o)=>{if(this.getTimezone(r)===o)return r;if(o==="UTC"){if(!this.hasUTCPlugin())throw new Error(Sl);return r.utc()}if(o==="system")return r.local();if(!this.hasTimezonePlugin()){if(o==="default")return r;throw new Error(Qd)}return Je.tz(r,this.cleanTimezone(o))},this.toJsDate=r=>r.toDate(),this.parse=(r,o)=>r===""?null:this.dayjs(r,o,this.locale,!0),this.getCurrentLocaleCode=()=>this.locale||"en",this.is12HourCycleInCurrentLocale=()=>/A|a/.test(this.getLocaleFormats().LT||""),this.expandFormat=r=>{const o=this.getLocaleFormats(),s=i=>i.replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,(l,c,u)=>c||u.slice(1));return r.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,(i,l,c)=>{const u=c&&c.toUpperCase();return l||o[c]||s(o[u])})},this.isValid=r=>r==null?!1:r.isValid(),this.format=(r,o)=>this.formatByString(r,this.formats[o]),this.formatByString=(r,o)=>this.dayjs(r).format(o),this.formatNumber=r=>r,this.isEqual=(r,o)=>r===null&&o===null?!0:r===null||o===null?!1:r.toDate().getTime()===o.toDate().getTime(),this.isSameYear=(r,o)=>this.isSame(r,o,"YYYY"),this.isSameMonth=(r,o)=>this.isSame(r,o,"YYYY-MM"),this.isSameDay=(r,o)=>this.isSame(r,o,"YYYY-MM-DD"),this.isSameHour=(r,o)=>r.isSame(o,"hour"),this.isAfter=(r,o)=>r>o,this.isAfterYear=(r,o)=>this.hasUTCPlugin()?!this.isSameYear(r,o)&&r.utc()>o.utc():r.isAfter(o,"year"),this.isAfterDay=(r,o)=>this.hasUTCPlugin()?!this.isSameDay(r,o)&&r.utc()>o.utc():r.isAfter(o,"day"),this.isBefore=(r,o)=>r<o,this.isBeforeYear=(r,o)=>this.hasUTCPlugin()?!this.isSameYear(r,o)&&r.utc()<o.utc():r.isBefore(o,"year"),this.isBeforeDay=(r,o)=>this.hasUTCPlugin()?!this.isSameDay(r,o)&&r.utc()<o.utc():r.isBefore(o,"day"),this.isWithinRange=(r,[o,s])=>r>=o&&r<=s,this.startOfYear=r=>this.adjustOffset(r.startOf("year")),this.startOfMonth=r=>this.adjustOffset(r.startOf("month")),this.startOfWeek=r=>this.adjustOffset(this.setLocaleToValue(r).startOf("week")),this.startOfDay=r=>this.adjustOffset(r.startOf("day")),this.endOfYear=r=>this.adjustOffset(r.endOf("year")),this.endOfMonth=r=>this.adjustOffset(r.endOf("month")),this.endOfWeek=r=>this.adjustOffset(this.setLocaleToValue(r).endOf("week")),this.endOfDay=r=>this.adjustOffset(r.endOf("day")),this.addYears=(r,o)=>this.adjustOffset(o<0?r.subtract(Math.abs(o),"year"):r.add(o,"year")),this.addMonths=(r,o)=>this.adjustOffset(o<0?r.subtract(Math.abs(o),"month"):r.add(o,"month")),this.addWeeks=(r,o)=>this.adjustOffset(o<0?r.subtract(Math.abs(o),"week"):r.add(o,"week")),this.addDays=(r,o)=>this.adjustOffset(o<0?r.subtract(Math.abs(o),"day"):r.add(o,"day")),this.addHours=(r,o)=>this.adjustOffset(o<0?r.subtract(Math.abs(o),"hour"):r.add(o,"hour")),this.addMinutes=(r,o)=>this.adjustOffset(o<0?r.subtract(Math.abs(o),"minute"):r.add(o,"minute")),this.addSeconds=(r,o)=>this.adjustOffset(o<0?r.subtract(Math.abs(o),"second"):r.add(o,"second")),this.getYear=r=>r.year(),this.getMonth=r=>r.month(),this.getDate=r=>r.date(),this.getHours=r=>r.hour(),this.getMinutes=r=>r.minute(),this.getSeconds=r=>r.second(),this.getMilliseconds=r=>r.millisecond(),this.setYear=(r,o)=>this.adjustOffset(r.set("year",o)),this.setMonth=(r,o)=>this.adjustOffset(r.set("month",o)),this.setDate=(r,o)=>this.adjustOffset(r.set("date",o)),this.setHours=(r,o)=>this.adjustOffset(r.set("hour",o)),this.setMinutes=(r,o)=>this.adjustOffset(r.set("minute",o)),this.setSeconds=(r,o)=>this.adjustOffset(r.set("second",o)),this.setMilliseconds=(r,o)=>this.adjustOffset(r.set("millisecond",o)),this.getDaysInMonth=r=>r.daysInMonth(),this.getWeekArray=r=>{const o=this.startOfWeek(this.startOfMonth(r)),s=this.endOfWeek(this.endOfMonth(r));let i=0,l=o;const c=[];for(;l<s;){const u=Math.floor(i/7);c[u]=c[u]||[],c[u].push(l),l=this.addDays(l,1),i+=1}return c},this.getWeekNumber=r=>r.week(),this.getYearRange=([r,o])=>{const s=this.startOfYear(r),i=this.endOfYear(o),l=[];let c=s;for(;this.isBefore(c,i);)l.push(c),c=this.addYears(c,1);return l},this.dayjs=nS(Je,t),this.locale=t,this.formats=U({},tS,n),Je.extend(z0)}getDayOfWeek(t){return t.day()+1}}function Fe(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function gh(e){const{theme:t,name:n,props:r}=e;return!t||!t.components||!t.components[n]||!t.components[n].defaultProps?r:oi(t.components[n].defaultProps,r)}function rS({props:e,name:t,defaultTheme:n,themeId:r}){let o=_v(n);return o=o[r]||o,gh({theme:o,name:t,props:e})}function oS(e,t,n,r,o){const[s,i]=D.useState(()=>o&&n?n(e).matches:r?r(e).matches:t);return Wt(()=>{if(!n)return;const l=n(e),c=()=>{i(l.matches)};return c(),l.addEventListener("change",c),()=>{l.removeEventListener("change",c)}},[e,n]),s}const sS={...D},yh=sS.useSyncExternalStore;function iS(e,t,n,r,o){const s=D.useCallback(()=>t,[t]),i=D.useMemo(()=>{if(o&&n)return()=>n(e).matches;if(r!==null){const{matches:d}=r(e);return()=>d}return s},[s,e,r,o,n]),[l,c]=D.useMemo(()=>{if(n===null)return[s,()=>()=>{}];const d=n(e);return[()=>d.matches,f=>(d.addEventListener("change",f),()=>{d.removeEventListener("change",f)})]},[s,n,e]);return yh(c,l,i)}function bh(e={}){const{themeId:t}=e;return function(r,o={}){let s=ih();s&&t&&(s=s[t]||s);const i=typeof window<"u"&&typeof window.matchMedia<"u",{defaultMatches:l=!1,matchMedia:c=i?window.matchMedia:null,ssrMatchMedia:u=null,noSsr:d=!1}=gh({name:"MuiUseMediaQuery",props:o,theme:s});let f=typeof r=="function"?r(s):r;return f=f.replace(/^@media( ?)/m,""),f.includes("print")&&console.warn(["MUI: You have provided a `print` query to the `useMediaQuery` hook.","Using the print media query to modify print styles can lead to unexpected results.","Consider using the `displayPrint` field in the `sx` prop instead.","More information about `displayPrint` on our docs: https://mui.com/system/display/#display-in-print."].join(`
23
+ `)),(yh!==void 0?iS:oS)(f,l,c,u,d)}}bh();const xh=bh({themeId:rs});function wt({props:e,name:t}){return rS({props:e,name:t,defaultTheme:za,themeId:rs})}const vh=fe.oneOfType([fe.func,fe.object]),Jd={};function Sh(e,t){const n=D.useRef(Jd);return n.current===Jd&&(n.current=e(t)),n}const aS=[];function lS(e){D.useEffect(e,aS)}class Rc{static create(){return new Rc}currentId=null;start(t,n){this.clear(),this.currentId=setTimeout(()=>{this.currentId=null,n()},t)}clear=()=>{this.currentId!==null&&(clearTimeout(this.currentId),this.currentId=null)};disposeEffect=()=>this.clear}function _a(){const e=Sh(Rc.create).current;return lS(e.disposeEffect),e}function ep(e){try{return e.matches(":focus-visible")}catch{}return!1}function Ch(e=window){const t=e.document.documentElement.clientWidth;return e.innerWidth-t}const cS=e=>{const t=D.useRef({});return D.useEffect(()=>{t.current=e}),t.current},uS={border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"absolute",whiteSpace:"nowrap",width:"1px"};function Zo(e){return typeof e=="string"}function wh(e,t,n){return e===void 0||Zo(e)?t:{...t,ownerState:{...t.ownerState,...n}}}function en(e,t=[]){if(e===void 0)return{};const n={};return Object.keys(e).filter(r=>r.match(/^on[A-Z]/)&&typeof e[r]=="function"&&!t.includes(r)).forEach(r=>{n[r]=e[r]}),n}function tp(e){if(e===void 0)return{};const t={};return Object.keys(e).filter(n=>!(n.match(/^on[A-Z]/)&&typeof e[n]=="function")).forEach(n=>{t[n]=e[n]}),t}function kh(e){const{getSlotProps:t,additionalProps:n,externalSlotProps:r,externalForwardedProps:o,className:s}=e;if(!t){const h=Te(n?.className,s,o?.className,r?.className),g={...n?.style,...o?.style,...r?.style},y={...n,...o,...r};return h.length>0&&(y.className=h),Object.keys(g).length>0&&(y.style=g),{props:y,internalRef:void 0}}const i=en({...o,...r}),l=tp(r),c=tp(o),u=t(i),d=Te(u?.className,n?.className,s,o?.className,r?.className),f={...u?.style,...n?.style,...o?.style,...r?.style},m={...u,...n,...c,...l};return d.length>0&&(m.className=d),Object.keys(f).length>0&&(m.style=f),{props:m,internalRef:u.ref}}function In(e,t,n){return typeof e=="function"?e(t,n):e}function Ge(e){const{elementType:t,externalSlotProps:n,ownerState:r,skipResolvingSlotProps:o=!1,...s}=e,i=o?{}:In(n,r),{props:l,internalRef:c}=kh({...s,externalSlotProps:i}),u=Ze(c,i?.ref,e.additionalProps?.ref);return wh(t,{...l,ref:u},r)}function os(e){return parseInt(D.version,10)>=19?e?.props?.ref||null:e?.ref||null}const Cs=(e,t)=>e.length!==t.length?!1:t.every(n=>e.includes(n)),dS=({openTo:e,defaultOpenTo:t,views:n,defaultViews:r})=>{const o=n??r;let s;if(e!=null)s=e;else if(o.includes(t))s=t;else if(o.length>0)s=o[0];else throw new Error("MUI X: The `views` prop must contain at least one view.");return{views:o,openTo:s}},xa=(e,t,n)=>{let r=t;return r=e.setHours(r,e.getHours(n)),r=e.setMinutes(r,e.getMinutes(n)),r=e.setSeconds(r,e.getSeconds(n)),r=e.setMilliseconds(r,e.getMilliseconds(n)),r},Xs=({date:e,disableFuture:t,disablePast:n,maxDate:r,minDate:o,isDateDisabled:s,utils:i,timezone:l})=>{const c=xa(i,i.date(void 0,l),e);n&&i.isBefore(o,c)&&(o=c),t&&i.isAfter(r,c)&&(r=c);let u=e,d=e;for(i.isBefore(e,o)&&(u=o,d=null),i.isAfter(e,r)&&(d&&(d=r),u=null);u||d;){if(u&&i.isAfter(u,r)&&(u=null),d&&i.isBefore(d,o)&&(d=null),u){if(!s(u))return u;u=i.addDays(u,1)}if(d){if(!s(d))return d;d=i.addDays(d,-1)}}return null},pS=(e,t)=>t==null||!e.isValid(t)?null:t,Pn=(e,t,n)=>t==null||!e.isValid(t)?n:t,fS=(e,t,n)=>!e.isValid(t)&&t!=null&&!e.isValid(n)&&n!=null?!0:e.isEqual(t,n),jc=(e,t)=>{const r=[e.startOfYear(t)];for(;r.length<12;){const o=r[r.length-1];r.push(e.addMonths(o,1))}return r},Th=(e,t,n)=>n==="date"?e.startOfDay(e.date(void 0,t)):e.date(void 0,t),hS=["year","month","day"],np=e=>hS.includes(e),$c=(e,{format:t,views:n},r)=>{if(t!=null)return t;const o=e.formats;return Cs(n,["year"])?o.year:Cs(n,["month"])?o.month:Cs(n,["day"])?o.dayOfMonth:Cs(n,["month","year"])?`${o.month} ${o.year}`:Cs(n,["day","month"])?`${o.month} ${o.dayOfMonth}`:r?/en/.test(e.getCurrentLocaleCode())?o.normalDateWithWeekday:o.normalDate:o.keyboardDate},mS=(e,t)=>{const n=e.startOfWeek(t);return[0,1,2,3,4,5,6].map(r=>e.addDays(n,r))},gS=["hours","minutes","seconds"],yS=e=>gS.includes(e),rp=(e,t)=>t.getHours(e)*3600+t.getMinutes(e)*60+t.getSeconds(e),bS=(e,t)=>(n,r)=>e?t.isAfter(n,r):rp(n,t)>rp(r,t),er={year:1,month:2,day:3,hours:4,minutes:5,seconds:6,milliseconds:7},xS=e=>Math.max(...e.map(t=>er[t.type]??1)),ws=(e,t,n)=>{if(t===er.year)return e.startOfYear(n);if(t===er.month)return e.startOfMonth(n);if(t===er.day)return e.startOfDay(n);let r=n;return t<er.minutes&&(r=e.setMinutes(r,0)),t<er.seconds&&(r=e.setSeconds(r,0)),t<er.milliseconds&&(r=e.setMilliseconds(r,0)),r},vS=({props:e,utils:t,granularity:n,timezone:r,getTodayDate:o})=>{let s=o?o():ws(t,n,Th(t,r));e.minDate!=null&&t.isAfterDay(e.minDate,s)&&(s=ws(t,n,e.minDate)),e.maxDate!=null&&t.isBeforeDay(e.maxDate,s)&&(s=ws(t,n,e.maxDate));const i=bS(e.disableIgnoringDatePartForTimeValidation??!1,t);return e.minTime!=null&&i(e.minTime,s)&&(s=ws(t,n,e.disableIgnoringDatePartForTimeValidation?e.minTime:xa(t,s,e.minTime))),e.maxTime!=null&&i(s,e.maxTime)&&(s=ws(t,n,e.disableIgnoringDatePartForTimeValidation?e.maxTime:xa(t,s,e.maxTime))),s},Ih=(e,t)=>{const n=e.formatTokenMap[t];if(n==null)throw new Error([`MUI X: The token "${t}" is not supported by the Date and Time Pickers.`,"Please try using another token or open an issue on https://github.com/mui/mui-x/issues/new/choose if you think it should be supported."].join(`
24
+ `));return typeof n=="string"?{type:n,contentType:n==="meridiem"?"letter":"digit",maxLength:void 0}:{type:n.sectionType,contentType:n.contentType,maxLength:n.maxLength}},SS=e=>{switch(e){case"ArrowUp":return 1;case"ArrowDown":return-1;case"PageUp":return 5;case"PageDown":return-5;default:return 0}},Wa=(e,t)=>{const n=[],r=e.date(void 0,"default"),o=e.startOfWeek(r),s=e.endOfWeek(r);let i=o;for(;e.isBefore(i,s);)n.push(i),i=e.addDays(i,1);return n.map(l=>e.formatByString(l,t))},Mh=(e,t,n,r)=>{switch(n){case"month":return jc(e,e.date(void 0,t)).map(o=>e.formatByString(o,r));case"weekDay":return Wa(e,r);case"meridiem":{const o=e.date(void 0,t);return[e.startOfDay(o),e.endOfDay(o)].map(s=>e.formatByString(s,r))}default:return[]}},op="s",CS=["0","1","2","3","4","5","6","7","8","9"],wS=e=>{const t=e.date(void 0);return e.formatByString(e.setSeconds(t,0),op)==="0"?CS:Array.from({length:10}).map((r,o)=>e.formatByString(e.setSeconds(t,o),op))},so=(e,t)=>{if(t[0]==="0")return e;const n=[];let r="";for(let o=0;o<e.length;o+=1){r+=e[o];const s=t.indexOf(r);s>-1&&(n.push(s.toString()),r="")}return n.join("")},Ac=(e,t)=>t[0]==="0"?e:e.split("").map(n=>t[Number(n)]).join(""),sp=(e,t)=>{const n=so(e,t);return n!==" "&&!Number.isNaN(Number(n))},Dh=(e,t)=>{let n=e;for(n=Number(n).toString();n.length<t;)n=`0${n}`;return n},Ph=(e,t,n,r,o)=>{if(o.type==="day"&&o.contentType==="digit-with-letter"){const i=e.setDate(n.longestMonth,t);return e.formatByString(i,o.format)}let s=t.toString();return o.hasLeadingZerosInInput&&(s=Dh(s,o.maxLength)),Ac(s,r)},kS=(e,t,n,r,o,s,i,l)=>{const c=SS(r),u=r==="Home",d=r==="End",f=n.value===""||u||d,m=()=>{const g=o[n.type]({currentDate:i,format:n.format,contentType:n.contentType}),y=C=>Ph(e,C,g,s,n),b=n.type==="minutes"&&l?.minutesStep?l.minutesStep:1;let x;if(f){if(n.type==="year"&&!d&&!u)return e.formatByString(e.date(void 0,t),n.format);c>0||u?x=g.minimum:x=g.maximum}else x=parseInt(so(n.value,s),10)+c*b;return x%b!==0&&((c<0||u)&&(x+=b-(b+x)%b),(c>0||d)&&(x-=x%b)),x>g.maximum?y(g.minimum+(x-g.maximum-1)%(g.maximum-g.minimum+1)):x<g.minimum?y(g.maximum-(g.minimum-x-1)%(g.maximum-g.minimum+1)):y(x)},h=()=>{const g=Mh(e,t,n.type,n.format);if(g.length===0)return n.value;if(f)return c>0||u?g[0]:g[g.length-1];const x=((g.indexOf(n.value)+c)%g.length+g.length)%g.length;return g[x]};return n.contentType==="digit"||n.contentType==="digit-with-letter"?m():h()},Fc=(e,t,n)=>{let r=e.value||e.placeholder;const o=t==="non-input"?e.hasLeadingZerosInFormat:e.hasLeadingZerosInInput;return t==="non-input"&&e.hasLeadingZerosInInput&&!e.hasLeadingZerosInFormat&&(r=Number(so(r,n)).toString()),["input-rtl","input-ltr"].includes(t)&&e.contentType==="digit"&&!o&&r.length===1&&(r=`${r}‎`),t==="input-rtl"&&(r=`⁨${r}⁩`),r},ip=(e,t,n,r)=>e.formatByString(e.parse(t,n),r),TS=(e,t)=>e.formatByString(e.date(void 0,"system"),t).length===4,Eh=(e,t,n,r)=>{if(t!=="digit")return!1;const o=e.date(void 0,"default");switch(n){case"year":return e.lib==="dayjs"&&r==="YY"?!0:e.formatByString(e.setYear(o,1),r).startsWith("0");case"month":return e.formatByString(e.startOfYear(o),r).length>1;case"day":return e.formatByString(e.startOfMonth(o),r).length>1;case"weekDay":return e.formatByString(e.startOfWeek(o),r).length>1;case"hours":return e.formatByString(e.setHours(o,1),r).length>1;case"minutes":return e.formatByString(e.setMinutes(o,1),r).length>1;case"seconds":return e.formatByString(e.setSeconds(o,1),r).length>1;default:throw new Error("Invalid section type")}},IS=(e,t,n)=>{const r=t.some(c=>c.type==="day"),o=[],s=[];for(let c=0;c<t.length;c+=1){const u=t[c];r&&u.type==="weekDay"||(o.push(u.format),s.push(Fc(u,"non-input",n)))}const i=o.join(" "),l=s.join(" ");return e.parse(l,i)},MS=e=>e.map(t=>`${t.startSeparator}${t.value||t.placeholder}${t.endSeparator}`).join(""),DS=(e,t,n)=>{const o=e.map(s=>{const i=Fc(s,n?"input-rtl":"input-ltr",t);return`${s.startSeparator}${i}${s.endSeparator}`}).join("");return n?`⁦${o}⁩`:o},PS=(e,t,n)=>{const r=e.date(void 0,n),o=e.endOfYear(r),s=e.endOfDay(r),{maxDaysInMonth:i,longestMonth:l}=jc(e,r).reduce((c,u)=>{const d=e.getDaysInMonth(u);return d>c.maxDaysInMonth?{maxDaysInMonth:d,longestMonth:u}:c},{maxDaysInMonth:0,longestMonth:null});return{year:({format:c})=>({minimum:0,maximum:TS(e,c)?9999:99}),month:()=>({minimum:1,maximum:e.getMonth(o)+1}),day:({currentDate:c})=>({minimum:1,maximum:c!=null&&e.isValid(c)?e.getDaysInMonth(c):i,longestMonth:l}),weekDay:({format:c,contentType:u})=>{if(u==="digit"){const d=Wa(e,c).map(Number);return{minimum:Math.min(...d),maximum:Math.max(...d)}}return{minimum:1,maximum:7}},hours:({format:c})=>{const u=e.getHours(s);return so(e.formatByString(e.endOfDay(r),c),t)!==u.toString()?{minimum:1,maximum:Number(so(e.formatByString(e.startOfDay(r),c),t))}:{minimum:0,maximum:u}},minutes:()=>({minimum:0,maximum:e.getMinutes(s)}),seconds:()=>({minimum:0,maximum:e.getSeconds(s)}),meridiem:()=>({minimum:0,maximum:1}),empty:()=>({minimum:0,maximum:0})}},ES=(e,t,n,r)=>{switch(t.type){case"year":return e.setYear(r,e.getYear(n));case"month":return e.setMonth(r,e.getMonth(n));case"weekDay":{const o=Wa(e,t.format),s=e.formatByString(n,t.format),i=o.indexOf(s),c=o.indexOf(t.value)-i;return e.addDays(n,c)}case"day":return e.setDate(r,e.getDate(n));case"meridiem":{const o=e.getHours(n)<12,s=e.getHours(r);return o&&s>=12?e.addHours(r,-12):!o&&s<12?e.addHours(r,12):r}case"hours":return e.setHours(r,e.getHours(n));case"minutes":return e.setMinutes(r,e.getMinutes(n));case"seconds":return e.setSeconds(r,e.getSeconds(n));default:return r}},ap={year:1,month:2,day:3,weekDay:4,hours:5,minutes:6,seconds:7,meridiem:8,empty:9},lp=(e,t,n,r,o)=>[...n].sort((s,i)=>ap[s.type]-ap[i.type]).reduce((s,i)=>!o||i.modified?ES(e,i,t,s):s,r),OS=()=>navigator.userAgent.toLowerCase().includes("android"),RS=(e,t)=>{const n={};if(!t)return e.forEach((c,u)=>{const d=u===0?null:u-1,f=u===e.length-1?null:u+1;n[u]={leftIndex:d,rightIndex:f}}),{neighbors:n,startIndex:0,endIndex:e.length-1};const r={},o={};let s=0,i=0,l=e.length-1;for(;l>=0;){i=e.findIndex((c,u)=>u>=s&&c.endSeparator?.includes(" ")&&c.endSeparator!==" / "),i===-1&&(i=e.length-1);for(let c=i;c>=s;c-=1)o[c]=l,r[l]=c,l-=1;s=i+1}return e.forEach((c,u)=>{const d=o[u],f=d===0?null:r[d-1],m=d===e.length-1?null:r[d+1];n[u]={leftIndex:f,rightIndex:m}}),{neighbors:n,startIndex:r[0],endIndex:r[e.length-1]}},Yl=(e,t)=>{if(e==null)return null;if(e==="all")return"all";if(typeof e=="string"){const n=t.findIndex(r=>r.type===e);return n===-1?null:n}return e},jS=(e,t)=>{if(e.value)switch(e.type){case"month":{if(e.contentType==="digit")return t.format(t.setMonth(t.date(),Number(e.value)-1),"month");const n=t.parse(e.value,e.format);return n?t.format(n,"month"):void 0}case"day":return e.contentType==="digit"?t.format(t.setDate(t.startOfYear(t.date()),Number(e.value)),"dayOfMonthFull"):e.value;case"weekDay":return;default:return}},$S=(e,t)=>{if(e.value)switch(e.type){case"weekDay":return e.contentType==="letter"?void 0:Number(e.value);case"meridiem":{const n=t.parse(`01:00 ${e.value}`,`${t.formats.hours12h}:${t.formats.minutes} ${e.format}`);return n?t.getHours(n)>=12?1:0:void 0}case"day":return e.contentType==="digit-with-letter"?parseInt(e.value,10):Number(e.value);case"month":{if(e.contentType==="digit")return Number(e.value);const n=t.parse(e.value,e.format);return n?t.getMonth(n)+1:void 0}default:return e.contentType!=="letter"?Number(e.value):void 0}},AS=["value","referenceDate"],or={emptyValue:null,getTodayValue:Th,getInitialReferenceValue:e=>{let{value:t,referenceDate:n}=e,r=Fe(e,AS);return t!=null&&r.utils.isValid(t)?t:n??vS(r)},cleanValue:pS,areValuesEqual:fS,isSameError:(e,t)=>e===t,hasError:e=>e!=null,defaultErrorState:null,getTimezone:(e,t)=>t==null||!e.isValid(t)?null:e.getTimezone(t),setTimezone:(e,t,n)=>n==null?null:e.setTimezone(n,t)},FS={updateReferenceValue:(e,t,n)=>t==null||!e.isValid(t)?n:t,getSectionsFromValue:(e,t,n,r)=>!e.isValid(t)&&!!n?n:r(t),getV7HiddenInputValueFromSections:MS,getV6InputValueFromSections:DS,getActiveDateManager:(e,t)=>({date:t.value,referenceDate:t.referenceValue,getSections:n=>n,getNewValuesFromNewActiveDate:n=>({value:n,referenceValue:n==null||!e.isValid(n)?t.referenceValue:n})}),parseValueStr:(e,t,n)=>n(e.trim(),t)},NS=["localeText"],Kl=D.createContext(null),Xo=function(t){const{localeText:n}=t,r=Fe(t,NS),{utils:o,localeText:s}=D.useContext(Kl)??{utils:void 0,localeText:void 0},i=wt({props:r,name:"MuiLocalizationProvider"}),{children:l,dateAdapter:c,dateFormats:u,dateLibInstance:d,adapterLocale:f,localeText:m}=i,h=D.useMemo(()=>U({},m,s,n),[m,s,n]),g=D.useMemo(()=>{if(!c)return o||null;const x=new c({locale:f,formats:u,instance:d});if(!x.isMUIAdapter)throw new Error(["MUI X: The date adapter should be imported from `@mui/x-date-pickers` or `@mui/x-date-pickers-pro`, not from `@date-io`","For example, `import { AdapterDayjs } from '@mui/x-date-pickers/AdapterDayjs'` instead of `import AdapterDayjs from '@date-io/dayjs'`","More information on the installation documentation: https://mui.com/x/react-date-pickers/getting-started/#installation"].join(`
25
+ `));return x},[c,f,u,d,o]),y=D.useMemo(()=>g?{minDate:g.date("1900-01-01T00:00:00.000"),maxDate:g.date("2099-12-31T00:00:00.000")}:null,[g]),b=D.useMemo(()=>({utils:g,defaultDates:y,localeText:h}),[y,g,h]);return a.jsx(Kl.Provider,{value:b,children:l})},LS=e=>({components:{MuiLocalizationProvider:{defaultProps:{localeText:U({},e)}}}}),Oh=e=>{const{utils:t,formatKey:n,contextTranslation:r,propsTranslation:o}=e;return s=>{const i=s!==null&&t.isValid(s)?t.format(s,n):null;return(o??r)(s,t,i)}},Rh={previousMonth:"Previous month",nextMonth:"Next month",openPreviousView:"Open previous view",openNextView:"Open next view",calendarViewSwitchingButtonAriaLabel:e=>e==="year"?"year view is open, switch to calendar view":"calendar view is open, switch to year view",start:"Start",end:"End",startDate:"Start date",startTime:"Start time",endDate:"End date",endTime:"End time",cancelButtonLabel:"Cancel",clearButtonLabel:"Clear",okButtonLabel:"OK",todayButtonLabel:"Today",datePickerToolbarTitle:"Select date",dateTimePickerToolbarTitle:"Select date & time",timePickerToolbarTitle:"Select time",dateRangePickerToolbarTitle:"Select date range",clockLabelText:(e,t,n,r)=>`Select ${e}. ${!r&&(t===null||!n.isValid(t))?"No time selected":`Selected time is ${r??n.format(t,"fullTime")}`}`,hoursClockNumberText:e=>`${e} hours`,minutesClockNumberText:e=>`${e} minutes`,secondsClockNumberText:e=>`${e} seconds`,selectViewText:e=>`Select ${e}`,calendarWeekNumberHeaderLabel:"Week number",calendarWeekNumberHeaderText:"#",calendarWeekNumberAriaLabelText:e=>`Week ${e}`,calendarWeekNumberText:e=>`${e}`,openDatePickerDialogue:(e,t,n)=>n||e!==null&&t.isValid(e)?`Choose date, selected date is ${n??t.format(e,"fullDate")}`:"Choose date",openTimePickerDialogue:(e,t,n)=>n||e!==null&&t.isValid(e)?`Choose time, selected time is ${n??t.format(e,"fullTime")}`:"Choose time",fieldClearLabel:"Clear",timeTableLabel:"pick time",dateTableLabel:"pick date",fieldYearPlaceholder:e=>"Y".repeat(e.digitAmount),fieldMonthPlaceholder:e=>e.contentType==="letter"?"MMMM":"MM",fieldDayPlaceholder:()=>"DD",fieldWeekDayPlaceholder:e=>e.contentType==="letter"?"EEEE":"EE",fieldHoursPlaceholder:()=>"hh",fieldMinutesPlaceholder:()=>"mm",fieldSecondsPlaceholder:()=>"ss",fieldMeridiemPlaceholder:()=>"aa",year:"Year",month:"Month",day:"Day",weekDay:"Week day",hours:"Hours",minutes:"Minutes",seconds:"Seconds",meridiem:"Meridiem",empty:"Empty"},BS=Rh;LS(Rh);const uo=()=>{const e=D.useContext(Kl);if(e===null)throw new Error(["MUI X: Can not find the date and time pickers localization context.","It looks like you forgot to wrap your component in LocalizationProvider.","This can also happen if you are bundling multiple versions of the `@mui/x-date-pickers` package"].join(`
26
+ `));if(e.utils===null)throw new Error(["MUI X: Can not find the date and time pickers adapter from its localization context.","It looks like you forgot to pass a `dateAdapter` to your LocalizationProvider."].join(`
27
+ `));const t=D.useMemo(()=>U({},BS,e.localeText),[e.localeText]);return D.useMemo(()=>U({},e,{localeText:t}),[e,t])},It=()=>uo().utils,Si=()=>uo().defaultDates,Ha=e=>{const t=It(),n=D.useRef(void 0);return n.current===void 0&&(n.current=t.date(void 0,e)),n.current};function VS(e){return typeof e.main=="string"}function zS(e,t=[]){if(!VS(e))return!1;for(const n of t)if(!e.hasOwnProperty(n)||typeof e[n]!="string")return!1;return!0}function tn(e=[]){return([,t])=>t&&zS(t,e)}function _S(e){return $e("MuiTypography",e)}const cp=Ee("MuiTypography",["root","h1","h2","h3","h4","h5","h6","subtitle1","subtitle2","body1","body2","inherit","button","caption","overline","alignLeft","alignRight","alignCenter","alignJustify","noWrap","gutterBottom","paragraph"]),WS={primary:!0,secondary:!0,error:!0,info:!0,success:!0,warning:!0,textPrimary:!0,textSecondary:!0,textDisabled:!0},HS=P0(),US=e=>{const{align:t,gutterBottom:n,noWrap:r,paragraph:o,variant:s,classes:i}=e,l={root:["root",s,e.align!=="inherit"&&`align${ve(t)}`,n&&"gutterBottom",r&&"noWrap",o&&"paragraph"]};return Re(l,_S,i)},qS=re("span",{name:"MuiTypography",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.variant&&t[n.variant],n.align!=="inherit"&&t[`align${ve(n.align)}`],n.noWrap&&t.noWrap,n.gutterBottom&&t.gutterBottom,n.paragraph&&t.paragraph]}})(He(({theme:e})=>({margin:0,variants:[{props:{variant:"inherit"},style:{font:"inherit",lineHeight:"inherit",letterSpacing:"inherit"}},...Object.entries(e.typography).filter(([t,n])=>t!=="inherit"&&n&&typeof n=="object").map(([t,n])=>({props:{variant:t},style:n})),...Object.entries(e.palette).filter(tn()).map(([t])=>({props:{color:t},style:{color:(e.vars||e).palette[t].main}})),...Object.entries(e.palette?.text||{}).filter(([,t])=>typeof t=="string").map(([t])=>({props:{color:`text${ve(t)}`},style:{color:(e.vars||e).palette.text[t]}})),{props:({ownerState:t})=>t.align!=="inherit",style:{textAlign:"var(--Typography-textAlign)"}},{props:({ownerState:t})=>t.noWrap,style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}},{props:({ownerState:t})=>t.gutterBottom,style:{marginBottom:"0.35em"}},{props:({ownerState:t})=>t.paragraph,style:{marginBottom:16}}]}))),up={h1:"h1",h2:"h2",h3:"h3",h4:"h4",h5:"h5",h6:"h6",subtitle1:"h6",subtitle2:"h6",body1:"p",body2:"p",inherit:"p"},rt=D.forwardRef(function(t,n){const{color:r,...o}=We({props:t,name:"MuiTypography"}),s=!WS[r],i=HS({...o,...s&&{color:r}}),{align:l="inherit",className:c,component:u,gutterBottom:d=!1,noWrap:f=!1,paragraph:m=!1,variant:h="body1",variantMapping:g=up,...y}=i,b={...i,align:l,color:r,className:c,component:u,gutterBottom:d,noWrap:f,paragraph:m,variant:h,variantMapping:g},x=u||(m?"p":g[h]||up[h])||"span",C=US(b);return a.jsx(qS,{as:x,ref:n,className:Te(C.root,c),...y,ownerState:b,style:{...l!=="inherit"&&{"--Typography-textAlign":l},...y.style}})});function YS(e){return $e("MuiPickersToolbar",e)}Ee("MuiPickersToolbar",["root","content"]);const KS=["children","className","toolbarTitle","hidden","titleId","isLandscape","classes","landscapeDirection"],GS=e=>{const{classes:t}=e;return Re({root:["root"],content:["content"]},YS,t)},ZS=re("div",{name:"MuiPickersToolbar",slot:"Root",overridesResolver:(e,t)=>t.root})(({theme:e})=>({display:"flex",flexDirection:"column",alignItems:"flex-start",justifyContent:"space-between",padding:e.spacing(2,3),variants:[{props:{isLandscape:!0},style:{height:"auto",maxWidth:160,padding:16,justifyContent:"flex-start",flexWrap:"wrap"}}]})),XS=re("div",{name:"MuiPickersToolbar",slot:"Content",overridesResolver:(e,t)=>t.content})({display:"flex",flexWrap:"wrap",width:"100%",flex:1,justifyContent:"space-between",alignItems:"center",flexDirection:"row",variants:[{props:{isLandscape:!0},style:{justifyContent:"flex-start",alignItems:"flex-start",flexDirection:"column"}},{props:{isLandscape:!0,landscapeDirection:"row"},style:{flexDirection:"row"}}]}),QS=D.forwardRef(function(t,n){const r=wt({props:t,name:"MuiPickersToolbar"}),{children:o,className:s,toolbarTitle:i,hidden:l,titleId:c}=r,u=Fe(r,KS),d=r,f=GS(d);return l?null:a.jsxs(ZS,U({ref:n,className:Te(f.root,s),ownerState:d},u,{children:[a.jsx(rt,{color:"text.secondary",variant:"overline",id:c,children:i}),a.jsx(XS,{className:f.content,ownerState:d,children:o})]}))}),Cr=()=>uo().localeText;function JS(e){return $e("MuiDatePickerToolbar",e)}Ee("MuiDatePickerToolbar",["root","title"]);const eC=["value","isLandscape","onChange","toolbarFormat","toolbarPlaceholder","views","className","onViewChange","view"],tC=e=>{const{classes:t}=e;return Re({root:["root"],title:["title"]},JS,t)},nC=re(QS,{name:"MuiDatePickerToolbar",slot:"Root",overridesResolver:(e,t)=>t.root})({}),rC=re(rt,{name:"MuiDatePickerToolbar",slot:"Title",overridesResolver:(e,t)=>t.title})({variants:[{props:{isLandscape:!0},style:{margin:"auto 16px auto auto"}}]}),oC=D.forwardRef(function(t,n){const r=wt({props:t,name:"MuiDatePickerToolbar"}),{value:o,isLandscape:s,toolbarFormat:i,toolbarPlaceholder:l="––",views:c,className:u}=r,d=Fe(r,eC),f=It(),m=Cr(),h=tC(r),g=D.useMemo(()=>{if(!o)return l;const b=$c(f,{format:i,views:c},!0);return f.formatByString(o,b)},[o,i,l,f,c]),y=r;return a.jsx(nC,U({ref:n,toolbarTitle:m.datePickerToolbarTitle,isLandscape:s,className:Te(h.root,u)},d,{children:a.jsx(rC,{variant:"h4",align:s?"left":"center",ownerState:y,className:h.title,children:g})}))});function jh(e,t){const n=It(),r=Si(),o=wt({props:e,name:t}),s=D.useMemo(()=>o.localeText?.toolbarTitle==null?o.localeText:U({},o.localeText,{datePickerToolbarTitle:o.localeText.toolbarTitle}),[o.localeText]);return U({},o,{localeText:s},dS({views:o.views,openTo:o.openTo,defaultViews:["year","day"],defaultOpenTo:"day"}),{disableFuture:o.disableFuture??!1,disablePast:o.disablePast??!1,minDate:Pn(n,o.minDate,r.minDate),maxDate:Pn(n,o.maxDate,r.maxDate),slots:U({toolbar:oC},o.slots)})}const Ci=({props:e,value:t,timezone:n,adapter:r})=>{if(t===null)return null;const{shouldDisableDate:o,shouldDisableMonth:s,shouldDisableYear:i,disablePast:l,disableFuture:c}=e,u=r.utils.date(void 0,n),d=Pn(r.utils,e.minDate,r.defaultDates.minDate),f=Pn(r.utils,e.maxDate,r.defaultDates.maxDate);switch(!0){case!r.utils.isValid(t):return"invalidDate";case!!(o&&o(t)):return"shouldDisableDate";case!!(s&&s(t)):return"shouldDisableMonth";case!!(i&&i(t)):return"shouldDisableYear";case!!(c&&r.utils.isAfterDay(t,u)):return"disableFuture";case!!(l&&r.utils.isBeforeDay(t,u)):return"disablePast";case!!(d&&r.utils.isBeforeDay(t,d)):return"minDate";case!!(f&&r.utils.isAfterDay(t,f)):return"maxDate";default:return null}};Ci.valueManager=or;const $h=["disablePast","disableFuture","minDate","maxDate","shouldDisableDate","shouldDisableMonth","shouldDisableYear"],sC=["disablePast","disableFuture","minTime","maxTime","shouldDisableTime","minutesStep","ampm","disableIgnoringDatePartForTimeValidation"],iC=["minDateTime","maxDateTime"],aC=[...$h,...sC,...iC],Ah=e=>aC.reduce((t,n)=>(e.hasOwnProperty(n)&&(t[n]=e[n]),t),{});function Fh(e){const{props:t,validator:n,value:r,timezone:o,onError:s}=e,i=uo(),l=D.useRef(n.valueManager.defaultErrorState),c=n({adapter:i,value:r,timezone:o,props:t}),u=n.valueManager.hasError(c);D.useEffect(()=>{s&&!n.valueManager.isSameError(c,l.current)&&s(c,r),l.current=c},[n,s,c,r]);const d=Me(f=>n({adapter:i,value:f,timezone:o,props:t}));return{validationError:c,hasValidationError:u,getValidationErrorForNewValue:d}}const Ua=D.createContext(void 0);function yn(){return D.useContext(Ua)}function lC(e){return $e("MuiInputAdornment",e)}const dp=Ee("MuiInputAdornment",["root","filled","standard","outlined","positionStart","positionEnd","disablePointerEvents","hiddenLabel","sizeSmall"]);var pp;const cC=(e,t)=>{const{ownerState:n}=e;return[t.root,t[`position${ve(n.position)}`],n.disablePointerEvents===!0&&t.disablePointerEvents,t[n.variant]]},uC=e=>{const{classes:t,disablePointerEvents:n,hiddenLabel:r,position:o,size:s,variant:i}=e,l={root:["root",n&&"disablePointerEvents",o&&`position${ve(o)}`,i,r&&"hiddenLabel",s&&`size${ve(s)}`]};return Re(l,lC,t)},dC=re("div",{name:"MuiInputAdornment",slot:"Root",overridesResolver:cC})(He(({theme:e})=>({display:"flex",maxHeight:"2em",alignItems:"center",whiteSpace:"nowrap",color:(e.vars||e).palette.action.active,variants:[{props:{variant:"filled"},style:{[`&.${dp.positionStart}&:not(.${dp.hiddenLabel})`]:{marginTop:16}}},{props:{position:"start"},style:{marginRight:8}},{props:{position:"end"},style:{marginLeft:8}},{props:{disablePointerEvents:!0},style:{pointerEvents:"none"}}]}))),Nh=D.forwardRef(function(t,n){const r=We({props:t,name:"MuiInputAdornment"}),{children:o,className:s,component:i="div",disablePointerEvents:l=!1,disableTypography:c=!1,position:u,variant:d,...f}=r,m=yn()||{};let h=d;d&&m.variant,m&&!h&&(h=m.variant);const g={...r,hiddenLabel:m.hiddenLabel,size:m.size,disablePointerEvents:l,position:u,variant:h},y=uC(g);return a.jsx(Ua.Provider,{value:null,children:a.jsx(dC,{as:i,ownerState:g,className:Te(y.root,s),ref:n,...f,children:typeof o=="string"&&!c?a.jsx(rt,{color:"textSecondary",children:o}):a.jsxs(D.Fragment,{children:[u==="start"?pp||(pp=a.jsx("span",{className:"notranslate","aria-hidden":!0,children:"​"})):null,o]})})})});class va{static create(){return new va}static use(){const t=Sh(va.create).current,[n,r]=D.useState(!1);return t.shouldMount=n,t.setShouldMount=r,D.useEffect(t.mountEffect,[n]),t}constructor(){this.ref={current:null},this.mounted=null,this.didMount=!1,this.shouldMount=!1,this.setShouldMount=null}mount(){return this.mounted||(this.mounted=fC(),this.shouldMount=!0,this.setShouldMount(this.shouldMount)),this.mounted}mountEffect=()=>{this.shouldMount&&!this.didMount&&this.ref.current!==null&&(this.didMount=!0,this.mounted.resolve())};start(...t){this.mount().then(()=>this.ref.current?.start(...t))}stop(...t){this.mount().then(()=>this.ref.current?.stop(...t))}pulsate(...t){this.mount().then(()=>this.ref.current?.pulsate(...t))}}function pC(){return va.use()}function fC(){let e,t;const n=new Promise((r,o)=>{e=r,t=o});return n.resolve=e,n.reject=t,n}function Gl(e,t){return Gl=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,r){return n.__proto__=r,n},Gl(e,t)}function Nc(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,Gl(e,t)}function hC(e,t){return e.classList?!!t&&e.classList.contains(t):(" "+(e.className.baseVal||e.className)+" ").indexOf(" "+t+" ")!==-1}function mC(e,t){e.classList?e.classList.add(t):hC(e,t)||(typeof e.className=="string"?e.className=e.className+" "+t:e.setAttribute("class",(e.className&&e.className.baseVal||"")+" "+t))}function fp(e,t){return e.replace(new RegExp("(^|\\s)"+t+"(?:\\s|$)","g"),"$1").replace(/\s+/g," ").replace(/^\s*|\s*$/g,"")}function gC(e,t){e.classList?e.classList.remove(t):typeof e.className=="string"?e.className=fp(e.className,t):e.setAttribute("class",fp(e.className&&e.className.baseVal||"",t))}const hp={disabled:!1},Sa=Y.createContext(null);var Lh=function(t){return t.scrollTop},Hs="unmounted",Zr="exited",Xr="entering",zo="entered",Zl="exiting",Fn=(function(e){Nc(t,e);function t(r,o){var s;s=e.call(this,r,o)||this;var i=o,l=i&&!i.isMounting?r.enter:r.appear,c;return s.appearStatus=null,r.in?l?(c=Zr,s.appearStatus=Xr):c=zo:r.unmountOnExit||r.mountOnEnter?c=Hs:c=Zr,s.state={status:c},s.nextCallback=null,s}t.getDerivedStateFromProps=function(o,s){var i=o.in;return i&&s.status===Hs?{status:Zr}:null};var n=t.prototype;return n.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},n.componentDidUpdate=function(o){var s=null;if(o!==this.props){var i=this.state.status;this.props.in?i!==Xr&&i!==zo&&(s=Xr):(i===Xr||i===zo)&&(s=Zl)}this.updateStatus(!1,s)},n.componentWillUnmount=function(){this.cancelNextCallback()},n.getTimeouts=function(){var o=this.props.timeout,s,i,l;return s=i=l=o,o!=null&&typeof o!="number"&&(s=o.exit,i=o.enter,l=o.appear!==void 0?o.appear:i),{exit:s,enter:i,appear:l}},n.updateStatus=function(o,s){if(o===void 0&&(o=!1),s!==null)if(this.cancelNextCallback(),s===Xr){if(this.props.unmountOnExit||this.props.mountOnEnter){var i=this.props.nodeRef?this.props.nodeRef.current:zs.findDOMNode(this);i&&Lh(i)}this.performEnter(o)}else this.performExit();else this.props.unmountOnExit&&this.state.status===Zr&&this.setState({status:Hs})},n.performEnter=function(o){var s=this,i=this.props.enter,l=this.context?this.context.isMounting:o,c=this.props.nodeRef?[l]:[zs.findDOMNode(this),l],u=c[0],d=c[1],f=this.getTimeouts(),m=l?f.appear:f.enter;if(!o&&!i||hp.disabled){this.safeSetState({status:zo},function(){s.props.onEntered(u)});return}this.props.onEnter(u,d),this.safeSetState({status:Xr},function(){s.props.onEntering(u,d),s.onTransitionEnd(m,function(){s.safeSetState({status:zo},function(){s.props.onEntered(u,d)})})})},n.performExit=function(){var o=this,s=this.props.exit,i=this.getTimeouts(),l=this.props.nodeRef?void 0:zs.findDOMNode(this);if(!s||hp.disabled){this.safeSetState({status:Zr},function(){o.props.onExited(l)});return}this.props.onExit(l),this.safeSetState({status:Zl},function(){o.props.onExiting(l),o.onTransitionEnd(i.exit,function(){o.safeSetState({status:Zr},function(){o.props.onExited(l)})})})},n.cancelNextCallback=function(){this.nextCallback!==null&&(this.nextCallback.cancel(),this.nextCallback=null)},n.safeSetState=function(o,s){s=this.setNextCallback(s),this.setState(o,s)},n.setNextCallback=function(o){var s=this,i=!0;return this.nextCallback=function(l){i&&(i=!1,s.nextCallback=null,o(l))},this.nextCallback.cancel=function(){i=!1},this.nextCallback},n.onTransitionEnd=function(o,s){this.setNextCallback(s);var i=this.props.nodeRef?this.props.nodeRef.current:zs.findDOMNode(this),l=o==null&&!this.props.addEndListener;if(!i||l){setTimeout(this.nextCallback,0);return}if(this.props.addEndListener){var c=this.props.nodeRef?[this.nextCallback]:[i,this.nextCallback],u=c[0],d=c[1];this.props.addEndListener(u,d)}o!=null&&setTimeout(this.nextCallback,o)},n.render=function(){var o=this.state.status;if(o===Hs)return null;var s=this.props,i=s.children;s.in,s.mountOnEnter,s.unmountOnExit,s.appear,s.enter,s.exit,s.timeout,s.addEndListener,s.onEnter,s.onEntering,s.onEntered,s.onExit,s.onExiting,s.onExited,s.nodeRef;var l=Fe(s,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]);return Y.createElement(Sa.Provider,{value:null},typeof i=="function"?i(o,l):Y.cloneElement(Y.Children.only(i),l))},t})(Y.Component);Fn.contextType=Sa;Fn.propTypes={};function Fo(){}Fn.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:Fo,onEntering:Fo,onEntered:Fo,onExit:Fo,onExiting:Fo,onExited:Fo};Fn.UNMOUNTED=Hs;Fn.EXITED=Zr;Fn.ENTERING=Xr;Fn.ENTERED=zo;Fn.EXITING=Zl;var yC=function(t,n){return t&&n&&n.split(" ").forEach(function(r){return mC(t,r)})},Cl=function(t,n){return t&&n&&n.split(" ").forEach(function(r){return gC(t,r)})},Lc=(function(e){Nc(t,e);function t(){for(var r,o=arguments.length,s=new Array(o),i=0;i<o;i++)s[i]=arguments[i];return r=e.call.apply(e,[this].concat(s))||this,r.appliedClasses={appear:{},enter:{},exit:{}},r.onEnter=function(l,c){var u=r.resolveArguments(l,c),d=u[0],f=u[1];r.removeClasses(d,"exit"),r.addClass(d,f?"appear":"enter","base"),r.props.onEnter&&r.props.onEnter(l,c)},r.onEntering=function(l,c){var u=r.resolveArguments(l,c),d=u[0],f=u[1],m=f?"appear":"enter";r.addClass(d,m,"active"),r.props.onEntering&&r.props.onEntering(l,c)},r.onEntered=function(l,c){var u=r.resolveArguments(l,c),d=u[0],f=u[1],m=f?"appear":"enter";r.removeClasses(d,m),r.addClass(d,m,"done"),r.props.onEntered&&r.props.onEntered(l,c)},r.onExit=function(l){var c=r.resolveArguments(l),u=c[0];r.removeClasses(u,"appear"),r.removeClasses(u,"enter"),r.addClass(u,"exit","base"),r.props.onExit&&r.props.onExit(l)},r.onExiting=function(l){var c=r.resolveArguments(l),u=c[0];r.addClass(u,"exit","active"),r.props.onExiting&&r.props.onExiting(l)},r.onExited=function(l){var c=r.resolveArguments(l),u=c[0];r.removeClasses(u,"exit"),r.addClass(u,"exit","done"),r.props.onExited&&r.props.onExited(l)},r.resolveArguments=function(l,c){return r.props.nodeRef?[r.props.nodeRef.current,l]:[l,c]},r.getClassNames=function(l){var c=r.props.classNames,u=typeof c=="string",d=u&&c?c+"-":"",f=u?""+d+l:c[l],m=u?f+"-active":c[l+"Active"],h=u?f+"-done":c[l+"Done"];return{baseClassName:f,activeClassName:m,doneClassName:h}},r}var n=t.prototype;return n.addClass=function(o,s,i){var l=this.getClassNames(s)[i+"ClassName"],c=this.getClassNames("enter"),u=c.doneClassName;s==="appear"&&i==="done"&&u&&(l+=" "+u),i==="active"&&o&&Lh(o),l&&(this.appliedClasses[s][i]=l,yC(o,l))},n.removeClasses=function(o,s){var i=this.appliedClasses[s],l=i.base,c=i.active,u=i.done;this.appliedClasses[s]={},l&&Cl(o,l),c&&Cl(o,c),u&&Cl(o,u)},n.render=function(){var o=this.props;o.classNames;var s=Fe(o,["classNames"]);return Y.createElement(Fn,U({},s,{onEnter:this.onEnter,onEntered:this.onEntered,onEntering:this.onEntering,onExit:this.onExit,onExiting:this.onExiting,onExited:this.onExited}))},t})(Y.Component);Lc.defaultProps={classNames:""};Lc.propTypes={};function bC(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Bc(e,t){var n=function(s){return t&&Y.isValidElement(s)?t(s):s},r=Object.create(null);return e&&Y.Children.map(e,function(o){return o}).forEach(function(o){r[o.key]=n(o)}),r}function xC(e,t){e=e||{},t=t||{};function n(d){return d in t?t[d]:e[d]}var r=Object.create(null),o=[];for(var s in e)s in t?o.length&&(r[s]=o,o=[]):o.push(s);var i,l={};for(var c in t){if(r[c])for(i=0;i<r[c].length;i++){var u=r[c][i];l[r[c][i]]=n(u)}l[c]=n(c)}for(i=0;i<o.length;i++)l[o[i]]=n(o[i]);return l}function eo(e,t,n){return n[t]!=null?n[t]:e.props[t]}function vC(e,t){return Bc(e.children,function(n){return Y.cloneElement(n,{onExited:t.bind(null,n),in:!0,appear:eo(n,"appear",e),enter:eo(n,"enter",e),exit:eo(n,"exit",e)})})}function SC(e,t,n){var r=Bc(e.children),o=xC(t,r);return Object.keys(o).forEach(function(s){var i=o[s];if(Y.isValidElement(i)){var l=s in t,c=s in r,u=t[s],d=Y.isValidElement(u)&&!u.props.in;c&&(!l||d)?o[s]=Y.cloneElement(i,{onExited:n.bind(null,i),in:!0,exit:eo(i,"exit",e),enter:eo(i,"enter",e)}):!c&&l&&!d?o[s]=Y.cloneElement(i,{in:!1}):c&&l&&Y.isValidElement(u)&&(o[s]=Y.cloneElement(i,{onExited:n.bind(null,i),in:u.props.in,exit:eo(i,"exit",e),enter:eo(i,"enter",e)}))}}),o}var CC=Object.values||function(e){return Object.keys(e).map(function(t){return e[t]})},wC={component:"div",childFactory:function(t){return t}},wi=(function(e){Nc(t,e);function t(r,o){var s;s=e.call(this,r,o)||this;var i=s.handleExited.bind(bC(s));return s.state={contextValue:{isMounting:!0},handleExited:i,firstRender:!0},s}var n=t.prototype;return n.componentDidMount=function(){this.mounted=!0,this.setState({contextValue:{isMounting:!1}})},n.componentWillUnmount=function(){this.mounted=!1},t.getDerivedStateFromProps=function(o,s){var i=s.children,l=s.handleExited,c=s.firstRender;return{children:c?vC(o,l):SC(o,i,l),firstRender:!1}},n.handleExited=function(o,s){var i=Bc(this.props.children);o.key in i||(o.props.onExited&&o.props.onExited(s),this.mounted&&this.setState(function(l){var c=U({},l.children);return delete c[o.key],{children:c}}))},n.render=function(){var o=this.props,s=o.component,i=o.childFactory,l=Fe(o,["component","childFactory"]),c=this.state.contextValue,u=CC(this.state.children).map(i);return delete l.appear,delete l.enter,delete l.exit,s===null?Y.createElement(Sa.Provider,{value:c},u):Y.createElement(Sa.Provider,{value:c},Y.createElement(s,l,u))},t})(Y.Component);wi.propTypes={};wi.defaultProps=wC;function kC(e){const{className:t,classes:n,pulsate:r=!1,rippleX:o,rippleY:s,rippleSize:i,in:l,onExited:c,timeout:u}=e,[d,f]=D.useState(!1),m=Te(t,n.ripple,n.rippleVisible,r&&n.ripplePulsate),h={width:i,height:i,top:-(i/2)+s,left:-(i/2)+o},g=Te(n.child,d&&n.childLeaving,r&&n.childPulsate);return!l&&!d&&f(!0),D.useEffect(()=>{if(!l&&c!=null){const y=setTimeout(c,u);return()=>{clearTimeout(y)}}},[c,l,u]),a.jsx("span",{className:m,style:h,children:a.jsx("span",{className:g})})}const kn=Ee("MuiTouchRipple",["root","ripple","rippleVisible","ripplePulsate","child","childLeaving","childPulsate"]),Xl=550,TC=80,IC=st.keyframes`
28
+ 0% {
29
+ transform: scale(0);
30
+ opacity: 0.1;
31
+ }
32
+
33
+ 100% {
34
+ transform: scale(1);
35
+ opacity: 0.3;
36
+ }
37
+ `,MC=st.keyframes`
38
+ 0% {
39
+ opacity: 1;
40
+ }
41
+
42
+ 100% {
43
+ opacity: 0;
44
+ }
45
+ `,DC=st.keyframes`
46
+ 0% {
47
+ transform: scale(1);
48
+ }
49
+
50
+ 50% {
51
+ transform: scale(0.92);
52
+ }
53
+
54
+ 100% {
55
+ transform: scale(1);
56
+ }
57
+ `,PC=re("span",{name:"MuiTouchRipple",slot:"Root"})({overflow:"hidden",pointerEvents:"none",position:"absolute",zIndex:0,top:0,right:0,bottom:0,left:0,borderRadius:"inherit"}),EC=re(kC,{name:"MuiTouchRipple",slot:"Ripple"})`
58
+ opacity: 0;
59
+ position: absolute;
60
+
61
+ &.${kn.rippleVisible} {
62
+ opacity: 0.3;
63
+ transform: scale(1);
64
+ animation-name: ${IC};
65
+ animation-duration: ${Xl}ms;
66
+ animation-timing-function: ${({theme:e})=>e.transitions.easing.easeInOut};
67
+ }
68
+
69
+ &.${kn.ripplePulsate} {
70
+ animation-duration: ${({theme:e})=>e.transitions.duration.shorter}ms;
71
+ }
72
+
73
+ & .${kn.child} {
74
+ opacity: 1;
75
+ display: block;
76
+ width: 100%;
77
+ height: 100%;
78
+ border-radius: 50%;
79
+ background-color: currentColor;
80
+ }
81
+
82
+ & .${kn.childLeaving} {
83
+ opacity: 0;
84
+ animation-name: ${MC};
85
+ animation-duration: ${Xl}ms;
86
+ animation-timing-function: ${({theme:e})=>e.transitions.easing.easeInOut};
87
+ }
88
+
89
+ & .${kn.childPulsate} {
90
+ position: absolute;
91
+ /* @noflip */
92
+ left: 0px;
93
+ top: 0;
94
+ animation-name: ${DC};
95
+ animation-duration: 2500ms;
96
+ animation-timing-function: ${({theme:e})=>e.transitions.easing.easeInOut};
97
+ animation-iteration-count: infinite;
98
+ animation-delay: 200ms;
99
+ }
100
+ `,OC=D.forwardRef(function(t,n){const r=We({props:t,name:"MuiTouchRipple"}),{center:o=!1,classes:s={},className:i,...l}=r,[c,u]=D.useState([]),d=D.useRef(0),f=D.useRef(null);D.useEffect(()=>{f.current&&(f.current(),f.current=null)},[c]);const m=D.useRef(!1),h=_a(),g=D.useRef(null),y=D.useRef(null),b=D.useCallback(w=>{const{pulsate:M,rippleX:E,rippleY:j,rippleSize:F,cb:O}=w;u(V=>[...V,a.jsx(EC,{classes:{ripple:Te(s.ripple,kn.ripple),rippleVisible:Te(s.rippleVisible,kn.rippleVisible),ripplePulsate:Te(s.ripplePulsate,kn.ripplePulsate),child:Te(s.child,kn.child),childLeaving:Te(s.childLeaving,kn.childLeaving),childPulsate:Te(s.childPulsate,kn.childPulsate)},timeout:Xl,pulsate:M,rippleX:E,rippleY:j,rippleSize:F},d.current)]),d.current+=1,f.current=O},[s]),x=D.useCallback((w={},M={},E=()=>{})=>{const{pulsate:j=!1,center:F=o||M.pulsate,fakeElement:O=!1}=M;if(w?.type==="mousedown"&&m.current){m.current=!1;return}w?.type==="touchstart"&&(m.current=!0);const V=O?null:y.current,L=V?V.getBoundingClientRect():{width:0,height:0,left:0,top:0};let v,N,A;if(F||w===void 0||w.clientX===0&&w.clientY===0||!w.clientX&&!w.touches)v=Math.round(L.width/2),N=Math.round(L.height/2);else{const{clientX:$,clientY:R}=w.touches&&w.touches.length>0?w.touches[0]:w;v=Math.round($-L.left),N=Math.round(R-L.top)}if(F)A=Math.sqrt((2*L.width**2+L.height**2)/3),A%2===0&&(A+=1);else{const $=Math.max(Math.abs((V?V.clientWidth:0)-v),v)*2+2,R=Math.max(Math.abs((V?V.clientHeight:0)-N),N)*2+2;A=Math.sqrt($**2+R**2)}w?.touches?g.current===null&&(g.current=()=>{b({pulsate:j,rippleX:v,rippleY:N,rippleSize:A,cb:E})},h.start(TC,()=>{g.current&&(g.current(),g.current=null)})):b({pulsate:j,rippleX:v,rippleY:N,rippleSize:A,cb:E})},[o,b,h]),C=D.useCallback(()=>{x({},{pulsate:!0})},[x]),T=D.useCallback((w,M)=>{if(h.clear(),w?.type==="touchend"&&g.current){g.current(),g.current=null,h.start(0,()=>{T(w,M)});return}g.current=null,u(E=>E.length>0?E.slice(1):E),f.current=M},[h]);return D.useImperativeHandle(n,()=>({pulsate:C,start:x,stop:T}),[C,x,T]),a.jsx(PC,{className:Te(kn.root,s.root,i),ref:y,...l,children:a.jsx(wi,{component:null,exit:!0,children:c})})});function RC(e){return $e("MuiButtonBase",e)}const jC=Ee("MuiButtonBase",["root","disabled","focusVisible"]),$C=e=>{const{disabled:t,focusVisible:n,focusVisibleClassName:r,classes:o}=e,i=Re({root:["root",t&&"disabled",n&&"focusVisible"]},RC,o);return n&&r&&(i.root+=` ${r}`),i},AC=re("button",{name:"MuiButtonBase",slot:"Root"})({display:"inline-flex",alignItems:"center",justifyContent:"center",position:"relative",boxSizing:"border-box",WebkitTapHighlightColor:"transparent",backgroundColor:"transparent",outline:0,border:0,margin:0,borderRadius:0,padding:0,cursor:"pointer",userSelect:"none",verticalAlign:"middle",MozAppearance:"none",WebkitAppearance:"none",textDecoration:"none",color:"inherit","&::-moz-focus-inner":{borderStyle:"none"},[`&.${jC.disabled}`]:{pointerEvents:"none",cursor:"default"},"@media print":{colorAdjust:"exact"}}),io=D.forwardRef(function(t,n){const r=We({props:t,name:"MuiButtonBase"}),{action:o,centerRipple:s=!1,children:i,className:l,component:c="button",disabled:u=!1,disableRipple:d=!1,disableTouchRipple:f=!1,focusRipple:m=!1,focusVisibleClassName:h,LinkComponent:g="a",onBlur:y,onClick:b,onContextMenu:x,onDragLeave:C,onFocus:T,onFocusVisible:w,onKeyDown:M,onKeyUp:E,onMouseDown:j,onMouseLeave:F,onMouseUp:O,onTouchEnd:V,onTouchMove:L,onTouchStart:v,tabIndex:N=0,TouchRippleProps:A,touchRippleRef:$,type:R,..._}=r,z=D.useRef(null),W=pC(),H=Ze(W.ref,$),[G,se]=D.useState(!1);u&&G&&se(!1),D.useImperativeHandle(o,()=>({focusVisible:()=>{se(!0),z.current.focus()}}),[]);const pe=W.shouldMount&&!d&&!u;D.useEffect(()=>{G&&m&&!d&&W.pulsate()},[d,m,G,W]);const me=fr(W,"start",j,f),X=fr(W,"stop",x,f),K=fr(W,"stop",C,f),le=fr(W,"stop",O,f),oe=fr(W,"stop",De=>{G&&De.preventDefault(),F&&F(De)},f),te=fr(W,"start",v,f),Z=fr(W,"stop",V,f),J=fr(W,"stop",L,f),ae=fr(W,"stop",De=>{ep(De.target)||se(!1),y&&y(De)},!1),Q=Me(De=>{z.current||(z.current=De.currentTarget),ep(De.target)&&(se(!0),w&&w(De)),T&&T(De)}),ue=()=>{const De=z.current;return c&&c!=="button"&&!(De.tagName==="A"&&De.href)},he=Me(De=>{m&&!De.repeat&&G&&De.key===" "&&W.stop(De,()=>{W.start(De)}),De.target===De.currentTarget&&ue()&&De.key===" "&&De.preventDefault(),M&&M(De),De.target===De.currentTarget&&ue()&&De.key==="Enter"&&!u&&(De.preventDefault(),b&&b(De))}),de=Me(De=>{m&&De.key===" "&&G&&!De.defaultPrevented&&W.stop(De,()=>{W.pulsate(De)}),E&&E(De),b&&De.target===De.currentTarget&&ue()&&De.key===" "&&!De.defaultPrevented&&b(De)});let Se=c;Se==="button"&&(_.href||_.to)&&(Se=g);const ce={};Se==="button"?(ce.type=R===void 0?"button":R,ce.disabled=u):(!_.href&&!_.to&&(ce.role="button"),u&&(ce["aria-disabled"]=u));const Pe=Ze(n,z),Ce={...r,centerRipple:s,component:c,disabled:u,disableRipple:d,disableTouchRipple:f,focusRipple:m,tabIndex:N,focusVisible:G},Ve=$C(Ce);return a.jsxs(AC,{as:Se,className:Te(Ve.root,l),ownerState:Ce,onBlur:ae,onClick:b,onContextMenu:X,onFocus:Q,onKeyDown:he,onKeyUp:de,onMouseDown:me,onMouseLeave:oe,onMouseUp:le,onDragLeave:K,onTouchEnd:Z,onTouchMove:J,onTouchStart:te,ref:Pe,tabIndex:u?-1:N,type:R,...ce,..._,children:[i,pe?a.jsx(OC,{ref:H,center:s,...A}):null]})});function fr(e,t,n,r=!1){return Me(o=>(n&&n(o),r||e[t](o),!0))}function FC(e){return $e("MuiCircularProgress",e)}Ee("MuiCircularProgress",["root","determinate","indeterminate","colorPrimary","colorSecondary","svg","circle","circleDeterminate","circleIndeterminate","circleDisableShrink"]);const Dr=44,Ql=st.keyframes`
101
+ 0% {
102
+ transform: rotate(0deg);
103
+ }
104
+
105
+ 100% {
106
+ transform: rotate(360deg);
107
+ }
108
+ `,Jl=st.keyframes`
109
+ 0% {
110
+ stroke-dasharray: 1px, 200px;
111
+ stroke-dashoffset: 0;
112
+ }
113
+
114
+ 50% {
115
+ stroke-dasharray: 100px, 200px;
116
+ stroke-dashoffset: -15px;
117
+ }
118
+
119
+ 100% {
120
+ stroke-dasharray: 1px, 200px;
121
+ stroke-dashoffset: -126px;
122
+ }
123
+ `,NC=typeof Ql!="string"?st.css`
124
+ animation: ${Ql} 1.4s linear infinite;
125
+ `:null,LC=typeof Jl!="string"?st.css`
126
+ animation: ${Jl} 1.4s ease-in-out infinite;
127
+ `:null,BC=e=>{const{classes:t,variant:n,color:r,disableShrink:o}=e,s={root:["root",n,`color${ve(r)}`],svg:["svg"],circle:["circle",`circle${ve(n)}`,o&&"circleDisableShrink"]};return Re(s,FC,t)},VC=re("span",{name:"MuiCircularProgress",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,t[n.variant],t[`color${ve(n.color)}`]]}})(He(({theme:e})=>({display:"inline-block",variants:[{props:{variant:"determinate"},style:{transition:e.transitions.create("transform")}},{props:{variant:"indeterminate"},style:NC||{animation:`${Ql} 1.4s linear infinite`}},...Object.entries(e.palette).filter(tn()).map(([t])=>({props:{color:t},style:{color:(e.vars||e).palette[t].main}}))]}))),zC=re("svg",{name:"MuiCircularProgress",slot:"Svg"})({display:"block"}),_C=re("circle",{name:"MuiCircularProgress",slot:"Circle",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.circle,t[`circle${ve(n.variant)}`],n.disableShrink&&t.circleDisableShrink]}})(He(({theme:e})=>({stroke:"currentColor",variants:[{props:{variant:"determinate"},style:{transition:e.transitions.create("stroke-dashoffset")}},{props:{variant:"indeterminate"},style:{strokeDasharray:"80px, 200px",strokeDashoffset:0}},{props:({ownerState:t})=>t.variant==="indeterminate"&&!t.disableShrink,style:LC||{animation:`${Jl} 1.4s ease-in-out infinite`}}]}))),Vc=D.forwardRef(function(t,n){const r=We({props:t,name:"MuiCircularProgress"}),{className:o,color:s="primary",disableShrink:i=!1,size:l=40,style:c,thickness:u=3.6,value:d=0,variant:f="indeterminate",...m}=r,h={...r,color:s,disableShrink:i,size:l,thickness:u,value:d,variant:f},g=BC(h),y={},b={},x={};if(f==="determinate"){const C=2*Math.PI*((Dr-u)/2);y.strokeDasharray=C.toFixed(3),x["aria-valuenow"]=Math.round(d),y.strokeDashoffset=`${((100-d)/100*C).toFixed(3)}px`,b.transform="rotate(-90deg)"}return a.jsx(VC,{className:Te(g.root,o),style:{width:l,height:l,...b,...c},ownerState:h,ref:n,role:"progressbar",...x,...m,children:a.jsx(zC,{className:g.svg,ownerState:h,viewBox:`${Dr/2} ${Dr/2} ${Dr} ${Dr}`,children:a.jsx(_C,{className:g.circle,style:y,ownerState:h,cx:Dr,cy:Dr,r:(Dr-u)/2,fill:"none",strokeWidth:u})})})});function WC(e){return $e("MuiIconButton",e)}const mp=Ee("MuiIconButton",["root","disabled","colorInherit","colorPrimary","colorSecondary","colorError","colorInfo","colorSuccess","colorWarning","edgeStart","edgeEnd","sizeSmall","sizeMedium","sizeLarge","loading","loadingIndicator","loadingWrapper"]),HC=e=>{const{classes:t,disabled:n,color:r,edge:o,size:s,loading:i}=e,l={root:["root",i&&"loading",n&&"disabled",r!=="default"&&`color${ve(r)}`,o&&`edge${ve(o)}`,`size${ve(s)}`],loadingIndicator:["loadingIndicator"],loadingWrapper:["loadingWrapper"]};return Re(l,WC,t)},UC=re(io,{name:"MuiIconButton",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.loading&&t.loading,n.color!=="default"&&t[`color${ve(n.color)}`],n.edge&&t[`edge${ve(n.edge)}`],t[`size${ve(n.size)}`]]}})(He(({theme:e})=>({textAlign:"center",flex:"0 0 auto",fontSize:e.typography.pxToRem(24),padding:8,borderRadius:"50%",color:(e.vars||e).palette.action.active,transition:e.transitions.create("background-color",{duration:e.transitions.duration.shortest}),variants:[{props:t=>!t.disableRipple,style:{"--IconButton-hoverBg":e.alpha((e.vars||e).palette.action.active,(e.vars||e).palette.action.hoverOpacity),"&:hover":{backgroundColor:"var(--IconButton-hoverBg)","@media (hover: none)":{backgroundColor:"transparent"}}}},{props:{edge:"start"},style:{marginLeft:-12}},{props:{edge:"start",size:"small"},style:{marginLeft:-3}},{props:{edge:"end"},style:{marginRight:-12}},{props:{edge:"end",size:"small"},style:{marginRight:-3}}]})),He(({theme:e})=>({variants:[{props:{color:"inherit"},style:{color:"inherit"}},...Object.entries(e.palette).filter(tn()).map(([t])=>({props:{color:t},style:{color:(e.vars||e).palette[t].main}})),...Object.entries(e.palette).filter(tn()).map(([t])=>({props:{color:t},style:{"--IconButton-hoverBg":e.alpha((e.vars||e).palette[t].main,(e.vars||e).palette.action.hoverOpacity)}})),{props:{size:"small"},style:{padding:5,fontSize:e.typography.pxToRem(18)}},{props:{size:"large"},style:{padding:12,fontSize:e.typography.pxToRem(28)}}],[`&.${mp.disabled}`]:{backgroundColor:"transparent",color:(e.vars||e).palette.action.disabled},[`&.${mp.loading}`]:{color:"transparent"}}))),qC=re("span",{name:"MuiIconButton",slot:"LoadingIndicator"})(({theme:e})=>({display:"none",position:"absolute",visibility:"visible",top:"50%",left:"50%",transform:"translate(-50%, -50%)",color:(e.vars||e).palette.action.disabled,variants:[{props:{loading:!0},style:{display:"flex"}}]})),Nn=D.forwardRef(function(t,n){const r=We({props:t,name:"MuiIconButton"}),{edge:o=!1,children:s,className:i,color:l="default",disabled:c=!1,disableFocusRipple:u=!1,size:d="medium",id:f,loading:m=null,loadingIndicator:h,...g}=r,y=Un(f),b=h??a.jsx(Vc,{"aria-labelledby":y,color:"inherit",size:16}),x={...r,edge:o,color:l,disabled:c,disableFocusRipple:u,loading:m,loadingIndicator:b,size:d},C=HC(x);return a.jsxs(UC,{id:m?y:f,className:Te(C.root,i),centerRipple:!0,focusRipple:!u,disabled:c||m,ref:n,...g,ownerState:x,children:[typeof m=="boolean"&&a.jsx("span",{className:C.loadingWrapper,style:{display:"contents"},children:a.jsx(qC,{className:C.loadingIndicator,ownerState:x,children:m&&b})}),s]})}),Bh=e=>e.scrollTop;function Qo(e,t){const{timeout:n,easing:r,style:o={}}=e;return{duration:o.transitionDuration??(typeof n=="number"?n:n[t.mode]||0),easing:o.transitionTimingFunction??(typeof r=="object"?r[t.mode]:r),delay:o.transitionDelay}}function ec(e){return`scale(${e}, ${e**2})`}const YC={entering:{opacity:1,transform:ec(1)},entered:{opacity:1,transform:"none"}},wl=typeof navigator<"u"&&/^((?!chrome|android).)*(safari|mobile)/i.test(navigator.userAgent)&&/(os |version\/)15(.|_)4/i.test(navigator.userAgent),ii=D.forwardRef(function(t,n){const{addEndListener:r,appear:o=!0,children:s,easing:i,in:l,onEnter:c,onEntered:u,onEntering:d,onExit:f,onExited:m,onExiting:h,style:g,timeout:y="auto",TransitionComponent:b=Fn,...x}=t,C=_a(),T=D.useRef(),w=$r(),M=D.useRef(null),E=Ze(M,os(s),n),j=$=>R=>{if($){const _=M.current;R===void 0?$(_):$(_,R)}},F=j(d),O=j(($,R)=>{Bh($);const{duration:_,delay:z,easing:W}=Qo({style:g,timeout:y,easing:i},{mode:"enter"});let H;y==="auto"?(H=w.transitions.getAutoHeightDuration($.clientHeight),T.current=H):H=_,$.style.transition=[w.transitions.create("opacity",{duration:H,delay:z}),w.transitions.create("transform",{duration:wl?H:H*.666,delay:z,easing:W})].join(","),c&&c($,R)}),V=j(u),L=j(h),v=j($=>{const{duration:R,delay:_,easing:z}=Qo({style:g,timeout:y,easing:i},{mode:"exit"});let W;y==="auto"?(W=w.transitions.getAutoHeightDuration($.clientHeight),T.current=W):W=R,$.style.transition=[w.transitions.create("opacity",{duration:W,delay:_}),w.transitions.create("transform",{duration:wl?W:W*.666,delay:wl?_:_||W*.333,easing:z})].join(","),$.style.opacity=0,$.style.transform=ec(.75),f&&f($)}),N=j(m),A=$=>{y==="auto"&&C.start(T.current||0,$),r&&r(M.current,$)};return a.jsx(b,{appear:o,in:l,nodeRef:M,onEnter:O,onEntered:V,onEntering:F,onExit:v,onExited:N,onExiting:L,addEndListener:A,timeout:y==="auto"?null:y,...x,children:($,{ownerState:R,..._})=>D.cloneElement(s,{style:{opacity:0,transform:ec(.75),visibility:$==="exited"&&!l?"hidden":void 0,...YC[$],...g,...s.props.style},ref:E,..._})})});ii&&(ii.muiSupportAuto=!0);const KC={entering:{opacity:1},entered:{opacity:1}},ao=D.forwardRef(function(t,n){const r=$r(),o={enter:r.transitions.duration.enteringScreen,exit:r.transitions.duration.leavingScreen},{addEndListener:s,appear:i=!0,children:l,easing:c,in:u,onEnter:d,onEntered:f,onEntering:m,onExit:h,onExited:g,onExiting:y,style:b,timeout:x=o,TransitionComponent:C=Fn,...T}=t,w=D.useRef(null),M=Ze(w,os(l),n),E=A=>$=>{if(A){const R=w.current;$===void 0?A(R):A(R,$)}},j=E(m),F=E((A,$)=>{Bh(A);const R=Qo({style:b,timeout:x,easing:c},{mode:"enter"});A.style.webkitTransition=r.transitions.create("opacity",R),A.style.transition=r.transitions.create("opacity",R),d&&d(A,$)}),O=E(f),V=E(y),L=E(A=>{const $=Qo({style:b,timeout:x,easing:c},{mode:"exit"});A.style.webkitTransition=r.transitions.create("opacity",$),A.style.transition=r.transitions.create("opacity",$),h&&h(A)}),v=E(g),N=A=>{s&&s(w.current,A)};return a.jsx(C,{appear:i,in:u,nodeRef:w,onEnter:F,onEntered:O,onEntering:j,onExit:L,onExited:v,onExiting:V,addEndListener:N,timeout:x,...T,children:(A,{ownerState:$,...R})=>D.cloneElement(l,{style:{opacity:0,visibility:A==="exited"&&!u?"hidden":void 0,...KC[A],...b,...l.props.style},ref:M,...R})})});function GC(e){return $e("MuiPaper",e)}Ee("MuiPaper",["root","rounded","outlined","elevation","elevation0","elevation1","elevation2","elevation3","elevation4","elevation5","elevation6","elevation7","elevation8","elevation9","elevation10","elevation11","elevation12","elevation13","elevation14","elevation15","elevation16","elevation17","elevation18","elevation19","elevation20","elevation21","elevation22","elevation23","elevation24"]);const ZC=e=>{const{square:t,elevation:n,variant:r,classes:o}=e,s={root:["root",r,!t&&"rounded",r==="elevation"&&`elevation${n}`]};return Re(s,GC,o)},XC=re("div",{name:"MuiPaper",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,t[n.variant],!n.square&&t.rounded,n.variant==="elevation"&&t[`elevation${n.elevation}`]]}})(He(({theme:e})=>({backgroundColor:(e.vars||e).palette.background.paper,color:(e.vars||e).palette.text.primary,transition:e.transitions.create("box-shadow"),variants:[{props:({ownerState:t})=>!t.square,style:{borderRadius:e.shape.borderRadius}},{props:{variant:"outlined"},style:{border:`1px solid ${(e.vars||e).palette.divider}`}},{props:{variant:"elevation"},style:{boxShadow:"var(--Paper-shadow)",backgroundImage:"var(--Paper-overlay)"}}]}))),po=D.forwardRef(function(t,n){const r=We({props:t,name:"MuiPaper"}),o=$r(),{className:s,component:i="div",elevation:l=1,square:c=!1,variant:u="elevation",...d}=r,f={...r,component:i,elevation:l,square:c,variant:u},m=ZC(f);return a.jsx(XC,{as:i,ownerState:f,className:Te(m.root,s),ref:n,...d,style:{...u==="elevation"&&{"--Paper-shadow":(o.vars||o).shadows[l],...o.vars&&{"--Paper-overlay":o.vars.overlays?.[l]},...!o.vars&&o.palette.mode==="dark"&&{"--Paper-overlay":`linear-gradient(${ma("#fff",Ul(l))}, ${ma("#fff",Ul(l))})`}},...d.style}})});var sn="top",En="bottom",On="right",an="left",zc="auto",ki=[sn,En,On,an],Jo="start",ai="end",QC="clippingParents",Vh="viewport",ks="popper",JC="reference",gp=ki.reduce(function(e,t){return e.concat([t+"-"+Jo,t+"-"+ai])},[]),zh=[].concat(ki,[zc]).reduce(function(e,t){return e.concat([t,t+"-"+Jo,t+"-"+ai])},[]),ew="beforeRead",tw="read",nw="afterRead",rw="beforeMain",ow="main",sw="afterMain",iw="beforeWrite",aw="write",lw="afterWrite",cw=[ew,tw,nw,rw,ow,sw,iw,aw,lw];function sr(e){return e?(e.nodeName||"").toLowerCase():null}function gn(e){if(e==null)return window;if(e.toString()!=="[object Window]"){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function lo(e){var t=gn(e).Element;return e instanceof t||e instanceof Element}function Mn(e){var t=gn(e).HTMLElement;return e instanceof t||e instanceof HTMLElement}function _c(e){if(typeof ShadowRoot>"u")return!1;var t=gn(e).ShadowRoot;return e instanceof t||e instanceof ShadowRoot}function uw(e){var t=e.state;Object.keys(t.elements).forEach(function(n){var r=t.styles[n]||{},o=t.attributes[n]||{},s=t.elements[n];!Mn(s)||!sr(s)||(Object.assign(s.style,r),Object.keys(o).forEach(function(i){var l=o[i];l===!1?s.removeAttribute(i):s.setAttribute(i,l===!0?"":l)}))})}function dw(e){var t=e.state,n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow),function(){Object.keys(t.elements).forEach(function(r){var o=t.elements[r],s=t.attributes[r]||{},i=Object.keys(t.styles.hasOwnProperty(r)?t.styles[r]:n[r]),l=i.reduce(function(c,u){return c[u]="",c},{});!Mn(o)||!sr(o)||(Object.assign(o.style,l),Object.keys(s).forEach(function(c){o.removeAttribute(c)}))})}}const pw={name:"applyStyles",enabled:!0,phase:"write",fn:uw,effect:dw,requires:["computeStyles"]};function rr(e){return e.split("-")[0]}var no=Math.max,Ca=Math.min,es=Math.round;function tc(){var e=navigator.userAgentData;return e!=null&&e.brands&&Array.isArray(e.brands)?e.brands.map(function(t){return t.brand+"/"+t.version}).join(" "):navigator.userAgent}function _h(){return!/^((?!chrome|android).)*safari/i.test(tc())}function ts(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!1);var r=e.getBoundingClientRect(),o=1,s=1;t&&Mn(e)&&(o=e.offsetWidth>0&&es(r.width)/e.offsetWidth||1,s=e.offsetHeight>0&&es(r.height)/e.offsetHeight||1);var i=lo(e)?gn(e):window,l=i.visualViewport,c=!_h()&&n,u=(r.left+(c&&l?l.offsetLeft:0))/o,d=(r.top+(c&&l?l.offsetTop:0))/s,f=r.width/o,m=r.height/s;return{width:f,height:m,top:d,right:u+f,bottom:d+m,left:u,x:u,y:d}}function Wc(e){var t=ts(e),n=e.offsetWidth,r=e.offsetHeight;return Math.abs(t.width-n)<=1&&(n=t.width),Math.abs(t.height-r)<=1&&(r=t.height),{x:e.offsetLeft,y:e.offsetTop,width:n,height:r}}function Wh(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&_c(n)){var r=t;do{if(r&&e.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function vr(e){return gn(e).getComputedStyle(e)}function fw(e){return["table","td","th"].indexOf(sr(e))>=0}function Ar(e){return((lo(e)?e.ownerDocument:e.document)||window.document).documentElement}function qa(e){return sr(e)==="html"?e:e.assignedSlot||e.parentNode||(_c(e)?e.host:null)||Ar(e)}function yp(e){return!Mn(e)||vr(e).position==="fixed"?null:e.offsetParent}function hw(e){var t=/firefox/i.test(tc()),n=/Trident/i.test(tc());if(n&&Mn(e)){var r=vr(e);if(r.position==="fixed")return null}var o=qa(e);for(_c(o)&&(o=o.host);Mn(o)&&["html","body"].indexOf(sr(o))<0;){var s=vr(o);if(s.transform!=="none"||s.perspective!=="none"||s.contain==="paint"||["transform","perspective"].indexOf(s.willChange)!==-1||t&&s.willChange==="filter"||t&&s.filter&&s.filter!=="none")return o;o=o.parentNode}return null}function Ti(e){for(var t=gn(e),n=yp(e);n&&fw(n)&&vr(n).position==="static";)n=yp(n);return n&&(sr(n)==="html"||sr(n)==="body"&&vr(n).position==="static")?t:n||hw(e)||t}function Hc(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function Qs(e,t,n){return no(e,Ca(t,n))}function mw(e,t,n){var r=Qs(e,t,n);return r>n?n:r}function Hh(){return{top:0,right:0,bottom:0,left:0}}function Uh(e){return Object.assign({},Hh(),e)}function qh(e,t){return t.reduce(function(n,r){return n[r]=e,n},{})}var gw=function(t,n){return t=typeof t=="function"?t(Object.assign({},n.rects,{placement:n.placement})):t,Uh(typeof t!="number"?t:qh(t,ki))};function yw(e){var t,n=e.state,r=e.name,o=e.options,s=n.elements.arrow,i=n.modifiersData.popperOffsets,l=rr(n.placement),c=Hc(l),u=[an,On].indexOf(l)>=0,d=u?"height":"width";if(!(!s||!i)){var f=gw(o.padding,n),m=Wc(s),h=c==="y"?sn:an,g=c==="y"?En:On,y=n.rects.reference[d]+n.rects.reference[c]-i[c]-n.rects.popper[d],b=i[c]-n.rects.reference[c],x=Ti(s),C=x?c==="y"?x.clientHeight||0:x.clientWidth||0:0,T=y/2-b/2,w=f[h],M=C-m[d]-f[g],E=C/2-m[d]/2+T,j=Qs(w,E,M),F=c;n.modifiersData[r]=(t={},t[F]=j,t.centerOffset=j-E,t)}}function bw(e){var t=e.state,n=e.options,r=n.element,o=r===void 0?"[data-popper-arrow]":r;o!=null&&(typeof o=="string"&&(o=t.elements.popper.querySelector(o),!o)||Wh(t.elements.popper,o)&&(t.elements.arrow=o))}const xw={name:"arrow",enabled:!0,phase:"main",fn:yw,effect:bw,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function ns(e){return e.split("-")[1]}var vw={top:"auto",right:"auto",bottom:"auto",left:"auto"};function Sw(e,t){var n=e.x,r=e.y,o=t.devicePixelRatio||1;return{x:es(n*o)/o||0,y:es(r*o)/o||0}}function bp(e){var t,n=e.popper,r=e.popperRect,o=e.placement,s=e.variation,i=e.offsets,l=e.position,c=e.gpuAcceleration,u=e.adaptive,d=e.roundOffsets,f=e.isFixed,m=i.x,h=m===void 0?0:m,g=i.y,y=g===void 0?0:g,b=typeof d=="function"?d({x:h,y}):{x:h,y};h=b.x,y=b.y;var x=i.hasOwnProperty("x"),C=i.hasOwnProperty("y"),T=an,w=sn,M=window;if(u){var E=Ti(n),j="clientHeight",F="clientWidth";if(E===gn(n)&&(E=Ar(n),vr(E).position!=="static"&&l==="absolute"&&(j="scrollHeight",F="scrollWidth")),E=E,o===sn||(o===an||o===On)&&s===ai){w=En;var O=f&&E===M&&M.visualViewport?M.visualViewport.height:E[j];y-=O-r.height,y*=c?1:-1}if(o===an||(o===sn||o===En)&&s===ai){T=On;var V=f&&E===M&&M.visualViewport?M.visualViewport.width:E[F];h-=V-r.width,h*=c?1:-1}}var L=Object.assign({position:l},u&&vw),v=d===!0?Sw({x:h,y},gn(n)):{x:h,y};if(h=v.x,y=v.y,c){var N;return Object.assign({},L,(N={},N[w]=C?"0":"",N[T]=x?"0":"",N.transform=(M.devicePixelRatio||1)<=1?"translate("+h+"px, "+y+"px)":"translate3d("+h+"px, "+y+"px, 0)",N))}return Object.assign({},L,(t={},t[w]=C?y+"px":"",t[T]=x?h+"px":"",t.transform="",t))}function Cw(e){var t=e.state,n=e.options,r=n.gpuAcceleration,o=r===void 0?!0:r,s=n.adaptive,i=s===void 0?!0:s,l=n.roundOffsets,c=l===void 0?!0:l,u={placement:rr(t.placement),variation:ns(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:o,isFixed:t.options.strategy==="fixed"};t.modifiersData.popperOffsets!=null&&(t.styles.popper=Object.assign({},t.styles.popper,bp(Object.assign({},u,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:i,roundOffsets:c})))),t.modifiersData.arrow!=null&&(t.styles.arrow=Object.assign({},t.styles.arrow,bp(Object.assign({},u,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:c})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})}const ww={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:Cw,data:{}};var zi={passive:!0};function kw(e){var t=e.state,n=e.instance,r=e.options,o=r.scroll,s=o===void 0?!0:o,i=r.resize,l=i===void 0?!0:i,c=gn(t.elements.popper),u=[].concat(t.scrollParents.reference,t.scrollParents.popper);return s&&u.forEach(function(d){d.addEventListener("scroll",n.update,zi)}),l&&c.addEventListener("resize",n.update,zi),function(){s&&u.forEach(function(d){d.removeEventListener("scroll",n.update,zi)}),l&&c.removeEventListener("resize",n.update,zi)}}const Tw={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:kw,data:{}};var Iw={left:"right",right:"left",bottom:"top",top:"bottom"};function aa(e){return e.replace(/left|right|bottom|top/g,function(t){return Iw[t]})}var Mw={start:"end",end:"start"};function xp(e){return e.replace(/start|end/g,function(t){return Mw[t]})}function Uc(e){var t=gn(e),n=t.pageXOffset,r=t.pageYOffset;return{scrollLeft:n,scrollTop:r}}function qc(e){return ts(Ar(e)).left+Uc(e).scrollLeft}function Dw(e,t){var n=gn(e),r=Ar(e),o=n.visualViewport,s=r.clientWidth,i=r.clientHeight,l=0,c=0;if(o){s=o.width,i=o.height;var u=_h();(u||!u&&t==="fixed")&&(l=o.offsetLeft,c=o.offsetTop)}return{width:s,height:i,x:l+qc(e),y:c}}function Pw(e){var t,n=Ar(e),r=Uc(e),o=(t=e.ownerDocument)==null?void 0:t.body,s=no(n.scrollWidth,n.clientWidth,o?o.scrollWidth:0,o?o.clientWidth:0),i=no(n.scrollHeight,n.clientHeight,o?o.scrollHeight:0,o?o.clientHeight:0),l=-r.scrollLeft+qc(e),c=-r.scrollTop;return vr(o||n).direction==="rtl"&&(l+=no(n.clientWidth,o?o.clientWidth:0)-s),{width:s,height:i,x:l,y:c}}function Yc(e){var t=vr(e),n=t.overflow,r=t.overflowX,o=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+o+r)}function Yh(e){return["html","body","#document"].indexOf(sr(e))>=0?e.ownerDocument.body:Mn(e)&&Yc(e)?e:Yh(qa(e))}function Js(e,t){var n;t===void 0&&(t=[]);var r=Yh(e),o=r===((n=e.ownerDocument)==null?void 0:n.body),s=gn(r),i=o?[s].concat(s.visualViewport||[],Yc(r)?r:[]):r,l=t.concat(i);return o?l:l.concat(Js(qa(i)))}function nc(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function Ew(e,t){var n=ts(e,!1,t==="fixed");return n.top=n.top+e.clientTop,n.left=n.left+e.clientLeft,n.bottom=n.top+e.clientHeight,n.right=n.left+e.clientWidth,n.width=e.clientWidth,n.height=e.clientHeight,n.x=n.left,n.y=n.top,n}function vp(e,t,n){return t===Vh?nc(Dw(e,n)):lo(t)?Ew(t,n):nc(Pw(Ar(e)))}function Ow(e){var t=Js(qa(e)),n=["absolute","fixed"].indexOf(vr(e).position)>=0,r=n&&Mn(e)?Ti(e):e;return lo(r)?t.filter(function(o){return lo(o)&&Wh(o,r)&&sr(o)!=="body"}):[]}function Rw(e,t,n,r){var o=t==="clippingParents"?Ow(e):[].concat(t),s=[].concat(o,[n]),i=s[0],l=s.reduce(function(c,u){var d=vp(e,u,r);return c.top=no(d.top,c.top),c.right=Ca(d.right,c.right),c.bottom=Ca(d.bottom,c.bottom),c.left=no(d.left,c.left),c},vp(e,i,r));return l.width=l.right-l.left,l.height=l.bottom-l.top,l.x=l.left,l.y=l.top,l}function Kh(e){var t=e.reference,n=e.element,r=e.placement,o=r?rr(r):null,s=r?ns(r):null,i=t.x+t.width/2-n.width/2,l=t.y+t.height/2-n.height/2,c;switch(o){case sn:c={x:i,y:t.y-n.height};break;case En:c={x:i,y:t.y+t.height};break;case On:c={x:t.x+t.width,y:l};break;case an:c={x:t.x-n.width,y:l};break;default:c={x:t.x,y:t.y}}var u=o?Hc(o):null;if(u!=null){var d=u==="y"?"height":"width";switch(s){case Jo:c[u]=c[u]-(t[d]/2-n[d]/2);break;case ai:c[u]=c[u]+(t[d]/2-n[d]/2);break}}return c}function li(e,t){t===void 0&&(t={});var n=t,r=n.placement,o=r===void 0?e.placement:r,s=n.strategy,i=s===void 0?e.strategy:s,l=n.boundary,c=l===void 0?QC:l,u=n.rootBoundary,d=u===void 0?Vh:u,f=n.elementContext,m=f===void 0?ks:f,h=n.altBoundary,g=h===void 0?!1:h,y=n.padding,b=y===void 0?0:y,x=Uh(typeof b!="number"?b:qh(b,ki)),C=m===ks?JC:ks,T=e.rects.popper,w=e.elements[g?C:m],M=Rw(lo(w)?w:w.contextElement||Ar(e.elements.popper),c,d,i),E=ts(e.elements.reference),j=Kh({reference:E,element:T,placement:o}),F=nc(Object.assign({},T,j)),O=m===ks?F:E,V={top:M.top-O.top+x.top,bottom:O.bottom-M.bottom+x.bottom,left:M.left-O.left+x.left,right:O.right-M.right+x.right},L=e.modifiersData.offset;if(m===ks&&L){var v=L[o];Object.keys(V).forEach(function(N){var A=[On,En].indexOf(N)>=0?1:-1,$=[sn,En].indexOf(N)>=0?"y":"x";V[N]+=v[$]*A})}return V}function jw(e,t){t===void 0&&(t={});var n=t,r=n.placement,o=n.boundary,s=n.rootBoundary,i=n.padding,l=n.flipVariations,c=n.allowedAutoPlacements,u=c===void 0?zh:c,d=ns(r),f=d?l?gp:gp.filter(function(g){return ns(g)===d}):ki,m=f.filter(function(g){return u.indexOf(g)>=0});m.length===0&&(m=f);var h=m.reduce(function(g,y){return g[y]=li(e,{placement:y,boundary:o,rootBoundary:s,padding:i})[rr(y)],g},{});return Object.keys(h).sort(function(g,y){return h[g]-h[y]})}function $w(e){if(rr(e)===zc)return[];var t=aa(e);return[xp(e),t,xp(t)]}function Aw(e){var t=e.state,n=e.options,r=e.name;if(!t.modifiersData[r]._skip){for(var o=n.mainAxis,s=o===void 0?!0:o,i=n.altAxis,l=i===void 0?!0:i,c=n.fallbackPlacements,u=n.padding,d=n.boundary,f=n.rootBoundary,m=n.altBoundary,h=n.flipVariations,g=h===void 0?!0:h,y=n.allowedAutoPlacements,b=t.options.placement,x=rr(b),C=x===b,T=c||(C||!g?[aa(b)]:$w(b)),w=[b].concat(T).reduce(function(me,X){return me.concat(rr(X)===zc?jw(t,{placement:X,boundary:d,rootBoundary:f,padding:u,flipVariations:g,allowedAutoPlacements:y}):X)},[]),M=t.rects.reference,E=t.rects.popper,j=new Map,F=!0,O=w[0],V=0;V<w.length;V++){var L=w[V],v=rr(L),N=ns(L)===Jo,A=[sn,En].indexOf(v)>=0,$=A?"width":"height",R=li(t,{placement:L,boundary:d,rootBoundary:f,altBoundary:m,padding:u}),_=A?N?On:an:N?En:sn;M[$]>E[$]&&(_=aa(_));var z=aa(_),W=[];if(s&&W.push(R[v]<=0),l&&W.push(R[_]<=0,R[z]<=0),W.every(function(me){return me})){O=L,F=!1;break}j.set(L,W)}if(F)for(var H=g?3:1,G=function(X){var K=w.find(function(le){var oe=j.get(le);if(oe)return oe.slice(0,X).every(function(te){return te})});if(K)return O=K,"break"},se=H;se>0;se--){var pe=G(se);if(pe==="break")break}t.placement!==O&&(t.modifiersData[r]._skip=!0,t.placement=O,t.reset=!0)}}const Fw={name:"flip",enabled:!0,phase:"main",fn:Aw,requiresIfExists:["offset"],data:{_skip:!1}};function Sp(e,t,n){return n===void 0&&(n={x:0,y:0}),{top:e.top-t.height-n.y,right:e.right-t.width+n.x,bottom:e.bottom-t.height+n.y,left:e.left-t.width-n.x}}function Cp(e){return[sn,On,En,an].some(function(t){return e[t]>=0})}function Nw(e){var t=e.state,n=e.name,r=t.rects.reference,o=t.rects.popper,s=t.modifiersData.preventOverflow,i=li(t,{elementContext:"reference"}),l=li(t,{altBoundary:!0}),c=Sp(i,r),u=Sp(l,o,s),d=Cp(c),f=Cp(u);t.modifiersData[n]={referenceClippingOffsets:c,popperEscapeOffsets:u,isReferenceHidden:d,hasPopperEscaped:f},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":d,"data-popper-escaped":f})}const Lw={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:Nw};function Bw(e,t,n){var r=rr(e),o=[an,sn].indexOf(r)>=0?-1:1,s=typeof n=="function"?n(Object.assign({},t,{placement:e})):n,i=s[0],l=s[1];return i=i||0,l=(l||0)*o,[an,On].indexOf(r)>=0?{x:l,y:i}:{x:i,y:l}}function Vw(e){var t=e.state,n=e.options,r=e.name,o=n.offset,s=o===void 0?[0,0]:o,i=zh.reduce(function(d,f){return d[f]=Bw(f,t.rects,s),d},{}),l=i[t.placement],c=l.x,u=l.y;t.modifiersData.popperOffsets!=null&&(t.modifiersData.popperOffsets.x+=c,t.modifiersData.popperOffsets.y+=u),t.modifiersData[r]=i}const zw={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:Vw};function _w(e){var t=e.state,n=e.name;t.modifiersData[n]=Kh({reference:t.rects.reference,element:t.rects.popper,placement:t.placement})}const Ww={name:"popperOffsets",enabled:!0,phase:"read",fn:_w,data:{}};function Hw(e){return e==="x"?"y":"x"}function Uw(e){var t=e.state,n=e.options,r=e.name,o=n.mainAxis,s=o===void 0?!0:o,i=n.altAxis,l=i===void 0?!1:i,c=n.boundary,u=n.rootBoundary,d=n.altBoundary,f=n.padding,m=n.tether,h=m===void 0?!0:m,g=n.tetherOffset,y=g===void 0?0:g,b=li(t,{boundary:c,rootBoundary:u,padding:f,altBoundary:d}),x=rr(t.placement),C=ns(t.placement),T=!C,w=Hc(x),M=Hw(w),E=t.modifiersData.popperOffsets,j=t.rects.reference,F=t.rects.popper,O=typeof y=="function"?y(Object.assign({},t.rects,{placement:t.placement})):y,V=typeof O=="number"?{mainAxis:O,altAxis:O}:Object.assign({mainAxis:0,altAxis:0},O),L=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,v={x:0,y:0};if(E){if(s){var N,A=w==="y"?sn:an,$=w==="y"?En:On,R=w==="y"?"height":"width",_=E[w],z=_+b[A],W=_-b[$],H=h?-F[R]/2:0,G=C===Jo?j[R]:F[R],se=C===Jo?-F[R]:-j[R],pe=t.elements.arrow,me=h&&pe?Wc(pe):{width:0,height:0},X=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:Hh(),K=X[A],le=X[$],oe=Qs(0,j[R],me[R]),te=T?j[R]/2-H-oe-K-V.mainAxis:G-oe-K-V.mainAxis,Z=T?-j[R]/2+H+oe+le+V.mainAxis:se+oe+le+V.mainAxis,J=t.elements.arrow&&Ti(t.elements.arrow),ae=J?w==="y"?J.clientTop||0:J.clientLeft||0:0,Q=(N=L?.[w])!=null?N:0,ue=_+te-Q-ae,he=_+Z-Q,de=Qs(h?Ca(z,ue):z,_,h?no(W,he):W);E[w]=de,v[w]=de-_}if(l){var Se,ce=w==="x"?sn:an,Pe=w==="x"?En:On,Ce=E[M],Ve=M==="y"?"height":"width",De=Ce+b[ce],pt=Ce-b[Pe],Ye=[sn,an].indexOf(x)!==-1,tt=(Se=L?.[M])!=null?Se:0,gt=Ye?De:Ce-j[Ve]-F[Ve]-tt+V.altAxis,kt=Ye?Ce+j[Ve]+F[Ve]-tt-V.altAxis:pt,Pt=h&&Ye?mw(gt,Ce,kt):Qs(h?gt:De,Ce,h?kt:pt);E[M]=Pt,v[M]=Pt-Ce}t.modifiersData[r]=v}}const qw={name:"preventOverflow",enabled:!0,phase:"main",fn:Uw,requiresIfExists:["offset"]};function Yw(e){return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}}function Kw(e){return e===gn(e)||!Mn(e)?Uc(e):Yw(e)}function Gw(e){var t=e.getBoundingClientRect(),n=es(t.width)/e.offsetWidth||1,r=es(t.height)/e.offsetHeight||1;return n!==1||r!==1}function Zw(e,t,n){n===void 0&&(n=!1);var r=Mn(t),o=Mn(t)&&Gw(t),s=Ar(t),i=ts(e,o,n),l={scrollLeft:0,scrollTop:0},c={x:0,y:0};return(r||!r&&!n)&&((sr(t)!=="body"||Yc(s))&&(l=Kw(t)),Mn(t)?(c=ts(t,!0),c.x+=t.clientLeft,c.y+=t.clientTop):s&&(c.x=qc(s))),{x:i.left+l.scrollLeft-c.x,y:i.top+l.scrollTop-c.y,width:i.width,height:i.height}}function Xw(e){var t=new Map,n=new Set,r=[];e.forEach(function(s){t.set(s.name,s)});function o(s){n.add(s.name);var i=[].concat(s.requires||[],s.requiresIfExists||[]);i.forEach(function(l){if(!n.has(l)){var c=t.get(l);c&&o(c)}}),r.push(s)}return e.forEach(function(s){n.has(s.name)||o(s)}),r}function Qw(e){var t=Xw(e);return cw.reduce(function(n,r){return n.concat(t.filter(function(o){return o.phase===r}))},[])}function Jw(e){var t;return function(){return t||(t=new Promise(function(n){Promise.resolve().then(function(){t=void 0,n(e())})})),t}}function e1(e){var t=e.reduce(function(n,r){var o=n[r.name];return n[r.name]=o?Object.assign({},o,r,{options:Object.assign({},o.options,r.options),data:Object.assign({},o.data,r.data)}):r,n},{});return Object.keys(t).map(function(n){return t[n]})}var wp={placement:"bottom",modifiers:[],strategy:"absolute"};function kp(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return!t.some(function(r){return!(r&&typeof r.getBoundingClientRect=="function")})}function t1(e){e===void 0&&(e={});var t=e,n=t.defaultModifiers,r=n===void 0?[]:n,o=t.defaultOptions,s=o===void 0?wp:o;return function(l,c,u){u===void 0&&(u=s);var d={placement:"bottom",orderedModifiers:[],options:Object.assign({},wp,s),modifiersData:{},elements:{reference:l,popper:c},attributes:{},styles:{}},f=[],m=!1,h={state:d,setOptions:function(x){var C=typeof x=="function"?x(d.options):x;y(),d.options=Object.assign({},s,d.options,C),d.scrollParents={reference:lo(l)?Js(l):l.contextElement?Js(l.contextElement):[],popper:Js(c)};var T=Qw(e1([].concat(r,d.options.modifiers)));return d.orderedModifiers=T.filter(function(w){return w.enabled}),g(),h.update()},forceUpdate:function(){if(!m){var x=d.elements,C=x.reference,T=x.popper;if(kp(C,T)){d.rects={reference:Zw(C,Ti(T),d.options.strategy==="fixed"),popper:Wc(T)},d.reset=!1,d.placement=d.options.placement,d.orderedModifiers.forEach(function(V){return d.modifiersData[V.name]=Object.assign({},V.data)});for(var w=0;w<d.orderedModifiers.length;w++){if(d.reset===!0){d.reset=!1,w=-1;continue}var M=d.orderedModifiers[w],E=M.fn,j=M.options,F=j===void 0?{}:j,O=M.name;typeof E=="function"&&(d=E({state:d,options:F,name:O,instance:h})||d)}}}},update:Jw(function(){return new Promise(function(b){h.forceUpdate(),b(d)})}),destroy:function(){y(),m=!0}};if(!kp(l,c))return h;h.setOptions(u).then(function(b){!m&&u.onFirstUpdate&&u.onFirstUpdate(b)});function g(){d.orderedModifiers.forEach(function(b){var x=b.name,C=b.options,T=C===void 0?{}:C,w=b.effect;if(typeof w=="function"){var M=w({state:d,name:x,instance:h,options:T}),E=function(){};f.push(M||E)}})}function y(){f.forEach(function(b){return b()}),f=[]}return h}}var n1=[Tw,Ww,ww,pw,zw,Fw,qw,xw,Lw],r1=t1({defaultModifiers:n1});function o1(e){return typeof e=="function"?e():e}const Gh=D.forwardRef(function(t,n){const{children:r,container:o,disablePortal:s=!1}=t,[i,l]=D.useState(null),c=Ze(D.isValidElement(r)?os(r):null,n);if(Wt(()=>{s||l(o1(o)||document.body)},[o,s]),Wt(()=>{if(i&&!s)return ql(n,i),()=>{ql(n,null)}},[n,i,s]),s){if(D.isValidElement(r)){const u={ref:c};return D.cloneElement(r,u)}return r}return i&&Db.createPortal(r,i)});function s1(e){return $e("MuiPopper",e)}Ee("MuiPopper",["root"]);function i1(e,t){if(t==="ltr")return e;switch(e){case"bottom-end":return"bottom-start";case"bottom-start":return"bottom-end";case"top-end":return"top-start";case"top-start":return"top-end";default:return e}}function rc(e){return typeof e=="function"?e():e}function a1(e){return e.nodeType!==void 0}const l1=e=>{const{classes:t}=e;return Re({root:["root"]},s1,t)},c1={},u1=D.forwardRef(function(t,n){const{anchorEl:r,children:o,direction:s,disablePortal:i,modifiers:l,open:c,placement:u,popperOptions:d,popperRef:f,slotProps:m={},slots:h={},TransitionProps:g,ownerState:y,...b}=t,x=D.useRef(null),C=Ze(x,n),T=D.useRef(null),w=Ze(T,f),M=D.useRef(w);Wt(()=>{M.current=w},[w]),D.useImperativeHandle(f,()=>T.current,[]);const E=i1(u,s),[j,F]=D.useState(E),[O,V]=D.useState(rc(r));D.useEffect(()=>{T.current&&T.current.forceUpdate()}),D.useEffect(()=>{r&&V(rc(r))},[r]),Wt(()=>{if(!O||!c)return;const $=z=>{F(z.placement)};let R=[{name:"preventOverflow",options:{altBoundary:i}},{name:"flip",options:{altBoundary:i}},{name:"onUpdate",enabled:!0,phase:"afterWrite",fn:({state:z})=>{$(z)}}];l!=null&&(R=R.concat(l)),d&&d.modifiers!=null&&(R=R.concat(d.modifiers));const _=r1(O,x.current,{placement:E,...d,modifiers:R});return M.current(_),()=>{_.destroy(),M.current(null)}},[O,i,l,c,d,E]);const L={placement:j};g!==null&&(L.TransitionProps=g);const v=l1(t),N=h.root??"div",A=Ge({elementType:N,externalSlotProps:m.root,externalForwardedProps:b,additionalProps:{role:"tooltip",ref:C},ownerState:t,className:v.root});return a.jsx(N,{...A,children:typeof o=="function"?o(L):o})}),d1=D.forwardRef(function(t,n){const{anchorEl:r,children:o,container:s,direction:i="ltr",disablePortal:l=!1,keepMounted:c=!1,modifiers:u,open:d,placement:f="bottom",popperOptions:m=c1,popperRef:h,style:g,transition:y=!1,slotProps:b={},slots:x={},...C}=t,[T,w]=D.useState(!0),M=()=>{w(!1)},E=()=>{w(!0)};if(!c&&!d&&(!y||T))return null;let j;if(s)j=s;else if(r){const V=rc(r);j=V&&a1(V)?zt(V).body:zt(null).body}const F=!d&&c&&(!y||T)?"none":void 0,O=y?{in:d,onEnter:M,onExited:E}:void 0;return a.jsx(Gh,{disablePortal:l,container:j,children:a.jsx(u1,{anchorEl:r,direction:i,disablePortal:l,modifiers:u,ref:n,open:y?!T:d,placement:f,popperOptions:m,popperRef:h,slotProps:b,slots:x,...C,style:{position:"fixed",top:0,left:0,display:F,...g},TransitionProps:O,children:o})})}),p1=re(d1,{name:"MuiPopper",slot:"Root"})({}),Kc=D.forwardRef(function(t,n){const r=An(),o=We({props:t,name:"MuiPopper"}),{anchorEl:s,component:i,components:l,componentsProps:c,container:u,disablePortal:d,keepMounted:f,modifiers:m,open:h,placement:g,popperOptions:y,popperRef:b,transition:x,slots:C,slotProps:T,...w}=o,M=C?.root??l?.Root,E={anchorEl:s,container:u,disablePortal:d,keepMounted:f,modifiers:m,open:h,placement:g,popperOptions:y,popperRef:b,transition:x,...w};return a.jsx(p1,{as:i,direction:r?"rtl":"ltr",slots:{root:M},slotProps:T??c,...E,ref:n})}),f1=["input","select","textarea","a[href]","button","[tabindex]","audio[controls]","video[controls]",'[contenteditable]:not([contenteditable="false"])'].join(",");function h1(e){const t=parseInt(e.getAttribute("tabindex")||"",10);return Number.isNaN(t)?e.contentEditable==="true"||(e.nodeName==="AUDIO"||e.nodeName==="VIDEO"||e.nodeName==="DETAILS")&&e.getAttribute("tabindex")===null?0:e.tabIndex:t}function m1(e){if(e.tagName!=="INPUT"||e.type!=="radio"||!e.name)return!1;const t=r=>e.ownerDocument.querySelector(`input[type="radio"]${r}`);let n=t(`[name="${e.name}"]:checked`);return n||(n=t(`[name="${e.name}"]`)),n!==e}function g1(e){return!(e.disabled||e.tagName==="INPUT"&&e.type==="hidden"||m1(e))}function y1(e){const t=[],n=[];return Array.from(e.querySelectorAll(f1)).forEach((r,o)=>{const s=h1(r);s===-1||!g1(r)||(s===0?t.push(r):n.push({documentOrder:o,tabIndex:s,node:r}))}),n.sort((r,o)=>r.tabIndex===o.tabIndex?r.documentOrder-o.documentOrder:r.tabIndex-o.tabIndex).map(r=>r.node).concat(t)}function b1(){return!0}function Zh(e){const{children:t,disableAutoFocus:n=!1,disableEnforceFocus:r=!1,disableRestoreFocus:o=!1,getTabbable:s=y1,isEnabled:i=b1,open:l}=e,c=D.useRef(!1),u=D.useRef(null),d=D.useRef(null),f=D.useRef(null),m=D.useRef(null),h=D.useRef(!1),g=D.useRef(null),y=Ze(os(t),g),b=D.useRef(null);D.useEffect(()=>{!l||!g.current||(h.current=!n)},[n,l]),D.useEffect(()=>{if(!l||!g.current)return;const T=zt(g.current);return g.current.contains(T.activeElement)||(g.current.hasAttribute("tabIndex")||g.current.setAttribute("tabIndex","-1"),h.current&&g.current.focus()),()=>{o||(f.current&&f.current.focus&&(c.current=!0,f.current.focus()),f.current=null)}},[l]),D.useEffect(()=>{if(!l||!g.current)return;const T=zt(g.current),w=j=>{b.current=j,!(r||!i()||j.key!=="Tab")&&T.activeElement===g.current&&j.shiftKey&&(c.current=!0,d.current&&d.current.focus())},M=()=>{const j=g.current;if(j===null)return;if(!T.hasFocus()||!i()||c.current){c.current=!1;return}if(j.contains(T.activeElement)||r&&T.activeElement!==u.current&&T.activeElement!==d.current)return;if(T.activeElement!==m.current)m.current=null;else if(m.current!==null)return;if(!h.current)return;let F=[];if((T.activeElement===u.current||T.activeElement===d.current)&&(F=s(g.current)),F.length>0){const O=!!(b.current?.shiftKey&&b.current?.key==="Tab"),V=F[0],L=F[F.length-1];typeof V!="string"&&typeof L!="string"&&(O?L.focus():V.focus())}else j.focus()};T.addEventListener("focusin",M),T.addEventListener("keydown",w,!0);const E=setInterval(()=>{T.activeElement&&T.activeElement.tagName==="BODY"&&M()},50);return()=>{clearInterval(E),T.removeEventListener("focusin",M),T.removeEventListener("keydown",w,!0)}},[n,r,o,i,l,s]);const x=T=>{f.current===null&&(f.current=T.relatedTarget),h.current=!0,m.current=T.target;const w=t.props.onFocus;w&&w(T)},C=T=>{f.current===null&&(f.current=T.relatedTarget),h.current=!0};return a.jsxs(D.Fragment,{children:[a.jsx("div",{tabIndex:l?0:-1,onFocus:C,ref:u,"data-testid":"sentinelStart"}),D.cloneElement(t,{ref:y,onFocus:x}),a.jsx("div",{tabIndex:l?0:-1,onFocus:C,ref:d,"data-testid":"sentinelEnd"})]})}function x1(e){return $e("MuiPickersPopper",e)}Ee("MuiPickersPopper",["root","paper"]);function v1(e,t){return Array.isArray(t)?t.every(n=>e.indexOf(n)!==-1):e.indexOf(t)!==-1}const S1=(e,t)=>n=>{(n.key==="Enter"||n.key===" ")&&(e(n),n.preventDefault(),n.stopPropagation())},on=(e=document)=>{const t=e.activeElement;return t?t.shadowRoot?on(t.shadowRoot):t:null},C1="@media (pointer: fine)",w1="@media (prefers-reduced-motion: reduce)",qo=typeof navigator<"u"&&navigator.userAgent.match(/android\s(\d+)|OS\s(\d+)/i),Tp=qo&&qo[1]?parseInt(qo[1],10):null,Ip=qo&&qo[2]?parseInt(qo[2],10):null,k1=Tp&&Tp<10||Ip&&Ip<13||!1,Xh=()=>xh(w1,{defaultMatches:!1})||k1,T1=["PaperComponent","popperPlacement","ownerState","children","paperSlotProps","paperClasses","onPaperClick","onPaperTouchStart"],I1=e=>{const{classes:t}=e;return Re({root:["root"],paper:["paper"]},x1,t)},M1=re(Kc,{name:"MuiPickersPopper",slot:"Root",overridesResolver:(e,t)=>t.root})(({theme:e})=>({zIndex:e.zIndex.modal})),D1=re(po,{name:"MuiPickersPopper",slot:"Paper",overridesResolver:(e,t)=>t.paper})({outline:0,transformOrigin:"top center",variants:[{props:({placement:e})=>["top","top-start","top-end"].includes(e),style:{transformOrigin:"bottom center"}}]});function P1(e,t){return t.documentElement.clientWidth<e.clientX||t.documentElement.clientHeight<e.clientY}function E1(e,t){const n=D.useRef(!1),r=D.useRef(!1),o=D.useRef(null),s=D.useRef(!1);D.useEffect(()=>{if(!e)return;function c(){s.current=!0}return document.addEventListener("mousedown",c,!0),document.addEventListener("touchstart",c,!0),()=>{document.removeEventListener("mousedown",c,!0),document.removeEventListener("touchstart",c,!0),s.current=!1}},[e]);const i=Me(c=>{if(!s.current)return;const u=r.current;r.current=!1;const d=zt(o.current);if(!o.current||"clientX"in c&&P1(c,d))return;if(n.current){n.current=!1;return}let f;c.composedPath?f=c.composedPath().indexOf(o.current)>-1:f=!d.documentElement.contains(c.target)||o.current.contains(c.target),!f&&!u&&t(c)}),l=()=>{r.current=!0};return D.useEffect(()=>{if(e){const c=zt(o.current),u=()=>{n.current=!0};return c.addEventListener("touchstart",i),c.addEventListener("touchmove",u),()=>{c.removeEventListener("touchstart",i),c.removeEventListener("touchmove",u)}}},[e,i]),D.useEffect(()=>{if(e){const c=zt(o.current);return c.addEventListener("click",i),()=>{c.removeEventListener("click",i),r.current=!1}}},[e,i]),[o,l,l]}const O1=D.forwardRef((e,t)=>{const{PaperComponent:n,popperPlacement:r,ownerState:o,children:s,paperSlotProps:i,paperClasses:l,onPaperClick:c,onPaperTouchStart:u}=e,d=Fe(e,T1),f=U({},o,{placement:r}),m=Ge({elementType:n,externalSlotProps:i,additionalProps:{tabIndex:-1,elevation:8,ref:t},className:l,ownerState:f});return a.jsx(n,U({},d,m,{onClick:h=>{c(h),m.onClick?.(h)},onTouchStart:h=>{u(h),m.onTouchStart?.(h)},ownerState:f,children:s}))});function R1(e){const t=wt({props:e,name:"MuiPickersPopper"}),{anchorEl:n,children:r,containerRef:o=null,shouldRestoreFocus:s,onBlur:i,onDismiss:l,open:c,role:u,placement:d,slots:f,slotProps:m,reduceAnimations:h}=t;D.useEffect(()=>{function $(R){c&&R.key==="Escape"&&l()}return document.addEventListener("keydown",$),()=>{document.removeEventListener("keydown",$)}},[l,c]);const g=D.useRef(null);D.useEffect(()=>{u==="tooltip"||s&&!s()||(c?g.current=on(document):g.current&&g.current instanceof HTMLElement&&setTimeout(()=>{g.current instanceof HTMLElement&&g.current.focus()}))},[c,u,s]);const[y,b,x]=E1(c,i??l),C=D.useRef(null),T=Ze(C,o),w=Ze(T,y),M=t,E=I1(M),j=Xh(),F=h??j,O=$=>{$.key==="Escape"&&($.stopPropagation(),l())},V=f?.desktopTransition??F?ao:ii,L=f?.desktopTrapFocus??Zh,v=f?.desktopPaper??D1,N=f?.popper??M1,A=Ge({elementType:N,externalSlotProps:m?.popper,additionalProps:{transition:!0,role:u,open:c,anchorEl:n,placement:d,onKeyDown:O},className:E.root,ownerState:t});return a.jsx(N,U({},A,{children:({TransitionProps:$,placement:R})=>a.jsx(L,U({open:c,disableAutoFocus:!0,disableRestoreFocus:!0,disableEnforceFocus:u==="tooltip",isEnabled:()=>!0},m?.desktopTrapFocus,{children:a.jsx(V,U({},$,m?.desktopTransition,{children:a.jsx(O1,{PaperComponent:v,ownerState:M,popperPlacement:R,ref:w,onPaperClick:b,onPaperTouchStart:x,paperClasses:E.paper,paperSlotProps:m?.desktopPaper,children:r})}))}))}))}const j1=({open:e,onOpen:t,onClose:n})=>{const r=D.useRef(typeof e=="boolean").current,[o,s]=D.useState(!1);D.useEffect(()=>{if(r){if(typeof e!="boolean")throw new Error("You must not mix controlling and uncontrolled mode for `open` prop");s(e)}},[r,e]);const i=D.useCallback(l=>{r||s(l),l&&t&&t(),!l&&n&&n()},[r,t,n]);return{isOpen:o,setIsOpen:i}},Gc=({timezone:e,value:t,defaultValue:n,referenceDate:r,onChange:o,valueManager:s})=>{const i=It(),l=D.useRef(n),c=t??l.current??s.emptyValue,u=D.useMemo(()=>s.getTimezone(i,c),[i,s,c]),d=Me(g=>u==null?g:s.setTimezone(i,u,g));let f;e?f=e:u?f=u:r?f=i.getTimezone(r):f="default";const m=D.useMemo(()=>s.setTimezone(i,f,c),[s,i,f,c]),h=Me((g,...y)=>{const b=d(g);o?.(b,...y)});return{value:m,handleValueChange:h,timezone:f}},Zc=({name:e,timezone:t,value:n,defaultValue:r,referenceDate:o,onChange:s,valueManager:i})=>{const[l,c]=mn({name:e,state:"value",controlled:n,default:r??i.emptyValue}),u=Me((d,...f)=>{c(d),s?.(d,...f)});return Gc({timezone:t,value:l,defaultValue:void 0,referenceDate:o,onChange:u,valueManager:i})},$1=e=>{const{action:t,hasChanged:n,dateState:r,isControlled:o}=e,s=!o&&!r.hasBeenModifiedSinceMount;return t.name==="setValueFromField"?!0:t.name==="setValueFromAction"?s&&["accept","today","clear"].includes(t.pickerAction)?!0:n(r.lastPublishedValue):t.name==="setValueFromView"&&t.selectionState!=="shallow"||t.name==="setValueFromShortcut"?s?!0:n(r.lastPublishedValue):!1},A1=e=>{const{action:t,hasChanged:n,dateState:r,isControlled:o,closeOnSelect:s}=e,i=!o&&!r.hasBeenModifiedSinceMount;return t.name==="setValueFromAction"?i&&["accept","today","clear"].includes(t.pickerAction)?!0:n(r.lastCommittedValue):t.name==="setValueFromView"&&t.selectionState==="finish"&&s?i?!0:n(r.lastCommittedValue):t.name==="setValueFromShortcut"?t.changeImportance==="accept"&&n(r.lastCommittedValue):!1},F1=e=>{const{action:t,closeOnSelect:n}=e;return t.name==="setValueFromAction"?!0:t.name==="setValueFromView"?t.selectionState==="finish"&&n:t.name==="setValueFromShortcut"?t.changeImportance==="accept":!1},N1=({props:e,valueManager:t,valueType:n,wrapperVariant:r,validator:o})=>{const{onAccept:s,onChange:i,value:l,defaultValue:c,closeOnSelect:u=r==="desktop",timezone:d,referenceDate:f}=e,{current:m}=D.useRef(c),{current:h}=D.useRef(l!==void 0),[g,y]=D.useState(d),b=It(),x=uo(),{isOpen:C,setIsOpen:T}=j1(e),{timezone:w,value:M,handleValueChange:E}=Gc({timezone:d,value:l,defaultValue:m,referenceDate:f,onChange:i,valueManager:t}),[j,F]=D.useState(()=>{let te;return M!==void 0?te=M:m!==void 0?te=m:te=t.emptyValue,{draft:te,lastPublishedValue:te,lastCommittedValue:te,lastControlledValue:l,hasBeenModifiedSinceMount:!1}}),O=t.getTimezone(b,j.draft);g!==d&&(y(d),d&&O&&d!==O&&F(te=>U({},te,{draft:t.setTimezone(b,d,te.draft)})));const{getValidationErrorForNewValue:V}=Fh({props:e,validator:o,timezone:w,value:j.draft,onError:e.onError}),L=Me(te=>{const Z={action:te,dateState:j,hasChanged:de=>!t.areValuesEqual(b,te.value,de),isControlled:h,closeOnSelect:u},J=$1(Z),ae=A1(Z),Q=F1(Z);F(de=>U({},de,{draft:te.value,lastPublishedValue:J?te.value:de.lastPublishedValue,lastCommittedValue:ae?te.value:de.lastCommittedValue,hasBeenModifiedSinceMount:!0}));let ue=null;const he=()=>(ue||(ue={validationError:te.name==="setValueFromField"?te.context.validationError:V(te.value)},te.name==="setValueFromShortcut"&&(ue.shortcut=te.shortcut)),ue);J&&E(te.value,he()),ae&&s&&s(te.value,he()),Q&&T(!1)});if(j.lastControlledValue!==l){const te=t.areValuesEqual(b,j.draft,M);F(Z=>U({},Z,{lastControlledValue:l},te?{}:{lastCommittedValue:M,lastPublishedValue:M,draft:M,hasBeenModifiedSinceMount:!0}))}const v=Me(()=>{L({value:t.emptyValue,name:"setValueFromAction",pickerAction:"clear"})}),N=Me(()=>{L({value:j.lastPublishedValue,name:"setValueFromAction",pickerAction:"accept"})}),A=Me(()=>{L({value:j.lastPublishedValue,name:"setValueFromAction",pickerAction:"dismiss"})}),$=Me(()=>{L({value:j.lastCommittedValue,name:"setValueFromAction",pickerAction:"cancel"})}),R=Me(()=>{L({value:t.getTodayValue(b,w,n),name:"setValueFromAction",pickerAction:"today"})}),_=Me(te=>{te.preventDefault(),T(!0)}),z=Me(te=>{te?.preventDefault(),T(!1)}),W=Me((te,Z="partial")=>L({name:"setValueFromView",value:te,selectionState:Z})),H=Me((te,Z,J)=>L({name:"setValueFromShortcut",value:te,changeImportance:Z,shortcut:J})),G=Me((te,Z)=>L({name:"setValueFromField",value:te,context:Z})),se={onClear:v,onAccept:N,onDismiss:A,onCancel:$,onSetToday:R,onOpen:_,onClose:z},pe={value:j.draft,onChange:G},me=D.useMemo(()=>t.cleanValue(b,j.draft),[b,t,j.draft]),X={value:me,onChange:W,onClose:z,open:C},le=U({},se,{value:me,onChange:W,onSelectShortcut:H,isValid:te=>{const Z=o({adapter:x,value:te,timezone:w,props:e});return!t.hasError(Z)}}),oe=D.useMemo(()=>({onOpen:_,onClose:z,open:C}),[C,z,_]);return{open:C,fieldProps:pe,viewProps:X,layoutProps:le,actions:se,contextValue:oe}};function Qh({onChange:e,onViewChange:t,openTo:n,view:r,views:o,autoFocus:s,focusedView:i,onFocusedViewChange:l}){const c=D.useRef(n),u=D.useRef(o),d=D.useRef(o.includes(n)?n:o[0]),[f,m]=mn({name:"useViews",state:"view",controlled:r,default:d.current}),h=D.useRef(s?f:null),[g,y]=mn({name:"useViews",state:"focusedView",controlled:i,default:h.current});D.useEffect(()=>{(c.current&&c.current!==n||u.current&&u.current.some(j=>!o.includes(j)))&&(m(o.includes(n)?n:o[0]),u.current=o,c.current=n)},[n,m,f,o]);const b=o.indexOf(f),x=o[b-1]??null,C=o[b+1]??null,T=Me((j,F)=>{y(F?j:O=>j===O?null:O),l?.(j,F)}),w=Me(j=>{T(j,!0),j!==f&&(m(j),t&&t(j))}),M=Me(()=>{C&&w(C)}),E=Me((j,F,O)=>{const V=F==="finish",L=O?o.indexOf(O)<o.length-1:!!C;if(e(j,V&&L?"partial":F,O),O&&O!==f){const N=o[o.indexOf(O)+1];N&&w(N)}else V&&M()});return{view:f,setView:w,focusedView:g,setFocusedView:T,nextView:C,previousView:x,defaultView:o.includes(n)?n:o[0],goToNextView:M,setValueAndGoToNextView:E}}const L1=["className","sx"],B1=({props:e,propsFromPickerValue:t,additionalViewProps:n,autoFocusView:r,rendererInterceptor:o,fieldRef:s})=>{const{onChange:i,open:l,onClose:c}=t,{view:u,views:d,openTo:f,onViewChange:m,viewRenderers:h,timezone:g}=e,y=Fe(e,L1),{view:b,setView:x,defaultView:C,focusedView:T,setFocusedView:w,setValueAndGoToNextView:M}=Qh({view:u,views:d,openTo:f,onChange:i,onViewChange:m,autoFocus:r}),{hasUIView:E,viewModeLookup:j}=D.useMemo(()=>d.reduce((A,$)=>{let R;return h[$]!=null?R="UI":R="field",A.viewModeLookup[$]=R,R==="UI"&&(A.hasUIView=!0),A},{hasUIView:!1,viewModeLookup:{}}),[h,d]),F=D.useMemo(()=>d.reduce((A,$)=>h[$]!=null&&yS($)?A+1:A,0),[h,d]),O=j[b],V=Me(()=>O==="UI"),[L,v]=D.useState(O==="UI"?b:null);return L!==b&&j[b]==="UI"&&v(b),Wt(()=>{O==="field"&&l&&(c(),setTimeout(()=>{s?.current?.setSelectedSections(b),s?.current?.focusField(b)}))},[b]),Wt(()=>{if(!l)return;let A=b;O==="field"&&L!=null&&(A=L),A!==C&&j[A]==="UI"&&j[C]==="UI"&&(A=C),A!==b&&x(A),w(A,!0)},[l]),{hasUIView:E,shouldRestoreFocus:V,layoutProps:{views:d,view:L,onViewChange:x},renderCurrentView:()=>{if(L==null)return null;const A=h[L];if(A==null)return null;const $=U({},y,n,t,{views:d,timezone:g,onChange:M,view:L,onViewChange:x,focusedView:T,onFocusedViewChange:w,showViewSwitcher:F>1,timeViewsCount:F});return o?o(h,L,$):A($)}}};function Mp(){return typeof window>"u"?"portrait":window.screen&&window.screen.orientation&&window.screen.orientation.angle?Math.abs(window.screen.orientation.angle)===90?"landscape":"portrait":window.orientation&&Math.abs(Number(window.orientation))===90?"landscape":"portrait"}const V1=(e,t)=>{const[n,r]=D.useState(Mp);return Wt(()=>{const s=()=>{r(Mp())};return window.addEventListener("orientationchange",s),()=>{window.removeEventListener("orientationchange",s)}},[]),v1(e,["hours","minutes","seconds"])?!1:(t||n)==="landscape"},z1=({props:e,propsFromPickerValue:t,propsFromPickerViews:n,wrapperVariant:r})=>{const{orientation:o}=e,s=V1(n.views,o),i=An();return{layoutProps:U({},n,t,{isLandscape:s,isRtl:i,wrapperVariant:r,disabled:e.disabled,readOnly:e.readOnly})}};function _1(e){const{props:t,pickerValueResponse:n}=e;return D.useMemo(()=>({value:n.viewProps.value,open:n.open,disabled:t.disabled??!1,readOnly:t.readOnly??!1}),[n.viewProps.value,n.open,t.disabled,t.readOnly])}const Jh=({props:e,valueManager:t,valueType:n,wrapperVariant:r,additionalViewProps:o,validator:s,autoFocusView:i,rendererInterceptor:l,fieldRef:c})=>{const u=N1({props:e,valueManager:t,valueType:n,wrapperVariant:r,validator:s}),d=B1({props:e,additionalViewProps:o,autoFocusView:i,fieldRef:c,propsFromPickerValue:u.viewProps,rendererInterceptor:l}),f=z1({props:e,wrapperVariant:r,propsFromPickerValue:u.layoutProps,propsFromPickerViews:d.layoutProps}),m=_1({props:e,pickerValueResponse:u});return{open:u.open,actions:u.actions,fieldProps:u.fieldProps,renderCurrentView:d.renderCurrentView,hasUIView:d.hasUIView,shouldRestoreFocus:d.shouldRestoreFocus,layoutProps:f.layoutProps,contextValue:u.contextValue,ownerState:m}};function em(e){return $e("MuiPickersLayout",e)}const Hr=Ee("MuiPickersLayout",["root","landscape","contentWrapper","toolbar","actionBar","tabs","shortcuts"]);function W1(e){return $e("MuiButton",e)}const Ur=Ee("MuiButton",["root","text","textInherit","textPrimary","textSecondary","textSuccess","textError","textInfo","textWarning","outlined","outlinedInherit","outlinedPrimary","outlinedSecondary","outlinedSuccess","outlinedError","outlinedInfo","outlinedWarning","contained","containedInherit","containedPrimary","containedSecondary","containedSuccess","containedError","containedInfo","containedWarning","disableElevation","focusVisible","disabled","colorInherit","colorPrimary","colorSecondary","colorSuccess","colorError","colorInfo","colorWarning","textSizeSmall","textSizeMedium","textSizeLarge","outlinedSizeSmall","outlinedSizeMedium","outlinedSizeLarge","containedSizeSmall","containedSizeMedium","containedSizeLarge","sizeMedium","sizeSmall","sizeLarge","fullWidth","startIcon","endIcon","icon","iconSizeSmall","iconSizeMedium","iconSizeLarge","loading","loadingWrapper","loadingIconPlaceholder","loadingIndicator","loadingPositionCenter","loadingPositionStart","loadingPositionEnd"]),H1=D.createContext({}),U1=D.createContext(void 0),q1=e=>{const{color:t,disableElevation:n,fullWidth:r,size:o,variant:s,loading:i,loadingPosition:l,classes:c}=e,u={root:["root",i&&"loading",s,`${s}${ve(t)}`,`size${ve(o)}`,`${s}Size${ve(o)}`,`color${ve(t)}`,n&&"disableElevation",r&&"fullWidth",i&&`loadingPosition${ve(l)}`],startIcon:["icon","startIcon",`iconSize${ve(o)}`],endIcon:["icon","endIcon",`iconSize${ve(o)}`],loadingIndicator:["loadingIndicator"],loadingWrapper:["loadingWrapper"]},d=Re(u,W1,c);return{...c,...d}},tm=[{props:{size:"small"},style:{"& > *:nth-of-type(1)":{fontSize:18}}},{props:{size:"medium"},style:{"& > *:nth-of-type(1)":{fontSize:20}}},{props:{size:"large"},style:{"& > *:nth-of-type(1)":{fontSize:22}}}],Y1=re(io,{shouldForwardProp:e=>nn(e)||e==="classes",name:"MuiButton",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,t[n.variant],t[`${n.variant}${ve(n.color)}`],t[`size${ve(n.size)}`],t[`${n.variant}Size${ve(n.size)}`],n.color==="inherit"&&t.colorInherit,n.disableElevation&&t.disableElevation,n.fullWidth&&t.fullWidth,n.loading&&t.loading]}})(He(({theme:e})=>{const t=e.palette.mode==="light"?e.palette.grey[300]:e.palette.grey[800],n=e.palette.mode==="light"?e.palette.grey.A100:e.palette.grey[700];return{...e.typography.button,minWidth:64,padding:"6px 16px",border:0,borderRadius:(e.vars||e).shape.borderRadius,transition:e.transitions.create(["background-color","box-shadow","border-color","color"],{duration:e.transitions.duration.short}),"&:hover":{textDecoration:"none"},[`&.${Ur.disabled}`]:{color:(e.vars||e).palette.action.disabled},variants:[{props:{variant:"contained"},style:{color:"var(--variant-containedColor)",backgroundColor:"var(--variant-containedBg)",boxShadow:(e.vars||e).shadows[2],"&:hover":{boxShadow:(e.vars||e).shadows[4],"@media (hover: none)":{boxShadow:(e.vars||e).shadows[2]}},"&:active":{boxShadow:(e.vars||e).shadows[8]},[`&.${Ur.focusVisible}`]:{boxShadow:(e.vars||e).shadows[6]},[`&.${Ur.disabled}`]:{color:(e.vars||e).palette.action.disabled,boxShadow:(e.vars||e).shadows[0],backgroundColor:(e.vars||e).palette.action.disabledBackground}}},{props:{variant:"outlined"},style:{padding:"5px 15px",border:"1px solid currentColor",borderColor:"var(--variant-outlinedBorder, currentColor)",backgroundColor:"var(--variant-outlinedBg)",color:"var(--variant-outlinedColor)",[`&.${Ur.disabled}`]:{border:`1px solid ${(e.vars||e).palette.action.disabledBackground}`}}},{props:{variant:"text"},style:{padding:"6px 8px",color:"var(--variant-textColor)",backgroundColor:"var(--variant-textBg)"}},...Object.entries(e.palette).filter(tn()).map(([r])=>({props:{color:r},style:{"--variant-textColor":(e.vars||e).palette[r].main,"--variant-outlinedColor":(e.vars||e).palette[r].main,"--variant-outlinedBorder":e.alpha((e.vars||e).palette[r].main,.5),"--variant-containedColor":(e.vars||e).palette[r].contrastText,"--variant-containedBg":(e.vars||e).palette[r].main,"@media (hover: hover)":{"&:hover":{"--variant-containedBg":(e.vars||e).palette[r].dark,"--variant-textBg":e.alpha((e.vars||e).palette[r].main,(e.vars||e).palette.action.hoverOpacity),"--variant-outlinedBorder":(e.vars||e).palette[r].main,"--variant-outlinedBg":e.alpha((e.vars||e).palette[r].main,(e.vars||e).palette.action.hoverOpacity)}}}})),{props:{color:"inherit"},style:{color:"inherit",borderColor:"currentColor","--variant-containedBg":e.vars?e.vars.palette.Button.inheritContainedBg:t,"@media (hover: hover)":{"&:hover":{"--variant-containedBg":e.vars?e.vars.palette.Button.inheritContainedHoverBg:n,"--variant-textBg":e.alpha((e.vars||e).palette.text.primary,(e.vars||e).palette.action.hoverOpacity),"--variant-outlinedBg":e.alpha((e.vars||e).palette.text.primary,(e.vars||e).palette.action.hoverOpacity)}}}},{props:{size:"small",variant:"text"},style:{padding:"4px 5px",fontSize:e.typography.pxToRem(13)}},{props:{size:"large",variant:"text"},style:{padding:"8px 11px",fontSize:e.typography.pxToRem(15)}},{props:{size:"small",variant:"outlined"},style:{padding:"3px 9px",fontSize:e.typography.pxToRem(13)}},{props:{size:"large",variant:"outlined"},style:{padding:"7px 21px",fontSize:e.typography.pxToRem(15)}},{props:{size:"small",variant:"contained"},style:{padding:"4px 10px",fontSize:e.typography.pxToRem(13)}},{props:{size:"large",variant:"contained"},style:{padding:"8px 22px",fontSize:e.typography.pxToRem(15)}},{props:{disableElevation:!0},style:{boxShadow:"none","&:hover":{boxShadow:"none"},[`&.${Ur.focusVisible}`]:{boxShadow:"none"},"&:active":{boxShadow:"none"},[`&.${Ur.disabled}`]:{boxShadow:"none"}}},{props:{fullWidth:!0},style:{width:"100%"}},{props:{loadingPosition:"center"},style:{transition:e.transitions.create(["background-color","box-shadow","border-color"],{duration:e.transitions.duration.short}),[`&.${Ur.loading}`]:{color:"transparent"}}}]}})),K1=re("span",{name:"MuiButton",slot:"StartIcon",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.startIcon,n.loading&&t.startIconLoadingStart,t[`iconSize${ve(n.size)}`]]}})(({theme:e})=>({display:"inherit",marginRight:8,marginLeft:-4,variants:[{props:{size:"small"},style:{marginLeft:-2}},{props:{loadingPosition:"start",loading:!0},style:{transition:e.transitions.create(["opacity"],{duration:e.transitions.duration.short}),opacity:0}},{props:{loadingPosition:"start",loading:!0,fullWidth:!0},style:{marginRight:-8}},...tm]})),G1=re("span",{name:"MuiButton",slot:"EndIcon",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.endIcon,n.loading&&t.endIconLoadingEnd,t[`iconSize${ve(n.size)}`]]}})(({theme:e})=>({display:"inherit",marginRight:-4,marginLeft:8,variants:[{props:{size:"small"},style:{marginRight:-2}},{props:{loadingPosition:"end",loading:!0},style:{transition:e.transitions.create(["opacity"],{duration:e.transitions.duration.short}),opacity:0}},{props:{loadingPosition:"end",loading:!0,fullWidth:!0},style:{marginLeft:-8}},...tm]})),Z1=re("span",{name:"MuiButton",slot:"LoadingIndicator"})(({theme:e})=>({display:"none",position:"absolute",visibility:"visible",variants:[{props:{loading:!0},style:{display:"flex"}},{props:{loadingPosition:"start"},style:{left:14}},{props:{loadingPosition:"start",size:"small"},style:{left:10}},{props:{variant:"text",loadingPosition:"start"},style:{left:6}},{props:{loadingPosition:"center"},style:{left:"50%",transform:"translate(-50%)",color:(e.vars||e).palette.action.disabled}},{props:{loadingPosition:"end"},style:{right:14}},{props:{loadingPosition:"end",size:"small"},style:{right:10}},{props:{variant:"text",loadingPosition:"end"},style:{right:6}},{props:{loadingPosition:"start",fullWidth:!0},style:{position:"relative",left:-10}},{props:{loadingPosition:"end",fullWidth:!0},style:{position:"relative",right:-10}}]})),Dp=re("span",{name:"MuiButton",slot:"LoadingIconPlaceholder"})({display:"inline-block",width:"1em",height:"1em"}),Dt=D.forwardRef(function(t,n){const r=D.useContext(H1),o=D.useContext(U1),s=oi(r,t),i=We({props:s,name:"MuiButton"}),{children:l,color:c="primary",component:u="button",className:d,disabled:f=!1,disableElevation:m=!1,disableFocusRipple:h=!1,endIcon:g,focusVisibleClassName:y,fullWidth:b=!1,id:x,loading:C=null,loadingIndicator:T,loadingPosition:w="center",size:M="medium",startIcon:E,type:j,variant:F="text",...O}=i,V=Un(x),L=T??a.jsx(Vc,{"aria-labelledby":V,color:"inherit",size:16}),v={...i,color:c,component:u,disabled:f,disableElevation:m,disableFocusRipple:h,fullWidth:b,loading:C,loadingIndicator:L,loadingPosition:w,size:M,type:j,variant:F},N=q1(v),A=(E||C&&w==="start")&&a.jsx(K1,{className:N.startIcon,ownerState:v,children:E||a.jsx(Dp,{className:N.loadingIconPlaceholder,ownerState:v})}),$=(g||C&&w==="end")&&a.jsx(G1,{className:N.endIcon,ownerState:v,children:g||a.jsx(Dp,{className:N.loadingIconPlaceholder,ownerState:v})}),R=o||"",_=typeof C=="boolean"?a.jsx("span",{className:N.loadingWrapper,style:{display:"contents"},children:C&&a.jsx(Z1,{className:N.loadingIndicator,ownerState:v,children:L})}):null;return a.jsxs(Y1,{ownerState:v,className:Te(r.className,N.root,d,R),component:u,disabled:f||C,focusRipple:!h,focusVisibleClassName:Te(N.focusVisible,y),ref:n,type:j,id:C?V:x,...O,classes:N,children:[A,w!=="end"&&_,l,w==="end"&&_,$]})});function X1(e){return $e("MuiDialogActions",e)}Ee("MuiDialogActions",["root","spacing"]);const Q1=e=>{const{classes:t,disableSpacing:n}=e;return Re({root:["root",!n&&"spacing"]},X1,t)},J1=re("div",{name:"MuiDialogActions",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,!n.disableSpacing&&t.spacing]}})({display:"flex",alignItems:"center",padding:8,justifyContent:"flex-end",flex:"0 0 auto",variants:[{props:({ownerState:e})=>!e.disableSpacing,style:{"& > :not(style) ~ :not(style)":{marginLeft:8}}}]}),ar=D.forwardRef(function(t,n){const r=We({props:t,name:"MuiDialogActions"}),{className:o,disableSpacing:s=!1,...i}=r,l={...r,disableSpacing:s},c=Q1(l);return a.jsx(J1,{className:Te(c.root,o),ownerState:l,ref:n,...i})}),ek=["onAccept","onClear","onCancel","onSetToday","actions"];function tk(e){const{onAccept:t,onClear:n,onCancel:r,onSetToday:o,actions:s}=e,i=Fe(e,ek),l=Cr();if(s==null||s.length===0)return null;const c=s?.map(u=>{switch(u){case"clear":return a.jsx(Dt,{onClick:n,children:l.clearButtonLabel},u);case"cancel":return a.jsx(Dt,{onClick:r,children:l.cancelButtonLabel},u);case"accept":return a.jsx(Dt,{onClick:t,children:l.okButtonLabel},u);case"today":return a.jsx(Dt,{onClick:o,children:l.todayButtonLabel},u);default:return null}});return a.jsx(ar,U({},i,{children:c}))}const gr=D.createContext({});function nk(e){return $e("MuiList",e)}Ee("MuiList",["root","padding","dense","subheader"]);const rk=e=>{const{classes:t,disablePadding:n,dense:r,subheader:o}=e;return Re({root:["root",!n&&"padding",r&&"dense",o&&"subheader"]},nk,t)},ok=re("ul",{name:"MuiList",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,!n.disablePadding&&t.padding,n.dense&&t.dense,n.subheader&&t.subheader]}})({listStyle:"none",margin:0,padding:0,position:"relative",variants:[{props:({ownerState:e})=>!e.disablePadding,style:{paddingTop:8,paddingBottom:8}},{props:({ownerState:e})=>e.subheader,style:{paddingTop:0}}]}),nm=D.forwardRef(function(t,n){const r=We({props:t,name:"MuiList"}),{children:o,className:s,component:i="ul",dense:l=!1,disablePadding:c=!1,subheader:u,...d}=r,f=D.useMemo(()=>({dense:l}),[l]),m={...r,component:i,dense:l,disablePadding:c},h=rk(m);return a.jsx(gr.Provider,{value:f,children:a.jsxs(ok,{as:i,className:Te(h.root,s),ref:n,ownerState:m,...d,children:[u,o]})})});function sk(e){return $e("MuiListItem",e)}Ee("MuiListItem",["root","container","dense","alignItemsFlexStart","divider","gutters","padding","secondaryAction"]);const ik=Ee("MuiListItemButton",["root","focusVisible","dense","alignItemsFlexStart","disabled","divider","gutters","selected"]);function ak(e){return $e("MuiListItemSecondaryAction",e)}Ee("MuiListItemSecondaryAction",["root","disableGutters"]);const lk=e=>{const{disableGutters:t,classes:n}=e;return Re({root:["root",t&&"disableGutters"]},ak,n)},ck=re("div",{name:"MuiListItemSecondaryAction",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.disableGutters&&t.disableGutters]}})({position:"absolute",right:16,top:"50%",transform:"translateY(-50%)",variants:[{props:({ownerState:e})=>e.disableGutters,style:{right:0}}]}),rm=D.forwardRef(function(t,n){const r=We({props:t,name:"MuiListItemSecondaryAction"}),{className:o,...s}=r,i=D.useContext(gr),l={...r,disableGutters:i.disableGutters},c=lk(l);return a.jsx(ck,{className:Te(c.root,o),ownerState:l,ref:n,...s})});rm.muiName="ListItemSecondaryAction";const uk=(e,t)=>{const{ownerState:n}=e;return[t.root,n.dense&&t.dense,n.alignItems==="flex-start"&&t.alignItemsFlexStart,n.divider&&t.divider,!n.disableGutters&&t.gutters,!n.disablePadding&&t.padding,n.hasSecondaryAction&&t.secondaryAction]},dk=e=>{const{alignItems:t,classes:n,dense:r,disableGutters:o,disablePadding:s,divider:i,hasSecondaryAction:l}=e;return Re({root:["root",r&&"dense",!o&&"gutters",!s&&"padding",i&&"divider",t==="flex-start"&&"alignItemsFlexStart",l&&"secondaryAction"],container:["container"]},sk,n)},pk=re("div",{name:"MuiListItem",slot:"Root",overridesResolver:uk})(He(({theme:e})=>({display:"flex",justifyContent:"flex-start",alignItems:"center",position:"relative",textDecoration:"none",width:"100%",boxSizing:"border-box",textAlign:"left",variants:[{props:({ownerState:t})=>!t.disablePadding,style:{paddingTop:8,paddingBottom:8}},{props:({ownerState:t})=>!t.disablePadding&&t.dense,style:{paddingTop:4,paddingBottom:4}},{props:({ownerState:t})=>!t.disablePadding&&!t.disableGutters,style:{paddingLeft:16,paddingRight:16}},{props:({ownerState:t})=>!t.disablePadding&&!!t.secondaryAction,style:{paddingRight:48}},{props:({ownerState:t})=>!!t.secondaryAction,style:{[`& > .${ik.root}`]:{paddingRight:48}}},{props:{alignItems:"flex-start"},style:{alignItems:"flex-start"}},{props:({ownerState:t})=>t.divider,style:{borderBottom:`1px solid ${(e.vars||e).palette.divider}`,backgroundClip:"padding-box"}},{props:({ownerState:t})=>t.button,style:{transition:e.transitions.create("background-color",{duration:e.transitions.duration.shortest}),"&:hover":{textDecoration:"none",backgroundColor:(e.vars||e).palette.action.hover,"@media (hover: none)":{backgroundColor:"transparent"}}}},{props:({ownerState:t})=>t.hasSecondaryAction,style:{paddingRight:48}}]}))),fk=re("li",{name:"MuiListItem",slot:"Container"})({position:"relative"}),hk=D.forwardRef(function(t,n){const r=We({props:t,name:"MuiListItem"}),{alignItems:o="center",children:s,className:i,component:l,components:c={},componentsProps:u={},ContainerComponent:d="li",ContainerProps:{className:f,...m}={},dense:h=!1,disableGutters:g=!1,disablePadding:y=!1,divider:b=!1,secondaryAction:x,slotProps:C={},slots:T={},...w}=r,M=D.useContext(gr),E=D.useMemo(()=>({dense:h||M.dense||!1,alignItems:o,disableGutters:g}),[o,M.dense,h,g]),j=D.useRef(null),F=D.Children.toArray(s),O=F.length&&ta(F[F.length-1],["ListItemSecondaryAction"]),V={...r,alignItems:o,dense:E.dense,disableGutters:g,disablePadding:y,divider:b,hasSecondaryAction:O},L=dk(V),v=Ze(j,n),N=T.root||c.Root||pk,A=C.root||u.root||{},$={className:Te(L.root,A.className,i),...w};let R=l||"li";return O?(R=!$.component&&!l?"div":R,d==="li"&&(R==="li"?R="div":$.component==="li"&&($.component="div")),a.jsx(gr.Provider,{value:E,children:a.jsxs(fk,{as:d,className:Te(L.container,f),ref:v,ownerState:V,...m,children:[a.jsx(N,{...A,...!Zo(N)&&{as:R,ownerState:{...V,...A.ownerState}},...$,children:F}),F.pop()]})})):a.jsx(gr.Provider,{value:E,children:a.jsxs(N,{...A,as:R,ref:v,...!Zo(N)&&{ownerState:{...V,...A.ownerState}},...$,children:[F,x&&a.jsx(rm,{children:x})]})})}),mk=Xe(a.jsx("path",{d:"M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2zm5 13.59L15.59 17 12 13.41 8.41 17 7 15.59 10.59 12 7 8.41 8.41 7 12 10.59 15.59 7 17 8.41 13.41 12 17 15.59z"}));function gk(e){return $e("MuiChip",e)}const Qe=Ee("MuiChip",["root","sizeSmall","sizeMedium","colorDefault","colorError","colorInfo","colorPrimary","colorSecondary","colorSuccess","colorWarning","disabled","clickable","clickableColorPrimary","clickableColorSecondary","deletable","deletableColorPrimary","deletableColorSecondary","outlined","filled","outlinedPrimary","outlinedSecondary","filledPrimary","filledSecondary","avatar","avatarSmall","avatarMedium","avatarColorPrimary","avatarColorSecondary","icon","iconSmall","iconMedium","iconColorPrimary","iconColorSecondary","label","labelSmall","labelMedium","deleteIcon","deleteIconSmall","deleteIconMedium","deleteIconColorPrimary","deleteIconColorSecondary","deleteIconOutlinedColorPrimary","deleteIconOutlinedColorSecondary","deleteIconFilledColorPrimary","deleteIconFilledColorSecondary","focusVisible"]);function et(e,t){const{className:n,elementType:r,ownerState:o,externalForwardedProps:s,internalForwardedProps:i,shouldForwardComponentProp:l=!1,...c}=t,{component:u,slots:d={[e]:void 0},slotProps:f={[e]:void 0},...m}=s,h=d[e]||r,g=In(f[e],o),{props:{component:y,...b},internalRef:x}=kh({className:n,...c,externalForwardedProps:e==="root"?m:void 0,externalSlotProps:g}),C=Ze(x,g?.ref,t.ref),T=e==="root"?y||u:y,w=wh(h,{...e==="root"&&!u&&!d[e]&&i,...e!=="root"&&!d[e]&&i,...b,...T&&!l&&{as:T},...T&&l&&{component:T},ref:C},o);return[h,w]}const yk=e=>{const{classes:t,disabled:n,size:r,color:o,iconColor:s,onDelete:i,clickable:l,variant:c}=e,u={root:["root",c,n&&"disabled",`size${ve(r)}`,`color${ve(o)}`,l&&"clickable",l&&`clickableColor${ve(o)}`,i&&"deletable",i&&`deletableColor${ve(o)}`,`${c}${ve(o)}`],label:["label",`label${ve(r)}`],avatar:["avatar",`avatar${ve(r)}`,`avatarColor${ve(o)}`],icon:["icon",`icon${ve(r)}`,`iconColor${ve(s)}`],deleteIcon:["deleteIcon",`deleteIcon${ve(r)}`,`deleteIconColor${ve(o)}`,`deleteIcon${ve(c)}Color${ve(o)}`]};return Re(u,gk,t)},bk=re("div",{name:"MuiChip",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e,{color:r,iconColor:o,clickable:s,onDelete:i,size:l,variant:c}=n;return[{[`& .${Qe.avatar}`]:t.avatar},{[`& .${Qe.avatar}`]:t[`avatar${ve(l)}`]},{[`& .${Qe.avatar}`]:t[`avatarColor${ve(r)}`]},{[`& .${Qe.icon}`]:t.icon},{[`& .${Qe.icon}`]:t[`icon${ve(l)}`]},{[`& .${Qe.icon}`]:t[`iconColor${ve(o)}`]},{[`& .${Qe.deleteIcon}`]:t.deleteIcon},{[`& .${Qe.deleteIcon}`]:t[`deleteIcon${ve(l)}`]},{[`& .${Qe.deleteIcon}`]:t[`deleteIconColor${ve(r)}`]},{[`& .${Qe.deleteIcon}`]:t[`deleteIcon${ve(c)}Color${ve(r)}`]},t.root,t[`size${ve(l)}`],t[`color${ve(r)}`],s&&t.clickable,s&&r!=="default"&&t[`clickableColor${ve(r)})`],i&&t.deletable,i&&r!=="default"&&t[`deletableColor${ve(r)}`],t[c],t[`${c}${ve(r)}`]]}})(He(({theme:e})=>{const t=e.palette.mode==="light"?e.palette.grey[700]:e.palette.grey[300];return{maxWidth:"100%",fontFamily:e.typography.fontFamily,fontSize:e.typography.pxToRem(13),display:"inline-flex",alignItems:"center",justifyContent:"center",height:32,lineHeight:1.5,color:(e.vars||e).palette.text.primary,backgroundColor:(e.vars||e).palette.action.selected,borderRadius:32/2,whiteSpace:"nowrap",transition:e.transitions.create(["background-color","box-shadow"]),cursor:"unset",outline:0,textDecoration:"none",border:0,padding:0,verticalAlign:"middle",boxSizing:"border-box",[`&.${Qe.disabled}`]:{opacity:(e.vars||e).palette.action.disabledOpacity,pointerEvents:"none"},[`& .${Qe.avatar}`]:{marginLeft:5,marginRight:-6,width:24,height:24,color:e.vars?e.vars.palette.Chip.defaultAvatarColor:t,fontSize:e.typography.pxToRem(12)},[`& .${Qe.avatarColorPrimary}`]:{color:(e.vars||e).palette.primary.contrastText,backgroundColor:(e.vars||e).palette.primary.dark},[`& .${Qe.avatarColorSecondary}`]:{color:(e.vars||e).palette.secondary.contrastText,backgroundColor:(e.vars||e).palette.secondary.dark},[`& .${Qe.avatarSmall}`]:{marginLeft:4,marginRight:-4,width:18,height:18,fontSize:e.typography.pxToRem(10)},[`& .${Qe.icon}`]:{marginLeft:5,marginRight:-6},[`& .${Qe.deleteIcon}`]:{WebkitTapHighlightColor:"transparent",color:e.alpha((e.vars||e).palette.text.primary,.26),fontSize:22,cursor:"pointer",margin:"0 5px 0 -6px","&:hover":{color:e.alpha((e.vars||e).palette.text.primary,.4)}},variants:[{props:{size:"small"},style:{height:24,[`& .${Qe.icon}`]:{fontSize:18,marginLeft:4,marginRight:-4},[`& .${Qe.deleteIcon}`]:{fontSize:16,marginRight:4,marginLeft:-4}}},...Object.entries(e.palette).filter(tn(["contrastText"])).map(([n])=>({props:{color:n},style:{backgroundColor:(e.vars||e).palette[n].main,color:(e.vars||e).palette[n].contrastText,[`& .${Qe.deleteIcon}`]:{color:e.alpha((e.vars||e).palette[n].contrastText,.7),"&:hover, &:active":{color:(e.vars||e).palette[n].contrastText}}}})),{props:n=>n.iconColor===n.color,style:{[`& .${Qe.icon}`]:{color:e.vars?e.vars.palette.Chip.defaultIconColor:t}}},{props:n=>n.iconColor===n.color&&n.color!=="default",style:{[`& .${Qe.icon}`]:{color:"inherit"}}},{props:{onDelete:!0},style:{[`&.${Qe.focusVisible}`]:{backgroundColor:e.alpha((e.vars||e).palette.action.selected,`${(e.vars||e).palette.action.selectedOpacity} + ${(e.vars||e).palette.action.focusOpacity}`)}}},...Object.entries(e.palette).filter(tn(["dark"])).map(([n])=>({props:{color:n,onDelete:!0},style:{[`&.${Qe.focusVisible}`]:{background:(e.vars||e).palette[n].dark}}})),{props:{clickable:!0},style:{userSelect:"none",WebkitTapHighlightColor:"transparent",cursor:"pointer","&:hover":{backgroundColor:e.alpha((e.vars||e).palette.action.selected,`${(e.vars||e).palette.action.selectedOpacity} + ${(e.vars||e).palette.action.hoverOpacity}`)},[`&.${Qe.focusVisible}`]:{backgroundColor:e.alpha((e.vars||e).palette.action.selected,`${(e.vars||e).palette.action.selectedOpacity} + ${(e.vars||e).palette.action.focusOpacity}`)},"&:active":{boxShadow:(e.vars||e).shadows[1]}}},...Object.entries(e.palette).filter(tn(["dark"])).map(([n])=>({props:{color:n,clickable:!0},style:{[`&:hover, &.${Qe.focusVisible}`]:{backgroundColor:(e.vars||e).palette[n].dark}}})),{props:{variant:"outlined"},style:{backgroundColor:"transparent",border:e.vars?`1px solid ${e.vars.palette.Chip.defaultBorder}`:`1px solid ${e.palette.mode==="light"?e.palette.grey[400]:e.palette.grey[700]}`,[`&.${Qe.clickable}:hover`]:{backgroundColor:(e.vars||e).palette.action.hover},[`&.${Qe.focusVisible}`]:{backgroundColor:(e.vars||e).palette.action.focus},[`& .${Qe.avatar}`]:{marginLeft:4},[`& .${Qe.avatarSmall}`]:{marginLeft:2},[`& .${Qe.icon}`]:{marginLeft:4},[`& .${Qe.iconSmall}`]:{marginLeft:2},[`& .${Qe.deleteIcon}`]:{marginRight:5},[`& .${Qe.deleteIconSmall}`]:{marginRight:3}}},...Object.entries(e.palette).filter(tn()).map(([n])=>({props:{variant:"outlined",color:n},style:{color:(e.vars||e).palette[n].main,border:`1px solid ${e.alpha((e.vars||e).palette[n].main,.7)}`,[`&.${Qe.clickable}:hover`]:{backgroundColor:e.alpha((e.vars||e).palette[n].main,(e.vars||e).palette.action.hoverOpacity)},[`&.${Qe.focusVisible}`]:{backgroundColor:e.alpha((e.vars||e).palette[n].main,(e.vars||e).palette.action.focusOpacity)},[`& .${Qe.deleteIcon}`]:{color:e.alpha((e.vars||e).palette[n].main,.7),"&:hover, &:active":{color:(e.vars||e).palette[n].main}}}}))]}})),xk=re("span",{name:"MuiChip",slot:"Label",overridesResolver:(e,t)=>{const{ownerState:n}=e,{size:r}=n;return[t.label,t[`label${ve(r)}`]]}})({overflow:"hidden",textOverflow:"ellipsis",paddingLeft:12,paddingRight:12,whiteSpace:"nowrap",variants:[{props:{variant:"outlined"},style:{paddingLeft:11,paddingRight:11}},{props:{size:"small"},style:{paddingLeft:8,paddingRight:8}},{props:{size:"small",variant:"outlined"},style:{paddingLeft:7,paddingRight:7}}]});function Pp(e){return e.key==="Backspace"||e.key==="Delete"}const om=D.forwardRef(function(t,n){const r=We({props:t,name:"MuiChip"}),{avatar:o,className:s,clickable:i,color:l="default",component:c,deleteIcon:u,disabled:d=!1,icon:f,label:m,onClick:h,onDelete:g,onKeyDown:y,onKeyUp:b,size:x="medium",variant:C="filled",tabIndex:T,skipFocusWhenDisabled:w=!1,slots:M={},slotProps:E={},...j}=r,F=D.useRef(null),O=Ze(F,n),V=K=>{K.stopPropagation(),g&&g(K)},L=K=>{K.currentTarget===K.target&&Pp(K)&&K.preventDefault(),y&&y(K)},v=K=>{K.currentTarget===K.target&&g&&Pp(K)&&g(K),b&&b(K)},N=i!==!1&&h?!0:i,A=N||g?io:c||"div",$={...r,component:A,disabled:d,size:x,color:l,iconColor:D.isValidElement(f)&&f.props.color||l,onDelete:!!g,clickable:N,variant:C},R=yk($),_=A===io?{component:c||"div",focusVisibleClassName:R.focusVisible,...g&&{disableRipple:!0}}:{};let z=null;g&&(z=u&&D.isValidElement(u)?D.cloneElement(u,{className:Te(u.props.className,R.deleteIcon),onClick:V}):a.jsx(mk,{className:R.deleteIcon,onClick:V}));let W=null;o&&D.isValidElement(o)&&(W=D.cloneElement(o,{className:Te(R.avatar,o.props.className)}));let H=null;f&&D.isValidElement(f)&&(H=D.cloneElement(f,{className:Te(R.icon,f.props.className)}));const G={slots:M,slotProps:E},[se,pe]=et("root",{elementType:bk,externalForwardedProps:{...G,...j},ownerState:$,shouldForwardComponentProp:!0,ref:O,className:Te(R.root,s),additionalProps:{disabled:N&&d?!0:void 0,tabIndex:w&&d?-1:T,..._},getSlotProps:K=>({...K,onClick:le=>{K.onClick?.(le),h?.(le)},onKeyDown:le=>{K.onKeyDown?.(le),L(le)},onKeyUp:le=>{K.onKeyUp?.(le),v(le)}})}),[me,X]=et("label",{elementType:xk,externalForwardedProps:G,ownerState:$,className:R.label});return a.jsxs(se,{as:A,...pe,children:[W||H,a.jsx(me,{...X,children:m}),z]})}),ci=36,Ya=2,Ka=320,vk=280,Xc=336,Sk=["items","changeImportance","isLandscape","onChange","isValid"],Ck=["getValue"];function wk(e){const{items:t,changeImportance:n="accept",onChange:r,isValid:o}=e,s=Fe(e,Sk);if(t==null||t.length===0)return null;const i=t.map(l=>{let{getValue:c}=l,u=Fe(l,Ck);const d=c({isValid:o});return U({},u,{label:u.label,onClick:()=>{r(d,n,u)},disabled:!o(d)})});return a.jsx(nm,U({dense:!0,sx:[{maxHeight:Xc,maxWidth:200,overflow:"auto"},...Array.isArray(s.sx)?s.sx:[s.sx]]},s,{children:i.map(l=>a.jsx(hk,{children:a.jsx(om,U({},l))},l.id??l.label))}))}function kk(e){return e.view!==null}const Tk=e=>{const{classes:t,isLandscape:n}=e;return Re({root:["root",n&&"landscape"],contentWrapper:["contentWrapper"],toolbar:["toolbar"],actionBar:["actionBar"],tabs:["tabs"],landscape:["landscape"],shortcuts:["shortcuts"]},em,t)},Ik=e=>{const{wrapperVariant:t,onAccept:n,onClear:r,onCancel:o,onSetToday:s,view:i,views:l,onViewChange:c,value:u,onChange:d,onSelectShortcut:f,isValid:m,isLandscape:h,disabled:g,readOnly:y,children:b,slots:x,slotProps:C}=e,T=Tk(e),w=x?.actionBar??tk,M=Ge({elementType:w,externalSlotProps:C?.actionBar,additionalProps:{onAccept:n,onClear:r,onCancel:o,onSetToday:s,actions:t==="desktop"?[]:["cancel","accept"]},className:T.actionBar,ownerState:U({},e,{wrapperVariant:t})}),E=a.jsx(w,U({},M)),j=x?.toolbar,F=Ge({elementType:j,externalSlotProps:C?.toolbar,additionalProps:{isLandscape:h,onChange:d,value:u,view:i,onViewChange:c,views:l,disabled:g,readOnly:y},className:T.toolbar,ownerState:U({},e,{wrapperVariant:t})}),O=kk(F)&&j?a.jsx(j,U({},F)):null,V=b,L=x?.tabs,v=i&&L?a.jsx(L,U({view:i,onViewChange:c,className:T.tabs},C?.tabs)):null,N=x?.shortcuts??wk,A=Ge({elementType:N,externalSlotProps:C?.shortcuts,additionalProps:{isValid:m,isLandscape:h,onChange:f},className:T.shortcuts,ownerState:{isValid:m,isLandscape:h,onChange:f,wrapperVariant:t}}),$=i&&N?a.jsx(N,U({},A)):null;return{toolbar:O,content:V,tabs:v,actionBar:E,shortcuts:$}},Mk=e=>{const{isLandscape:t,classes:n}=e;return Re({root:["root",t&&"landscape"],contentWrapper:["contentWrapper"]},em,n)},Dk=re("div",{name:"MuiPickersLayout",slot:"Root",overridesResolver:(e,t)=>t.root})({display:"grid",gridAutoColumns:"max-content auto max-content",gridAutoRows:"max-content auto max-content",[`& .${Hr.actionBar}`]:{gridColumn:"1 / 4",gridRow:3},variants:[{props:{isLandscape:!0},style:{[`& .${Hr.toolbar}`]:{gridColumn:1,gridRow:"2 / 3"},[`.${Hr.shortcuts}`]:{gridColumn:"2 / 4",gridRow:1}}},{props:{isLandscape:!0,isRtl:!0},style:{[`& .${Hr.toolbar}`]:{gridColumn:3}}},{props:{isLandscape:!1},style:{[`& .${Hr.toolbar}`]:{gridColumn:"2 / 4",gridRow:1},[`& .${Hr.shortcuts}`]:{gridColumn:1,gridRow:"2 / 3"}}},{props:{isLandscape:!1,isRtl:!0},style:{[`& .${Hr.shortcuts}`]:{gridColumn:3}}}]}),Pk=re("div",{name:"MuiPickersLayout",slot:"ContentWrapper",overridesResolver:(e,t)=>t.contentWrapper})({gridColumn:2,gridRow:2,display:"flex",flexDirection:"column"}),sm=D.forwardRef(function(t,n){const r=wt({props:t,name:"MuiPickersLayout"}),{toolbar:o,content:s,tabs:i,actionBar:l,shortcuts:c}=Ik(r),{sx:u,className:d,isLandscape:f,wrapperVariant:m}=r,h=Mk(r);return a.jsxs(Dk,{ref:n,sx:u,className:Te(h.root,d),ownerState:r,children:[f?c:o,f?o:c,a.jsx(Pk,{className:h.contentWrapper,children:m==="desktop"?a.jsxs(D.Fragment,{children:[s,i]}):a.jsxs(D.Fragment,{children:[i,s]})}),l]})}),Ek=D.createContext(null);function im(e){const{contextValue:t,localeText:n,children:r}=e;return a.jsx(Ek.Provider,{value:t,children:a.jsx(Xo,{localeText:n,children:r})})}const Ok=["props","getOpenDialogAriaText"],Rk=["ownerState"],jk=["ownerState"],$k=e=>{let{props:t,getOpenDialogAriaText:n}=e,r=Fe(e,Ok);const{slots:o,slotProps:s,className:i,sx:l,format:c,formatDensity:u,enableAccessibleFieldDOMStructure:d,selectedSections:f,onSelectedSectionsChange:m,timezone:h,name:g,label:y,inputRef:b,readOnly:x,disabled:C,autoFocus:T,localeText:w,reduceAnimations:M}=t,E=D.useRef(null),j=D.useRef(null),F=Un(),O=s?.toolbar?.hidden??!1,{open:V,actions:L,hasUIView:v,layoutProps:N,renderCurrentView:A,shouldRestoreFocus:$,fieldProps:R,contextValue:_,ownerState:z}=Jh(U({},r,{props:t,fieldRef:j,autoFocusView:!0,additionalViewProps:{},wrapperVariant:"desktop"})),W=o.inputAdornment??Nh,H=Ge({elementType:W,externalSlotProps:s?.inputAdornment,additionalProps:{position:"end"},ownerState:t}),G=Fe(H,Rk),se=o.openPickerButton??Nn,pe=Ge({elementType:se,externalSlotProps:s?.openPickerButton,additionalProps:{disabled:C||x,onClick:V?L.onClose:L.onOpen,"aria-label":n(R.value),edge:G.position},ownerState:t}),me=Fe(pe,jk),X=o.openPickerIcon,K=Ge({elementType:X,externalSlotProps:s?.openPickerIcon,ownerState:z}),le=o.field,oe=Ge({elementType:le,externalSlotProps:s?.field,additionalProps:U({},R,O&&{id:F},{readOnly:x,disabled:C,className:i,sx:l,format:c,formatDensity:u,enableAccessibleFieldDOMStructure:d,selectedSections:f,onSelectedSectionsChange:m,timezone:h,label:y,name:g,autoFocus:T&&!t.open,focused:V?!0:void 0},b?{inputRef:b}:{}),ownerState:t});v&&(oe.InputProps=U({},oe.InputProps,{ref:E},!t.disableOpenPicker&&{[`${G.position}Adornment`]:a.jsx(W,U({},G,{children:a.jsx(se,U({},me,{children:a.jsx(X,U({},K))}))}))}));const te=U({textField:o.textField,clearIcon:o.clearIcon,clearButton:o.clearButton},oe.slots),Z=o.layout??sm;let J=F;O&&(y?J=`${F}-label`:J=void 0);const ae=U({},s,{toolbar:U({},s?.toolbar,{titleId:F}),popper:U({"aria-labelledby":J},s?.popper)}),Q=Ze(j,oe.unstableFieldRef);return{renderPicker:()=>a.jsxs(im,{contextValue:_,localeText:w,children:[a.jsx(le,U({},oe,{slots:te,slotProps:ae,unstableFieldRef:Q})),a.jsx(R1,U({role:"dialog",placement:"bottom-start",anchorEl:E.current},L,{open:V,slots:o,slotProps:ae,shouldRestoreFocus:$,reduceAnimations:M,children:a.jsx(Z,U({},N,ae?.layout,{slots:o,slotProps:ae,children:A()}))}))]})}},Ak=Xe(a.jsx("path",{d:"M7 10l5 5 5-5z"})),Fk=Xe(a.jsx("path",{d:"M15.41 16.59L10.83 12l4.58-4.59L14 6l-6 6 6 6 1.41-1.41z"})),Nk=Xe(a.jsx("path",{d:"M8.59 16.59L13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.41z"})),Lk=Xe(a.jsx("path",{d:"M17 12h-5v5h5v-5zM16 1v2H8V1H6v2H5c-1.11 0-1.99.9-1.99 2L3 19c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2h-1V1h-2zm3 18H5V8h14v11z"}));Xe(a.jsxs(D.Fragment,{children:[a.jsx("path",{d:"M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"}),a.jsx("path",{d:"M12.5 7H11v6l5.25 3.15.75-1.23-4.5-2.67z"})]}));Xe(a.jsx("path",{d:"M9 11H7v2h2v-2zm4 0h-2v2h2v-2zm4 0h-2v2h2v-2zm2-7h-1V2h-2v2H8V2H6v2H5c-1.11 0-1.99.9-1.99 2L3 20c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm0 16H5V9h14v11z"}));Xe(a.jsxs(D.Fragment,{children:[a.jsx("path",{d:"M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"}),a.jsx("path",{d:"M12.5 7H11v6l5.25 3.15.75-1.23-4.5-2.67z"})]}));const Bk=Xe(a.jsx("path",{d:"M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"}));function _i(e){return parseInt(e,10)||0}const Vk={shadow:{visibility:"hidden",position:"absolute",overflow:"hidden",height:0,top:0,left:0,transform:"translateZ(0)"}};function zk(e){for(const t in e)return!1;return!0}function Ep(e){return zk(e)||e.outerHeightStyle===0&&!e.overflowing}const _k=D.forwardRef(function(t,n){const{onChange:r,maxRows:o,minRows:s=1,style:i,value:l,...c}=t,{current:u}=D.useRef(l!=null),d=D.useRef(null),f=Ze(n,d),m=D.useRef(null),h=D.useRef(null),g=D.useCallback(()=>{const T=d.current,w=h.current;if(!T||!w)return;const E=xr(T).getComputedStyle(T);if(E.width==="0px")return{outerHeightStyle:0,overflowing:!1};w.style.width=E.width,w.value=T.value||t.placeholder||"x",w.value.slice(-1)===`
128
+ `&&(w.value+=" ");const j=E.boxSizing,F=_i(E.paddingBottom)+_i(E.paddingTop),O=_i(E.borderBottomWidth)+_i(E.borderTopWidth),V=w.scrollHeight;w.value="x";const L=w.scrollHeight;let v=V;s&&(v=Math.max(Number(s)*L,v)),o&&(v=Math.min(Number(o)*L,v)),v=Math.max(v,L);const N=v+(j==="border-box"?F+O:0),A=Math.abs(v-V)<=1;return{outerHeightStyle:N,overflowing:A}},[o,s,t.placeholder]),y=Me(()=>{const T=d.current,w=g();if(!T||!w||Ep(w))return!1;const M=w.outerHeightStyle;return m.current!=null&&m.current!==M}),b=D.useCallback(()=>{const T=d.current,w=g();if(!T||!w||Ep(w))return;const M=w.outerHeightStyle;m.current!==M&&(m.current=M,T.style.height=`${M}px`),T.style.overflow=w.overflowing?"hidden":""},[g]),x=D.useRef(-1);Wt(()=>{const T=hh(b),w=d?.current;if(!w)return;const M=xr(w);M.addEventListener("resize",T);let E;return typeof ResizeObserver<"u"&&(E=new ResizeObserver(()=>{y()&&(E.unobserve(w),cancelAnimationFrame(x.current),b(),x.current=requestAnimationFrame(()=>{E.observe(w)}))}),E.observe(w)),()=>{T.clear(),cancelAnimationFrame(x.current),M.removeEventListener("resize",T),E&&E.disconnect()}},[g,b,y]),Wt(()=>{b()});const C=T=>{u||b();const w=T.target,M=w.value.length,E=w.value.endsWith(`
129
+ `),j=w.selectionStart===M;E&&j&&w.setSelectionRange(M,M),r&&r(T)};return a.jsxs(D.Fragment,{children:[a.jsx("textarea",{value:l,onChange:C,ref:f,rows:s,style:i,...c}),a.jsx("textarea",{"aria-hidden":!0,className:t.className,readOnly:!0,ref:h,tabIndex:-1,style:{...Vk.shadow,...i,paddingTop:0,paddingBottom:0}})]})});function fo({props:e,states:t,muiFormControl:n}){return t.reduce((r,o)=>(r[o]=e[o],n&&typeof e[o]>"u"&&(r[o]=n[o]),r),{})}function Op(e){return e!=null&&!(Array.isArray(e)&&e.length===0)}function wa(e,t=!1){return e&&(Op(e.value)&&e.value!==""||t&&Op(e.defaultValue)&&e.defaultValue!=="")}function Wk(e){return e.startAdornment}function Hk(e){return $e("MuiInputBase",e)}const pn=Ee("MuiInputBase",["root","formControl","focused","disabled","adornedStart","adornedEnd","error","sizeSmall","multiline","colorSecondary","fullWidth","hiddenLabel","readOnly","input","inputSizeSmall","inputMultiline","inputTypeSearch","inputAdornedStart","inputAdornedEnd","inputHiddenLabel"]);var Rp;const Ga=(e,t)=>{const{ownerState:n}=e;return[t.root,n.formControl&&t.formControl,n.startAdornment&&t.adornedStart,n.endAdornment&&t.adornedEnd,n.error&&t.error,n.size==="small"&&t.sizeSmall,n.multiline&&t.multiline,n.color&&t[`color${ve(n.color)}`],n.fullWidth&&t.fullWidth,n.hiddenLabel&&t.hiddenLabel]},Za=(e,t)=>{const{ownerState:n}=e;return[t.input,n.size==="small"&&t.inputSizeSmall,n.multiline&&t.inputMultiline,n.type==="search"&&t.inputTypeSearch,n.startAdornment&&t.inputAdornedStart,n.endAdornment&&t.inputAdornedEnd,n.hiddenLabel&&t.inputHiddenLabel]},Uk=e=>{const{classes:t,color:n,disabled:r,error:o,endAdornment:s,focused:i,formControl:l,fullWidth:c,hiddenLabel:u,multiline:d,readOnly:f,size:m,startAdornment:h,type:g}=e,y={root:["root",`color${ve(n)}`,r&&"disabled",o&&"error",c&&"fullWidth",i&&"focused",l&&"formControl",m&&m!=="medium"&&`size${ve(m)}`,d&&"multiline",h&&"adornedStart",s&&"adornedEnd",u&&"hiddenLabel",f&&"readOnly"],input:["input",r&&"disabled",g==="search"&&"inputTypeSearch",d&&"inputMultiline",m==="small"&&"inputSizeSmall",u&&"inputHiddenLabel",h&&"inputAdornedStart",s&&"inputAdornedEnd",f&&"readOnly"]};return Re(y,Hk,t)},Xa=re("div",{name:"MuiInputBase",slot:"Root",overridesResolver:Ga})(He(({theme:e})=>({...e.typography.body1,color:(e.vars||e).palette.text.primary,lineHeight:"1.4375em",boxSizing:"border-box",position:"relative",cursor:"text",display:"inline-flex",alignItems:"center",[`&.${pn.disabled}`]:{color:(e.vars||e).palette.text.disabled,cursor:"default"},variants:[{props:({ownerState:t})=>t.multiline,style:{padding:"4px 0 5px"}},{props:({ownerState:t,size:n})=>t.multiline&&n==="small",style:{paddingTop:1}},{props:({ownerState:t})=>t.fullWidth,style:{width:"100%"}}]}))),Qa=re("input",{name:"MuiInputBase",slot:"Input",overridesResolver:Za})(He(({theme:e})=>{const t=e.palette.mode==="light",n={color:"currentColor",...e.vars?{opacity:e.vars.opacity.inputPlaceholder}:{opacity:t?.42:.5},transition:e.transitions.create("opacity",{duration:e.transitions.duration.shorter})},r={opacity:"0 !important"},o=e.vars?{opacity:e.vars.opacity.inputPlaceholder}:{opacity:t?.42:.5};return{font:"inherit",letterSpacing:"inherit",color:"currentColor",padding:"4px 0 5px",border:0,boxSizing:"content-box",background:"none",height:"1.4375em",margin:0,WebkitTapHighlightColor:"transparent",display:"block",minWidth:0,width:"100%","&::-webkit-input-placeholder":n,"&::-moz-placeholder":n,"&::-ms-input-placeholder":n,"&:focus":{outline:0},"&:invalid":{boxShadow:"none"},"&::-webkit-search-decoration":{WebkitAppearance:"none"},[`label[data-shrink=false] + .${pn.formControl} &`]:{"&::-webkit-input-placeholder":r,"&::-moz-placeholder":r,"&::-ms-input-placeholder":r,"&:focus::-webkit-input-placeholder":o,"&:focus::-moz-placeholder":o,"&:focus::-ms-input-placeholder":o},[`&.${pn.disabled}`]:{opacity:1,WebkitTextFillColor:(e.vars||e).palette.text.disabled},variants:[{props:({ownerState:s})=>!s.disableInjectingGlobalStyles,style:{animationName:"mui-auto-fill-cancel",animationDuration:"10ms","&:-webkit-autofill":{animationDuration:"5000s",animationName:"mui-auto-fill"}}},{props:{size:"small"},style:{paddingTop:1}},{props:({ownerState:s})=>s.multiline,style:{height:"auto",resize:"none",padding:0,paddingTop:0}},{props:{type:"search"},style:{MozAppearance:"textfield"}}]}})),jp=D0({"@keyframes mui-auto-fill":{from:{display:"block"}},"@keyframes mui-auto-fill-cancel":{from:{display:"block"}}}),Qc=D.forwardRef(function(t,n){const r=We({props:t,name:"MuiInputBase"}),{"aria-describedby":o,autoComplete:s,autoFocus:i,className:l,color:c,components:u={},componentsProps:d={},defaultValue:f,disabled:m,disableInjectingGlobalStyles:h,endAdornment:g,error:y,fullWidth:b=!1,id:x,inputComponent:C="input",inputProps:T={},inputRef:w,margin:M,maxRows:E,minRows:j,multiline:F=!1,name:O,onBlur:V,onChange:L,onClick:v,onFocus:N,onKeyDown:A,onKeyUp:$,placeholder:R,readOnly:_,renderSuffix:z,rows:W,size:H,slotProps:G={},slots:se={},startAdornment:pe,type:me="text",value:X,...K}=r,le=T.value!=null?T.value:X,{current:oe}=D.useRef(le!=null),te=D.useRef(),Z=D.useCallback(Ie=>{},[]),J=Ze(te,w,T.ref,Z),[ae,Q]=D.useState(!1),ue=yn(),he=fo({props:r,muiFormControl:ue,states:["color","disabled","error","hiddenLabel","size","required","filled"]});he.focused=ue?ue.focused:ae,D.useEffect(()=>{!ue&&m&&ae&&(Q(!1),V&&V())},[ue,m,ae,V]);const de=ue&&ue.onFilled,Se=ue&&ue.onEmpty,ce=D.useCallback(Ie=>{wa(Ie)?de&&de():Se&&Se()},[de,Se]);Wt(()=>{oe&&ce({value:le})},[le,ce,oe]);const Pe=Ie=>{N&&N(Ie),T.onFocus&&T.onFocus(Ie),ue&&ue.onFocus?ue.onFocus(Ie):Q(!0)},Ce=Ie=>{V&&V(Ie),T.onBlur&&T.onBlur(Ie),ue&&ue.onBlur?ue.onBlur(Ie):Q(!1)},Ve=(Ie,...ft)=>{if(!oe){const it=Ie.target||te.current;if(it==null)throw new Error(yr(1));ce({value:it.value})}T.onChange&&T.onChange(Ie,...ft),L&&L(Ie,...ft)};D.useEffect(()=>{ce(te.current)},[]);const De=Ie=>{te.current&&Ie.currentTarget===Ie.target&&te.current.focus(),v&&v(Ie)};let pt=C,Ye=T;F&&pt==="input"&&(W?Ye={type:void 0,minRows:W,maxRows:W,...Ye}:Ye={type:void 0,maxRows:E,minRows:j,...Ye},pt=_k);const tt=Ie=>{ce(Ie.animationName==="mui-auto-fill-cancel"?te.current:{value:"x"})};D.useEffect(()=>{ue&&ue.setAdornedStart(!!pe)},[ue,pe]);const gt={...r,color:he.color||"primary",disabled:he.disabled,endAdornment:g,error:he.error,focused:he.focused,formControl:ue,fullWidth:b,hiddenLabel:he.hiddenLabel,multiline:F,size:he.size,startAdornment:pe,type:me},kt=Uk(gt),Pt=se.root||u.Root||Xa,Yt=G.root||d.root||{},lt=se.input||u.Input||Qa;return Ye={...Ye,...G.input??d.input},a.jsxs(D.Fragment,{children:[!h&&typeof jp=="function"&&(Rp||(Rp=a.jsx(jp,{}))),a.jsxs(Pt,{...Yt,ref:n,onClick:De,...K,...!Zo(Pt)&&{ownerState:{...gt,...Yt.ownerState}},className:Te(kt.root,Yt.className,l,_&&"MuiInputBase-readOnly"),children:[pe,a.jsx(Ua.Provider,{value:null,children:a.jsx(lt,{"aria-invalid":he.error,"aria-describedby":o,autoComplete:s,autoFocus:i,defaultValue:f,disabled:he.disabled,id:x,onAnimationStart:tt,name:O,placeholder:R,readOnly:_,required:he.required,rows:W,value:le,onKeyDown:A,onKeyUp:$,type:me,...Ye,...!Zo(lt)&&{as:pt,ownerState:{...gt,...Ye.ownerState}},ref:J,className:Te(kt.input,Ye.className,_&&"MuiInputBase-readOnly"),onBlur:Ce,onChange:Ve,onFocus:Pe})}),g,z?z({...he,startAdornment:pe}):null]})]})});function qk(e){return $e("MuiInput",e)}const Pr={...pn,...Ee("MuiInput",["root","underline","input"])},Yk=e=>{const{classes:t,disableUnderline:n}=e,o=Re({root:["root",!n&&"underline"],input:["input"]},qk,t);return{...t,...o}},Kk=re(Xa,{shouldForwardProp:e=>nn(e)||e==="classes",name:"MuiInput",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[...Ga(e,t),!n.disableUnderline&&t.underline]}})(He(({theme:e})=>{let n=e.palette.mode==="light"?"rgba(0, 0, 0, 0.42)":"rgba(255, 255, 255, 0.7)";return e.vars&&(n=e.alpha(e.vars.palette.common.onBackground,e.vars.opacity.inputUnderline)),{position:"relative",variants:[{props:({ownerState:r})=>r.formControl,style:{"label + &":{marginTop:16}}},{props:({ownerState:r})=>!r.disableUnderline,style:{"&::after":{left:0,bottom:0,content:'""',position:"absolute",right:0,transform:"scaleX(0)",transition:e.transitions.create("transform",{duration:e.transitions.duration.shorter,easing:e.transitions.easing.easeOut}),pointerEvents:"none"},[`&.${Pr.focused}:after`]:{transform:"scaleX(1) translateX(0)"},[`&.${Pr.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(.${Pr.disabled}, .${Pr.error}):before`]:{borderBottom:`2px solid ${(e.vars||e).palette.text.primary}`,"@media (hover: none)":{borderBottom:`1px solid ${n}`}},[`&.${Pr.disabled}:before`]:{borderBottomStyle:"dotted"}}},...Object.entries(e.palette).filter(tn()).map(([r])=>({props:{color:r,disableUnderline:!1},style:{"&::after":{borderBottom:`2px solid ${(e.vars||e).palette[r].main}`}}}))]}})),Gk=re(Qa,{name:"MuiInput",slot:"Input",overridesResolver:Za})({}),Jc=D.forwardRef(function(t,n){const r=We({props:t,name:"MuiInput"}),{disableUnderline:o=!1,components:s={},componentsProps:i,fullWidth:l=!1,inputComponent:c="input",multiline:u=!1,slotProps:d,slots:f={},type:m="text",...h}=r,g=Yk(r),b={root:{ownerState:{disableUnderline:o}}},x=d??i?Qt(d??i,b):b,C=f.root??s.Root??Kk,T=f.input??s.Input??Gk;return a.jsx(Qc,{slots:{root:C,input:T},slotProps:x,fullWidth:l,inputComponent:c,multiline:u,ref:n,type:m,...h,classes:g})});Jc.muiName="Input";function Zk(e){return $e("MuiFilledInput",e)}const fn={...pn,...Ee("MuiFilledInput",["root","underline","input","adornedStart","adornedEnd","sizeSmall","multiline","hiddenLabel"])},Xk=e=>{const{classes:t,disableUnderline:n,startAdornment:r,endAdornment:o,size:s,hiddenLabel:i,multiline:l}=e,c={root:["root",!n&&"underline",r&&"adornedStart",o&&"adornedEnd",s==="small"&&`size${ve(s)}`,i&&"hiddenLabel",l&&"multiline"],input:["input"]},u=Re(c,Zk,t);return{...t,...u}},Qk=re(Xa,{shouldForwardProp:e=>nn(e)||e==="classes",name:"MuiFilledInput",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[...Ga(e,t),!n.disableUnderline&&t.underline]}})(He(({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{position:"relative",backgroundColor:e.vars?e.vars.palette.FilledInput.bg:r,borderTopLeftRadius:(e.vars||e).shape.borderRadius,borderTopRightRadius:(e.vars||e).shape.borderRadius,transition:e.transitions.create("background-color",{duration:e.transitions.duration.shorter,easing:e.transitions.easing.easeOut}),"&:hover":{backgroundColor:e.vars?e.vars.palette.FilledInput.hoverBg:o,"@media (hover: none)":{backgroundColor:e.vars?e.vars.palette.FilledInput.bg:r}},[`&.${fn.focused}`]:{backgroundColor:e.vars?e.vars.palette.FilledInput.bg:r},[`&.${fn.disabled}`]:{backgroundColor:e.vars?e.vars.palette.FilledInput.disabledBg:s},variants:[{props:({ownerState:i})=>!i.disableUnderline,style:{"&::after":{left:0,bottom:0,content:'""',position:"absolute",right:0,transform:"scaleX(0)",transition:e.transitions.create("transform",{duration:e.transitions.duration.shorter,easing:e.transitions.easing.easeOut}),pointerEvents:"none"},[`&.${fn.focused}:after`]:{transform:"scaleX(1) translateX(0)"},[`&.${fn.error}`]:{"&::before, &::after":{borderBottomColor:(e.vars||e).palette.error.main}},"&::before":{borderBottom:`1px solid ${e.vars?e.alpha(e.vars.palette.common.onBackground,e.vars.opacity.inputUnderline):n}`,left:0,bottom:0,content:'"\\00a0"',position:"absolute",right:0,transition:e.transitions.create("border-bottom-color",{duration:e.transitions.duration.shorter}),pointerEvents:"none"},[`&:hover:not(.${fn.disabled}, .${fn.error}):before`]:{borderBottom:`1px solid ${(e.vars||e).palette.text.primary}`},[`&.${fn.disabled}:before`]:{borderBottomStyle:"dotted"}}},...Object.entries(e.palette).filter(tn()).map(([i])=>({props:{disableUnderline:!1,color:i},style:{"&::after":{borderBottom:`2px solid ${(e.vars||e).palette[i]?.main}`}}})),{props:({ownerState:i})=>i.startAdornment,style:{paddingLeft:12}},{props:({ownerState:i})=>i.endAdornment,style:{paddingRight:12}},{props:({ownerState:i})=>i.multiline,style:{padding:"25px 12px 8px"}},{props:({ownerState:i,size:l})=>i.multiline&&l==="small",style:{paddingTop:21,paddingBottom:4}},{props:({ownerState:i})=>i.multiline&&i.hiddenLabel,style:{paddingTop:16,paddingBottom:17}},{props:({ownerState:i})=>i.multiline&&i.hiddenLabel&&i.size==="small",style:{paddingTop:8,paddingBottom:9}}]}})),Jk=re(Qa,{name:"MuiFilledInput",slot:"Input",overridesResolver:Za})(He(({theme:e})=>({paddingTop:25,paddingRight:12,paddingBottom:8,paddingLeft:12,...!e.vars&&{"&:-webkit-autofill":{WebkitBoxShadow:e.palette.mode==="light"?null:"0 0 0 100px #266798 inset",WebkitTextFillColor:e.palette.mode==="light"?null:"#fff",caretColor:e.palette.mode==="light"?null:"#fff",borderTopLeftRadius:"inherit",borderTopRightRadius:"inherit"}},...e.vars&&{"&:-webkit-autofill":{borderTopLeftRadius:"inherit",borderTopRightRadius:"inherit"},[e.getColorSchemeSelector("dark")]:{"&:-webkit-autofill":{WebkitBoxShadow:"0 0 0 100px #266798 inset",WebkitTextFillColor:"#fff",caretColor:"#fff"}}},variants:[{props:{size:"small"},style:{paddingTop:21,paddingBottom:4}},{props:({ownerState:t})=>t.hiddenLabel,style:{paddingTop:16,paddingBottom:17}},{props:({ownerState:t})=>t.startAdornment,style:{paddingLeft:0}},{props:({ownerState:t})=>t.endAdornment,style:{paddingRight:0}},{props:({ownerState:t})=>t.hiddenLabel&&t.size==="small",style:{paddingTop:8,paddingBottom:9}},{props:({ownerState:t})=>t.multiline,style:{paddingTop:0,paddingBottom:0,paddingLeft:0,paddingRight:0}}]}))),eu=D.forwardRef(function(t,n){const r=We({props:t,name:"MuiFilledInput"}),{disableUnderline:o=!1,components:s={},componentsProps:i,fullWidth:l=!1,hiddenLabel:c,inputComponent:u="input",multiline:d=!1,slotProps:f,slots:m={},type:h="text",...g}=r,y={...r,disableUnderline:o,fullWidth:l,inputComponent:u,multiline:d,type:h},b=Xk(r),x={root:{ownerState:y},input:{ownerState:y}},C=f??i?Qt(x,f??i):x,T=m.root??s.Root??Qk,w=m.input??s.Input??Jk;return a.jsx(Qc,{slots:{root:T,input:w},slotProps:C,fullWidth:l,inputComponent:u,multiline:d,ref:n,type:h,...g,classes:b})});eu.muiName="Input";var $p;const eT=re("fieldset",{name:"MuiNotchedOutlined",shouldForwardProp:nn})({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%"}),tT=re("legend",{name:"MuiNotchedOutlined",shouldForwardProp:nn})(He(({theme:e})=>({float:"unset",width:"auto",overflow:"hidden",variants:[{props:({ownerState:t})=>!t.withLabel,style:{padding:0,lineHeight:"11px",transition:e.transitions.create("width",{duration:150,easing:e.transitions.easing.easeOut})}},{props:({ownerState:t})=>t.withLabel,style:{display:"block",padding:0,height:11,fontSize:"0.75em",visibility:"hidden",maxWidth:.01,transition:e.transitions.create("max-width",{duration:50,easing:e.transitions.easing.easeOut}),whiteSpace:"nowrap","& > span":{paddingLeft:5,paddingRight:5,display:"inline-block",opacity:0,visibility:"visible"}}},{props:({ownerState:t})=>t.withLabel&&t.notched,style:{maxWidth:"100%",transition:e.transitions.create("max-width",{duration:100,easing:e.transitions.easing.easeOut,delay:50})}}]})));function nT(e){const{children:t,classes:n,className:r,label:o,notched:s,...i}=e,l=o!=null&&o!=="",c={...e,notched:s,withLabel:l};return a.jsx(eT,{"aria-hidden":!0,className:r,ownerState:c,...i,children:a.jsx(tT,{ownerState:c,children:l?a.jsx("span",{children:o}):$p||($p=a.jsx("span",{className:"notranslate","aria-hidden":!0,children:"​"}))})})}function rT(e){return $e("MuiOutlinedInput",e)}const wn={...pn,...Ee("MuiOutlinedInput",["root","notchedOutline","input"])},oT=e=>{const{classes:t}=e,r=Re({root:["root"],notchedOutline:["notchedOutline"],input:["input"]},rT,t);return{...t,...r}},sT=re(Xa,{shouldForwardProp:e=>nn(e)||e==="classes",name:"MuiOutlinedInput",slot:"Root",overridesResolver:Ga})(He(({theme:e})=>{const t=e.palette.mode==="light"?"rgba(0, 0, 0, 0.23)":"rgba(255, 255, 255, 0.23)";return{position:"relative",borderRadius:(e.vars||e).shape.borderRadius,[`&:hover .${wn.notchedOutline}`]:{borderColor:(e.vars||e).palette.text.primary},"@media (hover: none)":{[`&:hover .${wn.notchedOutline}`]:{borderColor:e.vars?e.alpha(e.vars.palette.common.onBackground,.23):t}},[`&.${wn.focused} .${wn.notchedOutline}`]:{borderWidth:2},variants:[...Object.entries(e.palette).filter(tn()).map(([n])=>({props:{color:n},style:{[`&.${wn.focused} .${wn.notchedOutline}`]:{borderColor:(e.vars||e).palette[n].main}}})),{props:{},style:{[`&.${wn.error} .${wn.notchedOutline}`]:{borderColor:(e.vars||e).palette.error.main},[`&.${wn.disabled} .${wn.notchedOutline}`]:{borderColor:(e.vars||e).palette.action.disabled}}},{props:({ownerState:n})=>n.startAdornment,style:{paddingLeft:14}},{props:({ownerState:n})=>n.endAdornment,style:{paddingRight:14}},{props:({ownerState:n})=>n.multiline,style:{padding:"16.5px 14px"}},{props:({ownerState:n,size:r})=>n.multiline&&r==="small",style:{padding:"8.5px 14px"}}]}})),iT=re(nT,{name:"MuiOutlinedInput",slot:"NotchedOutline"})(He(({theme:e})=>{const t=e.palette.mode==="light"?"rgba(0, 0, 0, 0.23)":"rgba(255, 255, 255, 0.23)";return{borderColor:e.vars?e.alpha(e.vars.palette.common.onBackground,.23):t}})),aT=re(Qa,{name:"MuiOutlinedInput",slot:"Input",overridesResolver:Za})(He(({theme:e})=>({padding:"16.5px 14px",...!e.vars&&{"&:-webkit-autofill":{WebkitBoxShadow:e.palette.mode==="light"?null:"0 0 0 100px #266798 inset",WebkitTextFillColor:e.palette.mode==="light"?null:"#fff",caretColor:e.palette.mode==="light"?null:"#fff",borderRadius:"inherit"}},...e.vars&&{"&:-webkit-autofill":{borderRadius:"inherit"},[e.getColorSchemeSelector("dark")]:{"&:-webkit-autofill":{WebkitBoxShadow:"0 0 0 100px #266798 inset",WebkitTextFillColor:"#fff",caretColor:"#fff"}}},variants:[{props:{size:"small"},style:{padding:"8.5px 14px"}},{props:({ownerState:t})=>t.multiline,style:{padding:0}},{props:({ownerState:t})=>t.startAdornment,style:{paddingLeft:0}},{props:({ownerState:t})=>t.endAdornment,style:{paddingRight:0}}]}))),tu=D.forwardRef(function(t,n){const r=We({props:t,name:"MuiOutlinedInput"}),{components:o={},fullWidth:s=!1,inputComponent:i="input",label:l,multiline:c=!1,notched:u,slots:d={},slotProps:f={},type:m="text",...h}=r,g=oT(r),y=yn(),b=fo({props:r,muiFormControl:y,states:["color","disabled","error","focused","hiddenLabel","size","required"]}),x={...r,color:b.color||"primary",disabled:b.disabled,error:b.error,focused:b.focused,formControl:y,fullWidth:s,hiddenLabel:b.hiddenLabel,multiline:c,size:b.size,type:m},C=d.root??o.Root??sT,T=d.input??o.Input??aT,[w,M]=et("notchedOutline",{elementType:iT,className:g.notchedOutline,shouldForwardComponentProp:!0,ownerState:x,externalForwardedProps:{slots:d,slotProps:f},additionalProps:{label:l!=null&&l!==""&&b.required?a.jsxs(D.Fragment,{children:[l," ","*"]}):l}});return a.jsx(Qc,{slots:{root:C,input:T},slotProps:f,renderSuffix:E=>a.jsx(w,{...M,notched:typeof u<"u"?u:!!(E.startAdornment||E.filled||E.focused)}),fullWidth:s,inputComponent:i,multiline:c,ref:n,type:m,...h,classes:{...g,notchedOutline:null}})});tu.muiName="Input";function lT(e){return $e("MuiFormLabel",e)}const ei=Ee("MuiFormLabel",["root","colorSecondary","focused","disabled","error","filled","required","asterisk"]),cT=e=>{const{classes:t,color:n,focused:r,disabled:o,error:s,filled:i,required:l}=e,c={root:["root",`color${ve(n)}`,o&&"disabled",s&&"error",i&&"filled",r&&"focused",l&&"required"],asterisk:["asterisk",s&&"error"]};return Re(c,lT,t)},uT=re("label",{name:"MuiFormLabel",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.color==="secondary"&&t.colorSecondary,n.filled&&t.filled]}})(He(({theme:e})=>({color:(e.vars||e).palette.text.secondary,...e.typography.body1,lineHeight:"1.4375em",padding:0,position:"relative",variants:[...Object.entries(e.palette).filter(tn()).map(([t])=>({props:{color:t},style:{[`&.${ei.focused}`]:{color:(e.vars||e).palette[t].main}}})),{props:{},style:{[`&.${ei.disabled}`]:{color:(e.vars||e).palette.text.disabled},[`&.${ei.error}`]:{color:(e.vars||e).palette.error.main}}}]}))),dT=re("span",{name:"MuiFormLabel",slot:"Asterisk"})(He(({theme:e})=>({[`&.${ei.error}`]:{color:(e.vars||e).palette.error.main}}))),pT=D.forwardRef(function(t,n){const r=We({props:t,name:"MuiFormLabel"}),{children:o,className:s,color:i,component:l="label",disabled:c,error:u,filled:d,focused:f,required:m,...h}=r,g=yn(),y=fo({props:r,muiFormControl:g,states:["color","required","focused","disabled","error","filled"]}),b={...r,color:y.color||"primary",component:l,disabled:y.disabled,error:y.error,filled:y.filled,focused:y.focused,required:y.required},x=cT(b);return a.jsxs(uT,{as:l,ownerState:b,className:Te(x.root,s),ref:n,...h,children:[o,y.required&&a.jsxs(dT,{ownerState:b,"aria-hidden":!0,className:x.asterisk,children:[" ","*"]})]})});function fT(e){return $e("MuiInputLabel",e)}Ee("MuiInputLabel",["root","focused","disabled","error","required","asterisk","formControl","sizeSmall","shrink","animated","standard","filled","outlined"]);const hT=e=>{const{classes:t,formControl:n,size:r,shrink:o,disableAnimation:s,variant:i,required:l}=e,c={root:["root",n&&"formControl",!s&&"animated",o&&"shrink",r&&r!=="medium"&&`size${ve(r)}`,i],asterisk:[l&&"asterisk"]},u=Re(c,fT,t);return{...t,...u}},mT=re(pT,{shouldForwardProp:e=>nn(e)||e==="classes",name:"MuiInputLabel",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[{[`& .${ei.asterisk}`]:t.asterisk},t.root,n.formControl&&t.formControl,n.size==="small"&&t.sizeSmall,n.shrink&&t.shrink,!n.disableAnimation&&t.animated,n.focused&&t.focused,t[n.variant]]}})(He(({theme:e})=>({display:"block",transformOrigin:"top left",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",maxWidth:"100%",variants:[{props:({ownerState:t})=>t.formControl,style:{position:"absolute",left:0,top:0,transform:"translate(0, 20px) scale(1)"}},{props:{size:"small"},style:{transform:"translate(0, 17px) scale(1)"}},{props:({ownerState:t})=>t.shrink,style:{transform:"translate(0, -1.5px) scale(0.75)",transformOrigin:"top left",maxWidth:"133%"}},{props:({ownerState:t})=>!t.disableAnimation,style:{transition:e.transitions.create(["color","transform","max-width"],{duration:e.transitions.duration.shorter,easing:e.transitions.easing.easeOut})}},{props:{variant:"filled"},style:{zIndex:1,pointerEvents:"none",transform:"translate(12px, 16px) scale(1)",maxWidth:"calc(100% - 24px)"}},{props:{variant:"filled",size:"small"},style:{transform:"translate(12px, 13px) scale(1)"}},{props:({variant:t,ownerState:n})=>t==="filled"&&n.shrink,style:{userSelect:"none",pointerEvents:"auto",transform:"translate(12px, 7px) scale(0.75)",maxWidth:"calc(133% - 24px)"}},{props:({variant:t,ownerState:n,size:r})=>t==="filled"&&n.shrink&&r==="small",style:{transform:"translate(12px, 4px) scale(0.75)"}},{props:{variant:"outlined"},style:{zIndex:1,pointerEvents:"none",transform:"translate(14px, 16px) scale(1)",maxWidth:"calc(100% - 24px)"}},{props:{variant:"outlined",size:"small"},style:{transform:"translate(14px, 9px) scale(1)"}},{props:({variant:t,ownerState:n})=>t==="outlined"&&n.shrink,style:{userSelect:"none",pointerEvents:"auto",maxWidth:"calc(133% - 32px)",transform:"translate(14px, -9px) scale(0.75)"}}]}))),ka=D.forwardRef(function(t,n){const r=We({name:"MuiInputLabel",props:t}),{disableAnimation:o=!1,margin:s,shrink:i,variant:l,className:c,...u}=r,d=yn();let f=i;typeof f>"u"&&d&&(f=d.filled||d.focused||d.adornedStart);const m=fo({props:r,muiFormControl:d,states:["size","variant","required","focused"]}),h={...r,disableAnimation:o,formControl:d,shrink:f,size:m.size,variant:m.variant,required:m.required,focused:m.focused},g=hT(h);return a.jsx(mT,{"data-shrink":f,ref:n,className:Te(g.root,c),...u,ownerState:h,classes:g})});function gT(e){return $e("MuiFormControl",e)}Ee("MuiFormControl",["root","marginNone","marginNormal","marginDense","fullWidth","disabled"]);const yT=e=>{const{classes:t,margin:n,fullWidth:r}=e,o={root:["root",n!=="none"&&`margin${ve(n)}`,r&&"fullWidth"]};return Re(o,gT,t)},bT=re("div",{name:"MuiFormControl",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,t[`margin${ve(n.margin)}`],n.fullWidth&&t.fullWidth]}})({display:"inline-flex",flexDirection:"column",position:"relative",minWidth:0,padding:0,margin:0,border:0,verticalAlign:"top",variants:[{props:{margin:"normal"},style:{marginTop:16,marginBottom:8}},{props:{margin:"dense"},style:{marginTop:8,marginBottom:4}},{props:{fullWidth:!0},style:{width:"100%"}}]}),Ta=D.forwardRef(function(t,n){const r=We({props:t,name:"MuiFormControl"}),{children:o,className:s,color:i="primary",component:l="div",disabled:c=!1,error:u=!1,focused:d,fullWidth:f=!1,hiddenLabel:m=!1,margin:h="none",required:g=!1,size:y="medium",variant:b="outlined",...x}=r,C={...r,color:i,component:l,disabled:c,error:u,fullWidth:f,hiddenLabel:m,margin:h,required:g,size:y,variant:b},T=yT(C),[w,M]=D.useState(()=>{let $=!1;return o&&D.Children.forEach(o,R=>{if(!ta(R,["Input","Select"]))return;const _=ta(R,["Select"])?R.props.input:R;_&&Wk(_.props)&&($=!0)}),$}),[E,j]=D.useState(()=>{let $=!1;return o&&D.Children.forEach(o,R=>{ta(R,["Input","Select"])&&(wa(R.props,!0)||wa(R.props.inputProps,!0))&&($=!0)}),$}),[F,O]=D.useState(!1);c&&F&&O(!1);const V=d!==void 0&&!c?d:F;let L;D.useRef(!1);const v=D.useCallback(()=>{j(!0)},[]),N=D.useCallback(()=>{j(!1)},[]),A=D.useMemo(()=>({adornedStart:w,setAdornedStart:M,color:i,disabled:c,error:u,filled:E,focused:V,fullWidth:f,hiddenLabel:m,size:y,onBlur:()=>{O(!1)},onFocus:()=>{O(!0)},onEmpty:N,onFilled:v,registerEffect:L,required:g,variant:b}),[w,i,c,u,E,V,f,m,L,N,v,g,y,b]);return a.jsx(Ua.Provider,{value:A,children:a.jsx(bT,{as:l,ownerState:C,className:Te(T.root,s),ref:n,...x,children:o})})});function xT(e){return $e("MuiFormHelperText",e)}const Ap=Ee("MuiFormHelperText",["root","error","disabled","sizeSmall","sizeMedium","contained","focused","filled","required"]);var Fp;const vT=e=>{const{classes:t,contained:n,size:r,disabled:o,error:s,filled:i,focused:l,required:c}=e,u={root:["root",o&&"disabled",s&&"error",r&&`size${ve(r)}`,n&&"contained",l&&"focused",i&&"filled",c&&"required"]};return Re(u,xT,t)},ST=re("p",{name:"MuiFormHelperText",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.size&&t[`size${ve(n.size)}`],n.contained&&t.contained,n.filled&&t.filled]}})(He(({theme:e})=>({color:(e.vars||e).palette.text.secondary,...e.typography.caption,textAlign:"left",marginTop:3,marginRight:0,marginBottom:0,marginLeft:0,[`&.${Ap.disabled}`]:{color:(e.vars||e).palette.text.disabled},[`&.${Ap.error}`]:{color:(e.vars||e).palette.error.main},variants:[{props:{size:"small"},style:{marginTop:4}},{props:({ownerState:t})=>t.contained,style:{marginLeft:14,marginRight:14}}]}))),am=D.forwardRef(function(t,n){const r=We({props:t,name:"MuiFormHelperText"}),{children:o,className:s,component:i="p",disabled:l,error:c,filled:u,focused:d,margin:f,required:m,variant:h,...g}=r,y=yn(),b=fo({props:r,muiFormControl:y,states:["variant","size","disabled","error","filled","focused","required"]}),x={...r,component:i,contained:b.variant==="filled"||b.variant==="outlined",variant:b.variant,size:b.size,disabled:b.disabled,error:b.error,filled:b.filled,focused:b.focused,required:b.required};delete x.ownerState;const C=vT(x);return a.jsx(ST,{as:i,className:Te(C.root,s),ref:n,...g,ownerState:x,children:o===" "?Fp||(Fp=a.jsx("span",{className:"notranslate","aria-hidden":!0,children:"​"})):o})});function kl(e,t,n){return e===t?e.firstChild:t&&t.nextElementSibling?t.nextElementSibling:n?null:e.firstChild}function Np(e,t,n){return e===t?n?e.firstChild:e.lastChild:t&&t.previousElementSibling?t.previousElementSibling:n?null:e.lastChild}function lm(e,t){if(t===void 0)return!0;let n=e.innerText;return n===void 0&&(n=e.textContent),n=n.trim().toLowerCase(),n.length===0?!1:t.repeating?n[0]===t.keys[0]:n.startsWith(t.keys.join(""))}function Ts(e,t,n,r,o,s){let i=!1,l=o(e,t,t?n:!1);for(;l;){if(l===e.firstChild){if(i)return!1;i=!0}const c=r?!1:l.disabled||l.getAttribute("aria-disabled")==="true";if(!l.hasAttribute("tabindex")||!lm(l,s)||c)l=o(e,l,n);else return l.focus(),!0}return!1}const CT=D.forwardRef(function(t,n){const{actions:r,autoFocus:o=!1,autoFocusItem:s=!1,children:i,className:l,disabledItemsFocusable:c=!1,disableListWrap:u=!1,onKeyDown:d,variant:f="selectedMenu",...m}=t,h=D.useRef(null),g=D.useRef({keys:[],repeating:!0,previousKeyMatched:!0,lastTime:null});Wt(()=>{o&&h.current.focus()},[o]),D.useImperativeHandle(r,()=>({adjustStyleForScrollbar:(T,{direction:w})=>{const M=!h.current.style.width;if(T.clientHeight<h.current.clientHeight&&M){const E=`${Ch(xr(T))}px`;h.current.style[w==="rtl"?"paddingLeft":"paddingRight"]=E,h.current.style.width=`calc(100% + ${E})`}return h.current}}),[]);const y=T=>{const w=h.current,M=T.key;if(T.ctrlKey||T.metaKey||T.altKey){d&&d(T);return}const j=zt(w).activeElement;if(M==="ArrowDown")T.preventDefault(),Ts(w,j,u,c,kl);else if(M==="ArrowUp")T.preventDefault(),Ts(w,j,u,c,Np);else if(M==="Home")T.preventDefault(),Ts(w,null,u,c,kl);else if(M==="End")T.preventDefault(),Ts(w,null,u,c,Np);else if(M.length===1){const F=g.current,O=M.toLowerCase(),V=performance.now();F.keys.length>0&&(V-F.lastTime>500?(F.keys=[],F.repeating=!0,F.previousKeyMatched=!0):F.repeating&&O!==F.keys[0]&&(F.repeating=!1)),F.lastTime=V,F.keys.push(O);const L=j&&!F.repeating&&lm(j,F);F.previousKeyMatched&&(L||Ts(w,j,!1,c,kl,F))?T.preventDefault():F.previousKeyMatched=!1}d&&d(T)},b=Ze(h,n);let x=-1;D.Children.forEach(i,(T,w)=>{if(!D.isValidElement(T)){x===w&&(x+=1,x>=i.length&&(x=-1));return}T.props.disabled||(f==="selectedMenu"&&T.props.selected||x===-1)&&(x=w),x===w&&(T.props.disabled||T.props.muiSkipListHighlight||T.type.muiSkipListHighlight)&&(x+=1,x>=i.length&&(x=-1))});const C=D.Children.map(i,(T,w)=>{if(w===x){const M={};return s&&(M.autoFocus=!0),T.props.tabIndex===void 0&&f==="selectedMenu"&&(M.tabIndex=0),D.cloneElement(T,M)}return T});return a.jsx(nm,{role:"menu",ref:b,className:l,onKeyDown:y,tabIndex:o?0:-1,...m,children:C})});function wT(e){const t=zt(e);return t.body===e?xr(e).innerWidth>t.documentElement.clientWidth:e.scrollHeight>e.clientHeight}function ti(e,t){t?e.setAttribute("aria-hidden","true"):e.removeAttribute("aria-hidden")}function Lp(e){return parseInt(xr(e).getComputedStyle(e).paddingRight,10)||0}function kT(e){const n=["TEMPLATE","SCRIPT","STYLE","LINK","MAP","META","NOSCRIPT","PICTURE","COL","COLGROUP","PARAM","SLOT","SOURCE","TRACK"].includes(e.tagName),r=e.tagName==="INPUT"&&e.getAttribute("type")==="hidden";return n||r}function Bp(e,t,n,r,o){const s=[t,n,...r];[].forEach.call(e.children,i=>{const l=!s.includes(i),c=!kT(i);l&&c&&ti(i,o)})}function Tl(e,t){let n=-1;return e.some((r,o)=>t(r)?(n=o,!0):!1),n}function TT(e,t){const n=[],r=e.container;if(!t.disableScrollLock){if(wT(r)){const i=Ch(xr(r));n.push({value:r.style.paddingRight,property:"padding-right",el:r}),r.style.paddingRight=`${Lp(r)+i}px`;const l=zt(r).querySelectorAll(".mui-fixed");[].forEach.call(l,c=>{n.push({value:c.style.paddingRight,property:"padding-right",el:c}),c.style.paddingRight=`${Lp(c)+i}px`})}let s;if(r.parentNode instanceof DocumentFragment)s=zt(r).body;else{const i=r.parentElement,l=xr(r);s=i?.nodeName==="HTML"&&l.getComputedStyle(i).overflowY==="scroll"?i:r}n.push({value:s.style.overflow,property:"overflow",el:s},{value:s.style.overflowX,property:"overflow-x",el:s},{value:s.style.overflowY,property:"overflow-y",el:s}),s.style.overflow="hidden"}return()=>{n.forEach(({value:s,el:i,property:l})=>{s?i.style.setProperty(l,s):i.style.removeProperty(l)})}}function IT(e){const t=[];return[].forEach.call(e.children,n=>{n.getAttribute("aria-hidden")==="true"&&t.push(n)}),t}class MT{constructor(){this.modals=[],this.containers=[]}add(t,n){let r=this.modals.indexOf(t);if(r!==-1)return r;r=this.modals.length,this.modals.push(t),t.modalRef&&ti(t.modalRef,!1);const o=IT(n);Bp(n,t.mount,t.modalRef,o,!0);const s=Tl(this.containers,i=>i.container===n);return s!==-1?(this.containers[s].modals.push(t),r):(this.containers.push({modals:[t],container:n,restore:null,hiddenSiblings:o}),r)}mount(t,n){const r=Tl(this.containers,s=>s.modals.includes(t)),o=this.containers[r];o.restore||(o.restore=TT(o,n))}remove(t,n=!0){const r=this.modals.indexOf(t);if(r===-1)return r;const o=Tl(this.containers,i=>i.modals.includes(t)),s=this.containers[o];if(s.modals.splice(s.modals.indexOf(t),1),this.modals.splice(r,1),s.modals.length===0)s.restore&&s.restore(),t.modalRef&&ti(t.modalRef,n),Bp(s.container,t.mount,t.modalRef,s.hiddenSiblings,!1),this.containers.splice(o,1);else{const i=s.modals[s.modals.length-1];i.modalRef&&ti(i.modalRef,!1)}return r}isTopModal(t){return this.modals.length>0&&this.modals[this.modals.length-1]===t}}function DT(e){return $e("MuiBackdrop",e)}Ee("MuiBackdrop",["root","invisible"]);const PT=e=>{const{classes:t,invisible:n}=e;return Re({root:["root",n&&"invisible"]},DT,t)},ET=re("div",{name:"MuiBackdrop",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.invisible&&t.invisible]}})({position:"fixed",display:"flex",alignItems:"center",justifyContent:"center",right:0,bottom:0,top:0,left:0,backgroundColor:"rgba(0, 0, 0, 0.5)",WebkitTapHighlightColor:"transparent",variants:[{props:{invisible:!0},style:{backgroundColor:"transparent"}}]}),cm=D.forwardRef(function(t,n){const r=We({props:t,name:"MuiBackdrop"}),{children:o,className:s,component:i="div",invisible:l=!1,open:c,components:u={},componentsProps:d={},slotProps:f={},slots:m={},TransitionComponent:h,transitionDuration:g,...y}=r,b={...r,component:i,invisible:l},x=PT(b),C={transition:h,root:u.Root,...m},T={...d,...f},w={component:i,slots:C,slotProps:T},[M,E]=et("root",{elementType:ET,externalForwardedProps:w,className:Te(x.root,s),ownerState:b}),[j,F]=et("transition",{elementType:ao,externalForwardedProps:w,ownerState:b});return a.jsx(j,{in:c,timeout:g,...y,...F,children:a.jsx(M,{"aria-hidden":!0,...E,classes:x,ref:n,children:o})})});function OT(e){return typeof e=="function"?e():e}function RT(e){return e?e.props.hasOwnProperty("in"):!1}const Vp=()=>{},Wi=new MT;function jT(e){const{container:t,disableEscapeKeyDown:n=!1,disableScrollLock:r=!1,closeAfterTransition:o=!1,onTransitionEnter:s,onTransitionExited:i,children:l,onClose:c,open:u,rootRef:d}=e,f=D.useRef({}),m=D.useRef(null),h=D.useRef(null),g=Ze(h,d),[y,b]=D.useState(!u),x=RT(l);let C=!0;(e["aria-hidden"]==="false"||e["aria-hidden"]===!1)&&(C=!1);const T=()=>zt(m.current),w=()=>(f.current.modalRef=h.current,f.current.mount=m.current,f.current),M=()=>{Wi.mount(w(),{disableScrollLock:r}),h.current&&(h.current.scrollTop=0)},E=Me(()=>{const $=OT(t)||T().body;Wi.add(w(),$),h.current&&M()}),j=()=>Wi.isTopModal(w()),F=Me($=>{m.current=$,$&&(u&&j()?M():h.current&&ti(h.current,C))}),O=D.useCallback(()=>{Wi.remove(w(),C)},[C]);D.useEffect(()=>()=>{O()},[O]),D.useEffect(()=>{u?E():(!x||!o)&&O()},[u,O,x,o,E]);const V=$=>R=>{$.onKeyDown?.(R),!(R.key!=="Escape"||R.which===229||!j())&&(n||(R.stopPropagation(),c&&c(R,"escapeKeyDown")))},L=$=>R=>{$.onClick?.(R),R.target===R.currentTarget&&c&&c(R,"backdropClick")};return{getRootProps:($={})=>{const R=en(e);delete R.onTransitionEnter,delete R.onTransitionExited;const _={...R,...$};return{role:"presentation",..._,onKeyDown:V(_),ref:g}},getBackdropProps:($={})=>{const R=$;return{"aria-hidden":!0,...R,onClick:L(R),open:u}},getTransitionProps:()=>{const $=()=>{b(!1),s&&s()},R=()=>{b(!0),i&&i(),o&&O()};return{onEnter:wd($,l?.props.onEnter??Vp),onExited:wd(R,l?.props.onExited??Vp)}},rootRef:g,portalRef:F,isTopModal:j,exited:y,hasTransition:x}}function $T(e){return $e("MuiModal",e)}Ee("MuiModal",["root","hidden","backdrop"]);const AT=e=>{const{open:t,exited:n,classes:r}=e;return Re({root:["root",!t&&n&&"hidden"],backdrop:["backdrop"]},$T,r)},FT=re("div",{name:"MuiModal",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,!n.open&&n.exited&&t.hidden]}})(He(({theme:e})=>({position:"fixed",zIndex:(e.vars||e).zIndex.modal,right:0,bottom:0,top:0,left:0,variants:[{props:({ownerState:t})=>!t.open&&t.exited,style:{visibility:"hidden"}}]}))),NT=re(cm,{name:"MuiModal",slot:"Backdrop"})({zIndex:-1}),um=D.forwardRef(function(t,n){const r=We({name:"MuiModal",props:t}),{BackdropComponent:o=NT,BackdropProps:s,classes:i,className:l,closeAfterTransition:c=!1,children:u,container:d,component:f,components:m={},componentsProps:h={},disableAutoFocus:g=!1,disableEnforceFocus:y=!1,disableEscapeKeyDown:b=!1,disablePortal:x=!1,disableRestoreFocus:C=!1,disableScrollLock:T=!1,hideBackdrop:w=!1,keepMounted:M=!1,onClose:E,onTransitionEnter:j,onTransitionExited:F,open:O,slotProps:V={},slots:L={},theme:v,...N}=r,A={...r,closeAfterTransition:c,disableAutoFocus:g,disableEnforceFocus:y,disableEscapeKeyDown:b,disablePortal:x,disableRestoreFocus:C,disableScrollLock:T,hideBackdrop:w,keepMounted:M},{getRootProps:$,getBackdropProps:R,getTransitionProps:_,portalRef:z,isTopModal:W,exited:H,hasTransition:G}=jT({...A,rootRef:n}),se={...A,exited:H},pe=AT(se),me={};if(u.props.tabIndex===void 0&&(me.tabIndex="-1"),G){const{onEnter:Z,onExited:J}=_();me.onEnter=Z,me.onExited=J}const X={slots:{root:m.Root,backdrop:m.Backdrop,...L},slotProps:{...h,...V}},[K,le]=et("root",{ref:n,elementType:FT,externalForwardedProps:{...X,...N,component:f},getSlotProps:$,ownerState:se,className:Te(l,pe?.root,!se.open&&se.exited&&pe?.hidden)}),[oe,te]=et("backdrop",{ref:s?.ref,elementType:o,externalForwardedProps:X,shouldForwardComponentProp:!0,additionalProps:s,getSlotProps:Z=>R({...Z,onClick:J=>{Z?.onClick&&Z.onClick(J)}}),className:Te(s?.className,pe?.backdrop),ownerState:se});return!M&&!O&&(!G||H)?null:a.jsx(Gh,{ref:z,container:d,disablePortal:x,children:a.jsxs(K,{...le,children:[!w&&o?a.jsx(oe,{...te}):null,a.jsx(Zh,{disableEnforceFocus:y,disableAutoFocus:g,disableRestoreFocus:C,isEnabled:W,open:O,children:D.cloneElement(u,me)})]})})});function LT(e){return $e("MuiPopover",e)}Ee("MuiPopover",["root","paper"]);function zp(e,t){let n=0;return typeof t=="number"?n=t:t==="center"?n=e.height/2:t==="bottom"&&(n=e.height),n}function _p(e,t){let n=0;return typeof t=="number"?n=t:t==="center"?n=e.width/2:t==="right"&&(n=e.width),n}function Wp(e){return[e.horizontal,e.vertical].map(t=>typeof t=="number"?`${t}px`:t).join(" ")}function Hi(e){return typeof e=="function"?e():e}const BT=e=>{const{classes:t}=e;return Re({root:["root"],paper:["paper"]},LT,t)},VT=re(um,{name:"MuiPopover",slot:"Root"})({}),dm=re(po,{name:"MuiPopover",slot:"Paper"})({position:"absolute",overflowY:"auto",overflowX:"hidden",minWidth:16,minHeight:16,maxWidth:"calc(100% - 32px)",maxHeight:"calc(100% - 32px)",outline:0}),zT=D.forwardRef(function(t,n){const r=We({props:t,name:"MuiPopover"}),{action:o,anchorEl:s,anchorOrigin:i={vertical:"top",horizontal:"left"},anchorPosition:l,anchorReference:c="anchorEl",children:u,className:d,container:f,elevation:m=8,marginThreshold:h=16,open:g,PaperProps:y={},slots:b={},slotProps:x={},transformOrigin:C={vertical:"top",horizontal:"left"},TransitionComponent:T,transitionDuration:w="auto",TransitionProps:M={},disableScrollLock:E=!1,...j}=r,F=D.useRef(),O={...r,anchorOrigin:i,anchorReference:c,elevation:m,marginThreshold:h,transformOrigin:C,TransitionComponent:T,transitionDuration:w,TransitionProps:M},V=BT(O),L=D.useCallback(()=>{if(c==="anchorPosition")return l;const Z=Hi(s),ae=(Z&&Z.nodeType===1?Z:zt(F.current).body).getBoundingClientRect();return{top:ae.top+zp(ae,i.vertical),left:ae.left+_p(ae,i.horizontal)}},[s,i.horizontal,i.vertical,l,c]),v=D.useCallback(Z=>({vertical:zp(Z,C.vertical),horizontal:_p(Z,C.horizontal)}),[C.horizontal,C.vertical]),N=D.useCallback(Z=>{const J={width:Z.offsetWidth,height:Z.offsetHeight},ae=v(J);if(c==="none")return{top:null,left:null,transformOrigin:Wp(ae)};const Q=L();let ue=Q.top-ae.vertical,he=Q.left-ae.horizontal;const de=ue+J.height,Se=he+J.width,ce=xr(Hi(s)),Pe=ce.innerHeight-h,Ce=ce.innerWidth-h;if(h!==null&&ue<h){const Ve=ue-h;ue-=Ve,ae.vertical+=Ve}else if(h!==null&&de>Pe){const Ve=de-Pe;ue-=Ve,ae.vertical+=Ve}if(h!==null&&he<h){const Ve=he-h;he-=Ve,ae.horizontal+=Ve}else if(Se>Ce){const Ve=Se-Ce;he-=Ve,ae.horizontal+=Ve}return{top:`${Math.round(ue)}px`,left:`${Math.round(he)}px`,transformOrigin:Wp(ae)}},[s,c,L,v,h]),[A,$]=D.useState(g),R=D.useCallback(()=>{const Z=F.current;if(!Z)return;const J=N(Z);J.top!==null&&Z.style.setProperty("top",J.top),J.left!==null&&(Z.style.left=J.left),Z.style.transformOrigin=J.transformOrigin,$(!0)},[N]);D.useEffect(()=>(E&&window.addEventListener("scroll",R),()=>window.removeEventListener("scroll",R)),[s,E,R]);const _=()=>{R()},z=()=>{$(!1)};D.useEffect(()=>{g&&R()}),D.useImperativeHandle(o,()=>g?{updatePosition:()=>{R()}}:null,[g,R]),D.useEffect(()=>{if(!g)return;const Z=hh(()=>{R()}),J=xr(Hi(s));return J.addEventListener("resize",Z),()=>{Z.clear(),J.removeEventListener("resize",Z)}},[s,g,R]);let W=w;const H={slots:{transition:T,...b},slotProps:{transition:M,paper:y,...x}},[G,se]=et("transition",{elementType:ii,externalForwardedProps:H,ownerState:O,getSlotProps:Z=>({...Z,onEntering:(J,ae)=>{Z.onEntering?.(J,ae),_()},onExited:J=>{Z.onExited?.(J),z()}}),additionalProps:{appear:!0,in:g}});w==="auto"&&!G.muiSupportAuto&&(W=void 0);const pe=f||(s?zt(Hi(s)).body:void 0),[me,{slots:X,slotProps:K,...le}]=et("root",{ref:n,elementType:VT,externalForwardedProps:{...H,...j},shouldForwardComponentProp:!0,additionalProps:{slots:{backdrop:b.backdrop},slotProps:{backdrop:mh(typeof x.backdrop=="function"?x.backdrop(O):x.backdrop,{invisible:!0})},container:pe,open:g},ownerState:O,className:Te(V.root,d)}),[oe,te]=et("paper",{ref:F,className:V.paper,elementType:dm,externalForwardedProps:H,shouldForwardComponentProp:!0,additionalProps:{elevation:m,style:A?void 0:{opacity:0}},ownerState:O});return a.jsx(me,{...le,...!Zo(me)&&{slots:X,slotProps:K,disableScrollLock:E},children:a.jsx(G,{...se,timeout:W,children:a.jsx(oe,{...te,children:u})})})});function _T(e){return $e("MuiMenu",e)}Ee("MuiMenu",["root","paper","list"]);const WT={vertical:"top",horizontal:"right"},HT={vertical:"top",horizontal:"left"},UT=e=>{const{classes:t}=e;return Re({root:["root"],paper:["paper"],list:["list"]},_T,t)},qT=re(zT,{shouldForwardProp:e=>nn(e)||e==="classes",name:"MuiMenu",slot:"Root"})({}),YT=re(dm,{name:"MuiMenu",slot:"Paper"})({maxHeight:"calc(100% - 96px)",WebkitOverflowScrolling:"touch"}),KT=re(CT,{name:"MuiMenu",slot:"List"})({outline:0}),GT=D.forwardRef(function(t,n){const r=We({props:t,name:"MuiMenu"}),{autoFocus:o=!0,children:s,className:i,disableAutoFocusItem:l=!1,MenuListProps:c={},onClose:u,open:d,PaperProps:f={},PopoverClasses:m,transitionDuration:h="auto",TransitionProps:{onEntering:g,...y}={},variant:b="selectedMenu",slots:x={},slotProps:C={},...T}=r,w=An(),M={...r,autoFocus:o,disableAutoFocusItem:l,MenuListProps:c,onEntering:g,PaperProps:f,transitionDuration:h,TransitionProps:y,variant:b},E=UT(M),j=o&&!l&&d,F=D.useRef(null),O=(W,H)=>{F.current&&F.current.adjustStyleForScrollbar(W,{direction:w?"rtl":"ltr"}),g&&g(W,H)},V=W=>{W.key==="Tab"&&(W.preventDefault(),u&&u(W,"tabKeyDown"))};let L=-1;D.Children.map(s,(W,H)=>{D.isValidElement(W)&&(W.props.disabled||(b==="selectedMenu"&&W.props.selected||L===-1)&&(L=H))});const v={slots:x,slotProps:{list:c,transition:y,paper:f,...C}},N=Ge({elementType:x.root,externalSlotProps:C.root,ownerState:M,className:[E.root,i]}),[A,$]=et("paper",{className:E.paper,elementType:YT,externalForwardedProps:v,shouldForwardComponentProp:!0,ownerState:M}),[R,_]=et("list",{className:Te(E.list,c.className),elementType:KT,shouldForwardComponentProp:!0,externalForwardedProps:v,getSlotProps:W=>({...W,onKeyDown:H=>{V(H),W.onKeyDown?.(H)}}),ownerState:M}),z=typeof v.slotProps.transition=="function"?v.slotProps.transition(M):v.slotProps.transition;return a.jsx(qT,{onClose:u,anchorOrigin:{vertical:"bottom",horizontal:w?"right":"left"},transformOrigin:w?WT:HT,slots:{root:x.root,paper:A,backdrop:x.backdrop,...x.transition&&{transition:x.transition}},slotProps:{root:N,paper:$,backdrop:typeof C.backdrop=="function"?C.backdrop(M):C.backdrop,transition:{...z,onEntering:(...W)=>{O(...W),z?.onEntering?.(...W)}}},open:d,ref:n,transitionDuration:h,ownerState:M,...T,classes:m,children:a.jsx(R,{actions:F,autoFocus:o&&(L===-1||l),autoFocusItem:j,variant:b,..._,children:s})})});function ZT(e){return $e("MuiNativeSelect",e)}const nu=Ee("MuiNativeSelect",["root","select","multiple","filled","outlined","standard","disabled","icon","iconOpen","iconFilled","iconOutlined","iconStandard","nativeInput","error"]),XT=e=>{const{classes:t,variant:n,disabled:r,multiple:o,open:s,error:i}=e,l={select:["select",n,r&&"disabled",o&&"multiple",i&&"error"],icon:["icon",`icon${ve(n)}`,s&&"iconOpen",r&&"disabled"]};return Re(l,ZT,t)},pm=re("select",{name:"MuiNativeSelect"})(({theme:e})=>({MozAppearance:"none",WebkitAppearance:"none",userSelect:"none",borderRadius:0,cursor:"pointer","&:focus":{borderRadius:0},[`&.${nu.disabled}`]:{cursor:"default"},"&[multiple]":{height:"auto"},"&:not([multiple]) option, &:not([multiple]) optgroup":{backgroundColor:(e.vars||e).palette.background.paper},variants:[{props:({ownerState:t})=>t.variant!=="filled"&&t.variant!=="outlined",style:{"&&&":{paddingRight:24,minWidth:16}}},{props:{variant:"filled"},style:{"&&&":{paddingRight:32}}},{props:{variant:"outlined"},style:{borderRadius:(e.vars||e).shape.borderRadius,"&:focus":{borderRadius:(e.vars||e).shape.borderRadius},"&&&":{paddingRight:32}}}]})),QT=re(pm,{name:"MuiNativeSelect",slot:"Select",shouldForwardProp:nn,overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.select,t[n.variant],n.error&&t.error,{[`&.${nu.multiple}`]:t.multiple}]}})({}),fm=re("svg",{name:"MuiNativeSelect"})(({theme:e})=>({position:"absolute",right:0,top:"calc(50% - .5em)",pointerEvents:"none",color:(e.vars||e).palette.action.active,[`&.${nu.disabled}`]:{color:(e.vars||e).palette.action.disabled},variants:[{props:({ownerState:t})=>t.open,style:{transform:"rotate(180deg)"}},{props:{variant:"filled"},style:{right:7}},{props:{variant:"outlined"},style:{right:7}}]})),JT=re(fm,{name:"MuiNativeSelect",slot:"Icon",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.icon,n.variant&&t[`icon${ve(n.variant)}`],n.open&&t.iconOpen]}})({}),eI=D.forwardRef(function(t,n){const{className:r,disabled:o,error:s,IconComponent:i,inputRef:l,variant:c="standard",...u}=t,d={...t,disabled:o,variant:c,error:s},f=XT(d);return a.jsxs(D.Fragment,{children:[a.jsx(QT,{ownerState:d,className:Te(f.select,r),disabled:o,ref:l||n,...u}),t.multiple?null:a.jsx(JT,{as:i,ownerState:d,className:f.icon})]})});function hm(e){return $e("MuiSelect",e)}const Is=Ee("MuiSelect",["root","select","multiple","filled","outlined","standard","disabled","focused","icon","iconOpen","iconFilled","iconOutlined","iconStandard","nativeInput","error"]);var Hp;const tI=re(pm,{name:"MuiSelect",slot:"Select",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[{[`&.${Is.select}`]:t.select},{[`&.${Is.select}`]:t[n.variant]},{[`&.${Is.error}`]:t.error},{[`&.${Is.multiple}`]:t.multiple}]}})({[`&.${Is.select}`]:{height:"auto",minHeight:"1.4375em",textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden"}}),nI=re(fm,{name:"MuiSelect",slot:"Icon",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.icon,n.variant&&t[`icon${ve(n.variant)}`],n.open&&t.iconOpen]}})({}),rI=re("input",{shouldForwardProp:e=>fh(e)&&e!=="classes",name:"MuiSelect",slot:"NativeInput"})({bottom:0,left:0,position:"absolute",opacity:0,pointerEvents:"none",width:"100%",boxSizing:"border-box"});function Up(e,t){return typeof t=="object"&&t!==null?e===t:String(e)===String(t)}function oI(e){return e==null||typeof e=="string"&&!e.trim()}const sI=e=>{const{classes:t,variant:n,disabled:r,multiple:o,open:s,error:i}=e,l={select:["select",n,r&&"disabled",o&&"multiple",i&&"error"],icon:["icon",`icon${ve(n)}`,s&&"iconOpen",r&&"disabled"],nativeInput:["nativeInput"]};return Re(l,hm,t)},iI=D.forwardRef(function(t,n){const{"aria-describedby":r,"aria-label":o,autoFocus:s,autoWidth:i,children:l,className:c,defaultOpen:u,defaultValue:d,disabled:f,displayEmpty:m,error:h=!1,IconComponent:g,inputRef:y,labelId:b,MenuProps:x={},multiple:C,name:T,onBlur:w,onChange:M,onClose:E,onFocus:j,onOpen:F,open:O,readOnly:V,renderValue:L,required:v,SelectDisplayProps:N={},tabIndex:A,type:$,value:R,variant:_="standard",...z}=t,[W,H]=mn({controlled:R,default:d,name:"Select"}),[G,se]=mn({controlled:O,default:u,name:"Select"}),pe=D.useRef(null),me=D.useRef(null),[X,K]=D.useState(null),{current:le}=D.useRef(O!=null),[oe,te]=D.useState(),Z=Ze(n,y),J=D.useCallback(je=>{me.current=je,je&&K(je)},[]),ae=X?.parentNode;D.useImperativeHandle(Z,()=>({focus:()=>{me.current.focus()},node:pe.current,value:W}),[W]),D.useEffect(()=>{u&&G&&X&&!le&&(te(i?null:ae.clientWidth),me.current.focus())},[X,i]),D.useEffect(()=>{s&&me.current.focus()},[s]),D.useEffect(()=>{if(!b)return;const je=zt(me.current).getElementById(b);if(je){const ze=()=>{getSelection().isCollapsed&&me.current.focus()};return je.addEventListener("click",ze),()=>{je.removeEventListener("click",ze)}}},[b]);const Q=(je,ze)=>{je?F&&F(ze):E&&E(ze),le||(te(i?null:ae.clientWidth),se(je))},ue=je=>{je.button===0&&(je.preventDefault(),me.current.focus(),Q(!0,je))},he=je=>{Q(!1,je)},de=D.Children.toArray(l),Se=je=>{const ze=de.find(Ae=>Ae.props.value===je.target.value);ze!==void 0&&(H(ze.props.value),M&&M(je,ze))},ce=je=>ze=>{let Ae;if(ze.currentTarget.hasAttribute("tabindex")){if(C){Ae=Array.isArray(W)?W.slice():[];const Kt=W.indexOf(je.props.value);Kt===-1?Ae.push(je.props.value):Ae.splice(Kt,1)}else Ae=je.props.value;if(je.props.onClick&&je.props.onClick(ze),W!==Ae&&(H(Ae),M)){const Kt=ze.nativeEvent||ze,at=new Kt.constructor(Kt.type,Kt);Object.defineProperty(at,"target",{writable:!0,value:{value:Ae,name:T}}),M(at,je)}C||Q(!1,ze)}},Pe=je=>{V||[" ","ArrowUp","ArrowDown","Enter"].includes(je.key)&&(je.preventDefault(),Q(!0,je))},Ce=X!==null&&G,Ve=je=>{!Ce&&w&&(Object.defineProperty(je,"target",{writable:!0,value:{value:W,name:T}}),w(je))};delete z["aria-invalid"];let De,pt;const Ye=[];let tt=!1;(wa({value:W})||m)&&(L?De=L(W):tt=!0);const gt=de.map(je=>{if(!D.isValidElement(je))return null;let ze;if(C){if(!Array.isArray(W))throw new Error(yr(2));ze=W.some(Ae=>Up(Ae,je.props.value)),ze&&tt&&Ye.push(je.props.children)}else ze=Up(W,je.props.value),ze&&tt&&(pt=je.props.children);return D.cloneElement(je,{"aria-selected":ze?"true":"false",onClick:ce(je),onKeyUp:Ae=>{Ae.key===" "&&Ae.preventDefault(),je.props.onKeyUp&&je.props.onKeyUp(Ae)},role:"option",selected:ze,value:void 0,"data-value":je.props.value})});tt&&(C?Ye.length===0?De=null:De=Ye.reduce((je,ze,Ae)=>(je.push(ze),Ae<Ye.length-1&&je.push(", "),je),[]):De=pt);let kt=oe;!i&&le&&X&&(kt=ae.clientWidth);let Pt;typeof A<"u"?Pt=A:Pt=f?null:0;const Yt=N.id||(T?`mui-component-select-${T}`:void 0),lt={...t,variant:_,value:W,open:Ce,error:h},Ie=sI(lt),ft={...x.PaperProps,...typeof x.slotProps?.paper=="function"?x.slotProps.paper(lt):x.slotProps?.paper},it={...x.MenuListProps,...typeof x.slotProps?.list=="function"?x.slotProps.list(lt):x.slotProps?.list},jt=Un();return a.jsxs(D.Fragment,{children:[a.jsx(tI,{as:"div",ref:J,tabIndex:Pt,role:"combobox","aria-controls":Ce?jt:void 0,"aria-disabled":f?"true":void 0,"aria-expanded":Ce?"true":"false","aria-haspopup":"listbox","aria-label":o,"aria-labelledby":[b,Yt].filter(Boolean).join(" ")||void 0,"aria-describedby":r,"aria-required":v?"true":void 0,"aria-invalid":h?"true":void 0,onKeyDown:Pe,onMouseDown:f||V?null:ue,onBlur:Ve,onFocus:j,...N,ownerState:lt,className:Te(N.className,Ie.select,c),id:Yt,children:oI(De)?Hp||(Hp=a.jsx("span",{className:"notranslate","aria-hidden":!0,children:"​"})):De}),a.jsx(rI,{"aria-invalid":h,value:Array.isArray(W)?W.join(","):W,name:T,ref:pe,"aria-hidden":!0,onChange:Se,tabIndex:-1,disabled:f,className:Ie.nativeInput,autoFocus:s,required:v,...z,ownerState:lt}),a.jsx(nI,{as:g,className:Ie.icon,ownerState:lt}),a.jsx(GT,{id:`menu-${T||""}`,anchorEl:ae,open:Ce,onClose:he,anchorOrigin:{vertical:"bottom",horizontal:"center"},transformOrigin:{vertical:"top",horizontal:"center"},...x,slotProps:{...x.slotProps,list:{"aria-labelledby":b,role:"listbox","aria-multiselectable":C?"true":void 0,disableListWrap:!0,id:jt,...it},paper:{...ft,style:{minWidth:kt,...ft!=null?ft.style:null}}},children:gt})]})}),mm=Xe(a.jsx("path",{d:"M7 10l5 5 5-5z"})),aI=e=>{const{classes:t}=e,r=Re({root:["root"]},hm,t);return{...t,...r}},ru={name:"MuiSelect",slot:"Root",shouldForwardProp:e=>nn(e)&&e!=="variant"},lI=re(Jc,ru)(""),cI=re(tu,ru)(""),uI=re(eu,ru)(""),Ia=D.forwardRef(function(t,n){const r=We({name:"MuiSelect",props:t}),{autoWidth:o=!1,children:s,classes:i={},className:l,defaultOpen:c=!1,displayEmpty:u=!1,IconComponent:d=mm,id:f,input:m,inputProps:h,label:g,labelId:y,MenuProps:b,multiple:x=!1,native:C=!1,onClose:T,onOpen:w,open:M,renderValue:E,SelectDisplayProps:j,variant:F="outlined",...O}=r,V=C?eI:iI,L=yn(),v=fo({props:r,muiFormControl:L,states:["variant","error"]}),N=v.variant||F,A={...r,variant:N,classes:i},$=aI(A),{root:R,..._}=$,z=m||{standard:a.jsx(lI,{ownerState:A}),outlined:a.jsx(cI,{label:g,ownerState:A}),filled:a.jsx(uI,{ownerState:A})}[N],W=Ze(n,os(z));return a.jsx(D.Fragment,{children:D.cloneElement(z,{inputComponent:V,inputProps:{children:s,error:v.error,IconComponent:d,variant:N,type:void 0,multiple:x,...C?{id:f}:{autoWidth:o,defaultOpen:c,displayEmpty:u,labelId:y,MenuProps:b,onClose:T,onOpen:w,open:M,renderValue:E,SelectDisplayProps:{id:f,...j}},...h,classes:h?Qt(_,h.classes):_,...m?m.props.inputProps:{}},...(x&&C||u)&&N==="outlined"?{notched:!0}:{},ref:W,className:Te(z.props.className,l,$.root),...!m&&{variant:N},...O})})});Ia.muiName="Select";function dI(e){return $e("MuiTextField",e)}Ee("MuiTextField",["root"]);const pI={standard:Jc,filled:eu,outlined:tu},fI=e=>{const{classes:t}=e;return Re({root:["root"]},dI,t)},hI=re(Ta,{name:"MuiTextField",slot:"Root"})({}),Ke=D.forwardRef(function(t,n){const r=We({props:t,name:"MuiTextField"}),{autoComplete:o,autoFocus:s=!1,children:i,className:l,color:c="primary",defaultValue:u,disabled:d=!1,error:f=!1,FormHelperTextProps:m,fullWidth:h=!1,helperText:g,id:y,InputLabelProps:b,inputProps:x,InputProps:C,inputRef:T,label:w,maxRows:M,minRows:E,multiline:j=!1,name:F,onBlur:O,onChange:V,onFocus:L,placeholder:v,required:N=!1,rows:A,select:$=!1,SelectProps:R,slots:_={},slotProps:z={},type:W,value:H,variant:G="outlined",...se}=r,pe={...r,autoFocus:s,color:c,disabled:d,error:f,fullWidth:h,multiline:j,required:N,select:$,variant:G},me=fI(pe),X=Un(y),K=g&&X?`${X}-helper-text`:void 0,le=w&&X?`${X}-label`:void 0,oe=pI[G],te={slots:_,slotProps:{input:C,inputLabel:b,htmlInput:x,formHelperText:m,select:R,...z}},Z={},J=te.slotProps.inputLabel;G==="outlined"&&(J&&typeof J.shrink<"u"&&(Z.notched=J.shrink),Z.label=w),$&&((!R||!R.native)&&(Z.id=void 0),Z["aria-describedby"]=void 0);const[ae,Q]=et("root",{elementType:hI,shouldForwardComponentProp:!0,externalForwardedProps:{...te,...se},ownerState:pe,className:Te(me.root,l),ref:n,additionalProps:{disabled:d,error:f,fullWidth:h,required:N,color:c,variant:G}}),[ue,he]=et("input",{elementType:oe,externalForwardedProps:te,additionalProps:Z,ownerState:pe}),[de,Se]=et("inputLabel",{elementType:ka,externalForwardedProps:te,ownerState:pe}),[ce,Pe]=et("htmlInput",{elementType:"input",externalForwardedProps:te,ownerState:pe}),[Ce,Ve]=et("formHelperText",{elementType:am,externalForwardedProps:te,ownerState:pe}),[De,pt]=et("select",{elementType:Ia,externalForwardedProps:te,ownerState:pe}),Ye=a.jsx(ue,{"aria-describedby":K,autoComplete:o,autoFocus:s,defaultValue:u,fullWidth:h,multiline:j,name:F,rows:A,maxRows:M,minRows:E,type:W,value:H,id:X,inputRef:T,onBlur:O,onChange:V,onFocus:L,placeholder:v,inputProps:Pe,slots:{input:_.htmlInput?ce:void 0},...he});return a.jsxs(ae,{...Q,children:[w!=null&&w!==""&&a.jsx(de,{htmlFor:X,id:le,...Se,children:w}),$?a.jsx(De,{"aria-describedby":K,id:X,labelId:le,value:H,input:Ye,...pt,children:i}):Ye,g&&a.jsx(Ce,{id:K,...Ve,children:g})]})}),mI=({utils:e,format:t})=>{let n=10,r=t,o=e.expandFormat(t);for(;o!==r;)if(r=o,o=e.expandFormat(r),n-=1,n<0)throw new Error("MUI X: The format expansion seems to be in an infinite loop. Please open an issue with the format passed to the picker component.");return o},gI=({utils:e,expandedFormat:t})=>{const n=[],{start:r,end:o}=e.escapedCharacters,s=new RegExp(`(\\${r}[^\\${o}]*\\${o})+`,"g");let i=null;for(;i=s.exec(t);)n.push({start:i.index,end:s.lastIndex-1});return n},yI=(e,t,n,r)=>{switch(n.type){case"year":return t.fieldYearPlaceholder({digitAmount:e.formatByString(e.date(void 0,"default"),r).length,format:r});case"month":return t.fieldMonthPlaceholder({contentType:n.contentType,format:r});case"day":return t.fieldDayPlaceholder({format:r});case"weekDay":return t.fieldWeekDayPlaceholder({contentType:n.contentType,format:r});case"hours":return t.fieldHoursPlaceholder({format:r});case"minutes":return t.fieldMinutesPlaceholder({format:r});case"seconds":return t.fieldSecondsPlaceholder({format:r});case"meridiem":return t.fieldMeridiemPlaceholder({format:r});default:return r}},bI=({utils:e,date:t,shouldRespectLeadingZeros:n,localeText:r,localizedDigits:o,now:s,token:i,startSeparator:l})=>{if(i==="")throw new Error("MUI X: Should not call `commitToken` with an empty token");const c=Ih(e,i),u=Eh(e,c.contentType,c.type,i),d=n?u:c.contentType==="digit",f=t!=null&&e.isValid(t);let m=f?e.formatByString(t,i):"",h=null;if(d)if(u)h=m===""?e.formatByString(s,i).length:m.length;else{if(c.maxLength==null)throw new Error(`MUI X: The token ${i} should have a 'maxDigitNumber' property on it's adapter`);h=c.maxLength,f&&(m=Ac(Dh(so(m,o),h),o))}return U({},c,{format:i,maxLength:h,value:m,placeholder:yI(e,r,c,i),hasLeadingZerosInFormat:u,hasLeadingZerosInInput:d,startSeparator:l,endSeparator:"",modified:!1})},xI=e=>{const{utils:t,expandedFormat:n,escapedParts:r}=e,o=t.date(void 0),s=[];let i="";const l=Object.keys(t.formatTokenMap).sort((h,g)=>g.length-h.length),c=/^([a-zA-Z]+)/,u=new RegExp(`^(${l.join("|")})*$`),d=new RegExp(`^(${l.join("|")})`),f=h=>r.find(g=>g.start<=h&&g.end>=h);let m=0;for(;m<n.length;){const h=f(m),g=h!=null,y=c.exec(n.slice(m))?.[1];if(!g&&y!=null&&u.test(y)){let b=y;for(;b.length>0;){const x=d.exec(b)[1];b=b.slice(x.length),s.push(bI(U({},e,{now:o,token:x,startSeparator:i}))),i=""}m+=y.length}else{const b=n[m];g&&h?.start===m||h?.end===m||(s.length===0?i+=b:s[s.length-1].endSeparator+=b),m+=1}}return s.length===0&&i.length>0&&s.push({type:"empty",contentType:"letter",maxLength:null,format:"",value:"",placeholder:"",hasLeadingZerosInFormat:!1,hasLeadingZerosInInput:!1,startSeparator:i,endSeparator:"",modified:!1}),s},vI=({isRtl:e,formatDensity:t,sections:n})=>n.map(r=>{const o=s=>{let i=s;return e&&i!==null&&i.includes(" ")&&(i=`⁩${i}⁦`),t==="spacious"&&["/",".","-"].includes(i)&&(i=` ${i} `),i};return r.startSeparator=o(r.startSeparator),r.endSeparator=o(r.endSeparator),r}),qp=e=>{let t=mI(e);e.isRtl&&e.enableAccessibleFieldDOMStructure&&(t=t.split(" ").reverse().join(" "));const n=gI(U({},e,{expandedFormat:t})),r=xI(U({},e,{expandedFormat:t,escapedParts:n}));return vI(U({},e,{sections:r}))},SI=e=>{const t=It(),n=Cr(),r=uo(),o=An(),{valueManager:s,fieldValueManager:i,valueType:l,validator:c,internalProps:u,internalProps:{value:d,defaultValue:f,referenceDate:m,onChange:h,format:g,formatDensity:y="dense",selectedSections:b,onSelectedSectionsChange:x,shouldRespectLeadingZeros:C=!1,timezone:T,enableAccessibleFieldDOMStructure:w=!1}}=e,{timezone:M,value:E,handleValueChange:j}=Gc({timezone:T,value:d,defaultValue:f,referenceDate:m,onChange:h,valueManager:s}),F=D.useMemo(()=>wS(t),[t]),O=D.useMemo(()=>PS(t,F,M),[t,F,M]),V=D.useCallback((X,K=null)=>i.getSectionsFromValue(t,X,K,le=>qp({utils:t,localeText:n,localizedDigits:F,format:g,date:le,formatDensity:y,shouldRespectLeadingZeros:C,enableAccessibleFieldDOMStructure:w,isRtl:o})),[i,g,n,F,o,C,t,y,w]),[L,v]=D.useState(()=>{const X=V(E),K={sections:X,value:E,referenceValue:s.emptyValue,tempValueStrAndroid:null},le=xS(X),oe=s.getInitialReferenceValue({referenceDate:m,value:E,utils:t,props:u,granularity:le,timezone:M});return U({},K,{referenceValue:oe})}),[N,A]=mn({controlled:b,default:null,name:"useField",state:"selectedSections"}),$=X=>{A(X),x?.(X)},R=D.useMemo(()=>Yl(N,L.sections),[N,L.sections]),_=R==="all"?0:R,z=({value:X,referenceValue:K,sections:le})=>{if(v(te=>U({},te,{sections:le,value:X,referenceValue:K,tempValueStrAndroid:null})),s.areValuesEqual(t,L.value,X))return;const oe={validationError:c({adapter:r,value:X,timezone:M,props:u})};j(X,oe)},W=(X,K)=>{const le=[...L.sections];return le[X]=U({},le[X],{value:K,modified:!0}),le},H=()=>{z({value:s.emptyValue,referenceValue:L.referenceValue,sections:V(s.emptyValue)})},G=()=>{if(_==null)return;const X=L.sections[_],K=i.getActiveDateManager(t,L,X),oe=K.getSections(L.sections).filter(ae=>ae.value!=="").length===(X.value===""?0:1),te=W(_,""),Z=oe?null:t.getInvalidDate(),J=K.getNewValuesFromNewActiveDate(Z);z(U({},J,{sections:te}))},se=X=>{const K=(te,Z)=>{const J=t.parse(te,g);if(J==null||!t.isValid(J))return null;const ae=qp({utils:t,localeText:n,localizedDigits:F,format:g,date:J,formatDensity:y,shouldRespectLeadingZeros:C,enableAccessibleFieldDOMStructure:w,isRtl:o});return lp(t,J,ae,Z,!1)},le=i.parseValueStr(X,L.referenceValue,K),oe=i.updateReferenceValue(t,le,L.referenceValue);z({value:le,referenceValue:oe,sections:V(le,L.sections)})},pe=({activeSection:X,newSectionValue:K,shouldGoToNextSection:le})=>{le&&_<L.sections.length-1&&$(_+1);const oe=i.getActiveDateManager(t,L,X),te=W(_,K),Z=oe.getSections(te),J=IS(t,Z,F);let ae,Q;if(J!=null&&t.isValid(J)){const ue=lp(t,J,Z,oe.referenceDate,!0);ae=oe.getNewValuesFromNewActiveDate(ue),Q=!0}else ae=oe.getNewValuesFromNewActiveDate(J),Q=(J!=null&&!t.isValid(J))!=(oe.date!=null&&!t.isValid(oe.date));return Q?z(U({},ae,{sections:te})):v(ue=>U({},ue,ae,{sections:te,tempValueStrAndroid:null}))},me=X=>v(K=>U({},K,{tempValueStrAndroid:X}));return D.useEffect(()=>{const X=V(L.value);v(K=>U({},K,{sections:X}))},[g,t.locale,o]),D.useEffect(()=>{let X;s.areValuesEqual(t,L.value,E)?X=s.getTimezone(t,L.value)!==s.getTimezone(t,E):X=!0,X&&v(K=>U({},K,{value:E,referenceValue:i.updateReferenceValue(t,E,K.referenceValue),sections:V(E)}))},[E]),{state:L,activeSectionIndex:_,parsedSelectedSections:R,setSelectedSections:$,clearValue:H,clearActiveSection:G,updateSectionValue:pe,updateValueFromValueStr:se,setTempAndroidValueStr:me,getSectionsFromValue:V,sectionsValueBoundaries:O,localizedDigits:F,timezone:M}},CI=5e3,No=e=>e.saveQuery!=null,wI=({sections:e,updateSectionValue:t,sectionsValueBoundaries:n,localizedDigits:r,setTempAndroidValueStr:o,timezone:s})=>{const i=It(),[l,c]=D.useState(null),u=Me(()=>c(null));D.useEffect(()=>{l!=null&&e[l.sectionIndex]?.type!==l.sectionType&&u()},[e,l,u]),D.useEffect(()=>{if(l!=null){const g=setTimeout(()=>u(),CI);return()=>{clearTimeout(g)}}return()=>{}},[l,u]);const d=({keyPressed:g,sectionIndex:y},b,x)=>{const C=g.toLowerCase(),T=e[y];if(l!=null&&(!x||x(l.value))&&l.sectionIndex===y){const M=`${l.value}${C}`,E=b(M,T);if(!No(E))return c({sectionIndex:y,value:M,sectionType:T.type}),E}const w=b(C,T);return No(w)&&!w.saveQuery?(u(),null):(c({sectionIndex:y,value:C,sectionType:T.type}),No(w)?null:w)},f=g=>{const y=(C,T,w)=>{const M=T.filter(E=>E.toLowerCase().startsWith(w));return M.length===0?{saveQuery:!1}:{sectionValue:M[0],shouldGoToNextSection:M.length===1}},b=(C,T,w,M)=>{const E=j=>Mh(i,s,T.type,j);if(T.contentType==="letter")return y(T.format,E(T.format),C);if(w&&M!=null&&Ih(i,w).contentType==="letter"){const j=E(w),F=y(w,j,C);return No(F)?{saveQuery:!1}:U({},F,{sectionValue:M(F.sectionValue,j)})}return{saveQuery:!1}};return d(g,(C,T)=>{switch(T.type){case"month":{const w=M=>ip(i,M,i.formats.month,T.format);return b(C,T,i.formats.month,w)}case"weekDay":{const w=(M,E)=>E.indexOf(M).toString();return b(C,T,i.formats.weekday,w)}case"meridiem":return b(C,T);default:return{saveQuery:!1}}})},m=g=>{const y=(x,C)=>{const T=so(x,r),w=Number(T),M=n[C.type]({currentDate:null,format:C.format,contentType:C.contentType});if(w>M.maximum)return{saveQuery:!1};if(w<M.minimum)return{saveQuery:!0};const E=w*10>M.maximum||T.length===M.maximum.toString().length;return{sectionValue:Ph(i,w,M,r,C),shouldGoToNextSection:E}};return d(g,(x,C)=>{if(C.contentType==="digit"||C.contentType==="digit-with-letter")return y(x,C);if(C.type==="month"){Eh(i,"digit","month","MM");const T=y(x,{type:C.type,format:"MM",hasLeadingZerosInInput:!0,contentType:"digit",maxLength:2});if(No(T))return T;const w=ip(i,T.sectionValue,"MM",C.format);return U({},T,{sectionValue:w})}if(C.type==="weekDay"){const T=y(x,C);if(No(T))return T;const w=Wa(i,C.format)[Number(T.sectionValue)-1];return U({},T,{sectionValue:w})}return{saveQuery:!1}},x=>sp(x,r))};return{applyCharacterEditing:Me(g=>{const y=e[g.sectionIndex],x=sp(g.keyPressed,r)?m(U({},g,{keyPressed:Ac(g.keyPressed,r)})):f(g);if(x==null){o(null);return}t({activeSection:y,newSectionValue:x.sectionValue,shouldGoToNextSection:x.shouldGoToNextSection})}),resetCharacterQuery:u}},kI=e=>{const{internalProps:{disabled:t,readOnly:n=!1},forwardedProps:{sectionListRef:r,onBlur:o,onClick:s,onFocus:i,onInput:l,onPaste:c,focused:u,autoFocus:d=!1},fieldValueManager:f,applyCharacterEditing:m,resetCharacterQuery:h,setSelectedSections:g,parsedSelectedSections:y,state:b,clearActiveSection:x,clearValue:C,updateSectionValue:T,updateValueFromValueStr:w,sectionOrder:M,areAllSectionsEmpty:E,sectionsValueBoundaries:j}=e,F=D.useRef(null),O=Ze(r,F),V=Cr(),L=It(),v=Un(),[N,A]=D.useState(!1),$=D.useMemo(()=>({syncSelectionToDOM:()=>{if(!F.current)return;const Q=document.getSelection();if(!Q)return;if(y==null){Q.rangeCount>0&&F.current.getRoot().contains(Q.getRangeAt(0).startContainer)&&Q.removeAllRanges(),N&&F.current.getRoot().blur();return}if(!F.current.getRoot().contains(on(document)))return;const ue=new window.Range;let he;y==="all"?he=F.current.getRoot():b.sections[y].type==="empty"?he=F.current.getSectionContainer(y):he=F.current.getSectionContent(y),ue.selectNodeContents(he),he.focus(),Q.removeAllRanges(),Q.addRange(ue)},getActiveSectionIndexFromDOM:()=>{const Q=on(document);return!Q||!F.current||!F.current.getRoot().contains(Q)?null:F.current.getSectionIndexFromDOMElement(Q)},focusField:(Q=0)=>{if(!F.current||$.getActiveSectionIndexFromDOM()!=null)return;const ue=Yl(Q,b.sections);A(!0),F.current.getSectionContent(ue).focus()},setSelectedSections:Q=>{if(!F.current)return;const ue=Yl(Q,b.sections);A((ue==="all"?0:ue)!==null),g(Q)},isFieldFocused:()=>{const Q=on(document);return!!F.current&&F.current.getRoot().contains(Q)}}),[y,g,b.sections,N]),R=Me(Q=>{if(!F.current)return;const ue=b.sections[Q];F.current.getSectionContent(Q).innerHTML=ue.value||ue.placeholder,$.syncSelectionToDOM()}),_=Me((Q,...ue)=>{Q.isDefaultPrevented()||!F.current||(A(!0),s?.(Q,...ue),y==="all"?setTimeout(()=>{const he=document.getSelection().getRangeAt(0).startOffset;if(he===0){g(M.startIndex);return}let de=0,Se=0;for(;Se<he&&de<b.sections.length;){const ce=b.sections[de];de+=1,Se+=`${ce.startSeparator}${ce.value||ce.placeholder}${ce.endSeparator}`.length}g(de-1)}):N?F.current.getRoot().contains(Q.target)||g(M.startIndex):(A(!0),g(M.startIndex)))}),z=Me(Q=>{if(l?.(Q),!F.current||y!=="all")return;const he=Q.target.textContent??"";F.current.getRoot().innerHTML=b.sections.map(de=>`${de.startSeparator}${de.value||de.placeholder}${de.endSeparator}`).join(""),$.syncSelectionToDOM(),he.length===0||he.charCodeAt(0)===10?(h(),C(),g("all")):he.length>1?w(he):(y==="all"&&g(0),m({keyPressed:he,sectionIndex:0}))}),W=Me(Q=>{if(c?.(Q),n||y!=="all"){Q.preventDefault();return}const ue=Q.clipboardData.getData("text");Q.preventDefault(),h(),w(ue)}),H=Me((...Q)=>{if(i?.(...Q),N||!F.current)return;A(!0),F.current.getSectionIndexFromDOMElement(on(document))!=null||g(M.startIndex)}),G=Me((...Q)=>{o?.(...Q),setTimeout(()=>{if(!F.current)return;const ue=on(document);!F.current.getRoot().contains(ue)&&(A(!1),g(null))})}),se=Me(Q=>ue=>{ue.isDefaultPrevented()||g(Q)}),pe=Me(Q=>{Q.preventDefault()}),me=Me(Q=>()=>{g(Q)}),X=Me(Q=>{if(Q.preventDefault(),n||t||typeof y!="number")return;const ue=b.sections[y],he=Q.clipboardData.getData("text"),de=/^[a-zA-Z]+$/.test(he),Se=/^[0-9]+$/.test(he),ce=/^(([a-zA-Z]+)|)([0-9]+)(([a-zA-Z]+)|)$/.test(he);ue.contentType==="letter"&&de||ue.contentType==="digit"&&Se||ue.contentType==="digit-with-letter"&&ce?(h(),T({activeSection:ue,newSectionValue:he,shouldGoToNextSection:!0})):!de&&!Se&&(h(),w(he))}),K=Me(Q=>{Q.preventDefault(),Q.dataTransfer.dropEffect="none"}),le=Me(Q=>{if(!F.current)return;const ue=Q.target,he=ue.textContent??"",de=F.current.getSectionIndexFromDOMElement(ue),Se=b.sections[de];if(n||!F.current){R(de);return}if(he.length===0){if(Se.value===""){R(de);return}const ce=Q.nativeEvent.inputType;if(ce==="insertParagraph"||ce==="insertLineBreak"){R(de);return}h(),x();return}m({keyPressed:he,sectionIndex:de}),R(de)});Wt(()=>{if(!(!N||!F.current)){if(y==="all")F.current.getRoot().focus();else if(typeof y=="number"){const Q=F.current.getSectionContent(y);Q&&Q.focus()}}},[y,N]);const oe=D.useMemo(()=>b.sections.reduce((Q,ue)=>(Q[ue.type]=j[ue.type]({currentDate:null,contentType:ue.contentType,format:ue.format}),Q),{}),[j,b.sections]),te=y==="all",Z=D.useMemo(()=>b.sections.map((Q,ue)=>{const he=!te&&!t&&!n;return{container:{"data-sectionindex":ue,onClick:se(ue)},content:{tabIndex:te||ue>0?-1:0,contentEditable:!te&&!t&&!n,role:"spinbutton",id:`${v}-${Q.type}`,"aria-labelledby":`${v}-${Q.type}`,"aria-readonly":n,"aria-valuenow":$S(Q,L),"aria-valuemin":oe[Q.type].minimum,"aria-valuemax":oe[Q.type].maximum,"aria-valuetext":Q.value?jS(Q,L):V.empty,"aria-label":V[Q.type],"aria-disabled":t,spellCheck:he?!1:void 0,autoCapitalize:he?"off":void 0,autoCorrect:he?"off":void 0,[parseInt(D.version,10)>=17?"enterKeyHint":"enterkeyhint"]:he?"next":void 0,children:Q.value||Q.placeholder,onInput:le,onPaste:X,onFocus:me(ue),onDragOver:K,onMouseUp:pe,inputMode:Q.contentType==="letter"?"text":"numeric"},before:{children:Q.startSeparator},after:{children:Q.endSeparator}}}),[b.sections,me,X,K,le,se,pe,t,n,te,V,L,oe,v]),J=Me(Q=>{w(Q.target.value)}),ae=D.useMemo(()=>E?"":f.getV7HiddenInputValueFromSections(b.sections),[E,b.sections,f]);return D.useEffect(()=>{if(F.current==null)throw new Error(["MUI X: The `sectionListRef` prop has not been initialized by `PickersSectionList`","You probably tried to pass a component to the `textField` slot that contains an `<input />` element instead of a `PickersSectionList`.","","If you want to keep using an `<input />` HTML element for the editing, please remove the `enableAccessibleFieldDOMStructure` prop from your picker or field component:","","<DatePicker slots={{ textField: MyCustomTextField }} />","","Learn more about the field accessible DOM structure on the MUI documentation: https://mui.com/x/react-date-pickers/fields/#fields-to-edit-a-single-element"].join(`
130
+ `));d&&F.current&&F.current.getSectionContent(M.startIndex).focus()},[]),{interactions:$,returnedValue:{autoFocus:d,readOnly:n,focused:u??N,sectionListRef:O,onBlur:G,onClick:_,onFocus:H,onInput:z,onPaste:W,enableAccessibleFieldDOMStructure:!0,elements:Z,tabIndex:y===0?-1:0,contentEditable:te,value:ae,onChange:J,areAllSectionsEmpty:E}}},_o=e=>e.replace(/[\u2066\u2067\u2068\u2069]/g,""),TI=(e,t,n)=>{let r=0,o=n?1:0;const s=[];for(let i=0;i<e.length;i+=1){const l=e[i],c=Fc(l,n?"input-rtl":"input-ltr",t),u=`${l.startSeparator}${c}${l.endSeparator}`,d=_o(u).length,f=u.length,m=_o(c),h=o+(m===""?0:c.indexOf(m[0]))+l.startSeparator.length,g=h+m.length;s.push(U({},l,{start:r,end:r+d,startInInput:h,endInInput:g})),r+=d,o+=f}return s},II=e=>{const t=An(),n=D.useRef(void 0),r=D.useRef(void 0),{forwardedProps:{onFocus:o,onClick:s,onPaste:i,onBlur:l,inputRef:c,placeholder:u},internalProps:{readOnly:d=!1,disabled:f=!1},parsedSelectedSections:m,activeSectionIndex:h,state:g,fieldValueManager:y,valueManager:b,applyCharacterEditing:x,resetCharacterQuery:C,updateSectionValue:T,updateValueFromValueStr:w,clearActiveSection:M,clearValue:E,setTempAndroidValueStr:j,setSelectedSections:F,getSectionsFromValue:O,areAllSectionsEmpty:V,localizedDigits:L}=e,v=D.useRef(null),N=Ze(c,v),A=D.useMemo(()=>TI(g.sections,L,t),[g.sections,L,t]),$=D.useMemo(()=>({syncSelectionToDOM:()=>{if(!v.current)return;if(m==null){v.current.scrollLeft&&(v.current.scrollLeft=0);return}if(v.current!==on(document))return;const le=v.current.scrollTop;if(m==="all")v.current.select();else{const oe=A[m],te=oe.type==="empty"?oe.startInInput-oe.startSeparator.length:oe.startInInput,Z=oe.type==="empty"?oe.endInInput+oe.endSeparator.length:oe.endInInput;(te!==v.current.selectionStart||Z!==v.current.selectionEnd)&&v.current===on(document)&&v.current.setSelectionRange(te,Z),clearTimeout(r.current),r.current=setTimeout(()=>{v.current&&v.current===on(document)&&v.current.selectionStart===v.current.selectionEnd&&(v.current.selectionStart!==te||v.current.selectionEnd!==Z)&&$.syncSelectionToDOM()})}v.current.scrollTop=le},getActiveSectionIndexFromDOM:()=>{const le=v.current.selectionStart??0,oe=v.current.selectionEnd??0;if(le===0&&oe===0)return null;const te=le<=A[0].startInInput?1:A.findIndex(Z=>Z.startInInput-Z.startSeparator.length>le);return te===-1?A.length-1:te-1},focusField:(le=0)=>{on(document)!==v.current&&(v.current?.focus(),F(le))},setSelectedSections:le=>F(le),isFieldFocused:()=>v.current===on(document)}),[v,m,A,F]),R=()=>{const le=v.current.selectionStart??0;let oe;le<=A[0].startInInput||le>=A[A.length-1].endInInput?oe=1:oe=A.findIndex(Z=>Z.startInInput-Z.startSeparator.length>le);const te=oe===-1?A.length-1:oe-1;F(te)},_=Me((...le)=>{o?.(...le);const oe=v.current;clearTimeout(n.current),n.current=setTimeout(()=>{!oe||oe!==v.current||h==null&&(oe.value.length&&Number(oe.selectionEnd)-Number(oe.selectionStart)===oe.value.length?F("all"):R())})}),z=Me((le,...oe)=>{le.isDefaultPrevented()||(s?.(le,...oe),R())}),W=Me(le=>{if(i?.(le),le.preventDefault(),d||f)return;const oe=le.clipboardData.getData("text");if(typeof m=="number"){const te=g.sections[m],Z=/^[a-zA-Z]+$/.test(oe),J=/^[0-9]+$/.test(oe),ae=/^(([a-zA-Z]+)|)([0-9]+)(([a-zA-Z]+)|)$/.test(oe);if(te.contentType==="letter"&&Z||te.contentType==="digit"&&J||te.contentType==="digit-with-letter"&&ae){C(),T({activeSection:te,newSectionValue:oe,shouldGoToNextSection:!0});return}if(Z||J)return}C(),w(oe)}),H=Me((...le)=>{l?.(...le),F(null)}),G=Me(le=>{if(d)return;const oe=le.target.value;if(oe===""){C(),E();return}const te=le.nativeEvent.data,Z=te&&te.length>1,J=Z?te:oe,ae=_o(J);if(m==="all"&&F(h),h==null||Z){w(Z?te:ae);return}let Q;if(m==="all"&&ae.length===1)Q=ae;else{const ue=_o(y.getV6InputValueFromSections(A,L,t));let he=-1,de=-1;for(let Ce=0;Ce<ue.length;Ce+=1)he===-1&&ue[Ce]!==ae[Ce]&&(he=Ce),de===-1&&ue[ue.length-Ce-1]!==ae[ae.length-Ce-1]&&(de=Ce);const Se=A[h];if(he<Se.start||ue.length-de-1>Se.end)return;const Pe=ae.length-ue.length+Se.end-_o(Se.endSeparator||"").length;Q=ae.slice(Se.start+_o(Se.startSeparator||"").length,Pe)}if(Q.length===0){OS()&&j(J),C(),M();return}x({keyPressed:Q,sectionIndex:h})}),se=D.useMemo(()=>u!==void 0?u:y.getV6InputValueFromSections(O(b.emptyValue),L,t),[u,y,O,b.emptyValue,L,t]),pe=D.useMemo(()=>g.tempValueStrAndroid??y.getV6InputValueFromSections(g.sections,L,t),[g.sections,y,g.tempValueStrAndroid,L,t]);D.useEffect(()=>(v.current&&v.current===on(document)&&F("all"),()=>{clearTimeout(n.current),clearTimeout(r.current)}),[]);const me=D.useMemo(()=>h==null||g.sections[h].contentType==="letter"?"text":"numeric",[h,g.sections]),K=!(v.current&&v.current===on(document))&&V;return{interactions:$,returnedValue:{readOnly:d,onBlur:H,onClick:z,onFocus:_,onPaste:W,inputRef:N,enableAccessibleFieldDOMStructure:!1,placeholder:se,inputMode:me,autoComplete:"off",value:K?"":pe,onChange:G}}},MI=e=>{const t=It(),{internalProps:n,internalProps:{unstableFieldRef:r,minutesStep:o,enableAccessibleFieldDOMStructure:s=!1,disabled:i=!1,readOnly:l=!1},forwardedProps:{onKeyDown:c,error:u,clearable:d,onClear:f},fieldValueManager:m,valueManager:h,validator:g}=e,y=An(),b=SI(e),{state:x,activeSectionIndex:C,parsedSelectedSections:T,setSelectedSections:w,clearValue:M,clearActiveSection:E,updateSectionValue:j,setTempAndroidValueStr:F,sectionsValueBoundaries:O,localizedDigits:V,timezone:L}=b,v=wI({sections:x.sections,updateSectionValue:j,sectionsValueBoundaries:O,localizedDigits:V,setTempAndroidValueStr:F,timezone:L}),{resetCharacterQuery:N}=v,A=h.areValuesEqual(t,x.value,h.emptyValue),$=s?kI:II,R=D.useMemo(()=>RS(x.sections,y&&!s),[x.sections,y,s]),{returnedValue:_,interactions:z}=$(U({},e,b,v,{areAllSectionsEmpty:A,sectionOrder:R})),W=Me(X=>{if(c?.(X),!i)switch(!0){case((X.ctrlKey||X.metaKey)&&String.fromCharCode(X.keyCode)==="A"&&!X.shiftKey&&!X.altKey):{X.preventDefault(),w("all");break}case X.key==="ArrowRight":{if(X.preventDefault(),T==null)w(R.startIndex);else if(T==="all")w(R.endIndex);else{const K=R.neighbors[T].rightIndex;K!==null&&w(K)}break}case X.key==="ArrowLeft":{if(X.preventDefault(),T==null)w(R.endIndex);else if(T==="all")w(R.startIndex);else{const K=R.neighbors[T].leftIndex;K!==null&&w(K)}break}case X.key==="Delete":{if(X.preventDefault(),l)break;T==null||T==="all"?M():E(),N();break}case["ArrowUp","ArrowDown","Home","End","PageUp","PageDown"].includes(X.key):{if(X.preventDefault(),l||C==null)break;T==="all"&&w(C);const K=x.sections[C],le=m.getActiveDateManager(t,x,K),oe=kS(t,L,K,X.key,O,V,le.date,{minutesStep:o});j({activeSection:K,newSectionValue:oe,shouldGoToNextSection:!1});break}}});Wt(()=>{z.syncSelectionToDOM()});const{hasValidationError:H}=Fh({props:n,validator:g,timezone:L,value:x.value,onError:n.onError}),G=D.useMemo(()=>u!==void 0?u:H,[H,u]);D.useEffect(()=>{!G&&C==null&&N()},[x.referenceValue,C,G]),D.useEffect(()=>{x.tempValueStrAndroid!=null&&C!=null&&(N(),E())},[x.sections]),D.useImperativeHandle(r,()=>({getSections:()=>x.sections,getActiveSectionIndex:z.getActiveSectionIndexFromDOM,setSelectedSections:z.setSelectedSections,focusField:z.focusField,isFieldFocused:z.isFieldFocused}));const se=Me((X,...K)=>{X.preventDefault(),f?.(X,...K),M(),z.isFieldFocused()?w(R.startIndex):z.focusField(0)}),pe={onKeyDown:W,onClear:se,error:G,clearable:!!(d&&!A&&!l&&!i)},me={disabled:i,readOnly:l};return U({},e.forwardedProps,pe,me,_)},DI=["clearable","onClear","InputProps","sx","slots","slotProps"],PI=["ownerState"],EI=e=>{const t=Cr(),{clearable:n,onClear:r,InputProps:o,sx:s,slots:i,slotProps:l}=e,c=Fe(e,DI),u=i?.clearButton??Nn,d=Ge({elementType:u,externalSlotProps:l?.clearButton,ownerState:{},className:"clearButton",additionalProps:{title:t.fieldClearLabel}}),f=Fe(d,PI),m=i?.clearIcon??Bk,h=Ge({elementType:m,externalSlotProps:l?.clearIcon,ownerState:{}});return U({},c,{InputProps:U({},o,{endAdornment:a.jsxs(D.Fragment,{children:[n&&a.jsx(Nh,{position:"end",sx:{marginRight:o?.endAdornment?-1:-1.5},children:a.jsx(u,U({},f,{onClick:r,children:a.jsx(m,U({fontSize:"small"},h))}))}),o?.endAdornment]})}),sx:[{"& .clearButton":{opacity:1},"@media (pointer: fine)":{"& .clearButton":{opacity:0},"&:hover, &:focus-within":{".clearButton":{opacity:1}}}},...Array.isArray(s)?s:[s]]})},OI=["value","defaultValue","referenceDate","format","formatDensity","onChange","timezone","onError","shouldRespectLeadingZeros","selectedSections","onSelectedSectionsChange","unstableFieldRef","enableAccessibleFieldDOMStructure","disabled","readOnly","dateSeparator"],RI=(e,t)=>D.useMemo(()=>{const n=U({},e),r={},o=s=>{n.hasOwnProperty(s)&&(r[s]=n[s],delete n[s])};return OI.forEach(o),$h.forEach(o),{forwardedProps:n,internalProps:r}},[e,t]),jI=e=>{const t=It(),n=Si();return U({},e,{disablePast:e.disablePast??!1,disableFuture:e.disableFuture??!1,format:e.format??t.formats.keyboardDate,minDate:Pn(t,e.minDate,n.minDate),maxDate:Pn(t,e.maxDate,n.maxDate)})},$I=e=>{const t=jI(e),{forwardedProps:n,internalProps:r}=RI(t,"date");return MI({forwardedProps:n,internalProps:r,valueManager:or,fieldValueManager:FS,validator:Ci,valueType:"date"})};function AI(e){return $e("MuiPickersTextField",e)}Ee("MuiPickersTextField",["root","focused","disabled","error","required"]);function FI(e){return $e("MuiPickersInputBase",e)}const Yo=Ee("MuiPickersInputBase",["root","focused","disabled","error","notchedOutline","sectionContent","sectionBefore","sectionAfter","adornedStart","adornedEnd","input"]);function NI(e){return $e("MuiPickersSectionList",e)}const Ms=Ee("MuiPickersSectionList",["root","section","sectionContent"]),LI=["slots","slotProps","elements","sectionListRef"],gm=re("div",{name:"MuiPickersSectionList",slot:"Root",overridesResolver:(e,t)=>t.root})({direction:"ltr /*! @noflip */",outline:"none"}),ym=re("span",{name:"MuiPickersSectionList",slot:"Section",overridesResolver:(e,t)=>t.section})({}),bm=re("span",{name:"MuiPickersSectionList",slot:"SectionSeparator",overridesResolver:(e,t)=>t.sectionSeparator})({whiteSpace:"pre"}),xm=re("span",{name:"MuiPickersSectionList",slot:"SectionContent",overridesResolver:(e,t)=>t.sectionContent})({outline:"none"}),BI=e=>{const{classes:t}=e;return Re({root:["root"],section:["section"],sectionContent:["sectionContent"]},NI,t)};function VI(e){const{slots:t,slotProps:n,element:r,classes:o}=e,s=t?.section??ym,i=Ge({elementType:s,externalSlotProps:n?.section,externalForwardedProps:r.container,className:o.section,ownerState:{}}),l=t?.sectionContent??xm,c=Ge({elementType:l,externalSlotProps:n?.sectionContent,externalForwardedProps:r.content,additionalProps:{suppressContentEditableWarning:!0},className:o.sectionContent,ownerState:{}}),u=t?.sectionSeparator??bm,d=Ge({elementType:u,externalSlotProps:n?.sectionSeparator,externalForwardedProps:r.before,ownerState:{position:"before"}}),f=Ge({elementType:u,externalSlotProps:n?.sectionSeparator,externalForwardedProps:r.after,ownerState:{position:"after"}});return a.jsxs(s,U({},i,{children:[a.jsx(u,U({},d)),a.jsx(l,U({},c)),a.jsx(u,U({},f))]}))}const zI=D.forwardRef(function(t,n){const r=wt({props:t,name:"MuiPickersSectionList"}),{slots:o,slotProps:s,elements:i,sectionListRef:l}=r,c=Fe(r,LI),u=BI(r),d=D.useRef(null),f=Ze(n,d),m=y=>{if(!d.current)throw new Error(`MUI X: Cannot call sectionListRef.${y} before the mount of the component.`);return d.current};D.useImperativeHandle(l,()=>({getRoot(){return m("getRoot")},getSectionContainer(y){return m("getSectionContainer").querySelector(`.${Ms.section}[data-sectionindex="${y}"]`)},getSectionContent(y){return m("getSectionContent").querySelector(`.${Ms.section}[data-sectionindex="${y}"] .${Ms.sectionContent}`)},getSectionIndexFromDOMElement(y){const b=m("getSectionIndexFromDOMElement");if(y==null||!b.contains(y))return null;let x=null;return y.classList.contains(Ms.section)?x=y:y.classList.contains(Ms.sectionContent)&&(x=y.parentElement),x==null?null:Number(x.dataset.sectionindex)}}));const h=o?.root??gm,g=Ge({elementType:h,externalSlotProps:s?.root,externalForwardedProps:c,additionalProps:{ref:f,suppressContentEditableWarning:!0},className:u.root,ownerState:{}});return a.jsx(h,U({},g,{children:g.contentEditable?i.map(({content:y,before:b,after:x})=>`${b.children}${y.children}${x.children}`).join(""):a.jsx(D.Fragment,{children:i.map((y,b)=>a.jsx(VI,{slots:o,slotProps:s,element:y,classes:u},b))})}))}),_I=["elements","areAllSectionsEmpty","defaultValue","label","value","onChange","id","autoFocus","endAdornment","startAdornment","renderSuffix","slots","slotProps","contentEditable","tabIndex","onInput","onPaste","onKeyDown","fullWidth","name","readOnly","inputProps","inputRef","sectionListRef"],WI=e=>Math.round(e*1e5)/1e5,Ja=re("div",{name:"MuiPickersInputBase",slot:"Root",overridesResolver:(e,t)=>t.root})(({theme:e})=>U({},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:`${WI(.15/16)}em`,variants:[{props:{fullWidth:!0},style:{width:"100%"}}]})),ou=re(gm,{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}}]})),HI=re(ym,{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"})),UI=re(xm,{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"})),qI=re(bm,{name:"MuiPickersInputBase",slot:"Separator",overridesResolver:(e,t)=>t.separator})(()=>({whiteSpace:"pre",letterSpacing:"inherit"})),YI=re("input",{name:"MuiPickersInputBase",slot:"Input",overridesResolver:(e,t)=>t.hiddenInput})(U({},uS)),KI=e=>{const{focused:t,disabled:n,error:r,classes:o,fullWidth:s,readOnly:i,color:l,size:c,endAdornment:u,startAdornment:d}=e,f={root:["root",t&&!n&&"focused",n&&"disabled",i&&"readOnly",r&&"error",s&&"fullWidth",`color${ve(l)}`,c==="small"&&"inputSizeSmall",!!d&&"adornedStart",!!u&&"adornedEnd"],notchedOutline:["notchedOutline"],input:["input"],sectionsContainer:["sectionsContainer"],sectionContent:["sectionContent"],sectionBefore:["sectionBefore"],sectionAfter:["sectionAfter"]};return Re(f,FI,o)},su=D.forwardRef(function(t,n){const r=wt({props:t,name:"MuiPickersInputBase"}),{elements:o,areAllSectionsEmpty:s,value:i,onChange:l,id:c,endAdornment:u,startAdornment:d,renderSuffix:f,slots:m,slotProps:h,contentEditable:g,tabIndex:y,onInput:b,onPaste:x,onKeyDown:C,name:T,readOnly:w,inputProps:M,inputRef:E,sectionListRef:j}=r,F=Fe(r,_I),O=D.useRef(null),V=Ze(n,O),L=Ze(M?.ref,E),v=An(),N=yn();if(!N)throw new Error("MUI X: PickersInputBase should always be used inside a PickersTextField component");const A=H=>{if(N.disabled){H.stopPropagation();return}N.onFocus?.(H)};D.useEffect(()=>{N&&N.setAdornedStart(!!d)},[N,d]),D.useEffect(()=>{N&&(s?N.onEmpty():N.onFilled())},[N,s]);const $=U({},r,N,{isRtl:v}),R=KI($),_=m?.root||Ja,z=Ge({elementType:_,externalSlotProps:h?.root,externalForwardedProps:F,additionalProps:{"aria-invalid":N.error,ref:V},className:R.root,ownerState:$}),W=m?.input||ou;return a.jsxs(_,U({},z,{children:[d,a.jsx(zI,{sectionListRef:j,elements:o,contentEditable:g,tabIndex:y,className:R.sectionsContainer,onFocus:A,onBlur:N.onBlur,onInput:b,onPaste:x,onKeyDown:C,slots:{root:W,section:HI,sectionContent:UI,sectionSeparator:qI},slotProps:{root:{ownerState:$},sectionContent:{className:Yo.sectionContent},sectionSeparator:({position:H})=>({className:H==="before"?Yo.sectionBefore:Yo.sectionAfter})}}),u,f?f(U({},N)):null,a.jsx(YI,U({name:T,className:R.input,value:i,onChange:l,id:c,"aria-hidden":"true",tabIndex:-1,readOnly:w,required:N.required,disabled:N.disabled},M,{ref:L}))]}))});function GI(e){return $e("MuiPickersOutlinedInput",e)}const _n=U({},Yo,Ee("MuiPickersOutlinedInput",["root","notchedOutline","input"])),ZI=["children","className","label","notched","shrink"],XI=re("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}}),Yp=re("span")(({theme:e})=>({fontFamily:e.typography.fontFamily,fontSize:"inherit"})),QI=re("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 JI(e){const{className:t,label:n}=e,r=Fe(e,ZI),o=n!=null&&n!=="",s=U({},e,{withLabel:o});return a.jsx(XI,U({"aria-hidden":!0,className:t},r,{ownerState:s,children:a.jsx(QI,{ownerState:s,children:o?a.jsx(Yp,{children:n}):a.jsx(Yp,{className:"notranslate",children:"​"})})}))}const eM=["label","autoFocus","ownerState","notched"],tM=re(Ja,{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 .${_n.notchedOutline}`]:{borderColor:(e.vars||e).palette.text.primary},"@media (hover: none)":{[`&:hover .${_n.notchedOutline}`]:{borderColor:e.vars?`rgba(${e.vars.palette.common.onBackgroundChannel} / 0.23)`:t}},[`&.${_n.focused} .${_n.notchedOutline}`]:{borderStyle:"solid",borderWidth:2},[`&.${_n.disabled}`]:{[`& .${_n.notchedOutline}`]:{borderColor:(e.vars||e).palette.action.disabled},"*":{color:(e.vars||e).palette.action.disabled}},[`&.${_n.error} .${_n.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:{[`&.${_n.focused}:not(.${_n.error}) .${_n.notchedOutline}`]:{borderColor:(e.vars||e).palette[n].main}}}))}}),nM=re(ou,{name:"MuiPickersOutlinedInput",slot:"SectionsContainer",overridesResolver:(e,t)=>t.sectionsContainer})({padding:"16.5px 0",variants:[{props:{size:"small"},style:{padding:"8.5px 0"}}]}),rM=e=>{const{classes:t}=e,r=Re({root:["root"],notchedOutline:["notchedOutline"],input:["input"]},GI,t);return U({},t,r)},vm=D.forwardRef(function(t,n){const r=wt({props:t,name:"MuiPickersOutlinedInput"}),{label:o,ownerState:s,notched:i}=r,l=Fe(r,eM),c=yn(),u=U({},r,s,c,{color:c?.color||"primary"}),d=rM(u);return a.jsx(su,U({slots:{root:tM,input:nM},renderSuffix:f=>a.jsx(JI,{shrink:!!(i||f.adornedStart||f.focused||f.filled),notched:!!(i||f.adornedStart||f.focused||f.filled),className:d.notchedOutline,label:o!=null&&o!==""&&c?.required?a.jsxs(D.Fragment,{children:[o," ","*"]}):o,ownerState:u})},l,{label:o,classes:d,ref:n}))});vm.muiName="Input";function oM(e){return $e("MuiPickersFilledInput",e)}const qr=U({},Yo,Ee("MuiPickersFilledInput",["root","underline","input"])),sM=["label","autoFocus","disableUnderline","ownerState"],iM=re(Ja,{name:"MuiPickersFilledInput",slot:"Root",overridesResolver:(e,t)=>t.root,shouldForwardProp:e=>st.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}},[`&.${qr.focused}`]:{backgroundColor:e.vars?e.vars.palette.FilledInput.bg:r},[`&.${qr.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"},[`&.${qr.focused}:after`]:{transform:"scaleX(1) translateX(0)"},[`&.${qr.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(.${qr.disabled}, .${qr.error}):before`]:{borderBottom:`1px solid ${(e.vars||e).palette.text.primary}`},[`&.${qr.disabled}:before`]:{borderBottomStyle:"dotted"}}},{props:({startAdornment:i})=>!!i,style:{paddingLeft:12}},{props:({endAdornment:i})=>!!i,style:{paddingRight:12}}]}}),aM=re(ou,{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}}]}),lM=e=>{const{classes:t,disableUnderline:n}=e,o=Re({root:["root",!n&&"underline"],input:["input"]},oM,t);return U({},t,o)},Sm=D.forwardRef(function(t,n){const r=wt({props:t,name:"MuiPickersFilledInput"}),{label:o,disableUnderline:s=!1,ownerState:i}=r,l=Fe(r,sM),c=yn(),u=U({},r,i,c,{color:c?.color||"primary"}),d=lM(u);return a.jsx(su,U({slots:{root:iM,input:aM},slotProps:{root:{disableUnderline:s}}},l,{label:o,classes:d,ref:n}))});Sm.muiName="Input";function cM(e){return $e("MuiPickersFilledInput",e)}const Ds=U({},Yo,Ee("MuiPickersInput",["root","input"])),uM=["label","autoFocus","disableUnderline","ownerState"],dM=re(Ja,{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"},[`&.${Ds.focused}:after`]:{transform:"scaleX(1) translateX(0)"},[`&.${Ds.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(.${Ds.disabled}, .${Ds.error}):before`]:{borderBottom:`2px solid ${(e.vars||e).palette.text.primary}`,"@media (hover: none)":{borderBottom:`1px solid ${n}`}},[`&.${Ds.disabled}:before`]:{borderBottomStyle:"dotted"}}}]}}),pM=e=>{const{classes:t,disableUnderline:n}=e,o=Re({root:["root",!n&&"underline"],input:["input"]},cM,t);return U({},t,o)},Cm=D.forwardRef(function(t,n){const r=wt({props:t,name:"MuiPickersInput"}),{label:o,disableUnderline:s=!1,ownerState:i}=r,l=Fe(r,uM),c=yn(),u=U({},r,i,c,{disableUnderline:s,color:c?.color||"primary"}),d=pM(u);return a.jsx(su,U({slots:{root:dM}},l,{label:o,classes:d,ref:n}))});Cm.muiName="Input";const fM=["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"],hM={standard:Cm,filled:Sm,outlined:vm},mM=re(Ta,{name:"MuiPickersTextField",slot:"Root",overridesResolver:(e,t)=>t.root})({maxWidth:"100%"}),gM=e=>{const{focused:t,disabled:n,classes:r,required:o}=e;return Re({root:["root",t&&!n&&"focused",n&&"disabled",o&&"required"]},AI,r)},yM=D.forwardRef(function(t,n){const r=wt({props:t,name:"MuiPickersTextField"}),{onFocus:o,onBlur:s,className:i,color:l="primary",disabled:c=!1,error:u=!1,variant:d="outlined",required:f=!1,InputProps:m,inputProps:h,inputRef:g,sectionListRef:y,elements:b,areAllSectionsEmpty:x,onClick:C,onKeyDown:T,onKeyUp:w,onPaste:M,onInput:E,endAdornment:j,startAdornment:F,tabIndex:O,contentEditable:V,focused:L,value:v,onChange:N,fullWidth:A,id:$,name:R,helperText:_,FormHelperTextProps:z,label:W,InputLabelProps:H}=r,G=Fe(r,fM),se=D.useRef(null),pe=Ze(n,se),me=Un($),X=_&&me?`${me}-helper-text`:void 0,K=W&&me?`${me}-label`:void 0,le=U({},r,{color:l,disabled:c,error:u,focused:L,required:f,variant:d}),oe=gM(le),te=hM[d];return a.jsxs(mM,U({className:Te(oe.root,i),ref:pe,focused:L,onFocus:o,onBlur:s,disabled:c,variant:d,error:u,color:l,fullWidth:A,required:f,ownerState:le},G,{children:[a.jsx(ka,U({htmlFor:me,id:K},H,{children:W})),a.jsx(te,U({elements:b,areAllSectionsEmpty:x,onClick:C,onKeyDown:T,onKeyUp:w,onInput:E,onPaste:M,endAdornment:j,startAdornment:F,tabIndex:O,contentEditable:V,value:v,onChange:N,id:me,fullWidth:A,inputProps:h,inputRef:g,sectionListRef:y,label:W,name:R,role:"group","aria-labelledby":K,"aria-describedby":X,"aria-live":X?"polite":void 0},m)),_&&a.jsx(am,U({id:X},z,{children:_}))]}))}),bM=["enableAccessibleFieldDOMStructure"],xM=["InputProps","readOnly"],vM=["onPaste","onKeyDown","inputMode","readOnly","InputProps","inputProps","inputRef"],SM=e=>{let{enableAccessibleFieldDOMStructure:t}=e,n=Fe(e,bM);if(t){const{InputProps:f,readOnly:m}=n,h=Fe(n,xM);return U({},h,{InputProps:U({},f??{},{readOnly:m})})}const{onPaste:r,onKeyDown:o,inputMode:s,readOnly:i,InputProps:l,inputProps:c,inputRef:u}=n,d=Fe(n,vM);return U({},d,{InputProps:U({},l??{},{readOnly:i}),inputProps:U({},c??{},{inputMode:s,onPaste:r,onKeyDown:o,ref:u})})},CM=["slots","slotProps","InputProps","inputProps"],wm=D.forwardRef(function(t,n){const r=wt({props:t,name:"MuiDateField"}),{slots:o,slotProps:s,InputProps:i,inputProps:l}=r,c=Fe(r,CM),u=r,d=o?.textField??(t.enableAccessibleFieldDOMStructure?yM:Ke),f=Ge({elementType:d,externalSlotProps:s?.textField,externalForwardedProps:c,additionalProps:{ref:n},ownerState:u});f.inputProps=U({},l,f.inputProps),f.InputProps=U({},i,f.InputProps);const m=$I(f),h=SM(m),g=EI(U({},h,{slots:o,slotProps:s}));return a.jsx(d,U({},g))}),km=({shouldDisableDate:e,shouldDisableMonth:t,shouldDisableYear:n,minDate:r,maxDate:o,disableFuture:s,disablePast:i,timezone:l})=>{const c=uo();return D.useCallback(u=>Ci({adapter:c,value:u,timezone:l,props:{shouldDisableDate:e,shouldDisableMonth:t,shouldDisableYear:n,minDate:r,maxDate:o,disableFuture:s,disablePast:i}})!==null,[c,e,t,n,r,o,s,i,l])},wM=(e,t,n)=>(r,o)=>{switch(o.type){case"changeMonth":return U({},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))),U({},r,{currentMonth:i})}case"finishMonthSwitchingAnimation":return U({},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 U({},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")}},kM=e=>{const{value:t,referenceDate:n,disableFuture:r,disablePast:o,disableSwitchToMonthOnDayFocus:s=!1,maxDate:i,minDate:l,onMonthChange:c,reduceAnimations:u,shouldDisableDate:d,timezone:f}=e,m=It(),h=D.useRef(wM(!!u,s,m)).current,g=D.useMemo(()=>or.getInitialReferenceValue({value:t,utils:m,timezone:f,props:e,referenceDate:n,granularity:er.day}),[n,f]),[y,b]=D.useReducer(h,{isMonthSwitchingAnimating:!1,focusedDay:g,currentMonth:m.startOfMonth(g),slideDirection:"left"});D.useEffect(()=>{b({type:"changeMonthTimezone",newTimezone:m.getTimezone(g)})},[g,m]);const x=D.useCallback(E=>{b(U({type:"changeMonth"},E)),c&&c(E.newMonth)},[c]),C=D.useCallback(E=>{const j=E;m.isSameMonth(j,y.currentMonth)||x({newMonth:m.startOfMonth(j),direction:m.isAfterDay(j,y.currentMonth)?"left":"right"})},[y.currentMonth,x,m]),T=km({shouldDisableDate:d,minDate:l,maxDate:i,disableFuture:r,disablePast:o,timezone:f}),w=D.useCallback(()=>{b({type:"finishMonthSwitchingAnimation"})},[]),M=Me((E,j)=>{T(E)||b({type:"changeFocusedDay",focusedDay:E,withoutMonthSwitchingAnimation:j})});return{referenceDate:g,calendarState:y,changeMonth:C,changeFocusedDay:M,isDateDisabled:T,onMonthSwitchingAnimationEnd:w,handleChangeMonth:x}},TM=e=>$e("MuiPickersFadeTransitionGroup",e);Ee("MuiPickersFadeTransitionGroup",["root"]);const IM=e=>{const{classes:t}=e;return Re({root:["root"]},TM,t)},MM=re(wi,{name:"MuiPickersFadeTransitionGroup",slot:"Root",overridesResolver:(e,t)=>t.root})({display:"block",position:"relative"});function Tm(e){const t=wt({props:e,name:"MuiPickersFadeTransitionGroup"}),{children:n,className:r,reduceAnimations:o,transKey:s}=t,i=IM(t),l=$r();return o?n:a.jsx(MM,{className:Te(i.root,r),children:a.jsx(ao,{appear:!1,mountOnEnter:!0,unmountOnExit:!0,timeout:{appear:l.transitions.duration.enteringScreen,enter:l.transitions.duration.enteringScreen,exit:0},children:n},s)})}function DM(e){return $e("MuiPickersDay",e)}const Yr=Ee("MuiPickersDay",["root","dayWithMargin","dayOutsideMonth","hiddenDaySpacingFiller","today","selected","disabled"]),PM=["autoFocus","className","day","disabled","disableHighlightToday","disableMargin","hidden","isAnimating","onClick","onDaySelect","onFocus","onBlur","onKeyDown","onMouseDown","onMouseEnter","outsideCurrentMonth","selected","showDaysOutsideCurrentMonth","children","today","isFirstVisibleCell","isLastVisibleCell"],EM=e=>{const{selected:t,disableMargin:n,disableHighlightToday:r,today:o,disabled:s,outsideCurrentMonth:i,showDaysOutsideCurrentMonth:l,classes:c}=e,u=i&&!l;return Re({root:["root",t&&!u&&"selected",s&&"disabled",!n&&"dayWithMargin",!r&&o&&"today",i&&l&&"dayOutsideMonth",u&&"hiddenDaySpacingFiller"],hiddenDaySpacingFiller:["hiddenDaySpacingFiller"]},DM,c)},Im=({theme:e})=>U({},e.typography.caption,{width:ci,height:ci,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})`:st.alpha(e.palette.primary.main,e.palette.action.hoverOpacity)}},"&:focus":{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / ${e.vars.palette.action.focusOpacity})`:st.alpha(e.palette.primary.main,e.palette.action.focusOpacity),[`&.${Yr.selected}`]:{willChange:"background-color",backgroundColor:(e.vars||e).palette.primary.dark}},[`&.${Yr.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}},[`&.${Yr.disabled}:not(.${Yr.selected})`]:{color:(e.vars||e).palette.text.disabled},[`&.${Yr.disabled}&.${Yr.selected}`]:{opacity:.6},variants:[{props:{disableMargin:!1},style:{margin:`0 ${Ya}px`}},{props:{outsideCurrentMonth:!0,showDaysOutsideCurrentMonth:!0},style:{color:(e.vars||e).palette.text.secondary}},{props:{disableHighlightToday:!1,today:!0},style:{[`&:not(.${Yr.selected})`]:{border:`1px solid ${(e.vars||e).palette.text.secondary}`}}}]}),Mm=(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]},OM=re(io,{name:"MuiPickersDay",slot:"Root",overridesResolver:Mm})(Im),RM=re("div",{name:"MuiPickersDay",slot:"Root",overridesResolver:Mm})(({theme:e})=>U({},Im({theme:e}),{opacity:0,pointerEvents:"none"})),Ps=()=>{},jM=D.forwardRef(function(t,n){const r=wt({props:t,name:"MuiPickersDay"}),{autoFocus:o=!1,className:s,day:i,disabled:l=!1,disableHighlightToday:c=!1,disableMargin:u=!1,isAnimating:d,onClick:f,onDaySelect:m,onFocus:h=Ps,onBlur:g=Ps,onKeyDown:y=Ps,onMouseDown:b=Ps,onMouseEnter:x=Ps,outsideCurrentMonth:C,selected:T=!1,showDaysOutsideCurrentMonth:w=!1,children:M,today:E=!1}=r,j=Fe(r,PM),F=U({},r,{autoFocus:o,disabled:l,disableHighlightToday:c,disableMargin:u,selected:T,showDaysOutsideCurrentMonth:w,today:E}),O=EM(F),V=It(),L=D.useRef(null),v=Ze(L,n);Wt(()=>{o&&!l&&!d&&!C&&L.current.focus()},[o,l,d,C]);const N=$=>{b($),C&&$.preventDefault()},A=$=>{l||m(i),C&&$.currentTarget.focus(),f&&f($)};return C&&!w?a.jsx(RM,{className:Te(O.root,O.hiddenDaySpacingFiller,s),ownerState:F,role:j.role}):a.jsx(OM,U({className:Te(O.root,s),ref:v,centerRipple:!0,disabled:l,tabIndex:T?0:-1,onKeyDown:$=>y($,i),onFocus:$=>h($,i),onBlur:$=>g($,i),onMouseEnter:$=>x($,i),onClick:A,onMouseDown:N},j,{ownerState:F,children:M||V.format(i,"dayOfMonth")}))}),$M=D.memo(jM),AM=e=>$e("MuiPickersSlideTransition",e),Cn=Ee("MuiPickersSlideTransition",["root","slideEnter-left","slideEnter-right","slideEnterActive","slideExit","slideExitActiveLeft-left","slideExitActiveLeft-right"]),FM=["children","className","reduceAnimations","slideDirection","transKey","classes"],NM=e=>{const{classes:t,slideDirection:n}=e,r={root:["root"],exit:["slideExit"],enterActive:["slideEnterActive"],enter:[`slideEnter-${n}`],exitActive:[`slideExitActiveLeft-${n}`]};return Re(r,AM,t)},LM=re(wi,{name:"MuiPickersSlideTransition",slot:"Root",overridesResolver:(e,t)=>[t.root,{[`.${Cn["slideEnter-left"]}`]:t["slideEnter-left"]},{[`.${Cn["slideEnter-right"]}`]:t["slideEnter-right"]},{[`.${Cn.slideEnterActive}`]:t.slideEnterActive},{[`.${Cn.slideExit}`]:t.slideExit},{[`.${Cn["slideExitActiveLeft-left"]}`]:t["slideExitActiveLeft-left"]},{[`.${Cn["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},[`& .${Cn["slideEnter-left"]}`]:{willChange:"transform",transform:"translate(100%)",zIndex:1},[`& .${Cn["slideEnter-right"]}`]:{willChange:"transform",transform:"translate(-100%)",zIndex:1},[`& .${Cn.slideEnterActive}`]:{transform:"translate(0%)",transition:t},[`& .${Cn.slideExit}`]:{transform:"translate(0%)"},[`& .${Cn["slideExitActiveLeft-left"]}`]:{willChange:"transform",transform:"translate(-100%)",transition:t,zIndex:0},[`& .${Cn["slideExitActiveLeft-right"]}`]:{willChange:"transform",transform:"translate(100%)",transition:t,zIndex:0}}});function BM(e){const t=wt({props:e,name:"MuiPickersSlideTransition"}),{children:n,className:r,reduceAnimations:o,transKey:s}=t,i=Fe(t,FM),l=NM(t),c=$r();if(o)return a.jsx("div",{className:Te(l.root,r),children:n});const u={exit:l.exit,enterActive:l.enterActive,enter:l.enter,exitActive:l.exitActive};return a.jsx(LM,{className:Te(l.root,r),childFactory:d=>D.cloneElement(d,{classNames:u}),role:"presentation",children:a.jsx(Lc,U({mountOnEnter:!0,unmountOnExit:!0,timeout:c.transitions.duration.complex,classNames:u},i,{children:n}),s)})}const VM=e=>$e("MuiDayCalendar",e);Ee("MuiDayCalendar",["root","header","weekDayLabel","loadingContainer","slideTransition","monthContainer","weekContainer","weekNumberLabel","weekNumber"]);const zM=["parentProps","day","focusableDay","selectedDays","isDateDisabled","currentMonthNumber","isViewFocused"],_M=["ownerState"],WM=e=>{const{classes:t}=e;return Re({root:["root"],header:["header"],weekDayLabel:["weekDayLabel"],loadingContainer:["loadingContainer"],slideTransition:["slideTransition"],monthContainer:["monthContainer"],weekContainer:["weekContainer"],weekNumberLabel:["weekNumberLabel"],weekNumber:["weekNumber"]},VM,t)},Dm=(ci+Ya*2)*6,HM=re("div",{name:"MuiDayCalendar",slot:"Root",overridesResolver:(e,t)=>t.root})({}),UM=re("div",{name:"MuiDayCalendar",slot:"Header",overridesResolver:(e,t)=>t.header})({display:"flex",justifyContent:"center",alignItems:"center"}),qM=re(rt,{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})),YM=re(rt,{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})),KM=re(rt,{name:"MuiDayCalendar",slot:"WeekNumber",overridesResolver:(e,t)=>t.weekNumber})(({theme:e})=>U({},e.typography.caption,{width:ci,height:ci,padding:0,margin:`0 ${Ya}px`,color:e.palette.text.disabled,fontSize:"0.75rem",alignItems:"center",justifyContent:"center",display:"inline-flex"})),GM=re("div",{name:"MuiDayCalendar",slot:"LoadingContainer",overridesResolver:(e,t)=>t.loadingContainer})({display:"flex",justifyContent:"center",alignItems:"center",minHeight:Dm}),ZM=re(BM,{name:"MuiDayCalendar",slot:"SlideTransition",overridesResolver:(e,t)=>t.slideTransition})({minHeight:Dm}),XM=re("div",{name:"MuiDayCalendar",slot:"MonthContainer",overridesResolver:(e,t)=>t.monthContainer})({overflow:"hidden"}),QM=re("div",{name:"MuiDayCalendar",slot:"WeekContainer",overridesResolver:(e,t)=>t.weekContainer})({margin:`${Ya}px 0`,display:"flex",justifyContent:"center"});function JM(e){let{parentProps:t,day:n,focusableDay:r,selectedDays:o,isDateDisabled:s,currentMonthNumber:i,isViewFocused:l}=e,c=Fe(e,zM);const{disabled:u,disableHighlightToday:d,isMonthSwitchingAnimating:f,showDaysOutsideCurrentMonth:m,slots:h,slotProps:g,timezone:y}=t,b=It(),x=Ha(y),C=r!==null&&b.isSameDay(n,r),T=o.some(v=>b.isSameDay(v,n)),w=b.isSameDay(n,x),M=h?.day??$M,E=Ge({elementType:M,externalSlotProps:g?.day,additionalProps:U({disableHighlightToday:d,showDaysOutsideCurrentMonth:m,role:"gridcell",isAnimating:f,"data-timestamp":b.toJsDate(n).valueOf()},c),ownerState:U({},t,{day:n,selected:T})}),j=Fe(E,_M),F=D.useMemo(()=>u||s(n),[u,s,n]),O=D.useMemo(()=>b.getMonth(n)!==i,[b,n,i]),V=D.useMemo(()=>{const v=b.startOfMonth(b.setMonth(n,i));return m?b.isSameDay(n,b.startOfWeek(v)):b.isSameDay(n,v)},[i,n,m,b]),L=D.useMemo(()=>{const v=b.endOfMonth(b.setMonth(n,i));return m?b.isSameDay(n,b.endOfWeek(v)):b.isSameDay(n,v)},[i,n,m,b]);return a.jsx(M,U({},j,{day:n,disabled:F,autoFocus:l&&C,today:w,outsideCurrentMonth:O,isFirstVisibleCell:V,isLastVisibleCell:L,selected:T,tabIndex:C?0:-1,"aria-selected":T,"aria-current":w?"date":void 0}))}function eD(e){const t=wt({props:e,name:"MuiDayCalendar"}),n=It(),{onFocusedDayChange:r,className:o,currentMonth:s,selectedDays:i,focusedDay:l,loading:c,onSelectedDaysChange:u,onMonthSwitchingAnimationEnd:d,readOnly:f,reduceAnimations:m,renderLoading:h=()=>a.jsx("span",{children:"..."}),slideDirection:g,TransitionProps:y,disablePast:b,disableFuture:x,minDate:C,maxDate:T,shouldDisableDate:w,shouldDisableMonth:M,shouldDisableYear:E,dayOfWeekFormatter:j=de=>n.format(de,"weekdayShort").charAt(0).toUpperCase(),hasFocus:F,onFocusedViewChange:O,gridLabelId:V,displayWeekNumber:L,fixedWeekNumber:v,autoFocus:N,timezone:A}=t,$=Ha(A),R=WM(t),_=An(),z=km({shouldDisableDate:w,shouldDisableMonth:M,shouldDisableYear:E,minDate:C,maxDate:T,disablePast:b,disableFuture:x,timezone:A}),W=Cr(),[H,G]=mn({name:"DayCalendar",state:"hasFocus",controlled:F,default:N??!1}),[se,pe]=D.useState(()=>l||$),me=Me(de=>{f||u(de)}),X=de=>{z(de)||(r(de),pe(de),O?.(!0),G(!0))},K=Me((de,Se)=>{switch(de.key){case"ArrowUp":X(n.addDays(Se,-7)),de.preventDefault();break;case"ArrowDown":X(n.addDays(Se,7)),de.preventDefault();break;case"ArrowLeft":{const ce=n.addDays(Se,_?1:-1),Pe=n.addMonths(Se,_?1:-1),Ce=Xs({utils:n,date:ce,minDate:_?ce:n.startOfMonth(Pe),maxDate:_?n.endOfMonth(Pe):ce,isDateDisabled:z,timezone:A});X(Ce||ce),de.preventDefault();break}case"ArrowRight":{const ce=n.addDays(Se,_?-1:1),Pe=n.addMonths(Se,_?-1:1),Ce=Xs({utils:n,date:ce,minDate:_?n.startOfMonth(Pe):ce,maxDate:_?ce:n.endOfMonth(Pe),isDateDisabled:z,timezone:A});X(Ce||ce),de.preventDefault();break}case"Home":X(n.startOfWeek(Se)),de.preventDefault();break;case"End":X(n.endOfWeek(Se)),de.preventDefault();break;case"PageUp":X(n.addMonths(Se,1)),de.preventDefault();break;case"PageDown":X(n.addMonths(Se,-1)),de.preventDefault();break}}),le=Me((de,Se)=>X(Se)),oe=Me((de,Se)=>{H&&n.isSameDay(se,Se)&&O?.(!1)}),te=n.getMonth(s),Z=n.getYear(s),J=D.useMemo(()=>i.filter(de=>!!de).map(de=>n.startOfDay(de)),[n,i]),ae=`${Z}-${te}`,Q=D.useMemo(()=>D.createRef(),[ae]),ue=D.useMemo(()=>{const de=n.startOfMonth(s),Se=n.endOfMonth(s);return z(se)||n.isAfterDay(se,Se)||n.isBeforeDay(se,de)?Xs({utils:n,date:se,minDate:de,maxDate:Se,disablePast:b,disableFuture:x,isDateDisabled:z,timezone:A}):se},[s,x,b,se,z,n,A]),he=D.useMemo(()=>{const de=n.getWeekArray(s);let Se=n.addMonths(s,1);for(;v&&de.length<v;){const ce=n.getWeekArray(Se),Pe=n.isSameDay(de[de.length-1][0],ce[0][0]);ce.slice(Pe?1:0).forEach(Ce=>{de.length<v&&de.push(Ce)}),Se=n.addMonths(Se,1)}return de},[s,v,n]);return a.jsxs(HM,{role:"grid","aria-labelledby":V,className:R.root,children:[a.jsxs(UM,{role:"row",className:R.header,children:[L&&a.jsx(YM,{variant:"caption",role:"columnheader","aria-label":W.calendarWeekNumberHeaderLabel,className:R.weekNumberLabel,children:W.calendarWeekNumberHeaderText}),mS(n,$).map((de,Se)=>a.jsx(qM,{variant:"caption",role:"columnheader","aria-label":n.format(de,"weekday"),className:R.weekDayLabel,children:j(de)},Se.toString()))]}),c?a.jsx(GM,{className:R.loadingContainer,children:h()}):a.jsx(ZM,U({transKey:ae,onExited:d,reduceAnimations:m,slideDirection:g,className:Te(o,R.slideTransition)},y,{nodeRef:Q,children:a.jsx(XM,{ref:Q,role:"rowgroup",className:R.monthContainer,children:he.map((de,Se)=>a.jsxs(QM,{role:"row",className:R.weekContainer,"aria-rowindex":Se+1,children:[L&&a.jsx(KM,{className:R.weekNumber,role:"rowheader","aria-label":W.calendarWeekNumberAriaLabelText(n.getWeekNumber(de[0])),children:W.calendarWeekNumberText(n.getWeekNumber(de[0]))}),de.map((ce,Pe)=>a.jsx(JM,{parentProps:t,day:ce,selectedDays:J,focusableDay:ue,onKeyDown:K,onFocus:le,onBlur:oe,onDaySelect:me,isDateDisabled:z,currentMonthNumber:te,isViewFocused:H,"aria-colindex":Pe+1},ce.toString()))]},`week-${de[0]}`))})}))]})}function tD(e){return $e("MuiPickersMonth",e)}const Ui=Ee("MuiPickersMonth",["root","monthButton","disabled","selected"]),nD=["autoFocus","className","children","disabled","selected","value","tabIndex","onClick","onKeyDown","onFocus","onBlur","aria-current","aria-label","monthsPerRow","slots","slotProps"],rD=e=>{const{disabled:t,selected:n,classes:r}=e;return Re({root:["root"],monthButton:["monthButton",t&&"disabled",n&&"selected"]},tD,r)},oD=re("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%"}}]}),sD=re("button",{name:"MuiPickersMonth",slot:"MonthButton",overridesResolver:(e,t)=>[t.monthButton,{[`&.${Ui.disabled}`]:t.disabled},{[`&.${Ui.selected}`]:t.selected}]})(({theme:e})=>U({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})`:st.alpha(e.palette.action.active,e.palette.action.hoverOpacity)},"&:hover":{backgroundColor:e.vars?`rgba(${e.vars.palette.action.activeChannel} / ${e.vars.palette.action.hoverOpacity})`:st.alpha(e.palette.action.active,e.palette.action.hoverOpacity)},"&:disabled":{cursor:"auto",pointerEvents:"none"},[`&.${Ui.disabled}`]:{color:(e.vars||e).palette.text.secondary},[`&.${Ui.selected}`]:{color:(e.vars||e).palette.primary.contrastText,backgroundColor:(e.vars||e).palette.primary.main,"&:focus, &:hover":{backgroundColor:(e.vars||e).palette.primary.dark}}})),iD=D.memo(function(t){const n=wt({props:t,name:"MuiPickersMonth"}),{autoFocus:r,className:o,children:s,disabled:i,selected:l,value:c,tabIndex:u,onClick:d,onKeyDown:f,onFocus:m,onBlur:h,"aria-current":g,"aria-label":y,slots:b,slotProps:x}=n,C=Fe(n,nD),T=D.useRef(null),w=rD(n);Wt(()=>{r&&T.current?.focus()},[r]);const M=b?.monthButton??sD,E=Ge({elementType:M,externalSlotProps:x?.monthButton,additionalProps:{children:s,disabled:i,tabIndex:u,ref:T,type:"button",role:"radio","aria-current":g,"aria-checked":l,"aria-label":y,onClick:j=>d(j,c),onKeyDown:j=>f(j,c),onFocus:j=>m(j,c),onBlur:j=>h(j,c)},ownerState:n,className:w.monthButton});return a.jsx(oD,U({className:Te(w.root,o),ownerState:n},C,{children:a.jsx(M,U({},E))}))});function aD(e){return $e("MuiMonthCalendar",e)}Ee("MuiMonthCalendar",["root"]);const lD=["className","value","defaultValue","referenceDate","disabled","disableFuture","disablePast","maxDate","minDate","onChange","shouldDisableMonth","readOnly","disableHighlightToday","autoFocus","onMonthFocus","hasFocus","onFocusedViewChange","monthsPerRow","timezone","gridLabelId","slots","slotProps"],cD=e=>{const{classes:t}=e;return Re({root:["root"]},aD,t)};function uD(e,t){const n=It(),r=Si(),o=wt({props:e,name:t});return U({disableFuture:!1,disablePast:!1},o,{minDate:Pn(n,o.minDate,r.minDate),maxDate:Pn(n,o.maxDate,r.maxDate)})}const dD=re("div",{name:"MuiMonthCalendar",slot:"Root",overridesResolver:(e,t)=>t.root})({display:"flex",flexWrap:"wrap",alignContent:"stretch",padding:"0 4px",width:Ka,boxSizing:"border-box"}),pD=D.forwardRef(function(t,n){const r=uD(t,"MuiMonthCalendar"),{className:o,value:s,defaultValue:i,referenceDate:l,disabled:c,disableFuture:u,disablePast:d,maxDate:f,minDate:m,onChange:h,shouldDisableMonth:g,readOnly:y,autoFocus:b=!1,onMonthFocus:x,hasFocus:C,onFocusedViewChange:T,monthsPerRow:w=3,timezone:M,gridLabelId:E,slots:j,slotProps:F}=r,O=Fe(r,lD),{value:V,handleValueChange:L,timezone:v}=Zc({name:"MonthCalendar",timezone:M,value:s,defaultValue:i,referenceDate:l,onChange:h,valueManager:or}),N=Ha(v),A=An(),$=It(),R=D.useMemo(()=>or.getInitialReferenceValue({value:V,utils:$,props:r,timezone:v,referenceDate:l,granularity:er.month}),[]),_=r,z=cD(_),W=D.useMemo(()=>$.getMonth(N),[$,N]),H=D.useMemo(()=>V!=null?$.getMonth(V):null,[V,$]),[G,se]=D.useState(()=>H||$.getMonth(R)),[pe,me]=mn({name:"MonthCalendar",state:"hasFocus",controlled:C,default:b??!1}),X=Me(ae=>{me(ae),T&&T(ae)}),K=D.useCallback(ae=>{const Q=$.startOfMonth(d&&$.isAfter(N,m)?N:m),ue=$.startOfMonth(u&&$.isBefore(N,f)?N:f),he=$.startOfMonth(ae);return $.isBefore(he,Q)||$.isAfter(he,ue)?!0:g?g(he):!1},[u,d,f,m,N,g,$]),le=Me((ae,Q)=>{if(y)return;const ue=$.setMonth(V??R,Q);L(ue)}),oe=Me(ae=>{K($.setMonth(V??R,ae))||(se(ae),X(!0),x&&x(ae))});D.useEffect(()=>{se(ae=>H!==null&&ae!==H?H:ae)},[H]);const te=Me((ae,Q)=>{switch(ae.key){case"ArrowUp":oe((12+Q-3)%12),ae.preventDefault();break;case"ArrowDown":oe((12+Q+3)%12),ae.preventDefault();break;case"ArrowLeft":oe((12+Q+(A?1:-1))%12),ae.preventDefault();break;case"ArrowRight":oe((12+Q+(A?-1:1))%12),ae.preventDefault();break}}),Z=Me((ae,Q)=>{oe(Q)}),J=Me((ae,Q)=>{G===Q&&X(!1)});return a.jsx(dD,U({ref:n,className:Te(z.root,o),ownerState:_,role:"radiogroup","aria-labelledby":E},O,{children:jc($,V??R).map(ae=>{const Q=$.getMonth(ae),ue=$.format(ae,"monthShort"),he=$.format(ae,"month"),de=Q===H,Se=c||K(ae);return a.jsx(iD,{selected:de,value:Q,onClick:le,onKeyDown:te,autoFocus:pe&&Q===G,disabled:Se,tabIndex:Q===G&&!Se?0:-1,onFocus:Z,onBlur:J,"aria-current":W===Q?"date":void 0,"aria-label":he,monthsPerRow:w,slots:j,slotProps:F,children:ue},ue)})}))});function fD(e){return $e("MuiPickersYear",e)}const qi=Ee("MuiPickersYear",["root","yearButton","selected","disabled"]),hD=["autoFocus","className","children","disabled","selected","value","tabIndex","onClick","onKeyDown","onFocus","onBlur","aria-current","yearsPerRow","slots","slotProps"],mD=e=>{const{disabled:t,selected:n,classes:r}=e;return Re({root:["root"],yearButton:["yearButton",t&&"disabled",n&&"selected"]},fD,r)},gD=re("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%"}}]}),yD=re("button",{name:"MuiPickersYear",slot:"YearButton",overridesResolver:(e,t)=>[t.yearButton,{[`&.${qi.disabled}`]:t.disabled},{[`&.${qi.selected}`]:t.selected}]})(({theme:e})=>U({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})`:st.alpha(e.palette.action.active,e.palette.action.focusOpacity)},"&:hover":{backgroundColor:e.vars?`rgba(${e.vars.palette.action.activeChannel} / ${e.vars.palette.action.hoverOpacity})`:st.alpha(e.palette.action.active,e.palette.action.hoverOpacity)},"&:disabled":{cursor:"auto",pointerEvents:"none"},[`&.${qi.disabled}`]:{color:(e.vars||e).palette.text.secondary},[`&.${qi.selected}`]:{color:(e.vars||e).palette.primary.contrastText,backgroundColor:(e.vars||e).palette.primary.main,"&:focus, &:hover":{backgroundColor:(e.vars||e).palette.primary.dark}}})),bD=D.memo(function(t){const n=wt({props:t,name:"MuiPickersYear"}),{autoFocus:r,className:o,children:s,disabled:i,selected:l,value:c,tabIndex:u,onClick:d,onKeyDown:f,onFocus:m,onBlur:h,"aria-current":g,slots:y,slotProps:b}=n,x=Fe(n,hD),C=D.useRef(null),T=mD(n);Wt(()=>{r&&C.current?.focus()},[r]);const w=y?.yearButton??yD,M=Ge({elementType:w,externalSlotProps:b?.yearButton,additionalProps:{children:s,disabled:i,tabIndex:u,ref:C,type:"button",role:"radio","aria-current":g,"aria-checked":l,onClick:E=>d(E,c),onKeyDown:E=>f(E,c),onFocus:E=>m(E,c),onBlur:E=>h(E,c)},ownerState:n,className:T.yearButton});return a.jsx(gD,U({className:Te(T.root,o),ownerState:n},x,{children:a.jsx(w,U({},M))}))});function xD(e){return $e("MuiYearCalendar",e)}Ee("MuiYearCalendar",["root"]);const vD=["autoFocus","className","value","defaultValue","referenceDate","disabled","disableFuture","disablePast","maxDate","minDate","onChange","readOnly","shouldDisableYear","disableHighlightToday","onYearFocus","hasFocus","onFocusedViewChange","yearsOrder","yearsPerRow","timezone","gridLabelId","slots","slotProps"],SD=e=>{const{classes:t}=e;return Re({root:["root"]},xD,t)};function CD(e,t){const n=It(),r=Si(),o=wt({props:e,name:t});return U({disablePast:!1,disableFuture:!1},o,{yearsPerRow:o.yearsPerRow??3,minDate:Pn(n,o.minDate,r.minDate),maxDate:Pn(n,o.maxDate,r.maxDate)})}const wD=re("div",{name:"MuiYearCalendar",slot:"Root",overridesResolver:(e,t)=>t.root})({display:"flex",flexDirection:"row",flexWrap:"wrap",overflowY:"auto",height:"100%",padding:"0 4px",width:Ka,maxHeight:vk,boxSizing:"border-box",position:"relative"}),kD=D.forwardRef(function(t,n){const r=CD(t,"MuiYearCalendar"),{autoFocus:o,className:s,value:i,defaultValue:l,referenceDate:c,disabled:u,disableFuture:d,disablePast:f,maxDate:m,minDate:h,onChange:g,readOnly:y,shouldDisableYear:b,onYearFocus:x,hasFocus:C,onFocusedViewChange:T,yearsOrder:w="asc",yearsPerRow:M,timezone:E,gridLabelId:j,slots:F,slotProps:O}=r,V=Fe(r,vD),{value:L,handleValueChange:v,timezone:N}=Zc({name:"YearCalendar",timezone:E,value:i,defaultValue:l,referenceDate:c,onChange:g,valueManager:or}),A=Ha(N),$=An(),R=It(),_=D.useMemo(()=>or.getInitialReferenceValue({value:L,utils:R,props:r,timezone:N,referenceDate:c,granularity:er.year}),[]),z=r,W=SD(z),H=D.useMemo(()=>R.getYear(A),[R,A]),G=D.useMemo(()=>L!=null?R.getYear(L):null,[L,R]),[se,pe]=D.useState(()=>G||R.getYear(_)),[me,X]=mn({name:"YearCalendar",state:"hasFocus",controlled:C,default:o??!1}),K=Me(ce=>{X(ce),T&&T(ce)}),le=D.useCallback(ce=>{if(f&&R.isBeforeYear(ce,A)||d&&R.isAfterYear(ce,A)||h&&R.isBeforeYear(ce,h)||m&&R.isAfterYear(ce,m))return!0;if(!b)return!1;const Pe=R.startOfYear(ce);return b(Pe)},[d,f,m,h,A,b,R]),oe=Me((ce,Pe)=>{if(y)return;const Ce=R.setYear(L??_,Pe);v(Ce)}),te=Me(ce=>{le(R.setYear(L??_,ce))||(pe(ce),K(!0),x?.(ce))});D.useEffect(()=>{pe(ce=>G!==null&&ce!==G?G:ce)},[G]);const Z=w!=="desc"?M*1:M*-1,J=$&&w==="asc"||!$&&w==="desc"?-1:1,ae=Me((ce,Pe)=>{switch(ce.key){case"ArrowUp":te(Pe-Z),ce.preventDefault();break;case"ArrowDown":te(Pe+Z),ce.preventDefault();break;case"ArrowLeft":te(Pe-J),ce.preventDefault();break;case"ArrowRight":te(Pe+J),ce.preventDefault();break}}),Q=Me((ce,Pe)=>{te(Pe)}),ue=Me((ce,Pe)=>{se===Pe&&K(!1)}),he=D.useRef(null),de=Ze(n,he);D.useEffect(()=>{if(o||he.current===null)return;const ce=he.current.querySelector('[tabindex="0"]');if(!ce)return;const Pe=ce.offsetHeight,Ce=ce.offsetTop,Ve=he.current.clientHeight,De=he.current.scrollTop,pt=Ce+Pe;Pe>Ve||Ce<De||(he.current.scrollTop=pt-Ve/2-Pe/2)},[o]);const Se=R.getYearRange([h,m]);return w==="desc"&&Se.reverse(),a.jsx(wD,U({ref:de,className:Te(W.root,s),ownerState:z,role:"radiogroup","aria-labelledby":j},V,{children:Se.map(ce=>{const Pe=R.getYear(ce),Ce=Pe===G,Ve=u||le(ce);return a.jsx(bD,{selected:Ce,value:Pe,onClick:oe,onKeyDown:ae,autoFocus:me&&Pe===se,disabled:Ve,tabIndex:Pe===se&&!Ve?0:-1,onFocus:Q,onBlur:ue,"aria-current":H===Pe?"date":void 0,yearsPerRow:M,slots:F,slotProps:O,children:R.format(ce,"year")},R.format(ce,"year"))})}))}),TD=e=>$e("MuiPickersCalendarHeader",e),ID=Ee("MuiPickersCalendarHeader",["root","labelContainer","label","switchViewButton","switchViewIcon"]);function MD(e){return $e("MuiPickersArrowSwitcher",e)}Ee("MuiPickersArrowSwitcher",["root","spacer","button","previousIconButton","nextIconButton","leftArrowIcon","rightArrowIcon"]);const DD=["children","className","slots","slotProps","isNextDisabled","isNextHidden","onGoToNext","nextLabel","isPreviousDisabled","isPreviousHidden","onGoToPrevious","previousLabel","labelId"],PD=["ownerState"],ED=["ownerState"],OD=re("div",{name:"MuiPickersArrowSwitcher",slot:"Root",overridesResolver:(e,t)=>t.root})({display:"flex"}),RD=re("div",{name:"MuiPickersArrowSwitcher",slot:"Spacer",overridesResolver:(e,t)=>t.spacer})(({theme:e})=>({width:e.spacing(3)})),Kp=re(Nn,{name:"MuiPickersArrowSwitcher",slot:"Button",overridesResolver:(e,t)=>t.button})({variants:[{props:{hidden:!0},style:{visibility:"hidden"}}]}),jD=e=>{const{classes:t}=e;return Re({root:["root"],spacer:["spacer"],button:["button"],previousIconButton:["previousIconButton"],nextIconButton:["nextIconButton"],leftArrowIcon:["leftArrowIcon"],rightArrowIcon:["rightArrowIcon"]},MD,t)},$D=D.forwardRef(function(t,n){const r=An(),o=wt({props:t,name:"MuiPickersArrowSwitcher"}),{children:s,className:i,slots:l,slotProps:c,isNextDisabled:u,isNextHidden:d,onGoToNext:f,nextLabel:m,isPreviousDisabled:h,isPreviousHidden:g,onGoToPrevious:y,previousLabel:b,labelId:x}=o,C=Fe(o,DD),T=o,w=jD(T),M={isDisabled:u,isHidden:d,goTo:f,label:m},E={isDisabled:h,isHidden:g,goTo:y,label:b},j=l?.previousIconButton??Kp,F=Ge({elementType:j,externalSlotProps:c?.previousIconButton,additionalProps:{size:"medium",title:E.label,"aria-label":E.label,disabled:E.isDisabled,edge:"end",onClick:E.goTo},ownerState:U({},T,{hidden:E.isHidden}),className:Te(w.button,w.previousIconButton)}),O=l?.nextIconButton??Kp,V=Ge({elementType:O,externalSlotProps:c?.nextIconButton,additionalProps:{size:"medium",title:M.label,"aria-label":M.label,disabled:M.isDisabled,edge:"start",onClick:M.goTo},ownerState:U({},T,{hidden:M.isHidden}),className:Te(w.button,w.nextIconButton)}),L=l?.leftArrowIcon??Fk,v=Ge({elementType:L,externalSlotProps:c?.leftArrowIcon,additionalProps:{fontSize:"inherit"},ownerState:T,className:w.leftArrowIcon}),N=Fe(v,PD),A=l?.rightArrowIcon??Nk,$=Ge({elementType:A,externalSlotProps:c?.rightArrowIcon,additionalProps:{fontSize:"inherit"},ownerState:T,className:w.rightArrowIcon}),R=Fe($,ED);return a.jsxs(OD,U({ref:n,className:Te(w.root,i),ownerState:T},C,{children:[a.jsx(j,U({},F,{children:r?a.jsx(A,U({},R)):a.jsx(L,U({},N))})),s?a.jsx(rt,{variant:"subtitle1",component:"span",id:x,children:s}):a.jsx(RD,{className:w.spacer,ownerState:T}),a.jsx(O,U({},V,{children:r?a.jsx(L,U({},N)):a.jsx(A,U({},R))}))]}))});function AD(e,{disableFuture:t,maxDate:n,timezone:r}){const o=It();return D.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 FD(e,{disablePast:t,minDate:n,timezone:r}){const o=It();return D.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 ND=["slots","slotProps","currentMonth","disabled","disableFuture","disablePast","maxDate","minDate","onMonthChange","onViewChange","view","reduceAnimations","views","labelId","className","timezone","format"],LD=["ownerState"],BD=e=>{const{classes:t}=e;return Re({root:["root"],labelContainer:["labelContainer"],label:["label"],switchViewButton:["switchViewButton"],switchViewIcon:["switchViewIcon"]},TD,t)},VD=re("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}),zD=re("div",{name:"MuiPickersCalendarHeader",slot:"LabelContainer",overridesResolver:(e,t)=>t.labelContainer})(({theme:e})=>U({display:"flex",overflow:"hidden",alignItems:"center",cursor:"pointer",marginRight:"auto"},e.typography.body1,{fontWeight:e.typography.fontWeightMedium})),_D=re("div",{name:"MuiPickersCalendarHeader",slot:"Label",overridesResolver:(e,t)=>t.label})({marginRight:6}),WD=re(Nn,{name:"MuiPickersCalendarHeader",slot:"SwitchViewButton",overridesResolver:(e,t)=>t.switchViewButton})({marginRight:"auto",variants:[{props:{view:"year"},style:{[`.${ID.switchViewIcon}`]:{transform:"rotate(180deg)"}}}]}),HD=re(Ak,{name:"MuiPickersCalendarHeader",slot:"SwitchViewIcon",overridesResolver:(e,t)=>t.switchViewIcon})(({theme:e})=>({willChange:"transform",transition:e.transitions.create("transform"),transform:"rotate(0deg)"})),UD=D.forwardRef(function(t,n){const r=Cr(),o=It(),s=wt({props:t,name:"MuiPickersCalendarHeader"}),{slots:i,slotProps:l,currentMonth:c,disabled:u,disableFuture:d,disablePast:f,maxDate:m,minDate:h,onMonthChange:g,onViewChange:y,view:b,reduceAnimations:x,views:C,labelId:T,className:w,timezone:M,format:E=`${o.formats.month} ${o.formats.year}`}=s,j=Fe(s,ND),F=s,O=BD(s),V=i?.switchViewButton??WD,L=Ge({elementType:V,externalSlotProps:l?.switchViewButton,additionalProps:{size:"small","aria-label":r.calendarViewSwitchingButtonAriaLabel(b)},ownerState:F,className:O.switchViewButton}),v=i?.switchViewIcon??HD,N=Ge({elementType:v,externalSlotProps:l?.switchViewIcon,ownerState:F,className:O.switchViewIcon}),A=Fe(N,LD),$=()=>g(o.addMonths(c,1),"left"),R=()=>g(o.addMonths(c,-1),"right"),_=AD(c,{disableFuture:d,maxDate:m,timezone:M}),z=FD(c,{disablePast:f,minDate:h,timezone:M}),W=()=>{if(!(C.length===1||!y||u))if(C.length===2)y(C.find(G=>G!==b)||C[0]);else{const G=C.indexOf(b)!==0?0:1;y(C[G])}};if(C.length===1&&C[0]==="year")return null;const H=o.formatByString(c,E);return a.jsxs(VD,U({},j,{ownerState:F,className:Te(O.root,w),ref:n,children:[a.jsxs(zD,{role:"presentation",onClick:W,ownerState:F,"aria-live":"polite",className:O.labelContainer,children:[a.jsx(Tm,{reduceAnimations:x,transKey:H,children:a.jsx(_D,{id:T,ownerState:F,className:O.label,children:H})}),C.length>1&&!u&&a.jsx(V,U({},L,{children:a.jsx(v,U({},A))}))]}),a.jsx(ao,{in:b==="day",appear:!x,enter:!x,children:a.jsx($D,{slots:i,slotProps:l,onGoToPrevious:R,isPreviousDisabled:z,previousLabel:r.previousMonth,onGoToNext:$,isNextDisabled:_,nextLabel:r.nextMonth})})]}))}),qD=re("div")({overflow:"hidden",width:Ka,maxHeight:Xc,display:"flex",flexDirection:"column",margin:"0 auto"}),YD=e=>$e("MuiDateCalendar",e);Ee("MuiDateCalendar",["root","viewTransitionContainer"]);const KD=["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"],GD=e=>{const{classes:t}=e;return Re({root:["root"],viewTransitionContainer:["viewTransitionContainer"]},YD,t)};function ZD(e,t){const n=It(),r=Si(),o=Xh(),s=wt({props:e,name:t});return U({},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??(()=>a.jsx("span",{children:"..."})),minDate:Pn(n,s.minDate,r.minDate),maxDate:Pn(n,s.maxDate,r.maxDate)})}const XD=re(qD,{name:"MuiDateCalendar",slot:"Root",overridesResolver:(e,t)=>t.root})({display:"flex",flexDirection:"column",height:Xc}),QD=re(Tm,{name:"MuiDateCalendar",slot:"ViewTransitionContainer",overridesResolver:(e,t)=>t.viewTransitionContainer})({}),JD=D.forwardRef(function(t,n){const r=It(),o=Un(),s=ZD(t,"MuiDateCalendar"),{autoFocus:i,onViewChange:l,value:c,defaultValue:u,referenceDate:d,disableFuture:f,disablePast:m,onChange:h,onYearChange:g,onMonthChange:y,reduceAnimations:b,shouldDisableDate:x,shouldDisableMonth:C,shouldDisableYear:T,view:w,views:M,openTo:E,className:j,disabled:F,readOnly:O,minDate:V,maxDate:L,disableHighlightToday:v,focusedView:N,onFocusedViewChange:A,showDaysOutsideCurrentMonth:$,fixedWeekNumber:R,dayOfWeekFormatter:_,slots:z,slotProps:W,loading:H,renderLoading:G,displayWeekNumber:se,yearsOrder:pe,yearsPerRow:me,monthsPerRow:X,timezone:K}=s,le=Fe(s,KD),{value:oe,handleValueChange:te,timezone:Z}=Zc({name:"DateCalendar",timezone:K,value:c,defaultValue:u,referenceDate:d,onChange:h,valueManager:or}),{view:J,setView:ae,focusedView:Q,setFocusedView:ue,goToNextView:he,setValueAndGoToNextView:de}=Qh({view:w,views:M,openTo:E,onChange:te,onViewChange:l,autoFocus:i,focusedView:N,onFocusedViewChange:A}),{referenceDate:Se,calendarState:ce,changeFocusedDay:Pe,changeMonth:Ce,handleChangeMonth:Ve,isDateDisabled:De,onMonthSwitchingAnimationEnd:pt}=kM({value:oe,referenceDate:d,reduceAnimations:b,onMonthChange:y,minDate:V,maxDate:L,shouldDisableDate:x,disablePast:m,disableFuture:f,timezone:Z}),Ye=F&&oe||V,tt=F&&oe||L,gt=`${o}-grid-label`,kt=Q!==null,Pt=z?.calendarHeader??UD,Yt=Ge({elementType:Pt,externalSlotProps:W?.calendarHeader,additionalProps:{views:M,view:J,currentMonth:ce.currentMonth,onViewChange:ae,onMonthChange:(at,Lt)=>Ve({newMonth:at,direction:Lt}),minDate:Ye,maxDate:tt,disabled:F,disablePast:m,disableFuture:f,reduceAnimations:b,timezone:Z,labelId:gt},ownerState:s}),lt=Me(at=>{const Lt=r.startOfMonth(at),Gt=r.endOfMonth(at),ut=De(at)?Xs({utils:r,date:at,minDate:r.isBefore(V,Lt)?Lt:V,maxDate:r.isAfter(L,Gt)?Gt:L,disablePast:m,disableFuture:f,isDateDisabled:De,timezone:Z}):at;ut?(de(ut,"finish"),y?.(Lt)):(he(),Ce(Lt)),Pe(ut,!0)}),Ie=Me(at=>{const Lt=r.startOfYear(at),Gt=r.endOfYear(at),ut=De(at)?Xs({utils:r,date:at,minDate:r.isBefore(V,Lt)?Lt:V,maxDate:r.isAfter(L,Gt)?Gt:L,disablePast:m,disableFuture:f,isDateDisabled:De,timezone:Z}):at;ut?(de(ut,"finish"),g?.(ut)):(he(),Ce(Lt)),Pe(ut,!0)}),ft=Me(at=>te(at&&xa(r,at,oe??Se),"finish",J));D.useEffect(()=>{oe!=null&&r.isValid(oe)&&Ce(oe)},[oe]);const it=s,jt=GD(it),je={disablePast:m,disableFuture:f,maxDate:L,minDate:V},ze={disableHighlightToday:v,readOnly:O,disabled:F,timezone:Z,gridLabelId:gt,slots:z,slotProps:W},Ae=D.useRef(J);D.useEffect(()=>{Ae.current!==J&&(Q===Ae.current&&ue(J,!0),Ae.current=J)},[Q,ue,J]);const Kt=D.useMemo(()=>[oe],[oe]);return a.jsxs(XD,U({ref:n,className:Te(jt.root,j),ownerState:it},le,{children:[a.jsx(Pt,U({},Yt,{slots:z,slotProps:W})),a.jsx(QD,{reduceAnimations:b,className:jt.viewTransitionContainer,transKey:J,ownerState:it,children:a.jsxs("div",{children:[J==="year"&&a.jsx(kD,U({},je,ze,{value:oe,onChange:Ie,shouldDisableYear:T,hasFocus:kt,onFocusedViewChange:at=>ue("year",at),yearsOrder:pe,yearsPerRow:me,referenceDate:Se})),J==="month"&&a.jsx(pD,U({},je,ze,{hasFocus:kt,className:j,value:oe,onChange:lt,shouldDisableMonth:C,onFocusedViewChange:at=>ue("month",at),monthsPerRow:X,referenceDate:Se})),J==="day"&&a.jsx(eD,U({},ce,je,ze,{onMonthSwitchingAnimationEnd:pt,onFocusedDayChange:Pe,reduceAnimations:b,selectedDays:Kt,onSelectedDaysChange:ft,shouldDisableDate:x,shouldDisableMonth:C,shouldDisableYear:T,hasFocus:kt,onFocusedViewChange:at=>ue("day",at),showDaysOutsideCurrentMonth:$,fixedWeekNumber:R,dayOfWeekFormatter:_,displayWeekNumber:se,loading:H,renderLoading:G}))]})})]}))}),Ko=({view:e,onViewChange:t,views:n,focusedView:r,onFocusedViewChange:o,value:s,defaultValue:i,referenceDate:l,onChange:c,className:u,classes:d,disableFuture:f,disablePast:m,minDate:h,maxDate:g,shouldDisableDate:y,shouldDisableMonth:b,shouldDisableYear:x,reduceAnimations:C,onMonthChange:T,monthsPerRow:w,onYearChange:M,yearsOrder:E,yearsPerRow:j,slots:F,slotProps:O,loading:V,renderLoading:L,disableHighlightToday:v,readOnly:N,disabled:A,showDaysOutsideCurrentMonth:$,dayOfWeekFormatter:R,sx:_,autoFocus:z,fixedWeekNumber:W,displayWeekNumber:H,timezone:G})=>a.jsx(JD,{view:e,onViewChange:t,views:n.filter(np),focusedView:r&&np(r)?r:null,onFocusedViewChange:o,value:s,defaultValue:i,referenceDate:l,onChange:c,className:u,classes:d,disableFuture:f,disablePast:m,minDate:h,maxDate:g,shouldDisableDate:y,shouldDisableMonth:b,shouldDisableYear:x,reduceAnimations:C,onMonthChange:T,monthsPerRow:w,onYearChange:M,yearsOrder:E,yearsPerRow:j,slots:F,slotProps:O,loading:V,renderLoading:L,disableHighlightToday:v,readOnly:N,disabled:A,showDaysOutsideCurrentMonth:$,dayOfWeekFormatter:R,sx:_,autoFocus:z,fixedWeekNumber:W,displayWeekNumber:H,timezone:G}),Pm=D.forwardRef(function(t,n){const r=Cr(),o=It(),s=jh(t,"MuiDesktopDatePicker"),i=U({day:Ko,month:Ko,year:Ko},s.viewRenderers),l=U({},s,{viewRenderers:i,format:$c(o,s,!1),yearsPerRow:s.yearsPerRow??4,slots:U({openPickerIcon:Lk,field:wm},s.slots),slotProps:U({},s.slotProps,{field:u=>U({},In(s.slotProps?.field,u),Ah(s),{ref:n}),toolbar:U({hidden:!0},s.slotProps?.toolbar)})}),{renderPicker:c}=$k({props:l,valueManager:or,valueType:"date",getOpenDialogAriaText:Oh({utils:o,formatKey:"fullDate",contextTranslation:r.openDatePickerDialogue,propsTranslation:l.localeText?.openDatePickerDialogue}),validator:Ci});return c()});Pm.propTypes={autoFocus:fe.bool,className:fe.string,closeOnSelect:fe.bool,dayOfWeekFormatter:fe.func,defaultValue:fe.object,disabled:fe.bool,disableFuture:fe.bool,disableHighlightToday:fe.bool,disableOpenPicker:fe.bool,disablePast:fe.bool,displayWeekNumber:fe.bool,enableAccessibleFieldDOMStructure:fe.any,fixedWeekNumber:fe.number,format:fe.string,formatDensity:fe.oneOf(["dense","spacious"]),inputRef:vh,label:fe.node,loading:fe.bool,localeText:fe.object,maxDate:fe.object,minDate:fe.object,monthsPerRow:fe.oneOf([3,4]),name:fe.string,onAccept:fe.func,onChange:fe.func,onClose:fe.func,onError:fe.func,onMonthChange:fe.func,onOpen:fe.func,onSelectedSectionsChange:fe.func,onViewChange:fe.func,onYearChange:fe.func,open:fe.bool,openTo:fe.oneOf(["day","month","year"]),orientation:fe.oneOf(["landscape","portrait"]),readOnly:fe.bool,reduceAnimations:fe.bool,referenceDate:fe.object,renderLoading:fe.func,selectedSections:fe.oneOfType([fe.oneOf(["all","day","empty","hours","meridiem","minutes","month","seconds","weekDay","year"]),fe.number]),shouldDisableDate:fe.func,shouldDisableMonth:fe.func,shouldDisableYear:fe.func,showDaysOutsideCurrentMonth:fe.bool,slotProps:fe.object,slots:fe.object,sx:fe.oneOfType([fe.arrayOf(fe.oneOfType([fe.func,fe.object,fe.bool])),fe.func,fe.object]),timezone:fe.string,value:fe.object,view:fe.oneOf(["day","month","year"]),viewRenderers:fe.shape({day:fe.func,month:fe.func,year:fe.func}),views:fe.arrayOf(fe.oneOf(["day","month","year"]).isRequired),yearsOrder:fe.oneOf(["asc","desc"]),yearsPerRow:fe.oneOf([3,4])};function eP(e){return $e("MuiDialogContent",e)}Ee("MuiDialogContent",["root","dividers"]);function tP(e){return $e("MuiDialogTitle",e)}const nP=Ee("MuiDialogTitle",["root"]),rP=e=>{const{classes:t,dividers:n}=e;return Re({root:["root",n&&"dividers"]},eP,t)},oP=re("div",{name:"MuiDialogContent",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.dividers&&t.dividers]}})(He(({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:{[`.${nP.root} + &`]:{paddingTop:0}}}]}))),lr=D.forwardRef(function(t,n){const r=We({props:t,name:"MuiDialogContent"}),{className:o,dividers:s=!1,...i}=r,l={...r,dividers:s},c=rP(l);return a.jsx(oP,{className:Te(c.root,o),ownerState:l,ref:n,...i})});function sP(e){return $e("MuiDialog",e)}const ni=Ee("MuiDialog",["root","scrollPaper","scrollBody","container","paper","paperScrollPaper","paperScrollBody","paperWidthFalse","paperWidthXs","paperWidthSm","paperWidthMd","paperWidthLg","paperWidthXl","paperFullWidth","paperFullScreen"]),Em=D.createContext({}),iP=re(cm,{name:"MuiDialog",slot:"Backdrop",overrides:(e,t)=>t.backdrop})({zIndex:-1}),aP=e=>{const{classes:t,scroll:n,maxWidth:r,fullWidth:o,fullScreen:s}=e,i={root:["root"],container:["container",`scroll${ve(n)}`],paper:["paper",`paperScroll${ve(n)}`,`paperWidth${ve(String(r))}`,o&&"paperFullWidth",s&&"paperFullScreen"]};return Re(i,sP,t)},lP=re(um,{name:"MuiDialog",slot:"Root"})({"@media print":{position:"absolute !important"}}),cP=re("div",{name:"MuiDialog",slot:"Container",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.container,t[`scroll${ve(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"}}}]}),uP=re(po,{name:"MuiDialog",slot:"Paper",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.paper,t[`scrollPaper${ve(n.scroll)}`],t[`paperWidth${ve(String(n.maxWidth))}`],n.fullWidth&&t.paperFullWidth,n.fullScreen&&t.paperFullScreen]}})(He(({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)`,[`&.${ni.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}`,[`&.${ni.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,[`&.${ni.paperScrollBody}`]:{margin:0,maxWidth:"100%"}}}]}))),cr=D.forwardRef(function(t,n){const r=We({props:t,name:"MuiDialog"}),o=$r(),s={enter:o.transitions.duration.enteringScreen,exit:o.transitions.duration.leavingScreen},{"aria-describedby":i,"aria-labelledby":l,"aria-modal":c=!0,BackdropComponent:u,BackdropProps:d,children:f,className:m,disableEscapeKeyDown:h=!1,fullScreen:g=!1,fullWidth:y=!1,maxWidth:b="sm",onClick:x,onClose:C,open:T,PaperComponent:w=po,PaperProps:M={},scroll:E="paper",slots:j={},slotProps:F={},TransitionComponent:O=ao,transitionDuration:V=s,TransitionProps:L,...v}=r,N={...r,disableEscapeKeyDown:h,fullScreen:g,fullWidth:y,maxWidth:b,scroll:E},A=aP(N),$=D.useRef(),R=Q=>{$.current=Q.target===Q.currentTarget},_=Q=>{x&&x(Q),$.current&&($.current=null,C&&C(Q,"backdropClick"))},z=Un(l),W=D.useMemo(()=>({titleId:z}),[z]),H={transition:O,...j},G={transition:L,paper:M,backdrop:d,...F},se={slots:H,slotProps:G},[pe,me]=et("root",{elementType:lP,shouldForwardComponentProp:!0,externalForwardedProps:se,ownerState:N,className:Te(A.root,m),ref:n}),[X,K]=et("backdrop",{elementType:iP,shouldForwardComponentProp:!0,externalForwardedProps:se,ownerState:N}),[le,oe]=et("paper",{elementType:uP,shouldForwardComponentProp:!0,externalForwardedProps:se,ownerState:N,className:Te(A.paper,M.className)}),[te,Z]=et("container",{elementType:cP,externalForwardedProps:se,ownerState:N,className:A.container}),[J,ae]=et("transition",{elementType:ao,externalForwardedProps:se,ownerState:N,additionalProps:{appear:!0,in:T,timeout:V,role:"presentation"}});return a.jsx(pe,{closeAfterTransition:!0,slots:{backdrop:X},slotProps:{backdrop:{transitionDuration:V,as:u,...K}},disableEscapeKeyDown:h,onClose:C,open:T,onClick:_,...me,...v,children:a.jsx(J,{...ae,children:a.jsx(te,{onMouseDown:R,...Z,children:a.jsx(le,{as:w,elevation:24,role:"dialog","aria-describedby":i,"aria-labelledby":z,"aria-modal":c,...oe,children:a.jsx(Em.Provider,{value:W,children:f})})})})})}),dP=re(cr)({[`& .${ni.container}`]:{outline:0},[`& .${ni.paper}`]:{outline:0,minWidth:Ka}}),pP=re(lr)({"&:first-of-type":{padding:0}});function fP(e){const{children:t,onDismiss:n,open:r,slots:o,slotProps:s}=e,i=o?.dialog??dP,l=o?.mobileTransition??ao;return a.jsx(i,U({open:r,onClose:n},s?.dialog,{TransitionComponent:l,TransitionProps:s?.mobileTransition,PaperComponent:o?.mobilePaper,PaperProps:s?.mobilePaper,children:a.jsx(pP,{children:t})}))}const hP=["props","getOpenDialogAriaText"],mP=e=>{let{props:t,getOpenDialogAriaText:n}=e,r=Fe(e,hP);const{slots:o,slotProps:s,className:i,sx:l,format:c,formatDensity:u,enableAccessibleFieldDOMStructure:d,selectedSections:f,onSelectedSectionsChange:m,timezone:h,name:g,label:y,inputRef:b,readOnly:x,disabled:C,localeText:T}=t,w=D.useRef(null),M=Un(),E=s?.toolbar?.hidden??!1,{open:j,actions:F,layoutProps:O,renderCurrentView:V,fieldProps:L,contextValue:v}=Jh(U({},r,{props:t,fieldRef:w,autoFocusView:!0,additionalViewProps:{},wrapperVariant:"mobile"})),N=o.field,A=Ge({elementType:N,externalSlotProps:s?.field,additionalProps:U({},L,E&&{id:M},!(C||x)&&{onClick:F.onOpen,onKeyDown:S1(F.onOpen)},{readOnly:x??!0,disabled:C,className:i,sx:l,format:c,formatDensity:u,enableAccessibleFieldDOMStructure:d,selectedSections:f,onSelectedSectionsChange:m,timezone:h,label:y,name:g},b?{inputRef:b}:{}),ownerState:t});A.inputProps=U({},A.inputProps,{"aria-label":n(L.value)});const $=U({textField:o.textField},A.slots),R=o.layout??sm;let _=M;E&&(y?_=`${M}-label`:_=void 0);const z=U({},s,{toolbar:U({},s?.toolbar,{titleId:M}),mobilePaper:U({"aria-labelledby":_},s?.mobilePaper)}),W=Ze(w,A.unstableFieldRef);return{renderPicker:()=>a.jsxs(im,{contextValue:v,localeText:T,children:[a.jsx(N,U({},A,{slots:$,slotProps:z,unstableFieldRef:W})),a.jsx(fP,U({},F,{open:j,slots:o,slotProps:z,children:a.jsx(R,U({},O,z?.layout,{slots:o,slotProps:z,children:V()}))}))]})}},Om=D.forwardRef(function(t,n){const r=Cr(),o=It(),s=jh(t,"MuiMobileDatePicker"),i=U({day:Ko,month:Ko,year:Ko},s.viewRenderers),l=U({},s,{viewRenderers:i,format:$c(o,s,!1),slots:U({field:wm},s.slots),slotProps:U({},s.slotProps,{field:u=>U({},In(s.slotProps?.field,u),Ah(s),{ref:n}),toolbar:U({hidden:!1},s.slotProps?.toolbar)})}),{renderPicker:c}=mP({props:l,valueManager:or,valueType:"date",getOpenDialogAriaText:Oh({utils:o,formatKey:"fullDate",contextTranslation:r.openDatePickerDialogue,propsTranslation:l.localeText?.openDatePickerDialogue}),validator:Ci});return c()});Om.propTypes={autoFocus:fe.bool,className:fe.string,closeOnSelect:fe.bool,dayOfWeekFormatter:fe.func,defaultValue:fe.object,disabled:fe.bool,disableFuture:fe.bool,disableHighlightToday:fe.bool,disableOpenPicker:fe.bool,disablePast:fe.bool,displayWeekNumber:fe.bool,enableAccessibleFieldDOMStructure:fe.any,fixedWeekNumber:fe.number,format:fe.string,formatDensity:fe.oneOf(["dense","spacious"]),inputRef:vh,label:fe.node,loading:fe.bool,localeText:fe.object,maxDate:fe.object,minDate:fe.object,monthsPerRow:fe.oneOf([3,4]),name:fe.string,onAccept:fe.func,onChange:fe.func,onClose:fe.func,onError:fe.func,onMonthChange:fe.func,onOpen:fe.func,onSelectedSectionsChange:fe.func,onViewChange:fe.func,onYearChange:fe.func,open:fe.bool,openTo:fe.oneOf(["day","month","year"]),orientation:fe.oneOf(["landscape","portrait"]),readOnly:fe.bool,reduceAnimations:fe.bool,referenceDate:fe.object,renderLoading:fe.func,selectedSections:fe.oneOfType([fe.oneOf(["all","day","empty","hours","meridiem","minutes","month","seconds","weekDay","year"]),fe.number]),shouldDisableDate:fe.func,shouldDisableMonth:fe.func,shouldDisableYear:fe.func,showDaysOutsideCurrentMonth:fe.bool,slotProps:fe.object,slots:fe.object,sx:fe.oneOfType([fe.arrayOf(fe.oneOfType([fe.func,fe.object,fe.bool])),fe.func,fe.object]),timezone:fe.string,value:fe.object,view:fe.oneOf(["day","month","year"]),viewRenderers:fe.shape({day:fe.func,month:fe.func,year:fe.func}),views:fe.arrayOf(fe.oneOf(["day","month","year"]).isRequired),yearsOrder:fe.oneOf(["asc","desc"]),yearsPerRow:fe.oneOf([3,4])};const gP=["desktopModeMediaQuery"],ro=D.forwardRef(function(t,n){const r=wt({props:t,name:"MuiDatePicker"}),{desktopModeMediaQuery:o=C1}=r,s=Fe(r,gP);return xh(o,{defaultMatches:!0})?a.jsx(Pm,U({ref:n},s)):a.jsx(Om,U({ref:n},s))});function yP(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"?bP(n):n}function bP(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"?`
131
+ `:r==="t"?" ":r==="r"?"\r":r):e}Je.extend(gc);const Gp=14,xP=42;function vP(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(`
132
+ `):void 0}function Rm({given:e,value:t,onChange:n,options:r,optionsLoading:o,optionsFailed:s}){const i=e.label??e.name??"",l=e.type??"string",c=vP(e),u=yP(l,e.default),d=u!==void 0?`Default: ${u===""?"(empty)":u}`:void 0,f=c||d?a.jsxs(a.Fragment,{children:[c,c&&d?a.jsx("br",{}):null,d]}):void 0,m=l==="string"||Ks(l)==="string",h=!Qr(l)||typeof t!="string"||Lb(t),g=R=>a.jsx(I.TextField,{label:i,value:String(t),error:!0,inputProps:{readOnly:!0},helperText:a.jsxs(a.Fragment,{children:[`Not a ${R}. Clear it to pick one.`,f?a.jsx("br",{}):null,f]}),slotProps:{input:{endAdornment:a.jsx(Il,{onClear:()=>n(null)})}},fullWidth:!0,size:"small"}),y=Qr(l),b=e.control==="multiselect"&&y,x=Qr(l),C=e.control==="select"||e.control==="multiselect",T=C?x?typeof t=="string"?Nb(t):[]:typeof t=="string"&&t!==""?[t]:[]:[];if(C&&m&&h&&!(!b&&T.length>1)){const R=_=>{const z=x?yc(_):void 0;if(_.length===0||z===""){n(null);return}n(x?z:_[0])};return a.jsx(I.Autocomplete,{multiple:b,disableCloseOnSelect:b,freeSolo:!0,forcePopupIcon:!0,autoSelect:!0,options:r??[],loading:o,noOptionsText:s?"Options unavailable":"No matching values",value:b?T:T[0]??null,onChange:(_,z)=>R(z===null?[]:Array.isArray(z)?z:[z]),renderInput:_=>a.jsx(I.TextField,{..._,label:i,size:"small",placeholder:T.length!==0?void 0:t===""?"All":u??"All",error:s,helperText:s?a.jsxs(a.Fragment,{children:["Could not load the options for this control. Type a value to filter anyway.",f?a.jsx("br",{}):null,f]}):f,slotProps:{input:{..._.InputProps,endAdornment:a.jsxs(a.Fragment,{children:[o&&a.jsx(I.CircularProgress,{size:16}),_.InputProps.endAdornment]})}}}),fullWidth:!0})}const w=Qr(l)&&Ks(l)==="number",{rangeMin:M,rangeMax:E}=e,j=w&&typeof t=="string"?Vb(t):void 0,F=w&&typeof t=="string"?_b(t):void 0;if((w||l==="number")&&M!==void 0&&E!==void 0&&(!w||t===void 0||t===null||t===""||j!==void 0||F!==void 0)){const R=F??(j!==void 0?[j,E]:void 0),_=w?R?.[0]:typeof t=="number"?t:void 0;if(_===void 0&&t!==void 0&&t!==null&&t!=="")return g("number");const z=_??M,W=R??[M,E],H=W[1]>=E?`≥ ${W[0]}`:`${W[0]} to ${W[1]}`,G=w&&t==="",se=_!==void 0||G;return a.jsxs(I.FormControl,{fullWidth:!0,children:[a.jsxs(I.Box,{sx:{height:xP,px:`${Gp}px`,display:"flex",flexDirection:"column",justifyContent:"center"},children:[a.jsxs(I.Stack,{direction:"row",alignItems:"center",spacing:1,children:[a.jsx(I.Typography,{variant:"body2",color:"text.secondary",noWrap:!0,children:i}),a.jsx(I.Typography,{variant:"body2",sx:{fontWeight:600},children:se?G?"Any":w?H:String(z):w?"Any":u??"Unset"}),se&&a.jsx(I.IconButton,{size:"small","aria-label":"clear value",onClick:()=>n(null),sx:{p:0},children:a.jsx(ba,{fontSize:"small"})})]}),a.jsx(I.Slider,{size:"small",min:M,max:E,value:w?W:z,disableSwap:w,valueLabelDisplay:"auto","aria-label":w?void 0:i,getAriaLabel:w?pe=>pe===0?`${i} from`:`${i} to`:void 0,sx:{py:0,mt:.5},onChange:(pe,me)=>{if(w){const[X,K]=Array.isArray(me)?[me[0],me[1]]:[me,me];if(X<=M&&K>=E){n(null);return}n(K>=E?Bb(X):zb(X,K));return}n(Array.isArray(me)?me[0]:me)}})]}),f&&a.jsx(I.FormHelperText,{sx:{mx:`${Gp}px`},children:f})]})}const V=Qr(l)?Ks(l):void 0,L=V==="date"||V==="timestamp"||V==="timestamptz",v=typeof t=="string"&&/^\d{4}-\d{2}-\d{2}$/.test(t),N=t==null||v;if(L&&!v){const R=SP(t);if(R!==void 0)return a.jsx(CP,{label:i,state:R,onChange:n,helperNode:f,defaultDisplay:u})}if(L&&N){const R=v?Je.utc(t):null;return a.jsx(Xo,{dateAdapter:si,children:a.jsx(ro,{label:i,value:R?.isValid()?R:null,onChange:_=>n(_?_.format("YYYY-MM-DD"):null),slotProps:{textField:{fullWidth:!0,size:"small",helperText:f},field:{clearable:!0,onClear:()=>n(null)}}})})}if(l==="boolean"){const R=typeof t=="boolean";if(!R&&t!==void 0&&t!==null)return g("true or false");const _=e.default?.trim()==="true",z=R?t:_;return a.jsxs(I.FormControl,{children:[a.jsxs(I.Stack,{direction:"row",alignItems:"center",children:[a.jsx(I.FormControlLabel,{control:a.jsx(I.Checkbox,{checked:z,onChange:W=>n(W.target.checked)}),label:i}),R&&a.jsx(I.IconButton,{size:"small","aria-label":"clear value",onClick:()=>n(null),edge:"end",children:a.jsx(ba,{fontSize:"small"})})]}),f&&a.jsx(I.FormHelperText,{children:f})]})}if(l==="number"){const R=typeof t=="number"?t:"",_=t!=null;return _&&t!==""&&typeof t!="number"?g("number"):a.jsx(I.TextField,{label:i,type:"number",value:R,onChange:z=>{const W=z.target.value;n(W===""?null:Number(W))},placeholder:u,helperText:f,slotProps:{input:{endAdornment:_&&a.jsx(Il,{onClear:()=>n(null)})}},fullWidth:!0,size:"small"})}if(l==="date"||l==="timestamp"||l==="timestamptz"){const R=t instanceof Date?t:typeof t=="string"?(W=>W instanceof Date?W:null)(_f(l,t)):null,_=R?Je.utc(R):null;return t!=null&&t!==""&&R===null?g("date"):a.jsx(Xo,{dateAdapter:si,children:a.jsx(ro,{label:i,value:_,onChange:W=>n(W?Gb(W,R??void 0):null),slotProps:{textField:{fullWidth:!0,size:"small",helperText:f},field:{clearable:!0,onClear:()=>n(null)}}})})}const A=typeof t=="string"?t:"",$=t!=null;return a.jsx(I.TextField,{label:i,value:A,onChange:R=>n(R.target.value),placeholder:$?void 0:u??(l.startsWith("filter<")?l:void 0),helperText:f,slotProps:{input:{endAdornment:$&&a.jsx(Il,{onClear:()=>n(null)})}},fullWidth:!0,size:"small"})}function Il({onClear:e}){return a.jsx(I.InputAdornment,{position:"end",children:a.jsx(I.IconButton,{size:"small","aria-label":"clear value",onClick:e,edge:"end",children:a.jsx(ba,{fontSize:"small"})})})}function SP(e){if(e==null)return{kind:"unset"};if(typeof e!="string")return;if(e==="")return{kind:"any"};const t=Hb(e);if(t!==void 0)return{kind:"preset",key:t};const n=Yb(e);if(n!==void 0)return{kind:"days",...n}}const Yi="__custom__",Ml="__any__";function CP({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,l]=Y.useState(t.kind==="days"),[c,u]=Y.useState(t.kind==="days"?{from:t.firstDay,to:t.lastDay}:{});Y.useEffect(()=>{t.kind==="days"?(l(!0),u({from:t.firstDay,to:t.lastDay})):t.kind!=="unset"&&l(!1)},[s]);const d=t.kind!=="unset",f=i?Yi:t.kind==="preset"?t.key:t.kind==="any"?Ml:"",m=g=>{u(g),g.from&&g.to&&!Je.utc(g.to).isBefore(Je.utc(g.from))&&n(qb(g.from,g.to))},h=g=>{const y=g?Je.utc(g):null;return y?.isValid()?y:null};return a.jsxs(I.Stack,{direction:"row",spacing:1,"data-testid":"time-range",children:[a.jsxs(I.TextField,{select:!0,label:e,value:f,size:"small",fullWidth:!0,helperText:r,slotProps:{select:{displayEmpty:!0,renderValue:g=>{if(g===Yi)return"Custom range";if(g===Ml)return"Any time";const y=fa.find(b=>b.key===g);return y?y.label:o??"Any time"}},input:{endAdornment:d?a.jsx(I.IconButton,{size:"small","aria-label":"clear value",onClick:()=>{l(!1),u({}),n(null)},sx:{mr:2},children:a.jsx(ba,{fontSize:"small"})}):void 0}},onChange:g=>{const y=g.target.value;if(y===Yi){l(!0);return}l(!1);const b=Wb(y);b!==void 0&&n(b)},children:[t.kind==="any"&&a.jsx(I.MenuItem,{value:Ml,children:"Any time"}),fa.map(g=>a.jsx(I.MenuItem,{value:g.key,children:g.label},g.key)),a.jsx(I.MenuItem,{value:Yi,children:"Custom range"})]}),i&&a.jsxs(Xo,{dateAdapter:si,children:[a.jsx(ro,{label:"From",value:h(c.from),onChange:g=>m({...c,from:g?g.format("YYYY-MM-DD"):void 0}),slotProps:{textField:{size:"small"}}}),a.jsx(ro,{label:"To",value:h(c.to),minDate:h(c.from)??void 0,onChange:g=>m({...c,to:g?g.format("YYYY-MM-DD"):void 0}),slotProps:{textField:{size:"small"}}})]})]})}function iu({givens:e,values:t,onChange:n,onReset:r,layout:o="panel",options:s,optionsLoading:i,optionsFailed:l,apply:c,title:u}){if(e.length===0)return null;const d=Array.from(t.values()).some(h=>h!==null),f=e.map(h=>a.jsx(I.Box,{sx:o==="bar"?{minWidth:200,flex:"1 1 200px",maxWidth:320}:void 0,children:a.jsx(Rm,{given:h,value:h.name?t.get(h.name):void 0,onChange:g=>h.name&&n(h.name,g),options:h.name?s?.get(h.name):void 0,optionsLoading:i,optionsFailed:h.name?l?.has(h.name):void 0})},h.name)),m=a.jsxs(I.Stack,{direction:"row",alignItems:"center",spacing:1,children:[c&&a.jsx(I.Button,{variant:"contained",size:"small",disableElevation:!0,onClick:c.onApply,disabled:!c.pending,sx:{textTransform:"none"},children:"Apply"}),d&&a.jsx(I.Button,{variant:"text",size:"small",onClick:r,sx:{textTransform:"none"},children:"Reset"})]});return o==="bar"?a.jsx(I.Paper,{elevation:0,sx:{p:2,border:1,borderColor:"divider",borderRadius:1,backgroundColor:"background.paper"},children:a.jsxs(I.Stack,{direction:"row",alignItems:"flex-start",spacing:2,useFlexGap:!0,sx:{flexWrap:"wrap"},children:[f,a.jsx(I.Box,{sx:{flex:"0 0 auto",ml:"auto",pt:.5},children:m})]})}):a.jsxs(I.Paper,{elevation:0,sx:{p:3,backgroundColor:"transparent",border:"none",boxShadow:"none"},children:[a.jsxs(I.Stack,{direction:"row",alignItems:"center",justifyContent:"space-between",sx:{mb:2},children:[a.jsx(I.Typography,{variant:"subtitle2",sx:{fontWeight:600,color:"#333"},children:u??"Parameters"}),m]}),a.jsx(I.Box,{sx:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(220px, 1fr))",alignItems:"start",columnGap:3,rowGap:2.5},children:f})]})}function wP(){const[e]=Zi.useSearchParams(),t=Zi.useNavigate(),n=Zi.useLocation(),r=Y.useMemo(()=>Object.fromEntries(e.entries()),[e]),o=Y.useRef(new Set),s=Y.useCallback((i,l)=>{const c=new Set([...l,...o.current]);o.current=new Set([...o.current,...Object.keys(i),...l]);const u=new URLSearchParams(n.search);for(const d of c)Object.prototype.hasOwnProperty.call(i,d)||u.delete(d);for(const[d,f]of Object.entries(i))u.set(d,f);t({search:u.toString(),hash:n.hash},{replace:!0})},[t,n]);return{params:r,onGivensChange:s}}function Ht({text:e,size:t=20,color:n="primary",thickness:r=3.6,centered:o=!0,spacing:s=2,textVariant:i="body2"}){const l=a.jsxs(I.Box,{sx:{display:"flex",flexDirection:"column",alignItems:"center",gap:s},children:[a.jsx(I.CircularProgress,{size:t,color:n,thickness:r}),e&&a.jsx(I.Typography,{variant:i,color:"text.secondary",children:e})]});return o?a.jsx(I.Box,{sx:{display:"flex",justifyContent:"center",alignItems:"center",minHeight:"200px",width:"100%"},children:l}):l}const kP=new Set(["bar","line","chart","scatter_chart"]),TP=new Set(["table","dashboard","shape_map","segment_map","list","list_detail","big_value","cell","link","image"]);function la(e,t){return t==="fill"?"container":t==="fixed"||!e?"content":kP.has(e)?"container":"content"}function jm(e,t){return t==="fixed"?!0:t==="fill"?!1:e!==void 0&&TP.has(e)}function oc(e){return e==="dashboard"?3:2}function $m(e,t){let n=e.firstElementChild;for(let r=1;r<t&&n;r++)n=n.firstElementChild;return n}function Am(e,t){const n=$m(e,t);return n&&(n.scrollHeight||n.offsetHeight)||0}const Fm=400,Nm=700,Lm=600,Bm=800,Vm=400,sc=2e3;function zm(e){return e===void 0?sc:Math.min(e,sc)}function _m({sizing:e,contentHeight:t,maxHeight:n}){return e==="container"?n??Vm:t===void 0||t<=0?zm(n):n===void 0?t:Math.min(n,t)}const au=20,IP={radius:"8px",padding:`${au}px`};function Wm(e,t=IP){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}}const Hm=Xe(a.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"})),MP=new Set(["warn","error"]);function DP(e){if(!e?.length)return;const t=[];let n=!1;for(const r of e)!r.message||!MP.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(`
133
+ `)}}const PP=Y.lazy(()=>Promise.resolve().then(()=>T2));function ss({result:e,maxHeight:t,maxResultSize:n=0,renderLogs:r,drill:o}){const s=Y.useRef(null),[i,l]=Y.useState(void 0),[c,u]=Y.useState(void 0),[d,f]=Y.useState(!1),m=DP(r);if(!e)return null;if(n>0&&e.length>n&&!d)return a.jsxs(I.Box,{sx:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:2,p:4,backgroundColor:"#fafafa",border:"1px solid",borderColor:"#e0e0e0",borderRadius:1},children:[a.jsx(ln.Warning,{sx:{fontSize:48,color:"#757575"}}),a.jsx(I.Typography,{variant:"h6",color:"text.secondary",align:"center",children:"Processing large results may cause browser performance issues. Proceed?"}),a.jsx(I.Button,{variant:"contained",color:"primary",onClick:()=>f(!0),children:"Proceed"})]});const g=a.jsx(Ht,{text:"Loading...",centered:!0,size:32}),y=_m({sizing:i,contentHeight:c,maxHeight:t});return a.jsxs(I.Box,{ref:s,sx:{position:"relative",height:"auto",border:"0px",borderRadius:0,overflow:"hidden"},children:[e&&a.jsx(Y.Suspense,{fallback:g,children:a.jsx(PP,{result:e,height:y,onSizeChange:u,onSizing:l,drill:o})}),m&&a.jsx(I.Box,{sx:{position:"absolute",top:4,right:4,zIndex:1},children:a.jsx(I.Tooltip,{title:m.title,slotProps:{tooltip:{sx:{whiteSpace:"pre-line"}}},children:a.jsx(I.IconButton,{size:"small","aria-label":"Render tag warnings",sx:{backgroundColor:"rgba(255, 255, 255, 0.9)","&:hover":{backgroundColor:"rgba(255, 255, 255, 1)"}},children:a.jsx(Hm,{fontSize:"small",color:m.severity==="error"?"error":"warning"})})})})]})}const EP=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"]),OP={value:`# big_value
134
+ `};function RP(e){const t=e.schema?.fields;if(!Array.isArray(t)||t.length===0||!t.every(r=>r?.kind==="measure"))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 jP(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(EP.has(o))return!0}return!1}function $P(e){let t;try{t=JSON.parse(e)}catch{return e}if(!t||typeof t!="object"||!RP(t))return e;const n=Array.isArray(t.annotations)?t.annotations:[],r=n.map(o=>o?.value).filter(o=>typeof o=="string");return jP(r)?e:JSON.stringify({...t,annotations:[OP,...n]})}function AP(e){const t=e.split("->").at(-1)?.trim()??e;return/^[A-Za-z_][\w-]*$/.test(t)?Cc(t):e}function ic({environmentName:e,packageName:t,versionId:n,modelPath:r,queryName:o,tile:s,label:i,subtitle:l,borderless:c,givens:u,declaredTypes:d,givenNames:f,height:m,maxResultSize:h,drill:g}){const{apiClients:y}=xe.useServer(),{theme:b}=xe.usePublisherTheme(),x=bc(u,d,f),{data:C,isSuccess:T,isError:w,error:M}=vt({queryKey:["dashboardTile",e,t,n,r,o,s,JSON.stringify(x)],queryFn:()=>y.models.executeQueryModel(e,t,r,{queryName:o,query:s!==void 0?`run: ${s}`:void 0,givens:x,versionId:n}),...xe.CHART_RESULT_QUERY_OPTIONS}),E=Y.useMemo(()=>{const j=C?.data.result;return j===void 0||s===void 0?j:$P(j)},[C,s]);return a.jsxs(I.Paper,{elevation:0,sx:{border:c?"none":b.border,borderRadius:c?0:1,background:c?"none":b.tile,overflow:"hidden",minHeight:120,p:c?"12px 0":`${au}px`},children:[s!==void 0&&a.jsxs(I.Box,{sx:{pb:1.5},children:[a.jsx(I.Typography,{variant:"subtitle2",sx:{fontWeight:500,color:b.tileTitle,fontFamily:b.font.family},title:s,children:i??AP(s)}),l!==void 0&&a.jsx(I.Typography,{variant:"caption",sx:{display:"block",color:b.tileTitle,fontFamily:b.font.family,opacity:.8},children:l})]}),!T&&!w&&a.jsx(Ht,{text:"Running…"}),T&&a.jsx(ss,{result:E,maxHeight:m,maxResultSize:h,renderLogs:C.data.renderLogs,drill:g}),w&&a.jsx(I.Box,{sx:{p:2},children:a.jsx(_t,{context:s??o??r,error:M})})]})}const FP=2;function NP(e,t){const n=Math.min(e.colspan??1,t);return e.break?`1 / span ${n}`:`span ${n}`}function LP({resourceUri:e,dashboard:t,givens:n,onGivensChange:r,onNavigate:o,height:s,maxResultSize:i}){const l=St(e),{apiClients:c}=xe.useServer(),u=l.environmentName??"",d=l.packageName??"",f=l.versionId,m=!!l.environmentName&&!!l.packageName,{data:h,isSuccess:g,isError:y,error:b}=vt({queryKey:["dashboard",u,d,f,t],queryFn:()=>c.dashboards.getDashboard(u,d,t,f),enabled:m}),x=h?.data,C=Y.useMemo(()=>x?.givens??[],[x]),T=Y.useMemo(()=>new Map(C.filter(G=>G.name!==void 0).map(G=>[G.name,G.type])),[C]),w=Y.useCallback(G=>{g&&r?.(G,Array.from(T.keys()))},[g,r,T]),{draft:M,applied:E,setGiven:j,reset:F,apply:O,pending:V}=xc({declaredTypes:T,startingValues:x?.startingGivens,params:n,onParamsChange:g?w:void 0,documentKey:`${u}/${d}/${f??""}/${t}`,autorun:x?.autorun!==!1}),{options:L,isLoading:v,failed:N}=vc(u,d,x?.path,C,f,{values:E,declaredTypes:T}),{canSelf:A,onSelf:$}=kc({declaredTypes:T,setGiven:j,documentName:t}),{drill:R,drillMenu:_}=wc({onNavigate:o,onSelf:$,canSelf:A,selfLabel:"Filter this dashboard"});if(!m)return a.jsxs(I.Alert,{severity:"error",children:["A dashboard resource URI must name an environment and a package. Received: ",e]});if(y)return a.jsx(_t,{context:`${u} > ${d} > ${t}`,error:b});if(!g||!x)return a.jsx(Ht,{text:"Loading dashboard…"});if(x.error)return a.jsxs(I.Stack,{spacing:2,children:[a.jsx(Zp,{manifest:x}),a.jsx(I.Alert,{severity:"error",children:x.error})]});const z=x.path,W=x.tiles??[],H=x.dashboardColumns??FP;return a.jsxs(I.Stack,{spacing:2,children:[a.jsx(Zp,{manifest:x}),a.jsx(iu,{givens:C,values:M,onChange:j,onReset:F,layout:"bar",options:L,optionsLoading:v,optionsFailed:N,apply:x.autorun===!1?{onApply:O,pending:V}:void 0}),z===void 0?a.jsx(I.Alert,{severity:"error",children:"This dashboard has no model path, so there is nothing to run."}):x.query!==void 0?a.jsx(ic,{environmentName:u,packageName:d,versionId:f,modelPath:z,queryName:x.query,givens:E,declaredTypes:T,height:s,maxResultSize:i,drill:R}):W.length>0?a.jsx(I.Box,{sx:{display:"grid",gridTemplateColumns:{xs:"1fr",md:`repeat(${H}, minmax(0, 1fr))`},gap:2},children:W.map((G,se)=>a.jsx(I.Box,{sx:{display:"grid",gridColumn:{md:NP(G,H)}},children:a.jsx(ic,{environmentName:u,packageName:d,versionId:f,modelPath:z,tile:G.query,label:G.label,subtitle:G.subtitle,borderless:G.borderless,givens:E,declaredTypes:T,givenNames:G.givenNames,height:s??Fm,maxResultSize:i,drill:R})},`${se}:${G.query}`))}):a.jsx(I.Alert,{severity:"warning",children:"This dashboard names neither a query nor any tiles."}),_]})}function Zp({manifest:e}){return a.jsxs(I.Box,{children:[a.jsx(I.Typography,{variant:"h5",sx:{fontWeight:600},children:e.title??e.name}),e.description&&a.jsx(I.Box,{sx:{color:"text.secondary",typography:"body2","& > :first-of-type":{mt:0},"& > :last-child":{mb:0},"& h1, & h2, & h3, & h4, & h5, & h6":{fontSize:"inherit",fontWeight:600,m:"0.5em 0 0.25em"},"& p":{m:"0.5em 0"},"& ul, & ol":{m:"0.5em 0",pl:3},"& code":{fontFamily:"monospace",fontSize:"0.9em"}},children:a.jsx(pa,{children:e.description})})]})}const Um=Xe(a.jsx("path",{d:"M19 19H5V5h7V3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2v-7h-2zM14 3v2h3.59l-9.83 9.83 1.41 1.41L19 6.41V10h2V3z"})),BP="publisher:resize";function VP(e){return typeof e=="object"&&e!==null&&e.type===BP&&typeof e.height=="number"}function lu(e){return e.replace(/\/api\/v0\/?$/,"")}function qm({server:e,environmentName:t,packageName:n,path:r}){const o=r.startsWith("public/")?r.slice(7):r;return`${lu(e)}/environments/${encodeURIComponent(t)}/packages/${encodeURIComponent(n)}/`+o}function zP(e){try{const{environmentName:t,packageName:n,modelPath:r}=St(e);return!t||!n||!r?null:{environmentName:t,packageName:n,dataAppPath:r}}catch{return null}}function _P({resourceUri:e}){const{server:t,apiClients:n}=xe.useServer(),r=zP(e),o=r?.environmentName??"",s=r?.packageName??"",i=r?.dataAppPath??"",l=Y.useMemo(()=>qm({server:t,environmentName:o,packageName:s,path:i}),[t,o,s,i]),u=vt({queryKey:["data-apps",o,s],queryFn:()=>n.dataApps.listDataApps(o,s),enabled:!!r}).data?.data?.find(y=>y.path===i),d=u?.title??i,f=u?.fit==="viewport",m=Y.useRef(null),[h,g]=Y.useState(120);return Y.useEffect(()=>{if(f)return;function y(b){VP(b.data)&&b.source===m.current?.contentWindow&&b.data.height>0&&g(Math.ceil(b.data.height))}return window.addEventListener("message",y),()=>window.removeEventListener("message",y)},[f]),r?a.jsxs(I.Box,{sx:{p:3,...f?{height:"100%",display:"flex",flexDirection:"column"}:{maxWidth:1200,mx:"auto"}},children:[a.jsxs(I.Stack,{direction:"row",alignItems:"baseline",spacing:1,sx:{mb:1,flexShrink:0},children:[a.jsx(I.Typography,{variant:"h6",sx:{fontWeight:600,letterSpacing:"-0.025em"},children:d}),a.jsx(I.Typography,{variant:"caption",color:"text.secondary",sx:{fontFamily:xe.MONO_FONT_FAMILY},children:i}),a.jsx(I.Box,{sx:{flex:1}}),a.jsx(I.Tooltip,{title:"Open standalone in new tab",children:a.jsx(I.IconButton,{size:"small",href:l,target:"_blank",rel:"noopener noreferrer","aria-label":"Open standalone in new tab",sx:{color:"text.secondary"},children:a.jsx(Um,{fontSize:"small"})})})]}),a.jsx(I.Box,{sx:{border:"1px solid",borderColor:"divider",borderRadius:1.5,overflow:"hidden",backgroundColor:"background.paper",...f?{flex:1,minHeight:0}:{}},children:a.jsx("iframe",{ref:m,src:l,title:d,sandbox:"allow-scripts allow-same-origin allow-forms",style:{display:"block",width:"100%",height:f?"100%":h,border:0}})})]}):a.jsxs(I.Box,{sx:{p:3,maxWidth:1200,mx:"auto"},children:[a.jsx(I.Typography,{variant:"h6",sx:{fontWeight:600},children:"Can't open data app"}),a.jsxs(I.Typography,{variant:"body2",color:"text.secondary",sx:{mt:1},children:["This data app link is missing an environment, package, or path:",a.jsx(I.Box,{component:"span",sx:{fontFamily:xe.MONO_FONT_FAMILY,ml:1},children:e})]})]})}const Ym=Xe(a.jsx("path",{d:"M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20z"})),ui=Xe(a.jsx("path",{d:"M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6z"}));function WP({onSubmit:e,isSubmitting:t,disabled:n,disabledReason:r}){const[o,s]=Y.useState(!1),[i,l]=Y.useState(!1),c=()=>s(!1),u=async()=>{try{await e({forceRefresh:i}),s(!1)}catch{}},d=a.jsx("span",{children:a.jsx(I.Button,{variant:"contained",startIcon:a.jsx(ui,{}),onClick:()=>s(!0),disabled:n,"aria-label":"New materialization",children:"New materialization"})});return a.jsxs(a.Fragment,{children:[n&&r?a.jsx(I.Tooltip,{title:r,children:d}):d,a.jsxs(I.Dialog,{open:o,onClose:c,maxWidth:"xs",fullWidth:!0,"aria-labelledby":"create-materialization-title",children:[a.jsx(I.DialogTitle,{id:"create-materialization-title",children:"New materialization"}),a.jsxs(I.DialogContent,{children:[a.jsx(I.DialogContentText,{sx:{mb:2},children:"Materialize every persist source in this package: compile, build the tables, and load them so queries serve from the materialized tables."}),a.jsx(I.FormGroup,{children:a.jsx(I.FormControlLabel,{control:a.jsx(I.Switch,{checked:i,onChange:f=>l(f.target.checked)}),label:"Force refresh (rebuild even if unchanged)"})})]}),a.jsxs(I.DialogActions,{children:[a.jsx(I.Button,{onClick:c,children:"Cancel"}),a.jsx(I.Button,{variant:"contained",loading:t,onClick:u,children:"Materialize"})]})]})]})}const ir=Xe(a.jsx("path",{d:"M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"}));function ac({children:e}){return a.jsx(I.Typography,{variant:"caption",component:"h6",sx:{display:"block",textTransform:"uppercase",letterSpacing:"0.06em",fontWeight:600,color:"text.secondary",mb:1},children:e})}function di(e){return e===xe.MaterializationStatus.Pending||e===xe.MaterializationStatus.ManifestRowsReady}function HP(e){return e===xe.MaterializationStatus.ManifestFileReady||e===xe.MaterializationStatus.Failed||e===xe.MaterializationStatus.Cancelled}function Km(e){switch(e){case xe.MaterializationStatus.ManifestFileReady:return"Done";case xe.MaterializationStatus.Failed:return"Failed";case xe.MaterializationStatus.Cancelled:return"Cancelled";case xe.MaterializationStatus.Pending:case xe.MaterializationStatus.ManifestRowsReady:return"Pending";default:return"Unknown"}}function Gm(e){switch(e){case xe.MaterializationStatus.ManifestRowsReady:return"info";case xe.MaterializationStatus.ManifestFileReady:return"success";case xe.MaterializationStatus.Failed:return"error";case xe.MaterializationStatus.Cancelled:return"warning";case xe.MaterializationStatus.Pending:default:return"default"}}function Zm(e){return e.metadata??{}}function UP(e){return e.trigger==="SCHEDULER"?"Scheduled":"Manual"}function Xm(e,t){if(!e)return"-";const n=new Date(e).getTime(),r=t?new Date(t).getTime():Date.now(),o=Math.max(0,r-n);if(o<1e3)return`${o}ms`;const s=Math.round(o/1e3);if(s<60)return`${s}s`;const i=Math.floor(s/60),l=s%60;if(i<60)return`${i}m ${l}s`;const c=Math.floor(i/60),u=i%60;return`${c}h ${u}m`}function lc(e){if(!e)return"—";const t=new Date(e);return Number.isNaN(t.getTime())?"—":t.toLocaleString(void 0,{year:"numeric",month:"short",day:"numeric",hour:"numeric",minute:"2-digit"})}function qP(e){if(!e)return"-";const t=new Date(e).getTime(),n=Math.round((Date.now()-t)/1e3);if(n<60)return"just now";const r=Math.floor(n/60);if(r<60)return`${r}m ago`;const o=Math.floor(r/60);return o<24?`${o}h ago`:`${Math.floor(o/24)}d ago`}function YP({entries:e,builtAt:t}){const n=Object.entries(e??{});return a.jsxs(I.Box,{children:[a.jsxs(I.Stack,{direction:"row",alignItems:"baseline",justifyContent:"space-between",children:[a.jsx(ac,{children:"Build manifest"}),t&&a.jsxs(I.Typography,{variant:"caption",color:"text.secondary",children:["Built ",lc(t)]})]}),n.length===0?a.jsx(I.Typography,{variant:"body2",color:"text.secondary",sx:{fontStyle:"italic"},children:"No materialized tables yet."}):a.jsxs(I.Table,{size:"small",children:[a.jsx(I.TableHead,{children:a.jsxs(I.TableRow,{children:[a.jsx(I.TableCell,{children:"Source"}),a.jsx(I.TableCell,{children:"Table name"}),a.jsx(I.TableCell,{children:"Connection"}),a.jsx(I.TableCell,{children:"Realization"}),a.jsx(I.TableCell,{align:"right",children:"Rows"})]})}),a.jsx(I.TableBody,{children:n.map(([r,o])=>a.jsxs(I.TableRow,{children:[a.jsx(I.TableCell,{sx:{fontFamily:xe.MONO_FONT_FAMILY},children:o.sourceName??r}),a.jsx(I.TableCell,{sx:{fontFamily:xe.MONO_FONT_FAMILY},children:o.physicalTableName??"-"}),a.jsx(I.TableCell,{sx:{fontFamily:xe.MONO_FONT_FAMILY},children:o.connectionName??"-"}),a.jsx(I.TableCell,{children:o.realization??"-"}),a.jsx(I.TableCell,{align:"right",children:o.rowCount??"-"})]},r))})]})]})}const Ma=Xe([a.jsx("path",{d:"M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2M12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8"},"0"),a.jsx("path",{d:"M12.5 7H11v6l5.25 3.15.75-1.23-4.5-2.67z"},"1")]),KP=Xe(a.jsx("path",{d:"M9 11.24V7.5C9 6.12 10.12 5 11.5 5S14 6.12 14 7.5v3.74c1.21-.81 2-2.18 2-3.74C16 5.01 13.99 3 11.5 3S7 5.01 7 7.5c0 1.56.79 2.93 2 3.74m9.84 4.63-4.54-2.26c-.17-.07-.35-.11-.54-.11H13v-6c0-.83-.67-1.5-1.5-1.5S10 6.67 10 7.5v10.74c-3.6-.76-3.54-.75-3.67-.75-.31 0-.59.13-.79.33l-.79.8 4.94 4.94c.27.27.65.44 1.06.44h6.79c.75 0 1.33-.55 1.44-1.28l.75-5.27c.01-.07.02-.14.02-.2 0-.62-.38-1.16-.91-1.38"}));function Qm({meta:e}){const t=e.trigger==="SCHEDULER";return a.jsx(I.Tooltip,{title:t?"Fired by the materialization schedule":"Triggered manually",children:a.jsx(I.Chip,{size:"small",variant:"outlined",color:t?"info":"default",icon:t?a.jsx(Ma,{fontSize:"small"}):a.jsx(KP,{fontSize:"small"}),label:UP(e)})})}function Jm({materialization:e,buildPlan:t,showBuildPlan:n=!0,onClose:r}){const o=e?Zm(e):{},s=Object.values(t?.sources??{});return a.jsx(I.Dialog,{open:e!==null,onClose:r,maxWidth:"md",fullWidth:!0,"aria-labelledby":"materialization-detail-title",children:e&&a.jsxs(a.Fragment,{children:[a.jsxs(I.DialogTitle,{sx:{pr:6,pb:1.5},id:"materialization-detail-title",children:[a.jsxs(I.Stack,{direction:"row",alignItems:"center",spacing:1,sx:{mb:.75},children:[a.jsx(I.Chip,{size:"small",label:Km(e.status),color:Gm(e.status),variant:di(e.status)?"filled":"outlined"}),a.jsx(Qm,{meta:o})]}),a.jsx(I.Typography,{variant:"subtitle1",sx:{fontWeight:600},children:e.packageName??"Materialization"}),a.jsx(I.Typography,{variant:"caption",color:"text.secondary",sx:{fontFamily:xe.MONO_FONT_FAMILY,wordBreak:"break-all"},children:e.id}),a.jsx(I.IconButton,{"aria-label":"close",onClick:r,sx:{position:"absolute",right:8,top:8},children:a.jsx(ir,{fontSize:"small"})})]}),a.jsxs(I.DialogContent,{dividers:!0,children:[a.jsxs(I.Box,{sx:{bgcolor:"action.hover",borderRadius:2,p:2,mb:3,display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(140px, 1fr))",gap:2},children:[a.jsx(Es,{label:"Started",value:lc(e.startedAt??e.createdAt)}),a.jsx(Es,{label:"Completed",value:lc(e.completedAt)}),a.jsx(Es,{label:"Duration",value:Xm(e.startedAt,e.completedAt)}),a.jsx(Es,{label:"Sources",value:`${o.sourcesBuilt??0} built · ${o.sourcesReused??0} reused`}),a.jsx(Es,{label:"Force refresh",value:o.forceRefresh?"Yes":"No"})]}),e.error&&a.jsxs(I.Box,{sx:{borderRadius:2,p:2,mb:3,border:"1px solid",borderColor:"error.main"},children:[a.jsx(ac,{children:a.jsx(I.Box,{component:"span",sx:{color:"error.main"},children:"Error"})}),a.jsx(I.Typography,{variant:"body2",sx:{fontFamily:xe.MONO_FONT_FAMILY,whiteSpace:"pre-wrap"},children:e.error})]}),n&&a.jsxs(I.Box,{sx:{mb:3},children:[a.jsx(ac,{children:"Build plan"}),s.length===0?a.jsx(I.Typography,{variant:"body2",color:"text.secondary",sx:{fontStyle:"italic"},children:"This package has no persist sources."}):a.jsxs(I.Table,{size:"small",children:[a.jsx(I.TableHead,{children:a.jsxs(I.TableRow,{children:[a.jsx(I.TableCell,{children:"Source"}),a.jsx(I.TableCell,{children:"Connection"}),a.jsx(I.TableCell,{children:"Dialect"}),a.jsx(I.TableCell,{align:"right",children:"Columns"}),a.jsx(I.TableCell,{children:"Source Entity ID"})]})}),a.jsx(I.TableBody,{children:s.map(i=>a.jsxs(I.TableRow,{children:[a.jsx(I.TableCell,{sx:{fontFamily:xe.MONO_FONT_FAMILY},children:i.name}),a.jsx(I.TableCell,{sx:{fontFamily:xe.MONO_FONT_FAMILY},children:i.connectionName}),a.jsx(I.TableCell,{children:i.dialect??"-"}),a.jsx(I.TableCell,{align:"right",children:i.columns?.length??0}),a.jsx(I.TableCell,{sx:{fontFamily:xe.MONO_FONT_FAMILY,fontSize:"0.75rem",wordBreak:"break-all",maxWidth:220},children:i.sourceEntityId})]},i.sourceID))})]})]}),a.jsx(YP,{entries:e.manifest?.entries,builtAt:e.manifest?.builtAt})]})]})})}function Es({label:e,value:t}){return a.jsxs(I.Box,{children:[a.jsx(I.Typography,{variant:"caption",color:"text.secondary",display:"block",children:e}),a.jsx(I.Typography,{variant:"body2",children:t})]})}const GP=Xe(a.jsx("path",{d:"M6 6h12v12H6z"}));function ZP(e){return $e("PrivateSwitchBase",e)}Ee("PrivateSwitchBase",["root","checked","disabled","input","edgeStart","edgeEnd"]);const XP=e=>{const{classes:t,checked:n,disabled:r,edge:o}=e,s={root:["root",n&&"checked",r&&"disabled",o&&`edge${ve(o)}`],input:["input"]};return Re(s,ZP,t)},QP=re(io,{name:"MuiSwitchBase"})({padding:9,borderRadius:"50%",variants:[{props:{edge:"start",size:"small"},style:{marginLeft:-3}},{props:({edge:e,ownerState:t})=>e==="start"&&t.size!=="small",style:{marginLeft:-12}},{props:{edge:"end",size:"small"},style:{marginRight:-3}},{props:({edge:e,ownerState:t})=>e==="end"&&t.size!=="small",style:{marginRight:-12}}]}),JP=re("input",{name:"MuiSwitchBase",shouldForwardProp:nn})({cursor:"inherit",position:"absolute",opacity:0,width:"100%",height:"100%",top:0,left:0,margin:0,padding:0,zIndex:1}),eE=D.forwardRef(function(t,n){const{autoFocus:r,checked:o,checkedIcon:s,defaultChecked:i,disabled:l,disableFocusRipple:c=!1,edge:u=!1,icon:d,id:f,inputProps:m,inputRef:h,name:g,onBlur:y,onChange:b,onFocus:x,readOnly:C,required:T=!1,tabIndex:w,type:M,value:E,slots:j={},slotProps:F={},...O}=t,[V,L]=mn({controlled:o,default:!!i,name:"SwitchBase",state:"checked"}),v=yn(),N=X=>{x&&x(X),v&&v.onFocus&&v.onFocus(X)},A=X=>{y&&y(X),v&&v.onBlur&&v.onBlur(X)},$=X=>{if(X.nativeEvent.defaultPrevented)return;const K=X.target.checked;L(K),b&&b(X,K)};let R=l;v&&typeof R>"u"&&(R=v.disabled);const _=M==="checkbox"||M==="radio",z={...t,checked:V,disabled:R,disableFocusRipple:c,edge:u},W=XP(z),H={slots:j,slotProps:{input:m,...F}},[G,se]=et("root",{ref:n,elementType:QP,className:W.root,shouldForwardComponentProp:!0,externalForwardedProps:{...H,component:"span",...O},getSlotProps:X=>({...X,onFocus:K=>{X.onFocus?.(K),N(K)},onBlur:K=>{X.onBlur?.(K),A(K)}}),ownerState:z,additionalProps:{centerRipple:!0,focusRipple:!c,disabled:R,role:void 0,tabIndex:null}}),[pe,me]=et("input",{ref:h,elementType:JP,className:W.input,externalForwardedProps:H,getSlotProps:X=>({...X,onChange:K=>{X.onChange?.(K),$(K)}}),ownerState:z,additionalProps:{autoFocus:r,checked:o,defaultChecked:i,disabled:R,id:_?f:void 0,name:g,readOnly:C,required:T,tabIndex:w,type:M,...M==="checkbox"&&E===void 0?{}:{value:E}}});return a.jsxs(G,{...se,children:[a.jsx(pe,{...me}),V?s:d]})}),tE=Xe(a.jsx("path",{d:"M19 5v14H5V5h14m0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2z"})),nE=Xe(a.jsx("path",{d:"M19 3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.11 0 2-.9 2-2V5c0-1.1-.89-2-2-2zm-9 14l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"})),rE=Xe(a.jsx("path",{d:"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-2 10H7v-2h10v2z"}));function oE(e){return $e("MuiCheckbox",e)}const Dl=Ee("MuiCheckbox",["root","checked","disabled","indeterminate","colorPrimary","colorSecondary","sizeSmall","sizeMedium"]),sE=e=>{const{classes:t,indeterminate:n,color:r,size:o}=e,s={root:["root",n&&"indeterminate",`color${ve(r)}`,`size${ve(o)}`]},i=Re(s,oE,t);return{...t,...i}},iE=re(eE,{shouldForwardProp:e=>nn(e)||e==="classes",name:"MuiCheckbox",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.indeterminate&&t.indeterminate,t[`size${ve(n.size)}`],n.color!=="default"&&t[`color${ve(n.color)}`]]}})(He(({theme:e})=>({color:(e.vars||e).palette.text.secondary,variants:[{props:{color:"default",disableRipple:!1},style:{"&:hover":{backgroundColor:e.alpha((e.vars||e).palette.action.active,(e.vars||e).palette.action.hoverOpacity)}}},...Object.entries(e.palette).filter(tn()).map(([t])=>({props:{color:t,disableRipple:!1},style:{"&:hover":{backgroundColor:e.alpha((e.vars||e).palette[t].main,(e.vars||e).palette.action.hoverOpacity)}}})),...Object.entries(e.palette).filter(tn()).map(([t])=>({props:{color:t},style:{[`&.${Dl.checked}, &.${Dl.indeterminate}`]:{color:(e.vars||e).palette[t].main},[`&.${Dl.disabled}`]:{color:(e.vars||e).palette.action.disabled}}})),{props:{disableRipple:!1},style:{"&:hover":{"@media (hover: none)":{backgroundColor:"transparent"}}}}]}))),aE=a.jsx(nE,{}),lE=a.jsx(tE,{}),cE=a.jsx(rE,{}),cu=D.forwardRef(function(t,n){const r=We({props:t,name:"MuiCheckbox"}),{checkedIcon:o=aE,color:s="primary",icon:i=lE,indeterminate:l=!1,indeterminateIcon:c=cE,inputProps:u,size:d="medium",disableRipple:f=!1,className:m,slots:h={},slotProps:g={},...y}=r,b=l?c:i,x=l?c:o,C={...r,disableRipple:f,color:s,indeterminate:l,size:d},T=sE(C),w=g.input??u,[M,E]=et("root",{ref:n,elementType:iE,className:Te(T.root,m),shouldForwardComponentProp:!0,externalForwardedProps:{slots:h,slotProps:g,...y},ownerState:C,additionalProps:{type:"checkbox",icon:D.cloneElement(b,{fontSize:b.props.fontSize??d}),checkedIcon:D.cloneElement(x,{fontSize:x.props.fontSize??d}),disableRipple:f,slots:h,slotProps:{input:mh(typeof w=="function"?w(C):w,{"data-indeterminate":l})}}});return a.jsx(M,{...E,classes:T})}),uE=e=>{const{classes:t}=e;return Re({root:["root"]},tP,t)},dE=re(rt,{name:"MuiDialogTitle",slot:"Root"})({padding:"16px 24px",flex:"0 0 auto"}),wr=D.forwardRef(function(t,n){const r=We({props:t,name:"MuiDialogTitle"}),{className:o,id:s,...i}=r,l=r,c=uE(l),{titleId:u=s}=D.useContext(Em);return a.jsx(dE,{component:"h2",className:Te(c.root,o),ownerState:l,ref:n,variant:"h6",id:s??u,...i})});function pE(e){return $e("MuiFormControlLabel",e)}const Us=Ee("MuiFormControlLabel",["root","labelPlacementStart","labelPlacementTop","labelPlacementBottom","disabled","label","error","required","asterisk"]),fE=e=>{const{classes:t,disabled:n,labelPlacement:r,error:o,required:s}=e,i={root:["root",n&&"disabled",`labelPlacement${ve(r)}`,o&&"error",s&&"required"],label:["label",n&&"disabled"],asterisk:["asterisk",o&&"error"]};return Re(i,pE,t)},hE=re("label",{name:"MuiFormControlLabel",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[{[`& .${Us.label}`]:t.label},t.root,t[`labelPlacement${ve(n.labelPlacement)}`]]}})(He(({theme:e})=>({display:"inline-flex",alignItems:"center",cursor:"pointer",verticalAlign:"middle",WebkitTapHighlightColor:"transparent",marginLeft:-11,marginRight:16,[`&.${Us.disabled}`]:{cursor:"default"},[`& .${Us.label}`]:{[`&.${Us.disabled}`]:{color:(e.vars||e).palette.text.disabled}},variants:[{props:{labelPlacement:"start"},style:{flexDirection:"row-reverse",marginRight:-11}},{props:{labelPlacement:"top"},style:{flexDirection:"column-reverse"}},{props:{labelPlacement:"bottom"},style:{flexDirection:"column"}},{props:({labelPlacement:t})=>t==="start"||t==="top"||t==="bottom",style:{marginLeft:16}}]}))),mE=re("span",{name:"MuiFormControlLabel",slot:"Asterisk"})(He(({theme:e})=>({[`&.${Us.error}`]:{color:(e.vars||e).palette.error.main}}))),gE=D.forwardRef(function(t,n){const r=We({props:t,name:"MuiFormControlLabel"}),{checked:o,className:s,componentsProps:i={},control:l,disabled:c,disableTypography:u,inputRef:d,label:f,labelPlacement:m="end",name:h,onChange:g,required:y,slots:b={},slotProps:x={},value:C,...T}=r,w=yn(),M=c??l.props.disabled??w?.disabled,E=y??l.props.required,j={disabled:M,required:E};["checked","name","onChange","value","inputRef"].forEach($=>{typeof l.props[$]>"u"&&typeof r[$]<"u"&&(j[$]=r[$])});const F=fo({props:r,muiFormControl:w,states:["error"]}),O={...r,disabled:M,labelPlacement:m,required:E,error:F.error},V=fE(O),L={slots:b,slotProps:{...i,...x}},[v,N]=et("typography",{elementType:rt,externalForwardedProps:L,ownerState:O});let A=f;return A!=null&&A.type!==rt&&!u&&(A=a.jsx(v,{component:"span",...N,className:Te(V.label,N?.className),children:A})),a.jsxs(hE,{className:Te(V.root,s),ownerState:O,ref:n,...T,children:[D.cloneElement(l,j),E?a.jsxs("div",{children:[A,a.jsxs(mE,{ownerState:O,"aria-hidden":!0,className:V.asterisk,children:[" ","*"]})]}):A]})});function yE(e){return $e("MuiListItemIcon",e)}const Xp=Ee("MuiListItemIcon",["root","alignItemsFlexStart"]),bE=e=>{const{alignItems:t,classes:n}=e;return Re({root:["root",t==="flex-start"&&"alignItemsFlexStart"]},yE,n)},xE=re("div",{name:"MuiListItemIcon",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.alignItems==="flex-start"&&t.alignItemsFlexStart]}})(He(({theme:e})=>({minWidth:56,color:(e.vars||e).palette.action.active,flexShrink:0,display:"inline-flex",variants:[{props:{alignItems:"flex-start"},style:{marginTop:8}}]}))),uu=D.forwardRef(function(t,n){const r=We({props:t,name:"MuiListItemIcon"}),{className:o,...s}=r,i=D.useContext(gr),l={...r,alignItems:i.alignItems},c=bE(l);return a.jsx(xE,{className:Te(c.root,o),ownerState:l,ref:n,...s})});function vE(e){return $e("MuiListItemText",e)}const Wo=Ee("MuiListItemText",["root","multiline","dense","inset","primary","secondary"]),SE=e=>{const{classes:t,inset:n,primary:r,secondary:o,dense:s}=e;return Re({root:["root",n&&"inset",s&&"dense",r&&o&&"multiline"],primary:["primary"],secondary:["secondary"]},vE,t)},CE=re("div",{name:"MuiListItemText",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[{[`& .${Wo.primary}`]:t.primary},{[`& .${Wo.secondary}`]:t.secondary},t.root,n.inset&&t.inset,n.primary&&n.secondary&&t.multiline,n.dense&&t.dense]}})({flex:"1 1 auto",minWidth:0,marginTop:4,marginBottom:4,[`.${cp.root}:where(& .${Wo.primary})`]:{display:"block"},[`.${cp.root}:where(& .${Wo.secondary})`]:{display:"block"},variants:[{props:({ownerState:e})=>e.primary&&e.secondary,style:{marginTop:6,marginBottom:6}},{props:({ownerState:e})=>e.inset,style:{paddingLeft:56}}]}),du=D.forwardRef(function(t,n){const r=We({props:t,name:"MuiListItemText"}),{children:o,className:s,disableTypography:i=!1,inset:l=!1,primary:c,primaryTypographyProps:u,secondary:d,secondaryTypographyProps:f,slots:m={},slotProps:h={},...g}=r,{dense:y}=D.useContext(gr);let b=c??o,x=d;const C={...r,disableTypography:i,inset:l,primary:!!b,secondary:!!x,dense:y},T=SE(C),w={slots:m,slotProps:{primary:u,secondary:f,...h}},[M,E]=et("root",{className:Te(T.root,s),elementType:CE,externalForwardedProps:{...w,...g},ownerState:C,ref:n}),[j,F]=et("primary",{className:T.primary,elementType:rt,externalForwardedProps:w,ownerState:C}),[O,V]=et("secondary",{className:T.secondary,elementType:rt,externalForwardedProps:w,ownerState:C});return b!=null&&b.type!==rt&&!i&&(b=a.jsx(j,{variant:y?"body2":"body1",component:F?.variant?void 0:"span",...F,children:b})),x!=null&&x.type!==rt&&!i&&(x=a.jsx(O,{variant:"body2",color:"textSecondary",...V,children:x})),a.jsxs(M,{...E,children:[b,x]})}),Qp=Ee("MuiDivider",["root","absolute","fullWidth","inset","middle","flexItem","light","vertical","withChildren","withChildrenVertical","textAlignRight","textAlignLeft","wrapper","wrapperVertical"]);function wE(e){return $e("MuiMenuItem",e)}const Os=Ee("MuiMenuItem",["root","focusVisible","dense","disabled","divider","gutters","selected"]),kE=(e,t)=>{const{ownerState:n}=e;return[t.root,n.dense&&t.dense,n.divider&&t.divider,!n.disableGutters&&t.gutters]},TE=e=>{const{disabled:t,dense:n,divider:r,disableGutters:o,selected:s,classes:i}=e,c=Re({root:["root",n&&"dense",t&&"disabled",!o&&"gutters",r&&"divider",s&&"selected"]},wE,i);return{...i,...c}},IE=re(io,{shouldForwardProp:e=>nn(e)||e==="classes",name:"MuiMenuItem",slot:"Root",overridesResolver:kE})(He(({theme:e})=>({...e.typography.body1,display:"flex",justifyContent:"flex-start",alignItems:"center",position:"relative",textDecoration:"none",minHeight:48,paddingTop:6,paddingBottom:6,boxSizing:"border-box",whiteSpace:"nowrap","&:hover":{textDecoration:"none",backgroundColor:(e.vars||e).palette.action.hover,"@media (hover: none)":{backgroundColor:"transparent"}},[`&.${Os.selected}`]:{backgroundColor:e.alpha((e.vars||e).palette.primary.main,(e.vars||e).palette.action.selectedOpacity),[`&.${Os.focusVisible}`]:{backgroundColor:e.alpha((e.vars||e).palette.primary.main,`${(e.vars||e).palette.action.selectedOpacity} + ${(e.vars||e).palette.action.focusOpacity}`)}},[`&.${Os.selected}:hover`]:{backgroundColor:e.alpha((e.vars||e).palette.primary.main,`${(e.vars||e).palette.action.selectedOpacity} + ${(e.vars||e).palette.action.hoverOpacity}`),"@media (hover: none)":{backgroundColor:e.alpha((e.vars||e).palette.primary.main,(e.vars||e).palette.action.selectedOpacity)}},[`&.${Os.focusVisible}`]:{backgroundColor:(e.vars||e).palette.action.focus},[`&.${Os.disabled}`]:{opacity:(e.vars||e).palette.action.disabledOpacity},[`& + .${Qp.root}`]:{marginTop:e.spacing(1),marginBottom:e.spacing(1)},[`& + .${Qp.inset}`]:{marginLeft:52},[`& .${Wo.root}`]:{marginTop:0,marginBottom:0},[`& .${Wo.inset}`]:{paddingLeft:36},[`& .${Xp.root}`]:{minWidth:36},variants:[{props:({ownerState:t})=>!t.disableGutters,style:{paddingLeft:16,paddingRight:16}},{props:({ownerState:t})=>t.divider,style:{borderBottom:`1px solid ${(e.vars||e).palette.divider}`,backgroundClip:"padding-box"}},{props:({ownerState:t})=>!t.dense,style:{[e.breakpoints.up("sm")]:{minHeight:"auto"}}},{props:({ownerState:t})=>t.dense,style:{minHeight:32,paddingTop:4,paddingBottom:4,...e.typography.body2,[`& .${Xp.root} svg`]:{fontSize:"1.25rem"}}}]}))),Ft=D.forwardRef(function(t,n){const r=We({props:t,name:"MuiMenuItem"}),{autoFocus:o=!1,component:s="li",dense:i=!1,divider:l=!1,disableGutters:c=!1,focusVisibleClassName:u,role:d="menuitem",tabIndex:f,className:m,...h}=r,g=D.useContext(gr),y=D.useMemo(()=>({dense:i||g.dense||!1,disableGutters:c}),[g.dense,i,c]),b=D.useRef(null);Wt(()=>{o&&b.current&&b.current.focus()},[o]);const x={...r,dense:y.dense,divider:l,disableGutters:c},C=TE(r),T=Ze(b,n);let w;return r.disabled||(w=f!==void 0?f:-1),a.jsx(gr.Provider,{value:y,children:a.jsx(IE,{ref:T,role:d,tabIndex:w,component:s,focusVisibleClassName:Te(C.focusVisible,u),className:Te(C.root,m),...h,ownerState:x,classes:C})})});function ME({materialization:e,onCloseDialog:t,isMutating:n,onDelete:r}){const[o,s]=Y.useState(!1),[i,l]=Y.useState(!1),c=()=>s(!0),u=()=>{s(!1),l(!1),t()};return a.jsxs(Y.Fragment,{children:[a.jsxs(Ft,{"aria-label":`Delete materialization ${e?.id??""}`.trim(),onClick:d=>{d.stopPropagation(),c()},sx:{color:"error.main"},children:[a.jsx(uu,{sx:{color:"inherit"},children:a.jsx(ln.Delete,{fontSize:"small"})}),a.jsx(du,{children:"Delete"})]}),a.jsxs(cr,{onClose:u,open:o,"aria-labelledby":"delete-materialization-title",children:[a.jsx(wr,{sx:{m:0,p:2},id:"delete-materialization-title",children:"Delete Materialization"}),a.jsx(Nn,{"aria-label":"close",onClick:u,sx:d=>({position:"absolute",right:8,top:8,color:d.palette.grey[500]}),children:a.jsx(ir,{})}),a.jsxs(lr,{dividers:!0,children:[a.jsx(rt,{gutterBottom:!0,children:"Are you sure you want to delete this materialization record? This action cannot be undone."}),a.jsx(gE,{control:a.jsx(cu,{checked:i,onChange:d=>l(d.target.checked)}),label:"Also drop the materialized table(s) this run produced"})]}),a.jsx(ar,{children:a.jsx(Dt,{loading:n,variant:"contained",autoFocus:!0,onClick:()=>r(i),color:"error",children:"Delete"})})]})]})}function eg({materializations:e,mutable:t,isMutating:n,showPackage:r=!1,onClickPackage:o,onStop:s,onDelete:i,onViewDetails:l}){return e.length===0?a.jsx(I.Typography,{variant:"body2",color:"text.secondary",sx:{py:1,fontStyle:"italic"},children:"No materializations yet."}):a.jsxs(I.Table,{size:"small",children:[a.jsx(I.TableHead,{children:a.jsxs(I.TableRow,{children:[r&&a.jsx(I.TableCell,{children:"Package"}),a.jsx(I.TableCell,{children:"Status"}),a.jsx(I.TableCell,{children:"Trigger"}),a.jsx(I.TableCell,{children:"Started"}),a.jsx(I.TableCell,{children:"Duration"}),a.jsx(I.TableCell,{children:"Sources"}),a.jsx(I.TableCell,{align:"right",children:"Actions"})]})}),a.jsx(I.TableBody,{children:e.map(c=>a.jsx(DE,{materialization:c,mutable:t,isMutating:n,showPackage:r,onClickPackage:o,onStop:s,onDelete:i,onViewDetails:l},c.id))})]})}function DE({materialization:e,mutable:t,isMutating:n,showPackage:r,onClickPackage:o,onStop:s,onDelete:i,onViewDetails:l}){const[c,u]=Y.useState(null),d=!!c,f=()=>u(null),m=Zm(e),h=m.sourcesBuilt!==void 0||m.sourcesReused!==void 0?`${m.sourcesBuilt??0} built, ${m.sourcesReused??0} reused`:"-",g=di(e.status),y=HP(e.status),b=e.error??void 0,x=t&&(g||y);return a.jsxs(I.TableRow,{hover:!0,sx:{cursor:"pointer","&:focus-visible":{outline:"2px solid",outlineColor:"primary.main",outlineOffset:"-2px"}},onClick:()=>l(e),onKeyDown:C=>{(C.key==="Enter"||C.key===" ")&&(C.preventDefault(),l(e))},role:"button",tabIndex:0,"aria-label":`View materialization ${e.id??""} details`.trim(),children:[r&&a.jsx(I.TableCell,{onClick:C=>C.stopPropagation(),children:o?a.jsx(I.Link,{component:"button",underline:"hover",onClick:()=>o(e.packageName??""),sx:{fontWeight:500},children:e.packageName}):e.packageName}),a.jsx(I.TableCell,{children:a.jsxs(I.Box,{sx:{display:"flex",alignItems:"center",gap:.5},children:[a.jsx(I.Chip,{size:"small",label:Km(e.status),color:Gm(e.status),variant:g?"filled":"outlined"}),b&&a.jsx(I.Tooltip,{title:b,children:a.jsx(Hm,{fontSize:"small",color:"error"})})]})}),a.jsx(I.TableCell,{children:a.jsx(Qm,{meta:m})}),a.jsx(I.TableCell,{children:qP(e.startedAt??e.createdAt)}),a.jsx(I.TableCell,{children:Xm(e.startedAt,e.completedAt)}),a.jsx(I.TableCell,{children:h}),a.jsx(I.TableCell,{align:"right",onClick:C=>C.stopPropagation(),children:x&&a.jsxs(a.Fragment,{children:[a.jsx(I.IconButton,{size:"small","aria-label":`Materialization actions for ${e.id??""}`.trim(),onClick:C=>u(C.currentTarget),children:a.jsx(ln.MoreVert,{fontSize:"small"})}),a.jsxs(I.Menu,{anchorEl:c,open:d,onClose:f,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},children:[t&&g&&a.jsxs(I.MenuItem,{"aria-label":`Stop materialization ${e.id??""}`.trim(),disabled:n,onClick:()=>{f(),s(e)},children:[a.jsx(I.ListItemIcon,{children:a.jsx(GP,{fontSize:"small"})}),a.jsx(I.ListItemText,{children:"Stop"})]}),t&&y&&a.jsx(ME,{materialization:e,isMutating:n,onCloseDialog:f,onDelete:C=>i(e,C)})]})]})})]})}var Kr={},un={},Rs={},Gr={},Pl={},Jp;function PE(){return Jp||(Jp=1,Object.defineProperty(Pl,"__esModule",{value:!0})),Pl}var js={},$s={},ef;function ho(){if(ef)return $s;ef=1,Object.defineProperty($s,"__esModule",{value:!0}),$s.CronField=void 0;let e=class tg{#e=!1;#n=!1;#s=!1;#o=[];options={rawValue:""};static get min(){throw new Error("min must be overridden")}static get max(){throw new Error("max must be overridden")}static get chars(){return Object.freeze([])}static get validChars(){return/^[?,*\dH/-]+$|^.*H\(\d+-\d+\)\/\d+.*$|^.*H\(\d+-\d+\).*$|^.*H\/\d+.*$/}static get constraints(){return{min:this.min,max:this.max,chars:this.chars,validChars:this.validChars}}constructor(n,r={rawValue:""}){if(!Array.isArray(n))throw new Error(`${this.constructor.name} Validation error, values is not an array`);if(!(n.length>0))throw new Error(`${this.constructor.name} Validation error, values contains no values`);this.options={...r,rawValue:r.rawValue??""},this.#o=n.sort(tg.sorter),this.#s=this.options.wildcard!==void 0?this.options.wildcard:this.#r(),this.#e=this.options.rawValue.includes("L")||n.includes("L"),this.#n=this.options.rawValue.includes("?")||n.includes("?")}get min(){return this.constructor.min}get max(){return this.constructor.max}get chars(){return this.constructor.chars}get hasLastChar(){return this.#e}get hasQuestionMarkChar(){return this.#n}get isWildcard(){return this.#s}get values(){return this.#o}static sorter(n,r){const o=typeof n=="number",s=typeof r=="number";return o&&s?n-r:!o&&!s?n.localeCompare(r):o?-1:1}static findNearestValueInList(n,r,o){if(o){for(let s=n.length-1;s>=0;s--)if(n[s]<r)return n[s];return null}for(let s=0;s<n.length;s++)if(n[s]>r)return n[s];return null}findNearestValue(n,r){return this.constructor.findNearestValueInList(this.values,n,r)}serialize(){return{wildcard:this.#s,values:this.#o}}validate(){let n;const r=this.chars.length>0?` or chars ${this.chars.join("")}`:"",o=c=>u=>new RegExp(`^\\d{0,2}${u}$`).test(c),s=c=>(n=c,typeof c=="number"?c>=this.min&&c<=this.max:this.chars.some(o(c)));if(!this.#o.every(s))throw new Error(`${this.constructor.name} Validation error, got value ${n} expected range ${this.min}-${this.max}${r}`);const l=this.#o.find((c,u)=>this.#o.indexOf(c)!==u);if(l)throw new Error(`${this.constructor.name} Validation error, duplicate values found: ${l}`)}#r(){return this.options.rawValue.length>0?["*","?"].includes(this.options.rawValue):Array.from({length:this.max-this.min+1},(n,r)=>r+this.min).every(n=>this.#o.includes(n))}};return $s.CronField=e,$s}var tf;function EE(){if(tf)return js;tf=1,Object.defineProperty(js,"__esModule",{value:!0}),js.CronDayOfMonth=void 0;const e=ho(),t=1,n=31,r=Object.freeze(["L"]);let o=class extends e.CronField{static get min(){return t}static get max(){return n}static get chars(){return r}static get validChars(){return/^[?,*\dLH/-]+$|^.*H\(\d+-\d+\)\/\d+.*$|^.*H\(\d+-\d+\).*$|^.*H\/\d+.*$/}constructor(i,l){super(i,l),this.validate()}get values(){return super.values}};return js.CronDayOfMonth=o,js}var As={},nf;function OE(){if(nf)return As;nf=1,Object.defineProperty(As,"__esModule",{value:!0}),As.CronDayOfWeek=void 0;const e=ho(),t=0,n=7,r=Object.freeze(["L"]);let o=class extends e.CronField{static get min(){return t}static get max(){return n}static get chars(){return r}static get validChars(){return/^[?,*\dLH#/-]+$|^.*H\(\d+-\d+\)\/\d+.*$|^.*H\(\d+-\d+\).*$|^.*H\/\d+.*$/}constructor(i,l){super(i,l),this.validate()}get values(){return super.values}get nthDay(){return this.options.nthDayOfWeek??0}};return As.CronDayOfWeek=o,As}var Fs={},rf;function RE(){if(rf)return Fs;rf=1,Object.defineProperty(Fs,"__esModule",{value:!0}),Fs.CronHour=void 0;const e=ho(),t=0,n=23,r=Object.freeze([]);let o=class extends e.CronField{static get min(){return t}static get max(){return n}static get chars(){return r}constructor(i,l){super(i,l),this.validate()}get values(){return super.values}};return Fs.CronHour=o,Fs}var Ns={},of;function jE(){if(of)return Ns;of=1,Object.defineProperty(Ns,"__esModule",{value:!0}),Ns.CronMinute=void 0;const e=ho(),t=0,n=59,r=Object.freeze([]);let o=class extends e.CronField{static get min(){return t}static get max(){return n}static get chars(){return r}constructor(i,l){super(i,l),this.validate()}get values(){return super.values}};return Ns.CronMinute=o,Ns}var Ls={},El={},rn={},sf;function $E(){if(sf)return rn;sf=1,Object.defineProperty(rn,"__esModule",{value:!0});class e extends Error{}class t extends e{constructor(p){super(`Invalid DateTime: ${p.toMessage()}`)}}class n extends e{constructor(p){super(`Invalid Interval: ${p.toMessage()}`)}}class r extends e{constructor(p){super(`Invalid Duration: ${p.toMessage()}`)}}class o extends e{}class s extends e{constructor(p){super(`Invalid unit ${p}`)}}class i extends e{}class l extends e{constructor(){super("Zone is an abstract class")}}const c="numeric",u="short",d="long",f={year:c,month:c,day:c},m={year:c,month:u,day:c},h={year:c,month:u,day:c,weekday:u},g={year:c,month:d,day:c},y={year:c,month:d,day:c,weekday:d},b={hour:c,minute:c},x={hour:c,minute:c,second:c},C={hour:c,minute:c,second:c,timeZoneName:u},T={hour:c,minute:c,second:c,timeZoneName:d},w={hour:c,minute:c,hourCycle:"h23"},M={hour:c,minute:c,second:c,hourCycle:"h23"},E={hour:c,minute:c,second:c,hourCycle:"h23",timeZoneName:u},j={hour:c,minute:c,second:c,hourCycle:"h23",timeZoneName:d},F={year:c,month:c,day:c,hour:c,minute:c},O={year:c,month:c,day:c,hour:c,minute:c,second:c},V={year:c,month:u,day:c,hour:c,minute:c},L={year:c,month:u,day:c,hour:c,minute:c,second:c},v={year:c,month:u,day:c,weekday:u,hour:c,minute:c},N={year:c,month:d,day:c,hour:c,minute:c,timeZoneName:u},A={year:c,month:d,day:c,hour:c,minute:c,second:c,timeZoneName:u},$={year:c,month:d,day:c,weekday:d,hour:c,minute:c,timeZoneName:d},R={year:c,month:d,day:c,weekday:d,hour:c,minute:c,second:c,timeZoneName:d};class _{get type(){throw new l}get name(){throw new l}get ianaName(){return this.name}get isUniversal(){throw new l}offsetName(p,S){throw new l}formatOffset(p,S){throw new l}offset(p){throw new l}equals(p){throw new l}get isValid(){throw new l}}let z=null;class W extends _{static get instance(){return z===null&&(z=new W),z}get type(){return"system"}get name(){return new Intl.DateTimeFormat().resolvedOptions().timeZone}get isUniversal(){return!1}offsetName(p,{format:S,locale:P}){return ku(p,S,P)}formatOffset(p,S){return us(this.offset(p),S)}offset(p){return-new Date(p).getTimezoneOffset()}equals(p){return p.type==="system"}get isValid(){return!0}}const H=new Map;function G(k){let p=H.get(k);return p===void 0&&(p=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:k,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",era:"short"}),H.set(k,p)),p}const se={year:0,month:1,day:2,era:3,hour:4,minute:5,second:6};function pe(k,p){const S=k.format(p).replace(/\u200E/g,""),P=/(\d+)\/(\d+)\/(\d+) (AD|BC),? (\d+):(\d+):(\d+)/.exec(S),[,B,q,ee,ne,ie,we,Ne]=P;return[ee,B,q,ne,ie,we,Ne]}function me(k,p){const S=k.formatToParts(p),P=[];for(let B=0;B<S.length;B++){const{type:q,value:ee}=S[B],ne=se[q];q==="era"?P[ne]=ee:ke(ne)||(P[ne]=parseInt(ee,10))}return P}const X=new Map;class K extends _{static create(p){let S=X.get(p);return S===void 0&&X.set(p,S=new K(p)),S}static resetCache(){X.clear(),H.clear()}static isValidSpecifier(p){return this.isValidZone(p)}static isValidZone(p){if(!p)return!1;try{return new Intl.DateTimeFormat("en-US",{timeZone:p}).format(),!0}catch{return!1}}constructor(p){super(),this.zoneName=p,this.valid=K.isValidZone(p)}get type(){return"iana"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(p,{format:S,locale:P}){return ku(p,S,P,this.name)}formatOffset(p,S){return us(this.offset(p),S)}offset(p){if(!this.valid)return NaN;const S=new Date(p);if(isNaN(S))return NaN;const P=G(this.name);let[B,q,ee,ne,ie,we,Ne]=P.formatToParts?me(P,S):pe(P,S);ne==="BC"&&(B=-Math.abs(B)+1);const xt=Ei({year:B,month:q,day:ee,hour:ie===24?0:ie,minute:we,second:Ne,millisecond:0});let Be=+S;const Vt=Be%1e3;return Be-=Vt>=0?Vt:1e3+Vt,(xt-Be)/(60*1e3)}equals(p){return p.type==="iana"&&p.name===this.name}get isValid(){return this.valid}}let le={};function oe(k,p={}){const S=JSON.stringify([k,p]);let P=le[S];return P||(P=new Intl.ListFormat(k,p),le[S]=P),P}const te=new Map;function Z(k,p={}){const S=JSON.stringify([k,p]);let P=te.get(S);return P===void 0&&(P=new Intl.DateTimeFormat(k,p),te.set(S,P)),P}const J=new Map;function ae(k,p={}){const S=JSON.stringify([k,p]);let P=J.get(S);return P===void 0&&(P=new Intl.NumberFormat(k,p),J.set(S,P)),P}const Q=new Map;function ue(k,p={}){const{base:S,...P}=p,B=JSON.stringify([k,P]);let q=Q.get(B);return q===void 0&&(q=new Intl.RelativeTimeFormat(k,p),Q.set(B,q)),q}let he=null;function de(){return he||(he=new Intl.DateTimeFormat().resolvedOptions().locale,he)}const Se=new Map;function ce(k){let p=Se.get(k);return p===void 0&&(p=new Intl.DateTimeFormat(k).resolvedOptions(),Se.set(k,p)),p}const Pe=new Map;function Ce(k){let p=Pe.get(k);if(!p){const S=new Intl.Locale(k);p="getWeekInfo"in S?S.getWeekInfo():S.weekInfo,"minimalDays"in p||(p={...lt,...p}),Pe.set(k,p)}return p}function Ve(k){const p=k.indexOf("-x-");p!==-1&&(k=k.substring(0,p));const S=k.indexOf("-u-");if(S===-1)return[k];{let P,B;try{P=Z(k).resolvedOptions(),B=k}catch{const ie=k.substring(0,S);P=Z(ie).resolvedOptions(),B=ie}const{numberingSystem:q,calendar:ee}=P;return[B,q,ee]}}function De(k,p,S){return(S||p)&&(k.includes("-u-")||(k+="-u"),S&&(k+=`-ca-${S}`),p&&(k+=`-nu-${p}`)),k}function pt(k){const p=[];for(let S=1;S<=12;S++){const P=_e.utc(2009,S,1);p.push(k(P))}return p}function Ye(k){const p=[];for(let S=1;S<=7;S++){const P=_e.utc(2016,11,13+S);p.push(k(P))}return p}function tt(k,p,S,P){const B=k.listingMode();return B==="error"?null:B==="en"?S(p):P(p)}function gt(k){return k.numberingSystem&&k.numberingSystem!=="latn"?!1:k.numberingSystem==="latn"||!k.locale||k.locale.startsWith("en")||ce(k.locale).numberingSystem==="latn"}class kt{constructor(p,S,P){this.padTo=P.padTo||0,this.floor=P.floor||!1;const{padTo:B,floor:q,...ee}=P;if(!S||Object.keys(ee).length>0){const ne={useGrouping:!1,...P};P.padTo>0&&(ne.minimumIntegerDigits=P.padTo),this.inf=ae(p,ne)}}format(p){if(this.inf){const S=this.floor?Math.floor(p):p;return this.inf.format(S)}else{const S=this.floor?Math.floor(p):rl(p,3);return Bt(S,this.padTo)}}}class Pt{constructor(p,S,P){this.opts=P,this.originalZone=void 0;let B;if(this.opts.timeZone)this.dt=p;else if(p.zone.type==="fixed"){const ee=-1*(p.offset/60),ne=ee>=0?`Etc/GMT+${ee}`:`Etc/GMT${ee}`;p.offset!==0&&K.create(ne).valid?(B=ne,this.dt=p):(B="UTC",this.dt=p.offset===0?p:p.setZone("UTC").plus({minutes:p.offset}),this.originalZone=p.zone)}else p.zone.type==="system"?this.dt=p:p.zone.type==="iana"?(this.dt=p,B=p.zone.name):(B="UTC",this.dt=p.setZone("UTC").plus({minutes:p.offset}),this.originalZone=p.zone);const q={...this.opts};q.timeZone=q.timeZone||B,this.dtf=Z(S,q)}format(){return this.originalZone?this.formatToParts().map(({value:p})=>p).join(""):this.dtf.format(this.dt.toJSDate())}formatToParts(){const p=this.dtf.formatToParts(this.dt.toJSDate());return this.originalZone?p.map(S=>{if(S.type==="timeZoneName"){const P=this.originalZone.offsetName(this.dt.ts,{locale:this.dt.locale,format:this.opts.timeZoneName});return{...S,value:P}}else return S}):p}resolvedOptions(){return this.dtf.resolvedOptions()}}class Yt{constructor(p,S,P){this.opts={style:"long",...P},!S&&is()&&(this.rtf=ue(p,P))}format(p,S){return this.rtf?this.rtf.format(p,S):iy(S,p,this.opts.numeric,this.opts.style!=="long")}formatToParts(p,S){return this.rtf?this.rtf.formatToParts(p,S):[]}}const lt={firstDay:1,minimalDays:4,weekend:[6,7]};class Ie{static fromOpts(p){return Ie.create(p.locale,p.numberingSystem,p.outputCalendar,p.weekSettings,p.defaultToEN)}static create(p,S,P,B,q=!1){const ee=p||dt.defaultLocale,ne=ee||(q?"en-US":de()),ie=S||dt.defaultNumberingSystem,we=P||dt.defaultOutputCalendar,Ne=ur(B)||dt.defaultWeekSettings;return new Ie(ne,ie,we,Ne,ee)}static resetCache(){he=null,te.clear(),J.clear(),Q.clear(),Se.clear(),Pe.clear()}static fromObject({locale:p,numberingSystem:S,outputCalendar:P,weekSettings:B}={}){return Ie.create(p,S,P,B)}constructor(p,S,P,B,q){const[ee,ne,ie]=Ve(p);this.locale=ee,this.numberingSystem=S||ne||null,this.outputCalendar=P||ie||null,this.weekSettings=B,this.intl=De(this.locale,this.numberingSystem,this.outputCalendar),this.weekdaysCache={format:{},standalone:{}},this.monthsCache={format:{},standalone:{}},this.meridiemCache=null,this.eraCache={},this.specifiedLocale=q,this.fastNumbersCached=null}get fastNumbers(){return this.fastNumbersCached==null&&(this.fastNumbersCached=gt(this)),this.fastNumbersCached}listingMode(){const p=this.isEnglish(),S=(this.numberingSystem===null||this.numberingSystem==="latn")&&(this.outputCalendar===null||this.outputCalendar==="gregory");return p&&S?"en":"intl"}clone(p){return!p||Object.getOwnPropertyNames(p).length===0?this:Ie.create(p.locale||this.specifiedLocale,p.numberingSystem||this.numberingSystem,p.outputCalendar||this.outputCalendar,ur(p.weekSettings)||this.weekSettings,p.defaultToEN||!1)}redefaultToEN(p={}){return this.clone({...p,defaultToEN:!0})}redefaultToSystem(p={}){return this.clone({...p,defaultToEN:!1})}months(p,S=!1){return tt(this,p,Mu,()=>{const P=this.intl==="ja"||this.intl.startsWith("ja-");S&=!P;const B=S?{month:p,day:"numeric"}:{month:p},q=S?"format":"standalone";if(!this.monthsCache[q][p]){const ee=P?ne=>this.dtFormatter(ne,B).format():ne=>this.extract(ne,B,"month");this.monthsCache[q][p]=pt(ee)}return this.monthsCache[q][p]})}weekdays(p,S=!1){return tt(this,p,Eu,()=>{const P=S?{weekday:p,year:"numeric",month:"long",day:"numeric"}:{weekday:p},B=S?"format":"standalone";return this.weekdaysCache[B][p]||(this.weekdaysCache[B][p]=Ye(q=>this.extract(q,P,"weekday"))),this.weekdaysCache[B][p]})}meridiems(){return tt(this,void 0,()=>Ou,()=>{if(!this.meridiemCache){const p={hour:"numeric",hourCycle:"h12"};this.meridiemCache=[_e.utc(2016,11,13,9),_e.utc(2016,11,13,19)].map(S=>this.extract(S,p,"dayperiod"))}return this.meridiemCache})}eras(p){return tt(this,p,Ru,()=>{const S={era:p};return this.eraCache[p]||(this.eraCache[p]=[_e.utc(-40,1,1),_e.utc(2017,1,1)].map(P=>this.extract(P,S,"era"))),this.eraCache[p]})}extract(p,S,P){const B=this.dtFormatter(p,S),q=B.formatToParts(),ee=q.find(ne=>ne.type.toLowerCase()===P);return ee?ee.value:null}numberFormatter(p={}){return new kt(this.intl,p.forceSimple||this.fastNumbers,p)}dtFormatter(p,S={}){return new Pt(p,this.intl,S)}relFormatter(p={}){return new Yt(this.intl,this.isEnglish(),p)}listFormatter(p={}){return oe(this.intl,p)}isEnglish(){return this.locale==="en"||this.locale.toLowerCase()==="en-us"||ce(this.intl).locale.startsWith("en-us")}getWeekSettings(){return this.weekSettings?this.weekSettings:as()?Ce(this.locale):lt}getStartOfWeek(){return this.getWeekSettings().firstDay}getMinDaysInFirstWeek(){return this.getWeekSettings().minimalDays}getWeekendDays(){return this.getWeekSettings().weekend}equals(p){return this.locale===p.locale&&this.numberingSystem===p.numberingSystem&&this.outputCalendar===p.outputCalendar}toString(){return`Locale(${this.locale}, ${this.numberingSystem}, ${this.outputCalendar})`}}let ft=null;class it extends _{static get utcInstance(){return ft===null&&(ft=new it(0)),ft}static instance(p){return p===0?it.utcInstance:new it(p)}static parseSpecifier(p){if(p){const S=p.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);if(S)return new it(Oi(S[1],S[2]))}return null}constructor(p){super(),this.fixed=p}get type(){return"fixed"}get name(){return this.fixed===0?"UTC":`UTC${us(this.fixed,"narrow")}`}get ianaName(){return this.fixed===0?"Etc/UTC":`Etc/GMT${us(-this.fixed,"narrow")}`}offsetName(){return this.name}formatOffset(p,S){return us(this.fixed,S)}get isUniversal(){return!0}offset(){return this.fixed}equals(p){return p.type==="fixed"&&p.fixed===this.fixed}get isValid(){return!0}}class jt extends _{constructor(p){super(),this.zoneName=p}get type(){return"invalid"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(){return null}formatOffset(){return""}offset(){return NaN}equals(){return!1}get isValid(){return!1}}function je(k,p){if(ke(k)||k===null)return p;if(k instanceof _)return k;if(cn(k)){const S=k.toLowerCase();return S==="default"?p:S==="local"||S==="system"?W.instance:S==="utc"||S==="gmt"?it.utcInstance:it.parseSpecifier(S)||K.create(k)}else return bt(k)?it.instance(k):typeof k=="object"&&"offset"in k&&typeof k.offset=="function"?k:new jt(k)}const ze={arab:"[٠-٩]",arabext:"[۰-۹]",bali:"[᭐-᭙]",beng:"[০-৯]",deva:"[०-९]",fullwide:"[0-9]",gujr:"[૦-૯]",hanidec:"[〇|一|二|三|四|五|六|七|八|九]",khmr:"[០-៩]",knda:"[೦-೯]",laoo:"[໐-໙]",limb:"[᥆-᥏]",mlym:"[൦-൯]",mong:"[᠐-᠙]",mymr:"[၀-၉]",orya:"[୦-୯]",tamldec:"[௦-௯]",telu:"[౦-౯]",thai:"[๐-๙]",tibt:"[༠-༩]",latn:"\\d"},Ae={arab:[1632,1641],arabext:[1776,1785],bali:[6992,7001],beng:[2534,2543],deva:[2406,2415],fullwide:[65296,65303],gujr:[2790,2799],khmr:[6112,6121],knda:[3302,3311],laoo:[3792,3801],limb:[6470,6479],mlym:[3430,3439],mong:[6160,6169],mymr:[4160,4169],orya:[2918,2927],tamldec:[3046,3055],telu:[3174,3183],thai:[3664,3673],tibt:[3872,3881]},Kt=ze.hanidec.replace(/[\[|\]]/g,"").split("");function at(k){let p=parseInt(k,10);if(isNaN(p)){p="";for(let S=0;S<k.length;S++){const P=k.charCodeAt(S);if(k[S].search(ze.hanidec)!==-1)p+=Kt.indexOf(k[S]);else for(const B in Ae){const[q,ee]=Ae[B];P>=q&&P<=ee&&(p+=P-q)}}return parseInt(p,10)}else return p}const Lt=new Map;function Gt(){Lt.clear()}function ut({numberingSystem:k},p=""){const S=k||"latn";let P=Lt.get(S);P===void 0&&(P=new Map,Lt.set(S,P));let B=P.get(p);return B===void 0&&(B=new RegExp(`${ze[S]}${p}`),P.set(p,B)),B}let qn=()=>Date.now(),bn="system",xn=null,Ln=null,go=null,Yn=60,Fr,yo=null;class dt{static get now(){return qn}static set now(p){qn=p}static set defaultZone(p){bn=p}static get defaultZone(){return je(bn,W.instance)}static get defaultLocale(){return xn}static set defaultLocale(p){xn=p}static get defaultNumberingSystem(){return Ln}static set defaultNumberingSystem(p){Ln=p}static get defaultOutputCalendar(){return go}static set defaultOutputCalendar(p){go=p}static get defaultWeekSettings(){return yo}static set defaultWeekSettings(p){yo=ur(p)}static get twoDigitCutoffYear(){return Yn}static set twoDigitCutoffYear(p){Yn=p%100}static get throwOnInvalid(){return Fr}static set throwOnInvalid(p){Fr=p}static resetCaches(){Ie.resetCache(),K.resetCache(),_e.resetCache(),Gt()}}class Ut{constructor(p,S){this.reason=p,this.explanation=S}toMessage(){return this.explanation?`${this.reason}: ${this.explanation}`:this.reason}}const kr=[0,31,59,90,120,151,181,212,243,273,304,334],bo=[0,31,60,91,121,152,182,213,244,274,305,335];function Zt(k,p){return new Ut("unit out of range",`you specified ${p} (of type ${typeof p}) as a ${k}, which is invalid`)}function Nr(k,p,S){const P=new Date(Date.UTC(k,p-1,S));k<100&&k>=0&&P.setUTCFullYear(P.getUTCFullYear()-1900);const B=P.getUTCDay();return B===0?7:B}function xo(k,p,S){return S+(ls(k)?bo:kr)[p-1]}function Tr(k,p){const S=ls(k)?bo:kr,P=S.findIndex(q=>q<p),B=p-S[P];return{month:P+1,day:B}}function Et(k,p){return(k-p+7)%7+1}function Ot(k,p=4,S=1){const{year:P,month:B,day:q}=k,ee=xo(P,B,q),ne=Et(Nr(P,B,q),S);let ie=Math.floor((ee-ne+14-p)/7),we;return ie<1?(we=P-1,ie=cs(we,p,S)):ie>cs(P,p,S)?(we=P+1,ie=1):we=P,{weekYear:we,weekNumber:ie,weekday:ne,...ji(k)}}function Bn(k,p=4,S=1){const{weekYear:P,weekNumber:B,weekday:q}=k,ee=Et(Nr(P,1,p),S),ne=So(P);let ie=B*7+q-ee-7+p,we;ie<1?(we=P-1,ie+=So(we)):ie>ne?(we=P+1,ie-=So(P)):we=P;const{month:Ne,day:Ue}=Tr(we,ie);return{year:we,month:Ne,day:Ue,...ji(k)}}function Lr(k){const{year:p,month:S,day:P}=k,B=xo(p,S,P);return{year:p,ordinal:B,...ji(k)}}function Ir(k){const{year:p,ordinal:S}=k,{month:P,day:B}=Tr(p,S);return{year:p,month:P,day:B,...ji(k)}}function Br(k,p){if(!ke(k.localWeekday)||!ke(k.localWeekNumber)||!ke(k.localWeekYear)){if(!ke(k.weekday)||!ke(k.weekNumber)||!ke(k.weekYear))throw new o("Cannot mix locale-based week fields with ISO-based week fields");return ke(k.localWeekday)||(k.weekday=k.localWeekday),ke(k.localWeekNumber)||(k.weekNumber=k.localWeekNumber),ke(k.localWeekYear)||(k.weekYear=k.localWeekYear),delete k.localWeekday,delete k.localWeekNumber,delete k.localWeekYear,{minDaysInFirstWeek:p.getMinDaysInFirstWeek(),startOfWeek:p.getStartOfWeek()}}else return{minDaysInFirstWeek:4,startOfWeek:1}}function be(k,p=4,S=1){const P=Ct(k.weekYear),B=vn(k.weekNumber,1,cs(k.weekYear,p,S)),q=vn(k.weekday,1,7);return P?B?q?!1:Zt("weekday",k.weekday):Zt("week",k.weekNumber):Zt("weekYear",k.weekYear)}function ge(k){const p=Ct(k.year),S=vn(k.ordinal,1,So(k.year));return p?S?!1:Zt("ordinal",k.ordinal):Zt("year",k.year)}function Oe(k){const p=Ct(k.year),S=vn(k.month,1,12),P=vn(k.day,1,Pi(k.year,k.month));return p?S?P?!1:Zt("day",k.day):Zt("month",k.month):Zt("year",k.year)}function Le(k){const{hour:p,minute:S,second:P,millisecond:B}=k,q=vn(p,0,23)||p===24&&S===0&&P===0&&B===0,ee=vn(S,0,59),ne=vn(P,0,59),ie=vn(B,0,999);return q?ee?ne?ie?!1:Zt("millisecond",B):Zt("second",P):Zt("minute",S):Zt("hour",p)}function ke(k){return typeof k>"u"}function bt(k){return typeof k=="number"}function Ct(k){return typeof k=="number"&&k%1===0}function cn(k){return typeof k=="string"}function vo(k){return Object.prototype.toString.call(k)==="[object Date]"}function is(){try{return typeof Intl<"u"&&!!Intl.RelativeTimeFormat}catch{return!1}}function as(){try{return typeof Intl<"u"&&!!Intl.Locale&&("weekInfo"in Intl.Locale.prototype||"getWeekInfo"in Intl.Locale.prototype)}catch{return!1}}function Di(k){return Array.isArray(k)?k:[k]}function nt(k,p,S){if(k.length!==0)return k.reduce((P,B)=>{const q=[p(B),B];return P&&S(P[0],q[0])===P[0]?P:q},null)[1]}function Kn(k,p){return p.reduce((S,P)=>(S[P]=k[P],S),{})}function Jt(k,p){return Object.prototype.hasOwnProperty.call(k,p)}function ur(k){if(k==null)return null;if(typeof k!="object")throw new i("Week settings must be an object");if(!vn(k.firstDay,1,7)||!vn(k.minimalDays,1,7)||!Array.isArray(k.weekend)||k.weekend.some(p=>!vn(p,1,7)))throw new i("Invalid week settings");return{firstDay:k.firstDay,minimalDays:k.minimalDays,weekend:Array.from(k.weekend)}}function vn(k,p,S){return Ct(k)&&k>=p&&k<=S}function Gg(k,p){return k-p*Math.floor(k/p)}function Bt(k,p=2){const S=k<0;let P;return S?P="-"+(""+-k).padStart(p,"0"):P=(""+k).padStart(p,"0"),P}function Mr(k){if(!(ke(k)||k===null||k===""))return parseInt(k,10)}function Vr(k){if(!(ke(k)||k===null||k===""))return parseFloat(k)}function nl(k){if(!(ke(k)||k===null||k==="")){const p=parseFloat("0."+k)*1e3;return Math.floor(p)}}function rl(k,p,S="round"){const P=10**p;switch(S){case"expand":return k>0?Math.ceil(k*P)/P:Math.floor(k*P)/P;case"trunc":return Math.trunc(k*P)/P;case"round":return Math.round(k*P)/P;case"floor":return Math.floor(k*P)/P;case"ceil":return Math.ceil(k*P)/P;default:throw new RangeError(`Value rounding ${S} is out of range`)}}function ls(k){return k%4===0&&(k%100!==0||k%400===0)}function So(k){return ls(k)?366:365}function Pi(k,p){const S=Gg(p-1,12)+1,P=k+(p-S)/12;return S===2?ls(P)?29:28:[31,null,31,30,31,30,31,31,30,31,30,31][S-1]}function Ei(k){let p=Date.UTC(k.year,k.month-1,k.day,k.hour,k.minute,k.second,k.millisecond);return k.year<100&&k.year>=0&&(p=new Date(p),p.setUTCFullYear(k.year,k.month-1,k.day)),+p}function wu(k,p,S){return-Et(Nr(k,1,p),S)+p-1}function cs(k,p=4,S=1){const P=wu(k,p,S),B=wu(k+1,p,S);return(So(k)-P+B)/7}function ol(k){return k>99?k:k>dt.twoDigitCutoffYear?1900+k:2e3+k}function ku(k,p,S,P=null){const B=new Date(k),q={hourCycle:"h23",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"};P&&(q.timeZone=P);const ee={timeZoneName:p,...q},ne=new Intl.DateTimeFormat(S,ee).formatToParts(B).find(ie=>ie.type.toLowerCase()==="timezonename");return ne?ne.value:null}function Oi(k,p){let S=parseInt(k,10);Number.isNaN(S)&&(S=0);const P=parseInt(p,10)||0,B=S<0||Object.is(S,-0)?-P:P;return S*60+B}function Tu(k){const p=Number(k);if(typeof k=="boolean"||k===""||!Number.isFinite(p))throw new i(`Invalid unit value ${k}`);return p}function Ri(k,p){const S={};for(const P in k)if(Jt(k,P)){const B=k[P];if(B==null)continue;S[p(P)]=Tu(B)}return S}function us(k,p){const S=Math.trunc(Math.abs(k/60)),P=Math.trunc(Math.abs(k%60)),B=k>=0?"+":"-";switch(p){case"short":return`${B}${Bt(S,2)}:${Bt(P,2)}`;case"narrow":return`${B}${S}${P>0?`:${P}`:""}`;case"techie":return`${B}${Bt(S,2)}${Bt(P,2)}`;default:throw new RangeError(`Value format ${p} is out of range for property format`)}}function ji(k){return Kn(k,["hour","minute","second","millisecond"])}const Zg=["January","February","March","April","May","June","July","August","September","October","November","December"],Iu=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],Xg=["J","F","M","A","M","J","J","A","S","O","N","D"];function Mu(k){switch(k){case"narrow":return[...Xg];case"short":return[...Iu];case"long":return[...Zg];case"numeric":return["1","2","3","4","5","6","7","8","9","10","11","12"];case"2-digit":return["01","02","03","04","05","06","07","08","09","10","11","12"];default:return null}}const Du=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],Pu=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],Qg=["M","T","W","T","F","S","S"];function Eu(k){switch(k){case"narrow":return[...Qg];case"short":return[...Pu];case"long":return[...Du];case"numeric":return["1","2","3","4","5","6","7"];default:return null}}const Ou=["AM","PM"],Jg=["Before Christ","Anno Domini"],ey=["BC","AD"],ty=["B","A"];function Ru(k){switch(k){case"narrow":return[...ty];case"short":return[...ey];case"long":return[...Jg];default:return null}}function ny(k){return Ou[k.hour<12?0:1]}function ry(k,p){return Eu(p)[k.weekday-1]}function oy(k,p){return Mu(p)[k.month-1]}function sy(k,p){return Ru(p)[k.year<0?0:1]}function iy(k,p,S="always",P=!1){const B={years:["year","yr."],quarters:["quarter","qtr."],months:["month","mo."],weeks:["week","wk."],days:["day","day","days"],hours:["hour","hr."],minutes:["minute","min."],seconds:["second","sec."]},q=["hours","minutes","seconds"].indexOf(k)===-1;if(S==="auto"&&q){const Ue=k==="days";switch(p){case 1:return Ue?"tomorrow":`next ${B[k][0]}`;case-1:return Ue?"yesterday":`last ${B[k][0]}`;case 0:return Ue?"today":`this ${B[k][0]}`}}const ee=Object.is(p,-0)||p<0,ne=Math.abs(p),ie=ne===1,we=B[k],Ne=P?ie?we[1]:we[2]||we[1]:ie?B[k][0]:k;return ee?`${ne} ${Ne} ago`:`in ${ne} ${Ne}`}function ju(k,p){let S="";for(const P of k)P.literal?S+=P.val:S+=p(P.val);return S}const ay={D:f,DD:m,DDD:g,DDDD:y,t:b,tt:x,ttt:C,tttt:T,T:w,TT:M,TTT:E,TTTT:j,f:F,ff:V,fff:N,ffff:$,F:O,FF:L,FFF:A,FFFF:R};class Xt{static create(p,S={}){return new Xt(p,S)}static parseFormat(p){let S=null,P="",B=!1;const q=[];for(let ee=0;ee<p.length;ee++){const ne=p.charAt(ee);ne==="'"?((P.length>0||B)&&q.push({literal:B||/^\s+$/.test(P),val:P===""?"'":P}),S=null,P="",B=!B):B||ne===S?P+=ne:(P.length>0&&q.push({literal:/^\s+$/.test(P),val:P}),P=ne,S=ne)}return P.length>0&&q.push({literal:B||/^\s+$/.test(P),val:P}),q}static macroTokenToFormatOpts(p){return ay[p]}constructor(p,S){this.opts=S,this.loc=p,this.systemLoc=null}formatWithSystemDefault(p,S){return this.systemLoc===null&&(this.systemLoc=this.loc.redefaultToSystem()),this.systemLoc.dtFormatter(p,{...this.opts,...S}).format()}dtFormatter(p,S={}){return this.loc.dtFormatter(p,{...this.opts,...S})}formatDateTime(p,S){return this.dtFormatter(p,S).format()}formatDateTimeParts(p,S){return this.dtFormatter(p,S).formatToParts()}formatInterval(p,S){return this.dtFormatter(p.start,S).dtf.formatRange(p.start.toJSDate(),p.end.toJSDate())}resolvedOptions(p,S){return this.dtFormatter(p,S).resolvedOptions()}num(p,S=0,P=void 0){if(this.opts.forceSimple)return Bt(p,S);const B={...this.opts};return S>0&&(B.padTo=S),P&&(B.signDisplay=P),this.loc.numberFormatter(B).format(p)}formatDateTimeFromString(p,S){const P=this.loc.listingMode()==="en",B=this.loc.outputCalendar&&this.loc.outputCalendar!=="gregory",q=(Be,Vt)=>this.loc.extract(p,Be,Vt),ee=Be=>p.isOffsetFixed&&p.offset===0&&Be.allowZ?"Z":p.isValid?p.zone.formatOffset(p.ts,Be.format):"",ne=()=>P?ny(p):q({hour:"numeric",hourCycle:"h12"},"dayperiod"),ie=(Be,Vt)=>P?oy(p,Be):q(Vt?{month:Be}:{month:Be,day:"numeric"},"month"),we=(Be,Vt)=>P?ry(p,Be):q(Vt?{weekday:Be}:{weekday:Be,month:"long",day:"numeric"},"weekday"),Ne=Be=>{const Vt=Xt.macroTokenToFormatOpts(Be);return Vt?this.formatWithSystemDefault(p,Vt):Be},Ue=Be=>P?sy(p,Be):q({era:Be},"era"),xt=Be=>{switch(Be){case"S":return this.num(p.millisecond);case"u":case"SSS":return this.num(p.millisecond,3);case"s":return this.num(p.second);case"ss":return this.num(p.second,2);case"uu":return this.num(Math.floor(p.millisecond/10),2);case"uuu":return this.num(Math.floor(p.millisecond/100));case"m":return this.num(p.minute);case"mm":return this.num(p.minute,2);case"h":return this.num(p.hour%12===0?12:p.hour%12);case"hh":return this.num(p.hour%12===0?12:p.hour%12,2);case"H":return this.num(p.hour);case"HH":return this.num(p.hour,2);case"Z":return ee({format:"narrow",allowZ:this.opts.allowZ});case"ZZ":return ee({format:"short",allowZ:this.opts.allowZ});case"ZZZ":return ee({format:"techie",allowZ:this.opts.allowZ});case"ZZZZ":return p.zone.offsetName(p.ts,{format:"short",locale:this.loc.locale});case"ZZZZZ":return p.zone.offsetName(p.ts,{format:"long",locale:this.loc.locale});case"z":return p.zoneName;case"a":return ne();case"d":return B?q({day:"numeric"},"day"):this.num(p.day);case"dd":return B?q({day:"2-digit"},"day"):this.num(p.day,2);case"c":return this.num(p.weekday);case"ccc":return we("short",!0);case"cccc":return we("long",!0);case"ccccc":return we("narrow",!0);case"E":return this.num(p.weekday);case"EEE":return we("short",!1);case"EEEE":return we("long",!1);case"EEEEE":return we("narrow",!1);case"L":return B?q({month:"numeric",day:"numeric"},"month"):this.num(p.month);case"LL":return B?q({month:"2-digit",day:"numeric"},"month"):this.num(p.month,2);case"LLL":return ie("short",!0);case"LLLL":return ie("long",!0);case"LLLLL":return ie("narrow",!0);case"M":return B?q({month:"numeric"},"month"):this.num(p.month);case"MM":return B?q({month:"2-digit"},"month"):this.num(p.month,2);case"MMM":return ie("short",!1);case"MMMM":return ie("long",!1);case"MMMMM":return ie("narrow",!1);case"y":return B?q({year:"numeric"},"year"):this.num(p.year);case"yy":return B?q({year:"2-digit"},"year"):this.num(p.year.toString().slice(-2),2);case"yyyy":return B?q({year:"numeric"},"year"):this.num(p.year,4);case"yyyyyy":return B?q({year:"numeric"},"year"):this.num(p.year,6);case"G":return Ue("short");case"GG":return Ue("long");case"GGGGG":return Ue("narrow");case"kk":return this.num(p.weekYear.toString().slice(-2),2);case"kkkk":return this.num(p.weekYear,4);case"W":return this.num(p.weekNumber);case"WW":return this.num(p.weekNumber,2);case"n":return this.num(p.localWeekNumber);case"nn":return this.num(p.localWeekNumber,2);case"ii":return this.num(p.localWeekYear.toString().slice(-2),2);case"iiii":return this.num(p.localWeekYear,4);case"o":return this.num(p.ordinal);case"ooo":return this.num(p.ordinal,3);case"q":return this.num(p.quarter);case"qq":return this.num(p.quarter,2);case"X":return this.num(Math.floor(p.ts/1e3));case"x":return this.num(p.ts);default:return Ne(Be)}};return ju(Xt.parseFormat(S),xt)}formatDurationFromString(p,S){const P=this.opts.signMode==="negativeLargestOnly"?-1:1,B=Ne=>{switch(Ne[0]){case"S":return"milliseconds";case"s":return"seconds";case"m":return"minutes";case"h":return"hours";case"d":return"days";case"w":return"weeks";case"M":return"months";case"y":return"years";default:return null}},q=(Ne,Ue)=>xt=>{const Be=B(xt);if(Be){const Vt=Ue.isNegativeDuration&&Be!==Ue.largestUnit?P:1;let zn;return this.opts.signMode==="negativeLargestOnly"&&Be!==Ue.largestUnit?zn="never":this.opts.signMode==="all"?zn="always":zn="auto",this.num(Ne.get(Be)*Vt,xt.length,zn)}else return xt},ee=Xt.parseFormat(S),ne=ee.reduce((Ne,{literal:Ue,val:xt})=>Ue?Ne:Ne.concat(xt),[]),ie=p.shiftTo(...ne.map(B).filter(Ne=>Ne)),we={isNegativeDuration:ie<0,largestUnit:Object.keys(ie.values)[0]};return ju(ee,q(ie,we))}}const $u=/[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/;function Co(...k){const p=k.reduce((S,P)=>S+P.source,"");return RegExp(`^${p}$`)}function wo(...k){return p=>k.reduce(([S,P,B],q)=>{const[ee,ne,ie]=q(p,B);return[{...S,...ee},ne||P,ie]},[{},null,1]).slice(0,2)}function ko(k,...p){if(k==null)return[null,null];for(const[S,P]of p){const B=S.exec(k);if(B)return P(B)}return[null,null]}function Au(...k){return(p,S)=>{const P={};let B;for(B=0;B<k.length;B++)P[k[B]]=Mr(p[S+B]);return[P,null,S+B]}}const Fu=/(?:([Zz])|([+-]\d\d)(?::?(\d\d))?)/,ly=`(?:${Fu.source}?(?:\\[(${$u.source})\\])?)?`,sl=/(\d\d)(?::?(\d\d)(?::?(\d\d)(?:[.,](\d{1,30}))?)?)?/,Nu=RegExp(`${sl.source}${ly}`),il=RegExp(`(?:[Tt]${Nu.source})?`),cy=/([+-]\d{6}|\d{4})(?:-?(\d\d)(?:-?(\d\d))?)?/,uy=/(\d{4})-?W(\d\d)(?:-?(\d))?/,dy=/(\d{4})-?(\d{3})/,py=Au("weekYear","weekNumber","weekDay"),fy=Au("year","ordinal"),hy=/(\d{4})-(\d\d)-(\d\d)/,Lu=RegExp(`${sl.source} ?(?:${Fu.source}|(${$u.source}))?`),my=RegExp(`(?: ${Lu.source})?`);function To(k,p,S){const P=k[p];return ke(P)?S:Mr(P)}function gy(k,p){return[{year:To(k,p),month:To(k,p+1,1),day:To(k,p+2,1)},null,p+3]}function Io(k,p){return[{hours:To(k,p,0),minutes:To(k,p+1,0),seconds:To(k,p+2,0),milliseconds:nl(k[p+3])},null,p+4]}function ds(k,p){const S=!k[p]&&!k[p+1],P=Oi(k[p+1],k[p+2]),B=S?null:it.instance(P);return[{},B,p+3]}function ps(k,p){const S=k[p]?K.create(k[p]):null;return[{},S,p+1]}const yy=RegExp(`^T?${sl.source}$`),by=/^-?P(?:(?:(-?\d{1,20}(?:\.\d{1,20})?)Y)?(?:(-?\d{1,20}(?:\.\d{1,20})?)M)?(?:(-?\d{1,20}(?:\.\d{1,20})?)W)?(?:(-?\d{1,20}(?:\.\d{1,20})?)D)?(?:T(?:(-?\d{1,20}(?:\.\d{1,20})?)H)?(?:(-?\d{1,20}(?:\.\d{1,20})?)M)?(?:(-?\d{1,20})(?:[.,](-?\d{1,20}))?S)?)?)$/;function xy(k){const[p,S,P,B,q,ee,ne,ie,we]=k,Ne=p[0]==="-",Ue=ie&&ie[0]==="-",xt=(Be,Vt=!1)=>Be!==void 0&&(Vt||Be&&Ne)?-Be:Be;return[{years:xt(Vr(S)),months:xt(Vr(P)),weeks:xt(Vr(B)),days:xt(Vr(q)),hours:xt(Vr(ee)),minutes:xt(Vr(ne)),seconds:xt(Vr(ie),ie==="-0"),milliseconds:xt(nl(we),Ue)}]}const vy={GMT:0,EDT:-240,EST:-300,CDT:-300,CST:-360,MDT:-360,MST:-420,PDT:-420,PST:-480};function al(k,p,S,P,B,q,ee){const ne={year:p.length===2?ol(Mr(p)):Mr(p),month:Iu.indexOf(S)+1,day:Mr(P),hour:Mr(B),minute:Mr(q)};return ee&&(ne.second=Mr(ee)),k&&(ne.weekday=k.length>3?Du.indexOf(k)+1:Pu.indexOf(k)+1),ne}const Sy=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|(?:([+-]\d\d)(\d\d)))$/;function Cy(k){const[,p,S,P,B,q,ee,ne,ie,we,Ne,Ue]=k,xt=al(p,B,P,S,q,ee,ne);let Be;return ie?Be=vy[ie]:we?Be=0:Be=Oi(Ne,Ue),[xt,new it(Be)]}function wy(k){return k.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").trim()}const ky=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\d\d) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{4}) (\d\d):(\d\d):(\d\d) GMT$/,Ty=/^(Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (\d\d)-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\d\d) (\d\d):(\d\d):(\d\d) GMT$/,Iy=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( \d|\d\d) (\d\d):(\d\d):(\d\d) (\d{4})$/;function Bu(k){const[,p,S,P,B,q,ee,ne]=k;return[al(p,B,P,S,q,ee,ne),it.utcInstance]}function My(k){const[,p,S,P,B,q,ee,ne]=k;return[al(p,ne,S,P,B,q,ee),it.utcInstance]}const Dy=Co(cy,il),Py=Co(uy,il),Ey=Co(dy,il),Oy=Co(Nu),Vu=wo(gy,Io,ds,ps),Ry=wo(py,Io,ds,ps),jy=wo(fy,Io,ds,ps),$y=wo(Io,ds,ps);function Ay(k){return ko(k,[Dy,Vu],[Py,Ry],[Ey,jy],[Oy,$y])}function Fy(k){return ko(wy(k),[Sy,Cy])}function Ny(k){return ko(k,[ky,Bu],[Ty,Bu],[Iy,My])}function Ly(k){return ko(k,[by,xy])}const By=wo(Io);function Vy(k){return ko(k,[yy,By])}const zy=Co(hy,my),_y=Co(Lu),Wy=wo(Io,ds,ps);function Hy(k){return ko(k,[zy,Vu],[_y,Wy])}const zu="Invalid Duration",_u={weeks:{days:7,hours:168,minutes:10080,seconds:10080*60,milliseconds:10080*60*1e3},days:{hours:24,minutes:1440,seconds:1440*60,milliseconds:1440*60*1e3},hours:{minutes:60,seconds:3600,milliseconds:3600*1e3},minutes:{seconds:60,milliseconds:60*1e3},seconds:{milliseconds:1e3}},Uy={years:{quarters:4,months:12,weeks:52,days:365,hours:365*24,minutes:365*24*60,seconds:365*24*60*60,milliseconds:365*24*60*60*1e3},quarters:{months:3,weeks:13,days:91,hours:2184,minutes:2184*60,seconds:2184*60*60,milliseconds:2184*60*60*1e3},months:{weeks:4,days:30,hours:720,minutes:720*60,seconds:720*60*60,milliseconds:720*60*60*1e3},..._u},Sn=146097/400,Mo=146097/4800,qy={years:{quarters:4,months:12,weeks:Sn/7,days:Sn,hours:Sn*24,minutes:Sn*24*60,seconds:Sn*24*60*60,milliseconds:Sn*24*60*60*1e3},quarters:{months:3,weeks:Sn/28,days:Sn/4,hours:Sn*24/4,minutes:Sn*24*60/4,seconds:Sn*24*60*60/4,milliseconds:Sn*24*60*60*1e3/4},months:{weeks:Mo/7,days:Mo,hours:Mo*24,minutes:Mo*24*60,seconds:Mo*24*60*60,milliseconds:Mo*24*60*60*1e3},..._u},zr=["years","quarters","months","weeks","days","hours","minutes","seconds","milliseconds"],Yy=zr.slice(0).reverse();function dr(k,p,S=!1){const P={values:S?p.values:{...k.values,...p.values||{}},loc:k.loc.clone(p.loc),conversionAccuracy:p.conversionAccuracy||k.conversionAccuracy,matrix:p.matrix||k.matrix};return new ot(P)}function Wu(k,p){var S;let P=(S=p.milliseconds)!=null?S:0;for(const B of Yy.slice(1))p[B]&&(P+=p[B]*k[B].milliseconds);return P}function Hu(k,p){const S=Wu(k,p)<0?-1:1;zr.reduceRight((P,B)=>{if(ke(p[B]))return P;if(P){const q=p[P]*S,ee=k[B][P],ne=Math.floor(q/ee);p[B]+=ne*S,p[P]-=ne*ee*S}return B},null),zr.reduce((P,B)=>{if(ke(p[B]))return P;if(P){const q=p[P]%1;p[P]-=q,p[B]+=q*k[P][B]}return B},null)}function Uu(k){const p={};for(const[S,P]of Object.entries(k))P!==0&&(p[S]=P);return p}class ot{constructor(p){const S=p.conversionAccuracy==="longterm"||!1;let P=S?qy:Uy;p.matrix&&(P=p.matrix),this.values=p.values,this.loc=p.loc||Ie.create(),this.conversionAccuracy=S?"longterm":"casual",this.invalid=p.invalid||null,this.matrix=P,this.isLuxonDuration=!0}static fromMillis(p,S){return ot.fromObject({milliseconds:p},S)}static fromObject(p,S={}){if(p==null||typeof p!="object")throw new i(`Duration.fromObject: argument expected to be an object, got ${p===null?"null":typeof p}`);return new ot({values:Ri(p,ot.normalizeUnit),loc:Ie.fromObject(S),conversionAccuracy:S.conversionAccuracy,matrix:S.matrix})}static fromDurationLike(p){if(bt(p))return ot.fromMillis(p);if(ot.isDuration(p))return p;if(typeof p=="object")return ot.fromObject(p);throw new i(`Unknown duration argument ${p} of type ${typeof p}`)}static fromISO(p,S){const[P]=Ly(p);return P?ot.fromObject(P,S):ot.invalid("unparsable",`the input "${p}" can't be parsed as ISO 8601`)}static fromISOTime(p,S){const[P]=Vy(p);return P?ot.fromObject(P,S):ot.invalid("unparsable",`the input "${p}" can't be parsed as ISO 8601`)}static invalid(p,S=null){if(!p)throw new i("need to specify a reason the Duration is invalid");const P=p instanceof Ut?p:new Ut(p,S);if(dt.throwOnInvalid)throw new r(P);return new ot({invalid:P})}static normalizeUnit(p){const S={year:"years",years:"years",quarter:"quarters",quarters:"quarters",month:"months",months:"months",week:"weeks",weeks:"weeks",day:"days",days:"days",hour:"hours",hours:"hours",minute:"minutes",minutes:"minutes",second:"seconds",seconds:"seconds",millisecond:"milliseconds",milliseconds:"milliseconds"}[p&&p.toLowerCase()];if(!S)throw new s(p);return S}static isDuration(p){return p&&p.isLuxonDuration||!1}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}toFormat(p,S={}){const P={...S,floor:S.round!==!1&&S.floor!==!1};return this.isValid?Xt.create(this.loc,P).formatDurationFromString(this,p):zu}toHuman(p={}){if(!this.isValid)return zu;const S=p.showZeros!==!1,P=zr.map(B=>{const q=this.values[B];return ke(q)||q===0&&!S?null:this.loc.numberFormatter({style:"unit",unitDisplay:"long",...p,unit:B.slice(0,-1)}).format(q)}).filter(B=>B);return this.loc.listFormatter({type:"conjunction",style:p.listStyle||"narrow",...p}).format(P)}toObject(){return this.isValid?{...this.values}:{}}toISO(){if(!this.isValid)return null;let p="P";return this.years!==0&&(p+=this.years+"Y"),(this.months!==0||this.quarters!==0)&&(p+=this.months+this.quarters*3+"M"),this.weeks!==0&&(p+=this.weeks+"W"),this.days!==0&&(p+=this.days+"D"),(this.hours!==0||this.minutes!==0||this.seconds!==0||this.milliseconds!==0)&&(p+="T"),this.hours!==0&&(p+=this.hours+"H"),this.minutes!==0&&(p+=this.minutes+"M"),(this.seconds!==0||this.milliseconds!==0)&&(p+=rl(this.seconds+this.milliseconds/1e3,3)+"S"),p==="P"&&(p+="T0S"),p}toISOTime(p={}){if(!this.isValid)return null;const S=this.toMillis();return S<0||S>=864e5?null:(p={suppressMilliseconds:!1,suppressSeconds:!1,includePrefix:!1,format:"extended",...p,includeOffset:!1},_e.fromMillis(S,{zone:"UTC"}).toISOTime(p))}toJSON(){return this.toISO()}toString(){return this.toISO()}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`Duration { values: ${JSON.stringify(this.values)} }`:`Duration { Invalid, reason: ${this.invalidReason} }`}toMillis(){return this.isValid?Wu(this.matrix,this.values):NaN}valueOf(){return this.toMillis()}plus(p){if(!this.isValid)return this;const S=ot.fromDurationLike(p),P={};for(const B of zr)(Jt(S.values,B)||Jt(this.values,B))&&(P[B]=S.get(B)+this.get(B));return dr(this,{values:P},!0)}minus(p){if(!this.isValid)return this;const S=ot.fromDurationLike(p);return this.plus(S.negate())}mapUnits(p){if(!this.isValid)return this;const S={};for(const P of Object.keys(this.values))S[P]=Tu(p(this.values[P],P));return dr(this,{values:S},!0)}get(p){return this[ot.normalizeUnit(p)]}set(p){if(!this.isValid)return this;const S={...this.values,...Ri(p,ot.normalizeUnit)};return dr(this,{values:S})}reconfigure({locale:p,numberingSystem:S,conversionAccuracy:P,matrix:B}={}){const ee={loc:this.loc.clone({locale:p,numberingSystem:S}),matrix:B,conversionAccuracy:P};return dr(this,ee)}as(p){return this.isValid?this.shiftTo(p).get(p):NaN}normalize(){if(!this.isValid)return this;const p=this.toObject();return Hu(this.matrix,p),dr(this,{values:p},!0)}rescale(){if(!this.isValid)return this;const p=Uu(this.normalize().shiftToAll().toObject());return dr(this,{values:p},!0)}shiftTo(...p){if(!this.isValid)return this;if(p.length===0)return this;p=p.map(ee=>ot.normalizeUnit(ee));const S={},P={},B=this.toObject();let q;for(const ee of zr)if(p.indexOf(ee)>=0){q=ee;let ne=0;for(const we in P)ne+=this.matrix[we][ee]*P[we],P[we]=0;bt(B[ee])&&(ne+=B[ee]);const ie=Math.trunc(ne);S[ee]=ie,P[ee]=(ne*1e3-ie*1e3)/1e3}else bt(B[ee])&&(P[ee]=B[ee]);for(const ee in P)P[ee]!==0&&(S[q]+=ee===q?P[ee]:P[ee]/this.matrix[q][ee]);return Hu(this.matrix,S),dr(this,{values:S},!0)}shiftToAll(){return this.isValid?this.shiftTo("years","months","weeks","days","hours","minutes","seconds","milliseconds"):this}negate(){if(!this.isValid)return this;const p={};for(const S of Object.keys(this.values))p[S]=this.values[S]===0?0:-this.values[S];return dr(this,{values:p},!0)}removeZeros(){if(!this.isValid)return this;const p=Uu(this.values);return dr(this,{values:p},!0)}get years(){return this.isValid?this.values.years||0:NaN}get quarters(){return this.isValid?this.values.quarters||0:NaN}get months(){return this.isValid?this.values.months||0:NaN}get weeks(){return this.isValid?this.values.weeks||0:NaN}get days(){return this.isValid?this.values.days||0:NaN}get hours(){return this.isValid?this.values.hours||0:NaN}get minutes(){return this.isValid?this.values.minutes||0:NaN}get seconds(){return this.isValid?this.values.seconds||0:NaN}get milliseconds(){return this.isValid?this.values.milliseconds||0:NaN}get isValid(){return this.invalid===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}equals(p){if(!this.isValid||!p.isValid||!this.loc.equals(p.loc))return!1;function S(P,B){return P===void 0||P===0?B===void 0||B===0:P===B}for(const P of zr)if(!S(this.values[P],p.values[P]))return!1;return!0}}const Do="Invalid Interval";function Ky(k,p){return!k||!k.isValid?Rt.invalid("missing or invalid start"):!p||!p.isValid?Rt.invalid("missing or invalid end"):p<k?Rt.invalid("end before start",`The end of an interval must be after its start, but you had start=${k.toISO()} and end=${p.toISO()}`):null}class Rt{constructor(p){this.s=p.start,this.e=p.end,this.invalid=p.invalid||null,this.isLuxonInterval=!0}static invalid(p,S=null){if(!p)throw new i("need to specify a reason the Interval is invalid");const P=p instanceof Ut?p:new Ut(p,S);if(dt.throwOnInvalid)throw new n(P);return new Rt({invalid:P})}static fromDateTimes(p,S){const P=gs(p),B=gs(S),q=Ky(P,B);return q??new Rt({start:P,end:B})}static after(p,S){const P=ot.fromDurationLike(S),B=gs(p);return Rt.fromDateTimes(B,B.plus(P))}static before(p,S){const P=ot.fromDurationLike(S),B=gs(p);return Rt.fromDateTimes(B.minus(P),B)}static fromISO(p,S){const[P,B]=(p||"").split("/",2);if(P&&B){let q,ee;try{q=_e.fromISO(P,S),ee=q.isValid}catch{ee=!1}let ne,ie;try{ne=_e.fromISO(B,S),ie=ne.isValid}catch{ie=!1}if(ee&&ie)return Rt.fromDateTimes(q,ne);if(ee){const we=ot.fromISO(B,S);if(we.isValid)return Rt.after(q,we)}else if(ie){const we=ot.fromISO(P,S);if(we.isValid)return Rt.before(ne,we)}}return Rt.invalid("unparsable",`the input "${p}" can't be parsed as ISO 8601`)}static isInterval(p){return p&&p.isLuxonInterval||!1}get start(){return this.isValid?this.s:null}get end(){return this.isValid?this.e:null}get lastDateTime(){return this.isValid&&this.e?this.e.minus(1):null}get isValid(){return this.invalidReason===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}length(p="milliseconds"){return this.isValid?this.toDuration(p).get(p):NaN}count(p="milliseconds",S){if(!this.isValid)return NaN;const P=this.start.startOf(p,S);let B;return S!=null&&S.useLocaleWeeks?B=this.end.reconfigure({locale:P.locale}):B=this.end,B=B.startOf(p,S),Math.floor(B.diff(P,p).get(p))+(B.valueOf()!==this.end.valueOf())}hasSame(p){return this.isValid?this.isEmpty()||this.e.minus(1).hasSame(this.s,p):!1}isEmpty(){return this.s.valueOf()===this.e.valueOf()}isAfter(p){return this.isValid?this.s>p:!1}isBefore(p){return this.isValid?this.e<=p:!1}contains(p){return this.isValid?this.s<=p&&this.e>p:!1}set({start:p,end:S}={}){return this.isValid?Rt.fromDateTimes(p||this.s,S||this.e):this}splitAt(...p){if(!this.isValid)return[];const S=p.map(gs).filter(ee=>this.contains(ee)).sort((ee,ne)=>ee.toMillis()-ne.toMillis()),P=[];let{s:B}=this,q=0;for(;B<this.e;){const ee=S[q]||this.e,ne=+ee>+this.e?this.e:ee;P.push(Rt.fromDateTimes(B,ne)),B=ne,q+=1}return P}splitBy(p){const S=ot.fromDurationLike(p);if(!this.isValid||!S.isValid||S.as("milliseconds")===0)return[];let{s:P}=this,B=1,q;const ee=[];for(;P<this.e;){const ne=this.start.plus(S.mapUnits(ie=>ie*B));q=+ne>+this.e?this.e:ne,ee.push(Rt.fromDateTimes(P,q)),P=q,B+=1}return ee}divideEqually(p){return this.isValid?this.splitBy(this.length()/p).slice(0,p):[]}overlaps(p){return this.e>p.s&&this.s<p.e}abutsStart(p){return this.isValid?+this.e==+p.s:!1}abutsEnd(p){return this.isValid?+p.e==+this.s:!1}engulfs(p){return this.isValid?this.s<=p.s&&this.e>=p.e:!1}equals(p){return!this.isValid||!p.isValid?!1:this.s.equals(p.s)&&this.e.equals(p.e)}intersection(p){if(!this.isValid)return this;const S=this.s>p.s?this.s:p.s,P=this.e<p.e?this.e:p.e;return S>=P?null:Rt.fromDateTimes(S,P)}union(p){if(!this.isValid)return this;const S=this.s<p.s?this.s:p.s,P=this.e>p.e?this.e:p.e;return Rt.fromDateTimes(S,P)}static merge(p){const[S,P]=p.sort((B,q)=>B.s-q.s).reduce(([B,q],ee)=>q?q.overlaps(ee)||q.abutsStart(ee)?[B,q.union(ee)]:[B.concat([q]),ee]:[B,ee],[[],null]);return P&&S.push(P),S}static xor(p){let S=null,P=0;const B=[],q=p.map(ie=>[{time:ie.s,type:"s"},{time:ie.e,type:"e"}]),ee=Array.prototype.concat(...q),ne=ee.sort((ie,we)=>ie.time-we.time);for(const ie of ne)P+=ie.type==="s"?1:-1,P===1?S=ie.time:(S&&+S!=+ie.time&&B.push(Rt.fromDateTimes(S,ie.time)),S=null);return Rt.merge(B)}difference(...p){return Rt.xor([this].concat(p)).map(S=>this.intersection(S)).filter(S=>S&&!S.isEmpty())}toString(){return this.isValid?`[${this.s.toISO()} – ${this.e.toISO()})`:Do}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`Interval { start: ${this.s.toISO()}, end: ${this.e.toISO()} }`:`Interval { Invalid, reason: ${this.invalidReason} }`}toLocaleString(p=f,S={}){return this.isValid?Xt.create(this.s.loc.clone(S),p).formatInterval(this):Do}toISO(p){return this.isValid?`${this.s.toISO(p)}/${this.e.toISO(p)}`:Do}toISODate(){return this.isValid?`${this.s.toISODate()}/${this.e.toISODate()}`:Do}toISOTime(p){return this.isValid?`${this.s.toISOTime(p)}/${this.e.toISOTime(p)}`:Do}toFormat(p,{separator:S=" – "}={}){return this.isValid?`${this.s.toFormat(p)}${S}${this.e.toFormat(p)}`:Do}toDuration(p,S){return this.isValid?this.e.diff(this.s,p,S):ot.invalid(this.invalidReason)}mapEndpoints(p){return Rt.fromDateTimes(p(this.s),p(this.e))}}class fs{static hasDST(p=dt.defaultZone){const S=_e.now().setZone(p).set({month:12});return!p.isUniversal&&S.offset!==S.set({month:6}).offset}static isValidIANAZone(p){return K.isValidZone(p)}static normalizeZone(p){return je(p,dt.defaultZone)}static getStartOfWeek({locale:p=null,locObj:S=null}={}){return(S||Ie.create(p)).getStartOfWeek()}static getMinimumDaysInFirstWeek({locale:p=null,locObj:S=null}={}){return(S||Ie.create(p)).getMinDaysInFirstWeek()}static getWeekendWeekdays({locale:p=null,locObj:S=null}={}){return(S||Ie.create(p)).getWeekendDays().slice()}static months(p="long",{locale:S=null,numberingSystem:P=null,locObj:B=null,outputCalendar:q="gregory"}={}){return(B||Ie.create(S,P,q)).months(p)}static monthsFormat(p="long",{locale:S=null,numberingSystem:P=null,locObj:B=null,outputCalendar:q="gregory"}={}){return(B||Ie.create(S,P,q)).months(p,!0)}static weekdays(p="long",{locale:S=null,numberingSystem:P=null,locObj:B=null}={}){return(B||Ie.create(S,P,null)).weekdays(p)}static weekdaysFormat(p="long",{locale:S=null,numberingSystem:P=null,locObj:B=null}={}){return(B||Ie.create(S,P,null)).weekdays(p,!0)}static meridiems({locale:p=null}={}){return Ie.create(p).meridiems()}static eras(p="short",{locale:S=null}={}){return Ie.create(S,null,"gregory").eras(p)}static features(){return{relative:is(),localeWeek:as()}}}function qu(k,p){const S=B=>B.toUTC(0,{keepLocalTime:!0}).startOf("day").valueOf(),P=S(p)-S(k);return Math.floor(ot.fromMillis(P).as("days"))}function Gy(k,p,S){const P=[["years",(ie,we)=>we.year-ie.year],["quarters",(ie,we)=>we.quarter-ie.quarter+(we.year-ie.year)*4],["months",(ie,we)=>we.month-ie.month+(we.year-ie.year)*12],["weeks",(ie,we)=>{const Ne=qu(ie,we);return(Ne-Ne%7)/7}],["days",qu]],B={},q=k;let ee,ne;for(const[ie,we]of P)S.indexOf(ie)>=0&&(ee=ie,B[ie]=we(k,p),ne=q.plus(B),ne>p?(B[ie]--,k=q.plus(B),k>p&&(ne=k,B[ie]--,k=q.plus(B))):k=ne);return[k,B,ne,ee]}function Zy(k,p,S,P){let[B,q,ee,ne]=Gy(k,p,S);const ie=p-B,we=S.filter(Ue=>["hours","minutes","seconds","milliseconds"].indexOf(Ue)>=0);we.length===0&&(ee<p&&(ee=B.plus({[ne]:1})),ee!==B&&(q[ne]=(q[ne]||0)+ie/(ee-B)));const Ne=ot.fromObject(q,P);return we.length>0?ot.fromMillis(ie,P).shiftTo(...we).plus(Ne):Ne}const Xy="missing Intl.DateTimeFormat.formatToParts support";function ct(k,p=S=>S){return{regex:k,deser:([S])=>p(at(S))}}const Yu="[  ]",Ku=new RegExp(Yu,"g");function Qy(k){return k.replace(/\./g,"\\.?").replace(Ku,Yu)}function Gu(k){return k.replace(/\./g,"").replace(Ku," ").toLowerCase()}function Vn(k,p){return k===null?null:{regex:RegExp(k.map(Qy).join("|")),deser:([S])=>k.findIndex(P=>Gu(S)===Gu(P))+p}}function Zu(k,p){return{regex:k,deser:([,S,P])=>Oi(S,P),groups:p}}function $i(k){return{regex:k,deser:([p])=>p}}function Jy(k){return k.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function eb(k,p){const S=ut(p),P=ut(p,"{2}"),B=ut(p,"{3}"),q=ut(p,"{4}"),ee=ut(p,"{6}"),ne=ut(p,"{1,2}"),ie=ut(p,"{1,3}"),we=ut(p,"{1,6}"),Ne=ut(p,"{1,9}"),Ue=ut(p,"{2,4}"),xt=ut(p,"{4,6}"),Be=Gn=>({regex:RegExp(Jy(Gn.val)),deser:([Eo])=>Eo,literal:!0}),zn=(Gn=>{if(k.literal)return Be(Gn);switch(Gn.val){case"G":return Vn(p.eras("short"),0);case"GG":return Vn(p.eras("long"),0);case"y":return ct(we);case"yy":return ct(Ue,ol);case"yyyy":return ct(q);case"yyyyy":return ct(xt);case"yyyyyy":return ct(ee);case"M":return ct(ne);case"MM":return ct(P);case"MMM":return Vn(p.months("short",!0),1);case"MMMM":return Vn(p.months("long",!0),1);case"L":return ct(ne);case"LL":return ct(P);case"LLL":return Vn(p.months("short",!1),1);case"LLLL":return Vn(p.months("long",!1),1);case"d":return ct(ne);case"dd":return ct(P);case"o":return ct(ie);case"ooo":return ct(B);case"HH":return ct(P);case"H":return ct(ne);case"hh":return ct(P);case"h":return ct(ne);case"mm":return ct(P);case"m":return ct(ne);case"q":return ct(ne);case"qq":return ct(P);case"s":return ct(ne);case"ss":return ct(P);case"S":return ct(ie);case"SSS":return ct(B);case"u":return $i(Ne);case"uu":return $i(ne);case"uuu":return ct(S);case"a":return Vn(p.meridiems(),0);case"kkkk":return ct(q);case"kk":return ct(Ue,ol);case"W":return ct(ne);case"WW":return ct(P);case"E":case"c":return ct(S);case"EEE":return Vn(p.weekdays("short",!1),1);case"EEEE":return Vn(p.weekdays("long",!1),1);case"ccc":return Vn(p.weekdays("short",!0),1);case"cccc":return Vn(p.weekdays("long",!0),1);case"Z":case"ZZ":return Zu(new RegExp(`([+-]${ne.source})(?::(${P.source}))?`),2);case"ZZZ":return Zu(new RegExp(`([+-]${ne.source})(${P.source})?`),2);case"z":return $i(/[a-z_+-/]{1,256}?/i);case" ":return $i(/[^\S\n\r]/);default:return Be(Gn)}})(k)||{invalidReason:Xy};return zn.token=k,zn}const tb={year:{"2-digit":"yy",numeric:"yyyyy"},month:{numeric:"M","2-digit":"MM",short:"MMM",long:"MMMM"},day:{numeric:"d","2-digit":"dd"},weekday:{short:"EEE",long:"EEEE"},dayperiod:"a",dayPeriod:"a",hour12:{numeric:"h","2-digit":"hh"},hour24:{numeric:"H","2-digit":"HH"},minute:{numeric:"m","2-digit":"mm"},second:{numeric:"s","2-digit":"ss"},timeZoneName:{long:"ZZZZZ",short:"ZZZ"}};function nb(k,p,S){const{type:P,value:B}=k;if(P==="literal"){const ie=/^\s+$/.test(B);return{literal:!ie,val:ie?" ":B}}const q=p[P];let ee=P;P==="hour"&&(p.hour12!=null?ee=p.hour12?"hour12":"hour24":p.hourCycle!=null?p.hourCycle==="h11"||p.hourCycle==="h12"?ee="hour12":ee="hour24":ee=S.hour12?"hour12":"hour24");let ne=tb[ee];if(typeof ne=="object"&&(ne=ne[q]),ne)return{literal:!1,val:ne}}function rb(k){return[`^${k.map(S=>S.regex).reduce((S,P)=>`${S}(${P.source})`,"")}$`,k]}function ob(k,p,S){const P=k.match(p);if(P){const B={};let q=1;for(const ee in S)if(Jt(S,ee)){const ne=S[ee],ie=ne.groups?ne.groups+1:1;!ne.literal&&ne.token&&(B[ne.token.val[0]]=ne.deser(P.slice(q,q+ie))),q+=ie}return[P,B]}else return[P,{}]}function sb(k){const p=q=>{switch(q){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":case"H":return"hour";case"d":return"day";case"o":return"ordinal";case"L":case"M":return"month";case"y":return"year";case"E":case"c":return"weekday";case"W":return"weekNumber";case"k":return"weekYear";case"q":return"quarter";default:return null}};let S=null,P;return ke(k.z)||(S=K.create(k.z)),ke(k.Z)||(S||(S=new it(k.Z)),P=k.Z),ke(k.q)||(k.M=(k.q-1)*3+1),ke(k.h)||(k.h<12&&k.a===1?k.h+=12:k.h===12&&k.a===0&&(k.h=0)),k.G===0&&k.y&&(k.y=-k.y),ke(k.u)||(k.S=nl(k.u)),[Object.keys(k).reduce((q,ee)=>{const ne=p(ee);return ne&&(q[ne]=k[ee]),q},{}),S,P]}let ll=null;function ib(){return ll||(ll=_e.fromMillis(1555555555555)),ll}function ab(k,p){if(k.literal)return k;const S=Xt.macroTokenToFormatOpts(k.val),P=ed(S,p);return P==null||P.includes(void 0)?k:P}function Xu(k,p){return Array.prototype.concat(...k.map(S=>ab(S,p)))}class Qu{constructor(p,S){if(this.locale=p,this.format=S,this.tokens=Xu(Xt.parseFormat(S),p),this.units=this.tokens.map(P=>eb(P,p)),this.disqualifyingUnit=this.units.find(P=>P.invalidReason),!this.disqualifyingUnit){const[P,B]=rb(this.units);this.regex=RegExp(P,"i"),this.handlers=B}}explainFromTokens(p){if(this.isValid){const[S,P]=ob(p,this.regex,this.handlers),[B,q,ee]=P?sb(P):[null,null,void 0];if(Jt(P,"a")&&Jt(P,"H"))throw new o("Can't include meridiem when specifying 24-hour format");return{input:p,tokens:this.tokens,regex:this.regex,rawMatches:S,matches:P,result:B,zone:q,specificOffset:ee}}else return{input:p,tokens:this.tokens,invalidReason:this.invalidReason}}get isValid(){return!this.disqualifyingUnit}get invalidReason(){return this.disqualifyingUnit?this.disqualifyingUnit.invalidReason:null}}function Ju(k,p,S){return new Qu(k,S).explainFromTokens(p)}function lb(k,p,S){const{result:P,zone:B,specificOffset:q,invalidReason:ee}=Ju(k,p,S);return[P,B,q,ee]}function ed(k,p){if(!k)return null;const P=Xt.create(p,k).dtFormatter(ib()),B=P.formatToParts(),q=P.resolvedOptions();return B.map(ee=>nb(ee,k,q))}const cl="Invalid DateTime",td=864e13;function hs(k){return new Ut("unsupported zone",`the zone "${k.name}" is not supported`)}function ul(k){return k.weekData===null&&(k.weekData=Ot(k.c)),k.weekData}function dl(k){return k.localWeekData===null&&(k.localWeekData=Ot(k.c,k.loc.getMinDaysInFirstWeek(),k.loc.getStartOfWeek())),k.localWeekData}function _r(k,p){const S={ts:k.ts,zone:k.zone,c:k.c,o:k.o,loc:k.loc,invalid:k.invalid};return new _e({...S,...p,old:S})}function nd(k,p,S){let P=k-p*60*1e3;const B=S.offset(P);if(p===B)return[P,p];P-=(B-p)*60*1e3;const q=S.offset(P);return B===q?[P,B]:[k-Math.min(B,q)*60*1e3,Math.max(B,q)]}function Ai(k,p){k+=p*60*1e3;const S=new Date(k);return{year:S.getUTCFullYear(),month:S.getUTCMonth()+1,day:S.getUTCDate(),hour:S.getUTCHours(),minute:S.getUTCMinutes(),second:S.getUTCSeconds(),millisecond:S.getUTCMilliseconds()}}function Fi(k,p,S){return nd(Ei(k),p,S)}function rd(k,p){const S=k.o,P=k.c.year+Math.trunc(p.years),B=k.c.month+Math.trunc(p.months)+Math.trunc(p.quarters)*3,q={...k.c,year:P,month:B,day:Math.min(k.c.day,Pi(P,B))+Math.trunc(p.days)+Math.trunc(p.weeks)*7},ee=ot.fromObject({years:p.years-Math.trunc(p.years),quarters:p.quarters-Math.trunc(p.quarters),months:p.months-Math.trunc(p.months),weeks:p.weeks-Math.trunc(p.weeks),days:p.days-Math.trunc(p.days),hours:p.hours,minutes:p.minutes,seconds:p.seconds,milliseconds:p.milliseconds}).as("milliseconds"),ne=Ei(q);let[ie,we]=nd(ne,S,k.zone);return ee!==0&&(ie+=ee,we=k.zone.offset(ie)),{ts:ie,o:we}}function Po(k,p,S,P,B,q){const{setZone:ee,zone:ne}=S;if(k&&Object.keys(k).length!==0||p){const ie=p||ne,we=_e.fromObject(k,{...S,zone:ie,specificOffset:q});return ee?we:we.setZone(ne)}else return _e.invalid(new Ut("unparsable",`the input "${B}" can't be parsed as ${P}`))}function Ni(k,p,S=!0){return k.isValid?Xt.create(Ie.create("en-US"),{allowZ:S,forceSimple:!0}).formatDateTimeFromString(k,p):null}function pl(k,p,S){const P=k.c.year>9999||k.c.year<0;let B="";if(P&&k.c.year>=0&&(B+="+"),B+=Bt(k.c.year,P?6:4),S==="year")return B;if(p){if(B+="-",B+=Bt(k.c.month),S==="month")return B;B+="-"}else if(B+=Bt(k.c.month),S==="month")return B;return B+=Bt(k.c.day),B}function od(k,p,S,P,B,q,ee){let ne=!S||k.c.millisecond!==0||k.c.second!==0,ie="";switch(ee){case"day":case"month":case"year":break;default:if(ie+=Bt(k.c.hour),ee==="hour")break;if(p){if(ie+=":",ie+=Bt(k.c.minute),ee==="minute")break;ne&&(ie+=":",ie+=Bt(k.c.second))}else{if(ie+=Bt(k.c.minute),ee==="minute")break;ne&&(ie+=Bt(k.c.second))}if(ee==="second")break;ne&&(!P||k.c.millisecond!==0)&&(ie+=".",ie+=Bt(k.c.millisecond,3))}return B&&(k.isOffsetFixed&&k.offset===0&&!q?ie+="Z":k.o<0?(ie+="-",ie+=Bt(Math.trunc(-k.o/60)),ie+=":",ie+=Bt(Math.trunc(-k.o%60))):(ie+="+",ie+=Bt(Math.trunc(k.o/60)),ie+=":",ie+=Bt(Math.trunc(k.o%60)))),q&&(ie+="["+k.zone.ianaName+"]"),ie}const sd={month:1,day:1,hour:0,minute:0,second:0,millisecond:0},cb={weekNumber:1,weekday:1,hour:0,minute:0,second:0,millisecond:0},ub={ordinal:1,hour:0,minute:0,second:0,millisecond:0},Li=["year","month","day","hour","minute","second","millisecond"],db=["weekYear","weekNumber","weekday","hour","minute","second","millisecond"],pb=["year","ordinal","hour","minute","second","millisecond"];function Bi(k){const p={year:"year",years:"year",month:"month",months:"month",day:"day",days:"day",hour:"hour",hours:"hour",minute:"minute",minutes:"minute",quarter:"quarter",quarters:"quarter",second:"second",seconds:"second",millisecond:"millisecond",milliseconds:"millisecond",weekday:"weekday",weekdays:"weekday",weeknumber:"weekNumber",weeksnumber:"weekNumber",weeknumbers:"weekNumber",weekyear:"weekYear",weekyears:"weekYear",ordinal:"ordinal"}[k.toLowerCase()];if(!p)throw new s(k);return p}function id(k){switch(k.toLowerCase()){case"localweekday":case"localweekdays":return"localWeekday";case"localweeknumber":case"localweeknumbers":return"localWeekNumber";case"localweekyear":case"localweekyears":return"localWeekYear";default:return Bi(k)}}function fb(k){if(ms===void 0&&(ms=dt.now()),k.type!=="iana")return k.offset(ms);const p=k.name;let S=fl.get(p);return S===void 0&&(S=k.offset(ms),fl.set(p,S)),S}function ad(k,p){const S=je(p.zone,dt.defaultZone);if(!S.isValid)return _e.invalid(hs(S));const P=Ie.fromObject(p);let B,q;if(ke(k.year))B=dt.now();else{for(const ie of Li)ke(k[ie])&&(k[ie]=sd[ie]);const ee=Oe(k)||Le(k);if(ee)return _e.invalid(ee);const ne=fb(S);[B,q]=Fi(k,ne,S)}return new _e({ts:B,zone:S,loc:P,o:q})}function ld(k,p,S){const P=ke(S.round)?!0:S.round,B=ke(S.rounding)?"trunc":S.rounding,q=(ne,ie)=>(ne=rl(ne,P||S.calendary?0:2,S.calendary?"round":B),p.loc.clone(S).relFormatter(S).format(ne,ie)),ee=ne=>S.calendary?p.hasSame(k,ne)?0:p.startOf(ne).diff(k.startOf(ne),ne).get(ne):p.diff(k,ne).get(ne);if(S.unit)return q(ee(S.unit),S.unit);for(const ne of S.units){const ie=ee(ne);if(Math.abs(ie)>=1)return q(ie,ne)}return q(k>p?-0:0,S.units[S.units.length-1])}function cd(k){let p={},S;return k.length>0&&typeof k[k.length-1]=="object"?(p=k[k.length-1],S=Array.from(k).slice(0,k.length-1)):S=Array.from(k),[p,S]}let ms;const fl=new Map;class _e{constructor(p){const S=p.zone||dt.defaultZone;let P=p.invalid||(Number.isNaN(p.ts)?new Ut("invalid input"):null)||(S.isValid?null:hs(S));this.ts=ke(p.ts)?dt.now():p.ts;let B=null,q=null;if(!P)if(p.old&&p.old.ts===this.ts&&p.old.zone.equals(S))[B,q]=[p.old.c,p.old.o];else{const ne=bt(p.o)&&!p.old?p.o:S.offset(this.ts);B=Ai(this.ts,ne),P=Number.isNaN(B.year)?new Ut("invalid input"):null,B=P?null:B,q=P?null:ne}this._zone=S,this.loc=p.loc||Ie.create(),this.invalid=P,this.weekData=null,this.localWeekData=null,this.c=B,this.o=q,this.isLuxonDateTime=!0}static now(){return new _e({})}static local(){const[p,S]=cd(arguments),[P,B,q,ee,ne,ie,we]=S;return ad({year:P,month:B,day:q,hour:ee,minute:ne,second:ie,millisecond:we},p)}static utc(){const[p,S]=cd(arguments),[P,B,q,ee,ne,ie,we]=S;return p.zone=it.utcInstance,ad({year:P,month:B,day:q,hour:ee,minute:ne,second:ie,millisecond:we},p)}static fromJSDate(p,S={}){const P=vo(p)?p.valueOf():NaN;if(Number.isNaN(P))return _e.invalid("invalid input");const B=je(S.zone,dt.defaultZone);return B.isValid?new _e({ts:P,zone:B,loc:Ie.fromObject(S)}):_e.invalid(hs(B))}static fromMillis(p,S={}){if(bt(p))return p<-td||p>td?_e.invalid("Timestamp out of range"):new _e({ts:p,zone:je(S.zone,dt.defaultZone),loc:Ie.fromObject(S)});throw new i(`fromMillis requires a numerical input, but received a ${typeof p} with value ${p}`)}static fromSeconds(p,S={}){if(bt(p))return new _e({ts:p*1e3,zone:je(S.zone,dt.defaultZone),loc:Ie.fromObject(S)});throw new i("fromSeconds requires a numerical input")}static fromObject(p,S={}){p=p||{};const P=je(S.zone,dt.defaultZone);if(!P.isValid)return _e.invalid(hs(P));const B=Ie.fromObject(S),q=Ri(p,id),{minDaysInFirstWeek:ee,startOfWeek:ne}=Br(q,B),ie=dt.now(),we=ke(S.specificOffset)?P.offset(ie):S.specificOffset,Ne=!ke(q.ordinal),Ue=!ke(q.year),xt=!ke(q.month)||!ke(q.day),Be=Ue||xt,Vt=q.weekYear||q.weekNumber;if((Be||Ne)&&Vt)throw new o("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(xt&&Ne)throw new o("Can't mix ordinal dates with month/day");const zn=Vt||q.weekday&&!Be;let Gn,Eo,ys=Ai(ie,we);zn?(Gn=db,Eo=cb,ys=Ot(ys,ee,ne)):Ne?(Gn=pb,Eo=ub,ys=Lr(ys)):(Gn=Li,Eo=sd);let ud=!1;for(const xs of Gn){const xb=q[xs];ke(xb)?ud?q[xs]=Eo[xs]:q[xs]=ys[xs]:ud=!0}const mb=zn?be(q,ee,ne):Ne?ge(q):Oe(q),dd=mb||Le(q);if(dd)return _e.invalid(dd);const gb=zn?Bn(q,ee,ne):Ne?Ir(q):q,[yb,bb]=Fi(gb,we,P),bs=new _e({ts:yb,zone:P,o:bb,loc:B});return q.weekday&&Be&&p.weekday!==bs.weekday?_e.invalid("mismatched weekday",`you can't specify both a weekday of ${q.weekday} and a date of ${bs.toISO()}`):bs.isValid?bs:_e.invalid(bs.invalid)}static fromISO(p,S={}){const[P,B]=Ay(p);return Po(P,B,S,"ISO 8601",p)}static fromRFC2822(p,S={}){const[P,B]=Fy(p);return Po(P,B,S,"RFC 2822",p)}static fromHTTP(p,S={}){const[P,B]=Ny(p);return Po(P,B,S,"HTTP",S)}static fromFormat(p,S,P={}){if(ke(p)||ke(S))throw new i("fromFormat requires an input string and a format");const{locale:B=null,numberingSystem:q=null}=P,ee=Ie.fromOpts({locale:B,numberingSystem:q,defaultToEN:!0}),[ne,ie,we,Ne]=lb(ee,p,S);return Ne?_e.invalid(Ne):Po(ne,ie,P,`format ${S}`,p,we)}static fromString(p,S,P={}){return _e.fromFormat(p,S,P)}static fromSQL(p,S={}){const[P,B]=Hy(p);return Po(P,B,S,"SQL",p)}static invalid(p,S=null){if(!p)throw new i("need to specify a reason the DateTime is invalid");const P=p instanceof Ut?p:new Ut(p,S);if(dt.throwOnInvalid)throw new t(P);return new _e({invalid:P})}static isDateTime(p){return p&&p.isLuxonDateTime||!1}static parseFormatForOpts(p,S={}){const P=ed(p,Ie.fromObject(S));return P?P.map(B=>B?B.val:null).join(""):null}static expandFormat(p,S={}){return Xu(Xt.parseFormat(p),Ie.fromObject(S)).map(B=>B.val).join("")}static resetCache(){ms=void 0,fl.clear()}get(p){return this[p]}get isValid(){return this.invalid===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}get outputCalendar(){return this.isValid?this.loc.outputCalendar:null}get zone(){return this._zone}get zoneName(){return this.isValid?this.zone.name:null}get year(){return this.isValid?this.c.year:NaN}get quarter(){return this.isValid?Math.ceil(this.c.month/3):NaN}get month(){return this.isValid?this.c.month:NaN}get day(){return this.isValid?this.c.day:NaN}get hour(){return this.isValid?this.c.hour:NaN}get minute(){return this.isValid?this.c.minute:NaN}get second(){return this.isValid?this.c.second:NaN}get millisecond(){return this.isValid?this.c.millisecond:NaN}get weekYear(){return this.isValid?ul(this).weekYear:NaN}get weekNumber(){return this.isValid?ul(this).weekNumber:NaN}get weekday(){return this.isValid?ul(this).weekday:NaN}get isWeekend(){return this.isValid&&this.loc.getWeekendDays().includes(this.weekday)}get localWeekday(){return this.isValid?dl(this).weekday:NaN}get localWeekNumber(){return this.isValid?dl(this).weekNumber:NaN}get localWeekYear(){return this.isValid?dl(this).weekYear:NaN}get ordinal(){return this.isValid?Lr(this.c).ordinal:NaN}get monthShort(){return this.isValid?fs.months("short",{locObj:this.loc})[this.month-1]:null}get monthLong(){return this.isValid?fs.months("long",{locObj:this.loc})[this.month-1]:null}get weekdayShort(){return this.isValid?fs.weekdays("short",{locObj:this.loc})[this.weekday-1]:null}get weekdayLong(){return this.isValid?fs.weekdays("long",{locObj:this.loc})[this.weekday-1]:null}get offset(){return this.isValid?+this.o:NaN}get offsetNameShort(){return this.isValid?this.zone.offsetName(this.ts,{format:"short",locale:this.locale}):null}get offsetNameLong(){return this.isValid?this.zone.offsetName(this.ts,{format:"long",locale:this.locale}):null}get isOffsetFixed(){return this.isValid?this.zone.isUniversal:null}get isInDST(){return this.isOffsetFixed?!1:this.offset>this.set({month:1,day:1}).offset||this.offset>this.set({month:5}).offset}getPossibleOffsets(){if(!this.isValid||this.isOffsetFixed)return[this];const p=864e5,S=6e4,P=Ei(this.c),B=this.zone.offset(P-p),q=this.zone.offset(P+p),ee=this.zone.offset(P-B*S),ne=this.zone.offset(P-q*S);if(ee===ne)return[this];const ie=P-ee*S,we=P-ne*S,Ne=Ai(ie,ee),Ue=Ai(we,ne);return Ne.hour===Ue.hour&&Ne.minute===Ue.minute&&Ne.second===Ue.second&&Ne.millisecond===Ue.millisecond?[_r(this,{ts:ie}),_r(this,{ts:we})]:[this]}get isInLeapYear(){return ls(this.year)}get daysInMonth(){return Pi(this.year,this.month)}get daysInYear(){return this.isValid?So(this.year):NaN}get weeksInWeekYear(){return this.isValid?cs(this.weekYear):NaN}get weeksInLocalWeekYear(){return this.isValid?cs(this.localWeekYear,this.loc.getMinDaysInFirstWeek(),this.loc.getStartOfWeek()):NaN}resolvedLocaleOptions(p={}){const{locale:S,numberingSystem:P,calendar:B}=Xt.create(this.loc.clone(p),p).resolvedOptions(this);return{locale:S,numberingSystem:P,outputCalendar:B}}toUTC(p=0,S={}){return this.setZone(it.instance(p),S)}toLocal(){return this.setZone(dt.defaultZone)}setZone(p,{keepLocalTime:S=!1,keepCalendarTime:P=!1}={}){if(p=je(p,dt.defaultZone),p.equals(this.zone))return this;if(p.isValid){let B=this.ts;if(S||P){const q=p.offset(this.ts),ee=this.toObject();[B]=Fi(ee,q,p)}return _r(this,{ts:B,zone:p})}else return _e.invalid(hs(p))}reconfigure({locale:p,numberingSystem:S,outputCalendar:P}={}){const B=this.loc.clone({locale:p,numberingSystem:S,outputCalendar:P});return _r(this,{loc:B})}setLocale(p){return this.reconfigure({locale:p})}set(p){if(!this.isValid)return this;const S=Ri(p,id),{minDaysInFirstWeek:P,startOfWeek:B}=Br(S,this.loc),q=!ke(S.weekYear)||!ke(S.weekNumber)||!ke(S.weekday),ee=!ke(S.ordinal),ne=!ke(S.year),ie=!ke(S.month)||!ke(S.day),we=ne||ie,Ne=S.weekYear||S.weekNumber;if((we||ee)&&Ne)throw new o("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(ie&&ee)throw new o("Can't mix ordinal dates with month/day");let Ue;q?Ue=Bn({...Ot(this.c,P,B),...S},P,B):ke(S.ordinal)?(Ue={...this.toObject(),...S},ke(S.day)&&(Ue.day=Math.min(Pi(Ue.year,Ue.month),Ue.day))):Ue=Ir({...Lr(this.c),...S});const[xt,Be]=Fi(Ue,this.o,this.zone);return _r(this,{ts:xt,o:Be})}plus(p){if(!this.isValid)return this;const S=ot.fromDurationLike(p);return _r(this,rd(this,S))}minus(p){if(!this.isValid)return this;const S=ot.fromDurationLike(p).negate();return _r(this,rd(this,S))}startOf(p,{useLocaleWeeks:S=!1}={}){if(!this.isValid)return this;const P={},B=ot.normalizeUnit(p);switch(B){case"years":P.month=1;case"quarters":case"months":P.day=1;case"weeks":case"days":P.hour=0;case"hours":P.minute=0;case"minutes":P.second=0;case"seconds":P.millisecond=0;break}if(B==="weeks")if(S){const q=this.loc.getStartOfWeek(),{weekday:ee}=this;ee<q&&(P.weekNumber=this.weekNumber-1),P.weekday=q}else P.weekday=1;if(B==="quarters"){const q=Math.ceil(this.month/3);P.month=(q-1)*3+1}return this.set(P)}endOf(p,S){return this.isValid?this.plus({[p]:1}).startOf(p,S).minus(1):this}toFormat(p,S={}){return this.isValid?Xt.create(this.loc.redefaultToEN(S)).formatDateTimeFromString(this,p):cl}toLocaleString(p=f,S={}){return this.isValid?Xt.create(this.loc.clone(S),p).formatDateTime(this):cl}toLocaleParts(p={}){return this.isValid?Xt.create(this.loc.clone(p),p).formatDateTimeParts(this):[]}toISO({format:p="extended",suppressSeconds:S=!1,suppressMilliseconds:P=!1,includeOffset:B=!0,extendedZone:q=!1,precision:ee="milliseconds"}={}){if(!this.isValid)return null;ee=Bi(ee);const ne=p==="extended";let ie=pl(this,ne,ee);return Li.indexOf(ee)>=3&&(ie+="T"),ie+=od(this,ne,S,P,B,q,ee),ie}toISODate({format:p="extended",precision:S="day"}={}){return this.isValid?pl(this,p==="extended",Bi(S)):null}toISOWeekDate(){return Ni(this,"kkkk-'W'WW-c")}toISOTime({suppressMilliseconds:p=!1,suppressSeconds:S=!1,includeOffset:P=!0,includePrefix:B=!1,extendedZone:q=!1,format:ee="extended",precision:ne="milliseconds"}={}){return this.isValid?(ne=Bi(ne),(B&&Li.indexOf(ne)>=3?"T":"")+od(this,ee==="extended",S,p,P,q,ne)):null}toRFC2822(){return Ni(this,"EEE, dd LLL yyyy HH:mm:ss ZZZ",!1)}toHTTP(){return Ni(this.toUTC(),"EEE, dd LLL yyyy HH:mm:ss 'GMT'")}toSQLDate(){return this.isValid?pl(this,!0):null}toSQLTime({includeOffset:p=!0,includeZone:S=!1,includeOffsetSpace:P=!0}={}){let B="HH:mm:ss.SSS";return(S||p)&&(P&&(B+=" "),S?B+="z":p&&(B+="ZZ")),Ni(this,B,!0)}toSQL(p={}){return this.isValid?`${this.toSQLDate()} ${this.toSQLTime(p)}`:null}toString(){return this.isValid?this.toISO():cl}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`DateTime { ts: ${this.toISO()}, zone: ${this.zone.name}, locale: ${this.locale} }`:`DateTime { Invalid, reason: ${this.invalidReason} }`}valueOf(){return this.toMillis()}toMillis(){return this.isValid?this.ts:NaN}toSeconds(){return this.isValid?this.ts/1e3:NaN}toUnixInteger(){return this.isValid?Math.floor(this.ts/1e3):NaN}toJSON(){return this.toISO()}toBSON(){return this.toJSDate()}toObject(p={}){if(!this.isValid)return{};const S={...this.c};return p.includeConfig&&(S.outputCalendar=this.outputCalendar,S.numberingSystem=this.loc.numberingSystem,S.locale=this.loc.locale),S}toJSDate(){return new Date(this.isValid?this.ts:NaN)}diff(p,S="milliseconds",P={}){if(!this.isValid||!p.isValid)return ot.invalid("created by diffing an invalid DateTime");const B={locale:this.locale,numberingSystem:this.numberingSystem,...P},q=Di(S).map(ot.normalizeUnit),ee=p.valueOf()>this.valueOf(),ne=ee?this:p,ie=ee?p:this,we=Zy(ne,ie,q,B);return ee?we.negate():we}diffNow(p="milliseconds",S={}){return this.diff(_e.now(),p,S)}until(p){return this.isValid?Rt.fromDateTimes(this,p):this}hasSame(p,S,P){if(!this.isValid)return!1;const B=p.valueOf(),q=this.setZone(p.zone,{keepLocalTime:!0});return q.startOf(S,P)<=B&&B<=q.endOf(S,P)}equals(p){return this.isValid&&p.isValid&&this.valueOf()===p.valueOf()&&this.zone.equals(p.zone)&&this.loc.equals(p.loc)}toRelative(p={}){if(!this.isValid)return null;const S=p.base||_e.fromObject({},{zone:this.zone}),P=p.padding?this<S?-p.padding:p.padding:0;let B=["years","months","days","hours","minutes","seconds"],q=p.unit;return Array.isArray(p.unit)&&(B=p.unit,q=void 0),ld(S,this.plus(P),{...p,numeric:"always",units:B,unit:q})}toRelativeCalendar(p={}){return this.isValid?ld(p.base||_e.fromObject({},{zone:this.zone}),this,{...p,numeric:"auto",units:["years","months","days"],calendary:!0}):null}static min(...p){if(!p.every(_e.isDateTime))throw new i("min requires all arguments be DateTimes");return nt(p,S=>S.valueOf(),Math.min)}static max(...p){if(!p.every(_e.isDateTime))throw new i("max requires all arguments be DateTimes");return nt(p,S=>S.valueOf(),Math.max)}static fromFormatExplain(p,S,P={}){const{locale:B=null,numberingSystem:q=null}=P,ee=Ie.fromOpts({locale:B,numberingSystem:q,defaultToEN:!0});return Ju(ee,p,S)}static fromStringExplain(p,S,P={}){return _e.fromFormatExplain(p,S,P)}static buildFormatParser(p,S={}){const{locale:P=null,numberingSystem:B=null}=S,q=Ie.fromOpts({locale:P,numberingSystem:B,defaultToEN:!0});return new Qu(q,p)}static fromFormatParser(p,S,P={}){if(ke(p)||ke(S))throw new i("fromFormatParser requires an input string and a format parser");const{locale:B=null,numberingSystem:q=null}=P,ee=Ie.fromOpts({locale:B,numberingSystem:q,defaultToEN:!0});if(!ee.equals(S.locale))throw new i(`fromFormatParser called with a locale of ${ee}, but the format parser was created for ${S.locale}`);const{result:ne,zone:ie,specificOffset:we,invalidReason:Ne}=S.explainFromTokens(p);return Ne?_e.invalid(Ne):Po(ne,ie,P,`format ${S.format}`,p,we)}static get DATE_SHORT(){return f}static get DATE_MED(){return m}static get DATE_MED_WITH_WEEKDAY(){return h}static get DATE_FULL(){return g}static get DATE_HUGE(){return y}static get TIME_SIMPLE(){return b}static get TIME_WITH_SECONDS(){return x}static get TIME_WITH_SHORT_OFFSET(){return C}static get TIME_WITH_LONG_OFFSET(){return T}static get TIME_24_SIMPLE(){return w}static get TIME_24_WITH_SECONDS(){return M}static get TIME_24_WITH_SHORT_OFFSET(){return E}static get TIME_24_WITH_LONG_OFFSET(){return j}static get DATETIME_SHORT(){return F}static get DATETIME_SHORT_WITH_SECONDS(){return O}static get DATETIME_MED(){return V}static get DATETIME_MED_WITH_SECONDS(){return L}static get DATETIME_MED_WITH_WEEKDAY(){return v}static get DATETIME_FULL(){return N}static get DATETIME_FULL_WITH_SECONDS(){return A}static get DATETIME_HUGE(){return $}static get DATETIME_HUGE_WITH_SECONDS(){return R}}function gs(k){if(_e.isDateTime(k))return k;if(k&&k.valueOf&&bt(k.valueOf()))return _e.fromJSDate(k);if(k&&typeof k=="object")return _e.fromObject(k);throw new i(`Unknown datetime argument: ${k}, of type ${typeof k}`)}const hb="3.7.2";return rn.DateTime=_e,rn.Duration=ot,rn.FixedOffsetZone=it,rn.IANAZone=K,rn.Info=fs,rn.Interval=Rt,rn.InvalidZone=jt,rn.Settings=dt,rn.SystemZone=W,rn.VERSION=hb,rn.Zone=_,rn}var af;function pu(){return af||(af=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.CronDate=e.DAYS_IN_MONTH=e.DateMathOp=e.TimeUnit=void 0;const t=$E();var n;(function(s){s.Second="Second",s.Minute="Minute",s.Hour="Hour",s.Day="Day",s.Month="Month",s.Year="Year"})(n||(e.TimeUnit=n={}));var r;(function(s){s.Add="Add",s.Subtract="Subtract"})(r||(e.DateMathOp=r={})),e.DAYS_IN_MONTH=Object.freeze([31,29,31,30,31,30,31,31,30,31,30,31]);class o{#e;#n=null;#s=null;constructor(i,l){const c={zone:l};if(i?i instanceof o?(this.#e=i.#e,this.#n=i.#n,this.#s=i.#s):i instanceof Date?this.#e=t.DateTime.fromJSDate(i,c):typeof i=="number"?this.#e=t.DateTime.fromMillis(i,c):(this.#e=t.DateTime.fromISO(i,c),this.#e.isValid||(this.#e=t.DateTime.fromRFC2822(i,c)),this.#e.isValid||(this.#e=t.DateTime.fromSQL(i,c)),this.#e.isValid||(this.#e=t.DateTime.fromFormat(i,"EEE, d MMM yyyy HH:mm:ss",c))):this.#e=t.DateTime.local(),!this.#e.isValid)throw new Error(`CronDate: unhandled timestamp: ${i}`);l&&l!==this.#e.zoneName&&(this.#e=this.#e.setZone(l))}static#o(i){return i%4===0&&i%100!==0||i%400===0}get dstStart(){return this.#n}set dstStart(i){this.#n=i}get dstEnd(){return this.#s}set dstEnd(i){this.#s=i}addYear(){this.#e=this.#e.plus({years:1})}addMonth(){this.#e=this.#e.plus({months:1}).startOf("month")}addDay(){this.#e=this.#e.plus({days:1}).startOf("day")}addHour(){this.#e=this.#e.plus({hours:1}).startOf("hour")}addMinute(){this.#e=this.#e.plus({minutes:1}).startOf("minute")}addSecond(){this.#e=this.#e.plus({seconds:1})}subtractYear(){this.#e=this.#e.minus({years:1})}subtractMonth(){this.#e=this.#e.minus({months:1}).endOf("month").startOf("second")}subtractDay(){this.#e=this.#e.minus({days:1}).endOf("day").startOf("second")}subtractHour(){this.#e=this.#e.minus({hours:1}).endOf("hour").startOf("second")}subtractMinute(){this.#e=this.#e.minus({minutes:1}).endOf("minute").startOf("second")}subtractSecond(){this.#e=this.#e.minus({seconds:1})}addUnit(i){switch(i){case n.Year:return this.addYear();case n.Month:return this.addMonth();case n.Day:return this.addDay();case n.Hour:return this.addHour();case n.Minute:return this.addMinute();case n.Second:return this.addSecond()}}subtractUnit(i){switch(i){case n.Year:return this.subtractYear();case n.Month:return this.subtractMonth();case n.Day:return this.subtractDay();case n.Hour:return this.subtractHour();case n.Minute:return this.subtractMinute();case n.Second:return this.subtractSecond()}}invokeDateOperation(i,l){if(i===r.Add){this.addUnit(l);return}if(i===r.Subtract){this.subtractUnit(l);return}throw new Error(`Invalid verb: ${i}`)}getDate(){return this.#e.day}getFullYear(){return this.#e.year}getDay(){const i=this.#e.weekday;return i===7?0:i}getMonth(){return this.#e.month-1}getHours(){return this.#e.hour}getMinutes(){return this.#e.minute}getSeconds(){return this.#e.second}getMilliseconds(){return this.#e.millisecond}getUTCOffset(){return this.#e.offset}setStartOfDay(){this.#e=this.#e.startOf("day")}setEndOfDay(){this.#e=this.#e.endOf("day")}getTime(){return this.#e.valueOf()}getUTCDate(){return this.#r().day}getUTCFullYear(){return this.#r().year}getUTCDay(){const i=this.#r().weekday;return i===7?0:i}getUTCMonth(){return this.#r().month-1}getUTCHours(){return this.#r().hour}getUTCMinutes(){return this.#r().minute}getUTCSeconds(){return this.#r().second}toISOString(){return this.#e.toUTC().toISO()}toJSON(){return this.#e.toJSON()}setDate(i){this.#e=this.#e.set({day:i})}setFullYear(i){this.#e=this.#e.set({year:i})}setDay(i){this.#e=this.#e.set({weekday:i})}setMonth(i){this.#e=this.#e.set({month:i+1})}setHours(i){this.#e=this.#e.set({hour:i})}setMinutes(i){this.#e=this.#e.set({minute:i})}setSeconds(i){this.#e=this.#e.set({second:i})}setMilliseconds(i){this.#e=this.#e.set({millisecond:i})}toString(){return this.toDate().toString()}toDate(){return this.#e.toJSDate()}isLastDayOfMonth(){const{day:i,month:l}=this.#e;if(l===2){const c=o.#o(this.#e.year);return i===e.DAYS_IN_MONTH[l-1]-(c?0:1)}return i===e.DAYS_IN_MONTH[l-1]}isLastWeekdayOfMonth(){const{day:i,month:l}=this.#e;let c;return l===2?c=e.DAYS_IN_MONTH[l-1]-(o.#o(this.#e.year)?0:1):c=e.DAYS_IN_MONTH[l-1],i>c-7}applyDateOperation(i,l,c){if(l===n.Month||l===n.Day){this.invokeDateOperation(i,l);return}const u=this.getHours();this.invokeDateOperation(i,l);const d=this.getHours(),f=d-u;f===2?c!==24&&(this.dstStart=u+1):f===0&&this.getMinutes()===0&&this.getSeconds()===0&&c!==24&&(this.dstEnd=d)}#r(){return this.#e.toUTC()}}e.CronDate=o,e.default=o})(El)),El}var lf;function AE(){if(lf)return Ls;lf=1,Object.defineProperty(Ls,"__esModule",{value:!0}),Ls.CronMonth=void 0;const e=pu(),t=ho(),n=1,r=12,o=Object.freeze([]);let s=class extends t.CronField{static get min(){return n}static get max(){return r}static get chars(){return o}static get daysInMonth(){return e.DAYS_IN_MONTH}constructor(l,c){super(l,c),this.validate()}get values(){return super.values}};return Ls.CronMonth=s,Ls}var Bs={},cf;function FE(){if(cf)return Bs;cf=1,Object.defineProperty(Bs,"__esModule",{value:!0}),Bs.CronSecond=void 0;const e=ho(),t=0,n=59,r=Object.freeze([]);let o=class extends e.CronField{static get min(){return t}static get max(){return n}static get chars(){return r}constructor(i,l){super(i,l),this.validate()}get values(){return super.values}};return Bs.CronSecond=o,Bs}var uf;function fu(){return uf||(uf=1,(function(e){var t=Gr&&Gr.__createBinding||(Object.create?(function(r,o,s,i){i===void 0&&(i=s);var l=Object.getOwnPropertyDescriptor(o,s);(!l||("get"in l?!o.__esModule:l.writable||l.configurable))&&(l={enumerable:!0,get:function(){return o[s]}}),Object.defineProperty(r,i,l)}):(function(r,o,s,i){i===void 0&&(i=s),r[i]=o[s]})),n=Gr&&Gr.__exportStar||function(r,o){for(var s in r)s!=="default"&&!Object.prototype.hasOwnProperty.call(o,s)&&t(o,r,s)};Object.defineProperty(e,"__esModule",{value:!0}),n(PE(),e),n(EE(),e),n(OE(),e),n(ho(),e),n(RE(),e),n(jE(),e),n(AE(),e),n(FE(),e)})(Gr)),Gr}var df;function ng(){if(df)return Rs;df=1,Object.defineProperty(Rs,"__esModule",{value:!0}),Rs.CronFieldCollection=void 0;const e=fu();let t=class qs{#e;#n;#s;#o;#r;#t;static from(r,o){return new qs({second:this.resolveField(e.CronSecond,r.second,o.second),minute:this.resolveField(e.CronMinute,r.minute,o.minute),hour:this.resolveField(e.CronHour,r.hour,o.hour),dayOfMonth:this.resolveField(e.CronDayOfMonth,r.dayOfMonth,o.dayOfMonth),month:this.resolveField(e.CronMonth,r.month,o.month),dayOfWeek:this.resolveField(e.CronDayOfWeek,r.dayOfWeek,o.dayOfWeek)})}static resolveField(r,o,s){return s?s instanceof e.CronField?s:new r(s):o}constructor({second:r,minute:o,hour:s,dayOfMonth:i,month:l,dayOfWeek:c}){if(!r)throw new Error("Validation error, Field second is missing");if(!o)throw new Error("Validation error, Field minute is missing");if(!s)throw new Error("Validation error, Field hour is missing");if(!i)throw new Error("Validation error, Field dayOfMonth is missing");if(!l)throw new Error("Validation error, Field month is missing");if(!c)throw new Error("Validation error, Field dayOfWeek is missing");if(l.values.length===1&&!i.hasLastChar&&c.isWildcard&&!(parseInt(i.values[0],10)<=e.CronMonth.daysInMonth[l.values[0]-1]))throw new Error("Invalid explicit day of month definition");this.#e=r,this.#n=o,this.#s=s,this.#r=l,this.#t=c,this.#o=i}get second(){return this.#e}get minute(){return this.#n}get hour(){return this.#s}get dayOfMonth(){return this.#o}get month(){return this.#r}get dayOfWeek(){return this.#t}static compactField(r){if(r.length===0)return[];const o=[];let s;return r.forEach((i,l,c)=>{if(s===void 0){s={start:i,count:1};return}const u=c[l-1]||s.start,d=c[l+1];if(i==="L"||i==="W"){o.push(s),o.push({start:i,count:1}),s=void 0;return}if(s.step===void 0&&d!==void 0){const f=i-u,m=d-i;if(f<=m){s={...s,count:2,end:i,step:f};return}s.step=1}i-(s.end??0)===s.step?(s.count++,s.end=i):(s.count===1?o.push({start:s.start,count:1}):s.count===2?(o.push({start:s.start,count:1}),o.push({start:s.end??u,count:1})):o.push(s),s={start:i,count:1})}),s&&o.push(s),o}static#c(r,o,s){const i=o.step;return i?i===1&&o.start===r.min&&o.end&&o.end>=s?r.hasQuestionMarkChar?"?":"*":i!==1&&o.start===r.min&&o.end&&o.end>=s-i+1?`*/${i}`:null:null}static#l(r,o){const s=r.step;if(s===1)return`${r.start}-${r.end}`;const i=r.start===0?r.count-1:r.count;if(!s)throw new Error("Unexpected range step");if(!r.end)throw new Error("Unexpected range end");if(s*i>r.end){const l=(u,d)=>{if(typeof r.start!="number")throw new Error("Unexpected range start");return d%s===0?r.start+d:null};if(typeof r.start!="number")throw new Error("Unexpected range start");const c={length:r.end-r.start+1};return Array.from(c,l).filter(u=>u!==null).join(",")}return r.end===o-s+1?`${r.start}/${s}`:`${r.start}-${r.end}/${s}`}stringifyField(r){let o=r.max,s=r.values;if(r instanceof e.CronDayOfWeek){o=6;const l=this.#t.values;s=l[l.length-1]===7?l.slice(0,-1):l}r instanceof e.CronDayOfMonth&&(o=this.#r.values.length===1?e.CronMonth.daysInMonth[this.#r.values[0]-1]:r.max);const i=qs.compactField(s);if(i.length===1){const l=qs.#c(r,i[0],o);if(l)return l}return i.map(l=>{const c=l.count===1?l.start.toString():qs.#l(l,o);return r instanceof e.CronDayOfWeek&&r.nthDay>0?`${c}#${r.nthDay}`:c}).join(",")}stringify(r=!1){const o=[];return r&&o.push(this.stringifyField(this.#e)),o.push(this.stringifyField(this.#n),this.stringifyField(this.#s),this.stringifyField(this.#o),this.stringifyField(this.#r),this.stringifyField(this.#t)),o.join(" ")}serialize(){return{second:this.#e.serialize(),minute:this.#n.serialize(),hour:this.#s.serialize(),dayOfMonth:this.#o.serialize(),month:this.#r.serialize(),dayOfWeek:this.#t.serialize()}}};return Rs.CronFieldCollection=t,Rs}var Ol={},pf;function rg(){return pf||(pf=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.CronExpression=e.LOOPS_LIMIT_EXCEEDED_ERROR_MESSAGE=e.TIME_SPAN_OUT_OF_BOUNDS_ERROR_MESSAGE=void 0;const t=pu();e.TIME_SPAN_OUT_OF_BOUNDS_ERROR_MESSAGE="Out of the time span range",e.LOOPS_LIMIT_EXCEEDED_ERROR_MESSAGE="Invalid expression, loop limit exceeded";const n=1e4;class r{#e;#n;#s;#o;#r;#t;#c=null;#l=!1;constructor(s,i){this.#e=i,this.#n=i.tz,this.#o=i.startDate?new t.CronDate(i.startDate,this.#n):null,this.#r=i.endDate?new t.CronDate(i.endDate,this.#n):null;let l=i.currentDate??i.startDate;if(l){const c=new t.CronDate(l,this.#n);this.#o&&c.getTime()<this.#o.getTime()?l=this.#o:this.#r&&c.getTime()>this.#r.getTime()&&(l=this.#r)}this.#s=new t.CronDate(l,this.#n),this.#t=s}get fields(){return this.#t}static fieldsToExpression(s,i){return new r(s,i||{})}static#i(s,i){return i.some(l=>l===s)}#a(s,i){return s[i?s.length-1:0]}#d(s){const i=`${s.getFullYear()}-${s.getMonth()+1}-${s.getDate()}`;if(this.#c===i)return this.#l;const l=new t.CronDate(s);l.setStartOfDay();const c=new t.CronDate(s);return c.setEndOfDay(),this.#c=i,this.#l=l.getUTCOffset()!==c.getUTCOffset(),this.#l}#p(s,i,l){const c=this.#t.second.values,u=s.getSeconds(),d=this.#t.second.findNearestValue(u,l);if(d!==null){s.setSeconds(d);return}s.applyDateOperation(i,t.TimeUnit.Minute,this.#t.hour.values.length),s.setSeconds(this.#a(c,l))}#h(s,i,l){const c=this.#t.minute.values,u=this.#t.second.values,d=s.getMinutes(),f=this.#t.minute.findNearestValue(d,l);if(f!==null){s.setMinutes(f),s.setSeconds(this.#a(u,l));return}s.applyDateOperation(i,t.TimeUnit.Hour,this.#t.hour.values.length),s.setMinutes(this.#a(c,l)),s.setSeconds(this.#a(u,l))}static#m(s,i){const l=i.isLastWeekdayOfMonth();return s.some(c=>{const u=parseInt(c.toString().charAt(0),10)%7;if(Number.isNaN(u))throw new Error(`Invalid last weekday of the month expression: ${c}`);return i.getDay()===u&&l})}next(){return this.#u()}prev(){return this.#u(!0)}hasNext(){const s=this.#s;try{return this.#u(),!0}catch{return!1}finally{this.#s=s}}hasPrev(){const s=this.#s;try{return this.#u(!0),!0}catch{return!1}finally{this.#s=s}}take(s){const i=[];if(s>=0)for(let l=0;l<s;l++)try{i.push(this.next())}catch{return i}else for(let l=0;l>s;l--)try{i.push(this.prev())}catch{return i}return i}reset(s){this.#s=new t.CronDate(s||this.#e.currentDate,this.#n)}stringify(s=!1){return this.#t.stringify(s)}includesDate(s){const{second:i,minute:l,hour:c,month:u}=this.#t,d=new t.CronDate(s,this.#n);return!(!i.values.includes(d.getSeconds())||!l.values.includes(d.getMinutes())||!c.values.includes(d.getHours())||!u.values.includes(d.getMonth()+1)||!this.#f(d)||this.#t.dayOfWeek.nthDay>0&&Math.ceil(d.getDate()/7)!==this.#t.dayOfWeek.nthDay)}toString(){return this.#e.expression||this.stringify(!0)}#f(s){const i=this.#t.dayOfMonth.isWildcard,l=!i,c=this.#t.dayOfWeek.isWildcard,u=!c,d=r.#i(s.getDate(),this.#t.dayOfMonth.values)||this.#t.dayOfMonth.hasLastChar&&s.isLastDayOfMonth(),f=r.#i(s.getDay(),this.#t.dayOfWeek.values)||this.#t.dayOfWeek.hasLastChar&&r.#m(this.#t.dayOfWeek.values,s);return!!(l&&u&&(d||f)||d&&!u||i&&!c&&f)}#g(s,i,l){const c=this.#t.hour.values,u=c,d=s.getHours(),f=r.#i(d,c),m=s.dstEnd===d;if(s.dstStart!==null&&s.dstStart===d-1&&r.#i(s.dstStart,c))return!0;if(m&&!l)return s.dstEnd=null,s.applyDateOperation(t.DateMathOp.Add,t.TimeUnit.Hour,u.length),!1;if(f)return!0;s.dstStart=null;const h=this.#t.hour.findNearestValue(d,l);if(h===null)return s.applyDateOperation(i,t.TimeUnit.Day,u.length),!1;if(this.#d(s)){const g=l?d-h:h-d;for(let y=0;y<g&&(s.applyDateOperation(i,t.TimeUnit.Hour,u.length),!(!l&&s.getHours()>=h||l&&s.getHours()<=h));y++);}else s.setHours(h);return s.setMinutes(this.#a(this.#t.minute.values,l)),s.setSeconds(this.#a(this.#t.second.values,l)),!1}#y(s){if(!this.#o&&!this.#r)return;const i=s.getTime();if(this.#o&&i<this.#o.getTime())throw new Error(e.TIME_SPAN_OUT_OF_BOUNDS_ERROR_MESSAGE);if(this.#r&&i>this.#r.getTime())throw new Error(e.TIME_SPAN_OUT_OF_BOUNDS_ERROR_MESSAGE)}#u(s=!1){const i=s?t.DateMathOp.Subtract:t.DateMathOp.Add,l=new t.CronDate(this.#s),c=l.getTime();let u=0;for(;++u<n;){if(this.#y(l),!this.#f(l)){l.applyDateOperation(i,t.TimeUnit.Day,this.#t.hour.values.length);continue}if(!(this.#t.dayOfWeek.nthDay<=0||Math.ceil(l.getDate()/7)===this.#t.dayOfWeek.nthDay)){l.applyDateOperation(i,t.TimeUnit.Day,this.#t.hour.values.length);continue}if(!r.#i(l.getMonth()+1,this.#t.month.values)){l.applyDateOperation(i,t.TimeUnit.Month,this.#t.hour.values.length);continue}if(this.#g(l,i,s)){if(!r.#i(l.getMinutes(),this.#t.minute.values)){this.#h(l,i,s);continue}if(!r.#i(l.getSeconds(),this.#t.second.values)){this.#p(l,i,s);continue}if(c===l.getTime()){(i==="Add"||l.getMilliseconds()===0)&&l.applyDateOperation(i,t.TimeUnit.Second,this.#t.hour.values.length);continue}break}}if(u>n)throw new Error(e.LOOPS_LIMIT_EXCEEDED_ERROR_MESSAGE);return l.getMilliseconds()!==0&&l.setMilliseconds(0),this.#s=l,l}[Symbol.iterator](){return{next:()=>{try{return{value:this.#u(),done:!1}}catch{return{value:void 0,done:!0}}}}}}e.CronExpression=r,e.default=r})(Ol)),Ol}var Ki={},ff;function NE(){if(ff)return Ki;ff=1,Object.defineProperty(Ki,"__esModule",{value:!0}),Ki.seededRandom=n;function e(r){let o=2166136261;for(let s=0;s<r.length;s++)o^=r.charCodeAt(s),o=Math.imul(o,16777619);return()=>o>>>0}function t(r){return()=>{let o=r+=1831565813;return o=Math.imul(o^o>>>15,o|1),o^=o+Math.imul(o^o>>>7,o|61),((o^o>>>14)>>>0)/4294967296}}function n(r){const o=r?e(r)():Math.floor(Math.random()*1e10);return t(o)}return Ki}var hf;function cc(){if(hf)return un;hf=1,Object.defineProperty(un,"__esModule",{value:!0}),un.CronExpressionParser=un.DayOfWeek=un.Months=un.CronUnit=un.PredefinedExpressions=void 0;const e=ng(),t=rg(),n=NE(),r=fu();var o;(function(u){u["@yearly"]="0 0 0 1 1 *",u["@annually"]="0 0 0 1 1 *",u["@monthly"]="0 0 0 1 * *",u["@weekly"]="0 0 0 * * 0",u["@daily"]="0 0 0 * * *",u["@hourly"]="0 0 * * * *",u["@minutely"]="0 * * * * *",u["@secondly"]="* * * * * *",u["@weekdays"]="0 0 0 * * 1-5",u["@weekends"]="0 0 0 * * 0,6"})(o||(un.PredefinedExpressions=o={}));var s;(function(u){u.Second="Second",u.Minute="Minute",u.Hour="Hour",u.DayOfMonth="DayOfMonth",u.Month="Month",u.DayOfWeek="DayOfWeek"})(s||(un.CronUnit=s={}));var i;(function(u){u[u.jan=1]="jan",u[u.feb=2]="feb",u[u.mar=3]="mar",u[u.apr=4]="apr",u[u.may=5]="may",u[u.jun=6]="jun",u[u.jul=7]="jul",u[u.aug=8]="aug",u[u.sep=9]="sep",u[u.oct=10]="oct",u[u.nov=11]="nov",u[u.dec=12]="dec"})(i||(un.Months=i={}));var l;(function(u){u[u.sun=0]="sun",u[u.mon=1]="mon",u[u.tue=2]="tue",u[u.wed=3]="wed",u[u.thu=4]="thu",u[u.fri=5]="fri",u[u.sat=6]="sat"})(l||(un.DayOfWeek=l={}));let c=class dn{static parse(d,f={}){const{strict:m=!1,hashSeed:h}=f,g=(0,n.seededRandom)(h);d=o[d]||d;const y=dn.#e(d,m);if(!(y.dayOfMonth==="*"||y.dayOfWeek==="*"||!m))throw new Error("Cannot use both dayOfMonth and dayOfWeek together in strict mode!");const b=dn.#n(s.Second,y.second,r.CronSecond.constraints,g),x=dn.#n(s.Minute,y.minute,r.CronMinute.constraints,g),C=dn.#n(s.Hour,y.hour,r.CronHour.constraints,g),T=dn.#n(s.Month,y.month,r.CronMonth.constraints,g),w=dn.#n(s.DayOfMonth,y.dayOfMonth,r.CronDayOfMonth.constraints,g),{dayOfWeek:M,nthDayOfWeek:E}=dn.#d(y.dayOfWeek),j=dn.#n(s.DayOfWeek,M,r.CronDayOfWeek.constraints,g),F=new e.CronFieldCollection({second:new r.CronSecond(b,{rawValue:y.second}),minute:new r.CronMinute(x,{rawValue:y.minute}),hour:new r.CronHour(C,{rawValue:y.hour}),dayOfMonth:new r.CronDayOfMonth(w,{rawValue:y.dayOfMonth}),month:new r.CronMonth(T,{rawValue:y.month}),dayOfWeek:new r.CronDayOfWeek(j,{rawValue:y.dayOfWeek,nthDayOfWeek:E})});return new t.CronExpression(F,{...f,expression:d})}static#e(d,f){if(f&&!d.length)throw new Error("Invalid cron expression");d=d||"0 * * * * *";const m=d.trim().split(/\s+/);if(f&&m.length<6)throw new Error("Invalid cron expression, expected 6 fields");if(m.length>6)throw new Error("Invalid cron expression, too many fields");const h=["*","*","*","*","*","0"];m.length<h.length&&m.unshift(...h.slice(m.length));const[g,y,b,x,C,T]=m;return{second:g,minute:y,hour:b,dayOfMonth:x,month:C,dayOfWeek:T}}static#n(d,f,m,h){if((d===s.Month||d===s.DayOfWeek)&&(f=f.replace(/[a-z]{3}/gi,g=>{g=g.toLowerCase();const y=i[g]||l[g];if(y===void 0)throw new Error(`Validation error, cannot resolve alias "${g}"`);return y.toString()})),!m.validChars.test(f))throw new Error(`Invalid characters, got value: ${f}`);return f=this.#s(f,m),f=this.#o(f,m,h),this.#r(d,f,m)}static#s(d,f){return d.replace(/[*?]/g,f.min+"-"+f.max)}static#o(d,f,m){const h=m();return d.replace(/H(?:\((\d+)-(\d+)\))?(?:\/(\d+))?/g,(g,y,b,x)=>{if(y&&b&&x){const C=parseInt(y,10),T=parseInt(b,10),w=parseInt(x,10);if(C>T)throw new Error(`Invalid range: ${C}-${T}, min > max`);if(w<=0)throw new Error(`Invalid step: ${w}, must be positive`);const M=Math.max(C,f.min),E=Math.floor(h*w),j=[];for(let F=Math.floor(M/w)*w+E;F<=T;F+=w)F>=M&&j.push(F);return j.join(",")}else if(y&&b){const C=parseInt(y,10),T=parseInt(b,10);if(C>T)throw new Error(`Invalid range: ${C}-${T}, min > max`);return String(Math.floor(h*(T-C+1))+C)}else if(x){const C=parseInt(x,10);if(C<=0)throw new Error(`Invalid step: ${C}, must be positive`);const T=Math.floor(h*C),w=[];for(let M=Math.floor(f.min/C)*C+T;M<=f.max;M+=C)M>=f.min&&w.push(M);return w.join(",")}else return String(Math.floor(h*(f.max-f.min+1)+f.min))})}static#r(d,f,m){const h=[];function g(b,x){if(Array.isArray(b))h.push(...b);else if(dn.#p(x,b))h.push(b);else{const C=parseInt(b.toString(),10);if(!(C>=x.min&&C<=x.max))throw new Error(`Constraint error, got value ${b} expected range ${x.min}-${x.max}`);h.push(d===s.DayOfWeek?C%7:b)}}return f.split(",").forEach(b=>{if(!(b.length>0))throw new Error("Invalid list value format");g(dn.#t(d,b,m),m)}),h}static#t(d,f,m){const h=f.split("/");if(h.length>2)throw new Error(`Invalid repeat: ${f}`);return h.length===2?(h[0].includes("-")||(h[0]=`${h[0]}-${m.max}`),dn.#a(d,h[0],parseInt(h[1],10),m)):dn.#a(d,f,1,m)}static#c(d,f,m){if(!(!isNaN(d)&&!isNaN(f)&&d>=m.min&&f<=m.max))throw new Error(`Constraint error, got range ${d}-${f} expected range ${m.min}-${m.max}`);if(d>f)throw new Error(`Invalid range: ${d}-${f}, min(${d}) > max(${f})`)}static#l(d){if(!(!isNaN(d)&&d>0))throw new Error(`Constraint error, cannot repeat at every ${d} time.`)}static#i(d,f,m,h){const g=[];d===s.DayOfWeek&&m%7===0&&g.push(0);for(let y=f;y<=m;y+=h)g.indexOf(y)===-1&&g.push(y);return g}static#a(d,f,m,h){const g=f.split("-");if(g.length<=1)return isNaN(+f)?f:+f;const[y,b]=g.map(x=>parseInt(x,10));return this.#c(y,b,h),this.#l(m),this.#i(d,y,b,m)}static#d(d){const f=d.split("#");if(f.length<=1)return{dayOfWeek:f[0]};const m=+f[f.length-1],h=d.match(/([,-/])/);if(h!==null)throw new Error(`Constraint error, invalid dayOfWeek \`#\` and \`${h?.[0]}\` special characters are incompatible`);if(!(f.length<=2&&!isNaN(m)&&m>=1&&m<=5))throw new Error("Constraint error, invalid dayOfWeek occurrence number (#)");return{dayOfWeek:f[0],nthDayOfWeek:m}}static#p(d,f){return d.chars.some(m=>f.toString().includes(m))}};return un.CronExpressionParser=c,un}var Wn={};const LE={},BE=Object.freeze(Object.defineProperty({__proto__:null,default:LE},Symbol.toStringTag,{value:"Module"})),mf=Eb(BE);var gf;function VE(){if(gf)return Wn;gf=1;var e=Wn&&Wn.__createBinding||(Object.create?(function(s,i,l,c){c===void 0&&(c=l);var u=Object.getOwnPropertyDescriptor(i,l);(!u||("get"in u?!i.__esModule:u.writable||u.configurable))&&(u={enumerable:!0,get:function(){return i[l]}}),Object.defineProperty(s,c,u)}):(function(s,i,l,c){c===void 0&&(c=l),s[c]=i[l]})),t=Wn&&Wn.__setModuleDefault||(Object.create?(function(s,i){Object.defineProperty(s,"default",{enumerable:!0,value:i})}):function(s,i){s.default=i}),n=Wn&&Wn.__importStar||(function(){var s=function(i){return s=Object.getOwnPropertyNames||function(l){var c=[];for(var u in l)Object.prototype.hasOwnProperty.call(l,u)&&(c[c.length]=u);return c},s(i)};return function(i){if(i&&i.__esModule)return i;var l={};if(i!=null)for(var c=s(i),u=0;u<c.length;u++)c[u]!=="default"&&e(l,i,c[u]);return t(l,i),l}})();Object.defineProperty(Wn,"__esModule",{value:!0}),Wn.CronFileParser=void 0;const r=cc();let o=class ca{static async parseFile(i){const{readFile:l}=await Promise.resolve().then(()=>n(mf)),c=await l(i,"utf8");return ca.#e(c)}static parseFileSync(i){const{readFileSync:l}=mf,c=l(i,"utf8");return ca.#e(c)}static#e(i){const l=i.split(`
135
+ `),c={variables:{},expressions:[],errors:{}};for(const u of l){const d=u.trim();if(d.length===0||d.startsWith("#"))continue;const f=d.match(/^(.*)=(.*)$/);if(f){const[,m,h]=f;c.variables[m]=h.replace(/["']/g,"");continue}try{const m=ca.#n(d);c.expressions.push(m.interval)}catch(m){c.errors[d]=m}}return c}static#n(i){const l=i.split(" ");return{interval:r.CronExpressionParser.parse(l.slice(0,5).join(" ")),command:l.slice(5,l.length)}}};return Wn.CronFileParser=o,Wn}var yf;function zE(){return yf||(yf=1,(function(e){var t=Kr&&Kr.__createBinding||(Object.create?(function(u,d,f,m){m===void 0&&(m=f);var h=Object.getOwnPropertyDescriptor(d,f);(!h||("get"in h?!d.__esModule:h.writable||h.configurable))&&(h={enumerable:!0,get:function(){return d[f]}}),Object.defineProperty(u,m,h)}):(function(u,d,f,m){m===void 0&&(m=f),u[m]=d[f]})),n=Kr&&Kr.__exportStar||function(u,d){for(var f in u)f!=="default"&&!Object.prototype.hasOwnProperty.call(d,f)&&t(d,u,f)};Object.defineProperty(e,"__esModule",{value:!0}),e.CronFileParser=e.CronExpressionParser=e.CronExpression=e.CronFieldCollection=e.CronDate=void 0;const r=cc();var o=pu();Object.defineProperty(e,"CronDate",{enumerable:!0,get:function(){return o.CronDate}});var s=ng();Object.defineProperty(e,"CronFieldCollection",{enumerable:!0,get:function(){return s.CronFieldCollection}});var i=rg();Object.defineProperty(e,"CronExpression",{enumerable:!0,get:function(){return i.CronExpression}});var l=cc();Object.defineProperty(e,"CronExpressionParser",{enumerable:!0,get:function(){return l.CronExpressionParser}});var c=VE();Object.defineProperty(e,"CronFileParser",{enumerable:!0,get:function(){return c.CronFileParser}}),n(fu(),e),e.default=r.CronExpressionParser})(Kr)),Kr}var _E=zE(),Rl={exports:{}},bf;function WE(){return bf||(bf=1,(function(e,t){(function(r,o){e.exports=o()})(globalThis,()=>(()=>{var n={949:((i,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.CronParser=void 0;var u=c(515),d=(function(){function f(m,h,g){h===void 0&&(h=!0),g===void 0&&(g=!1),this.expression=m,this.dayOfWeekStartIndexZero=h,this.monthStartIndexZero=g}return f.prototype.parse=function(){var m,h,g=(m=this.expression)!==null&&m!==void 0?m:"";if(g==="@reboot")return h=["@reboot","","","","","",""],h;if(g.startsWith("@")){var y=this.parseSpecial(this.expression);h=this.extractParts(y)}else h=this.extractParts(this.expression);return this.normalize(h),this.validate(h),h},f.prototype.parseSpecial=function(m){var h={"@yearly":"0 0 1 1 *","@annually":"0 0 1 1 *","@monthly":"0 0 1 * *","@weekly":"0 0 * * 0","@daily":"0 0 * * *","@midnight":"0 0 * * *","@hourly":"0 * * * *","@reboot":"@reboot"},g=h[m];if(!g)throw new Error("Unknown special expression.");return g},f.prototype.extractParts=function(m){if(!this.expression)throw new Error("cron expression is empty");for(var h=m.trim().split(/[ ]+/),g=0;g<h.length;g++)if(h[g].includes(",")){var y=h[g].split(",").map(function(x){return x.trim()}).filter(function(x){return x!==""}).map(function(x){return isNaN(Number(x))?x:Number(x)}).filter(function(x){return x!==null&&x!==""});y.length===0&&y.push("*"),y.sort(function(x,C){return x!==null&&C!==null?x-C:0}),h[g]=y.map(function(x){return x!==null?x.toString():""}).join(",")}if(h.length<5)throw new Error("Expression has only ".concat(h.length," part").concat(h.length==1?"":"s",". At least 5 parts are required."));if(h.length==5)h.unshift(""),h.push("");else if(h.length==6){var b=/\d{4}$/.test(h[5])||h[4]=="?"||h[2]=="?";b?h.unshift(""):h.push("")}else if(h.length>7)throw new Error("Expression has ".concat(h.length," parts; too many!"));return h},f.prototype.normalize=function(m){var h=this;if(m[3]=m[3].replace("?","*"),m[5]=m[5].replace("?","*"),m[2]=m[2].replace("?","*"),m[0].indexOf("0/")==0&&(m[0]=m[0].replace("0/","*/")),m[1].indexOf("0/")==0&&(m[1]=m[1].replace("0/","*/")),m[2].indexOf("0/")==0&&(m[2]=m[2].replace("0/","*/")),m[3].indexOf("1/")==0&&(m[3]=m[3].replace("1/","*/")),m[4].indexOf("1/")==0&&(m[4]=m[4].replace("1/","*/")),m[6].indexOf("1/")==0&&(m[6]=m[6].replace("1/","*/")),m[5]=m[5].replace(/(^\d)|([^#/\s]\d)/g,function(M){var E=M.replace(/\D/,""),j=E;return h.dayOfWeekStartIndexZero?E=="7"&&(j="0"):j=(parseInt(E)-1).toString(),M.replace(E,j)}),m[5]=="L"&&(m[5]="6"),m[3]=="?"&&(m[3]="*"),m[3].indexOf("W")>-1&&(m[3].indexOf(",")>-1||m[3].indexOf("-")>-1))throw new Error("The 'W' character can be specified only when the day-of-month is a single day, not a range or list of days.");var g={SUN:0,MON:1,TUE:2,WED:3,THU:4,FRI:5,SAT:6};for(var y in g)m[5]=m[5].replace(new RegExp(y,"gi"),g[y].toString());m[4]=m[4].replace(/(^\d{1,2})|([^#/\s]\d{1,2})/g,function(M){var E=M.replace(/\D/,""),j=E;return h.monthStartIndexZero&&(j=(parseInt(E)+1).toString()),M.replace(E,j)});var b={JAN:1,FEB:2,MAR:3,APR:4,MAY:5,JUN:6,JUL:7,AUG:8,SEP:9,OCT:10,NOV:11,DEC:12};for(var x in b)m[4]=m[4].replace(new RegExp(x,"gi"),b[x].toString());m[0]=="0"&&(m[0]=""),!/\*|\-|\,|\//.test(m[2])&&(/\*|\//.test(m[1])||/\*|\//.test(m[0]))&&(m[2]+="-".concat(m[2]));for(var C=0;C<m.length;C++)if(m[C].indexOf(",")!=-1&&(m[C]=m[C].split(",").filter(function(M){return M!==""}).join(",")||"*"),m[C]=="*/1"&&(m[C]="*"),m[C].indexOf("/")>-1&&!/^\*|\-|\,/.test(m[C])){var T=null;switch(C){case 4:T="12";break;case 5:T="6";break;case 6:T="9999";break;default:T=null;break}if(T!==null){var w=m[C].split("/");m[C]="".concat(w[0],"-").concat(T,"/").concat(w[1])}}},f.prototype.validate=function(m){var h="0-9,\\-*/";this.validateOnlyExpectedCharactersFound(m[0],h),this.validateOnlyExpectedCharactersFound(m[1],h),this.validateOnlyExpectedCharactersFound(m[2],h),this.validateOnlyExpectedCharactersFound(m[3],"0-9,\\-*/LW"),this.validateOnlyExpectedCharactersFound(m[4],h),this.validateOnlyExpectedCharactersFound(m[5],"0-9,\\-*/L#"),this.validateOnlyExpectedCharactersFound(m[6],h),this.validateAnyRanges(m)},f.prototype.validateAnyRanges=function(m){u.default.secondRange(m[0]),u.default.minuteRange(m[1]),u.default.hourRange(m[2]),u.default.dayOfMonthRange(m[3]),u.default.monthRange(m[4],this.monthStartIndexZero),u.default.dayOfWeekRange(m[5],this.dayOfWeekStartIndexZero)},f.prototype.validateOnlyExpectedCharactersFound=function(m,h){var g=m.match(new RegExp("[^".concat(h,"]+"),"gi"));if(g&&g.length)throw new Error("Expression contains invalid values: '".concat(g.toString(),"'"))},f})();l.CronParser=d}),333:((i,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.ExpressionDescriptor=void 0;var u=c(823),d=c(949),f=(function(){function m(h,g){if(this.expression=h,this.options=g,this.expressionParts=new Array(5),!this.options.locale&&m.defaultLocale&&(this.options.locale=m.defaultLocale),!m.locales[this.options.locale]){var y=Object.keys(m.locales)[0];console.warn("Locale '".concat(this.options.locale,"' could not be found; falling back to '").concat(y,"'.")),this.options.locale=y}this.i18n=m.locales[this.options.locale],g.use24HourTimeFormat===void 0&&(g.use24HourTimeFormat=this.i18n.use24HourTimeFormatByDefault())}return m.toString=function(h,g){var y=g===void 0?{}:g,b=y.throwExceptionOnParseError,x=b===void 0?!0:b,C=y.verbose,T=C===void 0?!1:C,w=y.dayOfWeekStartIndexZero,M=w===void 0?!0:w,E=y.monthStartIndexZero,j=E===void 0?!1:E,F=y.use24HourTimeFormat,O=y.locale,V=O===void 0?null:O,L={throwExceptionOnParseError:x,verbose:T,dayOfWeekStartIndexZero:M,monthStartIndexZero:j,use24HourTimeFormat:F,locale:V};L.tzOffset&&console.warn("'tzOffset' option has been deprecated and is no longer supported.");var v=new m(h,L);return v.getFullDescription()},m.initialize=function(h,g){g===void 0&&(g="en"),m.specialCharacters=["/","-",",","*"],m.defaultLocale=g,h.load(m.locales)},m.prototype.getFullDescription=function(){var h,g,y="";try{var b=new d.CronParser(this.expression,this.options.dayOfWeekStartIndexZero,this.options.monthStartIndexZero);if(this.expressionParts=b.parse(),this.expressionParts[0]==="@reboot")return((g=(h=this.i18n).atReboot)===null||g===void 0?void 0:g.call(h))||"Run once, at startup";var x=this.getTimeOfDayDescription(),C=this.getDayOfMonthDescription(),T=this.getMonthDescription(),w=this.getDayOfWeekDescription(),M=this.getYearDescription();y+=x+C+w+T+M,y=this.transformVerbosity(y,!!this.options.verbose),y=y.charAt(0).toLocaleUpperCase()+y.substr(1)}catch(E){if(!this.options.throwExceptionOnParseError)y=this.i18n.anErrorOccuredWhenGeneratingTheExpressionD();else throw"".concat(E)}return y},m.prototype.getTimeOfDayDescription=function(){var h=this.expressionParts[0],g=this.expressionParts[1],y=this.expressionParts[2],b="";if(!u.StringUtilities.containsAny(g,m.specialCharacters)&&!u.StringUtilities.containsAny(y,m.specialCharacters)&&!u.StringUtilities.containsAny(h,m.specialCharacters))b+=this.i18n.atSpace()+this.formatTime(y,g,h);else if(!h&&g.indexOf("-")>-1&&!(g.indexOf(",")>-1)&&!(g.indexOf("/")>-1)&&!u.StringUtilities.containsAny(y,m.specialCharacters)){var x=g.split("-");b+=u.StringUtilities.format(this.i18n.everyMinuteBetweenX0AndX1(),this.formatTime(y,x[0],""),this.formatTime(y,x[1],""))}else if(!h&&y.indexOf(",")>-1&&y.indexOf("-")==-1&&y.indexOf("/")==-1&&!u.StringUtilities.containsAny(g,m.specialCharacters)){var C=y.split(",");b+=this.i18n.at();for(var T=0;T<C.length;T++)b+=" ",b+=this.formatTime(C[T],g,""),T<C.length-2&&(b+=","),T==C.length-2&&(b+=this.i18n.spaceAnd())}else{var w=this.getSecondsDescription(),M=this.getMinutesDescription(),E=this.getHoursDescription();if(b+=w,b&&M&&(b+=", "),b+=M,M===E)return b;b&&E&&(b+=", "),b+=E}return b},m.prototype.getSecondsDescription=function(){var h=this,g=this.getSegmentDescription(this.expressionParts[0],this.i18n.everySecond(),function(y){return y},function(y){return u.StringUtilities.format(h.i18n.everyX0Seconds(y),y)},function(y){return h.i18n.secondsX0ThroughX1PastTheMinute()},function(y){return y=="0"?"":parseInt(y)<20?h.i18n.atX0SecondsPastTheMinute(y):h.i18n.atX0SecondsPastTheMinuteGt20()||h.i18n.atX0SecondsPastTheMinute(y)});return g},m.prototype.getMinutesDescription=function(){var h=this,g=this.expressionParts[0],y=this.expressionParts[2],b=this.getSegmentDescription(this.expressionParts[1],this.i18n.everyMinute(),function(x){return x},function(x){return u.StringUtilities.format(h.i18n.everyX0Minutes(x),x)},function(x){return h.i18n.minutesX0ThroughX1PastTheHour()},function(x){try{return x=="0"&&y.indexOf("/")==-1&&g==""?h.i18n.everyHour():parseInt(x)<20?h.i18n.atX0MinutesPastTheHour(x):h.i18n.atX0MinutesPastTheHourGt20()||h.i18n.atX0MinutesPastTheHour(x)}catch{return h.i18n.atX0MinutesPastTheHour(x)}});return b},m.prototype.getHoursDescription=function(){var h=this,g=this.expressionParts[2],y=0,b=[];g.split("/")[0].split(",").forEach(function(T){var w=T.split("-");w.length===2&&b.push({value:w[1],index:y+1}),y+=w.length});var x=0,C=this.getSegmentDescription(g,this.i18n.everyHour(),function(T){var w=b.find(function(E){return E.value===T&&E.index===x}),M=w&&h.expressionParts[1]!=="0";return x++,M?h.formatTime(T,"59",""):h.formatTime(T,"0","")},function(T){return u.StringUtilities.format(h.i18n.everyX0Hours(T),T)},function(T){return h.i18n.betweenX0AndX1()},function(T){return h.i18n.atX0()});return C},m.prototype.getDayOfWeekDescription=function(){var h=this,g=this.i18n.daysOfTheWeek(),y=null;return this.expressionParts[5]=="*"?y="":y=this.getSegmentDescription(this.expressionParts[5],this.i18n.commaEveryDay(),function(b,x){var C=b;b.indexOf("#")>-1?C=b.substring(0,b.indexOf("#")):b.indexOf("L")>-1&&(C=C.replace("L",""));var T=parseInt(C),w=h.i18n.daysOfTheWeekInCase?h.i18n.daysOfTheWeekInCase(x)[T]:g[T];if(b.indexOf("#")>-1){var M=null,E=b.substring(b.indexOf("#")+1),j=b.substring(0,b.indexOf("#"));switch(E){case"1":M=h.i18n.first(j);break;case"2":M=h.i18n.second(j);break;case"3":M=h.i18n.third(j);break;case"4":M=h.i18n.fourth(j);break;case"5":M=h.i18n.fifth(j);break}w=M+" "+w}return w},function(b){return parseInt(b)==1?"":u.StringUtilities.format(h.i18n.commaEveryX0DaysOfTheWeek(b),b)},function(b){var x=b.substring(0,b.indexOf("-")),C=h.expressionParts[3]!="*";return C?h.i18n.commaAndX0ThroughX1(x):h.i18n.commaX0ThroughX1(x)},function(b){var x=null;if(b.indexOf("#")>-1){var C=b.substring(b.indexOf("#")+1),T=b.substring(0,b.indexOf("#"));x=h.i18n.commaOnThe(C,T).trim()+h.i18n.spaceX0OfTheMonth()}else if(b.indexOf("L")>-1)x=h.i18n.commaOnTheLastX0OfTheMonth(b.replace("L",""));else{var w=h.expressionParts[3]!="*";x=w?h.i18n.commaAndOnX0():h.i18n.commaOnlyOnX0(b)}return x}),y},m.prototype.getMonthDescription=function(){var h=this,g=this.i18n.monthsOfTheYear(),y=this.getSegmentDescription(this.expressionParts[4],"",function(b,x){return x&&h.i18n.monthsOfTheYearInCase?h.i18n.monthsOfTheYearInCase(x)[parseInt(b)-1]:g[parseInt(b)-1]},function(b){return parseInt(b)==1?"":u.StringUtilities.format(h.i18n.commaEveryX0Months(b),b)},function(b){return h.i18n.commaMonthX0ThroughMonthX1()||h.i18n.commaX0ThroughX1()},function(b){return h.i18n.commaOnlyInMonthX0?h.i18n.commaOnlyInMonthX0():h.i18n.commaOnlyInX0()});return y},m.prototype.getDayOfMonthDescription=function(){var h=this,g=null,y=this.expressionParts[3];switch(y){case"L":g=this.i18n.commaOnTheLastDayOfTheMonth();break;case"WL":case"LW":g=this.i18n.commaOnTheLastWeekdayOfTheMonth();break;default:var b=y.match(/(\d{1,2}W)|(W\d{1,2})/);if(b){var x=parseInt(b[0].replace("W","")),C=x==1?this.i18n.firstWeekday():u.StringUtilities.format(this.i18n.weekdayNearestDayX0(),x.toString());g=u.StringUtilities.format(this.i18n.commaOnTheX0OfTheMonth(),C);break}else{var T=y.match(/L-(\d{1,2})/);if(T){var w=T[1];g=u.StringUtilities.format(this.i18n.commaDaysBeforeTheLastDayOfTheMonth(w),w);break}else{if(y=="*"&&this.expressionParts[5]!="*")return"";g=this.getSegmentDescription(y,this.i18n.commaEveryDay(),function(M){return M=="L"?h.i18n.lastDay():h.i18n.dayX0?u.StringUtilities.format(h.i18n.dayX0(),M):M},function(M){return M=="1"?h.i18n.commaEveryDay():h.i18n.commaEveryX0Days(M)},function(M){return h.i18n.commaBetweenDayX0AndX1OfTheMonth(M)},function(M){return h.i18n.commaOnDayX0OfTheMonth(M)})}break}}return g},m.prototype.getYearDescription=function(){var h=this,g=this.getSegmentDescription(this.expressionParts[6],"",function(y){return/^\d+$/.test(y)?new Date(parseInt(y),1).getFullYear().toString():y},function(y){return u.StringUtilities.format(h.i18n.commaEveryX0Years(y),y)},function(y){return h.i18n.commaYearX0ThroughYearX1()||h.i18n.commaX0ThroughX1()},function(y){return h.i18n.commaOnlyInYearX0?h.i18n.commaOnlyInYearX0():h.i18n.commaOnlyInX0()});return g},m.prototype.getSegmentDescription=function(h,g,y,b,x,C){var T=null,w=h.indexOf("/")>-1,M=h.indexOf("-")>-1,E=h.indexOf(",")>-1;if(!h)T="";else if(h==="*")T=g;else if(!w&&!M&&!E)T=u.StringUtilities.format(C(h),y(h));else if(E){for(var j=h.split(","),F="",O=0;O<j.length;O++)if(O>0&&j.length>2&&(F+=",",O<j.length-1&&(F+=" ")),O>0&&j.length>1&&(O==j.length-1||j.length==2)&&(F+="".concat(this.i18n.spaceAnd()," ")),j[O].indexOf("/")>-1||j[O].indexOf("-")>-1){var V=j[O].indexOf("-")>-1&&j[O].indexOf("/")==-1,L=this.getSegmentDescription(j[O],g,y,b,V?this.i18n.commaX0ThroughX1:x,C);V&&(L=L.replace(", ","")),F+=L}else w?F+=this.getSegmentDescription(j[O],g,y,b,x,C):F+=y(j[O]);w?T=F:T=u.StringUtilities.format(C(h),F)}else if(w){var j=h.split("/");if(T=u.StringUtilities.format(b(j[1]),j[1]),j[0].indexOf("-")>-1){var v=this.generateRangeSegmentDescription(j[0],x,y);v.indexOf(", ")!=0&&(T+=", "),T+=v}else if(j[0].indexOf("*")==-1){var N=u.StringUtilities.format(C(j[0]),y(j[0]));N=N.replace(", ",""),T+=u.StringUtilities.format(this.i18n.commaStartingX0(),N)}}else M&&(T=this.generateRangeSegmentDescription(h,x,y));return T},m.prototype.generateRangeSegmentDescription=function(h,g,y){var b="",x=h.split("-"),C=y(x[0],1),T=y(x[1],2),w=g(h);return b+=u.StringUtilities.format(w,C,T),b},m.prototype.formatTime=function(h,g,y){var b=0,x=0,C=parseInt(h)+b,T=parseInt(g)+x;T>=60?(T-=60,C+=1):T<0&&(T+=60,C-=1),C>=24?C=C-24:C<0&&(C=24+C);var w="",M=!1;this.options.use24HourTimeFormat||(M=!!(this.i18n.setPeriodBeforeTime&&this.i18n.setPeriodBeforeTime()),w=M?"".concat(this.getPeriod(C)," "):" ".concat(this.getPeriod(C)),C>12&&(C-=12),C===0&&(C=12));var E="";return y&&(E=":".concat(("00"+y).substring(y.length))),"".concat(M?w:"").concat(("00"+C.toString()).substring(C.toString().length),":").concat(("00"+T.toString()).substring(T.toString().length)).concat(E).concat(M?"":w)},m.prototype.transformVerbosity=function(h,g){if(!g&&(h=h.replace(new RegExp(", ".concat(this.i18n.everyMinute()),"g"),""),h=h.replace(new RegExp(", ".concat(this.i18n.everyHour()),"g"),""),h=h.replace(new RegExp(this.i18n.commaEveryDay(),"g"),""),h=h.replace(/\, ?$/,""),this.i18n.conciseVerbosityReplacements))for(var y=0,b=Object.entries(this.i18n.conciseVerbosityReplacements());y<b.length;y++){var x=b[y],C=x[0],T=x[1];h=h.replace(new RegExp(C,"g"),T)}return h},m.prototype.getPeriod=function(h){return h>=12?this.i18n.pm&&this.i18n.pm()||"PM":this.i18n.am&&this.i18n.am()||"AM"},m.locales={},m})();l.ExpressionDescriptor=f}),747:((i,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.enLocaleLoader=void 0;var u=c(486),d=(function(){function f(){}return f.prototype.load=function(m){m.en=new u.en},f})();l.enLocaleLoader=d}),486:((i,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.en=void 0;var c=(function(){function u(){}return u.prototype.atX0SecondsPastTheMinuteGt20=function(){return null},u.prototype.atX0MinutesPastTheHourGt20=function(){return null},u.prototype.commaMonthX0ThroughMonthX1=function(){return null},u.prototype.commaYearX0ThroughYearX1=function(){return null},u.prototype.use24HourTimeFormatByDefault=function(){return!1},u.prototype.anErrorOccuredWhenGeneratingTheExpressionD=function(){return"An error occurred when generating the expression description. Check the cron expression syntax."},u.prototype.everyMinute=function(){return"every minute"},u.prototype.everyHour=function(){return"every hour"},u.prototype.atSpace=function(){return"At "},u.prototype.everyMinuteBetweenX0AndX1=function(){return"Every minute between %s and %s"},u.prototype.at=function(){return"At"},u.prototype.spaceAnd=function(){return" and"},u.prototype.everySecond=function(){return"every second"},u.prototype.everyX0Seconds=function(){return"every %s seconds"},u.prototype.secondsX0ThroughX1PastTheMinute=function(){return"seconds %s through %s past the minute"},u.prototype.atX0SecondsPastTheMinute=function(){return"at %s seconds past the minute"},u.prototype.everyX0Minutes=function(){return"every %s minutes"},u.prototype.minutesX0ThroughX1PastTheHour=function(){return"minutes %s through %s past the hour"},u.prototype.atX0MinutesPastTheHour=function(){return"at %s minutes past the hour"},u.prototype.everyX0Hours=function(){return"every %s hours"},u.prototype.betweenX0AndX1=function(){return"between %s and %s"},u.prototype.atX0=function(){return"at %s"},u.prototype.commaEveryDay=function(){return", every day"},u.prototype.commaEveryX0DaysOfTheWeek=function(){return", every %s days of the week"},u.prototype.commaX0ThroughX1=function(){return", %s through %s"},u.prototype.commaAndX0ThroughX1=function(){return", %s through %s"},u.prototype.first=function(){return"first"},u.prototype.second=function(){return"second"},u.prototype.third=function(){return"third"},u.prototype.fourth=function(){return"fourth"},u.prototype.fifth=function(){return"fifth"},u.prototype.commaOnThe=function(){return", on the "},u.prototype.spaceX0OfTheMonth=function(){return" %s of the month"},u.prototype.lastDay=function(){return"the last day"},u.prototype.commaOnTheLastX0OfTheMonth=function(){return", on the last %s of the month"},u.prototype.commaOnlyOnX0=function(){return", only on %s"},u.prototype.commaAndOnX0=function(){return", and on %s"},u.prototype.commaEveryX0Months=function(){return", every %s months"},u.prototype.commaOnlyInX0=function(){return", only in %s"},u.prototype.commaOnTheLastDayOfTheMonth=function(){return", on the last day of the month"},u.prototype.commaOnTheLastWeekdayOfTheMonth=function(){return", on the last weekday of the month"},u.prototype.commaDaysBeforeTheLastDayOfTheMonth=function(){return", %s days before the last day of the month"},u.prototype.firstWeekday=function(){return"first weekday"},u.prototype.weekdayNearestDayX0=function(){return"weekday nearest day %s"},u.prototype.commaOnTheX0OfTheMonth=function(){return", on the %s of the month"},u.prototype.commaEveryX0Days=function(){return", every %s days"},u.prototype.commaBetweenDayX0AndX1OfTheMonth=function(){return", between day %s and %s of the month"},u.prototype.commaOnDayX0OfTheMonth=function(){return", on day %s of the month"},u.prototype.commaEveryHour=function(){return", every hour"},u.prototype.commaEveryX0Years=function(){return", every %s years"},u.prototype.commaStartingX0=function(){return", starting %s"},u.prototype.daysOfTheWeek=function(){return["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},u.prototype.monthsOfTheYear=function(){return["January","February","March","April","May","June","July","August","September","October","November","December"]},u.prototype.atReboot=function(){return"Run once, at startup"},u})();l.en=c}),515:((i,l)=>{Object.defineProperty(l,"__esModule",{value:!0});function c(d,f){if(!d)throw new Error(f)}var u=(function(){function d(){}return d.secondRange=function(f){for(var m=f.split(","),h=0;h<m.length;h++)if(!isNaN(parseInt(m[h],10))){var g=parseInt(m[h],10);c(g>=0&&g<=59,"seconds part must be >= 0 and <= 59")}},d.minuteRange=function(f){for(var m=f.split(","),h=0;h<m.length;h++)if(!isNaN(parseInt(m[h],10))){var g=parseInt(m[h],10);c(g>=0&&g<=59,"minutes part must be >= 0 and <= 59")}},d.hourRange=function(f){for(var m=f.split(","),h=0;h<m.length;h++)if(!isNaN(parseInt(m[h],10))){var g=parseInt(m[h],10);c(g>=0&&g<=23,"hours part must be >= 0 and <= 23")}},d.dayOfMonthRange=function(f){for(var m=f.split(","),h=0;h<m.length;h++)if(!isNaN(parseInt(m[h],10))){var g=parseInt(m[h],10);c(g>=1&&g<=31,"DOM part must be >= 1 and <= 31")}},d.monthRange=function(f,m){for(var h=f.split(","),g=0;g<h.length;g++)if(!isNaN(parseInt(h[g],10))){var y=parseInt(h[g],10);c(y>=1&&y<=12,m?"month part must be >= 0 and <= 11":"month part must be >= 1 and <= 12")}},d.dayOfWeekRange=function(f,m){for(var h=f.split(","),g=0;g<h.length;g++)if(!isNaN(parseInt(h[g],10))){var y=parseInt(h[g],10);c(y>=0&&y<=6,m?"DOW part must be >= 0 and <= 6":"DOW part must be >= 1 and <= 7")}},d})();l.default=u}),823:((i,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.StringUtilities=void 0;var c=(function(){function u(){}return u.format=function(d){for(var f=[],m=1;m<arguments.length;m++)f[m-1]=arguments[m];return d.replace(/%s/g,function(h){return f.shift()})},u.containsAny=function(d,f){return f.some(function(m){return d.indexOf(m)>-1})},u})();l.StringUtilities=c})},r={};function o(i){var l=r[i];if(l!==void 0)return l.exports;var c=r[i]={exports:{}};return n[i](c,c.exports,o),c.exports}var s={};return(()=>{var i=s;Object.defineProperty(i,"__esModule",{value:!0}),i.toString=void 0;var l=o(333),c=o(747);l.ExpressionDescriptor.initialize(new c.enLocaleLoader),i.default=l.ExpressionDescriptor;var u=l.ExpressionDescriptor.toString;i.toString=u})(),s})())})(Rl)),Rl.exports}var HE=WE();const UE=Sr(HE),qE=new Set(["JAN","FEB","MAR","APR","MAY","JUN","JUL","AUG","SEP","OCT","NOV","DEC","SUN","MON","TUE","WED","THU","FRI","SAT"]);function YE(e){for(const t of e.trim().split(/\s+/)){if(/[#?]/.test(t))return!1;for(const n of t.split(/[,\-/]/))if(!(n===""||n==="*")&&/[A-Za-z]/.test(n)&&!qE.has(n.toUpperCase()))return!1}return!0}function og(e){const t=(e??"").trim();if(t.split(/\s+/).filter(Boolean).length!==5)return{valid:!1,description:"",nextRun:null,error:"Expected a 5-field UNIX cron: minute hour day-of-month month day-of-week."};if(!YE(t))return{valid:!1,description:"",nextRun:null,error:"Unsupported cron syntax: L, W, #, and ? extensions are not allowed (plain 5-field UNIX cron only)."};try{const n=UE.toString(t,{use24HourTimeFormat:!0,verbose:!1}),r=_E.CronExpressionParser.parse(t,{tz:"UTC"}).next().toDate();return{valid:!0,description:n,nextRun:r}}catch(n){return{valid:!1,description:"",nextRun:null,error:n instanceof Error?n.message:"Invalid cron expression."}}}function sg(e){return e?e.toLocaleString(void 0,{year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit",timeZone:"UTC",hour12:!1})+" UTC":"—"}const xf="0 6 * * *";function KE({currentSchedule:e,isSubmitting:t,disabled:n,disabledReason:r,onSubmit:o}){const[s,i]=Y.useState(!1),[l,c]=Y.useState(e??xf),u=()=>{c(e??xf),i(!0)},d=()=>i(!1),f=og(l),m=async g=>{try{await o(g),i(!1)}catch{}},h=a.jsx("span",{children:a.jsx(I.Button,{variant:"outlined",size:"small",startIcon:a.jsx(Ma,{}),onClick:u,disabled:n,"aria-label":e?"Edit schedule":"Set schedule",children:e?"Edit schedule":"Set schedule"})});return a.jsxs(a.Fragment,{children:[n&&r?a.jsx(I.Tooltip,{title:r,children:h}):h,a.jsxs(I.Dialog,{open:s,onClose:d,maxWidth:"xs",fullWidth:!0,"aria-labelledby":"set-schedule-title",children:[a.jsx(I.DialogTitle,{id:"set-schedule-title",children:e?"Edit schedule":"Set schedule"}),a.jsxs(I.DialogContent,{children:[a.jsx(I.DialogContentText,{sx:{mb:2},children:"The publisher rebuilds the materializations in this package on this cadence. Enter a 5-field UNIX cron, evaluated in UTC. In a hosted deployment, the change takes effect on your next publish."}),a.jsx(I.TextField,{autoFocus:!0,fullWidth:!0,label:"Cron expression",value:l,onChange:g=>c(g.target.value),error:l.trim()!==""&&!f.valid,slotProps:{htmlInput:{style:{fontFamily:xe.MONO_FONT_FAMILY}}}}),a.jsx(I.Box,{sx:{mt:1.5,minHeight:48},children:f.valid?a.jsxs(a.Fragment,{children:[a.jsx(I.Typography,{variant:"body2",children:f.description}),a.jsxs(I.Typography,{variant:"body2",color:"text.secondary",children:["Next run: ",sg(f.nextRun)]})]}):a.jsx(I.Typography,{variant:"body2",color:"error",children:f.error})}),a.jsxs(I.Alert,{severity:"info",sx:{mt:2},children:["A schedule runs only on version-scoped packages, so saving one sets ",a.jsx("code",{children:"scope: version"})," for this package."]})]}),a.jsxs(I.DialogActions,{sx:{justifyContent:"space-between",px:3},children:[a.jsx(I.Box,{children:e&&a.jsx(I.Button,{color:"error",loading:t,onClick:()=>m(null),children:"Clear schedule"})}),a.jsxs(I.Box,{children:[a.jsx(I.Button,{onClick:d,children:"Cancel"}),a.jsx(I.Button,{variant:"contained",loading:t,disabled:!f.valid,onClick:()=>m(l.trim()),sx:{ml:1},children:"Save"})]})]})]})]})}function GE({schedule:e,scope:t,manifestLocation:n,hasFreshness:r,mutable:o,isSubmitting:s,isScopeMutating:i,onSubmit:l,onScopeChange:c}){const u=!!n,d=e?og(e):null,f=!!e;return a.jsx(I.Card,{variant:"outlined",sx:{borderRadius:2,mb:6},children:a.jsx(I.CardContent,{children:a.jsxs(I.Stack,{direction:"row",justifyContent:"space-between",alignItems:"flex-start",spacing:2,children:[a.jsxs(I.Box,{sx:{minWidth:0},children:[a.jsxs(I.Stack,{direction:"row",alignItems:"center",spacing:1,sx:{mb:1},children:[a.jsx(Ma,{fontSize:"small",color:"action"}),a.jsx(I.Typography,{variant:"h6",sx:{fontWeight:600,letterSpacing:"-0.025em"},children:"Schedule"})]}),u?a.jsxs(I.Box,{children:[a.jsx(I.Chip,{size:"small",color:"default",variant:"outlined",label:"Control-plane managed",sx:{mb:1}}),a.jsx(I.Typography,{variant:"body2",color:"text.secondary",children:"Refresh is driven by the control plane; the built-in scheduler does not fire this package."})]}):d?a.jsxs(I.Box,{children:[a.jsxs(I.Stack,{direction:"row",alignItems:"center",spacing:1,sx:{mb:.5,flexWrap:"wrap"},children:[a.jsx(I.Chip,{size:"small",color:"success",variant:"outlined",icon:a.jsx(Ma,{fontSize:"small"}),label:"Active"}),a.jsx(I.Box,{component:"code",sx:{fontFamily:xe.MONO_FONT_FAMILY,fontSize:"0.8125rem",px:.75,py:.25,borderRadius:1,bgcolor:"action.hover"},children:e})]}),a.jsx(I.Typography,{variant:"body2",children:d.valid?d.description:"Unrecognized cron expression."}),d.valid&&a.jsxs(I.Typography,{variant:"body2",color:"text.secondary",children:["Next run: ",sg(d.nextRun)]})]}):r?a.jsx(I.Typography,{variant:"body2",color:"text.secondary",children:"This package uses a freshness policy; a cron schedule is not applicable."}):a.jsx(I.Typography,{variant:"body2",color:"text.secondary",children:"On-demand only — no schedule set."}),!u&&a.jsxs(I.Box,{sx:{mt:2},children:[a.jsx(I.Typography,{variant:"caption",color:"text.secondary",sx:{display:"block",mb:.5},children:"Scope"}),a.jsx(I.Tooltip,{title:f?"A schedule requires version scope. Clear the schedule to change it.":"",children:a.jsx("span",{children:a.jsxs(I.ToggleButtonGroup,{size:"small",exclusive:!0,value:t,disabled:!o||!c||f||!!i,onChange:(m,h)=>{h&&h!==t&&c?.(h)},children:[a.jsx(I.ToggleButton,{value:"package",children:"package"}),a.jsx(I.ToggleButton,{value:"version",children:"version"})]})})}),a.jsx(I.Typography,{variant:"caption",color:"text.secondary",sx:{display:"block",mt:.5},children:t==="version"?"Materialized artifacts are per version (required for a schedule).":"Materialized artifacts are shared across versions."})]}),a.jsxs(I.Typography,{variant:"caption",color:"text.secondary",sx:{display:"block",mt:1.5},children:["Declared in ",a.jsx("code",{children:"publisher.json"}),".",!u&&a.jsxs(a.Fragment,{children:[" ","In a hosted deployment, a change takes effect on your next publish."]})]})]}),o&&!u&&a.jsx(KE,{currentSchedule:e,isSubmitting:s,disabled:r,disabledReason:"This package declares a freshness policy; a schedule and freshness are mutually exclusive.",onSubmit:l})]})})})}const ZE=3e3;function XE({resourceUri:e,onClickPackageFile:t}){const{apiClients:n,mutable:r}=xe.useServer(),o=Rn.useQueryClient(),{environmentName:s,packageName:i}=St(e),[l,c]=Y.useState(""),[u,d]=Y.useState(null),f=t??(O=>{window.location.href=O});if(!i)throw new Error("Materializations requires a package in the resource URI");const m=vt({queryKey:["materializations",s,i],queryFn:()=>n.materializations.listMaterializations(s,i),refetchInterval:O=>(O.state.data?.data??[]).some(v=>di(v.status))?ZE:!1}),h=vt({queryKey:["package",s,i],queryFn:()=>n.packages.getPackage(s,i)}),g=()=>o.invalidateQueries({queryKey:["materializations",s,i]}),y=qt({mutationFn:O=>n.materializations.createMaterialization(s,i,{forceRefresh:O.forceRefresh}),onSuccess(){c("Materialization requested"),g()},onError(O){c(O.message),g()}}),b=qt({mutationFn:O=>n.materializations.materializationAction(s,i,O.id,xe.MaterializationActionActionEnum.Stop),onSuccess(){c("Materialization stopped"),g()},onError(O){c(O.message)}}),x=qt({mutationFn:({materialization:O,dropTables:V})=>n.materializations.deleteMaterialization(s,i,O.id,V),onSuccess(){c("Materialization deleted"),g()},onError(O){c(O.message)}}),C=h.data?.data,T=qt({mutationFn:O=>n.packages.updatePackage(s,i,{name:i,description:C?.description,...O?{scope:xe.PackageScopeEnum.Version}:{},materialization:{schedule:O}}),onSuccess(O,V){c(V?"Schedule updated":"Schedule cleared"),o.invalidateQueries({queryKey:["package",s,i]})},onError(O){c(O.message)}}),w=qt({mutationFn:O=>n.packages.updatePackage(s,i,{name:i,description:C?.description,scope:O}),onSuccess(){c("Scope updated"),o.invalidateQueries({queryKey:["package",s,i]})},onError(O){c(O.message)}}),M=m.data?.data??[],E=M.find(O=>O.id===u)??null,j=M.some(O=>di(O.status)),F=y.isPending||b.isPending||x.isPending;return a.jsxs(I.Container,{maxWidth:!1,sx:{maxWidth:1024,mx:"auto",px:3,py:6},children:[a.jsxs(I.Box,{sx:{mb:4},children:[a.jsxs(I.Link,{onClick:O=>f(`/${s}/${i}`,O),underline:"none",sx:{display:"inline-flex",alignItems:"center",gap:.5,cursor:"pointer",color:"text.secondary",fontSize:"0.875rem",mb:2,"&:hover":{color:"primary.main"}},children:[a.jsx(Ym,{sx:{fontSize:18}}),"Back to ",i]}),a.jsxs(I.Stack,{direction:"row",alignItems:"flex-start",justifyContent:"space-between",children:[a.jsxs(I.Box,{children:[a.jsx(I.Typography,{variant:"h4",component:"h1",sx:{fontWeight:600,letterSpacing:"-0.025em",mb:.5},children:"Materializations"}),a.jsxs(I.Typography,{variant:"body2",color:"text.secondary",children:["Materialize the persist sources in ",i," into tables and serve queries from them"]})]}),r&&a.jsx(WP,{onSubmit:O=>y.mutateAsync(O),isSubmitting:y.isPending,disabled:j,disabledReason:"A materialization is already pending or running for this package."})]})]}),h.isSuccess&&a.jsx(GE,{schedule:C?.materialization?.schedule??null,scope:C?.scope===xe.PackageScopeEnum.Version?"version":"package",manifestLocation:C?.manifestLocation??null,hasFreshness:!!C?.materialization?.freshness,mutable:r,isSubmitting:T.isPending,isScopeMutating:w.isPending,onSubmit:O=>T.mutateAsync(O),onScopeChange:O=>w.mutateAsync(O==="version"?xe.PackageScopeEnum.Version:xe.PackageScopeEnum.Package)}),a.jsxs(I.Box,{sx:{mb:6},children:[a.jsx(I.Typography,{variant:"h6",sx:{fontWeight:600,letterSpacing:"-0.025em",mb:1},children:"Runs"}),m.isError&&a.jsx(_t,{error:m.error,context:`${s} > ${i} > Materializations`}),!m.isSuccess&&!m.isError&&a.jsx(Ht,{text:"Loading materializations..."}),m.isSuccess&&a.jsx(eg,{materializations:M,mutable:r,isMutating:F,onStop:O=>b.mutate(O),onDelete:(O,V)=>x.mutate({materialization:O,dropTables:V}),onViewDetails:O=>d(O.id??null)})]}),a.jsx(Jm,{materialization:E,buildPlan:h.data?.data?.buildPlan??null,onClose:()=>d(null)}),a.jsx(I.Snackbar,{open:l!=="",autoHideDuration:6e3,onClose:()=>c(""),message:l})]})}function QE({packages:e,onSubmit:t,isSubmitting:n,disabled:r}){const[o,s]=Y.useState(!1),[i,l]=Y.useState({}),[c,u]=Y.useState(!1),d=()=>{l({}),u(!1),s(!0)},f=()=>s(!1),m=e.map(b=>b.name).filter(b=>i[b]),h=b=>l(x=>({...x,[b]:!x[b]})),g=e.length>0&&m.length===e.length,y=async()=>{try{await t({packageNames:m,forceRefresh:c}),s(!1)}catch{}};return a.jsxs(a.Fragment,{children:[a.jsx(I.Button,{variant:"contained",startIcon:a.jsx(ui,{}),onClick:d,disabled:r,"aria-label":"New materialization",children:"New materialization"}),a.jsxs(I.Dialog,{open:o,onClose:f,maxWidth:"xs",fullWidth:!0,"aria-labelledby":"create-env-materialization-title",children:[a.jsx(I.DialogTitle,{id:"create-env-materialization-title",children:"New materialization"}),a.jsxs(I.DialogContent,{children:[a.jsx(I.DialogContentText,{sx:{mb:1},children:"Pick the packages to materialize. Each runs an independent build of every persist source in that package."}),e.length===0?a.jsx(I.Typography,{variant:"body2",color:"text.secondary",children:"No packages in this environment."}):a.jsxs(a.Fragment,{children:[a.jsx(I.FormControlLabel,{control:a.jsx(I.Checkbox,{checked:g,indeterminate:m.length>0&&!g,onChange:b=>{const x={};b.target.checked&&e.forEach(C=>x[C.name]=!0),l(x)}}),label:a.jsx(I.Typography,{variant:"body2",children:"Select all"})}),a.jsx(I.Box,{sx:{maxHeight:240,overflowY:"auto",pl:1,borderLeft:"2px solid",borderColor:"divider"},children:a.jsx(I.FormGroup,{children:e.map(b=>a.jsx(I.FormControlLabel,{control:a.jsx(I.Checkbox,{checked:!!i[b.name],onChange:()=>h(b.name)}),label:b.name},b.name))})}),a.jsx(I.FormControlLabel,{sx:{mt:1},control:a.jsx(I.Switch,{checked:c,onChange:b=>u(b.target.checked)}),label:"Force refresh (rebuild even if unchanged)"})]})]}),a.jsxs(I.DialogActions,{children:[a.jsx(I.Button,{onClick:f,children:"Cancel"}),a.jsxs(I.Button,{variant:"contained",loading:n,disabled:m.length===0,onClick:y,children:["Materialize",m.length>0?` (${m.length})`:""]})]})]})]})}const JE=3e3,vf=10;function ig({resourceUri:e,onClickPackageFile:t}){const{apiClients:n,mutable:r}=xe.useServer(),o=Rn.useQueryClient(),{environmentName:s}=St(e),[i,l]=Y.useState(""),[c,u]=Y.useState(null),[d,f]=Y.useState(vf),m=t??(F=>{window.location.href=F}),h=vt({queryKey:["env-materializations",s,d],queryFn:()=>n.materializations.listEnvironmentMaterializations(s,d),placeholderData:F=>F,refetchInterval:F=>(F.state.data?.data??[]).some(L=>di(L.status))?JE:!1}),g=vt({queryKey:["packages",s],queryFn:()=>n.packages.listPackages(s)}),y=()=>o.invalidateQueries({queryKey:["env-materializations",s]}),b=qt({mutationFn:async F=>{const V=(await Promise.allSettled(F.packageNames.map(L=>n.materializations.createMaterialization(s,L,{forceRefresh:F.forceRefresh})))).filter(L=>L.status==="rejected").length;return{total:F.packageNames.length,failed:V}},onSuccess(F){const O=F.total-F.failed;l(F.failed===0?`Started ${O} materialization${O===1?"":"s"}`:`Started ${O} of ${F.total} (${F.failed} could not start — a build may already be active)`),y()},onError(F){l(F.message),y()}}),x=qt({mutationFn:F=>n.materializations.materializationAction(s,F.packageName,F.id,xe.MaterializationActionActionEnum.Stop),onSuccess(){l("Materialization stopped"),y()},onError(F){l(F.message)}}),C=qt({mutationFn:({materialization:F,dropTables:O})=>n.materializations.deleteMaterialization(s,F.packageName,F.id,O),onSuccess(){l("Materialization deleted"),y()},onError(F){l(F.message)}}),T=h.data?.data??[],w=g.data?.data??[],M=T.find(F=>F.id===c)??null,E=b.isPending||x.isPending||C.isPending,j=T.length>=d;return a.jsxs(I.Box,{children:[a.jsxs(I.Box,{sx:{display:"flex",alignItems:"flex-start",justifyContent:"space-between",mb:3},children:[a.jsxs(I.Box,{children:[a.jsx(I.Typography,{variant:"h6",sx:{fontWeight:600,letterSpacing:"-0.025em"},children:"Materializations"}),a.jsx(I.Typography,{variant:"body2",color:"text.secondary",children:"All materialization builds across the packages in this environment"})]}),r&&a.jsx(QE,{packages:w,onSubmit:F=>b.mutateAsync(F),isSubmitting:b.isPending})]}),h.isError&&a.jsx(_t,{error:h.error,context:`${s} > Materializations`}),!h.isSuccess&&!h.isError&&a.jsx(Ht,{text:"Loading materializations..."}),h.isSuccess&&a.jsx(eg,{materializations:T,mutable:r,isMutating:E,showPackage:!0,onClickPackage:F=>m(`/${s}/${F}/materializations`),onStop:F=>x.mutate(F),onDelete:(F,O)=>C.mutate({materialization:F,dropTables:O}),onViewDetails:F=>u(F.id??null)}),h.isSuccess&&T.length>0&&a.jsxs(I.Stack,{direction:"row",alignItems:"center",justifyContent:"center",spacing:2,sx:{mt:2},children:[a.jsx(I.Typography,{variant:"caption",color:"text.secondary",children:j?`Showing ${T.length} most recent`:`${T.length} materialization${T.length===1?"":"s"}`}),j&&a.jsx(I.Button,{size:"small",onClick:()=>f(F=>F+vf),disabled:h.isFetching,children:"Show more"})]}),a.jsx(Jm,{materialization:M,buildPlan:null,showBuildPlan:!1,onClose:()=>u(null)}),a.jsx(I.Snackbar,{open:i!=="",autoHideDuration:6e3,onClose:()=>l(""),message:i})]})}function eO({resourceUri:e}){const{environmentName:t}=St(e),{apiClients:n}=xe.useServer(),[r,o]=Y.useState(!1),s=90,{data:i,isSuccess:l,isError:c,error:u}=vt({queryKey:["about",t],queryFn:()=>n.environments.getEnvironment(t,!1)}),d=i?.data?.readme||"",f=d.split(/\s+/),m=f.length>s,h=f.slice(0,s).join(" ");return a.jsxs(a.Fragment,{children:[!l&&!c&&a.jsx(Ht,{text:"Fetching About..."}),l&&d&&a.jsx(xe.PackageCard,{children:a.jsxs(xe.PackageCardContent,{children:[a.jsx(xe.PackageSectionTitle,{children:"Readme"}),a.jsxs(I.Box,{sx:{mt:1,fontSize:"0.875rem",lineHeight:1.6},children:[a.jsx(pa,{options:{overrides:{h1:{component:"p",props:{style:{fontSize:"inherit",fontWeight:"italic"}}},h2:{component:"p",props:{style:{fontSize:"inherit",fontWeight:"italic"}}},h3:{component:"p",props:{style:{fontSize:"inherit",fontWeight:"italic"}}}}},children:r||!m?d:h}),m&&a.jsxs(I.Box,{sx:{mt:1},children:[" ",a.jsx(I.Button,{variant:"text",size:"small",onClick:()=>o(!r),children:r?"Read less":"Read more"})]})]})]})}),c&&a.jsx(_t,{error:u,context:`${t} > About`})]})}const ag="https://docs.malloydata.dev/documentation",jl=`${ag}/user_guides/publishing`,Lo="https://github.com/malloydata/publisher/blob/main/docs",Hn={docsHome:`${ag}/`,publishing:`${jl}/publishing`,explorer:`${jl}/explorer`,mcpAgents:`${jl}/mcp_agents`,surfaces:`${Lo}/choosing-a-surface.md`,dashboards:`${Lo}/dashboards.md`,dataApps:`${Lo}/html-data-apps.md`,givens:`${Lo}/givens.md`,materialization:`${Lo}/materialization.md`,connections:`${Lo}/connections.md`};function tO({resourceUri:e}){const[t,n]=Y.useState(!1),{apiClients:r}=xe.useServer(),o=Rn.useQueryClient(),[s,i]=Y.useState(""),{environmentName:l}=St(e),c=qt({async mutationFn(d){return r.packages.createPackage(l,{name:d.name,description:d.description,location:d.location})},onSuccess(){n(!1),i("Package created successfully"),o.invalidateQueries({queryKey:["packages",l]})},onError(d){i(d instanceof Error?d.message:"An unknown error occurred")}}),u=d=>{d.preventDefault();const f=new FormData(d.currentTarget),m=f.get("name")?.toString(),h=f.get("description")?.toString(),g=f.get("location")?.toString();c.mutate({name:m,description:h,location:g})};return a.jsxs(a.Fragment,{children:[a.jsx(I.Button,{onClick:()=>n(!0),variant:"contained",color:"primary",startIcon:a.jsx(ln.Add,{}),children:"Add Package"}),a.jsxs(I.Dialog,{open:t,onClose:()=>n(!1),maxWidth:"sm",fullWidth:!0,PaperProps:{sx:{borderRadius:2}},children:[a.jsx(I.DialogTitle,{sx:{fontSize:"1.25rem",fontWeight:600,letterSpacing:"-0.025em",pt:3,pb:1,px:3},children:"Create New Package"}),a.jsxs(I.DialogContent,{sx:{px:3,pb:0},children:[a.jsxs(I.Box,{sx:{mb:3},children:[a.jsx(I.Typography,{variant:"body2",color:"text.secondary",sx:{mb:1.5},children:"Create a new Malloy package to start exploring your data."}),a.jsx(I.Typography,{variant:"body2",color:"text.secondary",sx:{mb:1.5},children:"The location can be a GitHub/S3/GCP URL containing a package (zipped or unzipped), or an absolute path to a directory the publisher server has access to."}),a.jsxs(I.Typography,{variant:"body2",color:"text.secondary",children:["Make sure to conform to the"," ",a.jsx(I.Box,{component:"a",href:Hn.publishing,target:"_blank",rel:"noopener noreferrer",sx:{color:"text.primary",textDecoration:"underline"},children:"Malloy Package Format"}),"."]})]}),a.jsx("form",{onSubmit:u,id:"package-form",children:a.jsxs(I.Stack,{spacing:2.5,children:[a.jsx(I.TextField,{autoFocus:!0,required:!0,id:"name",name:"name",label:"Package Name",type:"text",fullWidth:!0,variant:"outlined",size:"small",InputLabelProps:{shrink:!0}}),a.jsx(I.TextField,{id:"description",name:"description",label:"Description",multiline:!0,rows:3,fullWidth:!0,variant:"outlined",size:"small",InputLabelProps:{shrink:!0}}),a.jsx(I.TextField,{id:"location",name:"location",label:"Location",type:"text",placeholder:"e.g. s3://my-bucket/my-package.zip",fullWidth:!0,variant:"outlined",size:"small",InputLabelProps:{shrink:!0}})]})})]}),a.jsxs(I.DialogActions,{sx:{px:3,pt:2,pb:3,gap:1},children:[a.jsx(I.Button,{variant:"outlined",disabled:c.isPending,onClick:()=>n(!1),children:"Cancel"}),a.jsx(I.Button,{type:"submit",form:"package-form",variant:"contained",loading:c.isPending,children:"Save Changes"})]})]}),a.jsx(I.Snackbar,{open:s!=="",autoHideDuration:6e3,onClose:()=>i(""),message:s})]})}const nO=Xe(a.jsx("path",{d:"M2 20h20v-4H2zm2-3h2v2H4zM2 4v4h20V4zm4 3H4V5h2zm-4 7h20v-4H2zm2-3h2v2H4z"})),lg=Xe(a.jsx("path",{d:"M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6zM19 4h-3.5l-1-1h-5l-1 1H5v2h14z"})),rO=Ee("MuiBox",["root"]),oO=dh(),Tt=st.createBox({themeId:rs,defaultTheme:oO,defaultClassName:rO.root,generateClassName:Zf.generate});function sO(e){return $e("MuiDialogContentText",e)}Ee("MuiDialogContentText",["root"]);const iO=e=>{const{classes:t}=e,r=Re({root:["root"]},sO,t);return{...t,...r}},aO=re(rt,{shouldForwardProp:e=>nn(e)||e==="classes",name:"MuiDialogContentText",slot:"Root"})({}),Ii=D.forwardRef(function(t,n){const r=We({props:t,name:"MuiDialogContentText"}),{children:o,className:s,...i}=r,l=iO(i);return a.jsx(aO,{component:"p",variant:"body1",color:"textSecondary",ref:n,ownerState:i,className:Te(l.root,s),...r,classes:l})}),mr={postgres:[{label:"Host",name:"host",type:"text",required:!1},{label:"Port",name:"port",type:"number",required:!1},{label:"Database Name",name:"databaseName",type:"text",required:!1},{label:"User Name",name:"userName",type:"text",required:!1},{label:"Password",name:"password",type:"password",required:!1},{label:"Connection String",name:"connectionString",type:"text",required:!1}],bigquery:[{label:"Project ID",name:"defaultProjectId",type:"text",required:!1},{label:"Billing Project ID",name:"billingProjectId",type:"text",required:!1},{label:"Location",name:"location",type:"text",required:!1},{label:"Service Account Key JSON",name:"serviceAccountKeyJson",type:"text",required:!0},{label:"Maximum Bytes Billed",name:"maximumBytesBilled",type:"text",required:!1},{label:"Query Timeout Milliseconds",name:"queryTimeoutMilliseconds",type:"text",required:!1}],snowflake:[{label:"Account",name:"account",type:"text",required:!0},{label:"Username",name:"username",type:"text",required:!0},{label:"Password",name:"password",type:"password",required:!1},{label:"Role",name:"role",type:"text",required:!1},{label:"Warehouse",name:"warehouse",type:"text",required:!0},{label:"Database",name:"database",type:"text",required:!1},{label:"Schema",name:"schema",type:"text",required:!1},{label:"Response Timeout Milliseconds",name:"responseTimeoutMilliseconds",type:"text",required:!1},{label:"Private Key",name:"privateKey",type:"password",required:!1},{label:"Private Key Passphrase",name:"privateKeyPass",type:"password",required:!1}],trino:[{label:"Server",name:"server",type:"text",required:!0},{label:"Port",name:"port",type:"number",required:!1},{label:"Catalog",name:"catalog",type:"text",required:!1},{label:"Schema",name:"schema",type:"text",required:!1},{label:"User",name:"user",type:"text",required:!0},{label:"Password",name:"password",type:"password",required:!1},{label:"Peaka Key",name:"peakaKey",type:"password",required:!1}],databricks:[{label:"Host",name:"host",type:"text",required:!0},{label:"HTTP Path",name:"path",type:"text",required:!0},{label:"Access Token",name:"token",type:"password",required:!1},{label:"OAuth Client ID",name:"oauthClientId",type:"text",required:!1},{label:"OAuth Client Secret",name:"oauthClientSecret",type:"password",required:!1},{label:"Default Catalog",name:"defaultCatalog",type:"text",required:!1},{label:"Default Schema",name:"defaultSchema",type:"text",required:!1}],mysql:[{label:"Host",name:"host",type:"text",required:!0},{label:"Port",name:"port",type:"number",required:!0},{label:"User",name:"user",type:"text",required:!0},{label:"Password",name:"password",type:"password",required:!0},{label:"Database",name:"database",type:"text",required:!0}],duckdb:[],motherduck:[{label:"Access Token",name:"accessToken",type:"text",required:!0},{label:"Database",name:"database",type:"text",required:!1}],ducklake:[],publisher:[]},Ys={postgres:"postgresConnection",bigquery:"bigqueryConnection",snowflake:"snowflakeConnection",trino:"trinoConnection",databricks:"databricksConnection",mysql:"mysqlConnection",duckdb:"duckdbConnection",motherduck:"motherduckConnection",ducklake:"ducklakeConnection",publisher:"publisherConnection"},cg=Object.values(xe.ConnectionTypeEnum).filter(e=>e!==xe.ConnectionTypeEnum.Publisher),uc={postgres:"postgresConnection",bigquery:"bigqueryConnection",snowflake:"snowflakeConnection",gcs:"gcsConnection",s3:"s3Connection",azure:"azureConnection"},pi=[{label:"Credential Provider",name:"provider",type:"text",required:!1,selectOptions:[{label:"Access key pair",value:"config"},{label:"Host credential chain",value:"credential_chain"}]},{label:"Access Key ID",name:"accessKeyId",type:"text",required:!1,visibleWhen:{field:"provider",value:"config"}},{label:"Secret Access Key",name:"secretAccessKey",type:"password",required:!1,visibleWhen:{field:"provider",value:"config"}},{label:"Credential Chain",name:"chain",type:"text",required:!1,visibleWhen:{field:"provider",value:"credential_chain"}},{label:"Region",name:"region",type:"text",required:!1},{label:"Endpoint",name:"endpoint",type:"text",required:!1},{label:"Session Token",name:"sessionToken",type:"password",required:!1,visibleWhen:{field:"provider",value:"config"}}],fi=[{label:"Key ID",name:"keyId",type:"text",required:!0},{label:"Secret",name:"secret",type:"password",required:!0}],lO=[{label:"Auth Type",name:"authType",type:"text",required:!0,selectOptions:[{label:"SAS Token",value:"sas_token"},{label:"Service Principal (SPN)",value:"service_principal"}]},{label:"SAS URL (e.g. https://account.blob.core.windows.net/container/file.parquet?sp=r&st=...)",name:"sasUrl",type:"text",required:!1,visibleWhen:{field:"authType",value:"sas_token"}},{label:"Tenant ID",name:"tenantId",type:"text",required:!1,visibleWhen:{field:"authType",value:"service_principal"}},{label:"Client ID",name:"clientId",type:"text",required:!1,visibleWhen:{field:"authType",value:"service_principal"}},{label:"Client Secret",name:"clientSecret",type:"password",required:!1,visibleWhen:{field:"authType",value:"service_principal"}},{label:"Account Name",name:"accountName",type:"text",required:!1,visibleWhen:{field:"authType",value:"service_principal"}},{label:"File URL (e.g. abfss://container/path/file.parquet)",name:"fileUrl",type:"text",required:!1,visibleWhen:{field:"authType",value:"service_principal"}}];function Da(e){return e==="postgres"||e==="bigquery"||e==="snowflake"?mr[e]||[]:e==="s3"?pi:e==="gcs"?fi:e==="azure"?lO:[]}function cO({onSubmit:e,isSubmitting:t}){const[n,r]=Y.useState(!1),[o,s]=Y.useState("postgres"),[i,l]=Y.useState([]),[c,u]=Y.useState("postgres"),[d,f]=Y.useState("s3"),[m,h]=Y.useState("config"),g=()=>{r(!0)},y=()=>{r(!1),l([]),s("postgres"),u("postgres"),f("s3"),h("config")},b=async w=>{w.preventDefault();const M=new FormData(w.currentTarget),E=M.get("name")?.toString(),j=M.get("type")?.toString(),F=mr[j];if(!E)throw new Error("Name is required");if(!j)throw new Error("Type is required");let O;if(j==="ducklake"){const V={};if(c==="postgres"){const N=mr.postgres,A={};if(N.forEach($=>{const R=M.get(`ducklake_pg_${$.name}`)?.toString();R&&(A[$.name]=R)}),Object.keys(A).length===0)throw new Error("DuckLake requires catalog connection");V.postgresConnection=A}const L=M.get("ducklake_bucketUrl")?.toString();if(!L)throw new Error("DuckLake requires a bucket URL");const v={bucketUrl:L};if(d==="s3"){const N={};if(pi.forEach(A=>{const $=M.get(`ducklake_s3_${A.name}`)?.toString();$&&(N[A.name]=$)}),N.provider==="credential_chain")delete N.accessKeyId,delete N.secretAccessKey,delete N.sessionToken;else{if(delete N.chain,!N.accessKeyId)throw new Error("S3 Access Key ID is required");if(!N.secretAccessKey)throw new Error("S3 Secret Access Key is required")}Object.keys(N).length>0&&(v.s3Connection=N)}else if(d==="gcs"){const N={};if(fi.forEach(A=>{const $=M.get(`ducklake_gcs_${A.name}`)?.toString();$&&(N[A.name]=$)}),!N.keyId)throw new Error("GCS Key ID is required");if(!N.secret)throw new Error("GCS Secret is required");Object.keys(N).length>0&&(v.gcsConnection=N)}O={name:E,type:j,ducklakeConnection:{catalog:V,storage:v}}}else if(j==="duckdb"){if(i.length===0)throw new Error("DuckDB connection must have at least one attached database");const V=i.map((L,v)=>{const N=L.dbType,A=M.get(`attachedDb_${v}_name`)?.toString();if(!A)throw new Error(`Attached database at index ${v} must have a name`);const $={name:A,type:N},R=Da(N);if(R&&R.length>0){const _={};if(R.forEach(W=>{const H=M.get(`attachedDb_${v}_${W.name}`)?.toString();H&&(_[W.name]=H)}),N==="s3"){if(_.provider==="credential_chain")delete _.accessKeyId,delete _.secretAccessKey,delete _.sessionToken;else if(delete _.chain,!_.accessKeyId||!_.secretAccessKey)throw new Error(`Attached database "${A}" requires an S3 Access Key ID and Secret Access Key, or Credential Provider set to the host credential chain`)}const z=uc[N];z&&($[z]=_)}return $});O={name:E,type:j,duckdbConnection:{attachedDatabases:V}}}else{const V={};if(F.forEach(L=>{const v=M.get(L.name)?.toString();v&&(V[L.name]=v)}),j==="postgres"){if(!!!V.connectionString?.trim()){const v=["host","port","databaseName","userName","password"];for(const N of v)if(!V[N])throw new Error(`${F.find(A=>A.name===N)?.label||N} is required`)}}else if(j==="bigquery"){if(!V.serviceAccountKeyJson)throw new Error("Service Account Key JSON is required")}else if(j==="snowflake"){if(!V.account)throw new Error("Account is required");if(!V.username)throw new Error("Username is required");if(!V.warehouse)throw new Error("Warehouse is required");if(!V.password&&!V.privateKey)throw new Error("Either password or private key is required")}else if(j==="trino"){if(!V.server)throw new Error("Server is required");if(!V.user)throw new Error("User is required");if(V.server.trim().startsWith("https://")&&!V.password&&!V.peakaKey)throw new Error("Password is required for HTTPS connections (or use Peaka Key)")}else if(j==="mysql"){const L=["host","port","database","user","password"];for(const v of L)if(!V[v])throw new Error(`${F.find(N=>N.name===v)?.label||v} is required`)}else if(j==="motherduck"){if(!V.accessToken)throw new Error("Access Token is required")}else if(j==="databricks"){if(!V.host)throw new Error("Host is required");if(!V.path)throw new Error("HTTP Path is required");const L=V.oauthClientId&&V.oauthClientSecret;if(!V.token&&!L)throw new Error("Either Access Token or OAuth Client ID + Secret is required")}O={name:E,type:j,[Ys[j]]:V}}await e(O),y()},x=()=>{l([...i,{name:"",dbType:"postgres"}])},C=w=>{l(i.filter((M,E)=>E!==w))},T=(w,M)=>{const E=[...i];E[w]={...E[w],dbType:M},l(E)};return a.jsxs(Y.Fragment,{children:[a.jsx(Dt,{variant:"contained",color:"primary",startIcon:a.jsx(ui,{}),onClick:g,children:"Add Connection"}),a.jsxs(cr,{open:n,onClose:y,children:[a.jsx(wr,{children:"Create New Connection"}),a.jsxs(lr,{children:[a.jsx(Ii,{children:"Add a new connection to query your data database using Malloy."}),a.jsxs("form",{onSubmit:b,id:"connection-form",children:[a.jsx(Ke,{autoFocus:!0,required:!0,margin:"dense",id:"name",name:"name",label:"Connection Name",type:"text",fullWidth:!0,variant:"standard"}),a.jsx(Ke,{margin:"dense",id:"type",name:"type",label:"Connection Type",fullWidth:!0,variant:"standard",value:o,select:!0,onChange:w=>s(w.target.value),children:cg.map(w=>a.jsx(Ft,{value:w,children:w},w))}),o==="ducklake"?a.jsxs(Tt,{sx:{mt:2},children:[a.jsxs(Tt,{sx:{mb:3,p:2,border:"1px solid",borderColor:"divider",borderRadius:1},children:[a.jsx(rt,{variant:"subtitle2",sx:{mb:2},fontWeight:500,children:"Catalog"}),a.jsx(Ke,{margin:"dense",id:"ducklake_catalogType",label:"Catalog Type",fullWidth:!0,variant:"standard",value:c,select:!0,onChange:w=>u(w.target.value),children:a.jsx(Ft,{value:"postgres",children:"PostgreSQL"})}),c==="postgres"&&a.jsx(a.Fragment,{children:mr.postgres.map(w=>a.jsx(Ke,{margin:"dense",id:`ducklake_pg_${w.name}`,name:`ducklake_pg_${w.name}`,label:w.label,type:w.type,fullWidth:!0,variant:"standard"},`pg_${w.name}`))})]}),a.jsxs(Tt,{sx:{mb:3,p:2,border:"1px solid",borderColor:"divider",borderRadius:1},children:[a.jsx(rt,{variant:"subtitle2",sx:{mb:2},fontWeight:500,children:"Storage"}),a.jsxs(Ke,{margin:"dense",id:"ducklake_storageType",label:"Storage Type",fullWidth:!0,variant:"standard",value:d,select:!0,onChange:w=>f(w.target.value),children:[a.jsx(Ft,{value:"s3",children:"S3"}),a.jsx(Ft,{value:"gcs",children:"GCS"})]}),a.jsx(Ke,{margin:"dense",required:!0,id:"ducklake_bucketUrl",name:"ducklake_bucketUrl",label:d==="s3"?"Bucket URL (e.g. s3://my-bucket/path)":"Bucket URL (e.g. gs://my-bucket/path)",type:"text",fullWidth:!0,variant:"standard"}),d==="s3"&&a.jsxs(a.Fragment,{children:[a.jsx(rt,{variant:"caption",sx:{mt:2,mb:1,display:"block"},color:"text.secondary",children:"S3 Credentials"}),pi.filter(w=>w.visibleWhen?m===w.visibleWhen.value:!0).map(w=>a.jsx(Ke,{margin:"dense",id:`ducklake_s3_${w.name}`,name:`ducklake_s3_${w.name}`,label:w.label,type:w.selectOptions?void 0:w.type,fullWidth:!0,variant:"standard",required:w.required,select:!!w.selectOptions,defaultValue:w.selectOptions?m:void 0,onChange:w.name==="provider"?M=>h(M.target.value):void 0,placeholder:w.name==="region"?"us-east-1":void 0,children:w.selectOptions?.map(M=>a.jsx(Ft,{value:M.value,children:M.label},M.value))},`s3_${w.name}`))]}),d==="gcs"&&a.jsxs(a.Fragment,{children:[a.jsx(rt,{variant:"caption",sx:{mt:2,mb:1,display:"block"},color:"text.secondary",children:"GCS Credentials"}),fi.map(w=>a.jsx(Ke,{margin:"dense",id:`ducklake_gcs_${w.name}`,name:`ducklake_gcs_${w.name}`,label:w.label,type:w.type,fullWidth:!0,variant:"standard",required:w.required},`gcs_${w.name}`))]})]})]}):o==="duckdb"?a.jsxs(Tt,{sx:{mt:2},children:[a.jsxs(Tt,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",mb:2},children:[a.jsx(rt,{variant:"subtitle1",fontWeight:500,children:"Attached Databases"}),a.jsx(Dt,{startIcon:a.jsx(ui,{}),onClick:x,size:"small",variant:"outlined",children:"Add Database"})]}),i.length===0&&a.jsx(rt,{variant:"body2",color:"text.secondary",sx:{mb:2},children:'DuckDB connections require at least one attached database. Click "Add Database" to get started.'}),i.map((w,M)=>{const E=Da(w.dbType);return a.jsxs(Tt,{sx:{mb:3,p:2,border:"1px solid",borderColor:"divider",borderRadius:1},children:[a.jsxs(Tt,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",mb:2},children:[a.jsxs(rt,{variant:"subtitle2",children:["Database ",M+1]}),a.jsx(Nn,{onClick:()=>C(M),size:"small",color:"error",children:a.jsx(lg,{fontSize:"small"})})]}),a.jsx(Ke,{margin:"dense",required:!0,id:`attachedDb_${M}_name`,name:`attachedDb_${M}_name`,label:"Database Name",type:"text",fullWidth:!0,variant:"standard",defaultValue:w.name}),a.jsx(Ke,{margin:"dense",id:`attachedDb_${M}_type`,name:`attachedDb_${M}_type`,label:"Database Type",fullWidth:!0,variant:"standard",value:w.dbType,select:!0,onChange:j=>T(M,j.target.value),children:Object.values(xe.AttachedDatabaseTypeEnum).map(j=>a.jsx(Ft,{value:j,children:j},j))}),E.filter(j=>j.visibleWhen?(w[j.visibleWhen.field]||E.find(O=>O.name===j.visibleWhen?.field)?.selectOptions?.[0]?.value)===j.visibleWhen.value:!0).map(j=>a.jsx(Ke,{margin:"dense",id:`attachedDb_${M}_${j.name}`,name:`attachedDb_${M}_${j.name}`,label:j.label,type:j.selectOptions?void 0:j.type,fullWidth:!0,variant:"standard",required:j.required,select:!!j.selectOptions,defaultValue:j.selectOptions?.[0]?.value,onChange:j.selectOptions?F=>{const O=[...i];O[M]={...O[M],[j.name]:F.target.value},l(O)}:void 0,children:j.selectOptions?.map(F=>a.jsx(Ft,{value:F.value,children:F.label},F.value))},j.name))]},M)})]}):mr[o].map(w=>a.jsx(Ke,{margin:"dense",id:w.name,name:w.name,label:w.label,type:w.type,fullWidth:!0,variant:"standard",required:w.required},w.name))]})]}),a.jsxs(ar,{children:[a.jsx(Dt,{disabled:t,onClick:y,children:"Cancel"}),a.jsx(Dt,{type:"submit",form:"connection-form",loading:t,children:"Create Connection"})]})]})]})}function uO({connection:e,onCloseDialog:t,isMutating:n,onDelete:r}){const[o,s]=Y.useState(!1),[i,l]=Y.useState(""),c=()=>{s(!0)},u=()=>{s(!1),t()};return a.jsxs(Y.Fragment,{children:[a.jsxs(Ft,{"aria-label":`Delete connection ${e?.name??""}`.trim(),onClick:d=>{d.stopPropagation(),c()},sx:{color:"error.main"},children:[a.jsx(uu,{sx:{color:"inherit"},children:a.jsx(ln.Delete,{fontSize:"small"})}),a.jsx(du,{children:"Delete"})]}),a.jsxs(cr,{onClose:u,"aria-labelledby":"customized-dialog-title",open:o,children:[a.jsx(wr,{sx:{m:0,p:2},id:"customized-dialog-title",children:"Delete Connection"}),a.jsx(Nn,{"aria-label":"close",onClick:u,sx:d=>({position:"absolute",right:8,top:8,color:d.palette.grey[500]}),children:a.jsx(ir,{})}),a.jsx(lr,{dividers:!0,children:a.jsxs(rt,{gutterBottom:!0,children:['Are you sure you want to delete "',e.name,'"? This action cannot be undone.']})}),a.jsx(ar,{children:a.jsx(Dt,{loading:n,variant:"contained",autoFocus:!0,onClick:()=>r(),color:"error",children:"Delete"})}),a.jsx(I.Snackbar,{open:i!=="",autoHideDuration:6e3,onClose:()=>l(""),message:i})]})]})}const Sf=new Set(["password","connectionString","privateKey","privateKeyPass","serviceAccountKeyJson","token","oauthClientSecret","accessToken","peakaKey","secret","secretAccessKey","sessionToken","clientSecret","sasUrl"]);function Cf(e){const t=e.duckdbConnection?.attachedDatabases;return!t||t.length===0?[]:t.map(n=>({name:n.name||"",dbType:n.type||"postgres"}))}function wf(e){const t=e.ducklakeConnection;return t&&t.storage?.gcsConnection?"gcs":"s3"}function dO({connection:e,onSubmit:t,isSubmitting:n,onCloseDialog:r}){const[o,s]=Y.useState(!1),[i,l]=Y.useState(e.type),c=Y.useMemo(()=>new Set(e.withheldFields??[]),[e.withheldFields]),[u,d]=Y.useState(()=>Cf(e)),[f,m]=Y.useState("postgres"),[h,g]=Y.useState(()=>wf(e)),[y,b]=Y.useState(()=>e.ducklakeConnection?.storage?.s3Connection?.provider??"config"),x=()=>{d(Cf(e)),l(e.type),b(e.ducklakeConnection?.storage?.s3Connection?.provider??"config"),m("postgres"),g(wf(e)),s(!0)},C=()=>{s(!1),r?.()},T=async O=>{O.preventDefault();const V=new FormData(O.currentTarget),L=V.get("name")?.toString(),v=V.get("type")?.toString(),N=mr[v];if(!L)throw new Error("Name is required");if(!v)throw new Error("Type is required");let A;if(v==="ducklake"){const $={};if(f==="postgres"){const z=mr.postgres,W={};if(z.forEach(H=>{const G=V.get(`ducklake_pg_${H.name}`)?.toString();G&&(W[H.name]=G)}),Object.keys(W).length===0)throw new Error("DuckLake requires catalog connection");$.postgresConnection=W}const R=V.get("ducklake_bucketUrl")?.toString();if(!R)throw new Error("DuckLake requires a bucket URL");const _={bucketUrl:R};if(h==="s3"){const z={};pi.forEach(H=>{const G=V.get(`ducklake_s3_${H.name}`)?.toString();G&&(z[H.name]=G)});const W=e.ducklakeConnection?.storage?.s3Connection;if(W&&(!z.provider&&W.provider&&(z.provider=W.provider),!z.chain&&W.chain&&(z.chain=W.chain),!z.accessKeyId&&W.accessKeyId&&(z.accessKeyId=W.accessKeyId)),z.provider==="credential_chain")delete z.accessKeyId,delete z.secretAccessKey,delete z.sessionToken;else if(delete z.chain,!z.accessKeyId)throw new Error("S3 Access Key ID is required");Object.keys(z).length>0&&(_.s3Connection=z)}else if(h==="gcs"){const z={};fi.forEach(H=>{const G=V.get(`ducklake_gcs_${H.name}`)?.toString();G&&(z[H.name]=G)});const W=e.ducklakeConnection?.storage?.gcsConnection;if(W&&!z.keyId&&W.keyId&&(z.keyId=W.keyId),!z.keyId)throw new Error("GCS Key ID is required");Object.keys(z).length>0&&(_.gcsConnection=z)}A={name:L,type:v,ducklakeConnection:{catalog:$,storage:_}}}else if(v==="duckdb"){if(u.length===0)throw new Error("DuckDB connection must have at least one attached database");const $=u.map((R,_)=>{const z=R.dbType,W=V.get(`attachedDb_${_}_name`)?.toString();if(!W)throw new Error(`Attached database at index ${_} must have a name`);const H={name:W,type:z},G=Da(z);if(G&&G.length>0){const se={};if(G.forEach(me=>{const X=V.get(`attachedDb_${_}_${me.name}`)?.toString();X&&(se[me.name]=X)}),z==="s3"){if(se.provider==="credential_chain")delete se.accessKeyId,delete se.secretAccessKey,delete se.sessionToken;else if(delete se.chain,!se.accessKeyId||!se.secretAccessKey)throw new Error(`Attached database "${W}" requires an S3 Access Key ID and Secret Access Key, or Credential Provider set to the host credential chain`)}const pe=uc[z];pe&&(H[pe]=se)}return H});A={name:L,type:v,duckdbConnection:{attachedDatabases:$}}}else{const $=e[Ys[v]]||{},R={};if(N.forEach(_=>{const z=V.get(_.name)?.toString(),W=$[_.name];z?R[_.name]=z:Sf.has(_.name)||(z!==void 0?R[_.name]=z:W&&(R[_.name]=W))}),v==="postgres"){const _=["host","port","databaseName","userName"],z=c.has("postgresConnection.connectionString");if(!(!!R.connectionString?.trim()||z)){const H=_;for(const G of H)if(!R[G])throw new Error(`${N.find(se=>se.name===G)?.label||G} is required`)}}else if(v==="snowflake"){if(!R.account)throw new Error("Account is required");if(!R.username)throw new Error("Username is required");if(!R.warehouse)throw new Error("Warehouse is required")}else if(v==="trino"){if(!R.server)throw new Error("Server is required");if(!R.user)throw new Error("User is required")}else if(v==="mysql"){const _=["host","port","database","user"];for(const z of _)if(!R[z])throw new Error(`${N.find(W=>W.name===z)?.label||z} is required`)}else if(v==="databricks"){if(!R.host)throw new Error("Host is required");if(!R.path)throw new Error("HTTP Path is required")}A={name:L,type:v,[Ys[v]]:R}}await t(A),C()},w=()=>{d([...u,{name:"",dbType:"postgres"}])},M=O=>{d(u.filter((V,L)=>L!==O))},E=(O,V)=>{const L=[...u];L[O]={...L[O],dbType:V},d(L)},j=(O,V)=>{const L=e.duckdbConnection?.attachedDatabases;if(!L||!L[O])return"";const v=L[O],N=uc[v.type||""];return N&&v[N]?v[N][V]??"":""},F=O=>{const V=e.ducklakeConnection;if(!V)return"";if(O.startsWith("pg_")){const L=O.replace("pg_","");return V.catalog?.postgresConnection?.[L]??""}if(O==="bucketUrl")return V.storage?.bucketUrl??"";if(O.startsWith("s3_")){const L=O.replace("s3_","");return V.storage?.s3Connection?.[L]??""}if(O.startsWith("gcs_")){const L=O.replace("gcs_","");return V.storage?.gcsConnection?.[L]??""}return""};return a.jsxs(Y.Fragment,{children:[a.jsxs(Ft,{"aria-label":`Edit connection ${e?.name??""}`.trim(),onClick:O=>{O.preventDefault(),O.stopPropagation(),x()},children:[a.jsx(uu,{children:a.jsx(ln.Edit,{fontSize:"small"})}),a.jsx(du,{children:"Edit"})]}),a.jsxs(cr,{open:o,onClose:C,children:[a.jsx(wr,{onClick:O=>{O.stopPropagation()},children:"Edit Connection"}),a.jsxs(lr,{onClick:O=>{O.stopPropagation()},children:[a.jsx(Ii,{children:"Edit a connection to query your data database using Malloy."}),a.jsxs("form",{onSubmit:T,id:"connection-form",children:[a.jsx(Ke,{autoFocus:!0,required:!0,margin:"dense",id:"name",name:"name",label:"Connection Name",type:"text",fullWidth:!0,variant:"standard",defaultValue:e.name}),a.jsx(Ke,{margin:"dense",id:"type",name:"type",label:"Connection Type",fullWidth:!0,variant:"standard",value:i,select:!0,onChange:O=>l(O.target.value),children:cg.map(O=>a.jsx(Ft,{value:O,children:O},O))}),i==="ducklake"?a.jsxs(Tt,{sx:{mt:2},children:[a.jsxs(Tt,{sx:{mb:3,p:2,border:"1px solid",borderColor:"divider",borderRadius:1},children:[a.jsx(rt,{variant:"subtitle2",sx:{mb:2},fontWeight:500,children:"Catalog"}),a.jsx(Ke,{margin:"dense",id:"ducklake_catalogType",label:"Catalog Type",fullWidth:!0,variant:"standard",value:f,select:!0,onChange:O=>m(O.target.value),children:a.jsx(Ft,{value:"postgres",children:"PostgreSQL"})}),f==="postgres"&&a.jsx(a.Fragment,{children:mr.postgres.map(O=>a.jsx(Ke,{margin:"dense",id:`ducklake_pg_${O.name}`,name:`ducklake_pg_${O.name}`,label:O.label,type:O.type,fullWidth:!0,variant:"standard",defaultValue:F(`pg_${O.name}`)},`pg_${O.name}`))})]}),a.jsxs(Tt,{sx:{mb:3,p:2,border:"1px solid",borderColor:"divider",borderRadius:1},children:[a.jsx(rt,{variant:"subtitle2",sx:{mb:2},fontWeight:500,children:"Storage"}),a.jsxs(Ke,{margin:"dense",id:"ducklake_storageType",label:"Storage Type",fullWidth:!0,variant:"standard",value:h,select:!0,onChange:O=>g(O.target.value),children:[a.jsx(Ft,{value:"s3",children:"S3"}),a.jsx(Ft,{value:"gcs",children:"GCS"})]}),a.jsx(Ke,{margin:"dense",required:!0,id:"ducklake_bucketUrl",name:"ducklake_bucketUrl",label:h==="s3"?"Bucket URL (e.g. s3://my-bucket/path)":"Bucket URL (e.g. gs://my-bucket/path)",type:"text",fullWidth:!0,variant:"standard",defaultValue:F("bucketUrl")}),h==="s3"&&a.jsxs(a.Fragment,{children:[a.jsx(rt,{variant:"caption",sx:{mt:2,mb:1,display:"block"},color:"text.secondary",children:"S3 Credentials"}),pi.filter(O=>O.visibleWhen?y===O.visibleWhen.value:!0).map(O=>a.jsx(Ke,{margin:"dense",id:`ducklake_s3_${O.name}`,name:`ducklake_s3_${O.name}`,label:O.label,type:O.selectOptions?void 0:O.type,fullWidth:!0,variant:"standard",required:O.required&&O.name!=="secretAccessKey",select:!!O.selectOptions,defaultValue:O.selectOptions?y:F(`s3_${O.name}`),onChange:O.name==="provider"?V=>b(V.target.value):void 0,placeholder:O.name==="region"?"us-east-1":O.name==="secretAccessKey"&&c.has("ducklakeConnection.storage.s3Connection.secretAccessKey")?"Leave empty to keep existing":void 0,children:O.selectOptions?.map(V=>a.jsx(Ft,{value:V.value,children:V.label},V.value))},`s3_${O.name}`))]}),h==="gcs"&&a.jsxs(a.Fragment,{children:[a.jsx(rt,{variant:"caption",sx:{mt:2,mb:1,display:"block"},color:"text.secondary",children:"GCS Credentials"}),fi.map(O=>a.jsx(Ke,{margin:"dense",id:`ducklake_gcs_${O.name}`,name:`ducklake_gcs_${O.name}`,label:O.label,type:O.type,fullWidth:!0,variant:"standard",required:O.required&&O.name!=="secret",defaultValue:F(`gcs_${O.name}`),placeholder:O.name==="secret"&&c.has("ducklakeConnection.storage.gcsConnection.secret")?"Leave empty to keep existing":void 0},`gcs_${O.name}`))]})]})]}):i==="duckdb"?a.jsxs(Tt,{sx:{mt:2},children:[a.jsxs(Tt,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",mb:2},children:[a.jsx(rt,{variant:"subtitle1",fontWeight:500,children:"Attached Databases"}),a.jsx(Dt,{startIcon:a.jsx(ui,{}),onClick:w,size:"small",variant:"outlined",children:"Add Database"})]}),u.length===0&&a.jsx(rt,{variant:"body2",color:"text.secondary",sx:{mb:2},children:'DuckDB connections require at least one attached database. Click "Add Database" to get started.'}),u.map((O,V)=>{const L=Da(O.dbType);return a.jsxs(Tt,{sx:{mb:3,p:2,border:"1px solid",borderColor:"divider",borderRadius:1},children:[a.jsxs(Tt,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",mb:2},children:[a.jsxs(rt,{variant:"subtitle2",children:["Database ",V+1]}),a.jsx(Nn,{"aria-label":`Remove attached database ${V+1}`,onClick:()=>M(V),size:"small",color:"error",children:a.jsx(lg,{fontSize:"small"})})]}),a.jsx(Ke,{margin:"dense",required:!0,id:`attachedDb_${V}_name`,name:`attachedDb_${V}_name`,label:"Database Name",type:"text",fullWidth:!0,variant:"standard",defaultValue:O.name}),a.jsx(Ke,{margin:"dense",id:`attachedDb_${V}_type`,name:`attachedDb_${V}_type`,label:"Database Type",fullWidth:!0,variant:"standard",value:O.dbType,select:!0,onChange:v=>E(V,v.target.value),children:Object.values(xe.AttachedDatabaseTypeEnum).map(v=>a.jsx(Ft,{value:v,children:v},v))}),L.filter(v=>v.visibleWhen?(O[v.visibleWhen.field]||j(V,v.visibleWhen.field)||L.find(A=>A.name===v.visibleWhen?.field)?.selectOptions?.[0]?.value)===v.visibleWhen.value:!0).map(v=>a.jsx(Ke,{margin:"dense",id:`attachedDb_${V}_${v.name}`,name:`attachedDb_${V}_${v.name}`,label:v.label,type:v.selectOptions?void 0:v.type,fullWidth:!0,variant:"standard",required:v.required,select:!!v.selectOptions,defaultValue:j(V,v.name)||v.selectOptions?.[0]?.value,onChange:v.selectOptions?N=>{const A=[...u];A[V]={...A[V],[v.name]:N.target.value},d(A)}:void 0,children:v.selectOptions?.map(N=>a.jsx(Ft,{value:N.value,children:N.label},N.value))},v.name))]},V)})]}):mr[i].map(O=>{const V=e?.[Ys[i]??""]?.[O.name??""]??"",L=O.type==="password"||Sf.has(O.name),v=c.has(`${Ys[i]??""}.${O.name}`);return a.jsx(Ke,{margin:"dense",id:O.name,name:O.name,label:O.label,type:O.type,fullWidth:!0,variant:"standard",required:O.required&&!L&&!V,defaultValue:V,placeholder:v?"Leave empty to keep existing":void 0,helperText:L?v?"Stored value is not shown. Leave empty to keep it.":"No value stored.":void 0},O.name)})]})]}),a.jsxs(ar,{onClick:O=>{O.stopPropagation()},children:[a.jsx(Dt,{disabled:n,onClick:C,children:"Cancel"}),a.jsx(Dt,{type:"submit",form:"connection-form",loading:n,children:"Edit Connection"})]})]})]})}function kf(e,t){return!e||e.type!=="duckdb"?!1:(e.duckdbConnection?.attachedDatabases||[]).some(r=>r.type==="azure"&&r.name===t)}function pO(e){return e.startsWith("gs://")||e.startsWith("s3://")||e.startsWith("https://")||e.startsWith("abfss://")||e.startsWith("az://")}function ug({connectionName:e,resourceUri:t,schema:n,connection:r}){const{apiClients:o}=xe.useServer(),{environmentName:s}=St(t),[i,l]=Y.useState(null),[c,u]=Y.useState(n||null),[d,f]=Y.useState(!1),{data:m,isError:h,isLoading:g,error:y}=vt({queryKey:["schemas",s,e],queryFn:()=>o.connections.listSchemas(s,e)}),b=m?.data||[];return a.jsxs(I.Grid,{container:!0,spacing:1,children:[!n&&a.jsx(I.Grid,{size:{xs:12,md:4},children:a.jsxs(I.Paper,{sx:{p:1,m:0},children:[a.jsxs(I.Box,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",mb:0},children:[a.jsx(I.Typography,{variant:"overline",fontWeight:"bold",children:"Table Paths"}),a.jsx(I.FormControlLabel,{control:a.jsx(I.Switch,{checked:d,onChange:x=>f(x.target.checked)}),label:"Hidden Schemas"})]}),a.jsx(I.Divider,{sx:{mt:"2px"}}),a.jsxs(I.Box,{sx:{mt:"2px",maxHeight:"600px",overflowY:"auto"},children:[g&&a.jsx(Ht,{text:"Loading schemas..."}),h&&a.jsx(_t,{error:y,context:`${s} > ${e} > Schemas`}),!g&&!h&&b.length===0&&a.jsx(I.Typography,{variant:"body2",children:"No Schemas"}),!g&&!h&&b.length>0&&a.jsx(I.List,{dense:!0,disablePadding:!0,children:b.map(x=>{const C=x.name;if(x.isHidden&&!d)return null;const w=c===C;return a.jsx(I.ListItemButton,{selected:w,onClick:()=>{u(C),l(null)},children:a.jsx(I.ListItemText,{primary:C})},C)})})]})]})}),a.jsx(I.Grid,{size:{xs:12,md:n?6:4},children:c&&a.jsx(I.Paper,{sx:{p:1,m:0},children:a.jsx(mO,{connectionName:e,schemaName:c,onTableSelect:x=>{l(x)},resourceUri:t,connection:r})})}),a.jsx(I.Grid,{size:{xs:12,md:n?6:4},children:c&&i&&a.jsx(fO,{environmentName:s,connectionName:e,schemaName:c,tableResource:i})})]})}function fO({environmentName:e,connectionName:t,schemaName:n,tableResource:r}){const{apiClients:o}=xe.useServer(),{data:s,isLoading:i,isError:l,error:c}=vt({queryKey:["connectionTableDetail",e,t,n,r],queryFn:()=>o.connections.getTable(e,t,n,r),enabled:!!n&&!!r}),u={resource:s?.data?.resource??r,columns:s?.data?.columns??[]};return a.jsxs(I.Paper,{sx:{p:1,m:0},children:[l&&a.jsx(_t,{error:c,context:`${e} > ${t} > ${n} > ${r}`}),!l&&a.jsx(hO,{table:u,loading:i})]})}function hO({table:e,loading:t}){return t?a.jsx(Ht,{text:"Loading columns..."}):a.jsxs(a.Fragment,{children:[a.jsxs(I.Typography,{variant:"overline",fontWeight:"bold",sx:{display:"block",wordBreak:"break-all"},children:[e.resource.includes("://")||/\.(parquet|csv|json|tsv|ndjson)$/i.test(e.resource)?"File":"Table",": ",e.resource]}),a.jsx(I.Divider,{}),a.jsx(I.Box,{sx:{mt:"10px",maxHeight:"600px",overflowY:"auto"},children:a.jsx(I.TableContainer,{children:a.jsxs(I.Table,{size:"small",sx:{"& .MuiTableCell-root":{padding:"10px"}},children:[a.jsx(I.TableHead,{children:a.jsxs(I.TableRow,{children:[a.jsx(I.TableCell,{children:"NAME"}),a.jsx(I.TableCell,{children:"TYPE"})]})}),a.jsx(I.TableBody,{children:e.columns?.sort((n,r)=>n.name.localeCompare(r.name))?.map(n=>a.jsxs(I.TableRow,{children:[a.jsx(I.TableCell,{children:n.name}),a.jsx(I.TableCell,{children:n.type})]},n.name))})]})})})]})}function mO({connectionName:e,schemaName:t,onTableSelect:n,resourceUri:r,connection:o}){const{environmentName:s}=St(r),{apiClients:i}=xe.useServer(),[l,c]=Y.useState(""),{data:u,isSuccess:d,isError:f,error:m,isLoading:h}=vt({queryKey:["tablesInSchema",s,e,t],queryFn:()=>i.connections.listTables(s,e,t)}),g=kf(o,t),y=x=>g?x:x.split(".").pop()||x,b=d&&u?.data?u.data.filter(x=>y(x.resource).toLowerCase().includes(l.toLowerCase())).sort((x,C)=>y(x.resource).localeCompare(y(C.resource))):[];return a.jsxs(a.Fragment,{children:[a.jsx(I.Typography,{variant:"overline",fontWeight:"bold",children:pO(t)||kf(o,t)?`Files in ${t}`:`Tables in ${t}`}),a.jsx(I.Divider,{}),a.jsx(I.Box,{sx:{mt:1,mb:1},children:a.jsx(I.TextField,{size:"small",fullWidth:!0,placeholder:"Search tables...",value:l,onChange:x=>c(x.target.value),variant:"outlined"})}),a.jsx(I.Divider,{}),a.jsxs(I.Box,{sx:{mt:"2px",maxHeight:"600px",overflowY:"auto"},children:[h&&a.jsx(Ht,{text:"Fetching Tables..."}),f&&a.jsx(_t,{error:m,context:`${s} > ${e} > ${t}`}),d&&b.length===0&&a.jsx(I.Typography,{variant:"body2",children:"No Tables"}),d&&u?.data&&u.data.length>0&&a.jsx(I.List,{dense:!0,disablePadding:!0,children:b.map(x=>{let C=y(x.resource);return!g&&x.resource.includes("://")&&(C=x.resource.split("/").pop()||x.resource),a.jsx(I.ListItemButton,{onClick:()=>n(x.resource),children:a.jsx(I.ListItemText,{primary:C,secondary:x.columns.length>0?`${x.columns.length} columns`:void 0})},x.resource)})})]})]})}const gO={bigquery:"BigQuery",snowflake:"Snowflake",postgres:"PostgreSQL",mysql:"MySQL",trino:"Trino",databricks:"Databricks",duckdb:"DuckDB",ducklake:"DuckLake",s3:"S3",gcs:"GCS",azure:"Azure"};function yO(e){return e?gO[e]??e:""}function bO({resourceUri:e}){const{apiClients:t,mutable:n}=xe.useServer(),r=Rn.useQueryClient(),{environmentName:o}=St(e),[s,i]=Y.useState(""),[l,c]=Y.useState(null),u=yi({environmentName:o,connectionName:l}),{data:d,isSuccess:f,isError:m,error:h}=vt({queryKey:["connections",o],queryFn:()=>t.connections.listConnections(o)}),g=()=>{c(null)},y=qt({mutationFn:w=>t.environments.updateEnvironment(o,{name:o,connections:[...d.data,w]}),onSuccess(){i("Connection added successfully"),r.invalidateQueries({queryKey:["connections",o]})},onError(w){i(w.message)}}),b=qt({mutationFn:w=>t.environments.updateEnvironment(o,{name:o,connections:d.data.map(M=>M.name===w.name?w:M)}),onSuccess(w,M){i(`Connection ${M.name} updated successfully`),r.invalidateQueries({queryKey:["connections",o]})},onError(w){i(w.message)}}),x=qt({mutationFn:w=>{if(!w.name)throw new Error("Cannot delete a connection with no name");return t.connections.deleteConnection(o,w.name)},onSuccess(w,M){i(`Connection ${M.name} deleted successfully`),r.invalidateQueries({queryKey:["connections",o]})},onError(w){i(w.message)}}),C=f?[...d.data].sort((w,M)=>(w.name??"").localeCompare(M.name??"")):[],T=y.isPending||b.isPending||x.isPending;return a.jsxs(I.Box,{children:[a.jsxs(I.Box,{sx:{display:"flex",alignItems:"flex-start",justifyContent:"space-between",mb:3},children:[a.jsxs(I.Box,{children:[a.jsx(I.Typography,{variant:"h6",sx:{fontWeight:600,letterSpacing:"-0.025em"},children:"Connections"}),a.jsx(I.Typography,{variant:"body2",color:"text.secondary",children:"Database connections available to packages in this environment"})]}),n&&f&&a.jsx(cO,{onSubmit:w=>y.mutateAsync(w),isSubmitting:y.isPending})]}),!f&&!m&&a.jsx(I.Typography,{variant:"body2",color:"text.secondary",children:"Fetching Connections..."}),m&&a.jsx(_t,{error:h,context:`${o} > Connections`}),f&&C.length===0&&a.jsx(I.Typography,{variant:"body2",color:"text.secondary",children:"No connections yet."}),f&&C.length>0&&a.jsx(I.Grid,{container:!0,spacing:2,children:C.map(w=>a.jsx(I.Grid,{size:{xs:12,sm:6,md:4},children:a.jsx(xO,{connection:w,mutable:n,isMutating:T,onOpenExplorer:()=>c(w.name??null),onEdit:M=>b.mutateAsync(M),onDelete:M=>x.mutateAsync(M)})},w.name))}),a.jsx(I.Snackbar,{open:s!=="",autoHideDuration:6e3,onClose:()=>i(""),message:s}),a.jsxs(I.Dialog,{open:l!==null,onClose:g,maxWidth:"lg",fullWidth:!0,children:[a.jsxs(I.DialogTitle,{children:["Connection Explorer: ",l,a.jsx(I.IconButton,{"aria-label":"close",onClick:g,sx:{position:"absolute",right:8,top:8},children:a.jsx(I.Box,{sx:{width:24,height:24,display:"flex",alignItems:"center",justifyContent:"center"},children:"X"})})]}),a.jsx(I.DialogContent,{children:l&&a.jsx(ug,{resourceUri:u,connectionName:l,connection:d?.data?.find(w=>w.name===l)})})]})]})}function xO({connection:e,mutable:t,isMutating:n,onOpenExplorer:r,onEdit:o,onDelete:s}){const[i,l]=Y.useState(null),c=!!i,u=f=>{f.stopPropagation(),l(f.currentTarget)},d=()=>{l(null)};return a.jsx(I.Card,{variant:"outlined",onClick:r,sx:{height:"100%",cursor:"pointer",borderRadius:3,borderColor:"divider",boxShadow:"none",transition:"all 0.2s ease-in-out","&:hover":{boxShadow:2,borderColor:"primary.main"}},children:a.jsx(I.CardContent,{sx:{p:2.5,"&:last-child":{pb:2.5}},children:a.jsxs(I.Box,{sx:{display:"flex",alignItems:"flex-start",gap:1.5},children:[a.jsx(I.Box,{sx:{width:36,height:36,borderRadius:1.5,bgcolor:"warning.light",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0,color:"warning.main"},children:a.jsx(nO,{sx:{fontSize:20}})}),a.jsxs(I.Box,{sx:{flex:1,minWidth:0},children:[a.jsx(I.Typography,{variant:"subtitle1",component:"h6",noWrap:!0,sx:{fontWeight:600,mb:.5},children:e.name}),a.jsx(I.Typography,{variant:"body2",color:"text.secondary",noWrap:!0,children:yO(e.type)})]}),t&&a.jsxs(a.Fragment,{children:[a.jsx(I.IconButton,{size:"small",onClick:u,"aria-label":`Connection actions for ${e.name??""}`.trim(),sx:{flexShrink:0,mt:-.5,mr:-.5},children:a.jsx(ln.MoreVert,{fontSize:"small"})}),a.jsxs(I.Menu,{anchorEl:i,open:c,onClose:d,onClick:f=>f.stopPropagation(),anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},children:[a.jsx(dO,{connection:e,onSubmit:o,isSubmitting:n,onCloseDialog:d}),a.jsx(uO,{connection:e,onCloseDialog:d,isMutating:n,onDelete:()=>s(e)})]})]})]})})})}const vO=Xe([a.jsx("path",{d:"M20 2H4c-1 0-2 .9-2 2v3.01c0 .72.43 1.34 1 1.69V20c0 1.1 1.1 2 2 2h14c.9 0 2-.9 2-2V8.7c.57-.35 1-.97 1-1.69V4c0-1.1-1-2-2-2m-1 18H5V9h14zm1-13H4V4h16z"},"0"),a.jsx("path",{d:"M9 12h6v2H9z"},"1")]);function SO({resourceUri:e,onCloseDialog:t}){const[n,r]=Y.useState(!1),{apiClients:o}=xe.useServer(),s=Rn.useQueryClient(),[i,l]=Y.useState(""),c=()=>{r(!0)},u=()=>{r(!1),t()},{environmentName:d,packageName:f}=St(e),m=qt({mutationFn:()=>o.packages.deletePackage(d,f),onSuccess(){u(),s.invalidateQueries({queryKey:["packages"]}),l("Package deleted successfully")},onError(h){l(h instanceof Error?h.message:"An unknown error occurred")}});return a.jsxs(Y.Fragment,{children:[a.jsxs(I.MenuItem,{onClick:c,children:[a.jsx(I.ListItemIcon,{children:a.jsx(ln.Delete,{fontSize:"small"})}),a.jsx(I.ListItemText,{children:"Delete"})]}),a.jsxs(cr,{onClose:u,"aria-labelledby":"customized-dialog-title",open:n,children:[a.jsx(wr,{sx:{m:0,p:2},id:"customized-dialog-title",children:"Delete Package"}),a.jsx(Nn,{"aria-label":"close",onClick:u,sx:h=>({position:"absolute",right:8,top:8,color:h.palette.grey[500]}),children:a.jsx(ir,{})}),a.jsx(lr,{dividers:!0,children:a.jsxs(rt,{gutterBottom:!0,children:['Are you sure you want to delete "',f,'"? This action cannot be undone.']})}),a.jsxs(ar,{children:[a.jsx(Dt,{variant:"outlined",onClick:u,style:{borderColor:xe.MALLOY_BRAND.teal,color:xe.MALLOY_BRAND.teal},children:"Cancel"}),a.jsx(Dt,{variant:"contained",autoFocus:!0,onClick:()=>m.mutate(),color:"error",loading:m.isPending,children:"Delete"})]}),a.jsx(I.Snackbar,{open:i!=="",autoHideDuration:6e3,onClose:()=>l(""),message:i})]})]})}function CO({package:e,resourceUri:t,onCloseDialog:n}){const[r,o]=Y.useState(!1),{apiClients:s}=xe.useServer(),i=Rn.useQueryClient(),[l,c]=Y.useState(""),u=()=>{o(!0)},d=()=>{o(!1),n()},{packageName:f,environmentName:m}=St(t),h=qt({async mutationFn(y){return s.packages.updatePackage(m,f,{name:f,description:y.description})},onSuccess(){d(),c("Package updated successfully"),i.invalidateQueries({queryKey:["packages",m]})},onError(y){c(y instanceof Error?y.message:"An unknown error occurred")}}),g=y=>{y.preventDefault();const x=new FormData(y.currentTarget).get("description")?.toString();h.mutate({description:x})};return a.jsxs(Y.Fragment,{children:[a.jsxs(I.MenuItem,{onClick:u,children:[a.jsx(I.ListItemIcon,{children:a.jsx(ln.Edit,{fontSize:"small"})}),a.jsx(I.ListItemText,{children:"Edit"})]}),a.jsxs(cr,{open:r,onClose:d,children:[a.jsx(wr,{children:"Edit Package"}),a.jsxs(lr,{children:[a.jsxs(Ii,{children:['Update the details for "',e.name,'".']}),a.jsxs("form",{onSubmit:g,id:"package-form",children:[a.jsx(Ke,{autoFocus:!0,required:!0,margin:"dense",id:"name",name:"name",label:"Package Name",disabled:!0,type:"text",fullWidth:!0,variant:"standard",defaultValue:e.name}),a.jsx(Ke,{id:"description",name:"description",label:"Description",multiline:!0,fullWidth:!0,rows:4,defaultValue:e.description,variant:"standard"})]})]}),a.jsxs(ar,{children:[a.jsx(Dt,{disabled:h.isPending,onClick:d,children:"Cancel"}),a.jsx(Dt,{type:"submit",form:"package-form",loading:h.isPending,children:"Save Changes"})]})]}),a.jsx(I.Snackbar,{open:l!=="",autoHideDuration:6e3,onClose:()=>c(""),message:l})]})}function dg({onSelectPackage:e,resourceUri:t}){const{apiClients:n}=xe.useServer(),{environmentName:r}=St(t),{data:o,isSuccess:s,isError:i,error:l}=vt({queryKey:["packages",r],queryFn:()=>n.packages.listPackages(r)});if(i)return a.jsx(_t,{error:l,context:`${r} > Packages`});if(!s)return a.jsx(Ht,{text:"Fetching Packages..."});const c=[...o.data].sort((u,d)=>u.name.localeCompare(d.name));return a.jsx(I.Grid,{container:!0,spacing:2,children:c.map(u=>{const d=yi({environmentName:r,packageName:u.name});return a.jsx(I.Grid,{size:{xs:12,sm:6,md:4},children:a.jsx(wO,{pkg:u,packageResourceUri:d,onSelectPackage:e})},u.name)})})}function wO({pkg:e,packageResourceUri:t,onSelectPackage:n}){const{mutable:r}=xe.useServer(),[o,s]=Y.useState(null),i=!!o,l=f=>{n(e.name,f)},c=f=>{f.stopPropagation(),s(f.currentTarget)},u=()=>{s(null)},d=e.description??"";return a.jsx(I.Card,{variant:"outlined",onClick:l,sx:{height:"100%",cursor:"pointer",borderRadius:3,borderColor:"divider",boxShadow:"none",transition:"all 0.2s ease-in-out","&:hover":{boxShadow:2,borderColor:"primary.main"}},children:a.jsx(I.CardContent,{sx:{p:2.5,"&:last-child":{pb:2.5}},children:a.jsxs(I.Box,{sx:{display:"flex",alignItems:"flex-start",gap:1.5},children:[a.jsx(I.Box,{sx:f=>({width:36,height:36,borderRadius:1.5,bgcolor:f.palette.mode==="dark"?"rgba(255, 255, 255, 0.08)":"grey.100",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0,color:"text.primary"}),children:a.jsx(vO,{sx:{fontSize:20}})}),a.jsxs(I.Box,{sx:{flex:1,minWidth:0},children:[a.jsx(I.Typography,{variant:"subtitle1",component:"h6",noWrap:!0,sx:{fontWeight:600,mb:.5},children:e.name}),a.jsx(I.Tooltip,{title:d,followCursor:!0,enterDelay:1e3,children:a.jsx(I.Typography,{variant:"body2",color:"text.secondary",sx:{overflow:"hidden",textOverflow:"ellipsis",display:"-webkit-box",WebkitLineClamp:2,WebkitBoxOrient:"vertical",lineHeight:1.5},children:d})})]}),r&&a.jsxs(a.Fragment,{children:[a.jsx(I.IconButton,{size:"small",onClick:c,"aria-label":`Package actions for ${e.name}`,sx:{flexShrink:0,mt:-.5,mr:-.5},children:a.jsx(ln.MoreVert,{fontSize:"small"})}),a.jsxs(I.Menu,{anchorEl:o,open:i,onClose:u,onClick:f=>f.stopPropagation(),anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},children:[a.jsx(CO,{package:e,resourceUri:t,onCloseDialog:u}),a.jsx(SO,{resourceUri:t,onCloseDialog:u})]})]})]})})})}function kO({onSelectPackage:e,resourceUri:t}){const{mutable:n}=xe.useServer(),{environmentName:r}=St(t);return Y.useEffect(()=>{window.scrollTo({top:0,behavior:"auto"})},[]),a.jsxs(I.Container,{maxWidth:!1,sx:{maxWidth:1024,mx:"auto",px:4,py:3},children:[a.jsxs(I.Box,{sx:{mb:5},children:[a.jsx(I.Typography,{variant:"h4",component:"h1",sx:{fontWeight:600,letterSpacing:"-0.025em",mb:.5},children:r}),a.jsx(I.Typography,{variant:"body2",color:"text.secondary",children:"Manage packages and database connections in this environment. Open a package to explore its models and notebooks."})]}),a.jsxs(I.Box,{sx:{mb:5},children:[a.jsxs(I.Stack,{direction:"row",justifyContent:"space-between",alignItems:"flex-start",sx:{mb:3},children:[a.jsxs(I.Box,{children:[a.jsx(I.Typography,{variant:"h6",sx:{fontWeight:600,letterSpacing:"-0.025em"},children:"Packages"}),a.jsx(I.Typography,{variant:"body2",color:"text.secondary",children:"Published packages available for use in this environment"})]}),n&&a.jsx(tO,{resourceUri:t})]}),a.jsx(dg,{onSelectPackage:e,resourceUri:t})]}),a.jsx(I.Box,{sx:{mb:5},children:a.jsx(bO,{resourceUri:t})}),a.jsx(I.Box,{sx:{mb:5},children:a.jsx(ig,{resourceUri:t,onClickPackageFile:e})}),a.jsx(eO,{resourceUri:t})]})}function Tf({array1:e,array2:t,parser:n=r=>r}){return e&&t&&e.length===t.length&&e.every((r,o)=>n(r)===n(t[o]))}function If(e){return e.normalize("NFD").replace(/[\u0300-\u036f]/g,"")}function TO(e={}){const{ignoreAccents:t=!0,ignoreCase:n=!0,limit:r,matchFrom:o="any",stringify:s,trim:i=!1}=e;return(l,{inputValue:c,getOptionLabel:u})=>{let d=i?c.trim():c;n&&(d=d.toLowerCase()),t&&(d=If(d));const f=d?l.filter(m=>{let h=(s||u)(m);return n&&(h=h.toLowerCase()),t&&(h=If(h)),o==="start"?h.startsWith(d):h.includes(d)}):l;return typeof r=="number"?f.slice(0,r):f}}const IO=TO(),Mf=5,MO=e=>e.current!==null&&e.current.parentElement?.contains(document.activeElement),DO=[];function Df(e,t,n,r){if(t||e==null||r)return"";const o=n(e);return typeof o=="string"?o:""}function PO(e){const{unstable_isActiveElementInListbox:t=MO,unstable_classNamePrefix:n="Mui",autoComplete:r=!1,autoHighlight:o=!1,autoSelect:s=!1,blurOnSelect:i=!1,clearOnBlur:l=!e.freeSolo,clearOnEscape:c=!1,componentName:u="useAutocomplete",defaultValue:d=e.multiple?DO:null,disableClearable:f=!1,disableCloseOnSelect:m=!1,disabled:h,disabledItemsFocusable:g=!1,disableListWrap:y=!1,filterOptions:b=IO,filterSelectedOptions:x=!1,freeSolo:C=!1,getOptionDisabled:T,getOptionKey:w,getOptionLabel:M=be=>be.label??be,groupBy:E,handleHomeEndKeys:j=!e.freeSolo,id:F,includeInputInList:O=!1,inputValue:V,isOptionEqualToValue:L=(be,ge)=>be===ge,multiple:v=!1,onChange:N,onClose:A,onHighlightChange:$,onInputChange:R,onOpen:_,open:z,openOnFocus:W=!1,options:H,readOnly:G=!1,renderValue:se,selectOnFocus:pe=!e.freeSolo,value:me}=e,X=Un(F);let K=M;K=be=>{const ge=M(be);return typeof ge!="string"?String(ge):ge};const le=D.useRef(!1),oe=D.useRef(!0),te=D.useRef(null),Z=D.useRef(null),[J,ae]=D.useState(null),[Q,ue]=D.useState(-1),he=o?0:-1,de=D.useRef(he),Se=D.useRef(Df(d??me,v,K)).current,[ce,Pe]=mn({controlled:me,default:d,name:u}),[Ce,Ve]=mn({controlled:V,default:Se,name:u,state:"inputValue"}),[De,pt]=D.useState(!1),Ye=D.useCallback((be,ge,Oe)=>{if(!(v?ce.length<ge.length:ge!==null)&&!l)return;const ke=Df(ge,v,K,se);Ce!==ke&&(Ve(ke),R&&R(be,ke,Oe))},[K,Ce,v,R,Ve,l,ce,se]),[tt,gt]=mn({controlled:z,default:!1,name:u,state:"open"}),[kt,Pt]=D.useState(!0),Yt=!v&&ce!=null&&Ce===K(ce),lt=tt&&!G,Ie=lt?b(H.filter(be=>!(x&&(v?ce:[ce]).some(ge=>ge!==null&&L(be,ge)))),{inputValue:Yt&&kt?"":Ce,getOptionLabel:K}):[],ft=cS({filteredOptions:Ie,value:ce,inputValue:Ce});D.useEffect(()=>{const be=ce!==ft.value;De&&!be||C&&!be||Ye(null,ce,"reset")},[ce,Ye,De,ft.value,C]);const it=tt&&Ie.length>0&&!G,jt=Me(be=>{if(be===-1)te.current.focus();else{const ge=se?"data-item-index":"data-tag-index";J.querySelector(`[${ge}="${be}"]`).focus()}});D.useEffect(()=>{v&&Q>ce.length-1&&(ue(-1),jt(-1))},[ce,v,Q,jt]);function je(be,ge){if(!Z.current||be<0||be>=Ie.length)return-1;let Oe=be;for(;;){const Le=Z.current.querySelector(`[data-option-index="${Oe}"]`),ke=g?!1:!Le||Le.disabled||Le.getAttribute("aria-disabled")==="true";if(Le&&Le.hasAttribute("tabindex")&&!ke)return Oe;if(ge==="next"?Oe=(Oe+1)%Ie.length:Oe=(Oe-1+Ie.length)%Ie.length,Oe===be)return-1}}const ze=Me(({event:be,index:ge,reason:Oe})=>{if(de.current=ge,ge===-1?te.current.removeAttribute("aria-activedescendant"):te.current.setAttribute("aria-activedescendant",`${X}-option-${ge}`),$&&["mouse","keyboard","touch"].includes(Oe)&&$(be,ge===-1?null:Ie[ge],Oe),!Z.current)return;const Le=Z.current.querySelector(`[role="option"].${n}-focused`);Le&&(Le.classList.remove(`${n}-focused`),Le.classList.remove(`${n}-focusVisible`));let ke=Z.current;if(Z.current.getAttribute("role")!=="listbox"&&(ke=Z.current.parentElement.querySelector('[role="listbox"]')),!ke)return;if(ge===-1){ke.scrollTop=0;return}const bt=Z.current.querySelector(`[data-option-index="${ge}"]`);if(bt&&(bt.classList.add(`${n}-focused`),Oe==="keyboard"&&bt.classList.add(`${n}-focusVisible`),ke.scrollHeight>ke.clientHeight&&Oe!=="mouse"&&Oe!=="touch")){const Ct=bt,cn=ke.clientHeight+ke.scrollTop,vo=Ct.offsetTop+Ct.offsetHeight;vo>cn?ke.scrollTop=vo-ke.clientHeight:Ct.offsetTop-Ct.offsetHeight*(E?1.3:0)<ke.scrollTop&&(ke.scrollTop=Ct.offsetTop-Ct.offsetHeight*(E?1.3:0))}}),Ae=Me(({event:be,diff:ge,direction:Oe="next",reason:Le})=>{if(!lt)return;const bt=je((()=>{const Ct=Ie.length-1;if(ge==="reset")return he;if(ge==="start")return 0;if(ge==="end")return Ct;const cn=de.current+ge;return cn<0?cn===-1&&O?-1:y&&de.current!==-1||Math.abs(ge)>1?0:Ct:cn>Ct?cn===Ct+1&&O?-1:y||Math.abs(ge)>1?Ct:0:cn})(),Oe);if(ze({index:bt,reason:Le,event:be}),r&&ge!=="reset")if(bt===-1)te.current.value=Ce;else{const Ct=K(Ie[bt]);te.current.value=Ct,Ct.toLowerCase().indexOf(Ce.toLowerCase())===0&&Ce.length>0&&te.current.setSelectionRange(Ce.length,Ct.length)}}),Kt=!Tf({array1:ft.filteredOptions,array2:Ie,parser:K}),at=()=>{const be=(ge,Oe)=>{const Le=ge?K(ge):"",ke=Oe?K(Oe):"";return Le===ke};if(de.current!==-1&&!Tf({array1:ft.filteredOptions,array2:Ie,parser:K})&&ft.inputValue===Ce&&(v?ce.length===ft.value.length&&ft.value.every((ge,Oe)=>K(ce[Oe])===K(ge)):be(ft.value,ce))){const ge=ft.filteredOptions[de.current];if(ge)return Ie.findIndex(Oe=>K(Oe)===K(ge))}return-1},Lt=D.useCallback(()=>{if(!lt)return;const be=at();if(be!==-1){de.current=be;return}const ge=v?ce[0]:ce;if(Ie.length===0||ge==null){Ae({diff:"reset"});return}if(Z.current){if(ge!=null){const Oe=Ie[de.current];if(v&&Oe&&ce.findIndex(ke=>L(Oe,ke))!==-1)return;const Le=Ie.findIndex(ke=>L(ke,ge));Le===-1?Ae({diff:"reset"}):ze({index:Le});return}if(de.current>=Ie.length-1){ze({index:Ie.length-1});return}ze({index:de.current})}},[Ie.length,v?!1:ce,x,Ae,ze,lt,Ce,v]),Gt=Me(be=>{ql(Z,be),be&&Lt()});D.useEffect(()=>{Kt&&Lt()},[Lt,Kt]);const ut=be=>{tt||(gt(!0),Pt(!0),_&&_(be))},qn=(be,ge)=>{tt&&(gt(!1),A&&A(be,ge))},bn=(be,ge,Oe,Le)=>{if(v){if(ce.length===ge.length&&ce.every((ke,bt)=>ke===ge[bt]))return}else if(ce===ge)return;N&&N(be,ge,Oe,Le),Pe(ge)},xn=D.useRef(!1),Ln=(be,ge,Oe="selectOption",Le="options")=>{let ke=Oe,bt=ge;if(v){bt=Array.isArray(ce)?ce.slice():[];const Ct=bt.findIndex(cn=>L(ge,cn));Ct===-1?bt.push(ge):Le!=="freeSolo"&&(bt.splice(Ct,1),ke="removeOption")}Ye(be,bt,ke),bn(be,bt,ke,{option:ge}),!m&&(!be||!be.ctrlKey&&!be.metaKey)&&qn(be,ke),(i===!0||i==="touch"&&xn.current||i==="mouse"&&!xn.current)&&te.current.blur()};function go(be,ge){if(be===-1)return-1;let Oe=be;for(;;){if(ge==="next"&&Oe===ce.length||ge==="previous"&&Oe===-1)return-1;const Le=se?"data-item-index":"data-tag-index",ke=J.querySelector(`[${Le}="${Oe}"]`);if(!ke||!ke.hasAttribute("tabindex")||ke.disabled||ke.getAttribute("aria-disabled")==="true")Oe+=ge==="next"?1:-1;else return Oe}}const Yn=(be,ge)=>{if(!v)return;Ce===""&&qn(be,"toggleInput");let Oe=Q;Q===-1?Ce===""&&ge==="previous"&&(Oe=ce.length-1):(Oe+=ge==="next"?1:-1,Oe<0&&(Oe=0),Oe===ce.length&&(Oe=-1)),Oe=go(Oe,ge),ue(Oe),jt(Oe)},Fr=be=>{le.current=!0,Ve(""),R&&R(be,"","clear"),bn(be,v?[]:null,"clear")},yo=be=>ge=>{if(be.onKeyDown&&be.onKeyDown(ge),!ge.defaultMuiPrevented&&(Q!==-1&&!["ArrowLeft","ArrowRight"].includes(ge.key)&&(ue(-1),jt(-1)),ge.which!==229))switch(ge.key){case"Home":lt&&j&&(ge.preventDefault(),Ae({diff:"start",direction:"next",reason:"keyboard",event:ge}));break;case"End":lt&&j&&(ge.preventDefault(),Ae({diff:"end",direction:"previous",reason:"keyboard",event:ge}));break;case"PageUp":ge.preventDefault(),Ae({diff:-Mf,direction:"previous",reason:"keyboard",event:ge}),ut(ge);break;case"PageDown":ge.preventDefault(),Ae({diff:Mf,direction:"next",reason:"keyboard",event:ge}),ut(ge);break;case"ArrowDown":ge.preventDefault(),Ae({diff:1,direction:"next",reason:"keyboard",event:ge}),ut(ge);break;case"ArrowUp":ge.preventDefault(),Ae({diff:-1,direction:"previous",reason:"keyboard",event:ge}),ut(ge);break;case"ArrowLeft":!v&&se?jt(0):Yn(ge,"previous");break;case"ArrowRight":!v&&se?jt(-1):Yn(ge,"next");break;case"Enter":if(de.current!==-1&&lt){const Oe=Ie[de.current],Le=T?T(Oe):!1;if(ge.preventDefault(),Le)return;Ln(ge,Oe,"selectOption"),r&&te.current.setSelectionRange(te.current.value.length,te.current.value.length)}else C&&Ce!==""&&Yt===!1&&(v&&ge.preventDefault(),Ln(ge,Ce,"createOption","freeSolo"));break;case"Escape":lt?(ge.preventDefault(),ge.stopPropagation(),qn(ge,"escape")):c&&(Ce!==""||v&&ce.length>0||se)&&(ge.preventDefault(),ge.stopPropagation(),Fr(ge));break;case"Backspace":if(v&&!G&&Ce===""&&ce.length>0){const Oe=Q===-1?ce.length-1:Q,Le=ce.slice();Le.splice(Oe,1),bn(ge,Le,"removeOption",{option:ce[Oe]})}!v&&se&&!G&&(Pe(null),jt(-1));break;case"Delete":if(v&&!G&&Ce===""&&ce.length>0&&Q!==-1){const Oe=Q,Le=ce.slice();Le.splice(Oe,1),bn(ge,Le,"removeOption",{option:ce[Oe]})}!v&&se&&!G&&(Pe(null),jt(-1));break}},dt=be=>{pt(!0),W&&!le.current&&ut(be)},Ut=be=>{if(t(Z)){te.current.focus();return}pt(!1),oe.current=!0,le.current=!1,s&&de.current!==-1&&lt?Ln(be,Ie[de.current],"blur"):s&&C&&Ce!==""?Ln(be,Ce,"blur","freeSolo"):l&&Ye(be,ce,"blur"),qn(be,"blur")},kr=be=>{const ge=be.target.value;Ce!==ge&&(Ve(ge),Pt(!1),R&&R(be,ge,"input")),ge===""?!f&&!v&&bn(be,null,"clear"):ut(be)},bo=be=>{const ge=Number(be.currentTarget.getAttribute("data-option-index"));de.current!==ge&&ze({event:be,index:ge,reason:"mouse"})},Zt=be=>{ze({event:be,index:Number(be.currentTarget.getAttribute("data-option-index")),reason:"touch"}),xn.current=!0},Nr=be=>{const ge=Number(be.currentTarget.getAttribute("data-option-index"));Ln(be,Ie[ge],"selectOption"),xn.current=!1},xo=be=>ge=>{const Oe=ce.slice();Oe.splice(be,1),bn(ge,Oe,"removeOption",{option:ce[be]})},Tr=be=>{bn(be,null,"removeOption",{option:ce})},Et=be=>{tt?qn(be,"toggleInput"):ut(be)},Ot=be=>{be.currentTarget.contains(be.target)&&be.target.getAttribute("id")!==X&&be.preventDefault()},Bn=be=>{be.currentTarget.contains(be.target)&&(te.current.focus(),pe&&oe.current&&te.current.selectionEnd-te.current.selectionStart===0&&te.current.select(),oe.current=!1)},Lr=be=>{!h&&(Ce===""||!tt)&&Et(be)};let Ir=C&&Ce.length>0;Ir=Ir||(v?ce.length>0:ce!==null);let Br=Ie;return E&&(Br=Ie.reduce((be,ge,Oe)=>{const Le=E(ge);return be.length>0&&be[be.length-1].group===Le?be[be.length-1].options.push(ge):be.push({key:Oe,index:Oe,group:Le,options:[ge]}),be},[])),h&&De&&Ut(),{getRootProps:(be={})=>({...be,onKeyDown:yo(be),onMouseDown:Ot,onClick:Bn}),getInputLabelProps:()=>({id:`${X}-label`,htmlFor:X}),getInputProps:()=>({id:X,value:Ce,onBlur:Ut,onFocus:dt,onChange:kr,onMouseDown:Lr,"aria-activedescendant":lt?"":null,"aria-autocomplete":r?"both":"list","aria-controls":it?`${X}-listbox`:void 0,"aria-expanded":it,autoComplete:"off",ref:te,autoCapitalize:"none",spellCheck:"false",role:"combobox",disabled:h}),getClearProps:()=>({tabIndex:-1,type:"button",onClick:Fr}),getItemProps:({index:be=0}={})=>({...v&&{key:be},...se?{"data-item-index":be}:{"data-tag-index":be},tabIndex:-1,...!G&&{onDelete:v?xo(be):Tr}}),getPopupIndicatorProps:()=>({tabIndex:-1,type:"button",onClick:Et}),getTagProps:({index:be})=>({key:be,"data-tag-index":be,tabIndex:-1,...!G&&{onDelete:xo(be)}}),getListboxProps:()=>({role:"listbox",id:`${X}-listbox`,"aria-labelledby":`${X}-label`,ref:Gt,onMouseDown:be=>{be.preventDefault()}}),getOptionProps:({index:be,option:ge})=>{const Oe=(v?ce:[ce]).some(ke=>ke!=null&&L(ge,ke)),Le=T?T(ge):!1;return{key:w?.(ge)??K(ge),tabIndex:-1,role:"option",id:`${X}-option-${be}`,onMouseMove:bo,onClick:Nr,onTouchStart:Zt,"data-option-index":be,"aria-disabled":Le,"aria-selected":Oe}},id:X,inputValue:Ce,value:ce,dirty:Ir,expanded:lt&&J,popupOpen:lt,focused:De||Q!==-1,anchorEl:J,setAnchorEl:ae,focusedItem:Q,focusedTag:Q,groupedOptions:Br}}function EO(e){return $e("MuiListSubheader",e)}Ee("MuiListSubheader",["root","colorPrimary","colorInherit","gutters","inset","sticky"]);const OO=e=>{const{classes:t,color:n,disableGutters:r,inset:o,disableSticky:s}=e,i={root:["root",n!=="default"&&`color${ve(n)}`,!r&&"gutters",o&&"inset",!s&&"sticky"]};return Re(i,EO,t)},RO=re("li",{name:"MuiListSubheader",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.color!=="default"&&t[`color${ve(n.color)}`],!n.disableGutters&&t.gutters,n.inset&&t.inset,!n.disableSticky&&t.sticky]}})(He(({theme:e})=>({boxSizing:"border-box",lineHeight:"48px",listStyle:"none",color:(e.vars||e).palette.text.secondary,fontFamily:e.typography.fontFamily,fontWeight:e.typography.fontWeightMedium,fontSize:e.typography.pxToRem(14),variants:[{props:{color:"primary"},style:{color:(e.vars||e).palette.primary.main}},{props:{color:"inherit"},style:{color:"inherit"}},{props:({ownerState:t})=>!t.disableGutters,style:{paddingLeft:16,paddingRight:16}},{props:({ownerState:t})=>t.inset,style:{paddingLeft:72}},{props:({ownerState:t})=>!t.disableSticky,style:{position:"sticky",top:0,zIndex:1,backgroundColor:(e.vars||e).palette.background.paper}}]}))),dc=D.forwardRef(function(t,n){const r=We({props:t,name:"MuiListSubheader"}),{className:o,color:s="default",component:i="li",disableGutters:l=!1,disableSticky:c=!1,inset:u=!1,...d}=r,f={...r,color:s,component:i,disableGutters:l,disableSticky:c,inset:u},m=OO(f);return a.jsx(RO,{as:i,className:Te(m.root,o),ref:n,ownerState:f,...d})});dc&&(dc.muiSkipListHighlight=!0);const jO=Xe(a.jsx("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"}));function $O(e){return $e("MuiAutocomplete",e)}const qe=Ee("MuiAutocomplete",["root","expanded","fullWidth","focused","focusVisible","tag","tagSizeSmall","tagSizeMedium","hasPopupIcon","hasClearIcon","inputRoot","input","inputFocused","endAdornment","clearIndicator","popupIndicator","popupIndicatorOpen","popper","popperDisablePortal","paper","listbox","loading","noOptions","option","groupLabel","groupUl"]);var Pf,Ef;const AO=e=>{const{classes:t,disablePortal:n,expanded:r,focused:o,fullWidth:s,hasClearIcon:i,hasPopupIcon:l,inputFocused:c,popupOpen:u,size:d}=e,f={root:["root",r&&"expanded",o&&"focused",s&&"fullWidth",i&&"hasClearIcon",l&&"hasPopupIcon"],inputRoot:["inputRoot"],input:["input",c&&"inputFocused"],tag:["tag",`tagSize${ve(d)}`],endAdornment:["endAdornment"],clearIndicator:["clearIndicator"],popupIndicator:["popupIndicator",u&&"popupIndicatorOpen"],popper:["popper",n&&"popperDisablePortal"],paper:["paper"],listbox:["listbox"],loading:["loading"],noOptions:["noOptions"],option:["option"],groupLabel:["groupLabel"],groupUl:["groupUl"]};return Re(f,$O,t)},FO=re("div",{name:"MuiAutocomplete",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e,{fullWidth:r,hasClearIcon:o,hasPopupIcon:s,inputFocused:i,size:l}=n;return[{[`& .${qe.tag}`]:t.tag},{[`& .${qe.tag}`]:t[`tagSize${ve(l)}`]},{[`& .${qe.inputRoot}`]:t.inputRoot},{[`& .${qe.input}`]:t.input},{[`& .${qe.input}`]:i&&t.inputFocused},t.root,r&&t.fullWidth,s&&t.hasPopupIcon,o&&t.hasClearIcon]}})({[`&.${qe.focused} .${qe.clearIndicator}`]:{visibility:"visible"},"@media (pointer: fine)":{[`&:hover .${qe.clearIndicator}`]:{visibility:"visible"}},[`& .${qe.tag}`]:{margin:3,maxWidth:"calc(100% - 6px)"},[`& .${qe.inputRoot}`]:{[`.${qe.hasPopupIcon}&, .${qe.hasClearIcon}&`]:{paddingRight:30},[`.${qe.hasPopupIcon}.${qe.hasClearIcon}&`]:{paddingRight:56},[`& .${qe.input}`]:{width:0,minWidth:30}},[`& .${Pr.root}`]:{paddingBottom:1,"& .MuiInput-input":{padding:"4px 4px 4px 0px"}},[`& .${Pr.root}.${pn.sizeSmall}`]:{[`& .${Pr.input}`]:{padding:"2px 4px 3px 0"}},[`& .${wn.root}`]:{padding:9,[`.${qe.hasPopupIcon}&, .${qe.hasClearIcon}&`]:{paddingRight:39},[`.${qe.hasPopupIcon}.${qe.hasClearIcon}&`]:{paddingRight:65},[`& .${qe.input}`]:{padding:"7.5px 4px 7.5px 5px"},[`& .${qe.endAdornment}`]:{right:9}},[`& .${wn.root}.${pn.sizeSmall}`]:{paddingTop:6,paddingBottom:6,paddingLeft:6,[`& .${qe.input}`]:{padding:"2.5px 4px 2.5px 8px"}},[`& .${fn.root}`]:{paddingTop:19,paddingLeft:8,[`.${qe.hasPopupIcon}&, .${qe.hasClearIcon}&`]:{paddingRight:39},[`.${qe.hasPopupIcon}.${qe.hasClearIcon}&`]:{paddingRight:65},[`& .${fn.input}`]:{padding:"7px 4px"},[`& .${qe.endAdornment}`]:{right:9}},[`& .${fn.root}.${pn.sizeSmall}`]:{paddingBottom:1,[`& .${fn.input}`]:{padding:"2.5px 4px"}},[`& .${pn.hiddenLabel}`]:{paddingTop:8},[`& .${fn.root}.${pn.hiddenLabel}`]:{paddingTop:0,paddingBottom:0,[`& .${qe.input}`]:{paddingTop:16,paddingBottom:17}},[`& .${fn.root}.${pn.hiddenLabel}.${pn.sizeSmall}`]:{[`& .${qe.input}`]:{paddingTop:8,paddingBottom:9}},[`& .${qe.input}`]:{flexGrow:1,textOverflow:"ellipsis",opacity:0},variants:[{props:{fullWidth:!0},style:{width:"100%"}},{props:{size:"small"},style:{[`& .${qe.tag}`]:{margin:2,maxWidth:"calc(100% - 4px)"}}},{props:{inputFocused:!0},style:{[`& .${qe.input}`]:{opacity:1}}},{props:{multiple:!0},style:{[`& .${qe.inputRoot}`]:{flexWrap:"wrap"}}}]}),NO=re("div",{name:"MuiAutocomplete",slot:"EndAdornment"})({position:"absolute",right:0,top:"50%",transform:"translate(0, -50%)"}),LO=re(Nn,{name:"MuiAutocomplete",slot:"ClearIndicator"})({marginRight:-2,padding:4,visibility:"hidden"}),BO=re(Nn,{name:"MuiAutocomplete",slot:"PopupIndicator",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.popupIndicator,n.popupOpen&&t.popupIndicatorOpen]}})({padding:2,marginRight:-2,variants:[{props:{popupOpen:!0},style:{transform:"rotate(180deg)"}}]}),VO=re(Kc,{name:"MuiAutocomplete",slot:"Popper",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[{[`& .${qe.option}`]:t.option},t.popper,n.disablePortal&&t.popperDisablePortal]}})(He(({theme:e})=>({zIndex:(e.vars||e).zIndex.modal,variants:[{props:{disablePortal:!0},style:{position:"absolute"}}]}))),zO=re(po,{name:"MuiAutocomplete",slot:"Paper"})(He(({theme:e})=>({...e.typography.body1,overflow:"auto"}))),_O=re("div",{name:"MuiAutocomplete",slot:"Loading"})(He(({theme:e})=>({color:(e.vars||e).palette.text.secondary,padding:"14px 16px"}))),WO=re("div",{name:"MuiAutocomplete",slot:"NoOptions"})(He(({theme:e})=>({color:(e.vars||e).palette.text.secondary,padding:"14px 16px"}))),HO=re("ul",{name:"MuiAutocomplete",slot:"Listbox"})(He(({theme:e})=>({listStyle:"none",margin:0,padding:"8px 0",maxHeight:"40vh",overflow:"auto",position:"relative",[`& .${qe.option}`]:{minHeight:48,display:"flex",overflow:"hidden",justifyContent:"flex-start",alignItems:"center",cursor:"pointer",paddingTop:6,boxSizing:"border-box",outline:"0",WebkitTapHighlightColor:"transparent",paddingBottom:6,paddingLeft:16,paddingRight:16,[e.breakpoints.up("sm")]:{minHeight:"auto"},[`&.${qe.focused}`]:{backgroundColor:(e.vars||e).palette.action.hover,"@media (hover: none)":{backgroundColor:"transparent"}},'&[aria-disabled="true"]':{opacity:(e.vars||e).palette.action.disabledOpacity,pointerEvents:"none"},[`&.${qe.focusVisible}`]:{backgroundColor:(e.vars||e).palette.action.focus},'&[aria-selected="true"]':{backgroundColor:e.alpha((e.vars||e).palette.primary.main,(e.vars||e).palette.action.selectedOpacity),[`&.${qe.focused}`]:{backgroundColor:e.alpha((e.vars||e).palette.primary.main,`${(e.vars||e).palette.action.selectedOpacity} + ${(e.vars||e).palette.action.hoverOpacity}`),"@media (hover: none)":{backgroundColor:(e.vars||e).palette.action.selected}},[`&.${qe.focusVisible}`]:{backgroundColor:e.alpha((e.vars||e).palette.primary.main,`${(e.vars||e).palette.action.selectedOpacity} + ${(e.vars||e).palette.action.focusOpacity}`)}}}}))),UO=re(dc,{name:"MuiAutocomplete",slot:"GroupLabel"})(He(({theme:e})=>({backgroundColor:(e.vars||e).palette.background.paper,top:-8}))),qO=re("ul",{name:"MuiAutocomplete",slot:"GroupUl"})({padding:0,[`& .${qe.option}`]:{paddingLeft:24}}),pc=D.forwardRef(function(t,n){const r=We({props:t,name:"MuiAutocomplete"}),{autoComplete:o=!1,autoHighlight:s=!1,autoSelect:i=!1,blurOnSelect:l=!1,ChipProps:c,className:u,clearIcon:d=Pf||(Pf=a.jsx(jO,{fontSize:"small"})),clearOnBlur:f=!r.freeSolo,clearOnEscape:m=!1,clearText:h="Clear",closeText:g="Close",componentsProps:y,defaultValue:b=r.multiple?[]:null,disableClearable:x=!1,disableCloseOnSelect:C=!1,disabled:T=!1,disabledItemsFocusable:w=!1,disableListWrap:M=!1,disablePortal:E=!1,filterOptions:j,filterSelectedOptions:F=!1,forcePopupIcon:O="auto",freeSolo:V=!1,fullWidth:L=!1,getLimitTagsText:v=nt=>`+${nt}`,getOptionDisabled:N,getOptionKey:A,getOptionLabel:$,isOptionEqualToValue:R,groupBy:_,handleHomeEndKeys:z=!r.freeSolo,id:W,includeInputInList:H=!1,inputValue:G,limitTags:se=-1,ListboxComponent:pe,ListboxProps:me,loading:X=!1,loadingText:K="Loading…",multiple:le=!1,noOptionsText:oe="No options",onChange:te,onClose:Z,onHighlightChange:J,onInputChange:ae,onOpen:Q,open:ue,openOnFocus:he=!1,openText:de="Open",options:Se,PaperComponent:ce,PopperComponent:Pe,popupIcon:Ce=Ef||(Ef=a.jsx(mm,{})),readOnly:Ve=!1,renderGroup:De,renderInput:pt,renderOption:Ye,renderTags:tt,renderValue:gt,selectOnFocus:kt=!r.freeSolo,size:Pt="medium",slots:Yt={},slotProps:lt={},value:Ie,...ft}=r,{getRootProps:it,getInputProps:jt,getInputLabelProps:je,getPopupIndicatorProps:ze,getClearProps:Ae,getItemProps:Kt,getListboxProps:at,getOptionProps:Lt,value:Gt,dirty:ut,expanded:qn,id:bn,popupOpen:xn,focused:Ln,focusedItem:go,anchorEl:Yn,setAnchorEl:Fr,inputValue:yo,groupedOptions:dt}=PO({...r,componentName:"Autocomplete"}),Ut=!x&&!T&&ut&&!Ve,kr=(!V||O===!0)&&O!==!1,{onMouseDown:bo}=jt(),{ref:Zt,...Nr}=at(),Tr=$||(nt=>nt.label??nt),Et={...r,disablePortal:E,expanded:qn,focused:Ln,fullWidth:L,getOptionLabel:Tr,hasClearIcon:Ut,hasPopupIcon:kr,inputFocused:go===-1,popupOpen:xn,size:Pt},Ot=AO(Et),Bn={slots:{paper:ce,popper:Pe,...Yt},slotProps:{chip:c,listbox:me,...y,...lt}},[Lr,Ir]=et("listbox",{elementType:HO,externalForwardedProps:Bn,ownerState:Et,className:Ot.listbox,additionalProps:Nr,ref:Zt}),[Br,be]=et("paper",{elementType:po,externalForwardedProps:Bn,ownerState:Et,className:Ot.paper}),[ge,Oe]=et("popper",{elementType:Kc,externalForwardedProps:Bn,ownerState:Et,className:Ot.popper,additionalProps:{disablePortal:E,style:{width:Yn?Yn.clientWidth:null},role:"presentation",anchorEl:Yn,open:xn}});let Le;const ke=nt=>({className:Ot.tag,disabled:T,...Kt(nt)});if(le?Gt.length>0&&(tt?Le=tt(Gt,ke,Et):gt?Le=gt(Gt,ke,Et):Le=Gt.map((nt,Kn)=>{const{key:Jt,...ur}=ke({index:Kn});return a.jsx(om,{label:Tr(nt),size:Pt,...ur,...Bn.slotProps.chip},Jt)})):gt&&Gt!=null&&(Le=gt(Gt,ke,Et)),se>-1&&Array.isArray(Le)){const nt=Le.length-se;!Ln&&nt>0&&(Le=Le.splice(0,se),Le.push(a.jsx("span",{className:Ot.tag,children:v(nt)},Le.length)))}const Ct=De||(nt=>a.jsxs("li",{children:[a.jsx(UO,{className:Ot.groupLabel,ownerState:Et,component:"div",children:nt.group}),a.jsx(qO,{className:Ot.groupUl,ownerState:Et,children:nt.children})]},nt.key)),vo=Ye||((nt,Kn)=>{const{key:Jt,...ur}=nt;return a.jsx("li",{...ur,children:Tr(Kn)},Jt)}),is=(nt,Kn)=>{const Jt=Lt({option:nt,index:Kn});return vo({...Jt,className:Ot.option},nt,{selected:Jt["aria-selected"],index:Kn,inputValue:yo},Et)},as=Bn.slotProps.clearIndicator,Di=Bn.slotProps.popupIndicator;return a.jsxs(D.Fragment,{children:[a.jsx(FO,{ref:n,className:Te(Ot.root,u),ownerState:Et,...it(ft),children:pt({id:bn,disabled:T,fullWidth:!0,size:Pt==="small"?"small":void 0,InputLabelProps:je(),InputProps:{ref:Fr,className:Ot.inputRoot,startAdornment:Le,onMouseDown:nt=>{nt.target===nt.currentTarget&&bo(nt)},...(Ut||kr)&&{endAdornment:a.jsxs(NO,{className:Ot.endAdornment,ownerState:Et,children:[Ut?a.jsx(LO,{...Ae(),"aria-label":h,title:h,ownerState:Et,...as,className:Te(Ot.clearIndicator,as?.className),children:d}):null,kr?a.jsx(BO,{...ze(),disabled:T,"aria-label":xn?g:de,title:xn?g:de,ownerState:Et,...Di,className:Te(Ot.popupIndicator,Di?.className),children:Ce}):null]})}},inputProps:{className:Ot.input,disabled:T,readOnly:Ve,...jt()}})}),Yn?a.jsx(VO,{as:ge,...Oe,children:a.jsxs(zO,{as:Br,...be,children:[X&&dt.length===0?a.jsx(_O,{className:Ot.loading,ownerState:Et,children:K}):null,dt.length===0&&!V&&!X?a.jsx(WO,{className:Ot.noOptions,ownerState:Et,role:"presentation",onMouseDown:nt=>{nt.preventDefault()},children:oe}):null,dt.length>0?a.jsx(Lr,{as:pe,...Ir,children:dt.map((nt,Kn)=>_?Ct({key:nt.key,group:nt.group,children:nt.options.map((Jt,ur)=>is(Jt,nt.index+ur))}):is(nt,Kn))}):null]})}):null]})});Je.extend(gc);function $l(e){switch(e){case"Star":return["Equals","Contains"];case"MinMax":return["Equals","Less Than","Greater Than","Between"];case"DateMinMax":return["Equals","Before","After","Between"];case"Retrieval":return["Semantic Search"];case"Boolean":return["Equals"];case"NONE":default:return[]}}function YO(e){return e==="DateMinMax"}function Al(e){return e==="Between"}function KO({spec:e,values:t,selection:n,onChange:r,retrievalFn:o}){const s=()=>n?.matchType?n.matchType:e.defaultMatchType?e.defaultMatchType:e.filterType==="DateMinMax"?"Between":$l(e.filterType)[0]||"Equals",[i,l]=Y.useState(s()),[c,u]=Y.useState(n?.value??""),[d,f]=Y.useState(n?.value2??""),[m,h]=Y.useState([]),[g,y]=Y.useState(!1),[b,x]=Y.useState(""),[C,T]=Y.useState(!1),[w,M]=Y.useState(!1),E=Y.useRef(null),j=Y.useRef(0),[F,O]=Y.useState(!1);Y.useEffect(()=>{if(e.filterType!=="Retrieval"||!o)return;const H=b.trim();if(H.length<=2){h([]),T(!1);return}return E.current&&clearTimeout(E.current),E.current=setTimeout(async()=>{j.current+=1;const G=j.current;y(!0);try{const se=await o(H,e);G===j.current&&h(se)}catch(se){G===j.current&&(console.error("Retrieval failed",se),h([]))}finally{G===j.current&&(y(!1),T(!0))}},500),()=>{E.current&&clearTimeout(E.current)}},[b,e,o]),Y.useEffect(()=>{n===null?(u(""),f(""),l(e.defaultMatchType??(e.filterType==="DateMinMax"?"Between":$l(e.filterType)[0]||"Equals"))):n&&(l(n.matchType),u(n.value??""),f(n.value2??""))},[n,e.filterType,e.defaultMatchType]);const V=$l(e.filterType),L=YO(e.filterType),v=Al(i),N=L&&t.length>=2&&t[0].value instanceof Date?Je.utc(t[0].value):void 0,A=L&&t.length>=2&&t[1].value instanceof Date?Je.utc(t[1].value):void 0,$=e.filterType==="MinMax"&&t.length>=2&&typeof t[0].value=="number"?t[0].value:void 0,R=e.filterType==="MinMax"&&t.length>=2&&typeof t[1].value=="number"?t[1].value:void 0;if(V.length===0)return null;const _=H=>{const G=H.target.value;l(G),Al(G)||f(""),c&&r({dimensionName:e.dimensionName,source:e.source,filterName:e.filterName,matchType:G,value:c,...Al(G)&&d&&{value2:d}})},z=(H,G)=>{u(H??""),G!==void 0&&f(G??"");const se=Array.isArray(H)&&H.length===0;r(!se&&H!==""&&H!==null&&H!==void 0?{dimensionName:e.dimensionName,source:e.source,filterName:e.filterName,matchType:i,value:H,...v&&G&&{value2:G}}:null)},W=()=>{u(""),f(""),r(null)};return a.jsxs(Tt,{sx:{display:"flex",flexDirection:"column",gap:1.5,fontSize:"0.75rem","& .MuiInputBase-root":{fontSize:"0.75rem"},"& .MuiInputBase-input":{padding:"6px 10px"},"& .MuiSelect-select":{padding:"6px 10px !important"},"& .MuiAutocomplete-input":{padding:"0 !important"},"& .MuiAutocomplete-root .MuiInputBase-root":{padding:"5px 10px",minHeight:"29.5px",boxSizing:"border-box",flexWrap:"wrap"},"& .MuiChip-root":{height:"16px",margin:"0 2px 0 0"},"& .MuiChip-label":{fontSize:"0.7rem",padding:"0 6px"},"& .MuiChip-deleteIcon":{fontSize:"14px",margin:"0 2px 0 -4px"},"& .MuiInputLabel-root":{fontSize:"0.75rem",transform:"translate(10px, 6px) scale(1)"},"& .MuiInputLabel-shrink":{fontSize:"0.85rem",transform:"translate(14px, -9px) scale(0.75)"},"& .MuiOutlinedInput-notchedOutline legend":{fontSize:"0.65rem"},"& .MuiFormHelperText-root":{fontSize:"0.65rem",marginTop:"2px"},"& .MuiSvgIcon-root":{fontSize:"1.25rem"}},children:[a.jsxs(Tt,{sx:{fontWeight:600,color:e.required&&!n?"error.main":"text.primary"},children:[e.label??e.dimensionName,e.required&&a.jsx(Tt,{component:"span",sx:{color:n?"text.secondary":"error.main",fontWeight:400,fontSize:"0.7rem",ml:.5},children:"(required)"})]}),e.filterType!=="Boolean"&&!e.defaultMatchType&&V.length>1&&a.jsxs(Ta,{size:"small",fullWidth:!0,children:[a.jsx(ka,{children:"Match Type"}),a.jsx(Ia,{value:i,label:"Match Type",onChange:_,MenuProps:{PaperProps:{sx:{"& .MuiMenuItem-root":{fontSize:"0.75rem",minHeight:"auto",padding:"4px 10px"}}}},children:V.map(H=>a.jsx(Ft,{value:H,children:H},H))})]}),e.filterType==="Star"&&i==="Equals"&&a.jsx(pc,{multiple:!0,size:"small",options:t,getOptionLabel:H=>typeof H=="string"?H:typeof H=="object"&&H!==null&&"value"in H?String(H.value):String(H),value:Array.isArray(c)?c.map(H=>t.find(G=>G.value===H)||H):c?[t.find(H=>H.value===c)||c]:[],onChange:(H,G)=>{const se=G.map(pe=>typeof pe=="string"?pe:pe&&typeof pe=="object"&&"value"in pe?pe.value:pe);z(se)},noOptionsText:"No matches found",renderInput:H=>a.jsx(Ke,{...H,size:"small",label:"Values",placeholder:"Select values..."}),freeSolo:!e.values||e.values.length===0,slotProps:{paper:{sx:{"& .MuiAutocomplete-option":{fontSize:"0.75rem",minHeight:"auto",padding:"4px 10px"}}}}}),e.filterType==="Star"&&i==="Contains"&&a.jsx(Ke,{size:"small",label:"Search Text",value:c,onChange:H=>u(H.target.value),onBlur:()=>z(c),onKeyDown:H=>{H.key==="Enter"&&z(c)},placeholder:"Enter text to search...",fullWidth:!0}),e.filterType==="Boolean"&&a.jsxs(Ta,{size:"small",fullWidth:!0,children:[a.jsx(ka,{children:"Value"}),a.jsxs(Ia,{value:c===!0?"true":c===!1?"false":"",label:"Value",onChange:H=>{const G=H.target.value;G==="true"?z(!0):G==="false"?z(!1):W()},MenuProps:{PaperProps:{sx:{"& .MuiMenuItem-root":{fontSize:"0.75rem",minHeight:"auto",padding:"4px 10px"}}}},children:[a.jsx(Ft,{value:"",children:a.jsx("em",{children:"Blank"})}),a.jsx(Ft,{value:"true",children:"True"}),a.jsx(Ft,{value:"false",children:"False"})]})]}),e.filterType==="Retrieval"&&i==="Semantic Search"&&a.jsx(pc,{multiple:!0,size:"small",options:m,loading:g,getOptionLabel:H=>typeof H=="string"?H:typeof H=="object"&&H!==null&&"value"in H?String(H.value):String(H),value:Array.isArray(c)?c.map(H=>m.find(se=>se.value===H)||{value:H}):c?[{value:c}]:[],onInputChange:(H,G)=>{x(G)},onChange:(H,G)=>{const se=G.map(pe=>typeof pe=="string"?pe:pe&&typeof pe=="object"&&"value"in pe?pe.value:pe);z(se)},noOptionsText:b.trim().length<=2?"Type at least 3 characters to search":"No matches found",renderInput:H=>a.jsx(Ke,{...H,size:"small",label:"Search Values",placeholder:"Type to search...",onFocus:()=>M(!0),onBlur:()=>M(!1),helperText:w&&!g&&C&&m.length===0?"No matches found":void 0,InputProps:{...H.InputProps,endAdornment:a.jsxs(a.Fragment,{children:[g?a.jsx(Vc,{color:"inherit",size:20}):null,H.InputProps.endAdornment]})}}),freeSolo:!0,filterOptions:H=>H,slotProps:{paper:{sx:{"& .MuiAutocomplete-option":{fontSize:"0.75rem",minHeight:"auto",padding:"4px 10px"}}}}}),e.filterType==="MinMax"&&!v&&a.jsx(Ke,{size:"small",type:"number",label:"Value",value:c,onChange:H=>z(parseFloat(H.target.value)||""),onFocus:()=>O(!0),onBlur:()=>O(!1),placeholder:"Enter number...",fullWidth:!0,inputProps:{min:$,max:R},helperText:F&&$!==void 0&&R!==void 0?`Valid range: [${$} - ${R}]`:void 0}),e.filterType==="MinMax"&&v&&a.jsxs(Tt,{sx:{display:"flex",flexDirection:"column",gap:1},children:[a.jsxs(Tt,{sx:{display:"flex",gap:1,alignItems:"center"},children:[a.jsx(Ke,{size:"small",type:"number",label:"From",value:c,onChange:H=>z(parseFloat(H.target.value)||"",d),onFocus:()=>O(!0),onBlur:()=>O(!1),placeholder:"Min...",fullWidth:!0,inputProps:{min:$,max:d||R}}),a.jsx(Tt,{children:"to"}),a.jsx(Ke,{size:"small",type:"number",label:"To",value:d,onChange:H=>z(c,parseFloat(H.target.value)||""),onFocus:()=>O(!0),onBlur:()=>O(!1),placeholder:"Max...",fullWidth:!0,inputProps:{min:c||$,max:R}})]}),F&&$!==void 0&&R!==void 0&&a.jsxs(rt,{variant:"caption",color:"text.secondary",sx:{mt:-.5,ml:1.5},children:["Valid range: [",$," - ",R,"]"]})]}),L&&!v&&a.jsx(Xo,{dateAdapter:si,children:a.jsx(ro,{label:"Date",value:c instanceof Date?Je.utc(c):null,onChange:H=>{H===null?z(null):H.isValid()&&z(H.utc().toDate())},timezone:"UTC",minDate:c instanceof Date?void 0:N,maxDate:c instanceof Date?void 0:A,referenceDate:i==="After"&&N?N:void 0,slotProps:{textField:{size:"small",fullWidth:!0,sx:{minWidth:150},onFocus:()=>O(!0),onBlur:()=>O(!1),helperText:F&&N&&A?`Valid range: [${N.format("YYYY-MM-DD")} - ${A.format("YYYY-MM-DD")}]`:void 0},openPickerButton:{sx:{backgroundColor:"transparent"}}}})}),L&&v&&a.jsx(Xo,{dateAdapter:si,children:a.jsxs(Tt,{sx:{display:"flex",flexDirection:"column",gap:1},children:[a.jsxs(Tt,{sx:{display:"flex",gap:1,alignItems:"center"},children:[a.jsx(Tt,{sx:{flex:1,minWidth:0},children:a.jsx(ro,{label:"From",value:c instanceof Date?Je.utc(c):null,onChange:H=>{H===null?z(null,d):H.isValid()&&z(H.utc().toDate(),d)},timezone:"UTC",minDate:c instanceof Date?void 0:N,maxDate:d instanceof Date?Je.utc(d):c instanceof Date?void 0:A,referenceDate:N,slotProps:{textField:{size:"small",fullWidth:!0,onFocus:()=>O(!0),onBlur:()=>O(!1)},openPickerButton:{sx:{backgroundColor:"transparent"}}}})}),a.jsx(Tt,{children:"to"}),a.jsx(Tt,{sx:{flex:1,minWidth:0},children:a.jsx(ro,{label:"To",value:d instanceof Date?Je.utc(d):null,onChange:H=>{H===null?z(c,null):H.isValid()&&z(c,H.utc().toDate())},timezone:"UTC",minDate:c instanceof Date?Je.utc(c):d instanceof Date?void 0:N,maxDate:d instanceof Date?void 0:A,referenceDate:c instanceof Date?Je.utc(c):N,slotProps:{textField:{size:"small",fullWidth:!0,onFocus:()=>O(!0),onBlur:()=>O(!1)},openPickerButton:{sx:{backgroundColor:"transparent"}}}})})]}),F&&N&&A&&a.jsxs(rt,{variant:"caption",color:"text.secondary",sx:{mt:-.5,ml:1.5},children:["Valid range: [",N.format("YYYY-MM-DD")," -"," ",A.format("YYYY-MM-DD"),"]"]})]})})]})}function jr(e){return e.replace(/\\/g,"\\\\").replace(/'/g,"\\'")}function GO(e){const t=new Set,n=e.schema?.fields;if(!n)return t;for(const r of n)"kind"in r&&r.kind==="join"&&r.name&&t.add(r.name);return t}function ZO(e){if(!e)return null;for(const t of e)if(t.startsWith("##(filters)")){const n=t.slice(11).trim();try{const r=JSON.parse(n);if(Array.isArray(r)){const o=[];for(const s of r)if(typeof s=="string"){const i=s.indexOf(".");i>0&&i<s.length-1&&o.push({source:s.substring(0,i),dimension:s.substring(i+1)})}if(o.length>0)return{filters:o}}}catch(r){console.error(`Failed to parse "${t}" annotation:`,r)}}return null}function pg(e){if(e.startsWith("#(filter)")){const t=e.slice(9).trim();try{const n=JSON.parse(t);if(n.type)return n}catch(n){console.error(`Failed to parse "${e}" annotation:`,n)}}return null}function XO(e){const t=e.match(/^#\s*label\s*=\s*"([^"]+)"/);return t?t[1]:null}function QO(e){const t=new Map;let n="";for(const r of e)if(r.type==="code"){if(!n&&r.text){const s=r.text.split(`
136
+ `).map(i=>i.trim()).find(i=>i.startsWith("import "))?.match(/['"]([^'"\n]+)['"]/);s&&(n=s[1])}if(r.newSources&&r.newSources.length>0)for(const o of r.newSources)try{const s=JSON.parse(o);s.name&&t.set(s.name,s)}catch(s){console.error("Failed to parse SourceInfo:",s)}}return{sourceInfoMap:t,modelPath:n}}function JO(e,t,n){const r=[];for(const{source:o,dimension:s}of t){const i=e.get(o);if(!i){console.warn(`Source "${o}" not found in notebook sources`),r.push({source:o,model:n,dimensionName:s,filterType:"Star"});continue}const l=i.schema?.fields;if(!l){r.push({source:o,model:n,dimensionName:s,filterType:"Star"});continue}const c=l.find(f=>f.name===s);if(!c){console.warn(`Dimension "${s}" not found in source "${o}"`),r.push({source:o,model:n,dimensionName:s,filterType:"Star"});continue}let u="Star",d;if("annotations"in c&&c.annotations){for(const f of c.annotations)if(f.value){const m=pg(f.value);m&&(u=m.type);const h=XO(f.value);h&&(d=h)}}r.push({source:o,model:n,dimensionName:s,filterType:u,label:d})}return r}function eR(e,t,n){return e.length===0?"":e.map(o=>{const{dimensionName:s,source:i,matchType:l,value:c,value2:u}=o,f=i&&i!==n?`\`${i}\`.\`${s}\``:`\`${s}\``,m=c instanceof Date,h=(g,y=!1)=>g==null?"null":y&&g instanceof Date?`@${g.getFullYear()}-${String(g.getMonth()+1).padStart(2,"0")}-${String(g.getDate()).padStart(2,"0")}`:typeof g=="string"?`'${jr(g)}'`:typeof g=="boolean"?g?"true":"false":String(g);switch(l){case"Equals":case"Semantic Search":return Array.isArray(c)&&c.length>0?`(${c.map(y=>`${f} = ${h(y,m)}`).join(" or ")})`:`${f} = ${h(c,m)}`;case"Contains":return typeof c=="string"?`${f} ~ f'%${jr(c)}%'`:`${f} = ${h(c)}`;case"After":case"Greater Than":return`${f} > ${h(c,m)}`;case"Before":case"Less Than":return`${f} < ${h(c,m)}`;case"Between":return u!==void 0?`${f} >= ${h(c,m)} and ${f} <= ${h(u,m)}`:`${f} >= ${h(c,m)}`;default:return""}}).filter(o=>o.length>0).join(" and ")}function tR(e){const t=e.match(/run\s*:\s*(\w+)\s*->/);if(t)return t[1];const n=e.match(/^\s*(\w+)\s*->/m);return n?n[1]:null}function nR(e,t){return`${e.trimEnd()} + {where: ${t}}`}const fg=Xe(a.jsx("path",{d:"m9.17 6 2 2H20v10H4V6zM10 4H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2h-8z"})),hg=e=>{if(!e)return"Explore semantic models, run queries, and build dashboards";const t=e.replace(/^#+\s+/gm,"").replace(/\*\*(.*?)\*\*/g,"$1").replace(/\*(.*?)\*/g,"$1").replace(/\[([^\]]+)\]\([^)]+\)/g,"$1").replace(/`([^`]+)`/g,"$1").trim(),r=t.split(/\n\s*\n/)[1]||t;if(r.length<=120)return r;const o=r.substring(0,120).split(" ");return o.pop(),o.join(" ")+"..."},mg=(e,t)=>{const n=(e.readme||void 0)?.split(`
137
+ `)??[];return n.length===0&&(n.push(`# ${e.name}`),n.push("")),(e.readme?.length??0)>0&&t?n.splice(2,1,t):t&&n.push(t),n.join(`
138
+ `)};function rR(e={}){const{autoHideDuration:t=null,disableWindowBlurListener:n=!1,onClose:r,open:o,resumeHideDuration:s}=e,i=_a();D.useEffect(()=>{if(!o)return;function x(C){C.defaultPrevented||C.key==="Escape"&&r?.(C,"escapeKeyDown")}return document.addEventListener("keydown",x),()=>{document.removeEventListener("keydown",x)}},[o,r]);const l=Me((x,C)=>{r?.(x,C)}),c=Me(x=>{!r||x==null||i.start(x,()=>{l(null,"timeout")})});D.useEffect(()=>(o&&c(t),i.clear),[o,t,c,i]);const u=x=>{r?.(x,"clickaway")},d=i.clear,f=D.useCallback(()=>{t!=null&&c(s??t*.5)},[t,s,c]),m=x=>C=>{const T=x.onBlur;T?.(C),f()},h=x=>C=>{const T=x.onFocus;T?.(C),d()},g=x=>C=>{const T=x.onMouseEnter;T?.(C),d()},y=x=>C=>{const T=x.onMouseLeave;T?.(C),f()};return D.useEffect(()=>{if(!n&&o)return window.addEventListener("focus",f),window.addEventListener("blur",d),()=>{window.removeEventListener("focus",f),window.removeEventListener("blur",d)}},[n,o,f,d]),{getRootProps:(x={})=>{const C={...en(e),...en(x)};return{role:"presentation",...x,...C,onBlur:m(C),onFocus:h(C),onMouseEnter:g(C),onMouseLeave:y(C)}},onClickAway:u}}function Of(e){return e.substring(2).toLowerCase()}function oR(e,t){return t.documentElement.clientWidth<e.clientX||t.documentElement.clientHeight<e.clientY}function sR(e){const{children:t,disableReactTree:n=!1,mouseEvent:r="onClick",onClickAway:o,touchEvent:s="onTouchEnd"}=e,i=D.useRef(!1),l=D.useRef(null),c=D.useRef(!1),u=D.useRef(!1);D.useEffect(()=>(setTimeout(()=>{c.current=!0},0),()=>{c.current=!1}),[]);const d=Ze(os(t),l),f=Me(g=>{const y=u.current;u.current=!1;const b=zt(l.current);if(!c.current||!l.current||"clientX"in g&&oR(g,b))return;if(i.current){i.current=!1;return}let x;g.composedPath?x=g.composedPath().includes(l.current):x=!b.documentElement.contains(g.target)||l.current.contains(g.target),!x&&(n||!y)&&o(g)}),m=g=>y=>{u.current=!0;const b=t.props[g];b&&b(y)},h={ref:d};return s!==!1&&(h[s]=m(s)),D.useEffect(()=>{if(s!==!1){const g=Of(s),y=zt(l.current),b=()=>{i.current=!0};return y.addEventListener(g,f),y.addEventListener("touchmove",b),()=>{y.removeEventListener(g,f),y.removeEventListener("touchmove",b)}}},[f,s]),r!==!1&&(h[r]=m(r)),D.useEffect(()=>{if(r!==!1){const g=Of(r),y=zt(l.current);return y.addEventListener(g,f),()=>{y.removeEventListener(g,f)}}},[f,r]),D.cloneElement(t,h)}function iR(e){return $e("MuiSnackbarContent",e)}Ee("MuiSnackbarContent",["root","message","action"]);const aR=e=>{const{classes:t}=e;return Re({root:["root"],action:["action"],message:["message"]},iR,t)},lR=re(po,{name:"MuiSnackbarContent",slot:"Root"})(He(({theme:e})=>{const t=e.palette.mode==="light"?.8:.98;return{...e.typography.body2,color:e.vars?e.vars.palette.SnackbarContent.color:e.palette.getContrastText(_l(e.palette.background.default,t)),backgroundColor:e.vars?e.vars.palette.SnackbarContent.bg:_l(e.palette.background.default,t),display:"flex",alignItems:"center",flexWrap:"wrap",padding:"6px 16px",flexGrow:1,[e.breakpoints.up("sm")]:{flexGrow:"initial",minWidth:288}}})),cR=re("div",{name:"MuiSnackbarContent",slot:"Message"})({padding:"8px 0"}),uR=re("div",{name:"MuiSnackbarContent",slot:"Action"})({display:"flex",alignItems:"center",marginLeft:"auto",paddingLeft:16,marginRight:-8}),dR=D.forwardRef(function(t,n){const r=We({props:t,name:"MuiSnackbarContent"}),{action:o,className:s,message:i,role:l="alert",...c}=r,u=r,d=aR(u);return a.jsxs(lR,{role:l,elevation:6,className:Te(d.root,s),ownerState:u,ref:n,...c,children:[a.jsx(cR,{className:d.message,ownerState:u,children:i}),o?a.jsx(uR,{className:d.action,ownerState:u,children:o}):null]})});function pR(e){return $e("MuiSnackbar",e)}Ee("MuiSnackbar",["root","anchorOriginTopCenter","anchorOriginBottomCenter","anchorOriginTopRight","anchorOriginBottomRight","anchorOriginTopLeft","anchorOriginBottomLeft"]);const fR=e=>{const{classes:t,anchorOrigin:n}=e,r={root:["root",`anchorOrigin${ve(n.vertical)}${ve(n.horizontal)}`]};return Re(r,pR,t)},hR=re("div",{name:"MuiSnackbar",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,t[`anchorOrigin${ve(n.anchorOrigin.vertical)}${ve(n.anchorOrigin.horizontal)}`]]}})(He(({theme:e})=>({zIndex:(e.vars||e).zIndex.snackbar,position:"fixed",display:"flex",left:8,right:8,justifyContent:"center",alignItems:"center",variants:[{props:({ownerState:t})=>t.anchorOrigin.vertical==="top",style:{top:8,[e.breakpoints.up("sm")]:{top:24}}},{props:({ownerState:t})=>t.anchorOrigin.vertical!=="top",style:{bottom:8,[e.breakpoints.up("sm")]:{bottom:24}}},{props:({ownerState:t})=>t.anchorOrigin.horizontal==="left",style:{justifyContent:"flex-start",[e.breakpoints.up("sm")]:{left:24,right:"auto"}}},{props:({ownerState:t})=>t.anchorOrigin.horizontal==="right",style:{justifyContent:"flex-end",[e.breakpoints.up("sm")]:{right:24,left:"auto"}}},{props:({ownerState:t})=>t.anchorOrigin.horizontal==="center",style:{[e.breakpoints.up("sm")]:{left:"50%",right:"auto",transform:"translateX(-50%)"}}}]}))),mR=D.forwardRef(function(t,n){const r=We({props:t,name:"MuiSnackbar"}),o=$r(),s={enter:o.transitions.duration.enteringScreen,exit:o.transitions.duration.leavingScreen},{action:i,anchorOrigin:{vertical:l,horizontal:c}={vertical:"bottom",horizontal:"left"},autoHideDuration:u=null,children:d,className:f,ClickAwayListenerProps:m,ContentProps:h,disableWindowBlurListener:g=!1,message:y,onBlur:b,onClose:x,onFocus:C,onMouseEnter:T,onMouseLeave:w,open:M,resumeHideDuration:E,slots:j={},slotProps:F={},TransitionComponent:O,transitionDuration:V=s,TransitionProps:{onEnter:L,onExited:v,...N}={},...A}=r,$={...r,anchorOrigin:{vertical:l,horizontal:c},autoHideDuration:u,disableWindowBlurListener:g,TransitionComponent:O,transitionDuration:V},R=fR($),{getRootProps:_,onClickAway:z}=rR({...$}),[W,H]=D.useState(!0),G=Q=>{H(!0),v&&v(Q)},se=(Q,ue)=>{H(!1),L&&L(Q,ue)},pe={slots:{transition:O,...j},slotProps:{content:h,clickAwayListener:m,transition:N,...F}},[me,X]=et("root",{ref:n,className:[R.root,f],elementType:hR,getSlotProps:_,externalForwardedProps:{...pe,...A},ownerState:$}),[K,{ownerState:le,...oe}]=et("clickAwayListener",{elementType:sR,externalForwardedProps:pe,getSlotProps:Q=>({onClickAway:(...ue)=>{const he=ue[0];Q.onClickAway?.(...ue),!he?.defaultMuiPrevented&&z(...ue)}}),ownerState:$}),[te,Z]=et("content",{elementType:dR,shouldForwardComponentProp:!0,externalForwardedProps:pe,additionalProps:{message:y,action:i},ownerState:$}),[J,ae]=et("transition",{elementType:ii,externalForwardedProps:pe,getSlotProps:Q=>({onEnter:(...ue)=>{Q.onEnter?.(...ue),se(...ue)},onExited:(...ue)=>{Q.onExited?.(...ue),G(...ue)}}),additionalProps:{appear:!0,in:M,timeout:V,direction:l==="top"?"down":"up"},ownerState:$});return!M&&W?null:a.jsx(K,{...oe,...j.clickAwayListener&&{ownerState:le},children:a.jsx(me,{...X,children:a.jsx(J,{...ae,children:d||a.jsx(te,{...Z})})})})});function Rf(){const[e,t]=Y.useState(!1),{apiClients:n}=xe.useServer(),[r,o]=Y.useState(""),s=()=>{t(!0)},i=()=>{t(!1)},l=Rn.useQueryClient(),c=qt({async mutationFn(d){return n.environments.createEnvironment({name:d.name,readme:mg({name:d.name,readme:""},d.description)})},onSuccess(){i(),l.invalidateQueries({queryKey:["environments"]}),o("Environment created successfully")},onError(d){o(d instanceof Error?d.message:"An unknown error occurred")}}),u=async d=>{d.preventDefault();const f=new FormData(d.currentTarget),m=f.get("name")?.toString(),h=f.get("description")?.toString();if(!m)throw new Error("Name is required");c.mutate({name:m,description:h})};return a.jsxs(Y.Fragment,{children:[a.jsx(Dt,{variant:"contained",onClick:s,startIcon:a.jsx(ln.AddCircleRounded,{}),sx:{mt:2},children:"Create New Environment"}),a.jsxs(cr,{open:e,onClose:i,children:[a.jsx(wr,{children:"Create New Environment"}),a.jsxs(lr,{children:[a.jsx(Ii,{children:"Add a new environment to start exploring semantic models and analyzing data."}),a.jsxs("form",{onSubmit:u,id:"environment-form",children:[a.jsx(Ke,{autoFocus:!0,required:!0,margin:"dense",id:"name",name:"name",label:"Environment Name",type:"text",fullWidth:!0,variant:"standard"}),a.jsx(Ke,{margin:"dense",id:"description",name:"description",label:"Environment Description",placeholder:"Explore semantic models, run queries, and build dashboards",type:"text",fullWidth:!0,variant:"standard"})]})]}),a.jsxs(ar,{children:[a.jsx(Dt,{disabled:c.isPending,onClick:i,children:"Cancel"}),a.jsx(Dt,{type:"submit",form:"environment-form",loading:c.isPending,children:"Create Environment"})]})]}),a.jsx(mR,{open:r!=="",autoHideDuration:6e3,onClose:()=>o(""),message:r})]})}function gR({environment:e,onCloseDialog:t}){const[n,r]=Y.useState(!1),{apiClients:o}=xe.useServer(),s=Rn.useQueryClient(),[i,l]=Y.useState(""),c=()=>{r(!0)},u=()=>{r(!1),t()},d=qt({mutationFn:()=>o.environments.deleteEnvironment(e.name),onSuccess(){u(),s.invalidateQueries({queryKey:["environments"]}),l("Environment deleted successfully")},onError(f){l(f instanceof Error?f.message:"An unknown error occurred")}});return a.jsxs(Y.Fragment,{children:[a.jsxs(I.MenuItem,{onClick:c,children:[a.jsx(I.ListItemIcon,{children:a.jsx(ln.Delete,{fontSize:"small"})}),a.jsx(I.ListItemText,{children:"Delete"})]}),a.jsxs(cr,{onClose:u,"aria-labelledby":"customized-dialog-title",open:n,children:[a.jsx(wr,{sx:{m:0,p:2},id:"customized-dialog-title",children:"Delete Environment"}),a.jsx(Nn,{"aria-label":"close",onClick:u,sx:f=>({position:"absolute",right:8,top:8,color:f.palette.grey[500]}),children:a.jsx(ir,{})}),a.jsx(lr,{dividers:!0,children:a.jsxs(rt,{gutterBottom:!0,children:['Are you sure you want to delete "',e.name,'"? This action cannot be undone.']})}),a.jsxs(ar,{children:[a.jsx(Dt,{variant:"outlined",onClick:u,style:{borderColor:xe.MALLOY_BRAND.teal,color:xe.MALLOY_BRAND.teal},children:"Cancel"}),a.jsx(Dt,{loading:d.isPending,variant:"contained",autoFocus:!0,onClick:()=>d.mutate(),color:"error",children:"Delete"})]}),a.jsx(I.Snackbar,{open:i!=="",autoHideDuration:6e3,onClose:()=>l(""),message:i})]})]})}function yR({environment:e,onCloseDialog:t}){const[n,r]=Y.useState(!1),{apiClients:o}=xe.useServer(),s=Rn.useQueryClient(),[i,l]=Y.useState(""),c=()=>{r(!0)},u=()=>{r(!1),t()},d=qt({async mutationFn(m){return o.environments.updateEnvironment(e.name,{name:e.name,readme:mg({name:e.name,readme:e.readme},m.description)})},onSuccess(){u(),s.invalidateQueries({queryKey:["environments"]}),l("Environment updated successfully")},onError(m){l(m instanceof Error?m.message:"An unknown error occurred")}}),f=m=>{m.preventDefault();const g=new FormData(m.currentTarget).get("description")?.toString();d.mutate({description:g})};return a.jsxs(Y.Fragment,{children:[a.jsxs(I.MenuItem,{onClick:c,children:[a.jsx(I.ListItemIcon,{children:a.jsx(ln.Edit,{fontSize:"small"})}),a.jsx(I.ListItemText,{children:"Edit"})]}),a.jsxs(cr,{open:n,onClose:u,children:[a.jsx(wr,{children:"Edit Environment"}),a.jsxs(lr,{children:[a.jsx(Ii,{children:"Edit this environment's description."}),a.jsxs("form",{onSubmit:f,id:"environment-form",children:[a.jsx(Ke,{autoFocus:!0,required:!0,margin:"dense",id:"name",name:"name",label:"Environment Name",disabled:!0,type:"text",fullWidth:!0,variant:"standard",defaultValue:e.name}),a.jsx(Ke,{margin:"dense",id:"description",name:"description",label:"Environment Description",type:"text",fullWidth:!0,variant:"standard",defaultValue:hg(e.readme)})]})]}),a.jsxs(ar,{children:[a.jsx(Dt,{disabled:d.isPending,onClick:u,children:"Cancel"}),a.jsx(Dt,{type:"submit",form:"environment-form",loading:d.isPending,children:"Save Changes"})]})]}),a.jsx(I.Snackbar,{open:i!=="",autoHideDuration:6e3,onClose:()=>l(""),message:i})]})}const bR=[{title:"Ad-hoc analysis",body:"Browse the semantic sources on this server and build nested queries in Explorer. Every click writes valid Malloy, so metrics stay correct even across joins.",href:Hn.explorer},{title:"Notebooks",body:"A data story: markdown and live query cells in one file, versioned beside the model it reads. Any givens it imports become a panel of filter controls above the cells.",href:Hn.surfaces},{title:"Dashboards",body:"A tagged Malloy file is the page. Tags lay out the grid, the filter row is rendered from the query's parameters, and a tagged dimension clicks through to a detail page. No front-end code.",href:Hn.dashboards},{title:"Data apps",body:"Hand-author an HTML page in a package's public directory and Publisher serves it, backed by that package's models. No build step, and it embeds in a host page.",href:Hn.dataApps},{title:"AI data agents",body:"One MCP endpoint. Agents discover the sources, compile-check the Malloy they write, and ask well-formed questions instead of guessing at raw tables.",href:Hn.mcpAgents},{title:"Governed access",body:"Runtime parameters, row-level filters, and per-source access gates are declared in the model, so every surface reads the same rules rather than reimplementing them.",href:Hn.givens}];function Gi({href:e,children:t}){return a.jsx(I.Box,{component:"a",href:e,target:"_blank",rel:"noopener noreferrer",sx:{color:"text.primary",textDecoration:"underline"},children:t})}function xR({onClickEnvironment:e}){const{apiClients:t,mutable:n,server:r}=xe.useServer(),{data:o,isSuccess:s,isError:i,error:l}=vt({queryKey:["environments"],queryFn:()=>t.environments.listEnvironments()});if(i)return a.jsx(_t,{error:l,context:"Environments List"});if(!s)return a.jsx(Ht,{text:"Loading environments..."});const c=o.data??[];return a.jsxs(I.Container,{maxWidth:"md",sx:{py:6},children:[a.jsxs(I.Box,{sx:{mb:5},children:[a.jsx(I.Typography,{variant:"h3",component:"h1",sx:{fontWeight:500,letterSpacing:"-0.025em",mb:1},children:"Publisher"}),a.jsx(I.Typography,{variant:"body1",color:"text.secondary",sx:{mb:3},children:"The open-source semantic model server for the Malloy data language."}),a.jsx(I.Typography,{variant:"body2",color:"text.secondary",sx:{maxWidth:720,lineHeight:1.6},children:"Define semantic models once and use them everywhere. Publisher serves Malloy models over a REST API and a single MCP endpoint, so applications, BI tools, and AI agents compose queries against the model instead of writing SQL, and the numbers come back right by construction."})]}),a.jsx(I.Grid,{container:!0,spacing:4,sx:{mb:5},children:bR.map(u=>a.jsx(I.Grid,{size:{xs:12,sm:6},children:a.jsxs(I.Stack,{spacing:1,children:[a.jsx(I.Typography,{variant:"body2",component:"a",href:u.href,target:"_blank",rel:"noopener noreferrer",sx:{fontWeight:500,color:"text.primary",textDecoration:"none","&:hover":{textDecoration:"underline"}},children:u.title}),a.jsx(I.Typography,{variant:"body2",color:"text.secondary",sx:{lineHeight:1.6},children:u.body})]})},u.title))}),a.jsx(I.Divider,{sx:{my:4}}),c.length>0?a.jsxs(I.Box,{sx:{mb:4},children:[a.jsxs(I.Stack,{direction:"row",justifyContent:"space-between",alignItems:"flex-start",sx:{mb:3},children:[a.jsxs(I.Box,{children:[a.jsx(I.Typography,{variant:"h5",sx:{fontWeight:500,letterSpacing:"-0.025em",mb:.5},children:"Environments"}),a.jsx(I.Typography,{variant:"body2",color:"text.secondary",children:"Published environments available on this server"})]}),n&&a.jsx(Rf,{})]}),a.jsx(I.Grid,{container:!0,spacing:2,children:c.map(u=>a.jsx(I.Grid,{size:{xs:12,sm:6,md:4},children:a.jsx(vR,{environment:u,onClickEnvironment:e})},u.name))})]}):a.jsxs(I.Box,{sx:{mb:4},children:[a.jsx(I.Typography,{variant:"h5",sx:{fontWeight:500,letterSpacing:"-0.025em",mb:1},children:"Get started"}),a.jsx(I.Typography,{variant:"body2",color:"text.secondary",sx:{mb:3,maxWidth:600},children:"Create your first Malloy environment to start exploring semantic models and building data experiences."}),n?a.jsx(Rf,{}):a.jsx(I.Button,{variant:"contained",color:"primary",href:Hn.publishing,target:"_blank",rel:"noopener noreferrer",children:"Learn how to create models"})]}),a.jsx(I.Divider,{sx:{my:4}}),a.jsxs(I.Typography,{variant:"body2",color:"text.secondary",sx:{maxWidth:720,lineHeight:1.6},children:["Also here:"," ",a.jsx(Gi,{href:Hn.connections,children:"connections"})," to BigQuery, Snowflake, Postgres, MySQL, Trino, DuckDB and more;"," ",a.jsx(Gi,{href:Hn.materialization,children:"materialized tables"})," ","built on demand or on a schedule; and a"," ",a.jsx(Gi,{href:`${lu(r)}/api-doc.html`,children:"REST API"})," ","that does everything this console does."]}),a.jsxs(I.Typography,{variant:"body2",color:"text.secondary",sx:{maxWidth:720,lineHeight:1.6,mt:2},children:["Publisher is built on fully open infrastructure and designed for the AI era. Join the"," ",a.jsx(Gi,{href:"https://join.slack.com/t/malloy-community/shared_invite/zt-1kgfwgi5g-CrsdaRqs81QY67QW0~t_uw",children:"Malloy Slack community"})," ","to ask questions, share ideas, and contribute."]})]})}function vR({environment:e,onClickEnvironment:t}){const{mutable:n}=xe.useServer(),[r,o]=Y.useState(null),s=!!r,i=hg(e.readme),l=d=>{e.name&&t&&t(`/${e.name}/`,d)},c=d=>{d.stopPropagation(),o(d.currentTarget)},u=()=>{o(null)};return a.jsx(I.Card,{variant:"outlined",onClick:l,sx:{height:"100%",cursor:"pointer",borderRadius:3,borderColor:"divider",boxShadow:"none",transition:"all 0.2s ease-in-out","&:hover":{boxShadow:2,borderColor:"primary.main"}},children:a.jsx(I.CardContent,{sx:{p:2.5,"&:last-child":{pb:2.5}},children:a.jsxs(I.Box,{sx:{display:"flex",alignItems:"flex-start",gap:1.5},children:[a.jsx(I.Box,{sx:d=>({width:36,height:36,borderRadius:1.5,bgcolor:d.palette.mode==="dark"?"rgba(255, 255, 255, 0.08)":"grey.100",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0,color:"text.primary"}),children:a.jsx(fg,{sx:{fontSize:20}})}),a.jsxs(I.Box,{sx:{flex:1,minWidth:0},children:[a.jsx(I.Typography,{variant:"subtitle1",component:"h6",noWrap:!0,sx:{fontWeight:600,mb:.5},children:e.name}),a.jsx(I.Tooltip,{title:i,followCursor:!0,enterDelay:1e3,children:a.jsx(I.Typography,{variant:"body2",color:"text.secondary",sx:{overflow:"hidden",textOverflow:"ellipsis",display:"-webkit-box",WebkitLineClamp:2,WebkitBoxOrient:"vertical",lineHeight:1.5},children:i})})]}),n&&a.jsxs(a.Fragment,{children:[a.jsx(I.IconButton,{size:"small",onClick:c,"aria-label":`Environment actions for ${e.name}`,sx:{flexShrink:0,mt:-.5,mr:-.5},children:a.jsx(ln.MoreVert,{fontSize:"small"})}),a.jsxs(I.Menu,{anchorEl:r,open:s,onClose:u,onClick:d=>d.stopPropagation(),anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},children:[a.jsx(yR,{environment:e,onCloseDialog:u}),a.jsx(gR,{environment:e,onCloseDialog:u})]})]})]})})})}const gg=Xe(a.jsx("path",{d:"M17 7h-4v2h4c1.65 0 3 1.35 3 3s-1.35 3-3 3h-4v2h4c2.76 0 5-2.24 5-5s-2.24-5-5-5m-6 8H7c-1.65 0-3-1.35-3-3s1.35-3 3-3h4V7H7c-2.76 0-5 2.24-5 5s2.24 5 5 5h4zm-3-4h8v2H8z"})),Pa=Xe(a.jsx("path",{d:"M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14"})),SR=Xe(a.jsx("path",{d:"M8 5v14l11-7z"})),Fl={scopeName:"source.malloy",patterns:[{include:"#malloy-language"}],repository:{"malloy-language":{patterns:[{include:"#sql-string"},{include:"#comments"},{include:"#tags"},{include:"#strings"},{include:"#numbers"},{include:"#keywords"},{include:"#properties"},{include:"#functions"},{include:"#datetimes"},{include:"#identifiers-quoted"},{include:"#types"},{include:"#constants"},{include:"#timeframes"},{include:"#identifiers-unquoted"}]},"malloy-matched":{begin:"{",end:"}",patterns:[{include:"#malloy-matched"},{include:"#malloy-language"}]},"malloy-in-sql":{begin:"%{",name:"source.malloy-in-sql",end:"}%?",patterns:[{include:"#malloy-matched"},{include:"#malloy-language"}]},"sql-string":{patterns:[{begin:'(\\b[A-Za-z_][A-Za-z_0-9]*)(\\s*\\.\\s*)(sql)(\\s*\\(\\s*)(""")',end:'"""',beginCaptures:{1:{name:"variable.other"},3:{name:"keyword.control.sql"},5:{name:"punctuation.sql-block.open"}},endCaptures:{0:{name:"punctuation.sql-block.close"}},name:"source.sql",patterns:[{include:"#malloy-in-sql"},{include:"source.sql"}]}]},functions:{patterns:[{match:"(?i)\\b(count)(\\s*\\()(distinct)",captures:{1:{name:"entity.name.function"},3:{name:"entity.name.function.modifier"}}},{match:"(?i)\\b(AVG|COUNT|FIRST|FORMAT|LAST|LCASE|LEN|MAX|MID|MIN|MOD|NOW|ROUND|SUM|UCASE|UNGROUPED)(\\s*\\()",captures:{1:{name:"entity.name.function"}}},{match:"(?i)\\b([a-zA-Z_][a-zA-Z_0-9]*)(\\s*\\()",captures:{1:{name:"entity.name.function"}}},{match:"(?i)\\b([a-zA-Z_][a-zA-Z_0-9]*)(!)(timestamp|number|string|boolean|date)?(\\s*\\()",captures:{1:{name:"entity.name.function"},3:{name:"entity.name.type"}}}]},datetimes:{patterns:[{match:"(?i)@[0-9]{4}-[0-9]{2}-[0-9]{2}[ T][0-9]{2}:[0-9]{2}((:[0-9]{2})(([\\.,][0-9]+)(\\[[A-Za-z_/]+\\])?)?)?",name:"constant.numeric.timestamp"},{match:"(?i)@[0-9]{4}(-Q[1-4]|-[0-9]{2}(-[0-9]{2}(-WK)?)?)?",name:"constant.numeric.date"}]},"identifiers-quoted":{patterns:[{match:"`[^`]*`",name:"variable.other.quoted"}]},"identifiers-unquoted":{patterns:[{match:"(?i)\\b[A-Za-z_][A-Za-z_0-9]*\\b",name:"variable.other"}]},timeframes:{patterns:[{match:"(?i)\\b((year|quarter|month|week|day|hour|minute|second)s?)\\b",name:"keyword.other.timeframe"},{match:"(?i)\\b(day_of_year|day_of_month)\\b",name:"keyword.other.timeframe"}]},comments:{patterns:[{begin:"/\\*",end:"\\*/",beginCaptures:{0:{name:"punctuation.definition.comment.begin"}},endCaptures:{0:{name:"punctuation.definition.comment.end"}},name:"comment.block"},{begin:"//",end:"\\n",beginCaptures:{0:{name:"punctuation.definition.comment"}},name:"comment.line.double-slash"},{begin:"--",end:"\\n",beginCaptures:{0:{name:"punctuation.definition.comment"}},name:"comment.line.double-hyphen"}]},tags:{patterns:[{match:"##\\n",name:"string.quoted",captures:{0:{name:"string.quoted"}}},{begin:'#"',end:"\\n",beginCaptures:{0:{name:"punctuation.definition.comment"}},name:"comment.line.double-slash"},{match:"#\\n",name:"string.quoted",captures:{0:{name:"string.quoted"}}},{begin:"#\\s",end:"\\n",beginCaptures:{0:{name:"support.type.property-name.json"}},name:"comment.line.double-slash",patterns:[{include:"#tag-values"}]},{begin:"##\\s",end:"\\n",beginCaptures:{0:{name:"support.type.property-name.json"}},name:"comment.line.double-slash",patterns:[{include:"#tag-values"}]},{begin:"#",end:"\\n",beginCaptures:{0:{name:"string.quoted"}},name:"string.quoted"}],repository:{"tag-values":{name:"support.type.property-name.json",match:'(-)?((?:[^\\s=#]+)|(?:"[^#]+"))(?:\\s*(=)\\s*((?:[^\\s=#]+)|(?:"[^#]+")))?',captures:{1:{name:"keyword.control.negate"},2:{name:"support.type.property-name.json"},3:{name:"keyword.operator.comparison.ts"},4:{name:"string.quoted"}}}}},strings:{patterns:[{begin:"'",end:"'",beginCaptures:{0:{name:"punctuation.definition.string.begin"}},endCaptures:{0:{name:"punctuation.definition.string.end"}},name:"string.quoted.single",patterns:[{include:"#escapes"}]},{begin:'"',end:'"',beginCaptures:{0:{name:"punctuation.definition.string.begin"}},endCaptures:{0:{name:"punctuation.definition.string.end"}},name:"string.quoted.double",patterns:[{include:"#escapes"}]},{begin:'"""',end:'"""',beginCaptures:{0:{name:"punctuation.definition.string.begin"}},endCaptures:{0:{name:"punctuation.definition.string.end"}},name:"string.quoted.triple"},{begin:"(?i)[r|/]'",end:"'",name:"string.regexp",patterns:[{include:"#regex-escapes"}]}],repository:{escapes:{name:"constant.character.escape",match:"\\\\(u[A-Fa-f0-9]{4}|.)",captures:{0:{name:"constant.character.escape"}}},"regex-escapes":{name:"constant.character.escape",match:"\\\\.",captures:{0:{name:"constant.character.escape"}}}}},numbers:{match:"(?i)(\\b((0|[1-9][0-9]*)(E[+-]?[0-9]+|\\.[0-9]*)?)|\\.[0-9]+)",name:"constant.numeric"},constants:{patterns:[{match:"(?i)\\bnull\\b",name:"constant.language.null"},{match:"(?i)\\btrue\\b",name:"constant.language.true"},{match:"(?i)\\bfalse\\b",name:"constant.language.false"}]},types:{patterns:[{match:"(?i)\\bstring\\b",name:"entity.name.type.string"},{match:"(?i)\\bnumber\\b",name:"entity.name.type.number"},{match:"(?i)\\bdate\\b",name:"entity.name.type.date"},{match:"(?i)\\btimestamp\\b",name:"entity.name.type.timestamp"},{match:"(?i)\\bboolean\\b",name:"entity.name.type.boolean"}]},properties:{patterns:[{match:"(?i)\\baccept\\b",name:"keyword.control.accept"},{match:"(?i)\\bselect\\b",name:"keyword.control.select"},{match:"(?i)\\bconnection\\b",name:"keyword.control.connection"},{match:"(?i)\\brun\\b",name:"keyword.control.run"},{match:"(?i)\\bextend\\b",name:"keyword.control.extend"},{match:"(?i)\\brefine\\b",name:"keyword.control.refine"},{match:"(?i)\\baggregate\\b",name:"keyword.control.aggregate"},{match:"(?i)\\bsample\\b",name:"keyword.control.sample"},{match:"(?i)\\bcalculate\\b",name:"keyword.control.calculate"},{match:"(?i)\\btimezone\\b",name:"keyword.control.timezone"},{match:"(?i)\\bdimension\\b",name:"keyword.control.dimension"},{match:"(?i)\\bexcept\\b",name:"keyword.control.except"},{match:"(?i)\\bsource\\b",name:"keyword.control.source"},{match:"(?i)\\bgroup_by\\b",name:"keyword.control.group_by"},{match:"(?i)\\bhaving\\b",name:"keyword.control.having"},{match:"(?i)\\bindex\\b",name:"keyword.control.index"},{match:"(?i)\\bjoin_one\\b",name:"keyword.control.join_one"},{match:"(?i)\\bwith\\b",name:"keyword.control.with"},{match:"(?i)\\bjoin_many\\b",name:"keyword.control.join_many"},{match:"(?i)\\bjoin_cross\\b",name:"keyword.control.join_cross"},{match:"(?i)\\blimit\\b",name:"keyword.control.limit"},{match:"(?i)\\bmeasure\\b",name:"keyword.control.measure"},{match:"(?i)\\bnest\\b",name:"keyword.control.nest"},{match:"(?i)\\border_by\\b",name:"keyword.control.order_by"},{match:"(?i)\\bpartition_by\\b",name:"keyword.control.partition_by"},{match:"(?i)\\bprimary_key\\b",name:"keyword.control.primary_key"},{match:"(?i)\\bproject\\b",name:"keyword.control.project"},{match:"(?i)\\bquery\\b",name:"keyword.control.query"},{match:"(?i)\\brename\\b",name:"keyword.control.rename"},{match:"(?i)\\btop\\b",name:"keyword.control.top"},{match:"(?i)\\bview\\b",name:"keyword.control.view"},{match:"(?i)\\bwhere\\b",name:"keyword.control.where"},{match:"(?i)\\bdeclare\\b",name:"keyword.control.declare"}]},keywords:{patterns:[{match:"(?i)\\bis\\b",name:"keyword.control.is"},{match:"(?i)\\bon\\b",name:"keyword.control.on"},{match:"(?i)\\bnot\\b",name:"keyword.other.not"},{match:"(?i)\\bor\\b",name:"keyword.other.or"},{match:"(?i)\\bdesc\\b",name:"keyword.control.desc"},{match:"(?i)\\bby\\b",name:"keyword.control.by"},{match:"(?i)\\band\\b",name:"keyword.other.and"},{match:"(?i)\\basc\\b",name:"keyword.control.asc"},{match:"(?i)\\bfor\\b",name:"keyword.other.for"},{match:"(?i)\\belse\\b",name:"keyword.other.else"},{match:"(?i)\\bto\\b",name:"keyword.other.to"},{match:"(?i)\\bwhen\\b",name:"keyword.other.when"},{match:"(?i)\\bpick\\b",name:"keyword.other.pick"},{match:"(?i)\\bimport\\b",name:"keyword.control.import"}]}}},CR={...Fl,patterns:[...Fl.patterns,{include:"#docvar"}],repository:{...Fl.repository,docvar:{patterns:[{match:"\\<\\<[^(\\>\\>)]*\\>\\>",beginCaptures:{0:{name:"punctuation.definition.comment.begin"}},endCaptures:{0:{name:"punctuation.definition.comment.end"}},name:"markup.italic.markdown"}]}}},wR={name:"Malloy SQL",scopeName:"source.malloy-sql",patterns:[{include:"#malloysql-sql"}],repository:{"malloysql-sql":{beginCaptures:{0:{name:"entity.other.attribute.malloy-sql"},1:{name:"entity.other.attribute.malloy-sql"},3:{name:"comment.line.double-slash"}},name:"meta.embedded.block.malloysql.sql",patterns:[{include:"#comments"},{begin:"%{",end:"}%",beginCaptures:{0:{name:"punctuation.definition.malloy-sql"}},endCaptures:{0:{name:"punctuation.definition.malloy-sql"}},name:"meta.embedded.block.malloy",patterns:[{include:"source.malloy"}]},{include:"source.sql"}]},comments:{patterns:[{begin:"/\\*",end:"\\*/",beginCaptures:{0:{name:"punctuation.definition.comment.begin"}},endCaptures:{0:{name:"punctuation.definition.comment.end"}},name:"comment.block"},{begin:"//",end:"\\n",beginCaptures:{0:{name:"punctuation.definition.comment"}},name:"comment.line.double-slash"},{begin:"--",end:"\\n",beginCaptures:{0:{name:"punctuation.definition.comment"}},name:"comment.line.double-hyphen"}]}}},kR="github-light",TR="github-dark";let Nl;function IR(){return Nl||(Nl=(async()=>{const[{createHighlighterCore:e},{createOnigurumaEngine:t},{default:n},{default:r},{default:o},{default:s},{default:i}]=await Promise.all([Promise.resolve().then(()=>require("./core-8NVBCLZh.cjs.js")),Promise.resolve().then(()=>require("./engine-oniguruma-BkproSVE.cjs.js")),Promise.resolve().then(()=>require("./sql-BqWZrLHB.cjs.js")),Promise.resolve().then(()=>require("./json-y-J1j5EW.cjs.js")),Promise.resolve().then(()=>require("./typescript-BqvpT6pB.cjs.js")),Promise.resolve().then(()=>require("./github-light-BFTOhCbz.cjs.js")),Promise.resolve().then(()=>require("./github-dark-BKL9xNgN.cjs.js"))]);return e({engine:t(Promise.resolve().then(()=>require("./wasm-Dw4u1m6u.cjs.js"))),themes:[s,i],langs:[n,r,o,{name:"malloy",scopeName:"source.malloy",embeddedLangs:["sql"],...CR},{name:"malloysql",scopeName:"source.malloy-sql",embeddedLangs:["sql"],...wR}]})})()),Nl}async function fc(e,t,n="light"){return(await IR()).codeToHtml(e,{lang:t,theme:n==="dark"?TR:kR})}function yg({open:e,onClose:t,result:n,title:r="Results",renderLogs:o,drill:s}){return a.jsxs(I.Dialog,{open:e,onClose:t,maxWidth:!1,fullWidth:!0,sx:{"& .MuiDialog-paper":{width:"95vw",height:"95vh",maxWidth:"none"}},children:[a.jsxs(I.DialogTitle,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[r,a.jsx(I.IconButton,{onClick:t,sx:{color:"text.secondary"},children:a.jsx(ir,{})})]}),a.jsx(I.DialogContent,{sx:{height:"calc(95vh - 120px)",overflow:"auto",padding:"0 16px"},children:a.jsx(ss,{result:n,maxHeight:Bm,maxResultSize:1e6,renderLogs:o,drill:s})})]})}function MR({queryName:e,annotations:t,resourceUri:n,runOnDemand:r=!1,maxResultSize:o=0}){const[s,i]=Y.useState(),[l,c]=Y.useState(!1),[u,d]=Y.useState(!1),{packageName:f,environmentName:m,versionId:h,modelPath:g}=St(n),{apiClients:y}=xe.useServer(),{data:b,isSuccess:x,isLoading:C}=vt({queryKey:["namedQueryResult",n,e],queryFn:()=>y.models.executeQueryModel(m,f,g,{query:void 0,sourceName:void 0,queryName:e,versionId:h}),enabled:r?u:!0,...xe.CHART_RESULT_QUERY_OPTIONS}),{mode:T}=xe.usePublisherTheme();return Y.useEffect(()=>{if(t&&t.length>0){const w=t.map(M=>`// ${M}`).join(`
139
+ `);fc(w,"typescript",T).then(M=>{i(M)})}},[t,T]),a.jsxs(xe.CleanNotebookCell,{children:[s&&a.jsx(I.Box,{sx:{marginBottom:"16px"},children:a.jsx(I.Typography,{fontSize:"12px",sx:{fontSize:"12px","& .line":{textWrap:"wrap"}},children:a.jsx("div",{className:"content",dangerouslySetInnerHTML:{__html:s}})})}),a.jsxs(I.Box,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"8px"},children:[a.jsx(I.Typography,{variant:"body2",sx:{fontSize:"15px",fontWeight:"600",color:"#495057",padding:"8px 16px",backgroundColor:"#f8f9fa",borderRadius:"6px",border:"1px solid #e9ecef"},children:e}),a.jsx(I.IconButton,{sx:{backgroundColor:"rgba(255, 255, 255, 0.9)","&:hover":{backgroundColor:"rgba(255, 255, 255, 1)"},width:"32px",height:"32px"},onClick:()=>c(!0),children:a.jsx(Pa,{sx:{fontSize:"18px",color:"text.secondary"}})})]}),a.jsxs(xe.CleanMetricCard,{sx:{position:"relative"},children:[r&&!u&&a.jsxs(I.Box,{sx:{padding:"40px 20px",textAlign:"center",display:"flex",flexDirection:"column",alignItems:"center",gap:"16px"},children:[a.jsx(I.Typography,{variant:"body2",color:"text.secondary",children:"Click Run to execute the query"}),a.jsx(I.Button,{variant:"contained",startIcon:a.jsx(SR,{}),onClick:()=>d(!0),sx:{backgroundColor:"#1976d2","&:hover":{backgroundColor:"#1565c0"},textTransform:"none",fontSize:"14px",fontWeight:600,padding:"8px 24px"},children:"Run Query"})]}),(!r||u)&&C&&a.jsx(I.Box,{sx:{padding:"20px",textAlign:"center"},children:a.jsx(I.Typography,{children:"Loading results..."})}),(!r||u)&&x&&b?.data?.result&&a.jsx(ss,{result:b.data.result,maxHeight:Lm,maxResultSize:o,renderLogs:b.data.renderLogs})]}),a.jsx(yg,{open:l,onClose:()=>c(!1),result:b?.data?.result||"",renderLogs:b?.data?.renderLogs,title:`Query: ${e}`})]})}function bg({sourceAndPaths:e,selectedSourceIndex:t,existingQuery:n,onQueryChange:r,onSourceChange:o,resourceUri:s}){return Y.useEffect(()=>{o&&o(t)},[t,o]),a.jsx(xe.StyledCardMedia,{children:a.jsxs(st.Stack,{spacing:2,component:"section",children:[a.jsx(PR,{sourceAndPath:e[t],existingQuery:n,onChange:i=>{r&&r(i)},resourceUri:s}),a.jsx(st.Box,{height:"5px"})]})})}function Ll(){return{query:void 0,malloyQuery:void 0,malloyResult:void 0}}function DR({sourceAndPath:e,onChange:t,existingQuery:n,explorerComponents:r,QueryBuilder:o,resourceUri:s}){const[i,l]=Y.useState(n||Ll()),[c,u]=Y.useState(void 0);Y.useEffect(()=>{n&&l(n)},[n]);const[d,f]=Y.useState([]),{MalloyExplorerProvider:m,QueryPanel:h,ResizableCollapsiblePanel:g,ResultPanel:y,SourcePanel:b}=r;Y.useEffect(()=>{t&&t(i)},[t,i]);const{environmentName:x,packageName:C,versionId:T}=St(s),{apiClients:w}=xe.useServer(),M=qt({mutationFn:()=>{const O=typeof i?.malloyQuery=="string"?i.malloyQuery:new o.ASTQuery({source:e.sourceInfo,query:i?.malloyQuery}).toMalloy();return u({executionState:"running",query:i?.malloyQuery,queryResolutionStartMillis:Date.now(),onCancel:()=>{M.reset(),u(void 0)},response:{result:{}}}),l({...i,query:O}),w.models.executeQueryModel(x,C,e.modelPath,{query:O,sourceName:void 0,queryName:void 0,versionId:T})},onSuccess:O=>{if(O){const V=JSON.parse(O.data.result);l({...i,malloyResult:V}),u(L=>L?{...L,executionState:"finished",response:{result:V}}:void 0)}},onError:O=>{u(void 0),console.error("Query execution error:",O)}}),[E,j]=Y.useState(e.sourceInfo.name);Y.useEffect(()=>{E!==e.sourceInfo.name&&(j(e.sourceInfo.name),l(Ll()),u(void 0))},[e,E]);const F=Y.useCallback(O=>{l({...i,malloyQuery:O,malloyResult:void 0})},[i]);return E!==e.sourceInfo.name?a.jsx("div",{children:"Loading..."}):a.jsx(xe.StyledExplorerContent,{sx:{border:"1px solid #e0e0e0",borderRadius:"8px",overflow:"hidden"},children:a.jsx(m,{source:e.sourceInfo,query:i?.malloyQuery,topValues:[],onFocusedNestViewPathChange:f,focusedNestViewPath:d,onQueryChange:F,children:a.jsxs("div",{style:{display:"flex",height:"100%",overflowY:"auto"},children:[a.jsx(g,{isInitiallyExpanded:!0,initialWidth:180,minWidth:180,icon:"database",title:e.sourceInfo.name,children:a.jsx(b,{onRefresh:()=>l(Ll())})}),a.jsx(g,{isInitiallyExpanded:!0,initialWidth:280,minWidth:280,icon:"filterSliders",title:"Query",children:a.jsx(h,{runQuery:()=>{console.log(`running query with: ${i?.malloyQuery}`);try{M.mutate()}catch(O){console.error("Error running query:",O)}}})}),a.jsx(y,{source:e.sourceInfo,draftQuery:i?.malloyQuery,setDraftQuery:O=>l({...i,malloyQuery:O}),submittedQuery:c,options:{showRawQuery:!0}})]})})},e.sourceInfo.name)}function PR(e){const[t,n]=Y.useState(null),[r,o]=Y.useState(null),[s,i]=Y.useState(!0);return Y.useEffect(()=>{let l=!0;return Promise.all([import("@malloydata/malloy-explorer"),import("@malloydata/malloy-query-builder")]).then(([c,u])=>{l&&(n(c),o(u),i(!1))}).catch(c=>{console.error("Failed to load Malloy components:",c),l&&i(!1)}),()=>{l=!1}},[]),s||!t||!r?a.jsx(xe.StyledExplorerPage,{children:a.jsx(xe.StyledExplorerContent,{children:a.jsx(st.Box,{sx:{alignItems:"center",justifyContent:"center",height:"200px",color:"text.secondary"},children:"Loading explorer..."})})}):a.jsx(DR,{...e,explorerComponents:t,QueryBuilder:r,resourceUri:e.resourceUri})}function hu(e,t=!0){const{modelPath:n,environmentName:r,packageName:o,versionId:s}=St(e),{apiClients:i}=xe.useServer();return vt({queryKey:["package",r,o,n,s],queryFn:async()=>(await i.models.getModel(r,o,n,s)).data,enabled:t})}function mu({data:e,onChange:t,existingQuery:n,initialSelectedSourceIndex:r=0,onSourceChange:o,resourceUri:s}){const[i,l]=Y.useState(r);Y.useEffect(()=>{l(r)},[r]);const{data:c,isError:u,isLoading:d,error:f}=hu(s,!e),{modelPath:m}=St(s),h=e||c;if(d&&!e)return a.jsx(Ht,{text:"Fetching Model..."});if(u&&!e)return console.log("error",f),a.jsx(_t,{error:f,context:`ModelExplorer > ${m}`});if(!h)return a.jsx(Ht,{text:"Loading..."});const g=(h?.sourceInfos||[]).map((b,x)=>{try{return JSON.parse(b)?.name||`Source ${x+1}`}catch{return`Source ${x+1}`}}),y=g[i]||"";return a.jsxs(xe.StyledCard,{variant:"outlined",children:[a.jsx(xe.StyledCardContent,{children:a.jsx(I.Stack,{sx:{flexDirection:"row"},children:a.jsx(pc,{size:"small",id:"size-small-standard",disablePortal:!0,options:g,value:y,onChange:(b,x)=>{if(!x)return;const C=g.indexOf(x);C>=0&&(l(C),o?.(C))},renderInput:b=>a.jsx(Ke,{...b}),style:{width:350,marginTop:"3px",marginLeft:"6px",marginBottom:"8px"}})})}),a.jsx(xe.StyledCardMedia,{children:a.jsxs(I.Stack,{spacing:2,component:"section",children:[Array.isArray(h.sourceInfos)&&h.sourceInfos.length>0&&a.jsx(bg,{sourceAndPaths:h.sourceInfos.map(b=>({sourceInfo:JSON.parse(b),modelPath:m})),selectedSourceIndex:i,existingQuery:n,onQueryChange:t,resourceUri:s}),a.jsx(I.Box,{height:"5px"})]})})]})}function gu({open:e,onClose:t,resourceUri:n,data:r,title:o="Data Sources",hasValidImport:s=!0,existingQuery:i,initialSelectedSourceIndex:l,onChange:c,onSourceChange:u}){return a.jsxs(I.Dialog,{open:e,onClose:t,fullScreen:!0,children:[a.jsxs(I.DialogTitle,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[o,a.jsx(I.IconButton,{onClick:t,sx:{color:"text.secondary"},children:a.jsx(ir,{})})]}),a.jsx(I.DialogContent,{children:s?a.jsx(mu,{resourceUri:n,data:r,existingQuery:i,initialSelectedSourceIndex:l,onChange:c,onSourceChange:u}):a.jsx("div",{children:"No valid import statement found in cell"})})]})}function ER({onChange:e,resourceUri:t,runOnDemand:n=!1,maxResultSize:r=0}){const{modelPath:o}=St(t),{data:s,isError:i,isLoading:l,error:c}=hu(t),[u,d]=Y.useState(!1),[f,m]=Y.useState(),[h,g]=Y.useState(0),[y,b]=Y.useState(""),x=s?.modelDef,C=Y.useMemo(()=>{if(!x)return!1;try{const E=JSON.parse(x);return Array.isArray(E.imports)&&E.imports.length>0}catch{return!1}},[x]);if(l)return a.jsx(Ht,{text:"Fetching Model..."});if(i)return console.log("error",c),a.jsx(_t,{error:c,context:`Model > ${o}`});const T=E=>{m(E),e&&e(E)},w=E=>{g(E)},M=()=>{const E=window.location.href;navigator.clipboard.writeText(E).then(()=>b("URL copied to clipboard!")).catch(()=>b("Failed to copy URL"))};return a.jsxs(a.Fragment,{children:[a.jsxs(I.Box,{sx:{position:"relative",maxWidth:"1200px",margin:"0 auto",paddingTop:"24px"},children:[Array.isArray(s?.sourceInfos)&&s.sourceInfos.length>0&&a.jsxs(I.Stack,{spacing:2,component:"section",children:[a.jsxs(I.Box,{sx:{padding:"0 0 16px 0",display:"flex",alignItems:"center",justifyContent:"space-between"},children:[a.jsx(I.Typography,{variant:"h1",sx:{fontSize:"28px",fontWeight:"600",color:"#1a1a1a",marginBottom:"8px",marginTop:"0",paddingLeft:"0"},children:"Sources"}),a.jsx(I.Tooltip,{title:"Click to copy link",children:a.jsx(gg,{sx:{fontSize:"24px",color:"text.secondary",cursor:"pointer"},onClick:M})})]}),a.jsx(mu,{data:s,onChange:T,onSourceChange:w,existingQuery:f,initialSelectedSourceIndex:h,resourceUri:t}),a.jsx(I.IconButton,{sx:{position:"absolute",top:"90px",right:"4px",backgroundColor:"rgba(255, 255, 255, 0.9)","&:hover":{backgroundColor:"rgba(255, 255, 255, 1)"},width:"32px",height:"32px",zIndex:2},onClick:()=>d(!0),children:a.jsx(Pa,{sx:{fontSize:"18px",color:"text.secondary",marginBottom:"5px"}})})]}),s?.queries?.length>0&&a.jsxs(I.Stack,{spacing:2,component:"section",sx:{marginTop:"24px"},children:[a.jsx(I.Box,{sx:{padding:"0 0 16px 0"},children:a.jsx(I.Typography,{variant:"h2",sx:{fontSize:"24px",fontWeight:"600",color:"#1a1a1a",marginBottom:"0",marginTop:"8px",paddingLeft:"0"},children:"Named Queries"})}),s.queries.map(E=>a.jsx(MR,{queryName:E.name,annotations:E.annotations,resourceUri:t,runOnDemand:n,maxResultSize:r},E.name))]}),(!Array.isArray(s?.sourceInfos)||s.sourceInfos.length===0)&&!(s?.queries&&s.queries.length>0)&&a.jsxs(I.Box,{sx:{textAlign:"center",py:6},children:[a.jsx(I.Typography,{variant:"body1",sx:{color:"text.secondary",marginBottom:"8px"},children:"This model exposes no sources or queries."}),C&&a.jsxs(I.Typography,{variant:"body2",color:"text.secondary",children:["It imports other files but re-exports nothing. Add"," ",a.jsxs("code",{children:["export ","{ source_name }"]})," to surface imported sources here."]})]}),a.jsx(gu,{open:u,onClose:()=>d(!1),resourceUri:t,data:s,title:`Model: ${o.split("/").pop()}`,existingQuery:f,initialSelectedSourceIndex:h,onChange:T,onSourceChange:w})]}),a.jsx(I.Snackbar,{open:y!=="",autoHideDuration:6e3,onClose:()=>b(""),message:y})]})}function OR({ready:e,lastRunKey:t,pendingKey:n,runKey:r,documentKey:o}){if(!e)return{cancelPending:n!==void 0,dispatch:"none"};const s=n!==void 0&&n!==r;if(t===r)return{cancelPending:s,dispatch:"none"};if(n===r)return{cancelPending:s,dispatch:"none"};const i=t===null||!t.startsWith(`${o}|`);return{cancelPending:s,dispatch:i?"now":"settle"}}function xg(e){return Y.useMemo(()=>{if(!e?.sources?.length)return[];const t=new Map;for(const n of e.sources)if(n.givens?.length)for(const r of n.givens)r.name&&!t.has(r.name)&&t.set(r.name,r);return Array.from(t.values())},[e])}const RR=Xe(a.jsx("path",{d:"M9.4 16.6 4.8 12l4.6-4.6L8 6l-6 6 6 6zm5.2 0 4.6-4.6-4.6-4.6L16 6l6 6-6 6z"})),jR=Xe(a.jsx("path",{d:"M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12zm3 4H8c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h11c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2m0 16H8V7h11z"}));function yu(e){const{environmentName:t,packageName:n}=St(e.resourceUri);if(!t||!n)throw new Error("Environment and Package name must be provided for query embedding.");return JSON.stringify({...e})}function $R({embeddedQueryResult:e}){const{query:t,sourceName:n,queryName:r,resourceUri:o,height:s}=JSON.parse(e),{modelPath:i}=St(o);if(!i||!t&&(!r||!n)||typeof i!="string")throw new Error("Invalid embedded query result: "+e);return a.jsx(vg,{query:t,sourceName:n,queryName:r,resourceUri:o,height:s})}function vg({query:e,sourceName:t,queryName:n,resourceUri:r,height:o=400}){const{modelPath:s,environmentName:i,packageName:l,versionId:c}=St(r),{apiClients:u}=xe.useServer();if(!i||!l)throw new Error("No environment or package name provided. A resource URI must be provided.");const{data:d,isSuccess:f,isError:m,error:h}=vt({queryKey:[r,e,t,n],queryFn:()=>u.models.executeQueryModel(i,l,s,{query:e,sourceName:t,queryName:n,versionId:c}),...xe.CHART_RESULT_QUERY_OPTIONS});return a.jsxs(a.Fragment,{children:[!f&&!m&&a.jsx(Ht,{text:"Fetching Query Results..."}),f&&a.jsx(Y.Suspense,{fallback:a.jsx("div",{children:"Loading..."}),children:a.jsx(ss,{result:d.data.result,maxHeight:o,renderLogs:d.data.renderLogs})}),m&&a.jsx(_t,{context:`${i} > ${l} > ${s}`,error:h})]})}function AR({href:e,title:t,children:n,envName:r,pkgName:o,sourceDir:s,onNavigate:i}){const l=!!e&&/^[a-z][a-z0-9+.-]*:/i.test(e);if(!(!!e&&!l&&!e.startsWith("/")&&!e.startsWith("#"))||!e){const m=l&&!/^(https?|mailto|tel):/i.test(e??"");return a.jsx("a",{href:m?void 0:e,title:t,...l?{target:"_blank",rel:"noopener noreferrer"}:{},children:n})}const u=new URL(e,`https://malloy.invalid/${s}`),d=u.pathname.slice(1)+u.search+u.hash,f=`/${r}/${o}/${d}`;return a.jsx("a",{href:f,title:t,onClick:i?m=>{m.preventDefault(),i(f,m)}:void 0,children:n})}function FR({cell:e,hideCodeCellIcon:t,hideEmbeddingIcon:n,resourceUri:r,index:o,maxResultSize:s,isExecuting:i,pendingRerun:l,onNavigate:c,onDrillSelf:u,canDrillSelf:d,onDrillNavigate:f}){const[m,h]=Y.useState(!1),[g,y]=Y.useState(!1),[b,x]=Y.useState(!1),[C,T]=Y.useState(),[w,M]=Y.useState(),[E,j]=Y.useState(!1),[F,O]=Y.useState(""),{environmentName:V,packageName:L,modelPath:v}=St(r),{drill:N,drillMenu:A}=wc({onNavigate:f,onSelf:u,canSelf:d,selfLabel:"Filter this notebook"}),$=v&&v.includes("/")?v.slice(0,v.lastIndexOf("/")+1):"",R={overrides:{a:{component:AR,props:{envName:V,pkgName:L,sourceDir:$,onNavigate:c}}}},_=/import\s*\{([^}]+)\}\s*from\s*['"`][^'"`]+['"`]/,z=/import\s*(?:\{[^}]*\}\s*from\s*)?['"`]([^'"`]+)['"`]/,W=K=>K.split(`
140
+ `).filter(le=>!le.trimStart().startsWith("##")).join(`
141
+ `),H=!!e.text&&(_.test(e.text)||z.test(e.text)),G=()=>{if(!e.newSources||e.newSources.length===0)return 0;let K=[],le="";if(e.text){const oe=e.text.match(_);oe&&(K=oe[1].split(",").map(Z=>Z.trim()));const te=e.text.match(z);te&&(le=te[1].trim())}for(let oe=0;oe<e.newSources.length;oe++)try{const te=JSON.parse(e.newSources[oe]);if(K.length>0&&K.includes(te.name)||le&&le===te.path)return oe}catch{continue}return 0},se=e.newSources&&e.newSources.length>0?{sourceInfos:e.newSources,resource:r}:void 0,pe=yu({query:e.text,resourceUri:r}),{mode:me}=xe.usePublisherTheme();Y.useEffect(()=>{e.type==="code"&&fc(W(e.text),"malloy",me).then(K=>{T(K)})},[e,me]),Y.useEffect(()=>{fc(pe,"typescript",me).then(K=>{M(K)})},[pe,me]);const X=()=>{const K=window.location.href;navigator.clipboard.writeText(K).then(()=>O("URL copied to clipboard!")).catch(()=>O("Failed to copy URL"))};return e.type==="markdown"&&a.jsx(xe.CleanNotebookCell,{children:a.jsxs(I.Box,{sx:K=>({"& h1, & h2, & h3, & h4, & h5, & h6":{fontWeight:"600",color:K.palette.text.primary,marginBottom:"8px",marginTop:"16px"},"& h1":{fontSize:"28px"},"& h2":{fontSize:"24px"},"& h3":{fontSize:"20px"},"& p":{color:K.palette.text.primary,lineHeight:"1.7",marginBottom:"8px",fontSize:"16px"},"& ul, & ol":{color:K.palette.text.primary,lineHeight:"1.7",marginBottom:"8px",fontSize:"16px"},"& li":{marginBottom:"4px"}}),children:[o===0?a.jsxs(I.Stack,{direction:"row",alignItems:"flex-start",justifyContent:"space-between",children:[a.jsx(pa,{options:R,children:e.text}),a.jsx(I.Tooltip,{title:"Click to copy link",children:a.jsx(gg,{sx:{fontSize:"24px",color:"text.secondary",cursor:"pointer",marginTop:"26px"},onClick:X})})]}):a.jsx(pa,{options:R,children:e.text}),a.jsx(I.Snackbar,{open:F!=="",autoHideDuration:6e3,onClose:()=>O(""),message:F})]})})||e.type==="code"&&a.jsxs(xe.CleanNotebookCell,{children:[(!t||!n&&e.result||e.newSources&&e.newSources.length>0)&&a.jsx(I.Stack,{sx:{flexDirection:"column",gap:"8px",marginBottom:"2px"},children:e.newSources&&e.newSources.length>0&&a.jsx(xe.CleanMetricCard,{sx:{position:"relative",padding:"0"},children:a.jsxs(I.Box,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",paddingLeft:"24px",paddingRight:"8px"},children:[C&&a.jsx("span",{dangerouslySetInnerHTML:{__html:C},style:{fontFamily:"monospace",fontSize:"14px",flex:1,marginRight:"8px"}}),H&&a.jsx(I.IconButton,{sx:{backgroundColor:"rgba(255, 255, 255, 0.9)","&:hover":{backgroundColor:"rgba(255, 255, 255, 1)"},width:"32px",height:"32px",flexShrink:0},onClick:()=>j(!0),children:a.jsx(Pa,{sx:{fontSize:"18px",color:"grey.700"}})})]})})}),a.jsx(gu,{open:E,onClose:()=>j(!1),title:"Data Sources",hasValidImport:H,resourceUri:r,data:se,initialSelectedSourceIndex:G()}),a.jsxs(I.Dialog,{open:m,onClose:()=>h(!1),maxWidth:"lg",fullWidth:!0,children:[a.jsxs(I.DialogTitle,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:["Malloy Code",a.jsx(I.IconButton,{onClick:()=>h(!1),sx:{color:"text.secondary"},children:a.jsx(ir,{})})]}),a.jsx(I.DialogContent,{children:a.jsx(I.Box,{sx:K=>({border:`1px solid ${K.palette.divider}`,borderRadius:"8px",padding:"16px",fontFamily:"monospace",fontSize:"14px",lineHeight:"1.5",overflow:"auto",maxHeight:"70vh",backgroundColor:K.palette.background.paper,color:K.palette.text.primary}),children:a.jsx("pre",{className:"code-display",style:{margin:0},dangerouslySetInnerHTML:{__html:C}})})})]}),a.jsxs(I.Dialog,{open:g,onClose:()=>y(!1),maxWidth:"lg",fullWidth:!0,children:[a.jsxs(I.DialogTitle,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:["Embeddable Code",a.jsx(I.IconButton,{onClick:()=>y(!1),sx:{color:"text.secondary"},children:a.jsx(ir,{})})]}),a.jsx(I.DialogContent,{children:a.jsxs(I.Stack,{sx:{flexDirection:"row",justifyContent:"space-between",alignItems:"flex-start"},children:[a.jsx(I.Typography,{component:"div",sx:{fontSize:"12px",fontFamily:"monospace","& .line":{textWrap:"wrap"},flex:1},dangerouslySetInnerHTML:{__html:w}}),a.jsx(I.Tooltip,{title:"Copy Embeddable Code",children:a.jsx(I.IconButton,{sx:{width:"24px",height:"24px",marginLeft:"8px",color:"text.secondary"},onClick:()=>{navigator.clipboard.writeText(pe)},children:a.jsx(jR,{})})})]})})]}),a.jsx(yg,{open:b,onClose:()=>x(!1),result:e.result||"",title:"Results",drill:N}),i&&!e.result&&!e.error&&!H&&!(e.newSources&&e.newSources.length>0)&&a.jsx(xe.CleanMetricCard,{sx:{display:"flex",justifyContent:"center",alignItems:"center",minHeight:200},children:a.jsx(I.CircularProgress,{size:32})}),!e.result&&e.error&&a.jsxs(xe.CleanMetricCard,{sx:{p:2},children:[a.jsx(I.Typography,{variant:"body2",sx:{color:"error.main"},children:"This cell could not be run."}),a.jsx(I.Typography,{variant:"body2",component:"pre",sx:{color:"text.secondary",whiteSpace:"pre-wrap",m:0,mt:1},children:e.error})]}),e.result&&l&&a.jsx(I.LinearProgress,{"aria-label":"a re-run is pending",sx:{mb:1,height:2,borderRadius:1}}),e.result&&a.jsxs(xe.CleanMetricCard,{sx:{position:"relative"},children:[a.jsx(I.Box,{sx:{paddingTop:"24px"},children:a.jsx(ss,{result:e.result,maxHeight:Nm,maxResultSize:s,drill:N})}),A,a.jsxs(I.Stack,{sx:{position:"absolute",top:"-12px",right:"8px",flexDirection:"row",gap:"8px",alignItems:"center",zIndex:2},children:[!t&&a.jsx(I.IconButton,{sx:{backgroundColor:"rgba(255, 255, 255, 0.9)","&:hover":{backgroundColor:"rgba(255, 255, 255, 1)"},width:"32px",height:"32px"},onClick:K=>{K.stopPropagation(),h(!0)},children:a.jsx(RR,{sx:{fontSize:"18px",color:"grey.700"}})}),a.jsx(I.IconButton,{sx:{backgroundColor:"rgba(255, 255, 255, 0.9)","&:hover":{backgroundColor:"rgba(255, 255, 255, 1)"},width:"32px",height:"32px"},onClick:()=>x(!0),children:a.jsx(Pa,{sx:{fontSize:"18px",color:"grey.700"}})})]})]})]})}const NR=4,LR=400;function BR(e){const t=e?.response?.data?.message;return typeof t=="string"&&t!==""?t:e instanceof Error&&e.message!==""?e.message:"The server did not say why."}function Sg({resourceUri:e,maxResultSize:t=0,givens:n,onGivensChange:r,onNavigate:o,onDrillNavigate:s}){const{apiClients:i}=xe.useServer(),{environmentName:l,packageName:c,versionId:u,modelPath:d}=St(e),{data:f,isSuccess:m,isError:h,error:g}=vt({queryKey:[e],queryFn:async()=>(await i.notebooks.getNotebook(l,c,d,u)).data}),[y,b]=Y.useState([]),[x,C]=Y.useState(!1),[T,w]=Y.useState(!1),M=Y.useRef(void 0),[E,j]=Y.useState(null),F=xg(f),O=Y.useMemo(()=>new Map(F.filter(ae=>ae.name!==void 0).map(ae=>[ae.name,ae.type])),[F]),V=Y.useCallback(ae=>{m&&r?.(ae,Array.from(O.keys()))},[m,r,O]),L=f?.autorun!==!1,{draft:v,applied:N,setGiven:A,reset:$,apply:R,pending:_}=xc({declaredTypes:O,startingValues:f?.startingGivens,params:n,onParamsChange:m?V:void 0,documentKey:e,autorun:L}),{options:z,isLoading:W,failed:H}=vc(l,c,d,F,u,{values:N,declaredTypes:O}),{canSelf:G,onSelf:se}=kc({declaredTypes:O,setGiven:A,documentName:d}),pe=Y.useCallback(ae=>{const Q=bc(ae,O);return Object.keys(Q).length>0?JSON.stringify(Q):void 0},[O]),me=Y.useRef(0),X=Y.useRef(null),K=Y.useRef(null),le=Y.useRef(void 0);Y.useEffect(()=>()=>{X.current?.abort(),K.current=null,clearTimeout(le.current?.timer),le.current=void 0},[]);const oe=Y.useCallback(async(ae=new Map)=>{if(!m||!f?.notebookCells)return;const Q=++me.current;X.current?.abort();const ue=new AbortController;X.current=ue,b(f.notebookCells.map(de=>({...de}))),C(!0),j(null);const he=pe(ae);try{const de=[];for(let ce=0;ce<f.notebookCells.length;ce++){const Pe=f.notebookCells[ce];if(Pe.type==="markdown")continue;const Ce=ce,Ve=async()=>{try{const De=await i.notebooks.executeNotebookCell(l,c,d,Ce,u,void 0,void 0,he,{signal:ue.signal});if(me.current!==Q)return;const pt=De.data,Ye=pt.result,tt=Pe.newSources||pt.newSources;b(gt=>{const kt=[...gt];return kt[Ce]||(kt[Ce]={...Pe}),kt[Ce]={...kt[Ce],result:Ye,newSources:tt},kt})}catch(De){if(ue.signal.aborted||me.current!==Q)return;console.error(`Error executing cell ${Ce}:`,De);const pt=BR(De);b(Ye=>{const tt=[...Ye];return tt[Ce]||(tt[Ce]={...Pe}),tt[Ce]={...tt[Ce],error:pt},tt})}};de.push(Ve)}const Se=[];for(const ce of de){const Pe=ce().then(()=>{Se.splice(Se.indexOf(Pe),1)});Se.push(Pe),Se.length>=NR&&await Promise.race(Se)}await Promise.all(Se)}catch(de){if(ue.signal.aborted||me.current!==Q)return;console.error("Error executing notebook cells:",de),j(de)}finally{me.current===Q&&(C(!1),X.current=null)}},[m,f,pe,l,c,d,u,i.notebooks]),te=Y.useRef(0),Z=Y.useRef(void 0);Z.current!==f&&(Z.current=f,te.current+=1);const J=te.current;return Y.useEffect(()=>{const ae=`${e}|${J}`,Q=`${ae}|${pe(N)??""}`;M.current!==void 0&&M.current!==ae&&(X.current?.abort(),X.current=null),M.current=ae;const ue=OR({ready:m&&!!f?.notebookCells,lastRunKey:K.current,pendingKey:le.current?.key,runKey:Q,documentKey:ae});if(ue.cancelPending&&(clearTimeout(le.current?.timer),le.current=void 0,w(!1)),ue.dispatch==="none")return;const he=()=>{le.current=void 0,w(!1),K.current=Q,oe(N)};if(ue.dispatch==="now"){he();return}w(!0),le.current={key:Q,timer:setTimeout(he,LR)}},[m,f,J,e,N,pe,oe]),a.jsx(xe.CleanNotebookContainer,{children:a.jsx(xe.CleanNotebookSection,{children:a.jsxs(I.Stack,{spacing:3,component:"section",children:[a.jsx(iu,{givens:F,values:v,onChange:A,onReset:$,options:z,optionsLoading:W,optionsFailed:H,apply:L?void 0:{onApply:R,pending:_}}),!m&&!h&&a.jsx(Ht,{text:"Fetching Notebook..."}),m&&(y.length>0?y:f?.notebookCells||[]).map((ae,Q)=>a.jsx(FR,{cell:ae,index:Q,resourceUri:e,maxResultSize:t,isExecuting:x,pendingRerun:T,onNavigate:o,onDrillNavigate:s,onDrillSelf:F.length>0?se:void 0,canDrillSelf:G},Q)),h&&g.status===404&&a.jsxs(I.Typography,{variant:"body2",sx:{color:"text.secondary"},children:[a.jsx("code",{children:`${l} > ${c} > ${d}`})," ","not found."]}),h&&g.status!==404&&a.jsx(_t,{error:g,context:`${l} > ${c} > ${d}`}),E&&a.jsx(_t,{error:{message:E.message,status:500,name:"ExecutionError"},context:"Notebook Execution"})]})})})}const VR={dashboard:xe.MALLOY_BRAND.orange,report:xe.MALLOY_BRAND.teal,model:xe.MALLOY_BRAND.darkBlue,dataApp:xe.MALLOY_ACCENT.violet,data:xe.MALLOY_ACCENT.moss,materialization:xe.MALLOY_ACCENT.magenta};function zR({type:e,size:t=18,sx:n,...r}){return a.jsx(ya,{...r,viewBox:"0 0 24 24",sx:{width:t,height:t,fill:"none",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round",...n},children:_R[e]()})}const _R={report:WR,model:HR,data:UR,materialization:qR,dataApp:KR,dashboard:YR};function WR(){return a.jsxs(a.Fragment,{children:[a.jsx("path",{d:"M14 3 H6 a2 2 0 0 0 -2 2 v14 a2 2 0 0 0 2 2 h12 a2 2 0 0 0 2 -2 V9 z"}),a.jsx("path",{d:"M14 3 v4 a2 2 0 0 0 2 2 h4"}),a.jsx("path",{d:"M8 17 v-3"}),a.jsx("path",{d:"M12 17 v-6"}),a.jsx("path",{d:"M16 17 v-4"})]})}function HR(){return a.jsxs(a.Fragment,{children:[a.jsx("path",{d:"M12 3 L4 7 v10 l8 4 l8 -4 V7 z"}),a.jsx("path",{d:"M4 7 l8 4 l8 -4"}),a.jsx("path",{d:"M12 11 v10"})]})}function UR(){return a.jsxs(a.Fragment,{children:[a.jsx("rect",{x:"3.5",y:"3.5",width:"17",height:"17",rx:"2"}),a.jsx("path",{d:"M3.5 9.5 H20.5"}),a.jsx("path",{d:"M9.5 3.5 V20.5"})]})}function qR(){return a.jsxs(a.Fragment,{children:[a.jsx("path",{d:"M12 3 L21 7.5 L12 12 L3 7.5 Z"}),a.jsx("path",{d:"M3 12 L12 16.5 L21 12"}),a.jsx("path",{d:"M3 16.5 L12 21 L21 16.5"})]})}function YR(){return a.jsxs(a.Fragment,{children:[a.jsx("rect",{x:"3.5",y:"3.5",width:"17",height:"17",rx:"2"}),a.jsx("path",{d:"M3.5 9.5 H20.5"}),a.jsx("path",{d:"M12 9.5 V20.5"}),a.jsx("path",{d:"M12 15 H20.5"})]})}function KR(){return a.jsxs(a.Fragment,{children:[a.jsx("rect",{x:"3.5",y:"4.5",width:"17",height:"15",rx:"2"}),a.jsx("path",{d:"M3.5 9.5 H20.5"}),a.jsx("path",{d:"M7 13.5 H17"}),a.jsx("path",{d:"M7 16.5 H13"})]})}const jf="README.malloynb";function GR({onClickPackageFile:e,resourceUri:t}){const{apiClients:n,server:r}=xe.useServer(),o=e??(v=>{window.location.href=v}),{environmentName:s,packageName:i,versionId:l}=St(t),[c,u]=Y.useState(null),d=vt({queryKey:["package",s,i,l],queryFn:()=>n.packages.getPackage(s,i,l,!1)}),f=vt({queryKey:["notebooks",s,i,l],queryFn:()=>n.notebooks.listNotebooks(s,i,l)}),m=vt({queryKey:["models",s,i,l],queryFn:()=>n.models.listModels(s,i,l)}),h=vt({queryKey:["databases",s,i,l],queryFn:()=>n.databases.listDatabases(s,i,l)}),y=vt({queryKey:["data-apps",s,i],queryFn:async()=>{try{return await n.dataApps.listDataApps(s,i)}catch(v){const N=v?.response?.status;if(N===404||N===void 0)return{data:[]};throw v}}}).data?.data??[],b=vt({queryKey:["dashboards",s,i,l],queryFn:async()=>{try{return await n.dashboards.listDashboards(s,i,l)}catch(v){const N=v?.response?.status;if(N===404||N===void 0)return{data:[]};throw v}}}),x=v=>v.title&&v.title!==v.name?v.title:v.name??"",C=v=>v.title&&v.title!==v.path?v.title:v.path??"",T=(b.data?.data??[]).slice().sort((v,N)=>x(v).localeCompare(x(N))),w=(f.data?.data??[]).slice().sort((v,N)=>C(v).localeCompare(C(N))),M=new Set(T.map(v=>v.path).filter(v=>v!==void 0)),E=(m.data?.data??[]).slice().filter(v=>!M.has(v.path)).sort((v,N)=>v.path.localeCompare(N.path)),j=(h.data?.data??[]).slice().sort((v,N)=>v.path.localeCompare(N.path)),F=d.data?.data?.description??"",O=w.some(v=>v.path===jf),V=yi({environmentName:s,packageName:i,versionId:l,modelPath:jf}),L=!f.isSuccess&&!f.isError||!b.isSuccess&&!b.isError;return d.isError?a.jsx(_t,{error:d.error,context:`${s} > ${i}`}):a.jsxs(I.Container,{maxWidth:!1,sx:{maxWidth:1024,mx:"auto",px:3,py:6},children:[a.jsxs(I.Box,{sx:{mb:4},children:[a.jsxs(I.Link,{onClick:v=>o(`/${s}/`,v),underline:"none",sx:{display:"inline-flex",alignItems:"center",gap:.5,cursor:"pointer",color:"text.secondary",fontSize:"0.875rem",mb:2,"&:hover":{color:"primary.main"}},children:[a.jsx(Ym,{sx:{fontSize:18}}),"Back to ",s]}),a.jsx(I.Typography,{variant:"h4",component:"h1",sx:{fontWeight:600,letterSpacing:"-0.025em",mb:.5},children:i}),F&&a.jsx(I.Typography,{variant:"body2",color:"text.secondary",children:F})]}),L&&a.jsx(Ht,{text:"Loading package..."}),!L&&a.jsxs(a.Fragment,{children:[b.isError&&a.jsx(I.Box,{sx:{mb:4},children:a.jsx(I.Alert,{severity:"warning",children:"Could not list this package's dashboards, so any it has are missing from this page."})}),T.length>0&&a.jsx(Bo,{title:"Dashboards",count:T.length,children:T.map(v=>{const N=!!v.title&&v.title!==v.name;return a.jsx(Vo,{type:"dashboard",label:N?v.title:v.name,rightLabel:N?v.name:void 0,onClick:A=>o(`/${s}/${i}/dashboards/`+encodeURIComponent(v.name??""),A)},v.name)})}),a.jsxs(Bo,{title:"Notebooks",count:w.length,children:[w.map(v=>{const N=!!v.title&&v.title!==v.path;return a.jsx(Vo,{type:"report",label:N?v.title:v.path,rightLabel:N?v.path:void 0,onClick:A=>o(`/${s}/${i}/${v.path}`,A)},v.path)}),w.length===0&&a.jsx(Bl,{label:"No notebooks"})]}),y.length>0&&a.jsx(Bo,{title:"Data Apps",count:y.length,children:y.map(v=>{const N=!!v.title&&v.title!==v.path,A=`${lu(r)}${v.resource}`;return a.jsx(Vo,{type:"dataApp",label:N?v.title:v.path,rightLabel:N?v.path:void 0,onClick:$=>{e?e(`/${s}/${i}/data-apps/${v.path}`,$):$&&($.metaKey||$.ctrlKey)?window.open(A,"_blank"):window.location.href=A},trailingAction:a.jsx(I.Tooltip,{title:"Open standalone in new tab",children:a.jsx(I.IconButton,{size:"small",href:A,target:"_blank",rel:"noopener noreferrer","aria-label":"Open standalone in new tab",onClick:$=>$.stopPropagation(),sx:{color:"text.secondary"},children:a.jsx(Um,{fontSize:"small"})})})},v.path)})}),a.jsxs(Bo,{title:"Semantic Models",count:E.length,children:[E.map(v=>a.jsx(Vo,{type:"model",label:v.path,onClick:N=>o(`/${s}/${i}/${v.path}`,N)},v.path)),E.length===0&&a.jsx(Bl,{label:"No models"})]}),a.jsxs(Bo,{title:"Package Data",count:j.length,children:[j.map(v=>a.jsx(Vo,{type:"data",label:v.path,rightLabel:v.info?ZR(v.info.rowCount):"Unreadable",onClick:()=>u(v)},v.path)),j.length===0&&a.jsx(Bl,{label:"No data files"})]}),a.jsx(Bo,{title:"Materializations",children:a.jsx(Vo,{type:"materialization",label:"Materializations",onClick:v=>o(`/${s}/${i}/materializations`,v)})}),O&&a.jsx(I.Box,{sx:{mt:6},children:a.jsx(Sg,{resourceUri:V,onNavigate:o})})]}),a.jsxs(I.Dialog,{open:c!==null,onClose:()=>u(null),maxWidth:"sm",fullWidth:!0,children:[a.jsxs(I.DialogTitle,{sx:{pr:6},children:[c?.path,a.jsx(I.IconButton,{"aria-label":"close",onClick:()=>u(null),sx:{position:"absolute",right:8,top:8},children:a.jsx(ir,{fontSize:"small"})})]}),a.jsxs(I.DialogContent,{children:[c?.error&&a.jsx(I.Typography,{variant:"body2",color:"error",children:c.error}),c?.info?.columns&&a.jsxs(I.Table,{size:"small",children:[a.jsx(I.TableHead,{children:a.jsxs(I.TableRow,{children:[a.jsx(I.TableCell,{children:"Column"}),a.jsx(I.TableCell,{children:"Type"})]})}),a.jsx(I.TableBody,{children:c.info.columns.map(v=>a.jsxs(I.TableRow,{children:[a.jsx(I.TableCell,{component:"th",scope:"row",children:v.name}),a.jsx(I.TableCell,{children:v.type})]},v.name))})]})]})]})]})}function Bo({title:e,count:t,children:n}){return a.jsxs(I.Box,{sx:{mb:4},children:[a.jsxs(I.Stack,{direction:"row",alignItems:"baseline",spacing:1,sx:{mb:1},children:[a.jsx(I.Typography,{variant:"h6",sx:{fontWeight:600,letterSpacing:"-0.025em"},children:e}),t!==void 0&&a.jsxs(I.Typography,{variant:"caption",color:"text.secondary",children:["(",t,")"]})]}),a.jsx(I.Box,{children:n})]})}function Vo({type:e,label:t,rightLabel:n,onClick:r,trailingAction:o}){const s=!!r,i=l=>{r&&(l.key==="Enter"||l.key===" ")&&(l.preventDefault(),r(l))};return a.jsxs(I.Box,{onClick:r,onKeyDown:s?i:void 0,role:s?"button":void 0,tabIndex:s?0:void 0,sx:l=>({display:"flex",alignItems:"center",gap:1.5,py:1,px:1,mx:-1,cursor:s?"pointer":"default",borderRadius:1.5,transition:"background-color 0.1s","&:hover":s?{backgroundColor:l.palette.mode==="dark"?"rgba(255, 255, 255, 0.08)":"grey.100"}:void 0,"&:focus-visible":s?{outline:"2px solid",outlineColor:"primary.main",outlineOffset:2}:void 0}),children:[a.jsx(I.Box,{sx:{width:32,height:32,borderRadius:1,bgcolor:VR[e],color:"#FFFFFF",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0},children:a.jsx(zR,{type:e})}),a.jsx(I.Typography,{variant:"body2",sx:{fontFamily:xe.MONO_FONT_FAMILY,flex:1,minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:t}),n&&a.jsx(I.Typography,{variant:"caption",color:"text.secondary",sx:{flexShrink:0},children:n}),o&&a.jsx(I.Box,{sx:{flexShrink:0,display:"flex",alignItems:"center"},children:o})]})}function Bl({label:e}){return a.jsx(I.Typography,{variant:"body2",color:"text.secondary",sx:{py:1,fontStyle:"italic"},children:e})}function ZR(e){return e>=1e9?`${(e/1e9).toFixed(1)} B rows`:e>=1e6?`${(e/1e6).toFixed(1)} M rows`:e>=1e3?`${(e/1e3).toFixed(1)} K rows`:`${e} rows`}function XR(e){return $e("MuiCollapse",e)}Ee("MuiCollapse",["root","horizontal","vertical","entered","hidden","wrapper","wrapperInner"]);const QR=e=>{const{orientation:t,classes:n}=e,r={root:["root",`${t}`],entered:["entered"],hidden:["hidden"],wrapper:["wrapper",`${t}`],wrapperInner:["wrapperInner",`${t}`]};return Re(r,XR,n)},JR=re("div",{name:"MuiCollapse",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,t[n.orientation],n.state==="entered"&&t.entered,n.state==="exited"&&!n.in&&n.collapsedSize==="0px"&&t.hidden]}})(He(({theme:e})=>({height:0,overflow:"hidden",transition:e.transitions.create("height"),variants:[{props:{orientation:"horizontal"},style:{height:"auto",width:0,transition:e.transitions.create("width")}},{props:{state:"entered"},style:{height:"auto",overflow:"visible"}},{props:{state:"entered",orientation:"horizontal"},style:{width:"auto"}},{props:({ownerState:t})=>t.state==="exited"&&!t.in&&t.collapsedSize==="0px",style:{visibility:"hidden"}}]}))),ej=re("div",{name:"MuiCollapse",slot:"Wrapper"})({display:"flex",width:"100%",variants:[{props:{orientation:"horizontal"},style:{width:"auto",height:"100%"}}]}),tj=re("div",{name:"MuiCollapse",slot:"WrapperInner"})({width:"100%",variants:[{props:{orientation:"horizontal"},style:{width:"auto",height:"100%"}}]}),hi=D.forwardRef(function(t,n){const r=We({props:t,name:"MuiCollapse"}),{addEndListener:o,children:s,className:i,collapsedSize:l="0px",component:c,easing:u,in:d,onEnter:f,onEntered:m,onEntering:h,onExit:g,onExited:y,onExiting:b,orientation:x="vertical",style:C,timeout:T=ah.standard,TransitionComponent:w=Fn,...M}=r,E={...r,orientation:x,collapsedSize:l},j=QR(E),F=$r(),O=_a(),V=D.useRef(null),L=D.useRef(),v=typeof l=="number"?`${l}px`:l,N=x==="horizontal",A=N?"width":"height",$=D.useRef(null),R=Ze(n,$),_=K=>le=>{if(K){const oe=$.current;le===void 0?K(oe):K(oe,le)}},z=()=>V.current?V.current[N?"clientWidth":"clientHeight"]:0,W=_((K,le)=>{V.current&&N&&(V.current.style.position="absolute"),K.style[A]=v,f&&f(K,le)}),H=_((K,le)=>{const oe=z();V.current&&N&&(V.current.style.position="");const{duration:te,easing:Z}=Qo({style:C,timeout:T,easing:u},{mode:"enter"});if(T==="auto"){const J=F.transitions.getAutoHeightDuration(oe);K.style.transitionDuration=`${J}ms`,L.current=J}else K.style.transitionDuration=typeof te=="string"?te:`${te}ms`;K.style[A]=`${oe}px`,K.style.transitionTimingFunction=Z,h&&h(K,le)}),G=_((K,le)=>{K.style[A]="auto",m&&m(K,le)}),se=_(K=>{K.style[A]=`${z()}px`,g&&g(K)}),pe=_(y),me=_(K=>{const le=z(),{duration:oe,easing:te}=Qo({style:C,timeout:T,easing:u},{mode:"exit"});if(T==="auto"){const Z=F.transitions.getAutoHeightDuration(le);K.style.transitionDuration=`${Z}ms`,L.current=Z}else K.style.transitionDuration=typeof oe=="string"?oe:`${oe}ms`;K.style[A]=v,K.style.transitionTimingFunction=te,b&&b(K)}),X=K=>{T==="auto"&&O.start(L.current||0,K),o&&o($.current,K)};return a.jsx(w,{in:d,onEnter:W,onEntered:G,onEntering:H,onExit:se,onExited:pe,onExiting:me,addEndListener:X,nodeRef:$,timeout:T==="auto"?null:T,...M,children:(K,{ownerState:le,...oe})=>a.jsx(JR,{as:c,className:Te(j.root,i,{entered:j.entered,exited:!d&&v==="0px"&&j.hidden}[K]),style:{[N?"minWidth":"minHeight"]:v,...C},ref:R,ownerState:{...E,state:K},...oe,children:a.jsx(ej,{ownerState:{...E,state:K},className:j.wrapper,ref:V,children:a.jsx(tj,{ownerState:{...E,state:K},className:j.wrapperInner,children:s})})})})});hi&&(hi.muiSupportAuto=!0);function Cg(e){return wt}const wg=D.createContext(null);function nj(e){const{value:t,children:n}=e;return a.jsx(wg.Provider,{value:t,children:t.wrapRoot({children:n,instance:t.instance})})}const mo=()=>{const e=D.useContext(wg);if(e==null)throw new Error(["MUI X: Could not find the Tree View context.","It looks like you rendered your component outside of a SimpleTreeView or RichTreeView parent component.","This can also happen if you are bundling multiple versions of the Tree View."].join(`
142
+ `));return e},rj=({props:e})=>{const{instance:t}=mo(),{label:n,itemId:r}=e,[o,s]=D.useState(n),i=t.isItemBeingEdited(r);return D.useEffect(()=>{i||s(n)},[i,n]),{propsEnhancers:{labelInput:({externalEventHandlers:l,interactions:c})=>t.isItemEditable(r)?{value:o??"","data-element":"labelInput",onChange:h=>{l.onChange?.(h),s(h.target.value)},onKeyDown:h=>{if(l.onKeyDown?.(h),h.defaultMuiPrevented)return;const g=h.target;h.key==="Enter"&&g.value?c.handleSaveItemLabel(h,g.value):h.key==="Escape"&&c.handleCancelItemLabelEditing(h)},onBlur:h=>{l.onBlur?.(h),!h.defaultMuiPrevented&&h.target.value&&c.handleSaveItemLabel(h,h.target.value)},autoFocus:!0,type:"text"}:{}}}},Dn=({instance:e,state:t,setState:n,params:r})=>{const o=D.useRef(t.editedItemId),s=f=>o.current===f,i=f=>{n(m=>U({},m,{editedItemId:f})),o.current=f},l=f=>f===t.editedItemId,c=!!r.isItemEditable,u=f=>{if(f==null||!c)return!1;const m=e.getItem(f);return m?typeof r.isItemEditable=="function"?r.isItemEditable(m):!!r.isItemEditable:!1},d=(f,m)=>{if(!m)throw new Error(["MUI X: The Tree View component requires all items to have a `label` property.","The label of an item cannot be empty.",f].join(`
143
+ `));n(h=>{const g=h.items.itemMetaMap[f];return g.label!==m?U({},h,{items:U({},h.items,{itemMetaMap:U({},h.items.itemMetaMap,{[f]:U({},g,{label:m})})})}):h}),r.onItemLabelChange&&r.onItemLabelChange(f,m)};return{instance:{setEditedItemId:i,isItemBeingEdited:l,updateItemLabel:d,isItemEditable:u,isTreeViewEditable:c,isItemBeingEditedRef:s},publicAPI:{updateItemLabel:d}}};Dn.itemPlugin=rj;Dn.getDefaultizedParams=({params:e,experimentalFeatures:t})=>{const n=t?.labelEditing;return U({},e,{isItemEditable:n?e.isItemEditable??!1:!1})};Dn.getInitialState=()=>({editedItemId:null});Dn.params={onItemLabelChange:!0,isItemEditable:!0};const oo=(e,t)=>e.getAvailablePlugins().has(t),kg=e=>Array.isArray(e)?e.length>0&&e.some(kg):!!e,oj=({itemId:e,children:t})=>{const{instance:n,selection:{multiSelect:r},publicAPI:o}=mo(),s={expandable:kg(t),expanded:n.isItemExpanded(e),focused:n.isItemFocused(e),selected:n.isItemSelected(e),disabled:n.isItemDisabled(e),editing:n?.isItemBeingEdited?n?.isItemBeingEdited(e):!1,editable:n.isItemEditable?n.isItemEditable(e):!1},i=h=>{if(s.disabled)return;s.focused||n.focusItem(h,e);const g=r&&(h.shiftKey||h.ctrlKey||h.metaKey);s.expandable&&!(g&&n.isItemExpanded(e))&&n.toggleItemExpansion(h,e)},l=h=>{if(s.disabled)return;!s.focused&&!s.editing&&n.focusItem(h,e),r&&(h.shiftKey||h.ctrlKey||h.metaKey)?h.shiftKey?n.expandSelectionRange(h,e):n.selectItem({event:h,itemId:e,keepExistingSelection:!0}):n.selectItem({event:h,itemId:e,shouldBeSelected:!0})},c=h=>{const g=h.nativeEvent.shiftKey;r&&g?n.expandSelectionRange(h,e):n.selectItem({event:h,itemId:e,keepExistingSelection:r,shouldBeSelected:h.target.checked})},u=()=>{oo(n,Dn)&&n.isItemEditable(e)&&(n.isItemBeingEdited(e)?n.setEditedItemId(null):n.setEditedItemId(e))};return{interactions:{handleExpansion:i,handleSelection:l,handleCheckboxSelection:c,toggleItemEditing:u,handleSaveItemLabel:(h,g)=>{oo(n,Dn)&&n.isItemBeingEditedRef(e)&&(n.updateItemLabel(e,g),u(),n.focusItem(h,e))},handleCancelItemLabelEditing:h=>{oo(n,Dn)&&n.isItemBeingEditedRef(e)&&(u(),n.focusItem(h,e))}},status:s,publicAPI:o}},bu=D.createContext(()=>-1),Tg=(e,t)=>{let n=t.length-1;for(;n>=0&&!e.isItemNavigable(t[n]);)n-=1;if(n!==-1)return t[n]},Ig=(e,t)=>{const n=e.getItemMeta(t),r=e.getItemOrderedChildrenIds(n.parentId),o=e.getItemIndex(t);if(o===0)return n.parentId;let s=o-1;for(;!e.isItemNavigable(r[s])&&s>=0;)s-=1;if(s===-1)return n.parentId==null?null:Ig(e,n.parentId);let i=r[s],l=Tg(e,e.getItemOrderedChildrenIds(i));for(;e.isItemExpanded(i)&&l!=null;)i=l,l=e.getItemOrderedChildrenIds(i).find(e.isItemNavigable);return i},ua=(e,t)=>{if(e.isItemExpanded(t)){const r=e.getItemOrderedChildrenIds(t).find(e.isItemNavigable);if(r!=null)return r}let n=e.getItemMeta(t);for(;n!=null;){const r=e.getItemOrderedChildrenIds(n.parentId),o=e.getItemIndex(n.id);if(o<r.length-1){let s=o+1;for(;!e.isItemNavigable(r[s])&&s<r.length-1;)s+=1;if(e.isItemNavigable(r[s]))return r[s]}n=e.getItemMeta(n.parentId)}return null},Mg=e=>{let t=null;for(;t==null||e.isItemExpanded(t);){const n=e.getItemOrderedChildrenIds(t),r=Tg(e,n);if(r==null)return t;t=r}return t},mi=e=>e.getItemOrderedChildrenIds(null).find(e.isItemNavigable),Dg=(e,t,n)=>{if(t===n)return[t,n];const r=e.getItemMeta(t),o=e.getItemMeta(n);if(r.parentId===o.id||o.parentId===r.id)return o.parentId===r.id?[r.id,o.id]:[o.id,r.id];const s=[r.id],i=[o.id];let l=r.parentId,c=o.parentId,u=i.indexOf(l)!==-1,d=s.indexOf(c)!==-1,f=!0,m=!0;for(;!d&&!u;)f&&(s.push(l),u=i.indexOf(l)!==-1,f=l!==null,!u&&f&&(l=e.getItemMeta(l).parentId)),m&&!u&&(i.push(c),d=s.indexOf(c)!==-1,m=c!==null,!d&&m&&(c=e.getItemMeta(c).parentId));const h=u?l:c,g=e.getItemOrderedChildrenIds(h),y=s[s.indexOf(h)-1],b=i[i.indexOf(h)-1];return g.indexOf(y)<g.indexOf(b)?[t,n]:[n,t]},sj=(e,t,n)=>{const r=c=>{if(e.isItemExpandable(c)&&e.isItemExpanded(c))return e.getItemOrderedChildrenIds(c)[0];let u=e.getItemMeta(c);for(;u!=null;){const d=e.getItemOrderedChildrenIds(u.parentId),f=e.getItemIndex(u.id);if(f<d.length-1)return d[f+1];u=e.getItemMeta(u.parentId)}throw new Error("Invalid range")},[o,s]=Dg(e,t,n),i=[o];let l=o;for(;l!==s;)l=r(l),e.isItemDisabled(l)||i.push(l);return i},ij=e=>{let t=mi(e);const n=[];for(;t!=null;)n.push(t),t=ua(e,t);return n},gi=(e,t)=>t!==e.closest('*[role="treeitem"]');let $f=0;const aj=()=>($f+=1,`mui-tree-view-${$f}`),xu=({id:e,treeId:t="",itemId:n})=>e??`${t}-${n}`,lj=e=>{const{runItemPlugins:t,items:{onItemClick:n,disabledItemsFocusable:r,indentationAtItemLevel:o},selection:{disableSelection:s,checkboxSelection:i},expansion:{expansionTrigger:l},treeId:c,instance:u,publicAPI:d}=mo(),f=D.useContext(bu),{id:m,itemId:h,label:g,children:y,rootRef:b}=e,{rootRef:x,contentRef:C,propsEnhancers:T}=t(e),{interactions:w,status:M}=oj({itemId:h,children:y}),E=D.useRef(null),j=D.useRef(null),F=Ze(b,x,E),O=Ze(C,j),V=D.useRef(null),L=xu({itemId:h,treeId:c,id:m}),v=u.canItemBeTabbed(h)?0:-1,N={rootRefObject:E,contentRefObject:j,interactions:w},A=Z=>J=>{if(Z.onFocus?.(J),J.defaultMuiPrevented)return;const ae=!M.disabled||r;!M.focused&&ae&&J.currentTarget===J.target&&u.focusItem(J,h)},$=Z=>J=>{if(Z.onBlur?.(J),J.defaultMuiPrevented)return;const ae=u.getItemDOMElement(h);M.editing||J.relatedTarget&&gi(J.relatedTarget,ae)&&(J.target&&J.target?.dataset?.element==="labelInput"&&gi(J.target,ae)||J.relatedTarget?.dataset?.element==="labelInput")||u.removeFocusedItem()},R=Z=>J=>{Z.onKeyDown?.(J),!(J.defaultMuiPrevented||J.target?.dataset?.element==="labelInput")&&u.handleItemKeyDown(J,h)},_=Z=>J=>{Z.onDoubleClick?.(J),!J.defaultMuiPrevented&&w.toggleItemEditing()},z=Z=>J=>{Z.onClick?.(J),n?.(J,h),!(J.defaultMuiPrevented||V.current?.contains(J.target))&&(l==="content"&&w.handleExpansion(J),i||w.handleSelection(J))},W=Z=>J=>{Z.onMouseDown?.(J),!J.defaultMuiPrevented&&(J.shiftKey||J.ctrlKey||J.metaKey||M.disabled)&&J.preventDefault()},H=Z=>J=>{Z.onChange?.(J),!J.defaultMuiPrevented&&(s||M.disabled||w.handleCheckboxSelection(J))},G=Z=>J=>{Z.onClick?.(J),!J.defaultMuiPrevented&&l==="iconContainer"&&w.handleExpansion(J)};return{getRootProps:(Z={})=>{const J=U({},en(e),en(Z));let ae;M.selected?ae=!0:s||M.disabled?ae=void 0:ae=!1;const Q=U({},J,{ref:F,role:"treeitem",tabIndex:v,id:L,"aria-expanded":M.expandable?M.expanded:void 0,"aria-selected":ae,"aria-disabled":M.disabled||void 0},Z,{onFocus:A(J),onBlur:$(J),onKeyDown:R(J)});o&&(Q.style={"--TreeView-itemDepth":typeof f=="function"?f(h):f});const ue=T.root?.(U({},N,{externalEventHandlers:J}))??{};return U({},Q,ue)},getContentProps:(Z={})=>{const J=en(Z),ae=U({},J,Z,{ref:O,onClick:z(J),onMouseDown:W(J),status:M});o&&(ae.indentationAtItemLevel=!0);const Q=T.content?.(U({},N,{externalEventHandlers:J}))??{};return U({},ae,Q)},getGroupTransitionProps:(Z={})=>{const J=en(Z),ae=U({},J,{unmountOnExit:!0,component:"ul",role:"group",in:M.expanded,children:y},Z);return o&&(ae.indentationAtItemLevel=!0),ae},getIconContainerProps:(Z={})=>{const J=en(Z);return U({},J,Z,{onClick:G(J)})},getCheckboxProps:(Z={})=>{const J=en(Z);return U({},J,{visible:i,ref:V,checked:M.selected,disabled:s||M.disabled,tabIndex:-1},Z,{onChange:H(J)})},getLabelProps:(Z={})=>{const J=U({},en(Z)),ae=U({},J,{children:g},Z,{onDoubleClick:_(J)});return u.isTreeViewEditable&&(ae.editable=M.editable),ae},getLabelInputProps:(Z={})=>{const J=en(Z),ae=T.labelInput?.({rootRefObject:E,contentRefObject:j,externalEventHandlers:J,interactions:w})??{};return U({},Z,ae)},getDragAndDropOverlayProps:(Z={})=>{const J=en(Z),ae=T.dragAndDropOverlay?.(U({},N,{externalEventHandlers:J}))??{};return U({},Z,ae)},rootRef:F,status:M,publicAPI:d}},cj=lj;function Pg(e){const{instance:t,items:{onItemClick:n},selection:{multiSelect:r,checkboxSelection:o,disableSelection:s},expansion:{expansionTrigger:i}}=mo(),l=t.isItemExpandable(e),c=t.isItemExpanded(e),u=t.isItemFocused(e),d=t.isItemSelected(e),f=t.isItemDisabled(e),m=t?.isItemBeingEdited?t?.isItemBeingEdited(e):!1,h=t.isItemEditable?t.isItemEditable(e):!1,g=M=>{if(!f){u||t.focusItem(M,e);const E=r&&(M.shiftKey||M.ctrlKey||M.metaKey);l&&!(E&&t.isItemExpanded(e))&&t.toggleItemExpansion(M,e)}},y=M=>{f||(!u&&!m&&t.focusItem(M,e),r&&(M.shiftKey||M.ctrlKey||M.metaKey)?M.shiftKey?t.expandSelectionRange(M,e):t.selectItem({event:M,itemId:e,keepExistingSelection:!0}):t.selectItem({event:M,itemId:e,shouldBeSelected:!0}))},b=M=>{if(s||f)return;const E=M.nativeEvent.shiftKey;r&&E?t.expandSelectionRange(M,e):t.selectItem({event:M,itemId:e,keepExistingSelection:r,shouldBeSelected:M.target.checked})},x=M=>{(M.shiftKey||M.ctrlKey||M.metaKey||f)&&M.preventDefault()},C=()=>{oo(t,Dn)&&t.isItemEditable(e)&&(t.isItemBeingEdited(e)?t.setEditedItemId(null):t.setEditedItemId(e))};return{disabled:f,expanded:c,selected:d,focused:u,editable:h,editing:m,disableSelection:s,checkboxSelection:o,handleExpansion:g,handleSelection:y,handleCheckboxSelection:b,handleContentClick:n,preventSelection:x,expansionTrigger:i,toggleItemEditing:C,handleSaveItemLabel:(M,E)=>{oo(t,Dn)&&t.isItemBeingEditedRef(e)&&(t.updateItemLabel(e,E),C(),t.focusItem(M,e))},handleCancelItemLabelEditing:M=>{oo(t,Dn)&&t.isItemBeingEditedRef(e)&&(C(),t.focusItem(M,e))}}}const uj=re("div",{name:"MuiTreeItem2DragAndDropOverlay",slot:"Root",overridesResolver:(e,t)=>t.root,shouldForwardProp:e=>st.shouldForwardProp(e)&&e!=="action"})(({theme:e})=>({position:"absolute",left:0,display:"flex",top:0,bottom:0,right:0,pointerEvents:"none",variants:[{props:{action:"make-child"},style:{marginLeft:"calc(var(--TreeView-indentMultiplier) * var(--TreeView-itemDepth))",borderRadius:e.shape.borderRadius,backgroundColor:e.vars?`rgba(${e.vars.palette.primary.darkChannel} / ${e.vars.palette.action.focusOpacity})`:st.alpha(e.palette.primary.dark,e.palette.action.focusOpacity)}},{props:{action:"reorder-above"},style:{marginLeft:"calc(var(--TreeView-indentMultiplier) * var(--TreeView-itemDepth))",borderTop:`1px solid ${(e.vars||e).palette.action.active}`}},{props:{action:"reorder-below"},style:{marginLeft:"calc(var(--TreeView-indentMultiplier) * var(--TreeView-itemDepth))",borderBottom:`1px solid ${(e.vars||e).palette.action.active}`}},{props:{action:"move-to-parent"},style:{marginLeft:"calc(var(--TreeView-indentMultiplier) * calc(var(--TreeView-itemDepth) - 1))",borderBottom:`1px solid ${(e.vars||e).palette.action.active}`}}]}));function dj(e){return e.action==null?null:a.jsx(uj,U({},e))}const pj=re("input",{name:"MuiTreeItem2",slot:"LabelInput",overridesResolver:(e,t)=>t.labelInput})(({theme:e})=>U({},e.typography.body1,{width:"100%",backgroundColor:e.palette.background.paper,borderRadius:e.shape.borderRadius,border:"none",padding:"0 2px",boxSizing:"border-box","&:focus":{outline:`1px solid ${e.palette.primary.main}`}})),fj=["classes","className","displayIcon","expansionIcon","icon","label","itemId","onClick","onMouseDown","dragAndDropOverlayProps","labelInputProps"],Eg=D.forwardRef(function(t,n){const{classes:r,className:o,displayIcon:s,expansionIcon:i,icon:l,label:c,itemId:u,onClick:d,onMouseDown:f,dragAndDropOverlayProps:m,labelInputProps:h}=t,g=Fe(t,fj),{disabled:y,expanded:b,selected:x,focused:C,editing:T,editable:w,disableSelection:M,checkboxSelection:E,handleExpansion:j,handleSelection:F,handleCheckboxSelection:O,handleContentClick:V,preventSelection:L,expansionTrigger:v,toggleItemEditing:N}=Pg(u),A=l||i||s,$=D.useRef(null),R=W=>{L(W),f&&f(W)},_=W=>{V?.(W,u),!$.current?.contains(W.target)&&(v==="content"&&j(W),E||F(W),d&&d(W))},z=W=>{W.defaultMuiPrevented||N()};return a.jsxs("div",U({},g,{className:Te(r.root,o,b&&r.expanded,x&&r.selected,C&&r.focused,y&&r.disabled,T&&r.editing,w&&r.editable),onClick:_,onMouseDown:R,ref:n,children:[a.jsx("div",{className:r.iconContainer,children:A}),E&&a.jsx(cu,{className:r.checkbox,checked:x,onChange:O,disabled:y||M,ref:$,tabIndex:-1}),T?a.jsx(pj,U({},h,{className:r.labelInput})):a.jsx("div",U({className:r.label},w&&{onDoubleClick:z},{children:c})),m&&a.jsx(dj,U({},m))]}))});function hj(e){return $e("MuiTreeItem",e)}const hr=Ee("MuiTreeItem",["root","groupTransition","content","expanded","selected","focused","disabled","iconContainer","label","checkbox","labelInput","editable","editing","dragAndDropOverlay"]),Og=Xe(a.jsx("path",{d:"M10 6 8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z"})),Rg=Xe(a.jsx("path",{d:"M16.59 8.59 12 13.17 7.41 8.59 6 10l6 6 6-6z"}));function vu(e){const{children:t,itemId:n}=e,{wrapItem:r,instance:o}=mo();return r({children:t,itemId:n,instance:o})}vu.propTypes={children:fe.node,itemId:fe.string.isRequired};const mj=["children","className","slots","slotProps","ContentComponent","ContentProps","itemId","id","label","onClick","onMouseDown","onFocus","onBlur","onKeyDown"],gj=["ownerState"],yj=["ownerState"],bj=["ownerState"],xj=Cg(),vj=e=>{const{classes:t}=e;return Re({root:["root"],content:["content"],expanded:["expanded"],selected:["selected"],focused:["focused"],disabled:["disabled"],iconContainer:["iconContainer"],checkbox:["checkbox"],label:["label"],labelInput:["labelInput"],editing:["editing"],editable:["editable"],groupTransition:["groupTransition"]},hj,t)},Sj=re("li",{name:"MuiTreeItem",slot:"Root",overridesResolver:(e,t)=>t.root})({listStyle:"none",margin:0,padding:0,outline:0}),Cj=re(Eg,{name:"MuiTreeItem",slot:"Content",overridesResolver:(e,t)=>[t.content,t.iconContainer&&{[`& .${hr.iconContainer}`]:t.iconContainer},t.label&&{[`& .${hr.label}`]:t.label}],shouldForwardProp:e=>Or(e)&&e!=="indentationAtItemLevel"})(({theme:e})=>({padding:e.spacing(.5,1),borderRadius:e.shape.borderRadius,width:"100%",boxSizing:"border-box",position:"relative",display:"flex",alignItems:"center",gap:e.spacing(1),cursor:"pointer",WebkitTapHighlightColor:"transparent","&:hover":{backgroundColor:(e.vars||e).palette.action.hover,"@media (hover: none)":{backgroundColor:"transparent"}},[`&.${hr.disabled}`]:{opacity:(e.vars||e).palette.action.disabledOpacity,backgroundColor:"transparent"},[`&.${hr.focused}`]:{backgroundColor:(e.vars||e).palette.action.focus},[`&.${hr.selected}`]:{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / ${e.vars.palette.action.selectedOpacity})`:st.alpha(e.palette.primary.main,e.palette.action.selectedOpacity),"&:hover":{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.hoverOpacity}))`:st.alpha(e.palette.primary.main,e.palette.action.selectedOpacity+e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / ${e.vars.palette.action.selectedOpacity})`:st.alpha(e.palette.primary.main,e.palette.action.selectedOpacity)}},[`&.${hr.focused}`]:{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.focusOpacity}))`:st.alpha(e.palette.primary.main,e.palette.action.selectedOpacity+e.palette.action.focusOpacity)}},[`& .${hr.iconContainer}`]:{width:16,display:"flex",flexShrink:0,justifyContent:"center","& svg":{fontSize:18}},[`& .${hr.label}`]:U({width:"100%",boxSizing:"border-box",minWidth:0,position:"relative"},e.typography.body1),[`& .${hr.checkbox}`]:{padding:0},variants:[{props:{indentationAtItemLevel:!0},style:{paddingLeft:`calc(${e.spacing(1)} + var(--TreeView-itemChildrenIndentation) * var(--TreeView-itemDepth))`}}]})),wj=re(hi,{name:"MuiTreeItem",slot:"GroupTransition",overridesResolver:(e,t)=>t.groupTransition,shouldForwardProp:e=>Or(e)&&e!=="indentationAtItemLevel"})({margin:0,padding:0,paddingLeft:"var(--TreeView-itemChildrenIndentation)",variants:[{props:{indentationAtItemLevel:!0},style:{paddingLeft:0}}]}),kj=D.forwardRef(function(t,n){const{icons:r,runItemPlugins:o,items:{disabledItemsFocusable:s,indentationAtItemLevel:i},selection:{disableSelection:l},expansion:{expansionTrigger:c},treeId:u,instance:d}=mo(),f=D.useContext(bu),m=xj({props:t,name:"MuiTreeItem"}),{children:h,className:g,slots:y,slotProps:b,ContentComponent:x=Eg,ContentProps:C,itemId:T,id:w,label:M,onClick:E,onMouseDown:j,onBlur:F,onKeyDown:O}=m,V=Fe(m,mj),{expanded:L,focused:v,selected:N,disabled:A,editing:$,handleExpansion:R,handleCancelItemLabelEditing:_,handleSaveItemLabel:z}=Pg(T),{contentRef:W,rootRef:H,propsEnhancers:G}=o(m),se=D.useRef(null),pe=D.useRef(null),me=Ze(n,H,se),X=Ze(C?.ref,W,pe),K={expandIcon:y?.expandIcon??r.slots.expandIcon??Og,collapseIcon:y?.collapseIcon??r.slots.collapseIcon??Rg,endIcon:y?.endIcon??r.slots.endIcon,icon:y?.icon,groupTransition:y?.groupTransition},le=Ae=>Array.isArray(Ae)?Ae.length>0&&Ae.some(le):!!Ae,oe=le(h),te=U({},m,{expanded:L,focused:v,selected:N,disabled:A,indentationAtItemLevel:i}),Z=vj(te),J=K.groupTransition??void 0,ae=Ge({elementType:J,ownerState:{},externalSlotProps:b?.groupTransition,additionalProps:U({unmountOnExit:!0,in:L,component:"ul",role:"group"},i?{indentationAtItemLevel:!0}:{}),className:Z.groupTransition}),Q=Ae=>{c==="iconContainer"&&R(Ae)},ue=L?K.collapseIcon:K.expandIcon,he=Ge({elementType:ue,ownerState:{},externalSlotProps:Ae=>L?U({},In(r.slotProps.collapseIcon,Ae),In(b?.collapseIcon,Ae)):U({},In(r.slotProps.expandIcon,Ae),In(b?.expandIcon,Ae)),additionalProps:{onClick:Q}}),de=Fe(he,gj),Se=oe&&ue?a.jsx(ue,U({},de)):null,ce=oe?void 0:K.endIcon,Pe=Ge({elementType:ce,ownerState:{},externalSlotProps:Ae=>oe?{}:U({},In(r.slotProps.endIcon,Ae),In(b?.endIcon,Ae))}),Ce=Fe(Pe,yj),Ve=ce?a.jsx(ce,U({},Ce)):null,De=K.icon,pt=Ge({elementType:De,ownerState:{},externalSlotProps:b?.icon}),Ye=Fe(pt,bj),tt=De?a.jsx(De,U({},Ye)):null;let gt;N?gt=!0:l||A?gt=void 0:gt=!1;function kt(Ae){!v&&(!A||s)&&Ae.currentTarget===Ae.target&&d.focusItem(Ae,T)}function Pt(Ae){F?.(Ae),!($||Ae.relatedTarget&&gi(Ae.relatedTarget,se.current)&&(Ae.target&&Ae.target?.dataset?.element==="labelInput"&&gi(Ae.target,se.current)||Ae.relatedTarget?.dataset?.element==="labelInput"))&&d.removeFocusedItem()}const Yt=Ae=>{O?.(Ae),Ae.target?.dataset?.element!=="labelInput"&&d.handleItemKeyDown(Ae,T)},lt=xu({itemId:T,treeId:u,id:w}),Ie=d.canItemBeTabbed(T)?0:-1,ft={rootRefObject:se,contentRefObject:pe,interactions:{handleSaveItemLabel:z,handleCancelItemLabelEditing:_}},it=G.root?.(U({},ft,{externalEventHandlers:en(V)}))??{},jt=G.content?.(U({},ft,{externalEventHandlers:en(C)}))??{},je=G.dragAndDropOverlay?.(U({},ft,{externalEventHandlers:{}}))??{},ze=G.labelInput?.(U({},ft,{externalEventHandlers:{}}))??{};return a.jsx(vu,{itemId:T,children:a.jsxs(Sj,U({className:Te(Z.root,g),role:"treeitem","aria-expanded":oe?L:void 0,"aria-selected":gt,"aria-disabled":A||void 0,id:lt,tabIndex:Ie},V,{ownerState:te,onFocus:kt,onBlur:Pt,onKeyDown:Yt,ref:me,style:i?U({},V.style,{"--TreeView-itemDepth":typeof f=="function"?f(T):f}):V.style},it,{children:[a.jsx(Cj,U({as:x,classes:{root:Z.content,expanded:Z.expanded,selected:Z.selected,focused:Z.focused,disabled:Z.disabled,editable:Z.editable,editing:Z.editing,iconContainer:Z.iconContainer,label:Z.label,labelInput:Z.labelInput,checkbox:Z.checkbox},label:M,itemId:T,onClick:E,onMouseDown:j,icon:tt,expansionIcon:Se,displayIcon:Ve,ownerState:te},C,jt,je.action==null?{}:{dragAndDropOverlayProps:je},ze.value==null?{}:{labelInputProps:ze},{ref:X})),h&&a.jsx(wj,U({as:J},ae,{children:h}))]}))})});function Tj(e){const{slots:t,slotProps:n,status:r}=e,o=mo(),s=U({},o.icons.slots,{expandIcon:o.icons.slots.expandIcon??Og,collapseIcon:o.icons.slots.collapseIcon??Rg}),i=o.icons.slotProps;let l;t?.icon?l="icon":r.expandable?r.expanded?l="collapseIcon":l="expandIcon":l="endIcon";const c=t?.[l]??s[l],u=Ge({elementType:c,externalSlotProps:d=>U({},In(i[l],d),In(n?.[l],d)),ownerState:{}});return c?a.jsx(c,U({},u)):null}const Ij=["visible"],Mj=re("li",{name:"MuiTreeItem2",slot:"Root",overridesResolver:(e,t)=>t.root})({listStyle:"none",margin:0,padding:0,outline:0}),Dj=re("div",{name:"MuiTreeItem2",slot:"Content",overridesResolver:(e,t)=>t.content,shouldForwardProp:e=>Or(e)&&e!=="status"&&e!=="indentationAtItemLevel"})(({theme:e})=>({padding:e.spacing(.5,1),borderRadius:e.shape.borderRadius,width:"100%",boxSizing:"border-box",position:"relative",display:"flex",alignItems:"center",gap:e.spacing(1),cursor:"pointer",WebkitTapHighlightColor:"transparent","&:hover":{backgroundColor:(e.vars||e).palette.action.hover,"@media (hover: none)":{backgroundColor:"transparent"}},variants:[{props:{indentationAtItemLevel:!0},style:{paddingLeft:`calc(${e.spacing(1)} + var(--TreeView-itemChildrenIndentation) * var(--TreeView-itemDepth))`}},{props:({status:t})=>t.disabled,style:{opacity:(e.vars||e).palette.action.disabledOpacity,backgroundColor:"transparent"}},{props:({status:t})=>t.focused,style:{backgroundColor:(e.vars||e).palette.action.focus}},{props:({status:t})=>t.selected,style:{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / ${e.vars.palette.action.selectedOpacity})`:st.alpha(e.palette.primary.main,e.palette.action.selectedOpacity),"&:hover":{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.hoverOpacity}))`:st.alpha(e.palette.primary.main,e.palette.action.selectedOpacity+e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / ${e.vars.palette.action.selectedOpacity})`:st.alpha(e.palette.primary.main,e.palette.action.selectedOpacity)}}}},{props:({status:t})=>t.selected&&t.focused,style:{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.focusOpacity}))`:st.alpha(e.palette.primary.main,e.palette.action.selectedOpacity+e.palette.action.focusOpacity)}}]})),Pj=re("div",{name:"MuiTreeItem2",slot:"Label",overridesResolver:(e,t)=>t.label,shouldForwardProp:e=>Or(e)&&e!=="editable"})(({theme:e})=>U({width:"100%",boxSizing:"border-box",minWidth:0,position:"relative",overflow:"hidden"},e.typography.body1,{variants:[{props:({editable:t})=>t,style:{paddingLeft:"2px"}}]})),Ej=re("div",{name:"MuiTreeItem2",slot:"IconContainer",overridesResolver:(e,t)=>t.iconContainer})({width:16,display:"flex",flexShrink:0,justifyContent:"center","& svg":{fontSize:18}});re(hi,{name:"MuiTreeItem2",slot:"GroupTransition",overridesResolver:(e,t)=>t.groupTransition,shouldForwardProp:e=>Or(e)&&e!=="indentationAtItemLevel"})({margin:0,padding:0,paddingLeft:"var(--TreeView-itemChildrenIndentation)",variants:[{props:{indentationAtItemLevel:!0},style:{paddingLeft:0}}]});re(D.forwardRef((e,t)=>{const{visible:n}=e,r=Fe(e,Ij);return n?a.jsx(cu,U({},r,{ref:t})):null}),{name:"MuiTreeItem2",slot:"Checkbox",overridesResolver:(e,t)=>t.checkbox})({padding:0});function Oj(e){return $e("MuiRichTreeView",e)}Ee("MuiRichTreeView",["root"]);const Rj=(e,t)=>{const n=D.useRef({}),[r,o]=D.useState(()=>{const i={};return e.forEach(l=>{l.models&&Object.entries(l.models).forEach(([c,u])=>{n.current[c]={isControlled:t[c]!==void 0,getDefaultValue:u.getDefaultValue},i[c]=u.getDefaultValue(t)})}),i});return Object.fromEntries(Object.entries(n.current).map(([i,l])=>{const c=t[i]??r[i];return[i,{value:c,setControlledValue:u=>{l.isControlled||o(d=>U({},d,{[i]:u}))}}]}))};class jj{constructor(){this.maxListeners=20,this.warnOnce=!1,this.events={}}on(t,n,r={}){let o=this.events[t];o||(o={highPriority:new Map,regular:new Map},this.events[t]=o),r.isFirst?o.highPriority.set(n,!0):o.regular.set(n,!0)}removeListener(t,n){this.events[t]&&(this.events[t].regular.delete(n),this.events[t].highPriority.delete(n))}removeAllListeners(){this.events={}}emit(t,...n){const r=this.events[t];if(!r)return;const o=Array.from(r.highPriority.keys()),s=Array.from(r.regular.keys());for(let i=o.length-1;i>=0;i-=1){const l=o[i];r.highPriority.has(l)&&l.apply(this,n)}for(let i=0;i<s.length;i+=1){const l=s[i];r.regular.has(l)&&l.apply(this,n)}}once(t,n){const r=this;this.on(t,function o(...s){r.removeListener(t,o),n.apply(r,s)})}}const $j=e=>e.isPropagationStopped!==void 0,jg=()=>{const[e]=D.useState(()=>new jj),t=D.useCallback((...r)=>{const[o,s,i={}]=r;i.defaultMuiPrevented=!1,!($j(i)&&i.isPropagationStopped())&&e.emit(o,s,i)},[e]),n=D.useCallback((r,o)=>(e.on(r,o),()=>{e.removeListener(r,o)}),[e]);return{instance:{$$publishEvent:t,$$subscribeEvent:n}}};jg.params={};const $g=({plugins:e})=>{const t=new Set(e);return{instance:{getAvailablePlugins:()=>t}}};$g.params={};const Su=({params:e,state:t,setState:n})=>{D.useEffect(()=>{n(o=>o.id.treeId===e.id&&o.id.treeId!==void 0?o:U({},o,{id:U({},o.id,{treeId:e.id??aj()})}))},[n,e.id]);const r=e.id??t.id.treeId;return{getRootProps:()=>({id:r}),contextValue:{treeId:r}}};Su.params={id:!0};Su.getInitialState=({id:e})=>({id:{treeId:e??void 0}});const Aj=[jg,$g,Su],Fj=["slots","slotProps","apiRef","experimentalFeatures"],Nj=e=>{let{props:{slots:t,slotProps:n,apiRef:r,experimentalFeatures:o},plugins:s}=e,i=Fe(e.props,Fj);const l={};s.forEach(m=>{Object.assign(l,m.params)});const c={},u={};Object.keys(i).forEach(m=>{const h=i[m];l[m]?c[m]=h:u[m]=h});const d=o??{},f=s.reduce((m,h)=>h.getDefaultizedParams?h.getDefaultizedParams({params:m,experimentalFeatures:d}):m,c);return{apiRef:r,forwardedProps:u,pluginParams:f,slots:t??{},slotProps:n??{},experimentalFeatures:d}},Lj=({plugins:e,instance:t,publicAPI:n,rootRef:r})=>({runItemPlugins:l=>{let c=null,u=null;const d=[],f={};e.forEach(g=>{if(!g.itemPlugin)return;const y=g.itemPlugin({props:l,rootRef:c,contentRef:u});y?.rootRef&&(c=y.rootRef),y?.contentRef&&(u=y.contentRef),y?.propsEnhancers&&(d.push(y.propsEnhancers),Object.keys(y.propsEnhancers).forEach(b=>{f[b]=!0}))});const m=g=>y=>{const b={};return d.forEach(x=>{const C=x[g];C!=null&&Object.assign(b,C(y))}),b},h=Object.fromEntries(Object.keys(f).map(g=>[g,m(g)]));return{contentRef:u,rootRef:c,propsEnhancers:h}},wrapItem:({itemId:l,children:c})=>{let u=c;for(let d=e.length-1;d>=0;d-=1){const f=e[d];f.wrapItem&&(u=f.wrapItem({itemId:l,children:u,instance:t}))}return u},wrapRoot:({children:l})=>{let c=l;for(let u=e.length-1;u>=0;u-=1){const d=e[u];d.wrapRoot&&(c=d.wrapRoot({children:c,instance:t}))}return c},instance:t,rootRef:r,publicAPI:n});function Bj(e){const t=D.useRef({});return e?(e.current==null&&(e.current={}),e.current):t.current}const Vj=({plugins:e,rootRef:t,props:n})=>{const r=[...Aj,...e],{pluginParams:o,forwardedProps:s,apiRef:i,experimentalFeatures:l,slots:c,slotProps:u}=Nj({plugins:r,props:n}),d=Rj(r,o),m=D.useRef({}).current,h=Bj(i),g=D.useRef(null),y=Ze(g,t),b=Lj({plugins:r,instance:m,publicAPI:h,rootRef:g}),[x,C]=D.useState(()=>{const E={};return r.forEach(j=>{j.getInitialState&&Object.assign(E,j.getInitialState(o))}),E}),T=[],w=E=>{const j=E({instance:m,params:o,slots:c,slotProps:u,experimentalFeatures:l,state:x,setState:C,rootRef:g,models:d,plugins:r});j.getRootProps&&T.push(j.getRootProps),j.publicAPI&&Object.assign(h,j.publicAPI),j.instance&&Object.assign(m,j.instance),j.contextValue&&Object.assign(b,j.contextValue)};return r.forEach(w),{getRootProps:(E={})=>{const j=U({role:"tree"},s,E,{ref:y});return T.forEach(F=>{Object.assign(j,F(E))}),j},rootRef:y,contextValue:b,instance:m}},zj=(e,t,n)=>{e.$$publishEvent(t,n)},Ho="__TREE_VIEW_ROOT_PARENT_ID__",_j=e=>{const t={};return e.forEach((n,r)=>{t[n]=r}),t},Wj=["children"],Ag=({items:e,isItemDisabled:t,getItemLabel:n,getItemId:r})=>{const o={},s={},i={[Ho]:[]},l=(u,d,f)=>{const m=r?r(u):u.id;if(m==null)throw new Error(["MUI X: The Tree View component requires all items to have a unique `id` property.","Alternatively, you can use the `getItemId` prop to specify a custom id for each item.","An item was provided without id in the `items` prop:",JSON.stringify(u)].join(`
144
+ `));if(o[m]!=null)throw new Error(["MUI X: The Tree View component requires all items to have a unique `id` property.","Alternatively, you can use the `getItemId` prop to specify a custom id for each item.",`Two items were provided with the same id in the \`items\` prop: "${m}"`].join(`
145
+ `));const h=n?n(u):u.label;if(h==null)throw new Error(["MUI X: The Tree View component requires all items to have a `label` property.","Alternatively, you can use the `getItemLabel` prop to specify a custom label for each item.","An item was provided without label in the `items` prop:",JSON.stringify(u)].join(`
146
+ `));o[m]={id:m,label:h,parentId:f,idAttribute:void 0,expandable:!!u.children?.length,disabled:t?t(u):!1,depth:d},s[m]=u;const g=f??Ho;i[g]||(i[g]=[]),i[g].push(m),u.children?.forEach(y=>l(y,d+1,m))};e.forEach(u=>l(u,0,null));const c={};return Object.keys(i).forEach(u=>{c[u]=_j(i[u])}),{itemMetaMap:o,itemMap:s,itemOrderedChildrenIds:i,itemChildrenIndexes:c}},Mi=({instance:e,params:t,state:n,setState:r,experimentalFeatures:o})=>{const s=D.useCallback(x=>n.items.itemMetaMap[x],[n.items.itemMetaMap]),i=D.useCallback(x=>n.items.itemMap[x],[n.items.itemMap]),l=D.useCallback(()=>{const x=C=>{const T=n.items.itemMap[C],w=Fe(T,Wj),M=n.items.itemOrderedChildrenIds[C];return M&&(w.children=M.map(x)),w};return n.items.itemOrderedChildrenIds[Ho].map(x)},[n.items.itemMap,n.items.itemOrderedChildrenIds]),c=D.useCallback(x=>{if(x==null)return!1;let C=e.getItemMeta(x);if(!C)return!1;if(C.disabled)return!0;for(;C.parentId!=null;)if(C=e.getItemMeta(C.parentId),C.disabled)return!0;return!1},[e]),u=D.useCallback(x=>{const C=e.getItemMeta(x).parentId??Ho;return n.items.itemChildrenIndexes[C][x]},[e,n.items.itemChildrenIndexes]),d=D.useCallback(x=>n.items.itemOrderedChildrenIds[x??Ho]??[],[n.items.itemOrderedChildrenIds]),f=x=>{const C=e.getItemMeta(x);return C==null?null:document.getElementById(xu({treeId:n.id.treeId,itemId:x,id:C.idAttribute}))},m=x=>t.disabledItemsFocusable?!0:!e.isItemDisabled(x),h=D.useRef(!1),g=D.useCallback(()=>{h.current=!0},[]),y=D.useCallback(()=>h.current,[]);return D.useEffect(()=>{e.areItemUpdatesPrevented()||r(x=>{const C=Ag({items:t.items,isItemDisabled:t.isItemDisabled,getItemId:t.getItemId,getItemLabel:t.getItemLabel});return Object.values(x.items.itemMetaMap).forEach(T=>{C.itemMetaMap[T.id]||zj(e,"removeItem",{id:T.id})}),U({},x,{items:C})})},[e,r,t.items,t.isItemDisabled,t.getItemId,t.getItemLabel]),{getRootProps:()=>({style:{"--TreeView-itemChildrenIndentation":typeof t.itemChildrenIndentation=="number"?`${t.itemChildrenIndentation}px`:t.itemChildrenIndentation}}),publicAPI:{getItem:i,getItemDOMElement:f,getItemTree:l,getItemOrderedChildrenIds:d},instance:{getItemMeta:s,getItem:i,getItemTree:l,getItemsToRender:()=>{const x=C=>{const T=n.items.itemMetaMap[C];return{label:T.label,itemId:T.id,id:T.idAttribute,children:n.items.itemOrderedChildrenIds[C]?.map(x)}};return n.items.itemOrderedChildrenIds[Ho].map(x)},getItemIndex:u,getItemDOMElement:f,getItemOrderedChildrenIds:d,isItemDisabled:c,isItemNavigable:m,preventItemUpdates:g,areItemUpdatesPrevented:y},contextValue:{items:{onItemClick:t.onItemClick,disabledItemsFocusable:t.disabledItemsFocusable,indentationAtItemLevel:o.indentationAtItemLevel??!1}}}};Mi.getInitialState=e=>({items:Ag({items:e.items,isItemDisabled:e.isItemDisabled,getItemId:e.getItemId,getItemLabel:e.getItemLabel})});Mi.getDefaultizedParams=({params:e})=>U({},e,{disabledItemsFocusable:e.disabledItemsFocusable??!1,itemChildrenIndentation:e.itemChildrenIndentation??"12px"});Mi.wrapRoot=({children:e,instance:t})=>a.jsx(bu.Provider,{value:n=>t.getItemMeta(n)?.depth??0,children:e});Mi.params={disabledItemsFocusable:!0,items:!0,isItemDisabled:!0,getItemLabel:!0,getItemId:!0,onItemClick:!0,itemChildrenIndentation:!0};const el=({instance:e,params:t,models:n})=>{const r=D.useMemo(()=>{const f=new Map;return n.expandedItems.value.forEach(m=>{f.set(m,!0)}),f},[n.expandedItems.value]),o=(f,m)=>{t.onExpandedItemsChange?.(f,m),n.expandedItems.setControlledValue(m)},s=D.useCallback(f=>r.has(f),[r]),i=D.useCallback(f=>!!e.getItemMeta(f)?.expandable,[e]),l=Me((f,m)=>{const h=e.isItemExpanded(m);e.setItemExpansion(f,m,!h)}),c=Me((f,m,h)=>{if(e.isItemExpanded(m)===h)return;let y;h?y=[m].concat(n.expandedItems.value):y=n.expandedItems.value.filter(b=>b!==m),t.onItemExpansionToggle&&t.onItemExpansionToggle(f,m,h),o(f,y)}),u=(f,m)=>{const h=e.getItemMeta(m),y=e.getItemOrderedChildrenIds(h.parentId).filter(x=>e.isItemExpandable(x)&&!e.isItemExpanded(x)),b=n.expandedItems.value.concat(y);y.length>0&&(t.onItemExpansionToggle&&y.forEach(x=>{t.onItemExpansionToggle(f,x,!0)}),o(f,b))},d=D.useMemo(()=>t.expansionTrigger?t.expansionTrigger:e.isTreeViewEditable?"iconContainer":"content",[t.expansionTrigger,e.isTreeViewEditable]);return{publicAPI:{setItemExpansion:c},instance:{isItemExpanded:s,isItemExpandable:i,setItemExpansion:c,toggleItemExpansion:l,expandAllSiblings:u},contextValue:{expansion:{expansionTrigger:d}}}};el.models={expandedItems:{getDefaultValue:e=>e.defaultExpandedItems}};const Hj=[];el.getDefaultizedParams=({params:e})=>U({},e,{defaultExpandedItems:e.defaultExpandedItems??Hj});el.params={expandedItems:!0,defaultExpandedItems:!0,onExpandedItemsChange:!0,onItemExpansionToggle:!0,expansionTrigger:!0};const da=e=>Array.isArray(e)?e:e!=null?[e]:[],Vl=e=>{const t={};return e.forEach(n=>{t[n]=!0}),t},tl=({instance:e,params:t,models:n})=>{const r=D.useRef(null),o=D.useRef({}),s=D.useMemo(()=>{const y=new Map;return Array.isArray(n.selectedItems.value)?n.selectedItems.value.forEach(b=>{y.set(b,!0)}):n.selectedItems.value!=null&&y.set(n.selectedItems.value,!0),y},[n.selectedItems.value]),i=(y,b)=>{if(t.onItemSelectionToggle)if(t.multiSelect){const x=b.filter(T=>!e.isItemSelected(T)),C=n.selectedItems.value.filter(T=>!b.includes(T));x.forEach(T=>{t.onItemSelectionToggle(y,T,!0)}),C.forEach(T=>{t.onItemSelectionToggle(y,T,!1)})}else b!==n.selectedItems.value&&(n.selectedItems.value!=null&&t.onItemSelectionToggle(y,n.selectedItems.value,!1),b!=null&&t.onItemSelectionToggle(y,b,!0));t.onSelectedItemsChange&&t.onSelectedItemsChange(y,b),n.selectedItems.setControlledValue(b)},l=y=>s.has(y),c=({event:y,itemId:b,keepExistingSelection:x=!1,shouldBeSelected:C})=>{if(t.disableSelection)return;let T;if(x){const w=da(n.selectedItems.value),M=e.isItemSelected(b);M&&(C===!1||C==null)?T=w.filter(E=>E!==b):!M&&(C===!0||C==null)?T=[b].concat(w):T=w}else C===!1||C==null&&e.isItemSelected(b)?T=t.multiSelect?[]:null:T=t.multiSelect?[b]:b;i(y,T),r.current=b,o.current={}},u=(y,[b,x])=>{if(t.disableSelection||!t.multiSelect)return;let C=da(n.selectedItems.value).slice();Object.keys(o.current).length>0&&(C=C.filter(E=>!o.current[E]));const T=Vl(C),w=sj(e,b,x),M=w.filter(E=>!T[E]);C=C.concat(M),i(y,C),o.current=Vl(w)};return{getRootProps:()=>({"aria-multiselectable":t.multiSelect}),publicAPI:{selectItem:c},instance:{isItemSelected:l,selectItem:c,selectAllNavigableItems:y=>{if(t.disableSelection||!t.multiSelect)return;const b=ij(e);i(y,b),o.current=Vl(b)},expandSelectionRange:(y,b)=>{if(r.current!=null){const[x,C]=Dg(e,b,r.current);u(y,[x,C])}},selectRangeFromStartToItem:(y,b)=>{u(y,[mi(e),b])},selectRangeFromItemToEnd:(y,b)=>{u(y,[b,Mg(e)])},selectItemFromArrowNavigation:(y,b,x)=>{if(t.disableSelection||!t.multiSelect)return;let C=da(n.selectedItems.value).slice();Object.keys(o.current).length===0?(C.push(x),o.current={[b]:!0,[x]:!0}):(o.current[b]||(o.current={}),o.current[x]?(C=C.filter(T=>T!==b),delete o.current[b]):(C.push(x),o.current[x]=!0)),i(y,C)}},contextValue:{selection:{multiSelect:t.multiSelect,checkboxSelection:t.checkboxSelection,disableSelection:t.disableSelection}}}};tl.models={selectedItems:{getDefaultValue:e=>e.defaultSelectedItems}};const Uj=[];tl.getDefaultizedParams=({params:e})=>U({},e,{disableSelection:e.disableSelection??!1,multiSelect:e.multiSelect??!1,checkboxSelection:e.checkboxSelection??!1,defaultSelectedItems:e.defaultSelectedItems??(e.multiSelect?Uj:null)});tl.params={disableSelection:!0,multiSelect:!0,checkboxSelection:!0,defaultSelectedItems:!0,selectedItems:!0,onSelectedItemsChange:!0,onItemSelectionToggle:!0};const Af=1e3;class qj{constructor(t=Af){this.timeouts=new Map,this.cleanupTimeout=Af,this.cleanupTimeout=t}register(t,n,r){this.timeouts||(this.timeouts=new Map);const o=setTimeout(()=>{typeof n=="function"&&n(),this.timeouts.delete(r.cleanupToken)},this.cleanupTimeout);this.timeouts.set(r.cleanupToken,o)}unregister(t){const n=this.timeouts.get(t.cleanupToken);n&&(this.timeouts.delete(t.cleanupToken),clearTimeout(n))}reset(){this.timeouts&&(this.timeouts.forEach((t,n)=>{this.unregister({cleanupToken:n})}),this.timeouts=void 0)}}class Yj{constructor(){this.registry=new FinalizationRegistry(t=>{typeof t=="function"&&t()})}register(t,n,r){this.registry.register(t,n,r)}unregister(t){this.registry.unregister(t)}reset(){}}class Kj{}function Gj(e){let t=0;return function(r,o,s){e.registry===null&&(e.registry=typeof FinalizationRegistry<"u"?new Yj:new qj);const[i]=D.useState(new Kj),l=D.useRef(null),c=D.useRef(void 0);c.current=s;const u=D.useRef(null);if(!l.current&&c.current){const d=(f,m)=>{m.defaultMuiPrevented||c.current?.(f,m)};l.current=r.$$subscribeEvent(o,d),t+=1,u.current={cleanupToken:t},e.registry.register(i,()=>{l.current?.(),l.current=null,u.current=null},u.current)}else!c.current&&l.current&&(l.current(),l.current=null,u.current&&(e.registry.unregister(u.current),u.current=null));D.useEffect(()=>{if(!l.current&&c.current){const d=(f,m)=>{m.defaultMuiPrevented||c.current?.(f,m)};l.current=r.$$subscribeEvent(o,d)}return u.current&&e.registry&&(e.registry.unregister(u.current),u.current=null),()=>{l.current?.(),l.current=null}},[r,o])}}const Zj={registry:null},Xj=Gj(Zj),Fg=(e=document)=>{const t=e.activeElement;return t?t.shadowRoot?Fg(t.shadowRoot):t:null},Qj=(e,t)=>{let n=da(t).find(r=>{if(!e.isItemNavigable(r))return!1;const o=e.getItemMeta(r);return o&&(o.parentId==null||e.isItemExpanded(o.parentId))});return n==null&&(n=mi(e)),n},Cu=({instance:e,params:t,state:n,setState:r,models:o,rootRef:s})=>{const i=Qj(e,o.selectedItems.value),l=Me(b=>{const x=typeof b=="function"?b(n.focusedItemId):b;n.focusedItemId!==x&&r(C=>U({},C,{focusedItemId:x}))}),c=D.useCallback(()=>!!s.current&&s.current.contains(Fg(zt(s.current))),[s]),u=D.useCallback(b=>n.focusedItemId===b&&c(),[n.focusedItemId,c]),d=b=>{const x=e.getItemMeta(b);return x&&(x.parentId==null||e.isItemExpanded(x.parentId))},f=(b,x)=>{const C=e.getItemDOMElement(x);C&&C.focus(),l(x),t.onItemFocus&&t.onItemFocus(b,x)},m=Me((b,x)=>{d(x)&&f(b,x)}),h=Me(()=>{if(n.focusedItemId==null)return;if(e.getItemMeta(n.focusedItemId)){const x=e.getItemDOMElement(n.focusedItemId);x&&x.blur()}l(null)}),g=b=>b===i;Xj(e,"removeItem",({id:b})=>{n.focusedItemId===b&&f(null,i)});const y=b=>x=>{b.onFocus?.(x),!x.defaultMuiPrevented&&x.target===x.currentTarget&&f(x,i)};return{getRootProps:b=>({onFocus:y(b)}),publicAPI:{focusItem:m},instance:{isItemFocused:u,canItemBeTabbed:g,focusItem:m,removeFocusedItem:h}}};Cu.getInitialState=()=>({focusedItemId:null});Cu.params={onItemFocus:!0};function Jj(e){return!!e&&e.length===1&&!!e.match(/\S/)}const Ng=({instance:e,params:t,state:n})=>{const r=An(),o=D.useRef({}),s=Me(d=>{o.current=d(o.current)});D.useEffect(()=>{if(e.areItemUpdatesPrevented())return;const d={},f=m=>{d[m.id]=m.label.substring(0,1).toLowerCase()};Object.values(n.items.itemMetaMap).forEach(f),o.current=d},[n.items.itemMetaMap,t.getItemId,e]);const i=(d,f)=>{const m=f.toLowerCase(),h=x=>{const C=ua(e,x);return C===null?mi(e):C};let g=null,y=h(d);const b={};for(;g==null&&!b[y];)o.current[y]===m?g=y:(b[y]=!0,y=h(y));return g},l=d=>!t.disableSelection&&!e.isItemDisabled(d),c=d=>!e.isItemDisabled(d)&&e.isItemExpandable(d);return{instance:{updateFirstCharMap:s,handleItemKeyDown:(d,f)=>{if(d.defaultMuiPrevented||d.altKey||gi(d.target,d.currentTarget))return;const m=d.ctrlKey||d.metaKey,h=d.key;switch(!0){case(h===" "&&l(f)):{d.preventDefault(),t.multiSelect&&d.shiftKey?e.expandSelectionRange(d,f):e.selectItem({event:d,itemId:f,keepExistingSelection:t.multiSelect,shouldBeSelected:t.multiSelect?void 0:!0});break}case h==="Enter":{oo(e,Dn)&&e.isItemEditable(f)&&!e.isItemBeingEdited(f)?e.setEditedItemId(f):c(f)?(e.toggleItemExpansion(d,f),d.preventDefault()):l(f)&&(t.multiSelect?(d.preventDefault(),e.selectItem({event:d,itemId:f,keepExistingSelection:!0})):e.isItemSelected(f)||(e.selectItem({event:d,itemId:f}),d.preventDefault()));break}case h==="ArrowDown":{const g=ua(e,f);g&&(d.preventDefault(),e.focusItem(d,g),t.multiSelect&&d.shiftKey&&l(g)&&e.selectItemFromArrowNavigation(d,f,g));break}case h==="ArrowUp":{const g=Ig(e,f);g&&(d.preventDefault(),e.focusItem(d,g),t.multiSelect&&d.shiftKey&&l(g)&&e.selectItemFromArrowNavigation(d,f,g));break}case(h==="ArrowRight"&&!r||h==="ArrowLeft"&&r):{if(m)return;if(e.isItemExpanded(f)){const g=ua(e,f);g&&(e.focusItem(d,g),d.preventDefault())}else c(f)&&(e.toggleItemExpansion(d,f),d.preventDefault());break}case(h==="ArrowLeft"&&!r||h==="ArrowRight"&&r):{if(m)return;if(c(f)&&e.isItemExpanded(f))e.toggleItemExpansion(d,f),d.preventDefault();else{const g=e.getItemMeta(f).parentId;g&&(e.focusItem(d,g),d.preventDefault())}break}case h==="Home":{l(f)&&t.multiSelect&&m&&d.shiftKey?e.selectRangeFromStartToItem(d,f):e.focusItem(d,mi(e)),d.preventDefault();break}case h==="End":{l(f)&&t.multiSelect&&m&&d.shiftKey?e.selectRangeFromItemToEnd(d,f):e.focusItem(d,Mg(e)),d.preventDefault();break}case h==="*":{e.expandAllSiblings(d,f),d.preventDefault();break}case(String.fromCharCode(d.keyCode)==="A"&&m&&t.multiSelect&&!t.disableSelection):{e.selectAllNavigableItems(d),d.preventDefault();break}case(!m&&!d.shiftKey&&Jj(h)):{const g=i(f,h);g!=null&&(e.focusItem(d,g),d.preventDefault());break}}}}}};Ng.params={};const Lg=({slots:e,slotProps:t})=>({contextValue:{icons:{slots:{collapseIcon:e.collapseIcon,expandIcon:e.expandIcon,endIcon:e.endIcon},slotProps:{collapseIcon:t.collapseIcon,expandIcon:t.expandIcon,endIcon:t.endIcon}}}});Lg.params={};const e2=[Mi,el,tl,Cu,Ng,Lg,Dn],t2=["ownerState"];function n2({slots:e,slotProps:t,label:n,id:r,itemId:o,itemsToRender:s}){const i=e?.item??kj,l=Ge({elementType:i,externalSlotProps:t?.item,additionalProps:{itemId:o,id:r,label:n},ownerState:{itemId:o,label:n}}),c=Fe(l,t2),u=D.useMemo(()=>s?a.jsx(Bg,{itemsToRender:s,slots:e,slotProps:t}):null,[s,e,t]);return a.jsx(i,U({},c,{children:u}))}function Bg(e){const{itemsToRender:t,slots:n,slotProps:r}=e;return a.jsx(D.Fragment,{children:t.map(o=>a.jsx(n2,{slots:n,slotProps:r,label:o.label,id:o.id,itemId:o.itemId,itemsToRender:o.children},o.itemId))})}const r2=Cg(),o2=e=>{const{classes:t}=e;return Re({root:["root"]},Oj,t)},s2=re("ul",{name:"MuiRichTreeView",slot:"Root",overridesResolver:(e,t)=>t.root})({padding:0,margin:0,listStyle:"none",outline:0,position:"relative"}),i2=D.forwardRef(function(t,n){const r=r2({props:t,name:"MuiRichTreeView"}),{getRootProps:o,contextValue:s,instance:i}=Vj({plugins:e2,rootRef:n,props:r}),{slots:l,slotProps:c}=r,u=o2(r),d=l?.root??s2,f=Ge({elementType:d,externalSlotProps:c?.root,className:u.root,getSlotProps:o,ownerState:r});return a.jsx(nj,{value:s,children:a.jsx(d,U({},f,{children:a.jsx(Bg,{slots:l,slotProps:c,itemsToRender:i.getItemsToRender()})}))})}),a2=Xe([a.jsx("path",{d:"M19 5v14H5V5zm0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2"},"0"),a.jsx("path",{d:"M14 17H7v-2h7zm3-4H7v-2h10zm0-4H7V7h10z"},"1")]),l2=Xe(a.jsx("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m1 15h-2v-2h2zm0-4h-2V7h2z"})),c2=Xe(a.jsx("path",{d:"M19 15v4H5v-4zm1-2H4c-.55 0-1 .45-1 1v6c0 .55.45 1 1 1h16c.55 0 1-.45 1-1v-6c0-.55-.45-1-1-1M7 18.5c-.82 0-1.5-.67-1.5-1.5s.68-1.5 1.5-1.5 1.5.67 1.5 1.5-.67 1.5-1.5 1.5M19 5v4H5V5zm1-2H4c-.55 0-1 .45-1 1v6c0 .55.45 1 1 1h16c.55 0 1-.45 1-1V4c0-.55-.45-1-1-1M7 8.5c-.82 0-1.5-.67-1.5-1.5S6.18 5.5 7 5.5s1.5.68 1.5 1.5S7.83 8.5 7 8.5"})),u2=Xe(a.jsx("path",{d:"M15 4v2h3v12h-3v2h5V4zM4 20h5v-2H6V6h3V4H4z"}));function d2({items:e,defaultExpandedItems:t,onClickTreeNode:n}){return a.jsx(i2,{items:g2(e,n),defaultExpandedItems:t,slots:{item:m2}})}const p2=Lf.animated(hi);function f2(e){const t=Lf.useSpring({to:{opacity:e.in?1:0,transform:`translate3d(0,${e.in?0:20}px,0)`}});return a.jsx(p2,{style:t,...e})}function h2({item:e,...t}){const n=a.jsxs(Pj,{...t,sx:{display:"flex",alignItems:"center",color:e.error?"error.main":"grey.600"},children:[e.fileType==="directory"&&a.jsx(fg,{})||e.fileType==="notebook"&&a.jsx(a2,{})||e.fileType==="model"&&a.jsx(u2,{})||e.fileType=="database"&&a.jsx(c2,{})||a.jsx(l2,{}),a.jsx(I.Typography,{variant:"body2",sx:{marginLeft:"5px"},color:e.error?"error.main":e.link?"primary.main":"grey.600",children:e.label})]});return e.error?a.jsx(I.Tooltip,{title:e.error,placement:"right",children:n}):n}const m2=D.forwardRef(function(t,n){const{id:r,itemId:o,label:s,children:i,disabled:l,...c}=t,{getRootProps:u,getContentProps:d,getLabelProps:f,getIconContainerProps:m,getGroupTransitionProps:h,status:g,publicAPI:y}=cj({id:r,itemId:o,children:i,label:s,disabled:l,rootRef:n}),b=y.getItem(o);return g.selected=!1,g.focused=!1,a.jsx(vu,{itemId:o,children:a.jsxs(Mj,{...u(c),children:[a.jsxs(Dj,{...d(),...b.link&&{onClick:x=>b.link(x)},sx:{pointerEvents:!b.selectable&&"none"},children:[a.jsx(Ej,{...m(),children:a.jsx(Tj,{status:g})}),a.jsx(h2,{...f({item:b})})]}),i&&a.jsx(f2,{...h()})]})})});function g2(e,t){const n=new Map;return e.map(r=>{let o=n;const s=r.path.split("/");s.forEach((i,l)=>{l===s.length-1?o.set(i,r):(o.has(i)||o.set(i,new Map),o=o.get(i))})}),Vg(n,"",t)}function Vg(e,t,n){const r=[];return e.forEach((o,s)=>{const i=s.endsWith(".malloy")&&"model"||s.endsWith(".malloynb")&&"notebook"||s.endsWith(".parquet")&&"database"||"unknown";if(i!=="unknown"){const l=o;r.push({id:t+s,label:s,fileType:i,link:i==="model"||i==="notebook"?c=>n(t+s,c):void 0,selectable:i==="model"||i==="notebook",error:"error"in l?l.error:void 0})}else{const l=t+s+"/";r.push({id:l,label:s,fileType:"directory",selectable:!0,link:void 0,children:Vg(o,l,n)})}}),r}const y2=["notebooks/","models/"];function b2({onClickModelFile:e,resourceUri:t}){const{environmentName:n,packageName:r,versionId:o}=St(t),{apiClients:s}=xe.useServer(),{data:i,isError:l,error:c,isSuccess:u}=vt({queryKey:["models",n,r,o],queryFn:()=>s.models.listModels(n,r,o)});return a.jsx(xe.PackageCard,{children:a.jsxs(xe.PackageCardContent,{children:[a.jsx(xe.PackageSectionTitle,{children:"Semantic Models"}),a.jsxs(I.Box,{sx:{maxHeight:"200px",overflowY:"auto"},children:[!u&&!l&&a.jsx(Ht,{text:"Fetching Models..."}),l&&a.jsx(_t,{error:c,context:`${n} > ${r} > Models`}),u&&i.data.length>0&&a.jsx(d2,{items:i.data.sort((d,f)=>d.path.localeCompare(f.path)),onClickTreeNode:e,defaultExpandedItems:y2}),u&&i.data.length===0&&a.jsx(I.Typography,{variant:"body2",children:"No models found"})]})]})})}function zg(e){return{background:e.dashboardRoot,tableBackground:e.tableBackground,tableHeaderColor:e.tableHeader,tableBodyColor:e.tableBody,tableBorder:e.border,tablePinnedBackground:e.tableHeaderBackground,tablePinnedBorder:e.pinnedBorder,tableFontSize:`${e.font.size}px`,fontFamily:e.font.family,mapColor:e.mapColor}}function _g(e){const{foreground:t,axisFaint:n,font:r}=e,o={background:e.background,font:r.family,title:{color:t,font:r.family},axis:{labelColor:t,titleColor:t,domainColor:n,tickColor:n,gridColor:n,labelFont:r.family,titleFont:r.family},legend:{labelColor:t,titleColor:t,labelFont:r.family,titleFont:r.family},header:{labelColor:t,titleColor:t},range:{category:e.series}};return s=>o}function Wg(e){if(!e)return;const t=e.tag("theme");if(!t)return;const n={},r=t.tag("palette");if(r){const s={},i=r.textArray("series");i&&i.length>0&&(s.series=i);for(const l of xe.PER_MODE_COLOR_KEYS){const c=r.tag(l);if(!c)continue;const u={},d=c.text("light"),f=c.text("dark");d&&(u.light=d),f&&(u.dark=f),Object.keys(u).length>0&&(s[l]=u)}Object.keys(s).length>0&&(n.palette=s)}const o=t.tag("font");if(o){const s={},i=o.text("family");i&&(s.family=i);const l=o.numeric("size");typeof l=="number"&&Number.isFinite(l)&&(s.size=l),Object.keys(s).length>0&&(n.font=s)}return Object.keys(n).length>0?n:void 0}const x2=async(e,t)=>{if(typeof window>"u")throw new Error("MalloyRenderer can only be used in browser environment");const{MalloyRenderer:n}=await import("@malloydata/render");return new n({onClick:t,vegaConfigOverride:_g(e),theme:zg(e),onError:o=>{console.error("Error rendering visualization:",typeof o,o)}}).createViz()};typeof window<"u"&&import("@malloydata/render");async function v2(e){if(!e||typeof e!="object")return;const t=e,n=[...Array.isArray(t.model_annotations)?t.model_annotations:[],...Array.isArray(t.source_annotations)?t.source_annotations:[],...Array.isArray(t.annotations)?t.annotations:[]].map(o=>typeof o?.value=="string"?o.value:void 0).filter(o=>!!o);if(n.length===0)return;let r;try{({parseAnnotation:r}=await import("@malloydata/malloy-tag"))}catch{return}try{const{tag:o}=r(n);return Wg(o)}catch(o){console.warn("Failed to parse # theme.* annotations; chart will render with the shell theme.",{error:o,lines:n});return}}function S2(e,t,n){const r=Wm(t,n);for(const[o,s]of Object.entries(r))e.style.setProperty(o,s)}const C2=`
147
+ /* Card geometry, through the renderer's OWN theme vars rather than over the top
148
+ of them. It declares --malloy-theme--dashboard-* on .malloy-render itself and
149
+ passes each through to the --malloy-render--* the card CSS reads, so a value
150
+ inherited from our wrapper loses to that declaration however early it is set:
151
+ this has to be a rule on the same element, at higher specificity. Doubling the
152
+ class does that, and then no !important is needed — which matters, because
153
+ !important here also lands on .dashboard-item-borderless and repaints a card
154
+ the author asked to have no card. */
155
+ .malloy-render.malloy-render {
156
+ --malloy-theme--dashboard-card-radius: var(--publisher-dashboard-card-radius);
157
+ --malloy-theme--dashboard-card-padding: var(--publisher-dashboard-card-padding);
158
+ }
159
+ /* dashboard.css hardcodes background: #f7f9fc on .malloy-dashboard
160
+ and .dashboard-row-header, which would paint light grey in dark
161
+ mode and also bleed an operator-picked palette.background across
162
+ the panel chrome in light. Both surfaces use
163
+ --malloy-render--background here, which buildMalloyExplicitTheme
164
+ wires to dashboardRoot: a mode-keyed neutral that stays decoupled
165
+ from palette.background (the chart canvas) on purpose. Selectors
166
+ are duplicated at higher specificity to beat the renderer s own
167
+ scoped rules. */
168
+ .malloy-render .malloy-dashboard,
169
+ .malloy-render.malloy-render .malloy-dashboard,
170
+ div.malloy-render .malloy-dashboard {
171
+ /* --publisher-dashboard-root is set on the outer Publisher wrapper
172
+ (see buildTableCssVars) and stays decoupled from
173
+ --malloy-render--background, which gets shadowed inside the
174
+ renderer when a theme.background annotation is present. The
175
+ dedicated var means the panel between tiles always paints the
176
+ operator neutral dashboardRoot regardless of annotations. */
177
+ background: var(--publisher-dashboard-root) !important;
178
+ background-color: var(--publisher-dashboard-root) !important;
179
+ color: var(--malloy-render--table-body-color) !important;
180
+ }
181
+ .malloy-render .malloy-dashboard .dashboard-row,
182
+ .malloy-render .malloy-dashboard .dashboard-row-body,
183
+ .malloy-render .malloy-dashboard .dashboard-row-header,
184
+ .malloy-render.malloy-render .malloy-dashboard .dashboard-row-header,
185
+ div.malloy-render .malloy-dashboard .dashboard-row-header {
186
+ /* Belt + suspenders: dashboard.css hardcodes .dashboard-row-header
187
+ to #f7f9fc, and row / row-body have no explicit background but
188
+ get caught in any annotation-driven inline writes. Force all of
189
+ them to the neutral panel colour. */
190
+ background: var(--publisher-dashboard-root) !important;
191
+ background-color: var(--publisher-dashboard-root) !important;
192
+ }
193
+ .malloy-render .malloy-dashboard .dashboard-item:not(.dashboard-item-borderless) {
194
+ /* Tile padding around each chart / table. Uses our custom
195
+ --malloy-render--tile-background so the operator can theme the
196
+ tile separately from the table header row (which paints from
197
+ --malloy-render--table-pinned-background below).
198
+
199
+ A flat bordered card rather than the renderer's shadow ring, which is what
200
+ makes it match the composite tile's Paper. :not(borderless) because
201
+ # borderless asks for no card at all, and an !important background and
202
+ border drew one anyway. */
203
+ background: var(--malloy-render--tile-background) !important;
204
+ color: var(--malloy-render--table-body-color) !important;
205
+ box-shadow: none !important;
206
+ border: var(--malloy-render--table-border) !important;
207
+ }
208
+ .malloy-render .malloy-dashboard .dashboard-row-header-separator {
209
+ background: var(--malloy-render--table-border) !important;
210
+ }
211
+ .malloy-render .malloy-table .th.column-cell {
212
+ /* Non-pinned tables have no header background in the renderer's
213
+ own CSS (only pinned scrolled tables paint the pinned-header
214
+ with this var). Force the same value here so every table has a
215
+ visible header band reflecting the operator's choice. */
216
+ background: var(--malloy-render--table-pinned-background) !important;
217
+ }
218
+ .malloy-render .dashboard-item-title,
219
+ .malloy-render .dashboard-dimension-name {
220
+ color: var(--malloy-render--label-color) !important;
221
+ }
222
+ .malloy-render .dashboard-item-value,
223
+ .malloy-render .dashboard-item-value-measure,
224
+ .malloy-render .dashboard-dimension-value {
225
+ color: var(--malloy-render--value-color) !important;
226
+ }
227
+ .malloy-render .malloy-table,
228
+ .malloy-render .malloy-list {
229
+ color: var(--malloy-render--table-body-color) !important;
230
+ }
231
+ .malloy-render .column-cell.th,
232
+ .malloy-render .cell-content.header {
233
+ color: var(--malloy-render--table-header-color) !important;
234
+ }
235
+ /* A cell whose column declares a "# drill" this surface can honor, marked
236
+ by markDrillableCells. Ordinary text with a pointer cursor until hovered,
237
+ then it reads as a link: the same affordance Malloyyo gives the same tag,
238
+ and the only thing that tells a reader a cell navigates. Kept off the
239
+ resting state deliberately: a column painted blue competes with the data.
240
+ (No backticks in here: this is inside a template literal.) */
241
+ .malloy-render .${nr} {
242
+ cursor: pointer;
243
+ }
244
+ .malloy-render .${nr}:hover > .cell-content {
245
+ color: var(--publisher-drill-link) !important;
246
+ text-decoration: underline;
247
+ }
248
+ /* Keyboard focus reads the same as hover, plus a ring: a hover colour is not
249
+ something a keyboard user can produce, and a focus ring is not something a
250
+ mouse user sees. focus-visible rather than focus, so a click does not leave a
251
+ ring behind it. (No backticks in here: this is inside a template literal.) */
252
+ .malloy-render .${nr}:focus-visible {
253
+ outline: 2px solid var(--publisher-drill-link);
254
+ outline-offset: -2px;
255
+ }
256
+ .malloy-render .${nr}:focus-visible > .cell-content {
257
+ color: var(--publisher-drill-link) !important;
258
+ text-decoration: underline;
259
+ }
260
+ `,Ff="publisher-malloy-renderer-overrides";function w2(){if(typeof document>"u"||document.getElementById(Ff))return;const e=document.createElement("style");e.id=Ff,e.textContent=C2,document.head.appendChild(e)}function k2({result:e,height:t,drill:n,onSizeChange:r,onSizing:o}){const s=Y.useRef(null),i=Y.useRef(n);i.current=n;const l=Y.useCallback(x=>{i.current?.onClick(x)},[]),c=n!==void 0,u=Y.useRef(!1),d=Y.useRef(null),f=Y.useRef(0),{theme:m,layers:h,mode:g}=xe.usePublisherTheme(),y=I.useTheme().shape.borderRadius,b=Y.useMemo(()=>({radius:`${y}px`,padding:`${au}px`}),[y]);return Y.useEffect(()=>()=>{f.current+=1,d.current?.viz.remove(),d.current=null},[]),Y.useLayoutEffect(()=>{if(!s.current||!e)return;w2();const x=s.current,C=f.current+=1;let T=!1;const w=()=>!T&&C===f.current;let M,E,j=null,F=0,O=null,V=null,L=null,v=null,N=null,A=null,$=null,R=0,_=null;u.current=!1;let z,W;const H=G=>{if(T||!G.firstElementChild||la(z,W)==="container")return;const se=jm(z,W);if(u.current&&!se)return;const pe=Am(G,oc(z));pe>0&&(u.current=!0,r&&pe!==R&&(R=pe,r(pe)));const me=$m(G,oc(z));se&&me&&$!==me&&($=me,A?.disconnect(),A=new ResizeObserver(()=>H(G)),A.observe(me))};return(async()=>{let G;try{G=JSON.parse(e)}catch(te){console.error("Error parsing visualization result:",te);return}const se=await v2(G),pe=se?xe.resolveTheme([...h,se],g):m;if(!w())return;try{E=await x2(pe,l)}catch(te){console.error("Failed to create renderer:",te);return}if(!w()){E.remove(),E=void 0;return}const me=d.current;M=document.createElement("div"),M.style.width="100%",M.style.height="100%",S2(M,pe,b),me&&(x.style.position="relative",M.style.position="absolute",M.style.inset="0",M.style.visibility="hidden"),x.appendChild(M);const X=M;v=new MutationObserver(()=>{N&&clearTimeout(N),N=setTimeout(()=>{H(X),u.current&&v?.disconnect()},100)}),v.observe(M,{childList:!0,subtree:!0,attributes:!0});const K=E;let le=!1;const oe=()=>{le||!w()||(le=!0,_&&(clearTimeout(_),_=null),me&&(me.viz.remove(),me.node.parentNode===x&&x.removeChild(me.node)),X.style.position="",X.style.inset="",X.style.visibility="",x.style.position="",d.current={viz:K,node:X},H(X))};try{E.setResult(G);try{const Z=E.getMetadata(),J=Z?.getRootField();z=J?.renderAs(),W=J?Z?.getPluginsForField(J.key)?.[0]?.sizingStrategy:void 0}catch{z=void 0,W=void 0}o?.(la(z,W)),M.dataset.malloyRenderAs=z??"unknown",M.dataset.malloySizing=la(z,W),E.render(M);const te=i.current;try{if(te){const Z=Uf(E,te.canDrill),J=()=>{try{qf(X,Z)}catch(he){console.warn("Drill affordance skipped:",he)}};J();const ae=he=>{const Se=he.querySelector(".cell-content")??he,ce=Se.getBoundingClientRect();Se.dispatchEvent(new MouseEvent("click",{bubbles:!0,cancelable:!0,view:Se.ownerDocument.defaultView,clientX:Math.round(ce.left+ce.width/2),clientY:Math.round(ce.bottom)}))},Q=he=>he.target?.closest?.(`.${nr}`)??null,ue=(he,de)=>{vd(he,de)?.focus()};O=he=>{const de=Q(he);if(!de)return;const Se=he.key==="ArrowDown"?1:he.key==="ArrowUp"?-1:he.key==="Home"?"first":he.key==="End"?"last":void 0;if(Se!==void 0){he.preventDefault(),ue(de,Se);return}he.key==="Enter"?(he.preventDefault(),ae(de)):he.key===" "&&he.preventDefault()},V=he=>{if(he.key!==" ")return;const de=Q(he);de&&(he.preventDefault(),ae(de))},L=he=>{const de=he.target?.closest?.(`.${nr}`);de&&vd(de,0)},X.addEventListener("keydown",O),X.addEventListener("keyup",V),X.addEventListener("focusin",L),Z.size>0&&typeof MutationObserver<"u"&&(j=new MutationObserver(()=>{cancelAnimationFrame(F),F=requestAnimationFrame(J)}),j.observe(X,{childList:!0,subtree:!0}))}}catch(Z){console.warn("Drill affordance skipped:",Z)}E.onReady(oe),_=setTimeout(oe,1e4)}catch(te){console.error("Error rendering visualization:",te),v?.disconnect(),A?.disconnect(),j?.disconnect(),E.remove(),E=void 0,X.parentNode===x&&x.removeChild(X)}})(),()=>{T=!0,v?.disconnect(),A?.disconnect(),N&&clearTimeout(N),_&&clearTimeout(_),M&&d.current?.node!==M&&(O&&M.removeEventListener("keydown",O),V&&M.removeEventListener("keyup",V),L&&M.removeEventListener("focusin",L),j?.disconnect(),cancelAnimationFrame(F),E?.remove(),M.parentNode===x&&x.removeChild(M),x.style.position="")}},[e,l,c,r,o,m,h,g,b]),a.jsx("div",{ref:s,style:{width:"100%",height:t?`${t}px`:"400px"}})}function Hg(e){return typeof window>"u"?a.jsx(I.Box,{sx:{width:"100%",height:e.height?`${e.height}px`:"100%",display:"flex",alignItems:"center",justifyContent:"center",color:"text.secondary"},children:"Loading..."}):a.jsx(Y.Suspense,{fallback:a.jsx(I.Box,{sx:{width:"100%",height:e.height?`${e.height}px`:"100%",display:"flex",alignItems:"center",justifyContent:"center",color:"text.secondary"},children:"Loading visualization..."}),children:a.jsx(k2,{...e})})}const T2=Object.freeze(Object.defineProperty({__proto__:null,default:Hg},Symbol.toStringTag,{value:"Module"})),Ug=Y.createContext(void 0);function I2({children:e,documentStorage:t}){const n=Y.useMemo(()=>({documentStorage:t}),[t]);return a.jsx(Ug.Provider,{value:n,children:e})}function M2(){const e=Y.useContext(Ug);if(!e)throw new Error("useDocumentStorage must be used within a DocumentStorageProvider");return e}const hc={name:"Local",description:"Stored in this browser only",writeable:!0},mc="publisher:document:";class D2{async listWorkspaces(t){return[hc]}async listDocuments(t,n){if(t.name!==hc.name)return[];const r=[];for(let o=0;o<localStorage.length;o++){const s=localStorage.key(o),i=s===null?void 0:P2(s);i&&(n===void 0||i.type===n)&&r.push(i)}return r}async getDocument(t){const n=localStorage.getItem(Vs(t));if(n===null)throw Nf(t);return n}async saveDocument(t,n){localStorage.setItem(Vs(t),n)}async deleteDocument(t){const n=Vs(t);if(localStorage.getItem(n)===null)throw Nf(t);localStorage.removeItem(n)}async moveDocument(t,n){const r=await this.getDocument(t);localStorage.setItem(Vs(n),r),localStorage.removeItem(Vs(t))}}function Vs(e){return`${mc}${e.type}:${e.path}`}function P2(e){if(!e.startsWith(mc))return;const t=e.slice(mc.length),n=t.indexOf(":");if(n<=0)return;const r=t.slice(0,n);if(!(r!=="dashboard"&&r!=="notebook"))return{workspace:hc.name,type:r,path:t.slice(n+1)}}function Nf(e){return new Error(`No ${e.type} at ${e.workspace}/${e.path}`)}function E2(e,t){return`${e}:${t}`}function co(e){return E2(e.source,e.filterName??e.dimensionName)}function Xn(e,t=!1){return e==null?"null":t?e instanceof Date?`@${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,"0")}-${String(e.getDate()).padStart(2,"0")}`:`@${e}`:typeof e=="string"?`'${jr(e)}'`:typeof e=="number"?String(e):typeof e=="boolean"?e?"true":"false":String(e)}function O2(e){const{dimensionName:t,matchType:n,value:r,value2:o}=e,s=`\`${t}\``,i=r instanceof Date;switch(n){case"Equals":case"Semantic Search":return Array.isArray(r)&&r.length>0?`(${r.map(c=>`${s} = ${Xn(c,i)}`).join(" or ")})`:Array.isArray(r)?"":`${s} = ${Xn(r,i)}`;case"Contains":return typeof r=="string"?`${s} ~ f'%${jr(r)}%'`:Array.isArray(r)?"":`${s} = ${Xn(r)}`;case"After":return Array.isArray(r)?"":`${s} > ${Xn(r,i)}`;case"Before":return Array.isArray(r)?"":`${s} < ${Xn(r,i)}`;case"Greater Than":return Array.isArray(r)?"":`${s} > ${Xn(r)}`;case"Less Than":return Array.isArray(r)?"":`${s} < ${Xn(r)}`;case"Between":return Array.isArray(r)?"":o!==void 0?`${s} >= ${Xn(r,i)} and ${s} <= ${Xn(o,i)}`:`${s} >= ${Xn(r,i)}`;default:return""}}function R2(e){const t=new Map;for(const n of e){const r=`${n.source}|${n.model}`,o=t.get(r)||[];o.push(n),t.set(r,o)}return t}function j2(e,t,n,r){const o=t.filter(u=>(u.filterType==="Star"||u.filterType==="MinMax"||u.filterType==="DateMinMax")&&!u.values);if(o.length===0)return"";const i=[...new Set(o.map(u=>u.dimensionName))].map(u=>`\`${u}\``).join(", "),l=r?.filter(u=>u.source===e)||[],c=l.length>0?l.map(u=>O2(u)).filter(u=>u.length>0).join(" and "):"";return`
261
+ run: ${e} -> {
262
+ ${c?`where: ${c}`:""}
263
+ index: ${i}
264
+ } -> {
265
+ select: *
266
+ order_by: weight desc
267
+
268
+ limit: ${n}
269
+ }
270
+ `}function $2(e,t){const n=new Map;for(const d of t){const f=co(d);n.set(f,[])}const r=JSON.parse(e),o=r.schema.fields,s=new Map;o.forEach((d,f)=>{s.set(d.name,f)});const i=d=>{if(!d)return null;switch(d.kind){case"string_cell":return d.string_value??null;case"number_cell":return d.number_value??null;case"boolean_cell":return d.boolean_value??null;case"null_cell":return null;default:return console.log("Unknown cell kind: "+d.kind),null}},c=(r.data?.array_value||[]).map(d=>{const f={};return d.kind==="record_cell"&&d.record_value&&d.record_value.forEach((m,h)=>{const g=o[h]?.name;if(g){const y=i(m);g==="fieldName"&&typeof y=="string"?f.fieldName=y:g==="fieldPath"&&typeof y=="string"?f.fieldPath=y:g==="fieldType"&&typeof y=="string"?f.fieldType=y:g==="fieldValue"&&typeof y=="string"?f.fieldValue=y:g==="weight"&&typeof y=="number"&&(f.weight=y)}}),f}),u=c.length===0||c.every(d=>!d.fieldName);for(const d of t){if(d.filterType==="NONE"||d.filterType==="Retrieval")continue;const f=c.filter(h=>{const g=h.fieldName||"",y=h.fieldPath||"";if(g===d.dimensionName||y===d.dimensionName||g.toLowerCase()===d.dimensionName.toLowerCase()||y.toLowerCase()===d.dimensionName.toLowerCase())return!0;const b=y.split(".").pop()||"";return b===d.dimensionName||b.toLowerCase()===d.dimensionName.toLowerCase()});if(f.length===0)continue;const m=co(d);if(d.filterType==="Star"){const h=f.filter(g=>g.fieldType==="string").map(g=>({value:g.fieldValue??"",count:g.weight})).sort((g,y)=>(y.count??0)-(g.count??0));n.set(m,h)}else if(d.filterType==="MinMax"){console.log("MinMax dimensionEntries: "+JSON.stringify(f,null,2)),console.log("All MinMax dimension entries fieldTypes:",f.map(g=>g.fieldType));const h=f.find(g=>g.fieldType==="number");if(console.log("numericEntry: "+JSON.stringify(h,null,2)),h?.fieldValue){const g=h.fieldValue,y=g.split(" to ");if(console.log("rangeParts: "+y),y.length===2){const b=[{value:parseFloat(y[0])},{value:parseFloat(y[1])}];n.set(m,b)}else console.warn(`Could not parse numeric range for ${d.dimensionName}: ${g}`)}else console.warn(`No numeric entry found for ${d.dimensionName}. Available entries:`,f)}else if(d.filterType==="DateMinMax"){const h=f.find(g=>g.fieldType==="date"||g.fieldType==="timestamp"||g.fieldType==="string");if(console.log("dateEntry: "+JSON.stringify(h,null,2)),console.log("All date dimension entries fieldTypes:",f.map(g=>g.fieldType)),h?.fieldValue){const g=h.fieldValue,y=g.split(" to ");if(console.log("date rangeParts: "+y),y.length===2){const b=[{value:new Date(y[0].trim())},{value:new Date(y[1].trim())}];n.set(m,b)}else console.warn(`Could not parse date range for ${d.dimensionName}: ${g}`)}else console.warn(`No date entry found for ${d.dimensionName}. Available entries:`,f)}}return{values:n,noRowsMatchedFilter:u}}function qg(e){const{environment:t,package:n,dimensionSpecs:r,versionId:o,enabled:s=!0,indexLimit:i=1e4,activeFilters:l=[]}=e,c=Y.useMemo(()=>R2(r),[r]),u=Y.useMemo(()=>{const y=[];for(const[b,x]of c){const[C,T]=b.split("|"),w=j2(C,x,i,l);w?y.push({key:b,source:C,model:T,query:w,specs:x}):console.log("No query for source: ",C,"model: ",T)}return y},[c,i,l]),d=Y.useMemo(()=>s&&u.length>0&&r.some(y=>y.filterType==="Star"||y.filterType==="MinMax"||y.filterType==="DateMinMax"),[s,u,r]),{apiClients:f}=xe.useServer(),m=vt({queryKey:["dimensionalFilter",t,n,r,o,l],queryFn:async()=>{if(!d){const C=new Map;for(const T of r){const w=co(T);C.set(w,[])}return{values:C,noRowsMatchedFilter:!1}}const y=await Promise.all(u.map(async C=>{const T=await f.models.executeQueryModel(t,n,C.model,{query:C.query,versionId:o,bypassFilters:!0});return{config:C,result:$2(T.data.result,C.specs)}})),b=new Map;let x=!1;for(const{result:C}of y){for(const[T,w]of C.values)b.set(T,w);C.noRowsMatchedFilter&&(x=!0)}return{values:b,noRowsMatchedFilter:x}},enabled:d,staleTime:300*1e3,placeholderData:y=>y}),h=m.data?.values;return{data:Y.useMemo(()=>{const y=new Map;for(const b of r){const x=co(b);b.values?y.set(x,b.values.map(C=>({value:C}))):y.set(x,[])}if(h)for(const[b,x]of h)x.length>0&&y.set(b,x);return y},[r,h]),noRowsMatchedFilter:m.data?.noRowsMatchedFilter??!1,isLoading:d?m.isPending:!1,isError:d?m.isError:!1,error:d?m.error:null,refetch:m.refetch}}function Qn(e,t=!1){return e==null?"null":t?e instanceof Date?`@${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,"0")}-${String(e.getDate()).padStart(2,"0")}`:`@${e}`:typeof e=="string"?`'${jr(e)}'`:typeof e=="number"?String(e):typeof e=="boolean"?e?"true":"false":String(e)}function A2(e){const{dimensionName:t,matchType:n,value:r,value2:o}=e,s=`\`${t}\``,i=r instanceof Date;switch(n){case"Equals":case"Semantic Search":return Array.isArray(r)&&r.length>0?`(${r.map(c=>`${s} = ${Qn(c,i)}`).join(" or ")})`:Array.isArray(r)?"":`${s} = ${Qn(r,i)}`;case"Contains":return typeof r=="string"?`${s} ~ f'%${jr(r)}%'`:Array.isArray(r)?"":`${s} = ${Qn(r)}`;case"After":return Array.isArray(r)?"":`${s} > ${Qn(r,i)}`;case"Before":return Array.isArray(r)?"":`${s} < ${Qn(r,i)}`;case"Greater Than":return Array.isArray(r)?"":`${s} > ${Qn(r)}`;case"Less Than":return Array.isArray(r)?"":`${s} < ${Qn(r)}`;case"Between":return Array.isArray(r)?"":o!==void 0?`${s} >= ${Qn(r,i)} and ${s} <= ${Qn(o,i)}`:`${s} >= ${Qn(r,i)}`;default:return""}}function Yg(e){const{dimensionSpecs:t}=e,[n,r]=Y.useState(()=>{const u=new Map;return t.forEach(d=>{const f=co(d);u.set(f,{spec:d,selection:null})}),u});Y.useEffect(()=>{r(u=>{const d=new Map;return t.forEach(f=>{const m=co(f),h=u.get(m);d.set(m,{spec:f,selection:h?.selection??null})}),d})},[t]);const o=Y.useCallback((u,d)=>{r(f=>{const m=new Map(f),h=m.get(u);return h&&m.set(u,{...h,selection:d}),m})},[]),s=Y.useCallback(u=>{o(u,null)},[o]),i=Y.useCallback(()=>{r(u=>{const d=new Map(u);return d.forEach((f,m)=>{d.set(m,{...f,selection:null})}),d})},[]),l=Y.useCallback(()=>{const u=[];return n.forEach(d=>{d.selection&&u.push(d.selection)}),u},[n]),c=Y.useCallback(()=>{const u=l();if(u.length===0)return"";const d=u.map(f=>A2(f)).filter(f=>f.length>0);return d.length===0?"":`where ${d.join(" and ")}`},[l]);return{filterStates:n,updateFilter:o,clearFilter:s,clearAllFilters:i,getActiveFilters:l,generateWhereClause:c}}function Jn(e,t=!1){return e==null?"null":t?e instanceof Date?`@${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,"0")}-${String(e.getDate()).padStart(2,"0")}`:`@${e}`:typeof e=="string"?`'${jr(e)}'`:typeof e=="number"?String(e):typeof e=="boolean"?e?"true":"false":String(e)}function F2(e){const{dimensionName:t,matchType:n,value:r,value2:o}=e,s=`\`${t}\``,i=r instanceof Date;switch(n){case"Equals":case"Semantic Search":return Array.isArray(r)&&r.length>0?`(${r.map(c=>`${s} = ${Jn(c,i)}`).join(" or ")})`:Array.isArray(r)?"":`${s} = ${Jn(r,i)}`;case"Contains":return typeof r=="string"?`${s} ~ f'%${jr(r)}%'`:Array.isArray(r)?"":`${s} = ${Jn(r)}`;case"After":return Array.isArray(r)?"":`${s} > ${Jn(r,i)}`;case"Before":return Array.isArray(r)?"":`${s} < ${Jn(r,i)}`;case"Greater Than":return Array.isArray(r)?"":`${s} > ${Jn(r)}`;case"Less Than":return Array.isArray(r)?"":`${s} < ${Jn(r)}`;case"Between":return Array.isArray(r)?"":o!==void 0?`${s} >= ${Jn(r,i)} and ${s} <= ${Jn(o,i)}`:`${s} >= ${Jn(r,i)}`;default:return""}}function N2(e){if(e.length===0)return"";const t=e.map(n=>F2(n)).filter(n=>n.length>0);return t.length===0?"":t.join(" and ")}function L2(e,t,n,r=1e3){const o=N2(t),i=n&&n.length>0?`group_by: ${n.map(l=>`\`${l}\``).join(", ")}`:"select: *";return o?`
271
+ run: ${e} -> {
272
+ where: ${o}
273
+ ${i}
274
+ limit: ${r}
275
+ }
276
+ `:`
277
+ run: ${e} -> {
278
+ ${i}
279
+ limit: ${r}
280
+ }
281
+ `}function Kg(e){const{environment:t,package:n,model:r,source:o,filterSelections:s,fields:i,limit:l=1e3}=e,[c,u]=Y.useState(null),d=Y.useMemo(()=>L2(o,s,i,l),[o,s,i,l]),f=Y.useMemo(()=>yi({environmentName:t,packageName:n,modelPath:r}),[t,n,r]),m=s.length>0,h=Y.useCallback(()=>{if(!m){u(null);return}const g=yu({resourceUri:f,query:d});u(g)},[m,f,d]);return{embeddedQueryResult:c,queryString:d,resourceUri:f,executeQuery:h,canExecute:m}}function B2(e,t=5e3){const n=e.dimensionSpecs[0]?.source??"",r=e.dimensionSpecs[0]?.model??"",{filterStates:o,updateFilter:s,clearAllFilters:i,getActiveFilters:l}=Yg({dimensionSpecs:e.dimensionSpecs}),c=Y.useMemo(()=>l(),[o,l]),{data:u,noRowsMatchedFilter:d,isLoading:f,isError:m,error:h,refetch:g}=qg({environment:e.environment,package:e.package,indexLimit:e.indexLimit,dimensionSpecs:e.dimensionSpecs,versionId:e.versionId,activeFilters:c}),y=f&&!u,{embeddedQueryResult:b,queryString:x,executeQuery:C,canExecute:T}=Kg({environment:e.environment,package:e.package,model:r,source:n,filterSelections:c,limit:t,fields:e.selectFields});return{filterStates:o,updateFilter:s,clearAllFilters:i,activeFilters:c,data:u,noRowsMatchedFilter:d,isLoading:f,isInitialLoading:y,isError:m,error:h,refetch:g,embeddedQueryResult:b,queryString:x,executeQuery:C,canExecute:T}}function V2({modelPath:e,query:t,sourceName:n,queryName:r,enabled:o=!0,resourceUri:s}){const{environmentName:i,packageName:l,versionId:c}=St(s),{apiClients:u}=xe.useServer(),{data:d,isSuccess:f,isError:m,error:h,isLoading:g}=vt({queryKey:["rawQueryData",i,l,e,c,t,n,r],queryFn:()=>u.models.executeQueryModel(i,l,e,{query:t,sourceName:n,queryName:r,versionId:c}),enabled:o});return{data:f&&d?.data?.result?(()=>{try{return JSON.parse(d.data.result).data?.array_value||[]}catch(b){return console.error("Failed to parse query result:",b),[]}})():[],isSuccess:f,isError:m,error:h,isLoading:g}}exports.DEFAULT_THEME=xe.DEFAULT_THEME;exports.ServerProvider=xe.ServerProvider;exports.ThemeProvider=xe.ThemeProvider;exports.resolveMode=xe.resolveMode;exports.resolveTheme=xe.resolveTheme;exports.usePublisherTheme=xe.usePublisherTheme;exports.useServer=xe.useServer;exports.ApiErrorDisplay=_t;exports.BrowserDocumentStorage=D2;exports.ConnectionExplorer=ug;exports.DOC_LINKS=Hn;exports.DRILL_CELL_CLASS=nr;exports.DRILL_SELF=Ji;exports.Dashboard=LP;exports.DashboardTile=ic;exports.DataAppViewer=_P;exports.DimensionFilter=KO;exports.DocumentStorageProvider=I2;exports.EmbeddedQueryResult=$R;exports.Environment=kO;exports.EnvironmentMaterializations=ig;exports.GivenInput=Rm;exports.GivensPanel=iu;exports.Home=xR;exports.INITIAL_RENDER_HEIGHT=sc;exports.Loading=Ht;exports.MODEL_CELL_MAX_HEIGHT=Lm;exports.Materializations=XE;exports.Model=ER;exports.ModelExplorer=mu;exports.ModelExplorerDialog=gu;exports.Models=b2;exports.NOTEBOOK_CELL_MAX_HEIGHT=Nm;exports.Notebook=Sg;exports.Package=GR;exports.Packages=dg;exports.QueryResult=vg;exports.RESULTS_DIALOG_MAX_HEIGHT=Bm;exports.RenderedResult=Hg;exports.ResultContainer=ss;exports.SourcesExplorer=bg;exports.TILE_MAX_HEIGHT=Fm;exports.UNCAPPED_CONTAINER_HEIGHT=Vm;exports.buildMalloyExplicitTheme=zg;exports.buildTableCssVars=Wm;exports.buildVegaThemeOverride=_g;exports.contentNodeDepth=oc;exports.createEmbeddedQueryResult=yu;exports.drillDestinations=Sc;exports.drillValueToFilter=Ea;exports.drillableFieldNames=Uf;exports.encodeDrillValue=Gf;exports.encodeResourceUri=yi;exports.extractDimensionSpecs=JO;exports.extractSourceFromQuery=tR;exports.generateFilterClause=eR;exports.getDimensionKey=co;exports.getJoinedSources=GO;exports.humanizeSlug=Cc;exports.initialResultHeight=zm;exports.injectWhereClause=nR;exports.markDrillableCells=qf;exports.measureContentHeight=Am;exports.packageFileUrl=qm;exports.parseAllSourceInfos=QO;exports.parseDimensionFilterAnnotation=pg;exports.parseNotebookFilterAnnotation=ZO;exports.parseResourceUri=St;exports.readChartAnnotations=Wg;exports.remeasuresAfterReady=jm;exports.resolveDrill=Kf;exports.resolveResultHeight=_m;exports.resultSizing=la;exports.useDimensionFilters=Yg;exports.useDimensionFiltersFromSpec=B2;exports.useDimensionFiltersQuery=Kg;exports.useDimensionalFilterRangeData=qg;exports.useDocumentStorage=M2;exports.useDrill=wc;exports.useDrillSelf=kc;exports.useGivenUrlParams=wP;exports.useGivensState=xc;exports.useModelData=hu;exports.useModelGivens=xg;exports.useRawQueryData=V2;exports.useRouterClickHandler=Pb;exports.useSuggestOptions=vc;