@deephaven/embed-grid 0.59.1-beta.3 → 0.59.1-beta.4
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-502ea112.js → App-84117096.js} +2 -2
- package/build/assets/{App-502ea112.js.map → App-84117096.js.map} +1 -1
- package/build/assets/{index-852d649a.js → index-2189151d.js} +2 -2
- package/build/assets/{index-852d649a.js.map → index-2189151d.js.map} +1 -1
- package/build/assets/{index-649698fd.js → index-6c9144d0.js} +2 -2
- package/build/assets/{index-649698fd.js.map → index-6c9144d0.js.map} +1 -1
- package/build/assets/index-7f31a5ce.css +1 -0
- package/build/assets/{useUser-a8635456.js → useUser-5fc898b9.js} +2 -2
- package/build/assets/{useUser-a8635456.js.map → useUser-5fc898b9.js.map} +1 -1
- package/build/index.html +1 -1
- package/package.json +14 -14
- package/build/assets/index-e444fcd7.css +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{C as h,$ as dl,H as Ca,I as nr,F as me,J as Pa,r as c,K as qe,L as Ne,M as cl,N as Ta,O as hl,P as Oa,Q as fl,S as vl,T as Gr,U as it,G as q,E as X,V as C,W as ml,D as zt,X as Ia,Y as pl,Z as gl,_ as bl,a0 as yl,a1 as Da,a2 as _l,a3 as wl,a4 as ft,a5 as xa,a6 as He,a7 as Dn,a8 as L,R as Aa,a9 as Kr,aa as Sl,ab as El,ac as Cl,ad as rr,ae as Pl,af as Tl,ag as Ol,ah as Il,ai as Dl,aj as Ma}from"./vendor-3c5b37f3.js";import{L as H,i as xl,v as Na,M as ir,b as ar,c as La,d as Al,e as Ml,a as Pe,f as ja,g as Nl,h as Ll,r as or,j as ze,k as jl,l as Fl,m as Rl,T as Gt,C as kl,D as $l,n as Bl,o as Ul,p as Wl,q as Fa,N as Vl,S as Hl,s as zl,t as Gl,W as Kl,u as Xl,w as Yl,x as ql,y as Zl,z as Jl,A as Ql,B as Ra,E as ka,F as eu,G as tu,H as nu,I as ru,J as iu,K as au,O as ou,P as su,Q as lu,R as $a,U as uu,V as Xr,X as du,Y as cu,Z as hu,_ as fu}from"./index-649698fd.js";import{T as rn,g as vu,c as Pt,d as mu,e as pu,h as Ba,P as an,B as _e,i as Vt,M as sr,D as Ua,j as Wa,k as gu,S as lr,R as Yr,l as xn,m as An,n as Va,o as Mn,p as Tt,q as bu,r as yu,s as _u,C as wu,t as Ha,v as Su,w as Eu,G as Cu,x as Pu,K as Tu,y as Ou,z as Iu,A as Du,O as xu,E as Au,F as Mu,H as Nu,J as Lu,L as za,N as ju,Q as Fu,U as Ru,V as ku,W as Ga,X as $u,Y as Bu,Z as Uu,_ as Wu,$ as Te,a0 as Vu,a1 as Hu,a2 as zu,a3 as Gu,a4 as Ka,a5 as Ku,a6 as Xu,a7 as Yu,a8 as on,a9 as lt,aa as qu,ab as Zu,ac as Ju,ad as _t,ae as Qu,af as ur,ag as ed,ah as Xa,ai as Ya,aj as dr,ak as cr,al as qa,am as Za,an as Ja,f as td,ao as Qa,ap as nd,aq as rd,ar as hr,as as Kt,at as id,au as eo,av as qr,aw as ad,ax as od,ay as to,az as sd,u as ld,aA as ud,aB as sn,aC as no,aD as ro,aE as dd,aF as cd,aG as hd,I as Zr,aH as fd,aI as vd,aJ as md,aK as pd,aL as gd,aM as bd,aN as yd,aO as _d,aP as wd,aQ as Sd,aR as Ed,aS as Cd,aT as Pd,aU as Td,aV as Od,aW as Id,b as Dd,aX as xd,aY as Ad,aZ as Md,a_ as Nd,a$ as Ld,b0 as io,b1 as jd,b2 as Fd,b3 as Rd,b4 as kd,b5 as $d,b6 as Bd,b7 as Ud,b8 as Wd,b9 as Vd,ba as Hd,bb as zd,bc as Gd,bd as Kd,be as Xd,bf as Yd,bg as qd,bh as Zd}from"./useUser-a8635456.js";import{a as qb}from"./useUser-a8635456.js";import{c as gn,P as fr,b as Jd,h as Qd,p as ec,o as tc,s as nc,t as rc}from"./plotly-c8d8354a.js";import"./helpers-042e6b4d.js";import"./monaco-9eb7d7d5.js";function vt(n){var e=n;n instanceof CustomEvent&&(e=n.detail);var t="";if(e instanceof Error?t=e.message:e!=null&&(t="".concat(e)),t=t.trim(),t.length>0)return t}var ao=24,ic=32,ac=33,oc=150,oo=200,so=500,lo=250,sc={spellCheck:!1},lc=["ariaLabel","icon","isQuiet","labelText","children","onOpenChange","tooltip"];function Jr(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function Qr(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Jr(Object(t),!0).forEach(function(r){uc(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Jr(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function uc(n,e,t){return e=dc(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function dc(n){var e=cc(n,"string");return typeof e=="symbol"?e:String(e)}function cc(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function hc(n,e){if(n==null)return{};var t=fc(n,e),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(n);for(i=0;i<a.length;i++)r=a[i],!(e.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(n,r)&&(t[r]=n[r])}return t}function fc(n,e){if(n==null)return{};var t={},r=Object.keys(n),i,a;for(a=0;a<r.length;a++)i=r[a],!(e.indexOf(i)>=0)&&(t[i]=n[i]);return t}function uo(n){var{ariaLabel:e,icon:t,isQuiet:r,labelText:i,children:a,onOpenChange:o,tooltip:s}=n,l=hc(n,lc),u=i==null&&s!=null?"action-button-icon-with-tooltip":void 0;return h.jsxs(dl,{type:"popover",onOpenChange:o,children:[h.jsxs(Ca,Qr(Qr({},l),{},{"aria-label":e??i,isQuiet:r,children:[h.jsx(nr,{UNSAFE_className:u,children:h.jsx(me,{icon:t})}),i==null?null:h.jsx(Pa,{children:i}),s==null?null:h.jsx(rn,{children:s})]})),a]})}function vc(n,e){return n===0?0:e==="all"||n===e.size?"all":e.size}function co(n,e){return n===e?!0:n==="all"||e==="all"||n.size!==e.size?!1:[...n.keys()].every(t=>e.has(t))}function ho(n,e){return n.isInverted===e.isInverted&&co(n.selection,e.selection)}function fo(n,e,t){if(n==="all")return"all";var r=[...n.keys()];return new Set(r.map(i=>t(e(i))))}function vo(n,e){var t=n==="all"||n.size>e/2,r=n;return t&&(r=n==="all"?new Set:new Set([...vu(0,e-1)].filter(i=>!n.has(String(i))).map(i=>String(i)))),{selection:r,isInverted:t}}function mc(n,e){return n?{}:{errorMessage:e,validationState:"invalid"}}function mo(n){var e;return(e=n==null?void 0:n.UNSAFE_getDOMNode())!==null&&e!==void 0?e:null}function pc(n){var e=n==null?void 0:n.UNSAFE_getDOMNode().lastElementChild;return po(e)}function gc(n){var e=n==null?void 0:n.UNSAFE_getDOMNode(),t=e==null?void 0:e.querySelector("input"),r=t==null?void 0:t.getAttribute("aria-controls"),i=r==null?null:document.getElementById(r);return i}function po(n){return n instanceof HTMLElement?n:null}function go(){var n=c.useRef(!1);return c.useEffect(()=>(n.current=!0,()=>{n.current=!1}),[]),n}function ei(n,e,t,r,i,a,o){try{var s=n[a](o),l=s.value}catch(u){t(u);return}s.done?e(l):Promise.resolve(l).then(r,i)}function bc(n){return function(){var e=this,t=arguments;return new Promise(function(r,i){var a=n.apply(e,t);function o(l){ei(a,r,i,o,s,"next",l)}function s(l){ei(a,r,i,o,s,"throw",l)}o(void 0)})}}var bn=H.module("useAsyncInterval");function yc(n,e){var t=go(),r=c.useRef(0),i=c.useRef(0),a=c.useRef(null),o=c.useCallback(bc(function*(){var s=Date.now();i.current+=1;var l=a.current==null?e:s-a.current;if(bn.debug("tick #".concat(i.current,"."),l,"ms elapsed since last tick."),a.current=s,yield n(),!!t.current){l+=Date.now()-a.current;var u=Math.max(0,l-e),d=Math.max(0,e-u);bn.debug("Next tick target:",e,", overage",u,", adjusted:",d),r.current=window.setTimeout(o,d)}}),[n,t,e]);c.useEffect(()=>(bn.debug("Setting target interval:",e),a.current=null,o(),()=>{window.clearTimeout(r.current)}),[e,o])}function _c(n,e){return c.useCallback(function(){var t=n(...arguments);return e(),t},[e,n])}function Xt(n,e){var t=c.useMemo(()=>qe(n,e),[n,e]);return c.useEffect(()=>()=>t.cancel(),[t]),t}function wc(n){var[e,t]=c.useState(n);return c.useEffect(()=>{t(n)},[n]),[e,t]}function Sc(n,e,t,r){var i=c.useRef(0);c.useEffect(()=>{i.current>=t||r&&(i.current+=1,n())},[t,r,...e])}function bo(n,e){var t=c.useRef(n),r=e(t.current,n)?t.current:n;return t.current=r,r}function Ec(n){n.preventDefault()}function yo(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,e=c.useMemo(()=>"useSubmitButtonRef-".concat(Ne()),[]),t=c.useCallback(a=>{a==null||a.UNSAFE_getDOMNode().setAttribute("form",e)},[e]),r=c.useMemo(()=>({id:e,onSubmit:n?void 0:Ec}),[e,n]),i=c.useMemo(()=>({form:e,ref:t}),[e,t]);return{formProps:r,submitButtonProps:i}}function _o(n,e){return c.useCallback(t=>{typeof n=="function"?n(e(t)):n.current=e(t)},[e,n])}function wo(n,e){var{getItem:t,selectedKeys:r,items:i}=n;return c.useMemo(()=>{var{selection:a,isInverted:o}=vo(r,i.length);return{selection:fo(a,t,e),isInverted:o}},[r,i.length,t,e])}function Cc(n){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:xl,t=c.useRef();return c.useEffect(()=>()=>{var r;return(r=t.current)===null||r===void 0?void 0:r.call(t)},[]),c.useCallback(r=>{var i;(i=t.current)===null||i===void 0||i.call(t);var a=e(r);a&&(a.addEventListener("scroll",n),t.current=()=>{a.removeEventListener("scroll",n),t.current=void 0})},[e,n])}function ti(n,e,t,r,i,a,o){try{var s=n[a](o),l=s.value}catch(u){t(u);return}s.done?e(l):Promise.resolve(l).then(r,i)}function Pc(n){return function(){var e=this,t=arguments;return new Promise(function(r,i){var a=n.apply(e,t);function o(l){ti(a,r,i,o,s,"next",l)}function s(l){ti(a,r,i,o,s,"throw",l)}o(void 0)})}}function Tc(n,e,t){var r=c.useRef(null),[i,a]=c.useState(null),o=c.useCallback(Pc(function*(){if(!(i==null||t==null)){var l=yield t();i.scroll(0,l)}}),[t,i]);c.useEffect(()=>(i==null||i.addEventListener("scroll",e),o(),()=>{i==null||i.removeEventListener("scroll",e)}),[e,i,o]);var s=c.useCallback(l=>{l&&setTimeout(()=>{a(n(r.current))},0)},[n]);return{ref:r,onOpenChange:s}}function ni(n,e,t,r,i,a,o){try{var s=n[a](o),l=s.value}catch(u){t(u);return}s.done?e(l):Promise.resolve(l).then(r,i)}function Oc(n){return function(){var e=this,t=arguments;return new Promise(function(r,i){var a=n.apply(e,t);function o(l){ni(a,r,i,o,s,"next",l)}function s(l){ni(a,r,i,o,s,"throw",l)}o(void 0)})}}function wt(n,e){var{autoLoad:t=!0}=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},[r,i]=c.useState(null),[a,o]=c.useState(null),[s,l]=c.useState(!1),u=c.useCallback(Oc(function*(){l(!0);try{var d=yield n(...e);i(d),o(null)}catch(f){i(null),o(f)}finally{l(!1)}}),[n,...e]);return c.useEffect(()=>{t&&u()},[t,u]),{data:r,error:a,isError:a!=null,isLoading:s,reload:u}}function ri(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function ii(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?ri(Object(t),!0).forEach(function(r){Ic(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):ri(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function Ic(n,e,t){return e=Dc(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Dc(n){var e=xc(n,"string");return typeof e=="symbol"?e:String(e)}function xc(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function Ac(n,e,t,r){var i=arguments.length===4;return c.useCallback(a=>{var o=i?a??r:a;t(ii(ii({},n),{},{[e]:o}))},[t,n,e,i,r])}function So(n,e){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,r=c.useRef(),i=c.useRef(0);return c.useCallback(a=>{window.clearTimeout(r.current),r.current=window.setTimeout(()=>{var o=Math.floor(a.target.scrollTop/n);i.current!==o&&(i.current=o,e(o))},t)},[t,n,e])}function ln(n,e){var[t,r]=c.useState(n);return c.useEffect(()=>{var i=setTimeout(()=>{r(n)},e);return()=>{clearTimeout(i)}},[n,e]),t}function Eo(n,e){return c.useCallback(t=>{if(t!=null){var r=e==null?[t]:t.querySelectorAll(e);r.forEach(i=>{Object.entries(n).forEach(a=>{var[o,s]=a;i.setAttribute(o,s)})})}},[n,e])}function Mc(n){var e=Eo(sc,n);return _o(e,mo)}function Co(){var{getKey:n=Po}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},[e,t]=c.useState([]),[r,i]=c.useState(()=>new Set),a=c.useCallback(p=>g=>n(g)===p,[n]),o=c.useCallback(p=>{var g;return(g=e.find(a(p)))!==null&&g!==void 0?g:null},[e,a]),s=c.useCallback(p=>{var g=o(p);if(g==null)throw new Error("No item found matching key: ".concat(p));return g},[o]),l=c.useCallback(p=>{t(g=>[...g,...p])},[]),u=c.useCallback((p,g)=>{t(b=>[...b.slice(0,p),...g,...b.slice(p)])},[]),d=c.useCallback(p=>{var g=new Set(p);t(b=>b.filter(_=>!g.has(n(_))))},[n]),f=c.useCallback((p,g)=>{var b=e.findIndex(a(p));b!==-1&&t(_=>[..._.slice(0,b),g,..._.slice(b+1)])},[e,a]),v=c.useCallback(p=>{if(p.size!==0){var g=[],b=new Map;for(var _ of p.keys()){var S=e.findIndex(a(_));g.push(S),b.set(S,_)}g.sort((T,y)=>T-y);var w=[];e.forEach((T,y)=>{if(g[0]===y){var O=b.get(g.shift()),M=p.get(O);w.push(M)}else w.push(T)}),t(w)}},[e,a]),m=c.useMemo(()=>({items:e,selectedKeys:r,append:l,bulkUpdate:v,findItem:o,getItem:s,insert:u,remove:d,setItems:t,setSelectedKeys:i,update:f}),[l,v,o,s,u,e,d,t,r,f]);return m}function Po(n){var e=n!=null&&typeof n=="object"&&"key"in n;if(!e)throw new Error("Item does not have a `key` prop.");return n.key}function To(n,e){c.useEffect(()=>{if(n!=null){var t=new window.ResizeObserver(e);return t.observe(n),()=>{n!=null&&t.unobserve(n)}}},[n,e])}const Nc=Object.freeze(Object.defineProperty({__proto__:null,createValidationProps:mc,defaultGetKey:Po,extractSpectrumHTMLElement:mo,extractSpectrumLastChildHTMLElement:pc,findSpectrumComboBoxScrollArea:gc,getSelectedItemCountOrAll:vc,identityExtractHTMLElement:po,isSelectionEqual:co,isSelectionMaybeInvertedEqual:ho,mapSelection:fo,optimizeSelection:vo,useAsyncInterval:yc,useCallbackWithAction:_c,useContextOrThrow:Pt,useCopyToClipboard:mu,useDebouncedCallback:Xt,useDebouncedValue:ln,useDependentState:wc,useEffectNTimesWhen:Sc,useFormWithDetachedSubmitButton:yo,useForwardedRef:pu,useIsEqualMemo:bo,useIsMountedRef:go,useMappedRef:_o,useMappedSelection:wo,useOnScrollOffsetChangeCallback:So,useOnScrollRef:Cc,usePopoverOnScrollRef:Tc,usePrevious:Ba,usePromiseFactory:wt,usePropChangeCallback:Ac,useResizeObserver:To,useSetAttributesCallback:Eo,useSpectrumDisableSpellcheckRef:Mc,useWindowedListData:Co},Symbol.toStringTag,{value:"Module"})),Lc="_spectrumActionBar_tmmkp_5",jc="_spectrumDialogComponentHeading_tmmkp_9",Fc="_spectrumEllipsis_tmmkp_14",vr={spectrumActionBar:Lc,spectrumDialogComponentHeading:jc,spectrumEllipsis:Fc};function ai(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function Lt(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?ai(Object(t),!0).forEach(function(r){Rc(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):ai(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function Rc(n,e,t){return e=kc(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function kc(n){var e=$c(n,"string");return typeof e=="symbol"?e:String(e)}function $c(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function Oo(n){var{heading:e,confirmationButtonLabel:t,children:r,onCancel:i,onConfirm:a}=n,{formProps:o,submitButtonProps:s}=yo();return h.jsxs(cl,{children:[h.jsx(Ta,{level:3,UNSAFE_className:vr.spectrumDialogComponentHeading,children:e}),h.jsx(hl,{}),h.jsx(Oa,{children:h.jsx(fl,Lt(Lt({},o),{},{children:r}))}),h.jsxs(vl,{children:[h.jsx(Gr,{variant:"secondary",onPress:i,children:"Cancel"}),h.jsx(Gr,Lt(Lt({},s),{},{style:"fill",variant:"negative",onPress:a,type:"submit",children:t}))]})]})}function Bc(n){var{ariaLabel:e,heading:t,confirmationButtonLabel:r,isHidden:i,children:a,tooltip:o,onConfirm:s}=n,l=c.useCallback(u=>h.jsx(Oo,{heading:t,confirmationButtonLabel:r,onCancel:u,onConfirm:()=>{u(),s()},children:a}),[a,r,t,s]);return h.jsx(uo,{ariaLabel:e,icon:Na,isHidden:i,isQuiet:!0,height:ao,tooltip:o,children:l})}var Uc=["icon","label","tooltip"];function oi(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function si(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?oi(Object(t),!0).forEach(function(r){Wc(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):oi(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function Wc(n,e,t){return e=Vc(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Vc(n){var e=Hc(n,"string");return typeof e=="symbol"?e:String(e)}function Hc(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function zc(n,e){if(n==null)return{};var t=Gc(n,e),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(n);for(i=0;i<a.length;i++)r=a[i],!(e.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(n,r)&&(t[r]=n[r])}return t}function Gc(n,e){if(n==null)return{};var t={},r=Object.keys(n),i,a;for(a=0;a<r.length;a++)i=r[a],!(e.indexOf(i)>=0)&&(t[i]=n[i]);return t}function Io(n){var{icon:e,label:t,tooltip:r}=n,i=zc(n,Uc);return h.jsxs(Ca,si(si({},i),{},{"aria-label":t,isQuiet:!0,height:ao,children:[h.jsx(nr,{UNSAFE_className:r==null?void 0:"action-button-icon-with-tooltip",children:h.jsx(me,{icon:e})}),r==null?null:h.jsx(rn,{children:r})]}))}Io.displayName="IconActionButton";function li(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function Kc(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?li(Object(t),!0).forEach(function(r){Ae(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):li(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function Ae(n,e,t){return e=Xc(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Xc(n){var e=Yc(n,"string");return typeof e=="symbol"?e:String(e)}function Yc(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var qc=100,Nn;(function(n){n.UP="UP",n.DOWN="DOWN"})(Nn||(Nn={}));class Se extends c.Component{constructor(e){super(e),Ae(this,"popper",void 0),Ae(this,"cbContainer",void 0),Ae(this,"menuContainer",void 0),Ae(this,"input",void 0),Ae(this,"getCachedFilteredOptions",it((r,i)=>r.filter(a=>a.title.toLowerCase().indexOf(i.toLowerCase())>=0)));var{popperOptions:t}=this.props;t=Kc({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=qe(this.updateInputValue,qc),this.handleOptionClick=this.handleOptionClick.bind(this),this.handleMenuOpened=this.handleMenuOpened.bind(this),this.handleMenuExited=this.handleMenuExited.bind(this),this.popper=q.createRef(),this.cbContainer=q.createRef(),this.menuContainer=q.createRef(),this.input=q.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,r=t.filter(i=>i.title.toLowerCase()===e.toLowerCase());return r.length<1?(this.setState({invalid:!0}),{value:e,isValid:!1}):(this.setState({invalid:!1}),{value:r[0].value,isValid:!0})}updateInputValue(e){var{menuIsOpen:t}=this.state,{value:r,isValid:i}=this.getValueAndValidate(e);t&&this.processFilterChange(e),this.fireOnChange(r,i)}fireOnChange(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,{onChange:r}=this.props;r(e,t)}processFilterChange(e){var t,{options:r}=this.props,{menuIsOpen:i}=this.state,a=e?this.getCachedFilteredOptions(r,e):r,o=a.length===1&&a[0].title===e;if(this.setState({filteredOptions:a,keyboardOptionIndex:0}),o&&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:r,keyboardOptionIndex:i}=this.state,a=r[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(Se.MENU_NAVIGATION_DIRECTION.UP);break;case"ArrowDown":e.stopPropagation(),e.preventDefault(),this.navigateMenu(Se.MENU_NAVIGATION_DIRECTION.DOWN);break;case"Tab":if(e.stopPropagation(),e.preventDefault(),e.shiftKey){this.navigateMenu(Se.MENU_NAVIGATION_DIRECTION.UP);break}this.navigateMenu(Se.MENU_NAVIGATION_DIRECTION.DOWN);break;case"Escape":e.preventDefault(),e.stopPropagation(),this.closeMenu();break}}navigateMenu(e){var{filteredOptions:t,keyboardOptionIndex:r}=this.state,i=r;e===Se.MENU_NAVIGATION_DIRECTION.UP?r>0?(i=(i-1)%t.length,this.setState({keyboardOptionIndex:i})):r===0&&(i=t.length-1,this.setState({keyboardOptionIndex:i})):e===Se.MENU_NAVIGATION_DIRECTION.DOWN&&r<t.length&&(i=(i+1)%t.length,this.setState({keyboardOptionIndex:i})),this.scrollOptionIntoView(i)}handleInputKeyDown(e){var{onEnter:t}=this.props,{menuIsOpen:r}=this.state;r?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 r;(r=this.input.current)===null||r===void 0||r.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 h.jsx("div",{className:X("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:r}=this.state;return t&&r.length===0?h.jsx("div",{className:"no-match",children:e}):r.map((i,a)=>this.renderOption(i,a))}renderOption(e,t){var{keyboardOptionIndex:r}=this.state,i="option-".concat(t,"-").concat(e.value);return h.jsx("button",{type:"button",className:X("aci-option-btn",{"keyboard-active":r===t}),onClick:()=>this.handleOptionClick(e),onFocus:()=>this.setState({keyboardOptionIndex:t}),children:e.title},i)}render(){var{options:e,inputPlaceholder:t,disabled:r,className:i,defaultTitle:a,spellCheck:o,"data-testid":s}=this.props,{title:l,menuIsOpen:u,popperOptions:d,invalid:f}=this.state;return h.jsxs("div",{className:"aci-container",ref:this.cbContainer,children:[h.jsx("input",{value:l||a,className:X("form-control",i,"aci-input",{"is-invalid":f&&!u}),ref:this.input,onChange:this.handleInputChange,placeholder:t||e[0].title,disabled:r,onFocus:this.handelInputFocus,onClick:this.handleInputClick,onBlur:this.handleInputBlur,onKeyDown:this.handleInputKeyDown,spellCheck:o,"data-testid":s}),h.jsx(an,{ref:this.popper,options:d,className:X("aci-options-popper interactive"),onEntered:this.handleMenuOpened,onExited:this.handleMenuExited,children:this.renderMenuElement()})]})}}Ae(Se,"propTypes",{options:C.arrayOf(C.shape({title:C.string.isRequired,value:C.string.isRequired})).isRequired,popperOptions:C.shape({}),onChange:C.func,inputPlaceholder:C.string,disabled:C.bool,className:C.string,defaultTitle:C.string,spellCheck:C.bool,onEnter:C.func,noMatchText:C.string,"data-testid":C.string});Ae(Se,"defaultProps",{onChange(){},inputPlaceholder:"",disabled:!1,className:"",defaultTitle:"",popperOptions:null,spellCheck:!0,onEnter(){},noMatchText:"No matching items found","data-testid":void 0});Ae(Se,"MENU_NAVIGATION_DIRECTION",Nn);const Zc=Se;function mr(n){var{className:e="",value:t,onChange:r,spellCheck:i=!1,placeholder:a="",disabled:o=!1,delimiter:s="",id:l="","data-testid":u}=n,[d,f]=c.useState(t),[v,m]=c.useState(!1),p=c.useRef(null);c.useEffect(function(){f(t)},[t]);function g(M){return M.trim().split(s).filter(A=>A).join(`
|
|
1
|
+
import{C as h,$ as dl,H as Ca,I as nr,F as me,J as Pa,r as c,K as qe,L as Ne,M as cl,N as Ta,O as hl,P as Oa,Q as fl,S as vl,T as Gr,U as it,G as q,E as X,V as C,W as ml,D as zt,X as Ia,Y as pl,Z as gl,_ as bl,a0 as yl,a1 as Da,a2 as _l,a3 as wl,a4 as ft,a5 as xa,a6 as He,a7 as Dn,a8 as L,R as Aa,a9 as Kr,aa as Sl,ab as El,ac as Cl,ad as rr,ae as Pl,af as Tl,ag as Ol,ah as Il,ai as Dl,aj as Ma}from"./vendor-3c5b37f3.js";import{L as H,i as xl,v as Na,M as ir,b as ar,c as La,d as Al,e as Ml,a as Pe,f as ja,g as Nl,h as Ll,r as or,j as ze,k as jl,l as Fl,m as Rl,T as Gt,C as kl,D as $l,n as Bl,o as Ul,p as Wl,q as Fa,N as Vl,S as Hl,s as zl,t as Gl,W as Kl,u as Xl,w as Yl,x as ql,y as Zl,z as Jl,A as Ql,B as Ra,E as ka,F as eu,G as tu,H as nu,I as ru,J as iu,K as au,O as ou,P as su,Q as lu,R as $a,U as uu,V as Xr,X as du,Y as cu,Z as hu,_ as fu}from"./index-6c9144d0.js";import{T as rn,g as vu,c as Pt,d as mu,e as pu,h as Ba,P as an,B as _e,i as Vt,M as sr,D as Ua,j as Wa,k as gu,S as lr,R as Yr,l as xn,m as An,n as Va,o as Mn,p as Tt,q as bu,r as yu,s as _u,C as wu,t as Ha,v as Su,w as Eu,G as Cu,x as Pu,K as Tu,y as Ou,z as Iu,A as Du,O as xu,E as Au,F as Mu,H as Nu,J as Lu,L as za,N as ju,Q as Fu,U as Ru,V as ku,W as Ga,X as $u,Y as Bu,Z as Uu,_ as Wu,$ as Te,a0 as Vu,a1 as Hu,a2 as zu,a3 as Gu,a4 as Ka,a5 as Ku,a6 as Xu,a7 as Yu,a8 as on,a9 as lt,aa as qu,ab as Zu,ac as Ju,ad as _t,ae as Qu,af as ur,ag as ed,ah as Xa,ai as Ya,aj as dr,ak as cr,al as qa,am as Za,an as Ja,f as td,ao as Qa,ap as nd,aq as rd,ar as hr,as as Kt,at as id,au as eo,av as qr,aw as ad,ax as od,ay as to,az as sd,u as ld,aA as ud,aB as sn,aC as no,aD as ro,aE as dd,aF as cd,aG as hd,I as Zr,aH as fd,aI as vd,aJ as md,aK as pd,aL as gd,aM as bd,aN as yd,aO as _d,aP as wd,aQ as Sd,aR as Ed,aS as Cd,aT as Pd,aU as Td,aV as Od,aW as Id,b as Dd,aX as xd,aY as Ad,aZ as Md,a_ as Nd,a$ as Ld,b0 as io,b1 as jd,b2 as Fd,b3 as Rd,b4 as kd,b5 as $d,b6 as Bd,b7 as Ud,b8 as Wd,b9 as Vd,ba as Hd,bb as zd,bc as Gd,bd as Kd,be as Xd,bf as Yd,bg as qd,bh as Zd}from"./useUser-5fc898b9.js";import{a as qb}from"./useUser-5fc898b9.js";import{c as gn,P as fr,b as Jd,h as Qd,p as ec,o as tc,s as nc,t as rc}from"./plotly-c8d8354a.js";import"./helpers-042e6b4d.js";import"./monaco-9eb7d7d5.js";function vt(n){var e=n;n instanceof CustomEvent&&(e=n.detail);var t="";if(e instanceof Error?t=e.message:e!=null&&(t="".concat(e)),t=t.trim(),t.length>0)return t}var ao=24,ic=32,ac=33,oc=150,oo=200,so=500,lo=250,sc={spellCheck:!1},lc=["ariaLabel","icon","isQuiet","labelText","children","onOpenChange","tooltip"];function Jr(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function Qr(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Jr(Object(t),!0).forEach(function(r){uc(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Jr(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function uc(n,e,t){return e=dc(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function dc(n){var e=cc(n,"string");return typeof e=="symbol"?e:String(e)}function cc(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function hc(n,e){if(n==null)return{};var t=fc(n,e),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(n);for(i=0;i<a.length;i++)r=a[i],!(e.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(n,r)&&(t[r]=n[r])}return t}function fc(n,e){if(n==null)return{};var t={},r=Object.keys(n),i,a;for(a=0;a<r.length;a++)i=r[a],!(e.indexOf(i)>=0)&&(t[i]=n[i]);return t}function uo(n){var{ariaLabel:e,icon:t,isQuiet:r,labelText:i,children:a,onOpenChange:o,tooltip:s}=n,l=hc(n,lc),u=i==null&&s!=null?"action-button-icon-with-tooltip":void 0;return h.jsxs(dl,{type:"popover",onOpenChange:o,children:[h.jsxs(Ca,Qr(Qr({},l),{},{"aria-label":e??i,isQuiet:r,children:[h.jsx(nr,{UNSAFE_className:u,children:h.jsx(me,{icon:t})}),i==null?null:h.jsx(Pa,{children:i}),s==null?null:h.jsx(rn,{children:s})]})),a]})}function vc(n,e){return n===0?0:e==="all"||n===e.size?"all":e.size}function co(n,e){return n===e?!0:n==="all"||e==="all"||n.size!==e.size?!1:[...n.keys()].every(t=>e.has(t))}function ho(n,e){return n.isInverted===e.isInverted&&co(n.selection,e.selection)}function fo(n,e,t){if(n==="all")return"all";var r=[...n.keys()];return new Set(r.map(i=>t(e(i))))}function vo(n,e){var t=n==="all"||n.size>e/2,r=n;return t&&(r=n==="all"?new Set:new Set([...vu(0,e-1)].filter(i=>!n.has(String(i))).map(i=>String(i)))),{selection:r,isInverted:t}}function mc(n,e){return n?{}:{errorMessage:e,validationState:"invalid"}}function mo(n){var e;return(e=n==null?void 0:n.UNSAFE_getDOMNode())!==null&&e!==void 0?e:null}function pc(n){var e=n==null?void 0:n.UNSAFE_getDOMNode().lastElementChild;return po(e)}function gc(n){var e=n==null?void 0:n.UNSAFE_getDOMNode(),t=e==null?void 0:e.querySelector("input"),r=t==null?void 0:t.getAttribute("aria-controls"),i=r==null?null:document.getElementById(r);return i}function po(n){return n instanceof HTMLElement?n:null}function go(){var n=c.useRef(!1);return c.useEffect(()=>(n.current=!0,()=>{n.current=!1}),[]),n}function ei(n,e,t,r,i,a,o){try{var s=n[a](o),l=s.value}catch(u){t(u);return}s.done?e(l):Promise.resolve(l).then(r,i)}function bc(n){return function(){var e=this,t=arguments;return new Promise(function(r,i){var a=n.apply(e,t);function o(l){ei(a,r,i,o,s,"next",l)}function s(l){ei(a,r,i,o,s,"throw",l)}o(void 0)})}}var bn=H.module("useAsyncInterval");function yc(n,e){var t=go(),r=c.useRef(0),i=c.useRef(0),a=c.useRef(null),o=c.useCallback(bc(function*(){var s=Date.now();i.current+=1;var l=a.current==null?e:s-a.current;if(bn.debug("tick #".concat(i.current,"."),l,"ms elapsed since last tick."),a.current=s,yield n(),!!t.current){l+=Date.now()-a.current;var u=Math.max(0,l-e),d=Math.max(0,e-u);bn.debug("Next tick target:",e,", overage",u,", adjusted:",d),r.current=window.setTimeout(o,d)}}),[n,t,e]);c.useEffect(()=>(bn.debug("Setting target interval:",e),a.current=null,o(),()=>{window.clearTimeout(r.current)}),[e,o])}function _c(n,e){return c.useCallback(function(){var t=n(...arguments);return e(),t},[e,n])}function Xt(n,e){var t=c.useMemo(()=>qe(n,e),[n,e]);return c.useEffect(()=>()=>t.cancel(),[t]),t}function wc(n){var[e,t]=c.useState(n);return c.useEffect(()=>{t(n)},[n]),[e,t]}function Sc(n,e,t,r){var i=c.useRef(0);c.useEffect(()=>{i.current>=t||r&&(i.current+=1,n())},[t,r,...e])}function bo(n,e){var t=c.useRef(n),r=e(t.current,n)?t.current:n;return t.current=r,r}function Ec(n){n.preventDefault()}function yo(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,e=c.useMemo(()=>"useSubmitButtonRef-".concat(Ne()),[]),t=c.useCallback(a=>{a==null||a.UNSAFE_getDOMNode().setAttribute("form",e)},[e]),r=c.useMemo(()=>({id:e,onSubmit:n?void 0:Ec}),[e,n]),i=c.useMemo(()=>({form:e,ref:t}),[e,t]);return{formProps:r,submitButtonProps:i}}function _o(n,e){return c.useCallback(t=>{typeof n=="function"?n(e(t)):n.current=e(t)},[e,n])}function wo(n,e){var{getItem:t,selectedKeys:r,items:i}=n;return c.useMemo(()=>{var{selection:a,isInverted:o}=vo(r,i.length);return{selection:fo(a,t,e),isInverted:o}},[r,i.length,t,e])}function Cc(n){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:xl,t=c.useRef();return c.useEffect(()=>()=>{var r;return(r=t.current)===null||r===void 0?void 0:r.call(t)},[]),c.useCallback(r=>{var i;(i=t.current)===null||i===void 0||i.call(t);var a=e(r);a&&(a.addEventListener("scroll",n),t.current=()=>{a.removeEventListener("scroll",n),t.current=void 0})},[e,n])}function ti(n,e,t,r,i,a,o){try{var s=n[a](o),l=s.value}catch(u){t(u);return}s.done?e(l):Promise.resolve(l).then(r,i)}function Pc(n){return function(){var e=this,t=arguments;return new Promise(function(r,i){var a=n.apply(e,t);function o(l){ti(a,r,i,o,s,"next",l)}function s(l){ti(a,r,i,o,s,"throw",l)}o(void 0)})}}function Tc(n,e,t){var r=c.useRef(null),[i,a]=c.useState(null),o=c.useCallback(Pc(function*(){if(!(i==null||t==null)){var l=yield t();i.scroll(0,l)}}),[t,i]);c.useEffect(()=>(i==null||i.addEventListener("scroll",e),o(),()=>{i==null||i.removeEventListener("scroll",e)}),[e,i,o]);var s=c.useCallback(l=>{l&&setTimeout(()=>{a(n(r.current))},0)},[n]);return{ref:r,onOpenChange:s}}function ni(n,e,t,r,i,a,o){try{var s=n[a](o),l=s.value}catch(u){t(u);return}s.done?e(l):Promise.resolve(l).then(r,i)}function Oc(n){return function(){var e=this,t=arguments;return new Promise(function(r,i){var a=n.apply(e,t);function o(l){ni(a,r,i,o,s,"next",l)}function s(l){ni(a,r,i,o,s,"throw",l)}o(void 0)})}}function wt(n,e){var{autoLoad:t=!0}=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},[r,i]=c.useState(null),[a,o]=c.useState(null),[s,l]=c.useState(!1),u=c.useCallback(Oc(function*(){l(!0);try{var d=yield n(...e);i(d),o(null)}catch(f){i(null),o(f)}finally{l(!1)}}),[n,...e]);return c.useEffect(()=>{t&&u()},[t,u]),{data:r,error:a,isError:a!=null,isLoading:s,reload:u}}function ri(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function ii(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?ri(Object(t),!0).forEach(function(r){Ic(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):ri(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function Ic(n,e,t){return e=Dc(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Dc(n){var e=xc(n,"string");return typeof e=="symbol"?e:String(e)}function xc(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function Ac(n,e,t,r){var i=arguments.length===4;return c.useCallback(a=>{var o=i?a??r:a;t(ii(ii({},n),{},{[e]:o}))},[t,n,e,i,r])}function So(n,e){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,r=c.useRef(),i=c.useRef(0);return c.useCallback(a=>{window.clearTimeout(r.current),r.current=window.setTimeout(()=>{var o=Math.floor(a.target.scrollTop/n);i.current!==o&&(i.current=o,e(o))},t)},[t,n,e])}function ln(n,e){var[t,r]=c.useState(n);return c.useEffect(()=>{var i=setTimeout(()=>{r(n)},e);return()=>{clearTimeout(i)}},[n,e]),t}function Eo(n,e){return c.useCallback(t=>{if(t!=null){var r=e==null?[t]:t.querySelectorAll(e);r.forEach(i=>{Object.entries(n).forEach(a=>{var[o,s]=a;i.setAttribute(o,s)})})}},[n,e])}function Mc(n){var e=Eo(sc,n);return _o(e,mo)}function Co(){var{getKey:n=Po}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},[e,t]=c.useState([]),[r,i]=c.useState(()=>new Set),a=c.useCallback(p=>g=>n(g)===p,[n]),o=c.useCallback(p=>{var g;return(g=e.find(a(p)))!==null&&g!==void 0?g:null},[e,a]),s=c.useCallback(p=>{var g=o(p);if(g==null)throw new Error("No item found matching key: ".concat(p));return g},[o]),l=c.useCallback(p=>{t(g=>[...g,...p])},[]),u=c.useCallback((p,g)=>{t(b=>[...b.slice(0,p),...g,...b.slice(p)])},[]),d=c.useCallback(p=>{var g=new Set(p);t(b=>b.filter(_=>!g.has(n(_))))},[n]),f=c.useCallback((p,g)=>{var b=e.findIndex(a(p));b!==-1&&t(_=>[..._.slice(0,b),g,..._.slice(b+1)])},[e,a]),v=c.useCallback(p=>{if(p.size!==0){var g=[],b=new Map;for(var _ of p.keys()){var S=e.findIndex(a(_));g.push(S),b.set(S,_)}g.sort((T,y)=>T-y);var w=[];e.forEach((T,y)=>{if(g[0]===y){var O=b.get(g.shift()),M=p.get(O);w.push(M)}else w.push(T)}),t(w)}},[e,a]),m=c.useMemo(()=>({items:e,selectedKeys:r,append:l,bulkUpdate:v,findItem:o,getItem:s,insert:u,remove:d,setItems:t,setSelectedKeys:i,update:f}),[l,v,o,s,u,e,d,t,r,f]);return m}function Po(n){var e=n!=null&&typeof n=="object"&&"key"in n;if(!e)throw new Error("Item does not have a `key` prop.");return n.key}function To(n,e){c.useEffect(()=>{if(n!=null){var t=new window.ResizeObserver(e);return t.observe(n),()=>{n!=null&&t.unobserve(n)}}},[n,e])}const Nc=Object.freeze(Object.defineProperty({__proto__:null,createValidationProps:mc,defaultGetKey:Po,extractSpectrumHTMLElement:mo,extractSpectrumLastChildHTMLElement:pc,findSpectrumComboBoxScrollArea:gc,getSelectedItemCountOrAll:vc,identityExtractHTMLElement:po,isSelectionEqual:co,isSelectionMaybeInvertedEqual:ho,mapSelection:fo,optimizeSelection:vo,useAsyncInterval:yc,useCallbackWithAction:_c,useContextOrThrow:Pt,useCopyToClipboard:mu,useDebouncedCallback:Xt,useDebouncedValue:ln,useDependentState:wc,useEffectNTimesWhen:Sc,useFormWithDetachedSubmitButton:yo,useForwardedRef:pu,useIsEqualMemo:bo,useIsMountedRef:go,useMappedRef:_o,useMappedSelection:wo,useOnScrollOffsetChangeCallback:So,useOnScrollRef:Cc,usePopoverOnScrollRef:Tc,usePrevious:Ba,usePromiseFactory:wt,usePropChangeCallback:Ac,useResizeObserver:To,useSetAttributesCallback:Eo,useSpectrumDisableSpellcheckRef:Mc,useWindowedListData:Co},Symbol.toStringTag,{value:"Module"})),Lc="_spectrumActionBar_tmmkp_5",jc="_spectrumDialogComponentHeading_tmmkp_9",Fc="_spectrumEllipsis_tmmkp_14",vr={spectrumActionBar:Lc,spectrumDialogComponentHeading:jc,spectrumEllipsis:Fc};function ai(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function Lt(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?ai(Object(t),!0).forEach(function(r){Rc(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):ai(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function Rc(n,e,t){return e=kc(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function kc(n){var e=$c(n,"string");return typeof e=="symbol"?e:String(e)}function $c(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function Oo(n){var{heading:e,confirmationButtonLabel:t,children:r,onCancel:i,onConfirm:a}=n,{formProps:o,submitButtonProps:s}=yo();return h.jsxs(cl,{children:[h.jsx(Ta,{level:3,UNSAFE_className:vr.spectrumDialogComponentHeading,children:e}),h.jsx(hl,{}),h.jsx(Oa,{children:h.jsx(fl,Lt(Lt({},o),{},{children:r}))}),h.jsxs(vl,{children:[h.jsx(Gr,{variant:"secondary",onPress:i,children:"Cancel"}),h.jsx(Gr,Lt(Lt({},s),{},{style:"fill",variant:"negative",onPress:a,type:"submit",children:t}))]})]})}function Bc(n){var{ariaLabel:e,heading:t,confirmationButtonLabel:r,isHidden:i,children:a,tooltip:o,onConfirm:s}=n,l=c.useCallback(u=>h.jsx(Oo,{heading:t,confirmationButtonLabel:r,onCancel:u,onConfirm:()=>{u(),s()},children:a}),[a,r,t,s]);return h.jsx(uo,{ariaLabel:e,icon:Na,isHidden:i,isQuiet:!0,height:ao,tooltip:o,children:l})}var Uc=["icon","label","tooltip"];function oi(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function si(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?oi(Object(t),!0).forEach(function(r){Wc(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):oi(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function Wc(n,e,t){return e=Vc(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Vc(n){var e=Hc(n,"string");return typeof e=="symbol"?e:String(e)}function Hc(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function zc(n,e){if(n==null)return{};var t=Gc(n,e),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(n);for(i=0;i<a.length;i++)r=a[i],!(e.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(n,r)&&(t[r]=n[r])}return t}function Gc(n,e){if(n==null)return{};var t={},r=Object.keys(n),i,a;for(a=0;a<r.length;a++)i=r[a],!(e.indexOf(i)>=0)&&(t[i]=n[i]);return t}function Io(n){var{icon:e,label:t,tooltip:r}=n,i=zc(n,Uc);return h.jsxs(Ca,si(si({},i),{},{"aria-label":t,isQuiet:!0,height:ao,children:[h.jsx(nr,{UNSAFE_className:r==null?void 0:"action-button-icon-with-tooltip",children:h.jsx(me,{icon:e})}),r==null?null:h.jsx(rn,{children:r})]}))}Io.displayName="IconActionButton";function li(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function Kc(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?li(Object(t),!0).forEach(function(r){Ae(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):li(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function Ae(n,e,t){return e=Xc(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Xc(n){var e=Yc(n,"string");return typeof e=="symbol"?e:String(e)}function Yc(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var qc=100,Nn;(function(n){n.UP="UP",n.DOWN="DOWN"})(Nn||(Nn={}));class Se extends c.Component{constructor(e){super(e),Ae(this,"popper",void 0),Ae(this,"cbContainer",void 0),Ae(this,"menuContainer",void 0),Ae(this,"input",void 0),Ae(this,"getCachedFilteredOptions",it((r,i)=>r.filter(a=>a.title.toLowerCase().indexOf(i.toLowerCase())>=0)));var{popperOptions:t}=this.props;t=Kc({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=qe(this.updateInputValue,qc),this.handleOptionClick=this.handleOptionClick.bind(this),this.handleMenuOpened=this.handleMenuOpened.bind(this),this.handleMenuExited=this.handleMenuExited.bind(this),this.popper=q.createRef(),this.cbContainer=q.createRef(),this.menuContainer=q.createRef(),this.input=q.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,r=t.filter(i=>i.title.toLowerCase()===e.toLowerCase());return r.length<1?(this.setState({invalid:!0}),{value:e,isValid:!1}):(this.setState({invalid:!1}),{value:r[0].value,isValid:!0})}updateInputValue(e){var{menuIsOpen:t}=this.state,{value:r,isValid:i}=this.getValueAndValidate(e);t&&this.processFilterChange(e),this.fireOnChange(r,i)}fireOnChange(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,{onChange:r}=this.props;r(e,t)}processFilterChange(e){var t,{options:r}=this.props,{menuIsOpen:i}=this.state,a=e?this.getCachedFilteredOptions(r,e):r,o=a.length===1&&a[0].title===e;if(this.setState({filteredOptions:a,keyboardOptionIndex:0}),o&&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:r,keyboardOptionIndex:i}=this.state,a=r[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(Se.MENU_NAVIGATION_DIRECTION.UP);break;case"ArrowDown":e.stopPropagation(),e.preventDefault(),this.navigateMenu(Se.MENU_NAVIGATION_DIRECTION.DOWN);break;case"Tab":if(e.stopPropagation(),e.preventDefault(),e.shiftKey){this.navigateMenu(Se.MENU_NAVIGATION_DIRECTION.UP);break}this.navigateMenu(Se.MENU_NAVIGATION_DIRECTION.DOWN);break;case"Escape":e.preventDefault(),e.stopPropagation(),this.closeMenu();break}}navigateMenu(e){var{filteredOptions:t,keyboardOptionIndex:r}=this.state,i=r;e===Se.MENU_NAVIGATION_DIRECTION.UP?r>0?(i=(i-1)%t.length,this.setState({keyboardOptionIndex:i})):r===0&&(i=t.length-1,this.setState({keyboardOptionIndex:i})):e===Se.MENU_NAVIGATION_DIRECTION.DOWN&&r<t.length&&(i=(i+1)%t.length,this.setState({keyboardOptionIndex:i})),this.scrollOptionIntoView(i)}handleInputKeyDown(e){var{onEnter:t}=this.props,{menuIsOpen:r}=this.state;r?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 r;(r=this.input.current)===null||r===void 0||r.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 h.jsx("div",{className:X("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:r}=this.state;return t&&r.length===0?h.jsx("div",{className:"no-match",children:e}):r.map((i,a)=>this.renderOption(i,a))}renderOption(e,t){var{keyboardOptionIndex:r}=this.state,i="option-".concat(t,"-").concat(e.value);return h.jsx("button",{type:"button",className:X("aci-option-btn",{"keyboard-active":r===t}),onClick:()=>this.handleOptionClick(e),onFocus:()=>this.setState({keyboardOptionIndex:t}),children:e.title},i)}render(){var{options:e,inputPlaceholder:t,disabled:r,className:i,defaultTitle:a,spellCheck:o,"data-testid":s}=this.props,{title:l,menuIsOpen:u,popperOptions:d,invalid:f}=this.state;return h.jsxs("div",{className:"aci-container",ref:this.cbContainer,children:[h.jsx("input",{value:l||a,className:X("form-control",i,"aci-input",{"is-invalid":f&&!u}),ref:this.input,onChange:this.handleInputChange,placeholder:t||e[0].title,disabled:r,onFocus:this.handelInputFocus,onClick:this.handleInputClick,onBlur:this.handleInputBlur,onKeyDown:this.handleInputKeyDown,spellCheck:o,"data-testid":s}),h.jsx(an,{ref:this.popper,options:d,className:X("aci-options-popper interactive"),onEntered:this.handleMenuOpened,onExited:this.handleMenuExited,children:this.renderMenuElement()})]})}}Ae(Se,"propTypes",{options:C.arrayOf(C.shape({title:C.string.isRequired,value:C.string.isRequired})).isRequired,popperOptions:C.shape({}),onChange:C.func,inputPlaceholder:C.string,disabled:C.bool,className:C.string,defaultTitle:C.string,spellCheck:C.bool,onEnter:C.func,noMatchText:C.string,"data-testid":C.string});Ae(Se,"defaultProps",{onChange(){},inputPlaceholder:"",disabled:!1,className:"",defaultTitle:"",popperOptions:null,spellCheck:!0,onEnter(){},noMatchText:"No matching items found","data-testid":void 0});Ae(Se,"MENU_NAVIGATION_DIRECTION",Nn);const Zc=Se;function mr(n){var{className:e="",value:t,onChange:r,spellCheck:i=!1,placeholder:a="",disabled:o=!1,delimiter:s="",id:l="","data-testid":u}=n,[d,f]=c.useState(t),[v,m]=c.useState(!1),p=c.useRef(null);c.useEffect(function(){f(t)},[t]);function g(M){return M.trim().split(s).filter(A=>A).join(`
|
|
2
2
|
`.concat(s.trim()))}function b(M){return M.split(`
|
|
3
3
|
`).map(A=>A.trim()).join(" ")}function _(){if(p.current){p.current.style.height="0";var M=p.current.scrollHeight+(p.current.offsetHeight-p.current.clientHeight);M>0&&(p.current.style.height="".concat(M,"px"))}}function S(M){var A=M.target.value;v&&(s&&(A=g(A)),m(!1)),f(A),r(A)}function w(){p.current&&(s&&(f(g(d)),_()),p.current.scrollLeft=0)}function T(){p.current&&document.activeElement!==p.current&&p.current.focus()}function y(){s&&(f(b(d)),r(b(d)))}function O(){m(!0)}return c.useEffect(function(){_()},[d]),h.jsx("textarea",{ref:p,id:l,className:X(e,"auto-resize-textarea form-control"),placeholder:a,value:d,rows:1,onChange:S,onFocus:w,onMouseDown:T,onBlur:y,onPaste:O,spellCheck:i,disabled:o,"data-testid":u})}mr.propTypes={value:C.string.isRequired,onChange:C.func.isRequired,className:C.string,placeholder:C.string,spellCheck:C.bool,disabled:C.bool,delimiter:C.string,id:C.string,"data-testid":C.string};mr.defaultProps={className:"",id:"",placeholder:"",disabled:!1,spellCheck:!1,delimiter:"","data-testid":void 0};function Ot(n){var{children:e,className:t,style:r,"data-testid":i}=n;return h.jsx("div",{className:X("btn-group",t),style:r,role:"group","data-testid":i,children:e})}Ot.displayName="ButtonGroup";Ot.propTypes={children:C.node.isRequired,className:C.string,style:C.object,"data-testid":C.string};Ot.defaultProps={className:null,style:{},"data-testid":void 0};function Jc(n){var{blockInteraction:e=!0,children:t,debounceMs:r,isOpen:i=!1}=n,a=ln(i,r);return h.jsxs(h.Fragment,{children:[e&&i&&h.jsx("div",{className:"modal-backdrop",style:{backgroundColor:"transparent"},"data-testid":"debounced-modal-backdrop"}),q.cloneElement(t,{isOpen:i&&a})]})}function Qc(n){var{className:e,icon:t,isOpen:r=!1,subtitle:i,title:a}=n;return h.jsx(ir,{isOpen:r,className:e,children:h.jsx(ar,{children:h.jsxs("div",{className:"info-modal",children:[t!=null&&h.jsx("div",{className:"message-icon",children:h.jsx(me,{icon:t})}),h.jsx("div",{className:"message-header",children:a}),i!=null&&h.jsx("div",{className:"message-content",children:i})]})})})}function Do(n){var{className:e="modal-footer",children:t,"data-testid":r}=n;return h.jsx("div",{className:e,"data-testid":r,children:t})}function pr(n){var{isOpen:e,headerText:t,bodyText:r,onCancel:i,onConfirm:a,onDiscard:o,onModalDisable:s,cancelButtonText:l="Cancel",confirmButtonText:u="Okay",discardButtonText:d="Discard",isConfirmDanger:f=!1,children:v,"data-testid":m}=n,p=c.useRef(null),g=c.useRef(null),b=c.useCallback(()=>{g.current!==null&&g.current.checked&&s&&s(),a()},[a,s]),_=c.useCallback(()=>{var w;(w=p.current)===null||w===void 0||w.focus()},[]),S="";return e&&(S=typeof r=="function"?r():r),h.jsxs(ir,{isOpen:e,onOpened:_,children:[h.jsx(La,{closeButton:!1,children:t}),h.jsx(ar,{children:S}),h.jsxs(Do,{children:[s&&h.jsxs("div",{className:"custom-control custom-checkbox form-group mr-auto",children:[h.jsx("input",{type:"checkbox",className:"custom-control-input",id:"move-confirmation-checkbox",defaultChecked:!1,ref:g,"data-testid":m!==void 0?"".concat(m,"-checkbox-confirm"):void 0}),h.jsx("label",{className:"custom-control-label",htmlFor:"move-confirmation-checkbox",children:"Don't ask me again"})]}),o&&h.jsx(_e,{kind:"secondary",className:"mr-auto","data-dismiss":"modal",onClick:o,"data-testid":m!==void 0?"".concat(m,"-btn-discard"):void 0,children:d}),i&&h.jsx(_e,{kind:"secondary","data-dismiss":"modal",onClick:i,"data-testid":m!==void 0?"".concat(m,"-btn-cancel"):void 0,children:l}),h.jsxs(Ot,{children:[h.jsx(_e,{kind:f?"danger":"primary",onClick:b,ref:p,"data-testid":m!==void 0?"".concat(m,"-btn-confirm"):void 0,children:u}),v]})]})]})}pr.propTypes={isOpen:C.bool.isRequired,headerText:C.string.isRequired,bodyText:C.oneOfType([C.string,C.func]).isRequired,onCancel:C.func,onConfirm:C.func.isRequired,onDiscard:C.func,onModalDisable:C.func,cancelButtonText:C.string,confirmButtonText:C.string,discardButtonText:C.string,children:C.node,"data-testid":C.string};pr.defaultProps={children:void 0,cancelButtonText:"Cancel",confirmButtonText:"Okay",discardButtonText:"Discard",onCancel:void 0,onDiscard:void 0,onModalDisable:void 0,"data-testid":void 0};var un=q.forwardRef((n,e)=>{var{children:t,className:r,disabled:i,onClick:a,style:o,id:s}=n;return h.jsx("button",{ref:e,type:"button",className:X("btn",r),onClick:a,style:o,disabled:i,id:s,children:t})});un.displayName="Button";un.propTypes={children:C.node,className:C.string,disabled:C.bool,onClick:C.func,style:C.shape({}),id:C.string};un.defaultProps={children:null,className:"",disabled:!1,onClick:()=>null,style:{},id:""};const eh=un;function ui(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function di(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?ui(Object(t),!0).forEach(function(r){th(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):ui(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function th(n,e,t){return e=nh(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function nh(n){var e=rh(n,"string");return typeof e=="symbol"?e:String(e)}function rh(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function ih(n){var{styleProps:e,selectedItemCount:t,onClearSelection:r}=n;return h.jsx(ml,di(di({UNSAFE_className:vr.spectrumActionBar},e),{},{isEmphasized:!0,selectedItemCount:t,onClearSelection:r}))}function ah(n){var{className:e,isFlipped:t,children:r,"data-testid":i}=n,a=u=>{if(r.length!==2)throw new Error("CardFlip requires 2 children to function");return r[u]},o=c.useRef(null),s=c.useCallback(u=>{u.target===u.currentTarget&&document.body.classList.add("card-flip--is-flipping")},[]),l=c.useCallback(u=>{u.target===u.currentTarget&&document.body.classList.remove("card-flip--is-flipping")},[]);return c.useEffect(function(){if(!o.current)throw Error("ref undefined");o.current.addEventListener("transitionstart",s);var d=o.current;return function(){if(d!=null)return d.removeEventListener("transitionstart",s)}},[s]),h.jsxs("div",{className:X(e,{"card-flip--show-front":t,"card-flip--show-back":!t}),"data-testid":i,children:[h.jsx("div",{className:"card-flip--back",children:a(0)}),h.jsx("div",{ref:o,className:"card-flip--front",onTransitionEnd:l,children:a(1)})]})}function xo(n,e,t){return e=oh(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function oh(n){var e=sh(n,"string");return typeof e=="symbol"?e:String(e)}function sh(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class Ce extends c.Component{static handleEnter(e){var t=e;t.style.height="0"}static handleEntering(e){var t=e;t.style.height="".concat(Ce.getHeight(t),"px")}static handleExiting(e){var t=e;t.style.height="0"}static handleExit(e){var t=e;t.style.height="".concat(Ce.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:r}=this.props;if(r!==void 0&&r){var i=t.querySelector("input, select, textarea");i!=null&&i.focus()}}render(){var{children:e,className:t,in:r,"data-testid":i}=this.props;return h.jsx(zt,{in:r,classNames:{enterActive:"collapsing",enterDone:"collapse show",exitActive:"collapsing",exitDone:"collapse"},onEnter:Ce.handleEnter,onEntering:Ce.handleEntering,onEntered:this.handleEntered,onExit:Ce.handleExit,onExiting:Ce.handleExiting,timeout:350,children:a=>h.jsx("div",{className:X({collapse:a==="exited"},t),"data-testid":i,children:e})})}}xo(Ce,"propTypes",{className:C.string,in:C.bool.isRequired,children:C.node.isRequired,autoFocusOnShow:C.bool,"data-testid":C.string});xo(Ce,"defaultProps",{className:"",autoFocusOnShow:!1,"data-testid":void 0});const lh=Ce;var uh=H.module("TimeInput"),dh="([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]",ch=["00:00:00","12:34:56","23:59:59"];function ci(n){return n!=null?"".concat(n.substring(0,8).replace(/\u2007/g,"0")).concat("00:00:00".substring(n.length)):n}var Ao=q.forwardRef((n,e)=>{var{allowValueWrapping:t=!0,className:r="",onChange:i=()=>!1,value:a=0,onFocus:o=()=>!1,onBlur:s=()=>!1,onSelect:l=()=>!1,"data-testid":u}=n,[d,f]=c.useState(Vt.formatTime(a)),v=c.useRef(a),[m,p]=c.useState(),g=c.useRef(null);c.useImperativeHandle(e,()=>({focus:()=>{var y;(y=g.current)===null||y===void 0||y.focus()},setSelection:y=>{var O;(O=g.current)===null||O===void 0||O.focus(),p(y)}}),[]),c.useEffect(function(){v.current!==a&&(f(Vt.formatTime(a)),v.current=a)},[v,a]);function b(y,O,M){var A=y.selectionStart===0?24:60,j=parseInt(M,10)-O;return Number.isNaN(j)?j=0:t?j=(j%A+A)%A:j=Math.min(Math.max(0,j),A-1),"".concat(j).padStart(2,"0")}function _(y,O,M,A,j){return A===0&&j===2&&O===1&&parseInt(M,10)>1?"0".concat(M).concat(y.substring(2)):Ua(y,O,M)}var S=c.useCallback(y=>{uh.debug("handleChange",y),f(y),v.current=Vt.parseTime(ci(y)),i(v.current)},[i]),w=c.useCallback(()=>{var y=ci(d);y!==d&&f(y),s()},[d,s]),T=c.useCallback(y=>{p(y),l(y)},[l]);return h.jsx(sr,{ref:g,className:r,example:ch,getNextSegmentValue:b,getPreferredReplacementString:_,onChange:S,onSelect:T,pattern:dh,selection:m,value:d,onFocus:o,onBlur:w,"data-testid":u})});Ao.defaultProps={allowValueWrapping:!0,className:"",onChange:()=>!1,onSelect:()=>!1,value:0,onFocus:()=>!1,onBlur:()=>!1,"data-testid":void 0};const Yt=Ao;function hi(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function hh(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?hi(Object(t),!0).forEach(function(r){Ke(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):hi(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function Ke(n,e,t){return e=fh(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function fh(n){var e=vh(n,"string");return typeof e=="symbol"?e:String(e)}function vh(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var fi=-1,Ln;(function(n){n.UP="UP",n.DOWN="DOWN"})(Ln||(Ln={}));class fe extends c.Component{constructor(e){super(e),Ke(this,"csContainer",void 0),Ke(this,"menuContainer",void 0),Ke(this,"button",void 0),Ke(this,"input",void 0);var{value:t,valueToTime:r}=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=q.createRef(),this.menuContainer=q.createRef(),this.button=q.createRef(),this.input=q.createRef(),this.state={keyboardOptionIndex:0,menuIsOpen:!1,inputWidth:100,customTime:r(t),inputFocused:!1}}getSelectedText(){var{options:e,value:t,placeholder:r}=this.props,{customTime:i}=this.state;if(t===null)return r;for(var a=0;a<e.length;a+=1){var o=e[a];if(o.value===t)return o.title}return Vt.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:r,inputFocused:i}=this.state,{options:a}=this.props;switch(e.key){case"Enter":case" ":i?this.updateFromCustom():this.updateInputValue(a[r].value),this.closeMenu(),(t=this.button.current)===null||t===void 0||t.focus(),e.stopPropagation(),e.preventDefault();break;case"Tab":e.shiftKey?this.handleMenuNavigation(fe.MENU_NAVIGATION_DIRECTION.UP):this.handleMenuNavigation(fe.MENU_NAVIGATION_DIRECTION.DOWN),e.stopPropagation(),e.preventDefault();break;case"ArrowUp":this.handleMenuNavigation(fe.MENU_NAVIGATION_DIRECTION.UP),e.stopPropagation(),e.preventDefault();break;case"ArrowDown":this.handleMenuNavigation(fe.MENU_NAVIGATION_DIRECTION.DOWN),e.stopPropagation(),e.preventDefault();break;case"Escape":this.closeMenu();break}}handleMenuNavigation(e){var{keyboardOptionIndex:t,inputFocused:r}=this.state,{options:i}=this.props,a=i.length,o=t;switch(e){case fe.MENU_NAVIGATION_DIRECTION.UP:if(!r&&t===0){this.focusInput();break}else r&&this.focusOption(t);t>0&&!r?(o=(o-1)%a,this.setState({keyboardOptionIndex:o})):t===0&&(o=a-1,this.setState({keyboardOptionIndex:o})),this.scrollOptionIntoView(o);break;case fe.MENU_NAVIGATION_DIRECTION.DOWN:if(!r&&t===a-1){this.focusInput();break}else r&&this.focusOption(t);t<a&&!(r&&t===0)&&(o=(o+1)%a,this.setState({keyboardOptionIndex:o})),this.scrollOptionIntoView(o);break}}handleOptionClick(e){var t=Number(e.currentTarget.value),{options:r,timeToValue:i}=this.props,{customTime:a}=this.state;if(t===fi){var o=i(a);this.updateAndClose(o)}else this.updateAndClose(r[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:r}=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(),r!==null){var o=t.map(s=>s.value).indexOf(r);o<0&&this.focusInput()}}focusInput(){var e;(e=this.input.current)===null||e===void 0||e.focus()}focusOption(e){var t,r=(t=this.menuContainer.current)===null||t===void 0?void 0:t.querySelector(".cs-options");if(r&&r.children!=null){var i=r.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,r=t(e);this.updateInputValue(r),this.setState({customTime:e})}updateFromCustom(){var{timeToValue:e}=this.props,{customTime:t}=this.state,r=e(t);this.updateInputValue(r)}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 r=e.map(i=>i.value).indexOf(t);r>0&&this.setState({keyboardOptionIndex:r})}}scrollOptionIntoView(e){var t,r=(t=this.menuContainer.current)===null||t===void 0?void 0:t.querySelector(".cs-options");if(r&&r.children!=null){var i=r.children.item(e);i instanceof HTMLElement&&i.offsetTop>fe.DROP_DOWN_MENU_HEIGHT?r.scrollTop=i.offsetTop-fe.DROP_DOWN_MENU_HEIGHT:(i instanceof HTMLElement&&i.offsetTop<0||e===0)&&(r.scrollTop=0)}}renderMenuElement(){var{inputWidth:e}=this.state;return h.jsx("div",{className:"cs-menu-container",ref:this.menuContainer,role:"presentation",onKeyDown:this.handleMenuKeyDown,onClick:t=>{t.stopPropagation()},style:{width:e},children:h.jsx("div",{className:"cs-options-container",children:h.jsx("div",{className:"cs-options",children:this.renderOptions()})})})}renderOptions(){for(var{options:e,value:t,icon:r,customText:i}=this.props,{keyboardOptionIndex:a,customTime:o,inputFocused:s}=this.state,l=!1,u=[],d=0;d<e.length;d+=1){var f=e[d],v="option-".concat(d,"-").concat(f.value);l=l||f.value===t,u.push(h.jsxs("button",{type:"button",value:d,className:X("cs-option-btn",{"keyboard-active":a===d&&!s}),onClick:this.handleOptionClick,onFocus:this.handleOptionFocus,children:[f.value===t&&h.jsx(me,{icon:r,className:"mr-2"}),f.value!==t&&h.jsx("span",{className:"mr-4"}),f.title]},v))}return u.push(h.jsx("hr",{className:"cs-divider"},"option-divider")),u.push(h.jsxs("button",{type:"button",value:fi,className:X("cs-option-btn",{"keyboard-active":s}),onClick:this.handleOptionClick,onFocus:this.handleOptionFocus,children:[!l&&t!==null?h.jsx(me,{icon:r,className:"mr-2"}):h.jsx("span",{className:"mr-4"}),i]},"option-custom-label")),u.push(h.jsxs("div",{className:"cs-custom-container",children:[h.jsx("span",{className:"mr-2"}),h.jsx(Yt,{ref:this.input,onChange:this.handleCustomInput,value:o,onFocus:()=>this.setState({inputFocused:!0}),onBlur:()=>this.setState({inputFocused:!1})},"option-input"),h.jsx("span",{className:"ml-2"})]},"cs-custom-container")),u.push(h.jsx("hr",{className:"mb-2"},"option-end")),u}render(){var{disabled:e,invalid:t,value:r,"data-testid":i}=this.props,{menuIsOpen:a}=this.state,{popperOptions:o}=this.props;return o=hh({placement:"bottom-end",modifiers:{preventOverflow:{enabled:!1}}},o),h.jsx("div",{className:"input-group cs-container context-menu",ref:this.csContainer,"data-testid":i,children:h.jsx("div",{className:X("input-group-append cs-dropdown",{"cs-dropdown-invalid":t}),children:h.jsxs("button",{type:"button",className:X("btn cs-btn form-control",{"cs-btn-invalid":t}),ref:this.button,onClick:this.toggleMenu,disabled:e,children:[h.jsx("span",{className:X({"text-muted":r===null}),children:this.getSelectedText()}),h.jsx("span",{className:"cs-caret"}),h.jsx(Wa,{isShown:a,actions:{menuElement:this.renderMenuElement()},popperOptions:o,popperClassName:"CustomTimeSelect",onMenuOpened:this.handleMenuOpened,onMenuClosed:this.handleMenuExited,menuStyle:{maxWidth:"100rem"}})]})})})}}Ke(fe,"MENU_NAVIGATION_DIRECTION",Ln);Ke(fe,"DROP_DOWN_MENU_HEIGHT",125);Ke(fe,"defaultProps",{onChange(){},value:null,disabled:!1,popperOptions:{},icon:Al,customText:"Custom",placeholder:"Select a time",valueToTime:n=>n===null?0:Math.round(n/1e3),timeToValue:n=>n*1e3,invalid:!1,"data-testid":void 0});const mh=fe;var ph=H.module("DateInput"),gh="[12][0-9]{3}-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])",bh=["2000-01-01","2022-12-31"],yh="YYYY-MM-DD",Mo=q.forwardRef((n,e)=>{var{className:t="",onChange:r=()=>{},defaultValue:i="",onFocus:a=()=>{},onBlur:o=()=>{},"data-testid":s}=n,[l,u]=c.useState(i),[d,f]=c.useState(),v=c.useCallback(m=>{ph.debug("handleChange",m),u(m),r(m)},[r]);return h.jsx("div",{className:"d-flex flex-row align-items-center",children:h.jsx(sr,{ref:e,className:X(t),example:bh,getNextSegmentValue:gu,onChange:v,onSelect:f,pattern:gh,placeholder:yh,selection:d,value:l,onFocus:a,onBlur:o,"data-testid":s})})});Mo.displayName="DateInput";const _h=Mo;function No(n,e,t){return e=wh(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function wh(n){var e=Sh(n,"string");return typeof e=="symbol"?e:String(e)}function Sh(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class Lo extends c.PureComponent{constructor(e){super(e),No(this,"searchInput",void 0),this.searchInput=q.createRef(),this.handleChange=this.handleChange.bind(this),this.sendUpdate=qe(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:r,id:i,"data-testid":a}=this.props,{value:o}=this.state;return h.jsx(lr,{value:o,placeholder:e,onChange:this.handleChange,className:t,matchCount:r,ref:this.searchInput,id:i,"data-testid":a})}}No(Lo,"defaultProps",{placeholder:"Search",className:"",matchCount:null,debounceMs:250,id:"","data-testid":void 0});const Eh=Lo;function Ch(n){var{isInvalid:e=!1,items:t,onAdd:r=()=>{},onDelete:i=()=>{},validate:a=()=>null}=n,[o,s]=c.useState(null),[l,u]=c.useState([]),[d,f]=c.useState(""),v=c.useCallback(w=>{u(w)},[]),m=c.useCallback(()=>{i(Yr.getItemsInRanges(t,l)),u([])},[t,l,i]),p=c.useCallback(()=>{if(d!==""){var w=a(d);w==null?(r(d),f("")):s(w)}},[d,r,a]),g=c.useCallback(w=>{var{value:T}=w.target;f(T),s(T===""?null:a(T))},[a]),b=c.useCallback(()=>{u([])},[]),_=c.useCallback(w=>{w.key==="Enter"&&p()},[p]),S=c.useMemo(()=>14+Ia(t.length,1,6)*xn.DEFAULT_ROW_HEIGHT,[t.length]);return h.jsxs("div",{className:X("editable-item-list-container",{"is-invalid":e}),children:[h.jsx("div",{style:{height:S},children:h.jsx(xn,{itemCount:t.length,items:t.map((w,T)=>({value:w,isSelected:Yr.isSelected(l,T)})),offset:0,selectedRanges:l,onSelectionChange:v,isMultiSelect:!0})}),h.jsxs("div",{className:"d-flex flex-row pt-2",children:[h.jsx("div",{className:"d-flex flex-grow-1",children:h.jsx("input",{className:X("form-control",{"is-invalid":o!=null}),placeholder:"Enter value",type:"text",value:d,onChange:g,onFocus:b,onKeyDown:_})}),h.jsxs("div",{className:"d-flex align-items-start mt-1 ml-2",children:[h.jsx(_e,{kind:"ghost",onClick:p,disabled:o!=null||d==="",icon:Ml,tooltip:"Add new item","data-testid":"add-item-button"}),h.jsx(_e,{kind:"ghost",onClick:m,disabled:l.length===0,icon:Na,tooltip:"Delete selected items","data-testid":"delete-item-button"})]})]})]})}var Ph=H.module("ErrorBoundary");class Th extends c.Component{static getDerivedStateFromError(e){return{error:e}}constructor(e){super(e),this.state={error:void 0}}componentDidCatch(e,t){var{onError:r}=this.props;Ph.error("Error caught by ErrorBoundary",e,t),r==null||r(e,t)}render(){var{children:e,className:t,fallback:r}=this.props,{error:i}=this.state;return i!=null?r??h.jsx("div",{className:t,children:h.jsx(Pe,{errorMessage:"".concat(i),isLoading:!1,isLoaded:!1})}):e}}function Oh(n,e,t){return e=Ih(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Ih(n){var e=Dh(n,"string");return typeof e=="symbol"?e:String(e)}function Dh(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class ut extends c.Component{static isParentSelected(e,t){var r=t.get(e);if(r===void 0)return!1;if(typeof r=="boolean")return r;var i=Array.from(r.values()).includes(!0),a=Array.from(r.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:r}=t;return{menuIsOpen:!r}})}toggleValueFor(e,t){var{valueMap:r,onUpdateValueMap:i}=this.props,a=new Map(r),o=a.get(e);if(o instanceof Map){var s=new Map(o);if(t!=null)s.set(t,o.get(t)===void 0);else{var l=ut.isParentSelected(e,a),u=l==null||!l;o.forEach((v,m)=>s.set(m,u))}a.set(e,s)}else a.set(e,o==null||!o);var d=a.get(e);if(t===void 0&&d!==void 0&&typeof d!="boolean"){var f=ut.isParentSelected(e,r);f!=null&&f?d.forEach((v,m)=>d.set(m,!1)):d.forEach((v,m)=>d.set(m,!0))}i(a)}setAllValues(e){var{valueMap:t,onUpdateValueMap:r}=this.props,i=new Map;t.forEach((a,o)=>{if(typeof a=="boolean")i.set(o,e);else{var s=new Map;a.forEach((l,u)=>s.set(u,e)),i.set(o,s)}}),r(i)}selectAll(){this.setAllValues(!0)}clear(){this.setAllValues(!1)}renderMenuElement(){var{valueMap:e,"data-testid":t}=this.props;return h.jsxs("div",{className:"hcm-menu-container",children:[Array.from(e.entries()).map(r=>{var[i,a]=r;return h.jsxs("div",{children:[h.jsx(An,{className:"hcm-parent",checked:ut.isParentSelected(i,e),onChange:()=>this.toggleValueFor(i),children:i}),a!==void 0&&typeof a!="boolean"&&Array.from(a.entries()).map(o=>{var[s,l]=o;return h.jsx(An,{className:"hcm-child",checked:l,onChange:()=>this.toggleValueFor(i,s),children:s},s)})]},i)}),h.jsx(_e,{kind:"ghost",onClick:this.selectAll,"data-testid":t!==void 0?"".concat(t,"-btn-select-all"):void 0,children:"Select All"}),h.jsx(_e,{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:r,id:i,"data-testid":a}=this.props,{menuIsOpen:o}=this.state;return h.jsxs("button",{type:"button",className:X("btn hcm-btn",t),onClick:this.toggleMenu,id:i,"data-testid":a,children:[h.jsxs("span",{children:[r&&h.jsx(me,{icon:r,className:"hcm-icon mr-1"}),e]}),h.jsx("span",{className:"cs-caret"}),h.jsx(an,{options:{placement:"bottom"},isShown:o,onExited:()=>{this.setState({menuIsOpen:!1})},closeOnBlur:!0,interactive:!0,children:this.renderMenuElement()})]})}}Oh(ut,"defaultProps",{className:"",icon:null,id:"","data-testid":void 0});const xh=ut;function vi(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function yn(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?vi(Object(t),!0).forEach(function(r){Ah(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):vi(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function Ah(n,e,t){return e=Mh(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Mh(n){var e=Nh(n,"string");return typeof e=="symbol"?e:String(e)}function Nh(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var jo=c.memo(n=>{var{tab:e,onClose:t,onSelect:r,isActive:i,activeRef:a,index:o,isDraggable:s,contextActions:l}=n,{key:u,isClosable:d=t!=null,title:f}=e;return h.jsx(pl,{draggableId:u,index:o,isDragDisabled:!s,children:(v,m)=>h.jsxs("div",{className:"context-menu-wrapper",ref:i?a:null,children:[h.jsxs("div",yn(yn(yn({ref:v.innerRef},v.draggableProps),v.dragHandleProps),{},{className:X("btn btn-link btn-nav-tab",{active:i},{dragging:m.isDragging}),"data-testid":"btn-nav-tab-".concat(f),role:"tab",tabIndex:0,onClick:p=>{p.target.focus(),r(u)},onKeyPress:p=>{p.key==="Enter"&&r(u)},children:[f,d&&h.jsx(_e,{kind:"ghost",className:"btn-nav-tab-close",onClick:p=>{t==null||t(u),p.stopPropagation(),p.preventDefault()},icon:ja,tooltip:"Close"})]})),h.jsx(Va,{actions:l})]})},u)});jo.displayName="NavTab";const Lh=jo;function mi(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function pi(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?mi(Object(t),!0).forEach(function(r){jh(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):mi(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function jh(n,e,t){return e=Fh(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Fh(n){var e=Rh(n,"string");return typeof e=="symbol"?e:String(e)}function Rh(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var kh=500,$h=.01,Bh=5e-4;function gi(n){return n.scrollLeft===0}function bi(n){return n.scrollLeft+n.clientWidth===n.scrollWidth||n.scrollWidth===0}function Uh(n,e,t){var{isClosable:r=!1,key:i}=n,a=[];if(r&&t!=null){a.push({title:"Close",order:10,group:20,action:()=>{t(i)}});for(var o=!0,s=e.length-1;s>0&&e[s].key!==n.key;s-=1)if(e[s].isClosable===!0){o=!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:o}),a.push({title:"Close All",order:30,group:20,action:()=>{e.forEach(l=>{l.isClosable===!0&&t(l.key)})}})}return a}function Wh(n){var{activeKey:e,tabs:t,onSelect:r,onReorder:i,onClose:a,makeContextActions:o}=n,s=c.useRef(),[l,u]=c.useState(!0),[d,f]=c.useState(!0),[v,m]=c.useState(!0),p=c.useCallback(()=>{s.current!=null&&(s.current.clientWidth<s.current.scrollWidth&&t.length>0?u(!0):u(!1),f(gi(s.current)),m(bi(s.current)))},[t]);To(s.current,p);var g=c.useCallback(E=>{Mn.stopDragging(),E.destination&&(i==null||i(E.source.index,E.destination.index))},[i]),b=c.useCallback(()=>{if(s.current!=null){var E=gi(s.current);E!==d&&f(E);var P=bi(s.current);P!==v&&m(P)}},[d,v]),_=c.useRef({cancelClick:!1}),S=c.useCallback(()=>{if(!(s.current==null||_.current.cancelClick))for(var{children:E}=s.current,P=E.length-1;P>=0;P-=1){var x=E[P];if(x.offsetLeft<s.current.scrollLeft-5){x.scrollIntoView({behavior:"smooth",block:"nearest",inline:"start"});return}}},[]),w=c.useCallback(()=>{if(!(s.current==null||_.current.cancelClick))for(var{children:E}=s.current,P=0;P<E.length;P+=1){var x=E[P];if(x.offsetLeft+5>s.current.scrollLeft+s.current.offsetWidth){x.scrollIntoView({behavior:"smooth",block:"nearest",inline:"end"});return}}},[]),T=c.useCallback(function(E,P){var x=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,R=arguments.length>3?arguments[3]:void 0,B=s.current;B!=null&&(_.current.cancelClick=!0,E==="left"?B.scrollLeft=P-x:E==="right"&&(B.scrollLeft=P+x),_.current.rAF=requestAnimationFrame(Y=>{var Q=R??Y,$=Y-Q,U=$h*$+.5*Bh*$**2;U=Math.min(U,B.scrollWidth),T(E,P,U,Q)}))},[]),y=c.useCallback(()=>{var{holdTimer:E,rAF:P}=_.current;E!=null&&(clearTimeout(E),_.current.holdTimer=void 0),P!=null&&(cancelAnimationFrame(P),_.current.rAF=void 0),window.removeEventListener("mouseup",y)},[]);c.useEffect(()=>()=>window.removeEventListener("mouseup",y),[y]);var O=c.useCallback(E=>{s.current!=null&&(_.current.holdTimer=window.setTimeout(T,kh,E,s.current.scrollLeft)),_.current.cancelClick=!1,window.addEventListener("mouseup",y)},[y,T]),M=c.useCallback(()=>{O("left")},[O]),A=c.useCallback(()=>{O("right")},[O]);c.useEffect(function(){var P,x=R=>{R.stopPropagation(),R.preventDefault();var B=R.currentTarget,Y=Math.abs(R.deltaY)>Math.abs(R.deltaX)?R.deltaY:R.deltaX;B.scrollLeft+=Ia(Y,-30,30)};return(P=s.current)===null||P===void 0||P.addEventListener("wheel",x),()=>{var R;(R=s.current)===null||R===void 0||R.removeEventListener("wheel",x)}},[]);var j=c.useMemo(()=>{var E=new Map;return t.forEach(P=>{var{key:x}=P,R=[()=>Uh(P,t,a),()=>{var B;return(B=o==null?void 0:o(P))!==null&&B!==void 0?B:[]}];E.set(x,R)}),E},[o,t,a]),F=c.useRef(null),V=t.find(E=>E.key===e),D=t.map((E,P)=>{var{key:x}=E,R=E===V;return h.jsx(Lh,{tab:E,index:P,isActive:R,activeRef:F,onSelect:r,onClose:a,isDraggable:i!=null,contextActions:j.get(x)},x)});return c.useEffect(function(){F.current!=null&&F.current.scrollIntoView({block:"nearest",inline:"nearest"})},[e]),h.jsxs("nav",{className:"nav-container",children:[l&&h.jsx(_e,{kind:"ghost",icon:h.jsx(me,{icon:Nl,transform:"grow-4"}),className:"tab-controls-btn tab-controls-btn-left",tooltip:"Scroll left",onClick:S,onMouseDown:M,disabled:d}),h.jsx(gl,{onDragStart:Mn.startDragging,onDragEnd:g,children:h.jsx(bl,{droppableId:"droppable-tab-navigation",direction:"horizontal",children:(E,P)=>h.jsxs("div",pi(pi({ref:x=>{x!=null&&(s.current=x,E.innerRef(x))}},E.droppableProps),{},{className:X("nav nav-tabs",{dragging:P.draggingFromThisWith}),role:"tablist",onScroll:b,children:[D,E.placeholder]}))})}),l&&h.jsx(_e,{kind:"ghost",icon:h.jsx(me,{icon:Ll,transform:"grow-4"}),className:"tab-controls-btn tab-controls-btn-right",tooltip:"Scroll right",onClick:w,onMouseDown:A,disabled:v})]})}function Vh(){var{selectedThemeKey:n,setSelectedThemeKey:e,themes:t}=Tt(),r=c.useCallback(i=>{e(i)},[e]);return h.jsx(yl,{label:"Pick a color scheme",items:t,selectedKey:n,onSelectionChange:r,children:i=>h.jsx(Da,{children:i.name},i.themeKey)})}function Hh(n){var{className:e,style:t}=n;return h.jsx("div",{className:X("dh-logo",e),style:t})}var zh=.025,Gh=.9,Kh=.1,Xh=.618,yi=80,et={SIZE:8,DOT_SIZE:2},Re=18,Yh=250,qh=60*1e3,Zh={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 Jh(){return or(Zh)}var Qh=q.memo(()=>{var{activeThemes:n}=Tt(),e=c.useMemo(Jh,[n]),t=c.useRef(null),r=c.useRef(null),[i,a]=c.useState(!1),o=window.devicePixelRatio,s,l,u,d,f,v=null,m=[];function p(){var D;r.current!=null&&(u=r.current.offsetWidth,d=r.current.offsetHeight),t.current!=null&&(t.current.style.width="".concat(u,"px"),t.current.style.height="".concat(d,"px"),t.current.width=u*o,t.current.height=d*o),(D=s)===null||D===void 0||D.scale(o,o)}function g(){var{foregroundFill:D,foregroundStroke:E}=e,P=document.createElement("canvas");P.width=et.SIZE,P.height=et.SIZE;var x=P.getContext("2d");return x!=null&&(x.fillStyle=E,x.fillRect(0,0,et.DOT_SIZE,et.DOT_SIZE),x.fillStyle=D,x.fillRect(0,0,et.SIZE,et.SIZE)),x==null?void 0:x.createPattern(P,"repeat")}function b(D){var E=Math.random()-.5,P=zh*E;return D<Kh?P=Math.abs(P):D>Gh&&(P=-Math.abs(P)),D+P}function _(){for(var D=[],E=Xh,P=0;P<u+Re;P+=1)E=b(E),D.push(E);return D}function S(){for(;m.length>=u+Re;)m.pop();for(;m.length<u+Re;)m.push(b(m[m.length-1]))}function w(D,E){E.beginPath(),E.moveTo(-1,d+1),E.lineTo(-1,d*D[0]);for(var P=0;P<D.length;P+=1)E.lineTo(P,d*D[P]);E.lineTo(u+Re,d*D[D.length-1]),E.lineTo(u+Re,d+1),E.closePath()}function T(D){D.beginPath();for(var E=1;E<u;E+=yi)D.moveTo(E,0),D.lineTo(E,d);for(var P=1;P<d;P+=yi)D.moveTo(0,P),D.lineTo(u,P)}function y(D){var E,P,x;v=(E=v)!==null&&E!==void 0?E:D;var{background:R,foregroundStroke:B,gridColor:Y}=e;ze(s),s.fillStyle=R,s.fillRect(0,0,u,d),T(s),s.lineWidth=1,s.strokeStyle=Y,s.stroke();var Q=(((P=v)!==null&&P!==void 0?P:0)-(D??0))/(1e3/Re);if(s.translate(Q,0),w(m,s),s.lineWidth=2,s.strokeStyle=B,s.stroke(),s.translate(-Q,0),l!=null&&(s.fillStyle=l),s.fill(),s.setTransform(o,0,0,o,0,0),(D??0)-((x=v)!==null&&x!==void 0?x:0)>1e3/Re){for(var $,U=Math.floor(((D??0)-(($=v)!==null&&$!==void 0?$:0))/(1e3/Re)),N=0;N<U;N+=1)m.shift(),m.push(b(m[m.length-1]));v=D}f!=null&&cancelAnimationFrame(f),f=requestAnimationFrame(y)}var O=qe(()=>{f=requestAnimationFrame(D=>{p(),S(),a(!1),y(D)})},Yh,{leading:!0});function M(){a(!0),f!=null&&cancelAnimationFrame(f),f=null,v=null}var A=qe(()=>{M()},qh);function j(){f==null&&(a(!1),p(),S(),f=requestAnimationFrame(y)),A()}function F(){document.hasFocus()&&j()}function V(){f!=null&&cancelAnimationFrame(f),A(),O()}return c.useEffect(()=>{var D;return s=(D=t.current)===null||D===void 0?void 0:D.getContext("2d",{alpha:!1}),p(),m=_(),l=g(),y(),A(),window.addEventListener("resize",V),window.addEventListener("focus",j),window.addEventListener("blur",M),window.addEventListener("mousemove",F),window.addEventListener("keydown",F),()=>{f!=null&&cancelAnimationFrame(f),window.removeEventListener("resize",V),window.removeEventListener("focus",j),window.removeEventListener("blur",M),window.removeEventListener("mousemove",F),window.removeEventListener("keydown",F),A.cancel(),O.cancel()}},[e]),h.jsx("div",{className:"random-area-plot-animation-container",ref:r,children:h.jsx("canvas",{ref:t,className:i?"shade":""})})});const Fo=Qh;function Ro(n){var{text:e,placement:t="top-start"}=n,r=c.useMemo(()=>({placement:t}),[t]);return h.jsxs(h.Fragment,{children:[h.jsx(Pa,{UNSAFE_className:vr.spectrumEllipsis,children:e??h.jsx(h.Fragment,{children:" "})}),e==null||e===""?null:h.jsx(rn,{options:r,children:e})]})}var ef=["scrollRef","getItemDisplayText","getKey"];function _i(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function wi(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?_i(Object(t),!0).forEach(function(r){tf(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):_i(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function tf(n,e,t){return e=nf(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function nf(n){var e=rf(n,"string");return typeof e=="symbol"?e:String(e)}function rf(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function af(n,e){if(n==null)return{};var t=of(n,e),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(n);for(i=0;i<a.length;i++)r=a[i],!(e.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(n,r)&&(t[r]=n[r])}return t}function of(n,e){if(n==null)return{};var t={},r=Object.keys(n),i,a;for(a=0;a<r.length;a++)i=r[a],!(e.indexOf(i)>=0)&&(t[i]=n[i]);return t}function sf(n){var{scrollRef:e,getItemDisplayText:t,getKey:r}=n,i=af(n,ef),a=c.useCallback(o=>{var s=r(o),l=t(o);return h.jsx(Da,{textValue:l??String(s),children:h.jsx(Ro,{text:l})},s)},[t,r]);return h.jsx(_l,wi(wi({},i),{},{ref:e,menuTrigger:"focus",onSelectionChange:i.onSelectionChange,children:a}))}var gr=q.forwardRef((n,e)=>{var{children:t,className:r,disabled:i,id:a,isLinked:o,isLinkedSource:s,isInvalid:l,onClick:u,onMouseEnter:d,onMouseLeave:f,style:v,"data-testid":m}=n;return h.jsxs("button",{ref:e,type:"button",className:X("btn-socketed",{"btn-socketed-linked":o!==void 0&&o||s},{"btn-socketed-linked-source":s},{"is-invalid":l},r),id:a,onClick:u,onMouseEnter:d,onMouseLeave:f,style:v,disabled:i,"data-testid":m,children:[t,h.jsx(me,{icon:jl,className:"linked btn-socketed-icon",transform:"down-1"}),h.jsx(me,{icon:Fl,className:"is-invalid btn-socketed-icon"})]})});gr.displayName="SocketedButton";gr.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 lf=gr;var uf=500;function df(n){var{heading:e,content:t,delayMs:r=uf}=n,[i,a]=c.useState(!1);return c.useEffect(()=>{window.setTimeout(()=>{a(!0)},r)},[r]),i?h.jsxs(wl,{children:[h.jsx(nr,{size:"XXL",children:h.jsx(me,{icon:Rl})}),h.jsx(Ta,{children:e}),t==null?null:h.jsx(Oa,{children:t})]}):null}const cf="_modified_10irp_24",hf="_track_10irp_35",ff="_handle_10irp_15",vf="_ticks_10irp_103",ko={"handle-size":"15px","popover-width":"90px","time-slider":"_time-slider_10irp_5","time-slider-popovers":"_time-slider-popovers_10irp_10","handle-popper":"_handle-popper_10irp_15",modified:cf,"flex-spacer":"_flex-spacer_10irp_31",track:hf,"track-fills":"_track-fills_10irp_42","track-fill":"_track-fill_10irp_42","track-fill-start":"_track-fill-start_10irp_60","track-fill-middle":"_track-fill-middle_10irp_61","track-fill-end":"_track-fill-end_10irp_64","handle-track":"_handle-track_10irp_67",handle:ff,ticks:vf,"tick-labels":"_tick-labels_10irp_121","tick-label":"_tick-label_10irp_121","tick-label-wrapper":"_tick-label-wrapper_10irp_137"};var jt=parseInt(ko["handle-size"],10),Si=parseInt(ko["popover-width"],10),ve=24*60*60-1,Ei=5*60;function mf(n){var{startTime:e,endTime:t,onChange:r,isStartModified:i=!1,isEndModified:a=!1,"data-testid":o}=n,[s,l]=c.useState(e),[u,d]=c.useState(t),f=c.useRef(null);c.useEffect(function(){l(e),d(t)},[e,t]);var v=c.useCallback((g,b)=>{var _=g,S=b;_===S&&(S<ve?S+=1:_-=1),l(_),d(S),r({startTime:_,endTime:S})},[l,d,r]),m=c.useCallback(g=>{v(g,u)},[v,u]),p=c.useCallback(g=>{v(s,g)},[v,s]);return h.jsxs("div",{className:"time-slider","data-testid":o,children:[h.jsx(pf,{startTime:s,endTime:u,onStartTimeChange:m,onEndTimeChange:p,isStartModified:i,isEndModified:a}),h.jsxs("div",{className:"track",ref:f,children:[h.jsx(gf,{startTime:s,endTime:u}),h.jsx("div",{className:"ticks",children:Array(24).fill(null).map((g,b)=>h.jsx("div",{className:"tick"},b))}),h.jsx(Ci,{track:f,time:s,setTime:m}),h.jsx(Ci,{track:f,time:u,setTime:p})]}),h.jsxs("div",{className:"tick-labels",children:[h.jsx("div",{className:"tick-label",children:"0:00"}),h.jsx("div",{className:"tick-label-wrapper",children:Array(24).fill(null).map((g,b)=>h.jsx("div",{className:"tick-label",children:"".concat(b+1,":00")},b))})]})]})}function pf(n){var{startTime:e,endTime:t,onStartTimeChange:r,onEndTimeChange:i,isStartModified:a,isEndModified:o,"data-testid":s}=n,l=e>t,[u,d]=c.useState(l?t:e),[f,v]=c.useState(l?e:t),m=c.useRef(null),p=c.useRef(null),g=c.useRef(null),b=c.useRef(null);c.useEffect(function(){d(e>t?t:e),v(e>t?e:t)},[e,t]),c.useEffect(function(){if(g.current!==null){var O;(O=p.current)===null||O===void 0||O.setSelection(g.current)}if(b.current!==null){var M;(M=m.current)===null||M===void 0||M.setSelection(b.current)}},[l]);function _(y){e<=t?r(y):i(y)}function S(y){e<=t?i(y):r(y)}var w=c.useCallback(y=>{g.current=y,b.current=null},[]),T=c.useCallback(y=>{g.current=null,b.current=y},[]);return h.jsxs("div",{className:"time-slider-popovers",children:[h.jsx("div",{className:"flex",style:{flexBasis:"calc(".concat(u/ve*100,"% - ").concat(Si/2,"px)")}}),h.jsxs("div",{className:"handle-popper",children:[h.jsx("label",{className:X({modified:l?o:a}),children:l?"End Time":"Start Time"}),h.jsx(Yt,{ref:m,allowValueWrapping:!1,value:u,onChange:_,onSelect:w,"data-testid":s!==void 0?"".concat(s,"-input-1"):void 0})]}),h.jsx("div",{className:"flex-spacer"}),h.jsxs("div",{className:"handle-popper",children:[h.jsx("label",{className:X({modified:l?a:o}),children:l?"Start Time":"End Time"}),h.jsx(Yt,{ref:p,allowValueWrapping:!1,value:f,onChange:S,onSelect:T,"data-testid":s!==void 0?"".concat(s,"-input-2"):void 0})]}),h.jsx("div",{className:"flex",style:{flexBasis:"calc(".concat((ve-f)/ve*100,"% - ").concat(Si/2,"px)")}})]})}function gf(n){var{startTime:e,endTime:t,"data-testid":r}=n;return h.jsxs("div",{className:"track-fills","data-testid":r,children:[e>t&&h.jsxs(h.Fragment,{children:[h.jsx("div",{className:"track-fill track-fill-start",style:{transform:"scaleX(".concat(t/ve,")")}}),h.jsx("div",{className:"track-fill track-fill-end",style:{transform:"scaleX(".concat((ve-e)/ve,")")}})]}),e<t&&h.jsx("div",{className:"track-fill track-fill-middle",style:{transform:"translateX(".concat(e/ve*100,"%) scaleX(").concat((t-e)/ve,")")}})]})}function Ci(n){var{track:e,time:t,setTime:r,"data-testid":i}=n,a=c.useMemo(()=>{var v=3600,m=jt/2;return t<v?m=t/v*(jt/2):t>23*v&&(m=jt/2+1/(ve-23*v)*(t-23*v)*(jt/2)),"translateX(calc(".concat(t/ve*100,"% - ").concat(m,"px))")},[t]),o=c.useCallback(v=>{if(!e.current)return 0;var m=e.current.getBoundingClientRect(),p=Math.max(v-m.left,0),g=ve*Math.min(1,p/m.width),b=Ei*Math.round(g/Ei),_=Math.min(ve,b);return _},[e]),s=c.useCallback(v=>{var{clientX:m}=v;r(o(m))},[r,o]),l=c.useCallback(v=>{var{clientX:m}=v;r(o(m)),window.removeEventListener("mousemove",s),window.removeEventListener("mouseup",l),document.documentElement.classList.remove("drag-pointer-events-none")},[r,o,s]),u=c.useCallback(()=>{window.addEventListener("mousemove",s),window.addEventListener("mouseup",l),document.documentElement.classList.add("drag-pointer-events-none")},[s,l]),d=c.useCallback(()=>{window.removeEventListener("mousemove",s),window.removeEventListener("mouseup",l),document.documentElement.classList.remove("drag-pointer-events-none")},[s,l]),f=c.useCallback(()=>{u()},[u]);return c.useEffect(function(){return()=>{d()}},[d]),h.jsx("div",{className:"handle-track",style:{transform:a},children:h.jsx("button",{className:"handle",type:"button","aria-label":"Change time",onMouseDown:f,"data-testid":i})})}function $o(n){var{buttons:e,isShown:t=!1,classNames:r,message:i,type:a,onClick:o,onDismiss:s,"data-testid":l}=n,u=e&&e.length!==0;return h.jsx(zt,{in:t,timeout:Gt.transitionMs,classNames:"toast-notification-slide-up",mountOnEnter:!0,unmountOnExit:!0,children:h.jsxs("div",{className:X("toast-notification",r,a),role:"presentation",onClick:o,onKeyPress:o,"data-testid":l,children:[h.jsx("div",{className:"message-container",children:h.jsx("span",{className:"message",children:i})}),h.jsx(zt,{in:u,timeout:Gt.transitionSlowMs,classNames:"fade",mountOnEnter:!0,unmountOnExit:!0,children:h.jsx("div",{className:"buttons-container",children:e})}),s&&h.jsx(_e,{kind:"ghost",icon:ja,tooltip:"Close notification",className:"my-2",onClick:s})]})})}$o.TYPE=Object.freeze({ERROR:"error"});function bf(n){var{children:e,className:t,labelText:r,hintText:i,isModified:a,validationError:o,showValidationError:s=!0,"data-testid":l,id:u}=n,{current:d}=c.useRef(u??Ne());return h.jsxs(h.Fragment,{children:[h.jsx("label",{className:X("validate-label",t,{modified:a}),htmlFor:d,"data-testid":l,children:r}),q.Children.toArray(e).map(f=>q.isValidElement(f)?q.cloneElement(f,{className:X(f.props.className,{"is-invalid":o})}):h.jsx("div",{className:X(t),children:f})),i!==void 0&&h.jsx("small",{className:"form-text text-muted",children:i}),o!==void 0&&s&&h.jsx("p",{className:"validate-label-error text-danger",children:o})]})}const yf=Object.freeze(Object.defineProperty({__proto__:null,ActionButtonDialogTrigger:uo,AutoCompleteInput:Zc,AutoResizeTextarea:mr,BasicModal:pr,BulkActionBar:ih,Button:_e,ButtonGroup:Ot,ButtonOld:eh,CSS_VAR_EXPRESSION_PREFIX:kl,CardFlip:ah,Checkbox:An,Collapse:lh,ComboBox:bu,ConfirmActionButton:Bc,ConfirmationDialog:Oo,ContextActionUtils:yu,ContextActions:Va,ContextMenuItem:_u,ContextMenuRoot:wu,CopyButton:Ha,CustomTimeSelect:mh,DEFAULT_DARK_THEME_KEY:$l,DEFAULT_DARK_THEME_PALETTE:Bl,DEFAULT_GET_PREFERRED_REPLACEMENT_STRING:Ua,DEFAULT_LIGHT_THEME_KEY:Ul,DEFAULT_PRELOAD_DATA_VARIABLES:Wl,DateInput:_h,DateTimeInput:Su,DebouncedModal:Jc,DebouncedSearchInput:Eh,DragUtils:Mn,DraggableItemList:Eu,DropdownMenu:Wa,EditableItemList:Ch,ErrorBoundary:Th,GLOBAL_SHORTCUTS:Cu,HierarchicalCheckboxMenu:xh,IconActionButton:Io,InfoModal:Qc,ItemList:xn,ItemListItem:Pu,get KEY(){return Tu},LoadingOverlay:Pe,LoadingSpinner:Fa,Logo:Hh,get MODIFIER(){return Ou},MaskedInput:sr,Menu:Iu,MenuItem:Du,Modal:ir,ModalBody:ar,ModalFooter:Do,ModalHeader:La,NON_WHITESPACE_REGEX:Vl,NavTabList:Wh,Option:xu,Page:Au,Popper:an,RadioGroup:Mu,RadioItem:Nu,RandomAreaPlotAnimation:Fo,SVG_ICON_MANUAL_COLOR_MAP:Hl,SearchInput:lr,SearchableCombobox:sf,Select:Lu,SelectValueList:za,Shortcut:ju,ShortcutRegistry:Fu,SocketedButton:lf,Stack:Ru,THEME_CACHE_LOCAL_STORAGE_KEY:zl,TMP_CSS_PROP_PREFIX:Gl,TableViewEmptyState:df,TextWithTooltip:Ro,ThemeContext:ku,ThemeExport:Gt,ThemePicker:Vh,ThemeProvider:Ga,TimeInput:Yt,TimeSlider:mf,ToastNotification:$o,Tooltip:rn,UISwitch:$u,ValidateLabelInput:bf,WHITESPACE_REGEX:Kl,calculatePreloadStyleContent:Xl,createCssVariableResolver:Yl,createPreloadStyleElement:ql,extractDistinctCssVariableExpressions:Zl,fillToLength:Bu,getActiveThemes:Jl,getDefaultBaseThemes:Ql,getExpressionRanges:Ra,getThemeKey:ka,getThemePreloadData:eu,overrideSVGFillColors:tu,preloadTheme:nu,replaceSVGFillColor:ru,resolveCssVariablesInRecord:or,resolveCssVariablesInString:iu,setThemePreloadData:au,themeDHDefault:Uu,themeDark:ou,themeLight:su,trimTrailingMask:Wu,useTheme:Tt},Symbol.toStringTag,{value:"Module"}));function _f(n,e){var t=Te(),r=c.useMemo(()=>new t.CoreClient(n,e),[t,n,e]);return c.useEffect(()=>()=>{r.disconnect()},[r]),r}var br=c.createContext(null);function Bo(n){var{serverUrl:e,options:t,children:r}=n,i=_f(e,t);return h.jsx(br.Provider,{value:i,children:r})}function Ze(){return Pt(br,"No Client available in useClient. Was code wrapped in ClientBootstrap or ClientContext.Provider?")}const wf=Object.freeze(Object.defineProperty({__proto__:null,ApiBootstrap:lu,ApiContext:$a,ClientBootstrap:Bo,ClientContext:br,useApi:Te,useClient:Ze},Symbol.toStringTag,{value:"Module"}));function Sf(n){return function(t){var{children:r}=t;return h.jsx($a.Provider,{value:n,children:r})}}function Pi(n,e,t,r,i,a,o){try{var s=n[a](o),l=s.value}catch(u){t(u);return}s.done?e(l):Promise.resolve(l).then(r,i)}function Ef(n){return function(){var e=this,t=arguments;return new Promise(function(r,i){var a=n.apply(e,t);function o(l){Pi(a,r,i,o,s,"next",l)}function s(l){Pi(a,r,i,o,s,"throw",l)}o(void 0)})}}var _n=H.module("MessageUtils"),Uo="io.deephaven.message.LoginOptions.request",Wo="io.deephaven.message.SessionDetails.request",Vo="io.deephaven.broadcast",yr="io.deephaven.broadcast.Login",Ho="io.deephaven.broadcast.Logout";function dn(n){var e=n;return e!=null&&typeof e.id=="string"&&typeof e.message=="string"}function zo(n){return dn(n)&&n.message===yr}function Go(n){return dn(n)&&n.message===Ho}function Ko(n){var e=n;return e!=null&&typeof e.id=="string"}function _r(n){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Ne(),t=arguments.length>2?arguments[2]:void 0;return{message:n,id:e,payload:t}}function Cf(n,e){return{id:n,payload:e}}function wr(){return window.opener!=null?window.opener:window.parent!=null&&window.parent!==window?window.parent:null}function Sr(n){return jn.apply(this,arguments)}function jn(){return jn=Ef(function*(n){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:3e4,t=wr();if(t==null)throw new Error("window parent is null, unable to send request.");return new Promise((r,i)=>{var a,o=Ne(),s=l=>{var{data:u}=l;if(!Ko(u)){_n.debug("Ignoring non-deephaven response",u);return}if(_n.debug("Received message",u),(u==null?void 0:u.id)!==o){_n.debug("Ignore message, id doesn't match",u);return}window.clearTimeout(a),window.removeEventListener("message",s),r(u.payload)};window.addEventListener("message",s),a=window.setTimeout(()=>{window.removeEventListener("message",s),i(new Vu("Request timed out"))},e),t.postMessage(_r(n,o),"*")})}),jn.apply(this,arguments)}function Pf(n,e,t){return e=Tf(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Tf(n){var e=Of(n,"string");return typeof e=="symbol"?e:String(e)}function Of(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class Xo extends Error{constructor(){super(...arguments),Pf(this,"isNoConsolesError",!0)}}function Yo(n){return n.isNoConsolesError}function Ti(n,e,t,r,i,a,o){try{var s=n[a](o),l=s.value}catch(u){t(u);return}s.done?e(l):Promise.resolve(l).then(r,i)}function cn(n){return function(){var e=this,t=arguments;return new Promise(function(r,i){var a=n.apply(e,t);function o(l){Ti(a,r,i,o,s,"next",l)}function s(l){Ti(a,r,i,o,s,"throw",l)}o(void 0)})}}var at=H.module("SessionUtils");function If(n,e){return at.info("Starting connection to '".concat(e,"'...")),new n.IdeConnection(e)}function qo(n,e,t){return Fn.apply(this,arguments)}function Fn(){return Fn=cn(function*(n,e,t){at.info("Getting console types...");var r=yield e.getConsoleTypes();if(r.length===0)throw new Xo("No console types available");at.info("Available types:",r);var i=r[0];at.info("Starting session with type",i);var a=yield e.startSession(i),o={type:i,id:Ne.generate()};return at.info("Console session established",o),{session:a,config:o,connection:e,details:t,dh:n}}),Fn.apply(this,arguments)}function Df(n,e,t){return at.info("createCoreClient",e),new n.CoreClient(e,t)}function xf(n){return n!=null&&typeof n=="object"}function Af(){return Rn.apply(this,arguments)}function Rn(){return Rn=cn(function*(){var n=yield Sr(Wo);if(!xf(n))throw new Error("Unexpected session details response: ".concat(n));return n}),Rn.apply(this,arguments)}function Mf(){return kn.apply(this,arguments)}function kn(){return kn=cn(function*(){var n=new URLSearchParams(window.location.search);switch(n.get("authProvider")){case"parent":return Af()}return{}}),kn.apply(this,arguments)}function Nf(n,e,t){return $n.apply(this,arguments)}function $n(){return $n=cn(function*(n,e,t){var r;try{r=yield qo(n,e,t)}catch(i){if(!Yo(i))throw i}return r}),$n.apply(this,arguments)}const Lf=Object.freeze(Object.defineProperty({__proto__:null,BROADCAST_CHANNEL_NAME:Vo,BROADCAST_LOGIN_MESSAGE:yr,BROADCAST_LOGOUT_MESSAGE:Ho,BooleanColumnFormatter:Hu,CharColumnFormatter:zu,DateTimeColumnFormatter:Gu,DateUtils:Ka,DecimalColumnFormatter:Ku,DefaultColumnFormatter:Xu,FETCH_TIMEOUT:Yu,Formatter:on,FormatterUtils:lt,IntegerColumnFormatter:qu,LOGIN_OPTIONS_REQUEST:Uo,NoConsolesError:Xo,SESSION_DETAILS_REQUEST:Wo,StringColumnFormatter:Zu,TableColumnFormatter:Ju,TableUtils:_t,createComboboxFilterArgs:Qu,createConnection:If,createCoreClient:Df,createFilterConditionFactory:ur,createKeyFromOffsetRow:ed,createNotNullOrEmptyFilterCondition:Xa,createOnTableUpdatedHandler:Ya,createSearchTextFilter:dr,createSelectedValuesFilter:cr,createSessionWrapper:qo,createShowOnlyEmptyFilterCondition:qa,createValueFilter:Za,defaultRowDeserializer:Ja,fetchVariableDefinition:td,generateEmptyKeyedItems:Qa,getColumnFormats:nd,getDateTimeFormatterOptions:rd,getSessionDetails:Mf,getSize:hr,getWindowParent:wr,isBroadcastLoginMessage:zo,isBroadcastLogoutMessage:Go,isClosed:Kt,isCustomColumnFormatDefined:id,isMessage:dn,isNoConsolesError:Yo,isResponse:Ko,loadSessionWrapper:Nf,makeMessage:_r,makeResponse:Cf,padFirstAndLastRow:eo,requestParentResponse:Sr},Symbol.toStringTag,{value:"Module"}));var Oi=H.module("useTableListener"),jf=(n,e,t)=>c.useEffect(function(){if(n==null){Oi.debug2("Emitter undefined, skipping addEventListener",e);return}return Oi.debug2("Adding listener",e),n.addEventListener(e,t)},[n,e,t]);const dt=jf;function Ff(n,e,t){return e=Rf(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Rf(n){var e=kf(n,"string");return typeof e=="symbol"?e:String(e)}function kf(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class $f extends Error{constructor(){super(...arguments),Ff(this,"isColumnNameError",!0)}}const Bf=$f;function Uf(n,e,t){return e=Wf(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Wf(n){var e=Vf(n,"string");return typeof e=="symbol"?e:String(e)}function Vf(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class Hf extends Error{constructor(){super(...arguments),Uf(this,"isTableDisconnectError",!0)}}const zf=Hf;var Ft=H.module("useTable"),Gf=(n,e,t,r)=>{var i=Te(),[a,o]=c.useState(void 0),[s,l]=c.useState([]),[u,d]=c.useState(null),[f,v]=c.useState(null);c.useEffect(()=>{if(r===void 0){o(n==null?void 0:n.columns),d(null);return}try{o(n==null?void 0:n.findColumns(r)),d(null)}catch(b){Ft.error("Column not found",b,r),d(new Bf("Invalid columnNames argument"))}},[n,r]),c.useEffect(()=>{if(!a||!n){Ft.debug2("Table or column not initialized, skip viewport update.");return}Ft.debug2("Setting viewport",e,t),n.setViewport(e,t,a)},[a,n,e,t]);var m=c.useCallback(b=>{var{detail:_}=b;if(!a){Ft.error("Columns not initialized.");return}var S=a.map(w=>_.rows.map(T=>T.get(w)));l(S)},[a]),p=c.useCallback(()=>{v(new zf("Table disconnected"))},[]),g=c.useCallback(()=>{v(null)},[]);return dt(n,i.Table.EVENT_UPDATED,m),dt(n,i.Table.EVENT_DISCONNECT,p),dt(n,i.Table.EVENT_RECONNECT,g),{columns:a,data:s,error:f??u}};const Zo=Gf;var Kf=(n,e,t,r)=>{var i=c.useMemo(()=>[r],[r]),{columns:a=[],data:o=[],error:s}=Zo(n,e,t,i);return{column:a[0],data:o[0],error:s}};const Jo=Kf;function Ii(n,e,t,r,i,a,o){try{var s=n[a](o),l=s.value}catch(u){t(u);return}s.done?e(l):Promise.resolve(l).then(r,i)}function Xf(n){return function(){var e=this,t=arguments;return new Promise(function(r,i){var a=n.apply(e,t);function o(l){Ii(a,r,i,o,s,"next",l)}function s(l){Ii(a,r,i,o,s,"throw",l)}o(void 0)})}}var Oe=H.module("TableInput"),wn=250;function Er(n){var e,t,{className:r=void 0,columnName:i,settings:a,defaultValue:o=[],isInvalid:s=!1,onChange:l=()=>!1,onBlur:u=()=>!1,table:d}=n,f=c.useRef(null),v=Te(),m=c.useMemo(()=>{var $=lt.getColumnFormats(a),U=lt.getDateTimeFormatterOptions(a),{defaultDecimalFormatOptions:N={},defaultIntegerFormatOptions:W={}}=a;return new on(v,$,U,N,W)},[v,a]),[p,g]=c.useState(""),[b,_]=c.useState(new Set(o)),[S,w]=c.useState(),T=c.useRef(null),y=Math.min((e=S==null?void 0:S.size)!==null&&e!==void 0?e:0,wn),{column:O,data:M,error:A}=Jo(S,0,wn-1,i),j=c.useCallback($=>O?m.getFormattedString($,O.type,O.name):"".concat($),[O,m]),[F,V]=c.useMemo(()=>{var $=new Set(b),U=[];if(M==null)return[U,null];if(M.forEach(W=>{var G="".concat(W),Fe=b.has(G);Fe&&$.delete(G),U.push({value:G,displayValue:j(W),isSelected:Fe})}),$.size>0){Oe.debug2("Selection has items that are missing from the viewport");var N=new Set(b);return Array.from($).forEach(W=>{N.delete(W)}),[U,N]}return[U,null]},[M,b,j]);c.useEffect(()=>{V!==null&&(_(V),l(Array.from(V)))},[l,V]);var D=c.useCallback(function(){var $=Xf(function*(U){try{var N=yield U;Oe.debug("Table resolved",N),w(N)}catch(W){if(qr.isCanceled(W))return;Oe.error(W)}});return function(U){return $.apply(this,arguments)}}(),[]);c.useEffect(()=>{var $=qr.makeCancelable(d);return D($),()=>{Oe.debug2("Cancel table promise"),$.cancel()}},[d,D]);var E=c.useCallback($=>{var{value:U}=$.target;g(U);var N=F.findIndex(G=>G.displayValue.includes(U));if(N>-1){var W;Oe.debug2("Found ".concat(U," at index ").concat(N)),(W=T.current)===null||W===void 0||W.scrollIntoView(N)}else Oe.debug2("".concat(U," not found"))},[F,T]),P=c.useCallback($=>{if(Oe.debug("handleSelect",$),$>=F.length){Oe.error("Invalid index",$);return}var U=F[$].value,N=new Set(b);F[$].isSelected?N.delete(U):N.add(U),_(N),l(Array.from(N))},[l,F,b]),x=c.useCallback(()=>{var $=F.map(N=>N.value),U=new Set($);_(U),l($)},[F,l]),R=c.useCallback(()=>{_(new Set),l([])},[l]),B=c.useCallback(()=>{},[]),Y=c.useCallback($=>{var U,{relatedTarget:N}=$;Oe.debug("handleChildBlur",N,N instanceof HTMLElement,f.current,(U=f.current)===null||U===void 0?void 0:U.contains(N)),(!N||f.current&&N instanceof HTMLElement&&!f.current.contains(N))&&u()},[u]),Q=F.length===0;return h.jsxs("div",{ref:f,className:X("table-input-container d-flex flex-column position-relative",r),children:[h.jsx(lr,{disabled:!!A||Q,value:p,placeholder:"Search",onChange:E,className:"mb-2 d-flex",onBlur:Y}),h.jsx(za,{className:"table-input-list",disabled:S===void 0||Q,isInvalid:s,items:Q?[{value:"Empty",isSelected:!1}]:F,itemCount:y,offset:0,onSelect:P,onViewportChange:B,ref:T,onBlur:Y}),S&&h.jsxs("div",{className:"meta-row",children:[h.jsx("div",{className:"d-flex align-items-center text-muted small",children:S!=null&&S.size>y&&h.jsxs(h.Fragment,{children:["Table is too large, showing the first ",wn," items."]})}),h.jsxs("div",{children:[h.jsx("button",{type:"button",className:"btn btn-link",onBlur:Y,onClick:x,children:"Select All"}),h.jsx("button",{type:"button",className:"btn btn-link mr-a",onBlur:Y,onClick:R,children:"Clear"})]})]}),S==null||A&&h.jsx("div",{className:"h-100 w-100 position-absolute",children:h.jsx(Pe,{isLoaded:S!=null,isLoading:S==null&&A==null,errorMessage:(t=A==null?void 0:A.message)!==null&&t!==void 0?t:null})})]})}Er.displayName="TableInput";Er.defaultProps={isInvalid:!1,className:void 0};var Di=H.module("useBroadcastChannel");function Cr(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:ad,e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Vo,t=c.useMemo(()=>new BroadcastChannel(e),[e]);return c.useEffect(()=>()=>{t.close()},[t]),c.useEffect(()=>{function r(i){var{data:a}=i;if(!dn(a)){Di.debug("Ignoring non-deephaven message",a);return}Di.debug("event received",a),n(i)}return t.addEventListener("message",r),()=>{t.removeEventListener("message",r)}},[t,n]),t}function hn(n,e){var t=c.useCallback(r=>{zo(r.data)?n==null||n(r.data):Go(r.data)&&(e==null||e(r.data))},[n,e]);Cr(t)}var qt="io.deephaven.web.client.auth.refreshToken",Qo=c.createContext(null),Yf=H.module("RefreshTokenUtils");function Bn(){var n=ft.get(qt);try{if(n!=null)return JSON.parse(n)}catch(e){Yf.error("Error parsing refresh token",n,e)}return null}function Un(n){if(n==null){ft.remove(qt);return}var e=JSON.stringify({bytes:n.bytes,expiry:n.expiry}),t=new Date(n.expiry);ft.set(qt,e,{secure:!0,sameSite:"strict",expires:t})}function es(n){var{children:e}=n,t=Te(),r=Ze(),[i,a]=c.useState(Bn());c.useEffect(function(){var u=r.addEventListener(t.CoreClient.EVENT_REFRESH_TOKEN_UPDATED,d=>{var{detail:f}=d;Un(f),a(f)});return u},[t,r,i]);var o=c.useCallback(()=>{a(Bn())},[]),s=c.useCallback(()=>{Un(null),a(null)},[]);return hn(o,s),h.jsx(Qo.Provider,{value:i,children:e})}function je(){var n=Te();return c.useMemo(()=>new _t(n),[n])}function qf(n,e,t,r){var i=je(),[a,o]=c.useState(""),s=ln(a,t),l=c.useCallback(v=>{o(v.trim())},[]),{data:u,isLoading:d}=wt(i.doesColumnValueExist,[n,e,s,r]),f=d||a!==s?null:u;return{valueTrimmed:a,valueTrimmedDebounced:s,valueExists:f,trimAndUpdateValue:l}}var xi=H.module("useDebouncedViewportSearch"),Zf=200;function Jf(n,e){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Zf,r=je(),{table:i,applyFiltersAndRefresh:a}=n,o=c.useMemo(()=>qe(s=>{if(xi.debug("Applying debounced searchText '".concat(s,"'")),i!=null){var l=s.trim();if(l===""){a([]);return}var u=i.findColumn(e),d=r.makeFilterValue(u.type,l),f=[u.filter().contains(d)];a(f)}},t),[a,e,t,i,r]);return c.useEffect(()=>()=>{xi.debug("Cancelling debounced search function"),o.cancel()},[o]),o}var ts=300;function Qf(n){var{viewportData:e,columnName:t,shouldSelectAllOnNoSelection:r,mapItemToValue:i}=n,a=je(),o=wo(e,i),s=ln(o,ts),l=bo(s,ho);return c.useMemo(()=>cr(a,t,l.selection,r,l.isInverted),[t,l,r,a])}function Pr(n){for(var e=arguments.length,t=new Array(e>1?e-1:0),r=1;r<e;r++)t[r-1]=arguments[r];return c.useMemo(()=>od(...t.map(i=>i(n))),[n,...t])}function ev(n,e,t,r){var i=c.useRef("");return i.current=t,c.useMemo(()=>{var a=n.length>0&&n[0].item==null;return!a&&r!=null&&(i.current===""||r.toLowerCase().includes(i.current.toLowerCase()))?[{key:r,item:{[e]:r}},...n]:n},[r,e,n])}function Ai(n,e,t,r,i,a,o){try{var s=n[a](o),l=s.value}catch(u){t(u);return}s.done?e(l):Promise.resolve(l).then(r,i)}function tv(n){return function(){var e=this,t=arguments;return new Promise(function(r,i){var a=n.apply(e,t);function o(l){Ai(a,r,i,o,s,"next",l)}function s(l){Ai(a,r,i,o,s,"throw",l)}o(void 0)})}}function nv(n){var{table:e,columnName:t,defaultValue:r,itemHeight:i,topOffset:a=0,value:o}=n;return c.useCallback(tv(function*(){if(e==null||o===""||o===r)return a;var s=e.findColumn(t),l=yield e.seekRow(0,s,"String",o),u=r==null?0:1;return(l+u)*i+a}),[t,r,i,e,a,o])}function Tr(n){var[,e]=c.useState(0),t=Te();return dt(n,t.Table.EVENT_SIZECHANGED,()=>{e(r=>r+1)}),hr(n)}var rv=H.module("useInitializeViewportData");function ns(n){var e=Co({}),t=Math.max(0,Tr(n));return c.useEffect(()=>{var r=e.items.length;t!==r&&(rv.debug("size changed:",{currentSize:r,targetSize:t}),e.setItems(Array.from(Qa(0,t-1))))},[t,n]),e}function rs(n,e,t){return c.useCallback(function(i){var[a,o]=eo(i,e,t,hr(n));n==null||n.setViewport(a,o)},[n,t,e])}var Mi=H.module("useViewportData");function Or(n){var{table:e,itemHeight:t=1,scrollDebounce:r=oc,viewportSize:i=10,viewportPadding:a=50,deserializeRow:o=Ja}=n,s=ns(e),l=rs(e,i,a),u=c.useCallback(g=>{e&&!Kt(e)?l(g):Mi.debug("setViewport called on closed table.",e)},[e,l]),d=c.useCallback(g=>{e&&!Kt(e)?(e.applyFilter(g),u(0)):Mi.debug("applyFiltersAndRefresh called on closed table.",e)},[u,e]),f=Te(),v=c.useMemo(()=>Ya(s,o),[o,s]);dt(e,f.Table.EVENT_UPDATED,v);var m=Tr(e);c.useEffect(()=>{u(0)},[e,u,m]);var p=So(t,u,r);return c.useMemo(()=>({viewportData:s,size:m,table:e,applyFiltersAndRefresh:d,setViewport:u,onScroll:p}),[d,p,u,m,e,s])}function Ir(n,e){var{applyFiltersAndRefresh:t}=n;c.useEffect(()=>{t(e)},[t,e])}function iv(n,e){for(var t=je(),[r,i]=c.useState(""),a=c.useMemo(()=>dr(t,e,r),[e,r,t]),o=Xt(i,oo),s=Or({table:n,itemHeight:ac,viewportSize:so,viewportPadding:lo}),l=arguments.length,u=new Array(l>2?l-2:0),d=2;d<l;d++)u[d-2]=arguments[d];var f=Pr(s.table,a,...u);return Ir(s,f),{list:s,onSearchTextChange:o}}function av(n){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"or",t=je(),r=c.useMemo(()=>Xa(t),[t]);return c.useMemo(()=>ur(n,r,e),[n,e,r])}function is(n){c.useEffect(()=>()=>{n!=null&&(Kt(n)||n.close())},[n])}function ov(n,e,t){for(var r=je(),[i,a]=c.useState(""),[o,s]=c.useState(""),[l,u]=c.useState(null),[d,f]=c.useState(()=>new Map),{data:v,isLoading:m}=wt(r.doesColumnValueExist,[n,e,o,!1]),p=m||o!==i?null:v,g=c.useMemo(()=>dr(r,e,o),[e,o,r]),b=c.useMemo(()=>cr(r,e,new Set(d.keys()),!1,!0),[e,d,r]),_=arguments.length,S=new Array(_>3?_-3:0),w=3;w<_;w++)S[w-3]=arguments[w];var{data:T}=wt(r.createDistinctSortedColumnTable,[n,e,"asc",...S]);is(T);var y=Or({table:T,itemHeight:ic,viewportSize:so,viewportPadding:lo}),O=i.length>0&&y.size===0,M=d.has(i),A=Xt(s,oo),j=c.useCallback(x=>{a(x),A(x)},[A]),F=Xt(u,0),V=c.useCallback(x=>{if(a(""),s(""),u(x),F(null),x!=null){var R=y.viewportData.findItem(x);if(R!=null){var B=t(R);f(Y=>{var Q=new Map(Y);return Q.set(B,{value:B}),Q})}}},[F,y.viewportData,t]),D=c.useCallback(x=>{f(R=>{if(x.size===0)return R;var B=new Map(R);for(var Y of x)B.set(Y,{value:Y});return B})},[]),E=c.useCallback(x=>{f(R=>{if(x==="all")return new Map;var B=new Map(R);for(var Y of x)B.delete(Y);return B})},[]),P=Pr(y.table,g,b);return Ir(y,P),c.useMemo(()=>({list:y,hasSearchTextWithZeroResults:O,searchText:i,searchTextExists:p,searchTextIsInSelectedValues:M,selectedKey:l,selectedValueMap:d,onSearchTextChange:j,onSelectKey:V,onAddValues:D,onRemoveValues:E}),[O,y,D,E,j,V,i,p,M,l,d])}function Ni(n,e,t,r,i,a,o){try{var s=n[a](o),l=s.value}catch(u){t(u);return}s.done?e(l):Promise.resolve(l).then(r,i)}function sv(n){return function(){var e=this,t=arguments;return new Promise(function(r,i){var a=n.apply(e,t);function o(l){Ni(a,r,i,o,s,"next",l)}function s(l){Ni(a,r,i,o,s,"throw",l)}o(void 0)})}}function lv(n){for(var e=arguments.length,t=new Array(e>1?e-1:0),r=1;r<e;r++)t[r-1]=arguments[r];var i=c.useCallback(sv(function*(){var u;return(u=n==null?void 0:n.selectDistinct(n.findColumns(t)))!==null&&u!==void 0?u:null}),[n,...t]),{data:a,error:o,isError:s,isLoading:l}=wt(i,[]);return c.useEffect(()=>()=>{a==null||a.close()},[a]),{distinctTable:a,error:o,isError:s,isLoading:l}}function uv(n,e){var t=je(),r=c.useMemo(()=>qa(t,n),[n,t]);return c.useMemo(()=>ur(e,r),[e,r])}function dv(n,e,t){var r=je();return c.useMemo(()=>Za(r,n,e,t),[n,t,r,e])}const cv=Object.freeze(Object.defineProperty({__proto__:null,ConnectionContext:to,DEBOUNCE_MS:ts,REFRESH_TOKEN_KEY:qt,RefreshTokenBootstrap:es,RefreshTokenContext:Qo,TableDropdown:sd,TableInput:Er,makeApiContextWrapper:Sf,readRefreshToken:Bn,storeRefreshToken:Un,useBroadcastChannel:Cr,useBroadcastLoginListener:hn,useCheckIfExistsValue:qf,useConnection:ld,useDebouncedViewportSearch:Jf,useDebouncedViewportSelectionFilter:Qf,useFilterConditionFactories:Pr,useFilteredItemsWithDefaultValue:ev,useGetItemPosition:nv,useInitializeViewportData:ns,useNotNullOrEmptyFilter:av,usePickerWithSelectedValues:ov,useSearchableViewportData:iv,useSelectDistinctTable:lv,useSetPaddedViewportCallback:rs,useShowOnlyEmptyFilter:uv,useTable:Zo,useTableClose:is,useTableColumn:Jo,useTableListener:dt,useTableSize:Tr,useTableUtils:je,useValueFilter:dv,useViewportData:Or,useViewportFilter:Ir},Symbol.toStringTag,{value:"Module"}));var as=c.createContext(!1);function hv(n){var{fontClassNames:e=["fira-sans-regular","fira-sans-semibold","fira-mono"],children:t}=n,[r,i]=c.useState(!1);return c.useEffect(function(){document.fonts.ready.then(()=>{i(!0)})},[]),h.jsxs(h.Fragment,{children:[h.jsx(as.Provider,{value:r,children:t}),h.jsx("div",{id:"preload-fonts",style:{visibility:"hidden",position:"absolute",top:-1e4},children:e.map(a=>h.jsx("p",{className:a,children:"preload"},a))})]})}var It=c.createContext(null),Je=Object.freeze({AUTH_PLUGIN:"AuthPlugin",DASHBOARD_PLUGIN:"DashboardPlugin",WIDGET_PLUGIN:"WidgetPlugin",TABLE_PLUGIN:"TablePlugin",THEME_PLUGIN:"ThemePlugin"});function os(n){return"DashboardPlugin"in n}function Zt(n){return"AuthPlugin"in n}function ss(n){return"TablePlugin"in n}function ls(n){return os(n)||Zt(n)||ss(n)}function fv(n){return"type"in n&&n.type===Je.DASHBOARD_PLUGIN}function fn(n){return"type"in n&&n.type===Je.WIDGET_PLUGIN}function vv(n){return"type"in n&&n.type===Je.TABLE_PLUGIN}function us(n){return"type"in n&&n.type===Je.AUTH_PLUGIN}function ds(n){return"type"in n&&n.type===Je.THEME_PLUGIN}var mv=H.module("@deephaven/plugin.PluginUtils");function pv(n,e){return n==null||!fn(n)?!1:[n.supportedTypes].flat().some(t=>t===e)}function gv(n){var e=h.jsx(me,{icon:uu});if(!fn(n))return e;var{icon:t}=n;return t==null?e:c.isValidElement(t)?t:h.jsx(me,{icon:t})}function cs(n){var e=[...n.entries()].filter(t=>ds(t[1]));return mv.debug("Getting theme data from plugins",e),e.map(t=>{var[r,i]=t,a=Array.isArray(i.themes)?i.themes:[i.themes];return a.map(o=>{var{name:s,baseTheme:l,styleContent:u}=o;return{baseThemeKey:"default-".concat(l??"dark"),themeKey:ka(r,s),name:s,styleContent:u}})}).flat()}function hs(){return Pt(It,"No Plugins available in usePlugins. This can happen when plugins have not finished loading or if code is not wrapped in PluginsContext.Provider.")}function bv(n){var{fetch:e,type:t}=n,r=hs(),i=c.useMemo(()=>[...r.values()].filter(fn).find(o=>[o.supportedTypes].flat().includes(t)),[r,t]);if(i!=null){var a=i.component;return h.jsx(a,{fetch:e})}throw new Error("Unknown widget type '".concat(t,"'"))}const yv=Object.freeze(Object.defineProperty({__proto__:null,PluginType:Je,PluginsContext:It,WidgetView:bv,getIconForPlugin:gv,getThemeDataFromPlugins:cs,isAuthPlugin:us,isDashboardPlugin:fv,isLegacyAuthPlugin:Zt,isLegacyDashboardPlugin:os,isLegacyPlugin:ls,isLegacyTablePlugin:ss,isTablePlugin:vv,isThemePlugin:ds,isWidgetPlugin:fn,pluginSupportsType:pv,usePlugins:hs},Symbol.toStringTag,{value:"Module"}));function _v(n){if(n==null)return!1;var e=n;return e.Component!==void 0&&typeof e.isAvailable=="function"}var fs="io.deephaven.auth.AnonymousAuthenticationHandler",wv="io.deephaven.authentication.psk.PskAuthenticationHandler";function Li(n,e,t){return e=Sv(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Sv(n){var e=Ev(n,"string");return typeof e=="symbol"?e:String(e)}function Ev(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class Cv extends Error{constructor(){super(...arguments),Li(this,"name","AuthenticationError"),Li(this,"isAuthenticationError",!0)}}const vs=Cv;function ji(n,e,t,r,i,a,o){try{var s=n[a](o),l=s.value}catch(u){t(u);return}s.done?e(l):Promise.resolve(l).then(r,i)}function Pv(n){return function(){var e=this,t=arguments;return new Promise(function(r,i){var a=n.apply(e,t);function o(l){ji(a,r,i,o,s,"next",l)}function s(l){ji(a,r,i,o,s,"throw",l)}o(void 0)})}}var Fi=H.module("AuthPluginBase");function Dr(n){var{children:e,getLoginOptions:t}=n,r=Ze(),[i,a]=c.useState(),[o,s]=c.useState(!1);return c.useEffect(()=>{var l=!1;function u(){if(l)throw new ud("Login canceled.")}function d(){return f.apply(this,arguments)}function f(){return f=Pv(function*(){try{var v=yield t();u(),Fi.info("Logging in..."),yield r.login(v),u(),s(!0)}catch(g){if(!l){var m;Fi.error("Unable to login:",g);var p=(m=vt(g))!==null&&m!==void 0?m:"Unable to login. Verify credentials.";a(new vs(p)),s(!1)}}}),f.apply(this,arguments)}return d(),()=>{l=!0}},[r,t]),o?h.jsx(h.Fragment,{children:e}):h.jsx(Pe,{"data-testid":"auth-base-loading",isLoading:i==null,isLoaded:!1,errorMessage:vt(i)})}var Tv={canLogout:!1};function Ov(n){var{children:e}=n,t=Te(),r=c.useCallback(()=>({type:t.CoreClient.LOGIN_TYPE_ANONYMOUS}),[t]);return h.jsx(Dr,{getLoginOptions:r,children:h.jsx(sn.Provider,{value:Tv,children:e})})}var Iv={Component:Ov,isAvailable:n=>n.includes(fs)};const ms=Iv;function Ri(n,e,t,r,i,a,o){try{var s=n[a](o),l=s.value}catch(u){t(u);return}s.done?e(l):Promise.resolve(l).then(r,i)}function Dv(n){return function(){var e=this,t=arguments;return new Promise(function(r,i){var a=n.apply(e,t);function o(l){Ri(a,r,i,o,s,"next",l)}function s(l){Ri(a,r,i,o,s,"throw",l)}o(void 0)})}}var xv=H.module("AuthPluginParent"),Av={canLogout:!1};function Mv(n){return n!=null&&typeof n.type=="string"}function Nv(){return Wn.apply(this,arguments)}function Wn(){return Wn=Dv(function*(){xv.info("Logging in by delegating to parent window...");var n=yield Sr(Uo);if(!Mv(n))throw new Error("Unexpected login options response: ".concat(n));return n}),Wn.apply(this,arguments)}function Lv(){var n;return(n=new URLSearchParams(window.location.search).get("authProvider"))!==null&&n!==void 0?n:""}function jv(n){var{children:e}=n;return h.jsx(Dr,{getLoginOptions:Nv,children:h.jsx(sn.Provider,{value:Av,children:e})})}var Fv={Component:jv,isAvailable:()=>wr()!=null&&Lv()==="parent"};const ps=Fv;function gs(n){var{children:e,errorMessage:t,isLoggingIn:r=!1,onSubmit:i}=n;return h.jsxs("form",{className:"login-form",onSubmit:a=>{a.preventDefault(),a.stopPropagation(),i==null||i(a)},children:[h.jsx("div",{className:"flex-spacer"}),h.jsxs("div",{className:"flex-wrapper",children:[h.jsx("fieldset",{disabled:r,className:"container-fluid",children:e}),h.jsx("div",{className:"form-group d-flex justify-content-end align-items-center mb-0",children:h.jsxs("button",{type:"submit",className:X("btn btn-primary",{"btn-spinner":r},{"btn-cancelable":r}),"data-testid":"btn-login",children:[r&&h.jsxs("span",{children:[h.jsx(Fa,{className:"mr-2 loading-spinner-vertical-align"}),h.jsx("span",{className:"btn-normal-content",children:"Logging in"}),h.jsx("span",{className:"btn-hover-content",children:"Cancel"})]}),!r&&"Login"]})})]}),h.jsx("div",{className:"flex-spacer",children:t!=null&&h.jsx("p",{className:"error-message mb-0",role:"alert",children:"".concat(t)})})]})}function bs(n){var{children:e,logoPath:t="./logo.png"}=n;return h.jsxs("div",{className:"login-container",children:[h.jsx(Fo,{}),h.jsxs("div",{className:"login-box",children:[h.jsx("div",{className:"logo",children:h.jsx("img",{src:t,alt:"Deephaven Data Labs"})}),e,h.jsxs("p",{className:"footer",children:["© 2016-",new Date().getFullYear()," Deephaven Data Labs LLC. Patent Pending."]})]})]})}function ki(n,e,t,r,i,a,o){try{var s=n[a](o),l=s.value}catch(u){t(u);return}s.done?e(l):Promise.resolve(l).then(r,i)}function Sn(n){return function(){var e=this,t=arguments;return new Promise(function(r,i){var a=n.apply(e,t);function o(l){ki(a,r,i,o,s,"next",l)}function s(l){ki(a,r,i,o,s,"throw",l)}o(void 0)})}}var Vn="io.deephaven.authentication.psk.PskAuthenticationHandler",ys="psk",Hn="io.deephaven.web.client.auth.psk.token",ot=H.module("AuthPluginPsk");function Rv(){return new URLSearchParams(window.location.search).get(ys)}function kv(){ot.debug2("clearWindowToken");var n=new URL(window.location.href);n.searchParams.delete(ys),window.history.replaceState(null,"",n.href)}function $i(){var n;return(n=ft.get(Hn))!==null&&n!==void 0?n:null}function En(n){ot.debug2("Storing token in cookie",n),n!=null?ft.set(Hn,n,{secure:!0,sameSite:"strict"}):ft.remove(Hn)}function $v(n){var{children:e,logoPath:t}=n,r=Ze(),i=c.useRef(null),a=c.useRef(null),[o,s]=c.useState(),[l,u]=c.useState(!1),[d,f]=c.useState(!1),[v,m]=c.useState(!1),[p,g]=c.useState(""),b=c.useCallback(function(){var y=Sn(function*(O){var M=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;ot.info("Logging in..."),m(!0);var A=null;try{if(A=r.login({type:Vn,token:O}),a.current=A,yield A,ot.info("Logged in successfully"),a.current!==A)return;En(O),f(!0)}catch(V){if(a.current!==A)return;if(u(!0),M){var j;ot.error("Unable to login",V);var F=(j=vt(V))!==null&&j!==void 0?j:"Unable to login: Verify credentials.";s(new vs(F))}}m(!1)});return function(O){return y.apply(this,arguments)}}(),[r]),_=c.useCallback(()=>{a.current=null,m(!1)},[]),S=c.useCallback(Sn(function*(){ot.debug("onLogin");var y=$i();d||v||y==null||b(y,!1)}),[d,v,b]),w=c.useCallback(()=>{En(null)},[]);hn(S,w),c.useEffect(()=>{var y=!1;function O(){return M.apply(this,arguments)}function M(){return M=Sn(function*(){var A,j=(A=Rv())!==null&&A!==void 0?A:$i();if(kv(),j==null){u(!0);return}m(!0);try{yield r.login({type:Vn,token:j}),y||(En(j),f(!0),m(!1))}catch{y||(u(!0),m(!1))}}),M.apply(this,arguments)}return O(),()=>{y=!0}},[r]);var T=c.useCallback(()=>{v?_():b(p)},[_,v,b,p]);return c.useEffect(function(){var O;(O=i.current)===null||O===void 0||O.focus()},[i,l]),h.jsxs(h.Fragment,{children:[d&&e,l&&h.jsx(zt,{in:!d,timeout:Gt.transitionMs,classNames:"fade",mountOnEnter:!0,unmountOnExit:!0,children:h.jsx(bs,{logoPath:t,children:h.jsx(gs,{errorMessage:vt(o),isLoggingIn:v,onSubmit:T,children:h.jsxs("div",{className:"form-group",children:[h.jsx("label",{htmlFor:"auth-psk-token-input",children:"Token"}),h.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:p,onChange:y=>{s(void 0),g(y.target.value)}})]})})})}),h.jsx(Pe,{"data-testid":"auth-psk-loading",isLoaded:d||l,isLoading:!d&&!l})]})}var Bv={Component:$v,isAvailable:n=>n.includes(Vn)};const _s=Bv;function Bi(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function Cn(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Bi(Object(t),!0).forEach(function(r){Uv(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Bi(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function Uv(n,e,t){return e=Wv(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Wv(n){var e=Vv(n,"string");return typeof e=="symbol"?e:String(e)}function Vv(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var Hv=H.module("UserUtils");function ws(n,e){return n.get("internal.webClient.appInit.".concat(e))}function Ss(n){var e,t,r,i,a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};function s(b){return ws(n,b)}function l(b,_){var S=s(b);return S==="true"?!0:S==="false"?!1:(S!==void 0&&Hv.warn("Unexpected value for ".concat(b,": ").concat(S)),_)}var u=(e=s("name"))!==null&&e!==void 0?e:"",d=(t=s("operateAs"))!==null&&t!==void 0?t:u,f=(r=(i=s("groups"))===null||i===void 0?void 0:i.split(","))!==null&&r!==void 0?r:[],v=l("canCopy",!0),m=l("canDownloadCsv",!0),p=l("canUsePanels",!0),g=l("canLogout",!0);return Cn(Cn({name:u,operateAs:d,groups:f},a),{},{permissions:Cn({canUsePanels:p,canCopy:v,canDownloadCsv:m,canLogout:g},o)})}const zv=Object.freeze(Object.defineProperty({__proto__:null,AUTH_HANDLER_TYPE_ANONYMOUS:fs,AUTH_HANDLER_TYPE_PSK:wv,AuthPluginAnonymous:ms,AuthPluginBase:Dr,AuthPluginParent:ps,AuthPluginPsk:_s,Login:bs,LoginForm:gs,UserContext:no,UserOverrideContext:ro,UserPermissionsOverrideContext:sn,getAppInitValue:ws,getUserFromConfig:Ss,isAuthPlugin:_v},Symbol.toStringTag,{value:"Module"})),Es=typeof gn=="function"?gn:gn.default;fr.register([Jd,Qd,ec,tc,nc,rc]);function ue(n,e,t){return e=Gv(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Gv(n){var e=Kv(n,"string");return typeof e=="symbol"?e:String(e)}function Kv(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class te{constructor(e){ue(this,"dh",void 0),ue(this,"listeners",void 0),ue(this,"formatter",void 0),ue(this,"rect",void 0),ue(this,"isDownsamplingDisabled",void 0),ue(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(te.EVENT_UPDATED,{detail:e}))}fireDisconnect(){this.fireEvent(new CustomEvent(te.EVENT_DISCONNECT))}fireReconnect(){this.fireEvent(new CustomEvent(te.EVENT_RECONNECT))}fireDownsampleStart(e){this.fireEvent(new CustomEvent(te.EVENT_DOWNSAMPLESTARTED,{detail:e}))}fireDownsampleFinish(e){this.fireEvent(new CustomEvent(te.EVENT_DOWNSAMPLEFINISHED,{detail:e}))}fireDownsampleFail(e){this.fireEvent(new CustomEvent(te.EVENT_DOWNSAMPLEFAILED,{detail:e}))}fireDownsampleNeeded(e){this.fireEvent(new CustomEvent(te.EVENT_DOWNSAMPLENEEDED,{detail:e}))}fireLoadFinished(){this.fireEvent(new CustomEvent(te.EVENT_LOADFINISHED))}fireError(e){this.fireEvent(new CustomEvent(te.EVENT_ERROR,{detail:e}))}}ue(te,"EVENT_UPDATED","ChartModel.EVENT_UPDATED");ue(te,"EVENT_DISCONNECT","ChartModel.EVENT_DISCONNECT");ue(te,"EVENT_RECONNECT","ChartModel.EVENT_RECONNECT");ue(te,"EVENT_DOWNSAMPLESTARTED","ChartModel.EVENT_DOWNSAMPLESTARTED");ue(te,"EVENT_DOWNSAMPLEFINISHED","ChartModel.EVENT_DOWNSAMPLEFINISHED");ue(te,"EVENT_DOWNSAMPLEFAILED","ChartModel.EVENT_DOWNSAMPLEFAILED");ue(te,"EVENT_DOWNSAMPLENEEDED","ChartModel.EVENT_DOWNSAMPLENEEDED");ue(te,"EVENT_LOADFINISHED","ChartModel.EVENT_LOADFINISHED");ue(te,"EVENT_ERROR","ChartModel.EVENT_ERROR");const be=te;function Ui(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function Rt(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Ui(Object(t),!0).forEach(function(r){oe(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Ui(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function oe(n,e,t){return e=Xv(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Xv(n){var e=Yv(n,"string");return typeof e=="symbol"?e:String(e)}function Yv(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var mt=H.module("ChartUtils"),Wi="io.deephaven.time.DateTime",qv=36e5,Zv=1e6;function Jv(n){return n.asDate!==void 0}function Qv(n){return n.asNumber!==void 0}function Vi(n){return n.dhTimeZone!==void 0}function em(n){return n!=null&&n.range!=null&&(n.autorange===!1||n.autorange===void 0)}class I{static getPlotlyErrorBars(e,t,r,i){var a=r.map((s,l)=>s-e[l]),o=t.map((s,l)=>e[l]-s);return{type:"data",symmetric:!1,array:a,arrayminus:o,color:i.error_band_line_color}}static convertNumberPrefix(e){return e.replace(/\u00A4\u00A4/g,"USD").replace(/\u00A4/g,"$")}static getPlotlyNumberFormat(e,t,r){if(!r)return null;var i=r.split(";"),a=i[0].match(/^([^#,0.]*)([#,]*)([0,]*)(\.?)(0*)(#*)(E?0*)(%?)(.*)/);ze(a);var[,o,s,l,,u,d,f,v,m]=a,p=l.replace(",","").length,g=s.indexOf(",")>=0||l.indexOf(",")>=0,b=g?",":"",_=f!=null&&f!==""?"e":"f",S=v!==""?v:_,w=u.length+d.length,T="",y="0".concat(p).concat(b,".").concat(w).concat(T).concat(S),O=I.convertNumberPrefix(o),M=I.convertNumberPrefix(m);return{tickformat:y,tickprefix:O,ticksuffix:M,automargin:!0}}static addTickSpacing(e,t,r){var{gapBetweenMajorTicks:i}=t;if(i>0){var a=e||{},o=i;return r&&(o=i/Zv),t.log&&(o=Math.log(o)),a.tickmode="linear",a.dtick=o,a}return e}static getSourceForAxis(e,t){for(var r=0;r<e.series.length;r+=1)for(var i=e.series[r],a=0;a<i.sources.length;a+=1){var o=i.sources[a];if(o.axis===t)return o}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,r,i){var a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:I.ORIENTATION.VERTICAL;return{type:e,mode:t,name:r,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,r)=>[...t,...r.axes],[])}static getAxisTypeMap(e){var t=I.getAllAxes(e);return I.groupArray(t,"type")}static getChartForSeries(e,t){for(var{charts:r}=e,i=0;i<r.length;i+=1)for(var a=r[i],o=0;o<a.series.length;o+=1)if(t===a.series[o])return a;return null}static getLayoutRanges(e){for(var t={},r=Object.keys(e).filter(s=>s.indexOf("axis")>=0),i=0;i<r.length;i+=1){var a=r[i],o=e[a];em(o)&&(t[a]=[...o.range])}return t}static getAxisLayoutProperty(e,t){var r=t>0?"".concat(t+1):"";return"".concat(e??"","axis").concat(r)}static periodToDecimal(e){var t=e.split(":");return Number(t[0])+Number(t[1])/60}static groupArray(e,t){return e.reduce((r,i)=>{var a,o=i[t],s=(a=r.get(o))!==null&&a!==void 0?a:[];return s.push(i),r.set(o,s),r},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(" "):mt.warn("Unable to handle colorway property: ".concat(e.colorway))),t}static titleFromSettings(e){var{series:t,xAxis:r,title:i="".concat((t??[]).join(", ")," by ").concat(r)}=e;return i}constructor(e){oe(this,"dh",void 0),oe(this,"daysOfWeek",void 0),this.dh=e,this.daysOfWeek=Object.freeze(e.calendar.DayOfWeek.values())}getAxisFormats(e,t){for(var r=this,i=new Map,a={tickformat:null,ticksuffix:null},o=I.getAllAxes(e),s=I.groupArray(o,"type"),{charts:l}=e,u=0;u<l.length;u+=1)for(var d=l[u],f=0;f<d.series.length;f+=1)for(var v=d.series[f],{sources:m}=v,p=m.filter(S=>S.axis),g=function(){var w=p[b],{axis:T}=w,{type:y}=T,O=s.get(y);ze(O);var M=O.indexOf(T),A=r.getAxisPropertyName(y);if(A!=null){var j=I.getAxisLayoutProperty(A,M);if(i.has(j))mt.debug("".concat(j," already added."));else{mt.debug("Adding ".concat(j," to axisFormats."));var F=r.getPlotlyAxisFormat(w,t);if(F===null)i.set(j,a);else{i.set(j,F);var{businessCalendar:V}=T;if(V!=null){var D=[],{businessPeriods:E,businessDays:P,holidays:x,timeZone:R}=V,B=t==null?void 0:t.getColumnTypeFormatter(Wi),Y;Vi(B)&&(Y=B.dhTimeZone);var Q=Y?(R.standardOffset-Y.standardOffset)/60:0;x.length>0&&D.push(...r.createRangeBreakValuesFromHolidays(x,R,Y)),E.forEach($=>D.push({pattern:"hour",bounds:[I.periodToDecimal($.close)+Q,I.periodToDecimal($.open)+Q]})),P.length<r.daysOfWeek.length&&r.createBoundsFromDays(P).forEach($=>D.push({pattern:"day of week",bounds:$})),F.rangebreaks=D}if(i.size===d.axes.length)return{v:i}}}}},b=0;b<p.length;b+=1){var _=g();if(typeof _=="object")return _.v}return i}getPlotlyChartType(e,t){var{dh:r}=this;switch(e){case r.plot.SeriesPlotStyle.SCATTER:return t?"scatter":"scattergl";case r.plot.SeriesPlotStyle.LINE:return"scatter";case r.plot.SeriesPlotStyle.BAR:case r.plot.SeriesPlotStyle.STACKED_BAR:return"bar";case r.plot.SeriesPlotStyle.PIE:return"pie";case r.plot.SeriesPlotStyle.TREEMAP:return"treemap";case r.plot.SeriesPlotStyle.HISTOGRAM:return"histogram";case r.plot.SeriesPlotStyle.OHLC:return"ohlc";default:return}}getPlotlyChartMode(e,t,r){var{dh:i}=this,a=new Set;switch(e){case i.plot.SeriesPlotStyle.SCATTER:(t??!1)&&a.add(I.MODE_LINES),(r??!0)&&a.add(I.MODE_MARKERS);break;case i.plot.SeriesPlotStyle.LINE:(t??!0)&&a.add(I.MODE_LINES),(r??!1)&&a.add(I.MODE_MARKERS);break}return a.size>0?[...a].join("+"):void 0}getPlotlyProperty(e,t){var{dh:r}=this;switch(e){case r.plot.SeriesPlotStyle.PIE:switch(t){case r.plot.SourceType.X:return"labels";case r.plot.SourceType.Y:return"values"}break;case r.plot.SeriesPlotStyle.OHLC:switch(t){case r.plot.SourceType.TIME:return"x"}break;case r.plot.SeriesPlotStyle.TREEMAP:switch(t){case r.plot.SourceType.X:return"ids";case r.plot.SourceType.Y:return"values";case r.plot.SourceType.LABEL:return"labels";case r.plot.SourceType.PARENT:return"parents";case r.plot.SourceType.COLOR:return"marker.colors"}break}switch(t){case r.plot.SourceType.X:return"x";case r.plot.SourceType.Y:return"y";case r.plot.SourceType.Z:return"z";case r.plot.SourceType.X_LOW:return"xLow";case r.plot.SourceType.X_HIGH:return"xHigh";case r.plot.SourceType.Y_LOW:return"yLow";case r.plot.SourceType.Y_HIGH:return"yHigh";case r.plot.SourceType.TIME:return"time";case r.plot.SourceType.OPEN:return"open";case r.plot.SourceType.HIGH:return"high";case r.plot.SourceType.LOW:return"low";case r.plot.SourceType.CLOSE:return"close";case r.plot.SourceType.SHAPE:return"shape";case r.plot.SourceType.SIZE:return"size";case r.plot.SourceType.LABEL:return"label";case r.plot.SourceType.COLOR:return"color";case r.plot.SourceType.PARENT:return"parent";case r.plot.SourceType.HOVER_TEXT:return"hovertext";case r.plot.SourceType.TEXT:return"text";default:throw new Error("Unrecognized source type: ".concat(t))}}getPlotlySeriesOrientation(e){var t,r,{dh:i}=this,{sources:a}=e;return a.length===2&&((t=a[0])===null||t===void 0||(r=t.axis)===null||r===void 0?void 0:r.type)===i.plot.AxisType.Y?I.ORIENTATION.HORIZONTAL:I.ORIENTATION.VERTICAL}makeSeriesDataFromSeries(e,t,r,i){var a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:null,{name:o,isLinesVisible:s,isShapesVisible:l,plotStyle:u,lineColor:d,shapeColor:f,sources:v,shape:m,shapeSize:p}=e,g=v.some(T=>{var y;return(y=T.axis)===null||y===void 0?void 0:y.businessCalendar}),b=this.getChartType(u,g),_=this.getPlotlyChartMode(u,s??void 0,l??void 0),S=this.getPlotlySeriesOrientation(e),w=I.makeSeriesData(b,_,o,a,S);return this.addSourcesToSeriesData(w,u,v,t),this.addStylingToSeriesData(w,u,i,d,f,m,p,r),w}addSourcesToSeriesData(e,t,r,i){for(var a=e,o=0;o<r.length;o+=1){var s=r[o],{axis:l,type:u}=s,d=this.getPlotlyProperty(t,u);xa(a,d,[]);var f=l!=null?this.getAxisPropertyName(l.type):null;if(f!=null){var v=i.get(l.type);if(v){var m=v.indexOf(l),p=m>0?"".concat(m+1):"";a["".concat(f,"axis")]="".concat(f).concat(p)}}}}addStylingToSeriesData(e,t,r){var i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null,a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:null,o=arguments.length>5&&arguments[5]!==void 0?arguments[5]:null,s=arguments.length>6&&arguments[6]!==void 0?arguments[6]:null,l=arguments.length>7&&arguments[7]!==void 0?arguments[7]:null,{dh:u}=this,d=e;if(d.marker={line:{}},d.line={width:1},t===u.plot.SeriesPlotStyle.AREA?d.fill="tozeroy":t===u.plot.SeriesPlotStyle.STACKED_AREA?d.stackgroup="stack":t===u.plot.SeriesPlotStyle.STEP?d.line.shape="hv":t===u.plot.SeriesPlotStyle.HISTOGRAM?(d.width=[],d.marker.line!==void 0&&Object.assign(d.marker.line,{color:r.paper_bgcolor,width:1})):t===u.plot.SeriesPlotStyle.OHLC?(d.increasing={line:{color:r.ohlc_increasing}},d.decreasing={line:{color:r.ohlc_decreasing}}):t===u.plot.SeriesPlotStyle.PIE?(d.textinfo="label+percent",d.outsidetextfont={color:r.title_color}):t===u.plot.SeriesPlotStyle.TREEMAP&&(d.hoverinfo="text",d.textinfo="label+text",d.tiling={packing:"squarify",pad:0},d.textposition="middle center",d.outsidetextfont={color:r.title_color}),i!=null&&(t===u.plot.SeriesPlotStyle.BAR?d.marker.color=i:d.line.color=i),a!=null&&(d.marker.color=a),o!=null&&o.length>0)try{d.marker.symbol=I.getMarkerSymbol(o)}catch(f){mt.warn("Unable to handle shape",o,":",f)}s!=null&&(d.marker.size=s*I.DEFAULT_MARKER_SIZE),l!=null&&t!==u.plot.SeriesPlotStyle.PIE&&(d.visible=l)}getChartType(e,t){var{dh:r}=this;switch(e){case r.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,r,i){for(var a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0,o=arguments.length>5&&arguments[5]!==void 0?arguments[5]:0,s=e,l=I.getAllAxes(t),u=0;u<t.charts.length;u+=1){var d=t.charts[u],f=i==null?void 0:i(d),v=this.getChartBounds(t,d,a,o);this.updateLayoutAxes(s,d.axes,l,r,a,o,v,f)}this.removeStaleAxes(s,l)}getChartBounds(e,t,r,i){var a,{dh:o}=this,{cols:s,rows:l}=e,{column:u,colspan:d,row:f,rowspan:v}=t,m=u+d,p=f+v,g=1/s,b=1/l,_=I.AXIS_SIZE_PX/r,S=I.AXIS_SIZE_PX/i,w={bottom:(l-p)*b+(p<l?S/2:0),top:(l-f)*b-(f>0?S/2:0),left:u*g+(u>0?_/2:0),right:m*g-(m<s?_/2:0)},T=I.groupArray(t.axes,"position"),y=(a=T.get(o.plot.AxisPosition.RIGHT))!==null&&a!==void 0?a:[];return y.length>0&&(r>0?w.right-=(w.right-w.left)*Math.max(0,Math.min(I.LEGEND_WIDTH_PX/r,I.MAX_LEGEND_SIZE)):w.right-=(w.right-w.left)*I.DEFAULT_AXIS_SIZE),w}getPlotlyDateFormat(e,t,r){var{dh:i}=this,a=r==null?void 0:r.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",""),o,s=e==null?void 0:e.getColumnTypeFormatter(t);return s!=null&&Vi(s)&&s.dhTimeZone!=null&&s.showTimeZone&&(o=i.i18n.DateTimeFormat.format(" z",new Date,s.dhTimeZone)),{tickformat:a,ticksuffix:o,automargin:!0}}getPlotlyAxisFormat(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null,{dh:r}=this,{axis:i,columnType:a}=e,{formatPattern:o}=i,s=null;return _t.isDateType(a)?(s=this.getPlotlyDateFormat(t,a,o),s=I.addTickSpacing(s,i,!0)):_t.isNumberType(a)&&(s=I.getPlotlyNumberFormat(t,a,o),s=I.addTickSpacing(s,i,!1)),i.formatType===r.plot.AxisFormatType.CATEGORY&&(s?s.type="category":s={type:"category",tickformat:void 0,ticksuffix:void 0}),s}updateLayoutAxes(e,t,r,i){for(var a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0,o=arguments.length>5&&arguments[5]!==void 0?arguments[5]:0,s=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:u}=this,d=a>0?Math.max(I.MIN_AXIS_SIZE,Math.min(I.AXIS_SIZE_PX/o,I.MAX_AXIS_SIZE)):I.DEFAULT_AXIS_SIZE,f=o>0?Math.max(I.MIN_AXIS_SIZE,Math.min(I.AXIS_SIZE_PX/a,I.MAX_AXIS_SIZE)):I.DEFAULT_AXIS_SIZE,v=e,m=I.groupArray(t,"position"),p=I.groupArray(t,"type"),g=[...p.keys()],b=I.groupArray(r,"type"),_=0;_<g.length;_+=1){var S=g[_],w=this.getAxisPropertyName(S);if(w!=null){var T=p.get(S),y=b.get(S),O=S===u.plot.AxisType.Y,M=O?o:a;ze(T),ze(y);for(var A=0;A<T.length;A+=1){var j=T[A],F=y.indexOf(j),V=I.getAxisLayoutProperty(w,F);v[V]==null&&(v[V]=this.makeLayoutAxis(S,i));var D=v[V];if(D!=null){this.updateLayoutAxis(D,j,A,m,d,f,s);var{range:E,autorange:P}=D;if(l!=null&&E!==void 0&&(P===void 0||P===!1)){var x=l(j),[R,B]=x(E);mt.debug("Setting downsample range",M,R,B),j.range(M,R,B)}else j.range(M)}}}}}removeStaleAxes(e,t){for(var r=e,i=I.groupArray(t,"type"),a=[...i.keys()],o=0;o<a.length;o+=1){var s=a[o],l=i.get(s);ze(l);var u=l.length,d=this.getAxisPropertyName(s);if(d!=null)for(var f=I.getAxisLayoutProperty(d,u);r[f]!=null;)delete r[f],u+=1,f=I.getAxisLayoutProperty(d,u)}}updateLayoutAxis(e,t,r,i,a,o,s){var l,{dh:u}=this,d=t.type===u.plot.AxisType.Y,f=d?o:a,v=e,m=(l=t.label)!==null&&l!==void 0?l:"";if(v.title!==void 0&&typeof v.title!="string"?v.title.text=m:v.title={text:m},t.log&&(v.type="log"),v.side=this.getAxisSide(t.position),r>0){var p,g;v.overlaying=(p=this.getAxisPropertyName(t.type))!==null&&p!==void 0?p:void 0;var b=(g=i.get(t.position))!==null&&g!==void 0?g:[],_=b.indexOf(t);_>0&&(v.anchor="free",t.position===u.plot.AxisPosition.RIGHT?v.position=s.right+(_-b.length+1)*f:t.position===u.plot.AxisPosition.TOP?v.position=s.top+(_-b.length+1)*f:t.position===u.plot.AxisPosition.BOTTOM?v.position=s.bottom+(b.length-_+1)*f:t.position===u.plot.AxisPosition.LEFT&&(v.position=s.left+(b.length-_+1)*f))}else if(t.type===u.plot.AxisType.X){var S=i.get(u.plot.AxisPosition.LEFT)||[],w=i.get(u.plot.AxisPosition.RIGHT)||[],T=Math.max(s.left,s.left+(S.length-1)*o),y=Math.min(s.right-(w.length-1)*o,s.right);v.domain=[T,y]}else if(t.type===u.plot.AxisType.Y){var O=i.get(u.plot.AxisPosition.BOTTOM)||[],M=i.get(u.plot.AxisPosition.TOP)||[],A=Math.max(s.bottom,s.bottom+(O.length-1)*a),j=Math.min(s.top-(M.length-1)*a,s.top);v.domain=[A,j]}}createBoundsFromDays(e){var t=e.map(o=>this.daysOfWeek.indexOf(o)),r=this.daysOfWeek.filter(o=>!e.includes(o)).map(o=>this.daysOfWeek.indexOf(o)),i=new Set;r.forEach(o=>{for(var s=o+1;s<o+this.daysOfWeek.length;s+=1){var l=s%this.daysOfWeek.length;if(t.includes(l)){i.add(l);break}}});var a=[];return i.forEach(o=>{for(var s=o-1;s>o-this.daysOfWeek.length;s-=1){var l=s<0?s+this.daysOfWeek.length:s;if(t.includes(l)){var u=(l+1)%7;a.push([u,o]);break}}}),a}createRangeBreakValuesFromHolidays(e,t,r){var i=[],a=[];return e.forEach(o=>{o.businessPeriods.length>0?a.push(...this.createPartialHoliday(o,t,r)):i.push(this.createFullHoliday(o,t,r))}),[{values:i},...a]}createFullHoliday(e,t,r){return this.adjustDateForTimeZone("".concat(e.date.toString()," 00:00:00.000000"),t,r)}createPartialHoliday(e,t,r){var i=e.date.toString(),a=["00:00"];e.businessPeriods.forEach(v=>{a.push(v.open),a.push(v.close)}),a.push("24:00");for(var o=[],s=0;s<a.length;s+=2){var l=a[s],u=a[s+1];if(l!==u){var d=[this.adjustDateForTimeZone("".concat(i," ").concat(l,":00.000000"),t,r)],f=qv*(I.periodToDecimal(u)-I.periodToDecimal(l));o.push({values:d,dvalue:f})}}return o}adjustDateForTimeZone(e,t,r){return r&&r.standardOffset!==t.standardOffset?this.unwrapValue(this.wrapValue(e,Wi,t),r):e}makeFigureSettings(e,t){var{dh:r}=this,{series:i,xAxis:a,type:o}=e,s=I.titleFromSettings(e),l={formatType:"".concat(r.plot.AxisFormatType.NUMBER),type:"".concat(r.plot.AxisType.X),position:"".concat(r.plot.AxisPosition.BOTTOM)},u={formatType:"".concat(r.plot.AxisFormatType.NUMBER),type:"".concat(r.plot.AxisType.Y),position:"".concat(r.plot.AxisPosition.LEFT)};return{charts:[{chartType:"".concat(r.plot.ChartType.XY),axes:[l,u],series:(i??[]).map(d=>({plotStyle:"".concat(o),name:d,dataSources:[{type:"".concat(r.plot.SourceType.X),columnName:a??"",axis:l,table:t},{type:"".concat(r.plot.SourceType.Y),columnName:d,axis:u,table:t}]}))}],title:s}}unwrapValue(e,t){var{dh:r}=this;if(e!=null){if(Jv(e))return r.i18n.DateTimeFormat.format(I.DATE_FORMAT,e,t);if(Qv(e))return e.asNumber()}return e}wrapValue(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,{dh:i}=this;if(_t.isDateType(t)&&typeof e=="string"){var a=e,o=I.DATE_FORMAT.substr(0,e.length),s=i.i18n.DateTimeFormat.parse(o,a);if(!r)return s;var l="".concat(o," Z"),u=i.i18n.DateTimeFormat.format("Z",s,r),d=i.i18n.DateTimeFormat.parse(l,"".concat(a," ").concat(u)),f=i.i18n.DateTimeFormat.format("Z",d,r);return i.i18n.DateTimeFormat.parse(l,"".concat(a," ").concat(f))}return e}makeLayoutAxis(e,t){var{dh:r}=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===r.plot.AxisType.X?Object.assign(i,{showgrid:!0}):e===r.plot.AxisType.Y&&Object.assign(i,{zerolinecolor:t.zerolinecolor,zerolinewidth:2}),i}makeDefaultLayout(e){var{dh:t}=this,{paper_bgcolor:r,plot_bgcolor:i,title_color:a,coastline_color:o,land_color:s,ocean_color:l,lake_color:u,river_color:d}=e,f={paper_bgcolor:r,plot_bgcolor:i,autosize:!0,colorway:I.getColorwayFromTheme(e),font:{family:"'Fira Sans', sans-serif",color:a},title:{font:{color:a},yanchor:"top",pad:Rt({},I.DEFAULT_TITLE_PADDING),y:1},legend:{font:{color:a}},margin:Rt({},I.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:r,coastlinecolor:o,landcolor:s,oceancolor:l,lakecolor:u,rivercolor:d}};return f.datarevision=0,f}hydrateSettings(e){var{dh:t}=this;return Rt(Rt({},e),{},{type:e.type!=null?t.plot.SeriesPlotStyle[e.type]:void 0})}}oe(I,"DEFAULT_AXIS_SIZE",.15);oe(I,"MIN_AXIS_SIZE",.025);oe(I,"MAX_AXIS_SIZE",.2);oe(I,"AXIS_SIZE_PX",75);oe(I,"LEGEND_WIDTH_PX",50);oe(I,"MAX_LEGEND_SIZE",.25);oe(I,"ORIENTATION",Object.freeze({HORIZONTAL:"h",VERTICAL:"v"}));oe(I,"DATE_FORMAT","yyyy-MM-dd HH:mm:ss.SSSSSS");oe(I,"DEFAULT_MARGIN",Object.freeze({l:60,r:50,t:30,b:60,pad:0}));oe(I,"DEFAULT_TITLE_PADDING",Object.freeze({t:8}));oe(I,"SUBTITLE_LINE_HEIGHT",25);oe(I,"DEFAULT_MARKER_SIZE",6);oe(I,"MODE_MARKERS","markers");oe(I,"MODE_LINES","lines");const le=I;function tm(n,e,t){return e=nm(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function nm(n){var e=rm(n,"string");return typeof e=="symbol"?e:String(e)}function rm(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class Cs extends Error{constructor(){super(...arguments),tm(this,"isDownsamplingError",!0)}}function Hi(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function zi(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Hi(Object(t),!0).forEach(function(r){se(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Hi(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function se(n,e,t){return e=im(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function im(n){var e=am(n,"string");return typeof e=="symbol"?e:String(e)}function am(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var ke=H.module("Chart");class Ge extends c.Component{static convertIcon(e){var[t,,,,r]=e.icon,i="".concat(r);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),se(this,"currentSeries",void 0),se(this,"PlotComponent",void 0),se(this,"plot",void 0),se(this,"plotWrapper",void 0),se(this,"columnFormats",void 0),se(this,"dateTimeFormatterOptions",void 0),se(this,"decimalFormatOptions",void 0),se(this,"integerFormatOptions",void 0),se(this,"rect",void 0),se(this,"ranges",void 0),se(this,"isSubscribed",void 0),se(this,"isLoadedFired",void 0),se(this,"resizeObserver",void 0),se(this,"getCachedConfig",Dn((r,i,a,o,s,l)=>{var u=[],d=!!r;d&&u.push({name:"Downsampling failed: ".concat(r),title:"Downsampling failed",click:()=>{this.toggleErrorMessage("".concat(r))},icon:Ge.convertIcon(Xr),attr:"fill-warning"});var f=!!l;if(f&&u.push({name:"Error: ".concat(l),title:"Error",click:()=>{this.toggleErrorMessage("".concat(l))},icon:Ge.convertIcon(Xr),attr:"fill-warning"}),i||a||o||d){var v=Ge.downsampleButtonTitle(a,o),m=Ge.downsampleButtonAttr(a,o),p=a?du:cu;u.push({name:v,title:"Downsampling status",icon:Ge.convertIcon(p),click:this.handleDownsampleClick,attr:m})}var g=s.some(w=>{var{type:T}=w;return T!=null&&!T.includes("3d")}),b=s.some(w=>{var{type:T}=w;return T!=null&&T.includes("3d")}),_=["zoomIn2d","zoomOut2d","autoScale2d","resetScale2d"],S=["orbitRotation","tableRotation","resetCameraDefault3d"];return{displaylogo:!1,displayModeBar:a||d||f?!0:"hover",modeBarButtons:[u,["toImage"],["zoom2d","pan2d"],[...g?_:[],...b?S:[]]]}})),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=Es(e.Plotly),this.plot=q.createRef(),this.plotWrapper=(t=e.containerRef)!==null&&t!==void 0?t:q.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:r,settings:i}=this.props;this.updateFormatterSettings(i),r!==e.model&&(this.unsubscribe(e.model),this.subscribe(r)),t!==e.isActive&&(t?(this.updateDimensions(),this.subscribe(r)):this.unsubscribe(r))}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:zi(zi({},t),e.getLayout())})}subscribe(e){if(!this.isSubscribed){if(!this.rect||this.rect.width===0||this.rect.height===0){ke.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:r}=e;switch(ke.debug2("Received data update",t,r),t){case be.EVENT_UPDATED:{this.currentSeries+=1,this.setState(m=>{var{layout:p,revision:g}=m;return typeof p.datarevision=="number"&&(p.datarevision+=1),{data:r,layout:p,revision:g+1}});var{onUpdate:i}=this.props;i({isLoading:!this.isLoadedFired});break}case be.EVENT_LOADFINISHED:{var{onUpdate:a}=this.props;this.isLoadedFired=!0,a({isLoading:!1});break}case be.EVENT_DISCONNECT:{var{onDisconnect:o}=this.props;o();break}case be.EVENT_RECONNECT:{var{onReconnect:s}=this.props;s();break}case be.EVENT_DOWNSAMPLESTARTED:{this.setState({isDownsampleFinished:!1,isDownsampleInProgress:!0,downsamplingError:null});break}case be.EVENT_DOWNSAMPLEFINISHED:{this.setState({isDownsampleFinished:!0,isDownsampleInProgress:!1,downsamplingError:null});break}case be.EVENT_DOWNSAMPLENEEDED:case be.EVENT_DOWNSAMPLEFAILED:{var l,u=(l=r.message)!==null&&l!==void 0?l:r;this.setState({isDownsampleFinished:!1,isDownsampleInProgress:!1,isDownsamplingDisabled:!1,downsamplingError:u});var{onError:d}=this.props;d(new Cs(u));break}case be.EVENT_ERROR:{var f="".concat(r);this.setState({error:f});var{onError:v}=this.props;v(new Error(f));break}default:ke.debug("Unknown event type",t,e)}}handlePlotUpdate(e){var{layout:t}=e,r=le.getLayoutRanges(t),i=!He(r,this.ranges);i&&(this.ranges=r,this.updateModelDimensions(!0))}handleRelayout(e){if(ke.debug("handleRelayout",e),e.hiddenlabels!=null){var{onSettingsChanged:t}=this.props,r=[...e.hiddenlabels];t({hiddenSeries:r})}this.updateModelDimensions()}handleResize(){this.updateDimensions()}handleRestyle(e){var[t,r]=e;if(ke.debug("handleRestyle",t,r),Object.keys(t).includes("visible")){var{data:i}=this.state,{onSettingsChanged:a}=this.props;if(i!=null){var o=i.reduce((s,l)=>{var{name:u,visible:d}=l;return u!=null&&d==="legendonly"?[...s,u]:s},[]);a({hiddenSeries:o})}}}toggleErrorMessage(e){this.setState(t=>{var{shownError:r}=t;return{shownError:r===e?null:e}})}updateModelDimensions(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,t=this.getPlotRect();if(!t){ke.warn("Unable to get plotting rect");return}var r=!this.rect||this.rect.width!==t.width||this.rect.height!==t.height;if(r||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=lt.getColumnFormats(e),r=lt.getDateTimeFormatterOptions(e),{decimalFormatOptions:i={},integerFormatOptions:a={}}=e;(!He(this.columnFormats,t)||!He(this.dateTimeFormatterOptions,r)||!He(this.decimalFormatOptions,i)||!He(this.integerFormatOptions,a))&&(this.columnFormats=lt.getColumnFormats(e),this.dateTimeFormatterOptions=r,this.decimalFormatOptions=i,this.integerFormatOptions=a,this.updateFormatter())}updateFormatter(){var{model:e}=this.props,t=new on(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(r=>{ke.debug("Unable to resize, promise rejected",r)})}render(){var{PlotComponent:e}=this,{data:t,downsamplingError:r,isDownsampleFinished:i,isDownsampleInProgress:a,isDownsamplingDisabled:o,error:s,shownError:l,layout:u,revision:d}=this.state,f=this.getCachedConfig(r,i,a,o,t??[],s),v=t!=null;return h.jsxs("div",{className:"h-100 w-100 chart-wrapper",ref:this.plotWrapper,children:[v&&h.jsx(e,{ref:this.plot,data:t,layout:u,revision:d,config:f,onAfterPlot:this.handleAfterPlot,onError:ke.error,onRelayout:this.handleRelayout,onUpdate:this.handlePlotUpdate,onRestyle:this.handleRestyle,useResizeHandler:!0,style:{height:"100%",width:"100%"}}),h.jsx(an,{className:"chart-error-popper",options:{placement:"top"},isShown:l!=null,onExited:this.handleErrorClose,closeOnBlur:!0,interactive:!0,children:l!=null&&h.jsxs(h.Fragment,{children:[h.jsx("div",{className:"chart-error",children:l}),h.jsx(Ha,{tooltip:"Copy Error",copy:l,children:"Copy Error"})]})})]})}}se(Ge,"defaultProps",{isActive:!0,settings:{timeZone:"America/New_York",defaultDateTimeFormat:Ka.FULL_DATE_FORMAT,showTimeZone:!1,showTSeparator:!0,formatter:[]},Plotly:fr,onDisconnect:()=>{},onReconnect:()=>{},onUpdate:()=>{},onError:()=>{},onSettingsChanged:()=>{}});const om=Ge;function Gi(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function Ki(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Gi(Object(t),!0).forEach(function(r){J(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Gi(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function J(n,e,t){return e=sm(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function sm(n){var e=lm(n,"string");return typeof e=="symbol"?e:String(e)}function lm(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var re=H.module("FigureChartModel");class vn extends be{constructor(e,t,r){var i,a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};super(e),i=this,J(this,"chartUtils",void 0),J(this,"dh",void 0),J(this,"figure",void 0),J(this,"settings",void 0),J(this,"theme",void 0),J(this,"data",void 0),J(this,"layout",void 0),J(this,"seriesDataMap",void 0),J(this,"pendingSeries",void 0),J(this,"oneClicks",void 0),J(this,"filterColumnMap",void 0),J(this,"lastFilter",void 0),J(this,"isConnected",void 0),J(this,"seriesToProcess",void 0),J(this,"addPendingSeries",qe(()=>{for(var s=le.getAxisTypeMap(this.figure),{pendingSeries:l}=this,u=function(){var v,m=l[d],p=i.figure.charts.find(g=>g.series.includes(m));i.addSeries(m,s,(v=p==null?void 0:p.showLegend)!==null&&v!==void 0?v:null),m.subscribe()},d=0;d<l.length;d+=1)u();this.pendingSeries=[]},vn.ADD_SERIES_DEBOUNCE)),J(this,"getTimeZone",it((s,l)=>{if(l!=null){var u=l.getColumnTypeFormatter(s);if(u!=null)return u.dhTimeZone}})),J(this,"getValueTranslator",it((s,l)=>{var u=this.getTimeZone(s,l);return d=>this.chartUtils.unwrapValue(d,u)})),J(this,"getValueParser",it((s,l)=>{var u=this.getTimeZone(s,l);return d=>this.chartUtils.wrapValue(d,s,u)})),J(this,"getRangeParser",it((s,l)=>u=>{var[d,f]=u,v=this.getValueParser(s,l);return d=v(d),f=v(f),[d,f]})),J(this,"getAxisRangeParser",it((s,l)=>u=>{var d=le.getSourceForAxis(s,u);return d!=null?this.getRangeParser(d.columnType,l):f=>f})),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 le(e),this.figure=t,this.settings=a,this.theme=r,this.data=[];var o={data:{},layout:this.chartUtils.makeDefaultLayout(r)};this.layout={grid:{rows:t.rows,columns:t.cols,pattern:"independent"},template:o},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();for(var{charts:t}=this.figure,r=le.getAxisTypeMap(this.figure),i=[],a=function(){for(var v=t[o],m=0;m<v.series.length;m+=1){var p=v.series[m];i.push(p.name),e.addSeries(p,r,v.showLegend)}var{axes:g,title:b}=v;if(b!=null&&b.length>0&&(t.length>1||e.figure.title!=null)){var _=g.find(F=>F.type===e.dh.plot.AxisType.X),S=g.find(F=>F.type===e.dh.plot.AxisType.Y);if(_==null||S==null)re.warn("Chart title provided, but unknown how to map to the correct axes for this chart type",v);else{var w,T,y,O,M=((w=(T=r.get(_.type))===null||T===void 0?void 0:T.findIndex(F=>F===_))!==null&&w!==void 0?w:0)+1,A=((y=(O=r.get(S.type))===null||O===void 0?void 0:O.findIndex(F=>F===S))!==null&&y!==void 0?y:0)+1,j={align:"center",x:.5,y:1,yshift:17,text:b,showarrow:!1,xref:"x".concat(M," domain"),yref:"y".concat(A," domain")};e.layout.annotations==null?e.layout.annotations=[j]:e.layout.annotations.push(j)}}},o=0;o<t.length;o+=1)a();for(var s=[...this.seriesDataMap.keys()],l=s.filter(f=>i.indexOf(f)<0),u=0;u<l.length;u+=1){var d=l[u];this.seriesDataMap.delete(d)}this.seriesToProcess=new Set([...this.seriesDataMap.keys()])}addSeries(e,t,r){var{dh:i}=this,a=this.chartUtils.makeSeriesDataFromSeries(e,t,le.getSeriesVisibility(e.name,this.settings),this.theme,r);if(this.seriesDataMap.set(e.name,a),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=le.getHiddenLabels(this.settings)),this.layout.showlegend=this.data.length>1||e.plotStyle===i.plot.SeriesPlotStyle.PIE?r??void 0:!1,e.oneClick!=null){for(var{oneClick:o}=e,{columns:s}=o,l=0;l<s.length;l+=1)this.filterColumnMap.set(s[l].name,s[l]);this.oneClicks.push(o)}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){re.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&&(re.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){re.debug("Downsample started",e),this.fireDownsampleStart(e.detail)}handleDownsampleFinish(e){re.debug("Downsample finished",e),this.fireDownsampleFinish(e.detail)}handleDownsampleFail(e){re.error("Downsample failed",e),this.fireDownsampleFail(e.detail)}handleDownsampleNeeded(e){re.info("Downsample needed",e),this.fireDownsampleNeeded(e.detail)}handleFigureUpdated(e){var{detail:t}=e,{series:r}=t;re.debug2("handleFigureUpdated",r);for(var i=0;i<r.length;i+=1){var a=r[i];re.debug2("handleFigureUpdated updating series",a.name);for(var{sources:o}=a,s=0;s<o.length;s+=1){var l=o[s],{columnType:u,type:d}=l,f=this.getValueTranslator(u,this.formatter),v=t.getArray(a,d,f);this.setDataArrayForSeries(a,d,v)}this.seriesToProcess.delete(a.name),this.cleanSeries(a)}this.seriesToProcess.size===0&&this.fireLoadFinished();var{data:m}=this;this.fireUpdate(m)}handleRequestFailed(e){re.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){re.debug("Figure disconnected",e),this.isConnected=!1,this.listeners.length>0&&this.unsubscribeFigure(),this.fireDisconnect()}handleFigureReconnected(e){re.debug("Figure reconnected",e),this.isConnected=!0,this.initAllSeries(),this.fireReconnect(),this.listeners.length>0&&this.subscribeFigure()}handleFigureSeriesAdded(e){var{detail:t}=e;re.debug("handleFigureSeriesAdded",t),this.pendingSeries.push(t),this.addPendingSeries()}setDimensions(e){super.setDimensions(e),this.updateAxisPositions()}setTitle(e){var t,r;super.setTitle(e);var i=(t=(r=(e??"").match(/<br>/g))===null||r===void 0?void 0:r.length)!==null&&t!==void 0?t:0,a=le.DEFAULT_MARGIN.t+i*le.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=Ki({},this.layout.title),this.layout.title.text=e,this.layout.title.pad=Ki({},this.layout.title.pad),this.layout.title.pad.t=le.DEFAULT_TITLE_PADDING.t+i*le.SUBTITLE_LINE_HEIGHT*.5)}getPlotWidth(){var e,t,r,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)-((r=(i=this.layout.margin)===null||i===void 0?void 0:i.r)!==null&&r!==void 0?r:0),0)}getPlotHeight(){var e,t,r,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)-((r=(i=this.layout.margin)===null||i===void 0?void 0:i.b)!==null&&r!==void 0?r:0),0)}updateAxisPositions(){var e=this.getPlotWidth(),t=this.getPlotHeight();this.chartUtils.updateFigureAxes(this.layout,this.figure,this.theme,r=>this.getAxisRangeParser(r,this.formatter),e,t)}updateLayoutFormats(){if(this.formatter){var e=this.chartUtils.getAxisFormats(this.figure,this.formatter);e.forEach((t,r)=>{re.debug("Assigning ".concat(r),this.layout[r],t);var i=this.layout[r];i!=null?Object.assign(i,t):re.debug("Ignoring null layout.".concat(r))})}}setDataArrayForSeries(e,t,r){var{name:i,plotStyle:a}=e,o=this.seriesDataMap.get(i),s=this.chartUtils.getPlotlyProperty(a,t);o&&xa(o,s,r)}cleanSeries(e){var{dh:t}=this,{name:r,plotStyle:i}=e,a=this.seriesDataMap.get(r);if(a!=null){if(i===t.plot.SeriesPlotStyle.HISTOGRAM){var{xLow:o,xHigh:s}=a;if(o&&s&&o.length===s.length){for(var l=[],u=0;u<o.length;u+=1)l.push(s[u]-o[u]);a.width=l}}else if(i===t.plot.SeriesPlotStyle.LINE||i===t.plot.SeriesPlotStyle.ERROR_BAR||i===t.plot.SeriesPlotStyle.BAR){var{x:d,xLow:f,xHigh:v,y:m,yLow:p,yHigh:g}=a;f&&v&&f!==d&&(a.error_x=le.getPlotlyErrorBars(d,f,v,this.theme)),p&&g&&p!==m&&(a.error_y=le.getPlotlyErrorBars(m,p,g,this.theme))}else if(i===t.plot.SeriesPlotStyle.TREEMAP){var{ids:b,labels:_}=a;b!==void 0&&_===void 0&&(a.labels=b)}}}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){re.warn("Trying to set a filter, but no one click!");return}re.debug("setFilter",e);for(var r=function(){var o=t.oneClicks[i],{columns:s}=o,l=new Set([...e.keys(),...t.lastFilter.keys()]);l.forEach(u=>{var d=e.get(u);t.lastFilter.get(u)!==d&&s.find(f=>f.name===u)!=null&&o.setValueForColumn(u,d)})},i=0;i<this.oneClicks.length;i+=1)r();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}}J(vn,"ADD_SERIES_DEBOUNCE",50);const zn=vn;function Xi(n,e,t,r,i,a,o){try{var s=n[a](o),l=s.value}catch(u){t(u);return}s.done?e(l):Promise.resolve(l).then(r,i)}function Pn(n){return function(){var e=this,t=arguments;return new Promise(function(r,i){var a=n.apply(e,t);function o(l){Xi(a,r,i,o,s,"next",l)}function s(l){Xi(a,r,i,o,s,"throw",l)}o(void 0)})}}class xr{static makeModelFromSettings(e,t,r,i){return Pn(function*(){var a=yield xr.makeFigureFromSettings(e,t,r);return new zn(e,a,i,t)})()}static makeFigureFromSettings(e,t,r){return Pn(function*(){var i=yield r.copy();return i.applyCustomColumns(r.customColumns),i.applyFilter(r.filter),i.applySort(r.sort),e.plot.Figure.create(new le(e).makeFigureSettings(t,i))})()}static makeModel(e,t,r,i){return Pn(function*(){return new zn(e,r,i,t)})()}}const um=xr,dm="var(--dh-color-chart-colorway)",cm="var(--dh-color-chart-grid)",hm="var(--dh-color-chart-axis-line)",fm="var(--dh-color-chart-axis-line-zero)",Yi={"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-color)",colorway:dm,gridcolor:cm,linecolor:hm,zerolinecolor:fm,"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 qi=H.module("ChartTheme");function Ar(){var n,e=or(Yi);return e.colorway=Ra((n=e.colorway)!==null&&n!==void 0?n:"").map(t=>{var[r,i]=t;return hu.normalizeCssColor(e.colorway.substring(r,i+1))}).join(" "),qi.debug2("Chart theme:",Yi),qi.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 ct(n,e,t){return e=vm(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function vm(n){var e=mm(n,"string");return typeof e=="symbol"?e:String(e)}function mm(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class Z extends be{static get theme(){return Z._theme==null&&(Z._theme=Ar()),Z._theme}static makeRandomSeries(e){for(var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:100,i=[],a=[],o=[],s=[],l=new Date("2018-06-01"),u=0;u<r;u+=1){var d=new Date(l.getFullYear(),l.getMonth(),l.getDate()+u-r);i.push("".concat(d.getFullYear(),"-").concat(d.getMonth()+1,"-").concat(d.getDate()));var f=(Math.sin(u/r*e)*r/3+Math.cos(u*.2)*r/6+Math.sin(u*.5)*r/10+Z.random()*r/5+u*Z.smoothing)*t;f=Math.round(f*100)/100,a.push(f),s.push(40+u*Z.smoothing),o.push(Math.sin(u/r*e)*r/3+Z.random()*r/10+u*Z.smoothing)}return{x:i,y:a,s:o,l:s}}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=[],r=[],i=0;i<e.y.length;i+=1){var a=e.y[i];t[i]=Math.round((a+18)*100)/100,r[i]=Math.round((a-18)*100)/100}var o=t.concat(r.reverse());return{name:"error",x:e.x.concat(e.x.slice().reverse()),y:o,type:"scatter",mode:"line",hoverinfo:"skip",fill:"toself",line:{width:0,color:Z.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=Z.makeRandomSeries(6),t=Z.makeArea(e),r=Z.makeTrendline(e),i=Z.makeRandomSeries(2),a=Z.makeLine(i),o=Z.makeErrorBand(i);return[t,r,a,o]}static makeDefaultLayout(e){var t=new le(e).makeDefaultLayout(Z.theme);return t.title="Chart",t.xaxis&&(t.xaxis.title="Datestamp"),t.yaxis&&(t.yaxis.title="Price"),t}constructor(e){var{data:t=Z.makeRandomData(),layout:r=Z.makeDefaultLayout(e),filterFields:i=[]}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};super(e),ct(this,"data",void 0),ct(this,"filterFields",void 0),ct(this,"layout",void 0),this.data=t,this.layout=r,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 r=this.filterFields[t],i="java.lang.String";e.set(r,{name:r,type:i})}return e}isFilterRequired(){return this.filterFields.length>0}setFilter(){this.fireUpdate(this.data)}}ct(Z,"random",Math.random.bind(Math));ct(Z,"smoothing",1.5);ct(Z,"_theme",void 0);const pm=Z,gm=Es(fr);var Mr=c.createContext(null);function Ps(n){var{children:e}=n,{activeThemes:t}=Tt(),r=c.useMemo(Ar,[t]);return h.jsx(Mr.Provider,{value:r,children:e})}function bm(n){return n.setFigure!==void 0}function ym(){return Pt(Mr,"No ChartThemeContext value found.")}const _m=Object.freeze(Object.defineProperty({__proto__:null,Chart:om,ChartModel:be,ChartModelFactory:um,ChartThemeContext:Mr,ChartThemeProvider:Ps,ChartUtils:le,DownsamplingError:Cs,FigureChartModel:zn,MockChartModel:pm,Plot:gm,defaultChartTheme:Ar,isFigureChartModel:bm,useChartTheme:ym},Symbol.toStringTag,{value:"Module"}));var Ts=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 Os(n){return n.componentName!==void 0}function wm(n){return n.component!==void 0}var Is=Object.freeze({type:"default",isClosable:!0,isFocusOnShow:!0,reorderEnabled:!0,title:""});const Sm=Object.freeze(Object.defineProperty({__proto__:null,defaultConfig:Ts,isGLComponentConfig:Os,isReactComponentConfig:wm,itemDefaultConfig:Is},Symbol.toStringTag,{value:"Module"}));function Ht(n,e,t){return e=Em(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Em(n){var e=Cm(n,"string");return typeof e=="symbol"?e:String(e)}function Cm(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class St{constructor(){Ht(this,"_mSubscriptions",void 0),Ht(this,"off",this.unbind),Ht(this,"trigger",this.emit),this._mSubscriptions={},this._mSubscriptions[St.ALL_EVENT]=[]}on(e,t,r){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:r})}emit(e){for(var t=this._mSubscriptions[e],r=arguments.length,i=new Array(r>1?r-1:0),a=1;a<r;a++)i[a-1]=arguments[a];if(t)for(var o=0;o<t.length;o++){var s=t[o].ctx||{};try{t[o].fn.apply(s,i)}catch(f){console.error("Error while emitting event:",f)}}i.unshift(e);for(var l=this._mSubscriptions[St.ALL_EVENT],u=0;u<l.length;u++){var d=l[u].ctx||{};try{l[u].fn.apply(d,i)}catch(f){console.error("Error while emitting event to allEventSubs:",f)}}}unbind(e,t,r){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)&&(!r||r===this._mSubscriptions[e][a].ctx)&&(this._mSubscriptions[e].splice(a,1),i=!0);if(i===!1)throw new Error("Nothing to unbind for "+e)}}Ht(St,"ALL_EVENT","__all");const Ee=St;function we(n,e,t){return e=Pm(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Pm(n){var e=Tm(n,"string");return typeof e=="symbol"?e:String(e)}function Tm(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class Gn extends Ee{constructor(e,t,r){super(),we(this,"width",void 0),we(this,"height",void 0),we(this,"title",void 0),we(this,"parent",void 0),we(this,"layoutManager",void 0),we(this,"tab",void 0),we(this,"_config",void 0),we(this,"isHidden",!1),we(this,"beforeCloseHandler",void 0),we(this,"_element",L(['<div class="lm_item_container">','<div class="lm_content" tabindex="-1"></div>',"</div>"].join(""))),we(this,"_contentElement",void 0),this.title=Os(e)?e.componentName:"",this.parent=t,this.layoutManager=r,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 r,i,a,o=this.parent,s=null;o&&!o.isColumn&&!o.isRow;){var l;if(s=o,o=o.parent,(l=o)!==null&&l!==void 0&&l.isRoot)return!1}if(!o||!s)return!1;for(var u=o.isColumn?"height":"width",d=u==="height"?t:e,f=((r=this[u])!==null&&r!==void 0?r:0)*(1/(((i=s.config[u])!==null&&i!==void 0?i:0)/100)),v=d/f*100,m=(((a=s.config[u])!==null&&a!==void 0?a:0)-v)/(o.contentItems.length-1),p=0;p<o.contentItems.length;p++)if(o.contentItems[p]===s)o.contentItems[p].config[u]=v;else{var g;o.contentItems[p].config[u]=((g=o.contentItems[p].config[u])!==null&&g!==void 0?g:0)+m}return o.callDownwards("setSize"),!0}close(e){var t,r;this._config.isClosable&&(!((t=(r=this.beforeCloseHandler)===null||r===void 0?void 0:r.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(L.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 r=this._contentElement[0],i=r.offsetWidth-r.clientWidth,a=r.offsetHeight-r.clientHeight;this._contentElement.width(this.width-i).height(this.height-a),this.emit("resize")}}}const Om=Object.freeze(Object.defineProperty({__proto__:null,Container:Gn,ItemContainer:Gn},Symbol.toStringTag,{value:"Module"}));function Ds(n){var e=location.hash.match(new RegExp(n+"=([^&]*)"));return e?e[1]:null}function xs(n){if(window.location.hash)return Ds(n);if(!window.location.search)return null;var e=window.location.search.substr(1).split("&"),t={},r,i;for(i=0;i<e.length;i++)r=e[i].split("="),t[r[0]]=r[1];return t[n]||null}function Nr(n){return window.requestAnimationFrame(n)}function Im(n,e){var t=e.indexOf(n);if(t===-1)throw new Error("Can't remove item from array. Item is not in the array");e.splice(t,1)}function Lr(){return(Math.random()*1e15).toString(36).replace(".","")}function Dm(n,e){var t=n.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 jr(n){return L.trim(n.replace(/(<([^>]+)>)/gi,""))}function he(n,e,t){return e=xm(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function xm(n){var e=Am(n,"string");return typeof e=="symbol"?e:String(e)}function Am(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class Mm extends Ee{constructor(e){var t,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;super(),he(this,"_eElement",void 0),he(this,"_oDocument",void 0),he(this,"_eBody",void 0),he(this,"_destroyAfterMouseUp",void 0),he(this,"_nDelay",400),he(this,"_timeout",void 0),he(this,"timeout",void 0),he(this,"_nDistance",10),he(this,"_nX",0),he(this,"_nY",0),he(this,"_nOriginalX",0),he(this,"_nOriginalY",0),he(this,"_bDragging",!1),this._eElement=e,this._oDocument=L(document),this._eBody=L(document.body),this._destroyAfterMouseUp=r,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,r,i,a,o=this._getCoordinates(e);this._nOriginalX=(t=o.x)!==null&&t!==void 0?t:0,this._nOriginalY=(r=o.y)!==null&&r!==void 0?r: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,r;e.preventDefault();var i=this._getCoordinates(e);this._nX=((t=i.x)!==null&&t!==void 0?t:0)-this._nOriginalX,this._nY=((r=i.y)!==null&&r!==void 0?r: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,r,i,a,o;if(clearTimeout(this._timeout),(t=this._oDocument)===null||t===void 0||t.unbind("mousemove",this.onMouseMove),(r=this._oDocument)===null||r===void 0||r.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)),(o=this._eBody)===null||o===void 0||o.removeClass("lm_dragging"),!(this._eElement instanceof Window)){var s;(s=this._eElement)===null||s===void 0||s.removeClass("lm_dragging")}this._destroyAfterMouseUp&&this.destroy()}}_startDrag(){var e,t,r,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"),(r=this._oDocument)===null||r===void 0||(i=r.find("iframe"))===null||i===void 0||i.css("pointer-events","none"),this.emit("dragStart",this._nOriginalX,this._nOriginalY)}_getCoordinates(e){var t,r;return{x:(t=e.pageX)!==null&&t!==void 0?t:0,y:(r=e.pageY)!==null&&r!==void 0?r:0}}}const Dt=Mm;function tt(n,e,t){return e=Nm(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Nm(n){var e=Lm(n,"string");return typeof e=="symbol"?e:String(e)}function Lm(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class As{constructor(e,t){tt(this,"_container",void 0),tt(this,"_reactComponent",null),tt(this,"_portalComponent",null),tt(this,"_originalComponentWillUpdate",null),tt(this,"_initialState",void 0),tt(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=Aa.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 r;this._container.setState(t),(r=this._originalComponentWillUpdate)===null||r===void 0||r.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=L.extend(e,this._container._config.props);return q.createElement(this._reactClass,t)}}var Jt=["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"],jm=[!0,!1,"row","column","stack","component","close","maximise","minimise","open in new window"];function Fr(n){if(Jt.length>36)throw new Error("Too many keys in config minifier map");var e={};return Rr(n,e,"_min"),e}function Kn(n){if(Jt.length>36)throw new Error("Too many keys in config minifier map");var e={};return Rr(n,e,"_max"),e}function Rr(n,e,t){var r=t==="_min"?Fm:Rm;for(var i in n)if(n.hasOwnProperty(i)){var a=Array.isArray(n)?n[Number.parseInt(i,10)]:n[i];if(typeof a=="object"&&a!=null){var o=a instanceof Array?[]:{};if(Array.isArray(e))e[Number.parseInt(i,10)]=o;else{var s=r(i,Jt);e[s]=o}Rr(a,o,t)}else{var l=r(a,jm);if(Array.isArray(e))e[Number.parseInt(i,10)]=l;else{var u=r(i,Jt);e[u]=l}}}}function Fm(n,e){if(typeof n=="string"&&n.length===1)return"___"+n;var t=e.indexOf(n);return t===-1?n:t.toString(36)}function Rm(n,e){return typeof n=="string"&&n.length===1?e[parseInt(n,36)]:typeof n=="string"&&n.substr(0,3)==="___"?n[3]:n}function Tn(n,e,t){return e=km(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function km(n){var e=$m(n,"string");return typeof e=="symbol"?e:String(e)}function $m(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class Xn{constructor(e,t){Tn(this,"name",void 0),Tn(this,"origin",void 0),Tn(this,"isPropagationStopped",void 0),this.name=e,this.origin=t,this.isPropagationStopped=!1}stopPropagation(){this.isPropagationStopped=!0}}function kt(n,e,t){return e=Bm(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Bm(n){var e=Um(n,"string");return typeof e=="symbol"?e:String(e)}function Um(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}let Wm=class extends Ee{constructor(e){super(),kt(this,"_layoutManager",void 0),kt(this,"_dontPropagateToParent",void 0),kt(this,"_childEventSource",void 0),kt(this,"_boundOnEventFromChild",void 0),this._layoutManager=e,this._dontPropagateToParent=null,this._childEventSource=null,this.on(Ee.ALL_EVENT,this._onEventFromThis.bind(this)),this._boundOnEventFromChild=this._onEventFromChild.bind(this),L(window).on("gl_child_event",this._boundOnEventFromChild)}_onEventFromThis(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];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,r="gl_child_event",i=(t=window.opener)===null||t===void 0?void 0:t.document.createEvent("HTMLEvents");i.initEvent(r,!0,!0),i.eventName=r,i.__glArgs=e,i.__gl=this._layoutManager,window.opener.dispatchEvent(i)}_propagateToChildren(e){for(var t=0;t<this._layoutManager.openPopouts.length;t++){var r=this._layoutManager.openPopouts[t].getGlInstance();r&&r!==this._childEventSource&&r.eventHub._$onEventFromParent(e)}}destroy(){L(window).off("gl_child_event",this._boundOnEventFromChild)}};const Ms=Wm,Vm=Object.freeze(Object.defineProperty({__proto__:null,BubblingEvent:Xn,DragListener:Dt,EventEmitter:Ee,EventHub:Ms,ReactComponentHandler:As,animFrame:Nr,filterXss:Dm,getHashValue:Ds,getQueryStringParam:xs,getUniqueId:Lr,minifyConfig:Fr,removeFromArray:Im,stripTags:jr,unminifyConfig:Kn},Symbol.toStringTag,{value:"Module"}));function $e(n,e,t){return e=Hm(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Hm(n){var e=zm(n,"string");return typeof e=="symbol"?e:String(e)}function zm(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class Ns extends Ee{constructor(e,t,r,i,a){super(),$e(this,"isInitialised",!1),$e(this,"_config",void 0),$e(this,"_dimensions",void 0),$e(this,"_parentId",void 0),$e(this,"_indexInParent",void 0),$e(this,"_layoutManager",void 0),$e(this,"_popoutWindow",null),$e(this,"_id",null),this._config=e,this._dimensions=t,this._parentId=r,this._indexInParent=i,this._layoutManager=a,this._createWindow()}toConfig(){var e,t,r,i,a,o,s,l,u,d,f;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:(r=(i=(a=this._popoutWindow)===null||a===void 0?void 0:a.screenX)!==null&&i!==void 0?i:(o=this._popoutWindow)===null||o===void 0?void 0:o.screenLeft)!==null&&r!==void 0?r:0,top:(s=(l=(u=this._popoutWindow)===null||u===void 0?void 0:u.screenY)!==null&&l!==void 0?l:(d=this._popoutWindow)===null||d===void 0?void 0:d.screenTop)!==null&&s!==void 0?s:0},content:(f=this.getGlInstance())===null||f===void 0?void 0:f.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,r=null;if(this._parentId){var i;if(t=L.extend(!0,{},(i=this.getGlInstance())===null||i===void 0?void 0:i.toConfig()).content[0],r=this._layoutManager.root.getItemsById(this._parentId)[0],!r){var a;((a=this._layoutManager.root.contentItems.length)!==null&&a!==void 0?a:0)>0?r=this._layoutManager.root.contentItems[0]:r=this._layoutManager.root}}t&&((e=r)===null||e===void 0||e.addChild(t,this._indexInParent),this.close())}_createWindow(){var e=this._createUrl(),t=Math.floor(Math.random()*1e6).toString(36),r=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,r),!this._popoutWindow)if(this._layoutManager.config.settings.blockedPopoutsThrowError===!0){var i=new Error("Popout blocked");throw i.type="popoutBlocked",i}else return;L(this._popoutWindow).on("load",this._positionWindow.bind(this)).on("unload beforeunload",this._onClose.bind(this));var a=window.setInterval(()=>{var o;(o=this._popoutWindow)!==null&&o!==void 0&&o.__glInstance&&this._popoutWindow.__glInstance.isInitialised&&(this._onInitialised(),window.clearInterval(a))},10)}_serializeWindowOptions(e){var t=[],r;for(r in e)t.push(r+"="+e[r]);return t.join(",")}_createUrl(){var e={content:this._config},t="gl-window-config-"+Lr();e=Fr(e);try{localStorage.setItem(t,JSON.stringify(e))}catch(i){throw new Error("Error while writing to localStorage "+i.toString())}var r=document.location.href.split("?");return r.length===1?r[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 ie(n,e,t){return e=Gm(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Gm(n){var e=Km(n,"string");return typeof e=="symbol"?e:String(e)}function Km(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class Qe extends Ee{constructor(e,t,r,i,a,o){var s,l,u,d,f,v,m,p;if(super(),ie(this,"_dragListener",void 0),ie(this,"_layoutManager",void 0),ie(this,"_contentItem",void 0),ie(this,"_originalParent",void 0),ie(this,"_area",null),ie(this,"_lastValidArea",null),ie(this,"_minX",void 0),ie(this,"_maxX",void 0),ie(this,"_minY",void 0),ie(this,"_maxY",void 0),ie(this,"_width",void 0),ie(this,"_height",void 0),ie(this,"_sided",void 0),ie(this,"element",void 0),ie(this,"childElementContainer",void 0),ie(this,"_proxyTab",void 0),this._dragListener=r,this._layoutManager=i,this._contentItem=a,this._originalParent=o,this._dragListener.on("drag",this._onDrag,this),this._dragListener.on("dragStop",this._onDrop,this),this._contentItem.tab&&this._contentItem.tab.element){var g,b;this._layoutManager.tabDropPlaceholder.width((g=this._contentItem.tab.element.outerWidth(!0))!==null&&g!==void 0?g:0),this._layoutManager.tabDropPlaceholder.height((b=this._contentItem.tab.element.outerHeight(!0))!==null&&b!==void 0?b:0)}if(this.element=L(Qe._template),o&&o._side&&(this._sided=o._sided,this.element.addClass("lm_"+o._side),["right","bottom"].indexOf(o._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",jr((s=this._contentItem.config.title)!==null&&s!==void 0?s:"")),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(),L(document.body).append(this.element),this._setDimensions(),!this._contentItem.tab&&this._proxyTab.length){var _,S;this._layoutManager.tabDropPlaceholder.width((_=this._proxyTab.outerWidth(!0))!==null&&_!==void 0?_:0),this._layoutManager.tabDropPlaceholder.height((S=this._proxyTab.outerHeight(!0))!==null&&S!==void 0?S:0)}var w=this._layoutManager.container.offset();this._minX=(u=w==null?void 0:w.left)!==null&&u!==void 0?u:0,this._minY=(d=w==null?void 0:w.top)!==null&&d!==void 0?d:0,this._maxX=((f=this._layoutManager.container.width())!==null&&f!==void 0?f:0)+this._minX,this._maxY=((v=this._layoutManager.container.height())!==null&&v!==void 0?v:0)+this._minY,this._width=(m=this.element.width())!==null&&m!==void 0?m:0,this._height=(p=this.element.height())!==null&&p!==void 0?p:0,this._setDropPosition(e,t),this._layoutManager.emit("itemPickedUp",this._contentItem)}_onDrag(e,t,r){var i,a,o=(i=r.pageX)!==null&&i!==void 0?i:0,s=(a=r.pageY)!==null&&a!==void 0?a:0,l=o>this._minX&&o<this._maxX&&s>this._minY&&s<this._maxY;!l&&this._layoutManager.config.settings.constrainDragToContainer===!0||this._setDropPosition(o,s)}_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,r=e.dragProxyHeight;this.element.width(t),this.element.height(r),t-=this._sided?e.headerHeight:0,r-=this._sided?0:e.headerHeight,this.childElementContainer.width(t),this.childElementContainer.height(r),this._contentItem.element.width(t),this._contentItem.element.height(r),this._contentItem.callDownwards("_$show"),this._contentItem.callDownwards("setSize")}}ie(Qe,"_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 $t(n,e,t){return e=Xm(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Xm(n){var e=Ym(n,"string");return typeof e=="symbol"?e:String(e)}function Ym(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class Ls{constructor(e,t,r){$t(this,"_element",void 0),$t(this,"_itemConfig",void 0),$t(this,"_layoutManager",void 0),$t(this,"_dragListener",void 0),this._element=e,this._itemConfig=t,this._layoutManager=r,this._dragListener=this._createDragListener()}_createDragListener(){return this._dragListener=new Dt(this._element,!0),this._dragListener.on("dragStart",this._onDragStart,this),this._dragListener.on("dragStop",this._createDragListener,this),this._dragListener}_onDragStart(e,t){var r=this._itemConfig;typeof r=="function"&&(r=r());var i=this._layoutManager._$normalizeContentItem(L.extend(!0,{},r));new Qe(e,t,this._dragListener,this._layoutManager,i,null)}}function Bt(n,e,t){return e=qm(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function qm(n){var e=Zm(n,"string");return typeof e=="symbol"?e:String(e)}function Zm(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class js{constructor(e,t,r){Bt(this,"_element",L(window)),Bt(this,"_itemConfig",void 0),Bt(this,"_layoutManager",void 0),Bt(this,"_dragListener",void 0),this._itemConfig=e,this._layoutManager=t,this._createDragListener(r)}_createDragListener(e){this._dragListener&&this._dragListener.destroy(),this._element&&(this._dragListener=new Dt(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 r=this._itemConfig;typeof r=="function"&&(r=r());var i=this._layoutManager._$normalizeContentItem(L.extend(!0,{},r));new Qe(e,t,this._dragListener,this._layoutManager,i,null)}}}function Fs(n,e,t){return e=Jm(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Jm(n){var e=Qm(n,"string");return typeof e=="symbol"?e:String(e)}function Qm(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class xt{constructor(){Fs(this,"element",L(xt._template)),L(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()}}Fs(xt,"_template",'<div class="lm_dropTargetIndicator"><div class="lm_inner"></div></div>');function On(n,e,t){return e=ep(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function ep(n){var e=tp(n,"string");return typeof e=="symbol"?e:String(e)}function tp(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class yt{constructor(e,t,r,i){On(this,"element",void 0),On(this,"_header",void 0),On(this,"_action",void 0),this._header=e,this.element=L('<li class="'+r+'" 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 np(n,e,t){return e=rp(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function rp(n){var e=ip(n,"string");return typeof e=="symbol"?e:String(e)}function ip(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class ap extends Error{constructor(e,t){super(),np(this,"node",void 0),this.name="Configuration Error",this.message=e,this.node=t}}const Xe=ap,op=Object.freeze(Object.defineProperty({__proto__:null,ConfigurationError:Xe},Symbol.toStringTag,{value:"Module"}));function ne(n,e,t){return e=sp(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function sp(n){var e=lp(n,"string");return typeof e=="symbol"?e:String(e)}function lp(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function Et(n){return n.isStack}function ye(n){return n.isComponent}function Rs(n){return n.isRoot}class ae extends Ee{constructor(e,t,r,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=r,this.layoutManager=e,this._pendingEventPropagations={},this._throttledEvents=["stateChanged"],this.on(Ee.ALL_EVENT,this._propagateEvent,this),t.content&&this._createContentItems(t)}callDownwards(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;r!==!0&&i!==!0&&this[e].apply(this,t);for(var a=0;a<this.contentItems.length;a++)this.contentItems[a].callDownwards(e,t,r);r===!0&&i!==!0&&this[e].apply(this,t)}removeChild(e){var t,r=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(r!==!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 r=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]),r===!0&&(e.parent=null,e._$destroy()),this.contentItems[i]=t,t.parent=this,Et(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=[],r=function i(a){for(var o=0;o<a.contentItems.length;o++)e(a.contentItems[o])===!0&&t.push(a.contentItems[o]),i(a.contentItems[o])};return r(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),r=[],i=0;i<t.length;i++)r.push(t[i].instance);return r}_$getItemsByProperty(e,t){return this.getItemsByFilter(function(r){return r[e]===t})}_$setParent(e){this.parent=e}_$highlightDropZone(e,t,r){var i;(i=this.layoutManager.dropTargetIndicator)===null||i===void 0||i.highlightArea(r)}_$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"),r=null,i=0;i<t.length;i++)r=t[i].getActiveContentItem(),r&&ye(r)&&r.container[e]()}_$destroy(){this.emitBubblingEvent("beforeItemDestroyed"),this.callDownwards("_$destroy",[],!0,!0),this.element.remove(),this.emitBubblingEvent("itemDestroyed")}_$getArea(e){var t,r,i;e=e||this.element;var a=(t=e.offset())!==null&&t!==void 0?t:{left:0,top:0},o=(r=e.width())!==null&&r!==void 0?r:0,s=(i=e.height())!==null&&i!==void 0?i:0;return{x1:a.left,y1:a.top,x2:a.left+o,y2:a.top+s,surface:o*s,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 Xn(e,this);this.emit(e,t)}_createContentItems(e){var t;if(!(e.content instanceof Array))throw new Xe("content must be an Array",e);for(var r=0;r<e.content.length;r++)t=this.layoutManager.createContentItem(e.content[r],this),this.contentItems.push(t)}_extendItemNode(e){for(var[t,r]of Object.entries(Is)){var i=t;e[i]===void 0&&(e[i]=r)}return e}_propagateEvent(e,t){t instanceof Xn&&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,Nr(this._propagateEventToLayoutManager.bind(this,e,t)))}_propagateEventToLayoutManager(e,t){this._pendingEventPropagations[e]=!1,this.layoutManager.emit(e,t)}}function pt(n,e,t){return e=up(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function up(n){var e=dp(n,"string");return typeof e=="symbol"?e:String(e)}function dp(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class ks extends ae{constructor(e,t,r){super(e,t,r,L()),pt(this,"config",void 0),pt(this,"componentName",void 0),pt(this,"container",void 0),pt(this,"parent",void 0),pt(this,"instance",void 0),this.config=t,this.parent=r;var i=e.getComponent(this.config.componentName)||e.getFallbackComponent(),a=L.extend(!0,{},this.config.componentState||{});if(i==null)throw new Xe('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 Gn(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(){ae.prototype._$init.call(this),this.container.emit("open")}_$hide(){this.container.hide(),ae.prototype._$hide.call(this)}_$show(){this.container.show(),this.container._config.isFocusOnShow&&this.container._contentElement[0].focus({preventScroll:!0}),ae.prototype._$show.call(this)}_$destroy(){this.container.emit("destroy",this),ae.prototype._$destroy.call(this)}_$getArea(){return null}}function pe(n,e,t){return e=cp(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function cp(n){var e=hp(n,"string");return typeof e=="symbol"?e:String(e)}function hp(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class Qt extends ae{constructor(e,t,r,i){super(t,r,i,L('<div class="lm_item lm_'+(e?"column":"row")+'"></div>')),pe(this,"isRow",void 0),pe(this,"isColumn",void 0),pe(this,"childElementContainer",void 0),pe(this,"parent",void 0),pe(this,"_splitter",[]),pe(this,"_splitterSize",void 0),pe(this,"_splitterGrabSize",void 0),pe(this,"_isColumn",void 0),pe(this,"_dimension",void 0),pe(this,"_splitterPosition",null),pe(this,"_splitterMinPosition",null),pe(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,r){var i,a,o,s;if(e=this.layoutManager._$normalizeContentItem(e,this),t===void 0&&(t=this.contentItems.length),this.contentItems.length>0?(s=this._createSplitter(Math.max(0,t-1)).element,t>0?(this.contentItems[t-1].element.after(s),s.after(e.element)):(this.contentItems[0].element.before(s),s.before(e.element))):this.childElementContainer.append(e.element),ae.prototype.addChild.call(this,e,t),i=1/this.contentItems.length*100,r===!0){this.emitBubblingEvent("stateChanged");return}for(o=0;o<this.contentItems.length;o++)if(this.contentItems[o]===e)e.config[this._dimension]=i;else{var l;a=((l=this.contentItems[o].config[this._dimension])!==null&&l!==void 0?l:0)*(100-i)/100,this.contentItems[o].config[this._dimension]=a}this.callDownwards("setSize"),this.emitBubblingEvent("stateChanged")}removeChild(e,t){var r,i=(r=e.config[this._dimension])!==null&&r!==void 0?r:0,a=this.contentItems.indexOf(e),o=Math.max(a-1,0),s,l;if(a===-1)throw new Error("Can't remove child. ContentItem is not child of this Row or Column");for(this._splitter[o]&&(this._splitter[o]._$destroy(),this._splitter.splice(o,1)),s=0;s<this.contentItems.length;s++)if(this.contentItems[s]!==e){var u;this.contentItems[s].config[this._dimension]=((u=this.contentItems[s].config[this._dimension])!==null&&u!==void 0?u:0)+i/(this.contentItems.length-1)}ae.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 r=e.config[this._dimension];super.replaceChild(e,t),t.config[this._dimension]=r,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(ae.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,r=(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,o=0,s=[];this._isColumn?a-=r:i-=r;for(var l=0;l<this.contentItems.length;l++){var u,d,f=this._isColumn?Math.floor(a*(((u=this.contentItems[l].config.height)!==null&&u!==void 0?u:0)/100)):Math.floor(i*(((d=this.contentItems[l].config.width)!==null&&d!==void 0?d:0)/100));o+=f,s.push(f)}var v=Math.floor((this._isColumn?a:i)-o);return{itemSizes:s,additionalPixel:v,totalWidth:i,totalHeight:a}}_calculateRelativeSizes(){for(var e=0,t=[],r=this._isColumn?"height":"width",i=0;i<this.contentItems.length;i++){var a=this.contentItems[i].config[r];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 o=0;o<t.length;o++)t[o].config[r]=(100-e)/t.length;this._respectMinItemWidth();return}if(Math.round(e)>100)for(var s=0;s<t.length;s++)t[s].config[r]=50,e+=50;for(var l=0;l<this.contentItems.length;l++){var u;this.contentItems[l].config[r]=((u=this.contentItems[l].config[r])!==null&&u!==void 0?u: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,r=[],i=0,a=0,o=0,s=[],l;if(!(this._isColumn||!t||this.contentItems.length<=1)){for(var u=this._calculateAbsoluteSizes(),d=0;d<this.contentItems.length;d++){this.contentItems[d];var f=u.itemSizes[d];f<t?(a+=t-f,l={width:t}):(i+=f-t,l={width:f},r.push(l)),s.push(l)}if(!(a===0||a>i)){var v=a/i;o=a;for(var m=0;m<r.length;m++){l=r[m];var p=Math.round((l.width-t)*v);o-=p,l.width-=p}o!==0&&(s[s.length-1].width-=o);for(var g=0;g<this.contentItems.length;g++)this.contentItems[g].config.width=s[g].width/u.totalWidth*100}}}_createSplitter(e){var t;return t=new $s(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,r=0,i=0;i<e.length;++i){var a,o;t=Math.max((a=e[i].minWidth)!==null&&a!==void 0?a:0,t),r=Math.max((o=e[i].minHeight)!==null&&o!==void 0?o:0,r)}return{horizontal:t,vertical:r}}_onSplitterDragStart(e){var t,r,i,a,o=this._getItemsForSplitter(e),s=this.layoutManager.config.dimensions[this._isColumn?"minItemHeight":"minItemWidth"],l=this._getMinimumDimensions((t=o.before.config.content)!==null&&t!==void 0?t:[]),u=this._isColumn?l.vertical:l.horizontal,d=this._getMinimumDimensions((r=o.after.config.content)!==null&&r!==void 0?r:[]),f=this._isColumn?d.vertical:d.horizontal;this._splitterPosition=0,this._splitterMinPosition=-1*(((i=o.before.element[this._dimension]())!==null&&i!==void 0?i:0)-(u||s)),this._splitterMaxPosition=((a=o.after.element[this._dimension]())!==null&&a!==void 0?a:0)-(f||s)}_onSplitterDrag(e,t,r){var i=this._isColumn?r: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,r,i,a,o,s=this._getItemsForSplitter(e),l=(t=s.before.element[this._dimension]())!==null&&t!==void 0?t:0,u=(r=s.after.element[this._dimension]())!==null&&r!==void 0?r:0,d=(((i=this._splitterPosition)!==null&&i!==void 0?i:0)+l)/(l+u),f=((a=s.before.config[this._dimension])!==null&&a!==void 0?a:0)+((o=s.after.config[this._dimension])!==null&&o!==void 0?o:0);s.before.config[this._dimension]=d*f,s.after.config[this._dimension]=(1-d)*f,e.element.css({top:0,left:0}),Nr(this.callDownwards.bind(this,"setSize",void 0,void 0,void 0))}}function Zi(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function Ji(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Zi(Object(t),!0).forEach(function(r){Yn(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Zi(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function Yn(n,e,t){return e=fp(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function fp(n){var e=vp(n,"string");return typeof e=="symbol"?e:String(e)}function vp(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class qn extends ae{constructor(e,t,r){super(e,Ji(Ji({},t),{},{type:"root"}),null,L('<div class="lm_goldenlayout lm_item lm_root"></div>')),Yn(this,"childElementContainer",void 0),Yn(this,"_containerElement",void 0),this.isRoot=!0,this.type="root",this.childElementContainer=this.element,this._containerElement=r,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 r,i;e=typeof e>"u"?(r=this._containerElement.width())!==null&&r!==void 0?r: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,r){this.layoutManager.tabDropPlaceholder.remove(),super._$highlightDropZone(e,t,r)}_$onDrop(e,t){var r;if(ye(e)&&(r=this.layoutManager.createContentItem({type:"stack",header:e.config.header||{}},this),r._$init(),r.addChild(e),e=r),!this.contentItems.length)this.addChild(e);else{var{side:i}=t,a=i==="left"||i==="right"?"row":"column",o=i==="left"||i==="right"?"width":"height",s=i==="left"||i==="top",l=this.contentItems[0];if(!(l instanceof Qt)||l.type!=a){var u=this.layoutManager.createContentItem({type:a},this);this.replaceChild(l,u),u.addChild(e,s?0:void 0,!0),u.addChild(l,s?void 0:0,!0),l.config[o]=50,e.config[o]=50,u.callDownwards("setSize")}else{var d,f=l.contentItems[s?0:l.contentItems.length-1];l.addChild(e,s?0:void 0,!0),f.config[o]=((d=f.config[o])!==null&&d!==void 0?d:0)*.5,e.config[o]=f.config[o],l.callDownwards("setSize")}}}}function Qi(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function nt(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Qi(Object(t),!0).forEach(function(r){ce(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Qi(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function ce(n,e,t){return e=mp(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function mp(n){var e=pp(n,"string");return typeof e=="symbol"?e:String(e)}function pp(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class Zn extends ae{constructor(e,t,r){var i,a,o,s,l,u,d,f,v;super(e,t,r,L('<div class="lm_item lm_stack"></div>')),ce(this,"_activeContentItem",null),ce(this,"_header",void 0),ce(this,"childElementContainer",L('<div class="lm_items"></div>')),ce(this,"header",void 0),ce(this,"parent",void 0),ce(this,"isStack",!0),ce(this,"_dropZones",{}),ce(this,"_dropSegment",null),ce(this,"_contentAreaDimensions",null),ce(this,"_dropIndex",void 0),ce(this,"_side",void 0),ce(this,"_sided",!1),ce(this,"config",void 0),this.parent=r,this.config=t;var m=e.config;this._side=!1,this._header={show:((i=m.settings)===null||i===void 0?void 0:i.hasHeaders)&&t.hasHeaders!==!1,popout:(a=m.settings)!==null&&a!==void 0&&a.showPopoutIcon?(o=m.labels)===null||o===void 0?void 0:o.popout:void 0,maximise:(s=m.settings)!==null&&s!==void 0&&s.showMaximiseIcon?(l=m.labels)===null||l===void 0?void 0:l.maximise:void 0,close:(u=m.settings)!==null&&u!==void 0&&u.showCloseIcon?(d=m.labels)===null||d===void 0?void 0:d.close:void 0,minimise:(f=(v=m.labels)===null||v===void 0?void 0:v.minimise)!==null&&f!==void 0?f:void 0},m.header&&(this._header=nt(nt({},this._header),m.header)),t.header&&(this._header=nt(nt({},this._header),t.header)),t.content&&t.content[0]&&t.content[0].header&&(this._header=nt(nt({},this._header),t.content[0].header)),this.header=new Le(e,this),this.element.append(this.header.element),this.element.append(this.childElementContainer),this._setupHeaderPosition(),this._$validateClosability()}setSize(){var e,t,r,i,a,o=this._header.show&&(e=(t=this.layoutManager.config.dimensions)===null||t===void 0?void 0:t.headerHeight)!==null&&e!==void 0?e:0,s=((r=this.element.width())!==null&&r!==void 0?r:0)-(this._sided?o:0),l=((i=this.element.height())!==null&&i!==void 0?i:0)-(this._sided?0:o);for(this.childElementContainer.width(s),this.childElementContainer.height(l),a=0;a<this.contentItems.length;a++)this.contentItems[a].element.width(s).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,r=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(r-1,0)]):this._activeContentItem=null),this._$validateClosability(),this.emitBubblingEvent("stateChanged")}_$validateClosability(){for(var e=this.header._isClosable(),t=0,r=this.contentItems.length;t<r;t++){var i;if(!e)break;e=(i=this.contentItems[t].config.isClosable)!==null&&i!==void 0?i:!1}this.header._$setClosable(e)}_$destroy(){ae.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",r=this._dropSegment==="left"||this._dropSegment==="right",i=this._dropSegment==="top"||this._dropSegment==="left",a=t&&this.parent.isColumn||r&&this.parent.isRow,o=t?"column":"row",s=t?"height":"width";if(ye(e)){var l=this.layoutManager.createContentItem({type:"stack",header:e.config.header||{}},this);l._$init(),l.addChild(e),e=l}if(a){var u,d=this.parent.contentItems.indexOf(this);this.parent.addChild(e,i?d:d+1,!0),this.config[s]=((u=this.config[s])!==null&&u!==void 0?u:0)*.5,e.config[s]=this.config[s],this.parent.callDownwards("setSize")}else{var f=this.layoutManager.createContentItem({type:o},this);this.parent.replaceChild(this,f),f.addChild(e,i?0:void 0,!0),f.addChild(this,i?void 0:0,!0),this.config[s]=50,e.config[s]=50,f.callDownwards("setSize")}}_$highlightDropZone(e,t){if(this._contentAreaDimensions)for(var[r,i]of Object.entries(this._contentAreaDimensions)){var a=i.hoverArea;if(a.x1<e&&a.x2>e&&a.y1<t&&a.y2>t){r==="header"?(this._dropSegment="header",this._highlightHeaderDropZone(e)):(this._resetHeaderDropZone(),this._highlightBodyDropZone(r));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 r=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+r*.25,y2:t.y2},highlightArea:{x1:t.x1,y1:t.y1,x2:t.x1+r*.5,y2:t.y2}},this._contentAreaDimensions.top={hoverArea:{x1:t.x1+r*.25,y1:t.y1,x2:t.x1+r*.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+r*.75,y1:t.y1,x2:t.x2,y2:t.y2},highlightArea:{x1:t.x1+r*.5,y1:t.y1,x2:t.x2,y2:t.y2}},this._contentAreaDimensions.bottom={hoverArea:{x1:t.x1+r*.25,y1:t.y1+i*.5,x2:t.x1+r*.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,r,i,a,o,s,l,u,d,f,v,m,p,g,b,_,S=this.header.tabs.length;if(S===0){var w,T,y,O,M,A,j,F,V=this.header.element.offset();(w=this.layoutManager.dropTargetIndicator)===null||w===void 0||w.highlightArea({x1:(T=V==null?void 0:V.left)!==null&&T!==void 0?T:0,x2:((y=V==null?void 0:V.left)!==null&&y!==void 0?y:0)+100,y1:(O=(M=this.header.element.offset())===null||M===void 0?void 0:M.top)!==null&&O!==void 0?O:0,y2:((A=(j=this.header.element.offset())===null||j===void 0?void 0:j.top)!==null&&A!==void 0?A:0)+((F=this.header.element.innerHeight())!==null&&F!==void 0?F:0)});return}var D=this.header.tabsContainer,E=(t=D.get(0))===null||t===void 0?void 0:t.getBoundingClientRect(),P=(r=this.layoutManager.tabDropPlaceholder.get(0))===null||r===void 0?void 0:r.getBoundingClientRect();if(!(!E||!P)){e<E.left?e=E.left+1:e>E.right&&(e=E.right-1);var x,R;if(!(P.left<e&&e<P.right)){for(var B=0;B<S;B++){var Y;if(x=this.header.tabs[B].element,R=(Y=x.get(0))===null||Y===void 0?void 0:Y.getBoundingClientRect(),R&&R.left<e&&e<R.right){this._dropIndex=B;break}}if(x&&R&&e<R.left+R.width*.5)x.before(this.layoutManager.tabDropPlaceholder);else if(x){var Q;this._dropIndex=Math.min(((Q=this._dropIndex)!==null&&Q!==void 0?Q:0)+1,S),x.after(this.layoutManager.tabDropPlaceholder)}}var $=(i=(a=this.layoutManager.tabDropPlaceholder.offset())===null||a===void 0?void 0:a.left)!==null&&i!==void 0?i:0;$=Math.max($,(o=(s=this.header.tabsContainer.offset())===null||s===void 0?void 0:s.left)!==null&&o!==void 0?o:0);var U=$+((l=this.layoutManager.tabDropPlaceholder.width())!==null&&l!==void 0?l:0);U=Math.min(U,((u=(d=this.header.tabsContainer.offset())===null||d===void 0?void 0:d.left)!==null&&u!==void 0?u:0)+((f=this.header.tabsContainer.innerWidth())!==null&&f!==void 0?f:0)),(v=this.layoutManager.dropTargetIndicator)===null||v===void 0||v.highlightArea({x1:$,x2:U,y1:(m=(p=this.header.element.offset())===null||p===void 0?void 0:p.top)!==null&&m!==void 0?m:0,y2:((g=(b=this.header.element.offset())===null||b===void 0?void 0:b.top)!==null&&g!==void 0?g:0)+((_=this.header.element.innerHeight())!==null&&_!==void 0?_:0)})}}_resetHeaderDropZone(){this.layoutManager.tabDropPlaceholder.remove()}_setupHeaderPosition(){var e=["right","left","bottom"].some(r=>r===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,r,i=(t=this._contentAreaDimensions)===null||t===void 0||(r=t[e])===null||r===void 0?void 0:r.highlightArea;if(i){var a;(a=this.layoutManager.dropTargetIndicator)===null||a===void 0||a.highlightArea(i)}this._dropSegment=e}}const gp=Object.freeze(Object.defineProperty({__proto__:null,AbstractContentItem:ae,Component:ks,ContentItem:ae,Root:qn,RowOrColumn:Qt,Stack:Zn,isComponent:ye,isRoot:Rs,isStack:Et},Symbol.toStringTag,{value:"Module"}));function xe(n,e,t){return e=bp(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function bp(n){var e=yp(n,"string");return typeof e=="symbol"?e:String(e)}function yp(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class At{constructor(e,t){var r;xe(this,"header",void 0),xe(this,"contentItem",void 0),xe(this,"element",L(At._template)),xe(this,"titleElement",void 0),xe(this,"closeElement",void 0),xe(this,"isActive",!1),xe(this,"_layoutManager",void 0),xe(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,(r=this._layoutManager.config.settings)!==null&&r!==void 0&&r.reorderEnabled&&t.config.reorderEnabled&&(this._dragListener=new Dt(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),ye(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),ye(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 r;(r=this.contentItem.parent)!==null&&r!==void 0&&r.isMaximised&&this.contentItem.parent.toggleMaximise(),this._dragListener&&new Qe(e,t,this._dragListener,this._layoutManager,this.contentItem,this.header.parent)}_onTabContentFocusIn(){L(".lm_focusin",this._layoutManager.root.element).removeClass("lm_focusin"),this.element.addClass("lm_focusin")}_onTabContentFocusOut(){ye(this.contentItem)&&!this.contentItem.container._contentElement[0].contains(document.activeElement)&&this.element.removeClass("lm_focusin")}_onTabClick(e){if(!e||e.button===0){var t,r=this.header.parent.getActiveContentItem();this.contentItem!==r&&ye(this.contentItem)?this.header.parent.setActiveContentItem(this.contentItem):ye(this.contentItem)&&!this.contentItem.container._contentElement[0].contains(document.activeElement)&&this.contentItem.container._contentElement.focus(),ye(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(),ye(this.contentItem)?this.contentItem.container.close():this.header.parent.removeChild(this.contentItem)}_onCloseMousedown(e){e.stopPropagation()}}xe(At,"_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 z(n,e,t){return e=_p(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function _p(n){var e=wp(n,"string");return typeof e=="symbol"?e:String(e)}function wp(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class Le extends Ee{constructor(e,t){var r,i;super(),z(this,"layoutManager",void 0),z(this,"element",L(Le._template)),z(this,"tabsContainer",void 0),z(this,"tabDropdownContainer",void 0),z(this,"tabDropdownSearch",void 0),z(this,"tabDropdownList",null),z(this,"controlsContainer",void 0),z(this,"parent",void 0),z(this,"tabs",[]),z(this,"activeContentItem",null),z(this,"closeButton",null),z(this,"tabDropdownButton",null),z(this,"tabNextButton",L(Le._nextButtonTemplate)),z(this,"tabPreviousButton",L(Le._previousButtonTemplate)),z(this,"holdTimer",null),z(this,"rAF",null),z(this,"CLICK_TIMEOUT",500),z(this,"START_SPEED",.01),z(this,"ACCELERATION",5e-4),z(this,"PADDING",10),z(this,"SCROLL_LEFT","left"),z(this,"SCROLL_RIGHT","right"),z(this,"isDraggingTab",!1),z(this,"isOverflowing",!1),z(this,"isDropdownShown",!1),z(this,"dropdownKeyIndex",0),z(this,"_lastVisibleTabIndex",-1),z(this,"_tabControlOffset",void 0),this.layoutManager=e,(r=this.layoutManager.config.settings)!==null&&r!==void 0&&r.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 r=0;r<this.tabs.length;r++)if(this.tabs[r].contentItem===e)return;var i=new At(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,r,i,a,o=0;o<this.tabs.length;o++)a=this.tabs[o].contentItem===e,this.tabs[o].setActive(a),a===!0&&(this.activeContentItem=e,this.parent.config.activeItemIndex=o);(t=this.tabs[(i=this.parent.config.activeItemIndex)!==null&&i!==void 0?i:0].element.get(0))===null||t===void 0||(r=t.scrollIntoView)===null||r===void 0||r.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 r=Math.abs(e.deltaY)>Math.abs(e.deltaX)?e.deltaY:e.deltaX;if(e.deltaMode===WheelEvent.DOM_DELTA_PAGE){var i;r*=(i=this.tabsContainer.innerWidth())!==null&&i!==void 0?i:1}else e.deltaMode===WheelEvent.DOM_DELTA_LINE&&(r*=100/3);t.scrollLeft+=Math.round(r)}}_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 r,i,a,o,s;if(((r=(i=this.tabs[t].element.get(0))===null||i===void 0?void 0:i.offsetLeft)!==null&&r!==void 0?r:0)>((a=(o=this.tabsContainer.get(0))===null||o===void 0?void 0:o.offsetWidth)!==null&&a!==void 0?a:0)+((s=this.tabsContainer.scrollLeft())!==null&&s!==void 0?s: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 u,d;l.scrollLeft=(u=(d=this.tabsContainer.get(0))===null||d===void 0?void 0:d.scrollWidth)!==null&&u!==void 0?u:0}}}_handlePreviousButtonMouseDown(){for(var e,t=this.tabs.length-1;t>=0;t-=1){var r,i,a;if(((r=(i=this.tabs[t].element.get(0))===null||i===void 0?void 0:i.offsetLeft)!==null&&r!==void 0?r: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 o=this.tabsContainer.get(0);o&&(o.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,r;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)===((r=this.tabsContainer.get(0))===null||r===void 0?void 0:r.scrollWidth)?this.tabNextButton.prop("disabled",!0):(this.tabNextButton.prop("disabled",!1),this.tabPreviousButton.first().prop("disabled",!1))}_handleScrollRepeat(e,t){var r,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,a=arguments.length>3?arguments[3]:void 0,o=this.tabsContainer.get(0);if(o){var s=o.getBoundingClientRect();if(e===this.SCROLL_LEFT){if(this.tabsContainer.scrollLeft(t-i),this.isDraggingTab&&this.parent._highlightHeaderDropZone(s.left-1),this.tabsContainer.scrollLeft()===0){this._checkScrollArrows();return}}else if(e===this.SCROLL_RIGHT){var l,u;if(this.tabsContainer.scrollLeft(t+i),this.isDraggingTab&&this.parent._highlightHeaderDropZone(s.right+1),((l=this.tabsContainer.scrollLeft())!==null&&l!==void 0?l:0)+((u=this.tabsContainer.innerWidth())!==null&&u!==void 0?u:0)===o.scrollWidth){this._checkScrollArrows();return}}window.cancelAnimationFrame((r=this.rAF)!==null&&r!==void 0?r:-1),this.rAF=window.requestAnimationFrame(d=>{var f,v,m=a||d,p=d-m,g=this.START_SPEED*p+.5*this.ACCELERATION*(p*p);g=Math.min(g,(f=(v=this.tabsContainer.get(0))===null||v===void 0?void 0:v.scrollWidth)!==null&&f!==void 0?f:1/0),this._handleScrollRepeat(e,t,g,m)})}}_$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(),L(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,r,i,a;if(a=this.layoutManager.config.labels.tabDropdown,this.layoutManager.config.labels.tabNextLabel,this.layoutManager.config.labels.tabPreviousLabel,this.tabDropdownButton=new yt(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),r=this._getHeaderSetting("popout"),new yt(this,r,"lm_popout",t)),this._getHeaderSetting("maximise")){i=this.parent.toggleMaximise.bind(this.parent);var o=this._getHeaderSetting("maximise"),s=this._getHeaderSetting("minimise"),l=new yt(this,o,"lm_maximise",i);this.parent.on("maximised",function(){l.element.attr("title",s??"")}),this.parent.on("minimised",function(){l.element.attr("title",o??"")})}this._isClosable()&&(e=this.parent.remove.bind(this.parent),r=this._getHeaderSetting("close"),this.closeButton=new yt(this,r,"lm_close",e))}_showAdditionalTabsDropdown(){if(this.isDropdownShown){this._hideAdditionalTabsDropdown();return}this.tabDropdownList=this.tabsContainer.clone(!0).appendTo(this.tabDropdownContainer).children().removeClass("lm_active"),L(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"),L(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(s,l,u){if(u==null||u.length<2)return-1;for(var d=(s+l+u.length)%u.length;d!==s;){if(u.eq(d).css("display")!=="none")return d;d=(d+l+u.length)%u.length}return s}if(e.key==="ArrowDown"||e.key==="Tab"&&e.shiftKey===!1){var r,i;e.preventDefault(),(r=this.tabDropdownList)===null||r===void 0||r.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,o;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),(o=this.tabDropdownList)===null||o===void 0||o.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 r,i;((r=(i=this.tabs[t].contentItem.config.title)===null||i===void 0?void 0:i.toLowerCase().indexOf(e.target.value.toLowerCase()))!==null&&r!==void 0?r:-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,r;this.isDropdownShown&&(e&&(t=this.tabDropdownContainer.get(0))!==null&&t!==void 0&&t.contains(e.target)||e&&((r=this.tabDropdownButton)===null||r===void 0?void 0:r.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(),L(document).off("mousedown",this._hideAdditionalTabsDropdown)))}_updateAdditionalTabsDropdown(){var e,t,r,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 o=this.tabDropdownContainer[0].getBoundingClientRect(),s=(r=L(window).height())!==null&&r!==void 0?r:0,l=(i=L(window).width())!==null&&i!==void 0?i:0;if(this.tabDropdownButton){var u=this.tabDropdownButton.element[0].getBoundingClientRect(),d=a<s-u.bottom,f=!d&&u.bottom>s*.6,v=Math.min(u.left+(f?u.width:0),l-o.width-this.PADDING),m=f?Math.max(u.top-a,this.PADDING):u.bottom,p=s-m-this.PADDING;this.tabDropdownContainer.css({"max-height":p,top:m,left:v})}}}}_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 r;(r=this.tabDropdownButton)===null||r===void 0||r.element.hide(),this.tabNextButton.hide(),this.tabPreviousButton.hide(),this.isOverflowing=!1}this.isOverflowing&&this._checkScrollArrows()}}}}z(Le,"_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(""));z(Le,"_previousButtonTemplate",['<ul class="lm_controls">','<li class="lm_tabpreviousbutton"></li>',"</ul>"].join(""));z(Le,"_nextButtonTemplate",['<li class="lm_tabnextbutton"></li>'].join(""));function gt(n,e,t){return e=Sp(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Sp(n){var e=Ep(n,"string");return typeof e=="symbol"?e:String(e)}function Ep(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class $s{constructor(e,t,r){gt(this,"_isVertical",void 0),gt(this,"_size",void 0),gt(this,"_grabSize",void 0),gt(this,"_dragListener",void 0),gt(this,"element",void 0),this._isVertical=e,this._size=t,this._grabSize=r<t?t:r,this.element=this._createElement(),this._dragListener=new Dt(this.element)}on(e,t,r){var i;(i=this._dragListener)===null||i===void 0||i.on(e,t,r)}_$destroy(){var e;(e=this._dragListener)===null||e===void 0||e.destroy(),this._dragListener=null,this.element.remove()}_createElement(){var e=L('<div class="lm_drag_handle"></div>'),t=L('<div class="lm_splitter"></div>');t.append(e);var r=this._grabSize-this._size,i=r/2;return this._isVertical?(e.css("top",-i),e.css("height",this._size+r),t.addClass("lm_vertical"),t.height(this._size)):(e.css("left",-i),e.css("width",this._size+r),t.addClass("lm_horizontal"),t.width(this._size)),t}}const Cp=Object.freeze(Object.defineProperty({__proto__:null,BrowserPopout:Ns,DragProxy:Qe,DragSource:Ls,DragSourceFromEvent:js,DropTargetIndicator:xt,Header:Le,HeaderButton:yt,Splitter:$s,Tab:At},Symbol.toStringTag,{value:"Module"}));var Pp={config:Sm,container:Om,controls:Cp,errors:op,items:gp,utils:Vm};const Tp=Pp;function ea(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function de(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?ea(Object(t),!0).forEach(function(r){K(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):ea(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function K(n,e,t){return e=Op(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Op(n){var e=Ip(n,"string");return typeof e=="symbol"?e:String(e)}function Ip(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class Bs extends Ee{static minifyConfig(e){return Fr(e)}static unminifyConfig(e){return Kn(e)}constructor(e,t){super(),K(this,"isInitialised",!1),K(this,"_isFullPage",!1),K(this,"_resizeTimeoutId",void 0),K(this,"_components",{"lm-react-component":As}),K(this,"_fallbackComponent",void 0),K(this,"_itemAreas",[]),K(this,"_maximisedItem",null),K(this,"_maximisePlaceholder",L('<div class="lm_maximise_place"></div>')),K(this,"_creationTimeoutPassed",!1),K(this,"_subWindowsCreated",!1),K(this,"_dragSources",[]),K(this,"_updatingColumnsResponsive",!1),K(this,"_firstLoad",!0),K(this,"_reactChildMap",new Map),K(this,"_reactChildren",null),K(this,"width",null),K(this,"height",null),K(this,"root",void 0),K(this,"openPopouts",[]),K(this,"selectedItem",null),K(this,"isSubWindow",!1),K(this,"eventHub",new Ms(this)),K(this,"config",void 0),K(this,"container",void 0),K(this,"_originalContainer",void 0),K(this,"dropTargetIndicator",null),K(this,"tabDropPlaceholder",L('<div class="lm_drop_tab_placeholder"></div>')),K(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&&L("body").css("visibility","hidden"),this._typeToItem={column:Qt.bind(this,!0),row:Qt.bind(this,!1),stack:Zn,component:ks}}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 r=()=>{if(this._components[e]===void 0)throw new Error("Component "+e+" is not registered");delete this._components[e]};return r}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 ae))throw new Error("Root must be a ContentItem");var t={settings:de({},this.config.settings),dimensions:de({},this.config.dimensions),labels:de({},this.config.labels),content:[]},r=function a(o,s){for(var l in s.config)l!=="content"&&(o[l]=s.config[l]);if(o.componentName==="lm-react-component"&&(o.type="react-component"),s.contentItems.length){o.content=[];for(var u=0;u<s.contentItems.length;u++)o.content[u]={},a(o.content[u],s.contentItems[u])}};e?r(t,{contentItems:[e]}):r(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){L(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 xt,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 r=this._reactChildMap.get(e);r===t&&(this._reactChildMap.delete(e),this._reactChildren=[...this._reactChildMap.values()],this.emit("reactChildrenChanged"))}getReactChildren(){return this._reactChildren}updateSize(e,t){var r,i;if(this.width=(r=e??this.container.width())!==null&&r!==void 0?r: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,o;this._maximisedItem.element.width((a=this.container.width())!==null&&a!==void 0?a:0),this._maximisedItem.element.height((o=this.container.height())!==null&&o!==void 0?o:0),this._maximisedItem.callDownwards("setSize")}this._adjustColumnsResponsive()}}destroy(){var e;this.isInitialised===!1||!this.root||(this._onUnload(),L(window).off("resize",this._onResize),L(window).off("unload beforeunload",this._onUnload),L(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 r,i;if(typeof e.type!="string")throw new Xe("Missing parameter 'type'",e);if(e.type==="react-component"&&(e.type="component",e.componentName="lm-react-component"),!this._typeToItem[e.type])throw r="Unknown type '"+e.type+"'. Valid types are "+Object.keys(this._typeToItem).join(","),new Xe(r);return e.type==="component"&&!(t instanceof Zn)&&t&&!(this.isSubWindow===!0&&t instanceof qn)&&(e={type:"stack",width:e.width,height:e.height,content:[e]}),i=new this._typeToItem[e.type](this,e,t),i}createPopout(e,t,r,i){var a=[],o=e instanceof ae,s=this;if(o){var l;a=this.toConfig(e).content,r=Lr();for(var u=e.parent,d=e;((f=u)===null||f===void 0?void 0:f.contentItems.length)===1&&!u.isRoot;){var f;d=u,u=u.parent}if((l=u)===null||l===void 0||l.addId(r),i==null||Number.isNaN(i)){var v;i=(v=u)===null||v===void 0?void 0:v.contentItems.indexOf(d)}}else e instanceof Array?a=e:a=[e];if(!t&&o){var m,p,g,b=window.screenX||window.screenLeft,_=window.screenY||window.screenTop,S=(m=e.element.offset())!==null&&m!==void 0?m:{left:0,top:0};t={left:b+S.left,top:_+S.top,width:(p=e.element.width())!==null&&p!==void 0?p:0,height:(g=e.element.height())!==null&&g!==void 0?g:0}}if(!t&&!o&&(t={left:window.screenX||window.screenLeft+20,top:window.screenY||window.screenTop+20,width:500,height:309}),o&&e.remove(),!(!t||!r||i===void 0)){var w=new Ns(a,t,r,i,this);return w.on("initialised",function(){s.emit("windowOpened",w)}),w.on("closed",function(){s._$reconcilePopoutWindows()}),this.openPopouts.push(w),w}}createDragSource(e,t){this.config.settings.constrainDragToContainer=!1;var r=new Ls(e,t,this);return this._dragSources.push(r),r}createDragSourceFromEvent(e,t){return this.config.settings.constrainDragToContainer=!1,new js(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,r;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((r=this.container.height())!==null&&r!==void 0?r: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 r=1/0,i=null,a=0;a<this._itemAreas.length;a++){var o=this._itemAreas[a];e>o.x1&&e<o.x2&&t>o.y1&&t<o.y2&&r>o.surface&&(r=o.surface,i=o)}return i}_$createRootItemAreas(){var e=50,t=de({},this.root._$getArea()),r=[de(de({},t),{},{side:"left",x2:t.x1+e}),de(de({},t),{},{side:"right",x1:t.x2-e}),de(de({},t),{},{side:"top",y2:t.y1+e}),de(de({},t),{},{side:"bottom",y1:t.y2-e})];r.forEach(i=>{i.surface=(i.x2-i.x1)*(i.y2-i.y1)}),this._itemAreas.push(...r)}_$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 r=e[t];if(Et(r)){var i=r._$getArea();if(i!==null)if(i instanceof Array)this._itemAreas=this._itemAreas.concat(i);else{var a;this._itemAreas.push(i);var o=de(de({},i),(a=i.contentItem._contentAreaDimensions)===null||a===void 0?void 0:a.header.highlightArea);o.surface=(o.x2-o.x1)*(o.y2-o.y1),this._itemAreas.push(o)}}}}_$normalizeContentItem(e,t){if(!e)throw new Error("No content item defined");if(typeof e=="function"&&(e=e()),e instanceof ae)return e;if(L.isPlainObject(e)&&e.type){var r=this.createContentItem(e,t);return r.callDownwards("_$init"),r}else throw new Error("Invalid contentItem")}_$reconcilePopoutWindows(){for(var e=[],t=0;t<this.openPopouts.length;t++){var r;((r=this.openPopouts[t].getWindow())===null||r===void 0?void 0:r.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=r=>{if(e.push(r),r.contentItems instanceof Array)for(var i=0;i<r.contentItems.length;i++)t(r.contentItems[i])};return t(this.root),e}_bindEvents(){this._isFullPage&&L(window).resize(this._onResize),L(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,r=xs("gl-window");r&&(this.isSubWindow=!0,e=JSON.parse(localStorage.getItem(r)||"{}"),e=Kn(e),localStorage.removeItem(r)),e=L.extend(!0,{},Ts,e);var i=function a(o){for(var s in o){var l=o[s];s!=="props"&&typeof l=="object"&&l!=null?a(l):s==="type"&&l==="react-component"&&(o.type="component",o.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=L('<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=jr((e=this.config.content[0].title)!==null&&e!==void 0?e:""),L("head").append(L("body link, body style, template, .gl_keep")),this.container=L("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?L(this._originalContainer):L("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,L("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 Xe(t,e);if(e.content.length>1)throw t="Top level content can't contain more then one element.",new Xe(t,e);this.root=new qn(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,r=e*t;if(!(this.width==null||r<=this.width)){this._updatingColumnsResponsive=!0;for(var i=Math.max(Math.floor(this.width/t),1),a=e-i,o=this.root.contentItems[0],s=this._findAllStackContainers()[0],l=0;l<a;l++){var u=o.contentItems[o.contentItems.length-1];this._addChildContentItemsToContainer(s,u)}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(r){e.addChild(r),t.removeChild(r,!0)}):t.contentItems.forEach(r=>{this._addChildContentItemsToContainer(e,r)})}_findAllStackContainers(){var e=[];return this._findAllStackContainersRecursive(e,this.root),e}_findAllStackContainersRecursive(e,t){t.contentItems.forEach(r=>{Et(r)?e.push(r):r.isComponent||this._findAllStackContainersRecursive(e,r)})}}K(Bs,"__lm",Tp);const Us=Bs,Dp="_lm_dragging_4iylo_1",xp="_lm_goldenlayout_4iylo_1",Ap="_lm_header_4iylo_1",Mp="_lm_controls_4iylo_1",Np="_lm_tabpreviousbutton_4iylo_1",Lp="_lm_tabnextbutton_4iylo_1",jp="_lm_tab_4iylo_1",Fp="_lm_active_4iylo_1",Rp="_lm_close_tab_4iylo_1",kp="_lm_content_4iylo_1",$p="_lm_dragProxy_4iylo_1",Bp="_lm_dropTargetIndicator_4iylo_1",Up="_march_4iylo_1",Wp="_lm_inner_4iylo_1",Vp="_lm_splitter_4iylo_1",Hp="_lm_selectable_4iylo_1",zp="_lm_tabdropdown_list_4iylo_1",Gp="_lm_title_4iylo_1",Kp="_lm_title_before_4iylo_1",Xp="_lm_selected_4iylo_1",Yp="_lm_focusin_4iylo_1",qp="_lm_window_blur_4iylo_1",Zp="_lm_popout_4iylo_1",Jp="_lm_maximise_4iylo_1",Qp="_lm_tabdropdown_4iylo_1",eg="_lm_close_4iylo_1",tg="_lm_tabdropdown_search_4iylo_1",ng="_lm_tabs_4iylo_1",rg="_lm_keyboard_active_4iylo_1",ig="_lm_maximised_4iylo_1",ag="_lm_items_4iylo_1",ta={"tab-height":"28px","drag-border-width":"5px",lm_dragging:Dp,lm_goldenlayout:xp,lm_header:Ap,lm_controls:Mp,lm_tabpreviousbutton:Np,lm_tabnextbutton:Lp,lm_tab:jp,lm_active:Fp,lm_close_tab:Rp,lm_content:kp,lm_dragProxy:$p,lm_dropTargetIndicator:Bp,march:Up,lm_inner:Wp,lm_splitter:Vp,lm_selectable:Hp,lm_tabdropdown_list:zp,lm_title:Gp,lm_title_before:Kp,lm_selected:Xp,lm_focusin:Yp,lm_window_blur:qp,lm_popout:Zp,lm_maximise:Jp,lm_tabdropdown:Qp,lm_close:eg,lm_tabdropdown_search:tg,lm_tabs:ng,lm_keyboard_active:rg,lm_maximised:ig,lm_items:ag},na=Object.freeze({tabHeight:parseInt(ta["tab-height"],10),dragBorderWidth:parseInt(ta["drag-border-width"],10)});function ra(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function Ie(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?ra(Object(t),!0).forEach(function(r){Ws(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):ra(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function Ws(n,e,t){return e=og(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function og(n){var e=sg(n,"string");return typeof e=="symbol"?e:String(e)}function sg(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var Be=H.module("LayoutUtils");function Vs(n){return n.componentName!==void 0}function st(n){var e=n;return(Vs(n)&&n.componentName==="lm-react-component"||n.type==="react-component")&&e.component!==void 0}function Ut(n){return n.focus!==void 0}function ia(n){return n.type==="stack"}class k{static activateTab(e,t){var r=k.getStackForRoot(e,t,!1);if(!r){Be.error("Could not find stack for config",t);return}var i=k.getContentItemInStack(r,t);i&&r.setActiveContentItem(i)}static isActiveTab(e,t){var r=k.getStackForRoot(e,t,!1);if(!r)return Be.error("Could not find stack for config",t),!1;var i=k.getContentItemInStack(r,t),a=r.getActiveContentItem();return a===i}static addStack(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,r=t?"column":"row";if(Rs(e)){(e.contentItems==null||e.contentItems.length===0)&&e.addChild({type:r});var i=e.contentItems[0],a=t?i.isColumn:i.isRow;if(!a){e.removeChild(i,!0),e.addChild({type:r});var o=document.activeElement;e.contentItems[0].addChild(i),o&&o.focus!=null&&o.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 s=e.contentItems[e.contentItems.length-1],l=t?s.isRow:s.isColumn;return l||(e.addChild({type:t?"row":"column"}),e.removeChild(s,!0),e.contentItems[e.contentItems.length-1].addChild(s),s=e.contentItems[e.contentItems.length-1]),this.addStack(s,!t)}static getStackForConfig(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;if(r&&Et(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&&Kr(a.config,t))return e;var o=this.getStackForConfig(a,t,r);if(o)return o}return null}static getStackForRoot(e,t){var r=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,o=this.getStackForConfig(e,t);return!o&&i&&(o=this.getStackForConfig(e,{component:t.component},a)),!o&&r&&(o=this.addStack(e)),o}static getStackForComponentTypes(e,t){for(var r=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,o=0;o<t.length;o+=1){var s=t[o],l=o===t.length-1,u=k.getStackForRoot(e,{component:s},r&&l,i,a);if(u)return u}return null}static getContentItemInStack(e,t){if(!e)return null;for(var r=0;r<e.contentItems.length;r+=1){var i=e.contentItems[r];if(i.isComponent&&i.config!=null&&Kr(i.config,t))return i}return null}static dehydrateLayoutConfig(e,t){if(e==null||!e.length)return[];for(var r=[],i=0;i<e.length;i+=1){var a=e[i],{component:o,content:s}=a;if(o){var l=t(o,a);l!=null?r.push(l):Be.debug2('dehydrateLayoutConfig: skipping unmapped component "'.concat(o,'"'))}else if(s){var u=Ie(Ie({},a),{},{content:k.dehydrateLayoutConfig(s,t)});r.push(u)}else r.push(a)}return r}static getTabPoint(e){var{tab:t}=e;if(t==null)throw new Error("Cannot get tab for panel container ".concat(e));var r=t.element[0].getBoundingClientRect();return[r.left+r.width*.5,r.bottom-8]}static dropLayoutMinorChange(e){for(var t=0;t<e.length;t+=1){var r=e[t],{content:i}=r;i!==void 0?(ia(r)&&delete r.activeItemIndex,k.dropLayoutMinorChange(i)):st(r)&&r.component==="IrisGridPanel"&&r.props.panelState!=null&&(delete r.id,r.props.panelState.irisGridState.sorts=[],r.props.panelState.irisGridState.quickFilters=[],r.props.panelState.gridState.isStuckToBottom=!1,r.props.panelState.gridState.isStuckToRight=!1)}}static isEqual(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;if(r){var i=k.cloneLayout(e),a=k.cloneLayout(t);return k.dropLayoutMinorChange(i),k.dropLayoutMinorChange(a),He(i,a)}return He(e,t)}static cloneLayout(e){return JSON.parse(JSON.stringify(e))}static hydrateLayoutConfig(e,t){if(e==null||!e.length)return[];for(var r=[],i=0;i<e.length;i+=1){var a=e[i];if(st(a)){var o,{component:s,props:l={}}=a;r.push(Ie(Ie({},a),{},{id:(o=a==null?void 0:a.id)!==null&&o!==void 0?o:Ne(),props:t(s,l)}))}else if(a.content!==void 0){var u=k.hydrateLayoutConfig(a.content,t);ia(a)&&a.activeItemIndex!=null&&a.activeItemIndex>=u.length&&(Be.warn("Fixing bad activeItemIndex!",a.activeItemIndex,a),a.activeItemIndex=0),r.push(Ie(Ie({},a),{},{content:u}))}else r.push(a)}return r}static openComponent(){var{root:e,config:t,replaceExisting:r=!0,replaceConfig:i=void 0,createNewStack:a=!1,focusElement:o=void 0,dragEvent:s=void 0}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},l=document.activeElement,u=Ie({},t);if(u.id==null&&(u.id=Ne.generate()),s!=null){e==null||e.layoutManager.createDragSourceFromEvent(u,s);return}var d=i||{id:u.id,component:u.component};ze(e);var f=a?k.addStack(e):k.getStackForRoot(e,d);ze(f);var v=k.getContentItemInStack(f,d);if(o!=null){var m=g=>{Be.debug("Component created, focusing element",o),f.off("componentCreated",m);var{element:b}=g.origin;requestAnimationFrame(()=>{k.focusElement(b[0],o)})};f.on("componentCreated",m)}if(r&&v){var p=f.contentItems.indexOf(v);f.addChild(u,p+1),f.removeChild(v),f.setActiveContentItem(f.contentItems[p])}else f.addChild(u);o==null&&l&&Ut(l)&&l.focus()}static openComponentInStack(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,i=document.activeElement,a={id:t.id},o=k.getContentItemInStack(e,a);if(r&&o&&e){var s=e==null?void 0:e.contentItems.indexOf(o);e.addChild(t,s+1),e.removeChild(o),e.setActiveContentItem(e.contentItems[s])}else e==null||e.addChild(t);i&&Ut(i)&&i.focus()}static closeComponent(e,t,r){var i=k.getStackForRoot(e,t,!1,!1,!1);if(!i){Be.warn("Cannot find stack for component, ignoring close",t);return}var a=k.getContentItemInStack(i,t),o=document.activeElement;a&&(ye(a)?a.container.close(r):i.removeChild(a)),o&&document.contains(o)&&Ut(o)&&o.focus()}static renameComponent(e,t,r){var i=k.getStackForRoot(e,t,!1);if(!i){Be.error("Could not find stack for config",t);return}var a=k.getContentItemInStack(i,t);a&&a.setTitle(r)}static cloneComponent(e,t){var r=k.getStackForRoot(e,t,!1);if(!r)return Be.error("Could not find stack for config",t),null;var{props:i={}}=t,a=k.getPanelComponentState(t),o={type:"react-component",component:t.component,props:Ie(Ie({},i),{},{panelState:a}),title:"".concat(t.title," Copy"),id:Ne.generate()};return k.openComponentInStack(r,o),o}static getPanelComponentState(e){if(Vs(e)){var t;return(t=e.componentState)===null||t===void 0?void 0:t.panelState}if(st(e)){var r;return(r=e.props)===null||r===void 0?void 0:r.panelState}return null}static makeDefaultLayout(){return{dimensions:{headerHeight:na.tabHeight,borderWidth:na.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=k.getComponentConfigFromContainer(e);return t?t.id:null}static getIdFromPanel(e){var{glContainer:t}=e.props;return k.getIdFromContainer(t)}static getComponentNameFromPanel(e){var{glContainer:t}=e.props,r=k.getComponentConfigFromContainer(t);if(r&&st(r)){var i;return(i=r.component)!==null&&i!==void 0?i:null}return null}static getComponentName(e){var t,r,i=(t=(r=e.WrappedComponent)===null||r===void 0?void 0:r.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]:k.DEFAULT_FOCUS_SELECTOR;if(e==null)return null;var r=e.querySelector(t);return r==null?null:(Ut(r)&&r.focus(),r)}static onInitialized(e){return new Promise(t=>{if(e.isInitialised){t();return}var r=()=>{e.off("initialised",r),t()};e.on("initialised",r)})}}Ws(k,"DEFAULT_FOCUS_SELECTOR","input, select, textarea, button");var Hs=q.forwardRef((n,e)=>{var t=k.getComponentNameFromPanel({props:n});return h.jsx("div",{ref:e,className:"panel-placeholder",children:h.jsxs("div",{children:['Component "',t,'" is not registered.']})})});Hs.displayName="PanelPlaceholder";const ee=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 Ct(n){return(n==null?void 0:n.WrappedComponent)!==void 0}function zs(n){return typeof n.id=="string"&&n.layout instanceof Us&&n.panelManager instanceof mn&&typeof n.registerComponent=="function"}function lg(n){if(!zs(n))throw new Error("Expected dashboard plugin props, but instead received ".concat(n))}function aa(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function oa(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?aa(Object(t),!0).forEach(function(r){Ue(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):aa(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function Ue(n,e,t){return e=ug(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function ug(n){var e=dg(n,"string");return typeof e=="symbol"?e:String(e)}function dg(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var ge=H.module("PanelManager");class mn{constructor(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:(s,l)=>l,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:(s,l)=>l,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:new Map,a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:[],o=arguments.length>5&&arguments[5]!==void 0?arguments[5]:()=>{};Ue(this,"layout",void 0),Ue(this,"hydrateComponent",void 0),Ue(this,"dehydrateComponent",void 0),Ue(this,"onPanelsUpdated",void 0),Ue(this,"closed",void 0),Ue(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=r,this.onPanelsUpdated=o,this.openedMap=new Map(i),this.closed=[...a],this.startListening()}startListening(){var{eventHub:e}=this.layout;e.on(ee.FOCUS,this.handleFocus),e.on(ee.MOUNT,this.handleMount),e.on(ee.UNMOUNT,this.handleUnmount),e.on(ee.REOPEN,this.handleReopen),e.on(ee.DELETE,this.handleDeleted),e.on(ee.CLOSED,this.handleClosed),e.on(ee.CLOSE,this.handleControlClose)}stopListening(){var{eventHub:e}=this.layout;e.off(ee.FOCUS,this.handleFocus),e.off(ee.MOUNT,this.handleMount),e.off(ee.UNMOUNT,this.handleUnmount),e.off(ee.REOPEN,this.handleReopen),e.off(ee.DELETE,this.handleDeleted),e.off(ee.CLOSED,this.handleClosed),e.off(ee.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 k.getComponentConfigFromContainer(t)})}getOpenedPanelConfigsOfType(e){return this.getOpenedPanelConfigs().filter(t=>t!=null&&st(t)&&t.component===e)}getOpenedPanelById(e){return this.openedMap.get(e)}getContainerByPanelId(e){var t,r=k.getStackForConfig(this.layout.root,{id:e});return(t=r&&k.getContentItemInStack(r,{id:e}))!==null&&t!==void 0?t:null}getLastUsedPanel(e){for(var t=this.getOpenedPanels(),r=t.length-1;r>=0;r-=1){var i=t[r];if(e==null||e(i))return i}}getLastUsedPanelOfType(e){return this.getLastUsedPanelOfTypes([e])}getLastUsedPanelOfTypes(e){return this.getLastUsedPanel(t=>e.some(r=>Ct(r)&&t instanceof r.WrappedComponent||!Ct(r)&&t instanceof r))}updatePanel(e){var t=k.getIdFromPanel(e);if(t==null){ge.error("updatePanel Panel did not have an ID",e);return}ge.debug2("Updating panel ID ".concat(t," in open panels map")),this.openedMap.delete(t),this.openedMap.set(t,e)}removePanel(e){var t=k.getIdFromPanel(e);if(t==null){ge.error("removePanel Panel did not have an ID",e);return}if(!this.openedMap.has(t)){ge.error("Missing panel ID ".concat(t," in open panels map"));return}if(this.openedMap.get(t)!==e){ge.debug("Panel argument doesn't match the open panels map entry for ".concat(t,", removePanel ignored"));return}ge.debug2("Removing panel ID ".concat(t," from open panels map")),this.openedMap.delete(t)}removeClosedPanelConfig(e){var t=this.closed.findIndex(r=>r===e||r.id!=null&&e.id!=null&&r.id===e.id);t>=0&&this.closed.splice(t,1)}handleFocus(e){ge.debug2("Focus: ",e),this.updatePanel(e)}handleMount(e){ge.debug2("Mount: ",e),this.updatePanel(e),this.sendUpdate()}handleUnmount(e){ge.debug2("Unmount: ",e),this.removePanel(e),this.sendUpdate()}handleReopen(e,t){ge.debug2("Reopen:",e,t),this.removeClosedPanelConfig(e);var{component:r}=e,{props:i}=e;i=this.hydrateComponent(r,i);var a=oa(oa({},e),{},{props:i}),{root:o}=this.layout;k.openComponent({root:o,config:a,replaceConfig:t})}handleDeleted(e){ge.debug2("Deleted:",e),this.removeClosedPanelConfig(e),this.sendUpdate()}handleClosed(e,t){ge.debug2("Closed: ",e),this.addClosedPanel(t),this.sendUpdate()}handleControlClose(e){var t={id:e},{root:r}=this.layout;k.closeComponent(r,t)}addClosedPanel(e){var t=k.getComponentConfigFromContainer(e);if(t&&st(t)){var r=this.dehydrateComponent(t.component,t);r!=null&&this.closed.push(r)}}sendUpdate(){var{closed:e,openedMap:t}=this;this.onPanelsUpdated({closed:[...e],openedMap:new Map(t)})}}Ue(mn,"MAX_CLOSED_PANEL_COUNT",100);var cg=H.module("PanelErrorBoundary");class Gs extends c.Component{constructor(e){super(e),this.state={error:null}}componentDidCatch(e){this.setState({error:e})}componentWillUnmount(){var{glContainer:e,glEventHub:t}=this.props,r=k.getIdFromContainer(e);cg.debug("componentWillUnmount",r),t.emit(ee.CLOSED,r,e)}render(){var{children:e}=this.props,{error:t}=this.state;return t!=null?h.jsx("div",{className:"panel-error-boundary",children:h.jsx(Pe,{errorMessage:"".concat(t),isLoading:!1,isLoaded:!1})}):e}}function sa(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function en(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?sa(Object(t),!0).forEach(function(r){hg(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):sa(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function hg(n,e,t){return e=fg(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function fg(n){var e=vg(n,"string");return typeof e=="symbol"?e:String(e)}function vg(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function kr(n){var{props:e,componentState:t}=n,{metadata:r}=e,{panelState:i=null}=e;t&&({panelState:i}=t);var a={};return r!=null&&(a.metadata=r),i!=null&&(a.panelState=i),en(en({},n),{},{componentState:null,props:a,type:"react-component"})}function $r(n){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";return en(en({metadata:{}},n),{},{localDashboardId:e})}function Ks(n){var e=Ct(n)&&n.WrappedComponent.prototype!=null&&n.WrappedComponent.prototype.isReactComponent!=null||n.prototype!=null&&n.prototype.isReactComponent!=null,t=!Ct(n)&&"$$typeof"in n&&n.$$typeof===Sl.ForwardRef;return e||t}const mg={dehydrate:kr,hydrate:$r};var Br=q.createContext(void 0),pg=C.shape({on:C.func,off:C.func,isHidden:C.bool,tab:C.shape({header:C.shape({tabs:C.arrayOf(C.shape({contentItem:C.shape({})}))})}),title:C.string,setTitle:C.func,close:C.func}),Xs=C.shape({on:C.func,off:C.func,emit:C.func}),gg=C.shape({registerComponent:C.func,root:C.shape({addChild:C.func}),on:C.func,off:C.func,eventHub:Xs}),Ys=Object.freeze({Container:pg,EventHub:Xs,Layout:gg});function We(n,e,t){c.useEffect(function(){return n.on(e,t),()=>{n.off(e,t)}},[n,e,t])}function qs(n,e,t,r){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.");q.useEffect(()=>{var o=n(a,e,t,r);return()=>{o()}},[e,r,t,a,n])}function bg(n){var{dashboardProps:e,componentName:t,component:r,supportedTypes:i,hydrate:a,dehydrate:o}=n,{id:s,layout:l,registerComponent:u}=e,d=c.useCallback(f=>{var v,{dragEvent:m,fetch:p,panelId:g=Ne.generate(),widget:b}=f,{id:_,type:S}=b,w=(v=b.title)!==null&&v!==void 0?v:b.name,T=Array.isArray(i)&&i.includes(S)||S===i;if(T){var y={id:_,name:w,type:S},O={localDashboardId:s,metadata:y,fetch:p};a!=null&&(O=a(O,s));var M={type:"react-component",component:t,props:O,title:w,id:g},{root:A}=l;k.openComponent({root:A,config:M,dragEvent:m})}},[t,a,s,l,i]);qs(u,r,a,o),We(l.eventHub,ee.OPEN,d)}function yg(){var n=c.useContext(Br);if(n==null)throw new Error("LayoutManager not available, did you add a LayoutManagerContext.Provider to the tree?");return n}function la(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function ua(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?la(Object(t),!0).forEach(function(r){_g(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):la(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function _g(n,e,t){return e=wg(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function wg(n){var e=Sg(n,"string");return typeof e=="symbol"?e:String(e)}function Sg(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function Eg(n){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 r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:e,i=arguments.length>1?arguments[1]:void 0;switch(i.type){case n:{var{id:a,payload:o}=i;return t&&He({payload:o},{payload:r[a]})?r:ua(ua({},r),{},{[a]:o})}default:return r}}}function da(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function ca(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?da(Object(t),!0).forEach(function(r){Jn(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):da(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function Jn(n,e,t){return e=Cg(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Cg(n){var e=Pg(n,"string");return typeof e=="symbol"?e:String(e)}function Pg(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class Tg{constructor(){Jn(this,"reducers",{}),Jn(this,"listener",null)}register(e,t){var r;this.reducers=ca(ca({},this.reducers),{},{[e]:t}),(r=this.listener)===null||r===void 0||r.call(this,this.reducers)}setListener(e){this.listener=e}}var Og=new Tg;const Ig=Og;var Ur="SET_DASHBOARD_DATA";const Dg=Eg(Ur,{},!1),Zs={dashboardData:Dg};var xg=new Map,Ag=Object.freeze({}),Mg=Object.freeze([]),Js=n=>n.dashboardData,Mt=(n,e)=>{var t;return(t=Js(n)[e])!==null&&t!==void 0?t:Ag},Ng=(n,e)=>{var t;return(t=Mt(n,e).closed)!==null&&t!==void 0?t:Mg},Lg=(n,e)=>{var t;return(t=Mt(n,e).openedMap)!==null&&t!==void 0?t:xg};function ha(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function fa(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?ha(Object(t),!0).forEach(function(r){jg(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):ha(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function jg(n,e,t){return e=Fg(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Fg(n){var e=Rg(n,"string");return typeof e=="symbol"?e:String(e)}function Rg(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var Qs=(n,e)=>({type:Ur,id:n,payload:e}),el=(n,e)=>(t,r)=>t(Qs(n,fa(fa({},Mt(r(),n)),e)));Object.entries(Zs).map(n=>{var[e,t]=n;return Ig.register(e,t)});function kg(n){var{children:e}=n;return h.jsx(h.Fragment,{children:e})}function va(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function bt(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?va(Object(t),!0).forEach(function(r){$g(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):va(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function $g(n,e,t){return e=Bg(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Bg(n){var e=Ug(n,"string");return typeof e=="symbol"?e:String(e)}function Ug(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var Wt=H.module("DashboardLayout"),Wg=Object.freeze({}),Vg=[],ma=()=>{},pa=n=>n;function Wr(n){var e,t,{id:r,children:i,emptyDashboard:a=h.jsx("div",{children:"Dashboard is empty."}),layout:o,layoutConfig:s=Vg,onLayoutChange:l=ma,onLayoutInitialized:u=ma,hydrate:d=$r,dehydrate:f=kr,panelWrapper:v=kg}=n,m=El(),p=(e=Cl(N=>Mt(N,r)))!==null&&e!==void 0?e:Wg,[g,b]=c.useState(!1),[_,S]=c.useState(!1),[w,T]=c.useState(),[y]=c.useState((t=p==null?void 0:p.closed)!==null&&t!==void 0?t:[]),[O,M]=c.useState(!1),[A,j]=c.useState(o.getReactChildren()),F=c.useMemo(()=>new Map,[]),V=c.useMemo(()=>new Map,[]),D=c.useCallback(function(N,W){var G,Fe=arguments.length>2&&arguments[2]!==void 0?arguments[2]:d,Hr=arguments.length>3&&arguments[3]!==void 0?arguments[3]:f;Wt.debug2("registerComponent",N,W,Fe,Hr);function zr(Nt,al){var pn=W,ol=v,sl=Ks(pn),{glContainer:ll,glEventHub:ul}=Nt;return h.jsx(Gs,{glContainer:ll,glEventHub:ul,children:h.jsx(ol,bt(bt({},Nt),{},{children:sl?h.jsx(pn,bt(bt({},Nt),{},{ref:al})):h.jsx(pn,bt({},Nt))}))})}zr.displayName="DashboardWrapper(".concat((G=W.displayName)!==null&&G!==void 0?G:N,")");var il=o.registerComponent(N,q.forwardRef(zr));return F.set(N,Fe),V.set(N,Hr),il},[d,f,F,V,o,v]),E=c.useCallback((N,W)=>{var G;return((G=F.get(N))!==null&&G!==void 0?G:pa)(W,r)},[F,r]),P=c.useCallback((N,W)=>{var G;return((G=V.get(N))!==null&&G!==void 0?G:pa)(W,r)},[V,r]),x=c.useMemo(()=>new mn(o,E,P,new Map,y,N=>{var{closed:W,openedMap:G}=N;m(el(r,{closed:W,openedMap:G}))}),[P,m,E,r,y,o]),R=c.useCallback(()=>{if(!_){O||(u(),M(!0));var N=o.toConfig(),W=N.content,G=k.dehydrateLayoutConfig(W,P),Fe=w==null||!k.isEqual(w,G);Wt.debug("handleLayoutStateChanged",Fe,W,G),Fe&&(b(o.root.contentItems.length===0),T(G),l(G),j(o.getReactChildren()))}},[P,O,_,w,o,l,u]),B=c.useCallback(N=>{var W=k.getIdFromContainer(N);o.eventHub.emit(ee.DRAGGING,W),S(!0)},[o.eventHub]),Y=c.useCallback(N=>{var W=k.getIdFromContainer(N);o.eventHub.emit(ee.DROPPED,W),S(!1)},[o.eventHub]),Q=c.useCallback(N=>{if(Wt.debug2("handleComponentCreated",N),!(N==null||N.config==null||N.config.component==null||N.element==null)){var W=N.config.component.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),G="".concat(W,"-component");N.element.addClass(G)}},[]),$=c.useCallback(()=>{j(o.getReactChildren())},[o]);We(o,"stateChanged",R),We(o,"itemPickedUp",B),We(o,"itemDropped",Y),We(o,"componentCreated",Q),We(o.eventHub,ee.TITLE_CHANGED,R),We(o,"reactChildrenChanged",$);var U=Ba(s);return c.useEffect(function(){if(U!==s&&s!==w){Wt.debug("Setting new layout content...");for(var W=k.hydrateLayoutConfig(s,E);o.root.contentItems.length>0;)o.root.contentItems[0].remove();for(var G=0;G<W.length;G+=1)o.root.addChild(W[G]);b(o.root.contentItems.length===0)}},[E,o,s,w,x,U]),h.jsxs(h.Fragment,{children:[g&&a,A,q.Children.map(i,N=>N!=null?q.cloneElement(N,{id:r,layout:o,panelManager:x,registerComponent:D}):null)]})}Wr.propTypes={id:C.string.isRequired,children:C.node,data:C.shape({}),emptyDashboard:C.node,layout:Ys.Layout.isRequired,layoutConfig:C.arrayOf(C.shape({})),onLayoutChange:C.func,onLayoutInitialized:C.func};function ga(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function Hg(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?ga(Object(t),!0).forEach(function(r){zg(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):ga(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function zg(n,e,t){return e=Gg(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Gg(n){var e=Kg(n,"string");return typeof e=="symbol"?e:String(e)}function Kg(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var Xg=100,In=()=>{},Yg=Object.freeze({});function ba(n){var{id:e="default",children:t,emptyDashboard:r,layoutConfig:i,layoutSettings:a=Yg,onLayoutConfigChange:o=In,onGoldenLayoutChange:s=In,onLayoutInitialized:l=In,fallbackComponent:u=Hs,hydrate:d,dehydrate:f,panelWrapper:v}=n,m=c.useRef(null),[p,g]=c.useState(!1),[b,_]=c.useState();c.useEffect(function(){if(!m.current){_(void 0);return}var T=Hg({},k.makeDefaultLayout());T.settings===void 0&&(T.settings={}),Object.assign(T.settings,a),T.content=[];var y=new Us(T,m.current),O=()=>{y.off("initialised",O),g(!0)};return y.on("initialised",O),u!=null&&y.setFallbackComponent(u),y.init(),_(y),s(y),()=>{y.destroy()}},[a,u,s,g,_]);var S=c.useMemo(()=>rr(()=>{b!=null&&b.isInitialised&&(b==null||b.updateSize())},Xg),[b]);return c.useEffect(function(){return window.addEventListener("resize",S),()=>{window.removeEventListener("resize",S)}},[S]),h.jsxs("div",{className:"dashboard-container w-100 h-100",children:[h.jsx("div",{className:"w-100 h-100",ref:m}),p&&b&&h.jsx(Br.Provider,{value:b,children:h.jsx(Wr,{emptyDashboard:r,id:e,layout:b,layoutConfig:i,onLayoutChange:o,onLayoutInitialized:l,hydrate:d,dehydrate:f,panelWrapper:v,children:t})})]})}var qg="default";const Zg=Object.freeze(Object.defineProperty({__proto__:null,DEFAULT_DASHBOARD_ID:qg,Dashboard:ba,DashboardLayout:Wr,DashboardUtils:mg,GLPropTypes:Ys,LayoutManagerContext:Br,LayoutUtils:k,PanelErrorBoundary:Gs,PanelEvent:ee,PanelManager:mn,SET_DASHBOARD_DATA:Ur,assertIsDashboardPluginProps:lg,canHaveRef:Ks,default:ba,dehydrate:kr,getAllDashboardsData:Js,getClosedPanelsForDashboard:Ng,getDashboardData:Mt,getOpenedPanelMapForDashboard:Lg,hydrate:$r,isDashboardPluginProps:zs,isWrappedComponent:Ct,reducers:Zs,setDashboardData:Qs,updateDashboardData:el,useDashboardPanel:bg,useLayoutManager:yg,useListener:We,usePanelRegistration:qs},Symbol.toStringTag,{value:"Module"}));function Jg(n){var{children:e}=n,{activeThemes:t}=Tt();return c.useEffect(function(){t!=null&&dd.initTheme()},[t]),h.jsx(h.Fragment,{children:e})}function tl(n,e,t){return e=Qg(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Qg(n){var e=eb(n,"string");return typeof e=="symbol"?e:String(e)}function eb(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class ht{static valueForCell(e,t,r){var i="".concat(e,",").concat(t);return r!==void 0&&r&&(i="(".concat(i,")")),i}constructor(e){tl(this,"dh",void 0),this.dh=e}makeColumn(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:ht.DEFAULT_TYPE,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0;return new this.dh.Column({index:r,name:e,type:t})}makeRollupTableConfig(){return new this.dh.RollupTableConfig}makeColumns(){for(var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:5,t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",r=[],i=0;i<e;i+=1)r.push(this.makeColumn("".concat(t).concat(i),ht.DEFAULT_TYPE,i));return r}static makeUserColumnWidths(){for(var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:5,t=new Map,r=0;r<e;r+=1)t.set(r.toString(),100);return t}makeRow(e){var t=new this.dh.Row({index:e,name:"".concat(e)});return t.get=jest.fn(r=>ht.valueForCell(e,r.index)),t}makeFilter(){return new this.dh.FilterCondition}makeSort(){return new this.dh.Sort}makeTable(){var{columns:e=this.makeColumns(),size:t=1e9,sort:r=[],layoutHints:i={}}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},a=new this.dh.Table({columns:e,size:t,sort:r});return a.copy=jest.fn(()=>Promise.resolve(a)),a.freeze=jest.fn(()=>Promise.resolve(a)),a.layoutHints=i,a}makeTreeTable(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.makeColumns(),t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1e9,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[],i=new this.dh.TreeTable({columns:e,size:t,sort:r});return i.copy=jest.fn(()=>Promise.resolve(i)),i}makeInputTable(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];return new this.dh.InputTable(e)}makeSubscription(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.makeTable();return new this.dh.TableViewportSubscription({table:e})}makeModel(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.makeTable(),t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,{dh:i}=this;return new cd(i,e,t??new on(i),r)}}tl(ht,"DEFAULT_TYPE","java.lang.String");const tb=ht;function Ye(n,e,t){return e=nb(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function nb(n){var e=rb(n,"string");return typeof e=="symbol"?e:String(e)}function rb(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var De=H.module("TableViewportUpdater"),ib=150;class Me extends c.PureComponent{constructor(){super(...arguments),Ye(this,"subscription",void 0),Ye(this,"getViewportRowRange",Dn((e,t,r)=>{var i=r-t,a=Math.max(0,t-i*Me.ROW_BUFFER_PAGES),o=r+i*Me.ROW_BUFFER_PAGES;return[a,o]})),Ye(this,"getViewportColumns",Dn((e,t,r,i)=>{if(t==null||r==null)return null;for(var a=r-t,o=Math.max(0,t-a*Me.COLUMN_BUFFER_PAGES),s=Math.min(r+a*Me.COLUMN_BUFFER_PAGES,e.columns.length-1),l=[],u=o;u<=s;u+=1){var d=hd.getModelIndex(u,i);l.push(e.columns[d])}return l})),Ye(this,"updateViewport",rr((e,t,r,i,a)=>{if(t<e){De.error("Invalid viewport",e,t);return}if(e===0&&t===0){De.debug2("Ignoring 0-0 viewport");return}var{movedColumns:o,table:s}=this.props,[l,u]=this.getViewportRowRange(s,e,t),d=a??this.getViewportColumns(s,r,i,o);if(De.debug2("Setting Viewport Top:",l,"Bottom:",u,"Columns:",d),this.subscription==null){De.debug2("updateViewport creating new subscription"),this.subscription=s.setViewport(l,u,d);var{onSubscription:f}=this.props;f(this.subscription)}else De.debug2("updateViewport using existing subscription"),this.subscription.setViewport(l,u,d)},ib))}componentDidMount(){var{top:e,bottom:t,left:r,right:i,table:a,filters:o,sorts:s,columns:l,customColumns:u}=this.props;a.applyFilter(o),a.applySort(s),a.applyCustomColumns(u),this.updateViewport(e,t,r,i,l)}componentDidUpdate(e){var{top:t,bottom:r,left:i,right:a,table:o,filters:s,sorts:l,customColumns:u,columns:d}=this.props,f=s!==e.filters,v=l!==e.sorts,m=u!==e.customColumns,p=o!==e.table;(f||v||m||p)&&this.closeSubscription(),(f||p)&&(De.debug("update table filter",s),o.applyFilter(s)),(v||p)&&(De.debug("update table sort",l),o.applySort(l)),(m||p)&&(De.debug("update table custom columns",u),o.applyCustomColumns(u)),this.updateViewport(t,r,i,a,d)}componentWillUnmount(){this.closeSubscription()}closeSubscription(){if(De.debug2("closeSubscription",this.subscription),this.subscription){this.subscription.close(),this.subscription=void 0;var{onSubscription:e}=this.props;e()}this.updateViewport.cancel()}render(){return null}}Ye(Me,"ROW_BUFFER_PAGES",3);Ye(Me,"COLUMN_BUFFER_PAGES",1);Ye(Me,"defaultProps",{top:0,bottom:0,left:null,right:null,columns:null,onSubscription:()=>{},filters:[],sorts:[],customColumns:[],movedColumns:[]});const ab=Me;function tn(n,e,t){return e=ob(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function ob(n){var e=sb(n,"string");return typeof e=="symbol"?e:String(e)}function sb(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var rt=H.module("TreeTableViewportUpdater"),lb=150;class nn extends c.PureComponent{constructor(e){super(e),tn(this,"listenerCleanup",void 0),tn(this,"updateViewport",rr((t,r)=>{if(r<t){rt.error("Invalid viewport",t,r);return}if(t===0&&r===0){rt.debug2("Ignoring 0-0 viewport");return}var{table:i,updateInterval:a}=this.props,o=r-t,s=Math.max(0,t-o*3),l=r+o*3+1;if(rt.debug2("Setting Viewport Top:",s,"Bottom:",l,i),!this.listenerCleanup){var{dh:u,onViewportUpdate:d}=this.props;this.listenerCleanup=i.addEventListener(u.TreeTable.EVENT_UPDATED,d)}i.setViewport(s,l,void 0,a)},lb)),this.listenerCleanup=null}componentDidMount(){var{top:e,bottom:t,table:r,filters:i,sorts:a}=this.props;rt.debug("componentDidMount",this.props),r.applyFilter(i),r.applySort(a),this.updateViewport(e,t)}componentDidUpdate(e){var{top:t,bottom:r,table:i,filters:a,sorts:o}=this.props;a!==e.filters&&(rt.debug("update table filter",a),i.applyFilter(a)),o!==e.sorts&&(rt.debug("update table sort",o),i.applySort(o)),this.updateViewport(t,r)}componentWillUnmount(){this.updateViewport.cancel(),this.listenerCleanup&&this.listenerCleanup()}render(){return null}}tn(nn,"UPDATE_INTERVAL",1e3);tn(nn,"defaultProps",{top:0,bottom:0,onViewportUpdate:()=>{},filters:[],sorts:[],updateInterval:nn.UPDATE_INTERVAL});const ub=nn,db=Object.freeze(Object.defineProperty({__proto__:null,AdvancedSettings:fd,AdvancedSettingsType:vd,AggregationEdit:md,AggregationUtils:pd,Aggregations:gd,BarIcon:bd,ChartBuilder:yd,ColumnHeaderGroup:_d,CustomColumnBuilder:wd,DownloadServiceWorkerUtils:Sd,FormatColumnWhereIcon:Ed,FormatRowWhereIcon:Cd,HistogramIcon:Pd,InputEditor:Td,IrisGrid:Zr,IrisGridMetricCalculator:Od,IrisGridModel:Id,IrisGridModelFactory:Dd,IrisGridPartitionedTableModel:xd,IrisGridRenderer:Ad,IrisGridTableModel:Md,IrisGridTableModelTemplate:Nd,IrisGridTestUtils:tb,IrisGridThemeContext:Ld,IrisGridThemeProvider:io,IrisGridTreeTableModel:jd,IrisGridUtils:Fd,LineIcon:Rd,OptionType:kd,PieIcon:$d,RollupRows:Bd,SHORTCUTS:Ud,ScatterIcon:Wd,TableCsvExporter:Vd,TableSaver:Hd,TableViewportUpdater:ab,TreeTableViewportUpdater:ub,VisibilityOrderingBuilder:zd,createDefaultIrisGridTheme:Gd,default:Zr,isIrisGridTableModelTemplate:Kd,isPanelStateV1:Xd,isPanelStateV2:Yd,isPartitionedGridModel:qd,isPartitionedGridModelProvider:Zd},Symbol.toStringTag,{value:"Module"}));var nl={react:q,"react-dom":Aa,redux:Pl,"react-redux":Tl,"@adobe/react-spectrum":Ol,"@deephaven/auth-plugins":zv,"@deephaven/chart":_m,"@deephaven/components":yf,"@deephaven/dashboard":Zg,"@deephaven/icons":fu,"@deephaven/iris-grid":db,"@deephaven/jsapi-bootstrap":wf,"@deephaven/jsapi-components":cv,"@deephaven/jsapi-utils":Lf,"@deephaven/log":H,"@deephaven/plugin":yv,"@deephaven/react-hooks":Nc},cb=Il.createRequires(nl),hb=Dl({requires:cb});const fb=hb;function ya(n,e,t,r,i,a,o){try{var s=n[a](o),l=s.value}catch(u){t(u);return}s.done?e(l):Promise.resolve(l).then(r,i)}function Vr(n){return function(){var e=this,t=arguments;return new Promise(function(r,i){var a=n.apply(e,t);function o(l){ya(a,r,i,o,s,"next",l)}function s(l){ya(a,r,i,o,s,"throw",l)}o(void 0)})}}var Ve=H.module("@deephaven/app-utils.PluginUtils");function vb(n){return Qn.apply(this,arguments)}function Qn(){return Qn=Vr(function*(n){var e=yield fb(n);return e}),Qn.apply(this,arguments)}function mb(n){return er.apply(this,arguments)}function er(){return er=Vr(function*(n){var e=yield fetch(n);if(!e.ok)throw new Error(e.statusText);try{return yield e.json()}catch{throw new Error("Could not be parsed as JSON")}}),er.apply(this,arguments)}function pb(n){return tr.apply(this,arguments)}function tr(){return tr=Vr(function*(n){Ve.debug("Loading plugins...");try{var e=yield mb("".concat(n,"/manifest.json"));if(!Array.isArray(e.plugins))throw new Error("Plugin manifest JSON does not contain plugins array");Ve.debug("Plugin manifest loaded:",e);for(var t=[],r=0;r<e.plugins.length;r+=1){var{name:i,main:a}=e.plugins[r],o="".concat(n,"/").concat(i,"/").concat(a);t.push(vb(o))}for(var s=yield Promise.allSettled(t),l=new Map,u=0;u<s.length;u+=1){var d=s[u],{name:f}=e.plugins[u];if(d.status==="fulfilled"){var v,m=ls(d.value)?d.value:(v=d.value.default)!==null&&v!==void 0?v:d.value;m==null?Ve.error("Plugin '".concat(f,"' is missing an exported value.")):l.set(f,m)}else Ve.error("Unable to load plugin '".concat(f,"'"),d.reason)}return Ve.info("Plugins loaded:",l),l}catch(p){return Ve.error("Unable to load plugins:",p),new Map}}),tr.apply(this,arguments)}function gb(n){var e,t;return(e=(t=n.get("AuthHandlers"))===null||t===void 0?void 0:t.split(","))!==null&&e!==void 0?e:[]}function bb(n,e){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:new Map,r=gb(e),i=[...n.entries(),...t.entries()].filter(l=>{var[,u]=l;return us(u)||Zt(u)}).map(l=>{var[u,d]=l;return Zt(d)?{type:Je.AUTH_PLUGIN,name:u,component:d.AuthPlugin.Component,isAvailable:d.AuthPlugin.isAvailable}:d}),a=i.filter(l=>{var{isAvailable:u}=l;return u(r,e)});if(a.length===0)throw new Error("No login plugins found, please register a login plugin for auth handlers: ".concat(r));a.length>1&&Ve.warn("More than one login plugin available, will use the first one: ",a.map(l=>{var{name:u}=l;return u}).join(", "));var{name:o,component:s}=a[0];return Ve.info("Using LoginPlugin",o),s}var yb=Ma.createRequires(()=>nl),_b=Ma.createRemoteComponent({requires:yb});const zb=_b;function _a(n,e,t,r,i,a,o){try{var s=n[a](o),l=s.value}catch(u){t(u);return}s.done?e(l):Promise.resolve(l).then(r,i)}function wb(n){return function(){var e=this,t=arguments;return new Promise(function(r,i){var a=n.apply(e,t);function o(l){_a(a,r,i,o,s,"next",l)}function s(l){_a(a,r,i,o,s,"throw",l)}o(void 0)})}}function Sb(n){var{pluginsUrl:e,getCorePlugins:t,children:r}=n,[i,a]=c.useState(null);return c.useEffect(function(){var s=!1;function l(){return u.apply(this,arguments)}function u(){return u=wb(function*(){var d,f=(d=yield t==null?void 0:t())!==null&&d!==void 0?d:[],v=yield pb(e);if(!s){var m=f.map(p=>[p.name,p]);a(new Map([...m,...v]))}}),u.apply(this,arguments)}return l(),()=>{s=!0}},[e,t]),h.jsx(It.Provider,{value:i,children:r})}function Eb(){var n=Cr();return c.useEffect(function(){n.postMessage(_r(yr))},[n]),null}function wa(n,e,t,r,i,a,o){try{var s=n[a](o),l=s.value}catch(u){t(u);return}s.done?e(l):Promise.resolve(l).then(r,i)}function Cb(n){return function(){var e=this,t=arguments;return new Promise(function(r,i){var a=n.apply(e,t);function o(l){wa(a,r,i,o,s,"next",l)}function s(l){wa(a,r,i,o,s,"throw",l)}o(void 0)})}}var Pb=new Map([["@deephaven/auth-plugins.AuthPluginParent",{AuthPlugin:ps}],["@deephaven/auth-plugins.AuthPluginPsk",{AuthPlugin:_s}],["@deephaven/auth-plugins.AuthPluginAnonymous",{AuthPlugin:ms}]]);function Tb(n){var{children:e}=n,t=Ze(),r=c.useContext(It),[i,a]=c.useState(),[o,s]=c.useState();c.useEffect(function(){var f=!1;function v(){return m.apply(this,arguments)}function m(){return m=Cb(function*(){try{var p=yield t.getAuthConfigValues();f||a(new Map(p))}catch(g){f||s(g)}}),m.apply(this,arguments)}return v(),()=>{f=!0}},[t]);var l=c.useMemo(()=>{if(!(r==null||i==null))try{return bb(r,i,Pb)}catch(d){s(d)}},[i,r]),u=l==null||i==null;return u||o!=null?h.jsx(Pe,{isLoading:u&&o==null,errorMessage:vt(o)}):h.jsx(l,{authConfigValues:i,children:h.jsxs(h.Fragment,{children:[h.jsx(Eb,{}),e]})})}function Sa(n,e,t,r,i,a,o){try{var s=n[a](o),l=s.value}catch(u){t(u);return}s.done?e(l):Promise.resolve(l).then(r,i)}function Ob(n){return function(){var e=this,t=arguments;return new Promise(function(r,i){var a=n.apply(e,t);function o(l){Sa(a,r,i,o,s,"next",l)}function s(l){Sa(a,r,i,o,s,"throw",l)}o(void 0)})}}var Ib=H.module("@deephaven/app-utils.ConnectionBootstrap");function Db(n){var{children:e}=n,t=Te(),r=Ze(),[i,a]=c.useState(),[o,s]=c.useState();return c.useEffect(function(){var u=!1;function d(){return f.apply(this,arguments)}function f(){return f=Ob(function*(){try{var v=yield r.getAsIdeConnection();if(u)return;s(v)}catch(m){if(u)return;a(m)}}),f.apply(this,arguments)}return d(),()=>{u=!0}},[t,r]),c.useEffect(function(){if(o==null)return;function u(f){var{detail:v}=f;Ib.info("Shutdown","".concat(JSON.stringify(v))),a("Server shutdown: ".concat(v??"Unknown reason"))}var d=o.addEventListener(t.IdeConnection.EVENT_SHUTDOWN,u);return d},[t,o]),o==null||i!=null?h.jsx(Pe,{"data-testid":"connection-bootstrap-loading",isLoading:o==null,errorMessage:i!=null?"".concat(i):void 0}):h.jsx(to.Provider,{value:o,children:e})}function Gb(n){return new URL(n,"".concat(window.location))}function xb(){var n=new URLSearchParams(window.location.search);return n.get("envoyPrefix")}function Ab(){var n=xb();return n!=null?{headers:{"envoy-prefix":n}}:{headers:{}}}function Mb(n){var{children:e}=n,t=c.useContext(as);return t?h.jsx(h.Fragment,{children:e}):h.jsx(Pe,{"data-testid":"fonts-loaded-loading"})}function Ea(n,e,t,r,i,a,o){try{var s=n[a](o),l=s.value}catch(u){t(u);return}s.done?e(l):Promise.resolve(l).then(r,i)}function Nb(n){return function(){var e=this,t=arguments;return new Promise(function(r,i){var a=n.apply(e,t);function o(l){Ea(a,r,i,o,s,"next",l)}function s(l){Ea(a,r,i,o,s,"throw",l)}o(void 0)})}}var rl=c.createContext(null);function Lb(n){var{children:e}=n,t=Ze(),[r,i]=c.useState(),[a,o]=c.useState();c.useEffect(function(){var u=!1;function d(){return f.apply(this,arguments)}function f(){return f=Nb(function*(){try{var v=yield t.getServerConfigValues();u||i(new Map(v))}catch(m){u||o(m)}}),f.apply(this,arguments)}return d(),()=>{u=!0}},[t]);var s=r==null;return s||a!=null?h.jsx(Pe,{isLoading:s&&a==null,errorMessage:vt(a)}):h.jsx(rl.Provider,{value:r,children:e})}function jb(){return Pt(rl,"No server config available in useServerConfig. Was code wrapped in ServerConfigBootstrap or ServerConfigContext.Provider?")}function Fb(n){var{children:e}=n,t=jb(),r=c.useContext(ro),i=c.useContext(sn),a=Ss(t,r,i);return h.jsx(no.Provider,{value:a,children:e})}function Rb(n){var{children:e}=n,t=c.useContext(It),r=c.useMemo(()=>t==null?null:cs(t),[t]);return h.jsx(Ga,{themes:r,children:h.jsx(Ps,{children:h.jsx(Jg,{children:h.jsx(io,{children:e})})})})}function Kb(n){var{fontClassNames:e,pluginsUrl:t,getCorePlugins:r,serverUrl:i,children:a}=n,o=c.useMemo(()=>Ab(),[]),[s,l]=c.useState(0),u=c.useCallback(()=>{},[]),d=c.useCallback(()=>{l(f=>f+1)},[]);return hn(u,d),h.jsx(hv,{fontClassNames:e,children:h.jsx(Sb,{getCorePlugins:r,pluginsUrl:t,children:h.jsx(Rb,{children:h.jsx(Bo,{serverUrl:i,options:o,children:h.jsx(es,{children:h.jsx(Tb,{children:h.jsx(Lb,{children:h.jsx(Fb,{children:h.jsx(Db,{children:h.jsx(Mb,{children:a})})})})})})},s)})})})}export{Kb as AppBootstrap,Tb as AuthBootstrap,Db as ConnectionBootstrap,hv as FontBootstrap,Mb as FontsLoaded,as as FontsLoadedContext,Sb as PluginsBootstrap,zb as RemoteComponent,Rb as ThemeBootstrap,gb as getAuthHandlers,bb as getAuthPluginComponent,Gb as getBaseUrl,Ab as getConnectOptions,xb as getEnvoyPrefix,mb as loadJson,vb as loadModulePlugin,pb as loadModulePlugins,jb as useServerConfig,qb as useUser};
|
|
4
|
-
//# sourceMappingURL=index-
|
|
4
|
+
//# sourceMappingURL=index-2189151d.js.map
|