@deephaven/embed-grid 0.53.1-beta.5 → 0.53.1-beta.8

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.
@@ -1,4 +1,4 @@
1
- import{C as h,$ as Qs,H as _a,I as Zn,F as we,J as wa,r as c,K as Ze,L as Ee,M as el,N as Sa,O as tl,P as Ca,Q as nl,S as rl,T as Gr,U as at,G as z,E as G,V as C,W as il,D as Vt,X as al,Y as ol,Z as sl,_ as ll,a0 as ul,a1 as dl,a2 as ft,a3 as Ea,a4 as Ve,a5 as En,a6 as A,R as Pa,a7 as Kr,a8 as cl,a9 as hl,aa as fl,ab as Jn,ac as ml,ad as pl,ae as vl,af as gl,ag as bl,ah as Ta}from"./vendor-a731ce4c.js";import{L as B,i as yl,v as Oa,M as Qn,b as er,c as Ia,d as Da,e as _l,f as wl,T as Je,g as ze,h as Sl,j as Cl,k as El,l as xa,m as Aa,D as Ma,n as Na,o as La,s as ja,p as Pl,C as Tl,q as Ol,r as Il,a as je,t as Fa,N as Dl,u as xl,w as Al,W as Ml,x as Nl,y as Ra,z as $a,A as Ll,B as ka,E as jl,F as Fl,G as Rl,H as tr,I as $l,J as kl,K as Bl,O as Ul,P as Wl,Q as Hl}from"./index-91182ad5.js";import{g as Vl,c as pt,d as zl,e as Gl,h as Ba,P as nr,B as Ne,T as _t,M as rr,D as Ua,i as Wa,j as Kl,S as ir,R as Xr,k as Pn,l as Tn,m as Ha,n as Xl,o as Yl,p as ql,q as Zl,C as Jl,r as Ql,s as eu,t as tu,v as nu,G as ru,w as iu,K as au,x as ou,y as su,z as lu,O as uu,A as du,E as cu,F as hu,H as fu,J as Va,L as mu,N as pu,Q as vu,U as gu,V as bu,W as yu,X as _u,Y as wu,Z as Su,_ as Cu,$ as za,a0 as Eu,a1 as Pu,a2 as Tu,a3 as en,a4 as ut,a5 as Ou,a6 as Iu,a7 as Du,a8 as St,a9 as xu,aa as ar,ab as Au,ac as Ga,ad as Ka,ae as or,af as sr,ag as Xa,ah as Ya,ai as qa,f as Mu,aj as Za,ak as Nu,al as Lu,am as lr,an as zt,ao as ju,ap as Ja,aq as Yr,ar as Fu,as as Ru,at as Qa,u as $u,au as ku,av as tn,aw as eo,ax as to,ay as Bu,az as Uu,I as qr,aA as Wu,aB as Hu,aC as Vu,aD as zu,aE as Gu,aF as Ku,aG as Xu,aH as Yu,aI as qu,aJ as Zu,aK as Ju,aL as Qu,aM as ed,aN as td,aO as nd,aP as rd,b as id,aQ as ad,aR as od,aS as sd,aT as ld,aU as ud,aV as dd,aW as cd,aX as hd,aY as fd,aZ as md,a_ as pd,a$ as vd,b0 as gd,b1 as bd,b2 as yd,b3 as _d,b4 as wd,b5 as Sd}from"./useUser-00f76174.js";import{a as bb}from"./useUser-00f76174.js";import{c as cn,P as ur,b as Cd,h as Ed,p as Pd,o as Td,s as Od,t as Id}from"./plotly-7ff7609c.js";import"./helpers-042e6b4d.js";import"./monaco-9eb7d7d5.js";function mt(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 no=24,Dd=32,xd=33,Ad=150,ro=200,io=500,ao=250,Md={spellCheck:!1},Nd=["ariaLabel","icon","isQuiet","labelText","children","onOpenChange"];function Zr(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 Jr(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Zr(Object(t),!0).forEach(function(r){Ld(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Zr(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function Ld(n,e,t){return e=jd(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function jd(n){var e=Fd(n,"string");return typeof e=="symbol"?e:String(e)}function Fd(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 Rd(n,e){if(n==null)return{};var t=$d(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 $d(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 oo(n){var{ariaLabel:e,icon:t,isQuiet:r,labelText:i,children:a,onOpenChange:o}=n,s=Rd(n,Nd);return h.jsxs(Qs,{type:"popover",onOpenChange:o,children:[h.jsxs(_a,Jr(Jr({},s),{},{"aria-label":e??i,isQuiet:r,children:[h.jsx(Zn,{children:h.jsx(we,{icon:t})}),i==null?null:h.jsx(wa,{children:i})]})),a]})}function kd(n,e){return n===0?0:e==="all"||n===e.size?"all":e.size}function so(n,e){return n===e?!0:n==="all"||e==="all"||n.size!==e.size?!1:[...n.keys()].every(t=>e.has(t))}function lo(n,e){return n.isInverted===e.isInverted&&so(n.selection,e.selection)}function uo(n,e,t){if(n==="all")return"all";var r=[...n.keys()];return new Set(r.map(i=>t(e(i))))}function co(n,e){var t=n==="all"||n.size>e/2,r=n;return t&&(r=n==="all"?new Set:new Set([...Vl(0,e-1)].filter(i=>!n.has(String(i))).map(i=>String(i)))),{selection:r,isInverted:t}}function Bd(n,e){return n?{}:{errorMessage:e,validationState:"invalid"}}function ho(n){var e;return(e=n==null?void 0:n.UNSAFE_getDOMNode())!==null&&e!==void 0?e:null}function Ud(n){var e=n==null?void 0:n.UNSAFE_getDOMNode().lastElementChild;return fo(e)}function Wd(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 fo(n){return n instanceof HTMLElement?n:null}function mo(){var n=c.useRef(!1);return c.useEffect(()=>(n.current=!0,()=>{n.current=!1}),[]),n}function Qr(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 Hd(n){return function(){var e=this,t=arguments;return new Promise(function(r,i){var a=n.apply(e,t);function o(l){Qr(a,r,i,o,s,"next",l)}function s(l){Qr(a,r,i,o,s,"throw",l)}o(void 0)})}}var hn=B.module("useAsyncInterval");function Vd(n,e){var t=mo(),r=c.useRef(0),i=c.useRef(0),a=c.useRef(null),o=c.useCallback(Hd(function*(){var s=Date.now();i.current+=1;var l=a.current==null?e:s-a.current;if(hn.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);hn.debug("Next tick target:",e,", overage",u,", adjusted:",d),r.current=window.setTimeout(o,d)}}),[n,t,e]);c.useEffect(()=>(hn.debug("Setting target interval:",e),a.current=null,o(),()=>{window.clearTimeout(r.current)}),[e,o])}function zd(n,e){return c.useCallback(function(){var t=n(...arguments);return e(),t},[e,n])}function Gt(n,e){var t=c.useMemo(()=>Ze(n,e),[n,e]);return c.useEffect(()=>()=>t.cancel(),[t]),t}function Gd(n){var[e,t]=c.useState(n);return c.useEffect(()=>{t(n)},[n]),[e,t]}function Kd(n,e,t,r){var i=c.useRef(0);c.useEffect(()=>{i.current>=t||r&&(i.current+=1,n())},[t,r,...e])}function po(n,e){var t=c.useRef(n),r=e(t.current,n)?t.current:n;return t.current=r,r}function Xd(n){n.preventDefault()}function vo(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,e=c.useMemo(()=>"useSubmitButtonRef-".concat(Ee()),[]),t=c.useCallback(a=>{a==null||a.UNSAFE_getDOMNode().setAttribute("form",e)},[e]),r=c.useMemo(()=>({id:e,onSubmit:n?void 0:Xd}),[e,n]),i=c.useMemo(()=>({form:e,ref:t}),[e,t]);return{formProps:r,submitButtonProps:i}}function go(n,e){return c.useCallback(t=>{typeof n=="function"?n(e(t)):n.current=e(t)},[e,n])}function bo(n,e){var{getItem:t,selectedKeys:r,items:i}=n;return c.useMemo(()=>{var{selection:a,isInverted:o}=co(r,i.length);return{selection:uo(a,t,e),isInverted:o}},[r,i.length,t,e])}function Yd(n){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:yl,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 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 qd(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)})}}function Zd(n,e,t){var r=c.useRef(null),[i,a]=c.useState(null),o=c.useCallback(qd(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 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 Jd(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 Et(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(Jd(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 ni(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 ri(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?ni(Object(t),!0).forEach(function(r){Qd(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):ni(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function Qd(n,e,t){return e=ec(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function ec(n){var e=tc(n,"string");return typeof e=="symbol"?e:String(e)}function tc(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 nc(n,e,t,r){var i=arguments.length===4;return c.useCallback(a=>{var o=i?a??r:a;t(ri(ri({},n),{},{[e]:o}))},[t,n,e,i,r])}function yo(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 nn(n,e){var[t,r]=c.useState(n);return c.useEffect(()=>{var i=setTimeout(()=>{r(n)},e);return()=>{clearTimeout(i)}},[n,e]),t}function _o(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 rc(n){var e=_o(Md,n);return go(e,ho)}function wo(){var{getKey:n=So}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},[e,t]=c.useState([]),[r,i]=c.useState(()=>new Set),a=c.useCallback(v=>g=>n(g)===v,[n]),o=c.useCallback(v=>{var g;return(g=e.find(a(v)))!==null&&g!==void 0?g:null},[e,a]),s=c.useCallback(v=>{var g=o(v);if(g==null)throw new Error("No item found matching key: ".concat(v));return g},[o]),l=c.useCallback(v=>{t(g=>[...g,...v])},[]),u=c.useCallback((v,g)=>{t(b=>[...b.slice(0,v),...g,...b.slice(v)])},[]),d=c.useCallback(v=>{var g=new Set(v);t(b=>b.filter(_=>!g.has(n(_))))},[n]),f=c.useCallback((v,g)=>{var b=e.findIndex(a(v));b!==-1&&t(_=>[..._.slice(0,b),g,..._.slice(b+1)])},[e,a]),m=c.useCallback(v=>{if(v.size!==0){var g=[],b=new Map;for(var _ of v.keys()){var w=e.findIndex(a(_));g.push(w),b.set(w,_)}g.sort((P,S)=>P-S);var y=[];e.forEach((P,S)=>{if(g[0]===S){var D=b.get(g.shift()),O=v.get(D);y.push(O)}else y.push(P)}),t(y)}},[e,a]),p=c.useMemo(()=>({items:e,selectedKeys:r,append:l,bulkUpdate:m,findItem:o,getItem:s,insert:u,remove:d,setItems:t,setSelectedKeys:i,update:f}),[l,m,o,s,u,e,d,t,r,f]);return p}function So(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 ic(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 ac=Object.freeze(Object.defineProperty({__proto__:null,createValidationProps:Bd,defaultGetKey:So,extractSpectrumHTMLElement:ho,extractSpectrumLastChildHTMLElement:Ud,findSpectrumComboBoxScrollArea:Wd,getSelectedItemCountOrAll:kd,identityExtractHTMLElement:fo,isSelectionEqual:so,isSelectionMaybeInvertedEqual:lo,mapSelection:uo,optimizeSelection:co,useAsyncInterval:Vd,useCallbackWithAction:zd,useContextOrThrow:pt,useCopyToClipboard:zl,useDebouncedCallback:Gt,useDebouncedValue:nn,useDependentState:Gd,useEffectNTimesWhen:Kd,useFormWithDetachedSubmitButton:vo,useForwardedRef:Gl,useIsEqualMemo:po,useIsMountedRef:mo,useMappedRef:go,useMappedSelection:bo,useOnScrollOffsetChangeCallback:yo,useOnScrollRef:Yd,usePopoverOnScrollRef:Zd,usePrevious:Ba,usePromiseFactory:Et,usePropChangeCallback:nc,useResizeObserver:ic,useSetAttributesCallback:_o,useSpectrumDisableSpellcheckRef:rc,useWindowedListData:wo},Symbol.toStringTag,{value:"Module"})),oc="_spectrumActionBar_tmmkp_5",sc="_spectrumDialogComponentHeading_tmmkp_9",lc="_spectrumEllipsis_tmmkp_14",dr={spectrumActionBar:oc,spectrumDialogComponentHeading:sc,spectrumEllipsis:lc};function ii(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?ii(Object(t),!0).forEach(function(r){uc(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):ii(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 Co(n){var{heading:e,confirmationButtonLabel:t,children:r,onCancel:i,onConfirm:a}=n,{formProps:o,submitButtonProps:s}=vo();return h.jsxs(el,{children:[h.jsx(Sa,{level:3,UNSAFE_className:dr.spectrumDialogComponentHeading,children:e}),h.jsx(tl,{}),h.jsx(Ca,{children:h.jsx(nl,Lt(Lt({},o),{},{children:r}))}),h.jsxs(rl,{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 hc(n){var{ariaLabel:e,heading:t,confirmationButtonLabel:r,isHidden:i,children:a,onConfirm:o}=n,s=c.useCallback(l=>h.jsx(Co,{heading:t,confirmationButtonLabel:r,onCancel:l,onConfirm:()=>{l(),o()},children:a}),[a,r,t,o]);return h.jsx(oo,{ariaLabel:e,icon:Oa,isHidden:i,isQuiet:!0,height:no,children:s})}var fc=["icon","label"];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 oi(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){mc(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 mc(n,e,t){return e=pc(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function pc(n){var e=vc(n,"string");return typeof e=="symbol"?e:String(e)}function vc(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 gc(n,e){if(n==null)return{};var t=bc(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 bc(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 Eo(n){var{icon:e,label:t}=n,r=gc(n,fc);return h.jsx(_a,oi(oi({},r),{},{"aria-label":t,isQuiet:!0,height:no,children:h.jsx(Zn,{children:h.jsx(we,{icon:e})})}))}Eo.displayName="IconActionButton";function si(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 yc(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?si(Object(t),!0).forEach(function(r){Ae(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):si(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function Ae(n,e,t){return e=_c(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function _c(n){var e=wc(n,"string");return typeof e=="symbol"?e:String(e)}function wc(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 Sc=100,On;(function(n){n.UP="UP",n.DOWN="DOWN"})(On||(On={}));class _e 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",at((r,i)=>r.filter(a=>a.title.toLowerCase().indexOf(i.toLowerCase())>=0)));var{popperOptions:t}=this.props;t=yc({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=Ze(this.updateInputValue,Sc),this.handleOptionClick=this.handleOptionClick.bind(this),this.handleMenuOpened=this.handleMenuOpened.bind(this),this.handleMenuExited=this.handleMenuExited.bind(this),this.popper=z.createRef(),this.cbContainer=z.createRef(),this.menuContainer=z.createRef(),this.input=z.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(_e.MENU_NAVIGATION_DIRECTION.UP);break;case"ArrowDown":e.stopPropagation(),e.preventDefault(),this.navigateMenu(_e.MENU_NAVIGATION_DIRECTION.DOWN);break;case"Tab":if(e.stopPropagation(),e.preventDefault(),e.shiftKey){this.navigateMenu(_e.MENU_NAVIGATION_DIRECTION.UP);break}this.navigateMenu(_e.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===_e.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===_e.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:G("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:G("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:G("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(nr,{ref:this.popper,options:d,className:G("aci-options-popper interactive"),onEntered:this.handleMenuOpened,onExited:this.handleMenuExited,children:this.renderMenuElement()})]})}}Ae(_e,"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(_e,"defaultProps",{onChange(){},inputPlaceholder:"",disabled:!1,className:"",defaultTitle:"",popperOptions:null,spellCheck:!0,onEnter(){},noMatchText:"No matching items found","data-testid":void 0});Ae(_e,"MENU_NAVIGATION_DIRECTION",On);const Cc=_e;function cr(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),[m,p]=c.useState(!1),v=c.useRef(null);c.useEffect(function(){f(t)},[t]);function g(O){return O.trim().split(s).filter(M=>M).join(`
1
+ import{C as h,$ as Qs,H as _a,I as Zn,F as we,J as wa,r as c,K as Ze,L as Ee,M as el,N as Sa,O as tl,P as Ca,Q as nl,S as rl,T as Gr,U as at,G as z,E as G,V as C,W as il,D as Vt,X as al,Y as ol,Z as sl,_ as ll,a0 as ul,a1 as dl,a2 as ft,a3 as Ea,a4 as Ve,a5 as En,a6 as A,R as Pa,a7 as Kr,a8 as cl,a9 as hl,aa as fl,ab as Jn,ac as ml,ad as pl,ae as vl,af as gl,ag as bl,ah as Ta}from"./vendor-a731ce4c.js";import{L as B,i as yl,v as Oa,M as Qn,b as er,c as Ia,d as Da,e as _l,f as wl,T as Je,g as ze,h as Sl,j as Cl,k as El,l as xa,m as Aa,D as Ma,n as Na,o as La,s as ja,p as Pl,C as Tl,q as Ol,r as Il,a as je,t as Fa,N as Dl,u as xl,w as Al,W as Ml,x as Nl,y as Ra,z as $a,A as Ll,B as ka,E as jl,F as Fl,G as Rl,H as tr,I as $l,J as kl,K as Bl,O as Ul,P as Wl,Q as Hl}from"./index-73a917f5.js";import{g as Vl,c as pt,d as zl,e as Gl,h as Ba,P as nr,B as Ne,T as _t,M as rr,D as Ua,i as Wa,j as Kl,S as ir,R as Xr,k as Pn,l as Tn,m as Ha,n as Xl,o as Yl,p as ql,q as Zl,C as Jl,r as Ql,s as eu,t as tu,v as nu,G as ru,w as iu,K as au,x as ou,y as su,z as lu,O as uu,A as du,E as cu,F as hu,H as fu,J as Va,L as mu,N as pu,Q as vu,U as gu,V as bu,W as yu,X as _u,Y as wu,Z as Su,_ as Cu,$ as za,a0 as Eu,a1 as Pu,a2 as Tu,a3 as en,a4 as ut,a5 as Ou,a6 as Iu,a7 as Du,a8 as St,a9 as xu,aa as ar,ab as Au,ac as Ga,ad as Ka,ae as or,af as sr,ag as Xa,ah as Ya,ai as qa,f as Mu,aj as Za,ak as Nu,al as Lu,am as lr,an as zt,ao as ju,ap as Ja,aq as Yr,ar as Fu,as as Ru,at as Qa,u as $u,au as ku,av as tn,aw as eo,ax as to,ay as Bu,az as Uu,I as qr,aA as Wu,aB as Hu,aC as Vu,aD as zu,aE as Gu,aF as Ku,aG as Xu,aH as Yu,aI as qu,aJ as Zu,aK as Ju,aL as Qu,aM as ed,aN as td,aO as nd,aP as rd,b as id,aQ as ad,aR as od,aS as sd,aT as ld,aU as ud,aV as dd,aW as cd,aX as hd,aY as fd,aZ as md,a_ as pd,a$ as vd,b0 as gd,b1 as bd,b2 as yd,b3 as _d,b4 as wd,b5 as Sd}from"./useUser-5337e19b.js";import{a as bb}from"./useUser-5337e19b.js";import{c as cn,P as ur,b as Cd,h as Ed,p as Pd,o as Td,s as Od,t as Id}from"./plotly-7ff7609c.js";import"./helpers-042e6b4d.js";import"./monaco-9eb7d7d5.js";function mt(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 no=24,Dd=32,xd=33,Ad=150,ro=200,io=500,ao=250,Md={spellCheck:!1},Nd=["ariaLabel","icon","isQuiet","labelText","children","onOpenChange"];function Zr(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 Jr(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Zr(Object(t),!0).forEach(function(r){Ld(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Zr(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function Ld(n,e,t){return e=jd(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function jd(n){var e=Fd(n,"string");return typeof e=="symbol"?e:String(e)}function Fd(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 Rd(n,e){if(n==null)return{};var t=$d(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 $d(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 oo(n){var{ariaLabel:e,icon:t,isQuiet:r,labelText:i,children:a,onOpenChange:o}=n,s=Rd(n,Nd);return h.jsxs(Qs,{type:"popover",onOpenChange:o,children:[h.jsxs(_a,Jr(Jr({},s),{},{"aria-label":e??i,isQuiet:r,children:[h.jsx(Zn,{children:h.jsx(we,{icon:t})}),i==null?null:h.jsx(wa,{children:i})]})),a]})}function kd(n,e){return n===0?0:e==="all"||n===e.size?"all":e.size}function so(n,e){return n===e?!0:n==="all"||e==="all"||n.size!==e.size?!1:[...n.keys()].every(t=>e.has(t))}function lo(n,e){return n.isInverted===e.isInverted&&so(n.selection,e.selection)}function uo(n,e,t){if(n==="all")return"all";var r=[...n.keys()];return new Set(r.map(i=>t(e(i))))}function co(n,e){var t=n==="all"||n.size>e/2,r=n;return t&&(r=n==="all"?new Set:new Set([...Vl(0,e-1)].filter(i=>!n.has(String(i))).map(i=>String(i)))),{selection:r,isInverted:t}}function Bd(n,e){return n?{}:{errorMessage:e,validationState:"invalid"}}function ho(n){var e;return(e=n==null?void 0:n.UNSAFE_getDOMNode())!==null&&e!==void 0?e:null}function Ud(n){var e=n==null?void 0:n.UNSAFE_getDOMNode().lastElementChild;return fo(e)}function Wd(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 fo(n){return n instanceof HTMLElement?n:null}function mo(){var n=c.useRef(!1);return c.useEffect(()=>(n.current=!0,()=>{n.current=!1}),[]),n}function Qr(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 Hd(n){return function(){var e=this,t=arguments;return new Promise(function(r,i){var a=n.apply(e,t);function o(l){Qr(a,r,i,o,s,"next",l)}function s(l){Qr(a,r,i,o,s,"throw",l)}o(void 0)})}}var hn=B.module("useAsyncInterval");function Vd(n,e){var t=mo(),r=c.useRef(0),i=c.useRef(0),a=c.useRef(null),o=c.useCallback(Hd(function*(){var s=Date.now();i.current+=1;var l=a.current==null?e:s-a.current;if(hn.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);hn.debug("Next tick target:",e,", overage",u,", adjusted:",d),r.current=window.setTimeout(o,d)}}),[n,t,e]);c.useEffect(()=>(hn.debug("Setting target interval:",e),a.current=null,o(),()=>{window.clearTimeout(r.current)}),[e,o])}function zd(n,e){return c.useCallback(function(){var t=n(...arguments);return e(),t},[e,n])}function Gt(n,e){var t=c.useMemo(()=>Ze(n,e),[n,e]);return c.useEffect(()=>()=>t.cancel(),[t]),t}function Gd(n){var[e,t]=c.useState(n);return c.useEffect(()=>{t(n)},[n]),[e,t]}function Kd(n,e,t,r){var i=c.useRef(0);c.useEffect(()=>{i.current>=t||r&&(i.current+=1,n())},[t,r,...e])}function po(n,e){var t=c.useRef(n),r=e(t.current,n)?t.current:n;return t.current=r,r}function Xd(n){n.preventDefault()}function vo(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,e=c.useMemo(()=>"useSubmitButtonRef-".concat(Ee()),[]),t=c.useCallback(a=>{a==null||a.UNSAFE_getDOMNode().setAttribute("form",e)},[e]),r=c.useMemo(()=>({id:e,onSubmit:n?void 0:Xd}),[e,n]),i=c.useMemo(()=>({form:e,ref:t}),[e,t]);return{formProps:r,submitButtonProps:i}}function go(n,e){return c.useCallback(t=>{typeof n=="function"?n(e(t)):n.current=e(t)},[e,n])}function bo(n,e){var{getItem:t,selectedKeys:r,items:i}=n;return c.useMemo(()=>{var{selection:a,isInverted:o}=co(r,i.length);return{selection:uo(a,t,e),isInverted:o}},[r,i.length,t,e])}function Yd(n){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:yl,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 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 qd(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)})}}function Zd(n,e,t){var r=c.useRef(null),[i,a]=c.useState(null),o=c.useCallback(qd(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 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 Jd(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 Et(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(Jd(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 ni(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 ri(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?ni(Object(t),!0).forEach(function(r){Qd(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):ni(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function Qd(n,e,t){return e=ec(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function ec(n){var e=tc(n,"string");return typeof e=="symbol"?e:String(e)}function tc(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 nc(n,e,t,r){var i=arguments.length===4;return c.useCallback(a=>{var o=i?a??r:a;t(ri(ri({},n),{},{[e]:o}))},[t,n,e,i,r])}function yo(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 nn(n,e){var[t,r]=c.useState(n);return c.useEffect(()=>{var i=setTimeout(()=>{r(n)},e);return()=>{clearTimeout(i)}},[n,e]),t}function _o(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 rc(n){var e=_o(Md,n);return go(e,ho)}function wo(){var{getKey:n=So}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},[e,t]=c.useState([]),[r,i]=c.useState(()=>new Set),a=c.useCallback(v=>g=>n(g)===v,[n]),o=c.useCallback(v=>{var g;return(g=e.find(a(v)))!==null&&g!==void 0?g:null},[e,a]),s=c.useCallback(v=>{var g=o(v);if(g==null)throw new Error("No item found matching key: ".concat(v));return g},[o]),l=c.useCallback(v=>{t(g=>[...g,...v])},[]),u=c.useCallback((v,g)=>{t(b=>[...b.slice(0,v),...g,...b.slice(v)])},[]),d=c.useCallback(v=>{var g=new Set(v);t(b=>b.filter(_=>!g.has(n(_))))},[n]),f=c.useCallback((v,g)=>{var b=e.findIndex(a(v));b!==-1&&t(_=>[..._.slice(0,b),g,..._.slice(b+1)])},[e,a]),m=c.useCallback(v=>{if(v.size!==0){var g=[],b=new Map;for(var _ of v.keys()){var w=e.findIndex(a(_));g.push(w),b.set(w,_)}g.sort((P,S)=>P-S);var y=[];e.forEach((P,S)=>{if(g[0]===S){var D=b.get(g.shift()),O=v.get(D);y.push(O)}else y.push(P)}),t(y)}},[e,a]),p=c.useMemo(()=>({items:e,selectedKeys:r,append:l,bulkUpdate:m,findItem:o,getItem:s,insert:u,remove:d,setItems:t,setSelectedKeys:i,update:f}),[l,m,o,s,u,e,d,t,r,f]);return p}function So(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 ic(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 ac=Object.freeze(Object.defineProperty({__proto__:null,createValidationProps:Bd,defaultGetKey:So,extractSpectrumHTMLElement:ho,extractSpectrumLastChildHTMLElement:Ud,findSpectrumComboBoxScrollArea:Wd,getSelectedItemCountOrAll:kd,identityExtractHTMLElement:fo,isSelectionEqual:so,isSelectionMaybeInvertedEqual:lo,mapSelection:uo,optimizeSelection:co,useAsyncInterval:Vd,useCallbackWithAction:zd,useContextOrThrow:pt,useCopyToClipboard:zl,useDebouncedCallback:Gt,useDebouncedValue:nn,useDependentState:Gd,useEffectNTimesWhen:Kd,useFormWithDetachedSubmitButton:vo,useForwardedRef:Gl,useIsEqualMemo:po,useIsMountedRef:mo,useMappedRef:go,useMappedSelection:bo,useOnScrollOffsetChangeCallback:yo,useOnScrollRef:Yd,usePopoverOnScrollRef:Zd,usePrevious:Ba,usePromiseFactory:Et,usePropChangeCallback:nc,useResizeObserver:ic,useSetAttributesCallback:_o,useSpectrumDisableSpellcheckRef:rc,useWindowedListData:wo},Symbol.toStringTag,{value:"Module"})),oc="_spectrumActionBar_tmmkp_5",sc="_spectrumDialogComponentHeading_tmmkp_9",lc="_spectrumEllipsis_tmmkp_14",dr={spectrumActionBar:oc,spectrumDialogComponentHeading:sc,spectrumEllipsis:lc};function ii(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?ii(Object(t),!0).forEach(function(r){uc(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):ii(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 Co(n){var{heading:e,confirmationButtonLabel:t,children:r,onCancel:i,onConfirm:a}=n,{formProps:o,submitButtonProps:s}=vo();return h.jsxs(el,{children:[h.jsx(Sa,{level:3,UNSAFE_className:dr.spectrumDialogComponentHeading,children:e}),h.jsx(tl,{}),h.jsx(Ca,{children:h.jsx(nl,Lt(Lt({},o),{},{children:r}))}),h.jsxs(rl,{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 hc(n){var{ariaLabel:e,heading:t,confirmationButtonLabel:r,isHidden:i,children:a,onConfirm:o}=n,s=c.useCallback(l=>h.jsx(Co,{heading:t,confirmationButtonLabel:r,onCancel:l,onConfirm:()=>{l(),o()},children:a}),[a,r,t,o]);return h.jsx(oo,{ariaLabel:e,icon:Oa,isHidden:i,isQuiet:!0,height:no,children:s})}var fc=["icon","label"];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 oi(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){mc(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 mc(n,e,t){return e=pc(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function pc(n){var e=vc(n,"string");return typeof e=="symbol"?e:String(e)}function vc(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 gc(n,e){if(n==null)return{};var t=bc(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 bc(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 Eo(n){var{icon:e,label:t}=n,r=gc(n,fc);return h.jsx(_a,oi(oi({},r),{},{"aria-label":t,isQuiet:!0,height:no,children:h.jsx(Zn,{children:h.jsx(we,{icon:e})})}))}Eo.displayName="IconActionButton";function si(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 yc(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?si(Object(t),!0).forEach(function(r){Ae(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):si(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function Ae(n,e,t){return e=_c(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function _c(n){var e=wc(n,"string");return typeof e=="symbol"?e:String(e)}function wc(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 Sc=100,On;(function(n){n.UP="UP",n.DOWN="DOWN"})(On||(On={}));class _e 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",at((r,i)=>r.filter(a=>a.title.toLowerCase().indexOf(i.toLowerCase())>=0)));var{popperOptions:t}=this.props;t=yc({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=Ze(this.updateInputValue,Sc),this.handleOptionClick=this.handleOptionClick.bind(this),this.handleMenuOpened=this.handleMenuOpened.bind(this),this.handleMenuExited=this.handleMenuExited.bind(this),this.popper=z.createRef(),this.cbContainer=z.createRef(),this.menuContainer=z.createRef(),this.input=z.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(_e.MENU_NAVIGATION_DIRECTION.UP);break;case"ArrowDown":e.stopPropagation(),e.preventDefault(),this.navigateMenu(_e.MENU_NAVIGATION_DIRECTION.DOWN);break;case"Tab":if(e.stopPropagation(),e.preventDefault(),e.shiftKey){this.navigateMenu(_e.MENU_NAVIGATION_DIRECTION.UP);break}this.navigateMenu(_e.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===_e.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===_e.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:G("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:G("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:G("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(nr,{ref:this.popper,options:d,className:G("aci-options-popper interactive"),onEntered:this.handleMenuOpened,onExited:this.handleMenuExited,children:this.renderMenuElement()})]})}}Ae(_e,"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(_e,"defaultProps",{onChange(){},inputPlaceholder:"",disabled:!1,className:"",defaultTitle:"",popperOptions:null,spellCheck:!0,onEnter(){},noMatchText:"No matching items found","data-testid":void 0});Ae(_e,"MENU_NAVIGATION_DIRECTION",On);const Cc=_e;function cr(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),[m,p]=c.useState(!1),v=c.useRef(null);c.useEffect(function(){f(t)},[t]);function g(O){return O.trim().split(s).filter(M=>M).join(`
2
2
  `.concat(s.trim()))}function b(O){return O.split(`
3
3
  `).map(M=>M.trim()).join(" ")}function _(){if(v.current){v.current.style.height="0";var O=v.current.scrollHeight+(v.current.offsetHeight-v.current.clientHeight);O>0&&(v.current.style.height="".concat(O,"px"))}}function w(O){var M=O.target.value;m&&(s&&(M=g(M)),p(!1)),f(M),r(M)}function y(){v.current&&(s&&(f(g(d)),_()),v.current.scrollLeft=0)}function P(){v.current&&document.activeElement!==v.current&&v.current.focus()}function S(){s&&(f(b(d)),r(b(d)))}function D(){p(!0)}return c.useEffect(function(){_()},[d]),h.jsx("textarea",{ref:v,id:l,className:G(e,"auto-resize-textarea form-control"),placeholder:a,value:d,rows:1,onChange:w,onFocus:y,onMouseDown:P,onBlur:S,onPaste:D,spellCheck:i,disabled:o,"data-testid":u})}cr.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};cr.defaultProps={className:"",id:"",placeholder:"",disabled:!1,spellCheck:!1,delimiter:"","data-testid":void 0};function It(n){var{children:e,className:t,style:r,"data-testid":i}=n;return h.jsx("div",{className:G("btn-group",t),style:r,role:"group","data-testid":i,children:e})}It.displayName="ButtonGroup";It.propTypes={children:C.node.isRequired,className:C.string,style:C.object,"data-testid":C.string};It.defaultProps={className:null,style:{},"data-testid":void 0};function Ec(n){var{blockInteraction:e=!0,children:t,debounceMs:r,isOpen:i=!1}=n,a=nn(i,r);return h.jsxs(h.Fragment,{children:[e&&i&&h.jsx("div",{className:"modal-backdrop",style:{backgroundColor:"transparent"},"data-testid":"debounced-modal-backdrop"}),z.cloneElement(t,{isOpen:i&&a})]})}function Pc(n){var{className:e,icon:t,isOpen:r=!1,subtitle:i,title:a}=n;return h.jsx(Qn,{isOpen:r,className:e,children:h.jsx(er,{children:h.jsxs("div",{className:"info-modal",children:[t!=null&&h.jsx("div",{className:"message-icon",children:h.jsx(we,{icon:t})}),h.jsx("div",{className:"message-header",children:a}),i!=null&&h.jsx("div",{className:"message-content",children:i})]})})})}function Po(n){var{className:e="modal-footer",children:t,"data-testid":r}=n;return h.jsx("div",{className:e,"data-testid":r,children:t})}function hr(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:m,"data-testid":p}=n,v=c.useRef(null),g=c.useRef(null),b=c.useCallback(()=>{g.current!==null&&g.current.checked&&s&&s(),a()},[a,s]),_=c.useCallback(()=>{var y;(y=v.current)===null||y===void 0||y.focus()},[]),w="";return e&&(w=typeof r=="function"?r():r),h.jsxs(Qn,{isOpen:e,className:"theme-bg-light",onOpened:_,children:[h.jsx(Ia,{closeButton:!1,children:t}),h.jsx(er,{children:w}),h.jsxs(Po,{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":p!==void 0?"".concat(p,"-checkbox-confirm"):void 0}),h.jsx("label",{className:"custom-control-label",htmlFor:"move-confirmation-checkbox",children:"Don't ask me again"})]}),o&&h.jsx(Ne,{kind:"secondary",className:"mr-auto","data-dismiss":"modal",onClick:o,"data-testid":p!==void 0?"".concat(p,"-btn-discard"):void 0,children:d}),i&&h.jsx(Ne,{kind:"secondary","data-dismiss":"modal",onClick:i,"data-testid":p!==void 0?"".concat(p,"-btn-cancel"):void 0,children:l}),h.jsxs(It,{children:[h.jsx(Ne,{kind:f?"danger":"primary",onClick:b,ref:v,"data-testid":p!==void 0?"".concat(p,"-btn-confirm"):void 0,children:u}),m]})]})]})}hr.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};hr.defaultProps={children:void 0,cancelButtonText:"Cancel",confirmButtonText:"Okay",discardButtonText:"Discard",onCancel:void 0,onDiscard:void 0,onModalDisable:void 0,"data-testid":void 0};var rn=z.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:G("btn",r),onClick:a,style:o,disabled:i,id:s,children:t})});rn.displayName="Button";rn.propTypes={children:C.node,className:C.string,disabled:C.bool,onClick:C.func,style:C.shape({}),id:C.string};rn.defaultProps={children:null,className:"",disabled:!1,onClick:()=>null,style:{},id:""};const Tc=rn;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 ui(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){Oc(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 Oc(n,e,t){return e=Ic(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Ic(n){var e=Dc(n,"string");return typeof e=="symbol"?e:String(e)}function Dc(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 xc(n){var{styleProps:e,selectedItemCount:t,onClearSelection:r}=n;return h.jsx(il,ui(ui({UNSAFE_className:dr.spectrumActionBar},e),{},{isEmphasized:!0,selectedItemCount:t,onClearSelection:r}))}function Ac(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:G(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 To(n,e,t){return e=Mc(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Mc(n){var e=Nc(n,"string");return typeof e=="symbol"?e:String(e)}function Nc(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(Vt,{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:G({collapse:a==="exited"},t),"data-testid":i,children:e})})}}To(Ce,"propTypes",{className:C.string,in:C.bool.isRequired,children:C.node.isRequired,autoFocusOnShow:C.bool,"data-testid":C.string});To(Ce,"defaultProps",{className:"",autoFocusOnShow:!1,"data-testid":void 0});const Lc=Ce;var jc=B.module("TimeInput"),Fc="([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]",Rc=["00:00:00","12:34:56","23:59:59"],Oo=z.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(_t.formatTime(a)),[m,p]=c.useState(),v=c.useRef(null);c.useImperativeHandle(e,()=>({focus:()=>{var y;(y=v.current)===null||y===void 0||y.focus()},setSelection:y=>{var P;(P=v.current)===null||P===void 0||P.focus(),p(y)}}),[]),c.useEffect(function(){f(_t.formatTime(a))},[a]);function g(y,P,S){var D=y.selectionStart===0?24:60,O=parseInt(S,10)-P;return Number.isNaN(O)?O=0:t?O=(O%D+D)%D:O=Math.min(Math.max(0,O),D-1),"".concat(O).padStart(2,"0")}function b(y,P,S,D,O){return D===0&&O===2&&P===1&&parseInt(S,10)>1?"0".concat(S).concat(y.substring(2)):Ua(y,P,S)}function _(y){jc.debug("handleChange",y),f(y),_t.isTimeString(y)&&i(_t.parseTime(y))}var w=c.useCallback(y=>{p(y),l(y)},[l]);return h.jsx(rr,{ref:v,className:r,example:Rc,getNextSegmentValue:g,getPreferredReplacementString:b,onChange:_,onSelect:w,pattern:Fc,selection:m,value:d,onFocus:o,onBlur:s,"data-testid":u})});Oo.defaultProps={allowValueWrapping:!0,className:"",onChange:()=>!1,onSelect:()=>!1,value:0,onFocus:()=>!1,onBlur:()=>!1,"data-testid":void 0};const Kt=Oo;function di(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 $c(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?di(Object(t),!0).forEach(function(r){Ge(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):di(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function Ge(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=Bc(n,"string");return typeof e=="symbol"?e:String(e)}function Bc(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 ci=-1,In;(function(n){n.UP="UP",n.DOWN="DOWN"})(In||(In={}));class fe extends c.Component{constructor(e){super(e),Ge(this,"csContainer",void 0),Ge(this,"menuContainer",void 0),Ge(this,"button",void 0),Ge(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=z.createRef(),this.menuContainer=z.createRef(),this.button=z.createRef(),this.input=z.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 _t.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===ci){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],m="option-".concat(d,"-").concat(f.value);l=l||f.value===t,u.push(h.jsxs("button",{type:"button",value:d,className:G("cs-option-btn",{"keyboard-active":a===d&&!s}),onClick:this.handleOptionClick,onFocus:this.handleOptionFocus,children:[f.value===t&&h.jsx(we,{icon:r,className:"mr-2"}),f.value!==t&&h.jsx("span",{className:"mr-4"}),f.title]},m))}return u.push(h.jsx("hr",{className:"cs-divider"},"option-divider")),u.push(h.jsxs("button",{type:"button",value:ci,className:G("cs-option-btn",{"keyboard-active":s}),onClick:this.handleOptionClick,onFocus:this.handleOptionFocus,children:[!l&&t!==null?h.jsx(we,{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(Kt,{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=$c({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:G("input-group-append cs-dropdown",{"cs-dropdown-invalid":t}),children:h.jsxs("button",{type:"button",className:G("btn cs-btn form-control",{"cs-btn-invalid":t}),ref:this.button,onClick:this.toggleMenu,disabled:e,children:[h.jsx("span",{className:G({"text-muted":r===null}),children:this.getSelectedText()}),h.jsx("span",{children:h.jsx(we,{icon:Da,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"}})]})})})}}Ge(fe,"MENU_NAVIGATION_DIRECTION",In);Ge(fe,"DROP_DOWN_MENU_HEIGHT",125);Ge(fe,"defaultProps",{onChange(){},value:null,disabled:!1,popperOptions:{},icon:_l,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 Uc=fe;var Wc=B.module("DateInput"),Hc="[12][0-9]{3}-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])",Vc=["2000-01-01","2022-12-31"],zc="YYYY-MM-DD",fr=z.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(),m=c.useCallback(p=>{Wc.debug("handleChange",p),u(p),r(p)},[r]);return h.jsx("div",{className:"d-flex flex-row align-items-center",children:h.jsx(rr,{ref:e,className:G(t),example:Vc,getNextSegmentValue:Kl,onChange:m,onSelect:f,pattern:Hc,placeholder:zc,selection:d,value:l,onFocus:a,onBlur:o,"data-testid":s})})});fr.displayName="DateInput";fr.defaultProps={className:"",onChange:()=>!1,defaultValue:"",onFocus:()=>!1,onBlur:()=>!1,"data-testid":void 0};const Gc=fr;function Io(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=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)}class Do extends c.PureComponent{constructor(e){super(e),Io(this,"searchInput",void 0),this.searchInput=z.createRef(),this.handleChange=this.handleChange.bind(this),this.sendUpdate=Ze(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(ir,{value:o,placeholder:e,onChange:this.handleChange,className:t,matchCount:r,ref:this.searchInput,id:i,"data-testid":a})}}Io(Do,"defaultProps",{placeholder:"Search",className:"",matchCount:null,debounceMs:250,id:"","data-testid":void 0});const Yc=Do;function qc(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(""),m=c.useCallback(y=>{u(y)},[]),p=c.useCallback(()=>{i(Xr.getItemsInRanges(t,l)),u([])},[t,l,i]),v=c.useCallback(()=>{if(d!==""){var y=a(d);y==null?(r(d),f("")):s(y)}},[d,r,a]),g=c.useCallback(y=>{var{value:P}=y.target;f(P),s(P===""?null:a(P))},[a]),b=c.useCallback(()=>{u([])},[]),_=c.useCallback(y=>{y.key==="Enter"&&v()},[v]),w=c.useMemo(()=>14+al(t.length,1,6)*Pn.DEFAULT_ROW_HEIGHT,[t.length]);return h.jsxs("div",{className:G("editable-item-list-container",{"is-invalid":e}),children:[h.jsx("div",{style:{height:w},children:h.jsx(Pn,{itemCount:t.length,items:t.map((y,P)=>({value:y,isSelected:Xr.isSelected(l,P)})),offset:0,selectedRanges:l,onSelectionChange:m,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:G("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(Ne,{kind:"ghost",onClick:v,disabled:o!=null||d==="",icon:wl,tooltip:"Add new item","data-testid":"add-item-button"}),h.jsx(Ne,{kind:"ghost",onClick:p,disabled:l.length===0,icon:Oa,tooltip:"Delete selected items","data-testid":"delete-item-button"})]})]})]})}function Zc(n,e,t){return e=Jc(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Jc(n){var e=Qc(n,"string");return typeof e=="symbol"?e:String(e)}function Qc(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 dt 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=dt.isParentSelected(e,a),u=l==null||!l;o.forEach((m,p)=>s.set(p,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=dt.isParentSelected(e,r);f!=null&&f?d.forEach((m,p)=>d.set(p,!1)):d.forEach((m,p)=>d.set(p,!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(Tn,{className:"hcm-parent",checked:dt.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(Tn,{className:"hcm-child",checked:l,onChange:()=>this.toggleValueFor(i,s),children:s},s)})]},i)}),h.jsx(Ne,{kind:"ghost",onClick:this.selectAll,"data-testid":t!==void 0?"".concat(t,"-btn-select-all"):void 0,children:"Select All"}),h.jsx(Ne,{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:G("btn hcm-btn",t),onClick:this.toggleMenu,id:i,"data-testid":a,children:[h.jsxs("span",{children:[r&&h.jsx(we,{icon:r,className:"hcm-icon mr-1"}),e]}),h.jsx(we,{icon:Da,className:"hcm-icon ml-1"}),h.jsx(nr,{options:{placement:"bottom"},isShown:o,onExited:()=>{this.setState({menuIsOpen:!1})},closeOnBlur:!0,interactive:!0,children:this.renderMenuElement()})]})}}Zc(dt,"defaultProps",{className:"",icon:null,id:"","data-testid":void 0});const eh=dt;var th=.025,nh=.9,rh=.1,ih=.618,fn=Je["primary-dark"],hi=80,ah=Je["gray-800"],oh=Je["gray-900"],Ke={SIZE:8,DOT_SIZE:2,FILL_OPACITY:.25},$e=18,sh=250,lh=60*1e3,uh=z.memo(()=>{var n=c.useRef(null),e=c.useRef(null),[t,r]=c.useState(!1),i=window.devicePixelRatio,a,o,s,l,u,d=null,f=[];function m(){var E;e.current!=null&&(s=e.current.offsetWidth,l=e.current.offsetHeight),n.current!=null&&(n.current.style.width="".concat(s,"px"),n.current.style.height="".concat(l,"px"),n.current.width=s*i,n.current.height=l*i),(E=a)===null||E===void 0||E.scale(i,i)}function p(){var E=document.createElement("canvas");E.width=Ke.SIZE,E.height=Ke.SIZE;var I=E.getContext("2d");return I!=null&&(I.fillStyle=fn,I.fillRect(0,0,Ke.DOT_SIZE,Ke.DOT_SIZE),I.fillStyle=fn+Math.round(255*Ke.FILL_OPACITY).toString(16).padStart(2,"0"),I.fillRect(0,0,Ke.SIZE,Ke.SIZE)),I==null?void 0:I.createPattern(E,"repeat")}function v(E){var I=Math.random()-.5,L=th*I;return E<rh?L=Math.abs(L):E>nh&&(L=-Math.abs(L)),E+L}function g(){for(var E=[],I=ih,L=0;L<s+$e;L+=1)I=v(I),E.push(I);return E}function b(){for(;f.length>=s+$e;)f.pop();for(;f.length<s+$e;)f.push(v(f[f.length-1]))}function _(E,I){I.beginPath(),I.moveTo(-1,l+1),I.lineTo(-1,l*E[0]);for(var L=0;L<E.length;L+=1)I.lineTo(L,l*E[L]);I.lineTo(s+$e,l*E[E.length-1]),I.lineTo(s+$e,l+1),I.closePath()}function w(E){E.beginPath();for(var I=1;I<s;I+=hi)E.moveTo(I,0),E.lineTo(I,l);for(var L=1;L<l;L+=hi)E.moveTo(0,L),E.lineTo(s,L)}function y(E){var I,L,X;d=(I=d)!==null&&I!==void 0?I:E,ze(a),a.fillStyle=oh,a.fillRect(0,0,s,l),w(a),a.lineWidth=1,a.strokeStyle=ah,a.stroke();var J=(((L=d)!==null&&L!==void 0?L:0)-(E??0))/(1e3/$e);if(a.translate(J,0),_(f,a),a.lineWidth=2,a.strokeStyle=fn,a.stroke(),a.translate(-J,0),o!=null&&(a.fillStyle=o),a.fill(),a.setTransform(i,0,0,i,0,0),(E??0)-((X=d)!==null&&X!==void 0?X:0)>1e3/$e){for(var $,V=Math.floor(((E??0)-(($=d)!==null&&$!==void 0?$:0))/(1e3/$e)),K=0;K<V;K+=1)f.shift(),f.push(v(f[f.length-1]));d=E}u!=null&&cancelAnimationFrame(u),u=requestAnimationFrame(y)}var P=Ze(()=>{u=requestAnimationFrame(E=>{m(),b(),r(!1),y(E)})},sh,{leading:!0});function S(){r(!0),u!=null&&cancelAnimationFrame(u),u=null,d=null}var D=Ze(()=>{S()},lh);function O(){u==null&&(r(!1),m(),b(),u=requestAnimationFrame(y)),D()}function M(){document.hasFocus()&&O()}function F(){u!=null&&cancelAnimationFrame(u),D(),P()}return c.useEffect(()=>{var E;return a=(E=n.current)===null||E===void 0?void 0:E.getContext("2d",{alpha:!1}),m(),f=g(),o=p(),y(),D(),window.addEventListener("resize",F),window.addEventListener("focus",O),window.addEventListener("blur",S),window.addEventListener("mousemove",M),window.addEventListener("keydown",M),()=>{u!=null&&cancelAnimationFrame(u),window.removeEventListener("resize",F),window.removeEventListener("focus",O),window.removeEventListener("blur",S),window.removeEventListener("mousemove",M),window.removeEventListener("keydown",M),D.cancel(),P.cancel()}},[]),h.jsx("div",{className:"random-area-plot-animation-container",ref:e,children:h.jsx("canvas",{ref:n,className:t?"shade":""})})});const xo=uh;function Ao(n){var{text:e,placement:t="top-start"}=n,r=c.useMemo(()=>({placement:t}),[t]);return h.jsxs(h.Fragment,{children:[h.jsx(wa,{UNSAFE_className:dr.spectrumEllipsis,children:e??h.jsx(h.Fragment,{children:" "})}),e==null||e===""?null:h.jsx(Ha,{options:r,children:e})]})}var dh=["scrollRef","getItemDisplayText","getKey"];function fi(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 mi(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?fi(Object(t),!0).forEach(function(r){ch(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):fi(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function ch(n,e,t){return e=hh(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function hh(n){var e=fh(n,"string");return typeof e=="symbol"?e:String(e)}function fh(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 mh(n,e){if(n==null)return{};var t=ph(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 ph(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 vh(n){var{scrollRef:e,getItemDisplayText:t,getKey:r}=n,i=mh(n,dh),a=c.useCallback(o=>{var s=r(o),l=t(o);return h.jsx(ol,{textValue:l??String(s),children:h.jsx(Ao,{text:l})},s)},[t,r]);return h.jsx(sl,mi(mi({},i),{},{ref:e,menuTrigger:"focus",onSelectionChange:i.onSelectionChange,children:a}))}var mr=z.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:m,"data-testid":p}=n;return h.jsxs("button",{ref:e,type:"button",className:G("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:m,disabled:i,"data-testid":p,children:[t,h.jsx(we,{icon:Sl,className:"linked btn-socketed-icon",transform:"down-1"}),h.jsx(we,{icon:Cl,className:"is-invalid btn-socketed-icon"})]})});mr.displayName="SocketedButton";mr.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 gh=mr,bh={"dh-spectrum-palette":"_dh-spectrum-palette_1mcqx_1"},yh={"dh-spectrum-alias":"_dh-spectrum-alias_83lrx_1"},_h={};function pi(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 mn(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?pi(Object(t),!0).forEach(function(r){wh(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):pi(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function wh(n,e,t){return e=Sh(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Sh(n){var e=Ch(n,"string");return typeof e=="symbol"?e:String(e)}function Ch(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 vi=mn(mn(mn({},bh),yh),_h);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 jt(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){Eh(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 Eh(n,e,t){return e=Ph(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Ph(n){var e=Th(n,"string");return typeof e=="symbol"?e:String(e)}function Th(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{global:Oh,light:Ih,dark:Dh,medium:xh,large:Ah}=ll,Mo={global:Oh,light:jt(jt({},Ih),vi),dark:jt(jt({},Dh),vi),medium:xh,large:Ah},Mh=500;function Nh(n){var{heading:e,content:t,delayMs:r=Mh}=n,[i,a]=c.useState(!1);return c.useEffect(()=>{window.setTimeout(()=>{a(!0)},r)},[r]),i?h.jsxs(ul,{children:[h.jsx(Zn,{size:"XXL",children:h.jsx(we,{icon:El})}),h.jsx(Sa,{children:e}),t==null?null:h.jsx(Ca,{children:t})]}):null}function Lh(n){var{children:e,isPortal:t=!1,theme:r=Mo,colorScheme:i}=n,[a]=c.useState(t?Ee():null);return h.jsx(dl,{theme:r,colorScheme:i,"data-unique-id":a,children:e})}var jh=B.module("ThemeProvider"),pr=c.createContext(null);function No(n){var{themes:e,children:t}=n,r=c.useMemo(()=>xa(),[]),[i,a]=c.useState(()=>{var l,u;return(l=(u=Aa())===null||u===void 0?void 0:u.themeKey)!==null&&l!==void 0?l:Ma}),o=c.useMemo(()=>e==null?null:Na(i,{base:r,custom:e??[]}),[r,i,e]);c.useEffect(function(){if(!(o==null||e==null)){var u=La();jh.debug2("updateThemePreloadData:",{active:o.map(d=>d.themeKey),all:e.map(d=>d.themeKey),preloadStyleContent:u,selectedThemeKey:i}),ja({themeKey:i,preloadStyleContent:u})}},[o,i,e]);var s=c.useMemo(()=>({activeThemes:o,selectedThemeKey:i,setSelectedThemeKey:a}),[o,i]);return h.jsxs(pr.Provider,{value:s,children:[o==null?null:h.jsx(h.Fragment,{children:o.map(l=>h.jsx("style",{"data-theme-key":l.themeKey,children:l.styleContent},l.themeKey))}),h.jsx(Lh,{children:t})]})}function Lo(){return pt(pr,"No ThemeContext value found. Component must be wrapped in a ThemeContext.Provider")}const Fh="_track_1ermw_30",Rh="_handle_1ermw_13",$h="_ticks_1ermw_98",jo={"handle-size":"15px","popover-width":"90px","time-slider":"_time-slider_1ermw_3","time-slider-popovers":"_time-slider-popovers_1ermw_8","handle-popper":"_handle-popper_1ermw_13","flex-spacer":"_flex-spacer_1ermw_26",track:Fh,"track-fills":"_track-fills_1ermw_37","track-fill":"_track-fill_1ermw_37","track-fill-start":"_track-fill-start_1ermw_55","track-fill-middle":"_track-fill-middle_1ermw_56","track-fill-end":"_track-fill-end_1ermw_59","handle-track":"_handle-track_1ermw_62",handle:Rh,ticks:$h,"tick-labels":"_tick-labels_1ermw_116","tick-label":"_tick-label_1ermw_116","tick-label-wrapper":"_tick-label-wrapper_1ermw_132"};var Ft=parseInt(jo["handle-size"],10),bi=parseInt(jo["popover-width"],10),me=24*60*60-1,yi=5*60;function kh(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 m=c.useCallback((g,b)=>{var _=g,w=b;_===w&&(w<me?w+=1:_-=1),l(_),d(w),r({startTime:_,endTime:w})},[l,d,r]),p=c.useCallback(g=>{m(g,u)},[m,u]),v=c.useCallback(g=>{m(s,g)},[m,s]);return h.jsxs("div",{className:"time-slider","data-testid":o,children:[h.jsx(Bh,{startTime:s,endTime:u,onStartTimeChange:p,onEndTimeChange:v,isStartModified:i,isEndModified:a}),h.jsxs("div",{className:"track",ref:f,children:[h.jsx(Uh,{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(_i,{track:f,time:s,setTime:p}),h.jsx(_i,{track:f,time:u,setTime:v})]}),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 Bh(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,m]=c.useState(l?e:t),p=c.useRef(null),v=c.useRef(null),g=c.useRef(null),b=c.useRef(null);c.useEffect(function(){d(e>t?t:e),m(e>t?e:t)},[e,t]),c.useEffect(function(){if(g.current!==null){var D;(D=v.current)===null||D===void 0||D.setSelection(g.current)}if(b.current!==null){var O;(O=p.current)===null||O===void 0||O.setSelection(b.current)}},[l]);function _(S){e<=t?r(S):i(S)}function w(S){e<=t?i(S):r(S)}var y=c.useCallback(S=>{g.current=S,b.current=null},[]),P=c.useCallback(S=>{g.current=null,b.current=S},[]);return h.jsxs("div",{className:"time-slider-popovers",children:[h.jsx("div",{className:"flex",style:{flexBasis:"calc(".concat(u/me*100,"% - ").concat(bi/2,"px)")}}),h.jsxs("div",{className:"handle-popper",children:[h.jsx("label",{className:G({modified:l?o:a}),children:l?"End Time":"Start Time"}),h.jsx(Kt,{ref:p,allowValueWrapping:!1,value:u,onChange:_,onSelect:y,"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:G({modified:l?a:o}),children:l?"Start Time":"End Time"}),h.jsx(Kt,{ref:v,allowValueWrapping:!1,value:f,onChange:w,onSelect:P,"data-testid":s!==void 0?"".concat(s,"-input-2"):void 0})]}),h.jsx("div",{className:"flex",style:{flexBasis:"calc(".concat((me-f)/me*100,"% - ").concat(bi/2,"px)")}})]})}function Uh(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/me,")")}}),h.jsx("div",{className:"track-fill track-fill-end",style:{transform:"scaleX(".concat((me-e)/me,")")}})]}),e<t&&h.jsx("div",{className:"track-fill track-fill-middle",style:{transform:"translateX(".concat(e/me*100,"%) scaleX(").concat((t-e)/me,")")}})]})}function _i(n){var{track:e,time:t,setTime:r,"data-testid":i}=n,a=c.useMemo(()=>{var m=3600,p=Ft/2;return t<m?p=t/m*(Ft/2):t>23*m&&(p=Ft/2+1/(me-23*m)*(t-23*m)*(Ft/2)),"translateX(calc(".concat(t/me*100,"% - ").concat(p,"px))")},[t]),o=c.useCallback(m=>{if(!e.current)return 0;var p=e.current.getBoundingClientRect(),v=Math.max(m-p.left,0),g=me*Math.min(1,v/p.width),b=yi*Math.round(g/yi),_=Math.min(me,b);return _},[e]),s=c.useCallback(m=>{var{clientX:p}=m;r(o(p))},[r,o]),l=c.useCallback(m=>{var{clientX:p}=m;r(o(p)),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 Fo(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(Vt,{in:t,timeout:Je.transitionMs,classNames:"toast-notification-slide-up",mountOnEnter:!0,unmountOnExit:!0,children:h.jsxs("div",{className:G("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(Vt,{in:u,timeout:Je.transitionSlowMs,classNames:"fade",mountOnEnter:!0,unmountOnExit:!0,children:h.jsx("div",{className:"buttons-container",children:e})}),s&&h.jsx(Ne,{kind:"ghost",icon:Pl,tooltip:"Close notification",className:"my-2",onClick:s})]})})}Fo.TYPE=Object.freeze({ERROR:"error"});function Wh(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??Ee());return h.jsxs(h.Fragment,{children:[h.jsx("label",{className:G("validate-label",t,{modified:a}),htmlFor:d,"data-testid":l,children:r}),z.Children.toArray(e).map(f=>z.isValidElement(f)?z.cloneElement(f,{className:G(f.props.className,{"is-invalid":o})}):h.jsx("div",{className:G(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 Hh=Object.freeze(Object.defineProperty({__proto__:null,ActionButtonDialogTrigger:oo,AutoCompleteInput:Cc,AutoResizeTextarea:cr,BasicModal:hr,BulkActionBar:xc,Button:Ne,ButtonGroup:It,ButtonOld:Tc,CSS_VAR_EXPRESSION_PREFIX:Tl,CardFlip:Ac,Checkbox:Tn,Collapse:Lc,ComboBox:Xl,ConfirmActionButton:hc,ConfirmationDialog:Co,ContextActionUtils:Yl,ContextActions:ql,ContextMenuItem:Zl,ContextMenuRoot:Jl,CopyButton:Ql,CustomTimeSelect:Uc,DEFAULT_DARK_THEME_KEY:Ma,DEFAULT_GET_PREFERRED_REPLACEMENT_STRING:Ua,DEFAULT_LIGHT_THEME_KEY:Ol,DEFAULT_PRELOAD_DATA_VARIABLES:Il,DateInput:Gc,DateTimeInput:eu,DebouncedModal:Ec,DebouncedSearchInput:Yc,DragUtils:tu,DraggableItemList:nu,DropdownMenu:Wa,EditableItemList:qc,GLOBAL_SHORTCUTS:ru,HierarchicalCheckboxMenu:eh,IconActionButton:Eo,InfoModal:Pc,ItemList:Pn,ItemListItem:iu,get KEY(){return au},LoadingOverlay:je,LoadingSpinner:Fa,get MODIFIER(){return ou},MaskedInput:rr,Menu:su,MenuItem:lu,Modal:Qn,ModalBody:er,ModalFooter:Po,ModalHeader:Ia,NON_WHITESPACE_REGEX:Dl,Option:uu,Page:du,Popper:nr,RadioGroup:cu,RadioItem:hu,RandomAreaPlotAnimation:xo,SearchInput:ir,SearchableCombobox:vh,Select:fu,SelectValueList:Va,Shortcut:mu,ShortcutRegistry:pu,SocketedButton:gh,Stack:vu,THEME_CACHE_LOCAL_STORAGE_KEY:xl,TMP_CSS_PROP_PREFIX:Al,TableViewEmptyState:Nh,TextWithTooltip:Ao,ThemeContext:pr,ThemeExport:Je,ThemeProvider:No,TimeInput:Kt,TimeSlider:kh,ToastNotification:Fo,Tooltip:Ha,UISwitch:gu,ValidateLabelInput:Wh,WHITESPACE_REGEX:Ml,calculatePreloadStyleContent:La,extractDistinctCssVariableExpressions:Nl,fillToLength:bu,getActiveThemes:Na,getDefaultBaseThemes:xa,getExpressionRanges:Ra,getThemeKey:$a,getThemePreloadData:Aa,preloadTheme:Ll,resolveCssVariablesInRecord:ka,resolveCssVariablesInString:jl,setThemePreloadData:ja,themeDHDefault:Mo,themeDark:Fl,themeLight:Rl,trimTrailingMask:yu,useTheme:Lo},Symbol.toStringTag,{value:"Module"}));function Pe(){return pt(tr,"No API available in useApi. Was code wrapped in ApiBootstrap or ApiContext.Provider?")}function Vh(n,e){var t=Pe(),r=c.useMemo(()=>new t.CoreClient(n,e),[t,n,e]);return c.useEffect(()=>()=>{r.disconnect()},[r]),r}var vr=c.createContext(null);function Ro(n){var{serverUrl:e,options:t,children:r}=n,i=Vh(e,t);return h.jsx(vr.Provider,{value:i,children:r})}function Qe(){return pt(vr,"No Client available in useClient. Was code wrapped in ClientBootstrap or ClientContext.Provider?")}const zh=Object.freeze(Object.defineProperty({__proto__:null,ApiBootstrap:$l,ApiContext:tr,ClientBootstrap:Ro,ClientContext:vr,useApi:Pe,useClient:Qe},Symbol.toStringTag,{value:"Module"}));function Gh(n){return function(t){var{children:r}=t;return h.jsx(tr.Provider,{value:n,children:r})}}function wi(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 Kh(n){return function(){var e=this,t=arguments;return new Promise(function(r,i){var a=n.apply(e,t);function o(l){wi(a,r,i,o,s,"next",l)}function s(l){wi(a,r,i,o,s,"throw",l)}o(void 0)})}}var pn=B.module("MessageUtils"),$o="io.deephaven.message.LoginOptions.request",ko="io.deephaven.message.SessionDetails.request",Bo="io.deephaven.broadcast",gr="io.deephaven.broadcast.Login",Uo="io.deephaven.broadcast.Logout";function an(n){var e=n;return e!=null&&typeof e.id=="string"&&typeof e.message=="string"}function Wo(n){return an(n)&&n.message===gr}function Ho(n){return an(n)&&n.message===Uo}function Vo(n){var e=n;return e!=null&&typeof e.id=="string"}function br(n){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Ee(),t=arguments.length>2?arguments[2]:void 0;return{message:n,id:e,payload:t}}function Xh(n,e){return{id:n,payload:e}}function yr(){return window.opener!=null?window.opener:window.parent!=null&&window.parent!==window?window.parent:null}function _r(n){return Dn.apply(this,arguments)}function Dn(){return Dn=Kh(function*(n){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:3e4,t=yr();if(t==null)throw new Error("window parent is null, unable to send request.");return new Promise((r,i)=>{var a,o=Ee(),s=l=>{var{data:u}=l;if(!Vo(u)){pn.debug("Ignoring non-deephaven response",u);return}if(pn.debug("Received message",u),(u==null?void 0:u.id)!==o){pn.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 _u("Request timed out"))},e),t.postMessage(br(n,o),"*")})}),Dn.apply(this,arguments)}function Yh(n,e,t){return e=qh(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function qh(n){var e=Zh(n,"string");return typeof e=="symbol"?e:String(e)}function Zh(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 zo extends Error{constructor(){super(...arguments),Yh(this,"isNoConsolesError",!0)}}function Go(n){return n.isNoConsolesError}function Si(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 on(n){return function(){var e=this,t=arguments;return new Promise(function(r,i){var a=n.apply(e,t);function o(l){Si(a,r,i,o,s,"next",l)}function s(l){Si(a,r,i,o,s,"throw",l)}o(void 0)})}}var ot=B.module("SessionUtils");function Jh(n,e){return ot.info("Starting connection to '".concat(e,"'...")),new n.IdeConnection(e)}function Ko(n,e,t){return xn.apply(this,arguments)}function xn(){return xn=on(function*(n,e,t){ot.info("Getting console types...");var r=yield e.getConsoleTypes();if(r.length===0)throw new zo("No console types available");ot.info("Available types:",r);var i=r[0];ot.info("Starting session with type",i);var a=yield e.startSession(i),o={type:i,id:Ee.generate()};return ot.info("Console session established",o),{session:a,config:o,connection:e,details:t,dh:n}}),xn.apply(this,arguments)}function Qh(n,e,t){return ot.info("createCoreClient",e),new n.CoreClient(e,t)}function ef(n){return n!=null&&typeof n=="object"}function tf(){return An.apply(this,arguments)}function An(){return An=on(function*(){var n=yield _r(ko);if(!ef(n))throw new Error("Unexpected session details response: ".concat(n));return n}),An.apply(this,arguments)}function nf(){return Mn.apply(this,arguments)}function Mn(){return Mn=on(function*(){var n=new URLSearchParams(window.location.search);switch(n.get("authProvider")){case"parent":return tf()}return{}}),Mn.apply(this,arguments)}function rf(n,e,t){return Nn.apply(this,arguments)}function Nn(){return Nn=on(function*(n,e,t){var r;try{r=yield Ko(n,e,t)}catch(i){if(!Go(i))throw i}return r}),Nn.apply(this,arguments)}const af=Object.freeze(Object.defineProperty({__proto__:null,BROADCAST_CHANNEL_NAME:Bo,BROADCAST_LOGIN_MESSAGE:gr,BROADCAST_LOGOUT_MESSAGE:Uo,BooleanColumnFormatter:wu,CharColumnFormatter:Su,DateTimeColumnFormatter:Cu,DateUtils:za,DecimalColumnFormatter:Eu,DefaultColumnFormatter:Pu,FETCH_TIMEOUT:Tu,Formatter:en,FormatterUtils:ut,IntegerColumnFormatter:Ou,LOGIN_OPTIONS_REQUEST:$o,NoConsolesError:zo,SESSION_DETAILS_REQUEST:ko,StringColumnFormatter:Iu,TableColumnFormatter:Du,TableUtils:St,createComboboxFilterArgs:xu,createConnection:Jh,createCoreClient:Qh,createFilterConditionFactory:ar,createKeyFromOffsetRow:Au,createNotNullOrEmptyFilterCondition:Ga,createOnTableUpdatedHandler:Ka,createSearchTextFilter:or,createSelectedValuesFilter:sr,createSessionWrapper:Ko,createShowOnlyEmptyFilterCondition:Xa,createValueFilter:Ya,defaultRowDeserializer:qa,fetchVariableDefinition:Mu,generateEmptyKeyedItems:Za,getColumnFormats:Nu,getDateTimeFormatterOptions:Lu,getSessionDetails:nf,getSize:lr,getWindowParent:yr,isBroadcastLoginMessage:Wo,isBroadcastLogoutMessage:Ho,isClosed:zt,isCustomColumnFormatDefined:ju,isMessage:an,isNoConsolesError:Go,isResponse:Vo,loadSessionWrapper:rf,makeMessage:br,makeResponse:Xh,padFirstAndLastRow:Ja,requestParentResponse:_r},Symbol.toStringTag,{value:"Module"}));var Ci=B.module("useTableListener"),of=(n,e,t)=>c.useEffect(function(){if(n==null){Ci.debug2("Emitter undefined, skipping addEventListener",e);return}return Ci.debug2("Adding listener",e),n.addEventListener(e,t)},[n,e,t]);const ct=of;function sf(n,e,t){return e=lf(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function lf(n){var e=uf(n,"string");return typeof e=="symbol"?e:String(e)}function uf(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 df extends Error{constructor(){super(...arguments),sf(this,"isColumnNameError",!0)}}const cf=df;function hf(n,e,t){return e=ff(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function ff(n){var e=mf(n,"string");return typeof e=="symbol"?e:String(e)}function mf(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 pf extends Error{constructor(){super(...arguments),hf(this,"isTableDisconnectError",!0)}}const vf=pf;var Rt=B.module("useTable"),gf=(n,e,t,r)=>{var i=Pe(),[a,o]=c.useState(void 0),[s,l]=c.useState([]),[u,d]=c.useState(null),[f,m]=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){Rt.error("Column not found",b,r),d(new cf("Invalid columnNames argument"))}},[n,r]),c.useEffect(()=>{if(!a||!n){Rt.debug2("Table or column not initialized, skip viewport update.");return}Rt.debug2("Setting viewport",e,t),n.setViewport(e,t,a)},[a,n,e,t]);var p=c.useCallback(b=>{var{detail:_}=b;if(!a){Rt.error("Columns not initialized.");return}var w=a.map(y=>_.rows.map(P=>P.get(y)));l(w)},[a]),v=c.useCallback(()=>{m(new vf("Table disconnected"))},[]),g=c.useCallback(()=>{m(null)},[]);return ct(n,i.Table.EVENT_UPDATED,p),ct(n,i.Table.EVENT_DISCONNECT,v),ct(n,i.Table.EVENT_RECONNECT,g),{columns:a,data:s,error:f??u}};const Xo=gf;var bf=(n,e,t,r)=>{var i=c.useMemo(()=>[r],[r]),{columns:a=[],data:o=[],error:s}=Xo(n,e,t,i);return{column:a[0],data:o[0],error:s}};const Yo=bf;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 yf(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 Te=B.module("TableInput"),vn=250;function wr(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),m=Pe(),p=c.useMemo(()=>{var j=ut.getColumnFormats(a),U=ut.getDateTimeFormatterOptions(a),{defaultDecimalFormatOptions:x={},defaultIntegerFormatOptions:R={}}=a;return new en(m,j,U,x,R)},[m,a]),[v,g]=c.useState(""),[b,_]=c.useState(new Set(o)),[w,y]=c.useState(),P=c.useRef(null),S=Math.min((e=w==null?void 0:w.size)!==null&&e!==void 0?e:0,vn),{column:D,data:O,error:M}=Yo(w,0,vn-1,i),F=c.useCallback(j=>D?p.getFormattedString(j,D.type,D.name):"".concat(j),[D,p]),[E,I]=c.useMemo(()=>{var j=new Set(b),U=[];if(O==null)return[U,null];if(O.forEach(R=>{var W="".concat(R),Re=b.has(W);Re&&j.delete(W),U.push({value:W,displayValue:F(R),isSelected:Re})}),j.size>0){Te.debug2("Selection has items that are missing from the viewport");var x=new Set(b);return Array.from(j).forEach(R=>{x.delete(R)}),[U,x]}return[U,null]},[O,b,F]);c.useEffect(()=>{I!==null&&(_(I),l(Array.from(I)))},[l,I]);var L=c.useCallback(function(){var j=yf(function*(U){try{var x=yield U;Te.debug("Table resolved",x),y(x)}catch(R){if(Yr.isCanceled(R))return;Te.error(R)}});return function(U){return j.apply(this,arguments)}}(),[]);c.useEffect(()=>{var j=Yr.makeCancelable(d);return L(j),()=>{Te.debug2("Cancel table promise"),j.cancel()}},[d,L]);var X=c.useCallback(j=>{var{value:U}=j.target;g(U);var x=E.findIndex(W=>W.displayValue.includes(U));if(x>-1){var R;Te.debug2("Found ".concat(U," at index ").concat(x)),(R=P.current)===null||R===void 0||R.scrollIntoView(x)}else Te.debug2("".concat(U," not found"))},[E,P]),J=c.useCallback(j=>{if(Te.debug("handleSelect",j),j>=E.length){Te.error("Invalid index",j);return}var U=E[j].value,x=new Set(b);E[j].isSelected?x.delete(U):x.add(U),_(x),l(Array.from(x))},[l,E,b]),$=c.useCallback(()=>{var j=E.map(x=>x.value),U=new Set(j);_(U),l(j)},[E,l]),V=c.useCallback(()=>{_(new Set),l([])},[l]),K=c.useCallback(()=>{},[]),q=c.useCallback(j=>{var U,{relatedTarget:x}=j;Te.debug("handleChildBlur",x,x instanceof HTMLElement,f.current,(U=f.current)===null||U===void 0?void 0:U.contains(x)),(!x||f.current&&x instanceof HTMLElement&&!f.current.contains(x))&&u()},[u]),se=E.length===0;return h.jsxs("div",{ref:f,className:G("table-input-container d-flex flex-column position-relative",r),children:[h.jsx(ir,{disabled:!!M||se,value:v,placeholder:"Search",onChange:X,className:"mb-2 d-flex",onBlur:q}),h.jsx(Va,{className:"table-input-list",disabled:w===void 0||se,isInvalid:s,items:se?[{value:"Empty",isSelected:!1}]:E,itemCount:S,offset:0,onSelect:J,onViewportChange:K,ref:P,onBlur:q}),w&&h.jsxs("div",{className:"meta-row",children:[h.jsx("div",{className:"d-flex align-items-center text-muted small",children:w!=null&&w.size>S&&h.jsxs(h.Fragment,{children:["Table is too large, showing the first ",vn," items."]})}),h.jsxs("div",{children:[h.jsx("button",{type:"button",className:"btn btn-link",onBlur:q,onClick:$,children:"Select All"}),h.jsx("button",{type:"button",className:"btn btn-link mr-a",onBlur:q,onClick:V,children:"Clear"})]})]}),w==null||M&&h.jsx("div",{className:"h-100 w-100 position-absolute",children:h.jsx(je,{isLoaded:w!=null,isLoading:w==null&&M==null,errorMessage:(t=M==null?void 0:M.message)!==null&&t!==void 0?t:null})})]})}wr.displayName="TableInput";wr.defaultProps={isInvalid:!1,className:void 0};var Pi=B.module("useBroadcastChannel");function Sr(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Fu,e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Bo,t=c.useMemo(()=>new BroadcastChannel(e),[e]);return c.useEffect(()=>()=>{t.close()},[t]),c.useEffect(()=>{function r(i){var{data:a}=i;if(!an(a)){Pi.debug("Ignoring non-deephaven message",a);return}Pi.debug("event received",a),n(i)}return t.addEventListener("message",r),()=>{t.removeEventListener("message",r)}},[t,n]),t}function sn(n,e){var t=c.useCallback(r=>{Wo(r.data)?n==null||n(r.data):Ho(r.data)&&(e==null||e(r.data))},[n,e]);Sr(t)}var Xt="io.deephaven.web.client.auth.refreshToken",qo=c.createContext(null),_f=B.module("RefreshTokenUtils");function Ln(){var n=ft.get(Xt);try{if(n!=null)return JSON.parse(n)}catch(e){_f.error("Error parsing refresh token",n,e)}return null}function jn(n){if(n==null){ft.remove(Xt);return}var e=JSON.stringify({bytes:n.bytes,expiry:n.expiry}),t=new Date(n.expiry);ft.set(Xt,e,{secure:!0,sameSite:"strict",expires:t})}function Zo(n){var{children:e}=n,t=Pe(),r=Qe(),[i,a]=c.useState(Ln());c.useEffect(function(){var u=r.addEventListener(t.CoreClient.EVENT_REFRESH_TOKEN_UPDATED,d=>{var{detail:f}=d;jn(f),a(f)});return u},[t,r,i]);var o=c.useCallback(()=>{a(Ln())},[]),s=c.useCallback(()=>{jn(null),a(null)},[]);return sn(o,s),h.jsx(qo.Provider,{value:i,children:e})}function Fe(){var n=Pe();return c.useMemo(()=>new St(n),[n])}function wf(n,e,t,r){var i=Fe(),[a,o]=c.useState(""),s=nn(a,t),l=c.useCallback(m=>{o(m.trim())},[]),{data:u,isLoading:d}=Et(i.doesColumnValueExist,[n,e,s,r]),f=d||a!==s?null:u;return{valueTrimmed:a,valueTrimmedDebounced:s,valueExists:f,trimAndUpdateValue:l}}var Ti=B.module("useDebouncedViewportSearch"),Sf=200;function Cf(n,e){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Sf,r=Fe(),{table:i,applyFiltersAndRefresh:a}=n,o=c.useMemo(()=>Ze(s=>{if(Ti.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(()=>()=>{Ti.debug("Cancelling debounced search function"),o.cancel()},[o]),o}var Jo=300;function Ef(n){var{viewportData:e,columnName:t,shouldSelectAllOnNoSelection:r,mapItemToValue:i}=n,a=Fe(),o=bo(e,i),s=nn(o,Jo),l=po(s,lo);return c.useMemo(()=>sr(a,t,l.selection,r,l.isInverted),[t,l,r,a])}function Cr(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(()=>Ru(...t.map(i=>i(n))),[n,...t])}function Pf(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 Oi(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 Tf(n){return function(){var e=this,t=arguments;return new Promise(function(r,i){var a=n.apply(e,t);function o(l){Oi(a,r,i,o,s,"next",l)}function s(l){Oi(a,r,i,o,s,"throw",l)}o(void 0)})}}function Of(n){var{table:e,columnName:t,defaultValue:r,itemHeight:i,topOffset:a=0,value:o}=n;return c.useCallback(Tf(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 Er(n){var[,e]=c.useState(0),t=Pe();return ct(n,t.Table.EVENT_SIZECHANGED,()=>{e(r=>r+1)}),lr(n)}var If=B.module("useInitializeViewportData");function Qo(n){var e=wo({}),t=Math.max(0,Er(n));return c.useEffect(()=>{var r=e.items.length;t!==r&&(If.debug("size changed:",{currentSize:r,targetSize:t}),e.setItems(Array.from(Za(0,t-1))))},[t,n]),e}function es(n,e,t){return c.useCallback(function(i){var[a,o]=Ja(i,e,t,lr(n));n==null||n.setViewport(a,o)},[n,t,e])}var Ii=B.module("useViewportData");function Pr(n){var{table:e,itemHeight:t=1,scrollDebounce:r=Ad,viewportSize:i=10,viewportPadding:a=50,deserializeRow:o=qa}=n,s=Qo(e),l=es(e,i,a),u=c.useCallback(g=>{e&&!zt(e)?l(g):Ii.debug("setViewport called on closed table.",e)},[e,l]),d=c.useCallback(g=>{e&&!zt(e)?(e.applyFilter(g),u(0)):Ii.debug("applyFiltersAndRefresh called on closed table.",e)},[u,e]),f=Pe(),m=c.useMemo(()=>Ka(s,o),[o,s]);ct(e,f.Table.EVENT_UPDATED,m);var p=Er(e);c.useEffect(()=>{u(0)},[e,u,p]);var v=yo(t,u,r);return c.useMemo(()=>({viewportData:s,size:p,table:e,applyFiltersAndRefresh:d,setViewport:u,onScroll:v}),[d,v,u,p,e,s])}function Tr(n,e){var{applyFiltersAndRefresh:t}=n;c.useEffect(()=>{t(e)},[t,e])}function Df(n,e){for(var t=Fe(),[r,i]=c.useState(""),a=c.useMemo(()=>or(t,e,r),[e,r,t]),o=Gt(i,ro),s=Pr({table:n,itemHeight:xd,viewportSize:io,viewportPadding:ao}),l=arguments.length,u=new Array(l>2?l-2:0),d=2;d<l;d++)u[d-2]=arguments[d];var f=Cr(s.table,a,...u);return Tr(s,f),{list:s,onSearchTextChange:o}}function xf(n){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"or",t=Fe(),r=c.useMemo(()=>Ga(t),[t]);return c.useMemo(()=>ar(n,r,e),[n,e,r])}function ts(n){c.useEffect(()=>()=>{n!=null&&(zt(n)||n.close())},[n])}function Af(n,e,t){for(var r=Fe(),[i,a]=c.useState(""),[o,s]=c.useState(""),[l,u]=c.useState(null),[d,f]=c.useState(()=>new Map),{data:m,isLoading:p}=Et(r.doesColumnValueExist,[n,e,o,!1]),v=p||o!==i?null:m,g=c.useMemo(()=>or(r,e,o),[e,o,r]),b=c.useMemo(()=>sr(r,e,new Set(d.keys()),!1,!0),[e,d,r]),_=arguments.length,w=new Array(_>3?_-3:0),y=3;y<_;y++)w[y-3]=arguments[y];var{data:P}=Et(r.createDistinctSortedColumnTable,[n,e,"asc",...w]);ts(P);var S=Pr({table:P,itemHeight:Dd,viewportSize:io,viewportPadding:ao}),D=i.length>0&&S.size===0,O=d.has(i),M=Gt(s,ro),F=c.useCallback($=>{a($),M($)},[M]),E=Gt(u,0),I=c.useCallback($=>{if(a(""),s(""),u($),E(null),$!=null){var V=S.viewportData.findItem($);if(V!=null){var K=t(V);f(q=>{var se=new Map(q);return se.set(K,{value:K}),se})}}},[E,S.viewportData,t]),L=c.useCallback($=>{f(V=>{if($.size===0)return V;var K=new Map(V);for(var q of $)K.set(q,{value:q});return K})},[]),X=c.useCallback($=>{f(V=>{if($==="all")return new Map;var K=new Map(V);for(var q of $)K.delete(q);return K})},[]),J=Cr(S.table,g,b);return Tr(S,J),c.useMemo(()=>({list:S,hasSearchTextWithZeroResults:D,searchText:i,searchTextExists:v,searchTextIsInSelectedValues:O,selectedKey:l,selectedValueMap:d,onSearchTextChange:F,onSelectKey:I,onAddValues:L,onRemoveValues:X}),[D,S,L,X,F,I,i,v,O,l,d])}function Di(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 Mf(n){return function(){var e=this,t=arguments;return new Promise(function(r,i){var a=n.apply(e,t);function o(l){Di(a,r,i,o,s,"next",l)}function s(l){Di(a,r,i,o,s,"throw",l)}o(void 0)})}}function Nf(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(Mf(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}=Et(i,[]);return c.useEffect(()=>()=>{a==null||a.close()},[a]),{distinctTable:a,error:o,isError:s,isLoading:l}}function Lf(n,e){var t=Fe(),r=c.useMemo(()=>Xa(t,n),[n,t]);return c.useMemo(()=>ar(e,r),[e,r])}function jf(n,e,t){var r=Fe();return c.useMemo(()=>Ya(r,n,e,t),[n,t,r,e])}const Ff=Object.freeze(Object.defineProperty({__proto__:null,ConnectionContext:Qa,DEBOUNCE_MS:Jo,REFRESH_TOKEN_KEY:Xt,RefreshTokenBootstrap:Zo,RefreshTokenContext:qo,TableInput:wr,makeApiContextWrapper:Gh,readRefreshToken:Ln,storeRefreshToken:jn,useBroadcastChannel:Sr,useBroadcastLoginListener:sn,useCheckIfExistsValue:wf,useConnection:$u,useDebouncedViewportSearch:Cf,useDebouncedViewportSelectionFilter:Ef,useFilterConditionFactories:Cr,useFilteredItemsWithDefaultValue:Pf,useGetItemPosition:Of,useInitializeViewportData:Qo,useNotNullOrEmptyFilter:xf,usePickerWithSelectedValues:Af,useSearchableViewportData:Df,useSelectDistinctTable:Nf,useSetPaddedViewportCallback:es,useShowOnlyEmptyFilter:Lf,useTable:Xo,useTableClose:ts,useTableColumn:Yo,useTableListener:ct,useTableSize:Er,useTableUtils:Fe,useValueFilter:jf,useViewportData:Pr,useViewportFilter:Tr},Symbol.toStringTag,{value:"Module"}));var ns=c.createContext(!1);function Rf(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(ns.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 Or=c.createContext(null),Ir=Object.freeze({AUTH_PLUGIN:"AuthPlugin",DASHBOARD_PLUGIN:"DashboardPlugin",WIDGET_PLUGIN:"WidgetPlugin",TABLE_PLUGIN:"TablePlugin",THEME_PLUGIN:"ThemePlugin"});function $f(n){return"DashboardPlugin"in n}function Fn(n){return"AuthPlugin"in n}function kf(n){return"TablePlugin"in n}function Bf(n){return $f(n)||Fn(n)||kf(n)}function Uf(n){return"type"in n&&n.type===Ir.AUTH_PLUGIN}function Wf(n){return"type"in n&&n.type===Ir.THEME_PLUGIN}function Hf(n){if(n==null)return!1;var e=n;return e.Component!==void 0&&typeof e.isAvailable=="function"}var rs="io.deephaven.auth.AnonymousAuthenticationHandler",Vf="io.deephaven.authentication.psk.PskAuthenticationHandler";function xi(n,e,t){return e=zf(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function zf(n){var e=Gf(n,"string");return typeof e=="symbol"?e:String(e)}function Gf(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 Kf extends Error{constructor(){super(...arguments),xi(this,"name","AuthenticationError"),xi(this,"isAuthenticationError",!0)}}const is=Kf;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 Xf(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)})}}var Mi=B.module("AuthPluginBase");function Dr(n){var{children:e,getLoginOptions:t}=n,r=Qe(),[i,a]=c.useState(),[o,s]=c.useState(!1);return c.useEffect(()=>{var l=!1;function u(){if(l)throw new ku("Login canceled.")}function d(){return f.apply(this,arguments)}function f(){return f=Xf(function*(){try{var m=yield t();u(),Mi.info("Logging in..."),yield r.login(m),u(),s(!0)}catch(g){if(!l){var p;Mi.error("Unable to login:",g);var v=(p=mt(g))!==null&&p!==void 0?p:"Unable to login. Verify credentials.";a(new is(v)),s(!1)}}}),f.apply(this,arguments)}return d(),()=>{l=!0}},[r,t]),o?h.jsx(h.Fragment,{children:e}):h.jsx(je,{"data-testid":"auth-base-loading",isLoading:i==null,isLoaded:!1,errorMessage:mt(i)})}var Yf={canLogout:!1};function qf(n){var{children:e}=n,t=Pe(),r=c.useCallback(()=>({type:t.CoreClient.LOGIN_TYPE_ANONYMOUS}),[t]);return h.jsx(Dr,{getLoginOptions:r,children:h.jsx(tn.Provider,{value:Yf,children:e})})}var Zf={Component:qf,isAvailable:n=>n.includes(rs)};const as=Zf;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 Jf(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)})}}var Qf=B.module("AuthPluginParent"),em={canLogout:!1};function tm(n){return n!=null&&typeof n.type=="string"}function nm(){return Rn.apply(this,arguments)}function Rn(){return Rn=Jf(function*(){Qf.info("Logging in by delegating to parent window...");var n=yield _r($o);if(!tm(n))throw new Error("Unexpected login options response: ".concat(n));return n}),Rn.apply(this,arguments)}function rm(){var n;return(n=new URLSearchParams(window.location.search).get("authProvider"))!==null&&n!==void 0?n:""}function im(n){var{children:e}=n;return h.jsx(Dr,{getLoginOptions:nm,children:h.jsx(tn.Provider,{value:em,children:e})})}var am={Component:im,isAvailable:()=>yr()!=null&&rm()==="parent"};const os=am;function ss(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:G("btn btn-primary",{"btn-spinner":r},{"btn-cancelable":r}),"data-testid":"btn-login",children:[r&&h.jsxs("span",{children:[h.jsx(Fa,{className:"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 ls(n){var{children:e,logoPath:t="./logo.png"}=n;return h.jsxs("div",{className:"login-container",children:[h.jsx(xo,{}),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 Li(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 gn(n){return function(){var e=this,t=arguments;return new Promise(function(r,i){var a=n.apply(e,t);function o(l){Li(a,r,i,o,s,"next",l)}function s(l){Li(a,r,i,o,s,"throw",l)}o(void 0)})}}var $n="io.deephaven.authentication.psk.PskAuthenticationHandler",us="psk",kn="io.deephaven.web.client.auth.psk.token",st=B.module("AuthPluginPsk");function om(){return new URLSearchParams(window.location.search).get(us)}function sm(){st.debug2("clearWindowToken");var n=new URL(window.location.href);n.searchParams.delete(us),window.history.replaceState(null,"",n.href)}function ji(){var n;return(n=ft.get(kn))!==null&&n!==void 0?n:null}function bn(n){st.debug2("Storing token in cookie",n),n!=null?ft.set(kn,n,{secure:!0,sameSite:"strict"}):ft.remove(kn)}function lm(n){var{children:e,logoPath:t}=n,r=Qe(),i=c.useRef(null),a=c.useRef(null),[o,s]=c.useState(),[l,u]=c.useState(!1),[d,f]=c.useState(!1),[m,p]=c.useState(!1),[v,g]=c.useState(""),b=c.useCallback(function(){var S=gn(function*(D){var O=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;st.info("Logging in..."),p(!0);var M=null;try{if(M=r.login({type:$n,token:D}),a.current=M,yield M,st.info("Logged in successfully"),a.current!==M)return;bn(D),f(!0)}catch(I){if(a.current!==M)return;if(u(!0),O){var F;st.error("Unable to login",I);var E=(F=mt(I))!==null&&F!==void 0?F:"Unable to login: Verify credentials.";s(new is(E))}}p(!1)});return function(D){return S.apply(this,arguments)}}(),[r]),_=c.useCallback(()=>{a.current=null,p(!1)},[]),w=c.useCallback(gn(function*(){st.debug("onLogin");var S=ji();d||m||S==null||b(S,!1)}),[d,m,b]),y=c.useCallback(()=>{bn(null)},[]);sn(w,y),c.useEffect(()=>{var S=!1;function D(){return O.apply(this,arguments)}function O(){return O=gn(function*(){var M,F=(M=om())!==null&&M!==void 0?M:ji();if(sm(),F==null){u(!0);return}p(!0);try{yield r.login({type:$n,token:F}),S||(bn(F),f(!0),p(!1))}catch{S||(u(!0),p(!1))}}),O.apply(this,arguments)}return D(),()=>{S=!0}},[r]);var P=c.useCallback(()=>{m?_():b(v)},[_,m,b,v]);return c.useEffect(function(){var D;(D=i.current)===null||D===void 0||D.focus()},[i,l]),h.jsxs(h.Fragment,{children:[d&&e,l&&h.jsx(Vt,{in:!d,timeout:Je.transitionMs,classNames:"fade",mountOnEnter:!0,unmountOnExit:!0,children:h.jsx(ls,{logoPath:t,children:h.jsx(ss,{errorMessage:mt(o),isLoggingIn:m,onSubmit:P,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:v,onChange:S=>{s(void 0),g(S.target.value)}})]})})})}),h.jsx(je,{"data-testid":"auth-psk-loading",isLoaded:d||l,isLoading:!d&&!l})]})}var um={Component:lm,isAvailable:n=>n.includes($n)};const ds=um;function Fi(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?Fi(Object(t),!0).forEach(function(r){dm(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Fi(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function dm(n,e,t){return e=cm(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function cm(n){var e=hm(n,"string");return typeof e=="symbol"?e:String(e)}function hm(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 fm=B.module("UserUtils");function cs(n,e){return n.get("internal.webClient.appInit.".concat(e))}function hs(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 cs(n,b)}function l(b,_){var w=s(b);return w==="true"?!0:w==="false"?!1:(w!==void 0&&fm.warn("Unexpected value for ".concat(b,": ").concat(w)),_)}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:[],m=l("canCopy",!0),p=l("canDownloadCsv",!0),v=l("canUsePanels",!0),g=l("canLogout",!0);return yn(yn({name:u,operateAs:d,groups:f},a),{},{permissions:yn({canUsePanels:v,canCopy:m,canDownloadCsv:p,canLogout:g},o)})}const mm=Object.freeze(Object.defineProperty({__proto__:null,AUTH_HANDLER_TYPE_ANONYMOUS:rs,AUTH_HANDLER_TYPE_PSK:Vf,AuthPluginAnonymous:as,AuthPluginBase:Dr,AuthPluginParent:os,AuthPluginPsk:ds,Login:ls,LoginForm:ss,UserContext:eo,UserOverrideContext:to,UserPermissionsOverrideContext:tn,getAppInitValue:cs,getUserFromConfig:hs,isAuthPlugin:Hf},Symbol.toStringTag,{value:"Module"})),fs=typeof cn=="function"?cn:cn.default;ur.register([Cd,Ed,Pd,Td,Od,Id]);function ce(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=vm(n,"string");return typeof e=="symbol"?e:String(e)}function vm(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){ce(this,"dh",void 0),ce(this,"listeners",void 0),ce(this,"formatter",void 0),ce(this,"rect",void 0),ce(this,"isDownsamplingDisabled",void 0),ce(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))}}ce(te,"EVENT_UPDATED","ChartModel.EVENT_UPDATED");ce(te,"EVENT_DISCONNECT","ChartModel.EVENT_DISCONNECT");ce(te,"EVENT_RECONNECT","ChartModel.EVENT_RECONNECT");ce(te,"EVENT_DOWNSAMPLESTARTED","ChartModel.EVENT_DOWNSAMPLESTARTED");ce(te,"EVENT_DOWNSAMPLEFINISHED","ChartModel.EVENT_DOWNSAMPLEFINISHED");ce(te,"EVENT_DOWNSAMPLEFAILED","ChartModel.EVENT_DOWNSAMPLEFAILED");ce(te,"EVENT_DOWNSAMPLENEEDED","ChartModel.EVENT_DOWNSAMPLENEEDED");ce(te,"EVENT_LOADFINISHED","ChartModel.EVENT_LOADFINISHED");const ye=te;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 tt(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){ae(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 ae(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=bm(n,"string");return typeof e=="symbol"?e:String(e)}function bm(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 vt=B.module("ChartUtils"),$i="io.deephaven.time.DateTime",ym=36e5,_m=1e6;function wm(n){return n.asDate!==void 0}function Sm(n){return n.asNumber!==void 0}function ki(n){return n.dhTimeZone!==void 0}function Cm(n){return n!=null&&n.range!=null&&(n.autorange===!1||n.autorange===void 0)}class T{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,m,p]=a,v=l.replace(",","").length,g=s.indexOf(",")>=0||l.indexOf(",")>=0,b=g?",":"",_=f!=null&&f!==""?"e":"f",w=m!==""?m:_,y=u.length+d.length,P="",S="0".concat(v).concat(b,".").concat(y).concat(P).concat(w),D=T.convertNumberPrefix(o),O=T.convertNumberPrefix(p);return{tickformat:S,tickprefix:D,ticksuffix:O,automargin:!0}}static addTickSpacing(e,t,r){var{gapBetweenMajorTicks:i}=t;if(i>0){var a=e||{},o=i;return r&&(o=i/_m),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]:T.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 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];Cm(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(" "):vt.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){ae(this,"dh",void 0),ae(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=T.getAllAxes(e),s=T.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 m=d.series[f],{sources:p}=m,v=p.filter(w=>w.axis),g=function(){var y=v[b],{axis:P}=y,{type:S}=P,D=s.get(S);ze(D);var O=D.indexOf(P),M=r.getAxisPropertyName(S);if(M!=null){var F=T.getAxisLayoutProperty(M,O);if(i.has(F))vt.debug("".concat(F," already added."));else{vt.debug("Adding ".concat(F," to axisFormats."));var E=r.getPlotlyAxisFormat(y,t);if(E===null)i.set(F,a);else{i.set(F,E);var{businessCalendar:I}=P;if(I!=null){var L=[],{businessPeriods:X,businessDays:J,holidays:$,timeZone:V}=I,K=t==null?void 0:t.getColumnTypeFormatter($i),q;ki(K)&&(q=K.dhTimeZone);var se=q?(V.standardOffset-q.standardOffset)/60:0;$.length>0&&L.push(...r.createRangeBreakValuesFromHolidays($,V,q)),X.forEach(j=>L.push({pattern:"hour",bounds:[T.periodToDecimal(j.close)+se,T.periodToDecimal(j.open)+se]})),J.length<r.daysOfWeek.length&&r.createBoundsFromDays(J).forEach(j=>L.push({pattern:"day of week",bounds:j})),E.rangebreaks=L}if(i.size===d.axes.length)return{v:i}}}}},b=0;b<v.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(T.MODE_LINES),(r??!0)&&a.add(T.MODE_MARKERS);break;case i.plot.SeriesPlotStyle.LINE:(t??!0)&&a.add(T.MODE_LINES),(r??!1)&&a.add(T.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?T.ORIENTATION.HORIZONTAL:T.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:m,shape:p,shapeSize:v}=e,g=m.some(P=>{var S;return(S=P.axis)===null||S===void 0?void 0:S.businessCalendar}),b=this.getChartType(u,g),_=this.getPlotlyChartMode(u,s??void 0,l??void 0),w=this.getPlotlySeriesOrientation(e),y=T.makeSeriesData(b,_,o,a,w);return this.addSourcesToSeriesData(y,u,m,t),this.addStylingToSeriesData(y,u,i,d,f,p,v,r),y}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);Ea(a,d,[]);var f=l!=null?this.getAxisPropertyName(l.type):null;if(f!=null){var m=i.get(l.type);if(m){var p=m.indexOf(l),v=p>0?"".concat(p+1):"";a["".concat(f,"axis")]="".concat(f).concat(v)}}}}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=T.getMarkerSymbol(o)}catch(f){vt.warn("Unable to handle shape",o,":",f)}s!=null&&(d.marker.size=s*T.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=T.getAllAxes(t),u=0;u<t.charts.length;u+=1){var d=t.charts[u],f=i==null?void 0:i(d),m=this.getChartBounds(t,d,a,o);this.updateLayoutAxes(s,d.axes,l,r,a,o,m,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:m}=t,p=u+d,v=f+m,g=1/s,b=1/l,_=T.AXIS_SIZE_PX/r,w=T.AXIS_SIZE_PX/i,y={bottom:(l-v)*b+(v<l?w/2:0),top:(l-f)*b-(f>0?w/2:0),left:u*g+(u>0?_/2:0),right:p*g-(p<s?_/2:0)},P=T.groupArray(t.axes,"position"),S=(a=P.get(o.plot.AxisPosition.RIGHT))!==null&&a!==void 0?a:[];return S.length>0&&(r>0?y.right-=(y.right-y.left)*Math.max(0,Math.min(T.LEGEND_WIDTH_PX/r,T.MAX_LEGEND_SIZE)):y.right-=(y.right-y.left)*T.DEFAULT_AXIS_SIZE),y}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&&ki(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 St.isDateType(a)?(s=this.getPlotlyDateFormat(t,a,o),s=T.addTickSpacing(s,i,!0)):St.isNumberType(a)&&(s=T.getPlotlyNumberFormat(t,a,o),s=T.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(T.MIN_AXIS_SIZE,Math.min(T.AXIS_SIZE_PX/o,T.MAX_AXIS_SIZE)):T.DEFAULT_AXIS_SIZE,f=o>0?Math.max(T.MIN_AXIS_SIZE,Math.min(T.AXIS_SIZE_PX/a,T.MAX_AXIS_SIZE)):T.DEFAULT_AXIS_SIZE,m=e,p=T.groupArray(t,"position"),v=T.groupArray(t,"type"),g=[...v.keys()],b=T.groupArray(r,"type"),_=0;_<g.length;_+=1){var w=g[_],y=this.getAxisPropertyName(w);if(y!=null){var P=v.get(w),S=b.get(w),D=w===u.plot.AxisType.Y,O=D?o:a;ze(P),ze(S);for(var M=0;M<P.length;M+=1){var F=P[M],E=S.indexOf(F),I=T.getAxisLayoutProperty(y,E);m[I]==null&&(m[I]=this.makeLayoutAxis(w,i));var L=m[I];if(L!=null){this.updateLayoutAxis(L,F,M,p,d,f,s);var{range:X,autorange:J}=L;if(l!=null&&X!==void 0&&(J===void 0||J===!1)){var $=l(F),[V,K]=$(X);vt.debug("Setting downsample range",O,V,K),F.range(O,V,K)}else F.range(O)}}}}}removeStaleAxes(e,t){for(var r=e,i=T.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=T.getAxisLayoutProperty(d,u);r[f]!=null;)delete r[f],u+=1,f=T.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,m=e,p=(l=t.label)!==null&&l!==void 0?l:"";if(m.title!==void 0&&typeof m.title!="string"?m.title.text=p:m.title={text:p},t.log&&(m.type="log"),m.side=this.getAxisSide(t.position),r>0){var v,g;m.overlaying=(v=this.getAxisPropertyName(t.type))!==null&&v!==void 0?v:void 0;var b=(g=i.get(t.position))!==null&&g!==void 0?g:[],_=b.indexOf(t);_>0&&(m.anchor="free",t.position===u.plot.AxisPosition.RIGHT?m.position=s.right+(_-b.length+1)*f:t.position===u.plot.AxisPosition.TOP?m.position=s.top+(_-b.length+1)*f:t.position===u.plot.AxisPosition.BOTTOM?m.position=s.bottom+(b.length-_+1)*f:t.position===u.plot.AxisPosition.LEFT&&(m.position=s.left+(b.length-_+1)*f))}else if(t.type===u.plot.AxisType.X){var w=i.get(u.plot.AxisPosition.LEFT)||[],y=i.get(u.plot.AxisPosition.RIGHT)||[],P=Math.max(s.left,s.left+(w.length-1)*o),S=Math.min(s.right-(y.length-1)*o,s.right);m.domain=[P,S]}else if(t.type===u.plot.AxisType.Y){var D=i.get(u.plot.AxisPosition.BOTTOM)||[],O=i.get(u.plot.AxisPosition.TOP)||[],M=Math.max(s.bottom,s.bottom+(D.length-1)*a),F=Math.min(s.top-(O.length-1)*a,s.top);m.domain=[M,F]}}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(m=>{a.push(m.open),a.push(m.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=ym*(T.periodToDecimal(u)-T.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,$i,t),r):e}makeFigureSettings(e,t){var{dh:r}=this,{series:i,xAxis:a,type:o}=e,s=T.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(wm(e))return r.i18n.DateTimeFormat.format(T.DATE_FORMAT,e,t);if(Sm(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(St.isDateType(t)&&typeof e=="string"){var a=e,o=T.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}}};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,r=tt(tt({},e),{},{autosize:!0,colorway:T.getColorwayFromTheme(e),font:{family:"'Fira Sans', sans-serif",color:e.title_color},title:{font:{color:e.title_color},yanchor:"top",pad:tt({},T.DEFAULT_TITLE_PADDING),y:1},legend:{font:{color:e.title_color}},margin:tt({},T.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)}});return r.datarevision=0,r}hydrateSettings(e){var{dh:t}=this;return tt(tt({},e),{},{type:e.type!=null?t.plot.SeriesPlotStyle[e.type]:void 0})}}ae(T,"DEFAULT_AXIS_SIZE",.15);ae(T,"MIN_AXIS_SIZE",.025);ae(T,"MAX_AXIS_SIZE",.2);ae(T,"AXIS_SIZE_PX",75);ae(T,"LEGEND_WIDTH_PX",50);ae(T,"MAX_LEGEND_SIZE",.25);ae(T,"ORIENTATION",Object.freeze({HORIZONTAL:"h",VERTICAL:"v"}));ae(T,"DATE_FORMAT","yyyy-MM-dd HH:mm:ss.SSSSSS");ae(T,"DEFAULT_MARGIN",Object.freeze({l:60,r:50,t:30,b:60,pad:0}));ae(T,"DEFAULT_TITLE_PADDING",Object.freeze({t:8}));ae(T,"SUBTITLE_LINE_HEIGHT",25);ae(T,"DEFAULT_MARKER_SIZE",6);ae(T,"MODE_MARKERS","markers");ae(T,"MODE_LINES","lines");const re=T;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 Ui(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){oe(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 oe(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=Pm(n,"string");return typeof e=="symbol"?e:String(e)}function Pm(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=B.module("Chart");class Xe 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){super(e),oe(this,"currentSeries",void 0),oe(this,"PlotComponent",void 0),oe(this,"plot",void 0),oe(this,"plotWrapper",void 0),oe(this,"columnFormats",void 0),oe(this,"dateTimeFormatterOptions",void 0),oe(this,"decimalFormatOptions",void 0),oe(this,"integerFormatOptions",void 0),oe(this,"rect",void 0),oe(this,"ranges",void 0),oe(this,"isSubscribed",void 0),oe(this,"isLoadedFired",void 0),oe(this,"resizeObserver",void 0),oe(this,"getCachedConfig",En((t,r,i,a,o)=>{var s=[],l=!!t;if(l&&s.push({name:"Downsampling failed: ".concat(t),title:"Downsampling failed",click:()=>{},icon:Xe.convertIcon(kl),attr:"fill-warning"}),r||i||a||l){var u=Xe.downsampleButtonTitle(i,a),d=Xe.downsampleButtonAttr(i,a),f=i?Bl:Ul;s.push({name:u,title:"Downsampling status",icon:Xe.convertIcon(f),click:this.handleDownsampleClick,attr:d})}var m=o.some(b=>{var{type:_}=b;return _!=null&&!_.includes("3d")}),p=o.some(b=>{var{type:_}=b;return _!=null&&_.includes("3d")}),v=["zoomIn2d","zoomOut2d","autoScale2d","resetScale2d"],g=["orbitRotation","tableRotation","resetCameraDefault3d"];return{displaylogo:!1,displayModeBar:i||l?!0:"hover",modeBarButtons:[s,["toImage"],["zoom2d","pan2d"],[...m?v:[],...p?g:[]]]}})),this.handleAfterPlot=this.handleAfterPlot.bind(this),this.handleDownsampleClick=this.handleDownsampleClick.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=fs(e.Plotly),this.plot=z.createRef(),this.plotWrapper=z.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,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:Ui(Ui({},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)})}handleModelEvent(e){var{type:t,detail:r}=e;switch(ke.debug2("Received data update",t,r),t){case ye.EVENT_UPDATED:{this.currentSeries+=1,this.setState(f=>{var{layout:m,revision:p}=f;return typeof m.datarevision=="number"&&(m.datarevision+=1),{data:r,layout:m,revision:p+1}});var{onUpdate:i}=this.props;i({isLoading:!this.isLoadedFired});break}case ye.EVENT_LOADFINISHED:{var{onUpdate:a}=this.props;this.isLoadedFired=!0,a({isLoading:!1});break}case ye.EVENT_DISCONNECT:{var{onDisconnect:o}=this.props;o();break}case ye.EVENT_RECONNECT:{var{onReconnect:s}=this.props;s();break}case ye.EVENT_DOWNSAMPLESTARTED:{this.setState({isDownsampleFinished:!1,isDownsampleInProgress:!0,downsamplingError:null});break}case ye.EVENT_DOWNSAMPLEFINISHED:{this.setState({isDownsampleFinished:!0,isDownsampleInProgress:!1,downsamplingError:null});break}case ye.EVENT_DOWNSAMPLENEEDED:case ye.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 Error(u));break}default:ke.debug("Unknown event type",t,e)}}handlePlotUpdate(e){var{layout:t}=e,r=re.getLayoutRanges(t),i=!Ve(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})}}}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=ut.getColumnFormats(e),r=ut.getDateTimeFormatterOptions(e),{decimalFormatOptions:i={},integerFormatOptions:a={}}=e;(!Ve(this.columnFormats,t)||!Ve(this.dateTimeFormatterOptions,r)||!Ve(this.decimalFormatOptions,i)||!Ve(this.integerFormatOptions,a))&&(this.columnFormats=ut.getColumnFormats(e),this.dateTimeFormatterOptions=r,this.decimalFormatOptions=i,this.integerFormatOptions=a,this.updateFormatter())}updateFormatter(){var{model:e}=this.props,t=new en(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,layout:s,revision:l}=this.state,u=this.getCachedConfig(r,i,a,o,t??[]),d=t!=null;return h.jsx("div",{className:"h-100 w-100 chart-wrapper",ref:this.plotWrapper,children:d&&h.jsx(e,{ref:this.plot,data:t,layout:s,revision:l,config:u,onAfterPlot:this.handleAfterPlot,onError:ke.error,onRelayout:this.handleRelayout,onUpdate:this.handlePlotUpdate,onRestyle:this.handleRestyle,useResizeHandler:!0,style:{height:"100%",width:"100%"}})})}}oe(Xe,"defaultProps",{isActive:!0,settings:{timeZone:"America/New_York",defaultDateTimeFormat:za.FULL_DATE_FORMAT,showTimeZone:!1,showTSeparator:!0,formatter:[]},Plotly:ur,onDisconnect:()=>{},onReconnect:()=>{},onUpdate:()=>{},onError:()=>{},onSettingsChanged:()=>{}});const Tm=Xe;function Wi(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 Hi(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Wi(Object(t),!0).forEach(function(r){Z(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Wi(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function Z(n,e,t){return e=Om(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Om(n){var e=Im(n,"string");return typeof e=="symbol"?e:String(e)}function Im(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 le=B.module("FigureChartModel");class ln extends ye{constructor(e,t,r){var i,a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};super(e),i=this,Z(this,"chartUtils",void 0),Z(this,"dh",void 0),Z(this,"figure",void 0),Z(this,"settings",void 0),Z(this,"theme",void 0),Z(this,"data",void 0),Z(this,"layout",void 0),Z(this,"seriesDataMap",void 0),Z(this,"pendingSeries",void 0),Z(this,"oneClicks",void 0),Z(this,"filterColumnMap",void 0),Z(this,"lastFilter",void 0),Z(this,"isConnected",void 0),Z(this,"seriesToProcess",void 0),Z(this,"addPendingSeries",Ze(()=>{for(var s=re.getAllAxes(this.figure),{pendingSeries:l}=this,u=function(){var m,p=l[d],v=i.figure.charts.find(g=>g.series.includes(p));i.addSeries(p,s,(m=v==null?void 0:v.showLegend)!==null&&m!==void 0?m:null),p.subscribe()},d=0;d<l.length;d+=1)u();this.pendingSeries=[]},ln.ADD_SERIES_DEBOUNCE)),Z(this,"getTimeZone",at((s,l)=>{if(l!=null){var u=l.getColumnTypeFormatter(s);if(u!=null)return u.dhTimeZone}})),Z(this,"getValueTranslator",at((s,l)=>{var u=this.getTimeZone(s,l);return d=>this.chartUtils.unwrapValue(d,u)})),Z(this,"getValueParser",at((s,l)=>{var u=this.getTimeZone(s,l);return d=>this.chartUtils.wrapValue(d,s,u)})),Z(this,"getRangeParser",at((s,l)=>u=>{var[d,f]=u,m=this.getValueParser(s,l);return d=m(d),f=m(f),[d,f]})),Z(this,"getAxisRangeParser",at((s,l)=>u=>{var d=re.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 re(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.charts.length>0){var e=this.figure.charts[0];return e.title}return""}initAllSeries(){this.oneClicks=[],this.filterColumnMap.clear();for(var{charts:e}=this.figure,t=re.getAllAxes(this.figure),r=[],i=0;i<e.length;i+=1)for(var a=e[i],o=0;o<a.series.length;o+=1){var s=a.series[o];r.push(s.name),this.addSeries(s,t,a.showLegend)}for(var l=[...this.seriesDataMap.keys()],u=l.filter(m=>r.indexOf(m)<0),d=0;d<u.length;d+=1){var f=u[d];this.seriesDataMap.delete(f)}this.seriesToProcess=new Set([...this.seriesDataMap.keys()])}addSeries(e,t,r){var{dh:i}=this,a=re.groupArray(t,"type"),o=this.chartUtils.makeSeriesDataFromSeries(e,a,re.getSeriesVisibility(e.name,this.settings),this.theme,r);if(this.seriesDataMap.set(e.name,o),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=re.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:s}=e,{columns:l}=s,u=0;u<l.length;u+=1)this.filterColumnMap.set(l[u].name,l[u]);this.oneClicks.push(s)}this.updateLayoutFormats()}subscribe(e){super.subscribe(e),this.listeners.length===1&&(this.initAllSeries(),this.subscribeFigure())}unsubscribe(e){super.unsubscribe(e),this.listeners.length===0&&this.unsubscribeFigure()}subscribeFigure(){if(!this.isConnected){le.debug("Ignoring subscribe when figure in disconnected state");return}this.figure.subscribe(this.isDownsamplingDisabled?this.dh.plot.DownsampleOptions.DISABLE:this.dh.plot.DownsampleOptions.DEFAULT)}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){le.debug("Downsample started",e),this.fireDownsampleStart(e.detail)}handleDownsampleFinish(e){le.debug("Downsample finished",e),this.fireDownsampleFinish(e.detail)}handleDownsampleFail(e){le.error("Downsample failed",e),this.fireDownsampleFail(e.detail)}handleDownsampleNeeded(e){le.info("Downsample needed",e),this.fireDownsampleNeeded(e.detail)}handleFigureUpdated(e){var{detail:t}=e,{series:r}=t;le.debug2("handleFigureUpdated",r);for(var i=0;i<r.length;i+=1){var a=r[i];le.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),m=t.getArray(a,d,f);this.setDataArrayForSeries(a,d,m)}this.seriesToProcess.delete(a.name),this.seriesToProcess.size===0&&this.fireLoadFinished(),this.cleanSeries(a)}var{data:p}=this;this.fireUpdate(p)}handleRequestFailed(e){le.error("Request failed",e)}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){le.debug("Figure disconnected",e),this.isConnected=!1,this.listeners.length>0&&this.unsubscribeFigure(),this.fireDisconnect()}handleFigureReconnected(e){le.debug("Figure reconnected",e),this.isConnected=!0,this.initAllSeries(),this.fireReconnect(),this.listeners.length>0&&this.subscribeFigure()}handleFigureSeriesAdded(e){var{detail:t}=e;le.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=re.DEFAULT_MARGIN.t+i*re.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=Hi({},this.layout.title),this.layout.title.text=e,this.layout.title.pad=Hi({},this.layout.title.pad),this.layout.title.pad.t=re.DEFAULT_TITLE_PADDING.t+i*re.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)=>{le.debug("Assigning ".concat(r),this.layout[r],t);var i=this.layout[r];i!=null?Object.assign(i,t):le.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&&Ea(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:m,y:p,yLow:v,yHigh:g}=a;f&&m&&f!==d&&(a.error_x=re.getPlotlyErrorBars(d,f,m,this.theme)),v&&g&&v!==p&&(a.error_y=re.getPlotlyErrorBars(p,v,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){le.warn("Trying to set a filter, but no one click!");return}le.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}}Z(ln,"ADD_SERIES_DEBOUNCE",50);const Bn=ln;function Vi(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 _n(n){return function(){var e=this,t=arguments;return new Promise(function(r,i){var a=n.apply(e,t);function o(l){Vi(a,r,i,o,s,"next",l)}function s(l){Vi(a,r,i,o,s,"throw",l)}o(void 0)})}}class xr{static makeModelFromSettings(e,t,r,i){return _n(function*(){var a=yield xr.makeFigureFromSettings(e,t,r);return new Bn(e,a,i,t)})()}static makeFigureFromSettings(e,t,r){return _n(function*(){var i=yield r.copy();return i.applyCustomColumns(r.customColumns),i.applyFilter(r.filter),i.applySort(r.sort),e.plot.Figure.create(new re(e).makeFigureSettings(t,i))})()}static makeModel(e,t,r,i){return _n(function*(){return new Bn(e,r,i,t)})()}}const Dm=xr,xm="var(--dh-color-chart-colorway)",Am="var(--dh-color-chart-grid)",Mm="var(--dh-color-chart-axis-line)",Nm="var(--dh-color-chart-axis-line-zero)",Lm="var(--dh-color-chart-active)",jm="var(--dh-color-chart-range-bg)",zi={"paper-bgcolor":"var(--dh-color-chart-bg)","plot-bgcolor":"var(--dh-color-chart-plot-bg)","title-color":"var(--dh-color-chart-title)",colorway:xm,gridcolor:Am,linecolor:Mm,zerolinecolor:Nm,activecolor:Lm,rangebgcolor:jm,"area-color":"var(--dh-color-chart-area)","trend-color":"var(--dh-color-chart-trend)","line-color":"var(--dh-color-chart-line-deprecated)","error-band-line-color":"var(--dh-color-chart-error-band-line)","error-band-fill-color":"var(--dh-color-chart-error-band-fill)","ohlc-increasing":"var(--dh-color-chart-ohlc-increase)","ohlc-decreasing":"var(--dh-color-chart-ohlc-decrease)"};var Gi=B.module("ChartTheme");function Ar(){var n,e=ka(zi);return e.colorway=Ra((n=e.colorway)!==null&&n!==void 0?n:"").map(t=>{var[r,i]=t;return Wl.normalizeCssColor(e.colorway.substring(r,i+1))}).join(" "),Gi.debug2("Chart theme:",zi),Gi.debug2("Chart theme derived:",e),Object.freeze({paper_bgcolor:e["paper-bgcolor"],plot_bgcolor:e["plot-bgcolor"],title_color:e["title-color"],colorway:e.colorway,gridcolor:e.gridcolor,linecolor:e.linecolor,zerolinecolor:e.zerolinecolor,activecolor:e.activecolor,rangebgcolor:e.rangebgcolor,area_color:e["area-color"],trend_color:e["trend-color"],line_color:e["line-color"],error_band_line_color:e["error-band-line-color"],error_band_fill_color:e["error-band-fill-color"],ohlc_increasing:e["ohlc-increasing"],ohlc_decreasing:e["ohlc-decreasing"]})}function Ct(n,e,t){return e=Fm(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Fm(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 Y extends ye{static get theme(){return Y._theme==null&&(Y._theme=Ar()),Y._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,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+Math.random()*r/5+u*Y.smoothing)*t;f=Math.round(f*100)/100,a.push(f),s.push(40+u*Y.smoothing),o.push(Math.sin(u/r*e)*r/3+Math.random()*r/10+u*Y.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:{color:Y.theme.area_color,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",color:Y.theme.trend_color}}}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",fillcolor:Y.theme.error_band_fill_color,line:{width:0,color:Y.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:{color:Y.theme.line_color,width:3}}}static makeRandomData(){var e=Y.makeRandomSeries(6),t=Y.makeArea(e),r=Y.makeTrendline(e),i=Y.makeRandomSeries(2),a=Y.makeLine(i),o=Y.makeErrorBand(i);return[t,r,a,o]}static makeDefaultLayout(e){var t=new re(e).makeDefaultLayout(Y.theme);return t.title="Chart",t.xaxis&&(t.xaxis.title="Datestamp"),t.yaxis&&(t.yaxis.title="Price"),t}constructor(e){var{data:t=Y.makeRandomData(),layout:r=Y.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(Y,"smoothing",1.5);Ct(Y,"_theme",void 0);const $m=Y,km=fs(ur);var Mr=c.createContext(null);function ms(n){var{children:e}=n,{activeThemes:t}=Lo(),[r,i]=c.useState(null);return c.useEffect(()=>{t!=null&&i(Ar())},[t]),h.jsx(Mr.Provider,{value:r,children:e})}function Bm(n){return n.setFigure!==void 0}function Um(){return pt(Mr,"No ChartThemeContext value found.")}const Wm=Object.freeze(Object.defineProperty({__proto__:null,Chart:Tm,ChartModel:ye,ChartModelFactory:Dm,ChartThemeContext:Mr,ChartThemeProvider:ms,ChartUtils:re,FigureChartModel:Bn,MockChartModel:$m,Plot:km,defaultChartTheme:Ar,isFigureChartModel:Bm,useChartTheme:Um},Symbol.toStringTag,{value:"Module"}));var ps=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 vs(n){return n.componentName!==void 0}function Hm(n){return n.component!==void 0}var gs=Object.freeze({type:"default",isClosable:!0,isFocusOnShow:!0,reorderEnabled:!0,title:""});const Vm=Object.freeze(Object.defineProperty({__proto__:null,defaultConfig:ps,isGLComponentConfig:vs,isReactComponentConfig:Hm,itemDefaultConfig:gs},Symbol.toStringTag,{value:"Module"}));function Ht(n,e,t){return e=zm(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function zm(n){var e=Gm(n,"string");return typeof e=="symbol"?e:String(e)}function Gm(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 Pt{constructor(){Ht(this,"_mSubscriptions",void 0),Ht(this,"off",this.unbind),Ht(this,"trigger",this.emit),this._mSubscriptions={},this._mSubscriptions[Pt.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[Pt.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(Pt,"ALL_EVENT","__all");const Se=Pt;function be(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=Xm(n,"string");return typeof e=="symbol"?e:String(e)}function Xm(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 Un extends Se{constructor(e,t,r){super(),be(this,"width",void 0),be(this,"height",void 0),be(this,"title",void 0),be(this,"parent",void 0),be(this,"layoutManager",void 0),be(this,"tab",void 0),be(this,"_config",void 0),be(this,"isHidden",!1),be(this,"beforeCloseHandler",void 0),be(this,"_element",A(['<div class="lm_item_container">','<div class="lm_content" tabindex="-1"></div>',"</div>"].join(""))),be(this,"_contentElement",void 0),this.title=vs(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)),m=d/f*100,p=(((a=s.config[u])!==null&&a!==void 0?a:0)-m)/(o.contentItems.length-1),v=0;v<o.contentItems.length;v++)if(o.contentItems[v]===s)o.contentItems[v].config[u]=m;else{var g;o.contentItems[v].config[u]=((g=o.contentItems[v].config[u])!==null&&g!==void 0?g:0)+p}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(A.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 Ym=Object.freeze(Object.defineProperty({__proto__:null,Container:Un,ItemContainer:Un},Symbol.toStringTag,{value:"Module"}));function bs(n){var e=location.hash.match(new RegExp(n+"=([^&]*)"));return e?e[1]:null}function ys(n){if(window.location.hash)return bs(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 qm(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 Zm(n,e){var t=n.replace(/javascript/gi,"j&#97;vascript").replace(/expression/gi,"expr&#101;ssion").replace(/onload/gi,"onlo&#97;d").replace(/script/gi,"&#115;cript").replace(/onerror/gi,"on&#101;rror");return e===!0?t:t.replace(/>/g,"&gt;").replace(/</g,"&lt;")}function jr(n){return A.trim(n.replace(/(<([^>]+)>)/gi,""))}function he(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 ep extends Se{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=A(document),this._eBody=A(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=ep;function nt(n,e,t){return e=tp(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function tp(n){var e=np(n,"string");return typeof e=="symbol"?e:String(e)}function np(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){nt(this,"_container",void 0),nt(this,"_reactComponent",null),nt(this,"_portalComponent",null),nt(this,"_originalComponentWillUpdate",null),nt(this,"_initialState",void 0),nt(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=Pa.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=A.extend(e,this._container._config.props);return z.createElement(this._reactClass,t)}}var Yt=["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"],rp=[!0,!1,"row","column","stack","component","close","maximise","minimise","open in new window"];function Fr(n){if(Yt.length>36)throw new Error("Too many keys in config minifier map");var e={};return Rr(n,e,"_min"),e}function Wn(n){if(Yt.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"?ip:ap;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,Yt);e[s]=o}Rr(a,o,t)}else{var l=r(a,rp);if(Array.isArray(e))e[Number.parseInt(i,10)]=l;else{var u=r(i,Yt);e[u]=l}}}}function ip(n,e){if(typeof n=="string"&&n.length===1)return"___"+n;var t=e.indexOf(n);return t===-1?n:t.toString(36)}function ap(n,e){return typeof n=="string"&&n.length===1?e[parseInt(n,36)]:typeof n=="string"&&n.substr(0,3)==="___"?n[3]:n}function wn(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=sp(n,"string");return typeof e=="symbol"?e:String(e)}function sp(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 Hn{constructor(e,t){wn(this,"name",void 0),wn(this,"origin",void 0),wn(this,"isPropagationStopped",void 0),this.name=e,this.origin=t,this.isPropagationStopped=!1}stopPropagation(){this.isPropagationStopped=!0}}function $t(n,e,t){return e=lp(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function lp(n){var e=up(n,"string");return typeof e=="symbol"?e:String(e)}function up(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 dp=class extends Se{constructor(e){super(),$t(this,"_layoutManager",void 0),$t(this,"_dontPropagateToParent",void 0),$t(this,"_childEventSource",void 0),$t(this,"_boundOnEventFromChild",void 0),this._layoutManager=e,this._dontPropagateToParent=null,this._childEventSource=null,this.on(Se.ALL_EVENT,this._onEventFromThis.bind(this)),this._boundOnEventFromChild=this._onEventFromChild.bind(this),A(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(){A(window).off("gl_child_event",this._boundOnEventFromChild)}};const ws=dp,cp=Object.freeze(Object.defineProperty({__proto__:null,BubblingEvent:Hn,DragListener:Dt,EventEmitter:Se,EventHub:ws,ReactComponentHandler:_s,animFrame:Nr,filterXss:Zm,getHashValue:bs,getQueryStringParam:ys,getUniqueId:Lr,minifyConfig:Fr,removeFromArray:qm,stripTags:jr,unminifyConfig:Wn},Symbol.toStringTag,{value:"Module"}));function Be(n,e,t){return e=hp(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function hp(n){var e=fp(n,"string");return typeof e=="symbol"?e:String(e)}function fp(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 Ss extends Se{constructor(e,t,r,i,a){super(),Be(this,"isInitialised",!1),Be(this,"_config",void 0),Be(this,"_dimensions",void 0),Be(this,"_parentId",void 0),Be(this,"_indexInParent",void 0),Be(this,"_layoutManager",void 0),Be(this,"_popoutWindow",null),Be(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=A.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;A(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 ne(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 et extends Se{constructor(e,t,r,i,a,o){var s,l,u,d,f,m,p,v;if(super(),ne(this,"_dragListener",void 0),ne(this,"_layoutManager",void 0),ne(this,"_contentItem",void 0),ne(this,"_originalParent",void 0),ne(this,"_area",null),ne(this,"_lastValidArea",null),ne(this,"_minX",void 0),ne(this,"_maxX",void 0),ne(this,"_minY",void 0),ne(this,"_maxY",void 0),ne(this,"_width",void 0),ne(this,"_height",void 0),ne(this,"_sided",void 0),ne(this,"element",void 0),ne(this,"childElementContainer",void 0),ne(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=A(et._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(),A(document.body).append(this.element),this._setDimensions(),!this._contentItem.tab&&this._proxyTab.length){var _,w;this._layoutManager.tabDropPlaceholder.width((_=this._proxyTab.outerWidth(!0))!==null&&_!==void 0?_:0),this._layoutManager.tabDropPlaceholder.height((w=this._proxyTab.outerHeight(!0))!==null&&w!==void 0?w:0)}var y=this._layoutManager.container.offset();this._minX=(u=y==null?void 0:y.left)!==null&&u!==void 0?u:0,this._minY=(d=y==null?void 0:y.top)!==null&&d!==void 0?d:0,this._maxX=((f=this._layoutManager.container.width())!==null&&f!==void 0?f:0)+this._minX,this._maxY=((m=this._layoutManager.container.height())!==null&&m!==void 0?m:0)+this._minY,this._width=(p=this.element.width())!==null&&p!==void 0?p:0,this._height=(v=this.element.height())!==null&&v!==void 0?v: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")}}ne(et,"_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 kt(n,e,t){return e=vp(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function vp(n){var e=gp(n,"string");return typeof e=="symbol"?e:String(e)}function gp(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{constructor(e,t,r){kt(this,"_element",void 0),kt(this,"_itemConfig",void 0),kt(this,"_layoutManager",void 0),kt(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(A.extend(!0,{},r));new et(e,t,this._dragListener,this._layoutManager,i,null)}}function Bt(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 Es{constructor(e,t,r){Bt(this,"_element",A(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(A.extend(!0,{},r));new et(e,t,this._dragListener,this._layoutManager,i,null)}}}function Ps(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 xt{constructor(){Ps(this,"element",A(xt._template)),A(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()}}Ps(xt,"_template",'<div class="lm_dropTargetIndicator"><div class="lm_inner"></div></div>');function Sn(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=Cp(n,"string");return typeof e=="symbol"?e:String(e)}function Cp(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 wt{constructor(e,t,r,i){Sn(this,"element",void 0),Sn(this,"_header",void 0),Sn(this,"_action",void 0),this._header=e,this.element=A('<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 Ep(n,e,t){return e=Pp(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Pp(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 Op extends Error{constructor(e,t){super(),Ep(this,"node",void 0),this.name="Configuration Error",this.message=e,this.node=t}}const Ye=Op,Ip=Object.freeze(Object.defineProperty({__proto__:null,ConfigurationError:Ye},Symbol.toStringTag,{value:"Module"}));function ee(n,e,t){return e=Dp(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Dp(n){var e=xp(n,"string");return typeof e=="symbol"?e:String(e)}function xp(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 Tt(n){return n.isStack}function ge(n){return n.isComponent}function Ts(n){return n.isRoot}class ie extends Se{constructor(e,t,r,i){super(),ee(this,"config",void 0),ee(this,"type",void 0),ee(this,"contentItems",void 0),ee(this,"parent",void 0),ee(this,"layoutManager",void 0),ee(this,"element",void 0),ee(this,"childElementContainer",void 0),ee(this,"componentName",void 0),ee(this,"isInitialised",!1),ee(this,"isMaximised",!1),ee(this,"isRoot",!1),ee(this,"isRow",!1),ee(this,"isColumn",!1),ee(this,"isStack",!1),ee(this,"isComponent",!1),ee(this,"tab",void 0),ee(this,"_pendingEventPropagations",void 0),ee(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(Se.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,Tt(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&&ge(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 Hn(e,this);this.emit(e,t)}_createContentItems(e){var t;if(!(e.content instanceof Array))throw new Ye("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(gs)){var i=t;e[i]===void 0&&(e[i]=r)}return e}_propagateEvent(e,t){t instanceof Hn&&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 gt(n,e,t){return e=Ap(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Ap(n){var e=Mp(n,"string");return typeof e=="symbol"?e:String(e)}function Mp(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 Os extends ie{constructor(e,t,r){super(e,t,r,A()),gt(this,"config",void 0),gt(this,"componentName",void 0),gt(this,"container",void 0),gt(this,"parent",void 0),gt(this,"instance",void 0),this.config=t,this.parent=r;var i=e.getComponent(this.config.componentName)||e.getFallbackComponent(),a=A.extend(!0,{},this.config.componentState||{});if(i==null)throw new Ye('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 Un(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(){ie.prototype._$init.call(this),this.container.emit("open")}_$hide(){this.container.hide(),ie.prototype._$hide.call(this)}_$show(){this.container.show(),this.container._config.isFocusOnShow&&this.container._contentElement[0].focus({preventScroll:!0}),ie.prototype._$show.call(this)}_$destroy(){this.container.emit("destroy",this),ie.prototype._$destroy.call(this)}_$getArea(){return null}}function pe(n,e,t){return e=Np(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Np(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)}class qt extends ie{constructor(e,t,r,i){super(t,r,i,A('<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),ie.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)}ie.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(ie.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 m=Math.floor((this._isColumn?a:i)-o);return{itemSizes:s,additionalPixel:m,totalWidth:i,totalHeight:a}}_calculateRelativeSizes(){for(var e=0,t=[],r=this._isColumn?"height":"width",i=0;i<this.contentItems.length;i++)if(this.contentItems[i].config[r]!==void 0){var a;e+=(a=this.contentItems[i].config[r])!==null&&a!==void 0?a:0}else 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 m=a/i;o=a;for(var p=0;p<r.length;p++){l=r[p];var v=Math.round((l.width-t)*m);o-=v,l.width-=v}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 Is(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 Ki(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 Xi(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Ki(Object(t),!0).forEach(function(r){Vn(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Ki(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function Vn(n,e,t){return e=jp(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function jp(n){var e=Fp(n,"string");return typeof e=="symbol"?e:String(e)}function Fp(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 ie{constructor(e,t,r){super(e,Xi(Xi({},t),{},{type:"root"}),null,A('<div class="lm_goldenlayout lm_item lm_root"></div>')),Vn(this,"childElementContainer",void 0),Vn(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(ge(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 Yi(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?Yi(Object(t),!0).forEach(function(r){de(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Yi(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function de(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=$p(n,"string");return typeof e=="symbol"?e:String(e)}function $p(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 ie{constructor(e,t,r){var i,a,o,s,l,u,d,f,m;super(e,t,r,A('<div class="lm_item lm_stack"></div>')),de(this,"_activeContentItem",null),de(this,"_header",void 0),de(this,"childElementContainer",A('<div class="lm_items"></div>')),de(this,"header",void 0),de(this,"parent",void 0),de(this,"isStack",!0),de(this,"_dropZones",{}),de(this,"_dropSegment",null),de(this,"_contentAreaDimensions",null),de(this,"_dropIndex",void 0),de(this,"_side",void 0),de(this,"_sided",!1),de(this,"config",void 0),this.parent=r,this.config=t;var p=e.config;this._side=!1,this._header={show:((i=p.settings)===null||i===void 0?void 0:i.hasHeaders)&&t.hasHeaders!==!1,popout:(a=p.settings)!==null&&a!==void 0&&a.showPopoutIcon?(o=p.labels)===null||o===void 0?void 0:o.popout:void 0,maximise:(s=p.settings)!==null&&s!==void 0&&s.showMaximiseIcon?(l=p.labels)===null||l===void 0?void 0:l.maximise:void 0,close:(u=p.settings)!==null&&u!==void 0&&u.showCloseIcon?(d=p.labels)===null||d===void 0?void 0:d.close:void 0,minimise:(f=(m=p.labels)===null||m===void 0?void 0:m.minimise)!==null&&f!==void 0?f:void 0},p.header&&(this._header=rt(rt({},this._header),p.header)),t.header&&(this._header=rt(rt({},this._header),t.header)),t.content&&t.content[0]&&t.content[0].header&&(this._header=rt(rt({},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(){ie.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(ge(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,m,p,v,g,b,_,w=this.header.tabs.length;if(w===0){var y,P,S,D,O,M,F,E,I=this.header.element.offset();(y=this.layoutManager.dropTargetIndicator)===null||y===void 0||y.highlightArea({x1:(P=I==null?void 0:I.left)!==null&&P!==void 0?P:0,x2:((S=I==null?void 0:I.left)!==null&&S!==void 0?S:0)+100,y1:(D=(O=this.header.element.offset())===null||O===void 0?void 0:O.top)!==null&&D!==void 0?D:0,y2:((M=(F=this.header.element.offset())===null||F===void 0?void 0:F.top)!==null&&M!==void 0?M:0)+((E=this.header.element.innerHeight())!==null&&E!==void 0?E:0)});return}var L=this.header.tabsContainer,X=(t=L.get(0))===null||t===void 0?void 0:t.getBoundingClientRect(),J=(r=this.layoutManager.tabDropPlaceholder.get(0))===null||r===void 0?void 0:r.getBoundingClientRect();if(!(!X||!J)){e<X.left?e=X.left+1:e>X.right&&(e=X.right-1);var $,V;if(!(J.left<e&&e<J.right)){for(var K=0;K<w;K++){var q;if($=this.header.tabs[K].element,V=(q=$.get(0))===null||q===void 0?void 0:q.getBoundingClientRect(),V&&V.left<e&&e<V.right){this._dropIndex=K;break}}if($&&V&&e<V.left+V.width*.5)$.before(this.layoutManager.tabDropPlaceholder);else if($){var se;this._dropIndex=Math.min(((se=this._dropIndex)!==null&&se!==void 0?se:0)+1,w),$.after(this.layoutManager.tabDropPlaceholder)}}var j=(i=(a=this.layoutManager.tabDropPlaceholder.offset())===null||a===void 0?void 0:a.left)!==null&&i!==void 0?i:0;j=Math.max(j,(o=(s=this.header.tabsContainer.offset())===null||s===void 0?void 0:s.left)!==null&&o!==void 0?o:0);var U=j+((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)),(m=this.layoutManager.dropTargetIndicator)===null||m===void 0||m.highlightArea({x1:j,x2:U,y1:(p=(v=this.header.element.offset())===null||v===void 0?void 0:v.top)!==null&&p!==void 0?p: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 kp=Object.freeze(Object.defineProperty({__proto__:null,AbstractContentItem:ie,Component:Os,ContentItem:ie,Root:zn,RowOrColumn:qt,Stack:Gn,isComponent:ge,isRoot:Ts,isStack:Tt},Symbol.toStringTag,{value:"Module"}));function De(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=Up(n,"string");return typeof e=="symbol"?e:String(e)}function Up(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;De(this,"header",void 0),De(this,"contentItem",void 0),De(this,"element",A(At._template)),De(this,"titleElement",void 0),De(this,"closeElement",void 0),De(this,"isActive",!1),De(this,"_layoutManager",void 0),De(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),ge(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),ge(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 et(e,t,this._dragListener,this._layoutManager,this.contentItem,this.header.parent)}_onTabContentFocusIn(){A(".lm_focusin",this._layoutManager.root.element).removeClass("lm_focusin"),this.element.addClass("lm_focusin")}_onTabContentFocusOut(){ge(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&&ge(this.contentItem)?this.header.parent.setActiveContentItem(this.contentItem):ge(this.contentItem)&&!this.contentItem.container._contentElement[0].contains(document.activeElement)&&this.contentItem.container._contentElement.focus(),ge(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(),ge(this.contentItem)?this.contentItem.container.close():this.header.parent.removeChild(this.contentItem)}_onCloseMousedown(e){e.stopPropagation()}}De(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 k(n,e,t){return e=Wp(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Wp(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 Le extends Se{constructor(e,t){var r,i;super(),k(this,"layoutManager",void 0),k(this,"element",A(Le._template)),k(this,"tabsContainer",void 0),k(this,"tabDropdownContainer",void 0),k(this,"tabDropdownSearch",void 0),k(this,"tabDropdownList",null),k(this,"controlsContainer",void 0),k(this,"parent",void 0),k(this,"tabs",[]),k(this,"activeContentItem",null),k(this,"closeButton",null),k(this,"tabDropdownButton",null),k(this,"tabNextButton",A(Le._nextButtonTemplate)),k(this,"tabPreviousButton",A(Le._previousButtonTemplate)),k(this,"holdTimer",null),k(this,"rAF",null),k(this,"CLICK_TIMEOUT",500),k(this,"START_SPEED",.01),k(this,"ACCELERATION",5e-4),k(this,"PADDING",10),k(this,"SCROLL_LEFT","left"),k(this,"SCROLL_RIGHT","right"),k(this,"isDraggingTab",!1),k(this,"isOverflowing",!1),k(this,"isDropdownShown",!1),k(this,"dropdownKeyIndex",0),k(this,"_lastVisibleTabIndex",-1),k(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,m,p=a||d,v=d-p,g=this.START_SPEED*v+.5*this.ACCELERATION*(v*v);g=Math.min(g,(f=(m=this.tabsContainer.get(0))===null||m===void 0?void 0:m.scrollWidth)!==null&&f!==void 0?f:1/0),this._handleScrollRepeat(e,t,g,p)})}}_$setClosable(e){return this.closeButton&&this._isClosable()?(this.closeButton.element[e?"show":"hide"](),!0):!1}_$destroy(){this.emit("destroy",this);for(var e=0;e<this.tabs.length;e++)this.tabs[e]._$destroy();this._detachWheelListener(),this._handleItemDropped(),A(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 wt(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 wt(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 wt(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 wt(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"),A(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"),A(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(),A(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=A(window).height())!==null&&r!==void 0?r:0,l=(i=A(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,m=Math.min(u.left+(f?u.width:0),l-o.width-this.PADDING),p=f?Math.max(u.top-a,this.PADDING):u.bottom,v=s-p-this.PADDING;this.tabDropdownContainer.css({"max-height":v,top:p,left:m})}}}}_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()}}}}k(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(""));k(Le,"_previousButtonTemplate",['<ul class="lm_controls">','<li class="lm_tabpreviousbutton"></li>',"</ul>"].join(""));k(Le,"_nextButtonTemplate",['<li class="lm_tabnextbutton"></li>'].join(""));function bt(n,e,t){return e=Vp(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Vp(n){var e=zp(n,"string");return typeof e=="symbol"?e:String(e)}function zp(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 Is{constructor(e,t,r){bt(this,"_isVertical",void 0),bt(this,"_size",void 0),bt(this,"_grabSize",void 0),bt(this,"_dragListener",void 0),bt(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=A('<div class="lm_drag_handle"></div>'),t=A('<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 Gp=Object.freeze(Object.defineProperty({__proto__:null,BrowserPopout:Ss,DragProxy:et,DragSource:Cs,DragSourceFromEvent:Es,DropTargetIndicator:xt,Header:Le,HeaderButton:wt,Splitter:Is,Tab:At},Symbol.toStringTag,{value:"Module"}));var Kp={config:Vm,container:Ym,controls:Gp,errors:Ip,items:kp,utils:cp};const Xp=Kp;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 ue(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){H(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 H(n,e,t){return e=Yp(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Yp(n){var e=qp(n,"string");return typeof e=="symbol"?e:String(e)}function qp(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 Ds extends Se{static minifyConfig(e){return Fr(e)}static unminifyConfig(e){return Wn(e)}constructor(e,t){super(),H(this,"isInitialised",!1),H(this,"_isFullPage",!1),H(this,"_resizeTimeoutId",void 0),H(this,"_components",{"lm-react-component":_s}),H(this,"_fallbackComponent",void 0),H(this,"_itemAreas",[]),H(this,"_maximisedItem",null),H(this,"_maximisePlaceholder",A('<div class="lm_maximise_place"></div>')),H(this,"_creationTimeoutPassed",!1),H(this,"_subWindowsCreated",!1),H(this,"_dragSources",[]),H(this,"_updatingColumnsResponsive",!1),H(this,"_firstLoad",!0),H(this,"_reactChildMap",new Map),H(this,"_reactChildren",null),H(this,"width",null),H(this,"height",null),H(this,"root",void 0),H(this,"openPopouts",[]),H(this,"selectedItem",null),H(this,"isSubWindow",!1),H(this,"eventHub",new ws(this)),H(this,"config",void 0),H(this,"container",void 0),H(this,"_originalContainer",void 0),H(this,"dropTargetIndicator",null),H(this,"tabDropPlaceholder",A('<div class="lm_drop_tab_placeholder"></div>')),H(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&&A("body").css("visibility","hidden"),this._typeToItem={column:qt.bind(this,!0),row:qt.bind(this,!1),stack:Gn,component:Os}}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 ie))throw new Error("Root must be a ContentItem");var t={settings:ue({},this.config.settings),dimensions:ue({},this.config.dimensions),labels:ue({},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){A(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(),A(window).off("resize",this._onResize),A(window).off("unload beforeunload",this._onUnload),A(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 Ye("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 Ye(r);return e.type==="component"&&!(t instanceof Gn)&&t&&!(this.isSubWindow===!0&&t instanceof zn)&&(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 ie,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 m;i=(m=u)===null||m===void 0?void 0:m.contentItems.indexOf(d)}}else e instanceof Array?a=e:a=[e];if(!t&&o){var p,v,g,b=window.screenX||window.screenLeft,_=window.screenY||window.screenTop,w=(p=e.element.offset())!==null&&p!==void 0?p:{left:0,top:0};t={left:b+w.left,top:_+w.top,width:(v=e.element.width())!==null&&v!==void 0?v: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 y=new Ss(a,t,r,i,this);return y.on("initialised",function(){s.emit("windowOpened",y)}),y.on("closed",function(){s._$reconcilePopoutWindows()}),this.openPopouts.push(y),y}}createDragSource(e,t){this.config.settings.constrainDragToContainer=!1;var r=new Cs(e,t,this);return this._dragSources.push(r),r}createDragSourceFromEvent(e,t){return this.config.settings.constrainDragToContainer=!1,new Es(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=ue({},this.root._$getArea()),r=[ue(ue({},t),{},{side:"left",x2:t.x1+e}),ue(ue({},t),{},{side:"right",x1:t.x2-e}),ue(ue({},t),{},{side:"top",y2:t.y1+e}),ue(ue({},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(Tt(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=ue(ue({},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 ie)return e;if(A.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&&A(window).resize(this._onResize),A(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=ys("gl-window");r&&(this.isSubWindow=!0,e=JSON.parse(localStorage.getItem(r)||"{}"),e=Wn(e),localStorage.removeItem(r)),e=A.extend(!0,{},ps,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=A('<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:""),A("head").append(A("body link, body style, template, .gl_keep")),this.container=A("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?A(this._originalContainer):A("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,A("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 Ye(t,e);if(e.content.length>1)throw t="Top level content can't contain more then one element.",new Ye(t,e);this.root=new zn(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=>{Tt(r)?e.push(r):r.isComponent||this._findAllStackContainersRecursive(e,r)})}}H(Ds,"__lm",Xp);const xs=Ds,Zp="_lm_dragging_27ejx_1",Jp="_lm_goldenlayout_27ejx_1",Qp="_lm_header_27ejx_1",ev="_lm_controls_27ejx_1",tv="_lm_tabpreviousbutton_27ejx_1",nv="_lm_tabnextbutton_27ejx_1",rv="_lm_tab_27ejx_1",iv="_lm_active_27ejx_1",av="_lm_close_tab_27ejx_1",ov="_lm_content_27ejx_1",sv="_lm_dragProxy_27ejx_1",lv="_lm_dropTargetIndicator_27ejx_1",uv="_march_27ejx_1",dv="_lm_inner_27ejx_1",cv="_lm_splitter_27ejx_1",hv="_lm_selectable_27ejx_1",fv="_lm_tabdropdown_list_27ejx_1",mv="_lm_title_27ejx_1",pv="_lm_title_before_27ejx_1",vv="_lm_selected_27ejx_1",gv="_lm_focusin_27ejx_1",bv="_lm_window_blur_27ejx_1",yv="_lm_popout_27ejx_1",_v="_lm_maximise_27ejx_1",wv="_lm_tabdropdown_27ejx_1",Sv="_lm_close_27ejx_1",Cv="_lm_tabdropdown_search_27ejx_1",Ev="_lm_tabs_27ejx_1",Pv="_lm_keyboard_active_27ejx_1",Tv="_lm_maximised_27ejx_1",Ov="_lm_items_27ejx_1",Zi={"tab-height":"28px","drag-border-width":"5px",lm_dragging:Zp,lm_goldenlayout:Jp,lm_header:Qp,lm_controls:ev,lm_tabpreviousbutton:tv,lm_tabnextbutton:nv,lm_tab:rv,lm_active:iv,lm_close_tab:av,lm_content:ov,lm_dragProxy:sv,lm_dropTargetIndicator:lv,march:uv,lm_inner:dv,lm_splitter:cv,lm_selectable:hv,lm_tabdropdown_list:fv,lm_title:mv,lm_title_before:pv,lm_selected:vv,lm_focusin:gv,lm_window_blur:bv,lm_popout:yv,lm_maximise:_v,lm_tabdropdown:wv,lm_close:Sv,lm_tabdropdown_search:Cv,lm_tabs:Ev,lm_keyboard_active:Pv,lm_maximised:Tv,lm_items:Ov},Ji=Object.freeze({tabHeight:parseInt(Zi["tab-height"],10),dragBorderWidth:parseInt(Zi["drag-border-width"],10)});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 Oe(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){As(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 As(n,e,t){return e=Iv(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Iv(n){var e=Dv(n,"string");return typeof e=="symbol"?e:String(e)}function Dv(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 Ue=B.module("LayoutUtils");function Ms(n){return n.componentName!==void 0}function lt(n){var e=n;return(Ms(n)&&n.componentName==="lm-react-component"||n.type==="react-component")&&e.component!==void 0}function Ut(n){return n.focus!==void 0}function ea(n){return n.type==="stack"}class N{static activateTab(e,t){var r=N.getStackForRoot(e,t,!1);if(!r){Ue.error("Could not find stack for config",t);return}var i=N.getContentItemInStack(r,t);i&&r.setActiveContentItem(i)}static isActiveTab(e,t){var r=N.getStackForRoot(e,t,!1);if(!r)return Ue.error("Could not find stack for config",t),!1;var i=N.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(Ts(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&&Tt(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=N.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):Ue.debug2('dehydrateLayoutConfig: skipping unmapped component "'.concat(o,'"'))}else if(s){var u=Oe(Oe({},a),{},{content:N.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?(ea(r)&&delete r.activeItemIndex,N.dropLayoutMinorChange(i)):lt(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=N.cloneLayout(e),a=N.cloneLayout(t);return N.dropLayoutMinorChange(i),N.dropLayoutMinorChange(a),Ve(i,a)}return Ve(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(lt(a)){var o,{component:s,props:l={}}=a;r.push(Oe(Oe({},a),{},{id:(o=a==null?void 0:a.id)!==null&&o!==void 0?o:Ee(),props:t(s,l)}))}else if(a.content!==void 0){var u=N.hydrateLayoutConfig(a.content,t);ea(a)&&a.activeItemIndex!=null&&a.activeItemIndex>=u.length&&(Ue.warn("Fixing bad activeItemIndex!",a.activeItemIndex,a),a.activeItemIndex=0),r.push(Oe(Oe({},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=Oe({},t);if(u.id==null&&(u.id=Ee.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?N.addStack(e):N.getStackForRoot(e,d);ze(f);var m=N.getContentItemInStack(f,d);if(o!=null){var p=g=>{Ue.debug("Component created, focusing element",o),f.off("componentCreated",p);var{element:b}=g.origin;requestAnimationFrame(()=>{N.focusElement(b[0],o)})};f.on("componentCreated",p)}if(r&&m){var v=f.contentItems.indexOf(m);f.addChild(u,v+1),f.removeChild(m),f.setActiveContentItem(f.contentItems[v])}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=N.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=N.getStackForRoot(e,t,!1,!1,!1);if(!i){Ue.warn("Cannot find stack for component, ignoring close",t);return}var a=N.getContentItemInStack(i,t),o=document.activeElement;a&&(ge(a)?a.container.close(r):i.removeChild(a)),o&&document.contains(o)&&Ut(o)&&o.focus()}static renameComponent(e,t,r){var i=N.getStackForRoot(e,t,!1);if(!i){Ue.error("Could not find stack for config",t);return}var a=N.getContentItemInStack(i,t);a&&a.setTitle(r)}static cloneComponent(e,t){var r=N.getStackForRoot(e,t,!1);if(!r)return Ue.error("Could not find stack for config",t),null;var{props:i={}}=t,a=N.getPanelComponentState(t),o={type:"react-component",component:t.component,props:Oe(Oe({},i),{},{panelState:a}),title:"".concat(t.title," Copy"),id:Ee.generate()};return N.openComponentInStack(r,o),o}static getPanelComponentState(e){if(Ms(e)){var t;return(t=e.componentState)===null||t===void 0?void 0:t.panelState}if(lt(e)){var r;return(r=e.props)===null||r===void 0?void 0:r.panelState}return null}static makeDefaultLayout(){return{dimensions:{headerHeight:Ji.tabHeight,borderWidth:Ji.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=N.getComponentConfigFromContainer(e);return t?t.id:null}static getIdFromPanel(e){var{glContainer:t}=e.props;return N.getIdFromContainer(t)}static getComponentNameFromPanel(e){var{glContainer:t}=e.props,r=N.getComponentConfigFromContainer(t);if(r&&lt(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]:N.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)})}}As(N,"DEFAULT_FOCUS_SELECTOR","input, select, textarea, button");var Ns=z.forwardRef((n,e)=>{var t=N.getComponentNameFromPanel({props:n});return h.jsx("div",{ref:e,className:"panel-placeholder",children:h.jsxs("div",{children:['Component "',t,'" is not registered.']})})});Ns.displayName="PanelPlaceholder";const Q=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 Ot(n){return(n==null?void 0:n.WrappedComponent)!==void 0}function Ls(n){return typeof n.id=="string"&&n.layout instanceof xs&&n.panelManager instanceof un&&typeof n.registerComponent=="function"}function xv(n){if(!Ls(n))throw new Error("Expected dashboard plugin props, but instead received ".concat(n))}function ta(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 na(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?ta(Object(t),!0).forEach(function(r){We(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):ta(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function We(n,e,t){return e=Av(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Av(n){var e=Mv(n,"string");return typeof e=="symbol"?e:String(e)}function Mv(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 ve=B.module("PanelManager");class un{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]:()=>{};We(this,"layout",void 0),We(this,"hydrateComponent",void 0),We(this,"dehydrateComponent",void 0),We(this,"onPanelsUpdated",void 0),We(this,"closed",void 0),We(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(Q.FOCUS,this.handleFocus),e.on(Q.MOUNT,this.handleMount),e.on(Q.UNMOUNT,this.handleUnmount),e.on(Q.REOPEN,this.handleReopen),e.on(Q.DELETE,this.handleDeleted),e.on(Q.CLOSED,this.handleClosed),e.on(Q.CLOSE,this.handleControlClose)}stopListening(){var{eventHub:e}=this.layout;e.off(Q.FOCUS,this.handleFocus),e.off(Q.MOUNT,this.handleMount),e.off(Q.UNMOUNT,this.handleUnmount),e.off(Q.REOPEN,this.handleReopen),e.off(Q.DELETE,this.handleDeleted),e.off(Q.CLOSED,this.handleClosed),e.off(Q.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 N.getComponentConfigFromContainer(t)})}getOpenedPanelConfigsOfType(e){return this.getOpenedPanelConfigs().filter(t=>t!=null&&lt(t)&&t.component===e)}getOpenedPanelById(e){return this.openedMap.get(e)}getContainerByPanelId(e){var t,r=N.getStackForConfig(this.layout.root,{id:e});return(t=r&&N.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=>Ot(r)&&t instanceof r.WrappedComponent||!Ot(r)&&t instanceof r))}updatePanel(e){var t=N.getIdFromPanel(e);if(t==null){ve.error("updatePanel Panel did not have an ID",e);return}ve.debug2("Updating panel ID ".concat(t," in open panels map")),this.openedMap.delete(t),this.openedMap.set(t,e)}removePanel(e){var t=N.getIdFromPanel(e);if(t==null){ve.error("removePanel Panel did not have an ID",e);return}if(!this.openedMap.has(t)){ve.error("Missing panel ID ".concat(t," in open panels map"));return}if(this.openedMap.get(t)!==e){ve.debug("Panel argument doesn't match the open panels map entry for ".concat(t,", removePanel ignored"));return}ve.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){ve.debug2("Focus: ",e),this.updatePanel(e)}handleMount(e){ve.debug2("Mount: ",e),this.updatePanel(e),this.sendUpdate()}handleUnmount(e){ve.debug2("Unmount: ",e),this.removePanel(e),this.sendUpdate()}handleReopen(e,t){ve.debug2("Reopen:",e,t),this.removeClosedPanelConfig(e);var{component:r}=e,{props:i}=e;i=this.hydrateComponent(r,i);var a=na(na({},e),{},{props:i}),{root:o}=this.layout;N.openComponent({root:o,config:a,replaceConfig:t})}handleDeleted(e){ve.debug2("Deleted:",e),this.removeClosedPanelConfig(e),this.sendUpdate()}handleClosed(e,t){ve.debug2("Closed: ",e),this.addClosedPanel(t),this.sendUpdate()}handleControlClose(e){var t={id:e},{root:r}=this.layout;N.closeComponent(r,t)}addClosedPanel(e){var t=N.getComponentConfigFromContainer(e);if(t&&lt(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)})}}We(un,"MAX_CLOSED_PANEL_COUNT",100);var Nv=B.module("PanelErrorBoundary");class js 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=N.getIdFromContainer(e);Nv.debug("componentWillUnmount",r),t.emit(Q.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(je,{errorMessage:"".concat(t),isLoading:!1,isLoaded:!1})}):e}}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 Zt(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){Lv(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 Lv(n,e,t){return e=jv(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function jv(n){var e=Fv(n,"string");return typeof e=="symbol"?e:String(e)}function Fv(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 $r(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),Zt(Zt({},n),{},{componentState:null,props:a,type:"react-component"})}function kr(n){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";return Zt(Zt({metadata:{}},n),{},{localDashboardId:e})}function Fs(n){var e=Ot(n)&&n.WrappedComponent.prototype!=null&&n.WrappedComponent.prototype.isReactComponent!=null||n.prototype!=null&&n.prototype.isReactComponent!=null,t=!Ot(n)&&"$$typeof"in n&&n.$$typeof===cl.ForwardRef;return e||t}const Rv={dehydrate:$r,hydrate:kr};var Br=z.createContext(void 0),$v=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}),Rs=C.shape({on:C.func,off:C.func,emit:C.func}),kv=C.shape({registerComponent:C.func,root:C.shape({addChild:C.func}),on:C.func,off:C.func,eventHub:Rs}),$s=Object.freeze({Container:$v,EventHub:Rs,Layout:kv});function He(n,e,t){c.useEffect(function(){return n.on(e,t),()=>{n.off(e,t)}},[n,e,t])}function ks(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.");z.useEffect(()=>{var o=n(a,e,t,r);return()=>{o()}},[e,r,t,a,n])}function Bv(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 m,{dragEvent:p,fetch:v,panelId:g=Ee.generate(),widget:b}=f,{id:_,type:w}=b,y=(m=b.title)!==null&&m!==void 0?m:b.name,P=Array.isArray(i)&&i.includes(w)||w===i;if(P){var S={id:_,name:y,type:w},D={localDashboardId:s,metadata:S,fetch:v};a!=null&&(D=a(D,s));var O={type:"react-component",component:t,props:D,title:y,id:g},{root:M}=l;N.openComponent({root:M,config:O,dragEvent:p})}},[t,a,s,l,i]);ks(u,r,a,o),He(l.eventHub,Q.OPEN,d)}function Uv(){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 ia(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 aa(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?ia(Object(t),!0).forEach(function(r){Wv(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):ia(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function Wv(n,e,t){return e=Hv(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Hv(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)}function zv(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&&Ve({payload:o},{payload:r[a]})?r:aa(aa({},r),{},{[a]:o})}default:return r}}}function oa(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 sa(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?oa(Object(t),!0).forEach(function(r){Kn(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):oa(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function Kn(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 Xv{constructor(){Kn(this,"reducers",{}),Kn(this,"listener",null)}register(e,t){var r;this.reducers=sa(sa({},this.reducers),{},{[e]:t}),(r=this.listener)===null||r===void 0||r.call(this,this.reducers)}setListener(e){this.listener=e}}var Yv=new Xv;const qv=Yv;var Ur="SET_DASHBOARD_DATA";const Zv=zv(Ur,{},!1),Bs={dashboardData:Zv};var Jv=new Map,Qv=Object.freeze({}),eg=Object.freeze([]),Us=n=>n.dashboardData,Mt=(n,e)=>{var t;return(t=Us(n)[e])!==null&&t!==void 0?t:Qv},tg=(n,e)=>{var t;return(t=Mt(n,e).closed)!==null&&t!==void 0?t:eg},ng=(n,e)=>{var t;return(t=Mt(n,e).openedMap)!==null&&t!==void 0?t:Jv};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){rg(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 rg(n,e,t){return e=ig(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function ig(n){var e=ag(n,"string");return typeof e=="symbol"?e:String(e)}function ag(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 Ws=(n,e)=>({type:Ur,id:n,payload:e}),Hs=(n,e)=>(t,r)=>t(Ws(n,ua(ua({},Mt(r(),n)),e)));Object.entries(Bs).map(n=>{var[e,t]=n;return qv.register(e,t)});function og(n){var{children:e}=n;return h.jsx(h.Fragment,{children:e})}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 yt(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){sg(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 sg(n,e,t){return e=lg(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function lg(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=B.module("DashboardLayout"),dg=Object.freeze({}),cg=[],ca=()=>{},ha=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=cg,onLayoutChange:l=ca,onLayoutInitialized:u=ca,hydrate:d=kr,dehydrate:f=$r,panelWrapper:m=og}=n,p=hl(),v=(e=fl(x=>Mt(x,r)))!==null&&e!==void 0?e:dg,[g,b]=c.useState(!1),[_,w]=c.useState(!1),[y,P]=c.useState(),[S]=c.useState((t=v==null?void 0:v.closed)!==null&&t!==void 0?t:[]),[D,O]=c.useState(!1),[M,F]=c.useState(o.getReactChildren()),E=c.useMemo(()=>new Map,[]),I=c.useMemo(()=>new Map,[]),L=c.useCallback(function(x,R){var W,Re=arguments.length>2&&arguments[2]!==void 0?arguments[2]:d,Vr=arguments.length>3&&arguments[3]!==void 0?arguments[3]:f;Wt.debug2("registerComponent",x,R,Re,Vr);function zr(Nt,Xs){var dn=R,Ys=m,qs=Fs(dn),{glContainer:Zs,glEventHub:Js}=Nt;return h.jsx(js,{glContainer:Zs,glEventHub:Js,children:h.jsx(Ys,yt(yt({},Nt),{},{children:qs?h.jsx(dn,yt(yt({},Nt),{},{ref:Xs})):h.jsx(dn,yt({},Nt))}))})}zr.displayName="DashboardWrapper(".concat((W=R.displayName)!==null&&W!==void 0?W:x,")");var Ks=o.registerComponent(x,z.forwardRef(zr));return E.set(x,Re),I.set(x,Vr),Ks},[d,f,E,I,o,m]),X=c.useCallback((x,R)=>{var W;return((W=E.get(x))!==null&&W!==void 0?W:ha)(R,r)},[E,r]),J=c.useCallback((x,R)=>{var W;return((W=I.get(x))!==null&&W!==void 0?W:ha)(R,r)},[I,r]),$=c.useMemo(()=>new un(o,X,J,new Map,S,x=>{var{closed:R,openedMap:W}=x;p(Hs(r,{closed:R,openedMap:W}))}),[J,p,X,r,S,o]),V=c.useCallback(()=>{if(!_){D||(u(),O(!0));var x=o.toConfig(),R=x.content,W=N.dehydrateLayoutConfig(R,J),Re=y==null||!N.isEqual(y,W);Wt.debug("handleLayoutStateChanged",Re,R,W),Re&&(b(o.root.contentItems.length===0),P(W),l(W),F(o.getReactChildren()))}},[J,D,_,y,o,l,u]),K=c.useCallback(x=>{var R=N.getIdFromContainer(x);o.eventHub.emit(Q.DRAGGING,R),w(!0)},[o.eventHub]),q=c.useCallback(x=>{var R=N.getIdFromContainer(x);o.eventHub.emit(Q.DROPPED,R),w(!1)},[o.eventHub]),se=c.useCallback(x=>{if(Wt.debug2("handleComponentCreated",x),!(x==null||x.config==null||x.config.component==null||x.element==null)){var R=x.config.component.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),W="".concat(R,"-component");x.element.addClass(W)}},[]),j=c.useCallback(()=>{F(o.getReactChildren())},[o]);He(o,"stateChanged",V),He(o,"itemPickedUp",K),He(o,"itemDropped",q),He(o,"componentCreated",se),He(o.eventHub,Q.TITLE_CHANGED,V),He(o,"reactChildrenChanged",j);var U=Ba(s);return c.useEffect(function(){if(U!==s&&s!==y){Wt.debug("Setting new layout content...");for(var R=N.hydrateLayoutConfig(s,X);o.root.contentItems.length>0;)o.root.contentItems[0].remove();for(var W=0;W<R.length;W+=1)o.root.addChild(R[W]);b(o.root.contentItems.length===0)}},[X,o,s,y,$,U]),h.jsxs(h.Fragment,{children:[g&&a,M,z.Children.map(i,x=>x!=null?z.cloneElement(x,{id:r,layout:o,panelManager:$,registerComponent:L}):null)]})}Wr.propTypes={id:C.string.isRequired,children:C.node,data:C.shape({}),emptyDashboard:C.node,layout:$s.Layout.isRequired,layoutConfig:C.arrayOf(C.shape({})),onLayoutChange:C.func,onLayoutInitialized:C.func};function fa(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?fa(Object(t),!0).forEach(function(r){fg(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):fa(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function fg(n,e,t){return e=mg(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function mg(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)}var vg=100,Cn=()=>{},gg=Object.freeze({});function ma(n){var{id:e="default",children:t,emptyDashboard:r,layoutConfig:i,layoutSettings:a=gg,onLayoutConfigChange:o=Cn,onGoldenLayoutChange:s=Cn,onLayoutInitialized:l=Cn,fallbackComponent:u=Ns,hydrate:d,dehydrate:f,panelWrapper:m}=n,p=c.useRef(null),[v,g]=c.useState(!1),[b,_]=c.useState();c.useEffect(function(){if(!p.current){_(void 0);return}var P=hg({},N.makeDefaultLayout());P.settings===void 0&&(P.settings={}),Object.assign(P.settings,a),P.content=[];var S=new xs(P,p.current),D=()=>{S.off("initialised",D),g(!0)};return S.on("initialised",D),u!=null&&S.setFallbackComponent(u),S.init(),_(S),s(S),()=>{S.destroy()}},[a,u,s,g,_]);var w=c.useMemo(()=>Jn(()=>{b!=null&&b.isInitialised&&(b==null||b.updateSize())},vg),[b]);return c.useEffect(function(){return window.addEventListener("resize",w),()=>{window.removeEventListener("resize",w)}},[w]),h.jsxs("div",{className:"dashboard-container w-100 h-100",children:[h.jsx("div",{className:"w-100 h-100",ref:p}),v&&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:m,children:t})})]})}var bg="default";const yg=Object.freeze(Object.defineProperty({__proto__:null,DEFAULT_DASHBOARD_ID:bg,Dashboard:ma,DashboardLayout:Wr,DashboardUtils:Rv,GLPropTypes:$s,LayoutManagerContext:Br,LayoutUtils:N,PanelErrorBoundary:js,PanelEvent:Q,PanelManager:un,SET_DASHBOARD_DATA:Ur,assertIsDashboardPluginProps:xv,canHaveRef:Fs,default:ma,dehydrate:$r,getAllDashboardsData:Us,getClosedPanelsForDashboard:tg,getDashboardData:Mt,getOpenedPanelMapForDashboard:ng,hydrate:kr,isDashboardPluginProps:Ls,isWrappedComponent:Ot,reducers:Bs,setDashboardData:Ws,updateDashboardData:Hs,useDashboardPanel:Bv,useLayoutManager:Uv,useListener:He,usePanelRegistration:ks},Symbol.toStringTag,{value:"Module"}));function Vs(n,e,t){return e=_g(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function _g(n){var e=wg(n,"string");return typeof e=="symbol"?e:String(e)}function wg(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){Vs(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 Bu(i,e,t??new en(i),r)}}Vs(ht,"DEFAULT_TYPE","java.lang.String");const Sg=ht;function qe(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=Eg(n,"string");return typeof e=="symbol"?e:String(e)}function Eg(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 Ie=B.module("TableViewportUpdater"),Pg=150;class Me extends c.PureComponent{constructor(){super(...arguments),qe(this,"subscription",void 0),qe(this,"getViewportRowRange",En((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]})),qe(this,"getViewportColumns",En((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=Uu.getModelIndex(u,i);l.push(e.columns[d])}return l})),qe(this,"updateViewport",Jn((e,t,r,i,a)=>{if(t<e){Ie.error("Invalid viewport",e,t);return}if(e===0&&t===0){Ie.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(Ie.debug2("Setting Viewport Top:",l,"Bottom:",u,"Columns:",d),this.subscription==null){Ie.debug2("updateViewport creating new subscription"),this.subscription=s.setViewport(l,u,d);var{onSubscription:f}=this.props;f(this.subscription)}else Ie.debug2("updateViewport using existing subscription"),this.subscription.setViewport(l,u,d)},Pg))}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,m=l!==e.sorts,p=u!==e.customColumns,v=o!==e.table;(f||m||p||v)&&this.closeSubscription(),(f||v)&&(Ie.debug("update table filter",s),o.applyFilter(s)),(m||v)&&(Ie.debug("update table sort",l),o.applySort(l)),(p||v)&&(Ie.debug("update table custom columns",u),o.applyCustomColumns(u)),this.updateViewport(t,r,i,a,d)}componentWillUnmount(){this.closeSubscription()}closeSubscription(){if(Ie.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}}qe(Me,"ROW_BUFFER_PAGES",3);qe(Me,"COLUMN_BUFFER_PAGES",1);qe(Me,"defaultProps",{top:0,bottom:0,left:null,right:null,columns:null,onSubscription:()=>{},filters:[],sorts:[],customColumns:[],movedColumns:[]});const Tg=Me;function Jt(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=Ig(n,"string");return typeof e=="symbol"?e:String(e)}function Ig(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 it=B.module("TreeTableViewportUpdater"),Dg=150;class Qt extends c.PureComponent{constructor(e){super(e),Jt(this,"listenerCleanup",void 0),Jt(this,"updateViewport",Jn((t,r)=>{if(r<t){it.error("Invalid viewport",t,r);return}if(t===0&&r===0){it.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(it.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)},Dg)),this.listenerCleanup=null}componentDidMount(){var{top:e,bottom:t,table:r,filters:i,sorts:a}=this.props;it.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&&(it.debug("update table filter",a),i.applyFilter(a)),o!==e.sorts&&(it.debug("update table sort",o),i.applySort(o)),this.updateViewport(t,r)}componentWillUnmount(){this.updateViewport.cancel(),this.listenerCleanup&&this.listenerCleanup()}render(){return null}}Jt(Qt,"UPDATE_INTERVAL",1e3);Jt(Qt,"defaultProps",{top:0,bottom:0,onViewportUpdate:()=>{},filters:[],sorts:[],updateInterval:Qt.UPDATE_INTERVAL});const xg=Qt,Ag=Object.freeze(Object.defineProperty({__proto__:null,AdvancedSettings:Wu,AdvancedSettingsType:Hu,AggregationEdit:Vu,AggregationUtils:zu,Aggregations:Gu,BarIcon:Ku,ChartBuilder:Xu,ColumnHeaderGroup:Yu,CustomColumnBuilder:qu,DownloadServiceWorkerUtils:Zu,FormatColumnWhereIcon:Ju,FormatRowWhereIcon:Qu,HistogramIcon:ed,InputEditor:td,IrisGrid:qr,IrisGridMetricCalculator:nd,IrisGridModel:rd,IrisGridModelFactory:id,IrisGridRenderer:ad,IrisGridTableModel:od,IrisGridTableModelTemplate:sd,IrisGridTestUtils:Sg,IrisGridTreeTableModel:ld,IrisGridUtils:ud,LineIcon:dd,OptionType:cd,PieIcon:hd,RollupRows:fd,SHORTCUTS:md,ScatterIcon:pd,TableCsvExporter:vd,TableSaver:gd,TableViewportUpdater:Tg,TreeTableViewportUpdater:xg,VisibilityOrderingBuilder:bd,createDefaultIrisGridTheme:yd,default:qr,isIrisGridTableModelTemplate:_d,isPanelStateV1:wd,isPanelStateV2:Sd},Symbol.toStringTag,{value:"Module"}));var zs={react:z,"react-dom":Pa,redux:ml,"react-redux":pl,"@adobe/react-spectrum":vl,"@deephaven/auth-plugins":mm,"@deephaven/chart":Wm,"@deephaven/components":Hh,"@deephaven/dashboard":yg,"@deephaven/icons":Hl,"@deephaven/iris-grid":Ag,"@deephaven/jsapi-bootstrap":zh,"@deephaven/jsapi-components":Ff,"@deephaven/jsapi-utils":af,"@deephaven/log":B,"@deephaven/react-hooks":ac},Mg=gl.createRequires(zs),Ng=bl({requires:Mg});const Lg=Ng;function pa(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 Hr(n){return function(){var e=this,t=arguments;return new Promise(function(r,i){var a=n.apply(e,t);function o(l){pa(a,r,i,o,s,"next",l)}function s(l){pa(a,r,i,o,s,"throw",l)}o(void 0)})}}var xe=B.module("@deephaven/app-utils.PluginUtils");function jg(n){return Xn.apply(this,arguments)}function Xn(){return Xn=Hr(function*(n){var e=yield Lg(n);return e}),Xn.apply(this,arguments)}function Fg(n){return Yn.apply(this,arguments)}function Yn(){return Yn=Hr(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")}}),Yn.apply(this,arguments)}function Rg(n){return qn.apply(this,arguments)}function qn(){return qn=Hr(function*(n){xe.debug("Loading plugins...");try{var e=yield Fg("".concat(n,"/manifest.json"));if(!Array.isArray(e.plugins))throw new Error("Plugin manifest JSON does not contain plugins array");xe.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(jg(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 m,p=Bf(d.value)?d.value:(m=d.value.default)!==null&&m!==void 0?m:d.value;p==null?xe.error("Plugin '".concat(f,"' is missing an exported value.")):l.set(f,p)}else xe.error("Unable to load plugin '".concat(f,"'"),d.reason)}return xe.info("Plugins loaded:",l),l}catch(v){return xe.error("Unable to load plugins:",v),new Map}}),qn.apply(this,arguments)}function $g(n){var e,t;return(e=(t=n.get("AuthHandlers"))===null||t===void 0?void 0:t.split(","))!==null&&e!==void 0?e:[]}function kg(n,e){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:new Map,r=$g(e),i=[...n.entries(),...t.entries()].filter(l=>{var[,u]=l;return Uf(u)||Fn(u)}).map(l=>{var[u,d]=l;return Fn(d)?{type:Ir.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&&xe.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 xe.info("Using LoginPlugin",o),s}function Bg(n){var e=[...n.entries()].filter(t=>Wf(t[1]));return xe.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:$a(r,s),name:s,styleContent:u}})}).flat()}var Ug=Ta.createRequires(()=>zs),Wg=Ta.createRemoteComponent({requires:Ug});const fb=Wg;function va(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 Hg(n){return function(){var e=this,t=arguments;return new Promise(function(r,i){var a=n.apply(e,t);function o(l){va(a,r,i,o,s,"next",l)}function s(l){va(a,r,i,o,s,"throw",l)}o(void 0)})}}function Vg(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=Hg(function*(){var d,f=(d=yield t==null?void 0:t())!==null&&d!==void 0?d:[],m=yield Rg(e);if(!s){var p=f.map(v=>[v.name,v]);a(new Map([...p,...m]))}}),u.apply(this,arguments)}return l(),()=>{s=!0}},[e,t]),h.jsx(Or.Provider,{value:i,children:r})}function zg(){var n=Sr();return c.useEffect(function(){n.postMessage(br(gr))},[n]),null}function ga(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 Gg(n){return function(){var e=this,t=arguments;return new Promise(function(r,i){var a=n.apply(e,t);function o(l){ga(a,r,i,o,s,"next",l)}function s(l){ga(a,r,i,o,s,"throw",l)}o(void 0)})}}var Kg=new Map([["@deephaven/auth-plugins.AuthPluginParent",{AuthPlugin:os}],["@deephaven/auth-plugins.AuthPluginPsk",{AuthPlugin:ds}],["@deephaven/auth-plugins.AuthPluginAnonymous",{AuthPlugin:as}]]);function Xg(n){var{children:e}=n,t=Qe(),r=c.useContext(Or),[i,a]=c.useState(),[o,s]=c.useState();c.useEffect(function(){var f=!1;function m(){return p.apply(this,arguments)}function p(){return p=Gg(function*(){try{var v=yield t.getAuthConfigValues();f||a(new Map(v))}catch(g){f||s(g)}}),p.apply(this,arguments)}return m(),()=>{f=!0}},[t]);var l=c.useMemo(()=>{if(!(r==null||i==null))try{return kg(r,i,Kg)}catch(d){s(d)}},[i,r]),u=l==null||i==null;return u||o!=null?h.jsx(je,{isLoading:u&&o==null,errorMessage:mt(o)}):h.jsx(l,{authConfigValues:i,children:h.jsxs(h.Fragment,{children:[h.jsx(zg,{}),e]})})}function ba(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 Yg(n){return function(){var e=this,t=arguments;return new Promise(function(r,i){var a=n.apply(e,t);function o(l){ba(a,r,i,o,s,"next",l)}function s(l){ba(a,r,i,o,s,"throw",l)}o(void 0)})}}var qg=B.module("@deephaven/app-utils.ConnectionBootstrap");function Zg(n){var{children:e}=n,t=Pe(),r=Qe(),[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=Yg(function*(){try{var m=yield r.getAsIdeConnection();if(u)return;s(m)}catch(p){if(u)return;a(p)}}),f.apply(this,arguments)}return d(),()=>{u=!0}},[t,r]),c.useEffect(function(){if(o==null)return;function u(f){var{detail:m}=f;qg.info("Shutdown","".concat(JSON.stringify(m))),a("Server shutdown: ".concat(m??"Unknown reason"))}var d=o.addEventListener(t.IdeConnection.EVENT_SHUTDOWN,u);return d},[t,o]),o==null||i!=null?h.jsx(je,{"data-testid":"connection-bootstrap-loading",isLoading:o==null,errorMessage:i!=null?"".concat(i):void 0}):h.jsx(Qa.Provider,{value:o,children:e})}function mb(n){return new URL(n,"".concat(window.location))}function Jg(){var n=new URLSearchParams(window.location.search);return n.get("envoyPrefix")}function Qg(){var n=Jg();return n!=null?{headers:{"envoy-prefix":n}}:{headers:{}}}function eb(n){var{children:e}=n,t=c.useContext(ns);return t?h.jsx(h.Fragment,{children:e}):h.jsx(je,{"data-testid":"fonts-loaded-loading"})}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 tb(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 Gs=c.createContext(null);function nb(n){var{children:e}=n,t=Qe(),[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=tb(function*(){try{var m=yield t.getServerConfigValues();u||i(new Map(m))}catch(p){u||o(p)}}),f.apply(this,arguments)}return d(),()=>{u=!0}},[t]);var s=r==null;return s||a!=null?h.jsx(je,{isLoading:s&&a==null,errorMessage:mt(a)}):h.jsx(Gs.Provider,{value:r,children:e})}function rb(){return pt(Gs,"No server config available in useServerConfig. Was code wrapped in ServerConfigBootstrap or ServerConfigContext.Provider?")}function ib(n){var{children:e}=n,t=rb(),r=c.useContext(to),i=c.useContext(tn),a=hs(t,r,i);return h.jsx(eo.Provider,{value:a,children:e})}function ab(n){var{children:e}=n,t=c.useContext(Or),r=c.useMemo(()=>t==null?null:Bg(t),[t]);return h.jsx(No,{themes:r,children:h.jsx(ms,{children:e})})}function pb(n){var{fontClassNames:e,pluginsUrl:t,getCorePlugins:r,serverUrl:i,children:a}=n,o=c.useMemo(()=>Qg(),[]),[s,l]=c.useState(0),u=c.useCallback(()=>{},[]),d=c.useCallback(()=>{l(f=>f+1)},[]);return sn(u,d),h.jsx(Rf,{fontClassNames:e,children:h.jsx(Vg,{getCorePlugins:r,pluginsUrl:t,children:h.jsx(ab,{children:h.jsx(Ro,{serverUrl:i,options:o,children:h.jsx(Zo,{children:h.jsx(Xg,{children:h.jsx(nb,{children:h.jsx(ib,{children:h.jsx(Zg,{children:h.jsx(eb,{children:a})})})})})})},s)})})})}export{pb as AppBootstrap,Xg as AuthBootstrap,Zg as ConnectionBootstrap,Rf as FontBootstrap,eb as FontsLoaded,ns as FontsLoadedContext,Vg as PluginsBootstrap,fb as RemoteComponent,ab as ThemeBootstrap,$g as getAuthHandlers,kg as getAuthPluginComponent,mb as getBaseUrl,Qg as getConnectOptions,Jg as getEnvoyPrefix,Bg as getThemeDataFromPlugins,Fg as loadJson,jg as loadModulePlugin,Rg as loadModulePlugins,rb as useServerConfig,bb as useUser};
4
- //# sourceMappingURL=index-b358c29d.js.map
4
+ //# sourceMappingURL=index-fdc44734.js.map