@deephaven/embed-grid 0.61.2-beta.0 → 0.62.1-beta.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.
- package/build/assets/{App-c76250d5.js → App-43b1026b.js} +2 -2
- package/build/assets/{App-c76250d5.js.map → App-43b1026b.js.map} +1 -1
- package/build/assets/{index-e703c935.js → index-6c2264c4.js} +2 -2
- package/build/assets/{index-e703c935.js.map → index-6c2264c4.js.map} +1 -1
- package/build/assets/{index-7bc179e3.js → index-df7a6430.js} +2 -2
- package/build/assets/{index-7bc179e3.js.map → index-df7a6430.js.map} +1 -1
- package/build/assets/plotly-bfbd68da.js +7 -0
- package/build/assets/{plotly-33051b85.js.map → plotly-bfbd68da.js.map} +1 -1
- package/build/assets/{useUser-8a9c44b4.js → useUser-5f3a0f4f.js} +2 -2
- package/build/assets/{useUser-8a9c44b4.js.map → useUser-5f3a0f4f.js.map} +1 -1
- package/build/index.html +2 -2
- package/package.json +14 -14
- package/build/assets/plotly-33051b85.js +0 -7
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{C as u,$ as Im,H as lc,I as Po,F as ne,J as dc,r as v,K as Le,L as Ee,M as Nm,N as uc,O as Mm,P as hc,Q as Lm,S as Fm,T as Kl,U as ot,G as X,E as Y,V as _,W as Am,D as Hn,X as ar,Y as Rm,Z as jm,_ as km,a0 as $m,a1 as cc,a2 as Um,a3 as Hm,a4 as yr,a5 as vc,a6 as Mt,a7 as se,a8 as Z,R as Ma,a9 as ql,aa as Vm,ab as _o,ac as Bm,ad as Wm,ae as Gm,af as zm,ag as mi,ah as fc,ai as gi,aj as Km,ak as ii,al as Pt,am as pc,an as qm,ao as Ym,ap as Xm,aq as Zm,ar as Qm,as as Jm,at as mc}from"./vendor-70ada314.js";import{L as B,i as eg,v as Wn,M as bi,b as Ci,c as La,d as hr,e as tg,a as tt,f as To,g as ng,h as rg,r as Oo,j as G,k as ig,l as ag,m as sg,T as Vn,C as og,D as lg,n as dg,o as ug,p as hg,q as Fa,N as cg,S as vg,s as fg,t as pg,W as mg,u as gg,w as bg,x as Cg,y as Sg,z as yg,A as Eg,B as gc,E as bc,F as wg,G as Pg,H as _g,I as Tg,J as Og,K as Dg,O as xg,P as Ig,Q as Aa,R as Ng,U as Cc,V as Yl,X as Mg,Y as Lg,Z as Fg,_ as Sc,$ as Do,a0 as xo,a1 as sr,a2 as Ag,a3 as Xl,a4 as Rg,a5 as jg,a6 as kg,a7 as $g,a8 as Io,a9 as yc,aa as $s,ab as Ug,ac as Hg,ad as Zl,ae as ha,af as Ql,ag as Ec,ah as Vg,ai as Ra,aj as Bg,ak as Wg,al as Gg,am as zg,an as Kg,ao as qg,ap as Yg,aq as wc,ar as Xg,as as Pc,at as _c,au as Jl,av as Zg,aw as Qg,ax as Jg,ay as eb,az as tb,aA as nb,aB as rb,aC as ib}from"./index-e703c935.js";import{T as wt,g as ab,c as Ar,d as sb,e as ob,h as Tc,P as Si,B as K,i as cr,M as No,D as Oc,j as En,k as lb,S as yi,R as ca,l as Er,m as va,n as ae,o as Us,p as Rr,q as db,r as ub,s as hb,C as Dc,t as Mo,v as cb,w as vb,G as wr,x as fb,K as fe,y as pe,z as pb,A as mb,O as gb,E as bb,F as xc,H as Hs,J as Bn,L as Ic,N as Cb,Q as Ke,U as Sb,V as yb,W as Nc,X as Mc,Y as Eb,Z as wb,_ as Pb,$ as He,a0 as _b,a1 as Tb,a2 as Ob,a3 as Lo,a4 as Fo,a5 as Db,a6 as xb,a7 as Ib,a8 as Pr,a9 as wn,aa as Nb,ab as Mb,ac as Lb,ad as Ie,ae as Fb,af as Ao,ag as Ab,ah as Lc,ai as Fc,aj as Ro,ak as jo,al as Ac,am as Rc,an as jc,f as Rb,ao as kc,ap as jb,aq as kb,ar as ko,as as fa,at as $b,au as $c,av as ye,aw as Ub,ax as Hb,ay as Vb,az as Uc,aA as ja,aB as Hc,aC as Vc,aD as vt,aE as Bb,aF as Ot,aG as Bc,aH as Tn,aI as Wc,aJ as Gc,aK as Wb,aL as Gb,I as _r,aM as zc,aN as zb,aO as Kb,aP as qb,aQ as Yb,aR as Xb,aS as Zb,aT as Qb,aU as Jb,aV as eC,aW as tC,aX as nC,aY as rC,aZ as iC,a_ as aC,a$ as Yt,b as ka,b0 as sC,b1 as oC,b2 as Kc,b3 as lC,b4 as dC,b5 as qc,b6 as uC,b7 as Xe,b8 as hC,b9 as cC,ba as vC,bb as fC,bc as pC,bd as mC,be as gC,bf as bC,bg as CC,bh as SC,bi as aa,bj as yC,bk as EC,bl as wC,bm as PC,bn as ai,bo as _C,bp as TC,bq as OC,br as Zr,bs as DC}from"./useUser-8a9c44b4.js";import{u as qM,a as YM}from"./useUser-8a9c44b4.js";import{c as bs,P as $o,b as xC,h as IC,p as NC,o as MC,s as LC,t as FC}from"./plotly-33051b85.js";import{e as Uo,l as ki,K as si,a as Yc}from"./monaco-0b69f16f.js";import"./helpers-de833af9.js";function Tr(r){var e=r;r instanceof CustomEvent&&(e=r.detail);var t="";if(e instanceof Error?t=e.message:e!=null&&(t="".concat(e)),t=t.trim(),t.length>0)return t}var Xc=24,AC=32,RC=33,jC=150,Vs=200,Zc=500,Qc=250,kC={spellCheck:!1},$C=["ariaLabel","icon","isQuiet","labelText","children","onOpenChange","tooltip"];function ed(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,n)}return t}function td(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?ed(Object(t),!0).forEach(function(n){UC(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):ed(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function UC(r,e,t){return e=HC(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function HC(r){var e=VC(r,"string");return typeof e=="symbol"?e:String(e)}function VC(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}function BC(r,e){if(r==null)return{};var t=WC(r,e),n,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(r);for(i=0;i<a.length;i++)n=a[i],!(e.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(r,n)&&(t[n]=r[n])}return t}function WC(r,e){if(r==null)return{};var t={},n=Object.keys(r),i,a;for(a=0;a<n.length;a++)i=n[a],!(e.indexOf(i)>=0)&&(t[i]=r[i]);return t}function Jc(r){var{ariaLabel:e,icon:t,isQuiet:n,labelText:i,children:a,onOpenChange:s,tooltip:o}=r,l=BC(r,$C),d=i==null&&o!=null?"action-button-icon-with-tooltip":void 0;return u.jsxs(Im,{type:"popover",onOpenChange:s,children:[u.jsxs(lc,td(td({},l),{},{"aria-label":e??i,isQuiet:n,children:[u.jsx(Po,{UNSAFE_className:d,children:u.jsx(ne,{icon:t})}),i==null?null:u.jsx(dc,{children:i}),o==null?null:u.jsx(wt,{children:o})]})),a]})}function GC(r,e){return r===0?0:e==="all"||r===e.size?"all":e.size}function ev(r,e){return r===e?!0:r==="all"||e==="all"||r.size!==e.size?!1:[...r.keys()].every(t=>e.has(t))}function tv(r,e){return r.isInverted===e.isInverted&&ev(r.selection,e.selection)}function nv(r,e,t){if(r==="all")return"all";var n=[...r.keys()];return new Set(n.map(i=>t(e(i))))}function rv(r,e){var t=r==="all"||r.size>e/2,n=r;return t&&(n=r==="all"?new Set:new Set([...ab(0,e-1)].filter(i=>!r.has(String(i))).map(i=>String(i)))),{selection:n,isInverted:t}}function zC(r,e){return r?{}:{errorMessage:e,validationState:"invalid"}}function iv(r){var e;return(e=r==null?void 0:r.UNSAFE_getDOMNode())!==null&&e!==void 0?e:null}function KC(r){var e=r==null?void 0:r.UNSAFE_getDOMNode().lastElementChild;return av(e)}function qC(r){var e=r==null?void 0:r.UNSAFE_getDOMNode(),t=e==null?void 0:e.querySelector("input"),n=t==null?void 0:t.getAttribute("aria-controls"),i=n==null?null:document.getElementById(n);return i}function av(r){return r instanceof HTMLElement?r:null}function Ho(){var r=v.useRef(!1);return v.useEffect(()=>(r.current=!0,()=>{r.current=!1}),[]),r}function nd(r,e,t,n,i,a,s){try{var o=r[a](s),l=o.value}catch(d){t(d);return}o.done?e(l):Promise.resolve(l).then(n,i)}function YC(r){return function(){var e=this,t=arguments;return new Promise(function(n,i){var a=r.apply(e,t);function s(l){nd(a,n,i,s,o,"next",l)}function o(l){nd(a,n,i,s,o,"throw",l)}s(void 0)})}}var XC=B.module("useAsyncInterval");function sv(r,e){var t=Ho(),n=v.useRef(0),i=v.useRef(0),a=v.useRef(null),s=v.useCallback(YC(function*(){var o=Date.now();i.current+=1;var l=a.current==null?e:o-a.current;a.current=o;try{yield r()}catch(c){XC.error("A tick error occurred:",c)}if(t.current){l+=Date.now()-a.current;var d=Math.max(0,l-e),h=Math.max(0,e-d);n.current=window.setTimeout(s,h)}}),[r,t,e]);v.useEffect(()=>(a.current=null,s(),()=>{window.clearTimeout(n.current)}),[e,s])}function ZC(r,e){return v.useCallback(function(){var t=r(...arguments);return e(),t},[e,r])}function pa(r,e){var t=v.useMemo(()=>Le(r,e),[r,e]);return v.useEffect(()=>()=>t.cancel(),[t]),t}function QC(r){var[e,t]=v.useState(r);return v.useEffect(()=>{t(r)},[r]),[e,t]}function JC(r,e,t,n){var i=v.useRef(0);v.useEffect(()=>{i.current>=t||n&&(i.current+=1,r())},[t,n,...e])}function ov(r,e){var t=v.useRef(r),n=e(t.current,r)?t.current:r;return t.current=n,n}function eS(r){r.preventDefault()}function lv(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,e=v.useMemo(()=>"useSubmitButtonRef-".concat(Ee()),[]),t=v.useCallback(a=>{a==null||a.UNSAFE_getDOMNode().setAttribute("form",e)},[e]),n=v.useMemo(()=>({id:e,onSubmit:r?void 0:eS}),[e,r]),i=v.useMemo(()=>({form:e,ref:t}),[e,t]);return{formProps:n,submitButtonProps:i}}function dv(r,e){return v.useCallback(t=>{typeof r=="function"?r(e(t)):r.current=e(t)},[e,r])}function uv(r,e){var{getItem:t,selectedKeys:n,items:i}=r;return v.useMemo(()=>{var{selection:a,isInverted:s}=rv(n,i.length);return{selection:nv(a,t,e),isInverted:s}},[n,i.length,t,e])}function tS(r){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:eg,t=v.useRef();return v.useEffect(()=>()=>{var n;return(n=t.current)===null||n===void 0?void 0:n.call(t)},[]),v.useCallback(n=>{var i;(i=t.current)===null||i===void 0||i.call(t);var a=e(n);a&&(a.addEventListener("scroll",r),t.current=()=>{a.removeEventListener("scroll",r),t.current=void 0})},[e,r])}function rd(r,e,t,n,i,a,s){try{var o=r[a](s),l=o.value}catch(d){t(d);return}o.done?e(l):Promise.resolve(l).then(n,i)}function nS(r){return function(){var e=this,t=arguments;return new Promise(function(n,i){var a=r.apply(e,t);function s(l){rd(a,n,i,s,o,"next",l)}function o(l){rd(a,n,i,s,o,"throw",l)}s(void 0)})}}function rS(r,e,t){var n=v.useRef(null),[i,a]=v.useState(null),s=v.useCallback(nS(function*(){if(!(i==null||t==null)){var l=yield t();i.scroll(0,l)}}),[t,i]);v.useEffect(()=>(i==null||i.addEventListener("scroll",e),s(),()=>{i==null||i.removeEventListener("scroll",e)}),[e,i,s]);var o=v.useCallback(l=>{l&&setTimeout(()=>{a(r(n.current))},0)},[r]);return{ref:n,onOpenChange:o}}function id(r,e,t,n,i,a,s){try{var o=r[a](s),l=o.value}catch(d){t(d);return}o.done?e(l):Promise.resolve(l).then(n,i)}function iS(r){return function(){var e=this,t=arguments;return new Promise(function(n,i){var a=r.apply(e,t);function s(l){id(a,n,i,s,o,"next",l)}function o(l){id(a,n,i,s,o,"throw",l)}s(void 0)})}}function ui(r,e){var{autoLoad:t=!0}=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},[n,i]=v.useState(null),[a,s]=v.useState(null),[o,l]=v.useState(!1),d=v.useCallback(iS(function*(){l(!0);try{var h=yield r(...e);i(h),s(null)}catch(c){i(null),s(c)}finally{l(!1)}}),[r,...e]);return v.useEffect(()=>{t&&d()},[t,d]),{data:n,error:a,isError:a!=null,isLoading:o,reload:d}}function ad(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,n)}return t}function sd(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?ad(Object(t),!0).forEach(function(n){aS(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):ad(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function aS(r,e,t){return e=sS(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function sS(r){var e=oS(r,"string");return typeof e=="symbol"?e:String(e)}function oS(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}function lS(r,e,t,n){var i=arguments.length===4;return v.useCallback(a=>{var s=i?a??n:a;t(sd(sd({},r),{},{[e]:s}))},[t,r,e,i,n])}function hv(r,e){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,n=v.useRef(),i=v.useRef(0);return v.useCallback(a=>{window.clearTimeout(n.current),n.current=window.setTimeout(()=>{var s=Math.floor(a.target.scrollTop/r);i.current!==s&&(i.current=s,e(s))},t)},[t,r,e])}function Ei(r,e){var[t,n]=v.useState(!0),[i,a]=v.useState(r),[s,o]=v.useState(r),[l,d]=v.useState(e);return(r!==s||e!==l)&&(n(!0),o(r),d(e)),v.useEffect(()=>{var h=!1,c=setTimeout(()=>{h||(n(!1),a(r))},e);return()=>{h=!0,clearTimeout(c)}},[r,e]),{isDebouncing:t,value:i}}function cv(r,e){return v.useCallback(t=>{if(t!=null){var n=e==null?[t]:t.querySelectorAll(e);n.forEach(i=>{Object.entries(r).forEach(a=>{var[s,o]=a;i.setAttribute(s,o)})})}},[r,e])}function dS(r){var e=cv(kC,r);return dv(e,iv)}function vv(){var{getKey:r=fv}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},[e,t]=v.useState([]),[n,i]=v.useState(()=>new Set),a=v.useCallback(m=>b=>r(b)===m,[r]),s=v.useCallback(m=>{var b;return(b=e.find(a(m)))!==null&&b!==void 0?b:null},[e,a]),o=v.useCallback(m=>{var b=s(m);if(b==null)throw new Error("No item found matching key: ".concat(m));return b},[s]),l=v.useCallback(m=>{t(b=>[...b,...m])},[]),d=v.useCallback((m,b)=>{t(g=>[...g.slice(0,m),...b,...g.slice(m)])},[]),h=v.useCallback(m=>{var b=new Set(m);t(g=>g.filter(C=>!b.has(r(C))))},[r]),c=v.useCallback((m,b)=>{var g=e.findIndex(a(m));g!==-1&&t(C=>[...C.slice(0,g),b,...C.slice(g+1)])},[e,a]),f=v.useCallback(m=>{if(m.size!==0){var b=[],g=new Map;for(var C of m.keys()){var y=e.findIndex(a(C));b.push(y),g.set(y,C)}b.sort((w,E)=>w-E);var S=[];e.forEach((w,E)=>{if(b[0]===E){var x=g.get(b.shift()),D=m.get(x);S.push(D)}else S.push(w)}),t(S)}},[e,a]),p=v.useMemo(()=>({items:e,selectedKeys:n,append:l,bulkUpdate:f,findItem:s,getItem:o,insert:d,remove:h,setItems:t,setSelectedKeys:i,update:c}),[l,f,s,o,d,e,h,t,n,c]);return p}function fv(r){var e=r!=null&&typeof r=="object"&&"key"in r;if(!e)throw new Error("Item does not have a `key` prop.");return r.key}function Vo(r,e){v.useEffect(()=>{if(r!=null){var t=new window.ResizeObserver(e);return t.observe(r),()=>{r!=null&&t.unobserve(r)}}},[r,e])}const uS=Object.freeze(Object.defineProperty({__proto__:null,createValidationProps:zC,defaultGetKey:fv,extractSpectrumHTMLElement:iv,extractSpectrumLastChildHTMLElement:KC,findSpectrumComboBoxScrollArea:qC,getSelectedItemCountOrAll:GC,identityExtractHTMLElement:av,isSelectionEqual:ev,isSelectionMaybeInvertedEqual:tv,mapSelection:nv,optimizeSelection:rv,useAsyncInterval:sv,useCallbackWithAction:ZC,useContextOrThrow:Ar,useCopyToClipboard:sb,useDebouncedCallback:pa,useDebouncedValue:Ei,useDependentState:QC,useEffectNTimesWhen:JC,useFormWithDetachedSubmitButton:lv,useForwardedRef:ob,useIsEqualMemo:ov,useIsMountedRef:Ho,useMappedRef:dv,useMappedSelection:uv,useOnScrollOffsetChangeCallback:hv,useOnScrollRef:tS,usePopoverOnScrollRef:rS,usePrevious:Tc,usePromiseFactory:ui,usePropChangeCallback:lS,useResizeObserver:Vo,useSetAttributesCallback:cv,useSpectrumDisableSpellcheckRef:dS,useWindowedListData:vv},Symbol.toStringTag,{value:"Module"})),hS="_spectrumActionBar_tmmkp_5",cS="_spectrumDialogComponentHeading_tmmkp_9",vS="_spectrumEllipsis_tmmkp_14",Bo={spectrumActionBar:hS,spectrumDialogComponentHeading:cS,spectrumEllipsis:vS};function od(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,n)}return t}function $i(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?od(Object(t),!0).forEach(function(n){fS(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):od(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function fS(r,e,t){return e=pS(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function pS(r){var e=mS(r,"string");return typeof e=="symbol"?e:String(e)}function mS(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}function pv(r){var{heading:e,confirmationButtonLabel:t,children:n,onCancel:i,onConfirm:a}=r,{formProps:s,submitButtonProps:o}=lv();return u.jsxs(Nm,{children:[u.jsx(uc,{level:3,UNSAFE_className:Bo.spectrumDialogComponentHeading,children:e}),u.jsx(Mm,{}),u.jsx(hc,{children:u.jsx(Lm,$i($i({},s),{},{children:n}))}),u.jsxs(Fm,{children:[u.jsx(Kl,{variant:"secondary",onPress:i,children:"Cancel"}),u.jsx(Kl,$i($i({},o),{},{style:"fill",variant:"negative",onPress:a,type:"submit",children:t}))]})]})}function gS(r){var{ariaLabel:e,heading:t,confirmationButtonLabel:n,isHidden:i,children:a,tooltip:s,onConfirm:o}=r,l=v.useCallback(d=>u.jsx(pv,{heading:t,confirmationButtonLabel:n,onCancel:d,onConfirm:()=>{d(),o()},children:a}),[a,n,t,o]);return u.jsx(Jc,{ariaLabel:e,icon:Wn,isHidden:i,isQuiet:!0,height:Xc,tooltip:s,children:l})}var bS=["icon","label","tooltip"];function ld(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,n)}return t}function dd(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?ld(Object(t),!0).forEach(function(n){CS(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):ld(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function CS(r,e,t){return e=SS(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function SS(r){var e=yS(r,"string");return typeof e=="symbol"?e:String(e)}function yS(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}function ES(r,e){if(r==null)return{};var t=wS(r,e),n,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(r);for(i=0;i<a.length;i++)n=a[i],!(e.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(r,n)&&(t[n]=r[n])}return t}function wS(r,e){if(r==null)return{};var t={},n=Object.keys(r),i,a;for(a=0;a<n.length;a++)i=n[a],!(e.indexOf(i)>=0)&&(t[i]=r[i]);return t}function mv(r){var{icon:e,label:t,tooltip:n}=r,i=ES(r,bS);return u.jsxs(lc,dd(dd({},i),{},{"aria-label":t,isQuiet:!0,height:Xc,children:[u.jsx(Po,{UNSAFE_className:n==null?void 0:"action-button-icon-with-tooltip",children:u.jsx(ne,{icon:e})}),n==null?null:u.jsx(wt,{children:n})]}))}mv.displayName="IconActionButton";function ud(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,n)}return t}function PS(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?ud(Object(t),!0).forEach(function(n){Qt(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):ud(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function Qt(r,e,t){return e=_S(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function _S(r){var e=TS(r,"string");return typeof e=="symbol"?e:String(e)}function TS(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}var OS=100,Bs;(function(r){r.UP="UP",r.DOWN="DOWN"})(Bs||(Bs={}));class It extends v.Component{constructor(e){super(e),Qt(this,"popper",void 0),Qt(this,"cbContainer",void 0),Qt(this,"menuContainer",void 0),Qt(this,"input",void 0),Qt(this,"getCachedFilteredOptions",ot((n,i)=>n.filter(a=>a.title.toLowerCase().indexOf(i.toLowerCase())>=0)));var{popperOptions:t}=this.props;t=PS({placement:"bottom-end",modifiers:{preventOverflow:{enabled:!1}}},t),this.state={title:"",filteredOptions:[],keyboardOptionIndex:0,menuIsOpen:!1,inputWidth:100,invalid:!1,popperOptions:t},this.handleMenuKeyDown=this.handleMenuKeyDown.bind(this),this.handleMenuBlur=this.handleMenuBlur.bind(this),this.handleInputChange=this.handleInputChange.bind(this),this.handleInputKeyDown=this.handleInputKeyDown.bind(this),this.handleInputBlur=this.handleInputBlur.bind(this),this.handelInputFocus=this.handelInputFocus.bind(this),this.handleInputClick=this.handleInputClick.bind(this),this.updateInputValue=Le(this.updateInputValue,OS),this.handleOptionClick=this.handleOptionClick.bind(this),this.handleMenuOpened=this.handleMenuOpened.bind(this),this.handleMenuExited=this.handleMenuExited.bind(this),this.popper=X.createRef(),this.cbContainer=X.createRef(),this.menuContainer=X.createRef(),this.input=X.createRef()}setInputWidth(){this.cbContainer.current&&this.setState({inputWidth:this.cbContainer.current.getBoundingClientRect().width})}getValueAndValidate(e){if(!e)return this.setState({invalid:!1}),{value:e,isValid:!1};var{options:t}=this.props,n=t.filter(i=>i.title.toLowerCase()===e.toLowerCase());return n.length<1?(this.setState({invalid:!0}),{value:e,isValid:!1}):(this.setState({invalid:!1}),{value:n[0].value,isValid:!0})}updateInputValue(e){var{menuIsOpen:t}=this.state,{value:n,isValid:i}=this.getValueAndValidate(e);t&&this.processFilterChange(e),this.fireOnChange(n,i)}fireOnChange(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,{onChange:n}=this.props;n(e,t)}processFilterChange(e){var t,{options:n}=this.props,{menuIsOpen:i}=this.state,a=e?this.getCachedFilteredOptions(n,e):n,s=a.length===1&&a[0].title===e;if(this.setState({filteredOptions:a,keyboardOptionIndex:0}),s&&i){this.closeMenu();return}(t=this.popper.current)===null||t===void 0||t.scheduleUpdate()}resetValue(){this.setState({title:""}),this.fireOnChange("")}handleResize(){this.setInputWidth()}handleMenuKeyDown(e){var t,{filteredOptions:n,keyboardOptionIndex:i}=this.state,a=n[i];switch(e.key){case"Enter":case"ArrowRight":e.stopPropagation(),e.preventDefault(),a!=null&&(this.setState({title:a.title,invalid:!1}),this.fireOnChange(a.value)),this.closeMenu(),(t=this.input.current)===null||t===void 0||t.focus();break;case"ArrowUp":e.stopPropagation(),e.preventDefault(),this.navigateMenu(It.MENU_NAVIGATION_DIRECTION.UP);break;case"ArrowDown":e.stopPropagation(),e.preventDefault(),this.navigateMenu(It.MENU_NAVIGATION_DIRECTION.DOWN);break;case"Tab":if(e.stopPropagation(),e.preventDefault(),e.shiftKey){this.navigateMenu(It.MENU_NAVIGATION_DIRECTION.UP);break}this.navigateMenu(It.MENU_NAVIGATION_DIRECTION.DOWN);break;case"Escape":e.preventDefault(),e.stopPropagation(),this.closeMenu();break}}navigateMenu(e){var{filteredOptions:t,keyboardOptionIndex:n}=this.state,i=n;e===It.MENU_NAVIGATION_DIRECTION.UP?n>0?(i=(i-1)%t.length,this.setState({keyboardOptionIndex:i})):n===0&&(i=t.length-1,this.setState({keyboardOptionIndex:i})):e===It.MENU_NAVIGATION_DIRECTION.DOWN&&n<t.length&&(i=(i+1)%t.length,this.setState({keyboardOptionIndex:i})),this.scrollOptionIntoView(i)}handleInputKeyDown(e){var{onEnter:t}=this.props,{menuIsOpen:n}=this.state;n?this.handleMenuKeyDown(e):e.key==="Enter"?t():e.key==="Escape"?(this.resetValue(),e.preventDefault(),e.stopPropagation()):e.key==="ArrowRight"||e.key==="ArrowLeft"||e.key==="Tab"||e.key==="Shift"||this.openMenu()}handleInputChange(e){this.setState({title:e.target.value}),this.updateInputValue(e.target.value)}handleOptionClick(e){var t;this.setState({title:e.title,invalid:!1}),this.fireOnChange(e.value),this.closeMenu(),(t=this.input.current)===null||t===void 0||t.focus()}handelInputFocus(){var{menuIsOpen:e}=this.state;e||this.openMenu()}handleInputClick(){var{menuIsOpen:e}=this.state;e||this.openMenu()}handleInputBlur(e){var{menuIsOpen:t}=this.state;t&&e.relatedTarget instanceof Element&&this.popper.current!==null&&this.popper.current.element.contains(e.relatedTarget)||this.closeMenu(!1)}handleMenuBlur(e){e.relatedTarget===this.input.current||e.relatedTarget instanceof Element&&this.popper.current!==null&&this.popper.current.element.contains(e.relatedTarget)||this.closeMenu(!1)}handleMenuOpened(){var e;(e=this.input.current)===null||e===void 0||e.focus()}handleMenuExited(){var{menuIsOpen:e}=this.state;e&&this.setState({menuIsOpen:!1,keyboardOptionIndex:0})}openMenu(){var{title:e}=this.state;this.processFilterChange(e),this.setInputWidth(),this.setState({menuIsOpen:!0}),window.requestAnimationFrame(()=>{var t;(t=this.popper.current)===null||t===void 0||t.show()})}closeMenu(){var e,t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;if(this.setState({menuIsOpen:!1,keyboardOptionIndex:0}),t){var n;(n=this.input.current)===null||n===void 0||n.focus()}(e=this.popper.current)===null||e===void 0||e.hide()}scrollOptionIntoView(e){if(this.menuContainer.current){var t;(t=this.menuContainer.current.children.item(e))===null||t===void 0||t.scrollIntoView({behavior:"smooth",block:"nearest"})}}renderMenuElement(){var{inputWidth:e}=this.state;return u.jsx("div",{className:Y("aci-options"),ref:this.menuContainer,role:"presentation",onKeyDown:this.handleMenuKeyDown,style:{width:e},onBlur:this.handleMenuBlur,children:this.renderOptions()})}renderOptions(){var{noMatchText:e}=this.props,{title:t,filteredOptions:n}=this.state;return t&&n.length===0?u.jsx("div",{className:"no-match",children:e}):n.map((i,a)=>this.renderOption(i,a))}renderOption(e,t){var{keyboardOptionIndex:n}=this.state,i="option-".concat(t,"-").concat(e.value);return u.jsx("button",{type:"button",className:Y("aci-option-btn",{"keyboard-active":n===t}),onClick:()=>this.handleOptionClick(e),onFocus:()=>this.setState({keyboardOptionIndex:t}),children:e.title},i)}render(){var{options:e,inputPlaceholder:t,disabled:n,className:i,defaultTitle:a,spellCheck:s,"data-testid":o}=this.props,{title:l,menuIsOpen:d,popperOptions:h,invalid:c}=this.state;return u.jsxs("div",{className:"aci-container",ref:this.cbContainer,children:[u.jsx("input",{value:l||a,className:Y("form-control",i,"aci-input",{"is-invalid":c&&!d}),ref:this.input,onChange:this.handleInputChange,placeholder:t||e[0].title,disabled:n,onFocus:this.handelInputFocus,onClick:this.handleInputClick,onBlur:this.handleInputBlur,onKeyDown:this.handleInputKeyDown,spellCheck:s,"data-testid":o}),u.jsx(Si,{ref:this.popper,options:h,className:Y("aci-options-popper interactive"),onEntered:this.handleMenuOpened,onExited:this.handleMenuExited,children:this.renderMenuElement()})]})}}Qt(It,"propTypes",{options:_.arrayOf(_.shape({title:_.string.isRequired,value:_.string.isRequired})).isRequired,popperOptions:_.shape({}),onChange:_.func,inputPlaceholder:_.string,disabled:_.bool,className:_.string,defaultTitle:_.string,spellCheck:_.bool,onEnter:_.func,noMatchText:_.string,"data-testid":_.string});Qt(It,"defaultProps",{onChange(){},inputPlaceholder:"",disabled:!1,className:"",defaultTitle:"",popperOptions:null,spellCheck:!0,onEnter(){},noMatchText:"No matching items found","data-testid":void 0});Qt(It,"MENU_NAVIGATION_DIRECTION",Bs);const DS=It;function Wo(r){var{className:e="",value:t,onChange:n,spellCheck:i=!1,placeholder:a="",disabled:s=!1,delimiter:o="",id:l="","data-testid":d}=r,[h,c]=v.useState(t),[f,p]=v.useState(!1),m=v.useRef(null);v.useEffect(function(){c(t)},[t]);function b(D){return D.trim().split(o).filter(T=>T).join(`
|
|
1
|
+
import{C as u,$ as Im,H as lc,I as Po,F as ne,J as dc,r as v,K as Le,L as Ee,M as Nm,N as uc,O as Mm,P as hc,Q as Lm,S as Fm,T as Kl,U as ot,G as X,E as Y,V as _,W as Am,D as Hn,X as ar,Y as Rm,Z as jm,_ as km,a0 as $m,a1 as cc,a2 as Um,a3 as Hm,a4 as yr,a5 as vc,a6 as Mt,a7 as se,a8 as Z,R as Ma,a9 as ql,aa as Vm,ab as _o,ac as Bm,ad as Wm,ae as Gm,af as zm,ag as mi,ah as fc,ai as gi,aj as Km,ak as ii,al as Pt,am as pc,an as qm,ao as Ym,ap as Xm,aq as Zm,ar as Qm,as as Jm,at as mc}from"./vendor-70ada314.js";import{L as B,i as eg,v as Wn,M as bi,b as Ci,c as La,d as hr,e as tg,a as tt,f as To,g as ng,h as rg,r as Oo,j as G,k as ig,l as ag,m as sg,T as Vn,C as og,D as lg,n as dg,o as ug,p as hg,q as Fa,N as cg,S as vg,s as fg,t as pg,W as mg,u as gg,w as bg,x as Cg,y as Sg,z as yg,A as Eg,B as gc,E as bc,F as wg,G as Pg,H as _g,I as Tg,J as Og,K as Dg,O as xg,P as Ig,Q as Aa,R as Ng,U as Cc,V as Yl,X as Mg,Y as Lg,Z as Fg,_ as Sc,$ as Do,a0 as xo,a1 as sr,a2 as Ag,a3 as Xl,a4 as Rg,a5 as jg,a6 as kg,a7 as $g,a8 as Io,a9 as yc,aa as $s,ab as Ug,ac as Hg,ad as Zl,ae as ha,af as Ql,ag as Ec,ah as Vg,ai as Ra,aj as Bg,ak as Wg,al as Gg,am as zg,an as Kg,ao as qg,ap as Yg,aq as wc,ar as Xg,as as Pc,at as _c,au as Jl,av as Zg,aw as Qg,ax as Jg,ay as eb,az as tb,aA as nb,aB as rb,aC as ib}from"./index-6c2264c4.js";import{T as wt,g as ab,c as Ar,d as sb,e as ob,h as Tc,P as Si,B as K,i as cr,M as No,D as Oc,j as En,k as lb,S as yi,R as ca,l as Er,m as va,n as ae,o as Us,p as Rr,q as db,r as ub,s as hb,C as Dc,t as Mo,v as cb,w as vb,G as wr,x as fb,K as fe,y as pe,z as pb,A as mb,O as gb,E as bb,F as xc,H as Hs,J as Bn,L as Ic,N as Cb,Q as Ke,U as Sb,V as yb,W as Nc,X as Mc,Y as Eb,Z as wb,_ as Pb,$ as He,a0 as _b,a1 as Tb,a2 as Ob,a3 as Lo,a4 as Fo,a5 as Db,a6 as xb,a7 as Ib,a8 as Pr,a9 as wn,aa as Nb,ab as Mb,ac as Lb,ad as Ie,ae as Fb,af as Ao,ag as Ab,ah as Lc,ai as Fc,aj as Ro,ak as jo,al as Ac,am as Rc,an as jc,f as Rb,ao as kc,ap as jb,aq as kb,ar as ko,as as fa,at as $b,au as $c,av as ye,aw as Ub,ax as Hb,ay as Vb,az as Uc,aA as ja,aB as Hc,aC as Vc,aD as vt,aE as Bb,aF as Ot,aG as Bc,aH as Tn,aI as Wc,aJ as Gc,aK as Wb,aL as Gb,I as _r,aM as zc,aN as zb,aO as Kb,aP as qb,aQ as Yb,aR as Xb,aS as Zb,aT as Qb,aU as Jb,aV as eC,aW as tC,aX as nC,aY as rC,aZ as iC,a_ as aC,a$ as Yt,b as ka,b0 as sC,b1 as oC,b2 as Kc,b3 as lC,b4 as dC,b5 as qc,b6 as uC,b7 as Xe,b8 as hC,b9 as cC,ba as vC,bb as fC,bc as pC,bd as mC,be as gC,bf as bC,bg as CC,bh as SC,bi as aa,bj as yC,bk as EC,bl as wC,bm as PC,bn as ai,bo as _C,bp as TC,bq as OC,br as Zr,bs as DC}from"./useUser-5f3a0f4f.js";import{u as qM,a as YM}from"./useUser-5f3a0f4f.js";import{c as bs,P as $o,b as xC,h as IC,p as NC,o as MC,s as LC,t as FC}from"./plotly-bfbd68da.js";import{e as Uo,l as ki,K as si,a as Yc}from"./monaco-0b69f16f.js";import"./helpers-de833af9.js";function Tr(r){var e=r;r instanceof CustomEvent&&(e=r.detail);var t="";if(e instanceof Error?t=e.message:e!=null&&(t="".concat(e)),t=t.trim(),t.length>0)return t}var Xc=24,AC=32,RC=33,jC=150,Vs=200,Zc=500,Qc=250,kC={spellCheck:!1},$C=["ariaLabel","icon","isQuiet","labelText","children","onOpenChange","tooltip"];function ed(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,n)}return t}function td(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?ed(Object(t),!0).forEach(function(n){UC(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):ed(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function UC(r,e,t){return e=HC(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function HC(r){var e=VC(r,"string");return typeof e=="symbol"?e:String(e)}function VC(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}function BC(r,e){if(r==null)return{};var t=WC(r,e),n,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(r);for(i=0;i<a.length;i++)n=a[i],!(e.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(r,n)&&(t[n]=r[n])}return t}function WC(r,e){if(r==null)return{};var t={},n=Object.keys(r),i,a;for(a=0;a<n.length;a++)i=n[a],!(e.indexOf(i)>=0)&&(t[i]=r[i]);return t}function Jc(r){var{ariaLabel:e,icon:t,isQuiet:n,labelText:i,children:a,onOpenChange:s,tooltip:o}=r,l=BC(r,$C),d=i==null&&o!=null?"action-button-icon-with-tooltip":void 0;return u.jsxs(Im,{type:"popover",onOpenChange:s,children:[u.jsxs(lc,td(td({},l),{},{"aria-label":e??i,isQuiet:n,children:[u.jsx(Po,{UNSAFE_className:d,children:u.jsx(ne,{icon:t})}),i==null?null:u.jsx(dc,{children:i}),o==null?null:u.jsx(wt,{children:o})]})),a]})}function GC(r,e){return r===0?0:e==="all"||r===e.size?"all":e.size}function ev(r,e){return r===e?!0:r==="all"||e==="all"||r.size!==e.size?!1:[...r.keys()].every(t=>e.has(t))}function tv(r,e){return r.isInverted===e.isInverted&&ev(r.selection,e.selection)}function nv(r,e,t){if(r==="all")return"all";var n=[...r.keys()];return new Set(n.map(i=>t(e(i))))}function rv(r,e){var t=r==="all"||r.size>e/2,n=r;return t&&(n=r==="all"?new Set:new Set([...ab(0,e-1)].filter(i=>!r.has(String(i))).map(i=>String(i)))),{selection:n,isInverted:t}}function zC(r,e){return r?{}:{errorMessage:e,validationState:"invalid"}}function iv(r){var e;return(e=r==null?void 0:r.UNSAFE_getDOMNode())!==null&&e!==void 0?e:null}function KC(r){var e=r==null?void 0:r.UNSAFE_getDOMNode().lastElementChild;return av(e)}function qC(r){var e=r==null?void 0:r.UNSAFE_getDOMNode(),t=e==null?void 0:e.querySelector("input"),n=t==null?void 0:t.getAttribute("aria-controls"),i=n==null?null:document.getElementById(n);return i}function av(r){return r instanceof HTMLElement?r:null}function Ho(){var r=v.useRef(!1);return v.useEffect(()=>(r.current=!0,()=>{r.current=!1}),[]),r}function nd(r,e,t,n,i,a,s){try{var o=r[a](s),l=o.value}catch(d){t(d);return}o.done?e(l):Promise.resolve(l).then(n,i)}function YC(r){return function(){var e=this,t=arguments;return new Promise(function(n,i){var a=r.apply(e,t);function s(l){nd(a,n,i,s,o,"next",l)}function o(l){nd(a,n,i,s,o,"throw",l)}s(void 0)})}}var XC=B.module("useAsyncInterval");function sv(r,e){var t=Ho(),n=v.useRef(0),i=v.useRef(0),a=v.useRef(null),s=v.useCallback(YC(function*(){var o=Date.now();i.current+=1;var l=a.current==null?e:o-a.current;a.current=o;try{yield r()}catch(c){XC.error("A tick error occurred:",c)}if(t.current){l+=Date.now()-a.current;var d=Math.max(0,l-e),h=Math.max(0,e-d);n.current=window.setTimeout(s,h)}}),[r,t,e]);v.useEffect(()=>(a.current=null,s(),()=>{window.clearTimeout(n.current)}),[e,s])}function ZC(r,e){return v.useCallback(function(){var t=r(...arguments);return e(),t},[e,r])}function pa(r,e){var t=v.useMemo(()=>Le(r,e),[r,e]);return v.useEffect(()=>()=>t.cancel(),[t]),t}function QC(r){var[e,t]=v.useState(r);return v.useEffect(()=>{t(r)},[r]),[e,t]}function JC(r,e,t,n){var i=v.useRef(0);v.useEffect(()=>{i.current>=t||n&&(i.current+=1,r())},[t,n,...e])}function ov(r,e){var t=v.useRef(r),n=e(t.current,r)?t.current:r;return t.current=n,n}function eS(r){r.preventDefault()}function lv(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,e=v.useMemo(()=>"useSubmitButtonRef-".concat(Ee()),[]),t=v.useCallback(a=>{a==null||a.UNSAFE_getDOMNode().setAttribute("form",e)},[e]),n=v.useMemo(()=>({id:e,onSubmit:r?void 0:eS}),[e,r]),i=v.useMemo(()=>({form:e,ref:t}),[e,t]);return{formProps:n,submitButtonProps:i}}function dv(r,e){return v.useCallback(t=>{typeof r=="function"?r(e(t)):r.current=e(t)},[e,r])}function uv(r,e){var{getItem:t,selectedKeys:n,items:i}=r;return v.useMemo(()=>{var{selection:a,isInverted:s}=rv(n,i.length);return{selection:nv(a,t,e),isInverted:s}},[n,i.length,t,e])}function tS(r){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:eg,t=v.useRef();return v.useEffect(()=>()=>{var n;return(n=t.current)===null||n===void 0?void 0:n.call(t)},[]),v.useCallback(n=>{var i;(i=t.current)===null||i===void 0||i.call(t);var a=e(n);a&&(a.addEventListener("scroll",r),t.current=()=>{a.removeEventListener("scroll",r),t.current=void 0})},[e,r])}function rd(r,e,t,n,i,a,s){try{var o=r[a](s),l=o.value}catch(d){t(d);return}o.done?e(l):Promise.resolve(l).then(n,i)}function nS(r){return function(){var e=this,t=arguments;return new Promise(function(n,i){var a=r.apply(e,t);function s(l){rd(a,n,i,s,o,"next",l)}function o(l){rd(a,n,i,s,o,"throw",l)}s(void 0)})}}function rS(r,e,t){var n=v.useRef(null),[i,a]=v.useState(null),s=v.useCallback(nS(function*(){if(!(i==null||t==null)){var l=yield t();i.scroll(0,l)}}),[t,i]);v.useEffect(()=>(i==null||i.addEventListener("scroll",e),s(),()=>{i==null||i.removeEventListener("scroll",e)}),[e,i,s]);var o=v.useCallback(l=>{l&&setTimeout(()=>{a(r(n.current))},0)},[r]);return{ref:n,onOpenChange:o}}function id(r,e,t,n,i,a,s){try{var o=r[a](s),l=o.value}catch(d){t(d);return}o.done?e(l):Promise.resolve(l).then(n,i)}function iS(r){return function(){var e=this,t=arguments;return new Promise(function(n,i){var a=r.apply(e,t);function s(l){id(a,n,i,s,o,"next",l)}function o(l){id(a,n,i,s,o,"throw",l)}s(void 0)})}}function ui(r,e){var{autoLoad:t=!0}=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},[n,i]=v.useState(null),[a,s]=v.useState(null),[o,l]=v.useState(!1),d=v.useCallback(iS(function*(){l(!0);try{var h=yield r(...e);i(h),s(null)}catch(c){i(null),s(c)}finally{l(!1)}}),[r,...e]);return v.useEffect(()=>{t&&d()},[t,d]),{data:n,error:a,isError:a!=null,isLoading:o,reload:d}}function ad(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,n)}return t}function sd(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?ad(Object(t),!0).forEach(function(n){aS(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):ad(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function aS(r,e,t){return e=sS(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function sS(r){var e=oS(r,"string");return typeof e=="symbol"?e:String(e)}function oS(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}function lS(r,e,t,n){var i=arguments.length===4;return v.useCallback(a=>{var s=i?a??n:a;t(sd(sd({},r),{},{[e]:s}))},[t,r,e,i,n])}function hv(r,e){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,n=v.useRef(),i=v.useRef(0);return v.useCallback(a=>{window.clearTimeout(n.current),n.current=window.setTimeout(()=>{var s=Math.floor(a.target.scrollTop/r);i.current!==s&&(i.current=s,e(s))},t)},[t,r,e])}function Ei(r,e){var[t,n]=v.useState(!0),[i,a]=v.useState(r),[s,o]=v.useState(r),[l,d]=v.useState(e);return(r!==s||e!==l)&&(n(!0),o(r),d(e)),v.useEffect(()=>{var h=!1,c=setTimeout(()=>{h||(n(!1),a(r))},e);return()=>{h=!0,clearTimeout(c)}},[r,e]),{isDebouncing:t,value:i}}function cv(r,e){return v.useCallback(t=>{if(t!=null){var n=e==null?[t]:t.querySelectorAll(e);n.forEach(i=>{Object.entries(r).forEach(a=>{var[s,o]=a;i.setAttribute(s,o)})})}},[r,e])}function dS(r){var e=cv(kC,r);return dv(e,iv)}function vv(){var{getKey:r=fv}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},[e,t]=v.useState([]),[n,i]=v.useState(()=>new Set),a=v.useCallback(m=>b=>r(b)===m,[r]),s=v.useCallback(m=>{var b;return(b=e.find(a(m)))!==null&&b!==void 0?b:null},[e,a]),o=v.useCallback(m=>{var b=s(m);if(b==null)throw new Error("No item found matching key: ".concat(m));return b},[s]),l=v.useCallback(m=>{t(b=>[...b,...m])},[]),d=v.useCallback((m,b)=>{t(g=>[...g.slice(0,m),...b,...g.slice(m)])},[]),h=v.useCallback(m=>{var b=new Set(m);t(g=>g.filter(C=>!b.has(r(C))))},[r]),c=v.useCallback((m,b)=>{var g=e.findIndex(a(m));g!==-1&&t(C=>[...C.slice(0,g),b,...C.slice(g+1)])},[e,a]),f=v.useCallback(m=>{if(m.size!==0){var b=[],g=new Map;for(var C of m.keys()){var y=e.findIndex(a(C));b.push(y),g.set(y,C)}b.sort((w,E)=>w-E);var S=[];e.forEach((w,E)=>{if(b[0]===E){var x=g.get(b.shift()),D=m.get(x);S.push(D)}else S.push(w)}),t(S)}},[e,a]),p=v.useMemo(()=>({items:e,selectedKeys:n,append:l,bulkUpdate:f,findItem:s,getItem:o,insert:d,remove:h,setItems:t,setSelectedKeys:i,update:c}),[l,f,s,o,d,e,h,t,n,c]);return p}function fv(r){var e=r!=null&&typeof r=="object"&&"key"in r;if(!e)throw new Error("Item does not have a `key` prop.");return r.key}function Vo(r,e){v.useEffect(()=>{if(r!=null){var t=new window.ResizeObserver(e);return t.observe(r),()=>{r!=null&&t.unobserve(r)}}},[r,e])}const uS=Object.freeze(Object.defineProperty({__proto__:null,createValidationProps:zC,defaultGetKey:fv,extractSpectrumHTMLElement:iv,extractSpectrumLastChildHTMLElement:KC,findSpectrumComboBoxScrollArea:qC,getSelectedItemCountOrAll:GC,identityExtractHTMLElement:av,isSelectionEqual:ev,isSelectionMaybeInvertedEqual:tv,mapSelection:nv,optimizeSelection:rv,useAsyncInterval:sv,useCallbackWithAction:ZC,useContextOrThrow:Ar,useCopyToClipboard:sb,useDebouncedCallback:pa,useDebouncedValue:Ei,useDependentState:QC,useEffectNTimesWhen:JC,useFormWithDetachedSubmitButton:lv,useForwardedRef:ob,useIsEqualMemo:ov,useIsMountedRef:Ho,useMappedRef:dv,useMappedSelection:uv,useOnScrollOffsetChangeCallback:hv,useOnScrollRef:tS,usePopoverOnScrollRef:rS,usePrevious:Tc,usePromiseFactory:ui,usePropChangeCallback:lS,useResizeObserver:Vo,useSetAttributesCallback:cv,useSpectrumDisableSpellcheckRef:dS,useWindowedListData:vv},Symbol.toStringTag,{value:"Module"})),hS="_spectrumActionBar_tmmkp_5",cS="_spectrumDialogComponentHeading_tmmkp_9",vS="_spectrumEllipsis_tmmkp_14",Bo={spectrumActionBar:hS,spectrumDialogComponentHeading:cS,spectrumEllipsis:vS};function od(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,n)}return t}function $i(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?od(Object(t),!0).forEach(function(n){fS(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):od(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function fS(r,e,t){return e=pS(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function pS(r){var e=mS(r,"string");return typeof e=="symbol"?e:String(e)}function mS(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}function pv(r){var{heading:e,confirmationButtonLabel:t,children:n,onCancel:i,onConfirm:a}=r,{formProps:s,submitButtonProps:o}=lv();return u.jsxs(Nm,{children:[u.jsx(uc,{level:3,UNSAFE_className:Bo.spectrumDialogComponentHeading,children:e}),u.jsx(Mm,{}),u.jsx(hc,{children:u.jsx(Lm,$i($i({},s),{},{children:n}))}),u.jsxs(Fm,{children:[u.jsx(Kl,{variant:"secondary",onPress:i,children:"Cancel"}),u.jsx(Kl,$i($i({},o),{},{style:"fill",variant:"negative",onPress:a,type:"submit",children:t}))]})]})}function gS(r){var{ariaLabel:e,heading:t,confirmationButtonLabel:n,isHidden:i,children:a,tooltip:s,onConfirm:o}=r,l=v.useCallback(d=>u.jsx(pv,{heading:t,confirmationButtonLabel:n,onCancel:d,onConfirm:()=>{d(),o()},children:a}),[a,n,t,o]);return u.jsx(Jc,{ariaLabel:e,icon:Wn,isHidden:i,isQuiet:!0,height:Xc,tooltip:s,children:l})}var bS=["icon","label","tooltip"];function ld(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,n)}return t}function dd(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?ld(Object(t),!0).forEach(function(n){CS(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):ld(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function CS(r,e,t){return e=SS(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function SS(r){var e=yS(r,"string");return typeof e=="symbol"?e:String(e)}function yS(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}function ES(r,e){if(r==null)return{};var t=wS(r,e),n,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(r);for(i=0;i<a.length;i++)n=a[i],!(e.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(r,n)&&(t[n]=r[n])}return t}function wS(r,e){if(r==null)return{};var t={},n=Object.keys(r),i,a;for(a=0;a<n.length;a++)i=n[a],!(e.indexOf(i)>=0)&&(t[i]=r[i]);return t}function mv(r){var{icon:e,label:t,tooltip:n}=r,i=ES(r,bS);return u.jsxs(lc,dd(dd({},i),{},{"aria-label":t,isQuiet:!0,height:Xc,children:[u.jsx(Po,{UNSAFE_className:n==null?void 0:"action-button-icon-with-tooltip",children:u.jsx(ne,{icon:e})}),n==null?null:u.jsx(wt,{children:n})]}))}mv.displayName="IconActionButton";function ud(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,n)}return t}function PS(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?ud(Object(t),!0).forEach(function(n){Qt(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):ud(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function Qt(r,e,t){return e=_S(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function _S(r){var e=TS(r,"string");return typeof e=="symbol"?e:String(e)}function TS(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}var OS=100,Bs;(function(r){r.UP="UP",r.DOWN="DOWN"})(Bs||(Bs={}));class It extends v.Component{constructor(e){super(e),Qt(this,"popper",void 0),Qt(this,"cbContainer",void 0),Qt(this,"menuContainer",void 0),Qt(this,"input",void 0),Qt(this,"getCachedFilteredOptions",ot((n,i)=>n.filter(a=>a.title.toLowerCase().indexOf(i.toLowerCase())>=0)));var{popperOptions:t}=this.props;t=PS({placement:"bottom-end",modifiers:{preventOverflow:{enabled:!1}}},t),this.state={title:"",filteredOptions:[],keyboardOptionIndex:0,menuIsOpen:!1,inputWidth:100,invalid:!1,popperOptions:t},this.handleMenuKeyDown=this.handleMenuKeyDown.bind(this),this.handleMenuBlur=this.handleMenuBlur.bind(this),this.handleInputChange=this.handleInputChange.bind(this),this.handleInputKeyDown=this.handleInputKeyDown.bind(this),this.handleInputBlur=this.handleInputBlur.bind(this),this.handelInputFocus=this.handelInputFocus.bind(this),this.handleInputClick=this.handleInputClick.bind(this),this.updateInputValue=Le(this.updateInputValue,OS),this.handleOptionClick=this.handleOptionClick.bind(this),this.handleMenuOpened=this.handleMenuOpened.bind(this),this.handleMenuExited=this.handleMenuExited.bind(this),this.popper=X.createRef(),this.cbContainer=X.createRef(),this.menuContainer=X.createRef(),this.input=X.createRef()}setInputWidth(){this.cbContainer.current&&this.setState({inputWidth:this.cbContainer.current.getBoundingClientRect().width})}getValueAndValidate(e){if(!e)return this.setState({invalid:!1}),{value:e,isValid:!1};var{options:t}=this.props,n=t.filter(i=>i.title.toLowerCase()===e.toLowerCase());return n.length<1?(this.setState({invalid:!0}),{value:e,isValid:!1}):(this.setState({invalid:!1}),{value:n[0].value,isValid:!0})}updateInputValue(e){var{menuIsOpen:t}=this.state,{value:n,isValid:i}=this.getValueAndValidate(e);t&&this.processFilterChange(e),this.fireOnChange(n,i)}fireOnChange(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,{onChange:n}=this.props;n(e,t)}processFilterChange(e){var t,{options:n}=this.props,{menuIsOpen:i}=this.state,a=e?this.getCachedFilteredOptions(n,e):n,s=a.length===1&&a[0].title===e;if(this.setState({filteredOptions:a,keyboardOptionIndex:0}),s&&i){this.closeMenu();return}(t=this.popper.current)===null||t===void 0||t.scheduleUpdate()}resetValue(){this.setState({title:""}),this.fireOnChange("")}handleResize(){this.setInputWidth()}handleMenuKeyDown(e){var t,{filteredOptions:n,keyboardOptionIndex:i}=this.state,a=n[i];switch(e.key){case"Enter":case"ArrowRight":e.stopPropagation(),e.preventDefault(),a!=null&&(this.setState({title:a.title,invalid:!1}),this.fireOnChange(a.value)),this.closeMenu(),(t=this.input.current)===null||t===void 0||t.focus();break;case"ArrowUp":e.stopPropagation(),e.preventDefault(),this.navigateMenu(It.MENU_NAVIGATION_DIRECTION.UP);break;case"ArrowDown":e.stopPropagation(),e.preventDefault(),this.navigateMenu(It.MENU_NAVIGATION_DIRECTION.DOWN);break;case"Tab":if(e.stopPropagation(),e.preventDefault(),e.shiftKey){this.navigateMenu(It.MENU_NAVIGATION_DIRECTION.UP);break}this.navigateMenu(It.MENU_NAVIGATION_DIRECTION.DOWN);break;case"Escape":e.preventDefault(),e.stopPropagation(),this.closeMenu();break}}navigateMenu(e){var{filteredOptions:t,keyboardOptionIndex:n}=this.state,i=n;e===It.MENU_NAVIGATION_DIRECTION.UP?n>0?(i=(i-1)%t.length,this.setState({keyboardOptionIndex:i})):n===0&&(i=t.length-1,this.setState({keyboardOptionIndex:i})):e===It.MENU_NAVIGATION_DIRECTION.DOWN&&n<t.length&&(i=(i+1)%t.length,this.setState({keyboardOptionIndex:i})),this.scrollOptionIntoView(i)}handleInputKeyDown(e){var{onEnter:t}=this.props,{menuIsOpen:n}=this.state;n?this.handleMenuKeyDown(e):e.key==="Enter"?t():e.key==="Escape"?(this.resetValue(),e.preventDefault(),e.stopPropagation()):e.key==="ArrowRight"||e.key==="ArrowLeft"||e.key==="Tab"||e.key==="Shift"||this.openMenu()}handleInputChange(e){this.setState({title:e.target.value}),this.updateInputValue(e.target.value)}handleOptionClick(e){var t;this.setState({title:e.title,invalid:!1}),this.fireOnChange(e.value),this.closeMenu(),(t=this.input.current)===null||t===void 0||t.focus()}handelInputFocus(){var{menuIsOpen:e}=this.state;e||this.openMenu()}handleInputClick(){var{menuIsOpen:e}=this.state;e||this.openMenu()}handleInputBlur(e){var{menuIsOpen:t}=this.state;t&&e.relatedTarget instanceof Element&&this.popper.current!==null&&this.popper.current.element.contains(e.relatedTarget)||this.closeMenu(!1)}handleMenuBlur(e){e.relatedTarget===this.input.current||e.relatedTarget instanceof Element&&this.popper.current!==null&&this.popper.current.element.contains(e.relatedTarget)||this.closeMenu(!1)}handleMenuOpened(){var e;(e=this.input.current)===null||e===void 0||e.focus()}handleMenuExited(){var{menuIsOpen:e}=this.state;e&&this.setState({menuIsOpen:!1,keyboardOptionIndex:0})}openMenu(){var{title:e}=this.state;this.processFilterChange(e),this.setInputWidth(),this.setState({menuIsOpen:!0}),window.requestAnimationFrame(()=>{var t;(t=this.popper.current)===null||t===void 0||t.show()})}closeMenu(){var e,t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;if(this.setState({menuIsOpen:!1,keyboardOptionIndex:0}),t){var n;(n=this.input.current)===null||n===void 0||n.focus()}(e=this.popper.current)===null||e===void 0||e.hide()}scrollOptionIntoView(e){if(this.menuContainer.current){var t;(t=this.menuContainer.current.children.item(e))===null||t===void 0||t.scrollIntoView({behavior:"smooth",block:"nearest"})}}renderMenuElement(){var{inputWidth:e}=this.state;return u.jsx("div",{className:Y("aci-options"),ref:this.menuContainer,role:"presentation",onKeyDown:this.handleMenuKeyDown,style:{width:e},onBlur:this.handleMenuBlur,children:this.renderOptions()})}renderOptions(){var{noMatchText:e}=this.props,{title:t,filteredOptions:n}=this.state;return t&&n.length===0?u.jsx("div",{className:"no-match",children:e}):n.map((i,a)=>this.renderOption(i,a))}renderOption(e,t){var{keyboardOptionIndex:n}=this.state,i="option-".concat(t,"-").concat(e.value);return u.jsx("button",{type:"button",className:Y("aci-option-btn",{"keyboard-active":n===t}),onClick:()=>this.handleOptionClick(e),onFocus:()=>this.setState({keyboardOptionIndex:t}),children:e.title},i)}render(){var{options:e,inputPlaceholder:t,disabled:n,className:i,defaultTitle:a,spellCheck:s,"data-testid":o}=this.props,{title:l,menuIsOpen:d,popperOptions:h,invalid:c}=this.state;return u.jsxs("div",{className:"aci-container",ref:this.cbContainer,children:[u.jsx("input",{value:l||a,className:Y("form-control",i,"aci-input",{"is-invalid":c&&!d}),ref:this.input,onChange:this.handleInputChange,placeholder:t||e[0].title,disabled:n,onFocus:this.handelInputFocus,onClick:this.handleInputClick,onBlur:this.handleInputBlur,onKeyDown:this.handleInputKeyDown,spellCheck:s,"data-testid":o}),u.jsx(Si,{ref:this.popper,options:h,className:Y("aci-options-popper interactive"),onEntered:this.handleMenuOpened,onExited:this.handleMenuExited,children:this.renderMenuElement()})]})}}Qt(It,"propTypes",{options:_.arrayOf(_.shape({title:_.string.isRequired,value:_.string.isRequired})).isRequired,popperOptions:_.shape({}),onChange:_.func,inputPlaceholder:_.string,disabled:_.bool,className:_.string,defaultTitle:_.string,spellCheck:_.bool,onEnter:_.func,noMatchText:_.string,"data-testid":_.string});Qt(It,"defaultProps",{onChange(){},inputPlaceholder:"",disabled:!1,className:"",defaultTitle:"",popperOptions:null,spellCheck:!0,onEnter(){},noMatchText:"No matching items found","data-testid":void 0});Qt(It,"MENU_NAVIGATION_DIRECTION",Bs);const DS=It;function Wo(r){var{className:e="",value:t,onChange:n,spellCheck:i=!1,placeholder:a="",disabled:s=!1,delimiter:o="",id:l="","data-testid":d}=r,[h,c]=v.useState(t),[f,p]=v.useState(!1),m=v.useRef(null);v.useEffect(function(){c(t)},[t]);function b(D){return D.trim().split(o).filter(T=>T).join(`
|
|
2
2
|
`.concat(o.trim()))}function g(D){return D.split(`
|
|
3
3
|
`).map(T=>T.trim()).join(" ")}function C(){if(m.current){m.current.style.height="0";var D=m.current.scrollHeight+(m.current.offsetHeight-m.current.clientHeight);D>0&&(m.current.style.height="".concat(D,"px"))}}function y(D){var T=D.target.value;f&&(o&&(T=b(T)),p(!1)),c(T),n(T)}function S(){m.current&&(o&&(c(b(h)),C()),m.current.scrollLeft=0)}function w(){m.current&&document.activeElement!==m.current&&m.current.focus()}function E(){o&&(c(g(h)),n(g(h)))}function x(){p(!0)}return v.useEffect(function(){C()},[h]),u.jsx("textarea",{ref:m,id:l,className:Y(e,"auto-resize-textarea form-control"),placeholder:a,value:h,rows:1,onChange:y,onFocus:S,onMouseDown:w,onBlur:E,onPaste:x,spellCheck:i,disabled:s,"data-testid":d})}Wo.propTypes={value:_.string.isRequired,onChange:_.func.isRequired,className:_.string,placeholder:_.string,spellCheck:_.bool,disabled:_.bool,delimiter:_.string,id:_.string,"data-testid":_.string};Wo.defaultProps={className:"",id:"",placeholder:"",disabled:!1,spellCheck:!1,delimiter:"","data-testid":void 0};function wi(r){var{children:e,className:t,style:n,"data-testid":i}=r;return u.jsx("div",{className:Y("btn-group",t),style:n,role:"group","data-testid":i,children:e})}wi.displayName="ButtonGroup";wi.propTypes={children:_.node.isRequired,className:_.string,style:_.object,"data-testid":_.string};wi.defaultProps={className:null,style:{},"data-testid":void 0};function xS(r){var{blockInteraction:e=!0,children:t,debounceMs:n,isOpen:i=!1}=r,{value:a}=Ei(i,n);return u.jsxs(u.Fragment,{children:[e&&i&&u.jsx("div",{className:"modal-backdrop",style:{backgroundColor:"transparent"},"data-testid":"debounced-modal-backdrop"}),X.cloneElement(t,{isOpen:i&&a})]})}function IS(r){var{className:e,icon:t,isOpen:n=!1,subtitle:i,title:a}=r;return u.jsx(bi,{isOpen:n,className:e,children:u.jsx(Ci,{children:u.jsxs("div",{className:"info-modal",children:[t!=null&&u.jsx("div",{className:"message-icon",children:u.jsx(ne,{icon:t})}),u.jsx("div",{className:"message-header",children:a}),i!=null&&u.jsx("div",{className:"message-content",children:i})]})})})}function $a(r){var{className:e="modal-footer",children:t,"data-testid":n}=r;return u.jsx("div",{className:e,"data-testid":n,children:t})}function _n(r){var{isOpen:e,headerText:t,bodyText:n,onCancel:i,onConfirm:a,onDiscard:s,onModalDisable:o,cancelButtonText:l="Cancel",confirmButtonText:d="Okay",discardButtonText:h="Discard",isConfirmDanger:c=!1,children:f,"data-testid":p}=r,m=v.useRef(null),b=v.useRef(null),g=v.useCallback(()=>{b.current!==null&&b.current.checked&&o&&o(),a()},[a,o]),C=v.useCallback(()=>{var S;(S=m.current)===null||S===void 0||S.focus()},[]),y="";return e&&(y=typeof n=="function"?n():n),u.jsxs(bi,{isOpen:e,onOpened:C,children:[u.jsx(La,{closeButton:!1,children:t}),u.jsx(Ci,{children:y}),u.jsxs($a,{children:[o&&u.jsxs("div",{className:"custom-control custom-checkbox form-group mr-auto",children:[u.jsx("input",{type:"checkbox",className:"custom-control-input",id:"move-confirmation-checkbox",defaultChecked:!1,ref:b,"data-testid":p!==void 0?"".concat(p,"-checkbox-confirm"):void 0}),u.jsx("label",{className:"custom-control-label",htmlFor:"move-confirmation-checkbox",children:"Don't ask me again"})]}),s&&u.jsx(K,{kind:"secondary",className:"mr-auto","data-dismiss":"modal",onClick:s,"data-testid":p!==void 0?"".concat(p,"-btn-discard"):void 0,children:h}),i&&u.jsx(K,{kind:"secondary","data-dismiss":"modal",onClick:i,"data-testid":p!==void 0?"".concat(p,"-btn-cancel"):void 0,children:l}),u.jsxs(wi,{children:[u.jsx(K,{kind:c?"danger":"primary",onClick:g,ref:m,"data-testid":p!==void 0?"".concat(p,"-btn-confirm"):void 0,children:d}),f]})]})]})}_n.propTypes={isOpen:_.bool.isRequired,headerText:_.string.isRequired,bodyText:_.oneOfType([_.string,_.func]).isRequired,onCancel:_.func,onConfirm:_.func.isRequired,onDiscard:_.func,onModalDisable:_.func,cancelButtonText:_.string,confirmButtonText:_.string,discardButtonText:_.string,children:_.node,"data-testid":_.string};_n.defaultProps={children:void 0,cancelButtonText:"Cancel",confirmButtonText:"Okay",discardButtonText:"Discard",onCancel:void 0,onDiscard:void 0,onModalDisable:void 0,"data-testid":void 0};var Ua=X.forwardRef((r,e)=>{var{children:t,className:n,disabled:i,onClick:a,style:s,id:o}=r;return u.jsx("button",{ref:e,type:"button",className:Y("btn",n),onClick:a,style:s,disabled:i,id:o,children:t})});Ua.displayName="Button";Ua.propTypes={children:_.node,className:_.string,disabled:_.bool,onClick:_.func,style:_.shape({}),id:_.string};Ua.defaultProps={children:null,className:"",disabled:!1,onClick:()=>null,style:{},id:""};const Ws=Ua;function hd(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,n)}return t}function cd(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?hd(Object(t),!0).forEach(function(n){NS(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):hd(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function NS(r,e,t){return e=MS(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function MS(r){var e=LS(r,"string");return typeof e=="symbol"?e:String(e)}function LS(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}function FS(r){var{styleProps:e,selectedItemCount:t,onClearSelection:n}=r;return u.jsx(Am,cd(cd({UNSAFE_className:Bo.spectrumActionBar},e),{},{isEmphasized:!0,selectedItemCount:t,onClearSelection:n}))}function Ha(r){var{className:e,isFlipped:t,children:n,"data-testid":i}=r,a=d=>{if(n.length!==2)throw new Error("CardFlip requires 2 children to function");return n[d]},s=v.useRef(null),o=v.useCallback(d=>{d.target===d.currentTarget&&document.body.classList.add("card-flip--is-flipping")},[]),l=v.useCallback(d=>{d.target===d.currentTarget&&document.body.classList.remove("card-flip--is-flipping")},[]);return v.useEffect(function(){if(!s.current)throw Error("ref undefined");s.current.addEventListener("transitionstart",o);var h=s.current;return function(){if(h!=null)return h.removeEventListener("transitionstart",o)}},[o]),u.jsxs("div",{className:Y(e,{"card-flip--show-front":t,"card-flip--show-back":!t}),"data-testid":i,children:[u.jsx("div",{className:"card-flip--back",children:a(0)}),u.jsx("div",{ref:s,className:"card-flip--front",onTransitionEnd:l,children:a(1)})]})}function gv(r,e,t){return e=AS(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function AS(r){var e=RS(r,"string");return typeof e=="symbol"?e:String(e)}function RS(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class Ut extends v.Component{static handleEnter(e){var t=e;t.style.height="0"}static handleEntering(e){var t=e;t.style.height="".concat(Ut.getHeight(t),"px")}static handleExiting(e){var t=e;t.style.height="0"}static handleExit(e){var t=e;t.style.height="".concat(Ut.getHeight(t),"px")}static getHeight(e){var t=e.scrollWidth-e.clientWidth;return e.scrollHeight-t}constructor(e){super(e),this.handleEntered=this.handleEntered.bind(this)}handleEntered(e){var t=e;t.style.height="";var{autoFocusOnShow:n}=this.props;if(n!==void 0&&n){var i=t.querySelector("input, select, textarea");i!=null&&i.focus()}}render(){var{children:e,className:t,in:n,"data-testid":i}=this.props;return u.jsx(Hn,{in:n,classNames:{enterActive:"collapsing",enterDone:"collapse show",exitActive:"collapsing",exitDone:"collapse"},onEnter:Ut.handleEnter,onEntering:Ut.handleEntering,onEntered:this.handleEntered,onExit:Ut.handleExit,onExiting:Ut.handleExiting,timeout:350,children:a=>u.jsx("div",{className:Y({collapse:a==="exited"},t),"data-testid":i,children:e})})}}gv(Ut,"propTypes",{className:_.string,in:_.bool.isRequired,children:_.node.isRequired,autoFocusOnShow:_.bool,"data-testid":_.string});gv(Ut,"defaultProps",{className:"",autoFocusOnShow:!1,"data-testid":void 0});const jS=Ut;var kS=B.module("TimeInput"),$S="([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]",US=["00:00:00","12:34:56","23:59:59"];function vd(r){return r!=null?"".concat(r.substring(0,8).replace(/\u2007/g,"0")).concat("00:00:00".substring(r.length)):r}var bv=X.forwardRef((r,e)=>{var{allowValueWrapping:t=!0,className:n="",onChange:i=()=>!1,value:a=0,onFocus:s=()=>!1,onBlur:o=()=>!1,onSelect:l=()=>!1,"data-testid":d}=r,[h,c]=v.useState(cr.formatTime(a)),f=v.useRef(a),[p,m]=v.useState(),b=v.useRef(null);v.useImperativeHandle(e,()=>({focus:()=>{var E;(E=b.current)===null||E===void 0||E.focus()},setSelection:E=>{var x;(x=b.current)===null||x===void 0||x.focus(),m(E)}}),[]),v.useEffect(function(){f.current!==a&&(c(cr.formatTime(a)),f.current=a)},[f,a]);function g(E,x,D){var T=E.selectionStart===0?24:60,I=parseInt(D,10)-x;return Number.isNaN(I)?I=0:t?I=(I%T+T)%T:I=Math.min(Math.max(0,I),T-1),"".concat(I).padStart(2,"0")}function C(E,x,D,T,I){return T===0&&I===2&&x===1&&parseInt(D,10)>1?"0".concat(D).concat(E.substring(2)):Oc(E,x,D)}var y=v.useCallback(E=>{kS.debug("handleChange",E),c(E),f.current=cr.parseTime(vd(E)),i(f.current)},[i]),S=v.useCallback(()=>{var E=vd(h);E!==h&&c(E),o()},[h,o]),w=v.useCallback(E=>{m(E),l(E)},[l]);return u.jsx(No,{ref:b,className:n,example:US,getNextSegmentValue:g,getPreferredReplacementString:C,onChange:y,onSelect:w,pattern:$S,selection:p,value:h,onFocus:s,onBlur:S,"data-testid":d})});bv.defaultProps={allowValueWrapping:!0,className:"",onChange:()=>!1,onSelect:()=>!1,value:0,onFocus:()=>!1,onBlur:()=>!1,"data-testid":void 0};const ma=bv;function fd(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,n)}return t}function HS(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?fd(Object(t),!0).forEach(function(n){Sn(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):fd(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function Sn(r,e,t){return e=VS(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function VS(r){var e=BS(r,"string");return typeof e=="symbol"?e:String(e)}function BS(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}var pd=-1,Gs;(function(r){r.UP="UP",r.DOWN="DOWN"})(Gs||(Gs={}));class ut extends v.Component{constructor(e){super(e),Sn(this,"csContainer",void 0),Sn(this,"menuContainer",void 0),Sn(this,"button",void 0),Sn(this,"input",void 0);var{value:t,valueToTime:n}=e;this.toggleMenu=this.toggleMenu.bind(this),this.handleMenuKeyDown=this.handleMenuKeyDown.bind(this),this.closeMenu=this.closeMenu.bind(this),this.handleOptionClick=this.handleOptionClick.bind(this),this.handleOptionFocus=this.handleOptionFocus.bind(this),this.handleMenuOpened=this.handleMenuOpened.bind(this),this.handleMenuExited=this.handleMenuExited.bind(this),this.handleCustomInput=this.handleCustomInput.bind(this),this.csContainer=X.createRef(),this.menuContainer=X.createRef(),this.button=X.createRef(),this.input=X.createRef(),this.state={keyboardOptionIndex:0,menuIsOpen:!1,inputWidth:100,customTime:n(t),inputFocused:!1}}getSelectedText(){var{options:e,value:t,placeholder:n}=this.props,{customTime:i}=this.state;if(t===null)return n;for(var a=0;a<e.length;a+=1){var s=e[a];if(s.value===t)return s.title}return cr.formatTime(i)}setInputWidth(){this.csContainer.current&&this.setState({inputWidth:this.csContainer.current.getBoundingClientRect().width})}focus(){var e;(e=this.button.current)===null||e===void 0||e.focus()}updateInputValue(e){var{onChange:t}=this.props;t(e)}handleResize(){this.setInputWidth()}handleMenuKeyDown(e){var t,{keyboardOptionIndex:n,inputFocused:i}=this.state,{options:a}=this.props;switch(e.key){case"Enter":case" ":i?this.updateFromCustom():this.updateInputValue(a[n].value),this.closeMenu(),(t=this.button.current)===null||t===void 0||t.focus(),e.stopPropagation(),e.preventDefault();break;case"Tab":e.shiftKey?this.handleMenuNavigation(ut.MENU_NAVIGATION_DIRECTION.UP):this.handleMenuNavigation(ut.MENU_NAVIGATION_DIRECTION.DOWN),e.stopPropagation(),e.preventDefault();break;case"ArrowUp":this.handleMenuNavigation(ut.MENU_NAVIGATION_DIRECTION.UP),e.stopPropagation(),e.preventDefault();break;case"ArrowDown":this.handleMenuNavigation(ut.MENU_NAVIGATION_DIRECTION.DOWN),e.stopPropagation(),e.preventDefault();break;case"Escape":this.closeMenu();break}}handleMenuNavigation(e){var{keyboardOptionIndex:t,inputFocused:n}=this.state,{options:i}=this.props,a=i.length,s=t;switch(e){case ut.MENU_NAVIGATION_DIRECTION.UP:if(!n&&t===0){this.focusInput();break}else n&&this.focusOption(t);t>0&&!n?(s=(s-1)%a,this.setState({keyboardOptionIndex:s})):t===0&&(s=a-1,this.setState({keyboardOptionIndex:s})),this.scrollOptionIntoView(s);break;case ut.MENU_NAVIGATION_DIRECTION.DOWN:if(!n&&t===a-1){this.focusInput();break}else n&&this.focusOption(t);t<a&&!(n&&t===0)&&(s=(s+1)%a,this.setState({keyboardOptionIndex:s})),this.scrollOptionIntoView(s);break}}handleOptionClick(e){var t=Number(e.currentTarget.value),{options:n,timeToValue:i}=this.props,{customTime:a}=this.state;if(t===pd){var s=i(a);this.updateAndClose(s)}else this.updateAndClose(n[t].value)}updateAndClose(e){var t;this.updateInputValue(e),this.closeMenu(),(t=this.button.current)===null||t===void 0||t.focus()}handleOptionFocus(e){this.setState({keyboardOptionIndex:Number(e.target.value)})}handleMenuOpened(){var e,{options:t,value:n}=this.props,{keyboardOptionIndex:i}=this.state;this.scrollOptionIntoView(i);var a=(e=this.menuContainer.current)===null||e===void 0?void 0:e.querySelector(".cs-option-btn.keyboard-active");if(a instanceof HTMLElement&&a.focus(),n!==null){var s=t.map(o=>o.value).indexOf(n);s<0&&this.focusInput()}}focusInput(){var e;(e=this.input.current)===null||e===void 0||e.focus()}focusOption(e){var t,n=(t=this.menuContainer.current)===null||t===void 0?void 0:t.querySelector(".cs-options");if(n&&n.children!=null){var i=n.children.item(e);i instanceof HTMLElement&&i.focus()}}handleMenuExited(){var{menuIsOpen:e}=this.state;e&&this.setState({menuIsOpen:!1,keyboardOptionIndex:0})}handleCustomInput(e){var{timeToValue:t}=this.props,n=t(e);this.updateInputValue(n),this.setState({customTime:e})}updateFromCustom(){var{timeToValue:e}=this.props,{customTime:t}=this.state,n=e(t);this.updateInputValue(n)}toggleMenu(e){var{menuIsOpen:t}=this.state;t?this.closeMenu():this.openMenu(),e.stopPropagation()}openMenu(){this.updateKeyboardIndex(),this.setInputWidth(),this.setState({menuIsOpen:!0})}closeMenu(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;if(this.setState({menuIsOpen:!1}),e){var t;(t=this.button.current)===null||t===void 0||t.focus()}}updateKeyboardIndex(){var{options:e,value:t}=this.props;if(t!==null){var n=e.map(i=>i.value).indexOf(t);n>0&&this.setState({keyboardOptionIndex:n})}}scrollOptionIntoView(e){var t,n=(t=this.menuContainer.current)===null||t===void 0?void 0:t.querySelector(".cs-options");if(n&&n.children!=null){var i=n.children.item(e);i instanceof HTMLElement&&i.offsetTop>ut.DROP_DOWN_MENU_HEIGHT?n.scrollTop=i.offsetTop-ut.DROP_DOWN_MENU_HEIGHT:(i instanceof HTMLElement&&i.offsetTop<0||e===0)&&(n.scrollTop=0)}}renderMenuElement(){var{inputWidth:e}=this.state;return u.jsx("div",{className:"cs-menu-container",ref:this.menuContainer,role:"presentation",onKeyDown:this.handleMenuKeyDown,onClick:t=>{t.stopPropagation()},style:{width:e},children:u.jsx("div",{className:"cs-options-container",children:u.jsx("div",{className:"cs-options",children:this.renderOptions()})})})}renderOptions(){for(var{options:e,value:t,icon:n,customText:i}=this.props,{keyboardOptionIndex:a,customTime:s,inputFocused:o}=this.state,l=!1,d=[],h=0;h<e.length;h+=1){var c=e[h],f="option-".concat(h,"-").concat(c.value);l=l||c.value===t,d.push(u.jsxs("button",{type:"button",value:h,className:Y("cs-option-btn",{"keyboard-active":a===h&&!o}),onClick:this.handleOptionClick,onFocus:this.handleOptionFocus,children:[c.value===t&&u.jsx(ne,{icon:n,className:"mr-2"}),c.value!==t&&u.jsx("span",{className:"mr-4"}),c.title]},f))}return d.push(u.jsx("hr",{className:"cs-divider"},"option-divider")),d.push(u.jsxs("button",{type:"button",value:pd,className:Y("cs-option-btn",{"keyboard-active":o}),onClick:this.handleOptionClick,onFocus:this.handleOptionFocus,children:[!l&&t!==null?u.jsx(ne,{icon:n,className:"mr-2"}):u.jsx("span",{className:"mr-4"}),i]},"option-custom-label")),d.push(u.jsxs("div",{className:"cs-custom-container",children:[u.jsx("span",{className:"mr-2"}),u.jsx(ma,{ref:this.input,onChange:this.handleCustomInput,value:s,onFocus:()=>this.setState({inputFocused:!0}),onBlur:()=>this.setState({inputFocused:!1})},"option-input"),u.jsx("span",{className:"ml-2"})]},"cs-custom-container")),d.push(u.jsx("hr",{className:"mb-2"},"option-end")),d}render(){var{disabled:e,invalid:t,value:n,"data-testid":i}=this.props,{menuIsOpen:a}=this.state,{popperOptions:s}=this.props;return s=HS({placement:"bottom-end",modifiers:{preventOverflow:{enabled:!1}}},s),u.jsx("div",{className:"input-group cs-container context-menu",ref:this.csContainer,"data-testid":i,children:u.jsx("div",{className:Y("input-group-append cs-dropdown",{"cs-dropdown-invalid":t}),children:u.jsxs("button",{type:"button",className:Y("btn cs-btn form-control",{"cs-btn-invalid":t}),ref:this.button,onClick:this.toggleMenu,disabled:e,children:[u.jsx("span",{className:Y({"text-muted":n===null}),children:this.getSelectedText()}),u.jsx("span",{className:"cs-caret"}),u.jsx(En,{isShown:a,actions:{menuElement:this.renderMenuElement()},popperOptions:s,popperClassName:"CustomTimeSelect",onMenuOpened:this.handleMenuOpened,onMenuClosed:this.handleMenuExited,menuStyle:{maxWidth:"100rem"}})]})})})}}Sn(ut,"MENU_NAVIGATION_DIRECTION",Gs);Sn(ut,"DROP_DOWN_MENU_HEIGHT",125);Sn(ut,"defaultProps",{onChange(){},value:null,disabled:!1,popperOptions:{},icon:hr,customText:"Custom",placeholder:"Select a time",valueToTime:r=>r===null?0:Math.round(r/1e3),timeToValue:r=>r*1e3,invalid:!1,"data-testid":void 0});const WS=ut;var GS=B.module("DateInput"),zS="[12][0-9]{3}-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])",KS=["2000-01-01","2022-12-31"],qS="YYYY-MM-DD",Cv=X.forwardRef((r,e)=>{var{className:t="",onChange:n=()=>{},defaultValue:i="",onFocus:a=()=>{},onBlur:s=()=>{},"data-testid":o}=r,[l,d]=v.useState(i),[h,c]=v.useState(),f=v.useCallback(p=>{GS.debug("handleChange",p),d(p),n(p)},[n]);return u.jsx("div",{className:"d-flex flex-row align-items-center",children:u.jsx(No,{ref:e,className:Y(t),example:KS,getNextSegmentValue:lb,onChange:f,onSelect:c,pattern:zS,placeholder:qS,selection:h,value:l,onFocus:a,onBlur:s,"data-testid":o})})});Cv.displayName="DateInput";const YS=Cv;function Sv(r,e,t){return e=XS(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function XS(r){var e=ZS(r,"string");return typeof e=="symbol"?e:String(e)}function ZS(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class yv extends v.PureComponent{constructor(e){super(e),Sv(this,"searchInput",void 0),this.searchInput=X.createRef(),this.handleChange=this.handleChange.bind(this),this.sendUpdate=Le(this.sendUpdate.bind(this),e.debounceMs),this.state={value:e.value}}componentDidUpdate(e){var{value:t}=this.props;e.value!==t&&this.setState({value:t})}focus(){var e;(e=this.searchInput.current)===null||e===void 0||e.focus()}handleChange(e){this.setState({value:e.target.value},this.sendUpdate)}sendUpdate(){var{onChange:e}=this.props,{value:t}=this.state;e(t)}render(){var{placeholder:e,className:t,matchCount:n,id:i,"data-testid":a}=this.props,{value:s}=this.state;return u.jsx(yi,{value:s,placeholder:e,onChange:this.handleChange,className:t,matchCount:n,ref:this.searchInput,id:i,"data-testid":a})}}Sv(yv,"defaultProps",{placeholder:"Search",className:"",matchCount:null,debounceMs:250,id:"","data-testid":void 0});const Ev=yv;function QS(r){var{isInvalid:e=!1,items:t,onAdd:n=()=>{},onDelete:i=()=>{},validate:a=()=>null}=r,[s,o]=v.useState(null),[l,d]=v.useState([]),[h,c]=v.useState(""),f=v.useCallback(S=>{d(S)},[]),p=v.useCallback(()=>{i(ca.getItemsInRanges(t,l)),d([])},[t,l,i]),m=v.useCallback(()=>{if(h!==""){var S=a(h);S==null?(n(h),c("")):o(S)}},[h,n,a]),b=v.useCallback(S=>{var{value:w}=S.target;c(w),o(w===""?null:a(w))},[a]),g=v.useCallback(()=>{d([])},[]),C=v.useCallback(S=>{S.key==="Enter"&&m()},[m]),y=v.useMemo(()=>14+ar(t.length,1,6)*Er.DEFAULT_ROW_HEIGHT,[t.length]);return u.jsxs("div",{className:Y("editable-item-list-container",{"is-invalid":e}),children:[u.jsx("div",{style:{height:y},children:u.jsx(Er,{itemCount:t.length,items:t.map((S,w)=>({value:S,isSelected:ca.isSelected(l,w)})),offset:0,selectedRanges:l,onSelectionChange:f,isMultiSelect:!0})}),u.jsxs("div",{className:"d-flex flex-row pt-2",children:[u.jsx("div",{className:"d-flex flex-grow-1",children:u.jsx("input",{className:Y("form-control",{"is-invalid":s!=null}),placeholder:"Enter value",type:"text",value:h,onChange:b,onFocus:g,onKeyDown:C})}),u.jsxs("div",{className:"d-flex align-items-start mt-1 ml-2",children:[u.jsx(K,{kind:"ghost",onClick:m,disabled:s!=null||h==="",icon:tg,tooltip:"Add new item","data-testid":"add-item-button"}),u.jsx(K,{kind:"ghost",onClick:p,disabled:l.length===0,icon:Wn,tooltip:"Delete selected items","data-testid":"delete-item-button"})]})]})]})}var JS=B.module("ErrorBoundary");class ey extends v.Component{static getDerivedStateFromError(e){return{error:e}}constructor(e){super(e),this.state={error:void 0}}componentDidCatch(e,t){var{onError:n}=this.props;JS.error("Error caught by ErrorBoundary",e,t),n==null||n(e,t)}render(){var{children:e,className:t,fallback:n}=this.props,{error:i}=this.state;return i!=null?n??u.jsx("div",{className:t,children:u.jsx(tt,{errorMessage:"".concat(i),isLoading:!1,isLoaded:!1})}):e}}function ty(r,e,t){return e=ny(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function ny(r){var e=ry(r,"string");return typeof e=="symbol"?e:String(e)}function ry(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class vr extends v.Component{static isParentSelected(e,t){var n=t.get(e);if(n===void 0)return!1;if(typeof n=="boolean")return n;var i=Array.from(n.values()).includes(!0),a=Array.from(n.values()).includes(!1);return i&&a?null:i}constructor(e){super(e),this.toggleMenu=this.toggleMenu.bind(this),this.toggleValueFor=this.toggleValueFor.bind(this),this.selectAll=this.selectAll.bind(this),this.clear=this.clear.bind(this),this.state={menuIsOpen:!1}}toggleMenu(e){e.stopPropagation(),e.preventDefault(),this.setState(t=>{var{menuIsOpen:n}=t;return{menuIsOpen:!n}})}toggleValueFor(e,t){var{valueMap:n,onUpdateValueMap:i}=this.props,a=new Map(n),s=a.get(e);if(s instanceof Map){var o=new Map(s);if(t!=null)o.set(t,s.get(t)===void 0);else{var l=vr.isParentSelected(e,a),d=l==null||!l;s.forEach((f,p)=>o.set(p,d))}a.set(e,o)}else a.set(e,s==null||!s);var h=a.get(e);if(t===void 0&&h!==void 0&&typeof h!="boolean"){var c=vr.isParentSelected(e,n);c!=null&&c?h.forEach((f,p)=>h.set(p,!1)):h.forEach((f,p)=>h.set(p,!0))}i(a)}setAllValues(e){var{valueMap:t,onUpdateValueMap:n}=this.props,i=new Map;t.forEach((a,s)=>{if(typeof a=="boolean")i.set(s,e);else{var o=new Map;a.forEach((l,d)=>o.set(d,e)),i.set(s,o)}}),n(i)}selectAll(){this.setAllValues(!0)}clear(){this.setAllValues(!1)}renderMenuElement(){var{valueMap:e,"data-testid":t}=this.props;return u.jsxs("div",{className:"hcm-menu-container",children:[Array.from(e.entries()).map(n=>{var[i,a]=n;return u.jsxs("div",{children:[u.jsx(va,{className:"hcm-parent",checked:vr.isParentSelected(i,e),onChange:()=>this.toggleValueFor(i),children:i}),a!==void 0&&typeof a!="boolean"&&Array.from(a.entries()).map(s=>{var[o,l]=s;return u.jsx(va,{className:"hcm-child",checked:l,onChange:()=>this.toggleValueFor(i,o),children:o},o)})]},i)}),u.jsx(K,{kind:"ghost",onClick:this.selectAll,"data-testid":t!==void 0?"".concat(t,"-btn-select-all"):void 0,children:"Select All"}),u.jsx(K,{kind:"ghost",onClick:this.clear,"data-testid":t!==void 0?"".concat(t,"-btn-clear"):void 0,children:"Clear"})]})}render(){var{menuText:e,className:t,icon:n,id:i,"data-testid":a}=this.props,{menuIsOpen:s}=this.state;return u.jsxs("button",{type:"button",className:Y("btn hcm-btn",t),onClick:this.toggleMenu,id:i,"data-testid":a,children:[u.jsxs("span",{children:[n&&u.jsx(ne,{icon:n,className:"hcm-icon mr-1"}),e]}),u.jsx("span",{className:"cs-caret"}),u.jsx(Si,{options:{placement:"bottom"},isShown:s,onExited:()=>{this.setState({menuIsOpen:!1})},closeOnBlur:!0,interactive:!0,children:this.renderMenuElement()})]})}}ty(vr,"defaultProps",{className:"",icon:null,id:"","data-testid":void 0});const iy=vr;function md(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,n)}return t}function Cs(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?md(Object(t),!0).forEach(function(n){ay(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):md(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function ay(r,e,t){return e=sy(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function sy(r){var e=oy(r,"string");return typeof e=="symbol"?e:String(e)}function oy(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}var wv=v.memo(r=>{var{tab:e,onClose:t,onSelect:n,isActive:i,activeRef:a,index:s,isDraggable:o,contextActions:l}=r,{key:d,isClosable:h=t!=null,title:c}=e;return u.jsx(Rm,{draggableId:d,index:s,isDragDisabled:!o,children:(f,p)=>u.jsxs("div",{className:"context-menu-wrapper",ref:i?a:null,children:[u.jsxs("div",Cs(Cs(Cs({ref:f.innerRef},f.draggableProps),f.dragHandleProps),{},{className:Y("btn btn-link btn-nav-tab",{active:i},{dragging:p.isDragging}),"data-testid":"btn-nav-tab-".concat(c),role:"tab",tabIndex:0,onClick:m=>{m.target.focus(),n(d)},onKeyPress:m=>{m.key==="Enter"&&n(d)},children:[c,h&&u.jsx(K,{kind:"ghost",className:"btn-nav-tab-close",onClick:m=>{t==null||t(d),m.stopPropagation(),m.preventDefault()},icon:To,tooltip:"Close"})]})),u.jsx(ae,{actions:l})]})},d)});wv.displayName="NavTab";const ly=wv;function gd(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,n)}return t}function bd(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?gd(Object(t),!0).forEach(function(n){dy(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):gd(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function dy(r,e,t){return e=uy(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function uy(r){var e=hy(r,"string");return typeof e=="symbol"?e:String(e)}function hy(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}var cy=500,vy=.01,fy=5e-4;function Cd(r){return r.scrollLeft===0}function Sd(r){return r.scrollLeft+r.clientWidth===r.scrollWidth||r.scrollWidth===0}function py(r,e,t){var{isClosable:n=!1,key:i}=r,a=[];if(n&&t!=null){a.push({title:"Close",order:10,group:20,action:()=>{t(i)}});for(var s=!0,o=e.length-1;o>0&&e[o].key!==r.key;o-=1)if(e[o].isClosable===!0){s=!1;break}a.push({title:"Close to the Right",order:20,group:20,action:()=>{for(var l=e.length-1;l>0&&e[l].key!==i;l-=1)e[l].isClosable===!0&&t(e[l].key)},disabled:s}),a.push({title:"Close All",order:30,group:20,action:()=>{e.forEach(l=>{l.isClosable===!0&&t(l.key)})}})}return a}function my(r){var{activeKey:e,tabs:t,onSelect:n,onReorder:i,onClose:a,makeContextActions:s}=r,o=v.useRef(),[l,d]=v.useState(!0),[h,c]=v.useState(!0),[f,p]=v.useState(!0),m=v.useCallback(()=>{o.current!=null&&(o.current.clientWidth<o.current.scrollWidth&&t.length>0?d(!0):d(!1),c(Cd(o.current)),p(Sd(o.current)))},[t]);Vo(o.current,m);var b=v.useCallback(O=>{Us.stopDragging(),O.destination&&(i==null||i(O.source.index,O.destination.index))},[i]),g=v.useCallback(()=>{if(o.current!=null){var O=Cd(o.current);O!==h&&c(O);var M=Sd(o.current);M!==f&&p(M)}},[h,f]),C=v.useRef({cancelClick:!1}),y=v.useCallback(()=>{if(!(o.current==null||C.current.cancelClick))for(var{children:O}=o.current,M=O.length-1;M>=0;M-=1){var A=O[M];if(A.offsetLeft<o.current.scrollLeft-5){A.scrollIntoView({behavior:"smooth",block:"nearest",inline:"start"});return}}},[]),S=v.useCallback(()=>{if(!(o.current==null||C.current.cancelClick))for(var{children:O}=o.current,M=0;M<O.length;M+=1){var A=O[M];if(A.offsetLeft+5>o.current.scrollLeft+o.current.offsetWidth){A.scrollIntoView({behavior:"smooth",block:"nearest",inline:"end"});return}}},[]),w=v.useCallback(function(O,M){var A=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,k=arguments.length>3?arguments[3]:void 0,H=o.current;H!=null&&(C.current.cancelClick=!0,O==="left"?H.scrollLeft=M-A:O==="right"&&(H.scrollLeft=M+A),C.current.rAF=requestAnimationFrame(q=>{var re=k??q,V=q-re,N=vy*V+.5*fy*V**2;N=Math.min(N,H.scrollWidth),w(O,M,N,re)}))},[]),E=v.useCallback(()=>{var{holdTimer:O,rAF:M}=C.current;O!=null&&(clearTimeout(O),C.current.holdTimer=void 0),M!=null&&(cancelAnimationFrame(M),C.current.rAF=void 0),window.removeEventListener("mouseup",E)},[]);v.useEffect(()=>()=>window.removeEventListener("mouseup",E),[E]);var x=v.useCallback(O=>{o.current!=null&&(C.current.holdTimer=window.setTimeout(w,cy,O,o.current.scrollLeft)),C.current.cancelClick=!1,window.addEventListener("mouseup",E)},[E,w]),D=v.useCallback(()=>{x("left")},[x]),T=v.useCallback(()=>{x("right")},[x]);v.useEffect(function(){var M,A=k=>{k.stopPropagation(),k.preventDefault();var H=k.currentTarget,q=Math.abs(k.deltaY)>Math.abs(k.deltaX)?k.deltaY:k.deltaX;H.scrollLeft+=ar(q,-30,30)};return(M=o.current)===null||M===void 0||M.addEventListener("wheel",A),()=>{var k;(k=o.current)===null||k===void 0||k.removeEventListener("wheel",A)}},[]);var I=v.useMemo(()=>{var O=new Map;return t.forEach(M=>{var{key:A}=M,k=[()=>py(M,t,a),()=>{var H;return(H=s==null?void 0:s(M))!==null&&H!==void 0?H:[]}];O.set(A,k)}),O},[s,t,a]),j=v.useRef(null),W=t.find(O=>O.key===e),L=t.map((O,M)=>{var{key:A}=O,k=O===W;return u.jsx(ly,{tab:O,index:M,isActive:k,activeRef:j,onSelect:n,onClose:a,isDraggable:i!=null,contextActions:I.get(A)},A)});return v.useEffect(function(){j.current!=null&&j.current.scrollIntoView({block:"nearest",inline:"nearest"})},[e]),u.jsxs("nav",{className:"nav-container",children:[l&&u.jsx(K,{kind:"ghost",icon:u.jsx(ne,{icon:ng,transform:"grow-4"}),className:"tab-controls-btn tab-controls-btn-left",tooltip:"Scroll left",onClick:y,onMouseDown:D,disabled:h}),u.jsx(jm,{onDragStart:Us.startDragging,onDragEnd:b,children:u.jsx(km,{droppableId:"droppable-tab-navigation",direction:"horizontal",children:(O,M)=>u.jsxs("div",bd(bd({ref:A=>{A!=null&&(o.current=A,O.innerRef(A))}},O.droppableProps),{},{className:Y("nav nav-tabs",{dragging:M.draggingFromThisWith}),role:"tablist",onScroll:g,children:[L,O.placeholder]}))})}),l&&u.jsx(K,{kind:"ghost",icon:u.jsx(ne,{icon:rg,transform:"grow-4"}),className:"tab-controls-btn tab-controls-btn-right",tooltip:"Scroll right",onClick:S,onMouseDown:T,disabled:f})]})}function gy(){var{selectedThemeKey:r,setSelectedThemeKey:e,themes:t}=Rr(),n=v.useCallback(i=>{e(i)},[e]);return u.jsx($m,{label:"Pick a color scheme",items:t,selectedKey:r,onSelectionChange:n,children:i=>u.jsx(cc,{children:i.name},i.themeKey)})}function by(r){var{className:e,style:t}=r;return u.jsx("div",{className:Y("dh-logo",e),style:t})}var Cy=.025,Sy=.9,yy=.1,Ey=.618,yd=80,Jn={SIZE:8,DOT_SIZE:2},sn=18,wy=250,Py=60*1e3,_y={background:"var(--dh-color-random-area-plot-animation-bg)",foregroundFill:"var(--dh-color-random-area-plot-animation-fg-fill)",foregroundStroke:"var(--dh-color-random-area-plot-animation-fg-stroke)",gridColor:"var(--dh-color-random-area-plot-animation-grid)"};function Ty(){return Oo(_y)}var Oy=X.memo(()=>{var{activeThemes:r}=Rr(),e=v.useMemo(Ty,[r]),t=v.useRef(null),n=v.useRef(null),[i,a]=v.useState(!1),s=window.devicePixelRatio,o,l,d,h,c,f=null,p=[];function m(){var L;n.current!=null&&(d=n.current.offsetWidth,h=n.current.offsetHeight),t.current!=null&&(t.current.style.width="".concat(d,"px"),t.current.style.height="".concat(h,"px"),t.current.width=d*s,t.current.height=h*s),(L=o)===null||L===void 0||L.scale(s,s)}function b(){var{foregroundFill:L,foregroundStroke:O}=e,M=document.createElement("canvas");M.width=Jn.SIZE,M.height=Jn.SIZE;var A=M.getContext("2d");return A!=null&&(A.fillStyle=O,A.fillRect(0,0,Jn.DOT_SIZE,Jn.DOT_SIZE),A.fillStyle=L,A.fillRect(0,0,Jn.SIZE,Jn.SIZE)),A==null?void 0:A.createPattern(M,"repeat")}function g(L){var O=Math.random()-.5,M=Cy*O;return L<yy?M=Math.abs(M):L>Sy&&(M=-Math.abs(M)),L+M}function C(){for(var L=[],O=Ey,M=0;M<d+sn;M+=1)O=g(O),L.push(O);return L}function y(){for(;p.length>=d+sn;)p.pop();for(;p.length<d+sn;)p.push(g(p[p.length-1]))}function S(L,O){O.beginPath(),O.moveTo(-1,h+1),O.lineTo(-1,h*L[0]);for(var M=0;M<L.length;M+=1)O.lineTo(M,h*L[M]);O.lineTo(d+sn,h*L[L.length-1]),O.lineTo(d+sn,h+1),O.closePath()}function w(L){L.beginPath();for(var O=1;O<d;O+=yd)L.moveTo(O,0),L.lineTo(O,h);for(var M=1;M<h;M+=yd)L.moveTo(0,M),L.lineTo(d,M)}function E(L){var O,M,A;f=(O=f)!==null&&O!==void 0?O:L;var{background:k,foregroundStroke:H,gridColor:q}=e;G(o),o.fillStyle=k,o.fillRect(0,0,d,h),w(o),o.lineWidth=1,o.strokeStyle=q,o.stroke();var re=(((M=f)!==null&&M!==void 0?M:0)-(L??0))/(1e3/sn);if(o.translate(re,0),S(p,o),o.lineWidth=2,o.strokeStyle=H,o.stroke(),o.translate(-re,0),l!=null&&(o.fillStyle=l),o.fill(),o.setTransform(s,0,0,s,0,0),(L??0)-((A=f)!==null&&A!==void 0?A:0)>1e3/sn){for(var V,N=Math.floor(((L??0)-((V=f)!==null&&V!==void 0?V:0))/(1e3/sn)),P=0;P<N;P+=1)p.shift(),p.push(g(p[p.length-1]));f=L}c!=null&&cancelAnimationFrame(c),c=requestAnimationFrame(E)}var x=Le(()=>{c=requestAnimationFrame(L=>{m(),y(),a(!1),E(L)})},wy,{leading:!0});function D(){a(!0),c!=null&&cancelAnimationFrame(c),c=null,f=null}var T=Le(()=>{D()},Py);function I(){c==null&&(a(!1),m(),y(),c=requestAnimationFrame(E)),T()}function j(){document.hasFocus()&&I()}function W(){c!=null&&cancelAnimationFrame(c),T(),x()}return v.useEffect(()=>{var L;return o=(L=t.current)===null||L===void 0?void 0:L.getContext("2d",{alpha:!1}),m(),p=C(),l=b(),E(),T(),window.addEventListener("resize",W),window.addEventListener("focus",I),window.addEventListener("blur",D),window.addEventListener("mousemove",j),window.addEventListener("keydown",j),()=>{c!=null&&cancelAnimationFrame(c),window.removeEventListener("resize",W),window.removeEventListener("focus",I),window.removeEventListener("blur",D),window.removeEventListener("mousemove",j),window.removeEventListener("keydown",j),T.cancel(),x.cancel()}},[e]),u.jsx("div",{className:"random-area-plot-animation-container",ref:n,children:u.jsx("canvas",{ref:t,className:i?"shade":""})})});const Pv=Oy;function _v(r){var{text:e,placement:t="top-start"}=r,n=v.useMemo(()=>({placement:t}),[t]);return u.jsxs(u.Fragment,{children:[u.jsx(dc,{UNSAFE_className:Bo.spectrumEllipsis,children:e??u.jsx(u.Fragment,{children:" "})}),e==null||e===""?null:u.jsx(wt,{options:n,children:e})]})}var Dy=["scrollRef","getItemDisplayText","getKey"];function Ed(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,n)}return t}function wd(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Ed(Object(t),!0).forEach(function(n){xy(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):Ed(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function xy(r,e,t){return e=Iy(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Iy(r){var e=Ny(r,"string");return typeof e=="symbol"?e:String(e)}function Ny(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}function My(r,e){if(r==null)return{};var t=Ly(r,e),n,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(r);for(i=0;i<a.length;i++)n=a[i],!(e.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(r,n)&&(t[n]=r[n])}return t}function Ly(r,e){if(r==null)return{};var t={},n=Object.keys(r),i,a;for(a=0;a<n.length;a++)i=n[a],!(e.indexOf(i)>=0)&&(t[i]=r[i]);return t}function Fy(r){var{scrollRef:e,getItemDisplayText:t,getKey:n}=r,i=My(r,Dy),a=v.useCallback(s=>{var o=n(s),l=t(s);return u.jsx(cc,{textValue:l??String(o),children:u.jsx(_v,{text:l})},o)},[t,n]);return u.jsx(Um,wd(wd({},i),{},{ref:e,menuTrigger:"focus",onSelectionChange:i.onSelectionChange,children:a}))}var Go=X.forwardRef((r,e)=>{var{children:t,className:n,disabled:i,id:a,isLinked:s,isLinkedSource:o,isInvalid:l,onClick:d,onMouseEnter:h,onMouseLeave:c,style:f,"data-testid":p}=r;return u.jsxs("button",{ref:e,type:"button",className:Y("btn-socketed",{"btn-socketed-linked":s!==void 0&&s||o},{"btn-socketed-linked-source":o},{"is-invalid":l},n),id:a,onClick:d,onMouseEnter:h,onMouseLeave:c,style:f,disabled:i,"data-testid":p,children:[t,u.jsx(ne,{icon:ig,className:"linked btn-socketed-icon",transform:"down-1"}),u.jsx(ne,{icon:ag,className:"is-invalid btn-socketed-icon"})]})});Go.displayName="SocketedButton";Go.defaultProps={children:void 0,className:"",disabled:!1,id:void 0,isLinked:!1,isLinkedSource:!1,isInvalid:!1,onClick:void 0,onMouseEnter:void 0,onMouseLeave:void 0,style:void 0,"data-testid":void 0};const zo=Go;var Ay=500;function Ry(r){var{heading:e,content:t,delayMs:n=Ay}=r,[i,a]=v.useState(!1);return v.useEffect(()=>{window.setTimeout(()=>{a(!0)},n)},[n]),i?u.jsxs(Hm,{children:[u.jsx(Po,{size:"XXL",children:u.jsx(ne,{icon:sg})}),u.jsx(uc,{children:e}),t==null?null:u.jsx(hc,{children:t})]}):null}const jy="_modified_5rbci_24",ky="_track_5rbci_35",$y="_handle_5rbci_15",Uy="_ticks_5rbci_103",Tv={"handle-size":"15px","popover-width":"90px","time-slider":"_time-slider_5rbci_5","time-slider-popovers":"_time-slider-popovers_5rbci_10","handle-popper":"_handle-popper_5rbci_15",modified:jy,"flex-spacer":"_flex-spacer_5rbci_31",track:ky,"track-fills":"_track-fills_5rbci_42","track-fill":"_track-fill_5rbci_42","track-fill-start":"_track-fill-start_5rbci_60","track-fill-middle":"_track-fill-middle_5rbci_61","track-fill-end":"_track-fill-end_5rbci_64","handle-track":"_handle-track_5rbci_67",handle:$y,ticks:Uy,"tick-labels":"_tick-labels_5rbci_121","tick-label":"_tick-label_5rbci_121","tick-label-wrapper":"_tick-label-wrapper_5rbci_137"};var Ui=parseInt(Tv["handle-size"],10),Pd=parseInt(Tv["popover-width"],10),ft=24*60*60-1,_d=5*60;function Hy(r){var{startTime:e,endTime:t,onChange:n,isStartModified:i=!1,isEndModified:a=!1,"data-testid":s}=r,[o,l]=v.useState(e),[d,h]=v.useState(t),c=v.useRef(null);v.useEffect(function(){l(e),h(t)},[e,t]);var f=v.useCallback((b,g)=>{var C=b,y=g;C===y&&(y<ft?y+=1:C-=1),l(C),h(y),n({startTime:C,endTime:y})},[l,h,n]),p=v.useCallback(b=>{f(b,d)},[f,d]),m=v.useCallback(b=>{f(o,b)},[f,o]);return u.jsxs("div",{className:"time-slider","data-testid":s,children:[u.jsx(Vy,{startTime:o,endTime:d,onStartTimeChange:p,onEndTimeChange:m,isStartModified:i,isEndModified:a}),u.jsxs("div",{className:"track",ref:c,children:[u.jsx(By,{startTime:o,endTime:d}),u.jsx("div",{className:"ticks",children:Array(24).fill(null).map((b,g)=>u.jsx("div",{className:"tick"},g))}),u.jsx(Td,{track:c,time:o,setTime:p}),u.jsx(Td,{track:c,time:d,setTime:m})]}),u.jsxs("div",{className:"tick-labels",children:[u.jsx("div",{className:"tick-label",children:"0:00"}),u.jsx("div",{className:"tick-label-wrapper",children:Array(24).fill(null).map((b,g)=>u.jsx("div",{className:"tick-label",children:"".concat(g+1,":00")},g))})]})]})}function Vy(r){var{startTime:e,endTime:t,onStartTimeChange:n,onEndTimeChange:i,isStartModified:a,isEndModified:s,"data-testid":o}=r,l=e>t,[d,h]=v.useState(l?t:e),[c,f]=v.useState(l?e:t),p=v.useRef(null),m=v.useRef(null),b=v.useRef(null),g=v.useRef(null);v.useEffect(function(){h(e>t?t:e),f(e>t?e:t)},[e,t]),v.useEffect(function(){if(b.current!==null){var x;(x=m.current)===null||x===void 0||x.setSelection(b.current)}if(g.current!==null){var D;(D=p.current)===null||D===void 0||D.setSelection(g.current)}},[l]);function C(E){e<=t?n(E):i(E)}function y(E){e<=t?i(E):n(E)}var S=v.useCallback(E=>{b.current=E,g.current=null},[]),w=v.useCallback(E=>{b.current=null,g.current=E},[]);return u.jsxs("div",{className:"time-slider-popovers",children:[u.jsx("div",{className:"flex",style:{flexBasis:"calc(".concat(d/ft*100,"% - ").concat(Pd/2,"px)")}}),u.jsxs("div",{className:"handle-popper",children:[u.jsx("label",{className:Y({modified:l?s:a}),children:l?"End Time":"Start Time"}),u.jsx(ma,{ref:p,allowValueWrapping:!1,value:d,onChange:C,onSelect:S,"data-testid":o!==void 0?"".concat(o,"-input-1"):void 0})]}),u.jsx("div",{className:"flex-spacer"}),u.jsxs("div",{className:"handle-popper",children:[u.jsx("label",{className:Y({modified:l?a:s}),children:l?"Start Time":"End Time"}),u.jsx(ma,{ref:m,allowValueWrapping:!1,value:c,onChange:y,onSelect:w,"data-testid":o!==void 0?"".concat(o,"-input-2"):void 0})]}),u.jsx("div",{className:"flex",style:{flexBasis:"calc(".concat((ft-c)/ft*100,"% - ").concat(Pd/2,"px)")}})]})}function By(r){var{startTime:e,endTime:t,"data-testid":n}=r;return u.jsxs("div",{className:"track-fills","data-testid":n,children:[e>t&&u.jsxs(u.Fragment,{children:[u.jsx("div",{className:"track-fill track-fill-start",style:{transform:"scaleX(".concat(t/ft,")")}}),u.jsx("div",{className:"track-fill track-fill-end",style:{transform:"scaleX(".concat((ft-e)/ft,")")}})]}),e<t&&u.jsx("div",{className:"track-fill track-fill-middle",style:{transform:"translateX(".concat(e/ft*100,"%) scaleX(").concat((t-e)/ft,")")}})]})}function Td(r){var{track:e,time:t,setTime:n,"data-testid":i}=r,a=v.useMemo(()=>{var f=3600,p=Ui/2;return t<f?p=t/f*(Ui/2):t>23*f&&(p=Ui/2+1/(ft-23*f)*(t-23*f)*(Ui/2)),"translateX(calc(".concat(t/ft*100,"% - ").concat(p,"px))")},[t]),s=v.useCallback(f=>{if(!e.current)return 0;var p=e.current.getBoundingClientRect(),m=Math.max(f-p.left,0),b=ft*Math.min(1,m/p.width),g=_d*Math.round(b/_d),C=Math.min(ft,g);return C},[e]),o=v.useCallback(f=>{var{clientX:p}=f;n(s(p))},[n,s]),l=v.useCallback(f=>{var{clientX:p}=f;n(s(p)),window.removeEventListener("mousemove",o),window.removeEventListener("mouseup",l),document.documentElement.classList.remove("drag-pointer-events-none")},[n,s,o]),d=v.useCallback(()=>{window.addEventListener("mousemove",o),window.addEventListener("mouseup",l),document.documentElement.classList.add("drag-pointer-events-none")},[o,l]),h=v.useCallback(()=>{window.removeEventListener("mousemove",o),window.removeEventListener("mouseup",l),document.documentElement.classList.remove("drag-pointer-events-none")},[o,l]),c=v.useCallback(()=>{d()},[d]);return v.useEffect(function(){return()=>{h()}},[h]),u.jsx("div",{className:"handle-track",style:{transform:a},children:u.jsx("button",{className:"handle",type:"button","aria-label":"Change time",onMouseDown:c,"data-testid":i})})}function Ov(r){var{buttons:e,isShown:t=!1,classNames:n,message:i,type:a,onClick:s,onDismiss:o,"data-testid":l}=r,d=e&&e.length!==0;return u.jsx(Hn,{in:t,timeout:Vn.transitionMs,classNames:"toast-notification-slide-up",mountOnEnter:!0,unmountOnExit:!0,children:u.jsxs("div",{className:Y("toast-notification",n,a),role:"presentation",onClick:s,onKeyPress:s,"data-testid":l,children:[u.jsx("div",{className:"message-container",children:u.jsx("span",{className:"message",children:i})}),u.jsx(Hn,{in:d,timeout:Vn.transitionSlowMs,classNames:"fade",mountOnEnter:!0,unmountOnExit:!0,children:u.jsx("div",{className:"buttons-container",children:e})}),o&&u.jsx(K,{kind:"ghost",icon:To,tooltip:"Close notification",className:"my-2",onClick:o})]})})}Ov.TYPE=Object.freeze({ERROR:"error"});function Wy(r){var{children:e,className:t,labelText:n,hintText:i,isModified:a,validationError:s,showValidationError:o=!0,"data-testid":l,id:d}=r,{current:h}=v.useRef(d??Ee());return u.jsxs(u.Fragment,{children:[u.jsx("label",{className:Y("validate-label",t,{modified:a}),htmlFor:h,"data-testid":l,children:n}),X.Children.toArray(e).map(c=>X.isValidElement(c)?X.cloneElement(c,{className:Y(c.props.className,{"is-invalid":s})}):u.jsx("div",{className:Y(t),children:c})),i!==void 0&&u.jsx("small",{className:"form-text text-muted",children:i}),s!==void 0&&o&&u.jsx("p",{className:"validate-label-error text-danger",children:s})]})}const Gy=Object.freeze(Object.defineProperty({__proto__:null,ActionButtonDialogTrigger:Jc,AutoCompleteInput:DS,AutoResizeTextarea:Wo,BasicModal:_n,BulkActionBar:FS,Button:K,ButtonGroup:wi,ButtonOld:Ws,CSS_VAR_EXPRESSION_PREFIX:og,CardFlip:Ha,Checkbox:va,Collapse:jS,ComboBox:db,ConfirmActionButton:gS,ConfirmationDialog:pv,ContextActionUtils:ub,ContextActions:ae,ContextMenuItem:hb,ContextMenuRoot:Dc,CopyButton:Mo,CustomTimeSelect:WS,DEFAULT_DARK_THEME_KEY:lg,DEFAULT_DARK_THEME_PALETTE:dg,DEFAULT_GET_PREFERRED_REPLACEMENT_STRING:Oc,DEFAULT_LIGHT_THEME_KEY:ug,DEFAULT_PRELOAD_DATA_VARIABLES:hg,DateInput:YS,DateTimeInput:cb,DebouncedModal:xS,DebouncedSearchInput:Ev,DragUtils:Us,DraggableItemList:vb,DropdownMenu:En,EditableItemList:QS,ErrorBoundary:ey,GLOBAL_SHORTCUTS:wr,HierarchicalCheckboxMenu:iy,IconActionButton:mv,InfoModal:IS,ItemList:Er,ItemListItem:fb,get KEY(){return fe},LoadingOverlay:tt,LoadingSpinner:Fa,Logo:by,get MODIFIER(){return pe},MaskedInput:No,Menu:pb,MenuItem:mb,Modal:bi,ModalBody:Ci,ModalFooter:$a,ModalHeader:La,NON_WHITESPACE_REGEX:cg,NavTabList:my,Option:gb,Page:bb,Popper:Si,RadioGroup:xc,RadioItem:Hs,RandomAreaPlotAnimation:Pv,SVG_ICON_MANUAL_COLOR_MAP:vg,SearchInput:yi,SearchableCombobox:Fy,Select:Bn,SelectValueList:Ic,Shortcut:Cb,ShortcutRegistry:Ke,SocketedButton:zo,Stack:Sb,THEME_CACHE_LOCAL_STORAGE_KEY:fg,TMP_CSS_PROP_PREFIX:pg,TableViewEmptyState:Ry,TextWithTooltip:_v,ThemeContext:yb,ThemeExport:Vn,ThemePicker:gy,ThemeProvider:Nc,TimeInput:ma,TimeSlider:Hy,ToastNotification:Ov,Tooltip:wt,UISwitch:Mc,ValidateLabelInput:Wy,WHITESPACE_REGEX:mg,calculatePreloadStyleContent:gg,createCssVariableResolver:bg,createPreloadStyleElement:Cg,extractDistinctCssVariableExpressions:Sg,fillToLength:Eb,getActiveThemes:yg,getDefaultBaseThemes:Eg,getExpressionRanges:gc,getThemeKey:bc,getThemePreloadData:wg,overrideSVGFillColors:Pg,preloadTheme:_g,replaceSVGFillColor:Tg,resolveCssVariablesInRecord:Oo,resolveCssVariablesInString:Og,setThemePreloadData:Dg,themeDHDefault:wb,themeDark:xg,themeLight:Ig,trimTrailingMask:Pb,useTheme:Rr},Symbol.toStringTag,{value:"Module"}));function zy(r,e){var t=He(),n=v.useMemo(()=>new t.CoreClient(r,e),[t,r,e]);return v.useEffect(()=>()=>{n.disconnect()},[n]),n}var Ko=v.createContext(null);function Dv(r){var{serverUrl:e,options:t,children:n}=r,i=zy(e,t);return u.jsx(Ko.Provider,{value:i,children:n})}function Od(r,e,t,n,i,a,s){try{var o=r[a](s),l=o.value}catch(d){t(d);return}o.done?e(l):Promise.resolve(l).then(n,i)}function Ky(r){return function(){var e=this,t=arguments;return new Promise(function(n,i){var a=r.apply(e,t);function s(l){Od(a,n,i,s,o,"next",l)}function o(l){Od(a,n,i,s,o,"throw",l)}s(void 0)})}}var xv=v.createContext(null);function Iv(r){var[e,t]=v.useState(null),[n,i]=v.useState(null),a=v.useContext(xv),s=v.useContext(Aa);return v.useEffect(()=>{if(a==null){if(s!=null){t(s),i(null);return}t(null),i(new Error("No API available in useDeferredApi. Was code wrapped in ApiBootstrap or DeferredApiContext.Provider?"));return}var o=!1;function l(){return d.apply(this,arguments)}function d(){return d=Ky(function*(){if(typeof a=="function")try{var h=yield a(r);o||(t(h),i(null))}catch(c){o||(t(null),i(c))}else t(a)}),d.apply(this,arguments)}return l(),()=>{o=!0}},[s,a,r]),[e,n]}var Nv=X.memo(r=>{var{children:e,onError:t,widget:n}=r,[i,a]=Iv(n);return a!=null?(t==null||t(a),null):i==null?null:u.jsx(Aa.Provider,{value:i,children:e})});Nv.displayName="DeferredApiBootstrap";function Gn(){return Ar(Ko,"No Client available in useClient. Was code wrapped in ClientBootstrap or ClientContext.Provider?")}function qo(r){return typeof r=="object"&&r!=null&&typeof r.type=="string"&&r.name!=null}function Yo(r){return typeof r=="object"&&r!=null&&typeof r.type=="string"&&r.id!=null}function qy(r){return qo(r)||Yo(r)}var Xo=v.createContext(null);function Mv(r){if(Yo(r))return{id:r.id,type:r.type};if(qo(r)){var e;return{name:(e=r.name)!==null&&e!==void 0?e:"",type:r.type}}throw new Error("Invalid descriptor: ".concat(r))}function Lv(r){var e,t;return{type:(e=r.type)!==null&&e!==void 0?e:"",name:(t=r.title)!==null&&t!==void 0?t:r.name,id:r.id}}function Fv(){return Ar(Xo,"No ObjectFetcher available in useObjectFetcher. Was code wrapped in ObjectFetcherContext.Provider?")}const Yy=Object.freeze(Object.defineProperty({__proto__:null,ApiBootstrap:Ng,ApiContext:Aa,ClientBootstrap:Dv,ClientContext:Ko,DeferredApiBootstrap:Nv,DeferredApiContext:xv,ObjectFetcherContext:Xo,getVariableDescriptor:Lv,isIdVariableDescriptor:Yo,isNameVariableDescriptor:qo,isVariableDescriptor:qy,sanitizeVariableDescriptor:Mv,useApi:He,useClient:Gn,useDeferredApi:Iv,useObjectFetcher:Fv},Symbol.toStringTag,{value:"Module"}));function Xy(r){return function(t){var{children:n}=t;return u.jsx(Aa.Provider,{value:r,children:n})}}function Dd(r,e,t,n,i,a,s){try{var o=r[a](s),l=o.value}catch(d){t(d);return}o.done?e(l):Promise.resolve(l).then(n,i)}function Zy(r){return function(){var e=this,t=arguments;return new Promise(function(n,i){var a=r.apply(e,t);function s(l){Dd(a,n,i,s,o,"next",l)}function o(l){Dd(a,n,i,s,o,"throw",l)}s(void 0)})}}var Ss=B.module("MessageUtils"),Av="io.deephaven.message.LoginOptions.request",Rv="io.deephaven.message.SessionDetails.request",jv="io.deephaven.broadcast",Zo="io.deephaven.broadcast.Login",kv="io.deephaven.broadcast.Logout";function Va(r){var e=r;return e!=null&&typeof e.id=="string"&&typeof e.message=="string"}function $v(r){return Va(r)&&r.message===Zo}function Uv(r){return Va(r)&&r.message===kv}function Hv(r){var e=r;return e!=null&&typeof e.id=="string"}function Qo(r){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Ee(),t=arguments.length>2?arguments[2]:void 0;return{message:r,id:e,payload:t}}function Qy(r,e){return{id:r,payload:e}}function Jo(){return window.opener!=null?window.opener:window.parent!=null&&window.parent!==window?window.parent:null}function el(r){return zs.apply(this,arguments)}function zs(){return zs=Zy(function*(r){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:3e4,t=Jo();if(t==null)throw new Error("window parent is null, unable to send request.");return new Promise((n,i)=>{var a,s=Ee(),o=l=>{var{data:d}=l;if(!Hv(d)){Ss.debug("Ignoring non-deephaven response",d);return}if(Ss.debug("Received message",d),(d==null?void 0:d.id)!==s){Ss.debug("Ignore message, id doesn't match",d);return}window.clearTimeout(a),window.removeEventListener("message",o),n(d.payload)};window.addEventListener("message",o),a=window.setTimeout(()=>{window.removeEventListener("message",o),i(new _b("Request timed out"))},e),t.postMessage(Qo(r,s),"*")})}),zs.apply(this,arguments)}function Jy(r,e,t){return e=eE(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function eE(r){var e=tE(r,"string");return typeof e=="symbol"?e:String(e)}function tE(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class Vv extends Error{constructor(){super(...arguments),Jy(this,"isNoConsolesError",!0)}}function Bv(r){return r.isNoConsolesError}function xd(r,e,t,n,i,a,s){try{var o=r[a](s),l=o.value}catch(d){t(d);return}o.done?e(l):Promise.resolve(l).then(n,i)}function Ba(r){return function(){var e=this,t=arguments;return new Promise(function(n,i){var a=r.apply(e,t);function s(l){xd(a,n,i,s,o,"next",l)}function o(l){xd(a,n,i,s,o,"throw",l)}s(void 0)})}}var or=B.module("SessionUtils");function nE(r,e){return or.info("Starting connection to '".concat(e,"'...")),new r.IdeConnection(e)}function Wv(r,e,t){return Ks.apply(this,arguments)}function Ks(){return Ks=Ba(function*(r,e,t){or.info("Getting console types...");var n=yield e.getConsoleTypes();if(n.length===0)throw new Vv("No console types available");or.info("Available types:",n);var i=n[0];or.info("Starting session with type",i);var a=yield e.startSession(i),s={type:i,id:Ee.generate()};return or.info("Console session established",s),{session:a,config:s,connection:e,details:t,dh:r}}),Ks.apply(this,arguments)}function rE(r,e,t){return or.info("createCoreClient",e),new r.CoreClient(e,t)}function iE(r){return r!=null&&typeof r=="object"}function aE(){return qs.apply(this,arguments)}function qs(){return qs=Ba(function*(){var r=yield el(Rv);if(!iE(r))throw new Error("Unexpected session details response: ".concat(r));return r}),qs.apply(this,arguments)}function sE(){return Ys.apply(this,arguments)}function Ys(){return Ys=Ba(function*(){var r=new URLSearchParams(window.location.search);switch(r.get("authProvider")){case"parent":return aE()}return{}}),Ys.apply(this,arguments)}function oE(r,e,t){return Xs.apply(this,arguments)}function Xs(){return Xs=Ba(function*(r,e,t){var n;try{n=yield Wv(r,e,t)}catch(i){if(!Bv(i))throw i}return n}),Xs.apply(this,arguments)}const lE=Object.freeze(Object.defineProperty({__proto__:null,BROADCAST_CHANNEL_NAME:jv,BROADCAST_LOGIN_MESSAGE:Zo,BROADCAST_LOGOUT_MESSAGE:kv,BooleanColumnFormatter:Tb,CharColumnFormatter:Ob,DateTimeColumnFormatter:Lo,DateUtils:Fo,DecimalColumnFormatter:Db,DefaultColumnFormatter:xb,FETCH_TIMEOUT:Ib,Formatter:Pr,FormatterUtils:wn,IntegerColumnFormatter:Nb,LOGIN_OPTIONS_REQUEST:Av,NoConsolesError:Vv,SESSION_DETAILS_REQUEST:Rv,StringColumnFormatter:Mb,TableColumnFormatter:Lb,TableUtils:Ie,createComboboxFilterArgs:Fb,createConnection:nE,createCoreClient:rE,createFilterConditionFactory:Ao,createKeyFromOffsetRow:Ab,createNotNullOrEmptyFilterCondition:Lc,createOnTableUpdatedHandler:Fc,createSearchTextFilter:Ro,createSelectedValuesFilter:jo,createSessionWrapper:Wv,createShowOnlyEmptyFilterCondition:Ac,createValueFilter:Rc,defaultRowDeserializer:jc,fetchVariableDefinition:Rb,generateEmptyKeyedItems:kc,getColumnFormats:jb,getDateTimeFormatterOptions:kb,getSessionDetails:sE,getSize:ko,getWindowParent:Jo,isBroadcastLoginMessage:$v,isBroadcastLogoutMessage:Uv,isClosed:fa,isCustomColumnFormatDefined:$b,isMessage:Va,isNoConsolesError:Bv,isResponse:Hv,loadSessionWrapper:oE,makeMessage:Qo,makeResponse:Qy,padFirstAndLastRow:$c,requestParentResponse:el},Symbol.toStringTag,{value:"Module"}));var Id=B.module("useTableListener"),dE=(r,e,t)=>v.useEffect(function(){if(r==null){Id.debug2("Emitter undefined, skipping addEventListener",e);return}return Id.debug2("Adding listener",e),r.addEventListener(e,t)},[r,e,t]);const fr=dE;function uE(r,e,t){return e=hE(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function hE(r){var e=cE(r,"string");return typeof e=="symbol"?e:String(e)}function cE(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class vE extends Error{constructor(){super(...arguments),uE(this,"isColumnNameError",!0)}}const fE=vE;function pE(r,e,t){return e=mE(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function mE(r){var e=gE(r,"string");return typeof e=="symbol"?e:String(e)}function gE(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class bE extends Error{constructor(){super(...arguments),pE(this,"isTableDisconnectError",!0)}}const CE=bE;var Hi=B.module("useTable"),SE=(r,e,t,n)=>{var i=He(),[a,s]=v.useState(void 0),[o,l]=v.useState([]),[d,h]=v.useState(null),[c,f]=v.useState(null);v.useEffect(()=>{if(n===void 0){s(r==null?void 0:r.columns),h(null);return}try{s(r==null?void 0:r.findColumns(n)),h(null)}catch(g){Hi.error("Column not found",g,n),h(new fE("Invalid columnNames argument"))}},[r,n]),v.useEffect(()=>{if(!a||!r){Hi.debug2("Table or column not initialized, skip viewport update.");return}Hi.debug2("Setting viewport",e,t),r.setViewport(e,t,a)},[a,r,e,t]);var p=v.useCallback(g=>{var{detail:C}=g;if(!a){Hi.error("Columns not initialized.");return}var y=a.map(S=>C.rows.map(w=>w.get(S)));l(y)},[a]),m=v.useCallback(()=>{f(new CE("Table disconnected"))},[]),b=v.useCallback(()=>{f(null)},[]);return fr(r,i.Table.EVENT_UPDATED,p),fr(r,i.Table.EVENT_DISCONNECT,m),fr(r,i.Table.EVENT_RECONNECT,b),{columns:a,data:o,error:c??d}};const Gv=SE;var yE=(r,e,t,n)=>{var i=v.useMemo(()=>[n],[n]),{columns:a=[],data:s=[],error:o}=Gv(r,e,t,i);return{column:a[0],data:s[0],error:o}};const zv=yE;function Nd(r,e,t,n,i,a,s){try{var o=r[a](s),l=o.value}catch(d){t(d);return}o.done?e(l):Promise.resolve(l).then(n,i)}function EE(r){return function(){var e=this,t=arguments;return new Promise(function(n,i){var a=r.apply(e,t);function s(l){Nd(a,n,i,s,o,"next",l)}function o(l){Nd(a,n,i,s,o,"throw",l)}s(void 0)})}}var Gt=B.module("TableInput"),ys=250;function tl(r){var e,t,{className:n=void 0,columnName:i,settings:a,defaultValue:s=[],isInvalid:o=!1,onChange:l=()=>!1,onBlur:d=()=>!1,table:h}=r,c=v.useRef(null),f=He(),p=v.useMemo(()=>{var V=wn.getColumnFormats(a),N=wn.getDateTimeFormatterOptions(a),{defaultDecimalFormatOptions:P={},defaultIntegerFormatOptions:R={}}=a;return new Pr(f,V,N,P,R)},[f,a]),[m,b]=v.useState(""),[g,C]=v.useState(new Set(s)),[y,S]=v.useState(),w=v.useRef(null),E=Math.min((e=y==null?void 0:y.size)!==null&&e!==void 0?e:0,ys),{column:x,data:D,error:T}=zv(y,0,ys-1,i),I=v.useCallback(V=>x?p.getFormattedString(V,x.type,x.name):"".concat(V),[x,p]),[j,W]=v.useMemo(()=>{var V=new Set(g),N=[];if(D==null)return[N,null];if(D.forEach(R=>{var U="".concat(R),Q=g.has(U);Q&&V.delete(U),N.push({value:U,displayValue:I(R),isSelected:Q})}),V.size>0){Gt.debug2("Selection has items that are missing from the viewport");var P=new Set(g);return Array.from(V).forEach(R=>{P.delete(R)}),[N,P]}return[N,null]},[D,g,I]);v.useEffect(()=>{W!==null&&(C(W),l(Array.from(W)))},[l,W]);var L=v.useCallback(function(){var V=EE(function*(N){try{var P=yield N;Gt.debug("Table resolved",P),S(P)}catch(R){if(ye.isCanceled(R))return;Gt.error(R)}});return function(N){return V.apply(this,arguments)}}(),[]);v.useEffect(()=>{var V=ye.makeCancelable(h);return L(V),()=>{Gt.debug2("Cancel table promise"),V.cancel()}},[h,L]);var O=v.useCallback(V=>{var{value:N}=V.target;b(N);var P=j.findIndex(U=>U.displayValue.includes(N));if(P>-1){var R;Gt.debug2("Found ".concat(N," at index ").concat(P)),(R=w.current)===null||R===void 0||R.scrollIntoView(P)}else Gt.debug2("".concat(N," not found"))},[j,w]),M=v.useCallback(V=>{if(Gt.debug("handleSelect",V),V>=j.length){Gt.error("Invalid index",V);return}var N=j[V].value,P=new Set(g);j[V].isSelected?P.delete(N):P.add(N),C(P),l(Array.from(P))},[l,j,g]),A=v.useCallback(()=>{var V=j.map(P=>P.value),N=new Set(V);C(N),l(V)},[j,l]),k=v.useCallback(()=>{C(new Set),l([])},[l]),H=v.useCallback(()=>{},[]),q=v.useCallback(V=>{var N,{relatedTarget:P}=V;Gt.debug("handleChildBlur",P,P instanceof HTMLElement,c.current,(N=c.current)===null||N===void 0?void 0:N.contains(P)),(!P||c.current&&P instanceof HTMLElement&&!c.current.contains(P))&&d()},[d]),re=j.length===0;return u.jsxs("div",{ref:c,className:Y("table-input-container d-flex flex-column position-relative",n),children:[u.jsx(yi,{disabled:!!T||re,value:m,placeholder:"Search",onChange:O,className:"mb-2 d-flex",onBlur:q}),u.jsx(Ic,{className:"table-input-list",disabled:y===void 0||re,isInvalid:o,items:re?[{value:"Empty",isSelected:!1}]:j,itemCount:E,offset:0,onSelect:M,onViewportChange:H,ref:w,onBlur:q}),y&&u.jsxs("div",{className:"meta-row",children:[u.jsx("div",{className:"d-flex align-items-center text-muted small",children:y!=null&&y.size>E&&u.jsxs(u.Fragment,{children:["Table is too large, showing the first ",ys," items."]})}),u.jsxs("div",{children:[u.jsx("button",{type:"button",className:"btn btn-link",onBlur:q,onClick:A,children:"Select All"}),u.jsx("button",{type:"button",className:"btn btn-link mr-a",onBlur:q,onClick:k,children:"Clear"})]})]}),y==null||T&&u.jsx("div",{className:"h-100 w-100 position-absolute",children:u.jsx(tt,{isLoaded:y!=null,isLoading:y==null&&T==null,errorMessage:(t=T==null?void 0:T.message)!==null&&t!==void 0?t:null})})]})}tl.displayName="TableInput";tl.defaultProps={isInvalid:!1,className:void 0};var Md=B.module("useBroadcastChannel");function nl(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Ub,e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:jv,t=v.useMemo(()=>new BroadcastChannel(e),[e]);return v.useEffect(()=>()=>{t.close()},[t]),v.useEffect(()=>{function n(i){var{data:a}=i;if(!Va(a)){Md.debug("Ignoring non-deephaven message",a);return}Md.debug("event received",a),r(i)}return t.addEventListener("message",n),()=>{t.removeEventListener("message",n)}},[t,r]),t}function Wa(r,e){var t=v.useCallback(n=>{$v(n.data)?r==null||r(n.data):Uv(n.data)&&(e==null||e(n.data))},[r,e]);nl(t)}var ga="io.deephaven.web.client.auth.refreshToken",Kv=v.createContext(null),wE=B.module("RefreshTokenUtils");function Zs(){var r=yr.get(ga);try{if(r!=null)return JSON.parse(r)}catch(e){wE.error("Error parsing refresh token",r,e)}return null}function Qs(r){if(r==null){yr.remove(ga);return}var e=JSON.stringify({bytes:r.bytes,expiry:r.expiry}),t=new Date(r.expiry);yr.set(ga,e,{secure:!0,sameSite:"strict",expires:t})}function qv(r){var{children:e}=r,t=He(),n=Gn(),[i,a]=v.useState(Zs());v.useEffect(function(){var d=n.addEventListener(t.CoreClient.EVENT_REFRESH_TOKEN_UPDATED,h=>{var{detail:c}=h;Qs(c),a(c)});return d},[t,n,i]);var s=v.useCallback(()=>{a(Zs())},[]),o=v.useCallback(()=>{Qs(null),a(null)},[]);return Wa(s,o),u.jsx(Kv.Provider,{value:i,children:e})}function nn(){var r=He();return v.useMemo(()=>new Ie(r),[r])}function PE(r,e,t,n){var i=nn(),[a,s]=v.useState(""),{value:o}=Ei(a,t),l=v.useCallback(f=>{s(f.trim())},[]),{data:d,isLoading:h}=ui(i.doesColumnValueExist,[r,e,o,n]),c=h||a!==o?null:d;return{valueTrimmed:a,valueTrimmedDebounced:o,valueExists:c,trimAndUpdateValue:l}}var Ld=B.module("useDebouncedViewportSearch"),_E=200;function TE(r,e){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:_E,n=nn(),{table:i,applyFiltersAndRefresh:a}=r,s=v.useMemo(()=>Le(o=>{if(Ld.debug("Applying debounced searchText '".concat(o,"'")),i!=null){var l=o.trim();if(l===""){a([]);return}var d=i.findColumn(e),h=n.makeFilterValue(d.type,l),c=[d.filter().contains(h)];a(c)}},t),[a,e,t,i,n]);return v.useEffect(()=>()=>{Ld.debug("Cancelling debounced search function"),s.cancel()},[s]),s}var Yv=300;function OE(r){var{viewportData:e,columnName:t,shouldSelectAllOnNoSelection:n,mapItemToValue:i}=r,a=nn(),s=uv(e,i),{value:o}=Ei(s,Yv),l=ov(o,tv);return v.useMemo(()=>jo(a,t,l.selection,n,l.isInverted),[t,l,n,a])}function rl(r){for(var e=arguments.length,t=new Array(e>1?e-1:0),n=1;n<e;n++)t[n-1]=arguments[n];return v.useMemo(()=>Hb(...t.map(i=>i(r))),[r,...t])}function DE(r,e,t,n){var i=v.useRef("");return i.current=t,v.useMemo(()=>{var a=r.length>0&&r[0].item==null;return!a&&n!=null&&(i.current===""||n.toLowerCase().includes(i.current.toLowerCase()))?[{key:n,item:{[e]:n}},...r]:r},[n,e,r])}function Fd(r,e,t,n,i,a,s){try{var o=r[a](s),l=o.value}catch(d){t(d);return}o.done?e(l):Promise.resolve(l).then(n,i)}function xE(r){return function(){var e=this,t=arguments;return new Promise(function(n,i){var a=r.apply(e,t);function s(l){Fd(a,n,i,s,o,"next",l)}function o(l){Fd(a,n,i,s,o,"throw",l)}s(void 0)})}}function IE(r){var{table:e,columnName:t,defaultValue:n,itemHeight:i,topOffset:a=0,value:s}=r;return v.useCallback(xE(function*(){if(e==null||s===""||s===n)return a;var o=e.findColumn(t),l=yield e.seekRow(0,o,"String",s),d=n==null?0:1;return(l+d)*i+a}),[t,n,i,e,a,s])}function il(r){var[,e]=v.useState(0),t=He();return fr(r,t.Table.EVENT_SIZECHANGED,()=>{e(n=>n+1)}),ko(r)}var NE=B.module("useInitializeViewportData");function Xv(r){var e=vv({}),t=Math.max(0,il(r));return v.useEffect(()=>{var n=e.items.length;t!==n&&(NE.debug("size changed:",{currentSize:n,targetSize:t}),e.setItems(Array.from(kc(0,t-1))))},[t,r]),e}function Zv(r,e,t){return v.useCallback(function(i){var[a,s]=$c(i,e,t,ko(r));r==null||r.setViewport(a,s)},[r,t,e])}var Ad=B.module("useViewportData");function al(r){var{table:e,itemHeight:t=1,scrollDebounce:n=jC,viewportSize:i=10,viewportPadding:a=50,deserializeRow:s=jc}=r,o=Xv(e),l=Zv(e,i,a),d=v.useCallback(b=>{e&&!fa(e)?l(b):Ad.debug("setViewport called on closed table.",e)},[e,l]),h=v.useCallback(b=>{e&&!fa(e)?(e.applyFilter(b),d(0)):Ad.debug("applyFiltersAndRefresh called on closed table.",e)},[d,e]),c=He(),f=v.useMemo(()=>Fc(o,s),[s,o]);fr(e,c.Table.EVENT_UPDATED,f);var p=il(e);v.useEffect(()=>{d(0)},[e,d,p]);var m=hv(t,d,n);return v.useMemo(()=>({viewportData:o,size:p,table:e,applyFiltersAndRefresh:h,setViewport:d,onScroll:m}),[h,m,d,p,e,o])}function sl(r,e){var{applyFiltersAndRefresh:t}=r;v.useEffect(()=>{t(e)},[t,e])}function ME(r,e){for(var t=nn(),[n,i]=v.useState(""),a=v.useMemo(()=>Ro(t,e,n),[e,n,t]),s=pa(i,Vs),o=al({table:r,itemHeight:RC,viewportSize:Zc,viewportPadding:Qc}),l=arguments.length,d=new Array(l>2?l-2:0),h=2;h<l;h++)d[h-2]=arguments[h];var c=rl(o.table,a,...d);return sl(o,c),{list:o,onSearchTextChange:s}}function LE(r){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"or",t=nn(),n=v.useMemo(()=>Lc(t),[t]);return v.useMemo(()=>Ao(r,n,e),[r,e,n])}function Qv(r){v.useEffect(()=>()=>{r!=null&&(fa(r)||r.close())},[r])}function FE(r){var{maybeTable:e,columnName:t,mapItemToValue:n,filterConditionFactories:i=[],trimSearchText:a=!1}=r,s=nn(),[o,l]=v.useState(""),[d,h]=v.useState(""),c=v.useCallback(q=>{h(a?q.trim():q)},[a]),f=v.useMemo(()=>a?o.trim():o,[o,a]),[p,m]=v.useState(null),[b,g]=v.useState(()=>new Map),{data:C,isLoading:y}=ui(s.doesColumnValueExist,[e,t,d,!1]),{isDebouncing:S}=Ei(d,Vs),w=S||y?null:C,E=v.useMemo(()=>Ro(s,t,d),[d,t,s]),x=v.useMemo(()=>jo(s,t,new Set(b.keys()),!1,!0),[t,b,s]),{data:D}=ui(s.createDistinctSortedColumnTable,[e,t,"asc",...i]);Qv(D);var T=al({table:D,itemHeight:AC,viewportSize:Zc,viewportPadding:Qc}),I=f.length>0&&T.size===0,j=b.has(f),W=pa(c,Vs),L=v.useCallback(q=>{l(q),W(q)},[W]),O=pa(m,0),M=v.useCallback(q=>{if(l(""),c(""),m(q),O(null),q!=null){var re=T.viewportData.findItem(q);if(re!=null){var V=n(re);g(N=>{var P=new Map(N);return P.set(V,{value:V}),P})}}},[c,O,T.viewportData,n]),A=v.useCallback(q=>{g(re=>{if(q.size===0)return re;var V=new Map(re);for(var N of q)V.set(N,{value:N});return V})},[]),k=v.useCallback(q=>{g(re=>{if(q==="all")return new Map;var V=new Map(re);for(var N of q)V.delete(N);return V})},[]),H=rl(T.table,E,x);return sl(T,H),v.useMemo(()=>({list:T,hasSearchTextWithZeroResults:I,searchText:o,searchTextExists:w,searchTextIsInSelectedValues:j,selectedKey:p,selectedValueMap:b,onSearchTextChange:L,onSelectKey:M,onAddValues:A,onRemoveValues:k}),[I,T,A,k,L,M,o,w,j,p,b])}function Rd(r,e,t,n,i,a,s){try{var o=r[a](s),l=o.value}catch(d){t(d);return}o.done?e(l):Promise.resolve(l).then(n,i)}function AE(r){return function(){var e=this,t=arguments;return new Promise(function(n,i){var a=r.apply(e,t);function s(l){Rd(a,n,i,s,o,"next",l)}function o(l){Rd(a,n,i,s,o,"throw",l)}s(void 0)})}}function RE(r){for(var e=arguments.length,t=new Array(e>1?e-1:0),n=1;n<e;n++)t[n-1]=arguments[n];var i=v.useCallback(AE(function*(){var d;return(d=r==null?void 0:r.selectDistinct(r.findColumns(t)))!==null&&d!==void 0?d:null}),[r,...t]),{data:a,error:s,isError:o,isLoading:l}=ui(i,[]);return v.useEffect(()=>()=>{a==null||a.close()},[a]),{distinctTable:a,error:s,isError:o,isLoading:l}}function jE(r,e){var t=nn(),n=v.useMemo(()=>Ac(t,r),[r,t]);return v.useMemo(()=>Ao(e,n),[e,n])}function kE(r,e,t){var n=nn();return v.useMemo(()=>Rc(n,r,e,t),[r,t,n,e])}const $E=Object.freeze(Object.defineProperty({__proto__:null,DEBOUNCE_MS:Yv,REFRESH_TOKEN_KEY:ga,RefreshTokenBootstrap:qv,RefreshTokenContext:Kv,TableDropdown:Vb,TableInput:tl,makeApiContextWrapper:Xy,readRefreshToken:Zs,storeRefreshToken:Qs,useBroadcastChannel:nl,useBroadcastLoginListener:Wa,useCheckIfExistsValue:PE,useDebouncedViewportSearch:TE,useDebouncedViewportSelectionFilter:OE,useFilterConditionFactories:rl,useFilteredItemsWithDefaultValue:DE,useGetItemPosition:IE,useInitializeViewportData:Xv,useNotNullOrEmptyFilter:LE,usePickerWithSelectedValues:FE,useSearchableViewportData:ME,useSelectDistinctTable:RE,useSetPaddedViewportCallback:Zv,useShowOnlyEmptyFilter:jE,useTable:Gv,useTableClose:Qv,useTableColumn:zv,useTableListener:fr,useTableSize:il,useTableUtils:nn,useValueFilter:kE,useViewportData:al,useViewportFilter:sl},Symbol.toStringTag,{value:"Module"}));var Jv=v.createContext(!1);function UE(r){var{fontClassNames:e=["fira-sans-regular","fira-sans-semibold","fira-mono"],children:t}=r,[n,i]=v.useState(!1);return v.useEffect(function(){document.fonts.ready.then(()=>{i(!0)})},[]),u.jsxs(u.Fragment,{children:[u.jsx(Jv.Provider,{value:n,children:t}),u.jsx("div",{id:"preload-fonts",style:{visibility:"hidden",position:"absolute",top:-1e4},children:e.map(a=>u.jsx("p",{className:a,children:"preload"},a))})]})}var Pi=v.createContext(null),nt=Object.freeze({AUTH_PLUGIN:"AuthPlugin",DASHBOARD_PLUGIN:"DashboardPlugin",WIDGET_PLUGIN:"WidgetPlugin",TABLE_PLUGIN:"TablePlugin",THEME_PLUGIN:"ThemePlugin"});function ef(r){return"DashboardPlugin"in r}function ba(r){return"AuthPlugin"in r}function ol(r){return"TablePlugin"in r}function tf(r){return ef(r)||ba(r)||ol(r)}function HE(r){return"type"in r&&r.type===nt.DASHBOARD_PLUGIN}function _i(r){return"type"in r&&r.type===nt.WIDGET_PLUGIN}function nf(r){return"type"in r&&r.type===nt.TABLE_PLUGIN}function rf(r){return"type"in r&&r.type===nt.AUTH_PLUGIN}function af(r){return"type"in r&&r.type===nt.THEME_PLUGIN}var VE=B.module("@deephaven/plugin.PluginUtils");function Js(r,e){return r==null||!_i(r)?!1:[r.supportedTypes].flat().some(t=>t===e)}function sf(r){var e=u.jsx(ne,{icon:Cc});if(!_i(r))return e;var{icon:t}=r;return t==null?e:v.isValidElement(t)?t:u.jsx(ne,{icon:t})}function of(r){var e=[...r.entries()].filter(t=>af(t[1]));return VE.debug("Getting theme data from plugins",e),e.map(t=>{var[n,i]=t,a=Array.isArray(i.themes)?i.themes:[i.themes];return a.map(s=>{var{name:o,baseTheme:l,styleContent:d}=s;return{baseThemeKey:"default-".concat(l??"dark"),themeKey:bc(n,o),name:o,styleContent:d}})}).flat()}function Ga(){return Ar(Pi,"No Plugins available in usePlugins. This can happen when plugins have not finished loading or if code is not wrapped in PluginsContext.Provider.")}function BE(r){var{fetch:e,type:t}=r,n=Ga(),i=v.useMemo(()=>[...n.values()].filter(_i).find(s=>[s.supportedTypes].flat().includes(t)),[n,t]);if(i!=null){var a=i.component;return u.jsx(a,{fetch:e})}throw new Error("Unknown widget type '".concat(t,"'"))}const WE=Object.freeze(Object.defineProperty({__proto__:null,PluginType:nt,PluginsContext:Pi,WidgetView:BE,getIconForPlugin:sf,getThemeDataFromPlugins:of,isAuthPlugin:rf,isDashboardPlugin:HE,isLegacyAuthPlugin:ba,isLegacyDashboardPlugin:ef,isLegacyPlugin:tf,isLegacyTablePlugin:ol,isTablePlugin:nf,isThemePlugin:af,isWidgetPlugin:_i,pluginSupportsType:Js,usePlugins:Ga},Symbol.toStringTag,{value:"Module"}));function GE(r){if(r==null)return!1;var e=r;return e.Component!==void 0&&typeof e.isAvailable=="function"}var lf="io.deephaven.auth.AnonymousAuthenticationHandler",zE="io.deephaven.authentication.psk.PskAuthenticationHandler";function jd(r,e,t){return e=KE(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function KE(r){var e=qE(r,"string");return typeof e=="symbol"?e:String(e)}function qE(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class YE extends Error{constructor(){super(...arguments),jd(this,"name","AuthenticationError"),jd(this,"isAuthenticationError",!0)}}const df=YE;function kd(r,e,t,n,i,a,s){try{var o=r[a](s),l=o.value}catch(d){t(d);return}o.done?e(l):Promise.resolve(l).then(n,i)}function XE(r){return function(){var e=this,t=arguments;return new Promise(function(n,i){var a=r.apply(e,t);function s(l){kd(a,n,i,s,o,"next",l)}function o(l){kd(a,n,i,s,o,"throw",l)}s(void 0)})}}var $d=B.module("AuthPluginBase");function ll(r){var{children:e,getLoginOptions:t}=r,n=Gn(),[i,a]=v.useState(),[s,o]=v.useState(!1);return v.useEffect(()=>{var l=!1;function d(){if(l)throw new Uc("Login canceled.")}function h(){return c.apply(this,arguments)}function c(){return c=XE(function*(){try{var f=yield t();d(),$d.info("Logging in..."),yield n.login(f),d(),o(!0)}catch(b){if(!l){var p;$d.error("Unable to login:",b);var m=(p=Tr(b))!==null&&p!==void 0?p:"Unable to login. Verify credentials.";a(new df(m)),o(!1)}}}),c.apply(this,arguments)}return h(),()=>{l=!0}},[n,t]),s?u.jsx(u.Fragment,{children:e}):u.jsx(tt,{"data-testid":"auth-base-loading",isLoading:i==null,isLoaded:!1,errorMessage:Tr(i)})}var ZE={canLogout:!1};function QE(r){var{children:e}=r,t=He(),n=v.useCallback(()=>({type:t.CoreClient.LOGIN_TYPE_ANONYMOUS}),[t]);return u.jsx(ll,{getLoginOptions:n,children:u.jsx(ja.Provider,{value:ZE,children:e})})}var JE={Component:QE,isAvailable:r=>r.includes(lf)};const uf=JE;function Ud(r,e,t,n,i,a,s){try{var o=r[a](s),l=o.value}catch(d){t(d);return}o.done?e(l):Promise.resolve(l).then(n,i)}function ew(r){return function(){var e=this,t=arguments;return new Promise(function(n,i){var a=r.apply(e,t);function s(l){Ud(a,n,i,s,o,"next",l)}function o(l){Ud(a,n,i,s,o,"throw",l)}s(void 0)})}}var tw=B.module("AuthPluginParent"),nw={canLogout:!1};function rw(r){return r!=null&&typeof r.type=="string"}function iw(){return eo.apply(this,arguments)}function eo(){return eo=ew(function*(){tw.info("Logging in by delegating to parent window...");var r=yield el(Av);if(!rw(r))throw new Error("Unexpected login options response: ".concat(r));return r}),eo.apply(this,arguments)}function aw(){var r;return(r=new URLSearchParams(window.location.search).get("authProvider"))!==null&&r!==void 0?r:""}function sw(r){var{children:e}=r;return u.jsx(ll,{getLoginOptions:iw,children:u.jsx(ja.Provider,{value:nw,children:e})})}var ow={Component:sw,isAvailable:()=>Jo()!=null&&aw()==="parent"};const hf=ow;function cf(r){var{children:e,errorMessage:t,isLoggingIn:n=!1,onSubmit:i}=r;return u.jsxs("form",{className:"login-form",onSubmit:a=>{a.preventDefault(),a.stopPropagation(),i==null||i(a)},children:[u.jsx("div",{className:"flex-spacer"}),u.jsxs("div",{className:"flex-wrapper",children:[u.jsx("fieldset",{disabled:n,className:"container-fluid",children:e}),u.jsx("div",{className:"form-group d-flex justify-content-end align-items-center mb-0",children:u.jsxs("button",{type:"submit",className:Y("btn btn-primary",{"btn-spinner":n},{"btn-cancelable":n}),"data-testid":"btn-login",children:[n&&u.jsxs("span",{children:[u.jsx(Fa,{className:"mr-2 loading-spinner-vertical-align"}),u.jsx("span",{className:"btn-normal-content",children:"Logging in"}),u.jsx("span",{className:"btn-hover-content",children:"Cancel"})]}),!n&&"Login"]})})]}),u.jsx("div",{className:"flex-spacer",children:t!=null&&u.jsx("p",{className:"error-message mb-0",role:"alert",children:"".concat(t)})})]})}function vf(r){var{children:e,logoPath:t="./logo.png"}=r;return u.jsxs("div",{className:"login-container",children:[u.jsx(Pv,{}),u.jsxs("div",{className:"login-box",children:[u.jsx("div",{className:"logo",children:u.jsx("img",{src:t,alt:"Deephaven Data Labs"})}),e,u.jsxs("p",{className:"footer",children:["© 2016-",new Date().getFullYear()," Deephaven Data Labs LLC. Patent Pending."]})]})]})}function Hd(r,e,t,n,i,a,s){try{var o=r[a](s),l=o.value}catch(d){t(d);return}o.done?e(l):Promise.resolve(l).then(n,i)}function Es(r){return function(){var e=this,t=arguments;return new Promise(function(n,i){var a=r.apply(e,t);function s(l){Hd(a,n,i,s,o,"next",l)}function o(l){Hd(a,n,i,s,o,"throw",l)}s(void 0)})}}var to="io.deephaven.authentication.psk.PskAuthenticationHandler",ff="psk",no="io.deephaven.web.client.auth.psk.token",lr=B.module("AuthPluginPsk");function lw(){return new URLSearchParams(window.location.search).get(ff)}function dw(){lr.debug2("clearWindowToken");var r=new URL(window.location.href);r.searchParams.delete(ff),window.history.replaceState(null,"",r.href)}function Vd(){var r;return(r=yr.get(no))!==null&&r!==void 0?r:null}function ws(r){lr.debug2("Storing token in cookie",r),r!=null?yr.set(no,r,{secure:!0,sameSite:"strict"}):yr.remove(no)}function uw(r){var{children:e,logoPath:t}=r,n=Gn(),i=v.useRef(null),a=v.useRef(null),[s,o]=v.useState(),[l,d]=v.useState(!1),[h,c]=v.useState(!1),[f,p]=v.useState(!1),[m,b]=v.useState(""),g=v.useCallback(function(){var E=Es(function*(x){var D=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;lr.info("Logging in..."),p(!0);var T=null;try{if(T=n.login({type:to,token:x}),a.current=T,yield T,lr.info("Logged in successfully"),a.current!==T)return;ws(x),c(!0)}catch(W){if(a.current!==T)return;if(d(!0),D){var I;lr.error("Unable to login",W);var j=(I=Tr(W))!==null&&I!==void 0?I:"Unable to login: Verify credentials.";o(new df(j))}}p(!1)});return function(x){return E.apply(this,arguments)}}(),[n]),C=v.useCallback(()=>{a.current=null,p(!1)},[]),y=v.useCallback(Es(function*(){lr.debug("onLogin");var E=Vd();h||f||E==null||g(E,!1)}),[h,f,g]),S=v.useCallback(()=>{ws(null)},[]);Wa(y,S),v.useEffect(()=>{var E=!1;function x(){return D.apply(this,arguments)}function D(){return D=Es(function*(){var T,I=(T=lw())!==null&&T!==void 0?T:Vd();if(dw(),I==null){d(!0);return}p(!0);try{yield n.login({type:to,token:I}),E||(ws(I),c(!0),p(!1))}catch{E||(d(!0),p(!1))}}),D.apply(this,arguments)}return x(),()=>{E=!0}},[n]);var w=v.useCallback(()=>{f?C():g(m)},[C,f,g,m]);return v.useEffect(function(){var x;(x=i.current)===null||x===void 0||x.focus()},[i,l]),u.jsxs(u.Fragment,{children:[h&&e,l&&u.jsx(Hn,{in:!h,timeout:Vn.transitionMs,classNames:"fade",mountOnEnter:!0,unmountOnExit:!0,children:u.jsx(vf,{logoPath:t,children:u.jsx(cf,{errorMessage:Tr(s),isLoggingIn:f,onSubmit:w,children:u.jsxs("div",{className:"form-group",children:[u.jsx("label",{htmlFor:"auth-psk-token-input",children:"Token"}),u.jsx("input",{id:"auth-psk-token-input",name:"token",className:"input-token form-control",type:"text",autoComplete:"username",autoCapitalize:"none",autoCorrect:"off",spellCheck:"false",ref:i,value:m,onChange:E=>{o(void 0),b(E.target.value)}})]})})})}),u.jsx(tt,{"data-testid":"auth-psk-loading",isLoaded:h||l,isLoading:!h&&!l})]})}var hw={Component:uw,isAvailable:r=>r.includes(to)};const pf=hw;function Bd(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,n)}return t}function Ps(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Bd(Object(t),!0).forEach(function(n){cw(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):Bd(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function cw(r,e,t){return e=vw(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function vw(r){var e=fw(r,"string");return typeof e=="symbol"?e:String(e)}function fw(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}var pw=B.module("UserUtils");function mf(r,e){return r.get("internal.webClient.appInit.".concat(e))}function gf(r){var e,t,n,i,a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};function o(g){return mf(r,g)}function l(g,C){var y=o(g);return y==="true"?!0:y==="false"?!1:(y!==void 0&&pw.warn("Unexpected value for ".concat(g,": ").concat(y)),C)}var d=(e=o("name"))!==null&&e!==void 0?e:"",h=(t=o("operateAs"))!==null&&t!==void 0?t:d,c=(n=(i=o("groups"))===null||i===void 0?void 0:i.split(","))!==null&&n!==void 0?n:[],f=l("canCopy",!0),p=l("canDownloadCsv",!0),m=l("canUsePanels",!0),b=l("canLogout",!0);return Ps(Ps({name:d,operateAs:h,groups:c},a),{},{permissions:Ps({canUsePanels:m,canCopy:f,canDownloadCsv:p,canLogout:b},s)})}const mw=Object.freeze(Object.defineProperty({__proto__:null,AUTH_HANDLER_TYPE_ANONYMOUS:lf,AUTH_HANDLER_TYPE_PSK:zE,AuthPluginAnonymous:uf,AuthPluginBase:ll,AuthPluginParent:hf,AuthPluginPsk:pf,Login:vf,LoginForm:cf,UserContext:Hc,UserOverrideContext:Vc,UserPermissionsOverrideContext:ja,getAppInitValue:mf,getUserFromConfig:gf,isAuthPlugin:GE},Symbol.toStringTag,{value:"Module"})),bf=typeof bs=="function"?bs:bs.default;$o.register([xC,IC,NC,MC,LC,FC]);function et(r,e,t){return e=gw(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function gw(r){var e=bw(r,"string");return typeof e=="symbol"?e:String(e)}function bw(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class De{constructor(e){et(this,"dh",void 0),et(this,"listeners",void 0),et(this,"formatter",void 0),et(this,"rect",void 0),et(this,"isDownsamplingDisabled",void 0),et(this,"title",void 0),this.dh=e,this.listeners=[],this.isDownsamplingDisabled=!1}getData(){return[]}getDefaultTitle(){return""}getLayout(){return{}}getFilterColumnMap(){return new Map}isFilterRequired(){return!1}setFilter(e){}close(){}setFormatter(e){this.formatter=e}setDownsamplingDisabled(e){this.isDownsamplingDisabled=e}setDimensions(e){this.rect=e}setTitle(e){this.title=e}subscribe(e){this.listeners.push(e)}unsubscribe(e){this.listeners=this.listeners.filter(t=>t!==e)}fireEvent(e){for(var t=0;t<this.listeners.length;t+=1)this.listeners[t](e)}fireUpdate(e){this.fireEvent(new CustomEvent(De.EVENT_UPDATED,{detail:e}))}fireDisconnect(){this.fireEvent(new CustomEvent(De.EVENT_DISCONNECT))}fireReconnect(){this.fireEvent(new CustomEvent(De.EVENT_RECONNECT))}fireDownsampleStart(e){this.fireEvent(new CustomEvent(De.EVENT_DOWNSAMPLESTARTED,{detail:e}))}fireDownsampleFinish(e){this.fireEvent(new CustomEvent(De.EVENT_DOWNSAMPLEFINISHED,{detail:e}))}fireDownsampleFail(e){this.fireEvent(new CustomEvent(De.EVENT_DOWNSAMPLEFAILED,{detail:e}))}fireDownsampleNeeded(e){this.fireEvent(new CustomEvent(De.EVENT_DOWNSAMPLENEEDED,{detail:e}))}fireLoadFinished(){this.fireEvent(new CustomEvent(De.EVENT_LOADFINISHED))}fireError(e){this.fireEvent(new CustomEvent(De.EVENT_ERROR,{detail:e}))}}et(De,"EVENT_UPDATED","ChartModel.EVENT_UPDATED");et(De,"EVENT_DISCONNECT","ChartModel.EVENT_DISCONNECT");et(De,"EVENT_RECONNECT","ChartModel.EVENT_RECONNECT");et(De,"EVENT_DOWNSAMPLESTARTED","ChartModel.EVENT_DOWNSAMPLESTARTED");et(De,"EVENT_DOWNSAMPLEFINISHED","ChartModel.EVENT_DOWNSAMPLEFINISHED");et(De,"EVENT_DOWNSAMPLEFAILED","ChartModel.EVENT_DOWNSAMPLEFAILED");et(De,"EVENT_DOWNSAMPLENEEDED","ChartModel.EVENT_DOWNSAMPLENEEDED");et(De,"EVENT_LOADFINISHED","ChartModel.EVENT_LOADFINISHED");et(De,"EVENT_ERROR","ChartModel.EVENT_ERROR");const St=De;function Wd(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,n)}return t}function Vi(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Wd(Object(t),!0).forEach(function(n){Ue(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):Wd(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function Ue(r,e,t){return e=Cw(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Cw(r){var e=Sw(r,"string");return typeof e=="symbol"?e:String(e)}function Sw(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}var Br=B.module("ChartUtils"),Gd="io.deephaven.time.DateTime",yw=36e5,Ew=1e6;function ww(r){return r.asDate!==void 0}function Pw(r){return r.asNumber!==void 0}function zd(r){return r.dhTimeZone!==void 0}function _w(r){return r!=null&&r.range!=null&&(r.autorange===!1||r.autorange===void 0)}class z{static getPlotlyErrorBars(e,t,n,i){var a=n.map((o,l)=>o-e[l]),s=t.map((o,l)=>e[l]-o);return{type:"data",symmetric:!1,array:a,arrayminus:s,color:i.error_band_line_color}}static convertNumberPrefix(e){return e.replace(/\u00A4\u00A4/g,"USD").replace(/\u00A4/g,"$")}static getPlotlyNumberFormat(e,t,n){if(!n)return null;var i=n.split(";"),a=i[0].match(/^([^#,0.]*)([#,]*)([0,]*)(\.?)(0*)(#*)(E?0*)(%?)(.*)/);G(a);var[,s,o,l,,d,h,c,f,p]=a,m=l.replace(",","").length,b=o.indexOf(",")>=0||l.indexOf(",")>=0,g=b?",":"",C=c!=null&&c!==""?"e":"f",y=f!==""?f:C,S=d.length+h.length,w="",E="0".concat(m).concat(g,".").concat(S).concat(w).concat(y),x=z.convertNumberPrefix(s),D=z.convertNumberPrefix(p);return{tickformat:E,tickprefix:x,ticksuffix:D,automargin:!0}}static addTickSpacing(e,t,n){var{gapBetweenMajorTicks:i}=t;if(i>0){var a=e||{},s=i;return n&&(s=i/Ew),t.log&&(s=Math.log(s)),a.tickmode="linear",a.dtick=s,a}return e}static getSourceForAxis(e,t){for(var n=0;n<e.series.length;n+=1)for(var i=e.series[n],a=0;a<i.sources.length;a+=1){var s=i.sources[a];if(s.axis===t)return s}return null}static getSeriesVisibility(e,t){return t!=null&&t.hiddenSeries!=null&&t.hiddenSeries.includes(e)?"legendonly":!0}static getHiddenLabels(e){return e!=null&&e.hiddenSeries?[...e.hiddenSeries]:[]}static makeSeriesData(e,t,n,i){var a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:z.ORIENTATION.VERTICAL;return{type:e,mode:t,name:n,orientation:a,showlegend:i??void 0}}static getMarkerSymbol(e){switch(e){case"SQUARE":return"square";case"CIRCLE":return"circle";case"DIAMOND":return"diamond";case"UP_TRIANGLE":return"triangle-up";case"DOWN_TRIANGLE":return"triangle-down";case"RIGHT_TRIANGLE":return"triangle-right";case"LEFT_TRIANGLE":return"triangle-left";case"ELLIPSE":case"HORIZONTAL_RECTANGLE":case"VERTICAL_RECTANGLE":default:throw new Error("Unrecognized shape ".concat(e))}}static getAllAxes(e){return e.charts.reduce((t,n)=>[...t,...n.axes],[])}static getAxisTypeMap(e){var t=z.getAllAxes(e);return z.groupArray(t,"type")}static getChartForSeries(e,t){for(var{charts:n}=e,i=0;i<n.length;i+=1)for(var a=n[i],s=0;s<a.series.length;s+=1)if(t===a.series[s])return a;return null}static getLayoutRanges(e){for(var t={},n=Object.keys(e).filter(o=>o.indexOf("axis")>=0),i=0;i<n.length;i+=1){var a=n[i],s=e[a];_w(s)&&(t[a]=[...s.range])}return t}static getAxisLayoutProperty(e,t){var n=t>0?"".concat(t+1):"";return"".concat(e??"","axis").concat(n)}static periodToDecimal(e){var t=e.split(":");return Number(t[0])+Number(t[1])/60}static groupArray(e,t){return e.reduce((n,i)=>{var a,s=i[t],o=(a=n.get(s))!==null&&a!==void 0?a:[];return o.push(i),n.set(s,o),n},new Map)}static getColorwayFromTheme(e){var t=[];return e.colorway&&(Array.isArray(e.colorway)?t=e.colorway:typeof e.colorway=="string"?t=e.colorway.split(" "):Br.warn("Unable to handle colorway property: ".concat(e.colorway))),t}static titleFromSettings(e){var{series:t,xAxis:n,title:i="".concat((t??[]).join(", ")," by ").concat(n)}=e;return i}constructor(e){Ue(this,"dh",void 0),Ue(this,"daysOfWeek",void 0),this.dh=e,this.daysOfWeek=Object.freeze(e.calendar.DayOfWeek.values())}getAxisFormats(e,t){for(var n=this,i=new Map,a={tickformat:null,ticksuffix:null},s=z.getAllAxes(e),o=z.groupArray(s,"type"),{charts:l}=e,d=0;d<l.length;d+=1)for(var h=l[d],c=0;c<h.series.length;c+=1)for(var f=h.series[c],{sources:p}=f,m=p.filter(y=>y.axis),b=function(){var S=m[g],{axis:w}=S,{type:E}=w,x=o.get(E);G(x);var D=x.indexOf(w),T=n.getAxisPropertyName(E);if(T!=null){var I=z.getAxisLayoutProperty(T,D);if(i.has(I))Br.debug("".concat(I," already added."));else{Br.debug("Adding ".concat(I," to axisFormats."));var j=n.getPlotlyAxisFormat(S,t);if(j===null)i.set(I,a);else{i.set(I,j);var{businessCalendar:W}=w;if(W!=null){var L=[],{businessPeriods:O,businessDays:M,holidays:A,timeZone:k}=W,H=t==null?void 0:t.getColumnTypeFormatter(Gd),q;zd(H)&&(q=H.dhTimeZone);var re=q?(k.standardOffset-q.standardOffset)/60:0;A.length>0&&L.push(...n.createRangeBreakValuesFromHolidays(A,k,q)),O.forEach(V=>L.push({pattern:"hour",bounds:[z.periodToDecimal(V.close)+re,z.periodToDecimal(V.open)+re]})),M.length<n.daysOfWeek.length&&n.createBoundsFromDays(M).forEach(V=>L.push({pattern:"day of week",bounds:V})),j.rangebreaks=L}if(i.size===h.axes.length)return{v:i}}}}},g=0;g<m.length;g+=1){var C=b();if(typeof C=="object")return C.v}return i}getPlotlyChartType(e,t){var{dh:n}=this;switch(e){case n.plot.SeriesPlotStyle.SCATTER:return t?"scatter":"scattergl";case n.plot.SeriesPlotStyle.LINE:return"scatter";case n.plot.SeriesPlotStyle.BAR:case n.plot.SeriesPlotStyle.STACKED_BAR:return"bar";case n.plot.SeriesPlotStyle.PIE:return"pie";case n.plot.SeriesPlotStyle.TREEMAP:return"treemap";case n.plot.SeriesPlotStyle.HISTOGRAM:return"histogram";case n.plot.SeriesPlotStyle.OHLC:return"ohlc";default:return}}getPlotlyChartMode(e,t,n){var{dh:i}=this,a=new Set;switch(e){case i.plot.SeriesPlotStyle.SCATTER:(t??!1)&&a.add(z.MODE_LINES),(n??!0)&&a.add(z.MODE_MARKERS);break;case i.plot.SeriesPlotStyle.LINE:(t??!0)&&a.add(z.MODE_LINES),(n??!1)&&a.add(z.MODE_MARKERS);break}return a.size>0?[...a].join("+"):void 0}getPlotlyProperty(e,t){var{dh:n}=this;switch(e){case n.plot.SeriesPlotStyle.PIE:switch(t){case n.plot.SourceType.X:return"labels";case n.plot.SourceType.Y:return"values"}break;case n.plot.SeriesPlotStyle.OHLC:switch(t){case n.plot.SourceType.TIME:return"x"}break;case n.plot.SeriesPlotStyle.TREEMAP:switch(t){case n.plot.SourceType.X:return"ids";case n.plot.SourceType.Y:return"values";case n.plot.SourceType.LABEL:return"labels";case n.plot.SourceType.PARENT:return"parents";case n.plot.SourceType.COLOR:return"marker.colors"}break}switch(t){case n.plot.SourceType.X:return"x";case n.plot.SourceType.Y:return"y";case n.plot.SourceType.Z:return"z";case n.plot.SourceType.X_LOW:return"xLow";case n.plot.SourceType.X_HIGH:return"xHigh";case n.plot.SourceType.Y_LOW:return"yLow";case n.plot.SourceType.Y_HIGH:return"yHigh";case n.plot.SourceType.TIME:return"time";case n.plot.SourceType.OPEN:return"open";case n.plot.SourceType.HIGH:return"high";case n.plot.SourceType.LOW:return"low";case n.plot.SourceType.CLOSE:return"close";case n.plot.SourceType.SHAPE:return"shape";case n.plot.SourceType.SIZE:return"size";case n.plot.SourceType.LABEL:return"label";case n.plot.SourceType.COLOR:return"color";case n.plot.SourceType.PARENT:return"parent";case n.plot.SourceType.HOVER_TEXT:return"hovertext";case n.plot.SourceType.TEXT:return"text";default:throw new Error("Unrecognized source type: ".concat(t))}}getPlotlySeriesOrientation(e){var t,n,{dh:i}=this,{sources:a}=e;return a.length===2&&((t=a[0])===null||t===void 0||(n=t.axis)===null||n===void 0?void 0:n.type)===i.plot.AxisType.Y?z.ORIENTATION.HORIZONTAL:z.ORIENTATION.VERTICAL}makeSeriesDataFromSeries(e,t,n,i){var a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:null,{name:s,isLinesVisible:o,isShapesVisible:l,plotStyle:d,lineColor:h,shapeColor:c,sources:f,shape:p,shapeSize:m}=e,b=f.some(w=>{var E;return(E=w.axis)===null||E===void 0?void 0:E.businessCalendar}),g=this.getChartType(d,b),C=this.getPlotlyChartMode(d,o??void 0,l??void 0),y=this.getPlotlySeriesOrientation(e),S=z.makeSeriesData(g,C,s,a,y);return this.addSourcesToSeriesData(S,d,f,t),this.addStylingToSeriesData(S,d,i,h,c,p,m,n),S}addSourcesToSeriesData(e,t,n,i){for(var a=e,s=0;s<n.length;s+=1){var o=n[s],{axis:l,type:d}=o,h=this.getPlotlyProperty(t,d);vc(a,h,[]);var c=l!=null?this.getAxisPropertyName(l.type):null;if(c!=null){var f=i.get(l.type);if(f){var p=f.indexOf(l),m=p>0?"".concat(p+1):"";a["".concat(c,"axis")]="".concat(c).concat(m)}}}}addStylingToSeriesData(e,t,n){var i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null,a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:null,s=arguments.length>5&&arguments[5]!==void 0?arguments[5]:null,o=arguments.length>6&&arguments[6]!==void 0?arguments[6]:null,l=arguments.length>7&&arguments[7]!==void 0?arguments[7]:null,{dh:d}=this,h=e;if(h.marker={line:{}},h.line={width:1},t===d.plot.SeriesPlotStyle.AREA?h.fill="tozeroy":t===d.plot.SeriesPlotStyle.STACKED_AREA?h.stackgroup="stack":t===d.plot.SeriesPlotStyle.STEP?h.line.shape="hv":t===d.plot.SeriesPlotStyle.HISTOGRAM?(h.width=[],h.marker.line!==void 0&&Object.assign(h.marker.line,{color:n.paper_bgcolor,width:1})):t===d.plot.SeriesPlotStyle.OHLC?(h.increasing={line:{color:n.ohlc_increasing}},h.decreasing={line:{color:n.ohlc_decreasing}}):t===d.plot.SeriesPlotStyle.PIE?(h.textinfo="label+percent",h.outsidetextfont={color:n.title_color}):t===d.plot.SeriesPlotStyle.TREEMAP&&(h.hoverinfo="text",h.textinfo="label+text",h.tiling={packing:"squarify",pad:0},h.textposition="middle center",h.outsidetextfont={color:n.title_color}),i!=null&&(t===d.plot.SeriesPlotStyle.BAR?h.marker.color=i:h.line.color=i),a!=null&&(h.marker.color=a),s!=null&&s.length>0)try{h.marker.symbol=z.getMarkerSymbol(s)}catch(c){Br.warn("Unable to handle shape",s,":",c)}o!=null&&(h.marker.size=o*z.DEFAULT_MARKER_SIZE),l!=null&&t!==d.plot.SeriesPlotStyle.PIE&&(h.visible=l)}getChartType(e,t){var{dh:n}=this;switch(e){case n.plot.SeriesPlotStyle.HISTOGRAM:return"bar";default:return this.getPlotlyChartType(e,t)}}getAxisPropertyName(e){var{dh:t}=this;switch(e){case t.plot.AxisType.X:return"x";case t.plot.AxisType.Y:return"y";default:return null}}getAxisSide(e){var{dh:t}=this;switch(e){case t.plot.AxisPosition.BOTTOM:return"bottom";case t.plot.AxisPosition.TOP:return"top";case t.plot.AxisPosition.LEFT:return"left";case t.plot.AxisPosition.RIGHT:return"right";default:return}}updateFigureAxes(e,t,n,i){for(var a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0,s=arguments.length>5&&arguments[5]!==void 0?arguments[5]:0,o=e,l=z.getAllAxes(t),d=0;d<t.charts.length;d+=1){var h=t.charts[d],c=i==null?void 0:i(h),f=this.getChartBounds(t,h,a,s);this.updateLayoutAxes(o,h.axes,l,n,a,s,f,c)}this.removeStaleAxes(o,l)}getChartBounds(e,t,n,i){var a,{dh:s}=this,{cols:o,rows:l}=e,{column:d,colspan:h,row:c,rowspan:f}=t,p=d+h,m=c+f,b=1/o,g=1/l,C=z.AXIS_SIZE_PX/n,y=z.AXIS_SIZE_PX/i,S={bottom:(l-m)*g+(m<l?y/2:0),top:(l-c)*g-(c>0?y/2:0),left:d*b+(d>0?C/2:0),right:p*b-(p<o?C/2:0)},w=z.groupArray(t.axes,"position"),E=(a=w.get(s.plot.AxisPosition.RIGHT))!==null&&a!==void 0?a:[];return E.length>0&&(n>0?S.right-=(S.right-S.left)*Math.max(0,Math.min(z.LEGEND_WIDTH_PX/n,z.MAX_LEGEND_SIZE)):S.right-=(S.right-S.left)*z.DEFAULT_AXIS_SIZE),S}getPlotlyDateFormat(e,t,n){var{dh:i}=this,a=n==null?void 0:n.replace("%","%%").replace(/S{9}/g,"%9f").replace(/S{8}/g,"%8f").replace(/S{7}/g,"%7f").replace(/S{6}/g,"%6f").replace(/S{5}/g,"%5f").replace(/S{4}/g,"%4f").replace(/S{3}/g,"%3f").replace(/S{2}/g,"%2f").replace(/S{1}/g,"%1f").replace(/y{4}/g,"%Y").replace(/y{2}/g,"%y").replace(/M{4}/g,"%B").replace(/M{3}/g,"%b").replace(/M{2}/g,"%m").replace(/M{1}/g,"%-m").replace(/E{4,}/g,"%A").replace(/E{1,}/g,"%a").replace(/d{2}/g,"%d").replace(/([^%]|^)d{1}/g,"$1%-d").replace(/H{2}/g,"%H").replace(/h{2}/g,"%I").replace(/h{1}/g,"%-I").replace(/m{2}/g,"%M").replace(/s{2}/g,"%S").replace("'T'","T").replace(" z",""),s,o=e==null?void 0:e.getColumnTypeFormatter(t);return o!=null&&zd(o)&&o.dhTimeZone!=null&&o.showTimeZone&&(s=i.i18n.DateTimeFormat.format(" z",new Date,o.dhTimeZone)),{tickformat:a,ticksuffix:s,automargin:!0}}getPlotlyAxisFormat(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null,{dh:n}=this,{axis:i,columnType:a}=e,{formatPattern:s}=i,o=null;return Ie.isDateType(a)?(o=this.getPlotlyDateFormat(t,a,s),o=z.addTickSpacing(o,i,!0)):Ie.isNumberType(a)&&(o=z.getPlotlyNumberFormat(t,a,s),o=z.addTickSpacing(o,i,!1)),i.formatType===n.plot.AxisFormatType.CATEGORY&&(o?o.type="category":o={type:"category",tickformat:void 0,ticksuffix:void 0}),o}updateLayoutAxes(e,t,n,i){for(var a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0,s=arguments.length>5&&arguments[5]!==void 0?arguments[5]:0,o=arguments.length>6&&arguments[6]!==void 0?arguments[6]:{left:0,top:0,right:1,bottom:1},l=arguments.length>7?arguments[7]:void 0,{dh:d}=this,h=a>0?Math.max(z.MIN_AXIS_SIZE,Math.min(z.AXIS_SIZE_PX/s,z.MAX_AXIS_SIZE)):z.DEFAULT_AXIS_SIZE,c=s>0?Math.max(z.MIN_AXIS_SIZE,Math.min(z.AXIS_SIZE_PX/a,z.MAX_AXIS_SIZE)):z.DEFAULT_AXIS_SIZE,f=e,p=z.groupArray(t,"position"),m=z.groupArray(t,"type"),b=[...m.keys()],g=z.groupArray(n,"type"),C=0;C<b.length;C+=1){var y=b[C],S=this.getAxisPropertyName(y);if(S!=null){var w=m.get(y),E=g.get(y),x=y===d.plot.AxisType.Y,D=x?s:a;G(w),G(E);for(var T=0;T<w.length;T+=1){var I=w[T],j=E.indexOf(I),W=z.getAxisLayoutProperty(S,j);f[W]==null&&(f[W]=this.makeLayoutAxis(y,i));var L=f[W];if(L!=null){this.updateLayoutAxis(L,I,T,p,h,c,o);var{range:O,autorange:M}=L;if(l!=null&&O!==void 0&&(M===void 0||M===!1)){var A=l(I),[k,H]=A(O);Br.debug("Setting downsample range",D,k,H),I.range(D,k,H)}else I.range(D)}}}}}removeStaleAxes(e,t){for(var n=e,i=z.groupArray(t,"type"),a=[...i.keys()],s=0;s<a.length;s+=1){var o=a[s],l=i.get(o);G(l);var d=l.length,h=this.getAxisPropertyName(o);if(h!=null)for(var c=z.getAxisLayoutProperty(h,d);n[c]!=null;)delete n[c],d+=1,c=z.getAxisLayoutProperty(h,d)}}updateLayoutAxis(e,t,n,i,a,s,o){var l,{dh:d}=this,h=t.type===d.plot.AxisType.Y,c=h?s:a,f=e,p=(l=t.label)!==null&&l!==void 0?l:"";if(f.title!==void 0&&typeof f.title!="string"?f.title.text=p:f.title={text:p},t.log&&(f.type="log"),f.side=this.getAxisSide(t.position),n>0){var m,b;f.overlaying=(m=this.getAxisPropertyName(t.type))!==null&&m!==void 0?m:void 0;var g=(b=i.get(t.position))!==null&&b!==void 0?b:[],C=g.indexOf(t);C>0&&(f.anchor="free",t.position===d.plot.AxisPosition.RIGHT?f.position=o.right+(C-g.length+1)*c:t.position===d.plot.AxisPosition.TOP?f.position=o.top+(C-g.length+1)*c:t.position===d.plot.AxisPosition.BOTTOM?f.position=o.bottom+(g.length-C+1)*c:t.position===d.plot.AxisPosition.LEFT&&(f.position=o.left+(g.length-C+1)*c))}else if(t.type===d.plot.AxisType.X){var y=i.get(d.plot.AxisPosition.LEFT)||[],S=i.get(d.plot.AxisPosition.RIGHT)||[],w=Math.max(o.left,o.left+(y.length-1)*s),E=Math.min(o.right-(S.length-1)*s,o.right);f.domain=[w,E]}else if(t.type===d.plot.AxisType.Y){var x=i.get(d.plot.AxisPosition.BOTTOM)||[],D=i.get(d.plot.AxisPosition.TOP)||[],T=Math.max(o.bottom,o.bottom+(x.length-1)*a),I=Math.min(o.top-(D.length-1)*a,o.top);f.domain=[T,I]}}createBoundsFromDays(e){var t=e.map(s=>this.daysOfWeek.indexOf(s)),n=this.daysOfWeek.filter(s=>!e.includes(s)).map(s=>this.daysOfWeek.indexOf(s)),i=new Set;n.forEach(s=>{for(var o=s+1;o<s+this.daysOfWeek.length;o+=1){var l=o%this.daysOfWeek.length;if(t.includes(l)){i.add(l);break}}});var a=[];return i.forEach(s=>{for(var o=s-1;o>s-this.daysOfWeek.length;o-=1){var l=o<0?o+this.daysOfWeek.length:o;if(t.includes(l)){var d=(l+1)%7;a.push([d,s]);break}}}),a}createRangeBreakValuesFromHolidays(e,t,n){var i=[],a=[];return e.forEach(s=>{s.businessPeriods.length>0?a.push(...this.createPartialHoliday(s,t,n)):i.push(this.createFullHoliday(s,t,n))}),[{values:i},...a]}createFullHoliday(e,t,n){return this.adjustDateForTimeZone("".concat(e.date.toString()," 00:00:00.000000"),t,n)}createPartialHoliday(e,t,n){var i=e.date.toString(),a=["00:00"];e.businessPeriods.forEach(f=>{a.push(f.open),a.push(f.close)}),a.push("24:00");for(var s=[],o=0;o<a.length;o+=2){var l=a[o],d=a[o+1];if(l!==d){var h=[this.adjustDateForTimeZone("".concat(i," ").concat(l,":00.000000"),t,n)],c=yw*(z.periodToDecimal(d)-z.periodToDecimal(l));s.push({values:h,dvalue:c})}}return s}adjustDateForTimeZone(e,t,n){return n&&n.standardOffset!==t.standardOffset?this.unwrapValue(this.wrapValue(e,Gd,t),n):e}makeFigureSettings(e,t){var{dh:n}=this,{series:i,xAxis:a,type:s}=e,o=z.titleFromSettings(e),l={formatType:"".concat(n.plot.AxisFormatType.NUMBER),type:"".concat(n.plot.AxisType.X),position:"".concat(n.plot.AxisPosition.BOTTOM)},d={formatType:"".concat(n.plot.AxisFormatType.NUMBER),type:"".concat(n.plot.AxisType.Y),position:"".concat(n.plot.AxisPosition.LEFT)};return{charts:[{chartType:"".concat(n.plot.ChartType.XY),axes:[l,d],series:(i??[]).map(h=>({plotStyle:"".concat(s),name:h,dataSources:[{type:"".concat(n.plot.SourceType.X),columnName:a??"",axis:l,table:t},{type:"".concat(n.plot.SourceType.Y),columnName:h,axis:d,table:t}]}))}],title:o}}unwrapValue(e,t){var{dh:n}=this;if(e!=null){if(ww(e))return n.i18n.DateTimeFormat.format(z.DATE_FORMAT,e,t);if(Pw(e))return e.asNumber()}return e}wrapValue(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,{dh:i}=this;if(Ie.isDateType(t)&&typeof e=="string"){var a=e,s=z.DATE_FORMAT.substr(0,e.length),o=i.i18n.DateTimeFormat.parse(s,a);if(!n)return o;var l="".concat(s," Z"),d=i.i18n.DateTimeFormat.format("Z",o,n),h=i.i18n.DateTimeFormat.parse(l,"".concat(a," ").concat(d)),c=i.i18n.DateTimeFormat.format("Z",h,n);return i.i18n.DateTimeFormat.parse(l,"".concat(a," ").concat(c))}return e}makeLayoutAxis(e,t){var{dh:n}=this,i={automargin:!0,gridcolor:t.gridcolor,linecolor:t.linecolor,rangeslider:{visible:!1},showline:!0,ticklen:5,tickcolor:t.paper_bgcolor,tickfont:{color:t.zerolinecolor},title:{font:{color:t.title_color}},legend:{font:{color:t.legend_color}}};return e===n.plot.AxisType.X?Object.assign(i,{showgrid:!0}):e===n.plot.AxisType.Y&&Object.assign(i,{zerolinecolor:t.zerolinecolor,zerolinewidth:2}),i}makeDefaultLayout(e){var{dh:t}=this,{paper_bgcolor:n,plot_bgcolor:i,title_color:a,coastline_color:s,land_color:o,ocean_color:l,lake_color:d,river_color:h}=e,c={paper_bgcolor:n,plot_bgcolor:i,autosize:!0,colorway:z.getColorwayFromTheme(e),font:{family:"'Fira Sans', sans-serif",color:a},title:{font:{color:a},yanchor:"top",pad:Vi({},z.DEFAULT_TITLE_PADDING),y:1},legend:{font:{color:a}},margin:Vi({},z.DEFAULT_MARGIN),xaxis:this.makeLayoutAxis(t.plot.AxisType.X,e),yaxis:this.makeLayoutAxis(t.plot.AxisType.Y,e),polar:{angularaxis:this.makeLayoutAxis(t.plot.AxisType.SHAPE,e),radialaxis:this.makeLayoutAxis(t.plot.AxisType.SHAPE,e),bgcolor:e.plot_bgcolor},scene:{xaxis:this.makeLayoutAxis(t.plot.AxisType.X,e),yaxis:this.makeLayoutAxis(t.plot.AxisType.Y,e),zaxis:this.makeLayoutAxis(t.plot.AxisType.Z,e)},geo:{showcoastlines:!0,showframe:!1,showland:!0,showocean:!0,showlakes:!0,showrivers:!0,bgcolor:n,coastlinecolor:s,landcolor:o,oceancolor:l,lakecolor:d,rivercolor:h}};return c.datarevision=0,c}hydrateSettings(e){var{dh:t}=this;return Vi(Vi({},e),{},{type:e.type!=null?t.plot.SeriesPlotStyle[e.type]:void 0})}}Ue(z,"DEFAULT_AXIS_SIZE",.15);Ue(z,"MIN_AXIS_SIZE",.025);Ue(z,"MAX_AXIS_SIZE",.2);Ue(z,"AXIS_SIZE_PX",75);Ue(z,"LEGEND_WIDTH_PX",50);Ue(z,"MAX_LEGEND_SIZE",.25);Ue(z,"ORIENTATION",Object.freeze({HORIZONTAL:"h",VERTICAL:"v"}));Ue(z,"DATE_FORMAT","yyyy-MM-dd HH:mm:ss.SSSSSS");Ue(z,"DEFAULT_MARGIN",Object.freeze({l:60,r:50,t:30,b:60,pad:0}));Ue(z,"DEFAULT_TITLE_PADDING",Object.freeze({t:8}));Ue(z,"SUBTITLE_LINE_HEIGHT",25);Ue(z,"DEFAULT_MARKER_SIZE",6);Ue(z,"MODE_MARKERS","markers");Ue(z,"MODE_LINES","lines");const Me=z;function Tw(r,e,t){return e=Ow(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Ow(r){var e=Dw(r,"string");return typeof e=="symbol"?e:String(e)}function Dw(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class Cf extends Error{constructor(){super(...arguments),Tw(this,"isDownsamplingError",!0)}}function Kd(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,n)}return t}function qd(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Kd(Object(t),!0).forEach(function(n){We(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):Kd(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function We(r,e,t){return e=xw(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function xw(r){var e=Iw(r,"string");return typeof e=="symbol"?e:String(e)}function Iw(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}var on=B.module("Chart");class bn extends v.Component{static convertIcon(e){var[t,,,,n]=e.icon,i="".concat(n);return{width:t,path:i,ascent:t,descent:0,transform:"matrix(1, 0, 0, 1, 0, 0)"}}static downsampleButtonTitle(e,t){return e?"Downsampling in progress...":t?"Downsampling disabled, click to enable":"Downsampling enabled, click to disable"}static downsampleButtonAttr(e,t){return e?"animation-spin":t?void 0:"fill-active"}constructor(e){var t;super(e),We(this,"currentSeries",void 0),We(this,"PlotComponent",void 0),We(this,"plot",void 0),We(this,"plotWrapper",void 0),We(this,"columnFormats",void 0),We(this,"dateTimeFormatterOptions",void 0),We(this,"decimalFormatOptions",void 0),We(this,"integerFormatOptions",void 0),We(this,"rect",void 0),We(this,"ranges",void 0),We(this,"isSubscribed",void 0),We(this,"isLoadedFired",void 0),We(this,"resizeObserver",void 0),We(this,"getCachedConfig",se((n,i,a,s,o,l)=>{var d=[],h=!!n;h&&d.push({name:"Downsampling failed: ".concat(n),title:"Downsampling failed",click:()=>{this.toggleErrorMessage("".concat(n))},icon:bn.convertIcon(Yl),attr:"fill-warning"});var c=!!l;if(c&&d.push({name:"Error: ".concat(l),title:"Error",click:()=>{this.toggleErrorMessage("".concat(l))},icon:bn.convertIcon(Yl),attr:"fill-warning"}),i||a||s||h){var f=bn.downsampleButtonTitle(a,s),p=bn.downsampleButtonAttr(a,s),m=a?Mg:Lg;d.push({name:f,title:"Downsampling status",icon:bn.convertIcon(m),click:this.handleDownsampleClick,attr:p})}var b=o.some(S=>{var{type:w}=S;return w!=null&&!w.includes("3d")}),g=o.some(S=>{var{type:w}=S;return w!=null&&w.includes("3d")}),C=["zoomIn2d","zoomOut2d","autoScale2d","resetScale2d"],y=["orbitRotation","tableRotation","resetCameraDefault3d"];return{displaylogo:!1,displayModeBar:a||h||c?!0:"hover",modeBarButtons:[d,["toImage"],["zoom2d","pan2d"],[...b?C:[],...g?y:[]]]}})),this.handleAfterPlot=this.handleAfterPlot.bind(this),this.handleDownsampleClick=this.handleDownsampleClick.bind(this),this.handleErrorClose=this.handleErrorClose.bind(this),this.handleModelEvent=this.handleModelEvent.bind(this),this.handlePlotUpdate=this.handlePlotUpdate.bind(this),this.handleRelayout=this.handleRelayout.bind(this),this.handleResize=this.handleResize.bind(this),this.handleRestyle=this.handleRestyle.bind(this),this.PlotComponent=bf(e.Plotly),this.plot=X.createRef(),this.plotWrapper=(t=e.containerRef)!==null&&t!==void 0?t:X.createRef(),this.columnFormats=[],this.dateTimeFormatterOptions={},this.decimalFormatOptions={},this.integerFormatOptions={},this.isSubscribed=!1,this.isLoadedFired=!1,this.currentSeries=0,this.resizeObserver=new window.ResizeObserver(this.handleResize),this.state={data:null,downsamplingError:null,isDownsampleFinished:!1,isDownsampleInProgress:!1,isDownsamplingDisabled:!1,error:null,shownError:null,layout:{datarevision:0},revision:0}}componentDidMount(){this.updateDimensions(),this.updateModelDimensions(),this.initData(),this.initFormatter();var{isActive:e,model:t}=this.props;e&&this.subscribe(t),this.plotWrapper.current!=null&&this.resizeObserver.observe(this.plotWrapper.current)}componentDidUpdate(e){var{isActive:t,model:n,settings:i}=this.props;this.updateFormatterSettings(i),n!==e.model&&(this.unsubscribe(e.model),this.subscribe(n)),t!==e.isActive&&(t?(this.updateDimensions(),this.subscribe(n)):this.unsubscribe(n))}componentWillUnmount(){var{model:e}=this.props;this.unsubscribe(e),this.resizeObserver.disconnect()}getPlotRect(){var e,t;return(e=(t=this.plotWrapper.current)===null||t===void 0?void 0:t.getBoundingClientRect())!==null&&e!==void 0?e:null}initData(){var{model:e}=this.props,{layout:t}=this.state;this.setState({data:e.getData(),layout:qd(qd({},t),e.getLayout())})}subscribe(e){if(!this.isSubscribed){if(!this.rect||this.rect.width===0||this.rect.height===0){on.debug2("Delaying subscription until model dimensions are set");return}e.subscribe(this.handleModelEvent),this.isSubscribed=!0}}unsubscribe(e){this.isSubscribed&&(e.unsubscribe(this.handleModelEvent),this.isSubscribed=!1)}handleAfterPlot(){this.plot.current!=null}handleDownsampleClick(){this.setState(e=>{var{isDownsamplingDisabled:t}=e;return{downsamplingError:null,isDownsampleInProgress:!1,isDownsampleFinished:!1,isDownsamplingDisabled:!t}},()=>{var{model:e}=this.props,{isDownsamplingDisabled:t}=this.state;e.setDownsamplingDisabled(t)})}handleErrorClose(){this.setState({shownError:null})}handleModelEvent(e){var{type:t,detail:n}=e;switch(on.debug2("Received data update",t,n),t){case St.EVENT_UPDATED:{this.currentSeries+=1,this.setState(p=>{var{layout:m,revision:b}=p;return typeof m.datarevision=="number"&&(m.datarevision+=1),{data:n,layout:m,revision:b+1}});var{onUpdate:i}=this.props;i({isLoading:!this.isLoadedFired});break}case St.EVENT_LOADFINISHED:{var{onUpdate:a}=this.props;this.isLoadedFired=!0,a({isLoading:!1});break}case St.EVENT_DISCONNECT:{var{onDisconnect:s}=this.props;s();break}case St.EVENT_RECONNECT:{var{onReconnect:o}=this.props;o();break}case St.EVENT_DOWNSAMPLESTARTED:{this.setState({isDownsampleFinished:!1,isDownsampleInProgress:!0,downsamplingError:null});break}case St.EVENT_DOWNSAMPLEFINISHED:{this.setState({isDownsampleFinished:!0,isDownsampleInProgress:!1,downsamplingError:null});break}case St.EVENT_DOWNSAMPLENEEDED:case St.EVENT_DOWNSAMPLEFAILED:{var l,d=(l=n.message)!==null&&l!==void 0?l:n;this.setState({isDownsampleFinished:!1,isDownsampleInProgress:!1,isDownsamplingDisabled:!1,downsamplingError:d});var{onError:h}=this.props;h(new Cf(d));break}case St.EVENT_ERROR:{var c="".concat(n);this.setState({error:c});var{onError:f}=this.props;f(new Error(c));break}default:on.debug("Unknown event type",t,e)}}handlePlotUpdate(e){var{layout:t}=e,n=Me.getLayoutRanges(t),i=!Mt(n,this.ranges);i&&(this.ranges=n,this.updateModelDimensions(!0))}handleRelayout(e){if(on.debug("handleRelayout",e),e.hiddenlabels!=null){var{onSettingsChanged:t}=this.props,n=[...e.hiddenlabels];t({hiddenSeries:n})}this.updateModelDimensions()}handleResize(){this.updateDimensions()}handleRestyle(e){var[t,n]=e;if(on.debug("handleRestyle",t,n),Object.keys(t).includes("visible")){var{data:i}=this.state,{onSettingsChanged:a}=this.props;if(i!=null){var s=i.reduce((o,l)=>{var{name:d,visible:h}=l;return d!=null&&h==="legendonly"?[...o,d]:o},[]);a({hiddenSeries:s})}}}toggleErrorMessage(e){this.setState(t=>{var{shownError:n}=t;return{shownError:n===e?null:e}})}updateModelDimensions(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,t=this.getPlotRect();if(!t){on.warn("Unable to get plotting rect");return}var n=!this.rect||this.rect.width!==t.width||this.rect.height!==t.height;if(n||e){this.rect=t;var{isActive:i,model:a}=this.props;a.setDimensions(t),i&&this.subscribe(a)}}initFormatter(){var{settings:e}=this.props;this.updateFormatterSettings(e)}updateFormatterSettings(e){var t=wn.getColumnFormats(e),n=wn.getDateTimeFormatterOptions(e),{decimalFormatOptions:i={},integerFormatOptions:a={}}=e;(!Mt(this.columnFormats,t)||!Mt(this.dateTimeFormatterOptions,n)||!Mt(this.decimalFormatOptions,i)||!Mt(this.integerFormatOptions,a))&&(this.columnFormats=wn.getColumnFormats(e),this.dateTimeFormatterOptions=n,this.decimalFormatOptions=i,this.integerFormatOptions=a,this.updateFormatter())}updateFormatter(){var{model:e}=this.props,t=new Pr(e.dh,this.columnFormats,this.dateTimeFormatterOptions,this.decimalFormatOptions,this.integerFormatOptions);e.setFormatter(t)}updateDimensions(){var e=this.getPlotRect(),{Plotly:t}=this.props;this.plot.current!=null&&e!=null&&e.width>0&&e.height>0&&t.relayout(this.plot.current.el,{autosize:!0}).catch(n=>{on.debug("Unable to resize, promise rejected",n)})}render(){var{PlotComponent:e}=this,{data:t,downsamplingError:n,isDownsampleFinished:i,isDownsampleInProgress:a,isDownsamplingDisabled:s,error:o,shownError:l,layout:d,revision:h}=this.state,c=this.getCachedConfig(n,i,a,s,t??[],o),f=t!=null;return u.jsxs("div",{className:"h-100 w-100 chart-wrapper",ref:this.plotWrapper,children:[f&&u.jsx(e,{ref:this.plot,data:t,layout:d,revision:h,config:c,onAfterPlot:this.handleAfterPlot,onError:on.error,onRelayout:this.handleRelayout,onUpdate:this.handlePlotUpdate,onRestyle:this.handleRestyle,useResizeHandler:!0,style:{height:"100%",width:"100%"}}),u.jsx(Si,{className:"chart-error-popper",options:{placement:"top"},isShown:l!=null,onExited:this.handleErrorClose,closeOnBlur:!0,interactive:!0,children:l!=null&&u.jsxs(u.Fragment,{children:[u.jsx("div",{className:"chart-error",children:l}),u.jsx(Mo,{tooltip:"Copy Error",copy:l,children:"Copy Error"})]})})]})}}We(bn,"defaultProps",{isActive:!0,settings:{timeZone:"America/New_York",defaultDateTimeFormat:Fo.FULL_DATE_FORMAT,showTimeZone:!1,showTSeparator:!0,formatter:[]},Plotly:$o,onDisconnect:()=>{},onReconnect:()=>{},onUpdate:()=>{},onError:()=>{},onSettingsChanged:()=>{}});const dl=bn;function Yd(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,n)}return t}function Xd(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Yd(Object(t),!0).forEach(function(n){Se(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):Yd(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function Se(r,e,t){return e=Nw(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Nw(r){var e=Mw(r,"string");return typeof e=="symbol"?e:String(e)}function Mw(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}var Fe=B.module("FigureChartModel");class za extends St{constructor(e,t,n){var i,a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};super(e),i=this,Se(this,"chartUtils",void 0),Se(this,"dh",void 0),Se(this,"figure",void 0),Se(this,"settings",void 0),Se(this,"theme",void 0),Se(this,"data",void 0),Se(this,"layout",void 0),Se(this,"seriesDataMap",void 0),Se(this,"pendingSeries",void 0),Se(this,"oneClicks",void 0),Se(this,"filterColumnMap",void 0),Se(this,"lastFilter",void 0),Se(this,"isConnected",void 0),Se(this,"seriesToProcess",void 0),Se(this,"addPendingSeries",Le(()=>{for(var o=Me.getAxisTypeMap(this.figure),{pendingSeries:l}=this,d=function(){var f,p=l[h],m=i.figure.charts.find(b=>b.series.includes(p));i.addSeries(p,o,(f=m==null?void 0:m.showLegend)!==null&&f!==void 0?f:null),p.subscribe()},h=0;h<l.length;h+=1)d();this.pendingSeries=[]},za.ADD_SERIES_DEBOUNCE)),Se(this,"getTimeZone",ot((o,l)=>{if(l!=null){var d=l.getColumnTypeFormatter(o);if(d!=null)return d.dhTimeZone}})),Se(this,"getValueTranslator",ot((o,l)=>{var d=this.getTimeZone(o,l);return h=>this.chartUtils.unwrapValue(h,d)})),Se(this,"getValueParser",ot((o,l)=>{var d=this.getTimeZone(o,l);return h=>this.chartUtils.wrapValue(h,o,d)})),Se(this,"getRangeParser",ot((o,l)=>d=>{var[h,c]=d,f=this.getValueParser(o,l);return h=f(h),c=f(c),[h,c]})),Se(this,"getAxisRangeParser",ot((o,l)=>d=>{var h=Me.getSourceForAxis(o,d);return h!=null?this.getRangeParser(h.columnType,l):c=>c})),this.handleFigureUpdated=this.handleFigureUpdated.bind(this),this.handleFigureDisconnected=this.handleFigureDisconnected.bind(this),this.handleFigureReconnected=this.handleFigureReconnected.bind(this),this.handleFigureSeriesAdded=this.handleFigureSeriesAdded.bind(this),this.handleDownsampleStart=this.handleDownsampleStart.bind(this),this.handleDownsampleFinish=this.handleDownsampleFinish.bind(this),this.handleDownsampleFail=this.handleDownsampleFail.bind(this),this.handleDownsampleNeeded=this.handleDownsampleNeeded.bind(this),this.handleRequestFailed=this.handleRequestFailed.bind(this),this.dh=e,this.chartUtils=new Me(e),this.figure=t,this.settings=a,this.theme=n,this.data=[];var s={data:{},layout:this.chartUtils.makeDefaultLayout(n)};this.layout={grid:{rows:t.rows,columns:t.cols,pattern:"independent"},template:s},this.seriesDataMap=new Map,this.pendingSeries=[],this.oneClicks=[],this.filterColumnMap=new Map,this.lastFilter=new Map,this.isConnected=!0,this.seriesToProcess=new Set,this.setTitle(this.getDefaultTitle()),this.initAllSeries(),this.updateAxisPositions(),this.startListeningFigure()}close(){this.figure.close(),this.addPendingSeries.cancel(),this.stopListeningFigure()}getDefaultTitle(){if(this.figure.title!=null&&this.figure.title.length>0)return this.figure.title;if(this.figure.charts.length===1){var e;return(e=this.figure.charts[0].title)!==null&&e!==void 0?e:""}return""}initAllSeries(){var e=this;this.oneClicks=[],this.filterColumnMap.clear();var{charts:t}=this.figure,n=Me.getAxisTypeMap(this.figure),i=[];this.seriesToProcess=new Set;for(var a=function(){for(var f=t[s],p=0;p<f.series.length;p+=1){var m=f.series[p];i.push(m.name),e.addSeries(m,n,f.showLegend)}var{axes:b,title:g}=f;if(g!=null&&g.length>0&&(t.length>1||e.figure.title!=null)){var C=b.find(j=>j.type===e.dh.plot.AxisType.X),y=b.find(j=>j.type===e.dh.plot.AxisType.Y);if(C==null||y==null)Fe.warn("Chart title provided, but unknown how to map to the correct axes for this chart type",f);else{var S,w,E,x,D=((S=(w=n.get(C.type))===null||w===void 0?void 0:w.findIndex(j=>j===C))!==null&&S!==void 0?S:0)+1,T=((E=(x=n.get(y.type))===null||x===void 0?void 0:x.findIndex(j=>j===y))!==null&&E!==void 0?E:0)+1,I={align:"center",x:.5,y:1,yshift:17,text:g,showarrow:!1,xref:"x".concat(D," domain"),yref:"y".concat(T," domain")};e.layout.annotations==null?e.layout.annotations=[I]:e.layout.annotations.push(I)}}},s=0;s<t.length;s+=1)a();for(var o=[...this.seriesDataMap.keys()],l=o.filter(c=>i.indexOf(c)<0),d=0;d<l.length;d+=1){var h=l[d];this.seriesDataMap.delete(h)}}addSeries(e,t,n){var{dh:i}=this,a=this.chartUtils.makeSeriesDataFromSeries(e,t,Me.getSeriesVisibility(e.name,this.settings),this.theme,n);if(this.seriesDataMap.set(e.name,a),this.seriesToProcess.add(e.name),this.data=[...this.seriesDataMap.values()],e.plotStyle===i.plot.SeriesPlotStyle.STACKED_BAR?this.layout.barmode="stack":e.plotStyle===i.plot.SeriesPlotStyle.PIE&&(this.layout.hiddenlabels=Me.getHiddenLabels(this.settings)),this.layout.showlegend=this.data.length>1||e.plotStyle===i.plot.SeriesPlotStyle.PIE?n??void 0:!1,e.oneClick!=null){for(var{oneClick:s}=e,{columns:o}=s,l=0;l<o.length;l+=1)this.filterColumnMap.set(o[l].name,o[l]);this.oneClicks.push(s)}this.updateLayoutFormats()}subscribe(e){super.subscribe(e),this.listeners.length===1&&(this.initAllSeries(),this.subscribeFigure())}unsubscribe(e){super.unsubscribe(e),this.listeners.length===0&&this.unsubscribeFigure()}subscribeFigure(){if(!this.isConnected){Fe.debug("Ignoring subscribe when figure in disconnected state");return}this.figure.subscribe(this.isDownsamplingDisabled?this.dh.plot.DownsampleOptions.DISABLE:this.dh.plot.DownsampleOptions.DEFAULT),this.figure.errors.length>0&&(Fe.error("Errors in figure",this.figure.errors),this.fireError(this.figure.errors))}unsubscribeFigure(){this.figure.unsubscribe()}startListeningFigure(){var{dh:e}=this;this.figure.addEventListener(e.plot.Figure.EVENT_UPDATED,this.handleFigureUpdated),this.figure.addEventListener(e.plot.Figure.EVENT_SERIES_ADDED,this.handleFigureSeriesAdded),this.figure.addEventListener(e.plot.Figure.EVENT_DISCONNECT,this.handleFigureDisconnected),this.figure.addEventListener(e.plot.Figure.EVENT_RECONNECT,this.handleFigureReconnected),this.figure.addEventListener(e.plot.Figure.EVENT_DOWNSAMPLESTARTED,this.handleDownsampleStart),this.figure.addEventListener(e.plot.Figure.EVENT_DOWNSAMPLEFINISHED,this.handleDownsampleFinish),this.figure.addEventListener(e.plot.Figure.EVENT_DOWNSAMPLEFAILED,this.handleDownsampleFail),this.figure.addEventListener(e.plot.Figure.EVENT_DOWNSAMPLENEEDED,this.handleDownsampleNeeded),this.figure.addEventListener(e.Client.EVENT_REQUEST_FAILED,this.handleRequestFailed)}stopListeningFigure(){var{dh:e}=this;this.figure.removeEventListener(e.plot.Figure.EVENT_UPDATED,this.handleFigureUpdated),this.figure.removeEventListener(e.plot.Figure.EVENT_SERIES_ADDED,this.handleFigureSeriesAdded),this.figure.removeEventListener(e.plot.Figure.EVENT_DISCONNECT,this.handleFigureDisconnected),this.figure.removeEventListener(e.plot.Figure.EVENT_RECONNECT,this.handleFigureReconnected),this.figure.removeEventListener(e.plot.Figure.EVENT_DOWNSAMPLESTARTED,this.handleDownsampleStart),this.figure.removeEventListener(e.plot.Figure.EVENT_DOWNSAMPLEFINISHED,this.handleDownsampleFinish),this.figure.removeEventListener(e.plot.Figure.EVENT_DOWNSAMPLEFAILED,this.handleDownsampleFail),this.figure.removeEventListener(e.plot.Figure.EVENT_DOWNSAMPLENEEDED,this.handleDownsampleNeeded),this.figure.removeEventListener(e.Client.EVENT_REQUEST_FAILED,this.handleRequestFailed)}handleDownsampleStart(e){Fe.debug("Downsample started",e),this.fireDownsampleStart(e.detail)}handleDownsampleFinish(e){Fe.debug("Downsample finished",e),this.fireDownsampleFinish(e.detail)}handleDownsampleFail(e){Fe.error("Downsample failed",e),this.fireDownsampleFail(e.detail)}handleDownsampleNeeded(e){Fe.info("Downsample needed",e),this.fireDownsampleNeeded(e.detail)}handleFigureUpdated(e){var{detail:t}=e,{series:n}=t;Fe.debug2("handleFigureUpdated",n);for(var i=0;i<n.length;i+=1){var a=n[i];Fe.debug2("handleFigureUpdated updating series",a.name);for(var{sources:s}=a,o=0;o<s.length;o+=1){var l=s[o],{columnType:d,type:h}=l,c=this.getValueTranslator(d,this.formatter),f=t.getArray(a,h,c);this.setDataArrayForSeries(a,h,f)}this.seriesToProcess.delete(a.name),this.cleanSeries(a)}this.seriesToProcess.size===0&&this.fireLoadFinished();var{data:p}=this;this.fireUpdate(p)}handleRequestFailed(e){Fe.error("Request failed",e),this.fireError(["".concat(e.detail)])}resubscribe(){this.listeners.length>0&&(this.unsubscribeFigure(),this.subscribeFigure())}setFormatter(e){super.setFormatter(e),this.updateLayoutFormats(),this.resubscribe()}setDownsamplingDisabled(e){super.setDownsamplingDisabled(e),this.resubscribe()}handleFigureDisconnected(e){Fe.debug("Figure disconnected",e),this.isConnected=!1,this.listeners.length>0&&this.unsubscribeFigure(),this.fireDisconnect()}handleFigureReconnected(e){Fe.debug("Figure reconnected",e),this.isConnected=!0,this.initAllSeries(),this.fireReconnect(),this.listeners.length>0&&this.subscribeFigure()}handleFigureSeriesAdded(e){var{detail:t}=e;Fe.debug("handleFigureSeriesAdded",t),this.pendingSeries.push(t),this.addPendingSeries()}setDimensions(e){super.setDimensions(e),this.updateAxisPositions()}setTitle(e){var t,n;super.setTitle(e);var i=(t=(n=(e??"").match(/<br>/g))===null||n===void 0?void 0:n.length)!==null&&t!==void 0?t:0,a=Me.DEFAULT_MARGIN.t+i*Me.SUBTITLE_LINE_HEIGHT;this.layout.margin?this.layout.margin.t=a:this.layout.margin={t:a},typeof this.layout.title=="string"?this.layout.title=e:(this.layout.title=Xd({},this.layout.title),this.layout.title.text=e,this.layout.title.pad=Xd({},this.layout.title.pad),this.layout.title.pad.t=Me.DEFAULT_TITLE_PADDING.t+i*Me.SUBTITLE_LINE_HEIGHT*.5)}getPlotWidth(){var e,t,n,i;return!this.rect||!this.rect.width?0:Math.max(this.rect.width-((e=(t=this.layout.margin)===null||t===void 0?void 0:t.l)!==null&&e!==void 0?e:0)-((n=(i=this.layout.margin)===null||i===void 0?void 0:i.r)!==null&&n!==void 0?n:0),0)}getPlotHeight(){var e,t,n,i;return!this.rect||!this.rect.height?0:Math.max(this.rect.height-((e=(t=this.layout.margin)===null||t===void 0?void 0:t.t)!==null&&e!==void 0?e:0)-((n=(i=this.layout.margin)===null||i===void 0?void 0:i.b)!==null&&n!==void 0?n:0),0)}updateAxisPositions(){var e=this.getPlotWidth(),t=this.getPlotHeight();this.chartUtils.updateFigureAxes(this.layout,this.figure,this.theme,n=>this.getAxisRangeParser(n,this.formatter),e,t)}updateLayoutFormats(){if(this.formatter){var e=this.chartUtils.getAxisFormats(this.figure,this.formatter);e.forEach((t,n)=>{Fe.debug("Assigning ".concat(n),this.layout[n],t);var i=this.layout[n];i!=null?Object.assign(i,t):Fe.debug("Ignoring null layout.".concat(n))})}}setDataArrayForSeries(e,t,n){var{name:i,plotStyle:a}=e,s=this.seriesDataMap.get(i),o=this.chartUtils.getPlotlyProperty(a,t);s&&vc(s,o,n)}cleanSeries(e){var{dh:t}=this,{name:n,plotStyle:i}=e,a=this.seriesDataMap.get(n);if(a!=null){if(i===t.plot.SeriesPlotStyle.HISTOGRAM){var{xLow:s,xHigh:o}=a;if(s&&o&&s.length===o.length){for(var l=[],d=0;d<s.length;d+=1)l.push(o[d]-s[d]);a.width=l}}else if(i===t.plot.SeriesPlotStyle.LINE||i===t.plot.SeriesPlotStyle.ERROR_BAR||i===t.plot.SeriesPlotStyle.BAR){var{x:h,xLow:c,xHigh:f,y:p,yLow:m,yHigh:b}=a;c&&f&&c!==h&&(a.error_x=Me.getPlotlyErrorBars(h,c,f,this.theme)),m&&b&&m!==p&&(a.error_y=Me.getPlotlyErrorBars(p,m,b,this.theme))}else if(i===t.plot.SeriesPlotStyle.TREEMAP){var{ids:g,labels:C}=a;g!==void 0&&C===void 0&&(a.labels=g)}}}getData(){return this.data}getLayout(){return this.layout}getFilterColumnMap(){return new Map(this.filterColumnMap)}isFilterRequired(){return this.oneClicks.find(e=>e.requireAllFiltersToDisplay)!=null}setFilter(e){var t=this;if(this.oneClicks.length===0){Fe.warn("Trying to set a filter, but no one click!");return}Fe.debug("setFilter",e);for(var n=function(){var s=t.oneClicks[i],{columns:o}=s,l=new Set([...e.keys(),...t.lastFilter.keys()]);l.forEach(d=>{var h=e.get(d);t.lastFilter.get(d)!==h&&o.find(c=>c.name===d)!=null&&s.setValueForColumn(d,h)})},i=0;i<this.oneClicks.length;i+=1)n();this.lastFilter=new Map(e)}setFigure(e){this.close(),this.figure=e,this.setTitle(this.getDefaultTitle()),this.initAllSeries(),this.updateAxisPositions(),this.startListeningFigure(),this.listeners.length>0&&this.subscribeFigure()}updateSettings(e){this.settings=e}}Se(za,"ADD_SERIES_DEBOUNCE",50);const ro=za;function Zd(r,e,t,n,i,a,s){try{var o=r[a](s),l=o.value}catch(d){t(d);return}o.done?e(l):Promise.resolve(l).then(n,i)}function _s(r){return function(){var e=this,t=arguments;return new Promise(function(n,i){var a=r.apply(e,t);function s(l){Zd(a,n,i,s,o,"next",l)}function o(l){Zd(a,n,i,s,o,"throw",l)}s(void 0)})}}class ul{static makeModelFromSettings(e,t,n,i){return _s(function*(){var a=yield ul.makeFigureFromSettings(e,t,n);return new ro(e,a,i,t)})()}static makeFigureFromSettings(e,t,n){return _s(function*(){var i=yield n.copy();return i.applyCustomColumns(n.customColumns),i.applyFilter(n.filter),i.applySort(n.sort),e.plot.Figure.create(new Me(e).makeFigureSettings(t,i))})()}static makeModel(e,t,n,i){return _s(function*(){return new ro(e,n,i,t)})()}}const pr=ul,Lw="var(--dh-color-chart-colorway)",Fw="var(--dh-color-chart-grid)",Aw="var(--dh-color-chart-axis-line)",Rw="var(--dh-color-chart-axis-line-zero)",Qd={"paper-bgcolor":"var(--dh-color-chart-bg)","plot-bgcolor":"var(--dh-color-chart-plot-bg)","title-color":"var(--dh-color-chart-title)","legend-color":"var(--dh-color-chart-legend-fg)",colorway:Lw,gridcolor:Fw,linecolor:Aw,zerolinecolor:Rw,"error-band-line-color":"var(--dh-color-chart-error-band-line)","ohlc-increasing":"var(--dh-color-chart-ohlc-increase)","ohlc-decreasing":"var(--dh-color-chart-ohlc-decrease)","coastline-color":"var(--dh-color-chart-geo-coastline)","land-color":"var(--dh-color-chart-geo-land)","ocean-color":"var(--dh-color-chart-geo-ocean)","lake-color":"var(--dh-color-chart-geo-lake)","river-color":"var(--dh-color-chart-geo-river)"};var Jd=B.module("ChartTheme");function hl(){var r,e=Oo(Qd);return e.colorway=gc((r=e.colorway)!==null&&r!==void 0?r:"").map(t=>{var[n,i]=t;return Fg.normalizeCssColor(e.colorway.substring(n,i+1))}).join(" "),Jd.debug2("Chart theme:",Qd),Jd.debug2("Chart theme derived:",e),Object.freeze({paper_bgcolor:e["paper-bgcolor"],plot_bgcolor:e["plot-bgcolor"],title_color:e["title-color"],legend_color:e["legend-color"],colorway:e.colorway,gridcolor:e.gridcolor,linecolor:e.linecolor,zerolinecolor:e.zerolinecolor,error_band_line_color:e["error-band-line-color"],ohlc_increasing:e["ohlc-increasing"],ohlc_decreasing:e["ohlc-decreasing"],coastline_color:e["coastline-color"],land_color:e["land-color"],ocean_color:e["ocean-color"],lake_color:e["lake-color"],river_color:e["river-color"]})}function mr(r,e,t){return e=jw(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function jw(r){var e=kw(r,"string");return typeof e=="symbol"?e:String(e)}function kw(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class be extends St{static get theme(){return be._theme==null&&(be._theme=hl()),be._theme}static makeRandomSeries(e){for(var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:100,i=[],a=[],s=[],o=[],l=new Date("2018-06-01"),d=0;d<n;d+=1){var h=new Date(l.getFullYear(),l.getMonth(),l.getDate()+d-n);i.push("".concat(h.getFullYear(),"-").concat(h.getMonth()+1,"-").concat(h.getDate()));var c=(Math.sin(d/n*e)*n/3+Math.cos(d*.2)*n/6+Math.sin(d*.5)*n/10+be.random()*n/5+d*be.smoothing)*t;c=Math.round(c*100)/100,a.push(c),o.push(40+d*be.smoothing),s.push(Math.sin(d/n*e)*n/3+be.random()*n/10+d*be.smoothing)}return{x:i,y:a,s,l:o}}static makeScatter(e){return{name:"SCTR",x:e.x,y:e.y,type:"scatter",mode:"markers",hoverinfo:"skip",marker:{size:5}}}static makeArea(e){return{name:"AREA",x:e.x,y:e.s,type:"scatter",mode:"line",fill:"tozeroy",hoverinfo:"all",line:{width:3}}}static makeTrendline(e){return{name:"Trendline <br>R<sup>2</sup> = 0.91",x:e.x,y:e.l,type:"scatter",mode:"line",hoverinfo:"skip",line:{width:3,dash:"dot"}}}static makeErrorBand(e){for(var t=[],n=[],i=0;i<e.y.length;i+=1){var a=e.y[i];t[i]=Math.round((a+18)*100)/100,n[i]=Math.round((a-18)*100)/100}var s=t.concat(n.reverse());return{name:"error",x:e.x.concat(e.x.slice().reverse()),y:s,type:"scatter",mode:"line",hoverinfo:"skip",fill:"toself",line:{width:0,color:be.theme.error_band_line_color,shape:"spline"}}}static makeLine(e){return{name:"LINE",x:e.x,y:e.y,type:"scatter",mode:"line",hoverinfo:"x+y+text+name",line:{width:3}}}static makeRandomData(){var e=be.makeRandomSeries(6),t=be.makeArea(e),n=be.makeTrendline(e),i=be.makeRandomSeries(2),a=be.makeLine(i),s=be.makeErrorBand(i);return[t,n,a,s]}static makeDefaultLayout(e){var t=new Me(e).makeDefaultLayout(be.theme);return t.title="Chart",t.xaxis&&(t.xaxis.title="Datestamp"),t.yaxis&&(t.yaxis.title="Price"),t}constructor(e){var{data:t=be.makeRandomData(),layout:n=be.makeDefaultLayout(e),filterFields:i=[]}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};super(e),mr(this,"data",void 0),mr(this,"filterFields",void 0),mr(this,"layout",void 0),this.data=t,this.layout=n,this.filterFields=i}getData(){return this.data}getLayout(){return this.layout}getFilterColumnMap(){for(var e=new Map,t=0;t<this.filterFields.length;t+=1){var n=this.filterFields[t],i="java.lang.String";e.set(n,{name:n,type:i})}return e}isFilterRequired(){return this.filterFields.length>0}setFilter(){this.fireUpdate(this.data)}}mr(be,"random",Math.random.bind(Math));mr(be,"smoothing",1.5);mr(be,"_theme",void 0);const $w=be,Sf=bf($o);var cl=v.createContext(null);function yf(r){var{children:e}=r,{activeThemes:t}=Rr(),n=v.useMemo(hl,[t]);return u.jsx(cl.Provider,{value:n,children:e})}function io(r){return r.setFigure!==void 0}function Ti(){return Ar(cl,"No ChartThemeContext value found.")}const Uw=Object.freeze(Object.defineProperty({__proto__:null,Chart:dl,ChartModel:St,ChartModelFactory:pr,ChartThemeContext:cl,ChartThemeProvider:yf,ChartUtils:Me,DownsamplingError:Cf,FigureChartModel:ro,MockChartModel:$w,Plot:Sf,defaultChartTheme:hl,isFigureChartModel:io,useChartTheme:Ti},Symbol.toStringTag,{value:"Module"}));var Ef=Object.freeze({openPopouts:[],settings:{hasHeaders:!0,constrainDragToContainer:!0,reorderEnabled:!0,selectionEnabled:!1,popoutWholeStack:!1,blockedPopoutsThrowError:!0,closePopoutsOnUnload:!0,showPopoutIcon:!0,showMaximiseIcon:!0,showCloseIcon:!0,responsiveMode:"onload",tabOverlapAllowance:0,tabControlOffset:10},dimensions:{borderWidth:5,borderGrabWidth:10,minItemHeight:10,minItemWidth:10,headerHeight:20,dragProxyWidth:300,dragProxyHeight:200},labels:{close:"Close",maximise:"Maximize",minimise:"Minimize",popout:"Open in new window",popin:"Pop in",tabDropdown:"Additional tabs",tabNextLabel:"Next",tabPreviousLabel:"Previous"},content:[]});function wf(r){return r.componentName!==void 0}function Hw(r){return r.component!==void 0}var Pf=Object.freeze({type:"default",isClosable:!0,isFocusOnShow:!0,reorderEnabled:!0,title:""});const Vw=Object.freeze(Object.defineProperty({__proto__:null,defaultConfig:Ef,isGLComponentConfig:wf,isReactComponentConfig:Hw,itemDefaultConfig:Pf},Symbol.toStringTag,{value:"Module"}));function sa(r,e,t){return e=Bw(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Bw(r){var e=Ww(r,"string");return typeof e=="symbol"?e:String(e)}function Ww(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class hi{constructor(){sa(this,"_mSubscriptions",void 0),sa(this,"off",this.unbind),sa(this,"trigger",this.emit),this._mSubscriptions={},this._mSubscriptions[hi.ALL_EVENT]=[]}on(e,t,n){if(typeof t!="function")throw new Error("Tried to listen to event "+e+" with non-function callback "+t);this._mSubscriptions[e]||(this._mSubscriptions[e]=[]),this._mSubscriptions[e].push({fn:t,ctx:n})}emit(e){for(var t=this._mSubscriptions[e],n=arguments.length,i=new Array(n>1?n-1:0),a=1;a<n;a++)i[a-1]=arguments[a];if(t)for(var s=0;s<t.length;s++){var o=t[s].ctx||{};try{t[s].fn.apply(o,i)}catch(c){console.error("Error while emitting event:",c)}}i.unshift(e);for(var l=this._mSubscriptions[hi.ALL_EVENT],d=0;d<l.length;d++){var h=l[d].ctx||{};try{l[d].fn.apply(h,i)}catch(c){console.error("Error while emitting event to allEventSubs:",c)}}}unbind(e,t,n){if(!this._mSubscriptions[e])throw new Error("No subscriptions to unsubscribe for event "+e);for(var i=!1,a=0;a<this._mSubscriptions[e].length;a++)(!t||this._mSubscriptions[e][a].fn===t)&&(!n||n===this._mSubscriptions[e][a].ctx)&&(this._mSubscriptions[e].splice(a,1),i=!0);if(i===!1)throw new Error("Nothing to unbind for "+e)}}sa(hi,"ALL_EVENT","__all");const Ft=hi;function _t(r,e,t){return e=Gw(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Gw(r){var e=zw(r,"string");return typeof e=="symbol"?e:String(e)}function zw(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class ao extends Ft{constructor(e,t,n){super(),_t(this,"width",void 0),_t(this,"height",void 0),_t(this,"title",void 0),_t(this,"parent",void 0),_t(this,"layoutManager",void 0),_t(this,"tab",void 0),_t(this,"_config",void 0),_t(this,"isHidden",!1),_t(this,"beforeCloseHandler",void 0),_t(this,"_element",Z(['<div class="lm_item_container">','<div class="lm_content" tabindex="-1"></div>',"</div>"].join(""))),_t(this,"_contentElement",void 0),this.title=wf(e)?e.componentName:"",this.parent=t,this.layoutManager=n,this._config=e,this._contentElement=this._element.find(".lm_content"),this.beforeCloseHandler=null}getElement(){return this._contentElement}hide(){this.emit("hide"),this.isHidden=!0,this._element.hide()}show(){this.emit("show"),this.isHidden=!1,this._element.show(),(this.height!=0||this.width!=0)&&this.emit("shown")}setSize(e,t){for(var n,i,a,s=this.parent,o=null;s&&!s.isColumn&&!s.isRow;){var l;if(o=s,s=s.parent,(l=s)!==null&&l!==void 0&&l.isRoot)return!1}if(!s||!o)return!1;for(var d=s.isColumn?"height":"width",h=d==="height"?t:e,c=((n=this[d])!==null&&n!==void 0?n:0)*(1/(((i=o.config[d])!==null&&i!==void 0?i:0)/100)),f=h/c*100,p=(((a=o.config[d])!==null&&a!==void 0?a:0)-f)/(s.contentItems.length-1),m=0;m<s.contentItems.length;m++)if(s.contentItems[m]===o)s.contentItems[m].config[d]=f;else{var b;s.contentItems[m].config[d]=((b=s.contentItems[m].config[d])!==null&&b!==void 0?b:0)+p}return s.callDownwards("setSize"),!0}close(e){var t,n;this._config.isClosable&&(!((t=(n=this.beforeCloseHandler)===null||n===void 0?void 0:n.call(this,e))!==null&&t!==void 0)||t)&&(this.emit("close"),this.parent.close())}beforeClose(e){this.beforeCloseHandler=e}getState(){return this._config.componentState}extendState(e){this.setState(Z.extend(!0,this.getState(),e))}setState(e){this._config.componentState=e,this.parent.emitBubblingEvent("stateChanged")}setTitle(e){this.parent.setTitle(e)}_$setSize(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;if(e!==this.width||t!==this.height){this.width=e,this.height=t;var n=this._contentElement[0],i=n.offsetWidth-n.clientWidth,a=n.offsetHeight-n.clientHeight;this._contentElement.width(this.width-i).height(this.height-a),this.emit("resize")}}}const Kw=Object.freeze(Object.defineProperty({__proto__:null,Container:ao,ItemContainer:ao},Symbol.toStringTag,{value:"Module"}));function _f(r){var e=location.hash.match(new RegExp(r+"=([^&]*)"));return e?e[1]:null}function Tf(r){if(window.location.hash)return _f(r);if(!window.location.search)return null;var e=window.location.search.substr(1).split("&"),t={},n,i;for(i=0;i<e.length;i++)n=e[i].split("="),t[n[0]]=n[1];return t[r]||null}function vl(r){return window.requestAnimationFrame(r)}function qw(r,e){var t=e.indexOf(r);if(t===-1)throw new Error("Can't remove item from array. Item is not in the array");e.splice(t,1)}function fl(){return(Math.random()*1e15).toString(36).replace(".","")}function Yw(r,e){var t=r.replace(/javascript/gi,"javascript").replace(/expression/gi,"expression").replace(/onload/gi,"onload").replace(/script/gi,"script").replace(/onerror/gi,"onerror");return e===!0?t:t.replace(/>/g,">").replace(/</g,"<")}function pl(r){return Z.trim(r.replace(/(<([^>]+)>)/gi,""))}function lt(r,e,t){return e=Xw(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Xw(r){var e=Zw(r,"string");return typeof e=="symbol"?e:String(e)}function Zw(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class Qw extends Ft{constructor(e){var t,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;super(),lt(this,"_eElement",void 0),lt(this,"_oDocument",void 0),lt(this,"_eBody",void 0),lt(this,"_destroyAfterMouseUp",void 0),lt(this,"_nDelay",400),lt(this,"_timeout",void 0),lt(this,"timeout",void 0),lt(this,"_nDistance",10),lt(this,"_nX",0),lt(this,"_nY",0),lt(this,"_nOriginalX",0),lt(this,"_nOriginalY",0),lt(this,"_bDragging",!1),this._eElement=e,this._oDocument=Z(document),this._eBody=Z(document.body),this._destroyAfterMouseUp=n,this.onMouseMove=this.onMouseMove.bind(this),this.onMouseUp=this.onMouseUp.bind(this),this.onMouseDown=this.onMouseDown.bind(this),this._startDrag=this._startDrag.bind(this),(t=this._eElement)===null||t===void 0||t.on("mousedown",this.onMouseDown)}destroy(){var e,t;(e=this._eElement)===null||e===void 0||e.unbind("mousedown",this.onMouseDown),(t=this._oDocument)===null||t===void 0||t.unbind("mouseup",this.onMouseUp),this._eElement=void 0,this._oDocument=void 0,this._eBody=void 0,clearTimeout(this._timeout),this._timeout=void 0}onMouseDown(e){if(e.preventDefault(),e.button===0){var t,n,i,a,s=this._getCoordinates(e);this._nOriginalX=(t=s.x)!==null&&t!==void 0?t:0,this._nOriginalY=(n=s.y)!==null&&n!==void 0?n:0,(i=this._oDocument)===null||i===void 0||i.on("mousemove",this.onMouseMove),(a=this._oDocument)===null||a===void 0||a.on("mouseup",this.onMouseUp),this._timeout=window.setTimeout(this._startDrag,this._nDelay)}}onMouseMove(e){if(this._timeout!=null){var t,n;e.preventDefault();var i=this._getCoordinates(e);this._nX=((t=i.x)!==null&&t!==void 0?t:0)-this._nOriginalX,this._nY=((n=i.y)!==null&&n!==void 0?n:0)-this._nOriginalY,this._bDragging===!1&&(Math.abs(this._nX)>this._nDistance||Math.abs(this._nY)>this._nDistance)&&this._startDrag(),this._bDragging&&this.emit("drag",this._nX,this._nY,e)}}onMouseUp(e){if(this._timeout!=null){var t,n,i,a,s;if(clearTimeout(this._timeout),(t=this._oDocument)===null||t===void 0||t.unbind("mousemove",this.onMouseMove),(n=this._oDocument)===null||n===void 0||n.unbind("mouseup",this.onMouseUp),(i=this._oDocument)===null||i===void 0||(a=i.find("iframe"))===null||a===void 0||a.css("pointer-events",""),this._bDragging===!0&&(this._bDragging=!1,this.emit("dragStop",e,this._nOriginalX+this._nX)),(s=this._eBody)===null||s===void 0||s.removeClass("lm_dragging"),!(this._eElement instanceof Window)){var o;(o=this._eElement)===null||o===void 0||o.removeClass("lm_dragging")}this._destroyAfterMouseUp&&this.destroy()}}_startDrag(){var e,t,n,i;window.clearTimeout(this._timeout),this._bDragging=!0,(e=this._eBody)===null||e===void 0||e.addClass("lm_dragging"),(t=this._eElement)===null||t===void 0||t.addClass("lm_dragging"),(n=this._oDocument)===null||n===void 0||(i=n.find("iframe"))===null||i===void 0||i.css("pointer-events","none"),this.emit("dragStart",this._nOriginalX,this._nOriginalY)}_getCoordinates(e){var t,n;return{x:(t=e.pageX)!==null&&t!==void 0?t:0,y:(n=e.pageY)!==null&&n!==void 0?n:0}}}const Oi=Qw;function er(r,e,t){return e=Jw(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Jw(r){var e=eP(r,"string");return typeof e=="symbol"?e:String(e)}function eP(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class Of{constructor(e,t){er(this,"_container",void 0),er(this,"_reactComponent",null),er(this,"_portalComponent",null),er(this,"_originalComponentWillUpdate",null),er(this,"_initialState",void 0),er(this,"_reactClass",void 0),this._reactComponent=null,this._portalComponent=null,this._originalComponentWillUpdate=null,this._container=e,this._initialState=t,this._reactClass=this._getReactClass(),this._container.on("open",this._render,this),this._container.on("destroy",this._destroy,this)}_key(){var e=this._container._config.id;if(!e)throw new Error("Cannot mount panel without id");return Array.isArray(e)?e.join(","):e}_render(){var e=this._key();this._portalComponent=Ma.createPortal(this._getReactComponent(),this._container.getElement()[0],e),this._container.layoutManager.addReactChild(e,this._portalComponent)}_gotReactComponent(e){if(e){this._reactComponent=e,this._originalComponentWillUpdate=this._reactComponent.componentWillUpdate||function(){},this._reactComponent.componentWillUpdate=this._onUpdate.bind(this);var t=this._container.getState();t&&this._reactComponent.setState(t)}}_destroy(){this._container.layoutManager.removeReactChild(this._key(),this._portalComponent),this._container.off("open",this._render,this),this._container.off("destroy",this._destroy,this)}_onUpdate(e,t){var n;this._container.setState(t),(n=this._originalComponentWillUpdate)===null||n===void 0||n.call(this._reactComponent,e,t)}_getReactClass(){var e=this._container._config.component;if(!e)throw new Error("No react component name. type: react-component needs a field `component`");var t=this._container.layoutManager.getComponent(e)||this._container.layoutManager.getFallbackComponent();if(!t)throw new Error('React component "'+e+'" not found. Please register all components with GoldenLayout using `registerComponent(name, component)`');return t}_getReactComponent(){var e={glEventHub:this._container.layoutManager.eventHub,glContainer:this._container,ref:this._gotReactComponent.bind(this)},t=Z.extend(e,this._container._config.props);return X.createElement(this._reactClass,t)}}var Ca=["settings","hasHeaders","constrainDragToContainer","selectionEnabled","dimensions","borderWidth","minItemHeight","minItemWidth","headerHeight","dragProxyWidth","dragProxyHeight","labels","close","maximise","minimise","popout","content","componentName","componentState","id","width","type","height","isClosable","title","popoutWholeStack","openPopouts","parentId","activeItemIndex","reorderEnabled","borderGrabWidth"],tP=[!0,!1,"row","column","stack","component","close","maximise","minimise","open in new window"];function ml(r){if(Ca.length>36)throw new Error("Too many keys in config minifier map");var e={};return gl(r,e,"_min"),e}function so(r){if(Ca.length>36)throw new Error("Too many keys in config minifier map");var e={};return gl(r,e,"_max"),e}function gl(r,e,t){var n=t==="_min"?nP:rP;for(var i in r)if(r.hasOwnProperty(i)){var a=Array.isArray(r)?r[Number.parseInt(i,10)]:r[i];if(typeof a=="object"&&a!=null){var s=a instanceof Array?[]:{};if(Array.isArray(e))e[Number.parseInt(i,10)]=s;else{var o=n(i,Ca);e[o]=s}gl(a,s,t)}else{var l=n(a,tP);if(Array.isArray(e))e[Number.parseInt(i,10)]=l;else{var d=n(i,Ca);e[d]=l}}}}function nP(r,e){if(typeof r=="string"&&r.length===1)return"___"+r;var t=e.indexOf(r);return t===-1?r:t.toString(36)}function rP(r,e){return typeof r=="string"&&r.length===1?e[parseInt(r,36)]:typeof r=="string"&&r.substr(0,3)==="___"?r[3]:r}function Ts(r,e,t){return e=iP(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function iP(r){var e=aP(r,"string");return typeof e=="symbol"?e:String(e)}function aP(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class oo{constructor(e,t){Ts(this,"name",void 0),Ts(this,"origin",void 0),Ts(this,"isPropagationStopped",void 0),this.name=e,this.origin=t,this.isPropagationStopped=!1}stopPropagation(){this.isPropagationStopped=!0}}function Bi(r,e,t){return e=sP(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function sP(r){var e=oP(r,"string");return typeof e=="symbol"?e:String(e)}function oP(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}let lP=class extends Ft{constructor(e){super(),Bi(this,"_layoutManager",void 0),Bi(this,"_dontPropagateToParent",void 0),Bi(this,"_childEventSource",void 0),Bi(this,"_boundOnEventFromChild",void 0),this._layoutManager=e,this._dontPropagateToParent=null,this._childEventSource=null,this.on(Ft.ALL_EVENT,this._onEventFromThis.bind(this)),this._boundOnEventFromChild=this._onEventFromChild.bind(this),Z(window).on("gl_child_event",this._boundOnEventFromChild)}_onEventFromThis(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];this._layoutManager.isSubWindow&&t[0]!==this._dontPropagateToParent&&this._propagateToParent(t),this._propagateToChildren(t),this._dontPropagateToParent=null,this._childEventSource=null}_$onEventFromParent(e){this._dontPropagateToParent=e[0],this.emit.apply(this,e)}_onEventFromChild(e){this._childEventSource=e.originalEvent.__gl,this.emit.apply(this,e.originalEvent.__glArgs)}_propagateToParent(e){var t,n="gl_child_event",i=(t=window.opener)===null||t===void 0?void 0:t.document.createEvent("HTMLEvents");i.initEvent(n,!0,!0),i.eventName=n,i.__glArgs=e,i.__gl=this._layoutManager,window.opener.dispatchEvent(i)}_propagateToChildren(e){for(var t=0;t<this._layoutManager.openPopouts.length;t++){var n=this._layoutManager.openPopouts[t].getGlInstance();n&&n!==this._childEventSource&&n.eventHub._$onEventFromParent(e)}}destroy(){Z(window).off("gl_child_event",this._boundOnEventFromChild)}};const Df=lP,dP=Object.freeze(Object.defineProperty({__proto__:null,BubblingEvent:oo,DragListener:Oi,EventEmitter:Ft,EventHub:Df,ReactComponentHandler:Of,animFrame:vl,filterXss:Yw,getHashValue:_f,getQueryStringParam:Tf,getUniqueId:fl,minifyConfig:ml,removeFromArray:qw,stripTags:pl,unminifyConfig:so},Symbol.toStringTag,{value:"Module"}));function ln(r,e,t){return e=uP(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function uP(r){var e=hP(r,"string");return typeof e=="symbol"?e:String(e)}function hP(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class xf extends Ft{constructor(e,t,n,i,a){super(),ln(this,"isInitialised",!1),ln(this,"_config",void 0),ln(this,"_dimensions",void 0),ln(this,"_parentId",void 0),ln(this,"_indexInParent",void 0),ln(this,"_layoutManager",void 0),ln(this,"_popoutWindow",null),ln(this,"_id",null),this._config=e,this._dimensions=t,this._parentId=n,this._indexInParent=i,this._layoutManager=a,this._createWindow()}toConfig(){var e,t,n,i,a,s,o,l,d,h,c;if(this.isInitialised===!1)throw new Error("Can't create config, layout not yet initialised");return{dimensions:{width:(e=this.getGlInstance())===null||e===void 0?void 0:e.width,height:(t=this.getGlInstance())===null||t===void 0?void 0:t.height,left:(n=(i=(a=this._popoutWindow)===null||a===void 0?void 0:a.screenX)!==null&&i!==void 0?i:(s=this._popoutWindow)===null||s===void 0?void 0:s.screenLeft)!==null&&n!==void 0?n:0,top:(o=(l=(d=this._popoutWindow)===null||d===void 0?void 0:d.screenY)!==null&&l!==void 0?l:(h=this._popoutWindow)===null||h===void 0?void 0:h.screenTop)!==null&&o!==void 0?o:0},content:(c=this.getGlInstance())===null||c===void 0?void 0:c.toConfig().content,parentId:this._parentId,indexInParent:this._indexInParent}}getGlInstance(){var e;return(e=this._popoutWindow)===null||e===void 0?void 0:e.__glInstance}getWindow(){return this._popoutWindow}close(){if(this.getGlInstance()){var e;(e=this.getGlInstance())===null||e===void 0||e._$closeWindow()}else try{var t;(t=this.getWindow())===null||t===void 0||t.close()}catch{}}popIn(){var e;this._indexInParent;var t=null,n=null;if(this._parentId){var i;if(t=Z.extend(!0,{},(i=this.getGlInstance())===null||i===void 0?void 0:i.toConfig()).content[0],n=this._layoutManager.root.getItemsById(this._parentId)[0],!n){var a;((a=this._layoutManager.root.contentItems.length)!==null&&a!==void 0?a:0)>0?n=this._layoutManager.root.contentItems[0]:n=this._layoutManager.root}}t&&((e=n)===null||e===void 0||e.addChild(t,this._indexInParent),this.close())}_createWindow(){var e=this._createUrl(),t=Math.floor(Math.random()*1e6).toString(36),n=this._serializeWindowOptions({width:this._dimensions.width,height:this._dimensions.height,innerWidth:this._dimensions.width,innerHeight:this._dimensions.height,menubar:"no",toolbar:"no",location:"no",personalbar:"no",resizable:"yes",scrollbars:"no",status:"no"});if(this._popoutWindow=window.open(e,t,n),!this._popoutWindow)if(this._layoutManager.config.settings.blockedPopoutsThrowError===!0){var i=new Error("Popout blocked");throw i.type="popoutBlocked",i}else return;Z(this._popoutWindow).on("load",this._positionWindow.bind(this)).on("unload beforeunload",this._onClose.bind(this));var a=window.setInterval(()=>{var s;(s=this._popoutWindow)!==null&&s!==void 0&&s.__glInstance&&this._popoutWindow.__glInstance.isInitialised&&(this._onInitialised(),window.clearInterval(a))},10)}_serializeWindowOptions(e){var t=[],n;for(n in e)t.push(n+"="+e[n]);return t.join(",")}_createUrl(){var e={content:this._config},t="gl-window-config-"+fl();e=ml(e);try{localStorage.setItem(t,JSON.stringify(e))}catch(i){throw new Error("Error while writing to localStorage "+i.toString())}var n=document.location.href.split("?");return n.length===1?n[0]+"?gl-window="+t:document.location.href+"&gl-window="+t}_positionWindow(){var e,t;(e=this._popoutWindow)===null||e===void 0||e.moveTo(this._dimensions.left,this._dimensions.top),(t=this._popoutWindow)===null||t===void 0||t.focus()}_onInitialised(){var e;this.isInitialised=!0,(e=this.getGlInstance())===null||e===void 0||e.on("popIn",this.popIn,this),this.emit("initialised")}_onClose(){setTimeout(this.emit.bind(this,"closed"),50)}}function Re(r,e,t){return e=cP(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function cP(r){var e=vP(r,"string");return typeof e=="symbol"?e:String(e)}function vP(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class zn extends Ft{constructor(e,t,n,i,a,s){var o,l,d,h,c,f,p,m;if(super(),Re(this,"_dragListener",void 0),Re(this,"_layoutManager",void 0),Re(this,"_contentItem",void 0),Re(this,"_originalParent",void 0),Re(this,"_area",null),Re(this,"_lastValidArea",null),Re(this,"_minX",void 0),Re(this,"_maxX",void 0),Re(this,"_minY",void 0),Re(this,"_maxY",void 0),Re(this,"_width",void 0),Re(this,"_height",void 0),Re(this,"_sided",void 0),Re(this,"element",void 0),Re(this,"childElementContainer",void 0),Re(this,"_proxyTab",void 0),this._dragListener=n,this._layoutManager=i,this._contentItem=a,this._originalParent=s,this._dragListener.on("drag",this._onDrag,this),this._dragListener.on("dragStop",this._onDrop,this),this._contentItem.tab&&this._contentItem.tab.element){var b,g;this._layoutManager.tabDropPlaceholder.width((b=this._contentItem.tab.element.outerWidth(!0))!==null&&b!==void 0?b:0),this._layoutManager.tabDropPlaceholder.height((g=this._contentItem.tab.element.outerHeight(!0))!==null&&g!==void 0?g:0)}if(this.element=Z(zn._template),s&&s._side&&(this._sided=s._sided,this.element.addClass("lm_"+s._side),["right","bottom"].indexOf(s._side.toString())>=0&&this.element.find(".lm_content").after(this.element.find(".lm_header"))),this.element.css({left:e,top:t}),this._proxyTab=this.element.find(".lm_tab"),this._proxyTab.attr("title",pl((o=this._contentItem.config.title)!==null&&o!==void 0?o:"")),this.element.find(".lm_title").html((l=this._contentItem.config.title)!==null&&l!==void 0?l:""),this.childElementContainer=this.element.find(".lm_content"),this.childElementContainer.append(a.element),this._updateTree(),this._layoutManager._$calculateItemAreas(),Z(document.body).append(this.element),this._setDimensions(),!this._contentItem.tab&&this._proxyTab.length){var C,y;this._layoutManager.tabDropPlaceholder.width((C=this._proxyTab.outerWidth(!0))!==null&&C!==void 0?C:0),this._layoutManager.tabDropPlaceholder.height((y=this._proxyTab.outerHeight(!0))!==null&&y!==void 0?y:0)}var S=this._layoutManager.container.offset();this._minX=(d=S==null?void 0:S.left)!==null&&d!==void 0?d:0,this._minY=(h=S==null?void 0:S.top)!==null&&h!==void 0?h:0,this._maxX=((c=this._layoutManager.container.width())!==null&&c!==void 0?c:0)+this._minX,this._maxY=((f=this._layoutManager.container.height())!==null&&f!==void 0?f:0)+this._minY,this._width=(p=this.element.width())!==null&&p!==void 0?p:0,this._height=(m=this.element.height())!==null&&m!==void 0?m:0,this._setDropPosition(e,t),this._layoutManager.emit("itemPickedUp",this._contentItem)}_onDrag(e,t,n){var i,a,s=(i=n.pageX)!==null&&i!==void 0?i:0,o=(a=n.pageY)!==null&&a!==void 0?a:0,l=s>this._minX&&s<this._maxX&&o>this._minY&&o<this._maxY;!l&&this._layoutManager.config.settings.constrainDragToContainer===!0||this._setDropPosition(s,o)}_setDropPosition(e,t){this.element.css({left:e,top:t}),this._area=this._layoutManager._$getArea(e,t),this._area!==null&&(this._lastValidArea=this._area,this._area.contentItem._$highlightDropZone(e,t,this._area))}_onDrop(){var e;(e=this._layoutManager.dropTargetIndicator)===null||e===void 0||e.hide(),this._area!==null?this._area.contentItem._$onDrop(this._contentItem,this._area):this._lastValidArea!==null?this._lastValidArea.contentItem._$onDrop(this._contentItem,this._lastValidArea):this._originalParent?this._originalParent.addChild(this._contentItem):this._contentItem._$destroy(),this._dragListener.off("drag",this._onDrag,this),this._dragListener.off("dragStop",this._onDrop,this),this.element.remove(),this._layoutManager.emit("itemDropped",this._contentItem)}_updateTree(){this._contentItem.parent&&this._contentItem.parent.removeChild(this._contentItem,!0),this._contentItem._$setParent(null)}_setDimensions(){var e=this._layoutManager.config.dimensions,t=e.dragProxyWidth,n=e.dragProxyHeight;this.element.width(t),this.element.height(n),t-=this._sided?e.headerHeight:0,n-=this._sided?0:e.headerHeight,this.childElementContainer.width(t),this.childElementContainer.height(n),this._contentItem.element.width(t),this._contentItem.element.height(n),this._contentItem.callDownwards("_$show"),this._contentItem.callDownwards("setSize")}}Re(zn,"_template",'<div class="lm_dragProxy"><div class="lm_header"><ul class="lm_tabs"><li class="lm_tab lm_active"><i class="lm_left"></i><span class="lm_title"></span><i class="lm_right"></i></li></ul></div><div class="lm_content"></div></div>');function Wi(r,e,t){return e=fP(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function fP(r){var e=pP(r,"string");return typeof e=="symbol"?e:String(e)}function pP(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class If{constructor(e,t,n){Wi(this,"_element",void 0),Wi(this,"_itemConfig",void 0),Wi(this,"_layoutManager",void 0),Wi(this,"_dragListener",void 0),this._element=e,this._itemConfig=t,this._layoutManager=n,this._dragListener=this._createDragListener()}_createDragListener(){return this._dragListener=new Oi(this._element,!0),this._dragListener.on("dragStart",this._onDragStart,this),this._dragListener.on("dragStop",this._createDragListener,this),this._dragListener}_onDragStart(e,t){var n=this._itemConfig;typeof n=="function"&&(n=n());var i=this._layoutManager._$normalizeContentItem(Z.extend(!0,{},n));new zn(e,t,this._dragListener,this._layoutManager,i,null)}}function Gi(r,e,t){return e=mP(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function mP(r){var e=gP(r,"string");return typeof e=="symbol"?e:String(e)}function gP(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class Nf{constructor(e,t,n){Gi(this,"_element",Z(window)),Gi(this,"_itemConfig",void 0),Gi(this,"_layoutManager",void 0),Gi(this,"_dragListener",void 0),this._itemConfig=e,this._layoutManager=t,this._createDragListener(n)}_createDragListener(e){this._dragListener&&this._dragListener.destroy(),this._element&&(this._dragListener=new Oi(this._element,!0),this._dragListener.on("dragStart",this._onDragStart,this),this._dragListener.on("dragStop",this._destroy,this),this._dragListener.onMouseDown(e),this._dragListener._startDrag())}_destroy(){this._dragListener=void 0,this._element=void 0,this._itemConfig=void 0,this._layoutManager=void 0}_onDragStart(e,t){if(!(!this._dragListener||!this._layoutManager)){var n=this._itemConfig;typeof n=="function"&&(n=n());var i=this._layoutManager._$normalizeContentItem(Z.extend(!0,{},n));new zn(e,t,this._dragListener,this._layoutManager,i,null)}}}function Mf(r,e,t){return e=bP(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function bP(r){var e=CP(r,"string");return typeof e=="symbol"?e:String(e)}function CP(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class Di{constructor(){Mf(this,"element",Z(Di._template)),Z(document.body).append(this.element)}destroy(){this.element.remove()}highlightArea(e){this.element.css({left:e.x1,top:e.y1,width:Math.floor(e.x2-e.x1),height:Math.floor(e.y2-e.y1)}).show()}hide(){this.element.hide()}}Mf(Di,"_template",'<div class="lm_dropTargetIndicator"><div class="lm_inner"></div></div>');function Os(r,e,t){return e=SP(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function SP(r){var e=yP(r,"string");return typeof e=="symbol"?e:String(e)}function yP(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class Qr{constructor(e,t,n,i){Os(this,"element",void 0),Os(this,"_header",void 0),Os(this,"_action",void 0),this._header=e,this.element=Z('<li class="'+n+'" title="'+t+'"></li>'),this._header.on("destroy",this._$destroy,this),this._action=i,this.element.on("click",this._action),this._header.controlsContainer.append(this.element)}_$destroy(){this.element.off(),this.element.remove()}}function EP(r,e,t){return e=wP(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function wP(r){var e=PP(r,"string");return typeof e=="symbol"?e:String(e)}function PP(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class _P extends Error{constructor(e,t){super(),EP(this,"node",void 0),this.name="Configuration Error",this.message=e,this.node=t}}const jn=_P,TP=Object.freeze(Object.defineProperty({__proto__:null,ConfigurationError:jn},Symbol.toStringTag,{value:"Module"}));function Ne(r,e,t){return e=OP(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function OP(r){var e=DP(r,"string");return typeof e=="symbol"?e:String(e)}function DP(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}function ci(r){return r.isStack}function ht(r){return r.isComponent}function Lf(r){return r.isRoot}class $e extends Ft{constructor(e,t,n,i){super(),Ne(this,"config",void 0),Ne(this,"type",void 0),Ne(this,"contentItems",void 0),Ne(this,"parent",void 0),Ne(this,"layoutManager",void 0),Ne(this,"element",void 0),Ne(this,"childElementContainer",void 0),Ne(this,"componentName",void 0),Ne(this,"isInitialised",!1),Ne(this,"isMaximised",!1),Ne(this,"isRoot",!1),Ne(this,"isRow",!1),Ne(this,"isColumn",!1),Ne(this,"isStack",!1),Ne(this,"isComponent",!1),Ne(this,"tab",void 0),Ne(this,"_pendingEventPropagations",void 0),Ne(this,"_throttledEvents",void 0),this.element=i,this.config=this._extendItemNode(t),this.type=t.type,this.contentItems=[],this.parent=n,this.layoutManager=e,this._pendingEventPropagations={},this._throttledEvents=["stateChanged"],this.on(Ft.ALL_EVENT,this._propagateEvent,this),t.content&&this._createContentItems(t)}callDownwards(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;n!==!0&&i!==!0&&this[e].apply(this,t);for(var a=0;a<this.contentItems.length;a++)this.contentItems[a].callDownwards(e,t,n);n===!0&&i!==!0&&this[e].apply(this,t)}removeChild(e){var t,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,i=this.contentItems.indexOf(e);if(i===-1)throw new Error("Can't remove child item. Unknown content item");if(n!==!0&&this.contentItems[i]._$destroy(),this.contentItems.splice(i,1),(t=this.config.content)===null||t===void 0||t.splice(i,1),this.contentItems.length>0)this.callDownwards("setSize");else if(this.type!=="root"&&this.config.isClosable){var a;(a=this.parent)===null||a===void 0||a.removeChild(this)}}addChild(e,t){e=this.layoutManager._$normalizeContentItem(e,this),t===void 0&&(t=this.contentItems.length),this.contentItems.splice(t,0,e),this.config.content===void 0&&(this.config.content=[]),this.config.content.splice(t,0,e.config),e.parent=this,e.parent.isInitialised===!0&&e.isInitialised===!1&&e._$init()}replaceChild(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;t=this.layoutManager._$normalizeContentItem(t);var i=this.contentItems.indexOf(e),a=e.element[0].parentNode;if(i===-1)throw new Error("Can't replace child. oldChild is not child of this");a==null||a.replaceChild(t.element[0],e.element[0]),n===!0&&(e.parent=null,e._$destroy()),this.contentItems[i]=t,t.parent=this,ci(this)&&(this.header.tabs[i].contentItem=t),t.parent.isInitialised===!0&&t.isInitialised===!1&&t._$init(),this.callDownwards("setSize")}remove(){var e;(e=this.parent)===null||e===void 0||e.removeChild(this)}popout(){var e=this.layoutManager.createPopout(this);return this.emitBubblingEvent("stateChanged"),e}toggleMaximise(e){e&&e.preventDefault(),this.isMaximised===!0?this.layoutManager._$minimiseItem(this):this.layoutManager._$maximiseItem(this),this.isMaximised=!this.isMaximised,this.emitBubblingEvent("stateChanged")}select(){this.layoutManager.selectedItem!==this&&(this.layoutManager.selectItem(this,!0),this.element.addClass("lm_selected"))}deselect(){this.layoutManager.selectedItem===this&&(this.layoutManager.selectedItem=null,this.element.removeClass("lm_selected"))}setTitle(e){this.config.title=e,this.emit("titleChanged",e),this.emitBubblingEvent("stateChanged")}hasId(e){if(this.config.id){if(typeof this.config.id=="string")return this.config.id===e;if(this.config.id instanceof Array)return this.config.id.indexOf(e)!==-1}else return!1}addId(e){this.hasId(e)||(this.config.id?typeof this.config.id=="string"?this.config.id=[this.config.id,e]:this.config.id instanceof Array&&this.config.id.push(e):this.config.id=e)}removeId(e){if(!this.hasId(e))throw new Error("Id not found");if(typeof this.config.id=="string")delete this.config.id;else if(this.config.id instanceof Array){var t=this.config.id.indexOf(e);this.config.id.splice(t,1)}}getItemsByFilter(e){var t=[],n=function i(a){for(var s=0;s<a.contentItems.length;s++)e(a.contentItems[s])===!0&&t.push(a.contentItems[s]),i(a.contentItems[s])};return n(this),t}getItemsById(e){return this.getItemsByFilter(function(t){return t.config.id instanceof Array?t.config.id.indexOf(e)!==-1:t.config.id===e})}getItemsByType(e){return this._$getItemsByProperty("type",e)}getComponentsByName(e){for(var t=this._$getItemsByProperty("componentName",e),n=[],i=0;i<t.length;i++)n.push(t[i].instance);return n}_$getItemsByProperty(e,t){return this.getItemsByFilter(function(n){return n[e]===t})}_$setParent(e){this.parent=e}_$highlightDropZone(e,t,n){var i;(i=this.layoutManager.dropTargetIndicator)===null||i===void 0||i.highlightArea(n)}_$onDrop(e,t){this.addChild(e)}_$hide(){this._callOnActiveComponents("hide"),this.element.hide(),this.layoutManager.updateSize()}_$show(){this._callOnActiveComponents("show"),this.element.show(),this.layoutManager.updateSize()}_callOnActiveComponents(e){for(var t=this.getItemsByType("stack"),n=null,i=0;i<t.length;i++)n=t[i].getActiveContentItem(),n&&ht(n)&&n.container[e]()}_$destroy(){this.emitBubblingEvent("beforeItemDestroyed"),this.callDownwards("_$destroy",[],!0,!0),this.element.remove(),this.emitBubblingEvent("itemDestroyed")}_$getArea(e){var t,n,i;e=e||this.element;var a=(t=e.offset())!==null&&t!==void 0?t:{left:0,top:0},s=(n=e.width())!==null&&n!==void 0?n:0,o=(i=e.height())!==null&&i!==void 0?i:0;return{x1:a.left,y1:a.top,x2:a.left+s,y2:a.top+o,surface:s*o,contentItem:this,side:""}}_$init(){this.setSize();for(var e=0;e<this.contentItems.length;e++){var t;(t=this.childElementContainer)===null||t===void 0||t.append(this.contentItems[e].element)}this.isInitialised=!0,this.emitBubblingEvent("itemCreated"),this.emitBubblingEvent(this.type+"Created")}emitBubblingEvent(e){var t=new oo(e,this);this.emit(e,t)}_createContentItems(e){var t;if(!(e.content instanceof Array))throw new jn("content must be an Array",e);for(var n=0;n<e.content.length;n++)t=this.layoutManager.createContentItem(e.content[n],this),this.contentItems.push(t)}_extendItemNode(e){for(var[t,n]of Object.entries(Pf)){var i=t;e[i]===void 0&&(e[i]=n)}return e}_propagateEvent(e,t){t instanceof oo&&t.isPropagationStopped===!1&&this.isInitialised===!0&&(this.isRoot===!1&&this.parent?this.parent.emit.apply(this.parent,[e,t]):this._scheduleEventPropagationToLayoutManager(e,t))}_scheduleEventPropagationToLayoutManager(e,t){this._throttledEvents.indexOf(e)===-1?this.layoutManager.emit(e,t.origin):this._pendingEventPropagations[e]!==!0&&(this._pendingEventPropagations[e]=!0,vl(this._propagateEventToLayoutManager.bind(this,e,t)))}_propagateEventToLayoutManager(e,t){this._pendingEventPropagations[e]=!1,this.layoutManager.emit(e,t)}}function Wr(r,e,t){return e=xP(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function xP(r){var e=IP(r,"string");return typeof e=="symbol"?e:String(e)}function IP(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class Ff extends $e{constructor(e,t,n){super(e,t,n,Z()),Wr(this,"config",void 0),Wr(this,"componentName",void 0),Wr(this,"container",void 0),Wr(this,"parent",void 0),Wr(this,"instance",void 0),this.config=t,this.parent=n;var i=e.getComponent(this.config.componentName)||e.getFallbackComponent(),a=Z.extend(!0,{},this.config.componentState||{});if(i==null)throw new jn('Unknown component "'+this.config.componentName+'"');a.componentName=this.config.componentName,this.componentName=this.config.componentName,this.config.title===""&&(this.config.title=this.config.componentName),this.isComponent=!0,this.container=new ao(this.config,this,e),this.instance=new i(this.container,a),this.element=this.container._element}close(){this.parent.removeChild(this)}setSize(){this.element.is(":visible")&&this.container._$setSize(this.element.width(),this.element.height())}_$init(){$e.prototype._$init.call(this),this.container.emit("open")}_$hide(){this.container.hide(),$e.prototype._$hide.call(this)}_$show(){this.container.show(),this.container._config.isFocusOnShow&&this.container._contentElement[0].focus({preventScroll:!0}),$e.prototype._$show.call(this)}_$destroy(){this.container.emit("destroy",this),$e.prototype._$destroy.call(this)}_$getArea(){return null}}function gt(r,e,t){return e=NP(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function NP(r){var e=MP(r,"string");return typeof e=="symbol"?e:String(e)}function MP(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class Sa extends $e{constructor(e,t,n,i){super(t,n,i,Z('<div class="lm_item lm_'+(e?"column":"row")+'"></div>')),gt(this,"isRow",void 0),gt(this,"isColumn",void 0),gt(this,"childElementContainer",void 0),gt(this,"parent",void 0),gt(this,"_splitter",[]),gt(this,"_splitterSize",void 0),gt(this,"_splitterGrabSize",void 0),gt(this,"_isColumn",void 0),gt(this,"_dimension",void 0),gt(this,"_splitterPosition",null),gt(this,"_splitterMinPosition",null),gt(this,"_splitterMaxPosition",null),this.parent=i,this.isRow=!e,this.isColumn=e,this.childElementContainer=this.element,this._splitterSize=t.config.dimensions.borderWidth,this._splitterGrabSize=t.config.dimensions.borderGrabWidth,this._isColumn=e,this._dimension=e?"height":"width",this._splitterPosition=null,this._splitterMinPosition=null,this._splitterMaxPosition=null}addChild(e,t,n){var i,a,s,o;if(e=this.layoutManager._$normalizeContentItem(e,this),t===void 0&&(t=this.contentItems.length),this.contentItems.length>0?(o=this._createSplitter(Math.max(0,t-1)).element,t>0?(this.contentItems[t-1].element.after(o),o.after(e.element)):(this.contentItems[0].element.before(o),o.before(e.element))):this.childElementContainer.append(e.element),$e.prototype.addChild.call(this,e,t),i=1/this.contentItems.length*100,n===!0){this.emitBubblingEvent("stateChanged");return}for(s=0;s<this.contentItems.length;s++)if(this.contentItems[s]===e)e.config[this._dimension]=i;else{var l;a=((l=this.contentItems[s].config[this._dimension])!==null&&l!==void 0?l:0)*(100-i)/100,this.contentItems[s].config[this._dimension]=a}this.callDownwards("setSize"),this.emitBubblingEvent("stateChanged")}removeChild(e,t){var n,i=(n=e.config[this._dimension])!==null&&n!==void 0?n:0,a=this.contentItems.indexOf(e),s=Math.max(a-1,0),o,l;if(a===-1)throw new Error("Can't remove child. ContentItem is not child of this Row or Column");for(this._splitter[s]&&(this._splitter[s]._$destroy(),this._splitter.splice(s,1)),o=0;o<this.contentItems.length;o++)if(this.contentItems[o]!==e){var d;this.contentItems[o].config[this._dimension]=((d=this.contentItems[o].config[this._dimension])!==null&&d!==void 0?d:0)+i/(this.contentItems.length-1)}$e.prototype.removeChild.call(this,e,t),this.contentItems.length===1&&this.config.isClosable===!0?(l=this.contentItems[0],this.contentItems=[],this.parent.replaceChild(this,l,!0)):(this.callDownwards("setSize"),this.emitBubblingEvent("stateChanged"))}replaceChild(e,t){var n=e.config[this._dimension];super.replaceChild(e,t),t.config[this._dimension]=n,this.callDownwards("setSize"),this.emitBubblingEvent("stateChanged")}setSize(){this.contentItems.length>0&&(this._calculateRelativeSizes(),this._setAbsoluteSizes()),this.emitBubblingEvent("stateChanged"),this.emit("resize")}_$init(){if(this.isInitialised!==!0){var e;for($e.prototype._$init.call(this),e=0;e<this.contentItems.length-1;e++)this.contentItems[e].element.after(this._createSplitter(e).element)}}_setAbsoluteSizes(){var e,t=this._calculateAbsoluteSizes();for(e=0;e<this.contentItems.length;e++)t.additionalPixel-e>0&&t.itemSizes[e]++,this._isColumn?(this.contentItems[e].element.width(t.totalWidth),this.contentItems[e].element.height(t.itemSizes[e])):(this.contentItems[e].element.width(t.itemSizes[e]),this.contentItems[e].element.height(t.totalHeight))}_calculateAbsoluteSizes(){var e,t,n=(this.contentItems.length-1)*this._splitterSize,i=(e=this.element.width())!==null&&e!==void 0?e:0,a=(t=this.element.height())!==null&&t!==void 0?t:0,s=0,o=[];this._isColumn?a-=n:i-=n;for(var l=0;l<this.contentItems.length;l++){var d,h,c=this._isColumn?Math.floor(a*(((d=this.contentItems[l].config.height)!==null&&d!==void 0?d:0)/100)):Math.floor(i*(((h=this.contentItems[l].config.width)!==null&&h!==void 0?h:0)/100));s+=c,o.push(c)}var f=Math.floor((this._isColumn?a:i)-s);return{itemSizes:o,additionalPixel:f,totalWidth:i,totalHeight:a}}_calculateRelativeSizes(){for(var e=0,t=[],n=this._isColumn?"height":"width",i=0;i<this.contentItems.length;i++){var a=this.contentItems[i].config[n];a!=null?e+=a:t.push(this.contentItems[i])}if(Math.round(e)===100){this._respectMinItemWidth();return}if(Math.round(e)<100&&t.length>0){for(var s=0;s<t.length;s++)t[s].config[n]=(100-e)/t.length;this._respectMinItemWidth();return}if(Math.round(e)>100)for(var o=0;o<t.length;o++)t[o].config[n]=50,e+=50;for(var l=0;l<this.contentItems.length;l++){var d;this.contentItems[l].config[n]=((d=this.contentItems[l].config[n])!==null&&d!==void 0?d:0)/e*100}this._respectMinItemWidth()}_respectMinItemWidth(){var e,t=this.layoutManager.config.dimensions&&(e=this.layoutManager.config.dimensions.minItemWidth)!==null&&e!==void 0?e:0,n=[],i=0,a=0,s=0,o=[],l;if(!(this._isColumn||!t||this.contentItems.length<=1)){for(var d=this._calculateAbsoluteSizes(),h=0;h<this.contentItems.length;h++){this.contentItems[h];var c=d.itemSizes[h];c<t?(a+=t-c,l={width:t}):(i+=c-t,l={width:c},n.push(l)),o.push(l)}if(!(a===0||a>i)){var f=a/i;s=a;for(var p=0;p<n.length;p++){l=n[p];var m=Math.round((l.width-t)*f);s-=m,l.width-=m}s!==0&&(o[o.length-1].width-=s);for(var b=0;b<this.contentItems.length;b++)this.contentItems[b].config.width=o[b].width/d.totalWidth*100}}}_createSplitter(e){var t;return t=new Af(this._isColumn,this._splitterSize,this._splitterGrabSize),t.on("drag",this._onSplitterDrag.bind(this,t),this),t.on("dragStop",this._onSplitterDragStop.bind(this,t),this),t.on("dragStart",this._onSplitterDragStart.bind(this,t),this),this._splitter.splice(e,0,t),t}_getItemsForSplitter(e){var t=this._splitter.indexOf(e);if(t<0)throw new Error("Splitter not found in RowOrColumn");return{before:this.contentItems[t],after:this.contentItems[t+1]}}_getMinimumDimensions(e){for(var t=0,n=0,i=0;i<e.length;++i){var a,s;t=Math.max((a=e[i].minWidth)!==null&&a!==void 0?a:0,t),n=Math.max((s=e[i].minHeight)!==null&&s!==void 0?s:0,n)}return{horizontal:t,vertical:n}}_onSplitterDragStart(e){var t,n,i,a,s=this._getItemsForSplitter(e),o=this.layoutManager.config.dimensions[this._isColumn?"minItemHeight":"minItemWidth"],l=this._getMinimumDimensions((t=s.before.config.content)!==null&&t!==void 0?t:[]),d=this._isColumn?l.vertical:l.horizontal,h=this._getMinimumDimensions((n=s.after.config.content)!==null&&n!==void 0?n:[]),c=this._isColumn?h.vertical:h.horizontal;this._splitterPosition=0,this._splitterMinPosition=-1*(((i=s.before.element[this._dimension]())!==null&&i!==void 0?i:0)-(d||o)),this._splitterMaxPosition=((a=s.after.element[this._dimension]())!==null&&a!==void 0?a:0)-(c||o)}_onSplitterDrag(e,t,n){var i=this._isColumn?n:t;this._splitterMaxPosition==null||this._splitterMinPosition==null||i>this._splitterMinPosition&&i<this._splitterMaxPosition&&(this._splitterPosition=i,e.element.css(this._isColumn?"top":"left",i))}_onSplitterDragStop(e){var t,n,i,a,s,o=this._getItemsForSplitter(e),l=(t=o.before.element[this._dimension]())!==null&&t!==void 0?t:0,d=(n=o.after.element[this._dimension]())!==null&&n!==void 0?n:0,h=(((i=this._splitterPosition)!==null&&i!==void 0?i:0)+l)/(l+d),c=((a=o.before.config[this._dimension])!==null&&a!==void 0?a:0)+((s=o.after.config[this._dimension])!==null&&s!==void 0?s:0);o.before.config[this._dimension]=h*c,o.after.config[this._dimension]=(1-h)*c,e.element.css({top:0,left:0}),vl(this.callDownwards.bind(this,"setSize",void 0,void 0,void 0))}}function eu(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,n)}return t}function tu(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?eu(Object(t),!0).forEach(function(n){lo(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):eu(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function lo(r,e,t){return e=LP(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function LP(r){var e=FP(r,"string");return typeof e=="symbol"?e:String(e)}function FP(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class uo extends $e{constructor(e,t,n){super(e,tu(tu({},t),{},{type:"root"}),null,Z('<div class="lm_goldenlayout lm_item lm_root"></div>')),lo(this,"childElementContainer",void 0),lo(this,"_containerElement",void 0),this.isRoot=!0,this.type="root",this.childElementContainer=this.element,this._containerElement=n,this._containerElement.append(this.element)}addChild(e,t){if(this.contentItems.length>0)throw new Error("Root node can only have a single child");e=this.layoutManager._$normalizeContentItem(e,this),this.childElementContainer.append(e.element),super.addChild(e,t),this.callDownwards("setSize"),this.emitBubblingEvent("stateChanged")}setSize(e,t){var n,i;e=typeof e>"u"?(n=this._containerElement.width())!==null&&n!==void 0?n:0:e,t=typeof t>"u"?(i=this._containerElement.height())!==null&&i!==void 0?i:0:t,this.element.width(e),this.element.height(t),this.contentItems[0]&&(this.contentItems[0].element.width(e),this.contentItems[0].element.height(t))}_$getArea(){var e=super._$getArea();if(e==null)throw new Error("Unable to get root area");return e}_$highlightDropZone(e,t,n){this.layoutManager.tabDropPlaceholder.remove(),super._$highlightDropZone(e,t,n)}_$onDrop(e,t){var n;if(ht(e)&&(n=this.layoutManager.createContentItem({type:"stack",header:e.config.header||{}},this),n._$init(),n.addChild(e),e=n),!this.contentItems.length)this.addChild(e);else{var{side:i}=t,a=i==="left"||i==="right"?"row":"column",s=i==="left"||i==="right"?"width":"height",o=i==="left"||i==="top",l=this.contentItems[0];if(!(l instanceof Sa)||l.type!=a){var d=this.layoutManager.createContentItem({type:a},this);this.replaceChild(l,d),d.addChild(e,o?0:void 0,!0),d.addChild(l,o?void 0:0,!0),l.config[s]=50,e.config[s]=50,d.callDownwards("setSize")}else{var h,c=l.contentItems[o?0:l.contentItems.length-1];l.addChild(e,o?0:void 0,!0),c.config[s]=((h=c.config[s])!==null&&h!==void 0?h:0)*.5,e.config[s]=c.config[s],l.callDownwards("setSize")}}}}function nu(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,n)}return t}function tr(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?nu(Object(t),!0).forEach(function(n){st(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):nu(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function st(r,e,t){return e=AP(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function AP(r){var e=RP(r,"string");return typeof e=="symbol"?e:String(e)}function RP(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class ho extends $e{constructor(e,t,n){var i,a,s,o,l,d,h,c,f;super(e,t,n,Z('<div class="lm_item lm_stack"></div>')),st(this,"_activeContentItem",null),st(this,"_header",void 0),st(this,"childElementContainer",Z('<div class="lm_items"></div>')),st(this,"header",void 0),st(this,"parent",void 0),st(this,"isStack",!0),st(this,"_dropZones",{}),st(this,"_dropSegment",null),st(this,"_contentAreaDimensions",null),st(this,"_dropIndex",void 0),st(this,"_side",void 0),st(this,"_sided",!1),st(this,"config",void 0),this.parent=n,this.config=t;var p=e.config;this._side=!1,this._header={show:((i=p.settings)===null||i===void 0?void 0:i.hasHeaders)&&t.hasHeaders!==!1,popout:(a=p.settings)!==null&&a!==void 0&&a.showPopoutIcon?(s=p.labels)===null||s===void 0?void 0:s.popout:void 0,maximise:(o=p.settings)!==null&&o!==void 0&&o.showMaximiseIcon?(l=p.labels)===null||l===void 0?void 0:l.maximise:void 0,close:(d=p.settings)!==null&&d!==void 0&&d.showCloseIcon?(h=p.labels)===null||h===void 0?void 0:h.close:void 0,minimise:(c=(f=p.labels)===null||f===void 0?void 0:f.minimise)!==null&&c!==void 0?c:void 0},p.header&&(this._header=tr(tr({},this._header),p.header)),t.header&&(this._header=tr(tr({},this._header),t.header)),t.content&&t.content[0]&&t.content[0].header&&(this._header=tr(tr({},this._header),t.content[0].header)),this.header=new en(e,this),this.element.append(this.header.element),this.element.append(this.childElementContainer),this._setupHeaderPosition(),this._$validateClosability()}setSize(){var e,t,n,i,a,s=this._header.show&&(e=(t=this.layoutManager.config.dimensions)===null||t===void 0?void 0:t.headerHeight)!==null&&e!==void 0?e:0,o=((n=this.element.width())!==null&&n!==void 0?n:0)-(this._sided?s:0),l=((i=this.element.height())!==null&&i!==void 0?i:0)-(this._sided?0:s);for(this.childElementContainer.width(o),this.childElementContainer.height(l),a=0;a<this.contentItems.length;a++)this.contentItems[a].element.width(o).height(l);this.emit("resize"),this.emitBubblingEvent("stateChanged")}_$init(){if(this.isInitialised!==!0){this.header._attachWheelListener(),super._$init();for(var e=0;e<this.contentItems.length;e++)this.header.createTab(this.contentItems[e]),this.contentItems[e]._$hide();if(this.contentItems.length>0){var t=this.contentItems[this.config.activeItemIndex||0];if(!t)throw new Error("Configured activeItemIndex out of bounds");this.setActiveContentItem(t)}}}setActiveContentItem(e){if(this.contentItems.indexOf(e)===-1)throw new Error("contentItem is not a child of this stack");this._activeContentItem!==null&&this._activeContentItem._$hide(),this._activeContentItem=e,this.header.setActiveContentItem(e),e._$show(),this.emit("activeContentItemChanged",e),this.layoutManager.emit("activeContentItemChanged",e),this.emitBubblingEvent("stateChanged")}getActiveContentItem(){return this.header.activeContentItem}addChild(e,t){e=this.layoutManager._$normalizeContentItem(e,this),super.addChild(e,t),this.childElementContainer.append(e.element),this.header.createTab(e,t),this.setActiveContentItem(e),this.callDownwards("setSize"),this._$validateClosability(),this.emitBubblingEvent("stateChanged")}removeChild(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,n=this.contentItems.indexOf(e);super.removeChild(e,t),this.header.removeTab(e),this.header.activeContentItem===e&&(this.contentItems.length>0?this.setActiveContentItem(this.contentItems[Math.max(n-1,0)]):this._activeContentItem=null),this._$validateClosability(),this.emitBubblingEvent("stateChanged")}_$validateClosability(){for(var e=this.header._isClosable(),t=0,n=this.contentItems.length;t<n;t++){var i;if(!e)break;e=(i=this.contentItems[t].config.isClosable)!==null&&i!==void 0?i:!1}this.header._$setClosable(e)}_$destroy(){$e.prototype._$destroy.call(this),this.header._$destroy()}_$onDrop(e){if(this._dropSegment==="header"){this._resetHeaderDropZone(),this.addChild(e,this._dropIndex);return}if(this._dropSegment==="body"){this.addChild(e);return}var t=this._dropSegment==="top"||this._dropSegment==="bottom",n=this._dropSegment==="left"||this._dropSegment==="right",i=this._dropSegment==="top"||this._dropSegment==="left",a=t&&this.parent.isColumn||n&&this.parent.isRow,s=t?"column":"row",o=t?"height":"width";if(ht(e)){var l=this.layoutManager.createContentItem({type:"stack",header:e.config.header||{}},this);l._$init(),l.addChild(e),e=l}if(a){var d,h=this.parent.contentItems.indexOf(this);this.parent.addChild(e,i?h:h+1,!0),this.config[o]=((d=this.config[o])!==null&&d!==void 0?d:0)*.5,e.config[o]=this.config[o],this.parent.callDownwards("setSize")}else{var c=this.layoutManager.createContentItem({type:s},this);this.parent.replaceChild(this,c),c.addChild(e,i?0:void 0,!0),c.addChild(this,i?void 0:0,!0),this.config[o]=50,e.config[o]=50,c.callDownwards("setSize")}}_$highlightDropZone(e,t){if(this._contentAreaDimensions)for(var[n,i]of Object.entries(this._contentAreaDimensions)){var a=i.hoverArea;if(a.x1<e&&a.x2>e&&a.y1<t&&a.y2>t){n==="header"?(this._dropSegment="header",this._highlightHeaderDropZone(e)):(this._resetHeaderDropZone(),this._highlightBodyDropZone(n));return}}}_$getArea(){if(this.element.is(":visible")===!1)return null;var e=super._$getArea(this.header.element),t=super._$getArea(this.childElementContainer);if(e==null||t==null)return null;var n=t.x2-t.x1,i=t.y2-t.y1;return this._contentAreaDimensions={header:{hoverArea:{x1:e.x1,y1:e.y1,x2:e.x2,y2:e.y2},highlightArea:{x1:e.x1,y1:e.y1,x2:e.x2,y2:e.y2}}},this._activeContentItem&&this._activeContentItem.isComponent===!1?e:this.contentItems.length===0?(this._contentAreaDimensions.body={hoverArea:{x1:t.x1,y1:t.y1,x2:t.x2,y2:t.y2},highlightArea:{x1:t.x1,y1:t.y1,x2:t.x2,y2:t.y2}},super._$getArea(this.element)):(this._contentAreaDimensions.left={hoverArea:{x1:t.x1,y1:t.y1,x2:t.x1+n*.25,y2:t.y2},highlightArea:{x1:t.x1,y1:t.y1,x2:t.x1+n*.5,y2:t.y2}},this._contentAreaDimensions.top={hoverArea:{x1:t.x1+n*.25,y1:t.y1,x2:t.x1+n*.75,y2:t.y1+i*.5},highlightArea:{x1:t.x1,y1:t.y1,x2:t.x2,y2:t.y1+i*.5}},this._contentAreaDimensions.right={hoverArea:{x1:t.x1+n*.75,y1:t.y1,x2:t.x2,y2:t.y2},highlightArea:{x1:t.x1+n*.5,y1:t.y1,x2:t.x2,y2:t.y2}},this._contentAreaDimensions.bottom={hoverArea:{x1:t.x1+n*.25,y1:t.y1+i*.5,x2:t.x1+n*.75,y2:t.y2},highlightArea:{x1:t.x1,y1:t.y1+i*.5,x2:t.x2,y2:t.y2}},super._$getArea(this.element))}_highlightHeaderDropZone(e){var t,n,i,a,s,o,l,d,h,c,f,p,m,b,g,C,y=this.header.tabs.length;if(y===0){var S,w,E,x,D,T,I,j,W=this.header.element.offset();(S=this.layoutManager.dropTargetIndicator)===null||S===void 0||S.highlightArea({x1:(w=W==null?void 0:W.left)!==null&&w!==void 0?w:0,x2:((E=W==null?void 0:W.left)!==null&&E!==void 0?E:0)+100,y1:(x=(D=this.header.element.offset())===null||D===void 0?void 0:D.top)!==null&&x!==void 0?x:0,y2:((T=(I=this.header.element.offset())===null||I===void 0?void 0:I.top)!==null&&T!==void 0?T:0)+((j=this.header.element.innerHeight())!==null&&j!==void 0?j:0)});return}var L=this.header.tabsContainer,O=(t=L.get(0))===null||t===void 0?void 0:t.getBoundingClientRect(),M=(n=this.layoutManager.tabDropPlaceholder.get(0))===null||n===void 0?void 0:n.getBoundingClientRect();if(!(!O||!M)){e<O.left?e=O.left+1:e>O.right&&(e=O.right-1);var A,k;if(!(M.left<e&&e<M.right)){for(var H=0;H<y;H++){var q;if(A=this.header.tabs[H].element,k=(q=A.get(0))===null||q===void 0?void 0:q.getBoundingClientRect(),k&&k.left<e&&e<k.right){this._dropIndex=H;break}}if(A&&k&&e<k.left+k.width*.5)A.before(this.layoutManager.tabDropPlaceholder);else if(A){var re;this._dropIndex=Math.min(((re=this._dropIndex)!==null&&re!==void 0?re:0)+1,y),A.after(this.layoutManager.tabDropPlaceholder)}}var V=(i=(a=this.layoutManager.tabDropPlaceholder.offset())===null||a===void 0?void 0:a.left)!==null&&i!==void 0?i:0;V=Math.max(V,(s=(o=this.header.tabsContainer.offset())===null||o===void 0?void 0:o.left)!==null&&s!==void 0?s:0);var N=V+((l=this.layoutManager.tabDropPlaceholder.width())!==null&&l!==void 0?l:0);N=Math.min(N,((d=(h=this.header.tabsContainer.offset())===null||h===void 0?void 0:h.left)!==null&&d!==void 0?d:0)+((c=this.header.tabsContainer.innerWidth())!==null&&c!==void 0?c:0)),(f=this.layoutManager.dropTargetIndicator)===null||f===void 0||f.highlightArea({x1:V,x2:N,y1:(p=(m=this.header.element.offset())===null||m===void 0?void 0:m.top)!==null&&p!==void 0?p:0,y2:((b=(g=this.header.element.offset())===null||g===void 0?void 0:g.top)!==null&&b!==void 0?b:0)+((C=this.header.element.innerHeight())!==null&&C!==void 0?C:0)})}}_resetHeaderDropZone(){this.layoutManager.tabDropPlaceholder.remove()}_setupHeaderPosition(){var e=["right","left","bottom"].some(n=>n===this._header.show)?this._header.show:void 0;if(this.header.element.toggle(!!this._header.show),!!e&&(this._side=e,this._sided=["right","left"].indexOf(this._side.toString())>=0,this.element.removeClass("lm_left lm_right lm_bottom"),this._side&&this.element.addClass("lm_"+this._side),this.element.find(".lm_header").length&&this.childElementContainer)){var t=["right","bottom"].indexOf(this._side.toString())>=0?"before":"after";this.header.element[t](this.childElementContainer),this.callDownwards("setSize")}}_highlightBodyDropZone(e){var t,n,i=(t=this._contentAreaDimensions)===null||t===void 0||(n=t[e])===null||n===void 0?void 0:n.highlightArea;if(i){var a;(a=this.layoutManager.dropTargetIndicator)===null||a===void 0||a.highlightArea(i)}this._dropSegment=e}}const jP=Object.freeze(Object.defineProperty({__proto__:null,AbstractContentItem:$e,Component:Ff,ContentItem:$e,Root:uo,RowOrColumn:Sa,Stack:ho,isComponent:ht,isRoot:Lf,isStack:ci},Symbol.toStringTag,{value:"Module"}));function Xt(r,e,t){return e=kP(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function kP(r){var e=$P(r,"string");return typeof e=="symbol"?e:String(e)}function $P(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class xi{constructor(e,t){var n;Xt(this,"header",void 0),Xt(this,"contentItem",void 0),Xt(this,"element",Z(xi._template)),Xt(this,"titleElement",void 0),Xt(this,"closeElement",void 0),Xt(this,"isActive",!1),Xt(this,"_layoutManager",void 0),Xt(this,"_dragListener",void 0),this.header=e,this.contentItem=t,this.titleElement=this.element.find(".lm_title"),this.closeElement=this.element.find(".lm_close_tab"),this.closeElement[t.config.isClosable?"show":"hide"](),this.setTitle(t.config.title),this.contentItem.on("titleChanged",this.setTitle,this),this._layoutManager=this.contentItem.layoutManager,(n=this._layoutManager.config.settings)!==null&&n!==void 0&&n.reorderEnabled&&t.config.reorderEnabled&&(this._dragListener=new Oi(this.element),this._dragListener.on("dragStart",this._onDragStart,this),this.contentItem.on("destroy",this._dragListener.destroy,this._dragListener)),this._onTabClick=this._onTabClick.bind(this),this._onCloseClick=this._onCloseClick.bind(this),this._onTabContentFocusIn=this._onTabContentFocusIn.bind(this),this._onTabContentFocusOut=this._onTabContentFocusOut.bind(this),this.element.on("click",this._onTabClick),this.element.on("auxclick",this._onTabClick),this.contentItem.config.isClosable?(this.closeElement.on("click",this._onCloseClick),this.closeElement.on("mousedown",this._onCloseMousedown)):this.closeElement.remove(),this.contentItem.tab=this,this.contentItem.emit("tab",this),this.contentItem.layoutManager.emit("tabCreated",this),ht(this.contentItem)&&(this.contentItem.container._contentElement.on("focusin",this._onTabContentFocusIn).on("focusout",this._onTabContentFocusOut),this.contentItem.container.tab=this,this.contentItem.container.emit("tab",this))}setTitle(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"";this.titleElement.html(e)}setActive(e){e!==this.isActive&&(this.isActive=e,e?this.element.addClass("lm_active"):this.element.removeClass("lm_active"))}_$destroy(){this.element.off("click",this._onTabClick),this.element.off("auxclick",this._onTabClick),this.closeElement.off("click",this._onCloseClick),ht(this.contentItem)&&(this.contentItem.container._contentElement.off(),this.contentItem.container._contentElement[0].removeEventListener("click",this._onTabContentFocusIn,!0)),this._dragListener&&(this.contentItem.off("destroy",this._dragListener.destroy,this._dragListener),this._dragListener.off("dragStart",this._onDragStart),this._dragListener=void 0),this.element.remove()}_onDragStart(e,t){var n;(n=this.contentItem.parent)!==null&&n!==void 0&&n.isMaximised&&this.contentItem.parent.toggleMaximise(),this._dragListener&&new zn(e,t,this._dragListener,this._layoutManager,this.contentItem,this.header.parent)}_onTabContentFocusIn(){Z(".lm_focusin",this._layoutManager.root.element).removeClass("lm_focusin"),this.element.addClass("lm_focusin")}_onTabContentFocusOut(){ht(this.contentItem)&&!this.contentItem.container._contentElement[0].contains(document.activeElement)&&this.element.removeClass("lm_focusin")}_onTabClick(e){if(!e||e.button===0){var t,n=this.header.parent.getActiveContentItem();this.contentItem!==n&&ht(this.contentItem)?this.header.parent.setActiveContentItem(this.contentItem):ht(this.contentItem)&&!this.contentItem.container._contentElement[0].contains(document.activeElement)&&this.contentItem.container._contentElement.focus(),ht(this.contentItem)&&this.contentItem.container.emit("tabClicked",e),this.header._hideAdditionalTabsDropdown(),(t=this.element.get(0))===null||t===void 0||t.scrollIntoView({inline:"nearest"})}else e.button===1&&this.contentItem.config.isClosable&&this._onCloseClick(e)}_onCloseClick(e){e.stopPropagation(),ht(this.contentItem)?this.contentItem.container.close():this.header.parent.removeChild(this.contentItem)}_onCloseMousedown(e){e.stopPropagation()}}Xt(xi,"_template",['<li class="lm_tab">','<span class="lm_title_before"></span>','<span class="lm_title"></span>','<div class="lm_close_tab" aria-label="Close tab"></div>',"</li>"].join(""));function le(r,e,t){return e=UP(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function UP(r){var e=HP(r,"string");return typeof e=="symbol"?e:String(e)}function HP(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class en extends Ft{constructor(e,t){var n,i;super(),le(this,"layoutManager",void 0),le(this,"element",Z(en._template)),le(this,"tabsContainer",void 0),le(this,"tabDropdownContainer",void 0),le(this,"tabDropdownSearch",void 0),le(this,"tabDropdownList",null),le(this,"controlsContainer",void 0),le(this,"parent",void 0),le(this,"tabs",[]),le(this,"activeContentItem",null),le(this,"closeButton",null),le(this,"tabDropdownButton",null),le(this,"tabNextButton",Z(en._nextButtonTemplate)),le(this,"tabPreviousButton",Z(en._previousButtonTemplate)),le(this,"holdTimer",null),le(this,"rAF",null),le(this,"CLICK_TIMEOUT",500),le(this,"START_SPEED",.01),le(this,"ACCELERATION",5e-4),le(this,"PADDING",10),le(this,"SCROLL_LEFT","left"),le(this,"SCROLL_RIGHT","right"),le(this,"isDraggingTab",!1),le(this,"isOverflowing",!1),le(this,"isDropdownShown",!1),le(this,"dropdownKeyIndex",0),le(this,"_lastVisibleTabIndex",-1),le(this,"_tabControlOffset",void 0),this.layoutManager=e,(n=this.layoutManager.config.settings)!==null&&n!==void 0&&n.selectionEnabled&&(this.element.addClass("lm_selectable"),this.element.on("click",this._onHeaderClick.bind(this))),this.tabsContainer=this.element.find(".lm_tabs"),this.tabDropdownContainer=this.element.find(".lm_tabdropdown_list"),this.tabDropdownContainer.hide(),this.tabDropdownSearch=this.element.find(".lm_tabdropdown_search input"),this._handleFilterInput=this._handleFilterInput.bind(this),this._handleFilterKeydown=this._handleFilterKeydown.bind(this),this.tabDropdownSearch.on("input",this._handleFilterInput),this.tabDropdownSearch.on("keydown",this._handleFilterKeydown),this.controlsContainer=this.element.find(".lm_controls"),this.parent=t,this.parent.on("resize",this._updateTabSizes,this),this._handleItemPickedUp=this._handleItemPickedUp.bind(this),this._handleItemDropped=this._handleItemDropped.bind(this),this._handleNextMouseEnter=this._handleNextMouseEnter.bind(this),this._handleNextMouseLeave=this._handleNextMouseLeave.bind(this),this._handlePreviousMouseEnter=this._handlePreviousMouseEnter.bind(this),this._handlePreviousMouseLeave=this._handlePreviousMouseLeave.bind(this),this._handleScrollRepeat=this._handleScrollRepeat.bind(this),this._handleNextButtonMouseDown=this._handleNextButtonMouseDown.bind(this),this._handlePreviousButtonMouseDown=this._handlePreviousButtonMouseDown.bind(this),this._handleScrollButtonMouseDown=this._handleScrollButtonMouseDown.bind(this),this._handleScrollButtonMouseUp=this._handleScrollButtonMouseUp.bind(this),this._handleScrollEvent=this._handleScrollEvent.bind(this),this.tabNextButton.on("mousedown",this._handleNextButtonMouseDown),this.tabPreviousButton.on("mousedown",this._handlePreviousButtonMouseDown),this.tabsContainer.on("scroll",this._handleScrollEvent),this.layoutManager.on("itemPickedUp",this._handleItemPickedUp),this.layoutManager.on("itemDropped",this._handleItemDropped),this.tabsContainer.before(this.tabPreviousButton),this.tabPreviousButton=this.tabPreviousButton.find(">:first-child"),this.tabPreviousButton.hide(),this._showAdditionalTabsDropdown=this._showAdditionalTabsDropdown.bind(this),this._hideAdditionalTabsDropdown=this._hideAdditionalTabsDropdown.bind(this),this._tabControlOffset=(i=this.layoutManager.config.settings)===null||i===void 0?void 0:i.tabControlOffset,this._createControls()}createTab(e,t){for(var n=0;n<this.tabs.length;n++)if(this.tabs[n].contentItem===e)return;var i=new xi(this,e);if(this.tabs.length===0){this.tabs.push(i),this.tabsContainer.append(i.element);return}t===void 0&&(t=this.tabs.length),t>0?this.tabs[t-1].element.after(i.element):this.tabs[0].element.before(i.element),this.tabs.splice(t,0,i),this._updateTabSizes()}removeTab(e){for(var t=0;t<this.tabs.length;t++)if(this.tabs[t].contentItem===e){this.tabs[t]._$destroy(),this.tabs.splice(t,1);return}throw new Error("contentItem is not controlled by this header")}setActiveContentItem(e){for(var t,n,i,a,s=0;s<this.tabs.length;s++)a=this.tabs[s].contentItem===e,this.tabs[s].setActive(a),a===!0&&(this.activeContentItem=e,this.parent.config.activeItemIndex=s);(t=this.tabs[(i=this.parent.config.activeItemIndex)!==null&&i!==void 0?i:0].element.get(0))===null||t===void 0||(n=t.scrollIntoView)===null||n===void 0||n.call(t,{inline:"nearest"}),this._hideAdditionalTabsDropdown(),this._updateTabSizes(),this.parent.emitBubblingEvent("stateChanged")}position(e){var t=this.parent._header.show;return t&&!this.parent._side&&(t="top"),e!==void 0&&this.parent._header.show!==e&&(this.parent._header.show=e,this.parent._setupHeaderPosition()),t}_attachWheelListener(){var e;(e=this.tabsContainer.get(0))===null||e===void 0||e.addEventListener("wheel",this._handleWheelEvent,{passive:!0})}_detachWheelListener(){var e;(e=this.tabsContainer.get(0))===null||e===void 0||e.removeEventListener("wheel",this._handleWheelEvent)}_handleWheelEvent(e){var t=e.currentTarget;if(t instanceof HTMLElement){var n=Math.abs(e.deltaY)>Math.abs(e.deltaX)?e.deltaY:e.deltaX;if(e.deltaMode===WheelEvent.DOM_DELTA_PAGE){var i;n*=(i=this.tabsContainer.innerWidth())!==null&&i!==void 0?i:1}else e.deltaMode===WheelEvent.DOM_DELTA_LINE&&(n*=100/3);t.scrollLeft+=Math.round(n)}}_handleScrollEvent(){this._checkScrollArrows()}_handleItemPickedUp(){this.isDraggingTab=!0,this.isDropdownShown&&this._hideAdditionalTabsDropdown(),this.controlsContainer.on("mouseenter",this._handleNextMouseEnter),this.tabPreviousButton.on("mouseenter",this._handlePreviousMouseEnter)}_handleItemDropped(){var e;this.isDraggingTab=!1,window.cancelAnimationFrame((e=this.rAF)!==null&&e!==void 0?e:-1),this.rAF=null,this.controlsContainer.off("mouseenter",this._handleNextMouseEnter),this.controlsContainer.off("mouseleave",this._handleNextMouseLeave),this.tabPreviousButton.off("mouseenter",this._handlePreviousMouseEnter),this.tabPreviousButton.off("mouseleave",this._handlePreviousMouseLeave)}_handleNextMouseEnter(){var e;this.controlsContainer.on("mouseleave",this._handleNextMouseLeave),this._handleScrollRepeat(this.SCROLL_RIGHT,(e=this.tabsContainer.scrollLeft())!==null&&e!==void 0?e:0)}_handlePreviousMouseEnter(){var e;this.tabPreviousButton.on("mouseleave",this._handlePreviousMouseLeave),this._handleScrollRepeat(this.SCROLL_LEFT,(e=this.tabsContainer.scrollLeft())!==null&&e!==void 0?e:0)}_handleNextMouseLeave(){var e;window.cancelAnimationFrame((e=this.rAF)!==null&&e!==void 0?e:-1),this.rAF=null,this.controlsContainer.off("mouseleave",this._handleNextMouseLeave)}_handlePreviousMouseLeave(){var e;window.cancelAnimationFrame((e=this.rAF)!==null&&e!==void 0?e:-1),this.rAF=null,this.tabPreviousButton.off("mouseleave",this._handlePreviousMouseLeave)}_handleNextButtonMouseDown(){for(var e,t=0;t<this.tabs.length;t+=1){var n,i,a,s,o;if(((n=(i=this.tabs[t].element.get(0))===null||i===void 0?void 0:i.offsetLeft)!==null&&n!==void 0?n:0)>((a=(s=this.tabsContainer.get(0))===null||s===void 0?void 0:s.offsetWidth)!==null&&a!==void 0?a:0)+((o=this.tabsContainer.scrollLeft())!==null&&o!==void 0?o:0)){e=this.tabs[t].element.get(0);break}}if(e)e.scrollIntoView({behavior:"smooth",inline:"nearest"}),this._handleScrollButtonMouseDown(this.SCROLL_RIGHT);else{var l=this.tabsContainer.get(0);if(l){var d,h;l.scrollLeft=(d=(h=this.tabsContainer.get(0))===null||h===void 0?void 0:h.scrollWidth)!==null&&d!==void 0?d:0}}}_handlePreviousButtonMouseDown(){for(var e,t=this.tabs.length-1;t>=0;t-=1){var n,i,a;if(((n=(i=this.tabs[t].element.get(0))===null||i===void 0?void 0:i.offsetLeft)!==null&&n!==void 0?n:0)<((a=this.tabsContainer.scrollLeft())!==null&&a!==void 0?a:0)){e=this.tabs[t].element.get(0);break}}if(e)e.scrollIntoView({behavior:"smooth",inline:"start"}),this._handleScrollButtonMouseDown(this.SCROLL_LEFT);else{var s=this.tabsContainer.get(0);s&&(s.scrollLeft=0)}}_handleScrollButtonMouseDown(e){this.holdTimer=window.setTimeout(()=>{var t;this._handleScrollRepeat(e,(t=this.tabsContainer.scrollLeft())!==null&&t!==void 0?t:0,100)},this.CLICK_TIMEOUT),window.addEventListener("mouseup",this._handleScrollButtonMouseUp)}_handleScrollButtonMouseUp(){var e,t;clearTimeout((e=this.holdTimer)!==null&&e!==void 0?e:-1),this.holdTimer=null,cancelAnimationFrame((t=this.rAF)!==null&&t!==void 0?t:-1),this.rAF=null,window.removeEventListener("mouseup",this._handleScrollButtonMouseUp)}_checkScrollArrows(){var e,t,n;this.tabsContainer.scrollLeft()===0?this.tabPreviousButton.first().prop("disabled",!0):((e=this.tabsContainer.scrollLeft())!==null&&e!==void 0?e:0)+((t=this.tabsContainer.innerWidth())!==null&&t!==void 0?t:0)===((n=this.tabsContainer.get(0))===null||n===void 0?void 0:n.scrollWidth)?this.tabNextButton.prop("disabled",!0):(this.tabNextButton.prop("disabled",!1),this.tabPreviousButton.first().prop("disabled",!1))}_handleScrollRepeat(e,t){var n,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,a=arguments.length>3?arguments[3]:void 0,s=this.tabsContainer.get(0);if(s){var o=s.getBoundingClientRect();if(e===this.SCROLL_LEFT){if(this.tabsContainer.scrollLeft(t-i),this.isDraggingTab&&this.parent._highlightHeaderDropZone(o.left-1),this.tabsContainer.scrollLeft()===0){this._checkScrollArrows();return}}else if(e===this.SCROLL_RIGHT){var l,d;if(this.tabsContainer.scrollLeft(t+i),this.isDraggingTab&&this.parent._highlightHeaderDropZone(o.right+1),((l=this.tabsContainer.scrollLeft())!==null&&l!==void 0?l:0)+((d=this.tabsContainer.innerWidth())!==null&&d!==void 0?d:0)===s.scrollWidth){this._checkScrollArrows();return}}window.cancelAnimationFrame((n=this.rAF)!==null&&n!==void 0?n:-1),this.rAF=window.requestAnimationFrame(h=>{var c,f,p=a||h,m=h-p,b=this.START_SPEED*m+.5*this.ACCELERATION*(m*m);b=Math.min(b,(c=(f=this.tabsContainer.get(0))===null||f===void 0?void 0:f.scrollWidth)!==null&&c!==void 0?c:1/0),this._handleScrollRepeat(e,t,b,p)})}}_$setClosable(e){return this.closeButton&&this._isClosable()?(this.closeButton.element[e?"show":"hide"](),!0):!1}_$destroy(){this.emit("destroy",this);for(var e=0;e<this.tabs.length;e++)this.tabs[e]._$destroy();this._detachWheelListener(),this._handleItemDropped(),Z(document).off("mouseup",this._hideAdditionalTabsDropdown),this.tabDropdownSearch.off("input",this._handleFilterInput),this.tabDropdownSearch.off("keydown",this._handleFilterKeydown),this.element.remove()}_getHeaderSetting(e){if(e in this.parent._header)return this.parent._header[e]}_createControls(){var e,t,n,i,a;if(a=this.layoutManager.config.labels.tabDropdown,this.layoutManager.config.labels.tabNextLabel,this.layoutManager.config.labels.tabPreviousLabel,this.tabDropdownButton=new Qr(this,a,"lm_tabdropdown",this._showAdditionalTabsDropdown),this.tabDropdownButton.element.hide(),this.controlsContainer.prepend(this.tabNextButton),this.tabNextButton.hide(),this._getHeaderSetting("popout")&&(t=this._onPopoutClick.bind(this),n=this._getHeaderSetting("popout"),new Qr(this,n,"lm_popout",t)),this._getHeaderSetting("maximise")){i=this.parent.toggleMaximise.bind(this.parent);var s=this._getHeaderSetting("maximise"),o=this._getHeaderSetting("minimise"),l=new Qr(this,s,"lm_maximise",i);this.parent.on("maximised",function(){l.element.attr("title",o??"")}),this.parent.on("minimised",function(){l.element.attr("title",s??"")})}this._isClosable()&&(e=this.parent.remove.bind(this.parent),n=this._getHeaderSetting("close"),this.closeButton=new Qr(this,n,"lm_close",e))}_showAdditionalTabsDropdown(){if(this.isDropdownShown){this._hideAdditionalTabsDropdown();return}this.tabDropdownList=this.tabsContainer.clone(!0).appendTo(this.tabDropdownContainer).children().removeClass("lm_active"),Z(document.body).append(this.tabDropdownContainer),this.tabDropdownContainer.show(),this.isDropdownShown=!0,this.element.addClass("lm_dropdown_open"),this.tabDropdownSearch.val("").focus(),this.dropdownKeyIndex=0,this.tabDropdownList.eq(this.dropdownKeyIndex).addClass("lm_keyboard_active"),Z(document).on("mousedown",this._hideAdditionalTabsDropdown),this._updateAdditionalTabsDropdown()}_handleFilterKeydown(e){if(e.key==="Escape"){this._hideAdditionalTabsDropdown();return}if(this.dropdownKeyIndex===-1)return;if(e.key==="Enter"||e.key===" "){this._hideAdditionalTabsDropdown(),this.tabs[this.dropdownKeyIndex]._onTabClick();return}function t(o,l,d){if(d==null||d.length<2)return-1;for(var h=(o+l+d.length)%d.length;h!==o;){if(d.eq(h).css("display")!=="none")return h;h=(h+l+d.length)%d.length}return o}if(e.key==="ArrowDown"||e.key==="Tab"&&e.shiftKey===!1){var n,i;e.preventDefault(),(n=this.tabDropdownList)===null||n===void 0||n.eq(this.dropdownKeyIndex).removeClass("lm_keyboard_active"),this.dropdownKeyIndex=t(this.dropdownKeyIndex,1,this.tabDropdownList),(i=this.tabDropdownList)===null||i===void 0||i.eq(this.dropdownKeyIndex).addClass("lm_keyboard_active")}else if(e.key==="ArrowUp"||e.key==="Tab"){var a,s;e.preventDefault(),(a=this.tabDropdownList)===null||a===void 0||a.eq(this.dropdownKeyIndex).removeClass("lm_keyboard_active"),this.dropdownKeyIndex=t(this.dropdownKeyIndex,-1,this.tabDropdownList),(s=this.tabDropdownList)===null||s===void 0||s.eq(this.dropdownKeyIndex).addClass("lm_keyboard_active")}}_handleFilterInput(e){if(this.tabDropdownList!=null){this.tabDropdownList.eq(this.dropdownKeyIndex).removeClass("lm_keyboard_active"),this.dropdownKeyIndex=-1;for(var t=0;t<this.tabDropdownList.length;t++){var n,i;((n=(i=this.tabs[t].contentItem.config.title)===null||i===void 0?void 0:i.toLowerCase().indexOf(e.target.value.toLowerCase()))!==null&&n!==void 0?n:-1)!==-1?(this.tabDropdownList.eq(t).css("display",""),this.dropdownKeyIndex===-1&&(this.dropdownKeyIndex=t)):this.tabDropdownList.eq(t).css("display","none")}this.dropdownKeyIndex!==-1&&this.tabDropdownList.eq(this.dropdownKeyIndex).addClass("lm_keyboard_active")}}_hideAdditionalTabsDropdown(e){var t,n;this.isDropdownShown&&(e&&(t=this.tabDropdownContainer.get(0))!==null&&t!==void 0&&t.contains(e.target)||e&&((n=this.tabDropdownButton)===null||n===void 0?void 0:n.element.get(0))===e.target||(this.element.removeClass("lm_dropdown_open"),this.tabDropdownContainer.hide(),this.isDropdownShown=!1,this.element.append(this.tabDropdownContainer),this.tabDropdownContainer.find(".lm_tabs").remove(),Z(document).off("mousedown",this._hideAdditionalTabsDropdown)))}_updateAdditionalTabsDropdown(){var e,t,n,i;if(this.isDropdownShown&&!(!this.tabDropdownList||this.tabDropdownList.length==0)){var a=(e=(t=this.tabDropdownContainer.get(0))===null||t===void 0?void 0:t.scrollHeight)!==null&&e!==void 0?e:0;if(a!==0){var s=this.tabDropdownContainer[0].getBoundingClientRect(),o=(n=Z(window).height())!==null&&n!==void 0?n:0,l=(i=Z(window).width())!==null&&i!==void 0?i:0;if(this.tabDropdownButton){var d=this.tabDropdownButton.element[0].getBoundingClientRect(),h=a<o-d.bottom,c=!h&&d.bottom>o*.6,f=Math.min(d.left+(c?d.width:0),l-s.width-this.PADDING),p=c?Math.max(d.top-a,this.PADDING):d.bottom,m=o-p-this.PADDING;this.tabDropdownContainer.css({"max-height":m,top:p,left:f})}}}}_isClosable(){return!!(this.parent.config.isClosable&&this.layoutManager.config.settings.showCloseIcon)}_onPopoutClick(){if(this.layoutManager.config.settings.popoutWholeStack===!0)this.parent.popout();else{var e;(e=this.activeContentItem)===null||e===void 0||e.popout()}}_onHeaderClick(e){e.target===this.element[0]&&this.parent.select()}_updateTabSizes(){if(this.tabs.length!==0){var e=this.tabsContainer.get(0);if(this.isDropdownShown&&this._updateAdditionalTabsDropdown(),!!e){if(!this.isOverflowing&&e.scrollWidth>e.clientWidth){var t;(t=this.tabDropdownButton)===null||t===void 0||t.element.show(),this.tabNextButton.show(),this.tabPreviousButton.show(),this.isOverflowing=!0}else if(this.isOverflowing&&e.scrollWidth<=e.clientWidth){var n;(n=this.tabDropdownButton)===null||n===void 0||n.element.hide(),this.tabNextButton.hide(),this.tabPreviousButton.hide(),this.isOverflowing=!1}this.isOverflowing&&this._checkScrollArrows()}}}}le(en,"_template",['<div class="lm_header">','<ul class="lm_tabs"></ul>','<ul class="lm_controls"></ul>','<ul class="lm_tabdropdown_list">','<li class="lm_tabdropdown_search"><input type="text" placeholder="Find tab..."></li>',"</ul>","</div>"].join(""));le(en,"_previousButtonTemplate",['<ul class="lm_controls">','<li class="lm_tabpreviousbutton"></li>',"</ul>"].join(""));le(en,"_nextButtonTemplate",['<li class="lm_tabnextbutton"></li>'].join(""));function Gr(r,e,t){return e=VP(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function VP(r){var e=BP(r,"string");return typeof e=="symbol"?e:String(e)}function BP(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class Af{constructor(e,t,n){Gr(this,"_isVertical",void 0),Gr(this,"_size",void 0),Gr(this,"_grabSize",void 0),Gr(this,"_dragListener",void 0),Gr(this,"element",void 0),this._isVertical=e,this._size=t,this._grabSize=n<t?t:n,this.element=this._createElement(),this._dragListener=new Oi(this.element)}on(e,t,n){var i;(i=this._dragListener)===null||i===void 0||i.on(e,t,n)}_$destroy(){var e;(e=this._dragListener)===null||e===void 0||e.destroy(),this._dragListener=null,this.element.remove()}_createElement(){var e=Z('<div class="lm_drag_handle"></div>'),t=Z('<div class="lm_splitter"></div>');t.append(e);var n=this._grabSize-this._size,i=n/2;return this._isVertical?(e.css("top",-i),e.css("height",this._size+n),t.addClass("lm_vertical"),t.height(this._size)):(e.css("left",-i),e.css("width",this._size+n),t.addClass("lm_horizontal"),t.width(this._size)),t}}const WP=Object.freeze(Object.defineProperty({__proto__:null,BrowserPopout:xf,DragProxy:zn,DragSource:If,DragSourceFromEvent:Nf,DropTargetIndicator:Di,Header:en,HeaderButton:Qr,Splitter:Af,Tab:xi},Symbol.toStringTag,{value:"Module"}));var GP={config:Vw,container:Kw,controls:WP,errors:TP,items:jP,utils:dP};const zP=GP;function ru(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,n)}return t}function rt(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?ru(Object(t),!0).forEach(function(n){ue(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):ru(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function ue(r,e,t){return e=KP(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function KP(r){var e=qP(r,"string");return typeof e=="symbol"?e:String(e)}function qP(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class Rf extends Ft{static minifyConfig(e){return ml(e)}static unminifyConfig(e){return so(e)}constructor(e,t){super(),ue(this,"isInitialised",!1),ue(this,"_isFullPage",!1),ue(this,"_resizeTimeoutId",void 0),ue(this,"_components",{"lm-react-component":Of}),ue(this,"_fallbackComponent",void 0),ue(this,"_itemAreas",[]),ue(this,"_maximisedItem",null),ue(this,"_maximisePlaceholder",Z('<div class="lm_maximise_place"></div>')),ue(this,"_creationTimeoutPassed",!1),ue(this,"_subWindowsCreated",!1),ue(this,"_dragSources",[]),ue(this,"_updatingColumnsResponsive",!1),ue(this,"_firstLoad",!0),ue(this,"_reactChildMap",new Map),ue(this,"_reactChildren",null),ue(this,"width",null),ue(this,"height",null),ue(this,"root",void 0),ue(this,"openPopouts",[]),ue(this,"selectedItem",null),ue(this,"isSubWindow",!1),ue(this,"eventHub",new Df(this)),ue(this,"config",void 0),ue(this,"container",void 0),ue(this,"_originalContainer",void 0),ue(this,"dropTargetIndicator",null),ue(this,"tabDropPlaceholder",Z('<div class="lm_drop_tab_placeholder"></div>')),ue(this,"_typeToItem",void 0),this._onResize=this._onResize.bind(this),this._onUnload=this._onUnload.bind(this),this._windowBlur=this._windowBlur.bind(this),this._windowFocus=this._windowFocus.bind(this),this.config=this._createConfig(e),this._originalContainer=t,this.container=this._getContainer(),this.isSubWindow&&Z("body").css("visibility","hidden"),this._typeToItem={column:Sa.bind(this,!0),row:Sa.bind(this,!1),stack:ho,component:Ff}}registerComponent(e,t){if(typeof t!="function"&&(t==null||t.render==null||typeof t.render!="function"))throw new Error("Please register a constructor function");if(this._components[e]!==void 0)throw new Error("Component "+e+" is already registered");this._components[e]=t;var n=()=>{if(this._components[e]===void 0)throw new Error("Component "+e+" is not registered");delete this._components[e]};return n}setFallbackComponent(e){this._fallbackComponent=e}toConfig(e){if(this.isInitialised===!1)throw new Error("Can't create config, layout not yet initialised");if(e&&!(e instanceof $e))throw new Error("Root must be a ContentItem");var t={settings:rt({},this.config.settings),dimensions:rt({},this.config.dimensions),labels:rt({},this.config.labels),content:[]},n=function a(s,o){for(var l in o.config)l!=="content"&&(s[l]=o.config[l]);if(s.componentName==="lm-react-component"&&(s.type="react-component"),o.contentItems.length){s.content=[];for(var d=0;d<o.contentItems.length;d++)s.content[d]={},a(s.content[d],o.contentItems[d])}};e?n(t,{contentItems:[e]}):n(t,this.root),this._$reconcilePopoutWindows(),t.openPopouts=[];for(var i=0;i<this.openPopouts.length;i++)t.openPopouts.push(this.openPopouts[i].toConfig());return t.maximisedItemId=this._maximisedItem?"__glMaximised":void 0,t}getComponent(e){return this._components[e]}getFallbackComponent(){return this._fallbackComponent}init(){if(this._subWindowsCreated===!1&&(this._createSubWindows(),this._subWindowsCreated=!0),document.readyState==="loading"||document.body===null){Z(document).ready(this.init.bind(this));return}if(this.isSubWindow===!0&&this._creationTimeoutPassed===!1){setTimeout(this.init.bind(this),7),this._creationTimeoutPassed=!0;return}this.isSubWindow===!0&&this._adjustToWindowMode(),this._setContainer(),this.dropTargetIndicator=new Di,this.updateSize(),this._create(this.config),this._bindEvents(),this.isInitialised=!0,this._adjustColumnsResponsive(),this.emit("initialised")}addReactChild(e,t){this._reactChildMap.set(e,t),this._reactChildren=[...this._reactChildMap.values()],this.emit("reactChildrenChanged")}removeReactChild(e,t){var n=this._reactChildMap.get(e);n===t&&(this._reactChildMap.delete(e),this._reactChildren=[...this._reactChildMap.values()],this.emit("reactChildrenChanged"))}getReactChildren(){return this._reactChildren}updateSize(e,t){var n,i;if(this.width=(n=e??this.container.width())!==null&&n!==void 0?n:0,this.height=(i=t??this.container.height())!==null&&i!==void 0?i:0,this.isInitialised===!0){if(this.root.callDownwards("setSize",[this.width,this.height]),this._maximisedItem){var a,s;this._maximisedItem.element.width((a=this.container.width())!==null&&a!==void 0?a:0),this._maximisedItem.element.height((s=this.container.height())!==null&&s!==void 0?s:0),this._maximisedItem.callDownwards("setSize")}this._adjustColumnsResponsive()}}destroy(){var e;this.isInitialised===!1||!this.root||(this._onUnload(),Z(window).off("resize",this._onResize),Z(window).off("unload beforeunload",this._onUnload),Z(window).off("blur.lm").off("focus.lm"),this.root.callDownwards("_$destroy",[],!0),this.root.contentItems=[],this.tabDropPlaceholder.remove(),(e=this.dropTargetIndicator)===null||e===void 0||e.destroy(),this.eventHub.destroy(),this._dragSources.forEach(function(t){t._dragListener.destroy()}),this._dragSources=[])}createContentItem(e,t){var n,i;if(typeof e.type!="string")throw new jn("Missing parameter 'type'",e);if(e.type==="react-component"&&(e.type="component",e.componentName="lm-react-component"),!this._typeToItem[e.type])throw n="Unknown type '"+e.type+"'. Valid types are "+Object.keys(this._typeToItem).join(","),new jn(n);return e.type==="component"&&!(t instanceof ho)&&t&&!(this.isSubWindow===!0&&t instanceof uo)&&(e={type:"stack",width:e.width,height:e.height,content:[e]}),i=new this._typeToItem[e.type](this,e,t),i}createPopout(e,t,n,i){var a=[],s=e instanceof $e,o=this;if(s){var l;a=this.toConfig(e).content,n=fl();for(var d=e.parent,h=e;((c=d)===null||c===void 0?void 0:c.contentItems.length)===1&&!d.isRoot;){var c;h=d,d=d.parent}if((l=d)===null||l===void 0||l.addId(n),i==null||Number.isNaN(i)){var f;i=(f=d)===null||f===void 0?void 0:f.contentItems.indexOf(h)}}else e instanceof Array?a=e:a=[e];if(!t&&s){var p,m,b,g=window.screenX||window.screenLeft,C=window.screenY||window.screenTop,y=(p=e.element.offset())!==null&&p!==void 0?p:{left:0,top:0};t={left:g+y.left,top:C+y.top,width:(m=e.element.width())!==null&&m!==void 0?m:0,height:(b=e.element.height())!==null&&b!==void 0?b:0}}if(!t&&!s&&(t={left:window.screenX||window.screenLeft+20,top:window.screenY||window.screenTop+20,width:500,height:309}),s&&e.remove(),!(!t||!n||i===void 0)){var S=new xf(a,t,n,i,this);return S.on("initialised",function(){o.emit("windowOpened",S)}),S.on("closed",function(){o._$reconcilePopoutWindows()}),this.openPopouts.push(S),S}}createDragSource(e,t){this.config.settings.constrainDragToContainer=!1;var n=new If(e,t,this);return this._dragSources.push(n),n}createDragSourceFromEvent(e,t){return this.config.settings.constrainDragToContainer=!1,new Nf(e,this,t)}selectItem(e,t){if(this.config.settings.selectionEnabled!==!0)throw new Error("Please set selectionEnabled to true to use this feature");e!==this.selectedItem&&(this.selectedItem!==null&&this.selectedItem.deselect(),e&&t!==!0&&e.select(),this.selectedItem=e,this.emit("selectionChanged",e))}_$maximiseItem(e){var t,n;this._maximisedItem!==null&&this._$minimiseItem(this._maximisedItem),this._maximisedItem=e,this._maximisedItem.addId("__glMaximised"),e.element.addClass("lm_maximised"),e.element.after(this._maximisePlaceholder),this.root.element.prepend(e.element),e.element.width((t=this.container.width())!==null&&t!==void 0?t:0),e.element.height((n=this.container.height())!==null&&n!==void 0?n:0),e.callDownwards("setSize"),this._maximisedItem.emit("maximised"),this.emit("stateChanged")}_$minimiseItem(e){var t;e.element.removeClass("lm_maximised"),e.removeId("__glMaximised"),this._maximisePlaceholder.after(e.element),this._maximisePlaceholder.remove(),(t=e.parent)===null||t===void 0||t.callDownwards("setSize"),this._maximisedItem=null,e.emit("minimised"),this.emit("stateChanged")}_$closeWindow(){window.setTimeout(function(){window.close()},1)}_$getArea(e,t){for(var n=1/0,i=null,a=0;a<this._itemAreas.length;a++){var s=this._itemAreas[a];e>s.x1&&e<s.x2&&t>s.y1&&t<s.y2&&n>s.surface&&(n=s.surface,i=s)}return i}_$createRootItemAreas(){var e=50,t=rt({},this.root._$getArea()),n=[rt(rt({},t),{},{side:"left",x2:t.x1+e}),rt(rt({},t),{},{side:"right",x1:t.x2-e}),rt(rt({},t),{},{side:"top",y2:t.y1+e}),rt(rt({},t),{},{side:"bottom",y1:t.y2-e})];n.forEach(i=>{i.surface=(i.x2-i.x1)*(i.y2-i.y1)}),this._itemAreas.push(...n)}_$calculateItemAreas(){var e=this._getAllContentItems();if(this._itemAreas=[],e.length===1){this._itemAreas.push(this.root._$getArea());return}this._$createRootItemAreas();for(var t=0;t<e.length;t++){var n=e[t];if(ci(n)){var i=n._$getArea();if(i!==null)if(i instanceof Array)this._itemAreas=this._itemAreas.concat(i);else{var a;this._itemAreas.push(i);var s=rt(rt({},i),(a=i.contentItem._contentAreaDimensions)===null||a===void 0?void 0:a.header.highlightArea);s.surface=(s.x2-s.x1)*(s.y2-s.y1),this._itemAreas.push(s)}}}}_$normalizeContentItem(e,t){if(!e)throw new Error("No content item defined");if(typeof e=="function"&&(e=e()),e instanceof $e)return e;if(Z.isPlainObject(e)&&e.type){var n=this.createContentItem(e,t);return n.callDownwards("_$init"),n}else throw new Error("Invalid contentItem")}_$reconcilePopoutWindows(){for(var e=[],t=0;t<this.openPopouts.length;t++){var n;((n=this.openPopouts[t].getWindow())===null||n===void 0?void 0:n.closed)===!1?e.push(this.openPopouts[t]):this.emit("windowClosed",this.openPopouts[t])}this.openPopouts.length!==e.length&&(this.emit("stateChanged"),this.openPopouts=e)}_getAllContentItems(){var e=[],t=n=>{if(e.push(n),n.contentItems instanceof Array)for(var i=0;i<n.contentItems.length;i++)t(n.contentItems[i])};return t(this.root),e}_bindEvents(){this._isFullPage&&Z(window).resize(this._onResize),Z(window).on("unload beforeunload",this._onUnload).on("blur.lm",this._windowBlur).on("focus.lm",this._windowFocus)}_windowBlur(){this.root.element.addClass("lm_window_blur")}_windowFocus(){this.root.element.removeClass("lm_window_blur")}_onResize(){clearTimeout(this._resizeTimeoutId),this._resizeTimeoutId=window.setTimeout(this.updateSize.bind(this),100)}_createConfig(e){var t,n=Tf("gl-window");n&&(this.isSubWindow=!0,e=JSON.parse(localStorage.getItem(n)||"{}"),e=so(e),localStorage.removeItem(n)),e=Z.extend(!0,{},Ef,e);var i=function a(s){for(var o in s){var l=s[o];o!=="props"&&typeof l=="object"&&l!=null?a(l):o==="type"&&l==="react-component"&&(s.type="component",s.componentName="lm-react-component")}};return i(e),((t=e.settings)===null||t===void 0?void 0:t.hasHeaders)===!1&&(e.dimensions.headerHeight=0),e}_adjustToWindowMode(){var e,t=Z('<div class="lm_popin" title="'+this.config.labels.popin+'"><div class="lm_icon"></div><div class="lm_bg"></div></div>');t.click(()=>{this.emit("popIn")}),document.title=pl((e=this.config.content[0].title)!==null&&e!==void 0?e:""),Z("head").append(Z("body link, body style, template, .gl_keep")),this.container=Z("body").html("").css("visibility","visible").append(t),document.body.offsetHeight,window.__glInstance=this}_createSubWindows(){if(this.config.openPopouts)for(var e=0;e<this.config.openPopouts.length;e++){var t=this.config.openPopouts[e];this.createPopout(t.content,t.dimensions,t.parentId,t.indexInParent)}}_getContainer(){var e=this._originalContainer?Z(this._originalContainer):Z("body");if(e.length===0)throw new Error("GoldenLayout container not found");if(e.length>1)throw new Error("GoldenLayout more than one container element specified");return e}_setContainer(){var e=this._getContainer();e[0]===document.body&&(this._isFullPage=!0,Z("html, body").css({height:"100%",margin:0,padding:0,overflow:"hidden"})),this.container=e}_create(e){var t;if(!(e.content instanceof Array))throw e.content===void 0?t="Missing setting 'content' on top level of configuration":t="Configuration parameter 'content' must be an array",new jn(t,e);if(e.content.length>1)throw t="Top level content can't contain more then one element.",new jn(t,e);this.root=new uo(this,{content:e.content},this.container),this.root.callDownwards("_$init"),e.maximisedItemId==="__glMaximised"&&this.root.getItemsById(e.maximisedItemId)[0].toggleMaximise()}_onUnload(){if(this.config.settings.closePopoutsOnUnload===!0)for(var e=0;e<this.openPopouts.length;e++)this.openPopouts[e].close()}_adjustColumnsResponsive(){if(!this._useResponsiveLayout()||this._updatingColumnsResponsive||!this.config.dimensions||!this.config.dimensions.minItemWidth||this.root.contentItems.length===0||!this.root.contentItems[0].isRow){this._firstLoad=!1;return}this._firstLoad=!1;var e=this.root.contentItems[0].contentItems.length;if(!(e<=1)){var t=this.config.dimensions.minItemWidth,n=e*t;if(!(this.width==null||n<=this.width)){this._updatingColumnsResponsive=!0;for(var i=Math.max(Math.floor(this.width/t),1),a=e-i,s=this.root.contentItems[0],o=this._findAllStackContainers()[0],l=0;l<a;l++){var d=s.contentItems[s.contentItems.length-1];this._addChildContentItemsToContainer(o,d)}this._updatingColumnsResponsive=!1}}}_useResponsiveLayout(){return this.config.settings&&(this.config.settings.responsiveMode=="always"||this.config.settings.responsiveMode=="onload"&&this._firstLoad)}_addChildContentItemsToContainer(e,t){t.type==="stack"?t.contentItems.forEach(function(n){e.addChild(n),t.removeChild(n,!0)}):t.contentItems.forEach(n=>{this._addChildContentItemsToContainer(e,n)})}_findAllStackContainers(){var e=[];return this._findAllStackContainersRecursive(e,this.root),e}_findAllStackContainersRecursive(e,t){t.contentItems.forEach(n=>{ci(n)?e.push(n):n.isComponent||this._findAllStackContainersRecursive(e,n)})}}ue(Rf,"__lm",zP);const jf=Rf,YP="_lm_dragging_1qalq_1",XP="_lm_goldenlayout_1qalq_1",ZP="_lm_header_1qalq_1",QP="_lm_controls_1qalq_1",JP="_lm_tabpreviousbutton_1qalq_1",e0="_lm_tabnextbutton_1qalq_1",t0="_lm_tab_1qalq_1",n0="_lm_active_1qalq_1",r0="_lm_close_tab_1qalq_1",i0="_lm_content_1qalq_1",a0="_lm_dragProxy_1qalq_1",s0="_lm_dropTargetIndicator_1qalq_1",o0="_march_1qalq_1",l0="_lm_inner_1qalq_1",d0="_lm_splitter_1qalq_1",u0="_lm_selectable_1qalq_1",h0="_lm_tabdropdown_list_1qalq_1",c0="_lm_title_1qalq_1",v0="_lm_title_before_1qalq_1",f0="_lm_selected_1qalq_1",p0="_lm_focusin_1qalq_1",m0="_lm_window_blur_1qalq_1",g0="_lm_popout_1qalq_1",b0="_lm_maximise_1qalq_1",C0="_lm_tabdropdown_1qalq_1",S0="_lm_close_1qalq_1",y0="_lm_tabdropdown_search_1qalq_1",E0="_lm_tabs_1qalq_1",w0="_lm_keyboard_active_1qalq_1",P0="_lm_maximised_1qalq_1",_0="_lm_items_1qalq_1",iu={"tab-height":"28px","drag-border-width":"5px",lm_dragging:YP,lm_goldenlayout:XP,lm_header:ZP,lm_controls:QP,lm_tabpreviousbutton:JP,lm_tabnextbutton:e0,lm_tab:t0,lm_active:n0,lm_close_tab:r0,lm_content:i0,lm_dragProxy:a0,lm_dropTargetIndicator:s0,march:o0,lm_inner:l0,lm_splitter:d0,lm_selectable:u0,lm_tabdropdown_list:h0,lm_title:c0,lm_title_before:v0,lm_selected:f0,lm_focusin:p0,lm_window_blur:m0,lm_popout:g0,lm_maximise:b0,lm_tabdropdown:C0,lm_close:S0,lm_tabdropdown_search:y0,lm_tabs:E0,lm_keyboard_active:w0,lm_maximised:P0,lm_items:_0},au=Object.freeze({tabHeight:parseInt(iu["tab-height"],10),dragBorderWidth:parseInt(iu["drag-border-width"],10)});function su(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,n)}return t}function zt(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?su(Object(t),!0).forEach(function(n){kf(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):su(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function kf(r,e,t){return e=T0(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function T0(r){var e=O0(r,"string");return typeof e=="symbol"?e:String(e)}function O0(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}var dn=B.module("LayoutUtils");function $f(r){return r.componentName!==void 0}function dr(r){var e=r;return($f(r)&&r.componentName==="lm-react-component"||r.type==="react-component")&&e.component!==void 0}function zi(r){return r.focus!==void 0}function ou(r){return r.type==="stack"}class F{static activateTab(e,t){var n=F.getStackForRoot(e,t,!1);if(!n){dn.error("Could not find stack for config",t);return}var i=F.getContentItemInStack(n,t);i&&n.setActiveContentItem(i)}static isActiveTab(e,t){var n=F.getStackForRoot(e,t,!1);if(!n)return dn.error("Could not find stack for config",t),!1;var i=F.getContentItemInStack(n,t),a=n.getActiveContentItem();return a===i}static addStack(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,n=t?"column":"row";if(Lf(e)){(e.contentItems==null||e.contentItems.length===0)&&e.addChild({type:n});var i=e.contentItems[0],a=t?i.isColumn:i.isRow;if(!a){e.removeChild(i,!0),e.addChild({type:n});var s=document.activeElement;e.contentItems[0].addChild(i),s&&s.focus!=null&&s.focus()}return this.addStack(e.contentItems[0],t)}if(e.contentItems.length<2)return e.addChild({type:"stack"}),e.contentItems[e.contentItems.length-1];var o=e.contentItems[e.contentItems.length-1],l=t?o.isRow:o.isColumn;return l||(e.addChild({type:t?"row":"column"}),e.removeChild(o,!0),e.contentItems[e.contentItems.length-1].addChild(o),o=e.contentItems[e.contentItems.length-1]),this.addStack(o,!t)}static getStackForConfig(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;if(n&&ci(e)&&e.contentItems.length===0)return e;if(e.contentItems==null)return null;for(var i=0;i<e.contentItems.length;i+=1){var a=e.contentItems[i];if(a.isComponent&&a.config!=null&&ql(a.config,t))return e;var s=this.getStackForConfig(a,t,n);if(s)return s}return null}static getStackForRoot(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,s=this.getStackForConfig(e,t);return!s&&i&&(s=this.getStackForConfig(e,{component:t.component},a)),!s&&n&&(s=this.addStack(e)),s}static getStackForComponentTypes(e,t){for(var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,s=0;s<t.length;s+=1){var o=t[s],l=s===t.length-1,d=F.getStackForRoot(e,{component:o},n&&l,i,a);if(d)return d}return null}static getContentItemInStack(e,t){if(!e)return null;for(var n=0;n<e.contentItems.length;n+=1){var i=e.contentItems[n];if(i.isComponent&&i.config!=null&&ql(i.config,t))return i}return null}static dehydrateLayoutConfig(e,t){if(e==null||!e.length)return[];for(var n=[],i=0;i<e.length;i+=1){var a=e[i],{component:s,content:o}=a;if(s){var l=t(s,a);l!=null?n.push(l):dn.debug2('dehydrateLayoutConfig: skipping unmapped component "'.concat(s,'"'))}else if(o){var d=zt(zt({},a),{},{content:F.dehydrateLayoutConfig(o,t)});n.push(d)}else n.push(a)}return n}static getTabPoint(e){var{tab:t}=e;if(t==null)throw new Error("Cannot get tab for panel container ".concat(e));var n=t.element[0].getBoundingClientRect();return[n.left+n.width*.5,n.bottom-8]}static dropLayoutMinorChange(e){for(var t=0;t<e.length;t+=1){var n=e[t],{content:i}=n;i!==void 0?(ou(n)&&delete n.activeItemIndex,F.dropLayoutMinorChange(i)):dr(n)&&n.component==="IrisGridPanel"&&n.props.panelState!=null&&(delete n.id,n.props.panelState.irisGridState.sorts=[],n.props.panelState.irisGridState.quickFilters=[],n.props.panelState.gridState.isStuckToBottom=!1,n.props.panelState.gridState.isStuckToRight=!1)}}static isEqual(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;if(n){var i=F.cloneLayout(e),a=F.cloneLayout(t);return F.dropLayoutMinorChange(i),F.dropLayoutMinorChange(a),Mt(i,a)}return Mt(e,t)}static cloneLayout(e){return JSON.parse(JSON.stringify(e))}static hydrateLayoutConfig(e,t){if(e==null||!e.length)return[];for(var n=[],i=0;i<e.length;i+=1){var a=e[i];if(dr(a)){var s,{component:o,props:l={}}=a;n.push(zt(zt({},a),{},{id:(s=a==null?void 0:a.id)!==null&&s!==void 0?s:Ee(),props:t(o,l)}))}else if(a.content!==void 0){var d=F.hydrateLayoutConfig(a.content,t);ou(a)&&a.activeItemIndex!=null&&a.activeItemIndex>=d.length&&(dn.warn("Fixing bad activeItemIndex!",a.activeItemIndex,a),a.activeItemIndex=0),n.push(zt(zt({},a),{},{content:d}))}else n.push(a)}return n}static openComponent(){var{root:e,config:t,replaceExisting:n=!0,replaceConfig:i=void 0,createNewStack:a=!1,focusElement:s=void 0,dragEvent:o=void 0}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},l=document.activeElement,d=zt({},t);if(d.id==null&&(d.id=Ee.generate()),o!=null){e==null||e.layoutManager.createDragSourceFromEvent(d,o);return}var h=i||{id:d.id,component:d.component};G(e);var c=a?F.addStack(e):F.getStackForRoot(e,h);G(c);var f=F.getContentItemInStack(c,h);if(s!=null){var p=b=>{dn.debug("Component created, focusing element",s),c.off("componentCreated",p);var{element:g}=b.origin;requestAnimationFrame(()=>{F.focusElement(g[0],s)})};c.on("componentCreated",p)}if(n&&f){var m=c.contentItems.indexOf(f);c.addChild(d,m+1),c.removeChild(f),c.setActiveContentItem(c.contentItems[m])}else c.addChild(d);s==null&&l&&zi(l)&&l.focus()}static openComponentInStack(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,i=document.activeElement,a={id:t.id},s=F.getContentItemInStack(e,a);if(n&&s&&e){var o=e==null?void 0:e.contentItems.indexOf(s);e.addChild(t,o+1),e.removeChild(s),e.setActiveContentItem(e.contentItems[o])}else e==null||e.addChild(t);i&&zi(i)&&i.focus()}static closeComponent(e,t,n){var i=F.getStackForRoot(e,t,!1,!1,!1);if(!i){dn.warn("Cannot find stack for component, ignoring close",t);return}var a=F.getContentItemInStack(i,t),s=document.activeElement;a&&(ht(a)?a.container.close(n):i.removeChild(a)),s&&document.contains(s)&&zi(s)&&s.focus()}static renameComponent(e,t,n){var i=F.getStackForRoot(e,t,!1);if(!i){dn.error("Could not find stack for config",t);return}var a=F.getContentItemInStack(i,t);a&&a.setTitle(n)}static cloneComponent(e,t){var n=F.getStackForRoot(e,t,!1);if(!n)return dn.error("Could not find stack for config",t),null;var{props:i={}}=t,a=F.getPanelComponentState(t),s={type:"react-component",component:t.component,props:zt(zt({},i),{},{panelState:a}),title:"".concat(t.title," Copy"),id:Ee.generate()};return F.openComponentInStack(n,s),s}static getPanelComponentState(e){if($f(e)){var t;return(t=e.componentState)===null||t===void 0?void 0:t.panelState}if(dr(e)){var n;return(n=e.props)===null||n===void 0?void 0:n.panelState}return null}static makeDefaultLayout(){return{dimensions:{headerHeight:au.tabHeight,borderWidth:au.dragBorderWidth,borderGrabWidth:10},settings:{showPopoutIcon:!1,showCloseIcon:!1,constrainDragToContainer:!1}}}static getRootFromContainer(e){return e.layoutManager.root}static getComponentConfigFromContainer(e){return e?e.tab!=null&&e.tab.contentItem!=null?e.tab.contentItem.config:e._config:null}static getTitleFromContainer(e){return e!=null&&e.tab!=null&&e.tab.contentItem!=null?e.tab.contentItem.config.title:null}static getTitleFromTab(e){return e!=null&&e.contentItem!=null?e.contentItem.config.title:null}static getIdFromContainer(e){var t=F.getComponentConfigFromContainer(e);return t?t.id:null}static getIdFromPanel(e){var{glContainer:t}=e.props;return F.getIdFromContainer(t)}static getComponentNameFromPanel(e){var{glContainer:t}=e.props,n=F.getComponentConfigFromContainer(t);if(n&&dr(n)){var i;return(i=n.component)!==null&&i!==void 0?i:null}return null}static getComponentName(e){var t,n,i=(t=(n=e.WrappedComponent)===null||n===void 0?void 0:n.displayName)!==null&&t!==void 0?t:e.displayName;if(i==null)throw new Error("Component displayName not defined ".concat(e));return i}static focusElement(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:F.DEFAULT_FOCUS_SELECTOR;if(e==null)return null;var n=e.querySelector(t);return n==null?null:(zi(n)&&n.focus(),n)}static onInitialized(e){return new Promise(t=>{if(e.isInitialised){t();return}var n=()=>{e.off("initialised",n),t()};e.on("initialised",n)})}}kf(F,"DEFAULT_FOCUS_SELECTOR","input, select, textarea, button");var Uf=X.forwardRef((r,e)=>{var t=F.getComponentNameFromPanel({props:r});return u.jsx("div",{ref:e,className:"panel-placeholder",children:u.jsxs("div",{children:['Component "',t,'" is not registered.']})})});Uf.displayName="PanelPlaceholder";const te=Object.freeze({FOCUS:"PanelEvent.FOCUS",MOUNT:"PanelEvent.MOUNT",UNMOUNT:"PanelEvent.UNMOUNT",TITLE_CHANGED:"PanelEvent.TITLE_CHANGED",REOPEN:"PanelEvent.REOPEN",DELETE:"PanelEvent.DELETE",CLONED:"PanelEvent.CLONED",CLOSED:"PanelEvent.CLOSED",OPEN:"PanelEvent.OPEN",CLOSE:"PanelEvent.CLOSE",DRAGGING:"PanelEvent.DRAGGING",DROPPED:"PanelEvent.DROPPED"});function vi(r){return(r==null?void 0:r.WrappedComponent)!==void 0}function Hf(r){return typeof r.id=="string"&&r.layout instanceof jf&&r.panelManager instanceof Ka&&typeof r.registerComponent=="function"}function Kn(r){if(!Hf(r))throw new Error("Expected dashboard plugin props, but instead received ".concat(r))}function lu(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,n)}return t}function du(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?lu(Object(t),!0).forEach(function(n){pn(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):lu(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function pn(r,e,t){return e=D0(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function D0(r){var e=x0(r,"string");return typeof e=="symbol"?e:String(e)}function x0(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}var bt=B.module("PanelManager");class Ka{constructor(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:(o,l)=>l,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:(o,l)=>l,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:new Map,a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:[],s=arguments.length>5&&arguments[5]!==void 0?arguments[5]:()=>{};pn(this,"layout",void 0),pn(this,"hydrateComponent",void 0),pn(this,"dehydrateComponent",void 0),pn(this,"onPanelsUpdated",void 0),pn(this,"closed",void 0),pn(this,"openedMap",void 0),this.handleFocus=this.handleFocus.bind(this),this.handleMount=this.handleMount.bind(this),this.handleUnmount=this.handleUnmount.bind(this),this.handleReopen=this.handleReopen.bind(this),this.handleDeleted=this.handleDeleted.bind(this),this.handleClosed=this.handleClosed.bind(this),this.handleControlClose=this.handleControlClose.bind(this),this.layout=e,this.hydrateComponent=t,this.dehydrateComponent=n,this.onPanelsUpdated=s,this.openedMap=new Map(i),this.closed=[...a],this.startListening()}startListening(){var{eventHub:e}=this.layout;e.on(te.FOCUS,this.handleFocus),e.on(te.MOUNT,this.handleMount),e.on(te.UNMOUNT,this.handleUnmount),e.on(te.REOPEN,this.handleReopen),e.on(te.DELETE,this.handleDeleted),e.on(te.CLOSED,this.handleClosed),e.on(te.CLOSE,this.handleControlClose)}stopListening(){var{eventHub:e}=this.layout;e.off(te.FOCUS,this.handleFocus),e.off(te.MOUNT,this.handleMount),e.off(te.UNMOUNT,this.handleUnmount),e.off(te.REOPEN,this.handleReopen),e.off(te.DELETE,this.handleDeleted),e.off(te.CLOSED,this.handleClosed),e.off(te.CLOSE,this.handleControlClose)}getClosedPanelConfigsOfType(e){return this.closed.filter(t=>t.component===e)}getOpenedPanels(){return Array.from(this.openedMap.values())}getOpenedPanelConfigs(){return this.getOpenedPanels().map(e=>{var{glContainer:t}=e.props;return F.getComponentConfigFromContainer(t)})}getOpenedPanelConfigsOfType(e){return this.getOpenedPanelConfigs().filter(t=>t!=null&&dr(t)&&t.component===e)}getOpenedPanelById(e){return this.openedMap.get(e)}getContainerByPanelId(e){var t,n=F.getStackForConfig(this.layout.root,{id:e});return(t=n&&F.getContentItemInStack(n,{id:e}))!==null&&t!==void 0?t:null}getLastUsedPanel(e){for(var t=this.getOpenedPanels(),n=t.length-1;n>=0;n-=1){var i=t[n];if(e==null||e(i))return i}}getLastUsedPanelOfType(e){return this.getLastUsedPanelOfTypes([e])}getLastUsedPanelOfTypes(e){return this.getLastUsedPanel(t=>e.some(n=>vi(n)&&t instanceof n.WrappedComponent||!vi(n)&&t instanceof n))}updatePanel(e){var t=F.getIdFromPanel(e);if(t==null){bt.error("updatePanel Panel did not have an ID",e);return}bt.debug2("Updating panel ID ".concat(t," in open panels map")),this.openedMap.delete(t),this.openedMap.set(t,e)}removePanel(e){var t=F.getIdFromPanel(e);if(t==null){bt.error("removePanel Panel did not have an ID",e);return}if(!this.openedMap.has(t)){bt.error("Missing panel ID ".concat(t," in open panels map"));return}if(this.openedMap.get(t)!==e){bt.debug("Panel argument doesn't match the open panels map entry for ".concat(t,", removePanel ignored"));return}bt.debug2("Removing panel ID ".concat(t," from open panels map")),this.openedMap.delete(t)}removeClosedPanelConfig(e){var t=this.closed.findIndex(n=>n===e||n.id!=null&&e.id!=null&&n.id===e.id);t>=0&&this.closed.splice(t,1)}handleFocus(e){bt.debug2("Focus: ",e),this.updatePanel(e)}handleMount(e){bt.debug2("Mount: ",e),this.updatePanel(e),this.sendUpdate()}handleUnmount(e){bt.debug2("Unmount: ",e),this.removePanel(e),this.sendUpdate()}handleReopen(e,t){bt.debug2("Reopen:",e,t),this.removeClosedPanelConfig(e);var{component:n}=e,{props:i}=e;i=this.hydrateComponent(n,i);var a=du(du({},e),{},{props:i}),{root:s}=this.layout;F.openComponent({root:s,config:a,replaceConfig:t})}handleDeleted(e){bt.debug2("Deleted:",e),this.removeClosedPanelConfig(e),this.sendUpdate()}handleClosed(e,t){bt.debug2("Closed: ",e),this.addClosedPanel(t),this.sendUpdate()}handleControlClose(e){var t={id:e},{root:n}=this.layout;F.closeComponent(n,t)}addClosedPanel(e){var t=F.getComponentConfigFromContainer(e);if(t&&dr(t)){var n=this.dehydrateComponent(t.component,t);n!=null&&this.closed.push(n)}}sendUpdate(){var{closed:e,openedMap:t}=this;this.onPanelsUpdated({closed:[...e],openedMap:new Map(t)})}}pn(Ka,"MAX_CLOSED_PANEL_COUNT",100);var I0=B.module("PanelErrorBoundary");class Vf extends v.Component{constructor(e){super(e),this.state={error:null}}componentDidCatch(e){this.setState({error:e})}componentWillUnmount(){var{glContainer:e,glEventHub:t}=this.props,n=F.getIdFromContainer(e);I0.debug("componentWillUnmount",n),t.emit(te.CLOSED,n,e)}render(){var{children:e}=this.props,{error:t}=this.state;return t!=null?u.jsx("div",{className:"panel-error-boundary",children:u.jsx(tt,{errorMessage:"".concat(t),isLoading:!1,isLoaded:!1})}):e}}function uu(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,n)}return t}function ya(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?uu(Object(t),!0).forEach(function(n){N0(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):uu(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function N0(r,e,t){return e=M0(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function M0(r){var e=L0(r,"string");return typeof e=="symbol"?e:String(e)}function L0(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}function qa(r){var{props:e,componentState:t}=r,{metadata:n}=e,{panelState:i=null}=e;t&&({panelState:i}=t);var a={};return n!=null&&(a.metadata=n),i!=null&&(a.panelState=i),ya(ya({},r),{},{componentState:null,props:a,type:"react-component"})}function Ya(r){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";return ya(ya({},r),{},{localDashboardId:e})}function bl(r){var e=vi(r)&&r.WrappedComponent.prototype!=null&&r.WrappedComponent.prototype.isReactComponent!=null||r.prototype!=null&&r.prototype.isReactComponent!=null,t=!vi(r)&&"$$typeof"in r&&r.$$typeof===Vm.ForwardRef;return e||t}const Bf={dehydrate:qa,hydrate:Ya};var Xa=X.createContext(void 0),F0=_.shape({on:_.func,off:_.func,isHidden:_.bool,tab:_.shape({header:_.shape({tabs:_.arrayOf(_.shape({contentItem:_.shape({})}))})}),title:_.string,setTitle:_.func,close:_.func}),Wf=_.shape({on:_.func,off:_.func,emit:_.func}),A0=_.shape({registerComponent:_.func,root:_.shape({addChild:_.func}),on:_.func,off:_.func,eventHub:Wf}),Za=Object.freeze({Container:F0,EventHub:Wf,Layout:A0});function ce(r,e,t){v.useEffect(function(){return r.on(e,t),()=>{r.off(e,t)}},[r,e,t])}function An(r,e,t,n){var i,a=(i=e.COMPONENT)!==null&&i!==void 0?i:e.displayName;if(a==null)throw new Error("ComponentType must have a `COMPONENT` or `displayName` attribute.");X.useEffect(()=>{var s=r(a,e,t,n);return()=>{s()}},[e,n,t,a,r])}function R0(r){var{dashboardProps:e,componentName:t,component:n,supportedTypes:i,hydrate:a,dehydrate:s}=r,{id:o,layout:l,registerComponent:d}=e,h=v.useCallback(c=>{var{dragEvent:f,panelId:p=Ee.generate(),widget:m}=c,{name:b,type:g}=m,C=g!=null&&(Array.isArray(i)&&i.includes(g)||g===i);if(C){var y={localDashboardId:o,metadata:m};a!=null&&(y=a(y,o));var S={type:"react-component",component:t,props:y,title:b,id:p},{root:w}=l;F.openComponent({root:w,config:S,dragEvent:f})}},[t,a,o,l,i]);An(d,n,a,s),ce(l.eventHub,te.OPEN,h)}function j0(){var r=v.useContext(Xa);if(r==null)throw new Error("LayoutManager not available, did you add a LayoutManagerContext.Provider to the tree?");return r}function hu(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,n)}return t}function k0(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?hu(Object(t),!0).forEach(function(n){$0(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):hu(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function $0(r,e,t){return e=U0(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function U0(r){var e=H0(r,"string");return typeof e=="symbol"?e:String(e)}function H0(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}var V0=Object.freeze({}),B0=new Map,Gf=r=>r.api,W0=r=>r.user,zf=r=>r.storage,Kf=r=>zf(r).commandHistoryStorage,qf=r=>zf(r).fileStorage,G0=r=>r.defaultWorkspaceSettings,Yf=r=>{var{workspace:e}=r;return e},Ii=r=>{for(var e=Yf(r).data.settings,t=k0({},G0(r)),n=Object.keys(e),i=0;i<n.length;i+=1){var a=n[i];e[a]!==void 0&&(t[a]=e[a])}return t},Cl=r=>Ii(r).timeZone,z0=r=>{var e;return(e=Ii(r).defaultNotebookSettings)!==null&&e!==void 0?e:V0},Sl=r=>r.activeTool,K0=r=>{var e;return(e=r.plugins)!==null&&e!==void 0?e:B0},Xf="SET_ACTIVE_TOOL",q0="SET_API",Y0="SET_COMMAND_HISTORY_STORAGE",X0="SET_FILE_STORAGE",Z0="SET_PLUGINS",Q0="SET_USER",Zf="SET_WORKSPACE",J0="SET_DEFAULT_WORKSPACE_SETTINGS",e_="SET_WORKSPACE_STORAGE",t_="SET_SERVER_CONFIG_VALUES";function cu(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,n)}return t}function Nn(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?cu(Object(t),!0).forEach(function(n){n_(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):cu(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function n_(r,e,t){return e=r_(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function r_(r){var e=i_(r,"string");return typeof e=="symbol"?e:String(e)}function i_(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}var a_=r=>({type:Zf,payload:r}),s_=r=>(e,t)=>{e(a_(r));var{storage:n}=t(),{workspaceStorage:i}=n;return i.save(r)},Qf=r=>(e,t)=>{var{workspace:n}=t(),{data:i}=n,a=Nn(Nn({},n),{},{data:Nn(Nn(Nn({},i),r),{},{settings:Nn(Nn({},i.settings),r.settings)})});return e(s_(a))},o_=r=>e=>e(Qf({settings:r})),Jf=r=>({type:Xf,payload:r});function vu(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,n)}return t}function Ds(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?vu(Object(t),!0).forEach(function(n){l_(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):vu(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function l_(r,e,t){return e=d_(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function d_(r){var e=u_(r,"string");return typeof e=="symbol"?e:String(e)}function u_(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}function ep(r,e){return function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:e,n=arguments.length>1?arguments[1]:void 0;switch(n.type){case r:{var i=n.payload;return i==null?null:t!=null?Ds(Ds({},t),i):Ds({},i)}default:return t}}}function fu(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,n)}return t}function pu(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?fu(Object(t),!0).forEach(function(n){h_(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):fu(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function h_(r,e,t){return e=c_(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function c_(r){var e=v_(r,"string");return typeof e=="symbol"?e:String(e)}function v_(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}function f_(r){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;return function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:e,i=arguments.length>1?arguments[1]:void 0;switch(i.type){case r:{var{id:a,payload:s}=i;return t&&Mt({payload:s},{payload:n[a]})?n:pu(pu({},n),{},{[a]:s})}default:return n}}}function On(r,e){return function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:e,n=arguments.length>1?arguments[1]:void 0;switch(n.type){case r:return n.payload;default:return t}}}const p_=On(q0,null),m_=On(Xf,null),g_=On(Z0,null),b_=On(Y0,null),C_=On(X0,null),S_=On(e_,null),y_=_o({commandHistoryStorage:b_,fileStorage:C_,workspaceStorage:S_}),E_=ep(Q0,null),w_=ep(Zf,null),P_=On(J0,null),__=On(t_,null);var T_={activeTool:m_,api:p_,plugins:g_,storage:y_,user:E_,workspace:w_,defaultWorkspaceSettings:P_,serverConfigValues:__};const O_=T_;function mu(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,n)}return t}function gu(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?mu(Object(t),!0).forEach(function(n){co(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):mu(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function co(r,e,t){return e=D_(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function D_(r){var e=x_(r,"string");return typeof e=="symbol"?e:String(e)}function x_(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class I_{constructor(){co(this,"reducers",{}),co(this,"listener",null)}register(e,t){var n;this.reducers=gu(gu({},this.reducers),{},{[e]:t}),(n=this.listener)===null||n===void 0||n.call(this,this.reducers)}setListener(e){this.listener=e}}var N_=new I_;const Qa=N_;var bu=B.module("redux-logger"),M_=r=>e=>t=>{bu.debug("dispatching",t);var n=e(t);return bu.debug("next state",r.getState()),n};const L_=M_;var F_=B.module("redux-crashReporter"),A_=r=>e=>t=>{try{return e(t)}catch(n){throw F_.error("Error executing",t," with state ",r.getState(),":",n),n}};const R_=A_,j_=[L_,R_,Bm];var xs;Object.entries(O_).map(r=>{var[e,t]=r;return Qa.register(e,t)});var k_=(xs=window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__)!==null&&xs!==void 0?xs:zm,tp=Wm(_o(Qa.reducers),k_(Gm(...j_)));Qa.setListener(r=>{tp.replaceReducer(_o(r))});const $_=tp;var yl="SET_DASHBOARD_DATA";const U_=f_(yl,{},!1),np={dashboardData:U_};var H_=new Map,rp=Object.freeze({}),V_=Object.freeze([]),ip=r=>r.dashboardData,Ve=(r,e)=>{var t;return(t=ip(r)[e])!==null&&t!==void 0?t:rp},ap=(r,e)=>{var t;return(t=Ve(r,e).closed)!==null&&t!==void 0?t:V_},El=(r,e)=>{var t;return(t=Ve(r,e).openedMap)!==null&&t!==void 0?t:H_},wl=(r,e)=>{var t;return(t=Ve(r,e).pluginDataMap)!==null&&t!==void 0?t:rp},sp=(r,e,t)=>wl(r,e)[t];function Cu(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,n)}return t}function ur(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Cu(Object(t),!0).forEach(function(n){B_(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):Cu(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function B_(r,e,t){return e=W_(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function W_(r){var e=G_(r,"string");return typeof e=="symbol"?e:String(e)}function G_(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}var Pl=(r,e)=>({type:yl,id:r,payload:e}),At=(r,e)=>(t,n)=>t(Pl(r,ur(ur({},Ve(n(),r)),e))),op=(r,e,t)=>(n,i)=>n(Pl(r,ur(ur({},Ve(i(),r)),{},{pluginDataMap:ur(ur({},wl(i(),r)),{},{[e]:t})})));function z_(r,e){var t=mi(),n=fc(a=>sp(a,r,e)),i=v.useCallback(a=>t(op(r,e,a)),[r,e,t]);return[n,i]}Object.entries(np).map(r=>{var[e,t]=r;return Qa.register(e,t)});function K_(r){var{children:e}=r;return u.jsx(u.Fragment,{children:e})}function Su(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,n)}return t}function zr(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Su(Object(t),!0).forEach(function(n){q_(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):Su(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function q_(r,e,t){return e=Y_(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Y_(r){var e=X_(r,"string");return typeof e=="symbol"?e:String(e)}function X_(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}var Ki=B.module("DashboardLayout"),Z_=Object.freeze({}),Q_=[],yu=()=>{},Eu=r=>r;function _l(r){var e,t,{id:n,children:i,emptyDashboard:a=u.jsx("div",{children:"Dashboard is empty."}),layout:s,layoutConfig:o=Q_,onLayoutChange:l=yu,onLayoutInitialized:d=yu,hydrate:h=Ya,dehydrate:c=qa,panelWrapper:f=K_}=r,p=mi(),m=(e=fc(P=>Ve(P,n)))!==null&&e!==void 0?e:Z_,[b,g]=v.useState(!1),[C,y]=v.useState(!1),[S,w]=v.useState(),[E]=v.useState((t=m==null?void 0:m.closed)!==null&&t!==void 0?t:[]),[x,D]=v.useState(!1),[T,I]=v.useState(s.getReactChildren()),j=v.useMemo(()=>new Map,[]),W=v.useMemo(()=>new Map,[]),L=v.useCallback(function(P,R){var U,Q=arguments.length>2&&arguments[2]!==void 0?arguments[2]:h,me=arguments.length>3&&arguments[3]!==void 0?arguments[3]:c;Ki.debug2("registerComponent",P,R,Q,me);function $(ie,ve){var we=R,Hr=f,Qn=bl(we),{glContainer:Vr,glEventHub:In}=ie;return u.jsx(Vf,{glContainer:Vr,glEventHub:In,children:u.jsx(Hr,zr(zr({},ie),{},{children:Qn?u.jsx(we,zr(zr({},ie),{},{ref:ve})):u.jsx(we,zr({},ie))}))})}$.displayName="DashboardWrapper(".concat((U=R.displayName)!==null&&U!==void 0?U:P,")");var J=s.registerComponent(P,X.forwardRef($));return j.set(P,Q),W.set(P,me),J},[h,c,j,W,s,f]),O=v.useCallback((P,R)=>{var U;return((U=j.get(P))!==null&&U!==void 0?U:Eu)(R,n)},[j,n]),M=v.useCallback((P,R)=>{var U;return((U=W.get(P))!==null&&U!==void 0?U:Eu)(R,n)},[W,n]),A=v.useMemo(()=>new Ka(s,O,M,new Map,E,P=>{var{closed:R,openedMap:U}=P;p(At(n,{closed:R,openedMap:U}))}),[M,p,O,n,E,s]),k=v.useCallback(()=>{if(!C){x||(d(),D(!0));var P=s.toConfig(),R=P.content,U=F.dehydrateLayoutConfig(R,M),Q=S==null||!F.isEqual(S,U);Ki.debug("handleLayoutStateChanged",Q,R,U),Q&&(g(s.root.contentItems.length===0),w(U),l(U),I(s.getReactChildren()))}},[M,x,C,S,s,l,d]),H=v.useCallback(P=>{var R=F.getIdFromContainer(P);s.eventHub.emit(te.DRAGGING,R),y(!0)},[s.eventHub]),q=v.useCallback(P=>{var R=F.getIdFromContainer(P);s.eventHub.emit(te.DROPPED,R),y(!1)},[s.eventHub]),re=v.useCallback(P=>{if(Ki.debug2("handleComponentCreated",P),!(P==null||P.config==null||P.config.component==null||P.element==null)){var R=P.config.component.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),U="".concat(R,"-component");P.element.addClass(U)}},[]),V=v.useCallback(()=>{I(s.getReactChildren())},[s]);ce(s,"stateChanged",k),ce(s,"itemPickedUp",H),ce(s,"itemDropped",q),ce(s,"componentCreated",re),ce(s.eventHub,te.TITLE_CHANGED,k),ce(s,"reactChildrenChanged",V);var N=Tc(o);return v.useEffect(function(){if(N!==o&&o!==S){Ki.debug("Setting new layout content...");for(var R=F.hydrateLayoutConfig(o,O);s.root.contentItems.length>0;)s.root.contentItems[0].remove();for(var U=0;U<R.length;U+=1)s.root.addChild(R[U]);g(s.root.contentItems.length===0)}},[O,s,o,S,A,N]),u.jsxs(u.Fragment,{children:[b&&a,T,X.Children.map(i,P=>P!=null?X.cloneElement(P,{id:n,layout:s,panelManager:A,registerComponent:L}):null)]})}_l.propTypes={id:_.string.isRequired,children:_.node,data:_.shape({}),emptyDashboard:_.node,layout:Za.Layout.isRequired,layoutConfig:_.arrayOf(_.shape({})),onLayoutChange:_.func,onLayoutInitialized:_.func};function wu(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,n)}return t}function J_(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?wu(Object(t),!0).forEach(function(n){eT(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):wu(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function eT(r,e,t){return e=tT(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function tT(r){var e=nT(r,"string");return typeof e=="symbol"?e:String(e)}function nT(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}var rT=100,Is=()=>{},iT=Object.freeze({});function vo(r){var{id:e="default",children:t,emptyDashboard:n,layoutConfig:i,layoutSettings:a=iT,onLayoutConfigChange:s=Is,onGoldenLayoutChange:o=Is,onLayoutInitialized:l=Is,fallbackComponent:d=Uf,hydrate:h,dehydrate:c,panelWrapper:f}=r,p=v.useRef(null),[m,b]=v.useState(!1),[g,C]=v.useState();v.useEffect(function(){if(!p.current){C(void 0);return}var w=J_({},F.makeDefaultLayout());w.settings===void 0&&(w.settings={}),Object.assign(w.settings,a),w.content=[];var E=new jf(w,p.current),x=()=>{E.off("initialised",x),b(!0)};return E.on("initialised",x),d!=null&&E.setFallbackComponent(d),E.init(),C(E),o(E),()=>{E.destroy()}},[a,d,o,b,C]);var y=v.useMemo(()=>gi(()=>{g!=null&&g.isInitialised&&(g==null||g.updateSize())},rT),[g]);return Vo(p.current,y),u.jsxs("div",{className:"dashboard-container w-100 h-100",children:[u.jsx("div",{className:"w-100 h-100",ref:p}),m&&g&&u.jsx(Xa.Provider,{value:g,children:u.jsx(_l,{emptyDashboard:n,id:e,layout:g,layoutConfig:i,onLayoutChange:s,onLayoutInitialized:l,hydrate:h,dehydrate:c,panelWrapper:f,children:t})})]})}var Tl="default",Ol="CREATE_DASHBOARD";function aT(r,e){r.on(Ol,e)}function sT(r,e){r.emit(Ol,e)}var oT=["id","isActive","plugins"];function Pu(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,n)}return t}function _u(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Pu(Object(t),!0).forEach(function(n){lT(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):Pu(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function lT(r,e,t){return e=dT(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function dT(r){var e=uT(r,"string");return typeof e=="symbol"?e:String(e)}function uT(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}function hT(r,e){if(r==null)return{};var t=cT(r,e),n,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(r);for(i=0;i<a.length;i++)n=a[i],!(e.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(r,n)&&(t[n]=r[n])}return t}function cT(r,e){if(r==null)return{};var t={},n=Object.keys(r),i,a;for(a=0;a<n.length;a++)i=n[a],!(e.indexOf(i)>=0)&&(t[i]=r[i]);return t}function vT(r){var{id:e,isActive:t,plugins:n}=r,i=hT(r,oT),[a,s]=v.useState(t),o=mi(),l=v.useCallback(d=>{o(e===Tl?Qf({layoutConfig:d}):At(e,{layoutConfig:d}))},[e,o]);return!a&&t&&s(!0),a?u.jsx(vo,_u(_u({id:e,onLayoutConfigChange:l},i),{},{children:n})):u.jsx(tt,{})}const fT=Object.freeze(Object.defineProperty({__proto__:null,CREATE_DASHBOARD:Ol,DEFAULT_DASHBOARD_ID:Tl,Dashboard:vo,DashboardLayout:_l,DashboardUtils:Bf,GLPropTypes:Za,LayoutManagerContext:Xa,LayoutUtils:F,LazyDashboard:vT,PanelErrorBoundary:Vf,PanelEvent:te,PanelManager:Ka,SET_DASHBOARD_DATA:yl,assertIsDashboardPluginProps:Kn,canHaveRef:bl,default:vo,dehydrate:qa,emitCreateDashboard:sT,getAllDashboardsData:ip,getClosedPanelsForDashboard:ap,getDashboardData:Ve,getOpenedPanelMapForDashboard:El,getPluginDataForDashboard:sp,getPluginDataMapForDashboard:wl,hydrate:Ya,isDashboardPluginProps:Hf,isWrappedComponent:vi,listenForCreateDashboard:aT,reducers:np,setDashboardData:Pl,setDashboardPluginData:op,updateDashboardData:At,useDashboardPanel:R0,useDashboardPluginData:z_,useLayoutManager:j0,useListener:ce,usePanelRegistration:An},Symbol.toStringTag,{value:"Module"}));function pT(r){var{type:e}=r,t=He();switch(e){case t.VariableType.TABLE:case t.VariableType.TABLEMAP:case t.VariableType.TREETABLE:case t.VariableType.HIERARCHICALTABLE:case t.VariableType.PARTITIONEDTABLE:return u.jsx(ne,{icon:xo});case t.VariableType.FIGURE:return u.jsx(ne,{icon:Do});case t.VariableType.PANDAS:return u.jsx(ne,{icon:Sc});default:return u.jsx(ne,{icon:Cc})}}function Tu(r,e,t,n,i,a,s){try{var o=r[a](s),l=o.value}catch(d){t(d);return}o.done?e(l):Promise.resolve(l).then(n,i)}function mT(r){return function(){var e=this,t=arguments;return new Promise(function(n,i){var a=r.apply(e,t);function s(l){Tu(a,n,i,s,o,"next",l)}function o(l){Tu(a,n,i,s,o,"throw",l)}s(void 0)})}}function Ja(r){var{children:e,language:t}=r,[n,i]=v.useState(null),{activeThemes:a}=Rr();return v.useEffect(()=>{var s=!1;function o(){return l.apply(this,arguments)}function l(){return l=mT(function*(){if(e!=null&&a!=null){var d=yield Uo.colorize(e.toString(),t,{});s||i(d)}}),l.apply(this,arguments)}return o(),()=>{s=!0}},[a,e,t]),u.jsx("div",{style:{pointerEvents:"none"},dangerouslySetInnerHTML:n!=null?{__html:n}:void 0})}class gT{static get LANGUAGE_MAP(){return new Map([["python","Python"],["groovy","Groovy"],["scala","Scala"]])}}const lp=gT;class Ea{static hasComment(e){return e.comment!==void 0}static hasPattern(e){return e.pattern!==void 0}static hasOp(e){return e.op!==void 0}static parseArguments(e){return e==null||!(typeof e=="string"||e instanceof String)?[]:Km.parse(e).filter(t=>!this.hasComment(t)).map(t=>this.hasPattern(t)?t.pattern:this.hasOp(t)?t.op:"".concat(t))}static formatTimestamp(e){if(e==null||!(e instanceof Date))return null;var t="".concat(e.getHours()).padStart(2,"0"),n="".concat(e.getMinutes()).padStart(2,"0"),i="".concat(e.getSeconds()).padStart(2,"0"),a="".concat(e.getMilliseconds()).padStart(3,"0");return"".concat(t,":").concat(n,":").concat(i,".").concat(a)}static isTableType(e,t){return t===e.VariableType.TABLE||t===e.VariableType.TREETABLE||t===e.VariableType.HIERARCHICALTABLE||t===e.VariableType.PARTITIONEDTABLE}static isWidgetType(e,t){return t===e.VariableType.FIGURE||t===e.VariableType.OTHERWIDGET||t===e.VariableType.PANDAS}static isOpenableType(e,t){return Ea.isTableType(e,t)||Ea.isWidgetType(e,t)}static isFigureType(e,t){return t===e.VariableType.FIGURE}static isPandas(e,t){return t===e.VariableType.PANDAS}}const fo=Ea;function dp(r){var{children:e}=r;return u.jsxs("div",{className:"console-history-item-result",children:[u.jsx("div",{className:"console-history-gutter",children:"-"}),u.jsx("div",{className:"console-history-content",children:e})]})}dp.propTypes={children:_.node.isRequired};function po(r,e,t){return e=bT(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function bT(r){var e=CT(r,"string");return typeof e=="symbol"?e:String(e)}function CT(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class up extends v.Component{constructor(e){super(e),po(this,"timer",void 0),po(this,"startTime",void 0),this.updateElapsed=this.updateElapsed.bind(this),this.startTime=Date.now(),this.state={elapsed:0}}componentDidMount(){this.timer=setInterval(this.updateElapsed,1e3)}componentWillUnmount(){this.timer&&clearInterval(this.timer),this.timer=void 0}updateElapsed(){this.setState({elapsed:Math.round((Date.now()-this.startTime)/1e3)})}render(){var{disabled:e,onCancelClick:t}=this.props,{elapsed:n}=this.state;return u.jsx("div",{className:Y("console-history-result-in-progress",{disabled:e}),children:u.jsxs("span",{className:"badge",children:[u.jsx(Fa,{className:"ml-2"}),"Running... ",cr.formatElapsedTime(n)," ",u.jsx(K,{className:"console-history-result-in-progress-cancel",kind:"ghost",icon:To,tooltip:"Cancel",onClick:t,disabled:e})]})})}}po(up,"defaultProps",{disabled:!1});const ST=up;function oi(r,e,t){return e=yT(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function yT(r){var e=ET(r,"string");return typeof e=="symbol"?e:String(e)}function ET(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class Or extends v.PureComponent{constructor(e){super(e),oi(this,"mouseX",void 0),oi(this,"mouseY",void 0),oi(this,"isClicking",void 0),this.handleKeyPress=this.handleKeyPress.bind(this),this.handleMouseDown=this.handleMouseDown.bind(this),this.handleMouseMove=this.handleMouseMove.bind(this),this.handleMouseUp=this.handleMouseUp.bind(this),this.handleToggleError=this.handleToggleError.bind(this),this.handleMouseEnter=this.handleMouseEnter.bind(this),this.handleMouseLeave=this.handleMouseLeave.bind(this),this.mouseX=null,this.mouseY=null,this.isClicking=!1,this.state={isExpanded:!1,isTriggerHovered:!1}}handleKeyPress(e){switch(e.key){case"Enter":case" ":this.handleToggleError(),e.stopPropagation(),e.preventDefault();break}}handleMouseDown(e){this.mouseX=e.clientX,this.mouseY=e.clientY,this.isClicking=!0}handleMouseMove(e){this.mouseX!=null&&this.mouseY!=null?(Math.abs(e.clientX-this.mouseX)>=Or.mouseDragThreshold||Math.abs(e.clientY-this.mouseY)>=Or.mouseDragThreshold)&&(this.isClicking=!1):this.isClicking&&(this.isClicking=!1)}handleMouseUp(e){this.isClicking&&!e.shiftKey&&!e.metaKey&&!e.altKey&&this.handleToggleError(),this.mouseX=null,this.mouseY=null,this.isClicking=!1}handleToggleError(){this.setState(e=>({isExpanded:!e.isExpanded}))}handleMouseEnter(){this.setState({isTriggerHovered:!0})}handleMouseLeave(){this.setState({isTriggerHovered:!1})}render(){var{isExpanded:e,isTriggerHovered:t}=this.state,{message:n}=this.props;G(n);var i=n.indexOf(`
|
|
4
4
|
`),a=i>-1,s=n;a&&(s=n.slice(0,i));var o=n.slice(i),l=t?"error-btn-link error-btn-link--active":"error-btn-link";return u.jsxs("div",{className:Y("error-message",{expanded:e}),children:[a&&u.jsxs(u.Fragment,{children:[u.jsx("div",{className:"error-gutter",children:u.jsx("button",{type:"button",onClick:this.handleToggleError,className:l,tabIndex:-1,children:u.jsx(ne,{icon:e?sr:Ag,transform:"left-3"})})}),u.jsxs("div",{className:"error-content",children:[u.jsx("div",{className:"console-error-text-trigger",role:"button",tabIndex:0,onKeyPress:this.handleKeyPress,onMouseDown:this.handleMouseDown,onMouseMove:this.handleMouseMove,onMouseEnter:this.handleMouseEnter,onMouseLeave:this.handleMouseLeave,onMouseUp:this.handleMouseUp,children:s}),e?o:""]})]}),!a&&u.jsx("div",{className:"error-content",children:u.jsx("div",{className:"console-error-text",children:s})})]},"error")}}oi(Or,"defaultProps",{message:""});oi(Or,"mouseDragThreshold",5);const wT=Or;function PT(r,e,t){return e=_T(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function _T(r){var e=TT(r,"string");return typeof e=="symbol"?e:String(e)}function TT(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}var Ou=B.module("ConsoleHistoryItem");class hp extends v.PureComponent{constructor(e){super(e),this.handleCancelClick=this.handleCancelClick.bind(this),this.handleObjectClick=this.handleObjectClick.bind(this)}handleObjectClick(e){Ou.debug("handleObjectClick",e);var{openObject:t}=this.props;t(e)}handleCancelClick(){var{item:e}=this.props;e!=null&&e.cancelResult&&(Ou.debug("Cancelling command: ".concat(e.command)),e.cancelResult())}render(){var{disabled:e,item:t,language:n,iconForType:i}=this.props,{disabledObjects:a,result:s}=t,o=t.command!=null&&t.command!=="",l=null;o&&(l=u.jsxs("div",{className:"console-history-item-command",children:[u.jsx("div",{className:"console-history-gutter",children:">"}),u.jsx("div",{className:"console-history-content",children:u.jsx(Ja,{language:n,children:t.command})})]}));var d=[],h=!1;if(s){var{error:c,message:f,changes:p}=s;if(p){var{created:m,updated:b}=p;[...m,...b].forEach(x=>{h=!0;var{title:D}=x,T="".concat(D),I=e===void 0||e||(a??[]).indexOf(T)>=0,j=u.jsx(K,{kind:"primary",onClick:()=>this.handleObjectClick(x),className:"btn-console-object",disabled:I,icon:i(x.type),children:D},T);d.push(j)})}if(c!=null&&!o){var g,C="".concat((g=c.message)!==null&&g!==void 0?g:c);C||(C=c);var y=u.jsx(wT,{message:C},"result-error");d.push(y)}if(f!==void 0&&f!==""){var S=u.jsx("div",{className:"log-message",children:f},"log-message");d.push(S)}}else{h=!0;var w=u.jsx(ST,{onCancelClick:this.handleCancelClick,disabled:e},"in_progress");d.push(w)}var E=null;return d.length>0&&(E=u.jsx(dp,{children:d})),u.jsxs("div",{className:Y("console-command-result",{"console-result-buttons":h}),children:[l,E]})}}PT(hp,"defaultProps",{disabled:!1});const OT=hp;function DT(r,e){return"".concat(r,".").concat(e.command,".").concat(e.result&&e.result.message,".").concat(e.result&&e.result.error)}function xT(r){for(var{disabled:e=!1,items:t,language:n,openObject:i,supportsType:a,iconForType:s}=r,o=[],l=0;l<t.length;l+=1){var d=t[l],h=u.jsx(OT,{disabled:e,item:d,openObject:i,language:n,supportsType:a,iconForType:s},DT(l,d));o.push(h)}return u.jsx("div",{className:"container-fluid console-history",children:o})}var IT={name:"Console",CLEAR:Ke.createAndAdd({id:"CONSOLE.CLEAR",name:"Clear",shortcut:[pe.CTRL,fe.L],macShortcut:[pe.CTRL,fe.C]}),FOCUS_HISTORY:Ke.createAndAdd({id:"CONSOLE.FOCUS_HISTORY",name:"Focus History",shortcut:[pe.CTRL,fe.H],macShortcut:[pe.CTRL,pe.OPTION,fe.H]})},NT={name:"Command History",FOCUS_HISTORY:Ke.createAndAdd({id:"COMMAND_HISTORY.FOCUS_HISTORY",name:"Focus History Search",shortcut:[pe.CTRL,fe.H],macShortcut:[pe.CTRL,pe.OPTION,fe.H]}),SEND_TO_CONSOLE:Ke.createAndAdd({id:"COMMAND_HISTORY.SEND_TO_CONSOLE",name:"Send to Console",shortcut:[fe.ENTER],macShortcut:[fe.ENTER]}),SEND_TO_NOTEBOOK:Ke.createAndAdd({id:"COMMAND_HISTORY.SEND_TO_NOTEBOOK",name:"Send to Notebook",shortcut:[pe.CTRL,fe.ENTER],macShortcut:[pe.CMD,fe.ENTER]}),RUN:Ke.createAndAdd({id:"COMMAND_HISTORY.RUN",name:"Run",shortcut:[pe.ALT,fe.R],macShortcut:[pe.OPTION,fe.R]})},MT={name:"Notebook",RUN:Ke.createAndAdd({id:"NOTEBOOK.RUN",name:"Run",shortcut:[pe.ALT,fe.R],macShortcut:[pe.OPTION,fe.R]}),RUN_SELECTED:Ke.createAndAdd({id:"NOTEBOOK.RUN_SELECTED",name:"Run Selected",shortcut:[pe.ALT,pe.SHIFT,fe.R],macShortcut:[pe.OPTION,pe.SHIFT,fe.R]}),FIND:Ke.createAndAdd({id:"NOTEBOOK.FIND",name:"Find",shortcut:[pe.CTRL,fe.F],macShortcut:[pe.CMD,fe.F],isEditable:!1}),MINIMAP:Ke.createAndAdd({id:"NOTEBOOK.MINIMAP",name:"Show Minimap",shortcut:[pe.ALT,fe.M],macShortcut:[pe.OPTION,fe.M]}),WORDWRAP:Ke.createAndAdd({id:"NOTEBOOK.WORDWRAP",name:"Word Wrap",shortcut:[pe.ALT,fe.Z],macShortcut:[pe.OPTION,fe.Z]})},LT={CONSOLE:IT,COMMAND_HISTORY:NT,NOTEBOOK:MT};const Je=LT,ke=Object.freeze({FATAL:"FATAL",STDERR:"STDERR",ERROR:"ERROR",WARN:"WARN",STDOUT:"STDOUT",INFO:"INFO",DEBUG:"DEBUG",TRACE:"TRACE"});function Ns(r,e,t){return e=FT(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function FT(r){var e=AT(r,"string");return typeof e=="symbol"?e:String(e)}function AT(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}var Kt=B.module("MonacoCompletionProvider");class Rn extends v.PureComponent{static lspToMonacoKind(e){var t=ki.CompletionItemKind;switch(e){case 1:return t.Text;case 2:return t.Method;case 3:return t.Function;case 4:return t.Constructor;case 5:return t.Field;case 6:return t.Variable;case 7:return t.Class;case 8:return t.Interface;case 9:return t.Module;case 10:return t.Property;case 11:return t.Unit;case 12:return t.Value;case 13:return t.Enum;case 14:return t.Keyword;case 15:return t.Snippet;case 16:return t.Color;case 17:return t.File;case 18:return t.Reference;case 19:return t.Folder;case 20:return t.EnumMember;case 21:return t.Constant;case 22:return t.Struct;case 23:return t.Event;case 24:return t.Operator;case 25:return t.TypeParameter;default:return t.Variable}}static lspToMonacoRange(e){var{start:t,end:n}=e;return{startLineNumber:t.line+1,startColumn:t.character+1,endLineNumber:n.line+1,endColumn:n.character+1}}static monacoToLspPosition(e){return{line:e.lineNumber-1,character:e.column-1}}constructor(e){super(e),Ns(this,"registeredCompletionProvider",void 0),Ns(this,"registeredSignatureProvider",void 0),Ns(this,"registeredHoverProvider",void 0),this.handleCompletionRequest=this.handleCompletionRequest.bind(this),this.handleSignatureRequest=this.handleSignatureRequest.bind(this),this.handleHoverRequest=this.handleHoverRequest.bind(this)}componentDidMount(){var{language:e,session:t}=this.props;this.registeredCompletionProvider=ki.registerCompletionItemProvider(e,{provideCompletionItems:this.handleCompletionRequest,triggerCharacters:[".",'"',"'"]}),t.getSignatureHelp&&(this.registeredSignatureProvider=ki.registerSignatureHelpProvider(e,{provideSignatureHelp:this.handleSignatureRequest,signatureHelpTriggerCharacters:["(",","]})),t.getHover&&(this.registeredHoverProvider=ki.registerHoverProvider(e,{provideHover:this.handleHoverRequest}))}componentWillUnmount(){var e,t,n;(e=this.registeredCompletionProvider)===null||e===void 0||e.dispose(),(t=this.registeredSignatureProvider)===null||t===void 0||t.dispose(),(n=this.registeredHoverProvider)===null||n===void 0||n.dispose()}handleCompletionRequest(e,t,n){var{model:i,session:a}=this.props;if(e!==i)return null;var s={textDocument:{uri:"".concat(e.uri),version:e.getVersionId()},position:Rn.monacoToLspPosition(t),context:n},o=a.getCompletionItems(s);Kt.debug("Requested completion items",s);var l=o.then(d=>{Kt.debug("Completion items received: ",s,d);var h=d.map(c=>{var{label:f,kind:p,detail:m,documentation:b,sortText:g,filterText:C,textEdit:y,insertTextFormat:S}=c;return{label:f,kind:Rn.lspToMonacoKind(p),detail:m,documentation:(b==null?void 0:b.kind)==="markdown"?b:b==null?void 0:b.value,sortText:g,filterText:C,insertText:y.text,insertTextRules:S===2?4:S,range:Rn.lspToMonacoRange(y.range)}});return{incomplete:!0,suggestions:h}}).catch(d=>(Kt.error("There was an error retrieving completion items",d),{suggestions:[]}));return l}handleSignatureRequest(e,t,n,i){var a={value:{signatures:[],activeSignature:0,activeParameter:0},dispose:()=>{}},{model:s,session:o}=this.props;if(e!==s||!o.getSignatureHelp)return null;var l={textDocument:{uri:"".concat(e.uri),version:e.getVersionId()},position:Rn.monacoToLspPosition(t),context:i},d=o.getSignatureHelp(l);Kt.debug("Requested signature help",l);var h=d.then(c=>{Kt.debug("Signatures received: ",l,d);var f=c.map(m=>{var{label:b,documentation:g,parameters:C}=m;return{documentation:(g==null?void 0:g.kind)==="markdown"?g:g==null?void 0:g.value,label:b,parameters:C??[]}});if(f.length===0)return a;var p=0;return{value:{signatures:f,activeSignature:p,activeParameter:c[p].activeParameter},dispose:()=>{}}}).catch(c=>(Kt.error("There was an error retrieving completion items",c),a));return h}handleHoverRequest(e,t){var{model:n,session:i}=this.props;if(e!==n||!i.getHover)return null;var a={textDocument:{uri:"".concat(e.uri),version:e.getVersionId()},position:Rn.monacoToLspPosition(t)},s=i.getHover(a);Kt.debug("Requested hover",a);var o=s.then(l=>{Kt.debug("Hover received: ",a,l);var{contents:d}=l;return{contents:d?[d]:[]}}).catch(l=>(Kt.error("There was an error retrieving hover",l),{contents:[]}));return o}render(){return null}}const cp=Rn;function RT(r){var{children:e}=r,{activeThemes:t}=Rr();return v.useEffect(function(){t!=null&&vt.initTheme()},[t]),u.jsx(u.Fragment,{children:e})}function Du(r,e,t,n,i,a,s){try{var o=r[a](s),l=o.value}catch(d){t(d);return}o.done?e(l):Promise.resolve(l).then(n,i)}function jT(r){return function(){var e=this,t=arguments;return new Promise(function(n,i){var a=r.apply(e,t);function s(l){Du(a,n,i,s,o,"next",l)}function o(l){Du(a,n,i,s,o,"throw",l)}s(void 0)})}}function dt(r,e,t){return e=kT(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function kT(r){var e=$T(r,"string");return typeof e=="symbol"?e:String(e)}function $T(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}var Ms=B.module("ConsoleInput"),wa=parseInt(Bb["line-height"],10),vp=6,fp=6,UT=wa+vp+fp,Ls=100;class Ni extends v.PureComponent{constructor(e){super(e),dt(this,"cancelListener",void 0),dt(this,"resizeObserver",void 0),dt(this,"commandContainer",void 0),dt(this,"commandEditor",void 0),dt(this,"commandHistoryIndex",void 0),dt(this,"commandSuggestionContainer",void 0),dt(this,"loadingPromise",void 0),dt(this,"timestamp",void 0),dt(this,"bufferIndex",void 0),dt(this,"history",void 0),dt(this,"modifiedCommands",void 0),this.handleResize=this.handleResize.bind(this),this.commandContainer=X.createRef(),this.commandHistoryIndex=null,this.timestamp=Date.now(),this.bufferIndex=0,this.history=[],this.modifiedCommands=new Map,this.resizeObserver=new window.ResizeObserver(this.handleResize),this.state={commandEditorHeight:wa,isFocused:!1,model:null}}componentDidMount(){this.initCommandEditor(),this.loadMoreHistory()}componentDidUpdate(){this.layoutEditor()}componentWillUnmount(){this.resizeObserver.disconnect(),this.loadingPromise!=null&&this.loadingPromise.cancel(),this.destroyCommandEditor()}setConsoleText(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;if(e){if(Ms.debug("Command received: ",e),!n){var i;this.commandHistoryIndex=null,(i=this.commandEditor)===null||i===void 0||i.setValue(e)}t&&this.focusEnd(),this.updateDimensions(),n&&this.processCommand(e)}}initCommandEditor(){var{language:e,session:t}=this.props,n={copyWithSyntaxHighlighting:!1,cursorStyle:"block",fixedOverflowWidgets:!0,folding:!1,fontFamily:"Fira Mono",glyphMargin:!1,language:e,lineHeight:wa,lineDecorationsWidth:3,lineNumbers:"off",minimap:{enabled:!1},renderLineHighlight:"none",scrollBeyondLastLine:!1,scrollbar:{arrowSize:0,horizontal:"hidden",horizontalScrollbarSize:0},padding:{top:vp,bottom:fp},value:"",wordWrap:"on"},i=this.commandContainer.current;G(i),this.commandEditor=Uo.create(i,n),vt.setEOL(this.commandEditor),vt.openDocument(this.commandEditor,t),this.commandEditor.onDidChangeModelContent(()=>{var a,s=(a=this.commandEditor)===null||a===void 0?void 0:a.getValue();this.modifiedCommands.set(this.commandHistoryIndex,s??null),this.updateDimensions()}),this.commandEditor.onDidFocusEditorText(()=>{this.setState({isFocused:!0})}),this.commandEditor.onDidBlurEditorText(()=>{this.setState({isFocused:!1})}),this.commandEditor.onKeyDown(a=>{var{commandEditor:s,commandHistoryIndex:o}=this,l=s==null?void 0:s.getPosition();G(l);var{lineNumber:d}=l,h=s==null?void 0:s.getModel();if(a.code==="ArrowUp"&&!this.isSuggestionMenuPopulated()&&d===1){o!=null?this.loadCommand(o+1):this.loadCommand(0),this.focusStart(),a.stopPropagation(),a.preventDefault();return}if(a.code==="ArrowDown"&&!this.isSuggestionMenuPopulated()&&d===(h==null?void 0:h.getLineCount())){o!=null&&o>0?this.loadCommand(o-1):this.loadCommand(null),this.focusEnd(),a.stopPropagation(),a.preventDefault();return}if(!a.altKey&&!a.shiftKey&&!a.metaKey&&a.keyCode===si.Enter&&!this.isSuggestionMenuPopulated()){var c;a.stopPropagation(),a.preventDefault();var f=(c=this.commandEditor)===null||c===void 0?void 0:c.getValue().trim();if(f!==void 0){var p;this.processCommand(f),(p=this.commandEditor)===null||p===void 0||p.setValue("")}}}),vt.disableKeyBindings(this.commandEditor,[Yc.CtrlCmd|si.KeyF]),vt.registerPasteHandler(this.commandEditor),this.commandEditor.focus(),this.resizeObserver.observe(i),this.updateDimensions(),this.setState({model:this.commandEditor.getModel()})}destroyCommandEditor(){var{session:e}=this.props;this.commandEditor&&(vt.closeDocument(this.commandEditor,e),this.commandEditor.dispose(),this.commandEditor=void 0)}handleResize(){this.updateDimensions()}isSuggestionMenuActive(){var e;if(!this.commandSuggestionContainer){var t,n;this.commandSuggestionContainer=(t=this.commandEditor)===null||t===void 0||(n=t.getDomNode())===null||n===void 0?void 0:n.querySelector(".suggest-widget")}return(e=this.commandSuggestionContainer&&this.commandSuggestionContainer.classList.contains("visible"))!==null&&e!==void 0?e:!1}isSuggestionMenuPopulated(){var e,t,n;return this.isSuggestionMenuActive()&&((e=(t=this.commandSuggestionContainer)===null||t===void 0||(n=t.querySelector(".monaco-list-rows"))===null||n===void 0?void 0:n.childElementCount)!==null&&e!==void 0?e:0)>0}focus(){var e;(e=this.commandEditor)===null||e===void 0||e.focus()}focusStart(){var e,t,n,i,a,s=(e=this.commandEditor)===null||e===void 0?void 0:e.getModel();G(s);var o=s.getLineLength(1)+1,l=(t=this.commandEditor)===null||t===void 0?void 0:t.getTopForPosition(1,o);G(l),(n=this.commandEditor)===null||n===void 0||n.setPosition({lineNumber:1,column:o}),(i=this.commandEditor)===null||i===void 0||i.setScrollTop(l),(a=this.commandEditor)===null||a===void 0||a.focus()}focusEnd(){var e,t,n,i,a,s=(e=this.commandEditor)===null||e===void 0?void 0:e.getModel();G(s);var o=s.getLineCount(),l=s.getLineLength(o)+1,d=(t=this.commandEditor)===null||t===void 0?void 0:t.getTopForPosition(o,l);G(d),(n=this.commandEditor)===null||n===void 0||n.setPosition({lineNumber:o,column:l}),(i=this.commandEditor)===null||i===void 0||i.setScrollTop(d),(a=this.commandEditor)===null||a===void 0||a.focus()}clear(){var e,t,n;(e=this.commandEditor)===null||e===void 0||e.focus(),(t=this.commandEditor)===null||t===void 0||(n=t.getModel())===null||n===void 0||n.setValue(""),this.commandHistoryIndex=null}layoutEditor(){this.commandEditor&&this.commandEditor.layout()}loadCommand(e){var t,n;if(!(e!==null&&e>=this.history.length)){var i=this.modifiedCommands.get(e),a=e===null?"":this.history[this.history.length-e-1];this.commandHistoryIndex=e,(t=this.commandEditor)===null||t===void 0||(n=t.getModel())===null||n===void 0||n.setValue(i??a),e!==null&&e>this.history.length-Ls&&this.loadMoreHistory()}}loadMoreHistory(){var e=this;return jT(function*(){try{if(e.loadingPromise!=null||e.bufferIndex==null)return;var{commandHistoryStorage:t,language:n,scope:i}=e.props;e.loadingPromise=ye.makeCancelable(t.getTable(n,i??"",e.timestamp),o=>o.close());var a=yield e.loadingPromise;a.setReversed(!0),a.setViewport({top:e.bufferIndex,bottom:e.bufferIndex+Ls-1}),e.loadingPromise=ye.makeCancelable(a.getViewportData(),()=>a.close());var s=yield e.loadingPromise;e.bufferIndex+=Ls,e.bufferIndex>=a.size&&(e.bufferIndex=null),e.history=[...s.items.filter((o,l,d)=>{var{name:h}=o;return l===0||h!==d[l-1].name}).map(o=>{var{name:l}=o;return l}).reverse(),...e.history],e.loadingPromise=void 0,a.close()}catch(o){if(e.loadingPromise=void 0,ye.isCanceled(o)){Ms.debug2("Promise canceled, not loading history");return}Ms.error("Error fetching history",o)}})()}processCommand(e){this.commandHistoryIndex=null,this.modifiedCommands.clear(),G(e),e!==""&&(this.history.length===0||e!==this.history[this.history.length-1])&&this.history.push(e),this.updateDimensions();var{onSubmit:t}=this.props;t(e)}updateDimensions(){if(this.commandEditor){var{maxHeight:e}=this.props;G(e);var t=this.commandEditor.getContentHeight(),n=Math.max(Math.min(t,e),UT),i=t>n,a={overviewRulerLanes:i?void 0:0};this.setState({commandEditorHeight:n},()=>{var s,o;(s=this.commandEditor)===null||s===void 0||s.updateOptions(a),(o=this.commandEditor)===null||o===void 0||o.layout()})}}render(){var{disabled:e,language:t,session:n}=this.props,{commandEditorHeight:i,isFocused:a,model:s}=this.state;return u.jsx("div",{className:Y("console-input-wrapper",{disabled:e}),children:u.jsxs("div",{className:Y("console-input-inner-wrapper",{focus:a}),children:[u.jsx("div",{className:Ni.INPUT_CLASS_NAME,ref:this.commandContainer,style:{height:i}}),s&&u.jsx(cp,{model:s,language:t,session:n})]})})}}dt(Ni,"defaultProps",{maxHeight:wa*10,scope:null,disabled:!1});dt(Ni,"INPUT_CLASS_NAME","console-input");const xu=Ni;function Cn(r,e,t){return e=HT(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function HT(r){var e=VT(r,"string");return typeof e=="symbol"?e:String(e)}function VT(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}var Iu="pasted values",BT=[/^audio.*/,/^font.*/,/^image.*/,/^video.*/],Fs=[".csv",".tsv",".tab",".psv",".dsv",".txt"],Nu=[".zip"];class Vt extends v.Component{static isValidDropItem(e){return e!=null&&e.kind==="file"&&!BT.find(t=>t.test(e.type))}static isValidExtension(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return Fs.some(n=>e.endsWith(n))||t&&Nu.some(n=>e.endsWith(n))}static handleDragOver(e){e.preventDefault(),e.stopPropagation()}static getIcon(e){return e===Iu?Xl:e.endsWith(".csv")?Rg:e.endsWith(".zip")?jg:kg}constructor(e){super(e),Cn(this,"fileElem",void 0),Cn(this,"divElem",void 0),Cn(this,"getValidExtensions",se(t=>t?[...Fs,...Nu]:[...Fs])),Cn(this,"getAcceptString",se(t=>this.getValidExtensions(t).join(", "))),Cn(this,"getFileTypeErrorString",se(t=>Ot.join(this.getValidExtensions(t),"or"))),this.handleSelectFile=this.handleSelectFile.bind(this),this.handleFiles=this.handleFiles.bind(this),this.handleDrop=this.handleDrop.bind(this),this.unstageFile=this.unstageFile.bind(this),this.handleMenuPaste=this.handleMenuPaste.bind(this),this.handlePasteEvent=this.handlePasteEvent.bind(this),this.fileElem=X.createRef(),this.divElem=X.createRef(),this.state={selectedFileName:""}}componentDidMount(){var e,t;(e=this.divElem.current)===null||e===void 0||e.addEventListener("paste",this.handlePasteEvent),(t=this.divElem.current)===null||t===void 0||t.focus()}componentWillUnmount(){var e;(e=this.divElem.current)===null||e===void 0||e.removeEventListener("paste",this.handlePasteEvent)}handleSelectFile(){if(this.fileElem.current){var e;this.fileElem.current.value="",(e=this.fileElem.current)===null||e===void 0||e.click()}}handleFiles(e){e.stopPropagation(),e.preventDefault();var{files:t}=e.target;t!=null&&this.handleFile(t[0])}handleDrop(e){var{allowZip:t,clearDragError:n,dragError:i}=this.props;if(e.preventDefault(),e.stopPropagation(),i!=null){n();return}if(!(e.dataTransfer==null||e.dataTransfer.items==null||e.dataTransfer.items.length===0)){var a=e.dataTransfer.items[0].getAsFile();G(a),Vt.isValidExtension(a.name,t)?this.handleFile(a):this.setState({dropError:Vt.FILE_TYPE_ERROR})}}unstageFile(e){var{onCancel:t}=this.props;e.stopPropagation(),e.preventDefault(),t(),this.setState({selectedFileName:"",dropError:void 0})}handleFile(e){var{onFileOpened:t}=this.props;t(e),this.setState({selectedFileName:e.name,dropError:void 0})}handleMenuPaste(){var{onPaste:e,onError:t,uploadInProgress:n}=this.props;n||navigator.clipboard.readText().then(i=>{e(i),this.setState({selectedFileName:Iu,dropError:void 0})}).catch(i=>t(i))}handlePasteEvent(e){e.stopPropagation(),e.preventDefault(),this.handleMenuPaste()}makeContextMenuItems(){var{uploadInProgress:e}=this.props;return[{title:"Paste",icon:Xl,action:this.handleMenuPaste,shortcut:wr.PASTE,disabled:e}]}render(){var{allowZip:e,dragError:t,uploadInProgress:n}=this.props,{selectedFileName:i,dropError:a}=this.state,s=t??a,o=this.makeContextMenuItems();return u.jsxs("div",{ref:this.divElem,className:"csv-overlay fill-parent-absolute",onDragOver:Vt.handleDragOver,onDrop:this.handleDrop,tabIndex:-1,children:[u.jsx(ae,{actions:o}),u.jsx("input",{ref:this.fileElem,type:"file",id:"fileElem",accept:this.getAcceptString(e),style:{display:"none"},onChange:this.handleFiles,"data-testid":"fileElem"}),!i&&(s===void 0||s==="")&&u.jsxs("div",{className:"message-content",children:[u.jsx("div",{className:"message-icon",children:u.jsx(ne,{icon:$g})}),u.jsx("label",{children:"Drop file (or paste values) here to import"}),u.jsx("div",{className:"message-small",children:u.jsx("label",{children:"or"})}),u.jsx(K,{kind:"primary",onClick:this.handleSelectFile,children:"Select File..."})]}),i&&(s===void 0||s==="")&&u.jsxs("div",{className:"selected-content",children:[u.jsx("div",{className:"selected-icon",children:u.jsx(ne,{icon:Vt.getIcon(i)})}),u.jsxs("div",{className:"selected-text",children:[u.jsx("label",{children:"Selected File"}),u.jsxs("label",{className:"selected-name",children:[i,!n&&u.jsx(K,{kind:"ghost",className:"ml-2",onClick:this.unstageFile,icon:Wn,tooltip:"Remove"})]})]})]}),!!s&&u.jsxs("div",{className:"message-content",children:[u.jsx("div",{className:"message-icon",children:u.jsx(ne,{icon:Io})}),u.jsx("label",{children:s}),s===Vt.FILE_TYPE_ERROR&&u.jsx("div",{className:"message-small",children:u.jsx("label",{children:this.getFileTypeErrorString(e)})})]})]})}}Cn(Vt,"defaultProps",{allowZip:!1,dragError:null});Cn(Vt,"MULTIPLE_FILE_ERROR","Please select only one file");Cn(Vt,"FILE_TYPE_ERROR","Filetype not supported.");const rr=Vt;function qn(r,e,t){return e=WT(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function WT(r){var e=GT(r,"string");return typeof e=="symbol"?e:String(e)}function GT(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class Dn{}qn(Dn,"INTEGER","int");qn(Dn,"LONG","long");qn(Dn,"DOUBLE","double");qn(Dn,"BOOLEAN","bool");qn(Dn,"STRING","string");qn(Dn,"DATE_TIME","datetime");qn(Dn,"LOCAL_TIME","localtime");const de=Dn;function pp(r,e){var t=r.internalStream("string");return t.readable=!0,t.read=()=>!1,t.removeListener=()=>!1,t.on("data",(n,i)=>e(i)),t}function Mu(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,n)}return t}function Lu(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Mu(Object(t),!0).forEach(function(n){Ye(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):Mu(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function Ye(r,e,t){return e=zT(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function zT(r){var e=KT(r,"string");return typeof e=="symbol"?e:String(e)}function KT(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}var Fu="unknown",qT=2147483647,YT=-2147483648,Au=/^[0-9]{4}-[0-1][0-9]-[0-3][0-9][ T][0-2][0-9]:[0-5][0-9]:[0-6][0-9](?:\.[0-9]{1,9})?(?: [a-zA-Z]+)?$/,Ru=/^([0-9]+T)?([0-9]+):([0-9]+)(:[0-9]+)?(?:\.[0-9]{1,9})?$/;class Ge{static determineType(e,t,n){if(!e||e===n)return t;switch(t){case de.STRING:return de.STRING;case de.INTEGER:return Ge.checkInteger(e);case de.LONG:return Ge.checkLong(e);case de.DOUBLE:return Ge.checkDouble(e);case de.BOOLEAN:return Ge.checkBoolean(e);case de.DATE_TIME:return Ge.checkDateTime(e);case de.LOCAL_TIME:return Ge.checkLocalTime(e);default:return Ge.getTypeFromUnknown(e)}}static isNotParsableNumber(e){return isNaN(e)||e==="Infinity"||e==="-Infinity"}static checkInteger(e){var t=e.replace(/,/g,"");return Ge.isNotParsableNumber(t)?de.STRING:Ge.getNumberType(t)}static checkLong(e){var t=e.replace(/,/g,"");return Ge.isNotParsableNumber(t)?de.STRING:t.includes(".")?de.DOUBLE:de.LONG}static checkDouble(e){var t=e.replace(/,/g,"");return Ge.isNotParsableNumber(t)?de.STRING:de.DOUBLE}static checkBoolean(e){var t=e.toLowerCase();return t==="true"||t==="false"?de.BOOLEAN:de.STRING}static checkDateTime(e){return Au.test(e)?de.DATE_TIME:de.STRING}static checkLocalTime(e){return Ru.test(e)?de.LOCAL_TIME:de.STRING}static getTypeFromUnknown(e){var t=e.replace(/,/g,"");if(Ge.isNotParsableNumber(t)){var n=e.toLowerCase();return n==="true"||n==="false"?de.BOOLEAN:Au.test(e)&&e.includes(":")?de.DATE_TIME:Ru.test(e)?de.LOCAL_TIME:de.STRING}return Ge.getNumberType(t)}static getNumberType(e){if(e.includes("."))return de.DOUBLE;var t=e.startsWith("-")?11:10;if(e.length>t)return de.LONG;var n=parseInt(e,10);return n>qT||n<YT?de.LONG:de.INTEGER}constructor(e,t,n,i,a,s,o,l,d,h){Ye(this,"onFileCompleted",void 0),Ye(this,"file",void 0),Ye(this,"readHeaders",void 0),Ye(this,"nullString",void 0),Ye(this,"onProgress",void 0),Ye(this,"onError",void 0),Ye(this,"types",void 0),Ye(this,"chunks",void 0),Ye(this,"totalChunks",void 0),Ye(this,"rowCount",void 0),Ye(this,"isZip",void 0),Ye(this,"shouldTrim",void 0),Ye(this,"zipProgress",void 0),Ye(this,"config",void 0),this.onFileCompleted=e,this.file=t,this.readHeaders=n,this.nullString=a,this.onProgress=s,this.onError=o,this.chunks=0,this.totalChunks=l,this.rowCount=0,this.isZip=d,this.shouldTrim=h,this.zipProgress=0,this.handleChunk=this.handleChunk.bind(this),this.handleComplete=this.handleComplete.bind(this),this.handleError=this.handleError.bind(this),this.handleNodeUpdate=this.handleNodeUpdate.bind(this),this.config=Lu(Lu({},i),{},{error:this.handleError,chunk:this.handleChunk,complete:this.handleComplete})}parse(){if(this.file instanceof File||this.file instanceof Blob)ii.parse(this.file,this.config);else{var e=pp(this.file,this.handleNodeUpdate);ii.parse(e,this.config),e.resume()}}handleChunk(e,t){var{data:n}=e;if(!this.types){if(n==null||n.length===0){t.abort(),this.onError("Error parsing CSV: no data in file.");return}this.types=new Array(n[0].length).fill(Fu),this.readHeaders&&(n=n.slice(1))}this.rowCount+=n.length,G(this.types);var i=[...this.types];n.forEach(o=>{if(o.length>=i.length){for(var l=0;l<i.length;l+=1)i[l]=Ge.determineType(this.shouldTrim?o[l].trim():o[l],i[l],this.nullString);this.types=i}else t.abort(),this.onError(`Error parsing CSV: Insufficient data in row.
|
|
@@ -26,4 +26,4 @@ Check your internet connection.`;if(t&&n)return"Disconnected from server.";if(n)
|
|
|
26
26
|
`).concat(Sr.makeCirclePath(s,o,zh)),T="link-select-clip-".concat(l),I=Math.atan2(o-E,s-w),j=I-Gh+Math.PI,W=I+Gh+Math.PI,L=s+Math.cos(I)*Wh,O=o+Math.sin(I)*Wh,M=L+Math.cos(j)*ia,A=O+Math.sin(j)*ia,k=L+Math.cos(W)*ia,H=O+Math.sin(W)*ia,q="".concat(L,",").concat(O," ").concat(M,",").concat(A," ").concat(k,",").concat(H),re=.25*i+.5*w+.25*s,V=.25*a+.5*E+.25*o,N=w-i+(s-w),P=E-a+(o-E),R=P/N,U=20,Q=U/Math.sqrt(1+R**2),me=Q*R,$=Q*-1,J=me*-1;Number.isFinite(R)?R>0?(Q*=-1,me*=-1,$*=-1,J*=-1,$-=50-10*(Math.abs(p)%vn),J+=10*(Math.abs(p)%vn),Q-=50-10*(Math.abs(p)%vn),me+=10*(Math.abs(p)%vn)):R<0?($+=10*(Math.abs(p)%vn),J+=10*(Math.abs(p)%vn),Q+=10*(Math.abs(p)%vn),me+=10*(Math.abs(p)%vn)):($=15,J=10,Q=-25,me=10):($=10,J=5,Q=10,me=-35);var ie="";t!==void 0&&(t==="startsWith"?ie="a*":t==="endsWith"?ie="*z":ie=Ie.getFilterOperatorString(t));var ve=h!=="chartLink"&&h!=="filterSource";return u.jsxs(u.Fragment,{children:[u.jsxs("svg",{className:Y(e,{hovering:c}),children:[u.jsx("clipPath",{id:T,children:u.jsx("path",{d:D,clipRule:"evenodd"})}),u.jsx("path",{className:"link-select",d:x,onClick:this.handleClick,onMouseEnter:this.handleMouseEnter,onMouseLeave:this.handleMouseLeave,clipPath:"url(#".concat(T,")"),"data-testid":"link-select"}),u.jsx("path",{className:"link-background",d:x}),u.jsx("path",{className:"link-foreground",d:x}),u.jsx("circle",{className:"link-dot",cx:i,cy:a,r:"5"}),u.jsx("polygon",{className:"link-triangle",points:q})]}),d!=null&&n&&u.jsxs(u.Fragment,{children:[ve&&u.jsx(K,{kind:"primary",className:"btn-fab btn-operator",style:{top:V+(R>=0?me:J),left:re+(R>=0?Q:$)},onClick:()=>{},icon:u.jsxs("div",{className:"fa-md fa-layers",children:[u.jsx("b",{children:ie}),u.jsx(ne,{icon:sr,transform:"right-8 down-9 shrink-5"})]}),tooltip:"Change comparison operator",children:u.jsx(En,{actions:this.getDropdownActions,popperOptions:{placement:"bottom-start"}})}),u.jsx(K,{kind:"primary",className:"btn-fab btn-delete",style:{top:V+(R<0?me:J),left:re+(R<0?Q:$)},onClick:this.handleDelete,icon:Wn,tooltip:"Delete"})]})]})}}um(Sr,"defaultProps",{className:"",isSelected:!1,onClick(){},onDelete(){}});const CN=Sr;function Kh(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,n)}return t}function qh(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Kh(Object(t),!0).forEach(function(n){Vl(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):Kh(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function Vl(r,e,t){return e=SN(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function SN(r){var e=yN(r,"string");return typeof e=="symbol"?e:String(e)}function yN(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}var Rs=B.module("LinkerOverlayContent");class vm extends v.Component{constructor(e){super(e),Vl(this,"dialogRef",void 0),this.handleBlur=this.handleBlur.bind(this),this.handleResize=this.handleResize.bind(this),this.handleMouseMove=this.handleMouseMove.bind(this),this.handleMouseDown=this.handleMouseDown.bind(this),this.handleMouseUp=this.handleMouseUp.bind(this),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleKeyUp=this.handleKeyUp.bind(this),this.handleEscapePressed=this.handleEscapePressed.bind(this),this.handleOperatorChanged=this.handleOperatorChanged.bind(this),this.dialogRef=X.createRef(),this.state={mouse:void 0,dialog:void 0,offset:{x:0,y:0},isDragging:!1,mode:"select"}}componentDidMount(){window.addEventListener("blur",this.handleBlur,!0),window.addEventListener("mousemove",this.handleMouseMove,!0),window.addEventListener("mouseup",this.handleMouseUp,!0),window.addEventListener("keydown",this.handleKeyDown,!0),window.addEventListener("keyup",this.handleKeyUp,!0),window.addEventListener("resize",this.handleResize,!0)}componentDidCatch(e,t){Rs.error("componentDidCatch",e,t)}componentWillUnmount(){window.removeEventListener("blur",this.handleBlur,!0),window.removeEventListener("mousemove",this.handleMouseMove,!0),window.removeEventListener("mouseup",this.handleMouseUp,!0),window.removeEventListener("keydown",this.handleKeyDown,!0),window.removeEventListener("keyup",this.handleKeyUp,!0),window.removeEventListener("resize",this.handleResize,!0)}getPointFromLinkPoint(e){var{panelManager:t}=this.props,{panelId:n,columnName:i}=e,a=t.getOpenedPanelById(n);if(a!=null){if(!dm(a))throw new Error("Panel does not have getCoordinateForColumn method: ".concat(n));try{var s=a.getCoordinateForColumn(i);if(s!=null)return s}catch{Rs.error("Could not get coordinate for column",i,a)}}var o=t.getContainerByPanelId(n);if(o==null)throw new Error("Unable to find panel container for id: ".concat(n));return F.getTabPoint(o)}handleOperatorChanged(e,t){var{links:n,onLinksUpdated:i}=this.props,a=n.map(s=>s.id===e?qh(qh({},s),{},{operator:t}):s);i(a)}handleBlur(){this.setState({mode:"select"})}handleResize(){var{dialog:e}=this.state;if(e&&this.dialogRef.current){var t=this.dialogRef.current.getBoundingClientRect(),n=ar(e.x,0,window.innerWidth-t.width),i=ar(e.y,0,window.innerHeight-t.height);this.setState({dialog:{x:n,y:i}})}}handleMouseMove(e){var{offset:t,isDragging:n}=this.state;if(this.setState({mouse:{x:e.clientX,y:e.clientY}}),n&&this.dialogRef.current){var i=this.dialogRef.current.getBoundingClientRect(),a=ar(window.innerWidth-(e.clientX+i.width+t.x),0,window.innerWidth-i.width),s=ar(window.innerHeight-(e.clientY+i.height+t.y),0,window.innerHeight-i.height);this.setState({dialog:{x:a,y:s}})}}handleMouseDown(e){e.preventDefault();var t={x:0,y:0};if(this.dialogRef.current){var n=this.dialogRef.current.getBoundingClientRect();t.x=n.right-(n.width+e.clientX),t.y=n.bottom-(n.height+e.clientY)}this.setState({isDragging:!0,offset:t})}handleMouseUp(){this.setState({isDragging:!1})}handleKeyDown(e){if(e.key==="Alt")e.preventDefault(),this.setState({mode:"delete"});else if(e.key==="Delete"||e.key==="Backspace"){var{selectedIds:t,onLinkDeleted:n}=this.props;e.preventDefault(),t.forEach(i=>n(i))}}handleKeyUp(e){e.key==="Alt"&&(e.preventDefault(),this.setState({mode:"select"}))}handleEscapePressed(){var{onCancel:e}=this.props;e()}render(){var{disabled:e,links:t,selectedIds:n,messageText:i,onLinkSelected:a,onLinkDeleted:s,onAllLinksDeleted:o,onDone:l}=this.props,{mouse:d,dialog:h,isDragging:c,mode:f}=this.state,p=t.map(m=>{try{var b,g,{id:C,type:y,isReversed:S,start:w,end:E,operator:x}=m,D=w.columnType,[T,I]=this.getPointFromLinkPoint(w),j=(b=d==null?void 0:d.x)!==null&&b!==void 0?b:T,W=(g=d==null?void 0:d.y)!==null&&g!==void 0?g:I;if(E!=null&&([j,W]=this.getPointFromLinkPoint(E)),S!=null&&S){var[L,O]=[T,I];[T,I]=[j,W],[j,W]=[L,O]}var M=Y("linker-link",{disabled:e},{"link-filter-source":y==="filterSource"},{"link-invalid":y==="invalid"},{interactive:m.end==null},{"link-is-selected":n.has(C)},{"danger-delete":f==="delete"});return{x1:T,y1:I,x2:j,y2:W,id:C,className:M,operator:x,startColumnType:D,type:y}}catch(A){return Rs.warn("Unable to get point for link",m,A),null}}).filter(m=>m!=null);return u.jsxs("div",{className:Y("linker-overlay",{"danger-delete":f==="delete"}),children:[p.map(m=>{var{x1:b,y1:g,x2:C,y2:y,id:S,className:w,operator:E,startColumnType:x,type:D}=m;return u.jsx(CN,{className:w,id:S,x1:b,y1:g,x2:C,y2:y,onClick:a,onDelete:s,isSelected:n.has(S),operator:E,startColumnType:x,type:D,onOperatorChanged:this.handleOperatorChanged},S)}),u.jsxs("div",{className:Y("linker-toast-dialog",{dragging:c}),ref:this.dialogRef,style:{bottom:h==null?void 0:h.y,right:h==null?void 0:h.x},"data-testid":"linker-toast-dialog",children:[u.jsx(K,{draggable:!0,kind:"inline",className:"btn-drag-handle",icon:rb,onClick:()=>{},onMouseDown:this.handleMouseDown,children:!c&&u.jsx(wt,{children:"Drag to reposition"})}),u.jsx("div",{className:"toast-body",children:i}),u.jsxs("div",{className:"toast-footer",children:[u.jsx(K,{kind:"secondary",onClick:o,children:"Clear All"}),u.jsx(K,{kind:"primary",onClick:l,children:"Done"})]})]}),u.jsx(ae,{actions:[{action:this.handleEscapePressed,shortcut:wr.LINKER_CLOSE,isGlobal:!0}]})]})}}Vl(vm,"defaultProps",{disabled:"false"});const EN=vm;function Yh(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,n)}return t}function Xh(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Yh(Object(t),!0).forEach(function(n){fm(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):Yh(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function fm(r,e,t){return e=wN(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function wN(r){var e=PN(r,"string");return typeof e=="symbol"?e:String(e)}function PN(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}var Ae=B.module("Linker"),_N=(r,e)=>({activeTool:Sl(r),dh:Gf(r),isolatedLinkerPanelId:ss(r,e.localDashboardId),links:Zn(r,e.localDashboardId),timeZone:Cl(r)}),TN=Pt(_N,{setActiveTool:Jf,setDashboardLinks:ls,addDashboardLinks:Mp,deleteDashboardLinks:Lp,setDashboardIsolatedLinkerPanelId:Ml,setDashboardColumnSelectionValidator:Fp});class ON extends v.Component{constructor(e){super(e),fm(this,"getCachedLinks",se((t,n,i)=>{var a=[...t];return n!=null&&n.start!=null&&a.push(n),i!==void 0?a.filter(s=>{var o,l;return(s==null||(o=s.start)===null||o===void 0?void 0:o.panelId)===i||(s==null||(l=s.end)===null||l===void 0?void 0:l.panelId)===i||(s==null?void 0:s.end)==null}):a})),this.handleCancel=this.handleCancel.bind(this),this.handleDone=this.handleDone.bind(this),this.handlePanelCloned=this.handlePanelCloned.bind(this),this.handleFilterColumnSelect=this.handleFilterColumnSelect.bind(this),this.handleColumnsChanged=this.handleColumnsChanged.bind(this),this.handlePanelClosed=this.handlePanelClosed.bind(this),this.handleLayoutStateChanged=this.handleLayoutStateChanged.bind(this),this.handleAllLinksDeleted=this.handleAllLinksDeleted.bind(this),this.handleLinkDeleted=this.handleLinkDeleted.bind(this),this.handleLinksUpdated=this.handleLinksUpdated.bind(this),this.handleChartColumnSelect=this.handleChartColumnSelect.bind(this),this.handleGridColumnSelect=this.handleGridColumnSelect.bind(this),this.handleUpdateValues=this.handleUpdateValues.bind(this),this.handleStateChange=this.handleStateChange.bind(this),this.handleExited=this.handleExited.bind(this),this.handleLinkSelected=this.handleLinkSelected.bind(this),this.handlePanelDragging=this.handlePanelDragging.bind(this),this.handlePanelDropped=this.handlePanelDropped.bind(this),this.isColumnSelectionValid=this.isColumnSelectionValid.bind(this),this.state={linkInProgress:void 0,selectedIds:new Set,isDraggingPanel:!1}}componentDidMount(){var{layout:e}=this.props;this.startListening(e),this.updateSelectionValidators()}componentDidUpdate(e){var{activeTool:t,layout:n}=this.props;n!==e.layout&&(this.stopListening(e.layout),this.startListening(n)),t!==e.activeTool&&(this.updateSelectionValidators(),t===Nt.DEFAULT&&this.reset())}componentDidCatch(e,t){Ae.error("componentDidCatch",e,t)}componentWillUnmount(){var{layout:e}=this.props;this.stopListening(e)}startListening(e){e.on("stateChanged",this.handleLayoutStateChanged);var{eventHub:t}=e;t.on(Et.COLUMN_SELECTED,this.handleGridColumnSelect),t.on(Et.DATA_SELECTED,this.handleUpdateValues),t.on(Et.STATE_CHANGED,this.handleStateChange),t.on(Da.COLUMN_SELECTED,this.handleChartColumnSelect),t.on(te.CLONED,this.handlePanelCloned),t.on(Te.COLUMN_SELECTED,this.handleFilterColumnSelect),t.on(Te.COLUMNS_CHANGED,this.handleColumnsChanged),t.on(te.CLOSE,this.handlePanelClosed),t.on(te.CLOSED,this.handlePanelClosed),t.on(te.DRAGGING,this.handlePanelDragging),t.on(te.DROPPED,this.handlePanelDropped)}stopListening(e){e.off("stateChanged",this.handleLayoutStateChanged);var{eventHub:t}=e;t.off(Et.COLUMN_SELECTED,this.handleGridColumnSelect),t.off(Et.DATA_SELECTED,this.handleUpdateValues),t.off(Et.STATE_CHANGED,this.handleStateChange),t.off(Da.COLUMN_SELECTED,this.handleChartColumnSelect),t.off(te.CLONED,this.handlePanelCloned),t.off(Te.COLUMN_SELECTED,this.handleFilterColumnSelect),t.off(Te.COLUMNS_CHANGED,this.handleColumnsChanged),t.off(te.CLOSE,this.handlePanelClosed),t.off(te.CLOSED,this.handlePanelClosed),t.off(te.DRAGGING,this.handlePanelDragging),t.off(te.DROPPED,this.handlePanelDropped)}reset(){this.setState({linkInProgress:void 0,selectedIds:new Set})}handleCancel(){var{linkInProgress:e}=this.state;if(e==null){var{setActiveTool:t}=this.props;t(Nt.DEFAULT)}this.setState({linkInProgress:void 0})}handleDone(){var{setActiveTool:e}=this.props;e(Nt.DEFAULT)}handleChartColumnSelect(e,t){this.columnSelected(e,t,!0)}handleFilterColumnSelect(e,t){Ae.debug("handleFilterColumnSelect",this.isOverlayShown());var{links:n,localDashboardId:i,setActiveTool:a,setDashboardIsolatedLinkerPanelId:s}=this.props,o=F.getIdFromPanel(e),l=n.filter(d=>{var h,c;return((h=d.start)===null||h===void 0?void 0:h.panelId)===o||((c=d.end)===null||c===void 0?void 0:c.panelId)===o});if(!this.isOverlayShown()&&o!=null){a(Nt.LINKER),s(i,o),l.length===0&&this.columnSelected(e,t,!0,o);return}this.columnSelected(e,t,!0)}handleColumnsChanged(e,t){Ae.debug("handleColumnsChanged",e,t);var{links:n}=this.props,i=F.getIdFromPanel(e);if(i==null){Ae.error("Invalid panelId",e);return}var a=n.filter(s=>{var{start:o,end:l}=s;return o.panelId===i&&Fn.findColumn(t,o)==null||l!=null&&l.panelId===i&&Fn.findColumn(t,l)==null});this.deleteLinks(a)}handleGridColumnSelect(e,t){if(!Hh(t)){Ae.debug2("Column is not filterable");return}this.columnSelected(e,t)}columnSelected(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,i=arguments.length>3?arguments[3]:void 0;if(!(i===void 0&&!this.isOverlayShown())){var{isolatedLinkerPanelId:a}=this.props,{linkInProgress:s}=this.state,o=F.getIdFromPanel(e);if(o!=null){var l=F.getComponentNameFromPanel(e),{name:d,type:h}=t;if(s==null||s.start==null){var c={id:Ee.generate(),start:{panelId:o,panelComponent:l,columnName:d,columnType:h},type:"invalid",isReversed:n};Ae.debug("starting link",c),this.setState({linkInProgress:c})}else{var{links:f}=this.props,{start:p,id:m,isReversed:b}=s,g={panelId:o,panelComponent:l,columnName:d,columnType:h},C=Fn.getLinkType(b!==void 0&&b?g:p,b!==void 0&&b?p:g,i??a);switch(C){case"invalid":Ae.debug("Ignore invalid link connection",s,g);return;case"filterSource":{var y=b!==void 0&&b?p.panelId:g.panelId,S=f.filter(T=>{var{end:I}=T;return(I==null?void 0:I.panelId)===y});this.deleteLinks(S);break}case"chartLink":{var w=b===!0?p:g,E=b===!0?g:p;Ae.debug("creating chartlink",{existingLinkEnd:w,start:p,end:g});var x=f.filter(T=>{var{end:I,start:j}=T;return(j==null?void 0:j.panelId)===E.panelId&&(I==null?void 0:I.panelId)===w.panelId&&(I==null?void 0:I.columnName)===w.columnName&&(I==null?void 0:I.columnType)===w.columnType});this.deleteLinks(x);break}}var D={start:b!==void 0&&b?g:p,end:b!==void 0&&b?p:g,id:m,type:C,operator:Zr.eq};Ae.info("creating link",D),this.setState({linkInProgress:void 0,selectedIds:new Set([m])},()=>{this.addLinks([D])})}}}}unsetFilterValueForLink(e){var{panelManager:t}=this.props;if(e.end){var{end:n}=e,{panelId:i,columnName:a,columnType:s}=n,o=t.getOpenedPanelById(i);o?Uh(o)?o.unsetFilterValue(a,s):Ae.debug("endPanel.unsetFilterValue not implemented",o):Ae.debug("endPanel no longer exists, ignoring unsetFilterValue",i)}}setPanelFilterMap(e,t){Ae.debug("Set filter data for panel:",e,t);var{panelManager:n}=this.props,i=n.getOpenedPanelById(e);i?Uh(i)?i.setFilterMap(t):Ae.debug("panel.setFilterMap not implemented",e,i):Ae.debug("panel no longer exists, ignoring setFilterMap",e)}addLinks(e){var{addDashboardLinks:t,localDashboardId:n}=this.props;t(n,e)}deleteLinks(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,{localDashboardId:n}=this.props;if(e.forEach(s=>this.unsetFilterValueForLink(s)),t){var{setDashboardLinks:i}=this.props;i(n,[])}else if(e.length>0){var{deleteDashboardLinks:a}=this.props;a(n,e.map(s=>{var{id:o}=s;return o}))}}handleAllLinksDeleted(){var{links:e,isolatedLinkerPanelId:t}=this.props;if(t===void 0)this.deleteLinks(e,!0);else{var n=e.filter(i=>{var a,s;return(i==null||(a=i.start)===null||a===void 0?void 0:a.panelId)===t||(i==null||(s=i.end)===null||s===void 0?void 0:s.panelId)===t});this.deleteLinks(n)}this.reset()}handleLinkDeleted(e){var{links:t}=this.props,n=t.find(i=>i.id===e);n?this.deleteLinks([n]):Ae.error("Unable to find link to delete",e)}handleUpdateValues(e,t){for(var n=F.getIdFromPanel(e),{dh:i,links:a,timeZone:s}=this.props,o=new Map,l=0;l<a.length;l+=1){var{start:d,end:h,operator:c}=a[l];if(d.panelId===n&&h!=null){var{panelId:f,columnName:p,columnType:m}=h,b=o.has(f)?o.get(f):new Map,g=b.has(p)===!0?b.get(p).filterList:[],{visibleIndex:C,isExpandable:y,isGrouped:S}=t[d.columnName],{value:w}=t[d.columnName],E="".concat(w);if(w===null&&y&&S&&(w=void 0),m!=null&&Ie.isDateType(m)){var x=new Lo(i,{timeZone:s,showTimeZone:!1,showTSeparator:!0,defaultDateTimeFormatString:Fo.FULL_DATE_FORMAT});E=x.format(w)}var D={operator:c,text:E,value:w,startColumnIndex:C};g.push(D),b.set(p,{columnType:m,filterList:g}),o.set(f,b)}}o.forEach((T,I)=>{this.setPanelFilterMap(I,T)})}handlePanelCloned(e,t){var{links:n}=this.props,i=F.getIdFromPanel(e),a=t.id;if(i!=null){var s=Fn.cloneLinksForPanel(n,i,a);this.addLinks(s)}}handlePanelDragging(e){for(var{links:t}=this.props,n=0;n<t.length;n+=1){var i=t[n],{start:a,end:s}=i;if(a.panelId===e||(s==null?void 0:s.panelId)===e){this.setState({isDraggingPanel:!0});return}}}handlePanelDropped(){this.setState({isDraggingPanel:!1})}handlePanelClosed(e){Ae.debug("Panel ".concat(e," closed, deleting links.")),this.deleteLinksForPanelId(e)}handleLinkSelected(e){this.setState({selectedIds:new Set([e])})}handleLinksUpdated(e){var{localDashboardId:t,setDashboardLinks:n}=this.props;n(t,e)}handleLayoutStateChanged(){this.forceUpdate()}handleStateChange(){this.forceUpdate()}handleExited(){var{localDashboardId:e,setDashboardIsolatedLinkerPanelId:t}=this.props;t(e,void 0)}deleteLinksForPanelId(e){for(var{links:t}=this.props,n=0;n<t.length;n+=1){var i=t[n],{start:a,end:s,id:o}=i;(a.panelId===e||(s==null?void 0:s.panelId)===e)&&this.handleLinkDeleted(o)}}isOverlayShown(){var{activeTool:e}=this.props;return e===Nt.LINKER}updateSelectionValidators(){var{activeTool:e,setDashboardColumnSelectionValidator:t,localDashboardId:n}=this.props;switch(e){case Nt.LINKER:t(n,this.isColumnSelectionValid);break;default:t(n,void 0);break}}updateLinkInProgressType(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"invalid";this.setState(t=>{var{linkInProgress:n}=t;return n!==void 0?{linkInProgress:Xh(Xh({},n),{},{type:e})}:null})}isColumnSelectionValid(e,t){var{linkInProgress:n}=this.state,{isolatedLinkerPanelId:i}=this.props;if(t==null)return(n==null?void 0:n.start)!=null&&this.updateLinkInProgressType(),!1;if(!Hh(t))return Ae.debug2("Column is not filterable",t.description),(n==null?void 0:n.start)!=null&&this.updateLinkInProgressType("invalid"),!1;if((n==null?void 0:n.start)==null)return!0;var{isReversed:a,start:s}=n,o=F.getIdFromPanel(e);if(o==null)return!1;var l={panelId:o,panelComponent:F.getComponentNameFromPanel(e),columnName:t.name,columnType:t.type},d=a!==void 0&&a?Fn.getLinkType(l,s,i):Fn.getLinkType(s,l,i);return this.updateLinkInProgressType(d),d!=="invalid"}render(){var{links:e,isolatedLinkerPanelId:t,panelManager:n}=this.props,{linkInProgress:i,selectedIds:a,isDraggingPanel:s}=this.state,o=this.isOverlayShown(),l=i!=null&&i.start!=null,d=t===void 0?"Click a column source, then click a column target to create a filter link. The filter comparison operator used by a selected link can be changed. Delete a filter link by clicking the delete button or with alt+click. Click done when finished.":"Create a link between the source column button and a table column by clicking on one, then the other. Delete a filter link by clicking the delete button or with alt+click. Click done when finished.";return s?null:u.jsx(Hn,{in:o,timeout:Vn.transitionMs,classNames:"fade",mountOnEnter:!0,unmountOnExit:!0,onExited:this.handleExited,children:u.jsx(EN,{disabled:l,panelManager:n,links:this.getCachedLinks(e,i,t),selectedIds:a,messageText:d,onLinkSelected:this.handleLinkSelected,onLinkDeleted:this.handleLinkDeleted,onAllLinksDeleted:this.handleAllLinksDeleted,onLinksUpdated:this.handleLinksUpdated,onDone:this.handleDone,onCancel:this.handleCancel})})}}var DN=TN(ON);const xN=DN;function pm(r){Kn(r);var{id:e,layout:t,panelManager:n}=r;return u.jsx(xN,{layout:t,localDashboardId:e,panelManager:n})}var IN={name:"LinkerPlugin",type:nt.DASHBOARD_PLUGIN,component:pm};const NN=IN;function mm(r,e,t){return e=MN(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function MN(r){var e=LN(r,"string");return typeof e=="symbol"?e:String(e)}function LN(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class Fr{static getNewMarkdownTitle(e){for(var t="".concat(Fr.DEFAULT_TITLE),n=0;e.indexOf(t)>=0;)n+=1,t="".concat(Fr.DEFAULT_TITLE,"-").concat(n);return t}}mm(Fr,"DEFAULT_TITLE","Note");mm(Fr,"DEFAULT_CONTENT",`# Markdown Note
|
|
27
27
|
|
|
28
28
|
This note can be edited using **markdown** for styling.`);const js=Fr;function gm(r){Kn(r);var{id:e,layout:t,panelManager:n,registerComponent:i}=r,a=v.useCallback(o=>{var{title:l,componentState:d,props:h}=o,{panelState:c=null}=h;return d!=null&&({panelState:c=null}=d),l==null||c==null||c.content==null||c.content.length===0||c.content===js.DEFAULT_CONTENT?null:qa(o)},[]),s=v.useCallback(function(){var{title:o="",metadata:l={},id:d=Ee.generate(),focusElement:h=F.DEFAULT_FOCUS_SELECTOR,createNewStack:c=!1,dragEvent:f=null}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},p=n.getOpenedPanelConfigsOfType(ir.COMPONENT),m=n.getClosedPanelConfigsOfType(ir.COMPONENT),b=p.map(w=>{var E;return(E=w.title)!==null&&E!==void 0?E:""}),g=o!=null&&o!==""?o:js.getNewMarkdownTitle(b),C=m.length>0?null:js.DEFAULT_CONTENT,y={type:"react-component",component:ir.COMPONENT,props:{id:d,metadata:l,panelState:{content:C},localDashboardId:e},title:g,id:d},{root:S}=t;F.openComponent({root:S,config:y,focusElement:h,createNewStack:c,dragEvent:f})},[e,t,n]);return v.useEffect(function(){var l=[i(ir.COMPONENT,ir,Ya,a)];return()=>{l.forEach(d=>d())}},[a,i]),ce(t.eventHub,wp.OPEN,s),null}var FN={name:"MarkdownPlugin",type:nt.DASHBOARD_PLUGIN,component:gm};const AN=FN;function Zh(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,n)}return t}function Qh(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Zh(Object(t),!0).forEach(function(n){RN(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):Zh(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function RN(r,e,t){return e=jN(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function jN(r){var e=kN(r,"string");return typeof e=="symbol"?e:String(e)}function kN(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}var Bl=v.forwardRef((r,e)=>{var{localDashboardId:t,fetch:n,metadata:i}=r,a=sm(n,t,i);return u.jsx(tm,Qh(Qh({ref:e},r),a))});Bl.displayName="PandasPanelPlugin";const $N=Bl;function Jh(r,e,t,n,i,a,s){try{var o=r[a](s),l=o.value}catch(d){t(d);return}o.done?e(l):Promise.resolve(l).then(n,i)}function ks(r){return function(){var e=this,t=arguments;return new Promise(function(n,i){var a=r.apply(e,t);function s(l){Jh(a,n,i,s,o,"next",l)}function o(l){Jh(a,n,i,s,o,"throw",l)}s(void 0)})}}function bm(r){var e=He(),[t,n]=v.useState(),[i,a]=v.useState(!0),[s,o]=v.useState(!1),{fetch:l}=r,d=v.useCallback(ks(function*(){var c=yield l();return ka.makeModel(e,c)}),[e,l]),h=v.useCallback(ks(function*(){a(!0);var c=yield d();n(c),a(!1)}),[d]);return v.useEffect(()=>{var c=!1;function f(){return p.apply(this,arguments)}function p(){return p=ks(function*(){var m=yield d();c||(n(m),o(!0),a(!1))}),p.apply(this,arguments)}return f(),a(!0),()=>{c=!0}},[d]),u.jsxs(u.Fragment,{children:[u.jsx(tt,{isLoaded:s,isLoading:i}),t&&u.jsx(_r,{model:t,children:u.jsx(em,{onClick:h})})]})}var UN={name:"PandasPanel",title:"Pandas",type:nt.WIDGET_PLUGIN,component:bm,panelComponent:Bl,supportedTypes:"pandas.DataFrame",icon:Sc};const HN=UN;function ec(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,n)}return t}function Xr(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?ec(Object(t),!0).forEach(function(n){VN(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):ec(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function VN(r,e,t){return e=BN(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function BN(r){var e=WN(r,"string");return typeof e=="symbol"?e:String(e)}function WN(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}var GN=B.module("WidgetLoaderPlugin");function zN(r){var e;function t(n,i){var a,s=r.component,{metadata:o}=n,l=bl(s);return u.jsx(Fi,Xr(Xr({widgetName:(a=o==null?void 0:o.name)!==null&&a!==void 0?a:void 0,widgetType:r.title},n),{},{children:l?u.jsx(s,Xr(Xr({},n),{},{ref:i})):u.jsx(s,Xr({},n))}))}return t.displayName="WidgetLoaderPlugin(".concat((e=r.component.displayName)!==null&&e!==void 0?e:r.name,")"),v.forwardRef(t)}function Cm(r){var e=Ga(),t=v.useMemo(()=>{var o=new Map;return e.forEach(l=>{_i(l)&&[l.supportedTypes].flat().forEach(d=>{if(d!=null&&d!==""){if(o.has(d)){var h;GN.warn("Multiple WidgetPlugins handling type ".concat(d,". Replacing ").concat((h=o.get(d))===null||h===void 0?void 0:h.name," with ").concat(l.name," to handle ").concat(d))}o.set(d,l)}})}),o},[e]);Kn(r);var{id:n,layout:i,registerComponent:a}=r,s=v.useCallback(o=>{var l,{dragEvent:d,panelId:h=Ee.generate(),fetch:c,widget:f}=o,{type:p}=f,m=p!=null?t.get(p):null;if(m!=null){var b=(l=f.name)!==null&&l!==void 0?l:p,g={localDashboardId:n,metadata:f,fetch:c},C={type:"react-component",component:m.name,props:g,title:b,id:h},{root:y}=i;F.openComponent({root:y,config:C,dragEvent:d})}},[n,i,t]);return v.useEffect(()=>{var o=[...new Set(t.values())].map(l=>{var{panelComponent:d}=l;return d==null?a(l.name,zN(l)):a(l.name,d)});return()=>{o.forEach(l=>l())}},[a,t]),ce(i.eventHub,te.OPEN,s),null}var KN={name:"WidgetLoaderPlugin",type:nt.DASHBOARD_PLUGIN,component:Cm};const qN=KN;function gs(r,e,t){return e=YN(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function YN(r){var e=XN(r,"string");return typeof e=="symbol"?e:String(e)}function XN(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class ji{}gs(ji,"DROPDOWN_FILTER","ControlType.DROPDOWN_FILTER");gs(ji,"INPUT_FILTER","ControlType.INPUT_FILTER");gs(ji,"MARKDOWN","ControlType.MARKDOWN");gs(ji,"FILTER_SET_MANAGER","ControlType.FILTER_SET_MANAGER");const ZN=ji;var QN=_.shape({state:_.shape({panelState:_.shape({})})}),JN=_.shape({panelId:_.string.isRequired,columnName:_.string.isRequired,columnType:_.string.isRequired}),tc=_.shape({panelId:_.string.isRequired,columnName:_.string.isRequired}),Sm=_.shape({start:tc,end:tc,id:_.string,isReversed:_.bool}),eM=_.arrayOf(Sm),tM=_.shape({name:_.string.isRequired,operateAs:_.string.isRequired,groups:_.arrayOf(_.string).isRequired,permissions:_.shape({canUsePanels:_.bool.isRequired,canCopy:_.bool.isRequired,canDownloadCsv:_.bool.isRequired,canLogout:_.bool.isRequired}).isRequired}),nM=Object.freeze({LinkPoint:JN,Link:Sm,Links:eM,Panel:QN,User:tM});const rM=nM;var iM=(r,e)=>r[e]===null?null:_.bool,aM=(r,e)=>r[e]===null?null:_.string,sM=Object.freeze({nullableBoolean:iM,nullableString:aM});const oM=sM,lM=Object.freeze(Object.defineProperty({__proto__:null,ChartBuilderPlugin:rm,ChartBuilderPluginConfig:ZI,ChartEvent:Da,ChartPanel:Ai,ChartPanelPlugin:zI,ChartPluginConfig:YI,ChartWidgetPlugin:nm,CommandHistoryPanel:Up,CommonPropTypes:oM,ConsoleEvent:pt,ConsolePanel:oa,ConsolePlugin:nN,ControlType:ZN,DropdownFilterPanel:Pn,FileExplorerPanel:Wp,FilterPlugin:im,FilterPluginConfig:iN,FilterSetManager:Gp,FilterSetManagerPanel:da,GridPanelPlugin:uN,GridPluginConfig:vN,GridWidgetPlugin:om,InputFilterEvent:Te,InputFilterPanel:Cr,IrisGridEvent:Et,IrisGridPanel:Nr,LinkerPlugin:pm,LinkerPluginConfig:NN,LinkerUtils:Fn,LogPanel:qp,MarkdownEvent:wp,MarkdownPanel:ir,MarkdownPlugin:gm,MarkdownPluginConfig:AN,MockFileStorage:UI,NotebookEvent:he,NotebookPanel:fn,PandasEvent:vD,PandasPanel:tm,PandasPanelPlugin:$N,PandasPluginConfig:HN,PandasWidgetPlugin:bm,Panel:Wt,TabEvent:ni,ToolType:Nt,UIPropTypes:rM,WidgetLoaderPlugin:Cm,WidgetLoaderPluginConfig:qN,WidgetPanel:Fi,WidgetPanelTooltip:Li,addDashboardLinks:Mp,deleteDashboardLinks:Lp,getColumnSelectionValidatorForDashboard:os,getColumnsForDashboard:Nl,getDashboardConnection:ID,getDashboardConsoleSettings:xD,getDashboardSessionWrapper:Ur,getFilterSetsForDashboard:Np,getInputFiltersForDashboard:is,getIsolatedLinkerPanelIdForDashboard:ss,getLinksForDashboard:Zn,getTableMapForDashboard:as,isChartPanelDehydratedProps:$p,isChartPanelFigureMetadata:Ll,isChartPanelTableMetadata:br,isGLChartPanelState:kp,isIrisGridPanelMetadata:Kp,isLegacyIrisGridPanelMetadata:zp,setDashboardColumnSelectionValidator:Fp,setDashboardConnection:ND,setDashboardConsoleSettings:Ap,setDashboardFilterSets:Rp,setDashboardIsolatedLinkerPanelId:Ml,setDashboardLinks:ls,setDashboardSessionWrapper:MD,useLoadTablePlugin:am},Symbol.toStringTag,{value:"Module"}));var ym={react:X,"react-dom":Ma,redux:Ym,"react-redux":Xm,"@adobe/react-spectrum":Zm,"@deephaven/auth-plugins":mw,"@deephaven/chart":Uw,"@deephaven/components":Gy,"@deephaven/dashboard":fT,"@deephaven/dashboard-core-plugins":lM,"@deephaven/icons":ib,"@deephaven/iris-grid":eD,"@deephaven/jsapi-bootstrap":Yy,"@deephaven/jsapi-components":$E,"@deephaven/jsapi-utils":lE,"@deephaven/log":B,"@deephaven/plugin":WE,"@deephaven/react-hooks":uS},dM=Qm.createRequires(ym),uM=Jm({requires:dM});const hM=uM;function nc(r,e,t,n,i,a,s){try{var o=r[a](s),l=o.value}catch(d){t(d);return}o.done?e(l):Promise.resolve(l).then(n,i)}function Wl(r){return function(){var e=this,t=arguments;return new Promise(function(n,i){var a=r.apply(e,t);function s(l){nc(a,n,i,s,o,"next",l)}function o(l){nc(a,n,i,s,o,"throw",l)}s(void 0)})}}var gn=B.module("@deephaven/app-utils.PluginUtils");function cM(r){return yo.apply(this,arguments)}function yo(){return yo=Wl(function*(r){var e=yield hM(r);return e}),yo.apply(this,arguments)}function vM(r){return Eo.apply(this,arguments)}function Eo(){return Eo=Wl(function*(r){var e=yield fetch(r);if(!e.ok)throw new Error(e.statusText);try{return yield e.json()}catch{throw new Error("Could not be parsed as JSON")}}),Eo.apply(this,arguments)}function fM(r){return wo.apply(this,arguments)}function wo(){return wo=Wl(function*(r){gn.debug("Loading plugins...");try{var e=yield vM("".concat(r,"/manifest.json"));if(!Array.isArray(e.plugins))throw new Error("Plugin manifest JSON does not contain plugins array");gn.debug("Plugin manifest loaded:",e);for(var t=[],n=0;n<e.plugins.length;n+=1){var{name:i,main:a}=e.plugins[n],s="".concat(r,"/").concat(i,"/").concat(a);t.push(cM(s))}for(var o=yield Promise.allSettled(t),l=new Map,d=0;d<o.length;d+=1){var h=o[d],{name:c}=e.plugins[d];if(h.status==="fulfilled"){var f,p=tf(h.value)?h.value:(f=h.value.default)!==null&&f!==void 0?f:h.value;p==null?gn.error("Plugin '".concat(c,"' is missing an exported value.")):l.set(c,p)}else gn.error("Unable to load plugin '".concat(c,"'"),h.reason)}return gn.info("Plugins loaded:",l),l}catch(m){return gn.error("Unable to load plugins:",m),new Map}}),wo.apply(this,arguments)}function pM(r){var e,t;return(e=(t=r.get("AuthHandlers"))===null||t===void 0?void 0:t.split(","))!==null&&e!==void 0?e:[]}function mM(r,e){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:new Map,n=pM(e),i=[...r.entries(),...t.entries()].filter(l=>{var[,d]=l;return rf(d)||ba(d)}).map(l=>{var[d,h]=l;return ba(h)?{type:nt.AUTH_PLUGIN,name:d,component:h.AuthPlugin.Component,isAvailable:h.AuthPlugin.isAvailable}:h}),a=i.filter(l=>{var{isAvailable:d}=l;return d(n,e)});if(a.length===0)throw new Error("No login plugins found, please register a login plugin for auth handlers: ".concat(n));a.length>1&&gn.warn("More than one login plugin available, will use the first one: ",a.map(l=>{var{name:d}=l;return d}).join(", "));var{name:s,component:o}=a[0];return gn.info("Using LoginPlugin",s),o}var gM=mc.createRequires(()=>ym),bM=mc.createRemoteComponent({requires:gM});const BM=bM;function rc(r,e,t,n,i,a,s){try{var o=r[a](s),l=o.value}catch(d){t(d);return}o.done?e(l):Promise.resolve(l).then(n,i)}function CM(r){return function(){var e=this,t=arguments;return new Promise(function(n,i){var a=r.apply(e,t);function s(l){rc(a,n,i,s,o,"next",l)}function o(l){rc(a,n,i,s,o,"throw",l)}s(void 0)})}}function SM(r){var{pluginsUrl:e,getCorePlugins:t,children:n}=r,[i,a]=v.useState(null);return v.useEffect(function(){var o=!1;function l(){return d.apply(this,arguments)}function d(){return d=CM(function*(){var h,c=(h=yield t==null?void 0:t())!==null&&h!==void 0?h:[],f=yield fM(e);if(!o){var p=c.map(m=>[m.name,m]);a(new Map([...p,...f]))}}),d.apply(this,arguments)}return l(),()=>{o=!0}},[e,t]),u.jsx(Pi.Provider,{value:i,children:n})}function yM(){var r=nl();return v.useEffect(function(){r.postMessage(Qo(Zo))},[r]),null}function ic(r,e,t,n,i,a,s){try{var o=r[a](s),l=o.value}catch(d){t(d);return}o.done?e(l):Promise.resolve(l).then(n,i)}function EM(r){return function(){var e=this,t=arguments;return new Promise(function(n,i){var a=r.apply(e,t);function s(l){ic(a,n,i,s,o,"next",l)}function o(l){ic(a,n,i,s,o,"throw",l)}s(void 0)})}}var wM=new Map([["@deephaven/auth-plugins.AuthPluginParent",{AuthPlugin:hf}],["@deephaven/auth-plugins.AuthPluginPsk",{AuthPlugin:pf}],["@deephaven/auth-plugins.AuthPluginAnonymous",{AuthPlugin:uf}]]);function PM(r){var{children:e}=r,t=Gn(),n=v.useContext(Pi),[i,a]=v.useState(),[s,o]=v.useState();v.useEffect(function(){var c=!1;function f(){return p.apply(this,arguments)}function p(){return p=EM(function*(){try{var m=yield t.getAuthConfigValues();c||a(new Map(m))}catch(b){c||o(b)}}),p.apply(this,arguments)}return f(),()=>{c=!0}},[t]);var l=v.useMemo(()=>{if(!(n==null||i==null))try{return mM(n,i,wM)}catch(h){o(h)}},[i,n]),d=l==null||i==null;return d||s!=null?u.jsx(tt,{isLoading:d&&s==null,errorMessage:Tr(s)}):u.jsx(l,{authConfigValues:i,children:u.jsxs(u.Fragment,{children:[u.jsx(yM,{}),e]})})}function ac(r,e,t,n,i,a,s){try{var o=r[a](s),l=o.value}catch(d){t(d);return}o.done?e(l):Promise.resolve(l).then(n,i)}function sc(r){return function(){var e=this,t=arguments;return new Promise(function(n,i){var a=r.apply(e,t);function s(l){ac(a,n,i,s,o,"next",l)}function o(l){ac(a,n,i,s,o,"throw",l)}s(void 0)})}}var _M=B.module("@deephaven/app-utils.ConnectionBootstrap");function TM(r){var{children:e}=r,t=He(),n=Gn(),[i,a]=v.useState(),[s,o]=v.useState();v.useEffect(function(){var h=!1;function c(){return f.apply(this,arguments)}function f(){return f=sc(function*(){try{var p=yield n.getAsIdeConnection();if(h)return;o(p)}catch(m){if(h)return;a(m)}}),f.apply(this,arguments)}return c(),()=>{h=!0}},[t,n]),v.useEffect(function(){if(s==null)return;function h(f){var{detail:p}=f;_M.info("Shutdown","".concat(JSON.stringify(p))),a("Server shutdown: ".concat(p??"Unknown reason"))}var c=s.addEventListener(t.IdeConnection.EVENT_SHUTDOWN,h);return c},[t,s]);var l=v.useCallback(function(){var d=sc(function*(h){return G(s,"No connection available to fetch object with"),s.getObject(Mv(h))});return function(h){return d.apply(this,arguments)}}(),[s]);return s==null||i!=null?u.jsx(tt,{"data-testid":"connection-bootstrap-loading",isLoading:s==null,errorMessage:i!=null?"".concat(i):void 0}):u.jsx(DC.Provider,{value:s,children:u.jsx(Xo.Provider,{value:l,children:e})})}function WM(r){return new URL(r,"".concat(window.location))}function OM(){var r=new URLSearchParams(window.location.search);return r.get("envoyPrefix")}function DM(){var r=OM();return r!=null?{headers:{"envoy-prefix":r}}:{headers:{}}}function xM(r){var{children:e}=r,t=v.useContext(Jv);return t?u.jsx(u.Fragment,{children:e}):u.jsx(tt,{"data-testid":"fonts-loaded-loading"})}function oc(r,e,t,n,i,a,s){try{var o=r[a](s),l=o.value}catch(d){t(d);return}o.done?e(l):Promise.resolve(l).then(n,i)}function IM(r){return function(){var e=this,t=arguments;return new Promise(function(n,i){var a=r.apply(e,t);function s(l){oc(a,n,i,s,o,"next",l)}function o(l){oc(a,n,i,s,o,"throw",l)}s(void 0)})}}var Em=v.createContext(null);function NM(r){var{children:e}=r,t=Gn(),[n,i]=v.useState(),[a,s]=v.useState();v.useEffect(function(){var d=!1;function h(){return c.apply(this,arguments)}function c(){return c=IM(function*(){try{var f=yield t.getServerConfigValues();d||i(new Map(f))}catch(p){d||s(p)}}),c.apply(this,arguments)}return h(),()=>{d=!0}},[t]);var o=n==null;return o||a!=null?u.jsx(tt,{isLoading:o&&a==null,errorMessage:Tr(a)}):u.jsx(Em.Provider,{value:n,children:e})}function MM(){return Ar(Em,"No server config available in useServerConfig. Was code wrapped in ServerConfigBootstrap or ServerConfigContext.Provider?")}function LM(r){var{children:e}=r,t=MM(),n=v.useContext(Vc),i=v.useContext(ja),a=gf(t,n,i);return u.jsx(Hc.Provider,{value:a,children:e})}function FM(r){var{children:e}=r,t=v.useContext(Pi),n=v.useMemo(()=>t==null?null:of(t),[t]);return u.jsx(Nc,{themes:n,children:u.jsx(yf,{children:u.jsx(RT,{children:u.jsx(qc,{children:e})})})})}function GM(r){var{fontClassNames:e,pluginsUrl:t,getCorePlugins:n,serverUrl:i,children:a}=r,s=v.useMemo(()=>DM(),[]),[o,l]=v.useState(0),d=v.useCallback(()=>{},[]),h=v.useCallback(()=>{l(c=>c+1)},[]);return Wa(d,h),u.jsx(UE,{fontClassNames:e,children:u.jsx(SM,{getCorePlugins:n,pluginsUrl:t,children:u.jsx(FM,{children:u.jsx(Dv,{serverUrl:i,options:s,children:u.jsx(qv,{children:u.jsx(PM,{children:u.jsx(NM,{children:u.jsx(LM,{children:u.jsx(TM,{children:u.jsx(xM,{children:a})})})})})})},o)})})})}export{GM as AppBootstrap,PM as AuthBootstrap,TM as ConnectionBootstrap,DC as ConnectionContext,UE as FontBootstrap,xM as FontsLoaded,Jv as FontsLoadedContext,SM as PluginsBootstrap,BM as RemoteComponent,FM as ThemeBootstrap,pM as getAuthHandlers,mM as getAuthPluginComponent,WM as getBaseUrl,DM as getConnectOptions,OM as getEnvoyPrefix,vM as loadJson,cM as loadModulePlugin,fM as loadModulePlugins,qM as useConnection,MM as useServerConfig,YM as useUser};
|
|
29
|
-
//# sourceMappingURL=index-
|
|
29
|
+
//# sourceMappingURL=index-df7a6430.js.map
|