@perses-dev/table-plugin 0.6.0 → 0.6.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/css/async/2569.cbbd94a8.css +1 -0
- package/__mf/js/{6487.f255ba88.js → 6487.ac0b3bec.js} +1 -1
- package/__mf/js/{Table.510470af.js → Table.dcb50d79.js} +3 -3
- package/__mf/js/async/133.46388a8d.js +1 -0
- package/__mf/js/async/2292.42e8992b.js +2 -0
- package/__mf/js/async/3079.9e782657.js +23 -0
- package/__mf/js/async/{3224.fbb884ab.js → 3224.673940ed.js} +1 -1
- package/__mf/js/async/{468.cca77551.js → 3372.d4622f1a.js} +7 -7
- package/__mf/js/async/{4075.4fb81a28.js → 4075.16e3dc8a.js} +1 -1
- package/__mf/js/async/4300.4e662fdf.js +38 -0
- package/__mf/js/async/{5409.3c667e6d.js → 5409.33ed27cd.js} +1 -1
- package/__mf/js/async/5677.c54b356e.js +1 -0
- package/__mf/js/async/5767.f16855a4.js +1 -0
- package/__mf/js/async/6277.853e296a.js +23 -0
- package/__mf/js/async/6284.0d33a1ae.js +1 -0
- package/__mf/js/async/6357.e10e2a7f.js +1 -0
- package/__mf/js/async/{654.fd64ef4b.js → 654.0d5da894.js} +1 -1
- package/__mf/js/async/6913.1b3a7693.js +1 -0
- package/__mf/js/async/8565.0065c3c7.js +1 -0
- package/__mf/js/async/{894.1c4bbdb5.js → 894.0035563b.js} +1 -1
- package/__mf/js/async/8981.3989d84b.js +1 -0
- package/__mf/js/async/9010.06449312.js +1 -0
- package/__mf/js/async/9057.2b54c435.js +1 -0
- package/__mf/js/async/{6757.5675a614.js → 922.d9680010.js} +5 -5
- package/__mf/js/async/9354.fc319e8b.js +1 -0
- package/__mf/js/async/__federation_expose_Table.07bc26cc.js +1 -0
- package/__mf/js/main.62569baf.js +1 -0
- package/mf-manifest.json +99 -104
- package/mf-stats.json +102 -107
- package/package.json +5 -12
- package/__mf/js/async/1722.586085f2.js +0 -1
- package/__mf/js/async/1996.e0e5fb2a.js +0 -2
- package/__mf/js/async/2399.8ceb88c6.js +0 -23
- package/__mf/js/async/3001.51d0062c.js +0 -1
- package/__mf/js/async/3598.66df4cef.js +0 -1
- package/__mf/js/async/3660.4a5855e1.js +0 -23
- package/__mf/js/async/3893.f1c71cae.js +0 -1
- package/__mf/js/async/4446.9a215492.js +0 -1
- package/__mf/js/async/4741.ceabfbaa.js +0 -38
- package/__mf/js/async/5662.d6ae2721.js +0 -1
- package/__mf/js/async/5767.6be60775.js +0 -1
- package/__mf/js/async/6884.5426473f.js +0 -1
- package/__mf/js/async/8444.d0d247d8.js +0 -1
- package/__mf/js/async/8807.f0e4209b.js +0 -1
- package/__mf/js/async/9010.8332598b.js +0 -1
- package/__mf/js/async/9509.e6075bf0.js +0 -1
- package/__mf/js/async/__federation_expose_Table.0b081d4a.js +0 -1
- package/__mf/js/main.fa5edfce.js +0 -1
- /package/__mf/js/async/{1996.e0e5fb2a.js.LICENSE.txt → 2292.42e8992b.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{468.cca77551.js.LICENSE.txt → 3372.d4622f1a.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{6757.5675a614.js.LICENSE.txt → 922.d9680010.js.LICENSE.txt} +0 -0
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkTable=self.webpackChunkTable||[]).push([["3660"],{76726:function(e,t,n){let r;n.r(t),n.d(t,{ErrorAlert:()=>tD,JSONEditor:()=>tH,INCREASE_NEARBY_SERIES_MULTIPLIER:()=>nN,OptionsEditorGroup:()=>n7,DensitySelector:()=>tu,assembleTransform:()=>n_,clearHighlightedSeries:()=>nM,getColorsForValues:()=>ib,ErrorBoundary:()=>tI.ErrorBoundary,SeriesMarker:()=>nm,TimeRangeSelector:()=>rk,testChartsTheme:()=>rz,ChartsThemeContext:()=>b,TextOverlay:()=>n4,hexToHSL:()=>ij,DEFAULT_COLUMN_HEIGHT:()=>eT,useMousePosition:()=>nc,NoDataOverlay:()=>n8,generateChartsTheme:()=>rR,OptionsEditorGrid:()=>n6,OPTIMIZED_MODE_SERIES_LIMIT:()=>nZ,TOOLTIP_ADJUST_Y_POS_MULTIPLIER:()=>t8,DiscardChangesConfirmationDialog:()=>e3,getDateRange:()=>P,EMPHASIZED_SERIES_DESCRIPTION:()=>nn,useChartsTheme:()=>C,persesColumnsToTanstackColumns:()=>eM,mockChartsContext:()=>rW,Legend:()=>eG,TOOLTIP_DATE_FORMAT:()=>ni,TOOLTIP_MAX_WIDTH:()=>t7,dateFormatOptionsWithTimeZone:()=>tK,legacyCheckforNearbySeries:()=>nz,ToolbarIconButton:()=>rA,PIN_TOOLTIP_HELP_TEXT:()=>nh,checkforNearbyTimeSeries:()=>nO,getTheme:()=>r3,PieChart:()=>ih,TooltipHeader:()=>nw,TOOLTIP_BG_COLOR_FALLBACK:()=>nr,UNPIN_TOOLTIP_HELP_TEXT:()=>np,DateTimeRangePicker:()=>rS,handleMoveUp:()=>tw,browser:()=>na,getClosestTimestamp:()=>nL,formatWithTimeZone:()=>tq,batchDispatchNearbySeriesActions:()=>nI,getFormattedAxis:()=>R,useTimeZone:()=>t2,ChartsProvider:()=>y,isWithinPercentageRange:()=>nH,TOOLTIP_MIN_WIDTH:()=>t6,StatusHistoryChart:()=>im,TOOLTIP_LABELS_MAX_WIDTH:()=>t4,getYBuffer:()=>nB,DEFAULT_PINNED_CROSSHAIR:()=>nk,LineChartTooltip:()=>nU,FormatControls:()=>rI,TooltipContent:()=>ny,hslToHex:()=>iC,SHOW_FEWER_SERIES_LIMIT:()=>nP,TimeChartTooltip:()=>rx,getClosestTimestampInFullDataset:()=>nF,getTableCellLayout:()=>eA,pointerEventsSupported:()=>ns,EChart:()=>L,PINNED_CROSSHAIR_SERIES_NAME:()=>nS,SortSelector:()=>rt,SnackbarProvider:()=>rL.wT,Drawer:()=>tA,AlignSelector:()=>a,LinksEditor:()=>nJ,ValueMappingsEditor:()=>ik,TimeZoneContext:()=>t1,GaugeChart:()=>tP,LineChart:()=>nY,SeriesLabelsStack:()=>nf,checkCrosshairPinnedStatus:()=>nE,StatChart:()=>rl,SeriesInfo:()=>nv,ColorPicker:()=>V,Table:()=>eB,useSnackbar:()=>rF,InfoTooltip:()=>tr,TimeZoneProvider:()=>t5,LoadingOverlay:()=>n9,typography:()=>r6,Dialog:()=>e7,DropIndicator:()=>th,TransformsEditor:()=>id,OptionsEditorControl:()=>to,TOOLTIP_PADDING:()=>t9,getFormattedAxisLabel:()=>tQ,SortSelectorButtons:()=>rn,getTooltipStyles:()=>nV,useChartsContext:()=>j,RefreshIntervalPicker:()=>ic,enableDataZoom:()=>nT,useDragAndDropMonitor:()=>tv,trackingEventName:()=>nd,combineSx:()=>en,OptionsEditorColumn:()=>n2,getDateAndTime:()=>t0,ThresholdsEditor:()=>rp,DEFAULT_TOOLTIP_CONFIG:()=>nu,handleMoveDown:()=>tZ,DragButton:()=>tS,useId:()=>te,ContentWithLegend:()=>eK,BarChart:()=>O,getFormattedDate:()=>tJ,NEARBY_SERIES_DESCRIPTION:()=>nt,getColorForValue:()=>iy,isLegendItemVisuallySelected:()=>eo,getPointInGrid:()=>nD,EMPTY_TOOLTIP_DATA:()=>no,legacyGetNearbySeriesData:()=>n$,buildRelativeTimeOption:()=>rP,SettingsAutocomplete:()=>td,FontSizeSelector:()=>tL,defaultCursorData:()=>nl,DYNAMIC_NEARBY_SERIES_MULTIPLIER:()=>nR,FALLBACK_COLOR:()=>iv,getNearbySeriesData:()=>nW,TOOLTIP_MAX_HEIGHT:()=>t3,YAxisLabel:()=>rE,TimeChart:()=>rm,FALLBACK_CHART_WIDTH:()=>ne,DragAndDropElement:()=>ty,getResponsiveValueSize:()=>tO,restoreChart:()=>nA,ModeSelector:()=>n1,TextField:()=>eq,DEFAULT_COLUMN_WIDTH:()=>ek,FormActions:()=>tN,OptionsColorPicker:()=>X});var i=n(24246),l=n(10970),o=n(48565);function a({onChange:e,value:t="left",...n}){let r=t=>{e(t)};return(0,i.jsxs)(l.Z,{"aria-label":"Alignement",...n,children:[(0,i.jsx)(o.Z,{onClick:()=>r("left"),variant:"left"===t?"contained":"outlined",children:"Left"},"left"),(0,i.jsx)(o.Z,{onClick:()=>r("center"),variant:"center"===t?"contained":"outlined",children:"Center"},"center"),(0,i.jsx)(o.Z,{onClick:()=>r("right"),variant:"right"===t?"contained":"outlined",children:"Right"},"right")]})}var s=n(54538),d=n.n(s),c=n(51278),u=n(36232),h=n(508),p=n(65201),g=n(99635),x=n(23709),m=n(67745),f=n(50378),v=n(36372);function y(e){let{children:t,chartsTheme:n,enablePinning:r=!1}=e,[l,o]=(0,s.useState)(null),a=(0,s.useMemo)(()=>({chartsTheme:n,enablePinning:r,lastTooltipPinnedCoords:l,setLastTooltipPinnedCoords:o}),[n,r,l,o]);return(0,i.jsx)(b.Provider,{value:a,children:t})}let b=(0,s.createContext)(void 0);function j(){let e=(0,s.useContext)(b);if(void 0===e)throw Error("No ChartsThemeContext found. Did you forget a Provider?");return e}function C(){return j().chartsTheme}var w=n(59161),Z=n(56141),S=n.n(Z),k=n(66726),T=n.n(k),A=n(8890),M=n(48906),D=n(27806);(0,u.D)([g.N,M.N,D.N,A.N,p.N,x.N,m.N,f.N]);let I=["click","dblclick","mousedown","mousemove","mouseup","mouseover","mouseout","globalout","contextmenu"],E=["datazoom","downplay","highlight"],L=(0,s.memo)(function({option:e,theme:t,renderer:n,sx:r,onEvents:l,_instance:o,syncGroup:a,onChartInitialized:d}){let c=(0,s.useRef)(e),u=(0,s.useRef)(e),h=(0,s.useRef)(null),p=(0,s.useRef)(null);return(0,s.useLayoutEffect)(()=>{if(null!==h.current&&null===p.current&&(p.current=(0,w.S1)(h.current,t,{renderer:n??"canvas"}),void 0!==p.current))return p.current.setOption(c.current,!0),d?.(p.current),void 0!==o&&(o.current=p.current),()=>{null!==p.current&&(p.current.dispose(),p.current=null)}},[o,d,t,n]),(0,s.useEffect)(()=>{p.current&&a&&(p.current.group=a,(0,w.$j)([p.current]))},[a,p]),(0,s.useEffect)(()=>{!(void 0===u.current||S()(u.current,e))&&p.current&&(p.current.setOption(e,!0),u.current=e)},[e]),(0,s.useLayoutEffect)(()=>{let e=T()(()=>{p.current&&p.current.resize()},200);return window.addEventListener("resize",e),e(),()=>{window.removeEventListener("resize",e)}},[]),(0,s.useEffect)(()=>{let e=p.current;if(e&&void 0!==l)return function(e,t){if(void 0!==t){for(let n in t)if(Object.prototype.hasOwnProperty.call(t,n)){let r=t[n]??null;r&&function(t,n){var r,i;"function"==typeof n&&((r=t,I.includes(r))?e.on(t,t=>n(t,e)):(i=t,E.includes(i))?e.on(t,e=>n(e)):e.on(t,()=>n(null,e)))}(n,r)}}}(e,l),()=>{if(void 0!==e&&!0!==e.isDisposed())for(let t in l)e.off(t)}},[l]),(0,s.useEffect)(()=>{T()(()=>{p.current&&p.current.resize()},200,{leading:!0})()},[r]),(0,i.jsx)(v.Z,{ref:h,sx:r})});var F=n(15409),N=n.n(F);function R(e,t){return[N()({type:"value",boundaryGap:[0,"10%"],axisLabel:{formatter:e=>(0,c.formatValue)(e,t)}},e)]}function P(e){if(0===e.length)return 36e5;let t=e[e.length-1];return void 0===e[0]||void 0===t?36e5:t-e[0]}function O(e){let{width:t,height:n,data:r,format:l={unit:"decimal"},mode:o="value"}=e,a=C(),d=(0,s.useMemo)(()=>{if(!r||!r.length)return a.noDataOption;let e=[];return r.map(t=>{e.push([t.label,t.value])}),{title:{show:!1},dataset:[{dimensions:["label","value"],source:e}],xAxis:R({},l),yAxis:{type:"category",splitLine:{show:!1},axisLabel:{overflow:"truncate",width:t/3}},series:{type:"bar",label:{show:!0,position:"right",formatter:e=>e.data[1]?"percentage"===o?(0,c.formatValue)(e.data[1],{unit:"percent",decimalPlaces:l.decimalPlaces}):(0,c.formatValue)(e.data[1],l):void 0,barMinWidth:14,barCategoryGap:6},itemStyle:{borderRadius:4,color:a.echartsTheme[0]}},tooltip:{appendToBody:!0,confine:!0,formatter:e=>e.data[1]&&`<b>${e.name}</b>   ${(0,c.formatValue)(e.data[1],l)}`},grid:{left:"5%",right:"5%"}}},[r,a,t,o,l]);return(0,i.jsx)(v.Z,{style:{width:t,height:n},sx:{overflow:"auto"},children:(0,i.jsx)(L,{sx:{minHeight:n,height:r?20*r.length:"100%"},option:d,theme:a.echartsTheme})})}(0,u.D)([h.N,p.N,g.N,x.N,m.N,f.N]);var z=n(25283),W=n(75094),$=n(8695),H=n(53094),B=n(20791),_=n(80354);let V=({color:e,onChange:t,onClear:n,palette:r})=>{let[l,o]=(0,s.useState)(e),a=e=>{o(e),t?.(e)};return(0,i.jsxs)(z.Z,{spacing:1,children:[(0,i.jsx)(H.gW,{color:e,onChange:a,style:{width:"100%"}}),(0,i.jsx)(z.Z,{direction:"row",flexWrap:"wrap",justifyContent:"space-evenly",width:"200px",children:r&&r.map((e,t)=>(0,i.jsx)(W.Z,{size:"small","aria-label":`change color to ${e}`,sx:{color:e},onClick:()=>a(e),children:(0,i.jsx)(B.default,{})},t))}),(0,i.jsxs)(z.Z,{direction:"row",gap:1,alignItems:"center",children:[(0,i.jsx)($.Z,{inputProps:{"aria-label":"enter hex color"},fullWidth:!0,value:l,onChange:e=>{let n=e.target.value.replace(/([^0-9A-F]+)/gi,"").substring(0,8);o(`#${n}`),U(e.target.value)&&t?.(e.target.value)}}),n&&(0,i.jsx)(W.Z,{onClick:n,children:(0,i.jsx)(_.default,{})})]})]})},U=(e,t)=>{let n=/^#?([0-9A-F]{3,8})$/i.exec(e),r=n&&n[1]?n[1].length:0;return 3===r||6===r||!!t&&4===r||!!t&&8===r};var Y=n(6714),G=n(12709);function X({label:e,color:t,onColorChange:n,onClear:r}){let[l,o]=(0,s.useState)(null),a=!!l,{thresholds:{defaultColor:d,palette:c}}=C();return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(K,{size:"small","aria-label":`change ${e} color`,isSelected:a,iconColor:t,onClick:e=>{o(e.currentTarget)},children:(0,i.jsx)(B.default,{})}),(0,i.jsx)(Y.ZP,{"data-testid":"options color picker",open:a,anchorEl:l,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)(V,{color:t,palette:[d,...c],onChange:n,onClear:r})})]})}let K=(0,G.ZP)(W.Z,{shouldForwardProp:e=>"isSelected"!==e&&"iconColor"!==e})(({iconColor:e,isSelected:t})=>({backgroundColor:t&&e?`${e}3F`:"undefined",color:e}));var q=n(94776),J=n(75586),Q=n(83675),ee=n(73845),et=n(12577);function en(...e){return e.flatMap(e=>void 0===e?[]:Array.isArray(e)?e:[e])}let er=(0,s.memo)(function({color:e,sx:t,...n}){return(0,i.jsx)(v.Z,{...n,sx:en({height:4,width:16,margin:e=>e.spacing(.5)},t),style:{backgroundColor:e}})}),ei=(0,s.forwardRef)(function({item:e,sx:t,truncateLabel:n,onClick:r,isVisuallySelected:l,onMouseOver:o,onMouseOut:a,index:d,...c},u){let[h,p]=(0,s.useState)(n);return(0,i.jsxs)(ee.Z,{...c,role:"listitem",sx:en({padding:0,cursor:"pointer"},t),dense:!0,onClick:t=>{r(t,e.id),e.onClick?.(t)},onMouseOver:t=>o?.(t,{id:e.id,index:d}),onMouseOut:t=>a?.(t,{id:e.id,index:d}),selected:l,ref:u,children:[(0,i.jsx)(v.Z,{sx:{display:"flex",alignItems:"center"},children:(0,i.jsx)(er,{color:e.color})}),(0,i.jsx)(et.Z,{primary:e.label,primaryTypographyProps:{noWrap:h},onMouseOver:function(){n&&p(!1)},onMouseOut:function(){n&&p(!0)}})]})}),el=(0,s.memo)(ei);function eo(e,t){return"ALL"!==t&&!!t[e.id]}function ea({items:e,height:t,width:n,selectedItems:r,onLegendItemClick:l,onItemMouseOver:o,onItemMouseOut:a}){let s=e.length>5;return(0,i.jsx)(Q.OO,{style:{height:t,width:n},data:e,itemContent:(e,t)=>(0,i.jsx)(el,{item:t,index:e,truncateLabel:s,isVisuallySelected:eo(t,r),onClick:l,onMouseOver:o,onMouseOut:a,sx:{width:"100%",wordBreak:"break-word",overflow:"hidden"}},t.id),role:"list"})}function es({height:e,items:t,selectedItems:n,onLegendItemClick:r,onItemMouseOver:l,onItemMouseOut:o}){return(0,i.jsx)(v.Z,{component:"ul",sx:{width:"100%",height:e,padding:[0,1,0,0],overflowY:"scroll",margin:0},children:t.map((e,t)=>(0,i.jsx)(el,{item:e,index:t,isVisuallySelected:eo(e,n),onMouseOver:l,onMouseOut:o,onClick:r,sx:{width:"auto",float:"left",paddingRight:1.5}},e.id))})}var ed=n(22577),ec=n(80900),eu=n(14968),eh=n(16838);let ep=(0,s.forwardRef)(function(e,t){return(0,i.jsx)(eu.Z,{...e,ref:t,sx:{backgroundColor:e=>e.palette.background.default,"&:hover":{backgroundColor:e=>(0,eh.Fq)(e.palette.primary.main,e.palette.action.hoverOpacity)}}})});var eg=n(56174);let ex=(0,s.forwardRef)(function(e,t){return(0,i.jsx)(eg.Z,{...e,ref:t})});var em=n(90190);let ef=(0,G.ZP)(em.Z)(({theme:e})=>({tableLayout:"fixed",borderCollapse:"separate",backgroundColor:e.palette.background.default})),ev={compact:"small",standard:"medium",comfortable:"medium"},ey=(0,s.forwardRef)(function({density:e,...t},n){return(0,i.jsx)(ef,{...t,tabIndex:-1,size:ev[e],ref:n,sx:{width:"100%"}})});var eb=n(31889);let ej=(0,s.forwardRef)(function(e,t){return(0,i.jsx)(eb.Z,{...e,ref:t})});var eC=n(52054),ew=n(78214),eZ=n(23147),eS=n(96205);let ek=150,eT=40;function eA(e,t,{isHeader:n,isLastColumn:r,isFirstColumn:i,defaultColumnHeight:l}={}){var o,a;let s=e.spacing(1),d=e.spacing(1.25),c=e.spacing(2),u=i?c:d,h=r?c:d,p=e.typography.body1.lineHeight,g=e.typography.body1.fontSize;"compact"===t&&(s=e.spacing(.5),d=e.spacing(.5),c=e.spacing(1),u=i?c:d,h=r?c:d,p=e.typography.body2.lineHeight,g=e.typography.body2.fontSize),"comfortable"===t&&(s=e.spacing(2),d=e.spacing(1.5),c=e.spacing(2),u=i?c:d,h=r?c:d,p=e.typography.body1.lineHeight,g=e.typography.body1.fontSize);let x=n||!l||"auto"===l?(o=p,a=s,("string"==typeof o?parseInt(o,10):o??0)+2*("string"==typeof a?parseInt(a,10):a)):l;return{padding:`${s} ${h} ${s} ${u}`,height:x,fontSize:g,lineHeight:p}}function eM(e){return e.map(({width:e,align:t,headerDescription:n,cellDescription:r,enableSorting:i,...l})=>({...l,..."auto"===e||void 0===e?{size:0,minSize:0,maxSize:0}:{size:e},enableSorting:!!i,meta:{align:t,headerDescription:n,cellDescription:r}}))}let eD=(0,G.ZP)(eS.Z)(({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 eI({children:e,density:t,variant:n,width:r,defaultColumnHeight:l,focusState:o="none",onFocusTrigger:a,isFirstColumn:d,isLastColumn:c,description:u,align:h,color:p,backgroundColor:g,...x}){let m=(0,q.Z)(),f=(0,s.useRef)(),y="head"===n;(0,s.useEffect)(()=>{"trigger-focus"===o&&f.current&&f.current.focus()},[o]);let b=e=>{a?.(e)};return(0,i.jsx)(eD,{...x,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:b,onKeyUp:b,style:{width:r},sx:{position:"relative",borderBottom:y?`solid 1px ${m.palette.grey[100]}`:`solid 1px ${m.palette.grey[50]}`,"&:hover #original-cell":{position:"absolute",top:0,left:0,zIndex:10,width:"fit-content",minWidth:"100%",whiteSpace:"nowrap",overflow:"visible",backgroundColor:`${g??m.palette.background.default} !important`,outline:`solid 1px ${m.palette.info.main}`,outlineOffset:"-1px"}},ref:f,children:(0,i.jsx)(v.Z,{id:"original-cell",sx:{...eA(m,t,{isHeader:y,isLastColumn:c,isFirstColumn:d,defaultColumnHeight:l}),position:"relative",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",flexDirection:"inherit"},style:{backgroundColor:g??"inherit",color:p??"inherit"},title:u,"aria-label":u,textAlign:h,children:e})})}function eE({onSort:e,sortDirection:t,nextSortDirection:n,children:r,...l}){let o=!!e,a=(0,i.jsx)(eC.Z,{noWrap:!0,variant:"inherit",component:"div",color:"inherit",children:r}),s=!!t;return(0,i.jsx)(eI,{...l,children:o?(0,i.jsx)(ew.Z,{onClick:e,direction:s?t:n,active:s,sx:{verticalAlign:"unset",maxWidth:"100%","&:focus-visible":{[`& .${eZ.Z.icon}`]:{opacity:s?1:.5}}},children:a}):a})}var eL=n(59019);let eF=(0,s.forwardRef)(function(e,t){return(0,i.jsx)(eL.Z,{...e,tabIndex:-1,ref:t})}),eN={row:0,column:0},eR=["ArrowRight","ArrowLeft","ArrowUp","ArrowDown"];function eP({width:e,height:t,density:n,defaultColumnWidth:r,defaultColumnHeight:l,onRowClick:o,onRowMouseOver:a,onRowMouseOut:d,rows:c,columns:u,headers:h,cellConfigs:p}){let g=(0,s.useRef)(null),x=(0,s.useRef)({startIndex:0,endIndex:0}),m=function({visibleRange:e,virtualTable:t,maxRows:n,maxColumns:r}){return function({maxRows:e,maxColumns:t,onActiveCellChange:n}){let[r,i]=(0,s.useState)(eN),[l,o]=(0,s.useState)(!1);return{activeCell:r,isActive:l,onTableKeyDown:(0,s.useCallback)(r=>{let l=r.key;(eR.includes(l)||"Home"===l||"End"===l||"PageDown"===l||"PageUp"===l)&&i(i=>{let o=i.row,a=i.column;"ArrowRight"===l&&a<t-1?(r.preventDefault(),a+=1):"ArrowLeft"===l&&a>0?(r.preventDefault(),a-=1):"ArrowDown"===l&&o<e-1?(r.preventDefault(),o+=1):"ArrowUp"===l&&o>0?(r.preventDefault(),o-=1):"Home"===l?(r.preventDefault(),o=0,a=0):"End"===l&&(r.preventDefault(),o=e-1,a=t-1);let s={column:a,row:o},d=n?.(r,i,s)||s;return d.row===i.row&&d.column===i.column?i:d})},[t,e,n]),onCellFocus:e=>{(e.column!==r.column||e.row!==r.row||!l)&&(o(!0),i(e))}}}({maxRows:n,maxColumns:r,onActiveCellChange:(r,i,l)=>{let o=r.key,a=l&&(i.column!==l.column||i.row!==l.row),s=l?.row??i.row;if("ArrowDown"===o&&a)(s-1<e.current.startIndex||s-1>e.current.endIndex)&&t.current?.scrollToIndex({index:s-1,align:"end"});else if("ArrowUp"===o&&a)(s-1<e.current.startIndex||s-1>e.current.endIndex)&&t.current?.scrollToIndex({index:s-1,align:"start"});else if(a&&("Home"===o||"End"===o))t.current?.scrollToIndex({index:Math.max(s-1,0),align:"start"});else if("PageDown"===o){r.preventDefault();let l=i.row;return l=Math.min(n-1,e.current.endIndex+1),t.current?.scrollToIndex({index:l-1,align:"start"}),{row:l,column:i.column}}else if("PageUp"===o){let n=i.row;return n=Math.max(0,e.current.startIndex-1),t.current?.scrollToIndex({index:n-1,align:"end"}),{row:n,column:i.column}}return l}})}({visibleRange:x,virtualTable:g,maxRows:c.length+1,maxColumns:u.length}),f=e=>e.row===m.activeCell.row&&e.column===m.activeCell.column?m.isActive?"trigger-focus":"focus-next":"none",y=(0,s.useMemo)(()=>({Scroller:eF,Table:t=>(0,i.jsx)(ey,{...t,width:e,density:n,onKeyDown:m.onTableKeyDown}),TableHead:ej,TableRow:({item:e,...t})=>{let r=c[t["data-index"]];if(!r)return null;let l={id:r.id,index:r.index};return(0,i.jsx)(ep,{...t,onClick:e=>o(e,r.id),density:n,onMouseOver:e=>{a?.(e,l)},onMouseOut:e=>{d?.(e,l)}})},TableBody:ex}),[n,m.onTableKeyDown,o,d,a,c,e]);return(0,i.jsx)(v.Z,{style:{width:e,height:t},children:(0,i.jsx)(Q._n,{ref:g,totalCount:c.length,components:y,rangeChanged:e=>{x.current=e},fixedHeaderContent:()=>(0,i.jsx)(i.Fragment,{children:h.map(e=>(0,i.jsx)(ep,{density:n,children:e.headers.map((e,t,o)=>{let a=e.column,s={row:0,column:t},d=a.getIsSorted(),c=a.getNextSortingOrder();return(0,i.jsx)(eE,{onSort:a.getCanSort()?a.getToggleSortingHandler():void 0,sortDirection:"string"==typeof d?d:void 0,nextSortDirection:"string"==typeof c?c:void 0,width:a.getSize()||r,defaultColumnHeight:l,align:a.columnDef.meta?.align,variant:"head",density:n,description:a.columnDef.meta?.headerDescription,focusState:f(s),onFocusTrigger:()=>m.onCellFocus(s),isFirstColumn:0===t,isLastColumn:t===o.length-1,children:(0,ed.ie)(a.columnDef.header,e.getContext())},e.id)})},e.id))}),itemContent:e=>{let t=c[e];return t?(0,i.jsx)(i.Fragment,{children:t.getVisibleCells().map((t,o,a)=>{let s;let d={row:e+1,column:o},c=t.getContext(),u=p?.[c.cell.id],h=t.column.columnDef.cell,g="function"==typeof h?h(c):null,x=t.column.columnDef.meta?.cellDescription;return"function"==typeof x?s=x(c):x&&"string"==typeof g&&(s=g),(0,i.jsx)(eI,{"data-testid":t.id,title:s||u?.text||g,width:t.column.getSize()||r,defaultColumnHeight:l,align:t.column.columnDef.meta?.align,density:n,focusState:f(d),onFocusTrigger:()=>m.onCellFocus(d),isFirstColumn:0===o,isLastColumn:o===a.length-1,description:s,color:u?.textColor??void 0,backgroundColor:u?.backgroundColor??void 0,children:u?.text||g},t.id)})}):null}})})}var eO=n(82707);function ez({color:e,density:t,...n}){let r="compact"===t;return(0,i.jsx)(eO.Z,{size:r?"small":"medium",...n,focusRipple:!1,tabIndex:-1,sx:{color:e,padding:e=>e.spacing(r?.25:.5),position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)","&.Mui-checked":{color:e},"&.Mui-focusVisible":{background:e?(0,eh.Fq)(e,.5):void 0},"& .MuiSvgIcon-root":{fontSize:r?16:18}}})}let eW=(e,t)=>`${t}`,e$={},eH=[];function eB({data:e,columns:t,cellConfigs:n,density:r="standard",defaultColumnWidth:l=ek,defaultColumnHeight:o="auto",checkboxSelection:a,onRowSelectionChange:d,onSortingChange:c,getCheckboxColor:u,getRowId:h=eW,rowSelection:p=e$,sorting:g=eH,rowSelectionVariant:x="standard",...m}){let f=(0,q.Z)(),v=(0,s.useCallback)((e,t,n)=>{"standard"===x||n?t.toggleSelected():t.getIsSelected()&&!e.getIsAllRowsSelected()?e.toggleAllRowsSelected():d?.({[t.id]:!0})},[d,x]),y=(0,s.useCallback)((e,t,n)=>{let r=e.nativeEvent&&(e.nativeEvent instanceof MouseEvent||e.nativeEvent instanceof KeyboardEvent)?e.nativeEvent:void 0;v(t,n,!!r?.metaKey||!!r?.shiftKey)},[v]),b=(0,s.useMemo)(()=>({id:"checkboxRowSelect",size:28,header:({table:e})=>(0,i.jsx)(ez,{checked:e.getIsAllRowsSelected(),indeterminate:e.getIsSomeRowsSelected(),onChange:e.getToggleAllRowsSelectedHandler(),color:f.palette.text.primary,density:r}),cell:({row:e,table:t})=>(0,i.jsx)(ez,{checked:e.getIsSelected(),indeterminate:e.getIsSomeSelected(),onChange:n=>{y(n,t,e)},color:u?.(e.original),density:r}),enableSorting:!1}),[f.palette.text.primary,r,u,y]),j=(0,s.useMemo)(()=>{let e=eM(t);return a&&e.unshift(b),e},[b,a,t]),C=(0,ed.b7)({data:e,columns:j,getRowId:h,getCoreRowModel:(0,ec.sC)(),getSortedRowModel:(0,ec.tj)(),enableRowSelection:!!a,onRowSelectionChange:e=>{let t="function"==typeof e?e(p):e;d?.(t)},onSortingChange:e=>{let t="function"==typeof e?e(g):e;c?.(t)},sortDescFirst:!0,state:{rowSelection:p,sorting:g}}),w=(0,s.useCallback)((e,t)=>{let n=C.getRow(t);v(C,n,e.metaKey||e.shiftKey)},[v,C]);return(0,i.jsx)(eP,{...m,density:r,defaultColumnWidth:l,defaultColumnHeight:o,onRowClick:w,rows:C.getRowModel().rows,columns:C.getAllFlatColumns(),headers:C.getHeaderGroups(),cellConfigs:n})}let e_=[{accessorKey:"label",header:"Name",enableSorting:!0,cell:({getValue:e})=>(0,i.jsx)("span",{title:e(),children:e()})}],eV=e=>e.id,eU=e=>e.color;function eY({items:e,selectedItems:t,onSelectedItemsChange:n,onItemMouseOver:r,onItemMouseOut:l,height:o,width:a,columns:d=[],sorting:c,onSortingChange:u}){let h=(0,s.useMemo)(()=>"string"!=typeof t?t:e.reduce((e,t,n)=>(e[eV(t,n)]=!0,e),{}),[t,e]),p=(0,s.useMemo)(()=>[...e_,...d],[d]);return(0,i.jsx)(eB,{height:o,width:a,rowSelection:h,onRowSelectionChange:n,onRowMouseOver:r,onRowMouseOut:l,sorting:c,onSortingChange:u,data:e,columns:p,density:"compact",defaultColumnWidth:"auto",getRowId:eV,getCheckboxColor:eU,checkboxSelection:!0,rowSelectionVariant:"legend"})}function eG({width:e,height:t,options:n,data:r,selectedItems:l,onSelectedItemsChange:o,onItemMouseOver:a,onItemMouseOut:s,tableProps:d}){let u;let h=(e,t)=>{let n=e.metaKey||e.shiftKey;o((0,J.Uy)(l,e=>{if("ALL"===e)return{[t]:!0};let r=!!e[t];return n?(r?delete e[t]:e[t]=!0,e):r?"ALL":{[t]:!0}}))},p=(0,c.getLegendMode)(n.mode),g=r.length>=500,x={height:t,items:r,selectedItems:l,onLegendItemClick:h,onItemMouseOver:a,onItemMouseOut:s};return(u="table"===p?(0,i.jsx)(eY,{...x,onSelectedItemsChange:o,width:e,...d}):"right"===n.position||g?(0,i.jsx)(ea,{...x,width:e,onLegendItemClick:h}):(0,i.jsx)(es,{...x,onLegendItemClick:h}),"right"===n.position)?(0,i.jsx)(v.Z,{style:{width:e,height:t},sx:{position:"absolute",top:0,right:0},children:u}):(0,i.jsx)(v.Z,{style:{width:e,height:t},sx:{position:"absolute",bottom:0},children:u})}let eX={medium:{bottom:6,right:250},small:{bottom:4,right:150}};function eK({children:e,legendProps:t,width:n,height:r,spacing:l=0,legendSize:o,minChildrenWidth:a=100,minChildrenHeight:s=100}){let{content:d,legend:u,margin:h}=function({width:e,height:t,legendProps:n,legendSize:r,minChildrenHeight:i,minChildrenWidth:l,spacing:o,theme:a}){let s,d;let u=n?.options,h={legend:{show:!1,width:0,height:0},content:{width:e,height:t},margin:{right:0,bottom:0}};if(!u)return h;let{position:p}=u;if("list"===(0,c.getLegendMode)(u.mode))s="right"===p?200:e,d=40,"right"===p?d=t:t>=300&&(d=100);else{let i=eA(a,"compact"),l=(n?.tableProps?.columns||[]).reduce((e,t)=>("number"==typeof t.width&&(e+=t.width),e),0);s="right"===p?eX[r].right+l:e;let o=Math.min(eX[r].bottom,n.data.length+1);d="bottom"===p?o*i.height:t}let g="right"===p?e-s-o:e,x="bottom"===p?t-d-o:t;return"right"===p&&g<l||"bottom"===p&&x<i?h:{legend:{width:s,height:d,show:!0},content:{width:g,height:x},margin:{right:"right"===p?o:0,bottom:"bottom"===p?o:0}}}({width:n,height:r,legendProps:t,minChildrenHeight:s,minChildrenWidth:a,spacing:l,theme:(0,q.Z)(),legendSize:(0,c.getLegendSize)(o)});return(0,i.jsxs)(v.Z,{style:{width:n,height:r},sx:{position:"relative",overflow:"hidden"},children:[(0,i.jsx)(v.Z,{style:{width:d.width,height:d.height},sx:{marginRight:`${h.right}px`,marginBottom:`${h.bottom}px`,overflow:"hidden"},children:"function"==typeof e?e({width:d.width,height:d.height}):e}),t&&u.show&&(0,i.jsx)(eG,{...t,height:u.height,width:u.width})]})}let eq=(0,s.forwardRef)(function({debounceMs:e=250,value:t,onChange:n,...r},l){let[o,a]=(0,s.useState)(t),d=(0,s.useCallback)(e=>{n?.(e)},[n]),c=(0,s.useMemo)(()=>T()(d,e),[e,d]);return(0,i.jsx)($.Z,{ref:l,value:o,onChange:function(e){a(e.target.value),c(e.target.value)},...r})});eq.displayName="TextField";var eJ=n(51602),eQ=n(19978),e0=n(56873),e1=n(70616),e5=n(10763);let e2=(0,G.ZP)("form")({overflowY:"auto",display:"flex",flexDirection:"column"}),e6=e=>({position:"absolute",top:e.spacing(.5),right:e.spacing(.5)}),e7=({children:e,...t})=>(0,i.jsx)(e0.Z,{...t,children:e});e7.Header=({children:e,onClose:t,...n})=>(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(eJ.Z,{style:{textOverflow:"ellipsis",overflow:"hidden"},...n,children:e}),t&&(0,i.jsx)(W.Z,{"aria-label":"Close",onClick:t,sx:e6,children:(0,i.jsx)(e5.default,{})})]}),e7.Form=e2,e7.Content=({children:e,sx:t,...n})=>(0,i.jsx)(eQ.Z,{dividers:!0,...n,sx:en({minWidth:"500px",textWrap:"balance"},t),children:e}),e7.PrimaryButton=({children:e,...t})=>(0,i.jsx)(o.Z,{variant:"contained",type:"submit",...t,children:e}),e7.SecondaryButton=({children:e,...t})=>(0,i.jsx)(o.Z,{variant:"outlined",color:"secondary",...t,children:e}),e7.Actions=e1.Z;let e3=e=>{let{description:t,isOpen:n,onCancel:r,onDiscardChanges:l}=e;return(0,i.jsxs)(e7,{open:n,"aria-labelledby":"discard-dialog",children:[(0,i.jsx)(e7.Header,{children:"Discard Changes"}),(0,i.jsx)(e7.Content,{children:t}),(0,i.jsxs)(e7.Actions,{children:[(0,i.jsx)(o.Z,{variant:"contained",onClick:l,children:"Discard Changes"}),(0,i.jsx)(o.Z,{variant:"outlined",color:"secondary",onClick:r,children:"Cancel"})]})]})};var e4=n(90192),e8=n(23626),e9=n(39398);function te(e){void 0===globalThis.useIdValue&&(globalThis.useIdValue=0);let t=(0,s.useRef)(void 0);return void 0===t.current&&(t.current=`${e}-${globalThis.useIdValue++}`),t.current}var tt=n(32964),tn=n(87143);let tr=({id:e,title:t,description:n,placement:r,children:l,enterDelay:o,enterNextDelay:a})=>{let s=(0,i.jsx)("span",{children:l});return(0,i.jsx)(tl,{arrow:!0,id:e,placement:r??"top",title:(0,i.jsx)(ti,{title:t,description:n}),enterDelay:o??500,enterNextDelay:a??500,children:s})},ti=({title:e,description:t})=>(0,i.jsxs)(i.Fragment,{children:[e&&(0,i.jsx)(eC.Z,{variant:"body2",sx:e=>({color:e.palette.text.primary,fontWeight:e.typography.fontWeightMedium}),children:e}),(0,i.jsx)(eC.Z,{variant:"caption",sx:e=>({color:e.palette.text.primary,whiteSpace:"pre-line"}),children:t})]}),tl=(0,G.ZP)(({className:e,...t})=>(0,i.jsx)(tt.Z,{...t,classes:{popper:e}}))(({theme:e})=>({[`& .${tn.Z.tooltip}`]:{backgroundColor:e.palette.background.tooltip,color:e.palette.text.primary,maxWidth:"300px",padding:e.spacing(1),boxShadow:e.shadows[1]},[`& .${tn.Z.arrow}`]:{color:e.palette.background.tooltip}})),to=({label:e,control:t,description:n})=>{let r=te("EditorSectionControl"),l=`${r}-control`;return(0,i.jsx)(e4.Z,{children:(0,i.jsxs)(z.Z,{direction:"row",alignItems:"center",justifyContent:"space-between",children:[(0,i.jsxs)(z.Z,{direction:"row",alignItems:"center",justifyContent:"center",children:[(0,i.jsx)(e8.Z,{htmlFor:l,children:e}),n&&(0,i.jsx)(tr,{description:n,enterDelay:100,children:(0,i.jsx)(W.Z,{size:"small",sx:e=>({borderRadius:e.shape.borderRadius,padding:"4x",margin:"0 2px"}),children:(0,i.jsx)(e9.default,{"aria-describedby":"info-tooltip","aria-hidden":!1,fontSize:"inherit",sx:{color:e=>e.palette.grey[700]}})})})]}),(0,i.jsxs)(v.Z,{sx:{width:"180px",textAlign:"right"},children:[" ",d().cloneElement(t,{id:l})]})]})})};var ta=n(11774),ts=n(57174);function td({options:e,renderInput:t=e=>(0,i.jsx)($.Z,{...e}),...n}){let r=e=>e.label??e.id;return(0,i.jsx)(ta.Z,{isOptionEqualToValue:(e,t)=>e.id===t.id,getOptionDisabled:e=>!!e.disabled,getOptionLabel:r,options:e,renderInput:t,renderOption:({key:e,...t},n)=>(0,i.jsx)("li",{...t,children:(0,i.jsxs)("div",{children:[(0,i.jsx)(eC.Z,{variant:"body1",component:"div",children:r(n)}),n.description&&(0,i.jsx)(eC.Z,{variant:"body2",component:"div",sx:{color:e=>e.palette.text.secondary},children:n.description})]})},e),filterOptions:(0,ts.D)({stringify:e=>`${r(e)} ${e.description||""}`}),...n})}let tc=[{id:"compact",label:"Compact"},{id:"standard",label:"Standard"},{id:"comfortable",label:"Comfortable"}];function tu({onChange:e,value:t="standard"}){return(0,i.jsx)(to,{label:"Density",control:(0,i.jsx)(td,{value:tc.find(e=>e.id===t),options:tc,getOptionLabel:e=>e.label,onChange:(t,{id:n})=>{e(n)},disableClearable:!0})})}function th(){return(0,i.jsxs)(z.Z,{direction:"row",alignItems:"center",children:[(0,i.jsx)(v.Z,{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)(v.Z,{sx:{content:'""',height:2,background:e=>e.palette.info.main,width:"100%"}})]})}var tp=n(39020),tg=n(55255),tx=n(62422),tm=n(74183);let tf={type:"idle"};function tv({elements:e,accessKey:t,axis:n="vertical",onChange:r}){return(0,s.useEffect)(()=>(0,tg.sd)({onDrop({location:i,source:l}){let o=i.current.dropTargets[0];if(!o)return;let a=l.data,s=o.data,d=e.findIndex(e=>e[t]===a[t]),c=e.findIndex(e=>e[t]===s[t]);if(c<0||d<0)return;let u=(0,tm.A)(s);r((0,tp.h)({list:e,startIndex:d,indexOfTarget:c,closestEdgeOfTarget:u,axis:n}))}}),[t,n,e,r])}function ty({children:e,data:t}){let n=(0,s.useRef)(null),[r,l]=(0,s.useState)(tf);return(0,s.useEffect)(()=>{let e=n.current;if(e)return(0,tx.$)((0,tg.En)({element:e,getInitialData:()=>t,onDragStart(){l({type:"is-dragging"})},onDrop(){l(tf)}}),(0,tg.wO)({element:e,canDrop:({source:t})=>t.element!==e,getData:({input:n})=>(0,tm.X)(t,{element:e,input:n,allowedEdges:["top","bottom"]}),getIsSticky:()=>!0,onDragEnter({self:e}){l({type:"is-dragging-over",closestEdge:(0,tm.A)(e.data)})},onDrag({self:e}){let t=(0,tm.A)(e.data);l(e=>"is-dragging-over"===e.type&&e.closestEdge===t?e:{type:"is-dragging-over",closestEdge:t})},onDragLeave(){l(tf)},onDrop(){l(tf)}}))},[t]),(0,i.jsxs)(z.Z,{ref:n,spacing:1,style:{opacity:"is-dragging"===r.type?.5:"unset"},children:["is-dragging-over"===r.type&&"top"===r.closestEdge?(0,i.jsx)(th,{}):null,e,"is-dragging-over"===r.type&&"bottom"===r.closestEdge?(0,i.jsx)(th,{}):null]})}var tb=n(5549),tj=n(10517),tC=n(11682);function tw(e,t){let n=t.indexOf(e);if(0===n)return t;let r=[...t];return r.splice(n,1),r.splice(n-1,0,e),r}function tZ(e,t){let n=t.indexOf(e);if(n===t.length-1)return t;let r=[...t];return r.splice(n,1),r.splice(n+1,0,e),r}let tS=(0,s.forwardRef)(function({onMoveUp:e,onMoveDown:t,onMoveLeft:n,onMoveRight:r,menuSx:l,...o},a){let[d,c]=(0,s.useState)(null),u=!!d;function h(e){c(null),e?.()}return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(W.Z,{...o,ref:a,"aria-label":"move","aria-haspopup":!0,"aria-expanded":u,size:"small",onClick:function(e){c(e.currentTarget)},children:(0,i.jsx)(tC.default,{})}),(e||t||n||r)&&(0,i.jsxs)(tb.Z,{id:"drag-button-menu",MenuListProps:{"aria-labelledby":"drag-button-menu"},anchorEl:d,open:u,onClose:()=>h(void 0),sx:l,children:[e&&(0,i.jsx)(tj.Z,{onClick:()=>h(e),children:"Move Up"}),t&&(0,i.jsx)(tj.Z,{onClick:()=>h(t),children:"Move Down"}),n&&(0,i.jsx)(tj.Z,{onClick:()=>h(n),children:"Move Left"}),r&&(0,i.jsx)(tj.Z,{onClick:()=>h(r),children:"Move Right"}),r&&(0,i.jsx)(tj.Z,{onClick:()=>h(r),children:"Move Right"})]})]})});var tk=n(76439),tT=n(73957);let tA=({anchor:e="right",isOpen:t,onClose:n,PaperProps:r,children:l,...o})=>{let a=(0,tk.Z)("(max-width:1080px)");return(0,i.jsx)(tT.ZP,{...o,open:t,onClose:n,anchor:e,PaperProps:{...r,sx:en({width:a?"100%":"1080px",overflow:"hidden"},r?.sx)},children:l})};var tM=n(315);function tD(e){let{error:t}=e;return(0,i.jsx)(tM.Z,{severity:"error",children:t.message})}var tI=n(68715);let tE=[{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 tL({value:e,onChange:t}){return(0,i.jsx)(to,{label:"Font Size",control:(0,i.jsx)(td,{value:tE.find(t=>t.value===e),options:tE,getOptionLabel:e=>e.label,onChange:(e,{value:n})=>{t(n)},disableClearable:!0})})}var tF=n(79119);function tN({action:e,submitText:t="Save",cancelText:n="Cancel",isReadonly:r,isValid:l,onActionChange:a,onSubmit:s,onDelete:d,onCancel:c,...u}){return(0,i.jsx)(z.Z,{direction:"row",gap:1,sx:{marginLeft:"auto"},...u,children:"read"===e?(0,i.jsxs)(i.Fragment,{children:[a&&(0,i.jsx)(o.Z,{disabled:r,variant:"contained",onClick:()=>a("update"),children:"Edit"}),d&&(0,i.jsx)(o.Z,{color:"error",disabled:r,variant:"outlined",onClick:d,children:"Delete"}),c&&(s||d)&&(0,i.jsx)(tF.Z,{orientation:"vertical",flexItem:!0,sx:{borderColor:e=>e.palette.grey["500"],"&.MuiDivider-root":{marginLeft:2,marginRight:1}}}),c&&(0,i.jsx)(o.Z,{color:"secondary",variant:"outlined",onClick:c,children:n})]}):(0,i.jsxs)(i.Fragment,{children:[s&&(0,i.jsx)(o.Z,{variant:"contained",disabled:!l,onClick:s,children:t}),c&&(0,i.jsx)(o.Z,{color:"secondary",variant:"outlined",onClick:c,children:n})]})})}var tR=n(78846);function tP(e){let{width:t,height:n,data:r,format:l,axisLine:o,max:a}=e,s=C(),d=(0,c.useDeepMemo)(()=>{if(void 0===r.value)return s.noDataOption;let e=tO(r.value,l,t,n);return{title:{show:!1},tooltip:{show:!1},series:[{type:"gauge",center:["50%","65%"],radius:"86%",startAngle:200,endAngle:-20,min:0,max:a,silent:!0,progress:{show:!0,width:16,itemStyle:{color:"auto"}},pointer:{show:!1},axisLine:{lineStyle:{color:[[1,"rgba(127,127,127,0.35)"]],width:16}},axisTick:{show:!1,distance:0},splitLine:{show:!1},axisLabel:{show:!1,distance:-18,color:"#999",fontSize:12},anchor:{show:!1},title:{show:!1},detail:{show:!1},data:[{value:r.value}]},{type:"gauge",center:["50%","65%"],radius:"100%",startAngle:200,endAngle:-20,min:0,max:a,pointer:{show:!0,icon:t>170?"path://M12.8,0.7l12,40.1H0.7L12.8,0.7z":"none",length:10,width:5,offsetCenter:[0,"-49%"],itemStyle:{color:"auto"}},axisLine:o,axisTick:{show:!1},splitLine:{show:!1},axisLabel:{show:!1},detail:{show:!0,width:"60%",borderRadius:8,offsetCenter:[0,"-9%"],color:"inherit",fontSize:e,formatter:null===r.value?()=>"null":e=>(0,c.formatValue)(e,l)},data:[{value:r.value,name:r.label,title:{show:!0,color:s.echartsTheme.textStyle?.color??"inherit",offsetCenter:[0,"55%"],overflow:"truncate",fontSize:12,width:.8*t}}]}]}},[r,t,n,s,l,o,a]);return(0,i.jsx)(L,{sx:{width:t,height:n,padding:`${s.container.padding.default}px`},option:d,theme:s.echartsTheme})}function tO(e,t,n,r){let i=Math.min(n,r)/(("number"==typeof e?(0,c.formatValue)(e,t):`${e}`).length??2)*.7;return`clamp(3px, ${i}px, 24px)`}(0,u.D)([tR.N,p.N,x.N,m.N,f.N]);var tz=n(97313),tW=n(10225),t$=n(68799);function tH(e){let t=(0,q.Z)(),n="dark"===t.palette.mode,[r,l]=(0,s.useState)(()=>JSON.stringify(e.value,null,2)),[o,a]=(0,s.useState)(r);return(0,s.useEffect)(()=>{l(JSON.stringify(e.value,null,2))},[e.value]),(0,i.jsx)(tz.ZP,{...e,style:{border:`1px solid ${t.palette.divider}`},theme:n?"dark":"light",extensions:[(0,tW.AV)(),(0,t$.ir)((0,tW.ap)()),(0,t$.Q2)()],value:r,onChange:e=>{l(e)},onBlur:()=>{o!==r&&void 0!==e.onChange&&(e.onChange(r),a(r))},placeholder:e.placeholder})}var tB=n(44811),t_=n(98857),tV=n(219),tU=n(17846),tY=n(55328),tG=n(4665),tX=n(20461);function tK(e,t){if(t){let n=t.toLowerCase();if("local"!==n&&"browser"!==n)return{...e,timeZone:"utc"===n?"UTC":t}}return e}function tq(e,t,n){let r=n?.toLowerCase();return n&&"local"!==r&&"browser"!==r?(0,tG.formatInTimeZone)(e,"utc"===r?"UTC":n,t):(0,tX.format)(e,t)}function tJ(e,t,n){let r=tK({hour:"numeric",minute:"numeric",hourCycle:"h23"},n);return t<=18e5?r.second="numeric":t>=864e5&&(r.month="numeric",r.day="numeric"),new Intl.DateTimeFormat(void 0,r).format(e).replace(/, /g," ")}function tQ(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 t0=e=>{if(!e)return{formattedDate:"",formattedTime:""};let t=new Date(e);return{formattedDate:(0,tX.format)(t,"MMM dd, yyyy - "),formattedTime:(0,tX.format)(t,"HH:mm:ss")}},t1=(0,s.createContext)(void 0);function t5(e){let{children:t,timeZone:n}=e;return(0,i.jsx)(t1.Provider,{value:n,children:t})}function t2(){let e=(0,s.useContext)(t1);return{timeZone:e??"local",formatWithUserTimeZone:(t,n)=>tq(t,n,e),dateFormatOptionsWithUserTimeZone:t=>tK(t,e)}}let t6=375,t7=650,t3=650,t4=500,t8=.75,t9=8,ne=750,nt="nearby series showing in tooltip",nn="emphasized series showing as bold in tooltip",nr="#2E313E",ni=new Intl.DateTimeFormat(void 0,{year:"numeric",month:"short",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric",hour12:!0}),nl={coords:{plotCanvas:{x:0,y:0},zrender:{x:0,y:0},target:null},chartWidth:0},no=[],na={ie:navigator.userAgent.match(/MSIE\s([\d.]+)/)||navigator.userAgent.match(/Trident\/.+?rv:(([\d.]+))/),edge:navigator.userAgent.match(/Edge?\/([\d.]+)/)},ns="onpointerdown"in window&&(na.edge||na.ie&&na.ie[1]&&+na.ie[1]>=11),nd=ns?"pointermove":"mousemove",nc=()=>{let[e,t]=(0,s.useState)(null);return(0,s.useEffect)(()=>{let e=e=>t({page:{x:e.pageX,y:e.pageY},client:{x:e.clientX,y:e.clientY},plotCanvas:{x:e.zrX,y:e.zrY},target:e.target});return window.addEventListener(nd,e),()=>{window.removeEventListener(nd,e)}},[]),e},nu={wrapLabels:!0,enablePinning:!0},nh="Click chart to pin",np="Click chart to unpin";var ng=n(7444),nx=n(75276);function nm(e){let{markerColor:t,sx:n}=e;return(0,i.jsx)(v.Z,{sx:en({display:"inline-block",width:"11px",height:"11px",borderRadius:"2px",marginRight:1,verticalAlign:"top"},n),style:{backgroundColor:t}})}function nf(e){let{formattedY:t,markerColor:n,metricName:r,metricLabels:l}=e;return(0,i.jsxs)(z.Z,{spacing:.5,children:[(0,i.jsxs)(v.Z,{sx:e=>({display:"flex",height:"16px",flexDirection:"row",alignItems:"center",justifyContent:"left",color:e.palette.common.white,fontSize:"11px"}),children:[(0,i.jsx)(nm,{markerColor:n,sx:{marginTop:.25}}),(0,i.jsxs)(v.Z,{component:"span",children:[r,(0,i.jsx)(v.Z,{component:"span",sx:e=>({color:e.palette.common.white,fontWeight:700,paddingLeft:"2px"}),children:t})]})]}),(0,i.jsx)(tF.Z,{sx:e=>({borderColor:e.palette.grey["500"]})}),(0,i.jsx)(v.Z,{sx:e=>({color:e.palette.common.white}),children:l.map(e=>{if(e){let[t,n]=e.split("="),r=void 0!==n?`${t}: `:t,l=void 0!==n?n.replace(/(^"|"$)/g,""):n;return(0,i.jsxs)(v.Z,{sx:{display:"flex",gap:"4px"},children:[(0,i.jsx)(eC.Z,{sx:{fontSize:"11px"},children:r}),(0,i.jsx)(eC.Z,{sx:e=>({color:e.palette.common.white,fontWeight:700,fontSize:"11px"}),children:l})]},e)}})})]})}function nv(e){let{seriesName:t,formattedY:n,markerColor:r,totalSeries:l,emphasizeText:o=!1,wrapLabels:a=!0}=e,s=t.split("{"),d=(s[1]??t).replace(/[{}]/g,"").split(",");if(1===l&&d.length>1){let e=s[0]?`${s[0]}:`:"value:";return(0,i.jsx)(nf,{formattedY:n,metricName:e,metricLabels:d,markerColor:r})}let c=t.replace(/[,]/g,", ");return(0,i.jsxs)(v.Z,{sx:{display:"table-row",paddingTop:.5},children:[(0,i.jsxs)(v.Z,{sx:{display:"table-cell",maxWidth:"520px"},children:[(0,i.jsx)(nm,{markerColor:r,sx:{marginTop:.5}}),(0,i.jsx)(v.Z,{component:"span",sx:e=>({display:"inline-block",width:"calc(100% - 20px)",minWidth:150,maxWidth:t4,overflow:"hidden",color:e.palette.common.white,fontWeight:o?e.typography.fontWeightBold:e.typography.fontWeightRegular,textOverflow:"ellipsis",whiteSpace:a?"normal":"nowrap"}),"aria-label":o?nn:nt,children:c})]}),(0,i.jsx)(v.Z,{sx:e=>({display:"table-cell",paddingLeft:1.5,textAlign:"right",verticalAlign:"top",fontWeight:o?e.typography.fontWeightBold:e.typography.fontWeightRegular}),children:n})]})}function ny(e){let{series:t,wrapLabels:n}=e,r=(0,s.useMemo)(()=>null===t?null:t.sort((e,t)=>e.y>t.y?-1:1),[t]);return null===t||null===r?null:(0,i.jsx)(v.Z,{sx:e=>({display:"table",padding:e.spacing(.5,2)}),children:r.map(({datumIdx:e,seriesIdx:t,seriesName:l,y:o,formattedY:a,markerColor:s,isClosestToCursor:d})=>{if(null===e||null===t)return null;let c=t.toString()+e.toString();return(0,i.jsx)(nv,{seriesName:l,y:o,formattedY:a,markerColor:s,totalSeries:r.length,wrapLabels:n,emphasizeText:d},c)})})}var nb=n(87895),nj=n(1889),nC=n(75186);let nw=(0,s.memo)(function({nearbySeries:e,totalSeries:t,isTooltipPinned:n,showAllSeries:r,enablePinning:l=!0,onShowAllClick:o,onUnpinClick:a}){let s=e[0]?.date??null;if(null===s)return null;let d=l&&t>5;return(0,i.jsxs)(v.Z,{sx:e=>({width:"100%",maxWidth:t7,padding:e.spacing(1.5,2,.5,2),backgroundColor:e.palette.designSystem?.grey[800]??nr,position:"sticky",top:0,left:0}),children:[(0,i.jsxs)(v.Z,{sx:{width:"100%",display:"flex",justifyContent:"start",alignItems:"center",paddingBottom:.5},children:[(e=>{let{formattedTime:t,formattedDate:n}=t0(e);return(0,i.jsxs)(v.Z,{children:[(0,i.jsx)(eC.Z,{variant:"caption",sx:e=>({color:e.palette.common.white}),children:n}),(0,i.jsx)(eC.Z,{variant:"caption",children:(0,i.jsx)("strong",{children:t})})]})})(s),(0,i.jsxs)(z.Z,{direction:"row",gap:1,sx:{marginLeft:"auto"},children:[d&&(0,i.jsxs)(z.Z,{direction:"row",gap:.5,alignItems:"center",sx:{textAlign:"right"},children:[(0,i.jsx)(eC.Z,{sx:{fontSize:11},children:"Show All"}),(0,i.jsx)(nb.Z,{checked:r,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}})})]}),l&&(0,i.jsxs)(z.Z,{direction:"row",alignItems:"center",children:[(0,i.jsx)(eC.Z,{sx:{marginRight:.5,fontSize:11,verticalAlign:"middle"},children:n?np:nh}),n?(0,i.jsx)(nj.default,{onClick:()=>{void 0!==a&&a()},sx:{fontSize:16,cursor:"pointer"}}):(0,i.jsx)(nC.default,{sx:{fontSize:16}})]})]})]}),(0,i.jsx)(tF.Z,{sx:e=>({width:"100%",borderColor:e.palette.grey["500"]})})]})}),nZ=1e3,nS="Pinned Crosshair",nk={name:nS,type:"line",markLine:{data:[],lineStyle:{type:"dashed",width:2},emphasis:{lineStyle:{width:2,opacity:1}},blur:{lineStyle:{width:2,opacity:1}}}};function nT(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 nA(e){e.dispatchAction({type:"restore"})}function nM(e){void 0!==e.dispatchAction&&(e.dispatchAction({type:"unselect"}),e.dispatchAction({type:"downplay"}))}function nD(e,t,n){if(void 0===n)return null;let r=[e,t];return n.containPixel("grid",r)?n.convertFromPixel("grid",r):null}function nI(e,t,n,r,i,l){let o=l.length>0?l[l.length-1]:i[i.length-1];void 0!==o&&e.dispatchAction({type:"select",seriesIndex:o.seriesIndex,dataIndex:o.dataIndex,escapeConnect:!0}),e.dispatchAction({type:"downplay",seriesIndex:r}),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 nE(e){return e[e.length-1]?.name===nS}function nL(e,t){if(void 0===e||void 0===t)return null;let n=null,r=1/0;for(let[i]of e){let e=Math.abs(i-t);e<r&&(n=i,r=e)}return n}function nF(e,t){if(void 0===t)return null;let n=e.length,r=null;for(let i=0;i<n;i++){let l=n>0?e[i]:null;if(!l)break;r=nL(l.values,t)}return r}let nN=5.5,nR=30,nP=5;function nO(e,t,n,r,i,l){let o=[],a=n[0]??null,s=n[1]??null;if(null===a||null===s||void 0===i.dispatchAction||!Array.isArray(e))return o;let d=[],u=[],h=[],p=[],g=[],x=e.length,m=new Map,f=nL(e[0]?.values,a);if(null===f)return no;for(let n=0;n<x;n++){let a=t[n];if(!a)break;let v=x>0?e[n]:null;if(!v)break;let y=v.values;if(void 0===y||!Array.isArray(y))break;let b=a.name?a.name.toString():"",j=a.color??"#000";if(Array.isArray(e))for(let e=0;e<y.length;e++){let t=y[e];if(void 0===t||!Array.isArray(t))break;let a=t[0],v=t[1];if(null!=v&&f===a&&s<=v+r&&s>=v-r){let t=nH({valueToCheck:s,baseValue:v,percentage:Math.max(x>nP?2:5,100/x)});if(t){u.push(n);let t=m.get(v)??0;m.set(v,t+1),t>0&&g.push({seriesIndex:n,dataIndex:e,seriesName:b,yValue:v}),p.push({seriesIndex:n,dataIndex:e,seriesName:b,yValue:v})}else h.push(n),i.dispatchAction({type:"downplay",seriesIndex:n});let r=(0,c.formatValue)(v,l);o.push({seriesIdx:n,datumIdx:e,seriesName:b,date:f,x:a,y:v,formattedY:r,markerColor:j.toString(),isClosestToCursor:t}),d.push(n)}}}return nI(i,d,u,h,p,g),o}function nz(e,t,n,r,i){let l=[],o=t[0]??null,a=t[1]??null;if(null===o||null===a)return l;let s=[],d=[],u=[],h=e.timeSeries.length;if(Array.isArray(e.xAxis)&&Array.isArray(e.timeSeries))for(let t=0;t<h;t++){let p=e.timeSeries[t];if(void 0===p||l.length>=nZ)break;let g=p.name?p.name.toString():"",x=p.color??"#000";if(Array.isArray(p.data))for(let m=0;m<p.data.length;m++){let f=e.xAxis[m]??0,v=p.data[m];if(null!=v&&o===m&&"-"!==v&&a<=v+n&&a>=v-n){let e=nH({valueToCheck:a,baseValue:v,percentage:Math.max(h>nP?2:5,100/h)});e?d.push(t):(u.push(t),r?.dispatchAction!==void 0&&r.dispatchAction({type:"downplay",seriesIndex:t}));let n=f>0x174876e7ff?f:1e3*f,o=(0,c.formatValue)(v,i);l.push({seriesIdx:t,datumIdx:m,seriesName:g,date:n,x:f,y:v,formattedY:o,markerColor:x.toString(),isClosestToCursor:e}),s.push(t)}}}return r?.dispatchAction!==void 0&&(r.dispatchAction({type:"downplay",seriesIndex:u}),d.length>0?r.dispatchAction({type:"highlight",seriesIndex:d,notBlur:!1,escapeConnect:!0}):r.dispatchAction({type:"highlight",seriesIndex:s,notBlur:!0,escapeConnect:!0})),l}function nW({mousePos:e,pinnedPos:t,data:n,seriesMapping:r,chart:i,format:l,showAllSeries:o=!1}){if(void 0===i||null===e)return no;let a=!1;if(null!==e.target){let t=e.target.parentElement;if(null!==t){let e=t.parentElement;null!==e&&i.getDom()===e&&(a=!0)}}if(null!==t&&(e=t,a=!0),!1===a||null===n||void 0===i._model||void 0===e.plotCanvas.x||void 0===e.plotCanvas.y)return no;let s=nD(e.plotCanvas.x,e.plotCanvas.y,i);if(null!==s){let e=nB({yInterval:i._model.getComponent("yAxis").axis.scale._interval,totalSeries:n.length,showAllSeries:o});return nO(n,r,s,e,i,l)}return no}function n$({mousePos:e,pinnedPos:t,chartData:n,chart:r,format:i,showAllSeries:l=!1}){if(void 0===r||null===e)return[];let o=!1;if(null!==e.target){let t=e.target.parentElement;if(null!==t){let e=t.parentElement;null!==e&&r.getDom()===e&&(o=!0)}}if(null!==t&&(e=t,o=!0),!1===o||void 0===r._model)return[];let a=nB({yInterval:r._model.getComponent("yAxis").axis.scale._interval,totalSeries:n.timeSeries.length,showAllSeries:l}),s=[e.plotCanvas.x??0,e.plotCanvas.y??0];if(r.containPixel("grid",s)){let e=r.convertFromPixel("grid",s);if(void 0!==e[0]&&void 0!==e[1])return nz(n,e,a,r,i)}return[]}function nH({valueToCheck:e,baseValue:t,percentage:n}){let r=n/100*t;return e>=t-r&&e<=t+r}function nB({yInterval:e,totalSeries:t,showAllSeries:n=!1}){if(n)return 10*e;let r=.3*e;return t>nP?Math.max(r,e*nR/t):Math.max(r,e*nN)}function n_(e,t,n,r,i,l){let o;if(null===e||(null!==n&&(e=n),void 0===e.plotCanvas.x))return;let a=e.page.x,s=e.page.y+16;return l&&(a=a-(o=l.getBoundingClientRect()).left+l.scrollLeft,s=s-o.top+l.scrollTop),e.client.y+r+16>window.innerHeight&&(s-=r*t8,o&&s<o.top&&(s=t9/2)),e.plotCanvas.x>t-.9*i&&a>t7?`translate3d(${a-32}px, ${s}px, 0) translateX(-100%)`:`translate3d(${a+32}px, ${s}px, 0)`}function nV(e,t,n){return{minWidth:t6,maxWidth:t7,maxHeight:(n?n-t9:void 0)??t3,padding:0,position:"absolute",top:0,left:0,backgroundColor:e.palette.designSystem?.grey[800]??nr,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 nU=(0,s.memo)(function({chartRef:e,chartData:t,enablePinning:n=!0,wrapLabels:r,format:l,onUnpinClick:o,pinnedPos:a,containerId:d}){let[c,u]=(0,s.useState)(!1),h=nc(),{height:p,width:g,ref:x}=(0,nx.default)(),m=(0,s.useRef)(),f=null!==a&&n;if(null===h||null===h.target||null===a&&"CANVAS"!==h.target.tagName)return null;let y=e.current,b=y?.getWidth()??ne,j=n$({mousePos:h,chartData:t,pinnedPos:a,chart:y,format:l,showAllSeries:c});if(0===j.length)return null;let C=t.timeSeries.length,w=d?document.querySelector(d):void 0,Z=w?w.getBoundingClientRect().height:void 0;return f||(m.current=n_(h,b,a,p??0,g??0,w)),(0,i.jsx)(ng.Z,{container:w,children:(0,i.jsx)(v.Z,{ref:x,sx:e=>({minWidth:t6,maxWidth:t7,maxHeight:Z??t3,padding:0,position:"absolute",top:0,left:0,backgroundColor:e.palette.designSystem?.grey[800]??nr,borderRadius:"6px",color:"#fff",fontSize:"11px",visibility:"visible",opacity:1,transition:"all 0.1s ease-out",zIndex:null!==a?"auto":e.zIndex.tooltip,overflow:"hidden","&:hover":{overflowY:"auto"}}),style:{transform:m.current,display:m.current?"block":"none"},children:(0,i.jsxs)(z.Z,{spacing:.5,children:[(0,i.jsx)(nw,{nearbySeries:j,totalSeries:C,enablePinning:n,isTooltipPinned:f,showAllSeries:c,onShowAllClick:e=>u(e),onUnpinClick:o}),(0,i.jsx)(ny,{series:j,wrapLabels:r})]})})})});(0,u.D)([tB.N,p.N,M.N,t_.N,tV.N,tU.N,x.N,tY.N,m.N,D.N,f.N]);let nY=(0,s.forwardRef)(function({height:e,data:t,yAxis:n,format:r,grid:l,legend:o,tooltipConfig:a=nu,noDataVariant:d="message",syncGroup:c,onDataZoom:u,onDoubleClick:h,__experimentalEChartsOptionsOverride:p},g){let x=C(),m=(0,s.useRef)(),[f,y]=(0,s.useState)(!0),[b,j]=(0,s.useState)(null),{timeZone:w}=t2(),[Z,S]=(0,s.useState)(!1),[k,T]=(0,s.useState)(0);(0,s.useImperativeHandle)(g,()=>({highlightSeries({id:e}){m.current&&m.current.dispatchAction({type:"highlight",seriesId:e})},clearHighlightedSeries:()=>{m.current&&nM(m.current)}}),[]);let A=(0,s.useMemo)(()=>({datazoom:e=>{if(void 0===u&&setTimeout(()=>{j(null)},10),void 0===u||void 0===e.batch[0])return;let n=e.batch[0].startValue??0,r=e.batch[0].endValue??t.xAxis.length-1,i=t.xAxis[n],l=t.xAxis[r];void 0!==i&&void 0!==l&&u({start:i,end:l,startIndex:n,endIndex:r})}}),[t,u,j]);void 0!==m.current&&nT(m.current);let{noDataOption:M}=x,D=(0,s.useMemo)(()=>{if(void 0===t.timeSeries)return{};if(null===t.timeSeries||0===t.timeSeries.length&&"message"===d)return M;let e=t.rangeMs??P(t.xAxis),i={series:t.timeSeries,xAxis:{type:"category",data:t.xAxis,max:t.xAxisMax,axisLabel:{formatter:t=>tJ(t,e,w)}},yAxis:R(n,r),animation:!1,tooltip:{show:!0,trigger:"axis",showContent:!1},axisPointer:{type:"line",z:0,triggerEmphasis:!1,triggerTooltip:!1,snap:!0},toolbox:{feature:{dataZoom:{icon:null,yAxisIndex:"none"}}},grid:l,legend:o};return p?p(i):i},[t,n,r,l,o,M,w,p,d]);return(0,i.jsxs)(v.Z,{style:{height:e},onClick:e=>{a.enablePinning&&e.target instanceof HTMLCanvasElement&&j(t=>null===t?{page:{x:e.pageX,y:e.pageY},client:{x:e.clientX,y:e.clientY},plotCanvas:{x:e.nativeEvent.offsetX,y:e.nativeEvent.offsetY},target:e.target}:null)},onMouseDown:e=>{let{clientX:t}=e;S(!0),T(t)},onMouseMove:e=>{if(!(e.target instanceof HTMLCanvasElement))return;let{clientX:t}=e;Z&&t-k>0&&y(!1)},onMouseUp:()=>{S(!1),T(0),y(!0)},onMouseLeave:()=>{null===b&&y(!1),void 0!==m.current&&nM(m.current)},onMouseEnter:()=>{y(!0),void 0!==m.current&&nT(m.current)},onDoubleClick:e=>{j(null),void 0===h?void 0!==m.current&&nA(m.current):h(e)},children:[!0===f&&D.tooltip?.showContent===!1&&!0!==a.hidden&&(0,i.jsx)(nU,{chartRef:m,chartData:t,wrapLabels:a.wrapLabels,enablePinning:a.enablePinning,pinnedPos:b,format:r,onUnpinClick:()=>{j(null)},containerId:x.tooltipPortalContainerId}),(0,i.jsx)(L,{sx:{width:"100%",height:"100%"},option:D,theme:x.echartsTheme,onEvents:A,_instance:m,syncGroup:c})]})});var nG=n(28797),nX=n(48137),nK=n(33755),nq=n(86396);function nJ({control:e,...t}){let{fields:n,append:r,remove:l}=(0,nX.useFieldArray)({control:e,name:"panelDefinition.spec.links"});return(0,i.jsxs)(z.Z,{...t,gap:3,children:[n&&n.length>0?n.map((t,n)=>(0,i.jsxs)(s.Fragment,{children:[(0,i.jsxs)(z.Z,{direction:"row",gap:1,alignItems:"center",children:[(0,i.jsx)(nQ,{control:e,index:n}),(0,i.jsx)(W.Z,{style:{width:"fit-content",height:"fit-content"},onClick:()=>l(n),children:(0,i.jsx)(nq.default,{})})]}),(0,i.jsx)(tF.Z,{})]},t.id)):(0,i.jsx)(eC.Z,{variant:"subtitle1",mb:2,fontStyle:"italic",children:"No links defined"}),(0,i.jsx)(W.Z,{style:{width:"fit-content",height:"fit-content"},onClick:()=>r({url:""}),children:(0,i.jsx)(nK.default,{})})]})}function nQ({control:e,index:t}){return(0,i.jsxs)(z.Z,{gap:2,flexGrow:1,children:[(0,i.jsxs)(z.Z,{direction:"row",gap:2,children:[(0,i.jsx)(nX.Controller,{control:e,name:`panelDefinition.spec.links.${t}.url`,render:({field:e,fieldState:t})=>(0,i.jsx)($.Z,{...e,required:!0,fullWidth:!0,label:"URL",error:!!t.error,helperText:t.error?.message,onChange:t=>{e.onChange(t)}})}),(0,i.jsx)(nX.Controller,{control:e,name:`panelDefinition.spec.links.${t}.name`,render:({field:e,fieldState:t})=>(0,i.jsx)($.Z,{...e,fullWidth:!0,label:"Name",defaultValue:"",error:!!t.error,helperText:t.error?.message,onChange:t=>{e.onChange(t)}})}),(0,i.jsx)(nX.Controller,{control:e,name:`panelDefinition.spec.links.${t}.tooltip`,render:({field:e,fieldState:t})=>(0,i.jsx)($.Z,{...e,fullWidth:!0,label:"Tooltip",defaultValue:"",error:!!t.error,helperText:t.error?.message,onChange:t=>{e.onChange(t)}})})]}),(0,i.jsxs)(z.Z,{gap:2,direction:"row",alignItems:"center",children:[(0,i.jsx)(nX.Controller,{control:e,name:`panelDefinition.spec.links.${t}.renderVariables`,render:({field:e})=>(0,i.jsx)(nG.Z,{label:"Render Variables",control:(0,i.jsx)(eO.Z,{...e,checked:e.value,onChange:t=>e.onChange(t.target.checked)})})}),(0,i.jsx)(nX.Controller,{control:e,name:`panelDefinition.spec.links.${t}.targetBlank`,render:({field:e})=>(0,i.jsx)(nG.Z,{label:"Open in new tab",control:(0,i.jsx)(eO.Z,{...e,checked:e.value,onChange:t=>e.onChange(t.target.checked)})})})]})]})}let n0=[{id:"value",label:"Value"},{id:"percentage",label:"Percentage"}];function n1({disablePercentageMode:e,onChange:t,value:n="value"}){return(0,i.jsx)(to,{label:"Mode",control:(0,i.jsx)(td,{value:n0.find(e=>e.id===n),options:n0,getOptionLabel:e=>e.label,getOptionDisabled:t=>"percentage"===t.id&&e,onChange:(e,{id:n})=>{t(n)},disableClearable:!0})})}var n5=n(38359);let n2=({children:e})=>(0,i.jsx)(n5.ZP,{item:!0,xs:4,children:(0,i.jsx)(z.Z,{spacing:3,children:e})}),n6=({children:e})=>(0,i.jsx)(n5.ZP,{container:!0,spacing:8,children:e}),n7=({title:e,children:t,icon:n})=>(0,i.jsxs)(v.Z,{children:[(0,i.jsxs)(v.Z,{display:"flex",borderBottom:1,borderColor:"grey.300",marginBottom:e=>e.spacing(1),children:[(0,i.jsx)(eC.Z,{variant:"overline",component:"h4",children:e}),n&&(0,i.jsx)(v.Z,{sx:{marginLeft:"auto"},children:n})]}),(0,i.jsx)(z.Z,{spacing:1,children:t})]});var n3=n(66224);function n4(e){let{message:t}=e;return(0,i.jsx)(z.Z,{sx:{height:"100%",alignItems:"center",justifyContent:"center"},children:(0,i.jsx)(eC.Z,{children:t})})}function n8(e){let{resource:t}=e;return(0,i.jsx)(n4,{message:`No ${t}`})}function n9(e){let{variant:t="rounded"}=e;return(0,i.jsx)(z.Z,{sx:{height:"100%",alignItems:"center",justifyContent:"center",px:1},children:(0,i.jsx)(n3.Z,{variant:t,width:"100%",height:"30%","aria-label":"Loading..."})})}let re=[{id:"asc",label:"Ascending"},{id:"desc",label:"Descending"}];function rt({onChange:e,value:t="desc"}){return(0,i.jsx)(to,{label:"Sort",control:(0,i.jsx)(td,{value:re.find(e=>e.id===t),options:re,getOptionLabel:e=>e.label,onChange:(t,{id:n})=>{e(n)},disableClearable:!0})})}function rn({onChange:e,value:t,...n}){let r=t=>{e(t)};return(0,i.jsxs)(l.Z,{"aria-label":"Sort",...n,children:[(0,i.jsx)(o.Z,{onClick:()=>r(void 0),variant:void 0===t?"contained":"outlined",children:"None"}),(0,i.jsx)(o.Z,{onClick:()=>r("asc"),variant:"asc"===t?"contained":"outlined",children:"Asc"}),(0,i.jsx)(o.Z,{onClick:()=>r("desc"),variant:"desc"===t?"contained":"outlined",children:"Desc"})]})}function rr({text:e,fontWeight:t,width:n,height:i,lineHeight:l,maxSize:o,fontSizeOverride:a}){let s=function(){if(!r&&null===(r=document.createElement("canvas").getContext("2d")))throw Error("Canvas context is null.");return r}(),{echartsTheme:d}=C();if(void 0!==a)return Number(a);let c=d.textStyle,u=Number(c?.fontSize)??12,h=c?.fontFamily??"Lato",p=`${t} ${u}px ${h}`;s.font=p;let g=Math.min(i/l,n/s.measureText(e).width*u);return o?Math.min(g,o):g}let ri=(e,t)=>null===e?"null":"number"==typeof e?(0,c.formatValue)(e,t):void 0===e?"":e;(0,u.D)([tB.N,p.N,g.N,x.N,m.N,f.N]);let rl=e=>{let{width:t,height:n,data:r,sparkline:l,showSeriesName:o,format:a,valueFontSize:d}=e,c=C(),u=r.color,h=ri(r.calculatedValue,a),p=c.container.padding.default,g=rr({text:r?.seriesData?.name??"",fontWeight:400,width:t,height:.125*n,lineHeight:1.2,maxSize:30}),x=o?1.2*g+p:0,m=t-2*p,f=n-x,y=rr({text:h,fontSizeOverride:d,fontWeight:700,width:l?m:.5*m,height:l?.25*f:.9*f,lineHeight:1.2}),b=1.2*y;g=Math.min(.7*y,g);let j=(0,s.useMemo)(()=>{if(void 0===r.seriesData)return c.noDataOption;let e=r.seriesData,t=[];if(void 0!==l){let n={type:"line",name:e.name,data:e.values,zlevel:1,symbol:"none",animation:!1,silent:!0},r=N()(n,l);t.push(r)}return{title:{show:!1},grid:{show:!1,top:"35%",right:0,bottom:0,left:0,containLabel:!1},xAxis:{type:"time",show:!1,boundaryGap:!1},yAxis:{type:"value",show:!1,min:e=>e.min>=0&&e.min<=1?0:e.min},tooltip:{show:!1},series:t}},[r,c,l]),w=l?"auto":"center";return(0,i.jsxs)(v.Z,{sx:{height:"100%",width:"100%",display:"flex",flexDirection:"column",justifyContent:w,alignItems:w},children:[o&&(0,i.jsx)(ro,{padding:p,fontSize:g,children:r.seriesData?.name}),(0,i.jsx)(ra,{variant:"h3",color:u,fontSize:y,padding:p,children:h}),void 0!==l&&(0,i.jsx)(L,{sx:{width:"100%",height:n-x-b},option:j,theme:c.echartsTheme,renderer:"svg"})]})},ro=(0,G.ZP)(eC.Z,{shouldForwardProp:e=>"padding"!==e&&"fontSize"!==e})(({theme:e,padding:t,fontSize:n})=>({color:e.palette.text.secondary,padding:`${t}px`,fontSize:`${n}px`,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"})),ra=(0,G.ZP)(eC.Z,{shouldForwardProp:e=>"color"!==e&&"padding"!==e&&"fontSize"!==e&&"sparkline"!==e})(({theme:e,color:t,padding:n,fontSize:r,sparkline:i})=>({color:t??e.palette.text.primary,fontSize:`${r}px`,padding:i?`${n}px ${n}px 0 ${n}px`:` 0 ${n}px`,whiteSpace:"nowrap",lineHeight:1.2}));var rs=n(5404),rd=n(98346),rc=n(12434),ru=n(22446);function rh({inputRef:e,label:t,color:n,value:r,mode:l,onChange:o,onColorChange:a,onBlur:d,onDelete:c}){let[u,h]=(0,s.useState)(0);return(0,i.jsxs)(z.Z,{flex:1,direction:"row",alignItems:"center",justifyContent:"space-between",spacing:1,children:[(0,i.jsx)(X,{label:t,color:n,onColorChange:a}),(0,i.jsx)(e8.Z,{htmlFor:t,children:t}),(0,i.jsx)($.Z,{id:t,inputRef:e,type:"number",value:0===r?"":r,placeholder:"0",onChange:o,onBlur:d,onKeyDown:e=>{"Enter"===e.key&&(d(),h(u+1))},InputProps:{endAdornment:"percent"===l?(0,i.jsx)(v.Z,{paddingX:1,children:"%"}):void 0}},u),(0,i.jsx)(W.Z,{"aria-label":`delete threshold ${t}`,size:"small",onClick:c,children:(0,i.jsx)(ru.default,{})})]})}function rp({thresholds:e,onChange:t,hideDefault:n,disablePercentMode:r}){let{thresholds:{defaultColor:l,palette:o}}=C(),a=e?.defaultColor??l,[d,c]=(0,s.useState)(e?.steps);(0,s.useEffect)(()=>{c(e?.steps)},[e?.steps]);let u=(0,s.useRef)(null),h=(0,s.useRef)(!1);(0,s.useEffect)(()=>{u.current&&h.current&&(u.current?.focus(),h.current=!1)},[d?.length]);let p=(e,t)=>{c((0,J.Uy)(d,n=>{let r=n?.[t];r&&(r.value=Number(e.target.value))}))},g=(n,r)=>{void 0!==e&&t((0,J.Uy)(e,e=>{if(void 0!==e.steps){let t=e.steps[r];t&&(t.color=n)}}))},x=()=>{if(void 0!==d){let n=[...d];n.sort((e,t)=>e.value-t.value),void 0!==e&&t((0,J.Uy)(e,e=>{e.steps=n}))}},m=n=>{void 0!==e&&t((0,J.Uy)(e,e=>{e.steps&&e.steps.splice(n,1)}))};return(0,i.jsxs)(n7,{title:"Thresholds",icon:(0,i.jsx)(tr,{description:"Add threshold",children:(0,i.jsx)(W.Z,{size:"small","aria-label":"add threshold",onClick:()=>{h.current=!0,void 0===e?t({steps:[{value:10}]}):e&&void 0===e.steps?t((0,J.Uy)(e,e=>{e.steps=[{value:10}]})):t((0,J.Uy)(e,e=>{let t=e.steps;if(t?.length){let e=t[t.length-1],n=o[t.length]??rg();t.push({color:n,value:(e?.value??0)+10})}else t&&t.push({value:10})}))},children:(0,i.jsx)(nK.default,{})})}),children:[(0,i.jsx)(to,{label:"Mode",description:"Percentage means thresholds relative to min & max",control:(0,i.jsxs)(rs.Z,{exclusive:!0,disabled:r,value:e?.mode??"absolute",onChange:(n,r)=>{let i="percent"===r?"percent":void 0;void 0!==e?t((0,J.Uy)(e,e=>{e.mode=i})):t({mode:i})},sx:{height:"36px",marginLeft:"auto"},children:[(0,i.jsx)(rd.Z,{"aria-label":"absolute",value:"absolute",sx:{fontWeight:500},children:"Absolute"}),(0,i.jsx)(rd.Z,{"aria-label":"percent",value:"percent",sx:{fontWeight:500},children:"Percent"})]})}),d&&d.map((t,n)=>(0,i.jsx)(rh,{inputRef:n===d.length-1?u:void 0,label:`T${n+1}`,color:t.color??o[n]??a,value:t.value,mode:e?.mode,onColorChange:e=>g(e,n),onChange:e=>{p(e,n)},onDelete:()=>{m(n)},onBlur:x},n)).reverse(),!n&&(0,i.jsxs)(rc.Z,{flex:1,direction:"row",alignItems:"center",spacing:1,children:[(0,i.jsx)(X,{label:"default",color:a,onColorChange:n=>{void 0!==e?t((0,J.Uy)(e,e=>{e.defaultColor=n})):t({defaultColor:n})}}),(0,i.jsx)(eC.Z,{children:"Default"})]})]})}let rg=()=>"#"+Math.floor(0x1000000*Math.random()).toString(16).padStart(6,"0"),rx=(0,s.memo)(function({containerId:e,chartRef:t,data:n,seriesMapping:r,enablePinning:l=!0,wrapLabels:o,format:a,onUnpinClick:d,pinnedPos:c}){let[u,h]=(0,s.useState)(!1),p=(0,s.useRef)(),g=nc(),{height:x,width:m,ref:f}=(0,nx.default)(),y=null!==c&&l;if(null===g||null===g.target||null===n||null===c&&"CANVAS"!==g.target.tagName)return null;let b=t.current,j=b?.getWidth()??ne,C=e?document.querySelector(e):void 0,w=C?C.getBoundingClientRect().height:void 0;y||(p.current=n_(g,j,c,x??0,m??0,C));let Z=nW({mousePos:g,data:n,seriesMapping:r,pinnedPos:c,chart:b,format:a,showAllSeries:u});if(0===Z.length)return null;let S=n.length;return(0,i.jsx)(ng.Z,{container:C,children:(0,i.jsx)(v.Z,{ref:f,sx:e=>nV(e,c,w),style:{transform:p.current},children:(0,i.jsxs)(z.Z,{spacing:.5,children:[(0,i.jsx)(nw,{nearbySeries:Z,totalSeries:S,enablePinning:l,isTooltipPinned:y,showAllSeries:u,onShowAllClick:e=>h(e),onUnpinClick:d}),(0,i.jsx)(ny,{series:Z,wrapLabels:o})]})})})});(0,u.D)([tB.N,h.N,p.N,g.N,M.N,t_.N,tV.N,tU.N,x.N,tY.N,m.N,f.N]);let rm=(0,s.forwardRef)(function({height:e,data:t,seriesMapping:n,timeScale:r,yAxis:l,format:o,grid:a,isStackedBar:d=!1,tooltipConfig:u=nu,noDataVariant:h="message",syncGroup:p,onDataZoom:g,onDoubleClick:x,__experimentalEChartsOptionsOverride:m},f){let y;let{chartsTheme:b,enablePinning:C,lastTooltipPinnedCoords:w,setLastTooltipPinnedCoords:Z}=j(),k=u.enablePinning&&C,T=(0,s.useRef)(),[A,M]=(0,s.useState)(!0),[D,I]=(0,s.useState)(null),[E,F]=(0,s.useState)(null),[P,O]=(0,s.useState)(!1),[z,W]=(0,s.useState)(0),{timeZone:$}=t2();if(void 0===r){let e=(0,c.getCommonTimeScale)(t);if(void 0===e){let e=new Date,t=new Date(e);t.setFullYear(e.getFullYear()-5);let n=e.getTime(),r=t.getTime();y={startMs:r,endMs:n,stepMs:1,rangeMs:n-r}}else y=e}else y=r;(0,s.useImperativeHandle)(f,()=>({highlightSeries({name:e}){T.current&&T.current.dispatchAction({type:"highlight",seriesId:e})},clearHighlightedSeries:()=>{T.current&&nM(T.current)}}),[]);let H=(0,s.useMemo)(()=>({datazoom:e=>{if(void 0===g&&setTimeout(()=>{I(null)},10),void 0===g||void 0===e.batch[0])return;let t=e.batch[0].startValue,n=e.batch[0].endValue;void 0!==t&&void 0!==n&&g({start:t,end:n})},finished:()=>{void 0!==T.current&&nT(T.current)}}),[g,I]),{noDataOption:B}=b,_=(0,s.useMemo)(()=>{if(null===t||0===t.length&&"message"===h)return B;let e=[],r="local"===$;t.map((t,n)=>{let i=t.values.map(([e,t])=>[r?e:(0,tG.toZonedTime)(e,$),null===t?"-":t]);e.push({id:n,source:[...i],dimensions:["time","value"]})});let i={dataset:e,series:C&&null!==E?[...n,E]:n,xAxis:{type:"time",min:r?y.startMs:(0,tG.toZonedTime)(y.startMs,$),max:r?y.endMs:(0,tG.toZonedTime)(y.endMs,$),axisLabel:{hideOverlap:!0,formatter:tQ(y.rangeMs??0)},axisPointer:{snap:!1}},yAxis:R(l,o),animation:!1,tooltip:{show:!0,showContent:d,trigger:d?"item":"axis",appendToBody:d},axisPointer:{type:"line",z:0,triggerEmphasis:!1,triggerTooltip:!1,snap:!1},toolbox:{feature:{dataZoom:{icon:null,yAxisIndex:"none"}}},grid:a};return m?m(i):i},[t,n,y,l,o,a,B,m,h,$,d,C,E]);return(0,s.useEffect)(()=>{null===D||null===w||S()(w,D)||(I(null),null!==D&&null!==E&&F(null))},[w,n]),(0,i.jsxs)(v.Z,{style:{height:e},onClick:e=>{let n=e.ctrlKey||e.metaKey;n&&e.preventDefault();let r=nD(e.nativeEvent.offsetX,e.nativeEvent.offsetY,T.current);if(null!==r&&k&&e.target instanceof HTMLCanvasElement){let i={page:{x:e.pageX,y:e.pageY},client:{x:e.clientX,y:e.clientY},plotCanvas:{x:e.nativeEvent.offsetX,y:e.nativeEvent.offsetY},target:e.target};I(e=>null===e?i:(F(null),null)),F(e=>{if(null!==e)return null;{let e=r[0],n=nL(t[0]?.values,e);return N()({},nk,{markLine:{data:[{xAxis:n}]}})}}),n||Z(i)}},onMouseDown:e=>{let{clientX:t}=e;O(!0),W(t)},onMouseMove:e=>{if(!(e.target instanceof HTMLCanvasElement))return;let{clientX:t}=e;P&&t-z>0&&M(!1)},onMouseUp:()=>{O(!1),W(0),M(!0)},onMouseLeave:()=>{null===D&&M(!1),void 0!==T.current&&nM(T.current)},onMouseEnter:()=>{M(!0),void 0!==T.current&&nT(T.current)},onDoubleClick:e=>{I(null),void 0===x?void 0!==T.current&&nA(T.current):x(e)},children:[!0===A&&_.tooltip?.showContent===!1&&!0!==u.hidden&&(0,i.jsx)(rx,{containerId:b.tooltipPortalContainerId,chartRef:T,data:t,seriesMapping:n,wrapLabels:u.wrapLabels,enablePinning:k,pinnedPos:D,format:o,onUnpinClick:()=>{I(null),F(null)}}),(0,i.jsx)(L,{sx:{width:"100%",height:"100%"},option:_,theme:b.echartsTheme,onEvents:H,_instance:T,syncGroup:p})]})});var rf=n(63767),rv=n(59986),ry=n(53578),rb=n(52583),rj=n(94913),rC=n(51727);let rw="yyyy-MM-dd HH:mm:ss";function rZ(e,t){return e?(0,c.isRelativeTimeRange)(e)?e.pastDuration:function(e,t,n){let r=tq(e.start,t,n),i=tq(e.end,t,n);return`${r} - ${i}`}(e,rw,t):"Custom Time Range"}let rS=({initialTimeRange:e,onChange:t,onCancel:n})=>{let{formatWithUserTimeZone:r}=t2(),[l,a]=(0,s.useState)(e),[d,c]=(0,s.useState)({start:r(e.start,rw),end:r(e.end,rw)}),[u,h]=(0,s.useState)(!0),p=(e,t)=>{let n="string"==typeof e,i=n?e:r(e,rw);c(e=>({...e,[t]:i})),n||a(n=>({...n,[t]:e}))},g=e=>{p(e,"start")},x=e=>{p(e,"end")},m=()=>{var e,t;let n={start:new Date(d.start),end:new Date(d.end)};if(e=n.start,t=n.end,(0,tX.isValid)(e)&&(0,tX.isValid)(t)?!!(0,tX.isBefore)(e,t)||(console.error("End Time is before Start Time"),!1):(console.error("Invalid Date"),!1))return a(n),n},f=()=>{let e=m();e&&t(e)};return(0,i.jsx)(ry._,{dateAdapter:rC.H,children:(0,i.jsxs)(z.Z,{spacing:2,sx:e=>({padding:e.spacing(1,0,2)}),children:[u&&(0,i.jsxs)(v.Z,{sx:e=>({".MuiPickersLayout-contentWrapper":{backgroundColor:e.palette.background.default}}),children:[(0,i.jsx)(eC.Z,{variant:"h3",padding:1,paddingLeft:2,children:"Select Start Time"}),(0,i.jsx)(rb.S,{displayStaticWrapperAs:"desktop",openTo:"day",disableHighlightToday:!0,value:e.start,onChange:e=>{null!==e&&g(e)},onAccept:()=>{h(!1)}})]}),!u&&(0,i.jsxs)(v.Z,{sx:e=>({".MuiPickersLayout-contentWrapper":{backgroundColor:e.palette.background.default}}),children:[(0,i.jsx)(eC.Z,{variant:"h3",padding:1,paddingLeft:2,children:"Select End Time"}),(0,i.jsx)(rb.S,{displayStaticWrapperAs:"desktop",openTo:"day",disableHighlightToday:!0,value:e.end,minDateTime:l.start,onChange:e=>{null!==e&&x(e)},onAccept:e=>{null!==e&&(h(!0),x(e))}})]}),(0,i.jsxs)(z.Z,{direction:"row",alignItems:"center",gap:1,pl:1,pr:1,children:[(0,i.jsx)(tI.ErrorBoundary,{FallbackComponent:tD,children:(0,i.jsx)(rj.l,{label:"Start Time",value:new Date(d.start),onChange:e=>{e&&g(e)},onBlur:()=>m(),format:rw})}),(0,i.jsx)(tI.ErrorBoundary,{FallbackComponent:tD,children:(0,i.jsx)(rj.l,{label:"End Time",value:new Date(d.end),onChange:e=>{e&&x(e)},onBlur:()=>m(),format:rw})})]}),(0,i.jsxs)(z.Z,{direction:"row",sx:{padding:e=>e.spacing(0,1)},gap:1,children:[(0,i.jsx)(o.Z,{variant:"contained",onClick:()=>f(),fullWidth:!0,children:"Apply"}),(0,i.jsx)(o.Z,{variant:"outlined",onClick:()=>n(),fullWidth:!0,children:"Cancel"})]})]})})};function rk({value:e,timeOptions:t,onChange:n,height:r,showCustomTimeRange:l=!0}){let{timeZone:o}=t2(),a=(0,s.useRef)(),[d,u]=(0,s.useState)(!1),h=(0,s.useMemo)(()=>(0,c.isRelativeTimeRange)(e)?(0,c.toAbsoluteTimeRange)(e):e,[e]),p=(0,s.useMemo)(()=>{var t;return{value:t=(0,c.isRelativeTimeRange)(e)?void 0:e,display:rZ(t,o)}},[e,o]),[g,x]=(0,s.useState)(!1);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Y.ZP,{anchorEl:a.current,anchorOrigin:{vertical:"bottom",horizontal:"center"},open:d,onClose:()=>u(!1),sx:e=>({padding:e.spacing(2)}),children:(0,i.jsx)(rS,{initialTimeRange:h,onChange:e=>{n(e),u(!1),x(!1)},onCancel:()=>u(!1)})}),(0,i.jsx)(v.Z,{ref:a,children:(0,i.jsxs)(rf.Z,{open:g,value:rZ(e,o),onClick:()=>x(!g),IconComponent:rv.default,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":r?{lineHeight:r,paddingY:0}:{}},children:[t.map((e,t)=>(0,i.jsx)(tj.Z,{value:rZ(e.value,o),onClick:()=>{n(e.value)},children:e.display},t)),l&&(0,i.jsx)(tj.Z,{value:rZ(p.value,o),onClick:()=>u(!0),children:p.display})]})})]})}let rT=(0,G.ZP)(o.Z)(({theme:e})=>({padding:e.spacing(.5),minWidth:"auto"})),rA=(0,s.forwardRef)(function(e,t){return(0,i.jsx)(rT,{ref:t,variant:"outlined",color:"secondary",...e})}),rM=Object.entries(c.UNIT_CONFIG).map(([e,t])=>({id:e,...t})).filter(e=>!e.disableSelectorOption),rD=[{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 rI({value:e,onChange:t,disabled:n=!1}){var r;let l=(0,c.isUnitWithDecimalPlaces)(e),o=(0,c.isUnitWithShortValues)(e),a=({decimalPlaces:n})=>{l&&t({...e,decimalPlaces:n})},s=c.UNIT_CONFIG[e.unit];return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(to,{label:"Short values",control:(0,i.jsx)(nb.Z,{checked:!!o&&(0,c.shouldShortenValues)(e.shortValues),onChange:(n,r)=>{o&&t({...e,shortValues:r})},disabled:!o})}),(0,i.jsx)(to,{label:"Unit",control:(0,i.jsx)(td,{value:{id:e.unit,...s},options:rM,groupBy:e=>e.group,onChange:(e,n)=>{t({unit:n.id})},disableClearable:!0,disabled:n})}),(0,i.jsx)(to,{label:"Decimals",control:(0,i.jsx)(td,{value:(r=e.decimalPlaces,rD.find(e=>e.decimalPlaces===r)),options:rD,getOptionLabel:e=>e.label,onChange:(e,t)=>a(t),disabled:!l,disableClearable:!0})})]})}function rE({name:e,height:t}){return(0,i.jsx)(v.Z,{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)(eC.Z,{variant:"body1","aria-label":"y axis label",sx:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:e})})}var rL=n(78439);function rF(){let{enqueueSnackbar:e,closeSnackbar:t}=(0,rL.Ds)(),n=rN(e,"error"),r=rN(e,"info"),i=rN(e,"warning"),l=rN(e,"success"),o=(0,s.useCallback)((e,t)=>n(e instanceof Error?e.message:`An unexpected error occurred: ${e}`,t),[n]);return{enqueueSnackbar:e,closeSnackbar:t,errorSnackbar:n,infoSnackbar:r,warningSnackbar:i,successSnackbar:l,exceptionSnackbar:o}}function rN(e,t){return(0,s.useCallback)((n,r)=>e(n,{...r,variant:t}),[e,t])}function rR(e,t){let n=e.palette.text?.primary??"#222",r={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 N()({echartsTheme:r,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 rP(e){return{value:{pastDuration:e},display:`Last ${(0,tX.formatDuration)((0,c.parseDurationString)(e),{delimiter:", "})}`}}var rO=n(28730);let rz=rR((0,rO.Z)({}),{echartsTheme:{textStyle:{fontFamily:"Lato"},categoryAxis:{splitLine:{show:!1}},timeAxis:{splitLine:{show:!1}},bar:{barCategoryGap:2}}}),rW={chartsTheme:rz,enablePinning:!1,lastTooltipPinnedCoords:null,setLastTooltipPinnedCoords:()=>null};var r$=n(79602);let rH={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,[`& .${r$.Z.icon}`]:{color:e.palette.error.main}}:{...e.typography.body1,backgroundColor:e.palette.error.light,color:e.palette.error.dark,[`& .${r$.Z.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,[`& .${r$.Z.icon}`]:{color:e.palette.info.main}}:{...e.typography.body1,backgroundColor:e.palette.info.light,color:e.palette.info.dark,[`& .${r$.Z.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,[`& .${r$.Z.icon}`]:{color:e.palette.success.main}}:{...e.typography.body1,backgroundColor:e.palette.success.light,color:e.palette.success.dark,[`& .${r$.Z.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,[`& .${r$.Z.icon}`]:{color:e.palette.warning.main}}:{...e.typography.body1,backgroundColor:e.palette.warning.light,color:e.palette.warning.dark,[`& .${r$.Z.icon}`]:{color:e.palette.warning.main}},root:{["& ."+n(757).Z.root]:{textDecoration:"underline"}}}},rB={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"},r_={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"},rV="#FFFFFF",rU=e=>{let t=rB["800"],n=rB["300"];return"light"===e?{navigation:t,accent:n,primary:rB["800"],secondary:rB["700"],disabled:rB["300"],link:r_["500"],linkHover:r_["600"]}:{navigation:t,accent:n,primary:rV,secondary:rB["50"],disabled:rB["600"],link:r_["400"],linkHover:r_["500"]}},rY=e=>{let t=r_["150"],n="rgba(21, 23, 33, 0.75)";return"light"===e?{navigation:t,overlay:n,default:rV,paper:rB["50"],code:rB["50"],tooltip:rB["100"],lighter:rB["50"],border:rB["100"]}:{navigation:t,overlay:n,default:rB["900"],paper:rB["850"],code:rB["800"],tooltip:rB["600"],lighter:rB["700"],border:rB["600"]}},rG=e=>"light"===e?{50:rB["50"],100:rB["100"],200:rB["200"],300:rB["300"],400:rB["400"],500:rB["500"],600:rB["600"],700:rB["700"],800:rB["800"],900:rB["900"],950:rB["950"]}:{50:rB["950"],100:rB["900"],200:rB["800"],300:rB["700"],400:rB["600"],500:rB["500"],600:rB["400"],700:rB["300"],800:rB["200"],900:rB["100"],950:rB["50"]},rX=e=>"light"===e?{main:r_["500"],dark:r_["600"],light:r_["50"]}:{main:r_["400"],dark:r_["800"],light:r_["200"]},rK=e=>"light"===e?{main:rB["600"],dark:rB["900"],light:rB["100"]}:{main:rV,dark:rV,light:rV},rq={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"},rJ={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"},rQ={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"},r0={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"},r1=e=>"light"===e?{main:r0["500"],dark:r0["600"],light:r0["50"]}:{main:r0["400"],dark:r0["800"],light:r0["300"]},r5=e=>"light"===e?{main:rq["500"],dark:rq["700"],light:rq["50"]}:{main:rq["400"],dark:rq["800"],light:rq["300"]},r2=e=>"light"===e?{main:rJ["500"],dark:rJ["700"],light:rJ["50"]}:{main:rJ["400"],dark:rJ["800"],light:rJ["300"]};n(12711),n(89479),n(99511),n(53213);let r6={fontFamily:'"Lato", sans-serif',fontWeightLight:300,fontWeightRegular:400,fontWeightMedium:700,fontWeightBold:900,h1:{fontSize:"1.5rem",fontWeight:700,lineHeight:"32px"},h2:{fontSize:"1.25rem",fontWeight:700,lineHeight:"28px"},h3:{fontSize:"1rem",fontWeight:700,lineHeight:"24px"},h4:{fontSize:"0.875rem",fontWeight:700,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:700,lineHeight:"22px",letterSpacing:"0.03rem",textTransform:"uppercase"},button:{fontSize:"0.875rem",fontWeight:700,lineHeight:"1.25rem",textTransform:"none",letterSpacing:"0.03rem"},caption:{fontSize:"0.6875rem",fontWeight:400,lineHeight:"16px"}},r7=({theme:e})=>({..."light"===e.palette.mode?{}:{backgroundImage:"unset",backgroundColor:e.palette.designSystem.grey[800]}});function r3(e,t={}){return(0,rO.Z)({palette:{mode:e,primary:rX(e),secondary:rK(e),grey:rG(e),background:rY(e),text:rU(e),error:r1(e),warning:r2(e),info:rX(e),success:r5(e),common:{white:rV,black:"#000000"},designSystem:{blue:r_,green:rq,grey:rB,orange:rJ,purple:rQ,red:r0}},typography:r6,mixins:{},components:r4,...t})}let r4={MuiAlert:rH,MuiFormControl:{defaultProps:{size:"small"}},MuiPaper:{styleOverrides:{root:({theme:e})=>({backgroundColor:e.palette.background.default})}},MuiTextField:{defaultProps:{size:"small"}},MuiDrawer:{styleOverrides:{paper:r7}},MuiDialog:{styleOverrides:{paper:r7}},MuiPopover:{styleOverrides:{paper:r7}}};var r8=n(84974),r9=n(12449),ie=n(28418),it=n(57689);function ir({value:e,onChange:t}){return(0,i.jsxs)(z.Z,{direction:"row",children:[(0,i.jsx)(ta.Z,{freeSolo:!0,multiple:!0,id:"join-columns",sx:{width:"100%"},options:[],value:e.spec.columns??[],renderInput:e=>(0,i.jsx)($.Z,{...e,variant:"outlined",label:"Columns",required:!0}),onChange:(n,r)=>{t({...e,spec:{...e.spec,columns:r}})}}),(0,i.jsx)(nG.Z,{label:"Enabled",labelPlacement:"start",control:(0,i.jsx)(nb.Z,{value:!e.spec.disabled,checked:!e.spec.disabled,onChange:n=>t({...e,spec:{...e.spec,disabled:!n.target.checked}})})})]})}function ii({value:e,onChange:t}){return(0,i.jsxs)(z.Z,{direction:"row",gap:1,alignItems:"center",children:[(0,i.jsx)(ta.Z,{freeSolo:!0,multiple:!0,id:"merge-columns-columns",sx:{width:"100%"},options:[],value:e.spec.columns??[],renderInput:e=>(0,i.jsx)($.Z,{...e,variant:"outlined",label:"Columns",required:!0}),onChange:(n,r)=>{t({...e,spec:{...e.spec,columns:r}})}}),(0,i.jsx)(eq,{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)(nG.Z,{label:"Enabled",labelPlacement:"start",control:(0,i.jsx)(nb.Z,{value:!e.spec.disabled,checked:!e.spec.disabled,onChange:n=>t({...e,spec:{...e.spec,disabled:!n.target.checked}})})})]})}function il({value:e,onChange:t}){return(0,i.jsxs)(z.Z,{direction:"row",children:[(0,i.jsx)(eq,{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)(nG.Z,{label:"Enabled",labelPlacement:"start",control:(0,i.jsx)(nb.Z,{value:!e.spec.disabled,checked:!e.spec.disabled,onChange:n=>t({...e,spec:{...e.spec,disabled:!n.target.checked}})})})]})}function io({value:e,onChange:t}){return(0,i.jsx)(z.Z,{direction:"row",children:(0,i.jsx)(nG.Z,{label:"Enabled",labelPlacement:"start",control:(0,i.jsx)(nb.Z,{value:!e.spec.disabled,checked:!e.spec.disabled,onChange:n=>t({...e,spec:{...e.spec,disabled:!n.target.checked}})})})})}function ia({value:e,onChange:t,...n}){return(0,i.jsxs)(z.Z,{gap:2,sx:{width:"100%"},mt:1,...n,children:[(0,i.jsxs)(eq,{select:!0,label:"Kind",value:e.kind,onChange:n=>t({...e,kind:n}),children:[(0,i.jsx)(tj.Z,{value:"JoinByColumnValue",children:(0,i.jsxs)(z.Z,{children:[(0,i.jsx)(eC.Z,{children:"Join by column value"}),(0,i.jsx)(eC.Z,{variant:"caption",children:"Regroup rows with equal cell value in a column"})]})}),(0,i.jsx)(tj.Z,{value:"MergeColumns",children:(0,i.jsxs)(z.Z,{children:[(0,i.jsx)(eC.Z,{children:"Merge columns"}),(0,i.jsx)(eC.Z,{variant:"caption",children:"Multiple columns are merged to one column"})]})}),(0,i.jsx)(tj.Z,{value:"MergeIndexedColumns",children:(0,i.jsxs)(z.Z,{children:[(0,i.jsx)(eC.Z,{children:"Merge indexed columns"}),(0,i.jsx)(eC.Z,{variant:"caption",children:"Indexed columns are merged to one column"})]})}),(0,i.jsx)(tj.Z,{value:"MergeSeries",children:(0,i.jsxs)(z.Z,{children:[(0,i.jsx)(eC.Z,{children:"Merge series"}),(0,i.jsx)(eC.Z,{variant:"caption",children:"Series will be merged by their labels"})]})})]}),"JoinByColumnValue"===e.kind&&(0,i.jsx)(ir,{value:e,onChange:t}),"MergeColumns"===e.kind&&(0,i.jsx)(ii,{value:e,onChange:t}),"MergeIndexedColumns"===e.kind&&(0,i.jsx)(il,{value:e,onChange:t}),"MergeSeries"===e.kind&&(0,i.jsx)(io,{value:e,onChange:t})]})}function is({index:e,value:t,isCollapsed:n,onChange:r,onCollapse:l,onDelete:o,...a}){return(0,i.jsxs)(z.Z,{...a,children:[(0,i.jsxs)(z.Z,{direction:"row",alignItems:"center",borderBottom:1,borderColor:e=>e.palette.divider,justifyContent:"space-between",gap:4,children:[(0,i.jsxs)(z.Z,{direction:"row",gap:1,children:[(0,i.jsx)(W.Z,{"data-testid":`transform-toggle#${e}`,size:"small",onClick:()=>l(!n),children:n?(0,i.jsx)(r8.default,{}):(0,i.jsx)(r9.default,{})}),(0,i.jsx)(eC.Z,{variant:"overline",component:"h4",sx:{textTransform:"none"},children:t.kind?(0,i.jsx)("span",{children:(0,i.jsx)("strong",{children:c.TRANSFORM_TEXT[t.kind]})}):(0,i.jsx)("strong",{children:"Select a transformation kind"})})]}),(0,i.jsxs)(z.Z,{direction:"row",gap:1,children:[n&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(tt.Z,{title:t.spec?.disabled?"Enable transformation":"Disable transformation",placement:"top",children:(0,i.jsx)(W.Z,{size:"small",sx:{marginLeft:"auto"},onClick:function(){r({...t,spec:{...t.spec,disabled:!t.spec?.disabled}})},children:t.spec?.disabled?(0,i.jsx)(ie.default,{}):(0,i.jsx)(it.default,{})})}),(0,i.jsx)(tF.Z,{flexItem:!0,orientation:"vertical",variant:"middle"})]}),(0,i.jsx)(tt.Z,{title:"Remove transformation",placement:"top",children:(0,i.jsx)(W.Z,{size:"small",sx:{marginLeft:"auto"},onClick:o,children:(0,i.jsx)(ru.default,{})})})]})]}),!n&&(0,i.jsx)(ia,{value:t,onChange:r})]})}function id({value:e,onChange:t,...n}){let[r,l]=(0,s.useState)(e.map(()=>!0));return(0,i.jsxs)(z.Z,{gap:1,...n,children:[e.map((n,o)=>(0,i.jsx)(is,{index:o,value:n,isCollapsed:r[o]??!0,onChange:n=>(function(n,r){let i=[...e];i[n]=r,t(i)})(o,n),onDelete:()=>(function(n){let r=[...e];r.splice(n,1),t(r),l(e=>(e.splice(n,1),[...e]))})(o),onCollapse:e=>{l(t=>(t[o]=e,[...t]))}},o)),(0,i.jsx)(o.Z,{variant:"contained",startIcon:(0,i.jsx)(nK.default,{}),sx:{marginTop:1},onClick:function(){let n=[...e];n.push({kind:"",spec:{}}),t(n),l(e=>(e.push(!1),[...e]))},children:"Add Transformation"})]})}function ic(e){let{value:t,onChange:n,timeOptions:r,height:l}=e,o=(0,s.useMemo)(()=>{if(t&&!r.some(e=>e.value.pastDuration===t))return(0,i.jsx)(tj.Z,{value:t,children:t})},[r,t]);return(0,i.jsx)(e4.Z,{children:(0,i.jsx)(v.Z,{children:(0,i.jsxs)(rf.Z,{id:"refreshInterval",value:t,onChange:e=>{n(e.target.value)},inputProps:{"aria-label":`Select refresh interval. Currently set to ${t}`},sx:{".MuiSelect-select":l?{lineHeight:l,paddingY:0}:{}},children:[r.map((e,t)=>(0,i.jsx)(tj.Z,{value:e.value.pastDuration,children:e.display},t)),o]})})})}var iu=n(85731);function ih(e){let{width:t,height:n,data:r}=e,l=C(),o={title:{text:"Referer of a Website",subtext:"Fake Data",left:"center"},tooltip:{trigger:"item",formatter:"{a} <br/>{b} : {c} ({d}%)"},axisLabel:{overflow:"truncate",width:t/3},series:[{name:"Access From",type:"pie",radius:"55%",label:!1,center:["40%","50%"],data:r,emphasis:{itemStyle:{shadowBlur:10,shadowOffsetX:0,shadowColor:"rgba(0, 0, 0, 0.5)"}}}],itemStyle:{borderRadius:2,color:l.echartsTheme[0]}};return(0,i.jsx)(v.Z,{style:{width:t,height:n},sx:{overflow:"auto"},children:(0,i.jsx)(L,{sx:{minHeight:n,height:r?16*r.length:"100%"},option:o,theme:l.echartsTheme})})}(0,u.D)([iu.N,p.N,g.N,x.N,m.N,f.N]);var ip=n(27835),ig=n(943),ix=n(72116);(0,u.D)([ip.N,ig.N,p.N,g.N,x.N,m.N,f.N]);let im=e=>{var t;let{height:n,data:r,xAxisCategories:l,yAxisCategories:o,timeScale:a,colors:s}=e,{timeZone:d}=t2(),c=C(),u=(0,q.Z)(),h={tooltip:{appendToBody:!0,formatter:e=>(function({data:e,label:t,marker:n,xAxisCategories:r,yAxisCategories:i,theme:l}){let[o,a]=e,{formattedDate:s,formattedTime:d}=t0(r[o]),c=(0,ix.css)`
|
|
2
|
-
border-bottom: 1px solid ${l.palette.grey[500]};
|
|
3
|
-
padding-bottom: 8px;
|
|
4
|
-
`,u=(0,ix.css)`
|
|
5
|
-
display: flex;
|
|
6
|
-
justify-content: space-between;
|
|
7
|
-
padding-top: 8px;
|
|
8
|
-
`,h=(0,ix.css)`
|
|
9
|
-
margin-right: 16px;
|
|
10
|
-
`;return`
|
|
11
|
-
<div>
|
|
12
|
-
<div style="${c.styles}">${s} ${d}</div>
|
|
13
|
-
<div style="${u.styles}">
|
|
14
|
-
<div style="${h.styles}">
|
|
15
|
-
${n}
|
|
16
|
-
<strong>${i[a]}</strong>
|
|
17
|
-
</div>
|
|
18
|
-
<div>
|
|
19
|
-
${t}
|
|
20
|
-
</div>
|
|
21
|
-
</div>
|
|
22
|
-
</div>
|
|
23
|
-
`})({data:e.data.value,label:e.data.label,marker:e.marker,xAxisCategories:l,yAxisCategories:o,theme:u})},grid:{top:"5%",bottom:"5%"},xAxis:{type:"category",data:l,axisLine:{show:!1},splitArea:{show:!1},axisLabel:{hideOverlap:!0,formatter:(t=a?.rangeMs??0,function(e){let n=new Date(Number(e));return t>15768e7?tq(n,"yyy",d):t>63072e6?tq(n,"MMM yyy",d):t>864e6&&t<1577664e4?tq(n,"dd.MM",d):t>1728e5&&t<=864e6?tq(n,"dd.MM HH:mm",d):tq(n,"HH:mm",d)})}},yAxis:{type:"category",data:o,axisLine:{show:!1},splitArea:{show:!1,interval:0},splitLine:{show:!1},axisLabel:{interval:0}},visualMap:{show:!1,type:"piecewise",pieces:s},series:[{name:"Status history",type:"heatmap",coordinateSystem:"cartesian2d",data:r,label:{show:!1},itemStyle:{borderWidth:1,borderType:"solid",borderColor:"#ffffff"},emphasis:{itemStyle:{opacity:.5}}}]};return(0,i.jsx)(v.Z,{style:{height:n},sx:{overflow:"auto"},children:(0,i.jsx)(L,{sx:{width:"100%",height:n},option:h,theme:c.echartsTheme})})},iv="#1f77b4";function iy(e,t){t.match(/^#[0-9A-Fa-f]{6}$/)||(t=iv);try{let[n,r,i]=ij(t);if(isNaN(n)||isNaN(r)||isNaN(i))throw Error("Invalid HSL values");let l=String(e).split("").reduce((e,t)=>e+t.charCodeAt(0),0),o=Math.min(r+10,90),a=iC(Math.abs((n+l%6*60)%360),Math.min(Math.max(o,50),90),Math.min(Math.max(i+(l%2?15:-15),30),70));if(!a.match(/^#[0-9A-Fa-f]{6}$/))throw Error("Invalid generated color");return a}catch(e){return iv}}function ib(e,t){return t.length>=e.length?t.slice(0,e.length):e.map((e,n)=>n<t.length?t[n]||iv:iy(e,t[0]||iv))}function ij(e){let t=parseInt(e.slice(1,3),16)/255,n=parseInt(e.slice(3,5),16)/255,r=parseInt(e.slice(5,7),16)/255,i=Math.max(t,n,r),l=Math.min(t,n,r),o=0,a=0,s=(i+l)/2;if(i!==l){let e=i-l;switch(a=s>.5?e/(2-i-l):e/(i+l),i){case t:o=(n-r)/e+6*(n<r);break;case n:o=(r-t)/e+2;break;case r:o=(t-n)/e+4}o/=6}return[360*o,100*a,100*s]}function iC(e,t,n){let r=t*Math.min(n/=100,1-n)/100,i=t=>{let i=(t+e/30)%12;return Math.round(255*(n-r*Math.max(Math.min(i-3,9-i,1),-1))).toString(16).padStart(2,"0")};return`#${i(0)}${i(8)}${i(4)}`}var iw=n(41305);let iZ=({mapping:e,onChange:t,...n})=>{switch(e.kind){case"Value":return(0,i.jsx)(z.Z,{gap:1,direction:"row",...n,children:(0,i.jsx)($.Z,{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.Z,{gap:1,direction:"row",...n,children:[(0,i.jsx)($.Z,{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)($.Z,{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.Z,{gap:1,direction:"row",...n,children:(0,i.jsx)($.Z,{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.Z,{gap:1,direction:"row",...n,children:(0,i.jsxs)($.Z,{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)(tj.Z,{value:"empty",children:(0,i.jsxs)(z.Z,{children:[(0,i.jsx)(eC.Z,{children:"Empty"}),(0,i.jsx)(eC.Z,{variant:"caption",children:"Matches empty string"})]})}),(0,i.jsx)(tj.Z,{value:"null",children:(0,i.jsxs)(z.Z,{children:[(0,i.jsx)(eC.Z,{children:"Null"}),(0,i.jsx)(eC.Z,{variant:"caption",children:"Matches null or undefined"})]})}),(0,i.jsx)(tj.Z,{value:"NaN",children:(0,i.jsxs)(z.Z,{children:[(0,i.jsx)(eC.Z,{children:"NaN"}),(0,i.jsx)(eC.Z,{variant:"caption",children:"Matches Not a Number value"})]})}),(0,i.jsx)(tj.Z,{value:"true",children:(0,i.jsxs)(z.Z,{children:[(0,i.jsx)(eC.Z,{children:"True"}),(0,i.jsx)(eC.Z,{variant:"caption",children:"Matches true boolean"})]})}),(0,i.jsx)(tj.Z,{value:"false",children:(0,i.jsxs)(z.Z,{children:[(0,i.jsx)(eC.Z,{children:"False"}),(0,i.jsx)(eC.Z,{variant:"caption",children:"Matches false boolean"})]})})]})});default:return null}},iS=({mapping:e,onChange:t,onDelete:n,...r})=>{let l=n=>{t({...e,spec:{...e.spec,result:{...e.spec.result,color:n}}})};return(0,i.jsxs)(iw.Z,{container:!0,spacing:2,...r,children:[(0,i.jsx)(iw.Z,{size:{xs:5},children:(0,i.jsxs)(z.Z,{direction:"row",gap:1,width:"100%",children:[(0,i.jsxs)($.Z,{select:!0,label:"Type",value:e.kind,onChange:n=>t({...e,kind:n.target.value}),required:!0,sx:{width:"120px"},children:[(0,i.jsx)(tj.Z,{value:"Value",children:(0,i.jsxs)(z.Z,{children:[(0,i.jsx)(eC.Z,{children:"Value"}),"Value"!==e.kind&&(0,i.jsx)(eC.Z,{variant:"caption",children:"Matches an exact text value"})]})}),(0,i.jsx)(tj.Z,{value:"Range",children:(0,i.jsxs)(z.Z,{children:[(0,i.jsx)(eC.Z,{children:"Range"}),"Range"!==e.kind&&(0,i.jsx)(eC.Z,{variant:"caption",children:"Matches against a numerical range"})]})}),(0,i.jsx)(tj.Z,{value:"Regex",children:(0,i.jsxs)(z.Z,{children:[(0,i.jsx)(eC.Z,{children:"Regex"}),"Regex"!==e.kind&&(0,i.jsx)(eC.Z,{variant:"caption",children:"Matches against a regular expression"})]})}),(0,i.jsx)(tj.Z,{value:"Misc",children:(0,i.jsxs)(z.Z,{children:[(0,i.jsx)(eC.Z,{children:"Misc"}),"Misc"!==e.kind&&(0,i.jsx)(eC.Z,{variant:"caption",children:"Matches against empty, null and NaN values"})]})})]}),(0,i.jsx)(iZ,{width:"100%",mapping:e,onChange:n=>t({...e,...n})})]})}),(0,i.jsx)(iw.Z,{size:{xs:4},children:(0,i.jsx)($.Z,{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)(iw.Z,{size:{xs:1},children:(0,i.jsx)(z.Z,{direction:"row",justifyContent:"center",gap:1,children:e.spec?.result?.color?(0,i.jsx)(X,{label:"Color",color:e.spec.result.color??"#000",onColorChange:l,onClear:()=>l(void 0)}):(0,i.jsx)(W.Z,{onClick:()=>l("#000"),children:(0,i.jsx)(nK.default,{})})})}),(0,i.jsx)(iw.Z,{size:{xs:1},textAlign:"end",children:(0,i.jsx)(tt.Z,{title:"Remove mapping settings",placement:"top",children:(0,i.jsx)(W.Z,{size:"small",sx:{marginLeft:"auto"},onClick:n,children:(0,i.jsx)(ru.default,{})})})})]})},ik=({mappings:e,onChange:t})=>{let[n,r]=(0,s.useState)(e);return(0,i.jsxs)(z.Z,{spacing:1,children:[(0,i.jsxs)(iw.Z,{container:!0,spacing:2,children:[(0,i.jsx)(iw.Z,{size:{xs:5},children:(0,i.jsx)(eC.Z,{variant:"subtitle1",children:"Condition"})}),(0,i.jsx)(iw.Z,{size:{xs:4},children:(0,i.jsx)(eC.Z,{variant:"subtitle1",children:"Display Text"})}),(0,i.jsx)(iw.Z,{size:{xs:1},textAlign:"center",children:(0,i.jsx)(eC.Z,{variant:"subtitle1",children:"Color"})}),(0,i.jsx)(iw.Z,{size:{xs:1}})]}),(0,i.jsx)(z.Z,{gap:1.5,divider:(0,i.jsx)(tF.Z,{flexItem:!0,orientation:"horizontal"}),children:n.map((e,l)=>(0,i.jsx)(iS,{mapping:e,onChange:e=>(function(e,i){let l=[...n];l[e]=i,r(l),t(l)})(l,e),onDelete:()=>(function(e){let i=[...n];i.splice(e,1),r(i),t(i)})(l)},l))}),(0,i.jsx)(o.Z,{variant:"contained",startIcon:(0,i.jsx)(nK.default,{}),sx:{marginTop:1},onClick:function(){let e=[...n];e.push({kind:"Value",spec:{result:{value:""}}}),r(e),t(e)},children:"Add value mappings"})]})}}}]);
|