@perses-dev/table-plugin 0.6.1 → 0.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (45) hide show
  1. package/__mf/js/{6487.ac0b3bec.js → 6487.b74a51ce.js} +1 -1
  2. package/__mf/js/{Table.dcb50d79.js → Table.ae720bb0.js} +3 -3
  3. package/__mf/js/async/3090.f748dadb.js +2 -0
  4. package/__mf/js/async/{3224.673940ed.js → 3224.fbb884ab.js} +1 -1
  5. package/__mf/js/async/3598.193e9962.js +1 -0
  6. package/__mf/js/async/3980.9246eb0c.js +2 -0
  7. package/__mf/js/async/{6333.35401612.js.LICENSE.txt → 3980.9246eb0c.js.LICENSE.txt} +2 -2
  8. package/__mf/js/async/{4075.16e3dc8a.js → 4075.4fb81a28.js} +1 -1
  9. package/__mf/js/async/{5377.05ab91aa.js → 5377.0695a823.js} +1 -1
  10. package/__mf/js/async/5503.6fa43555.js +1 -0
  11. package/__mf/js/async/5901.2aaa62a6.js +2 -0
  12. package/__mf/js/async/7179.516df6f8.js +73 -0
  13. package/__mf/js/async/8970.e4194572.js +7 -0
  14. package/__mf/js/async/__federation_expose_Table.12e32a6d.js +1 -0
  15. package/__mf/js/main.8865f4ed.js +1 -0
  16. package/mf-manifest.json +64 -96
  17. package/mf-stats.json +64 -96
  18. package/package.json +5 -5
  19. package/__mf/css/async/2569.cbbd94a8.css +0 -1
  20. package/__mf/css/async/8433.cbbd94a8.css +0 -1
  21. package/__mf/js/async/133.46388a8d.js +0 -1
  22. package/__mf/js/async/2292.42e8992b.js +0 -2
  23. package/__mf/js/async/232.ab228ab3.js +0 -1
  24. package/__mf/js/async/2641.78a9e888.js +0 -1
  25. package/__mf/js/async/3079.9e782657.js +0 -23
  26. package/__mf/js/async/4062.0dd7dc24.js +0 -1
  27. package/__mf/js/async/52.77f8a241.js +0 -2
  28. package/__mf/js/async/5409.33ed27cd.js +0 -1
  29. package/__mf/js/async/5767.f16855a4.js +0 -1
  30. package/__mf/js/async/5998.ac755fc8.js +0 -73
  31. package/__mf/js/async/6277.853e296a.js +0 -23
  32. package/__mf/js/async/6333.35401612.js +0 -2
  33. package/__mf/js/async/654.0d5da894.js +0 -1
  34. package/__mf/js/async/6913.1b3a7693.js +0 -1
  35. package/__mf/js/async/7606.4ba8e3ec.js +0 -1
  36. package/__mf/js/async/894.0035563b.js +0 -1
  37. package/__mf/js/async/8981.3989d84b.js +0 -1
  38. package/__mf/js/async/9057.2b54c435.js +0 -1
  39. package/__mf/js/async/922.d9680010.js +0 -7
  40. package/__mf/js/async/__federation_expose_Table.07bc26cc.js +0 -1
  41. package/__mf/js/main.62569baf.js +0 -1
  42. /package/__mf/js/async/{2292.42e8992b.js.LICENSE.txt → 3090.f748dadb.js.LICENSE.txt} +0 -0
  43. /package/__mf/js/async/{52.77f8a241.js.LICENSE.txt → 5901.2aaa62a6.js.LICENSE.txt} +0 -0
  44. /package/__mf/js/async/{5998.ac755fc8.js.LICENSE.txt → 7179.516df6f8.js.LICENSE.txt} +0 -0
  45. /package/__mf/js/async/{922.d9680010.js.LICENSE.txt → 8970.e4194572.js.LICENSE.txt} +0 -0
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunkTable=self.webpackChunkTable||[]).push([["232"],{40150:function(t,e,s){s.r(e),s.d(e,{useIsRestoring:()=>tv,dataTagErrorSymbol:()=>tc,QueryClientProvider:()=>tm,matchQuery:()=>c,useSuspenseQuery:()=>tU,QueryClientContext:()=>tp,IsRestoringProvider:()=>tg,Mutation:()=>K,usePrefetchInfiniteQuery:()=>tL,replaceEqualDeep:()=>y,useSuspenseQueries:()=>tK,defaultShouldDehydrateQuery:()=>ti,notifyManager:()=>T,useInfiniteQuery:()=>tX,matchMutation:()=>l,unsetMarker:()=>tl,MutationObserver:()=>te,useMutationState:()=>tJ,defaultShouldDehydrateMutation:()=>tr,Query:()=>A,dataTagSymbol:()=>th,HydrationBoundary:()=>tz,onlineManager:()=>P,useQueries:()=>tT,hydrate:()=>tu,skipToken:()=>S,experimental_streamedQuery:()=>to,dehydrate:()=>ta,QueryCache:()=>j,QueryClient:()=>B,CancelledError:()=>F,isCancelledError:()=>x,usePrefetchQuery:()=>tH,QueryObserver:()=>W,focusManager:()=>q,keepPreviousData:()=>R,useQueryErrorResetBoundary:()=>tC,useMutation:()=>tV,useSuspenseInfiniteQuery:()=>tj,useIsFetching:()=>tB,QueryErrorResetBoundary:()=>tQ,hashKey:()=>f,infiniteQueryOptions:()=>tG,useIsMutating:()=>tW,useQueryClient:()=>ty,InfiniteQueryObserver:()=>tt,useQuery:()=>tA,isServer:()=>i,MutationCache:()=>L,QueriesObserver:()=>Z,queryOptions:()=>t_});var r=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(t){return this.listeners.add(t),this.onSubscribe(),()=>{this.listeners.delete(t),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},i="undefined"==typeof window||"Deno"in globalThis;function n(){}function a(t){return"number"==typeof t&&t>=0&&t!==1/0}function u(t,e){return Math.max(t+(e||0)-Date.now(),0)}function o(t,e){return"function"==typeof t?t(e):t}function h(t,e){return"function"==typeof t?t(e):t}function c(t,e){let{type:s="all",exact:r,fetchStatus:i,predicate:n,queryKey:a,stale:u}=t;if(a){if(r){if(e.queryHash!==d(a,e.options))return!1}else if(!p(e.queryKey,a))return!1}if("all"!==s){let t=e.isActive();if("active"===s&&!t||"inactive"===s&&t)return!1}return("boolean"!=typeof u||e.isStale()===u)&&(!i||i===e.state.fetchStatus)&&(!n||!!n(e))}function l(t,e){let{exact:s,status:r,predicate:i,mutationKey:n}=t;if(n){if(!e.options.mutationKey)return!1;if(s){if(f(e.options.mutationKey)!==f(n))return!1}else if(!p(e.options.mutationKey,n))return!1}return(!r||e.state.status===r)&&(!i||!!i(e))}function d(t,e){return(e?.queryKeyHashFn||f)(t)}function f(t){return JSON.stringify(t,(t,e)=>v(e)?Object.keys(e).sort().reduce((t,s)=>(t[s]=e[s],t),{}):e)}function p(t,e){return t===e||typeof t==typeof e&&!!t&&!!e&&"object"==typeof t&&"object"==typeof e&&!Object.keys(e).some(s=>!p(t[s],e[s]))}function y(t,e){if(t===e)return t;let s=b(t)&&b(e);if(s||v(t)&&v(e)){let r=s?t:Object.keys(t),i=r.length,n=s?e:Object.keys(e),a=n.length,u=s?[]:{},o=0;for(let i=0;i<a;i++){let a=s?i:n[i];(!s&&r.includes(a)||s)&&void 0===t[a]&&void 0===e[a]?(u[a]=void 0,o++):(u[a]=y(t[a],e[a]),u[a]===t[a]&&void 0!==t[a]&&o++)}return i===a&&o===i?t:u}return e}function m(t,e){if(!e||Object.keys(t).length!==Object.keys(e).length)return!1;for(let s in t)if(t[s]!==e[s])return!1;return!0}function b(t){return Array.isArray(t)&&t.length===Object.keys(t).length}function v(t){if(!g(t))return!1;let e=t.constructor;if(void 0===e)return!0;let s=e.prototype;return!!(g(s)&&s.hasOwnProperty("isPrototypeOf"))&&Object.getPrototypeOf(t)===Object.prototype}function g(t){return"[object Object]"===Object.prototype.toString.call(t)}function O(t,e,s){return"function"==typeof s.structuralSharing?s.structuralSharing(t,e):!1!==s.structuralSharing?y(t,e):e}function R(t){return t}function C(t,e,s=0){let r=[...t,e];return s&&r.length>s?r.slice(1):r}function Q(t,e,s=0){let r=[e,...t];return s&&r.length>s?r.slice(0,-1):r}var S=Symbol();function w(t,e){return!t.queryFn&&e?.initialPromise?()=>e.initialPromise:t.queryFn&&t.queryFn!==S?t.queryFn:()=>Promise.reject(Error(`Missing queryFn: '${t.queryHash}'`))}var q=new class extends r{#t;#e;#s;constructor(){super(),this.#s=t=>{if(!i&&window.addEventListener){let e=()=>t();return window.addEventListener("visibilitychange",e,!1),()=>{window.removeEventListener("visibilitychange",e)}}}}onSubscribe(){this.#e||this.setEventListener(this.#s)}onUnsubscribe(){this.hasListeners()||(this.#e?.(),this.#e=void 0)}setEventListener(t){this.#s=t,this.#e?.(),this.#e=t(t=>{"boolean"==typeof t?this.setFocused(t):this.onFocus()})}setFocused(t){this.#t!==t&&(this.#t=t,this.onFocus())}onFocus(){let t=this.isFocused();this.listeners.forEach(e=>{e(t)})}isFocused(){return"boolean"==typeof this.#t?this.#t:globalThis.document?.visibilityState!=="hidden"}},P=new class extends r{#r=!0;#e;#s;constructor(){super(),this.#s=t=>{if(!i&&window.addEventListener){let e=()=>t(!0),s=()=>t(!1);return window.addEventListener("online",e,!1),window.addEventListener("offline",s,!1),()=>{window.removeEventListener("online",e),window.removeEventListener("offline",s)}}}}onSubscribe(){this.#e||this.setEventListener(this.#s)}onUnsubscribe(){this.hasListeners()||(this.#e?.(),this.#e=void 0)}setEventListener(t){this.#s=t,this.#e?.(),this.#e=t(this.setOnline.bind(this))}setOnline(t){this.#r!==t&&(this.#r=t,this.listeners.forEach(e=>{e(t)}))}isOnline(){return this.#r}};function E(){let t,e;let s=new Promise((s,r)=>{t=s,e=r});function r(t){Object.assign(s,t),delete s.resolve,delete s.reject}return s.status="pending",s.catch(()=>{}),s.resolve=e=>{r({status:"fulfilled",value:e}),t(e)},s.reject=t=>{r({status:"rejected",reason:t}),e(t)},s}function M(t){return Math.min(1e3*2**t,3e4)}function D(t){return(t??"online")!=="online"||P.isOnline()}var F=class extends Error{constructor(t){super("CancelledError"),this.revert=t?.revert,this.silent=t?.silent}};function x(t){return t instanceof F}function I(t){let e,s=!1,r=0,n=!1,a=E(),u=()=>q.isFocused()&&("always"===t.networkMode||P.isOnline())&&t.canRun(),o=()=>D(t.networkMode)&&t.canRun(),h=s=>{n||(n=!0,t.onSuccess?.(s),e?.(),a.resolve(s))},c=s=>{n||(n=!0,t.onError?.(s),e?.(),a.reject(s))},l=()=>new Promise(s=>{e=t=>{(n||u())&&s(t)},t.onPause?.()}).then(()=>{e=void 0,n||t.onContinue?.()}),d=()=>{let e;if(n)return;let a=0===r?t.initialPromise:void 0;try{e=a??t.fn()}catch(t){e=Promise.reject(t)}Promise.resolve(e).then(h).catch(e=>{if(n)return;let a=t.retry??3*!i,o=t.retryDelay??M,h="function"==typeof o?o(r,e):o,f=!0===a||"number"==typeof a&&r<a||"function"==typeof a&&a(r,e);if(s||!f){c(e);return}r++,t.onFail?.(r,e),new Promise(t=>{setTimeout(t,h)}).then(()=>u()?void 0:l()).then(()=>{s?c(e):d()})})};return{promise:a,cancel:e=>{n||(c(new F(e)),t.abort?.())},continue:()=>(e?.(),a),cancelRetry:()=>{s=!0},continueRetry:()=>{s=!1},canStart:o,start:()=>(o()?d():l().then(d),a)}}var T=function(){let t=[],e=0,s=t=>{t()},r=t=>{t()},i=t=>setTimeout(t,0),n=r=>{e?t.push(r):i(()=>{s(r)})},a=()=>{let e=t;t=[],e.length&&i(()=>{r(()=>{e.forEach(t=>{s(t)})})})};return{batch:t=>{let s;e++;try{s=t()}finally{--e||a()}return s},batchCalls:t=>(...e)=>{n(()=>{t(...e)})},schedule:n,setNotifyFunction:t=>{s=t},setBatchNotifyFunction:t=>{r=t},setScheduler:t=>{i=t}}}(),k=class{#i;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),a(this.gcTime)&&(this.#i=setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(t){this.gcTime=Math.max(this.gcTime||0,t??(i?1/0:3e5))}clearGcTimeout(){this.#i&&(clearTimeout(this.#i),this.#i=void 0)}},A=class extends k{#n;#a;#u;#o;#h;#c;#l;constructor(t){super(),this.#l=!1,this.#c=t.defaultOptions,this.setOptions(t.options),this.observers=[],this.#o=t.client,this.#u=this.#o.getQueryCache(),this.queryKey=t.queryKey,this.queryHash=t.queryHash,this.#n=function(t){let e="function"==typeof t.initialData?t.initialData():t.initialData,s=void 0!==e,r=s?"function"==typeof t.initialDataUpdatedAt?t.initialDataUpdatedAt():t.initialDataUpdatedAt:0;return{data:e,dataUpdateCount:0,dataUpdatedAt:s?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:s?"success":"pending",fetchStatus:"idle"}}(this.options),this.state=t.state??this.#n,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#h?.promise}setOptions(t){this.options={...this.#c,...t},this.updateGcTime(this.options.gcTime)}optionalRemove(){this.observers.length||"idle"!==this.state.fetchStatus||this.#u.remove(this)}setData(t,e){let s=O(this.state.data,t,this.options);return this.#d({data:s,type:"success",dataUpdatedAt:e?.updatedAt,manual:e?.manual}),s}setState(t,e){this.#d({type:"setState",state:t,setStateOptions:e})}cancel(t){let e=this.#h?.promise;return this.#h?.cancel(t),e?e.then(n).catch(n):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.#n)}isActive(){return this.observers.some(t=>!1!==h(t.options.enabled,this))}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===S||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStale(){return!!this.state.isInvalidated||(this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):void 0===this.state.data)}isStaleByTime(t=0){return this.state.isInvalidated||void 0===this.state.data||!u(this.state.dataUpdatedAt,t)}onFocus(){let t=this.observers.find(t=>t.shouldFetchOnWindowFocus());t?.refetch({cancelRefetch:!1}),this.#h?.continue()}onOnline(){let t=this.observers.find(t=>t.shouldFetchOnReconnect());t?.refetch({cancelRefetch:!1}),this.#h?.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),this.#u.notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(e=>e!==t),this.observers.length||(this.#h&&(this.#l?this.#h.cancel({revert:!0}):this.#h.cancelRetry()),this.scheduleGc()),this.#u.notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#d({type:"invalidate"})}fetch(t,e){if("idle"!==this.state.fetchStatus){if(void 0!==this.state.data&&e?.cancelRefetch)this.cancel({silent:!0});else if(this.#h)return this.#h.continueRetry(),this.#h.promise}if(t&&this.setOptions(t),!this.options.queryFn){let t=this.observers.find(t=>t.options.queryFn);t&&this.setOptions(t.options)}let s=new AbortController,r=t=>{Object.defineProperty(t,"signal",{enumerable:!0,get:()=>(this.#l=!0,s.signal)})},i={fetchOptions:e,options:this.options,queryKey:this.queryKey,client:this.#o,state:this.state,fetchFn:()=>{let t=w(this.options,e),s={client:this.#o,queryKey:this.queryKey,meta:this.meta};return(r(s),this.#l=!1,this.options.persister)?this.options.persister(t,s,this):t(s)}};r(i),this.options.behavior?.onFetch(i,this),this.#a=this.state,("idle"===this.state.fetchStatus||this.state.fetchMeta!==i.fetchOptions?.meta)&&this.#d({type:"fetch",meta:i.fetchOptions?.meta});let n=t=>{x(t)&&t.silent||this.#d({type:"error",error:t}),x(t)||(this.#u.config.onError?.(t,this),this.#u.config.onSettled?.(this.state.data,t,this)),this.scheduleGc()};return this.#h=I({initialPromise:e?.initialPromise,fn:i.fetchFn,abort:s.abort.bind(s),onSuccess:t=>{if(void 0===t){n(Error(`${this.queryHash} data is undefined`));return}try{this.setData(t)}catch(t){n(t);return}this.#u.config.onSuccess?.(t,this),this.#u.config.onSettled?.(t,this.state.error,this),this.scheduleGc()},onError:n,onFail:(t,e)=>{this.#d({type:"failed",failureCount:t,error:e})},onPause:()=>{this.#d({type:"pause"})},onContinue:()=>{this.#d({type:"continue"})},retry:i.options.retry,retryDelay:i.options.retryDelay,networkMode:i.options.networkMode,canRun:()=>!0}),this.#h.start()}#d(t){this.state=(e=>{switch(t.type){case"failed":return{...e,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...e,fetchStatus:"paused"};case"continue":return{...e,fetchStatus:"fetching"};case"fetch":return{...e,...U(e.data,this.options),fetchMeta:t.meta??null};case"success":return{...e,data:t.data,dataUpdateCount:e.dataUpdateCount+1,dataUpdatedAt:t.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":let s=t.error;if(x(s)&&s.revert&&this.#a)return{...this.#a,fetchStatus:"idle"};return{...e,error:s,errorUpdateCount:e.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:e.fetchFailureCount+1,fetchFailureReason:s,fetchStatus:"idle",status:"error"};case"invalidate":return{...e,isInvalidated:!0};case"setState":return{...e,...t.state}}})(this.state),T.batch(()=>{this.observers.forEach(t=>{t.onQueryUpdate()}),this.#u.notify({query:this,type:"updated",action:t})})}};function U(t,e){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:D(e.networkMode)?"fetching":"paused",...void 0===t&&{error:null,status:"pending"}}}var j=class extends r{constructor(t={}){super(),this.config=t,this.#f=new Map}#f;build(t,e,s){let r=e.queryKey,i=e.queryHash??d(r,e),n=this.get(i);return n||(n=new A({client:t,queryKey:r,queryHash:i,options:t.defaultQueryOptions(e),state:s,defaultOptions:t.getQueryDefaults(r)}),this.add(n)),n}add(t){this.#f.has(t.queryHash)||(this.#f.set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){let e=this.#f.get(t.queryHash);e&&(t.destroy(),e===t&&this.#f.delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){T.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return this.#f.get(t)}getAll(){return[...this.#f.values()]}find(t){let e={exact:!0,...t};return this.getAll().find(t=>c(e,t))}findAll(t={}){let e=this.getAll();return Object.keys(t).length>0?e.filter(e=>c(t,e)):e}notify(t){T.batch(()=>{this.listeners.forEach(e=>{e(t)})})}onFocus(){T.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){T.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},K=class extends k{#p;#y;#h;constructor(t){super(),this.mutationId=t.mutationId,this.#y=t.mutationCache,this.#p=[],this.state=t.state||H(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){this.#p.includes(t)||(this.#p.push(t),this.clearGcTimeout(),this.#y.notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){this.#p=this.#p.filter(e=>e!==t),this.scheduleGc(),this.#y.notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){this.#p.length||("pending"===this.state.status?this.scheduleGc():this.#y.remove(this))}continue(){return this.#h?.continue()??this.execute(this.state.variables)}async execute(t){this.#h=I({fn:()=>this.options.mutationFn?this.options.mutationFn(t):Promise.reject(Error("No mutationFn found")),onFail:(t,e)=>{this.#d({type:"failed",failureCount:t,error:e})},onPause:()=>{this.#d({type:"pause"})},onContinue:()=>{this.#d({type:"continue"})},retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#y.canRun(this)});let e="pending"===this.state.status,s=!this.#h.canStart();try{if(!e){this.#d({type:"pending",variables:t,isPaused:s}),await this.#y.config.onMutate?.(t,this);let e=await this.options.onMutate?.(t);e!==this.state.context&&this.#d({type:"pending",context:e,variables:t,isPaused:s})}let r=await this.#h.start();return await this.#y.config.onSuccess?.(r,t,this.state.context,this),await this.options.onSuccess?.(r,t,this.state.context),await this.#y.config.onSettled?.(r,null,this.state.variables,this.state.context,this),await this.options.onSettled?.(r,null,t,this.state.context),this.#d({type:"success",data:r}),r}catch(e){try{throw await this.#y.config.onError?.(e,t,this.state.context,this),await this.options.onError?.(e,t,this.state.context),await this.#y.config.onSettled?.(void 0,e,this.state.variables,this.state.context,this),await this.options.onSettled?.(void 0,e,t,this.state.context),e}finally{this.#d({type:"error",error:e})}}finally{this.#y.runNext(this)}}#d(t){this.state=(e=>{switch(t.type){case"failed":return{...e,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...e,isPaused:!0};case"continue":return{...e,isPaused:!1};case"pending":return{...e,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...e,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...e,data:void 0,error:t.error,failureCount:e.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}})(this.state),T.batch(()=>{this.#p.forEach(e=>{e.onMutationUpdate(t)}),this.#y.notify({mutation:this,type:"updated",action:t})})}};function H(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var L=class extends r{constructor(t={}){super(),this.config=t,this.#m=new Set,this.#b=new Map,this.#v=0}#m;#b;#v;build(t,e,s){let r=new K({mutationCache:this,mutationId:++this.#v,options:t.defaultMutationOptions(e),state:s});return this.add(r),r}add(t){this.#m.add(t);let e=_(t);if("string"==typeof e){let s=this.#b.get(e);s?s.push(t):this.#b.set(e,[t])}this.notify({type:"added",mutation:t})}remove(t){if(this.#m.delete(t)){let e=_(t);if("string"==typeof e){let s=this.#b.get(e);if(s){if(s.length>1){let e=s.indexOf(t);-1!==e&&s.splice(e,1)}else s[0]===t&&this.#b.delete(e)}}}this.notify({type:"removed",mutation:t})}canRun(t){let e=_(t);if("string"!=typeof e)return!0;{let s=this.#b.get(e),r=s?.find(t=>"pending"===t.state.status);return!r||r===t}}runNext(t){let e=_(t);if("string"!=typeof e)return Promise.resolve();{let s=this.#b.get(e)?.find(e=>e!==t&&e.state.isPaused);return s?.continue()??Promise.resolve()}}clear(){T.batch(()=>{this.#m.forEach(t=>{this.notify({type:"removed",mutation:t})}),this.#m.clear(),this.#b.clear()})}getAll(){return Array.from(this.#m)}find(t){let e={exact:!0,...t};return this.getAll().find(t=>l(e,t))}findAll(t={}){return this.getAll().filter(e=>l(t,e))}notify(t){T.batch(()=>{this.listeners.forEach(e=>{e(t)})})}resumePausedMutations(){let t=this.getAll().filter(t=>t.state.isPaused);return T.batch(()=>Promise.all(t.map(t=>t.continue().catch(n))))}};function _(t){return t.options.scope?.id}function G(t){return{onFetch:(e,s)=>{let r=e.options,i=e.fetchOptions?.meta?.fetchMore?.direction,n=e.state.data?.pages||[],a=e.state.data?.pageParams||[],u={pages:[],pageParams:[]},o=0,h=async()=>{let s=!1,h=t=>{Object.defineProperty(t,"signal",{enumerable:!0,get:()=>(e.signal.aborted?s=!0:e.signal.addEventListener("abort",()=>{s=!0}),e.signal)})},c=w(e.options,e.fetchOptions),l=async(t,r,i)=>{if(s)return Promise.reject();if(null==r&&t.pages.length)return Promise.resolve(t);let n={client:e.client,queryKey:e.queryKey,pageParam:r,direction:i?"backward":"forward",meta:e.options.meta};h(n);let a=await c(n),{maxPages:u}=e.options,o=i?Q:C;return{pages:o(t.pages,a,u),pageParams:o(t.pageParams,r,u)}};if(i&&n.length){let t="backward"===i,e={pages:n,pageParams:a},s=(t?z:N)(r,e);u=await l(e,s,t)}else{let e=t??n.length;do{let t=0===o?a[0]??r.initialPageParam:N(r,u);if(o>0&&null==t)break;u=await l(u,t),o++}while(o<e)}return u};e.options.persister?e.fetchFn=()=>e.options.persister?.(h,{client:e.client,queryKey:e.queryKey,meta:e.options.meta,signal:e.signal},s):e.fetchFn=h}}}function N(t,{pages:e,pageParams:s}){let r=e.length-1;return e.length>0?t.getNextPageParam(e[r],e,s[r],s):void 0}function z(t,{pages:e,pageParams:s}){return e.length>0?t.getPreviousPageParam?.(e[0],e,s[0],s):void 0}var B=class{#g;#y;#c;#O;#R;#C;#Q;#S;constructor(t={}){this.#g=t.queryCache||new j,this.#y=t.mutationCache||new L,this.#c=t.defaultOptions||{},this.#O=new Map,this.#R=new Map,this.#C=0}mount(){this.#C++,1===this.#C&&(this.#Q=q.subscribe(async t=>{t&&(await this.resumePausedMutations(),this.#g.onFocus())}),this.#S=P.subscribe(async t=>{t&&(await this.resumePausedMutations(),this.#g.onOnline())}))}unmount(){this.#C--,0===this.#C&&(this.#Q?.(),this.#Q=void 0,this.#S?.(),this.#S=void 0)}isFetching(t){return this.#g.findAll({...t,fetchStatus:"fetching"}).length}isMutating(t){return this.#y.findAll({...t,status:"pending"}).length}getQueryData(t){let e=this.defaultQueryOptions({queryKey:t});return this.#g.get(e.queryHash)?.state.data}ensureQueryData(t){let e=this.defaultQueryOptions(t),s=this.#g.build(this,e),r=s.state.data;return void 0===r?this.fetchQuery(t):(t.revalidateIfStale&&s.isStaleByTime(o(e.staleTime,s))&&this.prefetchQuery(e),Promise.resolve(r))}getQueriesData(t){return this.#g.findAll(t).map(({queryKey:t,state:e})=>[t,e.data])}setQueryData(t,e,s){let r=this.defaultQueryOptions({queryKey:t}),i=this.#g.get(r.queryHash),n=i?.state.data,a="function"==typeof e?e(n):e;if(void 0!==a)return this.#g.build(this,r).setData(a,{...s,manual:!0})}setQueriesData(t,e,s){return T.batch(()=>this.#g.findAll(t).map(({queryKey:t})=>[t,this.setQueryData(t,e,s)]))}getQueryState(t){let e=this.defaultQueryOptions({queryKey:t});return this.#g.get(e.queryHash)?.state}removeQueries(t){let e=this.#g;T.batch(()=>{e.findAll(t).forEach(t=>{e.remove(t)})})}resetQueries(t,e){let s=this.#g;return T.batch(()=>(s.findAll(t).forEach(t=>{t.reset()}),this.refetchQueries({type:"active",...t},e)))}cancelQueries(t,e={}){let s={revert:!0,...e};return Promise.all(T.batch(()=>this.#g.findAll(t).map(t=>t.cancel(s)))).then(n).catch(n)}invalidateQueries(t,e={}){return T.batch(()=>(this.#g.findAll(t).forEach(t=>{t.invalidate()}),t?.refetchType==="none")?Promise.resolve():this.refetchQueries({...t,type:t?.refetchType??t?.type??"active"},e))}refetchQueries(t,e={}){let s={...e,cancelRefetch:e.cancelRefetch??!0};return Promise.all(T.batch(()=>this.#g.findAll(t).filter(t=>!t.isDisabled()).map(t=>{let e=t.fetch(void 0,s);return s.throwOnError||(e=e.catch(n)),"paused"===t.state.fetchStatus?Promise.resolve():e}))).then(n)}fetchQuery(t){let e=this.defaultQueryOptions(t);void 0===e.retry&&(e.retry=!1);let s=this.#g.build(this,e);return s.isStaleByTime(o(e.staleTime,s))?s.fetch(e):Promise.resolve(s.state.data)}prefetchQuery(t){return this.fetchQuery(t).then(n).catch(n)}fetchInfiniteQuery(t){return t.behavior=G(t.pages),this.fetchQuery(t)}prefetchInfiniteQuery(t){return this.fetchInfiniteQuery(t).then(n).catch(n)}ensureInfiniteQueryData(t){return t.behavior=G(t.pages),this.ensureQueryData(t)}resumePausedMutations(){return P.isOnline()?this.#y.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#g}getMutationCache(){return this.#y}getDefaultOptions(){return this.#c}setDefaultOptions(t){this.#c=t}setQueryDefaults(t,e){this.#O.set(f(t),{queryKey:t,defaultOptions:e})}getQueryDefaults(t){let e=[...this.#O.values()],s={};return e.forEach(e=>{p(t,e.queryKey)&&Object.assign(s,e.defaultOptions)}),s}setMutationDefaults(t,e){this.#R.set(f(t),{mutationKey:t,defaultOptions:e})}getMutationDefaults(t){let e=[...this.#R.values()],s={};return e.forEach(e=>{p(t,e.mutationKey)&&Object.assign(s,e.defaultOptions)}),s}defaultQueryOptions(t){if(t._defaulted)return t;let e={...this.#c.queries,...this.getQueryDefaults(t.queryKey),...t,_defaulted:!0};return e.queryHash||(e.queryHash=d(e.queryKey,e)),void 0===e.refetchOnReconnect&&(e.refetchOnReconnect="always"!==e.networkMode),void 0===e.throwOnError&&(e.throwOnError=!!e.suspense),!e.networkMode&&e.persister&&(e.networkMode="offlineFirst"),e.queryFn===S&&(e.enabled=!1),e}defaultMutationOptions(t){return t?._defaulted?t:{...this.#c.mutations,...t?.mutationKey&&this.getMutationDefaults(t.mutationKey),...t,_defaulted:!0}}clear(){this.#g.clear(),this.#y.clear()}},W=class extends r{constructor(t,e){super(),this.options=e,this.#o=t,this.#w=null,this.#q=E(),this.options.experimental_prefetchInRender||this.#q.reject(Error("experimental_prefetchInRender feature flag is not enabled")),this.bindMethods(),this.setOptions(e)}#o;#P=void 0;#E=void 0;#M=void 0;#D;#F;#q;#w;#x;#I;#T;#k;#A;#U;#j=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){1===this.listeners.size&&(this.#P.addObserver(this),$(this.#P,this.options)?this.#K():this.updateResult(),this.#H())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return J(this.#P,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return J(this.#P,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#L(),this.#_(),this.#P.removeObserver(this)}setOptions(t,e){let s=this.options,r=this.#P;if(this.options=this.#o.defaultQueryOptions(t),void 0!==this.options.enabled&&"boolean"!=typeof this.options.enabled&&"function"!=typeof this.options.enabled&&"boolean"!=typeof h(this.options.enabled,this.#P))throw Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#G(),this.#P.setOptions(this.options),s._defaulted&&!m(this.options,s)&&this.#o.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#P,observer:this});let i=this.hasListeners();i&&V(this.#P,r,this.options,s)&&this.#K(),this.updateResult(e),i&&(this.#P!==r||h(this.options.enabled,this.#P)!==h(s.enabled,this.#P)||o(this.options.staleTime,this.#P)!==o(s.staleTime,this.#P))&&this.#N();let n=this.#z();i&&(this.#P!==r||h(this.options.enabled,this.#P)!==h(s.enabled,this.#P)||n!==this.#U)&&this.#B(n)}getOptimisticResult(t){var e,s;let r=this.#o.getQueryCache().build(this.#o,t),i=this.createResult(r,t);return e=this,s=i,m(e.getCurrentResult(),s)||(this.#M=i,this.#F=this.options,this.#D=this.#P.state),i}getCurrentResult(){return this.#M}trackResult(t,e){let s={};return Object.keys(t).forEach(r=>{Object.defineProperty(s,r,{configurable:!1,enumerable:!0,get:()=>(this.trackProp(r),e?.(r),t[r])})}),s}trackProp(t){this.#j.add(t)}getCurrentQuery(){return this.#P}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){let e=this.#o.defaultQueryOptions(t),s=this.#o.getQueryCache().build(this.#o,e);return s.fetch().then(()=>this.createResult(s,e))}fetch(t){return this.#K({...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#M))}#K(t){this.#G();let e=this.#P.fetch(this.options,t);return t?.throwOnError||(e=e.catch(n)),e}#N(){this.#L();let t=o(this.options.staleTime,this.#P);if(i||this.#M.isStale||!a(t))return;let e=u(this.#M.dataUpdatedAt,t);this.#k=setTimeout(()=>{this.#M.isStale||this.updateResult()},e+1)}#z(){return("function"==typeof this.options.refetchInterval?this.options.refetchInterval(this.#P):this.options.refetchInterval)??!1}#B(t){this.#_(),this.#U=t,!i&&!1!==h(this.options.enabled,this.#P)&&a(this.#U)&&0!==this.#U&&(this.#A=setInterval(()=>{(this.options.refetchIntervalInBackground||q.isFocused())&&this.#K()},this.#U))}#H(){this.#N(),this.#B(this.#z())}#L(){this.#k&&(clearTimeout(this.#k),this.#k=void 0)}#_(){this.#A&&(clearInterval(this.#A),this.#A=void 0)}createResult(t,e){let s;let r=this.#P,i=this.options,n=this.#M,a=this.#D,u=this.#F,o=t!==r?t.state:this.#E,{state:h}=t,c={...h},l=!1;if(e._optimisticResults){let s=this.hasListeners(),n=!s&&$(t,e),a=s&&V(t,r,e,i);(n||a)&&(c={...c,...U(h.data,t.options)}),"isRestoring"===e._optimisticResults&&(c.fetchStatus="idle")}let{error:d,errorUpdatedAt:f,status:p}=c;if(e.select&&void 0!==c.data){if(n&&c.data===a?.data&&e.select===this.#x)s=this.#I;else try{this.#x=e.select,s=e.select(c.data),s=O(n?.data,s,e),this.#I=s,this.#w=null}catch(t){this.#w=t}}else s=c.data;if(void 0!==e.placeholderData&&void 0===s&&"pending"===p){let t;if(n?.isPlaceholderData&&e.placeholderData===u?.placeholderData)t=n.data;else if(t="function"==typeof e.placeholderData?e.placeholderData(this.#T?.state.data,this.#T):e.placeholderData,e.select&&void 0!==t)try{t=e.select(t),this.#w=null}catch(t){this.#w=t}void 0!==t&&(p="success",s=O(n?.data,t,e),l=!0)}this.#w&&(d=this.#w,s=this.#I,f=Date.now(),p="error");let y="fetching"===c.fetchStatus,m="pending"===p,b="error"===p,v=m&&y,g=void 0!==s,R={status:p,fetchStatus:c.fetchStatus,isPending:m,isSuccess:"success"===p,isError:b,isInitialLoading:v,isLoading:v,data:s,dataUpdatedAt:c.dataUpdatedAt,error:d,errorUpdatedAt:f,failureCount:c.fetchFailureCount,failureReason:c.fetchFailureReason,errorUpdateCount:c.errorUpdateCount,isFetched:c.dataUpdateCount>0||c.errorUpdateCount>0,isFetchedAfterMount:c.dataUpdateCount>o.dataUpdateCount||c.errorUpdateCount>o.errorUpdateCount,isFetching:y,isRefetching:y&&!m,isLoadingError:b&&!g,isPaused:"paused"===c.fetchStatus,isPlaceholderData:l,isRefetchError:b&&g,isStale:X(t,e),refetch:this.refetch,promise:this.#q};if(this.options.experimental_prefetchInRender){let e=t=>{"error"===R.status?t.reject(R.error):void 0!==R.data&&t.resolve(R.data)},s=()=>{e(this.#q=R.promise=E())},i=this.#q;switch(i.status){case"pending":t.queryHash===r.queryHash&&e(i);break;case"fulfilled":("error"===R.status||R.data!==i.value)&&s();break;case"rejected":("error"!==R.status||R.error!==i.reason)&&s()}}return R}updateResult(t){let e=this.#M,s=this.createResult(this.#P,this.options);if(this.#D=this.#P.state,this.#F=this.options,void 0!==this.#D.data&&(this.#T=this.#P),m(s,e))return;this.#M=s;let r={};t?.listeners!==!1&&(()=>{if(!e)return!0;let{notifyOnChangeProps:t}=this.options,s="function"==typeof t?t():t;if("all"===s||!s&&!this.#j.size)return!0;let r=new Set(s??this.#j);return this.options.throwOnError&&r.add("error"),Object.keys(this.#M).some(t=>this.#M[t]!==e[t]&&r.has(t))})()&&(r.listeners=!0),this.#W({...r,...t})}#G(){let t=this.#o.getQueryCache().build(this.#o,this.options);if(t===this.#P)return;let e=this.#P;this.#P=t,this.#E=t.state,this.hasListeners()&&(e?.removeObserver(this),t.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#H()}#W(t){T.batch(()=>{t.listeners&&this.listeners.forEach(t=>{t(this.#M)}),this.#o.getQueryCache().notify({query:this.#P,type:"observerResultsUpdated"})})}};function $(t,e){return!1!==h(e.enabled,t)&&void 0===t.state.data&&("error"!==t.state.status||!1!==e.retryOnMount)||void 0!==t.state.data&&J(t,e,e.refetchOnMount)}function J(t,e,s){if(!1!==h(e.enabled,t)){let r="function"==typeof s?s(t):s;return"always"===r||!1!==r&&X(t,e)}return!1}function V(t,e,s,r){return(t!==e||!1===h(r.enabled,t))&&(!s.suspense||"error"!==t.state.status)&&X(t,s)}function X(t,e){return!1!==h(e.enabled,t)&&t.isStaleByTime(o(e.staleTime,t))}function Y(t,e){return t.filter(t=>!e.includes(t))}var Z=class extends r{#o;#$;#f;#J;#p;#V;#X;#Y;#Z=[];constructor(t,e,s){super(),this.#o=t,this.#J=s,this.#f=[],this.#p=[],this.#$=[],this.setQueries(e)}onSubscribe(){1===this.listeners.size&&this.#p.forEach(t=>{t.subscribe(e=>{this.#tt(t,e)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,this.#p.forEach(t=>{t.destroy()})}setQueries(t,e,s){this.#f=t,this.#J=e,T.batch(()=>{let t=this.#p,e=this.#te(this.#f);this.#Z=e,e.forEach(t=>t.observer.setOptions(t.defaultedQueryOptions,s));let r=e.map(t=>t.observer),i=r.map(t=>t.getCurrentResult()),n=r.some((e,s)=>e!==t[s]);if(t.length!==r.length||n)this.#p=r,this.#$=i,this.hasListeners()&&(Y(t,r).forEach(t=>{t.destroy()}),Y(r,t).forEach(t=>{t.subscribe(e=>{this.#tt(t,e)})}),this.#W())})}getCurrentResult(){return this.#$}getQueries(){return this.#p.map(t=>t.getCurrentQuery())}getObservers(){return this.#p}getOptimisticResult(t,e){let s=this.#te(t),r=s.map(t=>t.observer.getOptimisticResult(t.defaultedQueryOptions));return[r,t=>this.#ts(t??r,e),()=>this.#tr(r,s)]}#tr(t,e){return e.map((s,r)=>{let i=t[r];return s.defaultedQueryOptions.notifyOnChangeProps?i:s.observer.trackResult(i,t=>{e.forEach(e=>{e.observer.trackProp(t)})})})}#ts(t,e){return e?(this.#V&&this.#$===this.#Y&&e===this.#X||(this.#X=e,this.#Y=this.#$,this.#V=y(this.#V,e(t))),this.#V):t}#te(t){let e=new Map(this.#p.map(t=>[t.options.queryHash,t])),s=[];return t.forEach(t=>{let r=this.#o.defaultQueryOptions(t),i=e.get(r.queryHash);i?s.push({defaultedQueryOptions:r,observer:i}):s.push({defaultedQueryOptions:r,observer:new W(this.#o,r)})}),s}#tt(t,e){let s=this.#p.indexOf(t);-1!==s&&(this.#$=function(t,e,s){let r=t.slice(0);return r[e]=s,r}(this.#$,s,e),this.#W())}#W(){if(this.hasListeners()){let t=this.#V,e=this.#tr(this.#$,this.#Z);t!==this.#ts(e,this.#J?.combine)&&T.batch(()=>{this.listeners.forEach(t=>{t(this.#$)})})}}},tt=class extends W{constructor(t,e){super(t,e)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(t,e){super.setOptions({...t,behavior:G()},e)}getOptimisticResult(t){return t.behavior=G(),super.getOptimisticResult(t)}fetchNextPage(t){return this.fetch({...t,meta:{fetchMore:{direction:"forward"}}})}fetchPreviousPage(t){return this.fetch({...t,meta:{fetchMore:{direction:"backward"}}})}createResult(t,e){var s,r;let{state:i}=t,n=super.createResult(t,e),{isFetching:a,isRefetching:u,isError:o,isRefetchError:h}=n,c=i.fetchMeta?.fetchMore?.direction,l=o&&"forward"===c,d=a&&"forward"===c,f=o&&"backward"===c,p=a&&"backward"===c;return{...n,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:!!(s=i.data)&&null!=N(e,s),hasPreviousPage:!!(r=i.data)&&!!e.getPreviousPageParam&&null!=z(e,r),isFetchNextPageError:l,isFetchingNextPage:d,isFetchPreviousPageError:f,isFetchingPreviousPage:p,isRefetchError:h&&!l&&!f,isRefetching:u&&!d&&!p}}},te=class extends r{#o;#M=void 0;#ti;#tn;constructor(t,e){super(),this.#o=t,this.setOptions(e),this.bindMethods(),this.#ta()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(t){let e=this.options;this.options=this.#o.defaultMutationOptions(t),m(this.options,e)||this.#o.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#ti,observer:this}),e?.mutationKey&&this.options.mutationKey&&f(e.mutationKey)!==f(this.options.mutationKey)?this.reset():this.#ti?.state.status==="pending"&&this.#ti.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#ti?.removeObserver(this)}onMutationUpdate(t){this.#ta(),this.#W(t)}getCurrentResult(){return this.#M}reset(){this.#ti?.removeObserver(this),this.#ti=void 0,this.#ta(),this.#W()}mutate(t,e){return this.#tn=e,this.#ti?.removeObserver(this),this.#ti=this.#o.getMutationCache().build(this.#o,this.options),this.#ti.addObserver(this),this.#ti.execute(t)}#ta(){let t=this.#ti?.state??H();this.#M={...t,isPending:"pending"===t.status,isSuccess:"success"===t.status,isError:"error"===t.status,isIdle:"idle"===t.status,mutate:this.mutate,reset:this.reset}}#W(t){T.batch(()=>{if(this.#tn&&this.hasListeners()){let e=this.#M.variables,s=this.#M.context;t?.type==="success"?(this.#tn.onSuccess?.(t.data,e,s),this.#tn.onSettled?.(t.data,null,e,s)):t?.type==="error"&&(this.#tn.onError?.(t.error,e,s),this.#tn.onSettled?.(void 0,t.error,e,s))}this.listeners.forEach(t=>{t(this.#M)})})}};function ts(t){return t}function tr(t){return t.state.isPaused}function ti(t){return"success"===t.state.status}function tn(t){return!0}function ta(t,e={}){let s=e.shouldDehydrateMutation??t.getDefaultOptions().dehydrate?.shouldDehydrateMutation??tr,r=t.getMutationCache().getAll().flatMap(t=>s(t)?[{mutationKey:t.options.mutationKey,state:t.state,...t.options.scope&&{scope:t.options.scope},...t.meta&&{meta:t.meta}}]:[]),i=e.shouldDehydrateQuery??t.getDefaultOptions().dehydrate?.shouldDehydrateQuery??ti,n=e.shouldRedactErrors??t.getDefaultOptions().dehydrate?.shouldRedactErrors??tn,a=e.serializeData??t.getDefaultOptions().dehydrate?.serializeData??ts;return{mutations:r,queries:t.getQueryCache().getAll().flatMap(t=>i(t)?[{state:{...t.state,...void 0!==t.state.data&&{data:a(t.state.data)}},queryKey:t.queryKey,queryHash:t.queryHash,..."pending"===t.state.status&&{promise:t.promise?.then(a).catch(t=>n(t)?Promise.reject(Error("redacted")):Promise.reject(t))},...t.meta&&{meta:t.meta}}]:[])}}function tu(t,e,s){if("object"!=typeof e||null===e)return;let r=t.getMutationCache(),i=t.getQueryCache(),n=s?.defaultOptions?.deserializeData??t.getDefaultOptions().hydrate?.deserializeData??ts,a=e.mutations||[],u=e.queries||[];a.forEach(({state:e,...i})=>{r.build(t,{...t.getDefaultOptions().hydrate?.mutations,...s?.defaultOptions?.mutations,...i},e)}),u.forEach(({queryKey:e,state:r,queryHash:a,meta:u,promise:o})=>{let h=i.get(a),c=void 0===r.data?r.data:n(r.data);if(h){if(h.state.dataUpdatedAt<r.dataUpdatedAt){let{fetchStatus:t,...e}=r;h.setState({...e,data:c})}}else h=i.build(t,{...t.getDefaultOptions().hydrate?.queries,...s?.defaultOptions?.queries,queryKey:e,queryHash:a,meta:u},{...r,data:c,fetchStatus:"idle"});if(o){let t=Promise.resolve(o).then(n);h.fetch(void 0,{initialPromise:t})}})}function to({queryFn:t,refetchMode:e}){return async s=>{if("append"!==e){let t=s.client.getQueryCache().find({queryKey:s.queryKey,exact:!0});t&&void 0!==t.state.data&&t.setState({status:"pending",data:void 0,error:null,fetchStatus:"fetching"})}for await(let e of(await t(s))){if(s.signal.aborted)break;s.client.setQueryData(s.queryKey,(t=[])=>t.concat(e))}return s.client.getQueryData(s.queryKey)}}var th=Symbol("dataTagSymbol"),tc=Symbol("dataTagErrorSymbol"),tl=Symbol("unsetMarker"),td=s(54538),tf=s(24246),tp=td.createContext(void 0),ty=t=>{let e=td.useContext(tp);if(t)return t;if(!e)throw Error("No QueryClient set, use QueryClientProvider to set one");return e},tm=({client:t,children:e})=>(td.useEffect(()=>(t.mount(),()=>{t.unmount()}),[t]),(0,tf.jsx)(tp.Provider,{value:t,children:e})),tb=td.createContext(!1),tv=()=>td.useContext(tb),tg=tb.Provider;function tO(){let t=!1;return{clearReset:()=>{t=!1},reset:()=>{t=!0},isReset:()=>t}}var tR=td.createContext(tO()),tC=()=>td.useContext(tR),tQ=({children:t})=>{let[e]=td.useState(()=>tO());return(0,tf.jsx)(tR.Provider,{value:e,children:"function"==typeof t?t(e):t})};function tS(t,e){return"function"==typeof t?t(...e):!!t}function tw(){}var tq=(t,e)=>{(t.suspense||t.throwOnError||t.experimental_prefetchInRender)&&!e.isReset()&&(t.retryOnMount=!1)},tP=t=>{td.useEffect(()=>{t.clearReset()},[t])},tE=({result:t,errorResetBoundary:e,throwOnError:s,query:r,suspense:i})=>t.isError&&!e.isReset()&&!t.isFetching&&r&&(i&&void 0===t.data||tS(s,[t.error,r])),tM=(t,e)=>void 0===e.state.data,tD=t=>{let e=t.staleTime;t.suspense&&(t.staleTime="function"==typeof e?(...t)=>Math.max(e(...t),1e3):Math.max(e??1e3,1e3),"number"==typeof t.gcTime&&(t.gcTime=Math.max(t.gcTime,1e3)))},tF=(t,e)=>t.isLoading&&t.isFetching&&!e,tx=(t,e)=>t?.suspense&&e.isPending,tI=(t,e,s)=>e.fetchOptimistic(t).catch(()=>{s.clearReset()});function tT({queries:t,...e},s){let r=ty(s),i=tv(),n=tC(),a=td.useMemo(()=>t.map(t=>{let e=r.defaultQueryOptions(t);return e._optimisticResults=i?"isRestoring":"optimistic",e}),[t,r,i]);a.forEach(t=>{tD(t),tq(t,n)}),tP(n);let[u]=td.useState(()=>new Z(r,a,e)),[o,h,c]=u.getOptimisticResult(a,e.combine),l=!i&&!1!==e.subscribed;td.useSyncExternalStore(td.useCallback(t=>l?u.subscribe(T.batchCalls(t)):tw,[u,l]),()=>u.getCurrentResult(),()=>u.getCurrentResult()),td.useEffect(()=>{u.setQueries(a,e,{listeners:!1})},[a,e,u]);let d=o.some((t,e)=>tx(a[e],t))?o.flatMap((t,e)=>{let s=a[e];if(s){let e=new W(r,s);if(tx(s,t))return tI(s,e,n);tF(t,i)&&tI(s,e,n)}return[]}):[];if(d.length>0)throw Promise.all(d);let f=o.find((t,e)=>{let s=a[e];return s&&tE({result:t,errorResetBoundary:n,throwOnError:s.throwOnError,query:r.getQueryCache().get(s.queryHash),suspense:s.suspense})});if(f?.error)throw f.error;return h(c())}function tk(t,e,s){let r=ty(s),n=tv(),a=tC(),u=r.defaultQueryOptions(t);r.getDefaultOptions().queries?._experimental_beforeQuery?.(u),u._optimisticResults=n?"isRestoring":"optimistic",tD(u),tq(u,a),tP(a);let o=!r.getQueryCache().get(u.queryHash),[h]=td.useState(()=>new e(r,u)),c=h.getOptimisticResult(u),l=!n&&!1!==t.subscribed;if(td.useSyncExternalStore(td.useCallback(t=>{let e=l?h.subscribe(T.batchCalls(t)):tw;return h.updateResult(),e},[h,l]),()=>h.getCurrentResult(),()=>h.getCurrentResult()),td.useEffect(()=>{h.setOptions(u,{listeners:!1})},[u,h]),tx(u,c))throw tI(u,h,a);if(tE({result:c,errorResetBoundary:a,throwOnError:u.throwOnError,query:r.getQueryCache().get(u.queryHash),suspense:u.suspense}))throw c.error;if(r.getDefaultOptions().queries?._experimental_afterQuery?.(u,c),u.experimental_prefetchInRender&&!i&&tF(c,n)){let t=o?tI(u,h,a):r.getQueryCache().get(u.queryHash)?.promise;t?.catch(tw).finally(()=>{h.updateResult()})}return u.notifyOnChangeProps?c:h.trackResult(c)}function tA(t,e){return tk(t,W,e)}function tU(t,e){return tk({...t,enabled:!0,suspense:!0,throwOnError:tM,placeholderData:void 0},W,e)}function tj(t,e){return tk({...t,enabled:!0,suspense:!0,throwOnError:tM},tt,e)}function tK(t,e){return tT({...t,queries:t.queries.map(t=>({...t,suspense:!0,throwOnError:tM,enabled:!0,placeholderData:void 0}))},e)}function tH(t,e){let s=ty(e);s.getQueryState(t.queryKey)||s.prefetchQuery(t)}function tL(t,e){let s=ty(e);s.getQueryState(t.queryKey)||s.prefetchInfiniteQuery(t)}function t_(t){return t}function tG(t){return t}var tN=(t,e)=>"object"==typeof t&&null!==t&&e in t,tz=({children:t,options:e={},state:s,queryClient:r})=>{let i=ty(r),[n,a]=td.useState(),u=td.useRef(e);return u.current=e,td.useMemo(()=>{if(s){if("object"!=typeof s)return;let t=i.getQueryCache(),e=s.queries||[],r=[],o=[];for(let s of e){let e=t.get(s.queryHash);if(e){let t=s.state.dataUpdatedAt>e.state.dataUpdatedAt||tN(s.promise,"status")&&tN(e.promise,"status")&&s.promise.status!==e.promise.status,r=n?.find(t=>t.queryHash===s.queryHash);t&&(!r||s.state.dataUpdatedAt>r.state.dataUpdatedAt)&&o.push(s)}else r.push(s)}r.length>0&&tu(i,{queries:r},u.current),o.length>0&&a(t=>t?[...t,...o]:o)}},[i,n,s]),td.useEffect(()=>{n&&(tu(i,{queries:n},u.current),a(void 0))},[i,n]),t};function tB(t,e){let s=ty(e),r=s.getQueryCache();return td.useSyncExternalStore(td.useCallback(t=>r.subscribe(T.batchCalls(t)),[r]),()=>s.isFetching(t),()=>s.isFetching(t))}function tW(t,e){let s=ty(e);return tJ({filters:{...t,status:"pending"}},s).length}function t$(t,e){return t.findAll(e.filters).map(t=>e.select?e.select(t):t.state)}function tJ(t={},e){let s=ty(e).getMutationCache(),r=td.useRef(t),i=td.useRef(null);return i.current||(i.current=t$(s,t)),td.useEffect(()=>{r.current=t}),td.useSyncExternalStore(td.useCallback(t=>s.subscribe(()=>{let e=y(i.current,t$(s,r.current));i.current!==e&&(i.current=e,T.schedule(t))}),[s]),()=>i.current,()=>i.current)}function tV(t,e){let s=ty(e),[r]=td.useState(()=>new te(s,t));td.useEffect(()=>{r.setOptions(t)},[r,t]);let i=td.useSyncExternalStore(td.useCallback(t=>r.subscribe(T.batchCalls(t)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),n=td.useCallback((t,e)=>{r.mutate(t,e).catch(tw)},[r]);if(i.error&&tS(r.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:n,mutateAsync:i.mutate}}function tX(t,e){return tk(t,tt,e)}}}]);
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunkTable=self.webpackChunkTable||[]).push([["2641"],{56050:function(){}}]);
@@ -1,23 +0,0 @@
1
- "use strict";(self.webpackChunkTable=self.webpackChunkTable||[]).push([["3079"],{52529:function(e,t,n){let r;n.r(t),n.d(t,{ErrorAlert:()=>tF,JSONEditor:()=>tU,INCREASE_NEARBY_SERIES_MULTIPLIER:()=>nN,OptionsEditorGroup:()=>n7,DensitySelector:()=>tx,assembleTransform:()=>nV,clearHighlightedSeries:()=>nD,getColorsForValues:()=>ly,ErrorBoundary:()=>tR.ErrorBoundary,SeriesMarker:()=>nf,TimeRangeSelector:()=>rT,testChartsTheme:()=>rW,ChartsThemeContext:()=>b,TextOverlay:()=>n8,hexToHSL:()=>lb,DEFAULT_COLUMN_HEIGHT:()=>eM,useMousePosition:()=>nu,NoDataOverlay:()=>n9,generateChartsTheme:()=>rP,OptionsEditorGrid:()=>n3,OPTIMIZED_MODE_SERIES_LIMIT:()=>nS,TOOLTIP_ADJUST_Y_POS_MULTIPLIER:()=>nn,DiscardChangesConfirmationDialog:()=>te,getDateRange:()=>O,EMPHASIZED_SERIES_DESCRIPTION:()=>no,useChartsTheme:()=>j,persesColumnsToTanstackColumns:()=>eI,mockChartsContext:()=>r$,Legend:()=>eJ,TOOLTIP_DATE_FORMAT:()=>ns,TOOLTIP_MAX_WIDTH:()=>t9,dateFormatOptionsWithTimeZone:()=>t0,legacyCheckforNearbySeries:()=>nW,ToolbarIconButton:()=>rM,PIN_TOOLTIP_HELP_TEXT:()=>np,checkforNearbyTimeSeries:()=>nz,getTheme:()=>r4,PieChart:()=>lh,TooltipHeader:()=>nZ,TOOLTIP_BG_COLOR_FALLBACK:()=>na,UNPIN_TOOLTIP_HELP_TEXT:()=>ng,DateTimeRangePicker:()=>rk,handleMoveUp:()=>tT,getClosestTimestamp:()=>nF,getFormattedAxis:()=>P,formatWithTimeZone:()=>t1,batchDispatchNearbySeriesActions:()=>nE,useTimeZone:()=>t4,ChartsProvider:()=>y,isWithinPercentageRange:()=>nB,TOOLTIP_MIN_WIDTH:()=>t8,StatusHistoryChart:()=>lm,TOOLTIP_LABELS_MAX_WIDTH:()=>nt,getYBuffer:()=>n_,DEFAULT_PINNED_CROSSHAIR:()=>nT,LineChartTooltip:()=>nY,FormatControls:()=>rE,TooltipContent:()=>nb,hslToHex:()=>lC,SHOW_FEWER_SERIES_LIMIT:()=>nO,TimeChartTooltip:()=>rm,getClosestTimestampInFullDataset:()=>nR,getTableCellLayout:()=>eD,EChart:()=>F,PINNED_CROSSHAIR_SERIES_NAME:()=>nk,SortSelector:()=>rn,SnackbarProvider:()=>rF.wT,Drawer:()=>tE,AlignSelector:()=>a,LinksEditor:()=>nQ,ValueMappingsEditor:()=>lS,TimeZoneContext:()=>t3,GaugeChart:()=>t$,LineChart:()=>nG,SeriesLabelsStack:()=>nv,checkCrosshairPinnedStatus:()=>nL,StatChart:()=>ro,SeriesInfo:()=>ny,ColorPicker:()=>U,Table:()=>eY,useSnackbar:()=>rR,InfoTooltip:()=>ta,TimeZoneProvider:()=>t7,LoadingOverlay:()=>re,typography:()=>r3,Dialog:()=>e9,DropIndicator:()=>tm,TransformsEditor:()=>ld,OptionsEditorControl:()=>tc,TOOLTIP_PADDING:()=>nr,getFormattedAxisLabel:()=>t2,SortSelectorButtons:()=>rr,getTooltipStyles:()=>nU,useChartsContext:()=>C,RefreshIntervalPicker:()=>lc,enableDataZoom:()=>nA,useDragAndDropMonitor:()=>tj,combineSx:()=>er,OptionsEditorColumn:()=>n6,getDateAndTime:()=>t6,ThresholdsEditor:()=>rg,DEFAULT_TOOLTIP_CONFIG:()=>nh,handleMoveDown:()=>tA,DragButton:()=>tM,useId:()=>tl,ContentWithLegend:()=>e0,BarChart:()=>z,getFormattedDate:()=>t5,NEARBY_SERIES_DESCRIPTION:()=>ni,getColorForValue:()=>lv,isLegendItemVisuallySelected:()=>ea,getPointInGrid:()=>nI,EMPTY_TOOLTIP_DATA:()=>nc,legacyGetNearbySeriesData:()=>nH,buildRelativeTimeOption:()=>rO,SettingsAutocomplete:()=>tp,FontSizeSelector:()=>tP,defaultCursorData:()=>nd,DYNAMIC_NEARBY_SERIES_MULTIPLIER:()=>nP,FALLBACK_COLOR:()=>lf,getNearbySeriesData:()=>n$,TOOLTIP_MAX_HEIGHT:()=>ne,YAxisLabel:()=>rL,TimeChart:()=>rf,FALLBACK_CHART_WIDTH:()=>nl,DragAndDropElement:()=>tw,getResponsiveValueSize:()=>tH,restoreChart:()=>nM,ModeSelector:()=>n5,TextField:()=>e1,DEFAULT_COLUMN_WIDTH:()=>eA,FormActions:()=>tz,OptionsColorPicker:()=>K});var l=n(24246),i=n(10970),o=n(48565);function a({onChange:e,value:t="left",...n}){let r=t=>{e(t)};return(0,l.jsxs)(i.Z,{"aria-label":"Alignement",...n,children:[(0,l.jsx)(o.Z,{onClick:()=>r("left"),variant:"left"===t?"contained":"outlined",children:"Left"},"left"),(0,l.jsx)(o.Z,{onClick:()=>r("center"),variant:"center"===t?"contained":"outlined",children:"Center"},"center"),(0,l.jsx)(o.Z,{onClick:()=>r("right"),variant:"right"===t?"contained":"outlined",children:"Right"},"right")]})}var s=n(54538),d=n.n(s),c=n(3735),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,[i,o]=(0,s.useState)(null),a=(0,s.useMemo)(()=>({chartsTheme:n,enablePinning:r,lastTooltipPinnedCoords:i,setLastTooltipPinnedCoords:o}),[n,r,i,o]);return(0,l.jsx)(b.Provider,{value:a,children:t})}let b=(0,s.createContext)(void 0);function C(){let e=(0,s.useContext)(b);if(void 0===e)throw Error("No ChartsThemeContext found. Did you forget a Provider?");return e}function j(){return C().chartsTheme}var w=n(59161),Z=n(56141),S=n.n(Z),k=n(66726),T=n.n(k),A=n(8890),M=n(35246),D=n(48906),I=n(27806);(0,u.D)([g.N,D.N,I.N,A.N,M.N,p.N,x.N,m.N,f.N]);let E=["click","dblclick","mousedown","mousemove","mouseup","mouseover","mouseout","globalout","contextmenu"],L=["datazoom","downplay","highlight"],F=(0,s.memo)(function({option:e,theme:t,renderer:n,sx:r,style:i,onEvents:o,_instance:a,syncGroup:d,onChartInitialized:c}){let u=(0,s.useRef)(e),h=(0,s.useRef)(e),p=(0,s.useRef)(null),g=(0,s.useRef)(null);return(0,s.useLayoutEffect)(()=>{if(null!==p.current&&null===g.current&&(g.current=(0,w.S1)(p.current,t,{renderer:n??"canvas"}),void 0!==g.current))return g.current.setOption(u.current,!0),c?.(g.current),void 0!==a&&(a.current=g.current),()=>{null!==g.current&&(g.current.dispose(),g.current=null)}},[a,c,t,n]),(0,s.useEffect)(()=>{g.current&&d&&(g.current.group=d,(0,w.$j)([g.current]))},[d,g]),(0,s.useEffect)(()=>{!(void 0===h.current||S()(h.current,e))&&g.current&&(g.current.setOption(e,!0),h.current=e)},[e]),(0,s.useLayoutEffect)(()=>{let e=T()(()=>{g.current&&g.current.resize()},200);return window.addEventListener("resize",e),e(),()=>{window.removeEventListener("resize",e)}},[]),(0,s.useEffect)(()=>{let e=g.current;if(e&&void 0!==o)return function(e,t){if(void 0!==t){for(let n in t)if(Object.prototype.hasOwnProperty.call(t,n)){let r=t[n]??null;r&&function(t,n){var r,l;"function"==typeof n&&((r=t,E.includes(r))?e.on(t,t=>n(t,e)):(l=t,L.includes(l))?e.on(t,e=>n(e)):e.on(t,()=>n(null,e)))}(n,r)}}}(e,o),()=>{if(void 0!==e&&!0!==e.isDisposed())for(let t in o)e.off(t)}},[o]),(0,s.useEffect)(()=>{T()(()=>{g.current&&g.current.resize()},200,{leading:!0})()},[r,i]),(0,l.jsx)(v.Z,{ref:p,sx:r,style:i})});var R=n(15409),N=n.n(R);function P(e,t){return[N()({type:"value",boundaryGap:[0,"10%"],axisLabel:{formatter:e=>(0,c.formatValue)(e,t)}},e)]}function O(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 z(e){let{width:t,height:n,data:r,format:i={unit:"decimal"},mode:o="value"}=e,a=j(),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:P({},i),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:i.decimalPlaces}):(0,c.formatValue)(e.data[1],i):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> &emsp; ${(0,c.formatValue)(e.data[1],i)}`},grid:{left:"5%",right:"5%"}}},[r,a,t,o,i]);return(0,l.jsx)(v.Z,{style:{width:t,height:n},sx:{overflow:"auto"},children:(0,l.jsx)(F,{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 W=n(25283),$=n(75094),H=n(8695),B=n(53094),_=n(20791),V=n(80354);let U=({color:e,onChange:t,onClear:n,palette:r})=>{let[i,o]=(0,s.useState)(e),a=e=>{o(e),t?.(e)};return(0,l.jsxs)(W.Z,{spacing:1,children:[(0,l.jsx)(B.gW,{color:e,onChange:a,style:{width:"100%"}}),(0,l.jsx)(W.Z,{direction:"row",flexWrap:"wrap",justifyContent:"space-evenly",width:"200px",children:r&&r.map((e,t)=>(0,l.jsx)($.Z,{size:"small","aria-label":`change color to ${e}`,sx:{color:e},onClick:()=>a(e),children:(0,l.jsx)(_.default,{})},t))}),(0,l.jsxs)(W.Z,{direction:"row",gap:1,alignItems:"center",children:[(0,l.jsx)(H.Z,{inputProps:{"aria-label":"enter hex color"},fullWidth:!0,value:i,onChange:e=>{let n=e.target.value.replace(/([^0-9A-F]+)/gi,"").substring(0,8);o(`#${n}`),Y(e.target.value)&&t?.(e.target.value)}}),n&&(0,l.jsx)($.Z,{onClick:n,children:(0,l.jsx)(V.default,{})})]})]})},Y=(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 G=n(6714),X=n(12709);function K({label:e,color:t,onColorChange:n,onClear:r}){let[i,o]=(0,s.useState)(null),a=!!i,{thresholds:{defaultColor:d,palette:c}}=j();return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(q,{size:"small","aria-label":`change ${e} color`,isSelected:a,iconColor:t,onClick:e=>{o(e.currentTarget)},children:(0,l.jsx)(_.default,{})}),(0,l.jsx)(G.ZP,{"data-testid":"options color picker",open:a,anchorEl:i,onClose:()=>{o(null)},slotProps:{paper:{sx:{padding:e=>e.spacing(2)}}},anchorOrigin:{vertical:"top",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"right"},children:(0,l.jsx)(U,{color:t,palette:[d,...c],onChange:n,onClear:r})})]})}let q=(0,X.ZP)($.Z,{shouldForwardProp:e=>"isSelected"!==e&&"iconColor"!==e})(({iconColor:e,isSelected:t})=>({backgroundColor:t&&e?`${e}3F`:"undefined",color:e}));var J=n(94776),Q=n(75586),ee=n(83675),et=n(73845),en=n(12577);function er(...e){return e.flatMap(e=>void 0===e?[]:Array.isArray(e)?e:[e])}let el=(0,s.memo)(function({color:e,sx:t,...n}){return(0,l.jsx)(v.Z,{...n,sx:er({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:i,onMouseOver:o,onMouseOut:a,index:d,...c},u){let[h,p]=(0,s.useState)(n);return(0,l.jsxs)(et.Z,{...c,role:"listitem",sx:er({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:i,ref:u,children:[(0,l.jsx)(v.Z,{sx:{display:"flex",alignItems:"center"},children:(0,l.jsx)(el,{color:e.color})}),(0,l.jsx)(en.Z,{primary:e.label,primaryTypographyProps:{noWrap:h},onMouseOver:function(){n&&p(!1)},onMouseOut:function(){n&&p(!0)}})]})}),eo=(0,s.memo)(ei);function ea(e,t){return"ALL"!==t&&!!t[e.id]}function es({items:e,height:t,width:n,selectedItems:r,onLegendItemClick:i,onItemMouseOver:o,onItemMouseOut:a}){let s=e.length>5;return(0,l.jsx)(ee.OO,{style:{height:t,width:n},data:e,itemContent:(e,t)=>(0,l.jsx)(eo,{item:t,index:e,truncateLabel:s,isVisuallySelected:ea(t,r),onClick:i,onMouseOver:o,onMouseOut:a,sx:{width:"100%",wordBreak:"break-word",overflow:"hidden"}},t.id),role:"list"})}function ed({height:e,items:t,selectedItems:n,onLegendItemClick:r,onItemMouseOver:i,onItemMouseOut:o}){return(0,l.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,l.jsx)(eo,{item:e,index:t,isVisuallySelected:ea(e,n),onMouseOver:i,onMouseOut:o,onClick:r,sx:{width:"auto",float:"left",paddingRight:1.5}},e.id))})}var ec=n(22577),eu=n(80900),eh=n(14968),ep=n(42158),eg=n(16838);let ex=(0,s.forwardRef)(function(e,t){return(0,l.jsx)(eh.Z,{...e,ref:t,sx:{backgroundColor:e=>e.palette.background.default,"&:hover":{backgroundColor:e=>(0,eg.Fq)(e.palette.primary.main,e.palette.action.hoverOpacity)}}})});var em=n(56174);let ef=(0,s.forwardRef)(function(e,t){return(0,l.jsx)(em.Z,{...e,ref:t})});var ev=n(90190);let ey=(0,X.ZP)(ev.Z)(({theme:e})=>({tableLayout:"fixed",borderCollapse:"separate",backgroundColor:e.palette.background.default})),eb={compact:"small",standard:"medium",comfortable:"medium"},eC=(0,s.forwardRef)(function({density:e,...t},n){return(0,l.jsx)(ey,{...t,tabIndex:-1,size:eb[e],ref:n,sx:{width:"100%"}})});var ej=n(31889);let ew=(0,s.forwardRef)(function(e,t){return(0,l.jsx)(ej.Z,{...e,ref:t})});var eZ=n(52054),eS=n(78214),ek=n(23147),eT=n(96205);let eA=150,eM=40;function eD(e,t,{isHeader:n,isLastColumn:r,isFirstColumn:l,defaultColumnHeight:i}={}){var o,a;let s=e.spacing(1),d=e.spacing(1.25),c=e.spacing(2),u=l?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=l?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=l?c:d,h=r?c:d,p=e.typography.body1.lineHeight,g=e.typography.body1.fontSize);let x=n||!i||"auto"===i?(o=p,a=s,("string"==typeof o?parseInt(o,10):o??0)+2*("string"==typeof a?parseInt(a,10):a)):i;return{padding:`${s} ${h} ${s} ${u}`,height:x,fontSize:g,lineHeight:p}}function eI(e){return e.map(({width:e,align:t,headerDescription:n,cellDescription:r,enableSorting:l,...i})=>({...i,..."auto"===e||void 0===e?{size:0,minSize:0,maxSize:0}:{size:e},enableSorting:!!l,meta:{align:t,headerDescription:n,cellDescription:r}}))}let eE=(0,X.ZP)(eT.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 eL({children:e,density:t,variant:n,width:r,defaultColumnHeight:i,focusState:o="none",onFocusTrigger:a,isFirstColumn:d,isLastColumn:c,description:u,align:h,color:p,backgroundColor:g,...x}){let m=(0,J.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,l.jsx)(eE,{...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,l.jsx)(v.Z,{id:"original-cell",sx:{...eD(m,t,{isHeader:y,isLastColumn:c,isFirstColumn:d,defaultColumnHeight:i}),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 eF({onSort:e,sortDirection:t,nextSortDirection:n,children:r,...i}){let o=!!e,a=(0,l.jsx)(eZ.Z,{noWrap:!0,variant:"inherit",component:"div",color:"inherit",children:r}),s=!!t;return(0,l.jsx)(eL,{...i,children:o?(0,l.jsx)(eS.Z,{onClick:e,direction:s?t:n,active:s,sx:{verticalAlign:"unset",maxWidth:"100%","&:focus-visible":{[`& .${ek.Z.icon}`]:{opacity:s?1:.5}}},children:a}):a})}var eR=n(59019);let eN=(0,s.forwardRef)(function(e,t){return(0,l.jsx)(eR.Z,{...e,tabIndex:-1,ref:t})}),eP={row:0,column:0},eO=["ArrowRight","ArrowLeft","ArrowUp","ArrowDown"];var ez=n(25329);let eW=(0,s.forwardRef)(function(e,t){return(0,l.jsx)(ez.Z,{...e,ref:t})});function e$({width:e,height:t,density:n,defaultColumnWidth:r,defaultColumnHeight:i,onRowClick:o,onRowMouseOver:a,onRowMouseOut:d,rows:c,columns:u,headers:h,cellConfigs:p,pagination:g,onPaginationChange:x,rowCount:m}){let f=(0,s.useRef)(null),y=(0,s.useRef)({startIndex:0,endIndex:0}),b=function({visibleRange:e,virtualTable:t,maxRows:n,maxColumns:r}){return function({maxRows:e,maxColumns:t,onActiveCellChange:n}){let[r,l]=(0,s.useState)(eP),[i,o]=(0,s.useState)(!1);return{activeCell:r,isActive:i,onTableKeyDown:(0,s.useCallback)(r=>{let i=r.key;(eO.includes(i)||"Home"===i||"End"===i||"PageDown"===i||"PageUp"===i)&&l(l=>{let o=l.row,a=l.column;"ArrowRight"===i&&a<t-1?(r.preventDefault(),a+=1):"ArrowLeft"===i&&a>0?(r.preventDefault(),a-=1):"ArrowDown"===i&&o<e-1?(r.preventDefault(),o+=1):"ArrowUp"===i&&o>0?(r.preventDefault(),o-=1):"Home"===i?(r.preventDefault(),o=0,a=0):"End"===i&&(r.preventDefault(),o=e-1,a=t-1);let s={column:a,row:o},d=n?.(r,l,s)||s;return d.row===l.row&&d.column===l.column?l:d})},[t,e,n]),onCellFocus:e=>{(e.column!==r.column||e.row!==r.row||!i)&&(o(!0),l(e))}}}({maxRows:n,maxColumns:r,onActiveCellChange:(r,l,i)=>{let o=r.key,a=i&&(l.column!==i.column||l.row!==i.row),s=i?.row??l.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 i=l.row;return i=Math.min(n-1,e.current.endIndex+1),t.current?.scrollToIndex({index:i-1,align:"start"}),{row:i,column:l.column}}else if("PageUp"===o){let n=l.row;return n=Math.max(0,e.current.startIndex-1),t.current?.scrollToIndex({index:n-1,align:"end"}),{row:n,column:l.column}}return i}})}({visibleRange:y,virtualTable:f,maxRows:c.length+1,maxColumns:u.length}),C=e=>e.row===b.activeCell.row&&e.column===b.activeCell.column?b.isActive?"trigger-focus":"focus-next":"none",j=(0,s.useMemo)(()=>({Scroller:eN,Table:t=>(0,l.jsx)(eC,{...t,width:e,density:n,onKeyDown:b.onTableKeyDown}),TableHead:ew,TableFoot:eW,TableRow:({item:e,...t})=>{let r=c[t["data-index"]];if(!r)return null;let i={id:r.id,index:r.index};return(0,l.jsx)(ex,{...t,onClick:e=>o(e,r.id),density:n,onMouseOver:e=>{a?.(e,i)},onMouseOut:e=>{d?.(e,i)}})},TableBody:ef}),[n,b.onTableKeyDown,o,d,a,c,e]),w=(e,t)=>{g&&x&&x({...g,pageIndex:t})},Z=e=>{g&&x&&x({pageIndex:0,pageSize:parseInt(e.target.value,10)})};return(0,l.jsx)(v.Z,{style:{width:e,height:t},children:(0,l.jsx)(ee._n,{ref:f,totalCount:c.length,components:j,rangeChanged:e=>{y.current=e},fixedHeaderContent:()=>(0,l.jsx)(l.Fragment,{children:h.map(e=>(0,l.jsx)(ex,{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,l.jsx)(eF,{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:i,align:a.columnDef.meta?.align,variant:"head",density:n,description:a.columnDef.meta?.headerDescription,focusState:C(s),onFocusTrigger:()=>b.onCellFocus(s),isFirstColumn:0===t,isLastColumn:t===o.length-1,children:(0,ec.ie)(a.columnDef.header,e.getContext())},e.id)})},e.id))}),fixedFooterContent:g?()=>(0,l.jsx)(eh.Z,{sx:{backgroundColor:e=>e.palette.background.default},children:(0,l.jsx)(ep.Z,{colSpan:u.length,count:m,page:g.pageIndex,rowsPerPage:g.pageSize,onPageChange:w,onRowsPerPageChange:Z})}):void 0,itemContent:e=>{let t=c[e];return t?(0,l.jsx)(l.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,l.jsx)(eL,{"data-testid":t.id,title:s||u?.text||g,width:t.column.getSize()||r,defaultColumnHeight:i,align:t.column.columnDef.meta?.align,density:n,focusState:C(d),onFocusTrigger:()=>b.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 eH=n(82707);function eB({color:e,density:t,...n}){let r="compact"===t;return(0,l.jsx)(eH.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,eg.Fq)(e,.5):void 0},"& .MuiSvgIcon-root":{fontSize:r?16:18}}})}let e_=(e,t)=>`${t}`,eV={},eU=[];function eY({data:e,columns:t,cellConfigs:n,density:r="standard",defaultColumnWidth:i=eA,defaultColumnHeight:o="auto",checkboxSelection:a,onRowSelectionChange:d,onSortingChange:c,getCheckboxColor:u,getRowId:h=e_,rowSelection:p=eV,sorting:g=eU,pagination:x,onPaginationChange:m,rowSelectionVariant:f="standard",...v}){let y=(0,J.Z)(),b=(0,s.useCallback)((e,t,n)=>{"standard"===f||n?t.toggleSelected():t.getIsSelected()&&!e.getIsAllRowsSelected()?e.toggleAllRowsSelected():d?.({[t.id]:!0})},[d,f]),C=(0,s.useCallback)((e,t,n)=>{let r=e.nativeEvent&&(e.nativeEvent instanceof MouseEvent||e.nativeEvent instanceof KeyboardEvent)?e.nativeEvent:void 0;b(t,n,!!r?.metaKey||!!r?.shiftKey)},[b]),j=(0,s.useMemo)(()=>({id:"checkboxRowSelect",size:28,header:({table:e})=>(0,l.jsx)(eB,{checked:e.getIsAllRowsSelected(),indeterminate:e.getIsSomeRowsSelected(),onChange:e.getToggleAllRowsSelectedHandler(),color:y.palette.text.primary,density:r}),cell:({row:e,table:t})=>(0,l.jsx)(eB,{checked:e.getIsSelected(),indeterminate:e.getIsSomeSelected(),onChange:n=>{C(n,t,e)},color:u?.(e.original),density:r}),enableSorting:!1}),[y.palette.text.primary,r,u,C]),w=(0,s.useMemo)(()=>{let e=eI(t);return a&&e.unshift(j),e},[j,a,t]),Z=(0,ec.b7)({data:e,columns:w,getRowId:h,getCoreRowModel:(0,eu.sC)(),getSortedRowModel:(0,eu.tj)(),getPaginationRowModel:x?(0,eu.G_)():void 0,manualPagination:!x,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,...x?{pagination:x}:{}}}),S=(0,s.useCallback)((e,t)=>{let n=Z.getRow(t);b(Z,n,e.metaKey||e.shiftKey)},[b,Z]);return(0,l.jsx)(e$,{...v,density:r,defaultColumnWidth:i,defaultColumnHeight:o,onRowClick:S,rows:Z.getRowModel().rows,columns:Z.getAllFlatColumns(),headers:Z.getHeaderGroups(),cellConfigs:n,pagination:x,onPaginationChange:m,rowCount:Z.getRowCount()})}let eG=[{accessorKey:"label",header:"Name",enableSorting:!0,cell:({getValue:e})=>(0,l.jsx)("span",{title:e(),children:e()})}],eX=e=>e.id,eK=e=>e.color;function eq({items:e,selectedItems:t,onSelectedItemsChange:n,onItemMouseOver:r,onItemMouseOut:i,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[eX(t,n)]=!0,e),{}),[t,e]),p=(0,s.useMemo)(()=>[...eG,...d],[d]);return(0,l.jsx)(eY,{height:o,width:a,rowSelection:h,onRowSelectionChange:n,onRowMouseOver:r,onRowMouseOut:i,sorting:c,onSortingChange:u,data:e,columns:p,density:"compact",defaultColumnWidth:"auto",getRowId:eX,getCheckboxColor:eK,checkboxSelection:!0,rowSelectionVariant:"legend"})}function eJ({width:e,height:t,options:n,data:r,selectedItems:i,onSelectedItemsChange:o,onItemMouseOver:a,onItemMouseOut:s,tableProps:d}){let u;let h=(e,t)=>{let n=e.metaKey||e.shiftKey;o((0,Q.Uy)(i,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:i,onLegendItemClick:h,onItemMouseOver:a,onItemMouseOut:s};return(u="table"===p?(0,l.jsx)(eq,{...x,onSelectedItemsChange:o,width:e,...d}):"right"===n.position||g?(0,l.jsx)(es,{...x,width:e,onLegendItemClick:h}):(0,l.jsx)(ed,{...x,onLegendItemClick:h}),"right"===n.position)?(0,l.jsx)(v.Z,{style:{width:e,height:t},sx:{position:"absolute",top:0,right:0},children:u}):(0,l.jsx)(v.Z,{style:{width:e,height:t},sx:{position:"absolute",bottom:0},children:u})}let eQ={medium:{bottom:6,right:250},small:{bottom:4,right:150}};function e0({children:e,legendProps:t,width:n,height:r,spacing:i=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:l,minChildrenWidth:i,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 l=eD(a,"compact"),i=(n?.tableProps?.columns||[]).reduce((e,t)=>("number"==typeof t.width&&(e+=t.width),e),0);s="right"===p?eQ[r].right+i:e;let o=Math.min(eQ[r].bottom,n.data.length+1);d="bottom"===p?o*l.height:t}let g="right"===p?e-s-o:e,x="bottom"===p?t-d-o:t;return"right"===p&&g<i||"bottom"===p&&x<l?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:i,theme:(0,J.Z)(),legendSize:(0,c.getLegendSize)(o)});return(0,l.jsxs)(v.Z,{style:{width:n,height:r},sx:{position:"relative",overflow:"hidden"},children:[(0,l.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,l.jsx)(eJ,{...t,height:u.height,width:u.width})]})}let e1=(0,s.forwardRef)(function({debounceMs:e=250,value:t,onChange:n,...r},i){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,l.jsx)(H.Z,{ref:i,value:o,onChange:function(e){a(e.target.value),c(e.target.value)},...r})});e1.displayName="TextField";var e5=n(51602),e2=n(19978),e6=n(56873),e3=n(70616),e7=n(10763);let e4=(0,X.ZP)("form")({overflowY:"auto",display:"flex",flexDirection:"column"}),e8=e=>({position:"absolute",top:e.spacing(.5),right:e.spacing(.5)}),e9=({children:e,...t})=>(0,l.jsx)(e6.Z,{...t,children:e});e9.Header=({children:e,onClose:t,...n})=>(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(e5.Z,{style:{textOverflow:"ellipsis",overflow:"hidden"},...n,children:e}),t&&(0,l.jsx)($.Z,{"aria-label":"Close",onClick:t,sx:e8,children:(0,l.jsx)(e7.default,{})})]}),e9.Form=e4,e9.Content=({children:e,sx:t,...n})=>(0,l.jsx)(e2.Z,{dividers:!0,...n,sx:er({minWidth:"500px",textWrap:"balance"},t),children:e}),e9.PrimaryButton=({children:e,...t})=>(0,l.jsx)(o.Z,{variant:"contained",type:"submit",...t,children:e}),e9.SecondaryButton=({children:e,...t})=>(0,l.jsx)(o.Z,{variant:"outlined",color:"secondary",...t,children:e}),e9.Actions=e3.Z;let te=e=>{let{description:t,isOpen:n,onCancel:r,onDiscardChanges:i}=e;return(0,l.jsxs)(e9,{open:n,"aria-labelledby":"discard-dialog",children:[(0,l.jsx)(e9.Header,{children:"Discard Changes"}),(0,l.jsx)(e9.Content,{children:t}),(0,l.jsxs)(e9.Actions,{children:[(0,l.jsx)(o.Z,{variant:"contained",onClick:i,children:"Discard Changes"}),(0,l.jsx)(o.Z,{variant:"outlined",color:"secondary",onClick:r,children:"Cancel"})]})]})};var tt=n(90192),tn=n(23626),tr=n(39398);function tl(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 ti=n(32964),to=n(87143);let ta=({id:e,title:t,description:n,placement:r,children:i,enterDelay:o,enterNextDelay:a})=>{let s=(0,l.jsx)("span",{children:i});return(0,l.jsx)(td,{arrow:!0,id:e,placement:r??"top",title:(0,l.jsx)(ts,{title:t,description:n}),enterDelay:o??500,enterNextDelay:a??500,children:s})},ts=({title:e,description:t})=>(0,l.jsxs)(l.Fragment,{children:[e&&(0,l.jsx)(eZ.Z,{variant:"body2",sx:e=>({color:e.palette.text.primary,fontWeight:e.typography.fontWeightMedium}),children:e}),(0,l.jsx)(eZ.Z,{variant:"caption",sx:e=>({color:e.palette.text.primary,whiteSpace:"pre-line"}),children:t})]}),td=(0,X.ZP)(({className:e,...t})=>(0,l.jsx)(ti.Z,{...t,classes:{popper:e}}))(({theme:e})=>({[`& .${to.Z.tooltip}`]:{backgroundColor:e.palette.background.tooltip,color:e.palette.text.primary,maxWidth:"300px",padding:e.spacing(1),boxShadow:e.shadows[1]},[`& .${to.Z.arrow}`]:{color:e.palette.background.tooltip}})),tc=({label:e,control:t,description:n})=>{let r=tl("EditorSectionControl"),i=`${r}-control`;return(0,l.jsx)(tt.Z,{children:(0,l.jsxs)(W.Z,{direction:"row",alignItems:"center",justifyContent:"space-between",children:[(0,l.jsxs)(W.Z,{direction:"row",alignItems:"center",justifyContent:"center",children:[(0,l.jsx)(tn.Z,{htmlFor:i,children:e}),n&&(0,l.jsx)(ta,{description:n,enterDelay:100,children:(0,l.jsx)($.Z,{size:"small",sx:e=>({borderRadius:e.shape.borderRadius,padding:"4x",margin:"0 2px"}),children:(0,l.jsx)(tr.default,{"aria-describedby":"info-tooltip","aria-hidden":!1,fontSize:"inherit",sx:{color:e=>e.palette.grey[700]}})})})]}),(0,l.jsxs)(v.Z,{sx:{width:"180px",textAlign:"right"},children:[" ",d().cloneElement(t,{id:i})]})]})})};var tu=n(11774),th=n(57174);function tp({options:e,renderInput:t=e=>(0,l.jsx)(H.Z,{...e}),...n}){let r=e=>e.label??e.id;return(0,l.jsx)(tu.Z,{isOptionEqualToValue:(e,t)=>e.id===t.id,getOptionDisabled:e=>!!e.disabled,getOptionLabel:r,options:e,renderInput:t,renderOption:({key:e,...t},n)=>(0,l.jsx)("li",{...t,children:(0,l.jsxs)("div",{children:[(0,l.jsx)(eZ.Z,{variant:"body1",component:"div",children:r(n)}),n.description&&(0,l.jsx)(eZ.Z,{variant:"body2",component:"div",sx:{color:e=>e.palette.text.secondary},children:n.description})]})},e),filterOptions:(0,th.D)({stringify:e=>`${r(e)} ${e.description||""}`}),...n})}let tg=[{id:"compact",label:"Compact"},{id:"standard",label:"Standard"},{id:"comfortable",label:"Comfortable"}];function tx({onChange:e,value:t="standard"}){return(0,l.jsx)(tc,{label:"Density",control:(0,l.jsx)(tp,{value:tg.find(e=>e.id===t),options:tg,getOptionLabel:e=>e.label,onChange:(t,{id:n})=>{e(n)},disableClearable:!0})})}function tm(){return(0,l.jsxs)(W.Z,{direction:"row",alignItems:"center",children:[(0,l.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,l.jsx)(v.Z,{sx:{content:'""',height:2,background:e=>e.palette.info.main,width:"100%"}})]})}var tf=n(39020),tv=n(55255),ty=n(62422),tb=n(74183);let tC={type:"idle"};function tj({elements:e,accessKey:t,axis:n="vertical",onChange:r}){return(0,s.useEffect)(()=>(0,tv.sd)({onDrop({location:l,source:i}){let o=l.current.dropTargets[0];if(!o)return;let a=i.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,tb.A)(s);r((0,tf.h)({list:e,startIndex:d,indexOfTarget:c,closestEdgeOfTarget:u,axis:n}))}}),[t,n,e,r])}function tw({children:e,data:t}){let n=(0,s.useRef)(null),[r,i]=(0,s.useState)(tC);return(0,s.useEffect)(()=>{let e=n.current;if(e)return(0,ty.$)((0,tv.En)({element:e,getInitialData:()=>t,onDragStart(){i({type:"is-dragging"})},onDrop(){i(tC)}}),(0,tv.wO)({element:e,canDrop:({source:t})=>t.element!==e,getData:({input:n})=>(0,tb.X)(t,{element:e,input:n,allowedEdges:["top","bottom"]}),getIsSticky:()=>!0,onDragEnter({self:e}){i({type:"is-dragging-over",closestEdge:(0,tb.A)(e.data)})},onDrag({self:e}){let t=(0,tb.A)(e.data);i(e=>"is-dragging-over"===e.type&&e.closestEdge===t?e:{type:"is-dragging-over",closestEdge:t})},onDragLeave(){i(tC)},onDrop(){i(tC)}}))},[t]),(0,l.jsxs)(W.Z,{ref:n,spacing:1,style:{opacity:"is-dragging"===r.type?.5:"unset"},children:["is-dragging-over"===r.type&&"top"===r.closestEdge?(0,l.jsx)(tm,{}):null,e,"is-dragging-over"===r.type&&"bottom"===r.closestEdge?(0,l.jsx)(tm,{}):null]})}var tZ=n(5549),tS=n(10517),tk=n(11682);function tT(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 tA(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 tM=(0,s.forwardRef)(function({onMoveUp:e,onMoveDown:t,onMoveLeft:n,onMoveRight:r,menuSx:i,...o},a){let[d,c]=(0,s.useState)(null),u=!!d;function h(e){c(null),e?.()}return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)($.Z,{...o,ref:a,"aria-label":"move","aria-haspopup":!0,"aria-expanded":u,size:"small",onClick:function(e){c(e.currentTarget)},children:(0,l.jsx)(tk.default,{})}),(e||t||n||r)&&(0,l.jsxs)(tZ.Z,{id:"drag-button-menu",MenuListProps:{"aria-labelledby":"drag-button-menu"},anchorEl:d,open:u,onClose:()=>h(void 0),sx:i,children:[e&&(0,l.jsx)(tS.Z,{onClick:()=>h(e),children:"Move Up"}),t&&(0,l.jsx)(tS.Z,{onClick:()=>h(t),children:"Move Down"}),n&&(0,l.jsx)(tS.Z,{onClick:()=>h(n),children:"Move Left"}),r&&(0,l.jsx)(tS.Z,{onClick:()=>h(r),children:"Move Right"}),r&&(0,l.jsx)(tS.Z,{onClick:()=>h(r),children:"Move Right"})]})]})});var tD=n(76439),tI=n(73957);let tE=({anchor:e="right",isOpen:t,onClose:n,PaperProps:r,children:i,...o})=>{let a=(0,tD.Z)("(max-width:1080px)");return(0,l.jsx)(tI.ZP,{...o,open:t,onClose:n,anchor:e,PaperProps:{...r,sx:er({width:a?"100%":"1080px",overflow:"hidden"},r?.sx)},children:i})};var tL=n(315);function tF(e){let{error:t}=e;return(0,l.jsx)(tL.Z,{severity:"error",children:t.message})}var tR=n(68715);let tN=[{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 tP({value:e,onChange:t}){return(0,l.jsx)(tc,{label:"Font Size",control:(0,l.jsx)(tp,{value:tN.find(t=>t.value===e),options:tN,getOptionLabel:e=>e.label,onChange:(e,{value:n})=>{t(n)},disableClearable:!0})})}var tO=n(79119);function tz({action:e,submitText:t="Save",cancelText:n="Cancel",isReadonly:r,isValid:i,onActionChange:a,onSubmit:s,onDelete:d,onCancel:c,...u}){return(0,l.jsx)(W.Z,{direction:"row",gap:1,sx:{marginLeft:"auto"},...u,children:"read"===e?(0,l.jsxs)(l.Fragment,{children:[a&&(0,l.jsx)(o.Z,{disabled:r,variant:"contained",onClick:()=>a("update"),children:"Edit"}),d&&(0,l.jsx)(o.Z,{color:"error",disabled:r,variant:"outlined",onClick:d,children:"Delete"}),c&&(s||d)&&(0,l.jsx)(tO.Z,{orientation:"vertical",flexItem:!0,sx:{borderColor:e=>e.palette.grey["500"],"&.MuiDivider-root":{marginLeft:2,marginRight:1}}}),c&&(0,l.jsx)(o.Z,{color:"secondary",variant:"outlined",onClick:c,children:n})]}):(0,l.jsxs)(l.Fragment,{children:[s&&(0,l.jsx)(o.Z,{variant:"contained",disabled:!i,onClick:s,children:t}),c&&(0,l.jsx)(o.Z,{color:"secondary",variant:"outlined",onClick:c,children:n})]})})}var tW=n(78846);function t$(e){let{width:t,height:n,data:r,format:i,axisLine:o,max:a}=e,s=j(),d=(0,c.useDeepMemo)(()=>{if(void 0===r.value)return s.noDataOption;let e=tH(r.value,i,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,i)},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,i,o,a]);return(0,l.jsx)(F,{sx:{width:t,height:n,padding:`${s.container.padding.default}px`},option:d,theme:s.echartsTheme})}function tH(e,t,n,r){let l=Math.min(n,r)/(("number"==typeof e?(0,c.formatValue)(e,t):`${e}`).length??2)*.7;return`clamp(3px, ${l}px, 24px)`}(0,u.D)([tW.N,p.N,x.N,m.N,f.N]);var tB=n(97313),t_=n(10225),tV=n(68799);function tU(e){let t=(0,J.Z)(),n="dark"===t.palette.mode,[r,i]=(0,s.useState)(()=>JSON.stringify(e.value,null,2)),[o,a]=(0,s.useState)(r);return(0,l.jsx)(tB.ZP,{...e,style:{border:`1px solid ${t.palette.divider}`},theme:n?"dark":"light",extensions:[(0,t_.AV)(),(0,tV.ir)((0,t_.ap)()),(0,tV.Q2)()],value:r,onChange:t=>{i(t),e.onChange&&e.onChange(t)},onBlur:()=>{o!==r&&void 0!==e.onChange&&(e.onChange(r),a(r))},placeholder:e.placeholder})}var tY=n(44811),tG=n(98857),tX=n(219),tK=n(17846),tq=n(55328),tJ=n(4665),tQ=n(20461);function t0(e,t){if(t){let n=t.toLowerCase();if("local"!==n&&"browser"!==n)return{...e,timeZone:"utc"===n?"UTC":t}}return e}function t1(e,t,n){let r=n?.toLowerCase();return n&&"local"!==r&&"browser"!==r?(0,tJ.formatInTimeZone)(e,"utc"===r?"UTC":n,t):(0,tQ.format)(e,t)}function t5(e,t,n){let r=t0({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 t2(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 t6=e=>{if(!e)return{formattedDate:"",formattedTime:""};let t=new Date(e);return{formattedDate:(0,tQ.format)(t,"MMM dd, yyyy - "),formattedTime:(0,tQ.format)(t,"HH:mm:ss")}},t3=(0,s.createContext)(void 0);function t7(e){let{children:t,timeZone:n}=e;return(0,l.jsx)(t3.Provider,{value:n,children:t})}function t4(){let e=(0,s.useContext)(t3);return{timeZone:e??"local",formatWithUserTimeZone:(t,n)=>t1(t,n,e),dateFormatOptionsWithUserTimeZone:t=>t0(t,e)}}let t8=375,t9=650,ne=650,nt=500,nn=.75,nr=8,nl=750,ni="nearby series showing in tooltip",no="emphasized series showing as bold in tooltip",na="#2E313E",ns=new Intl.DateTimeFormat(void 0,{year:"numeric",month:"short",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric",hour12:!0}),nd={coords:{plotCanvas:{x:0,y:0},zrender:{x:0,y:0},target:null},chartWidth:0},nc=[],nu=()=>{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??e.offsetX,y:e.zrY??e.offsetY},target:e.target});return window.addEventListener("mousemove",e),()=>{window.removeEventListener("mousemove",e)}},[]),e},nh={wrapLabels:!0,enablePinning:!0},np="Click chart to pin",ng="Click chart to unpin";var nx=n(7444),nm=n(75276);function nf(e){let{markerColor:t,sx:n}=e;return(0,l.jsx)(v.Z,{sx:er({display:"inline-block",width:"11px",height:"11px",borderRadius:"2px",marginRight:1,verticalAlign:"top"},n),style:{backgroundColor:t}})}function nv(e){let{formattedY:t,markerColor:n,metricName:r,metricLabels:i}=e;return(0,l.jsxs)(W.Z,{spacing:.5,children:[(0,l.jsxs)(v.Z,{sx:e=>({display:"flex",height:"16px",flexDirection:"row",alignItems:"center",justifyContent:"left",color:e.palette.common.white,fontSize:"11px"}),children:[(0,l.jsx)(nf,{markerColor:n,sx:{marginTop:.25}}),(0,l.jsxs)(v.Z,{component:"span",children:[r,(0,l.jsx)(v.Z,{component:"span",sx:e=>({color:e.palette.common.white,fontWeight:700,paddingLeft:"2px"}),children:t})]})]}),(0,l.jsx)(tO.Z,{sx:e=>({borderColor:e.palette.grey["500"]})}),(0,l.jsx)(v.Z,{sx:e=>({color:e.palette.common.white}),children:i.map(e=>{if(e){let[t,n]=e.split("="),r=void 0!==n?`${t}: `:t,i=void 0!==n?n.replace(/(^"|"$)/g,""):n;return(0,l.jsxs)(v.Z,{sx:{display:"flex",gap:"4px"},children:[(0,l.jsx)(eZ.Z,{sx:{fontSize:"11px"},children:r}),(0,l.jsx)(eZ.Z,{sx:e=>({color:e.palette.common.white,fontWeight:700,fontSize:"11px"}),children:i})]},e)}})})]})}function ny(e){let{seriesName:t,formattedY:n,markerColor:r,totalSeries:i,emphasizeText:o=!1,wrapLabels:a=!0}=e,s=t.split("{"),d=(s[1]??t).replace(/[{}]/g,"").split(",");if(1===i&&d.length>1){let e=s[0]?`${s[0]}:`:"value:";return(0,l.jsx)(nv,{formattedY:n,metricName:e,metricLabels:d,markerColor:r})}let c=t.replace(/[,]/g,", ");return(0,l.jsxs)(v.Z,{sx:{display:"table-row",paddingTop:.5},children:[(0,l.jsxs)(v.Z,{sx:{display:"table-cell",maxWidth:"520px"},children:[(0,l.jsx)(nf,{markerColor:r,sx:{marginTop:.5}}),(0,l.jsx)(v.Z,{component:"span",sx:e=>({display:"inline-block",width:"calc(100% - 20px)",minWidth:150,maxWidth:nt,overflow:"hidden",color:e.palette.common.white,fontWeight:o?e.typography.fontWeightBold:e.typography.fontWeightRegular,textOverflow:"ellipsis",whiteSpace:a?"normal":"nowrap"}),"aria-label":o?no:ni,children:c})]}),(0,l.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 nb(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,l.jsx)(v.Z,{sx:e=>({display:"table",padding:e.spacing(.5,2)}),children:r.map(({datumIdx:e,seriesIdx:t,seriesName:i,y:o,formattedY:a,markerColor:s,isClosestToCursor:d})=>{if(null===e||null===t)return null;let c=t.toString()+e.toString();return(0,l.jsx)(ny,{seriesName:i,y:o,formattedY:a,markerColor:s,totalSeries:r.length,wrapLabels:n,emphasizeText:d},c)})})}var nC=n(87895),nj=n(1889),nw=n(75186);let nZ=(0,s.memo)(function({nearbySeries:e,totalSeries:t,isTooltipPinned:n,showAllSeries:r,enablePinning:i=!0,onShowAllClick:o,onUnpinClick:a}){let s=e[0]?.date??null;if(null===s)return null;let d=i&&t>5;return(0,l.jsxs)(v.Z,{sx:e=>({width:"100%",maxWidth:t9,padding:e.spacing(1.5,2,.5,2),backgroundColor:e.palette.designSystem?.grey[800]??na,position:"sticky",top:0,left:0}),children:[(0,l.jsxs)(v.Z,{sx:{width:"100%",display:"flex",justifyContent:"start",alignItems:"center",paddingBottom:.5},children:[(e=>{let{formattedTime:t,formattedDate:n}=t6(e);return(0,l.jsxs)(v.Z,{children:[(0,l.jsx)(eZ.Z,{variant:"caption",sx:e=>({color:e.palette.common.white}),children:n}),(0,l.jsx)(eZ.Z,{variant:"caption",children:(0,l.jsx)("strong",{children:t})})]})})(s),(0,l.jsxs)(W.Z,{direction:"row",gap:1,sx:{marginLeft:"auto"},children:[d&&(0,l.jsxs)(W.Z,{direction:"row",gap:.5,alignItems:"center",sx:{textAlign:"right"},children:[(0,l.jsx)(eZ.Z,{sx:{fontSize:11},children:"Show All"}),(0,l.jsx)(nC.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}})})]}),i&&(0,l.jsxs)(W.Z,{direction:"row",alignItems:"center",children:[(0,l.jsx)(eZ.Z,{sx:{marginRight:.5,fontSize:11,verticalAlign:"middle"},children:n?ng:np}),n?(0,l.jsx)(nj.default,{onClick:()=>{void 0!==a&&a()},sx:{fontSize:16,cursor:"pointer"}}):(0,l.jsx)(nw.default,{sx:{fontSize:16}})]})]})]}),(0,l.jsx)(tO.Z,{sx:e=>({width:"100%",borderColor:e.palette.grey["500"]})})]})}),nS=1e3,nk="Pinned Crosshair",nT={name:nk,type:"line",markLine:{data:[],lineStyle:{type:"dashed",width:2},emphasis:{lineStyle:{width:2,opacity:1}},blur:{lineStyle:{width:2,opacity:1}}}};function nA(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 nM(e){e.dispatchAction({type:"restore"})}function nD(e){void 0!==e.dispatchAction&&(e.dispatchAction({type:"unselect"}),e.dispatchAction({type:"downplay"}))}function nI(e,t,n){if(void 0===n)return null;let r=[e,t];return n.containPixel("grid",r)?n.convertFromPixel("grid",r):null}function nE(e,t,n,r,l,i){let o=i.length>0?i[i.length-1]:l[l.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 nL(e){return e[e.length-1]?.name===nk}function nF(e,t){if(void 0===e||void 0===t)return null;let n=null,r=1/0;for(let[l]of e){let e=Math.abs(l-t);e<r&&(n=l,r=e)}return n}function nR(e,t){if(void 0===t)return null;let n=e.length,r=null;for(let l=0;l<n;l++){let i=n>0?e[l]:null;if(!i)break;r=nF(i.values,t)}return r}let nN=5.5,nP=30,nO=5;function nz(e,t,n,r,l,i){let o=[],a=n[0]??null,s=n[1]??null;if(null===a||null===s||void 0===l.dispatchAction||!Array.isArray(e))return o;let d=[],u=[],h=[],p=[],g=[],x=e.length,m=new Map,f=nF(e[0]?.values,a);if(null===f)return nc;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():"",C=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=nB({valueToCheck:s,baseValue:v,percentage:Math.max(x>nO?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),l.dispatchAction({type:"downplay",seriesIndex:n});let r=(0,c.formatValue)(v,i);o.push({seriesIdx:n,datumIdx:e,seriesName:b,date:f,x:a,y:v,formattedY:r,markerColor:C.toString(),isClosestToCursor:t}),d.push(n)}}}return nE(l,d,u,h,p,g),o}function nW(e,t,n,r,l){let i=[],o=t[0]??null,a=t[1]??null;if(null===o||null===a)return i;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||i.length>=nS)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=nB({valueToCheck:a,baseValue:v,percentage:Math.max(h>nO?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,l);i.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})),i}function n$({mousePos:e,pinnedPos:t,data:n,seriesMapping:r,chart:l,format:i,showAllSeries:o=!1}){if(void 0===l||null===e)return nc;let a=!1;if(null!==e.target){let t=e.target.parentElement;if(null!==t){let e=t.parentElement;null!==e&&l.getDom()===e&&(a=!0)}}if(null!==t&&(e=t,a=!0),!1===a||null===n||void 0===l._model||void 0===e.plotCanvas.x||void 0===e.plotCanvas.y)return nc;let s=nI(e.plotCanvas.x,e.plotCanvas.y,l);if(null!==s){let e=n_({yInterval:l._model.getComponent("yAxis").axis.scale._interval,totalSeries:n.length,showAllSeries:o});return nz(n,r,s,e,l,i)}return nc}function nH({mousePos:e,pinnedPos:t,chartData:n,chart:r,format:l,showAllSeries:i=!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=n_({yInterval:r._model.getComponent("yAxis").axis.scale._interval,totalSeries:n.timeSeries.length,showAllSeries:i}),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 nW(n,e,a,r,l)}return[]}function nB({valueToCheck:e,baseValue:t,percentage:n}){let r=n/100*t;return e>=t-r&&e<=t+r}function n_({yInterval:e,totalSeries:t,showAllSeries:n=!1}){if(n)return 10*e;let r=.3*e;return t>nO?Math.max(r,e*nP/t):Math.max(r,e*nN)}function nV(e,t,n,r,l){if(null===e||(null!==t&&(e=t),void 0===e.plotCanvas.x))return;let i=e.page.x+32,o=e.page.y+16;if(l){let e=l.getBoundingClientRect();i=i-e.left+l.scrollLeft,o=o-e.top+l.scrollTop;let t=e.top+l.scrollHeight;o+n>t&&(o=Math.max(t-n-16,nr/2))}else o+n>window.innerHeight+window.scrollY&&(o=Math.max(window.innerHeight+window.scrollY-n-16,nr/2));return i+r>window.innerWidth&&(i=e.page.x-r-32),i<32&&(i=32),o<nr/2&&(o=nr/2),`translate3d(${i}px, ${o}px, 0)`}function nU(e,t,n){return{minWidth:t8,maxWidth:t9,maxHeight:(n?n-nr:void 0)??ne,padding:0,position:"absolute",top:0,left:0,backgroundColor:e.palette.designSystem?.grey[800]??na,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 nY=(0,s.memo)(function({chartRef:e,chartData:t,enablePinning:n=!0,wrapLabels:r,format:i,onUnpinClick:o,pinnedPos:a,containerId:d}){let[c,u]=(0,s.useState)(!1),h=nu(),{height:p,width:g,ref:x}=(0,nm.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=nH({mousePos:h,chartData:t,pinnedPos:a,chart:e.current,format:i,showAllSeries:c});if(0===y.length)return null;let b=t.timeSeries.length,C=d?document.querySelector(d):void 0,j=C?C.getBoundingClientRect().height:void 0;return m.current=nV(h,a,p??0,g??0,C),(0,l.jsx)(nx.Z,{container:C,children:(0,l.jsx)(v.Z,{ref:x,sx:e=>({minWidth:t8,maxWidth:t9,maxHeight:j??ne,padding:0,position:"absolute",top:0,left:0,backgroundColor:e.palette.designSystem?.grey[800]??na,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,l.jsxs)(W.Z,{spacing:.5,children:[(0,l.jsx)(nZ,{nearbySeries:y,totalSeries:b,enablePinning:n,isTooltipPinned:f,showAllSeries:c,onShowAllClick:e=>u(e),onUnpinClick:o}),(0,l.jsx)(nb,{series:y,wrapLabels:r})]})})})});(0,u.D)([tY.N,p.N,D.N,tG.N,tX.N,tK.N,x.N,tq.N,m.N,I.N,f.N]);let nG=(0,s.forwardRef)(function({height:e,data:t,yAxis:n,format:r,grid:i,legend:o,tooltipConfig:a=nh,noDataVariant:d="message",syncGroup:c,onDataZoom:u,onDoubleClick:h,__experimentalEChartsOptionsOverride:p},g){let x=j(),m=(0,s.useRef)(),[f,y]=(0,s.useState)(!0),[b,C]=(0,s.useState)(null),{timeZone:w}=t4(),[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&&nD(m.current)}}),[]);let A=(0,s.useMemo)(()=>({datazoom:e=>{if(void 0===u&&setTimeout(()=>{C(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,l=t.xAxis[n],i=t.xAxis[r];void 0!==l&&void 0!==i&&u({start:l,end:i,startIndex:n,endIndex:r})}}),[t,u,C]);void 0!==m.current&&nA(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??O(t.xAxis),l={series:t.timeSeries,xAxis:{type:"category",data:t.xAxis,max:t.xAxisMax,axisLabel:{formatter:t=>t5(t,e,w)}},yAxis:P(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:i,legend:o};return p?p(l):l},[t,n,r,i,o,M,w,p,d]);return(0,l.jsxs)(v.Z,{style:{height:e},onClick:e=>{a.enablePinning&&e.target instanceof HTMLCanvasElement&&C(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&&nD(m.current)},onMouseEnter:()=>{y(!0),void 0!==m.current&&nA(m.current)},onDoubleClick:e=>{C(null),void 0===h?void 0!==m.current&&nM(m.current):h(e)},children:[!0===f&&D.tooltip?.showContent===!1&&!0!==a.hidden&&(0,l.jsx)(nY,{chartRef:m,chartData:t,wrapLabels:a.wrapLabels,enablePinning:a.enablePinning,pinnedPos:b,format:r,onUnpinClick:()=>{C(null)},containerId:x.tooltipPortalContainerId}),(0,l.jsx)(F,{sx:{width:"100%",height:"100%"},option:D,theme:x.echartsTheme,onEvents:A,_instance:m,syncGroup:c})]})});var nX=n(28797),nK=n(48137),nq=n(33755),nJ=n(86396);function nQ({control:e,...t}){let{fields:n,append:r,remove:i}=(0,nK.useFieldArray)({control:e,name:"panelDefinition.spec.links"});return(0,l.jsxs)(W.Z,{...t,gap:3,children:[n&&n.length>0?n.map((t,n)=>(0,l.jsxs)(s.Fragment,{children:[(0,l.jsxs)(W.Z,{direction:"row",gap:1,alignItems:"center",children:[(0,l.jsx)(n0,{control:e,index:n}),(0,l.jsx)($.Z,{style:{width:"fit-content",height:"fit-content"},onClick:()=>i(n),children:(0,l.jsx)(nJ.default,{})})]}),(0,l.jsx)(tO.Z,{})]},t.id)):(0,l.jsx)(eZ.Z,{variant:"subtitle1",mb:2,fontStyle:"italic",children:"No links defined"}),(0,l.jsx)($.Z,{style:{width:"fit-content",height:"fit-content"},onClick:()=>r({url:""}),children:(0,l.jsx)(nq.default,{})})]})}function n0({control:e,index:t}){return(0,l.jsxs)(W.Z,{gap:2,flexGrow:1,children:[(0,l.jsxs)(W.Z,{direction:"row",gap:2,children:[(0,l.jsx)(nK.Controller,{control:e,name:`panelDefinition.spec.links.${t}.url`,render:({field:e,fieldState:t})=>(0,l.jsx)(H.Z,{...e,required:!0,fullWidth:!0,label:"URL",error:!!t.error,helperText:t.error?.message,onChange:t=>{e.onChange(t)}})}),(0,l.jsx)(nK.Controller,{control:e,name:`panelDefinition.spec.links.${t}.name`,render:({field:e,fieldState:t})=>(0,l.jsx)(H.Z,{...e,fullWidth:!0,label:"Name",defaultValue:"",error:!!t.error,helperText:t.error?.message,onChange:t=>{e.onChange(t)}})}),(0,l.jsx)(nK.Controller,{control:e,name:`panelDefinition.spec.links.${t}.tooltip`,render:({field:e,fieldState:t})=>(0,l.jsx)(H.Z,{...e,fullWidth:!0,label:"Tooltip",defaultValue:"",error:!!t.error,helperText:t.error?.message,onChange:t=>{e.onChange(t)}})})]}),(0,l.jsxs)(W.Z,{gap:2,direction:"row",alignItems:"center",children:[(0,l.jsx)(nK.Controller,{control:e,name:`panelDefinition.spec.links.${t}.renderVariables`,render:({field:e})=>(0,l.jsx)(nX.Z,{label:"Render Variables",control:(0,l.jsx)(eH.Z,{...e,checked:e.value,onChange:t=>e.onChange(t.target.checked)})})}),(0,l.jsx)(nK.Controller,{control:e,name:`panelDefinition.spec.links.${t}.targetBlank`,render:({field:e})=>(0,l.jsx)(nX.Z,{label:"Open in new tab",control:(0,l.jsx)(eH.Z,{...e,checked:e.value,onChange:t=>e.onChange(t.target.checked)})})})]})]})}let n1=[{id:"value",label:"Value"},{id:"percentage",label:"Percentage"}];function n5({disablePercentageMode:e,onChange:t,value:n="value"}){return(0,l.jsx)(tc,{label:"Mode",control:(0,l.jsx)(tp,{value:n1.find(e=>e.id===n),options:n1,getOptionLabel:e=>e.label,getOptionDisabled:t=>"percentage"===t.id&&e,onChange:(e,{id:n})=>{t(n)},disableClearable:!0})})}var n2=n(38359);let n6=({children:e})=>(0,l.jsx)(n2.ZP,{item:!0,xs:4,children:(0,l.jsx)(W.Z,{spacing:3,children:e})}),n3=({children:e})=>(0,l.jsx)(n2.ZP,{container:!0,spacing:8,children:e}),n7=({title:e,children:t,icon:n})=>(0,l.jsxs)(v.Z,{children:[(0,l.jsxs)(v.Z,{display:"flex",borderBottom:1,borderColor:"grey.300",marginBottom:e=>e.spacing(1),children:[(0,l.jsx)(eZ.Z,{variant:"overline",component:"h4",children:e}),n&&(0,l.jsx)(v.Z,{sx:{marginLeft:"auto"},children:n})]}),(0,l.jsx)(W.Z,{spacing:1,children:t})]});var n4=n(66224);function n8(e){let{message:t}=e;return(0,l.jsx)(W.Z,{sx:{height:"100%",alignItems:"center",justifyContent:"center"},children:(0,l.jsx)(eZ.Z,{children:t})})}function n9(e){let{resource:t}=e;return(0,l.jsx)(n8,{message:`No ${t}`})}function re(e){let{variant:t="rounded"}=e;return(0,l.jsx)(W.Z,{sx:{height:"100%",alignItems:"center",justifyContent:"center",px:1},children:(0,l.jsx)(n4.Z,{variant:t,width:"100%",height:"30%","aria-label":"Loading..."})})}let rt=[{id:"asc",label:"Ascending"},{id:"desc",label:"Descending"}];function rn({onChange:e,value:t="desc"}){return(0,l.jsx)(tc,{label:"Sort",control:(0,l.jsx)(tp,{value:rt.find(e=>e.id===t),options:rt,getOptionLabel:e=>e.label,onChange:(t,{id:n})=>{e(n)},disableClearable:!0})})}function rr({onChange:e,value:t,...n}){let r=t=>{e(t)};return(0,l.jsxs)(i.Z,{"aria-label":"Sort",...n,children:[(0,l.jsx)(o.Z,{onClick:()=>r(void 0),variant:void 0===t?"contained":"outlined",children:"None"}),(0,l.jsx)(o.Z,{onClick:()=>r("asc"),variant:"asc"===t?"contained":"outlined",children:"Asc"}),(0,l.jsx)(o.Z,{onClick:()=>r("desc"),variant:"desc"===t?"contained":"outlined",children:"Desc"})]})}function rl({text:e,fontWeight:t,width:n,height:l,lineHeight:i,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}=j();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(l/i,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)([tY.N,p.N,g.N,x.N,m.N,f.N]);let ro=e=>{let{width:t,height:n,data:r,sparkline:i,showSeriesName:o,format:a,valueFontSize:d}=e,c=j(),u=r.color,h=ri(r.calculatedValue,a),p=c.container.padding.default,g=rl({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=rl({text:h,fontSizeOverride:d,fontWeight:700,width:i?m:.5*m,height:i?.25*f:.9*f,lineHeight:1.2}),b=1.2*y;g=Math.min(.7*y,g);let C=(0,s.useMemo)(()=>{if(void 0===r.seriesData)return c.noDataOption;let e=r.seriesData,t=[];if(void 0!==i){let n={type:"line",name:e.name,data:e.values,zlevel:1,symbol:"none",animation:!1,silent:!0},r=N()(n,i);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,i]),w=i?"auto":"center";return(0,l.jsxs)(v.Z,{sx:{height:"100%",width:"100%",display:"flex",flexDirection:"column",justifyContent:w,alignItems:w},children:[o&&(0,l.jsx)(ra,{padding:p,fontSize:g,children:r.seriesData?.name}),(0,l.jsx)(rs,{variant:"h3",color:u,fontSize:y,padding:p,children:h}),void 0!==i&&(0,l.jsx)(F,{sx:{width:"100%"},style:{height:Math.floor(n-x-b)},option:C,theme:c.echartsTheme,renderer:"svg"})]})},ra=(0,X.ZP)(eZ.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"})),rs=(0,X.ZP)(eZ.Z,{shouldForwardProp:e=>"color"!==e&&"padding"!==e&&"fontSize"!==e&&"sparkline"!==e})(({theme:e,color:t,padding:n,fontSize:r,sparkline:l})=>({color:t??e.palette.text.primary,fontSize:`${r}px`,padding:l?`${n}px ${n}px 0 ${n}px`:` 0 ${n}px`,whiteSpace:"nowrap",lineHeight:1.2}));var rd=n(5404),rc=n(98346),ru=n(12434),rh=n(22446);function rp({inputRef:e,label:t,color:n,value:r,mode:i,onChange:o,onColorChange:a,onBlur:d,onDelete:c}){let[u,h]=(0,s.useState)(0);return(0,l.jsxs)(W.Z,{flex:1,direction:"row",alignItems:"center",justifyContent:"space-between",spacing:1,children:[(0,l.jsx)(K,{label:t,color:n,onColorChange:a}),(0,l.jsx)(tn.Z,{htmlFor:t,children:t}),(0,l.jsx)(H.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"===i?(0,l.jsx)(v.Z,{paddingX:1,children:"%"}):void 0}},u),(0,l.jsx)($.Z,{"aria-label":`delete threshold ${t}`,size:"small",onClick:c,children:(0,l.jsx)(rh.default,{})})]})}function rg({thresholds:e,onChange:t,hideDefault:n,disablePercentMode:r}){let{thresholds:{defaultColor:i,palette:o}}=j(),a=e?.defaultColor??i,[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,Q.Uy)(d,n=>{let r=n?.[t];r&&(r.value=Number(e.target.value))}))},g=(n,r)=>{void 0!==e&&t((0,Q.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,Q.Uy)(e,e=>{e.steps=n}))}},m=n=>{void 0!==e&&t((0,Q.Uy)(e,e=>{e.steps&&e.steps.splice(n,1)}))};return(0,l.jsxs)(n7,{title:"Thresholds",icon:(0,l.jsx)(ta,{description:"Add threshold",children:(0,l.jsx)($.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,Q.Uy)(e,e=>{e.steps=[{value:10}]})):t((0,Q.Uy)(e,e=>{let t=e.steps;if(t?.length){let e=t[t.length-1],n=o[t.length]??rx();t.push({color:n,value:(e?.value??0)+10})}else t&&t.push({value:10})}))},children:(0,l.jsx)(nq.default,{})})}),children:[(0,l.jsx)(tc,{label:"Mode",description:"Percentage means thresholds relative to min & max",control:(0,l.jsxs)(rd.Z,{exclusive:!0,disabled:r,value:e?.mode??"absolute",onChange:(n,r)=>{let l="percent"===r?"percent":void 0;void 0!==e?t((0,Q.Uy)(e,e=>{e.mode=l})):t({mode:l})},sx:{height:"36px",marginLeft:"auto"},children:[(0,l.jsx)(rc.Z,{"aria-label":"absolute",value:"absolute",sx:{fontWeight:500},children:"Absolute"}),(0,l.jsx)(rc.Z,{"aria-label":"percent",value:"percent",sx:{fontWeight:500},children:"Percent"})]})}),d&&d.map((t,n)=>(0,l.jsx)(rp,{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,l.jsxs)(ru.Z,{flex:1,direction:"row",alignItems:"center",spacing:1,children:[(0,l.jsx)(K,{label:"default",color:a,onColorChange:n=>{void 0!==e?t((0,Q.Uy)(e,e=>{e.defaultColor=n})):t({defaultColor:n})}}),(0,l.jsx)(eZ.Z,{children:"Default"})]})]})}let rx=()=>"#"+Math.floor(0x1000000*Math.random()).toString(16).padStart(6,"0"),rm=(0,s.memo)(function({containerId:e,chartRef:t,data:n,seriesMapping:r,enablePinning:i=!0,wrapLabels:o,format:a,onUnpinClick:d,pinnedPos:c}){let[u,h]=(0,s.useState)(!1),p=(0,s.useRef)(),g=nu(),{height:x,width:m,ref:f}=(0,nm.default)(),y=null!==c&&i;if(null===g||null===g.target||null===n||null===c&&"CANVAS"!==g.target.tagName)return null;let b=t.current,C=e?document.querySelector(e):void 0,j=C?C.getBoundingClientRect().height:void 0;p.current=nV(g,c,x??0,m??0,C);let w=n$({mousePos:g,data:n,seriesMapping:r,pinnedPos:c,chart:b,format:a,showAllSeries:u});if(0===w.length)return null;let Z=n.length;return(0,l.jsx)(nx.Z,{container:C,children:(0,l.jsx)(v.Z,{ref:f,sx:e=>nU(e,c,j),style:{transform:p.current},children:(0,l.jsxs)(W.Z,{spacing:.5,children:[(0,l.jsx)(nZ,{nearbySeries:w,totalSeries:Z,enablePinning:i,isTooltipPinned:y,showAllSeries:u,onShowAllClick:e=>h(e),onUnpinClick:d}),(0,l.jsx)(nb,{series:w,wrapLabels:o})]})})})});(0,u.D)([tY.N,h.N,p.N,g.N,D.N,tG.N,tX.N,tK.N,x.N,tq.N,m.N,f.N]);let rf=(0,s.forwardRef)(function({height:e,data:t,seriesMapping:n,timeScale:r,yAxis:i,format:o,grid:a,isStackedBar:d=!1,tooltipConfig:u=nh,noDataVariant:h="message",syncGroup:p,onDataZoom:g,onDoubleClick:x,__experimentalEChartsOptionsOverride:m},f){let y;let{chartsTheme:b,enablePinning:j,lastTooltipPinnedCoords:w,setLastTooltipPinnedCoords:Z}=C(),k=u.enablePinning&&j,T=(0,s.useRef)(),[A,M]=(0,s.useState)(!0),[D,I]=(0,s.useState)(null),[E,L]=(0,s.useState)(null),[R,O]=(0,s.useState)(!1),[z,W]=(0,s.useState)(0),{timeZone:$}=t4();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&&nD(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&&nA(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 l=t.values.map(([e,t])=>[r?e:(0,tJ.toZonedTime)(e,$),null===t?"-":t]);e.push({id:n,source:[...l],dimensions:["time","value"]})});let l={dataset:e,series:j&&null!==E?[...n,E]:n,xAxis:{type:"time",min:r?y.startMs:(0,tJ.toZonedTime)(y.startMs,$),max:r?y.endMs:(0,tJ.toZonedTime)(y.endMs,$),axisLabel:{hideOverlap:!0,formatter:t2(y.rangeMs??0)},axisPointer:{snap:!1}},yAxis:P(i,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(l):l},[t,n,y,i,o,a,B,m,h,$,d,j,E]);return(0,s.useEffect)(()=>{null===D||null===w||S()(w,D)||(I(null),null!==D&&null!==E&&L(null))},[w,n]),(0,l.jsxs)(v.Z,{style:{height:e},onClick:e=>{let n=e.ctrlKey||e.metaKey;n&&e.preventDefault();let r=nI(e.nativeEvent.offsetX,e.nativeEvent.offsetY,T.current);if(null!==r&&k&&e.target instanceof HTMLCanvasElement){let l={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?l:(L(null),null)),L(e=>{if(null!==e)return null;{let e=r[0],n=nF(t[0]?.values,e);return N()({},nT,{markLine:{data:[{xAxis:n}]}})}}),n||Z(l)}},onMouseDown:e=>{let{clientX:t}=e;O(!0),W(t)},onMouseMove:e=>{if(!(e.target instanceof HTMLCanvasElement))return;let{clientX:t}=e;R&&t-z>0&&M(!1)},onMouseUp:()=>{O(!1),W(0),M(!0)},onMouseLeave:()=>{null===D&&M(!1),void 0!==T.current&&nD(T.current)},onMouseEnter:()=>{M(!0),void 0!==T.current&&nA(T.current)},onDoubleClick:e=>{I(null),void 0===x?void 0!==T.current&&nM(T.current):x(e)},children:[!0===A&&_.tooltip?.showContent===!1&&!0!==u.hidden&&(0,l.jsx)(rm,{containerId:b.tooltipPortalContainerId,chartRef:T,data:t,seriesMapping:n,wrapLabels:u.wrapLabels,enablePinning:k,pinnedPos:D,format:o,onUnpinClick:()=>{I(null),L(null)}}),(0,l.jsx)(F,{sx:{width:"100%",height:"100%"},option:_,theme:b.echartsTheme,onEvents:H,_instance:T,syncGroup:p})]})});var rv=n(63767),ry=n(59986),rb=n(53578),rC=n(52583),rj=n(94913),rw=n(51727);let rZ="yyyy-MM-dd HH:mm:ss";function rS(e,t){return e?(0,c.isRelativeTimeRange)(e)?e.pastDuration:function(e,t,n){let r=t1(e.start,t,n),l=t1(e.end,t,n);return`${r} - ${l}`}(e,rZ,t):"Custom Time Range"}let rk=({initialTimeRange:e,onChange:t,onCancel:n})=>{let{formatWithUserTimeZone:r}=t4(),[i,a]=(0,s.useState)(e),[d,c]=(0,s.useState)({start:r(e.start,rZ),end:r(e.end,rZ)}),[u,h]=(0,s.useState)(!0),p=(e,t)=>{let n="string"==typeof e,l=n?e:r(e,rZ);c(e=>({...e,[t]:l})),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,tQ.isValid)(e)&&(0,tQ.isValid)(t)?!!(0,tQ.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,l.jsx)(rb._,{dateAdapter:rw.H,children:(0,l.jsxs)(W.Z,{spacing:2,sx:e=>({padding:e.spacing(1,0,2)}),children:[u&&(0,l.jsxs)(v.Z,{sx:e=>({".MuiPickersLayout-contentWrapper":{backgroundColor:e.palette.background.default}}),children:[(0,l.jsx)(eZ.Z,{variant:"h3",padding:1,paddingLeft:2,children:"Select Start Time"}),(0,l.jsx)(rC.S,{displayStaticWrapperAs:"desktop",openTo:"day",disableHighlightToday:!0,value:e.start,onChange:e=>{null!==e&&g(e)},onAccept:()=>{h(!1)}})]}),!u&&(0,l.jsxs)(v.Z,{sx:e=>({".MuiPickersLayout-contentWrapper":{backgroundColor:e.palette.background.default}}),children:[(0,l.jsx)(eZ.Z,{variant:"h3",padding:1,paddingLeft:2,children:"Select End Time"}),(0,l.jsx)(rC.S,{displayStaticWrapperAs:"desktop",openTo:"day",disableHighlightToday:!0,value:e.end,minDateTime:i.start,onChange:e=>{null!==e&&x(e)},onAccept:e=>{null!==e&&(h(!0),x(e))}})]}),(0,l.jsxs)(W.Z,{direction:"row",alignItems:"center",gap:1,pl:1,pr:1,children:[(0,l.jsx)(tR.ErrorBoundary,{FallbackComponent:tF,children:(0,l.jsx)(rj.l,{label:"Start Time",value:new Date(d.start),onChange:e=>{e&&g(e)},onBlur:()=>m(),format:rZ})}),(0,l.jsx)(tR.ErrorBoundary,{FallbackComponent:tF,children:(0,l.jsx)(rj.l,{label:"End Time",value:new Date(d.end),onChange:e=>{e&&x(e)},onBlur:()=>m(),format:rZ})})]}),(0,l.jsxs)(W.Z,{direction:"row",sx:{padding:e=>e.spacing(0,1)},gap:1,children:[(0,l.jsx)(o.Z,{variant:"contained",onClick:()=>f(),fullWidth:!0,children:"Apply"}),(0,l.jsx)(o.Z,{variant:"outlined",onClick:()=>n(),fullWidth:!0,children:"Cancel"})]})]})})};function rT({value:e,timeOptions:t,onChange:n,height:r,showCustomTimeRange:i=!0}){let{timeZone:o}=t4(),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:rS(t,o)}},[e,o]),[g,x]=(0,s.useState)(!1);return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(G.ZP,{anchorEl:a.current,anchorOrigin:{vertical:"bottom",horizontal:"center"},open:d,onClose:()=>u(!1),sx:e=>({padding:e.spacing(2)}),children:(0,l.jsx)(rk,{initialTimeRange:h,onChange:e=>{n(e),u(!1),x(!1)},onCancel:()=>u(!1)})}),(0,l.jsx)(v.Z,{ref:a,children:(0,l.jsxs)(rv.Z,{open:g,value:rS(e,o),onClick:()=>x(!g),IconComponent:ry.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,l.jsx)(tS.Z,{value:rS(e.value,o),onClick:()=>{n(e.value)},children:e.display},t)),i&&(0,l.jsx)(tS.Z,{value:rS(p.value,o),onClick:()=>u(!0),children:p.display})]})})]})}let rA=(0,X.ZP)(o.Z)(({theme:e})=>({padding:e.spacing(.5),minWidth:"auto"})),rM=(0,s.forwardRef)(function(e,t){return(0,l.jsx)(rA,{ref:t,variant:"outlined",color:"secondary",...e})}),rD=Object.entries(c.UNIT_CONFIG).map(([e,t])=>({id:e,...t})).filter(e=>!e.disableSelectorOption),rI=[{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 rE({value:e,onChange:t,disabled:n=!1}){var r;let i=(0,c.isUnitWithDecimalPlaces)(e),o=(0,c.isUnitWithShortValues)(e),a=({decimalPlaces:n})=>{i&&t({...e,decimalPlaces:n})},s=c.UNIT_CONFIG[e.unit];return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(tc,{label:"Short values",control:(0,l.jsx)(nC.Z,{checked:!!o&&(0,c.shouldShortenValues)(e.shortValues),onChange:(n,r)=>{o&&t({...e,shortValues:r})},disabled:!o})}),(0,l.jsx)(tc,{label:"Unit",control:(0,l.jsx)(tp,{value:{id:e.unit,...s},options:rD,groupBy:e=>e.group,onChange:(e,n)=>{t({unit:n.id})},disableClearable:!0,disabled:n})}),(0,l.jsx)(tc,{label:"Decimals",control:(0,l.jsx)(tp,{value:(r=e.decimalPlaces,rI.find(e=>e.decimalPlaces===r)),options:rI,getOptionLabel:e=>e.label,onChange:(e,t)=>a(t),disabled:!i,disableClearable:!0})})]})}function rL({name:e,height:t}){return(0,l.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,l.jsx)(eZ.Z,{variant:"body1","aria-label":"y axis label",sx:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:e})})}var rF=n(78439);function rR(){let{enqueueSnackbar:e,closeSnackbar:t}=(0,rF.Ds)(),n=rN(e,"error"),r=rN(e,"info"),l=rN(e,"warning"),i=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:l,successSnackbar:i,exceptionSnackbar:o}}function rN(e,t){return(0,s.useCallback)((n,r)=>e(n,{...r,variant:t}),[e,t])}function rP(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 rO(e){return{value:{pastDuration:e},display:`Last ${(0,tQ.formatDuration)((0,c.parseDurationString)(e),{delimiter:", "})}`}}var rz=n(28730);let rW=rP((0,rz.Z)({}),{echartsTheme:{textStyle:{fontFamily:"Lato"},categoryAxis:{splitLine:{show:!1}},timeAxis:{splitLine:{show:!1}},bar:{barCategoryGap:2}}}),r$={chartsTheme:rW,enablePinning:!1,lastTooltipPinnedCoords:null,setLastTooltipPinnedCoords:()=>null};var rH=n(79602);let rB={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,[`& .${rH.Z.icon}`]:{color:e.palette.error.main}}:{...e.typography.body1,backgroundColor:e.palette.error.light,color:e.palette.error.dark,[`& .${rH.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,[`& .${rH.Z.icon}`]:{color:e.palette.info.main}}:{...e.typography.body1,backgroundColor:e.palette.info.light,color:e.palette.info.dark,[`& .${rH.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,[`& .${rH.Z.icon}`]:{color:e.palette.success.main}}:{...e.typography.body1,backgroundColor:e.palette.success.light,color:e.palette.success.dark,[`& .${rH.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,[`& .${rH.Z.icon}`]:{color:e.palette.warning.main}}:{...e.typography.body1,backgroundColor:e.palette.warning.light,color:e.palette.warning.dark,[`& .${rH.Z.icon}`]:{color:e.palette.warning.main}},root:{["& ."+n(757).Z.root]:{textDecoration:"underline"}}}},r_={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"},rV={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"},rU="#FFFFFF",rY=e=>{let t=r_["800"],n=r_["300"];return"light"===e?{navigation:t,accent:n,primary:r_["800"],secondary:r_["700"],disabled:r_["300"],link:rV["500"],linkHover:rV["600"]}:{navigation:t,accent:n,primary:rU,secondary:r_["50"],disabled:r_["600"],link:rV["400"],linkHover:rV["500"]}},rG=e=>{let t=rV["150"],n="rgba(21, 23, 33, 0.75)";return"light"===e?{navigation:t,overlay:n,default:rU,paper:r_["50"],code:r_["50"],tooltip:r_["100"],lighter:r_["50"],border:r_["100"]}:{navigation:t,overlay:n,default:r_["900"],paper:r_["850"],code:r_["800"],tooltip:r_["600"],lighter:r_["700"],border:r_["600"]}},rX=e=>"light"===e?{50:r_["50"],100:r_["100"],200:r_["200"],300:r_["300"],400:r_["400"],500:r_["500"],600:r_["600"],700:r_["700"],800:r_["800"],900:r_["900"],950:r_["950"]}:{50:r_["950"],100:r_["900"],200:r_["800"],300:r_["700"],400:r_["600"],500:r_["500"],600:r_["400"],700:r_["300"],800:r_["200"],900:r_["100"],950:r_["50"]},rK=e=>"light"===e?{main:rV["500"],dark:rV["600"],light:rV["50"]}:{main:rV["400"],dark:rV["800"],light:rV["200"]},rq=e=>"light"===e?{main:r_["600"],dark:r_["900"],light:r_["100"]}:{main:rU,dark:rU,light:rU},rJ={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"},rQ={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"},r0={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"},r1={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"},r5=e=>"light"===e?{main:r1["500"],dark:r1["600"],light:r1["50"]}:{main:r1["400"],dark:r1["800"],light:r1["300"]},r2=e=>"light"===e?{main:rJ["500"],dark:rJ["700"],light:rJ["50"]}:{main:rJ["400"],dark:rJ["800"],light:rJ["300"]},r6=e=>"light"===e?{main:rQ["500"],dark:rQ["700"],light:rQ["50"]}:{main:rQ["400"],dark:rQ["800"],light:rQ["300"]};n(12711),n(89479),n(99511),n(53213);let r3={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 r4(e,t={}){return(0,rz.Z)({palette:{mode:e,primary:rK(e),secondary:rq(e),grey:rX(e),background:rG(e),text:rY(e),error:r5(e),warning:r6(e),info:rK(e),success:r2(e),common:{white:rU,black:"#000000"},designSystem:{blue:rV,green:rJ,grey:r_,orange:rQ,purple:r0,red:r1}},typography:r3,mixins:{},components:r8,...t})}let r8={MuiAlert:rB,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 r9=n(84974),le=n(12449),lt=n(28418),ln=n(57689);function lr({value:e,onChange:t}){return(0,l.jsxs)(W.Z,{direction:"row",children:[(0,l.jsx)(tu.Z,{freeSolo:!0,multiple:!0,id:"join-columns",sx:{width:"100%"},options:[],value:e.spec.columns??[],renderInput:e=>(0,l.jsx)(H.Z,{...e,variant:"outlined",label:"Columns",required:!0}),onChange:(n,r)=>{t({...e,spec:{...e.spec,columns:r}})}}),(0,l.jsx)(nX.Z,{label:"Enabled",labelPlacement:"start",control:(0,l.jsx)(nC.Z,{value:!e.spec.disabled,checked:!e.spec.disabled,onChange:n=>t({...e,spec:{...e.spec,disabled:!n.target.checked}})})})]})}function ll({value:e,onChange:t}){return(0,l.jsxs)(W.Z,{direction:"row",gap:1,alignItems:"center",children:[(0,l.jsx)(tu.Z,{freeSolo:!0,multiple:!0,id:"merge-columns-columns",sx:{width:"100%"},options:[],value:e.spec.columns??[],renderInput:e=>(0,l.jsx)(H.Z,{...e,variant:"outlined",label:"Columns",required:!0}),onChange:(n,r)=>{t({...e,spec:{...e.spec,columns:r}})}}),(0,l.jsx)(e1,{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,l.jsx)(nX.Z,{label:"Enabled",labelPlacement:"start",control:(0,l.jsx)(nC.Z,{value:!e.spec.disabled,checked:!e.spec.disabled,onChange:n=>t({...e,spec:{...e.spec,disabled:!n.target.checked}})})})]})}function li({value:e,onChange:t}){return(0,l.jsxs)(W.Z,{direction:"row",children:[(0,l.jsx)(e1,{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,l.jsx)(nX.Z,{label:"Enabled",labelPlacement:"start",control:(0,l.jsx)(nC.Z,{value:!e.spec.disabled,checked:!e.spec.disabled,onChange:n=>t({...e,spec:{...e.spec,disabled:!n.target.checked}})})})]})}function lo({value:e,onChange:t}){return(0,l.jsx)(W.Z,{direction:"row",children:(0,l.jsx)(nX.Z,{label:"Enabled",labelPlacement:"start",control:(0,l.jsx)(nC.Z,{value:!e.spec.disabled,checked:!e.spec.disabled,onChange:n=>t({...e,spec:{...e.spec,disabled:!n.target.checked}})})})})}function la({value:e,onChange:t,...n}){return(0,l.jsxs)(W.Z,{gap:2,sx:{width:"100%"},mt:1,...n,children:[(0,l.jsxs)(e1,{select:!0,label:"Kind",value:e.kind,onChange:n=>t({...e,kind:n}),children:[(0,l.jsx)(tS.Z,{value:"JoinByColumnValue",children:(0,l.jsxs)(W.Z,{children:[(0,l.jsx)(eZ.Z,{children:"Join by column value"}),(0,l.jsx)(eZ.Z,{variant:"caption",children:"Regroup rows with equal cell value in a column"})]})}),(0,l.jsx)(tS.Z,{value:"MergeColumns",children:(0,l.jsxs)(W.Z,{children:[(0,l.jsx)(eZ.Z,{children:"Merge columns"}),(0,l.jsx)(eZ.Z,{variant:"caption",children:"Multiple columns are merged to one column"})]})}),(0,l.jsx)(tS.Z,{value:"MergeIndexedColumns",children:(0,l.jsxs)(W.Z,{children:[(0,l.jsx)(eZ.Z,{children:"Merge indexed columns"}),(0,l.jsx)(eZ.Z,{variant:"caption",children:"Indexed columns are merged to one column"})]})}),(0,l.jsx)(tS.Z,{value:"MergeSeries",children:(0,l.jsxs)(W.Z,{children:[(0,l.jsx)(eZ.Z,{children:"Merge series"}),(0,l.jsx)(eZ.Z,{variant:"caption",children:"Series will be merged by their labels"})]})})]}),"JoinByColumnValue"===e.kind&&(0,l.jsx)(lr,{value:e,onChange:t}),"MergeColumns"===e.kind&&(0,l.jsx)(ll,{value:e,onChange:t}),"MergeIndexedColumns"===e.kind&&(0,l.jsx)(li,{value:e,onChange:t}),"MergeSeries"===e.kind&&(0,l.jsx)(lo,{value:e,onChange:t})]})}function ls({index:e,value:t,isCollapsed:n,onChange:r,onCollapse:i,onDelete:o,...a}){return(0,l.jsxs)(W.Z,{...a,children:[(0,l.jsxs)(W.Z,{direction:"row",alignItems:"center",borderBottom:1,borderColor:e=>e.palette.divider,justifyContent:"space-between",gap:4,children:[(0,l.jsxs)(W.Z,{direction:"row",gap:1,children:[(0,l.jsx)($.Z,{"data-testid":`transform-toggle#${e}`,size:"small",onClick:()=>i(!n),children:n?(0,l.jsx)(r9.default,{}):(0,l.jsx)(le.default,{})}),(0,l.jsx)(eZ.Z,{variant:"overline",component:"h4",sx:{textTransform:"none"},children:t.kind?(0,l.jsx)("span",{children:(0,l.jsx)("strong",{children:c.TRANSFORM_TEXT[t.kind]})}):(0,l.jsx)("strong",{children:"Select a transformation kind"})})]}),(0,l.jsxs)(W.Z,{direction:"row",gap:1,children:[n&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(ti.Z,{title:t.spec?.disabled?"Enable transformation":"Disable transformation",placement:"top",children:(0,l.jsx)($.Z,{size:"small",sx:{marginLeft:"auto"},onClick:function(){r({...t,spec:{...t.spec,disabled:!t.spec?.disabled}})},children:t.spec?.disabled?(0,l.jsx)(lt.default,{}):(0,l.jsx)(ln.default,{})})}),(0,l.jsx)(tO.Z,{flexItem:!0,orientation:"vertical",variant:"middle"})]}),(0,l.jsx)(ti.Z,{title:"Remove transformation",placement:"top",children:(0,l.jsx)($.Z,{size:"small",sx:{marginLeft:"auto"},onClick:o,children:(0,l.jsx)(rh.default,{})})})]})]}),!n&&(0,l.jsx)(la,{value:t,onChange:r})]})}function ld({value:e,onChange:t,...n}){let[r,i]=(0,s.useState)(e.map(()=>!0));return(0,l.jsxs)(W.Z,{gap:1,...n,children:[e.map((n,o)=>(0,l.jsx)(ls,{index:o,value:n,isCollapsed:r[o]??!0,onChange:n=>(function(n,r){let l=[...e];l[n]=r,t(l)})(o,n),onDelete:()=>(function(n){let r=[...e];r.splice(n,1),t(r),i(e=>(e.splice(n,1),[...e]))})(o),onCollapse:e=>{i(t=>(t[o]=e,[...t]))}},o)),(0,l.jsx)(o.Z,{variant:"contained",startIcon:(0,l.jsx)(nq.default,{}),sx:{marginTop:1},onClick:function(){let n=[...e];n.push({kind:"",spec:{}}),t(n),i(e=>(e.push(!1),[...e]))},children:"Add Transformation"})]})}function lc(e){let{value:t,onChange:n,timeOptions:r,height:i}=e,o=(0,s.useMemo)(()=>{if(t&&!r.some(e=>e.value.pastDuration===t))return(0,l.jsx)(tS.Z,{value:t,children:t})},[r,t]);return(0,l.jsx)(tt.Z,{children:(0,l.jsx)(v.Z,{children:(0,l.jsxs)(rv.Z,{id:"refreshInterval",value:t,onChange:e=>{n(e.target.value)},inputProps:{"aria-label":`Select refresh interval. Currently set to ${t}`},sx:{".MuiSelect-select":i?{lineHeight:i,paddingY:0}:{}},children:[r.map((e,t)=>(0,l.jsx)(tS.Z,{value:e.value.pastDuration,children:e.display},t)),o]})})})}var lu=n(85731);function lh(e){let{width:t,height:n,data:r}=e,i=j(),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:i.echartsTheme[0]}};return(0,l.jsx)(v.Z,{style:{width:t,height:n},sx:{overflow:"auto"},children:(0,l.jsx)(F,{sx:{minHeight:n,height:r?16*r.length:"100%"},option:o,theme:i.echartsTheme})})}(0,u.D)([lu.N,p.N,g.N,x.N,m.N,f.N]);var lp=n(27835),lg=n(943),lx=n(72116);(0,u.D)([lp.N,lg.N,p.N,g.N,x.N,m.N,f.N]);let lm=e=>{var t;let{height:n,data:r,xAxisCategories:i,yAxisCategories:o,timeScale:a,colors:s}=e,{timeZone:d}=t4(),c=j(),u=(0,J.Z)(),h={tooltip:{appendToBody:!0,formatter:e=>(function({data:e,label:t,marker:n,xAxisCategories:r,yAxisCategories:l,theme:i}){let[o,a]=e,{formattedDate:s,formattedTime:d}=t6(r[o]),c=(0,lx.css)`
2
- border-bottom: 1px solid ${i.palette.grey[500]};
3
- padding-bottom: 8px;
4
- `,u=(0,lx.css)`
5
- display: flex;
6
- justify-content: space-between;
7
- padding-top: 8px;
8
- `,h=(0,lx.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>${l[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:i,yAxisCategories:o,theme:u})},grid:{top:"5%",bottom:"5%"},xAxis:{type:"category",data:i,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?t1(n,"yyy",d):t>63072e6?t1(n,"MMM yyy",d):t>864e6&&t<1577664e4?t1(n,"dd.MM",d):t>1728e5&&t<=864e6?t1(n,"dd.MM HH:mm",d):t1(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,l.jsx)(v.Z,{style:{height:n},sx:{overflow:"auto"},children:(0,l.jsx)(F,{sx:{width:"100%",height:n},option:h,theme:c.echartsTheme})})},lf="#1f77b4";function lv(e,t){t.match(/^#[0-9A-Fa-f]{6}$/)||(t=lf);try{let[n,r,l]=lb(t);if(isNaN(n)||isNaN(r)||isNaN(l))throw Error("Invalid HSL values");let i=String(e).split("").reduce((e,t)=>e+t.charCodeAt(0),0),o=Math.min(r+10,90),a=lC(Math.abs((n+i%6*60)%360),Math.min(Math.max(o,50),90),Math.min(Math.max(l+(i%2?15:-15),30),70));if(!a.match(/^#[0-9A-Fa-f]{6}$/))throw Error("Invalid generated color");return a}catch(e){return lf}}function ly(e,t){return t.length>=e.length?t.slice(0,e.length):e.map((e,n)=>n<t.length?t[n]||lf:lv(e,t[0]||lf))}function lb(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,l=Math.max(t,n,r),i=Math.min(t,n,r),o=0,a=0,s=(l+i)/2;if(l!==i){let e=l-i;switch(a=s>.5?e/(2-l-i):e/(l+i),l){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 lC(e,t,n){let r=t*Math.min(n/=100,1-n)/100,l=t=>{let l=(t+e/30)%12;return Math.round(255*(n-r*Math.max(Math.min(l-3,9-l,1),-1))).toString(16).padStart(2,"0")};return`#${l(0)}${l(8)}${l(4)}`}var lj=n(41305);let lw=({mapping:e,onChange:t,...n})=>{switch(e.kind){case"Value":return(0,l.jsx)(W.Z,{gap:1,direction:"row",...n,children:(0,l.jsx)(H.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,l.jsxs)(W.Z,{gap:1,direction:"row",...n,children:[(0,l.jsx)(H.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,l.jsx)(H.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,l.jsx)(W.Z,{gap:1,direction:"row",...n,children:(0,l.jsx)(H.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,l.jsx)(W.Z,{gap:1,direction:"row",...n,children:(0,l.jsxs)(H.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,l.jsx)(tS.Z,{value:"empty",children:(0,l.jsxs)(W.Z,{children:[(0,l.jsx)(eZ.Z,{children:"Empty"}),(0,l.jsx)(eZ.Z,{variant:"caption",children:"Matches empty string"})]})}),(0,l.jsx)(tS.Z,{value:"null",children:(0,l.jsxs)(W.Z,{children:[(0,l.jsx)(eZ.Z,{children:"Null"}),(0,l.jsx)(eZ.Z,{variant:"caption",children:"Matches null or undefined"})]})}),(0,l.jsx)(tS.Z,{value:"NaN",children:(0,l.jsxs)(W.Z,{children:[(0,l.jsx)(eZ.Z,{children:"NaN"}),(0,l.jsx)(eZ.Z,{variant:"caption",children:"Matches Not a Number value"})]})}),(0,l.jsx)(tS.Z,{value:"true",children:(0,l.jsxs)(W.Z,{children:[(0,l.jsx)(eZ.Z,{children:"True"}),(0,l.jsx)(eZ.Z,{variant:"caption",children:"Matches true boolean"})]})}),(0,l.jsx)(tS.Z,{value:"false",children:(0,l.jsxs)(W.Z,{children:[(0,l.jsx)(eZ.Z,{children:"False"}),(0,l.jsx)(eZ.Z,{variant:"caption",children:"Matches false boolean"})]})})]})});default:return null}},lZ=({mapping:e,onChange:t,onDelete:n,...r})=>{let i=n=>{t({...e,spec:{...e.spec,result:{...e.spec.result,color:n}}})};return(0,l.jsxs)(lj.Z,{container:!0,spacing:2,...r,children:[(0,l.jsx)(lj.Z,{size:{xs:5},children:(0,l.jsxs)(W.Z,{direction:"row",gap:1,width:"100%",children:[(0,l.jsxs)(H.Z,{select:!0,label:"Type",value:e.kind,onChange:n=>t({...e,kind:n.target.value}),required:!0,sx:{width:"120px"},children:[(0,l.jsx)(tS.Z,{value:"Value",children:(0,l.jsxs)(W.Z,{children:[(0,l.jsx)(eZ.Z,{children:"Value"}),"Value"!==e.kind&&(0,l.jsx)(eZ.Z,{variant:"caption",children:"Matches an exact text value"})]})}),(0,l.jsx)(tS.Z,{value:"Range",children:(0,l.jsxs)(W.Z,{children:[(0,l.jsx)(eZ.Z,{children:"Range"}),"Range"!==e.kind&&(0,l.jsx)(eZ.Z,{variant:"caption",children:"Matches against a numerical range"})]})}),(0,l.jsx)(tS.Z,{value:"Regex",children:(0,l.jsxs)(W.Z,{children:[(0,l.jsx)(eZ.Z,{children:"Regex"}),"Regex"!==e.kind&&(0,l.jsx)(eZ.Z,{variant:"caption",children:"Matches against a regular expression"})]})}),(0,l.jsx)(tS.Z,{value:"Misc",children:(0,l.jsxs)(W.Z,{children:[(0,l.jsx)(eZ.Z,{children:"Misc"}),"Misc"!==e.kind&&(0,l.jsx)(eZ.Z,{variant:"caption",children:"Matches against empty, null and NaN values"})]})})]}),(0,l.jsx)(lw,{width:"100%",mapping:e,onChange:n=>t({...e,...n})})]})}),(0,l.jsx)(lj.Z,{size:{xs:4},children:(0,l.jsx)(H.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,l.jsx)(lj.Z,{size:{xs:1},children:(0,l.jsx)(W.Z,{direction:"row",justifyContent:"center",gap:1,children:e.spec?.result?.color?(0,l.jsx)(K,{label:"Color",color:e.spec.result.color??"#000",onColorChange:i,onClear:()=>i(void 0)}):(0,l.jsx)($.Z,{onClick:()=>i("#000"),children:(0,l.jsx)(nq.default,{})})})}),(0,l.jsx)(lj.Z,{size:{xs:1},textAlign:"end",children:(0,l.jsx)(ti.Z,{title:"Remove mapping settings",placement:"top",children:(0,l.jsx)($.Z,{size:"small",sx:{marginLeft:"auto"},onClick:n,children:(0,l.jsx)(rh.default,{})})})})]})},lS=({mappings:e,onChange:t})=>{let[n,r]=(0,s.useState)(e);return(0,l.jsxs)(W.Z,{spacing:1,children:[(0,l.jsxs)(lj.Z,{container:!0,spacing:2,children:[(0,l.jsx)(lj.Z,{size:{xs:5},children:(0,l.jsx)(eZ.Z,{variant:"subtitle1",children:"Condition"})}),(0,l.jsx)(lj.Z,{size:{xs:4},children:(0,l.jsx)(eZ.Z,{variant:"subtitle1",children:"Display Text"})}),(0,l.jsx)(lj.Z,{size:{xs:1},textAlign:"center",children:(0,l.jsx)(eZ.Z,{variant:"subtitle1",children:"Color"})}),(0,l.jsx)(lj.Z,{size:{xs:1}})]}),(0,l.jsx)(W.Z,{gap:1.5,divider:(0,l.jsx)(tO.Z,{flexItem:!0,orientation:"horizontal"}),children:n.map((e,i)=>(0,l.jsx)(lZ,{mapping:e,onChange:e=>(function(e,l){let i=[...n];i[e]=l,r(i),t(i)})(i,e),onDelete:()=>(function(e){let l=[...n];l.splice(e,1),r(l),t(l)})(i)},i))}),(0,l.jsx)(o.Z,{variant:"contained",startIcon:(0,l.jsx)(nq.default,{}),sx:{marginTop:1},onClick:function(){let e=[...n];e.push({kind:"Value",spec:{result:{value:""}}}),r(e),t(e)},children:"Add value mappings"})]})}}}]);
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunkTable=self.webpackChunkTable||[]).push([["4062"],{56050:function(){}}]);