@deephaven/embed-grid 0.50.1-beta.2 → 0.50.1-beta.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- import{C as d,$ as pi,H as wn,I as Kt,F as se,J as Pn,r as c,K as we,L as We,M as vi,N as On,O as mi,P as Cn,Q as gi,S as bi,T as Tr,U as De,G as V,E as F,V as x,W as yi,D as Je,X as Ei,Y as Si,Z as Ti,_ as wi,a0 as Pi,a1 as Le,a2 as xn,a3 as Ve,a4 as Ct,a5 as Dn,R as Oi,a6 as Ci,a7 as xi,a8 as Di,a9 as Ai,aa as Ni,ab as An}from"./vendor-291144f5.js";import{L as k,i as Ii,v as Nn,M as zt,b as qt,c as In,d as _n,e as _i,f as Mi,T as Pe,g as Ae,h as Fi,j as ki,k as Li,l as Mn,m as Fn,D as kn,n as Ln,s as jn,o as Rn,p as ji,q as Ri,r as $i,a as Oe,t as $n,u as Vi,w as Ui,x as Bi,y as Hi,z as Vn,A as Gi,B as Wi,C as Ki,E as zi,F as qi,G as Xi,H as Un,I as Yi,J as Zi,K as Qi,N as Ji}from"./index-5abc2804.js";import{g as es,c as ot,d as ts,e as rs,h as ns,P as Xt,B as pe,T as Be,M as Yt,D as Bn,i as Hn,j as as,S as Zt,R as wr,k as xt,l as Dt,m as Gn,n as is,o as ss,p as os,q as ls,C as us,r as cs,s as ds,t as fs,v as hs,G as ps,w as vs,K as ms,x as gs,y as bs,z as ys,O as Es,A as Ss,E as Ts,F as ws,H as Ps,J as Wn,L as Os,N as Cs,Q as xs,U as Ds,V as As,W as Ns,X as Kn,Y as Is,Z as ye,_ as Re,$ as _s,a0 as Ms,a1 as Fs,a2 as ks,a3 as zn,a4 as Ls,a5 as js,a6 as Rs,a7 as lt,a8 as _e,a9 as $s,aa as Vs,ab as Us,ac as He,ad as Bs,ae as Qt,af as Hs,ag as qn,ah as Xn,ai as Jt,aj as er,ak as Yn,al as Zn,am as Qn,f as Gs,an as Jn,ao as Ws,ap as Ks,aq as tr,ar as et,as as zs,at as ea,au as Pr,av as qs,aw as Xs,ax as Ys,ay as ut,az as ta,aA as ra,aB as Zs,aC as Qs,I as Or,aD as Js,aE as eo,aF as to,aG as ro,aH as no,aI as ao,aJ as io,aK as so,aL as oo,aM as lo,aN as uo,aO as co,aP as fo,aQ as ho,aR as po,aS as vo,b as mo,aT as go,aU as bo,aV as yo,aW as Eo,aX as So,aY as To,aZ as wo,a_ as Po,a$ as Oo,b0 as Co,b1 as xo,b2 as Do,b3 as Ao,b4 as No,b5 as Io,b6 as _o,b7 as Mo}from"./useUser-9d15b8d3.js";import{b8 as Wf,u as Kf,a as zf}from"./useUser-9d15b8d3.js";import{P as tt,b as Fo,h as ko,p as Lo,o as jo,s as Ro,t as $o,c as Ze}from"./plotly-6c9edc8f.js";import"./helpers-042e6b4d.js";import"./monaco-9eb7d7d5.js";function je(r){var e=r;r instanceof CustomEvent&&(e=r.detail);var t="";if(e instanceof Error?t=e.message:e!=null&&(t="".concat(e)),t=t.trim(),t.length>0)return t}var na=24,Vo=32,Uo=33,Bo=150,aa=200,ia=500,sa=250,Ho={spellCheck:!1},Go=["ariaLabel","icon","isQuiet","labelText","children","onOpenChange"];function Cr(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(r,a).enumerable})),t.push.apply(t,n)}return t}function xr(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Cr(Object(t),!0).forEach(function(n){Wo(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):Cr(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function Wo(r,e,t){return e=Ko(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Ko(r){var e=zo(r,"string");return typeof e=="symbol"?e:String(e)}function zo(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}function qo(r,e){if(r==null)return{};var t=Xo(r,e),n,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(r);for(a=0;a<i.length;a++)n=i[a],!(e.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(r,n)&&(t[n]=r[n])}return t}function Xo(r,e){if(r==null)return{};var t={},n=Object.keys(r),a,i;for(i=0;i<n.length;i++)a=n[i],!(e.indexOf(a)>=0)&&(t[a]=r[a]);return t}function oa(r){var{ariaLabel:e,icon:t,isQuiet:n,labelText:a,children:i,onOpenChange:s}=r,o=qo(r,Go);return d.jsxs(pi,{type:"popover",onOpenChange:s,children:[d.jsxs(wn,xr(xr({},o),{},{"aria-label":e??a,isQuiet:n,children:[d.jsx(Kt,{children:d.jsx(se,{icon:t})}),a==null?null:d.jsx(Pn,{children:a})]})),i]})}function Yo(r,e){return r===0?0:e==="all"||r===e.size?"all":e.size}function la(r,e){return r===e?!0:r==="all"||e==="all"||r.size!==e.size?!1:[...r.keys()].every(t=>e.has(t))}function ua(r,e){return r.isInverted===e.isInverted&&la(r.selection,e.selection)}function ca(r,e,t){if(r==="all")return"all";var n=[...r.keys()];return new Set(n.map(a=>t(e(a))))}function da(r,e){var t=r==="all"||r.size>e/2,n=r;return t&&(n=r==="all"?new Set:new Set([...es(0,e-1)].filter(a=>!r.has(String(a))).map(a=>String(a)))),{selection:n,isInverted:t}}function Zo(r,e){return r?{}:{errorMessage:e,validationState:"invalid"}}function fa(r){var e;return(e=r==null?void 0:r.UNSAFE_getDOMNode())!==null&&e!==void 0?e:null}function Qo(r){var e=r==null?void 0:r.UNSAFE_getDOMNode().lastElementChild;return ha(e)}function Jo(r){var e=r==null?void 0:r.UNSAFE_getDOMNode(),t=e==null?void 0:e.querySelector("input"),n=t==null?void 0:t.getAttribute("aria-controls"),a=n==null?null:document.getElementById(n);return a}function ha(r){return r instanceof HTMLElement?r:null}function pa(){var r=c.useRef(!1);return c.useEffect(()=>(r.current=!0,()=>{r.current=!1}),[]),r}function Dr(r,e,t,n,a,i,s){try{var o=r[i](s),l=o.value}catch(u){t(u);return}o.done?e(l):Promise.resolve(l).then(n,a)}function el(r){return function(){var e=this,t=arguments;return new Promise(function(n,a){var i=r.apply(e,t);function s(l){Dr(i,n,a,s,o,"next",l)}function o(l){Dr(i,n,a,s,o,"throw",l)}s(void 0)})}}var bt=k.module("useAsyncInterval");function tl(r,e){var t=pa(),n=c.useRef(0),a=c.useRef(0),i=c.useRef(null),s=c.useCallback(el(function*(){var o=Date.now();a.current+=1;var l=i.current==null?e:o-i.current;if(bt.debug("tick #".concat(a.current,"."),l,"ms elapsed since last tick."),i.current=o,yield r(),!!t.current){l+=Date.now()-i.current;var u=Math.max(0,l-e),f=Math.max(0,e-u);bt.debug("Next tick target:",e,", overage",u,", adjusted:",f),n.current=window.setTimeout(s,f)}}),[r,t,e]);c.useEffect(()=>(bt.debug("Setting target interval:",e),i.current=null,s(),()=>{window.clearTimeout(n.current)}),[e,s])}function rl(r,e){return c.useCallback(function(){var t=r(...arguments);return e(),t},[e,r])}function rt(r,e){var t=c.useMemo(()=>we(r,e),[r,e]);return c.useEffect(()=>()=>t.cancel(),[t]),t}function nl(r){var[e,t]=c.useState(r);return c.useEffect(()=>{t(r)},[r]),[e,t]}function al(r,e,t,n){var a=c.useRef(0);c.useEffect(()=>{a.current>=t||n&&(a.current+=1,r())},[t,n,...e])}function va(r,e){var t=c.useRef(r),n=e(t.current,r)?t.current:r;return t.current=n,n}function il(r){r.preventDefault()}function ma(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,e=c.useMemo(()=>"useSubmitButtonRef-".concat(We()),[]),t=c.useCallback(i=>{i==null||i.UNSAFE_getDOMNode().setAttribute("form",e)},[e]),n=c.useMemo(()=>({id:e,onSubmit:r?void 0:il}),[e,r]),a=c.useMemo(()=>({form:e,ref:t}),[e,t]);return{formProps:n,submitButtonProps:a}}function ga(r,e){return c.useCallback(t=>{typeof r=="function"?r(e(t)):r.current=e(t)},[e,r])}function ba(r,e){var{getItem:t,selectedKeys:n,items:a}=r;return c.useMemo(()=>{var{selection:i,isInverted:s}=da(n,a.length);return{selection:ca(i,t,e),isInverted:s}},[n,a.length,t,e])}function sl(r){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Ii,t=c.useRef();return c.useEffect(()=>()=>{var n;return(n=t.current)===null||n===void 0?void 0:n.call(t)},[]),c.useCallback(n=>{var a;(a=t.current)===null||a===void 0||a.call(t);var i=e(n);i&&(i.addEventListener("scroll",r),t.current=()=>{i.removeEventListener("scroll",r),t.current=void 0})},[e,r])}function Ar(r,e,t,n,a,i,s){try{var o=r[i](s),l=o.value}catch(u){t(u);return}o.done?e(l):Promise.resolve(l).then(n,a)}function ol(r){return function(){var e=this,t=arguments;return new Promise(function(n,a){var i=r.apply(e,t);function s(l){Ar(i,n,a,s,o,"next",l)}function o(l){Ar(i,n,a,s,o,"throw",l)}s(void 0)})}}function ll(r,e,t){var n=c.useRef(null),[a,i]=c.useState(null),s=c.useCallback(ol(function*(){if(!(a==null||t==null)){var l=yield t();a.scroll(0,l)}}),[t,a]);c.useEffect(()=>(a==null||a.addEventListener("scroll",e),s(),()=>{a==null||a.removeEventListener("scroll",e)}),[e,a,s]);var o=c.useCallback(l=>{l&&setTimeout(()=>{i(r(n.current))},0)},[r]);return{ref:n,onOpenChange:o}}function Nr(r,e,t,n,a,i,s){try{var o=r[i](s),l=o.value}catch(u){t(u);return}o.done?e(l):Promise.resolve(l).then(n,a)}function ul(r){return function(){var e=this,t=arguments;return new Promise(function(n,a){var i=r.apply(e,t);function s(l){Nr(i,n,a,s,o,"next",l)}function o(l){Nr(i,n,a,s,o,"throw",l)}s(void 0)})}}function Ge(r,e){var{autoLoad:t=!0}=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},[n,a]=c.useState(null),[i,s]=c.useState(null),[o,l]=c.useState(!1),u=c.useCallback(ul(function*(){l(!0);try{var f=yield r(...e);a(f),s(null)}catch(h){a(null),s(h)}finally{l(!1)}}),[r,...e]);return c.useEffect(()=>{t&&u()},[t,u]),{data:n,error:i,isError:i!=null,isLoading:o,reload:u}}function Ir(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(r,a).enumerable})),t.push.apply(t,n)}return t}function _r(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Ir(Object(t),!0).forEach(function(n){cl(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):Ir(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function cl(r,e,t){return e=dl(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function dl(r){var e=fl(r,"string");return typeof e=="symbol"?e:String(e)}function fl(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}function hl(r,e,t,n){var a=arguments.length===4;return c.useCallback(i=>{var s=a?i??n:i;t(_r(_r({},r),{},{[e]:s}))},[t,r,e,a,n])}function ya(r,e){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,n=c.useRef(),a=c.useRef(0);return c.useCallback(i=>{window.clearTimeout(n.current),n.current=window.setTimeout(()=>{var s=Math.floor(i.target.scrollTop/r);a.current!==s&&(a.current=s,e(s))},t)},[t,r,e])}function ct(r,e){var[t,n]=c.useState(r);return c.useEffect(()=>{var a=setTimeout(()=>{n(r)},e);return()=>{clearTimeout(a)}},[r,e]),t}function Ea(r,e){return c.useCallback(t=>{if(t!=null){var n=e==null?[t]:t.querySelectorAll(e);n.forEach(a=>{Object.entries(r).forEach(i=>{var[s,o]=i;a.setAttribute(s,o)})})}},[r,e])}function pl(r){var e=Ea(Ho,r);return ga(e,fa)}function Sa(){var{getKey:r=Ta}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},[e,t]=c.useState([]),[n,a]=c.useState(()=>new Set),i=c.useCallback(m=>g=>r(g)===m,[r]),s=c.useCallback(m=>{var g;return(g=e.find(i(m)))!==null&&g!==void 0?g:null},[e,i]),o=c.useCallback(m=>{var g=s(m);if(g==null)throw new Error("No item found matching key: ".concat(m));return g},[s]),l=c.useCallback(m=>{t(g=>[...g,...m])},[]),u=c.useCallback((m,g)=>{t(b=>[...b.slice(0,m),...g,...b.slice(m)])},[]),f=c.useCallback(m=>{var g=new Set(m);t(b=>b.filter(E=>!g.has(r(E))))},[r]),h=c.useCallback((m,g)=>{var b=e.findIndex(i(m));b!==-1&&t(E=>[...E.slice(0,b),g,...E.slice(b+1)])},[e,i]),p=c.useCallback(m=>{if(m.size!==0){var g=[],b=new Map;for(var E of m.keys()){var P=e.findIndex(i(E));g.push(P),b.set(P,E)}g.sort((C,T)=>C-T);var y=[];e.forEach((C,T)=>{if(g[0]===T){var A=b.get(g.shift()),O=m.get(A);y.push(O)}else y.push(C)}),t(y)}},[e,i]),v=c.useMemo(()=>({items:e,selectedKeys:n,append:l,bulkUpdate:p,findItem:s,getItem:o,insert:u,remove:f,setItems:t,setSelectedKeys:a,update:h}),[l,p,s,o,u,e,f,t,n,h]);return v}function Ta(r){var e=r!=null&&typeof r=="object"&&"key"in r;if(!e)throw new Error("Item does not have a `key` prop.");return r.key}const vl=Object.freeze(Object.defineProperty({__proto__:null,createValidationProps:Zo,defaultGetKey:Ta,extractSpectrumHTMLElement:fa,extractSpectrumLastChildHTMLElement:Qo,findSpectrumComboBoxScrollArea:Jo,getSelectedItemCountOrAll:Yo,identityExtractHTMLElement:ha,isSelectionEqual:la,isSelectionMaybeInvertedEqual:ua,mapSelection:ca,optimizeSelection:da,useAsyncInterval:tl,useCallbackWithAction:rl,useContextOrThrow:ot,useCopyToClipboard:ts,useDebouncedCallback:rt,useDebouncedValue:ct,useDependentState:nl,useEffectNTimesWhen:al,useFormWithDetachedSubmitButton:ma,useForwardedRef:rs,useIsEqualMemo:va,useIsMountedRef:pa,useMappedRef:ga,useMappedSelection:ba,useOnScrollOffsetChangeCallback:ya,useOnScrollRef:sl,usePopoverOnScrollRef:ll,usePrevious:ns,usePromiseFactory:Ge,usePropChangeCallback:hl,useSetAttributesCallback:Ea,useSpectrumDisableSpellcheckRef:pl,useWindowedListData:Sa},Symbol.toStringTag,{value:"Module"})),ml="_spectrumActionBar_tmmkp_5",gl="_spectrumDialogComponentHeading_tmmkp_9",bl="_spectrumEllipsis_tmmkp_14",rr={spectrumActionBar:ml,spectrumDialogComponentHeading:gl,spectrumEllipsis:bl};function Mr(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(r,a).enumerable})),t.push.apply(t,n)}return t}function ze(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Mr(Object(t),!0).forEach(function(n){yl(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):Mr(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function yl(r,e,t){return e=El(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function El(r){var e=Sl(r,"string");return typeof e=="symbol"?e:String(e)}function Sl(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}function wa(r){var{heading:e,confirmationButtonLabel:t,children:n,onCancel:a,onConfirm:i}=r,{formProps:s,submitButtonProps:o}=ma();return d.jsxs(vi,{children:[d.jsx(On,{level:3,UNSAFE_className:rr.spectrumDialogComponentHeading,children:e}),d.jsx(mi,{}),d.jsx(Cn,{children:d.jsx(gi,ze(ze({},s),{},{children:n}))}),d.jsxs(bi,{children:[d.jsx(Tr,{variant:"secondary",onPress:a,children:"Cancel"}),d.jsx(Tr,ze(ze({},o),{},{style:"fill",variant:"negative",onPress:i,type:"submit",children:t}))]})]})}function Tl(r){var{ariaLabel:e,heading:t,confirmationButtonLabel:n,isHidden:a,children:i,onConfirm:s}=r,o=c.useCallback(l=>d.jsx(wa,{heading:t,confirmationButtonLabel:n,onCancel:l,onConfirm:()=>{l(),s()},children:i}),[i,n,t,s]);return d.jsx(oa,{ariaLabel:e,icon:Nn,isHidden:a,isQuiet:!0,height:na,children:o})}var wl=["icon","label"];function Fr(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(r,a).enumerable})),t.push.apply(t,n)}return t}function kr(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Fr(Object(t),!0).forEach(function(n){Pl(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):Fr(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function Pl(r,e,t){return e=Ol(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Ol(r){var e=Cl(r,"string");return typeof e=="symbol"?e:String(e)}function Cl(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}function xl(r,e){if(r==null)return{};var t=Dl(r,e),n,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(r);for(a=0;a<i.length;a++)n=i[a],!(e.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(r,n)&&(t[n]=r[n])}return t}function Dl(r,e){if(r==null)return{};var t={},n=Object.keys(r),a,i;for(i=0;i<n.length;i++)a=n[i],!(e.indexOf(a)>=0)&&(t[a]=r[a]);return t}function Pa(r){var{icon:e,label:t}=r,n=xl(r,wl);return d.jsx(wn,kr(kr({},n),{},{"aria-label":t,isQuiet:!0,height:na,children:d.jsx(Kt,{children:d.jsx(se,{icon:e})})}))}Pa.displayName="IconActionButton";function Lr(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(r,a).enumerable})),t.push.apply(t,n)}return t}function Al(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Lr(Object(t),!0).forEach(function(n){fe(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):Lr(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function fe(r,e,t){return e=Nl(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Nl(r){var e=Il(r,"string");return typeof e=="symbol"?e:String(e)}function Il(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}var _l=100,At;(function(r){r.UP="UP",r.DOWN="DOWN"})(At||(At={}));class ie extends c.Component{constructor(e){super(e),fe(this,"popper",void 0),fe(this,"cbContainer",void 0),fe(this,"menuContainer",void 0),fe(this,"input",void 0),fe(this,"getCachedFilteredOptions",De((n,a)=>n.filter(i=>i.title.toLowerCase().indexOf(a.toLowerCase())>=0)));var{popperOptions:t}=this.props;t=Al({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=we(this.updateInputValue,_l),this.handleOptionClick=this.handleOptionClick.bind(this),this.handleMenuOpened=this.handleMenuOpened.bind(this),this.handleMenuExited=this.handleMenuExited.bind(this),this.popper=V.createRef(),this.cbContainer=V.createRef(),this.menuContainer=V.createRef(),this.input=V.createRef()}setInputWidth(){this.cbContainer.current&&this.setState({inputWidth:this.cbContainer.current.getBoundingClientRect().width})}getValueAndValidate(e){if(!e)return this.setState({invalid:!1}),{value:e,isValid:!1};var{options:t}=this.props,n=t.filter(a=>a.title.toLowerCase()===e.toLowerCase());return n.length<1?(this.setState({invalid:!0}),{value:e,isValid:!1}):(this.setState({invalid:!1}),{value:n[0].value,isValid:!0})}updateInputValue(e){var{menuIsOpen:t}=this.state,{value:n,isValid:a}=this.getValueAndValidate(e);t&&this.processFilterChange(e),this.fireOnChange(n,a)}fireOnChange(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,{onChange:n}=this.props;n(e,t)}processFilterChange(e){var t,{options:n}=this.props,{menuIsOpen:a}=this.state,i=e?this.getCachedFilteredOptions(n,e):n,s=i.length===1&&i[0].title===e;if(this.setState({filteredOptions:i,keyboardOptionIndex:0}),s&&a){this.closeMenu();return}(t=this.popper.current)===null||t===void 0||t.scheduleUpdate()}resetValue(){this.setState({title:""}),this.fireOnChange("")}handleResize(){this.setInputWidth()}handleMenuKeyDown(e){var t,{filteredOptions:n,keyboardOptionIndex:a}=this.state,i=n[a];switch(e.key){case"Enter":case"ArrowRight":e.stopPropagation(),e.preventDefault(),i!=null&&(this.setState({title:i.title,invalid:!1}),this.fireOnChange(i.value)),this.closeMenu(),(t=this.input.current)===null||t===void 0||t.focus();break;case"ArrowUp":e.stopPropagation(),e.preventDefault(),this.navigateMenu(ie.MENU_NAVIGATION_DIRECTION.UP);break;case"ArrowDown":e.stopPropagation(),e.preventDefault(),this.navigateMenu(ie.MENU_NAVIGATION_DIRECTION.DOWN);break;case"Tab":if(e.stopPropagation(),e.preventDefault(),e.shiftKey){this.navigateMenu(ie.MENU_NAVIGATION_DIRECTION.UP);break}this.navigateMenu(ie.MENU_NAVIGATION_DIRECTION.DOWN);break;case"Escape":e.preventDefault(),e.stopPropagation(),this.closeMenu();break}}navigateMenu(e){var{filteredOptions:t,keyboardOptionIndex:n}=this.state,a=n;e===ie.MENU_NAVIGATION_DIRECTION.UP?n>0?(a=(a-1)%t.length,this.setState({keyboardOptionIndex:a})):n===0&&(a=t.length-1,this.setState({keyboardOptionIndex:a})):e===ie.MENU_NAVIGATION_DIRECTION.DOWN&&n<t.length&&(a=(a+1)%t.length,this.setState({keyboardOptionIndex:a})),this.scrollOptionIntoView(a)}handleInputKeyDown(e){var{onEnter:t}=this.props,{menuIsOpen:n}=this.state;n?this.handleMenuKeyDown(e):e.key==="Enter"?t():e.key==="Escape"?(this.resetValue(),e.preventDefault(),e.stopPropagation()):e.key==="ArrowRight"||e.key==="ArrowLeft"||e.key==="Tab"||e.key==="Shift"||this.openMenu()}handleInputChange(e){this.setState({title:e.target.value}),this.updateInputValue(e.target.value)}handleOptionClick(e){var t;this.setState({title:e.title,invalid:!1}),this.fireOnChange(e.value),this.closeMenu(),(t=this.input.current)===null||t===void 0||t.focus()}handelInputFocus(){var{menuIsOpen:e}=this.state;e||this.openMenu()}handleInputClick(){var{menuIsOpen:e}=this.state;e||this.openMenu()}handleInputBlur(e){var{menuIsOpen:t}=this.state;t&&e.relatedTarget instanceof Element&&this.popper.current!==null&&this.popper.current.element.contains(e.relatedTarget)||this.closeMenu(!1)}handleMenuBlur(e){e.relatedTarget===this.input.current||e.relatedTarget instanceof Element&&this.popper.current!==null&&this.popper.current.element.contains(e.relatedTarget)||this.closeMenu(!1)}handleMenuOpened(){var e;(e=this.input.current)===null||e===void 0||e.focus()}handleMenuExited(){var{menuIsOpen:e}=this.state;e&&this.setState({menuIsOpen:!1,keyboardOptionIndex:0})}openMenu(){var{title:e}=this.state;this.processFilterChange(e),this.setInputWidth(),this.setState({menuIsOpen:!0}),window.requestAnimationFrame(()=>{var t;(t=this.popper.current)===null||t===void 0||t.show()})}closeMenu(){var e,t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;if(this.setState({menuIsOpen:!1,keyboardOptionIndex:0}),t){var n;(n=this.input.current)===null||n===void 0||n.focus()}(e=this.popper.current)===null||e===void 0||e.hide()}scrollOptionIntoView(e){if(this.menuContainer.current){var t;(t=this.menuContainer.current.children.item(e))===null||t===void 0||t.scrollIntoView({behavior:"smooth",block:"nearest"})}}renderMenuElement(){var{inputWidth:e}=this.state;return d.jsx("div",{className:F("aci-options"),ref:this.menuContainer,role:"presentation",onKeyDown:this.handleMenuKeyDown,style:{width:e},onBlur:this.handleMenuBlur,children:this.renderOptions()})}renderOptions(){var{noMatchText:e}=this.props,{title:t,filteredOptions:n}=this.state;return t&&n.length===0?d.jsx("div",{className:"no-match",children:e}):n.map((a,i)=>this.renderOption(a,i))}renderOption(e,t){var{keyboardOptionIndex:n}=this.state,a="option-".concat(t,"-").concat(e.value);return d.jsx("button",{type:"button",className:F("aci-option-btn",{"keyboard-active":n===t}),onClick:()=>this.handleOptionClick(e),onFocus:()=>this.setState({keyboardOptionIndex:t}),children:e.title},a)}render(){var{options:e,inputPlaceholder:t,disabled:n,className:a,defaultTitle:i,spellCheck:s,"data-testid":o}=this.props,{title:l,menuIsOpen:u,popperOptions:f,invalid:h}=this.state;return d.jsxs("div",{className:"aci-container",ref:this.cbContainer,children:[d.jsx("input",{value:l||i,className:F("form-control",a,"aci-input",{"is-invalid":h&&!u}),ref:this.input,onChange:this.handleInputChange,placeholder:t||e[0].title,disabled:n,onFocus:this.handelInputFocus,onClick:this.handleInputClick,onBlur:this.handleInputBlur,onKeyDown:this.handleInputKeyDown,spellCheck:s,"data-testid":o}),d.jsx(Xt,{ref:this.popper,options:f,className:F("aci-options-popper interactive"),onEntered:this.handleMenuOpened,onExited:this.handleMenuExited,children:this.renderMenuElement()})]})}}fe(ie,"propTypes",{options:x.arrayOf(x.shape({title:x.string.isRequired,value:x.string.isRequired})).isRequired,popperOptions:x.shape({}),onChange:x.func,inputPlaceholder:x.string,disabled:x.bool,className:x.string,defaultTitle:x.string,spellCheck:x.bool,onEnter:x.func,noMatchText:x.string,"data-testid":x.string});fe(ie,"defaultProps",{onChange(){},inputPlaceholder:"",disabled:!1,className:"",defaultTitle:"",popperOptions:null,spellCheck:!0,onEnter(){},noMatchText:"No matching items found","data-testid":void 0});fe(ie,"MENU_NAVIGATION_DIRECTION",At);const Ml=ie;function nr(r){var{className:e="",value:t,onChange:n,spellCheck:a=!1,placeholder:i="",disabled:s=!1,delimiter:o="",id:l="","data-testid":u}=r,[f,h]=c.useState(t),[p,v]=c.useState(!1),m=c.useRef(null);c.useEffect(function(){h(t)},[t]);function g(O){return O.trim().split(o).filter(N=>N).join(`
1
+ import{C as d,$ as pi,H as wn,I as Kt,F as se,J as Pn,r as c,K as we,L as We,M as vi,N as On,O as mi,P as Cn,Q as gi,S as bi,T as Tr,U as De,G as V,E as F,V as x,W as yi,D as Je,X as Ei,Y as Si,Z as Ti,_ as wi,a0 as Pi,a1 as Le,a2 as xn,a3 as Ve,a4 as Ct,a5 as Dn,R as Oi,a6 as Ci,a7 as xi,a8 as Di,a9 as Ai,aa as Ni,ab as An}from"./vendor-291144f5.js";import{L as k,i as Ii,v as Nn,M as zt,b as qt,c as In,d as _n,e as _i,f as Mi,T as Pe,g as Ae,h as Fi,j as ki,k as Li,l as Mn,m as Fn,D as kn,n as Ln,s as jn,o as Rn,p as ji,q as Ri,r as $i,a as Oe,t as $n,u as Vi,w as Ui,x as Bi,y as Hi,z as Vn,A as Gi,B as Wi,C as Ki,E as zi,F as qi,G as Xi,H as Un,I as Yi,J as Zi,K as Qi,N as Ji}from"./index-40f440be.js";import{g as es,c as ot,d as ts,e as rs,h as ns,P as Xt,B as pe,T as Be,M as Yt,D as Bn,i as Hn,j as as,S as Zt,R as wr,k as xt,l as Dt,m as Gn,n as is,o as ss,p as os,q as ls,C as us,r as cs,s as ds,t as fs,v as hs,G as ps,w as vs,K as ms,x as gs,y as bs,z as ys,O as Es,A as Ss,E as Ts,F as ws,H as Ps,J as Wn,L as Os,N as Cs,Q as xs,U as Ds,V as As,W as Ns,X as Kn,Y as Is,Z as ye,_ as Re,$ as _s,a0 as Ms,a1 as Fs,a2 as ks,a3 as zn,a4 as Ls,a5 as js,a6 as Rs,a7 as lt,a8 as _e,a9 as $s,aa as Vs,ab as Us,ac as He,ad as Bs,ae as Qt,af as Hs,ag as qn,ah as Xn,ai as Jt,aj as er,ak as Yn,al as Zn,am as Qn,f as Gs,an as Jn,ao as Ws,ap as Ks,aq as tr,ar as et,as as zs,at as ea,au as Pr,av as qs,aw as Xs,ax as Ys,ay as ut,az as ta,aA as ra,aB as Zs,aC as Qs,I as Or,aD as Js,aE as eo,aF as to,aG as ro,aH as no,aI as ao,aJ as io,aK as so,aL as oo,aM as lo,aN as uo,aO as co,aP as fo,aQ as ho,aR as po,aS as vo,b as mo,aT as go,aU as bo,aV as yo,aW as Eo,aX as So,aY as To,aZ as wo,a_ as Po,a$ as Oo,b0 as Co,b1 as xo,b2 as Do,b3 as Ao,b4 as No,b5 as Io,b6 as _o,b7 as Mo}from"./useUser-a9505863.js";import{b8 as Wf,u as Kf,a as zf}from"./useUser-a9505863.js";import{P as tt,b as Fo,h as ko,p as Lo,o as jo,s as Ro,t as $o,c as Ze}from"./plotly-e03ead7f.js";import"./helpers-042e6b4d.js";import"./monaco-9eb7d7d5.js";function je(r){var e=r;r instanceof CustomEvent&&(e=r.detail);var t="";if(e instanceof Error?t=e.message:e!=null&&(t="".concat(e)),t=t.trim(),t.length>0)return t}var na=24,Vo=32,Uo=33,Bo=150,aa=200,ia=500,sa=250,Ho={spellCheck:!1},Go=["ariaLabel","icon","isQuiet","labelText","children","onOpenChange"];function Cr(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(r,a).enumerable})),t.push.apply(t,n)}return t}function xr(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Cr(Object(t),!0).forEach(function(n){Wo(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):Cr(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function Wo(r,e,t){return e=Ko(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Ko(r){var e=zo(r,"string");return typeof e=="symbol"?e:String(e)}function zo(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}function qo(r,e){if(r==null)return{};var t=Xo(r,e),n,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(r);for(a=0;a<i.length;a++)n=i[a],!(e.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(r,n)&&(t[n]=r[n])}return t}function Xo(r,e){if(r==null)return{};var t={},n=Object.keys(r),a,i;for(i=0;i<n.length;i++)a=n[i],!(e.indexOf(a)>=0)&&(t[a]=r[a]);return t}function oa(r){var{ariaLabel:e,icon:t,isQuiet:n,labelText:a,children:i,onOpenChange:s}=r,o=qo(r,Go);return d.jsxs(pi,{type:"popover",onOpenChange:s,children:[d.jsxs(wn,xr(xr({},o),{},{"aria-label":e??a,isQuiet:n,children:[d.jsx(Kt,{children:d.jsx(se,{icon:t})}),a==null?null:d.jsx(Pn,{children:a})]})),i]})}function Yo(r,e){return r===0?0:e==="all"||r===e.size?"all":e.size}function la(r,e){return r===e?!0:r==="all"||e==="all"||r.size!==e.size?!1:[...r.keys()].every(t=>e.has(t))}function ua(r,e){return r.isInverted===e.isInverted&&la(r.selection,e.selection)}function ca(r,e,t){if(r==="all")return"all";var n=[...r.keys()];return new Set(n.map(a=>t(e(a))))}function da(r,e){var t=r==="all"||r.size>e/2,n=r;return t&&(n=r==="all"?new Set:new Set([...es(0,e-1)].filter(a=>!r.has(String(a))).map(a=>String(a)))),{selection:n,isInverted:t}}function Zo(r,e){return r?{}:{errorMessage:e,validationState:"invalid"}}function fa(r){var e;return(e=r==null?void 0:r.UNSAFE_getDOMNode())!==null&&e!==void 0?e:null}function Qo(r){var e=r==null?void 0:r.UNSAFE_getDOMNode().lastElementChild;return ha(e)}function Jo(r){var e=r==null?void 0:r.UNSAFE_getDOMNode(),t=e==null?void 0:e.querySelector("input"),n=t==null?void 0:t.getAttribute("aria-controls"),a=n==null?null:document.getElementById(n);return a}function ha(r){return r instanceof HTMLElement?r:null}function pa(){var r=c.useRef(!1);return c.useEffect(()=>(r.current=!0,()=>{r.current=!1}),[]),r}function Dr(r,e,t,n,a,i,s){try{var o=r[i](s),l=o.value}catch(u){t(u);return}o.done?e(l):Promise.resolve(l).then(n,a)}function el(r){return function(){var e=this,t=arguments;return new Promise(function(n,a){var i=r.apply(e,t);function s(l){Dr(i,n,a,s,o,"next",l)}function o(l){Dr(i,n,a,s,o,"throw",l)}s(void 0)})}}var bt=k.module("useAsyncInterval");function tl(r,e){var t=pa(),n=c.useRef(0),a=c.useRef(0),i=c.useRef(null),s=c.useCallback(el(function*(){var o=Date.now();a.current+=1;var l=i.current==null?e:o-i.current;if(bt.debug("tick #".concat(a.current,"."),l,"ms elapsed since last tick."),i.current=o,yield r(),!!t.current){l+=Date.now()-i.current;var u=Math.max(0,l-e),f=Math.max(0,e-u);bt.debug("Next tick target:",e,", overage",u,", adjusted:",f),n.current=window.setTimeout(s,f)}}),[r,t,e]);c.useEffect(()=>(bt.debug("Setting target interval:",e),i.current=null,s(),()=>{window.clearTimeout(n.current)}),[e,s])}function rl(r,e){return c.useCallback(function(){var t=r(...arguments);return e(),t},[e,r])}function rt(r,e){var t=c.useMemo(()=>we(r,e),[r,e]);return c.useEffect(()=>()=>t.cancel(),[t]),t}function nl(r){var[e,t]=c.useState(r);return c.useEffect(()=>{t(r)},[r]),[e,t]}function al(r,e,t,n){var a=c.useRef(0);c.useEffect(()=>{a.current>=t||n&&(a.current+=1,r())},[t,n,...e])}function va(r,e){var t=c.useRef(r),n=e(t.current,r)?t.current:r;return t.current=n,n}function il(r){r.preventDefault()}function ma(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,e=c.useMemo(()=>"useSubmitButtonRef-".concat(We()),[]),t=c.useCallback(i=>{i==null||i.UNSAFE_getDOMNode().setAttribute("form",e)},[e]),n=c.useMemo(()=>({id:e,onSubmit:r?void 0:il}),[e,r]),a=c.useMemo(()=>({form:e,ref:t}),[e,t]);return{formProps:n,submitButtonProps:a}}function ga(r,e){return c.useCallback(t=>{typeof r=="function"?r(e(t)):r.current=e(t)},[e,r])}function ba(r,e){var{getItem:t,selectedKeys:n,items:a}=r;return c.useMemo(()=>{var{selection:i,isInverted:s}=da(n,a.length);return{selection:ca(i,t,e),isInverted:s}},[n,a.length,t,e])}function sl(r){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Ii,t=c.useRef();return c.useEffect(()=>()=>{var n;return(n=t.current)===null||n===void 0?void 0:n.call(t)},[]),c.useCallback(n=>{var a;(a=t.current)===null||a===void 0||a.call(t);var i=e(n);i&&(i.addEventListener("scroll",r),t.current=()=>{i.removeEventListener("scroll",r),t.current=void 0})},[e,r])}function Ar(r,e,t,n,a,i,s){try{var o=r[i](s),l=o.value}catch(u){t(u);return}o.done?e(l):Promise.resolve(l).then(n,a)}function ol(r){return function(){var e=this,t=arguments;return new Promise(function(n,a){var i=r.apply(e,t);function s(l){Ar(i,n,a,s,o,"next",l)}function o(l){Ar(i,n,a,s,o,"throw",l)}s(void 0)})}}function ll(r,e,t){var n=c.useRef(null),[a,i]=c.useState(null),s=c.useCallback(ol(function*(){if(!(a==null||t==null)){var l=yield t();a.scroll(0,l)}}),[t,a]);c.useEffect(()=>(a==null||a.addEventListener("scroll",e),s(),()=>{a==null||a.removeEventListener("scroll",e)}),[e,a,s]);var o=c.useCallback(l=>{l&&setTimeout(()=>{i(r(n.current))},0)},[r]);return{ref:n,onOpenChange:o}}function Nr(r,e,t,n,a,i,s){try{var o=r[i](s),l=o.value}catch(u){t(u);return}o.done?e(l):Promise.resolve(l).then(n,a)}function ul(r){return function(){var e=this,t=arguments;return new Promise(function(n,a){var i=r.apply(e,t);function s(l){Nr(i,n,a,s,o,"next",l)}function o(l){Nr(i,n,a,s,o,"throw",l)}s(void 0)})}}function Ge(r,e){var{autoLoad:t=!0}=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},[n,a]=c.useState(null),[i,s]=c.useState(null),[o,l]=c.useState(!1),u=c.useCallback(ul(function*(){l(!0);try{var f=yield r(...e);a(f),s(null)}catch(h){a(null),s(h)}finally{l(!1)}}),[r,...e]);return c.useEffect(()=>{t&&u()},[t,u]),{data:n,error:i,isError:i!=null,isLoading:o,reload:u}}function Ir(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(r,a).enumerable})),t.push.apply(t,n)}return t}function _r(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Ir(Object(t),!0).forEach(function(n){cl(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):Ir(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function cl(r,e,t){return e=dl(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function dl(r){var e=fl(r,"string");return typeof e=="symbol"?e:String(e)}function fl(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}function hl(r,e,t,n){var a=arguments.length===4;return c.useCallback(i=>{var s=a?i??n:i;t(_r(_r({},r),{},{[e]:s}))},[t,r,e,a,n])}function ya(r,e){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,n=c.useRef(),a=c.useRef(0);return c.useCallback(i=>{window.clearTimeout(n.current),n.current=window.setTimeout(()=>{var s=Math.floor(i.target.scrollTop/r);a.current!==s&&(a.current=s,e(s))},t)},[t,r,e])}function ct(r,e){var[t,n]=c.useState(r);return c.useEffect(()=>{var a=setTimeout(()=>{n(r)},e);return()=>{clearTimeout(a)}},[r,e]),t}function Ea(r,e){return c.useCallback(t=>{if(t!=null){var n=e==null?[t]:t.querySelectorAll(e);n.forEach(a=>{Object.entries(r).forEach(i=>{var[s,o]=i;a.setAttribute(s,o)})})}},[r,e])}function pl(r){var e=Ea(Ho,r);return ga(e,fa)}function Sa(){var{getKey:r=Ta}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},[e,t]=c.useState([]),[n,a]=c.useState(()=>new Set),i=c.useCallback(m=>g=>r(g)===m,[r]),s=c.useCallback(m=>{var g;return(g=e.find(i(m)))!==null&&g!==void 0?g:null},[e,i]),o=c.useCallback(m=>{var g=s(m);if(g==null)throw new Error("No item found matching key: ".concat(m));return g},[s]),l=c.useCallback(m=>{t(g=>[...g,...m])},[]),u=c.useCallback((m,g)=>{t(b=>[...b.slice(0,m),...g,...b.slice(m)])},[]),f=c.useCallback(m=>{var g=new Set(m);t(b=>b.filter(E=>!g.has(r(E))))},[r]),h=c.useCallback((m,g)=>{var b=e.findIndex(i(m));b!==-1&&t(E=>[...E.slice(0,b),g,...E.slice(b+1)])},[e,i]),p=c.useCallback(m=>{if(m.size!==0){var g=[],b=new Map;for(var E of m.keys()){var P=e.findIndex(i(E));g.push(P),b.set(P,E)}g.sort((C,T)=>C-T);var y=[];e.forEach((C,T)=>{if(g[0]===T){var A=b.get(g.shift()),O=m.get(A);y.push(O)}else y.push(C)}),t(y)}},[e,i]),v=c.useMemo(()=>({items:e,selectedKeys:n,append:l,bulkUpdate:p,findItem:s,getItem:o,insert:u,remove:f,setItems:t,setSelectedKeys:a,update:h}),[l,p,s,o,u,e,f,t,n,h]);return v}function Ta(r){var e=r!=null&&typeof r=="object"&&"key"in r;if(!e)throw new Error("Item does not have a `key` prop.");return r.key}const vl=Object.freeze(Object.defineProperty({__proto__:null,createValidationProps:Zo,defaultGetKey:Ta,extractSpectrumHTMLElement:fa,extractSpectrumLastChildHTMLElement:Qo,findSpectrumComboBoxScrollArea:Jo,getSelectedItemCountOrAll:Yo,identityExtractHTMLElement:ha,isSelectionEqual:la,isSelectionMaybeInvertedEqual:ua,mapSelection:ca,optimizeSelection:da,useAsyncInterval:tl,useCallbackWithAction:rl,useContextOrThrow:ot,useCopyToClipboard:ts,useDebouncedCallback:rt,useDebouncedValue:ct,useDependentState:nl,useEffectNTimesWhen:al,useFormWithDetachedSubmitButton:ma,useForwardedRef:rs,useIsEqualMemo:va,useIsMountedRef:pa,useMappedRef:ga,useMappedSelection:ba,useOnScrollOffsetChangeCallback:ya,useOnScrollRef:sl,usePopoverOnScrollRef:ll,usePrevious:ns,usePromiseFactory:Ge,usePropChangeCallback:hl,useSetAttributesCallback:Ea,useSpectrumDisableSpellcheckRef:pl,useWindowedListData:Sa},Symbol.toStringTag,{value:"Module"})),ml="_spectrumActionBar_tmmkp_5",gl="_spectrumDialogComponentHeading_tmmkp_9",bl="_spectrumEllipsis_tmmkp_14",rr={spectrumActionBar:ml,spectrumDialogComponentHeading:gl,spectrumEllipsis:bl};function Mr(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(r,a).enumerable})),t.push.apply(t,n)}return t}function ze(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Mr(Object(t),!0).forEach(function(n){yl(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):Mr(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function yl(r,e,t){return e=El(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function El(r){var e=Sl(r,"string");return typeof e=="symbol"?e:String(e)}function Sl(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}function wa(r){var{heading:e,confirmationButtonLabel:t,children:n,onCancel:a,onConfirm:i}=r,{formProps:s,submitButtonProps:o}=ma();return d.jsxs(vi,{children:[d.jsx(On,{level:3,UNSAFE_className:rr.spectrumDialogComponentHeading,children:e}),d.jsx(mi,{}),d.jsx(Cn,{children:d.jsx(gi,ze(ze({},s),{},{children:n}))}),d.jsxs(bi,{children:[d.jsx(Tr,{variant:"secondary",onPress:a,children:"Cancel"}),d.jsx(Tr,ze(ze({},o),{},{style:"fill",variant:"negative",onPress:i,type:"submit",children:t}))]})]})}function Tl(r){var{ariaLabel:e,heading:t,confirmationButtonLabel:n,isHidden:a,children:i,onConfirm:s}=r,o=c.useCallback(l=>d.jsx(wa,{heading:t,confirmationButtonLabel:n,onCancel:l,onConfirm:()=>{l(),s()},children:i}),[i,n,t,s]);return d.jsx(oa,{ariaLabel:e,icon:Nn,isHidden:a,isQuiet:!0,height:na,children:o})}var wl=["icon","label"];function Fr(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(r,a).enumerable})),t.push.apply(t,n)}return t}function kr(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Fr(Object(t),!0).forEach(function(n){Pl(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):Fr(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function Pl(r,e,t){return e=Ol(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Ol(r){var e=Cl(r,"string");return typeof e=="symbol"?e:String(e)}function Cl(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}function xl(r,e){if(r==null)return{};var t=Dl(r,e),n,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(r);for(a=0;a<i.length;a++)n=i[a],!(e.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(r,n)&&(t[n]=r[n])}return t}function Dl(r,e){if(r==null)return{};var t={},n=Object.keys(r),a,i;for(i=0;i<n.length;i++)a=n[i],!(e.indexOf(a)>=0)&&(t[a]=r[a]);return t}function Pa(r){var{icon:e,label:t}=r,n=xl(r,wl);return d.jsx(wn,kr(kr({},n),{},{"aria-label":t,isQuiet:!0,height:na,children:d.jsx(Kt,{children:d.jsx(se,{icon:e})})}))}Pa.displayName="IconActionButton";function Lr(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(r,a).enumerable})),t.push.apply(t,n)}return t}function Al(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Lr(Object(t),!0).forEach(function(n){fe(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):Lr(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function fe(r,e,t){return e=Nl(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Nl(r){var e=Il(r,"string");return typeof e=="symbol"?e:String(e)}function Il(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}var _l=100,At;(function(r){r.UP="UP",r.DOWN="DOWN"})(At||(At={}));class ie extends c.Component{constructor(e){super(e),fe(this,"popper",void 0),fe(this,"cbContainer",void 0),fe(this,"menuContainer",void 0),fe(this,"input",void 0),fe(this,"getCachedFilteredOptions",De((n,a)=>n.filter(i=>i.title.toLowerCase().indexOf(a.toLowerCase())>=0)));var{popperOptions:t}=this.props;t=Al({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=we(this.updateInputValue,_l),this.handleOptionClick=this.handleOptionClick.bind(this),this.handleMenuOpened=this.handleMenuOpened.bind(this),this.handleMenuExited=this.handleMenuExited.bind(this),this.popper=V.createRef(),this.cbContainer=V.createRef(),this.menuContainer=V.createRef(),this.input=V.createRef()}setInputWidth(){this.cbContainer.current&&this.setState({inputWidth:this.cbContainer.current.getBoundingClientRect().width})}getValueAndValidate(e){if(!e)return this.setState({invalid:!1}),{value:e,isValid:!1};var{options:t}=this.props,n=t.filter(a=>a.title.toLowerCase()===e.toLowerCase());return n.length<1?(this.setState({invalid:!0}),{value:e,isValid:!1}):(this.setState({invalid:!1}),{value:n[0].value,isValid:!0})}updateInputValue(e){var{menuIsOpen:t}=this.state,{value:n,isValid:a}=this.getValueAndValidate(e);t&&this.processFilterChange(e),this.fireOnChange(n,a)}fireOnChange(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,{onChange:n}=this.props;n(e,t)}processFilterChange(e){var t,{options:n}=this.props,{menuIsOpen:a}=this.state,i=e?this.getCachedFilteredOptions(n,e):n,s=i.length===1&&i[0].title===e;if(this.setState({filteredOptions:i,keyboardOptionIndex:0}),s&&a){this.closeMenu();return}(t=this.popper.current)===null||t===void 0||t.scheduleUpdate()}resetValue(){this.setState({title:""}),this.fireOnChange("")}handleResize(){this.setInputWidth()}handleMenuKeyDown(e){var t,{filteredOptions:n,keyboardOptionIndex:a}=this.state,i=n[a];switch(e.key){case"Enter":case"ArrowRight":e.stopPropagation(),e.preventDefault(),i!=null&&(this.setState({title:i.title,invalid:!1}),this.fireOnChange(i.value)),this.closeMenu(),(t=this.input.current)===null||t===void 0||t.focus();break;case"ArrowUp":e.stopPropagation(),e.preventDefault(),this.navigateMenu(ie.MENU_NAVIGATION_DIRECTION.UP);break;case"ArrowDown":e.stopPropagation(),e.preventDefault(),this.navigateMenu(ie.MENU_NAVIGATION_DIRECTION.DOWN);break;case"Tab":if(e.stopPropagation(),e.preventDefault(),e.shiftKey){this.navigateMenu(ie.MENU_NAVIGATION_DIRECTION.UP);break}this.navigateMenu(ie.MENU_NAVIGATION_DIRECTION.DOWN);break;case"Escape":e.preventDefault(),e.stopPropagation(),this.closeMenu();break}}navigateMenu(e){var{filteredOptions:t,keyboardOptionIndex:n}=this.state,a=n;e===ie.MENU_NAVIGATION_DIRECTION.UP?n>0?(a=(a-1)%t.length,this.setState({keyboardOptionIndex:a})):n===0&&(a=t.length-1,this.setState({keyboardOptionIndex:a})):e===ie.MENU_NAVIGATION_DIRECTION.DOWN&&n<t.length&&(a=(a+1)%t.length,this.setState({keyboardOptionIndex:a})),this.scrollOptionIntoView(a)}handleInputKeyDown(e){var{onEnter:t}=this.props,{menuIsOpen:n}=this.state;n?this.handleMenuKeyDown(e):e.key==="Enter"?t():e.key==="Escape"?(this.resetValue(),e.preventDefault(),e.stopPropagation()):e.key==="ArrowRight"||e.key==="ArrowLeft"||e.key==="Tab"||e.key==="Shift"||this.openMenu()}handleInputChange(e){this.setState({title:e.target.value}),this.updateInputValue(e.target.value)}handleOptionClick(e){var t;this.setState({title:e.title,invalid:!1}),this.fireOnChange(e.value),this.closeMenu(),(t=this.input.current)===null||t===void 0||t.focus()}handelInputFocus(){var{menuIsOpen:e}=this.state;e||this.openMenu()}handleInputClick(){var{menuIsOpen:e}=this.state;e||this.openMenu()}handleInputBlur(e){var{menuIsOpen:t}=this.state;t&&e.relatedTarget instanceof Element&&this.popper.current!==null&&this.popper.current.element.contains(e.relatedTarget)||this.closeMenu(!1)}handleMenuBlur(e){e.relatedTarget===this.input.current||e.relatedTarget instanceof Element&&this.popper.current!==null&&this.popper.current.element.contains(e.relatedTarget)||this.closeMenu(!1)}handleMenuOpened(){var e;(e=this.input.current)===null||e===void 0||e.focus()}handleMenuExited(){var{menuIsOpen:e}=this.state;e&&this.setState({menuIsOpen:!1,keyboardOptionIndex:0})}openMenu(){var{title:e}=this.state;this.processFilterChange(e),this.setInputWidth(),this.setState({menuIsOpen:!0}),window.requestAnimationFrame(()=>{var t;(t=this.popper.current)===null||t===void 0||t.show()})}closeMenu(){var e,t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;if(this.setState({menuIsOpen:!1,keyboardOptionIndex:0}),t){var n;(n=this.input.current)===null||n===void 0||n.focus()}(e=this.popper.current)===null||e===void 0||e.hide()}scrollOptionIntoView(e){if(this.menuContainer.current){var t;(t=this.menuContainer.current.children.item(e))===null||t===void 0||t.scrollIntoView({behavior:"smooth",block:"nearest"})}}renderMenuElement(){var{inputWidth:e}=this.state;return d.jsx("div",{className:F("aci-options"),ref:this.menuContainer,role:"presentation",onKeyDown:this.handleMenuKeyDown,style:{width:e},onBlur:this.handleMenuBlur,children:this.renderOptions()})}renderOptions(){var{noMatchText:e}=this.props,{title:t,filteredOptions:n}=this.state;return t&&n.length===0?d.jsx("div",{className:"no-match",children:e}):n.map((a,i)=>this.renderOption(a,i))}renderOption(e,t){var{keyboardOptionIndex:n}=this.state,a="option-".concat(t,"-").concat(e.value);return d.jsx("button",{type:"button",className:F("aci-option-btn",{"keyboard-active":n===t}),onClick:()=>this.handleOptionClick(e),onFocus:()=>this.setState({keyboardOptionIndex:t}),children:e.title},a)}render(){var{options:e,inputPlaceholder:t,disabled:n,className:a,defaultTitle:i,spellCheck:s,"data-testid":o}=this.props,{title:l,menuIsOpen:u,popperOptions:f,invalid:h}=this.state;return d.jsxs("div",{className:"aci-container",ref:this.cbContainer,children:[d.jsx("input",{value:l||i,className:F("form-control",a,"aci-input",{"is-invalid":h&&!u}),ref:this.input,onChange:this.handleInputChange,placeholder:t||e[0].title,disabled:n,onFocus:this.handelInputFocus,onClick:this.handleInputClick,onBlur:this.handleInputBlur,onKeyDown:this.handleInputKeyDown,spellCheck:s,"data-testid":o}),d.jsx(Xt,{ref:this.popper,options:f,className:F("aci-options-popper interactive"),onEntered:this.handleMenuOpened,onExited:this.handleMenuExited,children:this.renderMenuElement()})]})}}fe(ie,"propTypes",{options:x.arrayOf(x.shape({title:x.string.isRequired,value:x.string.isRequired})).isRequired,popperOptions:x.shape({}),onChange:x.func,inputPlaceholder:x.string,disabled:x.bool,className:x.string,defaultTitle:x.string,spellCheck:x.bool,onEnter:x.func,noMatchText:x.string,"data-testid":x.string});fe(ie,"defaultProps",{onChange(){},inputPlaceholder:"",disabled:!1,className:"",defaultTitle:"",popperOptions:null,spellCheck:!0,onEnter(){},noMatchText:"No matching items found","data-testid":void 0});fe(ie,"MENU_NAVIGATION_DIRECTION",At);const Ml=ie;function nr(r){var{className:e="",value:t,onChange:n,spellCheck:a=!1,placeholder:i="",disabled:s=!1,delimiter:o="",id:l="","data-testid":u}=r,[f,h]=c.useState(t),[p,v]=c.useState(!1),m=c.useRef(null);c.useEffect(function(){h(t)},[t]);function g(O){return O.trim().split(o).filter(N=>N).join(`
2
2
  `.concat(o.trim()))}function b(O){return O.split(`
3
- `).map(N=>N.trim()).join(" ")}function E(){if(m.current){m.current.style.height="0";var O=m.current.scrollHeight+(m.current.offsetHeight-m.current.clientHeight);O>0&&(m.current.style.height="".concat(O,"px"))}}function P(O){var N=O.target.value;p&&(o&&(N=g(N)),v(!1)),h(N),n(N)}function y(){m.current&&(o&&(h(g(f)),E()),m.current.scrollLeft=0)}function C(){m.current&&document.activeElement!==m.current&&m.current.focus()}function T(){o&&(h(b(f)),n(b(f)))}function A(){v(!0)}return c.useEffect(function(){E()},[f]),d.jsx("textarea",{ref:m,id:l,className:F(e,"auto-resize-textarea form-control"),placeholder:i,value:f,rows:1,onChange:P,onFocus:y,onMouseDown:C,onBlur:T,onPaste:A,spellCheck:a,disabled:s,"data-testid":u})}nr.propTypes={value:x.string.isRequired,onChange:x.func.isRequired,className:x.string,placeholder:x.string,spellCheck:x.bool,disabled:x.bool,delimiter:x.string,id:x.string,"data-testid":x.string};nr.defaultProps={className:"",id:"",placeholder:"",disabled:!1,spellCheck:!1,delimiter:"","data-testid":void 0};function Ke(r){var{children:e,className:t,style:n,"data-testid":a}=r;return d.jsx("div",{className:F("btn-group",t),style:n,role:"group","data-testid":a,children:e})}Ke.displayName="ButtonGroup";Ke.propTypes={children:x.node.isRequired,className:x.string,style:x.object,"data-testid":x.string};Ke.defaultProps={className:null,style:{},"data-testid":void 0};function Fl(r){var{blockInteraction:e=!0,children:t,debounceMs:n,isOpen:a=!1}=r,i=ct(a,n);return d.jsxs(d.Fragment,{children:[e&&a&&d.jsx("div",{className:"modal-backdrop",style:{backgroundColor:"transparent"},"data-testid":"debounced-modal-backdrop"}),V.cloneElement(t,{isOpen:a&&i})]})}function kl(r){var{className:e,icon:t,isOpen:n=!1,subtitle:a,title:i}=r;return d.jsx(zt,{isOpen:n,className:e,children:d.jsx(qt,{children:d.jsxs("div",{className:"info-modal",children:[t!=null&&d.jsx("div",{className:"message-icon",children:d.jsx(se,{icon:t})}),d.jsx("div",{className:"message-header",children:i}),a!=null&&d.jsx("div",{className:"message-content",children:a})]})})})}function Oa(r){var{className:e="modal-footer",children:t,"data-testid":n}=r;return d.jsx("div",{className:e,"data-testid":n,children:t})}function ar(r){var{isOpen:e,headerText:t,bodyText:n,onCancel:a,onConfirm:i,onDiscard:s,onModalDisable:o,cancelButtonText:l="Cancel",confirmButtonText:u="Okay",discardButtonText:f="Discard",isConfirmDanger:h=!1,children:p,"data-testid":v}=r,m=c.useRef(null),g=c.useRef(null),b=c.useCallback(()=>{g.current!==null&&g.current.checked&&o&&o(),i()},[i,o]),E=c.useCallback(()=>{var y;(y=m.current)===null||y===void 0||y.focus()},[]),P="";return e&&(P=typeof n=="function"?n():n),d.jsxs(zt,{isOpen:e,className:"theme-bg-light",onOpened:E,children:[d.jsx(In,{closeButton:!1,children:t}),d.jsx(qt,{children:P}),d.jsxs(Oa,{children:[o&&d.jsxs("div",{className:"custom-control custom-checkbox form-group mr-auto",children:[d.jsx("input",{type:"checkbox",className:"custom-control-input",id:"move-confirmation-checkbox",defaultChecked:!1,ref:g,"data-testid":v!==void 0?"".concat(v,"-checkbox-confirm"):void 0}),d.jsx("label",{className:"custom-control-label",htmlFor:"move-confirmation-checkbox",children:"Don't ask me again"})]}),s&&d.jsx(pe,{kind:"secondary",className:"mr-auto","data-dismiss":"modal",onClick:s,"data-testid":v!==void 0?"".concat(v,"-btn-discard"):void 0,children:f}),a&&d.jsx(pe,{kind:"secondary","data-dismiss":"modal",onClick:a,"data-testid":v!==void 0?"".concat(v,"-btn-cancel"):void 0,children:l}),d.jsxs(Ke,{children:[d.jsx(pe,{kind:h?"danger":"primary",onClick:b,ref:m,"data-testid":v!==void 0?"".concat(v,"-btn-confirm"):void 0,children:u}),p]})]})]})}ar.propTypes={isOpen:x.bool.isRequired,headerText:x.string.isRequired,bodyText:x.oneOfType([x.string,x.func]).isRequired,onCancel:x.func,onConfirm:x.func.isRequired,onDiscard:x.func,onModalDisable:x.func,cancelButtonText:x.string,confirmButtonText:x.string,discardButtonText:x.string,children:x.node,"data-testid":x.string};ar.defaultProps={children:void 0,cancelButtonText:"Cancel",confirmButtonText:"Okay",discardButtonText:"Discard",onCancel:void 0,onDiscard:void 0,onModalDisable:void 0,"data-testid":void 0};var dt=V.forwardRef((r,e)=>{var{children:t,className:n,disabled:a,onClick:i,style:s,id:o}=r;return d.jsx("button",{ref:e,type:"button",className:F("btn",n),onClick:i,style:s,disabled:a,id:o,children:t})});dt.displayName="Button";dt.propTypes={children:x.node,className:x.string,disabled:x.bool,onClick:x.func,style:x.shape({}),id:x.string};dt.defaultProps={children:null,className:"",disabled:!1,onClick:()=>null,style:{},id:""};const Ll=dt;function jr(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(r,a).enumerable})),t.push.apply(t,n)}return t}function Rr(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?jr(Object(t),!0).forEach(function(n){jl(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):jr(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function jl(r,e,t){return e=Rl(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Rl(r){var e=$l(r,"string");return typeof e=="symbol"?e:String(e)}function $l(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}function Vl(r){var{styleProps:e,selectedItemCount:t,onClearSelection:n}=r;return d.jsx(yi,Rr(Rr({UNSAFE_className:rr.spectrumActionBar},e),{},{isEmphasized:!0,selectedItemCount:t,onClearSelection:n}))}function Ul(r){var{className:e,isFlipped:t,children:n,"data-testid":a}=r,i=u=>{if(n.length!==2)throw new Error("CardFlip requires 2 children to function");return n[u]},s=c.useRef(null),o=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(!s.current)throw Error("ref undefined");s.current.addEventListener("transitionstart",o);var f=s.current;return function(){if(f!=null)return f.removeEventListener("transitionstart",o)}},[o]),d.jsxs("div",{className:F(e,{"card-flip--show-front":t,"card-flip--show-back":!t}),"data-testid":a,children:[d.jsx("div",{className:"card-flip--back",children:i(0)}),d.jsx("div",{ref:s,className:"card-flip--front",onTransitionEnd:l,children:i(1)})]})}function Ca(r,e,t){return e=Bl(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Bl(r){var e=Hl(r,"string");return typeof e=="symbol"?e:String(e)}function Hl(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class oe extends c.Component{static handleEnter(e){var t=e;t.style.height="0"}static handleEntering(e){var t=e;t.style.height="".concat(oe.getHeight(t),"px")}static handleExiting(e){var t=e;t.style.height="0"}static handleExit(e){var t=e;t.style.height="".concat(oe.getHeight(t),"px")}static getHeight(e){var t=e.scrollWidth-e.clientWidth;return e.scrollHeight-t}constructor(e){super(e),this.handleEntered=this.handleEntered.bind(this)}handleEntered(e){var t=e;t.style.height="";var{autoFocusOnShow:n}=this.props;if(n!==void 0&&n){var a=t.querySelector("input, select, textarea");a!=null&&a.focus()}}render(){var{children:e,className:t,in:n,"data-testid":a}=this.props;return d.jsx(Je,{in:n,classNames:{enterActive:"collapsing",enterDone:"collapse show",exitActive:"collapsing",exitDone:"collapse"},onEnter:oe.handleEnter,onEntering:oe.handleEntering,onEntered:this.handleEntered,onExit:oe.handleExit,onExiting:oe.handleExiting,timeout:350,children:i=>d.jsx("div",{className:F({collapse:i==="exited"},t),"data-testid":a,children:e})})}}Ca(oe,"propTypes",{className:x.string,in:x.bool.isRequired,children:x.node.isRequired,autoFocusOnShow:x.bool,"data-testid":x.string});Ca(oe,"defaultProps",{className:"",autoFocusOnShow:!1,"data-testid":void 0});const Gl=oe;var Wl=k.module("TimeInput"),Kl="([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]",zl=["00:00:00","12:34:56","23:59:59"],xa=V.forwardRef((r,e)=>{var{allowValueWrapping:t=!0,className:n="",onChange:a=()=>!1,value:i=0,onFocus:s=()=>!1,onBlur:o=()=>!1,onSelect:l=()=>!1,"data-testid":u}=r,[f,h]=c.useState(Be.formatTime(i)),[p,v]=c.useState(),m=c.useRef(null);c.useImperativeHandle(e,()=>({focus:()=>{var y;(y=m.current)===null||y===void 0||y.focus()},setSelection:y=>{var C;(C=m.current)===null||C===void 0||C.focus(),v(y)}}),[]),c.useEffect(function(){h(Be.formatTime(i))},[i]);function g(y,C,T){var A=y.selectionStart===0?24:60,O=parseInt(T,10)-C;return Number.isNaN(O)?O=0:t?O=(O%A+A)%A:O=Math.min(Math.max(0,O),A-1),"".concat(O).padStart(2,"0")}function b(y,C,T,A,O){return A===0&&O===2&&C===1&&parseInt(T,10)>1?"0".concat(T).concat(y.substring(2)):Bn(y,C,T)}function E(y){Wl.debug("handleChange",y),h(y),Be.isTimeString(y)&&a(Be.parseTime(y))}var P=c.useCallback(y=>{v(y),l(y)},[l]);return d.jsx(Yt,{ref:m,className:n,example:zl,getNextSegmentValue:g,getPreferredReplacementString:b,onChange:E,onSelect:P,pattern:Kl,selection:p,value:f,onFocus:s,onBlur:o,"data-testid":u})});xa.defaultProps={allowValueWrapping:!0,className:"",onChange:()=>!1,onSelect:()=>!1,value:0,onFocus:()=>!1,onBlur:()=>!1,"data-testid":void 0};const nt=xa;function $r(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(r,a).enumerable})),t.push.apply(t,n)}return t}function ql(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?$r(Object(t),!0).forEach(function(n){be(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):$r(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function be(r,e,t){return e=Xl(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Xl(r){var e=Yl(r,"string");return typeof e=="symbol"?e:String(e)}function Yl(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}var Vr=-1,Nt;(function(r){r.UP="UP",r.DOWN="DOWN"})(Nt||(Nt={}));class te extends c.Component{constructor(e){super(e),be(this,"csContainer",void 0),be(this,"menuContainer",void 0),be(this,"button",void 0),be(this,"input",void 0);var{value:t,valueToTime:n}=e;this.toggleMenu=this.toggleMenu.bind(this),this.handleMenuKeyDown=this.handleMenuKeyDown.bind(this),this.closeMenu=this.closeMenu.bind(this),this.handleOptionClick=this.handleOptionClick.bind(this),this.handleOptionFocus=this.handleOptionFocus.bind(this),this.handleMenuOpened=this.handleMenuOpened.bind(this),this.handleMenuExited=this.handleMenuExited.bind(this),this.handleCustomInput=this.handleCustomInput.bind(this),this.csContainer=V.createRef(),this.menuContainer=V.createRef(),this.button=V.createRef(),this.input=V.createRef(),this.state={keyboardOptionIndex:0,menuIsOpen:!1,inputWidth:100,customTime:n(t),inputFocused:!1}}getSelectedText(){var{options:e,value:t,placeholder:n}=this.props,{customTime:a}=this.state;if(t===null)return n;for(var i=0;i<e.length;i+=1){var s=e[i];if(s.value===t)return s.title}return Be.formatTime(a)}setInputWidth(){this.csContainer.current&&this.setState({inputWidth:this.csContainer.current.getBoundingClientRect().width})}focus(){var e;(e=this.button.current)===null||e===void 0||e.focus()}updateInputValue(e){var{onChange:t}=this.props;t(e)}handleResize(){this.setInputWidth()}handleMenuKeyDown(e){var t,{keyboardOptionIndex:n,inputFocused:a}=this.state,{options:i}=this.props;switch(e.key){case"Enter":case" ":a?this.updateFromCustom():this.updateInputValue(i[n].value),this.closeMenu(),(t=this.button.current)===null||t===void 0||t.focus(),e.stopPropagation(),e.preventDefault();break;case"Tab":e.shiftKey?this.handleMenuNavigation(te.MENU_NAVIGATION_DIRECTION.UP):this.handleMenuNavigation(te.MENU_NAVIGATION_DIRECTION.DOWN),e.stopPropagation(),e.preventDefault();break;case"ArrowUp":this.handleMenuNavigation(te.MENU_NAVIGATION_DIRECTION.UP),e.stopPropagation(),e.preventDefault();break;case"ArrowDown":this.handleMenuNavigation(te.MENU_NAVIGATION_DIRECTION.DOWN),e.stopPropagation(),e.preventDefault();break;case"Escape":this.closeMenu();break}}handleMenuNavigation(e){var{keyboardOptionIndex:t,inputFocused:n}=this.state,{options:a}=this.props,i=a.length,s=t;switch(e){case te.MENU_NAVIGATION_DIRECTION.UP:if(!n&&t===0){this.focusInput();break}else n&&this.focusOption(t);t>0&&!n?(s=(s-1)%i,this.setState({keyboardOptionIndex:s})):t===0&&(s=i-1,this.setState({keyboardOptionIndex:s})),this.scrollOptionIntoView(s);break;case te.MENU_NAVIGATION_DIRECTION.DOWN:if(!n&&t===i-1){this.focusInput();break}else n&&this.focusOption(t);t<i&&!(n&&t===0)&&(s=(s+1)%i,this.setState({keyboardOptionIndex:s})),this.scrollOptionIntoView(s);break}}handleOptionClick(e){var t=Number(e.currentTarget.value),{options:n,timeToValue:a}=this.props,{customTime:i}=this.state;if(t===Vr){var s=a(i);this.updateAndClose(s)}else this.updateAndClose(n[t].value)}updateAndClose(e){var t;this.updateInputValue(e),this.closeMenu(),(t=this.button.current)===null||t===void 0||t.focus()}handleOptionFocus(e){this.setState({keyboardOptionIndex:Number(e.target.value)})}handleMenuOpened(){var e,{options:t,value:n}=this.props,{keyboardOptionIndex:a}=this.state;this.scrollOptionIntoView(a);var i=(e=this.menuContainer.current)===null||e===void 0?void 0:e.querySelector(".cs-option-btn.keyboard-active");if(i instanceof HTMLElement&&i.focus(),n!==null){var s=t.map(o=>o.value).indexOf(n);s<0&&this.focusInput()}}focusInput(){var e;(e=this.input.current)===null||e===void 0||e.focus()}focusOption(e){var t,n=(t=this.menuContainer.current)===null||t===void 0?void 0:t.querySelector(".cs-options");if(n&&n.children!=null){var a=n.children.item(e);a instanceof HTMLElement&&a.focus()}}handleMenuExited(){var{menuIsOpen:e}=this.state;e&&this.setState({menuIsOpen:!1,keyboardOptionIndex:0})}handleCustomInput(e){var{timeToValue:t}=this.props,n=t(e);this.updateInputValue(n),this.setState({customTime:e})}updateFromCustom(){var{timeToValue:e}=this.props,{customTime:t}=this.state,n=e(t);this.updateInputValue(n)}toggleMenu(e){var{menuIsOpen:t}=this.state;t?this.closeMenu():this.openMenu(),e.stopPropagation()}openMenu(){this.updateKeyboardIndex(),this.setInputWidth(),this.setState({menuIsOpen:!0})}closeMenu(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;if(this.setState({menuIsOpen:!1}),e){var t;(t=this.button.current)===null||t===void 0||t.focus()}}updateKeyboardIndex(){var{options:e,value:t}=this.props;if(t!==null){var n=e.map(a=>a.value).indexOf(t);n>0&&this.setState({keyboardOptionIndex:n})}}scrollOptionIntoView(e){var t,n=(t=this.menuContainer.current)===null||t===void 0?void 0:t.querySelector(".cs-options");if(n&&n.children!=null){var a=n.children.item(e);a instanceof HTMLElement&&a.offsetTop>te.DROP_DOWN_MENU_HEIGHT?n.scrollTop=a.offsetTop-te.DROP_DOWN_MENU_HEIGHT:(a instanceof HTMLElement&&a.offsetTop<0||e===0)&&(n.scrollTop=0)}}renderMenuElement(){var{inputWidth:e}=this.state;return d.jsx("div",{className:"cs-menu-container",ref:this.menuContainer,role:"presentation",onKeyDown:this.handleMenuKeyDown,onClick:t=>{t.stopPropagation()},style:{width:e},children:d.jsx("div",{className:"cs-options-container",children:d.jsx("div",{className:"cs-options",children:this.renderOptions()})})})}renderOptions(){for(var{options:e,value:t,icon:n,customText:a}=this.props,{keyboardOptionIndex:i,customTime:s,inputFocused:o}=this.state,l=!1,u=[],f=0;f<e.length;f+=1){var h=e[f],p="option-".concat(f,"-").concat(h.value);l=l||h.value===t,u.push(d.jsxs("button",{type:"button",value:f,className:F("cs-option-btn",{"keyboard-active":i===f&&!o}),onClick:this.handleOptionClick,onFocus:this.handleOptionFocus,children:[h.value===t&&d.jsx(se,{icon:n,className:"mr-2"}),h.value!==t&&d.jsx("span",{className:"mr-4"}),h.title]},p))}return u.push(d.jsx("hr",{className:"cs-divider"},"option-divider")),u.push(d.jsxs("button",{type:"button",value:Vr,className:F("cs-option-btn",{"keyboard-active":o}),onClick:this.handleOptionClick,onFocus:this.handleOptionFocus,children:[!l&&t!==null?d.jsx(se,{icon:n,className:"mr-2"}):d.jsx("span",{className:"mr-4"}),a]},"option-custom-label")),u.push(d.jsxs("div",{className:"cs-custom-container",children:[d.jsx("span",{className:"mr-2"}),d.jsx(nt,{ref:this.input,onChange:this.handleCustomInput,value:s,onFocus:()=>this.setState({inputFocused:!0}),onBlur:()=>this.setState({inputFocused:!1})},"option-input"),d.jsx("span",{className:"ml-2"})]},"cs-custom-container")),u.push(d.jsx("hr",{className:"mb-2"},"option-end")),u}render(){var{disabled:e,invalid:t,value:n,"data-testid":a}=this.props,{menuIsOpen:i}=this.state,{popperOptions:s}=this.props;return s=ql({placement:"bottom-end",modifiers:{preventOverflow:{enabled:!1}}},s),d.jsx("div",{className:"input-group cs-container context-menu",ref:this.csContainer,"data-testid":a,children:d.jsx("div",{className:F("input-group-append cs-dropdown",{"cs-dropdown-invalid":t}),children:d.jsxs("button",{type:"button",className:F("btn cs-btn form-control",{"cs-btn-invalid":t}),ref:this.button,onClick:this.toggleMenu,disabled:e,children:[d.jsx("span",{className:F({"text-muted":n===null}),children:this.getSelectedText()}),d.jsx("span",{children:d.jsx(se,{icon:_n,className:"cs-caret"})}),d.jsx(Hn,{isShown:i,actions:{menuElement:this.renderMenuElement()},popperOptions:s,popperClassName:"CustomTimeSelect",onMenuOpened:this.handleMenuOpened,onMenuClosed:this.handleMenuExited,menuStyle:{maxWidth:"100rem"}})]})})})}}be(te,"MENU_NAVIGATION_DIRECTION",Nt);be(te,"DROP_DOWN_MENU_HEIGHT",125);be(te,"defaultProps",{onChange(){},value:null,disabled:!1,popperOptions:{},icon:_i,customText:"Custom",placeholder:"Select a time",valueToTime:r=>r===null?0:Math.round(r/1e3),timeToValue:r=>r*1e3,invalid:!1,"data-testid":void 0});const Zl=te;var Ql=k.module("DateInput"),Jl="[12][0-9]{3}-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])",eu=["2000-01-01","2022-12-31"],tu="YYYY-MM-DD",ir=V.forwardRef((r,e)=>{var{className:t="",onChange:n=()=>{},defaultValue:a="",onFocus:i=()=>{},onBlur:s=()=>{},"data-testid":o}=r,[l,u]=c.useState(a),[f,h]=c.useState(),p=c.useCallback(v=>{Ql.debug("handleChange",v),u(v),n(v)},[n]);return d.jsx("div",{className:"d-flex flex-row align-items-center",children:d.jsx(Yt,{ref:e,className:F(t),example:eu,getNextSegmentValue:as,onChange:p,onSelect:h,pattern:Jl,placeholder:tu,selection:f,value:l,onFocus:i,onBlur:s,"data-testid":o})})});ir.displayName="DateInput";ir.defaultProps={className:"",onChange:()=>!1,defaultValue:"",onFocus:()=>!1,onBlur:()=>!1,"data-testid":void 0};const ru=ir;function Da(r,e,t){return e=nu(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function nu(r){var e=au(r,"string");return typeof e=="symbol"?e:String(e)}function au(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class Aa extends c.PureComponent{constructor(e){super(e),Da(this,"searchInput",void 0),this.searchInput=V.createRef(),this.handleChange=this.handleChange.bind(this),this.sendUpdate=we(this.sendUpdate.bind(this),e.debounceMs),this.state={value:e.value}}componentDidUpdate(e){var{value:t}=this.props;e.value!==t&&this.setState({value:t})}focus(){var e;(e=this.searchInput.current)===null||e===void 0||e.focus()}handleChange(e){this.setState({value:e.target.value},this.sendUpdate)}sendUpdate(){var{onChange:e}=this.props,{value:t}=this.state;e(t)}render(){var{placeholder:e,className:t,matchCount:n,id:a,"data-testid":i}=this.props,{value:s}=this.state;return d.jsx(Zt,{value:s,placeholder:e,onChange:this.handleChange,className:t,matchCount:n,ref:this.searchInput,id:a,"data-testid":i})}}Da(Aa,"defaultProps",{placeholder:"Search",className:"",matchCount:null,debounceMs:250,id:"","data-testid":void 0});const iu=Aa;function su(r){var{isInvalid:e=!1,items:t,onAdd:n=()=>{},onDelete:a=()=>{},validate:i=()=>null}=r,[s,o]=c.useState(null),[l,u]=c.useState([]),[f,h]=c.useState(""),p=c.useCallback(y=>{u(y)},[]),v=c.useCallback(()=>{a(wr.getItemsInRanges(t,l)),u([])},[t,l,a]),m=c.useCallback(()=>{if(f!==""){var y=i(f);y==null?(n(f),h("")):o(y)}},[f,n,i]),g=c.useCallback(y=>{var{value:C}=y.target;h(C),o(C===""?null:i(C))},[i]),b=c.useCallback(()=>{u([])},[]),E=c.useCallback(y=>{y.key==="Enter"&&m()},[m]),P=c.useMemo(()=>14+Ei(t.length,1,6)*xt.DEFAULT_ROW_HEIGHT,[t.length]);return d.jsxs("div",{className:F("editable-item-list-container",{"is-invalid":e}),children:[d.jsx("div",{style:{height:P},children:d.jsx(xt,{itemCount:t.length,items:t.map((y,C)=>({value:y,isSelected:wr.isSelected(l,C)})),offset:0,selectedRanges:l,onSelectionChange:p,isMultiSelect:!0})}),d.jsxs("div",{className:"d-flex flex-row pt-2",children:[d.jsx("div",{className:"d-flex flex-grow-1",children:d.jsx("input",{className:F("form-control",{"is-invalid":s!=null}),placeholder:"Enter value",type:"text",value:f,onChange:g,onFocus:b,onKeyDown:E})}),d.jsxs("div",{className:"d-flex align-items-start mt-1 ml-2",children:[d.jsx(pe,{kind:"ghost",onClick:m,disabled:s!=null||f==="",icon:Mi,tooltip:"Add new item","data-testid":"add-item-button"}),d.jsx(pe,{kind:"ghost",onClick:v,disabled:l.length===0,icon:Nn,tooltip:"Delete selected items","data-testid":"delete-item-button"})]})]})]})}function ou(r,e,t){return e=lu(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function lu(r){var e=uu(r,"string");return typeof e=="symbol"?e:String(e)}function uu(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class Me extends c.Component{static isParentSelected(e,t){var n=t.get(e);if(n===void 0)return!1;if(typeof n=="boolean")return n;var a=Array.from(n.values()).includes(!0),i=Array.from(n.values()).includes(!1);return a&&i?null:a}constructor(e){super(e),this.toggleMenu=this.toggleMenu.bind(this),this.toggleValueFor=this.toggleValueFor.bind(this),this.selectAll=this.selectAll.bind(this),this.clear=this.clear.bind(this),this.state={menuIsOpen:!1}}toggleMenu(e){e.stopPropagation(),e.preventDefault(),this.setState(t=>{var{menuIsOpen:n}=t;return{menuIsOpen:!n}})}toggleValueFor(e,t){var{valueMap:n,onUpdateValueMap:a}=this.props,i=new Map(n),s=i.get(e);if(s instanceof Map){var o=new Map(s);if(t!=null)o.set(t,s.get(t)===void 0);else{var l=Me.isParentSelected(e,i),u=l==null||!l;s.forEach((p,v)=>o.set(v,u))}i.set(e,o)}else i.set(e,s==null||!s);var f=i.get(e);if(t===void 0&&f!==void 0&&typeof f!="boolean"){var h=Me.isParentSelected(e,n);h!=null&&h?f.forEach((p,v)=>f.set(v,!1)):f.forEach((p,v)=>f.set(v,!0))}a(i)}setAllValues(e){var{valueMap:t,onUpdateValueMap:n}=this.props,a=new Map;t.forEach((i,s)=>{if(typeof i=="boolean")a.set(s,e);else{var o=new Map;i.forEach((l,u)=>o.set(u,e)),a.set(s,o)}}),n(a)}selectAll(){this.setAllValues(!0)}clear(){this.setAllValues(!1)}renderMenuElement(){var{valueMap:e,"data-testid":t}=this.props;return d.jsxs("div",{className:"hcm-menu-container",children:[Array.from(e.entries()).map(n=>{var[a,i]=n;return d.jsxs("div",{children:[d.jsx(Dt,{className:"hcm-parent",checked:Me.isParentSelected(a,e),onChange:()=>this.toggleValueFor(a),children:a}),i!==void 0&&typeof i!="boolean"&&Array.from(i.entries()).map(s=>{var[o,l]=s;return d.jsx(Dt,{className:"hcm-child",checked:l,onChange:()=>this.toggleValueFor(a,o),children:o},o)})]},a)}),d.jsx(pe,{kind:"ghost",onClick:this.selectAll,"data-testid":t!==void 0?"".concat(t,"-btn-select-all"):void 0,children:"Select All"}),d.jsx(pe,{kind:"ghost",onClick:this.clear,"data-testid":t!==void 0?"".concat(t,"-btn-clear"):void 0,children:"Clear"})]})}render(){var{menuText:e,className:t,icon:n,id:a,"data-testid":i}=this.props,{menuIsOpen:s}=this.state;return d.jsxs("button",{type:"button",className:F("btn hcm-btn",t),onClick:this.toggleMenu,id:a,"data-testid":i,children:[d.jsxs("span",{children:[n&&d.jsx(se,{icon:n,className:"hcm-icon mr-1"}),e]}),d.jsx(se,{icon:_n,className:"hcm-icon ml-1"}),d.jsx(Xt,{options:{placement:"bottom"},isShown:s,onExited:()=>{this.setState({menuIsOpen:!1})},closeOnBlur:!0,interactive:!0,children:this.renderMenuElement()})]})}}ou(Me,"defaultProps",{className:"",icon:null,id:"","data-testid":void 0});const cu=Me;var du=.025,fu=.9,hu=.1,pu=.618,yt=Pe["primary-dark"],Ur=80,vu=Pe["gray-800"],mu=Pe["gray-900"],Ee={SIZE:8,DOT_SIZE:2,FILL_OPACITY:.25},me=18,gu=250,bu=60*1e3,yu=V.memo(()=>{var r=c.useRef(null),e=c.useRef(null),[t,n]=c.useState(!1),a=window.devicePixelRatio,i,s,o,l,u,f=null,h=[];function p(){var S;e.current!=null&&(o=e.current.offsetWidth,l=e.current.offsetHeight),r.current!=null&&(r.current.style.width="".concat(o,"px"),r.current.style.height="".concat(l,"px"),r.current.width=o*a,r.current.height=l*a),(S=i)===null||S===void 0||S.scale(a,a)}function v(){var S=document.createElement("canvas");S.width=Ee.SIZE,S.height=Ee.SIZE;var D=S.getContext("2d");return D!=null&&(D.fillStyle=yt,D.fillRect(0,0,Ee.DOT_SIZE,Ee.DOT_SIZE),D.fillStyle=yt+Math.round(255*Ee.FILL_OPACITY).toString(16).padStart(2,"0"),D.fillRect(0,0,Ee.SIZE,Ee.SIZE)),D==null?void 0:D.createPattern(S,"repeat")}function m(S){var D=Math.random()-.5,I=du*D;return S<hu?I=Math.abs(I):S>fu&&(I=-Math.abs(I)),S+I}function g(){for(var S=[],D=pu,I=0;I<o+me;I+=1)D=m(D),S.push(D);return S}function b(){for(;h.length>=o+me;)h.pop();for(;h.length<o+me;)h.push(m(h[h.length-1]))}function E(S,D){D.beginPath(),D.moveTo(-1,l+1),D.lineTo(-1,l*S[0]);for(var I=0;I<S.length;I+=1)D.lineTo(I,l*S[I]);D.lineTo(o+me,l*S[S.length-1]),D.lineTo(o+me,l+1),D.closePath()}function P(S){S.beginPath();for(var D=1;D<o;D+=Ur)S.moveTo(D,0),S.lineTo(D,l);for(var I=1;I<l;I+=Ur)S.moveTo(0,I),S.lineTo(o,I)}function y(S){var D,I,J;f=(D=f)!==null&&D!==void 0?D:S,Ae(i),i.fillStyle=mu,i.fillRect(0,0,o,l),P(i),i.lineWidth=1,i.strokeStyle=vu,i.stroke();var ne=(((I=f)!==null&&I!==void 0?I:0)-(S??0))/(1e3/me);if(i.translate(ne,0),E(h,i),i.lineWidth=2,i.strokeStyle=yt,i.stroke(),i.translate(-ne,0),s!=null&&(i.fillStyle=s),i.fill(),i.setTransform(a,0,0,a,0,0),(S??0)-((J=f)!==null&&J!==void 0?J:0)>1e3/me){for(var j,G=Math.floor(((S??0)-((j=f)!==null&&j!==void 0?j:0))/(1e3/me)),U=0;U<G;U+=1)h.shift(),h.push(m(h[h.length-1]));f=S}u!=null&&cancelAnimationFrame(u),u=requestAnimationFrame(y)}var C=we(()=>{u=requestAnimationFrame(S=>{p(),b(),n(!1),y(S)})},gu,{leading:!0});function T(){n(!0),u!=null&&cancelAnimationFrame(u),u=null,f=null}var A=we(()=>{T()},bu);function O(){u==null&&(n(!1),p(),b(),u=requestAnimationFrame(y)),A()}function N(){document.hasFocus()&&O()}function M(){u!=null&&cancelAnimationFrame(u),A(),C()}return c.useEffect(()=>{var S;return i=(S=r.current)===null||S===void 0?void 0:S.getContext("2d",{alpha:!1}),p(),h=g(),s=v(),y(),A(),window.addEventListener("resize",M),window.addEventListener("focus",O),window.addEventListener("blur",T),window.addEventListener("mousemove",N),window.addEventListener("keydown",N),()=>{u!=null&&cancelAnimationFrame(u),window.removeEventListener("resize",M),window.removeEventListener("focus",O),window.removeEventListener("blur",T),window.removeEventListener("mousemove",N),window.removeEventListener("keydown",N),A.cancel(),C.cancel()}},[]),d.jsx("div",{className:"random-area-plot-animation-container",ref:e,children:d.jsx("canvas",{ref:r,className:t?"shade":""})})});const Na=yu;function Ia(r){var{text:e,placement:t="top-start"}=r,n=c.useMemo(()=>({placement:t}),[t]);return d.jsxs(d.Fragment,{children:[d.jsx(Pn,{UNSAFE_className:rr.spectrumEllipsis,children:e??d.jsx(d.Fragment,{children:" "})}),e==null||e===""?null:d.jsx(Gn,{options:n,children:e})]})}var Eu=["scrollRef","getItemDisplayText","getKey"];function Br(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(r,a).enumerable})),t.push.apply(t,n)}return t}function Hr(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Br(Object(t),!0).forEach(function(n){Su(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):Br(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function Su(r,e,t){return e=Tu(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Tu(r){var e=wu(r,"string");return typeof e=="symbol"?e:String(e)}function wu(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}function Pu(r,e){if(r==null)return{};var t=Ou(r,e),n,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(r);for(a=0;a<i.length;a++)n=i[a],!(e.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(r,n)&&(t[n]=r[n])}return t}function Ou(r,e){if(r==null)return{};var t={},n=Object.keys(r),a,i;for(i=0;i<n.length;i++)a=n[i],!(e.indexOf(a)>=0)&&(t[a]=r[a]);return t}function Cu(r){var{scrollRef:e,getItemDisplayText:t,getKey:n}=r,a=Pu(r,Eu),i=c.useCallback(s=>{var o=n(s),l=t(s);return d.jsx(Si,{textValue:l??String(o),children:d.jsx(Ia,{text:l})},o)},[t,n]);return d.jsx(Ti,Hr(Hr({},a),{},{ref:e,menuTrigger:"focus",onSelectionChange:a.onSelectionChange,children:i}))}var sr=V.forwardRef((r,e)=>{var{children:t,className:n,disabled:a,id:i,isLinked:s,isLinkedSource:o,isInvalid:l,onClick:u,onMouseEnter:f,onMouseLeave:h,style:p,"data-testid":v}=r;return d.jsxs("button",{ref:e,type:"button",className:F("btn-socketed",{"btn-socketed-linked":s!==void 0&&s||o},{"btn-socketed-linked-source":o},{"is-invalid":l},n),id:i,onClick:u,onMouseEnter:f,onMouseLeave:h,style:p,disabled:a,"data-testid":v,children:[t,d.jsx(se,{icon:Fi,className:"linked btn-socketed-icon",transform:"down-1"}),d.jsx(se,{icon:ki,className:"is-invalid btn-socketed-icon"})]})});sr.displayName="SocketedButton";sr.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 xu=sr,Du={"dh-spectrum-theme--dark":"_dh-spectrum-theme--dark_1qqxl_5"},Au={"dh-spectrum-theme--light":"_dh-spectrum-theme--light_oc9vy_5"};function Gr(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(r,a).enumerable})),t.push.apply(t,n)}return t}function qe(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Gr(Object(t),!0).forEach(function(n){Nu(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):Gr(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function Nu(r,e,t){return e=Iu(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Iu(r){var e=_u(r,"string");return typeof e=="symbol"?e:String(e)}function _u(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}var{global:Mu,light:Fu,dark:ku,medium:Lu,large:ju}=wi,Ru={global:Mu,light:qe(qe({},Fu),Au),dark:qe(qe({},ku),Du),medium:Lu,large:ju},$u=500;function Vu(r){var{heading:e,content:t,delayMs:n=$u}=r,[a,i]=c.useState(!1);return c.useEffect(()=>{window.setTimeout(()=>{i(!0)},n)},[n]),a?d.jsxs(Pi,{children:[d.jsx(Kt,{size:"XXL",children:d.jsx(se,{icon:Li})}),d.jsx(On,{children:e}),t==null?null:d.jsx(Cn,{children:t})]}):null}var Uu=k.module("ThemeProvider"),or=c.createContext(null);function _a(r){var{themes:e,children:t}=r,n=c.useMemo(()=>Mn(),[]),[a,i]=c.useState(()=>{var l,u;return(l=(u=Fn())===null||u===void 0?void 0:u.themeKey)!==null&&l!==void 0?l:kn}),s=c.useMemo(()=>e==null?null:Ln(a,{base:n,custom:e??[]}),[n,a,e]);c.useEffect(function(){Uu.debug("Active themes:",s==null?void 0:s.map(u=>u.themeKey)),jn({themeKey:a,preloadStyleContent:Rn()})},[s,a]);var o=c.useMemo(()=>({activeThemes:s,selectedThemeKey:a,setSelectedThemeKey:i}),[s,a]);return d.jsxs(or.Provider,{value:o,children:[s==null?void 0:s.map(l=>d.jsx("style",{"data-theme-key":l.themeKey,children:l.styleContent},l.themeKey)),t]})}function Bu(){return ot(or,"No ThemeContext value found. Component must be wrapped in a ThemeContext.Provider")}const Hu="_track_1ermw_30",Gu="_handle_1ermw_13",Wu="_ticks_1ermw_98",Ma={"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:Hu,"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:Gu,ticks:Wu,"tick-labels":"_tick-labels_1ermw_116","tick-label":"_tick-label_1ermw_116","tick-label-wrapper":"_tick-label-wrapper_1ermw_132"};var Xe=parseInt(Ma["handle-size"],10),Wr=parseInt(Ma["popover-width"],10),re=24*60*60-1,Kr=5*60;function Ku(r){var{startTime:e,endTime:t,onChange:n,isStartModified:a=!1,isEndModified:i=!1,"data-testid":s}=r,[o,l]=c.useState(e),[u,f]=c.useState(t),h=c.useRef(null);c.useEffect(function(){l(e),f(t)},[e,t]);var p=c.useCallback((g,b)=>{var E=g,P=b;E===P&&(P<re?P+=1:E-=1),l(E),f(P),n({startTime:E,endTime:P})},[l,f,n]),v=c.useCallback(g=>{p(g,u)},[p,u]),m=c.useCallback(g=>{p(o,g)},[p,o]);return d.jsxs("div",{className:"time-slider","data-testid":s,children:[d.jsx(zu,{startTime:o,endTime:u,onStartTimeChange:v,onEndTimeChange:m,isStartModified:a,isEndModified:i}),d.jsxs("div",{className:"track",ref:h,children:[d.jsx(qu,{startTime:o,endTime:u}),d.jsx("div",{className:"ticks",children:Array(24).fill(null).map((g,b)=>d.jsx("div",{className:"tick"},b))}),d.jsx(zr,{track:h,time:o,setTime:v}),d.jsx(zr,{track:h,time:u,setTime:m})]}),d.jsxs("div",{className:"tick-labels",children:[d.jsx("div",{className:"tick-label",children:"0:00"}),d.jsx("div",{className:"tick-label-wrapper",children:Array(24).fill(null).map((g,b)=>d.jsx("div",{className:"tick-label",children:"".concat(b+1,":00")},b))})]})]})}function zu(r){var{startTime:e,endTime:t,onStartTimeChange:n,onEndTimeChange:a,isStartModified:i,isEndModified:s,"data-testid":o}=r,l=e>t,[u,f]=c.useState(l?t:e),[h,p]=c.useState(l?e:t),v=c.useRef(null),m=c.useRef(null),g=c.useRef(null),b=c.useRef(null);c.useEffect(function(){f(e>t?t:e),p(e>t?e:t)},[e,t]),c.useEffect(function(){if(g.current!==null){var A;(A=m.current)===null||A===void 0||A.setSelection(g.current)}if(b.current!==null){var O;(O=v.current)===null||O===void 0||O.setSelection(b.current)}},[l]);function E(T){e<=t?n(T):a(T)}function P(T){e<=t?a(T):n(T)}var y=c.useCallback(T=>{g.current=T,b.current=null},[]),C=c.useCallback(T=>{g.current=null,b.current=T},[]);return d.jsxs("div",{className:"time-slider-popovers",children:[d.jsx("div",{className:"flex",style:{flexBasis:"calc(".concat(u/re*100,"% - ").concat(Wr/2,"px)")}}),d.jsxs("div",{className:"handle-popper",children:[d.jsx("label",{className:F({modified:l?s:i}),children:l?"End Time":"Start Time"}),d.jsx(nt,{ref:v,allowValueWrapping:!1,value:u,onChange:E,onSelect:y,"data-testid":o!==void 0?"".concat(o,"-input-1"):void 0})]}),d.jsx("div",{className:"flex-spacer"}),d.jsxs("div",{className:"handle-popper",children:[d.jsx("label",{className:F({modified:l?i:s}),children:l?"Start Time":"End Time"}),d.jsx(nt,{ref:m,allowValueWrapping:!1,value:h,onChange:P,onSelect:C,"data-testid":o!==void 0?"".concat(o,"-input-2"):void 0})]}),d.jsx("div",{className:"flex",style:{flexBasis:"calc(".concat((re-h)/re*100,"% - ").concat(Wr/2,"px)")}})]})}function qu(r){var{startTime:e,endTime:t,"data-testid":n}=r;return d.jsxs("div",{className:"track-fills","data-testid":n,children:[e>t&&d.jsxs(d.Fragment,{children:[d.jsx("div",{className:"track-fill track-fill-start",style:{transform:"scaleX(".concat(t/re,")")}}),d.jsx("div",{className:"track-fill track-fill-end",style:{transform:"scaleX(".concat((re-e)/re,")")}})]}),e<t&&d.jsx("div",{className:"track-fill track-fill-middle",style:{transform:"translateX(".concat(e/re*100,"%) scaleX(").concat((t-e)/re,")")}})]})}function zr(r){var{track:e,time:t,setTime:n,"data-testid":a}=r,i=c.useMemo(()=>{var p=3600,v=Xe/2;return t<p?v=t/p*(Xe/2):t>23*p&&(v=Xe/2+1/(re-23*p)*(t-23*p)*(Xe/2)),"translateX(calc(".concat(t/re*100,"% - ").concat(v,"px))")},[t]),s=c.useCallback(p=>{if(!e.current)return 0;var v=e.current.getBoundingClientRect(),m=Math.max(p-v.left,0),g=re*Math.min(1,m/v.width),b=Kr*Math.round(g/Kr),E=Math.min(re,b);return E},[e]),o=c.useCallback(p=>{var{clientX:v}=p;n(s(v))},[n,s]),l=c.useCallback(p=>{var{clientX:v}=p;n(s(v)),window.removeEventListener("mousemove",o),window.removeEventListener("mouseup",l),document.documentElement.classList.remove("drag-pointer-events-none")},[n,s,o]),u=c.useCallback(()=>{window.addEventListener("mousemove",o),window.addEventListener("mouseup",l),document.documentElement.classList.add("drag-pointer-events-none")},[o,l]),f=c.useCallback(()=>{window.removeEventListener("mousemove",o),window.removeEventListener("mouseup",l),document.documentElement.classList.remove("drag-pointer-events-none")},[o,l]),h=c.useCallback(()=>{u()},[u]);return c.useEffect(function(){return()=>{f()}},[f]),d.jsx("div",{className:"handle-track",style:{transform:i},children:d.jsx("button",{className:"handle",type:"button","aria-label":"Change time",onMouseDown:h,"data-testid":a})})}function Fa(r){var{buttons:e,isShown:t=!1,classNames:n,message:a,type:i,onClick:s,onDismiss:o,"data-testid":l}=r,u=e&&e.length!==0;return d.jsx(Je,{in:t,timeout:Pe.transitionMs,classNames:"toast-notification-slide-up",mountOnEnter:!0,unmountOnExit:!0,children:d.jsxs("div",{className:F("toast-notification",n,i),role:"presentation",onClick:s,onKeyPress:s,"data-testid":l,children:[d.jsx("div",{className:"message-container",children:d.jsx("span",{className:"message",children:a})}),d.jsx(Je,{in:u,timeout:Pe.transitionSlowMs,classNames:"fade",mountOnEnter:!0,unmountOnExit:!0,children:d.jsx("div",{className:"buttons-container",children:e})}),o&&d.jsx(pe,{kind:"ghost",icon:ji,tooltip:"Close notification",className:"my-2",onClick:o})]})})}Fa.TYPE=Object.freeze({ERROR:"error"});function Xu(r){var{children:e,className:t,labelText:n,hintText:a,isModified:i,validationError:s,showValidationError:o=!0,"data-testid":l,id:u}=r,{current:f}=c.useRef(u??We());return d.jsxs(d.Fragment,{children:[d.jsx("label",{className:F("validate-label",t,{modified:i}),htmlFor:f,"data-testid":l,children:n}),V.Children.toArray(e).map(h=>V.isValidElement(h)?V.cloneElement(h,{className:F(h.props.className,{"is-invalid":s})}):d.jsx("div",{className:F(t),children:h})),a!==void 0&&d.jsx("small",{className:"form-text text-muted",children:a}),s!==void 0&&o&&d.jsx("p",{className:"validate-label-error text-danger",children:s})]})}const Yu=Object.freeze(Object.defineProperty({__proto__:null,ActionButtonDialogTrigger:oa,AutoCompleteInput:Ml,AutoResizeTextarea:nr,BasicModal:ar,BulkActionBar:Vl,Button:pe,ButtonGroup:Ke,ButtonOld:Ll,CardFlip:Ul,Checkbox:Dt,Collapse:Gl,ComboBox:is,ConfirmActionButton:Tl,ConfirmationDialog:wa,ContextActionUtils:ss,ContextActions:os,ContextMenuItem:ls,ContextMenuRoot:us,CopyButton:cs,CustomTimeSelect:Zl,DEFAULT_DARK_THEME_KEY:kn,DEFAULT_GET_PREFERRED_REPLACEMENT_STRING:Bn,DEFAULT_LIGHT_THEME_KEY:Ri,DEFAULT_PRELOAD_DATA_VARIABLES:$i,DateInput:ru,DateTimeInput:ds,DebouncedModal:Fl,DebouncedSearchInput:iu,DragUtils:fs,DraggableItemList:hs,DropdownMenu:Hn,EditableItemList:su,GLOBAL_SHORTCUTS:ps,HierarchicalCheckboxMenu:cu,IconActionButton:Pa,InfoModal:kl,ItemList:xt,ItemListItem:vs,get KEY(){return ms},LoadingOverlay:Oe,LoadingSpinner:$n,get MODIFIER(){return gs},MaskedInput:Yt,Menu:bs,MenuItem:ys,Modal:zt,ModalBody:qt,ModalFooter:Oa,ModalHeader:In,Option:Es,Page:Ss,Popper:Xt,RadioGroup:Ts,RadioItem:ws,RandomAreaPlotAnimation:Na,SearchInput:Zt,SearchableCombobox:Cu,Select:Ps,SelectValueList:Wn,Shortcut:Os,ShortcutRegistry:Cs,SocketedButton:xu,Stack:xs,THEME_CACHE_LOCAL_STORAGE_KEY:Vi,TMP_CSS_PROP_PREFIX:Ui,TableViewEmptyState:Vu,TextWithTooltip:Ia,ThemeContext:or,ThemeExport:Pe,ThemeProvider:_a,TimeInput:nt,TimeSlider:Ku,ToastNotification:Fa,Tooltip:Gn,UISwitch:Ds,ValidateLabelInput:Xu,calculatePreloadStyleContent:Rn,extractDistinctCssVariableExpressions:Bi,fillToLength:As,getActiveThemes:Ln,getCssVariableRanges:Hi,getDefaultBaseThemes:Mn,getThemeKey:Vn,getThemePreloadData:Fn,preloadTheme:Gi,resolveCssVariablesInRecord:Wi,resolveCssVariablesInString:Ki,setThemePreloadData:jn,themeDHDefault:Ru,themeDark:zi,themeLight:qi,trimTrailingMask:Ns,useTheme:Bu},Symbol.toStringTag,{value:"Module"})),Zu=Object.freeze(Object.defineProperty({__proto__:null,ApiBootstrap:Xi,ApiContext:Un,ClientBootstrap:Kn,ClientContext:Is,useApi:ye,useClient:Re},Symbol.toStringTag,{value:"Module"}));function Qu(r){return function(t){var{children:n}=t;return d.jsx(Un.Provider,{value:r,children:n})}}function qr(r,e,t,n,a,i,s){try{var o=r[i](s),l=o.value}catch(u){t(u);return}o.done?e(l):Promise.resolve(l).then(n,a)}function Ju(r){return function(){var e=this,t=arguments;return new Promise(function(n,a){var i=r.apply(e,t);function s(l){qr(i,n,a,s,o,"next",l)}function o(l){qr(i,n,a,s,o,"throw",l)}s(void 0)})}}var Et=k.module("MessageUtils"),ka="io.deephaven.message.LoginOptions.request",La="io.deephaven.message.SessionDetails.request",ja="io.deephaven.broadcast",lr="io.deephaven.broadcast.Login",Ra="io.deephaven.broadcast.Logout";function ft(r){var e=r;return e!=null&&typeof e.id=="string"&&typeof e.message=="string"}function $a(r){return ft(r)&&r.message===lr}function Va(r){return ft(r)&&r.message===Ra}function Ua(r){var e=r;return e!=null&&typeof e.id=="string"}function ur(r){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:We(),t=arguments.length>2?arguments[2]:void 0;return{message:r,id:e,payload:t}}function ec(r,e){return{id:r,payload:e}}function cr(){return window.opener!=null?window.opener:window.parent!=null&&window.parent!==window?window.parent:null}function dr(r){return It.apply(this,arguments)}function It(){return It=Ju(function*(r){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:3e4,t=cr();if(t==null)throw new Error("window parent is null, unable to send request.");return new Promise((n,a)=>{var i,s=We(),o=l=>{var{data:u}=l;if(!Ua(u)){Et.debug("Ignoring non-deephaven response",u);return}if(Et.debug("Received message",u),(u==null?void 0:u.id)!==s){Et.debug("Ignore message, id doesn't match",u);return}window.clearTimeout(i),window.removeEventListener("message",o),n(u.payload)};window.addEventListener("message",o),i=window.setTimeout(()=>{window.removeEventListener("message",o),a(new _s("Request timed out"))},e),t.postMessage(ur(r,s),"*")})}),It.apply(this,arguments)}function tc(r,e,t){return e=rc(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function rc(r){var e=nc(r,"string");return typeof e=="symbol"?e:String(e)}function nc(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class Ba extends Error{constructor(){super(...arguments),tc(this,"isNoConsolesError",!0)}}function Ha(r){return r.isNoConsolesError}function Xr(r,e,t,n,a,i,s){try{var o=r[i](s),l=o.value}catch(u){t(u);return}o.done?e(l):Promise.resolve(l).then(n,a)}function ht(r){return function(){var e=this,t=arguments;return new Promise(function(n,a){var i=r.apply(e,t);function s(l){Xr(i,n,a,s,o,"next",l)}function o(l){Xr(i,n,a,s,o,"throw",l)}s(void 0)})}}var Ne=k.module("SessionUtils");function ac(r,e){return Ne.info("Starting connection to '".concat(e,"'...")),new r.IdeConnection(e)}function Ga(r,e,t){return _t.apply(this,arguments)}function _t(){return _t=ht(function*(r,e,t){Ne.info("Getting console types...");var n=yield e.getConsoleTypes();if(n.length===0)throw new Ba("No console types available");Ne.info("Available types:",n);var a=n[0];Ne.info("Starting session with type",a);var i=yield e.startSession(a),s={type:a,id:We.generate()};return Ne.info("Console session established",s),{session:i,config:s,connection:e,details:t,dh:r}}),_t.apply(this,arguments)}function ic(r,e,t){return Ne.info("createCoreClient",e),new r.CoreClient(e,t)}function sc(r){return r!=null&&typeof r=="object"}function oc(){return Mt.apply(this,arguments)}function Mt(){return Mt=ht(function*(){var r=yield dr(La);if(!sc(r))throw new Error("Unexpected session details response: ".concat(r));return r}),Mt.apply(this,arguments)}function lc(){return Ft.apply(this,arguments)}function Ft(){return Ft=ht(function*(){var r=new URLSearchParams(window.location.search);switch(r.get("authProvider")){case"parent":return oc()}return{}}),Ft.apply(this,arguments)}function uc(r,e,t){return kt.apply(this,arguments)}function kt(){return kt=ht(function*(r,e,t){var n;try{n=yield Ga(r,e,t)}catch(a){if(!Ha(a))throw a}return n}),kt.apply(this,arguments)}const cc=Object.freeze(Object.defineProperty({__proto__:null,BROADCAST_CHANNEL_NAME:ja,BROADCAST_LOGIN_MESSAGE:lr,BROADCAST_LOGOUT_MESSAGE:Ra,BooleanColumnFormatter:Ms,CharColumnFormatter:Fs,DateTimeColumnFormatter:ks,DateUtils:zn,DecimalColumnFormatter:Ls,DefaultColumnFormatter:js,FETCH_TIMEOUT:Rs,Formatter:lt,FormatterUtils:_e,IntegerColumnFormatter:$s,LOGIN_OPTIONS_REQUEST:ka,NoConsolesError:Ba,SESSION_DETAILS_REQUEST:La,StringColumnFormatter:Vs,TableColumnFormatter:Us,TableUtils:He,createComboboxFilterArgs:Bs,createConnection:ac,createCoreClient:ic,createFilterConditionFactory:Qt,createKeyFromOffsetRow:Hs,createNotNullOrEmptyFilterCondition:qn,createOnTableUpdatedHandler:Xn,createSearchTextFilter:Jt,createSelectedValuesFilter:er,createSessionWrapper:Ga,createShowOnlyEmptyFilterCondition:Yn,createValueFilter:Zn,defaultRowDeserializer:Qn,fetchVariableDefinition:Gs,generateEmptyKeyedItems:Jn,getColumnFormats:Ws,getDateTimeFormatterOptions:Ks,getSessionDetails:lc,getSize:tr,getWindowParent:cr,isBroadcastLoginMessage:$a,isBroadcastLogoutMessage:Va,isClosed:et,isCustomColumnFormatDefined:zs,isMessage:ft,isNoConsolesError:Ha,isResponse:Ua,loadSessionWrapper:uc,makeMessage:ur,makeResponse:ec,padFirstAndLastRow:ea,requestParentResponse:dr},Symbol.toStringTag,{value:"Module"}));var Yr=k.module("useTableListener"),dc=(r,e,t)=>c.useEffect(function(){if(r==null){Yr.debug2("Emitter undefined, skipping addEventListener",e);return}return Yr.debug2("Adding listener",e),r.addEventListener(e,t)},[r,e,t]);const Fe=dc;function fc(r,e,t){return e=hc(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function hc(r){var e=pc(r,"string");return typeof e=="symbol"?e:String(e)}function pc(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class vc extends Error{constructor(){super(...arguments),fc(this,"isColumnNameError",!0)}}const mc=vc;function gc(r,e,t){return e=bc(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function bc(r){var e=yc(r,"string");return typeof e=="symbol"?e:String(e)}function yc(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class Ec extends Error{constructor(){super(...arguments),gc(this,"isTableDisconnectError",!0)}}const Sc=Ec;var Ye=k.module("useTable"),Tc=(r,e,t,n)=>{var a=ye(),[i,s]=c.useState(void 0),[o,l]=c.useState([]),[u,f]=c.useState(null),[h,p]=c.useState(null);c.useEffect(()=>{if(n===void 0){s(r==null?void 0:r.columns),f(null);return}try{s(r==null?void 0:r.findColumns(n)),f(null)}catch(b){Ye.error("Column not found",b,n),f(new mc("Invalid columnNames argument"))}},[r,n]),c.useEffect(()=>{if(!i||!r){Ye.debug2("Table or column not initialized, skip viewport update.");return}Ye.debug2("Setting viewport",e,t),r.setViewport(e,t,i)},[i,r,e,t]);var v=c.useCallback(b=>{var{detail:E}=b;if(!i){Ye.error("Columns not initialized.");return}var P=i.map(y=>E.rows.map(C=>C.get(y)));l(P)},[i]),m=c.useCallback(()=>{p(new Sc("Table disconnected"))},[]),g=c.useCallback(()=>{p(null)},[]);return Fe(r,a.Table.EVENT_UPDATED,v),Fe(r,a.Table.EVENT_DISCONNECT,m),Fe(r,a.Table.EVENT_RECONNECT,g),{columns:i,data:o,error:h??u}};const Wa=Tc;var wc=(r,e,t,n)=>{var a=c.useMemo(()=>[n],[n]),{columns:i=[],data:s=[],error:o}=Wa(r,e,t,a);return{column:i[0],data:s[0],error:o}};const Ka=wc;function Zr(r,e,t,n,a,i,s){try{var o=r[i](s),l=o.value}catch(u){t(u);return}o.done?e(l):Promise.resolve(l).then(n,a)}function Pc(r){return function(){var e=this,t=arguments;return new Promise(function(n,a){var i=r.apply(e,t);function s(l){Zr(i,n,a,s,o,"next",l)}function o(l){Zr(i,n,a,s,o,"throw",l)}s(void 0)})}}var ue=k.module("TableInput"),St=250;function fr(r){var e,t,{className:n=void 0,columnName:a,settings:i,defaultValue:s=[],isInvalid:o=!1,onChange:l=()=>!1,onBlur:u=()=>!1,table:f}=r,h=c.useRef(null),p=ye(),v=c.useMemo(()=>{var _=_e.getColumnFormats(i),R=_e.getDateTimeFormatterOptions(i),{defaultDecimalFormatOptions:L={},defaultIntegerFormatOptions:ee={}}=i;return new lt(p,_,R,L,ee)},[p,i]),[m,g]=c.useState(""),[b,E]=c.useState(new Set(s)),[P,y]=c.useState(),C=c.useRef(null),T=Math.min((e=P==null?void 0:P.size)!==null&&e!==void 0?e:0,St),{column:A,data:O,error:N}=Ka(P,0,St-1,a),M=c.useCallback(_=>A?v.getFormattedString(_,A.type,A.name):"".concat(_),[A,v]),[S,D]=c.useMemo(()=>{var _=new Set(b),R=[];if(O==null)return[R,null];if(O.forEach(ee=>{var $e="".concat(ee),Sr=b.has($e);Sr&&_.delete($e),R.push({value:$e,displayValue:M(ee),isSelected:Sr})}),_.size>0){ue.debug2("Selection has items that are missing from the viewport");var L=new Set(b);return Array.from(_).forEach(ee=>{L.delete(ee)}),[R,L]}return[R,null]},[O,b,M]);c.useEffect(()=>{D!==null&&(E(D),l(Array.from(D)))},[l,D]);var I=c.useCallback(function(){var _=Pc(function*(R){try{var L=yield R;ue.debug("Table resolved",L),y(L)}catch(ee){if(Pr.isCanceled(ee))return;ue.error(ee)}});return function(R){return _.apply(this,arguments)}}(),[]);c.useEffect(()=>{var _=Pr.makeCancelable(f);return I(_),()=>{ue.debug2("Cancel table promise"),_.cancel()}},[f,I]);var J=c.useCallback(_=>{var{value:R}=_.target;g(R);var L=S.findIndex($e=>$e.displayValue.includes(R));if(L>-1){var ee;ue.debug2("Found ".concat(R," at index ").concat(L)),(ee=C.current)===null||ee===void 0||ee.scrollIntoView(L)}else ue.debug2("".concat(R," not found"))},[S,C]),ne=c.useCallback(_=>{if(ue.debug("handleSelect",_),_>=S.length){ue.error("Invalid index",_);return}var R=S[_].value,L=new Set(b);S[_].isSelected?L.delete(R):L.add(R),E(L),l(Array.from(L))},[l,S,b]),j=c.useCallback(()=>{var _=S.map(L=>L.value),R=new Set(_);E(R),l(_)},[S,l]),G=c.useCallback(()=>{E(new Set),l([])},[l]),U=c.useCallback(()=>{},[]),z=c.useCallback(_=>{var R,{relatedTarget:L}=_;ue.debug("handleChildBlur",L,L instanceof HTMLElement,h.current,(R=h.current)===null||R===void 0?void 0:R.contains(L)),(!L||h.current&&L instanceof HTMLElement&&!h.current.contains(L))&&u()},[u]),le=S.length===0;return d.jsxs("div",{ref:h,className:F("table-input-container d-flex flex-column position-relative",n),children:[d.jsx(Zt,{disabled:!!N||le,value:m,placeholder:"Search",onChange:J,className:"mb-2 d-flex",onBlur:z}),d.jsx(Wn,{className:"table-input-list",disabled:P===void 0||le,isInvalid:o,items:le?[{value:"Empty",isSelected:!1}]:S,itemCount:T,offset:0,onSelect:ne,onViewportChange:U,ref:C,onBlur:z}),P&&d.jsxs("div",{className:"meta-row",children:[d.jsx("div",{className:"d-flex align-items-center text-muted small",children:P!=null&&P.size>T&&d.jsxs(d.Fragment,{children:["Table is too large, showing the first ",St," items."]})}),d.jsxs("div",{children:[d.jsx("button",{type:"button",className:"btn btn-link",onBlur:z,onClick:j,children:"Select All"}),d.jsx("button",{type:"button",className:"btn btn-link mr-a",onBlur:z,onClick:G,children:"Clear"})]})]}),P==null||N&&d.jsx("div",{className:"h-100 w-100 position-absolute",children:d.jsx(Oe,{isLoaded:P!=null,isLoading:P==null&&N==null,errorMessage:(t=N==null?void 0:N.message)!==null&&t!==void 0?t:null})})]})}fr.displayName="TableInput";fr.defaultProps={isInvalid:!1,className:void 0};var Qr=k.module("useBroadcastChannel");function hr(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:qs,e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:ja,t=c.useMemo(()=>new BroadcastChannel(e),[e]);return c.useEffect(()=>()=>{t.close()},[t]),c.useEffect(()=>{function n(a){var{data:i}=a;if(!ft(i)){Qr.debug("Ignoring non-deephaven message",i);return}Qr.debug("event received",i),r(a)}return t.addEventListener("message",n),()=>{t.removeEventListener("message",n)}},[t,r]),t}function pt(r,e){var t=c.useCallback(n=>{$a(n.data)?r==null||r(n.data):Va(n.data)&&(e==null||e(n.data))},[r,e]);hr(t)}var at="io.deephaven.web.client.auth.refreshToken",za=c.createContext(null),Oc=k.module("RefreshTokenUtils");function Lt(){var r=Le.get(at);try{if(r!=null)return JSON.parse(r)}catch(e){Oc.error("Error parsing refresh token",r,e)}return null}function jt(r){if(r==null){Le.remove(at);return}var e=JSON.stringify({bytes:r.bytes,expiry:r.expiry}),t=new Date(r.expiry);Le.set(at,e,{secure:!0,sameSite:"strict",expires:t})}function qa(r){var{children:e}=r,t=ye(),n=Re(),[a,i]=c.useState(Lt());c.useEffect(function(){var u=n.addEventListener(t.CoreClient.EVENT_REFRESH_TOKEN_UPDATED,f=>{var{detail:h}=f;jt(h),i(h)});return u},[t,n,a]);var s=c.useCallback(()=>{i(Lt())},[]),o=c.useCallback(()=>{jt(null),i(null)},[]);return pt(s,o),d.jsx(za.Provider,{value:a,children:e})}function ve(){var r=ye();return c.useMemo(()=>new He(r),[r])}function Cc(r,e,t,n){var a=ve(),[i,s]=c.useState(""),o=ct(i,t),l=c.useCallback(p=>{s(p.trim())},[]),{data:u,isLoading:f}=Ge(a.doesColumnValueExist,[r,e,o,n]),h=f||i!==o?null:u;return{valueTrimmed:i,valueTrimmedDebounced:o,valueExists:h,trimAndUpdateValue:l}}var Jr=k.module("useDebouncedViewportSearch"),xc=200;function Dc(r,e){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:xc,n=ve(),{table:a,applyFiltersAndRefresh:i}=r,s=c.useMemo(()=>we(o=>{if(Jr.debug("Applying debounced searchText '".concat(o,"'")),a!=null){var l=o.trim();if(l===""){i([]);return}var u=a.findColumn(e),f=n.makeFilterValue(u.type,l),h=[u.filter().contains(f)];i(h)}},t),[i,e,t,a,n]);return c.useEffect(()=>()=>{Jr.debug("Cancelling debounced search function"),s.cancel()},[s]),s}var Xa=300;function Ac(r){var{viewportData:e,columnName:t,shouldSelectAllOnNoSelection:n,mapItemToValue:a}=r,i=ve(),s=ba(e,a),o=ct(s,Xa),l=va(o,ua);return c.useMemo(()=>er(i,t,l.selection,n,l.isInverted),[t,l,n,i])}function pr(r){for(var e=arguments.length,t=new Array(e>1?e-1:0),n=1;n<e;n++)t[n-1]=arguments[n];return c.useMemo(()=>Xs(...t.map(a=>a(r))),[r,...t])}function Nc(r,e,t,n){var a=c.useRef("");return a.current=t,c.useMemo(()=>{var i=r.length>0&&r[0].item==null;return!i&&n!=null&&(a.current===""||n.toLowerCase().includes(a.current.toLowerCase()))?[{key:n,item:{[e]:n}},...r]:r},[n,e,r])}function en(r,e,t,n,a,i,s){try{var o=r[i](s),l=o.value}catch(u){t(u);return}o.done?e(l):Promise.resolve(l).then(n,a)}function Ic(r){return function(){var e=this,t=arguments;return new Promise(function(n,a){var i=r.apply(e,t);function s(l){en(i,n,a,s,o,"next",l)}function o(l){en(i,n,a,s,o,"throw",l)}s(void 0)})}}function _c(r){var{table:e,columnName:t,defaultValue:n,itemHeight:a,topOffset:i=0,value:s}=r;return c.useCallback(Ic(function*(){if(e==null||s===""||s===n)return i;var o=e.findColumn(t),l=yield e.seekRow(0,o,"String",s),u=n==null?0:1;return(l+u)*a+i}),[t,n,a,e,i,s])}function vr(r){var[,e]=c.useState(0),t=ye();return Fe(r,t.Table.EVENT_SIZECHANGED,()=>{e(n=>n+1)}),tr(r)}var Mc=k.module("useInitializeViewportData");function Ya(r){var e=Sa({}),t=Math.max(0,vr(r));return c.useEffect(()=>{var n=e.items.length;t!==n&&(Mc.debug("size changed:",{currentSize:n,targetSize:t}),e.setItems(Array.from(Jn(0,t-1))))},[t,r]),e}function Za(r,e,t){return c.useCallback(function(a){var[i,s]=ea(a,e,t,tr(r));r==null||r.setViewport(i,s)},[r,t,e])}var tn=k.module("useViewportData");function mr(r){var{table:e,itemHeight:t=1,scrollDebounce:n=Bo,viewportSize:a=10,viewportPadding:i=50,deserializeRow:s=Qn}=r,o=Ya(e),l=Za(e,a,i),u=c.useCallback(g=>{e&&!et(e)?l(g):tn.debug("setViewport called on closed table.",e)},[e,l]),f=c.useCallback(g=>{e&&!et(e)?(e.applyFilter(g),u(0)):tn.debug("applyFiltersAndRefresh called on closed table.",e)},[u,e]),h=ye(),p=c.useMemo(()=>Xn(o,s),[s,o]);Fe(e,h.Table.EVENT_UPDATED,p);var v=vr(e);c.useEffect(()=>{u(0)},[e,u,v]);var m=ya(t,u,n);return c.useMemo(()=>({viewportData:o,size:v,table:e,applyFiltersAndRefresh:f,setViewport:u,onScroll:m}),[f,m,u,v,e,o])}function gr(r,e){var{applyFiltersAndRefresh:t}=r;c.useEffect(()=>{t(e)},[t,e])}function Fc(r,e){for(var t=ve(),[n,a]=c.useState(""),i=c.useMemo(()=>Jt(t,e,n),[e,n,t]),s=rt(a,aa),o=mr({table:r,itemHeight:Uo,viewportSize:ia,viewportPadding:sa}),l=arguments.length,u=new Array(l>2?l-2:0),f=2;f<l;f++)u[f-2]=arguments[f];var h=pr(o.table,i,...u);return gr(o,h),{list:o,onSearchTextChange:s}}function kc(r){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"or",t=ve(),n=c.useMemo(()=>qn(t),[t]);return c.useMemo(()=>Qt(r,n,e),[r,e,n])}function Qa(r){c.useEffect(()=>()=>{r!=null&&(et(r)||r.close())},[r])}function Lc(r,e,t){for(var n=ve(),[a,i]=c.useState(""),[s,o]=c.useState(""),[l,u]=c.useState(null),[f,h]=c.useState(()=>new Map),{data:p,isLoading:v}=Ge(n.doesColumnValueExist,[r,e,s,!1]),m=v||s!==a?null:p,g=c.useMemo(()=>Jt(n,e,s),[e,s,n]),b=c.useMemo(()=>er(n,e,new Set(f.keys()),!1,!0),[e,f,n]),E=arguments.length,P=new Array(E>3?E-3:0),y=3;y<E;y++)P[y-3]=arguments[y];var{data:C}=Ge(n.createDistinctSortedColumnTable,[r,e,"asc",...P]);Qa(C);var T=mr({table:C,itemHeight:Vo,viewportSize:ia,viewportPadding:sa}),A=a.length>0&&T.size===0,O=f.has(a),N=rt(o,aa),M=c.useCallback(j=>{i(j),N(j)},[N]),S=rt(u,0),D=c.useCallback(j=>{if(i(""),o(""),u(j),S(null),j!=null){var G=T.viewportData.findItem(j);if(G!=null){var U=t(G);h(z=>{var le=new Map(z);return le.set(U,{value:U}),le})}}},[S,T.viewportData,t]),I=c.useCallback(j=>{h(G=>{if(j.size===0)return G;var U=new Map(G);for(var z of j)U.set(z,{value:z});return U})},[]),J=c.useCallback(j=>{h(G=>{if(j==="all")return new Map;var U=new Map(G);for(var z of j)U.delete(z);return U})},[]),ne=pr(T.table,g,b);return gr(T,ne),c.useMemo(()=>({list:T,hasSearchTextWithZeroResults:A,searchText:a,searchTextExists:m,searchTextIsInSelectedValues:O,selectedKey:l,selectedValueMap:f,onSearchTextChange:M,onSelectKey:D,onAddValues:I,onRemoveValues:J}),[A,T,I,J,M,D,a,m,O,l,f])}function rn(r,e,t,n,a,i,s){try{var o=r[i](s),l=o.value}catch(u){t(u);return}o.done?e(l):Promise.resolve(l).then(n,a)}function jc(r){return function(){var e=this,t=arguments;return new Promise(function(n,a){var i=r.apply(e,t);function s(l){rn(i,n,a,s,o,"next",l)}function o(l){rn(i,n,a,s,o,"throw",l)}s(void 0)})}}function Rc(r){for(var e=arguments.length,t=new Array(e>1?e-1:0),n=1;n<e;n++)t[n-1]=arguments[n];var a=c.useCallback(jc(function*(){var u;return(u=r==null?void 0:r.selectDistinct(r.findColumns(t)))!==null&&u!==void 0?u:null}),[r,...t]),{data:i,error:s,isError:o,isLoading:l}=Ge(a,[]);return c.useEffect(()=>()=>{i==null||i.close()},[i]),{distinctTable:i,error:s,isError:o,isLoading:l}}function $c(r,e){var t=ve(),n=c.useMemo(()=>Yn(t,r),[r,t]);return c.useMemo(()=>Qt(e,n),[e,n])}function Vc(r,e,t){var n=ve();return c.useMemo(()=>Zn(n,r,e,t),[r,t,n,e])}const Uc=Object.freeze(Object.defineProperty({__proto__:null,DEBOUNCE_MS:Xa,REFRESH_TOKEN_KEY:at,RefreshTokenBootstrap:qa,RefreshTokenContext:za,TableInput:fr,makeApiContextWrapper:Qu,readRefreshToken:Lt,storeRefreshToken:jt,useBroadcastChannel:hr,useBroadcastLoginListener:pt,useCheckIfExistsValue:Cc,useDebouncedViewportSearch:Dc,useDebouncedViewportSelectionFilter:Ac,useFilterConditionFactories:pr,useFilteredItemsWithDefaultValue:Nc,useGetItemPosition:_c,useInitializeViewportData:Ya,useNotNullOrEmptyFilter:kc,usePickerWithSelectedValues:Lc,useSearchableViewportData:Fc,useSelectDistinctTable:Rc,useSetPaddedViewportCallback:Za,useShowOnlyEmptyFilter:$c,useTable:Wa,useTableClose:Qa,useTableColumn:Ka,useTableListener:Fe,useTableSize:vr,useTableUtils:ve,useValueFilter:Vc,useViewportData:mr,useViewportFilter:gr},Symbol.toStringTag,{value:"Module"}));var Ja=c.createContext(!1);function Bc(r){var{fontClassNames:e=["fira-sans-regular","fira-sans-semibold","fira-mono"],children:t}=r,[n,a]=c.useState(!1);return c.useEffect(function(){document.fonts.ready.then(()=>{a(!0)})},[]),d.jsxs(d.Fragment,{children:[d.jsx(Ja.Provider,{value:n,children:t}),d.jsx("div",{id:"preload-fonts",style:{visibility:"hidden",position:"absolute",top:-1e4},children:e.map(i=>d.jsx("p",{className:i,children:"preload"},i))})]})}var vt=Object.freeze({AUTH_PLUGIN:"AuthPlugin",DASHBOARD_PLUGIN:"DashboardPlugin",TABLE_PLUGIN:"TablePlugin",THEME_PLUGIN:"ThemePlugin"});function Hc(r){return"DashboardPlugin"in r}function Rt(r){return"AuthPlugin"in r}function ei(r){return"TablePlugin"in r}function Gc(r){return Hc(r)||Rt(r)||ei(r)}function Wc(r){return"type"in r&&r.type===vt.TABLE_PLUGIN}function Kc(r){return"type"in r&&r.type===vt.AUTH_PLUGIN}function zc(r){return"type"in r&&r.type===vt.THEME_PLUGIN}function qc(r){if(r==null)return!1;var e=r;return e.Component!==void 0&&typeof e.isAvailable=="function"}var ti="io.deephaven.auth.AnonymousAuthenticationHandler",Xc="io.deephaven.authentication.psk.PskAuthenticationHandler";function nn(r,e,t){return e=Yc(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Yc(r){var e=Zc(r,"string");return typeof e=="symbol"?e:String(e)}function Zc(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class Qc extends Error{constructor(){super(...arguments),nn(this,"name","AuthenticationError"),nn(this,"isAuthenticationError",!0)}}const ri=Qc;function an(r,e,t,n,a,i,s){try{var o=r[i](s),l=o.value}catch(u){t(u);return}o.done?e(l):Promise.resolve(l).then(n,a)}function Jc(r){return function(){var e=this,t=arguments;return new Promise(function(n,a){var i=r.apply(e,t);function s(l){an(i,n,a,s,o,"next",l)}function o(l){an(i,n,a,s,o,"throw",l)}s(void 0)})}}var sn=k.module("AuthPluginBase");function br(r){var{children:e,getLoginOptions:t}=r,n=Re(),[a,i]=c.useState(),[s,o]=c.useState(!1);return c.useEffect(()=>{var l=!1;function u(){if(l)throw new Ys("Login canceled.")}function f(){return h.apply(this,arguments)}function h(){return h=Jc(function*(){try{var p=yield t();u(),sn.info("Logging in..."),yield n.login(p),u(),o(!0)}catch(g){if(!l){var v;sn.error("Unable to login:",g);var m=(v=je(g))!==null&&v!==void 0?v:"Unable to login. Verify credentials.";i(new ri(m)),o(!1)}}}),h.apply(this,arguments)}return f(),()=>{l=!0}},[n,t]),s?d.jsx(d.Fragment,{children:e}):d.jsx(Oe,{"data-testid":"auth-base-loading",isLoading:a==null,isLoaded:!1,errorMessage:je(a)})}var ed={canLogout:!1};function td(r){var{children:e}=r,t=ye(),n=c.useCallback(()=>({type:t.CoreClient.LOGIN_TYPE_ANONYMOUS}),[t]);return d.jsx(br,{getLoginOptions:n,children:d.jsx(ut.Provider,{value:ed,children:e})})}var rd={Component:td,isAvailable:r=>r.includes(ti)};const ni=rd;function on(r,e,t,n,a,i,s){try{var o=r[i](s),l=o.value}catch(u){t(u);return}o.done?e(l):Promise.resolve(l).then(n,a)}function nd(r){return function(){var e=this,t=arguments;return new Promise(function(n,a){var i=r.apply(e,t);function s(l){on(i,n,a,s,o,"next",l)}function o(l){on(i,n,a,s,o,"throw",l)}s(void 0)})}}var ad=k.module("AuthPluginParent"),id={canLogout:!1};function sd(r){return r!=null&&typeof r.type=="string"}function od(){return $t.apply(this,arguments)}function $t(){return $t=nd(function*(){ad.info("Logging in by delegating to parent window...");var r=yield dr(ka);if(!sd(r))throw new Error("Unexpected login options response: ".concat(r));return r}),$t.apply(this,arguments)}function ld(){var r;return(r=new URLSearchParams(window.location.search).get("authProvider"))!==null&&r!==void 0?r:""}function ud(r){var{children:e}=r;return d.jsx(br,{getLoginOptions:od,children:d.jsx(ut.Provider,{value:id,children:e})})}var cd={Component:ud,isAvailable:()=>cr()!=null&&ld()==="parent"};const ai=cd;function ii(r){var{children:e,errorMessage:t,isLoggingIn:n=!1,onSubmit:a}=r;return d.jsxs("form",{className:"login-form",onSubmit:i=>{i.preventDefault(),i.stopPropagation(),a==null||a(i)},children:[d.jsx("div",{className:"flex-spacer"}),d.jsxs("div",{className:"flex-wrapper",children:[d.jsx("fieldset",{disabled:n,className:"container-fluid",children:e}),d.jsx("div",{className:"form-group d-flex justify-content-end align-items-center mb-0",children:d.jsxs("button",{type:"submit",className:F("btn btn-primary",{"btn-spinner":n},{"btn-cancelable":n}),"data-testid":"btn-login",children:[n&&d.jsxs("span",{children:[d.jsx($n,{className:"loading-spinner-vertical-align"}),d.jsx("span",{className:"btn-normal-content",children:"Logging in"}),d.jsx("span",{className:"btn-hover-content",children:"Cancel"})]}),!n&&"Login"]})})]}),d.jsx("div",{className:"flex-spacer",children:t!=null&&d.jsx("p",{className:"error-message mb-0",role:"alert",children:"".concat(t)})})]})}function si(r){var{children:e,logoPath:t="./logo.png"}=r;return d.jsxs("div",{className:"login-container",children:[d.jsx(Na,{}),d.jsxs("div",{className:"login-box",children:[d.jsx("div",{className:"logo",children:d.jsx("img",{src:t,alt:"Deephaven Data Labs"})}),e,d.jsxs("p",{className:"footer",children:["© 2016-",new Date().getFullYear()," Deephaven Data Labs LLC. Patent Pending."]})]})]})}function ln(r,e,t,n,a,i,s){try{var o=r[i](s),l=o.value}catch(u){t(u);return}o.done?e(l):Promise.resolve(l).then(n,a)}function Tt(r){return function(){var e=this,t=arguments;return new Promise(function(n,a){var i=r.apply(e,t);function s(l){ln(i,n,a,s,o,"next",l)}function o(l){ln(i,n,a,s,o,"throw",l)}s(void 0)})}}var Vt="io.deephaven.authentication.psk.PskAuthenticationHandler",oi="psk",Ut="io.deephaven.web.client.auth.psk.token",Ie=k.module("AuthPluginPsk");function dd(){return new URLSearchParams(window.location.search).get(oi)}function fd(){Ie.debug2("clearWindowToken");var r=new URL(window.location.href);r.searchParams.delete(oi),window.history.replaceState(null,"",r.href)}function un(){var r;return(r=Le.get(Ut))!==null&&r!==void 0?r:null}function wt(r){Ie.debug2("Storing token in cookie",r),r!=null?Le.set(Ut,r,{secure:!0,sameSite:"strict"}):Le.remove(Ut)}function hd(r){var{children:e,logoPath:t}=r,n=Re(),a=c.useRef(null),i=c.useRef(null),[s,o]=c.useState(),[l,u]=c.useState(!1),[f,h]=c.useState(!1),[p,v]=c.useState(!1),[m,g]=c.useState(""),b=c.useCallback(function(){var T=Tt(function*(A){var O=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;Ie.info("Logging in..."),v(!0);var N=null;try{if(N=n.login({type:Vt,token:A}),i.current=N,yield N,Ie.info("Logged in successfully"),i.current!==N)return;wt(A),h(!0)}catch(D){if(i.current!==N)return;if(u(!0),O){var M;Ie.error("Unable to login",D);var S=(M=je(D))!==null&&M!==void 0?M:"Unable to login: Verify credentials.";o(new ri(S))}}v(!1)});return function(A){return T.apply(this,arguments)}}(),[n]),E=c.useCallback(()=>{i.current=null,v(!1)},[]),P=c.useCallback(Tt(function*(){Ie.debug("onLogin");var T=un();f||p||T==null||b(T,!1)}),[f,p,b]),y=c.useCallback(()=>{wt(null)},[]);pt(P,y),c.useEffect(()=>{var T=!1;function A(){return O.apply(this,arguments)}function O(){return O=Tt(function*(){var N,M=(N=dd())!==null&&N!==void 0?N:un();if(fd(),M==null){u(!0);return}v(!0);try{yield n.login({type:Vt,token:M}),T||(wt(M),h(!0),v(!1))}catch{T||(u(!0),v(!1))}}),O.apply(this,arguments)}return A(),()=>{T=!0}},[n]);var C=c.useCallback(()=>{p?E():b(m)},[E,p,b,m]);return c.useEffect(function(){var A;(A=a.current)===null||A===void 0||A.focus()},[a,l]),d.jsxs(d.Fragment,{children:[f&&e,l&&d.jsx(Je,{in:!f,timeout:Pe.transitionMs,classNames:"fade",mountOnEnter:!0,unmountOnExit:!0,children:d.jsx(si,{logoPath:t,children:d.jsx(ii,{errorMessage:je(s),isLoggingIn:p,onSubmit:C,children:d.jsxs("div",{className:"form-group",children:[d.jsx("label",{htmlFor:"auth-psk-token-input",children:"Token"}),d.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:a,value:m,onChange:T=>{o(void 0),g(T.target.value)}})]})})})}),d.jsx(Oe,{"data-testid":"auth-psk-loading",isLoaded:f||l,isLoading:!f&&!l})]})}var pd={Component:hd,isAvailable:r=>r.includes(Vt)};const li=pd;function cn(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(r,a).enumerable})),t.push.apply(t,n)}return t}function Pt(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?cn(Object(t),!0).forEach(function(n){vd(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):cn(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function vd(r,e,t){return e=md(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function md(r){var e=gd(r,"string");return typeof e=="symbol"?e:String(e)}function gd(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}var bd=k.module("UserUtils");function ui(r,e){return r.get("internal.webClient.appInit.".concat(e))}function ci(r){var e,t,n,a,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};function o(b){return ui(r,b)}function l(b,E){var P=o(b);return P==="true"?!0:P==="false"?!1:(P!==void 0&&bd.warn("Unexpected value for ".concat(b,": ").concat(P)),E)}var u=(e=o("name"))!==null&&e!==void 0?e:"",f=(t=o("operateAs"))!==null&&t!==void 0?t:u,h=(n=(a=o("groups"))===null||a===void 0?void 0:a.split(","))!==null&&n!==void 0?n:[],p=l("canCopy",!0),v=l("canDownloadCsv",!0),m=l("canUsePanels",!0),g=l("canLogout",!0);return Pt(Pt({name:u,operateAs:f,groups:h},i),{},{permissions:Pt({canUsePanels:m,canCopy:p,canDownloadCsv:v,canLogout:g},s)})}const yd=Object.freeze(Object.defineProperty({__proto__:null,AUTH_HANDLER_TYPE_ANONYMOUS:ti,AUTH_HANDLER_TYPE_PSK:Xc,AuthPluginAnonymous:ni,AuthPluginBase:br,AuthPluginParent:ai,AuthPluginPsk:li,Login:si,LoginForm:ii,UserContext:ta,UserOverrideContext:ra,UserPermissionsOverrideContext:ut,getAppInitValue:ui,getUserFromConfig:ci,isAuthPlugin:qc},Symbol.toStringTag,{value:"Module"}));tt.register([Fo,ko,Lo,jo,Ro,$o]);function Q(r,e,t){return e=Ed(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Ed(r){var e=Sd(r,"string");return typeof e=="symbol"?e:String(e)}function Sd(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class B{constructor(e){Q(this,"dh",void 0),Q(this,"listeners",void 0),Q(this,"formatter",void 0),Q(this,"rect",void 0),Q(this,"isDownsamplingDisabled",void 0),Q(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(B.EVENT_UPDATED,{detail:e}))}fireDisconnect(){this.fireEvent(new CustomEvent(B.EVENT_DISCONNECT))}fireReconnect(){this.fireEvent(new CustomEvent(B.EVENT_RECONNECT))}fireDownsampleStart(e){this.fireEvent(new CustomEvent(B.EVENT_DOWNSAMPLESTARTED,{detail:e}))}fireDownsampleFinish(e){this.fireEvent(new CustomEvent(B.EVENT_DOWNSAMPLEFINISHED,{detail:e}))}fireDownsampleFail(e){this.fireEvent(new CustomEvent(B.EVENT_DOWNSAMPLEFAILED,{detail:e}))}fireDownsampleNeeded(e){this.fireEvent(new CustomEvent(B.EVENT_DOWNSAMPLENEEDED,{detail:e}))}fireLoadFinished(){this.fireEvent(new CustomEvent(B.EVENT_LOADFINISHED))}}Q(B,"EVENT_UPDATED","ChartModel.EVENT_UPDATED");Q(B,"EVENT_DISCONNECT","ChartModel.EVENT_DISCONNECT");Q(B,"EVENT_RECONNECT","ChartModel.EVENT_RECONNECT");Q(B,"EVENT_DOWNSAMPLESTARTED","ChartModel.EVENT_DOWNSAMPLESTARTED");Q(B,"EVENT_DOWNSAMPLEFINISHED","ChartModel.EVENT_DOWNSAMPLEFINISHED");Q(B,"EVENT_DOWNSAMPLEFAILED","ChartModel.EVENT_DOWNSAMPLEFAILED");Q(B,"EVENT_DOWNSAMPLENEEDED","ChartModel.EVENT_DOWNSAMPLENEEDED");Q(B,"EVENT_LOADFINISHED","ChartModel.EVENT_LOADFINISHED");const ae=B,Td="#76d9e4 #9edc6f #fcd65b #aa9af4 #f37e3f #f95d84 #f0f0ee",wd="#403e41",Pd="#5b5a5c",Od="#c0bfbf",Cd="#4878ea",xd="rgba(91, 90, 92, 0.7)",q={"paper-bgcolor":"#2d2a2e","plot-bgcolor":"#322f33","title-color":"#f0f0ee",colorway:Td,gridcolor:wd,linecolor:Pd,zerolinecolor:Od,activecolor:Cd,rangebgcolor:xd,"area-color":"#76d9e4","trend-color":"#d5f0c1","line-color":"#9edc6f","error-band-line-color":"white","error-band-fill-color":"rgba(213, 240, 193, 0.1)","ohlc-increasing":"#9edc6f","ohlc-decreasing":"#f95d84"},H=Object.freeze({paper_bgcolor:q["paper-bgcolor"],plot_bgcolor:q["plot-bgcolor"],title_color:q["title-color"],colorway:q.colorway,gridcolor:q.gridcolor,linecolor:q.linecolor,zerolinecolor:q.zerolinecolor,activecolor:q.activecolor,rangebgcolor:q.rangebgcolor,area_color:q["area-color"],trend_color:q["trend-color"],line_color:q["line-color"],error_band_line_color:q["error-band-line-color"],error_band_fill_color:q["error-band-fill-color"],ohlc_increasing:q["ohlc-increasing"],ohlc_decreasing:q["ohlc-decreasing"]});function dn(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(r,a).enumerable})),t.push.apply(t,n)}return t}function Ce(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?dn(Object(t),!0).forEach(function(n){K(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):dn(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function K(r,e,t){return e=Dd(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Dd(r){var e=Ad(r,"string");return typeof e=="symbol"?e:String(e)}function Ad(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}var Ue=k.module("ChartUtils"),fn="io.deephaven.time.DateTime",Nd=36e5,Id=1e6;function _d(r){return r.asDate!==void 0}function Md(r){return r.asNumber!==void 0}function hn(r){return r.dhTimeZone!==void 0}function Fd(r){return r!=null&&r.range!=null&&(r.autorange===!1||r.autorange===void 0)}class w{static getPlotlyErrorBars(e,t,n){var a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:H,i=n.map((o,l)=>o-e[l]),s=t.map((o,l)=>e[l]-o);return{type:"data",symmetric:!1,array:i,arrayminus:s,color:a.error_band_line_color}}static convertNumberPrefix(e){return e.replace(/\u00A4\u00A4/g,"USD").replace(/\u00A4/g,"$")}static getPlotlyNumberFormat(e,t,n){if(!n)return null;var a=n.split(";"),i=a[0].match(/^([^#,0.]*)([#,]*)([0,]*)(\.?)(0*)(#*)(E?0*)(%?)(.*)/);Ae(i);var[,s,o,l,,u,f,h,p,v]=i,m=l.replace(",","").length,g=o.indexOf(",")>=0||l.indexOf(",")>=0,b=g?",":"",E=h!=null&&h!==""?"e":"f",P=p!==""?p:E,y=u.length+f.length,C="",T="0".concat(m).concat(b,".").concat(y).concat(C).concat(P),A=w.convertNumberPrefix(s),O=w.convertNumberPrefix(v);return{tickformat:T,tickprefix:A,ticksuffix:O,automargin:!0}}static addTickSpacing(e,t,n){var{gapBetweenMajorTicks:a}=t;if(a>0){var i=e||{},s=a;return n&&(s=a/Id),t.log&&(s=Math.log(s)),i.tickmode="linear",i.dtick=s,i}return e}static getSourceForAxis(e,t){for(var n=0;n<e.series.length;n+=1)for(var a=e.series[n],i=0;i<a.sources.length;i+=1){var s=a.sources[i];if(s.axis===t)return s}return null}static getSeriesVisibility(e,t){return t!=null&&t.hiddenSeries!=null&&t.hiddenSeries.includes(e)?"legendonly":!0}static getHiddenLabels(e){return e!=null&&e.hiddenSeries?[...e.hiddenSeries]:[]}static makeSeriesData(e,t,n,a){var i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:w.ORIENTATION.VERTICAL;return{type:e,mode:t,name:n,orientation:i,showlegend:a??void 0}}static getMarkerSymbol(e){switch(e){case"SQUARE":return"square";case"CIRCLE":return"circle";case"DIAMOND":return"diamond";case"UP_TRIANGLE":return"triangle-up";case"DOWN_TRIANGLE":return"triangle-down";case"RIGHT_TRIANGLE":return"triangle-right";case"LEFT_TRIANGLE":return"triangle-left";case"ELLIPSE":case"HORIZONTAL_RECTANGLE":case"VERTICAL_RECTANGLE":default:throw new Error("Unrecognized shape ".concat(e))}}static getAllAxes(e){return e.charts.reduce((t,n)=>[...t,...n.axes],[])}static getChartForSeries(e,t){for(var{charts:n}=e,a=0;a<n.length;a+=1)for(var i=n[a],s=0;s<i.series.length;s+=1)if(t===i.series[s])return i;return null}static getLayoutRanges(e){for(var t={},n=Object.keys(e).filter(o=>o.indexOf("axis")>=0),a=0;a<n.length;a+=1){var i=n[a],s=e[i];Fd(s)&&(t[i]=[...s.range])}return t}static getAxisLayoutProperty(e,t){var n=t>0?"".concat(t+1):"";return"".concat(e??"","axis").concat(n)}static periodToDecimal(e){var t=e.split(":");return Number(t[0])+Number(t[1])/60}static groupArray(e,t){return e.reduce((n,a)=>{var i,s=a[t],o=(i=n.get(s))!==null&&i!==void 0?i:[];return o.push(a),n.set(s,o),n},new Map)}static getColorwayFromTheme(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:H,t=[];return e.colorway&&(Array.isArray(e.colorway)?t=e.colorway:typeof e.colorway=="string"?t=e.colorway.split(" "):Ue.warn("Unable to handle colorway property: ".concat(e.colorway))),t}static titleFromSettings(e){var{series:t,xAxis:n,title:a="".concat((t??[]).join(", ")," by ").concat(n)}=e;return a}constructor(e){K(this,"dh",void 0),K(this,"daysOfWeek",void 0),this.dh=e,this.daysOfWeek=Object.freeze(e.calendar.DayOfWeek.values())}getAxisFormats(e,t){for(var n=this,a=new Map,i={tickformat:null,ticksuffix:null},s=w.getAllAxes(e),o=w.groupArray(s,"type"),{charts:l}=e,u=0;u<l.length;u+=1)for(var f=l[u],h=0;h<f.series.length;h+=1)for(var p=f.series[h],{sources:v}=p,m=v.filter(P=>P.axis),g=function(){var y=m[b],{axis:C}=y,{type:T}=C,A=o.get(T);Ae(A);var O=A.indexOf(C),N=n.getAxisPropertyName(T);if(N!=null){var M=w.getAxisLayoutProperty(N,O);if(a.has(M))Ue.debug("".concat(M," already added."));else{Ue.debug("Adding ".concat(M," to axisFormats."));var S=n.getPlotlyAxisFormat(y,t);if(S===null)a.set(M,i);else{a.set(M,S);var{businessCalendar:D}=C;if(D!=null){var I=[],{businessPeriods:J,businessDays:ne,holidays:j,timeZone:G}=D,U=t==null?void 0:t.getColumnTypeFormatter(fn),z;hn(U)&&(z=U.dhTimeZone);var le=z?(G.standardOffset-z.standardOffset)/60:0;j.length>0&&I.push(...n.createRangeBreakValuesFromHolidays(j,G,z)),J.forEach(_=>I.push({pattern:"hour",bounds:[w.periodToDecimal(_.close)+le,w.periodToDecimal(_.open)+le]})),ne.length<n.daysOfWeek.length&&n.createBoundsFromDays(ne).forEach(_=>I.push({pattern:"day of week",bounds:_})),S.rangebreaks=I}if(a.size===f.axes.length)return{v:a}}}}},b=0;b<m.length;b+=1){var E=g();if(typeof E=="object")return E.v}return a}getPlotlyChartType(e,t){var{dh:n}=this;switch(e){case n.plot.SeriesPlotStyle.SCATTER:return t?"scatter":"scattergl";case n.plot.SeriesPlotStyle.LINE:return"scatter";case n.plot.SeriesPlotStyle.BAR:case n.plot.SeriesPlotStyle.STACKED_BAR:return"bar";case n.plot.SeriesPlotStyle.PIE:return"pie";case n.plot.SeriesPlotStyle.TREEMAP:return"treemap";case n.plot.SeriesPlotStyle.HISTOGRAM:return"histogram";case n.plot.SeriesPlotStyle.OHLC:return"ohlc";default:return}}getPlotlyChartMode(e,t,n){var{dh:a}=this,i=new Set;switch(e){case a.plot.SeriesPlotStyle.SCATTER:(t??!1)&&i.add(w.MODE_LINES),(n??!0)&&i.add(w.MODE_MARKERS);break;case a.plot.SeriesPlotStyle.LINE:(t??!0)&&i.add(w.MODE_LINES),(n??!1)&&i.add(w.MODE_MARKERS);break}return i.size>0?[...i].join("+"):void 0}getPlotlyProperty(e,t){var{dh:n}=this;switch(e){case n.plot.SeriesPlotStyle.PIE:switch(t){case n.plot.SourceType.X:return"labels";case n.plot.SourceType.Y:return"values"}break;case n.plot.SeriesPlotStyle.OHLC:switch(t){case n.plot.SourceType.TIME:return"x"}break;case n.plot.SeriesPlotStyle.TREEMAP:switch(t){case n.plot.SourceType.X:return"ids";case n.plot.SourceType.Y:return"values";case n.plot.SourceType.LABEL:return"labels";case n.plot.SourceType.PARENT:return"parents";case n.plot.SourceType.COLOR:return"marker.colors"}break}switch(t){case n.plot.SourceType.X:return"x";case n.plot.SourceType.Y:return"y";case n.plot.SourceType.Z:return"z";case n.plot.SourceType.X_LOW:return"xLow";case n.plot.SourceType.X_HIGH:return"xHigh";case n.plot.SourceType.Y_LOW:return"yLow";case n.plot.SourceType.Y_HIGH:return"yHigh";case n.plot.SourceType.TIME:return"time";case n.plot.SourceType.OPEN:return"open";case n.plot.SourceType.HIGH:return"high";case n.plot.SourceType.LOW:return"low";case n.plot.SourceType.CLOSE:return"close";case n.plot.SourceType.SHAPE:return"shape";case n.plot.SourceType.SIZE:return"size";case n.plot.SourceType.LABEL:return"label";case n.plot.SourceType.COLOR:return"color";case n.plot.SourceType.PARENT:return"parent";case n.plot.SourceType.HOVER_TEXT:return"hovertext";case n.plot.SourceType.TEXT:return"text";default:throw new Error("Unrecognized source type: ".concat(t))}}getPlotlySeriesOrientation(e){var t,n,{dh:a}=this,{sources:i}=e;return i.length===2&&((t=i[0])===null||t===void 0||(n=t.axis)===null||n===void 0?void 0:n.type)===a.plot.AxisType.Y?w.ORIENTATION.HORIZONTAL:w.ORIENTATION.VERTICAL}makeSeriesDataFromSeries(e,t,n){var a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null,i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:H,{name:s,isLinesVisible:o,isShapesVisible:l,plotStyle:u,lineColor:f,shapeColor:h,sources:p,shape:v,shapeSize:m}=e,g=p.some(C=>{var T;return(T=C.axis)===null||T===void 0?void 0:T.businessCalendar}),b=this.getChartType(u,g),E=this.getPlotlyChartMode(u,o??void 0,l??void 0),P=this.getPlotlySeriesOrientation(e),y=w.makeSeriesData(b,E,s,a,P);return this.addSourcesToSeriesData(y,u,p,t),this.addStylingToSeriesData(y,u,i,f,h,v,m,n),y}addSourcesToSeriesData(e,t,n,a){for(var i=e,s=0;s<n.length;s+=1){var o=n[s],{axis:l,type:u}=o,f=this.getPlotlyProperty(t,u);xn(i,f,[]);var h=l!=null?this.getAxisPropertyName(l.type):null;if(h!=null){var p=a.get(l.type);if(p){var v=p.indexOf(l),m=v>0?"".concat(v+1):"";i["".concat(h,"axis")]="".concat(h).concat(m)}}}}addStylingToSeriesData(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:H,a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null,i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:null,s=arguments.length>5&&arguments[5]!==void 0?arguments[5]:null,o=arguments.length>6&&arguments[6]!==void 0?arguments[6]:null,l=arguments.length>7&&arguments[7]!==void 0?arguments[7]:null,{dh:u}=this,f=e;if(f.marker={line:{}},f.line={width:1},t===u.plot.SeriesPlotStyle.AREA?f.fill="tozeroy":t===u.plot.SeriesPlotStyle.STACKED_AREA?f.stackgroup="stack":t===u.plot.SeriesPlotStyle.STEP?f.line.shape="hv":t===u.plot.SeriesPlotStyle.HISTOGRAM?(f.width=[],f.marker.line!==void 0&&Object.assign(f.marker.line,{color:n.paper_bgcolor,width:1})):t===u.plot.SeriesPlotStyle.OHLC?(f.increasing={line:{color:n.ohlc_increasing}},f.decreasing={line:{color:n.ohlc_decreasing}}):t===u.plot.SeriesPlotStyle.PIE?(f.textinfo="label+percent",f.outsidetextfont={color:n.title_color}):t===u.plot.SeriesPlotStyle.TREEMAP&&(f.hoverinfo="text",f.textinfo="label+text",f.tiling={packing:"squarify",pad:0},f.textposition="middle center",f.outsidetextfont={color:n.title_color}),a!=null&&(t===u.plot.SeriesPlotStyle.BAR?f.marker.color=a:f.line.color=a),i!=null&&(f.marker.color=i),s!=null&&s.length>0)try{f.marker.symbol=w.getMarkerSymbol(s)}catch(h){Ue.warn("Unable to handle shape",s,":",h)}o!=null&&(f.marker.size=o*w.DEFAULT_MARKER_SIZE),l!=null&&t!==u.plot.SeriesPlotStyle.PIE&&(f.visible=l)}getChartType(e,t){var{dh:n}=this;switch(e){case n.plot.SeriesPlotStyle.HISTOGRAM:return"bar";default:return this.getPlotlyChartType(e,t)}}getAxisPropertyName(e){var{dh:t}=this;switch(e){case t.plot.AxisType.X:return"x";case t.plot.AxisType.Y:return"y";default:return null}}getAxisSide(e){var{dh:t}=this;switch(e){case t.plot.AxisPosition.BOTTOM:return"bottom";case t.plot.AxisPosition.TOP:return"top";case t.plot.AxisPosition.LEFT:return"left";case t.plot.AxisPosition.RIGHT:return"right";default:return}}updateFigureAxes(e,t,n){for(var a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0,s=arguments.length>5&&arguments[5]!==void 0?arguments[5]:H,o=e,l=w.getAllAxes(t),u=0;u<t.charts.length;u+=1){var f=t.charts[u],h=n==null?void 0:n(f),p=this.getChartBounds(t,f,a,i);this.updateLayoutAxes(o,f.axes,l,a,i,p,h,s)}this.removeStaleAxes(o,l)}getChartBounds(e,t,n,a){var i,{dh:s}=this,{cols:o,rows:l}=e,{column:u,colspan:f,row:h,rowspan:p}=t,v=u+f,m=h+p,g=1/o,b=1/l,E=w.AXIS_SIZE_PX/n,P=w.AXIS_SIZE_PX/a,y={bottom:(l-m)*b+(m<l?P/2:0),top:(l-h)*b-(h>0?P/2:0),left:u*g+(u>0?E/2:0),right:v*g-(v<o?E/2:0)},C=w.groupArray(t.axes,"position"),T=(i=C.get(s.plot.AxisPosition.RIGHT))!==null&&i!==void 0?i:[];return T.length>0&&(n>0?y.right-=(y.right-y.left)*Math.max(0,Math.min(w.LEGEND_WIDTH_PX/n,w.MAX_LEGEND_SIZE)):y.right-=(y.right-y.left)*w.DEFAULT_AXIS_SIZE),y}getPlotlyDateFormat(e,t,n){var{dh:a}=this,i=n==null?void 0:n.replace("%","%%").replace(/S{9}/g,"%9f").replace(/S{8}/g,"%8f").replace(/S{7}/g,"%7f").replace(/S{6}/g,"%6f").replace(/S{5}/g,"%5f").replace(/S{4}/g,"%4f").replace(/S{3}/g,"%3f").replace(/S{2}/g,"%2f").replace(/S{1}/g,"%1f").replace(/y{4}/g,"%Y").replace(/y{2}/g,"%y").replace(/M{4}/g,"%B").replace(/M{3}/g,"%b").replace(/M{2}/g,"%m").replace(/M{1}/g,"%-m").replace(/E{4,}/g,"%A").replace(/E{1,}/g,"%a").replace(/d{2}/g,"%d").replace(/([^%]|^)d{1}/g,"$1%-d").replace(/H{2}/g,"%H").replace(/h{2}/g,"%I").replace(/h{1}/g,"%-I").replace(/m{2}/g,"%M").replace(/s{2}/g,"%S").replace("'T'","T").replace(" z",""),s,o=e==null?void 0:e.getColumnTypeFormatter(t);return o!=null&&hn(o)&&o.dhTimeZone!=null&&o.showTimeZone&&(s=a.i18n.DateTimeFormat.format(" z",new Date,o.dhTimeZone)),{tickformat:i,ticksuffix:s,automargin:!0}}getPlotlyAxisFormat(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null,{dh:n}=this,{axis:a,columnType:i}=e,{formatPattern:s}=a,o=null;return He.isDateType(i)?(o=this.getPlotlyDateFormat(t,i,s),o=w.addTickSpacing(o,a,!0)):He.isNumberType(i)&&(o=w.getPlotlyNumberFormat(t,i,s),o=w.addTickSpacing(o,a,!1)),a.formatType===n.plot.AxisFormatType.CATEGORY&&(o?o.type="category":o={type:"category",tickformat:void 0,ticksuffix:void 0}),o}updateLayoutAxes(e,t,n){for(var a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0,s=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{left:0,top:0,right:1,bottom:1},o=arguments.length>6?arguments[6]:void 0,l=arguments.length>7&&arguments[7]!==void 0?arguments[7]:H,{dh:u}=this,f=a>0?Math.max(w.MIN_AXIS_SIZE,Math.min(w.AXIS_SIZE_PX/i,w.MAX_AXIS_SIZE)):w.DEFAULT_AXIS_SIZE,h=i>0?Math.max(w.MIN_AXIS_SIZE,Math.min(w.AXIS_SIZE_PX/a,w.MAX_AXIS_SIZE)):w.DEFAULT_AXIS_SIZE,p=e,v=w.groupArray(t,"position"),m=w.groupArray(t,"type"),g=[...m.keys()],b=w.groupArray(n,"type"),E=0;E<g.length;E+=1){var P=g[E],y=this.getAxisPropertyName(P);if(y!=null){var C=m.get(P),T=b.get(P),A=P===u.plot.AxisType.Y,O=A?i:a;Ae(C),Ae(T);for(var N=0;N<C.length;N+=1){var M=C[N],S=T.indexOf(M),D=w.getAxisLayoutProperty(y,S);p[D]==null&&(p[D]=this.makeLayoutAxis(P,l));var I=p[D];if(I!=null){this.updateLayoutAxis(I,M,N,v,f,h,s);var{range:J,autorange:ne}=I;if(o!=null&&J!==void 0&&(ne===void 0||ne===!1)){var j=o(M),[G,U]=j(J);Ue.debug("Setting downsample range",O,G,U),M.range(O,G,U)}else M.range(O)}}}}}removeStaleAxes(e,t){for(var n=e,a=w.groupArray(t,"type"),i=[...a.keys()],s=0;s<i.length;s+=1){var o=i[s],l=a.get(o);Ae(l);var u=l.length,f=this.getAxisPropertyName(o);if(f!=null)for(var h=w.getAxisLayoutProperty(f,u);n[h]!=null;)delete n[h],u+=1,h=w.getAxisLayoutProperty(f,u)}}updateLayoutAxis(e,t,n,a,i,s,o){var l,{dh:u}=this,f=t.type===u.plot.AxisType.Y,h=f?s:i,p=e,v=(l=t.label)!==null&&l!==void 0?l:"";if(p.title!==void 0&&typeof p.title!="string"?p.title.text=v:p.title={text:v},t.log&&(p.type="log"),p.side=this.getAxisSide(t.position),n>0){var m,g;p.overlaying=(m=this.getAxisPropertyName(t.type))!==null&&m!==void 0?m:void 0;var b=(g=a.get(t.position))!==null&&g!==void 0?g:[],E=b.indexOf(t);E>0&&(p.anchor="free",t.position===u.plot.AxisPosition.RIGHT?p.position=o.right+(E-b.length+1)*h:t.position===u.plot.AxisPosition.TOP?p.position=o.top+(E-b.length+1)*h:t.position===u.plot.AxisPosition.BOTTOM?p.position=o.bottom+(b.length-E+1)*h:t.position===u.plot.AxisPosition.LEFT&&(p.position=o.left+(b.length-E+1)*h))}else if(t.type===u.plot.AxisType.X){var P=a.get(u.plot.AxisPosition.LEFT)||[],y=a.get(u.plot.AxisPosition.RIGHT)||[],C=Math.max(o.left,o.left+(P.length-1)*s),T=Math.min(o.right-(y.length-1)*s,o.right);p.domain=[C,T]}else if(t.type===u.plot.AxisType.Y){var A=a.get(u.plot.AxisPosition.BOTTOM)||[],O=a.get(u.plot.AxisPosition.TOP)||[],N=Math.max(o.bottom,o.bottom+(A.length-1)*i),M=Math.min(o.top-(O.length-1)*i,o.top);p.domain=[N,M]}}createBoundsFromDays(e){var t=e.map(s=>this.daysOfWeek.indexOf(s)),n=this.daysOfWeek.filter(s=>!e.includes(s)).map(s=>this.daysOfWeek.indexOf(s)),a=new Set;n.forEach(s=>{for(var o=s+1;o<s+this.daysOfWeek.length;o+=1){var l=o%this.daysOfWeek.length;if(t.includes(l)){a.add(l);break}}});var i=[];return a.forEach(s=>{for(var o=s-1;o>s-this.daysOfWeek.length;o-=1){var l=o<0?o+this.daysOfWeek.length:o;if(t.includes(l)){var u=(l+1)%7;i.push([u,s]);break}}}),i}createRangeBreakValuesFromHolidays(e,t,n){var a=[],i=[];return e.forEach(s=>{s.businessPeriods.length>0?i.push(...this.createPartialHoliday(s,t,n)):a.push(this.createFullHoliday(s,t,n))}),[{values:a},...i]}createFullHoliday(e,t,n){return this.adjustDateForTimeZone("".concat(e.date.toString()," 00:00:00.000000"),t,n)}createPartialHoliday(e,t,n){var a=e.date.toString(),i=["00:00"];e.businessPeriods.forEach(p=>{i.push(p.open),i.push(p.close)}),i.push("24:00");for(var s=[],o=0;o<i.length;o+=2){var l=i[o],u=i[o+1];if(l!==u){var f=[this.adjustDateForTimeZone("".concat(a," ").concat(l,":00.000000"),t,n)],h=Nd*(w.periodToDecimal(u)-w.periodToDecimal(l));s.push({values:f,dvalue:h})}}return s}adjustDateForTimeZone(e,t,n){return n&&n.standardOffset!==t.standardOffset?this.unwrapValue(this.wrapValue(e,fn,t),n):e}makeFigureSettings(e,t){var{dh:n}=this,{series:a,xAxis:i,type:s}=e,o=w.titleFromSettings(e),l={formatType:"".concat(n.plot.AxisFormatType.NUMBER),type:"".concat(n.plot.AxisType.X),position:"".concat(n.plot.AxisPosition.BOTTOM)},u={formatType:"".concat(n.plot.AxisFormatType.NUMBER),type:"".concat(n.plot.AxisType.Y),position:"".concat(n.plot.AxisPosition.LEFT)};return{charts:[{chartType:"".concat(n.plot.ChartType.XY),axes:[l,u],series:(a??[]).map(f=>({plotStyle:"".concat(s),name:f,dataSources:[{type:"".concat(n.plot.SourceType.X),columnName:i??"",axis:l,table:t},{type:"".concat(n.plot.SourceType.Y),columnName:f,axis:u,table:t}]}))}],title:o}}unwrapValue(e,t){var{dh:n}=this;if(e!=null){if(_d(e))return n.i18n.DateTimeFormat.format(w.DATE_FORMAT,e,t);if(Md(e))return e.asNumber()}return e}wrapValue(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,{dh:a}=this;if(He.isDateType(t)&&typeof e=="string"){var i=e,s=w.DATE_FORMAT.substr(0,e.length),o=a.i18n.DateTimeFormat.parse(s,i);if(!n)return o;var l="".concat(s," Z"),u=a.i18n.DateTimeFormat.format("Z",o,n),f=a.i18n.DateTimeFormat.parse(l,"".concat(i," ").concat(u)),h=a.i18n.DateTimeFormat.format("Z",f,n);return a.i18n.DateTimeFormat.parse(l,"".concat(i," ").concat(h))}return e}makeLayoutAxis(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:H,{dh:n}=this,a={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===n.plot.AxisType.X?Object.assign(a,{showgrid:!0}):e===n.plot.AxisType.Y&&Object.assign(a,{zerolinecolor:t.zerolinecolor,zerolinewidth:2}),a}makeDefaultLayout(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:H,{dh:t}=this,n=Ce(Ce({},e),{},{autosize:!0,colorway:w.getColorwayFromTheme(e),font:{family:"'Fira Sans', sans-serif",color:e.title_color},title:{font:{color:e.title_color},yanchor:"top",pad:Ce({},w.DEFAULT_TITLE_PADDING),y:1},legend:{font:{color:e.title_color}},margin:Ce({},w.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 n.datarevision=0,n}hydrateSettings(e){var{dh:t}=this;return Ce(Ce({},e),{},{type:e.type!=null?t.plot.SeriesPlotStyle[e.type]:void 0})}}K(w,"DEFAULT_AXIS_SIZE",.15);K(w,"MIN_AXIS_SIZE",.025);K(w,"MAX_AXIS_SIZE",.2);K(w,"AXIS_SIZE_PX",75);K(w,"LEGEND_WIDTH_PX",50);K(w,"MAX_LEGEND_SIZE",.25);K(w,"ORIENTATION",Object.freeze({HORIZONTAL:"h",VERTICAL:"v"}));K(w,"DATE_FORMAT","yyyy-MM-dd HH:mm:ss.SSSSSS");K(w,"DEFAULT_MARGIN",Object.freeze({l:60,r:50,t:30,b:60,pad:0}));K(w,"DEFAULT_TITLE_PADDING",Object.freeze({t:8}));K(w,"SUBTITLE_LINE_HEIGHT",25);K(w,"DEFAULT_MARKER_SIZE",6);K(w,"MODE_MARKERS","markers");K(w,"MODE_LINES","lines");const W=w;function pn(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(r,a).enumerable})),t.push.apply(t,n)}return t}function vn(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?pn(Object(t),!0).forEach(function(n){Y(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):pn(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function Y(r,e,t){return e=kd(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function kd(r){var e=Ld(r,"string");return typeof e=="symbol"?e:String(e)}function Ld(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}var ge=k.module("Chart");class Se extends c.Component{static convertIcon(e){var[t,,,,n]=e.icon,a="".concat(n);return{width:t,path:a,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),Y(this,"currentSeries",void 0),Y(this,"PlotComponent",void 0),Y(this,"plot",void 0),Y(this,"plotWrapper",void 0),Y(this,"columnFormats",void 0),Y(this,"dateTimeFormatterOptions",void 0),Y(this,"decimalFormatOptions",void 0),Y(this,"integerFormatOptions",void 0),Y(this,"rect",void 0),Y(this,"ranges",void 0),Y(this,"isSubscribed",void 0),Y(this,"isLoadedFired",void 0),Y(this,"getCachedConfig",Ct((t,n,a,i,s)=>{var o=[],l=!!t;if(l&&o.push({name:"Downsampling failed: ".concat(t),title:"Downsampling failed",click:()=>{},icon:Se.convertIcon(Yi),attr:"fill-warning"}),n||a||i||l){var u=Se.downsampleButtonTitle(a,i),f=Se.downsampleButtonAttr(a,i),h=a?Zi:Qi;o.push({name:u,title:"Downsampling status",icon:Se.convertIcon(h),click:this.handleDownsampleClick,attr:f})}var p=s.some(b=>{var{type:E}=b;return E!=null&&!E.includes("3d")}),v=s.some(b=>{var{type:E}=b;return E!=null&&E.includes("3d")}),m=["zoomIn2d","zoomOut2d","autoScale2d","resetScale2d"],g=["orbitRotation","tableRotation","resetCameraDefault3d"];return{displaylogo:!1,displayModeBar:a||l?!0:"hover",modeBarButtons:[o,["toImage"],["zoom2d","pan2d"],[...p?m:[],...v?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.handleRestyle=this.handleRestyle.bind(this),this.PlotComponent=Ze(e.Plotly),this.plot=V.createRef(),this.plotWrapper=V.createRef(),this.columnFormats=[],this.dateTimeFormatterOptions={},this.decimalFormatOptions={},this.integerFormatOptions={},this.isSubscribed=!1,this.isLoadedFired=!1,this.currentSeries=0,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)}componentDidUpdate(e){var{isActive:t,model:n,settings:a}=this.props;this.updateFormatterSettings(a),n!==e.model&&(this.unsubscribe(e.model),this.subscribe(n)),t!==e.isActive&&(t?this.subscribe(n):this.unsubscribe(n))}componentWillUnmount(){var{model:e}=this.props;this.unsubscribe(e)}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:vn(vn({},t),e.getLayout())})}subscribe(e){if(!this.isSubscribed){if(!this.rect||this.rect.width===0||this.rect.height===0){ge.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:n}=e;switch(ge.debug2("Received data update",t,n),t){case ae.EVENT_UPDATED:{this.currentSeries+=1,this.setState(h=>{var{layout:p,revision:v}=h;return typeof p.datarevision=="number"&&(p.datarevision+=1),{data:n,layout:p,revision:v+1}});var{onUpdate:a}=this.props;a({isLoading:!this.isLoadedFired});break}case ae.EVENT_LOADFINISHED:{var{onUpdate:i}=this.props;this.isLoadedFired=!0,i({isLoading:!1});break}case ae.EVENT_DISCONNECT:{var{onDisconnect:s}=this.props;s();break}case ae.EVENT_RECONNECT:{var{onReconnect:o}=this.props;o();break}case ae.EVENT_DOWNSAMPLESTARTED:{this.setState({isDownsampleFinished:!1,isDownsampleInProgress:!0,downsamplingError:null});break}case ae.EVENT_DOWNSAMPLEFINISHED:{this.setState({isDownsampleFinished:!0,isDownsampleInProgress:!1,downsamplingError:null});break}case ae.EVENT_DOWNSAMPLENEEDED:case ae.EVENT_DOWNSAMPLEFAILED:{var l,u=(l=n.message)!==null&&l!==void 0?l:n;this.setState({isDownsampleFinished:!1,isDownsampleInProgress:!1,isDownsamplingDisabled:!1,downsamplingError:u});var{onError:f}=this.props;f(new Error(u));break}default:ge.debug("Unknown event type",t,e)}}handlePlotUpdate(e){var{layout:t}=e,n=W.getLayoutRanges(t),a=!Ve(n,this.ranges);a&&(this.ranges=n,this.updateModelDimensions(!0))}handleRelayout(e){if(ge.debug("handleRelayout",e),e.hiddenlabels!=null){var{onSettingsChanged:t}=this.props,n=[...e.hiddenlabels];t({hiddenSeries:n})}this.updateModelDimensions()}handleRestyle(e){var[t,n]=e;if(ge.debug("handleRestyle",t,n),Object.keys(t).includes("visible")){var{data:a}=this.state,{onSettingsChanged:i}=this.props;if(a!=null){var s=a.reduce((o,l)=>{var{name:u,visible:f}=l;return u!=null&&f==="legendonly"?[...o,u]:o},[]);i({hiddenSeries:s})}}}updateModelDimensions(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,t=this.getPlotRect();if(!t){ge.warn("Unable to get plotting rect");return}var n=!this.rect||this.rect.width!==t.width||this.rect.height!==t.height;if(n||e){this.rect=t;var{isActive:a,model:i}=this.props;i.setDimensions(t),a&&this.subscribe(i)}}initFormatter(){var{settings:e}=this.props;this.updateFormatterSettings(e)}updateFormatterSettings(e){var t=_e.getColumnFormats(e),n=_e.getDateTimeFormatterOptions(e),{decimalFormatOptions:a={},integerFormatOptions:i={}}=e;(!Ve(this.columnFormats,t)||!Ve(this.dateTimeFormatterOptions,n)||!Ve(this.decimalFormatOptions,a)||!Ve(this.integerFormatOptions,i))&&(this.columnFormats=_e.getColumnFormats(e),this.dateTimeFormatterOptions=n,this.decimalFormatOptions=a,this.integerFormatOptions=i,this.updateFormatter())}updateFormatter(){var{model:e}=this.props,t=new lt(e.dh,this.columnFormats,this.dateTimeFormatterOptions,this.decimalFormatOptions,this.integerFormatOptions);e.setFormatter(t)}updateDimensions(){var e=this.getPlotRect(),{Plotly:t}=this.props;this.plot.current!=null&&e!=null&&e.width>0&&e.height>0&&t.relayout(this.plot.current.el,{autosize:!0}).catch(n=>{ge.debug("Unable to resize, promise rejected",n)})}render(){var{PlotComponent:e}=this,{data:t,downsamplingError:n,isDownsampleFinished:a,isDownsampleInProgress:i,isDownsamplingDisabled:s,layout:o,revision:l}=this.state,u=this.getCachedConfig(n,a,i,s,t??[]),f=t!=null;return d.jsx("div",{className:"h-100 w-100 chart-wrapper",ref:this.plotWrapper,children:f&&d.jsx(e,{ref:this.plot,data:t,layout:o,revision:l,config:u,onAfterPlot:this.handleAfterPlot,onError:ge.error,onRelayout:this.handleRelayout,onUpdate:this.handlePlotUpdate,onRestyle:this.handleRestyle,useResizeHandler:!0,style:{height:"100%",width:"100%"}})})}}Y(Se,"defaultProps",{isActive:!0,settings:{timeZone:"America/New_York",defaultDateTimeFormat:zn.FULL_DATE_FORMAT,showTimeZone:!1,showTSeparator:!0,formatter:[]},Plotly:tt,onDisconnect:()=>{},onReconnect:()=>{},onUpdate:()=>{},onError:()=>{},onSettingsChanged:()=>{}});const jd=Se;function mn(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(r,a).enumerable})),t.push.apply(t,n)}return t}function gn(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?mn(Object(t),!0).forEach(function(n){$(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):mn(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function $(r,e,t){return e=Rd(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Rd(r){var e=$d(r,"string");return typeof e=="symbol"?e:String(e)}function $d(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}var X=k.module("FigureChartModel");class mt extends ae{constructor(e,t){var n,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:H;super(e),n=this,$(this,"chartUtils",void 0),$(this,"dh",void 0),$(this,"figure",void 0),$(this,"settings",void 0),$(this,"theme",void 0),$(this,"data",void 0),$(this,"layout",void 0),$(this,"seriesDataMap",void 0),$(this,"pendingSeries",void 0),$(this,"oneClicks",void 0),$(this,"filterColumnMap",void 0),$(this,"lastFilter",void 0),$(this,"isConnected",void 0),$(this,"seriesToProcess",void 0),$(this,"addPendingSeries",we(()=>{for(var o=W.getAllAxes(this.figure),{pendingSeries:l}=this,u=function(){var p,v=l[f],m=n.figure.charts.find(g=>g.series.includes(v));n.addSeries(v,o,(p=m==null?void 0:m.showLegend)!==null&&p!==void 0?p:null),v.subscribe()},f=0;f<l.length;f+=1)u();this.pendingSeries=[]},mt.ADD_SERIES_DEBOUNCE)),$(this,"getTimeZone",De((o,l)=>{if(l!=null){var u=l.getColumnTypeFormatter(o);if(u!=null)return u.dhTimeZone}})),$(this,"getValueTranslator",De((o,l)=>{var u=this.getTimeZone(o,l);return f=>this.chartUtils.unwrapValue(f,u)})),$(this,"getValueParser",De((o,l)=>{var u=this.getTimeZone(o,l);return f=>this.chartUtils.wrapValue(f,o,u)})),$(this,"getRangeParser",De((o,l)=>u=>{var[f,h]=u,p=this.getValueParser(o,l);return f=p(f),h=p(h),[f,h]})),$(this,"getAxisRangeParser",De((o,l)=>u=>{var f=W.getSourceForAxis(o,u);return f!=null?this.getRangeParser(f.columnType,l):h=>h})),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 W(e),this.figure=t,this.settings=a,this.theme=i,this.data=[];var s={data:{},layout:this.chartUtils.makeDefaultLayout(i)};this.layout={grid:{rows:t.rows,columns:t.cols,pattern:"independent"},template:s},this.seriesDataMap=new Map,this.pendingSeries=[],this.oneClicks=[],this.filterColumnMap=new Map,this.lastFilter=new Map,this.isConnected=!0,this.seriesToProcess=new Set,this.setTitle(this.getDefaultTitle()),this.initAllSeries(),this.updateAxisPositions(),this.startListeningFigure()}close(){this.figure.close(),this.addPendingSeries.cancel(),this.stopListeningFigure()}getDefaultTitle(){if(this.figure.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=W.getAllAxes(this.figure),n=[],a=0;a<e.length;a+=1)for(var i=e[a],s=0;s<i.series.length;s+=1){var o=i.series[s];n.push(o.name),this.addSeries(o,t,i.showLegend)}for(var l=[...this.seriesDataMap.keys()],u=l.filter(p=>n.indexOf(p)<0),f=0;f<u.length;f+=1){var h=u[f];this.seriesDataMap.delete(h)}this.seriesToProcess=new Set([...this.seriesDataMap.keys()])}addSeries(e,t,n){var{dh:a}=this,i=W.groupArray(t,"type"),s=this.chartUtils.makeSeriesDataFromSeries(e,i,W.getSeriesVisibility(e.name,this.settings),n,this.theme);if(this.seriesDataMap.set(e.name,s),this.data=[...this.seriesDataMap.values()],e.plotStyle===a.plot.SeriesPlotStyle.STACKED_BAR?this.layout.barmode="stack":e.plotStyle===a.plot.SeriesPlotStyle.PIE&&(this.layout.hiddenlabels=W.getHiddenLabels(this.settings)),this.layout.showlegend=this.data.length>1||e.plotStyle===a.plot.SeriesPlotStyle.PIE?n??void 0:!1,e.oneClick!=null){for(var{oneClick:o}=e,{columns:l}=o,u=0;u<l.length;u+=1)this.filterColumnMap.set(l[u].name,l[u]);this.oneClicks.push(o)}this.updateLayoutFormats()}subscribe(e){super.subscribe(e),this.listeners.length===1&&(this.initAllSeries(),this.subscribeFigure())}unsubscribe(e){super.unsubscribe(e),this.listeners.length===0&&this.unsubscribeFigure()}subscribeFigure(){if(!this.isConnected){X.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){X.debug("Downsample started",e),this.fireDownsampleStart(e.detail)}handleDownsampleFinish(e){X.debug("Downsample finished",e),this.fireDownsampleFinish(e.detail)}handleDownsampleFail(e){X.error("Downsample failed",e),this.fireDownsampleFail(e.detail)}handleDownsampleNeeded(e){X.info("Downsample needed",e),this.fireDownsampleNeeded(e.detail)}handleFigureUpdated(e){var{detail:t}=e,{series:n}=t;X.debug2("handleFigureUpdated",n);for(var a=0;a<n.length;a+=1){var i=n[a];X.debug2("handleFigureUpdated updating series",i.name);for(var{sources:s}=i,o=0;o<s.length;o+=1){var l=s[o],{columnType:u,type:f}=l,h=this.getValueTranslator(u,this.formatter),p=t.getArray(i,f,h);this.setDataArrayForSeries(i,f,p)}this.seriesToProcess.delete(i.name),this.seriesToProcess.size===0&&this.fireLoadFinished(),this.cleanSeries(i)}var{data:v}=this;this.fireUpdate(v)}handleRequestFailed(e){X.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){X.debug("Figure disconnected",e),this.isConnected=!1,this.listeners.length>0&&this.unsubscribeFigure(),this.fireDisconnect()}handleFigureReconnected(e){X.debug("Figure reconnected",e),this.isConnected=!0,this.initAllSeries(),this.fireReconnect(),this.listeners.length>0&&this.subscribeFigure()}handleFigureSeriesAdded(e){var{detail:t}=e;X.debug("handleFigureSeriesAdded",t),this.pendingSeries.push(t),this.addPendingSeries()}setDimensions(e){super.setDimensions(e),this.updateAxisPositions()}setTitle(e){var t,n;super.setTitle(e);var a=(t=(n=(e??"").match(/<br>/g))===null||n===void 0?void 0:n.length)!==null&&t!==void 0?t:0,i=W.DEFAULT_MARGIN.t+a*W.SUBTITLE_LINE_HEIGHT;this.layout.margin?this.layout.margin.t=i:this.layout.margin={t:i},typeof this.layout.title=="string"?this.layout.title=e:(this.layout.title=gn({},this.layout.title),this.layout.title.text=e,this.layout.title.pad=gn({},this.layout.title.pad),this.layout.title.pad.t=W.DEFAULT_TITLE_PADDING.t+a*W.SUBTITLE_LINE_HEIGHT*.5)}getPlotWidth(){var e,t,n,a;return!this.rect||!this.rect.width?0:Math.max(this.rect.width-((e=(t=this.layout.margin)===null||t===void 0?void 0:t.l)!==null&&e!==void 0?e:0)-((n=(a=this.layout.margin)===null||a===void 0?void 0:a.r)!==null&&n!==void 0?n:0),0)}getPlotHeight(){var e,t,n,a;return!this.rect||!this.rect.height?0:Math.max(this.rect.height-((e=(t=this.layout.margin)===null||t===void 0?void 0:t.t)!==null&&e!==void 0?e:0)-((n=(a=this.layout.margin)===null||a===void 0?void 0:a.b)!==null&&n!==void 0?n:0),0)}updateAxisPositions(){var e=this.getPlotWidth(),t=this.getPlotHeight();this.chartUtils.updateFigureAxes(this.layout,this.figure,n=>this.getAxisRangeParser(n,this.formatter),e,t,this.theme)}updateLayoutFormats(){if(this.formatter){var e=this.chartUtils.getAxisFormats(this.figure,this.formatter);e.forEach((t,n)=>{X.debug("Assigning ".concat(n),this.layout[n],t);var a=this.layout[n];a!=null?Object.assign(a,t):X.debug("Ignoring null layout.".concat(n))})}}setDataArrayForSeries(e,t,n){var{name:a,plotStyle:i}=e,s=this.seriesDataMap.get(a),o=this.chartUtils.getPlotlyProperty(i,t);s&&xn(s,o,n)}cleanSeries(e){var{dh:t}=this,{name:n,plotStyle:a}=e,i=this.seriesDataMap.get(n);if(i!=null){if(a===t.plot.SeriesPlotStyle.HISTOGRAM){var{xLow:s,xHigh:o}=i;if(s&&o&&s.length===o.length){for(var l=[],u=0;u<s.length;u+=1)l.push(o[u]-s[u]);i.width=l}}else if(a===t.plot.SeriesPlotStyle.LINE||a===t.plot.SeriesPlotStyle.ERROR_BAR||a===t.plot.SeriesPlotStyle.BAR){var{x:f,xLow:h,xHigh:p,y:v,yLow:m,yHigh:g}=i;h&&p&&h!==f&&(i.error_x=W.getPlotlyErrorBars(f,h,p)),m&&g&&m!==v&&(i.error_y=W.getPlotlyErrorBars(v,m,g))}else if(a===t.plot.SeriesPlotStyle.TREEMAP){var{ids:b,labels:E}=i;b!==void 0&&E===void 0&&(i.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){X.warn("Trying to set a filter, but no one click!");return}X.debug("setFilter",e);for(var n=function(){var s=t.oneClicks[a],{columns:o}=s,l=new Set([...e.keys(),...t.lastFilter.keys()]);l.forEach(u=>{var f=e.get(u);t.lastFilter.get(u)!==f&&o.find(h=>h.name===u)!=null&&s.setValueForColumn(u,f)})},a=0;a<this.oneClicks.length;a+=1)n();this.lastFilter=new Map(e)}setFigure(e){this.close(),this.figure=e,this.setTitle(this.getDefaultTitle()),this.initAllSeries(),this.updateAxisPositions(),this.startListeningFigure(),this.listeners.length>0&&this.subscribeFigure()}updateSettings(e){this.settings=e}}$(mt,"ADD_SERIES_DEBOUNCE",50);const Bt=mt;function bn(r,e,t,n,a,i,s){try{var o=r[i](s),l=o.value}catch(u){t(u);return}o.done?e(l):Promise.resolve(l).then(n,a)}function Ot(r){return function(){var e=this,t=arguments;return new Promise(function(n,a){var i=r.apply(e,t);function s(l){bn(i,n,a,s,o,"next",l)}function o(l){bn(i,n,a,s,o,"throw",l)}s(void 0)})}}class yr{static makeModelFromSettings(e,t,n){var a=arguments;return Ot(function*(){var i=a.length>3&&a[3]!==void 0?a[3]:H,s=yield yr.makeFigureFromSettings(e,t,n);return new Bt(e,s,t,i)})()}static makeFigureFromSettings(e,t,n){return Ot(function*(){var a=yield n.copy();return a.applyCustomColumns(n.customColumns),a.applyFilter(n.filter),a.applySort(n.sort),e.plot.Figure.create(new W(e).makeFigureSettings(t,a))})()}static makeModel(e,t,n){var a=arguments;return Ot(function*(){var i=a.length>3&&a[3]!==void 0?a[3]:H;return new Bt(e,n,t,i)})()}}const Vd=yr;function Qe(r,e,t){return e=Ud(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Ud(r){var e=Bd(r,"string");return typeof e=="symbol"?e:String(e)}function Bd(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class Z extends ae{static makeRandomSeries(e){for(var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:100,a=[],i=[],s=[],o=[],l=new Date,u=0;u<n;u+=1){var f=new Date(l.getFullYear(),l.getMonth(),l.getDate()+u-n);a.push("".concat(f.getFullYear(),"-").concat(f.getMonth()+1,"-").concat(f.getDate()));var h=(Math.sin(u/n*e)*n/3+Math.cos(u*.2)*n/6+Math.sin(u*.5)*n/10+Math.random()*n/5+u*Z.smoothing)*t;h=Math.round(h*100)/100,i.push(h),o.push(40+u*Z.smoothing),s.push(Math.sin(u/n*e)*n/3+Math.random()*n/10+u*Z.smoothing)}return{x:a,y:i,s,l:o}}static makeScatter(e){return{name:"SCTR",x:e.x,y:e.y,type:"scattergl",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:H.area_color,width:3}}}static makeTrendline(e){return{name:"Trendline <br>R<sup>2</sup> = 0.91",x:e.x,y:e.l,type:"scattergl",mode:"line",hoverinfo:"skip",line:{width:3,dash:"dot",color:H.trend_color}}}static makeErrorBand(e){for(var t=[],n=[],a=0;a<e.y.length;a+=1){var i=e.y[a];t[a]=Math.round((i+18)*100)/100,n[a]=Math.round((i-18)*100)/100}var s=t.concat(n.reverse());return{name:"error",x:e.x.concat(e.x.slice().reverse()),y:s,type:"scattergl",mode:"line",hoverinfo:"skip",fill:"toself",fillcolor:H.error_band_fill_color,line:{width:0,color:H.error_band_line_color,shape:"spline"}}}static makeLine(e){return{name:"LINE",x:e.x,y:e.y,type:"scattergl",mode:"line",hoverinfo:"x+y+text+name",line:{color:H.line_color,width:3}}}static makeRandomData(){var e=Z.makeRandomSeries(6),t=Z.makeArea(e),n=Z.makeTrendline(e),a=Z.makeRandomSeries(2),i=Z.makeLine(a),s=Z.makeErrorBand(a);return[t,n,i,s]}static makeDefaultLayout(e){var t=new W(e).makeDefaultLayout(H);return t.title="Chart",t.xaxis&&(t.xaxis.title="Datestamp"),t.yaxis&&(t.yaxis.title="Price"),t}constructor(e){var{data:t=Z.makeRandomData(),layout:n=Z.makeDefaultLayout(e),filterFields:a=[]}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};super(e),Qe(this,"data",void 0),Qe(this,"filterFields",void 0),Qe(this,"layout",void 0),this.data=t,this.layout=n,this.filterFields=a}getData(){return this.data}getLayout(){return this.layout}getFilterColumnMap(){for(var e=new Map,t=0;t<this.filterFields.length;t+=1){var n=this.filterFields[t],a="java.lang.String";e.set(n,{name:n,type:a})}return e}isFilterRequired(){return this.filterFields.length>0}setFilter(){this.fireUpdate(this.data)}}Qe(Z,"smoothing",1.5);const Hd=Z,Gd=typeof Ze=="function"?Ze(tt):Ze.default(tt);function Wd(r){return r.setFigure!==void 0}const Kd=Object.freeze(Object.defineProperty({__proto__:null,Chart:jd,ChartModel:ae,ChartModelFactory:Vd,ChartTheme:H,ChartUtils:W,FigureChartModel:Bt,MockChartModel:Hd,Plot:Gd,isFigureChartModel:Wd},Symbol.toStringTag,{value:"Module"}));function di(r,e,t){return e=zd(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function zd(r){var e=qd(r,"string");return typeof e=="symbol"?e:String(e)}function qd(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class ke{static valueForCell(e,t,n){var a="".concat(e,",").concat(t);return n!==void 0&&n&&(a="(".concat(a,")")),a}constructor(e){di(this,"dh",void 0),this.dh=e}makeColumn(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:ke.DEFAULT_TYPE,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0;return new this.dh.Column({index:n,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]:"",n=[],a=0;a<e;a+=1)n.push(this.makeColumn("".concat(t).concat(a),ke.DEFAULT_TYPE,a));return n}static makeUserColumnWidths(){for(var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:5,t=new Map,n=0;n<e;n+=1)t.set(n.toString(),100);return t}makeRow(e){var t=new this.dh.Row({index:e,name:"".concat(e)});return t.get=jest.fn(n=>ke.valueForCell(e,n.index)),t}makeFilter(){return new this.dh.FilterCondition}makeSort(){return new this.dh.Sort}makeTable(){var{columns:e=this.makeColumns(),size:t=1e9,sort:n=[],layoutHints:a={}}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},i=new this.dh.Table({columns:e,size:t,sort:n});return i.copy=jest.fn(()=>Promise.resolve(i)),i.freeze=jest.fn(()=>Promise.resolve(i)),i.layoutHints=a,i}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,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[],a=new this.dh.TreeTable({columns:e,size:t,sort:n});return a.copy=jest.fn(()=>Promise.resolve(a)),a}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,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,{dh:a}=this;return new Zs(a,e,t??new lt(a),n)}}di(ke,"DEFAULT_TYPE","java.lang.String");const Xd=ke;function Te(r,e,t){return e=Yd(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Yd(r){var e=Zd(r,"string");return typeof e=="symbol"?e:String(e)}function Zd(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}var ce=k.module("TableViewportUpdater"),Qd=150;class he extends c.PureComponent{constructor(){super(...arguments),Te(this,"subscription",void 0),Te(this,"getViewportRowRange",Ct((e,t,n)=>{var a=n-t,i=Math.max(0,t-a*he.ROW_BUFFER_PAGES),s=n+a*he.ROW_BUFFER_PAGES;return[i,s]})),Te(this,"getViewportColumns",Ct((e,t,n,a)=>{if(t==null||n==null)return null;for(var i=n-t,s=Math.max(0,t-i*he.COLUMN_BUFFER_PAGES),o=Math.min(n+i*he.COLUMN_BUFFER_PAGES,e.columns.length-1),l=[],u=s;u<=o;u+=1){var f=Qs.getModelIndex(u,a);l.push(e.columns[f])}return l})),Te(this,"updateViewport",Dn((e,t,n,a,i)=>{if(t<e){ce.error("Invalid viewport",e,t);return}if(e===0&&t===0){ce.debug2("Ignoring 0-0 viewport");return}var{movedColumns:s,table:o}=this.props,[l,u]=this.getViewportRowRange(o,e,t),f=i??this.getViewportColumns(o,n,a,s);if(ce.debug2("Setting Viewport Top:",l,"Bottom:",u,"Columns:",f),this.subscription==null){ce.debug2("updateViewport creating new subscription"),this.subscription=o.setViewport(l,u,f);var{onSubscription:h}=this.props;h(this.subscription)}else ce.debug2("updateViewport using existing subscription"),this.subscription.setViewport(l,u,f)},Qd))}componentDidMount(){var{top:e,bottom:t,left:n,right:a,table:i,filters:s,sorts:o,columns:l,customColumns:u}=this.props;i.applyFilter(s),i.applySort(o),i.applyCustomColumns(u),this.updateViewport(e,t,n,a,l)}componentDidUpdate(e){var{top:t,bottom:n,left:a,right:i,table:s,filters:o,sorts:l,customColumns:u,columns:f}=this.props,h=o!==e.filters,p=l!==e.sorts,v=u!==e.customColumns,m=s!==e.table;(h||p||v||m)&&this.closeSubscription(),(h||m)&&(ce.debug("update table filter",o),s.applyFilter(o)),(p||m)&&(ce.debug("update table sort",l),s.applySort(l)),(v||m)&&(ce.debug("update table custom columns",u),s.applyCustomColumns(u)),this.updateViewport(t,n,a,i,f)}componentWillUnmount(){this.closeSubscription()}closeSubscription(){if(ce.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}}Te(he,"ROW_BUFFER_PAGES",3);Te(he,"COLUMN_BUFFER_PAGES",1);Te(he,"defaultProps",{top:0,bottom:0,left:null,right:null,columns:null,onSubscription:()=>{},filters:[],sorts:[],customColumns:[],movedColumns:[]});const Jd=he;function it(r,e,t){return e=ef(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function ef(r){var e=tf(r,"string");return typeof e=="symbol"?e:String(e)}function tf(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}var xe=k.module("TreeTableViewportUpdater"),rf=150;class st extends c.PureComponent{constructor(e){super(e),it(this,"listenerCleanup",void 0),it(this,"updateViewport",Dn((t,n)=>{if(n<t){xe.error("Invalid viewport",t,n);return}if(t===0&&n===0){xe.debug2("Ignoring 0-0 viewport");return}var{table:a,updateInterval:i}=this.props,s=n-t,o=Math.max(0,t-s*3),l=n+s*3+1;if(xe.debug2("Setting Viewport Top:",o,"Bottom:",l,a),!this.listenerCleanup){var{dh:u,onViewportUpdate:f}=this.props;this.listenerCleanup=a.addEventListener(u.TreeTable.EVENT_UPDATED,f)}a.setViewport(o,l,void 0,i)},rf)),this.listenerCleanup=null}componentDidMount(){var{top:e,bottom:t,table:n,filters:a,sorts:i}=this.props;xe.debug("componentDidMount",this.props),n.applyFilter(a),n.applySort(i),this.updateViewport(e,t)}componentDidUpdate(e){var{top:t,bottom:n,table:a,filters:i,sorts:s}=this.props;i!==e.filters&&(xe.debug("update table filter",i),a.applyFilter(i)),s!==e.sorts&&(xe.debug("update table sort",s),a.applySort(s)),this.updateViewport(t,n)}componentWillUnmount(){this.updateViewport.cancel(),this.listenerCleanup&&this.listenerCleanup()}render(){return null}}it(st,"UPDATE_INTERVAL",1e3);it(st,"defaultProps",{top:0,bottom:0,onViewportUpdate:()=>{},filters:[],sorts:[],updateInterval:st.UPDATE_INTERVAL});const nf=st,af=Object.freeze(Object.defineProperty({__proto__:null,AdvancedSettings:Js,AdvancedSettingsType:eo,AggregationEdit:to,AggregationUtils:ro,Aggregations:no,BarIcon:ao,ChartBuilder:io,ColumnHeaderGroup:so,CustomColumnBuilder:oo,DownloadServiceWorkerUtils:lo,FormatColumnWhereIcon:uo,FormatRowWhereIcon:co,HistogramIcon:fo,InputEditor:ho,IrisGrid:Or,IrisGridMetricCalculator:po,IrisGridModel:vo,IrisGridModelFactory:mo,IrisGridRenderer:go,IrisGridTableModel:bo,IrisGridTableModelTemplate:yo,IrisGridTestUtils:Xd,IrisGridTreeTableModel:Eo,IrisGridUtils:So,LineIcon:To,OptionType:wo,PieIcon:Po,RollupRows:Oo,SHORTCUTS:Co,ScatterIcon:xo,TableCsvExporter:Do,TableSaver:Ao,TableViewportUpdater:Jd,TreeTableViewportUpdater:nf,VisibilityOrderingBuilder:No,createDefaultIrisGridTheme:Io,default:Or,isIrisGridTableModelTemplate:_o},Symbol.toStringTag,{value:"Module"}));var fi={react:V,"react-dom":Oi,redux:Ci,"react-redux":xi,"@adobe/react-spectrum":Di,"@deephaven/auth-plugins":yd,"@deephaven/chart":Kd,"@deephaven/components":Yu,"@deephaven/icons":Ji,"@deephaven/iris-grid":af,"@deephaven/jsapi-bootstrap":Zu,"@deephaven/jsapi-components":Uc,"@deephaven/jsapi-utils":cc,"@deephaven/log":k,"@deephaven/react-hooks":vl},sf=Ai.createRequires(fi),of=Ni({requires:sf});const lf=of;function yn(r,e,t,n,a,i,s){try{var o=r[i](s),l=o.value}catch(u){t(u);return}o.done?e(l):Promise.resolve(l).then(n,a)}function Er(r){return function(){var e=this,t=arguments;return new Promise(function(n,a){var i=r.apply(e,t);function s(l){yn(i,n,a,s,o,"next",l)}function o(l){yn(i,n,a,s,o,"throw",l)}s(void 0)})}}var de=k.module("@deephaven/app-utils.PluginUtils");function uf(r){return Ht.apply(this,arguments)}function Ht(){return Ht=Er(function*(r){var e=yield lf(r);return e}),Ht.apply(this,arguments)}function cf(r){return Gt.apply(this,arguments)}function Gt(){return Gt=Er(function*(r){var e=yield fetch(r);if(!e.ok)throw new Error(e.statusText);try{return yield e.json()}catch{throw new Error("Could not be parsed as JSON")}}),Gt.apply(this,arguments)}function df(r){return Wt.apply(this,arguments)}function Wt(){return Wt=Er(function*(r){de.debug("Loading plugins...");try{var e=yield cf("".concat(r,"/manifest.json"));if(!Array.isArray(e.plugins))throw new Error("Plugin manifest JSON does not contain plugins array");de.debug("Plugin manifest loaded:",e);for(var t=[],n=0;n<e.plugins.length;n+=1){var{name:a,main:i}=e.plugins[n],s="".concat(r,"/").concat(a,"/").concat(i);t.push(uf(s))}for(var o=yield Promise.allSettled(t),l=new Map,u=0;u<o.length;u+=1){var f=o[u],{name:h}=e.plugins[u];if(f.status==="fulfilled"){var p,v=Gc(f.value)?f.value:(p=f.value.default)!==null&&p!==void 0?p:f.value;v==null?de.error("Plugin '".concat(h,"' is missing an exported value.")):l.set(h,v)}else de.error("Unable to load plugin '".concat(h,"'"),f.reason)}return de.info("Plugins loaded:",l),l}catch(m){return de.error("Unable to load plugins:",m),new Map}}),Wt.apply(this,arguments)}function ff(r){var e,t;return(e=(t=r.get("AuthHandlers"))===null||t===void 0?void 0:t.split(","))!==null&&e!==void 0?e:[]}function hf(r,e){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:new Map,n=ff(e),a=[...r.entries(),...t.entries()].filter(l=>{var[,u]=l;return Kc(u)||Rt(u)}).map(l=>{var[u,f]=l;return Rt(f)?{type:vt.AUTH_PLUGIN,name:u,component:f.AuthPlugin.Component,isAvailable:f.AuthPlugin.isAvailable}:f}),i=a.filter(l=>{var{isAvailable:u}=l;return u(n,e)});if(i.length===0)throw new Error("No login plugins found, please register a login plugin for auth handlers: ".concat(n));i.length>1&&de.warn("More than one login plugin available, will use the first one: ",i.map(l=>{var{name:u}=l;return u}).join(", "));var{name:s,component:o}=i[0];return de.info("Using LoginPlugin",s),o}function pf(r){var e=[...r.entries()].filter(t=>zc(t[1]));return de.debug("Getting theme data from plugins",e),e.map(t=>{var[n,a]=t,i=Array.isArray(a.themes)?a.themes:[a.themes];return i.map(s=>{var{name:o,baseTheme:l,styleContent:u}=s;return{baseThemeKey:"default-".concat(l??"dark"),themeKey:Vn(n,o),name:o,styleContent:u}})}).flat()}var vf=An.createRequires(()=>fi),mf=An.createRemoteComponent({requires:vf});const $f=mf;function En(r,e,t,n,a,i,s){try{var o=r[i](s),l=o.value}catch(u){t(u);return}o.done?e(l):Promise.resolve(l).then(n,a)}function gf(r){return function(){var e=this,t=arguments;return new Promise(function(n,a){var i=r.apply(e,t);function s(l){En(i,n,a,s,o,"next",l)}function o(l){En(i,n,a,s,o,"throw",l)}s(void 0)})}}var gt=c.createContext(null);function bf(r){var{pluginsUrl:e,getCorePlugins:t,children:n}=r,[a,i]=c.useState(null);return c.useEffect(function(){var o=!1;function l(){return u.apply(this,arguments)}function u(){return u=gf(function*(){var f,h=(f=yield t==null?void 0:t())!==null&&f!==void 0?f:[],p=yield df(e);if(!o){var v=h.map(m=>[m.name,m]);i(new Map([...v,...p]))}}),u.apply(this,arguments)}return l(),()=>{o=!0}},[e,t]),d.jsx(gt.Provider,{value:a,children:n})}function yf(){var r=hr();return c.useEffect(function(){r.postMessage(ur(lr))},[r]),null}function Sn(r,e,t,n,a,i,s){try{var o=r[i](s),l=o.value}catch(u){t(u);return}o.done?e(l):Promise.resolve(l).then(n,a)}function Ef(r){return function(){var e=this,t=arguments;return new Promise(function(n,a){var i=r.apply(e,t);function s(l){Sn(i,n,a,s,o,"next",l)}function o(l){Sn(i,n,a,s,o,"throw",l)}s(void 0)})}}var Sf=new Map([["@deephaven/auth-plugins.AuthPluginParent",{AuthPlugin:ai}],["@deephaven/auth-plugins.AuthPluginPsk",{AuthPlugin:li}],["@deephaven/auth-plugins.AuthPluginAnonymous",{AuthPlugin:ni}]]);function Tf(r){var{children:e}=r,t=Re(),n=c.useContext(gt),[a,i]=c.useState(),[s,o]=c.useState();c.useEffect(function(){var h=!1;function p(){return v.apply(this,arguments)}function v(){return v=Ef(function*(){try{var m=yield t.getAuthConfigValues();h||i(new Map(m))}catch(g){h||o(g)}}),v.apply(this,arguments)}return p(),()=>{h=!0}},[t]);var l=c.useMemo(()=>{if(!(n==null||a==null))try{return hf(n,a,Sf)}catch(f){o(f)}},[a,n]),u=l==null||a==null;return u||s!=null?d.jsx(Oe,{isLoading:u&&s==null,errorMessage:je(s)}):d.jsx(l,{authConfigValues:a,children:d.jsxs(d.Fragment,{children:[d.jsx(yf,{}),e]})})}function Vf(r){return new URL(r,"".concat(window.location))}function wf(){var r=new URLSearchParams(window.location.search);return r.get("envoyPrefix")}function Pf(){var r=wf();return r!=null?{headers:{"envoy-prefix":r}}:{headers:{}}}function Of(r){var{children:e}=r,t=c.useContext(Ja);return t?d.jsx(d.Fragment,{children:e}):d.jsx(Oe,{"data-testid":"fonts-loaded-loading"})}function Tn(r,e,t,n,a,i,s){try{var o=r[i](s),l=o.value}catch(u){t(u);return}o.done?e(l):Promise.resolve(l).then(n,a)}function Cf(r){return function(){var e=this,t=arguments;return new Promise(function(n,a){var i=r.apply(e,t);function s(l){Tn(i,n,a,s,o,"next",l)}function o(l){Tn(i,n,a,s,o,"throw",l)}s(void 0)})}}var hi=c.createContext(null);function xf(r){var{children:e}=r,t=Re(),[n,a]=c.useState(),[i,s]=c.useState();c.useEffect(function(){var u=!1;function f(){return h.apply(this,arguments)}function h(){return h=Cf(function*(){try{var p=yield t.getServerConfigValues();u||a(new Map(p))}catch(v){u||s(v)}}),h.apply(this,arguments)}return f(),()=>{u=!0}},[t]);var o=n==null;return o||i!=null?d.jsx(Oe,{isLoading:o&&i==null,errorMessage:je(i)}):d.jsx(hi.Provider,{value:n,children:e})}function Df(){return ot(hi,"No server config available in useServerConfig. Was code wrapped in ServerConfigBootstrap or ServerConfigContext.Provider?")}function Af(r){var{children:e}=r,t=Df(),n=c.useContext(ra),a=c.useContext(ut),i=ci(t,n,a);return d.jsx(ta.Provider,{value:i,children:e})}function Nf(r){var{children:e}=r,t=c.useContext(gt),n=c.useMemo(()=>t==null?null:pf(t),[t]);return d.jsx(_a,{themes:n,children:e})}function Uf(r){var{fontClassNames:e,pluginsUrl:t,getCorePlugins:n,serverUrl:a,children:i}=r,s=c.useMemo(()=>Pf(),[]),[o,l]=c.useState(0),u=c.useCallback(()=>{},[]),f=c.useCallback(()=>{l(h=>h+1)},[]);return pt(u,f),d.jsx(Bc,{fontClassNames:e,children:d.jsx(bf,{getCorePlugins:n,pluginsUrl:t,children:d.jsx(Nf,{children:d.jsx(Kn,{serverUrl:a,options:s,children:d.jsx(qa,{children:d.jsx(Tf,{children:d.jsx(xf,{children:d.jsx(Af,{children:d.jsx(Mo,{children:d.jsx(Of,{children:i})})})})})})},o)})})})}function If(){return ot(gt,"No Plugins available in usePlugins. This can happen when plugins have not finished loading or if code is not wrapped in PluginsBootstrap or PluginsContext.Provider.")}var _f=k.module("@deephaven/app-utils/useTablePlugin");function Bf(){var r=If(),e=c.useCallback(t=>{var n=r.get(t);if(n!=null){if(Wc(n))return n.component;if(ei(n))return n.TablePlugin}var a="Unable to find table plugin ".concat(t,".");throw _f.error(a),new Error(a)},[r]);return e}export{Uf as AppBootstrap,Tf as AuthBootstrap,Mo as ConnectionBootstrap,Wf as ConnectionContext,Bc as FontBootstrap,Of as FontsLoaded,Ja as FontsLoadedContext,bf as PluginsBootstrap,gt as PluginsContext,$f as RemoteComponent,Nf as ThemeBootstrap,ff as getAuthHandlers,hf as getAuthPluginComponent,Vf as getBaseUrl,Pf as getConnectOptions,wf as getEnvoyPrefix,pf as getThemeDataFromPlugins,cf as loadJson,uf as loadModulePlugin,df as loadModulePlugins,Kf as useConnection,Bf as useLoadTablePlugin,If as usePlugins,Df as useServerConfig,zf as useUser};
4
- //# sourceMappingURL=index-3775d13f.js.map
3
+ `).map(N=>N.trim()).join(" ")}function E(){if(m.current){m.current.style.height="0";var O=m.current.scrollHeight+(m.current.offsetHeight-m.current.clientHeight);O>0&&(m.current.style.height="".concat(O,"px"))}}function P(O){var N=O.target.value;p&&(o&&(N=g(N)),v(!1)),h(N),n(N)}function y(){m.current&&(o&&(h(g(f)),E()),m.current.scrollLeft=0)}function C(){m.current&&document.activeElement!==m.current&&m.current.focus()}function T(){o&&(h(b(f)),n(b(f)))}function A(){v(!0)}return c.useEffect(function(){E()},[f]),d.jsx("textarea",{ref:m,id:l,className:F(e,"auto-resize-textarea form-control"),placeholder:i,value:f,rows:1,onChange:P,onFocus:y,onMouseDown:C,onBlur:T,onPaste:A,spellCheck:a,disabled:s,"data-testid":u})}nr.propTypes={value:x.string.isRequired,onChange:x.func.isRequired,className:x.string,placeholder:x.string,spellCheck:x.bool,disabled:x.bool,delimiter:x.string,id:x.string,"data-testid":x.string};nr.defaultProps={className:"",id:"",placeholder:"",disabled:!1,spellCheck:!1,delimiter:"","data-testid":void 0};function Ke(r){var{children:e,className:t,style:n,"data-testid":a}=r;return d.jsx("div",{className:F("btn-group",t),style:n,role:"group","data-testid":a,children:e})}Ke.displayName="ButtonGroup";Ke.propTypes={children:x.node.isRequired,className:x.string,style:x.object,"data-testid":x.string};Ke.defaultProps={className:null,style:{},"data-testid":void 0};function Fl(r){var{blockInteraction:e=!0,children:t,debounceMs:n,isOpen:a=!1}=r,i=ct(a,n);return d.jsxs(d.Fragment,{children:[e&&a&&d.jsx("div",{className:"modal-backdrop",style:{backgroundColor:"transparent"},"data-testid":"debounced-modal-backdrop"}),V.cloneElement(t,{isOpen:a&&i})]})}function kl(r){var{className:e,icon:t,isOpen:n=!1,subtitle:a,title:i}=r;return d.jsx(zt,{isOpen:n,className:e,children:d.jsx(qt,{children:d.jsxs("div",{className:"info-modal",children:[t!=null&&d.jsx("div",{className:"message-icon",children:d.jsx(se,{icon:t})}),d.jsx("div",{className:"message-header",children:i}),a!=null&&d.jsx("div",{className:"message-content",children:a})]})})})}function Oa(r){var{className:e="modal-footer",children:t,"data-testid":n}=r;return d.jsx("div",{className:e,"data-testid":n,children:t})}function ar(r){var{isOpen:e,headerText:t,bodyText:n,onCancel:a,onConfirm:i,onDiscard:s,onModalDisable:o,cancelButtonText:l="Cancel",confirmButtonText:u="Okay",discardButtonText:f="Discard",isConfirmDanger:h=!1,children:p,"data-testid":v}=r,m=c.useRef(null),g=c.useRef(null),b=c.useCallback(()=>{g.current!==null&&g.current.checked&&o&&o(),i()},[i,o]),E=c.useCallback(()=>{var y;(y=m.current)===null||y===void 0||y.focus()},[]),P="";return e&&(P=typeof n=="function"?n():n),d.jsxs(zt,{isOpen:e,className:"theme-bg-light",onOpened:E,children:[d.jsx(In,{closeButton:!1,children:t}),d.jsx(qt,{children:P}),d.jsxs(Oa,{children:[o&&d.jsxs("div",{className:"custom-control custom-checkbox form-group mr-auto",children:[d.jsx("input",{type:"checkbox",className:"custom-control-input",id:"move-confirmation-checkbox",defaultChecked:!1,ref:g,"data-testid":v!==void 0?"".concat(v,"-checkbox-confirm"):void 0}),d.jsx("label",{className:"custom-control-label",htmlFor:"move-confirmation-checkbox",children:"Don't ask me again"})]}),s&&d.jsx(pe,{kind:"secondary",className:"mr-auto","data-dismiss":"modal",onClick:s,"data-testid":v!==void 0?"".concat(v,"-btn-discard"):void 0,children:f}),a&&d.jsx(pe,{kind:"secondary","data-dismiss":"modal",onClick:a,"data-testid":v!==void 0?"".concat(v,"-btn-cancel"):void 0,children:l}),d.jsxs(Ke,{children:[d.jsx(pe,{kind:h?"danger":"primary",onClick:b,ref:m,"data-testid":v!==void 0?"".concat(v,"-btn-confirm"):void 0,children:u}),p]})]})]})}ar.propTypes={isOpen:x.bool.isRequired,headerText:x.string.isRequired,bodyText:x.oneOfType([x.string,x.func]).isRequired,onCancel:x.func,onConfirm:x.func.isRequired,onDiscard:x.func,onModalDisable:x.func,cancelButtonText:x.string,confirmButtonText:x.string,discardButtonText:x.string,children:x.node,"data-testid":x.string};ar.defaultProps={children:void 0,cancelButtonText:"Cancel",confirmButtonText:"Okay",discardButtonText:"Discard",onCancel:void 0,onDiscard:void 0,onModalDisable:void 0,"data-testid":void 0};var dt=V.forwardRef((r,e)=>{var{children:t,className:n,disabled:a,onClick:i,style:s,id:o}=r;return d.jsx("button",{ref:e,type:"button",className:F("btn",n),onClick:i,style:s,disabled:a,id:o,children:t})});dt.displayName="Button";dt.propTypes={children:x.node,className:x.string,disabled:x.bool,onClick:x.func,style:x.shape({}),id:x.string};dt.defaultProps={children:null,className:"",disabled:!1,onClick:()=>null,style:{},id:""};const Ll=dt;function jr(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(r,a).enumerable})),t.push.apply(t,n)}return t}function Rr(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?jr(Object(t),!0).forEach(function(n){jl(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):jr(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function jl(r,e,t){return e=Rl(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Rl(r){var e=$l(r,"string");return typeof e=="symbol"?e:String(e)}function $l(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}function Vl(r){var{styleProps:e,selectedItemCount:t,onClearSelection:n}=r;return d.jsx(yi,Rr(Rr({UNSAFE_className:rr.spectrumActionBar},e),{},{isEmphasized:!0,selectedItemCount:t,onClearSelection:n}))}function Ul(r){var{className:e,isFlipped:t,children:n,"data-testid":a}=r,i=u=>{if(n.length!==2)throw new Error("CardFlip requires 2 children to function");return n[u]},s=c.useRef(null),o=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(!s.current)throw Error("ref undefined");s.current.addEventListener("transitionstart",o);var f=s.current;return function(){if(f!=null)return f.removeEventListener("transitionstart",o)}},[o]),d.jsxs("div",{className:F(e,{"card-flip--show-front":t,"card-flip--show-back":!t}),"data-testid":a,children:[d.jsx("div",{className:"card-flip--back",children:i(0)}),d.jsx("div",{ref:s,className:"card-flip--front",onTransitionEnd:l,children:i(1)})]})}function Ca(r,e,t){return e=Bl(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Bl(r){var e=Hl(r,"string");return typeof e=="symbol"?e:String(e)}function Hl(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class oe extends c.Component{static handleEnter(e){var t=e;t.style.height="0"}static handleEntering(e){var t=e;t.style.height="".concat(oe.getHeight(t),"px")}static handleExiting(e){var t=e;t.style.height="0"}static handleExit(e){var t=e;t.style.height="".concat(oe.getHeight(t),"px")}static getHeight(e){var t=e.scrollWidth-e.clientWidth;return e.scrollHeight-t}constructor(e){super(e),this.handleEntered=this.handleEntered.bind(this)}handleEntered(e){var t=e;t.style.height="";var{autoFocusOnShow:n}=this.props;if(n!==void 0&&n){var a=t.querySelector("input, select, textarea");a!=null&&a.focus()}}render(){var{children:e,className:t,in:n,"data-testid":a}=this.props;return d.jsx(Je,{in:n,classNames:{enterActive:"collapsing",enterDone:"collapse show",exitActive:"collapsing",exitDone:"collapse"},onEnter:oe.handleEnter,onEntering:oe.handleEntering,onEntered:this.handleEntered,onExit:oe.handleExit,onExiting:oe.handleExiting,timeout:350,children:i=>d.jsx("div",{className:F({collapse:i==="exited"},t),"data-testid":a,children:e})})}}Ca(oe,"propTypes",{className:x.string,in:x.bool.isRequired,children:x.node.isRequired,autoFocusOnShow:x.bool,"data-testid":x.string});Ca(oe,"defaultProps",{className:"",autoFocusOnShow:!1,"data-testid":void 0});const Gl=oe;var Wl=k.module("TimeInput"),Kl="([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]",zl=["00:00:00","12:34:56","23:59:59"],xa=V.forwardRef((r,e)=>{var{allowValueWrapping:t=!0,className:n="",onChange:a=()=>!1,value:i=0,onFocus:s=()=>!1,onBlur:o=()=>!1,onSelect:l=()=>!1,"data-testid":u}=r,[f,h]=c.useState(Be.formatTime(i)),[p,v]=c.useState(),m=c.useRef(null);c.useImperativeHandle(e,()=>({focus:()=>{var y;(y=m.current)===null||y===void 0||y.focus()},setSelection:y=>{var C;(C=m.current)===null||C===void 0||C.focus(),v(y)}}),[]),c.useEffect(function(){h(Be.formatTime(i))},[i]);function g(y,C,T){var A=y.selectionStart===0?24:60,O=parseInt(T,10)-C;return Number.isNaN(O)?O=0:t?O=(O%A+A)%A:O=Math.min(Math.max(0,O),A-1),"".concat(O).padStart(2,"0")}function b(y,C,T,A,O){return A===0&&O===2&&C===1&&parseInt(T,10)>1?"0".concat(T).concat(y.substring(2)):Bn(y,C,T)}function E(y){Wl.debug("handleChange",y),h(y),Be.isTimeString(y)&&a(Be.parseTime(y))}var P=c.useCallback(y=>{v(y),l(y)},[l]);return d.jsx(Yt,{ref:m,className:n,example:zl,getNextSegmentValue:g,getPreferredReplacementString:b,onChange:E,onSelect:P,pattern:Kl,selection:p,value:f,onFocus:s,onBlur:o,"data-testid":u})});xa.defaultProps={allowValueWrapping:!0,className:"",onChange:()=>!1,onSelect:()=>!1,value:0,onFocus:()=>!1,onBlur:()=>!1,"data-testid":void 0};const nt=xa;function $r(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(r,a).enumerable})),t.push.apply(t,n)}return t}function ql(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?$r(Object(t),!0).forEach(function(n){be(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):$r(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function be(r,e,t){return e=Xl(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Xl(r){var e=Yl(r,"string");return typeof e=="symbol"?e:String(e)}function Yl(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}var Vr=-1,Nt;(function(r){r.UP="UP",r.DOWN="DOWN"})(Nt||(Nt={}));class te extends c.Component{constructor(e){super(e),be(this,"csContainer",void 0),be(this,"menuContainer",void 0),be(this,"button",void 0),be(this,"input",void 0);var{value:t,valueToTime:n}=e;this.toggleMenu=this.toggleMenu.bind(this),this.handleMenuKeyDown=this.handleMenuKeyDown.bind(this),this.closeMenu=this.closeMenu.bind(this),this.handleOptionClick=this.handleOptionClick.bind(this),this.handleOptionFocus=this.handleOptionFocus.bind(this),this.handleMenuOpened=this.handleMenuOpened.bind(this),this.handleMenuExited=this.handleMenuExited.bind(this),this.handleCustomInput=this.handleCustomInput.bind(this),this.csContainer=V.createRef(),this.menuContainer=V.createRef(),this.button=V.createRef(),this.input=V.createRef(),this.state={keyboardOptionIndex:0,menuIsOpen:!1,inputWidth:100,customTime:n(t),inputFocused:!1}}getSelectedText(){var{options:e,value:t,placeholder:n}=this.props,{customTime:a}=this.state;if(t===null)return n;for(var i=0;i<e.length;i+=1){var s=e[i];if(s.value===t)return s.title}return Be.formatTime(a)}setInputWidth(){this.csContainer.current&&this.setState({inputWidth:this.csContainer.current.getBoundingClientRect().width})}focus(){var e;(e=this.button.current)===null||e===void 0||e.focus()}updateInputValue(e){var{onChange:t}=this.props;t(e)}handleResize(){this.setInputWidth()}handleMenuKeyDown(e){var t,{keyboardOptionIndex:n,inputFocused:a}=this.state,{options:i}=this.props;switch(e.key){case"Enter":case" ":a?this.updateFromCustom():this.updateInputValue(i[n].value),this.closeMenu(),(t=this.button.current)===null||t===void 0||t.focus(),e.stopPropagation(),e.preventDefault();break;case"Tab":e.shiftKey?this.handleMenuNavigation(te.MENU_NAVIGATION_DIRECTION.UP):this.handleMenuNavigation(te.MENU_NAVIGATION_DIRECTION.DOWN),e.stopPropagation(),e.preventDefault();break;case"ArrowUp":this.handleMenuNavigation(te.MENU_NAVIGATION_DIRECTION.UP),e.stopPropagation(),e.preventDefault();break;case"ArrowDown":this.handleMenuNavigation(te.MENU_NAVIGATION_DIRECTION.DOWN),e.stopPropagation(),e.preventDefault();break;case"Escape":this.closeMenu();break}}handleMenuNavigation(e){var{keyboardOptionIndex:t,inputFocused:n}=this.state,{options:a}=this.props,i=a.length,s=t;switch(e){case te.MENU_NAVIGATION_DIRECTION.UP:if(!n&&t===0){this.focusInput();break}else n&&this.focusOption(t);t>0&&!n?(s=(s-1)%i,this.setState({keyboardOptionIndex:s})):t===0&&(s=i-1,this.setState({keyboardOptionIndex:s})),this.scrollOptionIntoView(s);break;case te.MENU_NAVIGATION_DIRECTION.DOWN:if(!n&&t===i-1){this.focusInput();break}else n&&this.focusOption(t);t<i&&!(n&&t===0)&&(s=(s+1)%i,this.setState({keyboardOptionIndex:s})),this.scrollOptionIntoView(s);break}}handleOptionClick(e){var t=Number(e.currentTarget.value),{options:n,timeToValue:a}=this.props,{customTime:i}=this.state;if(t===Vr){var s=a(i);this.updateAndClose(s)}else this.updateAndClose(n[t].value)}updateAndClose(e){var t;this.updateInputValue(e),this.closeMenu(),(t=this.button.current)===null||t===void 0||t.focus()}handleOptionFocus(e){this.setState({keyboardOptionIndex:Number(e.target.value)})}handleMenuOpened(){var e,{options:t,value:n}=this.props,{keyboardOptionIndex:a}=this.state;this.scrollOptionIntoView(a);var i=(e=this.menuContainer.current)===null||e===void 0?void 0:e.querySelector(".cs-option-btn.keyboard-active");if(i instanceof HTMLElement&&i.focus(),n!==null){var s=t.map(o=>o.value).indexOf(n);s<0&&this.focusInput()}}focusInput(){var e;(e=this.input.current)===null||e===void 0||e.focus()}focusOption(e){var t,n=(t=this.menuContainer.current)===null||t===void 0?void 0:t.querySelector(".cs-options");if(n&&n.children!=null){var a=n.children.item(e);a instanceof HTMLElement&&a.focus()}}handleMenuExited(){var{menuIsOpen:e}=this.state;e&&this.setState({menuIsOpen:!1,keyboardOptionIndex:0})}handleCustomInput(e){var{timeToValue:t}=this.props,n=t(e);this.updateInputValue(n),this.setState({customTime:e})}updateFromCustom(){var{timeToValue:e}=this.props,{customTime:t}=this.state,n=e(t);this.updateInputValue(n)}toggleMenu(e){var{menuIsOpen:t}=this.state;t?this.closeMenu():this.openMenu(),e.stopPropagation()}openMenu(){this.updateKeyboardIndex(),this.setInputWidth(),this.setState({menuIsOpen:!0})}closeMenu(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;if(this.setState({menuIsOpen:!1}),e){var t;(t=this.button.current)===null||t===void 0||t.focus()}}updateKeyboardIndex(){var{options:e,value:t}=this.props;if(t!==null){var n=e.map(a=>a.value).indexOf(t);n>0&&this.setState({keyboardOptionIndex:n})}}scrollOptionIntoView(e){var t,n=(t=this.menuContainer.current)===null||t===void 0?void 0:t.querySelector(".cs-options");if(n&&n.children!=null){var a=n.children.item(e);a instanceof HTMLElement&&a.offsetTop>te.DROP_DOWN_MENU_HEIGHT?n.scrollTop=a.offsetTop-te.DROP_DOWN_MENU_HEIGHT:(a instanceof HTMLElement&&a.offsetTop<0||e===0)&&(n.scrollTop=0)}}renderMenuElement(){var{inputWidth:e}=this.state;return d.jsx("div",{className:"cs-menu-container",ref:this.menuContainer,role:"presentation",onKeyDown:this.handleMenuKeyDown,onClick:t=>{t.stopPropagation()},style:{width:e},children:d.jsx("div",{className:"cs-options-container",children:d.jsx("div",{className:"cs-options",children:this.renderOptions()})})})}renderOptions(){for(var{options:e,value:t,icon:n,customText:a}=this.props,{keyboardOptionIndex:i,customTime:s,inputFocused:o}=this.state,l=!1,u=[],f=0;f<e.length;f+=1){var h=e[f],p="option-".concat(f,"-").concat(h.value);l=l||h.value===t,u.push(d.jsxs("button",{type:"button",value:f,className:F("cs-option-btn",{"keyboard-active":i===f&&!o}),onClick:this.handleOptionClick,onFocus:this.handleOptionFocus,children:[h.value===t&&d.jsx(se,{icon:n,className:"mr-2"}),h.value!==t&&d.jsx("span",{className:"mr-4"}),h.title]},p))}return u.push(d.jsx("hr",{className:"cs-divider"},"option-divider")),u.push(d.jsxs("button",{type:"button",value:Vr,className:F("cs-option-btn",{"keyboard-active":o}),onClick:this.handleOptionClick,onFocus:this.handleOptionFocus,children:[!l&&t!==null?d.jsx(se,{icon:n,className:"mr-2"}):d.jsx("span",{className:"mr-4"}),a]},"option-custom-label")),u.push(d.jsxs("div",{className:"cs-custom-container",children:[d.jsx("span",{className:"mr-2"}),d.jsx(nt,{ref:this.input,onChange:this.handleCustomInput,value:s,onFocus:()=>this.setState({inputFocused:!0}),onBlur:()=>this.setState({inputFocused:!1})},"option-input"),d.jsx("span",{className:"ml-2"})]},"cs-custom-container")),u.push(d.jsx("hr",{className:"mb-2"},"option-end")),u}render(){var{disabled:e,invalid:t,value:n,"data-testid":a}=this.props,{menuIsOpen:i}=this.state,{popperOptions:s}=this.props;return s=ql({placement:"bottom-end",modifiers:{preventOverflow:{enabled:!1}}},s),d.jsx("div",{className:"input-group cs-container context-menu",ref:this.csContainer,"data-testid":a,children:d.jsx("div",{className:F("input-group-append cs-dropdown",{"cs-dropdown-invalid":t}),children:d.jsxs("button",{type:"button",className:F("btn cs-btn form-control",{"cs-btn-invalid":t}),ref:this.button,onClick:this.toggleMenu,disabled:e,children:[d.jsx("span",{className:F({"text-muted":n===null}),children:this.getSelectedText()}),d.jsx("span",{children:d.jsx(se,{icon:_n,className:"cs-caret"})}),d.jsx(Hn,{isShown:i,actions:{menuElement:this.renderMenuElement()},popperOptions:s,popperClassName:"CustomTimeSelect",onMenuOpened:this.handleMenuOpened,onMenuClosed:this.handleMenuExited,menuStyle:{maxWidth:"100rem"}})]})})})}}be(te,"MENU_NAVIGATION_DIRECTION",Nt);be(te,"DROP_DOWN_MENU_HEIGHT",125);be(te,"defaultProps",{onChange(){},value:null,disabled:!1,popperOptions:{},icon:_i,customText:"Custom",placeholder:"Select a time",valueToTime:r=>r===null?0:Math.round(r/1e3),timeToValue:r=>r*1e3,invalid:!1,"data-testid":void 0});const Zl=te;var Ql=k.module("DateInput"),Jl="[12][0-9]{3}-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])",eu=["2000-01-01","2022-12-31"],tu="YYYY-MM-DD",ir=V.forwardRef((r,e)=>{var{className:t="",onChange:n=()=>{},defaultValue:a="",onFocus:i=()=>{},onBlur:s=()=>{},"data-testid":o}=r,[l,u]=c.useState(a),[f,h]=c.useState(),p=c.useCallback(v=>{Ql.debug("handleChange",v),u(v),n(v)},[n]);return d.jsx("div",{className:"d-flex flex-row align-items-center",children:d.jsx(Yt,{ref:e,className:F(t),example:eu,getNextSegmentValue:as,onChange:p,onSelect:h,pattern:Jl,placeholder:tu,selection:f,value:l,onFocus:i,onBlur:s,"data-testid":o})})});ir.displayName="DateInput";ir.defaultProps={className:"",onChange:()=>!1,defaultValue:"",onFocus:()=>!1,onBlur:()=>!1,"data-testid":void 0};const ru=ir;function Da(r,e,t){return e=nu(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function nu(r){var e=au(r,"string");return typeof e=="symbol"?e:String(e)}function au(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class Aa extends c.PureComponent{constructor(e){super(e),Da(this,"searchInput",void 0),this.searchInput=V.createRef(),this.handleChange=this.handleChange.bind(this),this.sendUpdate=we(this.sendUpdate.bind(this),e.debounceMs),this.state={value:e.value}}componentDidUpdate(e){var{value:t}=this.props;e.value!==t&&this.setState({value:t})}focus(){var e;(e=this.searchInput.current)===null||e===void 0||e.focus()}handleChange(e){this.setState({value:e.target.value},this.sendUpdate)}sendUpdate(){var{onChange:e}=this.props,{value:t}=this.state;e(t)}render(){var{placeholder:e,className:t,matchCount:n,id:a,"data-testid":i}=this.props,{value:s}=this.state;return d.jsx(Zt,{value:s,placeholder:e,onChange:this.handleChange,className:t,matchCount:n,ref:this.searchInput,id:a,"data-testid":i})}}Da(Aa,"defaultProps",{placeholder:"Search",className:"",matchCount:null,debounceMs:250,id:"","data-testid":void 0});const iu=Aa;function su(r){var{isInvalid:e=!1,items:t,onAdd:n=()=>{},onDelete:a=()=>{},validate:i=()=>null}=r,[s,o]=c.useState(null),[l,u]=c.useState([]),[f,h]=c.useState(""),p=c.useCallback(y=>{u(y)},[]),v=c.useCallback(()=>{a(wr.getItemsInRanges(t,l)),u([])},[t,l,a]),m=c.useCallback(()=>{if(f!==""){var y=i(f);y==null?(n(f),h("")):o(y)}},[f,n,i]),g=c.useCallback(y=>{var{value:C}=y.target;h(C),o(C===""?null:i(C))},[i]),b=c.useCallback(()=>{u([])},[]),E=c.useCallback(y=>{y.key==="Enter"&&m()},[m]),P=c.useMemo(()=>14+Ei(t.length,1,6)*xt.DEFAULT_ROW_HEIGHT,[t.length]);return d.jsxs("div",{className:F("editable-item-list-container",{"is-invalid":e}),children:[d.jsx("div",{style:{height:P},children:d.jsx(xt,{itemCount:t.length,items:t.map((y,C)=>({value:y,isSelected:wr.isSelected(l,C)})),offset:0,selectedRanges:l,onSelectionChange:p,isMultiSelect:!0})}),d.jsxs("div",{className:"d-flex flex-row pt-2",children:[d.jsx("div",{className:"d-flex flex-grow-1",children:d.jsx("input",{className:F("form-control",{"is-invalid":s!=null}),placeholder:"Enter value",type:"text",value:f,onChange:g,onFocus:b,onKeyDown:E})}),d.jsxs("div",{className:"d-flex align-items-start mt-1 ml-2",children:[d.jsx(pe,{kind:"ghost",onClick:m,disabled:s!=null||f==="",icon:Mi,tooltip:"Add new item","data-testid":"add-item-button"}),d.jsx(pe,{kind:"ghost",onClick:v,disabled:l.length===0,icon:Nn,tooltip:"Delete selected items","data-testid":"delete-item-button"})]})]})]})}function ou(r,e,t){return e=lu(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function lu(r){var e=uu(r,"string");return typeof e=="symbol"?e:String(e)}function uu(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class Me extends c.Component{static isParentSelected(e,t){var n=t.get(e);if(n===void 0)return!1;if(typeof n=="boolean")return n;var a=Array.from(n.values()).includes(!0),i=Array.from(n.values()).includes(!1);return a&&i?null:a}constructor(e){super(e),this.toggleMenu=this.toggleMenu.bind(this),this.toggleValueFor=this.toggleValueFor.bind(this),this.selectAll=this.selectAll.bind(this),this.clear=this.clear.bind(this),this.state={menuIsOpen:!1}}toggleMenu(e){e.stopPropagation(),e.preventDefault(),this.setState(t=>{var{menuIsOpen:n}=t;return{menuIsOpen:!n}})}toggleValueFor(e,t){var{valueMap:n,onUpdateValueMap:a}=this.props,i=new Map(n),s=i.get(e);if(s instanceof Map){var o=new Map(s);if(t!=null)o.set(t,s.get(t)===void 0);else{var l=Me.isParentSelected(e,i),u=l==null||!l;s.forEach((p,v)=>o.set(v,u))}i.set(e,o)}else i.set(e,s==null||!s);var f=i.get(e);if(t===void 0&&f!==void 0&&typeof f!="boolean"){var h=Me.isParentSelected(e,n);h!=null&&h?f.forEach((p,v)=>f.set(v,!1)):f.forEach((p,v)=>f.set(v,!0))}a(i)}setAllValues(e){var{valueMap:t,onUpdateValueMap:n}=this.props,a=new Map;t.forEach((i,s)=>{if(typeof i=="boolean")a.set(s,e);else{var o=new Map;i.forEach((l,u)=>o.set(u,e)),a.set(s,o)}}),n(a)}selectAll(){this.setAllValues(!0)}clear(){this.setAllValues(!1)}renderMenuElement(){var{valueMap:e,"data-testid":t}=this.props;return d.jsxs("div",{className:"hcm-menu-container",children:[Array.from(e.entries()).map(n=>{var[a,i]=n;return d.jsxs("div",{children:[d.jsx(Dt,{className:"hcm-parent",checked:Me.isParentSelected(a,e),onChange:()=>this.toggleValueFor(a),children:a}),i!==void 0&&typeof i!="boolean"&&Array.from(i.entries()).map(s=>{var[o,l]=s;return d.jsx(Dt,{className:"hcm-child",checked:l,onChange:()=>this.toggleValueFor(a,o),children:o},o)})]},a)}),d.jsx(pe,{kind:"ghost",onClick:this.selectAll,"data-testid":t!==void 0?"".concat(t,"-btn-select-all"):void 0,children:"Select All"}),d.jsx(pe,{kind:"ghost",onClick:this.clear,"data-testid":t!==void 0?"".concat(t,"-btn-clear"):void 0,children:"Clear"})]})}render(){var{menuText:e,className:t,icon:n,id:a,"data-testid":i}=this.props,{menuIsOpen:s}=this.state;return d.jsxs("button",{type:"button",className:F("btn hcm-btn",t),onClick:this.toggleMenu,id:a,"data-testid":i,children:[d.jsxs("span",{children:[n&&d.jsx(se,{icon:n,className:"hcm-icon mr-1"}),e]}),d.jsx(se,{icon:_n,className:"hcm-icon ml-1"}),d.jsx(Xt,{options:{placement:"bottom"},isShown:s,onExited:()=>{this.setState({menuIsOpen:!1})},closeOnBlur:!0,interactive:!0,children:this.renderMenuElement()})]})}}ou(Me,"defaultProps",{className:"",icon:null,id:"","data-testid":void 0});const cu=Me;var du=.025,fu=.9,hu=.1,pu=.618,yt=Pe["primary-dark"],Ur=80,vu=Pe["gray-800"],mu=Pe["gray-900"],Ee={SIZE:8,DOT_SIZE:2,FILL_OPACITY:.25},me=18,gu=250,bu=60*1e3,yu=V.memo(()=>{var r=c.useRef(null),e=c.useRef(null),[t,n]=c.useState(!1),a=window.devicePixelRatio,i,s,o,l,u,f=null,h=[];function p(){var S;e.current!=null&&(o=e.current.offsetWidth,l=e.current.offsetHeight),r.current!=null&&(r.current.style.width="".concat(o,"px"),r.current.style.height="".concat(l,"px"),r.current.width=o*a,r.current.height=l*a),(S=i)===null||S===void 0||S.scale(a,a)}function v(){var S=document.createElement("canvas");S.width=Ee.SIZE,S.height=Ee.SIZE;var D=S.getContext("2d");return D!=null&&(D.fillStyle=yt,D.fillRect(0,0,Ee.DOT_SIZE,Ee.DOT_SIZE),D.fillStyle=yt+Math.round(255*Ee.FILL_OPACITY).toString(16).padStart(2,"0"),D.fillRect(0,0,Ee.SIZE,Ee.SIZE)),D==null?void 0:D.createPattern(S,"repeat")}function m(S){var D=Math.random()-.5,I=du*D;return S<hu?I=Math.abs(I):S>fu&&(I=-Math.abs(I)),S+I}function g(){for(var S=[],D=pu,I=0;I<o+me;I+=1)D=m(D),S.push(D);return S}function b(){for(;h.length>=o+me;)h.pop();for(;h.length<o+me;)h.push(m(h[h.length-1]))}function E(S,D){D.beginPath(),D.moveTo(-1,l+1),D.lineTo(-1,l*S[0]);for(var I=0;I<S.length;I+=1)D.lineTo(I,l*S[I]);D.lineTo(o+me,l*S[S.length-1]),D.lineTo(o+me,l+1),D.closePath()}function P(S){S.beginPath();for(var D=1;D<o;D+=Ur)S.moveTo(D,0),S.lineTo(D,l);for(var I=1;I<l;I+=Ur)S.moveTo(0,I),S.lineTo(o,I)}function y(S){var D,I,J;f=(D=f)!==null&&D!==void 0?D:S,Ae(i),i.fillStyle=mu,i.fillRect(0,0,o,l),P(i),i.lineWidth=1,i.strokeStyle=vu,i.stroke();var ne=(((I=f)!==null&&I!==void 0?I:0)-(S??0))/(1e3/me);if(i.translate(ne,0),E(h,i),i.lineWidth=2,i.strokeStyle=yt,i.stroke(),i.translate(-ne,0),s!=null&&(i.fillStyle=s),i.fill(),i.setTransform(a,0,0,a,0,0),(S??0)-((J=f)!==null&&J!==void 0?J:0)>1e3/me){for(var j,G=Math.floor(((S??0)-((j=f)!==null&&j!==void 0?j:0))/(1e3/me)),U=0;U<G;U+=1)h.shift(),h.push(m(h[h.length-1]));f=S}u!=null&&cancelAnimationFrame(u),u=requestAnimationFrame(y)}var C=we(()=>{u=requestAnimationFrame(S=>{p(),b(),n(!1),y(S)})},gu,{leading:!0});function T(){n(!0),u!=null&&cancelAnimationFrame(u),u=null,f=null}var A=we(()=>{T()},bu);function O(){u==null&&(n(!1),p(),b(),u=requestAnimationFrame(y)),A()}function N(){document.hasFocus()&&O()}function M(){u!=null&&cancelAnimationFrame(u),A(),C()}return c.useEffect(()=>{var S;return i=(S=r.current)===null||S===void 0?void 0:S.getContext("2d",{alpha:!1}),p(),h=g(),s=v(),y(),A(),window.addEventListener("resize",M),window.addEventListener("focus",O),window.addEventListener("blur",T),window.addEventListener("mousemove",N),window.addEventListener("keydown",N),()=>{u!=null&&cancelAnimationFrame(u),window.removeEventListener("resize",M),window.removeEventListener("focus",O),window.removeEventListener("blur",T),window.removeEventListener("mousemove",N),window.removeEventListener("keydown",N),A.cancel(),C.cancel()}},[]),d.jsx("div",{className:"random-area-plot-animation-container",ref:e,children:d.jsx("canvas",{ref:r,className:t?"shade":""})})});const Na=yu;function Ia(r){var{text:e,placement:t="top-start"}=r,n=c.useMemo(()=>({placement:t}),[t]);return d.jsxs(d.Fragment,{children:[d.jsx(Pn,{UNSAFE_className:rr.spectrumEllipsis,children:e??d.jsx(d.Fragment,{children:" "})}),e==null||e===""?null:d.jsx(Gn,{options:n,children:e})]})}var Eu=["scrollRef","getItemDisplayText","getKey"];function Br(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(r,a).enumerable})),t.push.apply(t,n)}return t}function Hr(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Br(Object(t),!0).forEach(function(n){Su(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):Br(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function Su(r,e,t){return e=Tu(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Tu(r){var e=wu(r,"string");return typeof e=="symbol"?e:String(e)}function wu(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}function Pu(r,e){if(r==null)return{};var t=Ou(r,e),n,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(r);for(a=0;a<i.length;a++)n=i[a],!(e.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(r,n)&&(t[n]=r[n])}return t}function Ou(r,e){if(r==null)return{};var t={},n=Object.keys(r),a,i;for(i=0;i<n.length;i++)a=n[i],!(e.indexOf(a)>=0)&&(t[a]=r[a]);return t}function Cu(r){var{scrollRef:e,getItemDisplayText:t,getKey:n}=r,a=Pu(r,Eu),i=c.useCallback(s=>{var o=n(s),l=t(s);return d.jsx(Si,{textValue:l??String(o),children:d.jsx(Ia,{text:l})},o)},[t,n]);return d.jsx(Ti,Hr(Hr({},a),{},{ref:e,menuTrigger:"focus",onSelectionChange:a.onSelectionChange,children:i}))}var sr=V.forwardRef((r,e)=>{var{children:t,className:n,disabled:a,id:i,isLinked:s,isLinkedSource:o,isInvalid:l,onClick:u,onMouseEnter:f,onMouseLeave:h,style:p,"data-testid":v}=r;return d.jsxs("button",{ref:e,type:"button",className:F("btn-socketed",{"btn-socketed-linked":s!==void 0&&s||o},{"btn-socketed-linked-source":o},{"is-invalid":l},n),id:i,onClick:u,onMouseEnter:f,onMouseLeave:h,style:p,disabled:a,"data-testid":v,children:[t,d.jsx(se,{icon:Fi,className:"linked btn-socketed-icon",transform:"down-1"}),d.jsx(se,{icon:ki,className:"is-invalid btn-socketed-icon"})]})});sr.displayName="SocketedButton";sr.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 xu=sr,Du={"dh-spectrum-theme--dark":"_dh-spectrum-theme--dark_1qqxl_5"},Au={"dh-spectrum-theme--light":"_dh-spectrum-theme--light_oc9vy_5"};function Gr(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(r,a).enumerable})),t.push.apply(t,n)}return t}function qe(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Gr(Object(t),!0).forEach(function(n){Nu(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):Gr(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function Nu(r,e,t){return e=Iu(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Iu(r){var e=_u(r,"string");return typeof e=="symbol"?e:String(e)}function _u(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}var{global:Mu,light:Fu,dark:ku,medium:Lu,large:ju}=wi,Ru={global:Mu,light:qe(qe({},Fu),Au),dark:qe(qe({},ku),Du),medium:Lu,large:ju},$u=500;function Vu(r){var{heading:e,content:t,delayMs:n=$u}=r,[a,i]=c.useState(!1);return c.useEffect(()=>{window.setTimeout(()=>{i(!0)},n)},[n]),a?d.jsxs(Pi,{children:[d.jsx(Kt,{size:"XXL",children:d.jsx(se,{icon:Li})}),d.jsx(On,{children:e}),t==null?null:d.jsx(Cn,{children:t})]}):null}var Uu=k.module("ThemeProvider"),or=c.createContext(null);function _a(r){var{themes:e,children:t}=r,n=c.useMemo(()=>Mn(),[]),[a,i]=c.useState(()=>{var l,u;return(l=(u=Fn())===null||u===void 0?void 0:u.themeKey)!==null&&l!==void 0?l:kn}),s=c.useMemo(()=>e==null?null:Ln(a,{base:n,custom:e??[]}),[n,a,e]);c.useEffect(function(){Uu.debug("Active themes:",s==null?void 0:s.map(u=>u.themeKey)),jn({themeKey:a,preloadStyleContent:Rn()})},[s,a]);var o=c.useMemo(()=>({activeThemes:s,selectedThemeKey:a,setSelectedThemeKey:i}),[s,a]);return d.jsxs(or.Provider,{value:o,children:[s==null?void 0:s.map(l=>d.jsx("style",{"data-theme-key":l.themeKey,children:l.styleContent},l.themeKey)),t]})}function Bu(){return ot(or,"No ThemeContext value found. Component must be wrapped in a ThemeContext.Provider")}const Hu="_track_1ermw_30",Gu="_handle_1ermw_13",Wu="_ticks_1ermw_98",Ma={"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:Hu,"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:Gu,ticks:Wu,"tick-labels":"_tick-labels_1ermw_116","tick-label":"_tick-label_1ermw_116","tick-label-wrapper":"_tick-label-wrapper_1ermw_132"};var Xe=parseInt(Ma["handle-size"],10),Wr=parseInt(Ma["popover-width"],10),re=24*60*60-1,Kr=5*60;function Ku(r){var{startTime:e,endTime:t,onChange:n,isStartModified:a=!1,isEndModified:i=!1,"data-testid":s}=r,[o,l]=c.useState(e),[u,f]=c.useState(t),h=c.useRef(null);c.useEffect(function(){l(e),f(t)},[e,t]);var p=c.useCallback((g,b)=>{var E=g,P=b;E===P&&(P<re?P+=1:E-=1),l(E),f(P),n({startTime:E,endTime:P})},[l,f,n]),v=c.useCallback(g=>{p(g,u)},[p,u]),m=c.useCallback(g=>{p(o,g)},[p,o]);return d.jsxs("div",{className:"time-slider","data-testid":s,children:[d.jsx(zu,{startTime:o,endTime:u,onStartTimeChange:v,onEndTimeChange:m,isStartModified:a,isEndModified:i}),d.jsxs("div",{className:"track",ref:h,children:[d.jsx(qu,{startTime:o,endTime:u}),d.jsx("div",{className:"ticks",children:Array(24).fill(null).map((g,b)=>d.jsx("div",{className:"tick"},b))}),d.jsx(zr,{track:h,time:o,setTime:v}),d.jsx(zr,{track:h,time:u,setTime:m})]}),d.jsxs("div",{className:"tick-labels",children:[d.jsx("div",{className:"tick-label",children:"0:00"}),d.jsx("div",{className:"tick-label-wrapper",children:Array(24).fill(null).map((g,b)=>d.jsx("div",{className:"tick-label",children:"".concat(b+1,":00")},b))})]})]})}function zu(r){var{startTime:e,endTime:t,onStartTimeChange:n,onEndTimeChange:a,isStartModified:i,isEndModified:s,"data-testid":o}=r,l=e>t,[u,f]=c.useState(l?t:e),[h,p]=c.useState(l?e:t),v=c.useRef(null),m=c.useRef(null),g=c.useRef(null),b=c.useRef(null);c.useEffect(function(){f(e>t?t:e),p(e>t?e:t)},[e,t]),c.useEffect(function(){if(g.current!==null){var A;(A=m.current)===null||A===void 0||A.setSelection(g.current)}if(b.current!==null){var O;(O=v.current)===null||O===void 0||O.setSelection(b.current)}},[l]);function E(T){e<=t?n(T):a(T)}function P(T){e<=t?a(T):n(T)}var y=c.useCallback(T=>{g.current=T,b.current=null},[]),C=c.useCallback(T=>{g.current=null,b.current=T},[]);return d.jsxs("div",{className:"time-slider-popovers",children:[d.jsx("div",{className:"flex",style:{flexBasis:"calc(".concat(u/re*100,"% - ").concat(Wr/2,"px)")}}),d.jsxs("div",{className:"handle-popper",children:[d.jsx("label",{className:F({modified:l?s:i}),children:l?"End Time":"Start Time"}),d.jsx(nt,{ref:v,allowValueWrapping:!1,value:u,onChange:E,onSelect:y,"data-testid":o!==void 0?"".concat(o,"-input-1"):void 0})]}),d.jsx("div",{className:"flex-spacer"}),d.jsxs("div",{className:"handle-popper",children:[d.jsx("label",{className:F({modified:l?i:s}),children:l?"Start Time":"End Time"}),d.jsx(nt,{ref:m,allowValueWrapping:!1,value:h,onChange:P,onSelect:C,"data-testid":o!==void 0?"".concat(o,"-input-2"):void 0})]}),d.jsx("div",{className:"flex",style:{flexBasis:"calc(".concat((re-h)/re*100,"% - ").concat(Wr/2,"px)")}})]})}function qu(r){var{startTime:e,endTime:t,"data-testid":n}=r;return d.jsxs("div",{className:"track-fills","data-testid":n,children:[e>t&&d.jsxs(d.Fragment,{children:[d.jsx("div",{className:"track-fill track-fill-start",style:{transform:"scaleX(".concat(t/re,")")}}),d.jsx("div",{className:"track-fill track-fill-end",style:{transform:"scaleX(".concat((re-e)/re,")")}})]}),e<t&&d.jsx("div",{className:"track-fill track-fill-middle",style:{transform:"translateX(".concat(e/re*100,"%) scaleX(").concat((t-e)/re,")")}})]})}function zr(r){var{track:e,time:t,setTime:n,"data-testid":a}=r,i=c.useMemo(()=>{var p=3600,v=Xe/2;return t<p?v=t/p*(Xe/2):t>23*p&&(v=Xe/2+1/(re-23*p)*(t-23*p)*(Xe/2)),"translateX(calc(".concat(t/re*100,"% - ").concat(v,"px))")},[t]),s=c.useCallback(p=>{if(!e.current)return 0;var v=e.current.getBoundingClientRect(),m=Math.max(p-v.left,0),g=re*Math.min(1,m/v.width),b=Kr*Math.round(g/Kr),E=Math.min(re,b);return E},[e]),o=c.useCallback(p=>{var{clientX:v}=p;n(s(v))},[n,s]),l=c.useCallback(p=>{var{clientX:v}=p;n(s(v)),window.removeEventListener("mousemove",o),window.removeEventListener("mouseup",l),document.documentElement.classList.remove("drag-pointer-events-none")},[n,s,o]),u=c.useCallback(()=>{window.addEventListener("mousemove",o),window.addEventListener("mouseup",l),document.documentElement.classList.add("drag-pointer-events-none")},[o,l]),f=c.useCallback(()=>{window.removeEventListener("mousemove",o),window.removeEventListener("mouseup",l),document.documentElement.classList.remove("drag-pointer-events-none")},[o,l]),h=c.useCallback(()=>{u()},[u]);return c.useEffect(function(){return()=>{f()}},[f]),d.jsx("div",{className:"handle-track",style:{transform:i},children:d.jsx("button",{className:"handle",type:"button","aria-label":"Change time",onMouseDown:h,"data-testid":a})})}function Fa(r){var{buttons:e,isShown:t=!1,classNames:n,message:a,type:i,onClick:s,onDismiss:o,"data-testid":l}=r,u=e&&e.length!==0;return d.jsx(Je,{in:t,timeout:Pe.transitionMs,classNames:"toast-notification-slide-up",mountOnEnter:!0,unmountOnExit:!0,children:d.jsxs("div",{className:F("toast-notification",n,i),role:"presentation",onClick:s,onKeyPress:s,"data-testid":l,children:[d.jsx("div",{className:"message-container",children:d.jsx("span",{className:"message",children:a})}),d.jsx(Je,{in:u,timeout:Pe.transitionSlowMs,classNames:"fade",mountOnEnter:!0,unmountOnExit:!0,children:d.jsx("div",{className:"buttons-container",children:e})}),o&&d.jsx(pe,{kind:"ghost",icon:ji,tooltip:"Close notification",className:"my-2",onClick:o})]})})}Fa.TYPE=Object.freeze({ERROR:"error"});function Xu(r){var{children:e,className:t,labelText:n,hintText:a,isModified:i,validationError:s,showValidationError:o=!0,"data-testid":l,id:u}=r,{current:f}=c.useRef(u??We());return d.jsxs(d.Fragment,{children:[d.jsx("label",{className:F("validate-label",t,{modified:i}),htmlFor:f,"data-testid":l,children:n}),V.Children.toArray(e).map(h=>V.isValidElement(h)?V.cloneElement(h,{className:F(h.props.className,{"is-invalid":s})}):d.jsx("div",{className:F(t),children:h})),a!==void 0&&d.jsx("small",{className:"form-text text-muted",children:a}),s!==void 0&&o&&d.jsx("p",{className:"validate-label-error text-danger",children:s})]})}const Yu=Object.freeze(Object.defineProperty({__proto__:null,ActionButtonDialogTrigger:oa,AutoCompleteInput:Ml,AutoResizeTextarea:nr,BasicModal:ar,BulkActionBar:Vl,Button:pe,ButtonGroup:Ke,ButtonOld:Ll,CardFlip:Ul,Checkbox:Dt,Collapse:Gl,ComboBox:is,ConfirmActionButton:Tl,ConfirmationDialog:wa,ContextActionUtils:ss,ContextActions:os,ContextMenuItem:ls,ContextMenuRoot:us,CopyButton:cs,CustomTimeSelect:Zl,DEFAULT_DARK_THEME_KEY:kn,DEFAULT_GET_PREFERRED_REPLACEMENT_STRING:Bn,DEFAULT_LIGHT_THEME_KEY:Ri,DEFAULT_PRELOAD_DATA_VARIABLES:$i,DateInput:ru,DateTimeInput:ds,DebouncedModal:Fl,DebouncedSearchInput:iu,DragUtils:fs,DraggableItemList:hs,DropdownMenu:Hn,EditableItemList:su,GLOBAL_SHORTCUTS:ps,HierarchicalCheckboxMenu:cu,IconActionButton:Pa,InfoModal:kl,ItemList:xt,ItemListItem:vs,get KEY(){return ms},LoadingOverlay:Oe,LoadingSpinner:$n,get MODIFIER(){return gs},MaskedInput:Yt,Menu:bs,MenuItem:ys,Modal:zt,ModalBody:qt,ModalFooter:Oa,ModalHeader:In,Option:Es,Page:Ss,Popper:Xt,RadioGroup:Ts,RadioItem:ws,RandomAreaPlotAnimation:Na,SearchInput:Zt,SearchableCombobox:Cu,Select:Ps,SelectValueList:Wn,Shortcut:Os,ShortcutRegistry:Cs,SocketedButton:xu,Stack:xs,THEME_CACHE_LOCAL_STORAGE_KEY:Vi,TMP_CSS_PROP_PREFIX:Ui,TableViewEmptyState:Vu,TextWithTooltip:Ia,ThemeContext:or,ThemeExport:Pe,ThemeProvider:_a,TimeInput:nt,TimeSlider:Ku,ToastNotification:Fa,Tooltip:Gn,UISwitch:Ds,ValidateLabelInput:Xu,calculatePreloadStyleContent:Rn,extractDistinctCssVariableExpressions:Bi,fillToLength:As,getActiveThemes:Ln,getCssVariableRanges:Hi,getDefaultBaseThemes:Mn,getThemeKey:Vn,getThemePreloadData:Fn,preloadTheme:Gi,resolveCssVariablesInRecord:Wi,resolveCssVariablesInString:Ki,setThemePreloadData:jn,themeDHDefault:Ru,themeDark:zi,themeLight:qi,trimTrailingMask:Ns,useTheme:Bu},Symbol.toStringTag,{value:"Module"})),Zu=Object.freeze(Object.defineProperty({__proto__:null,ApiBootstrap:Xi,ApiContext:Un,ClientBootstrap:Kn,ClientContext:Is,useApi:ye,useClient:Re},Symbol.toStringTag,{value:"Module"}));function Qu(r){return function(t){var{children:n}=t;return d.jsx(Un.Provider,{value:r,children:n})}}function qr(r,e,t,n,a,i,s){try{var o=r[i](s),l=o.value}catch(u){t(u);return}o.done?e(l):Promise.resolve(l).then(n,a)}function Ju(r){return function(){var e=this,t=arguments;return new Promise(function(n,a){var i=r.apply(e,t);function s(l){qr(i,n,a,s,o,"next",l)}function o(l){qr(i,n,a,s,o,"throw",l)}s(void 0)})}}var Et=k.module("MessageUtils"),ka="io.deephaven.message.LoginOptions.request",La="io.deephaven.message.SessionDetails.request",ja="io.deephaven.broadcast",lr="io.deephaven.broadcast.Login",Ra="io.deephaven.broadcast.Logout";function ft(r){var e=r;return e!=null&&typeof e.id=="string"&&typeof e.message=="string"}function $a(r){return ft(r)&&r.message===lr}function Va(r){return ft(r)&&r.message===Ra}function Ua(r){var e=r;return e!=null&&typeof e.id=="string"}function ur(r){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:We(),t=arguments.length>2?arguments[2]:void 0;return{message:r,id:e,payload:t}}function ec(r,e){return{id:r,payload:e}}function cr(){return window.opener!=null?window.opener:window.parent!=null&&window.parent!==window?window.parent:null}function dr(r){return It.apply(this,arguments)}function It(){return It=Ju(function*(r){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:3e4,t=cr();if(t==null)throw new Error("window parent is null, unable to send request.");return new Promise((n,a)=>{var i,s=We(),o=l=>{var{data:u}=l;if(!Ua(u)){Et.debug("Ignoring non-deephaven response",u);return}if(Et.debug("Received message",u),(u==null?void 0:u.id)!==s){Et.debug("Ignore message, id doesn't match",u);return}window.clearTimeout(i),window.removeEventListener("message",o),n(u.payload)};window.addEventListener("message",o),i=window.setTimeout(()=>{window.removeEventListener("message",o),a(new _s("Request timed out"))},e),t.postMessage(ur(r,s),"*")})}),It.apply(this,arguments)}function tc(r,e,t){return e=rc(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function rc(r){var e=nc(r,"string");return typeof e=="symbol"?e:String(e)}function nc(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class Ba extends Error{constructor(){super(...arguments),tc(this,"isNoConsolesError",!0)}}function Ha(r){return r.isNoConsolesError}function Xr(r,e,t,n,a,i,s){try{var o=r[i](s),l=o.value}catch(u){t(u);return}o.done?e(l):Promise.resolve(l).then(n,a)}function ht(r){return function(){var e=this,t=arguments;return new Promise(function(n,a){var i=r.apply(e,t);function s(l){Xr(i,n,a,s,o,"next",l)}function o(l){Xr(i,n,a,s,o,"throw",l)}s(void 0)})}}var Ne=k.module("SessionUtils");function ac(r,e){return Ne.info("Starting connection to '".concat(e,"'...")),new r.IdeConnection(e)}function Ga(r,e,t){return _t.apply(this,arguments)}function _t(){return _t=ht(function*(r,e,t){Ne.info("Getting console types...");var n=yield e.getConsoleTypes();if(n.length===0)throw new Ba("No console types available");Ne.info("Available types:",n);var a=n[0];Ne.info("Starting session with type",a);var i=yield e.startSession(a),s={type:a,id:We.generate()};return Ne.info("Console session established",s),{session:i,config:s,connection:e,details:t,dh:r}}),_t.apply(this,arguments)}function ic(r,e,t){return Ne.info("createCoreClient",e),new r.CoreClient(e,t)}function sc(r){return r!=null&&typeof r=="object"}function oc(){return Mt.apply(this,arguments)}function Mt(){return Mt=ht(function*(){var r=yield dr(La);if(!sc(r))throw new Error("Unexpected session details response: ".concat(r));return r}),Mt.apply(this,arguments)}function lc(){return Ft.apply(this,arguments)}function Ft(){return Ft=ht(function*(){var r=new URLSearchParams(window.location.search);switch(r.get("authProvider")){case"parent":return oc()}return{}}),Ft.apply(this,arguments)}function uc(r,e,t){return kt.apply(this,arguments)}function kt(){return kt=ht(function*(r,e,t){var n;try{n=yield Ga(r,e,t)}catch(a){if(!Ha(a))throw a}return n}),kt.apply(this,arguments)}const cc=Object.freeze(Object.defineProperty({__proto__:null,BROADCAST_CHANNEL_NAME:ja,BROADCAST_LOGIN_MESSAGE:lr,BROADCAST_LOGOUT_MESSAGE:Ra,BooleanColumnFormatter:Ms,CharColumnFormatter:Fs,DateTimeColumnFormatter:ks,DateUtils:zn,DecimalColumnFormatter:Ls,DefaultColumnFormatter:js,FETCH_TIMEOUT:Rs,Formatter:lt,FormatterUtils:_e,IntegerColumnFormatter:$s,LOGIN_OPTIONS_REQUEST:ka,NoConsolesError:Ba,SESSION_DETAILS_REQUEST:La,StringColumnFormatter:Vs,TableColumnFormatter:Us,TableUtils:He,createComboboxFilterArgs:Bs,createConnection:ac,createCoreClient:ic,createFilterConditionFactory:Qt,createKeyFromOffsetRow:Hs,createNotNullOrEmptyFilterCondition:qn,createOnTableUpdatedHandler:Xn,createSearchTextFilter:Jt,createSelectedValuesFilter:er,createSessionWrapper:Ga,createShowOnlyEmptyFilterCondition:Yn,createValueFilter:Zn,defaultRowDeserializer:Qn,fetchVariableDefinition:Gs,generateEmptyKeyedItems:Jn,getColumnFormats:Ws,getDateTimeFormatterOptions:Ks,getSessionDetails:lc,getSize:tr,getWindowParent:cr,isBroadcastLoginMessage:$a,isBroadcastLogoutMessage:Va,isClosed:et,isCustomColumnFormatDefined:zs,isMessage:ft,isNoConsolesError:Ha,isResponse:Ua,loadSessionWrapper:uc,makeMessage:ur,makeResponse:ec,padFirstAndLastRow:ea,requestParentResponse:dr},Symbol.toStringTag,{value:"Module"}));var Yr=k.module("useTableListener"),dc=(r,e,t)=>c.useEffect(function(){if(r==null){Yr.debug2("Emitter undefined, skipping addEventListener",e);return}return Yr.debug2("Adding listener",e),r.addEventListener(e,t)},[r,e,t]);const Fe=dc;function fc(r,e,t){return e=hc(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function hc(r){var e=pc(r,"string");return typeof e=="symbol"?e:String(e)}function pc(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class vc extends Error{constructor(){super(...arguments),fc(this,"isColumnNameError",!0)}}const mc=vc;function gc(r,e,t){return e=bc(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function bc(r){var e=yc(r,"string");return typeof e=="symbol"?e:String(e)}function yc(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class Ec extends Error{constructor(){super(...arguments),gc(this,"isTableDisconnectError",!0)}}const Sc=Ec;var Ye=k.module("useTable"),Tc=(r,e,t,n)=>{var a=ye(),[i,s]=c.useState(void 0),[o,l]=c.useState([]),[u,f]=c.useState(null),[h,p]=c.useState(null);c.useEffect(()=>{if(n===void 0){s(r==null?void 0:r.columns),f(null);return}try{s(r==null?void 0:r.findColumns(n)),f(null)}catch(b){Ye.error("Column not found",b,n),f(new mc("Invalid columnNames argument"))}},[r,n]),c.useEffect(()=>{if(!i||!r){Ye.debug2("Table or column not initialized, skip viewport update.");return}Ye.debug2("Setting viewport",e,t),r.setViewport(e,t,i)},[i,r,e,t]);var v=c.useCallback(b=>{var{detail:E}=b;if(!i){Ye.error("Columns not initialized.");return}var P=i.map(y=>E.rows.map(C=>C.get(y)));l(P)},[i]),m=c.useCallback(()=>{p(new Sc("Table disconnected"))},[]),g=c.useCallback(()=>{p(null)},[]);return Fe(r,a.Table.EVENT_UPDATED,v),Fe(r,a.Table.EVENT_DISCONNECT,m),Fe(r,a.Table.EVENT_RECONNECT,g),{columns:i,data:o,error:h??u}};const Wa=Tc;var wc=(r,e,t,n)=>{var a=c.useMemo(()=>[n],[n]),{columns:i=[],data:s=[],error:o}=Wa(r,e,t,a);return{column:i[0],data:s[0],error:o}};const Ka=wc;function Zr(r,e,t,n,a,i,s){try{var o=r[i](s),l=o.value}catch(u){t(u);return}o.done?e(l):Promise.resolve(l).then(n,a)}function Pc(r){return function(){var e=this,t=arguments;return new Promise(function(n,a){var i=r.apply(e,t);function s(l){Zr(i,n,a,s,o,"next",l)}function o(l){Zr(i,n,a,s,o,"throw",l)}s(void 0)})}}var ue=k.module("TableInput"),St=250;function fr(r){var e,t,{className:n=void 0,columnName:a,settings:i,defaultValue:s=[],isInvalid:o=!1,onChange:l=()=>!1,onBlur:u=()=>!1,table:f}=r,h=c.useRef(null),p=ye(),v=c.useMemo(()=>{var _=_e.getColumnFormats(i),R=_e.getDateTimeFormatterOptions(i),{defaultDecimalFormatOptions:L={},defaultIntegerFormatOptions:ee={}}=i;return new lt(p,_,R,L,ee)},[p,i]),[m,g]=c.useState(""),[b,E]=c.useState(new Set(s)),[P,y]=c.useState(),C=c.useRef(null),T=Math.min((e=P==null?void 0:P.size)!==null&&e!==void 0?e:0,St),{column:A,data:O,error:N}=Ka(P,0,St-1,a),M=c.useCallback(_=>A?v.getFormattedString(_,A.type,A.name):"".concat(_),[A,v]),[S,D]=c.useMemo(()=>{var _=new Set(b),R=[];if(O==null)return[R,null];if(O.forEach(ee=>{var $e="".concat(ee),Sr=b.has($e);Sr&&_.delete($e),R.push({value:$e,displayValue:M(ee),isSelected:Sr})}),_.size>0){ue.debug2("Selection has items that are missing from the viewport");var L=new Set(b);return Array.from(_).forEach(ee=>{L.delete(ee)}),[R,L]}return[R,null]},[O,b,M]);c.useEffect(()=>{D!==null&&(E(D),l(Array.from(D)))},[l,D]);var I=c.useCallback(function(){var _=Pc(function*(R){try{var L=yield R;ue.debug("Table resolved",L),y(L)}catch(ee){if(Pr.isCanceled(ee))return;ue.error(ee)}});return function(R){return _.apply(this,arguments)}}(),[]);c.useEffect(()=>{var _=Pr.makeCancelable(f);return I(_),()=>{ue.debug2("Cancel table promise"),_.cancel()}},[f,I]);var J=c.useCallback(_=>{var{value:R}=_.target;g(R);var L=S.findIndex($e=>$e.displayValue.includes(R));if(L>-1){var ee;ue.debug2("Found ".concat(R," at index ").concat(L)),(ee=C.current)===null||ee===void 0||ee.scrollIntoView(L)}else ue.debug2("".concat(R," not found"))},[S,C]),ne=c.useCallback(_=>{if(ue.debug("handleSelect",_),_>=S.length){ue.error("Invalid index",_);return}var R=S[_].value,L=new Set(b);S[_].isSelected?L.delete(R):L.add(R),E(L),l(Array.from(L))},[l,S,b]),j=c.useCallback(()=>{var _=S.map(L=>L.value),R=new Set(_);E(R),l(_)},[S,l]),G=c.useCallback(()=>{E(new Set),l([])},[l]),U=c.useCallback(()=>{},[]),z=c.useCallback(_=>{var R,{relatedTarget:L}=_;ue.debug("handleChildBlur",L,L instanceof HTMLElement,h.current,(R=h.current)===null||R===void 0?void 0:R.contains(L)),(!L||h.current&&L instanceof HTMLElement&&!h.current.contains(L))&&u()},[u]),le=S.length===0;return d.jsxs("div",{ref:h,className:F("table-input-container d-flex flex-column position-relative",n),children:[d.jsx(Zt,{disabled:!!N||le,value:m,placeholder:"Search",onChange:J,className:"mb-2 d-flex",onBlur:z}),d.jsx(Wn,{className:"table-input-list",disabled:P===void 0||le,isInvalid:o,items:le?[{value:"Empty",isSelected:!1}]:S,itemCount:T,offset:0,onSelect:ne,onViewportChange:U,ref:C,onBlur:z}),P&&d.jsxs("div",{className:"meta-row",children:[d.jsx("div",{className:"d-flex align-items-center text-muted small",children:P!=null&&P.size>T&&d.jsxs(d.Fragment,{children:["Table is too large, showing the first ",St," items."]})}),d.jsxs("div",{children:[d.jsx("button",{type:"button",className:"btn btn-link",onBlur:z,onClick:j,children:"Select All"}),d.jsx("button",{type:"button",className:"btn btn-link mr-a",onBlur:z,onClick:G,children:"Clear"})]})]}),P==null||N&&d.jsx("div",{className:"h-100 w-100 position-absolute",children:d.jsx(Oe,{isLoaded:P!=null,isLoading:P==null&&N==null,errorMessage:(t=N==null?void 0:N.message)!==null&&t!==void 0?t:null})})]})}fr.displayName="TableInput";fr.defaultProps={isInvalid:!1,className:void 0};var Qr=k.module("useBroadcastChannel");function hr(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:qs,e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:ja,t=c.useMemo(()=>new BroadcastChannel(e),[e]);return c.useEffect(()=>()=>{t.close()},[t]),c.useEffect(()=>{function n(a){var{data:i}=a;if(!ft(i)){Qr.debug("Ignoring non-deephaven message",i);return}Qr.debug("event received",i),r(a)}return t.addEventListener("message",n),()=>{t.removeEventListener("message",n)}},[t,r]),t}function pt(r,e){var t=c.useCallback(n=>{$a(n.data)?r==null||r(n.data):Va(n.data)&&(e==null||e(n.data))},[r,e]);hr(t)}var at="io.deephaven.web.client.auth.refreshToken",za=c.createContext(null),Oc=k.module("RefreshTokenUtils");function Lt(){var r=Le.get(at);try{if(r!=null)return JSON.parse(r)}catch(e){Oc.error("Error parsing refresh token",r,e)}return null}function jt(r){if(r==null){Le.remove(at);return}var e=JSON.stringify({bytes:r.bytes,expiry:r.expiry}),t=new Date(r.expiry);Le.set(at,e,{secure:!0,sameSite:"strict",expires:t})}function qa(r){var{children:e}=r,t=ye(),n=Re(),[a,i]=c.useState(Lt());c.useEffect(function(){var u=n.addEventListener(t.CoreClient.EVENT_REFRESH_TOKEN_UPDATED,f=>{var{detail:h}=f;jt(h),i(h)});return u},[t,n,a]);var s=c.useCallback(()=>{i(Lt())},[]),o=c.useCallback(()=>{jt(null),i(null)},[]);return pt(s,o),d.jsx(za.Provider,{value:a,children:e})}function ve(){var r=ye();return c.useMemo(()=>new He(r),[r])}function Cc(r,e,t,n){var a=ve(),[i,s]=c.useState(""),o=ct(i,t),l=c.useCallback(p=>{s(p.trim())},[]),{data:u,isLoading:f}=Ge(a.doesColumnValueExist,[r,e,o,n]),h=f||i!==o?null:u;return{valueTrimmed:i,valueTrimmedDebounced:o,valueExists:h,trimAndUpdateValue:l}}var Jr=k.module("useDebouncedViewportSearch"),xc=200;function Dc(r,e){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:xc,n=ve(),{table:a,applyFiltersAndRefresh:i}=r,s=c.useMemo(()=>we(o=>{if(Jr.debug("Applying debounced searchText '".concat(o,"'")),a!=null){var l=o.trim();if(l===""){i([]);return}var u=a.findColumn(e),f=n.makeFilterValue(u.type,l),h=[u.filter().contains(f)];i(h)}},t),[i,e,t,a,n]);return c.useEffect(()=>()=>{Jr.debug("Cancelling debounced search function"),s.cancel()},[s]),s}var Xa=300;function Ac(r){var{viewportData:e,columnName:t,shouldSelectAllOnNoSelection:n,mapItemToValue:a}=r,i=ve(),s=ba(e,a),o=ct(s,Xa),l=va(o,ua);return c.useMemo(()=>er(i,t,l.selection,n,l.isInverted),[t,l,n,i])}function pr(r){for(var e=arguments.length,t=new Array(e>1?e-1:0),n=1;n<e;n++)t[n-1]=arguments[n];return c.useMemo(()=>Xs(...t.map(a=>a(r))),[r,...t])}function Nc(r,e,t,n){var a=c.useRef("");return a.current=t,c.useMemo(()=>{var i=r.length>0&&r[0].item==null;return!i&&n!=null&&(a.current===""||n.toLowerCase().includes(a.current.toLowerCase()))?[{key:n,item:{[e]:n}},...r]:r},[n,e,r])}function en(r,e,t,n,a,i,s){try{var o=r[i](s),l=o.value}catch(u){t(u);return}o.done?e(l):Promise.resolve(l).then(n,a)}function Ic(r){return function(){var e=this,t=arguments;return new Promise(function(n,a){var i=r.apply(e,t);function s(l){en(i,n,a,s,o,"next",l)}function o(l){en(i,n,a,s,o,"throw",l)}s(void 0)})}}function _c(r){var{table:e,columnName:t,defaultValue:n,itemHeight:a,topOffset:i=0,value:s}=r;return c.useCallback(Ic(function*(){if(e==null||s===""||s===n)return i;var o=e.findColumn(t),l=yield e.seekRow(0,o,"String",s),u=n==null?0:1;return(l+u)*a+i}),[t,n,a,e,i,s])}function vr(r){var[,e]=c.useState(0),t=ye();return Fe(r,t.Table.EVENT_SIZECHANGED,()=>{e(n=>n+1)}),tr(r)}var Mc=k.module("useInitializeViewportData");function Ya(r){var e=Sa({}),t=Math.max(0,vr(r));return c.useEffect(()=>{var n=e.items.length;t!==n&&(Mc.debug("size changed:",{currentSize:n,targetSize:t}),e.setItems(Array.from(Jn(0,t-1))))},[t,r]),e}function Za(r,e,t){return c.useCallback(function(a){var[i,s]=ea(a,e,t,tr(r));r==null||r.setViewport(i,s)},[r,t,e])}var tn=k.module("useViewportData");function mr(r){var{table:e,itemHeight:t=1,scrollDebounce:n=Bo,viewportSize:a=10,viewportPadding:i=50,deserializeRow:s=Qn}=r,o=Ya(e),l=Za(e,a,i),u=c.useCallback(g=>{e&&!et(e)?l(g):tn.debug("setViewport called on closed table.",e)},[e,l]),f=c.useCallback(g=>{e&&!et(e)?(e.applyFilter(g),u(0)):tn.debug("applyFiltersAndRefresh called on closed table.",e)},[u,e]),h=ye(),p=c.useMemo(()=>Xn(o,s),[s,o]);Fe(e,h.Table.EVENT_UPDATED,p);var v=vr(e);c.useEffect(()=>{u(0)},[e,u,v]);var m=ya(t,u,n);return c.useMemo(()=>({viewportData:o,size:v,table:e,applyFiltersAndRefresh:f,setViewport:u,onScroll:m}),[f,m,u,v,e,o])}function gr(r,e){var{applyFiltersAndRefresh:t}=r;c.useEffect(()=>{t(e)},[t,e])}function Fc(r,e){for(var t=ve(),[n,a]=c.useState(""),i=c.useMemo(()=>Jt(t,e,n),[e,n,t]),s=rt(a,aa),o=mr({table:r,itemHeight:Uo,viewportSize:ia,viewportPadding:sa}),l=arguments.length,u=new Array(l>2?l-2:0),f=2;f<l;f++)u[f-2]=arguments[f];var h=pr(o.table,i,...u);return gr(o,h),{list:o,onSearchTextChange:s}}function kc(r){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"or",t=ve(),n=c.useMemo(()=>qn(t),[t]);return c.useMemo(()=>Qt(r,n,e),[r,e,n])}function Qa(r){c.useEffect(()=>()=>{r!=null&&(et(r)||r.close())},[r])}function Lc(r,e,t){for(var n=ve(),[a,i]=c.useState(""),[s,o]=c.useState(""),[l,u]=c.useState(null),[f,h]=c.useState(()=>new Map),{data:p,isLoading:v}=Ge(n.doesColumnValueExist,[r,e,s,!1]),m=v||s!==a?null:p,g=c.useMemo(()=>Jt(n,e,s),[e,s,n]),b=c.useMemo(()=>er(n,e,new Set(f.keys()),!1,!0),[e,f,n]),E=arguments.length,P=new Array(E>3?E-3:0),y=3;y<E;y++)P[y-3]=arguments[y];var{data:C}=Ge(n.createDistinctSortedColumnTable,[r,e,"asc",...P]);Qa(C);var T=mr({table:C,itemHeight:Vo,viewportSize:ia,viewportPadding:sa}),A=a.length>0&&T.size===0,O=f.has(a),N=rt(o,aa),M=c.useCallback(j=>{i(j),N(j)},[N]),S=rt(u,0),D=c.useCallback(j=>{if(i(""),o(""),u(j),S(null),j!=null){var G=T.viewportData.findItem(j);if(G!=null){var U=t(G);h(z=>{var le=new Map(z);return le.set(U,{value:U}),le})}}},[S,T.viewportData,t]),I=c.useCallback(j=>{h(G=>{if(j.size===0)return G;var U=new Map(G);for(var z of j)U.set(z,{value:z});return U})},[]),J=c.useCallback(j=>{h(G=>{if(j==="all")return new Map;var U=new Map(G);for(var z of j)U.delete(z);return U})},[]),ne=pr(T.table,g,b);return gr(T,ne),c.useMemo(()=>({list:T,hasSearchTextWithZeroResults:A,searchText:a,searchTextExists:m,searchTextIsInSelectedValues:O,selectedKey:l,selectedValueMap:f,onSearchTextChange:M,onSelectKey:D,onAddValues:I,onRemoveValues:J}),[A,T,I,J,M,D,a,m,O,l,f])}function rn(r,e,t,n,a,i,s){try{var o=r[i](s),l=o.value}catch(u){t(u);return}o.done?e(l):Promise.resolve(l).then(n,a)}function jc(r){return function(){var e=this,t=arguments;return new Promise(function(n,a){var i=r.apply(e,t);function s(l){rn(i,n,a,s,o,"next",l)}function o(l){rn(i,n,a,s,o,"throw",l)}s(void 0)})}}function Rc(r){for(var e=arguments.length,t=new Array(e>1?e-1:0),n=1;n<e;n++)t[n-1]=arguments[n];var a=c.useCallback(jc(function*(){var u;return(u=r==null?void 0:r.selectDistinct(r.findColumns(t)))!==null&&u!==void 0?u:null}),[r,...t]),{data:i,error:s,isError:o,isLoading:l}=Ge(a,[]);return c.useEffect(()=>()=>{i==null||i.close()},[i]),{distinctTable:i,error:s,isError:o,isLoading:l}}function $c(r,e){var t=ve(),n=c.useMemo(()=>Yn(t,r),[r,t]);return c.useMemo(()=>Qt(e,n),[e,n])}function Vc(r,e,t){var n=ve();return c.useMemo(()=>Zn(n,r,e,t),[r,t,n,e])}const Uc=Object.freeze(Object.defineProperty({__proto__:null,DEBOUNCE_MS:Xa,REFRESH_TOKEN_KEY:at,RefreshTokenBootstrap:qa,RefreshTokenContext:za,TableInput:fr,makeApiContextWrapper:Qu,readRefreshToken:Lt,storeRefreshToken:jt,useBroadcastChannel:hr,useBroadcastLoginListener:pt,useCheckIfExistsValue:Cc,useDebouncedViewportSearch:Dc,useDebouncedViewportSelectionFilter:Ac,useFilterConditionFactories:pr,useFilteredItemsWithDefaultValue:Nc,useGetItemPosition:_c,useInitializeViewportData:Ya,useNotNullOrEmptyFilter:kc,usePickerWithSelectedValues:Lc,useSearchableViewportData:Fc,useSelectDistinctTable:Rc,useSetPaddedViewportCallback:Za,useShowOnlyEmptyFilter:$c,useTable:Wa,useTableClose:Qa,useTableColumn:Ka,useTableListener:Fe,useTableSize:vr,useTableUtils:ve,useValueFilter:Vc,useViewportData:mr,useViewportFilter:gr},Symbol.toStringTag,{value:"Module"}));var Ja=c.createContext(!1);function Bc(r){var{fontClassNames:e=["fira-sans-regular","fira-sans-semibold","fira-mono"],children:t}=r,[n,a]=c.useState(!1);return c.useEffect(function(){document.fonts.ready.then(()=>{a(!0)})},[]),d.jsxs(d.Fragment,{children:[d.jsx(Ja.Provider,{value:n,children:t}),d.jsx("div",{id:"preload-fonts",style:{visibility:"hidden",position:"absolute",top:-1e4},children:e.map(i=>d.jsx("p",{className:i,children:"preload"},i))})]})}var vt=Object.freeze({AUTH_PLUGIN:"AuthPlugin",DASHBOARD_PLUGIN:"DashboardPlugin",WIDGET_PLUGIN:"WidgetPlugin",TABLE_PLUGIN:"TablePlugin",THEME_PLUGIN:"ThemePlugin"});function Hc(r){return"DashboardPlugin"in r}function Rt(r){return"AuthPlugin"in r}function ei(r){return"TablePlugin"in r}function Gc(r){return Hc(r)||Rt(r)||ei(r)}function Wc(r){return"type"in r&&r.type===vt.TABLE_PLUGIN}function Kc(r){return"type"in r&&r.type===vt.AUTH_PLUGIN}function zc(r){return"type"in r&&r.type===vt.THEME_PLUGIN}function qc(r){if(r==null)return!1;var e=r;return e.Component!==void 0&&typeof e.isAvailable=="function"}var ti="io.deephaven.auth.AnonymousAuthenticationHandler",Xc="io.deephaven.authentication.psk.PskAuthenticationHandler";function nn(r,e,t){return e=Yc(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Yc(r){var e=Zc(r,"string");return typeof e=="symbol"?e:String(e)}function Zc(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class Qc extends Error{constructor(){super(...arguments),nn(this,"name","AuthenticationError"),nn(this,"isAuthenticationError",!0)}}const ri=Qc;function an(r,e,t,n,a,i,s){try{var o=r[i](s),l=o.value}catch(u){t(u);return}o.done?e(l):Promise.resolve(l).then(n,a)}function Jc(r){return function(){var e=this,t=arguments;return new Promise(function(n,a){var i=r.apply(e,t);function s(l){an(i,n,a,s,o,"next",l)}function o(l){an(i,n,a,s,o,"throw",l)}s(void 0)})}}var sn=k.module("AuthPluginBase");function br(r){var{children:e,getLoginOptions:t}=r,n=Re(),[a,i]=c.useState(),[s,o]=c.useState(!1);return c.useEffect(()=>{var l=!1;function u(){if(l)throw new Ys("Login canceled.")}function f(){return h.apply(this,arguments)}function h(){return h=Jc(function*(){try{var p=yield t();u(),sn.info("Logging in..."),yield n.login(p),u(),o(!0)}catch(g){if(!l){var v;sn.error("Unable to login:",g);var m=(v=je(g))!==null&&v!==void 0?v:"Unable to login. Verify credentials.";i(new ri(m)),o(!1)}}}),h.apply(this,arguments)}return f(),()=>{l=!0}},[n,t]),s?d.jsx(d.Fragment,{children:e}):d.jsx(Oe,{"data-testid":"auth-base-loading",isLoading:a==null,isLoaded:!1,errorMessage:je(a)})}var ed={canLogout:!1};function td(r){var{children:e}=r,t=ye(),n=c.useCallback(()=>({type:t.CoreClient.LOGIN_TYPE_ANONYMOUS}),[t]);return d.jsx(br,{getLoginOptions:n,children:d.jsx(ut.Provider,{value:ed,children:e})})}var rd={Component:td,isAvailable:r=>r.includes(ti)};const ni=rd;function on(r,e,t,n,a,i,s){try{var o=r[i](s),l=o.value}catch(u){t(u);return}o.done?e(l):Promise.resolve(l).then(n,a)}function nd(r){return function(){var e=this,t=arguments;return new Promise(function(n,a){var i=r.apply(e,t);function s(l){on(i,n,a,s,o,"next",l)}function o(l){on(i,n,a,s,o,"throw",l)}s(void 0)})}}var ad=k.module("AuthPluginParent"),id={canLogout:!1};function sd(r){return r!=null&&typeof r.type=="string"}function od(){return $t.apply(this,arguments)}function $t(){return $t=nd(function*(){ad.info("Logging in by delegating to parent window...");var r=yield dr(ka);if(!sd(r))throw new Error("Unexpected login options response: ".concat(r));return r}),$t.apply(this,arguments)}function ld(){var r;return(r=new URLSearchParams(window.location.search).get("authProvider"))!==null&&r!==void 0?r:""}function ud(r){var{children:e}=r;return d.jsx(br,{getLoginOptions:od,children:d.jsx(ut.Provider,{value:id,children:e})})}var cd={Component:ud,isAvailable:()=>cr()!=null&&ld()==="parent"};const ai=cd;function ii(r){var{children:e,errorMessage:t,isLoggingIn:n=!1,onSubmit:a}=r;return d.jsxs("form",{className:"login-form",onSubmit:i=>{i.preventDefault(),i.stopPropagation(),a==null||a(i)},children:[d.jsx("div",{className:"flex-spacer"}),d.jsxs("div",{className:"flex-wrapper",children:[d.jsx("fieldset",{disabled:n,className:"container-fluid",children:e}),d.jsx("div",{className:"form-group d-flex justify-content-end align-items-center mb-0",children:d.jsxs("button",{type:"submit",className:F("btn btn-primary",{"btn-spinner":n},{"btn-cancelable":n}),"data-testid":"btn-login",children:[n&&d.jsxs("span",{children:[d.jsx($n,{className:"loading-spinner-vertical-align"}),d.jsx("span",{className:"btn-normal-content",children:"Logging in"}),d.jsx("span",{className:"btn-hover-content",children:"Cancel"})]}),!n&&"Login"]})})]}),d.jsx("div",{className:"flex-spacer",children:t!=null&&d.jsx("p",{className:"error-message mb-0",role:"alert",children:"".concat(t)})})]})}function si(r){var{children:e,logoPath:t="./logo.png"}=r;return d.jsxs("div",{className:"login-container",children:[d.jsx(Na,{}),d.jsxs("div",{className:"login-box",children:[d.jsx("div",{className:"logo",children:d.jsx("img",{src:t,alt:"Deephaven Data Labs"})}),e,d.jsxs("p",{className:"footer",children:["© 2016-",new Date().getFullYear()," Deephaven Data Labs LLC. Patent Pending."]})]})]})}function ln(r,e,t,n,a,i,s){try{var o=r[i](s),l=o.value}catch(u){t(u);return}o.done?e(l):Promise.resolve(l).then(n,a)}function Tt(r){return function(){var e=this,t=arguments;return new Promise(function(n,a){var i=r.apply(e,t);function s(l){ln(i,n,a,s,o,"next",l)}function o(l){ln(i,n,a,s,o,"throw",l)}s(void 0)})}}var Vt="io.deephaven.authentication.psk.PskAuthenticationHandler",oi="psk",Ut="io.deephaven.web.client.auth.psk.token",Ie=k.module("AuthPluginPsk");function dd(){return new URLSearchParams(window.location.search).get(oi)}function fd(){Ie.debug2("clearWindowToken");var r=new URL(window.location.href);r.searchParams.delete(oi),window.history.replaceState(null,"",r.href)}function un(){var r;return(r=Le.get(Ut))!==null&&r!==void 0?r:null}function wt(r){Ie.debug2("Storing token in cookie",r),r!=null?Le.set(Ut,r,{secure:!0,sameSite:"strict"}):Le.remove(Ut)}function hd(r){var{children:e,logoPath:t}=r,n=Re(),a=c.useRef(null),i=c.useRef(null),[s,o]=c.useState(),[l,u]=c.useState(!1),[f,h]=c.useState(!1),[p,v]=c.useState(!1),[m,g]=c.useState(""),b=c.useCallback(function(){var T=Tt(function*(A){var O=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;Ie.info("Logging in..."),v(!0);var N=null;try{if(N=n.login({type:Vt,token:A}),i.current=N,yield N,Ie.info("Logged in successfully"),i.current!==N)return;wt(A),h(!0)}catch(D){if(i.current!==N)return;if(u(!0),O){var M;Ie.error("Unable to login",D);var S=(M=je(D))!==null&&M!==void 0?M:"Unable to login: Verify credentials.";o(new ri(S))}}v(!1)});return function(A){return T.apply(this,arguments)}}(),[n]),E=c.useCallback(()=>{i.current=null,v(!1)},[]),P=c.useCallback(Tt(function*(){Ie.debug("onLogin");var T=un();f||p||T==null||b(T,!1)}),[f,p,b]),y=c.useCallback(()=>{wt(null)},[]);pt(P,y),c.useEffect(()=>{var T=!1;function A(){return O.apply(this,arguments)}function O(){return O=Tt(function*(){var N,M=(N=dd())!==null&&N!==void 0?N:un();if(fd(),M==null){u(!0);return}v(!0);try{yield n.login({type:Vt,token:M}),T||(wt(M),h(!0),v(!1))}catch{T||(u(!0),v(!1))}}),O.apply(this,arguments)}return A(),()=>{T=!0}},[n]);var C=c.useCallback(()=>{p?E():b(m)},[E,p,b,m]);return c.useEffect(function(){var A;(A=a.current)===null||A===void 0||A.focus()},[a,l]),d.jsxs(d.Fragment,{children:[f&&e,l&&d.jsx(Je,{in:!f,timeout:Pe.transitionMs,classNames:"fade",mountOnEnter:!0,unmountOnExit:!0,children:d.jsx(si,{logoPath:t,children:d.jsx(ii,{errorMessage:je(s),isLoggingIn:p,onSubmit:C,children:d.jsxs("div",{className:"form-group",children:[d.jsx("label",{htmlFor:"auth-psk-token-input",children:"Token"}),d.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:a,value:m,onChange:T=>{o(void 0),g(T.target.value)}})]})})})}),d.jsx(Oe,{"data-testid":"auth-psk-loading",isLoaded:f||l,isLoading:!f&&!l})]})}var pd={Component:hd,isAvailable:r=>r.includes(Vt)};const li=pd;function cn(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(r,a).enumerable})),t.push.apply(t,n)}return t}function Pt(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?cn(Object(t),!0).forEach(function(n){vd(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):cn(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function vd(r,e,t){return e=md(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function md(r){var e=gd(r,"string");return typeof e=="symbol"?e:String(e)}function gd(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}var bd=k.module("UserUtils");function ui(r,e){return r.get("internal.webClient.appInit.".concat(e))}function ci(r){var e,t,n,a,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};function o(b){return ui(r,b)}function l(b,E){var P=o(b);return P==="true"?!0:P==="false"?!1:(P!==void 0&&bd.warn("Unexpected value for ".concat(b,": ").concat(P)),E)}var u=(e=o("name"))!==null&&e!==void 0?e:"",f=(t=o("operateAs"))!==null&&t!==void 0?t:u,h=(n=(a=o("groups"))===null||a===void 0?void 0:a.split(","))!==null&&n!==void 0?n:[],p=l("canCopy",!0),v=l("canDownloadCsv",!0),m=l("canUsePanels",!0),g=l("canLogout",!0);return Pt(Pt({name:u,operateAs:f,groups:h},i),{},{permissions:Pt({canUsePanels:m,canCopy:p,canDownloadCsv:v,canLogout:g},s)})}const yd=Object.freeze(Object.defineProperty({__proto__:null,AUTH_HANDLER_TYPE_ANONYMOUS:ti,AUTH_HANDLER_TYPE_PSK:Xc,AuthPluginAnonymous:ni,AuthPluginBase:br,AuthPluginParent:ai,AuthPluginPsk:li,Login:si,LoginForm:ii,UserContext:ta,UserOverrideContext:ra,UserPermissionsOverrideContext:ut,getAppInitValue:ui,getUserFromConfig:ci,isAuthPlugin:qc},Symbol.toStringTag,{value:"Module"}));tt.register([Fo,ko,Lo,jo,Ro,$o]);function Q(r,e,t){return e=Ed(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Ed(r){var e=Sd(r,"string");return typeof e=="symbol"?e:String(e)}function Sd(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class B{constructor(e){Q(this,"dh",void 0),Q(this,"listeners",void 0),Q(this,"formatter",void 0),Q(this,"rect",void 0),Q(this,"isDownsamplingDisabled",void 0),Q(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(B.EVENT_UPDATED,{detail:e}))}fireDisconnect(){this.fireEvent(new CustomEvent(B.EVENT_DISCONNECT))}fireReconnect(){this.fireEvent(new CustomEvent(B.EVENT_RECONNECT))}fireDownsampleStart(e){this.fireEvent(new CustomEvent(B.EVENT_DOWNSAMPLESTARTED,{detail:e}))}fireDownsampleFinish(e){this.fireEvent(new CustomEvent(B.EVENT_DOWNSAMPLEFINISHED,{detail:e}))}fireDownsampleFail(e){this.fireEvent(new CustomEvent(B.EVENT_DOWNSAMPLEFAILED,{detail:e}))}fireDownsampleNeeded(e){this.fireEvent(new CustomEvent(B.EVENT_DOWNSAMPLENEEDED,{detail:e}))}fireLoadFinished(){this.fireEvent(new CustomEvent(B.EVENT_LOADFINISHED))}}Q(B,"EVENT_UPDATED","ChartModel.EVENT_UPDATED");Q(B,"EVENT_DISCONNECT","ChartModel.EVENT_DISCONNECT");Q(B,"EVENT_RECONNECT","ChartModel.EVENT_RECONNECT");Q(B,"EVENT_DOWNSAMPLESTARTED","ChartModel.EVENT_DOWNSAMPLESTARTED");Q(B,"EVENT_DOWNSAMPLEFINISHED","ChartModel.EVENT_DOWNSAMPLEFINISHED");Q(B,"EVENT_DOWNSAMPLEFAILED","ChartModel.EVENT_DOWNSAMPLEFAILED");Q(B,"EVENT_DOWNSAMPLENEEDED","ChartModel.EVENT_DOWNSAMPLENEEDED");Q(B,"EVENT_LOADFINISHED","ChartModel.EVENT_LOADFINISHED");const ae=B,Td="#76d9e4 #9edc6f #fcd65b #aa9af4 #f37e3f #f95d84 #f0f0ee",wd="#403e41",Pd="#5b5a5c",Od="#c0bfbf",Cd="#4878ea",xd="rgba(91, 90, 92, 0.7)",q={"paper-bgcolor":"#2d2a2e","plot-bgcolor":"#322f33","title-color":"#f0f0ee",colorway:Td,gridcolor:wd,linecolor:Pd,zerolinecolor:Od,activecolor:Cd,rangebgcolor:xd,"area-color":"#76d9e4","trend-color":"#d5f0c1","line-color":"#9edc6f","error-band-line-color":"white","error-band-fill-color":"rgba(213, 240, 193, 0.1)","ohlc-increasing":"#9edc6f","ohlc-decreasing":"#f95d84"},H=Object.freeze({paper_bgcolor:q["paper-bgcolor"],plot_bgcolor:q["plot-bgcolor"],title_color:q["title-color"],colorway:q.colorway,gridcolor:q.gridcolor,linecolor:q.linecolor,zerolinecolor:q.zerolinecolor,activecolor:q.activecolor,rangebgcolor:q.rangebgcolor,area_color:q["area-color"],trend_color:q["trend-color"],line_color:q["line-color"],error_band_line_color:q["error-band-line-color"],error_band_fill_color:q["error-band-fill-color"],ohlc_increasing:q["ohlc-increasing"],ohlc_decreasing:q["ohlc-decreasing"]});function dn(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(r,a).enumerable})),t.push.apply(t,n)}return t}function Ce(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?dn(Object(t),!0).forEach(function(n){K(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):dn(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function K(r,e,t){return e=Dd(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Dd(r){var e=Ad(r,"string");return typeof e=="symbol"?e:String(e)}function Ad(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}var Ue=k.module("ChartUtils"),fn="io.deephaven.time.DateTime",Nd=36e5,Id=1e6;function _d(r){return r.asDate!==void 0}function Md(r){return r.asNumber!==void 0}function hn(r){return r.dhTimeZone!==void 0}function Fd(r){return r!=null&&r.range!=null&&(r.autorange===!1||r.autorange===void 0)}class w{static getPlotlyErrorBars(e,t,n){var a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:H,i=n.map((o,l)=>o-e[l]),s=t.map((o,l)=>e[l]-o);return{type:"data",symmetric:!1,array:i,arrayminus:s,color:a.error_band_line_color}}static convertNumberPrefix(e){return e.replace(/\u00A4\u00A4/g,"USD").replace(/\u00A4/g,"$")}static getPlotlyNumberFormat(e,t,n){if(!n)return null;var a=n.split(";"),i=a[0].match(/^([^#,0.]*)([#,]*)([0,]*)(\.?)(0*)(#*)(E?0*)(%?)(.*)/);Ae(i);var[,s,o,l,,u,f,h,p,v]=i,m=l.replace(",","").length,g=o.indexOf(",")>=0||l.indexOf(",")>=0,b=g?",":"",E=h!=null&&h!==""?"e":"f",P=p!==""?p:E,y=u.length+f.length,C="",T="0".concat(m).concat(b,".").concat(y).concat(C).concat(P),A=w.convertNumberPrefix(s),O=w.convertNumberPrefix(v);return{tickformat:T,tickprefix:A,ticksuffix:O,automargin:!0}}static addTickSpacing(e,t,n){var{gapBetweenMajorTicks:a}=t;if(a>0){var i=e||{},s=a;return n&&(s=a/Id),t.log&&(s=Math.log(s)),i.tickmode="linear",i.dtick=s,i}return e}static getSourceForAxis(e,t){for(var n=0;n<e.series.length;n+=1)for(var a=e.series[n],i=0;i<a.sources.length;i+=1){var s=a.sources[i];if(s.axis===t)return s}return null}static getSeriesVisibility(e,t){return t!=null&&t.hiddenSeries!=null&&t.hiddenSeries.includes(e)?"legendonly":!0}static getHiddenLabels(e){return e!=null&&e.hiddenSeries?[...e.hiddenSeries]:[]}static makeSeriesData(e,t,n,a){var i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:w.ORIENTATION.VERTICAL;return{type:e,mode:t,name:n,orientation:i,showlegend:a??void 0}}static getMarkerSymbol(e){switch(e){case"SQUARE":return"square";case"CIRCLE":return"circle";case"DIAMOND":return"diamond";case"UP_TRIANGLE":return"triangle-up";case"DOWN_TRIANGLE":return"triangle-down";case"RIGHT_TRIANGLE":return"triangle-right";case"LEFT_TRIANGLE":return"triangle-left";case"ELLIPSE":case"HORIZONTAL_RECTANGLE":case"VERTICAL_RECTANGLE":default:throw new Error("Unrecognized shape ".concat(e))}}static getAllAxes(e){return e.charts.reduce((t,n)=>[...t,...n.axes],[])}static getChartForSeries(e,t){for(var{charts:n}=e,a=0;a<n.length;a+=1)for(var i=n[a],s=0;s<i.series.length;s+=1)if(t===i.series[s])return i;return null}static getLayoutRanges(e){for(var t={},n=Object.keys(e).filter(o=>o.indexOf("axis")>=0),a=0;a<n.length;a+=1){var i=n[a],s=e[i];Fd(s)&&(t[i]=[...s.range])}return t}static getAxisLayoutProperty(e,t){var n=t>0?"".concat(t+1):"";return"".concat(e??"","axis").concat(n)}static periodToDecimal(e){var t=e.split(":");return Number(t[0])+Number(t[1])/60}static groupArray(e,t){return e.reduce((n,a)=>{var i,s=a[t],o=(i=n.get(s))!==null&&i!==void 0?i:[];return o.push(a),n.set(s,o),n},new Map)}static getColorwayFromTheme(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:H,t=[];return e.colorway&&(Array.isArray(e.colorway)?t=e.colorway:typeof e.colorway=="string"?t=e.colorway.split(" "):Ue.warn("Unable to handle colorway property: ".concat(e.colorway))),t}static titleFromSettings(e){var{series:t,xAxis:n,title:a="".concat((t??[]).join(", ")," by ").concat(n)}=e;return a}constructor(e){K(this,"dh",void 0),K(this,"daysOfWeek",void 0),this.dh=e,this.daysOfWeek=Object.freeze(e.calendar.DayOfWeek.values())}getAxisFormats(e,t){for(var n=this,a=new Map,i={tickformat:null,ticksuffix:null},s=w.getAllAxes(e),o=w.groupArray(s,"type"),{charts:l}=e,u=0;u<l.length;u+=1)for(var f=l[u],h=0;h<f.series.length;h+=1)for(var p=f.series[h],{sources:v}=p,m=v.filter(P=>P.axis),g=function(){var y=m[b],{axis:C}=y,{type:T}=C,A=o.get(T);Ae(A);var O=A.indexOf(C),N=n.getAxisPropertyName(T);if(N!=null){var M=w.getAxisLayoutProperty(N,O);if(a.has(M))Ue.debug("".concat(M," already added."));else{Ue.debug("Adding ".concat(M," to axisFormats."));var S=n.getPlotlyAxisFormat(y,t);if(S===null)a.set(M,i);else{a.set(M,S);var{businessCalendar:D}=C;if(D!=null){var I=[],{businessPeriods:J,businessDays:ne,holidays:j,timeZone:G}=D,U=t==null?void 0:t.getColumnTypeFormatter(fn),z;hn(U)&&(z=U.dhTimeZone);var le=z?(G.standardOffset-z.standardOffset)/60:0;j.length>0&&I.push(...n.createRangeBreakValuesFromHolidays(j,G,z)),J.forEach(_=>I.push({pattern:"hour",bounds:[w.periodToDecimal(_.close)+le,w.periodToDecimal(_.open)+le]})),ne.length<n.daysOfWeek.length&&n.createBoundsFromDays(ne).forEach(_=>I.push({pattern:"day of week",bounds:_})),S.rangebreaks=I}if(a.size===f.axes.length)return{v:a}}}}},b=0;b<m.length;b+=1){var E=g();if(typeof E=="object")return E.v}return a}getPlotlyChartType(e,t){var{dh:n}=this;switch(e){case n.plot.SeriesPlotStyle.SCATTER:return t?"scatter":"scattergl";case n.plot.SeriesPlotStyle.LINE:return"scatter";case n.plot.SeriesPlotStyle.BAR:case n.plot.SeriesPlotStyle.STACKED_BAR:return"bar";case n.plot.SeriesPlotStyle.PIE:return"pie";case n.plot.SeriesPlotStyle.TREEMAP:return"treemap";case n.plot.SeriesPlotStyle.HISTOGRAM:return"histogram";case n.plot.SeriesPlotStyle.OHLC:return"ohlc";default:return}}getPlotlyChartMode(e,t,n){var{dh:a}=this,i=new Set;switch(e){case a.plot.SeriesPlotStyle.SCATTER:(t??!1)&&i.add(w.MODE_LINES),(n??!0)&&i.add(w.MODE_MARKERS);break;case a.plot.SeriesPlotStyle.LINE:(t??!0)&&i.add(w.MODE_LINES),(n??!1)&&i.add(w.MODE_MARKERS);break}return i.size>0?[...i].join("+"):void 0}getPlotlyProperty(e,t){var{dh:n}=this;switch(e){case n.plot.SeriesPlotStyle.PIE:switch(t){case n.plot.SourceType.X:return"labels";case n.plot.SourceType.Y:return"values"}break;case n.plot.SeriesPlotStyle.OHLC:switch(t){case n.plot.SourceType.TIME:return"x"}break;case n.plot.SeriesPlotStyle.TREEMAP:switch(t){case n.plot.SourceType.X:return"ids";case n.plot.SourceType.Y:return"values";case n.plot.SourceType.LABEL:return"labels";case n.plot.SourceType.PARENT:return"parents";case n.plot.SourceType.COLOR:return"marker.colors"}break}switch(t){case n.plot.SourceType.X:return"x";case n.plot.SourceType.Y:return"y";case n.plot.SourceType.Z:return"z";case n.plot.SourceType.X_LOW:return"xLow";case n.plot.SourceType.X_HIGH:return"xHigh";case n.plot.SourceType.Y_LOW:return"yLow";case n.plot.SourceType.Y_HIGH:return"yHigh";case n.plot.SourceType.TIME:return"time";case n.plot.SourceType.OPEN:return"open";case n.plot.SourceType.HIGH:return"high";case n.plot.SourceType.LOW:return"low";case n.plot.SourceType.CLOSE:return"close";case n.plot.SourceType.SHAPE:return"shape";case n.plot.SourceType.SIZE:return"size";case n.plot.SourceType.LABEL:return"label";case n.plot.SourceType.COLOR:return"color";case n.plot.SourceType.PARENT:return"parent";case n.plot.SourceType.HOVER_TEXT:return"hovertext";case n.plot.SourceType.TEXT:return"text";default:throw new Error("Unrecognized source type: ".concat(t))}}getPlotlySeriesOrientation(e){var t,n,{dh:a}=this,{sources:i}=e;return i.length===2&&((t=i[0])===null||t===void 0||(n=t.axis)===null||n===void 0?void 0:n.type)===a.plot.AxisType.Y?w.ORIENTATION.HORIZONTAL:w.ORIENTATION.VERTICAL}makeSeriesDataFromSeries(e,t,n){var a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null,i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:H,{name:s,isLinesVisible:o,isShapesVisible:l,plotStyle:u,lineColor:f,shapeColor:h,sources:p,shape:v,shapeSize:m}=e,g=p.some(C=>{var T;return(T=C.axis)===null||T===void 0?void 0:T.businessCalendar}),b=this.getChartType(u,g),E=this.getPlotlyChartMode(u,o??void 0,l??void 0),P=this.getPlotlySeriesOrientation(e),y=w.makeSeriesData(b,E,s,a,P);return this.addSourcesToSeriesData(y,u,p,t),this.addStylingToSeriesData(y,u,i,f,h,v,m,n),y}addSourcesToSeriesData(e,t,n,a){for(var i=e,s=0;s<n.length;s+=1){var o=n[s],{axis:l,type:u}=o,f=this.getPlotlyProperty(t,u);xn(i,f,[]);var h=l!=null?this.getAxisPropertyName(l.type):null;if(h!=null){var p=a.get(l.type);if(p){var v=p.indexOf(l),m=v>0?"".concat(v+1):"";i["".concat(h,"axis")]="".concat(h).concat(m)}}}}addStylingToSeriesData(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:H,a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null,i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:null,s=arguments.length>5&&arguments[5]!==void 0?arguments[5]:null,o=arguments.length>6&&arguments[6]!==void 0?arguments[6]:null,l=arguments.length>7&&arguments[7]!==void 0?arguments[7]:null,{dh:u}=this,f=e;if(f.marker={line:{}},f.line={width:1},t===u.plot.SeriesPlotStyle.AREA?f.fill="tozeroy":t===u.plot.SeriesPlotStyle.STACKED_AREA?f.stackgroup="stack":t===u.plot.SeriesPlotStyle.STEP?f.line.shape="hv":t===u.plot.SeriesPlotStyle.HISTOGRAM?(f.width=[],f.marker.line!==void 0&&Object.assign(f.marker.line,{color:n.paper_bgcolor,width:1})):t===u.plot.SeriesPlotStyle.OHLC?(f.increasing={line:{color:n.ohlc_increasing}},f.decreasing={line:{color:n.ohlc_decreasing}}):t===u.plot.SeriesPlotStyle.PIE?(f.textinfo="label+percent",f.outsidetextfont={color:n.title_color}):t===u.plot.SeriesPlotStyle.TREEMAP&&(f.hoverinfo="text",f.textinfo="label+text",f.tiling={packing:"squarify",pad:0},f.textposition="middle center",f.outsidetextfont={color:n.title_color}),a!=null&&(t===u.plot.SeriesPlotStyle.BAR?f.marker.color=a:f.line.color=a),i!=null&&(f.marker.color=i),s!=null&&s.length>0)try{f.marker.symbol=w.getMarkerSymbol(s)}catch(h){Ue.warn("Unable to handle shape",s,":",h)}o!=null&&(f.marker.size=o*w.DEFAULT_MARKER_SIZE),l!=null&&t!==u.plot.SeriesPlotStyle.PIE&&(f.visible=l)}getChartType(e,t){var{dh:n}=this;switch(e){case n.plot.SeriesPlotStyle.HISTOGRAM:return"bar";default:return this.getPlotlyChartType(e,t)}}getAxisPropertyName(e){var{dh:t}=this;switch(e){case t.plot.AxisType.X:return"x";case t.plot.AxisType.Y:return"y";default:return null}}getAxisSide(e){var{dh:t}=this;switch(e){case t.plot.AxisPosition.BOTTOM:return"bottom";case t.plot.AxisPosition.TOP:return"top";case t.plot.AxisPosition.LEFT:return"left";case t.plot.AxisPosition.RIGHT:return"right";default:return}}updateFigureAxes(e,t,n){for(var a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0,s=arguments.length>5&&arguments[5]!==void 0?arguments[5]:H,o=e,l=w.getAllAxes(t),u=0;u<t.charts.length;u+=1){var f=t.charts[u],h=n==null?void 0:n(f),p=this.getChartBounds(t,f,a,i);this.updateLayoutAxes(o,f.axes,l,a,i,p,h,s)}this.removeStaleAxes(o,l)}getChartBounds(e,t,n,a){var i,{dh:s}=this,{cols:o,rows:l}=e,{column:u,colspan:f,row:h,rowspan:p}=t,v=u+f,m=h+p,g=1/o,b=1/l,E=w.AXIS_SIZE_PX/n,P=w.AXIS_SIZE_PX/a,y={bottom:(l-m)*b+(m<l?P/2:0),top:(l-h)*b-(h>0?P/2:0),left:u*g+(u>0?E/2:0),right:v*g-(v<o?E/2:0)},C=w.groupArray(t.axes,"position"),T=(i=C.get(s.plot.AxisPosition.RIGHT))!==null&&i!==void 0?i:[];return T.length>0&&(n>0?y.right-=(y.right-y.left)*Math.max(0,Math.min(w.LEGEND_WIDTH_PX/n,w.MAX_LEGEND_SIZE)):y.right-=(y.right-y.left)*w.DEFAULT_AXIS_SIZE),y}getPlotlyDateFormat(e,t,n){var{dh:a}=this,i=n==null?void 0:n.replace("%","%%").replace(/S{9}/g,"%9f").replace(/S{8}/g,"%8f").replace(/S{7}/g,"%7f").replace(/S{6}/g,"%6f").replace(/S{5}/g,"%5f").replace(/S{4}/g,"%4f").replace(/S{3}/g,"%3f").replace(/S{2}/g,"%2f").replace(/S{1}/g,"%1f").replace(/y{4}/g,"%Y").replace(/y{2}/g,"%y").replace(/M{4}/g,"%B").replace(/M{3}/g,"%b").replace(/M{2}/g,"%m").replace(/M{1}/g,"%-m").replace(/E{4,}/g,"%A").replace(/E{1,}/g,"%a").replace(/d{2}/g,"%d").replace(/([^%]|^)d{1}/g,"$1%-d").replace(/H{2}/g,"%H").replace(/h{2}/g,"%I").replace(/h{1}/g,"%-I").replace(/m{2}/g,"%M").replace(/s{2}/g,"%S").replace("'T'","T").replace(" z",""),s,o=e==null?void 0:e.getColumnTypeFormatter(t);return o!=null&&hn(o)&&o.dhTimeZone!=null&&o.showTimeZone&&(s=a.i18n.DateTimeFormat.format(" z",new Date,o.dhTimeZone)),{tickformat:i,ticksuffix:s,automargin:!0}}getPlotlyAxisFormat(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null,{dh:n}=this,{axis:a,columnType:i}=e,{formatPattern:s}=a,o=null;return He.isDateType(i)?(o=this.getPlotlyDateFormat(t,i,s),o=w.addTickSpacing(o,a,!0)):He.isNumberType(i)&&(o=w.getPlotlyNumberFormat(t,i,s),o=w.addTickSpacing(o,a,!1)),a.formatType===n.plot.AxisFormatType.CATEGORY&&(o?o.type="category":o={type:"category",tickformat:void 0,ticksuffix:void 0}),o}updateLayoutAxes(e,t,n){for(var a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0,s=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{left:0,top:0,right:1,bottom:1},o=arguments.length>6?arguments[6]:void 0,l=arguments.length>7&&arguments[7]!==void 0?arguments[7]:H,{dh:u}=this,f=a>0?Math.max(w.MIN_AXIS_SIZE,Math.min(w.AXIS_SIZE_PX/i,w.MAX_AXIS_SIZE)):w.DEFAULT_AXIS_SIZE,h=i>0?Math.max(w.MIN_AXIS_SIZE,Math.min(w.AXIS_SIZE_PX/a,w.MAX_AXIS_SIZE)):w.DEFAULT_AXIS_SIZE,p=e,v=w.groupArray(t,"position"),m=w.groupArray(t,"type"),g=[...m.keys()],b=w.groupArray(n,"type"),E=0;E<g.length;E+=1){var P=g[E],y=this.getAxisPropertyName(P);if(y!=null){var C=m.get(P),T=b.get(P),A=P===u.plot.AxisType.Y,O=A?i:a;Ae(C),Ae(T);for(var N=0;N<C.length;N+=1){var M=C[N],S=T.indexOf(M),D=w.getAxisLayoutProperty(y,S);p[D]==null&&(p[D]=this.makeLayoutAxis(P,l));var I=p[D];if(I!=null){this.updateLayoutAxis(I,M,N,v,f,h,s);var{range:J,autorange:ne}=I;if(o!=null&&J!==void 0&&(ne===void 0||ne===!1)){var j=o(M),[G,U]=j(J);Ue.debug("Setting downsample range",O,G,U),M.range(O,G,U)}else M.range(O)}}}}}removeStaleAxes(e,t){for(var n=e,a=w.groupArray(t,"type"),i=[...a.keys()],s=0;s<i.length;s+=1){var o=i[s],l=a.get(o);Ae(l);var u=l.length,f=this.getAxisPropertyName(o);if(f!=null)for(var h=w.getAxisLayoutProperty(f,u);n[h]!=null;)delete n[h],u+=1,h=w.getAxisLayoutProperty(f,u)}}updateLayoutAxis(e,t,n,a,i,s,o){var l,{dh:u}=this,f=t.type===u.plot.AxisType.Y,h=f?s:i,p=e,v=(l=t.label)!==null&&l!==void 0?l:"";if(p.title!==void 0&&typeof p.title!="string"?p.title.text=v:p.title={text:v},t.log&&(p.type="log"),p.side=this.getAxisSide(t.position),n>0){var m,g;p.overlaying=(m=this.getAxisPropertyName(t.type))!==null&&m!==void 0?m:void 0;var b=(g=a.get(t.position))!==null&&g!==void 0?g:[],E=b.indexOf(t);E>0&&(p.anchor="free",t.position===u.plot.AxisPosition.RIGHT?p.position=o.right+(E-b.length+1)*h:t.position===u.plot.AxisPosition.TOP?p.position=o.top+(E-b.length+1)*h:t.position===u.plot.AxisPosition.BOTTOM?p.position=o.bottom+(b.length-E+1)*h:t.position===u.plot.AxisPosition.LEFT&&(p.position=o.left+(b.length-E+1)*h))}else if(t.type===u.plot.AxisType.X){var P=a.get(u.plot.AxisPosition.LEFT)||[],y=a.get(u.plot.AxisPosition.RIGHT)||[],C=Math.max(o.left,o.left+(P.length-1)*s),T=Math.min(o.right-(y.length-1)*s,o.right);p.domain=[C,T]}else if(t.type===u.plot.AxisType.Y){var A=a.get(u.plot.AxisPosition.BOTTOM)||[],O=a.get(u.plot.AxisPosition.TOP)||[],N=Math.max(o.bottom,o.bottom+(A.length-1)*i),M=Math.min(o.top-(O.length-1)*i,o.top);p.domain=[N,M]}}createBoundsFromDays(e){var t=e.map(s=>this.daysOfWeek.indexOf(s)),n=this.daysOfWeek.filter(s=>!e.includes(s)).map(s=>this.daysOfWeek.indexOf(s)),a=new Set;n.forEach(s=>{for(var o=s+1;o<s+this.daysOfWeek.length;o+=1){var l=o%this.daysOfWeek.length;if(t.includes(l)){a.add(l);break}}});var i=[];return a.forEach(s=>{for(var o=s-1;o>s-this.daysOfWeek.length;o-=1){var l=o<0?o+this.daysOfWeek.length:o;if(t.includes(l)){var u=(l+1)%7;i.push([u,s]);break}}}),i}createRangeBreakValuesFromHolidays(e,t,n){var a=[],i=[];return e.forEach(s=>{s.businessPeriods.length>0?i.push(...this.createPartialHoliday(s,t,n)):a.push(this.createFullHoliday(s,t,n))}),[{values:a},...i]}createFullHoliday(e,t,n){return this.adjustDateForTimeZone("".concat(e.date.toString()," 00:00:00.000000"),t,n)}createPartialHoliday(e,t,n){var a=e.date.toString(),i=["00:00"];e.businessPeriods.forEach(p=>{i.push(p.open),i.push(p.close)}),i.push("24:00");for(var s=[],o=0;o<i.length;o+=2){var l=i[o],u=i[o+1];if(l!==u){var f=[this.adjustDateForTimeZone("".concat(a," ").concat(l,":00.000000"),t,n)],h=Nd*(w.periodToDecimal(u)-w.periodToDecimal(l));s.push({values:f,dvalue:h})}}return s}adjustDateForTimeZone(e,t,n){return n&&n.standardOffset!==t.standardOffset?this.unwrapValue(this.wrapValue(e,fn,t),n):e}makeFigureSettings(e,t){var{dh:n}=this,{series:a,xAxis:i,type:s}=e,o=w.titleFromSettings(e),l={formatType:"".concat(n.plot.AxisFormatType.NUMBER),type:"".concat(n.plot.AxisType.X),position:"".concat(n.plot.AxisPosition.BOTTOM)},u={formatType:"".concat(n.plot.AxisFormatType.NUMBER),type:"".concat(n.plot.AxisType.Y),position:"".concat(n.plot.AxisPosition.LEFT)};return{charts:[{chartType:"".concat(n.plot.ChartType.XY),axes:[l,u],series:(a??[]).map(f=>({plotStyle:"".concat(s),name:f,dataSources:[{type:"".concat(n.plot.SourceType.X),columnName:i??"",axis:l,table:t},{type:"".concat(n.plot.SourceType.Y),columnName:f,axis:u,table:t}]}))}],title:o}}unwrapValue(e,t){var{dh:n}=this;if(e!=null){if(_d(e))return n.i18n.DateTimeFormat.format(w.DATE_FORMAT,e,t);if(Md(e))return e.asNumber()}return e}wrapValue(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,{dh:a}=this;if(He.isDateType(t)&&typeof e=="string"){var i=e,s=w.DATE_FORMAT.substr(0,e.length),o=a.i18n.DateTimeFormat.parse(s,i);if(!n)return o;var l="".concat(s," Z"),u=a.i18n.DateTimeFormat.format("Z",o,n),f=a.i18n.DateTimeFormat.parse(l,"".concat(i," ").concat(u)),h=a.i18n.DateTimeFormat.format("Z",f,n);return a.i18n.DateTimeFormat.parse(l,"".concat(i," ").concat(h))}return e}makeLayoutAxis(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:H,{dh:n}=this,a={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===n.plot.AxisType.X?Object.assign(a,{showgrid:!0}):e===n.plot.AxisType.Y&&Object.assign(a,{zerolinecolor:t.zerolinecolor,zerolinewidth:2}),a}makeDefaultLayout(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:H,{dh:t}=this,n=Ce(Ce({},e),{},{autosize:!0,colorway:w.getColorwayFromTheme(e),font:{family:"'Fira Sans', sans-serif",color:e.title_color},title:{font:{color:e.title_color},yanchor:"top",pad:Ce({},w.DEFAULT_TITLE_PADDING),y:1},legend:{font:{color:e.title_color}},margin:Ce({},w.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 n.datarevision=0,n}hydrateSettings(e){var{dh:t}=this;return Ce(Ce({},e),{},{type:e.type!=null?t.plot.SeriesPlotStyle[e.type]:void 0})}}K(w,"DEFAULT_AXIS_SIZE",.15);K(w,"MIN_AXIS_SIZE",.025);K(w,"MAX_AXIS_SIZE",.2);K(w,"AXIS_SIZE_PX",75);K(w,"LEGEND_WIDTH_PX",50);K(w,"MAX_LEGEND_SIZE",.25);K(w,"ORIENTATION",Object.freeze({HORIZONTAL:"h",VERTICAL:"v"}));K(w,"DATE_FORMAT","yyyy-MM-dd HH:mm:ss.SSSSSS");K(w,"DEFAULT_MARGIN",Object.freeze({l:60,r:50,t:30,b:60,pad:0}));K(w,"DEFAULT_TITLE_PADDING",Object.freeze({t:8}));K(w,"SUBTITLE_LINE_HEIGHT",25);K(w,"DEFAULT_MARKER_SIZE",6);K(w,"MODE_MARKERS","markers");K(w,"MODE_LINES","lines");const W=w;function pn(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(r,a).enumerable})),t.push.apply(t,n)}return t}function vn(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?pn(Object(t),!0).forEach(function(n){Y(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):pn(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function Y(r,e,t){return e=kd(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function kd(r){var e=Ld(r,"string");return typeof e=="symbol"?e:String(e)}function Ld(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}var ge=k.module("Chart");class Se extends c.Component{static convertIcon(e){var[t,,,,n]=e.icon,a="".concat(n);return{width:t,path:a,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),Y(this,"currentSeries",void 0),Y(this,"PlotComponent",void 0),Y(this,"plot",void 0),Y(this,"plotWrapper",void 0),Y(this,"columnFormats",void 0),Y(this,"dateTimeFormatterOptions",void 0),Y(this,"decimalFormatOptions",void 0),Y(this,"integerFormatOptions",void 0),Y(this,"rect",void 0),Y(this,"ranges",void 0),Y(this,"isSubscribed",void 0),Y(this,"isLoadedFired",void 0),Y(this,"getCachedConfig",Ct((t,n,a,i,s)=>{var o=[],l=!!t;if(l&&o.push({name:"Downsampling failed: ".concat(t),title:"Downsampling failed",click:()=>{},icon:Se.convertIcon(Yi),attr:"fill-warning"}),n||a||i||l){var u=Se.downsampleButtonTitle(a,i),f=Se.downsampleButtonAttr(a,i),h=a?Zi:Qi;o.push({name:u,title:"Downsampling status",icon:Se.convertIcon(h),click:this.handleDownsampleClick,attr:f})}var p=s.some(b=>{var{type:E}=b;return E!=null&&!E.includes("3d")}),v=s.some(b=>{var{type:E}=b;return E!=null&&E.includes("3d")}),m=["zoomIn2d","zoomOut2d","autoScale2d","resetScale2d"],g=["orbitRotation","tableRotation","resetCameraDefault3d"];return{displaylogo:!1,displayModeBar:a||l?!0:"hover",modeBarButtons:[o,["toImage"],["zoom2d","pan2d"],[...p?m:[],...v?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.handleRestyle=this.handleRestyle.bind(this),this.PlotComponent=Ze(e.Plotly),this.plot=V.createRef(),this.plotWrapper=V.createRef(),this.columnFormats=[],this.dateTimeFormatterOptions={},this.decimalFormatOptions={},this.integerFormatOptions={},this.isSubscribed=!1,this.isLoadedFired=!1,this.currentSeries=0,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)}componentDidUpdate(e){var{isActive:t,model:n,settings:a}=this.props;this.updateFormatterSettings(a),n!==e.model&&(this.unsubscribe(e.model),this.subscribe(n)),t!==e.isActive&&(t?this.subscribe(n):this.unsubscribe(n))}componentWillUnmount(){var{model:e}=this.props;this.unsubscribe(e)}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:vn(vn({},t),e.getLayout())})}subscribe(e){if(!this.isSubscribed){if(!this.rect||this.rect.width===0||this.rect.height===0){ge.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:n}=e;switch(ge.debug2("Received data update",t,n),t){case ae.EVENT_UPDATED:{this.currentSeries+=1,this.setState(h=>{var{layout:p,revision:v}=h;return typeof p.datarevision=="number"&&(p.datarevision+=1),{data:n,layout:p,revision:v+1}});var{onUpdate:a}=this.props;a({isLoading:!this.isLoadedFired});break}case ae.EVENT_LOADFINISHED:{var{onUpdate:i}=this.props;this.isLoadedFired=!0,i({isLoading:!1});break}case ae.EVENT_DISCONNECT:{var{onDisconnect:s}=this.props;s();break}case ae.EVENT_RECONNECT:{var{onReconnect:o}=this.props;o();break}case ae.EVENT_DOWNSAMPLESTARTED:{this.setState({isDownsampleFinished:!1,isDownsampleInProgress:!0,downsamplingError:null});break}case ae.EVENT_DOWNSAMPLEFINISHED:{this.setState({isDownsampleFinished:!0,isDownsampleInProgress:!1,downsamplingError:null});break}case ae.EVENT_DOWNSAMPLENEEDED:case ae.EVENT_DOWNSAMPLEFAILED:{var l,u=(l=n.message)!==null&&l!==void 0?l:n;this.setState({isDownsampleFinished:!1,isDownsampleInProgress:!1,isDownsamplingDisabled:!1,downsamplingError:u});var{onError:f}=this.props;f(new Error(u));break}default:ge.debug("Unknown event type",t,e)}}handlePlotUpdate(e){var{layout:t}=e,n=W.getLayoutRanges(t),a=!Ve(n,this.ranges);a&&(this.ranges=n,this.updateModelDimensions(!0))}handleRelayout(e){if(ge.debug("handleRelayout",e),e.hiddenlabels!=null){var{onSettingsChanged:t}=this.props,n=[...e.hiddenlabels];t({hiddenSeries:n})}this.updateModelDimensions()}handleRestyle(e){var[t,n]=e;if(ge.debug("handleRestyle",t,n),Object.keys(t).includes("visible")){var{data:a}=this.state,{onSettingsChanged:i}=this.props;if(a!=null){var s=a.reduce((o,l)=>{var{name:u,visible:f}=l;return u!=null&&f==="legendonly"?[...o,u]:o},[]);i({hiddenSeries:s})}}}updateModelDimensions(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,t=this.getPlotRect();if(!t){ge.warn("Unable to get plotting rect");return}var n=!this.rect||this.rect.width!==t.width||this.rect.height!==t.height;if(n||e){this.rect=t;var{isActive:a,model:i}=this.props;i.setDimensions(t),a&&this.subscribe(i)}}initFormatter(){var{settings:e}=this.props;this.updateFormatterSettings(e)}updateFormatterSettings(e){var t=_e.getColumnFormats(e),n=_e.getDateTimeFormatterOptions(e),{decimalFormatOptions:a={},integerFormatOptions:i={}}=e;(!Ve(this.columnFormats,t)||!Ve(this.dateTimeFormatterOptions,n)||!Ve(this.decimalFormatOptions,a)||!Ve(this.integerFormatOptions,i))&&(this.columnFormats=_e.getColumnFormats(e),this.dateTimeFormatterOptions=n,this.decimalFormatOptions=a,this.integerFormatOptions=i,this.updateFormatter())}updateFormatter(){var{model:e}=this.props,t=new lt(e.dh,this.columnFormats,this.dateTimeFormatterOptions,this.decimalFormatOptions,this.integerFormatOptions);e.setFormatter(t)}updateDimensions(){var e=this.getPlotRect(),{Plotly:t}=this.props;this.plot.current!=null&&e!=null&&e.width>0&&e.height>0&&t.relayout(this.plot.current.el,{autosize:!0}).catch(n=>{ge.debug("Unable to resize, promise rejected",n)})}render(){var{PlotComponent:e}=this,{data:t,downsamplingError:n,isDownsampleFinished:a,isDownsampleInProgress:i,isDownsamplingDisabled:s,layout:o,revision:l}=this.state,u=this.getCachedConfig(n,a,i,s,t??[]),f=t!=null;return d.jsx("div",{className:"h-100 w-100 chart-wrapper",ref:this.plotWrapper,children:f&&d.jsx(e,{ref:this.plot,data:t,layout:o,revision:l,config:u,onAfterPlot:this.handleAfterPlot,onError:ge.error,onRelayout:this.handleRelayout,onUpdate:this.handlePlotUpdate,onRestyle:this.handleRestyle,useResizeHandler:!0,style:{height:"100%",width:"100%"}})})}}Y(Se,"defaultProps",{isActive:!0,settings:{timeZone:"America/New_York",defaultDateTimeFormat:zn.FULL_DATE_FORMAT,showTimeZone:!1,showTSeparator:!0,formatter:[]},Plotly:tt,onDisconnect:()=>{},onReconnect:()=>{},onUpdate:()=>{},onError:()=>{},onSettingsChanged:()=>{}});const jd=Se;function mn(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(r,a).enumerable})),t.push.apply(t,n)}return t}function gn(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?mn(Object(t),!0).forEach(function(n){$(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):mn(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function $(r,e,t){return e=Rd(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Rd(r){var e=$d(r,"string");return typeof e=="symbol"?e:String(e)}function $d(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}var X=k.module("FigureChartModel");class mt extends ae{constructor(e,t){var n,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:H;super(e),n=this,$(this,"chartUtils",void 0),$(this,"dh",void 0),$(this,"figure",void 0),$(this,"settings",void 0),$(this,"theme",void 0),$(this,"data",void 0),$(this,"layout",void 0),$(this,"seriesDataMap",void 0),$(this,"pendingSeries",void 0),$(this,"oneClicks",void 0),$(this,"filterColumnMap",void 0),$(this,"lastFilter",void 0),$(this,"isConnected",void 0),$(this,"seriesToProcess",void 0),$(this,"addPendingSeries",we(()=>{for(var o=W.getAllAxes(this.figure),{pendingSeries:l}=this,u=function(){var p,v=l[f],m=n.figure.charts.find(g=>g.series.includes(v));n.addSeries(v,o,(p=m==null?void 0:m.showLegend)!==null&&p!==void 0?p:null),v.subscribe()},f=0;f<l.length;f+=1)u();this.pendingSeries=[]},mt.ADD_SERIES_DEBOUNCE)),$(this,"getTimeZone",De((o,l)=>{if(l!=null){var u=l.getColumnTypeFormatter(o);if(u!=null)return u.dhTimeZone}})),$(this,"getValueTranslator",De((o,l)=>{var u=this.getTimeZone(o,l);return f=>this.chartUtils.unwrapValue(f,u)})),$(this,"getValueParser",De((o,l)=>{var u=this.getTimeZone(o,l);return f=>this.chartUtils.wrapValue(f,o,u)})),$(this,"getRangeParser",De((o,l)=>u=>{var[f,h]=u,p=this.getValueParser(o,l);return f=p(f),h=p(h),[f,h]})),$(this,"getAxisRangeParser",De((o,l)=>u=>{var f=W.getSourceForAxis(o,u);return f!=null?this.getRangeParser(f.columnType,l):h=>h})),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 W(e),this.figure=t,this.settings=a,this.theme=i,this.data=[];var s={data:{},layout:this.chartUtils.makeDefaultLayout(i)};this.layout={grid:{rows:t.rows,columns:t.cols,pattern:"independent"},template:s},this.seriesDataMap=new Map,this.pendingSeries=[],this.oneClicks=[],this.filterColumnMap=new Map,this.lastFilter=new Map,this.isConnected=!0,this.seriesToProcess=new Set,this.setTitle(this.getDefaultTitle()),this.initAllSeries(),this.updateAxisPositions(),this.startListeningFigure()}close(){this.figure.close(),this.addPendingSeries.cancel(),this.stopListeningFigure()}getDefaultTitle(){if(this.figure.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=W.getAllAxes(this.figure),n=[],a=0;a<e.length;a+=1)for(var i=e[a],s=0;s<i.series.length;s+=1){var o=i.series[s];n.push(o.name),this.addSeries(o,t,i.showLegend)}for(var l=[...this.seriesDataMap.keys()],u=l.filter(p=>n.indexOf(p)<0),f=0;f<u.length;f+=1){var h=u[f];this.seriesDataMap.delete(h)}this.seriesToProcess=new Set([...this.seriesDataMap.keys()])}addSeries(e,t,n){var{dh:a}=this,i=W.groupArray(t,"type"),s=this.chartUtils.makeSeriesDataFromSeries(e,i,W.getSeriesVisibility(e.name,this.settings),n,this.theme);if(this.seriesDataMap.set(e.name,s),this.data=[...this.seriesDataMap.values()],e.plotStyle===a.plot.SeriesPlotStyle.STACKED_BAR?this.layout.barmode="stack":e.plotStyle===a.plot.SeriesPlotStyle.PIE&&(this.layout.hiddenlabels=W.getHiddenLabels(this.settings)),this.layout.showlegend=this.data.length>1||e.plotStyle===a.plot.SeriesPlotStyle.PIE?n??void 0:!1,e.oneClick!=null){for(var{oneClick:o}=e,{columns:l}=o,u=0;u<l.length;u+=1)this.filterColumnMap.set(l[u].name,l[u]);this.oneClicks.push(o)}this.updateLayoutFormats()}subscribe(e){super.subscribe(e),this.listeners.length===1&&(this.initAllSeries(),this.subscribeFigure())}unsubscribe(e){super.unsubscribe(e),this.listeners.length===0&&this.unsubscribeFigure()}subscribeFigure(){if(!this.isConnected){X.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){X.debug("Downsample started",e),this.fireDownsampleStart(e.detail)}handleDownsampleFinish(e){X.debug("Downsample finished",e),this.fireDownsampleFinish(e.detail)}handleDownsampleFail(e){X.error("Downsample failed",e),this.fireDownsampleFail(e.detail)}handleDownsampleNeeded(e){X.info("Downsample needed",e),this.fireDownsampleNeeded(e.detail)}handleFigureUpdated(e){var{detail:t}=e,{series:n}=t;X.debug2("handleFigureUpdated",n);for(var a=0;a<n.length;a+=1){var i=n[a];X.debug2("handleFigureUpdated updating series",i.name);for(var{sources:s}=i,o=0;o<s.length;o+=1){var l=s[o],{columnType:u,type:f}=l,h=this.getValueTranslator(u,this.formatter),p=t.getArray(i,f,h);this.setDataArrayForSeries(i,f,p)}this.seriesToProcess.delete(i.name),this.seriesToProcess.size===0&&this.fireLoadFinished(),this.cleanSeries(i)}var{data:v}=this;this.fireUpdate(v)}handleRequestFailed(e){X.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){X.debug("Figure disconnected",e),this.isConnected=!1,this.listeners.length>0&&this.unsubscribeFigure(),this.fireDisconnect()}handleFigureReconnected(e){X.debug("Figure reconnected",e),this.isConnected=!0,this.initAllSeries(),this.fireReconnect(),this.listeners.length>0&&this.subscribeFigure()}handleFigureSeriesAdded(e){var{detail:t}=e;X.debug("handleFigureSeriesAdded",t),this.pendingSeries.push(t),this.addPendingSeries()}setDimensions(e){super.setDimensions(e),this.updateAxisPositions()}setTitle(e){var t,n;super.setTitle(e);var a=(t=(n=(e??"").match(/<br>/g))===null||n===void 0?void 0:n.length)!==null&&t!==void 0?t:0,i=W.DEFAULT_MARGIN.t+a*W.SUBTITLE_LINE_HEIGHT;this.layout.margin?this.layout.margin.t=i:this.layout.margin={t:i},typeof this.layout.title=="string"?this.layout.title=e:(this.layout.title=gn({},this.layout.title),this.layout.title.text=e,this.layout.title.pad=gn({},this.layout.title.pad),this.layout.title.pad.t=W.DEFAULT_TITLE_PADDING.t+a*W.SUBTITLE_LINE_HEIGHT*.5)}getPlotWidth(){var e,t,n,a;return!this.rect||!this.rect.width?0:Math.max(this.rect.width-((e=(t=this.layout.margin)===null||t===void 0?void 0:t.l)!==null&&e!==void 0?e:0)-((n=(a=this.layout.margin)===null||a===void 0?void 0:a.r)!==null&&n!==void 0?n:0),0)}getPlotHeight(){var e,t,n,a;return!this.rect||!this.rect.height?0:Math.max(this.rect.height-((e=(t=this.layout.margin)===null||t===void 0?void 0:t.t)!==null&&e!==void 0?e:0)-((n=(a=this.layout.margin)===null||a===void 0?void 0:a.b)!==null&&n!==void 0?n:0),0)}updateAxisPositions(){var e=this.getPlotWidth(),t=this.getPlotHeight();this.chartUtils.updateFigureAxes(this.layout,this.figure,n=>this.getAxisRangeParser(n,this.formatter),e,t,this.theme)}updateLayoutFormats(){if(this.formatter){var e=this.chartUtils.getAxisFormats(this.figure,this.formatter);e.forEach((t,n)=>{X.debug("Assigning ".concat(n),this.layout[n],t);var a=this.layout[n];a!=null?Object.assign(a,t):X.debug("Ignoring null layout.".concat(n))})}}setDataArrayForSeries(e,t,n){var{name:a,plotStyle:i}=e,s=this.seriesDataMap.get(a),o=this.chartUtils.getPlotlyProperty(i,t);s&&xn(s,o,n)}cleanSeries(e){var{dh:t}=this,{name:n,plotStyle:a}=e,i=this.seriesDataMap.get(n);if(i!=null){if(a===t.plot.SeriesPlotStyle.HISTOGRAM){var{xLow:s,xHigh:o}=i;if(s&&o&&s.length===o.length){for(var l=[],u=0;u<s.length;u+=1)l.push(o[u]-s[u]);i.width=l}}else if(a===t.plot.SeriesPlotStyle.LINE||a===t.plot.SeriesPlotStyle.ERROR_BAR||a===t.plot.SeriesPlotStyle.BAR){var{x:f,xLow:h,xHigh:p,y:v,yLow:m,yHigh:g}=i;h&&p&&h!==f&&(i.error_x=W.getPlotlyErrorBars(f,h,p)),m&&g&&m!==v&&(i.error_y=W.getPlotlyErrorBars(v,m,g))}else if(a===t.plot.SeriesPlotStyle.TREEMAP){var{ids:b,labels:E}=i;b!==void 0&&E===void 0&&(i.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){X.warn("Trying to set a filter, but no one click!");return}X.debug("setFilter",e);for(var n=function(){var s=t.oneClicks[a],{columns:o}=s,l=new Set([...e.keys(),...t.lastFilter.keys()]);l.forEach(u=>{var f=e.get(u);t.lastFilter.get(u)!==f&&o.find(h=>h.name===u)!=null&&s.setValueForColumn(u,f)})},a=0;a<this.oneClicks.length;a+=1)n();this.lastFilter=new Map(e)}setFigure(e){this.close(),this.figure=e,this.setTitle(this.getDefaultTitle()),this.initAllSeries(),this.updateAxisPositions(),this.startListeningFigure(),this.listeners.length>0&&this.subscribeFigure()}updateSettings(e){this.settings=e}}$(mt,"ADD_SERIES_DEBOUNCE",50);const Bt=mt;function bn(r,e,t,n,a,i,s){try{var o=r[i](s),l=o.value}catch(u){t(u);return}o.done?e(l):Promise.resolve(l).then(n,a)}function Ot(r){return function(){var e=this,t=arguments;return new Promise(function(n,a){var i=r.apply(e,t);function s(l){bn(i,n,a,s,o,"next",l)}function o(l){bn(i,n,a,s,o,"throw",l)}s(void 0)})}}class yr{static makeModelFromSettings(e,t,n){var a=arguments;return Ot(function*(){var i=a.length>3&&a[3]!==void 0?a[3]:H,s=yield yr.makeFigureFromSettings(e,t,n);return new Bt(e,s,t,i)})()}static makeFigureFromSettings(e,t,n){return Ot(function*(){var a=yield n.copy();return a.applyCustomColumns(n.customColumns),a.applyFilter(n.filter),a.applySort(n.sort),e.plot.Figure.create(new W(e).makeFigureSettings(t,a))})()}static makeModel(e,t,n){var a=arguments;return Ot(function*(){var i=a.length>3&&a[3]!==void 0?a[3]:H;return new Bt(e,n,t,i)})()}}const Vd=yr;function Qe(r,e,t){return e=Ud(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Ud(r){var e=Bd(r,"string");return typeof e=="symbol"?e:String(e)}function Bd(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class Z extends ae{static makeRandomSeries(e){for(var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:100,a=[],i=[],s=[],o=[],l=new Date,u=0;u<n;u+=1){var f=new Date(l.getFullYear(),l.getMonth(),l.getDate()+u-n);a.push("".concat(f.getFullYear(),"-").concat(f.getMonth()+1,"-").concat(f.getDate()));var h=(Math.sin(u/n*e)*n/3+Math.cos(u*.2)*n/6+Math.sin(u*.5)*n/10+Math.random()*n/5+u*Z.smoothing)*t;h=Math.round(h*100)/100,i.push(h),o.push(40+u*Z.smoothing),s.push(Math.sin(u/n*e)*n/3+Math.random()*n/10+u*Z.smoothing)}return{x:a,y:i,s,l:o}}static makeScatter(e){return{name:"SCTR",x:e.x,y:e.y,type:"scattergl",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:H.area_color,width:3}}}static makeTrendline(e){return{name:"Trendline <br>R<sup>2</sup> = 0.91",x:e.x,y:e.l,type:"scattergl",mode:"line",hoverinfo:"skip",line:{width:3,dash:"dot",color:H.trend_color}}}static makeErrorBand(e){for(var t=[],n=[],a=0;a<e.y.length;a+=1){var i=e.y[a];t[a]=Math.round((i+18)*100)/100,n[a]=Math.round((i-18)*100)/100}var s=t.concat(n.reverse());return{name:"error",x:e.x.concat(e.x.slice().reverse()),y:s,type:"scattergl",mode:"line",hoverinfo:"skip",fill:"toself",fillcolor:H.error_band_fill_color,line:{width:0,color:H.error_band_line_color,shape:"spline"}}}static makeLine(e){return{name:"LINE",x:e.x,y:e.y,type:"scattergl",mode:"line",hoverinfo:"x+y+text+name",line:{color:H.line_color,width:3}}}static makeRandomData(){var e=Z.makeRandomSeries(6),t=Z.makeArea(e),n=Z.makeTrendline(e),a=Z.makeRandomSeries(2),i=Z.makeLine(a),s=Z.makeErrorBand(a);return[t,n,i,s]}static makeDefaultLayout(e){var t=new W(e).makeDefaultLayout(H);return t.title="Chart",t.xaxis&&(t.xaxis.title="Datestamp"),t.yaxis&&(t.yaxis.title="Price"),t}constructor(e){var{data:t=Z.makeRandomData(),layout:n=Z.makeDefaultLayout(e),filterFields:a=[]}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};super(e),Qe(this,"data",void 0),Qe(this,"filterFields",void 0),Qe(this,"layout",void 0),this.data=t,this.layout=n,this.filterFields=a}getData(){return this.data}getLayout(){return this.layout}getFilterColumnMap(){for(var e=new Map,t=0;t<this.filterFields.length;t+=1){var n=this.filterFields[t],a="java.lang.String";e.set(n,{name:n,type:a})}return e}isFilterRequired(){return this.filterFields.length>0}setFilter(){this.fireUpdate(this.data)}}Qe(Z,"smoothing",1.5);const Hd=Z,Gd=typeof Ze=="function"?Ze(tt):Ze.default(tt);function Wd(r){return r.setFigure!==void 0}const Kd=Object.freeze(Object.defineProperty({__proto__:null,Chart:jd,ChartModel:ae,ChartModelFactory:Vd,ChartTheme:H,ChartUtils:W,FigureChartModel:Bt,MockChartModel:Hd,Plot:Gd,isFigureChartModel:Wd},Symbol.toStringTag,{value:"Module"}));function di(r,e,t){return e=zd(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function zd(r){var e=qd(r,"string");return typeof e=="symbol"?e:String(e)}function qd(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class ke{static valueForCell(e,t,n){var a="".concat(e,",").concat(t);return n!==void 0&&n&&(a="(".concat(a,")")),a}constructor(e){di(this,"dh",void 0),this.dh=e}makeColumn(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:ke.DEFAULT_TYPE,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0;return new this.dh.Column({index:n,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]:"",n=[],a=0;a<e;a+=1)n.push(this.makeColumn("".concat(t).concat(a),ke.DEFAULT_TYPE,a));return n}static makeUserColumnWidths(){for(var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:5,t=new Map,n=0;n<e;n+=1)t.set(n.toString(),100);return t}makeRow(e){var t=new this.dh.Row({index:e,name:"".concat(e)});return t.get=jest.fn(n=>ke.valueForCell(e,n.index)),t}makeFilter(){return new this.dh.FilterCondition}makeSort(){return new this.dh.Sort}makeTable(){var{columns:e=this.makeColumns(),size:t=1e9,sort:n=[],layoutHints:a={}}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},i=new this.dh.Table({columns:e,size:t,sort:n});return i.copy=jest.fn(()=>Promise.resolve(i)),i.freeze=jest.fn(()=>Promise.resolve(i)),i.layoutHints=a,i}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,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[],a=new this.dh.TreeTable({columns:e,size:t,sort:n});return a.copy=jest.fn(()=>Promise.resolve(a)),a}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,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,{dh:a}=this;return new Zs(a,e,t??new lt(a),n)}}di(ke,"DEFAULT_TYPE","java.lang.String");const Xd=ke;function Te(r,e,t){return e=Yd(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Yd(r){var e=Zd(r,"string");return typeof e=="symbol"?e:String(e)}function Zd(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}var ce=k.module("TableViewportUpdater"),Qd=150;class he extends c.PureComponent{constructor(){super(...arguments),Te(this,"subscription",void 0),Te(this,"getViewportRowRange",Ct((e,t,n)=>{var a=n-t,i=Math.max(0,t-a*he.ROW_BUFFER_PAGES),s=n+a*he.ROW_BUFFER_PAGES;return[i,s]})),Te(this,"getViewportColumns",Ct((e,t,n,a)=>{if(t==null||n==null)return null;for(var i=n-t,s=Math.max(0,t-i*he.COLUMN_BUFFER_PAGES),o=Math.min(n+i*he.COLUMN_BUFFER_PAGES,e.columns.length-1),l=[],u=s;u<=o;u+=1){var f=Qs.getModelIndex(u,a);l.push(e.columns[f])}return l})),Te(this,"updateViewport",Dn((e,t,n,a,i)=>{if(t<e){ce.error("Invalid viewport",e,t);return}if(e===0&&t===0){ce.debug2("Ignoring 0-0 viewport");return}var{movedColumns:s,table:o}=this.props,[l,u]=this.getViewportRowRange(o,e,t),f=i??this.getViewportColumns(o,n,a,s);if(ce.debug2("Setting Viewport Top:",l,"Bottom:",u,"Columns:",f),this.subscription==null){ce.debug2("updateViewport creating new subscription"),this.subscription=o.setViewport(l,u,f);var{onSubscription:h}=this.props;h(this.subscription)}else ce.debug2("updateViewport using existing subscription"),this.subscription.setViewport(l,u,f)},Qd))}componentDidMount(){var{top:e,bottom:t,left:n,right:a,table:i,filters:s,sorts:o,columns:l,customColumns:u}=this.props;i.applyFilter(s),i.applySort(o),i.applyCustomColumns(u),this.updateViewport(e,t,n,a,l)}componentDidUpdate(e){var{top:t,bottom:n,left:a,right:i,table:s,filters:o,sorts:l,customColumns:u,columns:f}=this.props,h=o!==e.filters,p=l!==e.sorts,v=u!==e.customColumns,m=s!==e.table;(h||p||v||m)&&this.closeSubscription(),(h||m)&&(ce.debug("update table filter",o),s.applyFilter(o)),(p||m)&&(ce.debug("update table sort",l),s.applySort(l)),(v||m)&&(ce.debug("update table custom columns",u),s.applyCustomColumns(u)),this.updateViewport(t,n,a,i,f)}componentWillUnmount(){this.closeSubscription()}closeSubscription(){if(ce.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}}Te(he,"ROW_BUFFER_PAGES",3);Te(he,"COLUMN_BUFFER_PAGES",1);Te(he,"defaultProps",{top:0,bottom:0,left:null,right:null,columns:null,onSubscription:()=>{},filters:[],sorts:[],customColumns:[],movedColumns:[]});const Jd=he;function it(r,e,t){return e=ef(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function ef(r){var e=tf(r,"string");return typeof e=="symbol"?e:String(e)}function tf(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}var xe=k.module("TreeTableViewportUpdater"),rf=150;class st extends c.PureComponent{constructor(e){super(e),it(this,"listenerCleanup",void 0),it(this,"updateViewport",Dn((t,n)=>{if(n<t){xe.error("Invalid viewport",t,n);return}if(t===0&&n===0){xe.debug2("Ignoring 0-0 viewport");return}var{table:a,updateInterval:i}=this.props,s=n-t,o=Math.max(0,t-s*3),l=n+s*3+1;if(xe.debug2("Setting Viewport Top:",o,"Bottom:",l,a),!this.listenerCleanup){var{dh:u,onViewportUpdate:f}=this.props;this.listenerCleanup=a.addEventListener(u.TreeTable.EVENT_UPDATED,f)}a.setViewport(o,l,void 0,i)},rf)),this.listenerCleanup=null}componentDidMount(){var{top:e,bottom:t,table:n,filters:a,sorts:i}=this.props;xe.debug("componentDidMount",this.props),n.applyFilter(a),n.applySort(i),this.updateViewport(e,t)}componentDidUpdate(e){var{top:t,bottom:n,table:a,filters:i,sorts:s}=this.props;i!==e.filters&&(xe.debug("update table filter",i),a.applyFilter(i)),s!==e.sorts&&(xe.debug("update table sort",s),a.applySort(s)),this.updateViewport(t,n)}componentWillUnmount(){this.updateViewport.cancel(),this.listenerCleanup&&this.listenerCleanup()}render(){return null}}it(st,"UPDATE_INTERVAL",1e3);it(st,"defaultProps",{top:0,bottom:0,onViewportUpdate:()=>{},filters:[],sorts:[],updateInterval:st.UPDATE_INTERVAL});const nf=st,af=Object.freeze(Object.defineProperty({__proto__:null,AdvancedSettings:Js,AdvancedSettingsType:eo,AggregationEdit:to,AggregationUtils:ro,Aggregations:no,BarIcon:ao,ChartBuilder:io,ColumnHeaderGroup:so,CustomColumnBuilder:oo,DownloadServiceWorkerUtils:lo,FormatColumnWhereIcon:uo,FormatRowWhereIcon:co,HistogramIcon:fo,InputEditor:ho,IrisGrid:Or,IrisGridMetricCalculator:po,IrisGridModel:vo,IrisGridModelFactory:mo,IrisGridRenderer:go,IrisGridTableModel:bo,IrisGridTableModelTemplate:yo,IrisGridTestUtils:Xd,IrisGridTreeTableModel:Eo,IrisGridUtils:So,LineIcon:To,OptionType:wo,PieIcon:Po,RollupRows:Oo,SHORTCUTS:Co,ScatterIcon:xo,TableCsvExporter:Do,TableSaver:Ao,TableViewportUpdater:Jd,TreeTableViewportUpdater:nf,VisibilityOrderingBuilder:No,createDefaultIrisGridTheme:Io,default:Or,isIrisGridTableModelTemplate:_o},Symbol.toStringTag,{value:"Module"}));var fi={react:V,"react-dom":Oi,redux:Ci,"react-redux":xi,"@adobe/react-spectrum":Di,"@deephaven/auth-plugins":yd,"@deephaven/chart":Kd,"@deephaven/components":Yu,"@deephaven/icons":Ji,"@deephaven/iris-grid":af,"@deephaven/jsapi-bootstrap":Zu,"@deephaven/jsapi-components":Uc,"@deephaven/jsapi-utils":cc,"@deephaven/log":k,"@deephaven/react-hooks":vl},sf=Ai.createRequires(fi),of=Ni({requires:sf});const lf=of;function yn(r,e,t,n,a,i,s){try{var o=r[i](s),l=o.value}catch(u){t(u);return}o.done?e(l):Promise.resolve(l).then(n,a)}function Er(r){return function(){var e=this,t=arguments;return new Promise(function(n,a){var i=r.apply(e,t);function s(l){yn(i,n,a,s,o,"next",l)}function o(l){yn(i,n,a,s,o,"throw",l)}s(void 0)})}}var de=k.module("@deephaven/app-utils.PluginUtils");function uf(r){return Ht.apply(this,arguments)}function Ht(){return Ht=Er(function*(r){var e=yield lf(r);return e}),Ht.apply(this,arguments)}function cf(r){return Gt.apply(this,arguments)}function Gt(){return Gt=Er(function*(r){var e=yield fetch(r);if(!e.ok)throw new Error(e.statusText);try{return yield e.json()}catch{throw new Error("Could not be parsed as JSON")}}),Gt.apply(this,arguments)}function df(r){return Wt.apply(this,arguments)}function Wt(){return Wt=Er(function*(r){de.debug("Loading plugins...");try{var e=yield cf("".concat(r,"/manifest.json"));if(!Array.isArray(e.plugins))throw new Error("Plugin manifest JSON does not contain plugins array");de.debug("Plugin manifest loaded:",e);for(var t=[],n=0;n<e.plugins.length;n+=1){var{name:a,main:i}=e.plugins[n],s="".concat(r,"/").concat(a,"/").concat(i);t.push(uf(s))}for(var o=yield Promise.allSettled(t),l=new Map,u=0;u<o.length;u+=1){var f=o[u],{name:h}=e.plugins[u];if(f.status==="fulfilled"){var p,v=Gc(f.value)?f.value:(p=f.value.default)!==null&&p!==void 0?p:f.value;v==null?de.error("Plugin '".concat(h,"' is missing an exported value.")):l.set(h,v)}else de.error("Unable to load plugin '".concat(h,"'"),f.reason)}return de.info("Plugins loaded:",l),l}catch(m){return de.error("Unable to load plugins:",m),new Map}}),Wt.apply(this,arguments)}function ff(r){var e,t;return(e=(t=r.get("AuthHandlers"))===null||t===void 0?void 0:t.split(","))!==null&&e!==void 0?e:[]}function hf(r,e){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:new Map,n=ff(e),a=[...r.entries(),...t.entries()].filter(l=>{var[,u]=l;return Kc(u)||Rt(u)}).map(l=>{var[u,f]=l;return Rt(f)?{type:vt.AUTH_PLUGIN,name:u,component:f.AuthPlugin.Component,isAvailable:f.AuthPlugin.isAvailable}:f}),i=a.filter(l=>{var{isAvailable:u}=l;return u(n,e)});if(i.length===0)throw new Error("No login plugins found, please register a login plugin for auth handlers: ".concat(n));i.length>1&&de.warn("More than one login plugin available, will use the first one: ",i.map(l=>{var{name:u}=l;return u}).join(", "));var{name:s,component:o}=i[0];return de.info("Using LoginPlugin",s),o}function pf(r){var e=[...r.entries()].filter(t=>zc(t[1]));return de.debug("Getting theme data from plugins",e),e.map(t=>{var[n,a]=t,i=Array.isArray(a.themes)?a.themes:[a.themes];return i.map(s=>{var{name:o,baseTheme:l,styleContent:u}=s;return{baseThemeKey:"default-".concat(l??"dark"),themeKey:Vn(n,o),name:o,styleContent:u}})}).flat()}var vf=An.createRequires(()=>fi),mf=An.createRemoteComponent({requires:vf});const $f=mf;function En(r,e,t,n,a,i,s){try{var o=r[i](s),l=o.value}catch(u){t(u);return}o.done?e(l):Promise.resolve(l).then(n,a)}function gf(r){return function(){var e=this,t=arguments;return new Promise(function(n,a){var i=r.apply(e,t);function s(l){En(i,n,a,s,o,"next",l)}function o(l){En(i,n,a,s,o,"throw",l)}s(void 0)})}}var gt=c.createContext(null);function bf(r){var{pluginsUrl:e,getCorePlugins:t,children:n}=r,[a,i]=c.useState(null);return c.useEffect(function(){var o=!1;function l(){return u.apply(this,arguments)}function u(){return u=gf(function*(){var f,h=(f=yield t==null?void 0:t())!==null&&f!==void 0?f:[],p=yield df(e);if(!o){var v=h.map(m=>[m.name,m]);i(new Map([...v,...p]))}}),u.apply(this,arguments)}return l(),()=>{o=!0}},[e,t]),d.jsx(gt.Provider,{value:a,children:n})}function yf(){var r=hr();return c.useEffect(function(){r.postMessage(ur(lr))},[r]),null}function Sn(r,e,t,n,a,i,s){try{var o=r[i](s),l=o.value}catch(u){t(u);return}o.done?e(l):Promise.resolve(l).then(n,a)}function Ef(r){return function(){var e=this,t=arguments;return new Promise(function(n,a){var i=r.apply(e,t);function s(l){Sn(i,n,a,s,o,"next",l)}function o(l){Sn(i,n,a,s,o,"throw",l)}s(void 0)})}}var Sf=new Map([["@deephaven/auth-plugins.AuthPluginParent",{AuthPlugin:ai}],["@deephaven/auth-plugins.AuthPluginPsk",{AuthPlugin:li}],["@deephaven/auth-plugins.AuthPluginAnonymous",{AuthPlugin:ni}]]);function Tf(r){var{children:e}=r,t=Re(),n=c.useContext(gt),[a,i]=c.useState(),[s,o]=c.useState();c.useEffect(function(){var h=!1;function p(){return v.apply(this,arguments)}function v(){return v=Ef(function*(){try{var m=yield t.getAuthConfigValues();h||i(new Map(m))}catch(g){h||o(g)}}),v.apply(this,arguments)}return p(),()=>{h=!0}},[t]);var l=c.useMemo(()=>{if(!(n==null||a==null))try{return hf(n,a,Sf)}catch(f){o(f)}},[a,n]),u=l==null||a==null;return u||s!=null?d.jsx(Oe,{isLoading:u&&s==null,errorMessage:je(s)}):d.jsx(l,{authConfigValues:a,children:d.jsxs(d.Fragment,{children:[d.jsx(yf,{}),e]})})}function Vf(r){return new URL(r,"".concat(window.location))}function wf(){var r=new URLSearchParams(window.location.search);return r.get("envoyPrefix")}function Pf(){var r=wf();return r!=null?{headers:{"envoy-prefix":r}}:{headers:{}}}function Of(r){var{children:e}=r,t=c.useContext(Ja);return t?d.jsx(d.Fragment,{children:e}):d.jsx(Oe,{"data-testid":"fonts-loaded-loading"})}function Tn(r,e,t,n,a,i,s){try{var o=r[i](s),l=o.value}catch(u){t(u);return}o.done?e(l):Promise.resolve(l).then(n,a)}function Cf(r){return function(){var e=this,t=arguments;return new Promise(function(n,a){var i=r.apply(e,t);function s(l){Tn(i,n,a,s,o,"next",l)}function o(l){Tn(i,n,a,s,o,"throw",l)}s(void 0)})}}var hi=c.createContext(null);function xf(r){var{children:e}=r,t=Re(),[n,a]=c.useState(),[i,s]=c.useState();c.useEffect(function(){var u=!1;function f(){return h.apply(this,arguments)}function h(){return h=Cf(function*(){try{var p=yield t.getServerConfigValues();u||a(new Map(p))}catch(v){u||s(v)}}),h.apply(this,arguments)}return f(),()=>{u=!0}},[t]);var o=n==null;return o||i!=null?d.jsx(Oe,{isLoading:o&&i==null,errorMessage:je(i)}):d.jsx(hi.Provider,{value:n,children:e})}function Df(){return ot(hi,"No server config available in useServerConfig. Was code wrapped in ServerConfigBootstrap or ServerConfigContext.Provider?")}function Af(r){var{children:e}=r,t=Df(),n=c.useContext(ra),a=c.useContext(ut),i=ci(t,n,a);return d.jsx(ta.Provider,{value:i,children:e})}function Nf(r){var{children:e}=r,t=c.useContext(gt),n=c.useMemo(()=>t==null?null:pf(t),[t]);return d.jsx(_a,{themes:n,children:e})}function Uf(r){var{fontClassNames:e,pluginsUrl:t,getCorePlugins:n,serverUrl:a,children:i}=r,s=c.useMemo(()=>Pf(),[]),[o,l]=c.useState(0),u=c.useCallback(()=>{},[]),f=c.useCallback(()=>{l(h=>h+1)},[]);return pt(u,f),d.jsx(Bc,{fontClassNames:e,children:d.jsx(bf,{getCorePlugins:n,pluginsUrl:t,children:d.jsx(Nf,{children:d.jsx(Kn,{serverUrl:a,options:s,children:d.jsx(qa,{children:d.jsx(Tf,{children:d.jsx(xf,{children:d.jsx(Af,{children:d.jsx(Mo,{children:d.jsx(Of,{children:i})})})})})})},o)})})})}function If(){return ot(gt,"No Plugins available in usePlugins. This can happen when plugins have not finished loading or if code is not wrapped in PluginsBootstrap or PluginsContext.Provider.")}var _f=k.module("@deephaven/app-utils/useTablePlugin");function Bf(){var r=If(),e=c.useCallback(t=>{var n=r.get(t);if(n!=null){if(Wc(n))return n.component;if(ei(n))return n.TablePlugin}var a="Unable to find table plugin ".concat(t,".");throw _f.error(a),new Error(a)},[r]);return e}export{Uf as AppBootstrap,Tf as AuthBootstrap,Mo as ConnectionBootstrap,Wf as ConnectionContext,Bc as FontBootstrap,Of as FontsLoaded,Ja as FontsLoadedContext,bf as PluginsBootstrap,gt as PluginsContext,$f as RemoteComponent,Nf as ThemeBootstrap,ff as getAuthHandlers,hf as getAuthPluginComponent,Vf as getBaseUrl,Pf as getConnectOptions,wf as getEnvoyPrefix,pf as getThemeDataFromPlugins,cf as loadJson,uf as loadModulePlugin,df as loadModulePlugins,Kf as useConnection,Bf as useLoadTablePlugin,If as usePlugins,Df as useServerConfig,zf as useUser};
4
+ //# sourceMappingURL=index-ce73b24e.js.map