@perses-dev/timeseries-chart-plugin 0.13.0-beta.0 → 0.13.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/__mf/js/{TimeSeriesChart.7df900ef.js → TimeSeriesChart.f9dd142d.js} +2 -2
- package/__mf/js/async/187.2cc43fac.js +24 -0
- package/__mf/js/async/568.cdcaf97d.js +1 -0
- package/__mf/js/async/681.8d61b348.js +110 -0
- package/__mf/js/async/681.8d61b348.js.LICENSE.txt +27 -0
- package/__mf/js/async/724.3439df06.js +1 -0
- package/__mf/js/async/780.12a33d06.js +39 -0
- package/__mf/js/async/{721.88bf4be4.js.LICENSE.txt → 780.12a33d06.js.LICENSE.txt} +11 -23
- package/__mf/js/async/907.5ce8f69d.js +7 -0
- package/__mf/js/async/__federation_expose_TimeSeriesChart.d1167045.js +1 -0
- package/__mf/js/{main.496219f9.js → main.2bb9f3e3.js} +2 -2
- package/lib/QuerySettingsEditor.d.ts.map +1 -1
- package/lib/QuerySettingsEditor.js.map +1 -1
- package/lib/TimeSeriesChartBase.d.ts +2 -2
- package/lib/TimeSeriesChartBase.d.ts.map +1 -1
- package/lib/TimeSeriesChartBase.js +1 -2
- package/lib/TimeSeriesChartBase.js.map +1 -1
- package/lib/TimeSeriesChartPanel.d.ts +1 -1
- package/lib/TimeSeriesChartPanel.d.ts.map +1 -1
- package/lib/TimeSeriesChartPanel.js +2 -3
- package/lib/TimeSeriesChartPanel.js.map +1 -1
- package/lib/cjs/TimeSeriesChartBase.js +3 -4
- package/lib/cjs/TimeSeriesChartPanel.js +4 -5
- package/lib/cjs/utils/data-transform.js +1 -2
- package/lib/test/mock-query-results.d.ts +1 -1
- package/lib/test/mock-query-results.js.map +1 -1
- package/lib/time-series-chart-model.d.ts +2 -1
- package/lib/time-series-chart-model.d.ts.map +1 -1
- package/lib/time-series-chart-model.js.map +1 -1
- package/lib/utils/data-transform.d.ts +2 -2
- package/lib/utils/data-transform.d.ts.map +1 -1
- package/lib/utils/data-transform.js +1 -2
- package/lib/utils/data-transform.js.map +1 -1
- package/mf-manifest.json +14 -15
- package/mf-stats.json +14 -15
- package/package.json +4 -4
- package/__mf/js/async/366.084dd32e.js +0 -24
- package/__mf/js/async/377.7ec764e5.js +0 -2
- package/__mf/js/async/377.7ec764e5.js.LICENSE.txt +0 -15
- package/__mf/js/async/558.401fb679.js +0 -1
- package/__mf/js/async/721.88bf4be4.js +0 -110
- package/__mf/js/async/826.c7b150c6.js +0 -7
- package/__mf/js/async/891.18ba0e56.js +0 -38
- package/__mf/js/async/945.1a85358e.js +0 -1
- package/__mf/js/async/__federation_expose_TimeSeriesChart.0329eb0a.js +0 -1
- /package/__mf/css/async/{826.85c2cbf6.css → 907.85c2cbf6.css} +0 -0
- /package/__mf/js/async/{366.084dd32e.js.LICENSE.txt → 187.2cc43fac.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{826.c7b150c6.js.LICENSE.txt → 907.5ce8f69d.js.LICENSE.txt} +0 -0
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/*! For license information please see 907.5ce8f69d.js.LICENSE.txt */
|
|
2
|
+
(self["chunk_TimeSeriesChart "]=self["chunk_TimeSeriesChart "]||[]).push([["907"],{13094(e,t,n){"use strict";let i,r;n.r(t),n.d(t,{THROUGHPUT_GROUP_CONFIG:()=>io,BYTES_UNIT_CONFIG:()=>nX,generateChartsTheme:()=>rS,checkCrosshairPinnedStatus:()=>iF,mockChartsContext:()=>E2,DensitySelector:()=>c5,applyMergeIndexedColumnsTransform:()=>rD,checkforNearbyTimeSeries:()=>EB,interpolateSelectionIndividual:()=>ry,useChartsTheme:()=>eF,TOOLTIP_DATE_FORMAT:()=>Ew,DragButton:()=>hJ,hasDecimalPlaces:()=>nB,TimeRangeSelector:()=>El,isCurrencyUnit:()=>ik,getFormatterStats:()=>nL,OptionsEditorGrid:()=>cZ,TOOLTIP_MAX_HEIGHT:()=>Ef,useDeepMemo:()=>rv,useMousePosition:()=>EA,TextOverlay:()=>kh,isValidLegendSize:()=>nT,DEFAULT_COLUMN_MIN_WIDTH:()=>60,handleMoveUp:()=>hZ,isValidLegendMode:()=>nM,ContentWithLegend:()=>cO,OptionsEditorGroup:()=>cQ,isDateUnit:()=>iM,parseVariables:()=>iq,isUnitWithDecimalPlaces:()=>iS,SeriesLabelsStack:()=>Ec,PERCENT_UNIT_CONFIG:()=>n4,UnitSelector:()=>EX,getDateAndTime:()=>rf,YAxisLabel:()=>EJ,PERCENT_GROUP_CONFIG:()=>n5,getTableCellLayout:()=>co,ChartsThemeContext:()=>ej,TooltipContent:()=>EU,TOOLTIP_MIN_WIDTH:()=>Eh,useId:()=>iz,getTitleAction:()=>ny,formatCurrency:()=>n2,ValueMappingsEditor:()=>OW,BYTES_GROUP_CONFIG:()=>nK,interpolateSelectionBatch:()=>rw,isLegendItemVisuallySelected:()=>av,getYBuffer:()=>EH,getFormattedAxis:()=>iI,PINNED_CROSSHAIR_SERIES_NAME:()=>t8,getClosestTimestampInFullDataset:()=>iV,ChartsProvider:()=>eL,getFormattedAxisLabel:()=>rd,clearHighlightedSeries:()=>iL,FALLBACK_CHART_WIDTH:()=>Ev,TimeZoneSelector:()=>Ea,LinkEditorForm:()=>ko,restoreChart:()=>iP,SortSelector:()=>km,FormatControls:()=>EQ,formatValue:()=>id,transformData:()=>rR,getTimeSeriesValues:()=>r2,persesColumnsToTanstackColumns:()=>cs,DEFAULT_LEGEND:()=>nD,NEARBY_SERIES_DESCRIPTION:()=>Eb,OptionsEditorControl:()=>cX,formatDecimal:()=>ir,DiscardChangesConfirmationDialog:()=>cH,ColorPicker:()=>eE,formatTime:()=>n_,hasIndexedPatterns:()=>i6,useItemActions:()=>eW,getUnitGroup:()=>im,SelectionProvider:()=>eU,TimeChartTooltip:()=>EG,legendModes:()=>nC,EMPTY_TOOLTIP_DATA:()=>EC,formatThroughput:()=>ia,isThroughputUnit:()=>iA,getTheme:()=>Os,shouldShortenValues:()=>nj,MIN_STEP_INTERVAL_MS:()=>r1,applyJoinTransform:()=>rM,TextField:()=>uX,SeriesInfo:()=>ED,buildRelativeTimeOption:()=>nb,DropIndicator:()=>c3,applyMergeColumnsTransform:()=>rT,getClosestTimestamp:()=>iN,isTemperatureUnit:()=>iT,limitDecimalPlaces:()=>nF,TEMPERATURE_UNIT_CONFIG:()=>n7,dateFormatOptionsWithTimeZone:()=>ru,SortSelectorButtons:()=>kg,formatBits:()=>nY,getTimeZoneOptions:()=>nx,useSelection:()=>eY,DYNAMIC_NEARBY_SERIES_MULTIPLIER:()=>EL,useSnackbar:()=>t5,DEFAULT_COLUMN_HEIGHT:()=>40,parseVariablesAndFormat:()=>iY,isUnitWithShortValues:()=>iC,getCommonTimeScale:()=>r5,getTooltipStyles:()=>EO,interpolateHeaders:()=>rb,isBytesUnit:()=>iy,ErrorAlert:()=>dj,ModeSelector:()=>ku,OptionsColorPicker:()=>r8,OptionsEditorColumn:()=>cW,DECIMAL_UNIT_CONFIG:()=>ii,DEFAULT_PINNED_CROSSHAIR:()=>t9,TEMPERATURE_GROUP_CONFIG:()=>n9,NoDataOverlay:()=>kd,TOOLTIP_BG_COLOR_FALLBACK:()=>Ey,TOOLTIP_MAX_WIDTH:()=>Ed,InterpolationFormat:()=>iW,DragAndDropElement:()=>hK,ErrorBoundary:()=>dB.ErrorBoundary,extractFieldNames:()=>i9,getUnitGroupConfig:()=>ig,CURRENCY_UNIT_CONFIG:()=>n1,SHOW_FEWER_SERIES_LIMIT:()=>Ej,TIME_UNIT_CONFIG:()=>nH,hasDataFieldPatterns:()=>i8,INCREASE_NEARBY_SERIES_MULTIPLIER:()=>EP,LinksEditor:()=>ks,DEFAULT_TOOLTIP_CONFIG:()=>Ek,TRANSFORM_TEXT:()=>iD,ToolbarIconButton:()=>EY,isBitsUnit:()=>iw,isPercentUnit:()=>ib,ItemActionsProvider:()=>eV,isWithinPercentageRange:()=>EV,getLegendSize:()=>nE,OPTIMIZED_MODE_SERIES_LIMIT:()=>1e3,getSubmitText:()=>nw,handleMoveDown:()=>hQ,legendPositions:()=>nS,TIME_GROUP_CONFIG:()=>nV,PIN_TOOLTIP_HELP_TEXT:()=>EM,Table:()=>ck,defaultCursorData:()=>ES,typography:()=>Or,formatPercent:()=>n6,assembleTransform:()=>EE,formatTemperature:()=>ie,useTimeZone:()=>r6,createRegexFromString:()=>rA,hasBatchPatterns:()=>i4,PersesTimeToIntlTime:()=>nz,RefreshIntervalPicker:()=>Ob,legendSizes:()=>nA,BITS_GROUP_CONFIG:()=>nG,parseFormat:()=>i2,FormActions:()=>dV,TOOLTIP_LABELS_MAX_WIDTH:()=>Ep,UNIT_GROUP_CONFIG:()=>ic,applyValueMapping:()=>rk,DEFAULT_COLUMN_WIDTH:()=>150,batchDispatchNearbySeriesActions:()=>iB,getGMTOffset:()=>rh,getNearbySeriesData:()=>EN,getPointInGrid:()=>ij,InfoTooltip:()=>cq,AlignSelector:()=>X,JSONEditor:()=>ke,useMemoized:()=>rg,CURRENCY_GROUP_CONFIG:()=>n0,getLegendMode:()=>nR,EMPHASIZED_SERIES_DESCRIPTION:()=>Ex,TooltipHeader:()=>E_,SeriesMarker:()=>Eu,Drawer:()=>du,FontSizeSelector:()=>dN,THROUGHPUT_UNIT_CONFIG:()=>il,DEFAULT_COLUMN_MAX_WIDTH:()=>1e3,TOOLTIP_PADDING:()=>Eg,TimeZoneContext:()=>r3,TimeZoneProvider:()=>r4,TransformsEditor:()=>Ov,combineSx:()=>iH,getLegendPosition:()=>nI,BITS_UNIT_CONFIG:()=>nq,EChart:()=>dP,getFormatterFromCache:()=>nP,applyMergeSeriesTransform:()=>rI,Legend:()=>cR,interpolateQueryParams:()=>rx,isTimeUnit:()=>iv,isValidLegendPosition:()=>nk,replaceDataFields:()=>i5,UNPIN_TOOLTIP_HELP_TEXT:()=>ET,DateTimeRangePicker:()=>Es,Dialog:()=>cV,SettingsAutocomplete:()=>c1,ThresholdsEditor:()=>kS,DECIMAL_GROUP_CONFIG:()=>it,enableDataZoom:()=>iO,SnackbarProvider:()=>t2,formatBytes:()=>nZ,getFormattedMultipleYAxes:()=>iR,LoadingOverlay:()=>kf,formatWithTimeZone:()=>rc,getUnitConfig:()=>ip,isDecimalUnit:()=>ix,UNIT_CONFIG:()=>ih,legacyCheckforNearbySeries:()=>EF,replaceDataFieldsBatch:()=>i3,replaceVariable:()=>iU,replaceVariables:()=>iK,useChartsContext:()=>eB,testChartsTheme:()=>E1,TOOLTIP_ADJUST_Y_POS_MULTIPLIER:()=>Em,useDragAndDropMonitor:()=>hY,useLocalStorage:()=>iE,interpolate:()=>i_,isRegexPattern:()=>rC});var o,s,l,a,u,c,h,d,f,p,m,g,v,b,x,y,w,S,C,A,k,M,T,D,I=n(62540),R=n(70451),E=n.n(R),O=n(11750),P=n(81023),L=n(18227),j=n(41953),B=n(24726),F=n(77308),N=n(23434),V=n(26952),H=n(72052),z=n(29009),W=n(46733);function $(e){return(0,W.Ay)("MuiButtonGroup",e)}let _=(0,z.A)("MuiButtonGroup",["root","contained","outlined","text","disableElevation","disabled","firstButton","fullWidth","horizontal","vertical","colorPrimary","colorSecondary","grouped","groupedHorizontal","groupedVertical","groupedText","groupedTextHorizontal","groupedTextVertical","groupedTextPrimary","groupedTextSecondary","groupedOutlined","groupedOutlinedHorizontal","groupedOutlinedVertical","groupedOutlinedPrimary","groupedOutlinedSecondary","groupedContained","groupedContainedHorizontal","groupedContainedVertical","groupedContainedPrimary","groupedContainedSecondary","lastButton","middleButton"]);var U=n(94580),G=n(30016);let q=(0,F.A)("div",{name:"MuiButtonGroup",slot:"Root",overridesResolver:(e,t)=>{let{ownerState:n}=e;return[{[`& .${_.grouped}`]:t.grouped},{[`& .${_.grouped}`]:t[`grouped${(0,B.A)(n.orientation)}`]},{[`& .${_.grouped}`]:t[`grouped${(0,B.A)(n.variant)}`]},{[`& .${_.grouped}`]:t[`grouped${(0,B.A)(n.variant)}${(0,B.A)(n.orientation)}`]},{[`& .${_.grouped}`]:t[`grouped${(0,B.A)(n.variant)}${(0,B.A)(n.color)}`]},{[`& .${_.firstButton}`]:t.firstButton},{[`& .${_.lastButton}`]:t.lastButton},{[`& .${_.middleButton}`]:t.middleButton},t.root,t[n.variant],!0===n.disableElevation&&t.disableElevation,n.fullWidth&&t.fullWidth,"vertical"===n.orientation&&t.vertical]}})((0,N.A)(({theme:e})=>({display:"inline-flex",borderRadius:(e.vars||e).shape.borderRadius,variants:[{props:{variant:"contained"},style:{boxShadow:(e.vars||e).shadows[2]}},{props:{disableElevation:!0},style:{boxShadow:"none"}},{props:{fullWidth:!0},style:{width:"100%"}},{props:{orientation:"vertical"},style:{flexDirection:"column",[`& .${_.lastButton},& .${_.middleButton}`]:{borderTopRightRadius:0,borderTopLeftRadius:0},[`& .${_.firstButton},& .${_.middleButton}`]:{borderBottomRightRadius:0,borderBottomLeftRadius:0}}},{props:{orientation:"horizontal"},style:{[`& .${_.firstButton},& .${_.middleButton}`]:{borderTopRightRadius:0,borderBottomRightRadius:0},[`& .${_.lastButton},& .${_.middleButton}`]:{borderTopLeftRadius:0,borderBottomLeftRadius:0}}},{props:{variant:"text",orientation:"horizontal"},style:{[`& .${_.firstButton},& .${_.middleButton}`]:{borderRight:e.vars?`1px solid rgba(${e.vars.palette.common.onBackgroundChannel} / 0.23)`:`1px solid ${"light"===e.palette.mode?"rgba(0, 0, 0, 0.23)":"rgba(255, 255, 255, 0.23)"}`,[`&.${_.disabled}`]:{borderRight:`1px solid ${(e.vars||e).palette.action.disabled}`}}}},{props:{variant:"text",orientation:"vertical"},style:{[`& .${_.firstButton},& .${_.middleButton}`]:{borderBottom:e.vars?`1px solid rgba(${e.vars.palette.common.onBackgroundChannel} / 0.23)`:`1px solid ${"light"===e.palette.mode?"rgba(0, 0, 0, 0.23)":"rgba(255, 255, 255, 0.23)"}`,[`&.${_.disabled}`]:{borderBottom:`1px solid ${(e.vars||e).palette.action.disabled}`}}}},...Object.entries(e.palette).filter((0,V.A)()).flatMap(([t])=>[{props:{variant:"text",color:t},style:{[`& .${_.firstButton},& .${_.middleButton}`]:{borderColor:e.vars?`rgba(${e.vars.palette[t].mainChannel} / 0.5)`:(0,L.X4)(e.palette[t].main,.5)}}}]),{props:{variant:"outlined",orientation:"horizontal"},style:{[`& .${_.firstButton},& .${_.middleButton}`]:{borderRightColor:"transparent","&:hover":{borderRightColor:"currentColor"}},[`& .${_.lastButton},& .${_.middleButton}`]:{marginLeft:-1}}},{props:{variant:"outlined",orientation:"vertical"},style:{[`& .${_.firstButton},& .${_.middleButton}`]:{borderBottomColor:"transparent","&:hover":{borderBottomColor:"currentColor"}},[`& .${_.lastButton},& .${_.middleButton}`]:{marginTop:-1}}},{props:{variant:"contained",orientation:"horizontal"},style:{[`& .${_.firstButton},& .${_.middleButton}`]:{borderRight:`1px solid ${(e.vars||e).palette.grey[400]}`,[`&.${_.disabled}`]:{borderRight:`1px solid ${(e.vars||e).palette.action.disabled}`}}}},{props:{variant:"contained",orientation:"vertical"},style:{[`& .${_.firstButton},& .${_.middleButton}`]:{borderBottom:`1px solid ${(e.vars||e).palette.grey[400]}`,[`&.${_.disabled}`]:{borderBottom:`1px solid ${(e.vars||e).palette.action.disabled}`}}}},...Object.entries(e.palette).filter((0,V.A)(["dark"])).map(([t])=>({props:{variant:"contained",color:t},style:{[`& .${_.firstButton},& .${_.middleButton}`]:{borderColor:(e.vars||e).palette[t].dark}}}))],[`& .${_.grouped}`]:{minWidth:40,boxShadow:"none",props:{variant:"contained"},style:{"&:hover":{boxShadow:"none"}}}}))),Y=R.forwardRef(function(e,t){let n=(0,H.b)({props:e,name:"MuiButtonGroup"}),{children:i,className:r,color:o="primary",component:s="div",disabled:l=!1,disableElevation:a=!1,disableFocusRipple:u=!1,disableRipple:c=!1,fullWidth:h=!1,orientation:d="horizontal",size:f="medium",variant:p="outlined",...m}=n,g={...n,color:o,component:s,disabled:l,disableElevation:a,disableFocusRipple:u,disableRipple:c,fullWidth:h,orientation:d,size:f,variant:p},v=(e=>{let{classes:t,color:n,disabled:i,disableElevation:r,fullWidth:o,orientation:s,variant:l}=e,a={root:["root",l,s,o&&"fullWidth",r&&"disableElevation",`color${(0,B.A)(n)}`],grouped:["grouped",`grouped${(0,B.A)(s)}`,`grouped${(0,B.A)(l)}`,`grouped${(0,B.A)(l)}${(0,B.A)(s)}`,`grouped${(0,B.A)(l)}${(0,B.A)(n)}`,i&&"disabled"],firstButton:["firstButton"],lastButton:["lastButton"],middleButton:["middleButton"]};return(0,P.A)(a,$,t)})(g),b=R.useMemo(()=>({className:v.grouped,color:o,disabled:l,disableElevation:a,disableFocusRipple:u,disableRipple:c,fullWidth:h,size:f,variant:p}),[o,l,a,u,c,h,f,p,v.grouped]),x=(0,j.A)(i),y=x.length;return(0,I.jsx)(q,{as:s,role:"group",className:(0,O.A)(v.root,r),ref:t,ownerState:g,...m,children:(0,I.jsx)(U.A.Provider,{value:b,children:x.map((e,t)=>{let n,i;return(0,I.jsx)(G.A.Provider,{value:(n=0===t,i=t===y-1,n&&i?"":n?v.firstButton:i?v.lastButton:v.middleButton),children:e},t)})})})});var K=n(7013);function X({onChange:e,value:t="left",...n}){let i=t=>{e(t)};return(0,I.jsxs)(Y,{"aria-label":"Alignement",...n,children:[(0,I.jsx)(K.A,{onClick:()=>i("left"),variant:"left"===t?"contained":"outlined",children:"Left"},"left"),(0,I.jsx)(K.A,{onClick:()=>i("center"),variant:"center"===t?"contained":"outlined",children:"Center"},"center"),(0,I.jsx)(K.A,{onClick:()=>i("right"),variant:"right"===t?"contained":"outlined",children:"Right"},"right")]})}var Z=n(315),Q=n(47095),J=n(93648);function ee(){return(ee=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e}).apply(this,arguments)}function et(e,t){if(null==e)return{};var n,i,r={},o=Object.keys(e);for(i=0;i<o.length;i++)t.indexOf(n=o[i])>=0||(r[n]=e[n]);return r}function en(e){var t=(0,R.useRef)(e),n=(0,R.useRef)(function(e){t.current&&t.current(e)});return t.current=e,n.current}var ei,er=function(e,t,n){return void 0===t&&(t=0),void 0===n&&(n=1),e>n?n:e<t?t:e},eo=function(e){return"touches"in e},es=function(e){return e&&e.ownerDocument.defaultView||self},el=function(e,t,n){var i=e.getBoundingClientRect(),r=eo(t)?function(e,t){for(var n=0;n<e.length;n++)if(e[n].identifier===t)return e[n];return e[0]}(t.touches,n):t;return{left:er((r.pageX-(i.left+es(e).pageXOffset))/i.width),top:er((r.pageY-(i.top+es(e).pageYOffset))/i.height)}},ea=function(e){eo(e)||e.preventDefault()},eu=E().memo(function(e){var t=e.onMove,n=e.onKey,i=et(e,["onMove","onKey"]),r=(0,R.useRef)(null),o=en(t),s=en(n),l=(0,R.useRef)(null),a=(0,R.useRef)(!1),u=(0,R.useMemo)(function(){var e=function(e){ea(e),(eo(e)?e.touches.length>0:e.buttons>0)&&r.current?o(el(r.current,e,l.current)):n(!1)},t=function(){return n(!1)};function n(n){var i=a.current,o=es(r.current),s=n?o.addEventListener:o.removeEventListener;s(i?"touchmove":"mousemove",e),s(i?"touchend":"mouseup",t)}return[function(e){var t=e.nativeEvent,i=r.current;if(i&&(ea(t),(!a.current||eo(t))&&i)){if(eo(t)){a.current=!0;var s=t.changedTouches||[];s.length&&(l.current=s[0].identifier)}i.focus(),o(el(i,t,l.current)),n(!0)}},function(e){var t=e.which||e.keyCode;t<37||t>40||(e.preventDefault(),s({left:39===t?.05:37===t?-.05:0,top:40===t?.05:38===t?-.05:0}))},n]},[s,o]),c=u[0],h=u[1],d=u[2];return(0,R.useEffect)(function(){return d},[d]),E().createElement("div",ee({},i,{onTouchStart:c,onMouseDown:c,className:"react-colorful__interactive",ref:r,onKeyDown:h,tabIndex:0,role:"slider"}))}),ec=function(e){return e.filter(Boolean).join(" ")},eh=function(e){var t=e.color,n=e.left,i=e.top,r=ec(["react-colorful__pointer",e.className]);return E().createElement("div",{className:r,style:{top:100*(void 0===i?.5:i)+"%",left:100*n+"%"}},E().createElement("div",{className:"react-colorful__pointer-fill",style:{backgroundColor:t}}))},ed=function(e,t,n){return void 0===t&&(t=0),void 0===n&&(n=Math.pow(10,t)),Math.round(n*e)/n},ef=function(e){return"#"===e[0]&&(e=e.substring(1)),e.length<6?{r:parseInt(e[0]+e[0],16),g:parseInt(e[1]+e[1],16),b:parseInt(e[2]+e[2],16),a:4===e.length?ed(parseInt(e[3]+e[3],16)/255,2):1}:{r:parseInt(e.substring(0,2),16),g:parseInt(e.substring(2,4),16),b:parseInt(e.substring(4,6),16),a:8===e.length?ed(parseInt(e.substring(6,8),16)/255,2):1}},ep=function(e){var t=e.s,n=e.v,i=e.a,r=(200-t)*n/100;return{h:ed(e.h),s:ed(r>0&&r<200?t*n/100/(r<=100?r:200-r)*100:0),l:ed(r/2),a:ed(i,2)}},em=function(e){var t=ep(e);return"hsl("+t.h+", "+t.s+"%, "+t.l+"%)"},eg=function(e){var t=e.h,n=e.s,i=e.v,r=e.a;t=t/360*6,n/=100,i/=100;var o=Math.floor(t),s=i*(1-n),l=i*(1-(t-o)*n),a=i*(1-(1-t+o)*n),u=o%6;return{r:ed(255*[i,l,s,s,a,i][u]),g:ed(255*[a,i,i,l,s,s][u]),b:ed(255*[s,s,a,i,i,l][u]),a:ed(r,2)}},ev=function(e){var t=e.toString(16);return t.length<2?"0"+t:t},eb=function(e){var t=e.r,n=e.g,i=e.b,r=e.a,o=r<1?ev(ed(255*r)):"";return"#"+ev(t)+ev(n)+ev(i)+o},ex=function(e){var t=e.r,n=e.g,i=e.b,r=e.a,o=Math.max(t,n,i),s=o-Math.min(t,n,i),l=s?o===t?(n-i)/s:o===n?2+(i-t)/s:4+(t-n)/s:0;return{h:ed(60*(l<0?l+6:l)),s:ed(o?s/o*100:0),v:ed(o/255*100),a:r}},ey=E().memo(function(e){var t=e.hue,n=e.onChange,i=ec(["react-colorful__hue",e.className]);return E().createElement("div",{className:i},E().createElement(eu,{onMove:function(e){n({h:360*e.left})},onKey:function(e){n({h:er(t+360*e.left,0,360)})},"aria-label":"Hue","aria-valuenow":ed(t),"aria-valuemax":"360","aria-valuemin":"0"},E().createElement(eh,{className:"react-colorful__hue-pointer",left:t/360,color:em({h:t,s:100,v:100,a:1})})))}),ew=E().memo(function(e){var t=e.hsva,n=e.onChange,i={backgroundColor:em({h:t.h,s:100,v:100,a:1})};return E().createElement("div",{className:"react-colorful__saturation",style:i},E().createElement(eu,{onMove:function(e){n({s:100*e.left,v:100-100*e.top})},onKey:function(e){n({s:er(t.s+100*e.left,0,100),v:er(t.v-100*e.top,0,100)})},"aria-label":"Color","aria-valuetext":"Saturation "+ed(t.s)+"%, Brightness "+ed(t.v)+"%"},E().createElement(eh,{className:"react-colorful__saturation-pointer",top:1-t.v/100,left:t.s/100,color:em(t)})))}),eS=function(e,t){if(e===t)return!0;for(var n in e)if(e[n]!==t[n])return!1;return!0},eC="u">typeof window?R.useLayoutEffect:R.useEffect,eA=new Map,ek=function(e){eC(function(){var t=e.current?e.current.ownerDocument:document;if(void 0!==t&&!eA.has(t)){var i=t.createElement("style");i.innerHTML='.react-colorful{position:relative;display:flex;flex-direction:column;width:200px;height:200px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:default}.react-colorful__saturation{position:relative;flex-grow:1;border-color:transparent;border-bottom:12px solid #000;border-radius:8px 8px 0 0;background-image:linear-gradient(0deg,#000,transparent),linear-gradient(90deg,#fff,hsla(0,0%,100%,0))}.react-colorful__alpha-gradient,.react-colorful__pointer-fill{content:"";position:absolute;left:0;top:0;right:0;bottom:0;pointer-events:none;border-radius:inherit}.react-colorful__alpha-gradient,.react-colorful__saturation{box-shadow:inset 0 0 0 1px rgba(0,0,0,.05)}.react-colorful__alpha,.react-colorful__hue{position:relative;height:24px}.react-colorful__hue{background:linear-gradient(90deg,red 0,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,red)}.react-colorful__last-control{border-radius:0 0 8px 8px}.react-colorful__interactive{position:absolute;left:0;top:0;right:0;bottom:0;border-radius:inherit;outline:none;touch-action:none}.react-colorful__pointer{position:absolute;z-index:1;box-sizing:border-box;width:28px;height:28px;transform:translate(-50%,-50%);background-color:#fff;border:2px solid #fff;border-radius:50%;box-shadow:0 2px 4px rgba(0,0,0,.2)}.react-colorful__interactive:focus .react-colorful__pointer{transform:translate(-50%,-50%) scale(1.1)}.react-colorful__alpha,.react-colorful__alpha-pointer{background-color:#fff;background-image:url(\'data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill-opacity=".05"><path d="M8 0h8v8H8zM0 8h8v8H0z"/></svg>\')}.react-colorful__saturation-pointer{z-index:3}.react-colorful__hue-pointer{z-index:2}',eA.set(t,i);var r=ei||n.nc;r&&i.setAttribute("nonce",r),t.head.appendChild(i)}},[])},eM=function(e){var t,n,i,r,o,s=e.className,l=e.colorModel,a=e.color,u=void 0===a?l.defaultColor:a,c=e.onChange,h=et(e,["className","colorModel","color","onChange"]),d=(0,R.useRef)(null);ek(d);var f=(t=en(c),i=(n=(0,R.useState)(function(){return l.toHsva(u)}))[0],r=n[1],o=(0,R.useRef)({color:u,hsva:i}),(0,R.useEffect)(function(){if(!l.equal(u,o.current.color)){var e=l.toHsva(u);o.current={hsva:e,color:u},r(e)}},[u,l]),(0,R.useEffect)(function(){var e;eS(i,o.current.hsva)||l.equal(e=l.fromHsva(i),o.current.color)||(o.current={hsva:i,color:e},t(e))},[i,l,t]),[i,(0,R.useCallback)(function(e){r(function(t){return Object.assign({},t,e)})},[])]),p=f[0],m=f[1],g=ec(["react-colorful",s]);return E().createElement("div",ee({},h,{ref:d,className:g}),E().createElement(ew,{hsva:p,onChange:m}),E().createElement(ey,{hue:p.h,onChange:m,className:"react-colorful__last-control"}))},eT={defaultColor:"000",toHsva:function(e){return ex(ef(e))},fromHsva:function(e){return eb(eg({h:e.h,s:e.s,v:e.v,a:1}))},equal:function(e,t){return e.toLowerCase()===t.toLowerCase()||eS(ef(e),ef(t))}},eD=function(e){return E().createElement(eM,ee({},e,{colorModel:eT}))},eI=n(29618),eR=n(98029);let eE=({color:e,onChange:t,onClear:n,palette:i})=>{let[r,o]=(0,R.useState)(e),s=e=>{o(e),t?.(e)};return(0,I.jsxs)(Z.A,{spacing:1,children:[(0,I.jsx)(eD,{color:e,onChange:s,style:{width:"100%"}}),(0,I.jsx)(Z.A,{direction:"row",flexWrap:"wrap",justifyContent:"space-evenly",width:"200px",children:i&&i.map((e,t)=>(0,I.jsx)(Q.A,{size:"small","aria-label":`change color to ${e}`,sx:{color:e},onClick:()=>s(e),children:(0,I.jsx)(eI.default,{})},t))}),(0,I.jsxs)(Z.A,{direction:"row",gap:1,alignItems:"center",children:[(0,I.jsx)(J.A,{inputProps:{"aria-label":"enter hex color"},fullWidth:!0,value:r,onChange:e=>{let n=e.target.value.replace(/([^0-9A-F]+)/gi,"").substring(0,8);o(`#${n}`),eO(e.target.value)&&t?.(e.target.value)}}),n&&(0,I.jsx)(Q.A,{onClick:n,children:(0,I.jsx)(eR.default,{})})]})]})},eO=(e,t)=>{let n=/^#?([0-9A-F]{3,8})$/i.exec(e),i=n&&n[1]?n[1].length:0;return 3===i||6===i||!!t&&4===i||!!t&&8===i};var eP=n(91823);function eL(e){let{children:t,chartsTheme:n,enablePinning:i=!1,enableSyncGrouping:r=!0}=e,[o,s]=(0,R.useState)(null),l=(0,R.useMemo)(()=>({chartsTheme:n,enablePinning:i,lastTooltipPinnedCoords:o,enableSyncGrouping:r,setLastTooltipPinnedCoords:s}),[n,i,r,o,s]);return(0,I.jsx)(ej.Provider,{value:l,children:t})}let ej=(0,R.createContext)(void 0);function eB(){let e=(0,R.useContext)(ej);if(void 0===e)throw Error("No ChartsThemeContext found. Did you forget a Provider?");return e}function eF(){return eB().chartsTheme}let eN=(0,R.createContext)(void 0);function eV({children:e}){let[t,n]=(0,R.useState)(new Map),i=(0,R.useCallback)((e,t,i)=>{n(n=>{let r=new Map(n),o=r.get(e)||{loading:!1};if(void 0!==i){let n=new Map(o.itemStatuses||new Map),s=n.get(i)||{loading:!1};n.set(i,{...s,...t}),r.set(e,{...o,itemStatuses:n})}else r.set(e,{...o,...t});return r})},[]),r=(0,R.useCallback)(e=>{n(t=>{if(void 0===e)return new Map;if(!t.has(e))return t;let n=new Map(t);return n.delete(e),n})},[]),o=(0,R.useMemo)(()=>({actionStatuses:t,setActionStatus:i,clearActionStatus:r}),[t,i,r]);return(0,I.jsx)(eN.Provider,{value:o,children:e})}let eH=()=>{},ez={actionStatuses:new Map,setActionStatus:eH,clearActionStatus:eH,hasContext:!1};function eW(){let e=(0,R.useContext)(eN);return(0,R.useMemo)(()=>e?{...e,hasContext:!0}:ez,[e])}let e$=(0,R.createContext)(void 0),e_=(e,t)=>t;function eU({children:e}){let[t,n]=(0,R.useState)(new Map),i=(0,R.useRef)(e_),r=(0,R.useCallback)(e=>{i.current=e},[]),o=(0,R.useCallback)(e=>{let t=new Map;e.forEach(({item:e,id:n})=>t.set(n,e)),n(t)},[]),s=(0,R.useCallback)((e,t)=>{n(n=>{let i=new Map(n);return i.has(t)?i.delete(t):i.set(t,e),i})},[]),l=(0,R.useCallback)(e=>{n(t=>{if(!t.has(e))return t;let n=new Map(t);return n.delete(e),n})},[]),a=(0,R.useCallback)(()=>n(new Map),[]),u=(0,R.useCallback)((e,n)=>t.has(i.current(e,n)),[t]),c=(0,R.useMemo)(()=>({selectionMap:t,setSelection:o,toggleSelection:s,removeFromSelection:l,clearSelection:a,isSelected:u,registerGetId:r}),[t,o,s,l,a,u,r]);return(0,I.jsx)(e$.Provider,{value:c,children:e})}let eG=()=>{},eq={selectionMap:new Map,setSelection:eG,toggleSelection:eG,removeFromSelection:eG,clearSelection:eG,isSelected:()=>!1,hasContext:!1};function eY(e){let t=(0,R.useContext)(e$);return(0,R.useEffect)(()=>{t&&e?.getId&&t.registerGetId(e.getId)},[t,e?.getId]),(0,R.useMemo)(()=>{if(!t)return eq;let{registerGetId:e,...n}=t;return{...n,hasContext:!0}},[t])}var eK=n(20231),eX=n.n(eK);let eZ=function(){for(var e,t,n=0,i="";n<arguments.length;)(e=arguments[n++])&&(t=function e(t){var n,i,r="";if("string"==typeof t||"number"==typeof t)r+=t;else if("object"==typeof t)if(Array.isArray(t))for(n=0;n<t.length;n++)t[n]&&(i=e(t[n]))&&(r&&(r+=" "),r+=i);else for(n in t)t[n]&&(r&&(r+=" "),r+=n);return r}(e))&&(i&&(i+=" "),i+=t);return i},eQ={data:""},eJ=/(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g,e0=/\/\*[^]*?\*\/| +/g,e1=/\n+/g,e2=(e,t)=>{let n="",i="",r="";for(let o in e){let s=e[o];"@"==o[0]?"i"==o[1]?n=o+" "+s+";":i+="f"==o[1]?e2(s,o):o+"{"+e2(s,"k"==o[1]?"":t)+"}":"object"==typeof s?i+=e2(s,t?t.replace(/([^,])+/g,e=>o.replace(/([^,]*:\S+\([^)]*\))|([^,])+/g,t=>/&/.test(t)?t.replace(/&/g,e):e?e+" "+t:t)):o):null!=s&&(o=/^--/.test(o)?o:o.replace(/[A-Z]/g,"-$&").toLowerCase(),r+=e2.p?e2.p(o,s):o+":"+s+";")}return n+(t&&r?t+"{"+r+"}":r)+i},e5={},e3=e=>{if("object"==typeof e){let t="";for(let n in e)t+=n+e3(e[n]);return t}return e};function e4(e){let t,n,i=this||{},r=e.call?e(i.p):e;return((e,t,n,i,r)=>{var o;let s=e3(e),l=e5[s]||(e5[s]=(e=>{let t=0,n=11;for(;t<e.length;)n=101*n+e.charCodeAt(t++)>>>0;return"go"+n})(s));if(!e5[l]){let t=s!==e?e:(e=>{let t,n,i=[{}];for(;t=eJ.exec(e.replace(e0,""));)t[4]?i.shift():t[3]?(n=t[3].replace(e1," ").trim(),i.unshift(i[0][n]=i[0][n]||{})):i[0][t[1]]=t[2].replace(e1," ").trim();return i[0]})(e);e5[l]=e2(r?{["@keyframes "+l]:t}:t,n?"":"."+l)}let a=n&&e5.g?e5.g:null;return n&&(e5.g=e5[l]),o=e5[l],a?t.data=t.data.replace(a,o):-1===t.data.indexOf(o)&&(t.data=i?o+t.data:t.data+o),l})(r.unshift?r.raw?(t=[].slice.call(arguments,1),n=i.p,r.reduce((e,i,r)=>{let o=t[r];if(o&&o.call){let e=o(n),t=e&&e.props&&e.props.className||/^go/.test(e)&&e;o=t?"."+t:e&&"object"==typeof e?e.props?"":e2(e,""):!1===e?"":e}return e+i+(null==o?"":o)},"")):r.reduce((e,t)=>Object.assign(e,t&&t.call?t(i.p):t),{}):r,(e=>{if("object"==typeof window){let t=(e?e.querySelector("#_goober"):window._goober)||Object.assign(document.createElement("style"),{innerHTML:" ",id:"_goober"});return t.nonce=window.__nonce__,t.parentNode||(e||document.head).appendChild(t),t.firstChild}return e||eQ})(i.target),i.g,i.o,i.k)}function e6(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function e8(e,t,n){return t&&e6(e.prototype,t),n&&e6(e,n),e}function e9(){return(e9=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e}).apply(this,arguments)}function e7(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}function te(e,t){if(null==e)return{};var n,i,r={},o=Object.keys(e);for(i=0;i<o.length;i++)n=o[i],t.indexOf(n)>=0||(r[n]=e[n]);return r}function tt(e){if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}e4.bind({g:1}),e4.bind({k:1});var tn=function(){return""},ti=E().createContext({enqueueSnackbar:tn,closeSnackbar:tn}),tr="@media (max-width:599.95px)",to="@media (min-width:600px)",ts=function(e){return e.charAt(0).toUpperCase()+e.slice(1)},tl=function(e){return""+ts(e.vertical)+ts(e.horizontal)},ta=function(e){return!!e||0===e},tu="unmounted",tc="exited",th="entering",td="entered",tf="exiting",tp=function(e){function t(t){var n,i=e.call(this,t)||this,r=t.appear;return i.appearStatus=null,t.in?r?(n=tc,i.appearStatus=th):n=td:n=t.unmountOnExit||t.mountOnEnter?tu:tc,i.state={status:n},i.nextCallback=null,i}e7(t,e),t.getDerivedStateFromProps=function(e,t){return e.in&&t.status===tu?{status:tc}:null};var n=t.prototype;return n.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},n.componentDidUpdate=function(e){var t=null;if(e!==this.props){var n=this.state.status;this.props.in?n!==th&&n!==td&&(t=th):(n===th||n===td)&&(t=tf)}this.updateStatus(!1,t)},n.componentWillUnmount=function(){this.cancelNextCallback()},n.getTimeouts=function(){var e=this.props.timeout,t=e,n=e;return null!=e&&"number"!=typeof e&&"string"!=typeof e&&(n=e.exit,t=e.enter),{exit:n,enter:t}},n.updateStatus=function(e,t){void 0===e&&(e=!1),null!==t?(this.cancelNextCallback(),t===th?this.performEnter(e):this.performExit()):this.props.unmountOnExit&&this.state.status===tc&&this.setState({status:tu})},n.performEnter=function(e){var t=this,n=this.props.enter,i=this.getTimeouts();e||n?(this.props.onEnter&&this.props.onEnter(this.node,e),this.safeSetState({status:th},function(){t.props.onEntering&&t.props.onEntering(t.node,e),t.onTransitionEnd(i.enter,function(){t.safeSetState({status:td},function(){t.props.onEntered&&t.props.onEntered(t.node,e)})})})):this.safeSetState({status:td},function(){t.props.onEntered&&t.props.onEntered(t.node,e)})},n.performExit=function(){var e=this,t=this.props.exit,n=this.getTimeouts();t?(this.props.onExit&&this.props.onExit(this.node),this.safeSetState({status:tf},function(){e.props.onExiting&&e.props.onExiting(e.node),e.onTransitionEnd(n.exit,function(){e.safeSetState({status:tc},function(){e.props.onExited&&e.props.onExited(e.node)})})})):this.safeSetState({status:tc},function(){e.props.onExited&&e.props.onExited(e.node)})},n.cancelNextCallback=function(){null!==this.nextCallback&&this.nextCallback.cancel&&(this.nextCallback.cancel(),this.nextCallback=null)},n.safeSetState=function(e,t){t=this.setNextCallback(t),this.setState(e,t)},n.setNextCallback=function(e){var t=this,n=!0;return this.nextCallback=function(){n&&(n=!1,t.nextCallback=null,e())},this.nextCallback.cancel=function(){n=!1},this.nextCallback},n.onTransitionEnd=function(e,t){this.setNextCallback(t);var n=null==e&&!this.props.addEndListener;!this.node||n?setTimeout(this.nextCallback,0):(this.props.addEndListener&&this.props.addEndListener(this.node,this.nextCallback),null!=e&&setTimeout(this.nextCallback,e))},n.render=function(){var e=this.state.status;if(e===tu)return null;var t=this.props;return(0,t.children)(e,te(t,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]))},e8(t,[{key:"node",get:function(){var e,t=null==(e=this.props.nodeRef)?void 0:e.current;if(!t)throw Error("notistack - Custom snackbar is not refForwarding");return t}}]),t}(E().Component);function tm(){}function tg(e,t){"function"==typeof e?e(t):e&&(e.current=t)}function tv(e,t){return(0,R.useMemo)(function(){return null==e&&null==t?null:function(n){tg(e,n),tg(t,n)}},[e,t])}function tb(e){var t=e.timeout,n=e.style,i=void 0===n?{}:n,r=e.mode;return{duration:"object"==typeof t?t[r]||0:t,easing:i.transitionTimingFunction,delay:i.transitionDelay}}tp.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:tm,onEntering:tm,onEntered:tm,onExit:tm,onExiting:tm,onExited:tm};var tx=function(e){e.scrollTop=e.scrollTop},ty=function(e){return Math.round(e)+"ms"};function tw(e,t){void 0===e&&(e=["all"]);var n=t||{},i=n.duration,r=void 0===i?300:i,o=n.easing,s=void 0===o?"cubic-bezier(0.4, 0, 0.2, 1)":o,l=n.delay,a=void 0===l?0:l;return(Array.isArray(e)?e:[e]).map(function(e){return e+" "+("string"==typeof r?r:ty(r))+" "+s+" "+("string"==typeof a?a:ty(a))}).join(",")}function tS(e){return(e&&e.ownerDocument||document).defaultView||window}function tC(e,t){if(t){var n=function(e,t){var n,i=t.getBoundingClientRect(),r=tS(t);if(t.fakeTransform)n=t.fakeTransform;else{var o=r.getComputedStyle(t);n=o.getPropertyValue("-webkit-transform")||o.getPropertyValue("transform")}var s=0,l=0;if(n&&"none"!==n&&"string"==typeof n){var a=n.split("(")[1].split(")")[0].split(",");s=parseInt(a[4],10),l=parseInt(a[5],10)}switch(e){case"left":return"translateX("+(r.innerWidth+s-i.left)+"px)";case"right":return"translateX(-"+(i.left+i.width-s)+"px)";case"up":return"translateY("+(r.innerHeight+l-i.top)+"px)";default:return"translateY(-"+(i.top+i.height-l)+"px)"}}(e,t);n&&(t.style.webkitTransform=n,t.style.transform=n)}}var tA=(0,R.forwardRef)(function(e,t){var n=e.children,i=e.direction,r=void 0===i?"down":i,o=e.in,s=e.style,l=e.timeout,a=void 0===l?0:l,u=e.onEnter,c=e.onEntered,h=e.onExit,d=e.onExited,f=te(e,["children","direction","in","style","timeout","onEnter","onEntered","onExit","onExited"]),p=(0,R.useRef)(null),m=tv(n.ref,p),g=tv(m,t),v=(0,R.useCallback)(function(){p.current&&tC(r,p.current)},[r]);return(0,R.useEffect)(function(){if(!o&&"down"!==r&&"right"!==r){var e=function(e,t){var n;function i(){for(var i=this,r=arguments.length,o=Array(r),s=0;s<r;s++)o[s]=arguments[s];clearTimeout(n),n=setTimeout(function(){e.apply(i,o)},t)}return void 0===t&&(t=166),i.clear=function(){clearTimeout(n)},i}(function(){p.current&&tC(r,p.current)}),t=tS(p.current);return t.addEventListener("resize",e),function(){e.clear(),t.removeEventListener("resize",e)}}},[r,o]),(0,R.useEffect)(function(){o||v()},[o,v]),(0,R.createElement)(tp,Object.assign({appear:!0,nodeRef:p,onEnter:function(e,t){tC(r,e),tx(e),u&&u(e,t)},onEntered:c,onEntering:function(e){var t=(null==s?void 0:s.transitionTimingFunction)||"cubic-bezier(0.0, 0, 0.2, 1)",n=tb({timeout:a,mode:"enter",style:e9({},s,{transitionTimingFunction:t})});e.style.webkitTransition=tw("-webkit-transform",n),e.style.transition=tw("transform",n),e.style.webkitTransform="none",e.style.transform="none"},onExit:function(e){var t=(null==s?void 0:s.transitionTimingFunction)||"cubic-bezier(0.4, 0, 0.6, 1)",n=tb({timeout:a,mode:"exit",style:e9({},s,{transitionTimingFunction:t})});e.style.webkitTransition=tw("-webkit-transform",n),e.style.transition=tw("transform",n),tC(r,e),h&&h(e)},onExited:function(e){e.style.webkitTransition="",e.style.transition="",d&&d(e)},in:o,timeout:a},f),function(e,t){return(0,R.cloneElement)(n,e9({ref:g,style:e9({visibility:"exited"!==e||o?void 0:"hidden"},s,{},n.props.style)},t))})});tA.displayName="Slide";var tk=function(e){return E().createElement("svg",Object.assign({viewBox:"0 0 24 24",focusable:"false",style:{fontSize:20,marginInlineEnd:8,userSelect:"none",width:"1em",height:"1em",display:"inline-block",fill:"currentColor",flexShrink:0}},e))},tM={maxSnack:3,persist:!1,hideIconVariant:!1,disableWindowBlurListener:!1,variant:"default",autoHideDuration:5e3,iconVariant:{default:void 0,success:E().createElement(function(){return E().createElement(tk,null,E().createElement("path",{d:"M12 2C6.5 2 2 6.5 2 12S6.5 22 12 22 22 17.5 22 12 17.5 2 12 2M10 17L5 12L6.41\n 10.59L10 14.17L17.59 6.58L19 8L10 17Z"}))},null),warning:E().createElement(function(){return E().createElement(tk,null,E().createElement("path",{d:"M13,14H11V10H13M13,18H11V16H13M1,21H23L12,2L1,21Z"}))},null),error:E().createElement(function(){return E().createElement(tk,null,E().createElement("path",{d:"M12,2C17.53,2 22,6.47 22,12C22,17.53 17.53,22 12,22C6.47,22 2,17.53 2,12C2,\n 6.47 6.47,2 12,2M15.59,7L12,10.59L8.41,7L7,8.41L10.59,12L7,15.59L8.41,17L12,\n 13.41L15.59,17L17,15.59L13.41,12L17,8.41L15.59,7Z"}))},null),info:E().createElement(function(){return E().createElement(tk,null,E().createElement("path",{d:"M13,9H11V7H13M13,17H11V11H13M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,\n 0 22,12A10,10 0 0,0 12,2Z"}))},null)},anchorOrigin:{vertical:"bottom",horizontal:"left"},TransitionComponent:tA,transitionDuration:{enter:225,exit:195}},tT=function(e,t){var n=function(e){return"number"==typeof e||null===e};return n(e)?e:n(t)?t:tM.autoHideDuration},tD=function(e,t){var n=function(e,t){return t.some(function(t){return typeof e===t})};return n(e,["string","number"])?e:n(e,["object"])?e9({},tM.transitionDuration,{},n(t,["object"])&&t,{},e):n(t,["string","number"])?t:n(t,["object"])?e9({},tM.transitionDuration,{},t):tM.transitionDuration};function tI(e){return Object.entries(e).reduce(function(e,t){var n,i=t[0],r=t[1];return e9({},e,((n={})[i]=e4(r),n))},{})}var tR="notistack-CollapseWrapper",tE=tI({root:{height:0},entered:{height:"auto"}}),tO=(0,R.forwardRef)(function(e,t){var n=e.children,i=e.in,r=e.onExited,o=(0,R.useRef)(null),s=(0,R.useRef)(null),l=tv(t,s),a=function(){return o.current?o.current.clientHeight:0};return(0,R.createElement)(tp,{in:i,unmountOnExit:!0,onEnter:function(e){e.style.height="0px"},onEntered:function(e){e.style.height="auto"},onEntering:function(e){var t=a(),n=tb({timeout:175,mode:"enter"}),i=n.duration,r=n.easing;e.style.transitionDuration="string"==typeof i?i:i+"ms",e.style.height=t+"px",e.style.transitionTimingFunction=r||""},onExit:function(e){e.style.height=a()+"px"},onExited:r,onExiting:function(e){tx(e);var t=tb({timeout:175,mode:"exit"}),n=t.duration,i=t.easing;e.style.transitionDuration="string"==typeof n?n:n+"ms",e.style.height="0px",e.style.transitionTimingFunction=i||""},nodeRef:s,timeout:175},function(e,t){return(0,R.createElement)("div",Object.assign({ref:l,className:eZ(tE.root,"entered"===e&&tE.entered),style:e9({pointerEvents:"all",overflow:"hidden",minHeight:"0px",transition:tw("height")},"entered"===e&&{overflow:"visible"},{},"exited"===e&&!i&&{visibility:"hidden"})},t),(0,R.createElement)("div",{ref:o,className:tR,style:{display:"flex",width:"100%"}},n))})});tO.displayName="Collapse";var tP={right:"left",left:"right",bottom:"up",top:"down"},tL=function(e){void 0===e&&(e={});var t={containerRoot:!0,containerAnchorOriginTopCenter:!0,containerAnchorOriginBottomCenter:!0,containerAnchorOriginTopRight:!0,containerAnchorOriginBottomRight:!0,containerAnchorOriginTopLeft:!0,containerAnchorOriginBottomLeft:!0};return Object.keys(e).filter(function(e){return!t[e]}).reduce(function(t,n){var i;return e9({},t,((i={})[n]=e[n],i))},{})},tj=function(){};function tB(e,t){return e.reduce(function(e,n){return null==n?e:function(){for(var i=arguments.length,r=Array(i),o=0;o<i;o++)r[o]=arguments[o];var s=[].concat(r);t&&-1===s.indexOf(t)&&s.push(t),e.apply(this,s),n.apply(this,s)}},tj)}var tF="u">typeof window?R.useLayoutEffect:R.useEffect;function tN(e){var t=(0,R.useRef)(e);return tF(function(){t.current=e}),(0,R.useCallback)(function(){return t.current.apply(void 0,arguments)},[])}var tV=(0,R.forwardRef)(function(e,t){var n=e.children,i=e.className,r=e.autoHideDuration,o=e.disableWindowBlurListener,s=void 0!==o&&o,l=e.onClose,a=e.id,u=e.open,c=e.SnackbarProps,h=void 0===c?{}:c,d=(0,R.useRef)(),f=tN(function(){l&&l.apply(void 0,arguments)}),p=tN(function(e){l&&null!=e&&(d.current&&clearTimeout(d.current),d.current=setTimeout(function(){f(null,"timeout",a)},e))});(0,R.useEffect)(function(){return u&&p(r),function(){d.current&&clearTimeout(d.current)}},[u,r,p]);var m=function(){d.current&&clearTimeout(d.current)},g=(0,R.useCallback)(function(){null!=r&&p(.5*r)},[r,p]);return(0,R.useEffect)(function(){if(!s&&u)return window.addEventListener("focus",g),window.addEventListener("blur",m),function(){window.removeEventListener("focus",g),window.removeEventListener("blur",m)}},[s,g,u]),(0,R.createElement)("div",Object.assign({ref:t},h,{className:eZ("notistack-Snackbar",i),onMouseEnter:function(e){h.onMouseEnter&&h.onMouseEnter(e),m()},onMouseLeave:function(e){h.onMouseLeave&&h.onMouseLeave(e),g()}}),n)});tV.displayName="Snackbar";var tH=tI({root:((x={display:"flex",flexWrap:"wrap",flexGrow:1})[to]={flexGrow:"initial",minWidth:"288px"},x)}),tz=(0,R.forwardRef)(function(e,t){var n=e.className,i=te(e,["className"]);return E().createElement("div",Object.assign({ref:t,className:eZ(tH.root,n)},i))});tz.displayName="SnackbarContent";var tW=tI({root:{backgroundColor:"#313131",fontSize:"0.875rem",lineHeight:1.43,letterSpacing:"0.01071em",color:"#fff",alignItems:"center",padding:"6px 16px",borderRadius:"4px",boxShadow:"0px 3px 5px -1px rgba(0,0,0,0.2),0px 6px 10px 0px rgba(0,0,0,0.14),0px 1px 18px 0px rgba(0,0,0,0.12)"},lessPadding:{paddingLeft:"20px"},default:{backgroundColor:"#313131"},success:{backgroundColor:"#43a047"},error:{backgroundColor:"#d32f2f"},warning:{backgroundColor:"#ff9800"},info:{backgroundColor:"#2196f3"},message:{display:"flex",alignItems:"center",padding:"8px 0"},action:{display:"flex",alignItems:"center",marginLeft:"auto",paddingLeft:"16px",marginRight:"-8px"}}),t$="notistack-snackbar",t_=(0,R.forwardRef)(function(e,t){var n=e.id,i=e.message,r=e.action,o=e.iconVariant,s=e.variant,l=e.hideIconVariant,a=e.style,u=e.className,c=o[s],h=r;return"function"==typeof h&&(h=h(n)),E().createElement(tz,{ref:t,role:"alert","aria-describedby":t$,style:a,className:eZ("notistack-MuiContent","notistack-MuiContent-"+s,tW.root,tW[s],u,!l&&c&&tW.lessPadding)},E().createElement("div",{id:t$,className:tW.message},l?null:c,i),h&&E().createElement("div",{className:tW.action},h))});t_.displayName="MaterialDesignContent";var tU=(0,R.memo)(t_),tG=tI({wrappedRoot:{width:"100%",position:"relative",transform:"translateX(0)",top:0,right:0,bottom:0,left:0,minWidth:"288px"}}),tq=function(e){var t,n=(0,R.useRef)(),i=(0,R.useState)(!0),r=i[0],o=i[1],s=tB([e.snack.onClose,e.onClose]),l=(0,R.useCallback)(function(){n.current=setTimeout(function(){o(function(e){return!e})},125)},[]);(0,R.useEffect)(function(){return function(){n.current&&clearTimeout(n.current)}},[]);var a=e.snack,u=e.classes,c=e.Component,h=(0,R.useMemo)(function(){return tL(u)},[u]),d=a.open,f=a.SnackbarProps,p=a.TransitionComponent,m=a.TransitionProps,g=a.transitionDuration,v=a.disableWindowBlurListener,b=a.content,x=te(a,["open","SnackbarProps","TransitionComponent","TransitionProps","transitionDuration","disableWindowBlurListener","content","entered","requestClose","onEnter","onEntered","onExit","onExited"]),y=e9({direction:"center"!==(t=x.anchorOrigin).horizontal?tP[t.horizontal]:tP[t.vertical],timeout:g},m),w=b;"function"==typeof w&&(w=w(x.id,x.message));var S=["onEnter","onEntered","onExit","onExited"].reduce(function(t,n){var i;return e9({},t,((i={})[n]=tB([e.snack[n],e[n]],x.id),i))},{});return E().createElement(tO,{in:r,onExited:S.onExited},E().createElement(tV,{open:d,id:x.id,disableWindowBlurListener:v,autoHideDuration:x.autoHideDuration,className:eZ(tG.wrappedRoot,h.root,h["anchorOrigin"+tl(x.anchorOrigin)]),SnackbarProps:f,onClose:s},E().createElement(p,Object.assign({},y,{appear:!0,in:d,onExit:S.onExit,onExited:l,onEnter:S.onEnter,onEntered:tB([S.onEntered,function(){e.snack.requestClose&&s(null,"instructed",e.snack.id)}],x.id)}),w||E().createElement(void 0===c?tU:c,Object.assign({},x)))))},tY=20,tK=6,tX=2,tZ="."+tR,tQ=tI({root:((y={boxSizing:"border-box",display:"flex",maxHeight:"100%",position:"fixed",zIndex:1400,height:"auto",width:"auto",transition:tw(["top","right","bottom","left","max-width"],{duration:300,easing:"ease"}),pointerEvents:"none"})[tZ]={padding:tK+"px 0px",transition:"padding 300ms ease 0ms"},y.maxWidth="calc(100% - "+2*tY+"px)",y[tr]={width:"100%",maxWidth:"calc(100% - 32px)"},y),rootDense:((w={})[tZ]={padding:tX+"px 0px"},w),top:{top:tY-tK+"px",flexDirection:"column"},bottom:{bottom:tY-tK+"px",flexDirection:"column-reverse"},left:((S={left:tY+"px"})[to]={alignItems:"flex-start"},S[tr]={left:"16px"},S),right:((C={right:tY+"px"})[to]={alignItems:"flex-end"},C[tr]={right:"16px"},C),center:((A={left:"50%",transform:"translateX(-50%)"})[to]={alignItems:"center"},A)}),tJ=(0,R.memo)(function(e){var t=e.classes,n=void 0===t?{}:t,i=e.anchorOrigin,r=e.dense,o=e.children,s=eZ("notistack-SnackbarContainer",tQ[i.vertical],tQ[i.horizontal],tQ.root,n.containerRoot,n["containerAnchorOrigin"+tl(i)],r&&tQ.rootDense);return E().createElement("div",{className:s},o)}),t0=function(e){return!("string"==typeof e||(0,R.isValidElement)(e))},t1=function(e){function t(t){var n;return(n=e.call(this,t)||this).enqueueSnackbar=function(e,t){if(void 0===t&&(t={}),null==e)throw Error("enqueueSnackbar called with invalid argument");var i,r=t0(e)?e:t,o=t0(e)?e.message:e,s=r.key,l=r.preventDuplicate,a=te(r,["key","preventDuplicate"]),u=ta(s),c=u?s:new Date().getTime()+Math.random(),h=(i=n.props,function(e,t){return(void 0===t&&(t=!1),t)?e9({},tM[e],{},i[e],{},a[e]):"autoHideDuration"===e?tT(a.autoHideDuration,i.autoHideDuration):"transitionDuration"===e?tD(a.transitionDuration,i.transitionDuration):a[e]||i[e]||tM[e]}),d=e9({id:c},a,{message:o,open:!0,entered:!1,requestClose:!1,persist:h("persist"),action:h("action"),content:h("content"),variant:h("variant"),anchorOrigin:h("anchorOrigin"),disableWindowBlurListener:h("disableWindowBlurListener"),autoHideDuration:h("autoHideDuration"),hideIconVariant:h("hideIconVariant"),TransitionComponent:h("TransitionComponent"),transitionDuration:h("transitionDuration"),TransitionProps:h("TransitionProps",!0),iconVariant:h("iconVariant",!0),style:h("style",!0),SnackbarProps:h("SnackbarProps",!0),className:eZ(n.props.className,a.className)});return d.persist&&(d.autoHideDuration=void 0),n.setState(function(e){if(void 0===l&&n.props.preventDuplicate||l){var t=function(e){return u?e.id===c:e.message===o},i=e.queue.findIndex(t)>-1,r=e.snacks.findIndex(t)>-1;if(i||r)return e}return n.handleDisplaySnack(e9({},e,{queue:[].concat(e.queue,[d])}))}),c},n.handleDisplaySnack=function(e){return e.snacks.length>=n.maxSnack?n.handleDismissOldest(e):n.processQueue(e)},n.processQueue=function(e){var t=e.queue,n=e.snacks;return t.length>0?e9({},e,{snacks:[].concat(n,[t[0]]),queue:t.slice(1,t.length)}):e},n.handleDismissOldest=function(e){if(e.snacks.some(function(e){return!e.open||e.requestClose}))return e;var t=!1,i=!1;e.snacks.reduce(function(e,t){return e+(t.open&&t.persist?1:0)},0)===n.maxSnack&&(i=!0);var r=e.snacks.map(function(e){return t||e.persist&&!i?e9({},e):(t=!0,e.entered)?(e.onClose&&e.onClose(null,"maxsnack",e.id),n.props.onClose&&n.props.onClose(null,"maxsnack",e.id),e9({},e,{open:!1})):e9({},e,{requestClose:!0})});return e9({},e,{snacks:r})},n.handleEnteredSnack=function(e,t,i){if(!ta(i))throw Error("handleEnteredSnack Cannot be called with undefined key");n.setState(function(e){return{snacks:e.snacks.map(function(e){return e.id===i?e9({},e,{entered:!0}):e9({},e)})}})},n.handleCloseSnack=function(e,t,i){n.props.onClose&&n.props.onClose(e,t,i);var r=void 0===i;n.setState(function(e){var t=e.snacks,n=e.queue;return{snacks:t.map(function(e){return r||e.id===i?e.entered?e9({},e,{open:!1}):e9({},e,{requestClose:!0}):e9({},e)}),queue:n.filter(function(e){return e.id!==i})}})},n.closeSnackbar=function(e){var t=n.state.snacks.find(function(t){return t.id===e});ta(e)&&t&&t.onClose&&t.onClose(null,"instructed",e),n.handleCloseSnack(null,"instructed",e)},n.handleExitedSnack=function(e,t){if(!ta(t))throw Error("handleExitedSnack Cannot be called with undefined key");n.setState(function(e){var i=n.processQueue(e9({},e,{snacks:e.snacks.filter(function(e){return e.id!==t})}));return 0===i.queue.length?i:n.handleDismissOldest(i)})},n.enqueueSnackbar,n.closeSnackbar,n.state={snacks:[],queue:[],contextValue:{enqueueSnackbar:n.enqueueSnackbar.bind(tt(n)),closeSnackbar:n.closeSnackbar.bind(tt(n))}},n}return e7(t,e),t.prototype.render=function(){var e=this,t=this.state.contextValue,n=this.props,i=n.domRoot,r=n.children,o=n.dense,s=void 0!==o&&o,l=n.Components,a=void 0===l?{}:l,u=n.classes,c=this.state.snacks.reduce(function(e,t){var n,i=tl(t.anchorOrigin),r=e[i]||[];return e9({},e,((n={})[i]=[].concat(r,[t]),n))},{}),h=Object.keys(c).map(function(t){var n=c[t],i=n[0];return E().createElement(tJ,{key:t,dense:s,anchorOrigin:i.anchorOrigin,classes:u},n.map(function(t){return E().createElement(tq,{key:t.id,snack:t,classes:u,Component:a[t.variant],onClose:e.handleCloseSnack,onEnter:e.props.onEnter,onExit:e.props.onExit,onExited:tB([e.handleExitedSnack,e.props.onExited],t.id),onEntered:tB([e.handleEnteredSnack,e.props.onEntered],t.id)})}))});return E().createElement(ti.Provider,{value:t},r,i?(0,eK.createPortal)(h,i):h)},e8(t,[{key:"maxSnack",get:function(){return this.props.maxSnack||tM.maxSnack}}]),t}(R.Component);function t2({children:e,...t}){return(0,I.jsx)(t1,{...t,Components:{error:(0,F.A)(tU)(()=>({"&.notistack-MuiContent-error":{whiteSpace:"pre-wrap"}}))},children:e})}function t5(){let{enqueueSnackbar:e,closeSnackbar:t}=(0,R.useContext)(ti),n=t3(e,"error"),i=t3(e,"info"),r=t3(e,"warning"),o=t3(e,"success"),s=(0,R.useCallback)((e,t)=>n(e instanceof Error?e.message:`An unexpected error occurred: ${e}`,t),[n]);return{enqueueSnackbar:e,closeSnackbar:t,errorSnackbar:n,infoSnackbar:i,warningSnackbar:r,successSnackbar:o,exceptionSnackbar:s}}function t3(e,t){return(0,R.useCallback)((n,i)=>e(n,{...i,variant:t}),[e,t])}var t4=n(25632),t6=n.n(t4);let t8="Pinned Crosshair",t9={name:t8,type:"line",markLine:{data:[],lineStyle:{type:"dashed",width:2},emphasis:{lineStyle:{width:2,opacity:1}},blur:{lineStyle:{width:2,opacity:1}}}};var t7=n(94461);let ne=/^(?:(\d+)y)?(?:(\d+)w)?(?:(\d+)d)?(?:(\d+)h)?(?:(\d+)m)?(?:(\d+)s)?(?:(\d+)ms)?$/;function nt(e){let t=ne.exec(e);if(null===t)throw Error(`Invalid duration string '${e}'`);return{years:parseInt(t[1]??"0"),months:0,weeks:parseInt(t[2]??"0"),days:parseInt(t[3]??"0"),hours:parseInt(t[4]??"0"),minutes:parseInt(t[5]??"0"),seconds:parseInt(t[6]??"0")+parseInt(t[7]??"0")/1e3}}function nn(e){return void 0!==e.pastDuration}var ni=n(59140);let nr=ni.Ik({kind:ni.Yj().min(1,"Required"),spec:ni.g1(ni.Yj(),ni.bz())}),no=ni.Ik({name:ni.Yj(),description:ni.Yj().optional(),hidden:ni.zM().optional(),color:ni.Yj().optional()}),ns=ni.Ik({display:no,plugin:nr});ni.Ik({kind:ni.eu("Annotation"),spec:ns});let nl=ni.Ik({name:ni.Yj().optional(),description:ni.Yj().optional()});ni.Ik({display:nl.optional(),default:ni.zM(),plugin:nr}),ni.Yj().min(1,"Required").regex(ne,"Must be a valid duration string");let na=ni.Ik({name:ni.Yj().optional(),description:ni.Yj().optional()}),nu=ni.Ik({kind:ni.Yj().min(1),spec:ni.Ik({name:ni.Yj().optional(),plugin:nr})}),nc=ni.Ik({name:ni.Yj().optional(),url:ni.Yj().min(1),tooltip:ni.Yj().optional(),renderVariables:ni.zM().optional(),targetBlank:ni.zM().optional()}),nh=ni.Ik({display:na.optional(),plugin:nr,queries:ni.YO(nu).optional(),links:ni.YO(nc).optional()}),nd=ni.Ik({kind:ni.eu("Panel"),spec:nh});ni.Ik({groupId:ni.ai(),panelDefinition:nd});let nf=ni.Ik({name:ni.Yj().optional(),description:ni.Yj().optional(),hidden:ni.zM().optional()}),np=ni.Ik({name:ni.Yj().min(1),display:nf.optional(),defaultValue:ni.Yj().or(ni.YO(ni.Yj())).optional(),allowAllValue:ni.zM(),allowMultiple:ni.zM(),customAllValue:ni.Yj().optional(),capturingRegexp:ni.Yj().optional(),sort:ni.k5(["none","alphabetical-asc","alphabetical-desc","numerical-asc","numerical-desc","alphabetical-ci-asc","alphabetical-ci-desc"]).optional(),plugin:nr}),nm=ni.Ik({kind:ni.eu("ListVariable"),spec:np}),ng=ni.Ik({name:ni.Yj().min(1),display:nf.optional(),value:ni.Yj(),constant:ni.zM().optional()}),nv=ni.Ik({kind:ni.eu("TextVariable"),spec:ng});function nb(e){return{value:{pastDuration:e},display:`Last ${(0,t7.formatDuration)(nt(e),{delimiter:", "})}`}}function nx(){return["local","UTC",...Intl.supportedValuesOf?.("timeZone")??[]].filter((e,t,n)=>n.indexOf(e)===t).map(e=>({value:e,display:"local"===e?"Local":e.replace(/_/g," ")}))}function ny(e,t){return"read"===e?"View":t&&"create"===e?"Add":t||"create"!==e?"update"===e?"Edit":"":"Create"}function nw(e,t){return t&&"create"===e?"Add":t&&"update"===e?"Apply":t?"":"Save"}ni.gM("kind",[nv,nm]);let nS=["bottom","right"],nC=["list","table"],nA=["small","medium"];function nk(e){return nS.includes(e)}function nM(e){return nC.includes(e)}function nT(e){return nA.includes(e)}let nD={position:"bottom",mode:"list",size:"medium"};function nI(e){return void 0===e?nD.position:nk(e)?e:nD.position}function nR(e){return e&&nM(e)?e:nD.mode}function nE(e){return e&&nT(e)?e:nD.size}let nO=new Map([["time",new Map],["decimal",new Map],["bits",new Map],["bytes",new Map],["currency",new Map],["percent",new Map],["temperature",new Map],["throughput",new Map]]);function nP(e,t,n,i="en-US"){let r=`${e.filter(e=>![void 0,null,"",NaN].includes(e)).join("|")}|${i}`,o=nO.get(t);if(!o)throw Error("No formatter found for the input type");let s=o.get(r);if(s)return s.format;let l=Intl.NumberFormat(i,n);return o?.set(`${r}`,l),l.format}let nL=()=>({countCacheItems:e=>"all"!==e?nO.get(e)?.size??0:Array.from(nO.values()).reduce((e,t)=>e+(t?.size??0),0),getKeys:e=>[...nO.get(e)?.keys()||[]]});function nj(e){return!1!==e}function nB(e){return"number"==typeof e}function nF(e){return e&&(e<0?e=0:e>20&&(e=20)),e}let nN="Time",nV={label:"Time",decimalPlaces:!0},nH={nanoseconds:{group:nN,label:"Nanoseconds"},microseconds:{group:nN,label:"Microseconds"},milliseconds:{group:nN,label:"Milliseconds"},seconds:{group:nN,label:"Seconds"},minutes:{group:nN,label:"Minutes"},hours:{group:nN,label:"Hours"},days:{group:nN,label:"Days"},weeks:{group:nN,label:"Weeks"},months:{group:nN,label:"Months"},years:{group:nN,label:"Years"}};var nz=((o={}).nanoseconds="nanosecond",o.microseconds="microsecond",o.milliseconds="millisecond",o.seconds="second",o.minutes="minute",o.hours="hour",o.days="day",o.weeks="week",o.months="month",o.years="year",o);let nW={years:31536e3,months:2592e3,weeks:604800,days:86400,hours:3600,minutes:60,seconds:1,milliseconds:.001,microseconds:1e-6,nanoseconds:1e-9},n$=["years","months","weeks","days","hours","minutes","seconds","milliseconds","microseconds","nanoseconds"];function n_(e,{unit:t,decimalPlaces:n}){var i;if(0===e)return"0s";let r=function(e,t){let n=e*nW[t],i=n$[0]||"years",r=i,o=n/nW[i];for(r of n$)if((o=n/nW[r])>=1)break;return{value:o,unit:r}}(e,t??"seconds"),o={style:"unit",unit:nz[r.unit],unitDisplay:"months"===(i=r.unit)||"years"===i?"long":"narrow"};return nB(n)?(o.minimumFractionDigits=nF(n),o.maximumFractionDigits=nF(n)):o.maximumSignificantDigits=3,nP([o.style,o.unit,o.unitDisplay,o.maximumSignificantDigits,n,t??"seconds"],"time",o,"en-US")(r.value)}var nU=n(20009);let nG={label:"Bits",decimalPlaces:!0,shortValues:!0},nq={bits:{group:"Bits",label:"Bits (IEC)"},decbits:{group:"Bits",label:"Bits (SI)"}};function nY(e,{unit:t="bits",shortValues:n,decimalPlaces:i}){let r="decbits"===t;if(!nj(n)||Math.abs(e)<(r?1e3:1024)){let r={style:"decimal",useGrouping:!0};nB(i)?(r.minimumFractionDigits=nF(i),r.maximumFractionDigits=nF(i)):nj(n)&&(r.maximumSignificantDigits=3);let o=[r.style,r.useGrouping,r.maximumSignificantDigits,i,n,t];return`${nP(o,"bits",r,"en-US")(e)} bits`}return(0,nU.A)(e).format({output:"byte",base:r?"decimal":"binary",spaceSeparated:!0,mantissa:nB(i)?i:2,trimMantissa:!nB(i),optionalMantissa:!nB(i)}).replace(/KB/g,"Kb").replace(/MB/g,"Mb").replace(/GB/g,"Gb").replace(/TB/g,"Tb").replace(/PB/g,"Pb").replace(/EB/g,"Eb").replace(/KiB/g,"Kib").replace(/MiB/g,"Mib").replace(/GiB/g,"Gib").replace(/TiB/g,"Tib").replace(/PiB/g,"Pib").replace(/EiB/g,"Eib")}let nK={label:"Bytes",decimalPlaces:!0,shortValues:!0},nX={bytes:{group:"Bytes",label:"Bytes (IEC)"},decbytes:{group:"Bytes",label:"Bytes (SI)"}};function nZ(e,{unit:t="bytes",shortValues:n,decimalPlaces:i}){let r="decbytes"===t;if(!nj(n)||Math.abs(e)<(r?1e3:1024)){let r={style:"unit",unit:"byte",unitDisplay:"long",useGrouping:!0};return nB(i)?(r.minimumFractionDigits=nF(i),r.maximumFractionDigits=nF(i)):nj(n)&&(r.maximumSignificantDigits=3),nP([r.style,r.unit,r.unitDisplay,r.useGrouping,r.maximumSignificantDigits,i,n,t],"bytes",r,"en-US")(e)}return(0,nU.A)(e).format({output:"byte",base:r?"decimal":"binary",spaceSeparated:!0,mantissa:nB(i)?i:2,trimMantissa:!nB(i),optionalMantissa:!nB(i)})}var nQ=n(40224);let nJ="Currency",n0={label:"Currency",decimalPlaces:!0},n1={aud:{group:nJ,label:"Australian Dollar (A$)"},cad:{group:nJ,label:"Canadian Dollar (CA$)"},chf:{group:nJ,label:"Swiss Franc (CHF)"},cny:{group:nJ,label:"Renminbi (CN\xa5)"},eur:{group:nJ,label:"Euro (€)"},gbp:{group:nJ,label:"Pound (\xa3)"},hkd:{group:nJ,label:"Hong Kong Dollar (HK$)"},inr:{group:nJ,label:"Indian Rupee (₹)"},jpy:{group:nJ,label:"Yen (\xa5)"},krw:{group:nJ,label:"South Korean Won (₩)"},nok:{group:nJ,label:"Norwegian Krone (NOK)"},nzd:{group:nJ,label:"New Zealand Dollar (NZ$)"},sek:{group:nJ,label:"Swedish Krona (SEK)"},sgd:{group:nJ,label:"Singapore Dollar (S$)"},usd:{group:nJ,label:"US Dollar ($)"}};function n2(e,{unit:t,decimalPlaces:n}){let i={style:"currency",currency:(0,nQ.toUpper)(t),currencyDisplay:"symbol"};return nB(n)?(i.minimumFractionDigits=nF(n),i.maximumFractionDigits=nF(n)):i.maximumSignificantDigits=3,nP([i.style,i.currency,i.currencyDisplay,i.maximumSignificantDigits,n,t],"currency",i,"en-US")(e)}let n5={label:"percent",decimalPlaces:!0},n3="Percent",n4={percent:{group:n3,label:"Percent (0-100)"},"percent-decimal":{group:n3,label:"Percent (0.0-1.0)"},"%":{disableSelectorOption:!0,group:n3,label:"%"}};function n6(e,{unit:t,decimalPlaces:n}){let i={style:"percent",useGrouping:!0};return nB(n)?(i.minimumFractionDigits=nF(n),i.maximumFractionDigits=nF(n)):i.maximumSignificantDigits=3,"percent"===t&&(e/=100),nP([i.style,i.useGrouping,i.maximumSignificantDigits,n,t],"percent",i,"en-US")(e)}let n8="Temperature",n9={label:n8,decimalPlaces:!0},n7={celsius:{group:n8,label:"Celsius (\xb0C)"},fahrenheit:{group:n8,label:"Fahrenheit (\xb0F)"}},ie=(e,{unit:t,decimalPlaces:n})=>{let i={unit:t,style:"unit"};nB(n)?(i.minimumFractionDigits=nF(n),i.maximumFractionDigits=nF(n)):i.maximumSignificantDigits=3;let r="celsius"===t?"en-GB":"en-US";return nP([i.style,i.unit,i.maximumSignificantDigits,n,r],"temperature",i,r)(e)},it={label:"Decimal",decimalPlaces:!0,shortValues:!0},ii={decimal:{group:"Decimal",label:"Decimal"}};function ir(e,{shortValues:t,decimalPlaces:n}){let i={style:"decimal",useGrouping:!0};return nj(t)&&(i.notation="compact"),nB(n)?(i.minimumFractionDigits=nF(n),i.maximumFractionDigits=nF(n)):nj(t)&&(i.maximumSignificantDigits=3),nP([i.style,i.useGrouping,i.notation,i.maximumSignificantDigits,n],"decimal",i,"en-US")(e)}let io={label:"Throughput",decimalPlaces:!0},is="Throughput",il={"bits/sec":{group:is,label:"Bits/sec (IEC)"},"decbits/sec":{group:is,label:"Bits/sec (SI)"},"bytes/sec":{group:is,label:"Bytes/sec (IEC)"},"decbytes/sec":{group:is,label:"Bytes/sec (SI)"},"counts/sec":{group:is,label:"Counts/sec"},"events/sec":{group:is,label:"Events/sec"},"messages/sec":{group:is,label:"Messages/sec"},"ops/sec":{group:is,label:"Ops/sec"},"packets/sec":{group:is,label:"Packets/sec"},"reads/sec":{group:is,label:"Reads/sec"},"requests/sec":{group:is,label:"Requests/sec"},"records/sec":{group:is,label:"Records/sec"},"rows/sec":{group:is,label:"Rows/sec"},"writes/sec":{group:is,label:"Writes/sec"}};function ia(e,{unit:t,shortValues:n,decimalPlaces:i}){if("bits/sec"===t){let t=1024>Math.abs(e)?"sec":"s";return nY(e,{unit:"bits",shortValues:n,decimalPlaces:i})+"/"+t}if("decbits/sec"===t){let t=1e3>Math.abs(e)?"sec":"s";return nY(e,{unit:"decbits",shortValues:n,decimalPlaces:i})+"/"+t}if("decbytes/sec"===t){let t=1e3>Math.abs(e)?"sec":"s";return nZ(e,{unit:"decbytes",shortValues:n,decimalPlaces:i})+"/"+t}if("bytes/sec"===t){let t=1024>Math.abs(e)?"sec":"s";return nZ(e,{unit:"bytes",shortValues:n,decimalPlaces:i})+"/"+t}let r={style:"decimal",useGrouping:!0};nj(n)&&(r.notation="compact"),nB(i)?(r.minimumFractionDigits=nF(i),r.maximumFractionDigits=nF(i)):nj(n)&&(r.maximumSignificantDigits=3);let o=[r.style,r.useGrouping,r.notation,r.maximumSignificantDigits,i,n,t];return`${nP(o,"throughput",r,"en-US")(e)} ${t}`}let iu="Date",ic={Time:nV,Percent:n5,Decimal:it,Bytes:nK,Bits:nG,Throughput:io,Currency:n0,Temperature:n9,Date:{label:"Date & Time"}},ih={...nH,...n4,...ii,...nX,...nq,...il,...n1,...n7,"datetime-iso":{group:iu,label:"DateTime (GMT)"},"datetime-us":{group:iu,label:"DateTime (US-East)"},"datetime-local":{group:iu,label:"DateTime (Browser Local)"},"date-iso":{group:iu,label:"Date (GMT)"},"date-us":{group:iu,label:"Date (US-East)"},"date-local":{group:iu,label:"Date (Browser Local)"},"time-local":{group:iu,label:"Time (Browser Local)"},"time-iso":{group:iu,label:"Time (GMT)"},"time-us":{group:iu,label:"Time (US-East)"},"relative-time":{group:iu,label:"Relative Time"},"unix-timestamp":{group:iu,label:"Unix Timestamp (s)"},"unix-timestamp-ms":{group:iu,label:"Unix Timestamp (ms)"}};function id(e,t){if(!t)return e.toString();if(iy(t))return nZ(e,t);if(iw(t))return nY(e,t);if(ix(t))return ir(e,t);if(ib(t))return n6(e,t);if(iv(t))return n_(e,t);if(iA(t))return ia(e,t);if(ik(t))return n2(e,t);if(iM(t))return function(e,t={}){let n=Intl.DateTimeFormat().resolvedOptions().timeZone,{unit:i="datetime-local",locale:r=(()=>{if("u">typeof navigator){if(navigator.language)return navigator.language;if(navigator.languages&&navigator.languages.length>0){let e=navigator.languages[0];if(e)return e}let e=navigator;if(e.userLanguage)return e.userLanguage;if(e.browserLanguage)return e.browserLanguage;if(e.systemLanguage)return e.systemLanguage}return Intl.DateTimeFormat().resolvedOptions().locale||"en-US"})(),timeZone:o=n,referenceTime:s=Date.now()}=t;if("unix-timestamp"===i)return(e>1e12?Math.floor(e/1e3):e).toString();if("unix-timestamp-ms"===i)return Math.floor(e<1e11?1e3*e:e).toString();let l=function(e){if(e<0)if(Math.abs(e)>1e10)return new Date(e);else return new Date(1e3*e);if(e>=25e10&&e<=26e10){let t=new Date(1e3*e);if(t.getUTCFullYear()>=9999)return t}return new Date(e<1e10?1e3*e:e)}(e);if("relative-time"===i){let e=new Date(s),t=l.getTime()-e.getTime();for(let{unit:e,ms:n}of[{unit:"year",ms:31536e6},{unit:"month",ms:2592e6},{unit:"week",ms:6048e5},{unit:"day",ms:864e5},{unit:"hour",ms:36e5},{unit:"minute",ms:6e4},{unit:"second",ms:1e3}]){let i=Math.round(t/n);if(Math.abs(i)>=1)return new Intl.RelativeTimeFormat(r,{numeric:"auto"}).format(i,e)}return new Intl.RelativeTimeFormat(r,{numeric:"auto"}).format(0,"second")}let a={timeZone:o};switch(i){case"datetime-iso":return l.toISOString();case"datetime-us":return a.timeZone="America/New_York",a.year="numeric",a.month="2-digit",a.day="2-digit",a.hour="2-digit",a.minute="2-digit",a.second="2-digit",a.hour12=!0,new Intl.DateTimeFormat("en-US",a).format(l);case"datetime-local":a.year="numeric",a.month="2-digit",a.day="2-digit",a.hour="2-digit",a.minute="2-digit",a.second="2-digit",a.hour12=!1;break;case"date-iso":return l.toISOString().split("T")[0];case"date-us":return a.timeZone="America/New_York",a.year="numeric",a.month="2-digit",a.day="2-digit",new Intl.DateTimeFormat("en-US",a).format(l);case"date-local":a.year="numeric",a.month="2-digit",a.day="2-digit";break;case"time-local":a.hour="2-digit",a.minute="2-digit",a.second="2-digit",a.hour12=!1;break;case"time-iso":return l.toISOString().split("T")[1].replace("Z","");case"time-us":return a.timeZone="America/New_York",a.hour="2-digit",a.minute="2-digit",a.second="2-digit",a.hour12=!0,new Intl.DateTimeFormat("en-US",a).format(l);default:throw Error(`Unknown date unit: ${i}`)}return new Intl.DateTimeFormat(r,a).format(l)}(e,t);if(iT(t))return ie(e,t);throw Error(`Unknown unit options ${t}`)}function ip(e){return ih[e.unit??"decimal"]}function im(e){return ip(e).group??"Decimal"}function ig(e){return ic[ip(e).group??"Decimal"]}function iv(e){return"Time"===im(e)}function ib(e){return"Percent"===im(e)}function ix(e){return"Decimal"===im(e)}function iy(e){return"Bytes"===im(e)}function iw(e){return"Bits"===im(e)}function iS(e){return!!ig(e).decimalPlaces}function iC(e){return!!ig(e).shortValues}function iA(e){return"Throughput"===im(e)}function ik(e){return"Currency"===im(e)}function iM(e){return"Date"===im(e)}function iT(e){return"Temperature"===im(e)}let iD={JoinByColumnValue:"Join by column value",MergeColumns:"Merge columns",MergeIndexedColumns:"Merge indexed columns",MergeSeries:"Merge series",ExtractColumnFields:"Extract column fields"};function iI(e,t){return[t6()({type:"value",boundaryGap:[0,"10%"],axisLabel:{formatter:e=>id(e,t)}},e)]}function iR(e,t,n,i){let r=[],o=t6()({type:"value",position:"left",boundaryGap:[0,"10%"],axisLabel:{formatter:e=>id(e,t),overflow:"truncate"}},e);r.push(o);let s=0;return n.forEach((t,n)=>{let o,l,a={type:"value",position:"right",offset:s,boundaryGap:[0,"10%"],axisLabel:{formatter:e=>id(e,t)},splitLine:{show:!1},show:e?.show};r.push(a),i&&(s+=(o=id(i[n]??1e3,t),((l=document.createElement("canvas").getContext("2d"))?(l.font="12px sans-serif",l.measureText(o).width):6*o.length)+10))}),r}function iE(e,t){let{value:n,setValueAndStore:i}=function(e,t,n){let[i,r]=(0,R.useState)(()=>{try{let n=e.getItem(t);if(null!==n)return JSON.parse(n)}catch{}return e.setItem(t,JSON.stringify(n)),n}),o=(0,R.useCallback)(n=>{r(n),e.setItem(t,JSON.stringify(n))},[r,e,t]);return{value:i,setValue:r,setValueAndStore:o}}(window.localStorage,e,t);return[n,i]}function iO(e){let t=e._model;void 0!==t&&void 0!==t.option.toolbox&&t.option.toolbox.length>0&&"normal"===t.option.toolbox[0].feature.dataZoom.iconStatus.zoom&&e.dispatchAction({type:"takeGlobalCursor",key:"dataZoomSelect",dataZoomSelectActive:!0})}function iP(e){e.dispatchAction({type:"restore"})}function iL(e){void 0!==e.dispatchAction&&(e.dispatchAction({type:"unselect"}),e.dispatchAction({type:"downplay"}))}function ij(e,t,n){if(void 0===n)return null;let i=[e,t];return n.containPixel("grid",i)?n.convertFromPixel("grid",i):null}function iB(e,t,n,i,r,o){let s=o.length>0?o[o.length-1]:r[r.length-1];void 0!==s&&e.dispatchAction({type:"select",seriesIndex:s.seriesIndex,dataIndex:s.dataIndex,escapeConnect:!0}),e.dispatchAction({type:"downplay",seriesIndex:i}),n.length>0?e.dispatchAction({type:"highlight",seriesIndex:n,notBlur:!1,escapeConnect:!0}):(e.dispatchAction({type:"highlight",seriesIndex:t,notBlur:!0,escapeConnect:!0}),e.dispatchAction({type:"toggleSelect"}))}function iF(e){return e[e.length-1]?.name===t8}function iN(e,t){if(void 0===e||void 0===t)return null;let n=null,i=1/0;for(let[r]of e){let e=Math.abs(r-t);e<i&&(n=r,i=e)}return n}function iV(e,t){if(void 0===t)return null;let n=e.length,i=null;for(let r=0;r<n;r++){let o=n>0?e[r]:null;if(!o)break;i=iN(o.values,t)}return i}function iH(...e){return e.flatMap(e=>void 0===e?[]:Array.isArray(e)?e:[e])}function iz(e){void 0===globalThis.useIdValue&&(globalThis.useIdValue=0);let t=(0,R.useRef)(void 0);return void 0===t.current&&(t.current=`${e}-${globalThis.useIdValue++}`),t.current}var iW=((s={}).CSV="csv",s.DISTRIBUTED="distributed",s.DOUBLEQUOTE="doublequote",s.GLOB="glob",s.JSON="json",s.LUCENE="lucene",s.PERCENTENCODE="percentencode",s.PIPE="pipe",s.PROMETHEUS="prometheus",s.RAW="raw",s.REGEX="regex",s.SINGLEQUOTE="singlequote",s.SQLSTRING="sqlstring",s.TEXT="text",s.QUERYPARAM="queryparam",s);function i$(e){if(!e)return;let t=e.toLowerCase();return Object.values(iW).find(e=>e===t)||void 0}function i_(e,t,n){switch(n){case"csv":case"raw":return e.join(",");case"distributed":{let[n,...i]=e;return`${[n,...i.map(e=>`${t}=${e}`)].join(",")}`}case"doublequote":return e.map(e=>`"${e}"`).join(",");case"glob":return`{${e.join(",")}}`;case"json":return JSON.stringify(e.map(e=>{try{return JSON.parse(e)}catch{return e}}));case"lucene":return`(${e.map(e=>`"${e}"`).join(" OR ")})`;case"percentencode":return encodeURIComponent(e.join(","));case"pipe":return e.join("|");case"regex":{let t=e.map(e=>e.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&"));return`(${t.join("|")})`}case"singlequote":return e.map(e=>`'${e}'`).join(",");case"sqlstring":return e.map(e=>`'${e.replace(/'/g,"''")}'`).join(",");case"text":return e.join(" + ");case"queryparam":return e.map(e=>`${t}=${encodeURIComponent(e)}`).join("&");default:return`(${e.join("|")})`}}function iU(e,t,n,i){let r="$"+t,o="${"+t+(i?":"+i:"")+"}",s="";return Array.isArray(n)&&(s=i_(n,t,i||"prometheus")),"string"==typeof n&&(s=i_([n],t,i||"raw")),(e=e.replaceAll(r,s)).replaceAll(o,s)}let iG=/\$(\w+)|\${(\w+)(?:\.([^:^}]+))?(?::([^}]+))?}/gm;function iq(e){let t,n=new Set;for(;null!==(t=iG.exec(e));)t&&(t[1]?n.add(t[1]):t[2]&&n.add(t[2]));return Array.from(n.values())}function iY(e){let t,n=new Map;for(;null!==(t=iG.exec(e));)if(t){let e;t[4]&&(e=t[4]),t[1]?n.set(t[1],i$(e)):t[2]&&n.set(t[2],i$(e))}return n}function iK(e,t){let n=iY(e),i=Array.from(n.keys()),r=e;return i.sort((e,t)=>t.length-e.length).forEach(e=>{let i=t[e];i&&void 0!==i.value&&(r=iU(r,e,i?.value,n.get(e)))}),r}let iX=/\$\{__data\.fields(?:\[(?:"|')([^"']+)(?:"|')\]|\.([a-zA-Z_][a-zA-Z0-9_]*))(?::([a-z]+))?\}/g,iZ=/\$\{__data\[(\d+)\]\.fields\[(?:"|')([^"']+)(?:"|')\]\}/g,iQ=/\$\{__data\.index\}/g,iJ=/\$\{__data\.count\}/g,i0=/("|')?\$\{__data(?::([a-z]+))?\}("|')?/g;function i1(e,t){if(Object.prototype.hasOwnProperty.call(e,t)){let n=e[t];return null==n?"":"object"==typeof n?JSON.stringify(n):String(n)}if(t.includes(".")){let n=t.split("."),i=e;for(let e of n){if(null==i||"object"!=typeof i)return"";i=i[e]}return null==i?"":"object"==typeof i?JSON.stringify(i):String(i)}return""}function i2(e){if(!e)return;let t=e.toLowerCase();return Object.values(iW).find(e=>e===t)}function i5(e,t,n={}){let{urlEncode:i=!0,index:r,count:o}=n,s=e,l=[];return void 0!==r&&(s=s.replaceAll(iQ,String(r))),void 0!==o&&(s=s.replaceAll(iJ,String(o))),s=s.replaceAll(i0,(e,n,i,r)=>{let o=i2(i)??iW.RAW;return o===iW.JSON?JSON.stringify(t):i_(Object.values(t).map(e=>JSON.stringify(e)),"",o)}),iX.lastIndex=0,{text:s=s.replaceAll(iX,(e,n,r,o)=>{let s=n??r??"",a=i1(t,s);""===a&&void 0===t[s]&&l.push(`Field "${s}" not found in data`);let u=i2(o);if(u)return i_([a],s,u);if(i){if(u===iW.RAW)return a;if(u!==iW.QUERYPARAM&&u!==iW.PERCENTENCODE)return encodeURIComponent(a)}return a}),errors:l.length>0?l:void 0}}function i3(e,t,n={}){let{urlEncode:i=!0}=n,r=e,o=[];return r=r.replaceAll(iJ,String(t.length)),iZ.lastIndex=0,iX.lastIndex=0,{text:r=(r=(r=r.replaceAll(i0,(e,n,i,r)=>{let o=i2(i)??iW.RAW,s=i_(Object.values(t).map(e=>JSON.stringify(e)),"",o);return n&&r?s:`${n??""}${s}${r??""}`})).replaceAll(iZ,(e,n,r)=>{let s=parseInt(n,10);if(s<0||s>=t.length)return o.push(`Index ${s} out of bounds (0-${t.length-1})`),e;let l=i1(t[s],r);return""===l&&void 0===t[s][r]&&o.push(`Field "${r}" not found in data at index ${s}`),i?encodeURIComponent(l):l})).replaceAll(iX,(e,n,i,r)=>{let o=n??i??"";return i_(t.map(e=>i1(e,o)),o,i2(r)||iW.CSV)}),errors:o.length>0?o:void 0}}function i4(e){return iZ.lastIndex=0,iZ.test(e)||/\$\{__data\.fields(?:\[["'][^"']+["']\]|\.[a-zA-Z_][a-zA-Z0-9_]*):[a-z]+\}/.test(e)}function i6(e){return iZ.lastIndex=0,iZ.test(e)}function i8(e){return iX.lastIndex=0,iZ.lastIndex=0,iX.test(e)||iZ.test(e)}function i9(e){let t,n=new Set;for(iX.lastIndex=0,iZ.lastIndex=0;null!==(t=iX.exec(e));)n.add(t[1]??t[2]);for(;null!==(t=iZ.exec(e));)n.add(t[2]);return Array.from(n)}Symbol.for("constructDateFrom");let i7={},re={};function rt(e,t){try{let n=(i7[e]||=new Intl.DateTimeFormat("en-US",{timeZone:e,timeZoneName:"longOffset"}).format)(t).split("GMT")[1];if(n in re)return re[n];return ri(n,n.split(":"))}catch{if(e in re)return re[e];let t=e?.match(rn);if(t)return ri(e,t.slice(1));return NaN}}let rn=/([+-]\d\d):?(\d\d)?/;function ri(e,t){let n=+(t[0]||0),i=+(t[1]||0),r=(t[2]||0)/60;return re[e]=60*n+i>0?60*n+i+r:60*n-i-r}class rr extends Date{constructor(...e){super(),e.length>1&&"string"==typeof e[e.length-1]&&(this.timeZone=e.pop()),this.internal=new Date,isNaN(rt(this.timeZone,this))?this.setTime(NaN):e.length?"number"==typeof e[0]&&(1===e.length||2===e.length&&"number"!=typeof e[1])?this.setTime(e[0]):"string"==typeof e[0]?this.setTime(+new Date(e[0])):e[0]instanceof Date?this.setTime(+e[0]):(this.setTime(+new Date(...e)),rl(this,NaN),rs(this)):this.setTime(Date.now())}static tz(e,...t){return t.length?new rr(...t,e):new rr(Date.now(),e)}withTimeZone(e){return new rr(+this,e)}getTimezoneOffset(){let e=-rt(this.timeZone,this);return e>0?Math.floor(e):Math.ceil(e)}setTime(e){return Date.prototype.setTime.apply(this,arguments),rs(this),+this}[Symbol.for("constructDateFrom")](e){return new rr(+new Date(e),this.timeZone)}}let ro=/^(get|set)(?!UTC)/;function rs(e){e.internal.setTime(+e),e.internal.setUTCSeconds(e.internal.getUTCSeconds()-Math.round(-(60*rt(e.timeZone,e))))}function rl(e){let t=rt(e.timeZone,e),n=t>0?Math.floor(t):Math.ceil(t),i=new Date(+e);i.setUTCHours(i.getUTCHours()-1);let r=-new Date(+e).getTimezoneOffset(),o=r- -new Date(+i).getTimezoneOffset(),s=Date.prototype.getHours.apply(e)!==e.internal.getUTCHours();o&&s&&e.internal.setUTCMinutes(e.internal.getUTCMinutes()+o);let l=r-n;l&&Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+l);let a=new Date(+e);a.setUTCSeconds(0);let u=r>0?a.getSeconds():(a.getSeconds()-60)%60,c=Math.round(-(60*rt(e.timeZone,e)))%60;(c||u)&&(e.internal.setUTCSeconds(e.internal.getUTCSeconds()+c),Date.prototype.setUTCSeconds.call(e,Date.prototype.getUTCSeconds.call(e)+c+u));let h=rt(e.timeZone,e),d=h>0?Math.floor(h):Math.ceil(h),f=-new Date(+e).getTimezoneOffset()-d-l;if(d!==n&&f){Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+f);let t=rt(e.timeZone,e),n=d-(t>0?Math.floor(t):Math.ceil(t));n&&(e.internal.setUTCMinutes(e.internal.getUTCMinutes()+n),Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+n))}}Object.getOwnPropertyNames(Date.prototype).forEach(e=>{if(!ro.test(e))return;let t=e.replace(ro,"$1UTC");rr.prototype[t]&&(e.startsWith("get")?rr.prototype[e]=function(){return this.internal[t]()}:(rr.prototype[e]=function(){var e;return Date.prototype[t].apply(this.internal,arguments),e=this,Date.prototype.setFullYear.call(e,e.internal.getUTCFullYear(),e.internal.getUTCMonth(),e.internal.getUTCDate()),Date.prototype.setHours.call(e,e.internal.getUTCHours(),e.internal.getUTCMinutes(),e.internal.getUTCSeconds(),e.internal.getUTCMilliseconds()),rl(e),+this},rr.prototype[t]=function(){return Date.prototype[t].apply(this,arguments),rs(this),+this}))});class ra extends rr{static tz(e,...t){return t.length?new ra(...t,e):new ra(Date.now(),e)}toISOString(){let[e,t,n]=this.tzComponents(),i=`${e}${t}:${n}`;return this.internal.toISOString().slice(0,-1)+i}toString(){return`${this.toDateString()} ${this.toTimeString()}`}toDateString(){let[e,t,n,i]=this.internal.toUTCString().split(" ");return`${e?.slice(0,-1)} ${n} ${t} ${i}`}toTimeString(){let e=this.internal.toUTCString().split(" ")[4],[t,n,i]=this.tzComponents();return`${e} GMT${t}${n}${i} (${function(e,t,n="long"){return new Intl.DateTimeFormat("en-US",{hour:"numeric",timeZone:e,timeZoneName:n}).format(t).split(/\s/g).slice(2).join(" ")}(this.timeZone,this)})`}toLocaleString(e,t){return Date.prototype.toLocaleString.call(this,e,{...t,timeZone:t?.timeZone||this.timeZone})}toLocaleDateString(e,t){return Date.prototype.toLocaleDateString.call(this,e,{...t,timeZone:t?.timeZone||this.timeZone})}toLocaleTimeString(e,t){return Date.prototype.toLocaleTimeString.call(this,e,{...t,timeZone:t?.timeZone||this.timeZone})}tzComponents(){let e=this.getTimezoneOffset(),t=String(Math.floor(Math.abs(e)/60)).padStart(2,"0"),n=String(Math.abs(e)%60).padStart(2,"0");return[e>0?"-":"+",t,n]}withTimeZone(e){return new ra(+this,e)}[Symbol.for("constructDateFrom")](e){return new ra(+new Date(e),this.timeZone)}}function ru(e,t){if(t){let n=t.toLowerCase();if("local"!==n&&"browser"!==n)return{...e,timeZone:"utc"===n?"UTC":t}}return e}function rc(e,t,n){let i,r=n?.toLowerCase();if(!n||"local"===r||"browser"===r)return(0,t7.format)(e,t);return(0,t7.format)(e,t,{in:(i="utc"===r?"UTC":n,e=>ra.tz(i,+new Date(e)))})}function rh(e){let t=e?.toLowerCase(),n=e&&"local"!==t&&"browser"!==t?"utc"===t?"UTC":e:Intl.DateTimeFormat().resolvedOptions().timeZone;try{let e=new Intl.DateTimeFormat("en-US",{timeZone:n,timeZoneName:"shortOffset"}).formatToParts(new Date).find(e=>"timeZoneName"===e.type),t=e?.value??"";if("GMT"===t)return"GMT+0";return t}catch{return"GMT+0"}}function rd(e){return e>15768e7?"{yyyy}":e>63072e6?"{MMM} {yyyy}":e>432e6&&e<1577664e4?"{MM}/{dd}":e>1728e5&&e<=432e6?"{MM}/{dd} {HH}:{mm}":{year:"{yearStyle|{yyyy}}\n{monthStyle|{MMM}}",month:"{MMM}",day:"{MM}/{dd}"}}let rf=e=>{if(!e)return{formattedDate:"",formattedTime:""};let t=new Date(e);return{formattedDate:(0,t7.format)(t,"MMM dd, yyyy - "),formattedTime:(0,t7.format)(t,"HH:mm:ss")}};var rp=n(18264),rm=n.n(rp);function rg(e,t){let n=(0,R.useRef)(),i=!0;for(let e=0;e<t.length;e++)if(n.current?.deps[e]!==t[e]){i=!1;break}return(void 0===n.current||!1===i)&&(n.current={value:e(),deps:t}),n.current.value}function rv(e,t){let n=(0,R.useRef)();return(void 0===n.current||!1===rm()(t,n.current.deps))&&(n.current={value:e(),deps:t}),n.current.value}function rb(e,t){let n={};for(let[i,r]of Object.entries(e))n[i]=iK(r,t);return n}function rx(e,t){let n={};for(let[i,r]of Object.entries(e))Array.isArray(r)?n[i]=r.map(e=>iK(e,t)):n[i]=iK(r,t);return n}function ry(e,t,n,i,r){let o=i5(e,t,{index:n,count:i}),s=o.text,l=[];return o.errors&&l.push(...o.errors.map(e=>e.replace("in data","in selection data"))),r&&(s=iK(s,r)),{text:s,errors:l.length>0?l:void 0}}function rw(e,t,n){let i=i3(e,t),r=i.text,o=[];return i.errors&&o.push(...i.errors.map(e=>e.replace("in data","in selection data"))),n&&(r=iK(r,n)),{text:r,errors:o.length>0?o:void 0}}function rS(e,t){let n=e.palette.text?.primary??"#222",i={title:{show:!1},textStyle:{color:n,fontFamily:e.typography.fontFamily,fontSize:12},grid:{top:5,right:20,bottom:0,left:20,containLabel:!0},color:["#56B4E9","#009E73","#0072B2","#CC79A7","#F0E442","#E69F00","#D55E00"],categoryAxis:{show:!0,axisLabel:{show:!0,color:n,margin:15},axisTick:{show:!1,length:6,lineStyle:{color:e.palette.grey[600]}},axisLine:{show:!0,lineStyle:{color:e.palette.grey[600]}},splitLine:{show:!0,lineStyle:{width:.5,color:e.palette.grey[300],opacity:.4}},splitArea:{show:!1,areaStyle:{color:[e.palette.grey[300]]}}},timeAxis:{show:!0,axisLabel:{show:!0,color:n,margin:15},axisTick:{show:!1,length:6,lineStyle:{color:e.palette.grey[600]}},axisLine:{show:!0,lineStyle:{color:e.palette.grey[600]}},splitLine:{show:!0,lineStyle:{width:.5,color:e.palette.grey[300],opacity:.4}},splitArea:{show:!1,areaStyle:{color:[e.palette.grey[300]]}}},valueAxis:{show:!0,axisLabel:{color:n,margin:12},axisLine:{show:!1},splitLine:{show:!0,lineStyle:{width:.5,color:e.palette.grey[300],opacity:.6}}},legend:{orient:"horizontal",textStyle:{color:n},pageTextStyle:{color:e.palette.grey[600]},pageIconColor:e?.palette?.action?.active,pageIconInactiveColor:e?.palette?.action?.disabled},toolbox:{show:!0,top:10,right:10,iconStyle:{borderColor:n}},tooltip:{backgroundColor:e.palette.designSystem?.grey[800],borderColor:e.palette.designSystem?.grey[800],textStyle:{color:"#fff",fontSize:11}},axisPointer:{lineStyle:{color:e.palette.grey[500]}},markLine:{symbol:"none",symbolSize:0,itemStyle:{color:e.palette.grey[500]},lineStyle:{type:"dashed",width:1}},line:{showSymbol:!1,symbol:"circle",symbolSize:4,smooth:!1,lineStyle:{width:1},emphasis:{lineStyle:{width:1.5}}},bar:{barMaxWidth:150,itemStyle:{borderWidth:0,borderRadius:0,borderColor:e.palette.grey[300]},label:{show:!1,color:n}},gauge:{detail:{fontSize:18,fontWeight:600,valueAnimation:!1},splitLine:{distance:0,length:4,lineStyle:{width:1}},splitNumber:12}};return t6()({echartsTheme:i,noDataOption:{title:{show:!0,textStyle:{color:n,fontSize:16,fontWeight:400},text:"No data",left:"center",top:"center"},xAxis:{show:!1},yAxis:{show:!1}},sparkline:{width:2,color:"#1976d2"},container:{padding:{default:parseInt(e.spacing(1.5),10)}},thresholds:{defaultColor:e.palette.success.main,palette:["#FFCC00",e.palette.warning.main,e.palette.error.main]}},t)}function rC(e){return!!e?.startsWith("/")}function rA(e){if(!e)throw Error("Input string cannot be empty");if(!rC(e))return RegExp(`^${e}$`);let t=e.match(/^\/(.+)\/([gimy]*)$/);if(!t)throw Error(`Invalid regular expression format: ${e}`);let[,n="",i=""]=t;try{return new RegExp(n,i)}catch(e){throw Error(`Failed to create RegExp ${e}`)}}function rk(e,t=[]){if(!t.length)return{value:e};let n={value:e};return t.forEach(t=>{switch(t.kind){case"Value":{let i=t.spec;String(i.value)===String(e)&&(n.value=i.result.value||n.value,n.color=i.result.color);break}case"Range":{let i=t.spec;if(void 0===i.from&&void 0===i.to)break;let r=void 0!==i.from?i.from:-1/0,o=void 0!==i.to?i.to:1/0;e>=r&&e<=o&&(n.value=i.result.value||n.value,n.color=i.result.color);break}case"Regex":{let i=t.spec,r=e.toString();if(!i.pattern)break;let o=rA(i.pattern);r.match(o)&&null!==i.result.value&&(n.value=r.replace(o,i.result.value.toString()||"")||n.value,n.color=i.result.color);break}case"Misc":{let i=t.spec;(function(e,t){switch(e){case"empty":return""===t;case"null":return null==t;case"NaN":return Number.isNaN(t);case"true":return!0===t;case"false":return!1===t;default:return!1}})(i.value,e)&&(n.value=i.result.value||n.value,n.color=i.result.color)}}}),n}function rM(e,t){if(0===t.length)return e;let n={};for(let i of e){let e=Object.keys(i).filter(e=>t.includes(e)).map(e=>i[e]).join("|"),r=n[e];r?n[e]={...r,...i}:n[e]={...i}}return Object.values(n)}function rT(e,t,n){let i=[];for(let r of e){let e=Object.keys(r).filter(e=>t.includes(e)),o={};for(let t of e)o[t]=r[t],delete r[t];for(let t of e)i.push({...r,[n]:o[t]});0===e.length&&i.push(r)}return i}function rD(e,t){let n=[];for(let i of e){let e=Object.keys(i).filter(e=>RegExp("^(("+t+" #\\d+)|("+t+"))$").test(e)),r={};for(let t of e)r[t]=i[t],delete i[t];for(let o of e)n.push({...i,[t]:r[o]});0===e.length&&n.push(i)}return n}function rI(e){let t=[...e],n=Array.from(new Set(e.flatMap(Object.keys).map(e=>e.replace(/ #\d+/,"")).filter(e=>"value"!==e)));for(let e of n)t=rD(t,e);return rM(t,n)}function rR(e,t){let n=e;for(let e of t??[])if(!e.spec.disabled)switch(e.kind){case"JoinByColumnValue":e.spec.columns&&e.spec.columns.length>0&&(n=rM(n,e.spec.columns));break;case"MergeIndexedColumns":e.spec.column&&(n=rD(n,e.spec.column));break;case"MergeColumns":e.spec.columns&&e.spec.columns.length>0&&e.spec.name&&(n=rT(n,e.spec.columns,e.spec.name));break;case"MergeSeries":n=rI(n)}return n.map(e=>Object.keys(e).sort().reduce((t,n)=>(t[n]=e[n],t),{}))}var rE=n(18615),rO=n(95343),rP=n(80185),rL=n(53684),rj=n(43163),rB=n(45588),rF=n(46797),rN=n(55624),rV=n(49204),rH=n(1207),rz="zeros",rW=(0,rH.P9)(rz,["typed","config","matrix","BigNumber"],e=>{var{typed:t,config:n,matrix:i,BigNumber:r}=e;return t(rz,{"":function(){return"Array"===n.matrix?o([]):o([],"default")},"...number | BigNumber | string":function(e){if("string"==typeof e[e.length-1]){var t=e.pop();return o(e,t)}return"Array"===n.matrix?o(e):o(e,"default")},Array:o,Matrix:function(e){var t=e.storage();return o(e.valueOf(),t)},"Array | Matrix, string":function(e,t){return o(e.valueOf(),t)}});function o(e,t){var n,o=(n=!1,e.forEach(function(e,t,i){(0,rF.C4)(e)&&(n=!0,i[t]=e.toNumber())}),n)?new r(0):0;if(e.forEach(function(e){if("number"!=typeof e||!(0,rN.YN)(e)||e<0)throw Error("Parameters in function zeros must be positive integers")}),t){var s=i(t);return e.length>0?s.resize(e,o):s}var l=[];return e.length>0?(0,rV.XR)(l,e,o):l}}),r$={BigNumberDependencies:rO.P,matrixDependencies:rj.p,typedDependencies:rB.U,createZeros:rW},r_=(0,rH.P9)("algorithm11",["typed","equalScalar"],e=>{var{typed:t,equalScalar:n}=e;return function(e,i,r,o){var s,l=e._values,a=e._index,u=e._ptr,c=e._size,h=e._datatype;if(!l)throw Error("Cannot perform operation on Pattern Sparse Matrix and Scalar value");var d=c[0],f=c[1],p=n,m=0,g=r;"string"==typeof h&&(s=h,p=t.find(n,[s,s]),m=t.convert(0,s),i=t.convert(i,s),g=t.find(r,[s,s]));for(var v=[],b=[],x=[],y=0;y<f;y++){x[y]=b.length;for(var w=u[y],S=u[y+1],C=w;C<S;C++){var A=a[C],k=o?g(i,l[C]):g(l[C],i);p(k,m)||(b.push(A),v.push(k))}}return x[f]=b.length,e.createSparseMatrix({values:v,index:b,ptr:x,size:[d,f],datatype:s})}}),rU=(0,rH.P9)("algorithm12",["typed","DenseMatrix"],e=>{var{typed:t,DenseMatrix:n}=e;return function(e,i,r,o){var s,l=e._values,a=e._index,u=e._ptr,c=e._size,h=e._datatype;if(!l)throw Error("Cannot perform operation on Pattern Sparse Matrix and Scalar value");var d=c[0],f=c[1],p=r;"string"==typeof h&&(s=h,i=t.convert(i,s),p=t.find(r,[s,s]));for(var m=[],g=[],v=[],b=0;b<f;b++){for(var x=b+1,y=u[b],w=u[b+1],S=y;S<w;S++){var C=a[S];g[C]=l[S],v[C]=x}for(var A=0;A<d;A++)0===b&&(m[A]=[]),v[A]===x?m[A][b]=o?p(i,g[A]):p(g[A],i):m[A][b]=o?p(i,0):p(0,i)}return new n({data:m,size:[d,f],datatype:s})}}),rG=n(77666),rq=n(34046),rY="Number of decimals in function round must be an integer",rK="round",rX=(0,rH.P9)(rK,["typed","matrix","equalScalar","zeros","BigNumber","DenseMatrix"],e=>{var{typed:t,matrix:n,equalScalar:i,zeros:r,BigNumber:o,DenseMatrix:s}=e,l=r_({typed:t,equalScalar:i}),a=rU({typed:t,DenseMatrix:s}),u=(0,rG.f)({typed:t});return t(rK,{number:rq.Wf,"number, number":rq.Wf,"number, BigNumber":function(e,t){if(!t.isInteger())throw TypeError(rY);return new o(e).toDecimalPlaces(t.toNumber())},Complex:function(e){return e.round()},"Complex, number":function(e,t){if(t%1)throw TypeError(rY);return e.round(t)},"Complex, BigNumber":function(e,t){if(!t.isInteger())throw TypeError(rY);var n=t.toNumber();return e.round(n)},BigNumber:function(e){return e.toDecimalPlaces(0)},"BigNumber, BigNumber":function(e,t){if(!t.isInteger())throw TypeError(rY);return e.toDecimalPlaces(t.toNumber())},Fraction:function(e){return e.round()},"Fraction, number":function(e,t){if(t%1)throw TypeError(rY);return e.round(t)},"Fraction, BigNumber":function(e,t){if(!t.isInteger())throw TypeError(rY);return e.round(t.toNumber())},"Array | Matrix":function(e){return function e(t,n,i){return t&&"function"==typeof t.map?t.map(function(t){return e(t,n,i)}):n(t)}(e,this,!0)},"SparseMatrix, number | BigNumber":function(e,t){return l(e,t,this,!1)},"DenseMatrix, number | BigNumber":function(e,t){return u(e,t,this,!1)},"Array, number | BigNumber":function(e,t){return u(n(e),t,this,!1).valueOf()},"number | Complex | BigNumber | Fraction, SparseMatrix":function(e,t){return i(e,0)?r(t.size(),t.storage()):a(t,e,this,!0)},"number | Complex | BigNumber | Fraction, DenseMatrix":function(e,t){return i(e,0)?r(t.size(),t.storage()):u(t,e,this,!0)},"number | Complex | BigNumber | Fraction, Array":function(e,t){return u(n(t),e,this,!0).valueOf()}})}),rZ={BigNumberDependencies:rO.P,DenseMatrixDependencies:rP.k,equalScalarDependencies:rL.u,matrixDependencies:rj.p,typedDependencies:rB.U,zerosDependencies:r$,createRound:rX},rQ=n(91165);let{round:rJ}=(0,rE.v)({roundDependencies:rZ}),{gcd:r0}=(0,rE.v)({gcdDependencies:rQ._}),r1=10;function r2(e,t){let n=t.startMs,i=e.values,r=[];for(let e of i){for(;n<e[0];)r.push([n,null]),n+=t.stepMs;r.push([n,e[1]]),n+=t.stepMs}for(;n<=t.endMs;)r.push([n,null]),n+=t.stepMs;return r}function r5(e){let t,n,i=[];for(let t of e)if(t&&"timeRange"in t){if(void 0===t||void 0===t.timeRange||void 0===t.stepMs)continue;if(i.push(t.stepMs),void 0===n){n=t.timeRange;continue}t.timeRange.start<n.start&&(n.start=t.timeRange.start),t.timeRange.end>n.end&&(n.end=t.timeRange.end)}else if(t&&"values"in t){for(let e=0;e<t.values.length;e++){let i=t.values[e];if(void 0===i)continue;let[r]=i,o=new Date(r),s=new Date(r);if(void 0===n){n={start:o,end:s};continue}o<n.start&&(n.start=o),s>n.end&&(n.end=s)}if(void 0===n)return;let e=n.start.valueOf(),i=n.end.valueOf(),r=i-e;return{startMs:e,endMs:i,rangeMs:r,stepMs:r1}}if(void 0===n)return;if(1===i.length)t=i[0];else{let e=r0(...i);t=e<r1?r1:e}let r=n.start.valueOf(),o=n.end.valueOf();return{startMs:r,endMs:o,stepMs:t,rangeMs:o-r}}let r3=(0,R.createContext)(void 0);function r4(e){let{children:t,timeZone:n}=e;return(0,I.jsx)(r3.Provider,{value:n,children:t})}function r6(){let e=(0,R.useContext)(r3);return{timeZone:e??"local",formatWithUserTimeZone:(t,n)=>rc(t,n,e),dateFormatOptionsWithUserTimeZone:t=>ru(t,e)}}function r8({label:e,color:t,onColorChange:n,onClear:i}){let[r,o]=(0,R.useState)(null),s=!!r,{thresholds:{defaultColor:l,palette:a}}=eF();return(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(r9,{size:"small","aria-label":`change ${e} color`,isSelected:s,iconColor:t,onClick:e=>{o(e.currentTarget)},children:(0,I.jsx)(eI.default,{})}),(0,I.jsx)(eP.Ay,{"data-testid":"options color picker",open:s,anchorEl:r,onClose:()=>{o(null)},slotProps:{paper:{sx:{padding:e=>e.spacing(2)}}},anchorOrigin:{vertical:"top",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"right"},children:(0,I.jsx)(eE,{color:t,palette:[l,...a],onChange:n,onClear:i})})]})}let r9=(0,F.A)(Q.A,{shouldForwardProp:e=>"isSelected"!==e&&"iconColor"!==e})(({iconColor:e,isSelected:t})=>({backgroundColor:t&&e?`${e}3F`:"undefined",color:e}));var r7=n(56599),oe=n(74628),ot=n(38662);function on(e){e()}function oi(e,t){return n=>e(t(n))}function or(e){return void 0!==e}function oo(){}function os(e,t){return t(e)}function ol(...e){return e}function oa(e){e(2)}function ou(e){return e(4)}function oc(e,t){return e(1,e=>t(0,e))}function oh(e,t){let n=e(1,e=>{n(),t(e)});return n}function od(e){let t,n;return i=>r=>{t=r,n&&clearTimeout(n),n=setTimeout(()=>{i(t)},e)}}function of(e,t){return e===t}function op(e=of){let t;return n=>i=>{e(t,i)||(t=i,n(i))}}function om(e){return t=>n=>{e(n)&&t(n)}}function og(e){return t=>oi(t,e)}function ov(e){return t=>()=>{t(e)}}function ob(e,...t){let n=function(...e){return t=>e.reduceRight(os,t)}(...t);return(t,i)=>{switch(t){case 2:oa(e);return;case 1:return e(1,n(i))}}}function ox(e,t){return n=>i=>{n(t=e(t,i))}}function oy(e){return t=>n=>{e>0?e--:t(n)}}function ow(e){let t=null,n;return i=>r=>{t=r,n||(n=setTimeout(()=>{n=void 0,i(t)},e))}}function oS(...e){let t=Array(e.length),n=0,i=null,r=2**e.length-1;return e.forEach((e,o)=>{let s=2**o;e(1,e=>{let l=n;n|=s,t[o]=e,l!==r&&n===r&&i&&(i(),i=null)})}),e=>o=>{let s=()=>{e([o].concat(t))};n===r?s():i=s}}function oC(e){let t=e,n=ok();return(e,i)=>{switch(e){case 0:t=i;break;case 1:i(t);break;case 4:return t}return n(e,i)}}function oA(e,t){var n;return n=oC(t),oc(e,n),n}function ok(){let e=[];return(t,n)=>{switch(t){case 0:e.slice().forEach(e=>{e(n)});return;case 2:e.splice(0,e.length);return;case 1:return e.push(n),()=>{let t=e.indexOf(n);t>-1&&e.splice(t,1)}}}}function oM(e){var t;return t=ok(),oc(e,t),t}function oT(e,t=[],{singleton:n}={singleton:!0}){return{constructor:e,dependencies:t,id:oD(),singleton:n}}let oD=()=>Symbol();function oI(...e){let t=ok(),n=Array(e.length),i=0,r=2**e.length-1;return e.forEach((e,o)=>{let s=2**o;e(1,e=>{n[o]=e,(i|=s)===r&&t(0,n)})}),function(e,o){switch(e){case 2:return void oa(t);case 1:return i===r&&o(n),t(1,o)}}}function oR(e,t=of){return ob(e,op(t))}function oE(...e){return function(t,n){switch(t){case 2:return;case 1:return function(...e){return()=>{e.map(on)}}(...e.map(e=>e(1,n)))}}}let oO=1,oP={0:"debug",3:"error",[oO]:"log",2:"warn"},oL=oT(()=>{let e=oC(3);return{log:oC((t,n,i=oO)=>{i>=((typeof globalThis>"u"?window:globalThis).VIRTUOSO_LOG_LEVEL??ou(e))&&console[oP[i]]("%creact-virtuoso: %c%s %o","color: #0253b3; font-weight: bold","color: initial",t,n)}),logLevel:e}},[],{singleton:!0});function oj(e,t,n){return oB(e,t,n).callbackRef}function oB(e,t,n){let i=E().useRef(null),r=E().useMemo(()=>"u">typeof ResizeObserver?new ResizeObserver(t=>{let i=()=>{let n=t[0].target;null!==n.offsetParent&&e(n)};n?i():requestAnimationFrame(i)}):null,[e,n]);return{callbackRef:e=>{e&&t?(r?.observe(e),i.current=e):(i.current&&r?.unobserve(i.current),i.current=null)},ref:i}}function oF(e,t,n,i,r,o,s,l,a){return oB(E().useCallback(n=>{let a,u=function(e,t,n,i){let r=e.length;if(0===r)return null;let o=[];for(let s=0;s<r;s++){let r=e.item(s);if(void 0===r.dataset.index)continue;let l=parseInt(r.dataset.index),a=parseFloat(r.dataset.knownSize),u=t(r,n);if(0===u&&i("Zero-sized element, this should not happen",{child:r},3),u===a)continue;let c=o[o.length-1];0===o.length||c.size!==u||c.endIndex!==l-1?o.push({endIndex:l,size:u,startIndex:l}):o[o.length-1].endIndex++}return o}(n.children,t,l?"offsetWidth":"offsetHeight",r),c=n.parentElement;for(;void 0===c.dataset.virtuosoScroller;)c=c.parentElement;let h="window"===c.lastElementChild.dataset.viewportType;h&&(a=c.ownerDocument.defaultView);let d=s?l?s.scrollLeft:s.scrollTop:h?l?a.scrollX||a.document.documentElement.scrollLeft:a.scrollY||a.document.documentElement.scrollTop:l?c.scrollLeft:c.scrollTop;i({scrollHeight:s?l?s.scrollWidth:s.scrollHeight:h?l?a.document.documentElement.scrollWidth:a.document.documentElement.scrollHeight:l?c.scrollWidth:c.scrollHeight,scrollTop:Math.max(d,0),viewportHeight:s?l?s.offsetWidth:s.offsetHeight:h?l?a.innerWidth:a.innerHeight:l?c.offsetWidth:c.offsetHeight}),o?.(l?oN("column-gap",getComputedStyle(n).columnGap,r):oN("row-gap",getComputedStyle(n).rowGap,r)),null!==u&&e(u)},[e,t,r,o,s,i,l]),n,a)}function oN(e,t,n){return"normal"!==t&&t?.endsWith("px")!==!0&&n(`${e} was not resolved to pixel value correctly`,t,2),"normal"===t?0:parseInt(t??"0",10)}function oV(e,t,n){let i=E().useRef(null),r=E().useCallback(n=>{let r,o;if(!n?.offsetParent)return;let l=n.getBoundingClientRect(),a=l.width;if(t){let e=t.getBoundingClientRect(),n=l.top-e.top;o=e.height-Math.max(0,n),r=n+t.scrollTop}else{let e=s.current.ownerDocument.defaultView;o=e.innerHeight-Math.max(0,l.top),r=l.top+e.scrollY}i.current={listHeight:l.height,offsetTop:r,visibleHeight:o,visibleWidth:a},e(i.current)},[e,t]),{callbackRef:o,ref:s}=oB(r,!0,n),l=E().useCallback(()=>{r(s.current)},[r,s]);return E().useEffect(()=>{if(t){t.addEventListener("scroll",l);let e=new ResizeObserver(()=>{requestAnimationFrame(l)});return e.observe(t),()=>{t.removeEventListener("scroll",l),e.unobserve(t)}}let e=s.current?.ownerDocument.defaultView;return e?.addEventListener("scroll",l),e?.addEventListener("resize",l),()=>{e?.removeEventListener("scroll",l),e?.removeEventListener("resize",l)}},[l,t,s]),o}let oH=oT(()=>{let e=ok(),t=ok(),n=oC(0),i=ok(),r=oC(0),o=ok(),s=ok(),l=oC(0),a=oC(0),u=oC(0),c=oC(0),h=ok(),d=ok(),f=oC(!1),p=oC(!1),m=oC(!1);return oc(ob(e,og(({scrollTop:e})=>e)),t),oc(ob(e,og(({scrollHeight:e})=>e)),s),oc(t,r),{deviation:n,fixedFooterHeight:u,fixedHeaderHeight:a,footerHeight:c,headerHeight:l,horizontalDirection:p,scrollBy:d,scrollContainerState:e,scrollHeight:s,scrollingInProgress:f,scrollTo:h,scrollTop:t,skipAnimationFrameInResizeObserver:m,smoothScrollTargetReached:i,statefulScrollTop:r,viewportHeight:o}},[],{singleton:!0}),oz={lvl:0};function oW(e,t){let n=e.length;if(0===n)return[];let{index:i,value:r}=t(e[0]),o=[];for(let s=1;s<n;s++){let{index:n,value:l}=t(e[s]);o.push({end:n-1,start:i,value:r}),i=n,r=l}return o.push({end:1/0,start:i,value:r}),o}function o$(e){return e===oz}function o_(e,t){if(!o$(e))return t===e.k?e.v:t<e.k?o_(e.l,t):o_(e.r,t)}function oU(e,t,n="k"){if(o$(e))return[-1/0,void 0];if(Number(e[n])===t)return[e.k,e.v];if(Number(e[n])<t){let i=oU(e.r,t,n);return i[0]===-1/0?[e.k,e.v]:i}return oU(e.l,t,n)}function oG(e,t,n){return o$(e)?oQ(t,n,1):t===e.k?oX(e,{k:t,v:n}):t<e.k?o0(oJ(oX(e,{l:oG(e.l,t,n)}))):o0(oJ(oX(e,{r:oG(e.r,t,n)})))}function oq(e,t,n){if(o$(e))return[];let i=oU(e,t)[0];return oW(function e(t,n,i){if(o$(t))return[];let{k:r,l:o,r:s,v:l}=t,a=[];return r>n&&(a=a.concat(e(o,n,i))),r>=n&&r<=i&&a.push({k:r,v:l}),r<=i&&(a=a.concat(e(s,n,i))),a}(e,i,n),({k:e,v:t})=>({index:e,value:t}))}function oY(e){return o$(e)?[]:[...oY(e.l),{k:e.k,v:e.v},...oY(e.r)]}function oK(e){let{l:t,lvl:n,r:i}=e;if(i.lvl>=n-1&&t.lvl>=n-1)return e;if(n>i.lvl+1){if(oZ(t))return oJ(oX(e,{lvl:n-1}));if(!o$(t)&&!o$(t.r))return oX(t.r,{l:oX(t,{r:t.r.l}),lvl:n,r:oX(e,{l:t.r.r,lvl:n-1})});throw Error("Unexpected empty nodes")}if(oZ(e))return o0(oX(e,{lvl:n-1}));if(!o$(i)&&!o$(i.l)){let t=i.l,r=oZ(t)?i.lvl-1:i.lvl;return oX(t,{l:oX(e,{lvl:n-1,r:t.l}),lvl:t.lvl+1,r:o0(oX(i,{l:t.r,lvl:r}))})}throw Error("Unexpected empty nodes")}function oX(e,t){return oQ(void 0!==t.k?t.k:e.k,void 0!==t.v?t.v:e.v,void 0!==t.lvl?t.lvl:e.lvl,void 0!==t.l?t.l:e.l,void 0!==t.r?t.r:e.r)}function oZ(e){return o$(e)||e.lvl>e.r.lvl}function oQ(e,t,n,i=oz,r=oz){return{k:e,l:i,lvl:n,r,v:t}}function oJ(e){let{l:t}=e;return o$(t)||t.lvl!==e.lvl?e:oX(t,{r:oX(e,{l:t.r})})}function o0(e){let{lvl:t,r:n}=e;return o$(n)||o$(n.r)||n.lvl!==t||n.r.lvl!==t?e:oX(n,{l:oX(e,{r:n.l}),lvl:t+1})}function o1(e,t){return!!(e&&e.startIndex===t.startIndex&&e.endIndex===t.endIndex)}function o2(e,t){return!!(e&&e[0]===t[0]&&e[1]===t[1])}let o5=oT(()=>({recalcInProgress:oC(!1)}),[],{singleton:!0});function o3(e,t,n,i=0){let r=e.length-1;for(;i<=r;){let o=Math.floor((i+r)/2),s=n(e[o],t);if(0===s)return o;if(-1===s){if(r-i<2)return o-1;r=o-1}else{if(r===i)return o;i=o+1}}throw Error(`Failed binary finding record in array - ${e.join(",")}, searched for ${t}`)}function o4(e,t){return Math.round(e.getBoundingClientRect()[t])}function o6(e){return!o$(e.groupOffsetTree)}function o8({index:e},t){return t===e?0:t<e?-1:1}function o9({offset:e},t){return t===e?0:t<e?-1:1}function o7(e,t,n){if(0===t.length)return 0;let{index:i,offset:r,size:o}=t[o3(t,e,o8)],s=e-i,l=o*s+(s-1)*n+r;return l>0?l+n:l}function se(e,t){if(!o6(t))return e;let n=0;for(;t.groupIndices[n]<=e+n;)n++;return e+n}function st(e,t,n){if("u">typeof e.groupIndex)return t.groupIndices[e.groupIndex]+1;let i=se("LAST"===e.index?n:e.index,t);return Math.max(0,i,Math.min(n,i))}function sn(e,[t,n,i,r]){t.length>0&&i("received item sizes",t,0);let o=e.sizeTree,s=o,l=0;if(n.length>0&&o$(o)&&2===t.length){let e=t[0].size,i=t[1].size;s=n.reduce((t,n)=>oG(oG(t,n,e),n+1,i),s)}else[s,l]=function(e,t){let n=o$(e)?0:1/0;for(let i of t){let{endIndex:t,size:r,startIndex:o}=i;if(n=Math.min(n,o),o$(e)){e=oG(e,0,r);continue}let s=oq(e,o-1,t+1);if(s.some(function(e){let{endIndex:t,size:n,startIndex:i}=e;return e=>e.start===i&&(e.end===t||e.end===1/0)&&e.value===n}(i)))continue;let l=!1,a=!1;for(let{end:n,start:i,value:o}of s)l?(t>=i||r===o)&&(e=function e(t,n){if(o$(t))return oz;let{k:i,l:r,r:o}=t;if(n===i){if(o$(r))return o;if(o$(o))return r;let[e,n]=function e(t){return o$(t.r)?[t.k,t.v]:e(t.r)}(r);return oK(oX(t,{k:e,l:function e(t){return o$(t.r)?t.l:oK(oX(t,{r:e(t.r)}))}(r),v:n}))}return n<i?oK(oX(t,{l:e(r,n)})):oK(oX(t,{r:e(o,n)}))}(e,i)):(a=o!==r,l=!0),n>t&&t>=i&&o!==r&&(e=oG(e,t+1,o));a&&(e=oG(e,o,r))}return[e,n]}(s,t);if(s===o)return e;let{lastIndex:a,lastOffset:u,lastSize:c,offsetTree:h}=sr(e.offsetTree,l,s,r);return{groupIndices:n,groupOffsetTree:n.reduce((e,t)=>oG(e,t,o7(t,h,r)),oz),lastIndex:a,lastOffset:u,lastSize:c,offsetTree:h,sizeTree:s}}function si(e,t){let n=0,i=0;for(;n<e;)n+=t[i+1]-t[i]-1,i++;return i-(n!==e)}function sr(e,t,n,i){let r=e,o=0,s=0,l=0,a=0;if(0!==t){a=o3(r,t-1,o8),l=r[a].offset;let e=oU(n,t-1);o=e[0],s=e[1],r.length&&r[a].size===oU(n,t)[1]&&(a-=1),r=r.slice(0,a+1)}else r=[];for(let{start:e,value:a}of oq(n,t,1/0)){let t=e-o,n=t*s+l+t*i;r.push({index:e,offset:n,size:a}),o=e,l=n,s=a}return{lastIndex:o,lastOffset:l,lastSize:s,offsetTree:r}}function so(e){return{index:e.index,value:e}}let ss={offsetHeight:"height",offsetWidth:"width"},sl=oT(([{log:e},{recalcInProgress:t}])=>{let n=ok(),i=ok(),r=oA(i,0),o=ok(),s=ok(),l=oC(0),a=oC([]),u=oC(void 0),c=oC(void 0),h=oC(void 0),d=oC(void 0),f=oC((e,t)=>o4(e,ss[t])),p=oC(void 0),m=oC(0),g={groupIndices:[],groupOffsetTree:oz,lastIndex:0,lastOffset:0,lastSize:0,offsetTree:[],sizeTree:oz},v=oA(ob(n,oS(a,e,m),ox(sn,g),op()),g),b=oA(ob(a,op(),ox((e,t)=>({current:t,prev:e.current}),{current:[],prev:[]}),og(({prev:e})=>e)),[]);oc(ob(a,om(e=>e.length>0),oS(v,m),og(([e,t,n])=>{let i=e.reduce((e,i,r)=>oG(e,i,o7(i,t.offsetTree,n)||r),oz);return{...t,groupIndices:e,groupOffsetTree:i}})),v),oc(ob(i,oS(v),om(([e,{lastIndex:t}])=>e<t),og(([e,{lastIndex:t,lastSize:n}])=>[{endIndex:t,size:n,startIndex:e}])),n),oc(u,c);let x=oA(ob(u,og(e=>void 0===e)),!0);oc(ob(c,om(e=>void 0!==e&&o$(ou(v).sizeTree)),og(e=>{let t=ou(h),n=ou(a).length>0;return void 0!==t&&0!==t?n?[{endIndex:0,size:t,startIndex:0},{endIndex:1,size:e,startIndex:1}]:[]:[{endIndex:0,size:e,startIndex:0}]})),n),oc(ob(d,om(e=>void 0!==e&&e.length>0&&o$(ou(v).sizeTree)),og(e=>{let t=[],n=e[0],i=0;for(let r=1;r<e.length;r++){let o=e[r];o!==n&&(t.push({endIndex:r-1,size:n,startIndex:i}),n=o,i=r)}return t.push({endIndex:e.length-1,size:n,startIndex:i}),t})),n),oc(ob(a,oS(h,c),om(([,e,t])=>void 0!==e&&void 0!==t),og(([e,t,n])=>{let i=[];for(let r=0;r<e.length;r++){let o=e[r],s=e[r+1];i.push({startIndex:o,endIndex:o,size:t}),void 0!==s&&i.push({startIndex:o+1,endIndex:s-1,size:n})}return i})),n);let y=oM(ob(n,oS(v),ox(({sizes:e},[t,n])=>({changed:n!==e,sizes:n}),{changed:!1,sizes:g}),og(e=>e.changed)));ob(l,ox((e,t)=>({diff:e.prev-t,prev:t}),{diff:0,prev:0}),og(e=>e.diff))(1,e=>{let{groupIndices:n}=ou(v);if(e>0)t(0,!0),o(0,e+si(e,n));else if(e<0){let t=ou(b);t.length>0&&(e-=si(-e,t)),s(0,e)}}),ob(l,oS(e))(1,([e,t])=>{e<0&&t("`firstItemIndex` prop should not be set to less than zero. If you don't know the total count, just use a very high value",{firstItemIndex:l},3)});let w=oM(o);oc(ob(o,oS(v),og(([e,t])=>{let n=t.groupIndices.length>0,i=[],r=t.lastSize;if(n){let n=o_(t.sizeTree,0),o=0,s=0;for(;o<e;){let e=t.groupIndices[s],l=t.groupIndices.length===s+1?1/0:t.groupIndices[s+1]-e-1;i.push({endIndex:e,size:n,startIndex:e}),i.push({endIndex:e+1+l-1,size:r,startIndex:e+1}),s++,o+=l+1}let l=oY(t.sizeTree);return o!==e&&l.shift(),l.reduce((t,{k:n,v:i})=>{let r=t.ranges;return 0!==t.prevSize&&(r=[...t.ranges,{endIndex:n+e-1,size:t.prevSize,startIndex:t.prevIndex}]),{prevIndex:n+e,prevSize:i,ranges:r}},{prevIndex:e,prevSize:0,ranges:i}).ranges}return oY(t.sizeTree).reduce((t,{k:n,v:i})=>({prevIndex:n+e,prevSize:i,ranges:[...t.ranges,{endIndex:n+e-1,size:t.prevSize,startIndex:t.prevIndex}]}),{prevIndex:0,prevSize:r,ranges:[]}).ranges})),n);let S=oM(ob(s,oS(v,m),og(([e,{offsetTree:t},n])=>o7(-e,t,n))));return oc(ob(s,oS(v,m),og(([e,t,n])=>{if(t.groupIndices.length>0){if(o$(t.sizeTree))return t;let i=oz,r=ou(b),o=0,s=0,l=0;for(;o<-e;){l=r[s];let e=r[s+1]-l-1;s++,o+=e+1}return i=oY(t.sizeTree).reduce((t,{k:n,v:i})=>oG(t,Math.max(0,n+e),i),i),o!==-e&&(i=oG(i,0,o_(t.sizeTree,l)),i=oG(i,1,oU(t.sizeTree,-e+1)[1])),{...t,sizeTree:i,...sr(t.offsetTree,0,i,n)}}let i=oY(t.sizeTree).reduce((t,{k:n,v:i})=>oG(t,Math.max(0,n+e),i),oz);return{...t,sizeTree:i,...sr(t.offsetTree,0,i,n)}})),v),{beforeUnshiftWith:w,data:p,defaultItemSize:c,firstItemIndex:l,fixedItemSize:u,fixedGroupSize:h,gap:m,groupIndices:a,heightEstimates:d,itemSize:f,listRefresh:y,shiftWith:s,shiftWithOffset:S,sizeRanges:n,sizes:v,statefulTotalCount:r,totalCount:i,trackItemSizes:x,unshiftWith:o}},ol(oL,o5),{singleton:!0});function sa(e){return e.reduce((e,t)=>(e.groupIndices.push(e.totalCount),e.totalCount+=t+1,e),{groupIndices:[],totalCount:0})}let su=oT(([{groupIndices:e,sizes:t,totalCount:n},{headerHeight:i,scrollTop:r}])=>{let o=ok(),s=ok(),l=oM(ob(o,og(sa)));return oc(ob(l,og(e=>e.totalCount)),n),oc(ob(l,og(e=>e.groupIndices)),e),oc(ob(oI(r,t,i),om(([e,t])=>o6(t)),og(([e,t,n])=>oU(t.groupOffsetTree,Math.max(e-n,0),"v")[0]),op(),og(e=>[e])),s),{groupCounts:o,topItemsIndexes:s}},ol(sl,oH)),sc=oT(([{log:e}])=>{let t=oC(!1),n=oM(ob(t,om(e=>e),op()));return t(1,t=>{t&&ou(e)("props updated",{},0)}),{didMount:n,propsReady:t}},ol(oL),{singleton:!0}),sh="u">typeof document&&"scrollBehavior"in document.documentElement.style;function sd(e){let t="number"==typeof e?{index:e}:e;return t.align||(t.align="start"),t.behavior&&sh||(t.behavior="auto"),void 0===t.offset&&(t.offset=0),t}let sf=oT(([{gap:e,listRefresh:t,sizes:n,totalCount:i},{fixedFooterHeight:r,fixedHeaderHeight:o,footerHeight:s,headerHeight:l,scrollingInProgress:a,scrollTo:u,smoothScrollTargetReached:c,viewportHeight:h},{log:d}])=>{let f=ok(),p=ok(),m=oC(0),g=null,v=null,b=null;function x(){null!==g&&(g(),g=null),null!==b&&(b(),b=null),v&&(clearTimeout(v),v=null),a(0,!1)}return oc(ob(f,oS(n,h,i,m,l,s,d),oS(e,o,r),og(([[e,n,i,r,o,s,l,u],h,d,m])=>{let y=sd(e),{align:w,behavior:S,offset:C}=y,A=r-1,k=st(y,n,A),M=o7(k,n.offsetTree,h)+s;"end"===w?(M+=d+oU(n.sizeTree,k)[1]-i+m,k===A&&(M+=l)):"center"===w?M+=(d+oU(n.sizeTree,k)[1]-i+m)/2:M-=o,void 0!==C&&0!==C&&(M+=C);let T=t=>{x(),t?(u("retrying to scroll to",{location:e},0),f(0,e)):(p(0,!0),u("list did not change, scroll successful",{},0))};if(x(),"smooth"===S){let e=!1;b=t(1,t=>{e=e||t}),g=oh(c,()=>{T(e)})}else g=oh(ob(t,e=>{let t=setTimeout(()=>{e(!1)},150);return n=>{n&&(e(!0),clearTimeout(t))}}),T);return v=setTimeout(()=>{x()},1200),a(0,!0),u("scrolling from index to",{behavior:S,index:k,top:M},0),{behavior:S,top:M}})),u),{scrollTargetReached:p,scrollToIndex:f,topListHeight:m}},ol(sl,oH,oL),{singleton:!0});function sp(e,t){0===e?t():requestAnimationFrame(()=>{sp(e-1,t)})}function sm(e,t){return"number"==typeof e?e:"LAST"===e.index?t-1:e.index}let sg=oT(([{defaultItemSize:e,listRefresh:t,sizes:n},{scrollTop:i},{scrollTargetReached:r,scrollToIndex:o},{didMount:s}])=>{let l=oC(!0),a=oC(0),u=oC(!0);return oc(ob(s,oS(a),om(([e,t])=>0!==t),ov(!1)),l),oc(ob(s,oS(a),om(([e,t])=>0!==t),ov(!1)),u),ob(oI(t,s),oS(l,n,e,u),om(([[,e],t,{sizeTree:n},i,r])=>e&&(!o$(n)||or(i))&&!t&&!r),oS(a))(1,([,e])=>{oh(r,()=>{u(0,!0)}),sp(4,()=>{oh(i,()=>{l(0,!0)}),o(0,e)})}),{initialItemFinalLocationReached:u,initialTopMostItemIndex:a,scrolledToInitialItem:l}},ol(sl,oH,sf,sc),{singleton:!0});function sv(e,t){return 1.01>Math.abs(e-t)}let sb="down",sx={atBottom:!1,notAtBottomBecause:"NOT_SHOWING_LAST_ITEM",state:{offsetBottom:0,scrollHeight:0,scrollTop:0,viewportHeight:0}},sy=oT(([{footerHeight:e,headerHeight:t,scrollBy:n,scrollContainerState:i,scrollTop:r,viewportHeight:o}])=>{let s=oC(!1),l=oC(!0),a=ok(),u=ok(),c=oC(4),h=oC(0),d=oA(ob(oE(ob(oR(r),oy(1),ov(!0)),ob(oR(r),oy(1),ov(!1),od(100))),op()),!1),f=oA(ob(oE(ob(n,ov(!0)),ob(n,ov(!1),od(200))),op()),!1);oc(ob(oI(oR(r),oR(h)),og(([e,t])=>e<=t),op()),l),oc(ob(l,ow(50)),u);let p=oM(ob(oI(i,oR(o),oR(t),oR(e),oR(c)),ox((e,[{scrollHeight:t,scrollTop:n},i,r,o,s])=>{let l={scrollHeight:t,scrollTop:n,viewportHeight:i};if(n+i-t>-s){let t,i;return n>e.state.scrollTop?(t="SCROLLED_DOWN",i=e.state.scrollTop-n):(t="SIZE_DECREASED",i=e.state.scrollTop-n||e.scrollTopDelta),{atBottom:!0,atBottomBecause:t,scrollTopDelta:i,state:l}}return{atBottom:!1,notAtBottomBecause:l.scrollHeight>e.state.scrollHeight?"SIZE_INCREASED":i<e.state.viewportHeight?"VIEWPORT_HEIGHT_DECREASING":n<e.state.scrollTop?"SCROLLING_UPWARDS":"NOT_FULLY_SCROLLED_TO_LAST_ITEM_BOTTOM",state:l}},sx),op((e,t)=>void 0!==e&&e.atBottom===t.atBottom))),m=oA(ob(i,ox((e,{scrollHeight:t,scrollTop:n,viewportHeight:i})=>{if(!sv(e.scrollHeight,t)){let r=t-(n+i)<1;return e.scrollTop!==n&&r?{changed:!0,jump:e.scrollTop-n,scrollHeight:t,scrollTop:n}:{changed:!0,jump:0,scrollHeight:t,scrollTop:n}}return{changed:!1,jump:0,scrollHeight:t,scrollTop:n}},{changed:!1,jump:0,scrollHeight:0,scrollTop:0}),om(e=>e.changed),og(e=>e.jump)),0);oc(ob(p,og(e=>e.atBottom)),s),oc(ob(s,ow(50)),a);let g=oC(sb);oc(ob(i,og(({scrollTop:e})=>e),op(),ox((e,t)=>ou(f)?{direction:e.direction,prevScrollTop:t}:{direction:t<e.prevScrollTop?"up":sb,prevScrollTop:t},{direction:sb,prevScrollTop:0}),og(e=>e.direction)),g),oc(ob(i,ow(50),ov("none")),g);let v=oC(0);return oc(ob(d,om(e=>!e),ov(0)),v),oc(ob(r,ow(100),oS(d),om(([e,t])=>t),ox(([e,t],[n])=>[t,n],[0,0]),og(([e,t])=>t-e)),v),{atBottomState:p,atBottomStateChange:a,atBottomThreshold:c,atTopStateChange:u,atTopThreshold:h,isAtBottom:s,isAtTop:l,isScrolling:d,lastJumpDueToItemResize:m,scrollDirection:g,scrollVelocity:v}},ol(oH)),sw="bottom",sS="none";function sC(e,t,n){return"number"==typeof e?"up"===n&&"top"===t||n===sb&&t===sw?e:0:"up"===n?"top"===t?e.main:e.reverse:t===sw?e.main:e.reverse}function sA(e,t){return"number"==typeof e?e:e[t]??0}let sk=oT(([{deviation:e,fixedHeaderHeight:t,headerHeight:n,scrollTop:i,viewportHeight:r}])=>{let o=ok(),s=oC(0),l=oC(0),a=oC(0),u=oA(ob(oI(oR(i),oR(r),oR(n),oR(o,o2),oR(a),oR(s),oR(t),oR(e),oR(l)),og(([e,t,n,[i,r],o,s,l,a,u])=>{let c=e-a,h=Math.max(n-c,0),d=sS,f=sA(u,"top"),p=sA(u,sw);return i-=a,i+=n+l,r+=n+l,i>e+(s+l)-f&&(d="up"),(r-=a)<e-h+t+p&&(d=sb),d!==sS?[Math.max(c-n-sC(o,"top",d)-f,0),c-h-l+t+sC(o,sw,d)+p]:null}),om(e=>null!==e),op(o2)),[0,0]);return{increaseViewportBy:l,listBoundary:o,overscan:a,topListHeight:s,visibleRange:u}},ol(oH),{singleton:!0}),sM={bottom:0,firstItemIndex:0,items:[],offsetBottom:0,offsetTop:0,top:0,topItems:[],topListHeight:0,totalCount:0};function sT(e,t,n,i,r,o){let{lastIndex:s,lastOffset:l,lastSize:a}=r,u=0,c=0;if(e.length>0){u=e[0].offset;let t=e[e.length-1];c=t.offset+t.size}let h=n-s,d=u,f=l+h*a+(h-1)*i-c;return{bottom:c,firstItemIndex:o,items:sI(e,r,o),offsetBottom:f,offsetTop:u,top:d,topItems:sI(t,r,o),topListHeight:t.reduce((e,t)=>t.size+e,0),totalCount:n}}function sD(e,t,n,i,r,o){let s=0;if(n.groupIndices.length>0)for(let t of n.groupIndices){if(t-s>=e)break;s++}let l=e+s,a=sm(t,l);return sT(Array.from({length:l}).map((e,t)=>({data:o[t+a],index:t+a,offset:0,size:0})),[],l,r,n,i)}function sI(e,t,n){if(0===e.length)return[];if(!o6(t))return e.map(e=>({...e,index:e.index+n,originalIndex:e.index}));let i=e[0].index,r=e[e.length-1].index,o=[],s=oq(t.groupOffsetTree,i,r),l,a=0;for(let i of e){let e;(!l||l.end<i.index)&&(l=s.shift(),a=t.groupIndices.indexOf(l.start)),e=i.index===l.start?{index:a,type:"group"}:{groupIndex:a,index:i.index-(a+1)+n},o.push({...e,data:i.data,offset:i.offset,originalIndex:i.index,size:i.size})}return o}function sR(e,t){return void 0===e?0:"number"==typeof e?e:e[t]??0}let sE=oT(([{data:e,firstItemIndex:t,gap:n,sizes:i,totalCount:r},o,{listBoundary:s,topListHeight:l,visibleRange:a},{initialTopMostItemIndex:u,scrolledToInitialItem:c},{topListHeight:h},d,{didMount:f},{recalcInProgress:p}])=>{let m=oC([]),g=oC(0),v=ok(),b=oC(0);oc(o.topItemsIndexes,m);let x=oA(ob(oI(f,p,oR(a,o2),oR(r),oR(i),oR(u),c,oR(m),oR(t),oR(n),oR(b),e),om(([e,t,,n,,,,,,,,i])=>{let r=void 0!==i&&i.length!==n;return e&&!t&&!r}),og(([,,[e,t],n,i,r,o,s,l,a,u,c])=>{var h;let{offsetTree:d,sizeTree:f}=i,p=ou(g);if(0===n)return{...sM,totalCount:n};if(0===e&&0===t)return 0===p?{...sM,totalCount:n}:sD(p,r,i,l,a,c||[]);if(o$(f))return p>0?null:sT(function(e,t,n){if(o6(t)){let i=se(e,t);return[{index:oU(t.groupOffsetTree,i)[0],offset:0,size:0},{data:n?.[0],index:i,offset:0,size:0}]}return[{data:n?.[0],index:e,offset:0,size:0}]}(sm(r,n),i,c),[],n,a,i,l);let m=[];if(s.length>0){let e=s[0],t=s[s.length-1],n=0;for(let i of oq(f,e,t)){let r=i.value,o=Math.max(i.start,e),s=Math.min(i.end,t);for(let e=o;e<=s;e++)m.push({data:c?.[e],index:e,offset:n,size:r}),n+=r}}if(!o)return sT([],m,n,a,i,l);let v=s.length>0?s[s.length-1]+1:0,b=function(e,t,n,i=0){let r,o;return i>0&&(t=Math.max(t,e[o3(e,i,o8)].offset)),oW((r=o3(e,t,o9),o=o3(e,n,o9,r),e.slice(r,o+1)),so)}(d,e,t,v);if(0===b.length)return null;let x=n-1,y=((n=>{for(let i of b){let r=i.value,o=r.offset,s=i.start,l=r.size;if(r.offset<e){let t=(s+=Math.floor((e-r.offset+a)/(l+a)))-i.start;o+=t*l+t*a}s<v&&(o+=(v-s)*l,s=v);let u=Math.min(i.end,x);for(let e=s;e<=u&&!(o>=t);e++)n.push({data:c?.[e],index:e,offset:o,size:l}),o+=l+a}})(h=[]),h),w=sR(u,"top"),S=sR(u,sw);if(y.length>0&&(w>0||S>0)){let e=y[0],t=y[y.length-1];if(w>0&&e.index>v){let t=Math.min(w,e.index-v),n=[],i=e.offset;for(let r=e.index-1;r>=e.index-t;r--){let t=oq(f,r,r)[0]?.value??e.size;i-=t+a,n.unshift({data:c?.[r],index:r,offset:i,size:t})}y.unshift(...n)}if(S>0&&t.index<x){let e=Math.min(S,x-t.index),n=t.offset+t.size+a;for(let i=t.index+1;i<=t.index+e;i++){let e=oq(f,i,i)[0]?.value??t.size;y.push({data:c?.[i],index:i,offset:n,size:e}),n+=e+a}}}return sT(y,m,n,a,i,l)}),om(e=>null!==e),op()),sM);oc(ob(e,om(or),og(e=>e?.length)),r),oc(ob(x,og(e=>e.topListHeight)),h),oc(h,l),oc(ob(x,og(e=>[e.top,e.bottom])),s),oc(ob(x,og(e=>e.items)),v);let y=oM(ob(x,om(({items:e})=>e.length>0),oS(r,e),om(([{items:e},t])=>e[e.length-1].originalIndex===t-1),og(([,e,t])=>[e-1,t]),op(o2),og(([e])=>e))),w=oM(ob(x,ow(200),om(({items:e,topItems:t})=>e.length>0&&e[0].originalIndex===t.length),og(({items:e})=>e[0].index),op())),S=oM(ob(x,om(({items:e})=>e.length>0),og(({items:e})=>{let t=0,n=e.length-1;for(;"group"===e[t].type&&t<n;)t++;for(;"group"===e[n].type&&n>t;)n--;return{endIndex:e[n].index,startIndex:e[t].index}}),op(o1)));return{endReached:y,initialItemCount:g,itemsRendered:v,listState:x,minOverscanItemCount:b,rangeChanged:S,startReached:w,topItemsIndexes:m,...d}},ol(sl,su,sk,sg,sf,sy,sc,o5),{singleton:!0}),sO=oT(([{fixedFooterHeight:e,fixedHeaderHeight:t,footerHeight:n,headerHeight:i},{listState:r}])=>{let o=ok(),s=oA(ob(oI(n,e,i,t,r),og(([e,t,n,i,r])=>e+t+n+i+r.offsetBottom+r.bottom)),0);return oc(oR(s),o),{totalListHeight:s,totalListHeightChanged:o}},ol(oH,sE),{singleton:!0}),sP=oT(([{viewportHeight:e},{totalListHeight:t}])=>{let n=oC(!1),i=oA(ob(oI(n,e,t),om(([e])=>e),og(([,e,t])=>Math.max(0,e-t)),ow(0),op()),0);return{alignToBottom:n,paddingTopAddition:i}},ol(oH,sO),{singleton:!0}),sL=oT(()=>({context:oC(null)})),sj=({itemBottom:e,itemTop:t,locationParams:{align:n,behavior:i,...r},viewportBottom:o,viewportTop:s})=>t<s?{...r,align:n??"start",...void 0!==i?{behavior:i}:{}}:e>o?{...r,align:n??"end",...void 0!==i?{behavior:i}:{}}:null,sB=oT(([{gap:e,sizes:t,totalCount:n},{fixedFooterHeight:i,fixedHeaderHeight:r,headerHeight:o,scrollingInProgress:s,scrollTop:l,viewportHeight:a},{scrollToIndex:u}])=>{let c=ok();return oc(ob(c,oS(t,a,n,o,r,i,l),oS(e),og(([[e,t,n,i,r,o,l,a],u])=>{let{calculateViewLocation:c=sj,done:h,...d}=e,f=st(e,t,i-1),p=o7(f,t.offsetTree,u)+r+o,m=c({itemBottom:p+oU(t.sizeTree,f)[1],itemTop:p,locationParams:d,viewportBottom:a+n-l,viewportTop:a+o});return null!==m?h&&oh(ob(s,om(e=>!e),oy(ou(s)?1:2)),h):h?.(),m}),om(e=>null!==e)),u),{scrollIntoView:c}},ol(sl,oH,sf,sE,oL),{singleton:!0});function sF(e){return!1!==e&&("smooth"===e?"smooth":"auto")}let sN=oT(([{listRefresh:e,totalCount:t,fixedItemSize:n,data:i},{atBottomState:r,isAtBottom:o},{scrollToIndex:s},{scrolledToInitialItem:l},{didMount:a,propsReady:u},{log:c},{scrollingInProgress:h},{context:d},{scrollIntoView:f}])=>{let p=oC(!1),m=ok(),g=null;function v(e){s(0,{align:"end",behavior:e,index:"LAST"})}function b(e){setTimeout(oh(r,t=>{e&&!t.atBottom&&"SIZE_INCREASED"===t.notAtBottomBecause&&null===g&&(ou(c)("scrolling to bottom due to increased size",{},0),v("auto"))}),100)}ob(oI(ob(oR(t),oy(1)),a),oS(oR(p),o,l,h),og(([[e,t],n,i,r,o])=>{let s,l=t&&r,a="auto";return l&&(s=i||o,a="function"==typeof n?sF(n(s)):s&&sF(n),l=l&&!1!==a),{followOutputBehavior:a,shouldFollow:l,totalCount:e}}),om(({shouldFollow:e})=>e))(1,({followOutputBehavior:t,totalCount:i})=>{null!==g&&(g(),g=null),void 0!==ou(n)?requestAnimationFrame(()=>{ou(c)("following output to ",{totalCount:i},0),v(t)}):g=oh(e,()=>{ou(c)("following output to ",{totalCount:i},0),v(t),g=null})}),ob(oI(oR(p),t,u),om(([e,,t])=>!1!==e&&t),ox(({value:e},[,t])=>({refreshed:e===t,value:t}),{refreshed:!1,value:0}),om(({refreshed:e})=>e),oS(p,t))(1,([,e])=>{ou(l)&&b(!1!==e)}),m(1,()=>{b(!1!==ou(p))}),oI(oR(p),r)(1,([e,t])=>{!1===e||t.atBottom||"VIEWPORT_HEIGHT_DECREASING"!==t.notAtBottomBecause||v("auto")});let x=oC(null),y=ok();return oc(oE(ob(oR(i),og(e=>e?.length??0)),ob(oR(t))),y),ob(oI(ob(y,oy(1)),a),oS(oR(x),l,h,d),og(([[e,t],n,i,r,o])=>t&&i&&n?.({context:o,totalCount:e,scrollingInProgress:r})),om(e=>!!e),ow(0))(1,t=>{null!==g&&(g(),g=null),void 0!==ou(n)?requestAnimationFrame(()=>{ou(c)("scrolling into view",{}),f(0,t)}):g=oh(e,()=>{ou(c)("scrolling into view",{}),f(0,t),g=null})}),{autoscrollToBottom:m,followOutput:p,scrollIntoViewOnChange:x}},ol(sl,sy,sf,sg,sc,oL,oH,sL,sB)),sV=oT(([{data:e,firstItemIndex:t,gap:n,sizes:i},{initialTopMostItemIndex:r},{initialItemCount:o,listState:s},{didMount:l}])=>(oc(ob(l,oS(o),om(([,e])=>0!==e),oS(r,i,t,n,e),og(([[,e],t,n,i,r,o=[]])=>sD(e,t,n,i,r,o))),s),{}),ol(sl,sg,sE,sc),{singleton:!0}),sH=oT(([{didMount:e},{scrollTo:t},{listState:n}])=>{let i=oC(0);return ob(e,oS(i),om(([,e])=>0!==e),og(([,e])=>({top:e})))(1,e=>{oh(ob(n,oy(1),om(e=>e.items.length>1)),()=>{requestAnimationFrame(()=>{t(0,e)})})}),{initialScrollTop:i}},ol(sc,oH,sE),{singleton:!0}),sz=oT(([{scrollVelocity:e}])=>{let t=oC(!1),n=ok(),i=oC(!1);return oc(ob(e,oS(i,t,n),om(([e,t])=>!1!==t&&void 0!==t),og(([e,t,n,i])=>{let{enter:r,exit:o}=t;if(n){if(o(e,i))return!1}else if(r(e,i))return!0;return n}),op()),t),ob(oI(t,e,n),oS(i))(1,([[e,t,n],i])=>{e&&!1!==i&&void 0!==i&&i.change&&i.change(t,n)}),{isSeeking:t,scrollSeekConfiguration:i,scrollSeekRangeChanged:n,scrollVelocity:e}},ol(sy),{singleton:!0}),sW=oT(([{scrollContainerState:e,scrollTo:t}])=>{let n=ok(),i=ok(),r=ok(),o=oC(!1),s=oC(void 0);return oc(ob(oI(n,i),og(([{scrollTop:e,viewportHeight:t},{offsetTop:n,listHeight:i}])=>({scrollHeight:i,scrollTop:Math.max(0,e-n),viewportHeight:t}))),e),oc(ob(t,oS(i),og(([e,{offsetTop:t}])=>({...e,top:e.top+t}))),r),{customScrollParent:s,useWindowScroll:o,windowScrollContainerState:n,windowScrollTo:r,windowViewportRect:i}},ol(oH)),s$=oT(([{sizeRanges:e,sizes:t},{headerHeight:n,scrollTop:i},{initialTopMostItemIndex:r},{didMount:o},{useWindowScroll:s,windowScrollContainerState:l,windowViewportRect:a}])=>{let u=ok(),c=oC(void 0),h=oC(null),d=oC(null);return oc(l,h),oc(a,d),ob(u,oS(t,i,s,h,d,n))(1,([e,t,n,i,r,o,s])=>{let l=oY(t.sizeTree).map(({k:e,v:t},n,i)=>{let r=i[n+1];return{endIndex:void 0!==r?r.k-1:1/0,size:t,startIndex:e}});i&&null!==r&&null!==o&&(n=r.scrollTop-o.offsetTop),e({ranges:l,scrollTop:n-=s})}),oc(ob(c,om(or),og(s_)),r),oc(ob(o,oS(c),om(([,e])=>void 0!==e),op(),og(([,e])=>e.ranges)),e),{getState:u,restoreStateFrom:c}},ol(sl,oH,sg,sc,sW));function s_(e){return{align:"start",index:0,offset:e.scrollTop}}let sU=oT(([{topItemsIndexes:e}])=>{let t=oC(0);return oc(ob(t,om(e=>e>=0),og(e=>Array.from({length:e}).map((e,t)=>t))),e),{topItemCount:t}},ol(sE));function sG(e){let t=!1,n;return()=>(t||(t=!0,n=e()),n)}let sq=sG(()=>/iP(ad|od|hone)/i.test(navigator.userAgent)&&/WebKit/i.test(navigator.userAgent)),sY=oT(([{deviation:e,scrollBy:t,scrollingInProgress:n,scrollTop:i},{isAtBottom:r,isScrolling:o,lastJumpDueToItemResize:s,scrollDirection:l},{listState:a},{beforeUnshiftWith:u,gap:c,shiftWithOffset:h,sizes:d},{log:f},{recalcInProgress:p}])=>{let m=oM(ob(a,oS(s),ox(([,e,t,n],[{bottom:i,items:r,offsetBottom:o,totalCount:s},l])=>{let a=i+o,u=0;return t===s&&e.length>0&&r.length>0&&(0===r[0].originalIndex&&0===e[0].originalIndex||0!=(u=a-n)&&(u+=l)),[u,r,s,a]},[0,[],0,0]),om(([e])=>0!==e),oS(i,l,n,r,f,p),om(([,e,t,n,,,i])=>!i&&!n&&0!==e&&"up"===t),og(([[e],,,,,t])=>(t("Upward scrolling compensation",{amount:e},0),e))));function g(n){n>0?(t(0,{behavior:"auto",top:-n}),e(0,0)):(e(0,0),t(0,{behavior:"auto",top:-n}))}return ob(m,oS(e,o))(1,([t,n,i])=>{i&&sq()?e(0,n-t):g(-t)}),ob(oI(oA(o,!1),e,p),om(([e,t,n])=>!e&&!n&&0!==t),og(([e,t])=>t),ow(1))(1,g),oc(ob(h,og(e=>({top:-e}))),t),ob(u,oS(d,c),og(([e,{groupIndices:t,lastSize:n,sizeTree:i},r])=>{if(0===t.length)return e*(n+r);let o=0,s=o_(i,0),l=0,a=0;for(;l<e;){l++,o+=s;let i=t.length===a+1?1/0:t[a+1]-t[a]-1;l+i>e&&(o-=s,i=e-l+1),l+=i,o+=i*(n+r),a++}return o}))(1,n=>{e(0,n),requestAnimationFrame(()=>{t(0,{top:n}),requestAnimationFrame(()=>{e(0,0),p(0,!1)})})}),{deviation:e}},ol(oH,sy,sE,sl,oL,o5)),sK=oT(([e,t,n,i,r,o,s,l,a,u,c])=>({...e,...t,...n,...i,...r,...o,...s,...l,...a,...u,...c}),ol(sk,sV,sc,sz,sO,sH,sP,sW,sB,oL,sL)),sX=oT(([{data:e,defaultItemSize:t,firstItemIndex:n,fixedItemSize:i,fixedGroupSize:r,gap:o,groupIndices:s,heightEstimates:l,itemSize:a,sizeRanges:u,sizes:c,statefulTotalCount:h,totalCount:d,trackItemSizes:f},{initialItemFinalLocationReached:p,initialTopMostItemIndex:m,scrolledToInitialItem:g},v,b,x,y,{scrollToIndex:w},S,{topItemCount:C},{groupCounts:A},k])=>{let{listState:M,minOverscanItemCount:T,topItemsIndexes:D,rangeChanged:I,...R}=y;return oc(I,k.scrollSeekRangeChanged),oc(ob(k.windowViewportRect,og(e=>e.visibleHeight)),v.viewportHeight),{data:e,defaultItemHeight:t,firstItemIndex:n,fixedItemHeight:i,fixedGroupHeight:r,gap:o,groupCounts:A,heightEstimates:l,initialItemFinalLocationReached:p,initialTopMostItemIndex:m,scrolledToInitialItem:g,sizeRanges:u,topItemCount:C,topItemsIndexes:D,totalCount:d,...x,groupIndices:s,itemSize:a,listState:M,minOverscanItemCount:T,scrollToIndex:w,statefulTotalCount:h,trackItemSizes:f,rangeChanged:I,...R,...k,...v,sizes:c,...b}},ol(sl,sg,oH,s$,sN,sE,sf,sY,sU,su,sK)),sZ="u">typeof document?E().useLayoutEffect:E().useEffect;function sQ(e,t,n){let i=Object.keys(t.required||{}),r=Object.keys(t.optional||{}),o=Object.keys(t.methods||{}),s=Object.keys(t.events||{}),l=E().createContext({});function a(e,n){for(let r of(void 0!==e.propsReady&&(0,e.propsReady)(0,!1),i))(0,e[t.required[r]])(0,n[r]);for(let i of r)i in n&&(0,e[t.optional[i]])(0,n[i]);void 0!==e.propsReady&&(0,e.propsReady)(0,!0)}function u(e){return s.reduce((n,i)=>{var r;let o,s,l;return n[i]=(r=e[t.events[i]],l=()=>o?.(),function(e,t){switch(e){case 1:return t?s===t?void 0:(l(),s=t,o=r(1,t)):(l(),oo);case 2:l(),s=null;return}}),n},{})}return{Component:E().forwardRef(function(c,h){var d;let{children:f,...p}=c,[m]=E().useState(()=>{var t;let n,i;return n=new Map,a(t=(i=({constructor:e,dependencies:t,id:r,singleton:o})=>{if(o&&n.has(r))return n.get(r);let s=e(t.map(e=>i(e)));return o&&n.set(r,s),s})(e),p),t}),[g]=E().useState(()=>u(m));return sZ(()=>{for(let e of s)e in p&&(0,g[e])(1,p[e]);return()=>{Object.values(g).map(oa)}},[p,g,m]),sZ(()=>{a(m,p)}),E().useImperativeHandle(h,(d=o.reduce((e,n)=>(e[n]=e=>{(0,m[t.methods[n]])(0,e)},e),{}),()=>d)),(0,I.jsx)(l.Provider,{value:m,children:void 0!==n?(0,I.jsx)(n,{...function(e,t){let n={},i={},r=0,o=e.length;for(;r<o;)i[e[r]]=1,r+=1;for(let e in t)Object.hasOwn(i,e)||(n[e]=t[e]);return n}([...i,...r,...s],p),children:f}):f})}),useEmitter:(e,t)=>{let n=E().useContext(l)[e];sZ(()=>n(1,t),[t,n])},useEmitterValue:parseInt(E().version)>=18?e=>{let t=E().useContext(l)[e],n=E().useCallback(e=>t(1,e),[t]);return E().useSyncExternalStore(n,()=>ou(t),()=>ou(t))}:e=>{let t=E().useContext(l)[e],[n,i]=E().useState(()=>ou(t));return sZ(()=>t(1,e=>{e!==n&&i(()=>e)}),[t,n]),n},usePublisher:e=>{let t=E().useContext(l);return E().useCallback(n=>{(0,t[e])(0,n)},[t,e])}}}let sJ=E().createContext(void 0),s0=E().createContext(void 0),s1="-webkit-sticky",s2="sticky",s5=sG(()=>{if(typeof document>"u")return s2;let e=document.createElement("div");return e.style.position=s1,e.style.position===s1?s1:s2}),s3="u">typeof document?E().useLayoutEffect:E().useEffect;function s4(e){return"self"in e}function s6(e,t,n,i=oo,r,o){let s=E().useRef(null),l=E().useRef(null),a=E().useRef(null),u=E().useCallback(n=>{let i,r,s,u=n.target;if("body"in u||s4(u)){let e=s4(u)?u:u.defaultView;s=!0===o?e.scrollX:e.scrollY,i=!0===o?e.document.documentElement.scrollWidth:e.document.documentElement.scrollHeight,r=!0===o?e.innerWidth:e.innerHeight}else s=!0===o?u.scrollLeft:u.scrollTop,i=!0===o?u.scrollWidth:u.scrollHeight,r=!0===o?u.offsetWidth:u.offsetHeight;let c=()=>{e({scrollHeight:i,scrollTop:Math.max(s,0),viewportHeight:r})};!0===n.suppressFlushSync?c():eX().flushSync(c),null!==l.current&&(s===l.current||s<=0||s===i-r)&&(l.current=null,t(!0),a.current&&(clearTimeout(a.current),a.current=null))},[e,t,o]);return E().useEffect(()=>{let e=r||s.current;return i(r||s.current),u({suppressFlushSync:!0,target:e}),e.addEventListener("scroll",u,{passive:!0}),()=>{i(null),e.removeEventListener("scroll",u)}},[s,u,n,i,r]),{scrollByCallback:function(e){!0===o&&(e={...void 0!==e.behavior?{behavior:e.behavior}:{},...void 0!==e.top?{left:e.top}:{}}),s.current.scrollBy(e)},scrollerRef:s,scrollToCallback:function(n){let i,r,u,c=s.current;if(!c||(!0===o?"offsetWidth"in c&&0===c.offsetWidth:"offsetHeight"in c&&0===c.offsetHeight))return;let h="smooth"===n.behavior;s4(c)?(r=Math.max(o4(c.document.documentElement,!0===o?"width":"height"),!0===o?c.document.documentElement.scrollWidth:c.document.documentElement.scrollHeight),i=!0===o?c.innerWidth:c.innerHeight,u=!0===o?window.scrollX:window.scrollY):(r=c[!0===o?"scrollWidth":"scrollHeight"],i=o4(c,!0===o?"width":"height"),u=c[!0===o?"scrollLeft":"scrollTop"]);let d=r-i;if(n.top=Math.ceil(Math.max(Math.min(d,n.top),0)),sv(i,r)||n.top===u){e({scrollHeight:r,scrollTop:u,viewportHeight:i}),h&&t(!0);return}h?(l.current=n.top,a.current&&clearTimeout(a.current),a.current=setTimeout(()=>{a.current=null,l.current=null,t(!0)},1e3)):l.current=null,!0===o&&(n={...void 0!==n.behavior?{behavior:n.behavior}:{},left:n.top}),c.scrollTo(n)}}}function s8(e){return e}let s9=oT(()=>{let e=oC(e=>`Item ${e}`),t=oC(e=>`Group ${e}`),n=oC({}),i=oC(s8),r=oC("div"),o=oC(oo),s=(e,t=null)=>oA(ob(n,og(t=>t[e]),op()),t);return{components:n,computeItemKey:i,EmptyPlaceholder:s("EmptyPlaceholder"),FooterComponent:s("Footer"),GroupComponent:s("Group","div"),groupContent:t,HeaderComponent:s("Header"),HeaderFooterTag:r,ItemComponent:s("Item","div"),itemContent:e,ListComponent:s("List","div"),ScrollerComponent:s("Scroller","div"),scrollerRef:o,ScrollSeekPlaceholder:s("ScrollSeekPlaceholder"),TopItemListComponent:s("TopItemList")}}),s7=oT(([e,t])=>({...e,...t}),ol(sX,s9)),le=({height:e})=>(0,I.jsx)("div",{style:{height:e}}),lt={overflowAnchor:"none",position:s5(),zIndex:1},ln={overflowAnchor:"none"},li={...ln,display:"inline-block",height:"100%"},lr=E().memo(function({showTopList:e=!1}){let t=lw("listState"),n=lS("sizeRanges"),i=lw("useWindowScroll"),r=lw("customScrollParent"),o=lS("windowScrollContainerState"),s=lS("scrollContainerState"),l=lw("itemContent"),a=lw("context"),u=lw("groupContent"),c=lw("trackItemSizes"),h=lw("itemSize"),d=lw("log"),f=lS("gap"),p=lw("horizontalDirection"),{callbackRef:m}=oF(n,h,c,e?oo:r||i?o:s,d,f,r,p,lw("skipAnimationFrameInResizeObserver")),[g,v]=E().useState(0);ly("deviation",e=>{g!==e&&v(e)});let b=lw("EmptyPlaceholder"),x=lw("ScrollSeekPlaceholder")??le,y=lw("ListComponent"),w=lw("ItemComponent"),S=lw("GroupComponent"),C=lw("computeItemKey"),A=lw("isSeeking"),k=lw("groupIndices").length>0,M=lw("alignToBottom"),T=lw("initialItemFinalLocationReached"),D=e?{}:{boxSizing:"border-box",...p?{display:"inline-block",height:"100%",marginLeft:0!==g?g:M?"auto":0,paddingLeft:t.offsetTop,paddingRight:t.offsetBottom,whiteSpace:"nowrap"}:{marginTop:0!==g?g:M?"auto":0,paddingBottom:t.offsetBottom,paddingTop:t.offsetTop},...T?{}:{visibility:"hidden"}};return e||0!==t.totalCount||null==b?(0,I.jsx)(y,{...lc(y,a),"data-testid":e?"virtuoso-top-item-list":"virtuoso-item-list",ref:m,style:D,children:(e?t.topItems:t.items).map(e=>{let n=e.originalIndex,i=C(n+t.firstItemIndex,e.data,a);return A?(0,R.createElement)(x,{...lc(x,a),height:e.size,index:e.index,key:i,type:e.type||"item",..."group"===e.type?{}:{groupIndex:e.groupIndex}}):"group"===e.type?(0,R.createElement)(S,{...lc(S,a),"data-index":n,"data-item-index":e.index,"data-known-size":e.size,key:i,style:lt},u(e.index,a)):(0,R.createElement)(w,{...lc(w,a),...lh(w,e.data),"data-index":n,"data-item-group-index":e.groupIndex,"data-item-index":e.index,"data-known-size":e.size,key:i,style:p?li:ln},k?l(e.index,e.groupIndex,e.data,a):l(e.index,e.data,a))})}):(0,I.jsx)(b,{...lc(b,a)})}),lo={height:"100%",outline:"none",overflowY:"auto",position:"relative",WebkitOverflowScrolling:"touch"},ls={outline:"none",overflowX:"auto",position:"relative"},ll=e=>({height:"100%",position:"absolute",top:0,width:"100%",...e?{display:"flex",flexDirection:"column"}:void 0}),la=(e,t,n=0)=>({...ll(e),position:t?"relative":"absolute",top:t?-n:0}),lu={position:s5(),top:0,width:"100%",zIndex:1};function lc(e,t){if("string"!=typeof e)return{context:t}}function lh(e,t){return{item:"string"==typeof e?void 0:t}}let ld=E().memo(function(){let e=lw("HeaderComponent"),t=lS("headerHeight"),n=lw("HeaderFooterTag"),i=oj(E().useMemo(()=>e=>{t(o4(e,"height"))},[t]),!0,lw("skipAnimationFrameInResizeObserver")),r=lw("context");return null!=e?(0,I.jsx)(n,{ref:i,children:(0,I.jsx)(e,{...lc(e,r)})}):null}),lf=E().memo(function(){let e=lw("FooterComponent"),t=lS("footerHeight"),n=lw("HeaderFooterTag"),i=oj(E().useMemo(()=>e=>{t(o4(e,"height"))},[t]),!0,lw("skipAnimationFrameInResizeObserver")),r=lw("context");return null!=e?(0,I.jsx)(n,{ref:i,children:(0,I.jsx)(e,{...lc(e,r)})}):null});function lp({useEmitter:e,useEmitterValue:t,usePublisher:n}){return E().memo(function({children:i,style:r,context:o,...s}){let l=n("scrollContainerState"),a=t("ScrollerComponent"),u=n("smoothScrollTargetReached"),c=t("scrollerRef"),h=t("horizontalDirection")||!1,{scrollByCallback:d,scrollerRef:f,scrollToCallback:p}=s6(l,u,a,c,void 0,h);return e("scrollTo",p),e("scrollBy",d),(0,I.jsx)(a,{"data-testid":"virtuoso-scroller","data-virtuoso-scroller":!0,ref:f,style:{...h?ls:lo,...r},tabIndex:0,...s,...lc(a,o),children:i})})}function lm({useEmitter:e,useEmitterValue:t,usePublisher:n}){return E().memo(function({children:i,style:r,context:o,...s}){let l=n("windowScrollContainerState"),a=t("ScrollerComponent"),u=n("smoothScrollTargetReached"),c=t("totalListHeight"),h=t("deviation"),d=t("customScrollParent"),f=E().useRef(null),{scrollByCallback:p,scrollerRef:m,scrollToCallback:g}=s6(l,u,a,t("scrollerRef"),d);return s3(()=>(m.current=d||f.current?.ownerDocument.defaultView,()=>{m.current=null}),[m,d]),e("windowScrollTo",g),e("scrollBy",p),(0,I.jsx)(a,{ref:f,"data-virtuoso-scroller":!0,style:{position:"relative",...r,...0!==c?{height:c+h}:void 0},...s,...lc(a,o),children:i})})}let lg=({children:e})=>{let t=E().useContext(sJ),n=lS("viewportHeight"),i=lS("fixedItemHeight"),r=lw("alignToBottom"),o=lw("horizontalDirection"),s=oj(E().useMemo(()=>oi(n,e=>o4(e,o?"width":"height")),[n,o]),!0,lw("skipAnimationFrameInResizeObserver"));return E().useEffect(()=>{t&&(n(t.viewportHeight),i(t.itemHeight))},[t,n,i]),(0,I.jsx)("div",{"data-viewport-type":"element",ref:s,style:ll(r),children:e})},lv=({children:e})=>{let t=E().useContext(sJ),n=lS("windowViewportRect"),i=lS("fixedItemHeight"),r=lw("customScrollParent"),o=lw("useWindowScroll"),s=lw("topListHeight"),l=oV(n,r,lw("skipAnimationFrameInResizeObserver")),a=lw("alignToBottom");return E().useEffect(()=>{t&&(i(t.itemHeight),n({listHeight:0,offsetTop:0,visibleHeight:t.viewportHeight,visibleWidth:100}))},[t,n,i]),(0,I.jsx)("div",{"data-viewport-type":"window",ref:l,style:la(a,o,s),children:e})},lb=({children:e})=>{let t=lw("TopItemListComponent")??"div",n=lw("headerHeight"),i={...lu,marginTop:`${n}px`},r=lw("context");return(0,I.jsx)(t,{style:i,...lc(t,r),children:e})},{Component:lx,useEmitter:ly,useEmitterValue:lw,usePublisher:lS}=sQ(s7,{optional:{restoreStateFrom:"restoreStateFrom",context:"context",followOutput:"followOutput",scrollIntoViewOnChange:"scrollIntoViewOnChange",itemContent:"itemContent",groupContent:"groupContent",overscan:"overscan",increaseViewportBy:"increaseViewportBy",minOverscanItemCount:"minOverscanItemCount",totalCount:"totalCount",groupCounts:"groupCounts",topItemCount:"topItemCount",firstItemIndex:"firstItemIndex",initialTopMostItemIndex:"initialTopMostItemIndex",components:"components",atBottomThreshold:"atBottomThreshold",atTopThreshold:"atTopThreshold",computeItemKey:"computeItemKey",defaultItemHeight:"defaultItemHeight",fixedGroupHeight:"fixedGroupHeight",fixedItemHeight:"fixedItemHeight",heightEstimates:"heightEstimates",itemSize:"itemSize",scrollSeekConfiguration:"scrollSeekConfiguration",headerFooterTag:"HeaderFooterTag",data:"data",initialItemCount:"initialItemCount",initialScrollTop:"initialScrollTop",alignToBottom:"alignToBottom",useWindowScroll:"useWindowScroll",customScrollParent:"customScrollParent",scrollerRef:"scrollerRef",logLevel:"logLevel",horizontalDirection:"horizontalDirection",skipAnimationFrameInResizeObserver:"skipAnimationFrameInResizeObserver"},methods:{scrollToIndex:"scrollToIndex",scrollIntoView:"scrollIntoView",scrollTo:"scrollTo",scrollBy:"scrollBy",autoscrollToBottom:"autoscrollToBottom",getState:"getState"},events:{isScrolling:"isScrolling",endReached:"endReached",startReached:"startReached",rangeChanged:"rangeChanged",atBottomStateChange:"atBottomStateChange",atTopStateChange:"atTopStateChange",totalListHeightChanged:"totalListHeightChanged",itemsRendered:"itemsRendered",groupIndices:"groupIndices"}},E().memo(function(e){let t=lw("useWindowScroll"),n=lw("topItemsIndexes").length>0,i=lw("customScrollParent"),r=lw("context");return(0,I.jsxs)(i||t?lA:lC,{...e,context:r,children:[n&&(0,I.jsx)(lb,{children:(0,I.jsx)(lr,{showTopList:!0})}),(0,I.jsxs)(i||t?lv:lg,{children:[(0,I.jsx)(ld,{}),(0,I.jsx)(lr,{}),(0,I.jsx)(lf,{})]})]})})),lC=lp({useEmitter:ly,useEmitterValue:lw,usePublisher:lS}),lA=lm({useEmitter:ly,useEmitterValue:lw,usePublisher:lS}),lk=oT(()=>{let e=oC(e=>(0,I.jsxs)("td",{children:["Item $",e]})),t=oC(null),n=oC(e=>(0,I.jsxs)("td",{colSpan:1e3,children:["Group ",e]})),i=oC(null),r=oC(null),o=oC({}),s=oC(s8),l=oC(oo),a=(e,t=null)=>oA(ob(o,og(t=>t[e]),op()),t);return{components:o,computeItemKey:s,context:t,EmptyPlaceholder:a("EmptyPlaceholder"),FillerRow:a("FillerRow"),fixedFooterContent:r,fixedHeaderContent:i,itemContent:e,groupContent:n,ScrollerComponent:a("Scroller","div"),scrollerRef:l,ScrollSeekPlaceholder:a("ScrollSeekPlaceholder"),TableBodyComponent:a("TableBody","tbody"),TableComponent:a("Table","table"),TableFooterComponent:a("TableFoot","tfoot"),TableHeadComponent:a("TableHead","thead"),TableRowComponent:a("TableRow","tr"),GroupComponent:a("Group","tr")}}),lM=oT(([e,t])=>({...e,...t}),ol(sX,lk)),lT=({height:e})=>(0,I.jsx)("tr",{children:(0,I.jsx)("td",{style:{height:e}})}),lD=({height:e})=>(0,I.jsx)("tr",{children:(0,I.jsx)("td",{style:{border:0,height:e,padding:0}})}),lI={overflowAnchor:"none"},lR={position:s5(),zIndex:2,overflowAnchor:"none"},lE=E().memo(function({showTopList:e=!1}){let t=lF("listState"),n=lF("computeItemKey"),i=lF("firstItemIndex"),r=lF("context"),o=lF("isSeeking"),s=lF("fixedHeaderHeight"),l=lF("groupIndices").length>0,a=lF("itemContent"),u=lF("groupContent"),c=lF("ScrollSeekPlaceholder")??lT,h=lF("GroupComponent"),d=lF("TableRowComponent"),f=(e?t.topItems:[]).reduce((e,t,n)=>(0===n?e.push(t.size):e.push(e[n-1]+t.size),e),[]);return(e?t.topItems:t.items).map(t=>{let p=t.originalIndex,m=n(p+i,t.data,r),g=e?0===p?0:f[p-1]:0;return o?(0,R.createElement)(c,{...lc(c,r),height:t.size,index:t.index,key:m,type:t.type||"item"}):"group"===t.type?(0,R.createElement)(h,{...lc(h,r),"data-index":p,"data-item-index":t.index,"data-known-size":t.size,key:m,style:{...lR,top:s}},u(t.index,r)):(0,R.createElement)(d,{...lc(d,r),...lh(d,t.data),"data-index":p,"data-item-index":t.index,"data-known-size":t.size,"data-item-group-index":t.groupIndex,key:m,style:e?{...lR,top:s+g}:lI},l?a(t.index,t.groupIndex,t.data,r):a(t.index,t.data,r))})}),lO=E().memo(function(){let e=lF("listState"),t=lF("topItemsIndexes").length>0,n=lN("sizeRanges"),i=lF("useWindowScroll"),r=lF("customScrollParent"),o=lN("windowScrollContainerState"),s=lN("scrollContainerState"),l=lF("trackItemSizes"),{callbackRef:a,ref:u}=oF(n,lF("itemSize"),l,r||i?o:s,lF("log"),void 0,r,!1,lF("skipAnimationFrameInResizeObserver")),[c,h]=E().useState(0);lB("deviation",e=>{c!==e&&(u.current.style.marginTop=`${e}px`,h(e))});let d=lF("EmptyPlaceholder"),f=lF("FillerRow")??lD,p=lF("TableBodyComponent"),m=lF("paddingTopAddition"),g=lF("statefulTotalCount"),v=lF("context");if(0===g&&null!=d)return(0,I.jsx)(d,{...lc(d,v)});let b=(t?e.topItems:[]).reduce((e,t)=>e+t.size,0),x=e.offsetTop+m+c-b,y=e.offsetBottom,w=x>0?(0,I.jsx)(f,{context:v,height:x},"padding-top"):null,S=y>0?(0,I.jsx)(f,{context:v,height:y},"padding-bottom"):null;return(0,I.jsxs)(p,{"data-testid":"virtuoso-item-list",ref:a,...lc(p,v),children:[w,t&&(0,I.jsx)(lE,{showTopList:!0}),(0,I.jsx)(lE,{}),S]})}),lP=({children:e})=>{let t=E().useContext(sJ),n=lN("viewportHeight"),i=lN("fixedItemHeight"),r=oj(E().useMemo(()=>oi(n,e=>o4(e,"height")),[n]),!0,lF("skipAnimationFrameInResizeObserver"));return E().useEffect(()=>{t&&(n(t.viewportHeight),i(t.itemHeight))},[t,n,i]),(0,I.jsx)("div",{"data-viewport-type":"element",ref:r,style:ll(!1),children:e})},lL=({children:e})=>{let t=E().useContext(sJ),n=lN("windowViewportRect"),i=lN("fixedItemHeight"),r=lF("customScrollParent"),o=lF("useWindowScroll"),s=oV(n,r,lF("skipAnimationFrameInResizeObserver"));return E().useEffect(()=>{t&&(i(t.itemHeight),n({listHeight:0,offsetTop:0,visibleHeight:t.viewportHeight,visibleWidth:100}))},[t,n,i]),(0,I.jsx)("div",{"data-viewport-type":"window",ref:s,style:la(!1,o),children:e})},{Component:lj,useEmitter:lB,useEmitterValue:lF,usePublisher:lN}=sQ(lM,{optional:{restoreStateFrom:"restoreStateFrom",context:"context",followOutput:"followOutput",firstItemIndex:"firstItemIndex",itemContent:"itemContent",groupContent:"groupContent",fixedHeaderContent:"fixedHeaderContent",fixedFooterContent:"fixedFooterContent",overscan:"overscan",increaseViewportBy:"increaseViewportBy",minOverscanItemCount:"minOverscanItemCount",totalCount:"totalCount",topItemCount:"topItemCount",initialTopMostItemIndex:"initialTopMostItemIndex",components:"components",groupCounts:"groupCounts",atBottomThreshold:"atBottomThreshold",atTopThreshold:"atTopThreshold",computeItemKey:"computeItemKey",defaultItemHeight:"defaultItemHeight",fixedGroupHeight:"fixedGroupHeight",fixedItemHeight:"fixedItemHeight",itemSize:"itemSize",scrollSeekConfiguration:"scrollSeekConfiguration",data:"data",initialItemCount:"initialItemCount",initialScrollTop:"initialScrollTop",alignToBottom:"alignToBottom",useWindowScroll:"useWindowScroll",customScrollParent:"customScrollParent",scrollerRef:"scrollerRef",logLevel:"logLevel"},methods:{scrollToIndex:"scrollToIndex",scrollIntoView:"scrollIntoView",scrollTo:"scrollTo",scrollBy:"scrollBy",getState:"getState"},events:{isScrolling:"isScrolling",endReached:"endReached",startReached:"startReached",rangeChanged:"rangeChanged",atBottomStateChange:"atBottomStateChange",atTopStateChange:"atTopStateChange",totalListHeightChanged:"totalListHeightChanged",itemsRendered:"itemsRendered",groupIndices:"groupIndices"}},E().memo(function(e){let t=lF("useWindowScroll"),n=lF("customScrollParent"),i=lN("fixedHeaderHeight"),r=lN("fixedFooterHeight"),o=lF("fixedHeaderContent"),s=lF("fixedFooterContent"),l=lF("context"),a=oj(E().useMemo(()=>oi(i,e=>o4(e,"height")),[i]),!0,lF("skipAnimationFrameInResizeObserver")),u=oj(E().useMemo(()=>oi(r,e=>o4(e,"height")),[r]),!0,lF("skipAnimationFrameInResizeObserver")),c=n||t?lH:lV,h=n||t?lL:lP,d=lF("TableComponent"),f=lF("TableHeadComponent"),p=lF("TableFooterComponent"),m=o?(0,I.jsx)(f,{ref:a,style:{position:"sticky",top:0,zIndex:2},...lc(f,l),children:o()},"TableHead"):null,g=s?(0,I.jsx)(p,{ref:u,style:{bottom:0,position:"sticky",zIndex:1},...lc(p,l),children:s()},"TableFoot"):null;return(0,I.jsx)(c,{...e,...lc(c,l),children:(0,I.jsx)(h,{children:(0,I.jsxs)(d,{style:{borderSpacing:0,overflowAnchor:"none"},...lc(d,l),children:[m,(0,I.jsx)(lO,{},"TableBody"),g]})})})})),lV=lp({useEmitter:lB,useEmitterValue:lF,usePublisher:lN}),lH=lm({useEmitter:lB,useEmitterValue:lF,usePublisher:lN}),lz={bottom:0,itemHeight:0,items:[],itemWidth:0,offsetBottom:0,offsetTop:0,top:0},lW={bottom:0,itemHeight:0,items:[{index:0}],itemWidth:0,offsetBottom:0,offsetTop:0,top:0},{ceil:l$,floor:l_,max:lU,min:lG,round:lq}=Math;function lY(e,t,n){return Array.from({length:t-e+1}).map((t,i)=>({data:null===n?null:n[i+e],index:i+e}))}function lK(e,t){return void 0!==e&&e.width===t.width&&e.height===t.height}function lX(e,t){return void 0!==e&&e.column===t.column&&e.row===t.row}let lZ=oT(([{increaseViewportBy:e,listBoundary:t,overscan:n,visibleRange:i},{footerHeight:r,headerHeight:o,scrollBy:s,scrollContainerState:l,scrollTo:a,scrollTop:u,smoothScrollTargetReached:c,viewportHeight:h},d,f,{didMount:p,propsReady:m},{customScrollParent:g,useWindowScroll:v,windowScrollContainerState:b,windowScrollTo:x,windowViewportRect:y},w])=>{let S=oC(0),C=oC(0),A=oC(lz),k=oC({height:0,width:0}),M=oC({height:0,width:0}),T=ok(),D=ok(),I=oC(0),R=oC(null),E=oC({column:0,row:0}),O=ok(),P=ok(),L=oC(!1),j=oC(0),B=oC(!0),F=oC(!1),N=oC(!1);ob(p,oS(j),om(([e,t])=>0!==t))(1,()=>{B(0,!1)}),ob(oI(p,B,M,k,j,F),om(([e,t,n,i,,r])=>e&&!t&&0!==n.height&&0!==i.height&&!r))(1,([,,,,e])=>{F(0,!0),sp(1,()=>{T(0,e)}),oh(ob(u),()=>{t(0,[0,0]),B(0,!0)})}),oc(ob(P,om(e=>null!=e&&e.scrollTop>0),ov(0)),C),ob(p,oS(P),om(([,e])=>null!=e))(1,([,e])=>{e&&(k(0,e.viewport),M(0,e.item),E(0,e.gap),e.scrollTop>0&&(L(0,!0),oh(ob(u,oy(1)),e=>{L(0,!1)}),a(0,{top:e.scrollTop})))}),oc(ob(k,og(({height:e})=>e)),h),oc(ob(oI(oR(k,lK),oR(M,lK),oR(E,(e,t)=>void 0!==e&&e.column===t.column&&e.row===t.row),oR(u)),og(([e,t,n,i])=>({gap:n,item:t,scrollTop:i,viewport:e}))),O),oc(ob(oI(oR(S),i,oR(E,lX),oR(M,lK),oR(k,lK),oR(R),oR(C),oR(L),oR(B),oR(j)),om(([,,,,,,,e])=>!e),og(([e,[t,n],i,r,o,s,l,,a,u])=>{let c,h,{column:d,row:f}=i,{height:p,width:m}=r,{width:g}=o;if(0===l&&(0===e||0===g))return lz;if(0===m){var v;let t=sm(u,e),n=t+Math.max(l-1,0);return v=lY(t,n,s),{...lW,items:v}}let b=lQ(g,m,d);a?0===t&&0===n&&l>0?(c=0,h=l-1):(c=b*l_((t+f)/(p+f)),h=lG(e-1,lU(h=b*l$((n+f)/(p+f))-1,b-1)),c=lG(h,lU(0,c))):(c=0,h=-1);let x=lY(c,h,s),{bottom:y,top:w}=lJ(o,i,r,x),S=l$(e/b);return{bottom:y,itemHeight:p,items:x,itemWidth:m,offsetBottom:S*p+(S-1)*f-y,offsetTop:w,top:w}})),A),oc(ob(R,om(e=>null!==e),og(e=>e.length)),S),oc(ob(oI(k,M,A,E),om(([e,t,{items:n}])=>n.length>0&&0!==t.height&&0!==e.height),og(([e,t,{items:n},i])=>{let{bottom:r,top:o}=lJ(e,i,t,n);return[o,r]}),op(o2)),t);let V=oC(!1);oc(ob(u,oS(V),og(([e,t])=>t||0!==e)),V);let H=oM(ob(oI(A,S),om(([{items:e}])=>e.length>0),oS(V),om(([[e,t],n])=>{let i=e.items[e.items.length-1].index===t-1;return(n||e.bottom>0&&e.itemHeight>0&&0===e.offsetBottom&&e.items.length===t)&&i}),og(([[,e]])=>e-1),op())),z=oM(ob(oR(A),om(({items:e})=>e.length>0&&0===e[0].index),ov(0),op())),W=oM(ob(oR(A),oS(L),om(([{items:e},t])=>e.length>0&&!t),og(([{items:e}])=>({endIndex:e[e.length-1].index,startIndex:e[0].index})),op(o1),ow(0)));oc(W,f.scrollSeekRangeChanged),oc(ob(T,oS(k,M,S,E),og(([e,t,n,i,r])=>{let o=sd(e),{align:s,behavior:l,offset:a}=o,u=o.index;"LAST"===u&&(u=i-1);let c=l0(t,r,n,u=lU(0,u,lG(i-1,u)));return"end"===s?c=lq(c-t.height+n.height):"center"===s&&(c=lq(c-t.height/2+n.height/2)),void 0!==a&&0!==a&&(c+=a),{behavior:l,top:c}})),a);let $=oA(ob(A,og(e=>e.offsetBottom+e.bottom)),0);return oc(ob(y,og(e=>({height:e.visibleHeight,width:e.visibleWidth}))),k),{customScrollParent:g,data:R,deviation:I,footerHeight:r,gap:E,headerHeight:o,increaseViewportBy:e,initialItemCount:C,itemDimensions:M,overscan:n,restoreStateFrom:P,scrollBy:s,scrollContainerState:l,scrollHeight:D,scrollTo:a,scrollToIndex:T,scrollTop:u,smoothScrollTargetReached:c,totalCount:S,useWindowScroll:v,viewportDimensions:k,windowScrollContainerState:b,windowScrollTo:x,windowViewportRect:y,...f,gridState:A,horizontalDirection:N,initialTopMostItemIndex:j,totalListHeight:$,...d,endReached:H,propsReady:m,rangeChanged:W,startReached:z,stateChanged:O,stateRestoreInProgress:L,...w}},ol(sk,oH,sy,sz,sc,sW,oL));function lQ(e,t,n){return lU(1,l_((e+n)/(l_(t)+n)))}function lJ(e,t,n,i){let{height:r}=n;if(void 0===r||0===i.length)return{bottom:0,top:0};let o=l0(e,t,n,i[0].index);return{bottom:l0(e,t,n,i[i.length-1].index)+r,top:o}}function l0(e,t,n,i){let r=l_(i/lQ(e.width,n.width,t.column)),o=r*n.height+lU(0,r-1)*t.row;return o>0?o+t.row:o}let l1=oT(()=>{let e=oC(e=>`Item ${e}`),t=oC({}),n=oC(null),i=oC("virtuoso-grid-item"),r=oC("virtuoso-grid-list"),o=oC(s8),s=oC("div"),l=oC(oo),a=(e,n=null)=>oA(ob(t,og(t=>t[e]),op()),n),u=oC(!1),c=oC(!1);return oc(oR(c),u),{components:t,computeItemKey:o,context:n,FooterComponent:a("Footer"),HeaderComponent:a("Header"),headerFooterTag:s,itemClassName:i,ItemComponent:a("Item","div"),itemContent:e,listClassName:r,ListComponent:a("List","div"),readyStateChanged:u,reportReadyState:c,ScrollerComponent:a("Scroller","div"),scrollerRef:l,ScrollSeekPlaceholder:a("ScrollSeekPlaceholder","div")}}),l2=oT(([e,t])=>({...e,...t}),ol(lZ,l1)),l5=E().memo(function(){let e=l7("gridState"),t=l7("listClassName"),n=l7("itemClassName"),i=l7("itemContent"),r=l7("computeItemKey"),o=l7("isSeeking"),s=ae("scrollHeight"),l=l7("ItemComponent"),a=l7("ListComponent"),u=l7("ScrollSeekPlaceholder"),c=l7("context"),h=ae("itemDimensions"),d=ae("gap"),f=l7("log"),p=l7("stateRestoreInProgress"),m=ae("reportReadyState"),g=oj(E().useMemo(()=>e=>{s(e.parentElement.parentElement.scrollHeight);let t=e.firstChild;if(null!==t){let{height:e,width:n}=t.getBoundingClientRect();h({height:e,width:n})}d({column:ai("column-gap",getComputedStyle(e).columnGap,f),row:ai("row-gap",getComputedStyle(e).rowGap,f)})},[s,h,d,f]),!0,!1);return s3(()=>{e.itemHeight>0&&e.itemWidth>0&&m(!0)},[e]),p?null:(0,I.jsx)(a,{className:t,ref:g,...lc(a,c),"data-testid":"virtuoso-item-list",style:{paddingBottom:e.offsetBottom,paddingTop:e.offsetTop},children:e.items.map(t=>{let s=r(t.index,t.data,c);return o?(0,I.jsx)(u,{...lc(u,c),height:e.itemHeight,index:t.index,width:e.itemWidth},s):(0,R.createElement)(l,{...lc(l,c),className:n,"data-index":t.index,key:s},i(t.index,t.data,c))})})}),l3=E().memo(function(){let e=l7("HeaderComponent"),t=ae("headerHeight"),n=l7("headerFooterTag"),i=oj(E().useMemo(()=>e=>{t(o4(e,"height"))},[t]),!0,!1),r=l7("context");return null!=e?(0,I.jsx)(n,{ref:i,children:(0,I.jsx)(e,{...lc(e,r)})}):null}),l4=E().memo(function(){let e=l7("FooterComponent"),t=ae("footerHeight"),n=l7("headerFooterTag"),i=oj(E().useMemo(()=>e=>{t(o4(e,"height"))},[t]),!0,!1),r=l7("context");return null!=e?(0,I.jsx)(n,{ref:i,children:(0,I.jsx)(e,{...lc(e,r)})}):null}),l6=({children:e})=>{let t=E().useContext(s0),n=ae("itemDimensions"),i=ae("viewportDimensions"),r=oj(E().useMemo(()=>e=>{i(e.getBoundingClientRect())},[i]),!0,!1);return E().useEffect(()=>{t&&(i({height:t.viewportHeight,width:t.viewportWidth}),n({height:t.itemHeight,width:t.itemWidth}))},[t,i,n]),(0,I.jsx)("div",{ref:r,style:ll(!1),children:e})},l8=({children:e})=>{let t=E().useContext(s0),n=ae("windowViewportRect"),i=ae("itemDimensions"),r=l7("customScrollParent"),o=l7("useWindowScroll"),s=oV(n,r,!1);return E().useEffect(()=>{t&&(i({height:t.itemHeight,width:t.itemWidth}),n({listHeight:0,offsetTop:0,visibleHeight:t.viewportHeight,visibleWidth:t.viewportWidth}))},[t,n,i]),(0,I.jsx)("div",{ref:s,style:la(!1,o),children:e})},{useEmitter:l9,useEmitterValue:l7,usePublisher:ae}=sQ(l2,{optional:{context:"context",totalCount:"totalCount",overscan:"overscan",itemContent:"itemContent",components:"components",computeItemKey:"computeItemKey",data:"data",initialItemCount:"initialItemCount",scrollSeekConfiguration:"scrollSeekConfiguration",headerFooterTag:"headerFooterTag",listClassName:"listClassName",itemClassName:"itemClassName",useWindowScroll:"useWindowScroll",customScrollParent:"customScrollParent",scrollerRef:"scrollerRef",logLevel:"logLevel",restoreStateFrom:"restoreStateFrom",initialTopMostItemIndex:"initialTopMostItemIndex",increaseViewportBy:"increaseViewportBy"},methods:{scrollTo:"scrollTo",scrollBy:"scrollBy",scrollToIndex:"scrollToIndex"},events:{isScrolling:"isScrolling",endReached:"endReached",startReached:"startReached",rangeChanged:"rangeChanged",atBottomStateChange:"atBottomStateChange",atTopStateChange:"atTopStateChange",stateChanged:"stateChanged",readyStateChanged:"readyStateChanged"}},E().memo(function({...e}){let t=l7("useWindowScroll"),n=l7("customScrollParent"),i=n||t?an:at,r=n||t?l8:l6,o=l7("context");return(0,I.jsx)(i,{...e,...lc(i,o),children:(0,I.jsxs)(r,{children:[(0,I.jsx)(l3,{}),(0,I.jsx)(l5,{}),(0,I.jsx)(l4,{})]})})})),at=lp({useEmitter:l9,useEmitterValue:l7,usePublisher:ae}),an=lm({useEmitter:l9,useEmitterValue:l7,usePublisher:ae});function ai(e,t,n){return"normal"!==t&&t?.endsWith("px")!==!0&&n(`${e} was not resolved to pixel value correctly`,t,2),"normal"===t?0:parseInt(t??"0",10)}var ar=n(83926),ao=n(1337),as=n(54382),al=n(29424),aa=n(67214);function au(e){return(0,W.Ay)("MuiListItemButton",e)}let ac=(0,z.A)("MuiListItemButton",["root","focusVisible","dense","alignItemsFlexStart","disabled","divider","gutters","selected"]),ah=(0,F.A)(ao.A,{shouldForwardProp:e=>(0,ar.A)(e)||"classes"===e,name:"MuiListItemButton",slot:"Root",overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.root,n.dense&&t.dense,"flex-start"===n.alignItems&&t.alignItemsFlexStart,n.divider&&t.divider,!n.disableGutters&&t.gutters]}})((0,N.A)(({theme:e})=>({display:"flex",flexGrow:1,justifyContent:"flex-start",alignItems:"center",position:"relative",textDecoration:"none",minWidth:0,boxSizing:"border-box",textAlign:"left",paddingTop:8,paddingBottom:8,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"}},[`&.${ac.selected}`]:{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / ${e.vars.palette.action.selectedOpacity})`:(0,L.X4)(e.palette.primary.main,e.palette.action.selectedOpacity),[`&.${ac.focusVisible}`]:{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.focusOpacity}))`:(0,L.X4)(e.palette.primary.main,e.palette.action.selectedOpacity+e.palette.action.focusOpacity)}},[`&.${ac.selected}:hover`]:{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.hoverOpacity}))`:(0,L.X4)(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})`:(0,L.X4)(e.palette.primary.main,e.palette.action.selectedOpacity)}},[`&.${ac.focusVisible}`]:{backgroundColor:(e.vars||e).palette.action.focus},[`&.${ac.disabled}`]:{opacity:(e.vars||e).palette.action.disabledOpacity},variants:[{props:({ownerState:e})=>e.divider,style:{borderBottom:`1px solid ${(e.vars||e).palette.divider}`,backgroundClip:"padding-box"}},{props:{alignItems:"flex-start"},style:{alignItems:"flex-start"}},{props:({ownerState:e})=>!e.disableGutters,style:{paddingLeft:16,paddingRight:16}},{props:({ownerState:e})=>e.dense,style:{paddingTop:4,paddingBottom:4}}]}))),ad=R.forwardRef(function(e,t){let n=(0,H.b)({props:e,name:"MuiListItemButton"}),{alignItems:i="center",autoFocus:r=!1,component:o="div",children:s,dense:l=!1,disableGutters:a=!1,divider:u=!1,focusVisibleClassName:c,selected:h=!1,className:d,...f}=n,p=R.useContext(aa.A),m=R.useMemo(()=>({dense:l||p.dense||!1,alignItems:i,disableGutters:a}),[i,p.dense,l,a]),g=R.useRef(null);(0,as.A)(()=>{r&&g.current&&g.current.focus()},[r]);let v={...n,alignItems:i,dense:m.dense,disableGutters:a,divider:u,selected:h},b=(e=>{let{alignItems:t,classes:n,dense:i,disabled:r,disableGutters:o,divider:s,selected:l}=e,a=(0,P.A)({root:["root",i&&"dense",!o&&"gutters",s&&"divider",r&&"disabled","flex-start"===t&&"alignItemsFlexStart",l&&"selected"]},au,n);return{...n,...a}})(v),x=(0,al.A)(g,t);return(0,I.jsx)(aa.A.Provider,{value:m,children:(0,I.jsx)(ah,{ref:x,href:f.href||f.to,component:(f.href||f.to)&&"div"===o?"button":o,focusVisibleClassName:(0,O.A)(b.focusVisible,c),ownerState:v,className:(0,O.A)(b.root,d),...f,classes:b,children:s})})});var af=n(14045);let ap=(0,R.memo)(function({color:e,sx:t,...n}){return(0,I.jsx)(oe.A,{...n,sx:iH({height:4,width:16,margin:e=>e.spacing(.5)},t),style:{backgroundColor:e}})}),am=(0,R.forwardRef)(function({item:e,sx:t,truncateLabel:n,onClick:i,isVisuallySelected:r,onMouseOver:o,onMouseOut:s,index:l,...a},u){let[c,h]=(0,R.useState)(n);return(0,I.jsxs)(ad,{...a,role:"listitem",sx:iH({padding:0,cursor:"pointer"},t),dense:!0,onClick:t=>{i(t,e.id),e.onClick?.(t)},onMouseOver:t=>o?.(t,{id:e.id,index:l}),onMouseOut:t=>s?.(t,{id:e.id,index:l}),selected:r,ref:u,children:[(0,I.jsx)(oe.A,{sx:{display:"flex",alignItems:"center"},children:(0,I.jsx)(ap,{color:e.color})}),(0,I.jsx)(af.A,{primary:e.label,primaryTypographyProps:{noWrap:c},onMouseOver:function(){n&&h(!1)},onMouseOut:function(){n&&h(!0)}})]})}),ag=(0,R.memo)(am);function av(e,t){return"ALL"!==t&&!!t[e.id]}function ab({items:e,height:t,width:n,selectedItems:i,onLegendItemClick:r,onItemMouseOver:o,onItemMouseOut:s}){let l=e.length>5;return(0,I.jsx)(lx,{style:{height:t,width:n},data:e,itemContent:(e,t)=>(0,I.jsx)(ag,{item:t,index:e,truncateLabel:l,isVisuallySelected:av(t,i),onClick:r,onMouseOver:o,onMouseOut:s,sx:{width:"100%",wordBreak:"break-word",overflow:"hidden"}},t.id),role:"list"})}function ax({height:e,items:t,selectedItems:n,onLegendItemClick:i,onItemMouseOver:r,onItemMouseOut:o}){return(0,I.jsx)(oe.A,{component:"ul",sx:{width:"100%",height:e,padding:[0,1,0,0],overflowY:"scroll",margin:0},children:t.map((e,t)=>(0,I.jsx)(ag,{item:e,index:t,isVisuallySelected:av(e,n),onMouseOver:r,onMouseOut:o,onClick:i,sx:{width:"auto",float:"left",paddingRight:1.5}},e.id))})}function ay(e,t){return"function"==typeof e?e(t):e}function aw(e,t){return n=>{t.setState(t=>({...t,[e]:ay(n,t[e])}))}}function aS(e){return e instanceof Function}function aC(e,t,n){let i,r=[];return o=>{let s,l;n.key&&n.debug&&(s=Date.now());let a=e(o);if(!(a.length!==r.length||a.some((e,t)=>r[t]!==e)))return i;if(r=a,n.key&&n.debug&&(l=Date.now()),i=t(...a),null==n||null==n.onChange||n.onChange(i),n.key&&n.debug&&null!=n&&n.debug()){let e=Math.round((Date.now()-s)*100)/100,t=Math.round((Date.now()-l)*100)/100,i=t/16,r=(e,t)=>{for(e=String(e);e.length<t;)e=" "+e;return e};console.info(`%c⏱ ${r(t,5)} /${r(e,5)} ms`,`
|
|
3
|
+
font-size: .6rem;
|
|
4
|
+
font-weight: bold;
|
|
5
|
+
color: hsl(${Math.max(0,Math.min(120-120*i,120))}deg 100% 31%);`,null==n?void 0:n.key)}return i}}function aA(e,t,n,i){return{debug:()=>{var n;return null!=(n=null==e?void 0:e.debugAll)?n:e[t]},key:!1,onChange:i}}let ak="debugHeaders";function aM(e,t,n){var i;let r={id:null!=(i=n.id)?i:t.id,column:t,index:n.index,isPlaceholder:!!n.isPlaceholder,placeholderId:n.placeholderId,depth:n.depth,subHeaders:[],colSpan:0,rowSpan:0,headerGroup:null,getLeafHeaders:()=>{let e=[],t=n=>{n.subHeaders&&n.subHeaders.length&&n.subHeaders.map(t),e.push(n)};return t(r),e},getContext:()=>({table:e,header:r,column:t})};return e._features.forEach(t=>{null==t.createHeader||t.createHeader(r,e)}),r}function aT(e,t,n,i){var r,o;let s=0,l=function(e,t){void 0===t&&(t=1),s=Math.max(s,t),e.filter(e=>e.getIsVisible()).forEach(e=>{var n;null!=(n=e.columns)&&n.length&&l(e.columns,t+1)},0)};l(e);let a=[],u=(e,t)=>{let r={depth:t,id:[i,`${t}`].filter(Boolean).join("_"),headers:[]},o=[];e.forEach(e=>{let s,l=[...o].reverse()[0],a=e.column.depth===r.depth,u=!1;if(a&&e.column.parent?s=e.column.parent:(s=e.column,u=!0),l&&(null==l?void 0:l.column)===s)l.subHeaders.push(e);else{let r=aM(n,s,{id:[i,t,s.id,null==e?void 0:e.id].filter(Boolean).join("_"),isPlaceholder:u,placeholderId:u?`${o.filter(e=>e.column===s).length}`:void 0,depth:t,index:o.length});r.subHeaders.push(e),o.push(r)}r.headers.push(e),e.headerGroup=r}),a.push(r),t>0&&u(o,t-1)};u(t.map((e,t)=>aM(n,e,{depth:s,index:t})),s-1),a.reverse();let c=e=>e.filter(e=>e.column.getIsVisible()).map(e=>{let t=0,n=0,i=[0];return e.subHeaders&&e.subHeaders.length?(i=[],c(e.subHeaders).forEach(e=>{let{colSpan:n,rowSpan:r}=e;t+=n,i.push(r)})):t=1,n+=Math.min(...i),e.colSpan=t,e.rowSpan=n,{colSpan:t,rowSpan:n}});return c(null!=(r=null==(o=a[0])?void 0:o.headers)?r:[]),a}let aD=(e,t,n,i,r,o,s)=>{let l={id:t,index:i,original:n,depth:r,parentId:s,_valuesCache:{},_uniqueValuesCache:{},getValue:t=>{if(l._valuesCache.hasOwnProperty(t))return l._valuesCache[t];let n=e.getColumn(t);if(null!=n&&n.accessorFn)return l._valuesCache[t]=n.accessorFn(l.original,i),l._valuesCache[t]},getUniqueValues:t=>{if(l._uniqueValuesCache.hasOwnProperty(t))return l._uniqueValuesCache[t];let n=e.getColumn(t);if(null!=n&&n.accessorFn)return n.columnDef.getUniqueValues?l._uniqueValuesCache[t]=n.columnDef.getUniqueValues(l.original,i):l._uniqueValuesCache[t]=[l.getValue(t)],l._uniqueValuesCache[t]},renderValue:t=>{var n;return null!=(n=l.getValue(t))?n:e.options.renderFallbackValue},subRows:null!=o?o:[],getLeafRows:()=>{var e,t;let n,i;return e=l.subRows,t=e=>e.subRows,n=[],(i=e=>{e.forEach(e=>{n.push(e);let r=t(e);null!=r&&r.length&&i(r)})})(e),n},getParentRow:()=>l.parentId?e.getRow(l.parentId,!0):void 0,getParentRows:()=>{let e=[],t=l;for(;;){let n=t.getParentRow();if(!n)break;e.push(n),t=n}return e.reverse()},getAllCells:aC(()=>[e.getAllLeafColumns()],t=>t.map(t=>{var n;let i;return n=t.id,i={id:`${l.id}_${t.id}`,row:l,column:t,getValue:()=>l.getValue(n),renderValue:()=>{var t;return null!=(t=i.getValue())?t:e.options.renderFallbackValue},getContext:aC(()=>[e,t,l,i],(e,t,n,i)=>({table:e,column:t,row:n,cell:i,getValue:i.getValue,renderValue:i.renderValue}),aA(e.options,"debugCells","cell.getContext"))},e._features.forEach(n=>{null==n.createCell||n.createCell(i,t,l,e)},{}),i}),aA(e.options,"debugRows","getAllCells")),_getAllCellsByColumnId:aC(()=>[l.getAllCells()],e=>e.reduce((e,t)=>(e[t.column.id]=t,e),{}),aA(e.options,"debugRows","getAllCellsByColumnId"))};for(let t=0;t<e._features.length;t++){let n=e._features[t];null==n||null==n.createRow||n.createRow(l,e)}return l},aI=(e,t,n)=>{var i,r;let o=null==n||null==(i=n.toString())?void 0:i.toLowerCase();return!!(null==(r=e.getValue(t))||null==(r=r.toString())||null==(r=r.toLowerCase())?void 0:r.includes(o))};aI.autoRemove=e=>aV(e);let aR=(e,t,n)=>{var i;return!!(null==(i=e.getValue(t))||null==(i=i.toString())?void 0:i.includes(n))};aR.autoRemove=e=>aV(e);let aE=(e,t,n)=>{var i;return(null==(i=e.getValue(t))||null==(i=i.toString())?void 0:i.toLowerCase())===(null==n?void 0:n.toLowerCase())};aE.autoRemove=e=>aV(e);let aO=(e,t,n)=>{var i;return null==(i=e.getValue(t))?void 0:i.includes(n)};aO.autoRemove=e=>aV(e);let aP=(e,t,n)=>!n.some(n=>{var i;return!(null!=(i=e.getValue(t))&&i.includes(n))});aP.autoRemove=e=>aV(e)||!(null!=e&&e.length);let aL=(e,t,n)=>n.some(n=>{var i;return null==(i=e.getValue(t))?void 0:i.includes(n)});aL.autoRemove=e=>aV(e)||!(null!=e&&e.length);let aj=(e,t,n)=>e.getValue(t)===n;aj.autoRemove=e=>aV(e);let aB=(e,t,n)=>e.getValue(t)==n;aB.autoRemove=e=>aV(e);let aF=(e,t,n)=>{let[i,r]=n,o=e.getValue(t);return o>=i&&o<=r};aF.resolveFilterValue=e=>{let[t,n]=e,i="number"!=typeof t?parseFloat(t):t,r="number"!=typeof n?parseFloat(n):n,o=null===t||Number.isNaN(i)?-1/0:i,s=null===n||Number.isNaN(r)?1/0:r;if(o>s){let e=o;o=s,s=e}return[o,s]},aF.autoRemove=e=>aV(e)||aV(e[0])&&aV(e[1]);let aN={includesString:aI,includesStringSensitive:aR,equalsString:aE,arrIncludes:aO,arrIncludesAll:aP,arrIncludesSome:aL,equals:aj,weakEquals:aB,inNumberRange:aF};function aV(e){return null==e||""===e}function aH(e,t,n){return!!e&&!!e.autoRemove&&e.autoRemove(t,n)||void 0===t||"string"==typeof t&&!t}let az={sum:(e,t,n)=>n.reduce((t,n)=>{let i=n.getValue(e);return t+("number"==typeof i?i:0)},0),min:(e,t,n)=>{let i;return n.forEach(t=>{let n=t.getValue(e);null!=n&&(i>n||void 0===i&&n>=n)&&(i=n)}),i},max:(e,t,n)=>{let i;return n.forEach(t=>{let n=t.getValue(e);null!=n&&(i<n||void 0===i&&n>=n)&&(i=n)}),i},extent:(e,t,n)=>{let i,r;return n.forEach(t=>{let n=t.getValue(e);null!=n&&(void 0===i?n>=n&&(i=r=n):(i>n&&(i=n),r<n&&(r=n)))}),[i,r]},mean:(e,t)=>{let n=0,i=0;if(t.forEach(t=>{let r=t.getValue(e);null!=r&&(r*=1)>=r&&(++n,i+=r)}),n)return i/n},median:(e,t)=>{if(!t.length)return;let n=t.map(t=>t.getValue(e));if(!(Array.isArray(n)&&n.every(e=>"number"==typeof e)))return;if(1===n.length)return n[0];let i=Math.floor(n.length/2),r=n.sort((e,t)=>e-t);return n.length%2!=0?r[i]:(r[i-1]+r[i])/2},unique:(e,t)=>Array.from(new Set(t.map(t=>t.getValue(e))).values()),uniqueCount:(e,t)=>new Set(t.map(t=>t.getValue(e))).size,count:(e,t)=>t.length},aW=()=>({left:[],right:[]}),a$={size:150,minSize:20,maxSize:Number.MAX_SAFE_INTEGER},a_=()=>({startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]}),aU=null;function aG(e){return"touchstart"===e.type}function aq(e,t){return t?"center"===t?e.getCenterVisibleLeafColumns():"left"===t?e.getLeftVisibleLeafColumns():e.getRightVisibleLeafColumns():e.getVisibleLeafColumns()}let aY=()=>({pageIndex:0,pageSize:10}),aK=()=>({top:[],bottom:[]}),aX=(e,t,n,i,r)=>{var o;let s=r.getRow(t,!0);n?(s.getCanMultiSelect()||Object.keys(e).forEach(t=>delete e[t]),s.getCanSelect()&&(e[t]=!0)):delete e[t],i&&null!=(o=s.subRows)&&o.length&&s.getCanSelectSubRows()&&s.subRows.forEach(t=>aX(e,t.id,n,i,r))};function aZ(e,t){let n=e.getState().rowSelection,i=[],r={},o=function(e,t){return e.map(e=>{var t;let s=aQ(e,n);if(s&&(i.push(e),r[e.id]=e),null!=(t=e.subRows)&&t.length&&(e={...e,subRows:o(e.subRows)}),s)return e}).filter(Boolean)};return{rows:o(t.rows),flatRows:i,rowsById:r}}function aQ(e,t){var n;return null!=(n=t[e.id])&&n}function aJ(e,t,n){var i;if(!(null!=(i=e.subRows)&&i.length))return!1;let r=!0,o=!1;return e.subRows.forEach(e=>{if((!o||r)&&(e.getCanSelect()&&(aQ(e,t)?o=!0:r=!1),e.subRows&&e.subRows.length)){let n=aJ(e,t);"all"===n?o=!0:("some"===n&&(o=!0),r=!1)}}),r?"all":!!o&&"some"}let a0=/([0-9]+)/gm;function a1(e,t){return e===t?0:e>t?1:-1}function a2(e){return"number"==typeof e?isNaN(e)||e===1/0||e===-1/0?"":String(e):"string"==typeof e?e:""}function a5(e,t){let n=e.split(a0).filter(Boolean),i=t.split(a0).filter(Boolean);for(;n.length&&i.length;){let e=n.shift(),t=i.shift(),r=parseInt(e,10),o=parseInt(t,10),s=[r,o].sort();if(isNaN(s[0])){if(e>t)return 1;if(t>e)return -1;continue}if(isNaN(s[1]))return isNaN(r)?-1:1;if(r>o)return 1;if(o>r)return -1}return n.length-i.length}let a3={alphanumeric:(e,t,n)=>a5(a2(e.getValue(n)).toLowerCase(),a2(t.getValue(n)).toLowerCase()),alphanumericCaseSensitive:(e,t,n)=>a5(a2(e.getValue(n)),a2(t.getValue(n))),text:(e,t,n)=>a1(a2(e.getValue(n)).toLowerCase(),a2(t.getValue(n)).toLowerCase()),textCaseSensitive:(e,t,n)=>a1(a2(e.getValue(n)),a2(t.getValue(n))),datetime:(e,t,n)=>{let i=e.getValue(n),r=t.getValue(n);return i>r?1:i<r?-1:0},basic:(e,t,n)=>a1(e.getValue(n),t.getValue(n))},a4=[{createTable:e=>{e.getHeaderGroups=aC(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,i,r)=>{var o,s;let l=null!=(o=null==i?void 0:i.map(e=>n.find(t=>t.id===e)).filter(Boolean))?o:[],a=null!=(s=null==r?void 0:r.map(e=>n.find(t=>t.id===e)).filter(Boolean))?s:[];return aT(t,[...l,...n.filter(e=>!(null!=i&&i.includes(e.id))&&!(null!=r&&r.includes(e.id))),...a],e)},aA(e.options,ak,"getHeaderGroups")),e.getCenterHeaderGroups=aC(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,i,r)=>aT(t,n=n.filter(e=>!(null!=i&&i.includes(e.id))&&!(null!=r&&r.includes(e.id))),e,"center"),aA(e.options,ak,"getCenterHeaderGroups")),e.getLeftHeaderGroups=aC(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left],(t,n,i)=>{var r;return aT(t,null!=(r=null==i?void 0:i.map(e=>n.find(t=>t.id===e)).filter(Boolean))?r:[],e,"left")},aA(e.options,ak,"getLeftHeaderGroups")),e.getRightHeaderGroups=aC(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.right],(t,n,i)=>{var r;return aT(t,null!=(r=null==i?void 0:i.map(e=>n.find(t=>t.id===e)).filter(Boolean))?r:[],e,"right")},aA(e.options,ak,"getRightHeaderGroups")),e.getFooterGroups=aC(()=>[e.getHeaderGroups()],e=>[...e].reverse(),aA(e.options,ak,"getFooterGroups")),e.getLeftFooterGroups=aC(()=>[e.getLeftHeaderGroups()],e=>[...e].reverse(),aA(e.options,ak,"getLeftFooterGroups")),e.getCenterFooterGroups=aC(()=>[e.getCenterHeaderGroups()],e=>[...e].reverse(),aA(e.options,ak,"getCenterFooterGroups")),e.getRightFooterGroups=aC(()=>[e.getRightHeaderGroups()],e=>[...e].reverse(),aA(e.options,ak,"getRightFooterGroups")),e.getFlatHeaders=aC(()=>[e.getHeaderGroups()],e=>e.map(e=>e.headers).flat(),aA(e.options,ak,"getFlatHeaders")),e.getLeftFlatHeaders=aC(()=>[e.getLeftHeaderGroups()],e=>e.map(e=>e.headers).flat(),aA(e.options,ak,"getLeftFlatHeaders")),e.getCenterFlatHeaders=aC(()=>[e.getCenterHeaderGroups()],e=>e.map(e=>e.headers).flat(),aA(e.options,ak,"getCenterFlatHeaders")),e.getRightFlatHeaders=aC(()=>[e.getRightHeaderGroups()],e=>e.map(e=>e.headers).flat(),aA(e.options,ak,"getRightFlatHeaders")),e.getCenterLeafHeaders=aC(()=>[e.getCenterFlatHeaders()],e=>e.filter(e=>{var t;return!(null!=(t=e.subHeaders)&&t.length)}),aA(e.options,ak,"getCenterLeafHeaders")),e.getLeftLeafHeaders=aC(()=>[e.getLeftFlatHeaders()],e=>e.filter(e=>{var t;return!(null!=(t=e.subHeaders)&&t.length)}),aA(e.options,ak,"getLeftLeafHeaders")),e.getRightLeafHeaders=aC(()=>[e.getRightFlatHeaders()],e=>e.filter(e=>{var t;return!(null!=(t=e.subHeaders)&&t.length)}),aA(e.options,ak,"getRightLeafHeaders")),e.getLeafHeaders=aC(()=>[e.getLeftHeaderGroups(),e.getCenterHeaderGroups(),e.getRightHeaderGroups()],(e,t,n)=>{var i,r,o,s,l,a;return[...null!=(i=null==(r=e[0])?void 0:r.headers)?i:[],...null!=(o=null==(s=t[0])?void 0:s.headers)?o:[],...null!=(l=null==(a=n[0])?void 0:a.headers)?l:[]].map(e=>e.getLeafHeaders()).flat()},aA(e.options,ak,"getLeafHeaders"))}},{getInitialState:e=>({columnVisibility:{},...e}),getDefaultOptions:e=>({onColumnVisibilityChange:aw("columnVisibility",e)}),createColumn:(e,t)=>{e.toggleVisibility=n=>{e.getCanHide()&&t.setColumnVisibility(t=>({...t,[e.id]:null!=n?n:!e.getIsVisible()}))},e.getIsVisible=()=>{var n,i;let r=e.columns;return null==(n=r.length?r.some(e=>e.getIsVisible()):null==(i=t.getState().columnVisibility)?void 0:i[e.id])||n},e.getCanHide=()=>{var n,i;return(null==(n=e.columnDef.enableHiding)||n)&&(null==(i=t.options.enableHiding)||i)},e.getToggleVisibilityHandler=()=>t=>{null==e.toggleVisibility||e.toggleVisibility(t.target.checked)}},createRow:(e,t)=>{e._getAllVisibleCells=aC(()=>[e.getAllCells(),t.getState().columnVisibility],e=>e.filter(e=>e.column.getIsVisible()),aA(t.options,"debugRows","_getAllVisibleCells")),e.getVisibleCells=aC(()=>[e.getLeftVisibleCells(),e.getCenterVisibleCells(),e.getRightVisibleCells()],(e,t,n)=>[...e,...t,...n],aA(t.options,"debugRows","getVisibleCells"))},createTable:e=>{let t=(t,n)=>aC(()=>[n(),n().filter(e=>e.getIsVisible()).map(e=>e.id).join("_")],e=>e.filter(e=>null==e.getIsVisible?void 0:e.getIsVisible()),aA(e.options,"debugColumns",t));e.getVisibleFlatColumns=t("getVisibleFlatColumns",()=>e.getAllFlatColumns()),e.getVisibleLeafColumns=t("getVisibleLeafColumns",()=>e.getAllLeafColumns()),e.getLeftVisibleLeafColumns=t("getLeftVisibleLeafColumns",()=>e.getLeftLeafColumns()),e.getRightVisibleLeafColumns=t("getRightVisibleLeafColumns",()=>e.getRightLeafColumns()),e.getCenterVisibleLeafColumns=t("getCenterVisibleLeafColumns",()=>e.getCenterLeafColumns()),e.setColumnVisibility=t=>null==e.options.onColumnVisibilityChange?void 0:e.options.onColumnVisibilityChange(t),e.resetColumnVisibility=t=>{var n;e.setColumnVisibility(t?{}:null!=(n=e.initialState.columnVisibility)?n:{})},e.toggleAllColumnsVisible=t=>{var n;t=null!=(n=t)?n:!e.getIsAllColumnsVisible(),e.setColumnVisibility(e.getAllLeafColumns().reduce((e,n)=>({...e,[n.id]:t||!(null!=n.getCanHide&&n.getCanHide())}),{}))},e.getIsAllColumnsVisible=()=>!e.getAllLeafColumns().some(e=>!(null!=e.getIsVisible&&e.getIsVisible())),e.getIsSomeColumnsVisible=()=>e.getAllLeafColumns().some(e=>null==e.getIsVisible?void 0:e.getIsVisible()),e.getToggleAllColumnsVisibilityHandler=()=>t=>{var n;e.toggleAllColumnsVisible(null==(n=t.target)?void 0:n.checked)}}},{getInitialState:e=>({columnOrder:[],...e}),getDefaultOptions:e=>({onColumnOrderChange:aw("columnOrder",e)}),createColumn:(e,t)=>{e.getIndex=aC(e=>[aq(t,e)],t=>t.findIndex(t=>t.id===e.id),aA(t.options,"debugColumns","getIndex")),e.getIsFirstColumn=n=>{var i;return(null==(i=aq(t,n)[0])?void 0:i.id)===e.id},e.getIsLastColumn=n=>{var i;let r=aq(t,n);return(null==(i=r[r.length-1])?void 0:i.id)===e.id}},createTable:e=>{e.setColumnOrder=t=>null==e.options.onColumnOrderChange?void 0:e.options.onColumnOrderChange(t),e.resetColumnOrder=t=>{var n;e.setColumnOrder(t?[]:null!=(n=e.initialState.columnOrder)?n:[])},e._getOrderColumnsFn=aC(()=>[e.getState().columnOrder,e.getState().grouping,e.options.groupedColumnMode],(e,t,n)=>i=>{let r=[];if(null!=e&&e.length){let t=[...e],n=[...i];for(;n.length&&t.length;){let e=t.shift(),i=n.findIndex(t=>t.id===e);i>-1&&r.push(n.splice(i,1)[0])}r=[...r,...n]}else r=i;var o=r;if(!(null!=t&&t.length)||!n)return o;let s=o.filter(e=>!t.includes(e.id));return"remove"===n?s:[...t.map(e=>o.find(t=>t.id===e)).filter(Boolean),...s]},aA(e.options,"debugTable","_getOrderColumnsFn"))}},{getInitialState:e=>({columnPinning:aW(),...e}),getDefaultOptions:e=>({onColumnPinningChange:aw("columnPinning",e)}),createColumn:(e,t)=>{e.pin=n=>{let i=e.getLeafColumns().map(e=>e.id).filter(Boolean);t.setColumnPinning(e=>{var t,r,o,s,l,a;return"right"===n?{left:(null!=(o=null==e?void 0:e.left)?o:[]).filter(e=>!(null!=i&&i.includes(e))),right:[...(null!=(s=null==e?void 0:e.right)?s:[]).filter(e=>!(null!=i&&i.includes(e))),...i]}:"left"===n?{left:[...(null!=(l=null==e?void 0:e.left)?l:[]).filter(e=>!(null!=i&&i.includes(e))),...i],right:(null!=(a=null==e?void 0:e.right)?a:[]).filter(e=>!(null!=i&&i.includes(e)))}:{left:(null!=(t=null==e?void 0:e.left)?t:[]).filter(e=>!(null!=i&&i.includes(e))),right:(null!=(r=null==e?void 0:e.right)?r:[]).filter(e=>!(null!=i&&i.includes(e)))}})},e.getCanPin=()=>e.getLeafColumns().some(e=>{var n,i,r;return(null==(n=e.columnDef.enablePinning)||n)&&(null==(i=null!=(r=t.options.enableColumnPinning)?r:t.options.enablePinning)||i)}),e.getIsPinned=()=>{let n=e.getLeafColumns().map(e=>e.id),{left:i,right:r}=t.getState().columnPinning,o=n.some(e=>null==i?void 0:i.includes(e)),s=n.some(e=>null==r?void 0:r.includes(e));return o?"left":!!s&&"right"},e.getPinnedIndex=()=>{var n,i;let r=e.getIsPinned();return r?null!=(n=null==(i=t.getState().columnPinning)||null==(i=i[r])?void 0:i.indexOf(e.id))?n:-1:0}},createRow:(e,t)=>{e.getCenterVisibleCells=aC(()=>[e._getAllVisibleCells(),t.getState().columnPinning.left,t.getState().columnPinning.right],(e,t,n)=>{let i=[...null!=t?t:[],...null!=n?n:[]];return e.filter(e=>!i.includes(e.column.id))},aA(t.options,"debugRows","getCenterVisibleCells")),e.getLeftVisibleCells=aC(()=>[e._getAllVisibleCells(),t.getState().columnPinning.left],(e,t)=>(null!=t?t:[]).map(t=>e.find(e=>e.column.id===t)).filter(Boolean).map(e=>({...e,position:"left"})),aA(t.options,"debugRows","getLeftVisibleCells")),e.getRightVisibleCells=aC(()=>[e._getAllVisibleCells(),t.getState().columnPinning.right],(e,t)=>(null!=t?t:[]).map(t=>e.find(e=>e.column.id===t)).filter(Boolean).map(e=>({...e,position:"right"})),aA(t.options,"debugRows","getRightVisibleCells"))},createTable:e=>{e.setColumnPinning=t=>null==e.options.onColumnPinningChange?void 0:e.options.onColumnPinningChange(t),e.resetColumnPinning=t=>{var n,i;return e.setColumnPinning(t?aW():null!=(n=null==(i=e.initialState)?void 0:i.columnPinning)?n:aW())},e.getIsSomeColumnsPinned=t=>{var n,i,r;let o=e.getState().columnPinning;return t?!!(null==(n=o[t])?void 0:n.length):!!((null==(i=o.left)?void 0:i.length)||(null==(r=o.right)?void 0:r.length))},e.getLeftLeafColumns=aC(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left],(e,t)=>(null!=t?t:[]).map(t=>e.find(e=>e.id===t)).filter(Boolean),aA(e.options,"debugColumns","getLeftLeafColumns")),e.getRightLeafColumns=aC(()=>[e.getAllLeafColumns(),e.getState().columnPinning.right],(e,t)=>(null!=t?t:[]).map(t=>e.find(e=>e.id===t)).filter(Boolean),aA(e.options,"debugColumns","getRightLeafColumns")),e.getCenterLeafColumns=aC(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(e,t,n)=>{let i=[...null!=t?t:[],...null!=n?n:[]];return e.filter(e=>!i.includes(e.id))},aA(e.options,"debugColumns","getCenterLeafColumns"))}},{createColumn:(e,t)=>{e._getFacetedRowModel=t.options.getFacetedRowModel&&t.options.getFacetedRowModel(t,e.id),e.getFacetedRowModel=()=>e._getFacetedRowModel?e._getFacetedRowModel():t.getPreFilteredRowModel(),e._getFacetedUniqueValues=t.options.getFacetedUniqueValues&&t.options.getFacetedUniqueValues(t,e.id),e.getFacetedUniqueValues=()=>e._getFacetedUniqueValues?e._getFacetedUniqueValues():new Map,e._getFacetedMinMaxValues=t.options.getFacetedMinMaxValues&&t.options.getFacetedMinMaxValues(t,e.id),e.getFacetedMinMaxValues=()=>{if(e._getFacetedMinMaxValues)return e._getFacetedMinMaxValues()}}},{getDefaultColumnDef:()=>({filterFn:"auto"}),getInitialState:e=>({columnFilters:[],...e}),getDefaultOptions:e=>({onColumnFiltersChange:aw("columnFilters",e),filterFromLeafRows:!1,maxLeafRowFilterDepth:100}),createColumn:(e,t)=>{e.getAutoFilterFn=()=>{let n=t.getCoreRowModel().flatRows[0],i=null==n?void 0:n.getValue(e.id);return"string"==typeof i?aN.includesString:"number"==typeof i?aN.inNumberRange:"boolean"==typeof i||null!==i&&"object"==typeof i?aN.equals:Array.isArray(i)?aN.arrIncludes:aN.weakEquals},e.getFilterFn=()=>{var n,i;return aS(e.columnDef.filterFn)?e.columnDef.filterFn:"auto"===e.columnDef.filterFn?e.getAutoFilterFn():null!=(n=null==(i=t.options.filterFns)?void 0:i[e.columnDef.filterFn])?n:aN[e.columnDef.filterFn]},e.getCanFilter=()=>{var n,i,r;return(null==(n=e.columnDef.enableColumnFilter)||n)&&(null==(i=t.options.enableColumnFilters)||i)&&(null==(r=t.options.enableFilters)||r)&&!!e.accessorFn},e.getIsFiltered=()=>e.getFilterIndex()>-1,e.getFilterValue=()=>{var n;return null==(n=t.getState().columnFilters)||null==(n=n.find(t=>t.id===e.id))?void 0:n.value},e.getFilterIndex=()=>{var n,i;return null!=(n=null==(i=t.getState().columnFilters)?void 0:i.findIndex(t=>t.id===e.id))?n:-1},e.setFilterValue=n=>{t.setColumnFilters(t=>{var i,r;let o=e.getFilterFn(),s=null==t?void 0:t.find(t=>t.id===e.id),l=ay(n,s?s.value:void 0);if(aH(o,l,e))return null!=(i=null==t?void 0:t.filter(t=>t.id!==e.id))?i:[];let a={id:e.id,value:l};return s?null!=(r=null==t?void 0:t.map(t=>t.id===e.id?a:t))?r:[]:null!=t&&t.length?[...t,a]:[a]})}},createRow:(e,t)=>{e.columnFilters={},e.columnFiltersMeta={}},createTable:e=>{e.setColumnFilters=t=>{let n=e.getAllLeafColumns();null==e.options.onColumnFiltersChange||e.options.onColumnFiltersChange(e=>{var i;return null==(i=ay(t,e))?void 0:i.filter(e=>{let t=n.find(t=>t.id===e.id);return!(t&&aH(t.getFilterFn(),e.value,t))&&!0})})},e.resetColumnFilters=t=>{var n,i;e.setColumnFilters(t?[]:null!=(n=null==(i=e.initialState)?void 0:i.columnFilters)?n:[])},e.getPreFilteredRowModel=()=>e.getCoreRowModel(),e.getFilteredRowModel=()=>(!e._getFilteredRowModel&&e.options.getFilteredRowModel&&(e._getFilteredRowModel=e.options.getFilteredRowModel(e)),e.options.manualFiltering||!e._getFilteredRowModel)?e.getPreFilteredRowModel():e._getFilteredRowModel()}},{createTable:e=>{e._getGlobalFacetedRowModel=e.options.getFacetedRowModel&&e.options.getFacetedRowModel(e,"__global__"),e.getGlobalFacetedRowModel=()=>e.options.manualFiltering||!e._getGlobalFacetedRowModel?e.getPreFilteredRowModel():e._getGlobalFacetedRowModel(),e._getGlobalFacetedUniqueValues=e.options.getFacetedUniqueValues&&e.options.getFacetedUniqueValues(e,"__global__"),e.getGlobalFacetedUniqueValues=()=>e._getGlobalFacetedUniqueValues?e._getGlobalFacetedUniqueValues():new Map,e._getGlobalFacetedMinMaxValues=e.options.getFacetedMinMaxValues&&e.options.getFacetedMinMaxValues(e,"__global__"),e.getGlobalFacetedMinMaxValues=()=>{if(e._getGlobalFacetedMinMaxValues)return e._getGlobalFacetedMinMaxValues()}}},{getInitialState:e=>({globalFilter:void 0,...e}),getDefaultOptions:e=>({onGlobalFilterChange:aw("globalFilter",e),globalFilterFn:"auto",getColumnCanGlobalFilter:t=>{var n;let i=null==(n=e.getCoreRowModel().flatRows[0])||null==(n=n._getAllCellsByColumnId()[t.id])?void 0:n.getValue();return"string"==typeof i||"number"==typeof i}}),createColumn:(e,t)=>{e.getCanGlobalFilter=()=>{var n,i,r,o;return(null==(n=e.columnDef.enableGlobalFilter)||n)&&(null==(i=t.options.enableGlobalFilter)||i)&&(null==(r=t.options.enableFilters)||r)&&(null==(o=null==t.options.getColumnCanGlobalFilter?void 0:t.options.getColumnCanGlobalFilter(e))||o)&&!!e.accessorFn}},createTable:e=>{e.getGlobalAutoFilterFn=()=>aN.includesString,e.getGlobalFilterFn=()=>{var t,n;let{globalFilterFn:i}=e.options;return aS(i)?i:"auto"===i?e.getGlobalAutoFilterFn():null!=(t=null==(n=e.options.filterFns)?void 0:n[i])?t:aN[i]},e.setGlobalFilter=t=>{null==e.options.onGlobalFilterChange||e.options.onGlobalFilterChange(t)},e.resetGlobalFilter=t=>{e.setGlobalFilter(t?void 0:e.initialState.globalFilter)}}},{getInitialState:e=>({sorting:[],...e}),getDefaultColumnDef:()=>({sortingFn:"auto",sortUndefined:1}),getDefaultOptions:e=>({onSortingChange:aw("sorting",e),isMultiSortEvent:e=>e.shiftKey}),createColumn:(e,t)=>{e.getAutoSortingFn=()=>{let n=t.getFilteredRowModel().flatRows.slice(10),i=!1;for(let t of n){let n=null==t?void 0:t.getValue(e.id);if("[object Date]"===Object.prototype.toString.call(n))return a3.datetime;if("string"==typeof n&&(i=!0,n.split(a0).length>1))return a3.alphanumeric}return i?a3.text:a3.basic},e.getAutoSortDir=()=>{let n=t.getFilteredRowModel().flatRows[0];return"string"==typeof(null==n?void 0:n.getValue(e.id))?"asc":"desc"},e.getSortingFn=()=>{var n,i;if(!e)throw Error();return aS(e.columnDef.sortingFn)?e.columnDef.sortingFn:"auto"===e.columnDef.sortingFn?e.getAutoSortingFn():null!=(n=null==(i=t.options.sortingFns)?void 0:i[e.columnDef.sortingFn])?n:a3[e.columnDef.sortingFn]},e.toggleSorting=(n,i)=>{let r=e.getNextSortingOrder(),o=null!=n;t.setSorting(s=>{let l,a=null==s?void 0:s.find(t=>t.id===e.id),u=null==s?void 0:s.findIndex(t=>t.id===e.id),c=[],h=o?n:"desc"===r;if("toggle"!=(l=null!=s&&s.length&&e.getCanMultiSort()&&i?a?"toggle":"add":null!=s&&s.length&&u!==s.length-1?"replace":a?"toggle":"replace")||o||r||(l="remove"),"add"===l){var d;(c=[...s,{id:e.id,desc:h}]).splice(0,c.length-(null!=(d=t.options.maxMultiSortColCount)?d:Number.MAX_SAFE_INTEGER))}else c="toggle"===l?s.map(t=>t.id===e.id?{...t,desc:h}:t):"remove"===l?s.filter(t=>t.id!==e.id):[{id:e.id,desc:h}];return c})},e.getFirstSortDir=()=>{var n,i;return(null!=(n=null!=(i=e.columnDef.sortDescFirst)?i:t.options.sortDescFirst)?n:"desc"===e.getAutoSortDir())?"desc":"asc"},e.getNextSortingOrder=n=>{var i,r;let o=e.getFirstSortDir(),s=e.getIsSorted();return s?(s===o||null!=(i=t.options.enableSortingRemoval)&&!i||!!n&&null!=(r=t.options.enableMultiRemove)&&!r)&&("desc"===s?"asc":"desc"):o},e.getCanSort=()=>{var n,i;return(null==(n=e.columnDef.enableSorting)||n)&&(null==(i=t.options.enableSorting)||i)&&!!e.accessorFn},e.getCanMultiSort=()=>{var n,i;return null!=(n=null!=(i=e.columnDef.enableMultiSort)?i:t.options.enableMultiSort)?n:!!e.accessorFn},e.getIsSorted=()=>{var n;let i=null==(n=t.getState().sorting)?void 0:n.find(t=>t.id===e.id);return!!i&&(i.desc?"desc":"asc")},e.getSortIndex=()=>{var n,i;return null!=(n=null==(i=t.getState().sorting)?void 0:i.findIndex(t=>t.id===e.id))?n:-1},e.clearSorting=()=>{t.setSorting(t=>null!=t&&t.length?t.filter(t=>t.id!==e.id):[])},e.getToggleSortingHandler=()=>{let n=e.getCanSort();return i=>{n&&(null==i.persist||i.persist(),null==e.toggleSorting||e.toggleSorting(void 0,!!e.getCanMultiSort()&&(null==t.options.isMultiSortEvent?void 0:t.options.isMultiSortEvent(i))))}}},createTable:e=>{e.setSorting=t=>null==e.options.onSortingChange?void 0:e.options.onSortingChange(t),e.resetSorting=t=>{var n,i;e.setSorting(t?[]:null!=(n=null==(i=e.initialState)?void 0:i.sorting)?n:[])},e.getPreSortedRowModel=()=>e.getGroupedRowModel(),e.getSortedRowModel=()=>(!e._getSortedRowModel&&e.options.getSortedRowModel&&(e._getSortedRowModel=e.options.getSortedRowModel(e)),e.options.manualSorting||!e._getSortedRowModel)?e.getPreSortedRowModel():e._getSortedRowModel()}},{getDefaultColumnDef:()=>({aggregatedCell:e=>{var t,n;return null!=(t=null==(n=e.getValue())||null==n.toString?void 0:n.toString())?t:null},aggregationFn:"auto"}),getInitialState:e=>({grouping:[],...e}),getDefaultOptions:e=>({onGroupingChange:aw("grouping",e),groupedColumnMode:"reorder"}),createColumn:(e,t)=>{e.toggleGrouping=()=>{t.setGrouping(t=>null!=t&&t.includes(e.id)?t.filter(t=>t!==e.id):[...null!=t?t:[],e.id])},e.getCanGroup=()=>{var n,i;return(null==(n=e.columnDef.enableGrouping)||n)&&(null==(i=t.options.enableGrouping)||i)&&(!!e.accessorFn||!!e.columnDef.getGroupingValue)},e.getIsGrouped=()=>{var n;return null==(n=t.getState().grouping)?void 0:n.includes(e.id)},e.getGroupedIndex=()=>{var n;return null==(n=t.getState().grouping)?void 0:n.indexOf(e.id)},e.getToggleGroupingHandler=()=>{let t=e.getCanGroup();return()=>{t&&e.toggleGrouping()}},e.getAutoAggregationFn=()=>{let n=t.getCoreRowModel().flatRows[0],i=null==n?void 0:n.getValue(e.id);return"number"==typeof i?az.sum:"[object Date]"===Object.prototype.toString.call(i)?az.extent:void 0},e.getAggregationFn=()=>{var n,i;if(!e)throw Error();return aS(e.columnDef.aggregationFn)?e.columnDef.aggregationFn:"auto"===e.columnDef.aggregationFn?e.getAutoAggregationFn():null!=(n=null==(i=t.options.aggregationFns)?void 0:i[e.columnDef.aggregationFn])?n:az[e.columnDef.aggregationFn]}},createTable:e=>{e.setGrouping=t=>null==e.options.onGroupingChange?void 0:e.options.onGroupingChange(t),e.resetGrouping=t=>{var n,i;e.setGrouping(t?[]:null!=(n=null==(i=e.initialState)?void 0:i.grouping)?n:[])},e.getPreGroupedRowModel=()=>e.getFilteredRowModel(),e.getGroupedRowModel=()=>(!e._getGroupedRowModel&&e.options.getGroupedRowModel&&(e._getGroupedRowModel=e.options.getGroupedRowModel(e)),e.options.manualGrouping||!e._getGroupedRowModel)?e.getPreGroupedRowModel():e._getGroupedRowModel()},createRow:(e,t)=>{e.getIsGrouped=()=>!!e.groupingColumnId,e.getGroupingValue=n=>{if(e._groupingValuesCache.hasOwnProperty(n))return e._groupingValuesCache[n];let i=t.getColumn(n);return null!=i&&i.columnDef.getGroupingValue?(e._groupingValuesCache[n]=i.columnDef.getGroupingValue(e.original),e._groupingValuesCache[n]):e.getValue(n)},e._groupingValuesCache={}},createCell:(e,t,n,i)=>{e.getIsGrouped=()=>t.getIsGrouped()&&t.id===n.groupingColumnId,e.getIsPlaceholder=()=>!e.getIsGrouped()&&t.getIsGrouped(),e.getIsAggregated=()=>{var t;return!e.getIsGrouped()&&!e.getIsPlaceholder()&&!!(null!=(t=n.subRows)&&t.length)}}},{getInitialState:e=>({expanded:{},...e}),getDefaultOptions:e=>({onExpandedChange:aw("expanded",e),paginateExpandedRows:!0}),createTable:e=>{let t=!1,n=!1;e._autoResetExpanded=()=>{var i,r;if(!t)return void e._queue(()=>{t=!0});if(null!=(i=null!=(r=e.options.autoResetAll)?r:e.options.autoResetExpanded)?i:!e.options.manualExpanding){if(n)return;n=!0,e._queue(()=>{e.resetExpanded(),n=!1})}},e.setExpanded=t=>null==e.options.onExpandedChange?void 0:e.options.onExpandedChange(t),e.toggleAllRowsExpanded=t=>{(null!=t?t:!e.getIsAllRowsExpanded())?e.setExpanded(!0):e.setExpanded({})},e.resetExpanded=t=>{var n,i;e.setExpanded(t?{}:null!=(n=null==(i=e.initialState)?void 0:i.expanded)?n:{})},e.getCanSomeRowsExpand=()=>e.getPrePaginationRowModel().flatRows.some(e=>e.getCanExpand()),e.getToggleAllRowsExpandedHandler=()=>t=>{null==t.persist||t.persist(),e.toggleAllRowsExpanded()},e.getIsSomeRowsExpanded=()=>{let t=e.getState().expanded;return!0===t||Object.values(t).some(Boolean)},e.getIsAllRowsExpanded=()=>{let t=e.getState().expanded;return"boolean"==typeof t?!0===t:!(!Object.keys(t).length||e.getRowModel().flatRows.some(e=>!e.getIsExpanded()))},e.getExpandedDepth=()=>{let t=0;return(!0===e.getState().expanded?Object.keys(e.getRowModel().rowsById):Object.keys(e.getState().expanded)).forEach(e=>{let n=e.split(".");t=Math.max(t,n.length)}),t},e.getPreExpandedRowModel=()=>e.getSortedRowModel(),e.getExpandedRowModel=()=>(!e._getExpandedRowModel&&e.options.getExpandedRowModel&&(e._getExpandedRowModel=e.options.getExpandedRowModel(e)),e.options.manualExpanding||!e._getExpandedRowModel)?e.getPreExpandedRowModel():e._getExpandedRowModel()},createRow:(e,t)=>{e.toggleExpanded=n=>{t.setExpanded(i=>{var r;let o=!0===i||!!(null!=i&&i[e.id]),s={};if(!0===i?Object.keys(t.getRowModel().rowsById).forEach(e=>{s[e]=!0}):s=i,n=null!=(r=n)?r:!o,!o&&n)return{...s,[e.id]:!0};if(o&&!n){let{[e.id]:t,...n}=s;return n}return i})},e.getIsExpanded=()=>{var n;let i=t.getState().expanded;return!!(null!=(n=null==t.options.getIsRowExpanded?void 0:t.options.getIsRowExpanded(e))?n:!0===i||(null==i?void 0:i[e.id]))},e.getCanExpand=()=>{var n,i,r;return null!=(n=null==t.options.getRowCanExpand?void 0:t.options.getRowCanExpand(e))?n:(null==(i=t.options.enableExpanding)||i)&&!!(null!=(r=e.subRows)&&r.length)},e.getIsAllParentsExpanded=()=>{let n=!0,i=e;for(;n&&i.parentId;)n=(i=t.getRow(i.parentId,!0)).getIsExpanded();return n},e.getToggleExpandedHandler=()=>{let t=e.getCanExpand();return()=>{t&&e.toggleExpanded()}}}},{getInitialState:e=>({...e,pagination:{...aY(),...null==e?void 0:e.pagination}}),getDefaultOptions:e=>({onPaginationChange:aw("pagination",e)}),createTable:e=>{let t=!1,n=!1;e._autoResetPageIndex=()=>{var i,r;if(!t)return void e._queue(()=>{t=!0});if(null!=(i=null!=(r=e.options.autoResetAll)?r:e.options.autoResetPageIndex)?i:!e.options.manualPagination){if(n)return;n=!0,e._queue(()=>{e.resetPageIndex(),n=!1})}},e.setPagination=t=>null==e.options.onPaginationChange?void 0:e.options.onPaginationChange(e=>ay(t,e)),e.resetPagination=t=>{var n;e.setPagination(t?aY():null!=(n=e.initialState.pagination)?n:aY())},e.setPageIndex=t=>{e.setPagination(n=>{let i=ay(t,n.pageIndex);return i=Math.max(0,Math.min(i,void 0===e.options.pageCount||-1===e.options.pageCount?Number.MAX_SAFE_INTEGER:e.options.pageCount-1)),{...n,pageIndex:i}})},e.resetPageIndex=t=>{var n,i;e.setPageIndex(t?0:null!=(n=null==(i=e.initialState)||null==(i=i.pagination)?void 0:i.pageIndex)?n:0)},e.resetPageSize=t=>{var n,i;e.setPageSize(t?10:null!=(n=null==(i=e.initialState)||null==(i=i.pagination)?void 0:i.pageSize)?n:10)},e.setPageSize=t=>{e.setPagination(e=>{let n=Math.max(1,ay(t,e.pageSize)),i=Math.floor(e.pageSize*e.pageIndex/n);return{...e,pageIndex:i,pageSize:n}})},e.setPageCount=t=>e.setPagination(n=>{var i;let r=ay(t,null!=(i=e.options.pageCount)?i:-1);return"number"==typeof r&&(r=Math.max(-1,r)),{...n,pageCount:r}}),e.getPageOptions=aC(()=>[e.getPageCount()],e=>{let t=[];return e&&e>0&&(t=[...Array(e)].fill(null).map((e,t)=>t)),t},aA(e.options,"debugTable","getPageOptions")),e.getCanPreviousPage=()=>e.getState().pagination.pageIndex>0,e.getCanNextPage=()=>{let{pageIndex:t}=e.getState().pagination,n=e.getPageCount();return -1===n||0!==n&&t<n-1},e.previousPage=()=>e.setPageIndex(e=>e-1),e.nextPage=()=>e.setPageIndex(e=>e+1),e.firstPage=()=>e.setPageIndex(0),e.lastPage=()=>e.setPageIndex(e.getPageCount()-1),e.getPrePaginationRowModel=()=>e.getExpandedRowModel(),e.getPaginationRowModel=()=>(!e._getPaginationRowModel&&e.options.getPaginationRowModel&&(e._getPaginationRowModel=e.options.getPaginationRowModel(e)),e.options.manualPagination||!e._getPaginationRowModel)?e.getPrePaginationRowModel():e._getPaginationRowModel(),e.getPageCount=()=>{var t;return null!=(t=e.options.pageCount)?t:Math.ceil(e.getRowCount()/e.getState().pagination.pageSize)},e.getRowCount=()=>{var t;return null!=(t=e.options.rowCount)?t:e.getPrePaginationRowModel().rows.length}}},{getInitialState:e=>({rowPinning:aK(),...e}),getDefaultOptions:e=>({onRowPinningChange:aw("rowPinning",e)}),createRow:(e,t)=>{e.pin=(n,i,r)=>{let o=i?e.getLeafRows().map(e=>{let{id:t}=e;return t}):[],s=new Set([...r?e.getParentRows().map(e=>{let{id:t}=e;return t}):[],e.id,...o]);t.setRowPinning(e=>{var t,i,r,o,l,a;return"bottom"===n?{top:(null!=(r=null==e?void 0:e.top)?r:[]).filter(e=>!(null!=s&&s.has(e))),bottom:[...(null!=(o=null==e?void 0:e.bottom)?o:[]).filter(e=>!(null!=s&&s.has(e))),...Array.from(s)]}:"top"===n?{top:[...(null!=(l=null==e?void 0:e.top)?l:[]).filter(e=>!(null!=s&&s.has(e))),...Array.from(s)],bottom:(null!=(a=null==e?void 0:e.bottom)?a:[]).filter(e=>!(null!=s&&s.has(e)))}:{top:(null!=(t=null==e?void 0:e.top)?t:[]).filter(e=>!(null!=s&&s.has(e))),bottom:(null!=(i=null==e?void 0:e.bottom)?i:[]).filter(e=>!(null!=s&&s.has(e)))}})},e.getCanPin=()=>{var n;let{enableRowPinning:i,enablePinning:r}=t.options;return"function"==typeof i?i(e):null==(n=null!=i?i:r)||n},e.getIsPinned=()=>{let n=[e.id],{top:i,bottom:r}=t.getState().rowPinning,o=n.some(e=>null==i?void 0:i.includes(e)),s=n.some(e=>null==r?void 0:r.includes(e));return o?"top":!!s&&"bottom"},e.getPinnedIndex=()=>{var n,i;let r=e.getIsPinned();if(!r)return -1;let o=null==(n="top"===r?t.getTopRows():t.getBottomRows())?void 0:n.map(e=>{let{id:t}=e;return t});return null!=(i=null==o?void 0:o.indexOf(e.id))?i:-1}},createTable:e=>{e.setRowPinning=t=>null==e.options.onRowPinningChange?void 0:e.options.onRowPinningChange(t),e.resetRowPinning=t=>{var n,i;return e.setRowPinning(t?aK():null!=(n=null==(i=e.initialState)?void 0:i.rowPinning)?n:aK())},e.getIsSomeRowsPinned=t=>{var n,i,r;let o=e.getState().rowPinning;return t?!!(null==(n=o[t])?void 0:n.length):!!((null==(i=o.top)?void 0:i.length)||(null==(r=o.bottom)?void 0:r.length))},e._getPinnedRows=(t,n,i)=>{var r;return(null==(r=e.options.keepPinnedRows)||r?(null!=n?n:[]).map(t=>{let n=e.getRow(t,!0);return n.getIsAllParentsExpanded()?n:null}):(null!=n?n:[]).map(e=>t.find(t=>t.id===e))).filter(Boolean).map(e=>({...e,position:i}))},e.getTopRows=aC(()=>[e.getRowModel().rows,e.getState().rowPinning.top],(t,n)=>e._getPinnedRows(t,n,"top"),aA(e.options,"debugRows","getTopRows")),e.getBottomRows=aC(()=>[e.getRowModel().rows,e.getState().rowPinning.bottom],(t,n)=>e._getPinnedRows(t,n,"bottom"),aA(e.options,"debugRows","getBottomRows")),e.getCenterRows=aC(()=>[e.getRowModel().rows,e.getState().rowPinning.top,e.getState().rowPinning.bottom],(e,t,n)=>{let i=new Set([...null!=t?t:[],...null!=n?n:[]]);return e.filter(e=>!i.has(e.id))},aA(e.options,"debugRows","getCenterRows"))}},{getInitialState:e=>({rowSelection:{},...e}),getDefaultOptions:e=>({onRowSelectionChange:aw("rowSelection",e),enableRowSelection:!0,enableMultiRowSelection:!0,enableSubRowSelection:!0}),createTable:e=>{e.setRowSelection=t=>null==e.options.onRowSelectionChange?void 0:e.options.onRowSelectionChange(t),e.resetRowSelection=t=>{var n;return e.setRowSelection(t?{}:null!=(n=e.initialState.rowSelection)?n:{})},e.toggleAllRowsSelected=t=>{e.setRowSelection(n=>{t=void 0!==t?t:!e.getIsAllRowsSelected();let i={...n},r=e.getPreGroupedRowModel().flatRows;return t?r.forEach(e=>{e.getCanSelect()&&(i[e.id]=!0)}):r.forEach(e=>{delete i[e.id]}),i})},e.toggleAllPageRowsSelected=t=>e.setRowSelection(n=>{let i=void 0!==t?t:!e.getIsAllPageRowsSelected(),r={...n};return e.getRowModel().rows.forEach(t=>{aX(r,t.id,i,!0,e)}),r}),e.getPreSelectedRowModel=()=>e.getCoreRowModel(),e.getSelectedRowModel=aC(()=>[e.getState().rowSelection,e.getCoreRowModel()],(t,n)=>Object.keys(t).length?aZ(e,n):{rows:[],flatRows:[],rowsById:{}},aA(e.options,"debugTable","getSelectedRowModel")),e.getFilteredSelectedRowModel=aC(()=>[e.getState().rowSelection,e.getFilteredRowModel()],(t,n)=>Object.keys(t).length?aZ(e,n):{rows:[],flatRows:[],rowsById:{}},aA(e.options,"debugTable","getFilteredSelectedRowModel")),e.getGroupedSelectedRowModel=aC(()=>[e.getState().rowSelection,e.getSortedRowModel()],(t,n)=>Object.keys(t).length?aZ(e,n):{rows:[],flatRows:[],rowsById:{}},aA(e.options,"debugTable","getGroupedSelectedRowModel")),e.getIsAllRowsSelected=()=>{let t=e.getFilteredRowModel().flatRows,{rowSelection:n}=e.getState(),i=!!(t.length&&Object.keys(n).length);return i&&t.some(e=>e.getCanSelect()&&!n[e.id])&&(i=!1),i},e.getIsAllPageRowsSelected=()=>{let t=e.getPaginationRowModel().flatRows.filter(e=>e.getCanSelect()),{rowSelection:n}=e.getState(),i=!!t.length;return i&&t.some(e=>!n[e.id])&&(i=!1),i},e.getIsSomeRowsSelected=()=>{var t;let n=Object.keys(null!=(t=e.getState().rowSelection)?t:{}).length;return n>0&&n<e.getFilteredRowModel().flatRows.length},e.getIsSomePageRowsSelected=()=>{let t=e.getPaginationRowModel().flatRows;return!e.getIsAllPageRowsSelected()&&t.filter(e=>e.getCanSelect()).some(e=>e.getIsSelected()||e.getIsSomeSelected())},e.getToggleAllRowsSelectedHandler=()=>t=>{e.toggleAllRowsSelected(t.target.checked)},e.getToggleAllPageRowsSelectedHandler=()=>t=>{e.toggleAllPageRowsSelected(t.target.checked)}},createRow:(e,t)=>{e.toggleSelected=(n,i)=>{let r=e.getIsSelected();t.setRowSelection(o=>{var s;if(n=void 0!==n?n:!r,e.getCanSelect()&&r===n)return o;let l={...o};return aX(l,e.id,n,null==(s=null==i?void 0:i.selectChildren)||s,t),l})},e.getIsSelected=()=>{let{rowSelection:n}=t.getState();return aQ(e,n)},e.getIsSomeSelected=()=>{let{rowSelection:n}=t.getState();return"some"===aJ(e,n)},e.getIsAllSubRowsSelected=()=>{let{rowSelection:n}=t.getState();return"all"===aJ(e,n)},e.getCanSelect=()=>{var n;return"function"==typeof t.options.enableRowSelection?t.options.enableRowSelection(e):null==(n=t.options.enableRowSelection)||n},e.getCanSelectSubRows=()=>{var n;return"function"==typeof t.options.enableSubRowSelection?t.options.enableSubRowSelection(e):null==(n=t.options.enableSubRowSelection)||n},e.getCanMultiSelect=()=>{var n;return"function"==typeof t.options.enableMultiRowSelection?t.options.enableMultiRowSelection(e):null==(n=t.options.enableMultiRowSelection)||n},e.getToggleSelectedHandler=()=>{let t=e.getCanSelect();return n=>{var i;t&&e.toggleSelected(null==(i=n.target)?void 0:i.checked)}}}},{getDefaultColumnDef:()=>a$,getInitialState:e=>({columnSizing:{},columnSizingInfo:a_(),...e}),getDefaultOptions:e=>({columnResizeMode:"onEnd",columnResizeDirection:"ltr",onColumnSizingChange:aw("columnSizing",e),onColumnSizingInfoChange:aw("columnSizingInfo",e)}),createColumn:(e,t)=>{e.getSize=()=>{var n,i,r;let o=t.getState().columnSizing[e.id];return Math.min(Math.max(null!=(n=e.columnDef.minSize)?n:a$.minSize,null!=(i=null!=o?o:e.columnDef.size)?i:a$.size),null!=(r=e.columnDef.maxSize)?r:a$.maxSize)},e.getStart=aC(e=>[e,aq(t,e),t.getState().columnSizing],(t,n)=>n.slice(0,e.getIndex(t)).reduce((e,t)=>e+t.getSize(),0),aA(t.options,"debugColumns","getStart")),e.getAfter=aC(e=>[e,aq(t,e),t.getState().columnSizing],(t,n)=>n.slice(e.getIndex(t)+1).reduce((e,t)=>e+t.getSize(),0),aA(t.options,"debugColumns","getAfter")),e.resetSize=()=>{t.setColumnSizing(t=>{let{[e.id]:n,...i}=t;return i})},e.getCanResize=()=>{var n,i;return(null==(n=e.columnDef.enableResizing)||n)&&(null==(i=t.options.enableColumnResizing)||i)},e.getIsResizing=()=>t.getState().columnSizingInfo.isResizingColumn===e.id},createHeader:(e,t)=>{e.getSize=()=>{let t=0,n=e=>{if(e.subHeaders.length)e.subHeaders.forEach(n);else{var i;t+=null!=(i=e.column.getSize())?i:0}};return n(e),t},e.getStart=()=>{if(e.index>0){let t=e.headerGroup.headers[e.index-1];return t.getStart()+t.getSize()}return 0},e.getResizeHandler=n=>{let i=t.getColumn(e.column.id),r=null==i?void 0:i.getCanResize();return o=>{if(!i||!r||(null==o.persist||o.persist(),aG(o)&&o.touches&&o.touches.length>1))return;let s=e.getSize(),l=e?e.getLeafHeaders().map(e=>[e.column.id,e.column.getSize()]):[[i.id,i.getSize()]],a=aG(o)?Math.round(o.touches[0].clientX):o.clientX,u={},c=(e,n)=>{"number"==typeof n&&(t.setColumnSizingInfo(e=>{var i,r;let o="rtl"===t.options.columnResizeDirection?-1:1,s=(n-(null!=(i=null==e?void 0:e.startOffset)?i:0))*o,l=Math.max(s/(null!=(r=null==e?void 0:e.startSize)?r:0),-.999999);return e.columnSizingStart.forEach(e=>{let[t,n]=e;u[t]=Math.round(100*Math.max(n+n*l,0))/100}),{...e,deltaOffset:s,deltaPercentage:l}}),("onChange"===t.options.columnResizeMode||"end"===e)&&t.setColumnSizing(e=>({...e,...u})))},h=e=>{c("end",e),t.setColumnSizingInfo(e=>({...e,isResizingColumn:!1,startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,columnSizingStart:[]}))},d=n||("u">typeof document?document:null),f={moveHandler:e=>c("move",e.clientX),upHandler:e=>{null==d||d.removeEventListener("mousemove",f.moveHandler),null==d||d.removeEventListener("mouseup",f.upHandler),h(e.clientX)}},p={moveHandler:e=>(e.cancelable&&(e.preventDefault(),e.stopPropagation()),c("move",e.touches[0].clientX),!1),upHandler:e=>{var t;null==d||d.removeEventListener("touchmove",p.moveHandler),null==d||d.removeEventListener("touchend",p.upHandler),e.cancelable&&(e.preventDefault(),e.stopPropagation()),h(null==(t=e.touches[0])?void 0:t.clientX)}},m=!!function(){if("boolean"==typeof aU)return aU;let e=!1;try{let t=()=>{};window.addEventListener("test",t,{get passive(){return e=!0,!1}}),window.removeEventListener("test",t)}catch(t){e=!1}return aU=e}()&&{passive:!1};aG(o)?(null==d||d.addEventListener("touchmove",p.moveHandler,m),null==d||d.addEventListener("touchend",p.upHandler,m)):(null==d||d.addEventListener("mousemove",f.moveHandler,m),null==d||d.addEventListener("mouseup",f.upHandler,m)),t.setColumnSizingInfo(e=>({...e,startOffset:a,startSize:s,deltaOffset:0,deltaPercentage:0,columnSizingStart:l,isResizingColumn:i.id}))}}},createTable:e=>{e.setColumnSizing=t=>null==e.options.onColumnSizingChange?void 0:e.options.onColumnSizingChange(t),e.setColumnSizingInfo=t=>null==e.options.onColumnSizingInfoChange?void 0:e.options.onColumnSizingInfoChange(t),e.resetColumnSizing=t=>{var n;e.setColumnSizing(t?{}:null!=(n=e.initialState.columnSizing)?n:{})},e.resetHeaderSizeInfo=t=>{var n;e.setColumnSizingInfo(t?a_():null!=(n=e.initialState.columnSizingInfo)?n:a_())},e.getTotalSize=()=>{var t,n;return null!=(t=null==(n=e.getHeaderGroups()[0])?void 0:n.headers.reduce((e,t)=>e+t.getSize(),0))?t:0},e.getLeftTotalSize=()=>{var t,n;return null!=(t=null==(n=e.getLeftHeaderGroups()[0])?void 0:n.headers.reduce((e,t)=>e+t.getSize(),0))?t:0},e.getCenterTotalSize=()=>{var t,n;return null!=(t=null==(n=e.getCenterHeaderGroups()[0])?void 0:n.headers.reduce((e,t)=>e+t.getSize(),0))?t:0},e.getRightTotalSize=()=>{var t,n;return null!=(t=null==(n=e.getRightHeaderGroups()[0])?void 0:n.headers.reduce((e,t)=>e+t.getSize(),0))?t:0}}}];function a6(e){let t=[],n=e=>{var i;t.push(e),null!=(i=e.subRows)&&i.length&&e.getIsExpanded()&&e.subRows.forEach(n)};return e.rows.forEach(n),{rows:t,flatRows:e.flatRows,rowsById:e.rowsById}}let a8={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",Ấ:"A",Ắ:"A",Ẳ:"A",Ẵ:"A",Ặ:"A",Æ:"AE",Ầ:"A",Ằ:"A",Ȃ:"A",Ç:"C",Ḉ:"C",È:"E",É:"E",Ê:"E",Ë:"E",Ế:"E",Ḗ:"E",Ề:"E",Ḕ:"E",Ḝ:"E",Ȇ:"E",Ì:"I",Í:"I",Î:"I",Ï:"I",Ḯ:"I",Ȋ:"I",Ð:"D",Ñ:"N",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",Ố:"O",Ṍ:"O",Ṓ:"O",Ȏ:"O",Ù:"U",Ú:"U",Û:"U",Ü:"U",Ý:"Y",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",ấ:"a",ắ:"a",ẳ:"a",ẵ:"a",ặ:"a",æ:"ae",ầ:"a",ằ:"a",ȃ:"a",ç:"c",ḉ:"c",è:"e",é:"e",ê:"e",ë:"e",ế:"e",ḗ:"e",ề:"e",ḕ:"e",ḝ:"e",ȇ:"e",ì:"i",í:"i",î:"i",ï:"i",ḯ:"i",ȋ:"i",ð:"d",ñ:"n",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",ố:"o",ṍ:"o",ṓ:"o",ȏ:"o",ù:"u",ú:"u",û:"u",ü:"u",ý:"y",ÿ:"y",Ā:"A",ā:"a",Ă:"A",ă:"a",Ą:"A",ą:"a",Ć:"C",ć:"c",Ĉ:"C",ĉ:"c",Ċ:"C",ċ:"c",Č:"C",č:"c",C̆:"C",c̆:"c",Ď:"D",ď:"d",Đ:"D",đ:"d",Ē:"E",ē:"e",Ĕ:"E",ĕ:"e",Ė:"E",ė:"e",Ę:"E",ę:"e",Ě:"E",ě:"e",Ĝ:"G",Ǵ:"G",ĝ:"g",ǵ:"g",Ğ:"G",ğ:"g",Ġ:"G",ġ:"g",Ģ:"G",ģ:"g",Ĥ:"H",ĥ:"h",Ħ:"H",ħ:"h",Ḫ:"H",ḫ:"h",Ĩ:"I",ĩ:"i",Ī:"I",ī:"i",Ĭ:"I",ĭ:"i",Į:"I",į:"i",İ:"I",ı:"i",IJ:"IJ",ij:"ij",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",Ḱ:"K",ḱ:"k",K̆:"K",k̆:"k",Ĺ:"L",ĺ:"l",Ļ:"L",ļ:"l",Ľ:"L",ľ:"l",Ŀ:"L",ŀ:"l",Ł:"l",ł:"l",Ḿ:"M",ḿ:"m",M̆:"M",m̆:"m",Ń:"N",ń:"n",Ņ:"N",ņ:"n",Ň:"N",ň:"n",ʼn:"n",N̆:"N",n̆:"n",Ō:"O",ō:"o",Ŏ:"O",ŏ:"o",Ő:"O",ő:"o",Œ:"OE",œ:"oe",P̆:"P",p̆:"p",Ŕ:"R",ŕ:"r",Ŗ:"R",ŗ:"r",Ř:"R",ř:"r",R̆:"R",r̆:"r",Ȓ:"R",ȓ:"r",Ś:"S",ś:"s",Ŝ:"S",ŝ:"s",Ş:"S",Ș:"S",ș:"s",ş:"s",Š:"S",š:"s",Ţ:"T",ţ:"t",ț:"t",Ț:"T",Ť:"T",ť:"t",Ŧ:"T",ŧ:"t",T̆:"T",t̆:"t",Ũ:"U",ũ:"u",Ū:"U",ū:"u",Ŭ:"U",ŭ:"u",Ů:"U",ů:"u",Ű:"U",ű:"u",Ų:"U",ų:"u",Ȗ:"U",ȗ:"u",V̆:"V",v̆:"v",Ŵ:"W",ŵ:"w",Ẃ:"W",ẃ:"w",X̆:"X",x̆:"x",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Y̆:"Y",y̆:"y",Ź:"Z",ź:"z",Ż:"Z",ż:"z",Ž:"Z",ž:"z",ſ:"s",ƒ:"f",Ơ:"O",ơ:"o",Ư:"U",ư:"u",Ǎ:"A",ǎ:"a",Ǐ:"I",ǐ:"i",Ǒ:"O",ǒ:"o",Ǔ:"U",ǔ:"u",Ǖ:"U",ǖ:"u",Ǘ:"U",ǘ:"u",Ǚ:"U",ǚ:"u",Ǜ:"U",ǜ:"u",Ứ:"U",ứ:"u",Ṹ:"U",ṹ:"u",Ǻ:"A",ǻ:"a",Ǽ:"AE",ǽ:"ae",Ǿ:"O",ǿ:"o",Þ:"TH",þ:"th",Ṕ:"P",ṕ:"p",Ṥ:"S",ṥ:"s",X́:"X",x́:"x",Ѓ:"Г",ѓ:"г",Ќ:"К",ќ:"к",A̋:"A",a̋:"a",E̋:"E",e̋:"e",I̋:"I",i̋:"i",Ǹ:"N",ǹ:"n",Ồ:"O",ồ:"o",Ṑ:"O",ṑ:"o",Ừ:"U",ừ:"u",Ẁ:"W",ẁ:"w",Ỳ:"Y",ỳ:"y",Ȁ:"A",ȁ:"a",Ȅ:"E",ȅ:"e",Ȉ:"I",ȉ:"i",Ȍ:"O",ȍ:"o",Ȑ:"R",ȑ:"r",Ȕ:"U",ȕ:"u",B̌:"B",b̌:"b",Č̣:"C",č̣:"c",Ê̌:"E",ê̌:"e",F̌:"F",f̌:"f",Ǧ:"G",ǧ:"g",Ȟ:"H",ȟ:"h",J̌:"J",ǰ:"j",Ǩ:"K",ǩ:"k",M̌:"M",m̌:"m",P̌:"P",p̌:"p",Q̌:"Q",q̌:"q",Ř̩:"R",ř̩:"r",Ṧ:"S",ṧ:"s",V̌:"V",v̌:"v",W̌:"W",w̌:"w",X̌:"X",x̌:"x",Y̌:"Y",y̌:"y",A̧:"A",a̧:"a",B̧:"B",b̧:"b",Ḑ:"D",ḑ:"d",Ȩ:"E",ȩ:"e",Ɛ̧:"E",ɛ̧:"e",Ḩ:"H",ḩ:"h",I̧:"I",i̧:"i",Ɨ̧:"I",ɨ̧:"i",M̧:"M",m̧:"m",O̧:"O",o̧:"o",Q̧:"Q",q̧:"q",U̧:"U",u̧:"u",X̧:"X",x̧:"x",Z̧:"Z",z̧:"z"},a9=RegExp(Object.keys(a8).join("|"),"g"),a7={CASE_SENSITIVE_EQUAL:7,EQUAL:6,STARTS_WITH:5,WORD_STARTS_WITH:4,CONTAINS:3,ACRONYM:2,MATCHES:1,NO_MATCH:0};function ue(e,t,n){let i;return(e=ut(e,n),(t=ut(t,n)).length>e.length)?a7.NO_MATCH:e===t?a7.CASE_SENSITIVE_EQUAL:(e=e.toLowerCase())===(t=t.toLowerCase())?a7.EQUAL:e.startsWith(t)?a7.STARTS_WITH:e.includes(` ${t}`)?a7.WORD_STARTS_WITH:e.includes(t)?a7.CONTAINS:1===t.length?a7.NO_MATCH:(i="",e.split(" ").forEach(e=>{e.split("-").forEach(e=>{i+=e.substr(0,1)})}),i).includes(t)?a7.ACRONYM:function(e,t){var n;let i,r=0,o=0;function s(e,t,n){for(let i=n,o=t.length;i<o;i++)if(t[i]===e)return r+=1,i+1;return -1}let l=s(t[0],e,0);if(l<0)return a7.NO_MATCH;o=l;for(let n=1,i=t.length;n<i;n++)if(!((o=s(t[n],e,o))>-1))return a7.NO_MATCH;return n=o-l,i=r/t.length,a7.MATCHES+1/n*i}(e,t)}function ut(e,t){let{keepDiacritics:n}=t;return e=`${e}`,n||(e=e.replace(a9,e=>a8[e])),e}let un={maxRanking:1/0,minRanking:-1/0};var ui=n(42927);function ur({color:e,density:t,...n}){let i="compact"===t;return(0,I.jsx)(ui.A,{size:i?"small":"medium",...n,focusRipple:!1,tabIndex:-1,sx:{color:e,padding:e=>e.spacing(i?.25:.5),position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)","&.Mui-checked":{color:e},"&.Mui-focusVisible":{background:e?(0,L.X4)(e,.5):void 0},"& .MuiSvgIcon-root":{fontSize:i?16:18}}})}var uo=n(3399),us=n(76746),ul=n(97653),ua=n(76795),uu=n(45271);function uc(e){return(0,W.Ay)("MuiToolbar",e)}(0,z.A)("MuiToolbar",["root","gutters","regular","dense"]);let uh=(0,F.A)("div",{name:"MuiToolbar",slot:"Root",overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.root,!n.disableGutters&&t.gutters,t[n.variant]]}})((0,N.A)(({theme:e})=>({position:"relative",display:"flex",alignItems:"center",variants:[{props:({ownerState:e})=>!e.disableGutters,style:{paddingLeft:e.spacing(2),paddingRight:e.spacing(2),[e.breakpoints.up("sm")]:{paddingLeft:e.spacing(3),paddingRight:e.spacing(3)}}},{props:{variant:"dense"},style:{minHeight:48}},{props:{variant:"regular"},style:e.mixins.toolbar}]}))),ud=R.forwardRef(function(e,t){let n=(0,H.b)({props:e,name:"MuiToolbar"}),{className:i,component:r="div",disableGutters:o=!1,variant:s="regular",...l}=n,a={...n,component:r,disableGutters:o,variant:s},u=(e=>{let{classes:t,disableGutters:n,variant:i}=e;return(0,P.A)({root:["root",!n&&"gutters",i]},uc,t)})(a);return(0,I.jsx)(uh,{as:r,className:(0,O.A)(u.root,i),ref:t,ownerState:a,...l})});var uf=n(35216),up=n(96913),um=n(70776),ug=n(22402);let uv=(0,ug.A)((0,I.jsx)("path",{d:"M5.59 7.41L10.18 12l-4.59 4.59L7 18l6-6-6-6zM16 6h2v12h-2z"}),"LastPage"),ub=(0,ug.A)((0,I.jsx)("path",{d:"M18.41 16.59L13.82 12l4.59-4.59L17 6l-6 6 6 6zM6 6h2v12H6z"}),"FirstPage"),ux=R.forwardRef(function(e,t){let{backIconButtonProps:n,count:i,disabled:r=!1,getItemAriaLabel:o,nextIconButtonProps:s,onPageChange:l,page:a,rowsPerPage:u,showFirstButton:c,showLastButton:h,slots:d={},slotProps:f={},...p}=e,m=(0,uf.I)(),g=d.firstButton??Q.A,v=d.lastButton??Q.A,b=d.nextButton??Q.A,x=d.previousButton??Q.A,y=d.firstButtonIcon??ub,w=d.lastButtonIcon??uv,S=d.nextButtonIcon??um.A,C=d.previousButtonIcon??up.A,A=m?v:g,k=m?b:x,M=m?x:b,T=m?g:v,D=m?f.lastButton:f.firstButton,R=m?f.nextButton:f.previousButton,E=m?f.previousButton:f.nextButton,O=m?f.firstButton:f.lastButton;return(0,I.jsxs)("div",{ref:t,...p,children:[c&&(0,I.jsx)(A,{onClick:e=>{l(e,0)},disabled:r||0===a,"aria-label":o("first",a),title:o("first",a),...D,children:m?(0,I.jsx)(w,{...f.lastButtonIcon}):(0,I.jsx)(y,{...f.firstButtonIcon})}),(0,I.jsx)(k,{onClick:e=>{l(e,a-1)},disabled:r||0===a,color:"inherit","aria-label":o("previous",a),title:o("previous",a),...R??n,children:m?(0,I.jsx)(S,{...f.nextButtonIcon}):(0,I.jsx)(C,{...f.previousButtonIcon})}),(0,I.jsx)(M,{onClick:e=>{l(e,a+1)},disabled:r||-1!==i&&a>=Math.ceil(i/u)-1,color:"inherit","aria-label":o("next",a),title:o("next",a),...E??s,children:m?(0,I.jsx)(C,{...f.previousButtonIcon}):(0,I.jsx)(S,{...f.nextButtonIcon})}),h&&(0,I.jsx)(T,{onClick:e=>{l(e,Math.max(0,Math.ceil(i/u)-1))},disabled:r||a>=Math.ceil(i/u)-1,"aria-label":o("last",a),title:o("last",a),...O,children:m?(0,I.jsx)(y,{...f.firstButtonIcon}):(0,I.jsx)(w,{...f.lastButtonIcon})})]})});var uy=n(63392);function uw(e){return(0,W.Ay)("MuiTablePagination",e)}let uS=(0,z.A)("MuiTablePagination",["root","toolbar","spacer","selectLabel","selectRoot","select","selectIcon","input","menuItem","displayedRows","actions"]);var uC=n(73397);let uA=(0,F.A)(uu.A,{name:"MuiTablePagination",slot:"Root",overridesResolver:(e,t)=>t.root})((0,N.A)(({theme:e})=>({overflow:"auto",color:(e.vars||e).palette.text.primary,fontSize:e.typography.pxToRem(14),"&:last-child":{padding:0}}))),uk=(0,F.A)(ud,{name:"MuiTablePagination",slot:"Toolbar",overridesResolver:(e,t)=>({[`& .${uS.actions}`]:t.actions,...t.toolbar})})((0,N.A)(({theme:e})=>({minHeight:52,paddingRight:2,[`${e.breakpoints.up("xs")} and (orientation: landscape)`]:{minHeight:52},[e.breakpoints.up("sm")]:{minHeight:52,paddingRight:2},[`& .${uS.actions}`]:{flexShrink:0,marginLeft:20}}))),uM=(0,F.A)("div",{name:"MuiTablePagination",slot:"Spacer",overridesResolver:(e,t)=>t.spacer})({flex:"1 1 100%"}),uT=(0,F.A)("p",{name:"MuiTablePagination",slot:"SelectLabel",overridesResolver:(e,t)=>t.selectLabel})((0,N.A)(({theme:e})=>({...e.typography.body2,flexShrink:0}))),uD=(0,F.A)(ua.A,{name:"MuiTablePagination",slot:"Select",overridesResolver:(e,t)=>({[`& .${uS.selectIcon}`]:t.selectIcon,[`& .${uS.select}`]:t.select,...t.input,...t.selectRoot})})({color:"inherit",fontSize:"inherit",flexShrink:0,marginRight:32,marginLeft:8,[`& .${uS.select}`]:{paddingLeft:8,paddingRight:24,textAlign:"right",textAlignLast:"right"}}),uI=(0,F.A)(ul.A,{name:"MuiTablePagination",slot:"MenuItem",overridesResolver:(e,t)=>t.menuItem})({}),uR=(0,F.A)("p",{name:"MuiTablePagination",slot:"DisplayedRows",overridesResolver:(e,t)=>t.displayedRows})((0,N.A)(({theme:e})=>({...e.typography.body2,flexShrink:0})));function uE({from:e,to:t,count:n}){return`${e}–${t} of ${-1!==n?n:`more than ${t}`}`}function uO(e){return`Go to ${e} page`}let uP=R.forwardRef(function(e,t){let n,i=(0,H.b)({props:e,name:"MuiTablePagination"}),{ActionsComponent:r=ux,backIconButtonProps:o,colSpan:s,component:l=uu.A,count:a,disabled:u=!1,getItemAriaLabel:c=uO,labelDisplayedRows:h=uE,labelRowsPerPage:d="Rows per page:",nextIconButtonProps:f,onPageChange:p,onRowsPerPageChange:m,page:g,rowsPerPage:v,rowsPerPageOptions:b=[10,25,50,100],SelectProps:x={},showFirstButton:y=!1,showLastButton:w=!1,slotProps:S={},slots:C={},...A}=i,M=(e=>{let{classes:t}=e;return(0,P.A)({root:["root"],toolbar:["toolbar"],spacer:["spacer"],selectLabel:["selectLabel"],select:["select"],input:["input"],selectIcon:["selectIcon"],menuItem:["menuItem"],displayedRows:["displayedRows"],actions:["actions"]},uw,t)})(i),T=S?.select??x,D=T.native?"option":uI;(l===uu.A||"td"===l)&&(n=s||1e3);let E=(0,uy.A)(T.id),L=(0,uy.A)(T.labelId),j={slots:C,slotProps:S},[B,F]=(0,uC.A)("root",{ref:t,className:M.root,elementType:uA,externalForwardedProps:{...j,component:l,...A},ownerState:i,additionalProps:{colSpan:n}}),[N,V]=(0,uC.A)("toolbar",{className:M.toolbar,elementType:uk,externalForwardedProps:j,ownerState:i}),[z,W]=(0,uC.A)("spacer",{className:M.spacer,elementType:uM,externalForwardedProps:j,ownerState:i}),[$,_]=(0,uC.A)("selectLabel",{className:M.selectLabel,elementType:uT,externalForwardedProps:j,ownerState:i,additionalProps:{id:L}}),[U,G]=(0,uC.A)("select",{className:M.select,elementType:uD,externalForwardedProps:j,ownerState:i}),[q,Y]=(0,uC.A)("menuItem",{className:M.menuItem,elementType:D,externalForwardedProps:j,ownerState:i}),[K,X]=(0,uC.A)("displayedRows",{className:M.displayedRows,elementType:uR,externalForwardedProps:j,ownerState:i});return(0,I.jsx)(B,{...F,children:(0,I.jsxs)(N,{...V,children:[(0,I.jsx)(z,{...W}),b.length>1&&(0,I.jsx)($,{..._,children:d}),b.length>1&&(0,I.jsx)(U,{variant:"standard",...!T.variant&&{input:k||(k=(0,I.jsx)(us.Ay,{}))},value:v,onChange:m,id:E,labelId:L,...T,classes:{...T.classes,root:(0,O.A)(M.input,M.selectRoot,(T.classes||{}).root),select:(0,O.A)(M.select,(T.classes||{}).select),icon:(0,O.A)(M.selectIcon,(T.classes||{}).icon)},disabled:u,...G,children:b.map(e=>(0,R.createElement)(q,{...Y,key:e.label?e.label:e,value:e.value?e.value:e},e.label?e.label:e))}),(0,I.jsx)(K,{...X,children:h({from:0===a?0:g*v+1,to:-1===a?(g+1)*v:-1===v?a:Math.min(a,(g+1)*v),count:-1===a?-1:a,page:g})}),(0,I.jsx)(r,{className:M.actions,backIconButtonProps:o,count:a,nextIconButtonProps:f,onPageChange:p,page:g,rowsPerPage:v,showFirstButton:y,showLastButton:w,slotProps:S.actions,slots:C.actions,getItemAriaLabel:c,disabled:u})]})})});var uL=n(88091),uj=n(88404),uB=n(42872);function uF(e){return(0,W.Ay)("MuiInputAdornment",e)}let uN=(0,z.A)("MuiInputAdornment",["root","filled","standard","outlined","positionStart","positionEnd","disablePointerEvents","hiddenLabel","sizeSmall"]),uV=(0,F.A)("div",{name:"MuiInputAdornment",slot:"Root",overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.root,t[`position${(0,B.A)(n.position)}`],!0===n.disablePointerEvents&&t.disablePointerEvents,t[n.variant]]}})((0,N.A)(({theme:e})=>({display:"flex",maxHeight:"2em",alignItems:"center",whiteSpace:"nowrap",color:(e.vars||e).palette.action.active,variants:[{props:{variant:"filled"},style:{[`&.${uN.positionStart}&:not(.${uN.hiddenLabel})`]:{marginTop:16}}},{props:{position:"start"},style:{marginRight:8}},{props:{position:"end"},style:{marginLeft:8}},{props:{disablePointerEvents:!0},style:{pointerEvents:"none"}}]}))),uH=R.forwardRef(function(e,t){let n=(0,H.b)({props:e,name:"MuiInputAdornment"}),{children:i,className:r,component:o="div",disablePointerEvents:s=!1,disableTypography:l=!1,position:a,variant:u,...c}=n,h=(0,uB.A)()||{},d=u;u&&h.variant,h&&!d&&(d=h.variant);let f={...n,hiddenLabel:h.hiddenLabel,size:h.size,disablePointerEvents:s,position:a,variant:d},p=(e=>{let{classes:t,disablePointerEvents:n,hiddenLabel:i,position:r,size:o,variant:s}=e,l={root:["root",n&&"disablePointerEvents",r&&`position${(0,B.A)(r)}`,s,i&&"hiddenLabel",o&&`size${(0,B.A)(o)}`]};return(0,P.A)(l,uF,t)})(f);return(0,I.jsx)(uj.A.Provider,{value:null,children:(0,I.jsx)(uV,{as:o,ownerState:f,className:(0,O.A)(p.root,r),ref:t,...c,children:"string"!=typeof i||l?(0,I.jsxs)(R.Fragment,{children:["start"===a?M||(M=(0,I.jsx)("span",{className:"notranslate","aria-hidden":!0,children:""})):null,i]}):(0,I.jsx)(uL.A,{color:"textSecondary",children:i})})})});var uz=n(65211),uW=n(30145),u$=n(98599),u_=n(7800),uU=n(12933),uG=n(9323),uq=n(16979),uY=n(46177),uK=n.n(uY);let uX=(0,R.forwardRef)(function({debounceMs:e=250,value:t,onChange:n,...i},r){let[o,s]=(0,R.useState)(t),l=(0,R.useCallback)(e=>{n?.(e)},[n]),a=(0,R.useMemo)(()=>uK()(l,e),[e,l]);return(0,I.jsx)(J.A,{ref:r,value:o,onChange:function(e){s(e.target.value),a(e.target.value)},...i})});function uZ({isSearchEnabled:e,globalFilter:t,onGlobalFilterChange:n,isColumnFilterEnabled:i,columns:r,width:o,columnFilterMenuMaxHeight:s=400,isExpandAllEnabled:l,isAllExpanded:a,onExpandAllChange:u}){let[c,h]=(0,R.useState)(null),d=!!c,[f,p]=(0,R.useState)(0),m=(0,R.useCallback)(()=>{n(""),p(e=>e+1)},[n]);return e||i||l?(0,I.jsxs)(Z.A,{direction:"row",gap:1,alignItems:"center",justifyContent:"flex-end",width:o,padding:"0.5rem",sx:{backgroundColor:e=>e.palette.background.default},children:[e&&(0,I.jsx)(uX,{placeholder:"Search...",value:t,onChange:n,variant:"standard",slotProps:{htmlInput:{"aria-label":"search table"},input:{startAdornment:(0,I.jsx)(uH,{position:"start",children:(0,I.jsx)(u$.default,{fontSize:"small"})}),endAdornment:""!==t&&(0,I.jsx)(uH,{position:"end",children:(0,I.jsx)(Q.A,{onClick:m,children:(0,I.jsx)(u_.default,{fontSize:"small"})})})}},sx:{flexGrow:1}},f),l&&(0,I.jsx)(uz.A,{title:a?"Collapse all":"Expand all",children:(0,I.jsx)(Q.A,{onClick:u,color:"info","aria-label":a?"collapse all rows":"expand all rows",children:a?(0,I.jsx)(uq.default,{}):(0,I.jsx)(uG.default,{})})}),i&&(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(Q.A,{onClick:e=>h(e.currentTarget),"aria-haspopup":"listbox","aria-expanded":d,color:"info",children:(0,I.jsx)(uU.default,{})}),(0,I.jsx)(uW.A,{anchorEl:c,open:d,onClose:()=>h(null),slotProps:{list:{dense:!0}},sx:{maxHeight:s},children:r.map(e=>{let t=e.columnDef.header,n="string"==typeof t?t:e.id;return(0,I.jsxs)(ul.A,{disabled:!e.getCanHide(),onClick:e.getCanHide()?e.getToggleVisibilityHandler():void 0,dense:!0,children:[(0,I.jsx)(ui.A,{checked:e.getIsVisible(),disabled:!e.getCanHide(),size:"small",disableRipple:!0,sx:{p:0,mr:1}}),(0,I.jsx)(af.A,{primary:n})]},e.id)})})]})]}):null}uX.displayName="TextField";let uQ=(0,R.forwardRef)(function(e,t){return(0,I.jsx)(uo.A,{...e,ref:t,sx:{backgroundColor:e=>e.palette.background.default,"&:hover":{backgroundColor:e=>(0,L.X4)(e.palette.primary.main,e.palette.action.hoverOpacity)}}})});var uJ=n(5139);let u0=(0,R.forwardRef)(function(e,t){return(0,I.jsx)(uJ.A,{...e,ref:t})});var u1=n(91394);let u2=(0,F.A)(u1.A)(({theme:e})=>({tableLayout:"fixed",borderCollapse:"separate",backgroundColor:e.palette.background.default})),u5={compact:"small",standard:"medium",comfortable:"medium"},u3=(0,R.forwardRef)(function({density:e,...t},n){return(0,I.jsx)(u2,{...t,tabIndex:-1,size:u5[e],ref:n,sx:{width:"100%"}})});var u4=n(70561);let u6=(0,R.forwardRef)(function(e,t){return(0,I.jsx)(u4.A,{...e,ref:t})}),u8=(0,ug.A)((0,I.jsx)("path",{d:"M20 12l-1.41-1.41L13 16.17V4h-2v12.17l-5.58-5.59L4 12l8 8 8-8z"}),"ArrowDownward");function u9(e){return(0,W.Ay)("MuiTableSortLabel",e)}let u7=(0,z.A)("MuiTableSortLabel",["root","active","icon","iconDirectionDesc","iconDirectionAsc","directionDesc","directionAsc"]),ce=(0,F.A)(ao.A,{name:"MuiTableSortLabel",slot:"Root",overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.root,n.active&&t.active]}})((0,N.A)(({theme:e})=>({cursor:"pointer",display:"inline-flex",justifyContent:"flex-start",flexDirection:"inherit",alignItems:"center","&:focus":{color:(e.vars||e).palette.text.secondary},"&:hover":{color:(e.vars||e).palette.text.secondary,[`& .${u7.icon}`]:{opacity:.5}},[`&.${u7.active}`]:{color:(e.vars||e).palette.text.primary,[`& .${u7.icon}`]:{opacity:1,color:(e.vars||e).palette.text.secondary}}}))),ct=(0,F.A)("span",{name:"MuiTableSortLabel",slot:"Icon",overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.icon,t[`iconDirection${(0,B.A)(n.direction)}`]]}})((0,N.A)(({theme:e})=>({fontSize:18,marginRight:4,marginLeft:4,opacity:0,transition:e.transitions.create(["opacity","transform"],{duration:e.transitions.duration.shorter}),userSelect:"none",variants:[{props:{direction:"desc"},style:{transform:"rotate(0deg)"}},{props:{direction:"asc"},style:{transform:"rotate(180deg)"}}]}))),cn=R.forwardRef(function(e,t){let n=(0,H.b)({props:e,name:"MuiTableSortLabel"}),{active:i=!1,children:r,className:o,direction:s="asc",hideSortIcon:l=!1,IconComponent:a=u8,slots:u={},slotProps:c={},...h}=n,d={...n,active:i,direction:s,hideSortIcon:l,IconComponent:a},f=(e=>{let{classes:t,direction:n,active:i}=e,r={root:["root",i&&"active",`direction${(0,B.A)(n)}`],icon:["icon",`iconDirection${(0,B.A)(n)}`]};return(0,P.A)(r,u9,t)})(d),p={slots:u,slotProps:c},[m,g]=(0,uC.A)("root",{elementType:ce,externalForwardedProps:p,ownerState:d,className:(0,O.A)(f.root,o),ref:t}),[v,b]=(0,uC.A)("icon",{elementType:ct,externalForwardedProps:p,ownerState:d,className:f.icon});return(0,I.jsxs)(m,{disableRipple:!0,component:"span",...g,...h,children:[r,l&&!i?null:(0,I.jsx)(v,{as:a,...b})]})});var ci=n(6227),cr=n(57438);function co(e,t,{isHeader:n,isLastColumn:i,isFirstColumn:r,defaultColumnHeight:o}={}){var s,l;let a=e.spacing(1),u=e.spacing(1.25),c=e.spacing(2),h=r?c:u,d=i?c:u,f=e.typography.body1.lineHeight,p=e.typography.body1.fontSize;"compact"===t&&(a=e.spacing(.5),u=e.spacing(.5),c=e.spacing(1),h=r?c:u,d=i?c:u,f=e.typography.body2.lineHeight,p=e.typography.body2.fontSize),"comfortable"===t&&(a=e.spacing(2),u=e.spacing(1.5),c=e.spacing(2),h=r?c:u,d=i?c:u,f=e.typography.body1.lineHeight,p=e.typography.body1.fontSize);let m=n||!o||"auto"===o?(s=f,l=a,("string"==typeof s?parseInt(s,10):s??0)+2*("string"==typeof l?parseInt(l,10):l)):o;return{padding:`${a} ${d} ${a} ${h}`,height:m,fontSize:p,lineHeight:f}}function cs(e,t){return e.map(({width:e,align:n,headerDescription:i,cellDescription:r,enableSorting:o,dataLink:s,enableResizing:l,...a})=>{var u,c,h,d,f,p,m;let g=l??t?.enableResizing??!1,v="auto"===e||void 0===e?(u=g,c=t?.minWidth,h=t?.maxWidth,u?{size:150,minSize:c??60,maxSize:h??1e3}:{size:0,minSize:0,maxSize:0}):(d=g,f=e,p=t?.minWidth,m=t?.maxWidth,d?{size:f,minSize:p??60,maxSize:m??1e3}:{size:f});return{...a,...v,enableSorting:!!o,enableResizing:g,meta:{align:n,headerDescription:i,cellDescription:r,dataLink:s}}})}let cl=(0,F.A)(uu.A)(({theme:e})=>({padding:0,backgroundColor:"inherit","&.MuiTableCell-head":{backgroundColor:e.palette.background.default},"&:focus-visible":{outline:`solid 1px ${e.palette.primary.main}`,outlineOffset:"-1px",borderRadius:0}}));function ca({children:e,density:t,variant:n,width:i,defaultColumnHeight:r,focusState:o="none",onFocusTrigger:s,isFirstColumn:l,isLastColumn:a,description:u,align:c,color:h,backgroundColor:d,dataLink:f,adjacentCellsValuesMap:p,...m}){let g=(0,r7.A)(),v=(0,R.useRef)(),b="head"===n;(0,R.useEffect)(()=>{"trigger-focus"===o&&v.current&&v.current.focus()},[o]);let x=e=>{s?.(e)},y=(0,R.useMemo)(()=>{if(f){if(p&&i8(f.url)){let{text:e}=i5(f.url,p,{urlEncode:!0});return{...f,url:e}}return f}},[f,p]);return(0,I.jsx)(cl,{...m,tabIndex:"none"!==o?0:-1,onFocus:e=>{let t=e.currentTarget?.querySelector('a[href], button, input, textarea, select, details,[role="button"]');t&&t.focus()},onClick:x,onKeyUp:x,style:{width:i},sx:{position:"relative",borderBottom:b?`solid 1px ${g.palette.grey[100]}`:`solid 1px ${g.palette.grey[50]}`,"&:hover #original-cell":{position:"absolute",top:0,left:0,zIndex:10,width:"fit-content",minWidth:"100%",whiteSpace:"nowrap",overflow:"visible",backgroundColor:`${d??g.palette.background.default} !important`,outline:`solid 1px ${g.palette.info.main}`,outlineOffset:"-1px"}},ref:v,children:(0,I.jsx)(oe.A,{id:"original-cell",sx:{...co(g,t,{isHeader:b,isLastColumn:a,isFirstColumn:l,defaultColumnHeight:r}),position:"relative",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",flexDirection:"inherit"},style:{backgroundColor:d??"inherit",color:h??"inherit"},title:u,"aria-label":u,textAlign:c,children:y?(0,I.jsx)(cr.A,{href:y.url,target:y.targetBlank?"_blank":"_self",rel:y.targetBlank?"noopener noreferrer":void 0,children:e}):e})})}function cu({onSort:e,sortDirection:t,nextSortDirection:n,children:i,resizeConfig:r,...o}){let s=!!e,l=(0,I.jsx)(uL.A,{noWrap:!0,variant:"inherit",component:"div",color:"inherit",children:i}),a=!!t;return(0,I.jsxs)(ca,{...o,children:[s?(0,I.jsx)(cn,{onClick:e,direction:a?t:n,active:a,sx:{verticalAlign:"unset",maxWidth:"100%","&:focus-visible":{[`& .${u7.icon}`]:{opacity:a?1:.5}}},children:l}):l,r&&(0,I.jsx)(oe.A,{onMouseDown:e=>{2===e.detail?r.resetSizeHandler():r.resizeHandler(e)},onTouchStart:r.resizeHandler,sx:{position:"absolute",height:"100%",top:0,right:"4px",cursor:"col-resize"},children:(0,I.jsx)(ci.A,{flexItem:!0,orientation:"vertical",sx:e=>({backgroundColor:r.isResizing?e.palette.action.active:e.palette.divider,borderRadius:"2px",borderWidth:"2px",height:"100%",touchAction:"none",transform:"translateX(4px)",userSelect:"none"})})})]})}var cc=n(347);let ch=(0,R.forwardRef)(function(e,t){return(0,I.jsx)(cc.A,{...e,tabIndex:-1,ref:t,sx:iH({flexGrow:1},e.sx)})}),cd={row:0,column:0},cf=["ArrowRight","ArrowLeft","ArrowUp","ArrowDown"];var cp=n(91644);function cm(e){return(0,W.Ay)("MuiTableFooter",e)}(0,z.A)("MuiTableFooter",["root"]);let cg=(0,F.A)("tfoot",{name:"MuiTableFooter",slot:"Root",overridesResolver:(e,t)=>t.root})({display:"table-footer-group"}),cv={variant:"footer"},cb="tfoot",cx=R.forwardRef(function(e,t){let n=(0,H.b)({props:e,name:"MuiTableFooter"}),{className:i,component:r=cb,...o}=n,s={...n,component:r},l=(e=>{let{classes:t}=e;return(0,P.A)({root:["root"]},cm,t)})(s);return(0,I.jsx)(cp.A.Provider,{value:cv,children:(0,I.jsx)(cg,{as:r,className:(0,O.A)(l.root,i),ref:t,role:r===cb?null:"rowgroup",ownerState:s,...o})})}),cy=(0,R.forwardRef)(function(e,t){return(0,I.jsx)(cx,{...e,ref:t})});function cw({width:e,height:t,density:n,defaultColumnWidth:i,defaultColumnHeight:r,onRowClick:o,onRowMouseOver:s,onRowMouseOut:l,rows:a,columns:u,headers:c,columnSizing:h,columnSizingInfo:d,cellConfigs:f,pagination:p,onPaginationChange:m,rowCount:g,toolbarConfig:v}){let b=(0,R.useRef)(null),x=(0,R.useRef)({startIndex:0,endIndex:0}),y=function({visibleRange:e,virtualTable:t,maxRows:n,maxColumns:i}){return function({maxRows:e,maxColumns:t,onActiveCellChange:n}){let[i,r]=(0,R.useState)(cd),[o,s]=(0,R.useState)(!1);return{activeCell:i,isActive:o,onTableKeyDown:(0,R.useCallback)(i=>{let o=i.key;(cf.includes(o)||"Home"===o||"End"===o||"PageDown"===o||"PageUp"===o)&&r(r=>{let s=r.row,l=r.column;"ArrowRight"===o&&l<t-1?(i.preventDefault(),l+=1):"ArrowLeft"===o&&l>0?(i.preventDefault(),l-=1):"ArrowDown"===o&&s<e-1?(i.preventDefault(),s+=1):"ArrowUp"===o&&s>0?(i.preventDefault(),s-=1):"Home"===o?(i.preventDefault(),s=0,l=0):"End"===o&&(i.preventDefault(),s=e-1,l=t-1);let a={column:l,row:s},u=n?.(i,r,a)||a;return u.row===r.row&&u.column===r.column?r:u})},[t,e,n]),onCellFocus:e=>{e.column===i.column&&e.row===i.row&&o||(s(!0),r(e))},onTableBlur:(0,R.useCallback)(e=>{e.currentTarget.contains(e.relatedTarget)||(s(!1),r(cd))},[])}}({maxRows:n,maxColumns:i,onActiveCellChange:(i,r,o)=>{let s=i.key,l=o&&(r.column!==o.column||r.row!==o.row),a=o?.row??r.row;if("ArrowDown"===s&&l)(a-1<e.current.startIndex||a-1>e.current.endIndex)&&t.current?.scrollToIndex({index:a-1,align:"end"});else if("ArrowUp"===s&&l)(a-1<e.current.startIndex||a-1>e.current.endIndex)&&t.current?.scrollToIndex({index:a-1,align:"start"});else if(l&&("Home"===s||"End"===s))t.current?.scrollToIndex({index:Math.max(a-1,0),align:"start"});else if("PageDown"===s){i.preventDefault();let o=r.row;return o=Math.min(n-1,e.current.endIndex+1),t.current?.scrollToIndex({index:o-1,align:"start"}),{row:o,column:r.column}}else if("PageUp"===s){let n=r.row;return n=Math.max(0,e.current.startIndex-1),t.current?.scrollToIndex({index:n-1,align:"end"}),{row:n,column:r.column}}return o}})}({visibleRange:x,virtualTable:b,maxRows:a.length+1,maxColumns:u.length}),w=e=>e.row===y.activeCell.row&&e.column===y.activeCell.column?y.isActive?"trigger-focus":"focus-next":"none",S=(0,R.useMemo)(()=>({Scroller:ch,Table:t=>(0,I.jsx)(u3,{...t,width:e,density:n,onKeyDown:y.onTableKeyDown,onBlur:y.onTableBlur}),TableHead:u6,TableFoot:cy,TableRow:({item:e,...t})=>{let i=a[t["data-index"]];if(!i)return null;let r={id:i.id,index:i.index};return(0,I.jsx)(uQ,{...t,onClick:e=>o(e,i.id),density:n,onMouseOver:e=>{s?.(e,r)},onMouseOut:e=>{l?.(e,r)}})},TableBody:u0}),[n,y.onTableKeyDown,y.onTableBlur,o,l,s,a,e]),C=(e,t)=>{p&&m&&m({...p,pageIndex:t})},A=e=>{p&&m&&m({pageIndex:0,pageSize:parseInt(e.target.value,10)})},k=(0,R.useMemo)(()=>{let e={};return c.forEach(t=>{t.headers.filter(e=>e.column.getCanResize()).forEach(t=>{e[`--header-${t.id}-size`]=t.getSize(),e[`--col-${t.column.id}-size`]=t.column.getSize()})}),e},[d,h,c]);return(0,I.jsxs)(oe.A,{style:{width:e,height:t,...k},children:[(0,I.jsx)(uZ,{...v,width:e}),(0,I.jsx)(lj,{ref:b,totalCount:a.length,components:S,rangeChanged:e=>{x.current=e},fixedHeaderContent:()=>(0,I.jsx)(I.Fragment,{children:c.map(e=>(0,I.jsx)(uQ,{density:n,children:e.headers.map((e,t,o)=>{var s,l,a,u,c;let h,d=e.column,f={row:0,column:t},p=d.getIsSorted(),m=d.getNextSortingOrder();return(0,I.jsx)(cu,{onSort:d.getCanSort()?d.getToggleSortingHandler():void 0,sortDirection:"string"==typeof p?p:void 0,nextSortDirection:"string"==typeof m?m:void 0,width:e.column.getCanResize()?`calc(var(--header-${e?.id}-size) * 1px)`:d.getSize()||i,defaultColumnHeight:r,align:d.columnDef.meta?.align,variant:"head",density:n,description:d.columnDef.meta?.headerDescription,focusState:w(f),onFocusTrigger:()=>y.onCellFocus(f),isFirstColumn:0===t,isLastColumn:t===o.length-1,resizeConfig:e.column.getCanResize()?{resizeHandler:e.getResizeHandler(),resetSizeHandler:e.column.resetSize,isResizing:e.column.getIsResizing()}:void 0,children:(s=d.columnDef.header,l=e.getContext(),s?"function"==typeof(u=a=s)&&(h=Object.getPrototypeOf(u)).prototype&&h.prototype.isReactComponent||"function"==typeof a||"object"==typeof(c=a)&&"symbol"==typeof c.$$typeof&&["react.memo","react.forward_ref"].includes(c.$$typeof.description)?R.createElement(s,l):s:null)},e.id)})},e.id))}),fixedFooterContent:p?()=>(0,I.jsx)(uo.A,{sx:{backgroundColor:e=>e.palette.background.default},children:(0,I.jsx)(uP,{colSpan:u.length,count:g,page:p.pageIndex,rowsPerPage:p.pageSize,onPageChange:C,onRowsPerPageChange:A})}):void 0,itemContent:e=>{let t=a[e];return t?(0,I.jsx)(I.Fragment,{children:t.getVisibleCells().map((o,s,l)=>{let a,u={row:e+1,column:s},c=o.getContext(),h=f?.[c.cell.id],d=o.column.columnDef.cell,p="function"==typeof d?d(c):null,m=o.column.columnDef.meta?.cellDescription;"function"==typeof m?a=m(c):m&&"string"==typeof p&&(a=p);let g=Object.entries(t.original)?.filter(([e,t])=>["string","number"].includes(typeof t)).reduce((e,[t,n])=>({...e,[t]:String(n)}),{});return(0,I.jsx)(ca,{"data-testid":o.id,title:a||h?.text||p,width:o.column.getCanResize()?`calc(var(--col-${o.column.id}-size) * 1px)`:o.column.getSize()||i,defaultColumnHeight:r,align:o.column.columnDef.meta?.align,density:n,focusState:w(u),onFocusTrigger:()=>y.onCellFocus(u),isFirstColumn:0===s,isLastColumn:s===l.length-1,description:a,color:h?.textColor??void 0,backgroundColor:h?.backgroundColor??void 0,dataLink:o.column.columnDef.meta?.dataLink,adjacentCellsValuesMap:g,children:h?.text||p},o.id)})}):null}})]})}let cS=(e,t)=>`${t}`,cC={},cA=[];function ck({data:e,columns:t,cellConfigs:n,density:i="standard",defaultColumnWidth:r=150,defaultColumnHeight:o="auto",checkboxSelection:s,onRowSelectionChange:l,onSortingChange:a,getCheckboxColor:u,getRowId:c=cS,rowSelection:h=cC,sorting:d=cA,getItemActions:f,hasItemActions:p,pagination:m,onPaginationChange:g,rowSelectionVariant:v="standard",getSubRows:b,hiddenColumns:x,tableToolbarConfig:y,columnResizeMode:w="onChange",defaultColumnConfig:S,...C}){let A=(0,r7.A)(),k=!!b,[M,T]=(0,R.useState)({}),{globalFilter:D,setGlobalFilter:E,fuzzySearchOptions:O}=function(e,t,n,i){let[r,o]=(0,R.useState)(""),[s,l]=(0,R.useState)(n),a=(0,R.useCallback)(e=>{o(t=>(t?t&&!e&&i(s):(l(n),i(!0)),e))},[n,s,i]);return{globalFilter:r,setGlobalFilter:a,fuzzySearchOptions:{filterFns:{fuzzy:(e,n,i,r)=>{let o=function(e,t,n){var i;if((n=n||{}).threshold=null!=(i=n.threshold)?i:a7.MATCHES,!n.accessors){let i=ue(e,t,n);return{rankedValue:e,rank:i,accessorIndex:-1,accessorThreshold:n.threshold,passed:i>=n.threshold}}let r=function(e,t){let n=[];for(let i=0,r=t.length;i<r;i++){let r=t[i],o="function"==typeof r?un:{...un,...r},s=function(e,t){let n=t;"object"==typeof t&&(n=t.accessor);let i=n(e);return null==i?[]:Array.isArray(i)?i:[String(i)]}(e,r);for(let e=0,t=s.length;e<t;e++)n.push({itemValue:s[e],attributes:o})}return n}(e,n.accessors),o={rankedValue:e,rank:a7.NO_MATCH,accessorIndex:-1,accessorThreshold:n.threshold,passed:!1};for(let e=0;e<r.length;e++){let i=r[e],s=ue(i.itemValue,t,n),{minRanking:l,maxRanking:a,threshold:u=n.threshold}=i.attributes;s<l&&s>=a7.MATCHES?s=l:s>a&&(s=a),(s=Math.min(s,a))>=u&&s>o.rank&&(o.rank=s,o.passed=!0,o.accessorIndex=e,o.accessorThreshold=u,o.rankedValue=i.itemValue)}return o}(e.getValue(n),i,{threshold:a7[t]});return r({itemRank:o}),o.passed}},globalFilterFn:e?"fuzzy":void 0,getFilteredRowModel:e?e=>aC(()=>[e.getPreFilteredRowModel(),e.getState().columnFilters,e.getState().globalFilter],(t,n,i)=>{var r,o,s,l,a,u,c,h,d,f;let p,m,g,v,b,x,y,w,S,C;if(!t.rows.length||!(null!=n&&n.length)&&!i){for(let e=0;e<t.flatRows.length;e++)t.flatRows[e].columnFilters={},t.flatRows[e].columnFiltersMeta={};return t}let A=[],k=[];(null!=n?n:[]).forEach(t=>{var n;let i=e.getColumn(t.id);if(!i)return;let r=i.getFilterFn();r&&A.push({id:t.id,filterFn:r,resolvedValue:null!=(n=null==r.resolveFilterValue?void 0:r.resolveFilterValue(t.value))?n:t.value})});let M=(null!=n?n:[]).map(e=>e.id),T=e.getGlobalFilterFn(),D=e.getAllLeafColumns().filter(e=>e.getCanGlobalFilter());i&&T&&D.length&&(M.push("__global__"),D.forEach(e=>{var t;k.push({id:e.id,filterFn:T,resolvedValue:null!=(t=null==T.resolveFilterValue?void 0:T.resolveFilterValue(i))?t:i})}));for(let e=0;e<t.flatRows.length;e++){let n=t.flatRows[e];if(n.columnFilters={},A.length)for(let e=0;e<A.length;e++){let t=(p=A[e]).id;n.columnFilters[t]=p.filterFn(n,t,p.resolvedValue,e=>{n.columnFiltersMeta[t]=e})}if(k.length){for(let e=0;e<k.length;e++){let t=(m=k[e]).id;if(m.filterFn(n,t,m.resolvedValue,e=>{n.columnFiltersMeta[t]=e})){n.columnFilters.__global__=!0;break}}!0!==n.columnFilters.__global__&&(n.columnFilters.__global__=!1)}}return r=t.rows,o=e=>{for(let t=0;t<M.length;t++)if(!1===e.columnFilters[M[t]])return!1;return!0},e.options.filterFromLeafRows?(s=r,l=o,g=[],v={},b=null!=(u=(a=e).options.maxLeafRowFilterDepth)?u:100,{rows:(x=function(e,t){void 0===t&&(t=0);let n=[];for(let r=0;r<e.length;r++){var i;let o=e[r],s=aD(a,o.id,o.original,o.index,o.depth,void 0,o.parentId);if(s.columnFilters=o.columnFilters,null!=(i=o.subRows)&&i.length&&t<b){if(s.subRows=x(o.subRows,t+1),l(o=s)&&!s.subRows.length||l(o)||s.subRows.length){n.push(o),v[o.id]=o,g.push(o);continue}}else l(o=s)&&(n.push(o),v[o.id]=o,g.push(o))}return n})(s),flatRows:g,rowsById:v}):(c=r,h=o,y=[],w={},S=null!=(f=(d=e).options.maxLeafRowFilterDepth)?f:100,{rows:(C=function(e,t){void 0===t&&(t=0);let n=[];for(let r=0;r<e.length;r++){let o=e[r];if(h(o)){var i;if(null!=(i=o.subRows)&&i.length&&t<S){let e=aD(d,o.id,o.original,o.index,o.depth,void 0,o.parentId);e.subRows=C(o.subRows,t+1),o=e}n.push(o),y.push(o),w[o.id]=o}}return n})(c),flatRows:y,rowsById:w})},aA(e.options,"debugTable","getFilteredRowModel",()=>e._autoResetPageIndex())):void 0,filterFromLeafRows:e,onGlobalFilterChange:a}}}(y?.isSearchEnabled,y?.fuzzyMatchThreshold??"CONTAINS",M,T),[P,L]=(0,R.useState)(x?.reduce((e,t)=>({...e,[t]:!1}),{})??{}),j=(0,R.useCallback)((e,t,n)=>{"standard"===v||n?t.toggleSelected():t.getIsSelected()&&!e.getIsAllRowsSelected()?e.toggleAllRowsSelected():l?.({[t.id]:!0})},[l,v]),B=(0,R.useCallback)((e,t,n)=>{let i=e.nativeEvent&&(e.nativeEvent instanceof MouseEvent||e.nativeEvent instanceof KeyboardEvent)?e.nativeEvent:void 0;j(t,n,!!i?.metaKey||!!i?.shiftKey)},[j]),F=(0,R.useMemo)(()=>({id:"itemActions",header:"Actions",cell:({row:e})=>(0,I.jsx)(Z.A,{direction:"row",alignItems:"center",children:f?.({id:e.id,data:e.original})}),enableSorting:!1,enableResizing:!1}),[f]),N=(0,R.useMemo)(()=>({id:"checkboxRowSelect",size:28,header:({table:e})=>(0,I.jsx)(ur,{checked:e.getIsAllRowsSelected(),indeterminate:e.getIsSomeRowsSelected(),onChange:e.getToggleAllRowsSelectedHandler(),color:A.palette.text.primary,density:i}),cell:({row:e,table:t})=>(0,I.jsx)(ur,{checked:e.getIsSelected(),indeterminate:e.getIsSomeSelected(),onChange:n=>{B(n,t,e)},color:u?.(e.original),density:i}),enableSorting:!1,enableResizing:!1}),[A.palette.text.primary,i,u,B]),V=function(e){let t={state:{},onStateChange:()=>{},renderFallbackValue:null,...e},[n]=R.useState(()=>({current:function(e){var t,n;let i=[...a4,...null!=(t=e._features)?t:[]],r={_features:i},o=r._features.reduce((e,t)=>Object.assign(e,null==t.getDefaultOptions?void 0:t.getDefaultOptions(r)),{}),s={...null!=(n=e.initialState)?n:{}};r._features.forEach(e=>{var t;s=null!=(t=null==e.getInitialState?void 0:e.getInitialState(s))?t:s});let l=[],a=!1,u={_features:i,options:{...o,...e},initialState:s,_queue:e=>{l.push(e),a||(a=!0,Promise.resolve().then(()=>{for(;l.length;)l.shift()();a=!1}).catch(e=>setTimeout(()=>{throw e})))},reset:()=>{r.setState(r.initialState)},setOptions:e=>{var t;t=ay(e,r.options),r.options=r.options.mergeOptions?r.options.mergeOptions(o,t):{...o,...t}},getState:()=>r.options.state,setState:e=>{null==r.options.onStateChange||r.options.onStateChange(e)},_getRowId:(e,t,n)=>{var i;return null!=(i=null==r.options.getRowId?void 0:r.options.getRowId(e,t,n))?i:`${n?[n.id,t].join("."):t}`},getCoreRowModel:()=>(r._getCoreRowModel||(r._getCoreRowModel=r.options.getCoreRowModel(r)),r._getCoreRowModel()),getRowModel:()=>r.getPaginationRowModel(),getRow:(e,t)=>{let n=(t?r.getPrePaginationRowModel():r.getRowModel()).rowsById[e];if(!n&&!(n=r.getCoreRowModel().rowsById[e]))throw Error();return n},_getDefaultColumnDef:aC(()=>[r.options.defaultColumn],e=>{var t;return e=null!=(t=e)?t:{},{header:e=>{let t=e.header.column.columnDef;return t.accessorKey?t.accessorKey:t.accessorFn?t.id:null},cell:e=>{var t,n;return null!=(t=null==(n=e.renderValue())||null==n.toString?void 0:n.toString())?t:null},...r._features.reduce((e,t)=>Object.assign(e,null==t.getDefaultColumnDef?void 0:t.getDefaultColumnDef()),{}),...e}},aA(e,"debugColumns","_getDefaultColumnDef")),_getColumnDefs:()=>r.options.columns,getAllColumns:aC(()=>[r._getColumnDefs()],e=>{let t=function(e,n,i){return void 0===i&&(i=0),e.map(e=>{let o=function(e,t,n,i){var r,o;let s,l={...e._getDefaultColumnDef(),...t},a=l.accessorKey,u=null!=(r=null!=(o=l.id)?o:a?"function"==typeof String.prototype.replaceAll?a.replaceAll(".","_"):a.replace(/\./g,"_"):void 0)?r:"string"==typeof l.header?l.header:void 0;if(l.accessorFn?s=l.accessorFn:a&&(s=a.includes(".")?e=>{let t=e;for(let e of a.split(".")){var n;t=null==(n=t)?void 0:n[e]}return t}:e=>e[l.accessorKey]),!u)throw Error();let c={id:`${String(u)}`,accessorFn:s,parent:i,depth:n,columnDef:l,columns:[],getFlatColumns:aC(()=>[!0],()=>{var e;return[c,...null==(e=c.columns)?void 0:e.flatMap(e=>e.getFlatColumns())]},aA(e.options,"debugColumns","column.getFlatColumns")),getLeafColumns:aC(()=>[e._getOrderColumnsFn()],e=>{var t;return null!=(t=c.columns)&&t.length?e(c.columns.flatMap(e=>e.getLeafColumns())):[c]},aA(e.options,"debugColumns","column.getLeafColumns"))};for(let t of e._features)null==t.createColumn||t.createColumn(c,e);return c}(r,e,i,n);return o.columns=e.columns?t(e.columns,o,i+1):[],o})};return t(e)},aA(e,"debugColumns","getAllColumns")),getAllFlatColumns:aC(()=>[r.getAllColumns()],e=>e.flatMap(e=>e.getFlatColumns()),aA(e,"debugColumns","getAllFlatColumns")),_getAllFlatColumnsById:aC(()=>[r.getAllFlatColumns()],e=>e.reduce((e,t)=>(e[t.id]=t,e),{}),aA(e,"debugColumns","getAllFlatColumnsById")),getAllLeafColumns:aC(()=>[r.getAllColumns(),r._getOrderColumnsFn()],(e,t)=>t(e.flatMap(e=>e.getLeafColumns())),aA(e,"debugColumns","getAllLeafColumns")),getColumn:e=>r._getAllFlatColumnsById()[e]};Object.assign(r,u);for(let e=0;e<r._features.length;e++){let t=r._features[e];null==t||null==t.createTable||t.createTable(r)}return r}(t)})),[i,r]=R.useState(()=>n.current.initialState);return n.current.setOptions(t=>({...t,...e,state:{...i,...e.state},onStateChange:t=>{r(t),null==e.onStateChange||e.onStateChange(t)}})),n.current}({data:e,columns:(0,R.useMemo)(()=>{let e=cs(t,S);return p&&e.unshift(F),s&&e.unshift(N),e},[t,S,p,s,F,N]),getRowId:c,getCoreRowModel:e=>aC(()=>[e.options.data],t=>{let n={rows:[],flatRows:[],rowsById:{}},i=function(t,r,o){void 0===r&&(r=0);let s=[];for(let a=0;a<t.length;a++){let u=aD(e,e._getRowId(t[a],a,o),t[a],a,r,void 0,null==o?void 0:o.id);if(n.flatRows.push(u),n.rowsById[u.id]=u,s.push(u),e.options.getSubRows){var l;u.originalSubRows=e.options.getSubRows(t[a],a),null!=(l=u.originalSubRows)&&l.length&&(u.subRows=i(u.originalSubRows,r+1,u))}}return s};return n.rows=i(t),n},aA(e.options,"debugTable","getRowModel",()=>e._autoResetPageIndex())),getSortedRowModel:e=>aC(()=>[e.getState().sorting,e.getPreSortedRowModel()],(t,n)=>{if(!n.rows.length||!(null!=t&&t.length))return n;let i=e.getState().sorting,r=[],o=i.filter(t=>{var n;return null==(n=e.getColumn(t.id))?void 0:n.getCanSort()}),s={};o.forEach(t=>{let n=e.getColumn(t.id);n&&(s[t.id]={sortUndefined:n.columnDef.sortUndefined,invertSorting:n.columnDef.invertSorting,sortingFn:n.getSortingFn()})});let l=e=>{let t=e.map(e=>({...e}));return t.sort((e,t)=>{for(let i=0;i<o.length;i+=1){var n;let r=o[i],l=s[r.id],a=l.sortUndefined,u=null!=(n=null==r?void 0:r.desc)&&n,c=0;if(a){let n=e.getValue(r.id),i=t.getValue(r.id),o=void 0===n,s=void 0===i;if(o||s){if("first"===a)return o?-1:1;if("last"===a)return o?1:-1;c=o&&s?0:o?a:-a}}if(0===c&&(c=l.sortingFn(e,t,r.id)),0!==c)return u&&(c*=-1),l.invertSorting&&(c*=-1),c}return e.index-t.index}),t.forEach(e=>{var t;r.push(e),null!=(t=e.subRows)&&t.length&&(e.subRows=l(e.subRows))}),t};return{rows:l(n.rows),flatRows:r,rowsById:n.rowsById}},aA(e.options,"debugTable","getSortedRowModel",()=>e._autoResetPageIndex())),getPaginationRowModel:m?e=>aC(()=>[e.getState().pagination,e.getPrePaginationRowModel(),e.options.paginateExpandedRows?void 0:e.getState().expanded],(t,n)=>{let i;if(!n.rows.length)return n;let{pageSize:r,pageIndex:o}=t,{rows:s,flatRows:l,rowsById:a}=n,u=r*o;s=s.slice(u,u+r),(i=e.options.paginateExpandedRows?{rows:s,flatRows:l,rowsById:a}:a6({rows:s,flatRows:l,rowsById:a})).flatRows=[];let c=e=>{i.flatRows.push(e),e.subRows.length&&e.subRows.forEach(c)};return i.rows.forEach(c),i},aA(e.options,"debugTable","getPaginationRowModel")):void 0,manualPagination:!m,enableRowSelection:!!s,onRowSelectionChange:e=>{let t="function"==typeof e?e(h):e;l?.(t)},onSortingChange:e=>{let t="function"==typeof e?e(d):e;a?.(t)},onColumnVisibilityChange:L,getSubRows:b,getExpandedRowModel:k?e=>aC(()=>[e.getState().expanded,e.getPreExpandedRowModel(),e.options.paginateExpandedRows],(e,t,n)=>t.rows.length&&(!0===e||Object.keys(null!=e?e:{}).length)&&n?a6(t):t,aA(e.options,"debugTable","getExpandedRowModel")):void 0,...O,sortDescFirst:!0,columnResizeMode:w,onExpandedChange:T,state:{rowSelection:h,sorting:d,globalFilter:y?.isSearchEnabled?D:void 0,columnVisibility:P,...m?{pagination:m}:{},expanded:M}}),H=(0,R.useCallback)((e,t)=>{let n=V.getRow(t);j(V,n,e.metaKey||e.shiftKey)},[j,V]);return(0,I.jsx)(cw,{...C,density:i,defaultColumnWidth:r,defaultColumnHeight:o,onRowClick:H,rows:V.getRowModel().rows,columns:V.getVisibleFlatColumns(),columnSizing:V.getState().columnSizing,columnSizingInfo:V.getState().columnSizingInfo,headers:V.getHeaderGroups(),cellConfigs:n,pagination:m,onPaginationChange:g,rowCount:V.getRowCount(),toolbarConfig:{isSearchEnabled:y?.isSearchEnabled,globalFilter:D,onGlobalFilterChange:E,isColumnFilterEnabled:y?.isColumnFilterEnabled,columns:V.getAllColumns(),columnFilterMenuMaxHeight:y?.columnFilterMenuMaxHeight,isExpandAllEnabled:k,isAllExpanded:V.getIsAllRowsExpanded(),onExpandAllChange:V.getToggleAllRowsExpandedHandler()}})}let cM=[{accessorKey:"label",header:"Name",enableSorting:!0,enableResizing:!0,cell:({getValue:e})=>(0,I.jsx)("span",{title:e(),children:e()})}],cT=e=>e.id,cD=e=>e.color;function cI({items:e,selectedItems:t,onSelectedItemsChange:n,onItemMouseOver:i,onItemMouseOut:r,height:o,width:s,columns:l=[],sorting:a,onSortingChange:u}){let c=(0,R.useMemo)(()=>"string"!=typeof t?t:e.reduce((e,t,n)=>(e[cT(t,n)]=!0,e),{}),[t,e]),h=(0,R.useMemo)(()=>{let e=Math.max(s-(l?.reduce((e,t)=>e+("number"==typeof t.width?t.width:150),0)??0)-45,60*cM.length)/cM.length;return[...cM.map(t=>({...t,width:e})),...l]},[l,s]);return(0,I.jsx)(ck,{height:o,width:s,rowSelection:c,onRowSelectionChange:n,onRowMouseOver:i,onRowMouseOut:r,sorting:a,onSortingChange:u,data:e,columns:h,density:"compact",defaultColumnWidth:"auto",getRowId:cT,getCheckboxColor:cD,checkboxSelection:!0,rowSelectionVariant:"legend"})}function cR({width:e,height:t,options:n,data:i,selectedItems:r,onSelectedItemsChange:o,onItemMouseOver:s,onItemMouseOut:l,tableProps:a}){let u,c=(e,t)=>{let n=e.metaKey||e.shiftKey;o((0,ot.jM)(r,e=>{if("ALL"===e)return{[t]:!0};let i=!!e[t];return n?(i?delete e[t]:e[t]=!0,e):i?"ALL":{[t]:!0}}))},h=nR(n.mode),d=i.length>=500,f={height:t,items:i,selectedItems:r,onLegendItemClick:c,onItemMouseOver:s,onItemMouseOut:l};return(u="table"===h?(0,I.jsx)(cI,{...f,onSelectedItemsChange:o,width:e,...a}):"right"===n.position||d?(0,I.jsx)(ab,{...f,width:e,onLegendItemClick:c}):(0,I.jsx)(ax,{...f,onLegendItemClick:c}),"right"===n.position)?(0,I.jsx)(oe.A,{style:{width:e,height:t},sx:{position:"absolute",top:0,right:0,backgroundColor:e=>`${e.palette.background.default}`},children:u}):(0,I.jsx)(oe.A,{style:{width:e,height:t},sx:{position:"absolute",bottom:0,backgroundColor:e=>`${e.palette.background.default}`},children:u})}let cE={medium:{bottom:6,right:250},small:{bottom:4,right:150}};function cO({children:e,legendProps:t,width:n,height:i,spacing:r=0,legendSize:o,minChildrenWidth:s=100,minChildrenHeight:l=100}){let{content:a,legend:u,margin:c}=function({width:e,height:t,legendProps:n,legendSize:i,minChildrenHeight:r,minChildrenWidth:o,spacing:s,theme:l}){let a,u,c=n?.options,h={legend:{show:!1,width:0,height:0},content:{width:e,height:t},margin:{right:0,bottom:0}};if(!c)return h;let{position:d}=c;if("list"===nR(c.mode))a="right"===d?200:e,u=40,"right"===d?u=t:t>=300&&(u=100);else{let r=co(l,"compact"),o=(n?.tableProps?.columns||[]).reduce((e,t)=>("number"==typeof t.width&&(e+=t.width),e),0);a="right"===d?cE[i].right+o:e;let s=Math.min(cE[i].bottom,n.data.length+1);u="bottom"===d?s*r.height:t}let f="right"===d?e-a-s:e,p="bottom"===d?t-u-s:t;return"right"===d&&f<o||"bottom"===d&&p<r?h:{legend:{width:a,height:u,show:!0},content:{width:f,height:p},margin:{right:"right"===d?s:0,bottom:"bottom"===d?s:0}}}({width:n,height:i,legendProps:t,minChildrenHeight:l,minChildrenWidth:s,spacing:r,theme:(0,r7.A)(),legendSize:nE(o)});return(0,I.jsxs)(oe.A,{style:{width:n,height:i},sx:{position:"relative",overflow:"hidden"},children:[(0,I.jsx)(oe.A,{style:{width:a.width,height:a.height},sx:{marginRight:`${c.right}px`,marginBottom:`${c.bottom}px`},children:"function"==typeof e?e({width:a.width,height:a.height}):e}),t&&u.show&&(0,I.jsx)(cR,{...t,height:u.height,width:u.width})]})}var cP=n(91467),cL=n(66834),cj=n(92890),cB=n(39750);let cF=(0,F.A)("form")({overflowY:"auto",display:"flex",flexDirection:"column"}),cN=e=>({position:"absolute",top:e.spacing(.5),right:e.spacing(.5)}),cV=({children:e,...t})=>(0,I.jsx)(cj.A,{...t,children:e});cV.Header=({children:e,onClose:t,...n})=>(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(cP.A,{style:{textOverflow:"ellipsis",overflow:"hidden"},...n,children:e}),t&&(0,I.jsx)(Q.A,{"aria-label":"Close",onClick:t,sx:cN,children:(0,I.jsx)(u_.default,{})})]}),cV.Form=cF,cV.Content=({children:e,sx:t,...n})=>(0,I.jsx)(cL.A,{dividers:!0,...n,sx:iH({minWidth:"500px",textWrap:"balance"},t),children:e}),cV.PrimaryButton=({children:e,...t})=>(0,I.jsx)(K.A,{variant:"contained",type:"submit",...t,children:e}),cV.SecondaryButton=({children:e,...t})=>(0,I.jsx)(K.A,{variant:"outlined",color:"secondary",...t,children:e}),cV.Actions=cB.A;let cH=e=>{let{description:t,isOpen:n,onCancel:i,onDiscardChanges:r}=e;return(0,I.jsxs)(cV,{open:n,"aria-labelledby":"discard-dialog",children:[(0,I.jsx)(cV.Header,{children:"Discard Changes"}),(0,I.jsx)(cV.Content,{children:t}),(0,I.jsxs)(cV.Actions,{children:[(0,I.jsx)(K.A,{variant:"contained",onClick:r,children:"Discard Changes"}),(0,I.jsx)(K.A,{variant:"outlined",color:"secondary",onClick:i,children:"Cancel"})]})]})};var cz=n(66395);let cW=({children:e})=>(0,I.jsx)(cz.Ay,{item:!0,xs:4,children:(0,I.jsx)(Z.A,{spacing:3,children:e})});var c$=n(67987),c_=n(9799),cU=n(17366),cG=n(32751);let cq=({id:e,title:t,description:n,placement:i,children:r,enterDelay:o,enterNextDelay:s})=>{let l=(0,I.jsx)("span",{children:r});return(0,I.jsx)(cK,{arrow:!0,id:e,placement:i??"top",title:(0,I.jsx)(cY,{title:t,description:n}),enterDelay:o??500,enterNextDelay:s??500,children:l})},cY=({title:e,description:t})=>(0,I.jsxs)(I.Fragment,{children:[e&&(0,I.jsx)(uL.A,{variant:"body2",sx:e=>({color:e.palette.text.primary,fontWeight:e.typography.fontWeightMedium}),children:e}),(0,I.jsx)(uL.A,{variant:"caption",sx:e=>({color:e.palette.text.primary,whiteSpace:"pre-line"}),children:t})]}),cK=(0,F.A)(({className:e,...t})=>(0,I.jsx)(uz.A,{...t,classes:{popper:e}}))(({theme:e})=>({[`& .${cG.A.tooltip}`]:{backgroundColor:e.palette.background.tooltip,color:e.palette.text.primary,maxWidth:"300px",padding:e.spacing(1),boxShadow:e.shadows[1]},[`& .${cG.A.arrow}`]:{color:e.palette.background.tooltip}})),cX=({label:e,control:t,description:n})=>{let i=iz("EditorSectionControl"),r=`${i}-control`,o=`${i}-label`;return(0,I.jsx)(c$.A,{children:(0,I.jsxs)(Z.A,{direction:"row",alignItems:"center",justifyContent:"space-between",children:[(0,I.jsxs)(Z.A,{direction:"row",alignItems:"center",justifyContent:"center",children:[(0,I.jsx)(c_.A,{id:o,htmlFor:r,children:e}),n&&(0,I.jsx)(cq,{description:n,enterDelay:100,children:(0,I.jsx)(Q.A,{size:"small",sx:e=>({borderRadius:e.shape.borderRadius,padding:"4x",margin:"0 2px"}),children:(0,I.jsx)(cU.default,{"aria-describedby":"info-tooltip","aria-hidden":!1,fontSize:"inherit",sx:{color:e=>e.palette.grey[700]}})})})]}),(0,I.jsxs)(oe.A,{sx:{width:"180px",textAlign:"right"},children:[" ",E().cloneElement(t,{id:r,"aria-labelledby":o})]})]})})},cZ=({children:e})=>(0,I.jsx)(cz.Ay,{container:!0,spacing:8,children:e}),cQ=({title:e,children:t,icon:n})=>(0,I.jsxs)(oe.A,{children:[(0,I.jsxs)(oe.A,{display:"flex",borderBottom:1,borderColor:"grey.300",marginBottom:e=>e.spacing(1),children:[(0,I.jsx)(uL.A,{variant:"overline",component:"h4",children:e}),n&&(0,I.jsx)(oe.A,{sx:{marginLeft:"auto"},children:n})]}),(0,I.jsx)(Z.A,{spacing:1,children:t})]});var cJ=n(5611),c0=n(81227);function c1({options:e,renderInput:t=e=>(0,I.jsx)(J.A,{...e}),id:n,"aria-labelledby":i,...r}){let o=e=>e.label??e.id;return(0,I.jsx)(cJ.A,{isOptionEqualToValue:(e,t)=>e.id===t.id,getOptionDisabled:e=>!!e.disabled,getOptionLabel:o,options:e,renderInput:e=>t({...e,inputProps:{...e.inputProps,id:n,"aria-labelledby":i}}),renderOption:({key:e,...t},n)=>(0,I.jsx)("li",{...t,children:(0,I.jsxs)("div",{children:[(0,I.jsx)(uL.A,{variant:"body1",component:"div",children:o(n)}),n.description&&(0,I.jsx)(uL.A,{variant:"body2",component:"div",sx:{color:e=>e.palette.text.secondary},children:n.description})]})},e),filterOptions:(0,c0.Z)({stringify:e=>`${o(e)} ${e.description||""}`}),...r})}let c2=[{id:"compact",label:"Compact"},{id:"standard",label:"Standard"},{id:"comfortable",label:"Comfortable"}];function c5({onChange:e,value:t="standard"}){return(0,I.jsx)(cX,{label:"Density",control:(0,I.jsx)(c1,{value:c2.find(e=>e.id===t),options:c2,getOptionLabel:e=>e.label,onChange:(t,{id:n})=>{e(n)},disableClearable:!0})})}function c3(){return(0,I.jsxs)(Z.A,{direction:"row",alignItems:"center",children:[(0,I.jsx)(oe.A,{sx:{content:'""',width:8,height:8,boxSizing:"border-box",position:"absolute",backgroundColor:e=>e.palette.background.default,border:e=>`2px solid ${e.palette.info.main}`,borderRadius:"50%"}}),(0,I.jsx)(oe.A,{sx:{content:'""',height:2,background:e=>e.palette.info.main,width:"100%"}})]})}function c4(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=Array(t);n<t;n++)i[n]=e[n];return i}function c6(e,t){if(e){if("string"==typeof e)return c4(e,t);var n=({}).toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?c4(e,t):void 0}}function c8(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var i,r,o,s,l=[],a=!0,u=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;a=!1}else for(;!(a=(i=o.call(n)).done)&&(l.push(i.value),l.length!==t);a=!0);}catch(e){u=!0,r=e}finally{try{if(!a&&null!=n.return&&(s=n.return(),Object(s)!==s))return}finally{if(u)throw r}}return l}}(e,t)||c6(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var c9=n(96907),c7="data-pdnd-honey-pot";function he(e){return e instanceof Element&&e.hasAttribute(c7)}function ht(e){var t=c8(document.elementsFromPoint(e.x,e.y),2),n=t[0],i=t[1];return n?he(n)?null!=i?i:null:n:null}function hn(e){return(hn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function hi(e,t,n){var i;return(i=function(e,t){if("object"!=hn(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,t||"default");if("object"!=hn(i))return i;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(t,"string"),(t="symbol"==hn(i)?i:i+"")in e)?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var hr={inset:"unset",border:"none",padding:0,margin:0,overflow:"visible",color:"inherit",background:"transparent"};function ho(e){var t=null;return function(){if(!t){for(var n=arguments.length,i=Array(n),r=0;r<n;r++)i[r]=arguments[r];t={result:e.apply(this,i)}}return t.result}}var hs=ho(function(){return"u">typeof HTMLElement&&"function"==typeof HTMLElement.prototype.showPopover});function hl(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,i)}return n}function ha(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?hl(Object(n),!0).forEach(function(t){hi(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):hl(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function hu(e){var t,n,i,r,o={x:Math.min((r={x:Math.max((i={x:(n={x:Math.floor((t=e.client).x),y:Math.floor(t.y)}).x-1,y:n.y-1}).x,0),y:Math.max(i.y,0)}).x,window.innerWidth-2),y:Math.min(r.y,window.innerHeight-2)};return DOMRect.fromRect({x:o.x,y:o.y,width:2,height:2})}function hc(e){var t=e.clientRect;return{left:"".concat(t.left,"px"),top:"".concat(t.top,"px"),width:"".concat(t.width,"px"),height:"".concat(t.height,"px")}}function hh(e){return function(e){if(Array.isArray(e))return c4(e)}(e)||function(e){if("u">typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||c6(e)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var hd=ho(function(){return navigator.userAgent.includes("Firefox")}),hf=ho(function(){var e=navigator.userAgent;return e.includes("AppleWebKit")&&!e.includes("Chrome")}),hp={isLeavingWindow:Symbol("leaving"),isEnteringWindow:Symbol("entering")};if(!("u"<typeof window)&&hf()){var hm=hg();(0,c9.bindAll)(window,[{type:"dragstart",listener:function(){hm.enterCount=0,hm.isOverWindow=!0}},{type:"drop",listener:hv},{type:"dragend",listener:hv},{type:"dragenter",listener:function(e){hm.isOverWindow||0!==hm.enterCount||(e[hp.isEnteringWindow]=!0),hm.isOverWindow=!0,hm.enterCount++}},{type:"dragleave",listener:function(e){hm.enterCount--,hm.isOverWindow&&0===hm.enterCount&&(e[hp.isLeavingWindow]=!0,hm.isOverWindow=!1)}}],{capture:!0})}function hg(){return{enterCount:0,isOverWindow:!1}}function hv(){hm=hg()}function hb(e){return{altKey:e.altKey,button:e.button,buttons:e.buttons,ctrlKey:e.ctrlKey,metaKey:e.metaKey,shiftKey:e.shiftKey,clientX:e.clientX,clientY:e.clientY,pageX:e.pageX,pageY:e.pageY}}var hx=(l=function(e){return e()},a=[],u=null,(c=function(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];a=t,u||(u=requestAnimationFrame(function(){u=null,l.apply(void 0,a)}))}).cancel=function(){u&&(cancelAnimationFrame(u),u=null)},c),hy=(h=null,{schedule:function(e){h={frameId:requestAnimationFrame(function(){h=null,e()}),fn:e}},flush:function(){h&&(cancelAnimationFrame(h.frameId),h.fn(),h=null)}}),hw={isActive:!1};function hS(){return!hw.isActive}function hC(e){var t,n=e.event,i=null==(t=e.current[0])?void 0:t.dropEffect;null!=i&&n.dataTransfer&&(n.dataTransfer.dropEffect=i)}var hA=function(e){var t=e.event,n=e.dragType,i=e.getDropTargetsOver,r=e.dispatchEvent;if(hS()){var o,s,l=function(e){var t=e.event,n=e.dragType,i=e.getDropTargetsOver,r=hb(t);if("external"===n.startedFrom)return{input:r,dropTargets:[]};var o=i({input:r,source:n.payload,target:t.target,current:[]});return{input:r,dropTargets:o}}({event:t,dragType:n,getDropTargetsOver:i});hw.isActive=!0;var a={current:l};hC({event:t,current:l.dropTargets});var u=function(e){var t=e.source,n=e.initial,i=e.dispatchEvent,r={dropTargets:[]};function o(e){i(e),r={dropTargets:e.payload.location.current.dropTargets}}return{start:function(e){var i=e.nativeSetDragImage,s={current:n,previous:r,initial:n};o({eventName:"onGenerateDragPreview",payload:{source:t,location:s,nativeSetDragImage:i}}),hy.schedule(function(){o({eventName:"onDragStart",payload:{source:t,location:s}})})},dragUpdate:function(e){var i=e.current;hy.flush(),hx.cancel(),o({eventName:"onDropTargetChange",payload:{source:t,location:{initial:n,previous:r,current:i}}})},drag:function(e){var i=e.current;hx(function(){hy.flush(),o({eventName:"onDrag",payload:{source:t,location:{initial:n,previous:r,current:i}}})})},drop:function(e){var i=e.current,s=e.updatedSourcePayload;hy.flush(),hx.cancel(),o({eventName:"onDrop",payload:{source:null!=s?s:t,location:{current:i,previous:r,initial:n}}})}}}({source:n.payload,dispatchEvent:r,initial:l}),c=(0,c9.bindAll)(window,[{type:"dragover",listener:function(e){d(e),u.drag({current:a.current})}},{type:"dragenter",listener:d},{type:"dragleave",listener:function(e){(function(e){var t=e.dragLeave,n=t.type,i=t.relatedTarget;return"dragleave"===n&&(hf()?!!hf()&&t.hasOwnProperty(hp.isLeavingWindow):null==i||(hd()?"nodeName"in i&&i.ownerDocument!==document:i instanceof HTMLIFrameElement))})({dragLeave:e})&&(h({input:a.current.input,dropTargets:[]}),"external"===n.startedFrom&&f())}},{type:"drop",listener:function(e){(a.current={dropTargets:a.current.dropTargets,input:hb(e)},a.current.dropTargets.length)?(e.preventDefault(),hC({event:e,current:a.current.dropTargets}),u.drop({current:a.current,updatedSourcePayload:"external"===n.type?n.getDropPayload(e):null}),p()):f()}},{type:"dragend",listener:function(e){a.current={dropTargets:a.current.dropTargets,input:hb(e)},f()}}].concat(hh([{type:"pointermove",listener:(s=0,function(){s<20?s++:o()})},{type:"pointerdown",listener:o=f}])),{capture:!0});u.start({nativeSetDragImage:t.dataTransfer?t.dataTransfer.setDragImage.bind(t.dataTransfer):null})}function h(e){var t=function(e){var t=e.current,n=e.next;if(t.length!==n.length)return!0;for(var i=0;i<t.length;i++)if(t[i].element!==n[i].element)return!0;return!1}({current:a.current.dropTargets,next:e.dropTargets});a.current=e,t&&u.dragUpdate({current:a.current})}function d(e){var t=hb(e),r=i({target:he(e.target)?ht({x:t.clientX,y:t.clientY}):e.target,input:t,source:n.payload,current:a.current.dropTargets});r.length&&(e.preventDefault(),hC({event:e,current:r})),h({dropTargets:r,input:t})}function f(){a.current.dropTargets.length&&h({dropTargets:[],input:a.current.input}),u.drop({current:a.current,updatedSourcePayload:null}),p()}function p(){hw.isActive=!1,c()}},hk=new Map;function hM(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(){t.forEach(function(e){return e()})}}function hT(e,t){var n=t.attribute,i=t.value;return e.setAttribute(n,i),function(){return e.removeAttribute(n)}}function hD(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,i)}return n}function hI(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?hD(Object(n),!0).forEach(function(t){hi(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):hD(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function hR(e,t){var n="u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e){if(e){if("string"==typeof e)return hE(e,void 0);var t=({}).toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?hE(e,void 0):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var i=0,r=function(){};return{s:r,n:function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:r}}throw TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,s=!0,l=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return s=e.done,e},e:function(e){l=!0,o=e},f:function(){try{s||null==n.return||n.return()}finally{if(l)throw o}}}}function hE(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=Array(t);n<t;n++)i[n]=e[n];return i}function hO(e){return e.slice(0).reverse()}function hP(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=Array(t);n<t;n++)i[n]=e[n];return i}function hL(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,i)}return n}var hj=ho(function(){return navigator.userAgent.toLocaleLowerCase().includes("android")}),hB="text/plain",hF=new WeakMap,hN=(d=null,{bindEvents:function(){return d=null,(0,c9.bind)(window,{type:"pointermove",listener:function(e){d={x:e.clientX,y:e.clientY}},options:{capture:!0}})},getOnPostDispatch:function(){var e=null;return function(t){var n=t.eventName,i=t.payload;if("onDragStart"===n){var r,o,s,l=i.location.initial.input,a=null!=d?d:{x:l.clientX,y:l.clientY};(r=document.createElement("div")).setAttribute(c7,"true"),hs()&&r.setAttribute("popover","manual"),o=hu({client:a}),Object.assign(r.style,ha(ha({position:"fixed"},hs()?hr:{zIndex:0x7fffffff}),{},{backgroundColor:"transparent",padding:0,margin:0,boxSizing:"border-box",pointerEvents:"auto"},hc({clientRect:o}))),document.body.appendChild(r),hs()&&r.showPopover(),s=(0,c9.bind)(window,{type:"pointermove",listener:function(e){o=hu({client:{x:e.clientX,y:e.clientY}}),Object.assign(r.style,hc({clientRect:o}))},options:{capture:!0}}),e=function(e){var t,n,i,l=e.current;if(s(),n=(t={client:l,clientRect:o}).client,i=t.clientRect,n.x>=i.x&&n.x<=i.x+i.width&&n.y>=i.y&&n.y<=i.y+i.height)return void r.remove();function a(){u(),r.remove()}var u=(0,c9.bindAll)(window,[{type:"pointerdown",listener:a},{type:"pointermove",listener:a},{type:"focusin",listener:a},{type:"focusout",listener:a},{type:"dragstart",listener:a},{type:"dragenter",listener:a},{type:"dragover",listener:a}],{capture:!0})}}if("onDrop"===n){var u,c=i.location.current.input;null==(u=e)||u({current:{x:c.clientX,y:c.clientY}}),e=null,d=null}}}}),hV=function(e){var t=e.typeKey,n=e.mount,i=e.dispatchEventToSource,r=e.onPostDispatch,o=e.defaultDropEffect,s=function(){var e=new Set,t=null;function n(e){t&&(!e.canMonitor||e.canMonitor(t.canMonitorArgs))&&t.active.add(e)}return{dispatchEvent:function(i){var r=i.eventName,o=i.payload;if("onGenerateDragPreview"===r){t={canMonitorArgs:{initial:o.location.initial,source:o.source},active:new Set};var s,l=function(e){var t="u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!t){if(Array.isArray(e)||(t=function(e){if(e){if("string"==typeof e)return hP(e,void 0);var t=({}).toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?hP(e,void 0):void 0}}(e))){t&&(e=t);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:i}}throw TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,o=!0,s=!1;return{s:function(){t=t.call(e)},n:function(){var e=t.next();return o=e.done,e},e:function(e){s=!0,r=e},f:function(){try{o||null==t.return||t.return()}finally{if(s)throw r}}}}(e);try{for(l.s();!(s=l.n()).done;){var a=s.value;n(a)}}catch(e){l.e(e)}finally{l.f()}}if(t){for(var u=Array.from(t.active),c=0;c<u.length;c++){var h,d=u[c];t.active.has(d)&&(null==(h=d[r])||h.call(d,o))}"onDrop"===r&&(t.active.clear(),t=null)}},monitorForConsumers:function(i){var r=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?hL(Object(n),!0).forEach(function(t){hi(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):hL(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}({},i);return e.add(r),n(r),ho(function(){e.delete(r),t&&t.active.delete(r)})}}}(),l=function(e){var t=e.typeKey,n=e.defaultDropEffect,i=new WeakMap,r="data-drop-target-for-".concat(t),o="[".concat(r,"]");function s(e){var t,n=e.eventName,r=e.payload,o=hR(r.location.current.dropTargets);try{for(o.s();!(t=o.n()).done;){var s,l=t.value,a=i.get(l.element),u=hI(hI({},r),{},{self:l});null==a||null==(s=a[n])||s.call(a,u)}}catch(e){o.e(e)}finally{o.f()}}var l={onGenerateDragPreview:s,onDrag:s,onDragStart:s,onDrop:s,onDropTargetChange:function(e){var t,n=e.payload,r=new Set(n.location.current.dropTargets.map(function(e){return e.element})),o=new Set,s=hR(n.location.previous.dropTargets);try{for(s.s();!(t=s.n()).done;){var l,a,u=t.value;o.add(u.element);var c=i.get(u.element),h=r.has(u.element),d=hI(hI({},n),{},{self:u});null==c||null==(l=c.onDropTargetChange)||l.call(c,d),h||null==c||null==(a=c.onDragLeave)||a.call(c,d)}}catch(e){s.e(e)}finally{s.f()}var f,p=hR(n.location.current.dropTargets);try{for(p.s();!(f=p.n()).done;){var m,g,v=f.value;if(!o.has(v.element)){var b=hI(hI({},n),{},{self:v}),x=i.get(v.element);null==x||null==(m=x.onDropTargetChange)||m.call(x,b),null==x||null==(g=x.onDragEnter)||g.call(x,b)}}}catch(e){p.e(e)}finally{p.f()}}};return{dropTargetForConsumers:function(e){return ho(hM(hT(e.element,{attribute:r,value:"true"}),(i.set(e.element,e),function(){return i.delete(e.element)})))},getIsOver:function(e){var t=e.source,r=e.target,s=e.input,l=e.current,a=function e(t){var r,s,l,a,u=t.source,c=t.target,h=t.input,d=t.result,f=void 0===d?[]:d;if(null==c)return f;if(!(c instanceof Element))return c instanceof Node?e({source:u,target:c.parentElement,input:h,result:f}):f;var p=c.closest(o);if(null==p)return f;var m=i.get(p);if(null==m)return f;var g={input:h,source:u,element:m.element};if(m.canDrop&&!m.canDrop(g))return e({source:u,target:m.element.parentElement,input:h,result:f});var v=null!=(r=null==(s=m.getData)?void 0:s.call(m,g))?r:{},b=null!=(l=null==(a=m.getDropEffect)?void 0:a.call(m,g))?l:n,x={data:v,element:m.element,dropEffect:b,isActiveDueToStickiness:!1};return e({source:u,target:m.element.parentElement,input:h,result:[].concat(hh(f),[x])})}({source:t,target:r,input:s});if(a.length>=l.length)return a;for(var u=hO(l),c=hO(a),h=[],d=0;d<u.length;d++){var f,p=u[d],m=c[d];if(null!=m){h.push(m);continue}var g=h[d-1],v=u[d-1];if((null==g?void 0:g.element)!==(null==v?void 0:v.element))break;var b=i.get(p.element);if(!b)break;var x={input:s,source:t,element:b.element};if(b.canDrop&&!b.canDrop(x)||!(null!=(f=b.getIsSticky)&&f.call(b,x)))break;h.push(hI(hI({},p),{},{isActiveDueToStickiness:!0}))}return hO(h)},dispatchEvent:function(e){l[e.eventName](e)}}}({typeKey:t,defaultDropEffect:o});function a(e){null==i||i(e),l.dispatchEvent(e),s.dispatchEvent(e),null==r||r(e)}function u(e){hA({event:e.event,dragType:e.dragType,getDropTargetsOver:l.getIsOver,dispatchEvent:a})}return{registerUsage:function(){var e,i;return i=function(e){var t=e.typeKey,n=e.mount,i=hk.get(t);if(i)return i.usageCount++,i;var r={typeKey:t,unmount:n(),usageCount:1};return hk.set(t,r),r}(e={typeKey:t,mount:function(){return n({canStart:hS,start:u})}}),function(){i.usageCount--,i.usageCount>0||(i.unmount(),hk.delete(e.typeKey))}},dropTarget:l.dropTargetForConsumers,monitor:s.monitorForConsumers}}({typeKey:"element",defaultDropEffect:"move",mount:function(e){return hM(hN.bindEvents(),(0,c9.bind)(document,{type:"dragstart",listener:function(t){if(e.canStart(t)&&!t.defaultPrevented&&t.dataTransfer){var n,i,r,o,s,l,a=t.target;if(a instanceof HTMLElement){var u=hF.get(a);if(u){var c=hb(t),h={element:u.element,dragHandle:null!=(n=u.dragHandle)?n:null,input:c};if(u.canDrag&&!u.canDrag(h))return void t.preventDefault();if(u.dragHandle){var d=ht({x:c.clientX,y:c.clientY});if(!u.dragHandle.contains(d))return void t.preventDefault()}var f=null!=(i=null==(r=u.getInitialDataForExternal)?void 0:r.call(u,h))?i:null;if(f)for(var p=0,m=Object.entries(f);p<m.length;p++){var g=c8(m[p],2),v=g[0],b=g[1];t.dataTransfer.setData(v,null!=b?b:"")}!hj()||t.dataTransfer.types.includes(hB)||t.dataTransfer.types.includes("text/uri-list")||t.dataTransfer.setData(hB,"pdnd:android-fallback"),t.dataTransfer.setData("application/vnd.pdnd","");var x={element:u.element,dragHandle:null!=(o=u.dragHandle)?o:null,data:null!=(s=null==(l=u.getInitialData)?void 0:l.call(u,h))?s:{}};e.start({event:t,dragType:{type:"element",payload:x,startedFrom:"internal"}})}}}}}))},dispatchEventToSource:function(e){var t,n,i=e.eventName,r=e.payload;null==(t=hF.get(r.source.element))||null==(n=t[i])||n.call(t,r)},onPostDispatch:hN.getOnPostDispatch()}),hH=hV.dropTarget,hz=hV.monitor;function hW(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,i)}return n}function h$(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?hW(Object(n),!0).forEach(function(t){hi(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):hW(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var h_={top:function(e,t){return Math.abs(t.y-e.top)},right:function(e,t){return Math.abs(e.right-t.x)},bottom:function(e,t){return Math.abs(e.bottom-t.y)},left:function(e,t){return Math.abs(t.x-e.left)}},hU=Symbol("closestEdge");function hG(e){var t;return null!=(t=e[hU])?t:null}let hq={type:"idle"};function hY({elements:e,accessKey:t,axis:n="vertical",onChange:i}){return(0,R.useEffect)(()=>hz({onDrop({location:r,source:o}){var s,l;let a=r.current.dropTargets[0];if(!a)return;let u=o.data,c=a.data,h=e.findIndex(e=>e[t]===u[t]),d=e.findIndex(e=>e[t]===c[t]);d<0||h<0||i(function(e){var t=e.list,n=e.startIndex,i=e.finishIndex;if(-1===n||-1===i)return Array.from(t);var r=Array.from(t),o=c8(r.splice(n,1),1)[0];return r.splice(i,0,o),r}({list:(s={list:e,startIndex:h,indexOfTarget:d,closestEdgeOfTarget:hG(c),axis:n}).list,startIndex:l=s.startIndex,finishIndex:function(e){var t=e.startIndex,n=e.closestEdgeOfTarget,i=e.indexOfTarget,r=e.axis;if(-1===t||-1===i||t===i)return t;if(null==n)return i;var o="vertical"===r&&"bottom"===n||"horizontal"===r&&"right"===n;return t<i?o?i:i-1:o?i+1:i}({closestEdgeOfTarget:s.closestEdgeOfTarget,startIndex:l,indexOfTarget:s.indexOfTarget,axis:s.axis})}))}}),[t,n,e,i])}function hK({children:e,data:t}){let n=(0,R.useRef)(null),[i,r]=(0,R.useState)(hq);return(0,R.useEffect)(()=>{let e=n.current;if(e){var i;return hM((i={element:e,getInitialData:()=>t,onDragStart(){r({type:"is-dragging"})},onDrop(){r(hq)}},ho(hM(hV.registerUsage(),(hF.set(i.element,i),function(){hF.delete(i.element)}),hT(i.element,{attribute:"draggable",value:"true"})))),hH({element:e,canDrop:({source:t})=>t.element!==e,getData:({input:n})=>{var i,r,o,s,l,a,u,c,h;return s=(i={element:e,input:n,allowedEdges:["top","bottom"]}).element,l=i.input,a=i.allowedEdges,u={x:l.clientX,y:l.clientY},c=s.getBoundingClientRect(),h=null!=(r=null==(o=a.map(function(e){return{edge:e,value:h_[e](c,u)}}).sort(function(e,t){return e.value-t.value})[0])?void 0:o.edge)?r:null,h$(h$({},t),{},hi({},hU,h))},getIsSticky:()=>!0,onDragEnter({self:e}){r({type:"is-dragging-over",closestEdge:hG(e.data)})},onDrag({self:e}){let t=hG(e.data);r(e=>"is-dragging-over"===e.type&&e.closestEdge===t?e:{type:"is-dragging-over",closestEdge:t})},onDragLeave(){r(hq)},onDrop(){r(hq)}}))}},[t]),(0,I.jsxs)(Z.A,{ref:n,spacing:1,style:{opacity:"is-dragging"===i.type?.5:"unset"},children:["is-dragging-over"===i.type&&"top"===i.closestEdge?(0,I.jsx)(c3,{}):null,e,"is-dragging-over"===i.type&&"bottom"===i.closestEdge?(0,I.jsx)(c3,{}):null]})}var hX=n(53064);function hZ(e,t){let n=t.indexOf(e);if(0===n)return t;let i=[...t];return i.splice(n,1),i.splice(n-1,0,e),i}function hQ(e,t){let n=t.indexOf(e);if(n===t.length-1)return t;let i=[...t];return i.splice(n,1),i.splice(n+1,0,e),i}let hJ=(0,R.forwardRef)(function({onMoveUp:e,onMoveDown:t,onMoveLeft:n,onMoveRight:i,menuSx:r,...o},s){let[l,a]=(0,R.useState)(null),u=!!l;function c(e){a(null),e?.()}return(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(Q.A,{...o,ref:s,"aria-label":"move","aria-haspopup":!0,"aria-expanded":u,size:"small",onClick:function(e){a(e.currentTarget)},children:(0,I.jsx)(hX.default,{})}),(e||t||n||i)&&(0,I.jsxs)(uW.A,{id:"drag-button-menu",MenuListProps:{"aria-labelledby":"drag-button-menu"},anchorEl:l,open:u,onClose:()=>c(void 0),sx:r,children:[e&&(0,I.jsx)(ul.A,{onClick:()=>c(e),children:"Move Up"}),t&&(0,I.jsx)(ul.A,{onClick:()=>c(t),children:"Move Down"}),n&&(0,I.jsx)(ul.A,{onClick:()=>c(n),children:"Move Left"}),i&&(0,I.jsx)(ul.A,{onClick:()=>c(i),children:"Move Right"}),i&&(0,I.jsx)(ul.A,{onClick:()=>c(i),children:"Move Right"})]})]})});var h0=n(8072),h1=n(10972),h2=n(46477),h5=n(30443),h3=n(55403),h4=n(32494),h6=n(63025);function h8(e,t,n){let i=function(e,t,n){let i,r=t.getBoundingClientRect(),o=n&&n.getBoundingClientRect(),s=(0,h6.A)(t);if(t.fakeTransform)i=t.fakeTransform;else{let e=s.getComputedStyle(t);i=e.getPropertyValue("-webkit-transform")||e.getPropertyValue("transform")}let l=0,a=0;if(i&&"none"!==i&&"string"==typeof i){let e=i.split("(")[1].split(")")[0].split(",");l=parseInt(e[4],10),a=parseInt(e[5],10)}return"left"===e?o?`translateX(${o.right+l-r.left}px)`:`translateX(${s.innerWidth+l-r.left}px)`:"right"===e?o?`translateX(-${r.right-o.left-l}px)`:`translateX(-${r.left+r.width-l}px)`:"up"===e?o?`translateY(${o.bottom+a-r.top}px)`:`translateY(${s.innerHeight+a-r.top}px)`:o?`translateY(-${r.top-o.top+r.height-a}px)`:`translateY(-${r.top+r.height-a}px)`}(e,t,"function"==typeof n?n():n);i&&(t.style.webkitTransform=i,t.style.transform=i)}let h9=R.forwardRef(function(e,t){let n=(0,r7.A)(),i={enter:n.transitions.easing.easeOut,exit:n.transitions.easing.sharp},r={enter:n.transitions.duration.enteringScreen,exit:n.transitions.duration.leavingScreen},{addEndListener:o,appear:s=!0,children:l,container:a,direction:u="down",easing:c=i,in:h,onEnter:d,onEntered:f,onEntering:p,onExit:m,onExited:g,onExiting:v,style:b,timeout:x=r,TransitionComponent:y=h2.Ay,...w}=e,S=R.useRef(null),C=(0,al.A)((0,h5.A)(l),S,t),A=e=>t=>{e&&(void 0===t?e(S.current):e(S.current,t))},k=A((e,t)=>{h8(u,e,a),(0,h4.q)(e),d&&d(e,t)}),M=A((e,t)=>{let i=(0,h4.c)({timeout:x,style:b,easing:c},{mode:"enter"});e.style.webkitTransition=n.transitions.create("-webkit-transform",{...i}),e.style.transition=n.transitions.create("transform",{...i}),e.style.webkitTransform="none",e.style.transform="none",p&&p(e,t)}),T=A(f),D=A(v),E=A(e=>{let t=(0,h4.c)({timeout:x,style:b,easing:c},{mode:"exit"});e.style.webkitTransition=n.transitions.create("-webkit-transform",t),e.style.transition=n.transitions.create("transform",t),h8(u,e,a),m&&m(e)}),O=A(e=>{e.style.webkitTransition="",e.style.transition="",g&&g(e)}),P=R.useCallback(()=>{S.current&&h8(u,S.current,a)},[u,a]);return R.useEffect(()=>{if(h||"down"===u||"right"===u)return;let e=(0,h3.A)(()=>{S.current&&h8(u,S.current,a)}),t=(0,h6.A)(S.current);return t.addEventListener("resize",e),()=>{e.clear(),t.removeEventListener("resize",e)}},[u,h,a]),R.useEffect(()=>{h||P()},[h,P]),(0,I.jsx)(y,{nodeRef:S,onEnter:k,onEntered:T,onEntering:M,onExit:E,onExited:O,onExiting:D,addEndListener:e=>{o&&o(S.current,e)},appear:s,in:h,timeout:x,...w,children:(e,{ownerState:t,...n})=>R.cloneElement(l,{ref:C,style:{visibility:"exited"!==e||h?void 0:"hidden",...b,...l.props.style},...n})})});var h7=n(11502);function de(e){return(0,W.Ay)("MuiDrawer",e)}(0,z.A)("MuiDrawer",["root","docked","paper","anchorLeft","anchorRight","anchorTop","anchorBottom","paperAnchorLeft","paperAnchorRight","paperAnchorTop","paperAnchorBottom","paperAnchorDockedLeft","paperAnchorDockedRight","paperAnchorDockedTop","paperAnchorDockedBottom","modal"]);var dt=n(64606);let dn=(e,t)=>{let{ownerState:n}=e;return[t.root,("permanent"===n.variant||"persistent"===n.variant)&&t.docked,t.modal]},di=(0,F.A)(h1.A,{name:"MuiDrawer",slot:"Root",overridesResolver:dn})((0,N.A)(({theme:e})=>({zIndex:(e.vars||e).zIndex.drawer}))),dr=(0,F.A)("div",{shouldForwardProp:ar.A,name:"MuiDrawer",slot:"Docked",skipVariantsResolver:!1,overridesResolver:dn})({flex:"0 0 auto"}),ds=(0,F.A)(h7.A,{name:"MuiDrawer",slot:"Paper",overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.paper,t[`paperAnchor${(0,B.A)(n.anchor)}`],"temporary"!==n.variant&&t[`paperAnchorDocked${(0,B.A)(n.anchor)}`]]}})((0,N.A)(({theme:e})=>({overflowY:"auto",display:"flex",flexDirection:"column",height:"100%",flex:"1 0 auto",zIndex:(e.vars||e).zIndex.drawer,WebkitOverflowScrolling:"touch",position:"fixed",top:0,outline:0,variants:[{props:{anchor:"left"},style:{left:0}},{props:{anchor:"top"},style:{top:0,left:0,right:0,height:"auto",maxHeight:"100%"}},{props:{anchor:"right"},style:{right:0}},{props:{anchor:"bottom"},style:{top:"auto",left:0,bottom:0,right:0,height:"auto",maxHeight:"100%"}},{props:({ownerState:e})=>"left"===e.anchor&&"temporary"!==e.variant,style:{borderRight:`1px solid ${(e.vars||e).palette.divider}`}},{props:({ownerState:e})=>"top"===e.anchor&&"temporary"!==e.variant,style:{borderBottom:`1px solid ${(e.vars||e).palette.divider}`}},{props:({ownerState:e})=>"right"===e.anchor&&"temporary"!==e.variant,style:{borderLeft:`1px solid ${(e.vars||e).palette.divider}`}},{props:({ownerState:e})=>"bottom"===e.anchor&&"temporary"!==e.variant,style:{borderTop:`1px solid ${(e.vars||e).palette.divider}`}}]}))),dl={left:"right",right:"left",top:"down",bottom:"up"},da=R.forwardRef(function(e,t){let n=(0,H.b)({props:e,name:"MuiDrawer"}),i=(0,r7.A)(),r=(0,uf.I)(),o={enter:i.transitions.duration.enteringScreen,exit:i.transitions.duration.leavingScreen},{anchor:s="left",BackdropProps:l,children:a,className:u,elevation:c=16,hideBackdrop:h=!1,ModalProps:{BackdropProps:d,...f}={},onClose:p,open:m=!1,PaperProps:g={},SlideProps:v,TransitionComponent:b,transitionDuration:x=o,variant:y="temporary",slots:w={},slotProps:S={},...C}=n,A=R.useRef(!1);R.useEffect(()=>{A.current=!0},[]);let k=function({direction:e},t){return"rtl"===e&&["left","right"].includes(t)?dl[t]:t}({direction:r?"rtl":"ltr"},s),M={...n,anchor:s,elevation:c,open:m,variant:y,...C},T=(e=>{let{classes:t,anchor:n,variant:i}=e,r={root:["root",`anchor${(0,B.A)(n)}`],docked:[("permanent"===i||"persistent"===i)&&"docked"],modal:["modal"],paper:["paper",`paperAnchor${(0,B.A)(n)}`,"temporary"!==i&&`paperAnchorDocked${(0,B.A)(n)}`]};return(0,P.A)(r,de,t)})(M),D={slots:{transition:b,...w},slotProps:{paper:g,transition:v,...S,backdrop:(0,dt.A)(S.backdrop||{...l,...d},{transitionDuration:x})}},[E,L]=(0,uC.A)("root",{ref:t,elementType:di,className:(0,O.A)(T.root,T.modal,u),shouldForwardComponentProp:!0,ownerState:M,externalForwardedProps:{...D,...C,...f},additionalProps:{open:m,onClose:p,hideBackdrop:h,slots:{backdrop:D.slots.backdrop},slotProps:{backdrop:D.slotProps.backdrop}}}),[j,F]=(0,uC.A)("paper",{elementType:ds,shouldForwardComponentProp:!0,className:(0,O.A)(T.paper,g.className),ownerState:M,externalForwardedProps:D,additionalProps:{elevation:"temporary"===y?c:0,square:!0}}),[N,V]=(0,uC.A)("docked",{elementType:dr,ref:t,className:(0,O.A)(T.root,T.docked,u),ownerState:M,externalForwardedProps:D,additionalProps:C}),[z,W]=(0,uC.A)("transition",{elementType:h9,ownerState:M,externalForwardedProps:D,additionalProps:{in:m,direction:dl[k],timeout:x,appear:A.current}}),$=(0,I.jsx)(j,{...F,children:a});if("permanent"===y)return(0,I.jsx)(N,{...V,children:$});let _=(0,I.jsx)(z,{...W,children:$});return"persistent"===y?(0,I.jsx)(N,{...V,children:_}):(0,I.jsx)(E,{...L,children:_})}),du=({anchor:e="right",isOpen:t,onClose:n,PaperProps:i,children:r,...o})=>{let s=(0,h0.A)("(max-width:1080px)");return(0,I.jsx)(da,{...o,open:t,onClose:n,anchor:e,PaperProps:{...i,sx:iH({width:s?"100%":"1080px",overflow:"hidden"},i?.sx)},"aria-hidden":!t,children:r})};var dc=n(74653),dh=n(31950),dd=n(31373),df=n(62707),dp=n(49828),dm=n(76545),dg=n(32741),dv=n(23670),db=n(9356),dx=n(90652),dy=n(61305),dw=n(50944),dS=n(59738),dC=n(72106),dA=n(40988),dk=n(55875),dM=n(46182),dT=n(64404),dD=n(28502),dI=n(48683),dR=n(37573);(0,dc.Y)([dx.a,dy.a,dw.a,dd.a,df.a,dp.a,dm.a,dg.a,dv.a,db.a,dS.a,dC.a,dA.a,dk.a,dR.a,dM.a,dT.a,dD.a,dI.a]);let dE=["click","dblclick","mousedown","mousemove","mouseup","mouseover","mouseout","globalout","contextmenu"],dO=["datazoom","downplay","highlight"],dP=(0,R.memo)(function({option:e,theme:t,renderer:n,sx:i,style:r,onEvents:o,_instance:s,syncGroup:l,onChartInitialized:a}){let u=(0,R.useRef)(e),c=(0,R.useRef)(e),h=(0,R.useRef)(null),d=(0,R.useRef)(null);return(0,R.useLayoutEffect)(()=>{if(null!==h.current&&null===d.current&&(d.current=(0,dh.Ts)(h.current,t,{renderer:n??"canvas"}),void 0!==d.current))return d.current.setOption(u.current,!0),a?.(d.current),void 0!==s&&(s.current=d.current),()=>{null!==d.current&&(d.current.dispose(),d.current=null)}},[s,a,t,n]),(0,R.useEffect)(()=>{d.current&&l&&(d.current.group=l,(0,dh.Ng)([d.current]))},[l,d]),(0,R.useEffect)(()=>{void 0===c.current||rm()(c.current,e)||d.current&&(d.current.setOption(e,!0),c.current=e)},[e]),(0,R.useLayoutEffect)(()=>{let e=uK()(()=>{d.current&&d.current.resize()},200);return window.addEventListener("resize",e),e(),()=>{window.removeEventListener("resize",e)}},[]),(0,R.useEffect)(()=>{let e=d.current;if(e&&void 0!==o)return function(e,t){if(void 0!==t){for(let n in t)if(Object.prototype.hasOwnProperty.call(t,n)){let i=t[n]??null;i&&function(t,n){var i,r;"function"==typeof n&&((i=t,dE.includes(i))?e.on(t,t=>n(t,e)):(r=t,dO.includes(r))?e.on(t,e=>n(e)):e.on(t,()=>n(null,e)))}(n,i)}}}(e,o),()=>{if(void 0!==e&&!0!==e.isDisposed())for(let t in o)e.off(t)}},[o]),(0,R.useEffect)(()=>{uK()(()=>{d.current&&d.current.resize()},200,{leading:!0})()},[i,r]),(0,I.jsx)(oe.A,{ref:h,sx:i,style:r})});var dL=n(34007);function dj(e){let{error:t}=e;return(0,I.jsx)(dL.A,{severity:"error",children:t.message})}var dB=n(77440);let dF=[{id:"default",label:"Default",value:void 0},{id:"12",label:"12",value:12},{id:"14",label:"14",value:14},{id:"16",label:"16",value:16},{id:"20",label:"20",value:20},{id:"24",label:"24",value:24},{id:"28",label:"28",value:28},{id:"32",label:"32",value:32},{id:"36",label:"36",value:36},{id:"40",label:"40",value:40},{id:"48",label:"48",value:48},{id:"56",label:"56",value:56},{id:"64",label:"64",value:64},{id:"72",label:"72",value:72},{id:"96",label:"96",value:96},{id:"128",label:"128",value:128},{id:"160",label:"160",value:160},{id:"192",label:"192",value:192}];function dN({value:e,onChange:t}){return(0,I.jsx)(cX,{label:"Font Size",control:(0,I.jsx)(c1,{value:dF.find(t=>t.value===e),options:dF,getOptionLabel:e=>e.label,onChange:(e,{value:n})=>{t(n)},disableClearable:!0})})}function dV({action:e,submitText:t="Save",cancelText:n="Cancel",isReadonly:i,isValid:r,onActionChange:o,onSubmit:s,onDelete:l,onCancel:a,...u}){return(0,I.jsx)(Z.A,{direction:"row",gap:1,sx:{marginLeft:"auto"},...u,children:"read"===e?(0,I.jsxs)(I.Fragment,{children:[o&&(0,I.jsx)(K.A,{disabled:i,variant:"contained",onClick:()=>o("update"),children:"Edit"}),l&&(0,I.jsx)(K.A,{color:"error",disabled:i,variant:"outlined",onClick:l,children:"Delete"}),a&&(s||l)&&(0,I.jsx)(ci.A,{orientation:"vertical",flexItem:!0,sx:{borderColor:e=>e.palette.grey["500"],"&.MuiDivider-root":{marginLeft:2,marginRight:1}}}),a&&(0,I.jsx)(K.A,{color:"secondary",variant:"outlined",onClick:a,children:n})]}):(0,I.jsxs)(I.Fragment,{children:[s&&(0,I.jsx)(K.A,{variant:"contained",disabled:!r,onClick:s,children:t}),a&&(0,I.jsx)(K.A,{color:"secondary",variant:"outlined",onClick:a,children:n})]})})}var dH=n(68102),dz=n(49257);let dW=[],d$=[],d_="lc,34,7n,7,7b,19,,,,2,,2,,,20,b,1c,l,g,,2t,7,2,6,2,2,,4,z,,u,r,2j,b,1m,9,9,,o,4,,9,,3,,5,17,3,3b,f,,w,1j,,,,4,8,4,,3,7,a,2,t,,1m,,,,2,4,8,,9,,a,2,q,,2,2,1l,,4,2,4,2,2,3,3,,u,2,3,,b,2,1l,,4,5,,2,4,,k,2,m,6,,,1m,,,2,,4,8,,7,3,a,2,u,,1n,,,,c,,9,,14,,3,,1l,3,5,3,,4,7,2,b,2,t,,1m,,2,,2,,3,,5,2,7,2,b,2,s,2,1l,2,,,2,4,8,,9,,a,2,t,,20,,4,,2,3,,,8,,29,,2,7,c,8,2q,,2,9,b,6,22,2,r,,,,,,1j,e,,5,,2,5,b,,10,9,,2u,4,,6,,2,2,2,p,2,4,3,g,4,d,,2,2,6,,f,,jj,3,qa,3,t,3,t,2,u,2,1s,2,,7,8,,2,b,9,,19,3,3b,2,y,,3a,3,4,2,9,,6,3,63,2,2,,1m,,,7,,,,,2,8,6,a,2,,1c,h,1r,4,1c,7,,,5,,14,9,c,2,w,4,2,2,,3,1k,,,2,3,,,3,1m,8,2,2,48,3,,d,,7,4,,6,,3,2,5i,1m,,5,ek,,5f,x,2da,3,3x,,2o,w,fe,6,2x,2,n9w,4,,a,w,2,28,2,7k,,3,,4,,p,2,5,,47,2,q,i,d,,12,8,p,b,1a,3,1c,,2,4,2,2,13,,1v,6,2,2,2,2,c,,8,,1b,,1f,,,3,2,2,5,2,,,16,2,8,,6m,,2,,4,,fn4,,kh,g,g,g,a6,2,gt,,6a,,45,5,1ae,3,,2,5,4,14,3,4,,4l,2,fx,4,ar,2,49,b,4w,,1i,f,1k,3,1d,4,2,2,1x,3,10,5,,8,1q,,c,2,1g,9,a,4,2,,2n,3,2,,,2,6,,4g,,3,8,l,2,1l,2,,,,,m,,e,7,3,5,5f,8,2,3,,,n,,29,,2,6,,,2,,,2,,2,6j,,2,4,6,2,,2,r,2,2d,8,2,,,2,2y,,,,2,6,,,2t,3,2,4,,5,77,9,,2,6t,,a,2,,,4,,40,4,2,2,4,,w,a,14,6,2,4,8,,9,6,2,3,1a,d,,2,ba,7,,6,,,2a,m,2,7,,2,,2,3e,6,3,,,2,,7,,,20,2,3,,,,9n,2,f0b,5,1n,7,t4,,1r,4,29,,f5k,2,43q,,,3,4,5,8,8,2,7,u,4,44,3,1iz,1j,4,1e,8,,e,,m,5,,f,11s,7,,h,2,7,,2,,5,79,7,c5,4,15s,7,31,7,240,5,gx7k,2o,3k,6o".split(",").map(e=>e?parseInt(e,36):1);for(let e=0,t=0;e<d_.length;e++)(e%2?d$:dW).push(t+=d_[e]);function dU(e){return e>=127462&&e<=127487}function dG(e,t,n){if(t==e.length)return t;t&&dY(e.charCodeAt(t))&&dK(e.charCodeAt(t-1))&&t--;let i=dq(e,t);for(t+=dX(i);t<e.length;){let r=dq(e,t);if(8205==i||8205==r||n&&function(e){if(e<768)return!1;for(let t=0,n=dW.length;;){let i=t+n>>1;if(e<dW[i])n=i;else{if(!(e>=d$[i]))return!0;t=i+1}if(t==n)return!1}}(r))t+=dX(r),i=r;else if(dU(r)){let n=0,i=t-2;for(;i>=0&&dU(dq(e,i));)n++,i-=2;if(n%2==0)break;t+=2}else break}return t}function dq(e,t){let n=e.charCodeAt(t);if(!dK(n)||t+1==e.length)return n;let i=e.charCodeAt(t+1);return dY(i)?(n-55296<<10)+(i-56320)+65536:n}function dY(e){return e>=56320&&e<57344}function dK(e){return e>=55296&&e<56320}function dX(e){return e<65536?1:2}class dZ{lineAt(e){if(e<0||e>this.length)throw RangeError(`Invalid position ${e} in document of length ${this.length}`);return this.lineInner(e,!1,1,0)}line(e){if(e<1||e>this.lines)throw RangeError(`Invalid line number ${e} in ${this.lines}-line document`);return this.lineInner(e,!0,1,0)}replace(e,t,n){[e,t]=d4(this,e,t);let i=[];return this.decompose(0,e,i,2),n.length&&n.decompose(0,n.length,i,3),this.decompose(t,this.length,i,1),dJ.from(i,this.length-(t-e)+n.length)}append(e){return this.replace(this.length,this.length,e)}slice(e,t=this.length){[e,t]=d4(this,e,t);let n=[];return this.decompose(e,t,n,0),dJ.from(n,t-e)}eq(e){if(e==this)return!0;if(e.length!=this.length||e.lines!=this.lines)return!1;let t=this.scanIdentical(e,1),n=this.length-this.scanIdentical(e,-1),i=new d1(this),r=new d1(e);for(let e=t,o=t;;){if(i.next(e),r.next(e),e=0,i.lineBreak!=r.lineBreak||i.done!=r.done||i.value!=r.value)return!1;if(o+=i.value.length,i.done||o>=n)return!0}}iter(e=1){return new d1(this,e)}iterRange(e,t=this.length){return new d2(this,e,t)}iterLines(e,t){let n;if(null==e)n=this.iter();else{null==t&&(t=this.lines+1);let i=this.line(e).from;n=this.iterRange(i,Math.max(i,t==this.lines+1?this.length:t<=1?0:this.line(t-1).to))}return new d5(n)}toString(){return this.sliceString(0)}toJSON(){let e=[];return this.flatten(e),e}static of(e){if(0==e.length)throw RangeError("A document must have at least one line");return 1!=e.length||e[0]?e.length<=32?new dQ(e):dJ.from(dQ.split(e,[])):dZ.empty}}class dQ extends dZ{constructor(e,t=function(e){let t=-1;for(let n of e)t+=n.length+1;return t}(e)){super(),this.text=e,this.length=t}get lines(){return this.text.length}get children(){return null}lineInner(e,t,n,i){for(let r=0;;r++){let o=this.text[r],s=i+o.length;if((t?n:s)>=e)return new d3(i,s,n,o);i=s+1,n++}}decompose(e,t,n,i){var r;let o=e<=0&&t>=this.length?this:new dQ((r=this.text,d0(r,[""],e,t)),Math.min(t,this.length)-Math.max(0,e));if(1&i){let e=n.pop(),t=d0(o.text,e.text.slice(),0,o.length);if(t.length<=32)n.push(new dQ(t,e.length+o.length));else{let e=t.length>>1;n.push(new dQ(t.slice(0,e)),new dQ(t.slice(e)))}}else n.push(o)}replace(e,t,n){var i;if(!(n instanceof dQ))return super.replace(e,t,n);[e,t]=d4(this,e,t);let r=d0(this.text,d0(n.text,(i=this.text,d0(i,[""],0,e))),t),o=this.length+n.length-(t-e);return r.length<=32?new dQ(r,o):dJ.from(dQ.split(r,[]),o)}sliceString(e,t=this.length,n="\n"){[e,t]=d4(this,e,t);let i="";for(let r=0,o=0;r<=t&&o<this.text.length;o++){let s=this.text[o],l=r+s.length;r>e&&o&&(i+=n),e<l&&t>r&&(i+=s.slice(Math.max(0,e-r),t-r)),r=l+1}return i}flatten(e){for(let t of this.text)e.push(t)}scanIdentical(){return 0}static split(e,t){let n=[],i=-1;for(let r of e)n.push(r),i+=r.length+1,32==n.length&&(t.push(new dQ(n,i)),n=[],i=-1);return i>-1&&t.push(new dQ(n,i)),t}}class dJ extends dZ{constructor(e,t){for(let n of(super(),this.children=e,this.length=t,this.lines=0,e))this.lines+=n.lines}lineInner(e,t,n,i){for(let r=0;;r++){let o=this.children[r],s=i+o.length,l=n+o.lines-1;if((t?l:s)>=e)return o.lineInner(e,t,n,i);i=s+1,n=l+1}}decompose(e,t,n,i){for(let r=0,o=0;o<=t&&r<this.children.length;r++){let s=this.children[r],l=o+s.length;if(e<=l&&t>=o){let r=i&(o<=e|2*(l>=t));o>=e&&l<=t&&!r?n.push(s):s.decompose(e-o,t-o,n,r)}o=l+1}}replace(e,t,n){if([e,t]=d4(this,e,t),n.lines<this.lines)for(let i=0,r=0;i<this.children.length;i++){let o=this.children[i],s=r+o.length;if(e>=r&&t<=s){let l=o.replace(e-r,t-r,n),a=this.lines-o.lines+l.lines;if(l.lines<a>>4&&l.lines>a>>6){let r=this.children.slice();return r[i]=l,new dJ(r,this.length-(t-e)+n.length)}return super.replace(r,s,l)}r=s+1}return super.replace(e,t,n)}sliceString(e,t=this.length,n="\n"){[e,t]=d4(this,e,t);let i="";for(let r=0,o=0;r<this.children.length&&o<=t;r++){let s=this.children[r],l=o+s.length;o>e&&r&&(i+=n),e<l&&t>o&&(i+=s.sliceString(e-o,t-o,n)),o=l+1}return i}flatten(e){for(let t of this.children)t.flatten(e)}scanIdentical(e,t){if(!(e instanceof dJ))return 0;let n=0,[i,r,o,s]=t>0?[0,0,this.children.length,e.children.length]:[this.children.length-1,e.children.length-1,-1,-1];for(;;i+=t,r+=t){if(i==o||r==s)return n;let l=this.children[i],a=e.children[r];if(l!=a)return n+l.scanIdentical(a,t);n+=l.length+1}}static from(e,t=e.reduce((e,t)=>e+t.length+1,-1)){let n=0;for(let t of e)n+=t.lines;if(n<32){let n=[];for(let t of e)t.flatten(n);return new dQ(n,t)}let i=Math.max(32,n>>5),r=i<<1,o=i>>1,s=[],l=0,a=-1,u=[];function c(){0!=l&&(s.push(1==u.length?u[0]:dJ.from(u,a)),a=-1,l=u.length=0)}for(let t of e)!function e(t){let n;if(t.lines>r&&t instanceof dJ)for(let n of t.children)e(n);else t.lines>o&&(l>o||!l)?(c(),s.push(t)):t instanceof dQ&&l&&(n=u[u.length-1])instanceof dQ&&t.lines+n.lines<=32?(l+=t.lines,a+=t.length+1,u[u.length-1]=new dQ(n.text.concat(t.text),n.length+1+t.length)):(l+t.lines>i&&c(),l+=t.lines,a+=t.length+1,u.push(t))}(t);return c(),1==s.length?s[0]:new dJ(s,t)}}function d0(e,t,n=0,i=1e9){for(let r=0,o=0,s=!0;o<e.length&&r<=i;o++){let l=e[o],a=r+l.length;a>=n&&(a>i&&(l=l.slice(0,i-r)),r<n&&(l=l.slice(n-r)),s?(t[t.length-1]+=l,s=!1):t.push(l)),r=a+1}return t}dZ.empty=new dQ([""],0);class d1{constructor(e,t=1){this.dir=t,this.done=!1,this.lineBreak=!1,this.value="",this.nodes=[e],this.offsets=[t>0?1:(e instanceof dQ?e.text.length:e.children.length)<<1]}nextInner(e,t){for(this.done=this.lineBreak=!1;;){let n=this.nodes.length-1,i=this.nodes[n],r=this.offsets[n],o=r>>1,s=i instanceof dQ?i.text.length:i.children.length;if(o==(t>0?s:0)){if(0==n)return this.done=!0,this.value="",this;t>0&&this.offsets[n-1]++,this.nodes.pop(),this.offsets.pop()}else if((1&r)==(t>0?0:1)){if(this.offsets[n]+=t,0==e)return this.lineBreak=!0,this.value="\n",this;e--}else if(i instanceof dQ){let r=i.text[o+(t<0?-1:0)];if(this.offsets[n]+=t,r.length>Math.max(0,e))return this.value=0==e?r:t>0?r.slice(e):r.slice(0,r.length-e),this;e-=r.length}else{let r=i.children[o+(t<0?-1:0)];e>r.length?(e-=r.length,this.offsets[n]+=t):(t<0&&this.offsets[n]--,this.nodes.push(r),this.offsets.push(t>0?1:(r instanceof dQ?r.text.length:r.children.length)<<1))}}}next(e=0){return e<0&&(this.nextInner(-e,-this.dir),e=this.value.length),this.nextInner(e,this.dir)}}class d2{constructor(e,t,n){this.value="",this.done=!1,this.cursor=new d1(e,t>n?-1:1),this.pos=t>n?e.length:0,this.from=Math.min(t,n),this.to=Math.max(t,n)}nextInner(e,t){if(t<0?this.pos<=this.from:this.pos>=this.to)return this.value="",this.done=!0,this;e+=Math.max(0,t<0?this.pos-this.to:this.from-this.pos);let n=t<0?this.pos-this.from:this.to-this.pos;e>n&&(e=n),n-=e;let{value:i}=this.cursor.next(e);return this.pos+=(i.length+e)*t,this.value=i.length<=n?i:t<0?i.slice(i.length-n):i.slice(0,n),this.done=!this.value,this}next(e=0){return e<0?e=Math.max(e,this.from-this.pos):e>0&&(e=Math.min(e,this.to-this.pos)),this.nextInner(e,this.cursor.dir)}get lineBreak(){return this.cursor.lineBreak&&""!=this.value}}class d5{constructor(e){this.inner=e,this.afterBreak=!0,this.value="",this.done=!1}next(e=0){let{done:t,lineBreak:n,value:i}=this.inner.next(e);return t&&this.afterBreak?(this.value="",this.afterBreak=!1):t?(this.done=!0,this.value=""):n?this.afterBreak?this.value="":(this.afterBreak=!0,this.next()):(this.value=i,this.afterBreak=!1),this}get lineBreak(){return!1}}"u">typeof Symbol&&(dZ.prototype[Symbol.iterator]=function(){return this.iter()},d1.prototype[Symbol.iterator]=d2.prototype[Symbol.iterator]=d5.prototype[Symbol.iterator]=function(){return this});class d3{constructor(e,t,n,i){this.from=e,this.to=t,this.number=n,this.text=i}get length(){return this.to-this.from}}function d4(e,t,n){return[t=Math.max(0,Math.min(e.length,t)),Math.max(t,Math.min(e.length,n))]}function d6(e,t,n=!0,i=!0){return function(e,t,n=!0,i=!0){return(n?dG:function(e,t,n){for(;t>0;){let i=dG(e,t-2,n);if(i<t)return i;t--}return 0})(e,t,i)}(e,t,n,i)}function d8(e,t){let n=e.charCodeAt(t);if(!(n>=55296&&n<56320)||t+1==e.length)return n;let i=e.charCodeAt(t+1);return i>=56320&&i<57344?(n-55296<<10)+(i-56320)+65536:n}function d9(e){return e<=65535?String.fromCharCode(e):String.fromCharCode(((e-=65536)>>10)+55296,(1023&e)+56320)}function d7(e){return e<65536?1:2}let fe=/\r\n?|\n/;var ft=((f=ft||(ft={}))[f.Simple=0]="Simple",f[f.TrackDel=1]="TrackDel",f[f.TrackBefore=2]="TrackBefore",f[f.TrackAfter=3]="TrackAfter",f);class fn{constructor(e){this.sections=e}get length(){let e=0;for(let t=0;t<this.sections.length;t+=2)e+=this.sections[t];return e}get newLength(){let e=0;for(let t=0;t<this.sections.length;t+=2){let n=this.sections[t+1];e+=n<0?this.sections[t]:n}return e}get empty(){return 0==this.sections.length||2==this.sections.length&&this.sections[1]<0}iterGaps(e){for(let t=0,n=0,i=0;t<this.sections.length;){let r=this.sections[t++],o=this.sections[t++];o<0?(e(n,i,r),i+=r):i+=o,n+=r}}iterChangedRanges(e,t=!1){fs(this,e,t)}get invertedDesc(){let e=[];for(let t=0;t<this.sections.length;){let n=this.sections[t++],i=this.sections[t++];i<0?e.push(n,i):e.push(i,n)}return new fn(e)}composeDesc(e){return this.empty?e:e.empty?this:fa(this,e)}mapDesc(e,t=!1){return e.empty?this:fl(this,e,t)}mapPos(e,t=-1,n=ft.Simple){let i=0,r=0;for(let o=0;o<this.sections.length;){let s=this.sections[o++],l=this.sections[o++],a=i+s;if(l<0){if(a>e)return r+(e-i);r+=s}else{if(n!=ft.Simple&&a>=e&&(n==ft.TrackDel&&i<e&&a>e||n==ft.TrackBefore&&i<e||n==ft.TrackAfter&&a>e))return null;if(a>e||a==e&&t<0&&!s)return e==i||t<0?r:r+l;r+=l}i=a}if(e>i)throw RangeError(`Position ${e} is out of range for changeset of length ${i}`);return r}touchesRange(e,t=e){for(let n=0,i=0;n<this.sections.length&&i<=t;){let r=this.sections[n++],o=this.sections[n++],s=i+r;if(o>=0&&i<=t&&s>=e)return!(i<e)||!(s>t)||"cover";i=s}return!1}toString(){let e="";for(let t=0;t<this.sections.length;){let n=this.sections[t++],i=this.sections[t++];e+=(e?" ":"")+n+(i>=0?":"+i:"")}return e}toJSON(){return this.sections}static fromJSON(e){if(!Array.isArray(e)||e.length%2||e.some(e=>"number"!=typeof e))throw RangeError("Invalid JSON representation of ChangeDesc");return new fn(e)}static create(e){return new fn(e)}}class fi extends fn{constructor(e,t){super(e),this.inserted=t}apply(e){if(this.length!=e.length)throw RangeError("Applying change set to a document with the wrong length");return fs(this,(t,n,i,r,o)=>e=e.replace(i,i+(n-t),o),!1),e}mapDesc(e,t=!1){return fl(this,e,t,!0)}invert(e){let t=this.sections.slice(),n=[];for(let i=0,r=0;i<t.length;i+=2){let o=t[i],s=t[i+1];if(s>=0){t[i]=s,t[i+1]=o;let l=i>>1;for(;n.length<l;)n.push(dZ.empty);n.push(o?e.slice(r,r+o):dZ.empty)}r+=o}return new fi(t,n)}compose(e){return this.empty?e:e.empty?this:fa(this,e,!0)}map(e,t=!1){return e.empty?this:fl(this,e,t,!0)}iterChanges(e,t=!1){fs(this,e,t)}get desc(){return fn.create(this.sections)}filter(e){let t=[],n=[],i=[],r=new fu(this);e:for(let o=0,s=0;;){let l=o==e.length?1e9:e[o++];for(;s<l||s==l&&0==r.len;){if(r.done)break e;let e=Math.min(r.len,l-s);fr(i,e,-1);let o=-1==r.ins?-1:0==r.off?r.ins:0;fr(t,e,o),o>0&&fo(n,t,r.text),r.forward(e),s+=e}let a=e[o++];for(;s<a;){if(r.done)break e;let e=Math.min(r.len,a-s);fr(t,e,-1),fr(i,e,-1==r.ins?-1:0==r.off?r.ins:0),r.forward(e),s+=e}}return{changes:new fi(t,n),filtered:fn.create(i)}}toJSON(){let e=[];for(let t=0;t<this.sections.length;t+=2){let n=this.sections[t],i=this.sections[t+1];i<0?e.push(n):0==i?e.push([n]):e.push([n].concat(this.inserted[t>>1].toJSON()))}return e}static of(e,t,n){let i=[],r=[],o=0,s=null;function l(e=!1){if(!e&&!i.length)return;o<t&&fr(i,t-o,-1);let n=new fi(i,r);s=s?s.compose(n.map(s)):n,i=[],r=[],o=0}return!function e(a){if(Array.isArray(a))for(let t of a)e(t);else if(a instanceof fi){if(a.length!=t)throw RangeError(`Mismatched change set length (got ${a.length}, expected ${t})`);l(),s=s?s.compose(a.map(s)):a}else{let{from:e,to:s=e,insert:u}=a;if(e>s||e<0||s>t)throw RangeError(`Invalid change range ${e} to ${s} (in doc of length ${t})`);let c=u?"string"==typeof u?dZ.of(u.split(n||fe)):u:dZ.empty,h=c.length;if(e==s&&0==h)return;e<o&&l(),e>o&&fr(i,e-o,-1),fr(i,s-e,h),fo(r,i,c),o=s}}(e),l(!s),s}static empty(e){return new fi(e?[e,-1]:[],[])}static fromJSON(e){if(!Array.isArray(e))throw RangeError("Invalid JSON representation of ChangeSet");let t=[],n=[];for(let i=0;i<e.length;i++){let r=e[i];if("number"==typeof r)t.push(r,-1);else if(!Array.isArray(r)||"number"!=typeof r[0]||r.some((e,t)=>t&&"string"!=typeof e))throw RangeError("Invalid JSON representation of ChangeSet");else if(1==r.length)t.push(r[0],0);else{for(;n.length<i;)n.push(dZ.empty);n[i]=dZ.of(r.slice(1)),t.push(r[0],n[i].length)}}return new fi(t,n)}static createSet(e,t){return new fi(e,t)}}function fr(e,t,n,i=!1){if(0==t&&n<=0)return;let r=e.length-2;r>=0&&n<=0&&n==e[r+1]?e[r]+=t:r>=0&&0==t&&0==e[r]?e[r+1]+=n:i?(e[r]+=t,e[r+1]+=n):e.push(t,n)}function fo(e,t,n){if(0==n.length)return;let i=t.length-2>>1;if(i<e.length)e[e.length-1]=e[e.length-1].append(n);else{for(;e.length<i;)e.push(dZ.empty);e.push(n)}}function fs(e,t,n){let i=e.inserted;for(let r=0,o=0,s=0;s<e.sections.length;){let l=e.sections[s++],a=e.sections[s++];if(a<0)r+=l,o+=l;else{let u=r,c=o,h=dZ.empty;for(;u+=l,c+=a,a&&i&&(h=h.append(i[s-2>>1])),!n&&s!=e.sections.length&&!(e.sections[s+1]<0);)l=e.sections[s++],a=e.sections[s++];t(r,u,o,c,h),r=u,o=c}}}function fl(e,t,n,i=!1){let r=[],o=i?[]:null,s=new fu(e),l=new fu(t);for(let e=-1;;)if(s.done&&l.len||l.done&&s.len)throw Error("Mismatched change set lengths");else if(-1==s.ins&&-1==l.ins){let e=Math.min(s.len,l.len);fr(r,e,-1),s.forward(e),l.forward(e)}else if(l.ins>=0&&(s.ins<0||e==s.i||0==s.off&&(l.len<s.len||l.len==s.len&&!n))){let t=l.len;for(fr(r,l.ins,-1);t;){let n=Math.min(s.len,t);s.ins>=0&&e<s.i&&s.len<=n&&(fr(r,0,s.ins),o&&fo(o,r,s.text),e=s.i),s.forward(n),t-=n}l.next()}else if(s.ins>=0){let t=0,n=s.len;for(;n;)if(-1==l.ins){let e=Math.min(n,l.len);t+=e,n-=e,l.forward(e)}else if(0==l.ins&&l.len<n)n-=l.len,l.next();else break;fr(r,t,e<s.i?s.ins:0),o&&e<s.i&&fo(o,r,s.text),e=s.i,s.forward(s.len-n)}else if(s.done&&l.done)return o?fi.createSet(r,o):fn.create(r);else throw Error("Mismatched change set lengths")}function fa(e,t,n=!1){let i=[],r=n?[]:null,o=new fu(e),s=new fu(t);for(let e=!1;;)if(o.done&&s.done)return r?fi.createSet(i,r):fn.create(i);else if(0==o.ins)fr(i,o.len,0,e),o.next();else if(0!=s.len||s.done)if(o.done||s.done)throw Error("Mismatched change set lengths");else{let t=Math.min(o.len2,s.len),n=i.length;if(-1==o.ins){let n=-1==s.ins?-1:s.off?0:s.ins;fr(i,t,n,e),r&&n&&fo(r,i,s.text)}else -1==s.ins?(fr(i,o.off?0:o.len,t,e),r&&fo(r,i,o.textBit(t))):(fr(i,o.off?0:o.len,s.off?0:s.ins,e),r&&!s.off&&fo(r,i,s.text));e=(o.ins>t||s.ins>=0&&s.len>t)&&(e||i.length>n),o.forward2(t),s.forward(t)}else fr(i,0,s.ins,e),r&&fo(r,i,s.text),s.next()}class fu{constructor(e){this.set=e,this.i=0,this.next()}next(){let{sections:e}=this.set;this.i<e.length?(this.len=e[this.i++],this.ins=e[this.i++]):(this.len=0,this.ins=-2),this.off=0}get done(){return -2==this.ins}get len2(){return this.ins<0?this.len:this.ins}get text(){let{inserted:e}=this.set,t=this.i-2>>1;return t>=e.length?dZ.empty:e[t]}textBit(e){let{inserted:t}=this.set,n=this.i-2>>1;return n>=t.length&&!e?dZ.empty:t[n].slice(this.off,null==e?void 0:this.off+e)}forward(e){e==this.len?this.next():(this.len-=e,this.off+=e)}forward2(e){-1==this.ins?this.forward(e):e==this.ins?this.next():(this.ins-=e,this.off+=e)}}class fc{constructor(e,t,n){this.from=e,this.to=t,this.flags=n}get anchor(){return 32&this.flags?this.to:this.from}get head(){return 32&this.flags?this.from:this.to}get empty(){return this.from==this.to}get assoc(){return 8&this.flags?-1:16&this.flags?1:0}get bidiLevel(){let e=7&this.flags;return 7==e?null:e}get goalColumn(){let e=this.flags>>6;return 0xffffff==e?void 0:e}map(e,t=-1){let n,i;return this.empty?n=i=e.mapPos(this.from,t):(n=e.mapPos(this.from,1),i=e.mapPos(this.to,-1)),n==this.from&&i==this.to?this:new fc(n,i,this.flags)}extend(e,t=e,n=0){if(e<=this.anchor&&t>=this.anchor)return fh.range(e,t,void 0,void 0,n);let i=Math.abs(e-this.anchor)>Math.abs(t-this.anchor)?e:t;return fh.range(this.anchor,i,void 0,void 0,n)}eq(e,t=!1){return this.anchor==e.anchor&&this.head==e.head&&this.goalColumn==e.goalColumn&&(!t||!this.empty||this.assoc==e.assoc)}toJSON(){return{anchor:this.anchor,head:this.head}}static fromJSON(e){if(!e||"number"!=typeof e.anchor||"number"!=typeof e.head)throw RangeError("Invalid JSON representation for SelectionRange");return fh.range(e.anchor,e.head)}static create(e,t,n){return new fc(e,t,n)}}class fh{constructor(e,t){this.ranges=e,this.mainIndex=t}map(e,t=-1){return e.empty?this:fh.create(this.ranges.map(n=>n.map(e,t)),this.mainIndex)}eq(e,t=!1){if(this.ranges.length!=e.ranges.length||this.mainIndex!=e.mainIndex)return!1;for(let n=0;n<this.ranges.length;n++)if(!this.ranges[n].eq(e.ranges[n],t))return!1;return!0}get main(){return this.ranges[this.mainIndex]}asSingle(){return 1==this.ranges.length?this:new fh([this.main],0)}addRange(e,t=!0){return fh.create([e].concat(this.ranges),t?0:this.mainIndex+1)}replaceRange(e,t=this.mainIndex){let n=this.ranges.slice();return n[t]=e,fh.create(n,this.mainIndex)}toJSON(){return{ranges:this.ranges.map(e=>e.toJSON()),main:this.mainIndex}}static fromJSON(e){if(!e||!Array.isArray(e.ranges)||"number"!=typeof e.main||e.main>=e.ranges.length)throw RangeError("Invalid JSON representation for EditorSelection");return new fh(e.ranges.map(e=>fc.fromJSON(e)),e.main)}static single(e,t=e){return new fh([fh.range(e,t)],0)}static create(e,t=0){if(0==e.length)throw RangeError("A selection needs at least one range");for(let n=0,i=0;i<e.length;i++){let r=e[i];if(r.empty?r.from<=n:r.from<n)return fh.normalized(e.slice(),t);n=r.to}return new fh(e,t)}static cursor(e,t=0,n,i){return fc.create(e,e,(0==t?0:t<0?8:16)|(null==n?7:Math.min(6,n))|(null!=i?i:0xffffff)<<6)}static range(e,t,n,i,r){let o=(null!=n?n:0xffffff)<<6|(null==i?7:Math.min(6,i));return r||e==t||(r=t<e?1:-1),t<e?fc.create(t,e,48|o):fc.create(e,t,(r?r<0?8:16:0)|o)}static normalized(e,t=0){let n=e[t];e.sort((e,t)=>e.from-t.from),t=e.indexOf(n);for(let n=1;n<e.length;n++){let i=e[n],r=e[n-1];if(i.empty?i.from<=r.to:i.from<r.to){let o=r.from,s=Math.max(i.to,r.to);n<=t&&t--,e.splice(--n,2,i.anchor>i.head?fh.range(s,o):fh.range(o,s))}}return new fh(e,t)}}function fd(e,t){for(let n of e.ranges)if(n.to>t)throw RangeError("Selection points outside of document")}let ff=0;class fp{constructor(e,t,n,i,r){this.combine=e,this.compareInput=t,this.compare=n,this.isStatic=i,this.id=ff++,this.default=e([]),this.extensions="function"==typeof r?r(this):r}get reader(){return this}static define(e={}){return new fp(e.combine||(e=>e),e.compareInput||((e,t)=>e===t),e.compare||(!e.combine?fm:(e,t)=>e===t),!!e.static,e.enables)}of(e){return new fg([],this,0,e)}compute(e,t){if(this.isStatic)throw Error("Can't compute a static facet");return new fg(e,this,1,t)}computeN(e,t){if(this.isStatic)throw Error("Can't compute a static facet");return new fg(e,this,2,t)}from(e,t){return t||(t=e=>e),this.compute([e],n=>t(n.field(e)))}}function fm(e,t){return e==t||e.length==t.length&&e.every((e,n)=>e===t[n])}class fg{constructor(e,t,n,i){this.dependencies=e,this.facet=t,this.type=n,this.value=i,this.id=ff++}dynamicSlot(e){var t;let n=this.value,i=this.facet.compareInput,r=this.id,o=e[r]>>1,s=2==this.type,l=!1,a=!1,u=[];for(let n of this.dependencies)"doc"==n?l=!0:"selection"==n?a=!0:((null!=(t=e[n.id])?t:1)&1)==0&&u.push(e[n.id]);return{create:e=>(e.values[o]=n(e),1),update(e,t){if(l&&t.docChanged||a&&(t.docChanged||t.selection)||fb(e,u)){let t=n(e);if(s?!fv(t,e.values[o],i):!i(t,e.values[o]))return e.values[o]=t,1}return 0},reconfigure:(e,t)=>{let l,a=t.config.address[r];if(null!=a){let r=fD(t,a);if(this.dependencies.every(n=>n instanceof fp?t.facet(n)===e.facet(n):!(n instanceof fy)||t.field(n,!1)==e.field(n,!1))||(s?fv(l=n(e),r,i):i(l=n(e),r)))return e.values[o]=r,0}else l=n(e);return e.values[o]=l,1}}}}function fv(e,t,n){if(e.length!=t.length)return!1;for(let i=0;i<e.length;i++)if(!n(e[i],t[i]))return!1;return!0}function fb(e,t){let n=!1;for(let i of t)1&fT(e,i)&&(n=!0);return n}let fx=fp.define({static:!0});class fy{constructor(e,t,n,i,r){this.id=e,this.createF=t,this.updateF=n,this.compareF=i,this.spec=r,this.provides=void 0}static define(e){let t=new fy(ff++,e.create,e.update,e.compare||((e,t)=>e===t),e);return e.provide&&(t.provides=e.provide(t)),t}create(e){let t=e.facet(fx).find(e=>e.field==this);return((null==t?void 0:t.create)||this.createF)(e)}slot(e){let t=e[this.id]>>1;return{create:e=>(e.values[t]=this.create(e),1),update:(e,n)=>{let i=e.values[t],r=this.updateF(i,n);return this.compareF(i,r)?0:(e.values[t]=r,1)},reconfigure:(e,n)=>{let i=e.facet(fx),r=n.facet(fx),o;return(o=i.find(e=>e.field==this))&&o!=r.find(e=>e.field==this)?(e.values[t]=o.create(e),1):null!=n.config.address[this.id]?(e.values[t]=n.field(this),0):(e.values[t]=this.create(e),1)}}}init(e){return[this,fx.of({field:this,create:e})]}get extension(){return this}}function fw(e){return t=>new fC(t,e)}let fS={highest:fw(0),high:fw(1),default:fw(2),low:fw(3),lowest:fw(4)};class fC{constructor(e,t){this.inner=e,this.prec=t}}class fA{of(e){return new fk(this,e)}reconfigure(e){return fA.reconfigure.of({compartment:this,extension:e})}get(e){return e.config.compartments.get(this)}}class fk{constructor(e,t){this.compartment=e,this.inner=t}}class fM{constructor(e,t,n,i,r,o){for(this.base=e,this.compartments=t,this.dynamicSlots=n,this.address=i,this.staticValues=r,this.facets=o,this.statusTemplate=[];this.statusTemplate.length<n.length;)this.statusTemplate.push(0)}staticFacet(e){let t=this.address[e.id];return null==t?e.default:this.staticValues[t>>1]}static resolve(e,t,n){var i,r,o;let s,l,a=[],u=Object.create(null),c=new Map;for(let n of(i=e,r=t,o=c,s=[[],[],[],[],[]],l=new Map,!function e(t,n){let i=l.get(t);if(null!=i){if(i<=n)return;let e=s[i].indexOf(t);e>-1&&s[i].splice(e,1),t instanceof fk&&o.delete(t.compartment)}if(l.set(t,n),Array.isArray(t))for(let i of t)e(i,n);else if(t instanceof fk){if(o.has(t.compartment))throw RangeError("Duplicate use of compartment in extensions");let i=r.get(t.compartment)||t.inner;o.set(t.compartment,i),e(i,n)}else if(t instanceof fC)e(t.inner,t.prec);else if(t instanceof fy)s[n].push(t),t.provides&&e(t.provides,n);else if(t instanceof fg)s[n].push(t),t.facet.extensions&&e(t.facet.extensions,2);else{let i=t.extension;if(!i)throw Error(`Unrecognized extension value in extension set (${t}). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.`);e(i,n)}}(i,2),s.reduce((e,t)=>e.concat(t))))n instanceof fy?a.push(n):(u[n.facet.id]||(u[n.facet.id]=[])).push(n);let h=Object.create(null),d=[],f=[];for(let e of a)h[e.id]=f.length<<1,f.push(t=>e.slot(t));let p=null==n?void 0:n.config.facets;for(let e in u){let t=u[e],i=t[0].facet,r=p&&p[e]||[];if(t.every(e=>0==e.type))if(h[i.id]=d.length<<1|1,fm(r,t))d.push(n.facet(i));else{let e=i.combine(t.map(e=>e.value));d.push(n&&i.compare(e,n.facet(i))?n.facet(i):e)}else{for(let e of t)0==e.type?(h[e.id]=d.length<<1|1,d.push(e.value)):(h[e.id]=f.length<<1,f.push(t=>e.dynamicSlot(t)));h[i.id]=f.length<<1,f.push(e=>(function(e,t,n){let i=n.map(t=>e[t.id]),r=n.map(e=>e.type),o=i.filter(e=>!(1&e)),s=e[t.id]>>1;function l(e){let n=[];for(let t=0;t<i.length;t++){let o=fD(e,i[t]);if(2==r[t])for(let e of o)n.push(e);else n.push(o)}return t.combine(n)}return{create(e){for(let t of i)fT(e,t);return e.values[s]=l(e),1},update(e,n){if(!fb(e,o))return 0;let i=l(e);return t.compare(i,e.values[s])?0:(e.values[s]=i,1)},reconfigure(e,r){let o=fb(e,i),a=r.config.facets[t.id],u=r.facet(t);if(a&&!o&&fm(n,a))return e.values[s]=u,0;let c=l(e);return t.compare(c,u)?(e.values[s]=u,0):(e.values[s]=c,1)}}})(e,i,t))}}return new fM(e,c,f.map(e=>e(h)),h,d,u)}}function fT(e,t){if(1&t)return 2;let n=t>>1,i=e.status[n];if(4==i)throw Error("Cyclic dependency between fields and/or facets");if(2&i)return i;e.status[n]=4;let r=e.computeSlot(e,e.config.dynamicSlots[n]);return e.status[n]=2|r}function fD(e,t){return 1&t?e.config.staticValues[t>>1]:e.values[t>>1]}let fI=fp.define(),fR=fp.define({combine:e=>e.some(e=>e),static:!0}),fE=fp.define({combine:e=>e.length?e[0]:void 0,static:!0}),fO=fp.define(),fP=fp.define(),fL=fp.define(),fj=fp.define({combine:e=>!!e.length&&e[0]});class fB{constructor(e,t){this.type=e,this.value=t}static define(){return new fF}}class fF{of(e){return new fB(this,e)}}class fN{constructor(e){this.map=e}of(e){return new fV(this,e)}}class fV{constructor(e,t){this.type=e,this.value=t}map(e){let t=this.type.map(this.value,e);return void 0===t?void 0:t==this.value?this:new fV(this.type,t)}is(e){return this.type==e}static define(e={}){return new fN(e.map||(e=>e))}static mapEffects(e,t){if(!e.length)return e;let n=[];for(let i of e){let e=i.map(t);e&&n.push(e)}return n}}fV.reconfigure=fV.define(),fV.appendConfig=fV.define();class fH{constructor(e,t,n,i,r,o){this.startState=e,this.changes=t,this.selection=n,this.effects=i,this.annotations=r,this.scrollIntoView=o,this._doc=null,this._state=null,n&&fd(n,t.newLength),r.some(e=>e.type==fH.time)||(this.annotations=r.concat(fH.time.of(Date.now())))}static create(e,t,n,i,r,o){return new fH(e,t,n,i,r,o)}get newDoc(){return this._doc||(this._doc=this.changes.apply(this.startState.doc))}get newSelection(){return this.selection||this.startState.selection.map(this.changes)}get state(){return this._state||this.startState.applyTransaction(this),this._state}annotation(e){for(let t of this.annotations)if(t.type==e)return t.value}get docChanged(){return!this.changes.empty}get reconfigured(){return this.startState.config!=this.state.config}isUserEvent(e){let t=this.annotation(fH.userEvent);return!!(t&&(t==e||t.length>e.length&&t.slice(0,e.length)==e&&"."==t[e.length]))}}function fz(e,t,n){var i;let r,o,s;return n?(r=t.changes,o=fi.empty(t.changes.length),s=e.changes.compose(t.changes)):(r=t.changes.map(e.changes),o=e.changes.mapDesc(t.changes,!0),s=e.changes.compose(r)),{changes:s,selection:t.selection?t.selection.map(o):null==(i=e.selection)?void 0:i.map(r),effects:fV.mapEffects(e.effects,r).concat(fV.mapEffects(t.effects,o)),annotations:e.annotations.length?e.annotations.concat(t.annotations):t.annotations,scrollIntoView:e.scrollIntoView||t.scrollIntoView}}function fW(e,t,n){let i=t.selection,r=f_(t.annotations);return t.userEvent&&(r=r.concat(fH.userEvent.of(t.userEvent))),{changes:t.changes instanceof fi?t.changes:fi.of(t.changes||[],n,e.facet(fE)),selection:i&&(i instanceof fh?i:fh.single(i.anchor,i.head)),effects:f_(t.effects),annotations:r,scrollIntoView:!!t.scrollIntoView}}fH.time=fB.define(),fH.userEvent=fB.define(),fH.addToHistory=fB.define(),fH.remote=fB.define();let f$=[];function f_(e){return null==e?f$:Array.isArray(e)?e:[e]}var fU=((p=fU||(fU={}))[p.Word=0]="Word",p[p.Space=1]="Space",p[p.Other=2]="Other",p);let fG=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;try{i=RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch(e){}class fq{constructor(e,t,n,i,r,o){this.config=e,this.doc=t,this.selection=n,this.values=i,this.status=e.statusTemplate.slice(),this.computeSlot=r,o&&(o._state=this);for(let e=0;e<this.config.dynamicSlots.length;e++)fT(this,e<<1);this.computeSlot=null}field(e,t=!0){let n=this.config.address[e.id];if(null==n){if(t)throw RangeError("Field is not present in this state");return}return fT(this,n),fD(this,n)}update(...e){return function e(t,n,i){let r=fW(t,n.length?n[0]:{},t.doc.length);n.length&&!1===n[0].filter&&(i=!1);for(let e=1;e<n.length;e++){!1===n[e].filter&&(i=!1);let o=!!n[e].sequential;r=fz(r,fW(t,n[e],o?r.changes.newLength:t.doc.length),o)}let o=fH.create(t,r.changes,r.selection,r.effects,r.annotations,r.scrollIntoView);return function(e){let t=e.startState,n=t.facet(fL),i=e;for(let r=n.length-1;r>=0;r--){let o=n[r](e);o&&Object.keys(o).length&&(i=fz(i,fW(t,o,e.changes.newLength),!0))}return i==e?e:fH.create(t,e.changes,e.selection,i.effects,i.annotations,i.scrollIntoView)}(i?function(t){let n=t.startState,i=!0;for(let e of n.facet(fO)){let n=e(t);if(!1===n){i=!1;break}Array.isArray(n)&&(i=!0===i?n:function(e,t){let n=[];for(let i=0,r=0;;){let o,s;if(i<e.length&&(r==t.length||t[r]>=e[i]))o=e[i++],s=e[i++];else{if(!(r<t.length))return n;o=t[r++],s=t[r++]}!n.length||n[n.length-1]<o?n.push(o,s):n[n.length-1]<s&&(n[n.length-1]=s)}}(i,n))}if(!0!==i){let e,r;if(!1===i)r=t.changes.invertedDesc,e=fi.empty(n.doc.length);else{let n=t.changes.filter(i);e=n.changes,r=n.filtered.mapDesc(n.changes).invertedDesc}t=fH.create(n,e,t.selection&&t.selection.map(r),fV.mapEffects(t.effects,r),t.annotations,t.scrollIntoView)}let r=n.facet(fP);for(let i=r.length-1;i>=0;i--){let o=r[i](t);t=o instanceof fH?o:Array.isArray(o)&&1==o.length&&o[0]instanceof fH?o[0]:e(n,f_(o),!1)}return t}(o):o)}(this,e,!0)}applyTransaction(e){let t,n=this.config,{base:i,compartments:r}=n;for(let t of e.effects)t.is(fA.reconfigure)?(n&&(r=new Map,n.compartments.forEach((e,t)=>r.set(t,e)),n=null),r.set(t.value.compartment,t.value.extension)):t.is(fV.reconfigure)?(n=null,i=t.value):t.is(fV.appendConfig)&&(n=null,i=f_(i).concat(t.value));t=n?e.startState.values.slice():new fq(n=fM.resolve(i,r,this),this.doc,this.selection,n.dynamicSlots.map(()=>null),(e,t)=>t.reconfigure(e,this),null).values;let o=e.startState.facet(fR)?e.newSelection:e.newSelection.asSingle();new fq(n,e.newDoc,o,t,(t,n)=>n.update(t,e),e)}replaceSelection(e){return"string"==typeof e&&(e=this.toText(e)),this.changeByRange(t=>({changes:{from:t.from,to:t.to,insert:e},range:fh.cursor(t.from+e.length)}))}changeByRange(e){let t=this.selection,n=e(t.ranges[0]),i=this.changes(n.changes),r=[n.range],o=f_(n.effects);for(let n=1;n<t.ranges.length;n++){let s=e(t.ranges[n]),l=this.changes(s.changes),a=l.map(i);for(let e=0;e<n;e++)r[e]=r[e].map(a);let u=i.mapDesc(l,!0);r.push(s.range.map(u)),i=i.compose(a),o=fV.mapEffects(o,a).concat(fV.mapEffects(f_(s.effects),u))}return{changes:i,selection:fh.create(r,t.mainIndex),effects:o}}changes(e=[]){return e instanceof fi?e:fi.of(e,this.doc.length,this.facet(fq.lineSeparator))}toText(e){return dZ.of(e.split(this.facet(fq.lineSeparator)||fe))}sliceDoc(e=0,t=this.doc.length){return this.doc.sliceString(e,t,this.lineBreak)}facet(e){let t=this.config.address[e.id];return null==t?e.default:(fT(this,t),fD(this,t))}toJSON(e){let t={doc:this.sliceDoc(),selection:this.selection.toJSON()};if(e)for(let n in e){let i=e[n];i instanceof fy&&null!=this.config.address[i.id]&&(t[n]=i.spec.toJSON(this.field(e[n]),this))}return t}static fromJSON(e,t={},n){if(!e||"string"!=typeof e.doc)throw RangeError("Invalid JSON representation for EditorState");let i=[];if(n){for(let t in n)if(Object.prototype.hasOwnProperty.call(e,t)){let r=n[t],o=e[t];i.push(r.init(e=>r.spec.fromJSON(o,e)))}}return fq.create({doc:e.doc,selection:fh.fromJSON(e.selection),extensions:t.extensions?i.concat([t.extensions]):i})}static create(e={}){let t=fM.resolve(e.extensions||[],new Map),n=e.doc instanceof dZ?e.doc:dZ.of((e.doc||"").split(t.staticFacet(fq.lineSeparator)||fe)),i=e.selection?e.selection instanceof fh?e.selection:fh.single(e.selection.anchor,e.selection.head):fh.single(0);return fd(i,n.length),t.staticFacet(fR)||(i=i.asSingle()),new fq(t,n,i,t.dynamicSlots.map(()=>null),(e,t)=>t.create(e),null)}get tabSize(){return this.facet(fq.tabSize)}get lineBreak(){return this.facet(fq.lineSeparator)||"\n"}get readOnly(){return this.facet(fj)}phrase(e,...t){for(let t of this.facet(fq.phrases))if(Object.prototype.hasOwnProperty.call(t,e)){e=t[e];break}return t.length&&(e=e.replace(/\$(\$|\d*)/g,(e,n)=>{if("$"==n)return"$";let i=+(n||1);return!i||i>t.length?e:t[i-1]})),e}languageDataAt(e,t,n=-1){let i=[];for(let r of this.facet(fI))for(let o of r(this,t,n))Object.prototype.hasOwnProperty.call(o,e)&&i.push(o[e]);return i}charCategorizer(e){var t;let n=this.languageDataAt("wordChars",e);return t=n.length?n[0]:"",e=>{if(!/\S/.test(e))return fU.Space;if(function(e){if(i)return i.test(e);for(let t=0;t<e.length;t++){let n=e[t];if(/\w/.test(n)||n>"\x80"&&(n.toUpperCase()!=n.toLowerCase()||fG.test(n)))return!0}return!1}(e))return fU.Word;for(let n=0;n<t.length;n++)if(e.indexOf(t[n])>-1)return fU.Word;return fU.Other}}wordAt(e){let{text:t,from:n,length:i}=this.doc.lineAt(e),r=this.charCategorizer(e),o=e-n,s=e-n;for(;o>0;){let e=d6(t,o,!1);if(r(t.slice(e,o))!=fU.Word)break;o=e}for(;s<i;){let e=d6(t,s);if(r(t.slice(s,e))!=fU.Word)break;s=e}return o==s?null:fh.range(o+n,s+n)}}function fY(e,t,n={}){let i={};for(let t of e)for(let e of Object.keys(t)){let r=t[e],o=i[e];if(void 0===o)i[e]=r;else if(o===r||void 0===r);else if(Object.hasOwnProperty.call(n,e))i[e]=n[e](o,r);else throw Error("Config merge conflict for field "+e)}for(let e in t)void 0===i[e]&&(i[e]=t[e]);return i}fq.allowMultipleSelections=fR,fq.tabSize=fp.define({combine:e=>e.length?e[0]:4}),fq.lineSeparator=fE,fq.readOnly=fj,fq.phrases=fp.define({compare(e,t){let n=Object.keys(e),i=Object.keys(t);return n.length==i.length&&n.every(n=>e[n]==t[n])}}),fq.languageData=fI,fq.changeFilter=fO,fq.transactionFilter=fP,fq.transactionExtender=fL,fA.reconfigure=fV.define();class fK{eq(e){return this==e}range(e,t=e){return fZ.create(e,t,this)}}function fX(e,t){return e==t||e.constructor==t.constructor&&e.eq(t)}fK.prototype.startSide=fK.prototype.endSide=0,fK.prototype.point=!1,fK.prototype.mapMode=ft.TrackDel;class fZ{constructor(e,t,n){this.from=e,this.to=t,this.value=n}static create(e,t,n){return new fZ(e,t,n)}}function fQ(e,t){return e.from-t.from||e.value.startSide-t.value.startSide}class fJ{constructor(e,t,n,i){this.from=e,this.to=t,this.value=n,this.maxPoint=i}get length(){return this.to[this.to.length-1]}findIndex(e,t,n,i=0){let r=n?this.to:this.from;for(let o=i,s=r.length;;){if(o==s)return o;let i=o+s>>1,l=r[i]-e||(n?this.value[i].endSide:this.value[i].startSide)-t;if(i==o)return l>=0?o:s;l>=0?s=i:o=i+1}}between(e,t,n,i){for(let r=this.findIndex(t,-1e9,!0),o=this.findIndex(n,1e9,!1,r);r<o;r++)if(!1===i(this.from[r]+e,this.to[r]+e,this.value[r]))return!1}map(e,t){let n=[],i=[],r=[],o=-1,s=-1;for(let l=0;l<this.value.length;l++){let a=this.value[l],u=this.from[l]+e,c=this.to[l]+e,h,d;if(u==c){let e=t.mapPos(u,a.startSide,a.mapMode);if(null==e||(h=d=e,a.startSide!=a.endSide&&(d=t.mapPos(u,a.endSide))<h))continue}else if((h=t.mapPos(u,a.startSide))>(d=t.mapPos(c,a.endSide))||h==d&&a.startSide>0&&a.endSide<=0)continue;0>(d-h||a.endSide-a.startSide)||(o<0&&(o=h),a.point&&(s=Math.max(s,d-h)),n.push(a),i.push(h-o),r.push(d-o))}return{mapped:n.length?new fJ(i,r,n,s):null,pos:o}}}class f0{constructor(e,t,n,i){this.chunkPos=e,this.chunk=t,this.nextLayer=n,this.maxPoint=i}static create(e,t,n,i){return new f0(e,t,n,i)}get length(){let e=this.chunk.length-1;return e<0?0:Math.max(this.chunkEnd(e),this.nextLayer.length)}get size(){if(this.isEmpty)return 0;let e=this.nextLayer.size;for(let t of this.chunk)e+=t.value.length;return e}chunkEnd(e){return this.chunkPos[e]+this.chunk[e].length}update(e){let{add:t=[],sort:n=!1,filterFrom:i=0,filterTo:r=this.length}=e,o=e.filter;if(0==t.length&&!o)return this;if(n&&(t=t.slice().sort(fQ)),this.isEmpty)return t.length?f0.of(t):this;let s=new f5(this,null,-1).goto(0),l=0,a=[],u=new f1;for(;s.value||l<t.length;)if(l<t.length&&(s.from-t[l].from||s.startSide-t[l].value.startSide)>=0){let e=t[l++];u.addInner(e.from,e.to,e.value)||a.push(e)}else 1==s.rangeIndex&&s.chunkIndex<this.chunk.length&&(l==t.length||this.chunkEnd(s.chunkIndex)<t[l].from)&&(!o||i>this.chunkEnd(s.chunkIndex)||r<this.chunkPos[s.chunkIndex])&&u.addChunk(this.chunkPos[s.chunkIndex],this.chunk[s.chunkIndex])?s.nextChunk():((!o||i>s.to||r<s.from||o(s.from,s.to,s.value))&&!u.addInner(s.from,s.to,s.value)&&a.push(fZ.create(s.from,s.to,s.value)),s.next());return u.finishInner(this.nextLayer.isEmpty&&!a.length?f0.empty:this.nextLayer.update({add:a,filter:o,filterFrom:i,filterTo:r}))}map(e){if(e.empty||this.isEmpty)return this;let t=[],n=[],i=-1;for(let r=0;r<this.chunk.length;r++){let o=this.chunkPos[r],s=this.chunk[r],l=e.touchesRange(o,o+s.length);if(!1===l)i=Math.max(i,s.maxPoint),t.push(s),n.push(e.mapPos(o));else if(!0===l){let{mapped:r,pos:l}=s.map(o,e);r&&(i=Math.max(i,r.maxPoint),t.push(r),n.push(l))}}let r=this.nextLayer.map(e);return 0==t.length?r:new f0(n,t,r||f0.empty,i)}between(e,t,n){if(!this.isEmpty){for(let i=0;i<this.chunk.length;i++){let r=this.chunkPos[i],o=this.chunk[i];if(t>=r&&e<=r+o.length&&!1===o.between(r,e-r,t-r,n))return}this.nextLayer.between(e,t,n)}}iter(e=0){return f3.from([this]).goto(e)}get isEmpty(){return this.nextLayer==this}static iter(e,t=0){return f3.from(e).goto(t)}static compare(e,t,n,i,r=-1){let o=e.filter(e=>e.maxPoint>0||!e.isEmpty&&e.maxPoint>=r),s=t.filter(e=>e.maxPoint>0||!e.isEmpty&&e.maxPoint>=r),l=f2(o,s,n),a=new f6(o,l,r),u=new f6(s,l,r);n.iterGaps((e,t,n)=>f8(a,e,u,t,n,i)),n.empty&&0==n.length&&f8(a,0,u,0,0,i)}static eq(e,t,n=0,i){null==i&&(i=0x3b9ac9ff);let r=e.filter(e=>!e.isEmpty&&0>t.indexOf(e)),o=t.filter(t=>!t.isEmpty&&0>e.indexOf(t));if(r.length!=o.length)return!1;if(!r.length)return!0;let s=f2(r,o),l=new f6(r,s,0).goto(n),a=new f6(o,s,0).goto(n);for(;;){if(l.to!=a.to||!f9(l.active,a.active)||l.point&&(!a.point||!fX(l.point,a.point)))return!1;if(l.to>i)return!0;l.next(),a.next()}}static spans(e,t,n,i,r=-1){let o=new f6(e,null,r).goto(t),s=t,l=o.openStart;for(;;){let e=Math.min(o.to,n);if(o.point){let n=o.activeForPoint(o.to),r=o.pointFrom<t?n.length+1:o.point.startSide<0?n.length:Math.min(n.length,l);i.point(s,e,o.point,n,r,o.pointRank),l=Math.min(o.openEnd(e),n.length)}else e>s&&(i.span(s,e,o.active,l),l=o.openEnd(e));if(o.to>n)return l+(o.point&&o.to>n?1:0);s=o.to,o.next()}}static of(e,t=!1){let n=new f1;for(let i of e instanceof fZ?[e]:t?function(e){if(e.length>1)for(let t=e[0],n=1;n<e.length;n++){let i=e[n];if(fQ(t,i)>0)return e.slice().sort(fQ);t=i}return e}(e):e)n.add(i.from,i.to,i.value);return n.finish()}static join(e){if(!e.length)return f0.empty;let t=e[e.length-1];for(let n=e.length-2;n>=0;n--)for(let i=e[n];i!=f0.empty;i=i.nextLayer)t=new f0(i.chunkPos,i.chunk,t,Math.max(i.maxPoint,t.maxPoint));return t}}f0.empty=new f0([],[],null,-1),f0.empty.nextLayer=f0.empty;class f1{finishChunk(e){this.chunks.push(new fJ(this.from,this.to,this.value,this.maxPoint)),this.chunkPos.push(this.chunkStart),this.chunkStart=-1,this.setMaxPoint=Math.max(this.setMaxPoint,this.maxPoint),this.maxPoint=-1,e&&(this.from=[],this.to=[],this.value=[])}constructor(){this.chunks=[],this.chunkPos=[],this.chunkStart=-1,this.last=null,this.lastFrom=-1e9,this.lastTo=-1e9,this.from=[],this.to=[],this.value=[],this.maxPoint=-1,this.setMaxPoint=-1,this.nextLayer=null}add(e,t,n){this.addInner(e,t,n)||(this.nextLayer||(this.nextLayer=new f1)).add(e,t,n)}addInner(e,t,n){let i=e-this.lastTo||n.startSide-this.last.endSide;if(i<=0&&0>(e-this.lastFrom||n.startSide-this.last.startSide))throw Error("Ranges must be added sorted by `from` position and `startSide`");return!(i<0)&&(250==this.from.length&&this.finishChunk(!0),this.chunkStart<0&&(this.chunkStart=e),this.from.push(e-this.chunkStart),this.to.push(t-this.chunkStart),this.last=n,this.lastFrom=e,this.lastTo=t,this.value.push(n),n.point&&(this.maxPoint=Math.max(this.maxPoint,t-e)),!0)}addChunk(e,t){if(0>(e-this.lastTo||t.value[0].startSide-this.last.endSide))return!1;this.from.length&&this.finishChunk(!0),this.setMaxPoint=Math.max(this.setMaxPoint,t.maxPoint),this.chunks.push(t),this.chunkPos.push(e);let n=t.value.length-1;return this.last=t.value[n],this.lastFrom=t.from[n]+e,this.lastTo=t.to[n]+e,!0}finish(){return this.finishInner(f0.empty)}finishInner(e){if(this.from.length&&this.finishChunk(!1),0==this.chunks.length)return e;let t=f0.create(this.chunkPos,this.chunks,this.nextLayer?this.nextLayer.finishInner(e):e,this.setMaxPoint);return this.from=null,t}}function f2(e,t,n){let i=new Map;for(let t of e)for(let e=0;e<t.chunk.length;e++)t.chunk[e].maxPoint<=0&&i.set(t.chunk[e],t.chunkPos[e]);let r=new Set;for(let e of t)for(let t=0;t<e.chunk.length;t++){let o=i.get(e.chunk[t]);null==o||(n?n.mapPos(o):o)!=e.chunkPos[t]||(null==n?void 0:n.touchesRange(o,o+e.chunk[t].length))||r.add(e.chunk[t])}return r}class f5{constructor(e,t,n,i=0){this.layer=e,this.skip=t,this.minPoint=n,this.rank=i}get startSide(){return this.value?this.value.startSide:0}get endSide(){return this.value?this.value.endSide:0}goto(e,t=-1e9){return this.chunkIndex=this.rangeIndex=0,this.gotoInner(e,t,!1),this}gotoInner(e,t,n){for(;this.chunkIndex<this.layer.chunk.length;){let t=this.layer.chunk[this.chunkIndex];if(!(this.skip&&this.skip.has(t)||this.layer.chunkEnd(this.chunkIndex)<e||t.maxPoint<this.minPoint))break;this.chunkIndex++,n=!1}if(this.chunkIndex<this.layer.chunk.length){let i=this.layer.chunk[this.chunkIndex].findIndex(e-this.layer.chunkPos[this.chunkIndex],t,!0);(!n||this.rangeIndex<i)&&this.setRangeIndex(i)}this.next()}forward(e,t){0>(this.to-e||this.endSide-t)&&this.gotoInner(e,t,!0)}next(){for(;;)if(this.chunkIndex==this.layer.chunk.length){this.from=this.to=1e9,this.value=null;break}else{let e=this.layer.chunkPos[this.chunkIndex],t=this.layer.chunk[this.chunkIndex],n=e+t.from[this.rangeIndex];if(this.from=n,this.to=e+t.to[this.rangeIndex],this.value=t.value[this.rangeIndex],this.setRangeIndex(this.rangeIndex+1),this.minPoint<0||this.value.point&&this.to-this.from>=this.minPoint)break}}setRangeIndex(e){if(e==this.layer.chunk[this.chunkIndex].value.length){if(this.chunkIndex++,this.skip)for(;this.chunkIndex<this.layer.chunk.length&&this.skip.has(this.layer.chunk[this.chunkIndex]);)this.chunkIndex++;this.rangeIndex=0}else this.rangeIndex=e}nextChunk(){this.chunkIndex++,this.rangeIndex=0,this.next()}compare(e){return this.from-e.from||this.startSide-e.startSide||this.rank-e.rank||this.to-e.to||this.endSide-e.endSide}}class f3{constructor(e){this.heap=e}static from(e,t=null,n=-1){let i=[];for(let r=0;r<e.length;r++)for(let o=e[r];!o.isEmpty;o=o.nextLayer)o.maxPoint>=n&&i.push(new f5(o,t,n,r));return 1==i.length?i[0]:new f3(i)}get startSide(){return this.value?this.value.startSide:0}goto(e,t=-1e9){for(let n of this.heap)n.goto(e,t);for(let e=this.heap.length>>1;e>=0;e--)f4(this.heap,e);return this.next(),this}forward(e,t){for(let n of this.heap)n.forward(e,t);for(let e=this.heap.length>>1;e>=0;e--)f4(this.heap,e);0>(this.to-e||this.value.endSide-t)&&this.next()}next(){if(0==this.heap.length)this.from=this.to=1e9,this.value=null,this.rank=-1;else{let e=this.heap[0];this.from=e.from,this.to=e.to,this.value=e.value,this.rank=e.rank,e.value&&e.next(),f4(this.heap,0)}}}function f4(e,t){for(let n=e[t];;){let i=(t<<1)+1;if(i>=e.length)break;let r=e[i];if(i+1<e.length&&r.compare(e[i+1])>=0&&(r=e[i+1],i++),0>n.compare(r))break;e[i]=n,e[t]=r,t=i}}class f6{constructor(e,t,n){this.minPoint=n,this.active=[],this.activeTo=[],this.activeRank=[],this.minActive=-1,this.point=null,this.pointFrom=0,this.pointRank=0,this.to=-1e9,this.endSide=0,this.openStart=-1,this.cursor=f3.from(e,t,n)}goto(e,t=-1e9){return this.cursor.goto(e,t),this.active.length=this.activeTo.length=this.activeRank.length=0,this.minActive=-1,this.to=e,this.endSide=t,this.openStart=-1,this.next(),this}forward(e,t){for(;this.minActive>-1&&0>(this.activeTo[this.minActive]-e||this.active[this.minActive].endSide-t);)this.removeActive(this.minActive);this.cursor.forward(e,t)}removeActive(e){f7(this.active,e),f7(this.activeTo,e),f7(this.activeRank,e),this.minActive=pt(this.active,this.activeTo)}addActive(e){let t=0,{value:n,to:i,rank:r}=this.cursor;for(;t<this.activeRank.length&&(r-this.activeRank[t]||i-this.activeTo[t])>0;)t++;pe(this.active,t,n),pe(this.activeTo,t,i),pe(this.activeRank,t,r),e&&pe(e,t,this.cursor.from),this.minActive=pt(this.active,this.activeTo)}next(){let e=this.to,t=this.point;this.point=null;let n=this.openStart<0?[]:null;for(;;){let i=this.minActive;if(i>-1&&0>(this.activeTo[i]-this.cursor.from||this.active[i].endSide-this.cursor.startSide)){if(this.activeTo[i]>e){this.to=this.activeTo[i],this.endSide=this.active[i].endSide;break}this.removeActive(i),n&&f7(n,i)}else if(this.cursor.value)if(this.cursor.from>e){this.to=this.cursor.from,this.endSide=this.cursor.startSide;break}else{let e=this.cursor.value;if(e.point)if(t&&this.cursor.to==this.to&&this.cursor.from<this.cursor.to)this.cursor.next();else{this.point=e,this.pointFrom=this.cursor.from,this.pointRank=this.cursor.rank,this.to=this.cursor.to,this.endSide=e.endSide,this.cursor.next(),this.forward(this.to,this.endSide);break}else this.addActive(n),this.cursor.next()}else{this.to=this.endSide=1e9;break}}if(n){this.openStart=0;for(let t=n.length-1;t>=0&&n[t]<e;t--)this.openStart++}}activeForPoint(e){if(!this.active.length)return this.active;let t=[];for(let n=this.active.length-1;n>=0&&!(this.activeRank[n]<this.pointRank);n--)(this.activeTo[n]>e||this.activeTo[n]==e&&this.active[n].endSide>=this.point.endSide)&&t.push(this.active[n]);return t.reverse()}openEnd(e){let t=0;for(let n=this.activeTo.length-1;n>=0&&this.activeTo[n]>e;n--)t++;return t}}function f8(e,t,n,i,r,o){e.goto(t),n.goto(i);let s=i+r,l=i,a=i-t,u=!!o.boundChange;for(let t=!1;;){let i=e.to+a-n.to,r=i||e.endSide-n.endSide,c=r<0?e.to+a:n.to,h=Math.min(c,s);if(e.point||n.point?(e.point&&n.point&&fX(e.point,n.point)&&f9(e.activeForPoint(e.to),n.activeForPoint(n.to))||o.comparePoint(l,h,e.point,n.point),t=!1):(t&&o.boundChange(l),h>l&&!f9(e.active,n.active)&&o.compareRange(l,h,e.active,n.active),u&&h<s&&(i||e.openEnd(c)!=n.openEnd(c))&&(t=!0)),c>s)break;l=c,r<=0&&e.next(),r>=0&&n.next()}}function f9(e,t){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!=t[n]&&!fX(e[n],t[n]))return!1;return!0}function f7(e,t){for(let n=t,i=e.length-1;n<i;n++)e[n]=e[n+1];e.pop()}function pe(e,t,n){for(let n=e.length-1;n>=t;n--)e[n+1]=e[n];e[t]=n}function pt(e,t){let n=-1,i=1e9;for(let r=0;r<t.length;r++)0>(t[r]-i||e[r].endSide-e[n].endSide)&&(n=r,i=t[r]);return n}function pn(e,t,n=e.length){let i=0;for(let r=0;r<n&&r<e.length;)9==e.charCodeAt(r)?(i+=t-i%t,r++):(i++,r=d6(e,r));return i}function pi(e,t,n,i){for(let i=0,r=0;;){if(r>=t)return i;if(i==e.length)break;r+=9==e.charCodeAt(i)?n-r%n:1,i=d6(e,i)}return!0===i?-1:e.length}let pr="u"<typeof Symbol?"__ͼ":Symbol.for("ͼ"),po="u"<typeof Symbol?"__styleSet"+Math.floor(1e8*Math.random()):Symbol("styleSet"),ps="u">typeof globalThis?globalThis:"u">typeof window?window:{};class pl{constructor(e,t){this.rules=[];let{finish:n}=t||{};function i(e){return/^@/.test(e)?[e]:e.split(/,\s*/)}for(let t in e)!function e(t,r,o,s){let l=[],a=/^@(\w+)\b/.exec(t[0]),u=a&&"keyframes"==a[1];if(a&&null==r)return o.push(t[0]+";");for(let n in r){let s=r[n];if(/&/.test(n))e(n.split(/,\s*/).map(e=>t.map(t=>e.replace(/&/,t))).reduce((e,t)=>e.concat(t)),s,o);else if(s&&"object"==typeof s){if(!a)throw RangeError("The value of a property ("+n+") should be a primitive value.");e(i(n),s,l,u)}else null!=s&&l.push(n.replace(/_.*/,"").replace(/[A-Z]/g,e=>"-"+e.toLowerCase())+": "+s+";")}(l.length||u)&&o.push((n&&!a&&!s?t.map(n):t).join(", ")+" {"+l.join(" ")+"}")}(i(t),e[t],this.rules)}getRules(){return this.rules.join("\n")}static newName(){let e=ps[pr]||1;return ps[pr]=e+1,"ͼ"+e.toString(36)}static mount(e,t,n){let i=e[po],r=n&&n.nonce;i?r&&i.setNonce(r):i=new pu(e,r),i.mount(Array.isArray(t)?t:[t],e)}}let pa=new Map;class pu{constructor(e,t){let n=e.ownerDocument||e,i=n.defaultView;if(!e.head&&e.adoptedStyleSheets&&i.CSSStyleSheet){let t=pa.get(n);if(t)return e[po]=t;this.sheet=new i.CSSStyleSheet,pa.set(n,this)}else this.styleTag=n.createElement("style"),t&&this.styleTag.setAttribute("nonce",t);this.modules=[],e[po]=this}mount(e,t){let n=this.sheet,i=0,r=0;for(let t=0;t<e.length;t++){let o=e[t],s=this.modules.indexOf(o);if(s<r&&s>-1&&(this.modules.splice(s,1),r--,s=-1),-1==s){if(this.modules.splice(r++,0,o),n)for(let e=0;e<o.rules.length;e++)n.insertRule(o.rules[e],i++)}else{for(;r<s;)i+=this.modules[r++].rules.length;i+=o.rules.length,r++}}if(n)0>t.adoptedStyleSheets.indexOf(this.sheet)&&(t.adoptedStyleSheets=[this.sheet,...t.adoptedStyleSheets]);else{let e="";for(let t=0;t<this.modules.length;t++)e+=this.modules[t].getRules()+"\n";this.styleTag.textContent=e;let n=t.head||t;this.styleTag.parentNode!=n&&n.insertBefore(this.styleTag,n.firstChild)}}setNonce(e){this.styleTag&&this.styleTag.getAttribute("nonce")!=e&&this.styleTag.setAttribute("nonce",e)}}for(var pc={8:"Backspace",9:"Tab",10:"Enter",12:"NumLock",13:"Enter",16:"Shift",17:"Control",18:"Alt",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",44:"PrintScreen",45:"Insert",46:"Delete",59:";",61:"=",91:"Meta",92:"Meta",106:"*",107:"+",108:",",109:"-",110:".",111:"/",144:"NumLock",145:"ScrollLock",160:"Shift",161:"Shift",162:"Control",163:"Control",164:"Alt",165:"Alt",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},ph={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},pd="u">typeof navigator&&/Mac/.test(navigator.platform),pf="u">typeof navigator&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),pp=0;pp<10;pp++)pc[48+pp]=pc[96+pp]=String(pp);for(var pp=1;pp<=24;pp++)pc[pp+111]="F"+pp;for(var pp=65;pp<=90;pp++)pc[pp]=String.fromCharCode(pp+32),ph[pp]=String.fromCharCode(pp);for(var pm in pc)ph.hasOwnProperty(pm)||(ph[pm]=pc[pm]);function pg(){var e=arguments[0];"string"==typeof e&&(e=document.createElement(e));var t=1,n=arguments[1];if(n&&"object"==typeof n&&null==n.nodeType&&!Array.isArray(n)){for(var i in n)if(Object.prototype.hasOwnProperty.call(n,i)){var r=n[i];"string"==typeof r?e.setAttribute(i,r):null!=r&&(e[i]=r)}t++}for(;t<arguments.length;t++)!function e(t,n){if("string"==typeof n)t.appendChild(document.createTextNode(n));else if(null==n);else if(null!=n.nodeType)t.appendChild(n);else if(Array.isArray(n))for(var i=0;i<n.length;i++)e(t,n[i]);else throw RangeError("Unsupported child node: "+n)}(e,arguments[t]);return e}let pv="u">typeof navigator?navigator:{userAgent:"",vendor:"",platform:""},pb="u">typeof document?document:{documentElement:{style:{}}},px=/Edge\/(\d+)/.exec(pv.userAgent),py=/MSIE \d/.test(pv.userAgent),pw=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(pv.userAgent),pS=!!(py||pw||px),pC=!pS&&/gecko\/(\d+)/i.test(pv.userAgent),pA=!pS&&/Chrome\/(\d+)/.exec(pv.userAgent),pk="webkitFontSmoothing"in pb.documentElement.style,pM=!pS&&/Apple Computer/.test(pv.vendor),pT=pM&&(/Mobile\/\w+/.test(pv.userAgent)||pv.maxTouchPoints>2);var pD={mac:pT||/Mac/.test(pv.platform),windows:/Win/.test(pv.platform),linux:/Linux|X11/.test(pv.platform),ie:pS,ie_version:py?pb.documentMode||6:pw?+pw[1]:px?+px[1]:0,gecko:pC,gecko_version:pC?+(/Firefox\/(\d+)/.exec(pv.userAgent)||[0,0])[1]:0,chrome:!!pA,chrome_version:pA?+pA[1]:0,ios:pT,android:/Android\b/.test(pv.userAgent),webkit:pk,webkit_version:pk?+(/\bAppleWebKit\/(\d+)/.exec(pv.userAgent)||[0,0])[1]:0,safari:pM,safari_version:pM?+(/\bVersion\/(\d+(\.\d+)?)/.exec(pv.userAgent)||[0,0])[1]:0,tabSize:null!=pb.documentElement.style.tabSize?"tab-size":"-moz-tab-size"};function pI(e,t){for(let n in e)"class"==n&&t.class?t.class+=" "+e.class:"style"==n&&t.style?t.style+=";"+e.style:t[n]=e[n];return t}let pR=Object.create(null);function pE(e,t,n){if(e==t)return!0;e||(e=pR),t||(t=pR);let i=Object.keys(e),r=Object.keys(t);if(i.length-(n&&i.indexOf(n)>-1?1:0)!=r.length-(n&&r.indexOf(n)>-1?1:0))return!1;for(let o of i)if(o!=n&&(-1==r.indexOf(o)||e[o]!==t[o]))return!1;return!0}function pO(e,t,n){let i=!1;if(t)for(let r in t)n&&r in n||(i=!0,"style"==r?e.style.cssText="":e.removeAttribute(r));if(n)for(let r in n)t&&t[r]==n[r]||(i=!0,"style"==r?e.style.cssText=n[r]:e.setAttribute(r,n[r]));return i}class pP{eq(e){return!1}updateDOM(e,t,n){return!1}compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}get estimatedHeight(){return -1}get lineBreaks(){return 0}ignoreEvent(e){return!0}coordsAt(e,t,n){return null}get isHidden(){return!1}get editable(){return!1}destroy(e){}}var pL=((m=pL||(pL={}))[m.Text=0]="Text",m[m.WidgetBefore=1]="WidgetBefore",m[m.WidgetAfter=2]="WidgetAfter",m[m.WidgetRange=3]="WidgetRange",m);class pj extends fK{constructor(e,t,n,i){super(),this.startSide=e,this.endSide=t,this.widget=n,this.spec=i}get heightRelevant(){return!1}static mark(e){return new pB(e)}static widget(e){let t=Math.max(-1e4,Math.min(1e4,e.side||0)),n=!!e.block;return t+=n&&!e.inlineOrder?t>0?3e8:-4e8:t>0?1e8:-1e8,new pN(e,t,t,n,e.widget||null,!1)}static replace(e){let t=!!e.block,n,i;if(e.isBlockGap)n=-5e8,i=4e8;else{let{start:r,end:o}=pV(e,t);n=(r?t?-3e8:-1:5e8)-1,i=(o?t?2e8:1:-6e8)+1}return new pN(e,n,i,t,e.widget||null,!0)}static line(e){return new pF(e)}static set(e,t=!1){return f0.of(e,t)}hasHeight(){return!!this.widget&&this.widget.estimatedHeight>-1}}pj.none=f0.empty;class pB extends pj{constructor(e){let{start:t,end:n}=pV(e);super(t?-1:5e8,n?1:-6e8,null,e),this.tagName=e.tagName||"span",this.attrs=e.class&&e.attributes?pI(e.attributes,{class:e.class}):e.class?{class:e.class}:e.attributes||pR}eq(e){return this==e||e instanceof pB&&this.tagName==e.tagName&&pE(this.attrs,e.attrs)}range(e,t=e){if(e>=t)throw RangeError("Mark decorations may not be empty");return super.range(e,t)}}pB.prototype.point=!1;class pF extends pj{constructor(e){super(-2e8,-2e8,null,e)}eq(e){return e instanceof pF&&this.spec.class==e.spec.class&&pE(this.spec.attributes,e.spec.attributes)}range(e,t=e){if(t!=e)throw RangeError("Line decoration ranges must be zero-length");return super.range(e,t)}}pF.prototype.mapMode=ft.TrackBefore,pF.prototype.point=!0;class pN extends pj{constructor(e,t,n,i,r,o){super(t,n,r,e),this.block=i,this.isReplace=o,this.mapMode=i?t<=0?ft.TrackBefore:ft.TrackAfter:ft.TrackDel}get type(){return this.startSide!=this.endSide?pL.WidgetRange:this.startSide<=0?pL.WidgetBefore:pL.WidgetAfter}get heightRelevant(){return this.block||!!this.widget&&(this.widget.estimatedHeight>=5||this.widget.lineBreaks>0)}eq(e){var t,n;return e instanceof pN&&(t=this.widget,t==(n=e.widget)||!!(t&&n&&t.compare(n)))&&this.block==e.block&&this.startSide==e.startSide&&this.endSide==e.endSide}range(e,t=e){if(this.isReplace&&(e>t||e==t&&this.startSide>0&&this.endSide<=0))throw RangeError("Invalid range for replacement decoration");if(!this.isReplace&&t!=e)throw RangeError("Widget decorations can only have zero-length ranges");return super.range(e,t)}}function pV(e,t=!1){let{inclusiveStart:n,inclusiveEnd:i}=e;return null==n&&(n=e.inclusive),null==i&&(i=e.inclusive),{start:null!=n?n:t,end:null!=i?i:t}}function pH(e,t,n,i=0){let r=n.length-1;r>=0&&n[r]+i>=e?n[r]=Math.max(n[r],t):n.push(e,t)}pN.prototype.point=!0;class pz extends fK{constructor(e,t){super(),this.tagName=e,this.attributes=t}eq(e){return e==this||e instanceof pz&&this.tagName==e.tagName&&pE(this.attributes,e.attributes)}static create(e){return new pz(e.tagName,e.attributes||pR)}static set(e,t=!1){return f0.of(e,t)}}function pW(e){return(11==e.nodeType?e.getSelection?e:e.ownerDocument:e).getSelection()}function p$(e,t){return!!t&&(e==t||e.contains(1!=t.nodeType?t.parentNode:t))}function p_(e,t){if(!t.anchorNode)return!1;try{return p$(e,t.anchorNode)}catch(e){return!1}}function pU(e){return 3==e.nodeType?p5(e,0,e.nodeValue.length).getClientRects():1==e.nodeType?e.getClientRects():[]}function pG(e,t,n,i){return!!n&&(pK(e,t,n,i,-1)||pK(e,t,n,i,1))}function pq(e){for(var t=0;;t++)if(!(e=e.previousSibling))return t}function pY(e){return 1==e.nodeType&&/^(DIV|P|LI|UL|OL|BLOCKQUOTE|DD|DT|H\d|SECTION|PRE)$/.test(e.nodeName)}function pK(e,t,n,i,r){for(;;){if(e==n&&t==i)return!0;if(t==(r<0?0:pX(e))){if("DIV"==e.nodeName)return!1;let n=e.parentNode;if(!n||1!=n.nodeType)return!1;t=pq(e)+(r<0?0:1),e=n}else{if(1!=e.nodeType||1==(e=e.childNodes[t+(r<0?-1:0)]).nodeType&&"false"==e.contentEditable)return!1;t=r<0?pX(e):0}}}function pX(e){return 3==e.nodeType?e.nodeValue.length:e.childNodes.length}function pZ(e,t){let n=t?e.left:e.right;return{left:n,right:n,top:e.top,bottom:e.bottom}}function pQ(e,t){let n=t.width/e.offsetWidth,i=t.height/e.offsetHeight;return(n>.995&&n<1.005||!isFinite(n)||1>Math.abs(t.width-e.offsetWidth))&&(n=1),(i>.995&&i<1.005||!isFinite(i)||1>Math.abs(t.height-e.offsetHeight))&&(i=1),{scaleX:n,scaleY:i}}function pJ(e,t=!0){let n=e.ownerDocument,i=null,r=null;for(let o=e.parentNode;o;)if(o==n.body||(!t||i)&&r)break;else if(1==o.nodeType)!r&&o.scrollHeight>o.clientHeight&&(r=o),t&&!i&&o.scrollWidth>o.clientWidth&&(i=o),o=o.assignedSlot||o.parentNode;else if(11==o.nodeType)o=o.host;else break;return{x:i,y:r}}pz.prototype.startSide=pz.prototype.endSide=-1;class p0{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}eq(e){return this.anchorNode==e.anchorNode&&this.anchorOffset==e.anchorOffset&&this.focusNode==e.focusNode&&this.focusOffset==e.focusOffset}setRange(e){let{anchorNode:t,focusNode:n}=e;this.set(t,Math.min(e.anchorOffset,t?pX(t):0),n,Math.min(e.focusOffset,n?pX(n):0))}set(e,t,n,i){this.anchorNode=e,this.anchorOffset=t,this.focusNode=n,this.focusOffset=i}}let p1=null;function p2(e){if(e.setActive)return e.setActive();if(p1)return e.focus(p1);let t=[];for(let n=e;n&&(t.push(n,n.scrollTop,n.scrollLeft),n!=n.ownerDocument);n=n.parentNode);if(e.focus(null==p1?{get preventScroll(){return p1={preventScroll:!0},!0}}:void 0),!p1){p1=!1;for(let e=0;e<t.length;){let n=t[e++],i=t[e++],r=t[e++];n.scrollTop!=i&&(n.scrollTop=i),n.scrollLeft!=r&&(n.scrollLeft=r)}}}function p5(e,t,n=t){let i=r||(r=document.createRange());return i.setEnd(e,n),i.setStart(e,t),i}function p3(e,t,n,i){let r={key:t,code:t,keyCode:n,which:n,cancelable:!0};i&&({altKey:r.altKey,ctrlKey:r.ctrlKey,shiftKey:r.shiftKey,metaKey:r.metaKey}=i);let o=new KeyboardEvent("keydown",r);o.synthetic=!0,e.dispatchEvent(o);let s=new KeyboardEvent("keyup",r);return s.synthetic=!0,e.dispatchEvent(s),o.defaultPrevented||s.defaultPrevented}function p4(e){return e instanceof Window?e.pageYOffset>Math.max(0,e.document.documentElement.scrollHeight-e.innerHeight-4):e.scrollTop>Math.max(1,e.scrollHeight-e.clientHeight-4)}function p6(e,t){for(let n=e,i=t;;)if(3==n.nodeType&&i>0)return{node:n,offset:i};else if(1==n.nodeType&&i>0){if("false"==n.contentEditable)return null;i=pX(n=n.childNodes[i-1])}else{if(!n.parentNode||pY(n))return null;i=pq(n),n=n.parentNode}}function p8(e,t){for(let n=e,i=t;;)if(3==n.nodeType&&i<n.nodeValue.length)return{node:n,offset:i};else if(1==n.nodeType&&i<n.childNodes.length){if("false"==n.contentEditable)return null;n=n.childNodes[i],i=0}else{if(!n.parentNode||pY(n))return null;i=pq(n)+1,n=n.parentNode}}pD.safari&&pD.safari_version>=26&&(p1=!1);class p9{constructor(e,t,n=!0){this.node=e,this.offset=t,this.precise=n}static before(e,t){return new p9(e.parentNode,pq(e),t)}static after(e,t){return new p9(e.parentNode,pq(e)+1,t)}}var p7=((g=p7||(p7={}))[g.LTR=0]="LTR",g[g.RTL=1]="RTL",g);let me=p7.LTR,mt=p7.RTL;function mn(e){let t=[];for(let n=0;n<e.length;n++)t.push(1<<e[n]);return t}let mi=mn("88888888888888888888888888888888888666888888787833333333337888888000000000000000000000000008888880000000000000000000000000088888888888888888888888888888888888887866668888088888663380888308888800000000000000000000000800000000000000000000000000000008"),mr=mn("4444448826627288999999999992222222222222222222222222222222222222222222222229999999999999999999994444444444644222822222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222999999949999999229989999223333333333"),mo=Object.create(null),ms=[];for(let e of["()","[]","{}"]){let t=e.charCodeAt(0),n=e.charCodeAt(1);mo[t]=n,mo[n]=-t}function ml(e){return e<=247?mi[e]:1424<=e&&e<=1524?2:1536<=e&&e<=1785?mr[e-1536]:1774<=e&&e<=2220?4:8192<=e&&e<=8204?256:64336<=e&&e<=65023?4:1}let ma=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac\ufb50-\ufdff]/;class mu{get dir(){return this.level%2?mt:me}constructor(e,t,n){this.from=e,this.to=t,this.level=n}side(e,t){return this.dir==t==e?this.to:this.from}forward(e,t){return e==(this.dir==t)}static find(e,t,n,i){let r=-1;for(let o=0;o<e.length;o++){let s=e[o];if(s.from<=t&&s.to>=t){if(s.level==n)return o;(r<0||(0!=i?i<0?s.from<t:s.to>t:e[r].level>s.level))&&(r=o)}}if(r<0)throw RangeError("Index out of range");return r}}let mc=[];function mh(e){return[new mu(0,e,0)]}let md="",mf=fp.define(),mp=fp.define(),mm=fp.define(),mg=fp.define(),mv=fp.define(),mb=fp.define(),mx=fp.define(),my=fp.define(),mw=fp.define(),mS=fp.define({combine:e=>e.some(e=>e)}),mC=fp.define({combine:e=>e.some(e=>e)}),mA=fp.define();class mk{constructor(e,t,n,i,r,o=!1){this.range=e,this.y=t,this.x=n,this.yMargin=i,this.xMargin=r,this.isSnapshot=o}map(e){return e.empty?this:new mk(this.range.map(e),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}clip(e){return this.range.to<=e.doc.length?this:new mk(fh.cursor(e.doc.length),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}}let mM=fV.define({map:(e,t)=>e.map(t)}),mT=fV.define();function mD(e,t,n){let i=e.facet(mg);i.length?i[0](t):window.onerror&&window.onerror(String(t),n,void 0,void 0,t)||(n?console.error(n+":",t):console.error(t))}let mI=fp.define({combine:e=>!e.length||e[0]}),mR=0,mE=fp.define({combine:e=>e.filter((t,n)=>{for(let i=0;i<n;i++)if(e[i].plugin==t.plugin)return!1;return!0})});class mO{constructor(e,t,n,i,r){this.id=e,this.create=t,this.domEventHandlers=n,this.domEventObservers=i,this.baseExtensions=r(this),this.extension=this.baseExtensions.concat(mE.of({plugin:this,arg:void 0}))}of(e){return this.baseExtensions.concat(mE.of({plugin:this,arg:e}))}static define(e,t){let{eventHandlers:n,eventObservers:i,provide:r,decorations:o}=t||{};return new mO(mR++,e,n,i,e=>{let t=[];return o&&t.push(mB.of(t=>{let n=t.plugin(e);return n?o(n):pj.none})),r&&t.push(r(e)),t})}static fromClass(e,t){return mO.define((t,n)=>new e(t,n),t)}}class mP{constructor(e){this.spec=e,this.mustUpdate=null,this.value=null}get plugin(){return this.spec&&this.spec.plugin}update(e){if(this.value){if(this.mustUpdate){let e=this.mustUpdate;if(this.mustUpdate=null,this.value.update)try{this.value.update(e)}catch(t){if(mD(e.state,t,"CodeMirror plugin crashed"),this.value.destroy)try{this.value.destroy()}catch(e){}this.deactivate()}}}else if(this.spec)try{this.value=this.spec.plugin.create(e,this.spec.arg)}catch(t){mD(e.state,t,"CodeMirror plugin crashed"),this.deactivate()}return this}destroy(e){var t;if(null==(t=this.value)?void 0:t.destroy)try{this.value.destroy()}catch(t){mD(e.state,t,"CodeMirror plugin crashed")}}deactivate(){this.spec=this.value=null}}let mL=fp.define(),mj=fp.define(),mB=fp.define(),mF=fp.define(),mN=fp.define(),mV=fp.define(),mH=fp.define();function mz(e,t){let n=e.state.facet(mH);if(!n.length)return n;let i=n.map(t=>t instanceof Function?t(e):t),r=[];return f0.spans(i,t.from,t.to,{point(){},span(e,n,i,o){let s=e-t.from,l=n-t.from,a=r;for(let e=i.length-1;e>=0;e--,o--){let n=i[e].spec.bidiIsolate,r;if(null==n&&(n=function(e,t,n){for(let i=t;i<n;i++){let t=ml(e.charCodeAt(i));if(1==t)break;if(2==t||4==t)return mt}return me}(t.text,s,l)),o>0&&a.length&&(r=a[a.length-1]).to==s&&r.direction==n)r.to=l,a=r.inner;else{let e={from:s,to:l,direction:n,inner:[]};a.push(e),a=e.inner}}}}),r}let mW=fp.define();function m$(e){let t=0,n=0,i=0,r=0;for(let o of e.state.facet(mW)){let s=o(e);s&&(null!=s.left&&(t=Math.max(t,s.left)),null!=s.right&&(n=Math.max(n,s.right)),null!=s.top&&(i=Math.max(i,s.top)),null!=s.bottom&&(r=Math.max(r,s.bottom)))}return{left:t,right:n,top:i,bottom:r}}let m_=fp.define();class mU{constructor(e,t,n,i){this.fromA=e,this.toA=t,this.fromB=n,this.toB=i}join(e){return new mU(Math.min(this.fromA,e.fromA),Math.max(this.toA,e.toA),Math.min(this.fromB,e.fromB),Math.max(this.toB,e.toB))}addToSet(e){let t=e.length,n=this;for(;t>0;t--){let i=e[t-1];if(!(i.fromA>n.toA)){if(i.toA<n.fromA)break;n=n.join(i),e.splice(t-1,1)}}return e.splice(t,0,n),e}static extendWithRanges(e,t){if(0==t.length)return e;let n=[];for(let i=0,r=0,o=0;;){let s=Math.min(i<e.length?e[i].fromB:1e9,r<t.length?t[r]:1e9);if(1e9==s)break;let l=s+o,a=s,u=l;for(;;)if(r<t.length&&t[r]<=a){let n=t[r+1];r+=2,a=Math.max(a,n);for(let t=i;t<e.length&&e[t].fromB<=a;t++)o=e[t].toA-e[t].toB;u=Math.max(u,n+o)}else if(i<e.length&&e[i].fromB<=a){let t=e[i++];a=Math.max(a,t.toB),u=Math.max(u,t.toA),o=t.toA-t.toB}else break;n.push(new mU(l,u,s,a))}return n}}class mG{constructor(e,t,n){for(let i of(this.view=e,this.state=t,this.transactions=n,this.flags=0,this.startState=e.state,this.changes=fi.empty(this.startState.doc.length),n))this.changes=this.changes.compose(i.changes);let i=[];this.changes.iterChangedRanges((e,t,n,r)=>i.push(new mU(e,t,n,r))),this.changedRanges=i}static create(e,t,n){return new mG(e,t,n)}get viewportChanged(){return(4&this.flags)>0}get viewportMoved(){return(8&this.flags)>0}get heightChanged(){return(2&this.flags)>0}get geometryChanged(){return this.docChanged||(18&this.flags)>0}get focusChanged(){return(1&this.flags)>0}get docChanged(){return!this.changes.empty}get selectionSet(){return this.transactions.some(e=>e.selection)}get empty(){return 0==this.flags&&0==this.transactions.length}}let mq=[];class mY{constructor(e,t,n=0){this.dom=e,this.length=t,this.flags=n,this.parent=null,e.cmTile=this}get breakAfter(){return 1&this.flags}get children(){return mq}isWidget(){return!1}get isHidden(){return!1}isComposite(){return!1}isLine(){return!1}isText(){return!1}isBlock(){return!1}get domAttrs(){return null}sync(e){if(this.flags|=2,4&this.flags){this.flags&=-5;let e=this.domAttrs;e&&function(e,t){for(let n=e.attributes.length-1;n>=0;n--){let i=e.attributes[n].name;null==t[i]&&e.removeAttribute(i)}for(let n in t){let i=t[n];"style"==n?e.style.cssText=i:e.getAttribute(n)!=i&&e.setAttribute(n,i)}}(this.dom,e)}}toString(){return this.constructor.name+(this.children.length?`(${this.children})`:"")+(this.breakAfter?"#":"")}destroy(){this.parent=null}setDOM(e){this.dom=e,e.cmTile=this}get posAtStart(){return this.parent?this.parent.posBefore(this):0}get posAtEnd(){return this.posAtStart+this.length}posBefore(e,t=this.posAtStart){let n=t;for(let t of this.children){if(t==e)return n;n+=t.length+t.breakAfter}throw RangeError("Invalid child in posBefore")}posAfter(e){return this.posBefore(e)+e.length}covers(e){return!0}coordsIn(e,t){return null}domPosFor(e,t){let n=pq(this.dom),i=this.length?e>0:t>0;return new p9(this.parent.dom,n+ +!!i,0==e||e==this.length)}markDirty(e){this.flags&=-3,e&&(this.flags|=4),this.parent&&2&this.parent.flags&&this.parent.markDirty(!1)}get overrideDOMText(){return null}get root(){for(let e=this;e;e=e.parent)if(e instanceof mZ)return e;return null}static get(e){return e.cmTile}}class mK extends mY{constructor(e){super(e,0),this._children=[]}isComposite(){return!0}get children(){return this._children}get lastChild(){return this.children.length?this.children[this.children.length-1]:null}append(e){this.children.push(e),e.parent=this}sync(e){if(2&this.flags)return;super.sync(e);let t=this.dom,n=null,i,r=(null==e?void 0:e.node)==t?e:null,o=0;for(let s of this.children){if(s.sync(e),o+=s.length+s.breakAfter,i=n?n.nextSibling:t.firstChild,r&&i!=s.dom&&(r.written=!0),s.dom.parentNode==t)for(;i&&i!=s.dom;)i=mX(i);else t.insertBefore(s.dom,i);n=s.dom}for(i=n?n.nextSibling:t.firstChild,r&&i&&(r.written=!0);i;)i=mX(i);this.length=o}}function mX(e){let t=e.nextSibling;return e.parentNode.removeChild(e),t}class mZ extends mK{constructor(e,t){super(t),this.view=e}owns(e){for(;e;e=e.parent)if(e==this)return!0;return!1}isBlock(){return!0}nearest(e){for(;;){if(!e)return null;let t=mY.get(e);if(t&&this.owns(t))return t;e=e.parentNode}}blockTiles(e){for(let t=[],n=this,i=0,r=0;;)if(i==n.children.length){if(!t.length)return;(n=n.parent).breakAfter&&r++,i=t.pop()}else{let o=n.children[i++];if(o instanceof mQ)t.push(i),n=o,i=0;else{let t=r+o.length,n=e(o,r);if(void 0!==n)return n;r=t+o.breakAfter}}}resolveBlock(e,t){let n,i=-1,r,o=-1;if(this.blockTiles((s,l)=>{let a=l+s.length;if(e>=l&&e<=a){if(s.isWidget()&&t>=-1&&t<=1){if(32&s.flags)return!0;16&s.flags&&(n=void 0)}(l<e||e==a&&(t<-1?s.length:s.covers(1)))&&(!n||!s.isWidget()&&n.isWidget())&&(n=s,i=e-l),(a>e||e==l&&(t>1?s.length:s.covers(-1)))&&(!r||!s.isWidget()&&r.isWidget())&&(r=s,o=e-l)}}),!n&&!r)throw Error("No tile at position "+e);return n&&t<0||!r?{tile:n,offset:i}:{tile:r,offset:o}}}class mQ extends mK{constructor(e,t){super(e),this.wrapper=t}isBlock(){return!0}covers(e){return!!this.children.length&&(e<0?this.children[0].covers(-1):this.lastChild.covers(1))}get domAttrs(){return this.wrapper.attributes}static of(e,t){let n=new mQ(t||document.createElement(e.tagName),e);return t||(n.flags|=4),n}}class mJ extends mK{constructor(e,t){super(e),this.attrs=t}isLine(){return!0}static start(e,t,n){let i=new mJ(t||document.createElement("div"),e);return t&&n||(i.flags|=4),i}get domAttrs(){return this.attrs}resolveInline(e,t,n){let i=null,r=-1,o=null,s=-1;!function e(l,a){for(let u=0,c=0;u<l.children.length&&c<=a;u++){let h=l.children[u],d=c+h.length;d>=a&&(h.isComposite()?e(h,a-c):(!o||o.isHidden&&(t>0||n&&function(e,t){let n=e.coordsIn(0,1),i=t.coordsIn(0,1);return n&&i&&i.top<n.bottom}(o,h)))&&(d>a||32&h.flags)?(o=h,s=a-c):(c<a||16&h.flags&&!h.isHidden)&&(i=h,r=a-c)),c=d}}(this,e);let l=(t<0?i:o)||i||o;return l?{tile:l,offset:l==i?r:s}:null}coordsIn(e,t){let n=this.resolveInline(e,t,!0);return n?n.tile.coordsIn(Math.max(0,n.offset),t):function(e){let t=e.dom.lastChild;if(!t)return e.dom.getBoundingClientRect();let n=pU(t);return n[n.length-1]||null}(this)}domIn(e,t){let n=this.resolveInline(e,t);if(n){let{tile:e,offset:i}=n;if(this.dom.contains(e.dom))return e.isText()?new p9(e.dom,Math.min(e.dom.nodeValue.length,i)):e.domPosFor(i,16&e.flags?1:32&e.flags?-1:t);let r=n.tile.parent,o=!1;for(let e of r.children){if(o)return new p9(e.dom,0);e==n.tile&&(o=!0)}}return new p9(this.dom,0)}}class m0 extends mK{constructor(e,t){super(e),this.mark=t}get domAttrs(){return this.mark.attrs}static of(e,t){let n=new m0(t||document.createElement(e.tagName),e);return t||(n.flags|=4),n}}class m1 extends mY{constructor(e,t){super(e,t.length),this.text=t}sync(e){2&this.flags||(super.sync(e),this.dom.nodeValue!=this.text&&(e&&e.node==this.dom&&(e.written=!0),this.dom.nodeValue=this.text))}isText(){return!0}toString(){return JSON.stringify(this.text)}coordsIn(e,t){let n=this.dom.nodeValue.length;e>n&&(e=n);let i=e,r=e,o=0;0==e&&t<0||e==n&&t>=0?!(pD.chrome||pD.gecko)&&(e?(i--,o=1):r<n&&(r++,o=-1)):t<0?i--:r<n&&r++;let s=p5(this.dom,i,r).getClientRects();if(!s.length)return null;let l=s[(o?o<0:t>=0)?0:s.length-1];return pD.safari&&!o&&0==l.width&&(l=Array.prototype.find.call(s,e=>e.width)||l),o?pZ(l,o<0):l||null}static of(e,t){let n=new m1(t||document.createTextNode(e),e);return t||(n.flags|=2),n}}class m2 extends mY{constructor(e,t,n,i){super(e,t,i),this.widget=n}isWidget(){return!0}get isHidden(){return this.widget.isHidden}covers(e){return!(48&this.flags)&&(this.flags&(e<0?64:128))>0}coordsIn(e,t){return this.coordsInWidget(e,t,!1)}coordsInWidget(e,t,n){let i=this.widget.coordsAt(this.dom,e,t);if(i)return i;if(n)return pZ(this.dom.getBoundingClientRect(),this.length?0==e:t<=0);{let t=this.dom.getClientRects(),n=null;if(!t.length)return null;let i=!!(16&this.flags)||!(32&this.flags)&&e>0;for(let r=i?t.length-1:0;n=t[r],e>0?0!=r:r!=t.length-1&&!(n.top<n.bottom);r+=i?-1:1);return pZ(n,!i)}}get overrideDOMText(){if(!this.length)return dZ.empty;let{root:e}=this;if(!e)return dZ.empty;let t=this.posAtStart;return e.view.state.doc.slice(t,t+this.length)}destroy(){super.destroy(),this.widget.destroy(this.dom)}static of(e,t,n,i,r){return!r&&(r=e.toDOM(t),e.editable||(r.contentEditable="false")),new m2(r,n,e,i)}}class m5 extends mY{constructor(e){let t=document.createElement("img");t.className="cm-widgetBuffer",t.setAttribute("aria-hidden","true"),super(t,0,e)}get isHidden(){return!0}get overrideDOMText(){return dZ.empty}coordsIn(e){return this.dom.getBoundingClientRect()}}class m3{constructor(e){this.index=0,this.beforeBreak=!1,this.parents=[],this.tile=e}advance(e,t,n){let{tile:i,index:r,beforeBreak:o,parents:s}=this;for(;e||t>0;)if(i.isComposite())if(o){if(!e)break;n&&n.break(),e--,o=!1}else if(r==i.children.length){if(!e&&!s.length)break;n&&n.leave(i),o=!!i.breakAfter,({tile:i,index:r}=s.pop()),r++}else{let l=i.children[r],a=l.breakAfter;(t>0?l.length<=e:l.length<e)&&(!n||!1!==n.skip(l,0,l.length)||!l.isComposite)?(o=!!a,r++,e-=l.length):(s.push({tile:i,index:r}),i=l,r=0,n&&l.isComposite()&&n.enter(l))}else if(r==i.length)o=!!i.breakAfter,({tile:i,index:r}=s.pop()),r++;else if(e){let t=Math.min(e,i.length-r);n&&n.skip(i,r,r+t),e-=t,r+=t}else break;return this.tile=i,this.index=r,this.beforeBreak=o,this}get root(){return this.parents.length?this.parents[0].tile:this.tile}}class m4{constructor(e,t,n,i){this.from=e,this.to=t,this.wrapper=n,this.rank=i}}class m6{constructor(e,t,n){this.cache=e,this.root=t,this.blockWrappers=n,this.curLine=null,this.lastBlock=null,this.afterWidget=null,this.pos=0,this.wrappers=[],this.wrapperPos=0}addText(e,t,n,i){var r;this.flushBuffer();let o=this.ensureMarks(t,n),s=o.lastChild;s&&s.isText()&&!(8&s.flags)&&s.length+e.length<512?(this.cache.reused.set(s,2),(o.children[o.children.length-1]=new m1(s.dom,s.text+e)).parent=o):o.append(i||m1.of(e,null==(r=this.cache.find(m1))?void 0:r.dom)),this.pos+=e.length,this.afterWidget=null}addComposition(e,t){let n=this.curLine;n.dom!=t.line.dom&&(n.setDOM(this.cache.reused.has(t.line)?gi(t.line.dom):t.line.dom),this.cache.reused.set(t.line,2));let i=n;for(let e=t.marks.length-1;e>=0;e--){let n=t.marks[e],r=i.lastChild;if(r instanceof m0&&r.mark.eq(n.mark))r.dom!=n.dom&&r.setDOM(gi(n.dom)),i=r;else{if(this.cache.reused.get(n)){let e=mY.get(n.dom);e&&e.setDOM(gi(n.dom))}let e=m0.of(n.mark,n.dom);i.append(e),i=e}this.cache.reused.set(n,2)}let r=mY.get(e.text);r&&this.cache.reused.set(r,2);let o=new m1(e.text,e.text.nodeValue);o.flags|=8,i.append(o)}addInlineWidget(e,t,n){let i=this.afterWidget&&48&e.flags&&(48&this.afterWidget.flags)==(48&e.flags);i||this.flushBuffer();let r=this.ensureMarks(t,n);i||16&e.flags||r.append(this.getBuffer(1)),r.append(e),this.pos+=e.length,this.afterWidget=e}addMark(e,t,n){this.flushBuffer(),this.ensureMarks(t,n).append(e),this.pos+=e.length,this.afterWidget=null}addBlockWidget(e){this.getBlockPos().append(e),this.pos+=e.length,this.lastBlock=e,this.endLine()}continueWidget(e){let t=this.afterWidget||this.lastBlock;t.length+=e,this.pos+=e}addLineStart(e,t){var n;e||(e=gn);let i=mJ.start(e,t||(null==(n=this.cache.find(mJ))?void 0:n.dom),!!t);this.getBlockPos().append(this.lastBlock=this.curLine=i)}addLine(e){this.getBlockPos().append(e),this.pos+=e.length,this.lastBlock=e,this.endLine()}addBreak(){this.lastBlock.flags|=1,this.endLine(),this.pos++}addLineStartIfNotCovered(e){this.blockPosCovered()||this.addLineStart(e)}ensureLine(e){this.curLine||this.addLineStart(e)}ensureMarks(e,t){var n;let i=this.curLine;for(let r=e.length-1;r>=0;r--){let o=e[r],s;if(t>0&&(s=i.lastChild)&&s instanceof m0&&s.mark.eq(o))i=s,t--;else{let e=m0.of(o,null==(n=this.cache.find(m0,e=>e.mark.eq(o)))?void 0:n.dom);i.append(e),i=e,t=0}}return i}endLine(){if(this.curLine){this.flushBuffer();let e=this.curLine.lastChild;(!e||!gt(this.curLine,!1)||"BR"!=e.dom.nodeName&&e.isWidget()&&!(pD.ios&>(this.curLine,!0)))&&this.curLine.append(this.cache.findWidget(go,0,32)||new m2(go.toDOM(),0,go,32)),this.curLine=this.afterWidget=null}}updateBlockWrappers(){this.wrapperPos>this.pos+1e4&&(this.blockWrappers.goto(this.pos),this.wrappers.length=0);for(let e=this.wrappers.length-1;e>=0;e--)this.wrappers[e].to<this.pos&&this.wrappers.splice(e,1);for(let e=this.blockWrappers;e.value&&e.from<=this.pos;e.next())if(e.to>=this.pos){let t=new m4(e.from,e.to,e.value,e.rank),n=this.wrappers.length;for(;n>0&&0>(this.wrappers[n-1].rank-t.rank||this.wrappers[n-1].to-t.to);)n--;this.wrappers.splice(n,0,t)}this.wrapperPos=this.pos}getBlockPos(){var e;this.updateBlockWrappers();let t=this.root;for(let n of this.wrappers){let i=t.lastChild;if(n.from<this.pos&&i instanceof mQ&&i.wrapper.eq(n.wrapper))t=i;else{let i=mQ.of(n.wrapper,null==(e=this.cache.find(mQ,e=>e.wrapper.eq(n.wrapper)))?void 0:e.dom);t.append(i),t=i}}return t}blockPosCovered(){let e=this.lastBlock;return null!=e&&!e.breakAfter&&(!e.isWidget()||(160&e.flags)>0)}getBuffer(e){let t=2|(e<0?16:32),n=this.cache.find(m5,void 0,1);return n&&(n.flags=t),n||new m5(t)}flushBuffer(){this.afterWidget&&!(32&this.afterWidget.flags)&&(this.afterWidget.parent.append(this.getBuffer(-1)),this.afterWidget=null)}}class m8{constructor(e){this.skipCount=0,this.text="",this.textOff=0,this.cursor=e.iter()}skip(e){this.textOff+e<=this.text.length?this.textOff+=e:(this.skipCount+=e-(this.text.length-this.textOff),this.text="",this.textOff=0)}next(e){if(this.textOff==this.text.length){let{value:t,lineBreak:n,done:i}=this.cursor.next(this.skipCount);if(this.skipCount=0,i)throw Error("Ran out of text content when drawing inline views");this.text=t;let r=this.textOff=Math.min(e,t.length);return n?null:t.slice(0,r)}let t=Math.min(this.text.length,this.textOff+e),n=this.text.slice(this.textOff,t);return this.textOff=t,n}}let m9=[m2,mJ,m1,m0,m5,mQ,mZ];for(let e=0;e<m9.length;e++)m9[e].bucket=e;class m7{constructor(e){this.view=e,this.buckets=m9.map(()=>[]),this.index=m9.map(()=>0),this.reused=new Map}add(e){let t=e.constructor.bucket,n=this.buckets[t];n.length<6?n.push(e):n[this.index[t]=(this.index[t]+1)%6]=e}find(e,t,n=2){let i=e.bucket,r=this.buckets[i],o=this.index[i];for(let e=r.length-1;e>=0;e--){let s=(e+o)%r.length,l=r[s];if((!t||t(l))&&!this.reused.has(l))return r.splice(s,1),s<o&&this.index[i]--,this.reused.set(l,n),l}return null}findWidget(e,t,n){let i=this.buckets[0];if(i.length)for(let r=0,o=0;;r++){if(r==i.length){if(o)return null;o=1,r=0}let s=i[r];if(!this.reused.has(s)&&(0==o?s.widget.compare(e):s.widget.constructor==e.constructor&&e.updateDOM(s.dom,this.view,s.widget))){if(i.splice(r,1),r<this.index[0]&&this.index[0]--,s.widget==e&&s.length==t&&(497&s.flags)==n)return this.reused.set(s,1),s;return this.reused.set(s,2),new m2(s.dom,t,e,-498&s.flags|n)}}}reuse(e){return this.reused.set(e,1),e}maybeReuse(e,t=2){if(!this.reused.has(e))return this.reused.set(e,t),e.dom}clear(){for(let e=0;e<this.buckets.length;e++)this.buckets[e].length=this.index[e]=0}}class ge{constructor(e,t,n,i,r){this.view=e,this.decorations=i,this.disallowBlockEffectsFor=r,this.openWidget=!1,this.openMarks=0,this.cache=new m7(e),this.text=new m8(e.state.doc),this.builder=new m6(this.cache,new mZ(e,e.contentDOM),f0.iter(n)),this.cache.reused.set(t,2),this.old=new m3(t),this.reuseWalker={skip:(e,t,n)=>{if(this.cache.add(e),e.isComposite())return!1},enter:e=>this.cache.add(e),leave:()=>{},break:()=>{}}}run(e,t){let n=t&&this.getCompositionContext(t.text);for(let i=0,r=0,o=0;;){let s=o<e.length?e[o++]:null,l=s?s.fromA:this.old.root.length;if(l>i){let e=l-i;this.preserve(e,!o,!s),i=l,r+=e}if(!s)break;t&&s.fromA<=t.range.fromA&&s.toA>=t.range.toA?(this.forward(s.fromA,t.range.fromA,t.range.fromA<t.range.toA?1:-1),this.emit(r,t.range.fromB),this.cache.clear(),this.builder.addComposition(t,n),this.text.skip(t.range.toB-t.range.fromB),this.forward(t.range.fromA,s.toA),this.emit(t.range.toB,s.toB)):(this.forward(s.fromA,s.toA),this.emit(r,s.toB)),r=s.toB,i=s.toA}return this.builder.curLine&&this.builder.endLine(),this.builder.root}preserve(e,t,n){let i=function(e){let t=[];for(let n=e.parents.length;n>1;n--){let i=n==e.parents.length?e.tile:e.parents[n].tile;i instanceof m0&&t.push(i.mark)}return t}(this.old),r=this.openMarks;this.old.advance(e,n?1:-1,{skip:(e,t,n)=>{if(e.isWidget())if(this.openWidget)this.builder.continueWidget(n-t);else{let o=n>0||t<e.length?m2.of(e.widget,this.view,n-t,496&e.flags,this.cache.maybeReuse(e)):this.cache.reuse(e);256&o.flags?(o.flags&=-2,this.builder.addBlockWidget(o)):(this.builder.ensureLine(null),this.builder.addInlineWidget(o,i,r),r=i.length)}else if(e.isText())this.builder.ensureLine(null),t||n!=e.length||this.cache.reused.has(e)?(this.cache.add(e),this.builder.addText(e.text.slice(t,n),i,r)):this.builder.addText(e.text,i,r,this.cache.reuse(e)),r=i.length;else if(e.isLine())e.flags&=-2,this.cache.reused.set(e,1),this.builder.addLine(e);else if(e instanceof m5)this.cache.add(e);else{if(!(e instanceof m0))return!1;this.builder.ensureLine(null),this.builder.addMark(e,i,r),this.cache.reused.set(e,1),r=i.length}this.openWidget=!1},enter:e=>{e.isLine()?this.builder.addLineStart(e.attrs,this.cache.maybeReuse(e)):(this.cache.add(e),e instanceof m0&&i.unshift(e.mark)),this.openWidget=!1},leave:e=>{e.isLine()?i.length&&(i.length=r=0):e instanceof m0&&(i.shift(),r=Math.min(r,i.length))},break:()=>{this.builder.addBreak(),this.openWidget=!1}}),this.text.skip(e)}emit(e,t){let n=null,i=this.builder,r=0,o=f0.spans(this.decorations,e,t,{point:(e,t,o,s,l,a)=>{var u,c,h;if(o instanceof pN){if(this.disallowBlockEffectsFor[a]){if(o.block)throw RangeError("Block decorations may not be specified via plugins");if(t>this.view.state.doc.lineAt(e).to)throw RangeError("Decorations that replace line breaks may not be specified via plugins")}if(r=s.length,l>s.length)i.continueWidget(t-e);else{let r,a=o.widget||(o.block?gr.block:gr.inline),c=(r=(u=o).isReplace?64*(u.startSide<0)|128*(u.endSide>0):u.startSide>0?32:16,u.block&&(r|=256),r),h=this.cache.findWidget(a,t-e,c)||m2.of(a,this.view,t-e,c);o.block?(o.startSide>0&&i.addLineStartIfNotCovered(n),i.addBlockWidget(h)):(i.ensureLine(n),i.addInlineWidget(h,s,l))}n=null}else{let e,t;c=n,e=(h=o).spec.attributes,t=h.spec.class,(e||t)&&(c||(c={class:"cm-line"}),e&&pI(e,c),t&&(c.class+=" "+t)),n=c}t>e&&this.text.skip(t-e)},span:(e,t,r,o)=>{for(let s=e;s<t;){let l=this.text.next(Math.min(512,t-s));null==l?(i.addLineStartIfNotCovered(n),i.addBreak(),s++):(i.ensureLine(n),i.addText(l,r,s==e?o:r.length),s+=l.length),n=null}}});i.addLineStartIfNotCovered(n),this.openWidget=o>r,this.openMarks=o}forward(e,t,n=1){t-e<=10?this.old.advance(t-e,n,this.reuseWalker):(this.old.advance(5,-1,this.reuseWalker),this.old.advance(t-e-10,-1),this.old.advance(5,n,this.reuseWalker))}getCompositionContext(e){let t=[],n=null;for(let i=e.parentNode;;i=i.parentNode){let e=mY.get(i);if(i==this.view.contentDOM)break;e instanceof m0?t.push(e):(null==e?void 0:e.isLine())?n=e:e instanceof mQ||("DIV"!=i.nodeName||n||i==this.view.contentDOM?n||t.push(m0.of(new pB({tagName:i.nodeName.toLowerCase(),attributes:function(e){let t=Object.create(null);for(let n=0;n<e.attributes.length;n++){let i=e.attributes[n];t[i.name]=i.value}return t}(i)}),i)):n=new mJ(i,gn))}return{line:n,marks:t}}}function gt(e,t){let n=e=>{for(let i of e.children)if((t?i.isText():i.length)||n(i))return!0;return!1};return n(e)}let gn={class:"cm-line"};function gi(e){let t=mY.get(e);return t&&t.setDOM(e.cloneNode()),e}class gr extends pP{constructor(e){super(),this.tag=e}eq(e){return e.tag==this.tag}toDOM(){return document.createElement(this.tag)}updateDOM(e){return e.nodeName.toLowerCase()==this.tag}get isHidden(){return!0}}gr.inline=new gr("span"),gr.block=new gr("div");let go=new class extends pP{toDOM(){return document.createElement("br")}get isHidden(){return!0}get editable(){return!0}};class gs{constructor(e){this.view=e,this.decorations=[],this.blockWrappers=[],this.dynamicDecorationMap=[!1],this.domChanged=null,this.hasComposition=null,this.editContextFormatting=pj.none,this.lastCompositionAfterCursor=!1,this.minWidth=0,this.minWidthFrom=0,this.minWidthTo=0,this.impreciseAnchor=null,this.impreciseHead=null,this.forceSelection=!1,this.lastUpdate=Date.now(),this.updateDeco(),this.tile=new mZ(e,e.contentDOM),this.updateInner([new mU(0,0,0,e.state.doc.length)],null)}update(e){var t,n,i,r,o,s,l,a,u;let c,h,d,f=e.changedRanges;this.minWidth>0&&f.length&&(f.every(({fromA:e,toA:t})=>t<this.minWidthFrom||e>this.minWidthTo)?(this.minWidthFrom=e.changes.mapPos(this.minWidthFrom,1),this.minWidthTo=e.changes.mapPos(this.minWidthTo,1)):this.minWidth=this.minWidthFrom=this.minWidthTo=0),this.updateEditContextFormatting(e);let p=-1;this.view.inputState.composing>=0&&!this.view.observer.editContext&&((null==(t=this.domChanged)?void 0:t.newSel)?p=this.domChanged.newSel.head:(n=e.changes,i=this.hasComposition,c=!1,i&&n.iterChangedRanges((e,t)=>{e<i.to&&t>i.from&&(c=!0)}),c||e.selectionSet||(p=e.state.selection.main.head)));let m=p>-1?function(e,t,n){let i=ga(e,n);if(!i)return null;let{node:r,from:o,to:s}=i,l=r.nodeValue;if(/[\n\r]/.test(l)||e.state.doc.sliceString(i.from,i.to)!=l)return null;let a=t.invertedDesc;return{range:new mU(a.mapPos(o),a.mapPos(s),o,s),text:r}}(this.view,e.changes,p):null;if(this.domChanged=null,this.hasComposition){let{from:t,to:n}=this.hasComposition;f=new mU(t,n,e.changes.mapPos(t,-1),e.changes.mapPos(n,1)).addToSet(f.slice())}this.hasComposition=m?{from:m.range.fromB,to:m.range.toB}:null,(pD.ie||pD.chrome)&&!m&&e&&e.state.doc.lines!=e.startState.doc.lines&&(this.forceSelection=!0);let g=this.decorations,v=this.blockWrappers;this.updateDeco();let b=(r=g,o=this.decorations,s=e.changes,h=new gu,f0.compare(r,o,s,h),h.changes);b.length&&(f=mU.extendWithRanges(f,b));let x=(l=v,a=this.blockWrappers,u=e.changes,d=new gc,f0.compare(l,a,u,d),d.changes);return x.length&&(f=mU.extendWithRanges(f,x)),m&&!f.some(e=>e.fromA<=m.range.fromA&&e.toA>=m.range.toA)&&(f=m.range.addToSet(f.slice())),(!(2&this.tile.flags)||0!=f.length)&&(this.updateInner(f,m),e.transactions.length&&(this.lastUpdate=Date.now()),!0)}updateInner(e,t){this.view.viewState.mustMeasureContent=!0;let{observer:n}=this.view;n.ignore(()=>{if(t||e.length){let n=this.tile,i=new ge(this.view,n,this.blockWrappers,this.decorations,this.dynamicDecorationMap);t&&mY.get(t.text)&&i.cache.reused.set(mY.get(t.text),2),this.tile=i.run(e,t),gl(n,i.cache.reused)}this.tile.dom.style.height=this.view.viewState.contentHeight/this.view.scaleY+"px",this.tile.dom.style.flexBasis=this.minWidth?this.minWidth+"px":"";let i=pD.chrome||pD.ios?{node:n.selectionRange.focusNode,written:!1}:void 0;this.tile.sync(i),i&&(i.written||n.selectionRange.focusNode!=i.node||!this.tile.dom.contains(i.node))&&(this.forceSelection=!0),this.tile.dom.style.height=""});let i=[];if(this.view.viewport.from||this.view.viewport.to<this.view.state.doc.length)for(let e of this.tile.children)e.isWidget()&&e.widget instanceof gh&&i.push(e.dom);n.updateGaps(i)}updateEditContextFormatting(e){for(let t of(this.editContextFormatting=this.editContextFormatting.map(e.changes),e.transactions))for(let e of t.effects)e.is(mT)&&(this.editContextFormatting=e.value)}updateSelection(e=!1,t=!1){var n;(e||!this.view.observer.selectionRange.focusNode)&&this.view.observer.readSelectionRange();let{dom:i}=this.tile,r=this.view.root.activeElement,o=r==i,s=!o&&!(this.view.state.facet(mI)||i.tabIndex>-1)&&p_(i,this.view.observer.selectionRange)&&!(r&&i.contains(r));if(!(o||t||s))return;let l=this.forceSelection;this.forceSelection=!1;let a=this.view.state.selection.main,u,c;if(a.empty?c=u=this.inlineDOMNearPos(a.anchor,a.assoc||1):(c=this.inlineDOMNearPos(a.head,a.head==a.from?1:-1),u=this.inlineDOMNearPos(a.anchor,a.anchor==a.from?1:-1)),pD.gecko&&a.empty&&!this.hasComposition&&1==(n=u).node.nodeType&&n.node.firstChild&&(0==n.offset||"false"==n.node.childNodes[n.offset-1].contentEditable)&&(n.offset==n.node.childNodes.length||"false"==n.node.childNodes[n.offset].contentEditable)){let e=document.createTextNode("");this.view.observer.ignore(()=>u.node.insertBefore(e,u.node.childNodes[u.offset]||null)),u=c=new p9(e,0),l=!0}let h=this.view.observer.selectionRange;!l&&h.focusNode&&(pG(u.node,u.offset,h.anchorNode,h.anchorOffset)&&pG(c.node,c.offset,h.focusNode,h.focusOffset)||this.suppressWidgetCursorChange(h,a))||(this.view.observer.ignore(()=>{pD.android&&pD.chrome&&i.contains(h.focusNode)&&function(e,t){for(let n=e;n&&n!=t;n=n.assignedSlot||n.parentNode)if(1==n.nodeType&&"false"==n.contentEditable)return!0;return!1}(h.focusNode,i)&&(i.blur(),i.focus({preventScroll:!0}));let e=pW(this.view.root);if(e)if(a.empty){if(pD.gecko){var t,n;let e=(t=u.node,n=u.offset,1!=t.nodeType?0:(n&&"false"==t.childNodes[n-1].contentEditable?1:0)|2*(n<t.childNodes.length&&"false"==t.childNodes[n].contentEditable));if(e&&3!=e){let t=(1==e?p6:p8)(u.node,u.offset);t&&(u=new p9(t.node,t.offset))}}e.collapse(u.node,u.offset),null!=a.bidiLevel&&void 0!==e.caretBidiLevel&&(e.caretBidiLevel=a.bidiLevel)}else if(e.extend){e.collapse(u.node,u.offset);try{e.extend(c.node,c.offset)}catch(e){}}else{let t=document.createRange();a.anchor>a.head&&([u,c]=[c,u]),t.setEnd(c.node,c.offset),t.setStart(u.node,u.offset),e.removeAllRanges(),e.addRange(t)}s&&this.view.root.activeElement==i&&(i.blur(),r&&r.focus())}),this.view.observer.setSelectionRange(u,c)),this.impreciseAnchor=u.precise?null:new p9(h.anchorNode,h.anchorOffset),this.impreciseHead=c.precise?null:new p9(h.focusNode,h.focusOffset)}suppressWidgetCursorChange(e,t){return this.hasComposition&&t.empty&&pG(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset)&&this.posFromDOM(e.focusNode,e.focusOffset)==t.head}enforceCursorAssoc(){if(this.hasComposition)return;let{view:e}=this,t=e.state.selection.main,n=pW(e.root),{anchorNode:i,anchorOffset:r}=e.observer.selectionRange;if(!n||!t.empty||!t.assoc||!n.modify)return;let o=this.lineAt(t.head,t.assoc);if(!o)return;let s=o.posAtStart;if(t.head==s||t.head==s+o.length)return;let l=this.coordsAt(t.head,-1),a=this.coordsAt(t.head,1);if(!l||!a||l.bottom>a.top)return;let u=this.domAtPos(t.head+t.assoc,t.assoc);n.collapse(u.node,u.offset),n.modify("move",t.assoc<0?"forward":"backward","lineboundary"),e.observer.readSelectionRange();let c=e.observer.selectionRange;e.docView.posFromDOM(c.anchorNode,c.anchorOffset)!=t.from&&n.collapse(i,r)}posFromDOM(e,t){let n=this.tile.nearest(e);if(!n)return 2&this.tile.dom.compareDocumentPosition(e)?0:this.view.state.doc.length;let i=n.posAtStart;if(n.isComposite()){let r;if(e==n.dom)r=n.dom.childNodes[t];else{let i=0==pX(e)?0:0==t?-1:1;for(;;){let t=e.parentNode;if(t==n.dom)break;0==i&&t.firstChild!=t.lastChild&&(i=e==t.firstChild?-1:1),e=t}r=i<0?e:e.nextSibling}if(r==n.dom.firstChild)return i;for(;r&&!mY.get(r);)r=r.nextSibling;if(!r)return i+n.length;for(let e=0,t=i;;e++){let i=n.children[e];if(i.dom==r)return t;t+=i.length+i.breakAfter}}else if(n.isText())return e==n.dom?i+t:i+(t?n.length:0);else return i}domAtPos(e,t){let{tile:n,offset:i}=this.tile.resolveBlock(e,t);return n.isWidget()?n.domPosFor(e,t):n.domIn(i,t)}inlineDOMNearPos(e,t){let n,i=-1,r=!1,o,s=-1,l=!1;return(this.tile.blockTiles((t,a)=>{if(t.isWidget()){if(32&t.flags&&a>=e)return!0;16&t.flags&&(r=!0)}else{let u=a+t.length;if(a<=e&&(n=t,i=e-a,r=u<e),u>=e&&!o&&(o=t,s=e-a,l=a>e),a>e&&o)return!0}}),n||o)?(r&&o?n=null:l&&n&&(o=null),n&&t<0||!o?n.domIn(i,t):o.domIn(s,t)):this.domAtPos(e,t)}coordsAt(e,t){let{tile:n,offset:i}=this.tile.resolveBlock(e,t);return n.isWidget()?n.widget instanceof gh?null:n.coordsInWidget(i,t,!0):n.coordsIn(i,t)}lineAt(e,t){let{tile:n}=this.tile.resolveBlock(e,t);return n.isLine()?n:null}coordsForChar(e){let{tile:t,offset:n}=this.tile.resolveBlock(e,1);return t.isLine()?function e(t,n){if(t.isComposite())for(let i of t.children){if(i.length>=n){let t=e(i,n);if(t)return t}if((n-=i.length)<0)break}else if(t.isText()&&n<t.length){let e=d6(t.text,n);if(e==n)return null;let i=p5(t.dom,n,e).getClientRects();for(let e=0;e<i.length;e++){let t=i[e];if(e==i.length-1||t.top<t.bottom&&t.left<t.right)return t}}return null}(t,n):null}measureVisibleLineHeights(e){let t=[],{from:n,to:i}=e,r=this.view.contentDOM.clientWidth,o=r>Math.max(this.view.scrollDOM.clientWidth,this.minWidth)+1,s=-1,l=this.view.textDirection==p7.LTR,a=0,u=(e,c,h)=>{for(let d=0;d<e.children.length&&!(c>i);d++){let i=e.children[d],f=c+i.length,p=i.dom.getBoundingClientRect(),{height:m}=p;if(h&&!d&&(a+=p.top-h.top),i instanceof mQ)f>n&&u(i,c,p);else if(c>=n&&(a>0&&t.push(-a),t.push(m+a),a=0,o)){let e=i.dom.lastChild,t=e?pU(e):[];if(t.length){let e=t[t.length-1],n=l?e.right-p.left:p.right-e.left;n>s&&(s=n,this.minWidth=r,this.minWidthFrom=c,this.minWidthTo=f)}}h&&d==e.children.length-1&&(a+=h.bottom-p.bottom),c=f+i.breakAfter}};return u(this.tile,0,null),t}textDirectionAt(e){let{tile:t}=this.tile.resolveBlock(e,1);return"rtl"==getComputedStyle(t.dom).direction?p7.RTL:p7.LTR}measureTextSize(){let e=this.tile.blockTiles(e=>{if(e.isLine()&&e.children.length&&e.length<=20){let t=0,n;for(let i of e.children){if(!i.isText()||/[^ -~]/.test(i.text))return;let e=pU(i.dom);if(1!=e.length)return;t+=e[0].width,n=e[0].height}if(t)return{lineHeight:e.dom.getBoundingClientRect().height,charWidth:t/e.length,textHeight:n}}});if(e)return e;let t=document.createElement("div"),n,i,r;return t.className="cm-line",t.style.width="99999px",t.style.position="absolute",t.textContent="abc def ghi jkl mno pqr stu",this.view.observer.ignore(()=>{this.tile.dom.appendChild(t);let e=pU(t.firstChild)[0];n=t.getBoundingClientRect().height,i=e&&e.width?e.width/27:7,r=e&&e.height?e.height:n,t.remove()}),{lineHeight:n,charWidth:i,textHeight:r}}computeBlockGapDeco(){let e=[],t=this.view.viewState;for(let n=0,i=0;;i++){let r=i==t.viewports.length?null:t.viewports[i],o=r?r.from-1:this.view.state.doc.length;if(o>n){let i=(t.lineBlockAt(o).bottom-t.lineBlockAt(n).top)/this.view.scaleY;e.push(pj.replace({widget:new gh(i),block:!0,inclusive:!0,isBlockGap:!0}).range(n,o))}if(!r)break;n=r.to+1}return pj.set(e)}updateDeco(){let e=1,t=this.view.state.facet(mB).map(t=>(this.dynamicDecorationMap[e++]="function"==typeof t)?t(this.view):t),n=!1,i=this.view.state.facet(mN).map((e,t)=>{let i="function"==typeof e;return i&&(n=!0),i?e(this.view):e});for(i.length&&(this.dynamicDecorationMap[e++]=n,t.push(f0.join(i))),this.decorations=[this.editContextFormatting,...t,this.computeBlockGapDeco(),this.view.viewState.lineGapDeco];e<this.decorations.length;)this.dynamicDecorationMap[e++]=!1;this.blockWrappers=this.view.state.facet(mF).map(e=>"function"==typeof e?e(this.view):e)}scrollIntoView(e){var t;if(e.isSnapshot){let t=this.view.viewState.lineBlockAt(e.range.head);this.view.scrollDOM.scrollTop=t.top-e.yMargin,this.view.scrollDOM.scrollLeft=e.xMargin;return}for(let t of this.view.state.facet(mA))try{if(t(this.view,e.range,e))return!0}catch(e){mD(this.view.state,e,"scroll handler")}let{range:n}=e,i=this.coordsAt(n.head,null!=(t=n.assoc)?t:n.empty?0:n.head>n.anchor?-1:1),r;if(!i)return;!n.empty&&(r=this.coordsAt(n.anchor,n.anchor>n.head?-1:1))&&(i={left:Math.min(i.left,r.left),top:Math.min(i.top,r.top),right:Math.max(i.right,r.right),bottom:Math.max(i.bottom,r.bottom)});let o=m$(this.view),s={left:i.left-o.left,top:i.top-o.top,right:i.right+o.right,bottom:i.bottom+o.bottom},{offsetWidth:l,offsetHeight:a}=this.view.scrollDOM;if(!function(e,t,n,i,r,o,s,l){let a=e.ownerDocument,u=a.defaultView||window;for(let c=e,h=!1;c&&!h;)if(1==c.nodeType){let e,d=c==a.body,f=1,p=1;if(d)e=function(e){let t=e.visualViewport;return t?{left:0,right:t.width,top:0,bottom:t.height}:{left:0,right:e.innerWidth,top:0,bottom:e.innerHeight}}(u);else{if(/^(fixed|sticky)$/.test(getComputedStyle(c).position)&&(h=!0),c.scrollHeight<=c.clientHeight&&c.scrollWidth<=c.clientWidth){c=c.assignedSlot||c.parentNode;continue}let t=c.getBoundingClientRect();({scaleX:f,scaleY:p}=pQ(c,t)),e={left:t.left,right:t.left+c.clientWidth*f,top:t.top,bottom:t.top+c.clientHeight*p}}let m=0,g=0;if("nearest"==r)t.top<e.top+s?(g=t.top-(e.top+s),n>0&&t.bottom>e.bottom+g&&(g=t.bottom-e.bottom+s)):t.bottom>e.bottom-s&&(g=t.bottom-e.bottom+s,n<0&&t.top-g<e.top&&(g=t.top-(e.top+s)));else{let i=t.bottom-t.top,o=e.bottom-e.top;g=("center"==r&&i<=o?t.top+i/2-o/2:"start"==r||"center"==r&&n<0?t.top-s:t.bottom-o+s)-e.top}if("nearest"==i?t.left<e.left+o?(m=t.left-(e.left+o),n>0&&t.right>e.right+m&&(m=t.right-e.right+o)):t.right>e.right-o&&(m=t.right-e.right+o,n<0&&t.left<e.left+m&&(m=t.left-(e.left+o))):m=("center"==i?t.left+(t.right-t.left)/2-(e.right-e.left)/2:"start"==i==l?t.left-o:t.right-(e.right-e.left)+o)-e.left,m||g)if(d)u.scrollBy(m,g);else{let e=0,n=0;if(g){let e=c.scrollTop;c.scrollTop+=g/p,n=(c.scrollTop-e)*p}if(m){let t=c.scrollLeft;c.scrollLeft+=m/f,e=(c.scrollLeft-t)*f}t={left:t.left-e,top:t.top-n,right:t.right-e,bottom:t.bottom-n},e&&1>Math.abs(e-m)&&(i="nearest"),n&&1>Math.abs(n-g)&&(r="nearest")}if(d)break;(t.top<e.top||t.bottom>e.bottom||t.left<e.left||t.right>e.right)&&(t={left:Math.max(t.left,e.left),right:Math.min(t.right,e.right),top:Math.max(t.top,e.top),bottom:Math.min(t.bottom,e.bottom)}),c=c.assignedSlot||c.parentNode}else if(11==c.nodeType)c=c.host;else break}(this.view.scrollDOM,s,n.head<n.anchor?-1:1,e.x,e.y,Math.max(Math.min(e.xMargin,l),-l),Math.max(Math.min(e.yMargin,a),-a),this.view.textDirection==p7.LTR),window.visualViewport&&window.innerHeight-window.visualViewport.height>1&&(i.top>window.pageYOffset+window.visualViewport.offsetTop+window.visualViewport.height||i.bottom<window.pageYOffset+window.visualViewport.offsetTop)){let e=this.view.docView.lineAt(n.head,1);e&&e.dom.scrollIntoView({block:"nearest"})}}lineHasWidget(e){let t=e=>e.isWidget()||e.children.some(t);return t(this.tile.resolveBlock(e,1).tile)}destroy(){gl(this.tile)}}function gl(e,t){let n=null==t?void 0:t.get(e);if(1!=n)for(let i of(null==n&&e.destroy(),e.children))gl(i,t)}function ga(e,t){let n=e.observer.selectionRange;if(!n.focusNode)return null;let i=p6(n.focusNode,n.focusOffset),r=p8(n.focusNode,n.focusOffset),o=i||r;if(r&&i&&r.node!=i.node){let t=mY.get(r.node);if(!t||t.isText()&&t.text!=r.node.nodeValue)o=r;else if(e.docView.lastCompositionAfterCursor){let e=mY.get(i.node);!e||e.isText()&&e.text!=i.node.nodeValue||(o=r)}}if(e.docView.lastCompositionAfterCursor=o!=i,!o)return null;let s=t-o.offset;return{from:s,to:s+o.node.nodeValue.length,node:o.node}}let gu=class{constructor(){this.changes=[]}compareRange(e,t){pH(e,t,this.changes)}comparePoint(e,t){pH(e,t,this.changes)}boundChange(e){pH(e,e,this.changes)}};class gc{constructor(){this.changes=[]}compareRange(e,t){pH(e,t,this.changes)}comparePoint(){}boundChange(e){pH(e,e,this.changes)}}class gh extends pP{constructor(e){super(),this.height=e}toDOM(){let e=document.createElement("div");return e.className="cm-gap",this.updateDOM(e),e}eq(e){return e.height==this.height}updateDOM(e){return e.style.height=this.height+"px",!0}get editable(){return!0}get estimatedHeight(){return this.height}ignoreEvent(){return!1}}function gd(e,t,n){let i=e.lineBlockAt(t);if(Array.isArray(i.type)){let e;for(let r of i.type){if(r.from>t)break;if(!(r.to<t)){if(r.from<t&&r.to>t)return r;(!e||r.type==pL.Text&&(e.type!=r.type||(n<0?r.from<t:r.to>t)))&&(e=r)}}return e||i}return i}function gf(e,t,n,i){let r=e.state.doc.lineAt(t.head),o=e.bidiSpans(r),s=e.textDirectionAt(r.from);for(let l=t,a=null;;){let t=function(e,t,n,i,r){var o;let s=i.head-e.from,l=mu.find(t,s,null!=(o=i.bidiLevel)?o:-1,i.assoc),a=t[l],u=a.side(r,n);if(s==u){let e=l+=r?1:-1;if(e<0||e>=t.length)return null;s=(a=t[l=e]).side(!r,n),u=a.side(r,n)}let c=d6(e.text,s,a.forward(r,n));(c<a.from||c>a.to)&&(c=u),md=e.text.slice(Math.min(s,c),Math.max(s,c));let h=l==(r?t.length-1:0)?null:t[l+(r?1:-1)];return h&&c==u&&h.level+ +!r<a.level?fh.cursor(h.side(!r,n)+e.from,h.forward(r,n)?1:-1,h.level):fh.cursor(c+e.from,a.forward(r,n)?-1:1,a.level)}(r,o,s,l,n),u=md;if(!t){if(r.number==(n?e.state.doc.lines:1))return l;u="\n",r=e.state.doc.line(r.number+(n?1:-1)),o=e.bidiSpans(r),t=e.visualLineSide(r,!n)}if(a){if(!a(u))return l}else{if(!i)return t;a=i(u)}l=t}}function gp(e,t,n){for(;;){let i=0;for(let r of e)r.between(t-1,t+1,(e,r,o)=>{if(t>e&&t<r){let o=i||n||(t-e<r-t?-1:1);t=o<0?e:r,i=o}});if(!i)return t}}function gm(e,t){let n=null;for(let i=0;i<t.ranges.length;i++){let r=t.ranges[i],o=null;if(r.empty){let t=gp(e,r.from,0);t!=r.from&&(o=fh.cursor(t,-1))}else{let t=gp(e,r.from,-1),n=gp(e,r.to,1);(t!=r.from||n!=r.to)&&(o=fh.range(r.from==r.anchor?t:n,r.from==r.head?t:n))}o&&(n||(n=t.ranges.slice()),n[i]=o)}return n?fh.create(n,t.mainIndex):t}function gg(e,t,n){let i=gp(e.state.facet(mV).map(t=>t(e)),n.from,t.head>n.from?-1:1);return i==n.from?n:fh.cursor(i,i<n.from?1:-1)}class gv{constructor(e,t){this.pos=e,this.assoc=t}}function gb(e,t,n,i){let r=e.contentDOM.getBoundingClientRect(),o=r.top+e.viewState.paddingTop,{x:s,y:l}=t,a=l-o,u;for(;;){if(a<0)return new gv(0,1);if(a>e.viewState.docHeight)return new gv(e.state.doc.length,-1);if(u=e.elementAtHeight(a),null==i)break;if(u.type==pL.Text){if(i<0?u.to<e.viewport.from:u.from>e.viewport.to)break;let t=e.docView.coordsAt(i<0?u.from:u.to,i>0?-1:1);if(t&&(i<0?t.top<=a+o:t.bottom>=a+o))break}let t=e.viewState.heightOracle.textHeight/2;a=i>0?u.bottom+t:u.top-t}if(e.viewport.from>=u.to||e.viewport.to<=u.from){if(n)return null;if(u.type==pL.Text){let t=function(e,t,n,i,r){let o=Math.round((i-t.left)*e.defaultCharacterWidth);if(e.lineWrapping&&n.height>1.5*e.defaultLineHeight){let t=e.viewState.heightOracle.textHeight;o+=Math.floor((r-n.top-(e.defaultLineHeight-t)*.5)/t)*e.viewState.heightOracle.lineLength}let s=e.state.sliceDoc(n.from,n.to);return n.from+pi(s,o,e.state.tabSize)}(e,r,u,s,l);return new gv(t,t==u.from?1:-1)}}if(u.type!=pL.Text)return a<(u.top+u.bottom)/2?new gv(u.from,1):new gv(u.to,-1);let c=e.docView.lineAt(u.from,2);return c&&c.length==u.length||(c=e.docView.lineAt(u.from,-2)),new gx(e,s,l,e.textDirectionAt(u.from)).scanTile(c,u.from)}class gx{constructor(e,t,n,i){this.view=e,this.x=t,this.y=n,this.baseDir=i,this.line=null,this.spans=null}bidiSpansAt(e){return(!this.line||this.line.from>e||this.line.to<e)&&(this.line=this.view.state.doc.lineAt(e),this.spans=this.view.bidiSpans(this.line)),this}baseDirAt(e,t){let{line:n,spans:i}=this.bidiSpansAt(e);return i[mu.find(i,e-n.from,-1,t)].level==this.baseDir}dirAt(e,t){let{line:n,spans:i}=this.bidiSpansAt(e);return i[mu.find(i,e-n.from,-1,t)].dir}bidiIn(e,t){let{spans:n,line:i}=this.bidiSpansAt(e);return n.length>1||n.length&&(n[0].level!=this.baseDir||n[0].to+i.from<t)}scan(e,t,n=!1){let i,r,o=0,s=e.length-1,l=new Set,a=this.bidiIn(e[0],e[s]),u=-1,c=1e9,h;for(;o<s;){let n=s-o,d=o+s>>1;t:if(l.has(d)){let e=o+Math.floor(Math.random()*n);for(let t=0;t<n;t++){if(!l.has(e)){d=e;break t}++e==s&&(e=o)}break}l.add(d);let f=t(d);if(f)for(let t=0;t<f.length;t++){let n=f[t],l=0;if(0!=n.width||!(f.length>1)){if(n.bottom<this.y)(!i||i.bottom<n.bottom)&&(i=n),l=1;else if(n.top>this.y)(!r||r.top>n.top)&&(r=n),l=-1;else{let e=n.left>this.x?this.x-n.left:n.right<this.x?this.x-n.right:0,t=Math.abs(e);t<c&&(u=d,c=t,h=n),e&&(l=e<0==(this.baseDir==p7.LTR)?-1:1)}-1==l&&(!a||this.baseDirAt(e[d],1))?s=d:1==l&&(!a||this.baseDirAt(e[d+1],-1))&&(o=d+1)}}}if(!h){let n=i&&(!r||this.y-i.bottom<r.top-this.y)?i:r;return this.y=(n.top+n.bottom)/2,this.scan(e,t,!0)}if(c&&!n){let{top:n,bottom:o}=h;if(i&&i.bottom>(n+n+o)/3)return this.y=i.bottom-1,this.scan(e,t,!0);if(r&&r.top<(n+o+o)/3)return this.y=r.top+1,this.scan(e,t,!0)}let d=(a?this.dirAt(e[u],1):this.baseDir)==p7.LTR;return{i:u,after:this.x>(h.left+h.right)/2==d}}scanText(e,t){let n=[];for(let i=0;i<e.length;i=d6(e.text,i))n.push(t+i);n.push(t+e.length);let i=this.scan(n,i=>{let r=n[i]-t,o=n[i+1]-t;return p5(e.dom,r,o).getClientRects()});return i.after?new gv(n[i.i+1],-1):new gv(n[i.i],1)}scanTile(e,t){if(!e.length)return new gv(t,1);if(1==e.children.length){let n=e.children[0];if(n.isText())return this.scanText(n,t);if(n.isComposite())return this.scanTile(n,t)}let n=[t];for(let i=0,r=t;i<e.children.length;i++)n.push(r+=e.children[i].length);let i=this.scan(n,t=>{let n=e.children[t];return 48&n.flags?null:(1==n.dom.nodeType?n.dom:p5(n.dom,0,n.length)).getClientRects()}),r=e.children[i.i],o=n[i.i];return r.isText()?this.scanText(r,o):r.isComposite()?this.scanTile(r,o):i.after?new gv(n[i.i+1],-1):new gv(o,1)}}class gy{constructor(e,t){this.points=e,this.view=t,this.text="",this.lineSeparator=t.state.facet(fq.lineSeparator)}append(e){this.text+=e}lineBreak(){this.text+=""}readRange(e,t){if(!e)return this;let n=e.parentNode;for(let i=e;;){this.findPointBefore(n,i);let e=this.text.length;this.readNode(i);let r=mY.get(i),o=i.nextSibling;if(o==t){(null==r?void 0:r.breakAfter)&&!o&&n!=this.view.contentDOM&&this.lineBreak();break}let s=mY.get(o);(r&&s?r.breakAfter:(r?r.breakAfter:pY(i))||pY(o)&&("BR"!=i.nodeName||(null==r?void 0:r.isWidget()))&&this.text.length>e)&&!function(e,t){let n;for(;e!=t&&e;e=e.nextSibling){let t=mY.get(e);if(!(null==t?void 0:t.isWidget()))return!1;t&&(n||(n=[])).push(t)}if(n)for(let e of n){let t=e.overrideDOMText;if(null==t?void 0:t.length)return!1}return!0}(o,t)&&this.lineBreak(),i=o}return this.findPointBefore(n,t),this}readTextNode(e){let t=e.nodeValue;for(let n of this.points)n.node==e&&(n.pos=this.text.length+Math.min(n.offset,t.length));for(let n=0,i=this.lineSeparator?null:/\r\n?|\n/g;;){let r=-1,o=1,s;if(this.lineSeparator?(r=t.indexOf(this.lineSeparator,n),o=this.lineSeparator.length):(s=i.exec(t))&&(r=s.index,o=s[0].length),this.append(t.slice(n,r<0?t.length:r)),r<0)break;if(this.lineBreak(),o>1)for(let t of this.points)t.node==e&&t.pos>this.text.length&&(t.pos-=o-1);n=r+o}}readNode(e){let t=mY.get(e),n=t&&t.overrideDOMText;if(null!=n){this.findPointInside(e,n.length);for(let e=n.iter();!e.next().done;)e.lineBreak?this.lineBreak():this.append(e.value)}else 3==e.nodeType?this.readTextNode(e):"BR"==e.nodeName?e.nextSibling&&this.lineBreak():1==e.nodeType&&this.readRange(e.firstChild,null)}findPointBefore(e,t){for(let n of this.points)n.node==e&&e.childNodes[n.offset]==t&&(n.pos=this.text.length)}findPointInside(e,t){for(let n of this.points)(3==e.nodeType?n.node==e:e.contains(n.node))&&(n.pos=this.text.length+(!function(e,t,n){for(;;){if(!t||n<pX(t))return!1;if(t==e)return!0;n=pq(t)+1,t=t.parentNode}}(e,n.node,n.offset)?0:t))}}class gw{constructor(e,t){this.node=e,this.offset=t,this.pos=-1}}class gS{constructor(e,t,n,i){this.typeOver=i,this.bounds=null,this.text="",this.domChanged=t>-1;let{impreciseHead:r,impreciseAnchor:o}=e.docView,s=e.state.selection;if(e.state.readOnly&&t>-1)this.newSel=null;else if(t>-1&&(this.bounds=function e(t,n,i,r){if(t.isComposite()){let o=-1,s=-1,l=-1,a=-1;for(let u=0,c=r,h=r;u<t.children.length;u++){let r=t.children[u],d=c+r.length;if(c<n&&d>i)return e(r,n,i,c);if(d>=n&&-1==o&&(o=u,s=c),c>i&&r.dom.parentNode==t.dom){l=u,a=h;break}h=d,c=d+r.breakAfter}return{from:s,to:a<0?r+t.length:a,startDOM:(o?t.children[o-1].dom.nextSibling:null)||t.dom.firstChild,endDOM:l<t.children.length&&l>=0?t.children[l].dom:null}}return t.isText()?{from:r,to:r+t.length,startDOM:t.dom,endDOM:t.dom.nextSibling}:null}(e.docView.tile,t,n,0))){let t=r||o?[]:function(e){let t=[];if(e.root.activeElement!=e.contentDOM)return t;let{anchorNode:n,anchorOffset:i,focusNode:r,focusOffset:o}=e.observer.selectionRange;return n&&(t.push(new gw(n,i)),(r!=n||o!=i)&&t.push(new gw(r,o))),t}(e),n=new gy(t,e);n.readRange(this.bounds.startDOM,this.bounds.endDOM),this.text=n.text,this.newSel=function(e,t){if(0==e.length)return null;let n=e[0].pos,i=2==e.length?e[1].pos:n;return n>-1&&i>-1?fh.single(n+t,i+t):null}(t,this.bounds.from)}else{let t=e.observer.selectionRange,n=r&&r.node==t.focusNode&&r.offset==t.focusOffset||!p$(e.contentDOM,t.focusNode)?s.main.head:e.docView.posFromDOM(t.focusNode,t.focusOffset),i=o&&o.node==t.anchorNode&&o.offset==t.anchorOffset||!p$(e.contentDOM,t.anchorNode)?s.main.anchor:e.docView.posFromDOM(t.anchorNode,t.anchorOffset),l=e.viewport;if((pD.ios||pD.chrome)&&s.main.empty&&n!=i&&(l.from>0||l.to<e.state.doc.length)){let t=Math.min(n,i),r=Math.max(n,i),o=l.from-t,s=l.to-r;(0==o||1==o||0==t)&&(0==s||-1==s||r==e.state.doc.length)&&(n=0,i=e.state.doc.length)}if(e.inputState.composing>-1&&s.ranges.length>1)this.newSel=s.replaceRange(fh.range(i,n));else if(e.lineWrapping&&i==n&&!(s.main.empty&&s.main.head==n)&&e.inputState.lastTouchTime>Date.now()-100){let t=e.coordsAtPos(n,-1),i=0;t&&(i=e.inputState.lastTouchY<=t.bottom?-1:1),this.newSel=fh.create([fh.cursor(n,i)])}else this.newSel=fh.single(i,n)}}}function gC(e,t){let n,{newSel:i}=t,{state:r}=e,o=r.selection.main,s=e.inputState.lastKeyTime>Date.now()-100?e.inputState.lastKeyCode:-1;if(t.bounds){let{from:e,to:i}=t.bounds,l=o.from,a=null;(8===s||pD.android&&t.text.length<i-e)&&(l=o.to,a="end");let u=r.doc.sliceString(e,i,""),c,h;!o.empty&&o.from>=e&&o.to<=i&&(t.typeOver||u!=t.text)&&u.slice(0,o.from-e)==t.text.slice(0,o.from-e)&&u.slice(o.to-e)==t.text.slice(c=t.text.length-(u.length-(o.to-e)))?n={from:o.from,to:o.to,insert:dZ.of(t.text.slice(o.from-e,c).split(""))}:(h=gk(u,t.text,l-e,a))&&(pD.chrome&&13==s&&h.toB==h.from+2&&""==t.text.slice(h.from,h.toB)&&h.toB--,n={from:e+h.from,to:e+h.toA,insert:dZ.of(t.text.slice(h.from,h.toB).split(""))})}else i&&(!e.hasFocus&&r.facet(mI)||gM(i,o))&&(i=null);if(!n&&!i)return!1;if((pD.mac||pD.android)&&n&&n.from==n.to&&n.from==o.head-1&&/^\. ?$/.test(n.insert.toString())&&"off"==e.contentDOM.getAttribute("autocorrect")?(i&&2==n.insert.length&&(i=fh.single(i.main.anchor-1,i.main.head-1)),n={from:n.from,to:n.to,insert:dZ.of([n.insert.toString().replace("."," ")])}):r.doc.lineAt(o.from).to<o.to&&e.docView.lineHasWidget(o.to)&&e.inputState.insertingTextAt>Date.now()-50?n={from:o.from,to:o.to,insert:r.toText(e.inputState.insertingText)}:pD.chrome&&n&&n.from==n.to&&n.from==o.head&&"\n "==n.insert.toString()&&e.lineWrapping&&(i&&(i=fh.single(i.main.anchor-1,i.main.head-1)),n={from:o.from,to:o.to,insert:dZ.of([" "])}),n)return gA(e,n,i,s);if(!i||gM(i,o))return!1;{let t=!1,n="select";return e.inputState.lastSelectionTime>Date.now()-50&&("select"==e.inputState.lastSelectionOrigin&&(t=!0),"select.pointer"==(n=e.inputState.lastSelectionOrigin)&&(i=gm(r.facet(mV).map(t=>t(e)),i))),e.dispatch({selection:i,scrollIntoView:t,userEvent:n}),!0}}function gA(e,t,n,i=-1){let r;if(pD.ios&&e.inputState.flushIOSKey(t))return!0;let o=e.state.selection.main;if(pD.android&&(t.to==o.to&&(t.from==o.from||t.from==o.from-1&&" "==e.state.sliceDoc(t.from,o.from))&&1==t.insert.length&&2==t.insert.lines&&p3(e.contentDOM,"Enter",13)||(t.from==o.from-1&&t.to==o.to&&0==t.insert.length||8==i&&t.insert.length<t.to-t.from&&t.to>o.head)&&p3(e.contentDOM,"Backspace",8)||t.from==o.from&&t.to==o.to+1&&0==t.insert.length&&p3(e.contentDOM,"Delete",46)))return!0;let s=t.insert.toString();e.inputState.composing>=0&&e.inputState.composing++;let l=()=>r||(r=function(e,t,n){let i,r=e.state,o=r.selection.main,s=-1;if(t.from==t.to&&t.from<o.from||t.from>o.to){let n=t.from<o.from?-1:1,i=n<0?o.from:o.to,l=gp(r.facet(mV).map(t=>t(e)),i,n);t.from==l&&(s=l)}if(s>-1)i={changes:t,selection:fh.cursor(t.from+t.insert.length,-1)};else if(t.from>=o.from&&t.to<=o.to&&t.to-t.from>=(o.to-o.from)/3&&(!n||n.main.empty&&n.main.from==t.from+t.insert.length)&&e.inputState.composing<0){let n=o.from<t.from?r.sliceDoc(o.from,t.from):"",s=o.to>t.to?r.sliceDoc(t.to,o.to):"";i=r.replaceSelection(e.state.toText(n+t.insert.sliceString(0,void 0,e.state.lineBreak)+s))}else{let s=r.changes(t),l=n&&n.main.to<=s.newLength?n.main:void 0;if(r.selection.ranges.length>1&&(e.inputState.composing>=0||e.inputState.compositionPendingChange)&&t.to<=o.to+10&&t.to>=o.to-10){let a=e.state.sliceDoc(t.from,t.to),u,c=n&&ga(e,n.main.head);if(c){let e=t.insert.length-(t.to-t.from);u={from:c.from,to:c.to-e}}else u=e.state.doc.lineAt(o.head);let h=o.to-t.to;i=r.changeByRange(n=>{if(n.from==o.from&&n.to==o.to)return{changes:s,range:l||n.map(s)};let i=n.to-h,c=i-a.length;if(e.state.sliceDoc(c,i)!=a||i>=u.from&&c<=u.to)return{range:n};let d=r.changes({from:c,to:i,insert:t.insert}),f=n.to-o.to;return{changes:d,range:l?fh.range(Math.max(0,l.anchor+f),Math.max(0,l.head+f)):n.map(d)}})}else i={changes:s,selection:l&&r.selection.replaceRange(l)}}let l="input.type";return(e.composing||e.inputState.compositionPendingChange&&e.inputState.compositionEndedAt>Date.now()-50)&&(e.inputState.compositionPendingChange=!1,l+=".compose",e.inputState.compositionFirstChange&&(l+=".start",e.inputState.compositionFirstChange=!1)),r.update(i,{userEvent:l,scrollIntoView:!0})}(e,t,n));return e.state.facet(mb).some(n=>n(e,t.from,t.to,s,l))||e.dispatch(l()),!0}function gk(e,t,n,i){let r=Math.min(e.length,t.length),o=0;for(;o<r&&e.charCodeAt(o)==t.charCodeAt(o);)o++;if(o==r&&e.length==t.length)return null;let s=e.length,l=t.length;for(;s>0&&l>0&&e.charCodeAt(s-1)==t.charCodeAt(l-1);)s--,l--;if("end"==i){let e=Math.max(0,o-Math.min(s,l));n-=s+e-o}if(s<o&&e.length<t.length){let e=n<=o&&n>=s?o-n:0;o-=e,l=o+(l-s),s=o}else if(l<o){let e=n<=o&&n>=l?o-n:0;o-=e,s=o+(s-l),l=o}return{from:o,toA:s,toB:l}}function gM(e,t){return t.head==e.main.head&&t.anchor==e.main.anchor}class gT{setSelectionOrigin(e){this.lastSelectionOrigin=e,this.lastSelectionTime=Date.now()}constructor(e){this.view=e,this.lastKeyCode=0,this.lastKeyTime=0,this.lastTouchTime=0,this.lastTouchX=0,this.lastTouchY=0,this.lastFocusTime=0,this.lastScrollTop=0,this.lastScrollLeft=0,this.lastWheelEvent=0,this.pendingIOSKey=void 0,this.tabFocusMode=-1,this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastContextMenu=0,this.scrollHandlers=[],this.handlers=Object.create(null),this.composing=-1,this.compositionFirstChange=null,this.compositionEndedAt=0,this.compositionPendingKey=!1,this.compositionPendingChange=!1,this.insertingText="",this.insertingTextAt=0,this.mouseSelection=null,this.draggedContent=null,this.handleEvent=this.handleEvent.bind(this),this.notifiedFocused=e.hasFocus,pD.safari&&e.contentDOM.addEventListener("input",()=>null),pD.gecko&&function(e){gX.has(e)||(gX.add(e),e.addEventListener("copy",()=>{}),e.addEventListener("cut",()=>{}))}(e.contentDOM.ownerDocument)}handleEvent(e){!function(e,t){if(!t.bubbles)return!0;if(t.defaultPrevented)return!1;for(let n=t.target,i;n!=e.contentDOM;n=n.parentNode)if(!n||11==n.nodeType||(i=mY.get(n))&&i.isWidget()&&!i.isHidden&&i.widget.ignoreEvent(t))return!1;return!0}(this.view,e)||this.ignoreDuringComposition(e)||"keydown"==e.type&&this.keydown(e)||(0!=this.view.updateState?Promise.resolve().then(()=>this.runHandlers(e.type,e)):this.runHandlers(e.type,e))}runHandlers(e,t){let n=this.handlers[e];if(n){for(let e of n.observers)e(this.view,t);for(let e of n.handlers){if(t.defaultPrevented)break;if(e(this.view,t)){t.preventDefault();break}}}}ensureHandlers(e){let t=function(e){let t=Object.create(null);function n(e){return t[e]||(t[e]={observers:[],handlers:[]})}for(let t of e){let e=t.spec,i=e&&e.plugin.domEventHandlers,r=e&&e.plugin.domEventObservers;if(i)for(let e in i){let r=i[e];r&&n(e).handlers.push(gD(t.value,r))}if(r)for(let e in r){let i=r[e];i&&n(e).observers.push(gD(t.value,i))}}for(let e in gL)n(e).handlers.push(gL[e]);for(let e in gj)n(e).observers.push(gj[e]);return t}(e),n=this.handlers,i=this.view.contentDOM;for(let e in t)if("scroll"!=e){let r=!t[e].handlers.length,o=n[e];o&&!o.handlers.length!=r&&(i.removeEventListener(e,this.handleEvent),o=null),o||i.addEventListener(e,this.handleEvent,{passive:r})}for(let e in n)"scroll"==e||t[e]||i.removeEventListener(e,this.handleEvent);this.handlers=t}keydown(e){let t;return this.lastKeyCode=e.keyCode,this.lastKeyTime=Date.now(),!!(9==e.keyCode&&this.tabFocusMode>-1&&(!this.tabFocusMode||Date.now()<=this.tabFocusMode))||((this.tabFocusMode>0&&27!=e.keyCode&&0>gE.indexOf(e.keyCode)&&(this.tabFocusMode=-1),pD.android&&pD.chrome&&!e.synthetic&&(13==e.keyCode||8==e.keyCode))?(this.view.observer.delayAndroidKey(e.key,e.keyCode),!0):pD.ios&&!e.synthetic&&!e.altKey&&!e.metaKey&&!e.shiftKey&&((t=gI.find(t=>t.keyCode==e.keyCode))&&!e.ctrlKey||gR.indexOf(e.key)>-1&&e.ctrlKey)?(this.pendingIOSKey=t||e,setTimeout(()=>this.flushIOSKey(),250),!0):(229!=e.keyCode&&this.view.observer.forceFlush(),!1))}flushIOSKey(e){let t=this.pendingIOSKey;return!(!t||"Enter"==t.key&&e&&e.from<e.to&&/^\S+$/.test(e.insert.toString()))&&(this.pendingIOSKey=void 0,p3(this.view.contentDOM,t.key,t.keyCode,t instanceof KeyboardEvent?t:void 0))}ignoreDuringComposition(e){return!!/^key/.test(e.type)&&!e.synthetic&&(this.composing>0||!!(pD.safari&&!pD.ios&&this.compositionPendingKey&&Date.now()-this.compositionEndedAt<100)&&(this.compositionPendingKey=!1,!0))}startMouseSelection(e){this.mouseSelection&&this.mouseSelection.destroy(),this.mouseSelection=e}update(e){this.view.observer.update(e),this.mouseSelection&&this.mouseSelection.update(e),this.draggedContent&&e.docChanged&&(this.draggedContent=this.draggedContent.map(e.changes)),e.transactions.length&&(this.lastKeyCode=this.lastSelectionTime=0)}destroy(){this.mouseSelection&&this.mouseSelection.destroy()}}function gD(e,t){return(n,i)=>{try{return t.call(e,i,n)}catch(e){mD(n.state,e)}}}let gI=[{key:"Backspace",keyCode:8,inputType:"deleteContentBackward"},{key:"Enter",keyCode:13,inputType:"insertParagraph"},{key:"Enter",keyCode:13,inputType:"insertLineBreak"},{key:"Delete",keyCode:46,inputType:"deleteContentForward"}],gR="dthko",gE=[16,17,18,20,91,92,224,225];function gO(e){return .7*Math.max(0,e)+8}class gP{constructor(e,t,n,i){this.view=e,this.startEvent=t,this.style=n,this.mustSelect=i,this.scrollSpeed={x:0,y:0},this.scrolling=-1,this.lastEvent=t,this.scrollParents=pJ(e.contentDOM),this.atoms=e.state.facet(mV).map(t=>t(e));let r=e.contentDOM.ownerDocument;r.addEventListener("mousemove",this.move=this.move.bind(this)),r.addEventListener("mouseup",this.up=this.up.bind(this)),this.extend=t.shiftKey,this.multiple=e.state.facet(fq.allowMultipleSelections)&&function(e,t){let n=e.state.facet(mf);return n.length?n[0](t):pD.mac?t.metaKey:t.ctrlKey}(e,t),this.dragging=!!function(e,t){let{main:n}=e.state.selection;if(n.empty)return!1;let i=pW(e.root);if(!i||0==i.rangeCount)return!0;let r=i.getRangeAt(0).getClientRects();for(let e=0;e<r.length;e++){let n=r[e];if(n.left<=t.clientX&&n.right>=t.clientX&&n.top<=t.clientY&&n.bottom>=t.clientY)return!0}return!1}(e,t)&&1==g_(t)&&null}start(e){!1===this.dragging&&this.select(e)}move(e){var t;if(0==e.buttons)return this.destroy();if(this.dragging||null==this.dragging&&10>(t=this.startEvent,Math.max(Math.abs(t.clientX-e.clientX),Math.abs(t.clientY-e.clientY))))return;this.select(this.lastEvent=e);let n=0,i=0,r=0,o=0,s=this.view.win.innerWidth,l=this.view.win.innerHeight;this.scrollParents.x&&({left:r,right:s}=this.scrollParents.x.getBoundingClientRect()),this.scrollParents.y&&({top:o,bottom:l}=this.scrollParents.y.getBoundingClientRect());let a=m$(this.view);e.clientX-a.left<=r+6?n=-gO(r-e.clientX):e.clientX+a.right>=s-6&&(n=gO(e.clientX-s)),e.clientY-a.top<=o+6?i=-gO(o-e.clientY):e.clientY+a.bottom>=l-6&&(i=gO(e.clientY-l)),this.setScrollSpeed(n,i)}up(e){null==this.dragging&&this.select(this.lastEvent),this.dragging||e.preventDefault(),this.destroy()}destroy(){this.setScrollSpeed(0,0);let e=this.view.contentDOM.ownerDocument;e.removeEventListener("mousemove",this.move),e.removeEventListener("mouseup",this.up),this.view.inputState.mouseSelection=this.view.inputState.draggedContent=null}setScrollSpeed(e,t){this.scrollSpeed={x:e,y:t},e||t?this.scrolling<0&&(this.scrolling=setInterval(()=>this.scroll(),50)):this.scrolling>-1&&(clearInterval(this.scrolling),this.scrolling=-1)}scroll(){let{x:e,y:t}=this.scrollSpeed;e&&this.scrollParents.x&&(this.scrollParents.x.scrollLeft+=e,e=0),t&&this.scrollParents.y&&(this.scrollParents.y.scrollTop+=t,t=0),(e||t)&&this.view.win.scrollBy(e,t),!1===this.dragging&&this.select(this.lastEvent)}select(e){let{view:t}=this,n=gm(this.atoms,this.style.get(e,this.extend,this.multiple));(this.mustSelect||!n.eq(t.state.selection,!1===this.dragging))&&this.view.dispatch({selection:n,userEvent:"select.pointer"}),this.mustSelect=!1}update(e){e.transactions.some(e=>e.isUserEvent("input.type"))?this.destroy():this.style.update(e)&&setTimeout(()=>this.select(this.lastEvent),20)}}let gL=Object.create(null),gj=Object.create(null),gB=pD.ie&&pD.ie_version<15||pD.ios&&pD.webkit_version<604;function gF(e,t,n){for(let i of e.facet(t))n=i(n,e);return n}function gN(e,t){t=gF(e.state,my,t);let{state:n}=e,i,r=1,o=n.toText(t),s=o.lines==n.selection.ranges.length;if(null!=gG&&n.selection.ranges.every(e=>e.empty)&&gG==o.toString()){let e=-1;i=n.changeByRange(i=>{let l=n.doc.lineAt(i.from);if(l.from==e)return{range:i};e=l.from;let a=n.toText((s?o.line(r++).text:t)+n.lineBreak);return{changes:{from:l.from,insert:a},range:fh.cursor(i.from+a.length)}})}else i=s?n.changeByRange(e=>{let t=o.line(r++);return{changes:{from:e.from,to:e.to,insert:t.text},range:fh.cursor(e.from+t.length)}}):n.replaceSelection(o);e.dispatch(i,{userEvent:"input.paste",scrollIntoView:!0})}function gV(e,t,n,i){if(1==i)return fh.cursor(t,n);{if(2==i)return function(e,t,n=1){let i=e.charCategorizer(t),r=e.doc.lineAt(t),o=t-r.from;if(0==r.length)return fh.cursor(t);0==o?n=1:o==r.length&&(n=-1);let s=o,l=o;n<0?s=d6(r.text,o,!1):l=d6(r.text,o);let a=i(r.text.slice(s,l));for(;s>0;){let e=d6(r.text,s,!1);if(i(r.text.slice(e,s))!=a)break;s=e}for(;l<r.length;){let e=d6(r.text,l);if(i(r.text.slice(l,e))!=a)break;l=e}return fh.range(s+r.from,l+r.from)}(e.state,t,n);let r=e.docView.lineAt(t,n),o=e.state.doc.lineAt(r?r.posAtEnd:t),s=r?r.posAtStart:o.from,l=r?r.posAtEnd:o.to;return l<e.state.doc.length&&l==o.to&&l++,fh.range(s,l)}}gj.scroll=e=>{e.inputState.lastScrollTop=e.scrollDOM.scrollTop,e.inputState.lastScrollLeft=e.scrollDOM.scrollLeft},gj.wheel=gj.mousewheel=e=>{e.inputState.lastWheelEvent=Date.now()},gL.keydown=(e,t)=>(e.inputState.setSelectionOrigin("select"),27==t.keyCode&&0!=e.inputState.tabFocusMode&&(e.inputState.tabFocusMode=Date.now()+2e3),!1),gj.touchstart=(e,t)=>{let n=e.inputState,i=t.targetTouches[0];n.lastTouchTime=Date.now(),i&&(n.lastTouchX=i.clientX,n.lastTouchY=i.clientY),n.setSelectionOrigin("select.pointer")},gj.touchmove=e=>{e.inputState.setSelectionOrigin("select.pointer")},gL.mousedown=(e,t)=>{var n,i;let r,o,s;if(e.observer.flush(),e.inputState.lastTouchTime>Date.now()-2e3)return!1;let l=null;for(let n of e.state.facet(mm))if(l=n(e,t))break;if(l||0!=t.button||(n=e,i=t,r=n.posAndSideAtCoords({x:i.clientX,y:i.clientY},!1),o=g_(i),s=n.state.selection,l={update(e){e.docChanged&&(r.pos=e.changes.mapPos(r.pos),s=s.map(e.changes))},get(e,t,i){let l=n.posAndSideAtCoords({x:e.clientX,y:e.clientY},!1),a,u=gV(n,l.pos,l.assoc,o);if(r.pos!=l.pos&&!t){let e=gV(n,r.pos,r.assoc,o),t=Math.min(e.from,u.from),i=Math.max(e.to,u.to);u=t<u.from?fh.range(t,i,u.assoc):fh.range(i,t,u.assoc)}return t?s.replaceRange(s.main.extend(u.from,u.to,u.assoc)):i&&1==o&&s.ranges.length>1&&(a=function(e,t){for(let n=0;n<e.ranges.length;n++){let{from:i,to:r}=e.ranges[n];if(i<=t&&r>=t)return fh.create(e.ranges.slice(0,n).concat(e.ranges.slice(n+1)),e.mainIndex==n?0:e.mainIndex-(e.mainIndex>n))}return null}(s,l.pos))?a:i?s.addRange(u):fh.create([u])}}),l){let n=!e.hasFocus;e.inputState.startMouseSelection(new gP(e,t,l,n)),n&&e.observer.ignore(()=>{p2(e.contentDOM);let t=e.root.activeElement;t&&!t.contains(e.contentDOM)&&t.blur()});let i=e.inputState.mouseSelection;if(i)return i.start(t),!1===i.dragging}else e.inputState.setSelectionOrigin("select.pointer");return!1};let gH=pD.ie&&pD.ie_version<=11,gz=null,gW=0,g$=0;function g_(e){if(!gH)return e.detail;let t=gz,n=g$;return gz=e,g$=Date.now(),gW=!t||n>Date.now()-400&&2>Math.abs(t.clientX-e.clientX)&&2>Math.abs(t.clientY-e.clientY)?(gW+1)%3:1}function gU(e,t,n,i){let r;if(!(n=gF(e.state,my,n)))return;let o=e.posAtCoords({x:t.clientX,y:t.clientY},!1),{draggedContent:s}=e.inputState,l=i&&s&&((r=e.state.facet(mp)).length?r[0](t):pD.mac?!t.altKey:!t.ctrlKey)?{from:s.from,to:s.to}:null,a={from:o,insert:n},u=e.state.changes(l?[l,a]:a);e.focus(),e.dispatch({changes:u,selection:{anchor:u.mapPos(o,-1),head:u.mapPos(o,1)},userEvent:l?"move.drop":"input.drop"}),e.inputState.draggedContent=null}gL.dragstart=(e,t)=>{let{selection:{main:n}}=e.state;if(t.target.draggable){let i=e.docView.tile.nearest(t.target);if(i&&i.isWidget()){let e=i.posAtStart,t=e+i.length;(e>=n.to||t<=n.from)&&(n=fh.range(e,t))}}let{inputState:i}=e;return i.mouseSelection&&(i.mouseSelection.dragging=!0),i.draggedContent=n,t.dataTransfer&&(t.dataTransfer.setData("Text",gF(e.state,mw,e.state.sliceDoc(n.from,n.to))),t.dataTransfer.effectAllowed="copyMove"),!1},gL.dragend=e=>(e.inputState.draggedContent=null,!1),gL.drop=(e,t)=>{if(!t.dataTransfer)return!1;if(e.state.readOnly)return!0;let n=t.dataTransfer.files;if(n&&n.length){let i=Array(n.length),r=0,o=()=>{++r==n.length&&gU(e,t,i.filter(e=>null!=e).join(e.state.lineBreak),!1)};for(let e=0;e<n.length;e++){let t=new FileReader;t.onerror=o,t.onload=()=>{/[\x00-\x08\x0e-\x1f]{2}/.test(t.result)||(i[e]=t.result),o()},t.readAsText(n[e])}return!0}{let n=t.dataTransfer.getData("Text");if(n)return gU(e,t,n,!0),!0}return!1},gL.paste=(e,t)=>{if(e.state.readOnly)return!0;e.observer.flush();let n=gB?null:t.clipboardData;return n?(gN(e,n.getData("text/plain")||n.getData("text/uri-list")),!0):(!function(e){let t=e.dom.parentNode;if(!t)return;let n=t.appendChild(document.createElement("textarea"));n.style.cssText="position: fixed; left: -10000px; top: 10px",n.focus(),setTimeout(()=>{e.focus(),n.remove(),gN(e,n.value)},50)}(e),!1)};let gG=null;gL.copy=gL.cut=(e,t)=>{if(!p_(e.contentDOM,e.observer.selectionRange))return!1;let{text:n,ranges:i,linewise:r}=function(e){let t=[],n=[],i=!1;for(let i of e.selection.ranges)i.empty||(t.push(e.sliceDoc(i.from,i.to)),n.push(i));if(!t.length){let r=-1;for(let{from:i}of e.selection.ranges){let o=e.doc.lineAt(i);o.number>r&&(t.push(o.text),n.push({from:o.from,to:Math.min(e.doc.length,o.to+1)})),r=o.number}i=!0}return{text:gF(e,mw,t.join(e.lineBreak)),ranges:n,linewise:i}}(e.state);if(!n&&!r)return!1;gG=r?n:null,"cut"!=t.type||e.state.readOnly||e.dispatch({changes:i,scrollIntoView:!0,userEvent:"delete.cut"});let o=gB?null:t.clipboardData;return o?(o.clearData(),o.setData("text/plain",n),!0):(!function(e,t){let n=e.dom.parentNode;if(!n)return;let i=n.appendChild(document.createElement("textarea"));i.style.cssText="position: fixed; left: -10000px; top: 10px",i.value=t,i.focus(),i.selectionEnd=t.length,i.selectionStart=0,setTimeout(()=>{i.remove(),e.focus()},50)}(e,n),!1)};let gq=fB.define();function gY(e,t){let n=[];for(let i of e.facet(mx)){let r=i(e,t);r&&n.push(r)}return n.length?e.update({effects:n,annotations:gq.of(!0)}):null}function gK(e){setTimeout(()=>{let t=e.hasFocus;if(t!=e.inputState.notifiedFocused){let n=gY(e.state,t);n?e.dispatch(n):e.update([])}},10)}gj.focus=e=>{e.inputState.lastFocusTime=Date.now(),!e.scrollDOM.scrollTop&&(e.inputState.lastScrollTop||e.inputState.lastScrollLeft)&&(e.scrollDOM.scrollTop=e.inputState.lastScrollTop,e.scrollDOM.scrollLeft=e.inputState.lastScrollLeft),gK(e)},gj.blur=e=>{e.observer.clearSelectionRange(),gK(e)},gj.compositionstart=gj.compositionupdate=e=>{!e.observer.editContext&&(null==e.inputState.compositionFirstChange&&(e.inputState.compositionFirstChange=!0),e.inputState.composing<0&&(e.inputState.composing=0))},gj.compositionend=e=>{e.observer.editContext||(e.inputState.composing=-1,e.inputState.compositionEndedAt=Date.now(),e.inputState.compositionPendingKey=!0,e.inputState.compositionPendingChange=e.observer.pendingRecords().length>0,e.inputState.compositionFirstChange=null,pD.chrome&&pD.android?e.observer.flushSoon():e.inputState.compositionPendingChange?Promise.resolve().then(()=>e.observer.flush()):setTimeout(()=>{e.inputState.composing<0&&e.docView.hasComposition&&e.update([])},50))},gj.contextmenu=e=>{e.inputState.lastContextMenu=Date.now()},gL.beforeinput=(e,t)=>{var n,i;let r;if(("insertText"==t.inputType||"insertCompositionText"==t.inputType)&&(e.inputState.insertingText=t.data,e.inputState.insertingTextAt=Date.now()),"insertReplacementText"==t.inputType&&e.observer.editContext){let i=null==(n=t.dataTransfer)?void 0:n.getData("text/plain"),r=t.getTargetRanges();if(i&&r.length){let t=r[0],n=e.posAtDOM(t.startContainer,t.startOffset),o=e.posAtDOM(t.endContainer,t.endOffset);return gA(e,{from:n,to:o,insert:e.state.toText(i)},null),!0}}if(pD.chrome&&pD.android&&(r=gI.find(e=>e.inputType==t.inputType))&&(e.observer.delayAndroidKey(r.key,r.keyCode),"Backspace"==r.key||"Delete"==r.key)){let t=(null==(i=window.visualViewport)?void 0:i.height)||0;setTimeout(()=>{var n;((null==(n=window.visualViewport)?void 0:n.height)||0)>t+10&&e.hasFocus&&(e.contentDOM.blur(),e.focus())},100)}return pD.ios&&"deleteContentForward"==t.inputType&&e.observer.flushSoon(),pD.safari&&"insertText"==t.inputType&&e.inputState.composing>=0&&setTimeout(()=>gj.compositionend(e,t),20),!1};let gX=new Set,gZ=["pre-wrap","normal","pre-line","break-spaces"],gQ=!1;class gJ{constructor(e){this.lineWrapping=e,this.doc=dZ.empty,this.heightSamples={},this.lineHeight=14,this.charWidth=7,this.textHeight=14,this.lineLength=30}heightForGap(e,t){let n=this.doc.lineAt(t).number-this.doc.lineAt(e).number+1;return this.lineWrapping&&(n+=Math.max(0,Math.ceil((t-e-n*this.lineLength*.5)/this.lineLength))),this.lineHeight*n}heightForLine(e){return this.lineWrapping?(1+Math.max(0,Math.ceil((e-this.lineLength)/Math.max(1,this.lineLength-5))))*this.lineHeight:this.lineHeight}setDoc(e){return this.doc=e,this}mustRefreshForWrapping(e){return gZ.indexOf(e)>-1!=this.lineWrapping}mustRefreshForHeights(e){let t=!1;for(let n=0;n<e.length;n++){let i=e[n];i<0?n++:this.heightSamples[Math.floor(10*i)]||(t=!0,this.heightSamples[Math.floor(10*i)]=!0)}return t}refresh(e,t,n,i,r,o){let s=gZ.indexOf(e)>-1,l=Math.abs(t-this.lineHeight)>.3||this.lineWrapping!=s||Math.abs(n-this.charWidth)>.1;if(this.lineWrapping=s,this.lineHeight=t,this.charWidth=n,this.textHeight=i,this.lineLength=r,l){this.heightSamples={};for(let e=0;e<o.length;e++){let t=o[e];t<0?e++:this.heightSamples[Math.floor(10*t)]=!0}}return l}}class g0{constructor(e,t){this.from=e,this.heights=t,this.index=0}get more(){return this.index<this.heights.length}}class g1{constructor(e,t,n,i,r){this.from=e,this.length=t,this.top=n,this.height=i,this._content=r}get type(){return"number"==typeof this._content?pL.Text:Array.isArray(this._content)?this._content:this._content.type}get to(){return this.from+this.length}get bottom(){return this.top+this.height}get widget(){return this._content instanceof pN?this._content.widget:null}get widgetLineBreaks(){return"number"==typeof this._content?this._content:0}join(e){let t=(Array.isArray(this._content)?this._content:[this]).concat(Array.isArray(e._content)?e._content:[e]);return new g1(this.from,this.length+e.length,this.top,this.height+e.height,t)}}var g2=((v=g2||(g2={}))[v.ByPos=0]="ByPos",v[v.ByHeight=1]="ByHeight",v[v.ByPosNoHeight=2]="ByPosNoHeight",v);class g5{constructor(e,t,n=2){this.length=e,this.height=t,this.flags=n}get outdated(){return(2&this.flags)>0}set outdated(e){this.flags=2*!!e|-3&this.flags}setHeight(e){this.height!=e&&(Math.abs(this.height-e)>.001&&(gQ=!0),this.height=e)}replace(e,t,n){return g5.of(n)}decomposeLeft(e,t){t.push(this)}decomposeRight(e,t){t.push(this)}applyChanges(e,t,n,i){let r=this,o=n.doc;for(let s=i.length-1;s>=0;s--){let{fromA:l,toA:a,fromB:u,toB:c}=i[s],h=r.lineAt(l,g2.ByPosNoHeight,n.setDoc(t),0,0),d=h.to>=a?h:r.lineAt(a,g2.ByPosNoHeight,n,0,0);for(c+=d.to-a,a=d.to;s>0&&h.from<=i[s-1].toA;)l=i[s-1].fromA,u=i[s-1].fromB,s--,l<h.from&&(h=r.lineAt(l,g2.ByPosNoHeight,n,0,0));u+=h.from-l,l=h.from;let f=vt.build(n.setDoc(o),e,u,c);r=g3(r,r.replace(l,a,f))}return r.updateHeight(n,0)}static empty(){return new g8(0,0,0)}static of(e){if(1==e.length)return e[0];let t=0,n=e.length,i=0,r=0;for(;;)if(t==n)if(i>2*r){let r=e[t-1];r.break?e.splice(--t,1,r.left,null,r.right):e.splice(--t,1,r.left,r.right),n+=1+r.break,i-=r.size}else if(r>2*i){let t=e[n];t.break?e.splice(n,1,t.left,null,t.right):e.splice(n,1,t.left,t.right),n+=2+t.break,r-=t.size}else break;else if(i<r){let n=e[t++];n&&(i+=n.size)}else{let t=e[--n];t&&(r+=t.size)}let o=0;return null==e[t-1]?(o=1,t--):null==e[t]&&(o=1,n++),new g7(g5.of(e.slice(0,t)),o,g5.of(e.slice(n)))}}function g3(e,t){return e==t?e:(e.constructor!=t.constructor&&(gQ=!0),t)}g5.prototype.size=1;let g4=pj.replace({});class g6 extends g5{constructor(e,t,n){super(e,t),this.deco=n,this.spaceAbove=0}mainBlock(e,t){return new g1(t,this.length,e+this.spaceAbove,this.height-this.spaceAbove,this.deco||0)}blockAt(e,t,n,i){return this.spaceAbove&&e<n+this.spaceAbove?new g1(i,0,n,this.spaceAbove,g4):this.mainBlock(n,i)}lineAt(e,t,n,i,r){let o=this.mainBlock(i,r);return this.spaceAbove?this.blockAt(0,n,i,r).join(o):o}forEachLine(e,t,n,i,r,o){e<=r+this.length&&t>=r&&o(this.lineAt(0,g2.ByPos,n,i,r))}setMeasuredHeight(e){let t=e.heights[e.index++];t<0?(this.spaceAbove=-t,t=e.heights[e.index++]):this.spaceAbove=0,this.setHeight(t)}updateHeight(e,t=0,n=!1,i){return i&&i.from<=t&&i.more&&this.setMeasuredHeight(i),this.outdated=!1,this}toString(){return`block(${this.length})`}}class g8 extends g6{constructor(e,t,n){super(e,t,null),this.collapsed=0,this.widgetHeight=0,this.breaks=0,this.spaceAbove=n}mainBlock(e,t){return new g1(t,this.length,e+this.spaceAbove,this.height-this.spaceAbove,this.breaks)}replace(e,t,n){let i=n[0];return 1==n.length&&(i instanceof g8||i instanceof g9&&4&i.flags)&&10>Math.abs(this.length-i.length)?(i instanceof g9?i=new g8(i.length,this.height,this.spaceAbove):i.height=this.height,this.outdated||(i.outdated=!1),i):g5.of(n)}updateHeight(e,t=0,n=!1,i){return i&&i.from<=t&&i.more?this.setMeasuredHeight(i):(n||this.outdated)&&(this.spaceAbove=0,this.setHeight(Math.max(this.widgetHeight,e.heightForLine(this.length-this.collapsed))+this.breaks*e.lineHeight)),this.outdated=!1,this}toString(){return`line(${this.length}${this.collapsed?-this.collapsed:""}${this.widgetHeight?":"+this.widgetHeight:""})`}}class g9 extends g5{constructor(e){super(e,0)}heightMetrics(e,t){let n=e.doc.lineAt(t).number,i=e.doc.lineAt(t+this.length).number,r=i-n+1,o,s=0;if(e.lineWrapping){let t=Math.min(this.height,e.lineHeight*r);o=t/r,this.length>r+1&&(s=(this.height-t)/(this.length-r-1))}else o=this.height/r;return{firstLine:n,lastLine:i,perLine:o,perChar:s}}blockAt(e,t,n,i){let{firstLine:r,lastLine:o,perLine:s,perChar:l}=this.heightMetrics(t,i);if(t.lineWrapping){let r=i+(e<t.lineHeight?0:Math.round(Math.max(0,Math.min(1,(e-n)/this.height))*this.length)),o=t.doc.lineAt(r),a=s+o.length*l,u=Math.max(n,e-a/2);return new g1(o.from,o.length,u,a,0)}{let i=Math.max(0,Math.min(o-r,Math.floor((e-n)/s))),{from:l,length:a}=t.doc.line(r+i);return new g1(l,a,n+s*i,s,0)}}lineAt(e,t,n,i,r){if(t==g2.ByHeight)return this.blockAt(e,n,i,r);if(t==g2.ByPosNoHeight){let{from:t,to:i}=n.doc.lineAt(e);return new g1(t,i-t,0,0,0)}let{firstLine:o,perLine:s,perChar:l}=this.heightMetrics(n,r),a=n.doc.lineAt(e),u=s+a.length*l,c=a.number-o,h=i+s*c+l*(a.from-r-c);return new g1(a.from,a.length,Math.max(i,Math.min(h,i+this.height-u)),u,0)}forEachLine(e,t,n,i,r,o){e=Math.max(e,r),t=Math.min(t,r+this.length);let{firstLine:s,perLine:l,perChar:a}=this.heightMetrics(n,r);for(let u=e,c=i;u<=t;){let t=n.doc.lineAt(u);if(u==e){let n=t.number-s;c+=l*n+a*(e-r-n)}let i=l+a*t.length;o(new g1(t.from,t.length,c,i,0)),c+=i,u=t.to+1}}replace(e,t,n){let i=this.length-t;if(i>0){let e=n[n.length-1];e instanceof g9?n[n.length-1]=new g9(e.length+i):n.push(null,new g9(i-1))}if(e>0){let t=n[0];t instanceof g9?n[0]=new g9(e+t.length):n.unshift(new g9(e-1),null)}return g5.of(n)}decomposeLeft(e,t){t.push(new g9(e-1),null)}decomposeRight(e,t){t.push(null,new g9(this.length-e-1))}updateHeight(e,t=0,n=!1,i){let r=t+this.length;if(i&&i.from<=t+this.length&&i.more){let n=[],o=Math.max(t,i.from),s=-1;for(i.from>t&&n.push(new g9(i.from-t-1).updateHeight(e,t));o<=r&&i.more;){let t=e.doc.lineAt(o).length;n.length&&n.push(null);let r=i.heights[i.index++],l=0;r<0&&(l=-r,r=i.heights[i.index++]),-1==s?s=r:Math.abs(r-s)>=.001&&(s=-2);let a=new g8(t,r,l);a.outdated=!1,n.push(a),o+=t+1}o<=r&&n.push(null,new g9(r-o).updateHeight(e,o));let l=g5.of(n);return(s<0||Math.abs(l.height-this.height)>=.001||Math.abs(s-this.heightMetrics(e,t).perLine)>=.001)&&(gQ=!0),g3(this,l)}return(n||this.outdated)&&(this.setHeight(e.heightForGap(t,t+this.length)),this.outdated=!1),this}toString(){return`gap(${this.length})`}}class g7 extends g5{constructor(e,t,n){super(e.length+t+n.length,e.height+n.height,t|(e.outdated||n.outdated?2:0)),this.left=e,this.right=n,this.size=e.size+n.size}get break(){return 1&this.flags}blockAt(e,t,n,i){let r=n+this.left.height;return e<r?this.left.blockAt(e,t,n,i):this.right.blockAt(e,t,r,i+this.left.length+this.break)}lineAt(e,t,n,i,r){let o=i+this.left.height,s=r+this.left.length+this.break,l=t==g2.ByHeight?e<o:e<s,a=l?this.left.lineAt(e,t,n,i,r):this.right.lineAt(e,t,n,o,s);if(this.break||(l?a.to<s:a.from>s))return a;let u=t==g2.ByPosNoHeight?g2.ByPosNoHeight:g2.ByPos;return l?a.join(this.right.lineAt(s,u,n,o,s)):this.left.lineAt(s,u,n,i,r).join(a)}forEachLine(e,t,n,i,r,o){let s=i+this.left.height,l=r+this.left.length+this.break;if(this.break)e<l&&this.left.forEachLine(e,t,n,i,r,o),t>=l&&this.right.forEachLine(e,t,n,s,l,o);else{let a=this.lineAt(l,g2.ByPos,n,i,r);e<a.from&&this.left.forEachLine(e,a.from-1,n,i,r,o),a.to>=e&&a.from<=t&&o(a),t>a.to&&this.right.forEachLine(a.to+1,t,n,s,l,o)}}replace(e,t,n){let i=this.left.length+this.break;if(t<i)return this.balanced(this.left.replace(e,t,n),this.right);if(e>this.left.length)return this.balanced(this.left,this.right.replace(e-i,t-i,n));let r=[];e>0&&this.decomposeLeft(e,r);let o=r.length;for(let e of n)r.push(e);if(e>0&&ve(r,o-1),t<this.length){let e=r.length;this.decomposeRight(t,r),ve(r,e)}return g5.of(r)}decomposeLeft(e,t){let n=this.left.length;if(e<=n)return this.left.decomposeLeft(e,t);t.push(this.left),this.break&&e>=++n&&t.push(null),e>n&&this.right.decomposeLeft(e-n,t)}decomposeRight(e,t){let n=this.left.length,i=n+this.break;if(e>=i)return this.right.decomposeRight(e-i,t);e<n&&this.left.decomposeRight(e,t),this.break&&e<i&&t.push(null),t.push(this.right)}balanced(e,t){return e.size>2*t.size||t.size>2*e.size?g5.of(this.break?[e,null,t]:[e,t]):(this.left=g3(this.left,e),this.right=g3(this.right,t),this.setHeight(e.height+t.height),this.outdated=e.outdated||t.outdated,this.size=e.size+t.size,this.length=e.length+this.break+t.length,this)}updateHeight(e,t=0,n=!1,i){let{left:r,right:o}=this,s=t+r.length+this.break,l=null;return(i&&i.from<=t+r.length&&i.more?l=r=r.updateHeight(e,t,n,i):r.updateHeight(e,t,n),i&&i.from<=s+o.length&&i.more?l=o=o.updateHeight(e,s,n,i):o.updateHeight(e,s,n),l)?this.balanced(r,o):(this.height=this.left.height+this.right.height,this.outdated=!1,this)}toString(){return this.left+(this.break?" ":"-")+this.right}}function ve(e,t){let n,i;null==e[t]&&(n=e[t-1])instanceof g9&&(i=e[t+1])instanceof g9&&e.splice(t-1,3,new g9(n.length+1+i.length))}class vt{constructor(e,t){this.pos=e,this.oracle=t,this.nodes=[],this.lineStart=-1,this.lineEnd=-1,this.covering=null,this.writtenTo=e}get isCovered(){return this.covering&&this.nodes[this.nodes.length-1]==this.covering}span(e,t){if(this.lineStart>-1){let e=Math.min(t,this.lineEnd),n=this.nodes[this.nodes.length-1];n instanceof g8?n.length+=e-this.pos:(e>this.pos||!this.isCovered)&&this.nodes.push(new g8(e-this.pos,-1,0)),this.writtenTo=e,t>e&&(this.nodes.push(null),this.writtenTo++,this.lineStart=-1)}this.pos=t}point(e,t,n){if(e<t||n.heightRelevant){let i=n.widget?n.widget.estimatedHeight:0,r=n.widget?n.widget.lineBreaks:0;i<0&&(i=this.oracle.lineHeight);let o=t-e;n.block?this.addBlock(new g6(o,i,n)):(o||r||i>=5)&&this.addLineDeco(i,r,o)}else t>e&&this.span(e,t);this.lineEnd>-1&&this.lineEnd<this.pos&&(this.lineEnd=this.oracle.doc.lineAt(this.pos).to)}enterLine(){if(this.lineStart>-1)return;let{from:e,to:t}=this.oracle.doc.lineAt(this.pos);this.lineStart=e,this.lineEnd=t,this.writtenTo<e&&((this.writtenTo<e-1||null==this.nodes[this.nodes.length-1])&&this.nodes.push(this.blankContent(this.writtenTo,e-1)),this.nodes.push(null)),this.pos>e&&this.nodes.push(new g8(this.pos-e,-1,0)),this.writtenTo=this.pos}blankContent(e,t){let n=new g9(t-e);return this.oracle.doc.lineAt(e).to==t&&(n.flags|=4),n}ensureLine(){this.enterLine();let e=this.nodes.length?this.nodes[this.nodes.length-1]:null;if(e instanceof g8)return e;let t=new g8(0,-1,0);return this.nodes.push(t),t}addBlock(e){this.enterLine();let t=e.deco;t&&t.startSide>0&&!this.isCovered&&this.ensureLine(),this.nodes.push(e),this.writtenTo=this.pos=this.pos+e.length,t&&t.endSide>0&&(this.covering=e)}addLineDeco(e,t,n){let i=this.ensureLine();i.length+=n,i.collapsed+=n,i.widgetHeight=Math.max(i.widgetHeight,e),i.breaks+=t,this.writtenTo=this.pos=this.pos+n}finish(e){let t=0==this.nodes.length?null:this.nodes[this.nodes.length-1];!(this.lineStart>-1)||t instanceof g8||this.isCovered?(this.writtenTo<this.pos||null==t)&&this.nodes.push(this.blankContent(this.writtenTo,this.pos)):this.nodes.push(new g8(0,-1,0));let n=e;for(let e of this.nodes)e instanceof g8&&e.updateHeight(this.oracle,n),n+=e?e.length:1;return this.nodes}static build(e,t,n,i){let r=new vt(n,e);return f0.spans(t,n,i,r,0),r.finish(n)}}class vn{constructor(){this.changes=[]}compareRange(){}comparePoint(e,t,n,i){(e<t||n&&n.heightRelevant||i&&i.heightRelevant)&&pH(e,t,this.changes,5)}}class vi{constructor(e,t,n,i){this.from=e,this.to=t,this.size=n,this.displaySize=i}static same(e,t){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++){let i=e[n],r=t[n];if(i.from!=r.from||i.to!=r.to||i.size!=r.size)return!1}return!0}draw(e,t){return pj.replace({widget:new vr(this.displaySize*(t?e.scaleY:e.scaleX),t)}).range(this.from,this.to)}}class vr extends pP{constructor(e,t){super(),this.size=e,this.vertical=t}eq(e){return e.size==this.size&&e.vertical==this.vertical}toDOM(){let e=document.createElement("div");return this.vertical?e.style.height=this.size+"px":(e.style.width=this.size+"px",e.style.height="2px",e.style.display="inline-block"),e}get estimatedHeight(){return this.vertical?this.size:-1}}class vo{constructor(e,t){this.view=e,this.state=t,this.pixelViewport={left:0,right:window.innerWidth,top:0,bottom:0},this.inView=!0,this.paddingTop=0,this.paddingBottom=0,this.contentDOMWidth=0,this.contentDOMHeight=0,this.editorHeight=0,this.editorWidth=0,this.scaleX=1,this.scaleY=1,this.scrollOffset=0,this.scrolledToBottom=!1,this.scrollAnchorPos=0,this.scrollAnchorHeight=-1,this.scaler=vu,this.scrollTarget=null,this.printing=!1,this.mustMeasureContent=!0,this.defaultTextDirection=p7.LTR,this.visibleRanges=[],this.mustEnforceCursorAssoc=!1;let n=t.facet(mj).some(e=>"function"!=typeof e&&"cm-lineWrapping"==e.class);this.heightOracle=new gJ(n),this.stateDeco=vc(t),this.heightMap=g5.empty().applyChanges(this.stateDeco,dZ.empty,this.heightOracle.setDoc(t.doc),[new mU(0,0,0,t.doc.length)]);for(let e=0;e<2&&(this.viewport=this.getViewport(0,null),this.updateForViewport());e++);this.updateViewportLines(),this.lineGaps=this.ensureLineGaps([]),this.lineGapDeco=pj.set(this.lineGaps.map(e=>e.draw(this,!1))),this.scrollParent=e.scrollDOM,this.computeVisibleRanges()}updateForViewport(){let e=[this.viewport],{main:t}=this.state.selection;for(let n=0;n<=1;n++){let i=n?t.head:t.anchor;if(!e.some(({from:e,to:t})=>i>=e&&i<=t)){let{from:t,to:n}=this.lineBlockAt(i);e.push(new vs(t,n))}}return this.viewports=e.sort((e,t)=>e.from-t.from),this.updateScaler()}updateScaler(){let e=this.scaler;return this.scaler=this.heightMap.height<=7e6?vu:new vh(this.heightOracle,this.heightMap,this.viewports),2*!e.eq(this.scaler)}updateViewportLines(){this.viewportLines=[],this.heightMap.forEachLine(this.viewport.from,this.viewport.to,this.heightOracle.setDoc(this.state.doc),0,0,e=>{this.viewportLines.push(vd(e,this.scaler))})}update(e,t=null){var n,i;let r;this.state=e.state;let o=this.stateDeco;this.stateDeco=vc(this.state);let s=e.changedRanges,l=mU.extendWithRanges(s,(n=this.stateDeco,i=e?e.changes:fi.empty(this.state.doc.length),r=new vn,f0.compare(o,n,i,r,0),r.changes)),a=this.heightMap.height,u=this.scrolledToBottom?null:this.scrollAnchorAt(this.scrollOffset);gQ=!1,this.heightMap=this.heightMap.applyChanges(this.stateDeco,e.startState.doc,this.heightOracle.setDoc(this.state.doc),l),(this.heightMap.height!=a||gQ)&&(e.flags|=2),u?(this.scrollAnchorPos=e.changes.mapPos(u.from,-1),this.scrollAnchorHeight=u.top):(this.scrollAnchorPos=-1,this.scrollAnchorHeight=a);let c=l.length?this.mapViewport(this.viewport,e.changes):this.viewport;(t&&(t.range.head<c.from||t.range.head>c.to)||!this.viewportIsAppropriate(c))&&(c=this.getViewport(0,t));let h=c.from!=this.viewport.from||c.to!=this.viewport.to;this.viewport=c,e.flags|=this.updateForViewport(),(h||!e.changes.empty||2&e.flags)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(this.mapLineGaps(this.lineGaps,e.changes))),e.flags|=this.computeVisibleRanges(e.changes),t&&(this.scrollTarget=t),!this.mustEnforceCursorAssoc&&(e.selectionSet||e.focusChanged)&&e.view.lineWrapping&&e.state.selection.main.empty&&e.state.selection.main.assoc&&!e.state.facet(mC)&&(this.mustEnforceCursorAssoc=!0)}measure(){var e;let t,n,{view:i}=this,r=i.contentDOM,o=window.getComputedStyle(r),s=this.heightOracle,l=o.whiteSpace;this.defaultTextDirection="rtl"==o.direction?p7.RTL:p7.LTR;let a=this.heightOracle.mustRefreshForWrapping(l)||"refresh"===this.mustMeasureContent,u=r.getBoundingClientRect(),c=a||this.mustMeasureContent||this.contentDOMHeight!=u.height;this.contentDOMHeight=u.height,this.mustMeasureContent=!1;let h=0,d=0;if(u.width&&u.height){let{scaleX:e,scaleY:t}=pQ(r,u);(e>.005&&Math.abs(this.scaleX-e)>.005||t>.005&&Math.abs(this.scaleY-t)>.005)&&(this.scaleX=e,this.scaleY=t,h|=16,a=c=!0)}let f=(parseInt(o.paddingTop)||0)*this.scaleY,p=(parseInt(o.paddingBottom)||0)*this.scaleY;(this.paddingTop!=f||this.paddingBottom!=p)&&(this.paddingTop=f,this.paddingBottom=p,h|=18),this.editorWidth!=i.scrollDOM.clientWidth&&(s.lineWrapping&&(c=!0),this.editorWidth=i.scrollDOM.clientWidth,h|=16);let m=pJ(this.view.contentDOM,!1).y;m!=this.scrollParent&&(this.scrollParent=m,this.scrollAnchorHeight=-1,this.scrollOffset=0);let g=this.getScrollOffset();this.scrollOffset!=g&&(this.scrollAnchorHeight=-1,this.scrollOffset=g),this.scrolledToBottom=p4(this.scrollParent||i.win);let v=(this.printing?function(e,t){let n=e.getBoundingClientRect();return{left:0,right:n.right-n.left,top:t,bottom:n.bottom-(n.top+t)}}:function(e,t){let n=e.getBoundingClientRect(),i=e.ownerDocument,r=i.defaultView||window,o=Math.max(0,n.left),s=Math.min(r.innerWidth,n.right),l=Math.max(0,n.top),a=Math.min(r.innerHeight,n.bottom);for(let t=e.parentNode;t&&t!=i.body;)if(1==t.nodeType){let n=t,i=window.getComputedStyle(n);if((n.scrollHeight>n.clientHeight||n.scrollWidth>n.clientWidth)&&"visible"!=i.overflow){let i=n.getBoundingClientRect();o=Math.max(o,i.left),s=Math.min(s,i.right),l=Math.max(l,i.top),a=Math.min(t==e.parentNode?r.innerHeight:a,i.bottom)}t="absolute"==i.position||"fixed"==i.position?n.offsetParent:n.parentNode}else if(11==t.nodeType)t=t.host;else break;return{left:o-n.left,right:Math.max(o,s)-n.left,top:l-(n.top+t),bottom:Math.max(l,a)-(n.top+t)}})(r,this.paddingTop),b=v.top-this.pixelViewport.top,x=v.bottom-this.pixelViewport.bottom;this.pixelViewport=v;let y=this.pixelViewport.bottom>this.pixelViewport.top&&this.pixelViewport.right>this.pixelViewport.left;if(y!=this.inView&&(this.inView=y,y&&(c=!0)),!this.inView&&!this.scrollTarget&&(t=(e=i.dom).getBoundingClientRect(),n=e.ownerDocument.defaultView||window,!(t.left<n.innerWidth)||!(t.right>0)||!(t.top<n.innerHeight)||!(t.bottom>0)))return 0;let w=u.width;if((this.contentDOMWidth!=w||this.editorHeight!=i.scrollDOM.clientHeight)&&(this.contentDOMWidth=u.width,this.editorHeight=i.scrollDOM.clientHeight,h|=16),c){let e=i.docView.measureVisibleLineHeights(this.viewport);if(s.mustRefreshForHeights(e)&&(a=!0),a||s.lineWrapping&&Math.abs(w-this.contentDOMWidth)>s.charWidth){let{lineHeight:t,charWidth:n,textHeight:r}=i.docView.measureTextSize();(a=t>0&&s.refresh(l,t,n,r,Math.max(5,w/n),e))&&(i.docView.minWidth=0,h|=16)}for(let t of(b>0&&x>0?d=Math.max(b,x):b<0&&x<0&&(d=Math.min(b,x)),gQ=!1,this.viewports)){let n=t.from==this.viewport.from?e:i.docView.measureVisibleLineHeights(t);this.heightMap=(a?g5.empty().applyChanges(this.stateDeco,dZ.empty,this.heightOracle,[new mU(0,0,0,i.state.doc.length)]):this.heightMap).updateHeight(s,0,a,new g0(t.from,n))}gQ&&(h|=2)}let S=!this.viewportIsAppropriate(this.viewport,d)||this.scrollTarget&&(this.scrollTarget.range.head<this.viewport.from||this.scrollTarget.range.head>this.viewport.to);return S&&(2&h&&(h|=this.updateScaler()),this.viewport=this.getViewport(d,this.scrollTarget),h|=this.updateForViewport()),(2&h||S)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(a?[]:this.lineGaps,i)),h|=this.computeVisibleRanges(),this.mustEnforceCursorAssoc&&(this.mustEnforceCursorAssoc=!1,i.docView.enforceCursorAssoc()),h}get visibleTop(){return this.scaler.fromDOM(this.pixelViewport.top)}get visibleBottom(){return this.scaler.fromDOM(this.pixelViewport.bottom)}getViewport(e,t){let n=.5-Math.max(-.5,Math.min(.5,e/1e3/2)),i=this.heightMap,r=this.heightOracle,{visibleTop:o,visibleBottom:s}=this,l=new vs(i.lineAt(o-1e3*n,g2.ByHeight,r,0,0).from,i.lineAt(s+(1-n)*1e3,g2.ByHeight,r,0,0).to);if(t){let{head:e}=t.range;if(e<l.from||e>l.to){let n=Math.min(this.editorHeight,this.pixelViewport.bottom-this.pixelViewport.top),o=i.lineAt(e,g2.ByPos,r,0,0),s;s="center"==t.y?(o.top+o.bottom)/2-n/2:"start"==t.y||"nearest"==t.y&&e<l.from?o.top:o.bottom-n,l=new vs(i.lineAt(s-500,g2.ByHeight,r,0,0).from,i.lineAt(s+n+500,g2.ByHeight,r,0,0).to)}}return l}mapViewport(e,t){let n=t.mapPos(e.from,-1),i=t.mapPos(e.to,1);return new vs(this.heightMap.lineAt(n,g2.ByPos,this.heightOracle,0,0).from,this.heightMap.lineAt(i,g2.ByPos,this.heightOracle,0,0).to)}viewportIsAppropriate({from:e,to:t},n=0){if(!this.inView)return!0;let{top:i}=this.heightMap.lineAt(e,g2.ByPos,this.heightOracle,0,0),{bottom:r}=this.heightMap.lineAt(t,g2.ByPos,this.heightOracle,0,0),{visibleTop:o,visibleBottom:s}=this;return(0==e||i<=o-Math.max(10,Math.min(-n,250)))&&(t==this.state.doc.length||r>=s+Math.max(10,Math.min(n,250)))&&i>o-2e3&&r<s+2e3}mapLineGaps(e,t){if(!e.length||t.empty)return e;let n=[];for(let i of e)t.touchesRange(i.from,i.to)||n.push(new vi(t.mapPos(i.from),t.mapPos(i.to),i.size,i.displaySize));return n}ensureLineGaps(e,t){let n=this.heightOracle.lineWrapping,i=n?1e4:2e3,r=i>>1,o=i<<1;if(this.defaultTextDirection!=p7.LTR&&!n)return[];let s=[],l=(i,o,a,u)=>{if(o-i<r)return;let c=this.state.selection.main,h=[c.from];for(let e of(c.empty||h.push(c.to),h))if(e>i&&e<o){l(i,e-10,a,u),l(e+10,o,a,u);return}let d=function(e,t){for(let n of e)if(t(n))return n}(e,e=>e.from>=a.from&&e.to<=a.to&&Math.abs(e.from-i)<r&&Math.abs(e.to-o)<r&&!h.some(t=>e.from<t&&e.to>t));if(!d){if(o<a.to&&t&&n&&t.visibleRanges.some(e=>e.from<=o&&e.to>=o)){let e=t.moveToLineBoundary(fh.cursor(o),!1,!0).head;e>i&&(o=e)}let e=this.gapSize(a,i,o,u),r=n||e<2e6?e:2e6;d=new vi(i,o,e,r)}s.push(d)},a=t=>{var r,s,a;let u,c,h,d,f;if(t.length<o||t.type!=pL.Text)return;let p=(r=t.from,s=t.to,a=this.stateDeco,h=[],d=r,f=0,f0.spans(a,r,s,{span(){},point(e,t){e>d&&(h.push({from:d,to:e}),f+=e-d),d=t}},20),d<s&&(h.push({from:d,to:s}),f+=s-d),{total:f,ranges:h});if(p.total<o)return;let m=this.scrollTarget?this.scrollTarget.range.head:null;if(n){let e,n,r=i/this.heightOracle.lineLength*this.heightOracle.lineHeight;if(null!=m){let i=va(p,m),o=((this.visibleBottom-this.visibleTop)/2+r)/t.height;e=i-o,n=i+o}else e=(this.visibleTop-t.top-r)/t.height,n=(this.visibleBottom-t.top+r)/t.height;u=vl(p,e),c=vl(p,n)}else{let n,r,o=p.total*this.heightOracle.charWidth,s=i*this.heightOracle.charWidth,l=0;if(o>2e6)for(let n of e)n.from>=t.from&&n.from<t.to&&n.size!=n.displaySize&&n.from*this.heightOracle.charWidth+l<this.pixelViewport.left&&(l=n.size-n.displaySize);let a=this.pixelViewport.left+l,h=this.pixelViewport.right+l;if(null!=m){let e=va(p,m),t=((h-a)/2+s)/o;n=e-t,r=e+t}else n=(a-s)/o,r=(h+s)/o;u=vl(p,n),c=vl(p,r)}u>t.from&&l(t.from,u,t,p),c<t.to&&l(c,t.to,t,p)};for(let e of this.viewportLines)Array.isArray(e.type)?e.type.forEach(a):a(e);return s}gapSize(e,t,n,i){let r=va(i,n)-va(i,t);return this.heightOracle.lineWrapping?e.height*r:i.total*this.heightOracle.charWidth*r}updateLineGaps(e){vi.same(e,this.lineGaps)||(this.lineGaps=e,this.lineGapDeco=pj.set(e.map(e=>e.draw(this,this.heightOracle.lineWrapping))))}computeVisibleRanges(e){let t=this.stateDeco;this.lineGaps.length&&(t=t.concat(this.lineGapDeco));let n=[];f0.spans(t,this.viewport.from,this.viewport.to,{span(e,t){n.push({from:e,to:t})},point(){}},20);let i=0;if(n.length!=this.visibleRanges.length)i=12;else for(let t=0;t<n.length&&!(8&i);t++){let r=this.visibleRanges[t],o=n[t];(r.from!=o.from||r.to!=o.to)&&(i|=4,e&&e.mapPos(r.from,-1)==o.from&&e.mapPos(r.to,1)==o.to||(i|=8))}return this.visibleRanges=n,i}lineBlockAt(e){return e>=this.viewport.from&&e<=this.viewport.to&&this.viewportLines.find(t=>t.from<=e&&t.to>=e)||vd(this.heightMap.lineAt(e,g2.ByPos,this.heightOracle,0,0),this.scaler)}lineBlockAtHeight(e){return e>=this.viewportLines[0].top&&e<=this.viewportLines[this.viewportLines.length-1].bottom&&this.viewportLines.find(t=>t.top<=e&&t.bottom>=e)||vd(this.heightMap.lineAt(this.scaler.fromDOM(e),g2.ByHeight,this.heightOracle,0,0),this.scaler)}getScrollOffset(){return(this.scrollParent==this.view.scrollDOM?this.scrollParent.scrollTop:(this.scrollParent?this.scrollParent.getBoundingClientRect().top:0)-this.view.contentDOM.getBoundingClientRect().top)*this.scaleY}scrollAnchorAt(e){let t=this.lineBlockAtHeight(e+8);return t.from>=this.viewport.from||this.viewportLines[0].top-e>200?t:this.viewportLines[0]}elementAtHeight(e){return vd(this.heightMap.blockAt(this.scaler.fromDOM(e),this.heightOracle,0,0),this.scaler)}get docHeight(){return this.scaler.toDOM(this.heightMap.height)}get contentHeight(){return this.docHeight+this.paddingTop+this.paddingBottom}}class vs{constructor(e,t){this.from=e,this.to=t}}function vl({total:e,ranges:t},n){if(n<=0)return t[0].from;if(n>=1)return t[t.length-1].to;let i=Math.floor(e*n);for(let e=0;;e++){let{from:n,to:r}=t[e],o=r-n;if(i<=o)return n+i;i-=o}}function va(e,t){let n=0;for(let{from:i,to:r}of e.ranges){if(t<=r){n+=t-i;break}n+=r-i}return n/e.total}let vu={toDOM:e=>e,fromDOM:e=>e,scale:1,eq(e){return e==this}};function vc(e){let t=e.facet(mB).filter(e=>"function"!=typeof e),n=e.facet(mN).filter(e=>"function"!=typeof e);return n.length&&t.push(f0.join(n)),t}class vh{constructor(e,t,n){let i=0,r=0,o=0;for(let s of(this.viewports=n.map(({from:n,to:r})=>{let o=t.lineAt(n,g2.ByPos,e,0,0).top,s=t.lineAt(r,g2.ByPos,e,0,0).bottom;return i+=s-o,{from:n,to:r,top:o,bottom:s,domTop:0,domBottom:0}}),this.scale=(7e6-i)/(t.height-i),this.viewports))s.domTop=o+(s.top-r)*this.scale,o=s.domBottom=s.domTop+(s.bottom-s.top),r=s.bottom}toDOM(e){for(let t=0,n=0,i=0;;t++){let r=t<this.viewports.length?this.viewports[t]:null;if(!r||e<r.top)return i+(e-n)*this.scale;if(e<=r.bottom)return r.domTop+(e-r.top);n=r.bottom,i=r.domBottom}}fromDOM(e){for(let t=0,n=0,i=0;;t++){let r=t<this.viewports.length?this.viewports[t]:null;if(!r||e<r.domTop)return n+(e-i)/this.scale;if(e<=r.domBottom)return r.top+(e-r.domTop);n=r.bottom,i=r.domBottom}}eq(e){return e instanceof vh&&this.scale==e.scale&&this.viewports.length==e.viewports.length&&this.viewports.every((t,n)=>t.from==e.viewports[n].from&&t.to==e.viewports[n].to)}}function vd(e,t){if(1==t.scale)return e;let n=t.toDOM(e.top),i=t.toDOM(e.bottom);return new g1(e.from,e.length,n,i-n,Array.isArray(e._content)?e._content.map(e=>vd(e,t)):e._content)}let vf=fp.define({combine:e=>e.join(" ")}),vp=fp.define({combine:e=>e.indexOf(!0)>-1}),vm=pl.newName(),vg=pl.newName(),vv=pl.newName(),vb={"&light":"."+vg,"&dark":"."+vv};function vx(e,t,n){return new pl(t,{finish:t=>/&/.test(t)?t.replace(/&\w*/,t=>{if("&"==t)return e;if(!n||!n[t])throw RangeError(`Unsupported selector: ${t}`);return n[t]}):e+" "+t})}let vy=vx("."+vm,{"&":{position:"relative !important",boxSizing:"border-box","&.cm-focused":{outline:"1px dotted #212121"},display:"flex !important",flexDirection:"column"},".cm-scroller":{display:"flex !important",alignItems:"flex-start !important",fontFamily:"monospace",lineHeight:1.4,height:"100%",overflowX:"auto",position:"relative",zIndex:0,overflowAnchor:"none"},".cm-content":{margin:0,flexGrow:2,flexShrink:0,display:"block",whiteSpace:"pre",wordWrap:"normal",boxSizing:"border-box",minHeight:"100%",padding:"4px 0",outline:"none","&[contenteditable=true]":{WebkitUserModify:"read-write-plaintext-only"}},".cm-lineWrapping":{whiteSpace_fallback:"pre-wrap",whiteSpace:"break-spaces",wordBreak:"break-word",overflowWrap:"anywhere",flexShrink:1},"&light .cm-content":{caretColor:"black"},"&dark .cm-content":{caretColor:"white"},".cm-line":{display:"block",padding:"0 2px 0 6px"},".cm-layer":{position:"absolute",left:0,top:0,contain:"size style","& > *":{position:"absolute"}},"&light .cm-selectionBackground":{background:"#d9d9d9"},"&dark .cm-selectionBackground":{background:"#222"},"&light.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#d7d4f0"},"&dark.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#233"},".cm-cursorLayer":{pointerEvents:"none"},"&.cm-focused > .cm-scroller > .cm-cursorLayer":{animation:"steps(1) cm-blink 1.2s infinite"},"@keyframes cm-blink":{"0%":{},"50%":{opacity:0},"100%":{}},"@keyframes cm-blink2":{"0%":{},"50%":{opacity:0},"100%":{}},".cm-cursor, .cm-dropCursor":{borderLeft:"1.2px solid black",marginLeft:"-0.6px",pointerEvents:"none"},".cm-cursor":{display:"none"},"&dark .cm-cursor":{borderLeftColor:"#ddd"},".cm-selectionHandle":{backgroundColor:"currentColor",width:"1.5px"},".cm-selectionHandle-start::before, .cm-selectionHandle-end::before":{content:'""',backgroundColor:"inherit",borderRadius:"50%",width:"8px",height:"8px",position:"absolute",left:"-3.25px"},".cm-selectionHandle-start::before":{top:"-8px"},".cm-selectionHandle-end::before":{bottom:"-8px"},".cm-dropCursor":{position:"absolute"},"&.cm-focused > .cm-scroller > .cm-cursorLayer .cm-cursor":{display:"block"},".cm-iso":{unicodeBidi:"isolate"},".cm-announced":{position:"fixed",top:"-10000px"},"@media print":{".cm-announced":{display:"none"}},"&light .cm-activeLine":{backgroundColor:"#cceeff44"},"&dark .cm-activeLine":{backgroundColor:"#99eeff33"},"&light .cm-specialChar":{color:"red"},"&dark .cm-specialChar":{color:"#f78"},".cm-gutters":{flexShrink:0,display:"flex",height:"100%",boxSizing:"border-box",zIndex:200},".cm-gutters-before":{insetInlineStart:0},".cm-gutters-after":{insetInlineEnd:0},"&light .cm-gutters":{backgroundColor:"#f5f5f5",color:"#6c6c6c",border:"0px solid #ddd","&.cm-gutters-before":{borderRightWidth:"1px"},"&.cm-gutters-after":{borderLeftWidth:"1px"}},"&dark .cm-gutters":{backgroundColor:"#333338",color:"#ccc"},".cm-gutter":{display:"flex !important",flexDirection:"column",flexShrink:0,boxSizing:"border-box",minHeight:"100%",overflow:"hidden"},".cm-gutterElement":{boxSizing:"border-box"},".cm-lineNumbers .cm-gutterElement":{padding:"0 3px 0 5px",minWidth:"20px",textAlign:"right",whiteSpace:"nowrap"},"&light .cm-activeLineGutter":{backgroundColor:"#e2f2ff"},"&dark .cm-activeLineGutter":{backgroundColor:"#222227"},".cm-panels":{boxSizing:"border-box",position:"sticky",left:0,right:0,zIndex:300},"&light .cm-panels":{backgroundColor:"#f5f5f5",color:"black"},"&light .cm-panels-top":{borderBottom:"1px solid #ddd"},"&light .cm-panels-bottom":{borderTop:"1px solid #ddd"},"&dark .cm-panels":{backgroundColor:"#333338",color:"white"},".cm-dialog":{padding:"2px 19px 4px 6px",position:"relative","& label":{fontSize:"80%"}},".cm-dialog-close":{position:"absolute",top:"3px",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",fontSize:"14px",padding:"0"},".cm-tab":{display:"inline-block",overflow:"hidden",verticalAlign:"bottom"},".cm-widgetBuffer":{verticalAlign:"text-top",height:"1em",width:0,display:"inline"},".cm-placeholder":{color:"#888",display:"inline-block",verticalAlign:"top",userSelect:"none"},".cm-highlightSpace":{backgroundImage:"radial-gradient(circle at 50% 55%, #aaa 20%, transparent 5%)",backgroundPosition:"center"},".cm-highlightTab":{backgroundImage:'url(\'data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="200" height="20"><path stroke="%23888" stroke-width="1" fill="none" d="M1 10H196L190 5M190 15L196 10M197 4L197 16"/></svg>\')',backgroundSize:"auto 100%",backgroundPosition:"right 90%",backgroundRepeat:"no-repeat"},".cm-trailingSpace":{backgroundColor:"#ff332255"},".cm-button":{verticalAlign:"middle",color:"inherit",fontSize:"70%",padding:".2em 1em",borderRadius:"1px"},"&light .cm-button":{backgroundImage:"linear-gradient(#eff1f5, #d9d9df)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#b4b4b4, #d0d3d6)"}},"&dark .cm-button":{backgroundImage:"linear-gradient(#393939, #111)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#111, #333)"}},".cm-textfield":{verticalAlign:"middle",color:"inherit",fontSize:"70%",border:"1px solid silver",padding:".2em .5em"},"&light .cm-textfield":{backgroundColor:"white"},"&dark .cm-textfield":{border:"1px solid #555",backgroundColor:"inherit"}},vb),vw={childList:!0,characterData:!0,subtree:!0,attributes:!0,characterDataOldValue:!0},vS=pD.ie&&pD.ie_version<=11;class vC{constructor(e){this.view=e,this.active=!1,this.editContext=null,this.selectionRange=new p0,this.selectionChanged=!1,this.delayedFlush=-1,this.resizeTimeout=-1,this.queue=[],this.delayedAndroidKey=null,this.flushingAndroidKey=-1,this.lastChange=0,this.scrollTargets=[],this.intersection=null,this.resizeScroll=null,this.intersecting=!1,this.gapIntersection=null,this.gaps=[],this.printQuery=null,this.parentCheck=-1,this.dom=e.contentDOM,this.observer=new MutationObserver(t=>{for(let e of t)this.queue.push(e);(pD.ie&&pD.ie_version<=11||pD.ios&&e.composing)&&t.some(e=>"childList"==e.type&&e.removedNodes.length||"characterData"==e.type&&e.oldValue.length>e.target.nodeValue.length)?this.flushSoon():this.flush()}),window.EditContext&&pD.android&&!1!==e.constructor.EDIT_CONTEXT&&!(pD.chrome&&pD.chrome_version<126)&&(this.editContext=new vM(e),e.state.facet(mI)&&(e.contentDOM.editContext=this.editContext.editContext)),vS&&(this.onCharData=e=>{this.queue.push({target:e.target,type:"characterData",oldValue:e.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this),this.onResize=this.onResize.bind(this),this.onPrint=this.onPrint.bind(this),this.onScroll=this.onScroll.bind(this),window.matchMedia&&(this.printQuery=window.matchMedia("print")),"function"==typeof ResizeObserver&&(this.resizeScroll=new ResizeObserver(()=>{var e;(null==(e=this.view.docView)?void 0:e.lastUpdate)<Date.now()-75&&this.onResize()}),this.resizeScroll.observe(e.scrollDOM)),this.addWindowListeners(this.win=e.win),this.start(),"function"==typeof IntersectionObserver&&(this.intersection=new IntersectionObserver(e=>{this.parentCheck<0&&(this.parentCheck=setTimeout(this.listenForScroll.bind(this),1e3)),e.length>0&&e[e.length-1].intersectionRatio>0!=this.intersecting&&(this.intersecting=!this.intersecting,this.intersecting!=this.view.inView&&this.onScrollChanged(document.createEvent("Event")))},{threshold:[0,.001]}),this.intersection.observe(this.dom),this.gapIntersection=new IntersectionObserver(e=>{e.length>0&&e[e.length-1].intersectionRatio>0&&this.onScrollChanged(document.createEvent("Event"))},{})),this.listenForScroll(),this.readSelectionRange()}onScrollChanged(e){this.view.inputState.runHandlers("scroll",e),this.intersecting&&this.view.measure()}onScroll(e){this.intersecting&&this.flush(!1),this.editContext&&this.view.requestMeasure(this.editContext.measureReq),this.onScrollChanged(e)}onResize(){this.resizeTimeout<0&&(this.resizeTimeout=setTimeout(()=>{this.resizeTimeout=-1,this.view.requestMeasure()},50))}onPrint(e){("change"!=e.type&&e.type||e.matches)&&(this.view.viewState.printing=!0,this.view.measure(),setTimeout(()=>{this.view.viewState.printing=!1,this.view.requestMeasure()},500))}updateGaps(e){if(this.gapIntersection&&(e.length!=this.gaps.length||this.gaps.some((t,n)=>t!=e[n]))){for(let t of(this.gapIntersection.disconnect(),e))this.gapIntersection.observe(t);this.gaps=e}}onSelectionChange(e){let t=this.selectionChanged;if(!this.readSelectionRange()||this.delayedAndroidKey)return;let{view:n}=this,i=this.selectionRange;if(n.state.facet(mI)?n.root.activeElement!=this.dom:!p_(this.dom,i))return;let r=i.anchorNode&&n.docView.tile.nearest(i.anchorNode);if(r&&r.isWidget()&&r.widget.ignoreEvent(e)){t||(this.selectionChanged=!1);return}(pD.ie&&pD.ie_version<=11||pD.android&&pD.chrome)&&!n.state.selection.main.empty&&i.focusNode&&pG(i.focusNode,i.focusOffset,i.anchorNode,i.anchorOffset)?this.flushSoon():this.flush(!1)}readSelectionRange(){let{view:e}=this,t=pW(e.root);if(!t)return!1;let n=pD.safari&&11==e.root.nodeType&&e.root.activeElement==this.dom&&function(e,t){if(t.getComposedRanges){let n=t.getComposedRanges(e.root)[0];if(n)return vk(e,n)}let n=null;function i(e){e.preventDefault(),e.stopImmediatePropagation(),n=e.getTargetRanges()[0]}return e.contentDOM.addEventListener("beforeinput",i,!0),e.dom.ownerDocument.execCommand("indent"),e.contentDOM.removeEventListener("beforeinput",i,!0),n?vk(e,n):null}(this.view,t)||t;if(!n||this.selectionRange.eq(n))return!1;let i=p_(this.dom,n);return i&&!this.selectionChanged&&e.inputState.lastFocusTime>Date.now()-200&&e.inputState.lastTouchTime<Date.now()-300&&function(e,t){let n=t.focusNode,i=t.focusOffset;if(!n||t.anchorNode!=n||t.anchorOffset!=i)return!1;for(i=Math.min(i,pX(n));;)if(i){if(1!=n.nodeType)return!1;let e=n.childNodes[i-1];"false"==e.contentEditable?i--:i=pX(n=e)}else{if(n==e)return!0;i=pq(n),n=n.parentNode}}(this.dom,n)?(this.view.inputState.lastFocusTime=0,e.docView.updateSelection(),!1):(this.selectionRange.setRange(n),i&&(this.selectionChanged=!0),!0)}setSelectionRange(e,t){this.selectionRange.set(e.node,e.offset,t.node,t.offset),this.selectionChanged=!1}clearSelectionRange(){this.selectionRange.set(null,0,null,0)}listenForScroll(){this.parentCheck=-1;let e=0,t=null;for(let n=this.dom;n;)if(1==n.nodeType)!t&&e<this.scrollTargets.length&&this.scrollTargets[e]==n?e++:t||(t=this.scrollTargets.slice(0,e)),t&&t.push(n),n=n.assignedSlot||n.parentNode;else if(11==n.nodeType)n=n.host;else break;if(e<this.scrollTargets.length&&!t&&(t=this.scrollTargets.slice(0,e)),t){for(let e of this.scrollTargets)e.removeEventListener("scroll",this.onScroll);for(let e of this.scrollTargets=t)e.addEventListener("scroll",this.onScroll)}}ignore(e){if(!this.active)return e();try{return this.stop(),e()}finally{this.start(),this.clear()}}start(){this.active||(this.observer.observe(this.dom,vw),vS&&this.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.active=!0)}stop(){this.active&&(this.active=!1,this.observer.disconnect(),vS&&this.dom.removeEventListener("DOMCharacterDataModified",this.onCharData))}clear(){this.processRecords(),this.queue.length=0,this.selectionChanged=!1}delayAndroidKey(e,t){var n;if(!this.delayedAndroidKey){let e=()=>{let e=this.delayedAndroidKey;e&&(this.clearDelayedAndroidKey(),this.view.inputState.lastKeyCode=e.keyCode,this.view.inputState.lastKeyTime=Date.now(),!this.flush()&&e.force&&p3(this.dom,e.key,e.keyCode))};this.flushingAndroidKey=this.view.win.requestAnimationFrame(e)}this.delayedAndroidKey&&"Enter"!=e||(this.delayedAndroidKey={key:e,keyCode:t,force:this.lastChange<Date.now()-50||!!(null==(n=this.delayedAndroidKey)?void 0:n.force)})}clearDelayedAndroidKey(){this.win.cancelAnimationFrame(this.flushingAndroidKey),this.delayedAndroidKey=null,this.flushingAndroidKey=-1}flushSoon(){this.delayedFlush<0&&(this.delayedFlush=this.view.win.requestAnimationFrame(()=>{this.delayedFlush=-1,this.flush()}))}forceFlush(){this.delayedFlush>=0&&(this.view.win.cancelAnimationFrame(this.delayedFlush),this.delayedFlush=-1),this.flush()}pendingRecords(){for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}processRecords(){let e=this.pendingRecords();e.length&&(this.queue=[]);let t=-1,n=-1,i=!1;for(let r of e){let e=this.readMutation(r);e&&(e.typeOver&&(i=!0),-1==t?{from:t,to:n}=e:(t=Math.min(e.from,t),n=Math.max(e.to,n)))}return{from:t,to:n,typeOver:i}}readChange(){let{from:e,to:t,typeOver:n}=this.processRecords(),i=this.selectionChanged&&p_(this.dom,this.selectionRange);if(e<0&&!i)return null;e>-1&&(this.lastChange=Date.now()),this.view.inputState.lastFocusTime=0,this.selectionChanged=!1;let r=new gS(this.view,e,t,n);return this.view.docView.domChanged={newSel:r.newSel?r.newSel.main:null},r}flush(e=!0){if(this.delayedFlush>=0||this.delayedAndroidKey)return!1;e&&this.readSelectionRange();let t=this.readChange();if(!t)return this.view.requestMeasure(),!1;let n=this.view.state,i=gC(this.view,t);return this.view.state==n&&(t.domChanged||t.newSel&&!gM(this.view.state.selection,t.newSel.main))&&this.view.update([]),i}readMutation(e){let t=this.view.docView.tile.nearest(e.target);if(!t||t.isWidget())return null;if(t.markDirty("attributes"==e.type),"childList"==e.type){let n=vA(t,e.previousSibling||e.target.previousSibling,-1),i=vA(t,e.nextSibling||e.target.nextSibling,1);return{from:n?t.posAfter(n):t.posAtStart,to:i?t.posBefore(i):t.posAtEnd,typeOver:!1}}return"characterData"==e.type?{from:t.posAtStart,to:t.posAtEnd,typeOver:e.target.nodeValue==e.oldValue}:null}setWindow(e){e!=this.win&&(this.removeWindowListeners(this.win),this.win=e,this.addWindowListeners(this.win))}addWindowListeners(e){e.addEventListener("resize",this.onResize),this.printQuery?this.printQuery.addEventListener?this.printQuery.addEventListener("change",this.onPrint):this.printQuery.addListener(this.onPrint):e.addEventListener("beforeprint",this.onPrint),e.addEventListener("scroll",this.onScroll),e.document.addEventListener("selectionchange",this.onSelectionChange)}removeWindowListeners(e){e.removeEventListener("scroll",this.onScroll),e.removeEventListener("resize",this.onResize),this.printQuery?this.printQuery.removeEventListener?this.printQuery.removeEventListener("change",this.onPrint):this.printQuery.removeListener(this.onPrint):e.removeEventListener("beforeprint",this.onPrint),e.document.removeEventListener("selectionchange",this.onSelectionChange)}update(e){this.editContext&&(this.editContext.update(e),e.startState.facet(mI)!=e.state.facet(mI)&&(e.view.contentDOM.editContext=e.state.facet(mI)?this.editContext.editContext:null))}destroy(){var e,t,n;for(let i of(this.stop(),null==(e=this.intersection)||e.disconnect(),null==(t=this.gapIntersection)||t.disconnect(),null==(n=this.resizeScroll)||n.disconnect(),this.scrollTargets))i.removeEventListener("scroll",this.onScroll);this.removeWindowListeners(this.win),clearTimeout(this.parentCheck),clearTimeout(this.resizeTimeout),this.win.cancelAnimationFrame(this.delayedFlush),this.win.cancelAnimationFrame(this.flushingAndroidKey),this.editContext&&(this.view.contentDOM.editContext=null,this.editContext.destroy())}}function vA(e,t,n){for(;t;){let i=mY.get(t);if(i&&i.parent==e)return i;let r=t.parentNode;t=r!=e.dom?r:n>0?t.nextSibling:t.previousSibling}return null}function vk(e,t){let n=t.startContainer,i=t.startOffset,r=t.endContainer,o=t.endOffset,s=e.docView.domAtPos(e.state.selection.main.anchor,1);return pG(s.node,s.offset,r,o)&&([n,i,r,o]=[r,o,n,i]),{anchorNode:n,anchorOffset:i,focusNode:r,focusOffset:o}}class vM{constructor(e){this.from=0,this.to=0,this.pendingContextChange=null,this.handlers=Object.create(null),this.composing=null,this.resetRange(e.state);let t=this.editContext=new window.EditContext({text:e.state.doc.sliceString(this.from,this.to),selectionStart:this.toContextPos(Math.max(this.from,Math.min(this.to,e.state.selection.main.anchor))),selectionEnd:this.toContextPos(e.state.selection.main.head)});for(let n in this.handlers.textupdate=n=>{let i=e.state.selection.main,{anchor:r,head:o}=i,s=this.toEditorPos(n.updateRangeStart),l=this.toEditorPos(n.updateRangeEnd);e.inputState.composing>=0&&!this.composing&&(this.composing={contextBase:n.updateRangeStart,editorBase:s,drifted:!1});let a=l-s>n.text.length;s==this.from&&r<this.from?s=r:l==this.to&&r>this.to&&(l=r);let u=gk(e.state.sliceDoc(s,l),n.text,(a?i.from:i.to)-s,a?"end":null);if(!u){let t=fh.single(this.toEditorPos(n.selectionStart),this.toEditorPos(n.selectionEnd));gM(t,i)||e.dispatch({selection:t,userEvent:"select"});return}let c={from:u.from+s,to:u.toA+s,insert:dZ.of(n.text.slice(u.from,u.toB).split("\n"))};if((pD.mac||pD.android)&&c.from==o-1&&/^\. ?$/.test(n.text)&&"off"==e.contentDOM.getAttribute("autocorrect")&&(c={from:s,to:l,insert:dZ.of([n.text.replace("."," ")])}),this.pendingContextChange=c,!e.state.readOnly){let t=this.to-this.from+(c.to-c.from+c.insert.length);gA(e,c,fh.single(this.toEditorPos(n.selectionStart,t),this.toEditorPos(n.selectionEnd,t)))}this.pendingContextChange&&(this.revertPending(e.state),this.setSelection(e.state)),c.from<c.to&&!c.insert.length&&e.inputState.composing>=0&&!/[\\p{Alphabetic}\\p{Number}_]/.test(t.text.slice(Math.max(0,n.updateRangeStart-1),Math.min(t.text.length,n.updateRangeStart+1)))&&this.handlers.compositionend(n)},this.handlers.characterboundsupdate=n=>{let i=[],r=null;for(let t=this.toEditorPos(n.rangeStart),o=this.toEditorPos(n.rangeEnd);t<o;t++){let n=e.coordsForChar(t);r=n&&new DOMRect(n.left,n.top,n.right-n.left,n.bottom-n.top)||r||new DOMRect,i.push(r)}t.updateCharacterBounds(n.rangeStart,i)},this.handlers.textformatupdate=t=>{let n=[];for(let e of t.getTextFormats()){let t=e.underlineStyle,i=e.underlineThickness;if(!/none/i.test(t)&&!/none/i.test(i)){let r=this.toEditorPos(e.rangeStart),o=this.toEditorPos(e.rangeEnd);if(r<o){let e=`text-decoration: underline ${/^[a-z]/.test(t)?t+" ":"Dashed"==t?"dashed ":"Squiggle"==t?"wavy ":""}${/thin/i.test(i)?1:2}px`;n.push(pj.mark({attributes:{style:e}}).range(r,o))}}}e.dispatch({effects:mT.of(pj.set(n))})},this.handlers.compositionstart=()=>{e.inputState.composing<0&&(e.inputState.composing=0,e.inputState.compositionFirstChange=!0)},this.handlers.compositionend=()=>{if(e.inputState.composing=-1,e.inputState.compositionFirstChange=null,this.composing){let{drifted:t}=this.composing;this.composing=null,t&&this.reset(e.state)}},this.handlers)t.addEventListener(n,this.handlers[n]);this.measureReq={read:e=>{this.editContext.updateControlBounds(e.contentDOM.getBoundingClientRect());let t=pW(e.root);t&&t.rangeCount&&this.editContext.updateSelectionBounds(t.getRangeAt(0).getBoundingClientRect())}}}applyEdits(e){let t=0,n=!1,i=this.pendingContextChange;return e.changes.iterChanges((r,o,s,l,a)=>{if(n)return;let u=a.length-(o-r);if(i&&o>=i.to)if(i.from==r&&i.to==o&&i.insert.eq(a)){i=this.pendingContextChange=null,t+=u,this.to+=u;return}else i=null,this.revertPending(e.state);if(r+=t,(o+=t)<=this.from)this.from+=u,this.to+=u;else if(r<this.to){if(r<this.from||o>this.to||this.to-this.from+a.length>3e4){n=!0;return}this.editContext.updateText(this.toContextPos(r),this.toContextPos(o),a.toString()),this.to+=u}t+=u}),i&&!n&&this.revertPending(e.state),!n}update(e){let t=this.pendingContextChange,n=e.startState.selection.main;this.composing&&(this.composing.drifted||!e.changes.touchesRange(n.from,n.to)&&e.transactions.some(e=>!e.isUserEvent("input.type")&&e.changes.touchesRange(this.from,this.to)))?(this.composing.drifted=!0,this.composing.editorBase=e.changes.mapPos(this.composing.editorBase)):this.applyEdits(e)&&this.rangeIsValid(e.state)?(e.docChanged||e.selectionSet||t)&&this.setSelection(e.state):(this.pendingContextChange=null,this.reset(e.state)),(e.geometryChanged||e.docChanged||e.selectionSet)&&e.view.requestMeasure(this.measureReq)}resetRange(e){let{head:t}=e.selection.main;this.from=Math.max(0,t-1e4),this.to=Math.min(e.doc.length,t+1e4)}reset(e){this.resetRange(e),this.editContext.updateText(0,this.editContext.text.length,e.doc.sliceString(this.from,this.to)),this.setSelection(e)}revertPending(e){let t=this.pendingContextChange;this.pendingContextChange=null,this.editContext.updateText(this.toContextPos(t.from),this.toContextPos(t.from+t.insert.length),e.doc.sliceString(t.from,t.to))}setSelection(e){let{main:t}=e.selection,n=this.toContextPos(Math.max(this.from,Math.min(this.to,t.anchor))),i=this.toContextPos(t.head);(this.editContext.selectionStart!=n||this.editContext.selectionEnd!=i)&&this.editContext.updateSelection(n,i)}rangeIsValid(e){let{head:t}=e.selection.main;return!(this.from>0&&t-this.from<500||this.to<e.doc.length&&this.to-t<500||this.to-this.from>3e4)}toEditorPos(e,t=this.to-this.from){e=Math.min(e,t);let n=this.composing;return n&&n.drifted?n.editorBase+(e-n.contextBase):e+this.from}toContextPos(e){let t=this.composing;return t&&t.drifted?t.contextBase+(e-t.editorBase):e-this.from}destroy(){for(let e in this.handlers)this.editContext.removeEventListener(e,this.handlers[e])}}class vT{get state(){return this.viewState.state}get viewport(){return this.viewState.viewport}get visibleRanges(){return this.viewState.visibleRanges}get inView(){return this.viewState.inView}get composing(){return!!this.inputState&&this.inputState.composing>0}get compositionStarted(){return!!this.inputState&&this.inputState.composing>=0}get root(){return this._root}get win(){return this.dom.ownerDocument.defaultView||window}constructor(e={}){var t;this.plugins=[],this.pluginMap=new Map,this.editorAttrs={},this.contentAttrs={},this.bidiCache=[],this.destroyed=!1,this.updateState=2,this.measureScheduled=-1,this.measureRequests=[],this.contentDOM=document.createElement("div"),this.scrollDOM=document.createElement("div"),this.scrollDOM.tabIndex=-1,this.scrollDOM.className="cm-scroller",this.scrollDOM.appendChild(this.contentDOM),this.announceDOM=document.createElement("div"),this.announceDOM.className="cm-announced",this.announceDOM.setAttribute("aria-live","polite"),this.dom=document.createElement("div"),this.dom.appendChild(this.announceDOM),this.dom.appendChild(this.scrollDOM),e.parent&&e.parent.appendChild(this.dom);let{dispatch:n}=e;for(let t of(this.dispatchTransactions=e.dispatchTransactions||n&&(e=>e.forEach(e=>n(e,this)))||(e=>this.update(e)),this.dispatch=this.dispatch.bind(this),this._root=e.root||function(e){for(;e;){if(e&&(9==e.nodeType||11==e.nodeType&&e.host))return e;e=e.assignedSlot||e.parentNode}return null}(e.parent)||document,this.viewState=new vo(this,e.state||fq.create(e)),e.scrollTo&&e.scrollTo.is(mM)&&(this.viewState.scrollTarget=e.scrollTo.value.clip(this.viewState.state)),this.plugins=this.state.facet(mE).map(e=>new mP(e)),this.plugins))t.update(this);this.observer=new vC(this),this.inputState=new gT(this),this.inputState.ensureHandlers(this.plugins),this.docView=new gs(this),this.mountStyles(),this.updateAttrs(),this.updateState=0,this.requestMeasure(),(null==(t=document.fonts)?void 0:t.ready)&&document.fonts.ready.then(()=>{this.viewState.mustMeasureContent="refresh",this.requestMeasure()})}dispatch(...e){let t=1==e.length&&e[0]instanceof fH?e:1==e.length&&Array.isArray(e[0])?e[0]:[this.state.update(...e)];this.dispatchTransactions(t,this)}update(e){if(0!=this.updateState)throw Error("Calls to EditorView.update are not allowed while an update is in progress");let t=!1,n=!1,i,r=this.state;for(let t of e){if(t.startState!=r)throw RangeError("Trying to update state with a transaction that doesn't start from the previous state.");r=t.state}if(this.destroyed){this.viewState.state=r;return}let o=this.hasFocus,s=0,l=null;e.some(e=>e.annotation(gq))?(this.inputState.notifiedFocused=o,s=1):o!=this.inputState.notifiedFocused&&(this.inputState.notifiedFocused=o,(l=gY(r,o))||(s=1));let a=this.observer.delayedAndroidKey,u=null;if(a?(this.observer.clearDelayedAndroidKey(),((u=this.observer.readChange())&&!this.state.doc.eq(r.doc)||!this.state.selection.eq(r.selection))&&(u=null)):this.observer.clear(),r.facet(fq.phrases)!=this.state.facet(fq.phrases))return this.setState(r);i=mG.create(this,r,e),i.flags|=s;let c=this.viewState.scrollTarget;try{for(let t of(this.updateState=2,e)){if(c&&(c=c.map(t.changes)),t.scrollIntoView){let{main:e}=t.state.selection,{x:n,y:i}=this.state.facet(vT.cursorScrollMargin);c=new mk(e.empty?e:fh.cursor(e.head,e.head>e.anchor?-1:1),"nearest","nearest",i,n)}for(let e of t.effects)e.is(mM)&&(c=e.value.clip(this.state))}this.viewState.update(i,c),this.bidiCache=vR.update(this.bidiCache,i.changes),i.empty||(this.updatePlugins(i),this.inputState.update(i)),t=this.docView.update(i),this.state.facet(m_)!=this.styleModules&&this.mountStyles(),n=this.updateAttrs(),this.showAnnouncements(e),this.docView.updateSelection(t,e.some(e=>e.isUserEvent("select.pointer")))}finally{this.updateState=0}if(i.startState.facet(vf)!=i.state.facet(vf)&&(this.viewState.mustMeasureContent=!0),(t||n||c||this.viewState.mustEnforceCursorAssoc||this.viewState.mustMeasureContent)&&this.requestMeasure(),t&&this.docViewUpdate(),!i.empty)for(let e of this.state.facet(mv))try{e(i)}catch(e){mD(this.state,e,"update listener")}(l||u)&&Promise.resolve().then(()=>{l&&this.state==l.startState&&this.dispatch(l),u&&!gC(this,u)&&a.force&&p3(this.contentDOM,a.key,a.keyCode)})}setState(e){if(0!=this.updateState)throw Error("Calls to EditorView.setState are not allowed while an update is in progress");if(this.destroyed){this.viewState.state=e;return}this.updateState=2;let t=this.hasFocus;try{for(let e of this.plugins)e.destroy(this);for(let t of(this.viewState=new vo(this,e),this.plugins=e.facet(mE).map(e=>new mP(e)),this.pluginMap.clear(),this.plugins))t.update(this);this.docView.destroy(),this.docView=new gs(this),this.inputState.ensureHandlers(this.plugins),this.mountStyles(),this.updateAttrs(),this.bidiCache=[]}finally{this.updateState=0}t&&this.focus(),this.requestMeasure()}updatePlugins(e){let t=e.startState.facet(mE),n=e.state.facet(mE);if(t!=n){let i=[];for(let r of n){let n=t.indexOf(r);if(n<0)i.push(new mP(r));else{let t=this.plugins[n];t.mustUpdate=e,i.push(t)}}for(let t of this.plugins)t.mustUpdate!=e&&t.destroy(this);this.plugins=i,this.pluginMap.clear()}else for(let t of this.plugins)t.mustUpdate=e;for(let e=0;e<this.plugins.length;e++)this.plugins[e].update(this);t!=n&&this.inputState.ensureHandlers(this.plugins)}docViewUpdate(){for(let e of this.plugins){let t=e.value;if(t&&t.docViewUpdate)try{t.docViewUpdate(this)}catch(e){mD(this.state,e,"doc view update listener")}}}measure(e=!0){if(this.destroyed)return;if(this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.observer.delayedAndroidKey){this.measureScheduled=-1,this.requestMeasure();return}this.measureScheduled=0,e&&this.observer.forceFlush();let t=null,n=this.viewState.scrollParent,i=this.viewState.getScrollOffset(),{scrollAnchorPos:r,scrollAnchorHeight:o}=this.viewState;Math.abs(i-this.viewState.scrollOffset)>1&&(o=-1),this.viewState.scrollAnchorHeight=-1;try{for(let e=0;;e++){if(o<0)if(p4(n||this.win))r=-1,o=this.viewState.heightMap.height;else{let e=this.viewState.scrollAnchorAt(i);r=e.from,o=e.top}this.updateState=1;let s=this.viewState.measure();if(!s&&!this.measureRequests.length&&null==this.viewState.scrollTarget)break;if(e>5){console.warn(this.measureRequests.length?"Measure loop restarted more than 5 times":"Viewport failed to stabilize");break}let l=[];4&s||([this.measureRequests,l]=[l,this.measureRequests]);let a=l.map(e=>{try{return e.read(this)}catch(e){return mD(this.state,e),vI}}),u=mG.create(this,this.state,[]),c=!1;u.flags|=s,t?t.flags|=s:t=u,this.updateState=2,!u.empty&&(this.updatePlugins(u),this.inputState.update(u),this.updateAttrs(),(c=this.docView.update(u))&&this.docViewUpdate());for(let e=0;e<l.length;e++)if(a[e]!=vI)try{let t=l[e];t.write&&t.write(a[e],this)}catch(e){mD(this.state,e)}if(c&&this.docView.updateSelection(!0),!u.viewportChanged&&0==this.measureRequests.length){if(this.viewState.editorHeight)if(this.viewState.scrollTarget){this.docView.scrollIntoView(this.viewState.scrollTarget),this.viewState.scrollTarget=null,o=-1;continue}else{let e=((r<0?this.viewState.heightMap.height:this.viewState.lineBlockAt(r).top)-o)/this.scaleY;if((e>1||e<-1)&&(n==this.scrollDOM||this.hasFocus||Math.max(this.inputState.lastWheelEvent,this.inputState.lastTouchTime)>Date.now()-100)){i+=e,n?n.scrollTop+=e:this.win.scrollBy(0,e),o=-1;continue}}break}}}finally{this.updateState=0,this.measureScheduled=-1}if(t&&!t.empty)for(let e of this.state.facet(mv))e(t)}get themeClasses(){return vm+" "+(this.state.facet(vp)?vv:vg)+" "+this.state.facet(vf)}updateAttrs(){let e=vE(this,mL,{class:"cm-editor"+(this.hasFocus?" cm-focused ":" ")+this.themeClasses}),t={spellcheck:"false",autocorrect:"off",autocapitalize:"off",writingsuggestions:"false",translate:"no",contenteditable:this.state.facet(mI)?"true":"false",class:"cm-content",style:`${pD.tabSize}: ${this.state.tabSize}`,role:"textbox","aria-multiline":"true"};this.state.readOnly&&(t["aria-readonly"]="true"),vE(this,mj,t);let n=this.observer.ignore(()=>{let n=pO(this.contentDOM,this.contentAttrs,t),i=pO(this.dom,this.editorAttrs,e);return n||i});return this.editorAttrs=e,this.contentAttrs=t,n}showAnnouncements(e){let t=!0;for(let n of e)for(let e of n.effects)e.is(vT.announce)&&(t&&(this.announceDOM.textContent=""),t=!1,this.announceDOM.appendChild(document.createElement("div")).textContent=e.value)}mountStyles(){this.styleModules=this.state.facet(m_);let e=this.state.facet(vT.cspNonce);pl.mount(this.root,this.styleModules.concat(vy).reverse(),e?{nonce:e}:void 0)}readMeasured(){if(2==this.updateState)throw Error("Reading the editor layout isn't allowed during an update");0==this.updateState&&this.measureScheduled>-1&&this.measure(!1)}requestMeasure(e){if((this.measureScheduled<0&&(this.measureScheduled=this.win.requestAnimationFrame(()=>this.measure())),e)&&!(this.measureRequests.indexOf(e)>-1)){if(null!=e.key){for(let t=0;t<this.measureRequests.length;t++)if(this.measureRequests[t].key===e.key){this.measureRequests[t]=e;return}}this.measureRequests.push(e)}}plugin(e){let t=this.pluginMap.get(e);return(void 0===t||t&&t.plugin!=e)&&this.pluginMap.set(e,t=this.plugins.find(t=>t.plugin==e)||null),t&&t.update(this).value}get documentTop(){return this.contentDOM.getBoundingClientRect().top+this.viewState.paddingTop}get documentPadding(){return{top:this.viewState.paddingTop,bottom:this.viewState.paddingBottom}}get scaleX(){return this.viewState.scaleX}get scaleY(){return this.viewState.scaleY}elementAtHeight(e){return this.readMeasured(),this.viewState.elementAtHeight(e)}lineBlockAtHeight(e){return this.readMeasured(),this.viewState.lineBlockAtHeight(e)}get viewportLineBlocks(){return this.viewState.viewportLines}lineBlockAt(e){return this.viewState.lineBlockAt(e)}get contentHeight(){return this.viewState.contentHeight}moveByChar(e,t,n){return gg(this,e,gf(this,e,t,n))}moveByGroup(e,t){return gg(this,e,gf(this,e,t,t=>{var n;let i,r;return n=e.head,r=(i=this.state.charCategorizer(n))(t),e=>{let t=i(e);return r==fU.Space&&(r=t),r==t}}))}visualLineSide(e,t){let n=this.bidiSpans(e),i=this.textDirectionAt(e.from),r=n[t?n.length-1:0];return fh.cursor(r.side(t,i)+e.from,r.forward(!t,i)?1:-1)}moveToLineBoundary(e,t,n=!0){return function(e,t,n,i){let r=gd(e,t.head,t.assoc||-1),o=i&&r.type==pL.Text&&(e.lineWrapping||r.widgetLineBreaks)?e.coordsAtPos(t.assoc<0&&t.head>r.from?t.head-1:t.head):null;if(o){let t=e.dom.getBoundingClientRect(),i=e.textDirectionAt(r.from),s=e.posAtCoords({x:n==(i==p7.LTR)?t.right-1:t.left+1,y:(o.top+o.bottom)/2});if(null!=s)return fh.cursor(s,n?-1:1)}return fh.cursor(n?r.to:r.from,n?-1:1)}(this,e,t,n)}moveVertically(e,t,n){return gg(this,e,function(e,t,n,i){let r=t.head,o=n?1:-1;if(r==(n?e.state.doc.length:0))return fh.cursor(r,t.assoc);let s=t.goalColumn,l,a=e.contentDOM.getBoundingClientRect(),u=e.coordsAtPos(r,t.assoc||((t.empty?n:t.head==t.from)?1:-1)),c=e.documentTop;if(u)null==s&&(s=u.left-a.left),l=o<0?u.top:u.bottom;else{let t=e.viewState.lineBlockAt(r);null==s&&(s=Math.min(a.right-a.left,e.defaultCharacterWidth*(r-t.from))),l=(o<0?t.top:t.bottom)+c}let h=a.left+s,d=e.viewState.heightOracle.textHeight>>1,f=null!=i?i:d;for(let t=0;;t+=d){let i=l+(f+t)*o,r=gb(e,{x:h,y:i},!1,o);if(n?i>a.bottom:i<a.top)return fh.cursor(r.pos,r.assoc);let u=e.coordsAtPos(r.pos,r.assoc),c=u?(u.top+u.bottom)/2:0;if(!u||(n?c>l:c<l))return fh.cursor(r.pos,r.assoc,void 0,s)}}(this,e,t,n))}domAtPos(e,t=1){return this.docView.domAtPos(e,t)}posAtDOM(e,t=0){return this.docView.posFromDOM(e,t)}posAtCoords(e,t=!0){this.readMeasured();let n=gb(this,e,t);return n&&n.pos}posAndSideAtCoords(e,t=!0){return this.readMeasured(),gb(this,e,t)}coordsAtPos(e,t=1){this.readMeasured();let n=this.docView.coordsAt(e,t);if(!n||n.left==n.right)return n;let i=this.state.doc.lineAt(e),r=this.bidiSpans(i);return pZ(n,r[mu.find(r,e-i.from,-1,t)].dir==p7.LTR==t>0)}coordsForChar(e){return this.readMeasured(),this.docView.coordsForChar(e)}get defaultCharacterWidth(){return this.viewState.heightOracle.charWidth}get defaultLineHeight(){return this.viewState.heightOracle.lineHeight}get textDirection(){return this.viewState.defaultTextDirection}textDirectionAt(e){return!this.state.facet(mS)||e<this.viewport.from||e>this.viewport.to?this.textDirection:(this.readMeasured(),this.docView.textDirectionAt(e))}get lineWrapping(){return this.viewState.heightOracle.lineWrapping}bidiSpans(e){if(e.length>vD)return mh(e.length);let t=this.textDirectionAt(e.from),n;for(let i of this.bidiCache)if(i.from==e.from&&i.dir==t&&(i.fresh||function e(t,n){if(t.length!=n.length)return!1;for(let i=0;i<t.length;i++){let r=t[i],o=n[i];if(r.from!=o.from||r.to!=o.to||r.direction!=o.direction||!e(r.inner,o.inner))return!1}return!0}(i.isolates,n=mz(this,e))))return i.order;n||(n=mz(this,e));let i=function(e,t,n){if(!e)return[new mu(0,0,+(t==mt))];if(t==me&&!n.length&&!ma.test(e))return mh(e.length);if(n.length)for(;e.length>mc.length;)mc[mc.length]=256;let i=[],r=+(t!=me);return function e(t,n,i,r,o,s,l){let a=n%2?2:1;!function(e,t,n,i,r){for(let o=0;o<=i.length;o++){let s=o?i[o-1].to:t,l=o<i.length?i[o].from:n,a=o?256:r;for(let t=s,n=a,i=a;t<l;t++){let r=ml(e.charCodeAt(t));512==r?r=n:8==r&&4==i&&(r=16),mc[t]=4==r?2:r,7&r&&(i=r),n=r}for(let e=s,t=a,i=a;e<l;e++){let r=mc[e];if(128==r)e<l-1&&t==mc[e+1]&&24&t?r=mc[e]=t:mc[e]=256;else if(64==r){let r=e+1;for(;r<l&&64==mc[r];)r++;let o=e&&8==t||r<n&&8==mc[r]?1==i?1:8:256;for(let t=e;t<r;t++)mc[t]=o;e=r-1}else 8==r&&1==i&&(mc[e]=1);t=r,7&r&&(i=r)}}}(t,o,s,r,a),function(e,t,n,i,r){let o=1==r?2:1;for(let s=0,l=0,a=0;s<=i.length;s++){let u=s?i[s-1].to:t,c=s<i.length?i[s].from:n;for(let t=u,n,i,s;t<c;t++)if(i=mo[n=e.charCodeAt(t)])if(i<0){for(let e=l-3;e>=0;e-=3)if(ms[e+1]==-i){let n=ms[e+2],i=2&n?r:4&n?1&n?o:r:0;i&&(mc[t]=mc[ms[e]]=i),l=e;break}}else if(189==ms.length)break;else ms[l++]=t,ms[l++]=n,ms[l++]=a;else if(2==(s=mc[t])||1==s){let e=s==r;a=+!e;for(let t=l-3;t>=0;t-=3){let n=ms[t+2];if(2&n)break;if(e)ms[t+2]|=2;else{if(4&n)break;ms[t+2]|=4}}}}}(t,o,s,r,a),function(e,t,n,i){for(let r=0,o=i;r<=n.length;r++){let s=r?n[r-1].to:e,l=r<n.length?n[r].from:t;for(let a=s;a<l;){let s=mc[a];if(256==s){let s=a+1;for(;;)if(s==l){if(r==n.length)break;s=n[r++].to,l=r<n.length?n[r].from:t}else if(256==mc[s])s++;else break;let u=1==o,c=u==((s<t?mc[s]:i)==1)?u?1:2:i;for(let t=s,i=r,o=i?n[i-1].to:e;t>a;)t==o&&(t=n[--i].from,o=i?n[i-1].to:e),mc[--t]=c;a=s}else o=s,a++}}}(o,s,r,a),function t(n,i,r,o,s,l,a){let u=o%2?2:1;if(o%2==s%2)for(let c=i,h=0;c<r;){let i=!0,d=!1;if(h==l.length||c<l[h].from){let e=mc[c];e!=u&&(i=!1,d=16==e)}let f=i||1!=u?null:[],p=i?o:o+1,m=c;n:for(;;)if(h<l.length&&m==l[h].from){if(d)break;let t=l[h];if(!i)for(let e=t.to,n=h+1;;){if(e==r)break n;if(n<l.length&&l[n].from==e)e=l[n++].to;else if(mc[e]==u)break n;else break}h++,f?f.push(t):(t.from>c&&a.push(new mu(c,t.from,p)),e(n,t.direction==me!=!(p%2)?o+1:o,s,t.inner,t.from,t.to,a),c=t.to),m=t.to}else if(m==r||(i?mc[m]!=u:mc[m]==u))break;else m++;f?t(n,c,m,o+1,s,f,a):c<m&&a.push(new mu(c,m,p)),c=m}else for(let c=r,h=l.length;c>i;){let r=!0,d=!1;if(!h||c>l[h-1].to){let e=mc[c-1];e!=u&&(r=!1,d=16==e)}let f=r||1!=u?null:[],p=r?o:o+1,m=c;n:for(;;)if(h&&m==l[h-1].to){if(d)break;let t=l[--h];if(!r)for(let e=t.from,n=h;;){if(e==i)break n;if(n&&l[n-1].to==e)e=l[--n].from;else if(mc[e-1]==u)break n;else break}f?f.push(t):(t.to<c&&a.push(new mu(t.to,c,p)),e(n,t.direction==me!=!(p%2)?o+1:o,s,t.inner,t.from,t.to,a),c=t.from),m=t.from}else if(m==i||(r?mc[m-1]!=u:mc[m-1]==u))break;else m--;f?t(n,m,c,o+1,s,f,a):m<c&&a.push(new mu(m,c,p)),c=m}}(t,o,s,n,i,r,l)}(e,r,r,n,0,e.length,i),i}(e.text,t,n);return this.bidiCache.push(new vR(e.from,e.to,t,n,!0,i)),i}get hasFocus(){var e;return(this.dom.ownerDocument.hasFocus()||pD.safari&&(null==(e=this.inputState)?void 0:e.lastContextMenu)>Date.now()-3e4)&&this.root.activeElement==this.contentDOM}focus(){this.observer.ignore(()=>{p2(this.contentDOM),this.docView.updateSelection()})}setRoot(e){this._root!=e&&(this._root=e,this.observer.setWindow((9==e.nodeType?e:e.ownerDocument).defaultView||window),this.mountStyles())}destroy(){for(let e of(this.root.activeElement==this.contentDOM&&this.contentDOM.blur(),this.plugins))e.destroy(this);this.plugins=[],this.inputState.destroy(),this.docView.destroy(),this.dom.remove(),this.observer.destroy(),this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.destroyed=!0}static scrollIntoView(e,t={}){var n,i,r,o;return mM.of(new mk("number"==typeof e?fh.cursor(e):e,null!=(n=t.y)?n:"nearest",null!=(i=t.x)?i:"nearest",null!=(r=t.yMargin)?r:5,null!=(o=t.xMargin)?o:5))}scrollSnapshot(){let{scrollTop:e,scrollLeft:t}=this.scrollDOM,n=this.viewState.scrollAnchorAt(e);return mM.of(new mk(fh.cursor(n.from),"start","start",n.top-e,t,!0))}setTabFocusMode(e){null==e?this.inputState.tabFocusMode=this.inputState.tabFocusMode<0?0:-1:"boolean"==typeof e?this.inputState.tabFocusMode=e?0:-1:0!=this.inputState.tabFocusMode&&(this.inputState.tabFocusMode=Date.now()+e)}static domEventHandlers(e){return mO.define(()=>({}),{eventHandlers:e})}static domEventObservers(e){return mO.define(()=>({}),{eventObservers:e})}static theme(e,t){let n=pl.newName(),i=[vf.of(n),m_.of(vx(`.${n}`,e))];return t&&t.dark&&i.push(vp.of(!0)),i}static baseTheme(e){return fS.lowest(m_.of(vx("."+vm,e,vb)))}static findFromDOM(e){var t;let n=e.querySelector(".cm-content"),i=n&&mY.get(n)||mY.get(e);return(null==(t=null==i?void 0:i.root)?void 0:t.view)||null}}vT.styleModule=m_,vT.inputHandler=mb,vT.clipboardInputFilter=my,vT.clipboardOutputFilter=mw,vT.scrollHandler=mA,vT.focusChangeEffect=mx,vT.perLineTextDirection=mS,vT.exceptionSink=mg,vT.updateListener=mv,vT.editable=mI,vT.mouseSelectionStyle=mm,vT.dragMovesSelection=mp,vT.clickAddsSelectionRange=mf,vT.decorations=mB,vT.blockWrappers=mF,vT.outerDecorations=mN,vT.atomicRanges=mV,vT.bidiIsolatedRanges=mH,vT.cursorScrollMargin=fp.define({combine:e=>{let t=5,n=5;for(let i of e)"number"==typeof i?t=n=i:{x:t,y:n}=i;return{x:t,y:n}}}),vT.scrollMargins=mW,vT.darkTheme=vp,vT.cspNonce=fp.define({combine:e=>e.length?e[0]:""}),vT.contentAttributes=mj,vT.editorAttributes=mL,vT.lineWrapping=vT.contentAttributes.of({class:"cm-lineWrapping"}),vT.announce=fV.define();let vD=4096,vI={};class vR{constructor(e,t,n,i,r,o){this.from=e,this.to=t,this.dir=n,this.isolates=i,this.fresh=r,this.order=o}static update(e,t){if(t.empty&&!e.some(e=>e.fresh))return e;let n=[],i=e.length?e[e.length-1].dir:p7.LTR;for(let r=Math.max(0,e.length-10);r<e.length;r++){let o=e[r];o.dir!=i||t.touchesRange(o.from,o.to)||n.push(new vR(t.mapPos(o.from,1),t.mapPos(o.to,-1),o.dir,o.isolates,!1,o.order))}return n}}function vE(e,t,n){for(let i=e.state.facet(t),r=i.length-1;r>=0;r--){let t=i[r],o="function"==typeof t?t(e):t;o&&pI(o,n)}return n}let vO=pD.mac?"mac":pD.windows?"win":pD.linux?"linux":"key";function vP(e,t,n){return t.altKey&&(e="Alt-"+e),t.ctrlKey&&(e="Ctrl-"+e),t.metaKey&&(e="Meta-"+e),!1!==n&&t.shiftKey&&(e="Shift-"+e),e}let vL=fS.default(vT.domEventHandlers({keydown:(e,t)=>vH(vF(t.state),e,t,"editor")})),vj=fp.define({enables:vL}),vB=new WeakMap;function vF(e){let t=e.facet(vj),n=vB.get(t);return n||vB.set(t,n=function(e,t=vO){let n=Object.create(null),i=Object.create(null),r=(e,t)=>{let n=i[e];if(null==n)i[e]=t;else if(n!=t)throw Error("Key binding "+e+" is used both as a regular binding and as a multi-stroke prefix")},o=(e,i,o,s,l)=>{var a,u;let c=n[e]||(n[e]=Object.create(null)),h=i.split(/ (?!$)/).map(e=>(function(e,t){let n,i,r,o,s=e.split(/-(?!$)/),l=s[s.length-1];"Space"==l&&(l=" ");for(let e=0;e<s.length-1;++e){let l=s[e];if(/^(cmd|meta|m)$/i.test(l))o=!0;else if(/^a(lt)?$/i.test(l))n=!0;else if(/^(c|ctrl|control)$/i.test(l))i=!0;else if(/^s(hift)?$/i.test(l))r=!0;else if(/^mod$/i.test(l))"mac"==t?o=!0:i=!0;else throw Error("Unrecognized modifier name: "+l)}return n&&(l="Alt-"+l),i&&(l="Ctrl-"+l),o&&(l="Meta-"+l),r&&(l="Shift-"+l),l})(e,t));for(let t=1;t<h.length;t++){let n=h.slice(0,t).join(" ");r(n,!0),c[n]||(c[n]={preventDefault:!0,stopPropagation:!1,run:[t=>{let i=vN={view:t,prefix:n,scope:e};return setTimeout(()=>{vN==i&&(vN=null)},4e3),!0}]})}let d=h.join(" ");r(d,!1);let f=c[d]||(c[d]={preventDefault:!1,stopPropagation:!1,run:(null==(u=null==(a=c._any)?void 0:a.run)?void 0:u.slice())||[]});o&&f.run.push(o),s&&(f.preventDefault=!0),l&&(f.stopPropagation=!0)};for(let i of e){let e=i.scope?i.scope.split(" "):["editor"];if(i.any)for(let t of e){let e=n[t]||(n[t]=Object.create(null));e._any||(e._any={preventDefault:!1,stopPropagation:!1,run:[]});let{any:r}=i;for(let t in e)e[t].run.push(e=>r(e,vV))}let r=i[t]||i.key;if(r)for(let t of e)o(t,r,i.run,i.preventDefault,i.stopPropagation),i.shift&&o(t,"Shift-"+r,i.shift,i.preventDefault,i.stopPropagation)}return n}(t.reduce((e,t)=>e.concat(t),[]))),n}let vN=null,vV=null;function vH(e,t,n,i){var r;vV=t;let o=("Esc"==(r=!(pd&&t.metaKey&&t.shiftKey&&!t.ctrlKey&&!t.altKey||pf&&t.shiftKey&&t.key&&1==t.key.length||"Unidentified"==t.key)&&t.key||(t.shiftKey?ph:pc)[t.keyCode]||t.key||"Unidentified")&&(r="Escape"),"Del"==r&&(r="Delete"),"Left"==r&&(r="ArrowLeft"),"Up"==r&&(r="ArrowUp"),"Right"==r&&(r="ArrowRight"),"Down"==r&&(r="ArrowDown"),r),s=d7(d8(o,0))==o.length&&" "!=o,l="",a=!1,u=!1,c=!1;vN&&vN.view==n&&vN.scope==i&&(l=vN.prefix+" ",0>gE.indexOf(t.keyCode)&&(u=!0,vN=null));let h=new Set,d=e=>{if(e){for(let t of e.run)if(!h.has(t)&&(h.add(t),t(n)))return e.stopPropagation&&(c=!0),!0;e.preventDefault&&(e.stopPropagation&&(c=!0),u=!0)}return!1},f=e[i],p,m;return f&&(d(f[l+vP(o,t,!s)])?a=!0:s&&(t.altKey||t.metaKey||t.ctrlKey)&&!(pD.windows&&t.ctrlKey&&t.altKey)&&!(pD.mac&&t.altKey&&!(t.ctrlKey||t.metaKey))&&(p=pc[t.keyCode])&&p!=o?d(f[l+vP(p,t,!0)])?a=!0:t.shiftKey&&(m=ph[t.keyCode])!=o&&m!=p&&d(f[l+vP(m,t,!1)])&&(a=!0):s&&t.shiftKey&&d(f[l+vP(o,t,!0)])&&(a=!0),!a&&d(f._any)&&(a=!0)),u&&(a=!0),a&&c&&t.stopPropagation(),vV=null,a}class vz{constructor(e,t,n,i,r){this.className=e,this.left=t,this.top=n,this.width=i,this.height=r}draw(){let e=document.createElement("div");return e.className=this.className,this.adjust(e),e}update(e,t){return t.className==this.className&&(this.adjust(e),!0)}adjust(e){e.style.left=this.left+"px",e.style.top=this.top+"px",null!=this.width&&(e.style.width=this.width+"px"),e.style.height=this.height+"px"}eq(e){return this.left==e.left&&this.top==e.top&&this.width==e.width&&this.height==e.height&&this.className==e.className}static forRange(e,t,n){if(!n.empty)return function(e,t,n){if(n.to<=e.viewport.from||n.from>=e.viewport.to)return[];let i=Math.max(n.from,e.viewport.from),r=Math.min(n.to,e.viewport.to),o=e.textDirection==p7.LTR,s=e.contentDOM,l=s.getBoundingClientRect(),a=vW(e),u=s.querySelector(".cm-line"),c=u&&window.getComputedStyle(u),h=l.left+(c?parseInt(c.paddingLeft)+Math.min(0,parseInt(c.textIndent)):0),d=l.right-(c?parseInt(c.paddingRight):0),f=gd(e,i,1),p=gd(e,r,-1),m=f.type==pL.Text?f:null,g=p.type==pL.Text?p:null;if(m&&(e.lineWrapping||f.widgetLineBreaks)&&(m=v$(e,i,1,m)),g&&(e.lineWrapping||p.widgetLineBreaks)&&(g=v$(e,r,-1,g)),m&&g&&m.from==g.from&&m.to==g.to)return b(x(n.from,n.to,m));{let t=m?x(n.from,null,m):y(f,!1),i=g?x(null,n.to,g):y(p,!0),r=[];return(m||f).to<(g||p).from-(m&&g?1:0)||f.widgetLineBreaks>1&&t.bottom+e.defaultLineHeight/2<i.top?r.push(v(h,t.bottom,d,i.top)):t.bottom<i.top&&e.elementAtHeight((t.bottom+i.top)/2).type==pL.Text&&(t.bottom=i.top=(t.bottom+i.top)/2),b(t).concat(r).concat(b(i))}function v(e,n,i,r){return new vz(t,e-a.left,n-a.top,Math.max(0,i-e),r-n)}function b({top:e,bottom:t,horizontal:n}){let i=[];for(let r=0;r<n.length;r+=2)i.push(v(n[r],e,n[r+1],t));return i}function x(t,n,i){let r=1e9,s=-1e9,l=[];function a(t,n,a,u,c){let f=e.coordsAtPos(t,t==i.to?-2:2),p=e.coordsAtPos(a,a==i.from?2:-2);f&&p&&(r=Math.min(f.top,p.top,r),s=Math.max(f.bottom,p.bottom,s),c==p7.LTR?l.push(o&&n?h:f.left,o&&u?d:p.right):l.push(!o&&u?h:p.left,!o&&n?d:f.right))}let u=null!=t?t:i.from,c=null!=n?n:i.to;for(let i of e.visibleRanges)if(i.to>u&&i.from<c)for(let r=Math.max(i.from,u),o=Math.min(i.to,c);;){let i=e.state.doc.lineAt(r);for(let s of e.bidiSpans(i)){let e=s.from+i.from,l=s.to+i.from;if(e>=o)break;l>r&&a(Math.max(e,r),null==t&&e<=u,Math.min(l,o),null==n&&l>=c,s.dir)}if((r=i.to+1)>=o)break}return 0==l.length&&a(u,null==t,c,null==n,e.textDirection),{top:r,bottom:s,horizontal:l}}function y(e,t){let n=l.top+(t?e.top:e.bottom);return{top:n,bottom:n,horizontal:[]}}}(e,t,n);{let i=e.coordsAtPos(n.head,n.assoc||1);if(!i)return[];let r=vW(e);return[new vz(t,i.left-r.left,i.top-r.top,null,i.bottom-i.top)]}}}function vW(e){let t=e.scrollDOM.getBoundingClientRect();return{left:(e.textDirection==p7.LTR?t.left:t.right-e.scrollDOM.clientWidth*e.scaleX)-e.scrollDOM.scrollLeft*e.scaleX,top:t.top-e.scrollDOM.scrollTop*e.scaleY}}function v$(e,t,n,i){let r=e.coordsAtPos(t,2*n);if(!r)return i;let o=e.dom.getBoundingClientRect(),s=(r.top+r.bottom)/2,l=e.posAtCoords({x:o.left+1,y:s}),a=e.posAtCoords({x:o.right-1,y:s});return null==l||null==a?i:{from:Math.max(i.from,Math.min(l,a)),to:Math.min(i.to,Math.max(l,a))}}class v_{constructor(e,t){this.view=e,this.layer=t,this.drawn=[],this.scaleX=1,this.scaleY=1,this.measureReq={read:this.measure.bind(this),write:this.draw.bind(this)},this.dom=e.scrollDOM.appendChild(document.createElement("div")),this.dom.classList.add("cm-layer"),t.above&&this.dom.classList.add("cm-layer-above"),t.class&&this.dom.classList.add(t.class),this.scale(),this.dom.setAttribute("aria-hidden","true"),this.setOrder(e.state),e.requestMeasure(this.measureReq),t.mount&&t.mount(this.dom,e)}update(e){e.startState.facet(vU)!=e.state.facet(vU)&&this.setOrder(e.state),(this.layer.update(e,this.dom)||e.geometryChanged)&&(this.scale(),e.view.requestMeasure(this.measureReq))}docViewUpdate(e){!1!==this.layer.updateOnDocViewUpdate&&e.requestMeasure(this.measureReq)}setOrder(e){let t=0,n=e.facet(vU);for(;t<n.length&&n[t]!=this.layer;)t++;this.dom.style.zIndex=String((this.layer.above?150:-1)-t)}measure(){return this.layer.markers(this.view)}scale(){let{scaleX:e,scaleY:t}=this.view;(e!=this.scaleX||t!=this.scaleY)&&(this.scaleX=e,this.scaleY=t,this.dom.style.transform=`scale(${1/e}, ${1/t})`)}draw(e){if(e.length!=this.drawn.length||e.some((e,t)=>{var n;return n=this.drawn[t],!(e.constructor==n.constructor&&e.eq(n))})){let t=this.dom.firstChild,n=0;for(let i of e)i.update&&t&&i.constructor&&this.drawn[n].constructor&&i.update(t,this.drawn[n])?(t=t.nextSibling,n++):this.dom.insertBefore(i.draw(),t);for(;t;){let e=t.nextSibling;t.remove(),t=e}this.drawn=e,pD.webkit&&(this.dom.style.display=this.dom.firstChild?"":"none")}}destroy(){this.layer.destroy&&this.layer.destroy(this.dom,this.view),this.dom.remove()}}let vU=fp.define();function vG(e){return[mO.define(t=>new v_(t,e)),vU.of(e)]}let vq=fp.define({combine:e=>fY(e,{cursorBlinkRate:1200,drawRangeCursor:!0,iosSelectionHandles:!0},{cursorBlinkRate:(e,t)=>Math.min(e,t),drawRangeCursor:(e,t)=>e||t})});function vY(e){return e.startState.facet(vq)!=e.state.facet(vq)}let vK=vG({above:!0,markers(e){let{state:t}=e,n=t.facet(vq),i=[];for(let r of t.selection.ranges){let o=r==t.selection.main;if(r.empty||n.drawRangeCursor&&!(o&&pD.ios&&n.iosSelectionHandles)){let t=o?"cm-cursor cm-cursor-primary":"cm-cursor cm-cursor-secondary",n=r.empty?r:fh.cursor(r.head,r.assoc);for(let r of vz.forRange(e,t,n))i.push(r)}}return i},update(e,t){e.transactions.some(e=>e.selection)&&(t.style.animationName="cm-blink"==t.style.animationName?"cm-blink2":"cm-blink");let n=vY(e);return n&&vX(e.state,t),e.docChanged||e.selectionSet||n},mount(e,t){vX(t.state,e)},class:"cm-cursorLayer"});function vX(e,t){t.style.animationDuration=e.facet(vq).cursorBlinkRate+"ms"}let vZ=vG({above:!1,markers(e){let t=[],{main:n,ranges:i}=e.state.selection;for(let n of i)if(!n.empty)for(let i of vz.forRange(e,"cm-selectionBackground",n))t.push(i);if(pD.ios&&!n.empty&&e.state.facet(vq).iosSelectionHandles){for(let i of vz.forRange(e,"cm-selectionHandle cm-selectionHandle-start",fh.cursor(n.from,1)))t.push(i);for(let i of vz.forRange(e,"cm-selectionHandle cm-selectionHandle-end",fh.cursor(n.to,1)))t.push(i)}return t},update:(e,t)=>e.docChanged||e.selectionSet||e.viewportChanged||vY(e),class:"cm-selectionLayer"}),vQ=fS.highest(vT.theme({".cm-line":{"& ::selection, &::selection":{backgroundColor:"transparent !important"},caretColor:"transparent !important"},".cm-content":{caretColor:"transparent !important","& :focus":{caretColor:"initial !important","&::selection, & ::selection":{backgroundColor:"Highlight !important"}}}})),vJ=fV.define({map:(e,t)=>null==e?null:t.mapPos(e)}),v0=fy.define({create:()=>null,update:(e,t)=>(null!=e&&(e=t.changes.mapPos(e)),t.effects.reduce((e,t)=>t.is(vJ)?t.value:e,e))}),v1=mO.fromClass(class{constructor(e){this.view=e,this.cursor=null,this.measureReq={read:this.readPos.bind(this),write:this.drawCursor.bind(this)}}update(e){var t;let n=e.state.field(v0);null==n?null!=this.cursor&&(null==(t=this.cursor)||t.remove(),this.cursor=null):(this.cursor||(this.cursor=this.view.scrollDOM.appendChild(document.createElement("div")),this.cursor.className="cm-dropCursor"),(e.startState.field(v0)!=n||e.docChanged||e.geometryChanged)&&this.view.requestMeasure(this.measureReq))}readPos(){let{view:e}=this,t=e.state.field(v0),n=null!=t&&e.coordsAtPos(t);if(!n)return null;let i=e.scrollDOM.getBoundingClientRect();return{left:n.left-i.left+e.scrollDOM.scrollLeft*e.scaleX,top:n.top-i.top+e.scrollDOM.scrollTop*e.scaleY,height:n.bottom-n.top}}drawCursor(e){if(this.cursor){let{scaleX:t,scaleY:n}=this.view;e?(this.cursor.style.left=e.left/t+"px",this.cursor.style.top=e.top/n+"px",this.cursor.style.height=e.height/n+"px"):this.cursor.style.left="-100000px"}}destroy(){this.cursor&&this.cursor.remove()}setDropPos(e){this.view.state.field(v0)!=e&&this.view.dispatch({effects:vJ.of(e)})}},{eventObservers:{dragover(e){this.setDropPos(this.view.posAtCoords({x:e.clientX,y:e.clientY}))},dragleave(e){e.target!=this.view.contentDOM&&this.view.contentDOM.contains(e.relatedTarget)||this.setDropPos(null)},dragend(){this.setDropPos(null)},drop(){this.setDropPos(null)}}});function v2(e,t,n,i,r){t.lastIndex=0;for(let o=e.iterRange(n,i),s=n,l;!o.next().done;s+=o.value.length)if(!o.lineBreak)for(;l=t.exec(o.value);)r(s+l.index,l)}class v5{constructor(e){const{regexp:t,decoration:n,decorate:i,boundary:r,maxLength:o=1e3}=e;if(!t.global)throw RangeError("The regular expression given to MatchDecorator should have its 'g' flag set");if(this.regexp=t,i)this.addMatch=(e,t,n,r)=>i(r,n,n+e[0].length,e,t);else if("function"==typeof n)this.addMatch=(e,t,i,r)=>{let o=n(e,t,i);o&&r(i,i+e[0].length,o)};else if(n)this.addMatch=(e,t,i,r)=>r(i,i+e[0].length,n);else throw RangeError("Either 'decorate' or 'decoration' should be provided to MatchDecorator");this.boundary=r,this.maxLength=o}createDeco(e){let t=new f1,n=t.add.bind(t);for(let{from:t,to:i}of function(e,t){let n=e.visibleRanges;if(1==n.length&&n[0].from==e.viewport.from&&n[0].to==e.viewport.to)return n;let i=[];for(let{from:r,to:o}of n)r=Math.max(e.state.doc.lineAt(r).from,r-t),o=Math.min(e.state.doc.lineAt(o).to,o+t),i.length&&i[i.length-1].to>=r?i[i.length-1].to=o:i.push({from:r,to:o});return i}(e,this.maxLength))v2(e.state.doc,this.regexp,t,i,(t,i)=>this.addMatch(i,e,t,n));return t.finish()}updateDeco(e,t){let n=1e9,i=-1;return(e.docChanged&&e.changes.iterChanges((t,r,o,s)=>{s>=e.view.viewport.from&&o<=e.view.viewport.to&&(n=Math.min(o,n),i=Math.max(s,i))}),e.viewportMoved||i-n>1e3)?this.createDeco(e.view):i>-1?this.updateRange(e.view,t.map(e.changes),n,i):t}updateRange(e,t,n,i){for(let r of e.visibleRanges){let o=Math.max(r.from,n),s=Math.min(r.to,i);if(s>=o){let n=e.state.doc.lineAt(o),i=n.to<s?e.state.doc.lineAt(s):n,l=Math.max(r.from,n.from),a=Math.min(r.to,i.to);if(this.boundary){for(;o>n.from;o--)if(this.boundary.test(n.text[o-1-n.from])){l=o;break}for(;s<i.to;s++)if(this.boundary.test(i.text[s-i.from])){a=s;break}}let u=[],c,h=(e,t,n)=>u.push(n.range(e,t));if(n==i)for(this.regexp.lastIndex=l-n.from;(c=this.regexp.exec(n.text))&&c.index<a-n.from;)this.addMatch(c,e,c.index+n.from,h);else v2(e.state.doc,this.regexp,l,a,(t,n)=>this.addMatch(n,e,t,h));t=t.update({filterFrom:l,filterTo:a,filter:(e,t)=>e<l||t>a,add:u})}}return t}}let v3=null!=/x/.unicode?"gu":"g",v4=RegExp("[\0-\b\n-\x1f\x7f-\x9f\xad\u2028\u2029\uFEFF-]",v3),v6={0:"null",7:"bell",8:"backspace",10:"newline",11:"vertical tab",13:"carriage return",27:"escape",8203:"zero width space",8204:"zero width non-joiner",8205:"zero width joiner",8206:"left-to-right mark",8207:"right-to-left mark",8232:"line separator",8237:"left-to-right override",8238:"right-to-left override",8294:"left-to-right isolate",8295:"right-to-left isolate",8297:"pop directional isolate",8233:"paragraph separator",65279:"zero width no-break space",65532:"object replacement"},v8=null,v9=fp.define({combine(e){let t=fY(e,{render:null,specialChars:v4,addSpecialChars:null});return(t.replaceTabs=!function(){var e;if(null==v8&&"u">typeof document&&document.body){let t=document.body.style;v8=(null!=(e=t.tabSize)?e:t.MozTabSize)!=null}return v8||!1}())&&(t.specialChars=RegExp(" |"+t.specialChars.source,v3)),t.addSpecialChars&&(t.specialChars=RegExp(t.specialChars.source+"|"+t.addSpecialChars.source,v3)),t}}),v7=null;class be extends pP{constructor(e,t){super(),this.options=e,this.code=t}eq(e){return e.code==this.code}toDOM(e){var t;let n=(t=this.code)>=32?"•":10==t?"":String.fromCharCode(9216+t),i=e.state.phrase("Control character")+" "+(v6[this.code]||"0x"+this.code.toString(16)),r=this.options.render&&this.options.render(this.code,i,n);if(r)return r;let o=document.createElement("span");return o.textContent=n,o.title=i,o.setAttribute("aria-label",i),o.className="cm-specialChar",o}ignoreEvent(){return!1}}class bt extends pP{constructor(e){super(),this.width=e}eq(e){return e.width==this.width}toDOM(){let e=document.createElement("span");return e.textContent=" ",e.className="cm-tab",e.style.width=this.width+"px",e}ignoreEvent(){return!1}}let bn=pj.line({class:"cm-activeLine"}),bi=mO.fromClass(class{constructor(e){this.decorations=this.getDeco(e)}update(e){(e.docChanged||e.selectionSet)&&(this.decorations=this.getDeco(e.view))}getDeco(e){let t=-1,n=[];for(let i of e.state.selection.ranges){let r=e.lineBlockAt(i.head);r.from>t&&(n.push(bn.range(r.from)),t=r.from)}return pj.set(n)}},{decorations:e=>e.decorations});class br extends pP{constructor(e){super(),this.content=e}toDOM(e){let t=document.createElement("span");return t.className="cm-placeholder",t.style.pointerEvents="none",t.appendChild("string"==typeof this.content?document.createTextNode(this.content):"function"==typeof this.content?this.content(e):this.content.cloneNode(!0)),t.setAttribute("aria-hidden","true"),t}coordsAt(e){let t=e.firstChild?pU(e.firstChild):[];if(!t.length)return null;let n=window.getComputedStyle(e.parentNode),i=pZ(t[0],"rtl"!=n.direction),r=parseInt(n.lineHeight);return i.bottom-i.top>1.5*r?{left:i.left,right:i.right,top:i.top,bottom:i.top+r}:i}ignoreEvent(){return!1}}function bo(e,t){var n;let i,r=e.posAtCoords({x:t.clientX,y:t.clientY},!1),o=e.state.doc.lineAt(r),s=r-o.from,l=s>2e3?-1:s==o.length?(n=t.clientX,(i=e.coordsAtPos(e.viewport.from))?Math.round(Math.abs((i.left-n)/e.defaultCharacterWidth)):-1):pn(o.text,e.state.tabSize,r-o.from);return{line:o.number,col:l,off:s}}let bs={Alt:[18,e=>!!e.altKey],Control:[17,e=>!!e.ctrlKey],Shift:[16,e=>!!e.shiftKey],Meta:[91,e=>!!e.metaKey]},bl={style:"cursor: crosshair"},ba="-10000px";class bu{constructor(e,t,n,i){this.facet=t,this.createTooltipView=n,this.removeTooltipView=i,this.input=e.state.facet(t),this.tooltips=this.input.filter(e=>e);let r=null;this.tooltipViews=this.tooltips.map(e=>r=n(e,r))}update(e,t){var n;let i=e.state.facet(this.facet),r=i.filter(e=>e);if(i===this.input){for(let t of this.tooltipViews)t.update&&t.update(e);return!1}let o=[],s=t?[]:null;for(let n=0;n<r.length;n++){let i=r[n],l=-1;if(i){for(let e=0;e<this.tooltips.length;e++){let t=this.tooltips[e];t&&t.create==i.create&&(l=e)}if(l<0)o[n]=this.createTooltipView(i,n?o[n-1]:null),s&&(s[n]=!!i.above);else{let i=o[n]=this.tooltipViews[l];s&&(s[n]=t[l]),i.update&&i.update(e)}}}for(let e of this.tooltipViews)0>o.indexOf(e)&&(this.removeTooltipView(e),null==(n=e.destroy)||n.call(e));return t&&(s.forEach((e,n)=>t[n]=e),t.length=s.length),this.input=i,this.tooltips=r,this.tooltipViews=o,!0}}function bc(e){let t=e.dom.ownerDocument.documentElement;return{top:0,left:0,bottom:t.clientHeight,right:t.clientWidth}}let bh=fp.define({combine:e=>{var t,n,i;return{position:pD.ios?"absolute":(null==(t=e.find(e=>e.position))?void 0:t.position)||"fixed",parent:(null==(n=e.find(e=>e.parent))?void 0:n.parent)||null,tooltipSpace:(null==(i=e.find(e=>e.tooltipSpace))?void 0:i.tooltipSpace)||bc}}}),bd=new WeakMap,bf=mO.fromClass(class{constructor(e){this.view=e,this.above=[],this.inView=!0,this.madeAbsolute=!1,this.lastTransaction=0,this.measureTimeout=-1;let t=e.state.facet(bh);this.position=t.position,this.parent=t.parent,this.classes=e.themeClasses,this.createContainer(),this.measureReq={read:this.readMeasure.bind(this),write:this.writeMeasure.bind(this),key:this},this.resizeObserver="function"==typeof ResizeObserver?new ResizeObserver(()=>this.measureSoon()):null,this.manager=new bu(e,bv,(e,t)=>this.createTooltip(e,t),e=>{this.resizeObserver&&this.resizeObserver.unobserve(e.dom),e.dom.remove()}),this.above=this.manager.tooltips.map(e=>!!e.above),this.intersectionObserver="function"==typeof IntersectionObserver?new IntersectionObserver(e=>{Date.now()>this.lastTransaction-50&&e.length>0&&e[e.length-1].intersectionRatio<1&&this.measureSoon()},{threshold:[1]}):null,this.observeIntersection(),e.win.addEventListener("resize",this.measureSoon=this.measureSoon.bind(this)),this.maybeMeasure()}createContainer(){this.parent?(this.container=document.createElement("div"),this.container.style.position="relative",this.container.className=this.view.themeClasses,this.parent.appendChild(this.container)):this.container=this.view.dom}observeIntersection(){if(this.intersectionObserver)for(let e of(this.intersectionObserver.disconnect(),this.manager.tooltipViews))this.intersectionObserver.observe(e.dom)}measureSoon(){this.measureTimeout<0&&(this.measureTimeout=setTimeout(()=>{this.measureTimeout=-1,this.maybeMeasure()},50))}update(e){e.transactions.length&&(this.lastTransaction=Date.now());let t=this.manager.update(e,this.above);t&&this.observeIntersection();let n=t||e.geometryChanged,i=e.state.facet(bh);if(i.position!=this.position&&!this.madeAbsolute){for(let e of(this.position=i.position,this.manager.tooltipViews))e.dom.style.position=this.position;n=!0}if(i.parent!=this.parent){for(let e of(this.parent&&this.container.remove(),this.parent=i.parent,this.createContainer(),this.manager.tooltipViews))this.container.appendChild(e.dom);n=!0}else this.parent&&this.view.themeClasses!=this.classes&&(this.classes=this.container.className=this.view.themeClasses);n&&this.maybeMeasure()}createTooltip(e,t){let n=e.create(this.view),i=t?t.dom:null;if(n.dom.classList.add("cm-tooltip"),e.arrow&&!n.dom.querySelector(".cm-tooltip > .cm-tooltip-arrow")){let e=document.createElement("div");e.className="cm-tooltip-arrow",n.dom.appendChild(e)}return n.dom.style.position=this.position,n.dom.style.top=ba,n.dom.style.left="0px",this.container.insertBefore(n.dom,i),n.mount&&n.mount(this.view),this.resizeObserver&&this.resizeObserver.observe(n.dom),n}destroy(){var e,t,n;for(let t of(this.view.win.removeEventListener("resize",this.measureSoon),this.manager.tooltipViews))t.dom.remove(),null==(e=t.destroy)||e.call(t);this.parent&&this.container.remove(),null==(t=this.resizeObserver)||t.disconnect(),null==(n=this.intersectionObserver)||n.disconnect(),clearTimeout(this.measureTimeout)}readMeasure(){let e=1,t=1,n=!1;if("fixed"==this.position&&this.manager.tooltipViews.length){let{dom:e}=this.manager.tooltipViews[0];if(pD.safari){let t=e.getBoundingClientRect();n=Math.abs(t.top+1e4)>1||Math.abs(t.left)>1}else n=!!e.offsetParent&&e.offsetParent!=this.container.ownerDocument.body}if(n||"absolute"==this.position)if(this.parent){let n=this.parent.getBoundingClientRect();n.width&&n.height&&(e=n.width/this.parent.offsetWidth,t=n.height/this.parent.offsetHeight)}else({scaleX:e,scaleY:t}=this.view.viewState);let i=this.view.scrollDOM.getBoundingClientRect(),r=m$(this.view);return{visible:{left:i.left+r.left,top:i.top+r.top,right:i.right-r.right,bottom:i.bottom-r.bottom},parent:this.parent?this.container.getBoundingClientRect():this.view.dom.getBoundingClientRect(),pos:this.manager.tooltips.map((e,t)=>{let n=this.manager.tooltipViews[t];return n.getCoords?n.getCoords(e.pos):this.view.coordsAtPos(e.pos)}),size:this.manager.tooltipViews.map(({dom:e})=>e.getBoundingClientRect()),space:this.view.state.facet(bh).tooltipSpace(this.view),scaleX:e,scaleY:t,makeAbsolute:n}}writeMeasure(e){var t;if(e.makeAbsolute)for(let e of(this.madeAbsolute=!0,this.position="absolute",this.manager.tooltipViews))e.dom.style.position="absolute";let{visible:n,space:i,scaleX:r,scaleY:o}=e,s=[];for(let l=0;l<this.manager.tooltips.length;l++){let a=this.manager.tooltips[l],u=this.manager.tooltipViews[l],{dom:c}=u,h=e.pos[l],d=e.size[l];if(!h||!1!==a.clip&&(h.bottom<=Math.max(n.top,i.top)||h.top>=Math.min(n.bottom,i.bottom)||h.right<Math.max(n.left,i.left)-.1||h.left>Math.min(n.right,i.right)+.1)){c.style.top=ba;continue}let f=a.arrow?u.dom.querySelector(".cm-tooltip-arrow"):null,p=7*!!f,m=d.right-d.left,g=null!=(t=bd.get(u))?t:d.bottom-d.top,v=u.offset||bg,b=this.view.textDirection==p7.LTR,x=d.width>i.right-i.left?b?i.left:i.right-d.width:b?Math.max(i.left,Math.min(h.left-14*!!f+v.x,i.right-m)):Math.min(Math.max(i.left,h.left-m+14*!!f-v.x),i.right-m),y=this.above[l];!a.strictSide&&(y?h.top-g-p-v.y<i.top:h.bottom+g+p+v.y>i.bottom)&&y==i.bottom-h.bottom>h.top-i.top&&(y=this.above[l]=!y);let w=(y?h.top-i.top:i.bottom-h.bottom)-p;if(w<g&&!1!==u.resize){if(w<this.view.defaultLineHeight){c.style.top=ba;continue}bd.set(u,g),c.style.height=(g=w)/o+"px"}else c.style.height&&(c.style.height="");let S=y?h.top-g-p-v.y:h.bottom+p+v.y,C=x+m;if(!0!==u.overlap)for(let e of s)e.left<C&&e.right>x&&e.top<S+g&&e.bottom>S&&(S=y?e.top-g-2-p:e.bottom+p+2);if("absolute"==this.position?(c.style.top=(S-e.parent.top)/o+"px",bp(c,(x-e.parent.left)/r)):(c.style.top=S/o+"px",bp(c,x/r)),f){let e=h.left+(b?v.x:-v.x)-(x+14-7);f.style.left=e/r+"px"}!0!==u.overlap&&s.push({left:x,top:S,right:C,bottom:S+g}),c.classList.toggle("cm-tooltip-above",y),c.classList.toggle("cm-tooltip-below",!y),u.positioned&&u.positioned(e.space)}}maybeMeasure(){if(this.manager.tooltips.length&&(this.view.inView&&this.view.requestMeasure(this.measureReq),this.inView!=this.view.inView)&&(this.inView=this.view.inView,!this.inView))for(let e of this.manager.tooltipViews)e.dom.style.top=ba}},{eventObservers:{scroll(){this.maybeMeasure()}}});function bp(e,t){let n=parseInt(e.style.left,10);(isNaN(n)||Math.abs(t-n)>1)&&(e.style.left=t+"px")}let bm=vT.baseTheme({".cm-tooltip":{zIndex:500,boxSizing:"border-box"},"&light .cm-tooltip":{border:"1px solid #bbb",backgroundColor:"#f5f5f5"},"&light .cm-tooltip-section:not(:first-child)":{borderTop:"1px solid #bbb"},"&dark .cm-tooltip":{backgroundColor:"#333338",color:"white"},".cm-tooltip-arrow":{height:"7px",width:"14px",position:"absolute",zIndex:-1,overflow:"hidden","&:before, &:after":{content:"''",position:"absolute",width:0,height:0,borderLeft:"7px solid transparent",borderRight:"7px solid transparent"},".cm-tooltip-above &":{bottom:"-7px","&:before":{borderTop:"7px solid #bbb"},"&:after":{borderTop:"7px solid #f5f5f5",bottom:"1px"}},".cm-tooltip-below &":{top:"-7px","&:before":{borderBottom:"7px solid #bbb"},"&:after":{borderBottom:"7px solid #f5f5f5",top:"1px"}}},"&dark .cm-tooltip .cm-tooltip-arrow":{"&:before":{borderTopColor:"#333338",borderBottomColor:"#333338"},"&:after":{borderTopColor:"transparent",borderBottomColor:"transparent"}}}),bg={x:0,y:0},bv=fp.define({enables:[bf,bm]}),bb=fp.define({combine:e=>e.reduce((e,t)=>e.concat(t),[])});class bx{static create(e){return new bx(e)}constructor(e){this.view=e,this.mounted=!1,this.dom=document.createElement("div"),this.dom.classList.add("cm-tooltip-hover"),this.manager=new bu(e,bb,(e,t)=>this.createHostedView(e,t),e=>e.dom.remove())}createHostedView(e,t){let n=e.create(this.view);return n.dom.classList.add("cm-tooltip-section"),this.dom.insertBefore(n.dom,t?t.dom.nextSibling:this.dom.firstChild),this.mounted&&n.mount&&n.mount(this.view),n}mount(e){for(let t of this.manager.tooltipViews)t.mount&&t.mount(e);this.mounted=!0}positioned(e){for(let t of this.manager.tooltipViews)t.positioned&&t.positioned(e)}update(e){this.manager.update(e)}destroy(){var e;for(let t of this.manager.tooltipViews)null==(e=t.destroy)||e.call(t)}passProp(e){let t;for(let n of this.manager.tooltipViews){let i=n[e];if(void 0!==i){if(void 0===t)t=i;else if(t!==i)return}}return t}get offset(){return this.passProp("offset")}get getCoords(){return this.passProp("getCoords")}get overlap(){return this.passProp("overlap")}get resize(){return this.passProp("resize")}}let by=bv.compute([bb],e=>{let t=e.facet(bb);return 0===t.length?null:{pos:Math.min(...t.map(e=>e.pos)),end:Math.max(...t.map(e=>{var t;return null!=(t=e.end)?t:e.pos})),create:bx.create,above:t[0].above,arrow:t.some(e=>e.arrow)}}),bw=fp.define();class bS{constructor(e,t,n,i,r,o){this.view=e,this.source=t,this.field=n,this.locked=i,this.setHover=r,this.hoverTime=o,this.hoverTimeout=-1,this.restartTimeout=-1,this.pending=null,this.lastMove={x:0,y:0,target:e.dom,time:0},this.checkHover=this.checkHover.bind(this),e.dom.addEventListener("mouseleave",this.mouseleave=this.mouseleave.bind(this)),e.dom.addEventListener("mousemove",this.mousemove=this.mousemove.bind(this))}update(e){this.pending&&(this.pending=null,clearTimeout(this.restartTimeout),this.restartTimeout=setTimeout(()=>this.startHover(),20))}get active(){return this.view.state.field(this.field)}checkHover(){if(this.hoverTimeout=-1,this.active.length)return;let e=Date.now()-this.lastMove.time;e<this.hoverTime?this.hoverTimeout=setTimeout(this.checkHover,this.hoverTime-e):this.startHover()}startHover(){clearTimeout(this.restartTimeout);let{view:e,lastMove:t}=this,n=e.docView.tile.nearest(t.target);if(!n)return;let i,r=1;if(n.isWidget())i=n.posAtStart;else{if(null==(i=e.posAtCoords(t)))return;let n=e.coordsAtPos(i);if(!n||t.y<n.top||t.y>n.bottom||t.x<n.left-e.defaultCharacterWidth||t.x>n.right+e.defaultCharacterWidth)return;let o=e.bidiSpans(e.state.doc.lineAt(i)).find(e=>e.from<=i&&e.to>=i),s=o&&o.dir==p7.RTL?-1:1;r=t.x<n.left?-s:s}this.activateHover(e,i,r)}activateHover(e,t,n,i){let r=this.source(e,t,n),o=t=>{if(t&&!(Array.isArray(t)&&!t.length)){let n=Array.isArray(t)?t:[t];i&&this.locked.set(n,i),e.dispatch({effects:this.setHover.of(n)})}};if(r&&"then"in r){let n=this.pending={pos:t};r.then(e=>{this.pending==n&&(this.pending=null,o(e))},t=>mD(e.state,t,"hover tooltip"))}else o(r)}get tooltip(){let e=this.view.plugin(bf),t=e?e.manager.tooltips.findIndex(e=>e.create==bx.create):-1;return t>-1?e.manager.tooltipViews[t]:null}mousemove(e){var t,n;this.lastMove={x:e.clientX,y:e.clientY,target:e.target,time:Date.now()},this.hoverTimeout<0&&(this.hoverTimeout=setTimeout(this.checkHover,this.hoverTime));let{active:i,tooltip:r}=this;if(i.length&&!this.locked.has(i)&&r&&!function(e,t){let{left:n,right:i,top:r,bottom:o}=e.getBoundingClientRect(),s;if(s=e.querySelector(".cm-tooltip-arrow")){let e=s.getBoundingClientRect();r=Math.min(e.top,r),o=Math.max(e.bottom,o)}return t.clientX>=n-4&&t.clientX<=i+4&&t.clientY>=r-4&&t.clientY<=o+4}(r.dom,e)||this.pending){let{pos:r}=i[0]||this.pending,o=null!=(n=null==(t=i[0])?void 0:t.end)?n:r;(r==o?this.view.posAtCoords(this.lastMove)!=r:!function(e,t,n,i,r){let o=e.scrollDOM.getBoundingClientRect(),s=e.documentTop+e.documentPadding.top+e.contentHeight;if(o.left>i||o.right<i||o.top>r||Math.min(o.bottom,s)<r)return!1;let l=e.posAtCoords({x:i,y:r},!1);return l>=t&&l<=n}(this.view,r,o,e.clientX,e.clientY))&&(this.view.dispatch({effects:this.setHover.of([])}),this.pending=null)}}mouseleave(e){clearTimeout(this.hoverTimeout),this.hoverTimeout=-1;let{active:t}=this;if(t.length&&!this.locked.has(t)){let{tooltip:t}=this;t&&t.dom.contains(e.relatedTarget)?this.watchTooltipLeave(t.dom):this.view.dispatch({effects:this.setHover.of([])})}}watchTooltipLeave(e){let t=n=>{e.removeEventListener("mouseleave",t);let{active:i}=this;!i.length||this.locked.has(i)||this.view.dom.contains(n.relatedTarget)||this.view.dispatch({effects:this.setHover.of([])})};e.addEventListener("mouseleave",t)}destroy(){clearTimeout(this.hoverTimeout),clearTimeout(this.restartTimeout),this.view.dom.removeEventListener("mouseleave",this.mouseleave),this.view.dom.removeEventListener("mousemove",this.mousemove)}}function bC(e,t){let n=e.plugin(bf);if(!n)return null;let i=n.manager.tooltips.indexOf(t);return i<0?null:n.manager.tooltipViews[i]}let bA=fV.define(),bk=fp.define({combine(e){let t,n;for(let i of e)t=t||i.topContainer,n=n||i.bottomContainer;return{topContainer:t,bottomContainer:n}}});function bM(e,t){let n=e.plugin(bT),i=n?n.specs.indexOf(t):-1;return i>-1?n.panels[i]:null}let bT=mO.fromClass(class{constructor(e){this.input=e.state.facet(bR),this.specs=this.input.filter(e=>e),this.panels=this.specs.map(t=>t(e));let t=e.state.facet(bk);for(let n of(this.top=new bD(e,!0,t.topContainer),this.bottom=new bD(e,!1,t.bottomContainer),this.top.sync(this.panels.filter(e=>e.top)),this.bottom.sync(this.panels.filter(e=>!e.top)),this.panels))n.dom.classList.add("cm-panel"),n.mount&&n.mount()}update(e){let t=e.state.facet(bk);this.top.container!=t.topContainer&&(this.top.sync([]),this.top=new bD(e.view,!0,t.topContainer)),this.bottom.container!=t.bottomContainer&&(this.bottom.sync([]),this.bottom=new bD(e.view,!1,t.bottomContainer)),this.top.syncClasses(),this.bottom.syncClasses();let n=e.state.facet(bR);if(n!=this.input){let t=n.filter(e=>e),i=[],r=[],o=[],s=[];for(let n of t){let t=this.specs.indexOf(n),l;t<0?(l=n(e.view),s.push(l)):(l=this.panels[t]).update&&l.update(e),i.push(l),(l.top?r:o).push(l)}for(let e of(this.specs=t,this.panels=i,this.top.sync(r),this.bottom.sync(o),s))e.dom.classList.add("cm-panel"),e.mount&&e.mount()}else for(let t of this.panels)t.update&&t.update(e)}destroy(){this.top.sync([]),this.bottom.sync([])}},{provide:e=>vT.scrollMargins.of(t=>{let n=t.plugin(e);return n&&{top:n.top.scrollMargin(),bottom:n.bottom.scrollMargin()}})});class bD{constructor(e,t,n){this.view=e,this.top=t,this.container=n,this.dom=void 0,this.classes="",this.panels=[],this.syncClasses()}sync(e){for(let t of this.panels)t.destroy&&0>e.indexOf(t)&&t.destroy();this.panels=e,this.syncDOM()}syncDOM(){if(0==this.panels.length){this.dom&&(this.dom.remove(),this.dom=void 0);return}if(!this.dom){this.dom=document.createElement("div"),this.dom.className=this.top?"cm-panels cm-panels-top":"cm-panels cm-panels-bottom",this.dom.style[this.top?"top":"bottom"]="0";let e=this.container||this.view.dom;e.insertBefore(this.dom,this.top?e.firstChild:null)}let e=this.dom.firstChild;for(let t of this.panels)if(t.dom.parentNode==this.dom){for(;e!=t.dom;)e=bI(e);e=e.nextSibling}else this.dom.insertBefore(t.dom,e);for(;e;)e=bI(e)}scrollMargin(){return!this.dom||this.container?0:Math.max(0,this.top?this.dom.getBoundingClientRect().bottom-Math.max(0,this.view.scrollDOM.getBoundingClientRect().top):Math.min(innerHeight,this.view.scrollDOM.getBoundingClientRect().bottom)-this.dom.getBoundingClientRect().top)}syncClasses(){if(this.container&&this.classes!=this.view.themeClasses){for(let e of this.classes.split(" "))e&&this.container.classList.remove(e);for(let e of(this.classes=this.view.themeClasses).split(" "))e&&this.container.classList.add(e)}}}function bI(e){let t=e.nextSibling;return e.remove(),t}let bR=fp.define({enables:bT}),bE=fy.define({create:()=>[],update(e,t){for(let n of t.effects)n.is(bO)?e=[n.value].concat(e):n.is(bP)&&(e=e.filter(e=>e!=n.value));return e},provide:e=>bR.computeN([e],t=>t.field(e))}),bO=fV.define(),bP=fV.define();class bL extends fK{compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}eq(e){return!1}destroy(e){}}bL.prototype.elementClass="",bL.prototype.toDOM=void 0,bL.prototype.mapMode=ft.TrackBefore,bL.prototype.startSide=bL.prototype.endSide=-1,bL.prototype.point=!0;let bj=fp.define(),bB=fp.define(),bF={class:"",renderEmptyElements:!1,elementStyle:"",markers:()=>f0.empty,lineMarker:()=>null,widgetMarker:()=>null,lineMarkerChange:null,initialSpacer:null,updateSpacer:null,domEventHandlers:{},side:"before"},bN=fp.define();function bV(e){return[bz(),bN.of({...bF,...e})]}let bH=fp.define({combine:e=>e.some(e=>e)});function bz(e){let t=[bW];return e&&!1===e.fixed&&t.push(bH.of(!0)),t}let bW=mO.fromClass(class{constructor(e){for(let t of(this.view=e,this.domAfter=null,this.prevViewport=e.viewport,this.dom=document.createElement("div"),this.dom.className="cm-gutters cm-gutters-before",this.dom.setAttribute("aria-hidden","true"),this.dom.style.minHeight=this.view.contentHeight/this.view.scaleY+"px",this.gutters=e.state.facet(bN).map(t=>new bG(e,t)),this.fixed=!e.state.facet(bH),this.gutters))"after"==t.config.side?this.getDOMAfter().appendChild(t.dom):this.dom.appendChild(t.dom);this.fixed&&(this.dom.style.position="sticky"),this.syncGutters(!1),e.scrollDOM.insertBefore(this.dom,e.contentDOM)}getDOMAfter(){return this.domAfter||(this.domAfter=document.createElement("div"),this.domAfter.className="cm-gutters cm-gutters-after",this.domAfter.setAttribute("aria-hidden","true"),this.domAfter.style.minHeight=this.view.contentHeight/this.view.scaleY+"px",this.domAfter.style.position=this.fixed?"sticky":"",this.view.scrollDOM.appendChild(this.domAfter)),this.domAfter}update(e){if(this.updateGutters(e)){let t=this.prevViewport,n=e.view.viewport,i=Math.min(t.to,n.to)-Math.max(t.from,n.from);this.syncGutters(i<(n.to-n.from)*.8)}if(e.geometryChanged){let e=this.view.contentHeight/this.view.scaleY+"px";this.dom.style.minHeight=e,this.domAfter&&(this.domAfter.style.minHeight=e)}this.view.state.facet(bH)!=!this.fixed&&(this.fixed=!this.fixed,this.dom.style.position=this.fixed?"sticky":"",this.domAfter&&(this.domAfter.style.position=this.fixed?"sticky":"")),this.prevViewport=e.view.viewport}syncGutters(e){let t=this.dom.nextSibling;e&&(this.dom.remove(),this.domAfter&&this.domAfter.remove());let n=f0.iter(this.view.state.facet(bj),this.view.viewport.from),i=[],r=this.gutters.map(e=>new bU(e,this.view.viewport,-this.view.documentPadding.top));for(let e of this.view.viewportLineBlocks)if(i.length&&(i=[]),Array.isArray(e.type)){let t=!0;for(let o of e.type)if(o.type==pL.Text&&t){for(let e of(b_(n,i,o.from),r))e.line(this.view,o,i);t=!1}else if(o.widget)for(let e of r)e.widget(this.view,o)}else if(e.type==pL.Text)for(let t of(b_(n,i,e.from),r))t.line(this.view,e,i);else if(e.widget)for(let t of r)t.widget(this.view,e);for(let e of r)e.finish();e&&(this.view.scrollDOM.insertBefore(this.dom,t),this.domAfter&&this.view.scrollDOM.appendChild(this.domAfter))}updateGutters(e){let t=e.startState.facet(bN),n=e.state.facet(bN),i=e.docChanged||e.heightChanged||e.viewportChanged||!f0.eq(e.startState.facet(bj),e.state.facet(bj),e.view.viewport.from,e.view.viewport.to);if(t==n)for(let t of this.gutters)t.update(e)&&(i=!0);else{i=!0;let r=[];for(let i of n){let n=t.indexOf(i);n<0?r.push(new bG(this.view,i)):(this.gutters[n].update(e),r.push(this.gutters[n]))}for(let e of this.gutters)e.dom.remove(),0>r.indexOf(e)&&e.destroy();for(let e of r)"after"==e.config.side?this.getDOMAfter().appendChild(e.dom):this.dom.appendChild(e.dom);this.gutters=r}return i}destroy(){for(let e of this.gutters)e.destroy();this.dom.remove(),this.domAfter&&this.domAfter.remove()}},{provide:e=>vT.scrollMargins.of(t=>{let n=t.plugin(e);if(!n||0==n.gutters.length||!n.fixed)return null;let i=n.dom.offsetWidth*t.scaleX,r=n.domAfter?n.domAfter.offsetWidth*t.scaleX:0;return t.textDirection==p7.LTR?{left:i,right:r}:{right:i,left:r}})});function b$(e){return Array.isArray(e)?e:[e]}function b_(e,t,n){for(;e.value&&e.from<=n;)e.from==n&&t.push(e.value),e.next()}class bU{constructor(e,t,n){this.gutter=e,this.height=n,this.i=0,this.cursor=f0.iter(e.markers,t.from)}addElement(e,t,n){let{gutter:i}=this,r=(t.top-this.height)/e.scaleY,o=t.height/e.scaleY;if(this.i==i.elements.length){let t=new bq(e,o,r,n);i.elements.push(t),i.dom.appendChild(t.dom)}else i.elements[this.i].update(e,o,r,n);this.height=t.bottom,this.i++}line(e,t,n){let i=[];b_(this.cursor,i,t.from),n.length&&(i=i.concat(n));let r=this.gutter.config.lineMarker(e,t,i);r&&i.unshift(r);let o=this.gutter;(0!=i.length||o.config.renderEmptyElements)&&this.addElement(e,t,i)}widget(e,t){let n=this.gutter.config.widgetMarker(e,t.widget,t),i=n?[n]:null;for(let n of e.state.facet(bB)){let r=n(e,t.widget,t);r&&(i||(i=[])).push(r)}i&&this.addElement(e,t,i)}finish(){let e=this.gutter;for(;e.elements.length>this.i;){let t=e.elements.pop();e.dom.removeChild(t.dom),t.destroy()}}}class bG{constructor(e,t){for(let n in this.view=e,this.config=t,this.elements=[],this.spacer=null,this.dom=document.createElement("div"),this.dom.className="cm-gutter"+(this.config.class?" "+this.config.class:""),t.domEventHandlers)this.dom.addEventListener(n,i=>{let r=i.target,o;if(r!=this.dom&&this.dom.contains(r)){for(;r.parentNode!=this.dom;)r=r.parentNode;let e=r.getBoundingClientRect();o=(e.top+e.bottom)/2}else o=i.clientY;let s=e.lineBlockAtHeight(o-e.documentTop);t.domEventHandlers[n](e,s,i)&&i.preventDefault()});this.markers=b$(t.markers(e)),t.initialSpacer&&(this.spacer=new bq(e,0,0,[t.initialSpacer(e)]),this.dom.appendChild(this.spacer.dom),this.spacer.dom.style.cssText+="visibility: hidden; pointer-events: none")}update(e){let t=this.markers;if(this.markers=b$(this.config.markers(e.view)),this.spacer&&this.config.updateSpacer){let t=this.config.updateSpacer(this.spacer.markers[0],e);t!=this.spacer.markers[0]&&this.spacer.update(e.view,0,0,[t])}let n=e.view.viewport;return!f0.eq(this.markers,t,n.from,n.to)||!!this.config.lineMarkerChange&&this.config.lineMarkerChange(e)}destroy(){for(let e of this.elements)e.destroy()}}class bq{constructor(e,t,n,i){this.height=-1,this.above=0,this.markers=[],this.dom=document.createElement("div"),this.dom.className="cm-gutterElement",this.update(e,t,n,i)}update(e,t,n,i){this.height!=t&&(this.height=t,this.dom.style.height=t+"px"),this.above!=n&&(this.dom.style.marginTop=(this.above=n)?n+"px":""),!function(e,t){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!e[n].compare(t[n]))return!1;return!0}(this.markers,i)&&this.setMarkers(e,i)}setMarkers(e,t){let n="cm-gutterElement",i=this.dom.firstChild;for(let r=0,o=0;;){let s=o,l=r<t.length?t[r++]:null,a=!1;if(l){let e=l.elementClass;e&&(n+=" "+e);for(let e=o;e<this.markers.length;e++)if(this.markers[e].compare(l)){s=e,a=!0;break}}else s=this.markers.length;for(;o<s;){let e=this.markers[o++];if(e.toDOM){e.destroy(i);let t=i.nextSibling;i.remove(),i=t}}if(!l)break;l.toDOM&&(a?i=i.nextSibling:this.dom.insertBefore(l.toDOM(e),i)),a&&o++}this.dom.className=n,this.markers=t}destroy(){this.setMarkers(null,[])}}let bY=fp.define(),bK=fp.define(),bX=fp.define({combine:e=>fY(e,{formatNumber:String,domEventHandlers:{}},{domEventHandlers(e,t){let n=Object.assign({},e);for(let e in t){let i=n[e],r=t[e];n[e]=i?(e,t,n)=>i(e,t,n)||r(e,t,n):r}return n}})});class bZ extends bL{constructor(e){super(),this.number=e}eq(e){return this.number==e.number}toDOM(){return document.createTextNode(this.number)}}function bQ(e,t){return e.state.facet(bX).formatNumber(t,e.state)}let bJ=bN.compute([bX],e=>({class:"cm-lineNumbers",renderEmptyElements:!1,markers:e=>e.state.facet(bY),lineMarker:(e,t,n)=>n.some(e=>e.toDOM)?null:new bZ(bQ(e,e.state.doc.lineAt(t.from).number)),widgetMarker:(e,t,n)=>{for(let i of e.state.facet(bK)){let r=i(e,t,n);if(r)return r}return null},lineMarkerChange:e=>e.startState.facet(bX)!=e.state.facet(bX),initialSpacer:e=>new bZ(bQ(e,b0(e.state.doc.lines))),updateSpacer(e,t){let n=bQ(t.view,b0(t.view.state.doc.lines));return n==e.number?e:new bZ(n)},domEventHandlers:e.facet(bX).domEventHandlers,side:"before"}));function b0(e){let t=9;for(;t<e;)t=10*t+9;return t}let b1=new class extends bL{constructor(){super(...arguments),this.elementClass="cm-activeLineGutter"}},b2=bj.compute(["selection"],e=>{let t=[],n=-1;for(let i of e.selection.ranges){let r=e.doc.lineAt(i.head).from;r>n&&(n=r,t.push(b1.range(r)))}return f0.of(t)}),b5=0;class b3{constructor(e,t){this.from=e,this.to=t}}class b4{constructor(e={}){this.id=b5++,this.perNode=!!e.perNode,this.deserialize=e.deserialize||(()=>{throw Error("This node type doesn't define a deserialize function")}),this.combine=e.combine||null}add(e){if(this.perNode)throw RangeError("Can't add per-node props to node types");return"function"!=typeof e&&(e=b9.match(e)),t=>{let n=e(t);return void 0===n?null:[this,n]}}}b4.closedBy=new b4({deserialize:e=>e.split(" ")}),b4.openedBy=new b4({deserialize:e=>e.split(" ")}),b4.group=new b4({deserialize:e=>e.split(" ")}),b4.isolate=new b4({deserialize:e=>{if(e&&"rtl"!=e&&"ltr"!=e&&"auto"!=e)throw RangeError("Invalid value for isolate: "+e);return e||"auto"}}),b4.contextHash=new b4({perNode:!0}),b4.lookAhead=new b4({perNode:!0}),b4.mounted=new b4({perNode:!0});class b6{constructor(e,t,n,i=!1){this.tree=e,this.overlay=t,this.parser=n,this.bracketed=i}static get(e){return e&&e.props&&e.props[b4.mounted.id]}}let b8=Object.create(null);class b9{constructor(e,t,n,i=0){this.name=e,this.props=t,this.id=n,this.flags=i}static define(e){let t=e.props&&e.props.length?Object.create(null):b8,n=!!e.top|2*!!e.skipped|4*!!e.error|8*(null==e.name),i=new b9(e.name||"",t,e.id,n);if(e.props){for(let n of e.props)if(Array.isArray(n)||(n=n(i)),n){if(n[0].perNode)throw RangeError("Can't store a per-node prop on a node type");t[n[0].id]=n[1]}}return i}prop(e){return this.props[e.id]}get isTop(){return(1&this.flags)>0}get isSkipped(){return(2&this.flags)>0}get isError(){return(4&this.flags)>0}get isAnonymous(){return(8&this.flags)>0}is(e){if("string"==typeof e){if(this.name==e)return!0;let t=this.prop(b4.group);return!!t&&t.indexOf(e)>-1}return this.id==e}static match(e){let t=Object.create(null);for(let n in e)for(let i of n.split(" "))t[i]=e[n];return e=>{for(let n=e.prop(b4.group),i=-1;i<(n?n.length:0);i++){let r=t[i<0?e.name:n[i]];if(r)return r}}}}b9.none=new b9("",Object.create(null),0,8);class b7{constructor(e){this.types=e;for(let t=0;t<e.length;t++)if(e[t].id!=t)throw RangeError("Node type ids should correspond to array positions when creating a node set")}extend(...e){let t=[];for(let n of this.types){let i=null;for(let t of e){let e=t(n);if(e){i||(i=Object.assign({},n.props));let t=e[1],r=e[0];r.combine&&r.id in i&&(t=r.combine(i[r.id],t)),i[r.id]=t}}t.push(i?new b9(n.name,i,n.id,n.flags):n)}return new b7(t)}}let xe=new WeakMap,xt=new WeakMap;(b=T||(T={}))[b.ExcludeBuffers=1]="ExcludeBuffers",b[b.IncludeAnonymous=2]="IncludeAnonymous",b[b.IgnoreMounts=4]="IgnoreMounts",b[b.IgnoreOverlays=8]="IgnoreOverlays",b[b.EnterBracketed=16]="EnterBracketed";class xn{constructor(e,t,n,i,r){if(this.type=e,this.children=t,this.positions=n,this.length=i,this.props=null,r&&r.length)for(let[e,t]of(this.props=Object.create(null),r))this.props["number"==typeof e?e:e.id]=t}toString(){let e=b6.get(this);if(e&&!e.overlay)return e.tree.toString();let t="";for(let e of this.children){let n=e.toString();n&&(t&&(t+=","),t+=n)}return this.type.name?(/\W/.test(this.type.name)&&!this.type.isError?JSON.stringify(this.type.name):this.type.name)+(t.length?"("+t+")":""):t}cursor(e=0){return new xm(this.topNode,e)}cursorAt(e,t=0,n=0){let i=new xm(xe.get(this)||this.topNode);return i.moveTo(e,t),xe.set(this,i._tree),i}get topNode(){return new xa(this,0,0,null)}resolve(e,t=0){let n=xs(xe.get(this)||this.topNode,e,t,!1);return xe.set(this,n),n}resolveInner(e,t=0){let n=xs(xt.get(this)||this.topNode,e,t,!0);return xt.set(this,n),n}resolveStack(e,t=0){return function(e,t,n){let i=e.resolveInner(t,n),r=null;for(let e=i instanceof xa?i:i.context.parent;e;e=e.parent)if(e.index<0){let o=e.parent;(r||(r=[i])).push(o.resolve(t,n)),e=o}else{let o=b6.get(e.tree);if(o&&o.overlay&&o.overlay[0].from<=t&&o.overlay[o.overlay.length-1].to>=t){let s=new xa(o.tree,o.overlay[0].from+e.from,-1,e);(r||(r=[i])).push(xs(s,t,n,!1))}}return r?xf(r):i}(this,e,t)}iterate(e){let{enter:t,leave:n,from:i=0,to:r=this.length}=e,o=e.mode||0,s=(o&T.IncludeAnonymous)>0;for(let e=this.cursor(o|T.IncludeAnonymous);;){let o=!1;if(e.from<=r&&e.to>=i&&(!s&&e.type.isAnonymous||!1!==t(e))){if(e.firstChild())continue;o=!0}for(;o&&n&&(s||!e.type.isAnonymous)&&n(e),!e.nextSibling();){if(!e.parent())return;o=!0}}}prop(e){return e.perNode?this.props?this.props[e.id]:void 0:this.type.prop(e)}get propValues(){let e=[];if(this.props)for(let t in this.props)e.push([+t,this.props[t]]);return e}balance(e={}){return this.children.length<=8?this:xx(b9.none,this.children,this.positions,0,this.children.length,0,this.length,(e,t,n)=>new xn(this.type,e,t,n,this.propValues),e.makeTree||((e,t,n)=>new xn(b9.none,e,t,n)))}static build(e){return function(e){var t;let{buffer:n,nodeSet:i,maxBufferLength:r=1024,reused:o=[],minRepeatType:s=i.types.length}=e,l=Array.isArray(n)?new xi(n,n.length):n,a=i.types,u=0,c=0;function h(e,t,n,r,o,s,l,a,u){let c=[],h=[];for(;e.length>r;)c.push(e.pop()),h.push(t.pop()+n-o);e.push(d(i.types[l],c,h,s-o,a-s,u)),t.push(o-n)}function d(e,t,n,i,r,o,s){if(o){let e=[b4.contextHash,o];s=s?[e].concat(s):[e]}if(r>25){let e=[b4.lookAhead,r];s=s?[e].concat(s):[e]}return new xn(e,t,n,i,s)}let f=[],p=[];for(;l.pos>0;)!function e(t,n,f,p,m,g){let{id:v,start:b,end:x,size:y}=l,w=c,S=u;if(y<0){if(l.next(),-1==y){let e=o[v];f.push(e),p.push(b-t);return}if(-3==y){u=v;return}if(-4==y){c=v;return}else throw RangeError(`Unrecognized record size: ${y}`)}let C=a[v],A,k,M=b-t;if(x-b<=r&&(k=function(e,t){let n=l.fork(),i=0,o=0,a=0,u=n.end-r,c={size:0,start:0,skip:0};i:for(let r=n.pos-e;n.pos>r;){let e=n.size;if(n.id==t&&e>=0){c.size=i,c.start=o,c.skip=a,a+=4,i+=4,n.next();continue}let l=n.pos-e;if(e<0||l<r||n.start<u)break;let h=4*(n.id>=s),d=n.start;for(n.next();n.pos>l;){if(n.size<0)if(-3==n.size||-4==n.size)h+=4;else break i;else n.id>=s&&(h+=4);n.next()}o=d,i+=e,a+=h}return(t<0||i==e)&&(c.size=i,c.start=o,c.skip=a),c.size>4?c:void 0}(l.pos-n,m))){let e=new Uint16Array(k.size-k.skip),n=l.pos-k.size,r=e.length;for(;l.pos>n;)r=function e(t,n,i){let{id:r,start:o,end:a,size:h}=l;if(l.next(),h>=0&&r<s){let s=i;if(h>4){let r=l.pos-(h-4);for(;l.pos>r;)i=e(t,n,i)}n[--i]=s,n[--i]=a-t,n[--i]=o-t,n[--i]=r}else -3==h?u=r:-4==h&&(c=r);return i}(k.start,e,r);A=new xr(e,x-k.start,i),M=k.start-t}else{let t=l.pos-y;l.next();let n=[],o=[],a=v>=s?v:-1,u=0,c=x;for(;l.pos>t;)a>=0&&l.id==a&&l.size>=0?(l.end<=c-r&&(h(n,o,b,u,l.end,c,a,w,S),u=n.length,c=l.end),l.next()):g>2500?function(e,t,n,o){let s=[],a=0,u=-1;for(;l.pos>t;){let{id:e,start:t,end:n,size:i}=l;if(i>4)l.next();else if(u>-1&&t<u)break;else u<0&&(u=n-r),s.push(e,t,n),a++,l.next()}if(a){let t=new Uint16Array(4*a),r=s[s.length-2];for(let e=s.length-3,n=0;e>=0;e-=3)t[n++]=s[e],t[n++]=s[e+1]-r,t[n++]=s[e+2]-r,t[n++]=n;n.push(new xr(t,s[2]-r,i)),o.push(r-e)}}(b,t,n,o):e(b,t,n,o,a,g+1);if(a>=0&&u>0&&u<n.length&&h(n,o,b,u,b,c,a,w,S),n.reverse(),o.reverse(),a>-1&&u>0){let e=function(e,t){return(n,i,r)=>{let o=0,s=n.length-1,l,a;if(s>=0&&(l=n[s])instanceof xn){if(!s&&l.type==e&&l.length==r)return l;(a=l.prop(b4.lookAhead))&&(o=i[s]+l.length+a)}return d(e,n,i,r,o,t)}}(C,S);A=xx(C,n,o,0,n.length,0,x-b,e,e)}else A=d(C,n,o,x-b,w-x,S)}f.push(A),p.push(M)}(e.start||0,e.bufferStart||0,f,p,-1,0);let m=null!=(t=e.length)?t:f.length?p[0]+f[0].length:0;return new xn(a[e.topID],f.reverse(),p.reverse(),m)}(e)}}xn.empty=new xn(b9.none,[],[],0);class xi{constructor(e,t){this.buffer=e,this.index=t}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}get pos(){return this.index}next(){this.index-=4}fork(){return new xi(this.buffer,this.index)}}class xr{constructor(e,t,n){this.buffer=e,this.length=t,this.set=n}get type(){return b9.none}toString(){let e=[];for(let t=0;t<this.buffer.length;)e.push(this.childString(t)),t=this.buffer[t+3];return e.join(",")}childString(e){let t=this.buffer[e],n=this.buffer[e+3],i=this.set.types[t],r=i.name;if(/\W/.test(r)&&!i.isError&&(r=JSON.stringify(r)),n==(e+=4))return r;let o=[];for(;e<n;)o.push(this.childString(e)),e=this.buffer[e+3];return r+"("+o.join(",")+")"}findChild(e,t,n,i,r){let{buffer:o}=this,s=-1;for(let l=e;l!=t&&(!xo(r,i,o[l+1],o[l+2])||(s=l,!(n>0)));l=o[l+3]);return s}slice(e,t,n){let i=this.buffer,r=new Uint16Array(t-e),o=0;for(let s=e,l=0;s<t;){r[l++]=i[s++],r[l++]=i[s++]-n;let t=r[l++]=i[s++]-n;r[l++]=i[s++]-e,o=Math.max(o,t)}return new xr(r,o,this.set)}}function xo(e,t,n,i){switch(e){case -2:return n<t;case -1:return i>=t&&n<t;case 0:return n<t&&i>t;case 1:return n<=t&&i>t;case 2:return i>t;case 4:return!0}}function xs(e,t,n,i){for(var r;e.from==e.to||(n<1?e.from>=t:e.from>t)||(n>-1?e.to<=t:e.to<t);){let t=!i&&e instanceof xa&&e.index<0?null:e.parent;if(!t)return e;e=t}let o=i?0:T.IgnoreOverlays;if(i)for(let i=e,s=i.parent;s;s=(i=s).parent)i instanceof xa&&i.index<0&&(null==(r=s.enter(t,n,o))?void 0:r.from)!=i.from&&(e=s);for(;;){let i=e.enter(t,n,o);if(!i)return e;e=i}}class xl{cursor(e=0){return new xm(this,e)}getChild(e,t=null,n=null){let i=xu(this,e,t,n);return i.length?i[0]:null}getChildren(e,t=null,n=null){return xu(this,e,t,n)}resolve(e,t=0){return xs(this,e,t,!1)}resolveInner(e,t=0){return xs(this,e,t,!0)}matchContext(e){return xc(this.parent,e)}enterUnfinishedNodesBefore(e){let t=this.childBefore(e),n=this;for(;t;){let e=t.lastChild;if(!e||e.to!=t.to)break;e.type.isError&&e.from==e.to?(n=t,t=e.prevSibling):t=e}return n}get node(){return this}get next(){return this.parent}}class xa extends xl{constructor(e,t,n,i){super(),this._tree=e,this.from=t,this.index=n,this._parent=i}get type(){return this._tree.type}get name(){return this._tree.type.name}get to(){return this.from+this._tree.length}nextChild(e,t,n,i,r=0){for(let o=this;;){for(let{children:s,positions:l}=o._tree,a=t>0?s.length:-1;e!=a;e+=t){let a=s[e],u=l[e]+o.from,c;if(r&T.EnterBracketed&&a instanceof xn&&(c=b6.get(a))&&!c.overlay&&c.bracketed&&n>=u&&n<=u+a.length||xo(i,n,u,u+a.length)){if(a instanceof xr){if(r&T.ExcludeBuffers)continue;let s=a.findChild(0,a.buffer.length,t,n-u,i);if(s>-1)return new xd(new xh(o,a,e,u),null,s)}else if(r&T.IncludeAnonymous||!a.type.isAnonymous||xg(a)){let s;if(!(r&T.IgnoreMounts)&&(s=b6.get(a))&&!s.overlay)return new xa(s.tree,u,e,o);let l=new xa(a,u,e,o);return r&T.IncludeAnonymous||!l.type.isAnonymous?l:l.nextChild(t<0?a.children.length-1:0,t,n,i,r)}}}if(r&T.IncludeAnonymous||!o.type.isAnonymous||(e=o.index>=0?o.index+t:t<0?-1:o._parent._tree.children.length,!(o=o._parent)))return null}}get firstChild(){return this.nextChild(0,1,0,4)}get lastChild(){return this.nextChild(this._tree.children.length-1,-1,0,4)}childAfter(e){return this.nextChild(0,1,e,2)}childBefore(e){return this.nextChild(this._tree.children.length-1,-1,e,-2)}prop(e){return this._tree.prop(e)}enter(e,t,n=0){let i;if(!(n&T.IgnoreOverlays)&&(i=b6.get(this._tree))&&i.overlay){let r=e-this.from,o=n&T.EnterBracketed&&i.bracketed;for(let{from:e,to:n}of i.overlay)if((t>0||o?e<=r:e<r)&&(t<0||o?n>=r:n>r))return new xa(i.tree,i.overlay[0].from+this.from,-1,this)}return this.nextChild(0,1,e,t,n)}nextSignificantParent(){let e=this;for(;e.type.isAnonymous&&e._parent;)e=e._parent;return e}get parent(){return this._parent?this._parent.nextSignificantParent():null}get nextSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index+1,1,0,4):null}get prevSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index-1,-1,0,4):null}get tree(){return this._tree}toTree(){return this._tree}toString(){return this._tree.toString()}}function xu(e,t,n,i){let r=e.cursor(),o=[];if(!r.firstChild())return o;if(null!=n){for(let e=!1;!e;)if(e=r.type.is(n),!r.nextSibling())return o}for(;;){if(null!=i&&r.type.is(i))return o;if(r.type.is(t)&&o.push(r.node),!r.nextSibling())return null==i?o:[]}}function xc(e,t,n=t.length-1){for(let i=e;n>=0;i=i.parent){if(!i)return!1;if(!i.type.isAnonymous){if(t[n]&&t[n]!=i.name)return!1;n--}}return!0}class xh{constructor(e,t,n,i){this.parent=e,this.buffer=t,this.index=n,this.start=i}}class xd extends xl{get name(){return this.type.name}get from(){return this.context.start+this.context.buffer.buffer[this.index+1]}get to(){return this.context.start+this.context.buffer.buffer[this.index+2]}constructor(e,t,n){super(),this.context=e,this._parent=t,this.index=n,this.type=e.buffer.set.types[e.buffer.buffer[n]]}child(e,t,n){let{buffer:i}=this.context,r=i.findChild(this.index+4,i.buffer[this.index+3],e,t-this.context.start,n);return r<0?null:new xd(this.context,this,r)}get firstChild(){return this.child(1,0,4)}get lastChild(){return this.child(-1,0,4)}childAfter(e){return this.child(1,e,2)}childBefore(e){return this.child(-1,e,-2)}prop(e){return this.type.prop(e)}enter(e,t,n=0){if(n&T.ExcludeBuffers)return null;let{buffer:i}=this.context,r=i.findChild(this.index+4,i.buffer[this.index+3],t>0?1:-1,e-this.context.start,t);return r<0?null:new xd(this.context,this,r)}get parent(){return this._parent||this.context.parent.nextSignificantParent()}externalSibling(e){return this._parent?null:this.context.parent.nextChild(this.context.index+e,e,0,4)}get nextSibling(){let{buffer:e}=this.context,t=e.buffer[this.index+3];return t<(this._parent?e.buffer[this._parent.index+3]:e.buffer.length)?new xd(this.context,this._parent,t):this.externalSibling(1)}get prevSibling(){let{buffer:e}=this.context,t=this._parent?this._parent.index+4:0;return this.index==t?this.externalSibling(-1):new xd(this.context,this._parent,e.findChild(t,this.index,-1,0,4))}get tree(){return null}toTree(){let e=[],t=[],{buffer:n}=this.context,i=this.index+4,r=n.buffer[this.index+3];if(r>i){let o=n.buffer[this.index+1];e.push(n.slice(i,r,o)),t.push(0)}return new xn(this.type,e,t,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}}function xf(e){if(!e.length)return null;let t=0,n=e[0];for(let i=1;i<e.length;i++){let r=e[i];(r.from>n.from||r.to<n.to)&&(n=r,t=i)}let i=n instanceof xa&&n.index<0?null:n.parent,r=e.slice();return i?r[t]=i:r.splice(t,1),new xp(r,n)}class xp{constructor(e,t){this.heads=e,this.node=t}get next(){return xf(this.heads)}}class xm{get name(){return this.type.name}constructor(e,t=0){if(this.buffer=null,this.stack=[],this.index=0,this.bufferNode=null,this.mode=t&~T.EnterBracketed,e instanceof xa)this.yieldNode(e);else{this._tree=e.context.parent,this.buffer=e.context;for(let t=e._parent;t;t=t._parent)this.stack.unshift(t.index);this.bufferNode=e,this.yieldBuf(e.index)}}yieldNode(e){return!!e&&(this._tree=e,this.type=e.type,this.from=e.from,this.to=e.to,!0)}yieldBuf(e,t){this.index=e;let{start:n,buffer:i}=this.buffer;return this.type=t||i.set.types[i.buffer[e]],this.from=n+i.buffer[e+1],this.to=n+i.buffer[e+2],!0}yield(e){return!!e&&(e instanceof xa?(this.buffer=null,this.yieldNode(e)):(this.buffer=e.context,this.yieldBuf(e.index,e.type)))}toString(){return this.buffer?this.buffer.buffer.childString(this.index):this._tree.toString()}enterChild(e,t,n){if(!this.buffer)return this.yield(this._tree.nextChild(e<0?this._tree._tree.children.length-1:0,e,t,n,this.mode));let{buffer:i}=this.buffer,r=i.findChild(this.index+4,i.buffer[this.index+3],e,t-this.buffer.start,n);return!(r<0)&&(this.stack.push(this.index),this.yieldBuf(r))}firstChild(){return this.enterChild(1,0,4)}lastChild(){return this.enterChild(-1,0,4)}childAfter(e){return this.enterChild(1,e,2)}childBefore(e){return this.enterChild(-1,e,-2)}enter(e,t,n=this.mode){return this.buffer?!(n&T.ExcludeBuffers)&&this.enterChild(1,e,t):this.yield(this._tree.enter(e,t,n))}parent(){if(!this.buffer)return this.yieldNode(this.mode&T.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let e=this.mode&T.IncludeAnonymous?this.buffer.parent:this.buffer.parent.nextSignificantParent();return this.buffer=null,this.yieldNode(e)}sibling(e){if(!this.buffer)return!!this._tree._parent&&this.yield(this._tree.index<0?null:this._tree._parent.nextChild(this._tree.index+e,e,0,4,this.mode));let{buffer:t}=this.buffer,n=this.stack.length-1;if(e<0){let e=n<0?0:this.stack[n]+4;if(this.index!=e)return this.yieldBuf(t.findChild(e,this.index,-1,0,4))}else{let e=t.buffer[this.index+3];if(e<(n<0?t.buffer.length:t.buffer[this.stack[n]+3]))return this.yieldBuf(e)}return n<0&&this.yield(this.buffer.parent.nextChild(this.buffer.index+e,e,0,4,this.mode))}nextSibling(){return this.sibling(1)}prevSibling(){return this.sibling(-1)}atLastNode(e){let t,n,{buffer:i}=this;if(i){if(e>0){if(this.index<i.buffer.buffer.length)return!1}else for(let e=0;e<this.index;e++)if(i.buffer.buffer[e+3]<this.index)return!1;({index:t,parent:n}=i)}else({index:t,_parent:n}=this._tree);for(;n;{index:t,_parent:n}=n)if(t>-1)for(let i=t+e,r=e<0?-1:n._tree.children.length;i!=r;i+=e){let e=n._tree.children[i];if(this.mode&T.IncludeAnonymous||e instanceof xr||!e.type.isAnonymous||xg(e))return!1}return!0}move(e,t){if(t&&this.enterChild(e,0,4))return!0;for(;;){if(this.sibling(e))return!0;if(this.atLastNode(e)||!this.parent())return!1}}next(e=!0){return this.move(1,e)}prev(e=!0){return this.move(-1,e)}moveTo(e,t=0){for(;(this.from==this.to||(t<1?this.from>=e:this.from>e)||(t>-1?this.to<=e:this.to<e))&&this.parent(););for(;this.enterChild(1,e,t););return this}get node(){if(!this.buffer)return this._tree;let e=this.bufferNode,t=null,n=0;if(e&&e.context==this.buffer)i:for(let i=this.index,r=this.stack.length;r>=0;){for(let o=e;o;o=o._parent)if(o.index==i){if(i==this.index)return o;t=o,n=r+1;break i}i=this.stack[--r]}for(let e=n;e<this.stack.length;e++)t=new xd(this.buffer,t,this.stack[e]);return this.bufferNode=new xd(this.buffer,t,this.index)}get tree(){return this.buffer?null:this._tree._tree}iterate(e,t){for(let n=0;;){let i=!1;if(this.type.isAnonymous||!1!==e(this)){if(this.firstChild()){n++;continue}this.type.isAnonymous||(i=!0)}for(;;){if(i&&t&&t(this),i=this.type.isAnonymous,!n)return;if(this.nextSibling())break;this.parent(),n--,i=!0}}}matchContext(e){if(!this.buffer)return xc(this.node.parent,e);let{buffer:t}=this.buffer,{types:n}=t.set;for(let i=e.length-1,r=this.stack.length-1;i>=0;r--){if(r<0)return xc(this._tree,e,i);let o=n[t.buffer[this.stack[r]]];if(!o.isAnonymous){if(e[i]&&e[i]!=o.name)return!1;i--}}return!0}}function xg(e){return e.children.some(e=>e instanceof xr||!e.type.isAnonymous||xg(e))}let xv=new WeakMap;function xb(e,t){if(!e.isAnonymous||t instanceof xr||t.type!=e)return 1;let n=xv.get(t);if(null==n){for(let i of(n=1,t.children)){if(i.type!=e||!(i instanceof xn)){n=1;break}n+=xb(e,i)}xv.set(t,n)}return n}function xx(e,t,n,i,r,o,s,l,a){let u=0;for(let n=i;n<r;n++)u+=xb(e,t[n]);let c=Math.ceil(1.5*u/8),h=[],d=[];return!function t(n,i,r,s,l){for(let u=r;u<s;){let r=u,f=i[u],p=xb(e,n[u]);for(u++;u<s;u++){let t=xb(e,n[u]);if(p+t>=c)break;p+=t}if(u==r+1){if(p>c){let e=n[r];t(e.children,e.positions,0,e.children.length,i[r]+l);continue}h.push(n[r])}else{let t=i[u-1]+n[u-1].length-f;h.push(xx(e,n,i,r,u,f,t,null,a))}d.push(f+l-o)}}(t,n,i,r,0),(l||a)(h,d,s)}class xy{constructor(e,t,n,i,r=!1,o=!1){this.from=e,this.to=t,this.tree=n,this.offset=i,this.open=!!r|2*!!o}get openStart(){return(1&this.open)>0}get openEnd(){return(2&this.open)>0}static addTree(e,t=[],n=!1){let i=[new xy(0,e.length,e,0,!1,n)];for(let n of t)n.to>e.length&&i.push(n);return i}static applyChanges(e,t,n=128){if(!t.length)return e;let i=[],r=1,o=e.length?e[0]:null;for(let s=0,l=0,a=0;;s++){let u=s<t.length?t[s]:null,c=u?u.fromA:1e9;if(c-l>=n)for(;o&&o.from<c;){let t=o;if(l>=t.from||c<=t.to||a){let e=Math.max(t.from,l)-a,n=Math.min(t.to,c)-a;t=e>=n?null:new xy(e,n,t.tree,t.offset+a,s>0,!!u)}if(t&&i.push(t),o.to>c)break;o=r<e.length?e[r++]:null}if(!u)break;l=u.toA,a=u.toA-u.toB}return i}}class xw{startParse(e,t,n){return"string"==typeof e&&(e=new xS(e)),n=n?n.length?n.map(e=>new b3(e.from,e.to)):[new b3(0,0)]:[new b3(0,e.length)],this.createParse(e,t||[],n)}parse(e,t,n){let i=this.startParse(e,t,n);for(;;){let e=i.advance();if(e)return e}}}class xS{constructor(e){this.string=e}get length(){return this.string.length}chunk(e){return this.string.slice(e)}get lineChunks(){return!1}read(e,t){return this.string.slice(e,t)}}new b4({perNode:!0});let xC=0;class xA{constructor(e,t,n,i){this.name=e,this.set=t,this.base=n,this.modified=i,this.id=xC++}toString(){let{name:e}=this;for(let t of this.modified)t.name&&(e=`${t.name}(${e})`);return e}static define(e,t){if(e instanceof xA&&(t=e),null==t?void 0:t.base)throw Error("Can not derive from a modified tag");let n=new xA("string"==typeof e?e:"?",[],null,[]);if(n.set.push(n),t)for(let e of t.set)n.set.push(e);return n}static defineModifier(e){let t=new xM(e);return e=>e.modified.indexOf(t)>-1?e:xM.get(e.base||e,e.modified.concat(t).sort((e,t)=>e.id-t.id))}}let xk=0;class xM{constructor(e){this.name=e,this.instances=[],this.id=xk++}static get(e,t){if(!t.length)return e;let n=t[0].instances.find(n=>{var i,r;return n.base==e&&(i=t,r=n.modified,i.length==r.length&&i.every((e,t)=>e==r[t]))});if(n)return n;let i=[],r=new xA(e.name,i,e,t);for(let e of t)e.instances.push(r);let o=function(e){let t=[[]];for(let n=0;n<e.length;n++)for(let i=0,r=t.length;i<r;i++)t.push(t[i].concat(e[n]));return t.sort((e,t)=>t.length-e.length)}(t);for(let t of e.set)if(!t.modified.length)for(let e of o)i.push(xM.get(t,e));return r}}function xT(e){let t=Object.create(null);for(let n in e){let i=e[n];for(let e of(Array.isArray(i)||(i=[i]),n.split(" ")))if(e){let n=[],r=2,o=e;for(let t=0;;){if("..."==o&&t>0&&t+3==e.length){r=1;break}let i=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(o);if(!i)throw RangeError("Invalid path: "+e);if(n.push("*"==i[0]?"":'"'==i[0][0]?JSON.parse(i[0]):i[0]),(t+=i[0].length)==e.length)break;let s=e[t++];if(t==e.length&&"!"==s){r=0;break}if("/"!=s)throw RangeError("Invalid path: "+e);o=e.slice(t)}let s=n.length-1,l=n[s];if(!l)throw RangeError("Invalid path: "+e);let a=new xI(i,r,s>0?n.slice(0,s):null);t[l]=a.sort(t[l])}}return xD.add(t)}let xD=new b4({combine(e,t){let n,i,r;for(;e||t;){if(!e||t&&e.depth>=t.depth?(r=t,t=t.next):(r=e,e=e.next),n&&n.mode==r.mode&&!r.context&&!n.context)continue;let o=new xI(r.tags,r.mode,r.context);n?n.next=o:i=o,n=o}return i}});class xI{constructor(e,t,n,i){this.tags=e,this.mode=t,this.context=n,this.next=i}get opaque(){return 0==this.mode}get inherit(){return 1==this.mode}sort(e){return!e||e.depth<this.depth?(this.next=e,this):(e.next=this.sort(e.next),e)}get depth(){return this.context?this.context.length:0}}function xR(e,t){let n=Object.create(null);for(let t of e)if(Array.isArray(t.tag))for(let e of t.tag)n[e.id]=t.class;else n[t.tag.id]=t.class;let{scope:i,all:r=null}=t||{};return{style:e=>{let t=r;for(let i of e)for(let e of i.set){let i=n[e.id];if(i){t=t?t+" "+i:i;break}}return t},scope:i}}xI.empty=new xI([],2,null);class xE{constructor(e,t,n){this.at=e,this.highlighters=t,this.span=n,this.class=""}startSpan(e,t){t!=this.class&&(this.flush(e),e>this.at&&(this.at=e),this.class=t)}flush(e){e>this.at&&this.class&&this.span(this.at,e,this.class)}highlightRange(e,t,n,i,r){let{type:o,from:s,to:l}=e;if(s>=n||l<=t)return;o.isTop&&(r=this.highlighters.filter(e=>!e.scope||e.scope(o)));let a=i,u=function(e){let t=e.type.prop(xD);for(;t&&t.context&&!e.matchContext(t.context);)t=t.next;return t||null}(e)||xI.empty,c=function(e,t){let n=null;for(let i of e){let e=i.style(t);e&&(n=n?n+" "+e:e)}return n}(r,u.tags);if(c&&(a&&(a+=" "),a+=c,1==u.mode&&(i+=(i?" ":"")+c)),this.startSpan(Math.max(t,s),a),u.opaque)return;let h=e.tree&&e.tree.prop(b4.mounted);if(h&&h.overlay){let o=e.node.enter(h.overlay[0].from+s,1),u=this.highlighters.filter(e=>!e.scope||e.scope(h.tree.type)),c=e.firstChild();for(let d=0,f=s;;d++){let p=d<h.overlay.length?h.overlay[d]:null,m=p?p.from+s:l,g=Math.max(t,f),v=Math.min(n,m);if(g<v&&c)for(;e.from<v&&(this.highlightRange(e,g,v,i,r),this.startSpan(Math.min(v,e.to),a),!(e.to>=m)&&e.nextSibling()););if(!p||m>n)break;(f=p.to+s)>t&&(this.highlightRange(o.cursor(),Math.max(t,p.from+s),Math.min(n,f),"",u),this.startSpan(Math.min(n,f),a))}c&&e.parent()}else if(e.firstChild()){h&&(i="");do{if(e.to<=t)continue;if(e.from>=n)break;this.highlightRange(e,t,n,i,r),this.startSpan(Math.min(n,e.to),a)}while(e.nextSibling());e.parent()}}}let xO=xA.define,xP=xO(),xL=xO(),xj=xO(xL),xB=xO(xL),xF=xO(),xN=xO(xF),xV=xO(xF),xH=xO(),xz=xO(xH),xW=xO(),x$=xO(),x_=xO(),xU=xO(x_),xG=xO(),xq={comment:xP,lineComment:xO(xP),blockComment:xO(xP),docComment:xO(xP),name:xL,variableName:xO(xL),typeName:xj,tagName:xO(xj),propertyName:xB,attributeName:xO(xB),className:xO(xL),labelName:xO(xL),namespace:xO(xL),macroName:xO(xL),literal:xF,string:xN,docString:xO(xN),character:xO(xN),attributeValue:xO(xN),number:xV,integer:xO(xV),float:xO(xV),bool:xO(xF),regexp:xO(xF),escape:xO(xF),color:xO(xF),url:xO(xF),keyword:xW,self:xO(xW),null:xO(xW),atom:xO(xW),unit:xO(xW),modifier:xO(xW),operatorKeyword:xO(xW),controlKeyword:xO(xW),definitionKeyword:xO(xW),moduleKeyword:xO(xW),operator:x$,derefOperator:xO(x$),arithmeticOperator:xO(x$),logicOperator:xO(x$),bitwiseOperator:xO(x$),compareOperator:xO(x$),updateOperator:xO(x$),definitionOperator:xO(x$),typeOperator:xO(x$),controlOperator:xO(x$),punctuation:x_,separator:xO(x_),bracket:xU,angleBracket:xO(xU),squareBracket:xO(xU),paren:xO(xU),brace:xO(xU),content:xH,heading:xz,heading1:xO(xz),heading2:xO(xz),heading3:xO(xz),heading4:xO(xz),heading5:xO(xz),heading6:xO(xz),contentSeparator:xO(xH),list:xO(xH),quote:xO(xH),emphasis:xO(xH),strong:xO(xH),link:xO(xH),monospace:xO(xH),strikethrough:xO(xH),inserted:xO(),deleted:xO(),changed:xO(),invalid:xO(),meta:xG,documentMeta:xO(xG),annotation:xO(xG),processingInstruction:xO(xG),definition:xA.defineModifier("definition"),constant:xA.defineModifier("constant"),function:xA.defineModifier("function"),standard:xA.defineModifier("standard"),local:xA.defineModifier("local"),special:xA.defineModifier("special")};for(let e in xq){let t=xq[e];t instanceof xA&&(t.name=e)}xR([{tag:xq.link,class:"tok-link"},{tag:xq.heading,class:"tok-heading"},{tag:xq.emphasis,class:"tok-emphasis"},{tag:xq.strong,class:"tok-strong"},{tag:xq.keyword,class:"tok-keyword"},{tag:xq.atom,class:"tok-atom"},{tag:xq.bool,class:"tok-bool"},{tag:xq.url,class:"tok-url"},{tag:xq.labelName,class:"tok-labelName"},{tag:xq.inserted,class:"tok-inserted"},{tag:xq.deleted,class:"tok-deleted"},{tag:xq.literal,class:"tok-literal"},{tag:xq.string,class:"tok-string"},{tag:xq.number,class:"tok-number"},{tag:[xq.regexp,xq.escape,xq.special(xq.string)],class:"tok-string2"},{tag:xq.variableName,class:"tok-variableName"},{tag:xq.local(xq.variableName),class:"tok-variableName tok-local"},{tag:xq.definition(xq.variableName),class:"tok-variableName tok-definition"},{tag:xq.special(xq.variableName),class:"tok-variableName2"},{tag:xq.definition(xq.propertyName),class:"tok-propertyName tok-definition"},{tag:xq.typeName,class:"tok-typeName"},{tag:xq.namespace,class:"tok-namespace"},{tag:xq.className,class:"tok-className"},{tag:xq.macroName,class:"tok-macroName"},{tag:xq.propertyName,class:"tok-propertyName"},{tag:xq.operator,class:"tok-operator"},{tag:xq.comment,class:"tok-comment"},{tag:xq.meta,class:"tok-meta"},{tag:xq.invalid,class:"tok-invalid"},{tag:xq.punctuation,class:"tok-punctuation"}]);let xY=new b4,xK=new b4;class xX{constructor(e,t,n=[],i=""){this.data=e,this.name=i,fq.prototype.hasOwnProperty("tree")||Object.defineProperty(fq.prototype,"tree",{get(){return xJ(this)}}),this.parser=t,this.extension=[x9.of(this),fq.languageData.of((e,t,n)=>{let i=xZ(e,t,n),r=i.type.prop(xY);if(!r)return[];let o=e.facet(r),s=i.type.prop(xK);if(s){let r=i.resolve(t-i.from,n);for(let t of s)if(t.test(r,e)){let n=e.facet(t.facet);return"replace"==t.type?n:n.concat(o)}}return o})].concat(n)}isActiveAt(e,t,n=-1){return xZ(e,t,n).type.prop(xY)==this.data}findRegions(e){let t=e.facet(x9);if((null==t?void 0:t.data)==this.data)return[{from:0,to:e.doc.length}];if(!t||!t.allowsNesting)return[];let n=[],i=(e,t)=>{if(e.prop(xY)==this.data)return void n.push({from:t,to:t+e.length});let r=e.prop(b4.mounted);if(r){if(r.tree.prop(xY)==this.data){if(r.overlay)for(let e of r.overlay)n.push({from:e.from+t,to:e.to+t});else n.push({from:t,to:t+e.length});return}else if(r.overlay){let e=n.length;if(i(r.tree,r.overlay[0].from+t),n.length>e)return}}for(let n=0;n<e.children.length;n++){let r=e.children[n];r instanceof xn&&i(r,e.positions[n]+t)}};return i(xJ(e),0),n}get allowsNesting(){return!0}}function xZ(e,t,n){let i=e.facet(x9),r=xJ(e).topNode;if(!i||i.allowsNesting)for(let e=r;e;e=e.enter(t,n,T.ExcludeBuffers|T.EnterBracketed))e.type.isTop&&(r=e);return r}xX.setState=fV.define();class xQ extends xX{constructor(e,t,n){super(e,t,[],n),this.parser=t}static define(e){var t;let n=(t=e.languageData,fp.define({combine:t?e=>e.concat(t):void 0}));return new xQ(n,e.parser.configure({props:[xY.add(e=>e.isTop?n:void 0)]}),e.name)}configure(e,t){return new xQ(this.data,this.parser.configure(e),t||this.name)}get allowsNesting(){return this.parser.hasWrappers()}}function xJ(e){let t=e.field(xX.state,!1);return t?t.tree:xn.empty}class x0{constructor(e){this.doc=e,this.cursorPos=0,this.string="",this.cursor=e.iter()}get length(){return this.doc.length}syncTo(e){return this.string=this.cursor.next(e-this.cursorPos).value,this.cursorPos=e+this.string.length,this.cursorPos-this.string.length}chunk(e){return this.syncTo(e),this.string}get lineChunks(){return!0}read(e,t){let n=this.cursorPos-this.string.length;return e<n||t>=this.cursorPos?this.doc.sliceString(e,t):this.string.slice(e-n,t-n)}}let x1=null;class x2{constructor(e,t,n=[],i,r,o,s,l){this.parser=e,this.state=t,this.fragments=n,this.tree=i,this.treeLen=r,this.viewport=o,this.skipped=s,this.scheduleOn=l,this.parse=null,this.tempSkipped=[]}static create(e,t,n){return new x2(e,t,[],xn.empty,0,n,[],null)}startParse(){return this.parser.startParse(new x0(this.state.doc),this.fragments)}work(e,t){return(null!=t&&t>=this.state.doc.length&&(t=void 0),this.tree!=xn.empty&&this.isDone(null!=t?t:this.state.doc.length))?(this.takeTree(),!0):this.withContext(()=>{var n;if("number"==typeof e){let t=Date.now()+e;e=()=>Date.now()>t}for(this.parse||(this.parse=this.startParse()),null!=t&&(null==this.parse.stoppedAt||this.parse.stoppedAt>t)&&t<this.state.doc.length&&this.parse.stopAt(t);;){let i=this.parse.advance();if(i){if(this.fragments=this.withoutTempSkipped(xy.addTree(i,this.fragments,null!=this.parse.stoppedAt)),this.treeLen=null!=(n=this.parse.stoppedAt)?n:this.state.doc.length,this.tree=i,this.parse=null,!(this.treeLen<(null!=t?t:this.state.doc.length)))return!0;this.parse=this.startParse()}if(e())return!1}})}takeTree(){let e,t;this.parse&&(e=this.parse.parsedPos)>=this.treeLen&&((null==this.parse.stoppedAt||this.parse.stoppedAt>e)&&this.parse.stopAt(e),this.withContext(()=>{for(;!(t=this.parse.advance()););}),this.treeLen=e,this.tree=t,this.fragments=this.withoutTempSkipped(xy.addTree(this.tree,this.fragments,!0)),this.parse=null)}withContext(e){let t=x1;x1=this;try{return e()}finally{x1=t}}withoutTempSkipped(e){for(let t;t=this.tempSkipped.pop();)e=x5(e,t.from,t.to);return e}changes(e,t){let{fragments:n,tree:i,treeLen:r,viewport:o,skipped:s}=this;if(this.takeTree(),!e.empty){let t=[];if(e.iterChangedRanges((e,n,i,r)=>t.push({fromA:e,toA:n,fromB:i,toB:r})),n=xy.applyChanges(n,t),i=xn.empty,r=0,o={from:e.mapPos(o.from,-1),to:e.mapPos(o.to,1)},this.skipped.length)for(let t of(s=[],this.skipped)){let n=e.mapPos(t.from,1),i=e.mapPos(t.to,-1);n<i&&s.push({from:n,to:i})}}return new x2(this.parser,t,n,i,r,o,s,this.scheduleOn)}updateViewport(e){if(this.viewport.from==e.from&&this.viewport.to==e.to)return!1;this.viewport=e;let t=this.skipped.length;for(let t=0;t<this.skipped.length;t++){let{from:n,to:i}=this.skipped[t];n<e.to&&i>e.from&&(this.fragments=x5(this.fragments,n,i),this.skipped.splice(t--,1))}return!(this.skipped.length>=t)&&(this.reset(),!0)}reset(){this.parse&&(this.takeTree(),this.parse=null)}skipUntilInView(e,t){this.skipped.push({from:e,to:t})}static getSkippingParser(e){return new class extends xw{createParse(t,n,i){let r=i[0].from,o=i[i.length-1].to;return{parsedPos:r,advance(){let t=x1;if(t){for(let e of i)t.tempSkipped.push(e);e&&(t.scheduleOn=t.scheduleOn?Promise.all([t.scheduleOn,e]):e)}return this.parsedPos=o,new xn(b9.none,[],[],o-r)},stoppedAt:null,stopAt(){}}}}}isDone(e){e=Math.min(e,this.state.doc.length);let t=this.fragments;return this.treeLen>=e&&t.length&&0==t[0].from&&t[0].to>=e}static get(){return x1}}function x5(e,t,n){return xy.applyChanges(e,[{fromA:t,toA:n,fromB:t,toB:n}])}class x3{constructor(e){this.context=e,this.tree=e.tree}apply(e){if(!e.docChanged&&this.tree==this.context.tree)return this;let t=this.context.changes(e.changes,e.state),n=this.context.treeLen==e.startState.doc.length?void 0:Math.max(e.changes.mapPos(this.context.treeLen),t.viewport.to);return t.work(20,n)||t.takeTree(),new x3(t)}static init(e){let t=Math.min(3e3,e.doc.length),n=x2.create(e.facet(x9).parser,e,{from:0,to:t});return n.work(20,t)||n.takeTree(),new x3(n)}}xX.state=fy.define({create:x3.init,update(e,t){for(let e of t.effects)if(e.is(xX.setState))return e.value;return t.startState.facet(x9)!=t.state.facet(x9)?x3.init(t.state):e.apply(t)}});let x4=e=>{let t=setTimeout(()=>e(),500);return()=>clearTimeout(t)};"u">typeof requestIdleCallback&&(x4=e=>{let t=-1,n=setTimeout(()=>{t=requestIdleCallback(e,{timeout:400})},100);return()=>t<0?clearTimeout(n):cancelIdleCallback(t)});let x6="u">typeof navigator&&(null==(D=navigator.scheduling)?void 0:D.isInputPending)?()=>navigator.scheduling.isInputPending():null,x8=mO.fromClass(class{constructor(e){this.view=e,this.working=null,this.workScheduled=0,this.chunkEnd=-1,this.chunkBudget=-1,this.work=this.work.bind(this),this.scheduleWork()}update(e){let t=this.view.state.field(xX.state).context;(t.updateViewport(e.view.viewport)||this.view.viewport.to>t.treeLen)&&this.scheduleWork(),(e.docChanged||e.selectionSet)&&(this.view.hasFocus&&(this.chunkBudget+=50),this.scheduleWork()),this.checkAsyncSchedule(t)}scheduleWork(){if(this.working)return;let{state:e}=this.view,t=e.field(xX.state);t.tree==t.context.tree&&t.context.isDone(e.doc.length)||(this.working=x4(this.work))}work(e){this.working=null;let t=Date.now();if(this.chunkEnd<t&&(this.chunkEnd<0||this.view.hasFocus)&&(this.chunkEnd=t+3e4,this.chunkBudget=3e3),this.chunkBudget<=0)return;let{state:n,viewport:{to:i}}=this.view,r=n.field(xX.state);if(r.tree==r.context.tree&&r.context.isDone(i+1e5))return;let o=Date.now()+Math.min(this.chunkBudget,100,e&&!x6?Math.max(25,e.timeRemaining()-5):1e9),s=r.context.treeLen<i&&n.doc.length>i+1e3,l=r.context.work(()=>x6&&x6()||Date.now()>o,i+1e5*!s);this.chunkBudget-=Date.now()-t,(l||this.chunkBudget<=0)&&(r.context.takeTree(),this.view.dispatch({effects:xX.setState.of(new x3(r.context))})),this.chunkBudget>0&&!(l&&!s)&&this.scheduleWork(),this.checkAsyncSchedule(r.context)}checkAsyncSchedule(e){e.scheduleOn&&(this.workScheduled++,e.scheduleOn.then(()=>this.scheduleWork()).catch(e=>mD(this.view.state,e)).then(()=>this.workScheduled--),e.scheduleOn=null)}destroy(){this.working&&this.working()}isWorking(){return!!(this.working||this.workScheduled>0)}},{eventHandlers:{focus(){this.scheduleWork()}}}),x9=fp.define({combine:e=>e.length?e[0]:null,enables:e=>[xX.state,x8,vT.contentAttributes.compute([e],t=>{let n=t.facet(e);return n&&n.name?{"data-language":n.name}:{}})]});class x7{constructor(e,t=[]){this.language=e,this.support=t,this.extension=[e,t]}}let ye=fp.define(),yt=fp.define({combine:e=>{if(!e.length)return" ";let t=e[0];if(!t||/\S/.test(t)||Array.from(t).some(e=>e!=t[0]))throw Error("Invalid indent unit: "+JSON.stringify(e[0]));return t}});function yn(e){let t=e.facet(yt);return 9==t.charCodeAt(0)?e.tabSize*t.length:t.length}function yi(e,t){let n="",i=e.tabSize,r=e.facet(yt)[0];if(" "==r){for(;t>=i;)n+=" ",t-=i;r=" "}for(let e=0;e<t;e++)n+=r;return n}function yr(e,t){for(let n of(e instanceof fq&&(e=new yo(e)),e.state.facet(ye))){let i=n(e,t);if(void 0!==i)return i}let n=xJ(e.state);return n.length>=t?function(e,t,n){let i=t.resolveStack(n),r=t.resolveInner(n,-1).resolve(n,0).enterUnfinishedNodesBefore(n);if(r!=i.node){let e=[];for(let t=r;t&&!(t.from<i.node.from||t.to>i.node.to||t.from==i.node.from&&t.type==i.node.type);t=t.parent)e.push(t);for(let t=e.length-1;t>=0;t--)i={node:e[t],next:i}}return yl(i,e,n)}(e,n,t):null}class yo{constructor(e,t={}){this.state=e,this.options=t,this.unit=yn(e)}lineAt(e,t=1){let n=this.state.doc.lineAt(e),{simulateBreak:i,simulateDoubleBreak:r}=this.options;if(null!=i&&i>=n.from&&i<=n.to)if(r&&i==e)return{text:"",from:e};else if(t<0?i<e:i<=e)return{text:n.text.slice(i-n.from),from:i};else return{text:n.text.slice(0,i-n.from),from:n.from};return n}textAfterPos(e,t=1){if(this.options.simulateDoubleBreak&&e==this.options.simulateBreak)return"";let{text:n,from:i}=this.lineAt(e,t);return n.slice(e-i,Math.min(n.length,e+100-i))}column(e,t=1){let{text:n,from:i}=this.lineAt(e,t),r=this.countColumn(n,e-i),o=this.options.overrideIndentation?this.options.overrideIndentation(i):-1;return o>-1&&(r+=o-this.countColumn(n,n.search(/\S|$/))),r}countColumn(e,t=e.length){return pn(e,this.state.tabSize,t)}lineIndent(e,t=1){let{text:n,from:i}=this.lineAt(e,t),r=this.options.overrideIndentation;if(r){let e=r(i);if(e>-1)return e}return this.countColumn(n,n.search(/\S|$/))}get simulatedBreak(){return this.options.simulateBreak||null}}let ys=new b4;function yl(e,t,n){for(let i=e;i;i=i.next){let e=function(e){let t=e.type.prop(ys);if(t)return t;let n=e.firstChild,i;if(n&&(i=n.type.prop(b4.closedBy))){let t=e.lastChild,n=t&&i.indexOf(t.name)>-1;return e=>(function(e,t,n,i){let r=e.textAfter,o=r.match(/^\s*/)[0].length,s=n&&r.slice(o,o+n.length)==n||i==e.pos+o,l=t?function(e){let t=e.node,n=t.childAfter(t.from),i=t.lastChild;if(!n)return null;let r=e.options.simulateBreak,o=e.state.doc.lineAt(n.from),s=null==r||r<=o.from?o.to:Math.min(o.to,r);for(let e=n.to;;){let r=t.childAfter(e);if(!r||r==i)return null;if(!r.type.isSkipped){if(r.from>=s)return null;let e=/^ */.exec(o.text.slice(n.to-o.from))[0].length;return{from:n.from,to:n.to+e}}e=r.to}}(e):null;return l?s?e.column(l.from):e.column(l.to):e.baseIndent+(s?0:+e.unit)})(e,!0,void 0,n&&!(e.pos==e.options.simulateBreak&&e.options.simulateDoubleBreak)?t.from:void 0)}return null==e.parent?ya:null}(i.node);if(e)return e(yu.create(t,n,i))}return 0}function ya(){return 0}class yu extends yo{constructor(e,t,n){super(e.state,e.options),this.base=e,this.pos=t,this.context=n}get node(){return this.context.node}static create(e,t,n){return new yu(e,t,n)}get textAfter(){return this.textAfterPos(this.pos)}get baseIndent(){return this.baseIndentFor(this.node)}baseIndentFor(e){let t=this.state.doc.lineAt(e.from);for(;;){let n=e.resolve(t.from);for(;n.parent&&n.parent.from==n.from;)n=n.parent;if(function(e,t){for(let n=t;n;n=n.parent)if(e==n)return!0;return!1}(n,e))break;t=this.state.doc.lineAt(n.from)}return this.lineIndent(t.from)}continue(){return yl(this.context.next,this.base,this.pos)}}function yc({except:e,units:t=1}={}){return n=>{let i=e&&e.test(n.textAfter);return n.baseIndent+(i?0:t*n.unit)}}let yh=fp.define(),yd=new b4;function yf(e,t,n){for(let i of e.facet(yh)){let r=i(e,t,n);if(r)return r}return function(e,t,n){let i=xJ(e);if(i.length<n)return null;let r=i.resolveStack(n,1),o=null;for(let s=r;s;s=s.next){let r=s.node;if(r.to<=n||r.from>n)continue;if(o&&r.from<t)break;let l=r.type.prop(yd);if(l&&(r.to<i.length-50||i.length==e.doc.length||!function(e){let t=e.lastChild;return t&&t.to==e.to&&t.type.isError}(r))){let i=l(r,e);i&&i.from<=n&&i.from>=t&&i.to>n&&(o=i)}}return o}(e,t,n)}function yp(e,t){let n=t.mapPos(e.from,1),i=t.mapPos(e.to,-1);return n>=i?void 0:{from:n,to:i}}let ym=fV.define({map:yp}),yg=fV.define({map:yp});function yv(e){let t=[];for(let{head:n}of e.state.selection.ranges)t.some(e=>e.from<=n&&e.to>=n)||t.push(e.lineBlockAt(n));return t}let yb=fy.define({create:()=>pj.none,update(e,t){for(let n of(t.isUserEvent("delete")&&t.changes.iterChangedRanges((t,n)=>e=yx(e,t,n)),e=e.map(t.changes),t.effects))if(n.is(ym)&&!function(e,t,n){let i=!1;return e.between(t,t,(e,r)=>{e==t&&r==n&&(i=!0)}),i}(e,n.value.from,n.value.to)){let{preparePlaceholder:i}=t.state.facet(yk),r=i?pj.replace({widget:new yI(i(t.state,n.value))}):yD;e=e.update({add:[r.range(n.value.from,n.value.to)]})}else n.is(yg)&&(e=e.update({filter:(e,t)=>n.value.from!=e||n.value.to!=t,filterFrom:n.value.from,filterTo:n.value.to}));return t.selection&&(e=yx(e,t.selection.main.head)),e},provide:e=>vT.decorations.from(e),toJSON(e,t){let n=[];return e.between(0,t.doc.length,(e,t)=>{n.push(e,t)}),n},fromJSON(e){if(!Array.isArray(e)||e.length%2)throw RangeError("Invalid JSON for fold state");let t=[];for(let n=0;n<e.length;){let i=e[n++],r=e[n++];if("number"!=typeof i||"number"!=typeof r)throw RangeError("Invalid JSON for fold state");t.push(yD.range(i,r))}return pj.set(t,!0)}});function yx(e,t,n=t){let i=!1;return e.between(t,n,(e,r)=>{e<n&&r>t&&(i=!0)}),i?e.update({filterFrom:t,filterTo:n,filter:(e,i)=>e>=n||i<=t}):e}function yy(e,t,n){var i;let r=null;return null==(i=e.field(yb,!1))||i.between(t,n,(e,t)=>{(!r||r.from>e)&&(r={from:e,to:t})}),r}function yw(e,t){return e.field(yb,!1)?t:t.concat(fV.appendConfig.of(yM()))}function yS(e,t,n=!0){let i=e.state.doc.lineAt(t.from).number,r=e.state.doc.lineAt(t.to).number;return vT.announce.of(`${e.state.phrase(n?"Folded lines":"Unfolded lines")} ${i} ${e.state.phrase("to")} ${r}.`)}let yC=[{key:"Ctrl-Shift-[",mac:"Cmd-Alt-[",run:e=>{for(let t of yv(e)){let n=yf(e.state,t.from,t.to);if(n)return e.dispatch({effects:yw(e.state,[ym.of(n),yS(e,n)])}),!0}return!1}},{key:"Ctrl-Shift-]",mac:"Cmd-Alt-]",run:e=>{if(!e.state.field(yb,!1))return!1;let t=[];for(let n of yv(e)){let i=yy(e.state,n.from,n.to);i&&t.push(yg.of(i),yS(e,i,!1))}return t.length&&e.dispatch({effects:t}),t.length>0}},{key:"Ctrl-Alt-[",run:e=>{let{state:t}=e,n=[];for(let i=0;i<t.doc.length;){let r=e.lineBlockAt(i),o=yf(t,r.from,r.to);o&&n.push(ym.of(o)),i=(o?e.lineBlockAt(o.to):r).to+1}return n.length&&e.dispatch({effects:yw(e.state,n)}),!!n.length}},{key:"Ctrl-Alt-]",run:e=>{let t=e.state.field(yb,!1);if(!t||!t.size)return!1;let n=[];return t.between(0,e.state.doc.length,(e,t)=>{n.push(yg.of({from:e,to:t}))}),e.dispatch({effects:n}),!0}}],yA={placeholderDOM:null,preparePlaceholder:null,placeholderText:"…"},yk=fp.define({combine:e=>fY(e,yA)});function yM(e){let t=[yb,yO];return e&&t.push(yk.of(e)),t}function yT(e,t){let{state:n}=e,i=n.facet(yk),r=t=>{let n=e.lineBlockAt(e.posAtDOM(t.target)),i=yy(e.state,n.from,n.to);i&&e.dispatch({effects:yg.of(i)}),t.preventDefault()};if(i.placeholderDOM)return i.placeholderDOM(e,r,t);let o=document.createElement("span");return o.textContent=i.placeholderText,o.setAttribute("aria-label",n.phrase("folded code")),o.title=n.phrase("unfold"),o.className="cm-foldPlaceholder",o.onclick=r,o}let yD=pj.replace({widget:new class extends pP{toDOM(e){return yT(e,null)}}});class yI extends pP{constructor(e){super(),this.value=e}eq(e){return this.value==e.value}toDOM(e){return yT(e,this.value)}}let yR={openText:"⌄",closedText:"›",markerDOM:null,domEventHandlers:{},foldingChanged:()=>!1};class yE extends bL{constructor(e,t){super(),this.config=e,this.open=t}eq(e){return this.config==e.config&&this.open==e.open}toDOM(e){if(this.config.markerDOM)return this.config.markerDOM(this.open);let t=document.createElement("span");return t.textContent=this.open?this.config.openText:this.config.closedText,t.title=e.state.phrase(this.open?"Fold line":"Unfold line"),t}}let yO=vT.baseTheme({".cm-foldPlaceholder":{backgroundColor:"#eee",border:"1px solid #ddd",color:"#888",borderRadius:".2em",margin:"0 1px",padding:"0 1px",cursor:"pointer"},".cm-foldGutter span":{padding:"0 1px",cursor:"pointer"}});class yP{constructor(e,t){let n;function i(e){let t=pl.newName();return(n||(n=Object.create(null)))["."+t]=e,t}this.specs=e;const r="string"==typeof t.all?t.all:t.all?i(t.all):void 0,o=t.scope;this.scope=o instanceof xX?e=>e.prop(xY)==o.data:o?e=>e==o:void 0,this.style=xR(e.map(e=>({tag:e.tag,class:e.class||i(Object.assign({},e,{tag:null}))})),{all:r}).style,this.module=n?new pl(n):null,this.themeType=t.themeType}static define(e,t){return new yP(e,t||{})}}let yL=fp.define(),yj=fp.define({combine:e=>e.length?[e[0]]:null});function yB(e){let t=e.facet(yL);return t.length?t:e.facet(yj)}function yF(e,t){let n=[yN],i;return e instanceof yP&&(e.module&&n.push(vT.styleModule.of(e.module)),i=e.themeType),(null==t?void 0:t.fallback)?n.push(yj.of(e)):i?n.push(yL.computeN([vT.darkTheme],t=>t.facet(vT.darkTheme)==("dark"==i)?[e]:[])):n.push(yL.of(e)),n}let yN=fS.high(mO.fromClass(class{constructor(e){this.markCache=Object.create(null),this.tree=xJ(e.state),this.decorations=this.buildDeco(e,yB(e.state)),this.decoratedTo=e.viewport.to}update(e){let t=xJ(e.state),n=yB(e.state),i=n!=yB(e.startState),{viewport:r}=e.view,o=e.changes.mapPos(this.decoratedTo,1);t.length<r.to&&!i&&t.type==this.tree.type&&o>=r.to?(this.decorations=this.decorations.map(e.changes),this.decoratedTo=o):(t!=this.tree||e.viewportChanged||i)&&(this.tree=t,this.decorations=this.buildDeco(e.view,n),this.decoratedTo=r.to)}buildDeco(e,t){if(!t||!this.tree.length)return pj.none;let n=new f1;for(let{from:i,to:r}of e.visibleRanges)!function(e,t,n,i=0,r=e.length){let o=new xE(i,Array.isArray(t)?t:[t],n);o.highlightRange(e.cursor(),i,r,"",o.highlighters),o.flush(r)}(this.tree,t,(e,t,i)=>{n.add(e,t,this.markCache[i]||(this.markCache[i]=pj.mark({class:i})))},i,r);return n.finish()}},{decorations:e=>e.decorations})),yV=yP.define([{tag:xq.meta,color:"#404740"},{tag:xq.link,textDecoration:"underline"},{tag:xq.heading,textDecoration:"underline",fontWeight:"bold"},{tag:xq.emphasis,fontStyle:"italic"},{tag:xq.strong,fontWeight:"bold"},{tag:xq.strikethrough,textDecoration:"line-through"},{tag:xq.keyword,color:"#708"},{tag:[xq.atom,xq.bool,xq.url,xq.contentSeparator,xq.labelName],color:"#219"},{tag:[xq.literal,xq.inserted],color:"#164"},{tag:[xq.string,xq.deleted],color:"#a11"},{tag:[xq.regexp,xq.escape,xq.special(xq.string)],color:"#e40"},{tag:xq.definition(xq.variableName),color:"#00f"},{tag:xq.local(xq.variableName),color:"#30a"},{tag:[xq.typeName,xq.namespace],color:"#085"},{tag:xq.className,color:"#167"},{tag:[xq.special(xq.variableName),xq.macroName],color:"#256"},{tag:xq.definition(xq.propertyName),color:"#00c"},{tag:xq.comment,color:"#940"},{tag:xq.invalid,color:"#f00"}]),yH=vT.baseTheme({"&.cm-focused .cm-matchingBracket":{backgroundColor:"#328c8252"},"&.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bb555544"}}),yz="()[]{}",yW=fp.define({combine:e=>fY(e,{afterCursor:!0,brackets:yz,maxScanDistance:1e4,renderMatch:yU})}),y$=pj.mark({class:"cm-matchingBracket"}),y_=pj.mark({class:"cm-nonmatchingBracket"});function yU(e){let t=[],n=e.matched?y$:y_;return t.push(n.range(e.start.from,e.start.to)),e.end&&t.push(n.range(e.end.from,e.end.to)),t}function yG(e){let t=[],n=e.facet(yW);for(let i of e.selection.ranges){if(!i.empty)continue;let r=yZ(e,i.head,-1,n)||i.head>0&&yZ(e,i.head-1,1,n)||n.afterCursor&&(yZ(e,i.head,1,n)||i.head<e.doc.length&&yZ(e,i.head+1,-1,n));r&&(t=t.concat(n.renderMatch(r,e)))}return pj.set(t,!0)}let yq=[mO.fromClass(class{constructor(e){this.paused=!1,this.decorations=yG(e.state)}update(e){(e.docChanged||e.selectionSet||this.paused)&&(e.view.composing?(this.decorations=this.decorations.map(e.changes),this.paused=!0):(this.decorations=yG(e.state),this.paused=!1))}},{decorations:e=>e.decorations}),yH],yY=new b4;function yK(e,t,n){let i=e.prop(t<0?b4.openedBy:b4.closedBy);if(i)return i;if(1==e.name.length){let i=n.indexOf(e.name);if(i>-1&&i%2==+(t<0))return[n[i+t]]}return null}function yX(e){let t=e.type.prop(yY);return t?t(e.node):e}function yZ(e,t,n,i={}){let r=i.maxScanDistance||1e4,o=i.brackets||yz,s=xJ(e),l=s.resolveInner(t,n);for(let e=l;e;e=e.parent){let i=yK(e.type,n,o);if(i&&e.from<e.to){let r=yX(e);if(r&&(n>0?t>=r.from&&t<r.to:t>r.from&&t<=r.to))return function(e,t,n,i,r){let o=t.parent,s={from:n.from,to:n.to},l=0,a=null==o?void 0:o.cursor();if(a&&(e<0?a.childBefore(t.from):a.childAfter(t.to)))do if(e<0?a.to<=t.from:a.from>=t.to){if(0==l&&i.indexOf(a.type.name)>-1&&a.from<a.to){let e=yX(a);return{start:s,end:e?{from:e.from,to:e.to}:void 0,matched:!0}}else if(yK(a.type,e,r))l++;else if(yK(a.type,-e,r)){if(0==l){let e=yX(a);return{start:s,end:e&&e.from<e.to?{from:e.from,to:e.to}:void 0,matched:!1}}l--}}while(e<0?a.prevSibling():a.nextSibling());return{start:s,matched:!1}}(n,e,r,i,o)}}return function(e,t,n,i,r,o,s){if(n<0?!t:t==e.doc.length)return null;let l=n<0?e.sliceDoc(t-1,t):e.sliceDoc(t,t+1),a=s.indexOf(l);if(a<0||a%2==0!=n>0)return null;let u={from:n<0?t-1:t,to:n>0?t+1:t},c=e.doc.iterRange(t,n>0?e.doc.length:0),h=0;for(let e=0;!c.next().done&&e<=o;){let o=c.value;n<0&&(e+=o.length);let l=t+e*n;for(let e=n>0?0:o.length-1,t=n>0?o.length:-1;e!=t;e+=n){let t=s.indexOf(o[e]);if(!(t<0)&&i.resolveInner(l+e,1).type==r)if(t%2==0==n>0)h++;else{if(1==h)return{start:u,end:{from:l+e,to:l+e+1},matched:t>>1==a>>1};h--}}n>0&&(e+=o.length)}return c.done?{start:u,matched:!1}:null}(e,t,n,s,l.type,r,o)}let yQ=Object.create(null),yJ=[b9.none],y0=[],y1=Object.create(null),y2=Object.create(null);for(let[e,t]of[["variable","variableName"],["variable-2","variableName.special"],["string-2","string.special"],["def","variableName.definition"],["tag","tagName"],["attribute","attributeName"],["type","typeName"],["builtin","variableName.standard"],["qualifier","modifier"],["error","invalid"],["header","heading"],["property","propertyName"]])y2[e]=function(e,t){let n=[];for(let i of t.split(" ")){let t=[];for(let n of i.split(".")){let i=e[n]||xq[n];i?"function"==typeof i?t.length?t=t.map(i):y5(n,`Modifier ${n} used at start of tag`):t.length?y5(n,`Tag ${n} used as modifier`):t=Array.isArray(i)?i:[i]:y5(n,`Unknown highlighting tag ${n}`)}for(let e of t)n.push(e)}if(!n.length)return 0;let i=t.replace(/ /g,"_"),r=i+" "+n.map(e=>e.id),o=y1[r];if(o)return o.id;let s=y1[r]=b9.define({id:yJ.length,name:i,props:[xT({[i]:n})]});return yJ.push(s),s.id}(yQ,t);function y5(e,t){y0.indexOf(e)>-1||(y0.push(e),console.warn(t))}function y3(e,t){return({state:n,dispatch:i})=>{if(n.readOnly)return!1;let r=e(t,n);return!!r&&(i(n.update(r)),!0)}}p7.RTL,p7.LTR;let y4=y3(function(e,t,n=t.selection.ranges){let i=[],r=-1;r:for(let{from:e,to:o}of n){let n=i.length,s=1e9,l;for(let n=e;n<=o;){let a=t.doc.lineAt(n);if(void 0==l&&!(l=y9(t,a.from).line))continue r;if(a.from>r&&(e==o||o>a.from)){r=a.from;let e=/^\s*/.exec(a.text)[0].length,t=e==a.length,n=a.text.slice(e,e+l.length)==l?e:-1;e<a.text.length&&e<s&&(s=e),i.push({line:a,comment:n,token:l,indent:e,empty:t,single:!1})}n=a.to+1}if(s<1e9)for(let e=n;e<i.length;e++)i[e].indent<i[e].line.text.length&&(i[e].indent=s);i.length==n+1&&(i[n].single=!0)}if(2!=e&&i.some(e=>e.comment<0&&(!e.empty||e.single))){let e=[];for(let{line:t,token:n,indent:r,empty:o,single:s}of i)(s||!o)&&e.push({from:t.from+r,insert:n+" "});let n=t.changes(e);return{changes:n,selection:t.selection.map(n,1)}}if(1!=e&&i.some(e=>e.comment>=0)){let e=[];for(let{line:t,comment:n,token:r}of i)if(n>=0){let i=t.from+n,o=i+r.length;" "==t.text[o-t.from]&&o++,e.push({from:i,to:o})}return{changes:e}}return null},0),y6=y3(y7,0),y8=y3((e,t)=>y7(e,t,function(e){let t=[];for(let n of e.selection.ranges){let i=e.doc.lineAt(n.from),r=n.to<=i.to?i:e.doc.lineAt(n.to);r.from>i.from&&r.from==n.to&&(r=n.to==i.to+1?i:e.doc.lineAt(n.to-1));let o=t.length-1;o>=0&&t[o].to>i.from?t[o].to=r.to:t.push({from:i.from+/^\s*/.exec(i.text)[0].length,to:r.to})}return t}(t)),0);function y9(e,t){let n=e.languageDataAt("commentTokens",t,1);return n.length?n[0]:{}}function y7(e,t,n=t.selection.ranges){let i=n.map(e=>y9(t,e.from).block);if(!i.every(e=>e))return null;let r=n.map((e,n)=>(function(e,{open:t,close:n},i,r){let o,s,l=e.sliceDoc(i-50,i),a=e.sliceDoc(r,r+50),u=/\s*$/.exec(l)[0].length,c=/^\s*/.exec(a)[0].length,h=l.length-u;if(l.slice(h-t.length,h)==t&&a.slice(c,c+n.length)==n)return{open:{pos:i-u,margin:u&&1},close:{pos:r+c,margin:c&&1}};r-i<=100?o=s=e.sliceDoc(i,r):(o=e.sliceDoc(i,i+50),s=e.sliceDoc(r-50,r));let d=/^\s*/.exec(o)[0].length,f=/\s*$/.exec(s)[0].length,p=s.length-f-n.length;return o.slice(d,d+t.length)==t&&s.slice(p,p+n.length)==n?{open:{pos:i+d+t.length,margin:+!!/\s/.test(o.charAt(d+t.length))},close:{pos:r-f-n.length,margin:+!!/\s/.test(s.charAt(p-1))}}:null})(t,i[n],e.from,e.to));if(2!=e&&!r.every(e=>e))return{changes:t.changes(n.map((e,t)=>r[t]?[]:[{from:e.from,insert:i[t].open+" "},{from:e.to,insert:" "+i[t].close}]))};if(1!=e&&r.some(e=>e)){let e=[];for(let t=0,n;t<r.length;t++)if(n=r[t]){let r=i[t],{open:o,close:s}=n;e.push({from:o.pos-r.open.length,to:o.pos+o.margin},{from:s.pos-s.margin,to:s.pos+r.close.length})}return{changes:e}}return null}let we=fB.define(),wt=fB.define(),wn=fp.define(),wi=fp.define({combine:e=>fY(e,{minDepth:100,newGroupDelay:500,joinToEvent:(e,t)=>t},{minDepth:Math.max,newGroupDelay:Math.min,joinToEvent:(e,t)=>(n,i)=>e(n,i)||t(n,i)})}),wr=fy.define({create:()=>wv.empty,update(e,t){let n=t.state.facet(wi),i=t.annotation(we);if(i){let r=wc.fromTransaction(t,i.selection),o=i.side,s=0==o?e.undone:e.done;return s=r?wh(s,s.length,n.minDepth,r):wp(s,t.startState.selection),new wv(0==o?i.rest:s,0==o?s:i.rest)}let r=t.annotation(wt);if(("full"==r||"before"==r)&&(e=e.isolate()),!1===t.annotation(fH.addToHistory))return t.changes.empty?e:e.addMapping(t.changes.desc);let o=wc.fromTransaction(t),s=t.annotation(fH.time),l=t.annotation(fH.userEvent);return o?e=e.addChanges(o,s,l,n,t):t.selection&&(e=e.addSelection(t.startState.selection,s,l,n.newGroupDelay)),("full"==r||"after"==r)&&(e=e.isolate()),e},toJSON:e=>({done:e.done.map(e=>e.toJSON()),undone:e.undone.map(e=>e.toJSON())}),fromJSON:e=>new wv(e.done.map(wc.fromJSON),e.undone.map(wc.fromJSON))});function wo(e,t){return function({state:n,dispatch:i}){if(!t&&n.readOnly)return!1;let r=n.field(wr,!1);if(!r)return!1;let o=r.pop(e,n,t);return!!o&&(i(o),!0)}}let ws=wo(0,!1),wl=wo(1,!1),wa=wo(0,!0),wu=wo(1,!0);class wc{constructor(e,t,n,i,r){this.changes=e,this.effects=t,this.mapped=n,this.startSelection=i,this.selectionsAfter=r}setSelAfter(e){return new wc(this.changes,this.effects,this.mapped,this.startSelection,e)}toJSON(){var e,t,n;return{changes:null==(e=this.changes)?void 0:e.toJSON(),mapped:null==(t=this.mapped)?void 0:t.toJSON(),startSelection:null==(n=this.startSelection)?void 0:n.toJSON(),selectionsAfter:this.selectionsAfter.map(e=>e.toJSON())}}static fromJSON(e){return new wc(e.changes&&fi.fromJSON(e.changes),[],e.mapped&&fn.fromJSON(e.mapped),e.startSelection&&fh.fromJSON(e.startSelection),e.selectionsAfter.map(fh.fromJSON))}static fromTransaction(e,t){let n=wf;for(let t of e.startState.facet(wn)){let i=t(e);i.length&&(n=n.concat(i))}return!n.length&&e.changes.empty?null:new wc(e.changes.invert(e.startState.doc),n,void 0,t||e.startState.selection,wf)}static selection(e){return new wc(void 0,wf,void 0,void 0,e)}}function wh(e,t,n,i){let r=e.slice(t+1>n+20?t-n-1:0,t);return r.push(i),r}function wd(e,t){return e.length?t.length?e.concat(t):e:t}let wf=[];function wp(e,t){if(!e.length)return[wc.selection([t])];{let n=e[e.length-1],i=n.selectionsAfter.slice(Math.max(0,n.selectionsAfter.length-200));return i.length&&i[i.length-1].eq(t)?e:(i.push(t),wh(e,e.length-1,1e9,n.setSelAfter(i)))}}function wm(e,t){if(!e.length)return e;let n=e.length,i=wf;for(;n;){let r=function(e,t,n){let i=wd(e.selectionsAfter.length?e.selectionsAfter.map(e=>e.map(t)):wf,n);if(!e.changes)return wc.selection(i);let r=e.changes.map(t),o=t.mapDesc(e.changes,!0),s=e.mapped?e.mapped.composeDesc(o):o;return new wc(r,fV.mapEffects(e.effects,t),s,e.startSelection.map(o),i)}(e[n-1],t,i);if(r.changes&&!r.changes.empty||r.effects.length){let t=e.slice(0,n);return t[n-1]=r,t}t=r.mapped,n--,i=r.selectionsAfter}return i.length?[wc.selection(i)]:wf}let wg=/^(input\.type|delete)($|\.)/;class wv{constructor(e,t,n=0,i){this.done=e,this.undone=t,this.prevTime=n,this.prevUserEvent=i}isolate(){return this.prevTime?new wv(this.done,this.undone):this}addChanges(e,t,n,i,r){var o,s;let l,a,u=this.done,c=u[u.length-1];return new wv(u=c&&c.changes&&!c.changes.empty&&e.changes&&(!n||wg.test(n))&&(!c.selectionsAfter.length&&t-this.prevTime<i.newGroupDelay&&i.joinToEvent(r,(o=c.changes,s=e.changes,l=[],a=!1,o.iterChangedRanges((e,t)=>l.push(e,t)),s.iterChangedRanges((e,t,n,i)=>{for(let e=0;e<l.length;){let t=l[e++],r=l[e++];i>=t&&n<=r&&(a=!0)}}),a))||"input.type.compose"==n)?wh(u,u.length-1,i.minDepth,new wc(e.changes.compose(c.changes),wd(fV.mapEffects(e.effects,c.changes),c.effects),c.mapped,c.startSelection,wf)):wh(u,u.length,i.minDepth,e),wf,t,n)}addSelection(e,t,n,i){var r;let o=this.done.length?this.done[this.done.length-1].selectionsAfter:wf;return o.length>0&&t-this.prevTime<i&&n==this.prevUserEvent&&n&&/^select($|\.)/.test(n)&&(r=o[o.length-1],r.ranges.length==e.ranges.length&&0===r.ranges.filter((t,n)=>t.empty!=e.ranges[n].empty).length)?this:new wv(wp(this.done,e),this.undone,t,n)}addMapping(e){return new wv(wm(this.done,e),wm(this.undone,e),this.prevTime,this.prevUserEvent)}pop(e,t,n){let i=0==e?this.done:this.undone;if(0==i.length)return null;let r=i[i.length-1],o=r.selectionsAfter[0]||(r.startSelection?r.startSelection.map(r.changes.invertedDesc,1):t.selection);if(n&&r.selectionsAfter.length){let n,s;return t.update({selection:r.selectionsAfter[r.selectionsAfter.length-1],annotations:we.of({side:e,rest:(n=i[i.length-1],(s=i.slice())[i.length-1]=n.setSelAfter(n.selectionsAfter.slice(0,n.selectionsAfter.length-1)),s),selection:o}),userEvent:0==e?"select.undo":"select.redo",scrollIntoView:!0})}{if(!r.changes)return null;let n=1==i.length?wf:i.slice(0,i.length-1);return r.mapped&&(n=wm(n,r.mapped)),t.update({changes:r.changes,selection:r.startSelection,effects:r.effects,annotations:we.of({side:e,rest:n,selection:o}),filter:!1,userEvent:0==e?"undo":"redo",scrollIntoView:!0})}}}wv.empty=new wv(wf,wf);let wb=[{key:"Mod-z",run:ws,preventDefault:!0},{key:"Mod-y",mac:"Mod-Shift-z",run:wl,preventDefault:!0},{linux:"Ctrl-Shift-z",run:wl,preventDefault:!0},{key:"Mod-u",run:wa,preventDefault:!0},{key:"Alt-u",mac:"Mod-Shift-u",run:wu,preventDefault:!0}];function wx(e,t){return fh.create(e.ranges.map(t),e.mainIndex)}function wy(e,t){return e.update({selection:t,scrollIntoView:!0,userEvent:"select"})}function ww({state:e,dispatch:t},n){let i=wx(e.selection,n);return!i.eq(e.selection,!0)&&(t(wy(e,i)),!0)}function wS(e,t){return fh.cursor(t?e.to:e.from)}function wC(e,t){return ww(e,n=>n.empty?e.moveByChar(n,t):wS(n,t))}function wA(e){return e.textDirectionAt(e.state.selection.main.head)==p7.LTR}let wk=e=>wC(e,!wA(e)),wM=e=>wC(e,wA(e));function wT(e,t){return ww(e,n=>n.empty?e.moveByGroup(n,t):wS(n,t))}function wD(e,t,n){let i,r,o=xJ(e).resolveInner(t.head),s=n?b4.closedBy:b4.openedBy;for(let i=t.head;;){let t=n?o.childAfter(i):o.childBefore(i);if(!t)break;!function(e,t,n){if(t.type.prop(n))return!0;let i=t.to-t.from;return i&&(i>2||/[^\s,.;:]/.test(e.sliceDoc(t.from,t.to)))||t.firstChild}(e,t,s)?i=n?t.to:t.from:o=t}return r=o.type.prop(s)&&(i=n?yZ(e,o.from,1):yZ(e,o.to,-1))&&i.matched?n?i.end.to:i.end.from:n?o.to:o.from,fh.cursor(r,n?-1:1)}function wI(e,t){return ww(e,n=>{if(!n.empty)return wS(n,t);let i=e.moveVertically(n,t);return i.head!=n.head?i:e.moveToLineBoundary(n,t)})}"u">typeof Intl&&Intl.Segmenter;let wR=e=>wI(e,!1),wE=e=>wI(e,!0);function wO(e){let t=e.scrollDOM.clientHeight<e.scrollDOM.scrollHeight-2,n=0,i=0,r;if(t){for(let t of e.state.facet(vT.scrollMargins)){let r=t(e);(null==r?void 0:r.top)&&(n=Math.max(null==r?void 0:r.top,n)),(null==r?void 0:r.bottom)&&(i=Math.max(null==r?void 0:r.bottom,i))}r=e.scrollDOM.clientHeight-n-i}else r=(e.dom.ownerDocument.defaultView||window).innerHeight;return{marginTop:n,marginBottom:i,selfScroll:t,height:Math.max(e.defaultLineHeight,r-5)}}function wP(e,t){let n,i=wO(e),{state:r}=e,o=wx(r.selection,n=>n.empty?e.moveVertically(n,t,i.height):wS(n,t));if(o.eq(r.selection))return!1;if(i.selfScroll){let t=e.coordsAtPos(r.selection.main.head),s=e.scrollDOM.getBoundingClientRect(),l=s.top+i.marginTop,a=s.bottom-i.marginBottom;t&&t.top>l&&t.bottom<a&&(n=vT.scrollIntoView(o.main.head,{y:"start",yMargin:t.top-l}))}return e.dispatch(wy(r,o),{effects:n}),!0}let wL=e=>wP(e,!1),wj=e=>wP(e,!0);function wB(e,t,n){let i=e.lineBlockAt(t.head),r=e.moveToLineBoundary(t,n);if(r.head==t.head&&r.head!=(n?i.to:i.from)&&(r=e.moveToLineBoundary(t,n,!1)),!n&&r.head==i.from&&i.length){let n=/^\s*/.exec(e.state.sliceDoc(i.from,Math.min(i.from+100,i.to)))[0].length;n&&t.head!=i.from+n&&(r=fh.cursor(i.from+n))}return r}function wF(e,t){let n=wx(e.state.selection,e=>{let n=t(e);return fh.range(e.anchor,n.head,n.goalColumn,n.bidiLevel||void 0,n.assoc)});return!n.eq(e.state.selection)&&(e.dispatch(wy(e.state,n)),!0)}function wN(e,t){return wF(e,n=>e.moveByChar(n,t))}let wV=e=>wN(e,!wA(e)),wH=e=>wN(e,wA(e));function wz(e,t){return wF(e,n=>e.moveByGroup(n,t))}function wW(e,t){return wF(e,n=>e.moveVertically(n,t))}let w$=e=>wW(e,!1),w_=e=>wW(e,!0);function wU(e,t){return wF(e,n=>e.moveVertically(n,t,wO(e).height))}let wG=e=>wU(e,!1),wq=e=>wU(e,!0),wY=({state:e,dispatch:t})=>(t(wy(e,{anchor:0})),!0),wK=({state:e,dispatch:t})=>(t(wy(e,{anchor:e.doc.length})),!0),wX=({state:e,dispatch:t})=>(t(wy(e,{anchor:e.selection.main.anchor,head:0})),!0),wZ=({state:e,dispatch:t})=>(t(wy(e,{anchor:e.selection.main.anchor,head:e.doc.length})),!0);function wQ(e,t){let{state:n}=e,i=n.selection,r=n.selection.ranges.slice();for(let i of n.selection.ranges){let o=n.doc.lineAt(i.head);if(t?o.to<e.state.doc.length:o.from>0)for(let n=i;;){let i=e.moveVertically(n,t);if(i.head<o.from||i.head>o.to){r.some(e=>e.head==i.head)||r.push(i);break}if(i.head==n.head)break;n=i}}return r.length!=i.ranges.length&&(e.dispatch(wy(n,fh.create(r,r.length-1))),!0)}function wJ(e,t){if(e.state.readOnly)return!1;let n="delete.selection",{state:i}=e,r=i.changeByRange(i=>{let{from:r,to:o}=i;if(r==o){let s=t(i);s<r?(n="delete.backward",s=w0(e,s,!1)):s>r&&(n="delete.forward",s=w0(e,s,!0)),r=Math.min(r,s),o=Math.max(o,s)}else r=w0(e,r,!1),o=w0(e,o,!0);return r==o?{range:i}:{changes:{from:r,to:o},range:fh.cursor(r,r<i.head?-1:1)}});return!r.changes.empty&&(e.dispatch(i.update(r,{scrollIntoView:!0,userEvent:n,effects:"delete.selection"==n?vT.announce.of(i.phrase("Selection deleted")):void 0})),!0)}function w0(e,t,n){if(e instanceof vT)for(let i of e.state.facet(vT.atomicRanges).map(t=>t(e)))i.between(t,t,(e,i)=>{e<t&&i>t&&(t=n?i:e)});return t}let w1=(e,t,n)=>wJ(e,i=>{let r=i.from,{state:o}=e,s=o.doc.lineAt(r),l,a;if(n&&!t&&r>s.from&&r<s.from+200&&!/[^ \t]/.test(l=s.text.slice(0,r-s.from))){if(" "==l[l.length-1])return r-1;let e=pn(l,o.tabSize)%yn(o)||yn(o);for(let t=0;t<e&&" "==l[l.length-1-t];t++)r--;a=r}else(a=d6(s.text,r-s.from,t,t)+s.from)==r&&s.number!=(t?o.doc.lines:1)?a+=t?1:-1:!t&&/[\ufe00-\ufe0f]/.test(s.text.slice(a-s.from,r-s.from))&&(a=d6(s.text,a-s.from,!1,!1)+s.from);return a}),w2=e=>w1(e,!1,!0),w5=e=>w1(e,!0,!1),w3=(e,t)=>wJ(e,n=>{let i=n.head,{state:r}=e,o=r.doc.lineAt(i),s=r.charCategorizer(i);for(let e=null;;){if(i==(t?o.to:o.from)){i==n.head&&o.number!=(t?r.doc.lines:1)&&(i+=t?1:-1);break}let l=d6(o.text,i-o.from,t)+o.from,a=o.text.slice(Math.min(i,l)-o.from,Math.max(i,l)-o.from),u=s(a);if(null!=e&&u!=e)break;(" "!=a||i!=n.head)&&(e=u),i=l}return i}),w4=e=>w3(e,!1);function w6(e){let t=[],n=-1;for(let i of e.selection.ranges){let r=e.doc.lineAt(i.from),o=e.doc.lineAt(i.to);if(i.empty||i.to!=o.from||(o=e.doc.lineAt(i.to-1)),n>=r.number){let e=t[t.length-1];e.to=o.to,e.ranges.push(i)}else t.push({from:r.from,to:o.to,ranges:[i]});n=o.number+1}return t}function w8(e,t,n){if(e.readOnly)return!1;let i=[],r=[];for(let t of w6(e)){if(n?t.to==e.doc.length:0==t.from)continue;let o=e.doc.lineAt(n?t.to+1:t.from-1),s=o.length+1;if(n)for(let n of(i.push({from:t.to,to:o.to},{from:t.from,insert:o.text+e.lineBreak}),t.ranges))r.push(fh.range(Math.min(e.doc.length,n.anchor+s),Math.min(e.doc.length,n.head+s)));else for(let n of(i.push({from:o.from,to:t.from},{from:t.to,insert:e.lineBreak+o.text}),t.ranges))r.push(fh.range(n.anchor-s,n.head-s))}return!!i.length&&(t(e.update({changes:i,scrollIntoView:!0,selection:fh.create(r,e.selection.mainIndex),userEvent:"move.line"})),!0)}function w9(e,t,n){if(e.readOnly)return!1;let i=[];for(let t of w6(e))n?i.push({from:t.from,insert:e.doc.slice(t.from,t.to)+e.lineBreak}):i.push({from:t.to,insert:e.lineBreak+e.doc.slice(t.from,t.to)});let r=e.changes(i);return t(e.update({changes:r,selection:e.selection.map(r,n?1:-1),scrollIntoView:!0,userEvent:"input.copyline"})),!0}let w7=St(!1),Se=St(!0);function St(e){return({state:t,dispatch:n})=>{if(t.readOnly)return!1;let i=t.changeByRange(n=>{let{from:i,to:r}=n,o=t.doc.lineAt(i),s=!e&&i==r&&function(e,t){if(/\(\)|\[\]|\{\}/.test(e.sliceDoc(t-1,t+1)))return{from:t,to:t};let n=xJ(e).resolveInner(t),i=n.childBefore(t),r=n.childAfter(t),o;return i&&r&&i.to<=t&&r.from>=t&&(o=i.type.prop(b4.closedBy))&&o.indexOf(r.name)>-1&&e.doc.lineAt(i.to).from==e.doc.lineAt(r.from).from&&!/\S/.test(e.sliceDoc(i.to,r.from))?{from:i.to,to:r.from}:null}(t,i);e&&(i=r=(r<=o.to?o:t.doc.lineAt(r)).to);let l=new yo(t,{simulateBreak:i,simulateDoubleBreak:!!s}),a=yr(l,i);for(null==a&&(a=pn(/^\s*/.exec(t.doc.lineAt(i).text)[0],t.tabSize));r<o.to&&/\s/.test(o.text[r-o.from]);)r++;s?{from:i,to:r}=s:i>o.from&&i<o.from+100&&!/\S/.test(o.text.slice(0,i))&&(i=o.from);let u=["",yi(t,a)];return s&&u.push(yi(t,l.lineIndent(o.from,-1))),{changes:{from:i,to:r,insert:dZ.of(u)},range:fh.cursor(i+1+u[1].length)}});return n(t.update(i,{scrollIntoView:!0,userEvent:"input"})),!0}}function Sn(e,t){let n=-1;return e.changeByRange(i=>{let r=[];for(let o=i.from;o<=i.to;){let s=e.doc.lineAt(o);s.number>n&&(i.empty||i.to>s.from)&&(t(s,r,i),n=s.number),o=s.to+1}let o=e.changes(r);return{changes:r,range:fh.range(o.mapPos(i.anchor,1),o.mapPos(i.head,1))}})}let Si=({state:e,dispatch:t})=>!e.readOnly&&(t(e.update(Sn(e,(t,n)=>{n.push({from:t.from,insert:e.facet(yt)})}),{userEvent:"input.indent"})),!0),Sr=({state:e,dispatch:t})=>!e.readOnly&&(t(e.update(Sn(e,(t,n)=>{let i=/^\s*/.exec(t.text)[0];if(!i)return;let r=pn(i,e.tabSize),o=0,s=yi(e,Math.max(0,r-yn(e)));for(;o<i.length&&o<s.length&&i.charCodeAt(o)==s.charCodeAt(o);)o++;n.push({from:t.from+o,to:t.from+i.length,insert:s.slice(o)})}),{userEvent:"delete.dedent"})),!0),So=[{key:"Ctrl-b",run:wk,shift:wV,preventDefault:!0},{key:"Ctrl-f",run:wM,shift:wH},{key:"Ctrl-p",run:wR,shift:w$},{key:"Ctrl-n",run:wE,shift:w_},{key:"Ctrl-a",run:e=>ww(e,t=>fh.cursor(e.lineBlockAt(t.head).from,1)),shift:e=>wF(e,t=>fh.cursor(e.lineBlockAt(t.head).from))},{key:"Ctrl-e",run:e=>ww(e,t=>fh.cursor(e.lineBlockAt(t.head).to,-1)),shift:e=>wF(e,t=>fh.cursor(e.lineBlockAt(t.head).to))},{key:"Ctrl-d",run:w5},{key:"Ctrl-h",run:w2},{key:"Ctrl-k",run:e=>wJ(e,t=>{let n=e.lineBlockAt(t.head).to;return t.head<n?n:Math.min(e.state.doc.length,t.head+1)})},{key:"Ctrl-Alt-h",run:w4},{key:"Ctrl-o",run:({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=e.changeByRange(e=>({changes:{from:e.from,to:e.to,insert:dZ.of(["",""])},range:fh.cursor(e.from)}));return t(e.update(n,{scrollIntoView:!0,userEvent:"input"})),!0}},{key:"Ctrl-t",run:({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=e.changeByRange(t=>{if(!t.empty||0==t.from||t.from==e.doc.length)return{range:t};let n=t.from,i=e.doc.lineAt(n),r=n==i.from?n-1:d6(i.text,n-i.from,!1)+i.from,o=n==i.to?n+1:d6(i.text,n-i.from,!0)+i.from;return{changes:{from:r,to:o,insert:e.doc.slice(n,o).append(e.doc.slice(r,n))},range:fh.cursor(o)}});return!n.changes.empty&&(t(e.update(n,{scrollIntoView:!0,userEvent:"move.character"})),!0)}},{key:"Ctrl-v",run:wj}],Ss=[{key:"Alt-ArrowLeft",mac:"Ctrl-ArrowLeft",run:e=>ww(e,t=>wD(e.state,t,!wA(e))),shift:e=>wF(e,t=>wD(e.state,t,!wA(e)))},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:e=>ww(e,t=>wD(e.state,t,wA(e))),shift:e=>wF(e,t=>wD(e.state,t,wA(e)))},{key:"Alt-ArrowUp",run:({state:e,dispatch:t})=>w8(e,t,!1)},{key:"Shift-Alt-ArrowUp",run:({state:e,dispatch:t})=>w9(e,t,!1)},{key:"Alt-ArrowDown",run:({state:e,dispatch:t})=>w8(e,t,!0)},{key:"Shift-Alt-ArrowDown",run:({state:e,dispatch:t})=>w9(e,t,!0)},{key:"Mod-Alt-ArrowUp",run:e=>wQ(e,!1)},{key:"Mod-Alt-ArrowDown",run:e=>wQ(e,!0)},{key:"Escape",run:({state:e,dispatch:t})=>{let n=e.selection,i=null;return n.ranges.length>1?i=fh.create([n.main]):n.main.empty||(i=fh.create([fh.cursor(n.main.head)])),!!i&&(t(wy(e,i)),!0)}},{key:"Mod-Enter",run:Se},{key:"Alt-l",mac:"Ctrl-l",run:({state:e,dispatch:t})=>{let n=w6(e).map(({from:t,to:n})=>fh.range(t,Math.min(n+1,e.doc.length)));return t(e.update({selection:fh.create(n),userEvent:"select"})),!0}},{key:"Mod-i",run:({state:e,dispatch:t})=>{let n=wx(e.selection,t=>{let n=xJ(e),i=n.resolveStack(t.from,1);if(t.empty){let e=n.resolveStack(t.from,-1);e.node.from>=i.node.from&&e.node.to<=i.node.to&&(i=e)}for(let e=i;e;e=e.next){let{node:n}=e;if((n.from<t.from&&n.to>=t.to||n.to>t.to&&n.from<=t.from)&&e.next)return fh.range(n.to,n.from)}return t});return!n.eq(e.selection)&&(t(wy(e,n)),!0)},preventDefault:!0},{key:"Mod-[",run:Sr},{key:"Mod-]",run:Si},{key:"Mod-Alt-\\",run:({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=Object.create(null),i=new yo(e,{overrideIndentation:e=>{let t=n[e];return null==t?-1:t}}),r=Sn(e,(t,r,o)=>{let s=yr(i,t.from);if(null==s)return;/\S/.test(t.text)||(s=0);let l=/^\s*/.exec(t.text)[0],a=yi(e,s);(l!=a||o.from<t.from+l.length)&&(n[t.from]=s,r.push({from:t.from,to:t.from+l.length,insert:a}))});return r.changes.empty||t(e.update(r,{userEvent:"indent"})),!0}},{key:"Shift-Mod-k",run:e=>{if(e.state.readOnly)return!1;let{state:t}=e,n=t.changes(w6(t).map(({from:e,to:n})=>(e>0?e--:n<t.doc.length&&n++,{from:e,to:n}))),i=wx(t.selection,t=>{let n;if(e.lineWrapping){let i=e.lineBlockAt(t.head),r=e.coordsAtPos(t.head,t.assoc||1);r&&(n=i.bottom+e.documentTop-r.bottom+e.defaultLineHeight/2)}return e.moveVertically(t,!0,n)}).map(n);return e.dispatch({changes:n,selection:i,scrollIntoView:!0,userEvent:"delete.line"}),!0}},{key:"Shift-Mod-\\",run:({state:e,dispatch:t})=>{let n,i;return n=!1,i=wx(e.selection,t=>{let i=yZ(e,t.head,-1)||yZ(e,t.head,1)||t.head>0&&yZ(e,t.head-1,1)||t.head<e.doc.length&&yZ(e,t.head+1,-1);if(!i||!i.end)return t;n=!0;let r=i.start.from==t.head?i.end.to:i.end.from;return fh.cursor(r)}),!!n&&(t(wy(e,i)),!0)}},{key:"Mod-/",run:e=>{let{state:t}=e,n=t.doc.lineAt(t.selection.main.from),i=y9(e.state,n.from);return i.line?y4(e):!!i.block&&y8(e)}},{key:"Alt-A",run:y6},{key:"Ctrl-m",mac:"Shift-Alt-m",run:e=>(e.setTabFocusMode(),!0)}].concat([{key:"ArrowLeft",run:wk,shift:wV,preventDefault:!0},{key:"Mod-ArrowLeft",mac:"Alt-ArrowLeft",run:e=>wT(e,!wA(e)),shift:e=>wz(e,!wA(e)),preventDefault:!0},{mac:"Cmd-ArrowLeft",run:e=>ww(e,t=>wB(e,t,!wA(e))),shift:e=>wF(e,t=>wB(e,t,!wA(e))),preventDefault:!0},{key:"ArrowRight",run:wM,shift:wH,preventDefault:!0},{key:"Mod-ArrowRight",mac:"Alt-ArrowRight",run:e=>wT(e,wA(e)),shift:e=>wz(e,wA(e)),preventDefault:!0},{mac:"Cmd-ArrowRight",run:e=>ww(e,t=>wB(e,t,wA(e))),shift:e=>wF(e,t=>wB(e,t,wA(e))),preventDefault:!0},{key:"ArrowUp",run:wR,shift:w$,preventDefault:!0},{mac:"Cmd-ArrowUp",run:wY,shift:wX},{mac:"Ctrl-ArrowUp",run:wL,shift:wG},{key:"ArrowDown",run:wE,shift:w_,preventDefault:!0},{mac:"Cmd-ArrowDown",run:wK,shift:wZ},{mac:"Ctrl-ArrowDown",run:wj,shift:wq},{key:"PageUp",run:wL,shift:wG},{key:"PageDown",run:wj,shift:wq},{key:"Home",run:e=>ww(e,t=>wB(e,t,!1)),shift:e=>wF(e,t=>wB(e,t,!1)),preventDefault:!0},{key:"Mod-Home",run:wY,shift:wX},{key:"End",run:e=>ww(e,t=>wB(e,t,!0)),shift:e=>wF(e,t=>wB(e,t,!0)),preventDefault:!0},{key:"Mod-End",run:wK,shift:wZ},{key:"Enter",run:w7,shift:w7},{key:"Mod-a",run:({state:e,dispatch:t})=>(t(e.update({selection:{anchor:0,head:e.doc.length},userEvent:"select"})),!0)},{key:"Backspace",run:w2,shift:w2,preventDefault:!0},{key:"Delete",run:w5,preventDefault:!0},{key:"Mod-Backspace",mac:"Alt-Backspace",run:w4,preventDefault:!0},{key:"Mod-Delete",mac:"Alt-Delete",run:e=>w3(e,!0),preventDefault:!0},{mac:"Mod-Backspace",run:e=>wJ(e,t=>{let n=e.moveToLineBoundary(t,!1).head;return t.head>n?n:Math.max(0,t.head-1)}),preventDefault:!0},{mac:"Mod-Delete",run:e=>wJ(e,t=>{let n=e.moveToLineBoundary(t,!0).head;return t.head<n?n:Math.min(e.state.doc.length,t.head+1)}),preventDefault:!0}].concat(So.map(e=>({mac:e.key,run:e.run,shift:e.shift})))),Sl={key:"Tab",run:Si,shift:Sr},Sa="function"==typeof String.prototype.normalize?e=>e.normalize("NFKD"):e=>e;class Su{constructor(e,t,n=0,i=e.length,r,o){this.test=o,this.value={from:0,to:0,precise:!1},this.done=!1,this.matches=[],this.buffer="",this.bufferPos=0,this.iter=e.iterRange(n,i),this.bufferStart=n,this.normalize=r?e=>r(Sa(e)):Sa,this.query=this.normalize(t)}peek(){if(this.bufferPos==this.buffer.length){if(this.bufferStart+=this.buffer.length,this.iter.next(),this.iter.done)return -1;this.bufferPos=0,this.buffer=this.iter.value}return d8(this.buffer,this.bufferPos)}next(){for(;this.matches.length;)this.matches.pop();return this.nextOverlapping()}nextOverlapping(){for(;;){let e=this.peek();if(e<0)return this.done=!0,this;let t=d9(e),n=this.bufferStart+this.bufferPos;this.bufferPos+=d7(e);let i=this.normalize(t);if(i.length)for(let e=0,r=n,o=!0;;e++){let n=i.charCodeAt(e),s=this.match(n,r,o,this.bufferPos+this.bufferStart,e==i.length-1);if(s)return this.value=s,this;if(e==i.length-1)break;o&&e<t.length&&t.charCodeAt(e)==n?r++:o=!1}}}match(e,t,n,i,r){let o=null;for(let t=0;t<this.matches.length;){let n=this.matches[t],s=!1;this.query.charCodeAt(n.index)==e&&(n.index==this.query.length-1?o={from:n.from,to:i,precise:r&&n.precise}:(n.index++,s=!0)),s?t++:this.matches.splice(t,1)}return this.query.charCodeAt(0)==e&&(1==this.query.length?o={from:t,to:i,precise:n&&r}:this.matches.push({from:t,index:1,precise:n})),o&&this.test&&!this.test(o.from,o.to,this.buffer,this.bufferStart)&&(o=null),o}}"u">typeof Symbol&&(Su.prototype[Symbol.iterator]=function(){return this});let Sc={from:-1,to:-1,match:/.*/.exec(""),precise:!0},Sh="gm"+(null==/x/.unicode?"":"u");class Sd{constructor(e,t,n,i=0,r=e.length){if(this.text=e,this.to=r,this.curLine="",this.done=!1,this.value=Sc,/\\[sWDnr]|\n|\r|\[\^/.test(t))return new Sm(e,t,n,i,r);this.re=new RegExp(t,Sh+((null==n?void 0:n.ignoreCase)?"i":"")),this.test=null==n?void 0:n.test,this.iter=e.iter();let o=e.lineAt(i);this.curLineStart=o.from,this.matchPos=Sg(e,i),this.getLine(this.curLineStart)}getLine(e){this.iter.next(e),this.iter.lineBreak?this.curLine="":(this.curLine=this.iter.value,this.curLineStart+this.curLine.length>this.to&&(this.curLine=this.curLine.slice(0,this.to-this.curLineStart)),this.iter.next())}nextLine(){this.curLineStart=this.curLineStart+this.curLine.length+1,this.curLineStart>this.to?this.curLine="":this.getLine(0)}next(){for(let e=this.matchPos-this.curLineStart;;){this.re.lastIndex=e;let t=this.matchPos<=this.to&&this.re.exec(this.curLine);if(t){let n=this.curLineStart+t.index,i=n+t[0].length;if(this.matchPos=Sg(this.text,i+ +(n==i)),n==this.curLineStart+this.curLine.length&&this.nextLine(),(n<i||n>this.value.to)&&(!this.test||this.test(n,i,t)))return this.value={from:n,to:i,precise:!0,match:t},this;e=this.matchPos-this.curLineStart}else{if(!(this.curLineStart+this.curLine.length<this.to))return this.done=!0,this;this.nextLine(),e=0}}}}let Sf=new WeakMap;class Sp{constructor(e,t){this.from=e,this.text=t}get to(){return this.from+this.text.length}static get(e,t,n){let i=Sf.get(e);if(!i||i.from>=n||i.to<=t){let i=new Sp(t,e.sliceString(t,n));return Sf.set(e,i),i}if(i.from==t&&i.to==n)return i;let{text:r,from:o}=i;return o>t&&(r=e.sliceString(t,o)+r,o=t),i.to<n&&(r+=e.sliceString(i.to,n)),Sf.set(e,new Sp(o,r)),new Sp(t,r.slice(t-o,n-o))}}class Sm{constructor(e,t,n,i,r){this.text=e,this.to=r,this.done=!1,this.value=Sc,this.matchPos=Sg(e,i),this.re=new RegExp(t,Sh+((null==n?void 0:n.ignoreCase)?"i":"")),this.test=null==n?void 0:n.test,this.flat=Sp.get(e,i,this.chunkEnd(i+5e3))}chunkEnd(e){return e>=this.to?this.to:this.text.lineAt(e).to}next(){for(;;){let e=this.re.lastIndex=this.matchPos-this.flat.from,t=this.re.exec(this.flat.text);if(t&&!t[0]&&t.index==e&&(this.re.lastIndex=e+1,t=this.re.exec(this.flat.text)),t){let e=this.flat.from+t.index,n=e+t[0].length;if((this.flat.to>=this.to||t.index+t[0].length<=this.flat.text.length-10)&&(!this.test||this.test(e,n,t)))return this.value={from:e,to:n,precise:!0,match:t},this.matchPos=Sg(this.text,n+ +(e==n)),this}if(this.flat.to==this.to)return this.done=!0,this;this.flat=Sp.get(this.text,this.flat.from,this.chunkEnd(this.flat.from+2*this.flat.text.length))}}}function Sg(e,t){if(t>=e.length)return t;let n=e.lineAt(t),i;for(;t<n.to&&(i=n.text.charCodeAt(t-n.from))>=56320&&i<57344;)t++;return t}"u">typeof Symbol&&(Sd.prototype[Symbol.iterator]=Sm.prototype[Symbol.iterator]=function(){return this});let Sv={highlightWordAroundCursor:!1,minSelectionLength:1,maxMatches:100,wholeWords:!1},Sb=fp.define({combine:e=>fY(e,Sv,{highlightWordAroundCursor:(e,t)=>e||t,minSelectionLength:Math.min,maxMatches:Math.min})}),Sx=pj.mark({class:"cm-selectionMatch"}),Sy=pj.mark({class:"cm-selectionMatch cm-selectionMatch-main"});function Sw(e,t,n,i){return(0==n||e(t.sliceDoc(n-1,n))!=fU.Word)&&(i==t.doc.length||e(t.sliceDoc(i,i+1))!=fU.Word)}let SS=mO.fromClass(class{constructor(e){this.decorations=this.getDeco(e)}update(e){(e.selectionSet||e.docChanged||e.viewportChanged)&&(this.decorations=this.getDeco(e.view))}getDeco(e){let t=e.state.facet(Sb),{state:n}=e,i=n.selection;if(i.ranges.length>1)return pj.none;let r=i.main,o,s=null;if(r.empty){if(!t.highlightWordAroundCursor)return pj.none;let e=n.wordAt(r.head);if(!e)return pj.none;s=n.charCategorizer(r.head),o=n.sliceDoc(e.from,e.to)}else{let e=r.to-r.from;if(e<t.minSelectionLength||e>200)return pj.none;if(t.wholeWords){var l,a,u;if(o=n.sliceDoc(r.from,r.to),!(Sw(s=n.charCategorizer(r.head),n,r.from,r.to)&&(l=s,a=r.from,u=r.to,l(n.sliceDoc(a,a+1))==fU.Word&&l(n.sliceDoc(u-1,u))==fU.Word)))return pj.none}else if(!(o=n.sliceDoc(r.from,r.to)))return pj.none}let c=[];for(let i of e.visibleRanges){let e=new Su(n.doc,o,i.from,i.to);for(;!e.next().done;){let{from:i,to:o}=e.value;if((!s||Sw(s,n,i,o))&&(r.empty&&i<=r.from&&o>=r.to?c.push(Sy.range(i,o)):(i>=r.to||o<=r.from)&&c.push(Sx.range(i,o)),c.length>t.maxMatches))return pj.none}}return pj.set(c)}},{decorations:e=>e.decorations}),SC=vT.baseTheme({".cm-selectionMatch":{backgroundColor:"#99ff7780"},".cm-searchMatch .cm-selectionMatch":{backgroundColor:"transparent"}}),SA=fp.define({combine:e=>fY(e,{top:!1,caseSensitive:!1,literal:!1,regexp:!1,wholeWord:!1,createPanel:e=>new SJ(e),scrollToMatch:e=>vT.scrollIntoView(e)})});class Sk{constructor(e){this.search=e.search,this.caseSensitive=!!e.caseSensitive,this.literal=!!e.literal,this.regexp=!!e.regexp,this.replace=e.replace||"",this.valid=!!this.search&&(!this.regexp||function(e){try{return new RegExp(e,Sh),!0}catch(e){return!1}}(this.search)),this.unquoted=this.unquote(this.search),this.wholeWord=!!e.wholeWord,this.test=e.test}unquote(e){return this.literal?e:e.replace(/\\([nrt\\])/g,(e,t)=>"n"==t?"\n":"r"==t?"\r":"t"==t?" ":"\\")}eq(e){return this.search==e.search&&this.replace==e.replace&&this.caseSensitive==e.caseSensitive&&this.regexp==e.regexp&&this.wholeWord==e.wholeWord&&this.test==e.test}create(){return this.regexp?new SO(this):new SD(this)}getCursor(e,t=0,n){let i=e.doc?e:fq.create({doc:e});return null==n&&(n=i.doc.length),this.regexp?SI(this,i,t,n):ST(this,i,t,n)}}class SM{constructor(e){this.spec=e}}function ST(e,t,n,i){var r,o,s,l;let a;return e.wholeWord&&(s=t.doc,l=t.charCategorizer(t.selection.main.head),a=(e,t,n,i)=>((i>e||i+n.length<t)&&(i=Math.max(0,e-2),n=s.sliceString(i,Math.min(s.length,t+2))),(l(SR(n,e-i))!=fU.Word||l(SE(n,e-i))!=fU.Word)&&(l(SE(n,t-i))!=fU.Word||l(SR(n,t-i))!=fU.Word))),e.test&&(r=e.test,o=a,a=(e,n,i,s)=>(!o||!!o(e,n,i,s))&&r(e>=s&&n<=s+i.length?i.slice(e-s,n-s):t.doc.sliceString(e,n),t,e,n)),new Su(t.doc,e.unquoted,n,i,e.caseSensitive?void 0:e=>e.toLowerCase(),a)}class SD extends SM{constructor(e){super(e)}nextMatch(e,t,n){let i=ST(this.spec,e,n,e.doc.length).nextOverlapping();if(i.done){let n=Math.min(e.doc.length,t+this.spec.unquoted.length);i=ST(this.spec,e,0,n).nextOverlapping()}return i.done||i.value.from==t&&i.value.to==n?null:i.value}prevMatchInRange(e,t,n){for(let i=n;;){let n=Math.max(t,i-1e4-this.spec.unquoted.length),r=ST(this.spec,e,n,i),o=null;for(;!r.nextOverlapping().done;)o=r.value;if(o)return o;if(n==t)return null;i-=1e4}}prevMatch(e,t,n){let i=this.prevMatchInRange(e,0,t);return i||(i=this.prevMatchInRange(e,Math.max(0,n-this.spec.unquoted.length),e.doc.length)),i&&(i.from!=t||i.to!=n)?i:null}getReplacement(e){return this.spec.unquote(this.spec.replace)}matchAll(e,t){let n=ST(this.spec,e,0,e.doc.length),i=[];for(;!n.next().done;){if(i.length>=t)return null;i.push(n.value)}return i}highlight(e,t,n,i){let r=ST(this.spec,e,Math.max(0,t-this.spec.unquoted.length),Math.min(n+this.spec.unquoted.length,e.doc.length));for(;!r.next().done;)i(r.value.from,r.value.to)}}function SI(e,t,n,i){var r,o,s;let l;return e.wholeWord&&(s=t.charCategorizer(t.selection.main.head),l=(e,t,n)=>!n[0].length||(s(SR(n.input,n.index))!=fU.Word||s(SE(n.input,n.index))!=fU.Word)&&(s(SE(n.input,n.index+n[0].length))!=fU.Word||s(SR(n.input,n.index+n[0].length))!=fU.Word)),e.test&&(r=e.test,o=l,l=(e,n,i)=>(!o||o(e,n,i))&&r(i[0],t,e,n)),new Sd(t.doc,e.search,{ignoreCase:!e.caseSensitive,test:l},n,i)}function SR(e,t){return e.slice(d6(e,t,!1),t)}function SE(e,t){return e.slice(t,d6(e,t))}class SO extends SM{nextMatch(e,t,n){let i=SI(this.spec,e,n,e.doc.length).next();return i.done&&(i=SI(this.spec,e,0,t).next()),i.done?null:i.value}prevMatchInRange(e,t,n){for(let i=1;;i++){let r=Math.max(t,n-1e4*i),o=SI(this.spec,e,r,n),s=null;for(;!o.next().done;)s=o.value;if(s&&(r==t||s.from>r+10))return s;if(r==t)return null}}prevMatch(e,t,n){return this.prevMatchInRange(e,0,t)||this.prevMatchInRange(e,n,e.doc.length)}getReplacement(e){return this.spec.unquote(this.spec.replace).replace(/\$([$&]|\d+)/g,(t,n)=>{if("&"==n)return e.match[0];if("$"==n)return"$";for(let t=n.length;t>0;t--){let i=+n.slice(0,t);if(i>0&&i<e.match.length)return e.match[i]+n.slice(t)}return t})}matchAll(e,t){let n=SI(this.spec,e,0,e.doc.length),i=[];for(;!n.next().done;){if(i.length>=t)return null;i.push(n.value)}return i}highlight(e,t,n,i){let r=SI(this.spec,e,Math.max(0,t-250),Math.min(n+250,e.doc.length));for(;!r.next().done;)i(r.value.from,r.value.to)}}let SP=fV.define(),SL=fV.define(),Sj=fy.define({create:e=>new SB(Sq(e).create(),null),update(e,t){for(let n of t.effects)n.is(SP)?e=new SB(n.value.create(),e.panel):n.is(SL)&&(e=new SB(e.query,n.value?SG:null));return e},provide:e=>bR.from(e,e=>e.panel)});class SB{constructor(e,t){this.query=e,this.panel=t}}let SF=pj.mark({class:"cm-searchMatch"}),SN=pj.mark({class:"cm-searchMatch cm-searchMatch-selected"}),SV=mO.fromClass(class{constructor(e){this.view=e,this.decorations=this.highlight(e.state.field(Sj))}update(e){let t=e.state.field(Sj);(t!=e.startState.field(Sj)||e.docChanged||e.selectionSet||e.viewportChanged)&&(this.decorations=this.highlight(t))}highlight({query:e,panel:t}){if(!t||!e.spec.valid)return pj.none;let{view:n}=this,i=new f1;for(let t=0,r=n.visibleRanges,o=r.length;t<o;t++){let{from:s,to:l}=r[t];for(;t<o-1&&l>r[t+1].from-500;)l=r[++t].to;e.highlight(n.state,s,l,(e,t)=>{let r=n.state.selection.ranges.some(n=>n.from==e&&n.to==t);i.add(e,t,r?SN:SF)})}return i.finish()}},{decorations:e=>e.decorations});function SH(e){return t=>{let n=t.state.field(Sj,!1);return n&&n.query.spec.valid?e(t,n):SX(t)}}let Sz=SH((e,{query:t})=>{let{to:n}=e.state.selection.main,i=t.nextMatch(e.state,n,n);if(!i)return!1;let r=fh.single(i.from,i.to),o=e.state.facet(SA);return e.dispatch({selection:r,effects:[S2(e,i),o.scrollToMatch(r.main,e)],userEvent:"select.search"}),SK(e),!0}),SW=SH((e,{query:t})=>{let{state:n}=e,{from:i}=n.selection.main,r=t.prevMatch(n,i,i);if(!r)return!1;let o=fh.single(r.from,r.to),s=e.state.facet(SA);return e.dispatch({selection:o,effects:[S2(e,r),s.scrollToMatch(o.main,e)],userEvent:"select.search"}),SK(e),!0}),S$=SH((e,{query:t})=>{let n=t.matchAll(e.state,1e3);return!!n&&!!n.length&&(e.dispatch({selection:fh.create(n.map(e=>fh.range(e.from,e.to))),userEvent:"select.search.matches"}),!0)}),S_=SH((e,{query:t})=>{let{state:n}=e,{from:i,to:r}=n.selection.main;if(n.readOnly)return!1;let o=t.nextMatch(n,i,i);if(!o)return!1;let s=o,l=[],a,u,c=[];s.precise?s.from==i&&s.to==r&&(u=n.toText(t.getReplacement(s)),l.push({from:s.from,to:s.to,insert:u}),c.push(vT.announce.of(n.phrase("replaced match on line $",n.doc.lineAt(i).number)+"."))):s=t.nextMatch(n,s.from,s.to);let h=e.state.changes(l);return s&&(a=fh.single(s.from,s.to).map(h),c.push(S2(e,s)),c.push(n.facet(SA).scrollToMatch(a.main,e))),e.dispatch({changes:h,selection:a,effects:c,userEvent:"input.replace"}),!0}),SU=SH((e,{query:t})=>{if(e.state.readOnly)return!1;let n=[];for(let i of t.matchAll(e.state,1e9)){let{from:e,to:r,precise:o}=i;o&&n.push({from:e,to:r,insert:t.getReplacement(i)})}if(!n.length)return!1;let i=e.state.phrase("replaced $ matches",n.length)+".";return e.dispatch({changes:n,effects:vT.announce.of(i),userEvent:"input.replace.all"}),!0});function SG(e){return e.state.facet(SA).createPanel(e)}function Sq(e,t){var n,i,r,o,s;let l=e.selection.main,a=l.empty||l.to>l.from+100?"":e.sliceDoc(l.from,l.to);if(t&&!a)return t;let u=e.facet(SA);return new Sk({search:(null!=(n=null==t?void 0:t.literal)?n:u.literal)?a:a.replace(/\n/g,"\\n"),caseSensitive:null!=(i=null==t?void 0:t.caseSensitive)?i:u.caseSensitive,literal:null!=(r=null==t?void 0:t.literal)?r:u.literal,regexp:null!=(o=null==t?void 0:t.regexp)?o:u.regexp,wholeWord:null!=(s=null==t?void 0:t.wholeWord)?s:u.wholeWord})}function SY(e){let t=bM(e,SG);return t&&t.dom.querySelector("[main-field]")}function SK(e){let t=SY(e);t&&t==e.root.activeElement&&t.select()}let SX=e=>{let t=e.state.field(Sj,!1);if(t&&t.panel){let n=SY(e);if(n&&n!=e.root.activeElement){let i=Sq(e.state,t.query.spec);i.valid&&e.dispatch({effects:SP.of(i)}),n.focus(),n.select()}}else e.dispatch({effects:[SL.of(!0),t?SP.of(Sq(e.state,t.query.spec)):fV.appendConfig.of(S3)]});return!0},SZ=e=>{let t=e.state.field(Sj,!1);if(!t||!t.panel)return!1;let n=bM(e,SG);return n&&n.dom.contains(e.root.activeElement)&&e.focus(),e.dispatch({effects:SL.of(!1)}),!0},SQ=[{key:"Mod-f",run:SX,scope:"editor search-panel"},{key:"F3",run:Sz,shift:SW,scope:"editor search-panel",preventDefault:!0},{key:"Mod-g",run:Sz,shift:SW,scope:"editor search-panel",preventDefault:!0},{key:"Escape",run:SZ,scope:"editor search-panel"},{key:"Mod-Shift-l",run:({state:e,dispatch:t})=>{let n=e.selection;if(n.ranges.length>1||n.main.empty)return!1;let{from:i,to:r}=n.main,o=[],s=0;for(let t=new Su(e.doc,e.sliceDoc(i,r));!t.next().done;){if(o.length>1e3)return!1;t.value.from==i&&(s=o.length),o.push(fh.range(t.value.from,t.value.to))}return t(e.update({selection:fh.create(o,s),userEvent:"select.search.matches"})),!0}},{key:"Mod-Alt-g",run:e=>{var t;let n,i,r,o,{state:s}=e,l=String(s.doc.lineAt(e.state.selection.main.head).number),{close:a,result:u}=(t={label:s.phrase("Go to line"),input:{type:"text",name:"line",value:l},focus:!0,submitLabel:s.phrase("go")},i=new Promise(e=>n=e),r=e=>(function(e,t,n){let i=t.content?t.content(e,()=>s(null)):null;if(!i){if(i=pg("form"),t.input){let e=pg("input",t.input);/^(text|password|number|email|tel|url)$/.test(e.type)&&e.classList.add("cm-textfield"),e.name||(e.name="input"),i.appendChild(pg("label",(t.label||"")+": ",e))}else i.appendChild(document.createTextNode(t.label||""));i.appendChild(document.createTextNode(" ")),i.appendChild(pg("button",{class:"cm-button",type:"submit"},t.submitLabel||"OK"))}let r="FORM"==i.nodeName?[i]:i.querySelectorAll("form");for(let e=0;e<r.length;e++){let t=r[e];t.addEventListener("keydown",e=>{27==e.keyCode?(e.preventDefault(),s(null)):13==e.keyCode&&(e.preventDefault(),s(t))}),t.addEventListener("submit",e=>{e.preventDefault(),s(t)})}let o=pg("div",i,pg("button",{onclick:()=>s(null),"aria-label":e.state.phrase("close"),class:"cm-dialog-close",type:"button"},["\xd7"]));function s(t){o.contains(o.ownerDocument.activeElement)&&e.focus(),n(t)}return t.class&&(o.className=t.class),o.classList.add("cm-dialog"),{dom:o,top:t.top,mount:()=>{if(t.focus){let e;(e="string"==typeof t.focus?i.querySelector(t.focus):i.querySelector("input")||i.querySelector("button"))&&"select"in e?e.select():e&&"focus"in e&&e.focus()}}}})(e,t,n),e.state.field(bE,!1)?e.dispatch({effects:bO.of(r)}):e.dispatch({effects:fV.appendConfig.of(bE.init(()=>[r]))}),{close:o=bP.of(r),result:i.then(t=>((e.win.queueMicrotask||(t=>e.win.setTimeout(t,10)))(()=>{e.state.field(bE).indexOf(r)>-1&&e.dispatch({effects:o})}),t))});return u.then(t=>{let n=t&&/^([+-])?(\d+)?(:\d+)?(%)?$/.exec(t.elements.line.value);if(!n)return void e.dispatch({effects:a});let i=s.doc.lineAt(s.selection.main.head),[,r,o,l,u]=n,c=l?+l.slice(1):0,h=o?+o:i.number;if(o&&u){let e=h/100;r&&(e=e*("-"==r?-1:1)+i.number/s.doc.lines),h=Math.round(s.doc.lines*e)}else o&&r&&(h=h*("-"==r?-1:1)+i.number);let d=s.doc.line(Math.max(1,Math.min(s.doc.lines,h))),f=fh.cursor(d.from+Math.max(0,Math.min(c,d.length)));e.dispatch({effects:[a,vT.scrollIntoView(f.from,{y:"center"})],selection:f})}),!0}},{key:"Mod-d",run:({state:e,dispatch:t})=>{let{ranges:n}=e.selection;if(n.some(e=>e.from===e.to))return(({state:e,dispatch:t})=>{let{selection:n}=e,i=fh.create(n.ranges.map(t=>e.wordAt(t.head)||fh.cursor(t.head)),n.mainIndex);return!i.eq(n)&&(t(e.update({selection:i})),!0)})({state:e,dispatch:t});let i=e.sliceDoc(n[0].from,n[0].to);if(e.selection.ranges.some(t=>e.sliceDoc(t.from,t.to)!=i))return!1;let r=function(e,t){let{main:n,ranges:i}=e.selection,r=e.wordAt(n.head),o=r&&r.from==n.from&&r.to==n.to;for(let n=!1,r=new Su(e.doc,t,i[i.length-1].to);;)if(r.next(),r.done){if(n)return null;r=new Su(e.doc,t,0,Math.max(0,i[i.length-1].from-1)),n=!0}else{if(n&&i.some(e=>e.from==r.value.from))continue;if(o){let t=e.wordAt(r.value.from);if(!t||t.from!=r.value.from||t.to!=r.value.to)continue}return r.value}}(e,i);return!!r&&(t(e.update({selection:e.selection.addRange(fh.range(r.from,r.to),!1),effects:vT.scrollIntoView(r.to)})),!0)},preventDefault:!0}];class SJ{constructor(e){this.view=e;let t=this.query=e.state.field(Sj).query.spec;function n(e,t,n){return pg("button",{class:"cm-button",name:e,onclick:t,type:"button"},n)}this.commit=this.commit.bind(this),this.searchField=pg("input",{value:t.search,placeholder:S0(e,"Find"),"aria-label":S0(e,"Find"),class:"cm-textfield",name:"search",form:"","main-field":"true",onchange:this.commit,onkeyup:this.commit}),this.replaceField=pg("input",{value:t.replace,placeholder:S0(e,"Replace"),"aria-label":S0(e,"Replace"),class:"cm-textfield",name:"replace",form:"",onchange:this.commit,onkeyup:this.commit}),this.caseField=pg("input",{type:"checkbox",name:"case",form:"",checked:t.caseSensitive,onchange:this.commit}),this.reField=pg("input",{type:"checkbox",name:"re",form:"",checked:t.regexp,onchange:this.commit}),this.wordField=pg("input",{type:"checkbox",name:"word",form:"",checked:t.wholeWord,onchange:this.commit}),this.dom=pg("div",{onkeydown:e=>this.keydown(e),class:"cm-search"},[this.searchField,n("next",()=>Sz(e),[S0(e,"next")]),n("prev",()=>SW(e),[S0(e,"previous")]),n("select",()=>S$(e),[S0(e,"all")]),pg("label",null,[this.caseField,S0(e,"match case")]),pg("label",null,[this.reField,S0(e,"regexp")]),pg("label",null,[this.wordField,S0(e,"by word")]),...e.state.readOnly?[]:[pg("br"),this.replaceField,n("replace",()=>S_(e),[S0(e,"replace")]),n("replaceAll",()=>SU(e),[S0(e,"replace all")])],pg("button",{name:"close",onclick:()=>SZ(e),"aria-label":S0(e,"close"),type:"button"},["\xd7"])])}commit(){let e=new Sk({search:this.searchField.value,caseSensitive:this.caseField.checked,regexp:this.reField.checked,wholeWord:this.wordField.checked,replace:this.replaceField.value});e.eq(this.query)||(this.query=e,this.view.dispatch({effects:SP.of(e)}))}keydown(e){var t;(t=this.view,vH(vF(t.state),e,t,"search-panel"))?e.preventDefault():13==e.keyCode&&e.target==this.searchField?(e.preventDefault(),(e.shiftKey?SW:Sz)(this.view)):13==e.keyCode&&e.target==this.replaceField&&(e.preventDefault(),S_(this.view))}update(e){for(let t of e.transactions)for(let e of t.effects)e.is(SP)&&!e.value.eq(this.query)&&this.setQuery(e.value)}setQuery(e){this.query=e,this.searchField.value=e.search,this.replaceField.value=e.replace,this.caseField.checked=e.caseSensitive,this.reField.checked=e.regexp,this.wordField.checked=e.wholeWord}mount(){this.searchField.select()}get pos(){return 80}get top(){return this.view.state.facet(SA).top}}function S0(e,t){return e.state.phrase(t)}let S1=/[\s\.,:;?!]/;function S2(e,{from:t,to:n}){let i=e.state.doc.lineAt(t),r=e.state.doc.lineAt(n).to,o=Math.max(i.from,t-30),s=Math.min(r,n+30),l=e.state.sliceDoc(o,s);if(o!=i.from){for(let e=0;e<30;e++)if(!S1.test(l[e+1])&&S1.test(l[e])){l=l.slice(e);break}}if(s!=r){for(let e=l.length-1;e>l.length-30;e--)if(!S1.test(l[e-1])&&S1.test(l[e])){l=l.slice(0,e);break}}return vT.announce.of(`${e.state.phrase("current match")}. ${l} ${e.state.phrase("on line")} ${i.number}.`)}let S5=vT.baseTheme({".cm-panel.cm-search":{padding:"2px 6px 4px",position:"relative","& [name=close]":{position:"absolute",top:"0",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",padding:0,margin:0},"& input, & button, & label":{margin:".2em .6em .2em 0"},"& input[type=checkbox]":{marginRight:".2em"},"& label":{fontSize:"80%",whiteSpace:"pre"}},"&light .cm-searchMatch":{backgroundColor:"#ffff0054"},"&dark .cm-searchMatch":{backgroundColor:"#00ffff8a"},"&light .cm-searchMatch-selected":{backgroundColor:"#ff6a0054"},"&dark .cm-searchMatch-selected":{backgroundColor:"#ff00ff8a"}}),S3=[Sj,fS.low(SV),S5];class S4{constructor(e,t,n,i){this.state=e,this.pos=t,this.explicit=n,this.view=i,this.abortListeners=[],this.abortOnDocChange=!1}tokenBefore(e){let t=xJ(this.state).resolveInner(this.pos,-1);for(;t&&0>e.indexOf(t.name);)t=t.parent;return t?{from:t.from,to:this.pos,text:this.state.sliceDoc(t.from,this.pos),type:t.type}:null}matchBefore(e){let t=this.state.doc.lineAt(this.pos),n=Math.max(t.from,this.pos-250),i=t.text.slice(n-t.from,this.pos-t.from),r=i.search(S7(e,!1));return r<0?null:{from:n+r,to:this.pos,text:i.slice(r)}}get aborted(){return null==this.abortListeners}addEventListener(e,t,n){"abort"==e&&this.abortListeners&&(this.abortListeners.push(t),n&&n.onDocChange&&(this.abortOnDocChange=!0))}}function S6(e){let t=Object.keys(e).join(""),n=/\w/.test(t);return n&&(t=t.replace(/\w/g,"")),`[${n?"\\w":""}${t.replace(/[^\w\s]/g,"\\$&")}]`}class S8{constructor(e,t,n,i){this.completion=e,this.source=t,this.match=n,this.score=i}}function S9(e){return e.selection.main.from}function S7(e,t){var n;let{source:i}=e,r=t&&"^"!=i[0],o="$"!=i[i.length-1];return r||o?RegExp(`${r?"^":""}(?:${i})${o?"$":""}`,null!=(n=e.flags)?n:e.ignoreCase?"i":""):e}let Ce=fB.define(),Ct=new WeakMap;function Cn(e){if(!Array.isArray(e))return e;let t=Ct.get(e);return t||Ct.set(e,t=function(e){let t=e.map(e=>"string"==typeof e?{label:e}:e),[n,i]=t.every(e=>/^\w+$/.test(e.label))?[/\w*$/,/\w+$/]:function(e){let t=Object.create(null),n=Object.create(null);for(let{label:i}of e){t[i[0]]=!0;for(let e=1;e<i.length;e++)n[i[e]]=!0}let i=S6(t)+S6(n)+"*$";return[RegExp("^"+i),new RegExp(i)]}(t);return e=>{let r=e.matchBefore(i);return r||e.explicit?{from:r?r.from:e.pos,options:t,validFor:n}:null}}(e)),t}let Ci=fV.define(),Cr=fV.define();class Co{constructor(e){this.pattern=e,this.chars=[],this.folded=[],this.any=[],this.precise=[],this.byWord=[],this.score=0,this.matched=[];for(let t=0;t<e.length;){let n=d8(e,t),i=d7(n);this.chars.push(n);let r=e.slice(t,t+i),o=r.toUpperCase();this.folded.push(d8(o==r?r.toLowerCase():o,0)),t+=i}this.astral=e.length!=this.chars.length}ret(e,t){return this.score=e,this.matched=t,this}match(e){if(0==this.pattern.length)return this.ret(-100,[]);if(e.length<this.pattern.length)return null;let{chars:t,folded:n,any:i,precise:r,byWord:o}=this;if(1==t.length){let i=d8(e,0),r=d7(i),o=r==e.length?0:-100;if(i==t[0]);else{if(i!=n[0])return null;o+=-200}return this.ret(o,[0,r])}let s=e.indexOf(this.pattern);if(0==s)return this.ret(e.length==this.pattern.length?0:-100,[0,this.pattern.length]);let l=t.length,a=0;if(s<0){for(let r=0,o=Math.min(e.length,200);r<o&&a<l;){let o=d8(e,r);(o==t[a]||o==n[a])&&(i[a++]=r),r+=d7(o)}if(a<l)return null}let u=0,c=0,h=!1,d=0,f=-1,p=-1,m=/[a-z]/.test(e),g=!0;for(let i=0,a=Math.min(e.length,200),v=0;i<a&&c<l;){let a=d8(e,i);s<0&&(u<l&&a==t[u]&&(r[u++]=i),d<l&&(a==t[d]||a==n[d]?(0==d&&(f=i),p=i+1,d++):d=0));let b,x=a<255?a>=48&&a<=57||a>=97&&a<=122?2:+(a>=65&&a<=90):(b=d9(a))!=b.toLowerCase()?1:2*(b!=b.toUpperCase());(!i||1==x&&m||0==v&&0!=x)&&(t[c]==a||n[c]==a&&(h=!0)?o[c++]=i:o.length&&(g=!1)),v=x,i+=d7(a)}return c==l&&0==o[0]&&g?this.result(-100+(h?-200:0),o,e):d==l&&0==f?this.ret(-200-e.length+(p==e.length?0:-100),[0,p]):s>-1?this.ret(-700-e.length,[s,s+this.pattern.length]):d==l?this.ret(-900-e.length,[f,p]):c==l?this.result(-100+(h?-200:0)+-700+(g?0:-1100),o,e):2==t.length?null:this.result((i[0]?-700:0)+-200+-1100,i,e)}result(e,t,n){let i=[],r=0;for(let e of t){let t=e+(this.astral?d7(d8(n,e)):1);r&&i[r-1]==e?i[r-1]=t:(i[r++]=e,i[r++]=t)}return this.ret(e-n.length,i)}}class Cs{constructor(e){this.pattern=e,this.matched=[],this.score=0,this.folded=e.toLowerCase()}match(e){if(e.length<this.pattern.length)return null;let t=e.slice(0,this.pattern.length),n=t==this.pattern?0:t.toLowerCase()==this.folded?-200:null;return null==n?null:(this.matched=[0,t.length],this.score=n+(e.length==this.pattern.length?0:-100),this)}}let Cl=fp.define({combine:e=>fY(e,{activateOnTyping:!0,activateOnCompletion:()=>!1,activateOnTypingDelay:100,selectOnOpen:!0,override:null,closeOnBlur:!0,maxRenderedOptions:100,defaultKeymap:!0,tooltipClass:()=>"",optionClass:()=>"",aboveCursor:!1,icons:!0,addToOptions:[],positionInfo:Cu,filterStrict:!1,compareCompletions:(e,t)=>(e.sortText||e.label).localeCompare(t.sortText||t.label),interactionDelay:75,updateSyncTime:100},{defaultKeymap:(e,t)=>e&&t,closeOnBlur:(e,t)=>e&&t,icons:(e,t)=>e&&t,tooltipClass:(e,t)=>n=>Ca(e(n),t(n)),optionClass:(e,t)=>n=>Ca(e(n),t(n)),addToOptions:(e,t)=>e.concat(t),filterStrict:(e,t)=>e||t})});function Ca(e,t){return e?t?e+" "+t:e:t}function Cu(e,t,n,i,r,o){let s=e.textDirection==p7.RTL,l=s,a=!1,u="top",c,h,d=t.left-r.left,f=r.right-t.right,p=i.right-i.left,m=i.bottom-i.top;if(l&&d<Math.min(p,f)?l=!1:!l&&f<Math.min(p,d)&&(l=!0),p<=(l?d:f))c=Math.max(r.top,Math.min(n.top,r.bottom-m))-t.top,h=Math.min(400,l?d:f);else{a=!0,h=Math.min(400,(s?t.right:r.right-t.left)-30);let e=r.bottom-t.bottom;e>=m||e>t.top?c=n.bottom-t.top:(u="bottom",c=t.bottom-n.top)}let g=(t.bottom-t.top)/o.offsetHeight,v=(t.right-t.left)/o.offsetWidth;return{style:`${u}: ${c/g}px; max-width: ${h/v}px`,class:"cm-completionInfo-"+(a?s?"left-narrow":"right-narrow":l?"left":"right")}}let Cc=fV.define();function Ch(e,t,n){if(e<=n)return{from:0,to:e};if(t<0&&(t=0),t<=e>>1){let e=Math.floor(t/n);return{from:e*n,to:(e+1)*n}}let i=Math.ceil((e-t)/n);return{from:e-i*n,to:e-(i-1)*n}}class Cd{constructor(e,t,n){this.view=e,this.stateField=t,this.applyCompletion=n,this.info=null,this.infoDestroy=null,this.placeInfoReq={read:()=>this.measureInfo(),write:e=>this.placeInfo(e),key:this},this.space=null,this.currentClass="";let i=e.state.field(t),{options:r,selected:o}=i.open,s=e.state.facet(Cl);this.optionContent=function(e){let t=e.addToOptions.slice();return e.icons&&t.push({render(e){let t=document.createElement("div");return t.classList.add("cm-completionIcon"),e.type&&t.classList.add(...e.type.split(/\s+/g).map(e=>"cm-completionIcon-"+e)),t.setAttribute("aria-hidden","true"),t},position:20}),t.push({render(e,t,n,i){let r=document.createElement("span");r.className="cm-completionLabel";let o=e.displayLabel||e.label,s=0;for(let e=0;e<i.length;){let t=i[e++],n=i[e++];t>s&&r.appendChild(document.createTextNode(o.slice(s,t)));let l=r.appendChild(document.createElement("span"));l.appendChild(document.createTextNode(o.slice(t,n))),l.className="cm-completionMatchedText",s=n}return s<o.length&&r.appendChild(document.createTextNode(o.slice(s))),r},position:50},{render(e){if(!e.detail)return null;let t=document.createElement("span");return t.className="cm-completionDetail",t.textContent=e.detail,t},position:80}),t.sort((e,t)=>e.position-t.position).map(e=>e.render)}(s),this.optionClass=s.optionClass,this.tooltipClass=s.tooltipClass,this.range=Ch(r.length,o,s.maxRenderedOptions),this.dom=document.createElement("div"),this.dom.className="cm-tooltip-autocomplete",this.updateTooltipClass(e.state),this.dom.addEventListener("mousedown",n=>{let{options:i}=e.state.field(t).open;for(let t=n.target,r;t&&t!=this.dom;t=t.parentNode)if("LI"==t.nodeName&&(r=/-(\d+)$/.exec(t.id))&&+r[1]<i.length){this.applyCompletion(e,i[+r[1]]),n.preventDefault();return}if(n.target==this.list){let t=this.list.classList.contains("cm-completionListIncompleteTop")&&n.clientY<this.list.firstChild.getBoundingClientRect().top?this.range.from-1:this.list.classList.contains("cm-completionListIncompleteBottom")&&n.clientY>this.list.lastChild.getBoundingClientRect().bottom?this.range.to:null;null!=t&&(e.dispatch({effects:Cc.of(t)}),n.preventDefault())}}),this.dom.addEventListener("focusout",t=>{let n=e.state.field(this.stateField,!1);n&&n.tooltip&&e.state.facet(Cl).closeOnBlur&&t.relatedTarget!=e.contentDOM&&e.dispatch({effects:Cr.of(null)})}),this.showOptions(r,i.id)}mount(){this.updateSel()}showOptions(e,t){this.list&&this.list.remove(),this.list=this.dom.appendChild(this.createListBox(e,t,this.range)),this.list.addEventListener("scroll",()=>{this.info&&this.view.requestMeasure(this.placeInfoReq)})}update(e){var t;let n=e.state.field(this.stateField),i=e.startState.field(this.stateField);if(this.updateTooltipClass(e.state),n!=i){let{options:r,selected:o,disabled:s}=n.open;i.open&&i.open.options==r||(this.range=Ch(r.length,o,e.state.facet(Cl).maxRenderedOptions),this.showOptions(r,n.id)),this.updateSel(),s!=(null==(t=i.open)?void 0:t.disabled)&&this.dom.classList.toggle("cm-tooltip-autocomplete-disabled",!!s)}}updateTooltipClass(e){let t=this.tooltipClass(e);if(t!=this.currentClass){for(let e of this.currentClass.split(" "))e&&this.dom.classList.remove(e);for(let e of t.split(" "))e&&this.dom.classList.add(e);this.currentClass=t}}positioned(e){this.space=e,this.info&&this.view.requestMeasure(this.placeInfoReq)}updateSel(){let e=this.view.state.field(this.stateField),t=e.open;(t.selected>-1&&t.selected<this.range.from||t.selected>=this.range.to)&&(this.range=Ch(t.options.length,t.selected,this.view.state.facet(Cl).maxRenderedOptions),this.showOptions(t.options,e.id));let n=this.updateSelectedOption(t.selected);if(n){this.destroyInfo();let{completion:i}=t.options[t.selected],{info:r}=i;if(!r)return;let o="string"==typeof r?document.createTextNode(r):r(i);if(!o)return;"then"in o?o.then(t=>{t&&this.view.state.field(this.stateField,!1)==e&&this.addInfoPane(t,i)}).catch(e=>mD(this.view.state,e,"completion info")):(this.addInfoPane(o,i),n.setAttribute("aria-describedby",this.info.id))}}addInfoPane(e,t){this.destroyInfo();let n=this.info=document.createElement("div");if(n.className="cm-tooltip cm-completionInfo",n.id="cm-completionInfo-"+Math.floor(65535*Math.random()).toString(16),null!=e.nodeType)n.appendChild(e),this.infoDestroy=null;else{let{dom:t,destroy:i}=e;n.appendChild(t),this.infoDestroy=i||null}this.dom.appendChild(n),this.view.requestMeasure(this.placeInfoReq)}updateSelectedOption(e){var t,n;let i,r,o,s=null;for(let t=this.list.firstChild,n=this.range.from;t;t=t.nextSibling,n++)"LI"==t.nodeName&&t.id?n==e?t.hasAttribute("aria-selected")||(t.setAttribute("aria-selected","true"),s=t):t.hasAttribute("aria-selected")&&(t.removeAttribute("aria-selected"),t.removeAttribute("aria-describedby")):n--;return s&&(t=this.list,n=s,i=t.getBoundingClientRect(),r=n.getBoundingClientRect(),o=i.height/t.offsetHeight,r.top<i.top?t.scrollTop-=(i.top-r.top)/o:r.bottom>i.bottom&&(t.scrollTop+=(r.bottom-i.bottom)/o)),s}measureInfo(){let e=this.dom.querySelector("[aria-selected]");if(!e||!this.info)return null;let t=this.dom.getBoundingClientRect(),n=this.info.getBoundingClientRect(),i=e.getBoundingClientRect(),r=this.space;if(!r){let e=this.dom.ownerDocument.documentElement;r={left:0,top:0,right:e.clientWidth,bottom:e.clientHeight}}return i.top>Math.min(r.bottom,t.bottom)-10||i.bottom<Math.max(r.top,t.top)+10?null:this.view.state.facet(Cl).positionInfo(this.view,t,i,n,r,this.dom)}placeInfo(e){this.info&&(e?(e.style&&(this.info.style.cssText=e.style),this.info.className="cm-tooltip cm-completionInfo "+(e.class||"")):this.info.style.cssText="top: -1e6px")}createListBox(e,t,n){let i=document.createElement("ul");i.id=t,i.setAttribute("role","listbox"),i.setAttribute("aria-expanded","true"),i.setAttribute("aria-label",this.view.state.phrase("Completions")),i.addEventListener("mousedown",e=>{e.target==i&&e.preventDefault()});let r=null;for(let o=n.from;o<n.to;o++){let{completion:s,match:l}=e[o],{section:a}=s;if(a){let e="string"==typeof a?a:a.name;e!=r&&(o>n.from||0==n.from)&&(r=e,"string"!=typeof a&&a.header?i.appendChild(a.header(a)):i.appendChild(document.createElement("completion-section")).textContent=e)}let u=i.appendChild(document.createElement("li"));u.id=t+"-"+o,u.setAttribute("role","option");let c=this.optionClass(s);for(let e of(c&&(u.className=c),this.optionContent)){let t=e(s,this.view.state,this.view,l);t&&u.appendChild(t)}}return n.from&&i.classList.add("cm-completionListIncompleteTop"),n.to<e.length&&i.classList.add("cm-completionListIncompleteBottom"),i}destroyInfo(){this.info&&(this.infoDestroy&&this.infoDestroy(),this.info.remove(),this.info=null)}destroy(){this.destroyInfo()}}function Cf(e){return 100*(e.boost||0)+10*!!e.apply+5*!!e.info+ +!!e.type}class Cp{constructor(e,t,n,i,r,o){this.options=e,this.attrs=t,this.tooltip=n,this.timestamp=i,this.selected=r,this.disabled=o}setSelected(e,t){return e==this.selected||e>=this.options.length?this:new Cp(this.options,Cb(t,e),this.tooltip,this.timestamp,e,this.disabled)}static build(e,t,n,i,r,o){if(i&&!o&&e.some(e=>e.isPending))return i.setDisabled();let s=function(e,t){let n=[],i=null,r=null,o=e=>{n.push(e);let{section:t}=e.completion;if(t){i||(i=[]);let e="string"==typeof t?t:t.name;i.some(t=>t.name==e)||i.push("string"==typeof t?{name:e}:t)}},s=t.facet(Cl);for(let i of e)if(i.hasResult()){let e=i.result.getMatch;if(!1===i.result.filter)for(let t of i.result.options)o(new S8(t,i.source,e?e(t):[],1e9-n.length));else{let n=t.sliceDoc(i.from,i.to),l,a=s.filterStrict?new Cs(n):new Co(n);for(let t of i.result.options)if(l=a.match(t.label)){let n=t.displayLabel?e?e(t,l.matched):[]:l.matched,s=l.score+(t.boost||0);if(o(new S8(t,i.source,n,s)),"object"==typeof t.section&&"dynamic"===t.section.rank){let{name:e}=t.section;r||(r=Object.create(null)),r[e]=Math.max(s,r[e]||-1e9)}}}}if(i){let e=Object.create(null),t=0;for(let n of i.sort((e,t)=>("dynamic"===e.rank&&"dynamic"===t.rank?r[t.name]-r[e.name]:0)||("number"==typeof e.rank?e.rank:1e9)-("number"==typeof t.rank?t.rank:1e9)||(e.name<t.name?-1:1)))t-=1e5,e[n.name]=t;for(let t of n){let{section:n}=t.completion;n&&(t.score+=e["string"==typeof n?n:n.name])}}let l=[],a=null,u=s.compareCompletions;for(let e of n.sort((e,t)=>t.score-e.score||u(e.completion,t.completion))){let t=e.completion;a&&a.label==t.label&&a.detail==t.detail&&(null==a.type||null==t.type||a.type==t.type)&&a.apply==t.apply&&a.boost==t.boost?Cf(e.completion)>Cf(a)&&(l[l.length-1]=e):l.push(e),a=e.completion}return l}(e,t);if(!s.length)return i&&e.some(e=>e.isPending)?i.setDisabled():null;let l=t.facet(Cl).selectOnOpen?0:-1;if(i&&i.selected!=l&&-1!=i.selected){let e=i.options[i.selected].completion;for(let t=0;t<s.length;t++)if(s[t].completion==e){l=t;break}}return new Cp(s,Cb(n,l),{pos:e.reduce((e,t)=>t.hasResult()?Math.min(e,t.from):e,1e8),create:CM,above:r.aboveCursor},i?i.timestamp:Date.now(),l,!1)}map(e){return new Cp(this.options,this.attrs,{...this.tooltip,pos:e.mapPos(this.tooltip.pos)},this.timestamp,this.selected,this.disabled)}setDisabled(){return new Cp(this.options,this.attrs,this.tooltip,this.timestamp,this.selected,!0)}}class Cm{constructor(e,t,n){this.active=e,this.id=t,this.open=n}static start(){return new Cm(Cx,"cm-ac-"+Math.floor(2e6*Math.random()).toString(36),null)}update(e){let{state:t}=e,n=t.facet(Cl),i=(n.override||t.languageDataAt("autocomplete",S9(t)).map(Cn)).map(t=>(this.active.find(e=>e.source==t)||new Cw(t,+!!this.active.some(e=>0!=e.state))).update(e,n));i.length==this.active.length&&i.every((e,t)=>e==this.active[t])&&(i=this.active);let r=this.open,o=e.effects.some(e=>e.is(CC));for(let s of(r&&e.docChanged&&(r=r.map(e.changes)),e.selection||i.some(t=>t.hasResult()&&e.changes.touchesRange(t.from,t.to))||!function(e,t){if(e==t)return!0;for(let n=0,i=0;;){for(;n<e.length&&!e[n].hasResult();)n++;for(;i<t.length&&!t[i].hasResult();)i++;let r=n==e.length,o=i==t.length;if(r||o)return r==o;if(e[n++].result!=t[i++].result)return!1}}(i,this.active)||o?r=Cp.build(i,t,this.id,r,n,o):r&&r.disabled&&!i.some(e=>e.isPending)&&(r=null),!r&&i.every(e=>!e.isPending)&&i.some(e=>e.hasResult())&&(i=i.map(e=>e.hasResult()?new Cw(e.source,0):e)),e.effects))s.is(Cc)&&(r=r&&r.setSelected(s.value,this.id));return i==this.active&&r==this.open?this:new Cm(i,this.id,r)}get tooltip(){return this.open?this.open.tooltip:null}get attrs(){return this.open?this.open.attrs:this.active.length?Cg:Cv}}let Cg={"aria-autocomplete":"list"},Cv={};function Cb(e,t){let n={"aria-autocomplete":"list","aria-haspopup":"listbox","aria-controls":e};return t>-1&&(n["aria-activedescendant"]=e+"-"+t),n}let Cx=[];function Cy(e,t){if(e.isUserEvent("input.complete")){let n=e.annotation(Ce);if(n&&t.activateOnCompletion(n))return 12}let n=e.isUserEvent("input.type");return n&&t.activateOnTyping?5:n?1:e.isUserEvent("delete.backward")?2:e.selection?8:16*!!e.docChanged}class Cw{constructor(e,t,n=!1){this.source=e,this.state=t,this.explicit=n}hasResult(){return!1}get isPending(){return 1==this.state}update(e,t){let n=Cy(e,t),i=this;for(let t of((8&n||16&n&&this.touches(e))&&(i=new Cw(i.source,0)),4&n&&0==i.state&&(i=new Cw(this.source,1)),i=i.updateFor(e,n),e.effects))if(t.is(Ci))i=new Cw(i.source,1,t.value);else if(t.is(Cr))i=new Cw(i.source,0);else if(t.is(CC))for(let e of t.value)e.source==i.source&&(i=e);return i}updateFor(e,t){return this.map(e.changes)}map(e){return this}touches(e){return e.changes.touchesRange(S9(e.state))}}class CS extends Cw{constructor(e,t,n,i,r,o){super(e,3,t),this.limit=n,this.result=i,this.from=r,this.to=o}hasResult(){return!0}updateFor(e,t){var n;if(!(3&t))return this.map(e.changes);let i=this.result;i.map&&!e.changes.empty&&(i=i.map(i,e.changes));let r=e.changes.mapPos(this.from),o=e.changes.mapPos(this.to,1),s=S9(e.state);if(s>o||!i||2&t&&(S9(e.startState)==this.from||s<this.limit))return new Cw(this.source,4&t?1:0);let l=e.changes.mapPos(this.limit);return!function(e,t,n,i){if(!e)return!1;let r=t.sliceDoc(n,i);return"function"==typeof e?e(r,n,i,t):S7(e,!0).test(r)}(i.validFor,e.state,r,o)?i.update&&(i=i.update(i,r,o,new S4(e.state,s,!1)))?new CS(this.source,this.explicit,l,i,i.from,null!=(n=i.to)?n:S9(e.state)):new Cw(this.source,1,this.explicit):new CS(this.source,this.explicit,l,i,r,o)}map(e){return e.empty?this:(this.result.map?this.result.map(this.result,e):this.result)?new CS(this.source,this.explicit,e.mapPos(this.limit),this.result,e.mapPos(this.from),e.mapPos(this.to,1)):new Cw(this.source,0)}touches(e){return e.changes.touchesRange(this.from,this.to)}}let CC=fV.define({map:(e,t)=>e.map(e=>e.map(t))}),CA=fy.define({create:()=>Cm.start(),update:(e,t)=>e.update(t),provide:e=>[bv.from(e,e=>e.tooltip),vT.contentAttributes.from(e,e=>e.attrs)]});function Ck(e,t){let n=t.completion.apply||t.completion.label,i=e.state.field(CA).active.find(e=>e.source==t.source);return i instanceof CS&&("string"==typeof n?e.dispatch({...function(e,t,n,i){let{main:r}=e.selection,o=n-r.from,s=i-r.from;return{...e.changeByRange(l=>{if(l!=r&&n!=i&&e.sliceDoc(l.from+o,l.from+s)!=e.sliceDoc(n,i))return{range:l};let a=e.toText(t);return{changes:{from:l.from+o,to:i==r.from?l.to:l.from+s,insert:a},range:fh.cursor(l.from+o+a.length)}}),scrollIntoView:!0,userEvent:"input.complete"}}(e.state,n,i.from,i.to),annotations:Ce.of(t.completion)}):n(e,t.completion,i.from,i.to),!0)}let CM=e=>new Cd(e,CA,Ck);function CT(e,t="option"){return n=>{let i=n.state.field(CA,!1);if(!i||!i.open||i.open.disabled||Date.now()-i.open.timestamp<n.state.facet(Cl).interactionDelay)return!1;let r=1,o;"page"==t&&(o=bC(n,i.open.tooltip))&&(r=Math.max(2,Math.floor(o.dom.offsetHeight/o.dom.querySelector("li").offsetHeight)-1));let{length:s}=i.open.options,l=i.open.selected>-1?i.open.selected+r*(e?1:-1):e?0:s-1;return l<0?l="page"==t?0:s-1:l>=s&&(l="page"==t?s-1:0),n.dispatch({effects:Cc.of(l)}),!0}}let CD=e=>!!e.state.field(CA,!1)&&(e.dispatch({effects:Ci.of(!0)}),!0);class CI{constructor(e,t){this.active=e,this.context=t,this.time=Date.now(),this.updates=[],this.done=void 0}}let CR=mO.fromClass(class{constructor(e){for(let t of(this.view=e,this.debounceUpdate=-1,this.running=[],this.debounceAccept=-1,this.pendingStart=!1,this.composing=0,e.state.field(CA).active))t.isPending&&this.startQuery(t)}update(e){let t=e.state.field(CA),n=e.state.facet(Cl);if(!e.selectionSet&&!e.docChanged&&e.startState.field(CA)==t)return;let i=e.transactions.some(e=>{let t=Cy(e,n);return 8&t||(e.selection||e.docChanged)&&!(3&t)});for(let t=0;t<this.running.length;t++){let n=this.running[t];if(i||n.context.abortOnDocChange&&e.docChanged||n.updates.length+e.transactions.length>50&&Date.now()-n.time>1e3){for(let e of n.context.abortListeners)try{e()}catch(e){mD(this.view.state,e)}n.context.abortListeners=null,this.running.splice(t--,1)}else n.updates.push(...e.transactions)}this.debounceUpdate>-1&&clearTimeout(this.debounceUpdate),e.transactions.some(e=>e.effects.some(e=>e.is(Ci)))&&(this.pendingStart=!0);let r=this.pendingStart?50:n.activateOnTypingDelay;if(this.debounceUpdate=t.active.some(e=>e.isPending&&!this.running.some(t=>t.active.source==e.source))?setTimeout(()=>this.startUpdate(),r):-1,0!=this.composing)for(let t of e.transactions)t.isUserEvent("input.type")?this.composing=2:2==this.composing&&t.selection&&(this.composing=3)}startUpdate(){this.debounceUpdate=-1,this.pendingStart=!1;let{state:e}=this.view,t=e.field(CA);for(let e of t.active)e.isPending&&!this.running.some(t=>t.active.source==e.source)&&this.startQuery(e);this.running.length&&t.open&&t.open.disabled&&(this.debounceAccept=setTimeout(()=>this.accept(),this.view.state.facet(Cl).updateSyncTime))}startQuery(e){let{state:t}=this.view,n=S9(t),i=new S4(t,n,e.explicit,this.view),r=new CI(e,i);this.running.push(r),Promise.resolve(e.source(i)).then(e=>{r.context.aborted||(r.done=e||null,this.scheduleAccept())},e=>{this.view.dispatch({effects:Cr.of(null)}),mD(this.view.state,e)})}scheduleAccept(){this.running.every(e=>void 0!==e.done)?this.accept():this.debounceAccept<0&&(this.debounceAccept=setTimeout(()=>this.accept(),this.view.state.facet(Cl).updateSyncTime))}accept(){var e;this.debounceAccept>-1&&clearTimeout(this.debounceAccept),this.debounceAccept=-1;let t=[],n=this.view.state.facet(Cl),i=this.view.state.field(CA);for(let r=0;r<this.running.length;r++){let o=this.running[r];if(void 0===o.done)continue;if(this.running.splice(r--,1),o.done){let i=S9(o.updates.length?o.updates[0].startState:this.view.state),r=Math.min(i,o.done.from+ +!o.active.explicit),s=new CS(o.active.source,o.active.explicit,r,o.done,o.done.from,null!=(e=o.done.to)?e:i);for(let e of o.updates)s=s.update(e,n);if(s.hasResult()){t.push(s);continue}}let s=i.active.find(e=>e.source==o.active.source);if(s&&s.isPending)if(null==o.done){let e=new Cw(o.active.source,0);for(let t of o.updates)e=e.update(t,n);e.isPending||t.push(e)}else this.startQuery(s)}(t.length||i.open&&i.open.disabled)&&this.view.dispatch({effects:CC.of(t)})}},{eventHandlers:{blur(e){let t=this.view.state.field(CA,!1);if(t&&t.tooltip&&this.view.state.facet(Cl).closeOnBlur){let n=t.open&&bC(this.view,t.open.tooltip);n&&n.dom.contains(e.relatedTarget)||setTimeout(()=>this.view.dispatch({effects:Cr.of(null)}),10)}},compositionstart(){this.composing=1},compositionend(){3==this.composing&&setTimeout(()=>this.view.dispatch({effects:Ci.of(!1)}),20),this.composing=0}}}),CE="object"==typeof navigator&&/Win/.test(navigator.platform),CO=fS.highest(vT.domEventHandlers({keydown(e,t){let n=t.state.field(CA,!1);if(!n||!n.open||n.open.disabled||n.open.selected<0||e.key.length>1||e.ctrlKey&&!(CE&&e.altKey)||e.metaKey)return!1;let i=n.open.options[n.open.selected],r=n.active.find(e=>e.source==i.source),o=i.completion.commitCharacters||r.result.commitCharacters;return o&&o.indexOf(e.key)>-1&&Ck(t,i),!1}})),CP=vT.baseTheme({".cm-tooltip.cm-tooltip-autocomplete":{"& > ul":{fontFamily:"monospace",whiteSpace:"nowrap",overflow:"hidden auto",maxWidth_fallback:"700px",maxWidth:"min(700px, 95vw)",minWidth:"250px",maxHeight:"10em",height:"100%",listStyle:"none",margin:0,padding:0,"& > li, & > completion-section":{padding:"1px 3px",lineHeight:1.2},"& > li":{overflowX:"hidden",textOverflow:"ellipsis",cursor:"pointer"},"& > completion-section":{display:"list-item",borderBottom:"1px solid silver",paddingLeft:"0.5em",opacity:.7}}},"&light .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#17c",color:"white"},"&light .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#777"},"&dark .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#347",color:"white"},"&dark .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#444"},".cm-completionListIncompleteTop:before, .cm-completionListIncompleteBottom:after":{content:'"\xb7\xb7\xb7"',opacity:.5,display:"block",textAlign:"center",cursor:"pointer"},".cm-tooltip.cm-completionInfo":{position:"absolute",padding:"3px 9px",width:"max-content",maxWidth:"400px",boxSizing:"border-box",whiteSpace:"pre-line"},".cm-completionInfo.cm-completionInfo-left":{right:"100%"},".cm-completionInfo.cm-completionInfo-right":{left:"100%"},".cm-completionInfo.cm-completionInfo-left-narrow":{right:"30px"},".cm-completionInfo.cm-completionInfo-right-narrow":{left:"30px"},"&light .cm-snippetField":{backgroundColor:"#00000022"},"&dark .cm-snippetField":{backgroundColor:"#ffffff22"},".cm-snippetFieldPosition":{verticalAlign:"text-top",width:0,height:"1.15em",display:"inline-block",margin:"0 -0.7px -.7em",borderLeft:"1.4px dotted #888"},".cm-completionMatchedText":{textDecoration:"underline"},".cm-completionDetail":{marginLeft:"0.5em",fontStyle:"italic"},".cm-completionIcon":{fontSize:"90%",width:".8em",display:"inline-block",textAlign:"center",paddingRight:".6em",opacity:"0.6",boxSizing:"content-box"},".cm-completionIcon-function, .cm-completionIcon-method":{"&:after":{content:"'ƒ'"}},".cm-completionIcon-class":{"&:after":{content:"'○'"}},".cm-completionIcon-interface":{"&:after":{content:"'◌'"}},".cm-completionIcon-variable":{"&:after":{content:"'\uD835\uDC65'"}},".cm-completionIcon-constant":{"&:after":{content:"'\uD835\uDC36'"}},".cm-completionIcon-type":{"&:after":{content:"'\uD835\uDC61'"}},".cm-completionIcon-enum":{"&:after":{content:"'∪'"}},".cm-completionIcon-property":{"&:after":{content:"'□'"}},".cm-completionIcon-keyword":{"&:after":{content:"'\uD83D\uDD11︎'"}},".cm-completionIcon-namespace":{"&:after":{content:"'▢'"}},".cm-completionIcon-text":{"&:after":{content:"'abc'",fontSize:"50%",verticalAlign:"middle"}}}),CL={brackets:["(","[","{","'",'"'],before:")]}:;>",stringPrefixes:[]},Cj=fV.define({map(e,t){let n=t.mapPos(e,-1,ft.TrackAfter);return null==n?void 0:n}}),CB=new class extends fK{};CB.startSide=1,CB.endSide=-1;let CF=fy.define({create:()=>f0.empty,update(e,t){if(e=e.map(t.changes),t.selection){let n=t.state.doc.lineAt(t.selection.main.head);e=e.update({filter:e=>e>=n.from&&e<=n.to})}for(let n of t.effects)n.is(Cj)&&(e=e.update({add:[CB.range(n.value,n.value+1)]}));return e}}),CN="()[]{}<>\xab\xbb\xbb\xab[]{}";function CV(e){for(let t=0;t<CN.length;t+=2)if(CN.charCodeAt(t)==e)return CN.charAt(t+1);return d9(e<128?e:e+1)}function CH(e,t){return e.languageDataAt("closeBrackets",t)[0]||CL}let Cz="object"==typeof navigator&&/Android\b/.test(navigator.userAgent),CW=vT.inputHandler.of((e,t,n,i)=>{if((Cz?e.composing:e.compositionStarted)||e.state.readOnly)return!1;let r=e.state.selection.main;if(i.length>2||2==i.length&&1==d7(d8(i,0))||t!=r.from||n!=r.to)return!1;let o=function(e,t){let n=CH(e,e.selection.main.head),i=n.brackets||CL.brackets;for(let r of i){let o=CV(d8(r,0));if(t==r)return o==r?function(e,t,n,i){let r=i.stringPrefixes||CL.stringPrefixes,o=null,s=e.changeByRange(i=>{if(!i.empty)return{changes:[{insert:t,from:i.from},{insert:t,from:i.to}],effects:Cj.of(i.to+t.length),range:fh.range(i.anchor+t.length,i.head+t.length)};let s=i.head,l=CU(e.doc,s),a;if(l==t){if(CG(e,s))return{changes:{insert:t+t,from:s},effects:Cj.of(s+t.length),range:fh.cursor(s+t.length)};else if(C_(e,s)){let i=n&&e.sliceDoc(s,s+3*t.length)==t+t+t?t+t+t:t;return{changes:{from:s,to:s+i.length,insert:i},range:fh.cursor(s+i.length)}}}else if(n&&e.sliceDoc(s-2*t.length,s)==t+t&&(a=Cq(e,s-2*t.length,r))>-1&&CG(e,a))return{changes:{insert:t+t+t+t,from:s},effects:Cj.of(s+t.length),range:fh.cursor(s+t.length)};else if(e.charCategorizer(s)(l)!=fU.Word&&Cq(e,s,r)>-1&&!function(e,t,n,i){let r=xJ(e).resolveInner(t,-1),o=i.reduce((e,t)=>Math.max(e,t.length),0);for(let s=0;s<5;s++){let s=e.sliceDoc(r.from,Math.min(r.to,r.from+n.length+o)),l=s.indexOf(n);if(!l||l>-1&&i.indexOf(s.slice(0,l))>-1){let t=r.firstChild;for(;t&&t.from==r.from&&t.to-t.from>n.length+l;){if(e.sliceDoc(t.to-n.length,t.to)==n)return!1;t=t.firstChild}return!0}let a=r.to==t&&r.parent;if(!a)break;r=a}return!1}(e,s,t,r))return{changes:{insert:t+t,from:s},effects:Cj.of(s+t.length),range:fh.cursor(s+t.length)};return{range:o=i}});return o?null:e.update(s,{scrollIntoView:!0,userEvent:"input.type"})}(e,r,i.indexOf(r+r+r)>-1,n):function(e,t,n,i){let r=null,o=e.changeByRange(o=>{if(!o.empty)return{changes:[{insert:t,from:o.from},{insert:n,from:o.to}],effects:Cj.of(o.to+t.length),range:fh.range(o.anchor+t.length,o.head+t.length)};let s=CU(e.doc,o.head);return!s||/\s/.test(s)||i.indexOf(s)>-1?{changes:{insert:t+n,from:o.head},effects:Cj.of(o.head+t.length),range:fh.cursor(o.head+t.length)}:{range:r=o}});return r?null:e.update(o,{scrollIntoView:!0,userEvent:"input.type"})}(e,r,o,n.before||CL.before);if(t==o&&C_(e,e.selection.main.from))return function(e,t){let n=null,i=e.changeByRange(i=>i.empty&&CU(e.doc,i.head)==t?{changes:{from:i.head,to:i.head+t.length,insert:t},range:fh.cursor(i.head+t.length)}:n={range:i});return n?null:e.update(i,{scrollIntoView:!0,userEvent:"input.type"})}(e,o)}return null}(e.state,i);return!!o&&(e.dispatch(o),!0)}),C$=[{key:"Backspace",run:({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=CH(e,e.selection.main.head).brackets||CL.brackets,i=null,r=e.changeByRange(t=>{if(t.empty){var r,o;let i,s=(r=e.doc,o=t.head,d7(d8(i=r.sliceString(o-2,o),0))==i.length?i:i.slice(1));for(let i of n)if(i==s&&CU(e.doc,t.head)==CV(d8(i,0)))return{changes:{from:t.head-i.length,to:t.head+i.length},range:fh.cursor(t.head-i.length)}}return{range:i=t}});return i||t(e.update(r,{scrollIntoView:!0,userEvent:"delete.backward"})),!i}}];function C_(e,t){let n=!1;return e.field(CF).between(0,e.doc.length,e=>{e==t&&(n=!0)}),n}function CU(e,t){let n=e.sliceString(t,t+2);return n.slice(0,d7(d8(n,0)))}function CG(e,t){let n=xJ(e).resolveInner(t+1);return n.parent&&n.from==t}function Cq(e,t,n){let i=e.charCategorizer(t);if(i(e.sliceDoc(t-1,t))!=fU.Word)return t;for(let r of n){let n=t-r.length;if(e.sliceDoc(n,t)==r&&i(e.sliceDoc(n-1,n))!=fU.Word)return n}return -1}let CY=[{key:"Ctrl-Space",run:CD},{mac:"Alt-`",run:CD},{mac:"Alt-i",run:CD},{key:"Escape",run:e=>{let t=e.state.field(CA,!1);return!!t&&!!t.active.some(e=>0!=e.state)&&(e.dispatch({effects:Cr.of(null)}),!0)}},{key:"ArrowDown",run:CT(!0)},{key:"ArrowUp",run:CT(!1)},{key:"PageDown",run:CT(!0,"page")},{key:"PageUp",run:CT(!1,"page")},{key:"Enter",run:e=>{let t=e.state.field(CA,!1);return!(e.state.readOnly||!t||!t.open||t.open.selected<0||t.open.disabled||Date.now()-t.open.timestamp<e.state.facet(Cl).interactionDelay)&&Ck(e,t.open.options[t.open.selected])}}],CK=fS.highest(vj.computeN([Cl],e=>e.facet(Cl).defaultKeymap?[CY]:[]));class CX{constructor(e,t,n){this.from=e,this.to=t,this.diagnostic=n}}class CZ{constructor(e,t,n){this.diagnostics=e,this.panel=t,this.selected=n}static init(e,t,n){let i=n.facet(Ae).markerFilter;i&&(e=i(e,n));let r=e.slice().sort((e,t)=>e.from-t.from||e.to-t.to),o=new f1,s=[],l=0,a=n.doc.iter(),u=0,c=n.doc.length;for(let e=0;;){let t,n,i=e==r.length?null:r[e];if(!i&&!s.length)break;if(s.length)t=l,n=s.reduce((e,t)=>Math.min(e,t.to),i&&i.from>t?i.from:1e8);else{if((t=i.from)>c)break;n=i.to,s.push(i),e++}for(;e<r.length;){let i=r[e];if(i.from==t&&(i.to>i.from||i.to==t))s.push(i),e++,n=Math.min(i.to,n);else{n=Math.min(i.from,n);break}}n=Math.min(n,c);let h=!1;if(s.some(e=>e.from==t&&(e.to==n||n==c))&&!(h=t==n)&&n-t<10){let e=t-(u+a.value.length);e>0&&(a.next(e),u=t);for(let e=t;;){if(e>=n){h=!0;break}if(!a.lineBreak&&u+a.value.length>e)break;e=u+a.value.length,u+=a.value.length,a.next()}}let d=Ac(s);if(h)o.add(t,t,pj.widget({widget:new Ar(d),diagnostics:s.slice()}));else{let e=s.reduce((e,t)=>t.markClass?e+" "+t.markClass:e,"");o.add(t,n,pj.mark({class:"cm-lintRange cm-lintRange-"+d+e,diagnostics:s.slice(),inclusiveEnd:s.some(e=>e.to>n)}))}if((l=n)==c)break;for(let e=0;e<s.length;e++)s[e].to<=l&&s.splice(e--,1)}let h=o.finish();return new CZ(h,t,CQ(h))}}function CQ(e,t=null,n=0){let i=null;return e.between(n,1e9,(e,n,{spec:r})=>{if(!(t&&0>r.diagnostics.indexOf(t)))if(i){if(0>r.diagnostics.indexOf(i.diagnostic))return!1;i=new CX(i.from,n,i.diagnostic)}else i=new CX(e,n,t||r.diagnostics[0])}),i}function CJ(e,t){let n=t.pos,i=t.end||n,r=e.state.facet(Ae).hideOn(e,n,i);if(null!=r)return r;let o=e.startState.doc.lineAt(t.pos);return!!(e.effects.some(e=>e.is(C1))||e.changes.touchesRange(o.from,Math.max(o.to,i)))}function C0(e,t){return e.field(C3,!1)?t:t.concat(fV.appendConfig.of(Ab))}let C1=fV.define(),C2=fV.define(),C5=fV.define(),C3=fy.define({create:()=>new CZ(pj.none,null,null),update(e,t){if(t.docChanged&&e.diagnostics.size){let n=e.diagnostics.map(t.changes),i=null,r=e.panel;if(e.selected){let r=t.changes.mapPos(e.selected.from,1);i=CQ(n,e.selected.diagnostic,r)||CQ(n,null,r)}!n.size&&r&&t.state.facet(Ae).autoPanel&&(r=null),e=new CZ(n,r,i)}for(let n of t.effects)if(n.is(C1)){let i=t.state.facet(Ae).autoPanel?n.value.length?As.open:null:e.panel;e=CZ.init(n.value,i,t.state)}else n.is(C2)?e=new CZ(e.diagnostics,n.value?As.open:null,e.selected):n.is(C5)&&(e=new CZ(e.diagnostics,e.panel,n.value));return e},provide:e=>[bR.from(e,e=>e.panel),vT.decorations.from(e,e=>e.diagnostics)]}),C4=pj.mark({class:"cm-lintRange cm-lintRange-active"});function C6(e,t){return pg("ul",{class:"cm-tooltip-lint"},t.map(t=>Ai(e,t,!1)))}let C8=e=>{let t=e.state.field(C3,!1);return!!t&&!!t.panel&&(e.dispatch({effects:C2.of(!1)}),!0)},C9=[{key:"Mod-Shift-m",run:e=>{let t=e.state.field(C3,!1);t&&t.panel||e.dispatch({effects:C0(e.state,[C2.of(!0)])});let n=bM(e,As.open);return n&&n.dom.querySelector(".cm-panel-lint ul").focus(),!0},preventDefault:!0},{key:"F8",run:e=>{let t=e.state.field(C3,!1);if(!t)return!1;let n=e.state.selection.main,i=CQ(t.diagnostics,null,n.to+1);return(!!i||!!(i=CQ(t.diagnostics,null,0))&&(i.from!=n.from||i.to!=n.to))&&(e.dispatch({selection:{anchor:i.from,head:i.to},scrollIntoView:!0}),!function(e,t,n={}){var i;let r=e.state.facet(bw).map(t=>e.plugin(t)).filter(e=>!!e);if(n.tooltip&&n.tooltip.active){let e=r.find(e=>e.field==n.tooltip.active);e&&(r=[e])}for(let o of r)o.activateHover(e,t,1,null!=(i=n.until)?i:()=>!1)}(e,i.from,{tooltip:Av,until:e=>e.docChanged||e.newSelection.main.head<i.from||e.newSelection.main.head>i.to}),!0)}}],C7=mO.fromClass(class{constructor(e){this.view=e,this.timeout=-1,this.set=!0;let{delay:t}=e.state.facet(Ae);this.lintTime=Date.now()+t,this.run=this.run.bind(this),this.timeout=setTimeout(this.run,t)}run(){clearTimeout(this.timeout);let e=Date.now();if(e<this.lintTime-10)this.timeout=setTimeout(this.run,this.lintTime-e);else{this.set=!1;let{state:e}=this.view,{sources:t}=e.facet(Ae);t.length&&function(e,t,n){let i=[],r=-1;for(let o of e)o.then(n=>{i.push(n),clearTimeout(r),i.length==e.length?t(i):r=setTimeout(()=>t(i),200)},n)}(t.map(e=>Promise.resolve(e(this.view))),t=>{var n,i;this.view.state.doc==e.doc&&this.view.dispatch((n=this.view.state,i=t.reduce((e,t)=>e.concat(t)),{effects:C0(n,[C1.of(i)])}))},e=>{mD(this.view.state,e)})}}update(e){let t=e.state.facet(Ae);(e.docChanged||t!=e.startState.facet(Ae)||t.needsRefresh&&t.needsRefresh(e))&&(this.lintTime=Date.now()+t.delay,this.set||(this.set=!0,this.timeout=setTimeout(this.run,t.delay)))}force(){this.set&&(this.lintTime=Date.now(),this.run())}destroy(){clearTimeout(this.timeout)}}),Ae=fp.define({combine:e=>({sources:e.map(e=>e.source).filter(e=>null!=e),...fY(e.map(e=>e.config),{delay:750,markerFilter:null,tooltipFilter:null,needsRefresh:null,hideOn:()=>null},{delay:Math.max,markerFilter:At,tooltipFilter:At,needsRefresh:(e,t)=>e?t?n=>e(n)||t(n):e:t,hideOn:(e,t)=>e?t?(n,i,r)=>e(n,i,r)||t(n,i,r):e:t,autoPanel:(e,t)=>e||t})})});function At(e,t){return e?t?(n,i)=>t(e(n,i),i):e:t}function An(e){let t=[];if(e)o:for(let{name:n}of e){for(let e=0;e<n.length;e++){let i=n[e];if(/[a-zA-Z]/.test(i)&&!t.some(e=>e.toLowerCase()==i.toLowerCase())){t.push(i);continue o}}t.push("")}return t}function Ai(e,t,n){var i;let r=n?An(t.actions):[];return pg("li",{class:"cm-diagnostic cm-diagnostic-"+t.severity},pg("span",{class:"cm-diagnosticText"},t.renderMessage?t.renderMessage(e):t.message),null==(i=t.actions)?void 0:i.map((n,i)=>{let o=!1,s=i=>{if(i.preventDefault(),o)return;o=!0;let r=CQ(e.state.field(C3).diagnostics,t);r&&n.apply(e,r.from,r.to)},{name:l}=n,a=r[i]?l.indexOf(r[i]):-1,u=a<0?l:[l.slice(0,a),pg("u",l.slice(a,a+1)),l.slice(a+1)];return pg("button",{type:"button",class:"cm-diagnosticAction"+(n.markClass?" "+n.markClass:""),onclick:s,onmousedown:s,"aria-label":` Action: ${l}${a<0?"":` (access key "${r[i]})"`}.`},u)}),t.source&&pg("div",{class:"cm-diagnosticSource"},t.source))}class Ar extends pP{constructor(e){super(),this.sev=e}eq(e){return e.sev==this.sev}toDOM(){return pg("span",{class:"cm-lintPoint cm-lintPoint-"+this.sev})}}class Ao{constructor(e,t){this.diagnostic=t,this.id="item_"+Math.floor(0xffffffff*Math.random()).toString(16),this.dom=Ai(e,t,!0),this.dom.id=this.id,this.dom.setAttribute("role","option")}}class As{constructor(e){this.view=e,this.items=[];let t=t=>{if(!t.ctrlKey&&!t.altKey&&!t.metaKey){if(27==t.keyCode)C8(this.view),this.view.focus();else if(38==t.keyCode||33==t.keyCode)this.moveSelection((this.selectedIndex-1+this.items.length)%this.items.length);else if(40==t.keyCode||34==t.keyCode)this.moveSelection((this.selectedIndex+1)%this.items.length);else if(36==t.keyCode)this.moveSelection(0);else if(35==t.keyCode)this.moveSelection(this.items.length-1);else if(13==t.keyCode)this.view.focus();else{if(!(t.keyCode>=65)||!(t.keyCode<=90)||!(this.selectedIndex>=0))return;let{diagnostic:n}=this.items[this.selectedIndex],i=An(n.actions);for(let r=0;r<i.length;r++)if(i[r].toUpperCase().charCodeAt(0)==t.keyCode){let t=CQ(this.view.state.field(C3).diagnostics,n);t&&n.actions[r].apply(e,t.from,t.to)}}t.preventDefault()}},n=e=>{for(let t=0;t<this.items.length;t++)this.items[t].dom.contains(e.target)&&this.moveSelection(t)};this.list=pg("ul",{tabIndex:0,role:"listbox","aria-label":this.view.state.phrase("Diagnostics"),onkeydown:t,onclick:n}),this.dom=pg("div",{class:"cm-panel-lint"},this.list,pg("button",{type:"button",name:"close","aria-label":this.view.state.phrase("close"),onclick:()=>C8(this.view)},"\xd7")),this.update()}get selectedIndex(){let e=this.view.state.field(C3).selected;if(!e)return -1;for(let t=0;t<this.items.length;t++)if(this.items[t].diagnostic==e.diagnostic)return t;return -1}update(){let{diagnostics:e,selected:t}=this.view.state.field(C3),n=0,i=!1,r=null,o=new Set;for(e.between(0,this.view.state.doc.length,(e,s,{spec:l})=>{for(let e of l.diagnostics){if(o.has(e))continue;o.add(e);let s=-1,l;for(let t=n;t<this.items.length;t++)if(this.items[t].diagnostic==e){s=t;break}s<0?(l=new Ao(this.view,e),this.items.splice(n,0,l),i=!0):(l=this.items[s],s>n&&(this.items.splice(n,s-n),i=!0)),t&&l.diagnostic==t.diagnostic?l.dom.hasAttribute("aria-selected")||(l.dom.setAttribute("aria-selected","true"),r=l):l.dom.hasAttribute("aria-selected")&&l.dom.removeAttribute("aria-selected"),n++}});n<this.items.length&&!(1==this.items.length&&this.items[0].diagnostic.from<0);)i=!0,this.items.pop();0==this.items.length&&(this.items.push(new Ao(this.view,{from:-1,to:-1,severity:"info",message:this.view.state.phrase("No diagnostics")})),i=!0),r?(this.list.setAttribute("aria-activedescendant",r.id),this.view.requestMeasure({key:this,read:()=>({sel:r.dom.getBoundingClientRect(),panel:this.list.getBoundingClientRect()}),write:({sel:e,panel:t})=>{let n=t.height/this.list.offsetHeight;e.top<t.top?this.list.scrollTop-=(t.top-e.top)/n:e.bottom>t.bottom&&(this.list.scrollTop+=(e.bottom-t.bottom)/n)}})):this.selectedIndex<0&&this.list.removeAttribute("aria-activedescendant"),i&&this.sync()}sync(){let e=this.list.firstChild;function t(){let t=e;e=t.nextSibling,t.remove()}for(let n of this.items)if(n.dom.parentNode==this.list){for(;e!=n.dom;)t();e=n.dom.nextSibling}else this.list.insertBefore(n.dom,e);for(;e;)t()}moveSelection(e){if(this.selectedIndex<0)return;let t=CQ(this.view.state.field(C3).diagnostics,this.items[e].diagnostic);t&&this.view.dispatch({selection:{anchor:t.from,head:t.to},scrollIntoView:!0,effects:C5.of(t)})}static open(e){return new As(e)}}function Al(e,t='viewBox="0 0 40 40"'){return`url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" ${t}>${encodeURIComponent(e)}</svg>')`}function Aa(e){return Al(`<path d="m0 2.5 l2 -1.5 l1 0 l2 1.5 l1 0" stroke="${e}" fill="none" stroke-width=".7"/>`,'width="6" height="3"')}let Au=vT.baseTheme({".cm-diagnostic":{padding:"3px 6px 3px 8px",marginLeft:"-1px",display:"block",whiteSpace:"pre-wrap"},".cm-diagnostic-error":{borderLeft:"5px solid #d11"},".cm-diagnostic-warning":{borderLeft:"5px solid orange"},".cm-diagnostic-info":{borderLeft:"5px solid #999"},".cm-diagnostic-hint":{borderLeft:"5px solid #66d"},".cm-diagnosticAction":{font:"inherit",border:"none",padding:"2px 4px",backgroundColor:"#444",color:"white",borderRadius:"3px",marginLeft:"8px",cursor:"pointer"},".cm-diagnosticSource":{fontSize:"70%",opacity:.7},".cm-lintRange":{backgroundPosition:"left bottom",backgroundRepeat:"repeat-x",paddingBottom:"0.7px"},".cm-lintRange-error":{backgroundImage:Aa("#f11")},".cm-lintRange-warning":{backgroundImage:Aa("orange")},".cm-lintRange-info":{backgroundImage:Aa("#999")},".cm-lintRange-hint":{backgroundImage:Aa("#66d")},".cm-lintRange-active":{backgroundColor:"#ffdd9980"},".cm-tooltip-lint":{padding:0,margin:0},".cm-lintPoint":{position:"relative","&:after":{content:'""',position:"absolute",bottom:0,left:"-2px",borderLeft:"3px solid transparent",borderRight:"3px solid transparent",borderBottom:"4px solid #d11"}},".cm-lintPoint-warning":{"&:after":{borderBottomColor:"orange"}},".cm-lintPoint-info":{"&:after":{borderBottomColor:"#999"}},".cm-lintPoint-hint":{"&:after":{borderBottomColor:"#66d"}},".cm-panel.cm-panel-lint":{position:"relative","& ul":{maxHeight:"100px",overflowY:"auto","& [aria-selected]":{backgroundColor:"#ddd","& u":{textDecoration:"underline"}},"&:focus [aria-selected]":{background_fallback:"#bdf",backgroundColor:"Highlight",color_fallback:"white",color:"HighlightText"},"& u":{textDecoration:"none"},padding:0,margin:0},"& [name=close]":{position:"absolute",top:"0",right:"2px",background:"inherit",border:"none",font:"inherit",padding:0,margin:0}},"&dark .cm-lintRange-active":{backgroundColor:"#86714a80"},"&dark .cm-panel.cm-panel-lint ul":{"& [aria-selected]":{backgroundColor:"#2e343e"}}});function Ac(e){let t="hint",n=1;for(let r of e){var i;let e="error"==(i=r.severity)?4:"warning"==i?3:"info"==i?2:1;e>n&&(n=e,t=r.severity)}return t}class Ah extends bL{constructor(e){super(),this.diagnostics=e,this.severity=Ac(e)}toDOM(e){let t=document.createElement("div");t.className="cm-lint-marker cm-lint-marker-"+this.severity;let n=this.diagnostics,i=e.state.facet(Ax).tooltipFilter;return i&&(n=i(n,e.state)),n.length&&(t.onmouseover=()=>(function(e,t,n){function i(){let i,r=e.elementAtHeight(t.getBoundingClientRect().top+5-e.documentTop);e.coordsAtPos(r.from)&&e.dispatch({effects:Ap.of({pos:r.from,above:!1,clip:!1,create:()=>({dom:C6(e,n),getCoords:()=>t.getBoundingClientRect()})})}),t.onmouseout=t.onmousemove=null,i=n=>{let r=t.getBoundingClientRect();if(!(n.clientX>r.left-10)||!(n.clientX<r.right+10)||!(n.clientY>r.top-10)||!(n.clientY<r.bottom+10)){for(let e=n.target;e;e=e.parentNode)if(1==e.nodeType&&e.classList.contains("cm-tooltip-lint"))return;window.removeEventListener("mousemove",i),e.state.field(Am)&&e.dispatch({effects:Ap.of(null)})}},window.addEventListener("mousemove",i)}let{hoverTime:r}=e.state.facet(Ax),o=setTimeout(i,r);t.onmouseout=()=>{clearTimeout(o),t.onmouseout=t.onmousemove=null},t.onmousemove=()=>{clearTimeout(o),o=setTimeout(i,r)}})(e,t,n)),t}}let Ad=bV({class:"cm-gutter-lint",markers:e=>e.state.field(Af),widgetMarker:(e,t,n)=>{let i=[];return e.state.field(Af).between(n.from,n.to,(e,t,r)=>{e>n.from&&e<n.to&&i.push(...r.diagnostics)}),i.length?new Ah(i):null}}),Af=fy.define({create:()=>f0.empty,update(e,t){e=e.map(t.changes);let n=t.state.facet(Ax).markerFilter;for(let i of t.effects)if(i.is(C1)){let r=i.value;n&&(r=n(r||[],t.state)),e=function(e,t){let n=Object.create(null);for(let i of t){let t=e.lineAt(i.from);(n[t.from]||(n[t.from]=[])).push(i)}let i=[];for(let e in n)i.push(new Ah(n[e]).range(+e));return f0.of(i,!0)}(t.state.doc,r.slice(0))}return e}}),Ap=fV.define(),Am=fy.define({create:()=>null,update:(e,t)=>(e&&t.docChanged&&(e=CJ(t,e)?null:{...e,pos:t.changes.mapPos(e.pos)}),t.effects.reduce((e,t)=>t.is(Ap)?t.value:e,e)),provide:e=>bv.from(e)}),Ag=vT.baseTheme({".cm-gutter-lint":{width:"1.4em","& .cm-gutterElement":{padding:".2em"}},".cm-lint-marker":{width:"1em",height:"1em"},".cm-lint-marker-info":{content:Al('<path fill="#aaf" stroke="#77e" stroke-width="6" stroke-linejoin="round" d="M5 5L35 5L35 35L5 35Z"/>')},".cm-lint-marker-warning":{content:Al('<path fill="#fe8" stroke="#fd7" stroke-width="6" stroke-linejoin="round" d="M20 6L37 35L3 35Z"/>')},".cm-lint-marker-error":{content:Al('<circle cx="20" cy="20" r="15" fill="#f87" stroke="#f43" stroke-width="6"/>')}}),Av=function(e,t={}){let n=fV.define(),i=new WeakMap,r=fy.define({create:()=>[],update(e,o){let s=i.get(e);if(e.length&&(t.hideOnChange&&(o.docChanged||o.selection)||s&&s(o)?e=[]:t.hideOn&&(e=e.filter(e=>!t.hideOn(o,e)))),o.docChanged&&e.length){let t=[];for(let n of e){let e=o.changes.mapPos(n.pos,-1,ft.TrackDel);if(null!=e){let i=Object.assign(Object.create(null),n);i.pos=e,null!=i.end&&(i.end=o.changes.mapPos(i.end)),t.push(i)}}e=t}for(let t of o.effects)t.is(n)&&(e=t.value,s=void 0),(t.is(bA)&&!t.value||t.value==r)&&(e=[]);return e.length&&s&&i.set(e,s),e},provide:e=>bb.from(e)}),o=mO.define(o=>new bS(o,e,r,i,n,t.hoverTime||300));return{active:r,extension:[r,o,bw.of(o),by]}}(function(e,t,n){let{diagnostics:i}=e.state.field(C3),r,o=-1,s=-1;i.between(t-(n<0),t+ +(n>0),(e,i,{spec:l})=>{if(t>=e&&t<=i&&(e==i||(t>e||n>0)&&(t<i||n<0)))return r=l.diagnostics,o=e,s=i,!1});let l=e.state.facet(Ae).tooltipFilter;return(r&&l&&(r=l(r,e.state)),r)?{pos:o,end:s,above:e.state.doc.lineAt(o).to<s,create:()=>({dom:C6(e,r)})}:null},{hideOn:CJ}),Ab=[C3,vT.decorations.compute([C3],e=>{let{selected:t,panel:n}=e.field(C3);return t&&n&&t.from!=t.to?pj.set([C4.range(t.from,t.to)]):pj.none}),Av,Au],Ax=fp.define({combine:e=>fY(e,{hoverTime:300,markerFilter:null,tooltipFilter:null})});var Ay=function(e){let t;void 0===e&&(e={});var{crosshairCursor:n=!1}=e,i=[];!1!==e.closeBracketsKeymap&&(i=i.concat(C$)),!1!==e.defaultKeymap&&(i=i.concat(Ss)),!1!==e.searchKeymap&&(i=i.concat(SQ)),!1!==e.historyKeymap&&(i=i.concat(wb)),!1!==e.foldKeymap&&(i=i.concat(yC)),!1!==e.completionKeymap&&(i=i.concat(CY)),!1!==e.lintKeymap&&(i=i.concat(C9));var r=[];return!1!==e.lineNumbers&&r.push(function(e={}){return[bX.of(e),bz(),bJ]}()),!1!==e.highlightActiveLineGutter&&r.push(b2),!1!==e.highlightSpecialChars&&r.push(function(e={}){return[v9.of(e),v7||(v7=mO.fromClass(class{constructor(e){this.view=e,this.decorations=pj.none,this.decorationCache=Object.create(null),this.decorator=this.makeDecorator(e.state.facet(v9)),this.decorations=this.decorator.createDeco(e)}makeDecorator(e){return new v5({regexp:e.specialChars,decoration:(t,n,i)=>{let{doc:r}=n.state,o=d8(t[0],0);if(9==o){let e=r.lineAt(i),t=n.state.tabSize,o=pn(e.text,t,i-e.from);return pj.replace({widget:new bt((t-o%t)*this.view.defaultCharacterWidth/this.view.scaleX)})}return this.decorationCache[o]||(this.decorationCache[o]=pj.replace({widget:new be(e,o)}))},boundary:e.replaceTabs?void 0:/[^]/})}update(e){let t=e.state.facet(v9);e.startState.facet(v9)!=t?(this.decorator=this.makeDecorator(t),this.decorations=this.decorator.createDeco(e.view)):this.decorations=this.decorator.updateDeco(e,this.decorations)}},{decorations:e=>e.decorations}))]}()),!1!==e.history&&r.push(function(e={}){return[wr,wi.of(e),vT.domEventHandlers({beforeinput(e,t){let n="historyUndo"==e.inputType?ws:"historyRedo"==e.inputType?wl:null;return!!n&&(e.preventDefault(),n(t))}})]}()),!1!==e.foldGutter&&r.push(function(e={}){let t={...yR,...e},n=new yE(t,!0),i=new yE(t,!1),r=mO.fromClass(class{constructor(e){this.from=e.viewport.from,this.markers=this.buildMarkers(e)}update(e){(e.docChanged||e.viewportChanged||e.startState.facet(x9)!=e.state.facet(x9)||e.startState.field(yb,!1)!=e.state.field(yb,!1)||xJ(e.startState)!=xJ(e.state)||t.foldingChanged(e))&&(this.markers=this.buildMarkers(e.view))}buildMarkers(e){let t=new f1;for(let r of e.viewportLineBlocks){let o=yy(e.state,r.from,r.to)?i:yf(e.state,r.from,r.to)?n:null;o&&t.add(r.from,r.from,o)}return t.finish()}}),{domEventHandlers:o}=t;return[r,bV({class:"cm-foldGutter",markers(e){var t;return(null==(t=e.plugin(r))?void 0:t.markers)||f0.empty},initialSpacer:()=>new yE(t,!1),domEventHandlers:{...o,click:(e,t,n)=>{if(o.click&&o.click(e,t,n))return!0;let i=yy(e.state,t.from,t.to);if(i)return e.dispatch({effects:yg.of(i)}),!0;let r=yf(e.state,t.from,t.to);return!!r&&(e.dispatch({effects:ym.of(r)}),!0)}}}),yM()]}()),!1!==e.drawSelection&&r.push(function(e={}){return[vq.of(e),vK,vZ,vQ,mC.of(!0)]}()),!1!==e.dropCursor&&r.push([v0,v1]),!1!==e.allowMultipleSelections&&r.push(fq.allowMultipleSelections.of(!0)),!1!==e.indentOnInput&&r.push(fq.transactionFilter.of(e=>{if(!e.docChanged||!e.isUserEvent("input.type")&&!e.isUserEvent("input.complete"))return e;let t=e.startState.languageDataAt("indentOnInput",e.startState.selection.main.head);if(!t.length)return e;let n=e.newDoc,{head:i}=e.newSelection.main,r=n.lineAt(i);if(i>r.from+200)return e;let o=n.sliceString(r.from,i);if(!t.some(e=>e.test(o)))return e;let{state:s}=e,l=-1,a=[];for(let{head:e}of s.selection.ranges){let t=s.doc.lineAt(e);if(t.from==l)continue;l=t.from;let n=yr(s,t.from);if(null==n)continue;let i=/^\s*/.exec(t.text)[0],r=yi(s,n);i!=r&&a.push({from:t.from,to:t.from+i.length,insert:r})}return a.length?[e,{changes:a,sequential:!0}]:e})),!1!==e.syntaxHighlighting&&r.push(yF(yV,{fallback:!0})),!1!==e.bracketMatching&&r.push(function(e={}){return[yW.of(e),yq]}()),!1!==e.closeBrackets&&r.push([CW,CF]),!1!==e.autocompletion&&r.push(function(e={}){return[CO,CA,Cl.of(e),CR,CK,CP]}()),!1!==e.rectangularSelection&&r.push((t=e=>e.altKey&&0==e.button,vT.mouseSelectionStyle.of((e,n)=>{let i,r;return t(n)?(i=bo(e,n),r=e.state.selection,i?{update(e){if(e.docChanged){let t=e.changes.mapPos(e.startState.doc.line(i.line).from),n=e.state.doc.lineAt(t);i={line:n.number,col:i.col,off:Math.min(i.off,n.length)},r=r.map(e.changes)}},get(t,n,o){let s=bo(e,t);if(!s)return r;let l=function(e,t,n){let i=Math.min(t.line,n.line),r=Math.max(t.line,n.line),o=[];if(t.off>2e3||n.off>2e3||t.col<0||n.col<0){let s=Math.min(t.off,n.off),l=Math.max(t.off,n.off);for(let t=i;t<=r;t++){let n=e.doc.line(t);n.length<=l&&o.push(fh.range(n.from+s,n.to+l))}}else{let s=Math.min(t.col,n.col),l=Math.max(t.col,n.col);for(let t=i;t<=r;t++){let n=e.doc.line(t),i=pi(n.text,s,e.tabSize,!0);if(i<0)o.push(fh.cursor(n.to));else{let t=pi(n.text,l,e.tabSize);o.push(fh.range(n.from+i,n.from+t))}}}return o}(e.state,i,s);return l.length?o?fh.create(l.concat(r.ranges)):fh.create(l):r}}:null):null}))),!1!==n&&r.push(function(e={}){let[t,n]=bs[e.key||"Alt"],i=mO.fromClass(class{constructor(e){this.view=e,this.isDown=!1}set(e){this.isDown!=e&&(this.isDown=e,this.view.update([]))}},{eventObservers:{keydown(e){this.set(e.keyCode==t||n(e))},keyup(e){e.keyCode!=t&&n(e)||this.set(!1)},mousemove(e){this.set(n(e))}}});return[i,vT.contentAttributes.of(e=>{var t;return(null==(t=e.plugin(i))?void 0:t.isDown)?bl:null})]}()),!1!==e.highlightActiveLine&&r.push(bi),!1!==e.highlightSelectionMatches&&r.push([SC,SS]),e.tabSize&&"number"==typeof e.tabSize&&r.push(yt.of(" ".repeat(e.tabSize))),r.concat([vj.of(i.flat())]).filter(Boolean)};let Aw="#e06c75",AS="#abb2bf",AC="#7d8799",AA="#d19a66",Ak="#2c313a",AM="#282c34",AT="#353a42",AD="#528bff",AI=[vT.theme({"&":{color:AS,backgroundColor:AM},".cm-content":{caretColor:AD},".cm-cursor, .cm-dropCursor":{borderLeftColor:AD},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:"#3E4451"},".cm-panels":{backgroundColor:"#21252b",color:AS},".cm-panels.cm-panels-top":{borderBottom:"2px solid black"},".cm-panels.cm-panels-bottom":{borderTop:"2px solid black"},".cm-searchMatch":{backgroundColor:"#72a1ff59",outline:"1px solid #457dff"},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:"#6199ff2f"},".cm-activeLine":{backgroundColor:"#6699ff0b"},".cm-selectionMatch":{backgroundColor:"#aafe661a"},"&.cm-focused .cm-matchingBracket, &.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bad0f847"},".cm-gutters":{backgroundColor:AM,color:AC,border:"none"},".cm-activeLineGutter":{backgroundColor:Ak},".cm-foldPlaceholder":{backgroundColor:"transparent",border:"none",color:"#ddd"},".cm-tooltip":{border:"none",backgroundColor:AT},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:"transparent",borderBottomColor:"transparent"},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:AT,borderBottomColor:AT},".cm-tooltip-autocomplete":{"& > ul > li[aria-selected]":{backgroundColor:Ak,color:AS}}},{dark:!0}),yF(yP.define([{tag:xq.keyword,color:"#c678dd"},{tag:[xq.name,xq.deleted,xq.character,xq.propertyName,xq.macroName],color:Aw},{tag:[xq.function(xq.variableName),xq.labelName],color:"#61afef"},{tag:[xq.color,xq.constant(xq.name),xq.standard(xq.name)],color:AA},{tag:[xq.definition(xq.name),xq.separator],color:AS},{tag:[xq.typeName,xq.className,xq.number,xq.changed,xq.annotation,xq.modifier,xq.self,xq.namespace],color:"#e5c07b"},{tag:[xq.operator,xq.operatorKeyword,xq.url,xq.escape,xq.regexp,xq.link,xq.special(xq.string)],color:"#56b6c2"},{tag:[xq.meta,xq.comment],color:AC},{tag:xq.strong,fontWeight:"bold"},{tag:xq.emphasis,fontStyle:"italic"},{tag:xq.strikethrough,textDecoration:"line-through"},{tag:xq.link,color:AC,textDecoration:"underline"},{tag:xq.heading,fontWeight:"bold",color:Aw},{tag:[xq.atom,xq.bool,xq.special(xq.variableName)],color:AA},{tag:[xq.processingInstruction,xq.string,xq.inserted],color:"#98c379"},{tag:xq.invalid,color:"#ffffff"}]))];var AR=vT.theme({"&":{backgroundColor:"#fff"}},{dark:!1}),AE=function(e){let t;void 0===e&&(e={});var{indentWithTab:n=!0,editable:i=!0,readOnly:r=!1,theme:o="light",placeholder:s="",basicSetup:l=!0}=e,a=[];switch(n&&a.unshift(vj.of([Sl])),l&&("boolean"==typeof l?a.unshift(Ay()):a.unshift(Ay(l))),s&&a.unshift((t=mO.fromClass(class{constructor(e){this.view=e,this.placeholder=s?pj.set([pj.widget({widget:new br(s),side:1}).range(0)]):pj.none}get decorations(){return this.view.state.doc.length?pj.none:this.placeholder}},{decorations:e=>e.decorations}),"string"==typeof s?[t,vT.contentAttributes.of({"aria-placeholder":s})]:t)),o){case"light":a.push(AR);break;case"dark":a.push(AI);break;case"none":break;default:a.push(o)}return!1===i&&a.push(vT.editable.of(!1)),r&&a.push(fq.readOnly.of(!0)),[...a]};class AO{constructor(e,t){this.timeLeftMS=void 0,this.timeoutMS=void 0,this.isCancelled=!1,this.isTimeExhausted=!1,this.callbacks=[],this.timeLeftMS=t,this.timeoutMS=t,this.callbacks.push(e)}tick(){if(!this.isCancelled&&!this.isTimeExhausted&&(this.timeLeftMS--,this.timeLeftMS<=0)){this.isTimeExhausted=!0;var e=this.callbacks.slice();this.callbacks.length=0,e.forEach(e=>{try{e()}catch(e){console.error("TimeoutLatch callback error:",e)}})}}cancel(){this.isCancelled=!0,this.callbacks.length=0}reset(){this.timeLeftMS=this.timeoutMS,this.isCancelled=!1,this.isTimeExhausted=!1}get isDone(){return this.isCancelled||this.isTimeExhausted}}class AP{constructor(){this.interval=null,this.latches=new Set}add(e){this.latches.add(e),this.start()}remove(e){this.latches.delete(e),0===this.latches.size&&this.stop()}start(){null===this.interval&&(this.interval=setInterval(()=>{this.latches.forEach(e=>{e.tick(),e.isDone&&this.remove(e)})},1))}stop(){null!==this.interval&&(clearInterval(this.interval),this.interval=null)}}var AL=null,Aj=fB.define(),AB=[],AF=["className","value","selection","extensions","onChange","onStatistics","onCreateEditor","onUpdate","autoFocus","theme","height","minHeight","maxHeight","width","minWidth","maxWidth","basicSetup","placeholder","indentWithTab","editable","readOnly","root","initialState"],AN=(0,R.forwardRef)((e,t)=>{var{className:n,value:i="",selection:r,extensions:o=[],onChange:s,onStatistics:l,onCreateEditor:a,onUpdate:u,autoFocus:c,theme:h="light",height:d,minHeight:f,maxHeight:p,width:m,minWidth:g,maxWidth:v,basicSetup:b,placeholder:x,indentWithTab:y,editable:w,readOnly:S,root:C,initialState:A}=e,k=(0,dz.A)(e,AF),M=(0,R.useRef)(null),{state:T,view:D,container:E,setContainer:O}=function(e){var{value:t,selection:n,onChange:i,onStatistics:r,onCreateEditor:o,onUpdate:s,extensions:l=AB,autoFocus:a,theme:u="light",height:c=null,minHeight:h=null,maxHeight:d=null,width:f=null,minWidth:p=null,maxWidth:m=null,placeholder:g="",editable:v=!0,readOnly:b=!1,indentWithTab:x=!0,basicSetup:y=!0,root:w,initialState:S}=e,[C,A]=(0,R.useState)(),[k,M]=(0,R.useState)(),[T,D]=(0,R.useState)(),I=(0,R.useState)(()=>({current:null}))[0],E=(0,R.useState)(()=>({current:null}))[0],O=vT.theme({"&":{height:c,minHeight:h,maxHeight:d,width:f,minWidth:p,maxWidth:m},"& .cm-scroller":{height:"100% !important"}}),P=[vT.updateListener.of(e=>{e.docChanged&&"function"==typeof i&&!e.transactions.some(e=>e.annotation(Aj))&&(I.current?I.current.reset():(I.current=new AO(()=>{if(E.current){var e=E.current;E.current=null,e()}I.current=null},200),("u"<typeof window?new AP:(!AL&&(AL=new AP),AL)).add(I.current)),i(e.state.doc.toString(),e)),r&&r({line:e.state.doc.lineAt(e.state.selection.main.from),lineCount:e.state.doc.lines,lineBreak:e.state.lineBreak,length:e.state.doc.length,readOnly:e.state.readOnly,tabSize:e.state.tabSize,selection:e.state.selection,selectionAsSingle:e.state.selection.asSingle().main,ranges:e.state.selection.ranges,selectionCode:e.state.sliceDoc(e.state.selection.main.from,e.state.selection.main.to),selections:e.state.selection.ranges.map(t=>e.state.sliceDoc(t.from,t.to)),selectedText:e.state.selection.ranges.some(e=>!e.empty)})}),O,...AE({theme:u,editable:v,readOnly:b,placeholder:g,indentWithTab:x,basicSetup:y})];return s&&"function"==typeof s&&P.push(vT.updateListener.of(s)),P=P.concat(l),(0,R.useLayoutEffect)(()=>{if(C&&!T){var e={doc:t,selection:n,extensions:P},i=S?fq.fromJSON(S.json,e,S.fields):fq.create(e);if(D(i),!k){var r=new vT({state:i,parent:C,root:w});M(r),o&&o(r,i)}}return()=>{k&&(D(void 0),M(void 0))}},[C,T]),(0,R.useEffect)(()=>{e.container&&A(e.container)},[e.container]),(0,R.useEffect)(()=>()=>{k&&(k.destroy(),M(void 0)),I.current&&(I.current.cancel(),I.current=null)},[k]),(0,R.useEffect)(()=>{a&&k&&k.focus()},[a,k]),(0,R.useEffect)(()=>{k&&k.dispatch({effects:fV.reconfigure.of(P)})},[u,l,c,h,d,f,p,m,g,v,b,x,y,i,s]),(0,R.useEffect)(()=>{if(void 0!==t){var e=k?k.state.doc.toString():"";if(k&&t!==e){var n=I.current&&!I.current.isDone,i=()=>{k&&t!==k.state.doc.toString()&&k.dispatch({changes:{from:0,to:k.state.doc.toString().length,insert:t||""},annotations:[Aj.of(!0)]})};n?E.current=i:i()}}},[t,k]),{state:T,setState:D,view:k,setView:M,container:C,setContainer:A}}({root:C,value:i,autoFocus:c,theme:h,height:d,minHeight:f,maxHeight:p,width:m,minWidth:g,maxWidth:v,basicSetup:b,placeholder:x,indentWithTab:y,editable:w,readOnly:S,selection:r,onChange:s,onStatistics:l,onCreateEditor:a,onUpdate:u,extensions:o,initialState:A});(0,R.useImperativeHandle)(t,()=>({editor:M.current,state:T,view:D}),[M,E,T,D]);var P=(0,R.useCallback)(e=>{M.current=e,O(e)},[O]);if("string"!=typeof i)throw Error("value must be typeof string but got "+typeof i);var L="string"==typeof h?"cm-theme-"+h:"cm-theme";return(0,I.jsx)("div",(0,dH.A)({ref:P,className:""+L+(n?" "+n:"")},k))});AN.displayName="CodeMirror";class AV{constructor(e,t,n,i,r,o,s,l,a,u=0,c){this.p=e,this.stack=t,this.state=n,this.reducePos=i,this.pos=r,this.score=o,this.buffer=s,this.bufferBase=l,this.curContext=a,this.lookAhead=u,this.parent=c}toString(){return`[${this.stack.filter((e,t)=>t%3==0).concat(this.state)}]@${this.pos}${this.score?"!"+this.score:""}`}static start(e,t,n=0){let i=e.parser.context;return new AV(e,[],t,n,n,0,[],0,i?new AH(i,i.start):null,0,null)}get context(){return this.curContext?this.curContext.context:null}pushState(e,t){this.stack.push(this.state,t,this.bufferBase+this.buffer.length),this.state=e}reduce(e){var t;let n=e>>19,i=65535&e,{parser:r}=this.p,o=this.reducePos<this.pos-25&&this.setLookAhead(this.pos),s=r.dynamicPrecedence(i);if(s&&(this.score+=s),0==n){i<r.minRepeatTerm&&this.reducePos<this.pos&&(this.reducePos=this.pos),this.pushState(r.getGoto(this.state,i,!0),this.reducePos),i<r.minRepeatTerm&&this.storeNode(i,this.reducePos,this.reducePos,o?8:4,!0),this.reduceContext(i,this.reducePos);return}let l=this.stack.length-(n-1)*3-(262144&e?6:0),a=l?this.stack[l-2]:this.p.ranges[0].from;i<r.minRepeatTerm&&a==this.reducePos&&this.reducePos<this.pos&&(this.reducePos=this.pos);let u=this.reducePos-a;u>=2e3&&!(null==(t=this.p.parser.nodeSet.types[i])?void 0:t.isAnonymous)&&(a==this.p.lastBigReductionStart?(this.p.bigReductionCount++,this.p.lastBigReductionSize=u):this.p.lastBigReductionSize<u&&(this.p.bigReductionCount=1,this.p.lastBigReductionStart=a,this.p.lastBigReductionSize=u));let c=l?this.stack[l-1]:0,h=this.bufferBase+this.buffer.length-c;if(i<r.minRepeatTerm||131072&e){let e=r.stateFlag(this.state,1)?this.pos:this.reducePos;this.storeNode(i,a,e,h+4,!0)}if(262144&e)this.state=this.stack[l];else{let e=this.stack[l-3];this.state=r.getGoto(e,i,!0)}for(;this.stack.length>l;)this.stack.pop();this.reduceContext(i,a)}storeNode(e,t,n,i=4,r=!1){if(0==e&&(!this.stack.length||this.stack[this.stack.length-1]<this.buffer.length+this.bufferBase)){let e=this.buffer.length;if(e>0&&0==this.buffer[e-4]&&this.buffer[e-1]>-1){if(t==n)return;if(this.buffer[e-2]>=t){this.buffer[e-2]=n;return}}}if(r&&this.pos!=n){let r=this.buffer.length;if(r>0&&(0!=this.buffer[r-4]||this.buffer[r-1]<0)){let e=!1;for(let t=r;t>0&&this.buffer[t-2]>n;t-=4)if(this.buffer[t-1]>=0){e=!0;break}if(e)for(;r>0&&this.buffer[r-2]>n;)this.buffer[r]=this.buffer[r-4],this.buffer[r+1]=this.buffer[r-3],this.buffer[r+2]=this.buffer[r-2],this.buffer[r+3]=this.buffer[r-1],r-=4,i>4&&(i-=4)}this.buffer[r]=e,this.buffer[r+1]=t,this.buffer[r+2]=n,this.buffer[r+3]=i}else this.buffer.push(e,t,n,i)}shift(e,t,n,i){if(131072&e)this.pushState(65535&e,this.pos);else if((262144&e)==0){let{parser:r}=this.p;this.pos=i;let o=r.stateFlag(e,1);!o&&(i>n||t<=r.maxNode)&&(this.reducePos=i),this.pushState(e,o?n:Math.min(n,this.reducePos)),this.shiftContext(t,n),t<=r.maxNode&&this.buffer.push(t,n,i,4)}else this.pos=i,this.shiftContext(t,n),t<=this.p.parser.maxNode&&this.buffer.push(t,n,i,4)}apply(e,t,n,i){65536&e?this.reduce(e):this.shift(e,t,n,i)}useNode(e,t){let n=this.p.reused.length-1;(n<0||this.p.reused[n]!=e)&&(this.p.reused.push(e),n++);let i=this.pos;this.reducePos=this.pos=i+e.length,this.pushState(t,i),this.buffer.push(n,i,this.reducePos,-1),this.curContext&&this.updateContext(this.curContext.tracker.reuse(this.curContext.context,e,this,this.p.stream.reset(this.pos-e.length)))}split(){let e=this,t=e.buffer.length;for(t&&0==e.buffer[t-4]&&(t-=4);t>0&&e.buffer[t-2]>e.reducePos;)t-=4;let n=e.buffer.slice(t),i=e.bufferBase+t;for(;e&&i==e.bufferBase;)e=e.parent;return new AV(this.p,this.stack.slice(),this.state,this.reducePos,this.pos,this.score,n,i,this.curContext,this.lookAhead,e)}recoverByDelete(e,t){let n=e<=this.p.parser.maxNode;n&&this.storeNode(e,this.pos,t,4),this.storeNode(0,this.pos,t,n?8:4),this.pos=this.reducePos=t,this.score-=190}canShift(e){for(let t=new Az(this);;){let n=this.p.parser.stateSlot(t.state,4)||this.p.parser.hasAction(t.state,e);if(0==n)return!1;if((65536&n)==0)return!0;t.reduce(n)}}recoverByInsert(e){if(this.stack.length>=300)return[];let t=this.p.parser.nextStates(this.state);if(t.length>8||this.stack.length>=120){let n=[];for(let i=0,r;i<t.length;i+=2)(r=t[i+1])!=this.state&&this.p.parser.hasAction(r,e)&&n.push(t[i],r);if(this.stack.length<120)for(let e=0;n.length<8&&e<t.length;e+=2){let i=t[e+1];n.some((e,t)=>1&t&&e==i)||n.push(t[e],i)}t=n}let n=[];for(let e=0;e<t.length&&n.length<4;e+=2){let i=t[e+1];if(i==this.state)continue;let r=this.split();r.pushState(i,this.pos),r.storeNode(0,r.pos,r.pos,4,!0),r.shiftContext(t[e],this.pos),r.reducePos=this.pos,r.score-=200,n.push(r)}return n}forceReduce(){let{parser:e}=this.p,t=e.stateSlot(this.state,5);if((65536&t)==0)return!1;if(!e.validAction(this.state,t)){let n=t>>19,i=65535&t,r=this.stack.length-3*n;if(r<0||0>e.getGoto(this.stack[r],i,!1)){let e=this.findForcedReduction();if(null==e)return!1;t=e}this.storeNode(0,this.pos,this.pos,4,!0),this.score-=100}return this.reducePos=this.pos,this.reduce(t),!0}findForcedReduction(){let{parser:e}=this.p,t=[],n=(i,r)=>{if(!t.includes(i))return t.push(i),e.allActions(i,t=>{if(393216&t);else if(65536&t){let n=(t>>19)-r;if(n>1){let i=65535&t,r=this.stack.length-3*n;if(r>=0&&e.getGoto(this.stack[r],i,!1)>=0)return n<<19|65536|i}}else{let e=n(t,r+1);if(null!=e)return e}})};return n(this.state,0)}forceAll(){for(;!this.p.parser.stateFlag(this.state,2);)if(!this.forceReduce()){this.storeNode(0,this.pos,this.pos,4,!0);break}return this}get deadEnd(){if(3!=this.stack.length)return!1;let{parser:e}=this.p;return 65535==e.data[e.stateSlot(this.state,1)]&&!e.stateSlot(this.state,4)}restart(){this.storeNode(0,this.pos,this.pos,4,!0),this.state=this.stack[0],this.stack.length=0}sameState(e){if(this.state!=e.state||this.stack.length!=e.stack.length)return!1;for(let t=0;t<this.stack.length;t+=3)if(this.stack[t]!=e.stack[t])return!1;return!0}get parser(){return this.p.parser}dialectEnabled(e){return this.p.parser.dialect.flags[e]}shiftContext(e,t){this.curContext&&this.updateContext(this.curContext.tracker.shift(this.curContext.context,e,this,this.p.stream.reset(t)))}reduceContext(e,t){this.curContext&&this.updateContext(this.curContext.tracker.reduce(this.curContext.context,e,this,this.p.stream.reset(t)))}emitContext(){let e=this.buffer.length-1;(e<0||-3!=this.buffer[e])&&this.buffer.push(this.curContext.hash,this.pos,this.pos,-3)}emitLookAhead(){let e=this.buffer.length-1;(e<0||-4!=this.buffer[e])&&this.buffer.push(this.lookAhead,this.pos,this.pos,-4)}updateContext(e){if(e!=this.curContext.context){let t=new AH(this.curContext.tracker,e);t.hash!=this.curContext.hash&&this.emitContext(),this.curContext=t}}setLookAhead(e){return!(e<=this.lookAhead)&&(this.emitLookAhead(),this.lookAhead=e,!0)}close(){this.curContext&&this.curContext.tracker.strict&&this.emitContext(),this.lookAhead>0&&this.emitLookAhead()}}class AH{constructor(e,t){this.tracker=e,this.context=t,this.hash=e.strict?e.hash(t):0}}class Az{constructor(e){this.start=e,this.state=e.state,this.stack=e.stack,this.base=this.stack.length}reduce(e){let t=e>>19;0==t?(this.stack==this.start.stack&&(this.stack=this.stack.slice()),this.stack.push(this.state,0,0),this.base+=3):this.base-=(t-1)*3;let n=this.start.p.parser.getGoto(this.stack[this.base-3],65535&e,!0);this.state=n}}class AW{constructor(e,t,n){this.stack=e,this.pos=t,this.index=n,this.buffer=e.buffer,0==this.index&&this.maybeNext()}static create(e,t=e.bufferBase+e.buffer.length){return new AW(e,t,t-e.bufferBase)}maybeNext(){let e=this.stack.parent;null!=e&&(this.index=this.stack.bufferBase-e.bufferBase,this.stack=e,this.buffer=e.buffer)}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}next(){this.index-=4,this.pos-=4,0==this.index&&this.maybeNext()}fork(){return new AW(this.stack,this.pos,this.index)}}function A$(e,t=Uint16Array){if("string"!=typeof e)return e;let n=null;for(let i=0,r=0;i<e.length;){let o=0;for(;;){let t=e.charCodeAt(i++),n=!1;if(126==t){o=65535;break}t>=92&&t--,t>=34&&t--;let r=t-32;if(r>=46&&(r-=46,n=!0),o+=r,n)break;o*=46}n?n[r++]=o:n=new t(o)}return n}class A_{constructor(){this.start=-1,this.value=-1,this.end=-1,this.extended=-1,this.lookAhead=0,this.mask=0,this.context=0}}let AU=new A_;class AG{constructor(e,t){this.input=e,this.ranges=t,this.chunk="",this.chunkOff=0,this.chunk2="",this.chunk2Pos=0,this.next=-1,this.token=AU,this.rangeIndex=0,this.pos=this.chunkPos=t[0].from,this.range=t[0],this.end=t[t.length-1].to,this.readNext()}resolveOffset(e,t){let n=this.range,i=this.rangeIndex,r=this.pos+e;for(;r<n.from;){if(!i)return null;let e=this.ranges[--i];r-=n.from-e.to,n=e}for(;t<0?r>n.to:r>=n.to;){if(i==this.ranges.length-1)return null;let e=this.ranges[++i];r+=e.from-n.to,n=e}return r}clipPos(e){if(e>=this.range.from&&e<this.range.to)return e;for(let t of this.ranges)if(t.to>e)return Math.max(e,t.from);return this.end}peek(e){let t=this.chunkOff+e,n,i;if(t>=0&&t<this.chunk.length)n=this.pos+e,i=this.chunk.charCodeAt(t);else{let t=this.resolveOffset(e,1);if(null==t)return -1;if((n=t)>=this.chunk2Pos&&n<this.chunk2Pos+this.chunk2.length)i=this.chunk2.charCodeAt(n-this.chunk2Pos);else{let e=this.rangeIndex,t=this.range;for(;t.to<=n;)t=this.ranges[++e];this.chunk2=this.input.chunk(this.chunk2Pos=n),n+this.chunk2.length>t.to&&(this.chunk2=this.chunk2.slice(0,t.to-n)),i=this.chunk2.charCodeAt(0)}}return n>=this.token.lookAhead&&(this.token.lookAhead=n+1),i}acceptToken(e,t=0){let n=t?this.resolveOffset(t,-1):this.pos;if(null==n||n<this.token.start)throw RangeError("Token end out of bounds");this.token.value=e,this.token.end=n}acceptTokenTo(e,t){this.token.value=e,this.token.end=t}getChunk(){if(this.pos>=this.chunk2Pos&&this.pos<this.chunk2Pos+this.chunk2.length){let{chunk:e,chunkPos:t}=this;this.chunk=this.chunk2,this.chunkPos=this.chunk2Pos,this.chunk2=e,this.chunk2Pos=t,this.chunkOff=this.pos-this.chunkPos}else{this.chunk2=this.chunk,this.chunk2Pos=this.chunkPos;let e=this.input.chunk(this.pos),t=this.pos+e.length;this.chunk=t>this.range.to?e.slice(0,this.range.to-this.pos):e,this.chunkPos=this.pos,this.chunkOff=0}}readNext(){return this.chunkOff>=this.chunk.length&&(this.getChunk(),this.chunkOff==this.chunk.length)?this.next=-1:this.next=this.chunk.charCodeAt(this.chunkOff)}advance(e=1){for(this.chunkOff+=e;this.pos+e>=this.range.to;){if(this.rangeIndex==this.ranges.length-1)return this.setDone();e-=this.range.to-this.pos,this.range=this.ranges[++this.rangeIndex],this.pos=this.range.from}return this.pos+=e,this.pos>=this.token.lookAhead&&(this.token.lookAhead=this.pos+1),this.readNext()}setDone(){return this.pos=this.chunkPos=this.end,this.range=this.ranges[this.rangeIndex=this.ranges.length-1],this.chunk="",this.next=-1}reset(e,t){if(t?(this.token=t,t.start=e,t.lookAhead=e+1,t.value=t.extended=-1):this.token=AU,this.pos!=e){if(this.pos=e,e==this.end)return this.setDone(),this;for(;e<this.range.from;)this.range=this.ranges[--this.rangeIndex];for(;e>=this.range.to;)this.range=this.ranges[++this.rangeIndex];e>=this.chunkPos&&e<this.chunkPos+this.chunk.length?this.chunkOff=e-this.chunkPos:(this.chunk="",this.chunkOff=0),this.readNext()}return this}read(e,t){if(e>=this.chunkPos&&t<=this.chunkPos+this.chunk.length)return this.chunk.slice(e-this.chunkPos,t-this.chunkPos);if(e>=this.chunk2Pos&&t<=this.chunk2Pos+this.chunk2.length)return this.chunk2.slice(e-this.chunk2Pos,t-this.chunk2Pos);if(e>=this.range.from&&t<=this.range.to)return this.input.read(e,t);let n="";for(let i of this.ranges){if(i.from>=t)break;i.to>e&&(n+=this.input.read(Math.max(i.from,e),Math.min(i.to,t)))}return n}}class Aq{constructor(e,t){this.data=e,this.id=t}token(e,t){let{parser:n}=t.p;AY(this.data,e,t,this.id,n.data,n.tokenPrecTable)}}function AY(e,t,n,i,r,o){let s=0,l=1<<i,{dialect:a}=n.p.parser;i:for(;(l&e[s])!=0;){let n=e[s+1];for(let i=s+3;i<n;i+=2)if((e[i+1]&l)>0){let n=e[i];if(a.allows(n)&&(-1==t.token.value||t.token.value==n||function(e,t,n,i){let r=AK(n,i,t);return r<0||AK(n,i,e)<r}(n,t.token.value,r,o))){t.acceptToken(n);break}}let i=t.next,u=0,c=e[s+2];if(t.next<0&&c>u&&65535==e[n+3*c-3]){s=e[n+3*c-1];continue}for(;u<c;){let r=u+c>>1,o=n+r+(r<<1),l=e[o],a=e[o+1]||65536;if(i<l)c=r;else if(i>=a)u=r+1;else{s=e[o+2],t.advance();continue i}}break}}function AK(e,t,n){for(let i=t,r;65535!=(r=e[i]);i++)if(r==n)return i-t;return -1}Aq.prototype.contextual=Aq.prototype.fallback=Aq.prototype.extend=!1,(class{constructor(e,t,n){this.precTable=t,this.elseToken=n,this.data="string"==typeof e?A$(e):e}token(e,t){let n=e.pos,i=0;for(;;){let n=e.next<0,r=e.resolveOffset(1,1);if(AY(this.data,e,t,0,this.data,this.precTable),e.token.value>-1)break;if(null==this.elseToken)return;if(!n&&i++,null==r)break;e.reset(r,e.token)}i&&(e.reset(n,e.token),e.acceptToken(this.elseToken,i))}}).prototype.contextual=Aq.prototype.fallback=Aq.prototype.extend=!1;let AX="u">typeof process&&process.env&&/\bparse\b/.test(process.env.LOG),AZ=null;function AQ(e,t,n){let i=e.cursor(T.IncludeAnonymous);for(i.moveTo(t);;)if(!(n<0?i.childBefore(t):i.childAfter(t)))for(;;){if((n<0?i.to<t:i.from>t)&&!i.type.isError)return n<0?Math.max(0,Math.min(i.to-1,t-25)):Math.min(e.length,Math.max(i.from+1,t+25));if(n<0?i.prevSibling():i.nextSibling())break;if(!i.parent())return n<0?0:e.length}}class AJ{constructor(e,t){this.fragments=e,this.nodeSet=t,this.i=0,this.fragment=null,this.safeFrom=-1,this.safeTo=-1,this.trees=[],this.start=[],this.index=[],this.nextFragment()}nextFragment(){let e=this.fragment=this.i==this.fragments.length?null:this.fragments[this.i++];if(e){for(this.safeFrom=e.openStart?AQ(e.tree,e.from+e.offset,1)-e.offset:e.from,this.safeTo=e.openEnd?AQ(e.tree,e.to+e.offset,-1)-e.offset:e.to;this.trees.length;)this.trees.pop(),this.start.pop(),this.index.pop();this.trees.push(e.tree),this.start.push(-e.offset),this.index.push(0),this.nextStart=this.safeFrom}else this.nextStart=1e9}nodeAt(e){if(e<this.nextStart)return null;for(;this.fragment&&this.safeTo<=e;)this.nextFragment();if(!this.fragment)return null;for(;;){let t=this.trees.length-1;if(t<0)return this.nextFragment(),null;let n=this.trees[t],i=this.index[t];if(i==n.children.length){this.trees.pop(),this.start.pop(),this.index.pop();continue}let r=n.children[i],o=this.start[t]+n.positions[i];if(o>e)return this.nextStart=o,null;if(r instanceof xn){if(o==e){if(o<this.safeFrom)return null;let e=o+r.length;if(e<=this.safeTo){let t=r.prop(b4.lookAhead);if(!t||e+t<this.fragment.to)return r}}this.index[t]++,o+r.length>=Math.max(this.safeFrom,e)&&(this.trees.push(r),this.start.push(o),this.index.push(0))}else this.index[t]++,this.nextStart=o+r.length}}}class A0{constructor(e,t){this.stream=t,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=e.tokenizers.map(e=>new A_)}getActions(e){let t=0,n=null,{parser:i}=e.p,{tokenizers:r}=i,o=i.stateSlot(e.state,3),s=e.curContext?e.curContext.hash:0,l=0;for(let i=0;i<r.length;i++){if((1<<i&o)==0)continue;let a=r[i],u=this.tokens[i];if((!n||a.fallback)&&((a.contextual||u.start!=e.pos||u.mask!=o||u.context!=s)&&(this.updateCachedToken(u,a,e),u.mask=o,u.context=s),u.lookAhead>u.end+25&&(l=Math.max(u.lookAhead,l)),0!=u.value)){let i=t;if(u.extended>-1&&(t=this.addActions(e,u.extended,u.end,t)),t=this.addActions(e,u.value,u.end,t),!a.extend&&(n=u,t>i))break}}for(;this.actions.length>t;)this.actions.pop();return l&&e.setLookAhead(l),n||e.pos!=this.stream.end||((n=new A_).value=e.p.parser.eofTerm,n.start=n.end=e.pos,t=this.addActions(e,n.value,n.end,t)),this.mainToken=n,this.actions}getMainToken(e){if(this.mainToken)return this.mainToken;let t=new A_,{pos:n,p:i}=e;return t.start=n,t.end=Math.min(n+1,i.stream.end),t.value=n==i.stream.end?i.parser.eofTerm:0,t}updateCachedToken(e,t,n){let i=this.stream.clipPos(n.pos);if(t.token(this.stream.reset(i,e),n),e.value>-1){let{parser:t}=n.p;for(let i=0;i<t.specialized.length;i++)if(t.specialized[i]==e.value){let r=t.specializers[i](this.stream.read(e.start,e.end),n);if(r>=0&&n.p.parser.dialect.allows(r>>1)){(1&r)==0?e.value=r>>1:e.extended=r>>1;break}}}else e.value=0,e.end=this.stream.clipPos(i+1)}putAction(e,t,n,i){for(let t=0;t<i;t+=3)if(this.actions[t]==e)return i;return this.actions[i++]=e,this.actions[i++]=t,this.actions[i++]=n,i}addActions(e,t,n,i){let{state:r}=e,{parser:o}=e.p,{data:s}=o;for(let e=0;e<2;e++)for(let l=o.stateSlot(r,e?2:1);;l+=3){if(65535==s[l])if(1==s[l+1])l=A4(s,l+2);else{0==i&&2==s[l+1]&&(i=this.putAction(A4(s,l+2),t,n,i));break}s[l]==t&&(i=this.putAction(A4(s,l+1),t,n,i))}return i}}class A1{constructor(e,t,n,i){this.parser=e,this.input=t,this.ranges=i,this.recovering=0,this.nextStackID=9812,this.minStackPos=0,this.reused=[],this.stoppedAt=null,this.lastBigReductionStart=-1,this.lastBigReductionSize=0,this.bigReductionCount=0,this.stream=new AG(t,i),this.tokens=new A0(e,this.stream),this.topTerm=e.top[1];let{from:r}=i[0];this.stacks=[AV.start(this,e.top[0],r)],this.fragments=n.length&&this.stream.end-r>4*e.bufferLength?new AJ(n,e.nodeSet):null}get parsedPos(){return this.minStackPos}advance(){let e,t,n=this.stacks,i=this.minStackPos,r=this.stacks=[];if(this.bigReductionCount>300&&1==n.length){let[e]=n;for(;e.forceReduce()&&e.stack.length&&e.stack[e.stack.length-2]>=this.lastBigReductionStart;);this.bigReductionCount=this.lastBigReductionSize=0}for(let o=0;o<n.length;o++){let s=n[o];for(;;){if(this.tokens.mainToken=null,s.pos>i)r.push(s);else{if(this.advanceStack(s,r,n))continue;e||(e=[],t=[]),e.push(s);let i=this.tokens.getMainToken(s);t.push(i.value,i.end)}break}}if(!r.length){let t=e&&function(e){let t=null;for(let n of e){let e=n.p.stoppedAt;(n.pos==n.p.stream.end||null!=e&&n.pos>e)&&n.p.parser.stateFlag(n.state,2)&&(!t||t.score<n.score)&&(t=n)}return t}(e);if(t)return AX&&console.log("Finish with "+this.stackID(t)),this.stackToTree(t);if(this.parser.strict)throw AX&&e&&console.log("Stuck with token "+(this.tokens.mainToken?this.parser.getName(this.tokens.mainToken.value):"none")),SyntaxError("No parse at "+i);this.recovering||(this.recovering=5)}if(this.recovering&&e){let n=null!=this.stoppedAt&&e[0].pos>this.stoppedAt?e[0]:this.runRecovery(e,t,r);if(n)return AX&&console.log("Force-finish "+this.stackID(n)),this.stackToTree(n.forceAll())}if(this.recovering){let e=1==this.recovering?1:3*this.recovering;if(r.length>e)for(r.sort((e,t)=>t.score-e.score);r.length>e;)r.pop();r.some(e=>e.reducePos>i)&&this.recovering--}else if(r.length>1){s:for(let e=0;e<r.length-1;e++){let t=r[e];for(let n=e+1;n<r.length;n++){let i=r[n];if(t.sameState(i)||t.buffer.length>500&&i.buffer.length>500)if((t.score-i.score||t.buffer.length-i.buffer.length)>0)r.splice(n--,1);else{r.splice(e--,1);continue s}}}r.length>12&&(r.sort((e,t)=>t.score-e.score),r.splice(12,r.length-12))}this.minStackPos=r[0].pos;for(let e=1;e<r.length;e++)r[e].pos<this.minStackPos&&(this.minStackPos=r[e].pos);return null}stopAt(e){if(null!=this.stoppedAt&&this.stoppedAt<e)throw RangeError("Can't move stoppedAt forward");this.stoppedAt=e}advanceStack(e,t,n){let i=e.pos,{parser:r}=this,o=AX?this.stackID(e)+" -> ":"";if(null!=this.stoppedAt&&i>this.stoppedAt)return e.forceReduce()?e:null;if(this.fragments){let t=e.curContext&&e.curContext.tracker.strict,n=t?e.curContext.hash:0;for(let s=this.fragments.nodeAt(i);s;){let i=this.parser.nodeSet.types[s.type.id]==s.type?r.getGoto(e.state,s.type.id):-1;if(i>-1&&s.length&&(!t||(s.prop(b4.contextHash)||0)==n))return e.useNode(s,i),AX&&console.log(o+this.stackID(e)+` (via reuse of ${r.getName(s.type.id)})`),!0;if(!(s instanceof xn)||0==s.children.length||s.positions[0]>0)break;let l=s.children[0];if(l instanceof xn&&0==s.positions[0])s=l;else break}}let s=r.stateSlot(e.state,4);if(s>0)return e.reduce(s),AX&&console.log(o+this.stackID(e)+` (via always-reduce ${r.getName(65535&s)})`),!0;if(e.stack.length>=8400)for(;e.stack.length>6e3&&e.forceReduce(););let l=this.tokens.getActions(e);for(let s=0;s<l.length;){let a=l[s++],u=l[s++],c=l[s++],h=s==l.length||!n,d=h?e:e.split(),f=this.tokens.mainToken;if(d.apply(a,u,f?f.start:d.pos,c),AX&&console.log(o+this.stackID(d)+` (via ${(65536&a)==0?"shift":`reduce of ${r.getName(65535&a)}`} for ${r.getName(u)} @ ${i}${d==e?"":", split"})`),h)return!0;d.pos>i?t.push(d):n.push(d)}return!1}advanceFully(e,t){let n=e.pos;for(;;){if(!this.advanceStack(e,null,null))return!1;if(e.pos>n)return A2(e,t),!0}}runRecovery(e,t,n){let i=null,r=!1;for(let o=0;o<e.length;o++){let s=e[o],l=t[o<<1],a=t[(o<<1)+1],u=AX?this.stackID(s)+" -> ":"";if(s.deadEnd&&(r||(r=!0,s.restart(),AX&&console.log(u+this.stackID(s)+" (restarted)"),this.advanceFully(s,n))))continue;let c=s.split(),h=u;for(let e=0;e<10&&c.forceReduce()&&(AX&&console.log(h+this.stackID(c)+" (via force-reduce)"),!this.advanceFully(c,n));e++)AX&&(h=this.stackID(c)+" -> ");for(let e of s.recoverByInsert(l))AX&&console.log(u+this.stackID(e)+" (via recover-insert)"),this.advanceFully(e,n);this.stream.end>s.pos?(a==s.pos&&(a++,l=0),s.recoverByDelete(l,a),AX&&console.log(u+this.stackID(s)+` (via recover-delete ${this.parser.getName(l)})`),A2(s,n)):(!i||i.score<c.score)&&(i=c)}return i}stackToTree(e){return e.close(),xn.build({buffer:AW.create(e),nodeSet:this.parser.nodeSet,topID:this.topTerm,maxBufferLength:this.parser.bufferLength,reused:this.reused,start:this.ranges[0].from,length:e.pos-this.ranges[0].from,minRepeatType:this.parser.minRepeatTerm})}stackID(e){let t=(AZ||(AZ=new WeakMap)).get(e);return t||AZ.set(e,t=String.fromCodePoint(this.nextStackID++)),t+e}}function A2(e,t){for(let n=0;n<t.length;n++){let i=t[n];if(i.pos==e.pos&&i.sameState(e)){t[n].score<e.score&&(t[n]=e);return}}t.push(e)}class A5{constructor(e,t,n){this.source=e,this.flags=t,this.disabled=n}allows(e){return!this.disabled||0==this.disabled[e]}}class A3 extends xw{constructor(e){if(super(),this.wrappers=[],14!=e.version)throw RangeError(`Parser version (${e.version}) doesn't match runtime version (14)`);let t=e.nodeNames.split(" ");this.minRepeatTerm=t.length;for(let n=0;n<e.repeatNodeCount;n++)t.push("");let n=Object.keys(e.topRules).map(t=>e.topRules[t][1]),i=[];for(let e=0;e<t.length;e++)i.push([]);function r(e,t,n){i[e].push([t,t.deserialize(String(n))])}if(e.nodeProps)for(let t of e.nodeProps){let e=t[0];"string"==typeof e&&(e=b4[e]);for(let n=1;n<t.length;){let i=t[n++];if(i>=0)r(i,e,t[n++]);else{let o=t[n+-i];for(let s=-i;s>0;s--)r(t[n++],e,o);n++}}}this.nodeSet=new b7(t.map((t,r)=>b9.define({name:r>=this.minRepeatTerm?void 0:t,id:r,props:i[r],top:n.indexOf(r)>-1,error:0==r,skipped:e.skippedNodes&&e.skippedNodes.indexOf(r)>-1}))),e.propSources&&(this.nodeSet=this.nodeSet.extend(...e.propSources)),this.strict=!1,this.bufferLength=1024;let o=A$(e.tokenData);this.context=e.context,this.specializerSpecs=e.specialized||[],this.specialized=new Uint16Array(this.specializerSpecs.length);for(let e=0;e<this.specializerSpecs.length;e++)this.specialized[e]=this.specializerSpecs[e].term;this.specializers=this.specializerSpecs.map(A6),this.states=A$(e.states,Uint32Array),this.data=A$(e.stateData),this.goto=A$(e.goto),this.maxTerm=e.maxTerm,this.tokenizers=e.tokenizers.map(e=>"number"==typeof e?new Aq(o,e):e),this.topRules=e.topRules,this.dialects=e.dialects||{},this.dynamicPrecedences=e.dynamicPrecedences||null,this.tokenPrecTable=e.tokenPrec,this.termNames=e.termNames||null,this.maxNode=this.nodeSet.types.length-1,this.dialect=this.parseDialect(),this.top=this.topRules[Object.keys(this.topRules)[0]]}createParse(e,t,n){let i=new A1(this,e,t,n);for(let r of this.wrappers)i=r(i,e,t,n);return i}getGoto(e,t,n=!1){let i=this.goto;if(t>=i[0])return -1;for(let r=i[t+1];;){let t=i[r++],o=1&t,s=i[r++];if(o&&n)return s;for(let n=r+(t>>1);r<n;r++)if(i[r]==e)return s;if(o)return -1}}hasAction(e,t){let n=this.data;for(let i=0;i<2;i++)for(let r=this.stateSlot(e,i?2:1),o;;r+=3){if(65535==(o=n[r]))if(1==n[r+1])o=n[r=A4(n,r+2)];else if(2==n[r+1])return A4(n,r+2);else break;if(o==t||0==o)return A4(n,r+1)}return 0}stateSlot(e,t){return this.states[6*e+t]}stateFlag(e,t){return(this.stateSlot(e,0)&t)>0}validAction(e,t){return!!this.allActions(e,e=>e==t||null)}allActions(e,t){let n=this.stateSlot(e,4),i=n?t(n):void 0;for(let n=this.stateSlot(e,1);null==i;n+=3){if(65535==this.data[n])if(1==this.data[n+1])n=A4(this.data,n+2);else break;i=t(A4(this.data,n+1))}return i}nextStates(e){let t=[];for(let n=this.stateSlot(e,1);;n+=3){if(65535==this.data[n])if(1==this.data[n+1])n=A4(this.data,n+2);else break;if((1&this.data[n+2])==0){let e=this.data[n+1];t.some((t,n)=>1&n&&t==e)||t.push(this.data[n],e)}}return t}configure(e){let t=Object.assign(Object.create(A3.prototype),this);if(e.props&&(t.nodeSet=this.nodeSet.extend(...e.props)),e.top){let n=this.topRules[e.top];if(!n)throw RangeError(`Invalid top rule name ${e.top}`);t.top=n}return e.tokenizers&&(t.tokenizers=this.tokenizers.map(t=>{let n=e.tokenizers.find(e=>e.from==t);return n?n.to:t})),e.specializers&&(t.specializers=this.specializers.slice(),t.specializerSpecs=this.specializerSpecs.map((n,i)=>{let r=e.specializers.find(e=>e.from==n.external);if(!r)return n;let o=Object.assign(Object.assign({},n),{external:r.to});return t.specializers[i]=A6(o),o})),e.contextTracker&&(t.context=e.contextTracker),e.dialect&&(t.dialect=this.parseDialect(e.dialect)),null!=e.strict&&(t.strict=e.strict),e.wrap&&(t.wrappers=t.wrappers.concat(e.wrap)),null!=e.bufferLength&&(t.bufferLength=e.bufferLength),t}hasWrappers(){return this.wrappers.length>0}getName(e){return this.termNames?this.termNames[e]:String(e<=this.maxNode&&this.nodeSet.types[e].name||e)}get eofTerm(){return this.maxNode+1}get topNode(){return this.nodeSet.types[this.top[1]]}dynamicPrecedence(e){let t=this.dynamicPrecedences;return null==t?0:t[e]||0}parseDialect(e){let t=Object.keys(this.dialects),n=t.map(()=>!1);if(e)for(let i of e.split(" ")){let e=t.indexOf(i);e>=0&&(n[e]=!0)}let i=null;for(let e=0;e<t.length;e++)if(!n[e])for(let n=this.dialects[t[e]],r;65535!=(r=this.data[n++]);)(i||(i=new Uint8Array(this.maxTerm+1)))[r]=1;return new A5(e,n,i)}static deserialize(e){return new A3(e)}}function A4(e,t){return e[t]|e[t+1]<<16}function A6(e){if(e.external){let t=+!!e.extend;return(n,i)=>e.external(n,i)<<1|t}return e.get}let A8=xT({String:xq.string,Number:xq.number,"True False":xq.bool,PropertyName:xq.propertyName,Null:xq.null,", :":xq.separator,"[ ]":xq.squareBracket,"{ }":xq.brace}),A9=A3.deserialize({version:14,states:"$bOVQPOOOOQO'#Cb'#CbOnQPO'#CeOvQPO'#ClOOQO'#Cr'#CrQOQPOOOOQO'#Cg'#CgO}QPO'#CfO!SQPO'#CtOOQO,59P,59PO![QPO,59PO!aQPO'#CuOOQO,59W,59WO!iQPO,59WOVQPO,59QOqQPO'#CmO!nQPO,59`OOQO1G.k1G.kOVQPO'#CnO!vQPO,59aOOQO1G.r1G.rOOQO1G.l1G.lOOQO,59X,59XOOQO-E6k-E6kOOQO,59Y,59YOOQO-E6l-E6l",stateData:"#O~OeOS~OQSORSOSSOTSOWQO_ROgPO~OVXOgUO~O^[O~PVO[^O~O]_OVhX~OVaO~O]bO^iX~O^dO~O]_OVha~O]bO^ia~O",goto:"!kjPPPPPPkPPkqwPPPPk{!RPPP!XP!e!hXSOR^bQWQRf_TVQ_Q`WRg`QcZRicQTOQZRQe^RhbRYQR]R",nodeNames:"⚠ JsonText True False Null Number String } { Object Property PropertyName : , ] [ Array",maxTerm:25,nodeProps:[["isolate",-2,6,11,""],["openedBy",7,"{",14,"["],["closedBy",8,"}",15,"]"]],propSources:[A8],skippedNodes:[0],repeatNodeCount:2,tokenData:"(|~RaXY!WYZ!W]^!Wpq!Wrs!]|}$u}!O$z!Q!R%T!R![&c![!]&t!}#O&y#P#Q'O#Y#Z'T#b#c'r#h#i(Z#o#p(r#q#r(w~!]Oe~~!`Wpq!]qr!]rs!xs#O!]#O#P!}#P;'S!];'S;=`$o<%lO!]~!}Og~~#QXrs!]!P!Q!]#O#P!]#U#V!]#Y#Z!]#b#c!]#f#g!]#h#i!]#i#j#m~#pR!Q![#y!c!i#y#T#Z#y~#|R!Q![$V!c!i$V#T#Z$V~$YR!Q![$c!c!i$c#T#Z$c~$fR!Q![!]!c!i!]#T#Z!]~$rP;=`<%l!]~$zO]~~$}Q!Q!R%T!R![&c~%YRT~!O!P%c!g!h%w#X#Y%w~%fP!Q![%i~%nRT~!Q![%i!g!h%w#X#Y%w~%zR{|&T}!O&T!Q![&Z~&WP!Q![&Z~&`PT~!Q![&Z~&hST~!O!P%c!Q![&c!g!h%w#X#Y%w~&yO[~~'OO_~~'TO^~~'WP#T#U'Z~'^P#`#a'a~'dP#g#h'g~'jP#X#Y'm~'rOR~~'uP#i#j'x~'{P#`#a(O~(RP#`#a(U~(ZOS~~(^P#f#g(a~(dP#i#j(g~(jP#X#Y(m~(rOQ~~(wOW~~(|OV~",tokenizers:[0],topRules:{JsonText:[0,1]},tokenPrec:0}),A7=xQ.define({name:"json",parser:A9.configure({props:[ys.add({Object:yc({except:/^\s*\}/}),Array:yc({except:/^\s*\]/})}),yd.add({"Object Array":function(e){let t=e.firstChild,n=e.lastChild;return t&&t.to<n.from?{from:t.to,to:n.type.isError?e.to:n.from}:null}})]}),languageData:{closeBrackets:{brackets:["[","{",'"']},indentOnInput:/^\s*[\}\]]$/}});function ke(e){let t=(0,r7.A)(),n="dark"===t.palette.mode,[i,r]=(0,R.useState)(()=>JSON.stringify(e.value,null,2)),[o,s]=(0,R.useState)(i);return(0,I.jsx)(AN,{...e,style:{border:`1px solid ${t.palette.divider}`},theme:n?"dark":"light",extensions:[new x7(A7),function(e,t={}){return[Ae.of({source:e,config:t}),C7,Ab]}(e=>{try{JSON.parse(e.state.doc.toString())}catch(r){var t;let n;if(!(r instanceof SyntaxError))throw r;let i=(t=e.state.doc,(n=r.message.match(/at position (\d+)/))?Math.min(+n[1],t.length):(n=r.message.match(/at line (\d+) column (\d+)/))?Math.min(t.line(+n[1]).from+ +n[2]-1,t.length):0);return[{from:i,message:r.message,severity:"error",to:i}]}return[]}),function(e={}){return[Ax.of(e),Af,Ad,Ag,Am]}()],value:i,onChange:t=>{r(t),e.onChange&&e.onChange(t)},onBlur:()=>{o!==i&&void 0!==e.onChange&&(e.onChange(i),s(i))},placeholder:e.placeholder})}var kt=n(79215),kn=n(86742),ki=n(42524),kr=n(10740);let ko=e=>{let{mode:t,url:n,name:i,newTabOpen:r,renderVariables:o,tooltip:s}=e;return(0,I.jsxs)(Z.A,{direction:"column",gap:2,flexGrow:1,children:[(0,I.jsx)(uX,{label:n.label,error:n.error?.hasError,helperText:n.error?.helperText,onChange:n.onChange,placeholder:n.placeholder,multiline:!0,maxRows:5,required:!0,fullWidth:!0,value:n.value}),(i||s)&&(0,I.jsxs)(Z.A,{gap:1,direction:"inline"===t?"row":"column",children:[i&&(0,I.jsx)(uX,{sx:{flexGrow:"1"},label:i.label,onChange:i?.onChange,placeholder:i?.placeholder,value:i?.value}),s&&(0,I.jsx)(uX,{sx:{flexGrow:"1"},label:s.label,onChange:s?.onChange,placeholder:s?.placeholder,value:s?.value})]}),(0,I.jsxs)(Z.A,{direction:"row",gap:1,children:[o&&(0,I.jsx)(kr.A,{label:o.label,control:(0,I.jsx)(ui.A,{checked:o.value,onChange:e=>{o?.onChange(e.target.checked)}})}),(0,I.jsx)(kr.A,{label:r.label,control:(0,I.jsx)(ui.A,{checked:r.value,onChange:e=>{r?.onChange(e.target.checked)}})})]})]})};function ks({control:e,...t}){let{fields:n,append:i,remove:r}=(0,kt.useFieldArray)({control:e,name:"panelDefinition.spec.links"});return(0,I.jsxs)(Z.A,{...t,gap:3,children:[n&&n.length>0?n.map((t,n)=>(0,I.jsxs)(R.Fragment,{children:[(0,I.jsxs)(Z.A,{direction:"row",gap:1,alignItems:"center",children:[(0,I.jsx)(kl,{control:e,index:n}),(0,I.jsx)(Q.A,{style:{width:"fit-content",height:"fit-content"},onClick:()=>r(n),children:(0,I.jsx)(ki.default,{})})]}),(0,I.jsx)(ci.A,{})]},t.id)):(0,I.jsx)(uL.A,{variant:"subtitle1",mb:2,fontStyle:"italic",children:"No links defined"}),(0,I.jsx)(Q.A,{style:{width:"fit-content",height:"fit-content"},onClick:()=>i({url:"",name:"",tooltip:"",renderVariables:!1,targetBlank:!1}),children:(0,I.jsx)(kn.default,{})})]})}function kl({control:e,index:t}){let n={url:"",name:"",tooltip:"",renderVariables:!1,targetBlank:!1};return(0,I.jsx)(kt.Controller,{control:e,name:`panelDefinition.spec.links.${t}`,render:({field:e,field:{value:t},fieldState:i})=>{let r=t??n;return(0,I.jsx)(ko,{mode:"inline",url:{value:r.url,label:"URL",error:{hasError:!!i.error,helperText:i.error?.message},onChange:n=>{e.onChange({...t,url:n})}},newTabOpen:{value:!!r.targetBlank,onChange:n=>{e.onChange({...t,targetBlank:n})},label:"Open in new tab"},name:{value:r.name??"",label:"Name",onChange:n=>{e.onChange({...t,name:n})}},renderVariables:{value:!!r.renderVariables,label:"Render variables",onChange:n=>{e.onChange({...t,renderVariables:n})}},tooltip:{value:r.tooltip??"",label:"Tooltip",onChange:n=>{e.onChange({...t,tooltip:n})}}})}})}let ka=[{id:"value",label:"Value"},{id:"percentage",label:"Percentage"}];function ku({disablePercentageMode:e,onChange:t,value:n="value"}){return(0,I.jsx)(cX,{label:"Mode",control:(0,I.jsx)(c1,{value:ka.find(e=>e.id===n),options:ka,getOptionLabel:e=>e.label,getOptionDisabled:t=>"percentage"===t.id&&e,onChange:(e,{id:n})=>{t(n)},disableClearable:!0})})}var kc=n(33313);function kh(e){let{message:t}=e;return(0,I.jsx)(Z.A,{sx:{height:"100%",alignItems:"center",justifyContent:"center"},children:(0,I.jsx)(uL.A,{children:t})})}function kd(e){let{resource:t}=e;return(0,I.jsx)(kh,{message:`No ${t}`})}function kf(e){let{variant:t="rounded"}=e;return(0,I.jsx)(Z.A,{sx:{height:"100%",alignItems:"center",justifyContent:"center",px:1},children:(0,I.jsx)(kc.A,{variant:t,width:"100%",height:"30%","aria-label":"Loading..."})})}let kp=[{id:"asc",label:"Ascending"},{id:"desc",label:"Descending"}];function km({onChange:e,value:t="desc"}){return(0,I.jsx)(cX,{label:"Sort",control:(0,I.jsx)(c1,{value:kp.find(e=>e.id===t),options:kp,getOptionLabel:e=>e.label,onChange:(t,{id:n})=>{e(n)},disableClearable:!0})})}function kg({onChange:e,value:t,...n}){let i=t=>{e(t)};return(0,I.jsxs)(Y,{"aria-label":"Sort",...n,children:[(0,I.jsx)(K.A,{onClick:()=>i(void 0),variant:void 0===t?"contained":"outlined",children:"None"}),(0,I.jsx)(K.A,{onClick:()=>i("asc"),variant:"asc"===t?"contained":"outlined",children:"Asc"}),(0,I.jsx)(K.A,{onClick:()=>i("desc"),variant:"desc"===t?"contained":"outlined",children:"Desc"})]})}var kv=n(61375),kb=n(31729);let kx=(0,n(68335).A)();var ky=n(86067);function kw({inputRef:e,label:t,color:n,value:i,mode:r,onChange:o,onColorChange:s,onBlur:l,onDelete:a}){let[u,c]=(0,R.useState)(0);return(0,I.jsxs)(Z.A,{flex:1,direction:"row",alignItems:"center",justifyContent:"space-between",spacing:1,children:[(0,I.jsx)(r8,{label:t,color:n,onColorChange:s}),(0,I.jsx)(c_.A,{htmlFor:t,children:t}),(0,I.jsx)(J.A,{id:t,inputRef:e,type:"number",value:0===i?"":i,placeholder:"0",onChange:o,onBlur:l,onKeyDown:e=>{"Enter"===e.key&&(l(),c(u+1))},InputProps:{endAdornment:"percent"===r?(0,I.jsx)(oe.A,{paddingX:1,children:"%"}):void 0}},u),(0,I.jsx)(Q.A,{"aria-label":`delete threshold ${t}`,size:"small",onClick:a,children:(0,I.jsx)(ky.default,{})})]})}function kS({thresholds:e,onChange:t,hideDefault:n,disablePercentMode:i}){let{thresholds:{defaultColor:r,palette:o}}=eF(),s=e?.defaultColor??r,l=e?.steps,a=(0,R.useRef)(null),u=(0,R.useRef)(!1);(0,R.useEffect)(()=>{a.current&&u.current&&(a.current?.focus(),u.current=!1)},[l?.length]);let c=()=>{if(void 0!==l){let n=[...l];n.sort((e,t)=>e.value-t.value),void 0!==e&&t((0,ot.jM)(e,e=>{e.steps=n}))}};return(0,I.jsxs)(cQ,{title:"Thresholds",icon:(0,I.jsx)(cq,{description:"Add threshold",children:(0,I.jsx)(Q.A,{size:"small","aria-label":"add threshold",onClick:()=>{u.current=!0,void 0===e?t({steps:[{value:10}]}):e&&void 0===e.steps?t((0,ot.jM)(e,e=>{e.steps=[{value:10}]})):t((0,ot.jM)(e,e=>{let t=e.steps;if(t?.length){let e=t[t.length-1],n=o[t.length]??kC();t.push({color:n,value:(e?.value??0)+10})}else t&&t.push({value:10})}))},children:(0,I.jsx)(kn.default,{})})}),children:[(0,I.jsx)(cX,{label:"Mode",description:"Percentage means thresholds relative to min & max",control:(0,I.jsxs)(kv.A,{exclusive:!0,disabled:i,value:e?.mode??"absolute",onChange:(n,i)=>{let r="percent"===i?"percent":void 0;void 0!==e?t((0,ot.jM)(e,e=>{e.mode=r})):t({mode:r})},sx:{height:"36px",marginLeft:"auto"},children:[(0,I.jsx)(kb.A,{"aria-label":"absolute",value:"absolute",sx:{fontWeight:500},children:"Absolute"}),(0,I.jsx)(kb.A,{"aria-label":"percent",value:"percent",sx:{fontWeight:500},children:"Percent"})]})}),l&&l.map((n,i)=>(0,I.jsx)(kw,{inputRef:i===l.length-1?a:void 0,label:`T${i+1}`,color:n.color??o[i]??s,value:n.value,mode:e?.mode,onColorChange:n=>{void 0!==e&&t((0,ot.jM)(e,e=>{if(void 0!==e.steps){let t=e.steps[i];t&&(t.color=n)}}))},onChange:n=>{void 0!==e&&t((0,ot.jM)(e,e=>{let t=e.steps?.[i];t&&(t.value=Number(n.target.value))}))},onDelete:()=>{void 0!==e&&t((0,ot.jM)(e,e=>{e.steps&&e.steps.splice(i,1)}))},onBlur:c},i)).reverse(),!n&&(0,I.jsxs)(kx,{flex:1,direction:"row",alignItems:"center",spacing:1,children:[(0,I.jsx)(r8,{label:"default",color:s,onColorChange:n=>{void 0!==e?t((0,ot.jM)(e,e=>{e.defaultColor=n})):t({defaultColor:n})}}),(0,I.jsx)(uL.A,{children:"Default"})]})]})}let kC=()=>"#"+Math.floor(0x1000000*Math.random()).toString(16).padStart(6,"0");var kA=n(24300),kk=n(26684),kM=n(51327),kT=n(87169),kD=n(93724);function kI({props:e,name:t}){return(0,kM.A)({props:e,name:t,defaultTheme:kT.A,themeId:kD.A})}let kR=["localeText"],kE=R.createContext(null),kO=function(e){let{localeText:t}=e,n=(0,dz.A)(e,kR),{utils:i,localeText:r}=R.useContext(kE)??{utils:void 0,localeText:void 0},{children:o,dateAdapter:s,dateFormats:l,dateLibInstance:a,adapterLocale:u,localeText:c}=kI({props:n,name:"MuiLocalizationProvider"}),h=R.useMemo(()=>(0,dH.A)({},c,r,t),[c,r,t]),d=R.useMemo(()=>{if(!s)return i||null;let e=new s({locale:u,formats:l,instance:a});if(!e.isMUIAdapter)throw 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(`
|
|
6
|
+
`));return e},[s,u,l,a,i]),f=R.useMemo(()=>d?{minDate:d.date("1900-01-01T00:00:00.000"),maxDate:d.date("2099-12-31T00:00:00.000")}:null,[d]),p=R.useMemo(()=>({utils:d,defaultDates:f,localeText:h}),[f,d,h]);return(0,I.jsx)(kE.Provider,{value:p,children:o})};var kP=n(62688),kL=n.n(kP);let kj={previousMonth:"Previous month",nextMonth:"Next month",openPreviousView:"Open previous view",openNextView:"Open next view",calendarViewSwitchingButtonAriaLabel:e=>"year"===e?"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,i)=>`Select ${e}. ${!i&&(null===t||!n.isValid(t))?"No time selected":`Selected time is ${i??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||null!==e&&t.isValid(e)?`Choose date, selected date is ${n??t.format(e,"fullDate")}`:"Choose date",openTimePickerDialogue:(e,t,n)=>n||null!==e&&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=>"letter"===e.contentType?"MMMM":"MM",fieldDayPlaceholder:()=>"DD",fieldWeekDayPlaceholder:e=>"letter"===e.contentType?"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"};(0,dH.A)({},kj);let kB=()=>{let e=R.useContext(kE);if(null===e)throw Error("MUI X: Can not find the date and time pickers localization context.\nIt looks like you forgot to wrap your component in LocalizationProvider.\nThis can also happen if you are bundling multiple versions of the `@mui/x-date-pickers` package");if(null===e.utils)throw Error("MUI X: Can not find the date and time pickers adapter from its localization context.\nIt looks like you forgot to pass a `dateAdapter` to your LocalizationProvider.");let t=R.useMemo(()=>(0,dH.A)({},kj,e.localeText),[e.localeText]);return R.useMemo(()=>(0,dH.A)({},e,{localeText:t}),[e,t])},kF=e=>{let t=kB().utils,n=R.useRef(void 0);return void 0===n.current&&(n.current=t.date(void 0,e)),n.current},kN=(e,t,n)=>{let i=t;return i=e.setHours(i,e.getHours(n)),i=e.setMinutes(i,e.getMinutes(n)),i=e.setSeconds(i,e.getSeconds(n)),i=e.setMilliseconds(i,e.getMilliseconds(n))},kV=({date:e,disableFuture:t,disablePast:n,maxDate:i,minDate:r,isDateDisabled:o,utils:s,timezone:l})=>{let a=kN(s,s.date(void 0,l),e);n&&s.isBefore(r,a)&&(r=a),t&&s.isAfter(i,a)&&(i=a);let u=e,c=e;for(s.isBefore(e,r)&&(u=r,c=null),s.isAfter(e,i)&&(c&&(c=i),u=null);u||c;){if(u&&s.isAfter(u,i)&&(u=null),c&&s.isBefore(c,r)&&(c=null),u){if(!o(u))return u;u=s.addDays(u,1)}if(c){if(!o(c))return c;c=s.addDays(c,-1)}}return null},kH=(e,t,n)=>null!=t&&e.isValid(t)?t:n,kz=(e,t)=>{let n=[e.startOfYear(t)];for(;n.length<12;){let t=n[n.length-1];n.push(e.addMonths(t,1))}return n},kW=(e,t,n)=>"date"===n?e.startOfDay(e.date(void 0,t)):e.date(void 0,t),k$=(e,t)=>{let n=e.setHours(e.date(),"am"===t?2:14);return e.format(n,"meridiem")},k_=["year","month","day"],kU=e=>k_.includes(e);var kG=n(33868),kq=n(87034),kY=n(22857);let kK=(0,ug.A)((0,I.jsx)("path",{d:"M7 10l5 5 5-5z"}),"ArrowDropDown"),kX=(0,ug.A)((0,I.jsx)("path",{d:"M15.41 16.59L10.83 12l4.58-4.59L14 6l-6 6 6 6 1.41-1.41z"}),"ArrowLeft"),kZ=(0,ug.A)((0,I.jsx)("path",{d:"M8.59 16.59L13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.41z"}),"ArrowRight");(0,ug.A)((0,I.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"}),"Calendar"),(0,ug.A)((0,I.jsxs)(R.Fragment,{children:[(0,I.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"}),(0,I.jsx)("path",{d:"M12.5 7H11v6l5.25 3.15.75-1.23-4.5-2.67z"})]}),"Clock");let kQ=(0,ug.A)((0,I.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"}),"DateRange"),kJ=(0,ug.A)((0,I.jsxs)(R.Fragment,{children:[(0,I.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"}),(0,I.jsx)("path",{d:"M12.5 7H11v6l5.25 3.15.75-1.23-4.5-2.67z"})]}),"Time"),k0=(0,ug.A)((0,I.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"}),"Clear");function k1(e){return(0,W.Ay)("MuiDateTimePickerTabs",e)}(0,z.A)("MuiDateTimePickerTabs",["root"]);let k2=(0,F.A)(kq.A,{name:"MuiDateTimePickerTabs",slot:"Root",overridesResolver:(e,t)=>t.root})(({theme:e})=>({boxShadow:`0 -1px 0 0 inset ${(e.vars||e).palette.divider}`,"&:last-child":{boxShadow:`0 1px 0 0 inset ${(e.vars||e).palette.divider}`,[`& .${kY.A.indicator}`]:{bottom:"auto",top:0}}})),k5=function(e){let t=kI({props:e,name:"MuiDateTimePickerTabs"}),{dateIcon:n=(0,I.jsx)(kQ,{}),onViewChange:i,timeIcon:r=(0,I.jsx)(kJ,{}),view:o,hidden:s="u"<typeof window||window.innerHeight<667,className:l,sx:a}=t,u=kB().localeText,c=(e=>{let{classes:t}=e;return(0,P.A)({root:["root"]},k1,t)})(t);return s?null:(0,I.jsxs)(k2,{ownerState:t,variant:"fullWidth",value:kU(o)?"date":"time",onChange:(e,t)=>{i("date"===t?"day":"hours")},className:(0,O.A)(l,c.root),sx:a,children:[(0,I.jsx)(kG.A,{value:"date","aria-label":u.dateTableLabel,icon:(0,I.jsx)(R.Fragment,{children:n})}),(0,I.jsx)(kG.A,{value:"time","aria-label":u.timeTableLabel,icon:(0,I.jsx)(R.Fragment,{children:r})})]})};function k3(e){return(0,W.Ay)("MuiPickersToolbarText",e)}let k4=(0,z.A)("MuiPickersToolbarText",["root","selected"]),k6=["className","selected","value"],k8=(0,F.A)(uL.A,{name:"MuiPickersToolbarText",slot:"Root",overridesResolver:(e,t)=>[t.root,{[`&.${k4.selected}`]:t.selected}]})(({theme:e})=>({transition:e.transitions.create("color"),color:(e.vars||e).palette.text.secondary,[`&.${k4.selected}`]:{color:(e.vars||e).palette.text.primary}})),k9=R.forwardRef(function(e,t){let n=kI({props:e,name:"MuiPickersToolbarText"}),{className:i,value:r}=n,o=(0,dz.A)(n,k6),s=(e=>{let{classes:t,selected:n}=e;return(0,P.A)({root:["root",n&&"selected"]},k3,t)})(n);return(0,I.jsx)(k8,(0,dH.A)({ref:t,className:(0,O.A)(s.root,i),component:"span"},o,{children:r}))});function k7(e){return(0,W.Ay)("MuiPickersToolbar",e)}let Me=(0,z.A)("MuiPickersToolbar",["root","content"]),Mt=["children","className","toolbarTitle","hidden","titleId","isLandscape","classes","landscapeDirection"],Mn=(0,F.A)("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"}}]})),Mi=(0,F.A)("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"}}]}),Mr=R.forwardRef(function(e,t){let n=kI({props:e,name:"MuiPickersToolbar"}),{children:i,className:r,toolbarTitle:o,hidden:s,titleId:l}=n,a=(0,dz.A)(n,Mt),u=(e=>{let{classes:t}=e;return(0,P.A)({root:["root"],content:["content"]},k7,t)})(n);return s?null:(0,I.jsxs)(Mn,(0,dH.A)({ref:t,className:(0,O.A)(u.root,r),ownerState:n},a,{children:[(0,I.jsx)(uL.A,{color:"text.secondary",variant:"overline",id:l,children:o}),(0,I.jsx)(Mi,{className:u.content,ownerState:n,children:i})]}))}),Mo=["align","className","selected","typographyClassName","value","variant","width"],Ms=(0,F.A)(K.A,{name:"MuiPickersToolbarButton",slot:"Root",overridesResolver:(e,t)=>t.root})({padding:0,minWidth:16,textTransform:"none"}),Ml=R.forwardRef(function(e,t){let n=kI({props:e,name:"MuiPickersToolbarButton"}),{align:i,className:r,selected:o,typographyClassName:s,value:l,variant:a,width:u}=n,c=(0,dz.A)(n,Mo),h=(e=>{let{classes:t}=e;return(0,P.A)({root:["root"]},k7,t)})(n);return(0,I.jsx)(Ms,(0,dH.A)({variant:"text",ref:t,className:(0,O.A)(h.root,r)},u?{sx:{width:u}}:{},c,{children:(0,I.jsx)(k9,{align:i,className:s,variant:a,value:l,selected:o})}))});function Ma(e){return(0,W.Ay)("MuiDateTimePickerToolbar",e)}let Mu=(0,z.A)("MuiDateTimePickerToolbar",["root","dateContainer","timeContainer","timeDigitsContainer","separator","timeLabelReverse","ampmSelection","ampmLandscape","ampmLabel"]),Mc=["hours","minutes","seconds"],Mh=e=>Mc.includes(e),Md=(e,t,n)=>n&&(e>=12?"pm":"am")!==t?"am"===t?e-12:e+12:e,Mf=(e,t)=>3600*t.getHours(e)+60*t.getMinutes(e)+t.getSeconds(e),Mp=(e,t)=>(n,i)=>e?t.isAfter(n,i):Mf(n,t)>Mf(i,t);function Mm(e,t,n,i){let r=kB().utils;return{meridiemMode:e?r.getHours(e)>=12?"pm":"am":null,handleMeridiemChange:R.useCallback(o=>{var s;let l;n(null==e?null:(s=!!t,l=Md(r.getHours(e),o,s),r.setHours(e,l)),i??"partial")},[t,e,n,i,r])}}let Mg=["ampm","ampmInClock","value","onChange","view","isLandscape","onViewChange","toolbarFormat","toolbarPlaceholder","views","disabled","readOnly","toolbarVariant","toolbarTitle","className"],Mv=(0,F.A)(Mr,{name:"MuiDateTimePickerToolbar",slot:"Root",overridesResolver:(e,t)=>t.root})(({theme:e})=>({paddingLeft:16,paddingRight:16,justifyContent:"space-around",position:"relative",variants:[{props:{toolbarVariant:"desktop"},style:{borderBottom:`1px solid ${(e.vars||e).palette.divider}`,[`& .${Me.content} .${k4.selected}`]:{color:(e.vars||e).palette.primary.main,fontWeight:e.typography.fontWeightBold}}},{props:{toolbarVariant:"desktop",isLandscape:!0},style:{borderRight:`1px solid ${(e.vars||e).palette.divider}`}},{props:{toolbarVariant:"desktop",isLandscape:!1},style:{paddingLeft:24,paddingRight:0}}]})),Mb=(0,F.A)("div",{name:"MuiDateTimePickerToolbar",slot:"DateContainer",overridesResolver:(e,t)=>t.dateContainer})({display:"flex",flexDirection:"column",alignItems:"flex-start"}),Mx=(0,F.A)("div",{name:"MuiDateTimePickerToolbar",slot:"TimeContainer",overridesResolver:(e,t)=>t.timeContainer})({display:"flex",flexDirection:"row",variants:[{props:{isRtl:!0},style:{flexDirection:"row-reverse"}},{props:{toolbarVariant:"desktop",isLandscape:!1},style:{gap:9,marginRight:4,alignSelf:"flex-end"}},{props:({isLandscape:e,toolbarVariant:t})=>e&&"desktop"!==t,style:{flexDirection:"column"}},{props:({isLandscape:e,toolbarVariant:t,isRtl:n})=>e&&"desktop"!==t&&n,style:{flexDirection:"column-reverse"}}]}),My=(0,F.A)("div",{name:"MuiDateTimePickerToolbar",slot:"TimeDigitsContainer",overridesResolver:(e,t)=>t.timeDigitsContainer})({display:"flex",variants:[{props:{isRtl:!0},style:{flexDirection:"row-reverse"}},{props:{toolbarVariant:"desktop"},style:{gap:1.5}}]}),Mw=(0,F.A)(k9,{name:"MuiDateTimePickerToolbar",slot:"Separator",overridesResolver:(e,t)=>t.separator})({margin:"0 4px 0 2px",cursor:"default",variants:[{props:{toolbarVariant:"desktop"},style:{margin:0}}]}),MS=(0,F.A)("div",{name:"MuiDateTimePickerToolbar",slot:"AmPmSelection",overridesResolver:(e,t)=>[{[`.${Mu.ampmLabel}`]:t.ampmLabel},{[`&.${Mu.ampmLandscape}`]:t.ampmLandscape},t.ampmSelection]})({display:"flex",flexDirection:"column",marginRight:"auto",marginLeft:12,[`& .${Mu.ampmLabel}`]:{fontSize:17},variants:[{props:{isLandscape:!0},style:{margin:"4px 0 auto",flexDirection:"row",justifyContent:"space-around",width:"100%"}}]});function MC(e){let t=kI({props:e,name:"MuiDateTimePickerToolbar"}),{ampm:n,ampmInClock:i,value:r,onChange:o,view:s,isLandscape:l,onViewChange:a,toolbarFormat:u,toolbarPlaceholder:c="––",views:h,disabled:d,readOnly:f,toolbarVariant:p="mobile",toolbarTitle:m,className:g}=t,v=(0,dz.A)(t,Mg),b=(0,uf.I)(),x=(0,dH.A)({},t,{isRtl:b}),y=kB().utils,{meridiemMode:w,handleMeridiemChange:S}=Mm(r,n,o),C=!!(n&&!i),A="desktop"===p,k=kB().localeText,M=(e=>{let{classes:t,isLandscape:n,isRtl:i}=e;return(0,P.A)({root:["root"],dateContainer:["dateContainer"],timeContainer:["timeContainer",i&&"timeLabelReverse"],timeDigitsContainer:["timeDigitsContainer",i&&"timeLabelReverse"],separator:["separator"],ampmSelection:["ampmSelection",n&&"ampmLandscape"],ampmLabel:["ampmLabel"]},Ma,t)})(x),T=m??k.dateTimePickerToolbarTitle,D=R.useMemo(()=>r?u?y.formatByString(r,u):y.format(r,"shortDate"):c,[r,u,c,y]);return(0,I.jsxs)(Mv,(0,dH.A)({isLandscape:l,className:(0,O.A)(M.root,g),toolbarTitle:T},v,{ownerState:x,children:[(0,I.jsxs)(Mb,{className:M.dateContainer,ownerState:x,children:[h.includes("year")&&(0,I.jsx)(Ml,{tabIndex:-1,variant:"subtitle1",onClick:()=>a("year"),selected:"year"===s,value:r?y.format(r,"year"):"–"}),h.includes("day")&&(0,I.jsx)(Ml,{tabIndex:-1,variant:A?"h5":"h4",onClick:()=>a("day"),selected:"day"===s,value:D})]}),(0,I.jsxs)(Mx,{className:M.timeContainer,ownerState:x,children:[(0,I.jsxs)(My,{className:M.timeDigitsContainer,ownerState:x,children:[h.includes("hours")&&(0,I.jsxs)(R.Fragment,{children:[(0,I.jsx)(Ml,{variant:A?"h5":"h3",width:A&&!l?48:void 0,onClick:()=>a("hours"),selected:"hours"===s,value:r?n?y.format(r,"hours12h"):y.format(r,"hours24h"):"--"}),(0,I.jsx)(Mw,{variant:A?"h5":"h3",value:":",className:M.separator,ownerState:x}),(0,I.jsx)(Ml,{variant:A?"h5":"h3",width:A&&!l?48:void 0,onClick:()=>a("minutes"),selected:"minutes"===s||!h.includes("minutes")&&"hours"===s,value:r?y.format(r,"minutes"):"--",disabled:!h.includes("minutes")})]}),h.includes("seconds")&&(0,I.jsxs)(R.Fragment,{children:[(0,I.jsx)(Mw,{variant:A?"h5":"h3",value:":",className:M.separator,ownerState:x}),(0,I.jsx)(Ml,{variant:A?"h5":"h3",width:A&&!l?48:void 0,onClick:()=>a("seconds"),selected:"seconds"===s,value:r?y.format(r,"seconds"):"--"})]})]}),C&&!A&&(0,I.jsxs)(MS,{className:M.ampmSelection,ownerState:x,children:[(0,I.jsx)(Ml,{variant:"subtitle2",selected:"am"===w,typographyClassName:M.ampmLabel,value:k$(y,"am"),onClick:f?void 0:()=>S("am"),disabled:d}),(0,I.jsx)(Ml,{variant:"subtitle2",selected:"pm"===w,typographyClassName:M.ampmLabel,value:k$(y,"pm"),onClick:f?void 0:()=>S("pm"),disabled:d})]}),n&&A&&(0,I.jsx)(Ml,{variant:"h5",onClick:()=>a("meridiem"),selected:"meridiem"===s,value:r&&w?k$(y,w):"--",width:48})]})]}))}var MA=n(54553),Mk=n(77893);function MM(e){return(0,W.Ay)("MuiPickersArrowSwitcher",e)}(0,z.A)("MuiPickersArrowSwitcher",["root","spacer","button","previousIconButton","nextIconButton","leftArrowIcon","rightArrowIcon"]);let MT=["children","className","slots","slotProps","isNextDisabled","isNextHidden","onGoToNext","nextLabel","isPreviousDisabled","isPreviousHidden","onGoToPrevious","previousLabel","labelId"],MD=["ownerState"],MI=["ownerState"],MR=(0,F.A)("div",{name:"MuiPickersArrowSwitcher",slot:"Root",overridesResolver:(e,t)=>t.root})({display:"flex"}),ME=(0,F.A)("div",{name:"MuiPickersArrowSwitcher",slot:"Spacer",overridesResolver:(e,t)=>t.spacer})(({theme:e})=>({width:e.spacing(3)})),MO=(0,F.A)(Q.A,{name:"MuiPickersArrowSwitcher",slot:"Button",overridesResolver:(e,t)=>t.button})({variants:[{props:{hidden:!0},style:{visibility:"hidden"}}]}),MP=R.forwardRef(function(e,t){let n=(0,uf.I)(),i=kI({props:e,name:"MuiPickersArrowSwitcher"}),{children:r,className:o,slots:s,slotProps:l,isNextDisabled:a,isNextHidden:u,onGoToNext:c,nextLabel:h,isPreviousDisabled:d,isPreviousHidden:f,onGoToPrevious:p,previousLabel:m,labelId:g}=i,v=(0,dz.A)(i,MT),b=(e=>{let{classes:t}=e;return(0,P.A)({root:["root"],spacer:["spacer"],button:["button"],previousIconButton:["previousIconButton"],nextIconButton:["nextIconButton"],leftArrowIcon:["leftArrowIcon"],rightArrowIcon:["rightArrowIcon"]},MM,t)})(i),x=s?.previousIconButton??MO,y=(0,Mk.A)({elementType:x,externalSlotProps:l?.previousIconButton,additionalProps:{size:"medium",title:m,"aria-label":m,disabled:d,edge:"end",onClick:p},ownerState:(0,dH.A)({},i,{hidden:f}),className:(0,O.A)(b.button,b.previousIconButton)}),w=s?.nextIconButton??MO,S=(0,Mk.A)({elementType:w,externalSlotProps:l?.nextIconButton,additionalProps:{size:"medium",title:h,"aria-label":h,disabled:a,edge:"start",onClick:c},ownerState:(0,dH.A)({},i,{hidden:u}),className:(0,O.A)(b.button,b.nextIconButton)}),C=s?.leftArrowIcon??kX,A=(0,Mk.A)({elementType:C,externalSlotProps:l?.leftArrowIcon,additionalProps:{fontSize:"inherit"},ownerState:i,className:b.leftArrowIcon}),k=(0,dz.A)(A,MD),M=s?.rightArrowIcon??kZ,T=(0,Mk.A)({elementType:M,externalSlotProps:l?.rightArrowIcon,additionalProps:{fontSize:"inherit"},ownerState:i,className:b.rightArrowIcon}),D=(0,dz.A)(T,MI);return(0,I.jsxs)(MR,(0,dH.A)({ref:t,className:(0,O.A)(b.root,o),ownerState:i},v,{children:[(0,I.jsx)(x,(0,dH.A)({},y,{children:n?(0,I.jsx)(M,(0,dH.A)({},D)):(0,I.jsx)(C,(0,dH.A)({},k))})),r?(0,I.jsx)(uL.A,{variant:"subtitle1",component:"span",id:g,children:r}):(0,I.jsx)(ME,{className:b.spacer,ownerState:i}),(0,I.jsx)(w,(0,dH.A)({},S,{children:n?(0,I.jsx)(C,(0,dH.A)({},k)):(0,I.jsx)(M,(0,dH.A)({},D))}))]}))});var ML=n(83183),Mj=n(89369);function MB({onChange:e,onViewChange:t,openTo:n,view:i,views:r,autoFocus:o,focusedView:s,onFocusedViewChange:l}){let a=R.useRef(n),u=R.useRef(r),c=R.useRef(r.includes(n)?n:r[0]),[h,d]=(0,Mj.A)({name:"useViews",state:"view",controlled:i,default:c.current}),f=R.useRef(o?h:null),[p,m]=(0,Mj.A)({name:"useViews",state:"focusedView",controlled:s,default:f.current});R.useEffect(()=>{(a.current&&a.current!==n||u.current&&u.current.some(e=>!r.includes(e)))&&(d(r.includes(n)?n:r[0]),u.current=r,a.current=n)},[n,d,h,r]);let g=r.indexOf(h),v=r[g-1]??null,b=r[g+1]??null,x=(0,ML.A)((e,t)=>{t?m(e):m(t=>e===t?null:t),l?.(e,t)}),y=(0,ML.A)(e=>{x(e,!0),e!==h&&(d(e),t&&t(e))}),w=(0,ML.A)(()=>{b&&y(b)}),S=(0,ML.A)((t,n,i)=>{let o="finish"===n,s=i?r.indexOf(i)<r.length-1:!!b;if(e(t,o&&s?"partial":n,i),i&&i!==h){let e=r[r.indexOf(i)+1];e&&y(e)}else o&&w()});return{view:h,setView:y,focusedView:p,setFocusedView:x,nextView:b,previousView:v,defaultView:r.includes(n)?n:r[0],goToNextView:w,setValueAndGoToNextView:S}}let MF=(0,F.A)("div")({overflow:"hidden",width:320,maxHeight:336,display:"flex",flexDirection:"column",margin:"0 auto"});function MN(e){return(0,W.Ay)("MuiTimeClock",e)}(0,z.A)("MuiTimeClock",["root","arrowSwitcher"]);var MV=n(31789);function MH(e){return(0,W.Ay)("MuiClockPointer",e)}(0,z.A)("MuiClockPointer",["root","thumb"]);let Mz=["className","hasSelected","isInner","type","viewValue"],MW=(0,F.A)("div",{name:"MuiClockPointer",slot:"Root",overridesResolver:(e,t)=>t.root})(({theme:e})=>({width:2,backgroundColor:(e.vars||e).palette.primary.main,position:"absolute",left:"calc(50% - 1px)",bottom:"50%",transformOrigin:"center bottom 0px",variants:[{props:{shouldAnimate:!0},style:{transition:e.transitions.create(["transform","height"])}}]})),M$=(0,F.A)("div",{name:"MuiClockPointer",slot:"Thumb",overridesResolver:(e,t)=>t.thumb})(({theme:e})=>({width:4,height:4,backgroundColor:(e.vars||e).palette.primary.contrastText,borderRadius:"50%",position:"absolute",top:-21,left:"calc(50% - 18px)",border:`16px solid ${(e.vars||e).palette.primary.main}`,boxSizing:"content-box",variants:[{props:{hasSelected:!0},style:{backgroundColor:(e.vars||e).palette.primary.main}}]}));function M_(e){let t,n=kI({props:e,name:"MuiClockPointer"}),{className:i,isInner:r,type:o,viewValue:s}=n,l=(0,dz.A)(n,Mz),a=R.useRef(o);R.useEffect(()=>{a.current=o},[o]);let u=(0,dH.A)({},n,{shouldAnimate:a.current!==o}),c=(e=>{let{classes:t}=e;return(0,P.A)({root:["root"],thumb:["thumb"]},MH,t)})(u);return(0,I.jsx)(MW,(0,dH.A)({style:(t=360/("hours"===o?12:60)*s,"hours"===o&&s>12&&(t-=360),{height:Math.round((r?.26:.4)*220),transform:`rotateZ(${t}deg)`}),className:(0,O.A)(c.root,i),ownerState:u},l,{children:(0,I.jsx)(M$,{ownerState:u,className:c.thumb})}))}let MU=110,MG=110,Mq=MU,MY=0,MK=Mq-MU,MX=MY-MG,MZ=(e,t,n)=>{let i=t-MU,r=n-MG,o=180/Math.PI*(Math.atan2(MK,MX)-Math.atan2(i,r));return{value:Math.floor((o=Math.round(o/e)*e%360)/e)||0,distance:Math.sqrt(i**2+r**2)}};function MQ(e){return(0,W.Ay)("MuiClock",e)}(0,z.A)("MuiClock",["root","clock","wrapper","squareMask","pin","amButton","pmButton","meridiemText","selected"]);let MJ=(0,F.A)("div",{name:"MuiClock",slot:"Root",overridesResolver:(e,t)=>t.root})(({theme:e})=>({display:"flex",justifyContent:"center",alignItems:"center",margin:e.spacing(2)})),M0=(0,F.A)("div",{name:"MuiClock",slot:"Clock",overridesResolver:(e,t)=>t.clock})({backgroundColor:"rgba(0,0,0,.07)",borderRadius:"50%",height:220,width:220,flexShrink:0,position:"relative",pointerEvents:"none"}),M1=(0,F.A)("div",{name:"MuiClock",slot:"Wrapper",overridesResolver:(e,t)=>t.wrapper})({"&:focus":{outline:"none"}}),M2=(0,F.A)("div",{name:"MuiClock",slot:"SquareMask",overridesResolver:(e,t)=>t.squareMask})({width:"100%",height:"100%",position:"absolute",pointerEvents:"auto",outline:0,touchAction:"none",userSelect:"none",variants:[{props:{disabled:!1},style:{"@media (pointer: fine)":{cursor:"pointer",borderRadius:"50%"},"&:active":{cursor:"move"}}}]}),M5=(0,F.A)("div",{name:"MuiClock",slot:"Pin",overridesResolver:(e,t)=>t.pin})(({theme:e})=>({width:6,height:6,borderRadius:"50%",backgroundColor:(e.vars||e).palette.primary.main,position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)"})),M3=(e,t)=>({zIndex:1,bottom:8,paddingLeft:4,paddingRight:4,width:36,variants:[{props:{meridiemMode:t},style:{backgroundColor:(e.vars||e).palette.primary.main,color:(e.vars||e).palette.primary.contrastText,"&:hover":{backgroundColor:(e.vars||e).palette.primary.light}}}]}),M4=(0,F.A)(Q.A,{name:"MuiClock",slot:"AmButton",overridesResolver:(e,t)=>t.amButton})(({theme:e})=>(0,dH.A)({},M3(e,"am"),{position:"absolute",left:8})),M6=(0,F.A)(Q.A,{name:"MuiClock",slot:"PmButton",overridesResolver:(e,t)=>t.pmButton})(({theme:e})=>(0,dH.A)({},M3(e,"pm"),{position:"absolute",right:8})),M8=(0,F.A)(uL.A,{name:"MuiClock",slot:"meridiemText",overridesResolver:(e,t)=>t.meridiemText})({overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"});function M9(e){let t=kI({props:e,name:"MuiClock"}),{ampm:n,ampmInClock:i,autoFocus:r,children:o,value:s,handleMeridiemChange:l,isTimeDisabled:a,meridiemMode:u,minutesStep:c=1,onChange:h,selectedId:d,type:f,viewValue:p,viewRange:[m,g],disabled:v=!1,readOnly:b,className:x}=t,y=kB().utils,w=kB().localeText,S=R.useRef(!1),C=(e=>{let{classes:t,meridiemMode:n}=e;return(0,P.A)({root:["root"],clock:["clock"],wrapper:["wrapper"],squareMask:["squareMask"],pin:["pin"],amButton:["amButton","am"===n&&"selected"],pmButton:["pmButton","pm"===n&&"selected"],meridiemText:["meridiemText"]},MQ,t)})(t),A=a(p,f),k=!n&&"hours"===f&&(p<1||p>12),M=(e,t)=>{v||b||a(e,f)||h(e,t)},T=(e,t)=>{let{offsetX:i,offsetY:r}=e;if(void 0===i){let t=e.target.getBoundingClientRect();i=e.changedTouches[0].clientX-t.left,r=e.changedTouches[0].clientY-t.top}M("seconds"===f||"minutes"===f?((e,t,n=1)=>{let{value:i}=MZ(6*n,e,t);return i*n%60})(i,r,c):((e,t,n)=>{let{value:i,distance:r}=MZ(30,e,t),o=i||12;return n?o%=12:r<74&&(o+=12,o%=24),o})(i,r,!!n),t)},D=e=>{S.current=!0,T(e,"shallow")},E=R.useMemo(()=>"hours"===f||p%5==0,[f,p]),L="minutes"===f?c:1,j=R.useRef(null);(0,MV.A)(()=>{r&&j.current.focus()},[r]);let B=e=>Math.max(m,Math.min(g,e)),F=e=>(e+(g+1))%(g+1);return(0,I.jsxs)(MJ,{className:(0,O.A)(C.root,x),children:[(0,I.jsxs)(M0,{className:C.clock,children:[(0,I.jsx)(M2,{onTouchMove:D,onTouchStart:D,onTouchEnd:e=>{S.current&&(T(e,"finish"),S.current=!1),e.preventDefault()},onMouseUp:e=>{S.current&&(S.current=!1),T(e.nativeEvent,"finish")},onMouseMove:e=>{e.buttons>0&&T(e.nativeEvent,"shallow")},ownerState:{disabled:v},className:C.squareMask}),!A&&(0,I.jsxs)(R.Fragment,{children:[(0,I.jsx)(M5,{className:C.pin}),null!=s&&(0,I.jsx)(M_,{type:f,viewValue:p,isInner:k,hasSelected:E})]}),(0,I.jsx)(M1,{"aria-activedescendant":d,"aria-label":w.clockLabelText(f,s,y,null==s?null:y.format(s,"fullTime")),ref:j,role:"listbox",onKeyDown:e=>{if(!S.current)switch(e.key){case"Home":M(m,"partial"),e.preventDefault();break;case"End":M(g,"partial"),e.preventDefault();break;case"ArrowUp":M(F(p+L),"partial"),e.preventDefault();break;case"ArrowDown":M(F(p-L),"partial"),e.preventDefault();break;case"PageUp":M(B(p+5),"partial"),e.preventDefault();break;case"PageDown":M(B(p-5),"partial"),e.preventDefault();break;case"Enter":case" ":M(p,"finish"),e.preventDefault()}},tabIndex:0,className:C.wrapper,children:o})]}),n&&i&&(0,I.jsxs)(R.Fragment,{children:[(0,I.jsx)(M4,{onClick:b?void 0:()=>l("am"),disabled:v||null===u,ownerState:t,className:C.amButton,title:k$(y,"am"),children:(0,I.jsx)(M8,{variant:"caption",className:C.meridiemText,children:k$(y,"am")})}),(0,I.jsx)(M6,{disabled:v||null===u,onClick:b?void 0:()=>l("pm"),ownerState:t,className:C.pmButton,title:k$(y,"pm"),children:(0,I.jsx)(M8,{variant:"caption",className:C.meridiemText,children:k$(y,"pm")})})]})]})}function M7(e){return(0,W.Ay)("MuiClockNumber",e)}let Te=(0,z.A)("MuiClockNumber",["root","selected","disabled"]),Tt=["className","disabled","index","inner","label","selected"],Tn=(0,F.A)("span",{name:"MuiClockNumber",slot:"Root",overridesResolver:(e,t)=>[t.root,{[`&.${Te.disabled}`]:t.disabled},{[`&.${Te.selected}`]:t.selected}]})(({theme:e})=>({height:36,width:36,position:"absolute",left:"calc((100% - 36px) / 2)",display:"inline-flex",justifyContent:"center",alignItems:"center",borderRadius:"50%",color:(e.vars||e).palette.text.primary,fontFamily:e.typography.fontFamily,"&:focused":{backgroundColor:(e.vars||e).palette.background.paper},[`&.${Te.selected}`]:{color:(e.vars||e).palette.primary.contrastText},[`&.${Te.disabled}`]:{pointerEvents:"none",color:(e.vars||e).palette.text.disabled},variants:[{props:{inner:!0},style:(0,dH.A)({},e.typography.body2,{color:(e.vars||e).palette.text.secondary})}]}));function Ti(e){let t=kI({props:e,name:"MuiClockNumber"}),{className:n,disabled:i,index:r,inner:o,label:s,selected:l}=t,a=(0,dz.A)(t,Tt),u=(e=>{let{classes:t,selected:n,disabled:i}=e;return(0,P.A)({root:["root",n&&"selected",i&&"disabled"]},M7,t)})(t),c=r%12/12*Math.PI*2-Math.PI/2,h=91*(o?.65:1),d=Math.round(Math.cos(c)*h),f=Math.round(Math.sin(c)*h);return(0,I.jsx)(Tn,(0,dH.A)({className:(0,O.A)(u.root,n),"aria-disabled":!!i||void 0,"aria-selected":!!l||void 0,role:"option",style:{transform:`translate(${d}px, ${f+92}px`},ownerState:t},a,{children:s}))}let Tr=({utils:e,value:t,isDisabled:n,getClockNumberText:i,selectedId:r})=>{let o=e.formatNumber;return[[5,o("05")],[10,o("10")],[15,o("15")],[20,o("20")],[25,o("25")],[30,o("30")],[35,o("35")],[40,o("40")],[45,o("45")],[50,o("50")],[55,o("55")],[0,o("00")]].map(([e,o],s)=>{let l=e===t;return(0,I.jsx)(Ti,{label:o,id:l?r:void 0,index:s+1,inner:!1,disabled:n(e),selected:l,"aria-label":i(o)},e)})},To=({timezone:e,value:t,defaultValue:n,referenceDate:i,onChange:r,valueManager:o})=>{let s,l=kB().utils,a=R.useRef(n),u=t??a.current??o.emptyValue,c=R.useMemo(()=>o.getTimezone(l,u),[l,o,u]),h=(0,ML.A)(e=>null==c?e:o.setTimezone(l,c,e));return s=e||c||(i?l.getTimezone(i):"default"),{value:R.useMemo(()=>o.setTimezone(l,s,u),[o,l,s,u]),handleValueChange:(0,ML.A)((e,...t)=>{let n=h(e);r?.(n,...t)}),timezone:s}},Ts=({name:e,timezone:t,value:n,defaultValue:i,referenceDate:r,onChange:o,valueManager:s})=>{let[l,a]=(0,Mj.A)({name:e,state:"value",controlled:n,default:i??s.emptyValue});return To({timezone:t,value:l,defaultValue:void 0,referenceDate:r,onChange:(0,ML.A)((e,...t)=>{a(e),o?.(e,...t)}),valueManager:s})},Tl={year:1,month:2,day:3,hours:4,minutes:5,seconds:6,milliseconds:7},Ta=(e,t,n)=>{if(t===Tl.year)return e.startOfYear(n);if(t===Tl.month)return e.startOfMonth(n);if(t===Tl.day)return e.startOfDay(n);let i=n;return t<Tl.minutes&&(i=e.setMinutes(i,0)),t<Tl.seconds&&(i=e.setSeconds(i,0)),t<Tl.milliseconds&&(i=e.setMilliseconds(i,0)),i},Tu=(e,t)=>{let n=e.formatTokenMap[t];if(null==n)throw Error(`MUI X: The token "${t}" is not supported by the Date and Time Pickers.
|
|
7
|
+
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.`);return"string"==typeof n?{type:n,contentType:"meridiem"===n?"letter":"digit",maxLength:void 0}:{type:n.sectionType,contentType:n.contentType,maxLength:n.maxLength}},Tc=(e,t)=>{let n=[],i=e.date(void 0,"default"),r=e.startOfWeek(i),o=e.endOfWeek(i),s=r;for(;e.isBefore(s,o);)n.push(s),s=e.addDays(s,1);return n.map(n=>e.formatByString(n,t))},Th=(e,t,n,i)=>{switch(n){case"month":return kz(e,e.date(void 0,t)).map(t=>e.formatByString(t,i));case"weekDay":return Tc(e,i);case"meridiem":{let n=e.date(void 0,t);return[e.startOfDay(n),e.endOfDay(n)].map(t=>e.formatByString(t,i))}default:return[]}},Td=["0","1","2","3","4","5","6","7","8","9"],Tf=(e,t)=>{if("0"===t[0])return e;let n=[],i="";for(let r=0;r<e.length;r+=1){i+=e[r];let o=t.indexOf(i);o>-1&&(n.push(o.toString()),i="")}return n.join("")},Tp=(e,t)=>"0"===t[0]?e:e.split("").map(e=>t[Number(e)]).join(""),Tm=(e,t)=>{let n=Tf(e,t);return" "!==n&&!Number.isNaN(Number(n))},Tg=(e,t)=>{let n=e;for(n=Number(n).toString();n.length<t;)n=`0${n}`;return n},Tv=(e,t,n,i,r)=>{if("day"===r.type&&"digit-with-letter"===r.contentType){let i=e.setDate(n.longestMonth,t);return e.formatByString(i,r.format)}let o=t.toString();return r.hasLeadingZerosInInput&&(o=Tg(o,r.maxLength)),Tp(o,i)},Tb=(e,t,n)=>{let i=e.value||e.placeholder,r="non-input"===t?e.hasLeadingZerosInFormat:e.hasLeadingZerosInInput;return"non-input"===t&&e.hasLeadingZerosInInput&&!e.hasLeadingZerosInFormat&&(i=Number(Tf(i,n)).toString()),["input-rtl","input-ltr"].includes(t)&&"digit"===e.contentType&&!r&&1===i.length&&(i=`${i}\u200e`),"input-rtl"===t&&(i=`\u2068${i}\u2069`),i},Tx=(e,t,n,i)=>e.formatByString(e.parse(t,n),i),Ty=(e,t,n,i)=>{if("digit"!==t)return!1;let r=e.date(void 0,"default");switch(n){case"year":if("dayjs"===e.lib&&"YY"===i)return!0;return e.formatByString(e.setYear(r,1),i).startsWith("0");case"month":return e.formatByString(e.startOfYear(r),i).length>1;case"day":return e.formatByString(e.startOfMonth(r),i).length>1;case"weekDay":return e.formatByString(e.startOfWeek(r),i).length>1;case"hours":return e.formatByString(e.setHours(r,1),i).length>1;case"minutes":return e.formatByString(e.setMinutes(r,1),i).length>1;case"seconds":return e.formatByString(e.setSeconds(r,1),i).length>1;default:throw Error("Invalid section type")}},Tw=(e,t)=>{},TS={year:1,month:2,day:3,weekDay:4,hours:5,minutes:6,seconds:7,meridiem:8,empty:9},TC=(e,t,n,i,r)=>[...n].sort((e,t)=>TS[e.type]-TS[t.type]).reduce((n,i)=>!r||i.modified?((e,t,n,i)=>{switch(t.type){case"year":return e.setYear(i,e.getYear(n));case"month":return e.setMonth(i,e.getMonth(n));case"weekDay":{let i=Tc(e,t.format),r=e.formatByString(n,t.format),o=i.indexOf(r),s=i.indexOf(t.value);return e.addDays(n,s-o)}case"day":return e.setDate(i,e.getDate(n));case"meridiem":{let t=12>e.getHours(n),r=e.getHours(i);if(t&&r>=12)return e.addHours(i,-12);if(!t&&r<12)return e.addHours(i,12);return i}case"hours":return e.setHours(i,e.getHours(n));case"minutes":return e.setMinutes(i,e.getMinutes(n));case"seconds":return e.setSeconds(i,e.getSeconds(n));default:return i}})(e,i,t,n):n,i),TA=(e,t)=>{if(null==e)return null;if("all"===e)return"all";if("string"==typeof e){let n=t.findIndex(t=>t.type===e);return -1===n?null:n}return e},Tk=["value","referenceDate"],TM={emptyValue:null,getTodayValue:kW,getInitialReferenceValue:e=>{let{value:t,referenceDate:n}=e,i=(0,dz.A)(e,Tk);return null!=t&&i.utils.isValid(t)?t:null!=n?n:(({props:e,utils:t,granularity:n,timezone:i,getTodayDate:r})=>{let o=r?r():Ta(t,n,kW(t,i));null!=e.minDate&&t.isAfterDay(e.minDate,o)&&(o=Ta(t,n,e.minDate)),null!=e.maxDate&&t.isBeforeDay(e.maxDate,o)&&(o=Ta(t,n,e.maxDate));let s=Mp(e.disableIgnoringDatePartForTimeValidation??!1,t);return null!=e.minTime&&s(e.minTime,o)&&(o=Ta(t,n,e.disableIgnoringDatePartForTimeValidation?e.minTime:kN(t,o,e.minTime))),null!=e.maxTime&&s(o,e.maxTime)&&(o=Ta(t,n,e.disableIgnoringDatePartForTimeValidation?e.maxTime:kN(t,o,e.maxTime))),o})(i)},cleanValue:(e,t)=>null!=t&&e.isValid(t)?t:null,areValuesEqual:(e,t,n)=>!(e.isValid(t)||null==t||e.isValid(n))&&null!=n||e.isEqual(t,n),isSameError:(e,t)=>e===t,hasError:e=>null!=e,defaultErrorState:null,getTimezone:(e,t)=>null!=t&&e.isValid(t)?e.getTimezone(t):null,setTimezone:(e,t,n)=>null==n?null:e.setTimezone(n,t)},TT={updateReferenceValue:(e,t,n)=>null!=t&&e.isValid(t)?t:n,getSectionsFromValue:(e,t,n,i)=>!e.isValid(t)&&n?n:i(t),getV7HiddenInputValueFromSections:e=>e.map(e=>`${e.startSeparator}${e.value||e.placeholder}${e.endSeparator}`).join(""),getV6InputValueFromSections:(e,t,n)=>{let i=e.map(e=>{let i=Tb(e,n?"input-rtl":"input-ltr",t);return`${e.startSeparator}${i}${e.endSeparator}`}).join("");return n?`\u2066${i}\u2069`:i},getActiveDateManager:(e,t)=>({date:t.value,referenceDate:t.referenceValue,getSections:e=>e,getNewValuesFromNewActiveDate:n=>({value:n,referenceValue:null!=n&&e.isValid(n)?n:t.referenceValue})}),parseValueStr:(e,t,n)=>n(e.trim(),t)},TD=["ampm","ampmInClock","autoFocus","slots","slotProps","value","defaultValue","referenceDate","disableIgnoringDatePartForTimeValidation","maxTime","minTime","disableFuture","disablePast","minutesStep","shouldDisableTime","showViewSwitcher","onChange","view","views","openTo","onViewChange","focusedView","onFocusedViewChange","className","disabled","readOnly","timezone"],TI=(0,F.A)(MF,{name:"MuiTimeClock",slot:"Root",overridesResolver:(e,t)=>t.root})({display:"flex",flexDirection:"column",position:"relative"}),TR=(0,F.A)(MP,{name:"MuiTimeClock",slot:"ArrowSwitcher",overridesResolver:(e,t)=>t.arrowSwitcher})({position:"absolute",right:12,top:15}),TE=["hours","minutes"],TO=R.forwardRef(function(e,t){let n=kB().utils,i=kI({props:e,name:"MuiTimeClock"}),{ampm:r=n.is12HourCycleInCurrentLocale(),ampmInClock:o=!1,autoFocus:s,slots:l,slotProps:a,value:u,defaultValue:c,referenceDate:h,disableIgnoringDatePartForTimeValidation:d=!1,maxTime:f,minTime:p,disableFuture:m,disablePast:g,minutesStep:v=1,shouldDisableTime:b,showViewSwitcher:x,onChange:y,view:w,views:S=TE,openTo:C,onViewChange:A,focusedView:k,onFocusedViewChange:M,className:T,disabled:D,readOnly:E,timezone:L}=i,j=(0,dz.A)(i,TD),{value:B,handleValueChange:F,timezone:N}=Ts({name:"TimeClock",timezone:L,value:u,defaultValue:c,referenceDate:h,onChange:y,valueManager:TM}),V=(({value:e,referenceDate:t,utils:n,props:i,timezone:r})=>{let o=R.useMemo(()=>TM.getInitialReferenceValue({value:e,utils:n,props:i,referenceDate:t,granularity:Tl.day,timezone:r,getTodayDate:()=>kW(n,r,"date")}),[]);return e??o})({value:B,referenceDate:h,utils:n,props:i,timezone:N}),H=kB().localeText,z=kF(N),{view:W,setView:$,previousView:_,nextView:U,setValueAndGoToNextView:G}=MB({view:w,views:S,openTo:C,onViewChange:A,onChange:F,focusedView:k,onFocusedViewChange:M}),{meridiemMode:q,handleMeridiemChange:Y}=Mm(V,r,G),K=R.useCallback((e,t)=>{let i=Mp(d,n),o="hours"===t||"minutes"===t&&S.includes("seconds"),s=({start:e,end:t})=>!(p&&i(p,t)||f&&i(e,f)||m&&i(e,z)||g&&i(z,o?t:e)),l=(e,i=1)=>{if(e%i!=0)return!1;if(b)switch(t){case"hours":return!b(n.setHours(V,e),"hours");case"minutes":return!b(n.setMinutes(V,e),"minutes");case"seconds":return!b(n.setSeconds(V,e),"seconds");default:return!1}return!0};switch(t){case"hours":{let t=Md(e,q,r),i=n.setHours(V,t);if(n.getHours(i)!==t)return!0;return!s({start:n.setSeconds(n.setMinutes(i,0),0),end:n.setSeconds(n.setMinutes(i,59),59)})||!l(t)}case"minutes":{let t=n.setMinutes(V,e);return!s({start:n.setSeconds(t,0),end:n.setSeconds(t,59)})||!l(e,v)}case"seconds":{let t=n.setSeconds(V,e);return!s({start:t,end:t})||!l(e)}default:throw Error("not supported")}},[r,V,d,f,q,p,v,b,n,m,g,z,S]),X=(0,MA.A)(),Z=R.useMemo(()=>{switch(W){case"hours":{let e,t=(e,t)=>{let i=Md(e,q,r);G(n.setHours(V,i),t,"hours")},i=n.getHours(V);return e=r?i>12?[12,23]:[0,11]:[0,23],{onChange:t,viewValue:i,children:(({ampm:e,value:t,getClockNumberText:n,isDisabled:i,selectedId:r,utils:o})=>{let s=t?o.getHours(t):null,l=[],a=+!!e,u=e?12:23,c=t=>null!==s&&(e?12===t?12===s||0===s:s===t||s-12===t:s===t);for(let t=a;t<=u;t+=1){let s=t.toString();0===t&&(s="00");let a=!e&&(0===t||t>12);s=o.formatNumber(s);let u=c(t);l.push((0,I.jsx)(Ti,{id:u?r:void 0,index:t,inner:a,selected:u,disabled:i(t),label:s,"aria-label":n(s)},t))}return l})({value:B,utils:n,ampm:r,onChange:t,getClockNumberText:H.hoursClockNumberText,isDisabled:e=>D||K(e,"hours"),selectedId:X}),viewRange:e}}case"minutes":{let e=n.getMinutes(V),t=(e,t)=>{G(n.setMinutes(V,e),t,"minutes")};return{viewValue:e,onChange:t,children:Tr({utils:n,value:e,onChange:t,getClockNumberText:H.minutesClockNumberText,isDisabled:e=>D||K(e,"minutes"),selectedId:X}),viewRange:[0,59]}}case"seconds":{let e=n.getSeconds(V),t=(e,t)=>{G(n.setSeconds(V,e),t,"seconds")};return{viewValue:e,onChange:t,children:Tr({utils:n,value:e,onChange:t,getClockNumberText:H.secondsClockNumberText,isDisabled:e=>D||K(e,"seconds"),selectedId:X}),viewRange:[0,59]}}default:throw Error("You must provide the type for ClockView")}},[W,n,B,r,H.hoursClockNumberText,H.minutesClockNumberText,H.secondsClockNumberText,q,G,V,K,X,D]),Q=(e=>{let{classes:t}=e;return(0,P.A)({root:["root"],arrowSwitcher:["arrowSwitcher"]},MN,t)})(i);return(0,I.jsxs)(TI,(0,dH.A)({ref:t,className:(0,O.A)(Q.root,T),ownerState:i},j,{children:[(0,I.jsx)(M9,(0,dH.A)({autoFocus:s??!!k,ampmInClock:o&&S.includes("hours"),value:B,type:W,ampm:r,minutesStep:v,isTimeDisabled:K,meridiemMode:q,handleMeridiemChange:Y,selectedId:X,disabled:D,readOnly:E},Z)),x&&(0,I.jsx)(TR,{className:Q.arrowSwitcher,slots:l,slotProps:a,onGoToPrevious:()=>$(_),isPreviousDisabled:!_,previousLabel:H.openPreviousView,onGoToNext:()=>$(U),isNextDisabled:!U,nextLabel:H.openNextView,ownerState:i})]}))}),TP=({view:e,onViewChange:t,focusedView:n,onFocusedViewChange:i,views:r,value:o,defaultValue:s,referenceDate:l,onChange:a,className:u,classes:c,disableFuture:h,disablePast:d,minTime:f,maxTime:p,shouldDisableTime:m,minutesStep:g,ampm:v,ampmInClock:b,slots:x,slotProps:y,readOnly:w,disabled:S,sx:C,autoFocus:A,showViewSwitcher:k,disableIgnoringDatePartForTimeValidation:M,timezone:T})=>(0,I.jsx)(TO,{view:e,onViewChange:t,focusedView:n&&Mh(n)?n:null,onFocusedViewChange:i,views:r.filter(Mh),value:o,defaultValue:s,referenceDate:l,onChange:a,className:u,classes:c,disableFuture:h,disablePast:d,minTime:f,maxTime:p,shouldDisableTime:m,minutesStep:g,ampm:v,ampmInClock:b,slots:x,slotProps:y,readOnly:w,disabled:S,sx:C,autoFocus:A,showViewSwitcher:k,disableIgnoringDatePartForTimeValidation:M,timezone:T}),TL=({props:e,value:t,timezone:n,adapter:i})=>{if(null===t)return null;let{shouldDisableDate:r,shouldDisableMonth:o,shouldDisableYear:s,disablePast:l,disableFuture:a}=e,u=i.utils.date(void 0,n),c=kH(i.utils,e.minDate,i.defaultDates.minDate),h=kH(i.utils,e.maxDate,i.defaultDates.maxDate);switch(!0){case!i.utils.isValid(t):return"invalidDate";case!!(r&&r(t)):return"shouldDisableDate";case!!(o&&o(t)):return"shouldDisableMonth";case!!(s&&s(t)):return"shouldDisableYear";case!!(a&&i.utils.isAfterDay(t,u)):return"disableFuture";case!!(l&&i.utils.isBeforeDay(t,u)):return"disablePast";case!!(c&&i.utils.isBeforeDay(t,c)):return"minDate";case!!(h&&i.utils.isAfterDay(t,h)):return"maxDate";default:return null}};TL.valueManager=TM;let Tj=({shouldDisableDate:e,shouldDisableMonth:t,shouldDisableYear:n,minDate:i,maxDate:r,disableFuture:o,disablePast:s,timezone:l})=>{let a=kB();return R.useCallback(u=>null!==TL({adapter:a,value:u,timezone:l,props:{shouldDisableDate:e,shouldDisableMonth:t,shouldDisableYear:n,minDate:i,maxDate:r,disableFuture:o,disablePast:s}}),[a,e,t,n,i,r,o,s,l])};var TB=n(44394),TF=n(96313);let TN=e=>(0,W.Ay)("MuiPickersFadeTransitionGroup",e);(0,z.A)("MuiPickersFadeTransitionGroup",["root"]);let TV=(0,F.A)(TB.A,{name:"MuiPickersFadeTransitionGroup",slot:"Root",overridesResolver:(e,t)=>t.root})({display:"block",position:"relative"});function TH(e){let t=kI({props:e,name:"MuiPickersFadeTransitionGroup"}),{children:n,className:i,reduceAnimations:r,transKey:o}=t,s=(e=>{let{classes:t}=e;return(0,P.A)({root:["root"]},TN,t)})(t),l=(0,r7.A)();return r?n:(0,I.jsx)(TV,{className:(0,O.A)(s.root,i),children:(0,I.jsx)(TF.A,{appear:!1,mountOnEnter:!0,unmountOnExit:!0,timeout:{appear:l.transitions.duration.enteringScreen,enter:l.transitions.duration.enteringScreen,exit:0},children:n},o)})}var Tz=n(95591);function TW(e){return(0,W.Ay)("MuiPickersDay",e)}let T$=(0,z.A)("MuiPickersDay",["root","dayWithMargin","dayOutsideMonth","hiddenDaySpacingFiller","today","selected","disabled"]),T_=["autoFocus","className","day","disabled","disableHighlightToday","disableMargin","hidden","isAnimating","onClick","onDaySelect","onFocus","onBlur","onKeyDown","onMouseDown","onMouseEnter","outsideCurrentMonth","selected","showDaysOutsideCurrentMonth","children","today","isFirstVisibleCell","isLastVisibleCell"],TU=({theme:e})=>(0,dH.A)({},e.typography.caption,{width:36,height:36,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})`:(0,L.X4)(e.palette.primary.main,e.palette.action.hoverOpacity)}},"&:focus":{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / ${e.vars.palette.action.focusOpacity})`:(0,L.X4)(e.palette.primary.main,e.palette.action.focusOpacity),[`&.${T$.selected}`]:{willChange:"background-color",backgroundColor:(e.vars||e).palette.primary.dark}},[`&.${T$.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}},[`&.${T$.disabled}:not(.${T$.selected})`]:{color:(e.vars||e).palette.text.disabled},[`&.${T$.disabled}&.${T$.selected}`]:{opacity:.6},variants:[{props:{disableMargin:!1},style:{margin:"0 2px"}},{props:{outsideCurrentMonth:!0,showDaysOutsideCurrentMonth:!0},style:{color:(e.vars||e).palette.text.secondary}},{props:{disableHighlightToday:!1,today:!0},style:{[`&:not(.${T$.selected})`]:{border:`1px solid ${(e.vars||e).palette.text.secondary}`}}}]}),TG=(e,t)=>{let{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]},Tq=(0,F.A)(ao.A,{name:"MuiPickersDay",slot:"Root",overridesResolver:TG})(TU),TY=(0,F.A)("div",{name:"MuiPickersDay",slot:"Root",overridesResolver:TG})(({theme:e})=>(0,dH.A)({},TU({theme:e}),{opacity:0,pointerEvents:"none"})),TK=()=>{},TX=R.forwardRef(function(e,t){let n=kI({props:e,name:"MuiPickersDay"}),{autoFocus:i=!1,className:r,day:o,disabled:s=!1,disableHighlightToday:l=!1,disableMargin:a=!1,isAnimating:u,onClick:c,onDaySelect:h,onFocus:d=TK,onBlur:f=TK,onKeyDown:p=TK,onMouseDown:m=TK,onMouseEnter:g=TK,outsideCurrentMonth:v,selected:b=!1,showDaysOutsideCurrentMonth:x=!1,children:y,today:w=!1}=n,S=(0,dz.A)(n,T_),C=(0,dH.A)({},n,{autoFocus:i,disabled:s,disableHighlightToday:l,disableMargin:a,selected:b,showDaysOutsideCurrentMonth:x,today:w}),A=(e=>{let{selected:t,disableMargin:n,disableHighlightToday:i,today:r,disabled:o,outsideCurrentMonth:s,showDaysOutsideCurrentMonth:l,classes:a}=e,u=s&&!l;return(0,P.A)({root:["root",t&&!u&&"selected",o&&"disabled",!n&&"dayWithMargin",!i&&r&&"today",s&&l&&"dayOutsideMonth",u&&"hiddenDaySpacingFiller"],hiddenDaySpacingFiller:["hiddenDaySpacingFiller"]},TW,a)})(C),k=kB().utils,M=R.useRef(null),T=(0,Tz.A)(M,t);return((0,MV.A)(()=>{!i||s||u||v||M.current.focus()},[i,s,u,v]),v&&!x)?(0,I.jsx)(TY,{className:(0,O.A)(A.root,A.hiddenDaySpacingFiller,r),ownerState:C,role:S.role}):(0,I.jsx)(Tq,(0,dH.A)({className:(0,O.A)(A.root,r),ref:T,centerRipple:!0,disabled:s,tabIndex:b?0:-1,onKeyDown:e=>p(e,o),onFocus:e=>d(e,o),onBlur:e=>f(e,o),onMouseEnter:e=>g(e,o),onClick:e=>{s||h(o),v&&e.currentTarget.focus(),c&&c(e)},onMouseDown:e=>{m(e),v&&e.preventDefault()}},S,{ownerState:C,children:y||k.format(o,"dayOfMonth")}))}),TZ=R.memo(TX);var TQ=n(7490);function TJ(e,t){return e.replace(RegExp("(^|\\s)"+t+"(?:\\s|$)","g"),"$1").replace(/\s+/g," ").replace(/^\s*|\s*$/g,"")}var T0=n(64863),T1=function(e,t){return e&&t&&t.split(" ").forEach(function(t){e.classList?e.classList.remove(t):"string"==typeof e.className?e.className=TJ(e.className,t):e.setAttribute("class",TJ(e.className&&e.className.baseVal||"",t))})},T2=function(e){function t(){for(var t,n=arguments.length,i=Array(n),r=0;r<n;r++)i[r]=arguments[r];return(t=e.call.apply(e,[this].concat(i))||this).appliedClasses={appear:{},enter:{},exit:{}},t.onEnter=function(e,n){var i=t.resolveArguments(e,n),r=i[0],o=i[1];t.removeClasses(r,"exit"),t.addClass(r,o?"appear":"enter","base"),t.props.onEnter&&t.props.onEnter(e,n)},t.onEntering=function(e,n){var i=t.resolveArguments(e,n),r=i[0],o=i[1];t.addClass(r,o?"appear":"enter","active"),t.props.onEntering&&t.props.onEntering(e,n)},t.onEntered=function(e,n){var i=t.resolveArguments(e,n),r=i[0],o=i[1]?"appear":"enter";t.removeClasses(r,o),t.addClass(r,o,"done"),t.props.onEntered&&t.props.onEntered(e,n)},t.onExit=function(e){var n=t.resolveArguments(e)[0];t.removeClasses(n,"appear"),t.removeClasses(n,"enter"),t.addClass(n,"exit","base"),t.props.onExit&&t.props.onExit(e)},t.onExiting=function(e){var n=t.resolveArguments(e)[0];t.addClass(n,"exit","active"),t.props.onExiting&&t.props.onExiting(e)},t.onExited=function(e){var n=t.resolveArguments(e)[0];t.removeClasses(n,"exit"),t.addClass(n,"exit","done"),t.props.onExited&&t.props.onExited(e)},t.resolveArguments=function(e,n){return t.props.nodeRef?[t.props.nodeRef.current,e]:[e,n]},t.getClassNames=function(e){var n=t.props.classNames,i="string"==typeof n,r=i&&n?n+"-":"",o=i?""+r+e:n[e],s=i?o+"-active":n[e+"Active"],l=i?o+"-done":n[e+"Done"];return{baseClassName:o,activeClassName:s,doneClassName:l}},t}(0,TQ.A)(t,e);var n=t.prototype;return n.addClass=function(e,t,n){var i,r=this.getClassNames(t)[n+"ClassName"],o=this.getClassNames("enter").doneClassName;"appear"===t&&"done"===n&&o&&(r+=" "+o),"active"===n&&e&&(0,T0.F)(e),r&&(this.appliedClasses[t][n]=r,i=r,e&&i&&i.split(" ").forEach(function(t){e.classList?e.classList.add(t):(e.classList?t&&e.classList.contains(t):-1!==(" "+(e.className.baseVal||e.className)+" ").indexOf(" "+t+" "))||("string"==typeof e.className?e.className=e.className+" "+t:e.setAttribute("class",(e.className&&e.className.baseVal||"")+" "+t))}))},n.removeClasses=function(e,t){var n=this.appliedClasses[t],i=n.base,r=n.active,o=n.done;this.appliedClasses[t]={},i&&T1(e,i),r&&T1(e,r),o&&T1(e,o)},n.render=function(){var e=this.props,t=(e.classNames,(0,dz.A)(e,["classNames"]));return E().createElement(h2.Ay,(0,dH.A)({},t,{onEnter:this.onEnter,onEntered:this.onEntered,onEntering:this.onEntering,onExit:this.onExit,onExiting:this.onExiting,onExited:this.onExited}))},t}(E().Component);T2.defaultProps={classNames:""},T2.propTypes={};let T5=e=>(0,W.Ay)("MuiPickersSlideTransition",e),T3=(0,z.A)("MuiPickersSlideTransition",["root","slideEnter-left","slideEnter-right","slideEnterActive","slideExit","slideExitActiveLeft-left","slideExitActiveLeft-right"]),T4=["children","className","reduceAnimations","slideDirection","transKey","classes"],T6=(0,F.A)(TB.A,{name:"MuiPickersSlideTransition",slot:"Root",overridesResolver:(e,t)=>[t.root,{[`.${T3["slideEnter-left"]}`]:t["slideEnter-left"]},{[`.${T3["slideEnter-right"]}`]:t["slideEnter-right"]},{[`.${T3.slideEnterActive}`]:t.slideEnterActive},{[`.${T3.slideExit}`]:t.slideExit},{[`.${T3["slideExitActiveLeft-left"]}`]:t["slideExitActiveLeft-left"]},{[`.${T3["slideExitActiveLeft-right"]}`]:t["slideExitActiveLeft-right"]}]})(({theme:e})=>{let 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},[`& .${T3["slideEnter-left"]}`]:{willChange:"transform",transform:"translate(100%)",zIndex:1},[`& .${T3["slideEnter-right"]}`]:{willChange:"transform",transform:"translate(-100%)",zIndex:1},[`& .${T3.slideEnterActive}`]:{transform:"translate(0%)",transition:t},[`& .${T3.slideExit}`]:{transform:"translate(0%)"},[`& .${T3["slideExitActiveLeft-left"]}`]:{willChange:"transform",transform:"translate(-100%)",transition:t,zIndex:0},[`& .${T3["slideExitActiveLeft-right"]}`]:{willChange:"transform",transform:"translate(100%)",transition:t,zIndex:0}}}),T8=e=>(0,W.Ay)("MuiDayCalendar",e);(0,z.A)("MuiDayCalendar",["root","header","weekDayLabel","loadingContainer","slideTransition","monthContainer","weekContainer","weekNumberLabel","weekNumber"]);let T9=["parentProps","day","focusableDay","selectedDays","isDateDisabled","currentMonthNumber","isViewFocused"],T7=["ownerState"],De=(0,F.A)("div",{name:"MuiDayCalendar",slot:"Root",overridesResolver:(e,t)=>t.root})({}),Dt=(0,F.A)("div",{name:"MuiDayCalendar",slot:"Header",overridesResolver:(e,t)=>t.header})({display:"flex",justifyContent:"center",alignItems:"center"}),Dn=(0,F.A)(uL.A,{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})),Di=(0,F.A)(uL.A,{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})),Dr=(0,F.A)(uL.A,{name:"MuiDayCalendar",slot:"WeekNumber",overridesResolver:(e,t)=>t.weekNumber})(({theme:e})=>(0,dH.A)({},e.typography.caption,{width:36,height:36,padding:0,margin:"0 2px",color:e.palette.text.disabled,fontSize:"0.75rem",alignItems:"center",justifyContent:"center",display:"inline-flex"})),Do=(0,F.A)("div",{name:"MuiDayCalendar",slot:"LoadingContainer",overridesResolver:(e,t)=>t.loadingContainer})({display:"flex",justifyContent:"center",alignItems:"center",minHeight:240}),Ds=(0,F.A)(function(e){let t=kI({props:e,name:"MuiPickersSlideTransition"}),{children:n,className:i,reduceAnimations:r,transKey:o}=t,s=(0,dz.A)(t,T4),l=(e=>{let{classes:t,slideDirection:n}=e,i={root:["root"],exit:["slideExit"],enterActive:["slideEnterActive"],enter:[`slideEnter-${n}`],exitActive:[`slideExitActiveLeft-${n}`]};return(0,P.A)(i,T5,t)})(t),a=(0,r7.A)();if(r)return(0,I.jsx)("div",{className:(0,O.A)(l.root,i),children:n});let u={exit:l.exit,enterActive:l.enterActive,enter:l.enter,exitActive:l.exitActive};return(0,I.jsx)(T6,{className:(0,O.A)(l.root,i),childFactory:e=>R.cloneElement(e,{classNames:u}),role:"presentation",children:(0,I.jsx)(T2,(0,dH.A)({mountOnEnter:!0,unmountOnExit:!0,timeout:a.transitions.duration.complex,classNames:u},s,{children:n}),o)})},{name:"MuiDayCalendar",slot:"SlideTransition",overridesResolver:(e,t)=>t.slideTransition})({minHeight:240}),Dl=(0,F.A)("div",{name:"MuiDayCalendar",slot:"MonthContainer",overridesResolver:(e,t)=>t.monthContainer})({overflow:"hidden"}),Da=(0,F.A)("div",{name:"MuiDayCalendar",slot:"WeekContainer",overridesResolver:(e,t)=>t.weekContainer})({margin:"2px 0",display:"flex",justifyContent:"center"});function Du(e){let{parentProps:t,day:n,focusableDay:i,selectedDays:r,isDateDisabled:o,currentMonthNumber:s,isViewFocused:l}=e,a=(0,dz.A)(e,T9),{disabled:u,disableHighlightToday:c,isMonthSwitchingAnimating:h,showDaysOutsideCurrentMonth:d,slots:f,slotProps:p,timezone:m}=t,g=kB().utils,v=kF(m),b=null!==i&&g.isSameDay(n,i),x=r.some(e=>g.isSameDay(e,n)),y=g.isSameDay(n,v),w=f?.day??TZ,S=(0,Mk.A)({elementType:w,externalSlotProps:p?.day,additionalProps:(0,dH.A)({disableHighlightToday:c,showDaysOutsideCurrentMonth:d,role:"gridcell",isAnimating:h,"data-timestamp":g.toJsDate(n).valueOf()},a),ownerState:(0,dH.A)({},t,{day:n,selected:x})}),C=(0,dz.A)(S,T7),A=R.useMemo(()=>u||o(n),[u,o,n]),k=R.useMemo(()=>g.getMonth(n)!==s,[g,n,s]),M=R.useMemo(()=>{let e=g.startOfMonth(g.setMonth(n,s));return d?g.isSameDay(n,g.startOfWeek(e)):g.isSameDay(n,e)},[s,n,d,g]),T=R.useMemo(()=>{let e=g.endOfMonth(g.setMonth(n,s));return d?g.isSameDay(n,g.endOfWeek(e)):g.isSameDay(n,e)},[s,n,d,g]);return(0,I.jsx)(w,(0,dH.A)({},C,{day:n,disabled:A,autoFocus:l&&b,today:y,outsideCurrentMonth:k,isFirstVisibleCell:M,isLastVisibleCell:T,selected:x,tabIndex:b?0:-1,"aria-selected":x,"aria-current":y?"date":void 0}))}function Dc(e){let t,n=kI({props:e,name:"MuiDayCalendar"}),i=kB().utils,{onFocusedDayChange:r,className:o,currentMonth:s,selectedDays:l,focusedDay:a,loading:u,onSelectedDaysChange:c,onMonthSwitchingAnimationEnd:h,readOnly:d,reduceAnimations:f,renderLoading:p=()=>(0,I.jsx)("span",{children:"..."}),slideDirection:m,TransitionProps:g,disablePast:v,disableFuture:b,minDate:x,maxDate:y,shouldDisableDate:w,shouldDisableMonth:S,shouldDisableYear:C,dayOfWeekFormatter:A=e=>i.format(e,"weekdayShort").charAt(0).toUpperCase(),hasFocus:k,onFocusedViewChange:M,gridLabelId:T,displayWeekNumber:D,fixedWeekNumber:E,autoFocus:L,timezone:j}=n,B=kF(j),F=(e=>{let{classes:t}=e;return(0,P.A)({root:["root"],header:["header"],weekDayLabel:["weekDayLabel"],loadingContainer:["loadingContainer"],slideTransition:["slideTransition"],monthContainer:["monthContainer"],weekContainer:["weekContainer"],weekNumberLabel:["weekNumberLabel"],weekNumber:["weekNumber"]},T8,t)})(n),N=(0,uf.I)(),V=Tj({shouldDisableDate:w,shouldDisableMonth:S,shouldDisableYear:C,minDate:x,maxDate:y,disablePast:v,disableFuture:b,timezone:j}),H=kB().localeText,[z,W]=(0,Mj.A)({name:"DayCalendar",state:"hasFocus",controlled:k,default:L??!1}),[$,_]=R.useState(()=>a||B),U=(0,ML.A)(e=>{d||c(e)}),G=e=>{V(e)||(r(e),_(e),M?.(!0),W(!0))},q=(0,ML.A)((e,t)=>{switch(e.key){case"ArrowUp":G(i.addDays(t,-7)),e.preventDefault();break;case"ArrowDown":G(i.addDays(t,7)),e.preventDefault();break;case"ArrowLeft":{let n=i.addDays(t,N?1:-1),r=i.addMonths(t,N?1:-1);G(kV({utils:i,date:n,minDate:N?n:i.startOfMonth(r),maxDate:N?i.endOfMonth(r):n,isDateDisabled:V,timezone:j})||n),e.preventDefault();break}case"ArrowRight":{let n=i.addDays(t,N?-1:1),r=i.addMonths(t,N?-1:1);G(kV({utils:i,date:n,minDate:N?i.startOfMonth(r):n,maxDate:N?n:i.endOfMonth(r),isDateDisabled:V,timezone:j})||n),e.preventDefault();break}case"Home":G(i.startOfWeek(t)),e.preventDefault();break;case"End":G(i.endOfWeek(t)),e.preventDefault();break;case"PageUp":G(i.addMonths(t,1)),e.preventDefault();break;case"PageDown":G(i.addMonths(t,-1)),e.preventDefault()}}),Y=(0,ML.A)((e,t)=>G(t)),K=(0,ML.A)((e,t)=>{z&&i.isSameDay($,t)&&M?.(!1)}),X=i.getMonth(s),Z=i.getYear(s),Q=R.useMemo(()=>l.filter(e=>!!e).map(e=>i.startOfDay(e)),[i,l]),J=`${Z}-${X}`,ee=R.useMemo(()=>R.createRef(),[J]),et=R.useMemo(()=>{let e=i.startOfMonth(s),t=i.endOfMonth(s);return V($)||i.isAfterDay($,t)||i.isBeforeDay($,e)?kV({utils:i,date:$,minDate:e,maxDate:t,disablePast:v,disableFuture:b,isDateDisabled:V,timezone:j}):$},[s,b,v,$,V,i,j]),en=R.useMemo(()=>{let e=i.getWeekArray(s),t=i.addMonths(s,1);for(;E&&e.length<E;){let n=i.getWeekArray(t),r=i.isSameDay(e[e.length-1][0],n[0][0]);n.slice(+!!r).forEach(t=>{e.length<E&&e.push(t)}),t=i.addMonths(t,1)}return e},[s,E,i]);return(0,I.jsxs)(De,{role:"grid","aria-labelledby":T,className:F.root,children:[(0,I.jsxs)(Dt,{role:"row",className:F.header,children:[D&&(0,I.jsx)(Di,{variant:"caption",role:"columnheader","aria-label":H.calendarWeekNumberHeaderLabel,className:F.weekNumberLabel,children:H.calendarWeekNumberHeaderText}),(t=i.startOfWeek(B),[0,1,2,3,4,5,6].map(e=>i.addDays(t,e))).map((e,t)=>(0,I.jsx)(Dn,{variant:"caption",role:"columnheader","aria-label":i.format(e,"weekday"),className:F.weekDayLabel,children:A(e)},t.toString()))]}),u?(0,I.jsx)(Do,{className:F.loadingContainer,children:p()}):(0,I.jsx)(Ds,(0,dH.A)({transKey:J,onExited:h,reduceAnimations:f,slideDirection:m,className:(0,O.A)(o,F.slideTransition)},g,{nodeRef:ee,children:(0,I.jsx)(Dl,{ref:ee,role:"rowgroup",className:F.monthContainer,children:en.map((e,t)=>(0,I.jsxs)(Da,{role:"row",className:F.weekContainer,"aria-rowindex":t+1,children:[D&&(0,I.jsx)(Dr,{className:F.weekNumber,role:"rowheader","aria-label":H.calendarWeekNumberAriaLabelText(i.getWeekNumber(e[0])),children:H.calendarWeekNumberText(i.getWeekNumber(e[0]))}),e.map((e,t)=>(0,I.jsx)(Du,{parentProps:n,day:e,selectedDays:Q,focusableDay:et,onKeyDown:q,onFocus:Y,onBlur:K,onDaySelect:U,isDateDisabled:V,currentMonthNumber:X,isViewFocused:z,"aria-colindex":t+1},e.toString()))]},`week-${e[0]}`))})}))]})}function Dh(e){return(0,W.Ay)("MuiPickersMonth",e)}let Dd=(0,z.A)("MuiPickersMonth",["root","monthButton","disabled","selected"]),Df=["autoFocus","className","children","disabled","selected","value","tabIndex","onClick","onKeyDown","onFocus","onBlur","aria-current","aria-label","monthsPerRow","slots","slotProps"],Dp=(0,F.A)("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%"}}]}),Dm=(0,F.A)("button",{name:"MuiPickersMonth",slot:"MonthButton",overridesResolver:(e,t)=>[t.monthButton,{[`&.${Dd.disabled}`]:t.disabled},{[`&.${Dd.selected}`]:t.selected}]})(({theme:e})=>(0,dH.A)({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})`:(0,L.X4)(e.palette.action.active,e.palette.action.hoverOpacity)},"&:hover":{backgroundColor:e.vars?`rgba(${e.vars.palette.action.activeChannel} / ${e.vars.palette.action.hoverOpacity})`:(0,L.X4)(e.palette.action.active,e.palette.action.hoverOpacity)},"&:disabled":{cursor:"auto",pointerEvents:"none"},[`&.${Dd.disabled}`]:{color:(e.vars||e).palette.text.secondary},[`&.${Dd.selected}`]:{color:(e.vars||e).palette.primary.contrastText,backgroundColor:(e.vars||e).palette.primary.main,"&:focus, &:hover":{backgroundColor:(e.vars||e).palette.primary.dark}}})),Dg=R.memo(function(e){let t=kI({props:e,name:"MuiPickersMonth"}),{autoFocus:n,className:i,children:r,disabled:o,selected:s,value:l,tabIndex:a,onClick:u,onKeyDown:c,onFocus:h,onBlur:d,"aria-current":f,"aria-label":p,slots:m,slotProps:g}=t,v=(0,dz.A)(t,Df),b=R.useRef(null),x=(e=>{let{disabled:t,selected:n,classes:i}=e;return(0,P.A)({root:["root"],monthButton:["monthButton",t&&"disabled",n&&"selected"]},Dh,i)})(t);(0,MV.A)(()=>{n&&b.current?.focus()},[n]);let y=m?.monthButton??Dm,w=(0,Mk.A)({elementType:y,externalSlotProps:g?.monthButton,additionalProps:{children:r,disabled:o,tabIndex:a,ref:b,type:"button",role:"radio","aria-current":f,"aria-checked":s,"aria-label":p,onClick:e=>u(e,l),onKeyDown:e=>c(e,l),onFocus:e=>h(e,l),onBlur:e=>d(e,l)},ownerState:t,className:x.monthButton});return(0,I.jsx)(Dp,(0,dH.A)({className:(0,O.A)(x.root,i),ownerState:t},v,{children:(0,I.jsx)(y,(0,dH.A)({},w))}))});function Dv(e){return(0,W.Ay)("MuiMonthCalendar",e)}(0,z.A)("MuiMonthCalendar",["root"]);let Db=["className","value","defaultValue","referenceDate","disabled","disableFuture","disablePast","maxDate","minDate","onChange","shouldDisableMonth","readOnly","disableHighlightToday","autoFocus","onMonthFocus","hasFocus","onFocusedViewChange","monthsPerRow","timezone","gridLabelId","slots","slotProps"],Dx=(0,F.A)("div",{name:"MuiMonthCalendar",slot:"Root",overridesResolver:(e,t)=>t.root})({display:"flex",flexWrap:"wrap",alignContent:"stretch",padding:"0 4px",width:320,boxSizing:"border-box"}),Dy=R.forwardRef(function(e,t){let n,i,r,o=(n=kB().utils,i=kB().defaultDates,r=kI({props:e,name:"MuiMonthCalendar"}),(0,dH.A)({disableFuture:!1,disablePast:!1},r,{minDate:kH(n,r.minDate,i.minDate),maxDate:kH(n,r.maxDate,i.maxDate)})),{className:s,value:l,defaultValue:a,referenceDate:u,disabled:c,disableFuture:h,disablePast:d,maxDate:f,minDate:p,onChange:m,shouldDisableMonth:g,readOnly:v,autoFocus:b=!1,onMonthFocus:x,hasFocus:y,onFocusedViewChange:w,monthsPerRow:S=3,timezone:C,gridLabelId:A,slots:k,slotProps:M}=o,T=(0,dz.A)(o,Db),{value:D,handleValueChange:E,timezone:L}=Ts({name:"MonthCalendar",timezone:C,value:l,defaultValue:a,referenceDate:u,onChange:m,valueManager:TM}),j=kF(L),B=(0,uf.I)(),F=kB().utils,N=R.useMemo(()=>TM.getInitialReferenceValue({value:D,utils:F,props:o,timezone:L,referenceDate:u,granularity:Tl.month}),[]),V=(e=>{let{classes:t}=e;return(0,P.A)({root:["root"]},Dv,t)})(o),H=R.useMemo(()=>F.getMonth(j),[F,j]),z=R.useMemo(()=>null!=D?F.getMonth(D):null,[D,F]),[W,$]=R.useState(()=>z||F.getMonth(N)),[_,U]=(0,Mj.A)({name:"MonthCalendar",state:"hasFocus",controlled:y,default:b??!1}),G=(0,ML.A)(e=>{U(e),w&&w(e)}),q=R.useCallback(e=>{let t=F.startOfMonth(d&&F.isAfter(j,p)?j:p),n=F.startOfMonth(h&&F.isBefore(j,f)?j:f),i=F.startOfMonth(e);return!!(F.isBefore(i,t)||F.isAfter(i,n))||!!g&&g(i)},[h,d,f,p,j,g,F]),Y=(0,ML.A)((e,t)=>{v||E(F.setMonth(D??N,t))}),K=(0,ML.A)(e=>{!q(F.setMonth(D??N,e))&&($(e),G(!0),x&&x(e))});R.useEffect(()=>{$(e=>null!==z&&e!==z?z:e)},[z]);let X=(0,ML.A)((e,t)=>{switch(e.key){case"ArrowUp":K((12+t-3)%12),e.preventDefault();break;case"ArrowDown":K((12+t+3)%12),e.preventDefault();break;case"ArrowLeft":K((12+t+(B?1:-1))%12),e.preventDefault();break;case"ArrowRight":K((12+t+(B?-1:1))%12),e.preventDefault()}}),Z=(0,ML.A)((e,t)=>{K(t)}),Q=(0,ML.A)((e,t)=>{W===t&&G(!1)});return(0,I.jsx)(Dx,(0,dH.A)({ref:t,className:(0,O.A)(V.root,s),ownerState:o,role:"radiogroup","aria-labelledby":A},T,{children:kz(F,D??N).map(e=>{let t=F.getMonth(e),n=F.format(e,"monthShort"),i=F.format(e,"month"),r=c||q(e);return(0,I.jsx)(Dg,{selected:t===z,value:t,onClick:Y,onKeyDown:X,autoFocus:_&&t===W,disabled:r,tabIndex:t!==W||r?-1:0,onFocus:Z,onBlur:Q,"aria-current":H===t?"date":void 0,"aria-label":i,monthsPerRow:S,slots:k,slotProps:M,children:n},n)})}))});function Dw(e){return(0,W.Ay)("MuiPickersYear",e)}let DS=(0,z.A)("MuiPickersYear",["root","yearButton","selected","disabled"]),DC=["autoFocus","className","children","disabled","selected","value","tabIndex","onClick","onKeyDown","onFocus","onBlur","aria-current","yearsPerRow","slots","slotProps"],DA=(0,F.A)("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%"}}]}),Dk=(0,F.A)("button",{name:"MuiPickersYear",slot:"YearButton",overridesResolver:(e,t)=>[t.yearButton,{[`&.${DS.disabled}`]:t.disabled},{[`&.${DS.selected}`]:t.selected}]})(({theme:e})=>(0,dH.A)({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})`:(0,L.X4)(e.palette.action.active,e.palette.action.focusOpacity)},"&:hover":{backgroundColor:e.vars?`rgba(${e.vars.palette.action.activeChannel} / ${e.vars.palette.action.hoverOpacity})`:(0,L.X4)(e.palette.action.active,e.palette.action.hoverOpacity)},"&:disabled":{cursor:"auto",pointerEvents:"none"},[`&.${DS.disabled}`]:{color:(e.vars||e).palette.text.secondary},[`&.${DS.selected}`]:{color:(e.vars||e).palette.primary.contrastText,backgroundColor:(e.vars||e).palette.primary.main,"&:focus, &:hover":{backgroundColor:(e.vars||e).palette.primary.dark}}})),DM=R.memo(function(e){let t=kI({props:e,name:"MuiPickersYear"}),{autoFocus:n,className:i,children:r,disabled:o,selected:s,value:l,tabIndex:a,onClick:u,onKeyDown:c,onFocus:h,onBlur:d,"aria-current":f,slots:p,slotProps:m}=t,g=(0,dz.A)(t,DC),v=R.useRef(null),b=(e=>{let{disabled:t,selected:n,classes:i}=e;return(0,P.A)({root:["root"],yearButton:["yearButton",t&&"disabled",n&&"selected"]},Dw,i)})(t);(0,MV.A)(()=>{n&&v.current?.focus()},[n]);let x=p?.yearButton??Dk,y=(0,Mk.A)({elementType:x,externalSlotProps:m?.yearButton,additionalProps:{children:r,disabled:o,tabIndex:a,ref:v,type:"button",role:"radio","aria-current":f,"aria-checked":s,onClick:e=>u(e,l),onKeyDown:e=>c(e,l),onFocus:e=>h(e,l),onBlur:e=>d(e,l)},ownerState:t,className:b.yearButton});return(0,I.jsx)(DA,(0,dH.A)({className:(0,O.A)(b.root,i),ownerState:t},g,{children:(0,I.jsx)(x,(0,dH.A)({},y))}))});function DT(e){return(0,W.Ay)("MuiYearCalendar",e)}(0,z.A)("MuiYearCalendar",["root"]);let DD=["autoFocus","className","value","defaultValue","referenceDate","disabled","disableFuture","disablePast","maxDate","minDate","onChange","readOnly","shouldDisableYear","disableHighlightToday","onYearFocus","hasFocus","onFocusedViewChange","yearsOrder","yearsPerRow","timezone","gridLabelId","slots","slotProps"],DI=(0,F.A)("div",{name:"MuiYearCalendar",slot:"Root",overridesResolver:(e,t)=>t.root})({display:"flex",flexDirection:"row",flexWrap:"wrap",overflowY:"auto",height:"100%",padding:"0 4px",width:320,maxHeight:280,boxSizing:"border-box",position:"relative"}),DR=R.forwardRef(function(e,t){let n,i,r,o=(n=kB().utils,i=kB().defaultDates,r=kI({props:e,name:"MuiYearCalendar"}),(0,dH.A)({disablePast:!1,disableFuture:!1},r,{yearsPerRow:r.yearsPerRow??3,minDate:kH(n,r.minDate,i.minDate),maxDate:kH(n,r.maxDate,i.maxDate)})),{autoFocus:s,className:l,value:a,defaultValue:u,referenceDate:c,disabled:h,disableFuture:d,disablePast:f,maxDate:p,minDate:m,onChange:g,readOnly:v,shouldDisableYear:b,onYearFocus:x,hasFocus:y,onFocusedViewChange:w,yearsOrder:S="asc",yearsPerRow:C,timezone:A,gridLabelId:k,slots:M,slotProps:T}=o,D=(0,dz.A)(o,DD),{value:E,handleValueChange:L,timezone:j}=Ts({name:"YearCalendar",timezone:A,value:a,defaultValue:u,referenceDate:c,onChange:g,valueManager:TM}),B=kF(j),F=(0,uf.I)(),N=kB().utils,V=R.useMemo(()=>TM.getInitialReferenceValue({value:E,utils:N,props:o,timezone:j,referenceDate:c,granularity:Tl.year}),[]),H=(e=>{let{classes:t}=e;return(0,P.A)({root:["root"]},DT,t)})(o),z=R.useMemo(()=>N.getYear(B),[N,B]),W=R.useMemo(()=>null!=E?N.getYear(E):null,[E,N]),[$,_]=R.useState(()=>W||N.getYear(V)),[U,G]=(0,Mj.A)({name:"YearCalendar",state:"hasFocus",controlled:y,default:s??!1}),q=(0,ML.A)(e=>{G(e),w&&w(e)}),Y=R.useCallback(e=>!!(f&&N.isBeforeYear(e,B)||d&&N.isAfterYear(e,B)||m&&N.isBeforeYear(e,m)||p&&N.isAfterYear(e,p))||!!b&&b(N.startOfYear(e)),[d,f,p,m,B,b,N]),K=(0,ML.A)((e,t)=>{v||L(N.setYear(E??V,t))}),X=(0,ML.A)(e=>{Y(N.setYear(E??V,e))||(_(e),q(!0),x?.(e))});R.useEffect(()=>{_(e=>null!==W&&e!==W?W:e)},[W]);let Z="desc"!==S?+C:-1*C,Q=F&&"asc"===S||!F&&"desc"===S?-1:1,J=(0,ML.A)((e,t)=>{switch(e.key){case"ArrowUp":X(t-Z),e.preventDefault();break;case"ArrowDown":X(t+Z),e.preventDefault();break;case"ArrowLeft":X(t-Q),e.preventDefault();break;case"ArrowRight":X(t+Q),e.preventDefault()}}),ee=(0,ML.A)((e,t)=>{X(t)}),et=(0,ML.A)((e,t)=>{$===t&&q(!1)}),en=R.useRef(null),ei=(0,Tz.A)(t,en);R.useEffect(()=>{if(s||null===en.current)return;let e=en.current.querySelector('[tabindex="0"]');if(!e)return;let t=e.offsetHeight,n=e.offsetTop,i=en.current.clientHeight,r=en.current.scrollTop;t>i||n<r||(en.current.scrollTop=n+t-i/2-t/2)},[s]);let er=N.getYearRange([m,p]);return"desc"===S&&er.reverse(),(0,I.jsx)(DI,(0,dH.A)({ref:ei,className:(0,O.A)(H.root,l),ownerState:o,role:"radiogroup","aria-labelledby":k},D,{children:er.map(e=>{let t=N.getYear(e),n=h||Y(e);return(0,I.jsx)(DM,{selected:t===W,value:t,onClick:K,onKeyDown:J,autoFocus:U&&t===$,disabled:n,tabIndex:t!==$||n?-1:0,onFocus:ee,onBlur:et,"aria-current":z===t?"date":void 0,yearsPerRow:C,slots:M,slotProps:T,children:N.format(e,"year")},N.format(e,"year"))})}))}),DE=e=>(0,W.Ay)("MuiPickersCalendarHeader",e),DO=(0,z.A)("MuiPickersCalendarHeader",["root","labelContainer","label","switchViewButton","switchViewIcon"]),DP=["slots","slotProps","currentMonth","disabled","disableFuture","disablePast","maxDate","minDate","onMonthChange","onViewChange","view","reduceAnimations","views","labelId","className","timezone","format"],DL=["ownerState"],Dj=(0,F.A)("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}),DB=(0,F.A)("div",{name:"MuiPickersCalendarHeader",slot:"LabelContainer",overridesResolver:(e,t)=>t.labelContainer})(({theme:e})=>(0,dH.A)({display:"flex",overflow:"hidden",alignItems:"center",cursor:"pointer",marginRight:"auto"},e.typography.body1,{fontWeight:e.typography.fontWeightMedium})),DF=(0,F.A)("div",{name:"MuiPickersCalendarHeader",slot:"Label",overridesResolver:(e,t)=>t.label})({marginRight:6}),DN=(0,F.A)(Q.A,{name:"MuiPickersCalendarHeader",slot:"SwitchViewButton",overridesResolver:(e,t)=>t.switchViewButton})({marginRight:"auto",variants:[{props:{view:"year"},style:{[`.${DO.switchViewIcon}`]:{transform:"rotate(180deg)"}}}]}),DV=(0,F.A)(kK,{name:"MuiPickersCalendarHeader",slot:"SwitchViewIcon",overridesResolver:(e,t)=>t.switchViewIcon})(({theme:e})=>({willChange:"transform",transition:e.transitions.create("transform"),transform:"rotate(0deg)"})),DH=R.forwardRef(function(e,t){let n=kB().localeText,i=kB().utils,r=kI({props:e,name:"MuiPickersCalendarHeader"}),{slots:o,slotProps:s,currentMonth:l,disabled:a,disableFuture:u,disablePast:c,maxDate:h,minDate:d,onMonthChange:f,onViewChange:p,view:m,reduceAnimations:g,views:v,labelId:b,className:x,timezone:y,format:w=`${i.formats.month} ${i.formats.year}`}=r,S=(0,dz.A)(r,DP),C=(e=>{let{classes:t}=e;return(0,P.A)({root:["root"],labelContainer:["labelContainer"],label:["label"],switchViewButton:["switchViewButton"],switchViewIcon:["switchViewIcon"]},DE,t)})(r),A=o?.switchViewButton??DN,k=(0,Mk.A)({elementType:A,externalSlotProps:s?.switchViewButton,additionalProps:{size:"small","aria-label":n.calendarViewSwitchingButtonAriaLabel(m)},ownerState:r,className:C.switchViewButton}),M=o?.switchViewIcon??DV,T=(0,Mk.A)({elementType:M,externalSlotProps:s?.switchViewIcon,ownerState:r,className:C.switchViewIcon}),D=(0,dz.A)(T,DL),E=function(e,{disableFuture:t,maxDate:n,timezone:i}){let r=kB().utils;return R.useMemo(()=>{let o=r.date(void 0,i),s=r.startOfMonth(t&&r.isBefore(o,n)?o:n);return!r.isAfter(s,e)},[t,n,e,r,i])}(l,{disableFuture:u,maxDate:h,timezone:y}),L=function(e,{disablePast:t,minDate:n,timezone:i}){let r=kB().utils;return R.useMemo(()=>{let o=r.date(void 0,i),s=r.startOfMonth(t&&r.isAfter(o,n)?o:n);return!r.isBefore(s,e)},[t,n,e,r,i])}(l,{disablePast:c,minDate:d,timezone:y});if(1===v.length&&"year"===v[0])return null;let j=i.formatByString(l,w);return(0,I.jsxs)(Dj,(0,dH.A)({},S,{ownerState:r,className:(0,O.A)(C.root,x),ref:t,children:[(0,I.jsxs)(DB,{role:"presentation",onClick:()=>{if(1!==v.length&&p&&!a)if(2===v.length)p(v.find(e=>e!==m)||v[0]);else{let e=+(0===v.indexOf(m));p(v[e])}},ownerState:r,"aria-live":"polite",className:C.labelContainer,children:[(0,I.jsx)(TH,{reduceAnimations:g,transKey:j,children:(0,I.jsx)(DF,{id:b,ownerState:r,className:C.label,children:j})}),v.length>1&&!a&&(0,I.jsx)(A,(0,dH.A)({},k,{children:(0,I.jsx)(M,(0,dH.A)({},D))}))]}),(0,I.jsx)(TF.A,{in:"day"===m,appear:!g,enter:!g,children:(0,I.jsx)(MP,{slots:o,slotProps:s,onGoToPrevious:()=>f(i.addMonths(l,-1),"right"),isPreviousDisabled:L,previousLabel:n.previousMonth,onGoToNext:()=>f(i.addMonths(l,1),"left"),isNextDisabled:E,nextLabel:n.nextMonth})})]}))}),Dz="u">typeof navigator&&navigator.userAgent.match(/android\s(\d+)|OS\s(\d+)/i),DW=Dz&&Dz[1]?parseInt(Dz[1],10):null,D$=Dz&&Dz[2]?parseInt(Dz[2],10):null,D_=DW&&DW<10||D$&&D$<13||!1,DU=e=>(0,W.Ay)("MuiDateCalendar",e);(0,z.A)("MuiDateCalendar",["root","viewTransitionContainer"]);let DG=["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"],Dq=(0,F.A)(MF,{name:"MuiDateCalendar",slot:"Root",overridesResolver:(e,t)=>t.root})({display:"flex",flexDirection:"column",height:336}),DY=(0,F.A)(TH,{name:"MuiDateCalendar",slot:"ViewTransitionContainer",overridesResolver:(e,t)=>t.viewTransitionContainer})({}),DK=R.forwardRef(function(e,t){let n,i,r,o,s=kB().utils,l=(0,MA.A)(),a=(n=kB().utils,i=kB().defaultDates,r=(0,h0.A)("@media (prefers-reduced-motion: reduce)",{defaultMatches:!1})||D_,o=kI({props:e,name:"MuiDateCalendar"}),(0,dH.A)({},o,{loading:o.loading??!1,disablePast:o.disablePast??!1,disableFuture:o.disableFuture??!1,openTo:o.openTo??"day",views:o.views??["year","day"],reduceAnimations:o.reduceAnimations??r,renderLoading:o.renderLoading??(()=>(0,I.jsx)("span",{children:"..."})),minDate:kH(n,o.minDate,i.minDate),maxDate:kH(n,o.maxDate,i.maxDate)})),{autoFocus:u,onViewChange:c,value:h,defaultValue:d,referenceDate:f,disableFuture:p,disablePast:m,onChange:g,onYearChange:v,onMonthChange:b,reduceAnimations:x,shouldDisableDate:y,shouldDisableMonth:w,shouldDisableYear:S,view:C,views:A,openTo:k,className:M,disabled:T,readOnly:D,minDate:E,maxDate:L,disableHighlightToday:j,focusedView:B,onFocusedViewChange:F,showDaysOutsideCurrentMonth:N,fixedWeekNumber:V,dayOfWeekFormatter:H,slots:z,slotProps:W,loading:$,renderLoading:_,displayWeekNumber:U,yearsOrder:G,yearsPerRow:q,monthsPerRow:Y,timezone:K}=a,X=(0,dz.A)(a,DG),{value:Z,handleValueChange:Q,timezone:J}=Ts({name:"DateCalendar",timezone:K,value:h,defaultValue:d,referenceDate:f,onChange:g,valueManager:TM}),{view:ee,setView:et,focusedView:en,setFocusedView:ei,goToNextView:er,setValueAndGoToNextView:eo}=MB({view:C,views:A,openTo:k,onChange:Q,onViewChange:c,autoFocus:u,focusedView:B,onFocusedViewChange:F}),{referenceDate:es,calendarState:el,changeFocusedDay:ea,changeMonth:eu,handleChangeMonth:ec,isDateDisabled:eh,onMonthSwitchingAnimationEnd:ed}=(e=>{let t,{value:n,referenceDate:i,disableFuture:r,disablePast:o,disableSwitchToMonthOnDayFocus:s=!1,maxDate:l,minDate:a,onMonthChange:u,reduceAnimations:c,shouldDisableDate:h,timezone:d}=e,f=kB().utils,p=R.useRef((t=!!c,(e,n)=>{switch(n.type){case"changeMonth":return(0,dH.A)({},e,{slideDirection:n.direction,currentMonth:n.newMonth,isMonthSwitchingAnimating:!t});case"changeMonthTimezone":{let t=n.newTimezone;if(f.getTimezone(e.currentMonth)===t)return e;let i=f.setTimezone(e.currentMonth,t);return f.getMonth(i)!==f.getMonth(e.currentMonth)&&(i=f.setMonth(i,f.getMonth(e.currentMonth))),(0,dH.A)({},e,{currentMonth:i})}case"finishMonthSwitchingAnimation":return(0,dH.A)({},e,{isMonthSwitchingAnimating:!1});case"changeFocusedDay":{if(null!=e.focusedDay&&null!=n.focusedDay&&f.isSameDay(n.focusedDay,e.focusedDay))return e;let i=null!=n.focusedDay&&!s&&!f.isSameMonth(e.currentMonth,n.focusedDay);return(0,dH.A)({},e,{focusedDay:n.focusedDay,isMonthSwitchingAnimating:i&&!t&&!n.withoutMonthSwitchingAnimation,currentMonth:i?f.startOfMonth(n.focusedDay):e.currentMonth,slideDirection:null!=n.focusedDay&&f.isAfterDay(n.focusedDay,e.currentMonth)?"left":"right"})}default:throw Error("missing support")}})).current,m=R.useMemo(()=>TM.getInitialReferenceValue({value:n,utils:f,timezone:d,props:e,referenceDate:i,granularity:Tl.day}),[i,d]),[g,v]=R.useReducer(p,{isMonthSwitchingAnimating:!1,focusedDay:m,currentMonth:f.startOfMonth(m),slideDirection:"left"});R.useEffect(()=>{v({type:"changeMonthTimezone",newTimezone:f.getTimezone(m)})},[m,f]);let b=R.useCallback(e=>{v((0,dH.A)({type:"changeMonth"},e)),u&&u(e.newMonth)},[u]),x=R.useCallback(e=>{f.isSameMonth(e,g.currentMonth)||b({newMonth:f.startOfMonth(e),direction:f.isAfterDay(e,g.currentMonth)?"left":"right"})},[g.currentMonth,b,f]),y=Tj({shouldDisableDate:h,minDate:a,maxDate:l,disableFuture:r,disablePast:o,timezone:d}),w=R.useCallback(()=>{v({type:"finishMonthSwitchingAnimation"})},[]);return{referenceDate:m,calendarState:g,changeMonth:x,changeFocusedDay:(0,ML.A)((e,t)=>{y(e)||v({type:"changeFocusedDay",focusedDay:e,withoutMonthSwitchingAnimation:t})}),isDateDisabled:y,onMonthSwitchingAnimationEnd:w,handleChangeMonth:b}})({value:Z,referenceDate:f,reduceAnimations:x,onMonthChange:b,minDate:E,maxDate:L,shouldDisableDate:y,disablePast:m,disableFuture:p,timezone:J}),ef=T&&Z||E,ep=T&&Z||L,em=`${l}-grid-label`,eg=null!==en,ev=z?.calendarHeader??DH,eb=(0,Mk.A)({elementType:ev,externalSlotProps:W?.calendarHeader,additionalProps:{views:A,view:ee,currentMonth:el.currentMonth,onViewChange:et,onMonthChange:(e,t)=>ec({newMonth:e,direction:t}),minDate:ef,maxDate:ep,disabled:T,disablePast:m,disableFuture:p,reduceAnimations:x,timezone:J,labelId:em},ownerState:a}),ex=(0,ML.A)(e=>{let t=s.startOfMonth(e),n=s.endOfMonth(e),i=eh(e)?kV({utils:s,date:e,minDate:s.isBefore(E,t)?t:E,maxDate:s.isAfter(L,n)?n:L,disablePast:m,disableFuture:p,isDateDisabled:eh,timezone:J}):e;i?(eo(i,"finish"),b?.(t)):(er(),eu(t)),ea(i,!0)}),ey=(0,ML.A)(e=>{let t=s.startOfYear(e),n=s.endOfYear(e),i=eh(e)?kV({utils:s,date:e,minDate:s.isBefore(E,t)?t:E,maxDate:s.isAfter(L,n)?n:L,disablePast:m,disableFuture:p,isDateDisabled:eh,timezone:J}):e;i?(eo(i,"finish"),v?.(i)):(er(),eu(t)),ea(i,!0)}),ew=(0,ML.A)(e=>e?Q(kN(s,e,Z??es),"finish",ee):Q(e,"finish",ee));R.useEffect(()=>{null!=Z&&s.isValid(Z)&&eu(Z)},[Z]);let eS=(e=>{let{classes:t}=e;return(0,P.A)({root:["root"],viewTransitionContainer:["viewTransitionContainer"]},DU,t)})(a),eC={disablePast:m,disableFuture:p,maxDate:L,minDate:E},eA={disableHighlightToday:j,readOnly:D,disabled:T,timezone:J,gridLabelId:em,slots:z,slotProps:W},ek=R.useRef(ee);R.useEffect(()=>{ek.current!==ee&&(en===ek.current&&ei(ee,!0),ek.current=ee)},[en,ei,ee]);let eM=R.useMemo(()=>[Z],[Z]);return(0,I.jsxs)(Dq,(0,dH.A)({ref:t,className:(0,O.A)(eS.root,M),ownerState:a},X,{children:[(0,I.jsx)(ev,(0,dH.A)({},eb,{slots:z,slotProps:W})),(0,I.jsx)(DY,{reduceAnimations:x,className:eS.viewTransitionContainer,transKey:ee,ownerState:a,children:(0,I.jsxs)("div",{children:["year"===ee&&(0,I.jsx)(DR,(0,dH.A)({},eC,eA,{value:Z,onChange:ey,shouldDisableYear:S,hasFocus:eg,onFocusedViewChange:e=>ei("year",e),yearsOrder:G,yearsPerRow:q,referenceDate:es})),"month"===ee&&(0,I.jsx)(Dy,(0,dH.A)({},eC,eA,{hasFocus:eg,className:M,value:Z,onChange:ex,shouldDisableMonth:w,onFocusedViewChange:e=>ei("month",e),monthsPerRow:Y,referenceDate:es})),"day"===ee&&(0,I.jsx)(Dc,(0,dH.A)({},el,eC,eA,{onMonthSwitchingAnimationEnd:ed,onFocusedDayChange:ea,reduceAnimations:x,selectedDays:eM,onSelectedDaysChange:ew,shouldDisableDate:y,shouldDisableMonth:w,shouldDisableYear:S,hasFocus:eg,onFocusedViewChange:e=>ei("day",e),showDaysOutsideCurrentMonth:N,fixedWeekNumber:V,dayOfWeekFormatter:H,displayWeekNumber:U,loading:$,renderLoading:_}))]})})]}))}),DX=({view:e,onViewChange:t,views:n,focusedView:i,onFocusedViewChange:r,value:o,defaultValue:s,referenceDate:l,onChange:a,className:u,classes:c,disableFuture:h,disablePast:d,minDate:f,maxDate:p,shouldDisableDate:m,shouldDisableMonth:g,shouldDisableYear:v,reduceAnimations:b,onMonthChange:x,monthsPerRow:y,onYearChange:w,yearsOrder:S,yearsPerRow:C,slots:A,slotProps:k,loading:M,renderLoading:T,disableHighlightToday:D,readOnly:R,disabled:E,showDaysOutsideCurrentMonth:O,dayOfWeekFormatter:P,sx:L,autoFocus:j,fixedWeekNumber:B,displayWeekNumber:F,timezone:N})=>(0,I.jsx)(DK,{view:e,onViewChange:t,views:n.filter(kU),focusedView:i&&kU(i)?i:null,onFocusedViewChange:r,value:o,defaultValue:s,referenceDate:l,onChange:a,className:u,classes:c,disableFuture:h,disablePast:d,minDate:f,maxDate:p,shouldDisableDate:m,shouldDisableMonth:g,shouldDisableYear:v,reduceAnimations:b,onMonthChange:x,monthsPerRow:y,onYearChange:w,yearsOrder:S,yearsPerRow:C,slots:A,slotProps:k,loading:M,renderLoading:T,disableHighlightToday:D,readOnly:R,disabled:E,showDaysOutsideCurrentMonth:O,dayOfWeekFormatter:P,sx:L,autoFocus:j,fixedWeekNumber:B,displayWeekNumber:F,timezone:N});function DZ(e){let{props:t,validator:n,value:i,timezone:r,onError:o}=e,s=kB(),l=R.useRef(n.valueManager.defaultErrorState),a=n({adapter:s,value:i,timezone:r,props:t}),u=n.valueManager.hasError(a);return R.useEffect(()=>{o&&!n.valueManager.isSameError(a,l.current)&&o(a,i),l.current=a},[n,o,a,i]),{validationError:a,hasValidationError:u,getValidationErrorForNewValue:(0,ML.A)(e=>n({adapter:s,value:e,timezone:r,props:t}))}}let DQ=["className","sx"],DJ=(e=document)=>{let t=e.activeElement;return t?t.shadowRoot?DJ(t.shadowRoot):t:null};function D0(){return"u"<typeof window?"portrait":window.screen&&window.screen.orientation&&window.screen.orientation.angle?90===Math.abs(window.screen.orientation.angle)?"landscape":"portrait":window.orientation&&90===Math.abs(Number(window.orientation))?"landscape":"portrait"}function D1(e){return(0,W.Ay)("MuiPickersLayout",e)}let D2=(0,z.A)("MuiPickersLayout",["root","landscape","contentWrapper","toolbar","actionBar","tabs","shortcuts"]),D5=["onAccept","onClear","onCancel","onSetToday","actions"];function D3(e){let{onAccept:t,onClear:n,onCancel:i,onSetToday:r,actions:o}=e,s=(0,dz.A)(e,D5),l=kB().localeText;if(null==o||0===o.length)return null;let a=o?.map(e=>{switch(e){case"clear":return(0,I.jsx)(K.A,{onClick:n,children:l.clearButtonLabel},e);case"cancel":return(0,I.jsx)(K.A,{onClick:i,children:l.cancelButtonLabel},e);case"accept":return(0,I.jsx)(K.A,{onClick:t,children:l.okButtonLabel},e);case"today":return(0,I.jsx)(K.A,{onClick:r,children:l.todayButtonLabel},e);default:return null}});return(0,I.jsx)(cB.A,(0,dH.A)({},s,{children:a}))}var D4=n(76477),D6=n(79223),D8=n(6835);function D9(e){return(0,W.Ay)("MuiListItem",e)}function D7(e){return(0,W.Ay)("MuiListItemSecondaryAction",e)}(0,z.A)("MuiListItem",["root","container","dense","alignItemsFlexStart","divider","gutters","padding","secondaryAction"]),(0,z.A)("MuiListItemSecondaryAction",["root","disableGutters"]);let Ie=(0,F.A)("div",{name:"MuiListItemSecondaryAction",slot:"Root",overridesResolver:(e,t)=>{let{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}}]}),It=R.forwardRef(function(e,t){let n=(0,H.b)({props:e,name:"MuiListItemSecondaryAction"}),{className:i,...r}=n,o=R.useContext(aa.A),s={...n,disableGutters:o.disableGutters},l=(e=>{let{disableGutters:t,classes:n}=e;return(0,P.A)({root:["root",t&&"disableGutters"]},D7,n)})(s);return(0,I.jsx)(Ie,{className:(0,O.A)(l.root,i),ownerState:s,ref:t,...r})});It.muiName="ListItemSecondaryAction";let In=(0,F.A)("div",{name:"MuiListItem",slot:"Root",overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.root,n.dense&&t.dense,"flex-start"===n.alignItems&&t.alignItemsFlexStart,n.divider&&t.divider,!n.disableGutters&&t.gutters,!n.disablePadding&&t.padding,n.hasSecondaryAction&&t.secondaryAction]}})((0,N.A)(({theme:e})=>({display:"flex",justifyContent:"flex-start",alignItems:"center",position:"relative",textDecoration:"none",width:"100%",boxSizing:"border-box",textAlign:"left",variants:[{props:({ownerState:e})=>!e.disablePadding,style:{paddingTop:8,paddingBottom:8}},{props:({ownerState:e})=>!e.disablePadding&&e.dense,style:{paddingTop:4,paddingBottom:4}},{props:({ownerState:e})=>!e.disablePadding&&!e.disableGutters,style:{paddingLeft:16,paddingRight:16}},{props:({ownerState:e})=>!e.disablePadding&&!!e.secondaryAction,style:{paddingRight:48}},{props:({ownerState:e})=>!!e.secondaryAction,style:{[`& > .${ac.root}`]:{paddingRight:48}}},{props:{alignItems:"flex-start"},style:{alignItems:"flex-start"}},{props:({ownerState:e})=>e.divider,style:{borderBottom:`1px solid ${(e.vars||e).palette.divider}`,backgroundClip:"padding-box"}},{props:({ownerState:e})=>e.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:e})=>e.hasSecondaryAction,style:{paddingRight:48}}]}))),Ii=(0,F.A)("li",{name:"MuiListItem",slot:"Container",overridesResolver:(e,t)=>t.container})({position:"relative"}),Ir=R.forwardRef(function(e,t){let n=(0,H.b)({props:e,name:"MuiListItem"}),{alignItems:i="center",children:r,className:o,component:s,components:l={},componentsProps:a={},ContainerComponent:u="li",ContainerProps:{className:c,...h}={},dense:d=!1,disableGutters:f=!1,disablePadding:p=!1,divider:m=!1,secondaryAction:g,slotProps:v={},slots:b={},...x}=n,y=R.useContext(aa.A),w=R.useMemo(()=>({dense:d||y.dense||!1,alignItems:i,disableGutters:f}),[i,y.dense,d,f]),S=R.useRef(null),C=R.Children.toArray(r),A=C.length&&(0,D8.A)(C[C.length-1],["ListItemSecondaryAction"]),k={...n,alignItems:i,dense:w.dense,disableGutters:f,disablePadding:p,divider:m,hasSecondaryAction:A},M=(e=>{let{alignItems:t,classes:n,dense:i,disableGutters:r,disablePadding:o,divider:s,hasSecondaryAction:l}=e;return(0,P.A)({root:["root",i&&"dense",!r&&"gutters",!o&&"padding",s&&"divider","flex-start"===t&&"alignItemsFlexStart",l&&"secondaryAction"],container:["container"]},D9,n)})(k),T=(0,al.A)(S,t),D=b.root||l.Root||In,E=v.root||a.root||{},L={className:(0,O.A)(M.root,E.className,o),...x},j=s||"li";return A?(j=L.component||s?j:"div","li"===u&&("li"===j?j="div":"li"===L.component&&(L.component="div")),(0,I.jsx)(aa.A.Provider,{value:w,children:(0,I.jsxs)(Ii,{as:u,className:(0,O.A)(M.container,c),ref:T,ownerState:k,...h,children:[(0,I.jsx)(D,{...E,...!(0,D6.A)(D)&&{as:j,ownerState:{...k,...E.ownerState}},...L,children:C}),C.pop()]})})):(0,I.jsx)(aa.A.Provider,{value:w,children:(0,I.jsxs)(D,{...E,as:j,ref:T,...!(0,D6.A)(D)&&{ownerState:{...k,...E.ownerState}},...L,children:[C,g&&(0,I.jsx)(It,{children:g})]})})});var Io=n(47601);let Is=["items","changeImportance","isLandscape","onChange","isValid"],Il=["getValue"];function Ia(e){let{items:t,changeImportance:n="accept",onChange:i,isValid:r}=e,o=(0,dz.A)(e,Is);if(null==t||0===t.length)return null;let s=t.map(e=>{let{getValue:t}=e,o=(0,dz.A)(e,Il),s=t({isValid:r});return(0,dH.A)({},o,{label:o.label,onClick:()=>{i(s,n,o)},disabled:!r(s)})});return(0,I.jsx)(D4.A,(0,dH.A)({dense:!0,sx:[{maxHeight:336,maxWidth:200,overflow:"auto"},...Array.isArray(o.sx)?o.sx:[o.sx]]},o,{children:s.map(e=>(0,I.jsx)(Ir,{children:(0,I.jsx)(Io.A,(0,dH.A)({},e))},e.id??e.label))}))}let Iu=(0,F.A)("div",{name:"MuiPickersLayout",slot:"Root",overridesResolver:(e,t)=>t.root})({display:"grid",gridAutoColumns:"max-content auto max-content",gridAutoRows:"max-content auto max-content",[`& .${D2.actionBar}`]:{gridColumn:"1 / 4",gridRow:3},variants:[{props:{isLandscape:!0},style:{[`& .${D2.toolbar}`]:{gridColumn:1,gridRow:"2 / 3"},[`.${D2.shortcuts}`]:{gridColumn:"2 / 4",gridRow:1}}},{props:{isLandscape:!0,isRtl:!0},style:{[`& .${D2.toolbar}`]:{gridColumn:3}}},{props:{isLandscape:!1},style:{[`& .${D2.toolbar}`]:{gridColumn:"2 / 4",gridRow:1},[`& .${D2.shortcuts}`]:{gridColumn:1,gridRow:"2 / 3"}}},{props:{isLandscape:!1,isRtl:!0},style:{[`& .${D2.shortcuts}`]:{gridColumn:3}}}]}),Ic=(0,F.A)("div",{name:"MuiPickersLayout",slot:"ContentWrapper",overridesResolver:(e,t)=>t.contentWrapper})({gridColumn:2,gridRow:2,display:"flex",flexDirection:"column"}),Ih=R.forwardRef(function(e,t){let n=kI({props:e,name:"MuiPickersLayout"}),{toolbar:i,content:r,tabs:o,actionBar:s,shortcuts:l}=(e=>{let{wrapperVariant:t,onAccept:n,onClear:i,onCancel:r,onSetToday:o,view:s,views:l,onViewChange:a,value:u,onChange:c,onSelectShortcut:h,isValid:d,isLandscape:f,disabled:p,readOnly:m,children:g,slots:v,slotProps:b}=e,x=(e=>{let{classes:t,isLandscape:n}=e;return(0,P.A)({root:["root",n&&"landscape"],contentWrapper:["contentWrapper"],toolbar:["toolbar"],actionBar:["actionBar"],tabs:["tabs"],landscape:["landscape"],shortcuts:["shortcuts"]},D1,t)})(e),y=v?.actionBar??D3,w=(0,Mk.A)({elementType:y,externalSlotProps:b?.actionBar,additionalProps:{onAccept:n,onClear:i,onCancel:r,onSetToday:o,actions:"desktop"===t?[]:["cancel","accept"]},className:x.actionBar,ownerState:(0,dH.A)({},e,{wrapperVariant:t})}),S=(0,I.jsx)(y,(0,dH.A)({},w)),C=v?.toolbar,A=(0,Mk.A)({elementType:C,externalSlotProps:b?.toolbar,additionalProps:{isLandscape:f,onChange:c,value:u,view:s,onViewChange:a,views:l,disabled:p,readOnly:m},className:x.toolbar,ownerState:(0,dH.A)({},e,{wrapperVariant:t})}),k=null!==A.view&&C?(0,I.jsx)(C,(0,dH.A)({},A)):null,M=v?.tabs,T=s&&M?(0,I.jsx)(M,(0,dH.A)({view:s,onViewChange:a,className:x.tabs},b?.tabs)):null,D=v?.shortcuts??Ia,R=(0,Mk.A)({elementType:D,externalSlotProps:b?.shortcuts,additionalProps:{isValid:d,isLandscape:f,onChange:h},className:x.shortcuts,ownerState:{isValid:d,isLandscape:f,onChange:h,wrapperVariant:t}});return{toolbar:k,content:g,tabs:T,actionBar:S,shortcuts:s&&D?(0,I.jsx)(D,(0,dH.A)({},R)):null}})(n),{sx:a,className:u,isLandscape:c,wrapperVariant:h}=n,d=(e=>{let{isLandscape:t,classes:n}=e;return(0,P.A)({root:["root",t&&"landscape"],contentWrapper:["contentWrapper"]},D1,n)})(n);return(0,I.jsxs)(Iu,{ref:t,sx:a,className:(0,O.A)(d.root,u),ownerState:n,children:[c?l:i,c?i:l,(0,I.jsx)(Ic,{className:d.contentWrapper,children:"desktop"===h?(0,I.jsxs)(R.Fragment,{children:[r,o]}):(0,I.jsxs)(R.Fragment,{children:[o,r]})}),s]})}),Id=["props","ref"],If=(0,F.A)(Ih)(({theme:e})=>({overflow:"hidden",minWidth:320,backgroundColor:(e.vars||e).palette.background.paper})),Ip=({adapter:e,value:t,timezone:n,props:i})=>{if(null===t)return null;let{minTime:r,maxTime:o,minutesStep:s,shouldDisableTime:l,disableIgnoringDatePartForTimeValidation:a=!1,disablePast:u,disableFuture:c}=i,h=e.utils.date(void 0,n),d=Mp(a,e.utils);switch(!0){case!e.utils.isValid(t):return"invalidDate";case!!(r&&d(r,t)):return"minTime";case!!(o&&d(t,o)):return"maxTime";case!!(c&&e.utils.isAfter(t,h)):return"disableFuture";case!!(u&&e.utils.isBefore(t,h)):return"disablePast";case!!(l&&l(t,"hours")):return"shouldDisableTime-hours";case!!(l&&l(t,"minutes")):return"shouldDisableTime-minutes";case!!(l&&l(t,"seconds")):return"shouldDisableTime-seconds";case!!(s&&e.utils.getMinutes(t)%s!=0):return"minutesStep";default:return null}};Ip.valueManager=TM;let Im=({adapter:e,value:t,timezone:n,props:i})=>{let r=TL({adapter:e,value:t,timezone:n,props:i});return null!==r?r:Ip({adapter:e,value:t,timezone:n,props:i})};Im.valueManager=TM;let Ig=R.forwardRef(function(e,t){let n,i,r,o,s,l=(n=kB().utils,i=kB().defaultDates,o=(r=kI({props:e,name:"MuiStaticDateTimePicker"})).ampm??n.is12HourCycleInCurrentLocale(),s=R.useMemo(()=>r.localeText?.toolbarTitle==null?r.localeText:(0,dH.A)({},r.localeText,{dateTimePickerToolbarTitle:r.localeText.toolbarTitle}),[r.localeText]),(0,dH.A)({},r,(({openTo:e,defaultOpenTo:t,views:n,defaultViews:i})=>{let r,o=n??i;if(null!=e)r=e;else if(o.includes(t))r=t;else if(o.length>0)r=o[0];else throw Error("MUI X: The `views` prop must contain at least one view.");return{views:o,openTo:r}})({views:r.views,openTo:r.openTo,defaultViews:["year","day","hours","minutes"],defaultOpenTo:"day"}),{ampm:o,localeText:s,orientation:r.orientation??"portrait",disableIgnoringDatePartForTimeValidation:r.disableIgnoringDatePartForTimeValidation??!!(r.minDateTime||r.maxDateTime||r.disablePast||r.disableFuture),disableFuture:r.disableFuture??!1,disablePast:r.disablePast??!1,minDate:kH(n,r.minDateTime??r.minDate,i.minDate),maxDate:kH(n,r.maxDateTime??r.maxDate,i.maxDate),minTime:r.minDateTime??r.minTime,maxTime:r.maxDateTime??r.maxTime,slots:(0,dH.A)({toolbar:MC,tabs:k5},r.slots),slotProps:(0,dH.A)({},r.slotProps,{toolbar:(0,dH.A)({ampm:o},r.slotProps?.toolbar)})})),a=l.displayStaticWrapperAs??"mobile",u=l.ampmInClock??"desktop"===a,c=(0,dH.A)({day:DX,month:DX,year:DX,hours:TP,minutes:TP,seconds:TP},l.viewRenderers),{renderPicker:h}=(e=>{let{props:t,ref:n}=e,i=(0,dz.A)(e,Id),{localeText:r,slots:o,slotProps:s,className:l,sx:a,displayStaticWrapperAs:u,autoFocus:c}=t,{layoutProps:h,renderCurrentView:d}=(({props:e,valueManager:t,valueType:n,wrapperVariant:i,additionalViewProps:r,validator:o,autoFocusView:s,rendererInterceptor:l,fieldRef:a})=>{let u=(({props:e,valueManager:t,valueType:n,wrapperVariant:i,validator:r})=>{let{onAccept:o,onChange:s,value:l,defaultValue:a,closeOnSelect:u="desktop"===i,timezone:c,referenceDate:h}=e,{current:d}=R.useRef(a),{current:f}=R.useRef(void 0!==l),[p,m]=R.useState(c),g=kB().utils,v=kB(),{isOpen:b,setIsOpen:x}=(({open:e,onOpen:t,onClose:n})=>{let i=R.useRef("boolean"==typeof e).current,[r,o]=R.useState(!1);return R.useEffect(()=>{if(i){if("boolean"!=typeof e)throw Error("You must not mix controlling and uncontrolled mode for `open` prop");o(e)}},[i,e]),{isOpen:r,setIsOpen:R.useCallback(e=>{i||o(e),e&&t&&t(),!e&&n&&n()},[i,t,n])}})(e),{timezone:y,value:w,handleValueChange:S}=To({timezone:c,value:l,defaultValue:d,referenceDate:h,onChange:s,valueManager:t}),[C,A]=R.useState(()=>{let e;return{draft:e=void 0!==w?w:void 0!==d?d:t.emptyValue,lastPublishedValue:e,lastCommittedValue:e,lastControlledValue:l,hasBeenModifiedSinceMount:!1}}),k=t.getTimezone(g,C.draft);p!==c&&(m(c),c&&k&&c!==k&&A(e=>(0,dH.A)({},e,{draft:t.setTimezone(g,c,e.draft)})));let{getValidationErrorForNewValue:M}=DZ({props:e,validator:r,timezone:y,value:C.draft,onError:e.onError}),T=(0,ML.A)(e=>{let n={action:e,dateState:C,hasChanged:n=>!t.areValuesEqual(g,e.value,n),isControlled:f,closeOnSelect:u},i=(e=>{let{action:t,hasChanged:n,dateState:i,isControlled:r}=e,o=!r&&!i.hasBeenModifiedSinceMount;return"setValueFromField"===t.name||("setValueFromAction"===t.name?!!(o&&["accept","today","clear"].includes(t.pickerAction))||n(i.lastPublishedValue):("setValueFromView"===t.name&&"shallow"!==t.selectionState||"setValueFromShortcut"===t.name)&&(!!o||n(i.lastPublishedValue)))})(n),r=(e=>{let{action:t,hasChanged:n,dateState:i,isControlled:r,closeOnSelect:o}=e,s=!r&&!i.hasBeenModifiedSinceMount;return"setValueFromAction"===t.name?!!(s&&["accept","today","clear"].includes(t.pickerAction))||n(i.lastCommittedValue):"setValueFromView"===t.name&&"finish"===t.selectionState&&o?!!s||n(i.lastCommittedValue):"setValueFromShortcut"===t.name&&"accept"===t.changeImportance&&n(i.lastCommittedValue)})(n),s=(e=>{let{action:t,closeOnSelect:n}=e;return"setValueFromAction"===t.name||("setValueFromView"===t.name?"finish"===t.selectionState&&n:"setValueFromShortcut"===t.name&&"accept"===t.changeImportance)})(n);A(t=>(0,dH.A)({},t,{draft:e.value,lastPublishedValue:i?e.value:t.lastPublishedValue,lastCommittedValue:r?e.value:t.lastCommittedValue,hasBeenModifiedSinceMount:!0}));let l=null,a=()=>(l||(l={validationError:"setValueFromField"===e.name?e.context.validationError:M(e.value)},"setValueFromShortcut"===e.name&&(l.shortcut=e.shortcut)),l);i&&S(e.value,a()),r&&o&&o(e.value,a()),s&&x(!1)});if(C.lastControlledValue!==l){let e=t.areValuesEqual(g,C.draft,w);A(t=>(0,dH.A)({},t,{lastControlledValue:l},e?{}:{lastCommittedValue:w,lastPublishedValue:w,draft:w,hasBeenModifiedSinceMount:!0}))}let D=(0,ML.A)(()=>{T({value:t.emptyValue,name:"setValueFromAction",pickerAction:"clear"})}),I=(0,ML.A)(()=>{T({value:C.lastPublishedValue,name:"setValueFromAction",pickerAction:"accept"})}),E=(0,ML.A)(()=>{T({value:C.lastPublishedValue,name:"setValueFromAction",pickerAction:"dismiss"})}),O=(0,ML.A)(()=>{T({value:C.lastCommittedValue,name:"setValueFromAction",pickerAction:"cancel"})}),P=(0,ML.A)(()=>{T({value:t.getTodayValue(g,y,n),name:"setValueFromAction",pickerAction:"today"})}),L=(0,ML.A)(e=>{e.preventDefault(),x(!0)}),j=(0,ML.A)(e=>{e?.preventDefault(),x(!1)}),B=(0,ML.A)((e,t="partial")=>T({name:"setValueFromView",value:e,selectionState:t})),F=(0,ML.A)((e,t,n)=>T({name:"setValueFromShortcut",value:e,changeImportance:t,shortcut:n})),N=(0,ML.A)((e,t)=>T({name:"setValueFromField",value:e,context:t})),V={onClear:D,onAccept:I,onDismiss:E,onCancel:O,onSetToday:P,onOpen:L,onClose:j},H={value:C.draft,onChange:N},z=R.useMemo(()=>t.cleanValue(g,C.draft),[g,t,C.draft]),W=(0,dH.A)({},V,{value:z,onChange:B,onSelectShortcut:F,isValid:n=>{let i=r({adapter:v,value:n,timezone:y,props:e});return!t.hasError(i)}}),$=R.useMemo(()=>({onOpen:L,onClose:j,open:b}),[b,j,L]);return{open:b,fieldProps:H,viewProps:{value:z,onChange:B,onClose:j,open:b},layoutProps:W,actions:V,contextValue:$}})({props:e,valueManager:t,valueType:n,wrapperVariant:i,validator:o}),c=(({props:e,propsFromPickerValue:t,additionalViewProps:n,autoFocusView:i,rendererInterceptor:r,fieldRef:o})=>{let{onChange:s,open:l,onClose:a}=t,{view:u,views:c,openTo:h,onViewChange:d,viewRenderers:f,timezone:p}=e,m=(0,dz.A)(e,DQ),{view:g,setView:v,defaultView:b,focusedView:x,setFocusedView:y,setValueAndGoToNextView:w}=MB({view:u,views:c,openTo:h,onChange:s,onViewChange:d,autoFocus:i}),{hasUIView:S,viewModeLookup:C}=R.useMemo(()=>c.reduce((e,t)=>{let n;return n=null!=f[t]?"UI":"field",e.viewModeLookup[t]=n,"UI"===n&&(e.hasUIView=!0),e},{hasUIView:!1,viewModeLookup:{}}),[f,c]),A=R.useMemo(()=>c.reduce((e,t)=>null!=f[t]&&Mh(t)?e+1:e,0),[f,c]),k=C[g],M=(0,ML.A)(()=>"UI"===k),[T,D]=R.useState("UI"===k?g:null);return T!==g&&"UI"===C[g]&&D(g),(0,MV.A)(()=>{"field"===k&&l&&(a(),setTimeout(()=>{o?.current?.setSelectedSections(g),o?.current?.focusField(g)}))},[g]),(0,MV.A)(()=>{if(!l)return;let e=g;"field"===k&&null!=T&&(e=T),e!==b&&"UI"===C[e]&&"UI"===C[b]&&(e=b),e!==g&&v(e),y(e,!0)},[l]),{hasUIView:S,shouldRestoreFocus:M,layoutProps:{views:c,view:T,onViewChange:v},renderCurrentView:()=>{if(null==T)return null;let e=f[T];if(null==e)return null;let i=(0,dH.A)({},m,n,t,{views:c,timezone:p,onChange:w,view:T,onViewChange:v,focusedView:x,onFocusedViewChange:y,showViewSwitcher:A>1,timeViewsCount:A});return r?r(f,T,i):e(i)}}})({props:e,additionalViewProps:r,autoFocusView:s,fieldRef:a,propsFromPickerValue:u.viewProps,rendererInterceptor:l}),h=(({props:e,propsFromPickerValue:t,propsFromPickerViews:n,wrapperVariant:i})=>{let{orientation:r}=e,o=((e,t)=>{var n;let[i,r]=R.useState(D0);return(0,MV.A)(()=>{let e=()=>{r(D0())};return window.addEventListener("orientationchange",e),()=>{window.removeEventListener("orientationchange",e)}},[]),(Array.isArray(n=["hours","minutes","seconds"])?!n.every(t=>-1!==e.indexOf(t)):-1===e.indexOf(n))&&"landscape"===(t||i)})(n.views,r),s=(0,uf.I)();return{layoutProps:(0,dH.A)({},n,t,{isLandscape:o,isRtl:s,wrapperVariant:i,disabled:e.disabled,readOnly:e.readOnly})}})({props:e,wrapperVariant:i,propsFromPickerValue:u.layoutProps,propsFromPickerViews:c.layoutProps}),d=function(e){let{props:t,pickerValueResponse:n}=e;return R.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])}({props:e,pickerValueResponse:u});return{open:u.open,actions:u.actions,fieldProps:u.fieldProps,renderCurrentView:c.renderCurrentView,hasUIView:c.hasUIView,shouldRestoreFocus:c.shouldRestoreFocus,layoutProps:h.layoutProps,contextValue:u.contextValue,ownerState:d}})((0,dH.A)({},i,{props:t,autoFocusView:c??!1,additionalViewProps:{},wrapperVariant:u})),f=o?.layout??If;return{renderPicker:()=>(0,I.jsx)(kO,{localeText:r,children:(0,I.jsx)(f,(0,dH.A)({},h,s?.layout,{slots:o,slotProps:s,sx:[...Array.isArray(a)?a:[a],...Array.isArray(s?.layout?.sx)?s.layout.sx:[s?.layout?.sx]],className:(0,O.A)(l,s?.layout?.className),ref:n,children:d()}))})}})({props:(0,dH.A)({},l,{viewRenderers:c,displayStaticWrapperAs:a,ampmInClock:u,yearsPerRow:l.yearsPerRow??("mobile"===a?3:4),slotProps:(0,dH.A)({},l.slotProps,{tabs:(0,dH.A)({hidden:"desktop"===a},l.slotProps?.tabs),toolbar:(0,dH.A)({hidden:"desktop"===a,ampmInClock:u},l.slotProps?.toolbar)})}),valueManager:TM,valueType:"date-time",validator:Im,ref:t});return h()});Ig.propTypes={ampm:kL().bool,ampmInClock:kL().bool,autoFocus:kL().bool,className:kL().string,dayOfWeekFormatter:kL().func,defaultValue:kL().object,disabled:kL().bool,disableFuture:kL().bool,disableHighlightToday:kL().bool,disableIgnoringDatePartForTimeValidation:kL().bool,disablePast:kL().bool,displayStaticWrapperAs:kL().oneOf(["desktop","mobile"]),displayWeekNumber:kL().bool,fixedWeekNumber:kL().number,loading:kL().bool,localeText:kL().object,maxDate:kL().object,maxDateTime:kL().object,maxTime:kL().object,minDate:kL().object,minDateTime:kL().object,minTime:kL().object,minutesStep:kL().number,monthsPerRow:kL().oneOf([3,4]),onAccept:kL().func,onChange:kL().func,onClose:kL().func,onError:kL().func,onMonthChange:kL().func,onViewChange:kL().func,onYearChange:kL().func,openTo:kL().oneOf(["day","hours","minutes","month","seconds","year"]),orientation:kL().oneOf(["landscape","portrait"]),readOnly:kL().bool,reduceAnimations:kL().bool,referenceDate:kL().object,renderLoading:kL().func,shouldDisableDate:kL().func,shouldDisableMonth:kL().func,shouldDisableTime:kL().func,shouldDisableYear:kL().func,showDaysOutsideCurrentMonth:kL().bool,slotProps:kL().object,slots:kL().object,sx:kL().oneOfType([kL().arrayOf(kL().oneOfType([kL().func,kL().object,kL().bool])),kL().func,kL().object]),timezone:kL().string,value:kL().object,view:kL().oneOf(["day","hours","minutes","month","seconds","year"]),viewRenderers:kL().shape({day:kL().func,hours:kL().func,minutes:kL().func,month:kL().func,seconds:kL().func,year:kL().func}),views:kL().arrayOf(kL().oneOf(["day","hours","minutes","month","seconds","year"]).isRequired),yearsOrder:kL().oneOf(["asc","desc"]),yearsPerRow:kL().oneOf([3,4])};let Iv=({utils:e,date:t,shouldRespectLeadingZeros:n,localeText:i,localizedDigits:r,now:o,token:s,startSeparator:l})=>{if(""===s)throw Error("MUI X: Should not call `commitToken` with an empty token");let a=Tu(e,s),u=Ty(e,a.contentType,a.type,s),c=n?u:"digit"===a.contentType,h=null!=t&&e.isValid(t),d=h?e.formatByString(t,s):"",f=null;if(c)if(u)f=""===d?e.formatByString(o,s).length:d.length;else{if(null==a.maxLength)throw Error(`MUI X: The token ${s} should have a 'maxDigitNumber' property on it's adapter`);f=a.maxLength,h&&(d=Tp(Tg(Tf(d,r),f),r))}return(0,dH.A)({},a,{format:s,maxLength:f,value:d,placeholder:((e,t,n,i)=>{switch(n.type){case"year":return t.fieldYearPlaceholder({digitAmount:e.formatByString(e.date(void 0,"default"),i).length,format:i});case"month":return t.fieldMonthPlaceholder({contentType:n.contentType,format:i});case"day":return t.fieldDayPlaceholder({format:i});case"weekDay":return t.fieldWeekDayPlaceholder({contentType:n.contentType,format:i});case"hours":return t.fieldHoursPlaceholder({format:i});case"minutes":return t.fieldMinutesPlaceholder({format:i});case"seconds":return t.fieldSecondsPlaceholder({format:i});case"meridiem":return t.fieldMeridiemPlaceholder({format:i});default:return i}})(e,i,a,s),hasLeadingZerosInFormat:u,hasLeadingZerosInInput:c,startSeparator:l,endSeparator:"",modified:!1})},Ib=e=>{let t=(({utils:e,format:t})=>{let n=10,i=t,r=e.expandFormat(t);for(;r!==i;)if(i=r,r=e.expandFormat(i),(n-=1)<0)throw 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 r})(e);e.isRtl&&e.enableAccessibleFieldDOMStructure&&(t=t.split(" ").reverse().join(" "));let n=(({utils:e,expandedFormat:t})=>{let n=[],{start:i,end:r}=e.escapedCharacters,o=RegExp(`(\\${i}[^\\${r}]*\\${r})+`,"g"),s=null;for(;s=o.exec(t);)n.push({start:s.index,end:o.lastIndex-1});return n})((0,dH.A)({},e,{expandedFormat:t})),i=(e=>{let{utils:t,expandedFormat:n,escapedParts:i}=e,r=t.date(void 0),o=[],s="",l=Object.keys(t.formatTokenMap).sort((e,t)=>t.length-e.length),a=/^([a-zA-Z]+)/,u=RegExp(`^(${l.join("|")})*$`),c=RegExp(`^(${l.join("|")})`),h=e=>i.find(t=>t.start<=e&&t.end>=e),d=0;for(;d<n.length;){let t=h(d),i=null!=t,l=a.exec(n.slice(d))?.[1];if(!i&&null!=l&&u.test(l)){let t=l;for(;t.length>0;){let n=c.exec(t)[1];t=t.slice(n.length),o.push(Iv((0,dH.A)({},e,{now:r,token:n,startSeparator:s}))),s=""}d+=l.length}else{let e=n[d];i&&t?.start===d||t?.end===d||(0===o.length?s+=e:o[o.length-1].endSeparator+=e),d+=1}}return 0===o.length&&s.length>0&&o.push({type:"empty",contentType:"letter",maxLength:null,format:"",value:"",placeholder:"",hasLeadingZerosInFormat:!1,hasLeadingZerosInInput:!1,startSeparator:s,endSeparator:"",modified:!1}),o})((0,dH.A)({},e,{expandedFormat:t,escapedParts:n}));return(({isRtl:e,formatDensity:t,sections:n})=>n.map(n=>{let i=n=>{let i=n;return e&&null!==i&&i.includes(" ")&&(i=`\u2069${i}\u2066`),"spacious"===t&&["/",".","-"].includes(i)&&(i=` ${i} `),i};return n.startSeparator=i(n.startSeparator),n.endSeparator=i(n.endSeparator),n}))((0,dH.A)({},e,{sections:i}))},Ix=e=>{let{internalProps:{disabled:t,readOnly:n=!1},forwardedProps:{sectionListRef:i,onBlur:r,onClick:o,onFocus:s,onInput:l,onPaste:a,focused:u,autoFocus:c=!1},fieldValueManager:h,applyCharacterEditing:d,resetCharacterQuery:f,setSelectedSections:p,parsedSelectedSections:m,state:g,clearActiveSection:v,clearValue:b,updateSectionValue:x,updateValueFromValueStr:y,sectionOrder:w,areAllSectionsEmpty:S,sectionsValueBoundaries:C}=e,A=R.useRef(null),k=(0,Tz.A)(i,A),M=kB().localeText,T=kB().utils,D=(0,MA.A)(),[I,E]=R.useState(!1),O=R.useMemo(()=>({syncSelectionToDOM:()=>{let e;if(!A.current)return;let t=document.getSelection();if(!t)return;if(null==m){t.rangeCount>0&&A.current.getRoot().contains(t.getRangeAt(0).startContainer)&&t.removeAllRanges(),I&&A.current.getRoot().blur();return}if(!A.current.getRoot().contains(DJ(document)))return;let n=new window.Range;e="all"===m?A.current.getRoot():"empty"===g.sections[m].type?A.current.getSectionContainer(m):A.current.getSectionContent(m),n.selectNodeContents(e),e.focus(),t.removeAllRanges(),t.addRange(n)},getActiveSectionIndexFromDOM:()=>{let e=DJ(document);return e&&A.current&&A.current.getRoot().contains(e)?A.current.getSectionIndexFromDOMElement(e):null},focusField:(e=0)=>{if(!A.current||null!=O.getActiveSectionIndexFromDOM())return;let t=TA(e,g.sections);E(!0),A.current.getSectionContent(t).focus()},setSelectedSections:e=>{if(!A.current)return;let t=TA(e,g.sections);E(null!==("all"===t?0:t)),p(e)},isFieldFocused:()=>{let e=DJ(document);return!!A.current&&A.current.getRoot().contains(e)}}),[m,p,g.sections,I]),P=(0,ML.A)(e=>{if(!A.current)return;let t=g.sections[e];A.current.getSectionContent(e).innerHTML=t.value||t.placeholder,O.syncSelectionToDOM()}),L=(0,ML.A)((e,...t)=>{!e.isDefaultPrevented()&&A.current&&(E(!0),o?.(e,...t),"all"===m?setTimeout(()=>{let e=document.getSelection().getRangeAt(0).startOffset;if(0===e)return void p(w.startIndex);let t=0,n=0;for(;n<e&&t<g.sections.length;){let e=g.sections[t];t+=1,n+=`${e.startSeparator}${e.value||e.placeholder}${e.endSeparator}`.length}p(t-1)}):I?A.current.getRoot().contains(e.target)||p(w.startIndex):(E(!0),p(w.startIndex)))}),j=(0,ML.A)(e=>{if(l?.(e),!A.current||"all"!==m)return;let t=e.target.textContent??"";A.current.getRoot().innerHTML=g.sections.map(e=>`${e.startSeparator}${e.value||e.placeholder}${e.endSeparator}`).join(""),O.syncSelectionToDOM(),0===t.length||10===t.charCodeAt(0)?(f(),b(),p("all")):t.length>1?y(t):("all"===m&&p(0),d({keyPressed:t,sectionIndex:0}))}),B=(0,ML.A)(e=>{if(a?.(e),n||"all"!==m)return void e.preventDefault();let t=e.clipboardData.getData("text");e.preventDefault(),f(),y(t)}),F=(0,ML.A)((...e)=>{s?.(...e),I||!A.current||(E(!0),null==A.current.getSectionIndexFromDOMElement(DJ(document))&&p(w.startIndex))}),N=(0,ML.A)((...e)=>{r?.(...e),setTimeout(()=>{if(!A.current)return;let e=DJ(document);A.current.getRoot().contains(e)||(E(!1),p(null))})}),V=(0,ML.A)(e=>t=>{t.isDefaultPrevented()||p(e)}),H=(0,ML.A)(e=>{e.preventDefault()}),z=(0,ML.A)(e=>()=>{p(e)}),W=(0,ML.A)(e=>{if(e.preventDefault(),n||t||"number"!=typeof m)return;let i=g.sections[m],r=e.clipboardData.getData("text"),o=/^[a-zA-Z]+$/.test(r),s=/^[0-9]+$/.test(r),l=/^(([a-zA-Z]+)|)([0-9]+)(([a-zA-Z]+)|)$/.test(r);"letter"===i.contentType&&o||"digit"===i.contentType&&s||"digit-with-letter"===i.contentType&&l?(f(),x({activeSection:i,newSectionValue:r,shouldGoToNextSection:!0})):o||s||(f(),y(r))}),$=(0,ML.A)(e=>{e.preventDefault(),e.dataTransfer.dropEffect="none"}),_=(0,ML.A)(e=>{if(!A.current)return;let t=e.target,i=t.textContent??"",r=A.current.getSectionIndexFromDOMElement(t),o=g.sections[r];if(n||!A.current)return void P(r);if(0===i.length){if(""===o.value)return void P(r);let t=e.nativeEvent.inputType;return"insertParagraph"===t||"insertLineBreak"===t?void P(r):(f(),void v())}d({keyPressed:i,sectionIndex:r}),P(r)});(0,MV.A)(()=>{if(I&&A.current){if("all"===m)A.current.getRoot().focus();else if("number"==typeof m){let e=A.current.getSectionContent(m);e&&e.focus()}}},[m,I]);let U=R.useMemo(()=>g.sections.reduce((e,t)=>(e[t.type]=C[t.type]({currentDate:null,contentType:t.contentType,format:t.format}),e),{}),[C,g.sections]),G="all"===m,q=R.useMemo(()=>g.sections.map((e,i)=>{let r=!G&&!t&&!n;return{container:{"data-sectionindex":i,onClick:V(i)},content:{tabIndex:G||i>0?-1:0,contentEditable:!G&&!t&&!n,role:"spinbutton",id:`${D}-${e.type}`,"aria-labelledby":`${D}-${e.type}`,"aria-readonly":n,"aria-valuenow":((e,t)=>{if(e.value)switch(e.type){case"weekDay":if("letter"===e.contentType)return;return Number(e.value);case"meridiem":{let n=t.parse(`01:00 ${e.value}`,`${t.formats.hours12h}:${t.formats.minutes} ${e.format}`);if(n)return+(t.getHours(n)>=12);return}case"day":return"digit-with-letter"===e.contentType?parseInt(e.value,10):Number(e.value);case"month":{if("digit"===e.contentType)return Number(e.value);let n=t.parse(e.value,e.format);return n?t.getMonth(n)+1:void 0}default:return"letter"!==e.contentType?Number(e.value):void 0}})(e,T),"aria-valuemin":U[e.type].minimum,"aria-valuemax":U[e.type].maximum,"aria-valuetext":e.value?((e,t)=>{if(e.value)switch(e.type){case"month":{if("digit"===e.contentType)return t.format(t.setMonth(t.date(),Number(e.value)-1),"month");let n=t.parse(e.value,e.format);return n?t.format(n,"month"):void 0}case"day":return"digit"===e.contentType?t.format(t.setDate(t.startOfYear(t.date()),Number(e.value)),"dayOfMonthFull"):e.value;default:return}})(e,T):M.empty,"aria-label":M[e.type],"aria-disabled":t,spellCheck:!r&&void 0,autoCapitalize:r?"off":void 0,autoCorrect:r?"off":void 0,[parseInt(R.version,10)>=17?"enterKeyHint":"enterkeyhint"]:r?"next":void 0,children:e.value||e.placeholder,onInput:_,onPaste:W,onFocus:z(i),onDragOver:$,onMouseUp:H,inputMode:"letter"===e.contentType?"text":"numeric"},before:{children:e.startSeparator},after:{children:e.endSeparator}}}),[g.sections,z,W,$,_,V,H,t,n,G,M,T,U,D]),Y=(0,ML.A)(e=>{y(e.target.value)}),K=R.useMemo(()=>S?"":h.getV7HiddenInputValueFromSections(g.sections),[S,g.sections,h]);return R.useEffect(()=>{if(null==A.current)throw Error("MUI X: The `sectionListRef` prop has not been initialized by `PickersSectionList`\nYou probably tried to pass a component to the `textField` slot that contains an `<input />` element instead of a `PickersSectionList`.\n\nIf you want to keep using an `<input />` HTML element for the editing, please remove the `enableAccessibleFieldDOMStructure` prop from your picker or field component:\n\n<DatePicker slots={{ textField: MyCustomTextField }} />\n\nLearn 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");c&&A.current&&A.current.getSectionContent(w.startIndex).focus()},[]),{interactions:O,returnedValue:{autoFocus:c,readOnly:n,focused:u??I,sectionListRef:k,onBlur:N,onClick:L,onFocus:F,onInput:j,onPaste:B,enableAccessibleFieldDOMStructure:!0,elements:q,tabIndex:0===m?-1:0,contentEditable:G,value:K,onChange:Y,areAllSectionsEmpty:S}}},Iy=e=>e.replace(/[\u2066\u2067\u2068\u2069]/g,""),Iw=e=>{let t=(0,uf.I)(),n=R.useRef(void 0),i=R.useRef(void 0),{forwardedProps:{onFocus:r,onClick:o,onPaste:s,onBlur:l,inputRef:a,placeholder:u},internalProps:{readOnly:c=!1,disabled:h=!1},parsedSelectedSections:d,activeSectionIndex:f,state:p,fieldValueManager:m,valueManager:g,applyCharacterEditing:v,resetCharacterQuery:b,updateSectionValue:x,updateValueFromValueStr:y,clearActiveSection:w,clearValue:S,setTempAndroidValueStr:C,setSelectedSections:A,getSectionsFromValue:k,areAllSectionsEmpty:M,localizedDigits:T}=e,D=R.useRef(null),I=(0,Tz.A)(a,D),E=R.useMemo(()=>((e,t,n)=>{let i=0,r=+!!n,o=[];for(let s=0;s<e.length;s+=1){let l=e[s],a=Tb(l,n?"input-rtl":"input-ltr",t),u=`${l.startSeparator}${a}${l.endSeparator}`,c=Iy(u).length,h=u.length,d=Iy(a),f=r+(""===d?0:a.indexOf(d[0]))+l.startSeparator.length,p=f+d.length;o.push((0,dH.A)({},l,{start:i,end:i+c,startInInput:f,endInInput:p})),i+=c,r+=h}return o})(p.sections,T,t),[p.sections,T,t]),O=R.useMemo(()=>({syncSelectionToDOM:()=>{if(!D.current)return;if(null==d){D.current.scrollLeft&&(D.current.scrollLeft=0);return}if(D.current!==DJ(document))return;let e=D.current.scrollTop;if("all"===d)D.current.select();else{let e=E[d],t="empty"===e.type?e.startInInput-e.startSeparator.length:e.startInInput,n="empty"===e.type?e.endInInput+e.endSeparator.length:e.endInInput;(t!==D.current.selectionStart||n!==D.current.selectionEnd)&&D.current===DJ(document)&&D.current.setSelectionRange(t,n),clearTimeout(i.current),i.current=setTimeout(()=>{D.current&&D.current===DJ(document)&&D.current.selectionStart===D.current.selectionEnd&&(D.current.selectionStart!==t||D.current.selectionEnd!==n)&&O.syncSelectionToDOM()})}D.current.scrollTop=e},getActiveSectionIndexFromDOM:()=>{let e=D.current.selectionStart??0,t=D.current.selectionEnd??0;if(0===e&&0===t)return null;let n=e<=E[0].startInInput?1:E.findIndex(t=>t.startInInput-t.startSeparator.length>e);return -1===n?E.length-1:n-1},focusField:(e=0)=>{DJ(document)!==D.current&&(D.current?.focus(),A(e))},setSelectedSections:e=>A(e),isFieldFocused:()=>D.current===DJ(document)}),[D,d,E,A]),P=()=>{let e,t=D.current.selectionStart??0;A(-1===(e=t<=E[0].startInInput||t>=E[E.length-1].endInInput?1:E.findIndex(e=>e.startInInput-e.startSeparator.length>t))?E.length-1:e-1)},L=(0,ML.A)((...e)=>{r?.(...e);let t=D.current;clearTimeout(n.current),n.current=setTimeout(()=>{t&&t===D.current&&null==f&&(t.value.length&&Number(t.selectionEnd)-Number(t.selectionStart)===t.value.length?A("all"):P())})}),j=(0,ML.A)((e,...t)=>{e.isDefaultPrevented()||(o?.(e,...t),P())}),B=(0,ML.A)(e=>{if(s?.(e),e.preventDefault(),c||h)return;let t=e.clipboardData.getData("text");if("number"==typeof d){let e=p.sections[d],n=/^[a-zA-Z]+$/.test(t),i=/^[0-9]+$/.test(t),r=/^(([a-zA-Z]+)|)([0-9]+)(([a-zA-Z]+)|)$/.test(t);if("letter"===e.contentType&&n||"digit"===e.contentType&&i||"digit-with-letter"===e.contentType&&r){b(),x({activeSection:e,newSectionValue:t,shouldGoToNextSection:!0});return}if(n||i)return}b(),y(t)}),F=(0,ML.A)((...e)=>{l?.(...e),A(null)}),N=(0,ML.A)(e=>{let n;if(c)return;let i=e.target.value;if(""===i){b(),S();return}let r=e.nativeEvent.data,o=r&&r.length>1,s=o?r:i,l=Iy(s);if("all"===d&&A(f),null==f||o)return void y(o?r:l);if("all"===d&&1===l.length)n=l;else{let e=Iy(m.getV6InputValueFromSections(E,T,t)),i=-1,r=-1;for(let t=0;t<e.length;t+=1)-1===i&&e[t]!==l[t]&&(i=t),-1===r&&e[e.length-t-1]!==l[l.length-t-1]&&(r=t);let o=E[f];if(i<o.start||e.length-r-1>o.end)return;let s=l.length-e.length+o.end-Iy(o.endSeparator||"").length;n=l.slice(o.start+Iy(o.startSeparator||"").length,s)}if(0===n.length){navigator.userAgent.toLowerCase().includes("android")&&C(s),b(),w();return}v({keyPressed:n,sectionIndex:f})}),V=R.useMemo(()=>void 0!==u?u:m.getV6InputValueFromSections(k(g.emptyValue),T,t),[u,m,k,g.emptyValue,T,t]),H=R.useMemo(()=>p.tempValueStrAndroid??m.getV6InputValueFromSections(p.sections,T,t),[p.sections,m,p.tempValueStrAndroid,T,t]);return R.useEffect(()=>(D.current&&D.current===DJ(document)&&A("all"),()=>{clearTimeout(n.current),clearTimeout(i.current)}),[]),{interactions:O,returnedValue:{readOnly:c,onBlur:F,onClick:j,onFocus:L,onPaste:B,inputRef:I,enableAccessibleFieldDOMStructure:!1,placeholder:V,inputMode:R.useMemo(()=>null==f||"letter"===p.sections[f].contentType?"text":"numeric",[f,p.sections]),autoComplete:"off",value:!(D.current&&D.current===DJ(document))&&M?"":H,onChange:N}}},IS=["disablePast","disableFuture","minDate","maxDate","shouldDisableDate","shouldDisableMonth","shouldDisableYear"],IC=["disablePast","disableFuture","minTime","maxTime","shouldDisableTime","minutesStep","ampm","disableIgnoringDatePartForTimeValidation"],IA=["minDateTime","maxDateTime"];[...IS,...IC,...IA];let Ik=["value","defaultValue","referenceDate","format","formatDensity","onChange","timezone","onError","shouldRespectLeadingZeros","selectedSections","onSelectedSectionsChange","unstableFieldRef","enableAccessibleFieldDOMStructure","disabled","readOnly","dateSeparator"],IM=["clearable","onClear","InputProps","sx","slots","slotProps"],IT=["ownerState"];var ID=n(54227),II=n(75472);function IR(e){return(0,W.Ay)("MuiPickersTextField",e)}function IE(e){return(0,W.Ay)("MuiPickersInputBase",e)}(0,z.A)("MuiPickersTextField",["root","focused","disabled","error","required"]);let IO=(0,z.A)("MuiPickersInputBase",["root","focused","disabled","error","notchedOutline","sectionContent","sectionBefore","sectionAfter","adornedStart","adornedEnd","input"]);function IP(e){return(0,W.Ay)("MuiPickersOutlinedInput",e)}let IL=(0,dH.A)({},IO,(0,z.A)("MuiPickersOutlinedInput",["root","notchedOutline","input"])),Ij=["children","className","label","notched","shrink"],IB=(0,F.A)("fieldset",{name:"MuiPickersOutlinedInput",slot:"NotchedOutline",overridesResolver:(e,t)=>t.notchedOutline})(({theme:e})=>{let t="light"===e.palette.mode?"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}}),IF=(0,F.A)("span")(({theme:e})=>({fontFamily:e.typography.fontFamily,fontSize:"inherit"})),IN=(0,F.A)("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 IV(e){let{className:t,label:n}=e,i=(0,dz.A)(e,Ij),r=null!=n&&""!==n,o=(0,dH.A)({},e,{withLabel:r});return(0,I.jsx)(IB,(0,dH.A)({"aria-hidden":!0,className:t},i,{ownerState:o,children:(0,I.jsx)(IN,{ownerState:o,children:r?(0,I.jsx)(IF,{children:n}):(0,I.jsx)(IF,{className:"notranslate",children:""})})}))}var IH=n(85235),Iz=n(15841);function IW(e){return(0,W.Ay)("MuiPickersSectionList",e)}let I$=(0,z.A)("MuiPickersSectionList",["root","section","sectionContent"]),I_=["slots","slotProps","elements","sectionListRef"],IU=(0,F.A)("div",{name:"MuiPickersSectionList",slot:"Root",overridesResolver:(e,t)=>t.root})({direction:"ltr /*! @noflip */",outline:"none"}),IG=(0,F.A)("span",{name:"MuiPickersSectionList",slot:"Section",overridesResolver:(e,t)=>t.section})({}),Iq=(0,F.A)("span",{name:"MuiPickersSectionList",slot:"SectionSeparator",overridesResolver:(e,t)=>t.sectionSeparator})({whiteSpace:"pre"}),IY=(0,F.A)("span",{name:"MuiPickersSectionList",slot:"SectionContent",overridesResolver:(e,t)=>t.sectionContent})({outline:"none"});function IK(e){let{slots:t,slotProps:n,element:i,classes:r}=e,o=t?.section??IG,s=(0,Mk.A)({elementType:o,externalSlotProps:n?.section,externalForwardedProps:i.container,className:r.section,ownerState:{}}),l=t?.sectionContent??IY,a=(0,Mk.A)({elementType:l,externalSlotProps:n?.sectionContent,externalForwardedProps:i.content,additionalProps:{suppressContentEditableWarning:!0},className:r.sectionContent,ownerState:{}}),u=t?.sectionSeparator??Iq,c=(0,Mk.A)({elementType:u,externalSlotProps:n?.sectionSeparator,externalForwardedProps:i.before,ownerState:{position:"before"}}),h=(0,Mk.A)({elementType:u,externalSlotProps:n?.sectionSeparator,externalForwardedProps:i.after,ownerState:{position:"after"}});return(0,I.jsxs)(o,(0,dH.A)({},s,{children:[(0,I.jsx)(u,(0,dH.A)({},c)),(0,I.jsx)(l,(0,dH.A)({},a)),(0,I.jsx)(u,(0,dH.A)({},h))]}))}let IX=R.forwardRef(function(e,t){let n=kI({props:e,name:"MuiPickersSectionList"}),{slots:i,slotProps:r,elements:o,sectionListRef:s}=n,l=(0,dz.A)(n,I_),a=(e=>{let{classes:t}=e;return(0,P.A)({root:["root"],section:["section"],sectionContent:["sectionContent"]},IW,t)})(n),u=R.useRef(null),c=(0,Tz.A)(t,u),h=e=>{if(!u.current)throw Error(`MUI X: Cannot call sectionListRef.${e} before the mount of the component.`);return u.current};R.useImperativeHandle(s,()=>({getRoot:()=>h("getRoot"),getSectionContainer:e=>h("getSectionContainer").querySelector(`.${I$.section}[data-sectionindex="${e}"]`),getSectionContent:e=>h("getSectionContent").querySelector(`.${I$.section}[data-sectionindex="${e}"] .${I$.sectionContent}`),getSectionIndexFromDOMElement(e){let t=h("getSectionIndexFromDOMElement");if(null==e||!t.contains(e))return null;let n=null;return(e.classList.contains(I$.section)?n=e:e.classList.contains(I$.sectionContent)&&(n=e.parentElement),null==n)?null:Number(n.dataset.sectionindex)}}));let d=i?.root??IU,f=(0,Mk.A)({elementType:d,externalSlotProps:r?.root,externalForwardedProps:l,additionalProps:{ref:c,suppressContentEditableWarning:!0},className:a.root,ownerState:{}});return(0,I.jsx)(d,(0,dH.A)({},f,{children:f.contentEditable?o.map(({content:e,before:t,after:n})=>`${t.children}${e.children}${n.children}`).join(""):(0,I.jsx)(R.Fragment,{children:o.map((e,t)=>(0,I.jsx)(IK,{slots:i,slotProps:r,element:e,classes:a},t))})}))}),IZ=["elements","areAllSectionsEmpty","defaultValue","label","value","onChange","id","autoFocus","endAdornment","startAdornment","renderSuffix","slots","slotProps","contentEditable","tabIndex","onInput","onPaste","onKeyDown","fullWidth","name","readOnly","inputProps","inputRef","sectionListRef"],IQ=(0,F.A)("div",{name:"MuiPickersInputBase",slot:"Root",overridesResolver:(e,t)=>t.root})(({theme:e})=>(0,dH.A)({},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:`${Math.round(.15/16*1e5)/1e5}em`,variants:[{props:{fullWidth:!0},style:{width:"100%"}}]})),IJ=(0,F.A)(IU,{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:e,focused:t,filled:n,label:i})=>!e&&!t&&!n&&null==i,style:e.vars?{opacity:e.vars.opacity.inputPlaceholder}:{opacity:"light"===e.palette.mode?.42:.5}}]})),I0=(0,F.A)(IG,{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"})),I1=(0,F.A)(IY,{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"})),I2=(0,F.A)(Iq,{name:"MuiPickersInputBase",slot:"Separator",overridesResolver:(e,t)=>t.separator})(()=>({whiteSpace:"pre",letterSpacing:"inherit"})),I5=(0,F.A)("input",{name:"MuiPickersInputBase",slot:"Input",overridesResolver:(e,t)=>t.hiddenInput})((0,dH.A)({},Iz.A)),I3=R.forwardRef(function(e,t){let n=kI({props:e,name:"MuiPickersInputBase"}),{elements:i,areAllSectionsEmpty:r,value:o,onChange:s,id:l,endAdornment:a,startAdornment:u,renderSuffix:c,slots:h,slotProps:d,contentEditable:f,tabIndex:p,onInput:m,onPaste:g,onKeyDown:v,name:b,readOnly:x,inputProps:y,inputRef:w,sectionListRef:S}=n,C=(0,dz.A)(n,IZ),A=R.useRef(null),k=(0,Tz.A)(t,A),M=(0,Tz.A)(y?.ref,w),T=(0,uf.I)(),D=(0,uB.A)();if(!D)throw Error("MUI X: PickersInputBase should always be used inside a PickersTextField component");R.useEffect(()=>{D&&D.setAdornedStart(!!u)},[D,u]),R.useEffect(()=>{D&&(r?D.onEmpty():D.onFilled())},[D,r]);let E=(0,dH.A)({},n,D,{isRtl:T}),O=(e=>{let{focused:t,disabled:n,error:i,classes:r,fullWidth:o,readOnly:s,color:l,size:a,endAdornment:u,startAdornment:c}=e,h={root:["root",t&&!n&&"focused",n&&"disabled",s&&"readOnly",i&&"error",o&&"fullWidth",`color${(0,IH.A)(l)}`,"small"===a&&"inputSizeSmall",!!c&&"adornedStart",!!u&&"adornedEnd"],notchedOutline:["notchedOutline"],input:["input"],sectionsContainer:["sectionsContainer"],sectionContent:["sectionContent"],sectionBefore:["sectionBefore"],sectionAfter:["sectionAfter"]};return(0,P.A)(h,IE,r)})(E),L=h?.root||IQ,j=(0,Mk.A)({elementType:L,externalSlotProps:d?.root,externalForwardedProps:C,additionalProps:{"aria-invalid":D.error,ref:k},className:O.root,ownerState:E}),B=h?.input||IJ;return(0,I.jsxs)(L,(0,dH.A)({},j,{children:[u,(0,I.jsx)(IX,{sectionListRef:S,elements:i,contentEditable:f,tabIndex:p,className:O.sectionsContainer,onFocus:e=>{D.disabled?e.stopPropagation():D.onFocus?.(e)},onBlur:D.onBlur,onInput:m,onPaste:g,onKeyDown:v,slots:{root:B,section:I0,sectionContent:I1,sectionSeparator:I2},slotProps:{root:{ownerState:E},sectionContent:{className:IO.sectionContent},sectionSeparator:({position:e})=>({className:"before"===e?IO.sectionBefore:IO.sectionAfter})}}),a,c?c((0,dH.A)({},D)):null,(0,I.jsx)(I5,(0,dH.A)({name:b,className:O.input,value:o,onChange:s,id:l,"aria-hidden":"true",tabIndex:-1,readOnly:x,required:D.required,disabled:D.disabled},y,{ref:M}))]}))}),I4=["label","autoFocus","ownerState","notched"],I6=(0,F.A)(IQ,{name:"MuiPickersOutlinedInput",slot:"Root",overridesResolver:(e,t)=>t.root})(({theme:e})=>{let t="light"===e.palette.mode?"rgba(0, 0, 0, 0.23)":"rgba(255, 255, 255, 0.23)";return{padding:"0 14px",borderRadius:(e.vars||e).shape.borderRadius,[`&:hover .${IL.notchedOutline}`]:{borderColor:(e.vars||e).palette.text.primary},"@media (hover: none)":{[`&:hover .${IL.notchedOutline}`]:{borderColor:e.vars?`rgba(${e.vars.palette.common.onBackgroundChannel} / 0.23)`:t}},[`&.${IL.focused} .${IL.notchedOutline}`]:{borderStyle:"solid",borderWidth:2},[`&.${IL.disabled}`]:{[`& .${IL.notchedOutline}`]:{borderColor:(e.vars||e).palette.action.disabled},"*":{color:(e.vars||e).palette.action.disabled}},[`&.${IL.error} .${IL.notchedOutline}`]:{borderColor:(e.vars||e).palette.error.main},variants:Object.keys((e.vars??e).palette).filter(t=>(e.vars??e).palette[t]?.main??!1).map(t=>({props:{color:t},style:{[`&.${IL.focused}:not(.${IL.error}) .${IL.notchedOutline}`]:{borderColor:(e.vars||e).palette[t].main}}}))}}),I8=(0,F.A)(IJ,{name:"MuiPickersOutlinedInput",slot:"SectionsContainer",overridesResolver:(e,t)=>t.sectionsContainer})({padding:"16.5px 0",variants:[{props:{size:"small"},style:{padding:"8.5px 0"}}]}),I9=R.forwardRef(function(e,t){let n=kI({props:e,name:"MuiPickersOutlinedInput"}),{label:i,ownerState:r,notched:o}=n,s=(0,dz.A)(n,I4),l=(0,uB.A)(),a=(0,dH.A)({},n,r,l,{color:l?.color||"primary"}),u=(e=>{let{classes:t}=e,n=(0,P.A)({root:["root"],notchedOutline:["notchedOutline"],input:["input"]},IP,t);return(0,dH.A)({},t,n)})(a);return(0,I.jsx)(I3,(0,dH.A)({slots:{root:I6,input:I8},renderSuffix:e=>(0,I.jsx)(IV,{shrink:!!(o||e.adornedStart||e.focused||e.filled),notched:!!(o||e.adornedStart||e.focused||e.filled),className:u.notchedOutline,label:null!=i&&""!==i&&l?.required?(0,I.jsxs)(R.Fragment,{children:[i," ","*"]}):i,ownerState:a})},s,{label:i,classes:u,ref:t}))});I9.muiName="Input";var I7=n(57867);function Re(e){return(0,W.Ay)("MuiPickersFilledInput",e)}let Rt=(0,dH.A)({},IO,(0,z.A)("MuiPickersFilledInput",["root","underline","input"])),Rn=["label","autoFocus","disableUnderline","ownerState"],Ri=(0,F.A)(IQ,{name:"MuiPickersFilledInput",slot:"Root",overridesResolver:(e,t)=>t.root,shouldForwardProp:e=>(0,I7.MC)(e)&&"disableUnderline"!==e})(({theme:e})=>{let t="light"===e.palette.mode,n=t?"rgba(0, 0, 0, 0.06)":"rgba(255, 255, 255, 0.09)";return{backgroundColor:e.vars?e.vars.palette.FilledInput.bg:n,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:t?"rgba(0, 0, 0, 0.09)":"rgba(255, 255, 255, 0.13)","@media (hover: none)":{backgroundColor:e.vars?e.vars.palette.FilledInput.bg:n}},[`&.${Rt.focused}`]:{backgroundColor:e.vars?e.vars.palette.FilledInput.bg:n},[`&.${Rt.disabled}`]:{backgroundColor:e.vars?e.vars.palette.FilledInput.disabledBg:t?"rgba(0, 0, 0, 0.12)":"rgba(255, 255, 255, 0.12)"},variants:[...Object.keys((e.vars??e).palette).filter(t=>(e.vars??e).palette[t].main).map(t=>({props:{color:t,disableUnderline:!1},style:{"&::after":{borderBottom:`2px solid ${(e.vars||e).palette[t]?.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"},[`&.${Rt.focused}:after`]:{transform:"scaleX(1) translateX(0)"},[`&.${Rt.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})`:t?"rgba(0, 0, 0, 0.42)":"rgba(255, 255, 255, 0.7)"}`,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(.${Rt.disabled}, .${Rt.error}):before`]:{borderBottom:`1px solid ${(e.vars||e).palette.text.primary}`},[`&.${Rt.disabled}:before`]:{borderBottomStyle:"dotted"}}},{props:({startAdornment:e})=>!!e,style:{paddingLeft:12}},{props:({endAdornment:e})=>!!e,style:{paddingRight:12}}]}}),Rr=(0,F.A)(IJ,{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}}]}),Ro=R.forwardRef(function(e,t){let n=kI({props:e,name:"MuiPickersFilledInput"}),{label:i,disableUnderline:r=!1,ownerState:o}=n,s=(0,dz.A)(n,Rn),l=(0,uB.A)(),a=(e=>{let{classes:t,disableUnderline:n}=e,i=(0,P.A)({root:["root",!n&&"underline"],input:["input"]},Re,t);return(0,dH.A)({},t,i)})((0,dH.A)({},n,o,l,{color:l?.color||"primary"}));return(0,I.jsx)(I3,(0,dH.A)({slots:{root:Ri,input:Rr},slotProps:{root:{disableUnderline:r}}},s,{label:i,classes:a,ref:t}))});function Rs(e){return(0,W.Ay)("MuiPickersFilledInput",e)}Ro.muiName="Input";let Rl=(0,dH.A)({},IO,(0,z.A)("MuiPickersInput",["root","input"])),Ra=["label","autoFocus","disableUnderline","ownerState"],Ru=(0,F.A)(IQ,{name:"MuiPickersInput",slot:"Root",overridesResolver:(e,t)=>t.root})(({theme:e})=>{let t="light"===e.palette.mode?"rgba(0, 0, 0, 0.42)":"rgba(255, 255, 255, 0.7)";return e.vars&&(t=`rgba(${e.vars.palette.common.onBackgroundChannel} / ${e.vars.opacity.inputUnderline})`),{"label + &":{marginTop:16},variants:[...Object.keys((e.vars??e).palette).filter(t=>(e.vars??e).palette[t].main).map(t=>({props:{color:t},style:{"&::after":{borderBottom:`2px solid ${(e.vars||e).palette[t].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"},[`&.${Rl.focused}:after`]:{transform:"scaleX(1) translateX(0)"},[`&.${Rl.error}`]:{"&:before, &:after":{borderBottomColor:(e.vars||e).palette.error.main}},"&::before":{borderBottom:`1px solid ${t}`,left:0,bottom:0,content:'"\\00a0"',position:"absolute",right:0,transition:e.transitions.create("border-bottom-color",{duration:e.transitions.duration.shorter}),pointerEvents:"none"},[`&:hover:not(.${Rl.disabled}, .${Rl.error}):before`]:{borderBottom:`2px solid ${(e.vars||e).palette.text.primary}`,"@media (hover: none)":{borderBottom:`1px solid ${t}`}},[`&.${Rl.disabled}:before`]:{borderBottomStyle:"dotted"}}}]}}),Rc=R.forwardRef(function(e,t){let n=kI({props:e,name:"MuiPickersInput"}),{label:i,disableUnderline:r=!1,ownerState:o}=n,s=(0,dz.A)(n,Ra),l=(0,uB.A)(),a=(e=>{let{classes:t,disableUnderline:n}=e,i=(0,P.A)({root:["root",!n&&"underline"],input:["input"]},Rs,t);return(0,dH.A)({},t,i)})((0,dH.A)({},n,o,l,{disableUnderline:r,color:l?.color||"primary"}));return(0,I.jsx)(I3,(0,dH.A)({slots:{root:Ru}},s,{label:i,classes:a,ref:t}))});Rc.muiName="Input";let Rh=["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"],Rd={standard:Rc,filled:Ro,outlined:I9},Rf=(0,F.A)(c$.A,{name:"MuiPickersTextField",slot:"Root",overridesResolver:(e,t)=>t.root})({maxWidth:"100%"}),Rp=R.forwardRef(function(e,t){let n=kI({props:e,name:"MuiPickersTextField"}),{onFocus:i,onBlur:r,className:o,color:s="primary",disabled:l=!1,error:a=!1,variant:u="outlined",required:c=!1,InputProps:h,inputProps:d,inputRef:f,sectionListRef:p,elements:m,areAllSectionsEmpty:g,onClick:v,onKeyDown:b,onKeyUp:x,onPaste:y,onInput:w,endAdornment:S,startAdornment:C,tabIndex:A,contentEditable:k,focused:M,value:T,onChange:D,fullWidth:E,id:L,name:j,helperText:B,FormHelperTextProps:F,label:N,InputLabelProps:V}=n,H=(0,dz.A)(n,Rh),z=R.useRef(null),W=(0,Tz.A)(t,z),$=(0,MA.A)(L),_=B&&$?`${$}-helper-text`:void 0,U=N&&$?`${$}-label`:void 0,G=(0,dH.A)({},n,{color:s,disabled:l,error:a,focused:M,required:c,variant:u}),q=(e=>{let{focused:t,disabled:n,classes:i,required:r}=e;return(0,P.A)({root:["root",t&&!n&&"focused",n&&"disabled",r&&"required"]},IR,i)})(G),Y=Rd[u];return(0,I.jsxs)(Rf,(0,dH.A)({className:(0,O.A)(q.root,o),ref:W,focused:M,onFocus:i,onBlur:r,disabled:l,variant:u,error:a,color:s,fullWidth:E,required:c,ownerState:G},H,{children:[(0,I.jsx)(ID.A,(0,dH.A)({htmlFor:$,id:U},V,{children:N})),(0,I.jsx)(Y,(0,dH.A)({elements:m,areAllSectionsEmpty:g,onClick:v,onKeyDown:b,onKeyUp:x,onInput:w,onPaste:y,endAdornment:S,startAdornment:C,tabIndex:A,contentEditable:k,value:T,onChange:D,id:$,fullWidth:E,inputProps:d,inputRef:f,sectionListRef:p,label:N,name:j,role:"group","aria-labelledby":U,"aria-describedby":_,"aria-live":_?"polite":void 0},h)),B&&(0,I.jsx)(II.A,(0,dH.A)({id:_},F,{children:B}))]}))}),Rm=["enableAccessibleFieldDOMStructure"],Rg=["InputProps","readOnly"],Rv=["onPaste","onKeyDown","inputMode","readOnly","InputProps","inputProps","inputRef"],Rb=["slots","slotProps","InputProps","inputProps"],Rx=R.forwardRef(function(e,t){let n=kI({props:e,name:"MuiDateTimeField"}),{slots:i,slotProps:r,InputProps:o,inputProps:s}=n,l=(0,dz.A)(n,Rb),a=i?.textField??(e.enableAccessibleFieldDOMStructure?Rp:J.A),u=(0,Mk.A)({elementType:a,externalSlotProps:r?.textField,externalForwardedProps:l,ownerState:n,additionalProps:{ref:t}});u.inputProps=(0,dH.A)({},s,u.inputProps),u.InputProps=(0,dH.A)({},o,u.InputProps);let c=(e=>{let{enableAccessibleFieldDOMStructure:t}=e,n=(0,dz.A)(e,Rm);if(t){let{InputProps:e,readOnly:t}=n,i=(0,dz.A)(n,Rg);return(0,dH.A)({},i,{InputProps:(0,dH.A)({},e??{},{readOnly:t})})}let{onPaste:i,onKeyDown:r,inputMode:o,readOnly:s,InputProps:l,inputProps:a,inputRef:u}=n,c=(0,dz.A)(n,Rv);return(0,dH.A)({},c,{InputProps:(0,dH.A)({},l??{},{readOnly:s}),inputProps:(0,dH.A)({},a??{},{inputMode:o,onPaste:i,onKeyDown:r,ref:u})})})((e=>{let t,n,i,r,o,{forwardedProps:s,internalProps:l}=(t=kB().utils,n=kB().defaultDates,i=e.ampm??t.is12HourCycleInCurrentLocale()?t.formats.keyboardDateTime12h:t.formats.keyboardDateTime24h,r=(0,dH.A)({},e,{disablePast:e.disablePast??!1,disableFuture:e.disableFuture??!1,format:e.format??i,disableIgnoringDatePartForTimeValidation:!!(e.minDateTime||e.maxDateTime),minDate:kH(t,e.minDateTime??e.minDate,n.minDate),maxDate:kH(t,e.maxDateTime??e.maxDate,n.maxDate),minTime:e.minDateTime??e.minTime,maxTime:e.maxDateTime??e.maxTime}),o="date-time",R.useMemo(()=>{let e=(0,dH.A)({},r),t={},n=n=>{e.hasOwnProperty(n)&&(t[n]=e[n],delete e[n])};return Ik.forEach(n),IS.forEach(n),IC.forEach(n),IA.forEach(n),{forwardedProps:e,internalProps:t}},[r,o]));return(e=>{let t=kB().utils,{internalProps:n,internalProps:{unstableFieldRef:i,minutesStep:r,enableAccessibleFieldDOMStructure:o=!1,disabled:s=!1,readOnly:l=!1},forwardedProps:{onKeyDown:a,error:u,clearable:c,onClear:h},fieldValueManager:d,valueManager:f,validator:p}=e,m=(0,uf.I)(),g=(e=>{let t=kB().utils,n=kB().localeText,i=kB(),r=(0,uf.I)(),{valueManager:o,fieldValueManager:s,valueType:l,validator:a,internalProps:u,internalProps:{value:c,defaultValue:h,referenceDate:d,onChange:f,format:p,formatDensity:m="dense",selectedSections:g,onSelectedSectionsChange:v,shouldRespectLeadingZeros:b=!1,timezone:x,enableAccessibleFieldDOMStructure:y=!1}}=e,{timezone:w,value:S,handleValueChange:C}=To({timezone:x,value:c,defaultValue:h,referenceDate:d,onChange:f,valueManager:o}),A=R.useMemo(()=>{let e;return e=t.date(void 0),"0"===t.formatByString(t.setSeconds(e,0),"s")?Td:Array.from({length:10}).map((n,i)=>t.formatByString(t.setSeconds(e,i),"s"))},[t]),k=R.useMemo(()=>((e,t,n)=>{let i=e.date(void 0,n),r=e.endOfYear(i),o=e.endOfDay(i),{maxDaysInMonth:s,longestMonth:l}=kz(e,i).reduce((t,n)=>{let i=e.getDaysInMonth(n);return i>t.maxDaysInMonth?{maxDaysInMonth:i,longestMonth:n}:t},{maxDaysInMonth:0,longestMonth:null});return{year:({format:t})=>({minimum:0,maximum:4===e.formatByString(e.date(void 0,"system"),t).length?9999:99}),month:()=>({minimum:1,maximum:e.getMonth(r)+1}),day:({currentDate:t})=>({minimum:1,maximum:null!=t&&e.isValid(t)?e.getDaysInMonth(t):s,longestMonth:l}),weekDay:({format:t,contentType:n})=>{if("digit"===n){let n=Tc(e,t).map(Number);return{minimum:Math.min(...n),maximum:Math.max(...n)}}return{minimum:1,maximum:7}},hours:({format:n})=>{let r=e.getHours(o);return Tf(e.formatByString(e.endOfDay(i),n),t)!==r.toString()?{minimum:1,maximum:Number(Tf(e.formatByString(e.startOfDay(i),n),t))}:{minimum:0,maximum:r}},minutes:()=>({minimum:0,maximum:e.getMinutes(o)}),seconds:()=>({minimum:0,maximum:e.getSeconds(o)}),meridiem:()=>({minimum:0,maximum:1}),empty:()=>({minimum:0,maximum:0})}})(t,A,w),[t,A,w]),M=R.useCallback((e,i=null)=>s.getSectionsFromValue(t,e,i,e=>Ib({utils:t,localeText:n,localizedDigits:A,format:p,date:e,formatDensity:m,shouldRespectLeadingZeros:b,enableAccessibleFieldDOMStructure:y,isRtl:r})),[s,p,n,A,r,b,t,m,y]),[T,D]=R.useState(()=>{let e=M(S);Tw(e,l);let n={sections:e,value:S,referenceValue:o.emptyValue,tempValueStrAndroid:null},i=Math.max(...e.map(e=>Tl[e.type]??1)),r=o.getInitialReferenceValue({referenceDate:d,value:S,utils:t,props:u,granularity:i,timezone:w});return(0,dH.A)({},n,{referenceValue:r})}),[I,E]=(0,Mj.A)({controlled:g,default:null,name:"useField",state:"selectedSections"}),O=e=>{E(e),v?.(e)},P=R.useMemo(()=>TA(I,T.sections),[I,T.sections]),L="all"===P?0:P,j=({value:e,referenceValue:n,sections:r})=>{if(D(t=>(0,dH.A)({},t,{sections:r,value:e,referenceValue:n,tempValueStrAndroid:null})),o.areValuesEqual(t,T.value,e))return;let s={validationError:a({adapter:i,value:e,timezone:w,props:u})};C(e,s)},B=(e,t)=>{let n=[...T.sections];return n[e]=(0,dH.A)({},n[e],{value:t,modified:!0}),n};return R.useEffect(()=>{let e=M(T.value);Tw(e,l),D(t=>(0,dH.A)({},t,{sections:e}))},[p,t.locale,r]),R.useEffect(()=>{o.areValuesEqual(t,T.value,S)&&o.getTimezone(t,T.value)===o.getTimezone(t,S)||D(e=>(0,dH.A)({},e,{value:S,referenceValue:s.updateReferenceValue(t,S,e.referenceValue),sections:M(S)}))},[S]),{state:T,activeSectionIndex:L,parsedSelectedSections:P,setSelectedSections:O,clearValue:()=>{j({value:o.emptyValue,referenceValue:T.referenceValue,sections:M(o.emptyValue)})},clearActiveSection:()=>{if(null==L)return;let e=T.sections[L],n=s.getActiveDateManager(t,T,e),i=n.getSections(T.sections).filter(e=>""!==e.value).length===+(""!==e.value),r=B(L,""),o=i?null:t.getInvalidDate(),l=n.getNewValuesFromNewActiveDate(o);j((0,dH.A)({},l,{sections:r}))},updateSectionValue:({activeSection:e,newSectionValue:n,shouldGoToNextSection:i})=>{let r,o;i&&L<T.sections.length-1&&O(L+1);let l=s.getActiveDateManager(t,T,e),a=B(L,n),u=l.getSections(a),c=((e,t,n)=>{let i=t.some(e=>"day"===e.type),r=[],o=[];for(let e=0;e<t.length;e+=1){let s=t[e];i&&"weekDay"===s.type||(r.push(s.format),o.push(Tb(s,"non-input",n)))}let s=r.join(" "),l=o.join(" ");return e.parse(l,s)})(t,u,A);if(null!=c&&t.isValid(c)){let e=TC(t,c,u,l.referenceDate,!0);r=l.getNewValuesFromNewActiveDate(e),o=!0}else r=l.getNewValuesFromNewActiveDate(c),o=(null!=c&&!t.isValid(c))!=(null!=l.date&&!t.isValid(l.date));return o?j((0,dH.A)({},r,{sections:a})):D(e=>(0,dH.A)({},e,r,{sections:a,tempValueStrAndroid:null}))},updateValueFromValueStr:e=>{let i=s.parseValueStr(e,T.referenceValue,(e,i)=>{let o=t.parse(e,p);if(null==o||!t.isValid(o))return null;let s=Ib({utils:t,localeText:n,localizedDigits:A,format:p,date:o,formatDensity:m,shouldRespectLeadingZeros:b,enableAccessibleFieldDOMStructure:y,isRtl:r});return TC(t,o,s,i,!1)}),o=s.updateReferenceValue(t,i,T.referenceValue);j({value:i,referenceValue:o,sections:M(i,T.sections)})},setTempAndroidValueStr:e=>D(t=>(0,dH.A)({},t,{tempValueStrAndroid:e})),getSectionsFromValue:M,sectionsValueBoundaries:k,localizedDigits:A,timezone:w}})(e),{state:v,activeSectionIndex:b,parsedSelectedSections:x,setSelectedSections:y,clearValue:w,clearActiveSection:S,updateSectionValue:C,setTempAndroidValueStr:A,sectionsValueBoundaries:k,localizedDigits:M,timezone:T}=g,D=(({sections:e,updateSectionValue:t,sectionsValueBoundaries:n,localizedDigits:i,setTempAndroidValueStr:r,timezone:o})=>{let s=kB().utils,[l,a]=R.useState(null),u=(0,ML.A)(()=>a(null));R.useEffect(()=>{null!=l&&e[l.sectionIndex]?.type!==l.sectionType&&u()},[e,l,u]),R.useEffect(()=>{if(null!=l){let e=setTimeout(()=>u(),5e3);return()=>{clearTimeout(e)}}return()=>{}},[l,u]);let c=({keyPressed:t,sectionIndex:n},i,r)=>{let o=t.toLowerCase(),s=e[n];if(null!=l&&(!r||r(l.value))&&l.sectionIndex===n){let e=`${l.value}${o}`,t=i(e,s);if(null==t.saveQuery)return a({sectionIndex:n,value:e,sectionType:s.type}),t}let c=i(o,s);return null==c.saveQuery||c.saveQuery?(a({sectionIndex:n,value:o,sectionType:s.type}),null!=c.saveQuery?null:c):(u(),null)};return{applyCharacterEditing:(0,ML.A)(l=>{var a;let u,h,d,f=e[l.sectionIndex],p=Tm(l.keyPressed,i)?(a=(0,dH.A)({},l,{keyPressed:Tp(l.keyPressed,i)}),u=(e,t)=>{let r=Tf(e,i),o=Number(r),l=n[t.type]({currentDate:null,format:t.format,contentType:t.contentType});if(o>l.maximum)return{saveQuery:!1};if(o<l.minimum)return{saveQuery:!0};let a=10*o>l.maximum||r.length===l.maximum.toString().length;return{sectionValue:Tv(s,o,l,i,t),shouldGoToNextSection:a}},c(a,(e,t)=>{if("digit"===t.contentType||"digit-with-letter"===t.contentType)return u(e,t);if("month"===t.type){let n=Ty(s,"digit","month","MM"),i=u(e,{type:t.type,format:"MM",hasLeadingZerosInFormat:n,hasLeadingZerosInInput:!0,contentType:"digit",maxLength:2});if(null!=i.saveQuery)return i;let r=Tx(s,i.sectionValue,"MM",t.format);return(0,dH.A)({},i,{sectionValue:r})}if("weekDay"===t.type){let n=u(e,t);if(null!=n.saveQuery)return n;let i=Tc(s,t.format)[Number(n.sectionValue)-1];return(0,dH.A)({},n,{sectionValue:i})}return{saveQuery:!1}},e=>Tm(e,i))):(h=(e,t,n)=>{let i=t.filter(e=>e.toLowerCase().startsWith(n));return 0===i.length?{saveQuery:!1}:{sectionValue:i[0],shouldGoToNextSection:1===i.length}},d=(e,t,n,i)=>{let r=e=>Th(s,o,t.type,e);if("letter"===t.contentType)return h(t.format,r(t.format),e);if(n&&null!=i&&"letter"===Tu(s,n).contentType){let t=r(n),o=h(n,t,e);return null!=o.saveQuery?{saveQuery:!1}:(0,dH.A)({},o,{sectionValue:i(o.sectionValue,t)})}return{saveQuery:!1}},c(l,(e,t)=>{switch(t.type){case"month":return d(e,t,s.formats.month,e=>Tx(s,e,s.formats.month,t.format));case"weekDay":return d(e,t,s.formats.weekday,(e,t)=>t.indexOf(e).toString());case"meridiem":return d(e,t);default:return{saveQuery:!1}}}));null==p?r(null):t({activeSection:f,newSectionValue:p.sectionValue,shouldGoToNextSection:p.shouldGoToNextSection})}),resetCharacterQuery:u}})({sections:v.sections,updateSectionValue:C,sectionsValueBoundaries:k,localizedDigits:M,setTempAndroidValueStr:A,timezone:T}),{resetCharacterQuery:I}=D,E=f.areValuesEqual(t,v.value,f.emptyValue),O=o?Ix:Iw,P=R.useMemo(()=>((e,t)=>{let n={};if(!t)return e.forEach((t,i)=>{let r=i===e.length-1?null:i+1;n[i]={leftIndex:0===i?null:i-1,rightIndex:r}}),{neighbors:n,startIndex:0,endIndex:e.length-1};let i={},r={},o=0,s=0,l=e.length-1;for(;l>=0;){-1===(s=e.findIndex((e,t)=>t>=o&&e.endSeparator?.includes(" ")&&" / "!==e.endSeparator))&&(s=e.length-1);for(let e=s;e>=o;e-=1)r[e]=l,i[l]=e,l-=1;o=s+1}return e.forEach((t,o)=>{let s=r[o],l=0===s?null:i[s-1],a=s===e.length-1?null:i[s+1];n[o]={leftIndex:l,rightIndex:a}}),{neighbors:n,startIndex:i[0],endIndex:i[e.length-1]}})(v.sections,m&&!o),[v.sections,m,o]),{returnedValue:L,interactions:j}=O((0,dH.A)({},e,g,D,{areAllSectionsEmpty:E,sectionOrder:P})),B=(0,ML.A)(e=>{if(a?.(e),!s)switch(!0){case(e.ctrlKey||e.metaKey)&&"A"===String.fromCharCode(e.keyCode)&&!e.shiftKey&&!e.altKey:e.preventDefault(),y("all");break;case"ArrowRight"===e.key:if(e.preventDefault(),null==x)y(P.startIndex);else if("all"===x)y(P.endIndex);else{let e=P.neighbors[x].rightIndex;null!==e&&y(e)}break;case"ArrowLeft"===e.key:if(e.preventDefault(),null==x)y(P.endIndex);else if("all"===x)y(P.startIndex);else{let e=P.neighbors[x].leftIndex;null!==e&&y(e)}break;case"Delete"===e.key:if(e.preventDefault(),l)break;null==x||"all"===x?w():S(),I();break;case["ArrowUp","ArrowDown","Home","End","PageUp","PageDown"].includes(e.key):{if(e.preventDefault(),l||null==b)break;"all"===x&&y(b);let n=v.sections[b],i=d.getActiveDateManager(t,v,n),o=((e,t,n,i,r,o,s,l)=>{let a=(e=>{switch(e){case"ArrowUp":return 1;case"ArrowDown":return -1;case"PageUp":return 5;case"PageDown":return -5;default:return 0}})(i),u="Home"===i,c="End"===i,h=""===n.value||u||c;if("digit"===n.contentType||"digit-with-letter"===n.contentType){let i,d=r[n.type]({currentDate:s,format:n.format,contentType:n.contentType}),f="minutes"===n.type&&l?.minutesStep?l.minutesStep:1;if(h){if("year"===n.type&&!c&&!u)return e.formatByString(e.date(void 0,t),n.format);i=a>0||u?d.minimum:d.maximum}else i=parseInt(Tf(n.value,o),10)+a*f;return(i%f!=0&&((a<0||u)&&(i+=f-(f+i)%f),(a>0||c)&&(i-=i%f)),i>d.maximum)?Tv(e,d.minimum+(i-d.maximum-1)%(d.maximum-d.minimum+1),d,o,n):i<d.minimum?Tv(e,d.maximum-(d.minimum-i-1)%(d.maximum-d.minimum+1),d,o,n):Tv(e,i,d,o,n)}let d=Th(e,t,n.type,n.format);if(0===d.length)return n.value;if(h)return a>0||u?d[0]:d[d.length-1];let f=((d.indexOf(n.value)+a)%d.length+d.length)%d.length;return d[f]})(t,T,n,e.key,k,M,i.date,{minutesStep:r});C({activeSection:n,newSectionValue:o,shouldGoToNextSection:!1})}}});(0,MV.A)(()=>{j.syncSelectionToDOM()});let{hasValidationError:F}=DZ({props:n,validator:p,timezone:T,value:v.value,onError:n.onError}),N=R.useMemo(()=>void 0!==u?u:F,[F,u]);R.useEffect(()=>{N||null!=b||I()},[v.referenceValue,b,N]),R.useEffect(()=>{null!=v.tempValueStrAndroid&&null!=b&&(I(),S())},[v.sections]),R.useImperativeHandle(i,()=>({getSections:()=>v.sections,getActiveSectionIndex:j.getActiveSectionIndexFromDOM,setSelectedSections:j.setSelectedSections,focusField:j.focusField,isFieldFocused:j.isFieldFocused}));let V={onKeyDown:B,onClear:(0,ML.A)((e,...t)=>{e.preventDefault(),h?.(e,...t),w(),j.isFieldFocused()?y(P.startIndex):j.focusField(0)}),error:N,clearable:!!(c&&!E&&!l&&!s)};return(0,dH.A)({},e.forwardedProps,V,{disabled:s,readOnly:l},L)})({forwardedProps:s,internalProps:l,valueManager:TM,fieldValueManager:TT,validator:Im,valueType:"date-time"})})(u)),h=(e=>{let t=kB().localeText,{clearable:n,onClear:i,InputProps:r,sx:o,slots:s,slotProps:l}=e,a=(0,dz.A)(e,IM),u=s?.clearButton??Q.A,c=(0,Mk.A)({elementType:u,externalSlotProps:l?.clearButton,ownerState:{},className:"clearButton",additionalProps:{title:t.fieldClearLabel}}),h=(0,dz.A)(c,IT),d=s?.clearIcon??k0,f=(0,Mk.A)({elementType:d,externalSlotProps:l?.clearIcon,ownerState:{}});return(0,dH.A)({},a,{InputProps:(0,dH.A)({},r,{endAdornment:(0,I.jsxs)(R.Fragment,{children:[n&&(0,I.jsx)(uH,{position:"end",sx:{marginRight:r?.endAdornment?-1:-1.5},children:(0,I.jsx)(u,(0,dH.A)({},h,{onClick:i,children:(0,I.jsx)(d,(0,dH.A)({fontSize:"small"},f))}))}),r?.endAdornment]})}),sx:[{"& .clearButton":{opacity:1},"@media (pointer: fine)":{"& .clearButton":{opacity:0},"&:hover, &:focus-within":{".clearButton":{opacity:1}}}},...Array.isArray(o)?o:[o]]})})((0,dH.A)({},c,{slots:i,slotProps:r}));return(0,I.jsx)(a,(0,dH.A)({},h))});var Ry=n(65130),Rw=n(43628),RS=n(47196),RC=n(54266),RA=n(54708),Rk=n(38086),RM=n(16299),RT=n(85910),RD=n(44766),RI=n(65043),RR=n(72710),RE=n(96962),RO=n(47918),RP=n(54354),RL=n(8151),Rj=n(91733),RB=n(99042),RF=n(89321),RN=n(51148),RV=n(55578),RH=n(18463),Rz=n(54752),RW=n(36163),R$=n(28850),R_=n(45350),RU=n(67619),RG=n(39270),Rq=n(56756),RY=n(268),RK=n(12282),RX=n(41042),RZ=n(38267),RQ=n(47025),RJ=n(30118),R0=n(84253),R1=n(98608),R2=n(8643),R5=n(18109),R3=n(19681),R4=n(73206),R6=n(53819),R8=n(96058),R9=n(682),R7=n(67671);let Ee={y:{sectionType:"year",contentType:"digit",maxLength:4},yy:"year",yyy:{sectionType:"year",contentType:"digit",maxLength:4},yyyy:"year",M:{sectionType:"month",contentType:"digit",maxLength:2},MM:"month",MMMM:{sectionType:"month",contentType:"letter"},MMM:{sectionType:"month",contentType:"letter"},L:{sectionType:"month",contentType:"digit",maxLength:2},LL:"month",LLL:{sectionType:"month",contentType:"letter"},LLLL:{sectionType:"month",contentType:"letter"},d:{sectionType:"day",contentType:"digit",maxLength:2},dd:"day",do:{sectionType:"day",contentType:"digit-with-letter"},E:{sectionType:"weekDay",contentType:"letter"},EE:{sectionType:"weekDay",contentType:"letter"},EEE:{sectionType:"weekDay",contentType:"letter"},EEEE:{sectionType:"weekDay",contentType:"letter"},EEEEE:{sectionType:"weekDay",contentType:"letter"},i:{sectionType:"weekDay",contentType:"digit",maxLength:1},ii:"weekDay",iii:{sectionType:"weekDay",contentType:"letter"},iiii:{sectionType:"weekDay",contentType:"letter"},e:{sectionType:"weekDay",contentType:"digit",maxLength:1},ee:"weekDay",eee:{sectionType:"weekDay",contentType:"letter"},eeee:{sectionType:"weekDay",contentType:"letter"},eeeee:{sectionType:"weekDay",contentType:"letter"},eeeeee:{sectionType:"weekDay",contentType:"letter"},c:{sectionType:"weekDay",contentType:"digit",maxLength:1},cc:"weekDay",ccc:{sectionType:"weekDay",contentType:"letter"},cccc:{sectionType:"weekDay",contentType:"letter"},ccccc:{sectionType:"weekDay",contentType:"letter"},cccccc:{sectionType:"weekDay",contentType:"letter"},a:"meridiem",aa:"meridiem",aaa:"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"},Et={year:"yyyy",month:"LLLL",monthShort:"MMM",dayOfMonth:"d",dayOfMonthFull:"do",weekday:"EEEE",weekdayShort:"EEEEEE",hours24h:"HH",hours12h:"hh",meridiem:"aa",minutes:"mm",seconds:"ss",fullDate:"PP",keyboardDate:"P",shortDate:"MMM d",normalDate:"d MMMM",normalDateWithWeekday:"EEE, MMM d",fullTime:"p",fullTime12h:"hh:mm aa",fullTime24h:"HH:mm",keyboardDateTime:"P p",keyboardDateTime12h:"P hh:mm aa",keyboardDateTime24h:"P HH:mm"};class En{constructor(e){this.isMUIAdapter=!0,this.isTimezoneCompatible=!1,this.lib=void 0,this.locale=void 0,this.formats=void 0,this.formatTokenMap=Ee,this.escapedCharacters={start:"'",end:"'"},this.longFormatters=void 0,this.date=e=>void 0===e?new Date:null===e?null:new Date(e),this.getInvalidDate=()=>new Date("Invalid Date"),this.getTimezone=()=>"default",this.setTimezone=e=>e,this.toJsDate=e=>e,this.getCurrentLocaleCode=()=>this.locale.code,this.is12HourCycleInCurrentLocale=()=>/a/.test(this.locale.formatLong.time({width:"short"})),this.expandFormat=e=>e.match(/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g).map(e=>{let t=e[0];return"p"===t||"P"===t?(0,this.longFormatters[t])(e,this.locale.formatLong):e}).join(""),this.formatNumber=e=>e,this.getDayOfWeek=e=>e.getDay()+1;const{locale:t,formats:n,longFormatters:i,lib:r}=e;this.locale=t,this.formats=(0,dH.A)({},Et,n),this.longFormatters=i,this.lib=r||"date-fns"}}class Ei extends En{constructor({locale:e,formats:t}={}){super({locale:e??R7.c,formats:t,longFormatters:RR.m}),this.parse=(e,t)=>""===e?null:(0,RK.qg)(e,t,new Date,{locale:this.locale}),this.isValid=e=>null!=e&&(0,RY.f)(e),this.format=(e,t)=>this.formatByString(e,this.formats[t]),this.formatByString=(e,t)=>(0,RE.GP)(e,t,{locale:this.locale}),this.isEqual=(e,t)=>null===e&&null===t||null!==e&&null!==t&&(0,R$.n)(e,t),this.isSameYear=(e,t)=>(0,RU.s)(e,t),this.isSameMonth=(e,t)=>(0,RG.t)(e,t),this.isSameDay=(e,t)=>(0,R_.r)(e,t),this.isSameHour=(e,t)=>(0,Rq.l)(e,t),this.isAfter=(e,t)=>(0,Rz.d)(e,t),this.isAfterYear=(e,t)=>(0,Rz.d)(e,(0,RI.Q)(t)),this.isAfterDay=(e,t)=>(0,Rz.d)(e,(0,RT.D)(t)),this.isBefore=(e,t)=>(0,RW.Y)(e,t),this.isBeforeYear=(e,t)=>(0,RW.Y)(e,this.startOfYear(t)),this.isBeforeDay=(e,t)=>(0,RW.Y)(e,this.startOfDay(t)),this.isWithinRange=(e,[t,n])=>(0,R9.v)(e,{start:t,end:n}),this.startOfYear=e=>(0,R8.D)(e),this.startOfMonth=e=>(0,R3.w)(e),this.startOfWeek=e=>(0,R6.k)(e,{locale:this.locale}),this.startOfDay=e=>(0,R5.o)(e),this.endOfYear=e=>(0,RI.Q)(e),this.endOfMonth=e=>(0,R4.p)(e),this.endOfWeek=e=>(0,RD.$)(e,{locale:this.locale}),this.endOfDay=e=>(0,RT.D)(e),this.addYears=(e,t)=>(0,RM.e)(e,t),this.addMonths=(e,t)=>(0,Rk.P)(e,t),this.addWeeks=(e,t)=>(0,RA.J)(e,t),this.addDays=(e,t)=>(0,Ry.f)(e,t),this.addHours=(e,t)=>(0,RC.L)(e,t),this.addMinutes=(e,t)=>(0,RS.z)(e,t),this.addSeconds=(e,t)=>(0,Rw.p)(e,t),this.getYear=e=>(0,RH.C)(e),this.getMonth=e=>(0,RB.t)(e),this.getDate=e=>(0,RO.p)(e),this.getHours=e=>(0,RL.q)(e),this.getMinutes=e=>(0,Rj.O)(e),this.getSeconds=e=>(0,RF.S)(e),this.getMilliseconds=e=>(0,RN.D)(e),this.setYear=(e,t)=>(0,R2.i)(e,t),this.setMonth=(e,t)=>(0,RJ.Z)(e,t),this.setDate=(e,t)=>(0,RX.X)(e,t),this.setHours=(e,t)=>(0,RZ.a)(e,t),this.setMinutes=(e,t)=>(0,RQ.g)(e,t),this.setSeconds=(e,t)=>(0,R0.g)(e,t),this.setMilliseconds=(e,t)=>(0,R1.$)(e,t),this.getDaysInMonth=e=>(0,RP.P)(e),this.getWeekArray=e=>{let t=this.startOfWeek(this.startOfMonth(e)),n=this.endOfWeek(this.endOfMonth(e)),i=0,r=t,o=[];for(;this.isBefore(r,n);){let e=Math.floor(i/7);o[e]=o[e]||[],o[e].push(r),r=this.addDays(r,1),i+=1}return o},this.getWeekNumber=e=>(0,RV.N)(e,{locale:this.locale}),this.getYearRange=([e,t])=>{let n=this.startOfYear(e),i=this.endOfYear(t),r=[],o=n;for(;this.isBefore(o,i);)r.push(o),o=this.addYears(o,1);return r}}}let Er="yyyy-MM-dd HH:mm:ss";function Eo(e,t){let n,i;return e?nn(e)?e.pastDuration:(n=rc(e.start,Er,t),i=rc(e.end,Er,t),`${n} - ${i}`):"Custom Time Range"}let Es=({initialTimeRange:e,onChange:t,onCancel:n,timeZone:i})=>{let r=["local","browser"].includes(i.toLowerCase())?Intl.DateTimeFormat().resolvedOptions().timeZone:i,[o,s]=(0,R.useState)(e),[l,a]=(0,R.useState)(!0),u=(e,t)=>{s(n=>({...n,[t]:e}))},c=e=>{u(e,"start")},h=e=>{u(e,"end")},d=()=>{var e,t;let n={start:o.start,end:o.end};if(e=n.start,t=n.end,(0,t7.isValid)(e)&&(0,t7.isValid)(t)?!!(0,t7.isBefore)(e,t)||(console.error("End Time is before Start Time"),!1):(console.error("Invalid Date"),!1))return n};return(0,I.jsx)(kO,{dateAdapter:Ei,children:(0,I.jsxs)(Z.A,{spacing:2,sx:e=>({padding:e.spacing(1,0,2)}),children:[l&&(0,I.jsxs)(oe.A,{sx:e=>({".MuiPickersLayout-contentWrapper":{backgroundColor:e.palette.background.default}}),children:[(0,I.jsx)(uL.A,{variant:"h3",padding:1,paddingLeft:2,children:"Select Start Time"}),(0,I.jsx)(Ig,{timezone:r,displayStaticWrapperAs:"desktop",openTo:"day",disableHighlightToday:!0,value:new ra(o.start,r),onChange:e=>{null!==e&&c(e)},onAccept:()=>{a(!1)}})]}),!l&&(0,I.jsxs)(oe.A,{sx:e=>({".MuiPickersLayout-contentWrapper":{backgroundColor:e.palette.background.default}}),children:[(0,I.jsx)(uL.A,{variant:"h3",padding:1,paddingLeft:2,children:"Select End Time"}),(0,I.jsx)(Ig,{timezone:r,displayStaticWrapperAs:"desktop",openTo:"day",disableHighlightToday:!0,value:new ra(o.end,r),minDateTime:new ra(o.start,r),onChange:e=>{null!==e&&h(e)},onAccept:e=>{null!==e&&(a(!0),h(e))}})]}),(0,I.jsxs)(Z.A,{direction:"row",alignItems:"center",gap:1,pl:1,pr:1,children:[(0,I.jsx)(dB.ErrorBoundary,{FallbackComponent:dj,children:(0,I.jsx)(Rx,{"data-testid":"start_time_input",timezone:r,label:"Start Time",value:new ra(o.start,r),onChange:e=>{e&&c(e)},onBlur:()=>d(),format:Er})}),(0,I.jsx)(dB.ErrorBoundary,{FallbackComponent:dj,children:(0,I.jsx)(Rx,{"data-testid":"end_time_input",timezone:r,label:"End Time",value:new ra(o.end,r),onChange:e=>{e&&h(e)},onBlur:()=>d(),format:Er})})]}),(0,I.jsxs)(Z.A,{direction:"row",sx:{padding:e=>e.spacing(0,1)},gap:1,children:[(0,I.jsx)(K.A,{variant:"contained",onClick:()=>{let e;(e=d())&&t(e)},fullWidth:!0,children:"Apply"}),(0,I.jsx)(K.A,{variant:"outlined",onClick:()=>n(),fullWidth:!0,children:"Cancel"})]})]})})};function El({value:e,timeOptions:t,onChange:n,height:i,showCustomTimeRange:r=!0,timeZone:o,timeZoneOptions:s,onTimeZoneChange:l}){let a,{timeZone:u}=r6(),c=o??u,h=(0,R.useRef)(),[d,f]=(0,R.useState)(!1),p=(0,R.useMemo)(()=>{let t;return nn(e)?(t=e.end??new Date,{start:(0,t7.sub)(t,nt(e.pastDuration)),end:t}):e},[e]),m=(0,R.useMemo)(()=>{var t;return{value:t=nn(e)?void 0:e,display:Eo(t,c)}},[e,c]),[g,v]=(0,R.useState)(!1),b=s??nx(),[x,y]=(0,R.useState)(null),w=b.find(e=>e.value===c)?.display??c,S=rh(c),C=rh("local"),A=b.map(e=>({id:e.value,label:e.display}));{let e=b.find(e=>e.value===c);e&&(a={id:e.value,label:e.display})}return(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(eP.Ay,{anchorEl:x,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},open:!!x,onClose:()=>y(null),sx:e=>({padding:e.spacing(1)}),children:(0,I.jsx)(oe.A,{sx:{p:1,minWidth:260},onClick:e=>{e.stopPropagation()},children:(0,I.jsx)(c1,{options:A,value:a,onChange:(e,t)=>{if(t){let e=b.find(e=>e.value===t.id);e&&l?.(e)}y(null)},disableClearable:!0,renderInput:e=>(0,I.jsx)(J.A,{...e,placeholder:"Search timezones",size:"small"})})})}),(0,I.jsx)(eP.Ay,{anchorEl:h.current,anchorOrigin:{vertical:"bottom",horizontal:"center"},open:d,onClose:()=>f(!1),sx:e=>({padding:e.spacing(2)}),children:(0,I.jsx)(Es,{initialTimeRange:p,onChange:e=>{n(e),f(!1),v(!1)},onCancel:()=>f(!1),timeZone:c})}),(0,I.jsx)(oe.A,{ref:h,children:(0,I.jsxs)(ua.A,{open:g,value:Eo(e,c),onClick:()=>v(!g),IconComponent:kA.default,renderValue:()=>(0,I.jsxs)(Z.A,{direction:"row",alignItems:"center",spacing:1,children:[(0,I.jsx)("span",{children:t.find(t=>Eo(t.value,c)===Eo(e,c))?.display??Eo(e,c)}),S!==C&&(0,I.jsxs)(oe.A,{sx:{typography:"caption",color:"text.secondary"},children:["\xb7 ",S]})]}),inputProps:{"aria-label":`Select time range. Currently set to ${e}`},sx:{".MuiSelect-icon":{marginTop:"1px",transform:"none"},".MuiSelect-select.MuiSelect-outlined.MuiInputBase-input":{paddingRight:"36px"},".MuiSelect-select":i?{lineHeight:i,paddingY:0}:{}},children:[(0,I.jsx)(ul.A,{disableRipple:!0,onClick:e=>{e.preventDefault(),e.stopPropagation()},sx:{cursor:"default","&:hover":{backgroundColor:"transparent"},py:.5,px:1},children:(0,I.jsxs)(oe.A,{sx:{display:"flex",alignItems:"center",width:"100%",justifyContent:"space-between"},children:[(0,I.jsxs)(oe.A,{sx:{display:"flex",flexDirection:"column",alignItems:"flex-start"},children:[(0,I.jsx)(oe.A,{sx:{typography:"subtitle1"},children:"Time Range"}),(0,I.jsxs)(oe.A,{sx:{color:"text.secondary",typography:"caption",mt:.25},children:["Timezone: ",w]})]}),(0,I.jsx)(oe.A,{sx:{display:"flex",alignItems:"center",pr:1,ml:1.5},children:(0,I.jsx)(Q.A,{size:"small","aria-label":"Select timezone",onClick:e=>{e.preventDefault(),e.stopPropagation(),y(e.currentTarget)},children:(0,I.jsx)(kk.default,{fontSize:"small"})})})]})}),t.map((e,t)=>(0,I.jsx)(ul.A,{value:Eo(e.value,c),onClick:()=>{n(e.value)},children:e.display},t)),r&&(0,I.jsx)(ul.A,{value:Eo(m.value,c),onClick:()=>f(!0),children:m.display})]})})]})}function Ea({value:e,onChange:t,timeZoneOptions:n,variant:i="standard",heightPx:r,...o}){let s=(0,R.useMemo)(()=>n??nx(),[n]),l=r?"number"==typeof r?`${r}px`:r:void 0,a=(0,R.useMemo)(()=>({minWidth:"compact"===i?"80px":"150px",...l&&{lineHeight:l,paddingY:0},...o.sx}),[i,l,o.sx]);return(0,I.jsx)(ua.A,{...o,value:e,onChange:(e,n)=>{var i;let r;i=e.target.value,(r=s.find(e=>e.value===i))&&t&&t(r)},sx:a,size:"compact"===i?"small":"medium",children:s.map(e=>(0,I.jsx)(ul.A,{value:e.value,children:e.display},e.value))})}function Eu(e){let{markerColor:t,sx:n}=e;return(0,I.jsx)(oe.A,{sx:iH({display:"inline-block",width:"11px",height:"11px",borderRadius:"2px",marginRight:1,verticalAlign:"top"},n),style:{backgroundColor:t}})}function Ec(e){let{formattedY:t,markerColor:n,metricName:i,metricLabels:r}=e;return(0,I.jsxs)(Z.A,{spacing:.5,children:[(0,I.jsxs)(oe.A,{sx:e=>({display:"flex",height:"16px",flexDirection:"row",alignItems:"center",justifyContent:"left",color:e.palette.common.white,fontSize:"11px"}),children:[(0,I.jsx)(Eu,{markerColor:n,sx:{marginTop:.25}}),(0,I.jsxs)(oe.A,{component:"span",children:[i,(0,I.jsx)(oe.A,{component:"span",sx:e=>({color:e.palette.common.white,fontWeight:700,paddingLeft:"2px"}),children:t})]})]}),(0,I.jsx)(ci.A,{sx:e=>({borderColor:e.palette.grey["500"]})}),(0,I.jsx)(oe.A,{sx:e=>({color:e.palette.common.white}),children:r.map(e=>{if(e){let[t,n]=e.split("="),i=void 0!==n?`${t}: `:t,r=void 0!==n?n.replace(/(^"|"$)/g,""):n;return(0,I.jsxs)(oe.A,{sx:{display:"flex",gap:"4px"},children:[(0,I.jsx)(uL.A,{sx:{fontSize:"11px"},children:i}),(0,I.jsx)(uL.A,{sx:e=>({color:e.palette.common.white,fontWeight:700,fontSize:"11px"}),children:r})]},e)}})})]})}let Eh=375,Ed=650,Ef=650,Ep=500,Em=.75,Eg=8,Ev=750,Eb="nearby series showing in tooltip",Ex="emphasized series showing as bold in tooltip",Ey="#2E313E",Ew=new Intl.DateTimeFormat(void 0,{year:"numeric",month:"short",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric",hour12:!0}),ES={coords:{plotCanvas:{x:0,y:0},zrender:{x:0,y:0},target:null},chartWidth:0},EC=[],EA=()=>{let[e,t]=(0,R.useState)(null);return(0,R.useEffect)(()=>{let e=e=>t({page:{x:e.pageX,y:e.pageY},client:{x:e.clientX,y:e.clientY},plotCanvas:{x:e.zrX??e.offsetX,y:e.zrY??e.offsetY},target:e.target});return window.addEventListener("mousemove",e),()=>{window.removeEventListener("mousemove",e)}},[]),e},Ek={wrapLabels:!0,enablePinning:!0},EM="Click chart to pin",ET="Click chart to unpin";function ED(e){let{seriesName:t,formattedY:n,markerColor:i,totalSeries:r,emphasizeText:o=!1,wrapLabels:s=!0}=e,l=t.split("{"),a=(l[1]??t).replace(/[{}]/g,"").split(",");if(1===r&&a.length>1){let e=l[0]?`${l[0]}:`:"value:";return(0,I.jsx)(Ec,{formattedY:n,metricName:e,metricLabels:a,markerColor:i})}let u=t.replace(/[,]/g,", ");return(0,I.jsxs)(oe.A,{sx:{display:"table-row",paddingTop:.5},children:[(0,I.jsxs)(oe.A,{sx:{display:"table-cell",maxWidth:"520px"},children:[(0,I.jsx)(Eu,{markerColor:i,sx:{marginTop:.5}}),(0,I.jsx)(oe.A,{component:"span",sx:e=>({display:"inline-block",width:"calc(100% - 20px)",minWidth:150,maxWidth:Ep,overflow:"hidden",color:e.palette.common.white,fontWeight:o?e.typography.fontWeightBold:e.typography.fontWeightRegular,textOverflow:"ellipsis",whiteSpace:s?"normal":"nowrap"}),"aria-label":o?Ex:Eb,children:u})]}),(0,I.jsx)(oe.A,{sx:e=>({display:"table-cell",paddingLeft:1.5,textAlign:"right",verticalAlign:"top",fontWeight:o?e.typography.fontWeightBold:e.typography.fontWeightRegular}),children:n})]})}var EI=n(36961),ER=n(85180);function EE(e,t,n,i,r){if(null===e||(null!==t&&(e=t),void 0===e.plotCanvas.x))return;let o=e.page.x+32,s=e.page.y+16;if(r){let e=r.getBoundingClientRect();o=o-e.left+r.scrollLeft,s=s-e.top+r.scrollTop;let t=e.top+r.scrollHeight;s+n>t&&(s=Math.max(t-n-16,Eg/2))}else s+n>window.innerHeight+window.scrollY&&(s=Math.max(window.innerHeight+window.scrollY-n-16,Eg/2));return o+i>window.innerWidth&&(o=e.page.x-i-32),o<32&&(o=32),s<Eg/2&&(s=Eg/2),`translate3d(${o}px, ${s}px, 0)`}function EO(e,t,n){return{minWidth:Eh,maxWidth:Ed,maxHeight:(n?n-Eg:void 0)??Ef,padding:0,position:"absolute",top:0,left:0,backgroundColor:e.palette.designSystem?.grey[800]??Ey,borderRadius:"6px",color:"#fff",fontSize:"11px",visibility:"visible",opacity:1,transition:"all 0.1s ease-out",zIndex:null!==t?"auto":e.zIndex.tooltip,overflow:"hidden","&:hover":{overflowY:"auto"}}}let EP=5.5,EL=30,Ej=5;function EB(e,t,n,i,r,o,s,l){let a=[],u=n[0]??null,c=n[1]??null;if(null===u||null===c||void 0===r.dispatchAction||!Array.isArray(e))return a;let h=[],d=[],f=[],p=[],m=[],g=e.length,v=new Map,b=iN(e[0]?.values,u);if(null===b)return EC;let x=null;if(void 0!==l){let e=r.convertToPixel("grid",[0,c]),t=r.convertToPixel("grid",[0,c+i]);e&&t&&void 0!==e[1]&&void 0!==t[1]&&(x=Math.abs(t[1]-e[1]))}for(let n=0;n<g;n++){let u=t[n];if(!u)break;let y=g>0?e[n]:null;if(!y)break;let w=y.values;if(void 0===w||!Array.isArray(w))break;let S=u.name?u.name.toString():"",C=u.id?u.id.toString():"",A=u.color??"#000",k=s?.get(C)??o;if(Array.isArray(e))for(let e=0;e<w.length;e++){let t=w[e];if(void 0===t||!Array.isArray(t))break;let o=t[0],s=t[1];if(null!=s&&b===o){let t=!1;if(void 0!==l&&null!==x){let o=r.convertToPixel({seriesIndex:n},[e,s]);t=o&&void 0!==o[1]?Math.abs(l-o[1])<=x:c<=s+i&&c>=s-i}else t=c<=s+i&&c>=s-i;if(t){let t=Math.max(g>Ej?2:5,100/g),i=!1;if(void 0!==l){let o=r.convertToPixel({seriesIndex:n},[e,s]);i=o&&void 0!==o[1]?Math.abs(l-o[1])<=Math.max(t/100*(x??50),5):EV({valueToCheck:c,baseValue:s,percentage:t})}else i=EV({valueToCheck:c,baseValue:s,percentage:t});if(i){d.push(n);let t=v.get(s)??0;v.set(s,t+1),t>0&&m.push({seriesIndex:n,dataIndex:e,seriesName:S,yValue:s}),p.push({seriesIndex:n,dataIndex:e,seriesName:S,yValue:s})}else f.push(n),r.dispatchAction({type:"downplay",seriesIndex:n});let u=id(s,k);a.push({seriesIdx:n,datumIdx:e,seriesName:S,date:b,x:o,y:s,formattedY:u,markerColor:A.toString(),isClosestToCursor:i}),h.push(n)}}}}return iB(r,h,d,f,p,m),a}function EF(e,t,n,i,r){let o=[],s=t[0]??null,l=t[1]??null;if(null===s||null===l)return o;let a=[],u=[],c=[],h=e.timeSeries.length;if(Array.isArray(e.xAxis)&&Array.isArray(e.timeSeries))for(let t=0;t<h;t++){let d=e.timeSeries[t];if(void 0===d||o.length>=1e3)break;let f=d.name?d.name.toString():"",p=d.color??"#000";if(Array.isArray(d.data))for(let m=0;m<d.data.length;m++){let g=e.xAxis[m]??0,v=d.data[m];if(null!=v&&s===m&&"-"!==v&&l<=v+n&&l>=v-n){let e=EV({valueToCheck:l,baseValue:v,percentage:Math.max(h>Ej?2:5,100/h)});e?u.push(t):(c.push(t),i?.dispatchAction!==void 0&&i.dispatchAction({type:"downplay",seriesIndex:t}));let n=g>0x174876e7ff?g:1e3*g,s=id(v,r);o.push({seriesIdx:t,datumIdx:m,seriesName:f,date:n,x:g,y:v,formattedY:s,markerColor:p.toString(),isClosestToCursor:e}),a.push(t)}}}return i?.dispatchAction!==void 0&&(i.dispatchAction({type:"downplay",seriesIndex:c}),u.length>0?i.dispatchAction({type:"highlight",seriesIndex:u,notBlur:!1,escapeConnect:!0}):i.dispatchAction({type:"highlight",seriesIndex:a,notBlur:!0,escapeConnect:!0})),o}function EN({mousePos:e,pinnedPos:t,data:n,seriesMapping:i,chart:r,format:o,seriesFormatMap:s,showAllSeries:l=!1}){if(void 0===r||null===e)return EC;let a=!1;if(null!==e.target){let t=e.target.parentElement;if(null!==t){let e=t.parentElement;null!==e&&r.getDom()===e&&(a=!0)}}if(null!==t&&(e=t,a=!0),!1===a||null===n||void 0===r._model||void 0===e.plotCanvas.x||void 0===e.plotCanvas.y)return EC;let u=e.plotCanvas.y,c=ij(e.plotCanvas.x,u,r);if(null!==c){let e=r._model.getComponent("yAxis").axis.scale,t="log"===e.type,a=e._interval;if(t&&e.base){let t=e.base,n=e._extent,i=t**n[0];a=(t**n[1]-i)/100}let h=EH({yInterval:a,totalSeries:n.length,showAllSeries:l}),d=i.some(e=>void 0!==e.yAxisIndex&&e.yAxisIndex>0);return EB(n,i,c,h,r,o,s,d?u:void 0)}return EC}function EV({valueToCheck:e,baseValue:t,percentage:n}){let i=n/100*t;return e>=t-i&&e<=t+i}function EH({yInterval:e,totalSeries:t,showAllSeries:n=!1}){if(n)return 10*e;let i=.3*e;return t>Ej?Math.max(i,e*EL/t):Math.max(i,e*EP)}var Ez=n(68003),EW=n(4491),E$=n(29917);let E_=(0,R.memo)(function({nearbySeries:e,totalSeries:t,isTooltipPinned:n,showAllSeries:i,enablePinning:r=!0,onShowAllClick:o,onUnpinClick:s}){let l,a,u,{formatWithUserTimeZone:c}=r6(),h=e[0]?.date??null;if(null===h)return null;let d=r&&t>5;return(0,I.jsxs)(oe.A,{sx:e=>({width:"100%",maxWidth:Ed,padding:e.spacing(1.5,2,.5,2),backgroundColor:e.palette.designSystem?.grey[800]??Ey,position:"sticky",top:0,left:0}),children:[(0,I.jsxs)(oe.A,{sx:{width:"100%",display:"flex",justifyContent:"start",alignItems:"center",paddingBottom:.5},children:[(a=c(l=new Date(h),"MMM dd, yyyy - "),u=c(l,"HH:mm:ss"),(0,I.jsxs)(oe.A,{children:[(0,I.jsx)(uL.A,{variant:"caption",sx:e=>({color:e.palette.common.white}),children:a}),(0,I.jsx)(uL.A,{variant:"caption",children:(0,I.jsx)("strong",{children:u})})]})),(0,I.jsxs)(Z.A,{direction:"row",gap:1,sx:{marginLeft:"auto"},children:[d&&(0,I.jsxs)(Z.A,{direction:"row",gap:.5,alignItems:"center",sx:{textAlign:"right"},children:[(0,I.jsx)(uL.A,{sx:{fontSize:11},children:"Show All"}),(0,I.jsx)(Ez.A,{checked:i,size:"small",onChange:(e,t)=>{if(void 0!==o)return o(t)},sx:e=>({"& .MuiSwitch-switchBase":{color:e.palette.common.white},"& .MuiSwitch-track":{backgroundColor:e.palette.common.white}})})]}),r&&(0,I.jsxs)(Z.A,{direction:"row",alignItems:"center",children:[(0,I.jsx)(uL.A,{sx:{marginRight:.5,fontSize:11,verticalAlign:"middle"},children:n?ET:EM}),n?(0,I.jsx)(EW.default,{onClick:()=>{void 0!==s&&s()},sx:{fontSize:16,cursor:"pointer"}}):(0,I.jsx)(E$.default,{sx:{fontSize:16}})]})]})]}),(0,I.jsx)(ci.A,{sx:e=>({width:"100%",borderColor:e.palette.grey["500"]})})]})});function EU(e){let{series:t,wrapLabels:n}=e,i=(0,R.useMemo)(()=>null===t?null:t.sort((e,t)=>e.y>t.y?-1:1),[t]);return null===t||null===i?null:(0,I.jsx)(oe.A,{sx:e=>({display:"table",padding:e.spacing(.5,2)}),children:i.map(({datumIdx:e,seriesIdx:t,seriesName:r,y:o,formattedY:s,markerColor:l,isClosestToCursor:a})=>{if(null===e||null===t)return null;let u=t.toString()+e.toString();return(0,I.jsx)(ED,{seriesName:r,y:o,formattedY:s,markerColor:l,totalSeries:i.length,wrapLabels:n,emphasizeText:a},u)})})}let EG=(0,R.memo)(function({containerId:e,chartRef:t,data:n,seriesMapping:i,enablePinning:r=!0,wrapLabels:o,format:s,seriesFormatMap:l,onUnpinClick:a,pinnedPos:u}){let[c,h]=(0,R.useState)(!1),d=(0,R.useRef)(),f=EA(),{height:p,width:m,ref:g}=(0,ER.default)(),v=null!==u&&r;if(null===f||null===f.target||null===n||null===u&&"CANVAS"!==f.target.tagName)return null;let b=t.current,x=e?document.querySelector(e):void 0,y=x?x.getBoundingClientRect().height:void 0;d.current=EE(f,u,p??0,m??0,x);let w=EN({mousePos:f,data:n,seriesMapping:i,pinnedPos:u,chart:b,format:s,seriesFormatMap:l,showAllSeries:c});if(0===w.length)return null;let S=n.length;return(0,I.jsx)(EI.A,{container:x,children:(0,I.jsx)(oe.A,{ref:g,sx:e=>EO(e,u,y),style:{transform:d.current},children:(0,I.jsxs)(Z.A,{spacing:.5,children:[(0,I.jsx)(E_,{nearbySeries:w,totalSeries:S,enablePinning:r,isTooltipPinned:v,showAllSeries:c,onShowAllClick:e=>h(e),onUnpinClick:a}),(0,I.jsx)(EU,{series:w,wrapLabels:o})]})})})}),Eq=(0,F.A)(K.A)(({theme:e})=>({padding:e.spacing(.5),minWidth:"auto"})),EY=(0,R.forwardRef)(function(e,t){return(0,I.jsx)(Eq,{ref:t,variant:"outlined",color:"secondary",...e})}),EK=Object.entries(ih).map(([e,t])=>({...t,id:e,group:t.group||"Decimal"})).filter(e=>!e.disableSelectorOption);function EX({value:e,onChange:t,disabled:n=!1,...i}){let r=ih[e?.unit||"decimal"];return(0,I.jsx)(c1,{value:e?{id:e.unit||"decimal",...r}:null,options:EK,groupBy:e=>e.group??"Decimal",onChange:(e,n)=>{null===n?t(void 0):t({unit:n.id})},disabled:n,...i})}let EZ=[{id:"default",label:"Default",decimalPlaces:void 0},{id:"0",label:"0",decimalPlaces:0},{id:"1",label:"1",decimalPlaces:1},{id:"2",label:"2",decimalPlaces:2},{id:"3",label:"3",decimalPlaces:3},{id:"4",label:"4",decimalPlaces:4}];function EQ({value:e,onChange:t,disabled:n=!1}){var i;let r=iS(e),o=iC(e);return(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(cX,{label:"Short values",control:(0,I.jsx)(Ez.A,{checked:!!o&&nj(e.shortValues),onChange:(n,i)=>{o&&t({...e,shortValues:i})},disabled:!o})}),(0,I.jsx)(cX,{label:"Unit",control:(0,I.jsx)(EX,{value:e,onChange:e=>{t(e||{unit:"decimal"})},disabled:n})}),(0,I.jsx)(cX,{label:"Decimals",control:(0,I.jsx)(c1,{value:(i=e.decimalPlaces,EZ.find(e=>e.decimalPlaces===i)),options:EZ,getOptionLabel:e=>e.label,onChange:(n,i)=>(({decimalPlaces:n})=>{r&&t({...e,decimalPlaces:n})})(i),disabled:!r,disableClearable:!0})})]})}function EJ({name:e,height:t}){return(0,I.jsx)(oe.A,{style:{maxWidth:t,top:`calc(${t}px / 2)`},sx:{display:"inline-block",position:"absolute",transform:"translateX(-50%) rotate(-90deg)",transformOrigin:"top",textAlign:"center",zIndex:1},children:(0,I.jsx)(uL.A,{variant:"body1","aria-label":"y axis label",sx:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:e})})}var E0=n(9408);let E1=rS((0,E0.A)({}),{echartsTheme:{textStyle:{fontFamily:"Lato"},categoryAxis:{splitLine:{show:!1}},timeAxis:{splitLine:{show:!1}},bar:{barCategoryGap:2}}}),E2={chartsTheme:E1,enablePinning:!1,enableSyncGrouping:!0,lastTooltipPinnedCoords:null,setLastTooltipPinnedCoords:()=>null};var E5=n(52855);let E3={defaultProps:{variant:"standard",severity:"success"},styleOverrides:{standardError:({theme:e})=>"dark"===e.palette.mode?{...e.typography.body1,backgroundColor:e.palette.error.dark,color:e.palette.error.light,[`& .${E5.A.icon}`]:{color:e.palette.error.main}}:{...e.typography.body1,backgroundColor:e.palette.error.light,color:e.palette.error.dark,[`& .${E5.A.icon}`]:{color:e.palette.error.main}},standardInfo:({theme:e})=>"dark"===e.palette.mode?{...e.typography.body1,backgroundColor:e.palette.info.dark,color:e.palette.info.light,[`& .${E5.A.icon}`]:{color:e.palette.info.main}}:{...e.typography.body1,backgroundColor:e.palette.info.light,color:e.palette.info.dark,[`& .${E5.A.icon}`]:{color:e.palette.info.main}},standardSuccess:({theme:e})=>"dark"===e.palette.mode?{...e.typography.body1,backgroundColor:e.palette.success.dark,color:e.palette.success.light,[`& .${E5.A.icon}`]:{color:e.palette.success.main}}:{...e.typography.body1,backgroundColor:e.palette.success.light,color:e.palette.success.dark,[`& .${E5.A.icon}`]:{color:e.palette.success.main}},standardWarning:({theme:e})=>"dark"===e.palette.mode?{...e.typography.body1,backgroundColor:e.palette.warning.dark,color:e.palette.warning.light,[`& .${E5.A.icon}`]:{color:e.palette.warning.main}}:{...e.typography.body1,backgroundColor:e.palette.warning.light,color:e.palette.warning.dark,[`& .${E5.A.icon}`]:{color:e.palette.warning.main}},root:{["& ."+n(82561).A.root]:{textDecoration:"underline"}}}},E4={styleOverrides:{root:({theme:e})=>({backgroundColor:e.palette.background.default})}},E6={50:"#F0F1F6",100:"#E1E3ED",150:"#D2D5E4",200:"#C3C7DB",300:"#A4ACC8",400:"#8690B6",500:"#717CA4",600:"#535D83",700:"#3E4662",800:"#2A2E42",850:"#1F2331",900:"#151721",950:"#0A0C10"},E8={50:"#E7F1FC",100:"#D0E3FA",150:"#B8D5F7",200:"#A1C7F5",300:"#72ABF0",400:"#438FEB",500:"#1473E6",600:"#105CB8",700:"#0C458A",800:"#082E5C",850:"#062345",900:"#04172E",950:"#020C17"},E9="#FFFFFF",E7=e=>"light"===e?{main:E8["500"],dark:E8["600"],light:E8["50"]}:{main:E8["400"],dark:E8["800"],light:E8["200"]},Oe={50:"#EAF9F1",100:"#D5F2E3",150:"#C1ECD4",200:"#ACE5C6",300:"#82D9AA",400:"#59CC8D",500:"#2FBF71",600:"#26995A",700:"#1C7344",800:"#134C2D",850:"#0E3922",900:"#092617",950:"#05130B"},Ot={50:"#FFF5E8",100:"#FFECD2",150:"#FFE2BB",200:"#FFD9A4",300:"#FFC577",400:"#FFB249",500:"#FF9F1C",600:"#CC7F16",700:"#995F11",800:"#66400B",850:"#4D3008",900:"#332006",950:"#1A1003"},On={50:"#EFE9FD",100:"#E0D2FC",150:"#D0BCFA",200:"#C1A6F8",300:"#A179F5",400:"#824DF1",500:"#6320EE",600:"#4F1ABE",700:"#3B138F",800:"#280D5F",850:"#1E0A47",900:"#140630",950:"#0A0318"},Oi={50:"#FDEDED",100:"#FBDADA",150:"#F9C8C8",200:"#F7B5B5",300:"#F29191",400:"#EE6C6C",500:"#EA4747",600:"#BD3939",700:"#902B2B",800:"#621D1D",850:"#4C1616",900:"#350F0F",950:"#1F0808"},Or={fontFamily:'Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"',fontWeightLight:300,fontWeightRegular:400,fontWeightMedium:600,fontWeightBold:700,h1:{fontSize:"1.5rem",fontWeight:600,lineHeight:"32px"},h2:{fontSize:"1.25rem",fontWeight:600,lineHeight:"28px"},h3:{fontSize:"1rem",fontWeight:600,lineHeight:"24px"},h4:{fontSize:"0.875rem",fontWeight:600,lineHeight:"22px"},h5:void 0,h6:void 0,body1:{fontSize:"0.875rem",fontWeight:400,lineHeight:"20px"},body2:{fontSize:"0.75rem",fontWeight:400,lineHeight:"18px"},subtitle1:{fontSize:"1rem",fontWeight:400,lineHeight:"24px",letterSpacing:"0.02rem"},subtitle2:{fontSize:"0.875rem",fontWeight:600,lineHeight:"22px",letterSpacing:"0.03rem",textTransform:"uppercase"},button:{fontSize:"0.875rem",fontWeight:600,lineHeight:"1.25rem",textTransform:"none",letterSpacing:"0.03rem"},caption:{fontSize:"0.6875rem",fontWeight:400,lineHeight:"16px"}},Oo=({theme:e})=>({..."light"===e.palette.mode?{}:{backgroundImage:"unset",backgroundColor:e.palette.designSystem.grey[800]}});function Os(e,t={},n=!1){var i,r;let o;return(0,E0.A)({palette:function(e){let t,n,i,r;return{mode:e,primary:E7(e),secondary:"light"===e?{main:E6["600"],dark:E6["900"],light:E6["100"]}:{main:E9,dark:E9,light:E9},grey:"light"===e?{50:E6["50"],100:E6["100"],200:E6["200"],300:E6["300"],400:E6["400"],500:E6["500"],600:E6["600"],700:E6["700"],800:E6["800"],900:E6["900"],950:E6["950"]}:{50:E6["950"],100:E6["900"],200:E6["800"],300:E6["700"],400:E6["600"],500:E6["500"],600:E6["400"],700:E6["300"],800:E6["200"],900:E6["100"],950:E6["50"]},background:(t=E8["150"],n="rgba(21, 23, 33, 0.75)","light"===e?{navigation:t,overlay:n,default:E9,paper:E6["50"],code:E6["50"],tooltip:E6["100"],lighter:E6["50"],border:E6["100"]}:{navigation:t,overlay:n,default:E6["900"],paper:E6["850"],code:E6["800"],tooltip:E6["600"],lighter:E6["700"],border:E6["600"]}),text:(i=E6["800"],r=E6["300"],"light"===e?{navigation:i,accent:r,primary:E6["800"],secondary:E6["700"],disabled:E6["300"],link:E8["500"],linkHover:E8["600"]}:{navigation:i,accent:r,primary:E9,secondary:E6["50"],disabled:E6["600"],link:E8["400"],linkHover:E8["500"]}),error:"light"===e?{main:Oi["500"],dark:Oi["600"],light:Oi["50"]}:{main:Oi["400"],dark:Oi["800"],light:Oi["300"]},warning:"light"===e?{main:Ot["500"],dark:Ot["700"],light:Ot["50"]}:{main:Ot["400"],dark:Ot["800"],light:Ot["300"]},info:E7(e),success:"light"===e?{main:Oe["500"],dark:Oe["700"],light:Oe["50"]}:{main:Oe["400"],dark:Oe["800"],light:Oe["300"]},common:{white:E9,black:"#000000"},designSystem:{blue:E8,green:Oe,grey:E6,orange:Ot,purple:On,red:Oi}}}(e),typography:Or,mixins:{},components:(i=e,r=n,o={MuiAlert:E3,MuiFormControl:{defaultProps:{size:"small"}},MuiPaper:E4,MuiTextField:{defaultProps:{size:"small"}},MuiDrawer:{styleOverrides:{paper:Oo}},MuiDialog:{styleOverrides:{paper:Oo}},MuiPopover:{styleOverrides:{paper:Oo}}},r?o:{MuiCssBaseline:{styleOverrides:{body:{colorScheme:i}}},...o}),...t})}var Ol=n(11061),Oa=n(87275),Ou=n(78536),Oc=n(1355);function Oh({value:e,onChange:t}){return(0,I.jsxs)(Z.A,{direction:"row",children:[(0,I.jsx)(cJ.A,{freeSolo:!0,multiple:!0,id:"join-columns",sx:{width:"100%"},options:[],value:e.spec.columns??[],renderInput:e=>(0,I.jsx)(J.A,{...e,variant:"outlined",label:"Columns",required:!0}),onChange:(n,i)=>{t({...e,spec:{...e.spec,columns:i}})}}),(0,I.jsx)(kr.A,{label:"Enabled",labelPlacement:"start",control:(0,I.jsx)(Ez.A,{value:!e.spec.disabled,checked:!e.spec.disabled,onChange:n=>t({...e,spec:{...e.spec,disabled:!n.target.checked}})})})]})}function Od({value:e,onChange:t}){return(0,I.jsxs)(Z.A,{direction:"row",gap:1,alignItems:"center",children:[(0,I.jsx)(cJ.A,{freeSolo:!0,multiple:!0,id:"merge-columns-columns",sx:{width:"100%"},options:[],value:e.spec.columns??[],renderInput:e=>(0,I.jsx)(J.A,{...e,variant:"outlined",label:"Columns",required:!0}),onChange:(n,i)=>{t({...e,spec:{...e.spec,columns:i}})}}),(0,I.jsx)(uX,{id:"merge-columns-name",variant:"outlined",label:"Output Name",value:e.spec.name??"",sx:{width:"100%"},onChange:n=>{t({...e,spec:{...e.spec,name:n}})},required:!0}),(0,I.jsx)(kr.A,{label:"Enabled",labelPlacement:"start",control:(0,I.jsx)(Ez.A,{value:!e.spec.disabled,checked:!e.spec.disabled,onChange:n=>t({...e,spec:{...e.spec,disabled:!n.target.checked}})})})]})}function Of({value:e,onChange:t}){return(0,I.jsxs)(Z.A,{direction:"row",children:[(0,I.jsx)(uX,{id:"merge-indexed-columns",variant:"outlined",label:"Column",placeholder:"Example: 'value' for merging 'value #1', 'value #2' and 'value #...'",value:e.spec.column??"",sx:{width:"100%"},onChange:n=>{t({...e,spec:{...e.spec,column:n}})},required:!0}),(0,I.jsx)(kr.A,{label:"Enabled",labelPlacement:"start",control:(0,I.jsx)(Ez.A,{value:!e.spec.disabled,checked:!e.spec.disabled,onChange:n=>t({...e,spec:{...e.spec,disabled:!n.target.checked}})})})]})}function Op({value:e,onChange:t}){return(0,I.jsx)(Z.A,{direction:"row",children:(0,I.jsx)(kr.A,{label:"Enabled",labelPlacement:"start",control:(0,I.jsx)(Ez.A,{value:!e.spec.disabled,checked:!e.spec.disabled,onChange:n=>t({...e,spec:{...e.spec,disabled:!n.target.checked}})})})})}function Om({value:e,onChange:t,...n}){return(0,I.jsxs)(Z.A,{gap:2,sx:{width:"100%"},mt:1,...n,children:[(0,I.jsxs)(uX,{select:!0,label:"Kind",value:e.kind,onChange:n=>t({...e,kind:n}),children:[(0,I.jsx)(ul.A,{value:"JoinByColumnValue",children:(0,I.jsxs)(Z.A,{children:[(0,I.jsx)(uL.A,{children:"Join by column value"}),(0,I.jsx)(uL.A,{variant:"caption",children:"Regroup rows with equal cell value in a column"})]})}),(0,I.jsx)(ul.A,{value:"MergeColumns",children:(0,I.jsxs)(Z.A,{children:[(0,I.jsx)(uL.A,{children:"Merge columns"}),(0,I.jsx)(uL.A,{variant:"caption",children:"Multiple columns are merged to one column"})]})}),(0,I.jsx)(ul.A,{value:"MergeIndexedColumns",children:(0,I.jsxs)(Z.A,{children:[(0,I.jsx)(uL.A,{children:"Merge indexed columns"}),(0,I.jsx)(uL.A,{variant:"caption",children:"Indexed columns are merged to one column"})]})}),(0,I.jsx)(ul.A,{value:"MergeSeries",children:(0,I.jsxs)(Z.A,{children:[(0,I.jsx)(uL.A,{children:"Merge series"}),(0,I.jsx)(uL.A,{variant:"caption",children:"Series will be merged by their labels"})]})})]}),"JoinByColumnValue"===e.kind&&(0,I.jsx)(Oh,{value:e,onChange:t}),"MergeColumns"===e.kind&&(0,I.jsx)(Od,{value:e,onChange:t}),"MergeIndexedColumns"===e.kind&&(0,I.jsx)(Of,{value:e,onChange:t}),"MergeSeries"===e.kind&&(0,I.jsx)(Op,{value:e,onChange:t})]})}function Og({index:e,value:t,isCollapsed:n,onChange:i,onCollapse:r,onDelete:o,...s}){return(0,I.jsxs)(Z.A,{...s,children:[(0,I.jsxs)(Z.A,{direction:"row",alignItems:"center",borderBottom:1,borderColor:e=>e.palette.divider,justifyContent:"space-between",gap:4,children:[(0,I.jsxs)(Z.A,{direction:"row",gap:1,children:[(0,I.jsx)(Q.A,{"data-testid":`transform-toggle#${e}`,size:"small",onClick:()=>r(!n),children:n?(0,I.jsx)(Ol.default,{}):(0,I.jsx)(Oa.default,{})}),(0,I.jsx)(uL.A,{variant:"overline",component:"h4",sx:{textTransform:"none"},children:t.kind?(0,I.jsx)("span",{children:(0,I.jsx)("strong",{children:iD[t.kind]})}):(0,I.jsx)("strong",{children:"Select a transformation kind"})})]}),(0,I.jsxs)(Z.A,{direction:"row",gap:1,children:[n&&(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(uz.A,{title:t.spec?.disabled?"Enable transformation":"Disable transformation",placement:"top",children:(0,I.jsx)(Q.A,{size:"small",sx:{marginLeft:"auto"},onClick:function(){i({...t,spec:{...t.spec,disabled:!t.spec?.disabled}})},children:t.spec?.disabled?(0,I.jsx)(Ou.default,{}):(0,I.jsx)(Oc.default,{})})}),(0,I.jsx)(ci.A,{flexItem:!0,orientation:"vertical",variant:"middle"})]}),(0,I.jsx)(uz.A,{title:"Remove transformation",placement:"top",children:(0,I.jsx)(Q.A,{size:"small",sx:{marginLeft:"auto"},onClick:o,children:(0,I.jsx)(ky.default,{})})})]})]}),!n&&(0,I.jsx)(Om,{value:t,onChange:i})]})}function Ov({value:e,onChange:t,...n}){let[i,r]=(0,R.useState)(e.map(()=>!0));return(0,I.jsxs)(Z.A,{gap:1,...n,children:[e.map((n,o)=>(0,I.jsx)(Og,{index:o,value:n,isCollapsed:i[o]??!0,onChange:n=>{let i;(i=[...e])[o]=n,t(i)},onDelete:()=>{let n;(n=[...e]).splice(o,1),t(n),r(e=>(e.splice(o,1),[...e]))},onCollapse:e=>{r(t=>(t[o]=e,[...t]))}},o)),(0,I.jsx)(K.A,{variant:"contained",startIcon:(0,I.jsx)(kn.default,{}),sx:{marginTop:1},onClick:function(){let n=[...e];n.push({kind:"",spec:{}}),t(n),r(e=>(e.push(!1),[...e]))},children:"Add Transformation"})]})}function Ob(e){let{value:t,onChange:n,timeOptions:i,height:r}=e,o=(0,R.useMemo)(()=>{if(t&&!i.some(e=>e.value.pastDuration===t))return(0,I.jsx)(ul.A,{value:t,children:t})},[i,t]);return(0,I.jsx)(c$.A,{children:(0,I.jsx)(oe.A,{children:(0,I.jsxs)(ua.A,{id:"refreshInterval",value:t,onChange:e=>{n(e.target.value)},inputProps:{"aria-label":`Select refresh interval. Currently set to ${t}`},sx:{".MuiSelect-select":r?{lineHeight:r,paddingY:0}:{}},children:[i.map((e,t)=>(0,I.jsx)(ul.A,{value:e.value.pastDuration,children:e.display},t)),o]})})})}var Ox=n(94237),Oy=n(7939),Ow=n(26041),OS=n(20523),OC=n(80787);let OA=(e,t,n)=>{let i=e.keys[0];if(Array.isArray(t))t.forEach((t,i)=>{n((t,n)=>{i<=e.keys.length-1&&(0===i?Object.assign(t,n):t[e.up(e.keys[i])]=n)},t)});else if(t&&"object"==typeof t){let r,o;(Object.keys(t).length>e.keys.length?e.keys:(r=e.keys,o=Object.keys(t),r.filter(e=>o.includes(e)))).forEach(r=>{if(e.keys.includes(r)){let o=t[r];void 0!==o&&n((t,n)=>{i===r?Object.assign(t,n):t[e.up(r)]=n},o)}})}else("number"==typeof t||"string"==typeof t)&&n((e,t)=>{Object.assign(e,t)},t)};function Ok(e){return`--Grid-${e}Spacing`}function OM(e){return`--Grid-parent-${e}Spacing`}let OT="--Grid-columns",OD="--Grid-parent-columns",OI=({theme:e,ownerState:t})=>{let n={};return OA(e.breakpoints,t.size,(e,t)=>{let i={};"grow"===t&&(i={flexBasis:0,flexGrow:1,maxWidth:"100%"}),"auto"===t&&(i={flexBasis:"auto",flexGrow:0,flexShrink:0,maxWidth:"none",width:"auto"}),"number"==typeof t&&(i={flexGrow:0,flexBasis:"auto",width:`calc(100% * ${t} / var(${OD}) - (var(${OD}) - ${t}) * (var(${OM("column")}) / var(${OD})))`}),e(n,i)}),n},OR=({theme:e,ownerState:t})=>{let n={};return OA(e.breakpoints,t.offset,(e,t)=>{let i={};"auto"===t&&(i={marginLeft:"auto"}),"number"==typeof t&&(i={marginLeft:0===t?"0px":`calc(100% * ${t} / var(${OD}) + var(${OM("column")}) * ${t} / var(${OD}))`}),e(n,i)}),n},OE=({theme:e,ownerState:t})=>{if(!t.container)return{};let n={[OT]:12};return OA(e.breakpoints,t.columns,(e,t)=>{let i=t??12;e(n,{[OT]:i,"> *":{[OD]:i}})}),n},OO=({theme:e,ownerState:t})=>{if(!t.container)return{};let n={};return OA(e.breakpoints,t.rowSpacing,(t,i)=>{let r="string"==typeof i?i:e.spacing?.(i);t(n,{[Ok("row")]:r,"> *":{[OM("row")]:r}})}),n},OP=({theme:e,ownerState:t})=>{if(!t.container)return{};let n={};return OA(e.breakpoints,t.columnSpacing,(t,i)=>{let r="string"==typeof i?i:e.spacing?.(i);t(n,{[Ok("column")]:r,"> *":{[OM("column")]:r}})}),n},OL=({theme:e,ownerState:t})=>{if(!t.container)return{};let n={};return OA(e.breakpoints,t.direction,(e,t)=>{e(n,{flexDirection:t})}),n},Oj=({ownerState:e})=>({minWidth:0,boxSizing:"border-box",...e.container&&{display:"flex",flexWrap:"wrap",...e.wrap&&"wrap"!==e.wrap&&{flexWrap:e.wrap},gap:`var(${Ok("row")}) var(${Ok("column")})`}}),OB=(0,OC.A)(),OF=(0,Oy.A)("div",{name:"MuiGrid",slot:"Root",overridesResolver:(e,t)=>t.root});function ON(e){return(0,kM.A)({props:e,name:"MuiGrid",defaultTheme:OB})}let OV=function(e={}){let{createStyledComponent:t=OF,useThemeProps:n=ON,useTheme:i=Ow.A,componentName:r="MuiGrid"}=e;function o(e,t,n=()=>!0){let i={};return null===e||(Array.isArray(e)?e.forEach((e,r)=>{null!==e&&n(e)&&t.keys[r]&&(i[t.keys[r]]=e)}):"object"==typeof e?Object.keys(e).forEach(t=>{let r=e[t];null!=r&&n(r)&&(i[t]=r)}):i[t.keys[0]]=e),i}let s=t(OE,OP,OO,OI,OL,Oj,OR),l=R.forwardRef(function(e,t){var l;let a,u=i(),c=n(e),h=(0,OS.A)(c);l=u.breakpoints,a=[],void 0!==h.item&&(delete h.item,a.push("item")),void 0!==h.zeroMinWidth&&(delete h.zeroMinWidth,a.push("zeroMinWidth")),l.keys.forEach(e=>{void 0!==h[e]&&(a.push(e),delete h[e])});let{className:d,children:f,columns:p=12,container:m=!1,component:g="div",direction:v="row",wrap:b="wrap",size:x={},offset:y={},spacing:w=0,rowSpacing:S=w,columnSpacing:C=w,unstable_level:A=0,...k}=h,M=o(x,u.breakpoints,e=>!1!==e),T=o(y,u.breakpoints),D=e.columns??(A?void 0:p),E=e.spacing??(A?void 0:w),L=e.rowSpacing??e.spacing??(A?void 0:S),j=e.columnSpacing??e.spacing??(A?void 0:C),B={...h,level:A,columns:D,container:m,direction:v,wrap:b,spacing:E,rowSpacing:L,columnSpacing:j,size:M,offset:T},F=((e,t)=>{let n,{container:i,direction:o,spacing:s,wrap:l,size:a}=e,u={root:["root",i&&"container","wrap"!==l&&`wrap-xs-${String(l)}`,...void 0===o?[]:"object"==typeof o?Object.entries(o).map(([e,t])=>`direction-${e}-${t}`):[`direction-xs-${String(o)}`],...(n=[],Object.entries(a).forEach(([e,t])=>{!1!==t&&void 0!==t&&n.push(`grid-${e}-${String(t)}`)}),n),...i?((e,t="xs")=>{function n(e){return void 0!==e&&("string"==typeof e&&!Number.isNaN(Number(e))||"number"==typeof e&&e>0)}if(n(e))return[`spacing-${t}-${String(e)}`];if("object"==typeof e&&!Array.isArray(e)){let t=[];return Object.entries(e).forEach(([e,i])=>{n(i)&&t.push(`spacing-${e}-${String(i)}`)}),t}return[]})(s,t.breakpoints.keys[0]):[]]};return(0,P.A)(u,e=>(0,W.Ay)(r,e),{})})(B,u);return(0,I.jsx)(s,{ref:t,as:g,ownerState:B,className:(0,O.A)(F.root,d),...k,children:R.Children.map(f,e=>R.isValidElement(e)&&(0,Ox.A)(e,["Grid"])&&m&&e.props.container?R.cloneElement(e,{unstable_level:e.props?.unstable_level??A+1}):e)})});return l.muiName="Grid",l}({createStyledComponent:(0,F.A)("div",{name:"MuiGrid2",slot:"Root",overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.root,n.container&&t.container]}}),componentName:"MuiGrid2",useThemeProps:e=>(0,H.b)({props:e,name:"MuiGrid2"}),useTheme:r7.A}),OH=({mapping:e,onChange:t,...n})=>{switch(e.kind){case"Value":return(0,I.jsx)(Z.A,{gap:1,direction:"row",...n,children:(0,I.jsx)(J.A,{label:"Value",placeholder:"Exact value",value:e.spec?.value??"",onChange:n=>t({...e,spec:{...e.spec,value:n.target.value}}),fullWidth:!0})});case"Range":return(0,I.jsxs)(Z.A,{gap:1,direction:"row",...n,children:[(0,I.jsx)(J.A,{label:"From",placeholder:"Start of range",value:e.spec?.from??"",onChange:n=>t({...e,spec:{...e.spec,from:""===n.target.value?void 0:+n.target.value}}),fullWidth:!0}),(0,I.jsx)(J.A,{label:"To",placeholder:"End of range (inclusive)",value:e.spec?.to??"",onChange:n=>t({...e,spec:{...e.spec,to:""===n.target.value?void 0:+n.target.value}}),fullWidth:!0})]});case"Regex":return(0,I.jsx)(Z.A,{gap:1,direction:"row",...n,children:(0,I.jsx)(J.A,{label:"Regular Expression",placeholder:"JavaScript regular expression",value:e.spec?.pattern??"",onChange:n=>t({...e,spec:{...e.spec,pattern:n.target.value}}),fullWidth:!0})});case"Misc":return(0,I.jsx)(Z.A,{gap:1,direction:"row",...n,children:(0,I.jsxs)(J.A,{select:!0,label:"Value",value:e.spec?.value??"",onChange:n=>t({...e,spec:{value:n.target.value}}),SelectProps:{renderValue:e=>{switch(e){case"empty":return"Empty";case"null":return"Null";case"NaN":return"NaN";case"true":return"True";case"false":return"False";default:return String(e)}}},fullWidth:!0,children:[(0,I.jsx)(ul.A,{value:"empty",children:(0,I.jsxs)(Z.A,{children:[(0,I.jsx)(uL.A,{children:"Empty"}),(0,I.jsx)(uL.A,{variant:"caption",children:"Matches empty string"})]})}),(0,I.jsx)(ul.A,{value:"null",children:(0,I.jsxs)(Z.A,{children:[(0,I.jsx)(uL.A,{children:"Null"}),(0,I.jsx)(uL.A,{variant:"caption",children:"Matches null or undefined"})]})}),(0,I.jsx)(ul.A,{value:"NaN",children:(0,I.jsxs)(Z.A,{children:[(0,I.jsx)(uL.A,{children:"NaN"}),(0,I.jsx)(uL.A,{variant:"caption",children:"Matches Not a Number value"})]})}),(0,I.jsx)(ul.A,{value:"true",children:(0,I.jsxs)(Z.A,{children:[(0,I.jsx)(uL.A,{children:"True"}),(0,I.jsx)(uL.A,{variant:"caption",children:"Matches true boolean"})]})}),(0,I.jsx)(ul.A,{value:"false",children:(0,I.jsxs)(Z.A,{children:[(0,I.jsx)(uL.A,{children:"False"}),(0,I.jsx)(uL.A,{variant:"caption",children:"Matches false boolean"})]})})]})});default:return null}},Oz=({mapping:e,onChange:t,onDelete:n,...i})=>{let r=n=>{t({...e,spec:{...e.spec,result:{...e.spec.result,color:n}}})};return(0,I.jsxs)(OV,{container:!0,spacing:2,...i,children:[(0,I.jsx)(OV,{size:{xs:5},children:(0,I.jsxs)(Z.A,{direction:"row",gap:1,width:"100%",children:[(0,I.jsxs)(J.A,{select:!0,label:"Type",value:e.kind,onChange:n=>t({...e,kind:n.target.value}),required:!0,sx:{width:"120px"},children:[(0,I.jsx)(ul.A,{value:"Value",children:(0,I.jsxs)(Z.A,{children:[(0,I.jsx)(uL.A,{children:"Value"}),"Value"!==e.kind&&(0,I.jsx)(uL.A,{variant:"caption",children:"Matches an exact text value"})]})}),(0,I.jsx)(ul.A,{value:"Range",children:(0,I.jsxs)(Z.A,{children:[(0,I.jsx)(uL.A,{children:"Range"}),"Range"!==e.kind&&(0,I.jsx)(uL.A,{variant:"caption",children:"Matches against a numerical range"})]})}),(0,I.jsx)(ul.A,{value:"Regex",children:(0,I.jsxs)(Z.A,{children:[(0,I.jsx)(uL.A,{children:"Regex"}),"Regex"!==e.kind&&(0,I.jsx)(uL.A,{variant:"caption",children:"Matches against a regular expression"})]})}),(0,I.jsx)(ul.A,{value:"Misc",children:(0,I.jsxs)(Z.A,{children:[(0,I.jsx)(uL.A,{children:"Misc"}),"Misc"!==e.kind&&(0,I.jsx)(uL.A,{variant:"caption",children:"Matches against empty, null and NaN values"})]})})]}),(0,I.jsx)(OH,{width:"100%",mapping:e,onChange:n=>t({...e,...n})})]})}),(0,I.jsx)(OV,{size:{xs:4},children:(0,I.jsx)(J.A,{label:"Display text",value:e.spec?.result?.value??"",onChange:n=>t({...e,spec:{...e.spec,result:{...e.spec?.result,value:n.target.value}}}),fullWidth:!0})}),(0,I.jsx)(OV,{size:{xs:1},children:(0,I.jsx)(Z.A,{direction:"row",justifyContent:"center",gap:1,children:e.spec?.result?.color?(0,I.jsx)(r8,{label:"Color",color:e.spec.result.color??"#000",onColorChange:r,onClear:()=>r(void 0)}):(0,I.jsx)(Q.A,{onClick:()=>r("#000"),children:(0,I.jsx)(kn.default,{})})})}),(0,I.jsx)(OV,{size:{xs:1},textAlign:"end",children:(0,I.jsx)(uz.A,{title:"Remove mapping settings",placement:"top",children:(0,I.jsx)(Q.A,{size:"small",sx:{marginLeft:"auto"},onClick:n,children:(0,I.jsx)(ky.default,{})})})})]})},OW=({mappings:e,onChange:t})=>{let[n,i]=(0,R.useState)(e);return(0,I.jsxs)(Z.A,{spacing:1,children:[(0,I.jsxs)(OV,{container:!0,spacing:2,children:[(0,I.jsx)(OV,{size:{xs:5},children:(0,I.jsx)(uL.A,{variant:"subtitle1",children:"Condition"})}),(0,I.jsx)(OV,{size:{xs:4},children:(0,I.jsx)(uL.A,{variant:"subtitle1",children:"Display Text"})}),(0,I.jsx)(OV,{size:{xs:1},textAlign:"center",children:(0,I.jsx)(uL.A,{variant:"subtitle1",children:"Color"})}),(0,I.jsx)(OV,{size:{xs:1}})]}),(0,I.jsx)(Z.A,{gap:1.5,divider:(0,I.jsx)(ci.A,{flexItem:!0,orientation:"horizontal"}),children:n.map((e,r)=>(0,I.jsx)(Oz,{mapping:e,onChange:e=>{let o;(o=[...n])[r]=e,i(o),t(o)},onDelete:()=>{let e;(e=[...n]).splice(r,1),i(e),t(e)}},r))}),(0,I.jsx)(K.A,{variant:"contained",startIcon:(0,I.jsx)(kn.default,{}),sx:{marginTop:1},onClick:function(){let e=[...n];e.push({kind:"Value",spec:{result:{value:""}}}),i(e),t(e)},children:"Add value mappings"})]})}},70158(e,t,n){"use strict";var i=this&&this.__assign||function(){return(i=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e}).apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.bindAll=void 0;var r=n(96844);function o(e){if(void 0!==e)return"boolean"==typeof e?{capture:e}:e}t.bindAll=function(e,t,n){var s=t.map(function(t){var s=null==n?t:i(i({},t),{options:i(i({},o(n)),o(t.options))});return(0,r.bind)(e,s)});return function(){s.forEach(function(e){return e()})}}},96844(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.bind=void 0,t.bind=function(e,t){var n=t.type,i=t.listener,r=t.options;return e.addEventListener(n,i,r),function(){e.removeEventListener(n,i,r)}}},96907(e,t,n){"use strict";t.bindAll=t.bind=void 0;var i=n(96844);Object.defineProperty(t,"bind",{enumerable:!0,get:function(){return i.bind}});var r=n(70158);Object.defineProperty(t,"bindAll",{enumerable:!0,get:function(){return r.bindAll}})},68812(e,t,n){var i=n(62140),r=/^\s+/;e.exports=function(e){return e?e.slice(0,i(e)+1).replace(r,""):e}},62140(e){var t=/\s/;e.exports=function(e){for(var n=e.length;n--&&t.test(e.charAt(n)););return n}},46177(e,t,n){var i=n(58953),r=n(43664),o=n(95378),s=Math.max,l=Math.min;e.exports=function(e,t,n){var a,u,c,h,d,f,p=0,m=!1,g=!1,v=!0;if("function"!=typeof e)throw TypeError("Expected a function");function b(t){var n=a,i=u;return a=u=void 0,p=t,h=e.apply(i,n)}function x(e){var n=e-f,i=e-p;return void 0===f||n>=t||n<0||g&&i>=c}function y(){var e,n,i,o=r();if(x(o))return w(o);d=setTimeout(y,(e=o-f,n=o-p,i=t-e,g?l(i,c-n):i))}function w(e){return(d=void 0,v&&a)?b(e):(a=u=void 0,h)}function S(){var e,n=r(),i=x(n);if(a=arguments,u=this,f=n,i){if(void 0===d)return p=e=f,d=setTimeout(y,t),m?b(e):h;if(g)return clearTimeout(d),d=setTimeout(y,t),b(f)}return void 0===d&&(d=setTimeout(y,t)),h}return t=o(t)||0,i(n)&&(m=!!n.leading,c=(g="maxWait"in n)?s(o(n.maxWait)||0,t):c,v="trailing"in n?!!n.trailing:v),S.cancel=function(){void 0!==d&&clearTimeout(d),p=0,a=f=u=d=void 0},S.flush=function(){return void 0===d?h:w(r())},S}},75414(e,t,n){var i=n(87148),r=n(22934);e.exports=function(e){return"symbol"==typeof e||r(e)&&"[object Symbol]"==i(e)}},43664(e,t,n){var i=n(41433);e.exports=function(){return i.Date.now()}},95378(e,t,n){var i=n(68812),r=n(58953),o=n(75414),s=0/0,l=/^[-+]0x[0-9a-f]+$/i,a=/^0b[01]+$/i,u=/^0o[0-7]+$/i,c=parseInt;e.exports=function(e){if("number"==typeof e)return e;if(o(e))return s;if(r(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=r(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=i(e);var n=a.test(e);return n||u.test(e)?c(e.slice(2),n?2:8):l.test(e)?s:+e}},24300(e,t,n){"use strict";var i;t.default=void 0,t.default=(0,((i=n(1448))&&i.__esModule?i:{default:i}).default)("M19,19H5V8H19M16,1V3H8V1H6V3H5C3.89,3 3,3.89 3,5V19A2,2 0 0,0 5,21H19A2,2 0 0,0 21,19V5C21,3.89 20.1,3 19,3H18V1M17,12H12V17H17V12Z","Calendar")},29618(e,t,n){"use strict";var i;t.default=void 0,t.default=(0,((i=n(1448))&&i.__esModule?i:{default:i}).default)("M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2Z","Circle")},98029(e,t,n){"use strict";var i;t.default=void 0,t.default=(0,((i=n(1448))&&i.__esModule?i:{default:i}).default)("M19,4H15.5L14.5,3H9.5L8.5,4H5V6H19M6,19A2,2 0 0,0 8,21H16A2,2 0 0,0 18,19V7H6V19Z","Delete")},53064(e,t,n){"use strict";var i;t.default=void 0,t.default=(0,((i=n(1448))&&i.__esModule?i:{default:i}).default)("M7,19V17H9V19H7M11,19V17H13V19H11M15,19V17H17V19H15M7,15V13H9V15H7M11,15V13H13V15H11M15,15V13H17V15H15M7,11V9H9V11H7M11,11V9H13V11H11M15,11V9H17V11H15M7,7V5H9V7H7M11,7V5H13V7H11M15,7V5H17V7H15Z","Drag")},26684(e,t,n){"use strict";var i;t.default=void 0,t.default=(0,((i=n(1448))&&i.__esModule?i:{default:i}).default)("M17.9,17.39C17.64,16.59 16.89,16 16,16H15V13A1,1 0 0,0 14,12H8V10H10A1,1 0 0,0 11,9V7H13A2,2 0 0,0 15,5V4.59C17.93,5.77 20,8.64 20,12C20,14.08 19.2,15.97 17.9,17.39M11,19.93C7.05,19.44 4,16.08 4,12C4,11.38 4.08,10.78 4.21,10.21L9,15V16A2,2 0 0,0 11,18M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2Z","Earth")},78536(e,t,n){"use strict";var i;t.default=void 0,t.default=(0,((i=n(1448))&&i.__esModule?i:{default:i}).default)("M2,5.27L3.28,4L20,20.72L18.73,22L15.65,18.92C14.5,19.3 13.28,19.5 12,19.5C7,19.5 2.73,16.39 1,12C1.69,10.24 2.79,8.69 4.19,7.46L2,5.27M12,9A3,3 0 0,1 15,12C15,12.35 14.94,12.69 14.83,13L11,9.17C11.31,9.06 11.65,9 12,9M12,4.5C17,4.5 21.27,7.61 23,12C22.18,14.08 20.79,15.88 19,17.19L17.58,15.76C18.94,14.82 20.06,13.54 20.82,12C19.17,8.64 15.76,6.5 12,6.5C10.91,6.5 9.84,6.68 8.84,7L7.3,5.47C8.74,4.85 10.33,4.5 12,4.5M3.18,12C4.83,15.36 8.24,17.5 12,17.5C12.69,17.5 13.37,17.43 14,17.29L11.72,15C10.29,14.85 9.15,13.71 9,12.28L5.6,8.87C4.61,9.72 3.78,10.78 3.18,12Z","EyeOffOutline")},1355(e,t,n){"use strict";var i;t.default=void 0,t.default=(0,((i=n(1448))&&i.__esModule?i:{default:i}).default)("M12,9A3,3 0 0,1 15,12A3,3 0 0,1 12,15A3,3 0 0,1 9,12A3,3 0 0,1 12,9M12,4.5C17,4.5 21.27,7.61 23,12C21.27,16.39 17,19.5 12,19.5C7,19.5 2.73,16.39 1,12C2.73,7.61 7,4.5 12,4.5M3.18,12C4.83,15.36 8.24,17.5 12,17.5C15.76,17.5 19.17,15.36 20.82,12C19.17,8.64 15.76,6.5 12,6.5C8.24,6.5 4.83,8.64 3.18,12Z","EyeOutline")},98599(e,t,n){"use strict";var i;t.default=void 0,t.default=(0,((i=n(1448))&&i.__esModule?i:{default:i}).default)("M9.5,3A6.5,6.5 0 0,1 16,9.5C16,11.11 15.41,12.59 14.44,13.73L14.71,14H15.5L20.5,19L19,20.5L14,15.5V14.71L13.73,14.44C12.59,15.41 11.11,16 9.5,16A6.5,6.5 0 0,1 3,9.5A6.5,6.5 0 0,1 9.5,3M9.5,5C7,5 5,7 5,9.5C5,12 7,14 9.5,14C12,14 14,12 14,9.5C14,7 12,5 9.5,5Z","Magnify")},4491(e,t,n){"use strict";var i;t.default=void 0,t.default=(0,((i=n(1448))&&i.__esModule?i:{default:i}).default)("M16,12V4H17V2H7V4H8V12L6,14V16H11.2V22H12.8V16H18V14L16,12Z","Pin")},16979(e,t,n){"use strict";var i;t.default=void 0,t.default=(0,((i=n(1448))&&i.__esModule?i:{default:i}).default)("M16.59,5.41L15.17,4L12,7.17L8.83,4L7.41,5.41L12,10M7.41,18.59L8.83,20L12,16.83L15.17,20L16.58,18.59L12,14L7.41,18.59Z","UnfoldLessHorizontal")},9323(e,t,n){"use strict";var i;t.default=void 0,t.default=(0,((i=n(1448))&&i.__esModule?i:{default:i}).default)("M12,18.17L8.83,15L7.42,16.41L12,21L16.59,16.41L15.17,15M12,5.83L15.17,9L16.58,7.59L12,3L7.41,7.59L8.83,9L12,5.83Z","UnfoldMoreHorizontal")},12933(e,t,n){"use strict";var i;t.default=void 0,t.default=(0,((i=n(1448))&&i.__esModule?i:{default:i}).default)("M16,5V18H21V5M4,18H9V5H4M10,18H15V5H10V18Z","ViewColumn")},77440(e,t,n){!function(e,t){"use strict";var n=function(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach(function(n){if("default"!==n){var i=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,i.get?i:{enumerable:!0,get:function(){return e[n]}})}}),t.default=e,Object.freeze(t)}(t);function i(e,t){return(i=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var r={error:null},o=function(e){function t(){for(var t,n=arguments.length,i=Array(n),o=0;o<n;o++)i[o]=arguments[o];return(t=e.call.apply(e,[this].concat(i))||this).state=r,t.resetErrorBoundary=function(){for(var e,n=arguments.length,i=Array(n),r=0;r<n;r++)i[r]=arguments[r];null==t.props.onReset||(e=t.props).onReset.apply(e,i),t.reset()},t}t.prototype=Object.create(e.prototype),t.prototype.constructor=t,i(t,e),t.getDerivedStateFromError=function(e){return{error:e}};var o=t.prototype;return o.reset=function(){this.setState(r)},o.componentDidCatch=function(e,t){var n,i;null==(n=(i=this.props).onError)||n.call(i,e,t)},o.componentDidUpdate=function(e,t){var n,i,r,o,s=this.state.error,l=this.props.resetKeys;null!==s&&null!==t.error&&(void 0===(n=e.resetKeys)&&(n=[]),void 0===(i=l)&&(i=[]),n.length!==i.length||n.some(function(e,t){return!Object.is(e,i[t])}))&&(null==(r=(o=this.props).onResetKeysChange)||r.call(o,e.resetKeys,l),this.reset())},o.render=function(){var e=this.state.error,t=this.props,i=t.fallbackRender,r=t.FallbackComponent,o=t.fallback;if(null!==e){var s={error:e,resetErrorBoundary:this.resetErrorBoundary};if(n.isValidElement(o))return o;if("function"==typeof i)return i(s);if(r)return n.createElement(r,s);else throw Error("react-error-boundary requires either a fallback, fallbackRender, or FallbackComponent prop")}return this.props.children},t}(n.Component);e.ErrorBoundary=o,e.useErrorHandler=function(e){var t=n.useState(null),i=t[0],r=t[1];if(null!=e)throw e;if(null!=i)throw i;return r},e.withErrorBoundary=function(e,t){var i=function(i){return n.createElement(o,t,n.createElement(e,i))};return i.displayName="withErrorBoundary("+(e.displayName||e.name||"Unknown")+")",i},Object.defineProperty(e,"__esModule",{value:!0})}(t,n(70451))}}]);
|