@deephaven/embed-widget 0.61.1-beta.0 → 0.61.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/assets/{App-d6de2921.js → App-c7ea931c.js} +2 -2
- package/build/assets/{App-d6de2921.js.map → App-c7ea931c.js.map} +1 -1
- package/build/assets/{WidgetView-0e2c0561.js → WidgetView-43cbd201.js} +2 -2
- package/build/assets/{WidgetView-0e2c0561.js.map → WidgetView-43cbd201.js.map} +1 -1
- package/build/assets/index-10db434e.css +1 -0
- package/build/assets/{index-1a83aec3.js → index-17d5f9c5.js} +3 -3
- package/build/assets/{index-1a83aec3.js.map → index-17d5f9c5.js.map} +1 -1
- package/build/assets/{index-f447a3f6.js → index-3ec6d911.js} +5 -5
- package/build/assets/{index-f447a3f6.js.map → index-3ec6d911.js.map} +1 -1
- package/build/assets/{index-de06cd4a.js → index-74ec7f91.js} +2 -2
- package/build/assets/{index-de06cd4a.js.map → index-74ec7f91.js.map} +1 -1
- package/build/assets/{usePlugins-29d49f6f.js → usePlugins-c5a289f4.js} +2 -2
- package/build/assets/{usePlugins-29d49f6f.js.map → usePlugins-c5a289f4.js.map} +1 -1
- package/build/index.html +2 -2
- package/package.json +15 -15
- package/build/assets/index-a896b2a3.css +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import{r as w,G as oe,ag as iy,C as h,D as Sr,E as X,R as bd,V,F as ue,L as qe,ah as Bh,U as Se,K as wt,ai as ay,aj as oy,Y as Uh,a0 as Cd,ak as sy,al as ly,am as dy,X as Le,an as gb,ao as mt,a9 as be,ap as ge,aq as cm,ar as uy,as as Vh,at as hy,au as cy,av as my,aw as vy,a6 as Gh,a7 as fy,ax as pb,ay as dh,Z as Sd,az as rn,aA as gy,aB as Un,aC as py,aD as by,aE as Cy,aF as Sy,aG as uh,aH as wy,aI as yy,aJ as Ey,aK as mm,aL as Ty,aM as vm,aN as Py,aO as Oy,aP as Dy,aQ as Ny,aR as Ry,aS as Iy,a8 as bo,aT as Fy,aU as $n,aV as _r,aW as ea,aX as fm,aY as _y,aZ as ps,a_ as ln,a$ as bb,b0 as My}from"./vendor-fc3cb542.js";import{T as et,L as ie,M as wd,o as yd,b as Ed,R as Cb,U as xy,V as Sb,X as Ay,Y as wb,Z as xs,g as yb,f as Ly,e as Td,y as ky,B as jy,D as $y,x as Hy,E as By,s as Uy,I as Vy,m as Gy,_ as Eb,$ as Wy,O as zy,h as j,a0 as hh,a1 as Ky,a2 as qy,r as Wh,z as Tb,a3 as Pd,a as As,a4 as B,a5 as ta,n as ia,a6 as zh,a7 as Kh,a8 as Kl,a9 as Yy,aa as ti,c as vi,ab as Xy,ac as Qy,ad as Pa,ae as Pb,af as Zy,ag as Jy,ah as e0,ai as t0,aj as qh,v as Br,ak as Aa,al as gm,am as Ls,an as Yh,ao as Xh,ap as Od,aq as Co,ar as r0,as as n0,at as ql,au as i0,av as Qh,aw as Ob,ax as a0,ay as o0,d as s0,az as l0,aA as d0,aB as u0,aC as h0,aD as pm,aE as Mu,aF as c0,aG as m0,aH as v0,aI as f0,aJ as g0,aK as Db,aL as Zh,aM as bm,aN as p0,aO as b0,aP as C0,aQ as S0,aR as Nb,aS as w0,aT as Cm,aU as Yl,aV as Sm,aW as Rb,aX as y0,aY as Dd,aZ as E0,a_ as T0,a$ as P0,b0 as O0,b1 as D0,b2 as N0,b3 as R0,b4 as I0,b5 as F0,b6 as _0,b7 as M0,b8 as x0,b9 as A0,ba as L0,bb as k0,bc as j0,bd as $0,be as H0,bf as B0,bg as Ib,bh as U0,bi as wm,bj as V0,bk as G0,bl as W0,bm as z0}from"./index-f447a3f6.js";import{P as Re,b as lt,v as xu,c as K0,a as Jh,T as q0,t as Fb,r as ym,g as Y0,C as X0,u as Q0,e as aa,s as _b,o as Z0,n as J0,q as eE}from"./usePlugins-29d49f6f.js";import{c as Au,P as ec,b as tE,h as rE,p as nE,o as iE,s as aE,t as oE}from"./plotly-94807d7b.js";var Te=Object.freeze([]),Jr=new Map,k2=()=>{};function Lu(){for(var n=arguments.length,e=new Array(n),t=0;t<n;t++)e[t]=arguments[t];return e.filter(r=>r!=null)}function sE(n){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,t=lE(n,e);t.forEach(r=>{n[r]=n[r].bind(n)})}function lE(n,e){for(var t=new Set,r=n,i=0;r!=null&&r!==Object.prototype&&(i<=1||e);){for(var a of Object.getOwnPropertyNames(r))a!=="constructor"&&typeof r[a]=="function"&&t.add(a);r=Object.getPrototypeOf(r),i+=1}return[...t.keys()]}function Em(n,e,t,r,i,a,o){try{var s=n[a](o),l=s.value}catch(d){t(d);return}s.done?e(l):Promise.resolve(l).then(r,i)}function dE(n){return function(){var e=this,t=arguments;return new Promise(function(r,i){var a=n.apply(e,t);function o(l){Em(a,r,i,o,s,"next",l)}function s(l){Em(a,r,i,o,s,"throw",l)}o(void 0)})}}function Ro(n){return ch.apply(this,arguments)}function ch(){return ch=dE(function*(n){var{clipboard:e}=navigator;if(e!==void 0)try{return navigator.clipboard.writeText(n)}catch{return Tm(n)}Tm(n)}),ch.apply(this,arguments)}function Tm(n){var e=document.activeElement,t=document.createElement("textarea");t.value=n,document.body.appendChild(t),t.focus(),t.select();var r=document.execCommand("copy");if(document.body.removeChild(t),e instanceof HTMLElement&&e.focus(),!r)throw new Error("Unable to execute copy command")}function Io(n,e,t){return e=uE(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function uE(n){var e=hE(n,"string");return typeof e=="symbol"?e:String(e)}function hE(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var cE="table_",Mb="column_",mE=new Set(["in","not","i","ii","k"]),vE=new Set(["abstract","continue","for","new","switch","assert","default","if","package","synchronized","boolean","do","goto","private","this","break","double","implements","protected","throw","byte","else","import","public","throws","case","enum","instanceof","return","transient","catch","extends","int","short","try","char","final","interface","static","void","class","finally","long","strictfp","volatile","const","float","native","super","while","null","true","false"]),fE=/[^a-zA-Z0-9_$+@-]/g,gE=/[^A-Za-z0-9_$]/g;class sn{}Io(sn,"legalize",(n,e,t,r,i)=>{var a=n.trim().replace(/[- ]/g,"_");return r&&(mE.has(a)||vE.has(a))&&(a=e+a),a=a.replace(t,""),a||(a=e+i),Number.isNaN(Number(a.charAt(0)))||(a=e+a),a});Io(sn,"legalizeTableName",n=>sn.legalize(n,cE,fE,!1,0));Io(sn,"legalizeColumnNames",n=>{var e=[];return n.forEach((t,r)=>{var i=sn.legalizeColumnName(t,r);e.includes(i)&&(i=Mb+r),e.push(i)}),e});Io(sn,"legalizeColumnName",function(n){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return sn.legalize(n,Mb,gE,!0,e)});Io(sn,"isValidTableName",n=>sn.legalizeTableName(n)===n);Io(sn,"isValidColumnName",n=>sn.legalizeColumnName(n)===n);const ks=sn;class Qe extends CustomEvent{constructor(e,t){super(e,t)}}function Pm(n,e,t){return e=pE(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function pE(n){var e=bE(n,"string");return typeof e=="symbol"?e:String(e)}function bE(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class CE{constructor(){Pm(this,"pending",[]),Pm(this,"resolved",[])}add(e,t){var r=Re.makeCancelable(e,t);return this.pending.push(r),r.then(()=>{this.resolve(r)},()=>{this.resolve(r)}),r}remove(e){for(var t=0;t<this.pending.length;t+=1)if(this.pending[t]===e){this.pending.splice(t,1);return}}resolve(e){this.remove(e),this.resolved.push(e)}cancel(){for(var e=[...this.pending,...this.resolved],t=0;t<e.length;t+=1)e[t].cancel();this.pending=[],this.resolved=[]}}const qn=CE;function Om(n,e){var t=new Set([...Object.keys(n),...Object.keys(e)]),r=[];return t.forEach(i=>{n[i]!==e[i]&&r.push(i)}),r}class tc{static isValidRange(e){return e!=null&&e.length===2&&Number.isInteger(e[0])&&Number.isInteger(e[1])&&e[0]<=e[1]}static validateRange(e){if(!tc.isValidRange(e))throw new Error("Invalid range! ".concat(e))}static isSelected(e,t){for(var r=0;r<e.length;r+=1){var i=e[r],a=i[0],o=i[1];if(a<=t&&t<=o)return!0}return!1}static selectRange(e,t){for(var[r,i]=t,a=[...e],o=a.length-1;o>=0;o-=1){var s=a[o],l=s[0],d=s[1];if(l<=r&&i<=d)return a;r<=d&&l<=i&&(r=Math.min(r,l),i=Math.max(i,d),a.splice(o,1))}return a.push([r,i]),a}static deselectRange(e,t){for(var[r,i]=t,a=[...e],o=a.length-1;o>=0;o-=1){var s=a[o],l=s[0],d=s[1];if(!(i<l||d<r))if(l<r&&i<d){a[o]=[l,r-1],a.splice(o+1,0,[i+1,d]);break}else r<=l&&d<=i?a.splice(o,1):l<r?a[o]=[l,r-1]:a[o]=[i+1,d]}return a}static count(e){return e.reduce((t,r)=>t+(r[1]-r[0]+1),0)}static getItemsInRanges(e,t){return t.reduce((r,i)=>{for(var a=[...r],o=i[0];o<=i[1];o+=1)a.push(e[o]);return a},[])}}const An=tc;function*j2(n,e){for(var t=n;t<=e;++t)yield t}class SE{static join(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"and";if(e==null||e.length===0)return"";if(e.length===1)return e[0];if(e.length===2)return"".concat(e[0]," ").concat(t," ").concat(e[1]);var r=e.slice(0,e.length-1).join(", "),i=e[e.length-1];return"".concat(r,", ").concat(t," ").concat(i)}static toLower(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;if(e==null){if(t)return"";throw new Error("Null string passed in to TextUtils.toLower")}return e.toLowerCase()}static sort(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;return e<t?r?-1:1:e>t?r?1:-1:0}}const Mr=SE;function xb(n,e,t){return e=wE(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function wE(n){var e=yE(n,"string");return typeof e=="symbol"?e:String(e)}function yE(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class js{static formatElapsedTime(e){if(typeof e!="number"||!Number.isInteger(e))throw new Error("".concat(e," is not a number that can be expressed as a formatted time"));var t=Math.floor(e/3600),r=Math.floor(e%3600/60),i=e%60;return"".concat(t>0?"".concat(t,"h "):"")+"".concat(r>0||t>0?"".concat(r,"m "):"")+"".concat(e>=60?"".concat(i,"s").padStart(3,"0"):"".concat(i,"s"))}static formatTime(e){if(typeof e!="number"||!Number.isInteger(e)||e<0)throw new Error("".concat(e," is not a number that can be expressed as a formatted time"));var t=String(Math.floor(e/(60*60))).padStart(2,"0"),r=e%(60*60),i=String(Math.floor(r/60)).padStart(2,"0"),a=r%60,o=String(Math.ceil(a)).padStart(2,"0");return"".concat(t,":").concat(i,":").concat(o)}static isTimeString(e){return new RegExp(js.TIME_PATTERN).test(e)}static parseTime(e){if(e==null||typeof e!="string")throw new Error("".concat(e," is not a valid string"));var t=e.split(":");if(t.length!==3)throw new Error("".concat(e," is not a time string that can be parsed"));return Number(t[0])*60*60+Number(t[1])*60+Number(t[2])}}xb(js,"TIME_PATTERN","([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]");xb(js,"TIME_ZONES",Object.freeze([{label:"Tokyo UTC+9 No DST",value:"Asia/Tokyo"},{label:"Seoul UTC+9 No DST",value:"Asia/Seoul"},{label:"Hong Kong UTC+8 No DST",value:"Asia/Hong_Kong"},{label:"Singapore UTC+8 No DST",value:"Asia/Singapore"},{label:"Kolkata UTC+5:30 No DST",value:"Asia/Kolkata"},{label:"Berlin UTC+1",value:"Europe/Berlin"},{label:"UTC UTC±0 No DST",value:"UTC"},{label:"London UTC±0",value:"Europe/London"},{label:"Sao Paulo UTC-2",value:"America/Sao_Paulo"},{label:"Newfoundland UTC-3:30",value:"America/St_Johns"},{label:"Halifax UTC-4",value:"America/Halifax"},{label:"New York UTC−5",value:"America/New_York"},{label:"Chicago UTC-6",value:"America/Chicago"},{label:"Denver UTC-7",value:"America/Denver"},{label:"Los Angeles UTC-8",value:"America/Los_Angeles"},{label:"Anchorage UTC-9",value:"America/Anchorage"},{label:"Honolulu UTC-10 No DST",value:"Pacific/Honolulu"},{label:"Zurich UTC+1",value:"Europe/Zurich"},{label:"Amsterdam UTC+1",value:"Europe/Amsterdam"},{label:"Taipei UTC+8 No DST",value:"Asia/Taipei"},{label:"Sydney UTC+10",value:"Australia/Sydney"}]));const rc=js;function EE(n,e,t){return e=TE(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function TE(n){var e=PE(n,"string");return typeof e=="symbol"?e:String(e)}function PE(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class OE extends Error{constructor(){super(...arguments),EE(this,"isInvalid",!0)}}const mo=OE;function Dm(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function DE(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Dm(Object(t),!0).forEach(function(r){vo(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Dm(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function vo(n,e,t){return e=NE(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function NE(n){var e=RE(n,"string");return typeof e=="symbol"?e:String(e)}function RE(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class nc extends w.Component{constructor(e){super(e),vo(this,"element",void 0),vo(this,"container",void 0),vo(this,"rAF",void 0),this.handleEnter=this.handleEnter.bind(this),this.handleExit=this.handleExit.bind(this),this.handleBlur=this.handleBlur.bind(this),this.element=document.createElement("div"),this.element.className="popper-container",this.container=oe.createRef(),this.rAF=0;var{isShown:t}=this.props;this.state={show:t,popper:null}}componentDidUpdate(e){var{isShown:t}=this.props;e.isShown!==t&&(t?(cancelAnimationFrame(this.rAF),this.rAF=window.requestAnimationFrame(()=>{this.show()})):this.hide())}componentWillUnmount(){this.destroyPopper(!1)}getVisibleElement(e){return e==null||e.clientHeight>0||e.clientWidth>0?e:this.getVisibleElement(e.parentElement)}initPopper(){var{popper:e}=this.state,{closeOnBlur:t,referenceObject:r}=this.props;if(!e&&this.container.current!==null){var{options:i}=this.props;i=DE({placement:"auto",modifiers:{preventOverflow:{boundariesElement:"viewport"}}},i),document.body.appendChild(this.element);var a=this.getVisibleElement(this.container.current);a==null&&(a=this.container.current),e=new iy(r||a,this.element,i),e.scheduleUpdate(),cancelAnimationFrame(this.rAF),this.rAF=window.requestAnimationFrame(()=>{if(t&&!this.element.contains(document.activeElement)){var o=this.element.firstElementChild;o instanceof HTMLElement&&o.focus()}}),this.setState({popper:e})}}destroyPopper(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;cancelAnimationFrame(this.rAF);var{popper:t}=this.state;t&&(t.destroy(),document.body.contains(this.element)&&document.body.removeChild(this.element),e&&this.setState({popper:null}))}show(){this.initPopper(),this.setState({show:!0})}hide(){this.setState({show:!1})}scheduleUpdate(){var{popper:e}=this.state;e&&e.scheduleUpdate()}handleBlur(e){e.relatedTarget instanceof HTMLElement&&(this.element.contains(e.relatedTarget)||this.hide())}handleEnter(){var{onEntered:e}=this.props;e()}handleExit(){var{onExited:e}=this.props,{show:t}=this.state;t||this.destroyPopper(),e()}renderContent(){var{className:e,children:t,timeout:r,interactive:i,closeOnBlur:a}=this.props,{show:o}=this.state;return h.jsx(Sr,{in:o,timeout:r,classNames:"popper-transition",onEntered:this.handleEnter,onExited:this.handleExit,children:h.jsx("div",{onClick:s=>{s.stopPropagation()},onKeyDown:s=>{s.key==="Escape"&&this.hide()},className:X("popper",{interactive:i},e),onBlur:a?this.handleBlur:void 0,tabIndex:a?-1:void 0,role:"presentation",children:h.jsxs("div",{className:"popper-content",children:[t,h.jsx("div",{className:"popper-arrow","x-arrow":""})]})})})}render(){var{popper:e}=this.state,{"data-testid":t}=this.props;return h.jsx("div",{className:"popper-parent-container",ref:this.container,style:{display:"none"},"data-testid":t,children:e&&bd.createPortal(this.renderContent(),this.element)})}}vo(nc,"propTypes",{children:V.node.isRequired,options:V.shape({}),className:V.string,timeout:V.number,onEntered:V.func,onExited:V.func,isShown:V.bool,closeOnBlur:V.bool,interactive:V.bool,referenceObject:V.shape({}),"data-testid":V.string});vo(nc,"defaultProps",{options:{},className:"",timeout:et.transitionMs,onEntered(){},onExited(){},isShown:!1,interactive:!1,closeOnBlur:!1,referenceObject:null,"data-testid":void 0});const La=nc;function Nm(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function IE(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Nm(Object(t),!0).forEach(function(r){yn(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Nm(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function yn(n,e,t){return e=FE(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function FE(n){var e=_E(n,"string");return typeof e=="symbol"?e:String(e)}function _E(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var ME=ie.module("Tooltip");class Tt extends w.Component{static handleHidden(){Tt.shownTooltipCount-=1,Tt.shownTooltipCount===0&&(Tt.lastHiddenTime=Date.now())}static handleShown(){Tt.shownTooltipCount+=1}constructor(e){super(e),yn(this,"container",void 0),yn(this,"popper",void 0),yn(this,"parent",void 0),yn(this,"timer",void 0),this.handleMouseMove=this.handleMouseMove.bind(this),this.handleMouseLeave=this.handleMouseLeave.bind(this),this.handleWindowMouseMove=this.handleWindowMouseMove.bind(this),this.handleWheel=this.handleWheel.bind(this),this.handleTimeout=this.handleTimeout.bind(this),this.handleExited=this.handleExited.bind(this),this.stopShowingTooltip=this.stopShowingTooltip.bind(this),this.container=oe.createRef(),this.popper=oe.createRef(),this.parent=null,this.timer=null,this.state={isShown:!1}}componentDidMount(){this.startListening();var{timeout:e}=this.props;e===0&&this.show()}componentDidUpdate(e,t){var{isShown:r}=t,{isShown:i}=this.state;i!==r&&(i?Tt.handleShown():Tt.handleHidden())}componentWillUnmount(){this.stopListening(),this.stopListeningWindow(),this.stopTimer();var{isShown:e}=this.state;e&&Tt.handleHidden()}startListening(){if(!this.container.current||!this.container.current.parentElement){ME.error("Tooltip doesn't have a container or a parent set!");return}this.parent=this.container.current.parentElement,this.parent.addEventListener("mousemove",this.handleMouseMove),this.parent.addEventListener("mouseleave",this.handleMouseLeave),this.parent.addEventListener("mousedown",this.stopShowingTooltip)}stopListening(){this.parent&&(this.parent.removeEventListener("mousemove",this.handleMouseMove),this.parent.removeEventListener("mouseleave",this.handleMouseLeave),this.parent.removeEventListener("mousedown",this.stopShowingTooltip))}startListeningWindow(){window.addEventListener("mousemove",this.handleWindowMouseMove,!0),window.addEventListener("contextmenu",this.stopShowingTooltip,!0),window.addEventListener("wheel",this.handleWheel)}stopListeningWindow(){window.removeEventListener("mousemove",this.handleWindowMouseMove,!0),window.removeEventListener("contextmenu",this.stopShowingTooltip,!0),window.removeEventListener("wheel",this.handleWheel)}handleMouseMove(){this.startTimer()}handleWheel(){var{isShown:e}=this.state;this.popper.current&&this.parent&&e&&!this.popper.current.element.matches(":hover")&&!this.parent.matches(":hover")&&(this.stopTimer(),this.hide())}handleMouseLeave(){var{isShown:e}=this.state;this.stopTimer();var{interactive:t}=this.props;!t&&e&&this.hide()}handleTimeout(){this.show()}handleWindowMouseMove(e){var t=e.clientX,r=e.clientY,{isShown:i}=this.state;if(!(!this.popper.current||!this.parent)){var a=this.popper.current.element.getBoundingClientRect(),o=this.parent.getBoundingClientRect();t>=a.left&&t<=a.left+a.width&&r>=a.top&&r<=a.top+a.height?this.handleMouseMove():t>=o.left&&t<=o.left+o.width&&r>=o.top&&r<=o.top+o.height?this.handleMouseMove():i&&(this.stopTimer(),this.hide())}}startTimer(){this.stopTimer();var{timeout:e,reshowTimeout:t}=this.props,r=e;(Tt.shownTooltipCount>0||Date.now()-Tt.lastHiddenTime<Tt.triggerReshowThreshold)&&(r=t),this.timer=window.setTimeout(this.handleTimeout,r)}stopTimer(){this.timer!=null&&(clearTimeout(this.timer),this.timer=null)}show(){var{isShown:e}=this.state;if(this.stopTimer(),!e){var t;(t=this.popper.current)===null||t===void 0||t.show(),this.setState({isShown:!0});var{interactive:r}=this.props;r&&this.startListeningWindow()}}hide(){var e;(e=this.popper.current)===null||e===void 0||e.hide(),this.stopListeningWindow()}update(){var e;(e=this.popper.current)===null||e===void 0||e.scheduleUpdate()}handleExited(){this.setState({isShown:!1});var{onExited:e}=this.props;e()}stopShowingTooltip(){var{isShown:e}=this.state;this.stopTimer(),e&&this.hide()}render(){var{interactive:e,children:t,referenceObject:r,popperClassName:i,"data-testid":a,onEntered:o}=this.props,{isShown:s}=this.state,{options:l}=this.props;return l=IE({placement:"bottom"},l),h.jsx("div",{ref:this.container,style:{display:"none"},"data-testid":a,children:h.jsx(La,{className:X(i,"popper-tooltip"),options:l,ref:this.popper,onEntered:o,onExited:this.handleExited,interactive:e,referenceObject:r,children:h.jsxs("div",{className:"tooltip-content",children:[" ",s&&t]})})})}}yn(Tt,"defaultTimeout",500);yn(Tt,"defaultReshowTimeout",100);yn(Tt,"triggerReshowThreshold",300);yn(Tt,"shownTooltipCount",0);yn(Tt,"lastHiddenTime",Date.now());yn(Tt,"defaultProps",{interactive:!1,options:{},popperClassName:"",reshowTimeout:Tt.defaultReshowTimeout,timeout:Tt.defaultTimeout,onEntered:()=>{},onExited:()=>{},"data-testid":void 0});const Ot=Tt;function Ab(){var n=w.useRef(!1);return w.useEffect(()=>(n.current=!0,()=>{n.current=!1}),[]),n}function Rm(n,e,t,r,i,a,o){try{var s=n[a](o),l=s.value}catch(d){t(d);return}s.done?e(l):Promise.resolve(l).then(r,i)}function xE(n){return function(){var e=this,t=arguments;return new Promise(function(r,i){var a=n.apply(e,t);function o(l){Rm(a,r,i,o,s,"next",l)}function s(l){Rm(a,r,i,o,s,"throw",l)}o(void 0)})}}var AE=ie.module("useAsyncInterval");function LE(n,e){var t=Ab(),r=w.useRef(0),i=w.useRef(0),a=w.useRef(null),o=w.useCallback(xE(function*(){var s=Date.now();i.current+=1;var l=a.current==null?e:s-a.current;a.current=s;try{yield n()}catch(c){AE.error("A tick error occurred:",c)}if(t.current){l+=Date.now()-a.current;var d=Math.max(0,l-e),u=Math.max(0,e-d);r.current=window.setTimeout(o,u)}}),[n,t,e]);w.useEffect(()=>(a.current=null,o(),()=>{window.clearTimeout(r.current)}),[e,o])}function Nd(n){var e=w.useRef();return w.useEffect(function(){e.current=n}),e.current}function ic(n){var e=w.useRef(null);return w.useEffect(function(){n&&(typeof n=="function"?n(e.current):n.current=e.current)}),e}var kE=3500,jE=ie.module("useCopyToClipboard");function $E(){var[n,e]=w.useState(!1),t=w.useRef(null),r=w.useCallback(i=>{Ro(i).then(()=>{e(!0)}).catch(a=>jE.error("Unable to copy ".concat(i),`
|
|
2
|
-
`,a))},[]);return w.useEffect(()=>(t.current&&clearTimeout(t.current),n&&(t.current=setTimeout(()=>{e(!1)},kE)),()=>{t.current&&clearTimeout(t.current)}),[n]),[n,r]}function Rd(n){var{children:e,className:t,style:r,"data-testid":i}=n;return h.jsx("div",{className:X("btn-group",t),style:r,role:"group","data-testid":i,children:e})}Rd.displayName="ButtonGroup";Rd.propTypes={children:V.node.isRequired,className:V.string,style:V.object,"data-testid":V.string};Rd.defaultProps={className:null,style:{},"data-testid":void 0};var HE=["kind","variant","type","tooltip","icon","disabled","active","onClick","onContextMenu","onMouseDown","onMouseUp","onMouseEnter","onMouseLeave","onKeyDown","className","style","children","tabIndex","data-testid","aria-label"];function Im(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function Fm(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Im(Object(t),!0).forEach(function(r){BE(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Im(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function BE(n,e,t){return e=UE(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function UE(n){var e=VE(n,"string");return typeof e=="symbol"?e:String(e)}function VE(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function GE(n,e){if(n==null)return{};var t=WE(n,e),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(n);for(i=0;i<a.length;i++)r=a[i],!(e.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(n,r)&&(t[r]=n[r])}return t}function WE(n,e){if(n==null)return{};var t={},r=Object.keys(n),i,a;for(a=0;a<r.length;a++)i=r[a],!(e.indexOf(i)>=0)&&(t[i]=n[i]);return t}var zE=["primary","secondary","tertiary","success","danger","inline","ghost"],KE=["group-end"];function qE(n,e){switch(n){case"primary":return"btn-primary";case"secondary":return"btn-outline-primary";case"tertiary":return"btn-secondary";case"success":return"btn-success";case"danger":return"btn-danger";case"inline":return"btn-inline";case"ghost":return X("btn-link",{"btn-link-icon":e,"btn-link-icon-only":e})}}function YE(n){switch(n){case"group-end":return X("pl-2","pr-3")}}var Id=oe.forwardRef((n,e)=>{var{kind:t,variant:r,type:i,tooltip:a,icon:o,disabled:s=!1,active:l,onClick:d,onContextMenu:u,onMouseDown:c,onMouseUp:m,onMouseEnter:v,onMouseLeave:f,onKeyDown:g,className:p,style:b,children:S,tabIndex:C,"data-testid":y,"aria-label":E}=n,T=GE(n,HE),O;r&&(O=YE(r));var N;o&&(N=oe.isValidElement(o)?o:h.jsx(ue,{icon:o}));var P=N!=null&&S==null,R=qE(t,P),A;a!==void 0&&(A=typeof a=="string"?h.jsx(Ot,{children:a}):a);var M=E;E===void 0&&P&&a!=null&&typeof a=="string"&&(M=a);var I=h.jsxs("button",Fm(Fm({"data-testid":y,ref:e,type:i,className:X("btn",R,O,{active:l},p),onClick:d,onContextMenu:u,onMouseUp:m,onMouseDown:c,onMouseEnter:v,onMouseLeave:f,onKeyDown:g,style:b,disabled:s,tabIndex:C,"aria-label":M},T),{},{children:[o&&N,S,a!=null&&!s&&A]}));return s&&a!=null?h.jsxs("span",{className:"btn-disabled-wrapper",children:[I,A]}):I});Id.displayName="Button";Id.propTypes={kind:V.oneOf(zE).isRequired,variant:V.oneOf(KE),type:V.oneOf(["submit","reset","button"]),tooltip(n){var{tooltip:e,icon:t,children:r}=n;return e===void 0&&t!=null&&r==null?new Error("Tooltip is required for icon only buttons"):null},icon(n){var{children:e,icon:t}=n;return t==null&&e==null?new Error("Icon is required if no children are provided"):e==null&&!oe.isValidElement(t)&&(t==null||t.iconName===""||t.iconName==null)?new Error("Icon must be react element or fontawesome IconDefinition"):null},disabled:V.bool,active:V.bool,onClick(n){var{onClick:e,type:t}=n;return t==="button"&&typeof e!="function"?new Error("type button requires an onClick function"):e!==void 0&&typeof e!="function"?new Error("onClick must be a function"):null},onContextMenu:V.func,onMouseUp:V.func,onMouseDown:V.func,onMouseEnter:V.func,onMouseLeave:V.func,onKeyDown:V.func,tabIndex:V.number,children:V.node,className:V.string,style:V.object,"data-testid":V.string};Id.defaultProps={type:"button",onClick:void 0,onContextMenu:void 0,onMouseUp:void 0,onMouseDown:void 0,onMouseEnter:void 0,onMouseLeave:void 0,onKeyDown:void 0,variant:void 0,tooltip:void 0,icon:void 0,disabled:!1,active:void 0,tabIndex:void 0,children:void 0,className:void 0,style:{},"data-testid":void 0};const K=Id;function ac(n){var{className:e="modal-footer",children:t,"data-testid":r}=n;return h.jsx("div",{className:e,"data-testid":r,children:t})}function Ma(n){var{isOpen:e,headerText:t,bodyText:r,onCancel:i,onConfirm:a,onDiscard:o,onModalDisable:s,cancelButtonText:l="Cancel",confirmButtonText:d="Okay",discardButtonText:u="Discard",isConfirmDanger:c=!1,children:m,"data-testid":v}=n,f=w.useRef(null),g=w.useRef(null),p=w.useCallback(()=>{g.current!==null&&g.current.checked&&s&&s(),a()},[a,s]),b=w.useCallback(()=>{var C;(C=f.current)===null||C===void 0||C.focus()},[]),S="";return e&&(S=typeof r=="function"?r():r),h.jsxs(wd,{isOpen:e,onOpened:b,children:[h.jsx(yd,{closeButton:!1,children:t}),h.jsx(Ed,{children:S}),h.jsxs(ac,{children:[s&&h.jsxs("div",{className:"custom-control custom-checkbox form-group mr-auto",children:[h.jsx("input",{type:"checkbox",className:"custom-control-input",id:"move-confirmation-checkbox",defaultChecked:!1,ref:g,"data-testid":v!==void 0?"".concat(v,"-checkbox-confirm"):void 0}),h.jsx("label",{className:"custom-control-label",htmlFor:"move-confirmation-checkbox",children:"Don't ask me again"})]}),o&&h.jsx(K,{kind:"secondary",className:"mr-auto","data-dismiss":"modal",onClick:o,"data-testid":v!==void 0?"".concat(v,"-btn-discard"):void 0,children:u}),i&&h.jsx(K,{kind:"secondary","data-dismiss":"modal",onClick:i,"data-testid":v!==void 0?"".concat(v,"-btn-cancel"):void 0,children:l}),h.jsxs(Rd,{children:[h.jsx(K,{kind:c?"danger":"primary",onClick:p,ref:f,"data-testid":v!==void 0?"".concat(v,"-btn-confirm"):void 0,children:d}),m]})]})]})}Ma.propTypes={isOpen:V.bool.isRequired,headerText:V.string.isRequired,bodyText:V.oneOfType([V.string,V.func]).isRequired,onCancel:V.func,onConfirm:V.func.isRequired,onDiscard:V.func,onModalDisable:V.func,cancelButtonText:V.string,confirmButtonText:V.string,discardButtonText:V.string,children:V.node,"data-testid":V.string};Ma.defaultProps={children:void 0,cancelButtonText:"Cancel",confirmButtonText:"Okay",discardButtonText:"Discard",onCancel:void 0,onDiscard:void 0,onModalDisable:void 0,"data-testid":void 0};var Fd=oe.forwardRef((n,e)=>{var{children:t,className:r,disabled:i,onClick:a,style:o,id:s}=n;return h.jsx("button",{ref:e,type:"button",className:X("btn",r),onClick:a,style:o,disabled:i,id:s,children:t})});Fd.displayName="Button";Fd.propTypes={children:V.node,className:V.string,disabled:V.bool,onClick:V.func,style:V.shape({}),id:V.string};Fd.defaultProps={children:null,className:"",disabled:!1,onClick:()=>null,style:{},id:""};const _m=Fd;function oc(n){var{className:e,isFlipped:t,children:r,"data-testid":i}=n,a=d=>{if(r.length!==2)throw new Error("CardFlip requires 2 children to function");return r[d]},o=w.useRef(null),s=w.useCallback(d=>{d.target===d.currentTarget&&document.body.classList.add("card-flip--is-flipping")},[]),l=w.useCallback(d=>{d.target===d.currentTarget&&document.body.classList.remove("card-flip--is-flipping")},[]);return w.useEffect(function(){if(!o.current)throw Error("ref undefined");o.current.addEventListener("transitionstart",s);var u=o.current;return function(){if(u!=null)return u.removeEventListener("transitionstart",s)}},[s]),h.jsxs("div",{className:X(e,{"card-flip--show-front":t,"card-flip--show-back":!t}),"data-testid":i,children:[h.jsx("div",{className:"card-flip--back",children:a(0)}),h.jsx("div",{ref:o,className:"card-flip--front",onTransitionEnd:l,children:a(1)})]})}var Mm=ie.module("GlobalContextAction");class XE extends w.Component{constructor(e){super(e),this.handleContextMenu=this.handleContextMenu.bind(this),this.handleKeyDown=this.handleKeyDown.bind(this)}componentDidMount(){document.body.addEventListener("contextmenu",this.handleContextMenu),document.body.addEventListener("keydown",this.handleKeyDown)}componentWillUnmount(){document.body.removeEventListener("contextmenu",this.handleContextMenu),document.body.removeEventListener("keydown",this.handleKeyDown)}handleContextMenu(e){var t=e;t.contextActions==null&&(t.contextActions=[]);var{action:r}=this.props;r.title==null&&!r.menuElement||(t.contextActions==null&&(t.contextActions=[]),t.contextActions.push(r),Mm.debug("Received context menu event at global action! Menu items are now: ",t.contextActions))}handleKeyDown(e){var{action:t}=this.props;if(!lt.actionsDisabled&&t.shortcut!==void 0&&t.shortcut.matchesEvent(e)){var r;Mm.debug("Global hotkey matched!",e),(r=t.action)===null||r===void 0||r.call(t,e),e.preventDefault(),e.stopPropagation()}}render(){return null}}const QE=XE;class ZE extends w.Component{render(){for(var{actions:e,"data-testid":t}=this.props,r=[],i=0;i<e.length;i+=1){var a=e[i],{shortcut:o}=a;if(a.title!=null||a.menuElement||o){var s=h.jsx(QE,{action:a,"data-testid":t},"".concat(a.title,".").concat(o==null?void 0:o.id));r.push(s)}}return r}}const JE=ZE;function Lb(n,e,t){return e=eT(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function eT(n){var e=tT(n,"string");return typeof e=="symbol"?e:String(e)}function tT(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var al=ie.module("ContextActions");class kb extends w.Component{static triggerMenu(e,t,r,i){if(i.length!==0){var a=new MouseEvent("contextmenu",{clientX:t,clientY:r,bubbles:!0,cancelable:!0});a.contextActions=i,e.dispatchEvent(a)}}constructor(e){super(e),Lb(this,"container",void 0),this.handleContextMenu=this.handleContextMenu.bind(this),this.handleKeyDown=this.handleKeyDown.bind(this),this.container=oe.createRef(),this.state={globalActions:[],keyboardActions:[]}}static getDerivedStateFromProps(e){if(e.actions==null||!Array.isArray(e.actions))return{globalActions:[],keyboardActions:[]};var t=e.actions.filter(i=>!xu(i)&&typeof i!="function"&&i.isGlobal),r=e.actions.filter(i=>!xu(i)&&typeof i!="function"&&(i.isGlobal===void 0||!i.isGlobal)&&i.shortcut!=null);return{globalActions:t,keyboardActions:r}}componentDidMount(){var e;(e=this.container.current)!==null&&e!==void 0&&e.parentElement&&(this.container.current.parentElement.addEventListener("contextmenu",this.handleContextMenu),this.container.current.parentElement.addEventListener("keydown",this.handleKeyDown))}componentWillUnmount(){var e;(e=this.container.current)!==null&&e!==void 0&&e.parentElement&&(this.container.current.parentElement.removeEventListener("contextmenu",this.handleContextMenu),this.container.current.parentElement.removeEventListener("keydown",this.handleKeyDown))}handleContextMenu(e){var{ignoreClassNames:t=[]}=this.props;if(t.length>0)for(var r=e.target,i=function(){var{classList:d}=r,u=t.find(c=>d.contains(c));if(u!==void 0)return al.debug2('Contextmenu event ignored based on the target className "'.concat(u,'"')),{v:void 0};r=r.parentElement};r!=null;){var a=i();if(typeof a=="object")return a.v}if(lt.isContextActionEvent(e)||(e.contextActions=[]),!!lt.isContextActionEvent(e)){var{actions:o}=this.props;if(o!=null){var s=o;Array.isArray(s)&&(s=s.filter(l=>xu(l)||typeof l=="function"||l.isGlobal===void 0||!l.isGlobal)),e.contextActions=e.contextActions.concat(s)}al.debug("Received context menu event! Menu items are now: ",e.contextActions)}}handleKeyDown(e){for(var{keyboardActions:t}=this.state,r=0;r<t.length;r+=1){var i=t[r];if(!lt.actionsDisabled&&i.shortcut!=null&&i.shortcut.matchesEvent(e)){var a;al.debug("Context hotkey matched!",e),(a=i.action)===null||a===void 0||a.call(i,e),e.stopPropagation(),e.preventDefault(),al.debug2("Matched hotkey returned false, key event not consumed")}}}render(){var{"data-testid":e}=this.props,{globalActions:t}=this.state;return h.jsx("div",{className:"context-actions-listener",ref:this.container,"data-testid":e,children:h.jsx(JE,{actions:t})})}}Lb(kb,"groups",{default:void 0,high:100,medium:5e3,low:1e4,global:1e5,edit:100});const le=kb;var _d=oe.forwardRef((n,e)=>{var{checked:t=!1,children:r,className:i,disabled:a,inputClassName:o,isInvalid:s,labelClassName:l,name:d,onChange:u,"data-testid":c}=n,[m]=w.useState(qe()),v=ic(e);w.useEffect(function(){v.current&&(v.current.indeterminate=t===null)},[v,t]);var f=w.useCallback(g=>{v.current&&(v.current.indeterminate=t===null),u&&u(g)},[v,t,u]);return h.jsxs("div",{className:X("custom-control custom-checkbox",i),children:[h.jsx("input",{type:"checkbox",ref:v,checked:t??!1,className:X("custom-control-input",o,{"is-invalid":s}),disabled:a,id:m,name:d,onChange:f,"data-testid":c}),h.jsx("label",{className:X("custom-control-label",l),htmlFor:m,children:r})]})});_d.displayName="Checkbox";_d.propTypes={checked:(n,e)=>{var{[e]:t}=n;return t!==null&&typeof t!="boolean"?new Error("Checked must be a boolean or null for indeterminate"):null},children:V.node.isRequired,className:V.string,disabled:V.bool,inputClassName:V.string,isInvalid:V.bool,labelClassName:V.string,name:V.string,onChange:V.func,"data-testid":V.string};_d.defaultProps={checked:!1,className:"",disabled:!1,inputClassName:"",isInvalid:!1,labelClassName:"",name:void 0,onChange:void 0,"data-testid":void 0};const zn=_d;function Ui(n,e,t){return e=rT(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function rT(n){var e=nT(n,"string");return typeof e=="symbol"?e:String(e)}function nT(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var xm=ie.module("Shortcut"),he;(function(n){n.CTRL="MODIFIER_CTRL",n.CMD="MODIFIER_CMD",n.ALT="MODIFIER_ALT",n.OPTION="MODIFIER_OPTION",n.SHIFT="MODIFIER_SHIFT"})(he||(he={}));var de;(function(n){n.A="A",n.B="B",n.C="C",n.D="D",n.E="E",n.F="F",n.G="G",n.H="H",n.I="I",n.J="J",n.K="K",n.L="L",n.M="M",n.N="N",n.O="O",n.P="P",n.Q="Q",n.R="R",n.S="S",n.T="T",n.U="U",n.V="V",n.W="W",n.X="X",n.Y="Y",n.Z="Z",n.ZERO="0",n.ONE="1",n.TWO="2",n.THREE="3",n.FOUR="4",n.FIVE="5",n.SIX="6",n.SEVEN="7",n.EIGHT="8",n.NINE="9",n.BACKSPACE="Backspace",n.ESCAPE="Escape",n.ENTER="Enter",n.DELETE="Delete",n.SLASH="/",n.QUESTION_MARK="?",n.BACKSLASH="\\",n.PIPE="|",n.MINUS="-",n.UNDERSCORE="_",n.EQUALS="=",n.PLUS="+",n.BACKTICK="`",n.TILDE="~",n.COMMA=",",n.LEFT_CHEVRON="<",n.PERIOD=".",n.RIGHT_CHEVRON=">",n.SEMICOLON=";",n.COLON=":",n.SINGLE_QUOTE="'",n.DOUBLE_QUOTE='"',n.LEFT_BRACKET="[",n.RIGHT_BRACKET="]",n.LEFT_CURLY="{",n.RIGHT_CURLY="}",n.F1="F1",n.F2="F2",n.F3="F3",n.F4="F4",n.F5="F5",n.F6="F6",n.F7="F7",n.F8="F8",n.F9="F9",n.F10="F10",n.F11="F11",n.F12="F12"})(de||(de={}));var iT=new Set([de.ENTER,de.DELETE,de.F1,de.F2,de.F3,de.F4,de.F5,de.F6,de.F7,de.F8,de.F9,de.F10,de.F11,de.F12]);class pt extends Bh{static isAllowedKey(e){return Object.values(de).includes(e)}static isValidKeyState(e){var{keyValue:t}=e;if(t===null)return!0;if(!pt.isMacPlatform&&e.metaKey||!pt.isAllowedKey(t))return!1;var r=!e.altKey&&!e.ctrlKey&&!e.metaKey&&!e.shiftKey;return!r||iT.has(t)}static createKeyState(e){var t={altKey:!1,ctrlKey:!1,metaKey:!1,shiftKey:!1,keyValue:e[e.length-1]};return e.forEach(r=>{switch(r){case he.CTRL:t.ctrlKey=!0;break;case he.ALT:case he.OPTION:t.altKey=!0;break;case he.CMD:t.metaKey=!0;break;case he.SHIFT:t.shiftKey=!0;break}}),t}static getKeyStateFromEvent(e){var{key:t,keyCode:r}=e,i="";return t==="Shift"||t==="Meta"||t==="Control"||t==="Alt"?i="":!pt.isAllowedKey(t)&&pt.isAllowedKey(String.fromCharCode(r))?i=String.fromCharCode(r):i=t,{keyValue:i,altKey:e.altKey,ctrlKey:e.ctrlKey,metaKey:e.metaKey,shiftKey:e.shiftKey}}static getWindowsDisplayText(e){var t="";return e.ctrlKey&&(t+="Ctrl+"),e.altKey&&(t+="Alt+"),e.shiftKey&&(t+="Shift+"),e.keyValue===de.ESCAPE?t+="Esc":e.keyValue!==null&&(t+=e.keyValue),t}static getMacDisplayText(e){var t="";switch(e.ctrlKey&&(t+="⌃"),e.altKey&&(t+="⌥"),e.shiftKey&&(t+="⇧"),e.metaKey&&(t+="⌘"),e.keyValue){case de.ENTER:t+="⏎";break;case de.ESCAPE:t+="⎋";break;case de.BACKSPACE:t+="⌫";break;case de.DELETE:t+="⌦";break;case null:break;default:t+=e.keyValue}return t}static doKeyStatesMatch(e,t){var r,i;return((r=e.keyValue)===null||r===void 0?void 0:r.toUpperCase())===((i=t.keyValue)===null||i===void 0?void 0:i.toUpperCase())&&e.altKey===t.altKey&&e.ctrlKey===t.ctrlKey&&e.metaKey===t.metaKey&&e.shiftKey===t.shiftKey}static getDisplayText(e){return e.keyValue===null?"":pt.isMacPlatform?pt.getMacDisplayText(e):pt.getWindowsDisplayText(e)}constructor(e){var{id:t,shortcut:r,macShortcut:i,isEditable:a=!0,name:o,tooltip:s}=e;super(),Ui(this,"id",void 0),Ui(this,"name",void 0),Ui(this,"tooltip",void 0),Ui(this,"isEditable",void 0),Ui(this,"defaultKeyState",void 0),Ui(this,"keyState",void 0),this.id=t,this.name=o,this.tooltip=s,this.isEditable=a;var l=pt.isMacPlatform,d=l?i:r;this.defaultKeyState=pt.createKeyState(d),this.keyState=this.defaultKeyState}getDisplayText(){return pt.getDisplayText(this.keyState)}getKeyState(){return this.keyState}setKeyState(e){pt.isValidKeyState(e)?(xm.debug2("Shortcut ".concat(this.id," updated to ").concat(JSON.stringify(e))),this.keyState=e,this.dispatchEvent(new Qe("onUpdate",{detail:this}))):xm.debug2("Shortcut ".concat(this.id," tried to update to invalid keyState ").concat(JSON.stringify(e)))}getDefaultKeyState(){return this.defaultKeyState}isDefault(){return pt.doKeyStatesMatch(this.getDefaultKeyState(),this.getKeyState())}setToNull(){this.setKeyState(pt.NULL_KEY_STATE)}isNull(){return pt.doKeyStatesMatch(this.keyState,pt.NULL_KEY_STATE)}setToDefault(){this.setKeyState(this.defaultKeyState)}matchesKeyState(e){return pt.doKeyStatesMatch(e,this.keyState)}matchesEvent(e){return this.matchesKeyState(pt.getKeyStateFromEvent(e))}}Ui(pt,"NULL_KEY_STATE",{metaKey:!1,shiftKey:!1,altKey:!1,ctrlKey:!1,keyValue:null});Ui(pt,"isMacPlatform",lt.isMacPlatform());function Am(n,e,t){return e=aT(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function aT(n){var e=oT(n,"string");return typeof e=="symbol"?e:String(e)}function oT(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var Lm=ie.module("ShortcutRegistry");class sT extends Bh{constructor(){super(...arguments),Am(this,"shortcutMap",new Map),Am(this,"shortcutsByCategory",new Map)}createAndAdd(e){var t=new pt(e);return this.add(t)}add(e){var t=this.shortcutMap.get(e.id);if(t)return Lm.warn("Skipping attempt to add duplicate shortcut ID to registry: ".concat(e.id)),t;Lm.debug2("Adding shortcut to registry: ".concat(e.id)),e.addEventListener("onUpdate",a=>{var{detail:o}=a;return this.dispatchEvent(new Qe("onUpdate",{detail:o}))});var r=e.id.split(".")[0];if(this.shortcutMap.set(e.id,e),this.shortcutsByCategory.has(r)){var i;(i=this.shortcutsByCategory.get(r))===null||i===void 0||i.push(e)}else this.shortcutsByCategory.set(r,[e]);return e}get(e){return this.shortcutMap.get(e)}getConflictingShortcuts(e){return Array.from(this.shortcutMap.values()).filter(t=>!t.isNull()&&t.matchesKeyState(e))}}var lT=Object.freeze(new sT);const $e=lT;var dT={COPY:$e.createAndAdd({id:"GLOBAL.COPY",name:"Copy",shortcut:[he.CTRL,de.C],macShortcut:[he.CMD,de.C],isEditable:!1}),PASTE:$e.createAndAdd({id:"GLOBAL.PASTE",name:"Paste",shortcut:[he.CTRL,de.V],macShortcut:[he.CMD,de.V],isEditable:!1}),SAVE:$e.createAndAdd({id:"GLOBAL.SAVE",name:"Save",shortcut:[he.CTRL,de.S],macShortcut:[he.CMD,de.S],isEditable:!1}),SELECT_ALL:$e.createAndAdd({id:"GLOBAL.SELECT_ALL",name:"Select All",shortcut:[he.CTRL,de.A],macShortcut:[he.CMD,de.A],isEditable:!1}),LINKER:$e.createAndAdd({id:"GLOBAL.LINKER",name:"Linker",shortcut:[he.CTRL,de.L],macShortcut:[he.CMD,de.L]}),LINKER_CLOSE:$e.createAndAdd({id:"GLOBAL.LINKER_CLOSE",name:"Close Linker Overlay",shortcut:[de.ESCAPE],macShortcut:[de.ESCAPE],isEditable:!1}),COPY_VERSION_INFO:$e.createAndAdd({id:"GLOBAL.COPY_VERSION_INFO",name:"Copy Version Info",shortcut:[he.CTRL,he.ALT,de.I],macShortcut:[he.CMD,he.SHIFT,de.I],isEditable:!0}),NEXT:$e.createAndAdd({id:"GLOBAL.NEXT",name:"Next",shortcut:[de.ENTER],macShortcut:[de.ENTER],isEditable:!1}),PREVIOUS:$e.createAndAdd({id:"GLOBAL.PREVIOUS",name:"Previous",shortcut:[he.SHIFT,de.ENTER],macShortcut:[he.SHIFT,de.ENTER],isEditable:!1})};const Vn=dT;function mh(n,e,t){return e=uT(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function uT(n){var e=hT(n,"string");return typeof e=="symbol"?e:String(e)}function hT(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class jb extends w.PureComponent{constructor(e){super(e),mh(this,"inputField",void 0),mh(this,"searchChangeSelection",void 0),this.inputField=oe.createRef(),this.searchChangeSelection=oe.createRef()}componentDidMount(){this.setInputPaddingRight()}componentDidUpdate(){this.setInputPaddingRight()}focus(){var e;(e=this.inputField.current)===null||e===void 0||e.focus()}setInputPaddingRight(){var e=this.inputField.current,t=this.searchChangeSelection.current;if(e&&t){var r=t.getBoundingClientRect().width;e.style.paddingRight="".concat(r,"px")}}render(){var{value:e,placeholder:t,onBlur:r,onChange:i,className:a,disabled:o,matchCount:s,id:l,onKeyDown:d,"data-testid":u,cursor:c}=this.props,m,v=[{action:()=>c==null?void 0:c.next("forward"),shortcut:Vn.NEXT},{action:()=>c==null?void 0:c.next("back"),shortcut:Vn.PREVIOUS}];return c&&s>1?m=h.jsxs(h.Fragment,{children:[h.jsx(K,{kind:"ghost",className:"search-change-button",type:"button",onClick:()=>{c.next("back")},icon:Cb,tooltip:"Previous match (".concat(Vn.PREVIOUS.getDisplayText(),")")}),h.jsxs("span",{className:"search-change-text",children:[c.index!==void 0&&"".concat(c.index+1," of "),s]}),h.jsx(K,{kind:"ghost",className:"search-change-button",type:"button",onClick:()=>{c.next("forward")},icon:xy,tooltip:"Next match (".concat(Vn.NEXT.getDisplayText(),")")})]}):m=s>0&&h.jsx("span",{className:"search-match",children:s}),h.jsxs("div",{className:X("search-group",a),children:[h.jsx("input",{type:"search",value:e,onBlur:r,onChange:i,onKeyDown:d,className:"form-control",disabled:o,placeholder:t,ref:this.inputField,id:l,"data-testid":u}),s!=null?h.jsxs(h.Fragment,{children:[h.jsx("div",{className:"search-change-selection",ref:this.searchChangeSelection,children:m}),h.jsx(le,{actions:v})]}):h.jsx("span",{className:"search-icon",children:h.jsx(ue,{icon:Sb})})]})}}mh(jb,"defaultProps",{placeholder:"Search",className:"",matchCount:null,onKeyDown(){},id:"","data-testid":void 0,cursor:void 0});const ka=jb;function km(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function cT(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?km(Object(t),!0).forEach(function(r){en(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):km(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function en(n,e,t){return e=mT(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function mT(n){var e=vT(n,"string");return typeof e=="symbol"?e:String(e)}function vT(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var vh;(function(n){n.UP="UP",n.DOWN="DOWN"})(vh||(vh={}));class Gn extends w.Component{constructor(e){super(e),en(this,"popper",void 0),en(this,"cbContainer",void 0),en(this,"toggleButton",void 0),en(this,"menuContainer",void 0),en(this,"input",void 0),en(this,"searchInput",void 0),en(this,"getCachedFilteredOptions",Se((t,r)=>t.filter(i=>i.title.toLowerCase().indexOf(r.toLowerCase())>=0||i.value.toLowerCase().indexOf(r.toLowerCase())>=0))),this.state={value:"",filter:"",filteredOptions:e.options,keyboardOptionIndex:-1,menuIsOpen:!1,inputWidth:100},this.toggleMenu=this.toggleMenu.bind(this),this.handleMenuKeyDown=this.handleMenuKeyDown.bind(this),this.handleMenuBlur=this.handleMenuBlur.bind(this),this.closeMenu=this.closeMenu.bind(this),this.handleInputChange=this.handleInputChange.bind(this),this.handleInputKeyDown=this.handleInputKeyDown.bind(this),this.handleInputBlur=this.handleInputBlur.bind(this),this.handleFilterChange=this.handleFilterChange.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.popper=oe.createRef(),this.cbContainer=oe.createRef(),this.toggleButton=oe.createRef(),this.menuContainer=oe.createRef(),this.input=oe.createRef(),this.searchInput=oe.createRef()}componentDidUpdate(){var{menuIsOpen:e,keyboardOptionIndex:t}=this.state;e&&t>=0&&this.scrollOptionIntoView()}setInputWidth(){this.cbContainer.current&&this.setState({inputWidth:this.cbContainer.current.getBoundingClientRect().width})}focus(){var e;(e=this.input.current)===null||e===void 0||e.focus()}resetValue(){this.setState({value:""})}updateInputValue(e){var{onChange:t}=this.props;this.setState({value:e}),t(e)}handleResize(){this.setInputWidth()}handleMenuKeyDown(e){var t,r,{filter:i,filteredOptions:a,keyboardOptionIndex:o}=this.state,{options:s}=this.props,l=i?a:s;switch(e.key){case"Enter":((t=l[o])===null||t===void 0?void 0:t.value)!=null&&this.updateInputValue(l[o].value),this.closeMenu(),(r=this.input.current)===null||r===void 0||r.focus(),e.stopPropagation(),e.preventDefault();break;case"ArrowUp":this.handleMenuNavigation(Gn.MENU_NAVIGATION_DIRECTION.UP),e.stopPropagation(),e.preventDefault();break;case"ArrowDown":this.handleMenuNavigation(Gn.MENU_NAVIGATION_DIRECTION.DOWN),e.stopPropagation(),e.preventDefault();break;case"Escape":i!==""?(this.setState({filter:""}),e.stopPropagation()):this.closeMenu();break;case"Tab":!e.shiftKey&&o===l.length-1&&this.closeMenu();break}}handleMenuNavigation(e){var{filter:t,filteredOptions:r,keyboardOptionIndex:i}=this.state,{options:a}=this.props,o=t?r:a,s=o.length,l=0;switch(e){case Gn.MENU_NAVIGATION_DIRECTION.UP:l=-1;break;case Gn.MENU_NAVIGATION_DIRECTION.DOWN:l=1;break}l!==0&&this.setState({keyboardOptionIndex:(i+l+s)%s})}handleInputKeyDown(e){var{onEnter:t}=this.props,{menuIsOpen:r}=this.state;e.key==="ArrowDown"||e.key==="ArrowUp"?r||this.openMenu():e.key==="Enter"&&t()}handleInputChange(e){this.updateInputValue(e.target.value)}handleOptionClick(e){var t,r=Number(e.currentTarget.value),{filter:i,filteredOptions:a}=this.state,{options:o}=this.props,s=i?a:o;this.updateInputValue(s[r].value),this.closeMenu(),(t=this.input.current)===null||t===void 0||t.focus()}handleOptionFocus(e){this.setState({keyboardOptionIndex:Number(e.target.value)})}handleFilterChange(e){var t,{options:r}=this.props,i=e.target.value,a=this.getCachedFilteredOptions(r,i);this.setState({filter:i,filteredOptions:a,keyboardOptionIndex:0}),(t=this.popper.current)===null||t===void 0||t.scheduleUpdate()}handleMenuBlur(e){e.relatedTarget instanceof Element&&this.popper.current!=null&&this.popper.current.element.contains(e.relatedTarget)||e.relatedTarget===this.toggleButton.current||this.closeMenu(!1)}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)}handleMenuOpened(){var e;this.scrollOptionIntoView(),(e=this.searchInput.current)===null||e===void 0||e.focus()}handleMenuExited(){var{menuIsOpen:e}=this.state;if(e){var t;this.setState({menuIsOpen:!1}),(t=this.popper.current)===null||t===void 0||t.hide()}this.setState({filter:""})}toggleMenu(e){var{menuIsOpen:t}=this.state;t?this.closeMenu():this.openMenu(),e.stopPropagation()}openMenu(){this.updateKeyboardIndex(),this.setInputWidth(),this.setState({menuIsOpen:!0}),window.requestAnimationFrame(()=>{var e;(e=this.popper.current)===null||e===void 0||e.show()})}closeMenu(){var e,t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;if(this.setState({menuIsOpen:!1}),t){var r;(r=this.input.current)===null||r===void 0||r.focus()}(e=this.popper.current)===null||e===void 0||e.hide()}updateKeyboardIndex(){var{value:e,filter:t,filteredOptions:r}=this.state,{options:i}=this.props,a=t?r:i,o=a.findIndex(s=>s.value===e);this.setState({keyboardOptionIndex:o})}scrollOptionIntoView(){var e,t=(e=this.menuContainer.current)===null||e===void 0?void 0:e.querySelector(".cb-option-btn.keyboard-active");t instanceof HTMLElement&&t.scrollIntoView({block:"nearest",inline:"nearest"})}renderMenuElement(){var{searchPlaceholder:e}=this.props,{filter:t,inputWidth:r}=this.state;return h.jsxs("div",{className:"cb-menu-container",ref:this.menuContainer,role:"presentation",onKeyDown:this.handleMenuKeyDown,onClick:i=>{i.stopPropagation()},style:{width:r},onBlur:this.handleMenuBlur,children:[h.jsx("div",{className:"cb-search-input-container",children:h.jsx(ka,{value:t,ref:this.searchInput,onChange:this.handleFilterChange,className:"cb-search-input",placeholder:e})}),h.jsx("div",{className:"cb-options-container",children:h.jsx("div",{className:"cb-options",children:this.renderOptions()})})]})}renderOptions(){var{options:e}=this.props,{keyboardOptionIndex:t,filter:r,filteredOptions:i}=this.state,a=r?i:e;return a.map((o,s)=>{var l="option-".concat(s,"-").concat(o.value);return h.jsx("button",{type:"button",value:s,className:X("cb-option-btn",{"keyboard-active":t===s}),onClick:this.handleOptionClick,onFocus:this.handleOptionFocus,children:o.title},l)})}render(){var{options:e,inputPlaceholder:t,disabled:r,className:i,defaultValue:a,spellCheck:o,"data-testid":s}=this.props,{value:l}=this.state,{popperOptions:d}=this.props;return d=cT({placement:"bottom-end",modifiers:{preventOverflow:{enabled:!1}}},d),h.jsxs("div",{className:"input-group cb-container",ref:this.cbContainer,children:[h.jsx("input",{value:l||a,className:X("form-control",i,"cb-input"),ref:this.input,onChange:this.handleInputChange,placeholder:t||(e[0]!=null?e[0].title:void 0),disabled:r,onBlur:this.handleInputBlur,onKeyDown:this.handleInputKeyDown,spellCheck:o,"data-testid":s!==void 0?"".concat(s,"-input"):void 0}),h.jsx("div",{className:"input-group-append cb-dropdown",children:h.jsxs("button",{tabIndex:-1,type:"button",className:"btn cb-btn form-control",ref:this.toggleButton,onClick:this.toggleMenu,onKeyDown:this.handleInputKeyDown,disabled:r,"data-testid":s!==void 0?"".concat(s,"-btn"):void 0,children:[h.jsx("span",{className:"cb-caret"}),h.jsx(La,{ref:this.popper,options:d,className:X("combobox interactive"),onEntered:this.handleMenuOpened,onExited:this.handleMenuExited,children:this.renderMenuElement()})]})})]})}}en(Gn,"MENU_NAVIGATION_DIRECTION",vh);en(Gn,"DROP_DOWN_MENU_HEIGHT",200);en(Gn,"propTypes",{options:V.arrayOf(V.shape({title:V.string.isRequired,value:V.string.isRequired})).isRequired,popperOptions:V.shape({title:V.string.isRequired,value:V.string.isRequired}),onChange:V.func,inputPlaceholder:V.string,searchPlaceholder:V.string,disabled:V.bool,className:V.string,defaultValue:V.string,spellCheck:V.bool,onEnter:V.func,"data-testid":V.string});en(Gn,"defaultProps",{onChange(){},inputPlaceholder:"",searchPlaceholder:"Search",disabled:!1,className:"",defaultValue:"",popperOptions:null,spellCheck:!0,onEnter(){},"data-testid":void 0});const $b=Gn;function Md(n){var{copy:e,kind:t="ghost",tooltip:r="Copy",className:i,style:a,"data-testid":o,children:s}=n,[l,d]=$E();return h.jsx(K,{kind:t,className:i,style:a,"data-testid":o,icon:l?Ay:wb,tooltip:l?"Copied":r,onClick:()=>{d(typeof e=="function"?e():e)},children:s})}function Hb(n,e,t){return n.substring(0,e)+t+n.substring(e+1)}function fT(n,e,t){return n.length<t?"".concat(n).concat(e.substring(n.length,t)):n}function jm(n,e){for(var{length:t}=n,r=n.length-1;r>=0&&e[r]===n[r];r-=1)t=r;return n.substring(0,t)}function $m(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function gT(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?$m(Object(t),!0).forEach(function(r){pT(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):$m(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function pT(n,e,t){return e=bT(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function bT(n){var e=CT(n,"string");return typeof e=="symbol"?e:String(e)}function CT(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var hn=ie.module("MaskedInput"),Ya={FORWARD:"forward",BACKWARD:"backward",NONE:"none"},ol=" ",Bb=oe.forwardRef((n,e)=>{var{className:t,example:r,getNextSegmentValue:i=(I,x,_)=>_,getPreferredReplacementString:a=Hb,onChange:o=()=>!1,onSelect:s=()=>!1,onSubmit:l,pattern:d,placeholder:u,selection:c,value:m,onFocus:v=()=>!1,onBlur:f=()=>!1,"data-testid":g}=n,p=ic(e),b=w.useMemo(()=>Array.isArray(r)?r:[r],[r]),S=w.useMemo(()=>b[0].replace(/[a-zA-Z0-9]/g,ol),[b]);w.useEffect(function(){if(c!=null){var x;hn.debug("setting selection...",c);var{selectionStart:_,selectionEnd:k,selectionDirection:U}=c;(x=p.current)===null||x===void 0||x.setSelectionRange(_,k,U),hn.debug("selection set!")}},[c,p]);var C=w.useCallback(I=>{for(var x=I,_=I,k=b.length>0?b[0]:m,U=x-1;U>=0&&/[a-zA-Z0-9]/g.test(k.charAt(U));U-=1)x=U;for(var G=_;G<k.length&&/[a-zA-Z0-9]/g.test(k.charAt(G));G+=1)_=G+1;var Y=x===_?Ya.NONE:Ya.BACKWARD;return{selectionStart:x,selectionEnd:_,selectionDirection:Y}},[b,m]);function y(I,x){for(var _=arguments.length>2&&arguments[2]!==void 0?arguments[2]:I.length,k="",U=0;U<_;U+=1)I.charAt(U)!==ol?k=k.concat(I[U]):k=k.concat(x[U]);return k=k.concat(x.substring(_)),k}function E(I){var x=arguments.length>1&&arguments[1]!==void 0?arguments[1]:I.length,_=new RegExp("^".concat(d,"$"));if(_.test(I))return!0;for(var k=0;k<b.length;k+=1){var U=y(I,b[k],x);if(_.test(U))return!0}return!1}function T(I){var x=C(I),_=x.selectionEnd+1;return _>=m.length?x:C(_)}function O(I){var x=C(I),_=x.selectionStart-1;return _<=0?x:C(_)}function N(I,x){var _=C(I),k=m.substring(_.selectionStart,_.selectionEnd),U=i(_,x,k,m),G=m.substring(0,_.selectionStart)+U+m.substring(_.selectionEnd);E(G,_.selectionEnd)&&(o(G),s(_))}var P=w.useCallback(I=>{var{selectionStart:x=0,selectionEnd:_=0,selectionDirection:k="none"}=I.target;if(x===null||_===null||k===null){hn.error("Selection attempted on non-text input element",I.target);return}if(hn.debug2("handleSelect",x,_,k),!(c!=null&&x===c.selectionStart&&_===c.selectionEnd)){if(c!=null&&x===m.length&&_===m.length&&I.nativeEvent.type!=="mouseup"){s(gT({},c));return}if(x===_){var U=C(x);hn.debug("Selection segment from ",x,_,"=>",U),s(U)}else s({selectionStart:x,selectionEnd:_,selectionDirection:k})}},[C,s,c,m]),R=w.useCallback(I=>{var x;if(p.current){hn.debug("handleSelectCapture",I);var _=(x=p.current.selectionStart)!==null&&x!==void 0?x:0;_===m.length&&c!=null&&_!==c.selectionStart&&(I.preventDefault(),I.stopPropagation())}},[p,c,m]);function A(I){if(I.preventDefault(),I.stopPropagation(),!!p.current){var{key:x}=I,{selectionStart:_=0,selectionEnd:k=0}=p.current;if(_===null||k===null){hn.error("Selection arrow nvaigation attempted on non-text input element",I.target);return}x==="ArrowLeft"?s(O(_)):x==="ArrowRight"?s(T(k)):x==="ArrowUp"?N(_,-1):x==="ArrowDown"&&N(_,1)}}function M(I){if(p.current){hn.debug("handleKeyDown",I);var{key:x}=I,{selectionStart:_=0,selectionEnd:k=0}=p.current;if(_===null||k===null){hn.error("Selection key event on non-text input element",I.target);return}if(x==="Enter"){l==null||l(I);return}if(x.startsWith("Arrow")){A(I);return}if(x==="Delete"||x==="Backspace"){if(I.preventDefault(),I.stopPropagation(),k>=jm(m,S).length){var U=m.substring(0,_===k?_-1:_),G=jm(U,S);G!==m&&(o(G),s({selectionStart:G.length,selectionEnd:G.length,selectionDirection:Ya.NONE}));return}if(_!==k){var Y=m.substring(0,_)+m.substring(_,k).replace(/[a-zA-Z0-9]/g,ol)+m.substring(k);hn.debug("Range ",_,k,"deleted, setting value",Y),o(Y),s({selectionStart:_,selectionEnd:_,selectionDirection:Ya.NONE})}else if(_>0)for(var Z=_-1;Z>=0;Z-=1){var $=m.substring(0,Z)+m.substring(Z,_).replace(/[a-zA-Z0-9]/g,ol)+m.substring(_);if($!==m){o($),s({selectionStart:Z,selectionEnd:Z,selectionDirection:Ya.NONE});return}}return}if(!(I.altKey||I.metaKey||I.ctrlKey||x.length>1)){I.preventDefault(),I.stopPropagation();for(var D=Array.from(new Set([x,x.toUpperCase(),x.toLowerCase()])),L=0;L<D.length;L+=1)for(var H=D[L],z=/[a-zA-Z0-9]/g.test(H)?b[0].length-1:_,te=_;te<=z;te+=1){var W=fT(m,b[0],te+1),ne=a(W,te,H,_,k);if(E(ne,te+1)){var re=C(te),se=te+1,Ce={selectionStart:se,selectionEnd:se,selectionDirection:Ya.NONE};if(se>=re.selectionEnd){var Me=T(te);Me.selectionStart!==re.selectionStart&&(Ce=Me)}hn.debug("handleKeyDown",x,"=>",ne,Ce),o(ne),s(Ce);return}}}}}return h.jsx("input",{ref:p,className:X("form-control masked-input",t),type:"text",pattern:d,placeholder:u,value:m,onChange:()=>{},onKeyDown:M,onSelect:P,onSelectCapture:R,onFocus:v,onBlur:f,"data-testid":g})});Bb.defaultProps={className:"",placeholder:void 0,onChange(){},onSelect(){},getNextSegmentValue:(n,e,t)=>t,getPreferredReplacementString:Hb,selection:void 0,onFocus(){},onBlur(){},"data-testid":void 0};const ST=Bb;function Hm(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function wT(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Hm(Object(t),!0).forEach(function(r){bs(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Hm(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function bs(n,e,t){return e=yT(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function yT(n){var e=ET(n,"string");return typeof e=="symbol"?e:String(e)}function ET(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}let Ub=class extends w.PureComponent{constructor(e){var t;super(e),bs(this,"container",void 0),bs(this,"oldFocus",void 0),bs(this,"rAF",void 0),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleMenuItemClick=this.handleMenuItemClick.bind(this),this.handleMenuItemMouseMove=this.handleMenuItemMouseMove.bind(this),this.handleMouseLeave=this.handleMouseLeave.bind(this),this.handleCloseMenu=this.handleCloseMenu.bind(this),this.container=oe.createRef(),this.oldFocus=document.activeElement,this.rAF=0;var{options:r}=e,i=(t=r.initialKeyboardIndex)!==null&&t!==void 0?t:-1;this.state={menuItems:[],keyboardIndex:i,mouseIndex:-1}}componentDidMount(){this.initMenu(),this.rAF=window.requestAnimationFrame(()=>{var e;(e=this.container.current)===null||e===void 0||e.focus();var{onMenuOpened:t}=this.props;t(this)})}componentDidUpdate(e){var{actions:t}=this.props;e.actions!==t&&this.initMenu()}componentWillUnmount(){cancelAnimationFrame(this.rAF)}getKeyboardIndex(){var{options:e}=this.props;if(e.separateKeyboardMouse!==void 0&&e.separateKeyboardMouse){var{keyboardIndex:t}=this.state;return t}return this.getMouseIndex()}setKeyboardIndex(e){var{options:t}=this.props;t.separateKeyboardMouse!==void 0&&t.separateKeyboardMouse?this.setState({keyboardIndex:e}):this.setMouseIndex(e)}getMouseIndex(){var{mouseIndex:e}=this.state;return e}setMouseIndex(e){this.setState({mouseIndex:e})}initMenu(){cancelAnimationFrame(this.rAF),this.setState({menuItems:[]});var{actions:e}=this.props,t=lt.getMenuItems(e,!1);t.length>0&&this.setState(r=>({menuItems:lt.sortActions(r.menuItems.concat(t))}))}handleKeyDown(e){var{menuItems:t}=this.state,r=this.getKeyboardIndex(),i=r;if(e.key==="Enter"||e.key===" "){r!=null&&r>=0&&r<t.length&&this.handleMenuItemClick(t[r],e);return}if(e.key==="Escape")i=null;else if(e.key==="ArrowUp"||e.key==="Tab"&&e.shiftKey===!0){var a;i=lt.getNextMenuItem((a=i)!==null&&a!==void 0?a:0,-1,t)}else if(e.key==="ArrowDown"||e.key==="Tab"&&e.shiftKey===!1){var o;i=lt.getNextMenuItem((o=i)!==null&&o!==void 0?o:0,1,t)}r!==i&&(i!==null?this.setKeyboardIndex(i):(this.closeMenu(),this.oldFocus instanceof HTMLElement&&this.oldFocus.focus()),e.preventDefault(),e.stopPropagation())}closeMenu(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,{closeMenu:t,onMenuClosed:r}=this.props;cancelAnimationFrame(this.rAF),this.rAF=window.requestAnimationFrame(()=>{t(e),r(this)})}handleCloseMenu(){this.closeMenu()}handleMenuItemClick(e,t){t.preventDefault(),t.stopPropagation(),e!=null&&(e.disabled===void 0||!e.disabled)&&e.action!=null&&(e.action(t.nativeEvent),this.closeMenu(!0))}handleMenuItemMouseMove(e){var{menuItems:t}=this.state,r=t.indexOf(e);this.setMouseIndex(r)}handleMouseLeave(){this.setMouseIndex(-1)}render(){for(var e=[],{"data-testid":t}=this.props,{keyboardIndex:r,menuItems:i,mouseIndex:a}=this.state,o=0;o<i.length;o+=1){var s=i[o];o>0&&s.group!==i[o-1].group&&e.push(h.jsx("hr",{},"".concat(o,".separator")));var l=h.jsx(K0,{isKeyboardSelected:r===o,isMouseSelected:a===o,menuItem:s,closeMenu:this.handleCloseMenu,onMenuItemClick:this.handleMenuItemClick,onMenuItemMouseMove:this.handleMenuItemMouseMove,onMenuItemContextMenu:()=>!1},o);e.push(l)}var{menuStyle:d}=this.props;return h.jsx("div",{className:"context-menu-container",style:wT({},d),ref:this.container,onKeyDown:this.handleKeyDown,onMouseLeave:this.handleMouseLeave,role:"menuitem",tabIndex:0,"data-testid":t,children:e})}};bs(Ub,"defaultProps",{closeMenu(){},onMenuOpened(){},onMenuClosed(){},options:{},menuStyle:{},"data-testid":void 0});const TT=Ub;function Bm(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function Um(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Bm(Object(t),!0).forEach(function(r){so(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Bm(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function so(n,e,t){return e=PT(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function PT(n){var e=OT(n,"string");return typeof e=="symbol"?e:String(e)}function OT(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class Vb extends w.PureComponent{constructor(e){super(e),so(this,"container",void 0),so(this,"parent",void 0),so(this,"popper",void 0),so(this,"isOpen",void 0),this.handleClick=this.handleClick.bind(this),this.handleCloseMenu=this.handleCloseMenu.bind(this),this.handleExited=this.handleExited.bind(this),this.container=oe.createRef(),this.parent=null,this.popper=oe.createRef(),this.isOpen=!1}componentDidMount(){var{isShown:e}=this.props;if(e===null){var t;(t=this.container.current)!==null&&t!==void 0&&t.parentElement&&(this.parent=this.container.current.parentElement,this.parent.addEventListener("click",this.handleClick))}else e&&this.openMenu()}componentDidUpdate(e){var{isShown:t}=this.props;e.isShown!==t&&(t!==null&&t?window.requestAnimationFrame(()=>{this.openMenu()}):this.closeMenu())}componentWillUnmount(){this.parent&&this.parent.removeEventListener("click",this.handleClick)}closeMenu(){var e;(e=this.popper.current)===null||e===void 0||e.hide()}openMenu(){this.popper.current&&!this.isOpen&&(this.popper.current.show(),this.isOpen=!0)}scheduleUpdate(){var e;(e=this.popper.current)===null||e===void 0||e.scheduleUpdate()}handleClick(e){e.preventDefault(),e.stopPropagation(),this.openMenu()}handleCloseMenu(){this.closeMenu()}handleExited(){this.isOpen=!1;var{onMenuClosed:e}=this.props;e()}render(){var{actions:e,onMenuOpened:t,popperClassName:r,"data-testid":i}=this.props,{menuStyle:a}=this.props,{options:o,popperOptions:s}=this.props;return s=Um({placement:"bottom"},s),o=Um({separateKeyboardMouse:!0},o),h.jsx("div",{className:"menu-actions-listener",ref:this.container,"data-testid":i,children:h.jsx(La,{ref:this.popper,options:s,className:X("menu-popper",r),onExited:this.handleExited,closeOnBlur:!0,interactive:!0,children:h.jsx(TT,{actions:e,closeMenu:this.handleCloseMenu,onMenuOpened:t,options:o,menuStyle:a})})})}}so(Vb,"defaultProps",{isShown:null,onMenuClosed(){},onMenuOpened(){},options:{},popperOptions:{},popperClassName:"",menuStyle:{},"data-testid":void 0});const Ia=Vb;function Xa(n,e,t,r,i){var a=r-t+1,o=((parseInt(e,10)-n-t)%a+a)%a+t;return"".concat(o).padStart(i,"0")}function DT(n,e,t){var{selectionStart:r}=n;return r===0?Xa(e,t,1900,2099,4):r===5?Xa(e,t,1,12,2):r===8?Xa(e,t,1,31,2):r===11?Xa(e,t,0,23,2):r===17||r===14?Xa(e,t,0,59,2):r===20||r===24||r===28?Xa(e,t,0,999,3):t}function fh(n){var e=n.substring(0,23),t=n.substring(23,26),r=n.substring(26);return[e,t,r].filter(i=>i!=="").join("")}var NT=ie.module("DateTimeInput"),RT="[12][0-9]{3}-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])",IT="([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]\\.[0-9]{3}[0-9]{3}[0-9]{3}",FT="".concat(RT," ").concat(IT),Hl="2022-01-01",Gb="".concat(Hl," 00:00:00.000000000"),_T="YYYY-MM-DD HH:MM:SS.SSSSSSSSS";function Vm(n){return n!=null&&n.length>=Hl.length?"".concat(n.substring(0,Hl.length)).concat(n.substring(Hl.length).replace(/\u2007/g,"0")).concat(Gb.substring(n.length)):n}function Gm(n){return n.replace(/\u200B/g,"")}var MT=[fh(Gb)],sc=oe.forwardRef((n,e)=>{var{className:t="",onChange:r=()=>{},defaultValue:i="",onFocus:a=()=>{},onBlur:o=()=>{},onSubmit:s,"data-testid":l}=n,[d,u]=w.useState(i.length>0?fh(i):""),[c,m]=w.useState(),v=w.useCallback(g=>{NT.debug("handleChange",g),u(g),r(Vm(Gm(g)))},[r]),f=w.useCallback(()=>{var g=Gm(d),p=Vm(g);p!==g&&u(fh(p)),o()},[d,o]);return h.jsx("div",{className:"d-flex flex-row align-items-center",children:h.jsx(ST,{ref:e,className:X(t),example:MT,getNextSegmentValue:DT,onChange:v,onSelect:m,onSubmit:s,pattern:FT,placeholder:_T,selection:c,value:d,onFocus:a,onBlur:f,"data-testid":l})})});sc.displayName="DateTimeInput";sc.defaultProps={className:"",onChange:()=>{},defaultValue:"",onFocus:()=>{},onBlur:()=>{},"data-testid":void 0};const xT=sc;function Wb(n,e,t){return e=AT(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function AT(n){var e=LT(n,"string");return typeof e=="symbol"?e:String(e)}function LT(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class zb extends w.PureComponent{constructor(e){super(e),Wb(this,"searchInput",void 0),this.searchInput=oe.createRef(),this.handleChange=this.handleChange.bind(this),this.sendUpdate=wt(this.sendUpdate.bind(this),e.debounceMs),this.state={value:e.value}}componentDidUpdate(e){var{value:t}=this.props;e.value!==t&&this.setState({value:t})}focus(){var e;(e=this.searchInput.current)===null||e===void 0||e.focus()}handleChange(e){this.setState({value:e.target.value},this.sendUpdate)}sendUpdate(){var{onChange:e}=this.props,{value:t}=this.state;e(t)}render(){var{placeholder:e,className:t,matchCount:r,id:i,"data-testid":a}=this.props,{value:o}=this.state;return h.jsx(ka,{value:o,placeholder:e,onChange:this.handleChange,className:t,matchCount:r,ref:this.searchInput,id:i,"data-testid":a})}}Wb(zb,"defaultProps",{placeholder:"Search",className:"",matchCount:null,debounceMs:250,id:"","data-testid":void 0});const kT=zb;function Kb(n,e,t){return e=jT(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function jT(n){var e=$T(n,"string");return typeof e=="symbol"?e:String(e)}function $T(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var HT=ie.module("ItemListItem");class xd extends w.Component{static handleKeyDown(){return HT.log("ItemListItem.handleKeyDown false"),!1}constructor(e){super(e),Kb(this,"itemRef",void 0),this.handleBlur=this.handleBlur.bind(this),this.handleFocus=this.handleFocus.bind(this),this.handleClick=this.handleClick.bind(this),this.handleContextMenu=this.handleContextMenu.bind(this),this.handleDragStart=this.handleDragStart.bind(this),this.handleDrag=this.handleDrag.bind(this),this.handleDragOver=this.handleDragOver.bind(this),this.handleDragEnd=this.handleDragEnd.bind(this),this.handleDrop=this.handleDrop.bind(this),this.handleDoubleClick=this.handleDoubleClick.bind(this),this.handleMouseDown=this.handleMouseDown.bind(this),this.handleMouseMove=this.handleMouseMove.bind(this),this.handleMouseUp=this.handleMouseUp.bind(this),this.itemRef=oe.createRef()}handleBlur(e){var{itemIndex:t,onBlur:r}=this.props;r(t,e)}handleFocus(e){var{itemIndex:t,onFocus:r}=this.props;r(t,e)}handleClick(e){var{itemIndex:t,onClick:r}=this.props;r(t,e)}handleContextMenu(e){var{itemIndex:t,onContextMenu:r}=this.props;r(t,e)}handleDragStart(e){var{itemIndex:t,onDragStart:r}=this.props;r(t,e)}handleDrag(e){var{itemIndex:t,onDrag:r}=this.props;r(t,e)}handleDragOver(e){e.preventDefault();var{itemIndex:t,onDragOver:r}=this.props;r(t,e)}handleDragEnd(e){var{itemIndex:t,onDragEnd:r}=this.props;r(t,e)}handleDrop(e){var{itemIndex:t,onDrop:r}=this.props;r(t,e)}handleDoubleClick(e){var{itemIndex:t,onDoubleClick:r}=this.props;r(t,e)}handleMouseMove(e){var{itemIndex:t,onMouseMove:r}=this.props;r(t,e)}handleMouseDown(e){var{itemIndex:t,onMouseDown:r}=this.props;r(t,e)}handleMouseUp(e){var{itemIndex:t,onMouseUp:r}=this.props;r(t,e)}render(){var{isDraggable:e,isFocused:t,isSelected:r,style:i,children:a,"data-testid":o}=this.props;return h.jsx("div",{className:X("item-list-item",{active:r},{"is-focused":t},{"is-draggable":e}),onKeyDown:xd.handleKeyDown,onContextMenuCapture:this.handleContextMenu,onClick:this.handleClick,onDrag:this.handleDrag,onDragStart:this.handleDragStart,onDragOver:this.handleDragOver,onDragEnd:this.handleDragEnd,onDrop:this.handleDrop,onDoubleClick:this.handleDoubleClick,onMouseDown:this.handleMouseDown,onMouseMove:this.handleMouseMove,onMouseUp:this.handleMouseUp,tabIndex:-1,ref:this.itemRef,role:"listitem",style:i,onFocus:this.handleFocus,onBlur:this.handleBlur,draggable:e,"data-testid":o,children:a})}}Kb(xd,"defaultProps",{children:null,isDraggable:!1,isFocused:!1,isSelected:!1,itemIndex:0,"data-testid":void 0,onBlur(){},onClick(){},onContextMenu(){},onDragStart(){},onDrag(){},onDragOver(){},onDragEnd(){},onDrop(){},onDoubleClick(){},onFocus(){},onMouseDown(){},onMouseMove(){},onMouseUp(){},style:{}});const BT=xd;function Wm(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function zm(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Wm(Object(t),!0).forEach(function(r){tn(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Wm(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function tn(n,e,t){return e=UT(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function UT(n){var e=VT(n,"string");return typeof e=="symbol"?e:String(e)}function VT(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var Km=ie.module("ItemList"),qm=5;class Qt extends w.PureComponent{static renderItem(e){var t,r,{item:i}=e;return h.jsx("div",{className:"item-list-item-content",children:i!=null&&((t=(r=i.displayValue)!==null&&r!==void 0?r:i.value)!==null&&t!==void 0?t:"".concat(i))})}constructor(e){super(e),tn(this,"list",void 0),tn(this,"listContainer",void 0),tn(this,"getItemSelected",Se((i,a)=>An.isSelected(a,i),{max:Qt.CACHE_SIZE})),tn(this,"getCachedItem",Se((i,a,o,s,l,d,u,c)=>{var m=d({item:o,itemIndex:i,isFocused:s,isSelected:l,style:u});return h.jsx(BT,{onContextMenu:this.handleItemContextMenu,onDoubleClick:this.handleItemDoubleClick,onMouseDown:this.handleItemMouseDown,onFocus:this.handleItemFocus,onBlur:this.handleItemBlur,disableSelect:c,onMouseMove:this.handleItemMouseMove,onMouseUp:this.handleItemMouseUp,isFocused:s,isSelected:l,itemIndex:i,style:u,children:m},a)},{max:Qt.CACHE_SIZE})),tn(this,"getOuterElement",Se(i=>{var a=oe.forwardRef((o,s)=>h.jsx("div",zm({ref:s,tabIndex:-1,onKeyDown:i,role:"presentation"},o)));return a.displayName="ItemListOuterElement",a})),tn(this,"getInnerElement",Se(()=>{var i=oe.forwardRef((a,o)=>h.jsx("div",zm({className:"item-list-inner-element",ref:o},a)));return i.displayName="ItemListInnerElement",i})),tn(this,"getItemData",Se((i,a,o)=>({items:i,selectedRanges:a,renderItem:o}))),this.handleItemBlur=this.handleItemBlur.bind(this),this.handleItemContextMenu=this.handleItemContextMenu.bind(this),this.handleItemFocus=this.handleItemFocus.bind(this),this.handleItemDoubleClick=this.handleItemDoubleClick.bind(this),this.handleItemMouseDown=this.handleItemMouseDown.bind(this),this.handleItemMouseMove=this.handleItemMouseMove.bind(this),this.handleItemMouseUp=this.handleItemMouseUp.bind(this),this.handleItemsRendered=this.handleItemsRendered.bind(this),this.handleWindowMouseUp=this.handleWindowMouseUp.bind(this),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleMouseLeave=this.handleMouseLeave.bind(this),this.handleScroll=this.handleScroll.bind(this),this.handleResize=this.handleResize.bind(this),this.renderInnerElement=this.renderInnerElement.bind(this),this.list=oe.createRef(),this.listContainer=oe.createRef();var{isStickyBottom:t,selectedRanges:r}=e;this.state={focusIndex:null,mouseDownIndex:null,selectedRanges:r,overscanStartIndex:0,height:null,isDragging:!1,isStuckToBottom:t,scrollOffset:null,mouseX:null,mouseY:null}}componentDidUpdate(e,t){var{selectedRanges:r,itemCount:i}=this.props,{focusIndex:a,isStuckToBottom:o,scrollOffset:s,height:l,selectedRanges:d}=this.state;if(o&&!this.isListAtBottom()&&i>0&&this.scrollToBottom(),(s!==t.scrollOffset||l!==t.height)&&this.sendViewportUpdate(),r!==e.selectedRanges&&r!==d)this.setSelectedRanges(r);else if(d!==t.selectedRanges){var{onSelectionChange:u}=this.props;u(d)}if(a!==t.focusIndex){var{onFocusChange:c}=this.props;c(a)}}componentWillUnmount(){window.removeEventListener("mouseup",this.handleWindowMouseUp)}focus(){var e;(e=this.listContainer.current)===null||e===void 0||e.focus()}restoreScrollPosition(){var{scrollOffset:e}=this.state;if(e!=null){var t;(t=this.listContainer.current)===null||t===void 0||t.scrollTo(0,e)}}getElement(e){if(this.listContainer.current==null)return null;var{focusSelector:t}=this.props,{overscanStartIndex:r}=this.state,i=this.listContainer.current.querySelectorAll(t),a=e-r;return i[a]}focusItem(e){var{disableSelect:t}=this.props;if(!t){this.setState({focusIndex:e});var r=this.getElement(e);r instanceof HTMLElement&&r.focus()}}scrollToItem(e){var t=this.getElement(e);t!=null&&t.scrollIntoView({block:"center"})}handleItemContextMenu(e,t){this.setState({focusIndex:e});var{selectedRanges:r}=this.state,i=An.isSelected(r,e),a=i||lt.isModifierKeyDown(t);this.toggleSelect(e,t.shiftKey,a,!1)}handleItemDoubleClick(e,t){var{isDoubleClickSelect:r,onSelect:i}=this.props;r&&this.setState(a=>{var{selectedRanges:o}=a;return{selectedRanges:An.selectRange(o,[e,e])}},()=>{i(e,t)})}handleItemMouseDown(e,t){var{selectedRanges:r}=this.state;if(!(t.target instanceof HTMLElement&&["button","select","input","textarea"].indexOf(t.target.tagName.toLowerCase())!==-1)){if(t.button===2&&r.length===0){this.focusItem(e),this.selectItem(e);return}t.button!=null&&t.button!==0||(this.setState({mouseDownIndex:e,mouseX:t.clientX,mouseY:t.clientY}),window.addEventListener("mouseup",this.handleWindowMouseUp))}}handleItemBlur(e,t){Km.debug2("item blur",e,t.currentTarget,t.relatedTarget),(!t.relatedTarget||this.listContainer.current&&t.relatedTarget instanceof HTMLElement&&!this.listContainer.current.contains(t.relatedTarget))&&this.setState({focusIndex:null})}handleItemFocus(e,t){Km.debug2("item focus",e,t.target),this.setState(r=>{var{focusIndex:i}=r;return i!==e?{focusIndex:e}:null})}handleItemMouseMove(e,t){var{isDragSelect:r,isMultiSelect:i,disableSelect:a}=this.props,{mouseDownIndex:o,selectedRanges:s,mouseX:l,mouseY:d}=this.state;if(!(o==null||a)){var u=Math.abs(t.clientX-(l??0)),c=Math.abs(t.clientY-(d??0));u>qm&&c>qm&&this.setState({isDragging:!0}),(r||o===e)&&(this.focusItem(e),i?(!r&&!this.getItemSelected(e,s)&&!lt.isModifierKeyDown(t)&&this.deselectAll(),this.selectRange([Math.min(o,e),Math.max(o,e)])):this.toggleSelect(e,t.shiftKey,lt.isModifierKeyDown(t),!1))}}handleItemMouseUp(e,t){var{isDeselectOnClick:r,isDoubleClickSelect:i,onSelect:a}=this.props,{mouseDownIndex:o,isDragging:s}=this.state;if(!(t.target instanceof HTMLElement&&["button","select","input","textarea"].indexOf(t.target.tagName.toLowerCase())!==-1)){if(o===e&&!s){var l=t.shiftKey,d=lt.isModifierKeyDown(t);this.focusItem(e),this.toggleSelect(e,l,d,r),!i&&!l&&!d&&a(e,t)}this.resetMouseState()}}handleItemsRendered(e){var{overscanStartIndex:t}=e;this.setState({overscanStartIndex:t})}handleResize(e){var{height:t}=e;this.setState({height:t})}handleMouseLeave(){this.setState({mouseDownIndex:null})}handleWindowMouseUp(){this.resetMouseState(),window.removeEventListener("mouseup",this.handleWindowMouseUp)}handleKeyDown(e){var{isMultiSelect:t,itemCount:r,onSelect:i}=this.props,{focusIndex:a}=this.state,o=a;if(e.key==="Enter"||e.key===" "){!t&&o!=null&&this.setState({selectedRanges:[[o,o]]},()=>{o!=null&&i(o,e)});return}if(e.key==="ArrowUp")o!=null&&o>=0?o=Math.max(0,o-1):o=r-1;else if(e.key==="ArrowDown")o!=null&&o>=0?o=Math.min(o+1,r-1):o=0;else return;if(a!==o){e.stopPropagation(),e.preventDefault(),this.focusItem(o);var{selectedRanges:s}=this.state;if(e.shiftKey&&s.length>0){var l=s[s.length-1];this.selectRange([Math.min(o,l[0]),Math.max(o,l[1])])}else if(this.deselectAll(),o!==null)this.selectItem(o);else{var d;(d=this.listContainer.current)===null||d===void 0||d.focus()}this.scrollIntoView(o)}}handleScroll(e){var{scrollUpdateWasRequested:t,scrollOffset:r}=e;this.setState(i=>{if(t)return{scrollOffset:r};var{isStickyBottom:a}=this.props,{height:o}=i,s=a&&this.isListAtBottom({scrollOffset:r,height:o});return{isStuckToBottom:s,scrollOffset:r}})}resetMouseState(){this.setState({mouseDownIndex:null,isDragging:!1})}scrollToBottom(){var{itemCount:e}=this.props;this.list.current&&this.list.current.scrollToItem(e)}scrollIntoView(e){this.list.current&&this.list.current.scrollToItem(e)}toggleSelect(e,t,r){var i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,{isMultiSelect:a}=this.props,{selectedRanges:o}=this.state;if(a&&t&&o.length>0){var s=o[o.length-1];this.selectRange([Math.min(s[0],e),Math.max(e,s[1])])}else a&&o.length===1&&o[0][0]===e&&o[0][1]===e?i&&this.deselectItem(e):a&&r?this.getItemSelected(e,o)?i&&this.deselectItem(e):this.selectItem(e):(this.deselectAll(),this.selectItem(e))}deselectAll(){var{itemCount:e}=this.props;this.deselectRange([0,e])}deselectItem(e){this.deselectRange([e,e])}deselectRange(e){An.validateRange(e),this.setState(t=>{var{selectedRanges:r}=t;return{selectedRanges:An.deselectRange(r,e)}})}selectItem(e){var{disableSelect:t}=this.props;t||this.selectRange([e,e])}selectRange(e){An.validateRange(e),this.setState(t=>{var{selectedRanges:r}=t;return{selectedRanges:An.selectRange(r,e)}})}setSelectedRanges(e){this.setState({selectedRanges:e})}sendViewportUpdate(){var{scrollOffset:e,height:t}=this.state;if(e!=null&&t!=null){var{onViewportChange:r,rowHeight:i}=this.props,a=Math.floor(e/i),o=a+Math.ceil(t/i);r(a,o)}}isListAtBottom(){var{scrollOffset:e,height:t}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.state;if(t==null||e==null)return!1;var{itemCount:r,rowHeight:i}=this.props;return e+t>=r*i}renderInnerElement(e){var{index:t,style:r}=e,{items:i,offset:a,renderItem:o,disableSelect:s}=this.props,{focusIndex:l,selectedRanges:d}=this.state;if(t<a||t>=a+i.length)return null;var u=i[t-a];return this.getCachedItem(t,t,u,t===l&&!s,this.getItemSelected(t,d),o,r,s)}render(){var{items:e,itemCount:t,overscanCount:r,renderItem:i,rowHeight:a,"data-testid":o}=this.props,{selectedRanges:s,isStuckToBottom:l}=this.state;return h.jsx(ay,{className:"item-list-auto-sizer",onResize:this.handleResize,children:d=>{var{width:u,height:c}=d;return h.jsx(oy,{className:"item-list-scroll-pane",height:c,width:u,initialScrollOffset:l?t*a:0,itemCount:t,itemSize:a,itemData:this.getItemData(e,s,i),onScroll:this.handleScroll,onItemsRendered:this.handleItemsRendered,ref:this.list,outerElementType:this.getOuterElement(this.handleKeyDown),outerRef:this.listContainer,innerElementType:this.getInnerElement(),overscanCount:r,"data-testid":o,children:this.renderInnerElement})}})}}tn(Qt,"CACHE_SIZE",1e3);tn(Qt,"DEFAULT_ROW_HEIGHT",20);tn(Qt,"DEFAULT_OVERSCAN",10);tn(Qt,"defaultProps",{offset:0,items:[],rowHeight:Qt.DEFAULT_ROW_HEIGHT,isDeselectOnClick:!0,isDoubleClickSelect:!1,isDragSelect:!0,isMultiSelect:!1,isStickyBottom:!1,disableSelect:!1,onFocusChange(){},onSelect(){},onSelectionChange(){},onViewportChange(){},overscanCount:Qt.DEFAULT_OVERSCAN,renderItem:Qt.renderItem,selectedRanges:[],focusSelector:".item-list-item","data-testid":void 0});function Ym(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function Oi(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Ym(Object(t),!0).forEach(function(r){Oa(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Ym(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function Oa(n,e,t){return e=GT(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function GT(n){var e=WT(n,"string");return typeof e=="symbol"?e:String(e)}function WT(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class Wn extends w.PureComponent{static renderHandle(){return h.jsxs("div",{children:[h.jsx(Ot,{children:"Drag to re-order"}),h.jsx(ue,{icon:xs})]})}static renderBadge(e){var{text:t}=e;return t!=null&&t.length>0?h.jsx("span",{className:"number-badge",children:t}):null}static renderTextItem(e){var{text:t,badgeText:r="",className:i=""}=e;return h.jsxs("div",{className:X("item-list-item-content","draggable-item-list-item-content",i),children:[h.jsx("span",{className:"title",children:t}),Wn.renderBadge({text:r}),Wn.renderHandle()]})}static renderItem(e){var t,r,{item:i,isClone:a,selectedCount:o}=e,s=i!=null?(t=(r=i.displayValue)!==null&&r!==void 0?r:i.value)!==null&&t!==void 0?t:"".concat(i):"",l=a!==void 0&&a?"".concat(o):"",d=a!==void 0&&a?"item-list-item-clone":"";return Wn.renderTextItem({text:s,badgeText:l,className:d})}static getDraggableId(e,t){return"".concat(e,"/").concat(t)}static getDraggableIndex(e){var t=e.split("/").pop();return parseInt(t!==void 0?t:"",10)}constructor(e){super(e),Oa(this,"itemList",void 0),Oa(this,"getCachedDraggableItem",Se((t,r,i,a,o,s,l,d)=>h.jsx(Uh,{draggableId:Wn.getDraggableId(t,a),index:a,isDragDisabled:l,children:u=>h.jsx("div",Oi(Oi(Oi({role:"menuitem",className:"draggable-item-list-item",ref:u.innerRef,tabIndex:-1},u.draggableProps),u.dragHandleProps),{},{children:r({item:i,itemIndex:a,isFocused:o,isSelected:s,style:d,isClone:!1})}))},a),{max:Qt.CACHE_SIZE})),Oa(this,"getCachedRenderDraggableItem",Se((t,r,i)=>a=>{var{item:o,itemIndex:s,isFocused:l,isSelected:d,style:u}=a;return this.getCachedDraggableItem(t,i,o,s,l,d,r,u)},{max:1})),Oa(this,"getCachedRenderClone",Se((t,r,i,a)=>(o,s,l)=>{var{selectedCount:d}=this.state,{draggableProps:u,dragHandleProps:c,innerRef:m}=o,{index:v}=l.source,f=r[v-i];return h.jsx("div",Oi(Oi(Oi({className:X("draggable-item-list-dragging-item-container",t)},u),c),{},{ref:m,children:h.jsx("div",{className:X("draggable-item-list-dragging-item",{"two-dragged":d===2},{"multiple-dragged":d>2}),children:a({item:f,itemIndex:v,isFocused:!1,isSelected:!0,style:{},isClone:!0,selectedCount:d})})}))},{max:1})),this.handleSelectionChange=this.handleSelectionChange.bind(this),this.itemList=oe.createRef(),this.state={selectedCount:0}}selectItem(e){var t;(t=this.itemList.current)===null||t===void 0||t.selectItem(e)}focusItem(e){var t;(t=this.itemList.current)===null||t===void 0||t.focusItem(e)}scrollToItem(e){var t;(t=this.itemList.current)===null||t===void 0||t.scrollToItem(e)}handleSelectionChange(e){this.setState({selectedCount:An.count(e)});var{onSelectionChange:t}=this.props;t(e)}render(){var{className:e,draggablePrefix:t,draggingItemClassName:r,droppableId:i,isDoubleClickSelect:a,isDragDisabled:o,isDropDisabled:s,isMultiSelect:l,isStickyBottom:d,itemCount:u,items:c,offset:m,onFocusChange:v,onSelect:f,onViewportChange:g,renderItem:p,rowHeight:b,selectedRanges:S,style:C,"data-testid":y}=this.props;return h.jsx(Cd,{isDropDisabled:s,droppableId:i,mode:"virtual",renderClone:this.getCachedRenderClone(r,c,m,p),"data-testid":y,children:(E,T)=>h.jsx("div",Oi(Oi({role:"menu",className:X("draggable-item-list",e,{"is-drop-disabled":s,"is-drag-disabled":o,"is-dragging-from-this":T.draggingFromThisWith,"is-dragging-over":T.isDraggingOver,"is-dropping":T.draggingOverWith}),style:C,ref:E.innerRef},E.droppableProps),{},{children:h.jsx(Qt,{focusSelector:".draggable-item-list-item",isDoubleClickSelect:a,isDragSelect:!1,isMultiSelect:l,isStickyBottom:d,itemCount:u,items:c,onFocusChange:v,onSelect:f,onSelectionChange:this.handleSelectionChange,onViewportChange:g,offset:m,ref:this.itemList,renderItem:this.getCachedRenderDraggableItem(t,o,p),rowHeight:b,selectedRanges:S})}))})}}Oa(Wn,"DEFAULT_ROW_HEIGHT",30);Oa(Wn,"defaultProps",{className:"",draggingItemClassName:"",offset:0,items:[],rowHeight:Wn.DEFAULT_ROW_HEIGHT,isDeselectOnClick:!0,isDoubleClickSelect:!0,isDropDisabled:!1,isDragDisabled:!1,isMultiSelect:!1,isStickyBottom:!1,disableSelect:!1,style:null,onFocusChange(){},onSelect(){},onSelectionChange(){},onViewportChange(){},renderItem:Wn.renderItem,selectedRanges:[],draggablePrefix:"draggable-item",droppableId:"droppable-item-list","data-testid":void 0});const gn=Wn;class Xl{static reorder(e,t,r,i){var a=e===r?Xl.adjustDestinationIndex(i,t):i,o=Xl.removeItems(e,t);return r.splice(a,0,...o),o}static removeItems(e,t){for(var r=[],i=t.map((u,c)=>({range:u,index:c})).sort((u,c)=>c.range[0]-u.range[0]),a=0;a<i.length;a+=1){var{range:o,index:s}=i[a],[l,d]=o;r[s]=e.splice(l,d-l+1)}return sy(r)}static adjustDestinationIndex(e,t){for(var r=e,i=0;i<t.length;i+=1){var[a,o]=t[i];if(a>e)break;r-=Math.min(o,e-1)-a+1}return r}static startDragging(){document.documentElement.classList.add("drag-pointer-events-none")}static stopDragging(){document.documentElement.classList.remove("drag-pointer-events-none")}}const En=Xl;function qb(n){var{on:e,id:t,className:r,isInvalid:i,disabled:a=!1,onClick:o,"data-testid":s}=n;return h.jsx("button",{type:"button",className:X("btn","btn-switch",r,{active:e},{"is-invalid":i}),id:t,onClick:o,disabled:a,"data-testid":s,children:h.jsx("div",{className:"handle"})})}function Xm(n){return n.isOn!==void 0}function zT(n){var{item:e,onSelect:t=()=>{},"data-testid":r}=n,{icon:i,subtitle:a,title:o}=e,s=w.useMemo(()=>Xm(e)?()=>{e.onChange(!e.isOn)}:t,[e,t]);return h.jsxs("div",{className:"btn btn-navigation-menu-item","data-testid":"menu-item-".concat(o),onClick:s,onKeyDown:l=>{(l.key==="Enter"||l.key===" ")&&s()},tabIndex:0,role:"menuitem",children:[i!==void 0&&h.jsx("div",{className:"icon",children:h.jsx(ue,{icon:i})}),h.jsx("div",{className:"title",children:o}),a!==void 0&&h.jsx("div",{className:"shortcut",children:a}),h.jsx("div",{className:"accessory","data-testid":r,children:Xm(e)?h.jsx(qb,{on:e.isOn,onClick:l=>{l.stopPropagation(),s()}}):h.jsx(ue,{icon:yb})})]})}function Yb(n){var{items:e,onSelect:t=()=>{},"data-testid":r}=n;return h.jsx("div",{className:"navigation-menu-view","data-testid":r,children:h.jsx("ul",{className:"navigation-menu-list",children:e.map((i,a)=>h.jsx("li",{children:h.jsx(zT,{item:i,onSelect:()=>{t(a)}})},i.title))})})}function Qm(n){var{children:e,onBack:t,onClose:r,title:i,"data-testid":a}=n;return h.jsxs("div",{className:"navigation-page","data-testid":a,children:[h.jsxs("div",{className:"navigation-title-bar",children:[h.jsx("div",{className:"navigation-left-buttons",children:t!==void 0&&h.jsx(K,{kind:"ghost",className:"btn-back m-1 btn-sm","data-testid":"btn-page-back",onClick:t,icon:Ly,children:"Back"})}),h.jsx("div",{className:"navigation-title",children:i}),h.jsx("div",{className:"navigation-right-buttons",children:r!==void 0&&h.jsx(K,{kind:"ghost",className:"btn-close btn-sm px-2 m-1","data-testid":"btn-page-close",onClick:r,icon:Td,tooltip:"Close"})})]}),h.jsx("div",{className:"navigation-content",children:e})]})}function KT(n){var{children:e,"data-testid":t}=n,r=w.useMemo(()=>oe.Children.toArray(e),[e]),i=Nd(r),[a,o]=w.useState(r[r.length-1]),[s,l]=w.useState(null),[d,u]=w.useState(null);w.useEffect(function(){if(!(i===void 0||r===i)){var f=r[r.length-1];r.length===i.length||i.length===0||s!==null||d!==null?s!==null&&f!==s?l(f):f!==d&&f!==a&&o(f):r.length>i.length?l(f):r.length<i.length&&(o(f),u(i[i.length-1]))}},[r,i,s,d,a]);var c=w.useCallback(()=>{o(s),l(null)},[s]),m=w.useCallback(()=>{u(null)},[]);return h.jsxs("div",{className:"navigation-stack",children:[h.jsx("div",{className:"main-view","data-testid":t,children:a}),h.jsx(Sr,{in:d!=null,timeout:et.transitionMidMs,classNames:"slide-right",onEntered:m,children:h.jsx(h.Fragment,{children:d!=null&&h.jsx("div",{className:"popping-view",children:d})})}),h.jsx(Sr,{in:s!=null,timeout:et.transitionMidMs,classNames:"slide-left",onEntered:c,children:h.jsx(h.Fragment,{children:s!=null&&h.jsx("div",{className:"pushing-view",children:s})})})]})}var qT=["children"];function Zm(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function Jm(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Zm(Object(t),!0).forEach(function(r){YT(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Zm(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function YT(n,e,t){return e=XT(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function XT(n){var e=QT(n,"string");return typeof e=="symbol"?e:String(e)}function QT(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function ZT(n,e){if(n==null)return{};var t=JT(n,e),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(n);for(i=0;i<a.length;i++)r=a[i],!(e.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(n,r)&&(t[r]=n[r])}return t}function JT(n,e){if(n==null)return{};var t={},r=Object.keys(n),i,a;for(a=0;a<r.length;a++)i=r[a],!(e.indexOf(i)>=0)&&(t[i]=n[i]);return t}function Xb(n){var{children:e}=n,t=ZT(n,qT);return h.jsx("option",Jm(Jm({},t),{},{children:e}))}function Ad(n){var{children:e,disabled:t=!1,name:r,onChange:i,value:a="","data-testid":o}=n,[s]=w.useState(r??qe());return h.jsx(h.Fragment,{children:oe.Children.map(e,l=>{var d,u;return l?oe.cloneElement(l,{name:s,onChange:(d=l.props.onChange)!==null&&d!==void 0?d:i,checked:a===l.props.value,disabled:(u=l.props.disabled)!==null&&u!==void 0?u:t,"data-testid":o}):null})})}var lc=oe.forwardRef((n,e)=>{var{checked:t,children:r,className:i="",disabled:a=!1,inputClassName:o="",isInvalid:s=!1,labelClassName:l="",name:d,onChange:u,value:c,"data-testid":m}=n,[v]=w.useState(qe());return h.jsxs("div",{className:X("custom-control custom-radio",i),children:[h.jsx("input",{type:"radio",id:v,"data-testid":m,name:d,ref:e,className:X("custom-control-input",o,{"is-invalid":s}),checked:t,disabled:a,value:c,onChange:u}),h.jsx("label",{className:X("custom-control-label",l),htmlFor:v,children:r})]})});lc.displayName="RadioItem";lc.defaultProps={checked:void 0,className:"",disabled:!1,inputClassName:"",isInvalid:!1,labelClassName:"",name:void 0,onChange:void 0,"data-testid":void 0};const fi=lc,eP={"dh-spectrum-palette":"_dh-spectrum-palette_1mcqx_1"},tP={"dh-spectrum-alias":"_dh-spectrum-alias_1ji2m_1"};function ev(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function tv(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?ev(Object(t),!0).forEach(function(r){rP(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):ev(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function rP(n,e,t){return e=nP(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function nP(n){var e=iP(n,"string");return typeof e=="symbol"?e:String(e)}function iP(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var rv=tv(tv({},eP),tP);function nv(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function sl(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?nv(Object(t),!0).forEach(function(r){aP(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):nv(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function aP(n,e,t){return e=oP(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function oP(n){var e=sP(n,"string");return typeof e=="symbol"?e:String(e)}function sP(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var{global:lP,light:dP,dark:uP,medium:hP,large:cP}=ly,mP={global:lP,light:sl(sl({},dP),rv),dark:sl(sl({},uP),rv),medium:hP,large:cP};function vP(n){var{children:e,isPortal:t=!1,theme:r=mP,colorScheme:i}=n,[a]=w.useState(t?qe():null);return h.jsx(dy,{UNSAFE_className:"spectrum-theme-provider",theme:r,colorScheme:i,"data-unique-id":a,children:e})}var fP=ie.module("ThemeProvider"),Qb=w.createContext(null);function H2(n){var{themes:e,defaultPreloadValues:t=Gy,children:r}=n,i=w.useMemo(()=>ky(),[]),[a,o]=w.useState(null),[s,l]=w.useState(()=>{var c,m;return(c=(m=jy())===null||m===void 0?void 0:m.themeKey)!==null&&c!==void 0?c:$y}),d=w.useMemo(()=>e==null?null:Hy(s,{base:i,custom:e??[]}),[i,s,e]),u=w.useMemo(()=>[...i,...e??[]],[i,e]);return w.useEffect(function(){if(!(d==null||e==null)){By(t);var m=Uy(t);fP.debug2("updateThemePreloadData:",{active:d.map(v=>v.themeKey),custom:e.map(v=>v.themeKey),preloadStyleContent:m,selectedThemeKey:s}),Vy({themeKey:s,preloadStyleContent:m})}},[d,s,e,t]),w.useEffect(()=>{o({activeThemes:d,selectedThemeKey:s,themes:u,setSelectedThemeKey:l})},[d,s,u]),h.jsxs(h.Fragment,{children:[d==null?null:h.jsx(h.Fragment,{children:d.map(c=>h.jsx("style",{"data-theme-key":c.themeKey,children:c.styleContent},c.themeKey))}),a==null?null:h.jsx(Qb.Provider,{value:a,children:h.jsx(vP,{children:r})})]})}function dc(){return Jh(Qb,"No ThemeContext value found. Component must be wrapped in a ThemeContext.Provider")}var gP=["children","className","onChange","data-testid"];function iv(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function av(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?iv(Object(t),!0).forEach(function(r){pP(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):iv(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function pP(n,e,t){return e=bP(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function bP(n){var e=CP(n,"string");return typeof e=="symbol"?e:String(e)}function CP(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function SP(n,e){if(n==null)return{};var t=wP(n,e),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(n);for(i=0;i<a.length;i++)r=a[i],!(e.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(n,r)&&(t[r]=n[r])}return t}function wP(n,e){if(n==null)return{};var t={},r=Object.keys(n),i,a;for(a=0;a<r.length;a++)i=r[a],!(e.indexOf(i)>=0)&&(t[i]=n[i]);return t}var Zb=oe.forwardRef((n,e)=>{var{children:t,className:r,onChange:i,"data-testid":a}=n,o=SP(n,gP),s=ic(e),l=w.useCallback(d=>{i(d.target.value)},[i]);return h.jsx("select",av(av({ref:s,className:X("custom-select",r),onChange:l,"data-testid":a},o),{},{children:t}))});Zb.displayName="Select";const Gt=Zb;function no(n,e,t){return e=yP(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function yP(n){var e=EP(n,"string");return typeof e=="symbol"?e:String(e)}function EP(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class Jb extends w.PureComponent{constructor(e){super(e),no(this,"list",void 0),no(this,"topRow",void 0),no(this,"bottomRow",void 0),no(this,"getCachedItem",Se((t,r,i,a,o,s,l)=>{var d={height:o},u=a??i;return h.jsx("li",{className:"value-list-item",style:d,tabIndex:-1,children:h.jsx(zn,{checked:s,disabled:l,onChange:()=>this.handleSelect(t),children:u})},r)},{max:1e3})),no(this,"getCachedItems",Se((t,r,i,a)=>{for(var o=[],s=0;s<t.length;s+=1){var l=t[s],{value:d,displayValue:u,isSelected:c}=l,m=i+s,v=m,f=this.getCachedItem(m,v,d,u,r,c,a);o.push(f)}return o},{max:1})),this.handleBlur=this.handleBlur.bind(this),this.handleScroll=this.handleScroll.bind(this),this.handleSelect=this.handleSelect.bind(this),this.list=oe.createRef(),this.topRow=null,this.bottomRow=null}componentDidMount(){this.sendViewportUpdate()}componentDidUpdate(){this.sendViewportUpdate()}handleBlur(e){if(!e.relatedTarget||this.list.current&&e.relatedTarget instanceof HTMLElement&&!this.list.current.contains(e.relatedTarget)){var{onBlur:t}=this.props;t==null||t(e)}}handleScroll(){this.sendViewportUpdate()}handleSelect(e){var{items:t,offset:r,onSelect:i}=this.props,a=e-r;if(a>=0&&a<t.length){var o=t[a],{value:s}=o;i(e,s)}else i(e,null)}sendViewportUpdate(){if(!(!this.list.current||this.list.current.clientHeight===0)){var{onViewportChange:e,rowHeight:t}=this.props,r=this.list.current.scrollTop,i=r+this.list.current.clientHeight,a=Math.floor(r/t),o=Math.ceil(i/t);(this.topRow!==a||this.bottomRow!==o)&&(this.topRow=a,this.bottomRow=o,e(a,o))}}getElement(e){if(this.list.current==null)return null;var t=this.list.current.querySelectorAll(".value-list-item");return t[e]}scrollIntoView(e){var t=this.getElement(e);t==null||t.scrollIntoView({block:"center"})}render(){var{className:e,disabled:t,isInvalid:r,items:i,itemCount:a,offset:o,rowHeight:s,"data-testid":l}=this.props,d=this.getCachedItems(i,s,o,t);return h.jsx("div",{className:X("select-value-list-scroll-pane h-100 w-100",{"is-invalid":r},e),onBlur:this.handleBlur,onScroll:this.handleScroll,ref:this.list,"data-testid":l,children:h.jsx("div",{className:"select-value-list",style:{height:a*s},children:h.jsx("ol",{className:"select-value-list-content",style:{position:"absolute",height:i.length*s,top:o*s,left:0},children:d})})})}}no(Jb,"defaultProps",{disabled:!1,rowHeight:21,onBlur:()=>{},"data-testid":void 0});const TP=Jb;var uc=oe.forwardRef((n,e)=>{var{children:t,className:r,disabled:i,id:a,isLinked:o,isLinkedSource:s,isInvalid:l,onClick:d,onMouseEnter:u,onMouseLeave:c,style:m,"data-testid":v}=n;return h.jsxs("button",{ref:e,type:"button",className:X("btn-socketed",{"btn-socketed-linked":o!==void 0&&o||s},{"btn-socketed-linked-source":s},{"is-invalid":l},r),id:a,onClick:d,onMouseEnter:u,onMouseLeave:c,style:m,disabled:i,"data-testid":v,children:[t,h.jsx(ue,{icon:Eb,className:"linked btn-socketed-icon",transform:"down-1"}),h.jsx(ue,{icon:Wy,className:"is-invalid btn-socketed-icon"})]})});uc.displayName="SocketedButton";uc.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 eC=uc;function oa(){return Jh(zy,"No API available in useApi. Was code wrapped in ApiBootstrap or ApiContext.Provider?")}function hc(n,e,t){return e=PP(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function PP(n){var e=OP(n,"string");return typeof e=="symbol"?e:String(e)}function OP(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class Ld{static isValid(e,t){return!0}static isSameFormat(e,t){throw new Error("isSameFormat not implemented")}static makeFormat(e,t,r){return{label:e,formatString:t,type:r}}format(e,t){return""}}hc(Ld,"TYPE_GLOBAL","type-global");hc(Ld,"TYPE_CONTEXT_PRESET","type-context-preset");hc(Ld,"TYPE_CONTEXT_CUSTOM","type-context-custom");const Dt=Ld;class DP extends Dt{format(e){switch(e){case 1:case!0:return"true";case 0:case!1:return"false";default:return""}}}const NP=DP;class RP extends Dt{format(e){return String.fromCharCode(e)}}const IP=RP;function Vi(n,e,t){return e=FP(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function FP(n){var e=_P(n,"string");return typeof e=="symbol"?e:String(e)}function _P(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var ov=ie.module("DateTimeColumnFormatter");class Ut extends Dt{static isValid(e,t){try{return e.i18n.DateTimeFormat.format(t.formatString,new Date),!0}catch{return!1}}static makeFormat(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Dt.TYPE_CONTEXT_PRESET;return{label:e,formatString:t,type:r}}static isSameFormat(e,t){return e===t||e!==null&&t!==null&&e.type===t.type&&e.formatString===t.formatString}static makeGlobalFormatStringMap(e,t){var r=t?"'T'":" ",i=e?" z":"";return new Map([["yyyy-MM-dd HH:mm:ss","yyyy-MM-dd".concat(r,"HH:mm:ss").concat(i)],["yyyy-MM-dd HH:mm:ss.SSS","yyyy-MM-dd".concat(r,"HH:mm:ss.SSS").concat(i)],["yyyy-MM-dd HH:mm:ss.SSSSSSSSS","yyyy-MM-dd".concat(r,"HH:mm:ss.SSSSSSSSS").concat(i)]])}static getGlobalFormats(e,t){var r=Ut.makeGlobalFormatStringMap(e,t);return[...r.keys()]}static makeFormatStringMap(e,t){var r=t!==void 0&&t?"'T'":" ",i=e!==void 0&&e?" z":"";return new Map([["yyyy-MM-dd","yyyy-MM-dd".concat(i)],["MM-dd-yyyy","MM-dd-yyyy".concat(i)],["HH:mm:ss","HH:mm:ss".concat(i)],["HH:mm:ss.SSS","HH:mm:ss.SSS".concat(i)],["HH:mm:ss.SSSSSSSSS","HH:mm:ss.SSSSSSSSS".concat(i)],["yyyy-MM-dd HH:mm:ss","yyyy-MM-dd".concat(r,"HH:mm:ss").concat(i)],["yyyy-MM-dd HH:mm:ss.SSS","yyyy-MM-dd".concat(r,"HH:mm:ss.SSS").concat(i)],["yyyy-MM-dd HH:mm:ss.SSSSSSSSS","yyyy-MM-dd".concat(r,"HH:mm:ss.SSSSSSSSS").concat(i)]])}static getFormats(e,t){var r=Ut.makeFormatStringMap(e,t);return[...r.keys()]}constructor(e){var{timeZone:t="",showTimeZone:r=!0,showTSeparator:i=!1,defaultDateTimeFormatString:a=Ut.DEFAULT_DATETIME_FORMAT_STRING}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};super(),Vi(this,"dh",void 0),Vi(this,"dhTimeZone",void 0),Vi(this,"defaultDateTimeFormatString",void 0),Vi(this,"showTimeZone",void 0),Vi(this,"showTSeparator",void 0),Vi(this,"formatStringMap",void 0);var o=t||Ut.DEFAULT_TIME_ZONE_ID;try{this.dhTimeZone=e.i18n.TimeZone.getTimeZone(o)}catch{ov.error("Unsupported time zone id",o),this.dhTimeZone=e.i18n.TimeZone.getTimeZone(Ut.DEFAULT_TIME_ZONE_ID)}this.dh=e,this.defaultDateTimeFormatString=a,this.showTimeZone=r,this.showTSeparator=i,this.formatStringMap=Ut.makeFormatStringMap(r,i)}getEffectiveFormatString(e){var t;return(t=this.formatStringMap.get(e))!==null&&t!==void 0?t:e}format(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=t.formatString!=null&&t.formatString!==""?t.formatString:this.defaultDateTimeFormatString,i=this.getEffectiveFormatString(r);try{return this.dh.i18n.DateTimeFormat.format(i,e,this.dhTimeZone)}catch{ov.error("Invalid format arguments")}return""}}Vi(Ut,"DEFAULT_DATETIME_FORMAT_STRING","yyyy-MM-dd HH:mm:ss.SSS");Vi(Ut,"DEFAULT_TIME_ZONE_ID","America/New_York");function Kn(n,e,t){return e=MP(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function MP(n){var e=xP(n,"string");return typeof e=="symbol"?e:String(e)}function xP(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var AP=ie.module("DecimalColumnFormatter");class je extends Dt{static isValid(e,t){try{return e.i18n.NumberFormat.format(t.formatString,0),!0}catch{return!1}}static makeFormat(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Dt.TYPE_CONTEXT_PRESET,i=arguments.length>3?arguments[3]:void 0;return{label:e,type:r,formatString:t,multiplier:i}}static makePresetFormat(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",r=arguments.length>2?arguments[2]:void 0;return je.makeFormat(e,t,Dt.TYPE_CONTEXT_PRESET,r)}static makeCustomFormat(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",t=arguments.length>1?arguments[1]:void 0;return je.makeFormat("Custom Format",e,Dt.TYPE_CONTEXT_CUSTOM,t)}static isSameFormat(e,t){return e===t||e!=null&&t!=null&&e.type===t.type&&e.formatString===t.formatString&&e.multiplier===t.multiplier}constructor(e){var{defaultFormatString:t=je.DEFAULT_FORMAT_STRING}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};super(),Kn(this,"defaultFormatString",void 0),Kn(this,"dh",void 0),this.dh=e,this.defaultFormatString=t}format(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=t.formatString!=null&&t.formatString!==""?t.formatString:this.defaultFormatString,i=t.multiplier!=null&&t.multiplier!==0?e*t.multiplier:e;try{return this.dh.i18n.NumberFormat.format(r,i)}catch{AP.error("Invalid format arguments")}return""}}Kn(je,"DEFAULT_FORMAT_STRING","###,##0.0000");Kn(je,"FORMAT_PERCENT",je.makePresetFormat("Percent","##0.00%"));Kn(je,"FORMAT_BASIS_POINTS",je.makePresetFormat("Basis Points","###,##0 bp",1e4));Kn(je,"FORMAT_MILLIONS",je.makePresetFormat("Millions","###,##0.000 mm",1e-6));Kn(je,"FORMAT_SCIENTIFIC_NOTATION",je.makePresetFormat("Scientific Notation","0.0000E0"));Kn(je,"FORMAT_ROUND",je.makePresetFormat("Round","###,##0"));Kn(je,"FORMAT_ROUND_TWO_DECIMALS",je.makePresetFormat("0.00","###,##0.00"));Kn(je,"FORMAT_ROUND_FOUR_DECIMALS",je.makePresetFormat("0.0000","###,##0.0000"));class LP extends Dt{format(e){return"".concat(e)}}const kP=LP;function Os(n,e,t){return e=jP(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function jP(n){var e=$P(n,"string");return typeof e=="symbol"?e:String(e)}function $P(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var HP=ie.module("IntegerColumnFormatter");class Bt extends Dt{static isValid(e,t){try{return e.i18n.NumberFormat.format(t.formatString,0),!0}catch{return!1}}static makeFormat(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Dt.TYPE_CONTEXT_PRESET,i=arguments.length>3?arguments[3]:void 0;return{label:e,type:r,formatString:t,multiplier:i}}static makePresetFormat(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",r=arguments.length>2?arguments[2]:void 0;return Bt.makeFormat(e,t,Dt.TYPE_CONTEXT_PRESET,r)}static makeCustomFormat(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",t=arguments.length>1?arguments[1]:void 0;return Bt.makeFormat("Custom Format",e,Dt.TYPE_CONTEXT_CUSTOM,t)}static isSameFormat(e,t){return e===t||e!=null&&t!=null&&e.type===t.type&&e.formatString===t.formatString&&e.multiplier===t.multiplier}constructor(e){var{defaultFormatString:t=Bt.DEFAULT_FORMAT_STRING}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};super(),Os(this,"dh",void 0),Os(this,"defaultFormatString",void 0),this.dh=e,this.defaultFormatString=t}format(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=t.formatString!=null&&t.formatString!==""?t.formatString:this.defaultFormatString,i=t.multiplier!=null&&t.multiplier!==0?e*t.multiplier:e;try{return this.dh.i18n.NumberFormat.format(r,i)}catch{HP.error("Invalid format arguments")}return""}}Os(Bt,"DEFAULT_FORMAT_STRING","###,##0");Os(Bt,"FORMAT_MILLIONS",Bt.makePresetFormat("Millions","###,##0.000 mm",1e-6));Os(Bt,"FORMAT_SCIENTIFIC_NOTATION",Bt.makePresetFormat("Scientific Notation","0.0000E0"));class BP extends Dt{format(e){return e}}function tC(n,e,t){return e=UP(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function UP(n){var e=VP(n,"string");return typeof e=="symbol"?e:String(e)}function VP(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class Ze{static makeDateWrapper(e,t,r){var i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:1,o=arguments.length>5&&arguments[5]!==void 0?arguments[5]:0,s=arguments.length>6&&arguments[6]!==void 0?arguments[6]:0,l=arguments.length>7&&arguments[7]!==void 0?arguments[7]:0,d=arguments.length>8&&arguments[8]!==void 0?arguments[8]:0;if(!t)throw new Error("No timezone provided");var u="".concat(r).padStart(4,"0"),c="".concat(i+1).padStart(2,"0"),m="".concat(a).padStart(2,"0"),v="".concat(o).padStart(2,"0"),f="".concat(s).padStart(2,"0"),g="".concat(l).padStart(2,"0"),p="".concat(d).padStart(9,"0"),b="".concat(u,"-").concat(c,"-").concat(m," ").concat(v,":").concat(f,":").concat(g,".").concat(p);return e.i18n.DateTimeFormat.parse(Ze.FULL_DATE_FORMAT,b,e.i18n.TimeZone.getTimeZone(t))}static getNextNanos(e){var t=parseInt(e,10),r="0".repeat(9-e.length),i="".concat(t+1).concat(r);return parseInt(i,10)}static getNextDate(e,t,r,i){var{year:a,month:o,date:s,hours:l,minutes:d,seconds:u,nanos:c}=r;if(t.nanos!=null){if(t.nanos.length===9)return null;c=Ze.getNextNanos(t.nanos),c>999999999&&(u+=1,c=0)}else t.seconds!=null?u+=1:t.minutes!=null?d+=1:t.hours!=null?l+=1:t.date!=null?s+=1:t.month!=null?o+=1:a+=1;var m=new Date(a,o,s,l,d,u);return Ze.makeDateWrapper(e,i,m.getFullYear(),m.getMonth(),m.getDate(),m.getHours(),m.getMinutes(),m.getSeconds(),c)}static parseMonth(e){var t=parseInt(e,10);if(!Number.isNaN(t))return t>=1&&t<=12?t-1:NaN;var r=e.trim().toLowerCase();if(r.length>=3){for(var i=0;i<Ze.months.length;i+=1)if(Ze.months[i].startsWith(r))return i}return NaN}static parseDateValues(e,t,r,i,a,o,s){var l=parseInt(e,10),d=t!=null?this.parseMonth(t):0,u=r!=null?parseInt(r,10):1,c=i!=null?parseInt(i,10):0,m=a!=null?parseInt(a,10):0,v=o!=null?parseInt(o,10):0,f=s!=null?parseInt(s.padEnd(9,"0"),10):0;return Number.isNaN(l)||Number.isNaN(d)||Number.isNaN(u)||Number.isNaN(c)||Number.isNaN(m)||Number.isNaN(v)||Number.isNaN(f)?null:{year:l,month:d,date:u,hours:c,minutes:m,seconds:v,nanos:f}}static parseDateTimeString(e){var t=/\s*(\d{4})([-./]([\da-z]+))?([-./](\d{1,2}))?([tT\s](\d{2})([:](\d{2}))?([:](\d{2}))?([.](\d{1,9}))?)?(.*)/,r=t.exec(e);if(r==null)throw new Error("Unexpected date string: ".concat(e));var[,i,,a,,o,,s,,l,,d,,u,c]=r;if(c!=null&&c.length>0)throw new Error("Unexpected characters after date string '".concat(e,"': ").concat(c));return{year:i,month:a,date:o,hours:s,minutes:l,seconds:d,nanos:u}}static parseDateRange(e,t,r){var i=t.trim().toLowerCase();if(i.length===0)throw new Error("Cannot parse date range from empty string");if(i==="null")return[null,null];if(i==="today"){var a=new Date(Date.now()),o=Ze.makeDateWrapper(e,r,a.getFullYear(),a.getMonth(),a.getDate()),s=new Date(a.getFullYear(),a.getMonth(),a.getDate()+1),l=Ze.makeDateWrapper(e,r,s.getFullYear(),s.getMonth(),s.getDate());return[o,l]}if(i==="yesterday"){var d=new Date(Date.now()),u=new Date(d.getFullYear(),d.getMonth(),d.getDate()-1),c=Ze.makeDateWrapper(e,r,u.getFullYear(),u.getMonth(),u.getDate()),m=Ze.makeDateWrapper(e,r,d.getFullYear(),d.getMonth(),d.getDate());return[c,m]}if(i==="now"){var v=new Date(Date.now()),f=e.DateWrapper.ofJsDate(v);return[f,null]}var g=Ze.parseDateTimeString(i);if(g.year==null&&g.month==null&&g.date==null)throw new Error("Unable to extract year, month, or day ".concat(i));var p=Ze.parseDateValues(g.year,g.month,g.date,g.hours,g.minutes,g.seconds,g.nanos);if(p==null)throw new Error("Unable to extract date values from ".concat(g));var b=Ze.makeDateWrapper(e,r,p.year,p.month,p.date,p.hours,p.minutes,p.seconds,p.nanos),S=Ze.getNextDate(e,g,p,r);return[b,S]}static getJsDate(e){return typeof e=="number"?new Date(e):e.asDate()}}tC(Ze,"FULL_DATE_FORMAT","yyyy-MM-dd HH:mm:ss.SSSSSSSSS");tC(Ze,"months",["january","february","march","april","may","june","july","august","september","october","november","december"]);function B2(n,e){return n===e?{operator:"notEq",value:""}:{operator:"eq",value:n}}function U2(n,e,t){return function(i){var a=t.trim();if(a==="")return null;var o=rC(e,s=>s.filter().containsIgnoreCase(n.makeFilterValue(s.type,a)),"or");return o(i)}}function rC(n,e){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"or";return function(i){var a=i==null?void 0:i.findColumns(typeof n=="string"?[n]:n);if(a==null||a.length===0)return null;var o=a.map(e);return o.reduce((s,l)=>s[t](l))}}function GP(n,e,t,r){return rC(e,i=>i.filter()[r](n.makeFilterValue(i.type,t)),"or")}function V2(n,e,t,r,i){return function(o){var s=o==null?void 0:o.findColumn(e),l=t==="all"||r&&t.size===0;return s==null||l?null:n.makeSelectValueFilter(s,[...t.keys()],i)}}function G2(n){return function(t){return t.filter().isNull().not().and(t.filter().notEq(n.makeFilterValue(t.type,"")))}}function W2(n,e){return function(r){var i=r.filter(),a=n.makeFilterValue(r.type,""),o=i.eq(a);return e?i.isNull().or(o):o.or(i.notEq(a))}}function cc(n,e,t){return e=WP(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function WP(n){var e=zP(n,"string");return typeof e=="symbol"?e:String(e)}function zP(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class Hn{}cc(Hn,"not","not");cc(Hn,"and","and");cc(Hn,"or","or");function KP(n){if(!(n==="not"||n==="and"||n==="or"))throw new Error("operator is not a valid FilterOperatorValue")}function vt(n,e,t){return e=qP(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function qP(n){var e=YP(n,"string");return typeof e=="symbol"?e:String(e)}function YP(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class q{}vt(q,"eq","eq");vt(q,"eqIgnoreCase","eqIgnoreCase");vt(q,"notEq","notEq");vt(q,"notEqIgnoreCase","notEqIgnoreCase");vt(q,"greaterThan","greaterThan");vt(q,"greaterThanOrEqualTo","greaterThanOrEqualTo");vt(q,"lessThan","lessThan");vt(q,"lessThanOrEqualTo","lessThanOrEqualTo");vt(q,"in","in");vt(q,"inIgnoreCase","inIgnoreCase");vt(q,"notIn","notIn");vt(q,"notInIgnoreCase","notInIgnoreCase");vt(q,"isTrue","isTrue");vt(q,"isFalse","isFalse");vt(q,"isNull","isNull");vt(q,"invoke","invoke");vt(q,"contains","contains");vt(q,"notContains","notContains");vt(q,"containsIgnoreCase","containsIgnoreCase");vt(q,"startsWith","startsWith");vt(q,"endsWith","endsWith");vt(q,"containsAny","containsAny");function nC(n){switch(n){case q.eq:return"is exactly";case q.eqIgnoreCase:return"is exactly (ignore case)";case q.notEq:return"is not exactly";case q.notEqIgnoreCase:return"is not exactly (ignore case)";case q.contains:return"contains";case q.notContains:return"does not contain";case q.startsWith:return"starts with";case q.endsWith:return"ends with";default:throw new Error("Unrecognized text filter type ".concat(n))}}function iC(n){switch(n){case q.eq:return"is equal to";case q.notEq:return"is not equal to";case q.greaterThan:return"greater than";case q.greaterThanOrEqualTo:return"greater than or equal to";case q.lessThan:return"less than";case q.lessThanOrEqualTo:return"less than or equal to";default:throw new Error("Unrecognized number filter type ".concat(n))}}function aC(n){switch(n){case q.eq:return"date is";case q.notEq:return"date is not";case q.notEqIgnoreCase:case q.greaterThan:return"date is after";case q.greaterThanOrEqualTo:return"date is after or equal";case q.lessThan:return"date is before";case q.lessThanOrEqualTo:return"date is before or equal";default:throw new Error("Unrecognized date filter type ".concat(n))}}function XP(n){switch(n){case q.isTrue:return"Is True";case q.isFalse:return"Is False";case q.isNull:return"Is Null";default:throw new Error("Unrecognized boolean filter type ".concat(n))}}var sv=ie.module("ViewportDataUtils");function QP(n,e){return String(n.offsetInSnapshot+e)}function z2(n,e){var{bulkUpdate:t}=n;return function(i){var{columns:a,offset:o,rows:s}=i.detail;sv.debug("table updated",i.detail);var l=new Map;s.forEach(d=>{var u=e(d,a),c=QP(d,o);l.set(c,{key:c,item:u})}),sv.debug("update keys",l),t(l)}}function K2(n,e){return e.reduce((t,r)=>(t[r.name]=n.get(r),t),{})}function*q2(n,e){for(var t=n;t<=e;++t)yield{key:String(t)}}function ZP(n){return n==null||JP(n)?0:n.size}function JP(n){return"isClosed"in n?n.isClosed:!1}function Y2(n,e,t,r){var i=n+e-1,[a,o]=[0,r-1],s=Le(n-t,a,o),l=Le(i+t,a,o);return[s,l]}function lv(n,e,t,r,i,a,o){try{var s=n[a](o),l=s.value}catch(d){t(d);return}s.done?e(l):Promise.resolve(l).then(r,i)}function ji(n){return function(){var e=this,t=arguments;return new Promise(function(r,i){var a=n.apply(e,t);function o(l){lv(a,r,i,o,s,"next",l)}function s(l){lv(a,r,i,o,s,"throw",l)}o(void 0)})}}function ja(n,e,t){return e=eO(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function eO(n){var e=tO(n,"string");return typeof e=="symbol"?e:String(e)}function tO(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var ri=ie.module("TableUtils");class F{static copyTableAndApplyFilters(e){var t=arguments;return ji(function*(){if(e==null)return null;for(var r=yield e.copy(),i=t.length,a=new Array(i>1?i-1:0),o=1;o<i;o++)a[o-1]=t[o];return r.applyFilter(Lu(...a.map(s=>s(r)))),r})()}static getSortIndex(e,t){for(var r=0;r<e.length;r+=1){var i,a=e[r];if(((i=a.column)===null||i===void 0?void 0:i.name)===t)return r}return null}static getSortForColumn(e,t){var r=F.getSortIndex(e,t);return r!=null?e[r]:null}static getFilterText(e){return e?e.toString():null}static getFilterTypes(e){return F.isBooleanType(e)?[q.isTrue,q.isFalse,q.isNull]:F.isCharType(e)||F.isNumberType(e)||F.isDateType(e)?[q.eq,q.notEq,q.greaterThan,q.greaterThanOrEqualTo,q.lessThan,q.lessThanOrEqualTo]:F.isTextType(e)?[q.eq,q.eqIgnoreCase,q.notEq,q.notEqIgnoreCase,q.contains,q.notContains,q.startsWith,q.endsWith]:[]}static getNextSort(e,t,r){if(r<0||r>=e.length)return null;var i=F.getSortForColumn(t,e[r].name);return i===null?e[r].sort().asc():i.direction===F.sortDirection.ascending?i.desc():null}static makeColumnSort(e,t,r,i){if(t<0||t>=e.length||r===F.sortDirection.none)return null;var a=e[t].sort();switch(r){case F.sortDirection.ascending:a=a.asc();break;case F.sortDirection.descending:a=a.desc();break}return i&&(a=a.abs()),a}static toggleSortForColumn(e,t,r){var i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(r<0||r>=t.length)return[];var a=F.getNextSort(t,e,r);return F.setSortForColumn(e,t[r].name,a,i)}static sortColumn(e,t,r,i,a,o){if(r<0||r>=t.length)return[];var s=F.makeColumnSort(t,r,i,a);return F.setSortForColumn(e,t[r].name,s,o)}static setSortForColumn(e,t,r){var i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1,a=F.getSortIndex(e,t),o=[];return i&&(o=o.concat(e.filter(s=>{var{direction:l}=s;return l!==F.sortDirection.reverse})),a!==null&&o.splice(a,1)),r!==null&&o.push(r),o}static getNormalizedType(e){switch(e){case"boolean":case"java.lang.Boolean":case F.dataType.BOOLEAN:return F.dataType.BOOLEAN;case"char":case"java.lang.Character":case F.dataType.CHAR:return F.dataType.CHAR;case"java.lang.String":case F.dataType.STRING:return F.dataType.STRING;case"io.deephaven.db.tables.utils.DBDateTime":case"io.deephaven.time.DateTime":case"com.illumon.iris.db.tables.utils.DBDateTime":case"java.time.Instant":case"java.time.ZonedDateTime":case F.dataType.DATETIME:return F.dataType.DATETIME;case"double":case"java.lang.Double":case"float":case"java.lang.Float":case"java.math.BigDecimal":case F.dataType.DECIMAL:return F.dataType.DECIMAL;case"int":case"java.lang.Integer":case"long":case"java.lang.Long":case"short":case"java.lang.Short":case"byte":case"java.lang.Byte":case"java.math.BigInteger":case F.dataType.INT:return F.dataType.INT;default:return F.dataType.UNKNOWN}}static isLongType(e){switch(e){case"long":case"java.lang.Long":return!0;default:return!1}}static isDateType(e){switch(e){case"io.deephaven.db.tables.utils.DBDateTime":case"io.deephaven.time.DateTime":case"java.time.Instant":case"java.time.ZonedDateTime":case"com.illumon.iris.db.tables.utils.DBDateTime":return!0;default:return!1}}static isNumberType(e){return F.isIntegerType(e)||F.isDecimalType(e)}static isIntegerType(e){switch(e){case"int":case"java.lang.Integer":case"java.math.BigInteger":case"long":case"java.lang.Long":case"short":case"java.lang.Short":case"byte":case"java.lang.Byte":return!0;default:return!1}}static isDecimalType(e){switch(e){case"double":case"java.lang.Double":case"java.math.BigDecimal":case"float":case"java.lang.Float":return!0;default:return!1}}static isBigDecimalType(e){switch(e){case"java.math.BigDecimal":return!0;default:return!1}}static isBigIntegerType(e){switch(e){case"java.math.BigInteger":return!0;default:return!1}}static isBooleanType(e){switch(e){case"boolean":case"java.lang.Boolean":return!0;default:return!1}}static isCharType(e){switch(e){case"char":case"java.lang.Character":return!0;default:return!1}}static isStringType(e){switch(e){case"java.lang.String":return!0;default:return!1}}static isTextType(e){return this.isStringType(e)||this.isCharType(e)}static getBaseType(e){return e.split("[]")[0]}static isCompatibleType(e,t){return F.getNormalizedType(e)===F.getNormalizedType(t)}static quoteValue(e){return e.length>=2&&(e.charAt(0)==='"'&&e.charAt(e.length-1)==='"'||e.charAt(0)==="'"&&e.charAt(e.length-1)==="'")?e:'"'.concat(e,'"')}static isRangeOperation(e){switch(e){case"<":case"<=":case"=<":case">":case">=":case"=>":return!0;default:return!1}}static makeRangeFilterWithOperation(e,t,r){switch(t){case"=":return e.eq(r);case"<":return e.lessThan(r);case"<=":case"=<":return e.lessThanOrEqualTo(r);case">":return e.greaterThan(r);case">=":case"=>":return e.greaterThanOrEqualTo(r);case"!=":case"!":return e.notEq(r);default:return null}}static makeCancelableTablePromise(e){return Re.makeCancelable(e,t=>{t.close()})}static makeCancelableTableEventPromise(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null,a,o,s=!0,l=new Promise((d,u)=>{o=setTimeout(()=>{a(),s=!1,u(new q0('Event "'.concat(t,'" timed out.')))},r),a=e.addEventListener(t,c=>{if(i!=null&&!i(c)){ri.debug2("Event triggered, but matcher returned false.");return}ri.debug2("Event triggered, resolving."),a(),clearTimeout(o),s=!1,d(c)})});return l.cancel=()=>{if(s){ri.debug2("Pending promise cleanup."),a(),clearTimeout(o),s=!1;return}ri.debug2("Ignoring non-pending promise cancel.")},l}static removeCommas(e){return e.replace(/[\s|,]/g,"")}static makeBooleanValue(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(e===""&&t)return null;switch(e==null?void 0:e.toLowerCase()){case"null":return null;case"0":case"f":case"fa":case"fal":case"fals":case"false":case"n":case"no":return!1;case"1":case"t":case"tr":case"tru":case"true":case"y":case"ye":case"yes":return!0;default:throw new Error("Invalid boolean '".concat(e,"'"))}}static makeNumberValue(e){if(e==="null"||e==="")return null;var t=e.toLowerCase().trim();if(t==="∞"||t==="infinity"||t==="inf")return Number.POSITIVE_INFINITY;if(t==="-∞"||t==="-infinity"||t==="-inf")return Number.NEGATIVE_INFINITY;var r=F.removeCommas(t);if(F.NUMBER_REGEX.test(r))return parseFloat(r);throw new Error("Invalid number '".concat(e,"'"))}static getFilterOperatorString(e){switch(e){case q.eq:return"=";case q.notEq:return"!=";case q.greaterThan:return">";case q.greaterThanOrEqualTo:return">=";case q.lessThan:return"<";case q.lessThanOrEqualTo:return"<=";case q.contains:return"~";case q.notContains:return"!~";default:throw new Error("Unexpected filter type ".concat(e))}}static isPartitionedTable(e){return e!=null&&e.getMergedTable!==void 0&&e.getKeyTable!==void 0&&e.getKeys!==void 0}static isTreeTable(e){return e!=null&&e.expand!==void 0&&e.collapse!==void 0}static sortColumns(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return[...e].sort((r,i)=>{var a=r.name.toUpperCase(),o=i.name.toUpperCase();return Mr.sort(a,o,t)})}constructor(e){ja(this,"dh",void 0),this.dh=e,sE(this)}createDistinctSortedColumnTable(e,t,r){var i=arguments,a=this;return ji(function*(){if(e==null)return null;for(var o=e,s=i.length,l=new Array(s>3?s-3:0),d=3;d<s;d++)l[d-3]=i[d];l.length>0&&(o=yield e.copy(),yield o.applyFilter(Lu(...l.map(v=>v(o)))));var u=o.findColumn(t),c=yield o.selectDistinct([u]);o!==e&&o.close();var m=c.findColumn(t).sort()[r]();return a.applySort(c,[m])})()}doesColumnValueExist(e,t,r,i){var a=this;return ji(function*(){if(e==null)return null;var o=GP(a,t,r,i?"eq":"eqIgnoreCase"),s=yield e.copy();yield a.applyFilter(s,Lu(o(s)));var l=ZP(s);return s.close(),l>0})()}makeQuickFilter(e,t,r){for(var i=t.split("||"),a=null,o=0;o<i.length;o+=1){for(var s=i[o],l=s.split("&&"),d=null,u=0;u<l.length;u+=1){var c=l[u].trim();if(c.length>0){var m=this.makeQuickFilterFromComponent(e,c,r);if(m)d?d=d.and(m):d=m;else throw new Error("Unable to parse quick filter from text ".concat(t))}}a&&d?a=a.or(d):a=d}return a}makeQuickFilterFromComponent(e,t,r){var{type:i}=e;return F.isNumberType(i)?this.makeQuickNumberFilter(e,t):F.isBooleanType(i)?this.makeQuickBooleanFilter(e,t):r!=null&&F.isDateType(i)?this.makeQuickDateFilter(e,t,r):F.isCharType(i)?this.makeQuickCharFilter(e,t):this.makeQuickTextFilter(e,t)}makeQuickNumberFilter(e,t){var r=e.filter(),{dh:i}=this,a=null,o=/\s*(>=|<=|=>|=<|>|<|!=|=|!)?(\s*-\s*)?(\s*\d*(?:,\d{3})*(?:\.\d*)?\s*)?(null|nan|infinity|inf|\u221E)?(.*)/i,s=o.exec(t),l=null,d=null,u=null,c=null,m=null;if(s!==null&&s.length>3&&([,l,d,u,c,m]=s),m!=null&&m.trim().length>0)return null;if(l==null&&(l="="),c!=null){if(!(l==="="||l==="!"||l==="!="))return null;switch(c=c.trim().toLowerCase(),c){case"null":a=r.isNull();break;case"nan":a=i.FilterCondition.invoke("isNaN",r);break;case"infinity":case"inf":case"∞":d!=null?a=i.FilterCondition.invoke("isInf",r).and(r.lessThan(i.FilterValue.ofNumber(0))):a=i.FilterCondition.invoke("isInf",r).and(r.greaterThan(i.FilterValue.ofNumber(0)));break}return a!==null&&(l==="!"||l==="!=")&&(a=a.not()),a}if(u==null)return null;if(u=F.removeCommas(u),F.isLongType(e.type))try{u=i.FilterValue.ofNumber(i.LongWrapper.ofString("".concat(d!=null?"-":"").concat(u)))}catch(v){return ri.warn("Unable to create long filter",v),null}else{if(u=parseFloat(u),u==null||Number.isNaN(u))return null;u=i.FilterValue.ofNumber(d!=null?0-u:u)}return a=e.filter(),F.makeRangeFilterWithOperation(a,l,u)}static escapeQuickTextFilter(e){var t,r;if(e==null)return null;var i=/^(!~|!=|~|=|!)?(.*)/,a=/^\\*null$/,o=i.exec(e),s=null,l=null;if(o!==null&&o.length>2&&([,s,l]=o),s!=null){var d;return"\\".concat(s).concat((d=l)!==null&&d!==void 0?d:"")}return l!=null&&a.test(l.toLowerCase())||l!=null&&l.startsWith("*")?"\\".concat(l):l!=null&&l.endsWith("*")&&!l.endsWith("\\*")?(l=l.substring(0,l.length-1),"".concat(l,"\\*")):"".concat((t=s)!==null&&t!==void 0?t:"").concat((r=l)!==null&&r!==void 0?r:"")}static unescapeQuickTextFilter(e){var t,r,i=/^(\\!~|\\!=|\\~|\\=|\\!)?(.*)/,a=/^\\*null$/,o=i.exec(e),s=null,l=null;return o!==null&&o.length>2&&([,s,l]=o),s!=null&&(s=s.replace("\\","")),l!=null&&a.test(l.toLowerCase())&&(l=l.replace("\\","")),s==null&&l!=null&&l.startsWith("\\*")&&(l=l.substring(1)),s==null&&l!=null&&l.endsWith("\\*")?(l=l.substring(0,l.length-2),"".concat(l,"*")):"".concat((t=s)!==null&&t!==void 0?t:"").concat((r=l)!==null&&r!==void 0?r:"")}makeQuickTextFilter(e,t){var{dh:r}=this,i="".concat(t).trim(),a=/^(!~|!=|~|=|!)?(.*)/,o=a.exec(i),s=null,l=null;if(o!==null&&o.length>2&&([,s,l]=o,l!=null&&(l=l.trim())),l==null||l.length===0&&!(s==="="||s==="!="))return null;s==null&&(s="=");var d=e.filter();if(l.toLowerCase()==="null")switch(s){case"=":return d.isNull();case"!=":case"!":return d.isNull().not()}var u=null,c=null;switch(l.startsWith("*")?(u="*",l=l.substring(1)):l.endsWith("*")&&!l.endsWith("\\*")&&(c="*",l=l.substring(0,l.length-1)),l=F.unescapeQuickTextFilter(l),s){case"~":return d.isNull().not().and(d.invoke("matches",r.FilterValue.ofString("(?s)(?i).*\\Q".concat(l,"\\E.*"))));case"!~":return d.isNull().or(d.invoke("matches",r.FilterValue.ofString("(?s)(?i).*\\Q".concat(l,"\\E.*"))).not());case"!=":return u==="*"?d.isNull().or(d.invoke("matches",r.FilterValue.ofString("(?s)(?i).*\\Q".concat(l,"\\E$"))).not()):c==="*"?d.isNull().or(d.invoke("matches",r.FilterValue.ofString("(?s)(?i)^\\Q".concat(l,"\\E.*"))).not()):d.notEqIgnoreCase(r.FilterValue.ofString(l.toLowerCase()));case"=":return u==="*"?d.isNull().not().and(d.invoke("matches",r.FilterValue.ofString("(?s)(?i).*\\Q".concat(l,"\\E$")))):c==="*"?d.isNull().not().and(d.invoke("matches",r.FilterValue.ofString("(?s)(?i)^\\Q".concat(l,"\\E.*")))):d.eqIgnoreCase(r.FilterValue.ofString(l.toLowerCase()))}return null}makeQuickBooleanFilter(e,t){var r=/^(!=|=|!)?(.*)/,i=r.exec("".concat(t).trim());if(i===null)return null;var[,a,o]=i,s=a==="!"||a==="!=",l=o.trim().toLowerCase(),d=e.filter();try{var u=F.makeBooleanValue(l);return u!=null&&u?d=d.isTrue():u===null?d=d.isNull():d=d.isFalse(),s?d.not():d}catch{return null}}makeQuickDateFilter(e,t,r){var i=t.trim(),a=/\s*(>=|<=|=>|=<|>|<|!=|!|=)?(.*)/,o=a.exec(i);if(o==null||o.length<=2)throw new Error("Unable to parse date filter: ".concat(t));var s=null,l=null;[,s,l]=o;var d=q.eq;switch(s){case"<":d=q.lessThan;break;case"<=":case"=<":d=q.lessThanOrEqualTo;break;case">":d=q.greaterThan;break;case">=":case"=>":d=q.greaterThanOrEqualTo;break;case"!=":case"!":d=q.notEq;break;case"=":case"==":default:d=q.eq;break}return this.makeQuickDateFilterWithOperation(e,l,d,r)}makeQuickDateFilterWithOperation(e,t,r,i){var{dh:a}=this,[o,s]=Ze.parseDateRange(a,t,i),l=o!=null?a.FilterValue.ofNumber(o):null,d=s!=null?a.FilterValue.ofNumber(s):null,u=e.filter();if(l==null)return r===q.notEq?u.isNull().not():u.isNull();switch(r){case q.eq:{if(d!=null){var c=u.greaterThanOrEqualTo(l),m=u.lessThan(d);return c.and(m)}return u.eq(l)}case q.lessThan:return u.lessThan(l);case q.lessThanOrEqualTo:return d!=null?u.lessThan(d):u.lessThanOrEqualTo(l);case q.greaterThan:return d!=null?u.greaterThanOrEqualTo(d):u.greaterThan(l);case q.greaterThanOrEqualTo:return u.greaterThanOrEqualTo(l);case q.notEq:{if(d!=null){var v=u.lessThan(l),f=u.greaterThanOrEqualTo(d);return v.or(f)}return u.notEq(l)}default:throw new Error("Invalid operator: ".concat(r))}}makeQuickCharFilter(e,t){var{dh:r}=this,i="".concat(t).trim(),a=/^(>=|<=|=>|=<|>|<|!=|=|!)?(null|"."|'.'|.)?(.*)/,o=a.exec(i),s=null,l=null,d=null;if(o!==null&&o.length>3&&([,s,l,d]=o),d!=null&&d.trim().length>0||l==null||l.length===0)return null;s==null&&(s="=");var u=e.filter();if(l.toLowerCase()==="null")switch(s){case"=":return u.isNull();case"!=":case"!":return u.isNull().not();default:return null}var c=r.FilterValue.ofString(F.isRangeOperation(s)?F.quoteValue(l):l);return F.makeRangeFilterWithOperation(u,s,c)}makeAdvancedFilter(e,t,r){for(var{filterItems:i,filterOperators:a,invertSelection:o,selectedValues:s}=t,l=null,d=0;d<i.length;d+=1){var u=i[d],{selectedType:c,value:m}=u;if(c!=null&&c.length>0&&m!=null&&m.length>0)try{var v=this.makeAdvancedValueFilter(e,c,m,r);if(v!=null){if(d===0)l=v;else if(l!==null&&d-1<a.length){var f=a[d-1];if(f===Hn.and)l=l.and(v);else if(f===Hn.or)l=l.or(v);else{ri.error("Unexpected filter operator",f,v),l=null;break}}}else ri.debug2("Empty filter ignored for",c,m)}catch(p){ri.error("Unable to create filter",p),l=null;break}}var g=this.makeSelectValueFilter(e,s,o);return g!=null&&(l!=null?l=l.and(g):l=g),l}makeAdvancedValueFilter(e,t,r,i){var{dh:a}=this;if(F.isDateType(e.type))return this.makeQuickDateFilterWithOperation(e,r,t,i);if(F.isNumberType(e.type)||F.isCharType(e.type))return this.makeQuickFilter(e,"".concat(F.getFilterOperatorString(t)).concat(r));var o=this.makeFilterValue(e.type,r),s=e.filter();switch(t){case q.eq:return s.eq(o);case q.eqIgnoreCase:return s.eqIgnoreCase(o);case q.notEq:return s.notEq(o);case q.notEqIgnoreCase:return s.notEqIgnoreCase(o);case q.greaterThan:return s.greaterThan(o);case q.greaterThanOrEqualTo:return s.greaterThanOrEqualTo(o);case q.lessThan:return s.lessThan(o);case q.lessThanOrEqualTo:return s.lessThanOrEqualTo(o);case q.isTrue:return s.isTrue();case q.isFalse:return s.isFalse();case q.isNull:return s.isNull();case q.contains:return s.isNull().not().and(s.invoke("matches",a.FilterValue.ofString("(?s)(?i).*\\Q".concat(r,"\\E.*"))));case q.notContains:return s.isNull().or(s.invoke("matches",a.FilterValue.ofString("(?s)(?i).*\\Q".concat(r,"\\E.*"))).not());case q.startsWith:return s.isNull().not().and(s.invoke("matches",a.FilterValue.ofString("(?s)(?i)^\\Q".concat(r,"\\E.*"))));case q.endsWith:return s.isNull().not().and(s.invoke("matches",a.FilterValue.ofString("(?s)(?i).*\\Q".concat(r,"\\E$"))));case q.in:case q.inIgnoreCase:case q.notIn:case q.notInIgnoreCase:case q.invoke:default:throw new Error("Unexpected filter operation: ".concat(t))}}applyNeverFilter(e,t){var r=arguments,i=this;return ji(function*(){var a=r.length>2&&r[2]!==void 0?r[2]:F.APPLY_TABLE_CHANGE_TIMEOUT_MS;if(e==null)return null;var o=e.findColumn(t),s=[i.makeNeverFilter(o)];return yield i.applyFilter(e,s,a),e})()}applyCustomColumns(e,t){var r=arguments,i=this;return ji(function*(){var a=r.length>2&&r[2]!==void 0?r[2]:F.APPLY_TABLE_CHANGE_TIMEOUT_MS,{dh:o}=i;return F.executeAndWaitForEvent(s=>s==null?void 0:s.applyCustomColumns(t),e,o.Table.EVENT_CUSTOMCOLUMNSCHANGED,a)})()}applyFilter(e,t){var r=arguments,i=this;return ji(function*(){var a=r.length>2&&r[2]!==void 0?r[2]:F.APPLY_TABLE_CHANGE_TIMEOUT_MS,{dh:o}=i;return F.executeAndWaitForEvent(s=>s==null?void 0:s.applyFilter(t),e,o.Table.EVENT_FILTERCHANGED,a)})()}applySort(e,t){var r=arguments,i=this;return ji(function*(){var a=r.length>2&&r[2]!==void 0?r[2]:F.APPLY_TABLE_CHANGE_TIMEOUT_MS,{dh:o}=i;return F.executeAndWaitForEvent(s=>s==null?void 0:s.applySort(t),e,o.Table.EVENT_SORTCHANGED,a)})()}makeNeverFilter(e){var{dh:t}=this,r=null;F.isTextType(e.type)?r=t.FilterValue.ofString("a"):F.isBooleanType(e.type)?r=t.FilterValue.ofBoolean(!0):F.isDateType(e.type)?r=t.FilterValue.ofNumber(t.DateWrapper.ofJsDate(new Date)):r=t.FilterValue.ofNumber(0);var i=e.filter().eq(r),a=e.filter().notEq(r);return i.and(a)}makeFilterValue(e,t){var{dh:r}=this,i=F.getBaseType(e);return F.isTextType(i)?r.FilterValue.ofString(t):F.isLongType(i)?r.FilterValue.ofNumber(r.LongWrapper.ofString(F.removeCommas(t))):r.FilterValue.ofNumber(F.removeCommas(t))}makeFilterRawValue(e,t){var{dh:r}=this;return F.isCharType(e)?r.FilterValue.ofString(typeof t=="number"?String.fromCharCode(t):t):F.isTextType(e)?r.FilterValue.ofString(t):F.isBooleanType(e)?r.FilterValue.ofBoolean(t):r.FilterValue.ofNumber(t)}makeValue(e,t,r){var{dh:i}=this;if(t==="null")return null;if(F.isTextType(e))return t;if(F.isLongType(e))return i.LongWrapper.ofString(F.removeCommas(t));if(F.isBooleanType(e))return F.makeBooleanValue(t,!0);if(F.isDateType(e)){var[a]=Ze.parseDateRange(i,t,r);return a}return F.isNumberType(e)?F.makeNumberValue(t):(ri.error("Unexpected column type",e),null)}makeSelectValueFilter(e,t,r){var{dh:i}=this;if(t.length===0)return r?null:this.makeNeverFilter(e);for(var a=[],o=!1,s=0;s<t.length;s+=1){var l=t[s];l==null?o=!0:F.isTextType(e.type)?a.push(i.FilterValue.ofString(typeof l=="number"?String.fromCharCode(l):l)):F.isBooleanType(e.type)?a.push(i.FilterValue.ofBoolean(!!l)):a.push(i.FilterValue.ofNumber(l))}return o?a.length>0?r?e.filter().isNull().not().and(e.filter().notIn(a)):e.filter().isNull().or(e.filter().in(a)):r?e.filter().isNull().not():e.filter().isNull():r?e.filter().notIn(a):e.filter().in(a)}}ja(F,"dataType",{BOOLEAN:"boolean",CHAR:"char",DATETIME:"datetime",DECIMAL:"decimal",INT:"int",STRING:"string",UNKNOWN:"unknown"});ja(F,"sortDirection",{ascending:"ASC",descending:"DESC",reverse:"REVERSE",none:null});ja(F,"APPLY_TABLE_CHANGE_TIMEOUT_MS",3e4);ja(F,"REVERSE_TYPE",Object.freeze({NONE:"none",PRE_SORT:"pre-sort",POST_SORT:"post-sort"}));ja(F,"NUMBER_REGEX",/^-?\d+(\.\d+)?$/);ja(F,"executeAndWaitForEvent",function(){var n=ji(function*(e,t,r){var i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:F.APPLY_TABLE_CHANGE_TIMEOUT_MS;if(t==null)return null;var a=F.makeCancelableTableEventPromise(t,r,i);return e(t),yield a,t});return function(e,t,r){return n.apply(this,arguments)}}());function ll(n,e,t){return e=rO(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function rO(n){var e=nO(n,"string");return typeof e=="symbol"?e:String(e)}function nO(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class ur{static makeColumnFormatMap(e){return e==null?new Map:e.reduce((t,r)=>{var i=F.getNormalizedType(r.columnType);if(i===null)return t;t.has(i)||t.set(i,new Map);var a=t.get(i);return a==null||a.set(r.columnName,r.format),t},new Map)}static makeColumnFormattingRule(e,t,r){return{columnType:e,columnName:t,format:r}}constructor(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],r=arguments.length>2?arguments[2]:void 0,i=arguments.length>3?arguments[3]:void 0,a=arguments.length>4?arguments[4]:void 0,o=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!1;ll(this,"defaultColumnFormatter",void 0),ll(this,"typeFormatterMap",void 0),ll(this,"columnFormatMap",void 0),ll(this,"truncateNumbersWithPound",void 0),this.defaultColumnFormatter=new kP,this.typeFormatterMap=new Map([[F.dataType.BOOLEAN,new NP],[F.dataType.CHAR,new IP],[F.dataType.DATETIME,new Ut(e,r)],[F.dataType.DECIMAL,new je(e,i)],[F.dataType.INT,new Bt(e,a)],[F.dataType.STRING,new BP]]),this.columnFormatMap=ur.makeColumnFormatMap(t),this.truncateNumbersWithPound=o}getColumnFormatMapForType(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,r=F.getNormalizedType(e);if(r!==null)return t&&!this.columnFormatMap.has(r)&&this.columnFormatMap.set(r,new Map),this.columnFormatMap.get(r)}getColumnFormat(e,t){var r,i=this.getColumnFormatMapForType(e);return(r=i==null?void 0:i.get(t))!==null&&r!==void 0?r:null}getColumnTypeFormatter(e){var t=F.getNormalizedType(e),r=this.defaultColumnFormatter;if(t){var i;r=(i=this.typeFormatterMap.get(t))!==null&&i!==void 0?i:r}return r}getFormattedString(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"",i=arguments.length>3?arguments[3]:void 0;if(e==null)return"";var a=this.getColumnTypeFormatter(t),o=i||this.getColumnFormat(t,r);return a.format(e,o??void 0)}get timeZone(){var e,t=this.typeFormatterMap.get(F.dataType.DATETIME);return t==null||(e=t.dhTimeZone)===null||e===void 0?void 0:e.id}}function iO(n){if(n&&n.formatter){var{formatter:e}=n;return e}}function aO(n){return{timeZone:n==null?void 0:n.timeZone,defaultDateTimeFormatString:n==null?void 0:n.defaultDateTimeFormat,showTimeZone:n==null?void 0:n.showTimeZone,showTSeparator:n==null?void 0:n.showTSeparator}}function oO(n,e,t){var r=n.getColumnFormat(t,e);return r!=null&&(r.type===Dt.TYPE_CONTEXT_PRESET||r.type===Dt.TYPE_CONTEXT_CUSTOM)}const gi={getColumnFormats:iO,getDateTimeFormatterOptions:aO,isCustomColumnFormatDefined:oO};function sO(n){return typeof n=="object"&&n!=null&&"equals"in n&&typeof n.equals=="function"}function lO(n){return"".concat(n)}function dO(n){var{column:e,table:t,filter:r=Te,onChange:i,selectedValue:a,disabled:o,className:s,formatValue:l=lO,maxSize:d=1e3}=n,u=oa(),[c,m]=w.useState([]);w.useEffect(()=>{if(t==null){m([]);return}var p=e??t.columns[0];t.applyFilter(r);var b=t.setViewport(0,d,[p]);return b.addEventListener(u.Table.EVENT_UPDATED,S=>{var{detail:C}=S,y=C.rows.map(E=>E.get(p));m(y)}),()=>{b.close()}},[e,u,r,d,t]);var v=w.useMemo(()=>a===void 0?[void 0,...c]:c,[a,c]),f=w.useMemo(()=>v.findIndex(p=>p===a||sO(p)&&p.equals(a)),[a,v]),g=w.useCallback(p=>{i(v[p])},[i,v]);return h.jsx(Gt,{className:s,value:f,onChange:g,disabled:o,children:v.map((p,b)=>h.jsx(Xb,{value:b,children:l(p)},"".concat(b)))})}const oC=typeof Au=="function"?Au:Au.default;ec.register([tE,rE,nE,iE,aE,oE]);function dr(n,e,t){return e=uO(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function uO(n){var e=hO(n,"string");return typeof e=="symbol"?e:String(e)}function hO(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class Pt{constructor(e){dr(this,"dh",void 0),dr(this,"listeners",void 0),dr(this,"formatter",void 0),dr(this,"rect",void 0),dr(this,"isDownsamplingDisabled",void 0),dr(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(Pt.EVENT_UPDATED,{detail:e}))}fireDisconnect(){this.fireEvent(new CustomEvent(Pt.EVENT_DISCONNECT))}fireReconnect(){this.fireEvent(new CustomEvent(Pt.EVENT_RECONNECT))}fireDownsampleStart(e){this.fireEvent(new CustomEvent(Pt.EVENT_DOWNSAMPLESTARTED,{detail:e}))}fireDownsampleFinish(e){this.fireEvent(new CustomEvent(Pt.EVENT_DOWNSAMPLEFINISHED,{detail:e}))}fireDownsampleFail(e){this.fireEvent(new CustomEvent(Pt.EVENT_DOWNSAMPLEFAILED,{detail:e}))}fireDownsampleNeeded(e){this.fireEvent(new CustomEvent(Pt.EVENT_DOWNSAMPLENEEDED,{detail:e}))}fireLoadFinished(){this.fireEvent(new CustomEvent(Pt.EVENT_LOADFINISHED))}fireError(e){this.fireEvent(new CustomEvent(Pt.EVENT_ERROR,{detail:e}))}}dr(Pt,"EVENT_UPDATED","ChartModel.EVENT_UPDATED");dr(Pt,"EVENT_DISCONNECT","ChartModel.EVENT_DISCONNECT");dr(Pt,"EVENT_RECONNECT","ChartModel.EVENT_RECONNECT");dr(Pt,"EVENT_DOWNSAMPLESTARTED","ChartModel.EVENT_DOWNSAMPLESTARTED");dr(Pt,"EVENT_DOWNSAMPLEFINISHED","ChartModel.EVENT_DOWNSAMPLEFINISHED");dr(Pt,"EVENT_DOWNSAMPLEFAILED","ChartModel.EVENT_DOWNSAMPLEFAILED");dr(Pt,"EVENT_DOWNSAMPLENEEDED","ChartModel.EVENT_DOWNSAMPLENEEDED");dr(Pt,"EVENT_LOADFINISHED","ChartModel.EVENT_LOADFINISHED");dr(Pt,"EVENT_ERROR","ChartModel.EVENT_ERROR");const Mn=Pt;function dv(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function dl(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?dv(Object(t),!0).forEach(function(r){Wt(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):dv(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function Wt(n,e,t){return e=cO(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function cO(n){var e=mO(n,"string");return typeof e=="symbol"?e:String(e)}function mO(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var Wo=ie.module("ChartUtils"),uv="io.deephaven.time.DateTime",vO=36e5,fO=1e6;function gO(n){return n.asDate!==void 0}function pO(n){return n.asNumber!==void 0}function hv(n){return n.dhTimeZone!==void 0}function bO(n){return n!=null&&n.range!=null&&(n.autorange===!1||n.autorange===void 0)}class ce{static getPlotlyErrorBars(e,t,r,i){var a=r.map((s,l)=>s-e[l]),o=t.map((s,l)=>e[l]-s);return{type:"data",symmetric:!1,array:a,arrayminus:o,color:i.error_band_line_color}}static convertNumberPrefix(e){return e.replace(/\u00A4\u00A4/g,"USD").replace(/\u00A4/g,"$")}static getPlotlyNumberFormat(e,t,r){if(!r)return null;var i=r.split(";"),a=i[0].match(/^([^#,0.]*)([#,]*)([0,]*)(\.?)(0*)(#*)(E?0*)(%?)(.*)/);j(a);var[,o,s,l,,d,u,c,m,v]=a,f=l.replace(",","").length,g=s.indexOf(",")>=0||l.indexOf(",")>=0,p=g?",":"",b=c!=null&&c!==""?"e":"f",S=m!==""?m:b,C=d.length+u.length,y="",E="0".concat(f).concat(p,".").concat(C).concat(y).concat(S),T=ce.convertNumberPrefix(o),O=ce.convertNumberPrefix(v);return{tickformat:E,tickprefix:T,ticksuffix:O,automargin:!0}}static addTickSpacing(e,t,r){var{gapBetweenMajorTicks:i}=t;if(i>0){var a=e||{},o=i;return r&&(o=i/fO),t.log&&(o=Math.log(o)),a.tickmode="linear",a.dtick=o,a}return e}static getSourceForAxis(e,t){for(var r=0;r<e.series.length;r+=1)for(var i=e.series[r],a=0;a<i.sources.length;a+=1){var o=i.sources[a];if(o.axis===t)return o}return null}static getSeriesVisibility(e,t){return t!=null&&t.hiddenSeries!=null&&t.hiddenSeries.includes(e)?"legendonly":!0}static getHiddenLabels(e){return e!=null&&e.hiddenSeries?[...e.hiddenSeries]:[]}static makeSeriesData(e,t,r,i){var a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:ce.ORIENTATION.VERTICAL;return{type:e,mode:t,name:r,orientation:a,showlegend:i??void 0}}static getMarkerSymbol(e){switch(e){case"SQUARE":return"square";case"CIRCLE":return"circle";case"DIAMOND":return"diamond";case"UP_TRIANGLE":return"triangle-up";case"DOWN_TRIANGLE":return"triangle-down";case"RIGHT_TRIANGLE":return"triangle-right";case"LEFT_TRIANGLE":return"triangle-left";case"ELLIPSE":case"HORIZONTAL_RECTANGLE":case"VERTICAL_RECTANGLE":default:throw new Error("Unrecognized shape ".concat(e))}}static getAllAxes(e){return e.charts.reduce((t,r)=>[...t,...r.axes],[])}static getAxisTypeMap(e){var t=ce.getAllAxes(e);return ce.groupArray(t,"type")}static getChartForSeries(e,t){for(var{charts:r}=e,i=0;i<r.length;i+=1)for(var a=r[i],o=0;o<a.series.length;o+=1)if(t===a.series[o])return a;return null}static getLayoutRanges(e){for(var t={},r=Object.keys(e).filter(s=>s.indexOf("axis")>=0),i=0;i<r.length;i+=1){var a=r[i],o=e[a];bO(o)&&(t[a]=[...o.range])}return t}static getAxisLayoutProperty(e,t){var r=t>0?"".concat(t+1):"";return"".concat(e??"","axis").concat(r)}static periodToDecimal(e){var t=e.split(":");return Number(t[0])+Number(t[1])/60}static groupArray(e,t){return e.reduce((r,i)=>{var a,o=i[t],s=(a=r.get(o))!==null&&a!==void 0?a:[];return s.push(i),r.set(o,s),r},new Map)}static getColorwayFromTheme(e){var t=[];return e.colorway&&(Array.isArray(e.colorway)?t=e.colorway:typeof e.colorway=="string"?t=e.colorway.split(" "):Wo.warn("Unable to handle colorway property: ".concat(e.colorway))),t}static titleFromSettings(e){var{series:t,xAxis:r,title:i="".concat((t??[]).join(", ")," by ").concat(r)}=e;return i}constructor(e){Wt(this,"dh",void 0),Wt(this,"daysOfWeek",void 0),this.dh=e,this.daysOfWeek=Object.freeze(e.calendar.DayOfWeek.values())}getAxisFormats(e,t){for(var r=this,i=new Map,a={tickformat:null,ticksuffix:null},o=ce.getAllAxes(e),s=ce.groupArray(o,"type"),{charts:l}=e,d=0;d<l.length;d+=1)for(var u=l[d],c=0;c<u.series.length;c+=1)for(var m=u.series[c],{sources:v}=m,f=v.filter(S=>S.axis),g=function(){var C=f[p],{axis:y}=C,{type:E}=y,T=s.get(E);j(T);var O=T.indexOf(y),N=r.getAxisPropertyName(E);if(N!=null){var P=ce.getAxisLayoutProperty(N,O);if(i.has(P))Wo.debug("".concat(P," already added."));else{Wo.debug("Adding ".concat(P," to axisFormats."));var R=r.getPlotlyAxisFormat(C,t);if(R===null)i.set(P,a);else{i.set(P,R);var{businessCalendar:A}=y;if(A!=null){var M=[],{businessPeriods:I,businessDays:x,holidays:_,timeZone:k}=A,U=t==null?void 0:t.getColumnTypeFormatter(uv),G;hv(U)&&(G=U.dhTimeZone);var Y=G?(k.standardOffset-G.standardOffset)/60:0;_.length>0&&M.push(...r.createRangeBreakValuesFromHolidays(_,k,G)),I.forEach(Z=>M.push({pattern:"hour",bounds:[ce.periodToDecimal(Z.close)+Y,ce.periodToDecimal(Z.open)+Y]})),x.length<r.daysOfWeek.length&&r.createBoundsFromDays(x).forEach(Z=>M.push({pattern:"day of week",bounds:Z})),R.rangebreaks=M}if(i.size===u.axes.length)return{v:i}}}}},p=0;p<f.length;p+=1){var b=g();if(typeof b=="object")return b.v}return i}getPlotlyChartType(e,t){var{dh:r}=this;switch(e){case r.plot.SeriesPlotStyle.SCATTER:return t?"scatter":"scattergl";case r.plot.SeriesPlotStyle.LINE:return"scatter";case r.plot.SeriesPlotStyle.BAR:case r.plot.SeriesPlotStyle.STACKED_BAR:return"bar";case r.plot.SeriesPlotStyle.PIE:return"pie";case r.plot.SeriesPlotStyle.TREEMAP:return"treemap";case r.plot.SeriesPlotStyle.HISTOGRAM:return"histogram";case r.plot.SeriesPlotStyle.OHLC:return"ohlc";default:return}}getPlotlyChartMode(e,t,r){var{dh:i}=this,a=new Set;switch(e){case i.plot.SeriesPlotStyle.SCATTER:(t??!1)&&a.add(ce.MODE_LINES),(r??!0)&&a.add(ce.MODE_MARKERS);break;case i.plot.SeriesPlotStyle.LINE:(t??!0)&&a.add(ce.MODE_LINES),(r??!1)&&a.add(ce.MODE_MARKERS);break}return a.size>0?[...a].join("+"):void 0}getPlotlyProperty(e,t){var{dh:r}=this;switch(e){case r.plot.SeriesPlotStyle.PIE:switch(t){case r.plot.SourceType.X:return"labels";case r.plot.SourceType.Y:return"values"}break;case r.plot.SeriesPlotStyle.OHLC:switch(t){case r.plot.SourceType.TIME:return"x"}break;case r.plot.SeriesPlotStyle.TREEMAP:switch(t){case r.plot.SourceType.X:return"ids";case r.plot.SourceType.Y:return"values";case r.plot.SourceType.LABEL:return"labels";case r.plot.SourceType.PARENT:return"parents";case r.plot.SourceType.COLOR:return"marker.colors"}break}switch(t){case r.plot.SourceType.X:return"x";case r.plot.SourceType.Y:return"y";case r.plot.SourceType.Z:return"z";case r.plot.SourceType.X_LOW:return"xLow";case r.plot.SourceType.X_HIGH:return"xHigh";case r.plot.SourceType.Y_LOW:return"yLow";case r.plot.SourceType.Y_HIGH:return"yHigh";case r.plot.SourceType.TIME:return"time";case r.plot.SourceType.OPEN:return"open";case r.plot.SourceType.HIGH:return"high";case r.plot.SourceType.LOW:return"low";case r.plot.SourceType.CLOSE:return"close";case r.plot.SourceType.SHAPE:return"shape";case r.plot.SourceType.SIZE:return"size";case r.plot.SourceType.LABEL:return"label";case r.plot.SourceType.COLOR:return"color";case r.plot.SourceType.PARENT:return"parent";case r.plot.SourceType.HOVER_TEXT:return"hovertext";case r.plot.SourceType.TEXT:return"text";default:throw new Error("Unrecognized source type: ".concat(t))}}getPlotlySeriesOrientation(e){var t,r,{dh:i}=this,{sources:a}=e;return a.length===2&&((t=a[0])===null||t===void 0||(r=t.axis)===null||r===void 0?void 0:r.type)===i.plot.AxisType.Y?ce.ORIENTATION.HORIZONTAL:ce.ORIENTATION.VERTICAL}makeSeriesDataFromSeries(e,t,r,i){var a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:null,{name:o,isLinesVisible:s,isShapesVisible:l,plotStyle:d,lineColor:u,shapeColor:c,sources:m,shape:v,shapeSize:f}=e,g=m.some(y=>{var E;return(E=y.axis)===null||E===void 0?void 0:E.businessCalendar}),p=this.getChartType(d,g),b=this.getPlotlyChartMode(d,s??void 0,l??void 0),S=this.getPlotlySeriesOrientation(e),C=ce.makeSeriesData(p,b,o,a,S);return this.addSourcesToSeriesData(C,d,m,t),this.addStylingToSeriesData(C,d,i,u,c,v,f,r),C}addSourcesToSeriesData(e,t,r,i){for(var a=e,o=0;o<r.length;o+=1){var s=r[o],{axis:l,type:d}=s,u=this.getPlotlyProperty(t,d);gb(a,u,[]);var c=l!=null?this.getAxisPropertyName(l.type):null;if(c!=null){var m=i.get(l.type);if(m){var v=m.indexOf(l),f=v>0?"".concat(v+1):"";a["".concat(c,"axis")]="".concat(c).concat(f)}}}}addStylingToSeriesData(e,t,r){var i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null,a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:null,o=arguments.length>5&&arguments[5]!==void 0?arguments[5]:null,s=arguments.length>6&&arguments[6]!==void 0?arguments[6]:null,l=arguments.length>7&&arguments[7]!==void 0?arguments[7]:null,{dh:d}=this,u=e;if(u.marker={line:{}},u.line={width:1},t===d.plot.SeriesPlotStyle.AREA?u.fill="tozeroy":t===d.plot.SeriesPlotStyle.STACKED_AREA?u.stackgroup="stack":t===d.plot.SeriesPlotStyle.STEP?u.line.shape="hv":t===d.plot.SeriesPlotStyle.HISTOGRAM?(u.width=[],u.marker.line!==void 0&&Object.assign(u.marker.line,{color:r.paper_bgcolor,width:1})):t===d.plot.SeriesPlotStyle.OHLC?(u.increasing={line:{color:r.ohlc_increasing}},u.decreasing={line:{color:r.ohlc_decreasing}}):t===d.plot.SeriesPlotStyle.PIE?(u.textinfo="label+percent",u.outsidetextfont={color:r.title_color}):t===d.plot.SeriesPlotStyle.TREEMAP&&(u.hoverinfo="text",u.textinfo="label+text",u.tiling={packing:"squarify",pad:0},u.textposition="middle center",u.outsidetextfont={color:r.title_color}),i!=null&&(t===d.plot.SeriesPlotStyle.BAR?u.marker.color=i:u.line.color=i),a!=null&&(u.marker.color=a),o!=null&&o.length>0)try{u.marker.symbol=ce.getMarkerSymbol(o)}catch(c){Wo.warn("Unable to handle shape",o,":",c)}s!=null&&(u.marker.size=s*ce.DEFAULT_MARKER_SIZE),l!=null&&t!==d.plot.SeriesPlotStyle.PIE&&(u.visible=l)}getChartType(e,t){var{dh:r}=this;switch(e){case r.plot.SeriesPlotStyle.HISTOGRAM:return"bar";default:return this.getPlotlyChartType(e,t)}}getAxisPropertyName(e){var{dh:t}=this;switch(e){case t.plot.AxisType.X:return"x";case t.plot.AxisType.Y:return"y";default:return null}}getAxisSide(e){var{dh:t}=this;switch(e){case t.plot.AxisPosition.BOTTOM:return"bottom";case t.plot.AxisPosition.TOP:return"top";case t.plot.AxisPosition.LEFT:return"left";case t.plot.AxisPosition.RIGHT:return"right";default:return}}updateFigureAxes(e,t,r,i){for(var a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0,o=arguments.length>5&&arguments[5]!==void 0?arguments[5]:0,s=e,l=ce.getAllAxes(t),d=0;d<t.charts.length;d+=1){var u=t.charts[d],c=i==null?void 0:i(u),m=this.getChartBounds(t,u,a,o);this.updateLayoutAxes(s,u.axes,l,r,a,o,m,c)}this.removeStaleAxes(s,l)}getChartBounds(e,t,r,i){var a,{dh:o}=this,{cols:s,rows:l}=e,{column:d,colspan:u,row:c,rowspan:m}=t,v=d+u,f=c+m,g=1/s,p=1/l,b=ce.AXIS_SIZE_PX/r,S=ce.AXIS_SIZE_PX/i,C={bottom:(l-f)*p+(f<l?S/2:0),top:(l-c)*p-(c>0?S/2:0),left:d*g+(d>0?b/2:0),right:v*g-(v<s?b/2:0)},y=ce.groupArray(t.axes,"position"),E=(a=y.get(o.plot.AxisPosition.RIGHT))!==null&&a!==void 0?a:[];return E.length>0&&(r>0?C.right-=(C.right-C.left)*Math.max(0,Math.min(ce.LEGEND_WIDTH_PX/r,ce.MAX_LEGEND_SIZE)):C.right-=(C.right-C.left)*ce.DEFAULT_AXIS_SIZE),C}getPlotlyDateFormat(e,t,r){var{dh:i}=this,a=r==null?void 0:r.replace("%","%%").replace(/S{9}/g,"%9f").replace(/S{8}/g,"%8f").replace(/S{7}/g,"%7f").replace(/S{6}/g,"%6f").replace(/S{5}/g,"%5f").replace(/S{4}/g,"%4f").replace(/S{3}/g,"%3f").replace(/S{2}/g,"%2f").replace(/S{1}/g,"%1f").replace(/y{4}/g,"%Y").replace(/y{2}/g,"%y").replace(/M{4}/g,"%B").replace(/M{3}/g,"%b").replace(/M{2}/g,"%m").replace(/M{1}/g,"%-m").replace(/E{4,}/g,"%A").replace(/E{1,}/g,"%a").replace(/d{2}/g,"%d").replace(/([^%]|^)d{1}/g,"$1%-d").replace(/H{2}/g,"%H").replace(/h{2}/g,"%I").replace(/h{1}/g,"%-I").replace(/m{2}/g,"%M").replace(/s{2}/g,"%S").replace("'T'","T").replace(" z",""),o,s=e==null?void 0:e.getColumnTypeFormatter(t);return s!=null&&hv(s)&&s.dhTimeZone!=null&&s.showTimeZone&&(o=i.i18n.DateTimeFormat.format(" z",new Date,s.dhTimeZone)),{tickformat:a,ticksuffix:o,automargin:!0}}getPlotlyAxisFormat(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null,{dh:r}=this,{axis:i,columnType:a}=e,{formatPattern:o}=i,s=null;return F.isDateType(a)?(s=this.getPlotlyDateFormat(t,a,o),s=ce.addTickSpacing(s,i,!0)):F.isNumberType(a)&&(s=ce.getPlotlyNumberFormat(t,a,o),s=ce.addTickSpacing(s,i,!1)),i.formatType===r.plot.AxisFormatType.CATEGORY&&(s?s.type="category":s={type:"category",tickformat:void 0,ticksuffix:void 0}),s}updateLayoutAxes(e,t,r,i){for(var a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0,o=arguments.length>5&&arguments[5]!==void 0?arguments[5]:0,s=arguments.length>6&&arguments[6]!==void 0?arguments[6]:{left:0,top:0,right:1,bottom:1},l=arguments.length>7?arguments[7]:void 0,{dh:d}=this,u=a>0?Math.max(ce.MIN_AXIS_SIZE,Math.min(ce.AXIS_SIZE_PX/o,ce.MAX_AXIS_SIZE)):ce.DEFAULT_AXIS_SIZE,c=o>0?Math.max(ce.MIN_AXIS_SIZE,Math.min(ce.AXIS_SIZE_PX/a,ce.MAX_AXIS_SIZE)):ce.DEFAULT_AXIS_SIZE,m=e,v=ce.groupArray(t,"position"),f=ce.groupArray(t,"type"),g=[...f.keys()],p=ce.groupArray(r,"type"),b=0;b<g.length;b+=1){var S=g[b],C=this.getAxisPropertyName(S);if(C!=null){var y=f.get(S),E=p.get(S),T=S===d.plot.AxisType.Y,O=T?o:a;j(y),j(E);for(var N=0;N<y.length;N+=1){var P=y[N],R=E.indexOf(P),A=ce.getAxisLayoutProperty(C,R);m[A]==null&&(m[A]=this.makeLayoutAxis(S,i));var M=m[A];if(M!=null){this.updateLayoutAxis(M,P,N,v,u,c,s);var{range:I,autorange:x}=M;if(l!=null&&I!==void 0&&(x===void 0||x===!1)){var _=l(P),[k,U]=_(I);Wo.debug("Setting downsample range",O,k,U),P.range(O,k,U)}else P.range(O)}}}}}removeStaleAxes(e,t){for(var r=e,i=ce.groupArray(t,"type"),a=[...i.keys()],o=0;o<a.length;o+=1){var s=a[o],l=i.get(s);j(l);var d=l.length,u=this.getAxisPropertyName(s);if(u!=null)for(var c=ce.getAxisLayoutProperty(u,d);r[c]!=null;)delete r[c],d+=1,c=ce.getAxisLayoutProperty(u,d)}}updateLayoutAxis(e,t,r,i,a,o,s){var l,{dh:d}=this,u=t.type===d.plot.AxisType.Y,c=u?o:a,m=e,v=(l=t.label)!==null&&l!==void 0?l:"";if(m.title!==void 0&&typeof m.title!="string"?m.title.text=v:m.title={text:v},t.log&&(m.type="log"),m.side=this.getAxisSide(t.position),r>0){var f,g;m.overlaying=(f=this.getAxisPropertyName(t.type))!==null&&f!==void 0?f:void 0;var p=(g=i.get(t.position))!==null&&g!==void 0?g:[],b=p.indexOf(t);b>0&&(m.anchor="free",t.position===d.plot.AxisPosition.RIGHT?m.position=s.right+(b-p.length+1)*c:t.position===d.plot.AxisPosition.TOP?m.position=s.top+(b-p.length+1)*c:t.position===d.plot.AxisPosition.BOTTOM?m.position=s.bottom+(p.length-b+1)*c:t.position===d.plot.AxisPosition.LEFT&&(m.position=s.left+(p.length-b+1)*c))}else if(t.type===d.plot.AxisType.X){var S=i.get(d.plot.AxisPosition.LEFT)||[],C=i.get(d.plot.AxisPosition.RIGHT)||[],y=Math.max(s.left,s.left+(S.length-1)*o),E=Math.min(s.right-(C.length-1)*o,s.right);m.domain=[y,E]}else if(t.type===d.plot.AxisType.Y){var T=i.get(d.plot.AxisPosition.BOTTOM)||[],O=i.get(d.plot.AxisPosition.TOP)||[],N=Math.max(s.bottom,s.bottom+(T.length-1)*a),P=Math.min(s.top-(O.length-1)*a,s.top);m.domain=[N,P]}}createBoundsFromDays(e){var t=e.map(o=>this.daysOfWeek.indexOf(o)),r=this.daysOfWeek.filter(o=>!e.includes(o)).map(o=>this.daysOfWeek.indexOf(o)),i=new Set;r.forEach(o=>{for(var s=o+1;s<o+this.daysOfWeek.length;s+=1){var l=s%this.daysOfWeek.length;if(t.includes(l)){i.add(l);break}}});var a=[];return i.forEach(o=>{for(var s=o-1;s>o-this.daysOfWeek.length;s-=1){var l=s<0?s+this.daysOfWeek.length:s;if(t.includes(l)){var d=(l+1)%7;a.push([d,o]);break}}}),a}createRangeBreakValuesFromHolidays(e,t,r){var i=[],a=[];return e.forEach(o=>{o.businessPeriods.length>0?a.push(...this.createPartialHoliday(o,t,r)):i.push(this.createFullHoliday(o,t,r))}),[{values:i},...a]}createFullHoliday(e,t,r){return this.adjustDateForTimeZone("".concat(e.date.toString()," 00:00:00.000000"),t,r)}createPartialHoliday(e,t,r){var i=e.date.toString(),a=["00:00"];e.businessPeriods.forEach(m=>{a.push(m.open),a.push(m.close)}),a.push("24:00");for(var o=[],s=0;s<a.length;s+=2){var l=a[s],d=a[s+1];if(l!==d){var u=[this.adjustDateForTimeZone("".concat(i," ").concat(l,":00.000000"),t,r)],c=vO*(ce.periodToDecimal(d)-ce.periodToDecimal(l));o.push({values:u,dvalue:c})}}return o}adjustDateForTimeZone(e,t,r){return r&&r.standardOffset!==t.standardOffset?this.unwrapValue(this.wrapValue(e,uv,t),r):e}makeFigureSettings(e,t){var{dh:r}=this,{series:i,xAxis:a,type:o}=e,s=ce.titleFromSettings(e),l={formatType:"".concat(r.plot.AxisFormatType.NUMBER),type:"".concat(r.plot.AxisType.X),position:"".concat(r.plot.AxisPosition.BOTTOM)},d={formatType:"".concat(r.plot.AxisFormatType.NUMBER),type:"".concat(r.plot.AxisType.Y),position:"".concat(r.plot.AxisPosition.LEFT)};return{charts:[{chartType:"".concat(r.plot.ChartType.XY),axes:[l,d],series:(i??[]).map(u=>({plotStyle:"".concat(o),name:u,dataSources:[{type:"".concat(r.plot.SourceType.X),columnName:a??"",axis:l,table:t},{type:"".concat(r.plot.SourceType.Y),columnName:u,axis:d,table:t}]}))}],title:s}}unwrapValue(e,t){var{dh:r}=this;if(e!=null){if(gO(e))return r.i18n.DateTimeFormat.format(ce.DATE_FORMAT,e,t);if(pO(e))return e.asNumber()}return e}wrapValue(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,{dh:i}=this;if(F.isDateType(t)&&typeof e=="string"){var a=e,o=ce.DATE_FORMAT.substr(0,e.length),s=i.i18n.DateTimeFormat.parse(o,a);if(!r)return s;var l="".concat(o," Z"),d=i.i18n.DateTimeFormat.format("Z",s,r),u=i.i18n.DateTimeFormat.parse(l,"".concat(a," ").concat(d)),c=i.i18n.DateTimeFormat.format("Z",u,r);return i.i18n.DateTimeFormat.parse(l,"".concat(a," ").concat(c))}return e}makeLayoutAxis(e,t){var{dh:r}=this,i={automargin:!0,gridcolor:t.gridcolor,linecolor:t.linecolor,rangeslider:{visible:!1},showline:!0,ticklen:5,tickcolor:t.paper_bgcolor,tickfont:{color:t.zerolinecolor},title:{font:{color:t.title_color}},legend:{font:{color:t.legend_color}}};return e===r.plot.AxisType.X?Object.assign(i,{showgrid:!0}):e===r.plot.AxisType.Y&&Object.assign(i,{zerolinecolor:t.zerolinecolor,zerolinewidth:2}),i}makeDefaultLayout(e){var{dh:t}=this,{paper_bgcolor:r,plot_bgcolor:i,title_color:a,coastline_color:o,land_color:s,ocean_color:l,lake_color:d,river_color:u}=e,c={paper_bgcolor:r,plot_bgcolor:i,autosize:!0,colorway:ce.getColorwayFromTheme(e),font:{family:"'Fira Sans', sans-serif",color:a},title:{font:{color:a},yanchor:"top",pad:dl({},ce.DEFAULT_TITLE_PADDING),y:1},legend:{font:{color:a}},margin:dl({},ce.DEFAULT_MARGIN),xaxis:this.makeLayoutAxis(t.plot.AxisType.X,e),yaxis:this.makeLayoutAxis(t.plot.AxisType.Y,e),polar:{angularaxis:this.makeLayoutAxis(t.plot.AxisType.SHAPE,e),radialaxis:this.makeLayoutAxis(t.plot.AxisType.SHAPE,e),bgcolor:e.plot_bgcolor},scene:{xaxis:this.makeLayoutAxis(t.plot.AxisType.X,e),yaxis:this.makeLayoutAxis(t.plot.AxisType.Y,e),zaxis:this.makeLayoutAxis(t.plot.AxisType.Z,e)},geo:{showcoastlines:!0,showframe:!1,showland:!0,showocean:!0,showlakes:!0,showrivers:!0,bgcolor:r,coastlinecolor:o,landcolor:s,oceancolor:l,lakecolor:d,rivercolor:u}};return c.datarevision=0,c}hydrateSettings(e){var{dh:t}=this;return dl(dl({},e),{},{type:e.type!=null?t.plot.SeriesPlotStyle[e.type]:void 0})}}Wt(ce,"DEFAULT_AXIS_SIZE",.15);Wt(ce,"MIN_AXIS_SIZE",.025);Wt(ce,"MAX_AXIS_SIZE",.2);Wt(ce,"AXIS_SIZE_PX",75);Wt(ce,"LEGEND_WIDTH_PX",50);Wt(ce,"MAX_LEGEND_SIZE",.25);Wt(ce,"ORIENTATION",Object.freeze({HORIZONTAL:"h",VERTICAL:"v"}));Wt(ce,"DATE_FORMAT","yyyy-MM-dd HH:mm:ss.SSSSSS");Wt(ce,"DEFAULT_MARGIN",Object.freeze({l:60,r:50,t:30,b:60,pad:0}));Wt(ce,"DEFAULT_TITLE_PADDING",Object.freeze({t:8}));Wt(ce,"SUBTITLE_LINE_HEIGHT",25);Wt(ce,"DEFAULT_MARKER_SIZE",6);Wt(ce,"MODE_MARKERS","markers");Wt(ce,"MODE_LINES","lines");const Yt=ce;function CO(n,e,t){return e=SO(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function SO(n){var e=wO(n,"string");return typeof e=="symbol"?e:String(e)}function wO(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class yO extends Error{constructor(){super(...arguments),CO(this,"isDownsamplingError",!0)}}function cv(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function mv(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?cv(Object(t),!0).forEach(function(r){Kt(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):cv(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function Kt(n,e,t){return e=EO(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function EO(n){var e=TO(n,"string");return typeof e=="symbol"?e:String(e)}function TO(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var Di=ie.module("Chart");class Ki extends w.Component{static convertIcon(e){var[t,,,,r]=e.icon,i="".concat(r);return{width:t,path:i,ascent:t,descent:0,transform:"matrix(1, 0, 0, 1, 0, 0)"}}static downsampleButtonTitle(e,t){return e?"Downsampling in progress...":t?"Downsampling disabled, click to enable":"Downsampling enabled, click to disable"}static downsampleButtonAttr(e,t){return e?"animation-spin":t?void 0:"fill-active"}constructor(e){var t;super(e),Kt(this,"currentSeries",void 0),Kt(this,"PlotComponent",void 0),Kt(this,"plot",void 0),Kt(this,"plotWrapper",void 0),Kt(this,"columnFormats",void 0),Kt(this,"dateTimeFormatterOptions",void 0),Kt(this,"decimalFormatOptions",void 0),Kt(this,"integerFormatOptions",void 0),Kt(this,"rect",void 0),Kt(this,"ranges",void 0),Kt(this,"isSubscribed",void 0),Kt(this,"isLoadedFired",void 0),Kt(this,"resizeObserver",void 0),Kt(this,"getCachedConfig",be((r,i,a,o,s,l)=>{var d=[],u=!!r;u&&d.push({name:"Downsampling failed: ".concat(r),title:"Downsampling failed",click:()=>{this.toggleErrorMessage("".concat(r))},icon:Ki.convertIcon(hh),attr:"fill-warning"});var c=!!l;if(c&&d.push({name:"Error: ".concat(l),title:"Error",click:()=>{this.toggleErrorMessage("".concat(l))},icon:Ki.convertIcon(hh),attr:"fill-warning"}),i||a||o||u){var m=Ki.downsampleButtonTitle(a,o),v=Ki.downsampleButtonAttr(a,o),f=a?Ky:qy;d.push({name:m,title:"Downsampling status",icon:Ki.convertIcon(f),click:this.handleDownsampleClick,attr:v})}var g=s.some(C=>{var{type:y}=C;return y!=null&&!y.includes("3d")}),p=s.some(C=>{var{type:y}=C;return y!=null&&y.includes("3d")}),b=["zoomIn2d","zoomOut2d","autoScale2d","resetScale2d"],S=["orbitRotation","tableRotation","resetCameraDefault3d"];return{displaylogo:!1,displayModeBar:a||u||c?!0:"hover",modeBarButtons:[d,["toImage"],["zoom2d","pan2d"],[...g?b:[],...p?S:[]]]}})),this.handleAfterPlot=this.handleAfterPlot.bind(this),this.handleDownsampleClick=this.handleDownsampleClick.bind(this),this.handleErrorClose=this.handleErrorClose.bind(this),this.handleModelEvent=this.handleModelEvent.bind(this),this.handlePlotUpdate=this.handlePlotUpdate.bind(this),this.handleRelayout=this.handleRelayout.bind(this),this.handleResize=this.handleResize.bind(this),this.handleRestyle=this.handleRestyle.bind(this),this.PlotComponent=oC(e.Plotly),this.plot=oe.createRef(),this.plotWrapper=(t=e.containerRef)!==null&&t!==void 0?t:oe.createRef(),this.columnFormats=[],this.dateTimeFormatterOptions={},this.decimalFormatOptions={},this.integerFormatOptions={},this.isSubscribed=!1,this.isLoadedFired=!1,this.currentSeries=0,this.resizeObserver=new window.ResizeObserver(this.handleResize),this.state={data:null,downsamplingError:null,isDownsampleFinished:!1,isDownsampleInProgress:!1,isDownsamplingDisabled:!1,error:null,shownError:null,layout:{datarevision:0},revision:0}}componentDidMount(){this.updateDimensions(),this.updateModelDimensions(),this.initData(),this.initFormatter();var{isActive:e,model:t}=this.props;e&&this.subscribe(t),this.plotWrapper.current!=null&&this.resizeObserver.observe(this.plotWrapper.current)}componentDidUpdate(e){var{isActive:t,model:r,settings:i}=this.props;this.updateFormatterSettings(i),r!==e.model&&(this.unsubscribe(e.model),this.subscribe(r)),t!==e.isActive&&(t?(this.updateDimensions(),this.subscribe(r)):this.unsubscribe(r))}componentWillUnmount(){var{model:e}=this.props;this.unsubscribe(e),this.resizeObserver.disconnect()}getPlotRect(){var e,t;return(e=(t=this.plotWrapper.current)===null||t===void 0?void 0:t.getBoundingClientRect())!==null&&e!==void 0?e:null}initData(){var{model:e}=this.props,{layout:t}=this.state;this.setState({data:e.getData(),layout:mv(mv({},t),e.getLayout())})}subscribe(e){if(!this.isSubscribed){if(!this.rect||this.rect.width===0||this.rect.height===0){Di.debug2("Delaying subscription until model dimensions are set");return}e.subscribe(this.handleModelEvent),this.isSubscribed=!0}}unsubscribe(e){this.isSubscribed&&(e.unsubscribe(this.handleModelEvent),this.isSubscribed=!1)}handleAfterPlot(){this.plot.current!=null}handleDownsampleClick(){this.setState(e=>{var{isDownsamplingDisabled:t}=e;return{downsamplingError:null,isDownsampleInProgress:!1,isDownsampleFinished:!1,isDownsamplingDisabled:!t}},()=>{var{model:e}=this.props,{isDownsamplingDisabled:t}=this.state;e.setDownsamplingDisabled(t)})}handleErrorClose(){this.setState({shownError:null})}handleModelEvent(e){var{type:t,detail:r}=e;switch(Di.debug2("Received data update",t,r),t){case Mn.EVENT_UPDATED:{this.currentSeries+=1,this.setState(v=>{var{layout:f,revision:g}=v;return typeof f.datarevision=="number"&&(f.datarevision+=1),{data:r,layout:f,revision:g+1}});var{onUpdate:i}=this.props;i({isLoading:!this.isLoadedFired});break}case Mn.EVENT_LOADFINISHED:{var{onUpdate:a}=this.props;this.isLoadedFired=!0,a({isLoading:!1});break}case Mn.EVENT_DISCONNECT:{var{onDisconnect:o}=this.props;o();break}case Mn.EVENT_RECONNECT:{var{onReconnect:s}=this.props;s();break}case Mn.EVENT_DOWNSAMPLESTARTED:{this.setState({isDownsampleFinished:!1,isDownsampleInProgress:!0,downsamplingError:null});break}case Mn.EVENT_DOWNSAMPLEFINISHED:{this.setState({isDownsampleFinished:!0,isDownsampleInProgress:!1,downsamplingError:null});break}case Mn.EVENT_DOWNSAMPLENEEDED:case Mn.EVENT_DOWNSAMPLEFAILED:{var l,d=(l=r.message)!==null&&l!==void 0?l:r;this.setState({isDownsampleFinished:!1,isDownsampleInProgress:!1,isDownsamplingDisabled:!1,downsamplingError:d});var{onError:u}=this.props;u(new yO(d));break}case Mn.EVENT_ERROR:{var c="".concat(r);this.setState({error:c});var{onError:m}=this.props;m(new Error(c));break}default:Di.debug("Unknown event type",t,e)}}handlePlotUpdate(e){var{layout:t}=e,r=Yt.getLayoutRanges(t),i=!mt(r,this.ranges);i&&(this.ranges=r,this.updateModelDimensions(!0))}handleRelayout(e){if(Di.debug("handleRelayout",e),e.hiddenlabels!=null){var{onSettingsChanged:t}=this.props,r=[...e.hiddenlabels];t({hiddenSeries:r})}this.updateModelDimensions()}handleResize(){this.updateDimensions()}handleRestyle(e){var[t,r]=e;if(Di.debug("handleRestyle",t,r),Object.keys(t).includes("visible")){var{data:i}=this.state,{onSettingsChanged:a}=this.props;if(i!=null){var o=i.reduce((s,l)=>{var{name:d,visible:u}=l;return d!=null&&u==="legendonly"?[...s,d]:s},[]);a({hiddenSeries:o})}}}toggleErrorMessage(e){this.setState(t=>{var{shownError:r}=t;return{shownError:r===e?null:e}})}updateModelDimensions(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,t=this.getPlotRect();if(!t){Di.warn("Unable to get plotting rect");return}var r=!this.rect||this.rect.width!==t.width||this.rect.height!==t.height;if(r||e){this.rect=t;var{isActive:i,model:a}=this.props;a.setDimensions(t),i&&this.subscribe(a)}}initFormatter(){var{settings:e}=this.props;this.updateFormatterSettings(e)}updateFormatterSettings(e){var t=gi.getColumnFormats(e),r=gi.getDateTimeFormatterOptions(e),{decimalFormatOptions:i={},integerFormatOptions:a={}}=e;(!mt(this.columnFormats,t)||!mt(this.dateTimeFormatterOptions,r)||!mt(this.decimalFormatOptions,i)||!mt(this.integerFormatOptions,a))&&(this.columnFormats=gi.getColumnFormats(e),this.dateTimeFormatterOptions=r,this.decimalFormatOptions=i,this.integerFormatOptions=a,this.updateFormatter())}updateFormatter(){var{model:e}=this.props,t=new ur(e.dh,this.columnFormats,this.dateTimeFormatterOptions,this.decimalFormatOptions,this.integerFormatOptions);e.setFormatter(t)}updateDimensions(){var e=this.getPlotRect(),{Plotly:t}=this.props;this.plot.current!=null&&e!=null&&e.width>0&&e.height>0&&t.relayout(this.plot.current.el,{autosize:!0}).catch(r=>{Di.debug("Unable to resize, promise rejected",r)})}render(){var{PlotComponent:e}=this,{data:t,downsamplingError:r,isDownsampleFinished:i,isDownsampleInProgress:a,isDownsamplingDisabled:o,error:s,shownError:l,layout:d,revision:u}=this.state,c=this.getCachedConfig(r,i,a,o,t??[],s),m=t!=null;return h.jsxs("div",{className:"h-100 w-100 chart-wrapper",ref:this.plotWrapper,children:[m&&h.jsx(e,{ref:this.plot,data:t,layout:d,revision:u,config:c,onAfterPlot:this.handleAfterPlot,onError:Di.error,onRelayout:this.handleRelayout,onUpdate:this.handlePlotUpdate,onRestyle:this.handleRestyle,useResizeHandler:!0,style:{height:"100%",width:"100%"}}),h.jsx(La,{className:"chart-error-popper",options:{placement:"top"},isShown:l!=null,onExited:this.handleErrorClose,closeOnBlur:!0,interactive:!0,children:l!=null&&h.jsxs(h.Fragment,{children:[h.jsx("div",{className:"chart-error",children:l}),h.jsx(Md,{tooltip:"Copy Error",copy:l,children:"Copy Error"})]})})]})}}Kt(Ki,"defaultProps",{isActive:!0,settings:{timeZone:"America/New_York",defaultDateTimeFormat:Ze.FULL_DATE_FORMAT,showTimeZone:!1,showTSeparator:!0,formatter:[]},Plotly:ec,onDisconnect:()=>{},onReconnect:()=>{},onUpdate:()=>{},onError:()=>{},onSettingsChanged:()=>{}});const sC=Ki;function vv(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function fv(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?vv(Object(t),!0).forEach(function(r){ht(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):vv(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function ht(n,e,t){return e=PO(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function PO(n){var e=OO(n,"string");return typeof e=="symbol"?e:String(e)}function OO(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var At=ie.module("FigureChartModel");class kd extends Mn{constructor(e,t,r){var i,a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};super(e),i=this,ht(this,"chartUtils",void 0),ht(this,"dh",void 0),ht(this,"figure",void 0),ht(this,"settings",void 0),ht(this,"theme",void 0),ht(this,"data",void 0),ht(this,"layout",void 0),ht(this,"seriesDataMap",void 0),ht(this,"pendingSeries",void 0),ht(this,"oneClicks",void 0),ht(this,"filterColumnMap",void 0),ht(this,"lastFilter",void 0),ht(this,"isConnected",void 0),ht(this,"seriesToProcess",void 0),ht(this,"addPendingSeries",wt(()=>{for(var s=Yt.getAxisTypeMap(this.figure),{pendingSeries:l}=this,d=function(){var m,v=l[u],f=i.figure.charts.find(g=>g.series.includes(v));i.addSeries(v,s,(m=f==null?void 0:f.showLegend)!==null&&m!==void 0?m:null),v.subscribe()},u=0;u<l.length;u+=1)d();this.pendingSeries=[]},kd.ADD_SERIES_DEBOUNCE)),ht(this,"getTimeZone",Se((s,l)=>{if(l!=null){var d=l.getColumnTypeFormatter(s);if(d!=null)return d.dhTimeZone}})),ht(this,"getValueTranslator",Se((s,l)=>{var d=this.getTimeZone(s,l);return u=>this.chartUtils.unwrapValue(u,d)})),ht(this,"getValueParser",Se((s,l)=>{var d=this.getTimeZone(s,l);return u=>this.chartUtils.wrapValue(u,s,d)})),ht(this,"getRangeParser",Se((s,l)=>d=>{var[u,c]=d,m=this.getValueParser(s,l);return u=m(u),c=m(c),[u,c]})),ht(this,"getAxisRangeParser",Se((s,l)=>d=>{var u=Yt.getSourceForAxis(s,d);return u!=null?this.getRangeParser(u.columnType,l):c=>c})),this.handleFigureUpdated=this.handleFigureUpdated.bind(this),this.handleFigureDisconnected=this.handleFigureDisconnected.bind(this),this.handleFigureReconnected=this.handleFigureReconnected.bind(this),this.handleFigureSeriesAdded=this.handleFigureSeriesAdded.bind(this),this.handleDownsampleStart=this.handleDownsampleStart.bind(this),this.handleDownsampleFinish=this.handleDownsampleFinish.bind(this),this.handleDownsampleFail=this.handleDownsampleFail.bind(this),this.handleDownsampleNeeded=this.handleDownsampleNeeded.bind(this),this.handleRequestFailed=this.handleRequestFailed.bind(this),this.dh=e,this.chartUtils=new Yt(e),this.figure=t,this.settings=a,this.theme=r,this.data=[];var o={data:{},layout:this.chartUtils.makeDefaultLayout(r)};this.layout={grid:{rows:t.rows,columns:t.cols,pattern:"independent"},template:o},this.seriesDataMap=new Map,this.pendingSeries=[],this.oneClicks=[],this.filterColumnMap=new Map,this.lastFilter=new Map,this.isConnected=!0,this.seriesToProcess=new Set,this.setTitle(this.getDefaultTitle()),this.initAllSeries(),this.updateAxisPositions(),this.startListeningFigure()}close(){this.figure.close(),this.addPendingSeries.cancel(),this.stopListeningFigure()}getDefaultTitle(){if(this.figure.title!=null&&this.figure.title.length>0)return this.figure.title;if(this.figure.charts.length===1){var e;return(e=this.figure.charts[0].title)!==null&&e!==void 0?e:""}return""}initAllSeries(){var e=this;this.oneClicks=[],this.filterColumnMap.clear();var{charts:t}=this.figure,r=Yt.getAxisTypeMap(this.figure),i=[];this.seriesToProcess=new Set;for(var a=function(){for(var m=t[o],v=0;v<m.series.length;v+=1){var f=m.series[v];i.push(f.name),e.addSeries(f,r,m.showLegend)}var{axes:g,title:p}=m;if(p!=null&&p.length>0&&(t.length>1||e.figure.title!=null)){var b=g.find(R=>R.type===e.dh.plot.AxisType.X),S=g.find(R=>R.type===e.dh.plot.AxisType.Y);if(b==null||S==null)At.warn("Chart title provided, but unknown how to map to the correct axes for this chart type",m);else{var C,y,E,T,O=((C=(y=r.get(b.type))===null||y===void 0?void 0:y.findIndex(R=>R===b))!==null&&C!==void 0?C:0)+1,N=((E=(T=r.get(S.type))===null||T===void 0?void 0:T.findIndex(R=>R===S))!==null&&E!==void 0?E:0)+1,P={align:"center",x:.5,y:1,yshift:17,text:p,showarrow:!1,xref:"x".concat(O," domain"),yref:"y".concat(N," domain")};e.layout.annotations==null?e.layout.annotations=[P]:e.layout.annotations.push(P)}}},o=0;o<t.length;o+=1)a();for(var s=[...this.seriesDataMap.keys()],l=s.filter(c=>i.indexOf(c)<0),d=0;d<l.length;d+=1){var u=l[d];this.seriesDataMap.delete(u)}}addSeries(e,t,r){var{dh:i}=this,a=this.chartUtils.makeSeriesDataFromSeries(e,t,Yt.getSeriesVisibility(e.name,this.settings),this.theme,r);if(this.seriesDataMap.set(e.name,a),this.seriesToProcess.add(e.name),this.data=[...this.seriesDataMap.values()],e.plotStyle===i.plot.SeriesPlotStyle.STACKED_BAR?this.layout.barmode="stack":e.plotStyle===i.plot.SeriesPlotStyle.PIE&&(this.layout.hiddenlabels=Yt.getHiddenLabels(this.settings)),this.layout.showlegend=this.data.length>1||e.plotStyle===i.plot.SeriesPlotStyle.PIE?r??void 0:!1,e.oneClick!=null){for(var{oneClick:o}=e,{columns:s}=o,l=0;l<s.length;l+=1)this.filterColumnMap.set(s[l].name,s[l]);this.oneClicks.push(o)}this.updateLayoutFormats()}subscribe(e){super.subscribe(e),this.listeners.length===1&&(this.initAllSeries(),this.subscribeFigure())}unsubscribe(e){super.unsubscribe(e),this.listeners.length===0&&this.unsubscribeFigure()}subscribeFigure(){if(!this.isConnected){At.debug("Ignoring subscribe when figure in disconnected state");return}this.figure.subscribe(this.isDownsamplingDisabled?this.dh.plot.DownsampleOptions.DISABLE:this.dh.plot.DownsampleOptions.DEFAULT),this.figure.errors.length>0&&(At.error("Errors in figure",this.figure.errors),this.fireError(this.figure.errors))}unsubscribeFigure(){this.figure.unsubscribe()}startListeningFigure(){var{dh:e}=this;this.figure.addEventListener(e.plot.Figure.EVENT_UPDATED,this.handleFigureUpdated),this.figure.addEventListener(e.plot.Figure.EVENT_SERIES_ADDED,this.handleFigureSeriesAdded),this.figure.addEventListener(e.plot.Figure.EVENT_DISCONNECT,this.handleFigureDisconnected),this.figure.addEventListener(e.plot.Figure.EVENT_RECONNECT,this.handleFigureReconnected),this.figure.addEventListener(e.plot.Figure.EVENT_DOWNSAMPLESTARTED,this.handleDownsampleStart),this.figure.addEventListener(e.plot.Figure.EVENT_DOWNSAMPLEFINISHED,this.handleDownsampleFinish),this.figure.addEventListener(e.plot.Figure.EVENT_DOWNSAMPLEFAILED,this.handleDownsampleFail),this.figure.addEventListener(e.plot.Figure.EVENT_DOWNSAMPLENEEDED,this.handleDownsampleNeeded),this.figure.addEventListener(e.Client.EVENT_REQUEST_FAILED,this.handleRequestFailed)}stopListeningFigure(){var{dh:e}=this;this.figure.removeEventListener(e.plot.Figure.EVENT_UPDATED,this.handleFigureUpdated),this.figure.removeEventListener(e.plot.Figure.EVENT_SERIES_ADDED,this.handleFigureSeriesAdded),this.figure.removeEventListener(e.plot.Figure.EVENT_DISCONNECT,this.handleFigureDisconnected),this.figure.removeEventListener(e.plot.Figure.EVENT_RECONNECT,this.handleFigureReconnected),this.figure.removeEventListener(e.plot.Figure.EVENT_DOWNSAMPLESTARTED,this.handleDownsampleStart),this.figure.removeEventListener(e.plot.Figure.EVENT_DOWNSAMPLEFINISHED,this.handleDownsampleFinish),this.figure.removeEventListener(e.plot.Figure.EVENT_DOWNSAMPLEFAILED,this.handleDownsampleFail),this.figure.removeEventListener(e.plot.Figure.EVENT_DOWNSAMPLENEEDED,this.handleDownsampleNeeded),this.figure.removeEventListener(e.Client.EVENT_REQUEST_FAILED,this.handleRequestFailed)}handleDownsampleStart(e){At.debug("Downsample started",e),this.fireDownsampleStart(e.detail)}handleDownsampleFinish(e){At.debug("Downsample finished",e),this.fireDownsampleFinish(e.detail)}handleDownsampleFail(e){At.error("Downsample failed",e),this.fireDownsampleFail(e.detail)}handleDownsampleNeeded(e){At.info("Downsample needed",e),this.fireDownsampleNeeded(e.detail)}handleFigureUpdated(e){var{detail:t}=e,{series:r}=t;At.debug2("handleFigureUpdated",r);for(var i=0;i<r.length;i+=1){var a=r[i];At.debug2("handleFigureUpdated updating series",a.name);for(var{sources:o}=a,s=0;s<o.length;s+=1){var l=o[s],{columnType:d,type:u}=l,c=this.getValueTranslator(d,this.formatter),m=t.getArray(a,u,c);this.setDataArrayForSeries(a,u,m)}this.seriesToProcess.delete(a.name),this.cleanSeries(a)}this.seriesToProcess.size===0&&this.fireLoadFinished();var{data:v}=this;this.fireUpdate(v)}handleRequestFailed(e){At.error("Request failed",e),this.fireError(["".concat(e.detail)])}resubscribe(){this.listeners.length>0&&(this.unsubscribeFigure(),this.subscribeFigure())}setFormatter(e){super.setFormatter(e),this.updateLayoutFormats(),this.resubscribe()}setDownsamplingDisabled(e){super.setDownsamplingDisabled(e),this.resubscribe()}handleFigureDisconnected(e){At.debug("Figure disconnected",e),this.isConnected=!1,this.listeners.length>0&&this.unsubscribeFigure(),this.fireDisconnect()}handleFigureReconnected(e){At.debug("Figure reconnected",e),this.isConnected=!0,this.initAllSeries(),this.fireReconnect(),this.listeners.length>0&&this.subscribeFigure()}handleFigureSeriesAdded(e){var{detail:t}=e;At.debug("handleFigureSeriesAdded",t),this.pendingSeries.push(t),this.addPendingSeries()}setDimensions(e){super.setDimensions(e),this.updateAxisPositions()}setTitle(e){var t,r;super.setTitle(e);var i=(t=(r=(e??"").match(/<br>/g))===null||r===void 0?void 0:r.length)!==null&&t!==void 0?t:0,a=Yt.DEFAULT_MARGIN.t+i*Yt.SUBTITLE_LINE_HEIGHT;this.layout.margin?this.layout.margin.t=a:this.layout.margin={t:a},typeof this.layout.title=="string"?this.layout.title=e:(this.layout.title=fv({},this.layout.title),this.layout.title.text=e,this.layout.title.pad=fv({},this.layout.title.pad),this.layout.title.pad.t=Yt.DEFAULT_TITLE_PADDING.t+i*Yt.SUBTITLE_LINE_HEIGHT*.5)}getPlotWidth(){var e,t,r,i;return!this.rect||!this.rect.width?0:Math.max(this.rect.width-((e=(t=this.layout.margin)===null||t===void 0?void 0:t.l)!==null&&e!==void 0?e:0)-((r=(i=this.layout.margin)===null||i===void 0?void 0:i.r)!==null&&r!==void 0?r:0),0)}getPlotHeight(){var e,t,r,i;return!this.rect||!this.rect.height?0:Math.max(this.rect.height-((e=(t=this.layout.margin)===null||t===void 0?void 0:t.t)!==null&&e!==void 0?e:0)-((r=(i=this.layout.margin)===null||i===void 0?void 0:i.b)!==null&&r!==void 0?r:0),0)}updateAxisPositions(){var e=this.getPlotWidth(),t=this.getPlotHeight();this.chartUtils.updateFigureAxes(this.layout,this.figure,this.theme,r=>this.getAxisRangeParser(r,this.formatter),e,t)}updateLayoutFormats(){if(this.formatter){var e=this.chartUtils.getAxisFormats(this.figure,this.formatter);e.forEach((t,r)=>{At.debug("Assigning ".concat(r),this.layout[r],t);var i=this.layout[r];i!=null?Object.assign(i,t):At.debug("Ignoring null layout.".concat(r))})}}setDataArrayForSeries(e,t,r){var{name:i,plotStyle:a}=e,o=this.seriesDataMap.get(i),s=this.chartUtils.getPlotlyProperty(a,t);o&&gb(o,s,r)}cleanSeries(e){var{dh:t}=this,{name:r,plotStyle:i}=e,a=this.seriesDataMap.get(r);if(a!=null){if(i===t.plot.SeriesPlotStyle.HISTOGRAM){var{xLow:o,xHigh:s}=a;if(o&&s&&o.length===s.length){for(var l=[],d=0;d<o.length;d+=1)l.push(s[d]-o[d]);a.width=l}}else if(i===t.plot.SeriesPlotStyle.LINE||i===t.plot.SeriesPlotStyle.ERROR_BAR||i===t.plot.SeriesPlotStyle.BAR){var{x:u,xLow:c,xHigh:m,y:v,yLow:f,yHigh:g}=a;c&&m&&c!==u&&(a.error_x=Yt.getPlotlyErrorBars(u,c,m,this.theme)),f&&g&&f!==v&&(a.error_y=Yt.getPlotlyErrorBars(v,f,g,this.theme))}else if(i===t.plot.SeriesPlotStyle.TREEMAP){var{ids:p,labels:b}=a;p!==void 0&&b===void 0&&(a.labels=p)}}}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){At.warn("Trying to set a filter, but no one click!");return}At.debug("setFilter",e);for(var r=function(){var o=t.oneClicks[i],{columns:s}=o,l=new Set([...e.keys(),...t.lastFilter.keys()]);l.forEach(d=>{var u=e.get(d);t.lastFilter.get(d)!==u&&s.find(c=>c.name===d)!=null&&o.setValueForColumn(d,u)})},i=0;i<this.oneClicks.length;i+=1)r();this.lastFilter=new Map(e)}setFigure(e){this.close(),this.figure=e,this.setTitle(this.getDefaultTitle()),this.initAllSeries(),this.updateAxisPositions(),this.startListeningFigure(),this.listeners.length>0&&this.subscribeFigure()}updateSettings(e){this.settings=e}}ht(kd,"ADD_SERIES_DEBOUNCE",50);const gv=kd;function pv(n,e,t,r,i,a,o){try{var s=n[a](o),l=s.value}catch(d){t(d);return}s.done?e(l):Promise.resolve(l).then(r,i)}function ku(n){return function(){var e=this,t=arguments;return new Promise(function(r,i){var a=n.apply(e,t);function o(l){pv(a,r,i,o,s,"next",l)}function s(l){pv(a,r,i,o,s,"throw",l)}o(void 0)})}}class mc{static makeModelFromSettings(e,t,r,i){return ku(function*(){var a=yield mc.makeFigureFromSettings(e,t,r);return new gv(e,a,i,t)})()}static makeFigureFromSettings(e,t,r){return ku(function*(){var i=yield r.copy();return i.applyCustomColumns(r.customColumns),i.applyFilter(r.filter),i.applySort(r.sort),e.plot.Figure.create(new Yt(e).makeFigureSettings(t,i))})()}static makeModel(e,t,r,i){return ku(function*(){return new gv(e,r,i,t)})()}}const Cs=mc,DO="var(--dh-color-chart-colorway)",NO="var(--dh-color-chart-grid)",RO="var(--dh-color-chart-axis-line)",IO="var(--dh-color-chart-axis-line-zero)",bv={"paper-bgcolor":"var(--dh-color-chart-bg)","plot-bgcolor":"var(--dh-color-chart-plot-bg)","title-color":"var(--dh-color-chart-title)","legend-color":"var(--dh-color-chart-legend-fg)",colorway:DO,gridcolor:NO,linecolor:RO,zerolinecolor:IO,"error-band-line-color":"var(--dh-color-chart-error-band-line)","ohlc-increasing":"var(--dh-color-chart-ohlc-increase)","ohlc-decreasing":"var(--dh-color-chart-ohlc-decrease)","coastline-color":"var(--dh-color-chart-geo-coastline)","land-color":"var(--dh-color-chart-geo-land)","ocean-color":"var(--dh-color-chart-geo-ocean)","lake-color":"var(--dh-color-chart-geo-lake)","river-color":"var(--dh-color-chart-geo-river)"};var Cv=ie.module("ChartTheme");function FO(){var n,e=Wh(bv);return e.colorway=Tb((n=e.colorway)!==null&&n!==void 0?n:"").map(t=>{var[r,i]=t;return Pd.normalizeCssColor(e.colorway.substring(r,i+1))}).join(" "),Cv.debug2("Chart theme:",bv),Cv.debug2("Chart theme derived:",e),Object.freeze({paper_bgcolor:e["paper-bgcolor"],plot_bgcolor:e["plot-bgcolor"],title_color:e["title-color"],legend_color:e["legend-color"],colorway:e.colorway,gridcolor:e.gridcolor,linecolor:e.linecolor,zerolinecolor:e.zerolinecolor,error_band_line_color:e["error-band-line-color"],ohlc_increasing:e["ohlc-increasing"],ohlc_decreasing:e["ohlc-decreasing"],coastline_color:e["coastline-color"],land_color:e["land-color"],ocean_color:e["ocean-color"],lake_color:e["lake-color"],river_color:e["river-color"]})}const _O=oC(ec);var lC=w.createContext(null);function X2(n){var{children:e}=n,{activeThemes:t}=dc(),r=w.useMemo(FO,[t]);return h.jsx(lC.Provider,{value:r,children:e})}function Sv(n){return n.setFigure!==void 0}function jd(){return Jh(lC,"No ChartThemeContext value found.")}var dC=Object.freeze({openPopouts:[],settings:{hasHeaders:!0,constrainDragToContainer:!0,reorderEnabled:!0,selectionEnabled:!1,popoutWholeStack:!1,blockedPopoutsThrowError:!0,closePopoutsOnUnload:!0,showPopoutIcon:!0,showMaximiseIcon:!0,showCloseIcon:!0,responsiveMode:"onload",tabOverlapAllowance:0,tabControlOffset:10},dimensions:{borderWidth:5,borderGrabWidth:10,minItemHeight:10,minItemWidth:10,headerHeight:20,dragProxyWidth:300,dragProxyHeight:200},labels:{close:"Close",maximise:"Maximize",minimise:"Minimize",popout:"Open in new window",popin:"Pop in",tabDropdown:"Additional tabs",tabNextLabel:"Next",tabPreviousLabel:"Previous"},content:[]});function uC(n){return n.componentName!==void 0}function MO(n){return n.component!==void 0}var hC=Object.freeze({type:"default",isClosable:!0,isFocusOnShow:!0,reorderEnabled:!0,title:""});const xO=Object.freeze(Object.defineProperty({__proto__:null,defaultConfig:dC,isGLComponentConfig:uC,isReactComponentConfig:MO,itemDefaultConfig:hC},Symbol.toStringTag,{value:"Module"}));function Bl(n,e,t){return e=AO(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function AO(n){var e=LO(n,"string");return typeof e=="symbol"?e:String(e)}function LO(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class Ds{constructor(){Bl(this,"_mSubscriptions",void 0),Bl(this,"off",this.unbind),Bl(this,"trigger",this.emit),this._mSubscriptions={},this._mSubscriptions[Ds.ALL_EVENT]=[]}on(e,t,r){if(typeof t!="function")throw new Error("Tried to listen to event "+e+" with non-function callback "+t);this._mSubscriptions[e]||(this._mSubscriptions[e]=[]),this._mSubscriptions[e].push({fn:t,ctx:r})}emit(e){for(var t=this._mSubscriptions[e],r=arguments.length,i=new Array(r>1?r-1:0),a=1;a<r;a++)i[a-1]=arguments[a];if(t)for(var o=0;o<t.length;o++){var s=t[o].ctx||{};try{t[o].fn.apply(s,i)}catch(c){console.error("Error while emitting event:",c)}}i.unshift(e);for(var l=this._mSubscriptions[Ds.ALL_EVENT],d=0;d<l.length;d++){var u=l[d].ctx||{};try{l[d].fn.apply(u,i)}catch(c){console.error("Error while emitting event to allEventSubs:",c)}}}unbind(e,t,r){if(!this._mSubscriptions[e])throw new Error("No subscriptions to unsubscribe for event "+e);for(var i=!1,a=0;a<this._mSubscriptions[e].length;a++)(!t||this._mSubscriptions[e][a].fn===t)&&(!r||r===this._mSubscriptions[e][a].ctx)&&(this._mSubscriptions[e].splice(a,1),i=!0);if(i===!1)throw new Error("Nothing to unbind for "+e)}}Bl(Ds,"ALL_EVENT","__all");const Dn=Ds;function cn(n,e,t){return e=kO(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function kO(n){var e=jO(n,"string");return typeof e=="symbol"?e:String(e)}function jO(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class gh extends Dn{constructor(e,t,r){super(),cn(this,"width",void 0),cn(this,"height",void 0),cn(this,"title",void 0),cn(this,"parent",void 0),cn(this,"layoutManager",void 0),cn(this,"tab",void 0),cn(this,"_config",void 0),cn(this,"isHidden",!1),cn(this,"beforeCloseHandler",void 0),cn(this,"_element",ge(['<div class="lm_item_container">','<div class="lm_content" tabindex="-1"></div>',"</div>"].join(""))),cn(this,"_contentElement",void 0),this.title=uC(e)?e.componentName:"",this.parent=t,this.layoutManager=r,this._config=e,this._contentElement=this._element.find(".lm_content"),this.beforeCloseHandler=null}getElement(){return this._contentElement}hide(){this.emit("hide"),this.isHidden=!0,this._element.hide()}show(){this.emit("show"),this.isHidden=!1,this._element.show(),(this.height!=0||this.width!=0)&&this.emit("shown")}setSize(e,t){for(var r,i,a,o=this.parent,s=null;o&&!o.isColumn&&!o.isRow;){var l;if(s=o,o=o.parent,(l=o)!==null&&l!==void 0&&l.isRoot)return!1}if(!o||!s)return!1;for(var d=o.isColumn?"height":"width",u=d==="height"?t:e,c=((r=this[d])!==null&&r!==void 0?r:0)*(1/(((i=s.config[d])!==null&&i!==void 0?i:0)/100)),m=u/c*100,v=(((a=s.config[d])!==null&&a!==void 0?a:0)-m)/(o.contentItems.length-1),f=0;f<o.contentItems.length;f++)if(o.contentItems[f]===s)o.contentItems[f].config[d]=m;else{var g;o.contentItems[f].config[d]=((g=o.contentItems[f].config[d])!==null&&g!==void 0?g:0)+v}return o.callDownwards("setSize"),!0}close(e){var t,r;this._config.isClosable&&(!((t=(r=this.beforeCloseHandler)===null||r===void 0?void 0:r.call(this,e))!==null&&t!==void 0)||t)&&(this.emit("close"),this.parent.close())}beforeClose(e){this.beforeCloseHandler=e}getState(){return this._config.componentState}extendState(e){this.setState(ge.extend(!0,this.getState(),e))}setState(e){this._config.componentState=e,this.parent.emitBubblingEvent("stateChanged")}setTitle(e){this.parent.setTitle(e)}_$setSize(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;if(e!==this.width||t!==this.height){this.width=e,this.height=t;var r=this._contentElement[0],i=r.offsetWidth-r.clientWidth,a=r.offsetHeight-r.clientHeight;this._contentElement.width(this.width-i).height(this.height-a),this.emit("resize")}}}const $O=Object.freeze(Object.defineProperty({__proto__:null,Container:gh,ItemContainer:gh},Symbol.toStringTag,{value:"Module"}));function cC(n){var e=location.hash.match(new RegExp(n+"=([^&]*)"));return e?e[1]:null}function mC(n){if(window.location.hash)return cC(n);if(!window.location.search)return null;var e=window.location.search.substr(1).split("&"),t={},r,i;for(i=0;i<e.length;i++)r=e[i].split("="),t[r[0]]=r[1];return t[n]||null}function vc(n){return window.requestAnimationFrame(n)}function HO(n,e){var t=e.indexOf(n);if(t===-1)throw new Error("Can't remove item from array. Item is not in the array");e.splice(t,1)}function fc(){return(Math.random()*1e15).toString(36).replace(".","")}function BO(n,e){var t=n.replace(/javascript/gi,"javascript").replace(/expression/gi,"expression").replace(/onload/gi,"onload").replace(/script/gi,"script").replace(/onerror/gi,"onerror");return e===!0?t:t.replace(/>/g,">").replace(/</g,"<")}function gc(n){return ge.trim(n.replace(/(<([^>]+)>)/gi,""))}function Dr(n,e,t){return e=UO(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function UO(n){var e=VO(n,"string");return typeof e=="symbol"?e:String(e)}function VO(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class GO extends Dn{constructor(e){var t,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;super(),Dr(this,"_eElement",void 0),Dr(this,"_oDocument",void 0),Dr(this,"_eBody",void 0),Dr(this,"_destroyAfterMouseUp",void 0),Dr(this,"_nDelay",400),Dr(this,"_timeout",void 0),Dr(this,"timeout",void 0),Dr(this,"_nDistance",10),Dr(this,"_nX",0),Dr(this,"_nY",0),Dr(this,"_nOriginalX",0),Dr(this,"_nOriginalY",0),Dr(this,"_bDragging",!1),this._eElement=e,this._oDocument=ge(document),this._eBody=ge(document.body),this._destroyAfterMouseUp=r,this.onMouseMove=this.onMouseMove.bind(this),this.onMouseUp=this.onMouseUp.bind(this),this.onMouseDown=this.onMouseDown.bind(this),this._startDrag=this._startDrag.bind(this),(t=this._eElement)===null||t===void 0||t.on("mousedown",this.onMouseDown)}destroy(){var e,t;(e=this._eElement)===null||e===void 0||e.unbind("mousedown",this.onMouseDown),(t=this._oDocument)===null||t===void 0||t.unbind("mouseup",this.onMouseUp),this._eElement=void 0,this._oDocument=void 0,this._eBody=void 0,clearTimeout(this._timeout),this._timeout=void 0}onMouseDown(e){if(e.preventDefault(),e.button===0){var t,r,i,a,o=this._getCoordinates(e);this._nOriginalX=(t=o.x)!==null&&t!==void 0?t:0,this._nOriginalY=(r=o.y)!==null&&r!==void 0?r:0,(i=this._oDocument)===null||i===void 0||i.on("mousemove",this.onMouseMove),(a=this._oDocument)===null||a===void 0||a.on("mouseup",this.onMouseUp),this._timeout=window.setTimeout(this._startDrag,this._nDelay)}}onMouseMove(e){if(this._timeout!=null){var t,r;e.preventDefault();var i=this._getCoordinates(e);this._nX=((t=i.x)!==null&&t!==void 0?t:0)-this._nOriginalX,this._nY=((r=i.y)!==null&&r!==void 0?r:0)-this._nOriginalY,this._bDragging===!1&&(Math.abs(this._nX)>this._nDistance||Math.abs(this._nY)>this._nDistance)&&this._startDrag(),this._bDragging&&this.emit("drag",this._nX,this._nY,e)}}onMouseUp(e){if(this._timeout!=null){var t,r,i,a,o;if(clearTimeout(this._timeout),(t=this._oDocument)===null||t===void 0||t.unbind("mousemove",this.onMouseMove),(r=this._oDocument)===null||r===void 0||r.unbind("mouseup",this.onMouseUp),(i=this._oDocument)===null||i===void 0||(a=i.find("iframe"))===null||a===void 0||a.css("pointer-events",""),this._bDragging===!0&&(this._bDragging=!1,this.emit("dragStop",e,this._nOriginalX+this._nX)),(o=this._eBody)===null||o===void 0||o.removeClass("lm_dragging"),!(this._eElement instanceof Window)){var s;(s=this._eElement)===null||s===void 0||s.removeClass("lm_dragging")}this._destroyAfterMouseUp&&this.destroy()}}_startDrag(){var e,t,r,i;window.clearTimeout(this._timeout),this._bDragging=!0,(e=this._eBody)===null||e===void 0||e.addClass("lm_dragging"),(t=this._eElement)===null||t===void 0||t.addClass("lm_dragging"),(r=this._oDocument)===null||r===void 0||(i=r.find("iframe"))===null||i===void 0||i.css("pointer-events","none"),this.emit("dragStart",this._nOriginalX,this._nOriginalY)}_getCoordinates(e){var t,r;return{x:(t=e.pageX)!==null&&t!==void 0?t:0,y:(r=e.pageY)!==null&&r!==void 0?r:0}}}const $s=GO;function Qa(n,e,t){return e=WO(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function WO(n){var e=zO(n,"string");return typeof e=="symbol"?e:String(e)}function zO(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class vC{constructor(e,t){Qa(this,"_container",void 0),Qa(this,"_reactComponent",null),Qa(this,"_portalComponent",null),Qa(this,"_originalComponentWillUpdate",null),Qa(this,"_initialState",void 0),Qa(this,"_reactClass",void 0),this._reactComponent=null,this._portalComponent=null,this._originalComponentWillUpdate=null,this._container=e,this._initialState=t,this._reactClass=this._getReactClass(),this._container.on("open",this._render,this),this._container.on("destroy",this._destroy,this)}_key(){var e=this._container._config.id;if(!e)throw new Error("Cannot mount panel without id");return Array.isArray(e)?e.join(","):e}_render(){var e=this._key();this._portalComponent=bd.createPortal(this._getReactComponent(),this._container.getElement()[0],e),this._container.layoutManager.addReactChild(e,this._portalComponent)}_gotReactComponent(e){if(e){this._reactComponent=e,this._originalComponentWillUpdate=this._reactComponent.componentWillUpdate||function(){},this._reactComponent.componentWillUpdate=this._onUpdate.bind(this);var t=this._container.getState();t&&this._reactComponent.setState(t)}}_destroy(){this._container.layoutManager.removeReactChild(this._key(),this._portalComponent),this._container.off("open",this._render,this),this._container.off("destroy",this._destroy,this)}_onUpdate(e,t){var r;this._container.setState(t),(r=this._originalComponentWillUpdate)===null||r===void 0||r.call(this._reactComponent,e,t)}_getReactClass(){var e=this._container._config.component;if(!e)throw new Error("No react component name. type: react-component needs a field `component`");var t=this._container.layoutManager.getComponent(e)||this._container.layoutManager.getFallbackComponent();if(!t)throw new Error('React component "'+e+'" not found. Please register all components with GoldenLayout using `registerComponent(name, component)`');return t}_getReactComponent(){var e={glEventHub:this._container.layoutManager.eventHub,glContainer:this._container,ref:this._gotReactComponent.bind(this)},t=ge.extend(e,this._container._config.props);return oe.createElement(this._reactClass,t)}}var Ql=["settings","hasHeaders","constrainDragToContainer","selectionEnabled","dimensions","borderWidth","minItemHeight","minItemWidth","headerHeight","dragProxyWidth","dragProxyHeight","labels","close","maximise","minimise","popout","content","componentName","componentState","id","width","type","height","isClosable","title","popoutWholeStack","openPopouts","parentId","activeItemIndex","reorderEnabled","borderGrabWidth"],KO=[!0,!1,"row","column","stack","component","close","maximise","minimise","open in new window"];function pc(n){if(Ql.length>36)throw new Error("Too many keys in config minifier map");var e={};return bc(n,e,"_min"),e}function ph(n){if(Ql.length>36)throw new Error("Too many keys in config minifier map");var e={};return bc(n,e,"_max"),e}function bc(n,e,t){var r=t==="_min"?qO:YO;for(var i in n)if(n.hasOwnProperty(i)){var a=Array.isArray(n)?n[Number.parseInt(i,10)]:n[i];if(typeof a=="object"&&a!=null){var o=a instanceof Array?[]:{};if(Array.isArray(e))e[Number.parseInt(i,10)]=o;else{var s=r(i,Ql);e[s]=o}bc(a,o,t)}else{var l=r(a,KO);if(Array.isArray(e))e[Number.parseInt(i,10)]=l;else{var d=r(i,Ql);e[d]=l}}}}function qO(n,e){if(typeof n=="string"&&n.length===1)return"___"+n;var t=e.indexOf(n);return t===-1?n:t.toString(36)}function YO(n,e){return typeof n=="string"&&n.length===1?e[parseInt(n,36)]:typeof n=="string"&&n.substr(0,3)==="___"?n[3]:n}function ju(n,e,t){return e=XO(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function XO(n){var e=QO(n,"string");return typeof e=="symbol"?e:String(e)}function QO(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class bh{constructor(e,t){ju(this,"name",void 0),ju(this,"origin",void 0),ju(this,"isPropagationStopped",void 0),this.name=e,this.origin=t,this.isPropagationStopped=!1}stopPropagation(){this.isPropagationStopped=!0}}function ul(n,e,t){return e=ZO(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function ZO(n){var e=JO(n,"string");return typeof e=="symbol"?e:String(e)}function JO(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}let eD=class extends Dn{constructor(e){super(),ul(this,"_layoutManager",void 0),ul(this,"_dontPropagateToParent",void 0),ul(this,"_childEventSource",void 0),ul(this,"_boundOnEventFromChild",void 0),this._layoutManager=e,this._dontPropagateToParent=null,this._childEventSource=null,this.on(Dn.ALL_EVENT,this._onEventFromThis.bind(this)),this._boundOnEventFromChild=this._onEventFromChild.bind(this),ge(window).on("gl_child_event",this._boundOnEventFromChild)}_onEventFromThis(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];this._layoutManager.isSubWindow&&t[0]!==this._dontPropagateToParent&&this._propagateToParent(t),this._propagateToChildren(t),this._dontPropagateToParent=null,this._childEventSource=null}_$onEventFromParent(e){this._dontPropagateToParent=e[0],this.emit.apply(this,e)}_onEventFromChild(e){this._childEventSource=e.originalEvent.__gl,this.emit.apply(this,e.originalEvent.__glArgs)}_propagateToParent(e){var t,r="gl_child_event",i=(t=window.opener)===null||t===void 0?void 0:t.document.createEvent("HTMLEvents");i.initEvent(r,!0,!0),i.eventName=r,i.__glArgs=e,i.__gl=this._layoutManager,window.opener.dispatchEvent(i)}_propagateToChildren(e){for(var t=0;t<this._layoutManager.openPopouts.length;t++){var r=this._layoutManager.openPopouts[t].getGlInstance();r&&r!==this._childEventSource&&r.eventHub._$onEventFromParent(e)}}destroy(){ge(window).off("gl_child_event",this._boundOnEventFromChild)}};const fC=eD,tD=Object.freeze(Object.defineProperty({__proto__:null,BubblingEvent:bh,DragListener:$s,EventEmitter:Dn,EventHub:fC,ReactComponentHandler:vC,animFrame:vc,filterXss:BO,getHashValue:cC,getQueryStringParam:mC,getUniqueId:fc,minifyConfig:pc,removeFromArray:HO,stripTags:gc,unminifyConfig:ph},Symbol.toStringTag,{value:"Module"}));function Ni(n,e,t){return e=rD(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function rD(n){var e=nD(n,"string");return typeof e=="symbol"?e:String(e)}function nD(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class gC extends Dn{constructor(e,t,r,i,a){super(),Ni(this,"isInitialised",!1),Ni(this,"_config",void 0),Ni(this,"_dimensions",void 0),Ni(this,"_parentId",void 0),Ni(this,"_indexInParent",void 0),Ni(this,"_layoutManager",void 0),Ni(this,"_popoutWindow",null),Ni(this,"_id",null),this._config=e,this._dimensions=t,this._parentId=r,this._indexInParent=i,this._layoutManager=a,this._createWindow()}toConfig(){var e,t,r,i,a,o,s,l,d,u,c;if(this.isInitialised===!1)throw new Error("Can't create config, layout not yet initialised");return{dimensions:{width:(e=this.getGlInstance())===null||e===void 0?void 0:e.width,height:(t=this.getGlInstance())===null||t===void 0?void 0:t.height,left:(r=(i=(a=this._popoutWindow)===null||a===void 0?void 0:a.screenX)!==null&&i!==void 0?i:(o=this._popoutWindow)===null||o===void 0?void 0:o.screenLeft)!==null&&r!==void 0?r:0,top:(s=(l=(d=this._popoutWindow)===null||d===void 0?void 0:d.screenY)!==null&&l!==void 0?l:(u=this._popoutWindow)===null||u===void 0?void 0:u.screenTop)!==null&&s!==void 0?s:0},content:(c=this.getGlInstance())===null||c===void 0?void 0:c.toConfig().content,parentId:this._parentId,indexInParent:this._indexInParent}}getGlInstance(){var e;return(e=this._popoutWindow)===null||e===void 0?void 0:e.__glInstance}getWindow(){return this._popoutWindow}close(){if(this.getGlInstance()){var e;(e=this.getGlInstance())===null||e===void 0||e._$closeWindow()}else try{var t;(t=this.getWindow())===null||t===void 0||t.close()}catch{}}popIn(){var e;this._indexInParent;var t=null,r=null;if(this._parentId){var i;if(t=ge.extend(!0,{},(i=this.getGlInstance())===null||i===void 0?void 0:i.toConfig()).content[0],r=this._layoutManager.root.getItemsById(this._parentId)[0],!r){var a;((a=this._layoutManager.root.contentItems.length)!==null&&a!==void 0?a:0)>0?r=this._layoutManager.root.contentItems[0]:r=this._layoutManager.root}}t&&((e=r)===null||e===void 0||e.addChild(t,this._indexInParent),this.close())}_createWindow(){var e=this._createUrl(),t=Math.floor(Math.random()*1e6).toString(36),r=this._serializeWindowOptions({width:this._dimensions.width,height:this._dimensions.height,innerWidth:this._dimensions.width,innerHeight:this._dimensions.height,menubar:"no",toolbar:"no",location:"no",personalbar:"no",resizable:"yes",scrollbars:"no",status:"no"});if(this._popoutWindow=window.open(e,t,r),!this._popoutWindow)if(this._layoutManager.config.settings.blockedPopoutsThrowError===!0){var i=new Error("Popout blocked");throw i.type="popoutBlocked",i}else return;ge(this._popoutWindow).on("load",this._positionWindow.bind(this)).on("unload beforeunload",this._onClose.bind(this));var a=window.setInterval(()=>{var o;(o=this._popoutWindow)!==null&&o!==void 0&&o.__glInstance&&this._popoutWindow.__glInstance.isInitialised&&(this._onInitialised(),window.clearInterval(a))},10)}_serializeWindowOptions(e){var t=[],r;for(r in e)t.push(r+"="+e[r]);return t.join(",")}_createUrl(){var e={content:this._config},t="gl-window-config-"+fc();e=pc(e);try{localStorage.setItem(t,JSON.stringify(e))}catch(i){throw new Error("Error while writing to localStorage "+i.toString())}var r=document.location.href.split("?");return r.length===1?r[0]+"?gl-window="+t:document.location.href+"&gl-window="+t}_positionWindow(){var e,t;(e=this._popoutWindow)===null||e===void 0||e.moveTo(this._dimensions.left,this._dimensions.top),(t=this._popoutWindow)===null||t===void 0||t.focus()}_onInitialised(){var e;this.isInitialised=!0,(e=this.getGlInstance())===null||e===void 0||e.on("popIn",this.popIn,this),this.emit("initialised")}_onClose(){setTimeout(this.emit.bind(this,"closed"),50)}}function jt(n,e,t){return e=iD(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function iD(n){var e=aD(n,"string");return typeof e=="symbol"?e:String(e)}function aD(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class $a extends Dn{constructor(e,t,r,i,a,o){var s,l,d,u,c,m,v,f;if(super(),jt(this,"_dragListener",void 0),jt(this,"_layoutManager",void 0),jt(this,"_contentItem",void 0),jt(this,"_originalParent",void 0),jt(this,"_area",null),jt(this,"_lastValidArea",null),jt(this,"_minX",void 0),jt(this,"_maxX",void 0),jt(this,"_minY",void 0),jt(this,"_maxY",void 0),jt(this,"_width",void 0),jt(this,"_height",void 0),jt(this,"_sided",void 0),jt(this,"element",void 0),jt(this,"childElementContainer",void 0),jt(this,"_proxyTab",void 0),this._dragListener=r,this._layoutManager=i,this._contentItem=a,this._originalParent=o,this._dragListener.on("drag",this._onDrag,this),this._dragListener.on("dragStop",this._onDrop,this),this._contentItem.tab&&this._contentItem.tab.element){var g,p;this._layoutManager.tabDropPlaceholder.width((g=this._contentItem.tab.element.outerWidth(!0))!==null&&g!==void 0?g:0),this._layoutManager.tabDropPlaceholder.height((p=this._contentItem.tab.element.outerHeight(!0))!==null&&p!==void 0?p:0)}if(this.element=ge($a._template),o&&o._side&&(this._sided=o._sided,this.element.addClass("lm_"+o._side),["right","bottom"].indexOf(o._side.toString())>=0&&this.element.find(".lm_content").after(this.element.find(".lm_header"))),this.element.css({left:e,top:t}),this._proxyTab=this.element.find(".lm_tab"),this._proxyTab.attr("title",gc((s=this._contentItem.config.title)!==null&&s!==void 0?s:"")),this.element.find(".lm_title").html((l=this._contentItem.config.title)!==null&&l!==void 0?l:""),this.childElementContainer=this.element.find(".lm_content"),this.childElementContainer.append(a.element),this._updateTree(),this._layoutManager._$calculateItemAreas(),ge(document.body).append(this.element),this._setDimensions(),!this._contentItem.tab&&this._proxyTab.length){var b,S;this._layoutManager.tabDropPlaceholder.width((b=this._proxyTab.outerWidth(!0))!==null&&b!==void 0?b:0),this._layoutManager.tabDropPlaceholder.height((S=this._proxyTab.outerHeight(!0))!==null&&S!==void 0?S:0)}var C=this._layoutManager.container.offset();this._minX=(d=C==null?void 0:C.left)!==null&&d!==void 0?d:0,this._minY=(u=C==null?void 0:C.top)!==null&&u!==void 0?u:0,this._maxX=((c=this._layoutManager.container.width())!==null&&c!==void 0?c:0)+this._minX,this._maxY=((m=this._layoutManager.container.height())!==null&&m!==void 0?m:0)+this._minY,this._width=(v=this.element.width())!==null&&v!==void 0?v:0,this._height=(f=this.element.height())!==null&&f!==void 0?f:0,this._setDropPosition(e,t),this._layoutManager.emit("itemPickedUp",this._contentItem)}_onDrag(e,t,r){var i,a,o=(i=r.pageX)!==null&&i!==void 0?i:0,s=(a=r.pageY)!==null&&a!==void 0?a:0,l=o>this._minX&&o<this._maxX&&s>this._minY&&s<this._maxY;!l&&this._layoutManager.config.settings.constrainDragToContainer===!0||this._setDropPosition(o,s)}_setDropPosition(e,t){this.element.css({left:e,top:t}),this._area=this._layoutManager._$getArea(e,t),this._area!==null&&(this._lastValidArea=this._area,this._area.contentItem._$highlightDropZone(e,t,this._area))}_onDrop(){var e;(e=this._layoutManager.dropTargetIndicator)===null||e===void 0||e.hide(),this._area!==null?this._area.contentItem._$onDrop(this._contentItem,this._area):this._lastValidArea!==null?this._lastValidArea.contentItem._$onDrop(this._contentItem,this._lastValidArea):this._originalParent?this._originalParent.addChild(this._contentItem):this._contentItem._$destroy(),this._dragListener.off("drag",this._onDrag,this),this._dragListener.off("dragStop",this._onDrop,this),this.element.remove(),this._layoutManager.emit("itemDropped",this._contentItem)}_updateTree(){this._contentItem.parent&&this._contentItem.parent.removeChild(this._contentItem,!0),this._contentItem._$setParent(null)}_setDimensions(){var e=this._layoutManager.config.dimensions,t=e.dragProxyWidth,r=e.dragProxyHeight;this.element.width(t),this.element.height(r),t-=this._sided?e.headerHeight:0,r-=this._sided?0:e.headerHeight,this.childElementContainer.width(t),this.childElementContainer.height(r),this._contentItem.element.width(t),this._contentItem.element.height(r),this._contentItem.callDownwards("_$show"),this._contentItem.callDownwards("setSize")}}jt($a,"_template",'<div class="lm_dragProxy"><div class="lm_header"><ul class="lm_tabs"><li class="lm_tab lm_active"><i class="lm_left"></i><span class="lm_title"></span><i class="lm_right"></i></li></ul></div><div class="lm_content"></div></div>');function hl(n,e,t){return e=oD(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function oD(n){var e=sD(n,"string");return typeof e=="symbol"?e:String(e)}function sD(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class pC{constructor(e,t,r){hl(this,"_element",void 0),hl(this,"_itemConfig",void 0),hl(this,"_layoutManager",void 0),hl(this,"_dragListener",void 0),this._element=e,this._itemConfig=t,this._layoutManager=r,this._dragListener=this._createDragListener()}_createDragListener(){return this._dragListener=new $s(this._element,!0),this._dragListener.on("dragStart",this._onDragStart,this),this._dragListener.on("dragStop",this._createDragListener,this),this._dragListener}_onDragStart(e,t){var r=this._itemConfig;typeof r=="function"&&(r=r());var i=this._layoutManager._$normalizeContentItem(ge.extend(!0,{},r));new $a(e,t,this._dragListener,this._layoutManager,i,null)}}function cl(n,e,t){return e=lD(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function lD(n){var e=dD(n,"string");return typeof e=="symbol"?e:String(e)}function dD(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class bC{constructor(e,t,r){cl(this,"_element",ge(window)),cl(this,"_itemConfig",void 0),cl(this,"_layoutManager",void 0),cl(this,"_dragListener",void 0),this._itemConfig=e,this._layoutManager=t,this._createDragListener(r)}_createDragListener(e){this._dragListener&&this._dragListener.destroy(),this._element&&(this._dragListener=new $s(this._element,!0),this._dragListener.on("dragStart",this._onDragStart,this),this._dragListener.on("dragStop",this._destroy,this),this._dragListener.onMouseDown(e),this._dragListener._startDrag())}_destroy(){this._dragListener=void 0,this._element=void 0,this._itemConfig=void 0,this._layoutManager=void 0}_onDragStart(e,t){if(!(!this._dragListener||!this._layoutManager)){var r=this._itemConfig;typeof r=="function"&&(r=r());var i=this._layoutManager._$normalizeContentItem(ge.extend(!0,{},r));new $a(e,t,this._dragListener,this._layoutManager,i,null)}}}function CC(n,e,t){return e=uD(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function uD(n){var e=hD(n,"string");return typeof e=="symbol"?e:String(e)}function hD(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class Hs{constructor(){CC(this,"element",ge(Hs._template)),ge(document.body).append(this.element)}destroy(){this.element.remove()}highlightArea(e){this.element.css({left:e.x1,top:e.y1,width:Math.floor(e.x2-e.x1),height:Math.floor(e.y2-e.y1)}).show()}hide(){this.element.hide()}}CC(Hs,"_template",'<div class="lm_dropTargetIndicator"><div class="lm_inner"></div></div>');function $u(n,e,t){return e=cD(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function cD(n){var e=mD(n,"string");return typeof e=="symbol"?e:String(e)}function mD(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class ls{constructor(e,t,r,i){$u(this,"element",void 0),$u(this,"_header",void 0),$u(this,"_action",void 0),this._header=e,this.element=ge('<li class="'+r+'" title="'+t+'"></li>'),this._header.on("destroy",this._$destroy,this),this._action=i,this.element.on("click",this._action),this._header.controlsContainer.append(this.element)}_$destroy(){this.element.off(),this.element.remove()}}function vD(n,e,t){return e=fD(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function fD(n){var e=gD(n,"string");return typeof e=="symbol"?e:String(e)}function gD(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class pD extends Error{constructor(e,t){super(),vD(this,"node",void 0),this.name="Configuration Error",this.message=e,this.node=t}}const Da=pD,bD=Object.freeze(Object.defineProperty({__proto__:null,ConfigurationError:Da},Symbol.toStringTag,{value:"Module"}));function Mt(n,e,t){return e=CD(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function CD(n){var e=SD(n,"string");return typeof e=="symbol"?e:String(e)}function SD(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function Ns(n){return n.isStack}function xr(n){return n.isComponent}function SC(n){return n.isRoot}class Vt extends Dn{constructor(e,t,r,i){super(),Mt(this,"config",void 0),Mt(this,"type",void 0),Mt(this,"contentItems",void 0),Mt(this,"parent",void 0),Mt(this,"layoutManager",void 0),Mt(this,"element",void 0),Mt(this,"childElementContainer",void 0),Mt(this,"componentName",void 0),Mt(this,"isInitialised",!1),Mt(this,"isMaximised",!1),Mt(this,"isRoot",!1),Mt(this,"isRow",!1),Mt(this,"isColumn",!1),Mt(this,"isStack",!1),Mt(this,"isComponent",!1),Mt(this,"tab",void 0),Mt(this,"_pendingEventPropagations",void 0),Mt(this,"_throttledEvents",void 0),this.element=i,this.config=this._extendItemNode(t),this.type=t.type,this.contentItems=[],this.parent=r,this.layoutManager=e,this._pendingEventPropagations={},this._throttledEvents=["stateChanged"],this.on(Dn.ALL_EVENT,this._propagateEvent,this),t.content&&this._createContentItems(t)}callDownwards(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;r!==!0&&i!==!0&&this[e].apply(this,t);for(var a=0;a<this.contentItems.length;a++)this.contentItems[a].callDownwards(e,t,r);r===!0&&i!==!0&&this[e].apply(this,t)}removeChild(e){var t,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,i=this.contentItems.indexOf(e);if(i===-1)throw new Error("Can't remove child item. Unknown content item");if(r!==!0&&this.contentItems[i]._$destroy(),this.contentItems.splice(i,1),(t=this.config.content)===null||t===void 0||t.splice(i,1),this.contentItems.length>0)this.callDownwards("setSize");else if(this.type!=="root"&&this.config.isClosable){var a;(a=this.parent)===null||a===void 0||a.removeChild(this)}}addChild(e,t){e=this.layoutManager._$normalizeContentItem(e,this),t===void 0&&(t=this.contentItems.length),this.contentItems.splice(t,0,e),this.config.content===void 0&&(this.config.content=[]),this.config.content.splice(t,0,e.config),e.parent=this,e.parent.isInitialised===!0&&e.isInitialised===!1&&e._$init()}replaceChild(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;t=this.layoutManager._$normalizeContentItem(t);var i=this.contentItems.indexOf(e),a=e.element[0].parentNode;if(i===-1)throw new Error("Can't replace child. oldChild is not child of this");a==null||a.replaceChild(t.element[0],e.element[0]),r===!0&&(e.parent=null,e._$destroy()),this.contentItems[i]=t,t.parent=this,Ns(this)&&(this.header.tabs[i].contentItem=t),t.parent.isInitialised===!0&&t.isInitialised===!1&&t._$init(),this.callDownwards("setSize")}remove(){var e;(e=this.parent)===null||e===void 0||e.removeChild(this)}popout(){var e=this.layoutManager.createPopout(this);return this.emitBubblingEvent("stateChanged"),e}toggleMaximise(e){e&&e.preventDefault(),this.isMaximised===!0?this.layoutManager._$minimiseItem(this):this.layoutManager._$maximiseItem(this),this.isMaximised=!this.isMaximised,this.emitBubblingEvent("stateChanged")}select(){this.layoutManager.selectedItem!==this&&(this.layoutManager.selectItem(this,!0),this.element.addClass("lm_selected"))}deselect(){this.layoutManager.selectedItem===this&&(this.layoutManager.selectedItem=null,this.element.removeClass("lm_selected"))}setTitle(e){this.config.title=e,this.emit("titleChanged",e),this.emitBubblingEvent("stateChanged")}hasId(e){if(this.config.id){if(typeof this.config.id=="string")return this.config.id===e;if(this.config.id instanceof Array)return this.config.id.indexOf(e)!==-1}else return!1}addId(e){this.hasId(e)||(this.config.id?typeof this.config.id=="string"?this.config.id=[this.config.id,e]:this.config.id instanceof Array&&this.config.id.push(e):this.config.id=e)}removeId(e){if(!this.hasId(e))throw new Error("Id not found");if(typeof this.config.id=="string")delete this.config.id;else if(this.config.id instanceof Array){var t=this.config.id.indexOf(e);this.config.id.splice(t,1)}}getItemsByFilter(e){var t=[],r=function i(a){for(var o=0;o<a.contentItems.length;o++)e(a.contentItems[o])===!0&&t.push(a.contentItems[o]),i(a.contentItems[o])};return r(this),t}getItemsById(e){return this.getItemsByFilter(function(t){return t.config.id instanceof Array?t.config.id.indexOf(e)!==-1:t.config.id===e})}getItemsByType(e){return this._$getItemsByProperty("type",e)}getComponentsByName(e){for(var t=this._$getItemsByProperty("componentName",e),r=[],i=0;i<t.length;i++)r.push(t[i].instance);return r}_$getItemsByProperty(e,t){return this.getItemsByFilter(function(r){return r[e]===t})}_$setParent(e){this.parent=e}_$highlightDropZone(e,t,r){var i;(i=this.layoutManager.dropTargetIndicator)===null||i===void 0||i.highlightArea(r)}_$onDrop(e,t){this.addChild(e)}_$hide(){this._callOnActiveComponents("hide"),this.element.hide(),this.layoutManager.updateSize()}_$show(){this._callOnActiveComponents("show"),this.element.show(),this.layoutManager.updateSize()}_callOnActiveComponents(e){for(var t=this.getItemsByType("stack"),r=null,i=0;i<t.length;i++)r=t[i].getActiveContentItem(),r&&xr(r)&&r.container[e]()}_$destroy(){this.emitBubblingEvent("beforeItemDestroyed"),this.callDownwards("_$destroy",[],!0,!0),this.element.remove(),this.emitBubblingEvent("itemDestroyed")}_$getArea(e){var t,r,i;e=e||this.element;var a=(t=e.offset())!==null&&t!==void 0?t:{left:0,top:0},o=(r=e.width())!==null&&r!==void 0?r:0,s=(i=e.height())!==null&&i!==void 0?i:0;return{x1:a.left,y1:a.top,x2:a.left+o,y2:a.top+s,surface:o*s,contentItem:this,side:""}}_$init(){this.setSize();for(var e=0;e<this.contentItems.length;e++){var t;(t=this.childElementContainer)===null||t===void 0||t.append(this.contentItems[e].element)}this.isInitialised=!0,this.emitBubblingEvent("itemCreated"),this.emitBubblingEvent(this.type+"Created")}emitBubblingEvent(e){var t=new bh(e,this);this.emit(e,t)}_createContentItems(e){var t;if(!(e.content instanceof Array))throw new Da("content must be an Array",e);for(var r=0;r<e.content.length;r++)t=this.layoutManager.createContentItem(e.content[r],this),this.contentItems.push(t)}_extendItemNode(e){for(var[t,r]of Object.entries(hC)){var i=t;e[i]===void 0&&(e[i]=r)}return e}_propagateEvent(e,t){t instanceof bh&&t.isPropagationStopped===!1&&this.isInitialised===!0&&(this.isRoot===!1&&this.parent?this.parent.emit.apply(this.parent,[e,t]):this._scheduleEventPropagationToLayoutManager(e,t))}_scheduleEventPropagationToLayoutManager(e,t){this._throttledEvents.indexOf(e)===-1?this.layoutManager.emit(e,t.origin):this._pendingEventPropagations[e]!==!0&&(this._pendingEventPropagations[e]=!0,vc(this._propagateEventToLayoutManager.bind(this,e,t)))}_propagateEventToLayoutManager(e,t){this._pendingEventPropagations[e]=!1,this.layoutManager.emit(e,t)}}function zo(n,e,t){return e=wD(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function wD(n){var e=yD(n,"string");return typeof e=="symbol"?e:String(e)}function yD(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class wC extends Vt{constructor(e,t,r){super(e,t,r,ge()),zo(this,"config",void 0),zo(this,"componentName",void 0),zo(this,"container",void 0),zo(this,"parent",void 0),zo(this,"instance",void 0),this.config=t,this.parent=r;var i=e.getComponent(this.config.componentName)||e.getFallbackComponent(),a=ge.extend(!0,{},this.config.componentState||{});if(i==null)throw new Da('Unknown component "'+this.config.componentName+'"');a.componentName=this.config.componentName,this.componentName=this.config.componentName,this.config.title===""&&(this.config.title=this.config.componentName),this.isComponent=!0,this.container=new gh(this.config,this,e),this.instance=new i(this.container,a),this.element=this.container._element}close(){this.parent.removeChild(this)}setSize(){this.element.is(":visible")&&this.container._$setSize(this.element.width(),this.element.height())}_$init(){Vt.prototype._$init.call(this),this.container.emit("open")}_$hide(){this.container.hide(),Vt.prototype._$hide.call(this)}_$show(){this.container.show(),this.container._config.isFocusOnShow&&this.container._contentElement[0].focus({preventScroll:!0}),Vt.prototype._$show.call(this)}_$destroy(){this.container.emit("destroy",this),Vt.prototype._$destroy.call(this)}_$getArea(){return null}}function qr(n,e,t){return e=ED(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function ED(n){var e=TD(n,"string");return typeof e=="symbol"?e:String(e)}function TD(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class Zl extends Vt{constructor(e,t,r,i){super(t,r,i,ge('<div class="lm_item lm_'+(e?"column":"row")+'"></div>')),qr(this,"isRow",void 0),qr(this,"isColumn",void 0),qr(this,"childElementContainer",void 0),qr(this,"parent",void 0),qr(this,"_splitter",[]),qr(this,"_splitterSize",void 0),qr(this,"_splitterGrabSize",void 0),qr(this,"_isColumn",void 0),qr(this,"_dimension",void 0),qr(this,"_splitterPosition",null),qr(this,"_splitterMinPosition",null),qr(this,"_splitterMaxPosition",null),this.parent=i,this.isRow=!e,this.isColumn=e,this.childElementContainer=this.element,this._splitterSize=t.config.dimensions.borderWidth,this._splitterGrabSize=t.config.dimensions.borderGrabWidth,this._isColumn=e,this._dimension=e?"height":"width",this._splitterPosition=null,this._splitterMinPosition=null,this._splitterMaxPosition=null}addChild(e,t,r){var i,a,o,s;if(e=this.layoutManager._$normalizeContentItem(e,this),t===void 0&&(t=this.contentItems.length),this.contentItems.length>0?(s=this._createSplitter(Math.max(0,t-1)).element,t>0?(this.contentItems[t-1].element.after(s),s.after(e.element)):(this.contentItems[0].element.before(s),s.before(e.element))):this.childElementContainer.append(e.element),Vt.prototype.addChild.call(this,e,t),i=1/this.contentItems.length*100,r===!0){this.emitBubblingEvent("stateChanged");return}for(o=0;o<this.contentItems.length;o++)if(this.contentItems[o]===e)e.config[this._dimension]=i;else{var l;a=((l=this.contentItems[o].config[this._dimension])!==null&&l!==void 0?l:0)*(100-i)/100,this.contentItems[o].config[this._dimension]=a}this.callDownwards("setSize"),this.emitBubblingEvent("stateChanged")}removeChild(e,t){var r,i=(r=e.config[this._dimension])!==null&&r!==void 0?r:0,a=this.contentItems.indexOf(e),o=Math.max(a-1,0),s,l;if(a===-1)throw new Error("Can't remove child. ContentItem is not child of this Row or Column");for(this._splitter[o]&&(this._splitter[o]._$destroy(),this._splitter.splice(o,1)),s=0;s<this.contentItems.length;s++)if(this.contentItems[s]!==e){var d;this.contentItems[s].config[this._dimension]=((d=this.contentItems[s].config[this._dimension])!==null&&d!==void 0?d:0)+i/(this.contentItems.length-1)}Vt.prototype.removeChild.call(this,e,t),this.contentItems.length===1&&this.config.isClosable===!0?(l=this.contentItems[0],this.contentItems=[],this.parent.replaceChild(this,l,!0)):(this.callDownwards("setSize"),this.emitBubblingEvent("stateChanged"))}replaceChild(e,t){var r=e.config[this._dimension];super.replaceChild(e,t),t.config[this._dimension]=r,this.callDownwards("setSize"),this.emitBubblingEvent("stateChanged")}setSize(){this.contentItems.length>0&&(this._calculateRelativeSizes(),this._setAbsoluteSizes()),this.emitBubblingEvent("stateChanged"),this.emit("resize")}_$init(){if(this.isInitialised!==!0){var e;for(Vt.prototype._$init.call(this),e=0;e<this.contentItems.length-1;e++)this.contentItems[e].element.after(this._createSplitter(e).element)}}_setAbsoluteSizes(){var e,t=this._calculateAbsoluteSizes();for(e=0;e<this.contentItems.length;e++)t.additionalPixel-e>0&&t.itemSizes[e]++,this._isColumn?(this.contentItems[e].element.width(t.totalWidth),this.contentItems[e].element.height(t.itemSizes[e])):(this.contentItems[e].element.width(t.itemSizes[e]),this.contentItems[e].element.height(t.totalHeight))}_calculateAbsoluteSizes(){var e,t,r=(this.contentItems.length-1)*this._splitterSize,i=(e=this.element.width())!==null&&e!==void 0?e:0,a=(t=this.element.height())!==null&&t!==void 0?t:0,o=0,s=[];this._isColumn?a-=r:i-=r;for(var l=0;l<this.contentItems.length;l++){var d,u,c=this._isColumn?Math.floor(a*(((d=this.contentItems[l].config.height)!==null&&d!==void 0?d:0)/100)):Math.floor(i*(((u=this.contentItems[l].config.width)!==null&&u!==void 0?u:0)/100));o+=c,s.push(c)}var m=Math.floor((this._isColumn?a:i)-o);return{itemSizes:s,additionalPixel:m,totalWidth:i,totalHeight:a}}_calculateRelativeSizes(){for(var e=0,t=[],r=this._isColumn?"height":"width",i=0;i<this.contentItems.length;i++){var a=this.contentItems[i].config[r];a!=null?e+=a:t.push(this.contentItems[i])}if(Math.round(e)===100){this._respectMinItemWidth();return}if(Math.round(e)<100&&t.length>0){for(var o=0;o<t.length;o++)t[o].config[r]=(100-e)/t.length;this._respectMinItemWidth();return}if(Math.round(e)>100)for(var s=0;s<t.length;s++)t[s].config[r]=50,e+=50;for(var l=0;l<this.contentItems.length;l++){var d;this.contentItems[l].config[r]=((d=this.contentItems[l].config[r])!==null&&d!==void 0?d:0)/e*100}this._respectMinItemWidth()}_respectMinItemWidth(){var e,t=this.layoutManager.config.dimensions&&(e=this.layoutManager.config.dimensions.minItemWidth)!==null&&e!==void 0?e:0,r=[],i=0,a=0,o=0,s=[],l;if(!(this._isColumn||!t||this.contentItems.length<=1)){for(var d=this._calculateAbsoluteSizes(),u=0;u<this.contentItems.length;u++){this.contentItems[u];var c=d.itemSizes[u];c<t?(a+=t-c,l={width:t}):(i+=c-t,l={width:c},r.push(l)),s.push(l)}if(!(a===0||a>i)){var m=a/i;o=a;for(var v=0;v<r.length;v++){l=r[v];var f=Math.round((l.width-t)*m);o-=f,l.width-=f}o!==0&&(s[s.length-1].width-=o);for(var g=0;g<this.contentItems.length;g++)this.contentItems[g].config.width=s[g].width/d.totalWidth*100}}}_createSplitter(e){var t;return t=new yC(this._isColumn,this._splitterSize,this._splitterGrabSize),t.on("drag",this._onSplitterDrag.bind(this,t),this),t.on("dragStop",this._onSplitterDragStop.bind(this,t),this),t.on("dragStart",this._onSplitterDragStart.bind(this,t),this),this._splitter.splice(e,0,t),t}_getItemsForSplitter(e){var t=this._splitter.indexOf(e);if(t<0)throw new Error("Splitter not found in RowOrColumn");return{before:this.contentItems[t],after:this.contentItems[t+1]}}_getMinimumDimensions(e){for(var t=0,r=0,i=0;i<e.length;++i){var a,o;t=Math.max((a=e[i].minWidth)!==null&&a!==void 0?a:0,t),r=Math.max((o=e[i].minHeight)!==null&&o!==void 0?o:0,r)}return{horizontal:t,vertical:r}}_onSplitterDragStart(e){var t,r,i,a,o=this._getItemsForSplitter(e),s=this.layoutManager.config.dimensions[this._isColumn?"minItemHeight":"minItemWidth"],l=this._getMinimumDimensions((t=o.before.config.content)!==null&&t!==void 0?t:[]),d=this._isColumn?l.vertical:l.horizontal,u=this._getMinimumDimensions((r=o.after.config.content)!==null&&r!==void 0?r:[]),c=this._isColumn?u.vertical:u.horizontal;this._splitterPosition=0,this._splitterMinPosition=-1*(((i=o.before.element[this._dimension]())!==null&&i!==void 0?i:0)-(d||s)),this._splitterMaxPosition=((a=o.after.element[this._dimension]())!==null&&a!==void 0?a:0)-(c||s)}_onSplitterDrag(e,t,r){var i=this._isColumn?r:t;this._splitterMaxPosition==null||this._splitterMinPosition==null||i>this._splitterMinPosition&&i<this._splitterMaxPosition&&(this._splitterPosition=i,e.element.css(this._isColumn?"top":"left",i))}_onSplitterDragStop(e){var t,r,i,a,o,s=this._getItemsForSplitter(e),l=(t=s.before.element[this._dimension]())!==null&&t!==void 0?t:0,d=(r=s.after.element[this._dimension]())!==null&&r!==void 0?r:0,u=(((i=this._splitterPosition)!==null&&i!==void 0?i:0)+l)/(l+d),c=((a=s.before.config[this._dimension])!==null&&a!==void 0?a:0)+((o=s.after.config[this._dimension])!==null&&o!==void 0?o:0);s.before.config[this._dimension]=u*c,s.after.config[this._dimension]=(1-u)*c,e.element.css({top:0,left:0}),vc(this.callDownwards.bind(this,"setSize",void 0,void 0,void 0))}}function wv(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function yv(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?wv(Object(t),!0).forEach(function(r){Ch(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):wv(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function Ch(n,e,t){return e=PD(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function PD(n){var e=OD(n,"string");return typeof e=="symbol"?e:String(e)}function OD(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class Sh extends Vt{constructor(e,t,r){super(e,yv(yv({},t),{},{type:"root"}),null,ge('<div class="lm_goldenlayout lm_item lm_root"></div>')),Ch(this,"childElementContainer",void 0),Ch(this,"_containerElement",void 0),this.isRoot=!0,this.type="root",this.childElementContainer=this.element,this._containerElement=r,this._containerElement.append(this.element)}addChild(e,t){if(this.contentItems.length>0)throw new Error("Root node can only have a single child");e=this.layoutManager._$normalizeContentItem(e,this),this.childElementContainer.append(e.element),super.addChild(e,t),this.callDownwards("setSize"),this.emitBubblingEvent("stateChanged")}setSize(e,t){var r,i;e=typeof e>"u"?(r=this._containerElement.width())!==null&&r!==void 0?r:0:e,t=typeof t>"u"?(i=this._containerElement.height())!==null&&i!==void 0?i:0:t,this.element.width(e),this.element.height(t),this.contentItems[0]&&(this.contentItems[0].element.width(e),this.contentItems[0].element.height(t))}_$getArea(){var e=super._$getArea();if(e==null)throw new Error("Unable to get root area");return e}_$highlightDropZone(e,t,r){this.layoutManager.tabDropPlaceholder.remove(),super._$highlightDropZone(e,t,r)}_$onDrop(e,t){var r;if(xr(e)&&(r=this.layoutManager.createContentItem({type:"stack",header:e.config.header||{}},this),r._$init(),r.addChild(e),e=r),!this.contentItems.length)this.addChild(e);else{var{side:i}=t,a=i==="left"||i==="right"?"row":"column",o=i==="left"||i==="right"?"width":"height",s=i==="left"||i==="top",l=this.contentItems[0];if(!(l instanceof Zl)||l.type!=a){var d=this.layoutManager.createContentItem({type:a},this);this.replaceChild(l,d),d.addChild(e,s?0:void 0,!0),d.addChild(l,s?void 0:0,!0),l.config[o]=50,e.config[o]=50,d.callDownwards("setSize")}else{var u,c=l.contentItems[s?0:l.contentItems.length-1];l.addChild(e,s?0:void 0,!0),c.config[o]=((u=c.config[o])!==null&&u!==void 0?u:0)*.5,e.config[o]=c.config[o],l.callDownwards("setSize")}}}}function Ev(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function Za(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Ev(Object(t),!0).forEach(function(r){gr(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Ev(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function gr(n,e,t){return e=DD(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function DD(n){var e=ND(n,"string");return typeof e=="symbol"?e:String(e)}function ND(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class wh extends Vt{constructor(e,t,r){var i,a,o,s,l,d,u,c,m;super(e,t,r,ge('<div class="lm_item lm_stack"></div>')),gr(this,"_activeContentItem",null),gr(this,"_header",void 0),gr(this,"childElementContainer",ge('<div class="lm_items"></div>')),gr(this,"header",void 0),gr(this,"parent",void 0),gr(this,"isStack",!0),gr(this,"_dropZones",{}),gr(this,"_dropSegment",null),gr(this,"_contentAreaDimensions",null),gr(this,"_dropIndex",void 0),gr(this,"_side",void 0),gr(this,"_sided",!1),gr(this,"config",void 0),this.parent=r,this.config=t;var v=e.config;this._side=!1,this._header={show:((i=v.settings)===null||i===void 0?void 0:i.hasHeaders)&&t.hasHeaders!==!1,popout:(a=v.settings)!==null&&a!==void 0&&a.showPopoutIcon?(o=v.labels)===null||o===void 0?void 0:o.popout:void 0,maximise:(s=v.settings)!==null&&s!==void 0&&s.showMaximiseIcon?(l=v.labels)===null||l===void 0?void 0:l.maximise:void 0,close:(d=v.settings)!==null&&d!==void 0&&d.showCloseIcon?(u=v.labels)===null||u===void 0?void 0:u.close:void 0,minimise:(c=(m=v.labels)===null||m===void 0?void 0:m.minimise)!==null&&c!==void 0?c:void 0},v.header&&(this._header=Za(Za({},this._header),v.header)),t.header&&(this._header=Za(Za({},this._header),t.header)),t.content&&t.content[0]&&t.content[0].header&&(this._header=Za(Za({},this._header),t.content[0].header)),this.header=new pi(e,this),this.element.append(this.header.element),this.element.append(this.childElementContainer),this._setupHeaderPosition(),this._$validateClosability()}setSize(){var e,t,r,i,a,o=this._header.show&&(e=(t=this.layoutManager.config.dimensions)===null||t===void 0?void 0:t.headerHeight)!==null&&e!==void 0?e:0,s=((r=this.element.width())!==null&&r!==void 0?r:0)-(this._sided?o:0),l=((i=this.element.height())!==null&&i!==void 0?i:0)-(this._sided?0:o);for(this.childElementContainer.width(s),this.childElementContainer.height(l),a=0;a<this.contentItems.length;a++)this.contentItems[a].element.width(s).height(l);this.emit("resize"),this.emitBubblingEvent("stateChanged")}_$init(){if(this.isInitialised!==!0){this.header._attachWheelListener(),super._$init();for(var e=0;e<this.contentItems.length;e++)this.header.createTab(this.contentItems[e]),this.contentItems[e]._$hide();if(this.contentItems.length>0){var t=this.contentItems[this.config.activeItemIndex||0];if(!t)throw new Error("Configured activeItemIndex out of bounds");this.setActiveContentItem(t)}}}setActiveContentItem(e){if(this.contentItems.indexOf(e)===-1)throw new Error("contentItem is not a child of this stack");this._activeContentItem!==null&&this._activeContentItem._$hide(),this._activeContentItem=e,this.header.setActiveContentItem(e),e._$show(),this.emit("activeContentItemChanged",e),this.layoutManager.emit("activeContentItemChanged",e),this.emitBubblingEvent("stateChanged")}getActiveContentItem(){return this.header.activeContentItem}addChild(e,t){e=this.layoutManager._$normalizeContentItem(e,this),super.addChild(e,t),this.childElementContainer.append(e.element),this.header.createTab(e,t),this.setActiveContentItem(e),this.callDownwards("setSize"),this._$validateClosability(),this.emitBubblingEvent("stateChanged")}removeChild(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,r=this.contentItems.indexOf(e);super.removeChild(e,t),this.header.removeTab(e),this.header.activeContentItem===e&&(this.contentItems.length>0?this.setActiveContentItem(this.contentItems[Math.max(r-1,0)]):this._activeContentItem=null),this._$validateClosability(),this.emitBubblingEvent("stateChanged")}_$validateClosability(){for(var e=this.header._isClosable(),t=0,r=this.contentItems.length;t<r;t++){var i;if(!e)break;e=(i=this.contentItems[t].config.isClosable)!==null&&i!==void 0?i:!1}this.header._$setClosable(e)}_$destroy(){Vt.prototype._$destroy.call(this),this.header._$destroy()}_$onDrop(e){if(this._dropSegment==="header"){this._resetHeaderDropZone(),this.addChild(e,this._dropIndex);return}if(this._dropSegment==="body"){this.addChild(e);return}var t=this._dropSegment==="top"||this._dropSegment==="bottom",r=this._dropSegment==="left"||this._dropSegment==="right",i=this._dropSegment==="top"||this._dropSegment==="left",a=t&&this.parent.isColumn||r&&this.parent.isRow,o=t?"column":"row",s=t?"height":"width";if(xr(e)){var l=this.layoutManager.createContentItem({type:"stack",header:e.config.header||{}},this);l._$init(),l.addChild(e),e=l}if(a){var d,u=this.parent.contentItems.indexOf(this);this.parent.addChild(e,i?u:u+1,!0),this.config[s]=((d=this.config[s])!==null&&d!==void 0?d:0)*.5,e.config[s]=this.config[s],this.parent.callDownwards("setSize")}else{var c=this.layoutManager.createContentItem({type:o},this);this.parent.replaceChild(this,c),c.addChild(e,i?0:void 0,!0),c.addChild(this,i?void 0:0,!0),this.config[s]=50,e.config[s]=50,c.callDownwards("setSize")}}_$highlightDropZone(e,t){if(this._contentAreaDimensions)for(var[r,i]of Object.entries(this._contentAreaDimensions)){var a=i.hoverArea;if(a.x1<e&&a.x2>e&&a.y1<t&&a.y2>t){r==="header"?(this._dropSegment="header",this._highlightHeaderDropZone(e)):(this._resetHeaderDropZone(),this._highlightBodyDropZone(r));return}}}_$getArea(){if(this.element.is(":visible")===!1)return null;var e=super._$getArea(this.header.element),t=super._$getArea(this.childElementContainer);if(e==null||t==null)return null;var r=t.x2-t.x1,i=t.y2-t.y1;return this._contentAreaDimensions={header:{hoverArea:{x1:e.x1,y1:e.y1,x2:e.x2,y2:e.y2},highlightArea:{x1:e.x1,y1:e.y1,x2:e.x2,y2:e.y2}}},this._activeContentItem&&this._activeContentItem.isComponent===!1?e:this.contentItems.length===0?(this._contentAreaDimensions.body={hoverArea:{x1:t.x1,y1:t.y1,x2:t.x2,y2:t.y2},highlightArea:{x1:t.x1,y1:t.y1,x2:t.x2,y2:t.y2}},super._$getArea(this.element)):(this._contentAreaDimensions.left={hoverArea:{x1:t.x1,y1:t.y1,x2:t.x1+r*.25,y2:t.y2},highlightArea:{x1:t.x1,y1:t.y1,x2:t.x1+r*.5,y2:t.y2}},this._contentAreaDimensions.top={hoverArea:{x1:t.x1+r*.25,y1:t.y1,x2:t.x1+r*.75,y2:t.y1+i*.5},highlightArea:{x1:t.x1,y1:t.y1,x2:t.x2,y2:t.y1+i*.5}},this._contentAreaDimensions.right={hoverArea:{x1:t.x1+r*.75,y1:t.y1,x2:t.x2,y2:t.y2},highlightArea:{x1:t.x1+r*.5,y1:t.y1,x2:t.x2,y2:t.y2}},this._contentAreaDimensions.bottom={hoverArea:{x1:t.x1+r*.25,y1:t.y1+i*.5,x2:t.x1+r*.75,y2:t.y2},highlightArea:{x1:t.x1,y1:t.y1+i*.5,x2:t.x2,y2:t.y2}},super._$getArea(this.element))}_highlightHeaderDropZone(e){var t,r,i,a,o,s,l,d,u,c,m,v,f,g,p,b,S=this.header.tabs.length;if(S===0){var C,y,E,T,O,N,P,R,A=this.header.element.offset();(C=this.layoutManager.dropTargetIndicator)===null||C===void 0||C.highlightArea({x1:(y=A==null?void 0:A.left)!==null&&y!==void 0?y:0,x2:((E=A==null?void 0:A.left)!==null&&E!==void 0?E:0)+100,y1:(T=(O=this.header.element.offset())===null||O===void 0?void 0:O.top)!==null&&T!==void 0?T:0,y2:((N=(P=this.header.element.offset())===null||P===void 0?void 0:P.top)!==null&&N!==void 0?N:0)+((R=this.header.element.innerHeight())!==null&&R!==void 0?R:0)});return}var M=this.header.tabsContainer,I=(t=M.get(0))===null||t===void 0?void 0:t.getBoundingClientRect(),x=(r=this.layoutManager.tabDropPlaceholder.get(0))===null||r===void 0?void 0:r.getBoundingClientRect();if(!(!I||!x)){e<I.left?e=I.left+1:e>I.right&&(e=I.right-1);var _,k;if(!(x.left<e&&e<x.right)){for(var U=0;U<S;U++){var G;if(_=this.header.tabs[U].element,k=(G=_.get(0))===null||G===void 0?void 0:G.getBoundingClientRect(),k&&k.left<e&&e<k.right){this._dropIndex=U;break}}if(_&&k&&e<k.left+k.width*.5)_.before(this.layoutManager.tabDropPlaceholder);else if(_){var Y;this._dropIndex=Math.min(((Y=this._dropIndex)!==null&&Y!==void 0?Y:0)+1,S),_.after(this.layoutManager.tabDropPlaceholder)}}var Z=(i=(a=this.layoutManager.tabDropPlaceholder.offset())===null||a===void 0?void 0:a.left)!==null&&i!==void 0?i:0;Z=Math.max(Z,(o=(s=this.header.tabsContainer.offset())===null||s===void 0?void 0:s.left)!==null&&o!==void 0?o:0);var $=Z+((l=this.layoutManager.tabDropPlaceholder.width())!==null&&l!==void 0?l:0);$=Math.min($,((d=(u=this.header.tabsContainer.offset())===null||u===void 0?void 0:u.left)!==null&&d!==void 0?d:0)+((c=this.header.tabsContainer.innerWidth())!==null&&c!==void 0?c:0)),(m=this.layoutManager.dropTargetIndicator)===null||m===void 0||m.highlightArea({x1:Z,x2:$,y1:(v=(f=this.header.element.offset())===null||f===void 0?void 0:f.top)!==null&&v!==void 0?v:0,y2:((g=(p=this.header.element.offset())===null||p===void 0?void 0:p.top)!==null&&g!==void 0?g:0)+((b=this.header.element.innerHeight())!==null&&b!==void 0?b:0)})}}_resetHeaderDropZone(){this.layoutManager.tabDropPlaceholder.remove()}_setupHeaderPosition(){var e=["right","left","bottom"].some(r=>r===this._header.show)?this._header.show:void 0;if(this.header.element.toggle(!!this._header.show),!!e&&(this._side=e,this._sided=["right","left"].indexOf(this._side.toString())>=0,this.element.removeClass("lm_left lm_right lm_bottom"),this._side&&this.element.addClass("lm_"+this._side),this.element.find(".lm_header").length&&this.childElementContainer)){var t=["right","bottom"].indexOf(this._side.toString())>=0?"before":"after";this.header.element[t](this.childElementContainer),this.callDownwards("setSize")}}_highlightBodyDropZone(e){var t,r,i=(t=this._contentAreaDimensions)===null||t===void 0||(r=t[e])===null||r===void 0?void 0:r.highlightArea;if(i){var a;(a=this.layoutManager.dropTargetIndicator)===null||a===void 0||a.highlightArea(i)}this._dropSegment=e}}const RD=Object.freeze(Object.defineProperty({__proto__:null,AbstractContentItem:Vt,Component:wC,ContentItem:Vt,Root:Sh,RowOrColumn:Zl,Stack:wh,isComponent:xr,isRoot:SC,isStack:Ns},Symbol.toStringTag,{value:"Module"}));function ui(n,e,t){return e=ID(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function ID(n){var e=FD(n,"string");return typeof e=="symbol"?e:String(e)}function FD(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class Bs{constructor(e,t){var r;ui(this,"header",void 0),ui(this,"contentItem",void 0),ui(this,"element",ge(Bs._template)),ui(this,"titleElement",void 0),ui(this,"closeElement",void 0),ui(this,"isActive",!1),ui(this,"_layoutManager",void 0),ui(this,"_dragListener",void 0),this.header=e,this.contentItem=t,this.titleElement=this.element.find(".lm_title"),this.closeElement=this.element.find(".lm_close_tab"),this.closeElement[t.config.isClosable?"show":"hide"](),this.setTitle(t.config.title),this.contentItem.on("titleChanged",this.setTitle,this),this._layoutManager=this.contentItem.layoutManager,(r=this._layoutManager.config.settings)!==null&&r!==void 0&&r.reorderEnabled&&t.config.reorderEnabled&&(this._dragListener=new $s(this.element),this._dragListener.on("dragStart",this._onDragStart,this),this.contentItem.on("destroy",this._dragListener.destroy,this._dragListener)),this._onTabClick=this._onTabClick.bind(this),this._onCloseClick=this._onCloseClick.bind(this),this._onTabContentFocusIn=this._onTabContentFocusIn.bind(this),this._onTabContentFocusOut=this._onTabContentFocusOut.bind(this),this.element.on("click",this._onTabClick),this.element.on("auxclick",this._onTabClick),this.contentItem.config.isClosable?(this.closeElement.on("click",this._onCloseClick),this.closeElement.on("mousedown",this._onCloseMousedown)):this.closeElement.remove(),this.contentItem.tab=this,this.contentItem.emit("tab",this),this.contentItem.layoutManager.emit("tabCreated",this),xr(this.contentItem)&&(this.contentItem.container._contentElement.on("focusin",this._onTabContentFocusIn).on("focusout",this._onTabContentFocusOut),this.contentItem.container.tab=this,this.contentItem.container.emit("tab",this))}setTitle(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"";this.titleElement.html(e)}setActive(e){e!==this.isActive&&(this.isActive=e,e?this.element.addClass("lm_active"):this.element.removeClass("lm_active"))}_$destroy(){this.element.off("click",this._onTabClick),this.element.off("auxclick",this._onTabClick),this.closeElement.off("click",this._onCloseClick),xr(this.contentItem)&&(this.contentItem.container._contentElement.off(),this.contentItem.container._contentElement[0].removeEventListener("click",this._onTabContentFocusIn,!0)),this._dragListener&&(this.contentItem.off("destroy",this._dragListener.destroy,this._dragListener),this._dragListener.off("dragStart",this._onDragStart),this._dragListener=void 0),this.element.remove()}_onDragStart(e,t){var r;(r=this.contentItem.parent)!==null&&r!==void 0&&r.isMaximised&&this.contentItem.parent.toggleMaximise(),this._dragListener&&new $a(e,t,this._dragListener,this._layoutManager,this.contentItem,this.header.parent)}_onTabContentFocusIn(){ge(".lm_focusin",this._layoutManager.root.element).removeClass("lm_focusin"),this.element.addClass("lm_focusin")}_onTabContentFocusOut(){xr(this.contentItem)&&!this.contentItem.container._contentElement[0].contains(document.activeElement)&&this.element.removeClass("lm_focusin")}_onTabClick(e){if(!e||e.button===0){var t,r=this.header.parent.getActiveContentItem();this.contentItem!==r&&xr(this.contentItem)?this.header.parent.setActiveContentItem(this.contentItem):xr(this.contentItem)&&!this.contentItem.container._contentElement[0].contains(document.activeElement)&&this.contentItem.container._contentElement.focus(),xr(this.contentItem)&&this.contentItem.container.emit("tabClicked",e),this.header._hideAdditionalTabsDropdown(),(t=this.element.get(0))===null||t===void 0||t.scrollIntoView({inline:"nearest"})}else e.button===1&&this.contentItem.config.isClosable&&this._onCloseClick(e)}_onCloseClick(e){e.stopPropagation(),xr(this.contentItem)?this.contentItem.container.close():this.header.parent.removeChild(this.contentItem)}_onCloseMousedown(e){e.stopPropagation()}}ui(Bs,"_template",['<li class="lm_tab">','<span class="lm_title_before"></span>','<span class="lm_title"></span>','<div class="lm_close_tab" aria-label="Close tab"></div>',"</li>"].join(""));function Ue(n,e,t){return e=_D(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function _D(n){var e=MD(n,"string");return typeof e=="symbol"?e:String(e)}function MD(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class pi extends Dn{constructor(e,t){var r,i;super(),Ue(this,"layoutManager",void 0),Ue(this,"element",ge(pi._template)),Ue(this,"tabsContainer",void 0),Ue(this,"tabDropdownContainer",void 0),Ue(this,"tabDropdownSearch",void 0),Ue(this,"tabDropdownList",null),Ue(this,"controlsContainer",void 0),Ue(this,"parent",void 0),Ue(this,"tabs",[]),Ue(this,"activeContentItem",null),Ue(this,"closeButton",null),Ue(this,"tabDropdownButton",null),Ue(this,"tabNextButton",ge(pi._nextButtonTemplate)),Ue(this,"tabPreviousButton",ge(pi._previousButtonTemplate)),Ue(this,"holdTimer",null),Ue(this,"rAF",null),Ue(this,"CLICK_TIMEOUT",500),Ue(this,"START_SPEED",.01),Ue(this,"ACCELERATION",5e-4),Ue(this,"PADDING",10),Ue(this,"SCROLL_LEFT","left"),Ue(this,"SCROLL_RIGHT","right"),Ue(this,"isDraggingTab",!1),Ue(this,"isOverflowing",!1),Ue(this,"isDropdownShown",!1),Ue(this,"dropdownKeyIndex",0),Ue(this,"_lastVisibleTabIndex",-1),Ue(this,"_tabControlOffset",void 0),this.layoutManager=e,(r=this.layoutManager.config.settings)!==null&&r!==void 0&&r.selectionEnabled&&(this.element.addClass("lm_selectable"),this.element.on("click",this._onHeaderClick.bind(this))),this.tabsContainer=this.element.find(".lm_tabs"),this.tabDropdownContainer=this.element.find(".lm_tabdropdown_list"),this.tabDropdownContainer.hide(),this.tabDropdownSearch=this.element.find(".lm_tabdropdown_search input"),this._handleFilterInput=this._handleFilterInput.bind(this),this._handleFilterKeydown=this._handleFilterKeydown.bind(this),this.tabDropdownSearch.on("input",this._handleFilterInput),this.tabDropdownSearch.on("keydown",this._handleFilterKeydown),this.controlsContainer=this.element.find(".lm_controls"),this.parent=t,this.parent.on("resize",this._updateTabSizes,this),this._handleItemPickedUp=this._handleItemPickedUp.bind(this),this._handleItemDropped=this._handleItemDropped.bind(this),this._handleNextMouseEnter=this._handleNextMouseEnter.bind(this),this._handleNextMouseLeave=this._handleNextMouseLeave.bind(this),this._handlePreviousMouseEnter=this._handlePreviousMouseEnter.bind(this),this._handlePreviousMouseLeave=this._handlePreviousMouseLeave.bind(this),this._handleScrollRepeat=this._handleScrollRepeat.bind(this),this._handleNextButtonMouseDown=this._handleNextButtonMouseDown.bind(this),this._handlePreviousButtonMouseDown=this._handlePreviousButtonMouseDown.bind(this),this._handleScrollButtonMouseDown=this._handleScrollButtonMouseDown.bind(this),this._handleScrollButtonMouseUp=this._handleScrollButtonMouseUp.bind(this),this._handleScrollEvent=this._handleScrollEvent.bind(this),this.tabNextButton.on("mousedown",this._handleNextButtonMouseDown),this.tabPreviousButton.on("mousedown",this._handlePreviousButtonMouseDown),this.tabsContainer.on("scroll",this._handleScrollEvent),this.layoutManager.on("itemPickedUp",this._handleItemPickedUp),this.layoutManager.on("itemDropped",this._handleItemDropped),this.tabsContainer.before(this.tabPreviousButton),this.tabPreviousButton=this.tabPreviousButton.find(">:first-child"),this.tabPreviousButton.hide(),this._showAdditionalTabsDropdown=this._showAdditionalTabsDropdown.bind(this),this._hideAdditionalTabsDropdown=this._hideAdditionalTabsDropdown.bind(this),this._tabControlOffset=(i=this.layoutManager.config.settings)===null||i===void 0?void 0:i.tabControlOffset,this._createControls()}createTab(e,t){for(var r=0;r<this.tabs.length;r++)if(this.tabs[r].contentItem===e)return;var i=new Bs(this,e);if(this.tabs.length===0){this.tabs.push(i),this.tabsContainer.append(i.element);return}t===void 0&&(t=this.tabs.length),t>0?this.tabs[t-1].element.after(i.element):this.tabs[0].element.before(i.element),this.tabs.splice(t,0,i),this._updateTabSizes()}removeTab(e){for(var t=0;t<this.tabs.length;t++)if(this.tabs[t].contentItem===e){this.tabs[t]._$destroy(),this.tabs.splice(t,1);return}throw new Error("contentItem is not controlled by this header")}setActiveContentItem(e){for(var t,r,i,a,o=0;o<this.tabs.length;o++)a=this.tabs[o].contentItem===e,this.tabs[o].setActive(a),a===!0&&(this.activeContentItem=e,this.parent.config.activeItemIndex=o);(t=this.tabs[(i=this.parent.config.activeItemIndex)!==null&&i!==void 0?i:0].element.get(0))===null||t===void 0||(r=t.scrollIntoView)===null||r===void 0||r.call(t,{inline:"nearest"}),this._hideAdditionalTabsDropdown(),this._updateTabSizes(),this.parent.emitBubblingEvent("stateChanged")}position(e){var t=this.parent._header.show;return t&&!this.parent._side&&(t="top"),e!==void 0&&this.parent._header.show!==e&&(this.parent._header.show=e,this.parent._setupHeaderPosition()),t}_attachWheelListener(){var e;(e=this.tabsContainer.get(0))===null||e===void 0||e.addEventListener("wheel",this._handleWheelEvent,{passive:!0})}_detachWheelListener(){var e;(e=this.tabsContainer.get(0))===null||e===void 0||e.removeEventListener("wheel",this._handleWheelEvent)}_handleWheelEvent(e){var t=e.currentTarget;if(t instanceof HTMLElement){var r=Math.abs(e.deltaY)>Math.abs(e.deltaX)?e.deltaY:e.deltaX;if(e.deltaMode===WheelEvent.DOM_DELTA_PAGE){var i;r*=(i=this.tabsContainer.innerWidth())!==null&&i!==void 0?i:1}else e.deltaMode===WheelEvent.DOM_DELTA_LINE&&(r*=100/3);t.scrollLeft+=Math.round(r)}}_handleScrollEvent(){this._checkScrollArrows()}_handleItemPickedUp(){this.isDraggingTab=!0,this.isDropdownShown&&this._hideAdditionalTabsDropdown(),this.controlsContainer.on("mouseenter",this._handleNextMouseEnter),this.tabPreviousButton.on("mouseenter",this._handlePreviousMouseEnter)}_handleItemDropped(){var e;this.isDraggingTab=!1,window.cancelAnimationFrame((e=this.rAF)!==null&&e!==void 0?e:-1),this.rAF=null,this.controlsContainer.off("mouseenter",this._handleNextMouseEnter),this.controlsContainer.off("mouseleave",this._handleNextMouseLeave),this.tabPreviousButton.off("mouseenter",this._handlePreviousMouseEnter),this.tabPreviousButton.off("mouseleave",this._handlePreviousMouseLeave)}_handleNextMouseEnter(){var e;this.controlsContainer.on("mouseleave",this._handleNextMouseLeave),this._handleScrollRepeat(this.SCROLL_RIGHT,(e=this.tabsContainer.scrollLeft())!==null&&e!==void 0?e:0)}_handlePreviousMouseEnter(){var e;this.tabPreviousButton.on("mouseleave",this._handlePreviousMouseLeave),this._handleScrollRepeat(this.SCROLL_LEFT,(e=this.tabsContainer.scrollLeft())!==null&&e!==void 0?e:0)}_handleNextMouseLeave(){var e;window.cancelAnimationFrame((e=this.rAF)!==null&&e!==void 0?e:-1),this.rAF=null,this.controlsContainer.off("mouseleave",this._handleNextMouseLeave)}_handlePreviousMouseLeave(){var e;window.cancelAnimationFrame((e=this.rAF)!==null&&e!==void 0?e:-1),this.rAF=null,this.tabPreviousButton.off("mouseleave",this._handlePreviousMouseLeave)}_handleNextButtonMouseDown(){for(var e,t=0;t<this.tabs.length;t+=1){var r,i,a,o,s;if(((r=(i=this.tabs[t].element.get(0))===null||i===void 0?void 0:i.offsetLeft)!==null&&r!==void 0?r:0)>((a=(o=this.tabsContainer.get(0))===null||o===void 0?void 0:o.offsetWidth)!==null&&a!==void 0?a:0)+((s=this.tabsContainer.scrollLeft())!==null&&s!==void 0?s:0)){e=this.tabs[t].element.get(0);break}}if(e)e.scrollIntoView({behavior:"smooth",inline:"nearest"}),this._handleScrollButtonMouseDown(this.SCROLL_RIGHT);else{var l=this.tabsContainer.get(0);if(l){var d,u;l.scrollLeft=(d=(u=this.tabsContainer.get(0))===null||u===void 0?void 0:u.scrollWidth)!==null&&d!==void 0?d:0}}}_handlePreviousButtonMouseDown(){for(var e,t=this.tabs.length-1;t>=0;t-=1){var r,i,a;if(((r=(i=this.tabs[t].element.get(0))===null||i===void 0?void 0:i.offsetLeft)!==null&&r!==void 0?r:0)<((a=this.tabsContainer.scrollLeft())!==null&&a!==void 0?a:0)){e=this.tabs[t].element.get(0);break}}if(e)e.scrollIntoView({behavior:"smooth",inline:"start"}),this._handleScrollButtonMouseDown(this.SCROLL_LEFT);else{var o=this.tabsContainer.get(0);o&&(o.scrollLeft=0)}}_handleScrollButtonMouseDown(e){this.holdTimer=window.setTimeout(()=>{var t;this._handleScrollRepeat(e,(t=this.tabsContainer.scrollLeft())!==null&&t!==void 0?t:0,100)},this.CLICK_TIMEOUT),window.addEventListener("mouseup",this._handleScrollButtonMouseUp)}_handleScrollButtonMouseUp(){var e,t;clearTimeout((e=this.holdTimer)!==null&&e!==void 0?e:-1),this.holdTimer=null,cancelAnimationFrame((t=this.rAF)!==null&&t!==void 0?t:-1),this.rAF=null,window.removeEventListener("mouseup",this._handleScrollButtonMouseUp)}_checkScrollArrows(){var e,t,r;this.tabsContainer.scrollLeft()===0?this.tabPreviousButton.first().prop("disabled",!0):((e=this.tabsContainer.scrollLeft())!==null&&e!==void 0?e:0)+((t=this.tabsContainer.innerWidth())!==null&&t!==void 0?t:0)===((r=this.tabsContainer.get(0))===null||r===void 0?void 0:r.scrollWidth)?this.tabNextButton.prop("disabled",!0):(this.tabNextButton.prop("disabled",!1),this.tabPreviousButton.first().prop("disabled",!1))}_handleScrollRepeat(e,t){var r,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,a=arguments.length>3?arguments[3]:void 0,o=this.tabsContainer.get(0);if(o){var s=o.getBoundingClientRect();if(e===this.SCROLL_LEFT){if(this.tabsContainer.scrollLeft(t-i),this.isDraggingTab&&this.parent._highlightHeaderDropZone(s.left-1),this.tabsContainer.scrollLeft()===0){this._checkScrollArrows();return}}else if(e===this.SCROLL_RIGHT){var l,d;if(this.tabsContainer.scrollLeft(t+i),this.isDraggingTab&&this.parent._highlightHeaderDropZone(s.right+1),((l=this.tabsContainer.scrollLeft())!==null&&l!==void 0?l:0)+((d=this.tabsContainer.innerWidth())!==null&&d!==void 0?d:0)===o.scrollWidth){this._checkScrollArrows();return}}window.cancelAnimationFrame((r=this.rAF)!==null&&r!==void 0?r:-1),this.rAF=window.requestAnimationFrame(u=>{var c,m,v=a||u,f=u-v,g=this.START_SPEED*f+.5*this.ACCELERATION*(f*f);g=Math.min(g,(c=(m=this.tabsContainer.get(0))===null||m===void 0?void 0:m.scrollWidth)!==null&&c!==void 0?c:1/0),this._handleScrollRepeat(e,t,g,v)})}}_$setClosable(e){return this.closeButton&&this._isClosable()?(this.closeButton.element[e?"show":"hide"](),!0):!1}_$destroy(){this.emit("destroy",this);for(var e=0;e<this.tabs.length;e++)this.tabs[e]._$destroy();this._detachWheelListener(),this._handleItemDropped(),ge(document).off("mouseup",this._hideAdditionalTabsDropdown),this.tabDropdownSearch.off("input",this._handleFilterInput),this.tabDropdownSearch.off("keydown",this._handleFilterKeydown),this.element.remove()}_getHeaderSetting(e){if(e in this.parent._header)return this.parent._header[e]}_createControls(){var e,t,r,i,a;if(a=this.layoutManager.config.labels.tabDropdown,this.layoutManager.config.labels.tabNextLabel,this.layoutManager.config.labels.tabPreviousLabel,this.tabDropdownButton=new ls(this,a,"lm_tabdropdown",this._showAdditionalTabsDropdown),this.tabDropdownButton.element.hide(),this.controlsContainer.prepend(this.tabNextButton),this.tabNextButton.hide(),this._getHeaderSetting("popout")&&(t=this._onPopoutClick.bind(this),r=this._getHeaderSetting("popout"),new ls(this,r,"lm_popout",t)),this._getHeaderSetting("maximise")){i=this.parent.toggleMaximise.bind(this.parent);var o=this._getHeaderSetting("maximise"),s=this._getHeaderSetting("minimise"),l=new ls(this,o,"lm_maximise",i);this.parent.on("maximised",function(){l.element.attr("title",s??"")}),this.parent.on("minimised",function(){l.element.attr("title",o??"")})}this._isClosable()&&(e=this.parent.remove.bind(this.parent),r=this._getHeaderSetting("close"),this.closeButton=new ls(this,r,"lm_close",e))}_showAdditionalTabsDropdown(){if(this.isDropdownShown){this._hideAdditionalTabsDropdown();return}this.tabDropdownList=this.tabsContainer.clone(!0).appendTo(this.tabDropdownContainer).children().removeClass("lm_active"),ge(document.body).append(this.tabDropdownContainer),this.tabDropdownContainer.show(),this.isDropdownShown=!0,this.element.addClass("lm_dropdown_open"),this.tabDropdownSearch.val("").focus(),this.dropdownKeyIndex=0,this.tabDropdownList.eq(this.dropdownKeyIndex).addClass("lm_keyboard_active"),ge(document).on("mousedown",this._hideAdditionalTabsDropdown),this._updateAdditionalTabsDropdown()}_handleFilterKeydown(e){if(e.key==="Escape"){this._hideAdditionalTabsDropdown();return}if(this.dropdownKeyIndex===-1)return;if(e.key==="Enter"||e.key===" "){this._hideAdditionalTabsDropdown(),this.tabs[this.dropdownKeyIndex]._onTabClick();return}function t(s,l,d){if(d==null||d.length<2)return-1;for(var u=(s+l+d.length)%d.length;u!==s;){if(d.eq(u).css("display")!=="none")return u;u=(u+l+d.length)%d.length}return s}if(e.key==="ArrowDown"||e.key==="Tab"&&e.shiftKey===!1){var r,i;e.preventDefault(),(r=this.tabDropdownList)===null||r===void 0||r.eq(this.dropdownKeyIndex).removeClass("lm_keyboard_active"),this.dropdownKeyIndex=t(this.dropdownKeyIndex,1,this.tabDropdownList),(i=this.tabDropdownList)===null||i===void 0||i.eq(this.dropdownKeyIndex).addClass("lm_keyboard_active")}else if(e.key==="ArrowUp"||e.key==="Tab"){var a,o;e.preventDefault(),(a=this.tabDropdownList)===null||a===void 0||a.eq(this.dropdownKeyIndex).removeClass("lm_keyboard_active"),this.dropdownKeyIndex=t(this.dropdownKeyIndex,-1,this.tabDropdownList),(o=this.tabDropdownList)===null||o===void 0||o.eq(this.dropdownKeyIndex).addClass("lm_keyboard_active")}}_handleFilterInput(e){if(this.tabDropdownList!=null){this.tabDropdownList.eq(this.dropdownKeyIndex).removeClass("lm_keyboard_active"),this.dropdownKeyIndex=-1;for(var t=0;t<this.tabDropdownList.length;t++){var r,i;((r=(i=this.tabs[t].contentItem.config.title)===null||i===void 0?void 0:i.toLowerCase().indexOf(e.target.value.toLowerCase()))!==null&&r!==void 0?r:-1)!==-1?(this.tabDropdownList.eq(t).css("display",""),this.dropdownKeyIndex===-1&&(this.dropdownKeyIndex=t)):this.tabDropdownList.eq(t).css("display","none")}this.dropdownKeyIndex!==-1&&this.tabDropdownList.eq(this.dropdownKeyIndex).addClass("lm_keyboard_active")}}_hideAdditionalTabsDropdown(e){var t,r;this.isDropdownShown&&(e&&(t=this.tabDropdownContainer.get(0))!==null&&t!==void 0&&t.contains(e.target)||e&&((r=this.tabDropdownButton)===null||r===void 0?void 0:r.element.get(0))===e.target||(this.element.removeClass("lm_dropdown_open"),this.tabDropdownContainer.hide(),this.isDropdownShown=!1,this.element.append(this.tabDropdownContainer),this.tabDropdownContainer.find(".lm_tabs").remove(),ge(document).off("mousedown",this._hideAdditionalTabsDropdown)))}_updateAdditionalTabsDropdown(){var e,t,r,i;if(this.isDropdownShown&&!(!this.tabDropdownList||this.tabDropdownList.length==0)){var a=(e=(t=this.tabDropdownContainer.get(0))===null||t===void 0?void 0:t.scrollHeight)!==null&&e!==void 0?e:0;if(a!==0){var o=this.tabDropdownContainer[0].getBoundingClientRect(),s=(r=ge(window).height())!==null&&r!==void 0?r:0,l=(i=ge(window).width())!==null&&i!==void 0?i:0;if(this.tabDropdownButton){var d=this.tabDropdownButton.element[0].getBoundingClientRect(),u=a<s-d.bottom,c=!u&&d.bottom>s*.6,m=Math.min(d.left+(c?d.width:0),l-o.width-this.PADDING),v=c?Math.max(d.top-a,this.PADDING):d.bottom,f=s-v-this.PADDING;this.tabDropdownContainer.css({"max-height":f,top:v,left:m})}}}}_isClosable(){return!!(this.parent.config.isClosable&&this.layoutManager.config.settings.showCloseIcon)}_onPopoutClick(){if(this.layoutManager.config.settings.popoutWholeStack===!0)this.parent.popout();else{var e;(e=this.activeContentItem)===null||e===void 0||e.popout()}}_onHeaderClick(e){e.target===this.element[0]&&this.parent.select()}_updateTabSizes(){if(this.tabs.length!==0){var e=this.tabsContainer.get(0);if(this.isDropdownShown&&this._updateAdditionalTabsDropdown(),!!e){if(!this.isOverflowing&&e.scrollWidth>e.clientWidth){var t;(t=this.tabDropdownButton)===null||t===void 0||t.element.show(),this.tabNextButton.show(),this.tabPreviousButton.show(),this.isOverflowing=!0}else if(this.isOverflowing&&e.scrollWidth<=e.clientWidth){var r;(r=this.tabDropdownButton)===null||r===void 0||r.element.hide(),this.tabNextButton.hide(),this.tabPreviousButton.hide(),this.isOverflowing=!1}this.isOverflowing&&this._checkScrollArrows()}}}}Ue(pi,"_template",['<div class="lm_header">','<ul class="lm_tabs"></ul>','<ul class="lm_controls"></ul>','<ul class="lm_tabdropdown_list">','<li class="lm_tabdropdown_search"><input type="text" placeholder="Find tab..."></li>',"</ul>","</div>"].join(""));Ue(pi,"_previousButtonTemplate",['<ul class="lm_controls">','<li class="lm_tabpreviousbutton"></li>',"</ul>"].join(""));Ue(pi,"_nextButtonTemplate",['<li class="lm_tabnextbutton"></li>'].join(""));function Ko(n,e,t){return e=xD(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function xD(n){var e=AD(n,"string");return typeof e=="symbol"?e:String(e)}function AD(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class yC{constructor(e,t,r){Ko(this,"_isVertical",void 0),Ko(this,"_size",void 0),Ko(this,"_grabSize",void 0),Ko(this,"_dragListener",void 0),Ko(this,"element",void 0),this._isVertical=e,this._size=t,this._grabSize=r<t?t:r,this.element=this._createElement(),this._dragListener=new $s(this.element)}on(e,t,r){var i;(i=this._dragListener)===null||i===void 0||i.on(e,t,r)}_$destroy(){var e;(e=this._dragListener)===null||e===void 0||e.destroy(),this._dragListener=null,this.element.remove()}_createElement(){var e=ge('<div class="lm_drag_handle"></div>'),t=ge('<div class="lm_splitter"></div>');t.append(e);var r=this._grabSize-this._size,i=r/2;return this._isVertical?(e.css("top",-i),e.css("height",this._size+r),t.addClass("lm_vertical"),t.height(this._size)):(e.css("left",-i),e.css("width",this._size+r),t.addClass("lm_horizontal"),t.width(this._size)),t}}const LD=Object.freeze(Object.defineProperty({__proto__:null,BrowserPopout:gC,DragProxy:$a,DragSource:pC,DragSourceFromEvent:bC,DropTargetIndicator:Hs,Header:pi,HeaderButton:ls,Splitter:yC,Tab:Bs},Symbol.toStringTag,{value:"Module"}));var kD={config:xO,container:$O,controls:LD,errors:bD,items:RD,utils:tD};const jD=kD;function Tv(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function cr(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Tv(Object(t),!0).forEach(function(r){We(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Tv(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function We(n,e,t){return e=$D(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function $D(n){var e=HD(n,"string");return typeof e=="symbol"?e:String(e)}function HD(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class EC extends Dn{static minifyConfig(e){return pc(e)}static unminifyConfig(e){return ph(e)}constructor(e,t){super(),We(this,"isInitialised",!1),We(this,"_isFullPage",!1),We(this,"_resizeTimeoutId",void 0),We(this,"_components",{"lm-react-component":vC}),We(this,"_fallbackComponent",void 0),We(this,"_itemAreas",[]),We(this,"_maximisedItem",null),We(this,"_maximisePlaceholder",ge('<div class="lm_maximise_place"></div>')),We(this,"_creationTimeoutPassed",!1),We(this,"_subWindowsCreated",!1),We(this,"_dragSources",[]),We(this,"_updatingColumnsResponsive",!1),We(this,"_firstLoad",!0),We(this,"_reactChildMap",new Map),We(this,"_reactChildren",null),We(this,"width",null),We(this,"height",null),We(this,"root",void 0),We(this,"openPopouts",[]),We(this,"selectedItem",null),We(this,"isSubWindow",!1),We(this,"eventHub",new fC(this)),We(this,"config",void 0),We(this,"container",void 0),We(this,"_originalContainer",void 0),We(this,"dropTargetIndicator",null),We(this,"tabDropPlaceholder",ge('<div class="lm_drop_tab_placeholder"></div>')),We(this,"_typeToItem",void 0),this._onResize=this._onResize.bind(this),this._onUnload=this._onUnload.bind(this),this._windowBlur=this._windowBlur.bind(this),this._windowFocus=this._windowFocus.bind(this),this.config=this._createConfig(e),this._originalContainer=t,this.container=this._getContainer(),this.isSubWindow&&ge("body").css("visibility","hidden"),this._typeToItem={column:Zl.bind(this,!0),row:Zl.bind(this,!1),stack:wh,component:wC}}registerComponent(e,t){if(typeof t!="function"&&(t==null||t.render==null||typeof t.render!="function"))throw new Error("Please register a constructor function");if(this._components[e]!==void 0)throw new Error("Component "+e+" is already registered");this._components[e]=t;var r=()=>{if(this._components[e]===void 0)throw new Error("Component "+e+" is not registered");delete this._components[e]};return r}setFallbackComponent(e){this._fallbackComponent=e}toConfig(e){if(this.isInitialised===!1)throw new Error("Can't create config, layout not yet initialised");if(e&&!(e instanceof Vt))throw new Error("Root must be a ContentItem");var t={settings:cr({},this.config.settings),dimensions:cr({},this.config.dimensions),labels:cr({},this.config.labels),content:[]},r=function a(o,s){for(var l in s.config)l!=="content"&&(o[l]=s.config[l]);if(o.componentName==="lm-react-component"&&(o.type="react-component"),s.contentItems.length){o.content=[];for(var d=0;d<s.contentItems.length;d++)o.content[d]={},a(o.content[d],s.contentItems[d])}};e?r(t,{contentItems:[e]}):r(t,this.root),this._$reconcilePopoutWindows(),t.openPopouts=[];for(var i=0;i<this.openPopouts.length;i++)t.openPopouts.push(this.openPopouts[i].toConfig());return t.maximisedItemId=this._maximisedItem?"__glMaximised":void 0,t}getComponent(e){return this._components[e]}getFallbackComponent(){return this._fallbackComponent}init(){if(this._subWindowsCreated===!1&&(this._createSubWindows(),this._subWindowsCreated=!0),document.readyState==="loading"||document.body===null){ge(document).ready(this.init.bind(this));return}if(this.isSubWindow===!0&&this._creationTimeoutPassed===!1){setTimeout(this.init.bind(this),7),this._creationTimeoutPassed=!0;return}this.isSubWindow===!0&&this._adjustToWindowMode(),this._setContainer(),this.dropTargetIndicator=new Hs,this.updateSize(),this._create(this.config),this._bindEvents(),this.isInitialised=!0,this._adjustColumnsResponsive(),this.emit("initialised")}addReactChild(e,t){this._reactChildMap.set(e,t),this._reactChildren=[...this._reactChildMap.values()],this.emit("reactChildrenChanged")}removeReactChild(e,t){var r=this._reactChildMap.get(e);r===t&&(this._reactChildMap.delete(e),this._reactChildren=[...this._reactChildMap.values()],this.emit("reactChildrenChanged"))}getReactChildren(){return this._reactChildren}updateSize(e,t){var r,i;if(this.width=(r=e??this.container.width())!==null&&r!==void 0?r:0,this.height=(i=t??this.container.height())!==null&&i!==void 0?i:0,this.isInitialised===!0){if(this.root.callDownwards("setSize",[this.width,this.height]),this._maximisedItem){var a,o;this._maximisedItem.element.width((a=this.container.width())!==null&&a!==void 0?a:0),this._maximisedItem.element.height((o=this.container.height())!==null&&o!==void 0?o:0),this._maximisedItem.callDownwards("setSize")}this._adjustColumnsResponsive()}}destroy(){var e;this.isInitialised===!1||!this.root||(this._onUnload(),ge(window).off("resize",this._onResize),ge(window).off("unload beforeunload",this._onUnload),ge(window).off("blur.lm").off("focus.lm"),this.root.callDownwards("_$destroy",[],!0),this.root.contentItems=[],this.tabDropPlaceholder.remove(),(e=this.dropTargetIndicator)===null||e===void 0||e.destroy(),this.eventHub.destroy(),this._dragSources.forEach(function(t){t._dragListener.destroy()}),this._dragSources=[])}createContentItem(e,t){var r,i;if(typeof e.type!="string")throw new Da("Missing parameter 'type'",e);if(e.type==="react-component"&&(e.type="component",e.componentName="lm-react-component"),!this._typeToItem[e.type])throw r="Unknown type '"+e.type+"'. Valid types are "+Object.keys(this._typeToItem).join(","),new Da(r);return e.type==="component"&&!(t instanceof wh)&&t&&!(this.isSubWindow===!0&&t instanceof Sh)&&(e={type:"stack",width:e.width,height:e.height,content:[e]}),i=new this._typeToItem[e.type](this,e,t),i}createPopout(e,t,r,i){var a=[],o=e instanceof Vt,s=this;if(o){var l;a=this.toConfig(e).content,r=fc();for(var d=e.parent,u=e;((c=d)===null||c===void 0?void 0:c.contentItems.length)===1&&!d.isRoot;){var c;u=d,d=d.parent}if((l=d)===null||l===void 0||l.addId(r),i==null||Number.isNaN(i)){var m;i=(m=d)===null||m===void 0?void 0:m.contentItems.indexOf(u)}}else e instanceof Array?a=e:a=[e];if(!t&&o){var v,f,g,p=window.screenX||window.screenLeft,b=window.screenY||window.screenTop,S=(v=e.element.offset())!==null&&v!==void 0?v:{left:0,top:0};t={left:p+S.left,top:b+S.top,width:(f=e.element.width())!==null&&f!==void 0?f:0,height:(g=e.element.height())!==null&&g!==void 0?g:0}}if(!t&&!o&&(t={left:window.screenX||window.screenLeft+20,top:window.screenY||window.screenTop+20,width:500,height:309}),o&&e.remove(),!(!t||!r||i===void 0)){var C=new gC(a,t,r,i,this);return C.on("initialised",function(){s.emit("windowOpened",C)}),C.on("closed",function(){s._$reconcilePopoutWindows()}),this.openPopouts.push(C),C}}createDragSource(e,t){this.config.settings.constrainDragToContainer=!1;var r=new pC(e,t,this);return this._dragSources.push(r),r}createDragSourceFromEvent(e,t){return this.config.settings.constrainDragToContainer=!1,new bC(e,this,t)}selectItem(e,t){if(this.config.settings.selectionEnabled!==!0)throw new Error("Please set selectionEnabled to true to use this feature");e!==this.selectedItem&&(this.selectedItem!==null&&this.selectedItem.deselect(),e&&t!==!0&&e.select(),this.selectedItem=e,this.emit("selectionChanged",e))}_$maximiseItem(e){var t,r;this._maximisedItem!==null&&this._$minimiseItem(this._maximisedItem),this._maximisedItem=e,this._maximisedItem.addId("__glMaximised"),e.element.addClass("lm_maximised"),e.element.after(this._maximisePlaceholder),this.root.element.prepend(e.element),e.element.width((t=this.container.width())!==null&&t!==void 0?t:0),e.element.height((r=this.container.height())!==null&&r!==void 0?r:0),e.callDownwards("setSize"),this._maximisedItem.emit("maximised"),this.emit("stateChanged")}_$minimiseItem(e){var t;e.element.removeClass("lm_maximised"),e.removeId("__glMaximised"),this._maximisePlaceholder.after(e.element),this._maximisePlaceholder.remove(),(t=e.parent)===null||t===void 0||t.callDownwards("setSize"),this._maximisedItem=null,e.emit("minimised"),this.emit("stateChanged")}_$closeWindow(){window.setTimeout(function(){window.close()},1)}_$getArea(e,t){for(var r=1/0,i=null,a=0;a<this._itemAreas.length;a++){var o=this._itemAreas[a];e>o.x1&&e<o.x2&&t>o.y1&&t<o.y2&&r>o.surface&&(r=o.surface,i=o)}return i}_$createRootItemAreas(){var e=50,t=cr({},this.root._$getArea()),r=[cr(cr({},t),{},{side:"left",x2:t.x1+e}),cr(cr({},t),{},{side:"right",x1:t.x2-e}),cr(cr({},t),{},{side:"top",y2:t.y1+e}),cr(cr({},t),{},{side:"bottom",y1:t.y2-e})];r.forEach(i=>{i.surface=(i.x2-i.x1)*(i.y2-i.y1)}),this._itemAreas.push(...r)}_$calculateItemAreas(){var e=this._getAllContentItems();if(this._itemAreas=[],e.length===1){this._itemAreas.push(this.root._$getArea());return}this._$createRootItemAreas();for(var t=0;t<e.length;t++){var r=e[t];if(Ns(r)){var i=r._$getArea();if(i!==null)if(i instanceof Array)this._itemAreas=this._itemAreas.concat(i);else{var a;this._itemAreas.push(i);var o=cr(cr({},i),(a=i.contentItem._contentAreaDimensions)===null||a===void 0?void 0:a.header.highlightArea);o.surface=(o.x2-o.x1)*(o.y2-o.y1),this._itemAreas.push(o)}}}}_$normalizeContentItem(e,t){if(!e)throw new Error("No content item defined");if(typeof e=="function"&&(e=e()),e instanceof Vt)return e;if(ge.isPlainObject(e)&&e.type){var r=this.createContentItem(e,t);return r.callDownwards("_$init"),r}else throw new Error("Invalid contentItem")}_$reconcilePopoutWindows(){for(var e=[],t=0;t<this.openPopouts.length;t++){var r;((r=this.openPopouts[t].getWindow())===null||r===void 0?void 0:r.closed)===!1?e.push(this.openPopouts[t]):this.emit("windowClosed",this.openPopouts[t])}this.openPopouts.length!==e.length&&(this.emit("stateChanged"),this.openPopouts=e)}_getAllContentItems(){var e=[],t=r=>{if(e.push(r),r.contentItems instanceof Array)for(var i=0;i<r.contentItems.length;i++)t(r.contentItems[i])};return t(this.root),e}_bindEvents(){this._isFullPage&&ge(window).resize(this._onResize),ge(window).on("unload beforeunload",this._onUnload).on("blur.lm",this._windowBlur).on("focus.lm",this._windowFocus)}_windowBlur(){this.root.element.addClass("lm_window_blur")}_windowFocus(){this.root.element.removeClass("lm_window_blur")}_onResize(){clearTimeout(this._resizeTimeoutId),this._resizeTimeoutId=window.setTimeout(this.updateSize.bind(this),100)}_createConfig(e){var t,r=mC("gl-window");r&&(this.isSubWindow=!0,e=JSON.parse(localStorage.getItem(r)||"{}"),e=ph(e),localStorage.removeItem(r)),e=ge.extend(!0,{},dC,e);var i=function a(o){for(var s in o){var l=o[s];s!=="props"&&typeof l=="object"&&l!=null?a(l):s==="type"&&l==="react-component"&&(o.type="component",o.componentName="lm-react-component")}};return i(e),((t=e.settings)===null||t===void 0?void 0:t.hasHeaders)===!1&&(e.dimensions.headerHeight=0),e}_adjustToWindowMode(){var e,t=ge('<div class="lm_popin" title="'+this.config.labels.popin+'"><div class="lm_icon"></div><div class="lm_bg"></div></div>');t.click(()=>{this.emit("popIn")}),document.title=gc((e=this.config.content[0].title)!==null&&e!==void 0?e:""),ge("head").append(ge("body link, body style, template, .gl_keep")),this.container=ge("body").html("").css("visibility","visible").append(t),document.body.offsetHeight,window.__glInstance=this}_createSubWindows(){if(this.config.openPopouts)for(var e=0;e<this.config.openPopouts.length;e++){var t=this.config.openPopouts[e];this.createPopout(t.content,t.dimensions,t.parentId,t.indexInParent)}}_getContainer(){var e=this._originalContainer?ge(this._originalContainer):ge("body");if(e.length===0)throw new Error("GoldenLayout container not found");if(e.length>1)throw new Error("GoldenLayout more than one container element specified");return e}_setContainer(){var e=this._getContainer();e[0]===document.body&&(this._isFullPage=!0,ge("html, body").css({height:"100%",margin:0,padding:0,overflow:"hidden"})),this.container=e}_create(e){var t;if(!(e.content instanceof Array))throw e.content===void 0?t="Missing setting 'content' on top level of configuration":t="Configuration parameter 'content' must be an array",new Da(t,e);if(e.content.length>1)throw t="Top level content can't contain more then one element.",new Da(t,e);this.root=new Sh(this,{content:e.content},this.container),this.root.callDownwards("_$init"),e.maximisedItemId==="__glMaximised"&&this.root.getItemsById(e.maximisedItemId)[0].toggleMaximise()}_onUnload(){if(this.config.settings.closePopoutsOnUnload===!0)for(var e=0;e<this.openPopouts.length;e++)this.openPopouts[e].close()}_adjustColumnsResponsive(){if(!this._useResponsiveLayout()||this._updatingColumnsResponsive||!this.config.dimensions||!this.config.dimensions.minItemWidth||this.root.contentItems.length===0||!this.root.contentItems[0].isRow){this._firstLoad=!1;return}this._firstLoad=!1;var e=this.root.contentItems[0].contentItems.length;if(!(e<=1)){var t=this.config.dimensions.minItemWidth,r=e*t;if(!(this.width==null||r<=this.width)){this._updatingColumnsResponsive=!0;for(var i=Math.max(Math.floor(this.width/t),1),a=e-i,o=this.root.contentItems[0],s=this._findAllStackContainers()[0],l=0;l<a;l++){var d=o.contentItems[o.contentItems.length-1];this._addChildContentItemsToContainer(s,d)}this._updatingColumnsResponsive=!1}}}_useResponsiveLayout(){return this.config.settings&&(this.config.settings.responsiveMode=="always"||this.config.settings.responsiveMode=="onload"&&this._firstLoad)}_addChildContentItemsToContainer(e,t){t.type==="stack"?t.contentItems.forEach(function(r){e.addChild(r),t.removeChild(r,!0)}):t.contentItems.forEach(r=>{this._addChildContentItemsToContainer(e,r)})}_findAllStackContainers(){var e=[];return this._findAllStackContainersRecursive(e,this.root),e}_findAllStackContainersRecursive(e,t){t.contentItems.forEach(r=>{Ns(r)?e.push(r):r.isComponent||this._findAllStackContainersRecursive(e,r)})}}We(EC,"__lm",jD);const BD=EC,UD="_lm_dragging_1qalq_1",VD="_lm_goldenlayout_1qalq_1",GD="_lm_header_1qalq_1",WD="_lm_controls_1qalq_1",zD="_lm_tabpreviousbutton_1qalq_1",KD="_lm_tabnextbutton_1qalq_1",qD="_lm_tab_1qalq_1",YD="_lm_active_1qalq_1",XD="_lm_close_tab_1qalq_1",QD="_lm_content_1qalq_1",ZD="_lm_dragProxy_1qalq_1",JD="_lm_dropTargetIndicator_1qalq_1",eN="_march_1qalq_1",tN="_lm_inner_1qalq_1",rN="_lm_splitter_1qalq_1",nN="_lm_selectable_1qalq_1",iN="_lm_tabdropdown_list_1qalq_1",aN="_lm_title_1qalq_1",oN="_lm_title_before_1qalq_1",sN="_lm_selected_1qalq_1",lN="_lm_focusin_1qalq_1",dN="_lm_window_blur_1qalq_1",uN="_lm_popout_1qalq_1",hN="_lm_maximise_1qalq_1",cN="_lm_tabdropdown_1qalq_1",mN="_lm_close_1qalq_1",vN="_lm_tabdropdown_search_1qalq_1",fN="_lm_tabs_1qalq_1",gN="_lm_keyboard_active_1qalq_1",pN="_lm_maximised_1qalq_1",bN="_lm_items_1qalq_1",Pv={"tab-height":"28px","drag-border-width":"5px",lm_dragging:UD,lm_goldenlayout:VD,lm_header:GD,lm_controls:WD,lm_tabpreviousbutton:zD,lm_tabnextbutton:KD,lm_tab:qD,lm_active:YD,lm_close_tab:XD,lm_content:QD,lm_dragProxy:ZD,lm_dropTargetIndicator:JD,march:eN,lm_inner:tN,lm_splitter:rN,lm_selectable:nN,lm_tabdropdown_list:iN,lm_title:aN,lm_title_before:oN,lm_selected:sN,lm_focusin:lN,lm_window_blur:dN,lm_popout:uN,lm_maximise:hN,lm_tabdropdown:cN,lm_close:mN,lm_tabdropdown_search:vN,lm_tabs:fN,lm_keyboard_active:gN,lm_maximised:pN,lm_items:bN},Ov=Object.freeze({tabHeight:parseInt(Pv["tab-height"],10),dragBorderWidth:parseInt(Pv["drag-border-width"],10)});function Dv(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function ni(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Dv(Object(t),!0).forEach(function(r){TC(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Dv(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function TC(n,e,t){return e=CN(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function CN(n){var e=SN(n,"string");return typeof e=="symbol"?e:String(e)}function SN(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var Ri=ie.module("LayoutUtils");function PC(n){return n.componentName!==void 0}function lo(n){var e=n;return(PC(n)&&n.componentName==="lm-react-component"||n.type==="react-component")&&e.component!==void 0}function ml(n){return n.focus!==void 0}function Nv(n){return n.type==="stack"}class ee{static activateTab(e,t){var r=ee.getStackForRoot(e,t,!1);if(!r){Ri.error("Could not find stack for config",t);return}var i=ee.getContentItemInStack(r,t);i&&r.setActiveContentItem(i)}static isActiveTab(e,t){var r=ee.getStackForRoot(e,t,!1);if(!r)return Ri.error("Could not find stack for config",t),!1;var i=ee.getContentItemInStack(r,t),a=r.getActiveContentItem();return a===i}static addStack(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,r=t?"column":"row";if(SC(e)){(e.contentItems==null||e.contentItems.length===0)&&e.addChild({type:r});var i=e.contentItems[0],a=t?i.isColumn:i.isRow;if(!a){e.removeChild(i,!0),e.addChild({type:r});var o=document.activeElement;e.contentItems[0].addChild(i),o&&o.focus!=null&&o.focus()}return this.addStack(e.contentItems[0],t)}if(e.contentItems.length<2)return e.addChild({type:"stack"}),e.contentItems[e.contentItems.length-1];var s=e.contentItems[e.contentItems.length-1],l=t?s.isRow:s.isColumn;return l||(e.addChild({type:t?"row":"column"}),e.removeChild(s,!0),e.contentItems[e.contentItems.length-1].addChild(s),s=e.contentItems[e.contentItems.length-1]),this.addStack(s,!t)}static getStackForConfig(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;if(r&&Ns(e)&&e.contentItems.length===0)return e;if(e.contentItems==null)return null;for(var i=0;i<e.contentItems.length;i+=1){var a=e.contentItems[i];if(a.isComponent&&a.config!=null&&cm(a.config,t))return e;var o=this.getStackForConfig(a,t,r);if(o)return o}return null}static getStackForRoot(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,o=this.getStackForConfig(e,t);return!o&&i&&(o=this.getStackForConfig(e,{component:t.component},a)),!o&&r&&(o=this.addStack(e)),o}static getStackForComponentTypes(e,t){for(var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,o=0;o<t.length;o+=1){var s=t[o],l=o===t.length-1,d=ee.getStackForRoot(e,{component:s},r&&l,i,a);if(d)return d}return null}static getContentItemInStack(e,t){if(!e)return null;for(var r=0;r<e.contentItems.length;r+=1){var i=e.contentItems[r];if(i.isComponent&&i.config!=null&&cm(i.config,t))return i}return null}static dehydrateLayoutConfig(e,t){if(e==null||!e.length)return[];for(var r=[],i=0;i<e.length;i+=1){var a=e[i],{component:o,content:s}=a;if(o){var l=t(o,a);l!=null?r.push(l):Ri.debug2('dehydrateLayoutConfig: skipping unmapped component "'.concat(o,'"'))}else if(s){var d=ni(ni({},a),{},{content:ee.dehydrateLayoutConfig(s,t)});r.push(d)}else r.push(a)}return r}static getTabPoint(e){var{tab:t}=e;if(t==null)throw new Error("Cannot get tab for panel container ".concat(e));var r=t.element[0].getBoundingClientRect();return[r.left+r.width*.5,r.bottom-8]}static dropLayoutMinorChange(e){for(var t=0;t<e.length;t+=1){var r=e[t],{content:i}=r;i!==void 0?(Nv(r)&&delete r.activeItemIndex,ee.dropLayoutMinorChange(i)):lo(r)&&r.component==="IrisGridPanel"&&r.props.panelState!=null&&(delete r.id,r.props.panelState.irisGridState.sorts=[],r.props.panelState.irisGridState.quickFilters=[],r.props.panelState.gridState.isStuckToBottom=!1,r.props.panelState.gridState.isStuckToRight=!1)}}static isEqual(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;if(r){var i=ee.cloneLayout(e),a=ee.cloneLayout(t);return ee.dropLayoutMinorChange(i),ee.dropLayoutMinorChange(a),mt(i,a)}return mt(e,t)}static cloneLayout(e){return JSON.parse(JSON.stringify(e))}static hydrateLayoutConfig(e,t){if(e==null||!e.length)return[];for(var r=[],i=0;i<e.length;i+=1){var a=e[i];if(lo(a)){var o,{component:s,props:l={}}=a;r.push(ni(ni({},a),{},{id:(o=a==null?void 0:a.id)!==null&&o!==void 0?o:qe(),props:t(s,l)}))}else if(a.content!==void 0){var d=ee.hydrateLayoutConfig(a.content,t);Nv(a)&&a.activeItemIndex!=null&&a.activeItemIndex>=d.length&&(Ri.warn("Fixing bad activeItemIndex!",a.activeItemIndex,a),a.activeItemIndex=0),r.push(ni(ni({},a),{},{content:d}))}else r.push(a)}return r}static openComponent(){var{root:e,config:t,replaceExisting:r=!0,replaceConfig:i=void 0,createNewStack:a=!1,focusElement:o=void 0,dragEvent:s=void 0}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},l=document.activeElement,d=ni({},t);if(d.id==null&&(d.id=qe.generate()),s!=null){e==null||e.layoutManager.createDragSourceFromEvent(d,s);return}var u=i||{id:d.id,component:d.component};j(e);var c=a?ee.addStack(e):ee.getStackForRoot(e,u);j(c);var m=ee.getContentItemInStack(c,u);if(o!=null){var v=g=>{Ri.debug("Component created, focusing element",o),c.off("componentCreated",v);var{element:p}=g.origin;requestAnimationFrame(()=>{ee.focusElement(p[0],o)})};c.on("componentCreated",v)}if(r&&m){var f=c.contentItems.indexOf(m);c.addChild(d,f+1),c.removeChild(m),c.setActiveContentItem(c.contentItems[f])}else c.addChild(d);o==null&&l&&ml(l)&&l.focus()}static openComponentInStack(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,i=document.activeElement,a={id:t.id},o=ee.getContentItemInStack(e,a);if(r&&o&&e){var s=e==null?void 0:e.contentItems.indexOf(o);e.addChild(t,s+1),e.removeChild(o),e.setActiveContentItem(e.contentItems[s])}else e==null||e.addChild(t);i&&ml(i)&&i.focus()}static closeComponent(e,t,r){var i=ee.getStackForRoot(e,t,!1,!1,!1);if(!i){Ri.warn("Cannot find stack for component, ignoring close",t);return}var a=ee.getContentItemInStack(i,t),o=document.activeElement;a&&(xr(a)?a.container.close(r):i.removeChild(a)),o&&document.contains(o)&&ml(o)&&o.focus()}static renameComponent(e,t,r){var i=ee.getStackForRoot(e,t,!1);if(!i){Ri.error("Could not find stack for config",t);return}var a=ee.getContentItemInStack(i,t);a&&a.setTitle(r)}static cloneComponent(e,t){var r=ee.getStackForRoot(e,t,!1);if(!r)return Ri.error("Could not find stack for config",t),null;var{props:i={}}=t,a=ee.getPanelComponentState(t),o={type:"react-component",component:t.component,props:ni(ni({},i),{},{panelState:a}),title:"".concat(t.title," Copy"),id:qe.generate()};return ee.openComponentInStack(r,o),o}static getPanelComponentState(e){if(PC(e)){var t;return(t=e.componentState)===null||t===void 0?void 0:t.panelState}if(lo(e)){var r;return(r=e.props)===null||r===void 0?void 0:r.panelState}return null}static makeDefaultLayout(){return{dimensions:{headerHeight:Ov.tabHeight,borderWidth:Ov.dragBorderWidth,borderGrabWidth:10},settings:{showPopoutIcon:!1,showCloseIcon:!1,constrainDragToContainer:!1}}}static getRootFromContainer(e){return e.layoutManager.root}static getComponentConfigFromContainer(e){return e?e.tab!=null&&e.tab.contentItem!=null?e.tab.contentItem.config:e._config:null}static getTitleFromContainer(e){return e!=null&&e.tab!=null&&e.tab.contentItem!=null?e.tab.contentItem.config.title:null}static getTitleFromTab(e){return e!=null&&e.contentItem!=null?e.contentItem.config.title:null}static getIdFromContainer(e){var t=ee.getComponentConfigFromContainer(e);return t?t.id:null}static getIdFromPanel(e){var{glContainer:t}=e.props;return ee.getIdFromContainer(t)}static getComponentNameFromPanel(e){var{glContainer:t}=e.props,r=ee.getComponentConfigFromContainer(t);if(r&&lo(r)){var i;return(i=r.component)!==null&&i!==void 0?i:null}return null}static getComponentName(e){var t,r,i=(t=(r=e.WrappedComponent)===null||r===void 0?void 0:r.displayName)!==null&&t!==void 0?t:e.displayName;if(i==null)throw new Error("Component displayName not defined ".concat(e));return i}static focusElement(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:ee.DEFAULT_FOCUS_SELECTOR;if(e==null)return null;var r=e.querySelector(t);return r==null?null:(ml(r)&&r.focus(),r)}static onInitialized(e){return new Promise(t=>{if(e.isInitialised){t();return}var r=()=>{e.off("initialised",r),t()};e.on("initialised",r)})}}TC(ee,"DEFAULT_FOCUS_SELECTOR","input, select, textarea, button");var wN=oe.forwardRef((n,e)=>{var t=ee.getComponentNameFromPanel({props:n});return h.jsx("div",{ref:e,className:"panel-placeholder",children:h.jsxs("div",{children:['Component "',t,'" is not registered.']})})});wN.displayName="PanelPlaceholder";const Oe=Object.freeze({FOCUS:"PanelEvent.FOCUS",MOUNT:"PanelEvent.MOUNT",UNMOUNT:"PanelEvent.UNMOUNT",TITLE_CHANGED:"PanelEvent.TITLE_CHANGED",REOPEN:"PanelEvent.REOPEN",DELETE:"PanelEvent.DELETE",CLONED:"PanelEvent.CLONED",CLOSED:"PanelEvent.CLOSED",OPEN:"PanelEvent.OPEN",CLOSE:"PanelEvent.CLOSE",DRAGGING:"PanelEvent.DRAGGING",DROPPED:"PanelEvent.DROPPED"});function Jl(n){return(n==null?void 0:n.WrappedComponent)!==void 0}function yN(n){return typeof n.id=="string"&&n.layout instanceof BD&&n.panelManager instanceof Cc&&typeof n.registerComponent=="function"}function Fo(n){if(!yN(n))throw new Error("Expected dashboard plugin props, but instead received ".concat(n))}function Rv(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function Iv(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Rv(Object(t),!0).forEach(function(r){Gi(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Rv(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function Gi(n,e,t){return e=EN(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function EN(n){var e=TN(n,"string");return typeof e=="symbol"?e:String(e)}function TN(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var Yr=ie.module("PanelManager");class Cc{constructor(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:(s,l)=>l,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:(s,l)=>l,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:new Map,a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:[],o=arguments.length>5&&arguments[5]!==void 0?arguments[5]:()=>{};Gi(this,"layout",void 0),Gi(this,"hydrateComponent",void 0),Gi(this,"dehydrateComponent",void 0),Gi(this,"onPanelsUpdated",void 0),Gi(this,"closed",void 0),Gi(this,"openedMap",void 0),this.handleFocus=this.handleFocus.bind(this),this.handleMount=this.handleMount.bind(this),this.handleUnmount=this.handleUnmount.bind(this),this.handleReopen=this.handleReopen.bind(this),this.handleDeleted=this.handleDeleted.bind(this),this.handleClosed=this.handleClosed.bind(this),this.handleControlClose=this.handleControlClose.bind(this),this.layout=e,this.hydrateComponent=t,this.dehydrateComponent=r,this.onPanelsUpdated=o,this.openedMap=new Map(i),this.closed=[...a],this.startListening()}startListening(){var{eventHub:e}=this.layout;e.on(Oe.FOCUS,this.handleFocus),e.on(Oe.MOUNT,this.handleMount),e.on(Oe.UNMOUNT,this.handleUnmount),e.on(Oe.REOPEN,this.handleReopen),e.on(Oe.DELETE,this.handleDeleted),e.on(Oe.CLOSED,this.handleClosed),e.on(Oe.CLOSE,this.handleControlClose)}stopListening(){var{eventHub:e}=this.layout;e.off(Oe.FOCUS,this.handleFocus),e.off(Oe.MOUNT,this.handleMount),e.off(Oe.UNMOUNT,this.handleUnmount),e.off(Oe.REOPEN,this.handleReopen),e.off(Oe.DELETE,this.handleDeleted),e.off(Oe.CLOSED,this.handleClosed),e.off(Oe.CLOSE,this.handleControlClose)}getClosedPanelConfigsOfType(e){return this.closed.filter(t=>t.component===e)}getOpenedPanels(){return Array.from(this.openedMap.values())}getOpenedPanelConfigs(){return this.getOpenedPanels().map(e=>{var{glContainer:t}=e.props;return ee.getComponentConfigFromContainer(t)})}getOpenedPanelConfigsOfType(e){return this.getOpenedPanelConfigs().filter(t=>t!=null&&lo(t)&&t.component===e)}getOpenedPanelById(e){return this.openedMap.get(e)}getContainerByPanelId(e){var t,r=ee.getStackForConfig(this.layout.root,{id:e});return(t=r&&ee.getContentItemInStack(r,{id:e}))!==null&&t!==void 0?t:null}getLastUsedPanel(e){for(var t=this.getOpenedPanels(),r=t.length-1;r>=0;r-=1){var i=t[r];if(e==null||e(i))return i}}getLastUsedPanelOfType(e){return this.getLastUsedPanelOfTypes([e])}getLastUsedPanelOfTypes(e){return this.getLastUsedPanel(t=>e.some(r=>Jl(r)&&t instanceof r.WrappedComponent||!Jl(r)&&t instanceof r))}updatePanel(e){var t=ee.getIdFromPanel(e);if(t==null){Yr.error("updatePanel Panel did not have an ID",e);return}Yr.debug2("Updating panel ID ".concat(t," in open panels map")),this.openedMap.delete(t),this.openedMap.set(t,e)}removePanel(e){var t=ee.getIdFromPanel(e);if(t==null){Yr.error("removePanel Panel did not have an ID",e);return}if(!this.openedMap.has(t)){Yr.error("Missing panel ID ".concat(t," in open panels map"));return}if(this.openedMap.get(t)!==e){Yr.debug("Panel argument doesn't match the open panels map entry for ".concat(t,", removePanel ignored"));return}Yr.debug2("Removing panel ID ".concat(t," from open panels map")),this.openedMap.delete(t)}removeClosedPanelConfig(e){var t=this.closed.findIndex(r=>r===e||r.id!=null&&e.id!=null&&r.id===e.id);t>=0&&this.closed.splice(t,1)}handleFocus(e){Yr.debug2("Focus: ",e),this.updatePanel(e)}handleMount(e){Yr.debug2("Mount: ",e),this.updatePanel(e),this.sendUpdate()}handleUnmount(e){Yr.debug2("Unmount: ",e),this.removePanel(e),this.sendUpdate()}handleReopen(e,t){Yr.debug2("Reopen:",e,t),this.removeClosedPanelConfig(e);var{component:r}=e,{props:i}=e;i=this.hydrateComponent(r,i);var a=Iv(Iv({},e),{},{props:i}),{root:o}=this.layout;ee.openComponent({root:o,config:a,replaceConfig:t})}handleDeleted(e){Yr.debug2("Deleted:",e),this.removeClosedPanelConfig(e),this.sendUpdate()}handleClosed(e,t){Yr.debug2("Closed: ",e),this.addClosedPanel(t),this.sendUpdate()}handleControlClose(e){var t={id:e},{root:r}=this.layout;ee.closeComponent(r,t)}addClosedPanel(e){var t=ee.getComponentConfigFromContainer(e);if(t&&lo(t)){var r=this.dehydrateComponent(t.component,t);r!=null&&this.closed.push(r)}}sendUpdate(){var{closed:e,openedMap:t}=this;this.onPanelsUpdated({closed:[...e],openedMap:new Map(t)})}}Gi(Cc,"MAX_CLOSED_PANEL_COUNT",100);var PN=ie.module("PanelErrorBoundary");class ON extends w.Component{constructor(e){super(e),this.state={error:null}}componentDidCatch(e){this.setState({error:e})}componentWillUnmount(){var{glContainer:e,glEventHub:t}=this.props,r=ee.getIdFromContainer(e);PN.debug("componentWillUnmount",r),t.emit(Oe.CLOSED,r,e)}render(){var{children:e}=this.props,{error:t}=this.state;return t!=null?h.jsx("div",{className:"panel-error-boundary",children:h.jsx(As,{errorMessage:"".concat(t),isLoading:!1,isLoaded:!1})}):e}}function Fv(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function ed(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Fv(Object(t),!0).forEach(function(r){DN(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Fv(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function DN(n,e,t){return e=NN(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function NN(n){var e=RN(n,"string");return typeof e=="symbol"?e:String(e)}function RN(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function Sc(n){var{props:e,componentState:t}=n,{metadata:r}=e,{panelState:i=null}=e;t&&({panelState:i}=t);var a={};return r!=null&&(a.metadata=r),i!=null&&(a.panelState=i),ed(ed({},n),{},{componentState:null,props:a,type:"react-component"})}function wc(n){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";return ed(ed({metadata:{}},n),{},{localDashboardId:e})}function OC(n){var e=Jl(n)&&n.WrappedComponent.prototype!=null&&n.WrappedComponent.prototype.isReactComponent!=null||n.prototype!=null&&n.prototype.isReactComponent!=null,t=!Jl(n)&&"$$typeof"in n&&n.$$typeof===uy.ForwardRef;return e||t}const IN={dehydrate:Sc,hydrate:wc};var FN=oe.createContext(void 0),_N=V.shape({on:V.func,off:V.func,isHidden:V.bool,tab:V.shape({header:V.shape({tabs:V.arrayOf(V.shape({contentItem:V.shape({})}))})}),title:V.string,setTitle:V.func,close:V.func}),DC=V.shape({on:V.func,off:V.func,emit:V.func}),MN=V.shape({registerComponent:V.func,root:V.shape({addChild:V.func}),on:V.func,off:V.func,eventHub:DC}),yc=Object.freeze({Container:_N,EventHub:DC,Layout:MN});function Ye(n,e,t){w.useEffect(function(){return n.on(e,t),()=>{n.off(e,t)}},[n,e,t])}function qo(n,e,t,r){var i,a=(i=e.COMPONENT)!==null&&i!==void 0?i:e.displayName;if(a==null)throw new Error("ComponentType must have a `COMPONENT` or `displayName` attribute.");oe.useEffect(()=>{var o=n(a,e,t,r);return()=>{o()}},[e,r,t,a,n])}function _v(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function xN(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?_v(Object(t),!0).forEach(function(r){AN(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):_v(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function AN(n,e,t){return e=LN(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function LN(n){var e=kN(n,"string");return typeof e=="symbol"?e:String(e)}function kN(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var jN=Object.freeze({}),$N=new Map,NC=n=>n.api,HN=n=>n.user,RC=n=>n.storage,IC=n=>RC(n).commandHistoryStorage,FC=n=>RC(n).fileStorage,BN=n=>n.defaultWorkspaceSettings,_C=n=>{var{workspace:e}=n;return e},Us=n=>{for(var e=_C(n).data.settings,t=xN({},BN(n)),r=Object.keys(e),i=0;i<r.length;i+=1){var a=r[i];e[a]!==void 0&&(t[a]=e[a])}return t},Ec=n=>Us(n).timeZone,UN=n=>{var e;return(e=Us(n).defaultNotebookSettings)!==null&&e!==void 0?e:jN},Tc=n=>n.activeTool,VN=n=>{var e;return(e=n.plugins)!==null&&e!==void 0?e:$N},MC="SET_ACTIVE_TOOL",GN="SET_API",WN="SET_COMMAND_HISTORY_STORAGE",zN="SET_FILE_STORAGE",KN="SET_PLUGINS",qN="SET_USER",xC="SET_WORKSPACE",YN="SET_DEFAULT_WORKSPACE_SETTINGS",XN="SET_WORKSPACE_STORAGE",QN="SET_SERVER_CONFIG_VALUES";function Mv(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function va(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Mv(Object(t),!0).forEach(function(r){ZN(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Mv(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function ZN(n,e,t){return e=JN(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function JN(n){var e=eR(n,"string");return typeof e=="symbol"?e:String(e)}function eR(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var tR=n=>({type:xC,payload:n}),rR=n=>(e,t)=>{e(tR(n));var{storage:r}=t(),{workspaceStorage:i}=r;return i.save(n)},nR=n=>(e,t)=>{var{workspace:r}=t(),{data:i}=r,a=va(va({},r),{},{data:va(va(va({},i),n),{},{settings:va(va({},i.settings),n.settings)})});return e(rR(a))},iR=n=>e=>e(nR({settings:n})),AC=n=>({type:MC,payload:n});function xv(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function Hu(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?xv(Object(t),!0).forEach(function(r){aR(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):xv(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function aR(n,e,t){return e=oR(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function oR(n){var e=sR(n,"string");return typeof e=="symbol"?e:String(e)}function sR(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function LC(n,e){return function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:e,r=arguments.length>1?arguments[1]:void 0;switch(r.type){case n:{var i=r.payload;return i==null?null:t!=null?Hu(Hu({},t),i):Hu({},i)}default:return t}}}function Av(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function Lv(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Av(Object(t),!0).forEach(function(r){lR(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Av(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function lR(n,e,t){return e=dR(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function dR(n){var e=uR(n,"string");return typeof e=="symbol"?e:String(e)}function uR(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function hR(n){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;return function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:e,i=arguments.length>1?arguments[1]:void 0;switch(i.type){case n:{var{id:a,payload:o}=i;return t&&mt({payload:o},{payload:r[a]})?r:Lv(Lv({},r),{},{[a]:o})}default:return r}}}function sa(n,e){return function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:e,r=arguments.length>1?arguments[1]:void 0;switch(r.type){case n:return r.payload;default:return t}}}const cR=sa(GN,null),mR=sa(MC,null),vR=sa(KN,null),fR=sa(WN,null),gR=sa(zN,null),pR=sa(XN,null),bR=Vh({commandHistoryStorage:fR,fileStorage:gR,workspaceStorage:pR}),CR=LC(qN,null),SR=LC(xC,null),wR=sa(YN,null),yR=sa(QN,null);var ER={activeTool:mR,api:cR,plugins:vR,storage:bR,user:CR,workspace:SR,defaultWorkspaceSettings:wR,serverConfigValues:yR};const TR=ER;function kv(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function jv(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?kv(Object(t),!0).forEach(function(r){yh(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):kv(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function yh(n,e,t){return e=PR(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function PR(n){var e=OR(n,"string");return typeof e=="symbol"?e:String(e)}function OR(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class DR{constructor(){yh(this,"reducers",{}),yh(this,"listener",null)}register(e,t){var r;this.reducers=jv(jv({},this.reducers),{},{[e]:t}),(r=this.listener)===null||r===void 0||r.call(this,this.reducers)}setListener(e){this.listener=e}}var NR=new DR;const $d=NR;var $v=ie.module("redux-logger"),RR=n=>e=>t=>{$v.debug("dispatching",t);var r=e(t);return $v.debug("next state",n.getState()),r};const IR=RR;var FR=ie.module("redux-crashReporter"),_R=n=>e=>t=>{try{return e(t)}catch(r){throw FR.error("Error executing",t," with state ",n.getState(),":",r),r}};const MR=_R,xR=[IR,MR,hy];var Bu;Object.entries(TR).map(n=>{var[e,t]=n;return $d.register(e,t)});var AR=(Bu=window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__)!==null&&Bu!==void 0?Bu:vy,kC=cy(Vh($d.reducers),AR(my(...xR)));$d.setListener(n=>{kC.replaceReducer(Vh(n))});const LR=kC;var jC="SET_DASHBOARD_DATA";const kR=hR(jC,{},!1),jR={dashboardData:kR};var $R=new Map,$C=Object.freeze({}),HR=Object.freeze([]),BR=n=>n.dashboardData,Zt=(n,e)=>{var t;return(t=BR(n)[e])!==null&&t!==void 0?t:$C},UR=(n,e)=>{var t;return(t=Zt(n,e).closed)!==null&&t!==void 0?t:HR},HC=(n,e)=>{var t;return(t=Zt(n,e).openedMap)!==null&&t!==void 0?t:$R},BC=(n,e)=>{var t;return(t=Zt(n,e).pluginDataMap)!==null&&t!==void 0?t:$C},Z2=(n,e,t)=>BC(n,e)[t];function Hv(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function uo(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Hv(Object(t),!0).forEach(function(r){VR(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Hv(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function VR(n,e,t){return e=GR(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function GR(n){var e=WR(n,"string");return typeof e=="symbol"?e:String(e)}function WR(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var UC=(n,e)=>({type:jC,id:n,payload:e}),Ci=(n,e)=>(t,r)=>t(UC(n,uo(uo({},Zt(r(),n)),e))),J2=(n,e,t)=>(r,i)=>r(UC(n,uo(uo({},Zt(i(),n)),{},{pluginDataMap:uo(uo({},BC(i(),n)),{},{[e]:t})})));Object.entries(jR).map(n=>{var[e,t]=n;return $d.register(e,t)});function zR(n){var{children:e}=n;return h.jsx(h.Fragment,{children:e})}function Bv(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function Yo(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Bv(Object(t),!0).forEach(function(r){KR(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Bv(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function KR(n,e,t){return e=qR(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function qR(n){var e=YR(n,"string");return typeof e=="symbol"?e:String(e)}function YR(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var vl=ie.module("DashboardLayout"),XR=Object.freeze({}),QR=[],Uv=()=>{},Vv=n=>n;function ZR(n){var e,t,{id:r,children:i,emptyDashboard:a=h.jsx("div",{children:"Dashboard is empty."}),layout:o,layoutConfig:s=QR,onLayoutChange:l=Uv,onLayoutInitialized:d=Uv,hydrate:u=wc,dehydrate:c=Sc,panelWrapper:m=zR}=n,v=Gh(),f=(e=fy(D=>Zt(D,r)))!==null&&e!==void 0?e:XR,[g,p]=w.useState(!1),[b,S]=w.useState(!1),[C,y]=w.useState(),[E]=w.useState((t=f==null?void 0:f.closed)!==null&&t!==void 0?t:[]),[T,O]=w.useState(!1),[N,P]=w.useState(o.getReactChildren()),R=w.useMemo(()=>new Map,[]),A=w.useMemo(()=>new Map,[]),M=w.useCallback(function(D,L){var H,z=arguments.length>2&&arguments[2]!==void 0?arguments[2]:u,te=arguments.length>3&&arguments[3]!==void 0?arguments[3]:c;vl.debug2("registerComponent",D,L,z,te);function W(re,se){var Ce=L,Me=m,rt=OC(Ce),{glContainer:nt,glEventHub:Xe}=re;return h.jsx(ON,{glContainer:nt,glEventHub:Xe,children:h.jsx(Me,Yo(Yo({},re),{},{children:rt?h.jsx(Ce,Yo(Yo({},re),{},{ref:se})):h.jsx(Ce,Yo({},re))}))})}W.displayName="DashboardWrapper(".concat((H=L.displayName)!==null&&H!==void 0?H:D,")");var ne=o.registerComponent(D,oe.forwardRef(W));return R.set(D,z),A.set(D,te),ne},[u,c,R,A,o,m]),I=w.useCallback((D,L)=>{var H;return((H=R.get(D))!==null&&H!==void 0?H:Vv)(L,r)},[R,r]),x=w.useCallback((D,L)=>{var H;return((H=A.get(D))!==null&&H!==void 0?H:Vv)(L,r)},[A,r]),_=w.useMemo(()=>new Cc(o,I,x,new Map,E,D=>{var{closed:L,openedMap:H}=D;v(Ci(r,{closed:L,openedMap:H}))}),[x,v,I,r,E,o]),k=w.useCallback(()=>{if(!b){T||(d(),O(!0));var D=o.toConfig(),L=D.content,H=ee.dehydrateLayoutConfig(L,x),z=C==null||!ee.isEqual(C,H);vl.debug("handleLayoutStateChanged",z,L,H),z&&(p(o.root.contentItems.length===0),y(H),l(H),P(o.getReactChildren()))}},[x,T,b,C,o,l,d]),U=w.useCallback(D=>{var L=ee.getIdFromContainer(D);o.eventHub.emit(Oe.DRAGGING,L),S(!0)},[o.eventHub]),G=w.useCallback(D=>{var L=ee.getIdFromContainer(D);o.eventHub.emit(Oe.DROPPED,L),S(!1)},[o.eventHub]),Y=w.useCallback(D=>{if(vl.debug2("handleComponentCreated",D),!(D==null||D.config==null||D.config.component==null||D.element==null)){var L=D.config.component.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),H="".concat(L,"-component");D.element.addClass(H)}},[]),Z=w.useCallback(()=>{P(o.getReactChildren())},[o]);Ye(o,"stateChanged",k),Ye(o,"itemPickedUp",U),Ye(o,"itemDropped",G),Ye(o,"componentCreated",Y),Ye(o.eventHub,Oe.TITLE_CHANGED,k),Ye(o,"reactChildrenChanged",Z);var $=Nd(s);return w.useEffect(function(){if($!==s&&s!==C){vl.debug("Setting new layout content...");for(var L=ee.hydrateLayoutConfig(s,I);o.root.contentItems.length>0;)o.root.contentItems[0].remove();for(var H=0;H<L.length;H+=1)o.root.addChild(L[H]);p(o.root.contentItems.length===0)}},[I,o,s,C,_,$]),h.jsxs(h.Fragment,{children:[g&&a,N,oe.Children.map(i,D=>D!=null?oe.cloneElement(D,{id:r,layout:o,panelManager:_,registerComponent:M}):null)]})}ZR.propTypes={id:V.string.isRequired,children:V.node,data:V.shape({}),emptyDashboard:V.node,layout:yc.Layout.isRequired,layoutConfig:V.arrayOf(V.shape({})),onLayoutChange:V.func,onLayoutInitialized:V.func};var JR="default";function eI(n,e,t){return e=tI(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function tI(n){var e=rI(n,"string");return typeof e=="symbol"?e:String(e)}function rI(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class nI extends Error{constructor(){super(...arguments),eI(this,"isAssertionFailed",!0)}}const VC=nI;function Gv(n){if(n==null)throw new VC("Expected 'val' to be defined, but received ".concat(n))}function iI(n,e,t){return e=aI(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function aI(n){var e=oI(n,"string");return typeof e=="symbol"?e:String(e)}function oI(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class sI extends Error{constructor(){super(...arguments),iI(this,"isPasteError",!0)}}const Uu=sI;function tt(n){return(n==null?void 0:n.isEditable)!==void 0}function Wv(n){if(!tt(n))throw new VC("Expected 'model' to be editable, but received ".concat(n))}function Ke(n){return(n==null?void 0:n.hasExpandableRows)!==void 0}function ds(n,e,t){return e=lI(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function lI(n){var e=dI(n,"string");return typeof e=="symbol"?e:String(e)}function dI(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var on;(function(n){n.DOWN="DOWN",n.UP="UP",n.LEFT="LEFT",n.RIGHT="RIGHT"})(on||(on={}));class Q{static normalize(e,t,r,i){var a=e,o=t,s=r,l=i;return a!=null&&s!=null&&s<a&&(a=s,s=e),o!=null&&l!=null&&l<o&&(o=l,l=t),[a,o,s,l]}static makeNormalized(e,t,r,i){return new Q(...Q.normalize(e,t,r,i))}static makeCell(e,t){return new Q(e,t,e,t)}static makeColumn(e){return new Q(e,null,e,null)}static makeRow(e){return new Q(null,e,null,e)}static minOrNull(e,t){return e==null||t==null?null:Math.min(e,t)}static maxOrNull(e,t){return e==null||t==null?null:Math.max(e,t)}static consolidate(e){for(var t=e.slice(),r=!0;r;){r=!1;for(var i=0;i<t.length&&!r;i+=1)for(var a=t[i],o=t.length-1;o>i;o-=1){var s=t[o];if(a.contains(s))t.splice(o,1);else if(s.contains(a)){r=!0,t[i]=s,t.splice(o,1);break}else if(a.startRow===s.startRow&&a.endRow===s.endRow){if(a.touches(s)){var{startRow:l,endRow:d}=a,u=Q.minOrNull(a.startColumn,s.startColumn),c=Q.maxOrNull(a.endColumn,s.endColumn);r=!0,t[i]=new Q(u,l,c,d),t.splice(o,1);break}}else if(a.startColumn===s.startColumn&&a.endColumn===s.endColumn&&a.touches(s)){var{startColumn:m,endColumn:v}=a,f=Q.minOrNull(a.startRow,s.startRow),g=Q.maxOrNull(a.endRow,s.endRow);r=!0,t[i]=new Q(m,f,v,g),t.splice(o,1);break}}}return t}static isAxisRangeTouching(e,t,r,i){return e==null?t==null||r==null?!0:r<=t+1:t==null?i==null?!0:i>=e-1:r==null?i==null?!0:e<=i+1:i==null?t>=r-1:r>=e-1?r<=t+1:i>=e-1}static rangeArraysEqual(e,t){if(e===t)return!0;if(e==null||t==null||e.length!==t.length)return!1;for(var r=0;r<e.length;r+=1)if(!e[r].equals(t[r]))return!1;return!0}static intersection(e,t){var r,i,a,o,s,l;if(e.equals(t))return e;var{startColumn:d,startRow:u,endColumn:c,endRow:m}=e;return d=d!=null&&t.startColumn!=null?Math.max(d,t.startColumn):(r=d)!==null&&r!==void 0?r:t.startColumn,c=c!=null&&t.endColumn!=null?Math.min(c,t.endColumn):(i=c)!==null&&i!==void 0?i:t.endColumn,u=u!=null&&t.startRow!=null?Math.max(u,t.startRow):(a=u)!==null&&a!==void 0?a:t.startRow,m=m!=null&&t.endRow!=null?Math.min(m,t.endRow):(o=m)!==null&&o!==void 0?o:t.endRow,d!=null&&d>((s=c)!==null&&s!==void 0?s:-1)||u!=null&&u>((l=m)!==null&&l!==void 0?l:-1)?null:new Q(d,u,c,m)}static subtractFromRange(e,t){var r=[],i=Q.intersection(e,t);return i==null?[e]:(i.startRow!=null&&(e.startRow==null||e.startRow<i.startRow)&&r.push(new Q(e.startColumn,e.startRow,e.endColumn,i.startRow-1)),i.startColumn!=null&&(e.startColumn==null||e.startColumn<i.startColumn)&&r.push(new Q(e.startColumn,i.startRow,i.startColumn-1,i.endRow)),i.endColumn!=null&&(e.endColumn==null||e.endColumn>i.endColumn)&&r.push(new Q(i.endColumn+1,i.startRow,e.endColumn,i.endRow)),i.endRow!=null&&(e.endRow==null||e.endRow>i.endRow)&&r.push(new Q(e.startColumn,i.endRow+1,e.endColumn,e.endRow)),r)}static subtractFromRanges(e,t){for(var r=[],i=0;i<e.length;i+=1)r.push(...Q.subtractFromRange(e[i],t));return r}static subtractRangesFromRanges(e,t){for(var r=[...e],i=0;i<t.length;i+=1)r=Q.subtractFromRanges(r,t[i]);return r}static isBounded(e){return e.startRow!=null&&e.startColumn!=null&&e.endRow!=null&&e.endColumn!=null}static boundedRange(e,t,r){var i,a,o,s;return Q.isBounded(e)?e:new Q((i=e.startColumn)!==null&&i!==void 0?i:0,(a=e.startRow)!==null&&a!==void 0?a:0,(o=e.endColumn)!==null&&o!==void 0?o:t-1,(s=e.endRow)!==null&&s!==void 0?s:r-1)}static boundedRanges(e,t,r){return e.map(i=>Q.boundedRange(i,t,r))}static offset(e,t,r){return new Q(e.startColumn!=null?e.startColumn+t:null,e.startRow!=null?e.startRow+r:null,e.endColumn!=null?e.endColumn+t:null,e.endRow!=null?e.endRow+r:null)}static nextCell(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:Q.SELECTION_DIRECTION.DOWN;if(e.length===0)return null;var a=-1;if(t!=null&&r!=null&&(a=e.findIndex(m=>m.containsCell(t,r)),a>=0)){var o=e[a],s=o.nextCell(t,r,i);if(s!=null)return s}switch(i){case Q.SELECTION_DIRECTION.DOWN:case Q.SELECTION_DIRECTION.RIGHT:{var l=a<e.length-1?a+1:0,d=e[l];return d.startCell(i)}case Q.SELECTION_DIRECTION.LEFT:case Q.SELECTION_DIRECTION.UP:{var u=a>0?a-1:e.length-1,c=e[u];return c.startCell(i)}default:throw new Error("Invalid direction: ".concat(i))}}static cellCount(e){return e.reduce((t,r)=>{var i,a,o,s;return t+(((i=r.endRow)!==null&&i!==void 0?i:NaN)-((a=r.startRow)!==null&&a!==void 0?a:NaN)+1)*(((o=r.endColumn)!==null&&o!==void 0?o:NaN)-((s=r.startColumn)!==null&&s!==void 0?s:NaN)+1)},0)}static rowCount(e){return e.reduce((t,r)=>{var i,a;return t+((i=r.endRow)!==null&&i!==void 0?i:NaN)-((a=r.startRow)!==null&&a!==void 0?a:NaN)+1},0)}static columnCount(e){return e.reduce((t,r)=>{var i,a;return t+((i=r.endColumn)!==null&&i!==void 0?i:NaN)-((a=r.startColumn)!==null&&a!==void 0?a:NaN)+1},0)}static containsCell(e,t,r){for(var i=0;i<e.length;i+=1){var a=e[i];if(a.containsCell(t,r))return!0}return!1}static forEachCell(e,t){for(var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Q.SELECTION_DIRECTION.RIGHT,i=0;i<e.length;i+=1)e[i].forEach(t,r)}constructor(e,t,r,i){ds(this,"startColumn",void 0),ds(this,"startRow",void 0),ds(this,"endColumn",void 0),ds(this,"endRow",void 0),this.startColumn=e,this.startRow=t,this.endColumn=r,this.endRow=i}equals(e){return this.startColumn===e.startColumn&&this.startRow===e.startRow&&this.endColumn===e.endColumn&&this.endRow===e.endRow}contains(e){return(this.startColumn==null||e.startColumn!=null&&this.startColumn<=e.startColumn)&&(this.startRow==null||e.startRow!=null&&this.startRow<=e.startRow)&&(this.endColumn==null||e.endColumn!=null&&this.endColumn>=e.endColumn)&&(this.endRow==null||e.endRow!=null&&this.endRow>=e.endRow)}containsCell(e,t){return e==null||t==null?!1:(this.startColumn==null||this.startColumn<=e)&&(this.endColumn==null||this.endColumn>=e)&&(this.startRow==null||this.startRow<=t)&&(this.endRow==null||this.endRow>=t)}touches(e){return Q.isAxisRangeTouching(this.startRow,this.endRow,e.startRow,e.endRow)&&Q.isAxisRangeTouching(this.startColumn,this.endColumn,e.startColumn,e.endColumn)}subtract(e){return Q.subtractFromRange(this,e)}startCell(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Q.SELECTION_DIRECTION.DOWN;if(!Q.isBounded(this))throw new Error("Cannot get the startCell of an unbounded range");switch(e){case Q.SELECTION_DIRECTION.DOWN:case Q.SELECTION_DIRECTION.RIGHT:return{column:this.startColumn,row:this.startRow};case Q.SELECTION_DIRECTION.LEFT:case Q.SELECTION_DIRECTION.UP:return{column:this.endColumn,row:this.endRow};default:throw new Error("Invalid direction: ".concat(e))}}nextCell(e,t,r){if(!Q.isBounded(this))throw new Error("Bounded range required");if(e==null||t==null)throw new Error("Require a non-null cursor");var{startColumn:i,endColumn:a,startRow:o,endRow:s}=this;switch(r){case Q.SELECTION_DIRECTION.DOWN:if(t<s)return{column:e,row:Math.max(t+1,o)};if(e<a)return{column:Math.max(e+1,i),row:o};break;case Q.SELECTION_DIRECTION.UP:if(t>o)return{column:e,row:Math.min(t-1,s)};if(e>i)return{column:Math.min(e-1,a),row:s};break;case Q.SELECTION_DIRECTION.RIGHT:if(e<a)return{column:Math.max(e+1,i),row:t};if(t<s)return{column:i,row:Math.max(t+1,o)};break;case Q.SELECTION_DIRECTION.LEFT:if(e>i)return{column:Math.min(e-1,a),row:t};if(t>o)return{column:a,row:Math.min(t-1,s)};break;default:throw new Error("Invalid direction: ".concat(r))}return null}forEach(e){for(var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Q.SELECTION_DIRECTION.RIGHT,r=0,{column:i,row:a}=this.startCell(t);i!=null&&a!=null;){var o;e(i,a,r),r+=1,{column:i,row:a}=(o=this.nextCell(i,a,t))!==null&&o!==void 0?o:{}}}}ds(Q,"SELECTION_DIRECTION",on);function uI(n){return Array.isArray(n)&&n.length===2&&(n[0]===null||typeof n[0]=="number")&&(n[1]===null||typeof n[1]=="number")}function fl(n){return uI(n)&&n[0]!=null&&n[1]!=null}function zv(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function gl(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?zv(Object(t),!0).forEach(function(r){GC(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):zv(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function GC(n,e,t){return e=hI(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function hI(n){var e=cI(n,"string");return typeof e=="symbol"?e:String(e)}function cI(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function td(n){return(n==null?void 0:n.href)!==void 0}class ae{static getGridPointFromXY(e,t,r){var i=ae.getColumnAtX(e,r),a=ae.getRowAtY(t,r),o=ae.getColumnHeaderDepthAtY(t,r);return{x:e,y:t,row:a,column:i,columnHeaderDepth:o}}static getCellInfoFromXY(e,t,r){var{row:i,column:a}=ae.getGridPointFromXY(e,t,r),{allColumnWidths:o,allRowHeights:s,allColumnXs:l,allRowYs:d,modelColumns:u,modelRows:c}=r,m=i!==null?c.get(i):null,v=a!==null?u.get(a):null,f=a!==null?l.get(a):null,g=i!==null?d.get(i):null,p=a!==null?o.get(a):null,b=i!==null?s.get(i):null;return{row:i,column:a,modelRow:m??null,modelColumn:v??null,left:f??null,top:g??null,columnWidth:p??null,rowHeight:b??null}}static getColumnHeaderDepthAtY(e,t){var r=ae.getRowAtY(e,t),{columnHeaderHeight:i,columnHeaderMaxDepth:a}=t;if(r===null&&e<=i*a)return Le(a-Math.ceil(e/i),0,a-1)}static iterateFloatingStart(e,t,r){for(var i=0;i<e&&i<t;i+=1){var a=r(i);if(a!==void 0)return a}}static iterateFloatingEnd(e,t,r){for(var i=0;i<e&&t-(e-i)>=0;i+=1){var a=r(t-(e-i));if(a!==void 0)return a}}static iterateFloating(e,t,r,i){var a=ae.iterateFloatingStart(e,r,i);return a!==void 0?a:ae.iterateFloatingEnd(t,r,i)}static iterateAllItems(e,t,r,i,a,o){var s=Math.max(e,r),l=Math.min(t,a-i-1),d=ae.iterateFloating(r,i,a,o);if(d!==void 0)return d;for(var u=s;u<=l;u+=1)if(d=o(u),d!==void 0)return d}static isInItem(e,t,r,i){var a,o,s=(a=t.get(e))!==null&&a!==void 0?a:0,l=(o=r.get(e))!==null&&o!==void 0?o:0;return s<=i&&i<=s+l}static getItemAtOffset(e,t,r,i,a,o,s){var l=arguments.length>7&&arguments[7]!==void 0?arguments[7]:!1,d=l?void 0:ae.iterateFloating(r,i,t,m=>{if(ae.isInItem(m,o,s,e))return m});if(!l&&d!==void 0)return d;for(var u=0;u<a.length;u+=1){var c=a[u];if(ae.isInItem(c,o,s,e))return c}return null}static getColumnAtX(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,{columnCount:i,floatingLeftColumnCount:a,floatingRightColumnCount:o,visibleColumns:s,allColumnXs:l,allColumnWidths:d,gridX:u}=t;return e<u?null:this.getItemAtOffset(e-u,i,a,o,s,l,d,r)}static getRowAtY(e,t){var{floatingTopRowCount:r,floatingBottomRowCount:i,rowCount:a,visibleRows:o,allRowYs:s,allRowHeights:l,gridY:d}=t;return e<d?null:this.getItemAtOffset(e-d,a,r,i,o,s,l)}static getNextShownItem(e,t,r,i){var a=r.findIndex(l=>l===e)||0;for(a-=1;a!=null&&a>=0;){var o=r[a],s=t.get(o);if(s!=null&&i.get(s)!==0)return o;a-=1}return null}static getNextShownColumn(e,t){var{modelColumns:r,visibleColumns:i,userColumnWidths:a}=t;return ae.getNextShownItem(e,r,i,a)}static getNextShownRow(e,t){var{modelRows:r,visibleRows:i,userRowHeights:a}=t;return ae.getNextShownItem(e,r,i,a)}static getColumnSeparatorIndex(e,t,r,i){var{rowHeaderWidth:a,columnHeaderHeight:o,floatingColumns:s,floatingLeftWidth:l,visibleColumns:d,allColumnXs:u,allColumnWidths:c,columnHeaderMaxDepth:m}=r,{allowColumnResize:v,headerSeparatorHandleSize:f}=i;if(m*o<t||!v||f<=0)return null;for(var g=e-a,p=f*.5,b=!1,S=s.length-1;S>=0;S-=1){var C,y,E=s[S],T=(C=u.get(E))!==null&&C!==void 0?C:0,O=(y=c.get(E))!==null&&y!==void 0?y:0,N=O===0;if(!b||!N){var P=T+O;N?P+=p:b&&(P-=p);var R=P-p,A=P+p;if(R<=g&&g<=A)return E;b=N}}b=!1;for(var M=d.length-1;M>=0;M-=1){var I,x,_=d[M],k=(I=u.get(_))!==null&&I!==void 0?I:0,U=(x=c.get(_))!==null&&x!==void 0?x:0,G=U===0;if(k<l-U)return null;if(!b||!G){var Y=k+U;G?Y+=p:b&&(Y-=p);var Z=Y-p,$=Y+p;if(Z<=g&&g<=$)return _;b=G}}return null}static isItemHidden(e,t){return t.get(e)===0}static isColumnHidden(e,t){var{allColumnWidths:r}=t;return ae.isItemHidden(e,r)}static isFloatingRow(e,t){if(e==null)return!1;var{floatingTopRowCount:r,floatingBottomRowCount:i,rowCount:a}=t;return e<r||e>=a-i}static isFloatingColumn(e,t){if(e==null)return!1;var{floatingLeftColumnCount:r,floatingRightColumnCount:i,columnCount:a}=t;return e<r||e>=a-i}static getHiddenItems(e,t,r){if(!ae.isItemHidden(e,t))return[];for(var i=[e],a=r.findIndex(l=>l===e),o=a-1;o>=0;o-=1){var s=r[o];if(!ae.isItemHidden(s,t))break;i.push(s)}return i}static getHiddenColumns(e,t){var{visibleColumns:r,allColumnWidths:i}=t;return ae.getHiddenItems(e,i,r)}static getRowSeparatorIndex(e,t,r,i){var{rowHeaderWidth:a,columnHeaderHeight:o,visibleRows:s,allRowYs:l,allRowHeights:d}=r,{allowRowResize:u,headerSeparatorHandleSize:c}=i;if(a<e||!u||c<=0)return null;for(var m=t-o,v=c*.5,f=!1,g=s.length-1;g>=0;g-=1){var p,b,S=s[g],C=(p=l.get(S))!==null&&p!==void 0?p:0,y=(b=d.get(S))!==null&&b!==void 0?b:0,E=y===0;if(!f||!E){var T=C+y;E?T+=v:f&&(T-=v);var O=T-v,N=T+v;if(O<=m&&m<=N)return S;f=E}}return null}static isRowHidden(e,t){var{allRowHeights:r}=t;return ae.isItemHidden(e,r)}static getHiddenRows(e,t){var{visibleRows:r,allRowHeights:i}=t;return ae.getHiddenItems(e,i,r)}static moveItem(e,t,r){if(e===t)return[...r];var i=[...r],a=i[i.length-1];return a!=null&&!fl(a.from)&&a.to===e?a.from===t?i.pop():i[i.length-1]=gl(gl({},a),{},{to:t}):i.push({from:e,to:t}),i}static moveRange(e,t,r){var i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(e[0]===e[1])return ae.moveItem(e[0],t,r);var a=t;if(i&&e[0]<t&&(a-=e[1]-e[0]),e[0]===a)return[...r];var o=[...r],s=o[o.length-1];s!=null&&fl(s.from)&&s.from[1]-s.from[0]===e[1]-e[0]&&s.to===e[0]?o[o.length-1]=gl(gl({},s),{},{to:a}):o.push({from:e,to:a});var l=o[o.length-1];return fl(l.from)&&l.from[0]===l.to&&o.pop(),o}static moveItemOrRange(e,t,r){var i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;return Array.isArray(e)?ae.moveRange(e,t,r,i):ae.moveItem(e,t,r)}static applyItemMoves(e,t,r){for(var i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1,a=[[e,t]],o=function(){var{from:d,to:u}=r[s],c=1,m;fl(d)?(c=d[1]-d[0]+1,[m]=d):m=d;for(var v=i?u:m,f=v+c-1,g=i?m:u,p=g-v,b=[],S=function(){var E,T,O=(E=a[C][0])!==null&&E!==void 0?E:Number.NEGATIVE_INFINITY,N=(T=a[C][1])!==null&&T!==void 0?T:Number.POSITIVE_INFINITY,P,R=[[O,v-1],[v,f],[f+1,N]].map(A=>{var[M,I]=A;return[Math.max(M,O),Math.min(I,N)]}).filter(A=>{var[M,I]=A;return M<=I}).map(A=>{var[M,I]=A;return v<=M&&f>=I?(P=[M+p,I+p],P):f<M?[M-c,I-c]:A}).map(A=>{var[M,I]=A;return g>M&&g<=I?[[M,g-1],[g+c,I+c]]:A===P?[A]:g<=M?[[M+c,I+c]]:[A]}).flat();b.push(...R)},C=0;C<a.length;C+=1)S();a=b.map(y=>{var[E,T]=y;return[Number.isFinite(E)?E:null,Number.isFinite(T)?T:null]})},s=i?r.length-1:0;i?s>=0:s<r.length;i?s-=1:s+=1)o();return a}static translateRange(e,t,r,i){for(var a=ae.applyItemMoves(e.startColumn,e.endColumn,t,i),o=ae.applyItemMoves(e.startRow,e.endRow,r,i),s=[],l=0;l<a.length;l+=1)for(var d=a[l],u=0;u<o.length;u+=1){var c=o[u];s.push(new Q(d[0],c[0],d[1],c[1]))}return s}static getModelIndex(e,t){var r=ae.applyItemMoves(e,e,t,!0)[0][0];return r}static getModelIndexes(e,t){return e.map(r=>ae.getModelIndex(r,t))}static getModelRangeIndexes(e,t,r){return ae.applyItemMoves(e,t,r,!0)}static getModelRange(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Te,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Te;return ae.translateRange(e,t,r,!0)}static getModelRanges(e){for(var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Te,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Te,i=[],a=0;a<e.length;a+=1)i.push(...ae.getModelRange(e[a],t,r));return i}static getVisibleRangeIndexes(e,t,r){return ae.applyItemMoves(e,t,r,!1)}static getVisibleRange(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Te,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Te;return this.translateRange(e,t,r,!1)}static getVisibleRanges(e){for(var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Te,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Te,i=[],a=0;a<e.length;a+=1)i.push(...ae.getVisibleRange(e[a],t,r));return i}static getVisibleIndex(e,t){var r=ae.applyItemMoves(e,e,t)[0][0];return r}static getVisibleIndexes(e,t){return e.map(r=>ae.getVisibleIndex(r,t))}static isMacPlatform(){var{platform:e}=window.navigator;return e.startsWith("Mac")}static getModifierKey(){return ae.isMacPlatform()?"metaKey":"ctrlKey"}static isModifierKeyDown(e){var t=ae.getModifierKey();return e[t]}static checkColumnHidden(e,t){return t.get(e)===0}static checkAllColumnsHidden(e,t){return t.size===0?!1:e.every(r=>t.get(r)===0)}static getScrollDragBounds(e,t,r){var{gridX:i,gridY:a,width:o,height:s,floatingTopRowCount:l,floatingBottomRowCount:d,floatingLeftColumnCount:u,floatingRightColumnCount:c,floatingLeftWidth:m,floatingRightWidth:v,floatingTopHeight:f,floatingBottomHeight:g,columnCount:p,rowCount:b}=e,S=i,C=a,y=o,E=s;return r!=null&&(r>u&&(S+=m),r<p-c&&(y-=v)),t!=null&&(t>l&&(C+=f),t<b-d&&(E-=g)),{x1:S,y1:C,x2:y,y2:E}}static getScrollDelta(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1024,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:768,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:20,a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:20,{deltaX:o,deltaY:s}=e;return!ae.isMacPlatform()&&e.shiftKey&&e.deltaX===0&&e.deltaY!==0&&(o=e.deltaY,s=e.deltaX),(e==null?void 0:e.deltaMode)===WheelEvent.DOM_DELTA_PAGE?(o*=t,s*=r):(e==null?void 0:e.deltaMode)===WheelEvent.DOM_DELTA_LINE&&(ae.isMacPlatform()?(o=Math.round(o*i),s=Math.round(s*a)):(o=Math.round(o*this.PIXELS_PER_LINE),s=Math.round(s*this.PIXELS_PER_LINE))),{deltaX:o,deltaY:s}}static compareRanges(e,t){return e[0]==null||e[1]==null||t[0]==null||t[1]==null?0:e[0]!==t[0]?e[0]-t[0]:e[1]-t[1]}static mergeSortedRanges(e){for(var t=[],r=0;r<e.length;r+=1){var i=e[r],a=i[0],o=i[1];r===0?t.push([a,o]):a-1<=t[t.length-1][1]?t[t.length-1][1]=Math.max(t[t.length-1][1],o):t.push([a,o])}return t}static translateTokenBox(e,t){var{x1:r,y1:i,x2:a,y2:o}=e,{gridX:s,gridY:l,width:d,height:u,verticalBarWidth:c,horizontalBarHeight:m}=t,v=Le(s+r,s,d-c),f=Le(s+a,s,d-c),g=Le(l+i,l,u-m),p=Le(l+o,l,u-m);return{x1:v,y1:g,x2:f,y2:p,token:e.token}}static getTextRenderMetrics(e,t,r){var{metrics:i,model:a,theme:o}=e,{firstColumn:s,allColumnXs:l,allColumnWidths:d,allRowYs:u,allRowHeights:c,modelRows:m,modelColumns:v}=i,{cellHorizontalPadding:f,treeDepthIndent:g,treeHorizontalPadding:p}=o,b=B(m,r),S=B(v,t),C=a.textAlignForCell(S,b),y=B(l,t),E=B(u,r),T=B(d,t),O=B(c,r),N=t===s,P=0;Ke(a)&&a.hasExpandableRows&&N&&(P=g*(a.depthForRow(r)+1)+p);var R=T-P,A=y+f,M=E+O*.5;return C==="right"?A=y+R-f:C==="center"&&(A=y+R*.5),A+=P,{width:R-f*2,x:A,y:M}}static findTokensWithProtocolInText(e){var t=pb(e);return t.filter(r=>r.type==="url"?/^https?:\/\//.test(r.value):!0)}}GC(ae,"PIXELS_PER_LINE",100/3);const me=ae;function Rr(n,e,t){return e=mI(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function mI(n){var e=vI(n,"string");return typeof e=="symbol"?e:String(e)}function vI(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function pl(n){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Ha.CACHE_SIZE,t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Math.floor(e/2);if(n.size>e)for(var r=n.keys();n.size>t;)n.delete(r.next().value)}function Kv(n,e,t,r,i){for(var a=new Map,o=0,s=0;s<n&&s<t;s+=1)a.set(s,o),o+=B(i,s);o=r;for(var l=0;l<e&&t-l-1>=0;l+=1)o-=B(i,t-l-1),a.set(t-l-1,o);return a}class Ha{constructor(){var{userColumnWidths:e=new Map,userRowHeights:t=new Map,calculatedColumnWidths:r=new Map,calculatedRowHeights:i=new Map,fontWidths:a=new Map,modelRows:o=new Map,modelColumns:s=new Map,movedRows:l=[],movedColumns:d=[],initialRowHeights:u=new Map,initialColumnWidths:c=new Map}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Rr(this,"initialRowHeights",void 0),Rr(this,"initialColumnWidths",void 0),Rr(this,"userColumnWidths",void 0),Rr(this,"userRowHeights",void 0),Rr(this,"calculatedColumnWidths",void 0),Rr(this,"calculatedRowHeights",void 0),Rr(this,"fontWidths",void 0),Rr(this,"modelRows",void 0),Rr(this,"modelColumns",void 0),Rr(this,"movedRows",void 0),Rr(this,"movedColumns",void 0),this.userColumnWidths=e,this.userRowHeights=t,this.calculatedRowHeights=i,this.calculatedColumnWidths=r,this.fontWidths=a,this.modelRows=o,this.modelColumns=s,this.movedRows=l,this.movedColumns=d,this.initialRowHeights=u,this.initialColumnWidths=c}getMetrics(e){var{left:t,top:r,leftOffset:i,topOffset:a,width:o,height:s,theme:l,model:d,movedRows:u,movedColumns:c,draggingColumn:m}=e,{rowHeight:v,rowHeaderWidth:f,rowFooterWidth:g,columnWidth:p,columnHeaderHeight:b,minScrollHandleSize:S,scrollBarSize:C}=l;u!==this.movedRows&&(this.movedRows=u,this.modelRows.clear()),c!==this.movedColumns&&(this.movedColumns=c,this.modelColumns.clear());var{columnCount:y,rowCount:E,floatingTopRowCount:T,floatingBottomRowCount:O,floatingLeftColumnCount:N,floatingRightColumnCount:P,columnHeaderMaxDepth:R}=d,A=this.getFirstRow(e),M=this.getFirstColumn(e),I=this.getGridX(e),x=this.getGridY(e),_=Ke(d)&&d.hasExpandableRows?this.calculateTreePaddingX(e):0,k=0,U=this.getVisibleRowHeights(e),G=this.getVisibleColumnWidths(e,M,_),Y=Array.from(U.keys()),Z=Array.from(G.keys()),$=new Map([...U,...this.getFloatingRowHeights(e)]),D=new Map([...G,...this.getFloatingColumnWidths(e)]),L=this.getVisibleColumnXs(D,Z,i),H=this.getVisibleRowYs($,Y,a),z=Y.length>0?Y[Y.length-1]:r,te=Z.length>0?Z[Z.length-1]:t,W=this.getBottomViewport(e,Y,H,$),ne=this.getRightViewport(e,Z,L,D),re=this.getFloatingTopHeight(e,$),se=this.getFloatingBottomHeight(e,$),Ce=this.getFloatingLeftWidth(e,D),Me=this.getFloatingRightWidth(e,D),rt=Array.from(D.values()),nt=Array.from($.values()),Xe=rt.reduce((Rn,ma)=>Rn+ma,0)-i,ft=nt.reduce((Rn,ma)=>Rn+ma,0)-a,Nt=i+Xe+g,He=a+ft,Rt=o-I,xt=s-x,Ur=this.getLastLeft(e,null,Rt-g),Er=this.getLastLeft(e,null,Rt-g-C),Qn=this.getLastTop(e,null,xt-se),dn=this.getLastTop(e,null,xt-se-C),Tr=Er,it=dn;Ur===0&&Qn===0&&(Tr=0,it=0);var Jt=Tr>0,Vr=Jt?C:0,Pr=it>0,Gr=Pr?C:0,yi=I,Wr=R*b,zr=o-yi-Gr,hr=s-Wr-Vr,Zn=y===1?zr/Nt:(y-Tr)/y,Jn=E===1?hr/He:(E-it)/E,ei=Jt?Le(zr*Zn,S,zr-1):0,Or=Pr?Le(hr*Jn,S,hr-1):0,un=B(D,t,0),Ei=B($,r,0),ua=un>0?i/un:0,Lo=Ei>0?a/Ei:0,ko=y===1?i/(Nt-Rt):(t+ua)/Tr,jo=E===1?a/(He-xt):(r+Lo)/it,$o=Jt?ko*(zr-ei):0,at=Pr?jo*(hr-Or):0,Qs=[...Array(T).keys(),...[...Array(O).keys()].map(Rn=>E-Rn-1)],ha=new Map([...H,...this.getFloatingRowYs(e,$,Math.floor(s-x-Vr))]),Ti=[...Array(N).keys(),...[...Array(P).keys()].map(Rn=>y-Rn-1)],ca=new Map([...L,...this.getFloatingColumnXs(e,D,Math.floor(o-I-Gr))]),Ho=[];if(m)for(var Nn=m.range[0];Nn<=m.range[1];Nn+=1)Ho.push(Nn),D.has(Nn)||D.set(Nn,this.getVisibleColumnWidth(Nn,e)),ca.has(Nn)||ca.set(Nn,0);var Zs=Y.concat(Qs),Js=Z.concat(Ti).concat(Ho),Bo=this.getModelRows(Zs,e),el=this.getModelColumns(Js,e),hu=this.getVisibleRowTreeBoxes($,Bo,e),tl=this.getTopVisible(e,ha,$,Y),rl=this.getLeftVisible(e,ca,D,Z),cu=it>0?this.getBottomVisible(e,ha,$,Y,x):z,mu=Tr>0?this.getRightVisible(e,ca,D,Z,I):te,{fontWidths:vu,userColumnWidths:fu,userRowHeights:gu,calculatedRowHeights:pu,calculatedColumnWidths:nl}=this;return{rowHeight:v,rowHeaderWidth:f,rowFooterWidth:g,rowCount:E,columnWidth:p,columnCount:y,columnHeaderHeight:b,floatingTopRowCount:T,floatingBottomRowCount:O,floatingLeftColumnCount:N,floatingRightColumnCount:P,gridX:I,gridY:x,firstRow:A,firstColumn:M,treePaddingX:_,treePaddingY:k,left:t,top:r,bottom:z,right:te,topOffset:a,leftOffset:i,topVisible:tl,leftVisible:rl,bottomVisible:cu,rightVisible:mu,bottomViewport:W,rightViewport:ne,width:o,height:s,maxX:Xe,maxY:ft,lastLeft:Tr,lastTop:it,barHeight:hr,barTop:Wr,barWidth:zr,barLeft:yi,handleHeight:Or,handleWidth:ei,hasHorizontalBar:Jt,hasVerticalBar:Pr,verticalBarWidth:Gr,horizontalBarHeight:Vr,scrollX:$o,scrollY:at,scrollableContentWidth:Nt,scrollableContentHeight:He,scrollableViewportWidth:Rt,scrollableViewportHeight:xt,visibleRows:Y,visibleColumns:Z,visibleRowHeights:U,visibleColumnWidths:G,floatingRows:Qs,floatingColumns:Ti,allRows:Zs,allColumns:Js,allRowHeights:$,allColumnWidths:D,floatingTopHeight:re,floatingBottomHeight:se,floatingLeftWidth:Ce,floatingRightWidth:Me,visibleRowYs:H,visibleColumnXs:L,allRowYs:ha,allColumnXs:ca,visibleRowTreeBoxes:hu,modelRows:Bo,modelColumns:el,movedRows:u,movedColumns:c,fontWidths:vu,userColumnWidths:fu,userRowHeights:gu,calculatedRowHeights:pu,calculatedColumnWidths:nl,columnHeaderMaxDepth:R}}getGridX(e){var{theme:t}=e,{rowHeaderWidth:r}=t;return r}getGridY(e){var{theme:t,model:r}=e,{columnHeaderHeight:i}=t,{columnHeaderMaxDepth:a}=r;return a*i}getVisibleHeight(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.getFloatingRowHeights(e),{height:r,theme:i}=e,{scrollBarSize:a}=i,o=this.getGridY(e),s=this.getFloatingBottomHeight(e,t),l=this.getFloatingTopHeight(e,t);return r-s-l-o-a}getVisibleWidth(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.getFloatingColumnWidths(e),{width:r,theme:i}=e,{scrollBarSize:a,rowFooterWidth:o}=i,s=this.getGridX(e),l=this.getFloatingRightWidth(e,t),d=this.getFloatingLeftWidth(e,t);return r-d-l-s-a-o}getFirstIndex(e,t,r){for(var i=e.size+1,a=0;a<i;a+=1){var o=t(a,r);if(e.get(o)!==0)return a}return 0}getFirstColumn(e){return this.getFirstIndex(this.userColumnWidths,this.getModelColumn.bind(this),e)}getFirstRow(e){return this.getFirstIndex(this.userRowHeights,this.getModelRow.bind(this),e)}getLastLeft(e,t,r){var{model:i}=e,{columnCount:a,floatingRightColumnCount:o}=i,s=Math.max(0,a-o-1);t!=null&&(s=t);for(var l=0;s>=0;){var d=this.getVisibleColumnWidth(s,e);if(l+=d,l>=r)return Le(s+1,0,t??a-1);s-=1}return 0}getLastTop(e,t,r){var{model:i}=e,{rowCount:a,floatingBottomRowCount:o}=i,s=Math.max(0,a-o-1);t!=null&&(s=t);for(var l=0;s>=0;){var d=this.getVisibleRowHeight(s,e);if(l+=d,l>=r)return Le(s+1,0,a-1);s-=1}return 0}getTopForTopVisible(e,t){for(var r=this.getFloatingTopHeight(e),i=t,a=0;i>0&&a<r;)i-=1,a+=this.getVisibleRowHeight(i,e);return i}getTopForBottomVisible(e,t){var{height:r}=e,i=this.getGridY(e),a=this.getFloatingBottomHeight(e),o=r-i-a;return this.getLastTop(e,t,o)}getLeftForLeftVisible(e,t){for(var r=this.getFloatingLeftWidth(e),i=t,a=0;i>0&&a<r;)i-=1,a+=this.getVisibleColumnWidth(i,e);return i}getLeftForRightVisible(e,t){var{width:r}=e,i=this.getGridX(e),a=this.getFloatingRightWidth(e),o=r-i-a;return this.getLastLeft(e,t,o)}getFloatingRowHeights(e){for(var{model:t}=e,{floatingTopRowCount:r,floatingBottomRowCount:i,rowCount:a}=t,o=new Map,s=0;s<r&&s<a;s+=1)o.set(s,this.getVisibleRowHeight(s,e));for(var l=0;l<i&&a-l-1>=0;l+=1){var d=a-l-1;o.set(d,this.getVisibleRowHeight(d,e))}return o}getVisibleRowHeights(e){for(var{top:t,topOffset:r,height:i,model:a}=e,o=0,s=t,l=new Map,{rowCount:d}=a;o<i+r&&s<d;){var u=this.getVisibleRowHeight(s,e);l.set(s,u),o+=u,s+=1}return l}getFloatingColumnWidths(e){for(var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.getFirstColumn(e),r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.calculateTreePaddingX(e),{model:i}=e,{columnCount:a,floatingLeftColumnCount:o,floatingRightColumnCount:s}=i,l=new Map,d=0;d<o&&d<a;d+=1)l.set(d,this.getVisibleColumnWidth(d,e,t,r));for(var u=0;u<s&&a-u-1>=0;u+=1){var c=a-u-1;l.set(c,this.getVisibleColumnWidth(c,e,t,r))}return l}getVisibleColumnWidths(e){for(var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.getFirstColumn(e),r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.calculateTreePaddingX(e),{left:i,leftOffset:a,width:o,model:s}=e,l=0,d=i,u=new Map,{columnCount:c}=s;l<o+a&&d<c;){var m=this.getVisibleColumnWidth(d,e,t,r);u.set(d,m),l+=m,d+=1}return u}getFloatingColumnXs(e,t,r){var{model:i}=e,{columnCount:a,floatingLeftColumnCount:o,floatingRightColumnCount:s}=i;return Kv(o,s,a,r,t)}getVisibleColumnXs(e,t,r){for(var i=new Map,a=-r,o=0;o<t.length;o+=1){var s=t[o],l=B(e,s);i.set(s,a),a+=l}return i}getFloatingRowYs(e,t,r){var{model:i}=e,{floatingTopRowCount:a,floatingBottomRowCount:o,rowCount:s}=i;return Kv(a,o,s,r,t)}getVisibleRowYs(e,t,r){for(var i=new Map,a=-r,o=0;o<t.length;o+=1){var s=t[o],l=B(e,s);i.set(s,a),a+=l}return i}getVisibleRowTreeBoxes(e,t,r){var i=new Map,{model:a,theme:o}=r,{treeDepthIndent:s,treeHorizontalPadding:l}=o;return Ke(a)&&a.hasExpandableRows&&e.forEach((d,u)=>{var c=B(t,u);if(a.isRowExpandable(c)){var m=a.depthForRow(c),v=m*s+l,f=(m+1)*s+l,g=0,p=d;i.set(u,{x1:v,y1:g,x2:f,y2:p})}}),i}getFloatingLeftWidth(e){for(var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.getFloatingColumnWidths(e),{model:r}=e,{floatingLeftColumnCount:i}=r,a=0,o=0;o<i;o+=1)a+=B(t,o);return a}getFloatingRightWidth(e){for(var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.getFloatingColumnWidths(e),{model:r}=e,{floatingRightColumnCount:i,columnCount:a}=r,o=0,s=0;s<i;s+=1)o+=B(t,a-s-1);return o}getFloatingTopHeight(e){for(var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.getFloatingRowHeights(e),{model:r}=e,{floatingTopRowCount:i}=r,a=0,o=0;o<i;o+=1)a+=B(t,o);return a}getFloatingBottomHeight(e){for(var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.getFloatingRowHeights(e),{model:r}=e,{floatingBottomRowCount:i,rowCount:a}=r,o=0,s=0;s<i;s+=1)o+=B(t,a-s-1);return o}getTopVisible(e,t,r,i){for(var a=this.getFloatingTopHeight(e,r),o=0;o<i.length;o+=1){var s=i[o],l=B(t,s);if(l>=a)return s}return 0}getLeftVisible(e,t,r,i){for(var a=this.getFloatingLeftWidth(e,r),o=0;o<i.length;o+=1){var s=i[o],l=B(t,s);if(l>=a)return s}return 0}getBottomVisible(e,t,r,i,a){for(var{height:o,theme:s}=e,{scrollBarSize:l}=s,d=this.getFloatingBottomHeight(e,r),u=o-a-l-d,c=i.length-1;c>=0;c-=1){var m=i[c],v=B(t,m),f=B(r,m);if(v+f<=u)return m}return 0}getRightVisible(e,t,r,i,a){for(var{width:o,theme:s}=e,{scrollBarSize:l}=s,d=this.getFloatingRightWidth(e,r),u=o-a-l-d,c=i.length-1;c>=0;c-=1){var m=i[c],v=B(t,m),f=B(r,m);if(v+f<=u)return m}return 0}getBottomViewport(e,t,r,i){var{height:a,theme:o}=e,{rowHeight:s}=o;return this.getLastIndexViewport(t,r,i,a,s)}getRightViewport(e,t,r,i){var{width:a,theme:o}=e,{columnWidth:s}=o;return this.getLastIndexViewport(t,r,i,a,s)}getLastIndexViewport(e,t,r,i,a){var o=0,s=0;return e.length>0&&(o=e[e.length-1],s=B(t,o)+B(r,o)),s<i&&(o+=Math.ceil((i-s)/a)),o}getVisibleItemSize(e,t,r){var i;return(i=t.get(e))!==null&&i!==void 0?i:r()}getVisibleRowHeight(e,t){var r=this.getModelRow(e,t),i=this.calculateRowHeight(e,r,t);return this.getVisibleItemSize(r,this.userRowHeights,()=>{var a=this.initialRowHeights.get(r);return a!==void 0?a:i})}getVisibleColumnWidth(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.getFirstColumn(t),i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:this.calculateTreePaddingX(t),a=this.getModelColumn(e,t),o=this.calculateColumnWidth(e,a,t,r,i);return this.getVisibleItemSize(a,this.userColumnWidths,()=>{var s=this.initialColumnWidths.get(a);return s!==void 0?s:o})}getModelRows(e,t){for(var r=new Map,i=0;i<e.length;i+=1){var a=e[i],o=this.getModelRow(a,t);r.set(a,o)}return r}getModelRow(e,t){if(this.modelRows.has(e))return B(this.modelRows,e);var{movedRows:r}=t,i=me.getModelIndex(e,r);return this.modelRows.set(e,i),i}getModelColumns(e,t){for(var r=new Map,i=0;i<e.length;i+=1){var a=e[i],o=this.getModelColumn(a,t);r.set(a,o)}return r}getModelColumn(e,t){var r=this.modelColumns.has(e);if(r)return B(this.modelColumns,e);var{movedColumns:i}=t,a=me.getModelIndex(e,i);return this.modelColumns.set(e,a),a}calculateRowHeight(e,t,r){var{theme:i}=r,{autoSizeRows:a,rowHeight:o}=i;if(!a)return o;var s=this.calculatedRowHeights.get(t);return s??(this.calculatedRowHeights.set(t,Math.ceil(o)),pl(this.calculatedRowHeights),o)}calculateColumnWidth(e,t,r){var i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:this.getFirstColumn(r),a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:this.calculateTreePaddingX(r),{theme:o}=r,{autoSizeColumns:s,minColumnWidth:l,maxColumnWidth:d}=o;if(!s){var{columnWidth:u}=o;return u}var c=this.calculateColumnHeaderWidth(t,r),m=this.calculateColumnDataWidth(t,r),v=this.calculatedColumnWidths.get(t),f=Math.ceil(Math.max(c,m));return f=Math.max(l,f),f=Math.min(d,f),v!=null&&v>f?f=v:(this.calculatedColumnWidths.set(t,f),pl(this.calculatedColumnWidths)),e===i&&(f+=a),f}calculateColumnHeaderWidth(e,t){var{model:r,theme:i}=t,{headerFont:a,headerHorizontalPadding:o}=i,s=r.textForColumnHeader(e,0);if(s!==void 0&&s!==""){var l=this.getWidthForFont(a,t);return s.length*l+o*2}return o*2}calculateColumnDataWidth(e,t){var{top:r,height:i,width:a,model:o,theme:s}=t,{floatingTopRowCount:l,floatingBottomRowCount:d,rowCount:u}=o,{font:c,cellHorizontalPadding:m,rowHeight:v,rowHeaderWidth:f,rowFooterWidth:g,scrollBarSize:p,dataBarHorizontalPadding:b}=s,S=0,C=this.getWidthForFont(c,t),y=i/v,E=Math.ceil(r+y);return me.iterateAllItems(r,E,l,d,u,T=>{var O=this.getModelRow(T,t),N=o.textForCell(e,O),P=o.renderTypeForCell(e,O),R=0;if(N){var A=m*2;R=N.length*C+A}P==="dataBar"&&(R+=b),S=Math.max(S,R)}),S=Math.max(Math.min(S,(a-f-p-g)*Ha.MAX_COLUMN_WIDTH),m*2),S}calculateTreePaddingX(e){var{top:t,height:r,model:i,theme:a}=e,{rowHeight:o,treeDepthIndent:s}=a;if(!Ke(i)||!i.hasExpandableRows)return 0;for(var l=0,d=r/o,u=Math.ceil(t+d),c=t;c<=u;c+=1){var m=this.getModelRow(c,e),v=i.depthForRow(m);l=Math.max(l,s*(v+1))}return l}getWidthForFont(e,t){if(this.fontWidths.has(e))return B(this.fontWidths,e);var{context:r}=t;r.font=e;var i=r.measureText("8"),{width:a}=i;return this.fontWidths.set(e,a),this.fontWidths.set(r.font,a),a}setColumnWidth(e,t){var r=new Map(this.userColumnWidths);r.set(e,Math.ceil(t)),pl(r),this.userColumnWidths=r}resetColumnWidth(e){var t=new Map(this.userColumnWidths);t.delete(e),this.userColumnWidths=t}setRowHeight(e,t){var r=new Map(this.userRowHeights);r.set(e,Math.ceil(t)),pl(r),this.userRowHeights=r}resetRowHeight(e){var t=new Map(this.userRowHeights);t.delete(e),this.userRowHeights=t,this.calculatedRowHeights.delete(e)}}Rr(Ha,"CACHE_SIZE",1e4);Rr(Ha,"MAX_COLUMN_WIDTH",.8);var fI=Object.freeze({allowColumnResize:!0,allowRowResize:!0,autoSelectRow:!1,autoSelectColumn:!1,autoSizeColumns:!0,autoSizeRows:!0,backgroundColor:"#000000",black:"#000000",white:"#ffffff",cellHorizontalPadding:5,headerHorizontalPadding:5,font:"12px Arial, sans-serif",gridColumnColor:"#8f8f8f66",gridRowColor:"#8f8f8f66",headerBackgroundColor:"#222222",headerSeparatorColor:"#000000",headerSeparatorHoverColor:"#888888",headerSeparatorHandleSize:5,headerHiddenSeparatorSize:5,headerHiddenSeparatorHoverColor:"#8888FF",headerColor:"#d5d5d5",headerFont:"10px Arial, sans-serif",columnHoverBackgroundColor:"#444444",selectedColumnHoverBackgroundColor:"#494949",rowBackgroundColors:"#333333 #222222",rowHoverBackgroundColor:"#444444",selectedRowHoverBackgroundColor:"#494949",minScrollHandleSize:50,scrollBarBackgroundColor:"#111111",scrollBarHoverBackgroundColor:"#333333",scrollBarCasingColor:"#000000",scrollBarCornerColor:"#000000",scrollBarColor:"#555555",scrollBarHoverColor:"#888888",scrollBarActiveColor:"#AAAAAA",scrollBarSize:12,scrollBarHoverSize:16,scrollBarCasingWidth:1,scrollSnapToColumn:!1,scrollSnapToRow:!1,selectionColor:"#4286f433",selectionOutlineColor:"#4286f4",selectionOutlineCasingColor:"#222222",scrollBarSelectionTick:!0,scrollBarSelectionTickColor:"#4286f433",scrollBarActiveSelectionTickColor:"#4286f480",shadowBlur:8,shadowAlpha:.15,shadowColor:"#000000",textColor:"#ffffff",hyperlinkColor:"#4878ea",maxDepth:6,treeDepthIndent:10,treeHorizontalPadding:5,treeLineColor:"#888888",treeMarkerColor:"#cccccc",treeMarkerHoverColor:"#ffffff",rowHeight:20,columnWidth:100,minRowHeight:20,minColumnWidth:55,maxColumnWidth:600,columnHeaderHeight:20,rowHeaderWidth:30,rowFooterWidth:0,headerResizeSnapThreshold:10,headerResizeHiddenSnapThreshold:8,allowColumnReorder:!0,allowRowReorder:!0,reorderOffset:2,floatingGridColumnColor:"#8f8f8f66",floatingGridRowColor:"#8f8f8f66",floatingRowBackgroundColors:"#393939 #292929",floatingDividerOuterColor:"#000000",floatingDividerInnerColor:"#cccccc",zeroLineColor:"#888888",positiveBarColor:"#00ff00",negativeBarColor:"#ff0000",markerBarColor:"#ffffff",dataBarHorizontalPadding:90});const WC=fI;function qv(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function Yv(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?qv(Object(t),!0).forEach(function(r){gI(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):qv(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function gI(n,e,t){return e=pI(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function pI(n){var e=bI(n,"string");return typeof e=="symbol"?e:String(e)}function bI(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var CI=(n,e)=>{var t=!1,r=Se(n,Yv(Yv({},e),{},{dispose:()=>{t||(t=!0,r.clear(),t=!1)}}));return r};const On=CI;function SI(n,e){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:6,r=dh.hex.lab.raw(n),i=r[0]<50?17:10;return r[0]=Math.max(r[0]-i/t*e,0),"#".concat(dh.lab.hex(r))}function wI(n,e){var[t,r,i]=dh.hex.rgb(n);return"rgba(".concat(t,", ").concat(r,", ").concat(i,", ").concat(e,")")}var yI=n=>{var{r:e,g:t,b:r}=n,i=.4122214708*e+.5363325363*t+.0514459929*r,a=.2119034982*e+.6806995451*t+.1073969566*r,o=.0883024619*e+.2817188376*t+.6299787005*r,s=Math.cbrt(i),l=Math.cbrt(a),d=Math.cbrt(o);return{L:.2104542553*s+.793617785*l-.0040720468*d,a:1.9779984951*s-2.428592205*l+.4505937099*d,b:.0259040371*s+.7827717662*l-.808675766*d}},EI=n=>{var{L:e,a:t,b:r}=n,i=e+.3963377774*t+.2158037573*r,a=e-.1055613458*t-.0638541728*r,o=e-.0894841775*t-1.291485548*r,s=i*i*i,l=a*a*a,d=o*o*o;return{r:Le(4.0767416621*s-3.3077115913*l+.2309699292*d,0,255),g:Le(-1.2684380046*s+2.6097574011*l-.3413193965*d,0,255),b:Le(-.0041960863*s-.7034186147*l+1.707614701*d,0,255)}},TI=n=>{var e,t,r=(e=(t=n.replace(/^#?([a-f\d])([a-f\d])([a-f\d])$/i,(i,a,o,s)=>"#".concat(a).concat(a).concat(o).concat(o).concat(s).concat(s)).substring(1).match(/.{2}/g))===null||t===void 0?void 0:t.map(i=>parseInt(i,16)))!==null&&e!==void 0?e:[0,0,0];return{r:r[0],g:r[1],b:r[2]}},PI=n=>{var e=Math.round(n.r),t=Math.round(n.g),r=Math.round(n.b);return"#".concat([e,t,r].map(i=>{var a=i.toString(16);return a.length===1?"0".concat(a):a}).join(""))},OI=(n,e,t)=>{var{L:r,a:i,b:a}=n,{L:o,a:s,b:l}=e,d=r+(o-r)*t,u=i+(s-i)*t,c=a+(l-a)*t;return{L:d,a:u,b:c}};const ya={colorWithAlpha:wI,darkenForDepth:SI,linearSRGBToOklab:yI,OklabToLinearSRGB:EI,hexToRgb:TI,rgbToHex:PI,lerpColor:OI};function Xv(n,e,t){return e=DI(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function DI(n){var e=NI(n,"string");return typeof e=="symbol"?e:String(e)}function NI(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class yt{constructor(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:5e3;Xv(this,"order",void 0),Xv(this,"cursor",null),this.order=e}onDown(e,t,r){return!1}onMove(e,t,r){return!1}onDrag(e,t,r){return!1}onLeave(e,t,r){return!1}onClick(e,t,r){return!1}onContextMenu(e,t,r){return!1}onDoubleClick(e,t,r){return!1}onUp(e,t,r){return!1}onWheel(e,t,r){return!1}}function Xo(n,e,t){return e=RI(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function RI(n){var e=II(n,"string");return typeof e=="symbol"?e:String(e)}function II(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class FI extends yt{constructor(){super(...arguments),Xo(this,"draggingIndex",void 0),Xo(this,"resizingItems",[]),Xo(this,"hiddenItems",[]),Xo(this,"targetSizes",new Map),Xo(this,"dragOffset",0)}onDown(e,t){var{metrics:r}=t,{model:i}=t.props,a=t.getTheme();if(!r)throw new Error("metrics not set");var o=this.getSeparator(e,r,i,a);if(o!=null){var s=o.index;return this.dragOffset=0,this.draggingIndex=s,this.resizingItems=[s],this.hiddenItems=this.getHiddenItems(s,r).reverse(),this.targetSizes.clear(),this.addTargetSize(r,s),this.updateCursor(r,s),this.updateSeparator(t,o),!0}return!1}onMove(e,t){var{metrics:r}=t,{model:i}=t.props,a=t.getTheme();if(!r)throw new Error("metrics not set");var o=this.getSeparator(e,r,i,a);return o!=null?(this.updateCursor(r,o.index),!0):!1}onDrag(e,t){if(this.draggingIndex==null)return!1;var r=e[this.pointProperty],{metricCalculator:i,metrics:a}=t;if(!a)throw new Error("metrics not set");for(var o=t.getTheme(),s=a[this.visibleOffsetProperty],l=a[this.marginProperty],d=a[this.calculatedSizesProperty],u=a[this.modelIndexesProperty],c=a[this.firstIndexProperty],m=a[this.treePaddingProperty],v=new Map,f=this.resizingItems[this.resizingItems.length-1];f!=null;){var g=B(s,f),p=r-l-g-this.dragOffset,b=B(u,f),S=this.targetSizes.get(b),C=this.resizingItems.length>1,y=this.hiddenItems.indexOf(f),E=B(d,b);f===c&&(E+=m);var T=p;if(Math.abs(p-E)<=o.headerResizeSnapThreshold?T=E:S!==void 0&&p>S&&(C&&y!==0||y>0)?T=S:p<=o.headerResizeHiddenSnapThreshold&&(T=0),v.set(b,T),p<-o.headerResizeSnapThreshold&&T===0)if(y>=0&&C){var O;this.resizingItems.pop(),this.removeTargetSize(a,f),f=this.resizingItems[this.resizingItems.length-1],this.dragOffset-=(O=this.targetSizes.get(B(u,f)))!==null&&O!==void 0?O:0}else f=this.getNextShownItem(f,a),f!==null&&(this.resizingItems.push(f),this.addTargetSize(a,f));else S!==void 0&&p>S+o.headerResizeSnapThreshold&&T===S?y>0?(this.dragOffset+=T,f=this.hiddenItems[y-1],this.resizingItems.push(f),this.addTargetSize(a,f)):C?(this.resizingItems.pop(),this.removeTargetSize(a,f),f=this.resizingItems[this.resizingItems.length-1]):f=null:f=null}return v.forEach((N,P)=>{var R,A=(R=i[this.initialSizesProperty].get(P))!==null&&R!==void 0?R:d.get(P);N===A?this.resetSize(i,P):this.setSize(i,P,N)}),this.updateCursor(a,this.draggingIndex),!0}onUp(e,t){return this.draggingIndex!=null&&(this.draggingIndex=void 0,this.resizingItems=[],this.hiddenItems=[],this.targetSizes.clear(),this.updateSeparator(t,null)),!1}onDoubleClick(e,t){var{metrics:r,metricCalculator:i}=t,{model:a}=t.props,o=t.getTheme();if(!r)throw new Error("metrics not set");var s=this.getSeparator(e,r,a,o);if(s!=null){var l=r[this.modelIndexesProperty],d=B(l,s.index),u=B(r[this.calculatedSizesProperty],d),c=i[this.initialSizesProperty].get(d);return u===c?this.resetSize(i,d):this.setSize(i,d,u),t.forceUpdate(),!0}return!1}updateCursor(e,t){var r=e[this.visibleSizesProperty],i=B(r,t);i===0?this.cursor=this.hiddenCursor:this.cursor=this.defaultCursor}addTargetSize(e,t){var r=e[this.modelIndexesProperty],i=e[this.userSizesProperty],a=e[this.calculatedSizesProperty],o=t===0?e[this.treePaddingProperty]:0,s=B(r,t),l=i.get(s);(l==null||l===0)&&(l=B(a,s)+o),this.targetSizes.set(s,l)}removeTargetSize(e,t){var r=e[this.modelIndexesProperty],i=B(r,t);this.targetSizes.delete(i)}}const zC=FI;function er(n,e,t){return e=_I(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function _I(n){var e=MI(n,"string");return typeof e=="symbol"?e:String(e)}function MI(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class Pc extends zC{constructor(){super(...arguments),er(this,"hiddenCursor","e-resize"),er(this,"defaultCursor","col-resize"),er(this,"pointProperty","x"),er(this,"userSizesProperty","userColumnWidths"),er(this,"visibleOffsetProperty","visibleColumnXs"),er(this,"visibleSizesProperty","visibleColumnWidths"),er(this,"marginProperty","rowHeaderWidth"),er(this,"calculatedSizesProperty","calculatedColumnWidths"),er(this,"initialSizesProperty","initialColumnWidths"),er(this,"modelIndexesProperty","modelColumns"),er(this,"firstIndexProperty","firstColumn"),er(this,"treePaddingProperty","treePaddingX"),er(this,"getHiddenItems",me.getHiddenColumns),er(this,"getNextShownItem",me.getNextShownColumn),er(this,"getSeparator",Pc.getColumnSeparator)}static getColumnSeparator(e,t,r,i){if(!i.allowColumnResize)return null;var{x:a,y:o,columnHeaderDepth:s}=e,{modelColumns:l}=t,d=me.getColumnSeparatorIndex(a,o,t,i);if(d==null||s==null||s>0)return null;var u=l.get(d);return u!=null?{index:d,depth:0}:null}setSize(e,t,r){e.setColumnWidth(t,r)}resetSize(e,t){e.resetColumnWidth(t)}updateSeparator(e,t){e.setState({draggingColumnSeparator:t,isDragging:t!==null})}}const KC=Pc;var xa=10;function xI(n,e,t){return e=AI(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function AI(n){var e=LI(n,"string");return typeof e=="symbol"?e:String(e)}function LI(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class kI{constructor(){xI(this,"getCachedTruncatedString",On((e,t,r,i,a)=>Tn.truncateToWidth(e,t,r,i,a),{max:1e4}))}drawCellRowTreeMarker(e,t,r){var{metrics:i,model:a,mouseX:o,mouseY:s,theme:l}=t,{firstColumn:d,gridX:u,gridY:c,allColumnXs:m,allColumnWidths:v,allRowYs:f,allRowHeights:g,visibleRowTreeBoxes:p}=i,{treeMarkerColor:b,treeMarkerHoverColor:S}=l,C=B(m,d),y=B(v,d),E=B(f,r),T=B(g,r);if(!(!Ke(a)||!a.isRowExpandable(r))){var O=B(p,r),N=o!=null&&s!=null&&o>=u+C&&o<=u+C+y&&s>=c+E&&s<=c+E+T?S:b;this.drawTreeMarker(e,t,C,E,O,N,a.isRowExpanded(r))}}drawTreeMarker(e,t,r,i,a,o,s){var{x1:l,y1:d,x2:u,y2:c}=a,m=s?"⊟":"⊞",v=r+(l+u)*.5+.5,f=i+(d+c)*.5+.5;e.fillStyle=o,e.textAlign="center",e.fillText(m,v,f)}}const qC=kI;function Qv(n){return(n==null?void 0:n.dataBarOptionsForCell)!==void 0}function Zv(n,e,t){return e=jI(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function jI(n){var e=$I(n,"string");return typeof e=="symbol"?e:String(e)}function $I(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class HI extends qC{constructor(){super(...arguments),Zv(this,"heightOfDigits",void 0),Zv(this,"getCachedWidestValueForColumn",On((e,t,r,i,a)=>{for(var o=0,s=0;s<t.length;s+=1){var l=t[s],d=B(r,l),u=i.textForCell(a,d);o=Math.max(o,e.measureText(u).width)}return o},{max:1e3}))}drawCellContent(e,t,r,i){var a,{metrics:o,model:s,theme:l}=t;if(Qv(s)){var{modelColumns:d,modelRows:u,allRowHeights:c,allRowYs:m,firstColumn:v,fontWidths:f}=o,g=r===v,p=B(c,i),b=B(u,i),S=B(d,r),C=B(m,i),y=s.textAlignForCell(S,b),E=s.textForCell(S,b),{x:T,width:O}=me.getTextRenderMetrics(t,r,i),N=(a=f==null?void 0:f.get(e.font))!==null&&a!==void 0?a:xa,P=s.truncationCharForCell(S,b),R=this.getCachedTruncatedString(e,E,O,N,P),{columnMin:A,columnMax:M,axis:I,color:x,valuePlacement:_,opacity:k,markers:U,direction:G,value:Y}=s.dataBarOptionsForCell(S,b,l),Z=Array.isArray(x);if(!(A==null||M==null)){var{maxWidth:$,x:D,y:L,zeroPosition:H,leftmostPosition:z,markerXs:te,totalValueRange:W,dataBarWidth:ne}=this.getDataBarRenderMetrics(e,t,r,i);if(this.heightOfDigits===void 0){var{actualBoundingBoxAscent:re,actualBoundingBoxDescent:se}=e.measureText("1234567890");this.heightOfDigits=re+se}if(e.save(),e.textAlign=y,Z){var Ce=Y>=0?x[x.length-1]:x[0];e.fillStyle=Ce}else e.fillStyle=x;if(e.textBaseline="top",e.font=l.font,_!=="hide"&&e.fillText(R,T,C+(p-this.heightOfDigits)/2),Z){var Me=x.map(Or=>ya.linearSRGBToOklab(ya.hexToRgb(Or)));if(e.save(),e.beginPath(),e.roundRect(D,L,ne,p-2,1),e.clip(),Y<0){if(G==="LTR")for(var rt=Math.round(Math.abs(A)/W*$),nt=rt/(x.length-1),Xe=Math.round(z),ft=0;ft<x.length-1;ft+=1){var Nt=Me[ft],He=Me[ft+1];this.drawGradient(e,Nt,He,Xe,C+1,nt,p),Xe+=nt}else if(G==="RTL")for(var Rt=Math.round($-Math.abs(M)/W*$),xt=Rt/(x.length-1),Ur=Math.round(H),Er=x.length-1;Er>0;Er-=1){var Qn=Me[Er],dn=Me[Er-1];this.drawGradient(e,Qn,dn,Ur,C+1,xt,p),Ur+=xt}}else if(G==="LTR")for(var Tr=Math.round($-Math.abs(A)/W*$)-1,it=Tr/(x.length-1),Jt=Math.round(H),Vr=0;Vr<x.length-1;Vr+=1){var Pr=Me[Vr],Gr=Me[Vr+1];this.drawGradient(e,Pr,Gr,Jt,C+1,it,p-2),Jt+=it}else if(G==="RTL")for(var yi=Math.round(Math.abs(M)/W*$),Wr=yi/(x.length-1),zr=Math.round(z),hr=x.length-1;hr>0;hr-=1){var Zn=Me[hr],Jn=Me[hr-1];this.drawGradient(e,Zn,Jn,zr,C+1,Wr,p-2),zr+=Wr}e.restore()}else e.save(),e.globalAlpha=k,e.beginPath(),e.roundRect(D,L,ne,p-2,1),e.fill(),e.restore();$>0&&te.forEach((Or,un)=>{e.fillStyle=U[un].color,e.fillRect(Or,L,1,p-2)});var ei=!(I==="directional"&&(_==="beside"&&y==="right"&&G==="LTR"||_==="beside"&&y==="left"&&G==="RTL"||_!=="beside"));ei&&(e.strokeStyle=l.zeroLineColor,e.beginPath(),e.setLineDash([2,1]),e.moveTo(H,C),e.lineTo(H,C+p),e.stroke()),e.restore(),g&&Ke(s)&&s.hasExpandableRows&&this.drawCellRowTreeMarker(e,t,i)}}}getDataBarRenderMetrics(e,t,r,i){var{metrics:a,model:o,theme:s}=t;if(!Qv(o))throw new Error("Grid model is not a data bar grid model");var{firstColumn:l,allColumnXs:d,allColumnWidths:u,allRowYs:c,modelColumns:m,modelRows:v,visibleRows:f}=a,{cellHorizontalPadding:g,treeDepthIndent:p,treeHorizontalPadding:b}=s,S=B(m,r),C=B(v,i),y=B(d,r),E=B(c,i),T=B(u,r),O=r===l,N=0;Ke(o)&&o.hasExpandableRows&&O&&(N=p*(o.depthForRow(i)+1)+b);var P=o.textAlignForCell(S,C),{columnMin:R,columnMax:A,axis:M,valuePlacement:I,markers:x,direction:_,value:k}=o.dataBarOptionsForCell(S,C,s),U=this.getCachedWidestValueForColumn(e,f,v,o,S),G=2,Y=I==="beside"&&P==="right"?2:1,Z=A-R;A>=0&&R>=0||R===A?Z=A:A<=0&&R<=0&&(Z=Math.abs(R));var $=T-N-Y-G;I==="beside"&&($=$-g-U),$<0&&($=0);var D=Math.max(Math.abs(R),Math.abs(A)),L=Math.abs(k)/Z*$;$===0?L=0:M==="middle"?L=Math.abs(k)/D*($/2):M==="directional"&&(L=Math.abs(k)/D*$);var H=R>=0?0:Math.abs(R)/Z*$,z=k>=0?H:H-Math.abs(k)/Z*$,te=x.map(re=>{var{value:se}=re,Ce=Math.abs(se)/Z*$;return se>=0?H+Ce:H-Ce}),W=I==="beside"&&P==="left"?g+U+G:G,ne=I==="beside"&&P==="right"?T-g-U-Y:Y;return _==="RTL"&&(H=R>=0?T:T-Math.abs(R)/Z*$,z=k>=0?H-k/Z*$:H,te=x.map(re=>{var{value:se}=re;return se>=0?H-Math.abs(se)/Z*$:H+Math.abs(se)/Z*$})),M==="middle"?(H=$/2,_==="LTR"?(z=k>=0?H:H-Math.abs(k)/D*($/2),te=x.map(re=>{var{value:se}=re;return se>=0?H+Math.abs(se)/D*($/2):H-Math.abs(se)/D*($/2)})):_==="RTL"&&(z=k<=0?H:H-Math.abs(k)/D*($/2),te=x.map(re=>{var{value:se}=re;return se<=0?H+Math.abs(se)/D*($/2):H-Math.abs(se)/D*($/2)}))):M==="directional"&&(_==="LTR"?(H=0,z=H,te=x.map(re=>{var{value:se}=re;return H+Math.abs(se)/D*$})):_==="RTL"&&(H=T,z=H-Math.abs(k)/D*$,te=x.map(re=>{var{value:se}=re;return H-Math.abs(se)/D*$}))),_==="LTR"?(H+=y+G+N,z+=y+G+N,te=te.map(re=>re+y+G+N),I==="beside"&&P==="left"&&(H+=U+g,z+=U+g,te=te.map(re=>re+U+g))):_==="RTL"&&(H=H+y-Y,z=z+y-Y,te=te.map(re=>re+y-Y),I==="beside"&&P==="right"&&(H=H-g-U,z=z-g-U,te=te.map(re=>re-g-U))),W+=y+N,ne+=y,{maxWidth:$,x:z,y:E+1.5,zeroPosition:H,leftmostPosition:W,rightmostPosition:ne,totalValueRange:Z,dataBarWidth:L,markerXs:te}}drawGradient(e,t,r,i,a,o,s){for(var l=t,d=i;d<=i+o;d+=.5)this.drawGradientPart(e,d,a,1,s,ya.rgbToHex(ya.OklabToLinearSRGB(l))),l=ya.lerpColor(t,r,(d-i)/o)}drawGradientPart(e,t,r,i,a,o){e.fillStyle=o,e.fillRect(t,r,i,a)}}const YC=HI;function BI(n,e,t){return e=UI(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function UI(n){var e=VI(n,"string");return typeof e=="symbol"?e:String(e)}function VI(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class GI extends qC{constructor(){super(...arguments),BI(this,"getCachedTokenBoxesForVisibleCell",On((e,t,r,i,a,o)=>{for(var s=0,l=a,d=[],u=0,c=0,m=0;m<t.length;m+=1){var v=t[m],{start:f,end:g}=v,p=g>e.length?e.substring(f):v.value;c+=o.measureText(e.substring(u,f)).width;var b=o.measureText(p).width,S=c,C=S+b,y={x1:S,y1:s,x2:C,y2:l,token:v};d.push(y),u=g,c+=b}return d},{max:1e4}))}drawCellContent(e,t,r,i){var{metrics:a,model:o,theme:s}=t,{fontWidths:l,modelColumns:d,modelRows:u,allRowHeights:c,firstColumn:m}=a,v=r===m,{textColor:f}=s,g=B(c,i),p=B(u,i),b=B(d,r),S=o.textForCell(b,p),C=o.truncationCharForCell(b,p);if(S&&g>0){var y,E=o.textAlignForCell(b,p)||"left";e.textAlign=E;var T=o.colorForCell(b,p,s)||f;e.fillStyle=T,e.save();var{width:O,x:N,y:P}=me.getTextRenderMetrics(t,r,i),R=(y=l.get(e.font))!==null&&y!==void 0?y:xa,A=this.getCachedTruncatedString(e,S,O,R,C),M=o.tokensForCell(b,p,A.length);if(A)for(var I=0,x=0,_=N,{actualBoundingBoxDescent:k}=e.measureText(A);x<A.length;){var U,G,Y=M[I],Z=x===(Y==null?void 0:Y.start)?Y:null,$=(U=(G=Z==null?void 0:Z.end)!==null&&G!==void 0?G:Y==null?void 0:Y.start)!==null&&U!==void 0?U:A.length,D=A.substring(x,$),{width:L}=e.measureText(D),H=D.endsWith("…")?e.measureText(D.substring(0,D.length-1)).width:L;Z!=null?(e.fillStyle=s.hyperlinkColor,e.fillText(D,_,P),e.fillRect(_,P+k,H,1)):(e.fillStyle=T,e.fillText(D,_,P)),_+=L,x=$,Z!=null&&(I+=1)}e.restore()}v&&Ke(o)&&o.hasExpandableRows&&this.drawCellRowTreeMarker(e,t,i)}getTokenBoxesForVisibleCell(e,t,r){var i,{metrics:a,context:o,model:s,theme:l}=r;if(o==null||a==null)return Te;var{modelRows:d,modelColumns:u}=a,c=B(d,t),m=B(u,e),v=s.textForCell(m,c),{width:f,x:g,y:p}=me.getTextRenderMetrics(r,e,t),{fontWidths:b}=a;o.save(),this.configureContext(o,r);var S=(i=b==null?void 0:b.get(o.font))!==null&&i!==void 0?i:xa,C=s.truncationCharForCell(m,c),y=this.getCachedTruncatedString(o,v,f,S,C),{actualBoundingBoxAscent:E,actualBoundingBoxDescent:T}=o.measureText(y),O=E+T,N=s.tokensForCell(m,c,y.length);if(N.length===0)return o.restore(),Te;var P=this.getCachedTokenBoxesForVisibleCell(y,N,l.font,"middle",O,o).map(R=>({x1:R.x1+g,y1:R.y1+(p-E),x2:R.x2+g,y2:R.y2+(p-E),token:R.token}));return o.restore(),P}configureContext(e,t){var{theme:r}=t;e.font=r.font,e.textBaseline="middle",e.lineCap="butt"}}const XC=GI;function Ea(n,e,t){return e=WI(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function WI(n){var e=zI(n,"string");return typeof e=="symbol"?e:String(e)}function zI(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class Tn{constructor(){Ea(this,"textCellRenderer",new XC),Ea(this,"dataBarCellRenderer",new YC),Ea(this,"getCachedBackgroundColors",On((e,t)=>e.split(" ").map(r=>{for(var i=[],a=0;a<t;a+=1)i.push(ya.darkenForDepth(r,a,t));return i}),{max:1e3})),Ea(this,"getCachedColorWithAlpha",On((e,t)=>ya.colorWithAlpha(e,t),{max:1e3})),Ea(this,"getCachedColorIsDark",On(e=>Pd.isDark(e),{max:1e3}))}static truncate(e,t){return t<e.length?e.substr(0,t)+"…":e}static binaryTruncateToWidth(e,t,r){var i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:t.length,o=arguments.length>5?arguments[5]:void 0;if(a>=t.length&&e.measureText(t).width<=r)return t;if(o!==void 0){var s=e.measureText(o).width;return o.repeat(Math.max(1,Math.floor(r/s)))}for(var l=i,d=Math.min(t.length-1,a),u=t;d>=l;){var c=Math.ceil((d+l)/2),m=Tn.truncate(t,c);if(e.measureText(m).width<=r){if(u=m,l===c)break;l=c}else if(c===0){u=m;break}else d=c-1}return u}static truncateToWidth(e,t,r){var i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:xa,a=arguments.length>4?arguments[4]:void 0;if(r<=0||t.length<=0)return"";var o=Math.min(Math.max(0,Math.floor(r/i/2)-5),t.length),s=Math.min(Math.ceil(r/i*2),t.length);return Tn.binaryTruncateToWidth(e,t,r,o,s,a)}drawCanvas(e){var{context:t}=e;t.save(),this.configureContext(t,e),this.drawBackground(t,e),this.drawGrid(t,e),this.drawHeaders(t,e),this.drawFooters(t,e),this.drawDraggingColumn(t,e),this.drawDraggingRow(t,e),this.drawScrollBars(t,e),t.restore()}configureContext(e,t){var{theme:r}=t;e.font=r.font,e.textBaseline="middle",e.lineCap="butt"}drawBackground(e,t){var{theme:r,metrics:i}=t,{width:a,height:o}=i;e.fillStyle=r.backgroundColor,e.fillRect(0,0,a,o)}drawGrid(e,t){var{metrics:r,draggingRow:i,draggingColumn:a}=t,{gridX:o,gridY:s}=r;e.translate(o,s),this.drawGridBackground(e,t,i==null&&a==null),this.drawCellContents(e,t),this.drawFloatingRows(e,t),this.drawFloatingColumns(e,t),e.translate(-o,-s)}drawFloatingRows(e,t){var{draggingRow:r,draggingColumn:i,metrics:a,theme:o}=t,{floatingTopRowCount:s,floatingBottomRowCount:l,floatingRows:d,rowCount:u,visibleColumns:c,allRowYs:m,allRowHeights:v}=a;if(d.length!==0){o.floatingRowBackgroundColors&&this.drawRowStripesForRows(e,t,d,o.floatingRowBackgroundColors),r==null&&i==null&&this.drawFloatingMouseRowHover(e,t),this.drawGridLinesForItems(e,t,c,d,o.floatingGridColumnColor,o.floatingGridRowColor),this.drawCellBackgroundsForItems(e,t,c,d),this.drawFloatingBorders(e,t),s>0&&this.drawSelectedRanges(e,t,{top:0,bottom:s-1,maxY:B(m,s-1)+B(v,s-1)-.5}),l>0&&this.drawSelectedRanges(e,t,{top:u-l-1,bottom:u-1,minY:B(m,u-l)+.5,maxY:B(m,u-1)+B(v,u-1)-.5});for(var f=0;f<c.length;f+=1)for(var g=c[f],p=0;p<d.length;p+=1){var b=d[p];this.drawCellContent(e,t,g,b)}}}drawFloatingColumns(e,t){var{draggingRow:r,draggingColumn:i,metrics:a,theme:o}=t,{floatingLeftColumnCount:s,floatingRightColumnCount:l,floatingLeftWidth:d,floatingRightWidth:u,floatingColumns:c,gridX:m,maxX:v,columnCount:f,visibleRows:g,allColumnXs:p,allColumnWidths:b,width:S,height:C}=a;if(c.length!==0){o.floatingRowBackgroundColors&&(this.drawRowStripesForRows(e,t,g,o.floatingRowBackgroundColors,0,d),this.drawRowStripesForRows(e,t,g,o.floatingRowBackgroundColors,S-m-u,v)),r==null&&i==null&&this.drawFloatingMouseRowHover(e,t),e.save(),e.beginPath(),e.rect(0,0,d,C),e.clip(),this.drawGridLinesForItems(e,t,c,g,o.floatingGridColumnColor,o.floatingGridRowColor),e.restore(),this.drawCellBackgroundsForItems(e,t,c,g),this.drawFloatingBorders(e,t),s>0&&this.drawSelectedRanges(e,t,{left:0,maxX:B(p,s-1)+B(b,s-1)}),l>0&&this.drawSelectedRanges(e,t,{left:f-l,right:f-1,minX:B(p,f-l)+.5,maxX:B(p,f-1)+B(b,f-1)});for(var y=0;y<c.length;y+=1)for(var E=c[y],T=0;T<g.length;T+=1){var O=g[T];this.drawCellContent(e,t,E,O)}}}drawFloatingBorders(e,t){var{metrics:r,theme:i}=t,{floatingTopRowCount:a,floatingBottomRowCount:o,floatingLeftColumnCount:s,floatingRightColumnCount:l,rowCount:d,columnCount:u,allRowYs:c,allColumnXs:m,allRowHeights:v,allColumnWidths:f,maxX:g,maxY:p}=r,{floatingDividerOuterColor:b,floatingDividerInnerColor:S}=i;if(e.lineWidth=3,e.beginPath(),e.strokeStyle=b,a>0){var C=B(c,a-1)+B(v,a-1)+.5;e.moveTo(0,C),e.lineTo(g,C)}if(o>0){var y=B(c,d-o)-.5;e.moveTo(0,y),e.lineTo(g,y)}if(s>0){var E=B(m,s-1)+B(f,s-1)+.5;e.moveTo(E,0),e.lineTo(E,p)}if(l>0){var T=B(m,u-l)-.5;e.moveTo(T,0),e.lineTo(T,p)}if(e.stroke(),e.beginPath(),e.lineWidth=1,e.strokeStyle=S,a>0){var O=B(c,a-1)+B(v,a-1)+.5;e.moveTo(0,O),e.lineTo(g,O)}if(o>0){var N=B(c,d-o)-.5;e.moveTo(0,N),e.lineTo(g,N)}if(s>0){var P=B(m,s-1)+B(f,s-1)+.5;e.moveTo(P,0),e.lineTo(P,p)}if(l>0){var R=B(m,u-l)-.5;e.moveTo(R,0),e.lineTo(R,p)}e.stroke()}drawGridBackground(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;this.drawRowStripes(e,t),r&&(this.drawMouseColumnHover(e,t),this.drawMouseRowHover(e,t)),this.drawGridLines(e,t),this.drawCellBackgrounds(e,t);var{metrics:i}=t,{bottom:a,right:o,floatingBottomRowCount:s,floatingLeftColumnCount:l,floatingRightColumnCount:d,floatingTopRowCount:u,columnCount:c,rowCount:m,allRowHeights:v,allRowYs:f,allColumnXs:g,allColumnWidths:p,width:b,height:S}=i;this.drawSelectedRanges(e,t,{bottom:Math.min(a,m-s-1),right:Math.min(o,c-d-1),minX:l>0&&g.has(l+1)?B(g,l+1):-10,minY:u>0&&f.has(u+1)?B(f,u+1):-10,maxX:d>0&&g.has(c-d-1)?B(g,c-d-1)+B(p,c-d-1)-.5:b+10,maxY:s>0&&f.has(m-s-1)?B(f,m-s-1)+B(v,m-s-1)-.5:S+10})}drawRowStripes(e,t){var{metrics:r,theme:i}=t,{visibleRows:a}=r,{rowBackgroundColors:o}=i;o&&this.drawRowStripesForRows(e,t,a,o)}drawRowStripesForRows(e,t,r,i){for(var a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0,o=arguments.length>5&&arguments[5]!==void 0?arguments[5]:t.metrics.maxX,{theme:s,metrics:l,model:d}=t,{maxDepth:u,shadowBlur:c,shadowColor:m,shadowAlpha:v}=s,f=this.getCachedBackgroundColors(i,u),{allRowYs:g,allRowHeights:p}=l,b=new Map,S=[],C=[],y=(D,L)=>{var H=Ke(d)?d.depthForRow(D):0,z=f[D%f.length],te=z[Math.min(H,z.length-1)];if(b.has(te)||b.set(te,[]),b.get(te).push(D),L!=null){var W=Ke(d)?d.depthForRow(L):0;W<H?S.push(D):W>H&&C.push(L)}},E=0;E<r.length;E+=1){var T=r[E],O=E>0?r[E-1]:void 0;y(T,O)}if(b.forEach((D,L)=>{e.fillStyle=L,e.beginPath();for(var H=0;H<D.length;H+=1){var z=D[H],te=B(g,z),W=B(p,z);e.rect(a,te,o,W)}e.fill()}),S.length>0){e.save();var N=this.getCachedColorWithAlpha(m,v),P=this.getCachedColorWithAlpha(m,0),R=e.createLinearGradient(0,0,0,c);R.addColorStop(0,N),R.addColorStop(1,P),e.fillStyle=R;for(var A=0;A<S.length;A+=1){var M=S[A],I=B(g,M);e.translate(0,I),e.fillRect(a,0,o,c),e.translate(0,-I)}e.restore()}if(C.length>0){e.save();var x=this.getCachedColorWithAlpha(m,0),_=this.getCachedColorWithAlpha(m,v),k=e.createLinearGradient(0,0,0,c);k.addColorStop(0,x),k.addColorStop(1,_),e.fillStyle=k;for(var U=0;U<C.length;U+=1){var G=C[U],Y=B(g,G),Z=B(p,G),$=Y+Z-c;e.translate(0,$),e.fillRect(a,0,o,c),e.translate(0,-$)}e.restore()}}drawMouseColumnHover(e,t){var{mouseX:r,mouseY:i,theme:a,metrics:o}=t;if(!(r==null||i==null)){var s=me.getColumnAtX(r,o);if(!(s==null||a.columnHoverBackgroundColor==null)){var{allColumnWidths:l,allColumnXs:d,maxY:u}=o;if(!(i>u)){var c=B(d,s),m=B(l,s);e.fillStyle=a.columnHoverBackgroundColor,e.fillRect(c,0,m,u)}}}}drawMouseRowHover(e,t){var{mouseX:r,mouseY:i,theme:a,metrics:o}=t;if(!(r==null||i==null)){var{maxX:s}=o;if(!(r>s||a.rowHoverBackgroundColor==null)){var l=me.getRowAtY(i,o);l!=null&&this.drawMouseRowHoverForRow(e,t,l)}}}drawFloatingMouseRowHover(e,t){var{mouseX:r,mouseY:i,theme:a,metrics:o}=t,{maxX:s,floatingTopRowCount:l,floatingBottomRowCount:d,rowCount:u,rowFooterWidth:c}=o;if(!(r==null||i==null||r>s+c||a.rowHoverBackgroundColor==null)){var m=me.getRowAtY(i,o);m!=null&&(m<l||u-d<=m)&&this.drawMouseRowHoverForRow(e,t,m)}}drawMouseRowHoverForRow(e,t,r){var{metrics:i,selectedRanges:a,theme:o}=t,{allRowHeights:s,allRowYs:l,maxX:d}=i,u=B(l,r),c=B(s,r);o.rowHoverBackgroundColor!=null&&(e.fillStyle=o.rowHoverBackgroundColor);for(var m=0;m<a.length;m+=1){var{startRow:v,endRow:f}=a[m];if(v!=null&&f!=null&&v<=r&&f>=r){o.selectedRowHoverBackgroundColor!=null&&(e.fillStyle=o.selectedRowHoverBackgroundColor);break}}e.fillRect(0,u,d,c)}drawGridLines(e,t){var{metrics:r,theme:i}=t,{visibleColumns:a,visibleRows:o}=r;this.drawGridLinesForItems(e,t,a,o,i.gridColumnColor,i.gridRowColor)}drawGridLinesForItems(e,t,r,i,a,o){a==null&&o==null||(e.lineWidth=1,e.beginPath(),a!=null&&(e.strokeStyle=a,this.drawGridLinesForColumns(e,t,r)),o!=null&&(e.strokeStyle=o,this.drawGridLinesForRows(e,t,i)),e.stroke())}drawGridLinesForColumns(e,t,r){for(var{metrics:i}=t,{allColumnXs:a,maxY:o}=i,s=0;s<r.length;s+=1){var l=r[s],d=B(a,l)+.5;e.moveTo(d,0),e.lineTo(d,o)}}drawGridLinesForRows(e,t,r){for(var{metrics:i}=t,{allRowYs:a,maxX:o}=i,s=o,l=0;l<r.length;l+=1){var d=r[l],u=B(a,d)+.5;e.moveTo(.5,u),e.lineTo(s-.5,u)}}drawCellBackgrounds(e,t){var{metrics:r}=t,{visibleColumns:i,visibleRows:a}=r;this.drawCellBackgroundsForItems(e,t,i,a)}drawCellBackgroundsForItems(e,t,r,i){e.save();for(var a=0;a<r.length;a+=1)for(var o=r[a],s=0;s<i.length;s+=1){var l=i[s],d=s+1<i.length?i[s+1]:void 0;this.drawCellBackground(e,t,o,l,d)}e.restore()}drawCellBackground(e,t,r,i,a){var{metrics:o,model:s,theme:l}=t,{firstColumn:d,modelColumns:u,modelRows:c,allColumnXs:m,allColumnWidths:v,allRowYs:f,allRowHeights:g}=o,p=B(c,i),b=B(u,r),S=s.backgroundColorForCell(b,p,l),C=r===d,y=Ke(s)&&s.hasExpandableRows;if(S!=null){var E=B(m,r)+1,T=B(f,i)+1,O=B(v,r)-1,N=B(g,i)-1;e.fillStyle=S,e.fillRect(E,T,O,N)}C&&y&&this.drawCellRowTreeDepthLines(e,t,i,a)}drawCellContents(e,t){for(var{metrics:r}=t,{visibleColumns:i}=r,a=0;a<i.length;a+=1){var o=i[a];this.drawColumnCellContents(e,t,o)}}drawColumnCellContents(e,t,r){var{metrics:i}=t,{allColumnXs:a,allColumnWidths:o,visibleRows:s,height:l}=i,d=B(a,r),u=B(o,r);e.save(),e.beginPath(),e.rect(d,0,u,l),e.clip();for(var c=0;c<s.length;c+=1){var m=s[c];this.drawCellContent(e,t,r,m)}e.restore()}drawCellContent(e,t,r,i){var{metrics:a,model:o}=t,{modelColumns:s,modelRows:l}=a,d=B(l,i),u=B(s,r),c=o.renderTypeForCell(u,d),m=this.getCellRenderer(c);m.drawCellContent(e,t,r,i)}getCellRenderer(e){switch(e){case"dataBar":return this.dataBarCellRenderer;default:return this.textCellRenderer}}drawCellRowTreeDepthLines(e,t,r,i){var{metrics:a,model:o,theme:s}=t;if(Ke(o)){var l=o.depthForRow(r);if(l!==0){var{firstColumn:d,allColumnXs:u,allRowYs:c,allRowHeights:m}=a,{treeDepthIndent:v,treeHorizontalPadding:f,treeLineColor:g}=s,p=B(u,d),b=B(c,r),S=B(m,r),C=i!==void 0?o.depthForRow(i):0,y=l>C?l-C:0;if(e.strokeStyle=g,e.lineWidth=1,l-y>0){e.beginPath();for(var E=0;E<l-y;E+=1){var T=p+E*v+v*.5+f+.5;e.moveTo(T,b),e.lineTo(T,b+S)}e.stroke()}if(y>0){e.beginPath();for(var O=l-y;O<l;O+=1){var N=p+O*v+v*.5+f+.5;e.moveTo(N,b),e.lineTo(N,b+Math.ceil(S/2)),e.moveTo(N-.5,b+Math.ceil(S/2)+.5),e.lineTo(N+v-.5,b+Math.ceil(S/2)+.5)}e.stroke()}}}}drawHeaders(e,t){var{theme:r}=t;e.font=r.headerFont,this.drawColumnHeaders(e,t),this.drawRowHeaders(e,t)}drawFooters(e,t){var{theme:r}=t;e.font=r.headerFont,this.drawRowFooters(e,t)}drawColumnHeaders(e,t){var{mouseX:r,mouseY:i,theme:a,metrics:o,draggingColumnSeparator:s,isDragging:l,model:d}=t,{columnHeaderHeight:u,floatingColumns:c,gridX:m,width:v,visibleColumns:f,allColumnWidths:g,allColumnXs:p,floatingLeftColumnCount:b,floatingLeftWidth:S,floatingRightWidth:C,modelColumns:y,columnHeaderMaxDepth:E}=o;if(!(u<=0)){var{headerHiddenSeparatorSize:T,headerHiddenSeparatorHoverColor:O,headerSeparatorColor:N,headerSeparatorHoverColor:P}=a,R=u*.5,A=u*(E-1)+u*.5-R*.5,M=b>0;if(e.save(),this.drawColumnHeadersForRange(e,t,[f[0],f[f.length-1]],{minX:m+S,maxX:v-C}),M&&this.drawColumnHeadersForRange(e,t,[c[0],c[c.length-1]],{minX:m,maxX:m+S}),N){e.strokeStyle=N;var I=[...g.entries()].filter(rt=>{var[nt,Xe]=rt;return Xe===0}).map(rt=>{var[nt]=rt;return nt});e.beginPath(),e.fillStyle=N;for(var x=0;x<I.length;x+=1){var _=I[x],k=B(p,_),U=B(g,_),G=m+k+U+.5-T*.5;e.rect(G,A,T,R)}e.fill()}if(P){var{index:Y,depth:Z}=s??{};if(Y==null&&r!=null&&i!=null){var $=KC.getColumnSeparator(me.getGridPointFromXY(r,i,o),o,d,a);Y=$==null?void 0:$.index,Z=$==null?void 0:$.depth}var D;if(Y==null)D=!1;else{var L=y.get(Y),H=y.get(Y+1);L==null||H==null?D=!1:D=d.textForColumnHeader(L,Z)!==d.textForColumnHeader(H,Z)}if(D&&Y!=null&&Z!=null&&(!l||s!=null)){e.strokeStyle=P;var z=B(p,Y),te=B(g,Y),W=m+z+te+.5,ne=f.indexOf(Y),re=ne<f.length-1?f[ne+1]:null,se=re!=null?g.get(re):null,Ce=te===0,Me=se!=null&&se===0;Ce?(e.strokeStyle=O,e.fillStyle=O,e.fillRect(W,A,T*.5,R)):Me&&(e.fillStyle=P,e.fillRect(W-T*.5,A,T*.5,R)),e.beginPath(),e.moveTo(W,(E-Z-1)*u),e.lineTo(W,(E-Z)*u-1),e.stroke()}}e.restore()}}drawColumnHeadersForRange(e,t,r,i){var{model:a}=t,{columnHeaderMaxDepth:o}=a;if(o!==0)for(var s=0;s<=o;s+=1)this.drawColumnHeadersAtDepth(e,t,r,i,s)}drawColumnHeadersAtDepth(e,t,r,i,a){var{metrics:o,model:s,theme:l}=t,{modelColumns:d,allColumnXs:u,gridX:c,userColumnWidths:m,allColumnWidths:v,movedColumns:f}=o,{columnHeaderHeight:g,columnWidth:p}=l,{columnHeaderMaxDepth:b}=s,{minX:S,maxX:C}=i,y=C-S;if(b!==0){var E=r[0],T=r[1];if(e.save(),e.translate(0,(b-a-1)*g),a===0){this.drawColumnHeader(e,t,"",S,C);for(var O=E;O<=T;O+=1)this.drawColumnHeaderAtIndex(e,t,O,i)}if(a>0)for(var N=E;N<=T;){var{columnCount:P}=o,R=B(d,N),A=s.textForColumnHeader(R,a),M=s.colorForColumnHeader(R,a),I=B(u,N)+c,x=I+B(v,N);if(A!=null){for(var _=N-1;_>=0&&(x-I<y||I>S);){var k,U,G,Y=(k=d.get(_))!==null&&k!==void 0?k:me.getModelIndex(_,f);if(Y==null||s.textForColumnHeader(Y,a)!==A)break;var Z=(U=(G=m.get(Y))!==null&&G!==void 0?G:v.get(_))!==null&&U!==void 0?U:p;I-=Z,_-=1}for(var $=N+1;$<P&&(x-I<y||x<C);){var D,L,H,z=(D=d.get($))!==null&&D!==void 0?D:me.getModelIndex($,f);if(s.textForColumnHeader(z,a)!==A)break;var te=(L=(H=m.get(z))!==null&&H!==void 0?H:v.get($))!==null&&L!==void 0?L:p;x+=te,$+=1}N=$-1;var W=x-I>=y,ne=I;W&&(x<C?ne=x-y:I<S&&(ne=S)),this.drawColumnHeader(e,t,A,ne,Math.min(x-I,y),{backgroundColor:M??void 0},i)}N+=1}e.restore()}}drawColumnHeaderAtIndex(e,t,r,i){var a,{metrics:o,model:s}=t,{modelColumns:l,allColumnWidths:d,allColumnXs:u,gridX:c}=o,m=B(d,r),v=B(u,r)+c,f=B(l,r),g=s.textForColumnHeader(f);g!=null&&this.drawColumnHeader(e,t,g,v,m,{backgroundColor:(a=s.colorForColumnHeader(f))!==null&&a!==void 0?a:void 0},i)}drawColumnHeader(e,t,r,i,a,o,s){var l;if(!(a<=0)){var{metrics:d,theme:u}=t,{headerHorizontalPadding:c,columnHeaderHeight:m,headerBackgroundColor:v,headerColor:f,headerSeparatorColor:g,black:p,white:b}=u,{fontWidths:S,width:C}=d,y=(l=S.get(e.font))!==null&&l!==void 0?l:xa,E=a-c*2,T=E/y,{backgroundColor:O=v,separatorColor:N=g}=o??{},{textColor:P=f}=o??{};try{var R=this.getCachedColorIsDark(O),A=this.getCachedColorIsDark(P);R&&A?P=b:!R&&!A&&(P=p)}catch{}var{minX:M=0,maxX:I=C}=s??{};e.save(),e.rect(M,0,I-M,m),e.clip(),O!=null&&(e.fillStyle=O,e.fillRect(i,0,a,m)),N!=null&&(e.strokeStyle=N,e.beginPath(),i>0&&(e.moveTo(i+.5,0),e.lineTo(i+.5,m)),e.moveTo(i+a+.5,0),e.lineTo(i+a+.5,m),e.moveTo(i,m-.5),e.lineTo(i+a,m-.5),e.stroke()),e.beginPath(),e.rect(i,0,a,m),e.clip(),e.fillStyle=P;var x=r;T<=0?x="":x.length>T&&(x="".concat(x.substring(0,T-1),"…"));var _=x.length*y,k=i+a*.5,U=m*.5;M+=c,I-=c;var G=i+c,Y=Le(G,M,I),Z=i+a-c,$=Le(Z,M,I),D=$-Y,L=k-_*.5<M,H=k+_*.5>I;L?_<D?k=M+_*.5:k=Z-_*.5:H&&(_<D?k=I-_*.5:k=G+_*.5),e.textAlign="center",e.fillText(x,k,U),e.restore()}}drawRowHeaders(e,t){var{mouseX:r,mouseY:i,metrics:a,theme:o,draggingRowSeparator:s}=t,{gridY:l,rowHeaderWidth:d,height:u,visibleRows:c,allRowHeights:m,allRowYs:v}=a;if(!(d<=0)){var{headerBackgroundColor:f,headerColor:g,headerHiddenSeparatorSize:p,headerHiddenSeparatorHoverColor:b,headerSeparatorColor:S,headerSeparatorHoverColor:C}=o,y=d*.5,E=d*.5-y*.5;if(e.save(),e.beginPath(),e.fillStyle=f,e.fillRect(0,0,d,u),S){e.strokeStyle=S,e.beginPath(),e.moveTo(0,l+.5),e.lineTo(d,l+.5);for(var T=[],O=!1,N=0;N<c.length;N+=1){var P=c[N],R=B(v,P),A=B(m,P);if(A>0){var M=l+R+A+.5;e.moveTo(0,M),e.lineTo(d,M),O=!1}else O||(O=!0,T.push(P))}e.moveTo(d-.5,0),e.lineTo(d-.5,u),e.stroke(),e.beginPath(),e.fillStyle=S;for(var I=0;I<T.length;I+=1){var x=T[I],_=B(v,x),k=B(m,x),U=l+_+k+.5-p*.5;e.rect(E,U,y,p)}e.fill()}if(C){var{index:G=null}=s??{};if(G==null&&r!=null&&i!=null&&(G=me.getRowSeparatorIndex(r,i,a,o)),G!=null){e.strokeStyle=C;var Y=B(v,G),Z=B(m,G),$=l+Y+Z+.5,D=c.indexOf(G),L=D<c.length-1?c[D+1]:null,H=L!=null?m.get(L):null,z=Z===0,te=H!=null&&H===0;z?(e.strokeStyle=b,e.fillStyle=b,e.fillRect(E,$,y,p*.5)):te&&(e.fillStyle=C,e.fillRect(E,$-p*.5,y,p*.5)),e.beginPath(),e.moveTo(.5,$),e.lineTo(d+.5,$),e.stroke()}}e.beginPath(),e.rect(0,l,d,u),e.clip(),e.fillStyle=g,e.textAlign="right";for(var W=0;W<c.length;W+=1){var ne=c[W],re=B(m,ne),se=B(v,ne)+l;this.drawRowHeader(e,t,ne,se,re)}e.restore()}}drawRowHeader(e,t,r,i,a){if(!(a<=0)){var{metrics:o,model:s,theme:l}=t,{modelRows:d,rowHeaderWidth:u}=o,c=B(d,r),m=u-l.cellHorizontalPadding,v=i+a*.5;e.fillText(s.textForRowHeader(c),m,v)}}drawRowFooters(e,t){var{mouseX:r,mouseY:i,metrics:a,model:o,theme:s,draggingRowSeparator:l}=t,{gridY:d,gridX:u,maxX:c,modelRows:m,rowFooterWidth:v,height:f,verticalBarWidth:g,visibleRows:p,allRowHeights:b,allRowYs:S,width:C}=a;if(!(v<=0)){var{cellHorizontalPadding:y,headerBackgroundColor:E,headerColor:T,headerHiddenSeparatorSize:O,headerHiddenSeparatorHoverColor:N,headerSeparatorColor:P,headerSeparatorHoverColor:R}=s,A=v*.5,M=v*.5-A*.5,I=Math.min(u+c,C-v-g);if(e.save(),e.beginPath(),e.fillStyle=E,e.fillRect(I,d,v,f),P){e.strokeStyle=P,e.beginPath(),e.moveTo(I,d+.5),e.lineTo(v,d+.5);for(var x=[],_=!1,k=0;k<p.length;k+=1){var U=p[k],G=B(S,U),Y=B(b,U);if(Y>0){var Z=d+G+Y+.5;e.moveTo(I+.5,Z),e.lineTo(I+v-.5,Z),_=!1}else _||(_=!0,x.push(U))}e.moveTo(I+.5,d),e.lineTo(I+.5,f),e.stroke(),e.beginPath(),e.fillStyle=P;for(var $=0;$<x.length;$+=1){var D=x[$],L=B(S,D),H=B(b,D),z=d+L+H+.5-O*.5;e.rect(I+M,z,A,O)}e.fill()}if(R){var{index:te=null}=l??{};if(te==null&&r!=null&&i!=null&&(te=me.getRowSeparatorIndex(r,i,a,s)),te!=null){e.strokeStyle=R;var W=B(S,te),ne=B(b,te),re=d+W+ne+.5,se=p.indexOf(te),Ce=se<p.length-1?p[se+1]:null,Me=Ce!=null?b.get(Ce):null,rt=ne===0,nt=Me!=null&&Me===0;rt?(e.strokeStyle=N,e.fillStyle=N,e.fillRect(M,re,A,O*.5)):nt&&(e.fillStyle=R,e.fillRect(M,re-O*.5,A,O*.5)),e.beginPath(),e.moveTo(I+.5,re),e.lineTo(I+v+.5,re),e.stroke()}}e.beginPath(),e.rect(I,d,v,f),e.clip(),e.fillStyle=T,e.textAlign="left";for(var Xe=I+y,ft=0;ft<p.length;ft+=1){var Nt=p[ft],He=B(b,Nt);if(He>0){var Rt=B(S,Nt)+d,xt=B(m,Nt),Ur=Rt+He*.5;e.fillText(o.textForRowFooter(xt),Xe,Ur)}}e.restore()}}drawSelectedRanges(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},{cursorColumn:i,cursorRow:a,draggingRow:o,draggingColumn:s,editingCell:l,metrics:d,model:u,selectedRanges:c,theme:m}=t,{allColumnWidths:v,allColumnXs:f,allRowHeights:g,allRowYs:p,width:b,height:S}=d,{left:C=d.left,top:y=d.top,right:E=d.right,bottom:T=d.bottom,minY:O=-10,maxY:N=S+10,minX:P=-10,maxX:R=b+10}=r;if(c.length!==0){var A=tt(u)&&u.isEditable&&l==null&&o==null&&s==null&&i!=null&&a!=null&&f.has(i)&&p.has(a);if(A){var M=B(f,i),I=B(p,a),x=B(v,i),_=B(g,a);e.save(),e.beginPath(),e.rect(0,0,b,S),e.rect(M,I,x,_),e.clip("evenodd")}e.beginPath();for(var k=0;k<c.length;k+=1){var U=c[k],G=U.startColumn!==null?U.startColumn:C,Y=U.startRow!==null?U.startRow:y,Z=U.endColumn!==null?U.endColumn:E,$=U.endRow!==null?U.endRow:T;if($>=y&&T>=Y&&Z>=C&&E>=G){var D=G>=C&&f.has(G)?Math.round(B(f,G))+.5:P,L=Y>=y&&p.has(Y)?Math.max(Math.round(B(p,Y))+.5,.5):O,H=Z<=E&&f.has(Z)?Math.round(B(f,Z)+B(v,Z))-.5:R,z=$<=T&&p.has($)?Math.round(B(p,$)+B(g,$))-.5:N;e.rect(D,L,H-D,z-L)}}e.fillStyle=m.selectionColor,e.fill(),e.save(),e.clip(),e.strokeStyle=m.selectionOutlineCasingColor,e.lineWidth=3,e.stroke(),e.restore(),e.strokeStyle=m.selectionOutlineColor,e.lineWidth=1,e.stroke(),A&&i!=null&&a!=null&&(e.restore(),this.drawActiveCell(e,t,i,a))}}drawActiveCell(e,t,r,i){var a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:Tn.ACTIVE_CELL_BORDER_WIDTH,{metrics:o,theme:s}=t,{allColumnWidths:l,allColumnXs:d,allRowHeights:u,allRowYs:c}=o,m=B(d,r),v=B(c,i),f=B(l,r),g=B(u,i),p=m-a*.5,b=v-a*.5,S=f+a,C=g+a;p<=0&&(S+=p-1,p=1),b<=0&&(C+=b-1,b=1);var{lineWidth:y}=e;e.beginPath(),e.lineWidth=a,e.strokeStyle=s.selectionOutlineColor,this.drawRoundedRect(e,p,b,S,C),e.stroke(),e.lineWidth=y}drawRoundedRect(e,t,r,i,a){var o=arguments.length>5&&arguments[5]!==void 0?arguments[5]:Tn.DEFAULT_EDGE_RADIUS;e.beginPath(),e.moveTo(t+o,r),e.lineTo(t+i-o,r),e.quadraticCurveTo(t+i,r,t+i,r+o),e.lineTo(t+i,r+a-o),e.quadraticCurveTo(t+i,r+a,t+i-o,r+a),e.lineTo(t+o,r+a),e.quadraticCurveTo(t,r+a,t,r+a-o),e.lineTo(t,r+o),e.quadraticCurveTo(t,r,t+o,r),e.closePath()}drawDraggingColumn(e,t){var r,{draggingColumn:i,metrics:a,mouseX:o,theme:s,model:l}=t;if(!(i==null||o==null)){var{range:d,depth:u}=i,{gridX:c,gridY:m,allColumnXs:v,allColumnWidths:f,height:g,width:p,columnHeaderMaxDepth:b,columnHeaderHeight:S,movedColumns:C,modelColumns:y,floatingLeftWidth:E}=a,T=(r=y.get(d[0]))!==null&&r!==void 0?r:me.getModelIndex(d[0],C),O=l.getColumnHeaderGroup(T,u);if(!(u>0&&!O)){var[N,P]=d,R=B(v,N),A=B(v,P)+B(f,P),M=A-R,I=i.left,{backgroundColor:x,font:_,headerFont:k,reorderOffset:U,shadowBlur:G,shadowColor:Y}=s,Z=(b-u-1)*S;e.save(),e.translate(c,0),e.save(),e.beginPath(),e.rect(E,0,p,g),e.clip(),e.fillStyle=x,e.fillRect(R,Z,M,g),e.restore(),e.translate(0,U),e.save(),e.shadowColor=Y,e.shadowBlur=G,e.fillStyle=x,e.fillRect(i.left,Z+U,i.width,g),e.restore(),e.beginPath(),e.rect(i.left,Z,i.width+1,g),e.clip(),e.translate(I-R,0),e.font=k;for(var $=[],D=i.range[0];D<=i.range[1];D+=1)$.push(D);this.drawColumnHeaders(e,t),this.drawColumnHeadersForRange(e,t,[$[0],$[$.length-1]],{minX:R,maxX:p}),e.translate(0,m),e.font=_,this.drawGridBackground(e,t);for(var L=N;L<=P;L+=1)this.drawColumnCellContents(e,t,L);e.restore()}}}drawDraggingRow(e,t){var{draggingRow:r,draggingRowOffset:i,metrics:a,mouseY:o,theme:s}=t;if(!(r==null||o==null)){var{gridX:l,gridY:d,allRowYs:u,allRowHeights:c,width:m}=a,v=B(u,r),f=B(c,r)+1,{backgroundColor:g,font:p,headerFont:b,reorderOffset:S,shadowBlur:C,shadowColor:y}=s;e.save(),e.translate(0,d),e.fillStyle=g,e.fillRect(0,v,m,f),e.translate(l+S,o-v-d-(i??0)),e.save(),e.shadowColor=y,e.shadowBlur=C,e.fillStyle=g,e.fillRect(-l,v,m,f),e.restore(),e.beginPath(),e.rect(-l,v,m,f),e.clip(),e.font=p,this.drawGridBackground(e,t),this.drawCellContents(e,t),e.translate(-l,-d),e.font=b,this.drawRowHeaders(e,t),e.restore()}}drawScrollBars(e,t){var{isDraggingHorizontalScrollBar:r,isDraggingVerticalScrollBar:i,isDragging:a,metrics:o,mouseX:s,mouseY:l,theme:d}=t;if(!(d.scrollBarSize<=0)){var{width:u,height:c,handleHeight:m,handleWidth:v,scrollX:f,scrollY:g,hasHorizontalBar:p,hasVerticalBar:b,barWidth:S,barHeight:C,barLeft:y,barTop:E}=o,{scrollBarBackgroundColor:T,scrollBarHoverBackgroundColor:O,scrollBarCasingColor:N,scrollBarCornerColor:P,scrollBarColor:R,scrollBarHoverColor:A,scrollBarActiveColor:M,scrollBarSize:I,scrollBarHoverSize:x,scrollBarCasingWidth:_,scrollBarSelectionTick:k,scrollBarSelectionTickColor:U,scrollBarActiveSelectionTickColor:G,autoSelectRow:Y,autoSelectColumn:Z}=d,$=s!=null&&l!=null&&s<=u&&l<=c,D=i||b&&!r&&!a&&s!=null&&l!=null&&s>=u-x&&l>=E&&$,L=r||p&&!i&&!a&&!D&&s!=null&&l!=null&&l>=c-x&&s>=y&&$,H=L?x:I,z=D?x:I;if(e.translate(y,E),p&&b&&(e.fillStyle=N,e.fillRect(u-y-I,c-E-I,I,I),e.fillStyle=P,e.fillRect(u-y-I+_,c-E-I+_,I-_,I-_)),p){var te=f,W=c-E-H;if(e.fillStyle=N,e.fillRect(0,W,S,H-_),e.fillStyle=L?O:T,e.fillRect(0,W+_,S,H-_),r?e.fillStyle=M:L?e.fillStyle=A:e.fillStyle=R,e.fillRect(te,W+_,v,H-_),!Y&&k&&U!=null&&G!=null){e.fillStyle=U;for(var{selectedRanges:ne,cursorColumn:re}=t,{lastLeft:se,columnCount:Ce}=o,Me=[...ne].filter(at=>at.startColumn!=null&&at.endColumn!=null),rt=Me.map(at=>[at.startColumn,at.endColumn]).sort(me.compareRanges),nt=me.mergeSortedRanges(rt),Xe=at=>at<=se?at/se*(S-v):S-v+(at-se)/(Ce-se)*v,ft=0;ft<nt.length;ft+=1){var Nt=nt[ft],He=Nt[0],Rt=Nt[1];if(He!=null&&Rt!=null&&(He!==re||Rt!==re)){var xt=Xe(He),Ur=Math.max(1,Math.round(Xe(Rt+1)-xt)),Er=H-_;e.fillRect(xt,W+_+Math.round(Er/3),Ur,Math.round(Er/3))}}if(re!=null){var Qn=Xe(re),dn=2,Tr=H-_;e.fillStyle=G,e.fillRect(Qn,W+_,dn,Tr)}}}if(b){var it=u-y-z,Jt=g;if(e.fillStyle=N,e.fillRect(it,0,z-_,C),e.fillStyle=D?O:T,e.fillRect(it+_,0,z-_,C),i?e.fillStyle=M:D?e.fillStyle=A:e.fillStyle=R,e.fillRect(it+_,Jt,z-_,m),!Z&&k&&U!=null&&G!=null){var{selectedRanges:Vr,cursorRow:Pr}=t,{lastTop:Gr,rowCount:yi}=o,Wr=at=>at<=Gr?at/Gr*(C-m):C-m+(at-Gr)/(yi-Gr)*m;e.fillStyle=U;for(var zr=[...Vr].filter(at=>at.startRow!=null&&at.endRow!=null),hr=zr.map(at=>[at.startRow,at.endRow]).sort(me.compareRanges),Zn=me.mergeSortedRanges(hr),Jn=0;Jn<Zn.length;Jn+=1){var ei=Zn[Jn],Or=ei[0],un=ei[1];if(Or!=null&&un!=null&&(Or!==Pr||un!==Pr)){var Ei=Wr(Or),ua=z-_,Lo=Math.max(1,Math.round(Wr(un+1)-Ei));e.fillRect(it+_+Math.round(ua/3),Ei,Math.round(ua/3),Lo)}}if(Pr!=null){var ko=Math.round(Wr(Pr)),jo=z-_,$o=2;e.fillStyle=G,e.fillRect(it+_,ko,jo,$o)}}}e.translate(-y,-E)}}}Ea(Tn,"DEFAULT_EDGE_RADIUS",2);Ea(Tn,"ACTIVE_CELL_BORDER_WIDTH",2);function Qo(n,e,t){return e=KI(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function KI(n){var e=qI(n,"string");return typeof e=="symbol"?e:String(e)}function qI(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var Jv=100;class YI extends yt{constructor(){super(...arguments),Qo(this,"startPoint",void 0),Qo(this,"hasExtendedFloating",!1),Qo(this,"timer",void 0),Qo(this,"lastTriggerTime",void 0),Qo(this,"dragBounds",void 0)}onDown(e,t,r){var{x:i,y:a,column:o,row:s}=e,{metrics:l}=t;if(!l)throw new Error("metrics not set");var{gridX:d,gridY:u,maxX:c,maxY:m}=l,v=i-d,f=a-u;if(v<0||f<0||o==null&&v>c||s==null&&f>m)return!1;var g=me.isModifierKeyDown(r),p=r.shiftKey;g||(p?t.trimSelectedRanges():t.clearSelectedRanges());var b=t.getTheme(),{autoSelectRow:S,autoSelectColumn:C}=b;return(o!==null||!C)&&(s!==null||!S)&&(t.focus(),t.moveCursorToPosition(o,s,p,!1,p&&g)),this.startPoint=e,this.hasExtendedFloating=!1,this.dragBounds=me.getScrollDragBounds(l,s,o),!0}onDrag(e,t){if(this.startPoint===void 0)return!1;this.stopTimer();var{row:r,column:i}=this.startPoint,{x:a,y:o}=e,{row:s,column:l}=e,{metrics:d}=t;if(!d)throw new Error("metrics not set");var{left:u,lastLeft:c,top:m,lastTop:v,columnWidth:f,rowHeight:g}=d,p=me.getScrollDragBounds(d,r,i),b=0,S=0;if(u<c&&(a<p.x1?b=a-p.x1:a>p.x2&&(b=a-p.x2)),m<v&&(o<p.y1?S=o-p.y1:o>p.y2&&(S=o-p.y2)),b!==0||S!==0)this.startTimer(t,e,b>0?Math.ceil(b/f):Math.floor(b/f),S>0?Math.ceil(S/g):Math.floor(S/g));else if(s!=null&&l!=null){var{floatingTopRowCount:C,floatingBottomRowCount:y,floatingLeftColumnCount:E,floatingRightColumnCount:T,columnCount:O,rowCount:N,bottom:P,right:R,topVisible:A,bottomVisible:M,leftVisible:I,rightVisible:x}=d;this.hasExtendedFloating||(r!==null&&r<C&&s>=C?(s=C,this.hasExtendedFloating=!0):r!==null&&r>=N-y&&s<N-y&&(s=N-y-1,this.hasExtendedFloating=!0),i!==null&&i<E&&l>=E?(l=E,this.hasExtendedFloating=!0):i!==null&&i>=O-T&&l<O-T&&(l=O-T-1,this.hasExtendedFloating=!0)),r!==null&&!me.isFloatingRow(r,d)&&me.isFloatingRow(s,d)&&(r>s&&s<m?s=A-1:r<s&&s>P&&(s=M+1)),i!==null&&!me.isFloatingColumn(i,d)&&me.isFloatingColumn(l,d)&&(i>l&&l<u?l=I-1:i<l&&l>R&&(l=x+1)),t.moveCursorToPosition(l,s,!0,!0)}return!0}onUp(e,t){return this.startPoint!==void 0&&(this.startPoint=void 0,this.dragBounds=void 0,this.stopTimer(),t.commitSelection()),!1}moveSelection(e,t,r,i){var{row:a,column:o}=t,{metrics:s}=e;if(!s)throw new Error("metrics not set");var{selectionEndRow:l,selectionEndColumn:d}=e.state;if(l==null||d==null)throw new Error("selection not set");var{rowCount:u,columnCount:c}=s,m=r<0&&o!=null?o:0,v=r>0&&o!=null?o:c-1,f=i<0&&a!=null?a:0,g=i>0&&a!=null?a:u-1;e.moveCursorToPosition(Math.min(Math.max(m,d+r),v),Math.min(Math.max(f,l+i),g),!0),this.lastTriggerTime=Date.now()}startTimer(e,t,r,i){this.stopTimer();var a=this.lastTriggerTime!=null?Jv-Math.min(Jv,Date.now()-this.lastTriggerTime):0;this.timer=setTimeout(()=>{this.moveSelection(e,t,r,i),this.startTimer(e,t,r,i)},a)}stopTimer(){this.timer!==void 0&&(clearTimeout(this.timer),this.timer=void 0)}}const XI=YI;function ef(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function mr(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?ef(Object(t),!0).forEach(function(r){$i(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):ef(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function $i(n,e,t){return e=QI(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function QI(n){var e=ZI(n,"string");return typeof e=="symbol"?e:String(e)}function ZI(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var tf=5,JI=1e3/60,bl=10;function Ii(n,e,t,r){var i,{modelColumns:a,movedColumns:o,allColumnXs:s,columnCount:l,allColumnWidths:d,userColumnWidths:u,calculatedColumnWidths:c,floatingLeftWidth:m,maxX:v}=t;if(e==null||n==null||n>l||n<0)return null;var f=(i=a.get(n))!==null&&i!==void 0?i:me.getModelIndex(n,o),g=r.getColumnHeaderGroup(f,e),p=g!=null,b,S,C;if(g!=null){var y,E,T,[O,N]=g.getVisibleRange(o);b=(y=s.get(O))!==null&&y!==void 0?y:m,S=((E=s.get(N))!==null&&E!==void 0?E:v)+((T=d.get(N))!==null&&T!==void 0?T:0),C=[O,N]}else{var P,R,A,M=s.get(n);if(M==null)return null;b=M,S=b+((P=(R=(A=d.get(n))!==null&&A!==void 0?A:u.get(f))!==null&&R!==void 0?R:c.get(f))!==null&&P!==void 0?P:0),C=[n,n]}return{visibleIndex:n,modelIndex:f,left:b,right:S,width:S-b,isColumnGroup:p,range:C,depth:e}}class eF extends yt{constructor(){super(...arguments),$i(this,"cursor",null),$i(this,"draggingOffset",void 0),$i(this,"initialOffset",void 0),$i(this,"initialGridPoint",void 0),$i(this,"scrollingInterval",void 0),$i(this,"scrollingDirection",void 0),$i(this,"draggingColumn",null)}setScrollInterval(e,t){this.scrollingInterval!=null&&t===this.scrollingDirection||(this.scrollingDirection=t,this.scrollingInterval=window.setInterval(()=>{var{metrics:r}=e;if(r){var{left:i,lastLeft:a,leftOffset:o,userColumnWidths:s,calculatedColumnWidths:l,movedColumns:d,allColumnWidths:u}=r,c=i,m=o;if(t==="left")for(m-=bl;m<0;){var v;c-=1;var f=me.getModelIndex(i-1,d),g=(v=s.get(f))!==null&&v!==void 0?v:l.get(f);g===void 0?m=0:m+=g,c<0&&(m=0,c=0)}else{m+=bl;for(var p=u.get(i);p!==void 0&&m>p;){var b;c+=1,m-=p;var S=me.getModelIndex(i+1,d);p=(b=s.get(S))!==null&&b!==void 0?b:l.get(S),c>a&&(m=0,c=a)}}var{mouseX:C,mouseY:y}=e.state;r==null||C==null||y==null||(this.moveDraggingColumn(C,e,t==="left"?-bl:bl),e.setState({left:c,leftOffset:m}),(t==="left"&&c===0&&o===0||t==="right"&&c===a)&&this.clearScrollInterval())}},JI))}clearScrollInterval(){this.scrollingDirection=void 0,window.clearInterval(this.scrollingInterval),this.scrollingInterval=void 0}onLeave(){return this.clearScrollInterval(),!1}onDown(e,t){var{model:r}=t.props,{x:i,column:a,columnHeaderDepth:o}=e,{metrics:s}=t;if(!s)throw new Error("Metrics not set");var l=Ii(a,o,s,r);if(a==null||l==null||o==null||o>0&&!l.isColumnGroup)return!1;var{rowHeaderWidth:d}=s;return this.initialGridPoint=e,this.draggingColumn=null,this.cursor=null,l.modelIndex!=null&&o!=null&&r.isColumnMovable(l.modelIndex,o)&&(this.draggingOffset=i-l.left-d,this.initialOffset=this.draggingOffset),!1}onDrag(e,t,r){if(this.draggingOffset===void 0||this.initialGridPoint===void 0||this.initialOffset===void 0)return!1;var{x:i,y:a}=e,{columnHeaderDepth:o}=this.initialGridPoint,{model:s}=t.props,{draggingColumn:l}=this,{metrics:d}=t;if(!d)throw new Error("Metrics not set");if(!l&&Math.abs(this.initialGridPoint.x-i)<tf&&Math.abs(this.initialGridPoint.y-a)<tf)return!1;if(l==null){var u=Ii(this.initialGridPoint.column,o,d,s);if(!u||o==null||!s.isColumnMovable(u.modelIndex)||o>0&&!u.isColumnGroup||u.range[0]==null)return!1;l={range:u.range,depth:o,left:u.left,width:u.width};var c=Ii(l.range[0],0,d,s),m=Ii(l.range[1],0,d,s);if(!c||!m)return!1;this.draggingColumn=l,t.setState({draggingColumn:l,isDragging:!0})}return this.cursor="move",this.moveDraggingColumn(e.x,t,r.movementX),!0}moveDraggingColumn(e,t,r){var i;if(!(this.draggingOffset===void 0||this.initialGridPoint===void 0||this.initialOffset===void 0||this.draggingColumn==null||r===0)){if(this.initialOffset!==this.draggingOffset){this.draggingOffset<this.initialOffset&&this.initialOffset<this.draggingOffset+r||this.draggingOffset>this.initialOffset&&this.initialOffset>this.draggingOffset+r?this.draggingOffset=this.initialOffset:this.draggingOffset+=r,this.draggingColumn=mr(mr({},this.draggingColumn),{},{left:e-this.draggingOffset}),t.setState({draggingColumn:this.draggingColumn});return}var{depth:a}=this.draggingColumn,{model:o}=t.props,{movedColumns:s}=t.state,{metrics:l}=t;if(!l)throw new Error("Metrics not set");var{floatingLeftWidth:d,width:u,columnHeaderMaxDepth:c,allColumnXs:m}=l,v=r<0,f=Ii(this.draggingColumn.range[0],a,l,o);if(f){var g=e-this.draggingOffset,p=g+f.width;this.draggingColumn=mr(mr({},this.draggingColumn),{},{left:g}),t.setState({draggingColumn:this.draggingColumn});var b=Ii(me.getColumnAtX(Le(v?g:p,d,u),l,!0),a,l,o),S=o.getColumnHeaderParentGroup(f.modelIndex,f.depth);if(b){if(S!==void 0){var C=S.getVisibleRange(s);if(b.visibleIndex<C[0]){var y,E=this.moveColumn(f,C[0],s);this.draggingOffset=e-((y=m.get(C[0]))!==null&&y!==void 0?y:0),this.draggingColumn=mr(mr({},this.draggingColumn),{},{left:e-this.draggingOffset}),this.clearScrollInterval(),t.setState({draggingColumn:this.draggingColumn,movedColumns:E});return}if(b.visibleIndex>C[1]){var T,O=this.moveColumn(f,C[1]-(f.range[1]-f.range[0]),s),{right:N=0}=(T=Ii(C[1],0,l,o))!==null&&T!==void 0?T:{};this.draggingOffset=e-(N-f.width),this.draggingColumn=mr(mr({},this.draggingColumn),{},{left:e-this.draggingOffset}),this.clearScrollInterval(),t.setState({draggingColumn:this.draggingColumn,movedColumns:O});return}}if(!o.isColumnMovable(b.modelIndex)){var P=b.visibleIndex;if(v)for(P+=1;P<f.visibleIndex&&!o.isColumnMovable(me.getModelIndex(P,s));)P+=1;else for(P-=1;P>f.visibleIndex&&!o.isColumnMovable(me.getModelIndex(P,s));)P-=1;if(P!==f.visibleIndex){v||(P-=f.range[1]-f.range[0]);var R=this.moveColumn(f,P,s);t.setState({movedColumns:R,draggingColumn:this.draggingColumn})}var A=Ii(P,0,l,o);if(v){var M;this.draggingOffset=e-((M=A==null?void 0:A.left)!==null&&M!==void 0?M:0)}else{var I;this.draggingOffset=e-(((I=A==null?void 0:A.right)!==null&&I!==void 0?I:0)-f.width)}this.draggingColumn=mr(mr({},this.draggingColumn),{},{left:e-this.draggingOffset}),t.setState({draggingColumn:this.draggingColumn});return}if(g<=d?this.setScrollInterval(t,"left"):p>u?this.setScrollInterval(t,"right"):this.clearScrollInterval(),b.visibleIndex!==f.visibleIndex&&!(v&&f.visibleIndex<b.visibleIndex||!v&&f.visibleIndex>b.visibleIndex)){for(var x=b.left+b.width*.5,_=o.getColumnHeaderParentGroup(f.modelIndex,f.depth),k,U=((i=_==null?void 0:_.depth)!==null&&i!==void 0?i:c)-1;U>=0&&k===void 0;)k=o.getColumnHeaderGroup(b.modelIndex,U),U-=1;var G;v&&g<x&&(!k||b.visibleIndex===k.getVisibleRange(s)[0])&&(G=this.moveColumn(f,b.range[0],s)),!v&&p>x&&(!k||b.visibleIndex===k.getVisibleRange(s)[1])&&(G=this.moveColumn(f,b.range[1]-(f.range[1]-f.range[0]),s)),G&&(this.draggingColumn=mr(mr({},this.draggingColumn),{},{left:g}),t.setState({movedColumns:G,draggingColumn:this.draggingColumn}))}}}}}moveColumn(e,t,r){var i=e.isColumnGroup?me.moveRange(e.range,t,r):me.moveItem(e.visibleIndex,t,r),a=t-e.range[0],o=[e.range[0]+a,e.range[1]+a];return this.draggingColumn&&(this.draggingColumn=mr(mr({},this.draggingColumn),{},{range:o})),i}onUp(e,t){return this.cursor=null,this.clearScrollInterval(),this.draggingOffset!=null?(this.draggingOffset=void 0,t.setState({draggingColumn:null,isDragging:!1}),!0):!1}}const tF=eF;function rf(n,e,t){return e=rF(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function rF(n){var e=nF(n,"string");return typeof e=="symbol"?e:String(e)}function nF(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class Oc extends yt{constructor(){super(...arguments),rf(this,"dragOffset",void 0),rf(this,"cursor","default")}static getLeftWithOffsetFromRawLeft(e,t){var r=e.getTheme(),{metrics:i,metricCalculator:a}=e;if(!i)throw new Error("metrics not set");if(r.scrollSnapToColumn){var o=Math.round(t),s=0;return{left:o,leftOffset:s}}var l=Math.floor(t),d=t-l,u=i.allColumnWidths.get(l);if(u==null){var c=e.getMetricState();u=a.getVisibleColumnWidth(l,c)}var m=u*d;return{left:l,leftOffset:m}}isInScrollBar(e,t){var r=t.getTheme(),{scrollBarSize:i,scrollBarHoverSize:a}=r,{metrics:o}=t;if(!o)throw new Error("metrics not set");var{x:s,y:l}=e,{barLeft:d,barWidth:u,height:c,hasHorizontalBar:m}=o;return m&&i>0&&l>=c-a&&l<c&&s>d&&s<d+u}getLeftWithOffset(e,t){var r,{metrics:i}=t;if(!i)throw new Error("metrics not set");var{x:a}=e,{barWidth:o,handleWidth:s,lastLeft:l,barLeft:d,columnCount:u,scrollableContentWidth:c,scrollableViewportWidth:m}=i,v=a-d,f=Le((v-((r=this.dragOffset)!==null&&r!==void 0?r:0))/(o-s),0,1);if(u===1)return{left:0,leftOffset:f*(c-m)};var g=f*l;return Oc.getLeftWithOffsetFromRawLeft(t,g)}onDown(e,t){var{metrics:r}=t;if(!r)throw new Error("metrics not set");var{x:i}=e,{handleWidth:a,barLeft:o,scrollX:s}=r;if(!this.isInScrollBar(e,t))return!1;var l=i-o;if(l>=s&&l<=s+a)this.dragOffset=l-s,t.setState({isDraggingHorizontalScrollBar:!0});else{this.dragOffset=0;var{left:d,leftOffset:u}=this.getLeftWithOffset(e,t);t.setViewState({left:d,leftOffset:u,isDraggingHorizontalScrollBar:!0,isDragging:!0})}return!0}onDrag(e,t){if(this.dragOffset!=null){var{left:r,leftOffset:i}=this.getLeftWithOffset(e,t);return t.setViewState({left:r,leftOffset:i,isDraggingHorizontalScrollBar:!0,isDragging:!0}),!0}return!1}onMove(e,t){return this.isInScrollBar(e,t)}onUp(e,t){return this.dragOffset!==void 0&&(this.dragOffset=void 0,t.setState({isDraggingHorizontalScrollBar:!1,isDragging:!1})),this.isInScrollBar(e,t)}onClick(e,t){return this.isInScrollBar(e,t)}}const iF=Oc;function nf(n,e,t){return e=aF(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function aF(n){var e=oF(n,"string");return typeof e=="symbol"?e:String(e)}function oF(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class sF extends yt{constructor(){super(...arguments),nf(this,"cursor","move"),nf(this,"draggingOffset",void 0)}onDown(e,t){var{model:r}=t.props,{x:i,y:a,row:o}=e,{metrics:s}=t;if(!s)throw new Error("metrics not set");var{columnHeaderHeight:l,rowHeaderWidth:d,allRowYs:u}=s;if(i<=d&&o!==null&&r.isRowMovable(o)){var c=B(u,o);this.draggingOffset=a-c-l,t.setState({draggingRowOffset:this.draggingOffset})}return!1}onDrag(e,t){if(this.draggingOffset==null)return!1;var{model:r}=t.props,{draggingRow:i}=t.state,{mouseX:a,mouseY:o}=t.state;if(a==null||o==null)return!1;if(i==null){var{row:s}=t.getGridPointFromXY(a,o);if(s!=null&&!r.isRowMovable(s)||(i=s,t.setState({draggingRow:i,isDragging:!0}),i==null))return!1}var{metrics:l}=t;if(!l)throw new Error("metrics not set");var{top:d,lastTop:u,bottom:c,bottomVisible:m,rowCount:v,columnHeaderHeight:f,allRowHeights:g,allRowYs:p,height:b}=l,S=f;if(d<i){var C=i-1;S=B(p,C)+B(g,C)*.5+f}var y=b;if(i<c){var E=i+1;y=B(p,E)+B(g,E)*.5+f}var{movedRows:T}=t.state;o<S&&i>0&&r.isRowMovable(i-1)?(T=me.moveItem(i,i-1,T),i-=1):y<o&&i<v-1&&r.isRowMovable(i+1)&&(T=me.moveItem(i,i+1,T),i+=1),t.setState({movedRows:T,draggingRow:i});var O=f+B(g,d)*.5,N=f+B(p,m)+B(g,m)*.5;return o<O&&d>0?t.setState({top:d-1}):o>N&&d<u&&t.setState({top:d+1}),!0}onUp(e,t){return this.draggingOffset!==void 0?(this.draggingOffset=void 0,t.setState({draggingRowOffset:null,draggingRow:null,isDragging:!1}),!0):!1}}const lF=sF;function tr(n,e,t){return e=dF(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function dF(n){var e=uF(n,"string");return typeof e=="symbol"?e:String(e)}function uF(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class Dc extends zC{constructor(){super(...arguments),tr(this,"hiddenCursor","s-resize"),tr(this,"defaultCursor","row-resize"),tr(this,"pointProperty","y"),tr(this,"userSizesProperty","userRowHeights"),tr(this,"visibleOffsetProperty","visibleRowYs"),tr(this,"visibleSizesProperty","visibleRowHeights"),tr(this,"marginProperty","columnHeaderHeight"),tr(this,"calculatedSizesProperty","calculatedRowHeights"),tr(this,"initialSizesProperty","initialRowHeights"),tr(this,"modelIndexesProperty","modelRows"),tr(this,"firstIndexProperty","firstRow"),tr(this,"treePaddingProperty","treePaddingY"),tr(this,"getHiddenItems",me.getHiddenRows),tr(this,"getNextShownItem",me.getNextShownRow),tr(this,"getSeparator",Dc.getRowSeparator)}static getRowSeparator(e,t,r,i){if(!i.allowRowResize)return null;var{x:a,y:o}=e,s=me.getRowSeparatorIndex(a,o,t,i);return s!=null?{index:s,depth:0}:null}setSize(e,t,r){e.setRowHeight(t,r)}resetSize(e,t){e.resetRowHeight(t)}updateSeparator(e,t){e.setState({draggingRowSeparator:t,isDragging:t!==null})}}const hF=Dc;class rd extends yt{static isInTreeBox(e,t){var{column:r,row:i,x:a,y:o}=e,{metrics:s}=t;if(!s)throw new Error("metrics not set");var{gridX:l,gridY:d,firstColumn:u,allColumnXs:c,allColumnWidths:m,allRowHeights:v,allRowYs:f,visibleRowTreeBoxes:g}=s;if(r===u&&i!=null&&g.get(i)!=null&&a>l&&o>d){var p=B(c,r),b=B(m,r),S=B(f,i),C=B(v,i);if(a>=l+p&&a<=l+p+b&&o>=d+S&&o<=d+S+C)return!0}return!1}onDown(e,t){return rd.isInTreeBox(e,t)}onClick(e,t,r){if(rd.isInTreeBox(e,t)){var{row:i}=e;if(i!==null)return t.toggleRowExpanded(i,me.isModifierKeyDown(r)),!0}return!1}}const Eh=rd;class cF extends yt{isInCorner(e,t){var r=t.getTheme(),{scrollBarSize:i}=r,{metrics:a}=t;if(!a)throw new Error("metrics not set");var{x:o,y:s}=e,{width:l,height:d,hasVerticalBar:u,hasHorizontalBar:c}=a;return i>0&&u&&c&&o>=l-i&&s>=d-i&&o<=l&&s<=d}onDown(e,t){return this.isInCorner(e,t)}onUp(e,t){return this.isInCorner(e,t)}onClick(e,t){return this.isInCorner(e,t)}}const mF=cF;function af(n,e,t){return e=vF(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function vF(n){var e=fF(n,"string");return typeof e=="symbol"?e:String(e)}function fF(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class Nc extends yt{constructor(){super(...arguments),af(this,"dragOffset",void 0),af(this,"cursor","default")}static getTopWithOffsetFromRawTop(e,t){var r=e.getTheme(),{metrics:i,metricCalculator:a}=e;if(!i)throw new Error("metrics not set");if(r.scrollSnapToRow){var o=Math.round(t),s=0;return{top:o,topOffset:s}}var l=Math.floor(t),d=t-l,u=i.allRowHeights.get(l);if(u==null){var c=e.getMetricState();u=a.getVisibleRowHeight(l,c)}var m=u*d;return{top:l,topOffset:m}}isInScrollBar(e,t){var r=t.getTheme(),{scrollBarSize:i,scrollBarHoverSize:a}=r,{metrics:o}=t;if(!o)throw new Error("metrics not set");var{x:s,y:l}=e,{barTop:d,barHeight:u,width:c,hasVerticalBar:m}=o;return m&&i>0&&s>=c-a&&s<c&&l>d&&l<d+u}getTopWithOffset(e,t){var r,{metrics:i}=t;if(!i)throw new Error("metrics not set");var{y:a}=e,{barHeight:o,handleHeight:s,lastTop:l,barTop:d,rowCount:u,scrollableContentHeight:c,scrollableViewportHeight:m}=i,v=a-d,f=Le((v-((r=this.dragOffset)!==null&&r!==void 0?r:0))/(o-s),0,1);if(u===1)return{top:0,topOffset:f*(c-m)};var g=f*l;return Nc.getTopWithOffsetFromRawTop(t,g)}onDown(e,t){var{metrics:r}=t;if(!r)throw new Error("metrics not set");var{y:i}=e,{handleHeight:a,barTop:o,scrollY:s}=r;if(!this.isInScrollBar(e,t))return!1;var l=i-o;if(l>=s&&l<=s+a)this.dragOffset=l-s,t.setState({isDraggingVerticalScrollBar:!0});else{this.dragOffset=0;var{top:d,topOffset:u}=this.getTopWithOffset(e,t);t.setViewState({top:d,topOffset:u,isDraggingVerticalScrollBar:!0,isDragging:!0})}return!0}onMove(e,t){return this.isInScrollBar(e,t)}onDrag(e,t){if(this.dragOffset!=null){var{top:r,topOffset:i}=this.getTopWithOffset(e,t);return t.setViewState({top:r,topOffset:i,isDraggingVerticalScrollBar:!0,isDragging:!0}),!0}return!1}onUp(e,t){return this.dragOffset!==void 0&&(this.dragOffset=void 0,t.setState({isDraggingVerticalScrollBar:!1,isDragging:!1})),this.isInScrollBar(e,t)}onClick(e,t){return this.isInScrollBar(e,t)}}const gF=Nc;class pF extends yt{onDoubleClick(e,t){var{column:r,row:i}=e,{model:a}=t.props;return tt(a)&&r!=null&&i!=null&&a.isEditableRange(Q.makeCell(r,i))?(t.startEditing(r,i),!0):!1}}const bF=pF;function QC(n){return(n==null?void 0:n.getTokenBoxesForVisibleCell)!==void 0}function us(n,e,t){return e=CF(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function CF(n){var e=SF(n,"string");return typeof e=="symbol"?e:String(e)}function SF(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class Hd extends yt{constructor(){super(...arguments),us(this,"timeoutId",void 0),us(this,"isHold",!1),us(this,"isDown",!1),us(this,"currentLinkBox",void 0)}isHoveringLink(e,t){var{column:r,row:i,x:a,y:o}=e,{renderer:s,metrics:l,props:d}=t,{model:u}=d;if(r==null||i==null||l==null)return this.currentLinkBox=void 0,!1;var{modelRows:c,modelColumns:m}=l,v=B(c,i),f=B(m,r),g=u.renderTypeForCell(f,v),p=s.getCellRenderer(g);if(!QC(p))return!1;if(this.currentLinkBox!=null){var{x1:b,y1:S,x2:C,y2:y}=this.currentLinkBox;if(a>=b&&a<=C&&o>=S&&o<=y)return!0}for(var E=t.updateRenderState(),T=p.getTokenBoxesForVisibleCell(r,i,E),O=0;O<T.length;O+=1)if(td(T[O].token)){var N=me.translateTokenBox(T[O],l),{x1:P,x2:R,y1:A,y2:M}=N;if(a>=P&&a<=R&&o>=A&&o<=M)return this.currentLinkBox=N,!0}return this.currentLinkBox=void 0,!1}setCursor(e,t){return this.isHoveringLink(e,t)?this.cursor="pointer":this.cursor=null,!1}onMove(e,t){return this.setCursor(e,t)}onDown(e,t,r){var i=this.isHoveringLink(e,t);return me.isModifierKeyDown(r)||r.shiftKey||!i?!1:(this.isDown=!0,this.timeoutId!=null&&clearTimeout(this.timeoutId),this.isHold=!1,this.timeoutId=setTimeout(()=>{this.isHold=!0;var{column:a,row:o}=e,{model:s}=t.props;t.clearSelectedRanges(),t.focus(),t.moveCursorToPosition(a,o),tt(s)&&a!=null&&o!=null&&s.isEditableRange(Q.makeCell(a,o))&&t.startEditing(a,o)},Hd.HOLD_LENGTH),!0)}onClick(e,t){var r=this.isHoveringLink(e,t);if(!r||!this.isDown||this.currentLinkBox==null)return this.isDown=!1,this.isHold=!1,!1;if(!this.isHold){var i;this.timeoutId!=null&&clearTimeout(this.timeoutId),this.timeoutId=void 0,t.props.onTokenClicked((i=this.currentLinkBox)===null||i===void 0?void 0:i.token)}return this.isHold=!1,this.isDown=!1,!0}}us(Hd,"HOLD_LENGTH",1e3);const wF=Hd;function yF(n,e,t){return e=EF(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function EF(n){var e=TF(n,"string");return typeof e=="symbol"?e:String(e)}function TF(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class PF{constructor(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:5e3;yF(this,"order",void 0),this.order=e}onDown(e,t){return!1}onUp(e,t){return!1}}const Ba=PF;class OF extends Ba{onDown(e,t){switch(e.key){case"a":if(me.isModifierKeyDown(e))return t.selectAll(),!0;break;case"ArrowUp":return this.handleArrowMove(0,-1,e,t);case"ArrowDown":return this.handleArrowMove(0,1,e,t);case"ArrowRight":return this.handleArrowMove(1,0,e,t);case"ArrowLeft":return this.handleArrowMove(-1,0,e,t);case"k":case"K":return me.isModifierKeyDown(e)?!1:this.handlePageUp(e,t);case"j":case"J":return me.isModifierKeyDown(e)?!1:this.handlePageDown(e,t);case"h":case"H":return me.isModifierKeyDown(e)?!1:(e.shiftKey||t.clearSelectedRanges(),t.moveCursorToPosition(0,t.state.cursorRow,e.shiftKey),!0);case"l":case"L":{if(me.isModifierKeyDown(e))return!1;var{model:r}=t.props,{columnCount:i}=r;return e.shiftKey||t.clearSelectedRanges(),t.moveCursorToPosition(i-1,t.state.cursorRow,e.shiftKey),!0}case"PageDown":return this.handlePageDown(e,t);case"PageUp":return this.handlePageUp(e,t);case"Home":return e.shiftKey||t.clearSelectedRanges(),t.moveCursorToPosition(me.isModifierKeyDown(e)?t.state.cursorColumn:0,me.isModifierKeyDown(e)?0:t.state.cursorRow,e.shiftKey,!0,!0),!0;case"End":{var{model:a}=t.props,{columnCount:o,rowCount:s}=a;return e.shiftKey||t.clearSelectedRanges(),t.moveCursorToPosition(me.isModifierKeyDown(e)?t.state.cursorColumn:o-1,me.isModifierKeyDown(e)?s-1:t.state.cursorRow,e.shiftKey,!0,!0),!0}case"Escape":return t.clearSelectedRanges(),{preventDefault:!1,stopPropagation:!1};case"Enter":if(t.state.selectedRanges.length>0)return t.moveCursorInDirection(e.shiftKey?Q.SELECTION_DIRECTION.UP:Q.SELECTION_DIRECTION.DOWN),!0;break;case"Tab":if(t.state.selectedRanges.length>0)return t.moveCursorInDirection(e.shiftKey?Q.SELECTION_DIRECTION.LEFT:Q.SELECTION_DIRECTION.RIGHT),!0;break}return!1}handleArrowMove(e,t,r,i){var a=r.shiftKey,o=me.isModifierKeyDown(r);a?i.trimSelectedRanges():i.clearSelectedRanges();var{cursorRow:s,cursorColumn:l,selectionEndColumn:d,selectionEndRow:u}=i.state,c=a?d:l,m=a?u:s;if(o){var{model:v}=i.props,{columnCount:f,rowCount:g}=v,p=o&&a,b=null,S=null;e<0?(b=0,S=m):e>0?(b=f-1,S=m):t<0?(b=c,S=0):t>0&&(b=c,S=g-1),b!=null&&S!=null&&i.moveCursorToPosition(b,S,a,!0,p)}else{if(!i.metrics)throw new Error("grid.metrics are not set");var{theme:C}=i.props,{autoSelectRow:y=!1,autoSelectColumn:E=!1}=C;if(y&&e!==0){var{lastLeft:T}=i.metrics,{left:O}=i.state;O=Le(O+e,0,T),i.moveCursorToPosition(O,s,a,!1),i.setViewState({left:O})}else if(E&&t!==0){var{lastTop:N}=i.metrics,{top:P}=i.state;P=Le(P+t,0,N),i.moveCursorToPosition(P,l,a,!1),i.setViewState({top:P})}else i.moveCursor(e,t,a)}return!0}handlePageUp(e,t){var r=e.shiftKey;r?t.trimSelectedRanges():t.clearSelectedRanges();var{cursorColumn:i,selectionEndRow:a}=t.state,o=a,s=i;if(o==null)return!1;var l=t.getMetricState(),{metricCalculator:d}=t,{bottomVisible:u,topVisible:c,hasHorizontalBar:m}=d.getMetrics(l),v=o-(u-c);v-=m?0:1,v=Math.max(v,0);var f=Math.max(v-(o-c),0);return t.moveCursorToPosition(s,v,r,!1),t.setViewState({top:f}),!0}handlePageDown(e,t){var r=e.shiftKey;r?t.trimSelectedRanges():t.clearSelectedRanges();var{selectionEndRow:i,cursorColumn:a}=t.state,o=i,s=a;if(o===null)return!1;var l=t.getMetricState(),{metricCalculator:d}=t,{bottomVisible:u,topVisible:c,hasHorizontalBar:m,rowCount:v,lastTop:f}=d.getMetrics(l),g=v-1,p=u-c+o;p+=m?0:1,p=Math.min(p,g);var b=Math.min(f,p-(o-c));return t.moveCursorToPosition(s,p,r,!1),t.setViewState({top:b}),!0}}const DF=OF;class NF extends Ba{onDown(e,t){switch(e.key){case"Enter":case" ":return this.handleExpandKey(e,t)}return!1}handleExpandKey(e,t){var{selectedRanges:r}=t.state;if(r.length===1){var i=r[0];if(i.startRow===i.endRow&&i.startColumn===i.endColumn){if(!t.metrics)throw new Error("grid.metrics not set");var{model:a}=t.props,{startRow:o,startColumn:s}=i;if(o!=null){var l=t.getModelRow(o);if((s===0||s==null)&&Ke(a)&&a.isRowExpandable(l))return t.toggleRowExpanded(o),!0}}}return!1}}const RF=NF;class IF extends Ba{onDown(e,t){if(me.isModifierKeyDown(e))return!1;var{model:r}=t.props,{cursorColumn:i,cursorRow:a}=t.state;if(i==null||a==null||!tt(r)||!r.isEditableRange(Q.makeCell(i,a)))return!1;var o=i,s=a;return o==null||s==null?!1:e.key.length===1?(t.startEditing(o,s,!0,[1,1],e.key),!0):e.key==="F2"?(t.startEditing(o,s),!0):e.key==="Backspace"?(t.startEditing(o,s,!0,void 0,""),!0):e.key==="Delete"?(t.setValueForCell(o,s,""),!0):!1}}const FF=IF;function _F(n){for(var e=[],t=n.querySelectorAll("tr"),r=0;r<t.length;r+=1){for(var i=t[r],a=i.querySelectorAll("td"),o=[],s=0;s<a.length;s+=1){var l,d,u=a[s];o.push((l=(d=u.textContent)===null||d===void 0?void 0:d.trim())!==null&&l!==void 0?l:"")}e.push(o)}return e}function MF(n){var e=[];return n.forEach(t=>{var r,i=(r=t.textContent)!==null&&r!==void 0?r:"";i.length>0&&e.push(i.split(/\t|\u00a0\u00a0 \u00a0/))}),e}function xF(n){var e,t,r=n.querySelector("table");if(r!=null)return _F(r);var i=(e=(t=n.textContent)===null||t===void 0?void 0:t.trim())!==null&&e!==void 0?e:"";if(i.length>0){var{childNodes:a}=n,o=i.includes(" "),s=i.includes(" ");return o&&a.length!==0&&(a.length===1||a.length>1&&(a[0].textContent==null||!a[0].textContent.includes(" ")))?i.split(`
|
|
1
|
+
import{r as w,G as oe,ag as iy,C as h,D as Sr,E as X,R as bd,V,F as ue,L as qe,ah as Bh,U as Se,K as wt,ai as ay,aj as oy,Y as Uh,a0 as Cd,ak as sy,al as ly,am as dy,X as Le,an as gb,ao as mt,a9 as be,ap as ge,aq as cm,ar as uy,as as Vh,at as hy,au as cy,av as my,aw as vy,a6 as Gh,a7 as fy,ax as pb,ay as dh,Z as Sd,az as rn,aA as gy,aB as Un,aC as py,aD as by,aE as Cy,aF as Sy,aG as uh,aH as wy,aI as yy,aJ as Ey,aK as mm,aL as Ty,aM as vm,aN as Py,aO as Oy,aP as Dy,aQ as Ny,aR as Ry,aS as Iy,a8 as bo,aT as Fy,aU as $n,aV as _r,aW as ea,aX as fm,aY as _y,aZ as ps,a_ as ln,a$ as bb,b0 as My}from"./vendor-fc3cb542.js";import{T as et,L as ie,M as wd,o as yd,b as Ed,R as Cb,U as xy,V as Sb,X as Ay,Y as wb,Z as xs,g as yb,f as Ly,e as Td,y as ky,B as jy,D as $y,x as Hy,E as By,s as Uy,I as Vy,m as Gy,_ as Eb,$ as Wy,O as zy,h as j,a0 as hh,a1 as Ky,a2 as qy,r as Wh,z as Tb,a3 as Pd,a as As,a4 as B,a5 as ta,n as ia,a6 as zh,a7 as Kh,a8 as Kl,a9 as Yy,aa as ti,c as vi,ab as Xy,ac as Qy,ad as Pa,ae as Pb,af as Zy,ag as Jy,ah as e0,ai as t0,aj as qh,v as Br,ak as Aa,al as gm,am as Ls,an as Yh,ao as Xh,ap as Od,aq as Co,ar as r0,as as n0,at as ql,au as i0,av as Qh,aw as Ob,ax as a0,ay as o0,d as s0,az as l0,aA as d0,aB as u0,aC as h0,aD as pm,aE as Mu,aF as c0,aG as m0,aH as v0,aI as f0,aJ as g0,aK as Db,aL as Zh,aM as bm,aN as p0,aO as b0,aP as C0,aQ as S0,aR as Nb,aS as w0,aT as Cm,aU as Yl,aV as Sm,aW as Rb,aX as y0,aY as Dd,aZ as E0,a_ as T0,a$ as P0,b0 as O0,b1 as D0,b2 as N0,b3 as R0,b4 as I0,b5 as F0,b6 as _0,b7 as M0,b8 as x0,b9 as A0,ba as L0,bb as k0,bc as j0,bd as $0,be as H0,bf as B0,bg as Ib,bh as U0,bi as wm,bj as V0,bk as G0,bl as W0,bm as z0}from"./index-3ec6d911.js";import{P as Re,b as lt,v as xu,c as K0,a as Jh,T as q0,t as Fb,r as ym,g as Y0,C as X0,u as Q0,e as aa,s as _b,o as Z0,n as J0,q as eE}from"./usePlugins-c5a289f4.js";import{c as Au,P as ec,b as tE,h as rE,p as nE,o as iE,s as aE,t as oE}from"./plotly-94807d7b.js";var Te=Object.freeze([]),Jr=new Map,k2=()=>{};function Lu(){for(var n=arguments.length,e=new Array(n),t=0;t<n;t++)e[t]=arguments[t];return e.filter(r=>r!=null)}function sE(n){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,t=lE(n,e);t.forEach(r=>{n[r]=n[r].bind(n)})}function lE(n,e){for(var t=new Set,r=n,i=0;r!=null&&r!==Object.prototype&&(i<=1||e);){for(var a of Object.getOwnPropertyNames(r))a!=="constructor"&&typeof r[a]=="function"&&t.add(a);r=Object.getPrototypeOf(r),i+=1}return[...t.keys()]}function Em(n,e,t,r,i,a,o){try{var s=n[a](o),l=s.value}catch(d){t(d);return}s.done?e(l):Promise.resolve(l).then(r,i)}function dE(n){return function(){var e=this,t=arguments;return new Promise(function(r,i){var a=n.apply(e,t);function o(l){Em(a,r,i,o,s,"next",l)}function s(l){Em(a,r,i,o,s,"throw",l)}o(void 0)})}}function Ro(n){return ch.apply(this,arguments)}function ch(){return ch=dE(function*(n){var{clipboard:e}=navigator;if(e!==void 0)try{return navigator.clipboard.writeText(n)}catch{return Tm(n)}Tm(n)}),ch.apply(this,arguments)}function Tm(n){var e=document.activeElement,t=document.createElement("textarea");t.value=n,document.body.appendChild(t),t.focus(),t.select();var r=document.execCommand("copy");if(document.body.removeChild(t),e instanceof HTMLElement&&e.focus(),!r)throw new Error("Unable to execute copy command")}function Io(n,e,t){return e=uE(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function uE(n){var e=hE(n,"string");return typeof e=="symbol"?e:String(e)}function hE(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var cE="table_",Mb="column_",mE=new Set(["in","not","i","ii","k"]),vE=new Set(["abstract","continue","for","new","switch","assert","default","if","package","synchronized","boolean","do","goto","private","this","break","double","implements","protected","throw","byte","else","import","public","throws","case","enum","instanceof","return","transient","catch","extends","int","short","try","char","final","interface","static","void","class","finally","long","strictfp","volatile","const","float","native","super","while","null","true","false"]),fE=/[^a-zA-Z0-9_$+@-]/g,gE=/[^A-Za-z0-9_$]/g;class sn{}Io(sn,"legalize",(n,e,t,r,i)=>{var a=n.trim().replace(/[- ]/g,"_");return r&&(mE.has(a)||vE.has(a))&&(a=e+a),a=a.replace(t,""),a||(a=e+i),Number.isNaN(Number(a.charAt(0)))||(a=e+a),a});Io(sn,"legalizeTableName",n=>sn.legalize(n,cE,fE,!1,0));Io(sn,"legalizeColumnNames",n=>{var e=[];return n.forEach((t,r)=>{var i=sn.legalizeColumnName(t,r);e.includes(i)&&(i=Mb+r),e.push(i)}),e});Io(sn,"legalizeColumnName",function(n){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return sn.legalize(n,Mb,gE,!0,e)});Io(sn,"isValidTableName",n=>sn.legalizeTableName(n)===n);Io(sn,"isValidColumnName",n=>sn.legalizeColumnName(n)===n);const ks=sn;class Qe extends CustomEvent{constructor(e,t){super(e,t)}}function Pm(n,e,t){return e=pE(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function pE(n){var e=bE(n,"string");return typeof e=="symbol"?e:String(e)}function bE(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class CE{constructor(){Pm(this,"pending",[]),Pm(this,"resolved",[])}add(e,t){var r=Re.makeCancelable(e,t);return this.pending.push(r),r.then(()=>{this.resolve(r)},()=>{this.resolve(r)}),r}remove(e){for(var t=0;t<this.pending.length;t+=1)if(this.pending[t]===e){this.pending.splice(t,1);return}}resolve(e){this.remove(e),this.resolved.push(e)}cancel(){for(var e=[...this.pending,...this.resolved],t=0;t<e.length;t+=1)e[t].cancel();this.pending=[],this.resolved=[]}}const qn=CE;function Om(n,e){var t=new Set([...Object.keys(n),...Object.keys(e)]),r=[];return t.forEach(i=>{n[i]!==e[i]&&r.push(i)}),r}class tc{static isValidRange(e){return e!=null&&e.length===2&&Number.isInteger(e[0])&&Number.isInteger(e[1])&&e[0]<=e[1]}static validateRange(e){if(!tc.isValidRange(e))throw new Error("Invalid range! ".concat(e))}static isSelected(e,t){for(var r=0;r<e.length;r+=1){var i=e[r],a=i[0],o=i[1];if(a<=t&&t<=o)return!0}return!1}static selectRange(e,t){for(var[r,i]=t,a=[...e],o=a.length-1;o>=0;o-=1){var s=a[o],l=s[0],d=s[1];if(l<=r&&i<=d)return a;r<=d&&l<=i&&(r=Math.min(r,l),i=Math.max(i,d),a.splice(o,1))}return a.push([r,i]),a}static deselectRange(e,t){for(var[r,i]=t,a=[...e],o=a.length-1;o>=0;o-=1){var s=a[o],l=s[0],d=s[1];if(!(i<l||d<r))if(l<r&&i<d){a[o]=[l,r-1],a.splice(o+1,0,[i+1,d]);break}else r<=l&&d<=i?a.splice(o,1):l<r?a[o]=[l,r-1]:a[o]=[i+1,d]}return a}static count(e){return e.reduce((t,r)=>t+(r[1]-r[0]+1),0)}static getItemsInRanges(e,t){return t.reduce((r,i)=>{for(var a=[...r],o=i[0];o<=i[1];o+=1)a.push(e[o]);return a},[])}}const An=tc;function*j2(n,e){for(var t=n;t<=e;++t)yield t}class SE{static join(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"and";if(e==null||e.length===0)return"";if(e.length===1)return e[0];if(e.length===2)return"".concat(e[0]," ").concat(t," ").concat(e[1]);var r=e.slice(0,e.length-1).join(", "),i=e[e.length-1];return"".concat(r,", ").concat(t," ").concat(i)}static toLower(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;if(e==null){if(t)return"";throw new Error("Null string passed in to TextUtils.toLower")}return e.toLowerCase()}static sort(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;return e<t?r?-1:1:e>t?r?1:-1:0}}const Mr=SE;function xb(n,e,t){return e=wE(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function wE(n){var e=yE(n,"string");return typeof e=="symbol"?e:String(e)}function yE(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class js{static formatElapsedTime(e){if(typeof e!="number"||!Number.isInteger(e))throw new Error("".concat(e," is not a number that can be expressed as a formatted time"));var t=Math.floor(e/3600),r=Math.floor(e%3600/60),i=e%60;return"".concat(t>0?"".concat(t,"h "):"")+"".concat(r>0||t>0?"".concat(r,"m "):"")+"".concat(e>=60?"".concat(i,"s").padStart(3,"0"):"".concat(i,"s"))}static formatTime(e){if(typeof e!="number"||!Number.isInteger(e)||e<0)throw new Error("".concat(e," is not a number that can be expressed as a formatted time"));var t=String(Math.floor(e/(60*60))).padStart(2,"0"),r=e%(60*60),i=String(Math.floor(r/60)).padStart(2,"0"),a=r%60,o=String(Math.ceil(a)).padStart(2,"0");return"".concat(t,":").concat(i,":").concat(o)}static isTimeString(e){return new RegExp(js.TIME_PATTERN).test(e)}static parseTime(e){if(e==null||typeof e!="string")throw new Error("".concat(e," is not a valid string"));var t=e.split(":");if(t.length!==3)throw new Error("".concat(e," is not a time string that can be parsed"));return Number(t[0])*60*60+Number(t[1])*60+Number(t[2])}}xb(js,"TIME_PATTERN","([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]");xb(js,"TIME_ZONES",Object.freeze([{label:"Tokyo UTC+9 No DST",value:"Asia/Tokyo"},{label:"Seoul UTC+9 No DST",value:"Asia/Seoul"},{label:"Hong Kong UTC+8 No DST",value:"Asia/Hong_Kong"},{label:"Singapore UTC+8 No DST",value:"Asia/Singapore"},{label:"Kolkata UTC+5:30 No DST",value:"Asia/Kolkata"},{label:"Berlin UTC+1",value:"Europe/Berlin"},{label:"UTC UTC±0 No DST",value:"UTC"},{label:"London UTC±0",value:"Europe/London"},{label:"Sao Paulo UTC-2",value:"America/Sao_Paulo"},{label:"Newfoundland UTC-3:30",value:"America/St_Johns"},{label:"Halifax UTC-4",value:"America/Halifax"},{label:"New York UTC−5",value:"America/New_York"},{label:"Chicago UTC-6",value:"America/Chicago"},{label:"Denver UTC-7",value:"America/Denver"},{label:"Los Angeles UTC-8",value:"America/Los_Angeles"},{label:"Anchorage UTC-9",value:"America/Anchorage"},{label:"Honolulu UTC-10 No DST",value:"Pacific/Honolulu"},{label:"Zurich UTC+1",value:"Europe/Zurich"},{label:"Amsterdam UTC+1",value:"Europe/Amsterdam"},{label:"Taipei UTC+8 No DST",value:"Asia/Taipei"},{label:"Sydney UTC+10",value:"Australia/Sydney"}]));const rc=js;function EE(n,e,t){return e=TE(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function TE(n){var e=PE(n,"string");return typeof e=="symbol"?e:String(e)}function PE(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class OE extends Error{constructor(){super(...arguments),EE(this,"isInvalid",!0)}}const mo=OE;function Dm(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function DE(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Dm(Object(t),!0).forEach(function(r){vo(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Dm(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function vo(n,e,t){return e=NE(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function NE(n){var e=RE(n,"string");return typeof e=="symbol"?e:String(e)}function RE(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class nc extends w.Component{constructor(e){super(e),vo(this,"element",void 0),vo(this,"container",void 0),vo(this,"rAF",void 0),this.handleEnter=this.handleEnter.bind(this),this.handleExit=this.handleExit.bind(this),this.handleBlur=this.handleBlur.bind(this),this.element=document.createElement("div"),this.element.className="popper-container",this.container=oe.createRef(),this.rAF=0;var{isShown:t}=this.props;this.state={show:t,popper:null}}componentDidUpdate(e){var{isShown:t}=this.props;e.isShown!==t&&(t?(cancelAnimationFrame(this.rAF),this.rAF=window.requestAnimationFrame(()=>{this.show()})):this.hide())}componentWillUnmount(){this.destroyPopper(!1)}getVisibleElement(e){return e==null||e.clientHeight>0||e.clientWidth>0?e:this.getVisibleElement(e.parentElement)}initPopper(){var{popper:e}=this.state,{closeOnBlur:t,referenceObject:r}=this.props;if(!e&&this.container.current!==null){var{options:i}=this.props;i=DE({placement:"auto",modifiers:{preventOverflow:{boundariesElement:"viewport"}}},i),document.body.appendChild(this.element);var a=this.getVisibleElement(this.container.current);a==null&&(a=this.container.current),e=new iy(r||a,this.element,i),e.scheduleUpdate(),cancelAnimationFrame(this.rAF),this.rAF=window.requestAnimationFrame(()=>{if(t&&!this.element.contains(document.activeElement)){var o=this.element.firstElementChild;o instanceof HTMLElement&&o.focus()}}),this.setState({popper:e})}}destroyPopper(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;cancelAnimationFrame(this.rAF);var{popper:t}=this.state;t&&(t.destroy(),document.body.contains(this.element)&&document.body.removeChild(this.element),e&&this.setState({popper:null}))}show(){this.initPopper(),this.setState({show:!0})}hide(){this.setState({show:!1})}scheduleUpdate(){var{popper:e}=this.state;e&&e.scheduleUpdate()}handleBlur(e){e.relatedTarget instanceof HTMLElement&&(this.element.contains(e.relatedTarget)||this.hide())}handleEnter(){var{onEntered:e}=this.props;e()}handleExit(){var{onExited:e}=this.props,{show:t}=this.state;t||this.destroyPopper(),e()}renderContent(){var{className:e,children:t,timeout:r,interactive:i,closeOnBlur:a}=this.props,{show:o}=this.state;return h.jsx(Sr,{in:o,timeout:r,classNames:"popper-transition",onEntered:this.handleEnter,onExited:this.handleExit,children:h.jsx("div",{onClick:s=>{s.stopPropagation()},onKeyDown:s=>{s.key==="Escape"&&this.hide()},className:X("popper",{interactive:i},e),onBlur:a?this.handleBlur:void 0,tabIndex:a?-1:void 0,role:"presentation",children:h.jsxs("div",{className:"popper-content",children:[t,h.jsx("div",{className:"popper-arrow","x-arrow":""})]})})})}render(){var{popper:e}=this.state,{"data-testid":t}=this.props;return h.jsx("div",{className:"popper-parent-container",ref:this.container,style:{display:"none"},"data-testid":t,children:e&&bd.createPortal(this.renderContent(),this.element)})}}vo(nc,"propTypes",{children:V.node.isRequired,options:V.shape({}),className:V.string,timeout:V.number,onEntered:V.func,onExited:V.func,isShown:V.bool,closeOnBlur:V.bool,interactive:V.bool,referenceObject:V.shape({}),"data-testid":V.string});vo(nc,"defaultProps",{options:{},className:"",timeout:et.transitionMs,onEntered(){},onExited(){},isShown:!1,interactive:!1,closeOnBlur:!1,referenceObject:null,"data-testid":void 0});const La=nc;function Nm(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function IE(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Nm(Object(t),!0).forEach(function(r){yn(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Nm(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function yn(n,e,t){return e=FE(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function FE(n){var e=_E(n,"string");return typeof e=="symbol"?e:String(e)}function _E(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var ME=ie.module("Tooltip");class Tt extends w.Component{static handleHidden(){Tt.shownTooltipCount-=1,Tt.shownTooltipCount===0&&(Tt.lastHiddenTime=Date.now())}static handleShown(){Tt.shownTooltipCount+=1}constructor(e){super(e),yn(this,"container",void 0),yn(this,"popper",void 0),yn(this,"parent",void 0),yn(this,"timer",void 0),this.handleMouseMove=this.handleMouseMove.bind(this),this.handleMouseLeave=this.handleMouseLeave.bind(this),this.handleWindowMouseMove=this.handleWindowMouseMove.bind(this),this.handleWheel=this.handleWheel.bind(this),this.handleTimeout=this.handleTimeout.bind(this),this.handleExited=this.handleExited.bind(this),this.stopShowingTooltip=this.stopShowingTooltip.bind(this),this.container=oe.createRef(),this.popper=oe.createRef(),this.parent=null,this.timer=null,this.state={isShown:!1}}componentDidMount(){this.startListening();var{timeout:e}=this.props;e===0&&this.show()}componentDidUpdate(e,t){var{isShown:r}=t,{isShown:i}=this.state;i!==r&&(i?Tt.handleShown():Tt.handleHidden())}componentWillUnmount(){this.stopListening(),this.stopListeningWindow(),this.stopTimer();var{isShown:e}=this.state;e&&Tt.handleHidden()}startListening(){if(!this.container.current||!this.container.current.parentElement){ME.error("Tooltip doesn't have a container or a parent set!");return}this.parent=this.container.current.parentElement,this.parent.addEventListener("mousemove",this.handleMouseMove),this.parent.addEventListener("mouseleave",this.handleMouseLeave),this.parent.addEventListener("mousedown",this.stopShowingTooltip)}stopListening(){this.parent&&(this.parent.removeEventListener("mousemove",this.handleMouseMove),this.parent.removeEventListener("mouseleave",this.handleMouseLeave),this.parent.removeEventListener("mousedown",this.stopShowingTooltip))}startListeningWindow(){window.addEventListener("mousemove",this.handleWindowMouseMove,!0),window.addEventListener("contextmenu",this.stopShowingTooltip,!0),window.addEventListener("wheel",this.handleWheel)}stopListeningWindow(){window.removeEventListener("mousemove",this.handleWindowMouseMove,!0),window.removeEventListener("contextmenu",this.stopShowingTooltip,!0),window.removeEventListener("wheel",this.handleWheel)}handleMouseMove(){this.startTimer()}handleWheel(){var{isShown:e}=this.state;this.popper.current&&this.parent&&e&&!this.popper.current.element.matches(":hover")&&!this.parent.matches(":hover")&&(this.stopTimer(),this.hide())}handleMouseLeave(){var{isShown:e}=this.state;this.stopTimer();var{interactive:t}=this.props;!t&&e&&this.hide()}handleTimeout(){this.show()}handleWindowMouseMove(e){var t=e.clientX,r=e.clientY,{isShown:i}=this.state;if(!(!this.popper.current||!this.parent)){var a=this.popper.current.element.getBoundingClientRect(),o=this.parent.getBoundingClientRect();t>=a.left&&t<=a.left+a.width&&r>=a.top&&r<=a.top+a.height?this.handleMouseMove():t>=o.left&&t<=o.left+o.width&&r>=o.top&&r<=o.top+o.height?this.handleMouseMove():i&&(this.stopTimer(),this.hide())}}startTimer(){this.stopTimer();var{timeout:e,reshowTimeout:t}=this.props,r=e;(Tt.shownTooltipCount>0||Date.now()-Tt.lastHiddenTime<Tt.triggerReshowThreshold)&&(r=t),this.timer=window.setTimeout(this.handleTimeout,r)}stopTimer(){this.timer!=null&&(clearTimeout(this.timer),this.timer=null)}show(){var{isShown:e}=this.state;if(this.stopTimer(),!e){var t;(t=this.popper.current)===null||t===void 0||t.show(),this.setState({isShown:!0});var{interactive:r}=this.props;r&&this.startListeningWindow()}}hide(){var e;(e=this.popper.current)===null||e===void 0||e.hide(),this.stopListeningWindow()}update(){var e;(e=this.popper.current)===null||e===void 0||e.scheduleUpdate()}handleExited(){this.setState({isShown:!1});var{onExited:e}=this.props;e()}stopShowingTooltip(){var{isShown:e}=this.state;this.stopTimer(),e&&this.hide()}render(){var{interactive:e,children:t,referenceObject:r,popperClassName:i,"data-testid":a,onEntered:o}=this.props,{isShown:s}=this.state,{options:l}=this.props;return l=IE({placement:"bottom"},l),h.jsx("div",{ref:this.container,style:{display:"none"},"data-testid":a,children:h.jsx(La,{className:X(i,"popper-tooltip"),options:l,ref:this.popper,onEntered:o,onExited:this.handleExited,interactive:e,referenceObject:r,children:h.jsxs("div",{className:"tooltip-content",children:[" ",s&&t]})})})}}yn(Tt,"defaultTimeout",500);yn(Tt,"defaultReshowTimeout",100);yn(Tt,"triggerReshowThreshold",300);yn(Tt,"shownTooltipCount",0);yn(Tt,"lastHiddenTime",Date.now());yn(Tt,"defaultProps",{interactive:!1,options:{},popperClassName:"",reshowTimeout:Tt.defaultReshowTimeout,timeout:Tt.defaultTimeout,onEntered:()=>{},onExited:()=>{},"data-testid":void 0});const Ot=Tt;function Ab(){var n=w.useRef(!1);return w.useEffect(()=>(n.current=!0,()=>{n.current=!1}),[]),n}function Rm(n,e,t,r,i,a,o){try{var s=n[a](o),l=s.value}catch(d){t(d);return}s.done?e(l):Promise.resolve(l).then(r,i)}function xE(n){return function(){var e=this,t=arguments;return new Promise(function(r,i){var a=n.apply(e,t);function o(l){Rm(a,r,i,o,s,"next",l)}function s(l){Rm(a,r,i,o,s,"throw",l)}o(void 0)})}}var AE=ie.module("useAsyncInterval");function LE(n,e){var t=Ab(),r=w.useRef(0),i=w.useRef(0),a=w.useRef(null),o=w.useCallback(xE(function*(){var s=Date.now();i.current+=1;var l=a.current==null?e:s-a.current;a.current=s;try{yield n()}catch(c){AE.error("A tick error occurred:",c)}if(t.current){l+=Date.now()-a.current;var d=Math.max(0,l-e),u=Math.max(0,e-d);r.current=window.setTimeout(o,u)}}),[n,t,e]);w.useEffect(()=>(a.current=null,o(),()=>{window.clearTimeout(r.current)}),[e,o])}function Nd(n){var e=w.useRef();return w.useEffect(function(){e.current=n}),e.current}function ic(n){var e=w.useRef(null);return w.useEffect(function(){n&&(typeof n=="function"?n(e.current):n.current=e.current)}),e}var kE=3500,jE=ie.module("useCopyToClipboard");function $E(){var[n,e]=w.useState(!1),t=w.useRef(null),r=w.useCallback(i=>{Ro(i).then(()=>{e(!0)}).catch(a=>jE.error("Unable to copy ".concat(i),`
|
|
2
|
+
`,a))},[]);return w.useEffect(()=>(t.current&&clearTimeout(t.current),n&&(t.current=setTimeout(()=>{e(!1)},kE)),()=>{t.current&&clearTimeout(t.current)}),[n]),[n,r]}function Rd(n){var{children:e,className:t,style:r,"data-testid":i}=n;return h.jsx("div",{className:X("btn-group",t),style:r,role:"group","data-testid":i,children:e})}Rd.displayName="ButtonGroup";Rd.propTypes={children:V.node.isRequired,className:V.string,style:V.object,"data-testid":V.string};Rd.defaultProps={className:null,style:{},"data-testid":void 0};var HE=["kind","variant","type","tooltip","icon","disabled","active","onClick","onContextMenu","onMouseDown","onMouseUp","onMouseEnter","onMouseLeave","onKeyDown","className","style","children","tabIndex","data-testid","aria-label"];function Im(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function Fm(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Im(Object(t),!0).forEach(function(r){BE(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Im(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function BE(n,e,t){return e=UE(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function UE(n){var e=VE(n,"string");return typeof e=="symbol"?e:String(e)}function VE(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function GE(n,e){if(n==null)return{};var t=WE(n,e),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(n);for(i=0;i<a.length;i++)r=a[i],!(e.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(n,r)&&(t[r]=n[r])}return t}function WE(n,e){if(n==null)return{};var t={},r=Object.keys(n),i,a;for(a=0;a<r.length;a++)i=r[a],!(e.indexOf(i)>=0)&&(t[i]=n[i]);return t}var zE=["primary","secondary","tertiary","success","danger","inline","ghost"],KE=["group-end"];function qE(n,e){switch(n){case"primary":return"btn-primary";case"secondary":return"btn-outline-primary";case"tertiary":return"btn-secondary";case"success":return"btn-success";case"danger":return"btn-danger";case"inline":return"btn-inline";case"ghost":return X("btn-link",{"btn-link-icon":e,"btn-link-icon-only":e})}}function YE(n){switch(n){case"group-end":return X("pl-2","pr-3")}}var Id=oe.forwardRef((n,e)=>{var{kind:t,variant:r,type:i,tooltip:a,icon:o,disabled:s=!1,active:l,onClick:d,onContextMenu:u,onMouseDown:c,onMouseUp:m,onMouseEnter:v,onMouseLeave:f,onKeyDown:g,className:p,style:b,children:S,tabIndex:C,"data-testid":y,"aria-label":E}=n,T=GE(n,HE),O;r&&(O=YE(r));var N;o&&(N=oe.isValidElement(o)?o:h.jsx(ue,{icon:o}));var P=N!=null&&S==null,R=qE(t,P),A;a!==void 0&&(A=typeof a=="string"?h.jsx(Ot,{children:a}):a);var M=E;E===void 0&&P&&a!=null&&typeof a=="string"&&(M=a);var I=h.jsxs("button",Fm(Fm({"data-testid":y,ref:e,type:i,className:X("btn",R,O,{active:l},p),onClick:d,onContextMenu:u,onMouseUp:m,onMouseDown:c,onMouseEnter:v,onMouseLeave:f,onKeyDown:g,style:b,disabled:s,tabIndex:C,"aria-label":M},T),{},{children:[o&&N,S,a!=null&&!s&&A]}));return s&&a!=null?h.jsxs("span",{className:"btn-disabled-wrapper",children:[I,A]}):I});Id.displayName="Button";Id.propTypes={kind:V.oneOf(zE).isRequired,variant:V.oneOf(KE),type:V.oneOf(["submit","reset","button"]),tooltip(n){var{tooltip:e,icon:t,children:r}=n;return e===void 0&&t!=null&&r==null?new Error("Tooltip is required for icon only buttons"):null},icon(n){var{children:e,icon:t}=n;return t==null&&e==null?new Error("Icon is required if no children are provided"):e==null&&!oe.isValidElement(t)&&(t==null||t.iconName===""||t.iconName==null)?new Error("Icon must be react element or fontawesome IconDefinition"):null},disabled:V.bool,active:V.bool,onClick(n){var{onClick:e,type:t}=n;return t==="button"&&typeof e!="function"?new Error("type button requires an onClick function"):e!==void 0&&typeof e!="function"?new Error("onClick must be a function"):null},onContextMenu:V.func,onMouseUp:V.func,onMouseDown:V.func,onMouseEnter:V.func,onMouseLeave:V.func,onKeyDown:V.func,tabIndex:V.number,children:V.node,className:V.string,style:V.object,"data-testid":V.string};Id.defaultProps={type:"button",onClick:void 0,onContextMenu:void 0,onMouseUp:void 0,onMouseDown:void 0,onMouseEnter:void 0,onMouseLeave:void 0,onKeyDown:void 0,variant:void 0,tooltip:void 0,icon:void 0,disabled:!1,active:void 0,tabIndex:void 0,children:void 0,className:void 0,style:{},"data-testid":void 0};const K=Id;function ac(n){var{className:e="modal-footer",children:t,"data-testid":r}=n;return h.jsx("div",{className:e,"data-testid":r,children:t})}function Ma(n){var{isOpen:e,headerText:t,bodyText:r,onCancel:i,onConfirm:a,onDiscard:o,onModalDisable:s,cancelButtonText:l="Cancel",confirmButtonText:d="Okay",discardButtonText:u="Discard",isConfirmDanger:c=!1,children:m,"data-testid":v}=n,f=w.useRef(null),g=w.useRef(null),p=w.useCallback(()=>{g.current!==null&&g.current.checked&&s&&s(),a()},[a,s]),b=w.useCallback(()=>{var C;(C=f.current)===null||C===void 0||C.focus()},[]),S="";return e&&(S=typeof r=="function"?r():r),h.jsxs(wd,{isOpen:e,onOpened:b,children:[h.jsx(yd,{closeButton:!1,children:t}),h.jsx(Ed,{children:S}),h.jsxs(ac,{children:[s&&h.jsxs("div",{className:"custom-control custom-checkbox form-group mr-auto",children:[h.jsx("input",{type:"checkbox",className:"custom-control-input",id:"move-confirmation-checkbox",defaultChecked:!1,ref:g,"data-testid":v!==void 0?"".concat(v,"-checkbox-confirm"):void 0}),h.jsx("label",{className:"custom-control-label",htmlFor:"move-confirmation-checkbox",children:"Don't ask me again"})]}),o&&h.jsx(K,{kind:"secondary",className:"mr-auto","data-dismiss":"modal",onClick:o,"data-testid":v!==void 0?"".concat(v,"-btn-discard"):void 0,children:u}),i&&h.jsx(K,{kind:"secondary","data-dismiss":"modal",onClick:i,"data-testid":v!==void 0?"".concat(v,"-btn-cancel"):void 0,children:l}),h.jsxs(Rd,{children:[h.jsx(K,{kind:c?"danger":"primary",onClick:p,ref:f,"data-testid":v!==void 0?"".concat(v,"-btn-confirm"):void 0,children:d}),m]})]})]})}Ma.propTypes={isOpen:V.bool.isRequired,headerText:V.string.isRequired,bodyText:V.oneOfType([V.string,V.func]).isRequired,onCancel:V.func,onConfirm:V.func.isRequired,onDiscard:V.func,onModalDisable:V.func,cancelButtonText:V.string,confirmButtonText:V.string,discardButtonText:V.string,children:V.node,"data-testid":V.string};Ma.defaultProps={children:void 0,cancelButtonText:"Cancel",confirmButtonText:"Okay",discardButtonText:"Discard",onCancel:void 0,onDiscard:void 0,onModalDisable:void 0,"data-testid":void 0};var Fd=oe.forwardRef((n,e)=>{var{children:t,className:r,disabled:i,onClick:a,style:o,id:s}=n;return h.jsx("button",{ref:e,type:"button",className:X("btn",r),onClick:a,style:o,disabled:i,id:s,children:t})});Fd.displayName="Button";Fd.propTypes={children:V.node,className:V.string,disabled:V.bool,onClick:V.func,style:V.shape({}),id:V.string};Fd.defaultProps={children:null,className:"",disabled:!1,onClick:()=>null,style:{},id:""};const _m=Fd;function oc(n){var{className:e,isFlipped:t,children:r,"data-testid":i}=n,a=d=>{if(r.length!==2)throw new Error("CardFlip requires 2 children to function");return r[d]},o=w.useRef(null),s=w.useCallback(d=>{d.target===d.currentTarget&&document.body.classList.add("card-flip--is-flipping")},[]),l=w.useCallback(d=>{d.target===d.currentTarget&&document.body.classList.remove("card-flip--is-flipping")},[]);return w.useEffect(function(){if(!o.current)throw Error("ref undefined");o.current.addEventListener("transitionstart",s);var u=o.current;return function(){if(u!=null)return u.removeEventListener("transitionstart",s)}},[s]),h.jsxs("div",{className:X(e,{"card-flip--show-front":t,"card-flip--show-back":!t}),"data-testid":i,children:[h.jsx("div",{className:"card-flip--back",children:a(0)}),h.jsx("div",{ref:o,className:"card-flip--front",onTransitionEnd:l,children:a(1)})]})}var Mm=ie.module("GlobalContextAction");class XE extends w.Component{constructor(e){super(e),this.handleContextMenu=this.handleContextMenu.bind(this),this.handleKeyDown=this.handleKeyDown.bind(this)}componentDidMount(){document.body.addEventListener("contextmenu",this.handleContextMenu),document.body.addEventListener("keydown",this.handleKeyDown)}componentWillUnmount(){document.body.removeEventListener("contextmenu",this.handleContextMenu),document.body.removeEventListener("keydown",this.handleKeyDown)}handleContextMenu(e){var t=e;t.contextActions==null&&(t.contextActions=[]);var{action:r}=this.props;r.title==null&&!r.menuElement||(t.contextActions==null&&(t.contextActions=[]),t.contextActions.push(r),Mm.debug("Received context menu event at global action! Menu items are now: ",t.contextActions))}handleKeyDown(e){var{action:t}=this.props;if(!lt.actionsDisabled&&t.shortcut!==void 0&&t.shortcut.matchesEvent(e)){var r;Mm.debug("Global hotkey matched!",e),(r=t.action)===null||r===void 0||r.call(t,e),e.preventDefault(),e.stopPropagation()}}render(){return null}}const QE=XE;class ZE extends w.Component{render(){for(var{actions:e,"data-testid":t}=this.props,r=[],i=0;i<e.length;i+=1){var a=e[i],{shortcut:o}=a;if(a.title!=null||a.menuElement||o){var s=h.jsx(QE,{action:a,"data-testid":t},"".concat(a.title,".").concat(o==null?void 0:o.id));r.push(s)}}return r}}const JE=ZE;function Lb(n,e,t){return e=eT(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function eT(n){var e=tT(n,"string");return typeof e=="symbol"?e:String(e)}function tT(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var al=ie.module("ContextActions");class kb extends w.Component{static triggerMenu(e,t,r,i){if(i.length!==0){var a=new MouseEvent("contextmenu",{clientX:t,clientY:r,bubbles:!0,cancelable:!0});a.contextActions=i,e.dispatchEvent(a)}}constructor(e){super(e),Lb(this,"container",void 0),this.handleContextMenu=this.handleContextMenu.bind(this),this.handleKeyDown=this.handleKeyDown.bind(this),this.container=oe.createRef(),this.state={globalActions:[],keyboardActions:[]}}static getDerivedStateFromProps(e){if(e.actions==null||!Array.isArray(e.actions))return{globalActions:[],keyboardActions:[]};var t=e.actions.filter(i=>!xu(i)&&typeof i!="function"&&i.isGlobal),r=e.actions.filter(i=>!xu(i)&&typeof i!="function"&&(i.isGlobal===void 0||!i.isGlobal)&&i.shortcut!=null);return{globalActions:t,keyboardActions:r}}componentDidMount(){var e;(e=this.container.current)!==null&&e!==void 0&&e.parentElement&&(this.container.current.parentElement.addEventListener("contextmenu",this.handleContextMenu),this.container.current.parentElement.addEventListener("keydown",this.handleKeyDown))}componentWillUnmount(){var e;(e=this.container.current)!==null&&e!==void 0&&e.parentElement&&(this.container.current.parentElement.removeEventListener("contextmenu",this.handleContextMenu),this.container.current.parentElement.removeEventListener("keydown",this.handleKeyDown))}handleContextMenu(e){var{ignoreClassNames:t=[]}=this.props;if(t.length>0)for(var r=e.target,i=function(){var{classList:d}=r,u=t.find(c=>d.contains(c));if(u!==void 0)return al.debug2('Contextmenu event ignored based on the target className "'.concat(u,'"')),{v:void 0};r=r.parentElement};r!=null;){var a=i();if(typeof a=="object")return a.v}if(lt.isContextActionEvent(e)||(e.contextActions=[]),!!lt.isContextActionEvent(e)){var{actions:o}=this.props;if(o!=null){var s=o;Array.isArray(s)&&(s=s.filter(l=>xu(l)||typeof l=="function"||l.isGlobal===void 0||!l.isGlobal)),e.contextActions=e.contextActions.concat(s)}al.debug("Received context menu event! Menu items are now: ",e.contextActions)}}handleKeyDown(e){for(var{keyboardActions:t}=this.state,r=0;r<t.length;r+=1){var i=t[r];if(!lt.actionsDisabled&&i.shortcut!=null&&i.shortcut.matchesEvent(e)){var a;al.debug("Context hotkey matched!",e),(a=i.action)===null||a===void 0||a.call(i,e),e.stopPropagation(),e.preventDefault(),al.debug2("Matched hotkey returned false, key event not consumed")}}}render(){var{"data-testid":e}=this.props,{globalActions:t}=this.state;return h.jsx("div",{className:"context-actions-listener",ref:this.container,"data-testid":e,children:h.jsx(JE,{actions:t})})}}Lb(kb,"groups",{default:void 0,high:100,medium:5e3,low:1e4,global:1e5,edit:100});const le=kb;var _d=oe.forwardRef((n,e)=>{var{checked:t=!1,children:r,className:i,disabled:a,inputClassName:o,isInvalid:s,labelClassName:l,name:d,onChange:u,"data-testid":c}=n,[m]=w.useState(qe()),v=ic(e);w.useEffect(function(){v.current&&(v.current.indeterminate=t===null)},[v,t]);var f=w.useCallback(g=>{v.current&&(v.current.indeterminate=t===null),u&&u(g)},[v,t,u]);return h.jsxs("div",{className:X("custom-control custom-checkbox",i),children:[h.jsx("input",{type:"checkbox",ref:v,checked:t??!1,className:X("custom-control-input",o,{"is-invalid":s}),disabled:a,id:m,name:d,onChange:f,"data-testid":c}),h.jsx("label",{className:X("custom-control-label",l),htmlFor:m,children:r})]})});_d.displayName="Checkbox";_d.propTypes={checked:(n,e)=>{var{[e]:t}=n;return t!==null&&typeof t!="boolean"?new Error("Checked must be a boolean or null for indeterminate"):null},children:V.node.isRequired,className:V.string,disabled:V.bool,inputClassName:V.string,isInvalid:V.bool,labelClassName:V.string,name:V.string,onChange:V.func,"data-testid":V.string};_d.defaultProps={checked:!1,className:"",disabled:!1,inputClassName:"",isInvalid:!1,labelClassName:"",name:void 0,onChange:void 0,"data-testid":void 0};const zn=_d;function Ui(n,e,t){return e=rT(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function rT(n){var e=nT(n,"string");return typeof e=="symbol"?e:String(e)}function nT(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var xm=ie.module("Shortcut"),he;(function(n){n.CTRL="MODIFIER_CTRL",n.CMD="MODIFIER_CMD",n.ALT="MODIFIER_ALT",n.OPTION="MODIFIER_OPTION",n.SHIFT="MODIFIER_SHIFT"})(he||(he={}));var de;(function(n){n.A="A",n.B="B",n.C="C",n.D="D",n.E="E",n.F="F",n.G="G",n.H="H",n.I="I",n.J="J",n.K="K",n.L="L",n.M="M",n.N="N",n.O="O",n.P="P",n.Q="Q",n.R="R",n.S="S",n.T="T",n.U="U",n.V="V",n.W="W",n.X="X",n.Y="Y",n.Z="Z",n.ZERO="0",n.ONE="1",n.TWO="2",n.THREE="3",n.FOUR="4",n.FIVE="5",n.SIX="6",n.SEVEN="7",n.EIGHT="8",n.NINE="9",n.BACKSPACE="Backspace",n.ESCAPE="Escape",n.ENTER="Enter",n.DELETE="Delete",n.SLASH="/",n.QUESTION_MARK="?",n.BACKSLASH="\\",n.PIPE="|",n.MINUS="-",n.UNDERSCORE="_",n.EQUALS="=",n.PLUS="+",n.BACKTICK="`",n.TILDE="~",n.COMMA=",",n.LEFT_CHEVRON="<",n.PERIOD=".",n.RIGHT_CHEVRON=">",n.SEMICOLON=";",n.COLON=":",n.SINGLE_QUOTE="'",n.DOUBLE_QUOTE='"',n.LEFT_BRACKET="[",n.RIGHT_BRACKET="]",n.LEFT_CURLY="{",n.RIGHT_CURLY="}",n.F1="F1",n.F2="F2",n.F3="F3",n.F4="F4",n.F5="F5",n.F6="F6",n.F7="F7",n.F8="F8",n.F9="F9",n.F10="F10",n.F11="F11",n.F12="F12"})(de||(de={}));var iT=new Set([de.ENTER,de.DELETE,de.F1,de.F2,de.F3,de.F4,de.F5,de.F6,de.F7,de.F8,de.F9,de.F10,de.F11,de.F12]);class pt extends Bh{static isAllowedKey(e){return Object.values(de).includes(e)}static isValidKeyState(e){var{keyValue:t}=e;if(t===null)return!0;if(!pt.isMacPlatform&&e.metaKey||!pt.isAllowedKey(t))return!1;var r=!e.altKey&&!e.ctrlKey&&!e.metaKey&&!e.shiftKey;return!r||iT.has(t)}static createKeyState(e){var t={altKey:!1,ctrlKey:!1,metaKey:!1,shiftKey:!1,keyValue:e[e.length-1]};return e.forEach(r=>{switch(r){case he.CTRL:t.ctrlKey=!0;break;case he.ALT:case he.OPTION:t.altKey=!0;break;case he.CMD:t.metaKey=!0;break;case he.SHIFT:t.shiftKey=!0;break}}),t}static getKeyStateFromEvent(e){var{key:t,keyCode:r}=e,i="";return t==="Shift"||t==="Meta"||t==="Control"||t==="Alt"?i="":!pt.isAllowedKey(t)&&pt.isAllowedKey(String.fromCharCode(r))?i=String.fromCharCode(r):i=t,{keyValue:i,altKey:e.altKey,ctrlKey:e.ctrlKey,metaKey:e.metaKey,shiftKey:e.shiftKey}}static getWindowsDisplayText(e){var t="";return e.ctrlKey&&(t+="Ctrl+"),e.altKey&&(t+="Alt+"),e.shiftKey&&(t+="Shift+"),e.keyValue===de.ESCAPE?t+="Esc":e.keyValue!==null&&(t+=e.keyValue),t}static getMacDisplayText(e){var t="";switch(e.ctrlKey&&(t+="⌃"),e.altKey&&(t+="⌥"),e.shiftKey&&(t+="⇧"),e.metaKey&&(t+="⌘"),e.keyValue){case de.ENTER:t+="⏎";break;case de.ESCAPE:t+="⎋";break;case de.BACKSPACE:t+="⌫";break;case de.DELETE:t+="⌦";break;case null:break;default:t+=e.keyValue}return t}static doKeyStatesMatch(e,t){var r,i;return((r=e.keyValue)===null||r===void 0?void 0:r.toUpperCase())===((i=t.keyValue)===null||i===void 0?void 0:i.toUpperCase())&&e.altKey===t.altKey&&e.ctrlKey===t.ctrlKey&&e.metaKey===t.metaKey&&e.shiftKey===t.shiftKey}static getDisplayText(e){return e.keyValue===null?"":pt.isMacPlatform?pt.getMacDisplayText(e):pt.getWindowsDisplayText(e)}constructor(e){var{id:t,shortcut:r,macShortcut:i,isEditable:a=!0,name:o,tooltip:s}=e;super(),Ui(this,"id",void 0),Ui(this,"name",void 0),Ui(this,"tooltip",void 0),Ui(this,"isEditable",void 0),Ui(this,"defaultKeyState",void 0),Ui(this,"keyState",void 0),this.id=t,this.name=o,this.tooltip=s,this.isEditable=a;var l=pt.isMacPlatform,d=l?i:r;this.defaultKeyState=pt.createKeyState(d),this.keyState=this.defaultKeyState}getDisplayText(){return pt.getDisplayText(this.keyState)}getKeyState(){return this.keyState}setKeyState(e){pt.isValidKeyState(e)?(xm.debug2("Shortcut ".concat(this.id," updated to ").concat(JSON.stringify(e))),this.keyState=e,this.dispatchEvent(new Qe("onUpdate",{detail:this}))):xm.debug2("Shortcut ".concat(this.id," tried to update to invalid keyState ").concat(JSON.stringify(e)))}getDefaultKeyState(){return this.defaultKeyState}isDefault(){return pt.doKeyStatesMatch(this.getDefaultKeyState(),this.getKeyState())}setToNull(){this.setKeyState(pt.NULL_KEY_STATE)}isNull(){return pt.doKeyStatesMatch(this.keyState,pt.NULL_KEY_STATE)}setToDefault(){this.setKeyState(this.defaultKeyState)}matchesKeyState(e){return pt.doKeyStatesMatch(e,this.keyState)}matchesEvent(e){return this.matchesKeyState(pt.getKeyStateFromEvent(e))}}Ui(pt,"NULL_KEY_STATE",{metaKey:!1,shiftKey:!1,altKey:!1,ctrlKey:!1,keyValue:null});Ui(pt,"isMacPlatform",lt.isMacPlatform());function Am(n,e,t){return e=aT(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function aT(n){var e=oT(n,"string");return typeof e=="symbol"?e:String(e)}function oT(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var Lm=ie.module("ShortcutRegistry");class sT extends Bh{constructor(){super(...arguments),Am(this,"shortcutMap",new Map),Am(this,"shortcutsByCategory",new Map)}createAndAdd(e){var t=new pt(e);return this.add(t)}add(e){var t=this.shortcutMap.get(e.id);if(t)return Lm.warn("Skipping attempt to add duplicate shortcut ID to registry: ".concat(e.id)),t;Lm.debug2("Adding shortcut to registry: ".concat(e.id)),e.addEventListener("onUpdate",a=>{var{detail:o}=a;return this.dispatchEvent(new Qe("onUpdate",{detail:o}))});var r=e.id.split(".")[0];if(this.shortcutMap.set(e.id,e),this.shortcutsByCategory.has(r)){var i;(i=this.shortcutsByCategory.get(r))===null||i===void 0||i.push(e)}else this.shortcutsByCategory.set(r,[e]);return e}get(e){return this.shortcutMap.get(e)}getConflictingShortcuts(e){return Array.from(this.shortcutMap.values()).filter(t=>!t.isNull()&&t.matchesKeyState(e))}}var lT=Object.freeze(new sT);const $e=lT;var dT={COPY:$e.createAndAdd({id:"GLOBAL.COPY",name:"Copy",shortcut:[he.CTRL,de.C],macShortcut:[he.CMD,de.C],isEditable:!1}),PASTE:$e.createAndAdd({id:"GLOBAL.PASTE",name:"Paste",shortcut:[he.CTRL,de.V],macShortcut:[he.CMD,de.V],isEditable:!1}),SAVE:$e.createAndAdd({id:"GLOBAL.SAVE",name:"Save",shortcut:[he.CTRL,de.S],macShortcut:[he.CMD,de.S],isEditable:!1}),SELECT_ALL:$e.createAndAdd({id:"GLOBAL.SELECT_ALL",name:"Select All",shortcut:[he.CTRL,de.A],macShortcut:[he.CMD,de.A],isEditable:!1}),LINKER:$e.createAndAdd({id:"GLOBAL.LINKER",name:"Linker",shortcut:[he.CTRL,de.L],macShortcut:[he.CMD,de.L]}),LINKER_CLOSE:$e.createAndAdd({id:"GLOBAL.LINKER_CLOSE",name:"Close Linker Overlay",shortcut:[de.ESCAPE],macShortcut:[de.ESCAPE],isEditable:!1}),COPY_VERSION_INFO:$e.createAndAdd({id:"GLOBAL.COPY_VERSION_INFO",name:"Copy Version Info",shortcut:[he.CTRL,he.ALT,de.I],macShortcut:[he.CMD,he.SHIFT,de.I],isEditable:!0}),NEXT:$e.createAndAdd({id:"GLOBAL.NEXT",name:"Next",shortcut:[de.ENTER],macShortcut:[de.ENTER],isEditable:!1}),PREVIOUS:$e.createAndAdd({id:"GLOBAL.PREVIOUS",name:"Previous",shortcut:[he.SHIFT,de.ENTER],macShortcut:[he.SHIFT,de.ENTER],isEditable:!1})};const Vn=dT;function mh(n,e,t){return e=uT(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function uT(n){var e=hT(n,"string");return typeof e=="symbol"?e:String(e)}function hT(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class jb extends w.PureComponent{constructor(e){super(e),mh(this,"inputField",void 0),mh(this,"searchChangeSelection",void 0),this.inputField=oe.createRef(),this.searchChangeSelection=oe.createRef()}componentDidMount(){this.setInputPaddingRight()}componentDidUpdate(){this.setInputPaddingRight()}focus(){var e;(e=this.inputField.current)===null||e===void 0||e.focus()}setInputPaddingRight(){var e=this.inputField.current,t=this.searchChangeSelection.current;if(e&&t){var r=t.getBoundingClientRect().width;e.style.paddingRight="".concat(r,"px")}}render(){var{value:e,placeholder:t,onBlur:r,onChange:i,className:a,disabled:o,matchCount:s,id:l,onKeyDown:d,"data-testid":u,cursor:c}=this.props,m,v=[{action:()=>c==null?void 0:c.next("forward"),shortcut:Vn.NEXT},{action:()=>c==null?void 0:c.next("back"),shortcut:Vn.PREVIOUS}];return c&&s>1?m=h.jsxs(h.Fragment,{children:[h.jsx(K,{kind:"ghost",className:"search-change-button",type:"button",onClick:()=>{c.next("back")},icon:Cb,tooltip:"Previous match (".concat(Vn.PREVIOUS.getDisplayText(),")")}),h.jsxs("span",{className:"search-change-text",children:[c.index!==void 0&&"".concat(c.index+1," of "),s]}),h.jsx(K,{kind:"ghost",className:"search-change-button",type:"button",onClick:()=>{c.next("forward")},icon:xy,tooltip:"Next match (".concat(Vn.NEXT.getDisplayText(),")")})]}):m=s>0&&h.jsx("span",{className:"search-match",children:s}),h.jsxs("div",{className:X("search-group",a),children:[h.jsx("input",{type:"search",value:e,onBlur:r,onChange:i,onKeyDown:d,className:"form-control",disabled:o,placeholder:t,ref:this.inputField,id:l,"data-testid":u}),s!=null?h.jsxs(h.Fragment,{children:[h.jsx("div",{className:"search-change-selection",ref:this.searchChangeSelection,children:m}),h.jsx(le,{actions:v})]}):h.jsx("span",{className:"search-icon",children:h.jsx(ue,{icon:Sb})})]})}}mh(jb,"defaultProps",{placeholder:"Search",className:"",matchCount:null,onKeyDown(){},id:"","data-testid":void 0,cursor:void 0});const ka=jb;function km(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function cT(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?km(Object(t),!0).forEach(function(r){en(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):km(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function en(n,e,t){return e=mT(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function mT(n){var e=vT(n,"string");return typeof e=="symbol"?e:String(e)}function vT(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var vh;(function(n){n.UP="UP",n.DOWN="DOWN"})(vh||(vh={}));class Gn extends w.Component{constructor(e){super(e),en(this,"popper",void 0),en(this,"cbContainer",void 0),en(this,"toggleButton",void 0),en(this,"menuContainer",void 0),en(this,"input",void 0),en(this,"searchInput",void 0),en(this,"getCachedFilteredOptions",Se((t,r)=>t.filter(i=>i.title.toLowerCase().indexOf(r.toLowerCase())>=0||i.value.toLowerCase().indexOf(r.toLowerCase())>=0))),this.state={value:"",filter:"",filteredOptions:e.options,keyboardOptionIndex:-1,menuIsOpen:!1,inputWidth:100},this.toggleMenu=this.toggleMenu.bind(this),this.handleMenuKeyDown=this.handleMenuKeyDown.bind(this),this.handleMenuBlur=this.handleMenuBlur.bind(this),this.closeMenu=this.closeMenu.bind(this),this.handleInputChange=this.handleInputChange.bind(this),this.handleInputKeyDown=this.handleInputKeyDown.bind(this),this.handleInputBlur=this.handleInputBlur.bind(this),this.handleFilterChange=this.handleFilterChange.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.popper=oe.createRef(),this.cbContainer=oe.createRef(),this.toggleButton=oe.createRef(),this.menuContainer=oe.createRef(),this.input=oe.createRef(),this.searchInput=oe.createRef()}componentDidUpdate(){var{menuIsOpen:e,keyboardOptionIndex:t}=this.state;e&&t>=0&&this.scrollOptionIntoView()}setInputWidth(){this.cbContainer.current&&this.setState({inputWidth:this.cbContainer.current.getBoundingClientRect().width})}focus(){var e;(e=this.input.current)===null||e===void 0||e.focus()}resetValue(){this.setState({value:""})}updateInputValue(e){var{onChange:t}=this.props;this.setState({value:e}),t(e)}handleResize(){this.setInputWidth()}handleMenuKeyDown(e){var t,r,{filter:i,filteredOptions:a,keyboardOptionIndex:o}=this.state,{options:s}=this.props,l=i?a:s;switch(e.key){case"Enter":((t=l[o])===null||t===void 0?void 0:t.value)!=null&&this.updateInputValue(l[o].value),this.closeMenu(),(r=this.input.current)===null||r===void 0||r.focus(),e.stopPropagation(),e.preventDefault();break;case"ArrowUp":this.handleMenuNavigation(Gn.MENU_NAVIGATION_DIRECTION.UP),e.stopPropagation(),e.preventDefault();break;case"ArrowDown":this.handleMenuNavigation(Gn.MENU_NAVIGATION_DIRECTION.DOWN),e.stopPropagation(),e.preventDefault();break;case"Escape":i!==""?(this.setState({filter:""}),e.stopPropagation()):this.closeMenu();break;case"Tab":!e.shiftKey&&o===l.length-1&&this.closeMenu();break}}handleMenuNavigation(e){var{filter:t,filteredOptions:r,keyboardOptionIndex:i}=this.state,{options:a}=this.props,o=t?r:a,s=o.length,l=0;switch(e){case Gn.MENU_NAVIGATION_DIRECTION.UP:l=-1;break;case Gn.MENU_NAVIGATION_DIRECTION.DOWN:l=1;break}l!==0&&this.setState({keyboardOptionIndex:(i+l+s)%s})}handleInputKeyDown(e){var{onEnter:t}=this.props,{menuIsOpen:r}=this.state;e.key==="ArrowDown"||e.key==="ArrowUp"?r||this.openMenu():e.key==="Enter"&&t()}handleInputChange(e){this.updateInputValue(e.target.value)}handleOptionClick(e){var t,r=Number(e.currentTarget.value),{filter:i,filteredOptions:a}=this.state,{options:o}=this.props,s=i?a:o;this.updateInputValue(s[r].value),this.closeMenu(),(t=this.input.current)===null||t===void 0||t.focus()}handleOptionFocus(e){this.setState({keyboardOptionIndex:Number(e.target.value)})}handleFilterChange(e){var t,{options:r}=this.props,i=e.target.value,a=this.getCachedFilteredOptions(r,i);this.setState({filter:i,filteredOptions:a,keyboardOptionIndex:0}),(t=this.popper.current)===null||t===void 0||t.scheduleUpdate()}handleMenuBlur(e){e.relatedTarget instanceof Element&&this.popper.current!=null&&this.popper.current.element.contains(e.relatedTarget)||e.relatedTarget===this.toggleButton.current||this.closeMenu(!1)}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)}handleMenuOpened(){var e;this.scrollOptionIntoView(),(e=this.searchInput.current)===null||e===void 0||e.focus()}handleMenuExited(){var{menuIsOpen:e}=this.state;if(e){var t;this.setState({menuIsOpen:!1}),(t=this.popper.current)===null||t===void 0||t.hide()}this.setState({filter:""})}toggleMenu(e){var{menuIsOpen:t}=this.state;t?this.closeMenu():this.openMenu(),e.stopPropagation()}openMenu(){this.updateKeyboardIndex(),this.setInputWidth(),this.setState({menuIsOpen:!0}),window.requestAnimationFrame(()=>{var e;(e=this.popper.current)===null||e===void 0||e.show()})}closeMenu(){var e,t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;if(this.setState({menuIsOpen:!1}),t){var r;(r=this.input.current)===null||r===void 0||r.focus()}(e=this.popper.current)===null||e===void 0||e.hide()}updateKeyboardIndex(){var{value:e,filter:t,filteredOptions:r}=this.state,{options:i}=this.props,a=t?r:i,o=a.findIndex(s=>s.value===e);this.setState({keyboardOptionIndex:o})}scrollOptionIntoView(){var e,t=(e=this.menuContainer.current)===null||e===void 0?void 0:e.querySelector(".cb-option-btn.keyboard-active");t instanceof HTMLElement&&t.scrollIntoView({block:"nearest",inline:"nearest"})}renderMenuElement(){var{searchPlaceholder:e}=this.props,{filter:t,inputWidth:r}=this.state;return h.jsxs("div",{className:"cb-menu-container",ref:this.menuContainer,role:"presentation",onKeyDown:this.handleMenuKeyDown,onClick:i=>{i.stopPropagation()},style:{width:r},onBlur:this.handleMenuBlur,children:[h.jsx("div",{className:"cb-search-input-container",children:h.jsx(ka,{value:t,ref:this.searchInput,onChange:this.handleFilterChange,className:"cb-search-input",placeholder:e})}),h.jsx("div",{className:"cb-options-container",children:h.jsx("div",{className:"cb-options",children:this.renderOptions()})})]})}renderOptions(){var{options:e}=this.props,{keyboardOptionIndex:t,filter:r,filteredOptions:i}=this.state,a=r?i:e;return a.map((o,s)=>{var l="option-".concat(s,"-").concat(o.value);return h.jsx("button",{type:"button",value:s,className:X("cb-option-btn",{"keyboard-active":t===s}),onClick:this.handleOptionClick,onFocus:this.handleOptionFocus,children:o.title},l)})}render(){var{options:e,inputPlaceholder:t,disabled:r,className:i,defaultValue:a,spellCheck:o,"data-testid":s}=this.props,{value:l}=this.state,{popperOptions:d}=this.props;return d=cT({placement:"bottom-end",modifiers:{preventOverflow:{enabled:!1}}},d),h.jsxs("div",{className:"input-group cb-container",ref:this.cbContainer,children:[h.jsx("input",{value:l||a,className:X("form-control",i,"cb-input"),ref:this.input,onChange:this.handleInputChange,placeholder:t||(e[0]!=null?e[0].title:void 0),disabled:r,onBlur:this.handleInputBlur,onKeyDown:this.handleInputKeyDown,spellCheck:o,"data-testid":s!==void 0?"".concat(s,"-input"):void 0}),h.jsx("div",{className:"input-group-append cb-dropdown",children:h.jsxs("button",{tabIndex:-1,type:"button",className:"btn cb-btn form-control",ref:this.toggleButton,onClick:this.toggleMenu,onKeyDown:this.handleInputKeyDown,disabled:r,"data-testid":s!==void 0?"".concat(s,"-btn"):void 0,children:[h.jsx("span",{className:"cb-caret"}),h.jsx(La,{ref:this.popper,options:d,className:X("combobox interactive"),onEntered:this.handleMenuOpened,onExited:this.handleMenuExited,children:this.renderMenuElement()})]})})]})}}en(Gn,"MENU_NAVIGATION_DIRECTION",vh);en(Gn,"DROP_DOWN_MENU_HEIGHT",200);en(Gn,"propTypes",{options:V.arrayOf(V.shape({title:V.string.isRequired,value:V.string.isRequired})).isRequired,popperOptions:V.shape({title:V.string.isRequired,value:V.string.isRequired}),onChange:V.func,inputPlaceholder:V.string,searchPlaceholder:V.string,disabled:V.bool,className:V.string,defaultValue:V.string,spellCheck:V.bool,onEnter:V.func,"data-testid":V.string});en(Gn,"defaultProps",{onChange(){},inputPlaceholder:"",searchPlaceholder:"Search",disabled:!1,className:"",defaultValue:"",popperOptions:null,spellCheck:!0,onEnter(){},"data-testid":void 0});const $b=Gn;function Md(n){var{copy:e,kind:t="ghost",tooltip:r="Copy",className:i,style:a,"data-testid":o,children:s}=n,[l,d]=$E();return h.jsx(K,{kind:t,className:i,style:a,"data-testid":o,icon:l?Ay:wb,tooltip:l?"Copied":r,onClick:()=>{d(typeof e=="function"?e():e)},children:s})}function Hb(n,e,t){return n.substring(0,e)+t+n.substring(e+1)}function fT(n,e,t){return n.length<t?"".concat(n).concat(e.substring(n.length,t)):n}function jm(n,e){for(var{length:t}=n,r=n.length-1;r>=0&&e[r]===n[r];r-=1)t=r;return n.substring(0,t)}function $m(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function gT(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?$m(Object(t),!0).forEach(function(r){pT(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):$m(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function pT(n,e,t){return e=bT(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function bT(n){var e=CT(n,"string");return typeof e=="symbol"?e:String(e)}function CT(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var hn=ie.module("MaskedInput"),Ya={FORWARD:"forward",BACKWARD:"backward",NONE:"none"},ol=" ",Bb=oe.forwardRef((n,e)=>{var{className:t,example:r,getNextSegmentValue:i=(I,x,_)=>_,getPreferredReplacementString:a=Hb,onChange:o=()=>!1,onSelect:s=()=>!1,onSubmit:l,pattern:d,placeholder:u,selection:c,value:m,onFocus:v=()=>!1,onBlur:f=()=>!1,"data-testid":g}=n,p=ic(e),b=w.useMemo(()=>Array.isArray(r)?r:[r],[r]),S=w.useMemo(()=>b[0].replace(/[a-zA-Z0-9]/g,ol),[b]);w.useEffect(function(){if(c!=null){var x;hn.debug("setting selection...",c);var{selectionStart:_,selectionEnd:k,selectionDirection:U}=c;(x=p.current)===null||x===void 0||x.setSelectionRange(_,k,U),hn.debug("selection set!")}},[c,p]);var C=w.useCallback(I=>{for(var x=I,_=I,k=b.length>0?b[0]:m,U=x-1;U>=0&&/[a-zA-Z0-9]/g.test(k.charAt(U));U-=1)x=U;for(var G=_;G<k.length&&/[a-zA-Z0-9]/g.test(k.charAt(G));G+=1)_=G+1;var Y=x===_?Ya.NONE:Ya.BACKWARD;return{selectionStart:x,selectionEnd:_,selectionDirection:Y}},[b,m]);function y(I,x){for(var _=arguments.length>2&&arguments[2]!==void 0?arguments[2]:I.length,k="",U=0;U<_;U+=1)I.charAt(U)!==ol?k=k.concat(I[U]):k=k.concat(x[U]);return k=k.concat(x.substring(_)),k}function E(I){var x=arguments.length>1&&arguments[1]!==void 0?arguments[1]:I.length,_=new RegExp("^".concat(d,"$"));if(_.test(I))return!0;for(var k=0;k<b.length;k+=1){var U=y(I,b[k],x);if(_.test(U))return!0}return!1}function T(I){var x=C(I),_=x.selectionEnd+1;return _>=m.length?x:C(_)}function O(I){var x=C(I),_=x.selectionStart-1;return _<=0?x:C(_)}function N(I,x){var _=C(I),k=m.substring(_.selectionStart,_.selectionEnd),U=i(_,x,k,m),G=m.substring(0,_.selectionStart)+U+m.substring(_.selectionEnd);E(G,_.selectionEnd)&&(o(G),s(_))}var P=w.useCallback(I=>{var{selectionStart:x=0,selectionEnd:_=0,selectionDirection:k="none"}=I.target;if(x===null||_===null||k===null){hn.error("Selection attempted on non-text input element",I.target);return}if(hn.debug2("handleSelect",x,_,k),!(c!=null&&x===c.selectionStart&&_===c.selectionEnd)){if(c!=null&&x===m.length&&_===m.length&&I.nativeEvent.type!=="mouseup"){s(gT({},c));return}if(x===_){var U=C(x);hn.debug("Selection segment from ",x,_,"=>",U),s(U)}else s({selectionStart:x,selectionEnd:_,selectionDirection:k})}},[C,s,c,m]),R=w.useCallback(I=>{var x;if(p.current){hn.debug("handleSelectCapture",I);var _=(x=p.current.selectionStart)!==null&&x!==void 0?x:0;_===m.length&&c!=null&&_!==c.selectionStart&&(I.preventDefault(),I.stopPropagation())}},[p,c,m]);function A(I){if(I.preventDefault(),I.stopPropagation(),!!p.current){var{key:x}=I,{selectionStart:_=0,selectionEnd:k=0}=p.current;if(_===null||k===null){hn.error("Selection arrow nvaigation attempted on non-text input element",I.target);return}x==="ArrowLeft"?s(O(_)):x==="ArrowRight"?s(T(k)):x==="ArrowUp"?N(_,-1):x==="ArrowDown"&&N(_,1)}}function M(I){if(p.current){hn.debug("handleKeyDown",I);var{key:x}=I,{selectionStart:_=0,selectionEnd:k=0}=p.current;if(_===null||k===null){hn.error("Selection key event on non-text input element",I.target);return}if(x==="Enter"){l==null||l(I);return}if(x.startsWith("Arrow")){A(I);return}if(x==="Delete"||x==="Backspace"){if(I.preventDefault(),I.stopPropagation(),k>=jm(m,S).length){var U=m.substring(0,_===k?_-1:_),G=jm(U,S);G!==m&&(o(G),s({selectionStart:G.length,selectionEnd:G.length,selectionDirection:Ya.NONE}));return}if(_!==k){var Y=m.substring(0,_)+m.substring(_,k).replace(/[a-zA-Z0-9]/g,ol)+m.substring(k);hn.debug("Range ",_,k,"deleted, setting value",Y),o(Y),s({selectionStart:_,selectionEnd:_,selectionDirection:Ya.NONE})}else if(_>0)for(var Z=_-1;Z>=0;Z-=1){var $=m.substring(0,Z)+m.substring(Z,_).replace(/[a-zA-Z0-9]/g,ol)+m.substring(_);if($!==m){o($),s({selectionStart:Z,selectionEnd:Z,selectionDirection:Ya.NONE});return}}return}if(!(I.altKey||I.metaKey||I.ctrlKey||x.length>1)){I.preventDefault(),I.stopPropagation();for(var D=Array.from(new Set([x,x.toUpperCase(),x.toLowerCase()])),L=0;L<D.length;L+=1)for(var H=D[L],z=/[a-zA-Z0-9]/g.test(H)?b[0].length-1:_,te=_;te<=z;te+=1){var W=fT(m,b[0],te+1),ne=a(W,te,H,_,k);if(E(ne,te+1)){var re=C(te),se=te+1,Ce={selectionStart:se,selectionEnd:se,selectionDirection:Ya.NONE};if(se>=re.selectionEnd){var Me=T(te);Me.selectionStart!==re.selectionStart&&(Ce=Me)}hn.debug("handleKeyDown",x,"=>",ne,Ce),o(ne),s(Ce);return}}}}}return h.jsx("input",{ref:p,className:X("form-control masked-input",t),type:"text",pattern:d,placeholder:u,value:m,onChange:()=>{},onKeyDown:M,onSelect:P,onSelectCapture:R,onFocus:v,onBlur:f,"data-testid":g})});Bb.defaultProps={className:"",placeholder:void 0,onChange(){},onSelect(){},getNextSegmentValue:(n,e,t)=>t,getPreferredReplacementString:Hb,selection:void 0,onFocus(){},onBlur(){},"data-testid":void 0};const ST=Bb;function Hm(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function wT(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Hm(Object(t),!0).forEach(function(r){bs(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Hm(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function bs(n,e,t){return e=yT(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function yT(n){var e=ET(n,"string");return typeof e=="symbol"?e:String(e)}function ET(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}let Ub=class extends w.PureComponent{constructor(e){var t;super(e),bs(this,"container",void 0),bs(this,"oldFocus",void 0),bs(this,"rAF",void 0),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleMenuItemClick=this.handleMenuItemClick.bind(this),this.handleMenuItemMouseMove=this.handleMenuItemMouseMove.bind(this),this.handleMouseLeave=this.handleMouseLeave.bind(this),this.handleCloseMenu=this.handleCloseMenu.bind(this),this.container=oe.createRef(),this.oldFocus=document.activeElement,this.rAF=0;var{options:r}=e,i=(t=r.initialKeyboardIndex)!==null&&t!==void 0?t:-1;this.state={menuItems:[],keyboardIndex:i,mouseIndex:-1}}componentDidMount(){this.initMenu(),this.rAF=window.requestAnimationFrame(()=>{var e;(e=this.container.current)===null||e===void 0||e.focus();var{onMenuOpened:t}=this.props;t(this)})}componentDidUpdate(e){var{actions:t}=this.props;e.actions!==t&&this.initMenu()}componentWillUnmount(){cancelAnimationFrame(this.rAF)}getKeyboardIndex(){var{options:e}=this.props;if(e.separateKeyboardMouse!==void 0&&e.separateKeyboardMouse){var{keyboardIndex:t}=this.state;return t}return this.getMouseIndex()}setKeyboardIndex(e){var{options:t}=this.props;t.separateKeyboardMouse!==void 0&&t.separateKeyboardMouse?this.setState({keyboardIndex:e}):this.setMouseIndex(e)}getMouseIndex(){var{mouseIndex:e}=this.state;return e}setMouseIndex(e){this.setState({mouseIndex:e})}initMenu(){cancelAnimationFrame(this.rAF),this.setState({menuItems:[]});var{actions:e}=this.props,t=lt.getMenuItems(e,!1);t.length>0&&this.setState(r=>({menuItems:lt.sortActions(r.menuItems.concat(t))}))}handleKeyDown(e){var{menuItems:t}=this.state,r=this.getKeyboardIndex(),i=r;if(e.key==="Enter"||e.key===" "){r!=null&&r>=0&&r<t.length&&this.handleMenuItemClick(t[r],e);return}if(e.key==="Escape")i=null;else if(e.key==="ArrowUp"||e.key==="Tab"&&e.shiftKey===!0){var a;i=lt.getNextMenuItem((a=i)!==null&&a!==void 0?a:0,-1,t)}else if(e.key==="ArrowDown"||e.key==="Tab"&&e.shiftKey===!1){var o;i=lt.getNextMenuItem((o=i)!==null&&o!==void 0?o:0,1,t)}r!==i&&(i!==null?this.setKeyboardIndex(i):(this.closeMenu(),this.oldFocus instanceof HTMLElement&&this.oldFocus.focus()),e.preventDefault(),e.stopPropagation())}closeMenu(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,{closeMenu:t,onMenuClosed:r}=this.props;cancelAnimationFrame(this.rAF),this.rAF=window.requestAnimationFrame(()=>{t(e),r(this)})}handleCloseMenu(){this.closeMenu()}handleMenuItemClick(e,t){t.preventDefault(),t.stopPropagation(),e!=null&&(e.disabled===void 0||!e.disabled)&&e.action!=null&&(e.action(t.nativeEvent),this.closeMenu(!0))}handleMenuItemMouseMove(e){var{menuItems:t}=this.state,r=t.indexOf(e);this.setMouseIndex(r)}handleMouseLeave(){this.setMouseIndex(-1)}render(){for(var e=[],{"data-testid":t}=this.props,{keyboardIndex:r,menuItems:i,mouseIndex:a}=this.state,o=0;o<i.length;o+=1){var s=i[o];o>0&&s.group!==i[o-1].group&&e.push(h.jsx("hr",{},"".concat(o,".separator")));var l=h.jsx(K0,{isKeyboardSelected:r===o,isMouseSelected:a===o,menuItem:s,closeMenu:this.handleCloseMenu,onMenuItemClick:this.handleMenuItemClick,onMenuItemMouseMove:this.handleMenuItemMouseMove,onMenuItemContextMenu:()=>!1},o);e.push(l)}var{menuStyle:d}=this.props;return h.jsx("div",{className:"context-menu-container",style:wT({},d),ref:this.container,onKeyDown:this.handleKeyDown,onMouseLeave:this.handleMouseLeave,role:"menuitem",tabIndex:0,"data-testid":t,children:e})}};bs(Ub,"defaultProps",{closeMenu(){},onMenuOpened(){},onMenuClosed(){},options:{},menuStyle:{},"data-testid":void 0});const TT=Ub;function Bm(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function Um(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Bm(Object(t),!0).forEach(function(r){so(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Bm(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function so(n,e,t){return e=PT(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function PT(n){var e=OT(n,"string");return typeof e=="symbol"?e:String(e)}function OT(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class Vb extends w.PureComponent{constructor(e){super(e),so(this,"container",void 0),so(this,"parent",void 0),so(this,"popper",void 0),so(this,"isOpen",void 0),this.handleClick=this.handleClick.bind(this),this.handleCloseMenu=this.handleCloseMenu.bind(this),this.handleExited=this.handleExited.bind(this),this.container=oe.createRef(),this.parent=null,this.popper=oe.createRef(),this.isOpen=!1}componentDidMount(){var{isShown:e}=this.props;if(e===null){var t;(t=this.container.current)!==null&&t!==void 0&&t.parentElement&&(this.parent=this.container.current.parentElement,this.parent.addEventListener("click",this.handleClick))}else e&&this.openMenu()}componentDidUpdate(e){var{isShown:t}=this.props;e.isShown!==t&&(t!==null&&t?window.requestAnimationFrame(()=>{this.openMenu()}):this.closeMenu())}componentWillUnmount(){this.parent&&this.parent.removeEventListener("click",this.handleClick)}closeMenu(){var e;(e=this.popper.current)===null||e===void 0||e.hide()}openMenu(){this.popper.current&&!this.isOpen&&(this.popper.current.show(),this.isOpen=!0)}scheduleUpdate(){var e;(e=this.popper.current)===null||e===void 0||e.scheduleUpdate()}handleClick(e){e.preventDefault(),e.stopPropagation(),this.openMenu()}handleCloseMenu(){this.closeMenu()}handleExited(){this.isOpen=!1;var{onMenuClosed:e}=this.props;e()}render(){var{actions:e,onMenuOpened:t,popperClassName:r,"data-testid":i}=this.props,{menuStyle:a}=this.props,{options:o,popperOptions:s}=this.props;return s=Um({placement:"bottom"},s),o=Um({separateKeyboardMouse:!0},o),h.jsx("div",{className:"menu-actions-listener",ref:this.container,"data-testid":i,children:h.jsx(La,{ref:this.popper,options:s,className:X("menu-popper",r),onExited:this.handleExited,closeOnBlur:!0,interactive:!0,children:h.jsx(TT,{actions:e,closeMenu:this.handleCloseMenu,onMenuOpened:t,options:o,menuStyle:a})})})}}so(Vb,"defaultProps",{isShown:null,onMenuClosed(){},onMenuOpened(){},options:{},popperOptions:{},popperClassName:"",menuStyle:{},"data-testid":void 0});const Ia=Vb;function Xa(n,e,t,r,i){var a=r-t+1,o=((parseInt(e,10)-n-t)%a+a)%a+t;return"".concat(o).padStart(i,"0")}function DT(n,e,t){var{selectionStart:r}=n;return r===0?Xa(e,t,1900,2099,4):r===5?Xa(e,t,1,12,2):r===8?Xa(e,t,1,31,2):r===11?Xa(e,t,0,23,2):r===17||r===14?Xa(e,t,0,59,2):r===20||r===24||r===28?Xa(e,t,0,999,3):t}function fh(n){var e=n.substring(0,23),t=n.substring(23,26),r=n.substring(26);return[e,t,r].filter(i=>i!=="").join("")}var NT=ie.module("DateTimeInput"),RT="[12][0-9]{3}-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])",IT="([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]\\.[0-9]{3}[0-9]{3}[0-9]{3}",FT="".concat(RT," ").concat(IT),Hl="2022-01-01",Gb="".concat(Hl," 00:00:00.000000000"),_T="YYYY-MM-DD HH:MM:SS.SSSSSSSSS";function Vm(n){return n!=null&&n.length>=Hl.length?"".concat(n.substring(0,Hl.length)).concat(n.substring(Hl.length).replace(/\u2007/g,"0")).concat(Gb.substring(n.length)):n}function Gm(n){return n.replace(/\u200B/g,"")}var MT=[fh(Gb)],sc=oe.forwardRef((n,e)=>{var{className:t="",onChange:r=()=>{},defaultValue:i="",onFocus:a=()=>{},onBlur:o=()=>{},onSubmit:s,"data-testid":l}=n,[d,u]=w.useState(i.length>0?fh(i):""),[c,m]=w.useState(),v=w.useCallback(g=>{NT.debug("handleChange",g),u(g),r(Vm(Gm(g)))},[r]),f=w.useCallback(()=>{var g=Gm(d),p=Vm(g);p!==g&&u(fh(p)),o()},[d,o]);return h.jsx("div",{className:"d-flex flex-row align-items-center",children:h.jsx(ST,{ref:e,className:X(t),example:MT,getNextSegmentValue:DT,onChange:v,onSelect:m,onSubmit:s,pattern:FT,placeholder:_T,selection:c,value:d,onFocus:a,onBlur:f,"data-testid":l})})});sc.displayName="DateTimeInput";sc.defaultProps={className:"",onChange:()=>{},defaultValue:"",onFocus:()=>{},onBlur:()=>{},"data-testid":void 0};const xT=sc;function Wb(n,e,t){return e=AT(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function AT(n){var e=LT(n,"string");return typeof e=="symbol"?e:String(e)}function LT(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class zb extends w.PureComponent{constructor(e){super(e),Wb(this,"searchInput",void 0),this.searchInput=oe.createRef(),this.handleChange=this.handleChange.bind(this),this.sendUpdate=wt(this.sendUpdate.bind(this),e.debounceMs),this.state={value:e.value}}componentDidUpdate(e){var{value:t}=this.props;e.value!==t&&this.setState({value:t})}focus(){var e;(e=this.searchInput.current)===null||e===void 0||e.focus()}handleChange(e){this.setState({value:e.target.value},this.sendUpdate)}sendUpdate(){var{onChange:e}=this.props,{value:t}=this.state;e(t)}render(){var{placeholder:e,className:t,matchCount:r,id:i,"data-testid":a}=this.props,{value:o}=this.state;return h.jsx(ka,{value:o,placeholder:e,onChange:this.handleChange,className:t,matchCount:r,ref:this.searchInput,id:i,"data-testid":a})}}Wb(zb,"defaultProps",{placeholder:"Search",className:"",matchCount:null,debounceMs:250,id:"","data-testid":void 0});const kT=zb;function Kb(n,e,t){return e=jT(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function jT(n){var e=$T(n,"string");return typeof e=="symbol"?e:String(e)}function $T(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var HT=ie.module("ItemListItem");class xd extends w.Component{static handleKeyDown(){return HT.log("ItemListItem.handleKeyDown false"),!1}constructor(e){super(e),Kb(this,"itemRef",void 0),this.handleBlur=this.handleBlur.bind(this),this.handleFocus=this.handleFocus.bind(this),this.handleClick=this.handleClick.bind(this),this.handleContextMenu=this.handleContextMenu.bind(this),this.handleDragStart=this.handleDragStart.bind(this),this.handleDrag=this.handleDrag.bind(this),this.handleDragOver=this.handleDragOver.bind(this),this.handleDragEnd=this.handleDragEnd.bind(this),this.handleDrop=this.handleDrop.bind(this),this.handleDoubleClick=this.handleDoubleClick.bind(this),this.handleMouseDown=this.handleMouseDown.bind(this),this.handleMouseMove=this.handleMouseMove.bind(this),this.handleMouseUp=this.handleMouseUp.bind(this),this.itemRef=oe.createRef()}handleBlur(e){var{itemIndex:t,onBlur:r}=this.props;r(t,e)}handleFocus(e){var{itemIndex:t,onFocus:r}=this.props;r(t,e)}handleClick(e){var{itemIndex:t,onClick:r}=this.props;r(t,e)}handleContextMenu(e){var{itemIndex:t,onContextMenu:r}=this.props;r(t,e)}handleDragStart(e){var{itemIndex:t,onDragStart:r}=this.props;r(t,e)}handleDrag(e){var{itemIndex:t,onDrag:r}=this.props;r(t,e)}handleDragOver(e){e.preventDefault();var{itemIndex:t,onDragOver:r}=this.props;r(t,e)}handleDragEnd(e){var{itemIndex:t,onDragEnd:r}=this.props;r(t,e)}handleDrop(e){var{itemIndex:t,onDrop:r}=this.props;r(t,e)}handleDoubleClick(e){var{itemIndex:t,onDoubleClick:r}=this.props;r(t,e)}handleMouseMove(e){var{itemIndex:t,onMouseMove:r}=this.props;r(t,e)}handleMouseDown(e){var{itemIndex:t,onMouseDown:r}=this.props;r(t,e)}handleMouseUp(e){var{itemIndex:t,onMouseUp:r}=this.props;r(t,e)}render(){var{isDraggable:e,isFocused:t,isSelected:r,style:i,children:a,"data-testid":o}=this.props;return h.jsx("div",{className:X("item-list-item",{active:r},{"is-focused":t},{"is-draggable":e}),onKeyDown:xd.handleKeyDown,onContextMenuCapture:this.handleContextMenu,onClick:this.handleClick,onDrag:this.handleDrag,onDragStart:this.handleDragStart,onDragOver:this.handleDragOver,onDragEnd:this.handleDragEnd,onDrop:this.handleDrop,onDoubleClick:this.handleDoubleClick,onMouseDown:this.handleMouseDown,onMouseMove:this.handleMouseMove,onMouseUp:this.handleMouseUp,tabIndex:-1,ref:this.itemRef,role:"listitem",style:i,onFocus:this.handleFocus,onBlur:this.handleBlur,draggable:e,"data-testid":o,children:a})}}Kb(xd,"defaultProps",{children:null,isDraggable:!1,isFocused:!1,isSelected:!1,itemIndex:0,"data-testid":void 0,onBlur(){},onClick(){},onContextMenu(){},onDragStart(){},onDrag(){},onDragOver(){},onDragEnd(){},onDrop(){},onDoubleClick(){},onFocus(){},onMouseDown(){},onMouseMove(){},onMouseUp(){},style:{}});const BT=xd;function Wm(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function zm(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Wm(Object(t),!0).forEach(function(r){tn(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Wm(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function tn(n,e,t){return e=UT(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function UT(n){var e=VT(n,"string");return typeof e=="symbol"?e:String(e)}function VT(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var Km=ie.module("ItemList"),qm=5;class Qt extends w.PureComponent{static renderItem(e){var t,r,{item:i}=e;return h.jsx("div",{className:"item-list-item-content",children:i!=null&&((t=(r=i.displayValue)!==null&&r!==void 0?r:i.value)!==null&&t!==void 0?t:"".concat(i))})}constructor(e){super(e),tn(this,"list",void 0),tn(this,"listContainer",void 0),tn(this,"getItemSelected",Se((i,a)=>An.isSelected(a,i),{max:Qt.CACHE_SIZE})),tn(this,"getCachedItem",Se((i,a,o,s,l,d,u,c)=>{var m=d({item:o,itemIndex:i,isFocused:s,isSelected:l,style:u});return h.jsx(BT,{onContextMenu:this.handleItemContextMenu,onDoubleClick:this.handleItemDoubleClick,onMouseDown:this.handleItemMouseDown,onFocus:this.handleItemFocus,onBlur:this.handleItemBlur,disableSelect:c,onMouseMove:this.handleItemMouseMove,onMouseUp:this.handleItemMouseUp,isFocused:s,isSelected:l,itemIndex:i,style:u,children:m},a)},{max:Qt.CACHE_SIZE})),tn(this,"getOuterElement",Se(i=>{var a=oe.forwardRef((o,s)=>h.jsx("div",zm({ref:s,tabIndex:-1,onKeyDown:i,role:"presentation"},o)));return a.displayName="ItemListOuterElement",a})),tn(this,"getInnerElement",Se(()=>{var i=oe.forwardRef((a,o)=>h.jsx("div",zm({className:"item-list-inner-element",ref:o},a)));return i.displayName="ItemListInnerElement",i})),tn(this,"getItemData",Se((i,a,o)=>({items:i,selectedRanges:a,renderItem:o}))),this.handleItemBlur=this.handleItemBlur.bind(this),this.handleItemContextMenu=this.handleItemContextMenu.bind(this),this.handleItemFocus=this.handleItemFocus.bind(this),this.handleItemDoubleClick=this.handleItemDoubleClick.bind(this),this.handleItemMouseDown=this.handleItemMouseDown.bind(this),this.handleItemMouseMove=this.handleItemMouseMove.bind(this),this.handleItemMouseUp=this.handleItemMouseUp.bind(this),this.handleItemsRendered=this.handleItemsRendered.bind(this),this.handleWindowMouseUp=this.handleWindowMouseUp.bind(this),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleMouseLeave=this.handleMouseLeave.bind(this),this.handleScroll=this.handleScroll.bind(this),this.handleResize=this.handleResize.bind(this),this.renderInnerElement=this.renderInnerElement.bind(this),this.list=oe.createRef(),this.listContainer=oe.createRef();var{isStickyBottom:t,selectedRanges:r}=e;this.state={focusIndex:null,mouseDownIndex:null,selectedRanges:r,overscanStartIndex:0,height:null,isDragging:!1,isStuckToBottom:t,scrollOffset:null,mouseX:null,mouseY:null}}componentDidUpdate(e,t){var{selectedRanges:r,itemCount:i}=this.props,{focusIndex:a,isStuckToBottom:o,scrollOffset:s,height:l,selectedRanges:d}=this.state;if(o&&!this.isListAtBottom()&&i>0&&this.scrollToBottom(),(s!==t.scrollOffset||l!==t.height)&&this.sendViewportUpdate(),r!==e.selectedRanges&&r!==d)this.setSelectedRanges(r);else if(d!==t.selectedRanges){var{onSelectionChange:u}=this.props;u(d)}if(a!==t.focusIndex){var{onFocusChange:c}=this.props;c(a)}}componentWillUnmount(){window.removeEventListener("mouseup",this.handleWindowMouseUp)}focus(){var e;(e=this.listContainer.current)===null||e===void 0||e.focus()}restoreScrollPosition(){var{scrollOffset:e}=this.state;if(e!=null){var t;(t=this.listContainer.current)===null||t===void 0||t.scrollTo(0,e)}}getElement(e){if(this.listContainer.current==null)return null;var{focusSelector:t}=this.props,{overscanStartIndex:r}=this.state,i=this.listContainer.current.querySelectorAll(t),a=e-r;return i[a]}focusItem(e){var{disableSelect:t}=this.props;if(!t){this.setState({focusIndex:e});var r=this.getElement(e);r instanceof HTMLElement&&r.focus()}}scrollToItem(e){var t=this.getElement(e);t!=null&&t.scrollIntoView({block:"center"})}handleItemContextMenu(e,t){this.setState({focusIndex:e});var{selectedRanges:r}=this.state,i=An.isSelected(r,e),a=i||lt.isModifierKeyDown(t);this.toggleSelect(e,t.shiftKey,a,!1)}handleItemDoubleClick(e,t){var{isDoubleClickSelect:r,onSelect:i}=this.props;r&&this.setState(a=>{var{selectedRanges:o}=a;return{selectedRanges:An.selectRange(o,[e,e])}},()=>{i(e,t)})}handleItemMouseDown(e,t){var{selectedRanges:r}=this.state;if(!(t.target instanceof HTMLElement&&["button","select","input","textarea"].indexOf(t.target.tagName.toLowerCase())!==-1)){if(t.button===2&&r.length===0){this.focusItem(e),this.selectItem(e);return}t.button!=null&&t.button!==0||(this.setState({mouseDownIndex:e,mouseX:t.clientX,mouseY:t.clientY}),window.addEventListener("mouseup",this.handleWindowMouseUp))}}handleItemBlur(e,t){Km.debug2("item blur",e,t.currentTarget,t.relatedTarget),(!t.relatedTarget||this.listContainer.current&&t.relatedTarget instanceof HTMLElement&&!this.listContainer.current.contains(t.relatedTarget))&&this.setState({focusIndex:null})}handleItemFocus(e,t){Km.debug2("item focus",e,t.target),this.setState(r=>{var{focusIndex:i}=r;return i!==e?{focusIndex:e}:null})}handleItemMouseMove(e,t){var{isDragSelect:r,isMultiSelect:i,disableSelect:a}=this.props,{mouseDownIndex:o,selectedRanges:s,mouseX:l,mouseY:d}=this.state;if(!(o==null||a)){var u=Math.abs(t.clientX-(l??0)),c=Math.abs(t.clientY-(d??0));u>qm&&c>qm&&this.setState({isDragging:!0}),(r||o===e)&&(this.focusItem(e),i?(!r&&!this.getItemSelected(e,s)&&!lt.isModifierKeyDown(t)&&this.deselectAll(),this.selectRange([Math.min(o,e),Math.max(o,e)])):this.toggleSelect(e,t.shiftKey,lt.isModifierKeyDown(t),!1))}}handleItemMouseUp(e,t){var{isDeselectOnClick:r,isDoubleClickSelect:i,onSelect:a}=this.props,{mouseDownIndex:o,isDragging:s}=this.state;if(!(t.target instanceof HTMLElement&&["button","select","input","textarea"].indexOf(t.target.tagName.toLowerCase())!==-1)){if(o===e&&!s){var l=t.shiftKey,d=lt.isModifierKeyDown(t);this.focusItem(e),this.toggleSelect(e,l,d,r),!i&&!l&&!d&&a(e,t)}this.resetMouseState()}}handleItemsRendered(e){var{overscanStartIndex:t}=e;this.setState({overscanStartIndex:t})}handleResize(e){var{height:t}=e;this.setState({height:t})}handleMouseLeave(){this.setState({mouseDownIndex:null})}handleWindowMouseUp(){this.resetMouseState(),window.removeEventListener("mouseup",this.handleWindowMouseUp)}handleKeyDown(e){var{isMultiSelect:t,itemCount:r,onSelect:i}=this.props,{focusIndex:a}=this.state,o=a;if(e.key==="Enter"||e.key===" "){!t&&o!=null&&this.setState({selectedRanges:[[o,o]]},()=>{o!=null&&i(o,e)});return}if(e.key==="ArrowUp")o!=null&&o>=0?o=Math.max(0,o-1):o=r-1;else if(e.key==="ArrowDown")o!=null&&o>=0?o=Math.min(o+1,r-1):o=0;else return;if(a!==o){e.stopPropagation(),e.preventDefault(),this.focusItem(o);var{selectedRanges:s}=this.state;if(e.shiftKey&&s.length>0){var l=s[s.length-1];this.selectRange([Math.min(o,l[0]),Math.max(o,l[1])])}else if(this.deselectAll(),o!==null)this.selectItem(o);else{var d;(d=this.listContainer.current)===null||d===void 0||d.focus()}this.scrollIntoView(o)}}handleScroll(e){var{scrollUpdateWasRequested:t,scrollOffset:r}=e;this.setState(i=>{if(t)return{scrollOffset:r};var{isStickyBottom:a}=this.props,{height:o}=i,s=a&&this.isListAtBottom({scrollOffset:r,height:o});return{isStuckToBottom:s,scrollOffset:r}})}resetMouseState(){this.setState({mouseDownIndex:null,isDragging:!1})}scrollToBottom(){var{itemCount:e}=this.props;this.list.current&&this.list.current.scrollToItem(e)}scrollIntoView(e){this.list.current&&this.list.current.scrollToItem(e)}toggleSelect(e,t,r){var i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,{isMultiSelect:a}=this.props,{selectedRanges:o}=this.state;if(a&&t&&o.length>0){var s=o[o.length-1];this.selectRange([Math.min(s[0],e),Math.max(e,s[1])])}else a&&o.length===1&&o[0][0]===e&&o[0][1]===e?i&&this.deselectItem(e):a&&r?this.getItemSelected(e,o)?i&&this.deselectItem(e):this.selectItem(e):(this.deselectAll(),this.selectItem(e))}deselectAll(){var{itemCount:e}=this.props;this.deselectRange([0,e])}deselectItem(e){this.deselectRange([e,e])}deselectRange(e){An.validateRange(e),this.setState(t=>{var{selectedRanges:r}=t;return{selectedRanges:An.deselectRange(r,e)}})}selectItem(e){var{disableSelect:t}=this.props;t||this.selectRange([e,e])}selectRange(e){An.validateRange(e),this.setState(t=>{var{selectedRanges:r}=t;return{selectedRanges:An.selectRange(r,e)}})}setSelectedRanges(e){this.setState({selectedRanges:e})}sendViewportUpdate(){var{scrollOffset:e,height:t}=this.state;if(e!=null&&t!=null){var{onViewportChange:r,rowHeight:i}=this.props,a=Math.floor(e/i),o=a+Math.ceil(t/i);r(a,o)}}isListAtBottom(){var{scrollOffset:e,height:t}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.state;if(t==null||e==null)return!1;var{itemCount:r,rowHeight:i}=this.props;return e+t>=r*i}renderInnerElement(e){var{index:t,style:r}=e,{items:i,offset:a,renderItem:o,disableSelect:s}=this.props,{focusIndex:l,selectedRanges:d}=this.state;if(t<a||t>=a+i.length)return null;var u=i[t-a];return this.getCachedItem(t,t,u,t===l&&!s,this.getItemSelected(t,d),o,r,s)}render(){var{items:e,itemCount:t,overscanCount:r,renderItem:i,rowHeight:a,"data-testid":o}=this.props,{selectedRanges:s,isStuckToBottom:l}=this.state;return h.jsx(ay,{className:"item-list-auto-sizer",onResize:this.handleResize,children:d=>{var{width:u,height:c}=d;return h.jsx(oy,{className:"item-list-scroll-pane",height:c,width:u,initialScrollOffset:l?t*a:0,itemCount:t,itemSize:a,itemData:this.getItemData(e,s,i),onScroll:this.handleScroll,onItemsRendered:this.handleItemsRendered,ref:this.list,outerElementType:this.getOuterElement(this.handleKeyDown),outerRef:this.listContainer,innerElementType:this.getInnerElement(),overscanCount:r,"data-testid":o,children:this.renderInnerElement})}})}}tn(Qt,"CACHE_SIZE",1e3);tn(Qt,"DEFAULT_ROW_HEIGHT",20);tn(Qt,"DEFAULT_OVERSCAN",10);tn(Qt,"defaultProps",{offset:0,items:[],rowHeight:Qt.DEFAULT_ROW_HEIGHT,isDeselectOnClick:!0,isDoubleClickSelect:!1,isDragSelect:!0,isMultiSelect:!1,isStickyBottom:!1,disableSelect:!1,onFocusChange(){},onSelect(){},onSelectionChange(){},onViewportChange(){},overscanCount:Qt.DEFAULT_OVERSCAN,renderItem:Qt.renderItem,selectedRanges:[],focusSelector:".item-list-item","data-testid":void 0});function Ym(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function Oi(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Ym(Object(t),!0).forEach(function(r){Oa(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Ym(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function Oa(n,e,t){return e=GT(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function GT(n){var e=WT(n,"string");return typeof e=="symbol"?e:String(e)}function WT(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class Wn extends w.PureComponent{static renderHandle(){return h.jsxs("div",{children:[h.jsx(Ot,{children:"Drag to re-order"}),h.jsx(ue,{icon:xs})]})}static renderBadge(e){var{text:t}=e;return t!=null&&t.length>0?h.jsx("span",{className:"number-badge",children:t}):null}static renderTextItem(e){var{text:t,badgeText:r="",className:i=""}=e;return h.jsxs("div",{className:X("item-list-item-content","draggable-item-list-item-content",i),children:[h.jsx("span",{className:"title",children:t}),Wn.renderBadge({text:r}),Wn.renderHandle()]})}static renderItem(e){var t,r,{item:i,isClone:a,selectedCount:o}=e,s=i!=null?(t=(r=i.displayValue)!==null&&r!==void 0?r:i.value)!==null&&t!==void 0?t:"".concat(i):"",l=a!==void 0&&a?"".concat(o):"",d=a!==void 0&&a?"item-list-item-clone":"";return Wn.renderTextItem({text:s,badgeText:l,className:d})}static getDraggableId(e,t){return"".concat(e,"/").concat(t)}static getDraggableIndex(e){var t=e.split("/").pop();return parseInt(t!==void 0?t:"",10)}constructor(e){super(e),Oa(this,"itemList",void 0),Oa(this,"getCachedDraggableItem",Se((t,r,i,a,o,s,l,d)=>h.jsx(Uh,{draggableId:Wn.getDraggableId(t,a),index:a,isDragDisabled:l,children:u=>h.jsx("div",Oi(Oi(Oi({role:"menuitem",className:"draggable-item-list-item",ref:u.innerRef,tabIndex:-1},u.draggableProps),u.dragHandleProps),{},{children:r({item:i,itemIndex:a,isFocused:o,isSelected:s,style:d,isClone:!1})}))},a),{max:Qt.CACHE_SIZE})),Oa(this,"getCachedRenderDraggableItem",Se((t,r,i)=>a=>{var{item:o,itemIndex:s,isFocused:l,isSelected:d,style:u}=a;return this.getCachedDraggableItem(t,i,o,s,l,d,r,u)},{max:1})),Oa(this,"getCachedRenderClone",Se((t,r,i,a)=>(o,s,l)=>{var{selectedCount:d}=this.state,{draggableProps:u,dragHandleProps:c,innerRef:m}=o,{index:v}=l.source,f=r[v-i];return h.jsx("div",Oi(Oi(Oi({className:X("draggable-item-list-dragging-item-container",t)},u),c),{},{ref:m,children:h.jsx("div",{className:X("draggable-item-list-dragging-item",{"two-dragged":d===2},{"multiple-dragged":d>2}),children:a({item:f,itemIndex:v,isFocused:!1,isSelected:!0,style:{},isClone:!0,selectedCount:d})})}))},{max:1})),this.handleSelectionChange=this.handleSelectionChange.bind(this),this.itemList=oe.createRef(),this.state={selectedCount:0}}selectItem(e){var t;(t=this.itemList.current)===null||t===void 0||t.selectItem(e)}focusItem(e){var t;(t=this.itemList.current)===null||t===void 0||t.focusItem(e)}scrollToItem(e){var t;(t=this.itemList.current)===null||t===void 0||t.scrollToItem(e)}handleSelectionChange(e){this.setState({selectedCount:An.count(e)});var{onSelectionChange:t}=this.props;t(e)}render(){var{className:e,draggablePrefix:t,draggingItemClassName:r,droppableId:i,isDoubleClickSelect:a,isDragDisabled:o,isDropDisabled:s,isMultiSelect:l,isStickyBottom:d,itemCount:u,items:c,offset:m,onFocusChange:v,onSelect:f,onViewportChange:g,renderItem:p,rowHeight:b,selectedRanges:S,style:C,"data-testid":y}=this.props;return h.jsx(Cd,{isDropDisabled:s,droppableId:i,mode:"virtual",renderClone:this.getCachedRenderClone(r,c,m,p),"data-testid":y,children:(E,T)=>h.jsx("div",Oi(Oi({role:"menu",className:X("draggable-item-list",e,{"is-drop-disabled":s,"is-drag-disabled":o,"is-dragging-from-this":T.draggingFromThisWith,"is-dragging-over":T.isDraggingOver,"is-dropping":T.draggingOverWith}),style:C,ref:E.innerRef},E.droppableProps),{},{children:h.jsx(Qt,{focusSelector:".draggable-item-list-item",isDoubleClickSelect:a,isDragSelect:!1,isMultiSelect:l,isStickyBottom:d,itemCount:u,items:c,onFocusChange:v,onSelect:f,onSelectionChange:this.handleSelectionChange,onViewportChange:g,offset:m,ref:this.itemList,renderItem:this.getCachedRenderDraggableItem(t,o,p),rowHeight:b,selectedRanges:S})}))})}}Oa(Wn,"DEFAULT_ROW_HEIGHT",30);Oa(Wn,"defaultProps",{className:"",draggingItemClassName:"",offset:0,items:[],rowHeight:Wn.DEFAULT_ROW_HEIGHT,isDeselectOnClick:!0,isDoubleClickSelect:!0,isDropDisabled:!1,isDragDisabled:!1,isMultiSelect:!1,isStickyBottom:!1,disableSelect:!1,style:null,onFocusChange(){},onSelect(){},onSelectionChange(){},onViewportChange(){},renderItem:Wn.renderItem,selectedRanges:[],draggablePrefix:"draggable-item",droppableId:"droppable-item-list","data-testid":void 0});const gn=Wn;class Xl{static reorder(e,t,r,i){var a=e===r?Xl.adjustDestinationIndex(i,t):i,o=Xl.removeItems(e,t);return r.splice(a,0,...o),o}static removeItems(e,t){for(var r=[],i=t.map((u,c)=>({range:u,index:c})).sort((u,c)=>c.range[0]-u.range[0]),a=0;a<i.length;a+=1){var{range:o,index:s}=i[a],[l,d]=o;r[s]=e.splice(l,d-l+1)}return sy(r)}static adjustDestinationIndex(e,t){for(var r=e,i=0;i<t.length;i+=1){var[a,o]=t[i];if(a>e)break;r-=Math.min(o,e-1)-a+1}return r}static startDragging(){document.documentElement.classList.add("drag-pointer-events-none")}static stopDragging(){document.documentElement.classList.remove("drag-pointer-events-none")}}const En=Xl;function qb(n){var{on:e,id:t,className:r,isInvalid:i,disabled:a=!1,onClick:o,"data-testid":s}=n;return h.jsx("button",{type:"button",className:X("btn","btn-switch",r,{active:e},{"is-invalid":i}),id:t,onClick:o,disabled:a,"data-testid":s,children:h.jsx("div",{className:"handle"})})}function Xm(n){return n.isOn!==void 0}function zT(n){var{item:e,onSelect:t=()=>{},"data-testid":r}=n,{icon:i,subtitle:a,title:o}=e,s=w.useMemo(()=>Xm(e)?()=>{e.onChange(!e.isOn)}:t,[e,t]);return h.jsxs("div",{className:"btn btn-navigation-menu-item","data-testid":"menu-item-".concat(o),onClick:s,onKeyDown:l=>{(l.key==="Enter"||l.key===" ")&&s()},tabIndex:0,role:"menuitem",children:[i!==void 0&&h.jsx("div",{className:"icon",children:h.jsx(ue,{icon:i})}),h.jsx("div",{className:"title",children:o}),a!==void 0&&h.jsx("div",{className:"shortcut",children:a}),h.jsx("div",{className:"accessory","data-testid":r,children:Xm(e)?h.jsx(qb,{on:e.isOn,onClick:l=>{l.stopPropagation(),s()}}):h.jsx(ue,{icon:yb})})]})}function Yb(n){var{items:e,onSelect:t=()=>{},"data-testid":r}=n;return h.jsx("div",{className:"navigation-menu-view","data-testid":r,children:h.jsx("ul",{className:"navigation-menu-list",children:e.map((i,a)=>h.jsx("li",{children:h.jsx(zT,{item:i,onSelect:()=>{t(a)}})},i.title))})})}function Qm(n){var{children:e,onBack:t,onClose:r,title:i,"data-testid":a}=n;return h.jsxs("div",{className:"navigation-page","data-testid":a,children:[h.jsxs("div",{className:"navigation-title-bar",children:[h.jsx("div",{className:"navigation-left-buttons",children:t!==void 0&&h.jsx(K,{kind:"ghost",className:"btn-back m-1 btn-sm","data-testid":"btn-page-back",onClick:t,icon:Ly,children:"Back"})}),h.jsx("div",{className:"navigation-title",children:i}),h.jsx("div",{className:"navigation-right-buttons",children:r!==void 0&&h.jsx(K,{kind:"ghost",className:"btn-close btn-sm px-2 m-1","data-testid":"btn-page-close",onClick:r,icon:Td,tooltip:"Close"})})]}),h.jsx("div",{className:"navigation-content",children:e})]})}function KT(n){var{children:e,"data-testid":t}=n,r=w.useMemo(()=>oe.Children.toArray(e),[e]),i=Nd(r),[a,o]=w.useState(r[r.length-1]),[s,l]=w.useState(null),[d,u]=w.useState(null);w.useEffect(function(){if(!(i===void 0||r===i)){var f=r[r.length-1];r.length===i.length||i.length===0||s!==null||d!==null?s!==null&&f!==s?l(f):f!==d&&f!==a&&o(f):r.length>i.length?l(f):r.length<i.length&&(o(f),u(i[i.length-1]))}},[r,i,s,d,a]);var c=w.useCallback(()=>{o(s),l(null)},[s]),m=w.useCallback(()=>{u(null)},[]);return h.jsxs("div",{className:"navigation-stack",children:[h.jsx("div",{className:"main-view","data-testid":t,children:a}),h.jsx(Sr,{in:d!=null,timeout:et.transitionMidMs,classNames:"slide-right",onEntered:m,children:h.jsx(h.Fragment,{children:d!=null&&h.jsx("div",{className:"popping-view",children:d})})}),h.jsx(Sr,{in:s!=null,timeout:et.transitionMidMs,classNames:"slide-left",onEntered:c,children:h.jsx(h.Fragment,{children:s!=null&&h.jsx("div",{className:"pushing-view",children:s})})})]})}var qT=["children"];function Zm(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function Jm(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Zm(Object(t),!0).forEach(function(r){YT(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Zm(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function YT(n,e,t){return e=XT(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function XT(n){var e=QT(n,"string");return typeof e=="symbol"?e:String(e)}function QT(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function ZT(n,e){if(n==null)return{};var t=JT(n,e),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(n);for(i=0;i<a.length;i++)r=a[i],!(e.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(n,r)&&(t[r]=n[r])}return t}function JT(n,e){if(n==null)return{};var t={},r=Object.keys(n),i,a;for(a=0;a<r.length;a++)i=r[a],!(e.indexOf(i)>=0)&&(t[i]=n[i]);return t}function Xb(n){var{children:e}=n,t=ZT(n,qT);return h.jsx("option",Jm(Jm({},t),{},{children:e}))}function Ad(n){var{children:e,disabled:t=!1,name:r,onChange:i,value:a="","data-testid":o}=n,[s]=w.useState(r??qe());return h.jsx(h.Fragment,{children:oe.Children.map(e,l=>{var d,u;return l?oe.cloneElement(l,{name:s,onChange:(d=l.props.onChange)!==null&&d!==void 0?d:i,checked:a===l.props.value,disabled:(u=l.props.disabled)!==null&&u!==void 0?u:t,"data-testid":o}):null})})}var lc=oe.forwardRef((n,e)=>{var{checked:t,children:r,className:i="",disabled:a=!1,inputClassName:o="",isInvalid:s=!1,labelClassName:l="",name:d,onChange:u,value:c,"data-testid":m}=n,[v]=w.useState(qe());return h.jsxs("div",{className:X("custom-control custom-radio",i),children:[h.jsx("input",{type:"radio",id:v,"data-testid":m,name:d,ref:e,className:X("custom-control-input",o,{"is-invalid":s}),checked:t,disabled:a,value:c,onChange:u}),h.jsx("label",{className:X("custom-control-label",l),htmlFor:v,children:r})]})});lc.displayName="RadioItem";lc.defaultProps={checked:void 0,className:"",disabled:!1,inputClassName:"",isInvalid:!1,labelClassName:"",name:void 0,onChange:void 0,"data-testid":void 0};const fi=lc,eP={"dh-spectrum-palette":"_dh-spectrum-palette_1mcqx_1"},tP={"dh-spectrum-alias":"_dh-spectrum-alias_1uc7a_1"};function ev(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function tv(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?ev(Object(t),!0).forEach(function(r){rP(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):ev(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function rP(n,e,t){return e=nP(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function nP(n){var e=iP(n,"string");return typeof e=="symbol"?e:String(e)}function iP(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var rv=tv(tv({},eP),tP);function nv(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function sl(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?nv(Object(t),!0).forEach(function(r){aP(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):nv(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function aP(n,e,t){return e=oP(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function oP(n){var e=sP(n,"string");return typeof e=="symbol"?e:String(e)}function sP(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var{global:lP,light:dP,dark:uP,medium:hP,large:cP}=ly,mP={global:lP,light:sl(sl({},dP),rv),dark:sl(sl({},uP),rv),medium:hP,large:cP};function vP(n){var{children:e,isPortal:t=!1,theme:r=mP,colorScheme:i}=n,[a]=w.useState(t?qe():null);return h.jsx(dy,{UNSAFE_className:"spectrum-theme-provider",theme:r,colorScheme:i,"data-unique-id":a,children:e})}var fP=ie.module("ThemeProvider"),Qb=w.createContext(null);function H2(n){var{themes:e,defaultPreloadValues:t=Gy,children:r}=n,i=w.useMemo(()=>ky(),[]),[a,o]=w.useState(null),[s,l]=w.useState(()=>{var c,m;return(c=(m=jy())===null||m===void 0?void 0:m.themeKey)!==null&&c!==void 0?c:$y}),d=w.useMemo(()=>e==null?null:Hy(s,{base:i,custom:e??[]}),[i,s,e]),u=w.useMemo(()=>[...i,...e??[]],[i,e]);return w.useEffect(function(){if(!(d==null||e==null)){By(t);var m=Uy(t);fP.debug2("updateThemePreloadData:",{active:d.map(v=>v.themeKey),custom:e.map(v=>v.themeKey),preloadStyleContent:m,selectedThemeKey:s}),Vy({themeKey:s,preloadStyleContent:m})}},[d,s,e,t]),w.useEffect(()=>{o({activeThemes:d,selectedThemeKey:s,themes:u,setSelectedThemeKey:l})},[d,s,u]),h.jsxs(h.Fragment,{children:[d==null?null:h.jsx(h.Fragment,{children:d.map(c=>h.jsx("style",{"data-theme-key":c.themeKey,children:c.styleContent},c.themeKey))}),a==null?null:h.jsx(Qb.Provider,{value:a,children:h.jsx(vP,{children:r})})]})}function dc(){return Jh(Qb,"No ThemeContext value found. Component must be wrapped in a ThemeContext.Provider")}var gP=["children","className","onChange","data-testid"];function iv(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function av(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?iv(Object(t),!0).forEach(function(r){pP(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):iv(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function pP(n,e,t){return e=bP(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function bP(n){var e=CP(n,"string");return typeof e=="symbol"?e:String(e)}function CP(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function SP(n,e){if(n==null)return{};var t=wP(n,e),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(n);for(i=0;i<a.length;i++)r=a[i],!(e.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(n,r)&&(t[r]=n[r])}return t}function wP(n,e){if(n==null)return{};var t={},r=Object.keys(n),i,a;for(a=0;a<r.length;a++)i=r[a],!(e.indexOf(i)>=0)&&(t[i]=n[i]);return t}var Zb=oe.forwardRef((n,e)=>{var{children:t,className:r,onChange:i,"data-testid":a}=n,o=SP(n,gP),s=ic(e),l=w.useCallback(d=>{i(d.target.value)},[i]);return h.jsx("select",av(av({ref:s,className:X("custom-select",r),onChange:l,"data-testid":a},o),{},{children:t}))});Zb.displayName="Select";const Gt=Zb;function no(n,e,t){return e=yP(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function yP(n){var e=EP(n,"string");return typeof e=="symbol"?e:String(e)}function EP(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class Jb extends w.PureComponent{constructor(e){super(e),no(this,"list",void 0),no(this,"topRow",void 0),no(this,"bottomRow",void 0),no(this,"getCachedItem",Se((t,r,i,a,o,s,l)=>{var d={height:o},u=a??i;return h.jsx("li",{className:"value-list-item",style:d,tabIndex:-1,children:h.jsx(zn,{checked:s,disabled:l,onChange:()=>this.handleSelect(t),children:u})},r)},{max:1e3})),no(this,"getCachedItems",Se((t,r,i,a)=>{for(var o=[],s=0;s<t.length;s+=1){var l=t[s],{value:d,displayValue:u,isSelected:c}=l,m=i+s,v=m,f=this.getCachedItem(m,v,d,u,r,c,a);o.push(f)}return o},{max:1})),this.handleBlur=this.handleBlur.bind(this),this.handleScroll=this.handleScroll.bind(this),this.handleSelect=this.handleSelect.bind(this),this.list=oe.createRef(),this.topRow=null,this.bottomRow=null}componentDidMount(){this.sendViewportUpdate()}componentDidUpdate(){this.sendViewportUpdate()}handleBlur(e){if(!e.relatedTarget||this.list.current&&e.relatedTarget instanceof HTMLElement&&!this.list.current.contains(e.relatedTarget)){var{onBlur:t}=this.props;t==null||t(e)}}handleScroll(){this.sendViewportUpdate()}handleSelect(e){var{items:t,offset:r,onSelect:i}=this.props,a=e-r;if(a>=0&&a<t.length){var o=t[a],{value:s}=o;i(e,s)}else i(e,null)}sendViewportUpdate(){if(!(!this.list.current||this.list.current.clientHeight===0)){var{onViewportChange:e,rowHeight:t}=this.props,r=this.list.current.scrollTop,i=r+this.list.current.clientHeight,a=Math.floor(r/t),o=Math.ceil(i/t);(this.topRow!==a||this.bottomRow!==o)&&(this.topRow=a,this.bottomRow=o,e(a,o))}}getElement(e){if(this.list.current==null)return null;var t=this.list.current.querySelectorAll(".value-list-item");return t[e]}scrollIntoView(e){var t=this.getElement(e);t==null||t.scrollIntoView({block:"center"})}render(){var{className:e,disabled:t,isInvalid:r,items:i,itemCount:a,offset:o,rowHeight:s,"data-testid":l}=this.props,d=this.getCachedItems(i,s,o,t);return h.jsx("div",{className:X("select-value-list-scroll-pane h-100 w-100",{"is-invalid":r},e),onBlur:this.handleBlur,onScroll:this.handleScroll,ref:this.list,"data-testid":l,children:h.jsx("div",{className:"select-value-list",style:{height:a*s},children:h.jsx("ol",{className:"select-value-list-content",style:{position:"absolute",height:i.length*s,top:o*s,left:0},children:d})})})}}no(Jb,"defaultProps",{disabled:!1,rowHeight:21,onBlur:()=>{},"data-testid":void 0});const TP=Jb;var uc=oe.forwardRef((n,e)=>{var{children:t,className:r,disabled:i,id:a,isLinked:o,isLinkedSource:s,isInvalid:l,onClick:d,onMouseEnter:u,onMouseLeave:c,style:m,"data-testid":v}=n;return h.jsxs("button",{ref:e,type:"button",className:X("btn-socketed",{"btn-socketed-linked":o!==void 0&&o||s},{"btn-socketed-linked-source":s},{"is-invalid":l},r),id:a,onClick:d,onMouseEnter:u,onMouseLeave:c,style:m,disabled:i,"data-testid":v,children:[t,h.jsx(ue,{icon:Eb,className:"linked btn-socketed-icon",transform:"down-1"}),h.jsx(ue,{icon:Wy,className:"is-invalid btn-socketed-icon"})]})});uc.displayName="SocketedButton";uc.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 eC=uc;function oa(){return Jh(zy,"No API available in useApi. Was code wrapped in ApiBootstrap or ApiContext.Provider?")}function hc(n,e,t){return e=PP(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function PP(n){var e=OP(n,"string");return typeof e=="symbol"?e:String(e)}function OP(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class Ld{static isValid(e,t){return!0}static isSameFormat(e,t){throw new Error("isSameFormat not implemented")}static makeFormat(e,t,r){return{label:e,formatString:t,type:r}}format(e,t){return""}}hc(Ld,"TYPE_GLOBAL","type-global");hc(Ld,"TYPE_CONTEXT_PRESET","type-context-preset");hc(Ld,"TYPE_CONTEXT_CUSTOM","type-context-custom");const Dt=Ld;class DP extends Dt{format(e){switch(e){case 1:case!0:return"true";case 0:case!1:return"false";default:return""}}}const NP=DP;class RP extends Dt{format(e){return String.fromCharCode(e)}}const IP=RP;function Vi(n,e,t){return e=FP(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function FP(n){var e=_P(n,"string");return typeof e=="symbol"?e:String(e)}function _P(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var ov=ie.module("DateTimeColumnFormatter");class Ut extends Dt{static isValid(e,t){try{return e.i18n.DateTimeFormat.format(t.formatString,new Date),!0}catch{return!1}}static makeFormat(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Dt.TYPE_CONTEXT_PRESET;return{label:e,formatString:t,type:r}}static isSameFormat(e,t){return e===t||e!==null&&t!==null&&e.type===t.type&&e.formatString===t.formatString}static makeGlobalFormatStringMap(e,t){var r=t?"'T'":" ",i=e?" z":"";return new Map([["yyyy-MM-dd HH:mm:ss","yyyy-MM-dd".concat(r,"HH:mm:ss").concat(i)],["yyyy-MM-dd HH:mm:ss.SSS","yyyy-MM-dd".concat(r,"HH:mm:ss.SSS").concat(i)],["yyyy-MM-dd HH:mm:ss.SSSSSSSSS","yyyy-MM-dd".concat(r,"HH:mm:ss.SSSSSSSSS").concat(i)]])}static getGlobalFormats(e,t){var r=Ut.makeGlobalFormatStringMap(e,t);return[...r.keys()]}static makeFormatStringMap(e,t){var r=t!==void 0&&t?"'T'":" ",i=e!==void 0&&e?" z":"";return new Map([["yyyy-MM-dd","yyyy-MM-dd".concat(i)],["MM-dd-yyyy","MM-dd-yyyy".concat(i)],["HH:mm:ss","HH:mm:ss".concat(i)],["HH:mm:ss.SSS","HH:mm:ss.SSS".concat(i)],["HH:mm:ss.SSSSSSSSS","HH:mm:ss.SSSSSSSSS".concat(i)],["yyyy-MM-dd HH:mm:ss","yyyy-MM-dd".concat(r,"HH:mm:ss").concat(i)],["yyyy-MM-dd HH:mm:ss.SSS","yyyy-MM-dd".concat(r,"HH:mm:ss.SSS").concat(i)],["yyyy-MM-dd HH:mm:ss.SSSSSSSSS","yyyy-MM-dd".concat(r,"HH:mm:ss.SSSSSSSSS").concat(i)]])}static getFormats(e,t){var r=Ut.makeFormatStringMap(e,t);return[...r.keys()]}constructor(e){var{timeZone:t="",showTimeZone:r=!0,showTSeparator:i=!1,defaultDateTimeFormatString:a=Ut.DEFAULT_DATETIME_FORMAT_STRING}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};super(),Vi(this,"dh",void 0),Vi(this,"dhTimeZone",void 0),Vi(this,"defaultDateTimeFormatString",void 0),Vi(this,"showTimeZone",void 0),Vi(this,"showTSeparator",void 0),Vi(this,"formatStringMap",void 0);var o=t||Ut.DEFAULT_TIME_ZONE_ID;try{this.dhTimeZone=e.i18n.TimeZone.getTimeZone(o)}catch{ov.error("Unsupported time zone id",o),this.dhTimeZone=e.i18n.TimeZone.getTimeZone(Ut.DEFAULT_TIME_ZONE_ID)}this.dh=e,this.defaultDateTimeFormatString=a,this.showTimeZone=r,this.showTSeparator=i,this.formatStringMap=Ut.makeFormatStringMap(r,i)}getEffectiveFormatString(e){var t;return(t=this.formatStringMap.get(e))!==null&&t!==void 0?t:e}format(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=t.formatString!=null&&t.formatString!==""?t.formatString:this.defaultDateTimeFormatString,i=this.getEffectiveFormatString(r);try{return this.dh.i18n.DateTimeFormat.format(i,e,this.dhTimeZone)}catch{ov.error("Invalid format arguments")}return""}}Vi(Ut,"DEFAULT_DATETIME_FORMAT_STRING","yyyy-MM-dd HH:mm:ss.SSS");Vi(Ut,"DEFAULT_TIME_ZONE_ID","America/New_York");function Kn(n,e,t){return e=MP(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function MP(n){var e=xP(n,"string");return typeof e=="symbol"?e:String(e)}function xP(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var AP=ie.module("DecimalColumnFormatter");class je extends Dt{static isValid(e,t){try{return e.i18n.NumberFormat.format(t.formatString,0),!0}catch{return!1}}static makeFormat(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Dt.TYPE_CONTEXT_PRESET,i=arguments.length>3?arguments[3]:void 0;return{label:e,type:r,formatString:t,multiplier:i}}static makePresetFormat(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",r=arguments.length>2?arguments[2]:void 0;return je.makeFormat(e,t,Dt.TYPE_CONTEXT_PRESET,r)}static makeCustomFormat(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",t=arguments.length>1?arguments[1]:void 0;return je.makeFormat("Custom Format",e,Dt.TYPE_CONTEXT_CUSTOM,t)}static isSameFormat(e,t){return e===t||e!=null&&t!=null&&e.type===t.type&&e.formatString===t.formatString&&e.multiplier===t.multiplier}constructor(e){var{defaultFormatString:t=je.DEFAULT_FORMAT_STRING}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};super(),Kn(this,"defaultFormatString",void 0),Kn(this,"dh",void 0),this.dh=e,this.defaultFormatString=t}format(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=t.formatString!=null&&t.formatString!==""?t.formatString:this.defaultFormatString,i=t.multiplier!=null&&t.multiplier!==0?e*t.multiplier:e;try{return this.dh.i18n.NumberFormat.format(r,i)}catch{AP.error("Invalid format arguments")}return""}}Kn(je,"DEFAULT_FORMAT_STRING","###,##0.0000");Kn(je,"FORMAT_PERCENT",je.makePresetFormat("Percent","##0.00%"));Kn(je,"FORMAT_BASIS_POINTS",je.makePresetFormat("Basis Points","###,##0 bp",1e4));Kn(je,"FORMAT_MILLIONS",je.makePresetFormat("Millions","###,##0.000 mm",1e-6));Kn(je,"FORMAT_SCIENTIFIC_NOTATION",je.makePresetFormat("Scientific Notation","0.0000E0"));Kn(je,"FORMAT_ROUND",je.makePresetFormat("Round","###,##0"));Kn(je,"FORMAT_ROUND_TWO_DECIMALS",je.makePresetFormat("0.00","###,##0.00"));Kn(je,"FORMAT_ROUND_FOUR_DECIMALS",je.makePresetFormat("0.0000","###,##0.0000"));class LP extends Dt{format(e){return"".concat(e)}}const kP=LP;function Os(n,e,t){return e=jP(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function jP(n){var e=$P(n,"string");return typeof e=="symbol"?e:String(e)}function $P(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var HP=ie.module("IntegerColumnFormatter");class Bt extends Dt{static isValid(e,t){try{return e.i18n.NumberFormat.format(t.formatString,0),!0}catch{return!1}}static makeFormat(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Dt.TYPE_CONTEXT_PRESET,i=arguments.length>3?arguments[3]:void 0;return{label:e,type:r,formatString:t,multiplier:i}}static makePresetFormat(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",r=arguments.length>2?arguments[2]:void 0;return Bt.makeFormat(e,t,Dt.TYPE_CONTEXT_PRESET,r)}static makeCustomFormat(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",t=arguments.length>1?arguments[1]:void 0;return Bt.makeFormat("Custom Format",e,Dt.TYPE_CONTEXT_CUSTOM,t)}static isSameFormat(e,t){return e===t||e!=null&&t!=null&&e.type===t.type&&e.formatString===t.formatString&&e.multiplier===t.multiplier}constructor(e){var{defaultFormatString:t=Bt.DEFAULT_FORMAT_STRING}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};super(),Os(this,"dh",void 0),Os(this,"defaultFormatString",void 0),this.dh=e,this.defaultFormatString=t}format(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=t.formatString!=null&&t.formatString!==""?t.formatString:this.defaultFormatString,i=t.multiplier!=null&&t.multiplier!==0?e*t.multiplier:e;try{return this.dh.i18n.NumberFormat.format(r,i)}catch{HP.error("Invalid format arguments")}return""}}Os(Bt,"DEFAULT_FORMAT_STRING","###,##0");Os(Bt,"FORMAT_MILLIONS",Bt.makePresetFormat("Millions","###,##0.000 mm",1e-6));Os(Bt,"FORMAT_SCIENTIFIC_NOTATION",Bt.makePresetFormat("Scientific Notation","0.0000E0"));class BP extends Dt{format(e){return e}}function tC(n,e,t){return e=UP(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function UP(n){var e=VP(n,"string");return typeof e=="symbol"?e:String(e)}function VP(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class Ze{static makeDateWrapper(e,t,r){var i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:1,o=arguments.length>5&&arguments[5]!==void 0?arguments[5]:0,s=arguments.length>6&&arguments[6]!==void 0?arguments[6]:0,l=arguments.length>7&&arguments[7]!==void 0?arguments[7]:0,d=arguments.length>8&&arguments[8]!==void 0?arguments[8]:0;if(!t)throw new Error("No timezone provided");var u="".concat(r).padStart(4,"0"),c="".concat(i+1).padStart(2,"0"),m="".concat(a).padStart(2,"0"),v="".concat(o).padStart(2,"0"),f="".concat(s).padStart(2,"0"),g="".concat(l).padStart(2,"0"),p="".concat(d).padStart(9,"0"),b="".concat(u,"-").concat(c,"-").concat(m," ").concat(v,":").concat(f,":").concat(g,".").concat(p);return e.i18n.DateTimeFormat.parse(Ze.FULL_DATE_FORMAT,b,e.i18n.TimeZone.getTimeZone(t))}static getNextNanos(e){var t=parseInt(e,10),r="0".repeat(9-e.length),i="".concat(t+1).concat(r);return parseInt(i,10)}static getNextDate(e,t,r,i){var{year:a,month:o,date:s,hours:l,minutes:d,seconds:u,nanos:c}=r;if(t.nanos!=null){if(t.nanos.length===9)return null;c=Ze.getNextNanos(t.nanos),c>999999999&&(u+=1,c=0)}else t.seconds!=null?u+=1:t.minutes!=null?d+=1:t.hours!=null?l+=1:t.date!=null?s+=1:t.month!=null?o+=1:a+=1;var m=new Date(a,o,s,l,d,u);return Ze.makeDateWrapper(e,i,m.getFullYear(),m.getMonth(),m.getDate(),m.getHours(),m.getMinutes(),m.getSeconds(),c)}static parseMonth(e){var t=parseInt(e,10);if(!Number.isNaN(t))return t>=1&&t<=12?t-1:NaN;var r=e.trim().toLowerCase();if(r.length>=3){for(var i=0;i<Ze.months.length;i+=1)if(Ze.months[i].startsWith(r))return i}return NaN}static parseDateValues(e,t,r,i,a,o,s){var l=parseInt(e,10),d=t!=null?this.parseMonth(t):0,u=r!=null?parseInt(r,10):1,c=i!=null?parseInt(i,10):0,m=a!=null?parseInt(a,10):0,v=o!=null?parseInt(o,10):0,f=s!=null?parseInt(s.padEnd(9,"0"),10):0;return Number.isNaN(l)||Number.isNaN(d)||Number.isNaN(u)||Number.isNaN(c)||Number.isNaN(m)||Number.isNaN(v)||Number.isNaN(f)?null:{year:l,month:d,date:u,hours:c,minutes:m,seconds:v,nanos:f}}static parseDateTimeString(e){var t=/\s*(\d{4})([-./]([\da-z]+))?([-./](\d{1,2}))?([tT\s](\d{2})([:](\d{2}))?([:](\d{2}))?([.](\d{1,9}))?)?(.*)/,r=t.exec(e);if(r==null)throw new Error("Unexpected date string: ".concat(e));var[,i,,a,,o,,s,,l,,d,,u,c]=r;if(c!=null&&c.length>0)throw new Error("Unexpected characters after date string '".concat(e,"': ").concat(c));return{year:i,month:a,date:o,hours:s,minutes:l,seconds:d,nanos:u}}static parseDateRange(e,t,r){var i=t.trim().toLowerCase();if(i.length===0)throw new Error("Cannot parse date range from empty string");if(i==="null")return[null,null];if(i==="today"){var a=new Date(Date.now()),o=Ze.makeDateWrapper(e,r,a.getFullYear(),a.getMonth(),a.getDate()),s=new Date(a.getFullYear(),a.getMonth(),a.getDate()+1),l=Ze.makeDateWrapper(e,r,s.getFullYear(),s.getMonth(),s.getDate());return[o,l]}if(i==="yesterday"){var d=new Date(Date.now()),u=new Date(d.getFullYear(),d.getMonth(),d.getDate()-1),c=Ze.makeDateWrapper(e,r,u.getFullYear(),u.getMonth(),u.getDate()),m=Ze.makeDateWrapper(e,r,d.getFullYear(),d.getMonth(),d.getDate());return[c,m]}if(i==="now"){var v=new Date(Date.now()),f=e.DateWrapper.ofJsDate(v);return[f,null]}var g=Ze.parseDateTimeString(i);if(g.year==null&&g.month==null&&g.date==null)throw new Error("Unable to extract year, month, or day ".concat(i));var p=Ze.parseDateValues(g.year,g.month,g.date,g.hours,g.minutes,g.seconds,g.nanos);if(p==null)throw new Error("Unable to extract date values from ".concat(g));var b=Ze.makeDateWrapper(e,r,p.year,p.month,p.date,p.hours,p.minutes,p.seconds,p.nanos),S=Ze.getNextDate(e,g,p,r);return[b,S]}static getJsDate(e){return typeof e=="number"?new Date(e):e.asDate()}}tC(Ze,"FULL_DATE_FORMAT","yyyy-MM-dd HH:mm:ss.SSSSSSSSS");tC(Ze,"months",["january","february","march","april","may","june","july","august","september","october","november","december"]);function B2(n,e){return n===e?{operator:"notEq",value:""}:{operator:"eq",value:n}}function U2(n,e,t){return function(i){var a=t.trim();if(a==="")return null;var o=rC(e,s=>s.filter().containsIgnoreCase(n.makeFilterValue(s.type,a)),"or");return o(i)}}function rC(n,e){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"or";return function(i){var a=i==null?void 0:i.findColumns(typeof n=="string"?[n]:n);if(a==null||a.length===0)return null;var o=a.map(e);return o.reduce((s,l)=>s[t](l))}}function GP(n,e,t,r){return rC(e,i=>i.filter()[r](n.makeFilterValue(i.type,t)),"or")}function V2(n,e,t,r,i){return function(o){var s=o==null?void 0:o.findColumn(e),l=t==="all"||r&&t.size===0;return s==null||l?null:n.makeSelectValueFilter(s,[...t.keys()],i)}}function G2(n){return function(t){return t.filter().isNull().not().and(t.filter().notEq(n.makeFilterValue(t.type,"")))}}function W2(n,e){return function(r){var i=r.filter(),a=n.makeFilterValue(r.type,""),o=i.eq(a);return e?i.isNull().or(o):o.or(i.notEq(a))}}function cc(n,e,t){return e=WP(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function WP(n){var e=zP(n,"string");return typeof e=="symbol"?e:String(e)}function zP(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class Hn{}cc(Hn,"not","not");cc(Hn,"and","and");cc(Hn,"or","or");function KP(n){if(!(n==="not"||n==="and"||n==="or"))throw new Error("operator is not a valid FilterOperatorValue")}function vt(n,e,t){return e=qP(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function qP(n){var e=YP(n,"string");return typeof e=="symbol"?e:String(e)}function YP(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class q{}vt(q,"eq","eq");vt(q,"eqIgnoreCase","eqIgnoreCase");vt(q,"notEq","notEq");vt(q,"notEqIgnoreCase","notEqIgnoreCase");vt(q,"greaterThan","greaterThan");vt(q,"greaterThanOrEqualTo","greaterThanOrEqualTo");vt(q,"lessThan","lessThan");vt(q,"lessThanOrEqualTo","lessThanOrEqualTo");vt(q,"in","in");vt(q,"inIgnoreCase","inIgnoreCase");vt(q,"notIn","notIn");vt(q,"notInIgnoreCase","notInIgnoreCase");vt(q,"isTrue","isTrue");vt(q,"isFalse","isFalse");vt(q,"isNull","isNull");vt(q,"invoke","invoke");vt(q,"contains","contains");vt(q,"notContains","notContains");vt(q,"containsIgnoreCase","containsIgnoreCase");vt(q,"startsWith","startsWith");vt(q,"endsWith","endsWith");vt(q,"containsAny","containsAny");function nC(n){switch(n){case q.eq:return"is exactly";case q.eqIgnoreCase:return"is exactly (ignore case)";case q.notEq:return"is not exactly";case q.notEqIgnoreCase:return"is not exactly (ignore case)";case q.contains:return"contains";case q.notContains:return"does not contain";case q.startsWith:return"starts with";case q.endsWith:return"ends with";default:throw new Error("Unrecognized text filter type ".concat(n))}}function iC(n){switch(n){case q.eq:return"is equal to";case q.notEq:return"is not equal to";case q.greaterThan:return"greater than";case q.greaterThanOrEqualTo:return"greater than or equal to";case q.lessThan:return"less than";case q.lessThanOrEqualTo:return"less than or equal to";default:throw new Error("Unrecognized number filter type ".concat(n))}}function aC(n){switch(n){case q.eq:return"date is";case q.notEq:return"date is not";case q.notEqIgnoreCase:case q.greaterThan:return"date is after";case q.greaterThanOrEqualTo:return"date is after or equal";case q.lessThan:return"date is before";case q.lessThanOrEqualTo:return"date is before or equal";default:throw new Error("Unrecognized date filter type ".concat(n))}}function XP(n){switch(n){case q.isTrue:return"Is True";case q.isFalse:return"Is False";case q.isNull:return"Is Null";default:throw new Error("Unrecognized boolean filter type ".concat(n))}}var sv=ie.module("ViewportDataUtils");function QP(n,e){return String(n.offsetInSnapshot+e)}function z2(n,e){var{bulkUpdate:t}=n;return function(i){var{columns:a,offset:o,rows:s}=i.detail;sv.debug("table updated",i.detail);var l=new Map;s.forEach(d=>{var u=e(d,a),c=QP(d,o);l.set(c,{key:c,item:u})}),sv.debug("update keys",l),t(l)}}function K2(n,e){return e.reduce((t,r)=>(t[r.name]=n.get(r),t),{})}function*q2(n,e){for(var t=n;t<=e;++t)yield{key:String(t)}}function ZP(n){return n==null||JP(n)?0:n.size}function JP(n){return"isClosed"in n?n.isClosed:!1}function Y2(n,e,t,r){var i=n+e-1,[a,o]=[0,r-1],s=Le(n-t,a,o),l=Le(i+t,a,o);return[s,l]}function lv(n,e,t,r,i,a,o){try{var s=n[a](o),l=s.value}catch(d){t(d);return}s.done?e(l):Promise.resolve(l).then(r,i)}function ji(n){return function(){var e=this,t=arguments;return new Promise(function(r,i){var a=n.apply(e,t);function o(l){lv(a,r,i,o,s,"next",l)}function s(l){lv(a,r,i,o,s,"throw",l)}o(void 0)})}}function ja(n,e,t){return e=eO(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function eO(n){var e=tO(n,"string");return typeof e=="symbol"?e:String(e)}function tO(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var ri=ie.module("TableUtils");class F{static copyTableAndApplyFilters(e){var t=arguments;return ji(function*(){if(e==null)return null;for(var r=yield e.copy(),i=t.length,a=new Array(i>1?i-1:0),o=1;o<i;o++)a[o-1]=t[o];return r.applyFilter(Lu(...a.map(s=>s(r)))),r})()}static getSortIndex(e,t){for(var r=0;r<e.length;r+=1){var i,a=e[r];if(((i=a.column)===null||i===void 0?void 0:i.name)===t)return r}return null}static getSortForColumn(e,t){var r=F.getSortIndex(e,t);return r!=null?e[r]:null}static getFilterText(e){return e?e.toString():null}static getFilterTypes(e){return F.isBooleanType(e)?[q.isTrue,q.isFalse,q.isNull]:F.isCharType(e)||F.isNumberType(e)||F.isDateType(e)?[q.eq,q.notEq,q.greaterThan,q.greaterThanOrEqualTo,q.lessThan,q.lessThanOrEqualTo]:F.isTextType(e)?[q.eq,q.eqIgnoreCase,q.notEq,q.notEqIgnoreCase,q.contains,q.notContains,q.startsWith,q.endsWith]:[]}static getNextSort(e,t,r){if(r<0||r>=e.length)return null;var i=F.getSortForColumn(t,e[r].name);return i===null?e[r].sort().asc():i.direction===F.sortDirection.ascending?i.desc():null}static makeColumnSort(e,t,r,i){if(t<0||t>=e.length||r===F.sortDirection.none)return null;var a=e[t].sort();switch(r){case F.sortDirection.ascending:a=a.asc();break;case F.sortDirection.descending:a=a.desc();break}return i&&(a=a.abs()),a}static toggleSortForColumn(e,t,r){var i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(r<0||r>=t.length)return[];var a=F.getNextSort(t,e,r);return F.setSortForColumn(e,t[r].name,a,i)}static sortColumn(e,t,r,i,a,o){if(r<0||r>=t.length)return[];var s=F.makeColumnSort(t,r,i,a);return F.setSortForColumn(e,t[r].name,s,o)}static setSortForColumn(e,t,r){var i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1,a=F.getSortIndex(e,t),o=[];return i&&(o=o.concat(e.filter(s=>{var{direction:l}=s;return l!==F.sortDirection.reverse})),a!==null&&o.splice(a,1)),r!==null&&o.push(r),o}static getNormalizedType(e){switch(e){case"boolean":case"java.lang.Boolean":case F.dataType.BOOLEAN:return F.dataType.BOOLEAN;case"char":case"java.lang.Character":case F.dataType.CHAR:return F.dataType.CHAR;case"java.lang.String":case F.dataType.STRING:return F.dataType.STRING;case"io.deephaven.db.tables.utils.DBDateTime":case"io.deephaven.time.DateTime":case"com.illumon.iris.db.tables.utils.DBDateTime":case"java.time.Instant":case"java.time.ZonedDateTime":case F.dataType.DATETIME:return F.dataType.DATETIME;case"double":case"java.lang.Double":case"float":case"java.lang.Float":case"java.math.BigDecimal":case F.dataType.DECIMAL:return F.dataType.DECIMAL;case"int":case"java.lang.Integer":case"long":case"java.lang.Long":case"short":case"java.lang.Short":case"byte":case"java.lang.Byte":case"java.math.BigInteger":case F.dataType.INT:return F.dataType.INT;default:return F.dataType.UNKNOWN}}static isLongType(e){switch(e){case"long":case"java.lang.Long":return!0;default:return!1}}static isDateType(e){switch(e){case"io.deephaven.db.tables.utils.DBDateTime":case"io.deephaven.time.DateTime":case"java.time.Instant":case"java.time.ZonedDateTime":case"com.illumon.iris.db.tables.utils.DBDateTime":return!0;default:return!1}}static isNumberType(e){return F.isIntegerType(e)||F.isDecimalType(e)}static isIntegerType(e){switch(e){case"int":case"java.lang.Integer":case"java.math.BigInteger":case"long":case"java.lang.Long":case"short":case"java.lang.Short":case"byte":case"java.lang.Byte":return!0;default:return!1}}static isDecimalType(e){switch(e){case"double":case"java.lang.Double":case"java.math.BigDecimal":case"float":case"java.lang.Float":return!0;default:return!1}}static isBigDecimalType(e){switch(e){case"java.math.BigDecimal":return!0;default:return!1}}static isBigIntegerType(e){switch(e){case"java.math.BigInteger":return!0;default:return!1}}static isBooleanType(e){switch(e){case"boolean":case"java.lang.Boolean":return!0;default:return!1}}static isCharType(e){switch(e){case"char":case"java.lang.Character":return!0;default:return!1}}static isStringType(e){switch(e){case"java.lang.String":return!0;default:return!1}}static isTextType(e){return this.isStringType(e)||this.isCharType(e)}static getBaseType(e){return e.split("[]")[0]}static isCompatibleType(e,t){return F.getNormalizedType(e)===F.getNormalizedType(t)}static quoteValue(e){return e.length>=2&&(e.charAt(0)==='"'&&e.charAt(e.length-1)==='"'||e.charAt(0)==="'"&&e.charAt(e.length-1)==="'")?e:'"'.concat(e,'"')}static isRangeOperation(e){switch(e){case"<":case"<=":case"=<":case">":case">=":case"=>":return!0;default:return!1}}static makeRangeFilterWithOperation(e,t,r){switch(t){case"=":return e.eq(r);case"<":return e.lessThan(r);case"<=":case"=<":return e.lessThanOrEqualTo(r);case">":return e.greaterThan(r);case">=":case"=>":return e.greaterThanOrEqualTo(r);case"!=":case"!":return e.notEq(r);default:return null}}static makeCancelableTablePromise(e){return Re.makeCancelable(e,t=>{t.close()})}static makeCancelableTableEventPromise(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null,a,o,s=!0,l=new Promise((d,u)=>{o=setTimeout(()=>{a(),s=!1,u(new q0('Event "'.concat(t,'" timed out.')))},r),a=e.addEventListener(t,c=>{if(i!=null&&!i(c)){ri.debug2("Event triggered, but matcher returned false.");return}ri.debug2("Event triggered, resolving."),a(),clearTimeout(o),s=!1,d(c)})});return l.cancel=()=>{if(s){ri.debug2("Pending promise cleanup."),a(),clearTimeout(o),s=!1;return}ri.debug2("Ignoring non-pending promise cancel.")},l}static removeCommas(e){return e.replace(/[\s|,]/g,"")}static makeBooleanValue(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(e===""&&t)return null;switch(e==null?void 0:e.toLowerCase()){case"null":return null;case"0":case"f":case"fa":case"fal":case"fals":case"false":case"n":case"no":return!1;case"1":case"t":case"tr":case"tru":case"true":case"y":case"ye":case"yes":return!0;default:throw new Error("Invalid boolean '".concat(e,"'"))}}static makeNumberValue(e){if(e==="null"||e==="")return null;var t=e.toLowerCase().trim();if(t==="∞"||t==="infinity"||t==="inf")return Number.POSITIVE_INFINITY;if(t==="-∞"||t==="-infinity"||t==="-inf")return Number.NEGATIVE_INFINITY;var r=F.removeCommas(t);if(F.NUMBER_REGEX.test(r))return parseFloat(r);throw new Error("Invalid number '".concat(e,"'"))}static getFilterOperatorString(e){switch(e){case q.eq:return"=";case q.notEq:return"!=";case q.greaterThan:return">";case q.greaterThanOrEqualTo:return">=";case q.lessThan:return"<";case q.lessThanOrEqualTo:return"<=";case q.contains:return"~";case q.notContains:return"!~";default:throw new Error("Unexpected filter type ".concat(e))}}static isPartitionedTable(e){return e!=null&&e.getMergedTable!==void 0&&e.getKeyTable!==void 0&&e.getKeys!==void 0}static isTreeTable(e){return e!=null&&e.expand!==void 0&&e.collapse!==void 0}static sortColumns(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return[...e].sort((r,i)=>{var a=r.name.toUpperCase(),o=i.name.toUpperCase();return Mr.sort(a,o,t)})}constructor(e){ja(this,"dh",void 0),this.dh=e,sE(this)}createDistinctSortedColumnTable(e,t,r){var i=arguments,a=this;return ji(function*(){if(e==null)return null;for(var o=e,s=i.length,l=new Array(s>3?s-3:0),d=3;d<s;d++)l[d-3]=i[d];l.length>0&&(o=yield e.copy(),yield o.applyFilter(Lu(...l.map(v=>v(o)))));var u=o.findColumn(t),c=yield o.selectDistinct([u]);o!==e&&o.close();var m=c.findColumn(t).sort()[r]();return a.applySort(c,[m])})()}doesColumnValueExist(e,t,r,i){var a=this;return ji(function*(){if(e==null)return null;var o=GP(a,t,r,i?"eq":"eqIgnoreCase"),s=yield e.copy();yield a.applyFilter(s,Lu(o(s)));var l=ZP(s);return s.close(),l>0})()}makeQuickFilter(e,t,r){for(var i=t.split("||"),a=null,o=0;o<i.length;o+=1){for(var s=i[o],l=s.split("&&"),d=null,u=0;u<l.length;u+=1){var c=l[u].trim();if(c.length>0){var m=this.makeQuickFilterFromComponent(e,c,r);if(m)d?d=d.and(m):d=m;else throw new Error("Unable to parse quick filter from text ".concat(t))}}a&&d?a=a.or(d):a=d}return a}makeQuickFilterFromComponent(e,t,r){var{type:i}=e;return F.isNumberType(i)?this.makeQuickNumberFilter(e,t):F.isBooleanType(i)?this.makeQuickBooleanFilter(e,t):r!=null&&F.isDateType(i)?this.makeQuickDateFilter(e,t,r):F.isCharType(i)?this.makeQuickCharFilter(e,t):this.makeQuickTextFilter(e,t)}makeQuickNumberFilter(e,t){var r=e.filter(),{dh:i}=this,a=null,o=/\s*(>=|<=|=>|=<|>|<|!=|=|!)?(\s*-\s*)?(\s*\d*(?:,\d{3})*(?:\.\d*)?\s*)?(null|nan|infinity|inf|\u221E)?(.*)/i,s=o.exec(t),l=null,d=null,u=null,c=null,m=null;if(s!==null&&s.length>3&&([,l,d,u,c,m]=s),m!=null&&m.trim().length>0)return null;if(l==null&&(l="="),c!=null){if(!(l==="="||l==="!"||l==="!="))return null;switch(c=c.trim().toLowerCase(),c){case"null":a=r.isNull();break;case"nan":a=i.FilterCondition.invoke("isNaN",r);break;case"infinity":case"inf":case"∞":d!=null?a=i.FilterCondition.invoke("isInf",r).and(r.lessThan(i.FilterValue.ofNumber(0))):a=i.FilterCondition.invoke("isInf",r).and(r.greaterThan(i.FilterValue.ofNumber(0)));break}return a!==null&&(l==="!"||l==="!=")&&(a=a.not()),a}if(u==null)return null;if(u=F.removeCommas(u),F.isLongType(e.type))try{u=i.FilterValue.ofNumber(i.LongWrapper.ofString("".concat(d!=null?"-":"").concat(u)))}catch(v){return ri.warn("Unable to create long filter",v),null}else{if(u=parseFloat(u),u==null||Number.isNaN(u))return null;u=i.FilterValue.ofNumber(d!=null?0-u:u)}return a=e.filter(),F.makeRangeFilterWithOperation(a,l,u)}static escapeQuickTextFilter(e){var t,r;if(e==null)return null;var i=/^(!~|!=|~|=|!)?(.*)/,a=/^\\*null$/,o=i.exec(e),s=null,l=null;if(o!==null&&o.length>2&&([,s,l]=o),s!=null){var d;return"\\".concat(s).concat((d=l)!==null&&d!==void 0?d:"")}return l!=null&&a.test(l.toLowerCase())||l!=null&&l.startsWith("*")?"\\".concat(l):l!=null&&l.endsWith("*")&&!l.endsWith("\\*")?(l=l.substring(0,l.length-1),"".concat(l,"\\*")):"".concat((t=s)!==null&&t!==void 0?t:"").concat((r=l)!==null&&r!==void 0?r:"")}static unescapeQuickTextFilter(e){var t,r,i=/^(\\!~|\\!=|\\~|\\=|\\!)?(.*)/,a=/^\\*null$/,o=i.exec(e),s=null,l=null;return o!==null&&o.length>2&&([,s,l]=o),s!=null&&(s=s.replace("\\","")),l!=null&&a.test(l.toLowerCase())&&(l=l.replace("\\","")),s==null&&l!=null&&l.startsWith("\\*")&&(l=l.substring(1)),s==null&&l!=null&&l.endsWith("\\*")?(l=l.substring(0,l.length-2),"".concat(l,"*")):"".concat((t=s)!==null&&t!==void 0?t:"").concat((r=l)!==null&&r!==void 0?r:"")}makeQuickTextFilter(e,t){var{dh:r}=this,i="".concat(t).trim(),a=/^(!~|!=|~|=|!)?(.*)/,o=a.exec(i),s=null,l=null;if(o!==null&&o.length>2&&([,s,l]=o,l!=null&&(l=l.trim())),l==null||l.length===0&&!(s==="="||s==="!="))return null;s==null&&(s="=");var d=e.filter();if(l.toLowerCase()==="null")switch(s){case"=":return d.isNull();case"!=":case"!":return d.isNull().not()}var u=null,c=null;switch(l.startsWith("*")?(u="*",l=l.substring(1)):l.endsWith("*")&&!l.endsWith("\\*")&&(c="*",l=l.substring(0,l.length-1)),l=F.unescapeQuickTextFilter(l),s){case"~":return d.isNull().not().and(d.invoke("matches",r.FilterValue.ofString("(?s)(?i).*\\Q".concat(l,"\\E.*"))));case"!~":return d.isNull().or(d.invoke("matches",r.FilterValue.ofString("(?s)(?i).*\\Q".concat(l,"\\E.*"))).not());case"!=":return u==="*"?d.isNull().or(d.invoke("matches",r.FilterValue.ofString("(?s)(?i).*\\Q".concat(l,"\\E$"))).not()):c==="*"?d.isNull().or(d.invoke("matches",r.FilterValue.ofString("(?s)(?i)^\\Q".concat(l,"\\E.*"))).not()):d.notEqIgnoreCase(r.FilterValue.ofString(l.toLowerCase()));case"=":return u==="*"?d.isNull().not().and(d.invoke("matches",r.FilterValue.ofString("(?s)(?i).*\\Q".concat(l,"\\E$")))):c==="*"?d.isNull().not().and(d.invoke("matches",r.FilterValue.ofString("(?s)(?i)^\\Q".concat(l,"\\E.*")))):d.eqIgnoreCase(r.FilterValue.ofString(l.toLowerCase()))}return null}makeQuickBooleanFilter(e,t){var r=/^(!=|=|!)?(.*)/,i=r.exec("".concat(t).trim());if(i===null)return null;var[,a,o]=i,s=a==="!"||a==="!=",l=o.trim().toLowerCase(),d=e.filter();try{var u=F.makeBooleanValue(l);return u!=null&&u?d=d.isTrue():u===null?d=d.isNull():d=d.isFalse(),s?d.not():d}catch{return null}}makeQuickDateFilter(e,t,r){var i=t.trim(),a=/\s*(>=|<=|=>|=<|>|<|!=|!|=)?(.*)/,o=a.exec(i);if(o==null||o.length<=2)throw new Error("Unable to parse date filter: ".concat(t));var s=null,l=null;[,s,l]=o;var d=q.eq;switch(s){case"<":d=q.lessThan;break;case"<=":case"=<":d=q.lessThanOrEqualTo;break;case">":d=q.greaterThan;break;case">=":case"=>":d=q.greaterThanOrEqualTo;break;case"!=":case"!":d=q.notEq;break;case"=":case"==":default:d=q.eq;break}return this.makeQuickDateFilterWithOperation(e,l,d,r)}makeQuickDateFilterWithOperation(e,t,r,i){var{dh:a}=this,[o,s]=Ze.parseDateRange(a,t,i),l=o!=null?a.FilterValue.ofNumber(o):null,d=s!=null?a.FilterValue.ofNumber(s):null,u=e.filter();if(l==null)return r===q.notEq?u.isNull().not():u.isNull();switch(r){case q.eq:{if(d!=null){var c=u.greaterThanOrEqualTo(l),m=u.lessThan(d);return c.and(m)}return u.eq(l)}case q.lessThan:return u.lessThan(l);case q.lessThanOrEqualTo:return d!=null?u.lessThan(d):u.lessThanOrEqualTo(l);case q.greaterThan:return d!=null?u.greaterThanOrEqualTo(d):u.greaterThan(l);case q.greaterThanOrEqualTo:return u.greaterThanOrEqualTo(l);case q.notEq:{if(d!=null){var v=u.lessThan(l),f=u.greaterThanOrEqualTo(d);return v.or(f)}return u.notEq(l)}default:throw new Error("Invalid operator: ".concat(r))}}makeQuickCharFilter(e,t){var{dh:r}=this,i="".concat(t).trim(),a=/^(>=|<=|=>|=<|>|<|!=|=|!)?(null|"."|'.'|.)?(.*)/,o=a.exec(i),s=null,l=null,d=null;if(o!==null&&o.length>3&&([,s,l,d]=o),d!=null&&d.trim().length>0||l==null||l.length===0)return null;s==null&&(s="=");var u=e.filter();if(l.toLowerCase()==="null")switch(s){case"=":return u.isNull();case"!=":case"!":return u.isNull().not();default:return null}var c=r.FilterValue.ofString(F.isRangeOperation(s)?F.quoteValue(l):l);return F.makeRangeFilterWithOperation(u,s,c)}makeAdvancedFilter(e,t,r){for(var{filterItems:i,filterOperators:a,invertSelection:o,selectedValues:s}=t,l=null,d=0;d<i.length;d+=1){var u=i[d],{selectedType:c,value:m}=u;if(c!=null&&c.length>0&&m!=null&&m.length>0)try{var v=this.makeAdvancedValueFilter(e,c,m,r);if(v!=null){if(d===0)l=v;else if(l!==null&&d-1<a.length){var f=a[d-1];if(f===Hn.and)l=l.and(v);else if(f===Hn.or)l=l.or(v);else{ri.error("Unexpected filter operator",f,v),l=null;break}}}else ri.debug2("Empty filter ignored for",c,m)}catch(p){ri.error("Unable to create filter",p),l=null;break}}var g=this.makeSelectValueFilter(e,s,o);return g!=null&&(l!=null?l=l.and(g):l=g),l}makeAdvancedValueFilter(e,t,r,i){var{dh:a}=this;if(F.isDateType(e.type))return this.makeQuickDateFilterWithOperation(e,r,t,i);if(F.isNumberType(e.type)||F.isCharType(e.type))return this.makeQuickFilter(e,"".concat(F.getFilterOperatorString(t)).concat(r));var o=this.makeFilterValue(e.type,r),s=e.filter();switch(t){case q.eq:return s.eq(o);case q.eqIgnoreCase:return s.eqIgnoreCase(o);case q.notEq:return s.notEq(o);case q.notEqIgnoreCase:return s.notEqIgnoreCase(o);case q.greaterThan:return s.greaterThan(o);case q.greaterThanOrEqualTo:return s.greaterThanOrEqualTo(o);case q.lessThan:return s.lessThan(o);case q.lessThanOrEqualTo:return s.lessThanOrEqualTo(o);case q.isTrue:return s.isTrue();case q.isFalse:return s.isFalse();case q.isNull:return s.isNull();case q.contains:return s.isNull().not().and(s.invoke("matches",a.FilterValue.ofString("(?s)(?i).*\\Q".concat(r,"\\E.*"))));case q.notContains:return s.isNull().or(s.invoke("matches",a.FilterValue.ofString("(?s)(?i).*\\Q".concat(r,"\\E.*"))).not());case q.startsWith:return s.isNull().not().and(s.invoke("matches",a.FilterValue.ofString("(?s)(?i)^\\Q".concat(r,"\\E.*"))));case q.endsWith:return s.isNull().not().and(s.invoke("matches",a.FilterValue.ofString("(?s)(?i).*\\Q".concat(r,"\\E$"))));case q.in:case q.inIgnoreCase:case q.notIn:case q.notInIgnoreCase:case q.invoke:default:throw new Error("Unexpected filter operation: ".concat(t))}}applyNeverFilter(e,t){var r=arguments,i=this;return ji(function*(){var a=r.length>2&&r[2]!==void 0?r[2]:F.APPLY_TABLE_CHANGE_TIMEOUT_MS;if(e==null)return null;var o=e.findColumn(t),s=[i.makeNeverFilter(o)];return yield i.applyFilter(e,s,a),e})()}applyCustomColumns(e,t){var r=arguments,i=this;return ji(function*(){var a=r.length>2&&r[2]!==void 0?r[2]:F.APPLY_TABLE_CHANGE_TIMEOUT_MS,{dh:o}=i;return F.executeAndWaitForEvent(s=>s==null?void 0:s.applyCustomColumns(t),e,o.Table.EVENT_CUSTOMCOLUMNSCHANGED,a)})()}applyFilter(e,t){var r=arguments,i=this;return ji(function*(){var a=r.length>2&&r[2]!==void 0?r[2]:F.APPLY_TABLE_CHANGE_TIMEOUT_MS,{dh:o}=i;return F.executeAndWaitForEvent(s=>s==null?void 0:s.applyFilter(t),e,o.Table.EVENT_FILTERCHANGED,a)})()}applySort(e,t){var r=arguments,i=this;return ji(function*(){var a=r.length>2&&r[2]!==void 0?r[2]:F.APPLY_TABLE_CHANGE_TIMEOUT_MS,{dh:o}=i;return F.executeAndWaitForEvent(s=>s==null?void 0:s.applySort(t),e,o.Table.EVENT_SORTCHANGED,a)})()}makeNeverFilter(e){var{dh:t}=this,r=null;F.isTextType(e.type)?r=t.FilterValue.ofString("a"):F.isBooleanType(e.type)?r=t.FilterValue.ofBoolean(!0):F.isDateType(e.type)?r=t.FilterValue.ofNumber(t.DateWrapper.ofJsDate(new Date)):r=t.FilterValue.ofNumber(0);var i=e.filter().eq(r),a=e.filter().notEq(r);return i.and(a)}makeFilterValue(e,t){var{dh:r}=this,i=F.getBaseType(e);return F.isTextType(i)?r.FilterValue.ofString(t):F.isLongType(i)?r.FilterValue.ofNumber(r.LongWrapper.ofString(F.removeCommas(t))):r.FilterValue.ofNumber(F.removeCommas(t))}makeFilterRawValue(e,t){var{dh:r}=this;return F.isCharType(e)?r.FilterValue.ofString(typeof t=="number"?String.fromCharCode(t):t):F.isTextType(e)?r.FilterValue.ofString(t):F.isBooleanType(e)?r.FilterValue.ofBoolean(t):r.FilterValue.ofNumber(t)}makeValue(e,t,r){var{dh:i}=this;if(t==="null")return null;if(F.isTextType(e))return t;if(F.isLongType(e))return i.LongWrapper.ofString(F.removeCommas(t));if(F.isBooleanType(e))return F.makeBooleanValue(t,!0);if(F.isDateType(e)){var[a]=Ze.parseDateRange(i,t,r);return a}return F.isNumberType(e)?F.makeNumberValue(t):(ri.error("Unexpected column type",e),null)}makeSelectValueFilter(e,t,r){var{dh:i}=this;if(t.length===0)return r?null:this.makeNeverFilter(e);for(var a=[],o=!1,s=0;s<t.length;s+=1){var l=t[s];l==null?o=!0:F.isTextType(e.type)?a.push(i.FilterValue.ofString(typeof l=="number"?String.fromCharCode(l):l)):F.isBooleanType(e.type)?a.push(i.FilterValue.ofBoolean(!!l)):a.push(i.FilterValue.ofNumber(l))}return o?a.length>0?r?e.filter().isNull().not().and(e.filter().notIn(a)):e.filter().isNull().or(e.filter().in(a)):r?e.filter().isNull().not():e.filter().isNull():r?e.filter().notIn(a):e.filter().in(a)}}ja(F,"dataType",{BOOLEAN:"boolean",CHAR:"char",DATETIME:"datetime",DECIMAL:"decimal",INT:"int",STRING:"string",UNKNOWN:"unknown"});ja(F,"sortDirection",{ascending:"ASC",descending:"DESC",reverse:"REVERSE",none:null});ja(F,"APPLY_TABLE_CHANGE_TIMEOUT_MS",3e4);ja(F,"REVERSE_TYPE",Object.freeze({NONE:"none",PRE_SORT:"pre-sort",POST_SORT:"post-sort"}));ja(F,"NUMBER_REGEX",/^-?\d+(\.\d+)?$/);ja(F,"executeAndWaitForEvent",function(){var n=ji(function*(e,t,r){var i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:F.APPLY_TABLE_CHANGE_TIMEOUT_MS;if(t==null)return null;var a=F.makeCancelableTableEventPromise(t,r,i);return e(t),yield a,t});return function(e,t,r){return n.apply(this,arguments)}}());function ll(n,e,t){return e=rO(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function rO(n){var e=nO(n,"string");return typeof e=="symbol"?e:String(e)}function nO(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class ur{static makeColumnFormatMap(e){return e==null?new Map:e.reduce((t,r)=>{var i=F.getNormalizedType(r.columnType);if(i===null)return t;t.has(i)||t.set(i,new Map);var a=t.get(i);return a==null||a.set(r.columnName,r.format),t},new Map)}static makeColumnFormattingRule(e,t,r){return{columnType:e,columnName:t,format:r}}constructor(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],r=arguments.length>2?arguments[2]:void 0,i=arguments.length>3?arguments[3]:void 0,a=arguments.length>4?arguments[4]:void 0,o=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!1;ll(this,"defaultColumnFormatter",void 0),ll(this,"typeFormatterMap",void 0),ll(this,"columnFormatMap",void 0),ll(this,"truncateNumbersWithPound",void 0),this.defaultColumnFormatter=new kP,this.typeFormatterMap=new Map([[F.dataType.BOOLEAN,new NP],[F.dataType.CHAR,new IP],[F.dataType.DATETIME,new Ut(e,r)],[F.dataType.DECIMAL,new je(e,i)],[F.dataType.INT,new Bt(e,a)],[F.dataType.STRING,new BP]]),this.columnFormatMap=ur.makeColumnFormatMap(t),this.truncateNumbersWithPound=o}getColumnFormatMapForType(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,r=F.getNormalizedType(e);if(r!==null)return t&&!this.columnFormatMap.has(r)&&this.columnFormatMap.set(r,new Map),this.columnFormatMap.get(r)}getColumnFormat(e,t){var r,i=this.getColumnFormatMapForType(e);return(r=i==null?void 0:i.get(t))!==null&&r!==void 0?r:null}getColumnTypeFormatter(e){var t=F.getNormalizedType(e),r=this.defaultColumnFormatter;if(t){var i;r=(i=this.typeFormatterMap.get(t))!==null&&i!==void 0?i:r}return r}getFormattedString(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"",i=arguments.length>3?arguments[3]:void 0;if(e==null)return"";var a=this.getColumnTypeFormatter(t),o=i||this.getColumnFormat(t,r);return a.format(e,o??void 0)}get timeZone(){var e,t=this.typeFormatterMap.get(F.dataType.DATETIME);return t==null||(e=t.dhTimeZone)===null||e===void 0?void 0:e.id}}function iO(n){if(n&&n.formatter){var{formatter:e}=n;return e}}function aO(n){return{timeZone:n==null?void 0:n.timeZone,defaultDateTimeFormatString:n==null?void 0:n.defaultDateTimeFormat,showTimeZone:n==null?void 0:n.showTimeZone,showTSeparator:n==null?void 0:n.showTSeparator}}function oO(n,e,t){var r=n.getColumnFormat(t,e);return r!=null&&(r.type===Dt.TYPE_CONTEXT_PRESET||r.type===Dt.TYPE_CONTEXT_CUSTOM)}const gi={getColumnFormats:iO,getDateTimeFormatterOptions:aO,isCustomColumnFormatDefined:oO};function sO(n){return typeof n=="object"&&n!=null&&"equals"in n&&typeof n.equals=="function"}function lO(n){return"".concat(n)}function dO(n){var{column:e,table:t,filter:r=Te,onChange:i,selectedValue:a,disabled:o,className:s,formatValue:l=lO,maxSize:d=1e3}=n,u=oa(),[c,m]=w.useState([]);w.useEffect(()=>{if(t==null){m([]);return}var p=e??t.columns[0];t.applyFilter(r);var b=t.setViewport(0,d,[p]);return b.addEventListener(u.Table.EVENT_UPDATED,S=>{var{detail:C}=S,y=C.rows.map(E=>E.get(p));m(y)}),()=>{b.close()}},[e,u,r,d,t]);var v=w.useMemo(()=>a===void 0?[void 0,...c]:c,[a,c]),f=w.useMemo(()=>v.findIndex(p=>p===a||sO(p)&&p.equals(a)),[a,v]),g=w.useCallback(p=>{i(v[p])},[i,v]);return h.jsx(Gt,{className:s,value:f,onChange:g,disabled:o,children:v.map((p,b)=>h.jsx(Xb,{value:b,children:l(p)},"".concat(b)))})}const oC=typeof Au=="function"?Au:Au.default;ec.register([tE,rE,nE,iE,aE,oE]);function dr(n,e,t){return e=uO(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function uO(n){var e=hO(n,"string");return typeof e=="symbol"?e:String(e)}function hO(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class Pt{constructor(e){dr(this,"dh",void 0),dr(this,"listeners",void 0),dr(this,"formatter",void 0),dr(this,"rect",void 0),dr(this,"isDownsamplingDisabled",void 0),dr(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(Pt.EVENT_UPDATED,{detail:e}))}fireDisconnect(){this.fireEvent(new CustomEvent(Pt.EVENT_DISCONNECT))}fireReconnect(){this.fireEvent(new CustomEvent(Pt.EVENT_RECONNECT))}fireDownsampleStart(e){this.fireEvent(new CustomEvent(Pt.EVENT_DOWNSAMPLESTARTED,{detail:e}))}fireDownsampleFinish(e){this.fireEvent(new CustomEvent(Pt.EVENT_DOWNSAMPLEFINISHED,{detail:e}))}fireDownsampleFail(e){this.fireEvent(new CustomEvent(Pt.EVENT_DOWNSAMPLEFAILED,{detail:e}))}fireDownsampleNeeded(e){this.fireEvent(new CustomEvent(Pt.EVENT_DOWNSAMPLENEEDED,{detail:e}))}fireLoadFinished(){this.fireEvent(new CustomEvent(Pt.EVENT_LOADFINISHED))}fireError(e){this.fireEvent(new CustomEvent(Pt.EVENT_ERROR,{detail:e}))}}dr(Pt,"EVENT_UPDATED","ChartModel.EVENT_UPDATED");dr(Pt,"EVENT_DISCONNECT","ChartModel.EVENT_DISCONNECT");dr(Pt,"EVENT_RECONNECT","ChartModel.EVENT_RECONNECT");dr(Pt,"EVENT_DOWNSAMPLESTARTED","ChartModel.EVENT_DOWNSAMPLESTARTED");dr(Pt,"EVENT_DOWNSAMPLEFINISHED","ChartModel.EVENT_DOWNSAMPLEFINISHED");dr(Pt,"EVENT_DOWNSAMPLEFAILED","ChartModel.EVENT_DOWNSAMPLEFAILED");dr(Pt,"EVENT_DOWNSAMPLENEEDED","ChartModel.EVENT_DOWNSAMPLENEEDED");dr(Pt,"EVENT_LOADFINISHED","ChartModel.EVENT_LOADFINISHED");dr(Pt,"EVENT_ERROR","ChartModel.EVENT_ERROR");const Mn=Pt;function dv(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function dl(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?dv(Object(t),!0).forEach(function(r){Wt(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):dv(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function Wt(n,e,t){return e=cO(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function cO(n){var e=mO(n,"string");return typeof e=="symbol"?e:String(e)}function mO(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var Wo=ie.module("ChartUtils"),uv="io.deephaven.time.DateTime",vO=36e5,fO=1e6;function gO(n){return n.asDate!==void 0}function pO(n){return n.asNumber!==void 0}function hv(n){return n.dhTimeZone!==void 0}function bO(n){return n!=null&&n.range!=null&&(n.autorange===!1||n.autorange===void 0)}class ce{static getPlotlyErrorBars(e,t,r,i){var a=r.map((s,l)=>s-e[l]),o=t.map((s,l)=>e[l]-s);return{type:"data",symmetric:!1,array:a,arrayminus:o,color:i.error_band_line_color}}static convertNumberPrefix(e){return e.replace(/\u00A4\u00A4/g,"USD").replace(/\u00A4/g,"$")}static getPlotlyNumberFormat(e,t,r){if(!r)return null;var i=r.split(";"),a=i[0].match(/^([^#,0.]*)([#,]*)([0,]*)(\.?)(0*)(#*)(E?0*)(%?)(.*)/);j(a);var[,o,s,l,,d,u,c,m,v]=a,f=l.replace(",","").length,g=s.indexOf(",")>=0||l.indexOf(",")>=0,p=g?",":"",b=c!=null&&c!==""?"e":"f",S=m!==""?m:b,C=d.length+u.length,y="",E="0".concat(f).concat(p,".").concat(C).concat(y).concat(S),T=ce.convertNumberPrefix(o),O=ce.convertNumberPrefix(v);return{tickformat:E,tickprefix:T,ticksuffix:O,automargin:!0}}static addTickSpacing(e,t,r){var{gapBetweenMajorTicks:i}=t;if(i>0){var a=e||{},o=i;return r&&(o=i/fO),t.log&&(o=Math.log(o)),a.tickmode="linear",a.dtick=o,a}return e}static getSourceForAxis(e,t){for(var r=0;r<e.series.length;r+=1)for(var i=e.series[r],a=0;a<i.sources.length;a+=1){var o=i.sources[a];if(o.axis===t)return o}return null}static getSeriesVisibility(e,t){return t!=null&&t.hiddenSeries!=null&&t.hiddenSeries.includes(e)?"legendonly":!0}static getHiddenLabels(e){return e!=null&&e.hiddenSeries?[...e.hiddenSeries]:[]}static makeSeriesData(e,t,r,i){var a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:ce.ORIENTATION.VERTICAL;return{type:e,mode:t,name:r,orientation:a,showlegend:i??void 0}}static getMarkerSymbol(e){switch(e){case"SQUARE":return"square";case"CIRCLE":return"circle";case"DIAMOND":return"diamond";case"UP_TRIANGLE":return"triangle-up";case"DOWN_TRIANGLE":return"triangle-down";case"RIGHT_TRIANGLE":return"triangle-right";case"LEFT_TRIANGLE":return"triangle-left";case"ELLIPSE":case"HORIZONTAL_RECTANGLE":case"VERTICAL_RECTANGLE":default:throw new Error("Unrecognized shape ".concat(e))}}static getAllAxes(e){return e.charts.reduce((t,r)=>[...t,...r.axes],[])}static getAxisTypeMap(e){var t=ce.getAllAxes(e);return ce.groupArray(t,"type")}static getChartForSeries(e,t){for(var{charts:r}=e,i=0;i<r.length;i+=1)for(var a=r[i],o=0;o<a.series.length;o+=1)if(t===a.series[o])return a;return null}static getLayoutRanges(e){for(var t={},r=Object.keys(e).filter(s=>s.indexOf("axis")>=0),i=0;i<r.length;i+=1){var a=r[i],o=e[a];bO(o)&&(t[a]=[...o.range])}return t}static getAxisLayoutProperty(e,t){var r=t>0?"".concat(t+1):"";return"".concat(e??"","axis").concat(r)}static periodToDecimal(e){var t=e.split(":");return Number(t[0])+Number(t[1])/60}static groupArray(e,t){return e.reduce((r,i)=>{var a,o=i[t],s=(a=r.get(o))!==null&&a!==void 0?a:[];return s.push(i),r.set(o,s),r},new Map)}static getColorwayFromTheme(e){var t=[];return e.colorway&&(Array.isArray(e.colorway)?t=e.colorway:typeof e.colorway=="string"?t=e.colorway.split(" "):Wo.warn("Unable to handle colorway property: ".concat(e.colorway))),t}static titleFromSettings(e){var{series:t,xAxis:r,title:i="".concat((t??[]).join(", ")," by ").concat(r)}=e;return i}constructor(e){Wt(this,"dh",void 0),Wt(this,"daysOfWeek",void 0),this.dh=e,this.daysOfWeek=Object.freeze(e.calendar.DayOfWeek.values())}getAxisFormats(e,t){for(var r=this,i=new Map,a={tickformat:null,ticksuffix:null},o=ce.getAllAxes(e),s=ce.groupArray(o,"type"),{charts:l}=e,d=0;d<l.length;d+=1)for(var u=l[d],c=0;c<u.series.length;c+=1)for(var m=u.series[c],{sources:v}=m,f=v.filter(S=>S.axis),g=function(){var C=f[p],{axis:y}=C,{type:E}=y,T=s.get(E);j(T);var O=T.indexOf(y),N=r.getAxisPropertyName(E);if(N!=null){var P=ce.getAxisLayoutProperty(N,O);if(i.has(P))Wo.debug("".concat(P," already added."));else{Wo.debug("Adding ".concat(P," to axisFormats."));var R=r.getPlotlyAxisFormat(C,t);if(R===null)i.set(P,a);else{i.set(P,R);var{businessCalendar:A}=y;if(A!=null){var M=[],{businessPeriods:I,businessDays:x,holidays:_,timeZone:k}=A,U=t==null?void 0:t.getColumnTypeFormatter(uv),G;hv(U)&&(G=U.dhTimeZone);var Y=G?(k.standardOffset-G.standardOffset)/60:0;_.length>0&&M.push(...r.createRangeBreakValuesFromHolidays(_,k,G)),I.forEach(Z=>M.push({pattern:"hour",bounds:[ce.periodToDecimal(Z.close)+Y,ce.periodToDecimal(Z.open)+Y]})),x.length<r.daysOfWeek.length&&r.createBoundsFromDays(x).forEach(Z=>M.push({pattern:"day of week",bounds:Z})),R.rangebreaks=M}if(i.size===u.axes.length)return{v:i}}}}},p=0;p<f.length;p+=1){var b=g();if(typeof b=="object")return b.v}return i}getPlotlyChartType(e,t){var{dh:r}=this;switch(e){case r.plot.SeriesPlotStyle.SCATTER:return t?"scatter":"scattergl";case r.plot.SeriesPlotStyle.LINE:return"scatter";case r.plot.SeriesPlotStyle.BAR:case r.plot.SeriesPlotStyle.STACKED_BAR:return"bar";case r.plot.SeriesPlotStyle.PIE:return"pie";case r.plot.SeriesPlotStyle.TREEMAP:return"treemap";case r.plot.SeriesPlotStyle.HISTOGRAM:return"histogram";case r.plot.SeriesPlotStyle.OHLC:return"ohlc";default:return}}getPlotlyChartMode(e,t,r){var{dh:i}=this,a=new Set;switch(e){case i.plot.SeriesPlotStyle.SCATTER:(t??!1)&&a.add(ce.MODE_LINES),(r??!0)&&a.add(ce.MODE_MARKERS);break;case i.plot.SeriesPlotStyle.LINE:(t??!0)&&a.add(ce.MODE_LINES),(r??!1)&&a.add(ce.MODE_MARKERS);break}return a.size>0?[...a].join("+"):void 0}getPlotlyProperty(e,t){var{dh:r}=this;switch(e){case r.plot.SeriesPlotStyle.PIE:switch(t){case r.plot.SourceType.X:return"labels";case r.plot.SourceType.Y:return"values"}break;case r.plot.SeriesPlotStyle.OHLC:switch(t){case r.plot.SourceType.TIME:return"x"}break;case r.plot.SeriesPlotStyle.TREEMAP:switch(t){case r.plot.SourceType.X:return"ids";case r.plot.SourceType.Y:return"values";case r.plot.SourceType.LABEL:return"labels";case r.plot.SourceType.PARENT:return"parents";case r.plot.SourceType.COLOR:return"marker.colors"}break}switch(t){case r.plot.SourceType.X:return"x";case r.plot.SourceType.Y:return"y";case r.plot.SourceType.Z:return"z";case r.plot.SourceType.X_LOW:return"xLow";case r.plot.SourceType.X_HIGH:return"xHigh";case r.plot.SourceType.Y_LOW:return"yLow";case r.plot.SourceType.Y_HIGH:return"yHigh";case r.plot.SourceType.TIME:return"time";case r.plot.SourceType.OPEN:return"open";case r.plot.SourceType.HIGH:return"high";case r.plot.SourceType.LOW:return"low";case r.plot.SourceType.CLOSE:return"close";case r.plot.SourceType.SHAPE:return"shape";case r.plot.SourceType.SIZE:return"size";case r.plot.SourceType.LABEL:return"label";case r.plot.SourceType.COLOR:return"color";case r.plot.SourceType.PARENT:return"parent";case r.plot.SourceType.HOVER_TEXT:return"hovertext";case r.plot.SourceType.TEXT:return"text";default:throw new Error("Unrecognized source type: ".concat(t))}}getPlotlySeriesOrientation(e){var t,r,{dh:i}=this,{sources:a}=e;return a.length===2&&((t=a[0])===null||t===void 0||(r=t.axis)===null||r===void 0?void 0:r.type)===i.plot.AxisType.Y?ce.ORIENTATION.HORIZONTAL:ce.ORIENTATION.VERTICAL}makeSeriesDataFromSeries(e,t,r,i){var a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:null,{name:o,isLinesVisible:s,isShapesVisible:l,plotStyle:d,lineColor:u,shapeColor:c,sources:m,shape:v,shapeSize:f}=e,g=m.some(y=>{var E;return(E=y.axis)===null||E===void 0?void 0:E.businessCalendar}),p=this.getChartType(d,g),b=this.getPlotlyChartMode(d,s??void 0,l??void 0),S=this.getPlotlySeriesOrientation(e),C=ce.makeSeriesData(p,b,o,a,S);return this.addSourcesToSeriesData(C,d,m,t),this.addStylingToSeriesData(C,d,i,u,c,v,f,r),C}addSourcesToSeriesData(e,t,r,i){for(var a=e,o=0;o<r.length;o+=1){var s=r[o],{axis:l,type:d}=s,u=this.getPlotlyProperty(t,d);gb(a,u,[]);var c=l!=null?this.getAxisPropertyName(l.type):null;if(c!=null){var m=i.get(l.type);if(m){var v=m.indexOf(l),f=v>0?"".concat(v+1):"";a["".concat(c,"axis")]="".concat(c).concat(f)}}}}addStylingToSeriesData(e,t,r){var i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null,a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:null,o=arguments.length>5&&arguments[5]!==void 0?arguments[5]:null,s=arguments.length>6&&arguments[6]!==void 0?arguments[6]:null,l=arguments.length>7&&arguments[7]!==void 0?arguments[7]:null,{dh:d}=this,u=e;if(u.marker={line:{}},u.line={width:1},t===d.plot.SeriesPlotStyle.AREA?u.fill="tozeroy":t===d.plot.SeriesPlotStyle.STACKED_AREA?u.stackgroup="stack":t===d.plot.SeriesPlotStyle.STEP?u.line.shape="hv":t===d.plot.SeriesPlotStyle.HISTOGRAM?(u.width=[],u.marker.line!==void 0&&Object.assign(u.marker.line,{color:r.paper_bgcolor,width:1})):t===d.plot.SeriesPlotStyle.OHLC?(u.increasing={line:{color:r.ohlc_increasing}},u.decreasing={line:{color:r.ohlc_decreasing}}):t===d.plot.SeriesPlotStyle.PIE?(u.textinfo="label+percent",u.outsidetextfont={color:r.title_color}):t===d.plot.SeriesPlotStyle.TREEMAP&&(u.hoverinfo="text",u.textinfo="label+text",u.tiling={packing:"squarify",pad:0},u.textposition="middle center",u.outsidetextfont={color:r.title_color}),i!=null&&(t===d.plot.SeriesPlotStyle.BAR?u.marker.color=i:u.line.color=i),a!=null&&(u.marker.color=a),o!=null&&o.length>0)try{u.marker.symbol=ce.getMarkerSymbol(o)}catch(c){Wo.warn("Unable to handle shape",o,":",c)}s!=null&&(u.marker.size=s*ce.DEFAULT_MARKER_SIZE),l!=null&&t!==d.plot.SeriesPlotStyle.PIE&&(u.visible=l)}getChartType(e,t){var{dh:r}=this;switch(e){case r.plot.SeriesPlotStyle.HISTOGRAM:return"bar";default:return this.getPlotlyChartType(e,t)}}getAxisPropertyName(e){var{dh:t}=this;switch(e){case t.plot.AxisType.X:return"x";case t.plot.AxisType.Y:return"y";default:return null}}getAxisSide(e){var{dh:t}=this;switch(e){case t.plot.AxisPosition.BOTTOM:return"bottom";case t.plot.AxisPosition.TOP:return"top";case t.plot.AxisPosition.LEFT:return"left";case t.plot.AxisPosition.RIGHT:return"right";default:return}}updateFigureAxes(e,t,r,i){for(var a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0,o=arguments.length>5&&arguments[5]!==void 0?arguments[5]:0,s=e,l=ce.getAllAxes(t),d=0;d<t.charts.length;d+=1){var u=t.charts[d],c=i==null?void 0:i(u),m=this.getChartBounds(t,u,a,o);this.updateLayoutAxes(s,u.axes,l,r,a,o,m,c)}this.removeStaleAxes(s,l)}getChartBounds(e,t,r,i){var a,{dh:o}=this,{cols:s,rows:l}=e,{column:d,colspan:u,row:c,rowspan:m}=t,v=d+u,f=c+m,g=1/s,p=1/l,b=ce.AXIS_SIZE_PX/r,S=ce.AXIS_SIZE_PX/i,C={bottom:(l-f)*p+(f<l?S/2:0),top:(l-c)*p-(c>0?S/2:0),left:d*g+(d>0?b/2:0),right:v*g-(v<s?b/2:0)},y=ce.groupArray(t.axes,"position"),E=(a=y.get(o.plot.AxisPosition.RIGHT))!==null&&a!==void 0?a:[];return E.length>0&&(r>0?C.right-=(C.right-C.left)*Math.max(0,Math.min(ce.LEGEND_WIDTH_PX/r,ce.MAX_LEGEND_SIZE)):C.right-=(C.right-C.left)*ce.DEFAULT_AXIS_SIZE),C}getPlotlyDateFormat(e,t,r){var{dh:i}=this,a=r==null?void 0:r.replace("%","%%").replace(/S{9}/g,"%9f").replace(/S{8}/g,"%8f").replace(/S{7}/g,"%7f").replace(/S{6}/g,"%6f").replace(/S{5}/g,"%5f").replace(/S{4}/g,"%4f").replace(/S{3}/g,"%3f").replace(/S{2}/g,"%2f").replace(/S{1}/g,"%1f").replace(/y{4}/g,"%Y").replace(/y{2}/g,"%y").replace(/M{4}/g,"%B").replace(/M{3}/g,"%b").replace(/M{2}/g,"%m").replace(/M{1}/g,"%-m").replace(/E{4,}/g,"%A").replace(/E{1,}/g,"%a").replace(/d{2}/g,"%d").replace(/([^%]|^)d{1}/g,"$1%-d").replace(/H{2}/g,"%H").replace(/h{2}/g,"%I").replace(/h{1}/g,"%-I").replace(/m{2}/g,"%M").replace(/s{2}/g,"%S").replace("'T'","T").replace(" z",""),o,s=e==null?void 0:e.getColumnTypeFormatter(t);return s!=null&&hv(s)&&s.dhTimeZone!=null&&s.showTimeZone&&(o=i.i18n.DateTimeFormat.format(" z",new Date,s.dhTimeZone)),{tickformat:a,ticksuffix:o,automargin:!0}}getPlotlyAxisFormat(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null,{dh:r}=this,{axis:i,columnType:a}=e,{formatPattern:o}=i,s=null;return F.isDateType(a)?(s=this.getPlotlyDateFormat(t,a,o),s=ce.addTickSpacing(s,i,!0)):F.isNumberType(a)&&(s=ce.getPlotlyNumberFormat(t,a,o),s=ce.addTickSpacing(s,i,!1)),i.formatType===r.plot.AxisFormatType.CATEGORY&&(s?s.type="category":s={type:"category",tickformat:void 0,ticksuffix:void 0}),s}updateLayoutAxes(e,t,r,i){for(var a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0,o=arguments.length>5&&arguments[5]!==void 0?arguments[5]:0,s=arguments.length>6&&arguments[6]!==void 0?arguments[6]:{left:0,top:0,right:1,bottom:1},l=arguments.length>7?arguments[7]:void 0,{dh:d}=this,u=a>0?Math.max(ce.MIN_AXIS_SIZE,Math.min(ce.AXIS_SIZE_PX/o,ce.MAX_AXIS_SIZE)):ce.DEFAULT_AXIS_SIZE,c=o>0?Math.max(ce.MIN_AXIS_SIZE,Math.min(ce.AXIS_SIZE_PX/a,ce.MAX_AXIS_SIZE)):ce.DEFAULT_AXIS_SIZE,m=e,v=ce.groupArray(t,"position"),f=ce.groupArray(t,"type"),g=[...f.keys()],p=ce.groupArray(r,"type"),b=0;b<g.length;b+=1){var S=g[b],C=this.getAxisPropertyName(S);if(C!=null){var y=f.get(S),E=p.get(S),T=S===d.plot.AxisType.Y,O=T?o:a;j(y),j(E);for(var N=0;N<y.length;N+=1){var P=y[N],R=E.indexOf(P),A=ce.getAxisLayoutProperty(C,R);m[A]==null&&(m[A]=this.makeLayoutAxis(S,i));var M=m[A];if(M!=null){this.updateLayoutAxis(M,P,N,v,u,c,s);var{range:I,autorange:x}=M;if(l!=null&&I!==void 0&&(x===void 0||x===!1)){var _=l(P),[k,U]=_(I);Wo.debug("Setting downsample range",O,k,U),P.range(O,k,U)}else P.range(O)}}}}}removeStaleAxes(e,t){for(var r=e,i=ce.groupArray(t,"type"),a=[...i.keys()],o=0;o<a.length;o+=1){var s=a[o],l=i.get(s);j(l);var d=l.length,u=this.getAxisPropertyName(s);if(u!=null)for(var c=ce.getAxisLayoutProperty(u,d);r[c]!=null;)delete r[c],d+=1,c=ce.getAxisLayoutProperty(u,d)}}updateLayoutAxis(e,t,r,i,a,o,s){var l,{dh:d}=this,u=t.type===d.plot.AxisType.Y,c=u?o:a,m=e,v=(l=t.label)!==null&&l!==void 0?l:"";if(m.title!==void 0&&typeof m.title!="string"?m.title.text=v:m.title={text:v},t.log&&(m.type="log"),m.side=this.getAxisSide(t.position),r>0){var f,g;m.overlaying=(f=this.getAxisPropertyName(t.type))!==null&&f!==void 0?f:void 0;var p=(g=i.get(t.position))!==null&&g!==void 0?g:[],b=p.indexOf(t);b>0&&(m.anchor="free",t.position===d.plot.AxisPosition.RIGHT?m.position=s.right+(b-p.length+1)*c:t.position===d.plot.AxisPosition.TOP?m.position=s.top+(b-p.length+1)*c:t.position===d.plot.AxisPosition.BOTTOM?m.position=s.bottom+(p.length-b+1)*c:t.position===d.plot.AxisPosition.LEFT&&(m.position=s.left+(p.length-b+1)*c))}else if(t.type===d.plot.AxisType.X){var S=i.get(d.plot.AxisPosition.LEFT)||[],C=i.get(d.plot.AxisPosition.RIGHT)||[],y=Math.max(s.left,s.left+(S.length-1)*o),E=Math.min(s.right-(C.length-1)*o,s.right);m.domain=[y,E]}else if(t.type===d.plot.AxisType.Y){var T=i.get(d.plot.AxisPosition.BOTTOM)||[],O=i.get(d.plot.AxisPosition.TOP)||[],N=Math.max(s.bottom,s.bottom+(T.length-1)*a),P=Math.min(s.top-(O.length-1)*a,s.top);m.domain=[N,P]}}createBoundsFromDays(e){var t=e.map(o=>this.daysOfWeek.indexOf(o)),r=this.daysOfWeek.filter(o=>!e.includes(o)).map(o=>this.daysOfWeek.indexOf(o)),i=new Set;r.forEach(o=>{for(var s=o+1;s<o+this.daysOfWeek.length;s+=1){var l=s%this.daysOfWeek.length;if(t.includes(l)){i.add(l);break}}});var a=[];return i.forEach(o=>{for(var s=o-1;s>o-this.daysOfWeek.length;s-=1){var l=s<0?s+this.daysOfWeek.length:s;if(t.includes(l)){var d=(l+1)%7;a.push([d,o]);break}}}),a}createRangeBreakValuesFromHolidays(e,t,r){var i=[],a=[];return e.forEach(o=>{o.businessPeriods.length>0?a.push(...this.createPartialHoliday(o,t,r)):i.push(this.createFullHoliday(o,t,r))}),[{values:i},...a]}createFullHoliday(e,t,r){return this.adjustDateForTimeZone("".concat(e.date.toString()," 00:00:00.000000"),t,r)}createPartialHoliday(e,t,r){var i=e.date.toString(),a=["00:00"];e.businessPeriods.forEach(m=>{a.push(m.open),a.push(m.close)}),a.push("24:00");for(var o=[],s=0;s<a.length;s+=2){var l=a[s],d=a[s+1];if(l!==d){var u=[this.adjustDateForTimeZone("".concat(i," ").concat(l,":00.000000"),t,r)],c=vO*(ce.periodToDecimal(d)-ce.periodToDecimal(l));o.push({values:u,dvalue:c})}}return o}adjustDateForTimeZone(e,t,r){return r&&r.standardOffset!==t.standardOffset?this.unwrapValue(this.wrapValue(e,uv,t),r):e}makeFigureSettings(e,t){var{dh:r}=this,{series:i,xAxis:a,type:o}=e,s=ce.titleFromSettings(e),l={formatType:"".concat(r.plot.AxisFormatType.NUMBER),type:"".concat(r.plot.AxisType.X),position:"".concat(r.plot.AxisPosition.BOTTOM)},d={formatType:"".concat(r.plot.AxisFormatType.NUMBER),type:"".concat(r.plot.AxisType.Y),position:"".concat(r.plot.AxisPosition.LEFT)};return{charts:[{chartType:"".concat(r.plot.ChartType.XY),axes:[l,d],series:(i??[]).map(u=>({plotStyle:"".concat(o),name:u,dataSources:[{type:"".concat(r.plot.SourceType.X),columnName:a??"",axis:l,table:t},{type:"".concat(r.plot.SourceType.Y),columnName:u,axis:d,table:t}]}))}],title:s}}unwrapValue(e,t){var{dh:r}=this;if(e!=null){if(gO(e))return r.i18n.DateTimeFormat.format(ce.DATE_FORMAT,e,t);if(pO(e))return e.asNumber()}return e}wrapValue(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,{dh:i}=this;if(F.isDateType(t)&&typeof e=="string"){var a=e,o=ce.DATE_FORMAT.substr(0,e.length),s=i.i18n.DateTimeFormat.parse(o,a);if(!r)return s;var l="".concat(o," Z"),d=i.i18n.DateTimeFormat.format("Z",s,r),u=i.i18n.DateTimeFormat.parse(l,"".concat(a," ").concat(d)),c=i.i18n.DateTimeFormat.format("Z",u,r);return i.i18n.DateTimeFormat.parse(l,"".concat(a," ").concat(c))}return e}makeLayoutAxis(e,t){var{dh:r}=this,i={automargin:!0,gridcolor:t.gridcolor,linecolor:t.linecolor,rangeslider:{visible:!1},showline:!0,ticklen:5,tickcolor:t.paper_bgcolor,tickfont:{color:t.zerolinecolor},title:{font:{color:t.title_color}},legend:{font:{color:t.legend_color}}};return e===r.plot.AxisType.X?Object.assign(i,{showgrid:!0}):e===r.plot.AxisType.Y&&Object.assign(i,{zerolinecolor:t.zerolinecolor,zerolinewidth:2}),i}makeDefaultLayout(e){var{dh:t}=this,{paper_bgcolor:r,plot_bgcolor:i,title_color:a,coastline_color:o,land_color:s,ocean_color:l,lake_color:d,river_color:u}=e,c={paper_bgcolor:r,plot_bgcolor:i,autosize:!0,colorway:ce.getColorwayFromTheme(e),font:{family:"'Fira Sans', sans-serif",color:a},title:{font:{color:a},yanchor:"top",pad:dl({},ce.DEFAULT_TITLE_PADDING),y:1},legend:{font:{color:a}},margin:dl({},ce.DEFAULT_MARGIN),xaxis:this.makeLayoutAxis(t.plot.AxisType.X,e),yaxis:this.makeLayoutAxis(t.plot.AxisType.Y,e),polar:{angularaxis:this.makeLayoutAxis(t.plot.AxisType.SHAPE,e),radialaxis:this.makeLayoutAxis(t.plot.AxisType.SHAPE,e),bgcolor:e.plot_bgcolor},scene:{xaxis:this.makeLayoutAxis(t.plot.AxisType.X,e),yaxis:this.makeLayoutAxis(t.plot.AxisType.Y,e),zaxis:this.makeLayoutAxis(t.plot.AxisType.Z,e)},geo:{showcoastlines:!0,showframe:!1,showland:!0,showocean:!0,showlakes:!0,showrivers:!0,bgcolor:r,coastlinecolor:o,landcolor:s,oceancolor:l,lakecolor:d,rivercolor:u}};return c.datarevision=0,c}hydrateSettings(e){var{dh:t}=this;return dl(dl({},e),{},{type:e.type!=null?t.plot.SeriesPlotStyle[e.type]:void 0})}}Wt(ce,"DEFAULT_AXIS_SIZE",.15);Wt(ce,"MIN_AXIS_SIZE",.025);Wt(ce,"MAX_AXIS_SIZE",.2);Wt(ce,"AXIS_SIZE_PX",75);Wt(ce,"LEGEND_WIDTH_PX",50);Wt(ce,"MAX_LEGEND_SIZE",.25);Wt(ce,"ORIENTATION",Object.freeze({HORIZONTAL:"h",VERTICAL:"v"}));Wt(ce,"DATE_FORMAT","yyyy-MM-dd HH:mm:ss.SSSSSS");Wt(ce,"DEFAULT_MARGIN",Object.freeze({l:60,r:50,t:30,b:60,pad:0}));Wt(ce,"DEFAULT_TITLE_PADDING",Object.freeze({t:8}));Wt(ce,"SUBTITLE_LINE_HEIGHT",25);Wt(ce,"DEFAULT_MARKER_SIZE",6);Wt(ce,"MODE_MARKERS","markers");Wt(ce,"MODE_LINES","lines");const Yt=ce;function CO(n,e,t){return e=SO(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function SO(n){var e=wO(n,"string");return typeof e=="symbol"?e:String(e)}function wO(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class yO extends Error{constructor(){super(...arguments),CO(this,"isDownsamplingError",!0)}}function cv(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function mv(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?cv(Object(t),!0).forEach(function(r){Kt(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):cv(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function Kt(n,e,t){return e=EO(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function EO(n){var e=TO(n,"string");return typeof e=="symbol"?e:String(e)}function TO(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var Di=ie.module("Chart");class Ki extends w.Component{static convertIcon(e){var[t,,,,r]=e.icon,i="".concat(r);return{width:t,path:i,ascent:t,descent:0,transform:"matrix(1, 0, 0, 1, 0, 0)"}}static downsampleButtonTitle(e,t){return e?"Downsampling in progress...":t?"Downsampling disabled, click to enable":"Downsampling enabled, click to disable"}static downsampleButtonAttr(e,t){return e?"animation-spin":t?void 0:"fill-active"}constructor(e){var t;super(e),Kt(this,"currentSeries",void 0),Kt(this,"PlotComponent",void 0),Kt(this,"plot",void 0),Kt(this,"plotWrapper",void 0),Kt(this,"columnFormats",void 0),Kt(this,"dateTimeFormatterOptions",void 0),Kt(this,"decimalFormatOptions",void 0),Kt(this,"integerFormatOptions",void 0),Kt(this,"rect",void 0),Kt(this,"ranges",void 0),Kt(this,"isSubscribed",void 0),Kt(this,"isLoadedFired",void 0),Kt(this,"resizeObserver",void 0),Kt(this,"getCachedConfig",be((r,i,a,o,s,l)=>{var d=[],u=!!r;u&&d.push({name:"Downsampling failed: ".concat(r),title:"Downsampling failed",click:()=>{this.toggleErrorMessage("".concat(r))},icon:Ki.convertIcon(hh),attr:"fill-warning"});var c=!!l;if(c&&d.push({name:"Error: ".concat(l),title:"Error",click:()=>{this.toggleErrorMessage("".concat(l))},icon:Ki.convertIcon(hh),attr:"fill-warning"}),i||a||o||u){var m=Ki.downsampleButtonTitle(a,o),v=Ki.downsampleButtonAttr(a,o),f=a?Ky:qy;d.push({name:m,title:"Downsampling status",icon:Ki.convertIcon(f),click:this.handleDownsampleClick,attr:v})}var g=s.some(C=>{var{type:y}=C;return y!=null&&!y.includes("3d")}),p=s.some(C=>{var{type:y}=C;return y!=null&&y.includes("3d")}),b=["zoomIn2d","zoomOut2d","autoScale2d","resetScale2d"],S=["orbitRotation","tableRotation","resetCameraDefault3d"];return{displaylogo:!1,displayModeBar:a||u||c?!0:"hover",modeBarButtons:[d,["toImage"],["zoom2d","pan2d"],[...g?b:[],...p?S:[]]]}})),this.handleAfterPlot=this.handleAfterPlot.bind(this),this.handleDownsampleClick=this.handleDownsampleClick.bind(this),this.handleErrorClose=this.handleErrorClose.bind(this),this.handleModelEvent=this.handleModelEvent.bind(this),this.handlePlotUpdate=this.handlePlotUpdate.bind(this),this.handleRelayout=this.handleRelayout.bind(this),this.handleResize=this.handleResize.bind(this),this.handleRestyle=this.handleRestyle.bind(this),this.PlotComponent=oC(e.Plotly),this.plot=oe.createRef(),this.plotWrapper=(t=e.containerRef)!==null&&t!==void 0?t:oe.createRef(),this.columnFormats=[],this.dateTimeFormatterOptions={},this.decimalFormatOptions={},this.integerFormatOptions={},this.isSubscribed=!1,this.isLoadedFired=!1,this.currentSeries=0,this.resizeObserver=new window.ResizeObserver(this.handleResize),this.state={data:null,downsamplingError:null,isDownsampleFinished:!1,isDownsampleInProgress:!1,isDownsamplingDisabled:!1,error:null,shownError:null,layout:{datarevision:0},revision:0}}componentDidMount(){this.updateDimensions(),this.updateModelDimensions(),this.initData(),this.initFormatter();var{isActive:e,model:t}=this.props;e&&this.subscribe(t),this.plotWrapper.current!=null&&this.resizeObserver.observe(this.plotWrapper.current)}componentDidUpdate(e){var{isActive:t,model:r,settings:i}=this.props;this.updateFormatterSettings(i),r!==e.model&&(this.unsubscribe(e.model),this.subscribe(r)),t!==e.isActive&&(t?(this.updateDimensions(),this.subscribe(r)):this.unsubscribe(r))}componentWillUnmount(){var{model:e}=this.props;this.unsubscribe(e),this.resizeObserver.disconnect()}getPlotRect(){var e,t;return(e=(t=this.plotWrapper.current)===null||t===void 0?void 0:t.getBoundingClientRect())!==null&&e!==void 0?e:null}initData(){var{model:e}=this.props,{layout:t}=this.state;this.setState({data:e.getData(),layout:mv(mv({},t),e.getLayout())})}subscribe(e){if(!this.isSubscribed){if(!this.rect||this.rect.width===0||this.rect.height===0){Di.debug2("Delaying subscription until model dimensions are set");return}e.subscribe(this.handleModelEvent),this.isSubscribed=!0}}unsubscribe(e){this.isSubscribed&&(e.unsubscribe(this.handleModelEvent),this.isSubscribed=!1)}handleAfterPlot(){this.plot.current!=null}handleDownsampleClick(){this.setState(e=>{var{isDownsamplingDisabled:t}=e;return{downsamplingError:null,isDownsampleInProgress:!1,isDownsampleFinished:!1,isDownsamplingDisabled:!t}},()=>{var{model:e}=this.props,{isDownsamplingDisabled:t}=this.state;e.setDownsamplingDisabled(t)})}handleErrorClose(){this.setState({shownError:null})}handleModelEvent(e){var{type:t,detail:r}=e;switch(Di.debug2("Received data update",t,r),t){case Mn.EVENT_UPDATED:{this.currentSeries+=1,this.setState(v=>{var{layout:f,revision:g}=v;return typeof f.datarevision=="number"&&(f.datarevision+=1),{data:r,layout:f,revision:g+1}});var{onUpdate:i}=this.props;i({isLoading:!this.isLoadedFired});break}case Mn.EVENT_LOADFINISHED:{var{onUpdate:a}=this.props;this.isLoadedFired=!0,a({isLoading:!1});break}case Mn.EVENT_DISCONNECT:{var{onDisconnect:o}=this.props;o();break}case Mn.EVENT_RECONNECT:{var{onReconnect:s}=this.props;s();break}case Mn.EVENT_DOWNSAMPLESTARTED:{this.setState({isDownsampleFinished:!1,isDownsampleInProgress:!0,downsamplingError:null});break}case Mn.EVENT_DOWNSAMPLEFINISHED:{this.setState({isDownsampleFinished:!0,isDownsampleInProgress:!1,downsamplingError:null});break}case Mn.EVENT_DOWNSAMPLENEEDED:case Mn.EVENT_DOWNSAMPLEFAILED:{var l,d=(l=r.message)!==null&&l!==void 0?l:r;this.setState({isDownsampleFinished:!1,isDownsampleInProgress:!1,isDownsamplingDisabled:!1,downsamplingError:d});var{onError:u}=this.props;u(new yO(d));break}case Mn.EVENT_ERROR:{var c="".concat(r);this.setState({error:c});var{onError:m}=this.props;m(new Error(c));break}default:Di.debug("Unknown event type",t,e)}}handlePlotUpdate(e){var{layout:t}=e,r=Yt.getLayoutRanges(t),i=!mt(r,this.ranges);i&&(this.ranges=r,this.updateModelDimensions(!0))}handleRelayout(e){if(Di.debug("handleRelayout",e),e.hiddenlabels!=null){var{onSettingsChanged:t}=this.props,r=[...e.hiddenlabels];t({hiddenSeries:r})}this.updateModelDimensions()}handleResize(){this.updateDimensions()}handleRestyle(e){var[t,r]=e;if(Di.debug("handleRestyle",t,r),Object.keys(t).includes("visible")){var{data:i}=this.state,{onSettingsChanged:a}=this.props;if(i!=null){var o=i.reduce((s,l)=>{var{name:d,visible:u}=l;return d!=null&&u==="legendonly"?[...s,d]:s},[]);a({hiddenSeries:o})}}}toggleErrorMessage(e){this.setState(t=>{var{shownError:r}=t;return{shownError:r===e?null:e}})}updateModelDimensions(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,t=this.getPlotRect();if(!t){Di.warn("Unable to get plotting rect");return}var r=!this.rect||this.rect.width!==t.width||this.rect.height!==t.height;if(r||e){this.rect=t;var{isActive:i,model:a}=this.props;a.setDimensions(t),i&&this.subscribe(a)}}initFormatter(){var{settings:e}=this.props;this.updateFormatterSettings(e)}updateFormatterSettings(e){var t=gi.getColumnFormats(e),r=gi.getDateTimeFormatterOptions(e),{decimalFormatOptions:i={},integerFormatOptions:a={}}=e;(!mt(this.columnFormats,t)||!mt(this.dateTimeFormatterOptions,r)||!mt(this.decimalFormatOptions,i)||!mt(this.integerFormatOptions,a))&&(this.columnFormats=gi.getColumnFormats(e),this.dateTimeFormatterOptions=r,this.decimalFormatOptions=i,this.integerFormatOptions=a,this.updateFormatter())}updateFormatter(){var{model:e}=this.props,t=new ur(e.dh,this.columnFormats,this.dateTimeFormatterOptions,this.decimalFormatOptions,this.integerFormatOptions);e.setFormatter(t)}updateDimensions(){var e=this.getPlotRect(),{Plotly:t}=this.props;this.plot.current!=null&&e!=null&&e.width>0&&e.height>0&&t.relayout(this.plot.current.el,{autosize:!0}).catch(r=>{Di.debug("Unable to resize, promise rejected",r)})}render(){var{PlotComponent:e}=this,{data:t,downsamplingError:r,isDownsampleFinished:i,isDownsampleInProgress:a,isDownsamplingDisabled:o,error:s,shownError:l,layout:d,revision:u}=this.state,c=this.getCachedConfig(r,i,a,o,t??[],s),m=t!=null;return h.jsxs("div",{className:"h-100 w-100 chart-wrapper",ref:this.plotWrapper,children:[m&&h.jsx(e,{ref:this.plot,data:t,layout:d,revision:u,config:c,onAfterPlot:this.handleAfterPlot,onError:Di.error,onRelayout:this.handleRelayout,onUpdate:this.handlePlotUpdate,onRestyle:this.handleRestyle,useResizeHandler:!0,style:{height:"100%",width:"100%"}}),h.jsx(La,{className:"chart-error-popper",options:{placement:"top"},isShown:l!=null,onExited:this.handleErrorClose,closeOnBlur:!0,interactive:!0,children:l!=null&&h.jsxs(h.Fragment,{children:[h.jsx("div",{className:"chart-error",children:l}),h.jsx(Md,{tooltip:"Copy Error",copy:l,children:"Copy Error"})]})})]})}}Kt(Ki,"defaultProps",{isActive:!0,settings:{timeZone:"America/New_York",defaultDateTimeFormat:Ze.FULL_DATE_FORMAT,showTimeZone:!1,showTSeparator:!0,formatter:[]},Plotly:ec,onDisconnect:()=>{},onReconnect:()=>{},onUpdate:()=>{},onError:()=>{},onSettingsChanged:()=>{}});const sC=Ki;function vv(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function fv(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?vv(Object(t),!0).forEach(function(r){ht(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):vv(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function ht(n,e,t){return e=PO(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function PO(n){var e=OO(n,"string");return typeof e=="symbol"?e:String(e)}function OO(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var At=ie.module("FigureChartModel");class kd extends Mn{constructor(e,t,r){var i,a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};super(e),i=this,ht(this,"chartUtils",void 0),ht(this,"dh",void 0),ht(this,"figure",void 0),ht(this,"settings",void 0),ht(this,"theme",void 0),ht(this,"data",void 0),ht(this,"layout",void 0),ht(this,"seriesDataMap",void 0),ht(this,"pendingSeries",void 0),ht(this,"oneClicks",void 0),ht(this,"filterColumnMap",void 0),ht(this,"lastFilter",void 0),ht(this,"isConnected",void 0),ht(this,"seriesToProcess",void 0),ht(this,"addPendingSeries",wt(()=>{for(var s=Yt.getAxisTypeMap(this.figure),{pendingSeries:l}=this,d=function(){var m,v=l[u],f=i.figure.charts.find(g=>g.series.includes(v));i.addSeries(v,s,(m=f==null?void 0:f.showLegend)!==null&&m!==void 0?m:null),v.subscribe()},u=0;u<l.length;u+=1)d();this.pendingSeries=[]},kd.ADD_SERIES_DEBOUNCE)),ht(this,"getTimeZone",Se((s,l)=>{if(l!=null){var d=l.getColumnTypeFormatter(s);if(d!=null)return d.dhTimeZone}})),ht(this,"getValueTranslator",Se((s,l)=>{var d=this.getTimeZone(s,l);return u=>this.chartUtils.unwrapValue(u,d)})),ht(this,"getValueParser",Se((s,l)=>{var d=this.getTimeZone(s,l);return u=>this.chartUtils.wrapValue(u,s,d)})),ht(this,"getRangeParser",Se((s,l)=>d=>{var[u,c]=d,m=this.getValueParser(s,l);return u=m(u),c=m(c),[u,c]})),ht(this,"getAxisRangeParser",Se((s,l)=>d=>{var u=Yt.getSourceForAxis(s,d);return u!=null?this.getRangeParser(u.columnType,l):c=>c})),this.handleFigureUpdated=this.handleFigureUpdated.bind(this),this.handleFigureDisconnected=this.handleFigureDisconnected.bind(this),this.handleFigureReconnected=this.handleFigureReconnected.bind(this),this.handleFigureSeriesAdded=this.handleFigureSeriesAdded.bind(this),this.handleDownsampleStart=this.handleDownsampleStart.bind(this),this.handleDownsampleFinish=this.handleDownsampleFinish.bind(this),this.handleDownsampleFail=this.handleDownsampleFail.bind(this),this.handleDownsampleNeeded=this.handleDownsampleNeeded.bind(this),this.handleRequestFailed=this.handleRequestFailed.bind(this),this.dh=e,this.chartUtils=new Yt(e),this.figure=t,this.settings=a,this.theme=r,this.data=[];var o={data:{},layout:this.chartUtils.makeDefaultLayout(r)};this.layout={grid:{rows:t.rows,columns:t.cols,pattern:"independent"},template:o},this.seriesDataMap=new Map,this.pendingSeries=[],this.oneClicks=[],this.filterColumnMap=new Map,this.lastFilter=new Map,this.isConnected=!0,this.seriesToProcess=new Set,this.setTitle(this.getDefaultTitle()),this.initAllSeries(),this.updateAxisPositions(),this.startListeningFigure()}close(){this.figure.close(),this.addPendingSeries.cancel(),this.stopListeningFigure()}getDefaultTitle(){if(this.figure.title!=null&&this.figure.title.length>0)return this.figure.title;if(this.figure.charts.length===1){var e;return(e=this.figure.charts[0].title)!==null&&e!==void 0?e:""}return""}initAllSeries(){var e=this;this.oneClicks=[],this.filterColumnMap.clear();var{charts:t}=this.figure,r=Yt.getAxisTypeMap(this.figure),i=[];this.seriesToProcess=new Set;for(var a=function(){for(var m=t[o],v=0;v<m.series.length;v+=1){var f=m.series[v];i.push(f.name),e.addSeries(f,r,m.showLegend)}var{axes:g,title:p}=m;if(p!=null&&p.length>0&&(t.length>1||e.figure.title!=null)){var b=g.find(R=>R.type===e.dh.plot.AxisType.X),S=g.find(R=>R.type===e.dh.plot.AxisType.Y);if(b==null||S==null)At.warn("Chart title provided, but unknown how to map to the correct axes for this chart type",m);else{var C,y,E,T,O=((C=(y=r.get(b.type))===null||y===void 0?void 0:y.findIndex(R=>R===b))!==null&&C!==void 0?C:0)+1,N=((E=(T=r.get(S.type))===null||T===void 0?void 0:T.findIndex(R=>R===S))!==null&&E!==void 0?E:0)+1,P={align:"center",x:.5,y:1,yshift:17,text:p,showarrow:!1,xref:"x".concat(O," domain"),yref:"y".concat(N," domain")};e.layout.annotations==null?e.layout.annotations=[P]:e.layout.annotations.push(P)}}},o=0;o<t.length;o+=1)a();for(var s=[...this.seriesDataMap.keys()],l=s.filter(c=>i.indexOf(c)<0),d=0;d<l.length;d+=1){var u=l[d];this.seriesDataMap.delete(u)}}addSeries(e,t,r){var{dh:i}=this,a=this.chartUtils.makeSeriesDataFromSeries(e,t,Yt.getSeriesVisibility(e.name,this.settings),this.theme,r);if(this.seriesDataMap.set(e.name,a),this.seriesToProcess.add(e.name),this.data=[...this.seriesDataMap.values()],e.plotStyle===i.plot.SeriesPlotStyle.STACKED_BAR?this.layout.barmode="stack":e.plotStyle===i.plot.SeriesPlotStyle.PIE&&(this.layout.hiddenlabels=Yt.getHiddenLabels(this.settings)),this.layout.showlegend=this.data.length>1||e.plotStyle===i.plot.SeriesPlotStyle.PIE?r??void 0:!1,e.oneClick!=null){for(var{oneClick:o}=e,{columns:s}=o,l=0;l<s.length;l+=1)this.filterColumnMap.set(s[l].name,s[l]);this.oneClicks.push(o)}this.updateLayoutFormats()}subscribe(e){super.subscribe(e),this.listeners.length===1&&(this.initAllSeries(),this.subscribeFigure())}unsubscribe(e){super.unsubscribe(e),this.listeners.length===0&&this.unsubscribeFigure()}subscribeFigure(){if(!this.isConnected){At.debug("Ignoring subscribe when figure in disconnected state");return}this.figure.subscribe(this.isDownsamplingDisabled?this.dh.plot.DownsampleOptions.DISABLE:this.dh.plot.DownsampleOptions.DEFAULT),this.figure.errors.length>0&&(At.error("Errors in figure",this.figure.errors),this.fireError(this.figure.errors))}unsubscribeFigure(){this.figure.unsubscribe()}startListeningFigure(){var{dh:e}=this;this.figure.addEventListener(e.plot.Figure.EVENT_UPDATED,this.handleFigureUpdated),this.figure.addEventListener(e.plot.Figure.EVENT_SERIES_ADDED,this.handleFigureSeriesAdded),this.figure.addEventListener(e.plot.Figure.EVENT_DISCONNECT,this.handleFigureDisconnected),this.figure.addEventListener(e.plot.Figure.EVENT_RECONNECT,this.handleFigureReconnected),this.figure.addEventListener(e.plot.Figure.EVENT_DOWNSAMPLESTARTED,this.handleDownsampleStart),this.figure.addEventListener(e.plot.Figure.EVENT_DOWNSAMPLEFINISHED,this.handleDownsampleFinish),this.figure.addEventListener(e.plot.Figure.EVENT_DOWNSAMPLEFAILED,this.handleDownsampleFail),this.figure.addEventListener(e.plot.Figure.EVENT_DOWNSAMPLENEEDED,this.handleDownsampleNeeded),this.figure.addEventListener(e.Client.EVENT_REQUEST_FAILED,this.handleRequestFailed)}stopListeningFigure(){var{dh:e}=this;this.figure.removeEventListener(e.plot.Figure.EVENT_UPDATED,this.handleFigureUpdated),this.figure.removeEventListener(e.plot.Figure.EVENT_SERIES_ADDED,this.handleFigureSeriesAdded),this.figure.removeEventListener(e.plot.Figure.EVENT_DISCONNECT,this.handleFigureDisconnected),this.figure.removeEventListener(e.plot.Figure.EVENT_RECONNECT,this.handleFigureReconnected),this.figure.removeEventListener(e.plot.Figure.EVENT_DOWNSAMPLESTARTED,this.handleDownsampleStart),this.figure.removeEventListener(e.plot.Figure.EVENT_DOWNSAMPLEFINISHED,this.handleDownsampleFinish),this.figure.removeEventListener(e.plot.Figure.EVENT_DOWNSAMPLEFAILED,this.handleDownsampleFail),this.figure.removeEventListener(e.plot.Figure.EVENT_DOWNSAMPLENEEDED,this.handleDownsampleNeeded),this.figure.removeEventListener(e.Client.EVENT_REQUEST_FAILED,this.handleRequestFailed)}handleDownsampleStart(e){At.debug("Downsample started",e),this.fireDownsampleStart(e.detail)}handleDownsampleFinish(e){At.debug("Downsample finished",e),this.fireDownsampleFinish(e.detail)}handleDownsampleFail(e){At.error("Downsample failed",e),this.fireDownsampleFail(e.detail)}handleDownsampleNeeded(e){At.info("Downsample needed",e),this.fireDownsampleNeeded(e.detail)}handleFigureUpdated(e){var{detail:t}=e,{series:r}=t;At.debug2("handleFigureUpdated",r);for(var i=0;i<r.length;i+=1){var a=r[i];At.debug2("handleFigureUpdated updating series",a.name);for(var{sources:o}=a,s=0;s<o.length;s+=1){var l=o[s],{columnType:d,type:u}=l,c=this.getValueTranslator(d,this.formatter),m=t.getArray(a,u,c);this.setDataArrayForSeries(a,u,m)}this.seriesToProcess.delete(a.name),this.cleanSeries(a)}this.seriesToProcess.size===0&&this.fireLoadFinished();var{data:v}=this;this.fireUpdate(v)}handleRequestFailed(e){At.error("Request failed",e),this.fireError(["".concat(e.detail)])}resubscribe(){this.listeners.length>0&&(this.unsubscribeFigure(),this.subscribeFigure())}setFormatter(e){super.setFormatter(e),this.updateLayoutFormats(),this.resubscribe()}setDownsamplingDisabled(e){super.setDownsamplingDisabled(e),this.resubscribe()}handleFigureDisconnected(e){At.debug("Figure disconnected",e),this.isConnected=!1,this.listeners.length>0&&this.unsubscribeFigure(),this.fireDisconnect()}handleFigureReconnected(e){At.debug("Figure reconnected",e),this.isConnected=!0,this.initAllSeries(),this.fireReconnect(),this.listeners.length>0&&this.subscribeFigure()}handleFigureSeriesAdded(e){var{detail:t}=e;At.debug("handleFigureSeriesAdded",t),this.pendingSeries.push(t),this.addPendingSeries()}setDimensions(e){super.setDimensions(e),this.updateAxisPositions()}setTitle(e){var t,r;super.setTitle(e);var i=(t=(r=(e??"").match(/<br>/g))===null||r===void 0?void 0:r.length)!==null&&t!==void 0?t:0,a=Yt.DEFAULT_MARGIN.t+i*Yt.SUBTITLE_LINE_HEIGHT;this.layout.margin?this.layout.margin.t=a:this.layout.margin={t:a},typeof this.layout.title=="string"?this.layout.title=e:(this.layout.title=fv({},this.layout.title),this.layout.title.text=e,this.layout.title.pad=fv({},this.layout.title.pad),this.layout.title.pad.t=Yt.DEFAULT_TITLE_PADDING.t+i*Yt.SUBTITLE_LINE_HEIGHT*.5)}getPlotWidth(){var e,t,r,i;return!this.rect||!this.rect.width?0:Math.max(this.rect.width-((e=(t=this.layout.margin)===null||t===void 0?void 0:t.l)!==null&&e!==void 0?e:0)-((r=(i=this.layout.margin)===null||i===void 0?void 0:i.r)!==null&&r!==void 0?r:0),0)}getPlotHeight(){var e,t,r,i;return!this.rect||!this.rect.height?0:Math.max(this.rect.height-((e=(t=this.layout.margin)===null||t===void 0?void 0:t.t)!==null&&e!==void 0?e:0)-((r=(i=this.layout.margin)===null||i===void 0?void 0:i.b)!==null&&r!==void 0?r:0),0)}updateAxisPositions(){var e=this.getPlotWidth(),t=this.getPlotHeight();this.chartUtils.updateFigureAxes(this.layout,this.figure,this.theme,r=>this.getAxisRangeParser(r,this.formatter),e,t)}updateLayoutFormats(){if(this.formatter){var e=this.chartUtils.getAxisFormats(this.figure,this.formatter);e.forEach((t,r)=>{At.debug("Assigning ".concat(r),this.layout[r],t);var i=this.layout[r];i!=null?Object.assign(i,t):At.debug("Ignoring null layout.".concat(r))})}}setDataArrayForSeries(e,t,r){var{name:i,plotStyle:a}=e,o=this.seriesDataMap.get(i),s=this.chartUtils.getPlotlyProperty(a,t);o&&gb(o,s,r)}cleanSeries(e){var{dh:t}=this,{name:r,plotStyle:i}=e,a=this.seriesDataMap.get(r);if(a!=null){if(i===t.plot.SeriesPlotStyle.HISTOGRAM){var{xLow:o,xHigh:s}=a;if(o&&s&&o.length===s.length){for(var l=[],d=0;d<o.length;d+=1)l.push(s[d]-o[d]);a.width=l}}else if(i===t.plot.SeriesPlotStyle.LINE||i===t.plot.SeriesPlotStyle.ERROR_BAR||i===t.plot.SeriesPlotStyle.BAR){var{x:u,xLow:c,xHigh:m,y:v,yLow:f,yHigh:g}=a;c&&m&&c!==u&&(a.error_x=Yt.getPlotlyErrorBars(u,c,m,this.theme)),f&&g&&f!==v&&(a.error_y=Yt.getPlotlyErrorBars(v,f,g,this.theme))}else if(i===t.plot.SeriesPlotStyle.TREEMAP){var{ids:p,labels:b}=a;p!==void 0&&b===void 0&&(a.labels=p)}}}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){At.warn("Trying to set a filter, but no one click!");return}At.debug("setFilter",e);for(var r=function(){var o=t.oneClicks[i],{columns:s}=o,l=new Set([...e.keys(),...t.lastFilter.keys()]);l.forEach(d=>{var u=e.get(d);t.lastFilter.get(d)!==u&&s.find(c=>c.name===d)!=null&&o.setValueForColumn(d,u)})},i=0;i<this.oneClicks.length;i+=1)r();this.lastFilter=new Map(e)}setFigure(e){this.close(),this.figure=e,this.setTitle(this.getDefaultTitle()),this.initAllSeries(),this.updateAxisPositions(),this.startListeningFigure(),this.listeners.length>0&&this.subscribeFigure()}updateSettings(e){this.settings=e}}ht(kd,"ADD_SERIES_DEBOUNCE",50);const gv=kd;function pv(n,e,t,r,i,a,o){try{var s=n[a](o),l=s.value}catch(d){t(d);return}s.done?e(l):Promise.resolve(l).then(r,i)}function ku(n){return function(){var e=this,t=arguments;return new Promise(function(r,i){var a=n.apply(e,t);function o(l){pv(a,r,i,o,s,"next",l)}function s(l){pv(a,r,i,o,s,"throw",l)}o(void 0)})}}class mc{static makeModelFromSettings(e,t,r,i){return ku(function*(){var a=yield mc.makeFigureFromSettings(e,t,r);return new gv(e,a,i,t)})()}static makeFigureFromSettings(e,t,r){return ku(function*(){var i=yield r.copy();return i.applyCustomColumns(r.customColumns),i.applyFilter(r.filter),i.applySort(r.sort),e.plot.Figure.create(new Yt(e).makeFigureSettings(t,i))})()}static makeModel(e,t,r,i){return ku(function*(){return new gv(e,r,i,t)})()}}const Cs=mc,DO="var(--dh-color-chart-colorway)",NO="var(--dh-color-chart-grid)",RO="var(--dh-color-chart-axis-line)",IO="var(--dh-color-chart-axis-line-zero)",bv={"paper-bgcolor":"var(--dh-color-chart-bg)","plot-bgcolor":"var(--dh-color-chart-plot-bg)","title-color":"var(--dh-color-chart-title)","legend-color":"var(--dh-color-chart-legend-fg)",colorway:DO,gridcolor:NO,linecolor:RO,zerolinecolor:IO,"error-band-line-color":"var(--dh-color-chart-error-band-line)","ohlc-increasing":"var(--dh-color-chart-ohlc-increase)","ohlc-decreasing":"var(--dh-color-chart-ohlc-decrease)","coastline-color":"var(--dh-color-chart-geo-coastline)","land-color":"var(--dh-color-chart-geo-land)","ocean-color":"var(--dh-color-chart-geo-ocean)","lake-color":"var(--dh-color-chart-geo-lake)","river-color":"var(--dh-color-chart-geo-river)"};var Cv=ie.module("ChartTheme");function FO(){var n,e=Wh(bv);return e.colorway=Tb((n=e.colorway)!==null&&n!==void 0?n:"").map(t=>{var[r,i]=t;return Pd.normalizeCssColor(e.colorway.substring(r,i+1))}).join(" "),Cv.debug2("Chart theme:",bv),Cv.debug2("Chart theme derived:",e),Object.freeze({paper_bgcolor:e["paper-bgcolor"],plot_bgcolor:e["plot-bgcolor"],title_color:e["title-color"],legend_color:e["legend-color"],colorway:e.colorway,gridcolor:e.gridcolor,linecolor:e.linecolor,zerolinecolor:e.zerolinecolor,error_band_line_color:e["error-band-line-color"],ohlc_increasing:e["ohlc-increasing"],ohlc_decreasing:e["ohlc-decreasing"],coastline_color:e["coastline-color"],land_color:e["land-color"],ocean_color:e["ocean-color"],lake_color:e["lake-color"],river_color:e["river-color"]})}const _O=oC(ec);var lC=w.createContext(null);function X2(n){var{children:e}=n,{activeThemes:t}=dc(),r=w.useMemo(FO,[t]);return h.jsx(lC.Provider,{value:r,children:e})}function Sv(n){return n.setFigure!==void 0}function jd(){return Jh(lC,"No ChartThemeContext value found.")}var dC=Object.freeze({openPopouts:[],settings:{hasHeaders:!0,constrainDragToContainer:!0,reorderEnabled:!0,selectionEnabled:!1,popoutWholeStack:!1,blockedPopoutsThrowError:!0,closePopoutsOnUnload:!0,showPopoutIcon:!0,showMaximiseIcon:!0,showCloseIcon:!0,responsiveMode:"onload",tabOverlapAllowance:0,tabControlOffset:10},dimensions:{borderWidth:5,borderGrabWidth:10,minItemHeight:10,minItemWidth:10,headerHeight:20,dragProxyWidth:300,dragProxyHeight:200},labels:{close:"Close",maximise:"Maximize",minimise:"Minimize",popout:"Open in new window",popin:"Pop in",tabDropdown:"Additional tabs",tabNextLabel:"Next",tabPreviousLabel:"Previous"},content:[]});function uC(n){return n.componentName!==void 0}function MO(n){return n.component!==void 0}var hC=Object.freeze({type:"default",isClosable:!0,isFocusOnShow:!0,reorderEnabled:!0,title:""});const xO=Object.freeze(Object.defineProperty({__proto__:null,defaultConfig:dC,isGLComponentConfig:uC,isReactComponentConfig:MO,itemDefaultConfig:hC},Symbol.toStringTag,{value:"Module"}));function Bl(n,e,t){return e=AO(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function AO(n){var e=LO(n,"string");return typeof e=="symbol"?e:String(e)}function LO(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class Ds{constructor(){Bl(this,"_mSubscriptions",void 0),Bl(this,"off",this.unbind),Bl(this,"trigger",this.emit),this._mSubscriptions={},this._mSubscriptions[Ds.ALL_EVENT]=[]}on(e,t,r){if(typeof t!="function")throw new Error("Tried to listen to event "+e+" with non-function callback "+t);this._mSubscriptions[e]||(this._mSubscriptions[e]=[]),this._mSubscriptions[e].push({fn:t,ctx:r})}emit(e){for(var t=this._mSubscriptions[e],r=arguments.length,i=new Array(r>1?r-1:0),a=1;a<r;a++)i[a-1]=arguments[a];if(t)for(var o=0;o<t.length;o++){var s=t[o].ctx||{};try{t[o].fn.apply(s,i)}catch(c){console.error("Error while emitting event:",c)}}i.unshift(e);for(var l=this._mSubscriptions[Ds.ALL_EVENT],d=0;d<l.length;d++){var u=l[d].ctx||{};try{l[d].fn.apply(u,i)}catch(c){console.error("Error while emitting event to allEventSubs:",c)}}}unbind(e,t,r){if(!this._mSubscriptions[e])throw new Error("No subscriptions to unsubscribe for event "+e);for(var i=!1,a=0;a<this._mSubscriptions[e].length;a++)(!t||this._mSubscriptions[e][a].fn===t)&&(!r||r===this._mSubscriptions[e][a].ctx)&&(this._mSubscriptions[e].splice(a,1),i=!0);if(i===!1)throw new Error("Nothing to unbind for "+e)}}Bl(Ds,"ALL_EVENT","__all");const Dn=Ds;function cn(n,e,t){return e=kO(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function kO(n){var e=jO(n,"string");return typeof e=="symbol"?e:String(e)}function jO(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class gh extends Dn{constructor(e,t,r){super(),cn(this,"width",void 0),cn(this,"height",void 0),cn(this,"title",void 0),cn(this,"parent",void 0),cn(this,"layoutManager",void 0),cn(this,"tab",void 0),cn(this,"_config",void 0),cn(this,"isHidden",!1),cn(this,"beforeCloseHandler",void 0),cn(this,"_element",ge(['<div class="lm_item_container">','<div class="lm_content" tabindex="-1"></div>',"</div>"].join(""))),cn(this,"_contentElement",void 0),this.title=uC(e)?e.componentName:"",this.parent=t,this.layoutManager=r,this._config=e,this._contentElement=this._element.find(".lm_content"),this.beforeCloseHandler=null}getElement(){return this._contentElement}hide(){this.emit("hide"),this.isHidden=!0,this._element.hide()}show(){this.emit("show"),this.isHidden=!1,this._element.show(),(this.height!=0||this.width!=0)&&this.emit("shown")}setSize(e,t){for(var r,i,a,o=this.parent,s=null;o&&!o.isColumn&&!o.isRow;){var l;if(s=o,o=o.parent,(l=o)!==null&&l!==void 0&&l.isRoot)return!1}if(!o||!s)return!1;for(var d=o.isColumn?"height":"width",u=d==="height"?t:e,c=((r=this[d])!==null&&r!==void 0?r:0)*(1/(((i=s.config[d])!==null&&i!==void 0?i:0)/100)),m=u/c*100,v=(((a=s.config[d])!==null&&a!==void 0?a:0)-m)/(o.contentItems.length-1),f=0;f<o.contentItems.length;f++)if(o.contentItems[f]===s)o.contentItems[f].config[d]=m;else{var g;o.contentItems[f].config[d]=((g=o.contentItems[f].config[d])!==null&&g!==void 0?g:0)+v}return o.callDownwards("setSize"),!0}close(e){var t,r;this._config.isClosable&&(!((t=(r=this.beforeCloseHandler)===null||r===void 0?void 0:r.call(this,e))!==null&&t!==void 0)||t)&&(this.emit("close"),this.parent.close())}beforeClose(e){this.beforeCloseHandler=e}getState(){return this._config.componentState}extendState(e){this.setState(ge.extend(!0,this.getState(),e))}setState(e){this._config.componentState=e,this.parent.emitBubblingEvent("stateChanged")}setTitle(e){this.parent.setTitle(e)}_$setSize(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;if(e!==this.width||t!==this.height){this.width=e,this.height=t;var r=this._contentElement[0],i=r.offsetWidth-r.clientWidth,a=r.offsetHeight-r.clientHeight;this._contentElement.width(this.width-i).height(this.height-a),this.emit("resize")}}}const $O=Object.freeze(Object.defineProperty({__proto__:null,Container:gh,ItemContainer:gh},Symbol.toStringTag,{value:"Module"}));function cC(n){var e=location.hash.match(new RegExp(n+"=([^&]*)"));return e?e[1]:null}function mC(n){if(window.location.hash)return cC(n);if(!window.location.search)return null;var e=window.location.search.substr(1).split("&"),t={},r,i;for(i=0;i<e.length;i++)r=e[i].split("="),t[r[0]]=r[1];return t[n]||null}function vc(n){return window.requestAnimationFrame(n)}function HO(n,e){var t=e.indexOf(n);if(t===-1)throw new Error("Can't remove item from array. Item is not in the array");e.splice(t,1)}function fc(){return(Math.random()*1e15).toString(36).replace(".","")}function BO(n,e){var t=n.replace(/javascript/gi,"javascript").replace(/expression/gi,"expression").replace(/onload/gi,"onload").replace(/script/gi,"script").replace(/onerror/gi,"onerror");return e===!0?t:t.replace(/>/g,">").replace(/</g,"<")}function gc(n){return ge.trim(n.replace(/(<([^>]+)>)/gi,""))}function Dr(n,e,t){return e=UO(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function UO(n){var e=VO(n,"string");return typeof e=="symbol"?e:String(e)}function VO(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class GO extends Dn{constructor(e){var t,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;super(),Dr(this,"_eElement",void 0),Dr(this,"_oDocument",void 0),Dr(this,"_eBody",void 0),Dr(this,"_destroyAfterMouseUp",void 0),Dr(this,"_nDelay",400),Dr(this,"_timeout",void 0),Dr(this,"timeout",void 0),Dr(this,"_nDistance",10),Dr(this,"_nX",0),Dr(this,"_nY",0),Dr(this,"_nOriginalX",0),Dr(this,"_nOriginalY",0),Dr(this,"_bDragging",!1),this._eElement=e,this._oDocument=ge(document),this._eBody=ge(document.body),this._destroyAfterMouseUp=r,this.onMouseMove=this.onMouseMove.bind(this),this.onMouseUp=this.onMouseUp.bind(this),this.onMouseDown=this.onMouseDown.bind(this),this._startDrag=this._startDrag.bind(this),(t=this._eElement)===null||t===void 0||t.on("mousedown",this.onMouseDown)}destroy(){var e,t;(e=this._eElement)===null||e===void 0||e.unbind("mousedown",this.onMouseDown),(t=this._oDocument)===null||t===void 0||t.unbind("mouseup",this.onMouseUp),this._eElement=void 0,this._oDocument=void 0,this._eBody=void 0,clearTimeout(this._timeout),this._timeout=void 0}onMouseDown(e){if(e.preventDefault(),e.button===0){var t,r,i,a,o=this._getCoordinates(e);this._nOriginalX=(t=o.x)!==null&&t!==void 0?t:0,this._nOriginalY=(r=o.y)!==null&&r!==void 0?r:0,(i=this._oDocument)===null||i===void 0||i.on("mousemove",this.onMouseMove),(a=this._oDocument)===null||a===void 0||a.on("mouseup",this.onMouseUp),this._timeout=window.setTimeout(this._startDrag,this._nDelay)}}onMouseMove(e){if(this._timeout!=null){var t,r;e.preventDefault();var i=this._getCoordinates(e);this._nX=((t=i.x)!==null&&t!==void 0?t:0)-this._nOriginalX,this._nY=((r=i.y)!==null&&r!==void 0?r:0)-this._nOriginalY,this._bDragging===!1&&(Math.abs(this._nX)>this._nDistance||Math.abs(this._nY)>this._nDistance)&&this._startDrag(),this._bDragging&&this.emit("drag",this._nX,this._nY,e)}}onMouseUp(e){if(this._timeout!=null){var t,r,i,a,o;if(clearTimeout(this._timeout),(t=this._oDocument)===null||t===void 0||t.unbind("mousemove",this.onMouseMove),(r=this._oDocument)===null||r===void 0||r.unbind("mouseup",this.onMouseUp),(i=this._oDocument)===null||i===void 0||(a=i.find("iframe"))===null||a===void 0||a.css("pointer-events",""),this._bDragging===!0&&(this._bDragging=!1,this.emit("dragStop",e,this._nOriginalX+this._nX)),(o=this._eBody)===null||o===void 0||o.removeClass("lm_dragging"),!(this._eElement instanceof Window)){var s;(s=this._eElement)===null||s===void 0||s.removeClass("lm_dragging")}this._destroyAfterMouseUp&&this.destroy()}}_startDrag(){var e,t,r,i;window.clearTimeout(this._timeout),this._bDragging=!0,(e=this._eBody)===null||e===void 0||e.addClass("lm_dragging"),(t=this._eElement)===null||t===void 0||t.addClass("lm_dragging"),(r=this._oDocument)===null||r===void 0||(i=r.find("iframe"))===null||i===void 0||i.css("pointer-events","none"),this.emit("dragStart",this._nOriginalX,this._nOriginalY)}_getCoordinates(e){var t,r;return{x:(t=e.pageX)!==null&&t!==void 0?t:0,y:(r=e.pageY)!==null&&r!==void 0?r:0}}}const $s=GO;function Qa(n,e,t){return e=WO(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function WO(n){var e=zO(n,"string");return typeof e=="symbol"?e:String(e)}function zO(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class vC{constructor(e,t){Qa(this,"_container",void 0),Qa(this,"_reactComponent",null),Qa(this,"_portalComponent",null),Qa(this,"_originalComponentWillUpdate",null),Qa(this,"_initialState",void 0),Qa(this,"_reactClass",void 0),this._reactComponent=null,this._portalComponent=null,this._originalComponentWillUpdate=null,this._container=e,this._initialState=t,this._reactClass=this._getReactClass(),this._container.on("open",this._render,this),this._container.on("destroy",this._destroy,this)}_key(){var e=this._container._config.id;if(!e)throw new Error("Cannot mount panel without id");return Array.isArray(e)?e.join(","):e}_render(){var e=this._key();this._portalComponent=bd.createPortal(this._getReactComponent(),this._container.getElement()[0],e),this._container.layoutManager.addReactChild(e,this._portalComponent)}_gotReactComponent(e){if(e){this._reactComponent=e,this._originalComponentWillUpdate=this._reactComponent.componentWillUpdate||function(){},this._reactComponent.componentWillUpdate=this._onUpdate.bind(this);var t=this._container.getState();t&&this._reactComponent.setState(t)}}_destroy(){this._container.layoutManager.removeReactChild(this._key(),this._portalComponent),this._container.off("open",this._render,this),this._container.off("destroy",this._destroy,this)}_onUpdate(e,t){var r;this._container.setState(t),(r=this._originalComponentWillUpdate)===null||r===void 0||r.call(this._reactComponent,e,t)}_getReactClass(){var e=this._container._config.component;if(!e)throw new Error("No react component name. type: react-component needs a field `component`");var t=this._container.layoutManager.getComponent(e)||this._container.layoutManager.getFallbackComponent();if(!t)throw new Error('React component "'+e+'" not found. Please register all components with GoldenLayout using `registerComponent(name, component)`');return t}_getReactComponent(){var e={glEventHub:this._container.layoutManager.eventHub,glContainer:this._container,ref:this._gotReactComponent.bind(this)},t=ge.extend(e,this._container._config.props);return oe.createElement(this._reactClass,t)}}var Ql=["settings","hasHeaders","constrainDragToContainer","selectionEnabled","dimensions","borderWidth","minItemHeight","minItemWidth","headerHeight","dragProxyWidth","dragProxyHeight","labels","close","maximise","minimise","popout","content","componentName","componentState","id","width","type","height","isClosable","title","popoutWholeStack","openPopouts","parentId","activeItemIndex","reorderEnabled","borderGrabWidth"],KO=[!0,!1,"row","column","stack","component","close","maximise","minimise","open in new window"];function pc(n){if(Ql.length>36)throw new Error("Too many keys in config minifier map");var e={};return bc(n,e,"_min"),e}function ph(n){if(Ql.length>36)throw new Error("Too many keys in config minifier map");var e={};return bc(n,e,"_max"),e}function bc(n,e,t){var r=t==="_min"?qO:YO;for(var i in n)if(n.hasOwnProperty(i)){var a=Array.isArray(n)?n[Number.parseInt(i,10)]:n[i];if(typeof a=="object"&&a!=null){var o=a instanceof Array?[]:{};if(Array.isArray(e))e[Number.parseInt(i,10)]=o;else{var s=r(i,Ql);e[s]=o}bc(a,o,t)}else{var l=r(a,KO);if(Array.isArray(e))e[Number.parseInt(i,10)]=l;else{var d=r(i,Ql);e[d]=l}}}}function qO(n,e){if(typeof n=="string"&&n.length===1)return"___"+n;var t=e.indexOf(n);return t===-1?n:t.toString(36)}function YO(n,e){return typeof n=="string"&&n.length===1?e[parseInt(n,36)]:typeof n=="string"&&n.substr(0,3)==="___"?n[3]:n}function ju(n,e,t){return e=XO(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function XO(n){var e=QO(n,"string");return typeof e=="symbol"?e:String(e)}function QO(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class bh{constructor(e,t){ju(this,"name",void 0),ju(this,"origin",void 0),ju(this,"isPropagationStopped",void 0),this.name=e,this.origin=t,this.isPropagationStopped=!1}stopPropagation(){this.isPropagationStopped=!0}}function ul(n,e,t){return e=ZO(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function ZO(n){var e=JO(n,"string");return typeof e=="symbol"?e:String(e)}function JO(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}let eD=class extends Dn{constructor(e){super(),ul(this,"_layoutManager",void 0),ul(this,"_dontPropagateToParent",void 0),ul(this,"_childEventSource",void 0),ul(this,"_boundOnEventFromChild",void 0),this._layoutManager=e,this._dontPropagateToParent=null,this._childEventSource=null,this.on(Dn.ALL_EVENT,this._onEventFromThis.bind(this)),this._boundOnEventFromChild=this._onEventFromChild.bind(this),ge(window).on("gl_child_event",this._boundOnEventFromChild)}_onEventFromThis(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];this._layoutManager.isSubWindow&&t[0]!==this._dontPropagateToParent&&this._propagateToParent(t),this._propagateToChildren(t),this._dontPropagateToParent=null,this._childEventSource=null}_$onEventFromParent(e){this._dontPropagateToParent=e[0],this.emit.apply(this,e)}_onEventFromChild(e){this._childEventSource=e.originalEvent.__gl,this.emit.apply(this,e.originalEvent.__glArgs)}_propagateToParent(e){var t,r="gl_child_event",i=(t=window.opener)===null||t===void 0?void 0:t.document.createEvent("HTMLEvents");i.initEvent(r,!0,!0),i.eventName=r,i.__glArgs=e,i.__gl=this._layoutManager,window.opener.dispatchEvent(i)}_propagateToChildren(e){for(var t=0;t<this._layoutManager.openPopouts.length;t++){var r=this._layoutManager.openPopouts[t].getGlInstance();r&&r!==this._childEventSource&&r.eventHub._$onEventFromParent(e)}}destroy(){ge(window).off("gl_child_event",this._boundOnEventFromChild)}};const fC=eD,tD=Object.freeze(Object.defineProperty({__proto__:null,BubblingEvent:bh,DragListener:$s,EventEmitter:Dn,EventHub:fC,ReactComponentHandler:vC,animFrame:vc,filterXss:BO,getHashValue:cC,getQueryStringParam:mC,getUniqueId:fc,minifyConfig:pc,removeFromArray:HO,stripTags:gc,unminifyConfig:ph},Symbol.toStringTag,{value:"Module"}));function Ni(n,e,t){return e=rD(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function rD(n){var e=nD(n,"string");return typeof e=="symbol"?e:String(e)}function nD(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class gC extends Dn{constructor(e,t,r,i,a){super(),Ni(this,"isInitialised",!1),Ni(this,"_config",void 0),Ni(this,"_dimensions",void 0),Ni(this,"_parentId",void 0),Ni(this,"_indexInParent",void 0),Ni(this,"_layoutManager",void 0),Ni(this,"_popoutWindow",null),Ni(this,"_id",null),this._config=e,this._dimensions=t,this._parentId=r,this._indexInParent=i,this._layoutManager=a,this._createWindow()}toConfig(){var e,t,r,i,a,o,s,l,d,u,c;if(this.isInitialised===!1)throw new Error("Can't create config, layout not yet initialised");return{dimensions:{width:(e=this.getGlInstance())===null||e===void 0?void 0:e.width,height:(t=this.getGlInstance())===null||t===void 0?void 0:t.height,left:(r=(i=(a=this._popoutWindow)===null||a===void 0?void 0:a.screenX)!==null&&i!==void 0?i:(o=this._popoutWindow)===null||o===void 0?void 0:o.screenLeft)!==null&&r!==void 0?r:0,top:(s=(l=(d=this._popoutWindow)===null||d===void 0?void 0:d.screenY)!==null&&l!==void 0?l:(u=this._popoutWindow)===null||u===void 0?void 0:u.screenTop)!==null&&s!==void 0?s:0},content:(c=this.getGlInstance())===null||c===void 0?void 0:c.toConfig().content,parentId:this._parentId,indexInParent:this._indexInParent}}getGlInstance(){var e;return(e=this._popoutWindow)===null||e===void 0?void 0:e.__glInstance}getWindow(){return this._popoutWindow}close(){if(this.getGlInstance()){var e;(e=this.getGlInstance())===null||e===void 0||e._$closeWindow()}else try{var t;(t=this.getWindow())===null||t===void 0||t.close()}catch{}}popIn(){var e;this._indexInParent;var t=null,r=null;if(this._parentId){var i;if(t=ge.extend(!0,{},(i=this.getGlInstance())===null||i===void 0?void 0:i.toConfig()).content[0],r=this._layoutManager.root.getItemsById(this._parentId)[0],!r){var a;((a=this._layoutManager.root.contentItems.length)!==null&&a!==void 0?a:0)>0?r=this._layoutManager.root.contentItems[0]:r=this._layoutManager.root}}t&&((e=r)===null||e===void 0||e.addChild(t,this._indexInParent),this.close())}_createWindow(){var e=this._createUrl(),t=Math.floor(Math.random()*1e6).toString(36),r=this._serializeWindowOptions({width:this._dimensions.width,height:this._dimensions.height,innerWidth:this._dimensions.width,innerHeight:this._dimensions.height,menubar:"no",toolbar:"no",location:"no",personalbar:"no",resizable:"yes",scrollbars:"no",status:"no"});if(this._popoutWindow=window.open(e,t,r),!this._popoutWindow)if(this._layoutManager.config.settings.blockedPopoutsThrowError===!0){var i=new Error("Popout blocked");throw i.type="popoutBlocked",i}else return;ge(this._popoutWindow).on("load",this._positionWindow.bind(this)).on("unload beforeunload",this._onClose.bind(this));var a=window.setInterval(()=>{var o;(o=this._popoutWindow)!==null&&o!==void 0&&o.__glInstance&&this._popoutWindow.__glInstance.isInitialised&&(this._onInitialised(),window.clearInterval(a))},10)}_serializeWindowOptions(e){var t=[],r;for(r in e)t.push(r+"="+e[r]);return t.join(",")}_createUrl(){var e={content:this._config},t="gl-window-config-"+fc();e=pc(e);try{localStorage.setItem(t,JSON.stringify(e))}catch(i){throw new Error("Error while writing to localStorage "+i.toString())}var r=document.location.href.split("?");return r.length===1?r[0]+"?gl-window="+t:document.location.href+"&gl-window="+t}_positionWindow(){var e,t;(e=this._popoutWindow)===null||e===void 0||e.moveTo(this._dimensions.left,this._dimensions.top),(t=this._popoutWindow)===null||t===void 0||t.focus()}_onInitialised(){var e;this.isInitialised=!0,(e=this.getGlInstance())===null||e===void 0||e.on("popIn",this.popIn,this),this.emit("initialised")}_onClose(){setTimeout(this.emit.bind(this,"closed"),50)}}function jt(n,e,t){return e=iD(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function iD(n){var e=aD(n,"string");return typeof e=="symbol"?e:String(e)}function aD(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class $a extends Dn{constructor(e,t,r,i,a,o){var s,l,d,u,c,m,v,f;if(super(),jt(this,"_dragListener",void 0),jt(this,"_layoutManager",void 0),jt(this,"_contentItem",void 0),jt(this,"_originalParent",void 0),jt(this,"_area",null),jt(this,"_lastValidArea",null),jt(this,"_minX",void 0),jt(this,"_maxX",void 0),jt(this,"_minY",void 0),jt(this,"_maxY",void 0),jt(this,"_width",void 0),jt(this,"_height",void 0),jt(this,"_sided",void 0),jt(this,"element",void 0),jt(this,"childElementContainer",void 0),jt(this,"_proxyTab",void 0),this._dragListener=r,this._layoutManager=i,this._contentItem=a,this._originalParent=o,this._dragListener.on("drag",this._onDrag,this),this._dragListener.on("dragStop",this._onDrop,this),this._contentItem.tab&&this._contentItem.tab.element){var g,p;this._layoutManager.tabDropPlaceholder.width((g=this._contentItem.tab.element.outerWidth(!0))!==null&&g!==void 0?g:0),this._layoutManager.tabDropPlaceholder.height((p=this._contentItem.tab.element.outerHeight(!0))!==null&&p!==void 0?p:0)}if(this.element=ge($a._template),o&&o._side&&(this._sided=o._sided,this.element.addClass("lm_"+o._side),["right","bottom"].indexOf(o._side.toString())>=0&&this.element.find(".lm_content").after(this.element.find(".lm_header"))),this.element.css({left:e,top:t}),this._proxyTab=this.element.find(".lm_tab"),this._proxyTab.attr("title",gc((s=this._contentItem.config.title)!==null&&s!==void 0?s:"")),this.element.find(".lm_title").html((l=this._contentItem.config.title)!==null&&l!==void 0?l:""),this.childElementContainer=this.element.find(".lm_content"),this.childElementContainer.append(a.element),this._updateTree(),this._layoutManager._$calculateItemAreas(),ge(document.body).append(this.element),this._setDimensions(),!this._contentItem.tab&&this._proxyTab.length){var b,S;this._layoutManager.tabDropPlaceholder.width((b=this._proxyTab.outerWidth(!0))!==null&&b!==void 0?b:0),this._layoutManager.tabDropPlaceholder.height((S=this._proxyTab.outerHeight(!0))!==null&&S!==void 0?S:0)}var C=this._layoutManager.container.offset();this._minX=(d=C==null?void 0:C.left)!==null&&d!==void 0?d:0,this._minY=(u=C==null?void 0:C.top)!==null&&u!==void 0?u:0,this._maxX=((c=this._layoutManager.container.width())!==null&&c!==void 0?c:0)+this._minX,this._maxY=((m=this._layoutManager.container.height())!==null&&m!==void 0?m:0)+this._minY,this._width=(v=this.element.width())!==null&&v!==void 0?v:0,this._height=(f=this.element.height())!==null&&f!==void 0?f:0,this._setDropPosition(e,t),this._layoutManager.emit("itemPickedUp",this._contentItem)}_onDrag(e,t,r){var i,a,o=(i=r.pageX)!==null&&i!==void 0?i:0,s=(a=r.pageY)!==null&&a!==void 0?a:0,l=o>this._minX&&o<this._maxX&&s>this._minY&&s<this._maxY;!l&&this._layoutManager.config.settings.constrainDragToContainer===!0||this._setDropPosition(o,s)}_setDropPosition(e,t){this.element.css({left:e,top:t}),this._area=this._layoutManager._$getArea(e,t),this._area!==null&&(this._lastValidArea=this._area,this._area.contentItem._$highlightDropZone(e,t,this._area))}_onDrop(){var e;(e=this._layoutManager.dropTargetIndicator)===null||e===void 0||e.hide(),this._area!==null?this._area.contentItem._$onDrop(this._contentItem,this._area):this._lastValidArea!==null?this._lastValidArea.contentItem._$onDrop(this._contentItem,this._lastValidArea):this._originalParent?this._originalParent.addChild(this._contentItem):this._contentItem._$destroy(),this._dragListener.off("drag",this._onDrag,this),this._dragListener.off("dragStop",this._onDrop,this),this.element.remove(),this._layoutManager.emit("itemDropped",this._contentItem)}_updateTree(){this._contentItem.parent&&this._contentItem.parent.removeChild(this._contentItem,!0),this._contentItem._$setParent(null)}_setDimensions(){var e=this._layoutManager.config.dimensions,t=e.dragProxyWidth,r=e.dragProxyHeight;this.element.width(t),this.element.height(r),t-=this._sided?e.headerHeight:0,r-=this._sided?0:e.headerHeight,this.childElementContainer.width(t),this.childElementContainer.height(r),this._contentItem.element.width(t),this._contentItem.element.height(r),this._contentItem.callDownwards("_$show"),this._contentItem.callDownwards("setSize")}}jt($a,"_template",'<div class="lm_dragProxy"><div class="lm_header"><ul class="lm_tabs"><li class="lm_tab lm_active"><i class="lm_left"></i><span class="lm_title"></span><i class="lm_right"></i></li></ul></div><div class="lm_content"></div></div>');function hl(n,e,t){return e=oD(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function oD(n){var e=sD(n,"string");return typeof e=="symbol"?e:String(e)}function sD(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class pC{constructor(e,t,r){hl(this,"_element",void 0),hl(this,"_itemConfig",void 0),hl(this,"_layoutManager",void 0),hl(this,"_dragListener",void 0),this._element=e,this._itemConfig=t,this._layoutManager=r,this._dragListener=this._createDragListener()}_createDragListener(){return this._dragListener=new $s(this._element,!0),this._dragListener.on("dragStart",this._onDragStart,this),this._dragListener.on("dragStop",this._createDragListener,this),this._dragListener}_onDragStart(e,t){var r=this._itemConfig;typeof r=="function"&&(r=r());var i=this._layoutManager._$normalizeContentItem(ge.extend(!0,{},r));new $a(e,t,this._dragListener,this._layoutManager,i,null)}}function cl(n,e,t){return e=lD(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function lD(n){var e=dD(n,"string");return typeof e=="symbol"?e:String(e)}function dD(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class bC{constructor(e,t,r){cl(this,"_element",ge(window)),cl(this,"_itemConfig",void 0),cl(this,"_layoutManager",void 0),cl(this,"_dragListener",void 0),this._itemConfig=e,this._layoutManager=t,this._createDragListener(r)}_createDragListener(e){this._dragListener&&this._dragListener.destroy(),this._element&&(this._dragListener=new $s(this._element,!0),this._dragListener.on("dragStart",this._onDragStart,this),this._dragListener.on("dragStop",this._destroy,this),this._dragListener.onMouseDown(e),this._dragListener._startDrag())}_destroy(){this._dragListener=void 0,this._element=void 0,this._itemConfig=void 0,this._layoutManager=void 0}_onDragStart(e,t){if(!(!this._dragListener||!this._layoutManager)){var r=this._itemConfig;typeof r=="function"&&(r=r());var i=this._layoutManager._$normalizeContentItem(ge.extend(!0,{},r));new $a(e,t,this._dragListener,this._layoutManager,i,null)}}}function CC(n,e,t){return e=uD(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function uD(n){var e=hD(n,"string");return typeof e=="symbol"?e:String(e)}function hD(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class Hs{constructor(){CC(this,"element",ge(Hs._template)),ge(document.body).append(this.element)}destroy(){this.element.remove()}highlightArea(e){this.element.css({left:e.x1,top:e.y1,width:Math.floor(e.x2-e.x1),height:Math.floor(e.y2-e.y1)}).show()}hide(){this.element.hide()}}CC(Hs,"_template",'<div class="lm_dropTargetIndicator"><div class="lm_inner"></div></div>');function $u(n,e,t){return e=cD(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function cD(n){var e=mD(n,"string");return typeof e=="symbol"?e:String(e)}function mD(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class ls{constructor(e,t,r,i){$u(this,"element",void 0),$u(this,"_header",void 0),$u(this,"_action",void 0),this._header=e,this.element=ge('<li class="'+r+'" title="'+t+'"></li>'),this._header.on("destroy",this._$destroy,this),this._action=i,this.element.on("click",this._action),this._header.controlsContainer.append(this.element)}_$destroy(){this.element.off(),this.element.remove()}}function vD(n,e,t){return e=fD(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function fD(n){var e=gD(n,"string");return typeof e=="symbol"?e:String(e)}function gD(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class pD extends Error{constructor(e,t){super(),vD(this,"node",void 0),this.name="Configuration Error",this.message=e,this.node=t}}const Da=pD,bD=Object.freeze(Object.defineProperty({__proto__:null,ConfigurationError:Da},Symbol.toStringTag,{value:"Module"}));function Mt(n,e,t){return e=CD(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function CD(n){var e=SD(n,"string");return typeof e=="symbol"?e:String(e)}function SD(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function Ns(n){return n.isStack}function xr(n){return n.isComponent}function SC(n){return n.isRoot}class Vt extends Dn{constructor(e,t,r,i){super(),Mt(this,"config",void 0),Mt(this,"type",void 0),Mt(this,"contentItems",void 0),Mt(this,"parent",void 0),Mt(this,"layoutManager",void 0),Mt(this,"element",void 0),Mt(this,"childElementContainer",void 0),Mt(this,"componentName",void 0),Mt(this,"isInitialised",!1),Mt(this,"isMaximised",!1),Mt(this,"isRoot",!1),Mt(this,"isRow",!1),Mt(this,"isColumn",!1),Mt(this,"isStack",!1),Mt(this,"isComponent",!1),Mt(this,"tab",void 0),Mt(this,"_pendingEventPropagations",void 0),Mt(this,"_throttledEvents",void 0),this.element=i,this.config=this._extendItemNode(t),this.type=t.type,this.contentItems=[],this.parent=r,this.layoutManager=e,this._pendingEventPropagations={},this._throttledEvents=["stateChanged"],this.on(Dn.ALL_EVENT,this._propagateEvent,this),t.content&&this._createContentItems(t)}callDownwards(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;r!==!0&&i!==!0&&this[e].apply(this,t);for(var a=0;a<this.contentItems.length;a++)this.contentItems[a].callDownwards(e,t,r);r===!0&&i!==!0&&this[e].apply(this,t)}removeChild(e){var t,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,i=this.contentItems.indexOf(e);if(i===-1)throw new Error("Can't remove child item. Unknown content item");if(r!==!0&&this.contentItems[i]._$destroy(),this.contentItems.splice(i,1),(t=this.config.content)===null||t===void 0||t.splice(i,1),this.contentItems.length>0)this.callDownwards("setSize");else if(this.type!=="root"&&this.config.isClosable){var a;(a=this.parent)===null||a===void 0||a.removeChild(this)}}addChild(e,t){e=this.layoutManager._$normalizeContentItem(e,this),t===void 0&&(t=this.contentItems.length),this.contentItems.splice(t,0,e),this.config.content===void 0&&(this.config.content=[]),this.config.content.splice(t,0,e.config),e.parent=this,e.parent.isInitialised===!0&&e.isInitialised===!1&&e._$init()}replaceChild(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;t=this.layoutManager._$normalizeContentItem(t);var i=this.contentItems.indexOf(e),a=e.element[0].parentNode;if(i===-1)throw new Error("Can't replace child. oldChild is not child of this");a==null||a.replaceChild(t.element[0],e.element[0]),r===!0&&(e.parent=null,e._$destroy()),this.contentItems[i]=t,t.parent=this,Ns(this)&&(this.header.tabs[i].contentItem=t),t.parent.isInitialised===!0&&t.isInitialised===!1&&t._$init(),this.callDownwards("setSize")}remove(){var e;(e=this.parent)===null||e===void 0||e.removeChild(this)}popout(){var e=this.layoutManager.createPopout(this);return this.emitBubblingEvent("stateChanged"),e}toggleMaximise(e){e&&e.preventDefault(),this.isMaximised===!0?this.layoutManager._$minimiseItem(this):this.layoutManager._$maximiseItem(this),this.isMaximised=!this.isMaximised,this.emitBubblingEvent("stateChanged")}select(){this.layoutManager.selectedItem!==this&&(this.layoutManager.selectItem(this,!0),this.element.addClass("lm_selected"))}deselect(){this.layoutManager.selectedItem===this&&(this.layoutManager.selectedItem=null,this.element.removeClass("lm_selected"))}setTitle(e){this.config.title=e,this.emit("titleChanged",e),this.emitBubblingEvent("stateChanged")}hasId(e){if(this.config.id){if(typeof this.config.id=="string")return this.config.id===e;if(this.config.id instanceof Array)return this.config.id.indexOf(e)!==-1}else return!1}addId(e){this.hasId(e)||(this.config.id?typeof this.config.id=="string"?this.config.id=[this.config.id,e]:this.config.id instanceof Array&&this.config.id.push(e):this.config.id=e)}removeId(e){if(!this.hasId(e))throw new Error("Id not found");if(typeof this.config.id=="string")delete this.config.id;else if(this.config.id instanceof Array){var t=this.config.id.indexOf(e);this.config.id.splice(t,1)}}getItemsByFilter(e){var t=[],r=function i(a){for(var o=0;o<a.contentItems.length;o++)e(a.contentItems[o])===!0&&t.push(a.contentItems[o]),i(a.contentItems[o])};return r(this),t}getItemsById(e){return this.getItemsByFilter(function(t){return t.config.id instanceof Array?t.config.id.indexOf(e)!==-1:t.config.id===e})}getItemsByType(e){return this._$getItemsByProperty("type",e)}getComponentsByName(e){for(var t=this._$getItemsByProperty("componentName",e),r=[],i=0;i<t.length;i++)r.push(t[i].instance);return r}_$getItemsByProperty(e,t){return this.getItemsByFilter(function(r){return r[e]===t})}_$setParent(e){this.parent=e}_$highlightDropZone(e,t,r){var i;(i=this.layoutManager.dropTargetIndicator)===null||i===void 0||i.highlightArea(r)}_$onDrop(e,t){this.addChild(e)}_$hide(){this._callOnActiveComponents("hide"),this.element.hide(),this.layoutManager.updateSize()}_$show(){this._callOnActiveComponents("show"),this.element.show(),this.layoutManager.updateSize()}_callOnActiveComponents(e){for(var t=this.getItemsByType("stack"),r=null,i=0;i<t.length;i++)r=t[i].getActiveContentItem(),r&&xr(r)&&r.container[e]()}_$destroy(){this.emitBubblingEvent("beforeItemDestroyed"),this.callDownwards("_$destroy",[],!0,!0),this.element.remove(),this.emitBubblingEvent("itemDestroyed")}_$getArea(e){var t,r,i;e=e||this.element;var a=(t=e.offset())!==null&&t!==void 0?t:{left:0,top:0},o=(r=e.width())!==null&&r!==void 0?r:0,s=(i=e.height())!==null&&i!==void 0?i:0;return{x1:a.left,y1:a.top,x2:a.left+o,y2:a.top+s,surface:o*s,contentItem:this,side:""}}_$init(){this.setSize();for(var e=0;e<this.contentItems.length;e++){var t;(t=this.childElementContainer)===null||t===void 0||t.append(this.contentItems[e].element)}this.isInitialised=!0,this.emitBubblingEvent("itemCreated"),this.emitBubblingEvent(this.type+"Created")}emitBubblingEvent(e){var t=new bh(e,this);this.emit(e,t)}_createContentItems(e){var t;if(!(e.content instanceof Array))throw new Da("content must be an Array",e);for(var r=0;r<e.content.length;r++)t=this.layoutManager.createContentItem(e.content[r],this),this.contentItems.push(t)}_extendItemNode(e){for(var[t,r]of Object.entries(hC)){var i=t;e[i]===void 0&&(e[i]=r)}return e}_propagateEvent(e,t){t instanceof bh&&t.isPropagationStopped===!1&&this.isInitialised===!0&&(this.isRoot===!1&&this.parent?this.parent.emit.apply(this.parent,[e,t]):this._scheduleEventPropagationToLayoutManager(e,t))}_scheduleEventPropagationToLayoutManager(e,t){this._throttledEvents.indexOf(e)===-1?this.layoutManager.emit(e,t.origin):this._pendingEventPropagations[e]!==!0&&(this._pendingEventPropagations[e]=!0,vc(this._propagateEventToLayoutManager.bind(this,e,t)))}_propagateEventToLayoutManager(e,t){this._pendingEventPropagations[e]=!1,this.layoutManager.emit(e,t)}}function zo(n,e,t){return e=wD(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function wD(n){var e=yD(n,"string");return typeof e=="symbol"?e:String(e)}function yD(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class wC extends Vt{constructor(e,t,r){super(e,t,r,ge()),zo(this,"config",void 0),zo(this,"componentName",void 0),zo(this,"container",void 0),zo(this,"parent",void 0),zo(this,"instance",void 0),this.config=t,this.parent=r;var i=e.getComponent(this.config.componentName)||e.getFallbackComponent(),a=ge.extend(!0,{},this.config.componentState||{});if(i==null)throw new Da('Unknown component "'+this.config.componentName+'"');a.componentName=this.config.componentName,this.componentName=this.config.componentName,this.config.title===""&&(this.config.title=this.config.componentName),this.isComponent=!0,this.container=new gh(this.config,this,e),this.instance=new i(this.container,a),this.element=this.container._element}close(){this.parent.removeChild(this)}setSize(){this.element.is(":visible")&&this.container._$setSize(this.element.width(),this.element.height())}_$init(){Vt.prototype._$init.call(this),this.container.emit("open")}_$hide(){this.container.hide(),Vt.prototype._$hide.call(this)}_$show(){this.container.show(),this.container._config.isFocusOnShow&&this.container._contentElement[0].focus({preventScroll:!0}),Vt.prototype._$show.call(this)}_$destroy(){this.container.emit("destroy",this),Vt.prototype._$destroy.call(this)}_$getArea(){return null}}function qr(n,e,t){return e=ED(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function ED(n){var e=TD(n,"string");return typeof e=="symbol"?e:String(e)}function TD(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class Zl extends Vt{constructor(e,t,r,i){super(t,r,i,ge('<div class="lm_item lm_'+(e?"column":"row")+'"></div>')),qr(this,"isRow",void 0),qr(this,"isColumn",void 0),qr(this,"childElementContainer",void 0),qr(this,"parent",void 0),qr(this,"_splitter",[]),qr(this,"_splitterSize",void 0),qr(this,"_splitterGrabSize",void 0),qr(this,"_isColumn",void 0),qr(this,"_dimension",void 0),qr(this,"_splitterPosition",null),qr(this,"_splitterMinPosition",null),qr(this,"_splitterMaxPosition",null),this.parent=i,this.isRow=!e,this.isColumn=e,this.childElementContainer=this.element,this._splitterSize=t.config.dimensions.borderWidth,this._splitterGrabSize=t.config.dimensions.borderGrabWidth,this._isColumn=e,this._dimension=e?"height":"width",this._splitterPosition=null,this._splitterMinPosition=null,this._splitterMaxPosition=null}addChild(e,t,r){var i,a,o,s;if(e=this.layoutManager._$normalizeContentItem(e,this),t===void 0&&(t=this.contentItems.length),this.contentItems.length>0?(s=this._createSplitter(Math.max(0,t-1)).element,t>0?(this.contentItems[t-1].element.after(s),s.after(e.element)):(this.contentItems[0].element.before(s),s.before(e.element))):this.childElementContainer.append(e.element),Vt.prototype.addChild.call(this,e,t),i=1/this.contentItems.length*100,r===!0){this.emitBubblingEvent("stateChanged");return}for(o=0;o<this.contentItems.length;o++)if(this.contentItems[o]===e)e.config[this._dimension]=i;else{var l;a=((l=this.contentItems[o].config[this._dimension])!==null&&l!==void 0?l:0)*(100-i)/100,this.contentItems[o].config[this._dimension]=a}this.callDownwards("setSize"),this.emitBubblingEvent("stateChanged")}removeChild(e,t){var r,i=(r=e.config[this._dimension])!==null&&r!==void 0?r:0,a=this.contentItems.indexOf(e),o=Math.max(a-1,0),s,l;if(a===-1)throw new Error("Can't remove child. ContentItem is not child of this Row or Column");for(this._splitter[o]&&(this._splitter[o]._$destroy(),this._splitter.splice(o,1)),s=0;s<this.contentItems.length;s++)if(this.contentItems[s]!==e){var d;this.contentItems[s].config[this._dimension]=((d=this.contentItems[s].config[this._dimension])!==null&&d!==void 0?d:0)+i/(this.contentItems.length-1)}Vt.prototype.removeChild.call(this,e,t),this.contentItems.length===1&&this.config.isClosable===!0?(l=this.contentItems[0],this.contentItems=[],this.parent.replaceChild(this,l,!0)):(this.callDownwards("setSize"),this.emitBubblingEvent("stateChanged"))}replaceChild(e,t){var r=e.config[this._dimension];super.replaceChild(e,t),t.config[this._dimension]=r,this.callDownwards("setSize"),this.emitBubblingEvent("stateChanged")}setSize(){this.contentItems.length>0&&(this._calculateRelativeSizes(),this._setAbsoluteSizes()),this.emitBubblingEvent("stateChanged"),this.emit("resize")}_$init(){if(this.isInitialised!==!0){var e;for(Vt.prototype._$init.call(this),e=0;e<this.contentItems.length-1;e++)this.contentItems[e].element.after(this._createSplitter(e).element)}}_setAbsoluteSizes(){var e,t=this._calculateAbsoluteSizes();for(e=0;e<this.contentItems.length;e++)t.additionalPixel-e>0&&t.itemSizes[e]++,this._isColumn?(this.contentItems[e].element.width(t.totalWidth),this.contentItems[e].element.height(t.itemSizes[e])):(this.contentItems[e].element.width(t.itemSizes[e]),this.contentItems[e].element.height(t.totalHeight))}_calculateAbsoluteSizes(){var e,t,r=(this.contentItems.length-1)*this._splitterSize,i=(e=this.element.width())!==null&&e!==void 0?e:0,a=(t=this.element.height())!==null&&t!==void 0?t:0,o=0,s=[];this._isColumn?a-=r:i-=r;for(var l=0;l<this.contentItems.length;l++){var d,u,c=this._isColumn?Math.floor(a*(((d=this.contentItems[l].config.height)!==null&&d!==void 0?d:0)/100)):Math.floor(i*(((u=this.contentItems[l].config.width)!==null&&u!==void 0?u:0)/100));o+=c,s.push(c)}var m=Math.floor((this._isColumn?a:i)-o);return{itemSizes:s,additionalPixel:m,totalWidth:i,totalHeight:a}}_calculateRelativeSizes(){for(var e=0,t=[],r=this._isColumn?"height":"width",i=0;i<this.contentItems.length;i++){var a=this.contentItems[i].config[r];a!=null?e+=a:t.push(this.contentItems[i])}if(Math.round(e)===100){this._respectMinItemWidth();return}if(Math.round(e)<100&&t.length>0){for(var o=0;o<t.length;o++)t[o].config[r]=(100-e)/t.length;this._respectMinItemWidth();return}if(Math.round(e)>100)for(var s=0;s<t.length;s++)t[s].config[r]=50,e+=50;for(var l=0;l<this.contentItems.length;l++){var d;this.contentItems[l].config[r]=((d=this.contentItems[l].config[r])!==null&&d!==void 0?d:0)/e*100}this._respectMinItemWidth()}_respectMinItemWidth(){var e,t=this.layoutManager.config.dimensions&&(e=this.layoutManager.config.dimensions.minItemWidth)!==null&&e!==void 0?e:0,r=[],i=0,a=0,o=0,s=[],l;if(!(this._isColumn||!t||this.contentItems.length<=1)){for(var d=this._calculateAbsoluteSizes(),u=0;u<this.contentItems.length;u++){this.contentItems[u];var c=d.itemSizes[u];c<t?(a+=t-c,l={width:t}):(i+=c-t,l={width:c},r.push(l)),s.push(l)}if(!(a===0||a>i)){var m=a/i;o=a;for(var v=0;v<r.length;v++){l=r[v];var f=Math.round((l.width-t)*m);o-=f,l.width-=f}o!==0&&(s[s.length-1].width-=o);for(var g=0;g<this.contentItems.length;g++)this.contentItems[g].config.width=s[g].width/d.totalWidth*100}}}_createSplitter(e){var t;return t=new yC(this._isColumn,this._splitterSize,this._splitterGrabSize),t.on("drag",this._onSplitterDrag.bind(this,t),this),t.on("dragStop",this._onSplitterDragStop.bind(this,t),this),t.on("dragStart",this._onSplitterDragStart.bind(this,t),this),this._splitter.splice(e,0,t),t}_getItemsForSplitter(e){var t=this._splitter.indexOf(e);if(t<0)throw new Error("Splitter not found in RowOrColumn");return{before:this.contentItems[t],after:this.contentItems[t+1]}}_getMinimumDimensions(e){for(var t=0,r=0,i=0;i<e.length;++i){var a,o;t=Math.max((a=e[i].minWidth)!==null&&a!==void 0?a:0,t),r=Math.max((o=e[i].minHeight)!==null&&o!==void 0?o:0,r)}return{horizontal:t,vertical:r}}_onSplitterDragStart(e){var t,r,i,a,o=this._getItemsForSplitter(e),s=this.layoutManager.config.dimensions[this._isColumn?"minItemHeight":"minItemWidth"],l=this._getMinimumDimensions((t=o.before.config.content)!==null&&t!==void 0?t:[]),d=this._isColumn?l.vertical:l.horizontal,u=this._getMinimumDimensions((r=o.after.config.content)!==null&&r!==void 0?r:[]),c=this._isColumn?u.vertical:u.horizontal;this._splitterPosition=0,this._splitterMinPosition=-1*(((i=o.before.element[this._dimension]())!==null&&i!==void 0?i:0)-(d||s)),this._splitterMaxPosition=((a=o.after.element[this._dimension]())!==null&&a!==void 0?a:0)-(c||s)}_onSplitterDrag(e,t,r){var i=this._isColumn?r:t;this._splitterMaxPosition==null||this._splitterMinPosition==null||i>this._splitterMinPosition&&i<this._splitterMaxPosition&&(this._splitterPosition=i,e.element.css(this._isColumn?"top":"left",i))}_onSplitterDragStop(e){var t,r,i,a,o,s=this._getItemsForSplitter(e),l=(t=s.before.element[this._dimension]())!==null&&t!==void 0?t:0,d=(r=s.after.element[this._dimension]())!==null&&r!==void 0?r:0,u=(((i=this._splitterPosition)!==null&&i!==void 0?i:0)+l)/(l+d),c=((a=s.before.config[this._dimension])!==null&&a!==void 0?a:0)+((o=s.after.config[this._dimension])!==null&&o!==void 0?o:0);s.before.config[this._dimension]=u*c,s.after.config[this._dimension]=(1-u)*c,e.element.css({top:0,left:0}),vc(this.callDownwards.bind(this,"setSize",void 0,void 0,void 0))}}function wv(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function yv(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?wv(Object(t),!0).forEach(function(r){Ch(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):wv(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function Ch(n,e,t){return e=PD(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function PD(n){var e=OD(n,"string");return typeof e=="symbol"?e:String(e)}function OD(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class Sh extends Vt{constructor(e,t,r){super(e,yv(yv({},t),{},{type:"root"}),null,ge('<div class="lm_goldenlayout lm_item lm_root"></div>')),Ch(this,"childElementContainer",void 0),Ch(this,"_containerElement",void 0),this.isRoot=!0,this.type="root",this.childElementContainer=this.element,this._containerElement=r,this._containerElement.append(this.element)}addChild(e,t){if(this.contentItems.length>0)throw new Error("Root node can only have a single child");e=this.layoutManager._$normalizeContentItem(e,this),this.childElementContainer.append(e.element),super.addChild(e,t),this.callDownwards("setSize"),this.emitBubblingEvent("stateChanged")}setSize(e,t){var r,i;e=typeof e>"u"?(r=this._containerElement.width())!==null&&r!==void 0?r:0:e,t=typeof t>"u"?(i=this._containerElement.height())!==null&&i!==void 0?i:0:t,this.element.width(e),this.element.height(t),this.contentItems[0]&&(this.contentItems[0].element.width(e),this.contentItems[0].element.height(t))}_$getArea(){var e=super._$getArea();if(e==null)throw new Error("Unable to get root area");return e}_$highlightDropZone(e,t,r){this.layoutManager.tabDropPlaceholder.remove(),super._$highlightDropZone(e,t,r)}_$onDrop(e,t){var r;if(xr(e)&&(r=this.layoutManager.createContentItem({type:"stack",header:e.config.header||{}},this),r._$init(),r.addChild(e),e=r),!this.contentItems.length)this.addChild(e);else{var{side:i}=t,a=i==="left"||i==="right"?"row":"column",o=i==="left"||i==="right"?"width":"height",s=i==="left"||i==="top",l=this.contentItems[0];if(!(l instanceof Zl)||l.type!=a){var d=this.layoutManager.createContentItem({type:a},this);this.replaceChild(l,d),d.addChild(e,s?0:void 0,!0),d.addChild(l,s?void 0:0,!0),l.config[o]=50,e.config[o]=50,d.callDownwards("setSize")}else{var u,c=l.contentItems[s?0:l.contentItems.length-1];l.addChild(e,s?0:void 0,!0),c.config[o]=((u=c.config[o])!==null&&u!==void 0?u:0)*.5,e.config[o]=c.config[o],l.callDownwards("setSize")}}}}function Ev(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function Za(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Ev(Object(t),!0).forEach(function(r){gr(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Ev(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function gr(n,e,t){return e=DD(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function DD(n){var e=ND(n,"string");return typeof e=="symbol"?e:String(e)}function ND(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class wh extends Vt{constructor(e,t,r){var i,a,o,s,l,d,u,c,m;super(e,t,r,ge('<div class="lm_item lm_stack"></div>')),gr(this,"_activeContentItem",null),gr(this,"_header",void 0),gr(this,"childElementContainer",ge('<div class="lm_items"></div>')),gr(this,"header",void 0),gr(this,"parent",void 0),gr(this,"isStack",!0),gr(this,"_dropZones",{}),gr(this,"_dropSegment",null),gr(this,"_contentAreaDimensions",null),gr(this,"_dropIndex",void 0),gr(this,"_side",void 0),gr(this,"_sided",!1),gr(this,"config",void 0),this.parent=r,this.config=t;var v=e.config;this._side=!1,this._header={show:((i=v.settings)===null||i===void 0?void 0:i.hasHeaders)&&t.hasHeaders!==!1,popout:(a=v.settings)!==null&&a!==void 0&&a.showPopoutIcon?(o=v.labels)===null||o===void 0?void 0:o.popout:void 0,maximise:(s=v.settings)!==null&&s!==void 0&&s.showMaximiseIcon?(l=v.labels)===null||l===void 0?void 0:l.maximise:void 0,close:(d=v.settings)!==null&&d!==void 0&&d.showCloseIcon?(u=v.labels)===null||u===void 0?void 0:u.close:void 0,minimise:(c=(m=v.labels)===null||m===void 0?void 0:m.minimise)!==null&&c!==void 0?c:void 0},v.header&&(this._header=Za(Za({},this._header),v.header)),t.header&&(this._header=Za(Za({},this._header),t.header)),t.content&&t.content[0]&&t.content[0].header&&(this._header=Za(Za({},this._header),t.content[0].header)),this.header=new pi(e,this),this.element.append(this.header.element),this.element.append(this.childElementContainer),this._setupHeaderPosition(),this._$validateClosability()}setSize(){var e,t,r,i,a,o=this._header.show&&(e=(t=this.layoutManager.config.dimensions)===null||t===void 0?void 0:t.headerHeight)!==null&&e!==void 0?e:0,s=((r=this.element.width())!==null&&r!==void 0?r:0)-(this._sided?o:0),l=((i=this.element.height())!==null&&i!==void 0?i:0)-(this._sided?0:o);for(this.childElementContainer.width(s),this.childElementContainer.height(l),a=0;a<this.contentItems.length;a++)this.contentItems[a].element.width(s).height(l);this.emit("resize"),this.emitBubblingEvent("stateChanged")}_$init(){if(this.isInitialised!==!0){this.header._attachWheelListener(),super._$init();for(var e=0;e<this.contentItems.length;e++)this.header.createTab(this.contentItems[e]),this.contentItems[e]._$hide();if(this.contentItems.length>0){var t=this.contentItems[this.config.activeItemIndex||0];if(!t)throw new Error("Configured activeItemIndex out of bounds");this.setActiveContentItem(t)}}}setActiveContentItem(e){if(this.contentItems.indexOf(e)===-1)throw new Error("contentItem is not a child of this stack");this._activeContentItem!==null&&this._activeContentItem._$hide(),this._activeContentItem=e,this.header.setActiveContentItem(e),e._$show(),this.emit("activeContentItemChanged",e),this.layoutManager.emit("activeContentItemChanged",e),this.emitBubblingEvent("stateChanged")}getActiveContentItem(){return this.header.activeContentItem}addChild(e,t){e=this.layoutManager._$normalizeContentItem(e,this),super.addChild(e,t),this.childElementContainer.append(e.element),this.header.createTab(e,t),this.setActiveContentItem(e),this.callDownwards("setSize"),this._$validateClosability(),this.emitBubblingEvent("stateChanged")}removeChild(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,r=this.contentItems.indexOf(e);super.removeChild(e,t),this.header.removeTab(e),this.header.activeContentItem===e&&(this.contentItems.length>0?this.setActiveContentItem(this.contentItems[Math.max(r-1,0)]):this._activeContentItem=null),this._$validateClosability(),this.emitBubblingEvent("stateChanged")}_$validateClosability(){for(var e=this.header._isClosable(),t=0,r=this.contentItems.length;t<r;t++){var i;if(!e)break;e=(i=this.contentItems[t].config.isClosable)!==null&&i!==void 0?i:!1}this.header._$setClosable(e)}_$destroy(){Vt.prototype._$destroy.call(this),this.header._$destroy()}_$onDrop(e){if(this._dropSegment==="header"){this._resetHeaderDropZone(),this.addChild(e,this._dropIndex);return}if(this._dropSegment==="body"){this.addChild(e);return}var t=this._dropSegment==="top"||this._dropSegment==="bottom",r=this._dropSegment==="left"||this._dropSegment==="right",i=this._dropSegment==="top"||this._dropSegment==="left",a=t&&this.parent.isColumn||r&&this.parent.isRow,o=t?"column":"row",s=t?"height":"width";if(xr(e)){var l=this.layoutManager.createContentItem({type:"stack",header:e.config.header||{}},this);l._$init(),l.addChild(e),e=l}if(a){var d,u=this.parent.contentItems.indexOf(this);this.parent.addChild(e,i?u:u+1,!0),this.config[s]=((d=this.config[s])!==null&&d!==void 0?d:0)*.5,e.config[s]=this.config[s],this.parent.callDownwards("setSize")}else{var c=this.layoutManager.createContentItem({type:o},this);this.parent.replaceChild(this,c),c.addChild(e,i?0:void 0,!0),c.addChild(this,i?void 0:0,!0),this.config[s]=50,e.config[s]=50,c.callDownwards("setSize")}}_$highlightDropZone(e,t){if(this._contentAreaDimensions)for(var[r,i]of Object.entries(this._contentAreaDimensions)){var a=i.hoverArea;if(a.x1<e&&a.x2>e&&a.y1<t&&a.y2>t){r==="header"?(this._dropSegment="header",this._highlightHeaderDropZone(e)):(this._resetHeaderDropZone(),this._highlightBodyDropZone(r));return}}}_$getArea(){if(this.element.is(":visible")===!1)return null;var e=super._$getArea(this.header.element),t=super._$getArea(this.childElementContainer);if(e==null||t==null)return null;var r=t.x2-t.x1,i=t.y2-t.y1;return this._contentAreaDimensions={header:{hoverArea:{x1:e.x1,y1:e.y1,x2:e.x2,y2:e.y2},highlightArea:{x1:e.x1,y1:e.y1,x2:e.x2,y2:e.y2}}},this._activeContentItem&&this._activeContentItem.isComponent===!1?e:this.contentItems.length===0?(this._contentAreaDimensions.body={hoverArea:{x1:t.x1,y1:t.y1,x2:t.x2,y2:t.y2},highlightArea:{x1:t.x1,y1:t.y1,x2:t.x2,y2:t.y2}},super._$getArea(this.element)):(this._contentAreaDimensions.left={hoverArea:{x1:t.x1,y1:t.y1,x2:t.x1+r*.25,y2:t.y2},highlightArea:{x1:t.x1,y1:t.y1,x2:t.x1+r*.5,y2:t.y2}},this._contentAreaDimensions.top={hoverArea:{x1:t.x1+r*.25,y1:t.y1,x2:t.x1+r*.75,y2:t.y1+i*.5},highlightArea:{x1:t.x1,y1:t.y1,x2:t.x2,y2:t.y1+i*.5}},this._contentAreaDimensions.right={hoverArea:{x1:t.x1+r*.75,y1:t.y1,x2:t.x2,y2:t.y2},highlightArea:{x1:t.x1+r*.5,y1:t.y1,x2:t.x2,y2:t.y2}},this._contentAreaDimensions.bottom={hoverArea:{x1:t.x1+r*.25,y1:t.y1+i*.5,x2:t.x1+r*.75,y2:t.y2},highlightArea:{x1:t.x1,y1:t.y1+i*.5,x2:t.x2,y2:t.y2}},super._$getArea(this.element))}_highlightHeaderDropZone(e){var t,r,i,a,o,s,l,d,u,c,m,v,f,g,p,b,S=this.header.tabs.length;if(S===0){var C,y,E,T,O,N,P,R,A=this.header.element.offset();(C=this.layoutManager.dropTargetIndicator)===null||C===void 0||C.highlightArea({x1:(y=A==null?void 0:A.left)!==null&&y!==void 0?y:0,x2:((E=A==null?void 0:A.left)!==null&&E!==void 0?E:0)+100,y1:(T=(O=this.header.element.offset())===null||O===void 0?void 0:O.top)!==null&&T!==void 0?T:0,y2:((N=(P=this.header.element.offset())===null||P===void 0?void 0:P.top)!==null&&N!==void 0?N:0)+((R=this.header.element.innerHeight())!==null&&R!==void 0?R:0)});return}var M=this.header.tabsContainer,I=(t=M.get(0))===null||t===void 0?void 0:t.getBoundingClientRect(),x=(r=this.layoutManager.tabDropPlaceholder.get(0))===null||r===void 0?void 0:r.getBoundingClientRect();if(!(!I||!x)){e<I.left?e=I.left+1:e>I.right&&(e=I.right-1);var _,k;if(!(x.left<e&&e<x.right)){for(var U=0;U<S;U++){var G;if(_=this.header.tabs[U].element,k=(G=_.get(0))===null||G===void 0?void 0:G.getBoundingClientRect(),k&&k.left<e&&e<k.right){this._dropIndex=U;break}}if(_&&k&&e<k.left+k.width*.5)_.before(this.layoutManager.tabDropPlaceholder);else if(_){var Y;this._dropIndex=Math.min(((Y=this._dropIndex)!==null&&Y!==void 0?Y:0)+1,S),_.after(this.layoutManager.tabDropPlaceholder)}}var Z=(i=(a=this.layoutManager.tabDropPlaceholder.offset())===null||a===void 0?void 0:a.left)!==null&&i!==void 0?i:0;Z=Math.max(Z,(o=(s=this.header.tabsContainer.offset())===null||s===void 0?void 0:s.left)!==null&&o!==void 0?o:0);var $=Z+((l=this.layoutManager.tabDropPlaceholder.width())!==null&&l!==void 0?l:0);$=Math.min($,((d=(u=this.header.tabsContainer.offset())===null||u===void 0?void 0:u.left)!==null&&d!==void 0?d:0)+((c=this.header.tabsContainer.innerWidth())!==null&&c!==void 0?c:0)),(m=this.layoutManager.dropTargetIndicator)===null||m===void 0||m.highlightArea({x1:Z,x2:$,y1:(v=(f=this.header.element.offset())===null||f===void 0?void 0:f.top)!==null&&v!==void 0?v:0,y2:((g=(p=this.header.element.offset())===null||p===void 0?void 0:p.top)!==null&&g!==void 0?g:0)+((b=this.header.element.innerHeight())!==null&&b!==void 0?b:0)})}}_resetHeaderDropZone(){this.layoutManager.tabDropPlaceholder.remove()}_setupHeaderPosition(){var e=["right","left","bottom"].some(r=>r===this._header.show)?this._header.show:void 0;if(this.header.element.toggle(!!this._header.show),!!e&&(this._side=e,this._sided=["right","left"].indexOf(this._side.toString())>=0,this.element.removeClass("lm_left lm_right lm_bottom"),this._side&&this.element.addClass("lm_"+this._side),this.element.find(".lm_header").length&&this.childElementContainer)){var t=["right","bottom"].indexOf(this._side.toString())>=0?"before":"after";this.header.element[t](this.childElementContainer),this.callDownwards("setSize")}}_highlightBodyDropZone(e){var t,r,i=(t=this._contentAreaDimensions)===null||t===void 0||(r=t[e])===null||r===void 0?void 0:r.highlightArea;if(i){var a;(a=this.layoutManager.dropTargetIndicator)===null||a===void 0||a.highlightArea(i)}this._dropSegment=e}}const RD=Object.freeze(Object.defineProperty({__proto__:null,AbstractContentItem:Vt,Component:wC,ContentItem:Vt,Root:Sh,RowOrColumn:Zl,Stack:wh,isComponent:xr,isRoot:SC,isStack:Ns},Symbol.toStringTag,{value:"Module"}));function ui(n,e,t){return e=ID(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function ID(n){var e=FD(n,"string");return typeof e=="symbol"?e:String(e)}function FD(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class Bs{constructor(e,t){var r;ui(this,"header",void 0),ui(this,"contentItem",void 0),ui(this,"element",ge(Bs._template)),ui(this,"titleElement",void 0),ui(this,"closeElement",void 0),ui(this,"isActive",!1),ui(this,"_layoutManager",void 0),ui(this,"_dragListener",void 0),this.header=e,this.contentItem=t,this.titleElement=this.element.find(".lm_title"),this.closeElement=this.element.find(".lm_close_tab"),this.closeElement[t.config.isClosable?"show":"hide"](),this.setTitle(t.config.title),this.contentItem.on("titleChanged",this.setTitle,this),this._layoutManager=this.contentItem.layoutManager,(r=this._layoutManager.config.settings)!==null&&r!==void 0&&r.reorderEnabled&&t.config.reorderEnabled&&(this._dragListener=new $s(this.element),this._dragListener.on("dragStart",this._onDragStart,this),this.contentItem.on("destroy",this._dragListener.destroy,this._dragListener)),this._onTabClick=this._onTabClick.bind(this),this._onCloseClick=this._onCloseClick.bind(this),this._onTabContentFocusIn=this._onTabContentFocusIn.bind(this),this._onTabContentFocusOut=this._onTabContentFocusOut.bind(this),this.element.on("click",this._onTabClick),this.element.on("auxclick",this._onTabClick),this.contentItem.config.isClosable?(this.closeElement.on("click",this._onCloseClick),this.closeElement.on("mousedown",this._onCloseMousedown)):this.closeElement.remove(),this.contentItem.tab=this,this.contentItem.emit("tab",this),this.contentItem.layoutManager.emit("tabCreated",this),xr(this.contentItem)&&(this.contentItem.container._contentElement.on("focusin",this._onTabContentFocusIn).on("focusout",this._onTabContentFocusOut),this.contentItem.container.tab=this,this.contentItem.container.emit("tab",this))}setTitle(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"";this.titleElement.html(e)}setActive(e){e!==this.isActive&&(this.isActive=e,e?this.element.addClass("lm_active"):this.element.removeClass("lm_active"))}_$destroy(){this.element.off("click",this._onTabClick),this.element.off("auxclick",this._onTabClick),this.closeElement.off("click",this._onCloseClick),xr(this.contentItem)&&(this.contentItem.container._contentElement.off(),this.contentItem.container._contentElement[0].removeEventListener("click",this._onTabContentFocusIn,!0)),this._dragListener&&(this.contentItem.off("destroy",this._dragListener.destroy,this._dragListener),this._dragListener.off("dragStart",this._onDragStart),this._dragListener=void 0),this.element.remove()}_onDragStart(e,t){var r;(r=this.contentItem.parent)!==null&&r!==void 0&&r.isMaximised&&this.contentItem.parent.toggleMaximise(),this._dragListener&&new $a(e,t,this._dragListener,this._layoutManager,this.contentItem,this.header.parent)}_onTabContentFocusIn(){ge(".lm_focusin",this._layoutManager.root.element).removeClass("lm_focusin"),this.element.addClass("lm_focusin")}_onTabContentFocusOut(){xr(this.contentItem)&&!this.contentItem.container._contentElement[0].contains(document.activeElement)&&this.element.removeClass("lm_focusin")}_onTabClick(e){if(!e||e.button===0){var t,r=this.header.parent.getActiveContentItem();this.contentItem!==r&&xr(this.contentItem)?this.header.parent.setActiveContentItem(this.contentItem):xr(this.contentItem)&&!this.contentItem.container._contentElement[0].contains(document.activeElement)&&this.contentItem.container._contentElement.focus(),xr(this.contentItem)&&this.contentItem.container.emit("tabClicked",e),this.header._hideAdditionalTabsDropdown(),(t=this.element.get(0))===null||t===void 0||t.scrollIntoView({inline:"nearest"})}else e.button===1&&this.contentItem.config.isClosable&&this._onCloseClick(e)}_onCloseClick(e){e.stopPropagation(),xr(this.contentItem)?this.contentItem.container.close():this.header.parent.removeChild(this.contentItem)}_onCloseMousedown(e){e.stopPropagation()}}ui(Bs,"_template",['<li class="lm_tab">','<span class="lm_title_before"></span>','<span class="lm_title"></span>','<div class="lm_close_tab" aria-label="Close tab"></div>',"</li>"].join(""));function Ue(n,e,t){return e=_D(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function _D(n){var e=MD(n,"string");return typeof e=="symbol"?e:String(e)}function MD(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class pi extends Dn{constructor(e,t){var r,i;super(),Ue(this,"layoutManager",void 0),Ue(this,"element",ge(pi._template)),Ue(this,"tabsContainer",void 0),Ue(this,"tabDropdownContainer",void 0),Ue(this,"tabDropdownSearch",void 0),Ue(this,"tabDropdownList",null),Ue(this,"controlsContainer",void 0),Ue(this,"parent",void 0),Ue(this,"tabs",[]),Ue(this,"activeContentItem",null),Ue(this,"closeButton",null),Ue(this,"tabDropdownButton",null),Ue(this,"tabNextButton",ge(pi._nextButtonTemplate)),Ue(this,"tabPreviousButton",ge(pi._previousButtonTemplate)),Ue(this,"holdTimer",null),Ue(this,"rAF",null),Ue(this,"CLICK_TIMEOUT",500),Ue(this,"START_SPEED",.01),Ue(this,"ACCELERATION",5e-4),Ue(this,"PADDING",10),Ue(this,"SCROLL_LEFT","left"),Ue(this,"SCROLL_RIGHT","right"),Ue(this,"isDraggingTab",!1),Ue(this,"isOverflowing",!1),Ue(this,"isDropdownShown",!1),Ue(this,"dropdownKeyIndex",0),Ue(this,"_lastVisibleTabIndex",-1),Ue(this,"_tabControlOffset",void 0),this.layoutManager=e,(r=this.layoutManager.config.settings)!==null&&r!==void 0&&r.selectionEnabled&&(this.element.addClass("lm_selectable"),this.element.on("click",this._onHeaderClick.bind(this))),this.tabsContainer=this.element.find(".lm_tabs"),this.tabDropdownContainer=this.element.find(".lm_tabdropdown_list"),this.tabDropdownContainer.hide(),this.tabDropdownSearch=this.element.find(".lm_tabdropdown_search input"),this._handleFilterInput=this._handleFilterInput.bind(this),this._handleFilterKeydown=this._handleFilterKeydown.bind(this),this.tabDropdownSearch.on("input",this._handleFilterInput),this.tabDropdownSearch.on("keydown",this._handleFilterKeydown),this.controlsContainer=this.element.find(".lm_controls"),this.parent=t,this.parent.on("resize",this._updateTabSizes,this),this._handleItemPickedUp=this._handleItemPickedUp.bind(this),this._handleItemDropped=this._handleItemDropped.bind(this),this._handleNextMouseEnter=this._handleNextMouseEnter.bind(this),this._handleNextMouseLeave=this._handleNextMouseLeave.bind(this),this._handlePreviousMouseEnter=this._handlePreviousMouseEnter.bind(this),this._handlePreviousMouseLeave=this._handlePreviousMouseLeave.bind(this),this._handleScrollRepeat=this._handleScrollRepeat.bind(this),this._handleNextButtonMouseDown=this._handleNextButtonMouseDown.bind(this),this._handlePreviousButtonMouseDown=this._handlePreviousButtonMouseDown.bind(this),this._handleScrollButtonMouseDown=this._handleScrollButtonMouseDown.bind(this),this._handleScrollButtonMouseUp=this._handleScrollButtonMouseUp.bind(this),this._handleScrollEvent=this._handleScrollEvent.bind(this),this.tabNextButton.on("mousedown",this._handleNextButtonMouseDown),this.tabPreviousButton.on("mousedown",this._handlePreviousButtonMouseDown),this.tabsContainer.on("scroll",this._handleScrollEvent),this.layoutManager.on("itemPickedUp",this._handleItemPickedUp),this.layoutManager.on("itemDropped",this._handleItemDropped),this.tabsContainer.before(this.tabPreviousButton),this.tabPreviousButton=this.tabPreviousButton.find(">:first-child"),this.tabPreviousButton.hide(),this._showAdditionalTabsDropdown=this._showAdditionalTabsDropdown.bind(this),this._hideAdditionalTabsDropdown=this._hideAdditionalTabsDropdown.bind(this),this._tabControlOffset=(i=this.layoutManager.config.settings)===null||i===void 0?void 0:i.tabControlOffset,this._createControls()}createTab(e,t){for(var r=0;r<this.tabs.length;r++)if(this.tabs[r].contentItem===e)return;var i=new Bs(this,e);if(this.tabs.length===0){this.tabs.push(i),this.tabsContainer.append(i.element);return}t===void 0&&(t=this.tabs.length),t>0?this.tabs[t-1].element.after(i.element):this.tabs[0].element.before(i.element),this.tabs.splice(t,0,i),this._updateTabSizes()}removeTab(e){for(var t=0;t<this.tabs.length;t++)if(this.tabs[t].contentItem===e){this.tabs[t]._$destroy(),this.tabs.splice(t,1);return}throw new Error("contentItem is not controlled by this header")}setActiveContentItem(e){for(var t,r,i,a,o=0;o<this.tabs.length;o++)a=this.tabs[o].contentItem===e,this.tabs[o].setActive(a),a===!0&&(this.activeContentItem=e,this.parent.config.activeItemIndex=o);(t=this.tabs[(i=this.parent.config.activeItemIndex)!==null&&i!==void 0?i:0].element.get(0))===null||t===void 0||(r=t.scrollIntoView)===null||r===void 0||r.call(t,{inline:"nearest"}),this._hideAdditionalTabsDropdown(),this._updateTabSizes(),this.parent.emitBubblingEvent("stateChanged")}position(e){var t=this.parent._header.show;return t&&!this.parent._side&&(t="top"),e!==void 0&&this.parent._header.show!==e&&(this.parent._header.show=e,this.parent._setupHeaderPosition()),t}_attachWheelListener(){var e;(e=this.tabsContainer.get(0))===null||e===void 0||e.addEventListener("wheel",this._handleWheelEvent,{passive:!0})}_detachWheelListener(){var e;(e=this.tabsContainer.get(0))===null||e===void 0||e.removeEventListener("wheel",this._handleWheelEvent)}_handleWheelEvent(e){var t=e.currentTarget;if(t instanceof HTMLElement){var r=Math.abs(e.deltaY)>Math.abs(e.deltaX)?e.deltaY:e.deltaX;if(e.deltaMode===WheelEvent.DOM_DELTA_PAGE){var i;r*=(i=this.tabsContainer.innerWidth())!==null&&i!==void 0?i:1}else e.deltaMode===WheelEvent.DOM_DELTA_LINE&&(r*=100/3);t.scrollLeft+=Math.round(r)}}_handleScrollEvent(){this._checkScrollArrows()}_handleItemPickedUp(){this.isDraggingTab=!0,this.isDropdownShown&&this._hideAdditionalTabsDropdown(),this.controlsContainer.on("mouseenter",this._handleNextMouseEnter),this.tabPreviousButton.on("mouseenter",this._handlePreviousMouseEnter)}_handleItemDropped(){var e;this.isDraggingTab=!1,window.cancelAnimationFrame((e=this.rAF)!==null&&e!==void 0?e:-1),this.rAF=null,this.controlsContainer.off("mouseenter",this._handleNextMouseEnter),this.controlsContainer.off("mouseleave",this._handleNextMouseLeave),this.tabPreviousButton.off("mouseenter",this._handlePreviousMouseEnter),this.tabPreviousButton.off("mouseleave",this._handlePreviousMouseLeave)}_handleNextMouseEnter(){var e;this.controlsContainer.on("mouseleave",this._handleNextMouseLeave),this._handleScrollRepeat(this.SCROLL_RIGHT,(e=this.tabsContainer.scrollLeft())!==null&&e!==void 0?e:0)}_handlePreviousMouseEnter(){var e;this.tabPreviousButton.on("mouseleave",this._handlePreviousMouseLeave),this._handleScrollRepeat(this.SCROLL_LEFT,(e=this.tabsContainer.scrollLeft())!==null&&e!==void 0?e:0)}_handleNextMouseLeave(){var e;window.cancelAnimationFrame((e=this.rAF)!==null&&e!==void 0?e:-1),this.rAF=null,this.controlsContainer.off("mouseleave",this._handleNextMouseLeave)}_handlePreviousMouseLeave(){var e;window.cancelAnimationFrame((e=this.rAF)!==null&&e!==void 0?e:-1),this.rAF=null,this.tabPreviousButton.off("mouseleave",this._handlePreviousMouseLeave)}_handleNextButtonMouseDown(){for(var e,t=0;t<this.tabs.length;t+=1){var r,i,a,o,s;if(((r=(i=this.tabs[t].element.get(0))===null||i===void 0?void 0:i.offsetLeft)!==null&&r!==void 0?r:0)>((a=(o=this.tabsContainer.get(0))===null||o===void 0?void 0:o.offsetWidth)!==null&&a!==void 0?a:0)+((s=this.tabsContainer.scrollLeft())!==null&&s!==void 0?s:0)){e=this.tabs[t].element.get(0);break}}if(e)e.scrollIntoView({behavior:"smooth",inline:"nearest"}),this._handleScrollButtonMouseDown(this.SCROLL_RIGHT);else{var l=this.tabsContainer.get(0);if(l){var d,u;l.scrollLeft=(d=(u=this.tabsContainer.get(0))===null||u===void 0?void 0:u.scrollWidth)!==null&&d!==void 0?d:0}}}_handlePreviousButtonMouseDown(){for(var e,t=this.tabs.length-1;t>=0;t-=1){var r,i,a;if(((r=(i=this.tabs[t].element.get(0))===null||i===void 0?void 0:i.offsetLeft)!==null&&r!==void 0?r:0)<((a=this.tabsContainer.scrollLeft())!==null&&a!==void 0?a:0)){e=this.tabs[t].element.get(0);break}}if(e)e.scrollIntoView({behavior:"smooth",inline:"start"}),this._handleScrollButtonMouseDown(this.SCROLL_LEFT);else{var o=this.tabsContainer.get(0);o&&(o.scrollLeft=0)}}_handleScrollButtonMouseDown(e){this.holdTimer=window.setTimeout(()=>{var t;this._handleScrollRepeat(e,(t=this.tabsContainer.scrollLeft())!==null&&t!==void 0?t:0,100)},this.CLICK_TIMEOUT),window.addEventListener("mouseup",this._handleScrollButtonMouseUp)}_handleScrollButtonMouseUp(){var e,t;clearTimeout((e=this.holdTimer)!==null&&e!==void 0?e:-1),this.holdTimer=null,cancelAnimationFrame((t=this.rAF)!==null&&t!==void 0?t:-1),this.rAF=null,window.removeEventListener("mouseup",this._handleScrollButtonMouseUp)}_checkScrollArrows(){var e,t,r;this.tabsContainer.scrollLeft()===0?this.tabPreviousButton.first().prop("disabled",!0):((e=this.tabsContainer.scrollLeft())!==null&&e!==void 0?e:0)+((t=this.tabsContainer.innerWidth())!==null&&t!==void 0?t:0)===((r=this.tabsContainer.get(0))===null||r===void 0?void 0:r.scrollWidth)?this.tabNextButton.prop("disabled",!0):(this.tabNextButton.prop("disabled",!1),this.tabPreviousButton.first().prop("disabled",!1))}_handleScrollRepeat(e,t){var r,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,a=arguments.length>3?arguments[3]:void 0,o=this.tabsContainer.get(0);if(o){var s=o.getBoundingClientRect();if(e===this.SCROLL_LEFT){if(this.tabsContainer.scrollLeft(t-i),this.isDraggingTab&&this.parent._highlightHeaderDropZone(s.left-1),this.tabsContainer.scrollLeft()===0){this._checkScrollArrows();return}}else if(e===this.SCROLL_RIGHT){var l,d;if(this.tabsContainer.scrollLeft(t+i),this.isDraggingTab&&this.parent._highlightHeaderDropZone(s.right+1),((l=this.tabsContainer.scrollLeft())!==null&&l!==void 0?l:0)+((d=this.tabsContainer.innerWidth())!==null&&d!==void 0?d:0)===o.scrollWidth){this._checkScrollArrows();return}}window.cancelAnimationFrame((r=this.rAF)!==null&&r!==void 0?r:-1),this.rAF=window.requestAnimationFrame(u=>{var c,m,v=a||u,f=u-v,g=this.START_SPEED*f+.5*this.ACCELERATION*(f*f);g=Math.min(g,(c=(m=this.tabsContainer.get(0))===null||m===void 0?void 0:m.scrollWidth)!==null&&c!==void 0?c:1/0),this._handleScrollRepeat(e,t,g,v)})}}_$setClosable(e){return this.closeButton&&this._isClosable()?(this.closeButton.element[e?"show":"hide"](),!0):!1}_$destroy(){this.emit("destroy",this);for(var e=0;e<this.tabs.length;e++)this.tabs[e]._$destroy();this._detachWheelListener(),this._handleItemDropped(),ge(document).off("mouseup",this._hideAdditionalTabsDropdown),this.tabDropdownSearch.off("input",this._handleFilterInput),this.tabDropdownSearch.off("keydown",this._handleFilterKeydown),this.element.remove()}_getHeaderSetting(e){if(e in this.parent._header)return this.parent._header[e]}_createControls(){var e,t,r,i,a;if(a=this.layoutManager.config.labels.tabDropdown,this.layoutManager.config.labels.tabNextLabel,this.layoutManager.config.labels.tabPreviousLabel,this.tabDropdownButton=new ls(this,a,"lm_tabdropdown",this._showAdditionalTabsDropdown),this.tabDropdownButton.element.hide(),this.controlsContainer.prepend(this.tabNextButton),this.tabNextButton.hide(),this._getHeaderSetting("popout")&&(t=this._onPopoutClick.bind(this),r=this._getHeaderSetting("popout"),new ls(this,r,"lm_popout",t)),this._getHeaderSetting("maximise")){i=this.parent.toggleMaximise.bind(this.parent);var o=this._getHeaderSetting("maximise"),s=this._getHeaderSetting("minimise"),l=new ls(this,o,"lm_maximise",i);this.parent.on("maximised",function(){l.element.attr("title",s??"")}),this.parent.on("minimised",function(){l.element.attr("title",o??"")})}this._isClosable()&&(e=this.parent.remove.bind(this.parent),r=this._getHeaderSetting("close"),this.closeButton=new ls(this,r,"lm_close",e))}_showAdditionalTabsDropdown(){if(this.isDropdownShown){this._hideAdditionalTabsDropdown();return}this.tabDropdownList=this.tabsContainer.clone(!0).appendTo(this.tabDropdownContainer).children().removeClass("lm_active"),ge(document.body).append(this.tabDropdownContainer),this.tabDropdownContainer.show(),this.isDropdownShown=!0,this.element.addClass("lm_dropdown_open"),this.tabDropdownSearch.val("").focus(),this.dropdownKeyIndex=0,this.tabDropdownList.eq(this.dropdownKeyIndex).addClass("lm_keyboard_active"),ge(document).on("mousedown",this._hideAdditionalTabsDropdown),this._updateAdditionalTabsDropdown()}_handleFilterKeydown(e){if(e.key==="Escape"){this._hideAdditionalTabsDropdown();return}if(this.dropdownKeyIndex===-1)return;if(e.key==="Enter"||e.key===" "){this._hideAdditionalTabsDropdown(),this.tabs[this.dropdownKeyIndex]._onTabClick();return}function t(s,l,d){if(d==null||d.length<2)return-1;for(var u=(s+l+d.length)%d.length;u!==s;){if(d.eq(u).css("display")!=="none")return u;u=(u+l+d.length)%d.length}return s}if(e.key==="ArrowDown"||e.key==="Tab"&&e.shiftKey===!1){var r,i;e.preventDefault(),(r=this.tabDropdownList)===null||r===void 0||r.eq(this.dropdownKeyIndex).removeClass("lm_keyboard_active"),this.dropdownKeyIndex=t(this.dropdownKeyIndex,1,this.tabDropdownList),(i=this.tabDropdownList)===null||i===void 0||i.eq(this.dropdownKeyIndex).addClass("lm_keyboard_active")}else if(e.key==="ArrowUp"||e.key==="Tab"){var a,o;e.preventDefault(),(a=this.tabDropdownList)===null||a===void 0||a.eq(this.dropdownKeyIndex).removeClass("lm_keyboard_active"),this.dropdownKeyIndex=t(this.dropdownKeyIndex,-1,this.tabDropdownList),(o=this.tabDropdownList)===null||o===void 0||o.eq(this.dropdownKeyIndex).addClass("lm_keyboard_active")}}_handleFilterInput(e){if(this.tabDropdownList!=null){this.tabDropdownList.eq(this.dropdownKeyIndex).removeClass("lm_keyboard_active"),this.dropdownKeyIndex=-1;for(var t=0;t<this.tabDropdownList.length;t++){var r,i;((r=(i=this.tabs[t].contentItem.config.title)===null||i===void 0?void 0:i.toLowerCase().indexOf(e.target.value.toLowerCase()))!==null&&r!==void 0?r:-1)!==-1?(this.tabDropdownList.eq(t).css("display",""),this.dropdownKeyIndex===-1&&(this.dropdownKeyIndex=t)):this.tabDropdownList.eq(t).css("display","none")}this.dropdownKeyIndex!==-1&&this.tabDropdownList.eq(this.dropdownKeyIndex).addClass("lm_keyboard_active")}}_hideAdditionalTabsDropdown(e){var t,r;this.isDropdownShown&&(e&&(t=this.tabDropdownContainer.get(0))!==null&&t!==void 0&&t.contains(e.target)||e&&((r=this.tabDropdownButton)===null||r===void 0?void 0:r.element.get(0))===e.target||(this.element.removeClass("lm_dropdown_open"),this.tabDropdownContainer.hide(),this.isDropdownShown=!1,this.element.append(this.tabDropdownContainer),this.tabDropdownContainer.find(".lm_tabs").remove(),ge(document).off("mousedown",this._hideAdditionalTabsDropdown)))}_updateAdditionalTabsDropdown(){var e,t,r,i;if(this.isDropdownShown&&!(!this.tabDropdownList||this.tabDropdownList.length==0)){var a=(e=(t=this.tabDropdownContainer.get(0))===null||t===void 0?void 0:t.scrollHeight)!==null&&e!==void 0?e:0;if(a!==0){var o=this.tabDropdownContainer[0].getBoundingClientRect(),s=(r=ge(window).height())!==null&&r!==void 0?r:0,l=(i=ge(window).width())!==null&&i!==void 0?i:0;if(this.tabDropdownButton){var d=this.tabDropdownButton.element[0].getBoundingClientRect(),u=a<s-d.bottom,c=!u&&d.bottom>s*.6,m=Math.min(d.left+(c?d.width:0),l-o.width-this.PADDING),v=c?Math.max(d.top-a,this.PADDING):d.bottom,f=s-v-this.PADDING;this.tabDropdownContainer.css({"max-height":f,top:v,left:m})}}}}_isClosable(){return!!(this.parent.config.isClosable&&this.layoutManager.config.settings.showCloseIcon)}_onPopoutClick(){if(this.layoutManager.config.settings.popoutWholeStack===!0)this.parent.popout();else{var e;(e=this.activeContentItem)===null||e===void 0||e.popout()}}_onHeaderClick(e){e.target===this.element[0]&&this.parent.select()}_updateTabSizes(){if(this.tabs.length!==0){var e=this.tabsContainer.get(0);if(this.isDropdownShown&&this._updateAdditionalTabsDropdown(),!!e){if(!this.isOverflowing&&e.scrollWidth>e.clientWidth){var t;(t=this.tabDropdownButton)===null||t===void 0||t.element.show(),this.tabNextButton.show(),this.tabPreviousButton.show(),this.isOverflowing=!0}else if(this.isOverflowing&&e.scrollWidth<=e.clientWidth){var r;(r=this.tabDropdownButton)===null||r===void 0||r.element.hide(),this.tabNextButton.hide(),this.tabPreviousButton.hide(),this.isOverflowing=!1}this.isOverflowing&&this._checkScrollArrows()}}}}Ue(pi,"_template",['<div class="lm_header">','<ul class="lm_tabs"></ul>','<ul class="lm_controls"></ul>','<ul class="lm_tabdropdown_list">','<li class="lm_tabdropdown_search"><input type="text" placeholder="Find tab..."></li>',"</ul>","</div>"].join(""));Ue(pi,"_previousButtonTemplate",['<ul class="lm_controls">','<li class="lm_tabpreviousbutton"></li>',"</ul>"].join(""));Ue(pi,"_nextButtonTemplate",['<li class="lm_tabnextbutton"></li>'].join(""));function Ko(n,e,t){return e=xD(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function xD(n){var e=AD(n,"string");return typeof e=="symbol"?e:String(e)}function AD(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class yC{constructor(e,t,r){Ko(this,"_isVertical",void 0),Ko(this,"_size",void 0),Ko(this,"_grabSize",void 0),Ko(this,"_dragListener",void 0),Ko(this,"element",void 0),this._isVertical=e,this._size=t,this._grabSize=r<t?t:r,this.element=this._createElement(),this._dragListener=new $s(this.element)}on(e,t,r){var i;(i=this._dragListener)===null||i===void 0||i.on(e,t,r)}_$destroy(){var e;(e=this._dragListener)===null||e===void 0||e.destroy(),this._dragListener=null,this.element.remove()}_createElement(){var e=ge('<div class="lm_drag_handle"></div>'),t=ge('<div class="lm_splitter"></div>');t.append(e);var r=this._grabSize-this._size,i=r/2;return this._isVertical?(e.css("top",-i),e.css("height",this._size+r),t.addClass("lm_vertical"),t.height(this._size)):(e.css("left",-i),e.css("width",this._size+r),t.addClass("lm_horizontal"),t.width(this._size)),t}}const LD=Object.freeze(Object.defineProperty({__proto__:null,BrowserPopout:gC,DragProxy:$a,DragSource:pC,DragSourceFromEvent:bC,DropTargetIndicator:Hs,Header:pi,HeaderButton:ls,Splitter:yC,Tab:Bs},Symbol.toStringTag,{value:"Module"}));var kD={config:xO,container:$O,controls:LD,errors:bD,items:RD,utils:tD};const jD=kD;function Tv(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function cr(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Tv(Object(t),!0).forEach(function(r){We(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Tv(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function We(n,e,t){return e=$D(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function $D(n){var e=HD(n,"string");return typeof e=="symbol"?e:String(e)}function HD(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class EC extends Dn{static minifyConfig(e){return pc(e)}static unminifyConfig(e){return ph(e)}constructor(e,t){super(),We(this,"isInitialised",!1),We(this,"_isFullPage",!1),We(this,"_resizeTimeoutId",void 0),We(this,"_components",{"lm-react-component":vC}),We(this,"_fallbackComponent",void 0),We(this,"_itemAreas",[]),We(this,"_maximisedItem",null),We(this,"_maximisePlaceholder",ge('<div class="lm_maximise_place"></div>')),We(this,"_creationTimeoutPassed",!1),We(this,"_subWindowsCreated",!1),We(this,"_dragSources",[]),We(this,"_updatingColumnsResponsive",!1),We(this,"_firstLoad",!0),We(this,"_reactChildMap",new Map),We(this,"_reactChildren",null),We(this,"width",null),We(this,"height",null),We(this,"root",void 0),We(this,"openPopouts",[]),We(this,"selectedItem",null),We(this,"isSubWindow",!1),We(this,"eventHub",new fC(this)),We(this,"config",void 0),We(this,"container",void 0),We(this,"_originalContainer",void 0),We(this,"dropTargetIndicator",null),We(this,"tabDropPlaceholder",ge('<div class="lm_drop_tab_placeholder"></div>')),We(this,"_typeToItem",void 0),this._onResize=this._onResize.bind(this),this._onUnload=this._onUnload.bind(this),this._windowBlur=this._windowBlur.bind(this),this._windowFocus=this._windowFocus.bind(this),this.config=this._createConfig(e),this._originalContainer=t,this.container=this._getContainer(),this.isSubWindow&&ge("body").css("visibility","hidden"),this._typeToItem={column:Zl.bind(this,!0),row:Zl.bind(this,!1),stack:wh,component:wC}}registerComponent(e,t){if(typeof t!="function"&&(t==null||t.render==null||typeof t.render!="function"))throw new Error("Please register a constructor function");if(this._components[e]!==void 0)throw new Error("Component "+e+" is already registered");this._components[e]=t;var r=()=>{if(this._components[e]===void 0)throw new Error("Component "+e+" is not registered");delete this._components[e]};return r}setFallbackComponent(e){this._fallbackComponent=e}toConfig(e){if(this.isInitialised===!1)throw new Error("Can't create config, layout not yet initialised");if(e&&!(e instanceof Vt))throw new Error("Root must be a ContentItem");var t={settings:cr({},this.config.settings),dimensions:cr({},this.config.dimensions),labels:cr({},this.config.labels),content:[]},r=function a(o,s){for(var l in s.config)l!=="content"&&(o[l]=s.config[l]);if(o.componentName==="lm-react-component"&&(o.type="react-component"),s.contentItems.length){o.content=[];for(var d=0;d<s.contentItems.length;d++)o.content[d]={},a(o.content[d],s.contentItems[d])}};e?r(t,{contentItems:[e]}):r(t,this.root),this._$reconcilePopoutWindows(),t.openPopouts=[];for(var i=0;i<this.openPopouts.length;i++)t.openPopouts.push(this.openPopouts[i].toConfig());return t.maximisedItemId=this._maximisedItem?"__glMaximised":void 0,t}getComponent(e){return this._components[e]}getFallbackComponent(){return this._fallbackComponent}init(){if(this._subWindowsCreated===!1&&(this._createSubWindows(),this._subWindowsCreated=!0),document.readyState==="loading"||document.body===null){ge(document).ready(this.init.bind(this));return}if(this.isSubWindow===!0&&this._creationTimeoutPassed===!1){setTimeout(this.init.bind(this),7),this._creationTimeoutPassed=!0;return}this.isSubWindow===!0&&this._adjustToWindowMode(),this._setContainer(),this.dropTargetIndicator=new Hs,this.updateSize(),this._create(this.config),this._bindEvents(),this.isInitialised=!0,this._adjustColumnsResponsive(),this.emit("initialised")}addReactChild(e,t){this._reactChildMap.set(e,t),this._reactChildren=[...this._reactChildMap.values()],this.emit("reactChildrenChanged")}removeReactChild(e,t){var r=this._reactChildMap.get(e);r===t&&(this._reactChildMap.delete(e),this._reactChildren=[...this._reactChildMap.values()],this.emit("reactChildrenChanged"))}getReactChildren(){return this._reactChildren}updateSize(e,t){var r,i;if(this.width=(r=e??this.container.width())!==null&&r!==void 0?r:0,this.height=(i=t??this.container.height())!==null&&i!==void 0?i:0,this.isInitialised===!0){if(this.root.callDownwards("setSize",[this.width,this.height]),this._maximisedItem){var a,o;this._maximisedItem.element.width((a=this.container.width())!==null&&a!==void 0?a:0),this._maximisedItem.element.height((o=this.container.height())!==null&&o!==void 0?o:0),this._maximisedItem.callDownwards("setSize")}this._adjustColumnsResponsive()}}destroy(){var e;this.isInitialised===!1||!this.root||(this._onUnload(),ge(window).off("resize",this._onResize),ge(window).off("unload beforeunload",this._onUnload),ge(window).off("blur.lm").off("focus.lm"),this.root.callDownwards("_$destroy",[],!0),this.root.contentItems=[],this.tabDropPlaceholder.remove(),(e=this.dropTargetIndicator)===null||e===void 0||e.destroy(),this.eventHub.destroy(),this._dragSources.forEach(function(t){t._dragListener.destroy()}),this._dragSources=[])}createContentItem(e,t){var r,i;if(typeof e.type!="string")throw new Da("Missing parameter 'type'",e);if(e.type==="react-component"&&(e.type="component",e.componentName="lm-react-component"),!this._typeToItem[e.type])throw r="Unknown type '"+e.type+"'. Valid types are "+Object.keys(this._typeToItem).join(","),new Da(r);return e.type==="component"&&!(t instanceof wh)&&t&&!(this.isSubWindow===!0&&t instanceof Sh)&&(e={type:"stack",width:e.width,height:e.height,content:[e]}),i=new this._typeToItem[e.type](this,e,t),i}createPopout(e,t,r,i){var a=[],o=e instanceof Vt,s=this;if(o){var l;a=this.toConfig(e).content,r=fc();for(var d=e.parent,u=e;((c=d)===null||c===void 0?void 0:c.contentItems.length)===1&&!d.isRoot;){var c;u=d,d=d.parent}if((l=d)===null||l===void 0||l.addId(r),i==null||Number.isNaN(i)){var m;i=(m=d)===null||m===void 0?void 0:m.contentItems.indexOf(u)}}else e instanceof Array?a=e:a=[e];if(!t&&o){var v,f,g,p=window.screenX||window.screenLeft,b=window.screenY||window.screenTop,S=(v=e.element.offset())!==null&&v!==void 0?v:{left:0,top:0};t={left:p+S.left,top:b+S.top,width:(f=e.element.width())!==null&&f!==void 0?f:0,height:(g=e.element.height())!==null&&g!==void 0?g:0}}if(!t&&!o&&(t={left:window.screenX||window.screenLeft+20,top:window.screenY||window.screenTop+20,width:500,height:309}),o&&e.remove(),!(!t||!r||i===void 0)){var C=new gC(a,t,r,i,this);return C.on("initialised",function(){s.emit("windowOpened",C)}),C.on("closed",function(){s._$reconcilePopoutWindows()}),this.openPopouts.push(C),C}}createDragSource(e,t){this.config.settings.constrainDragToContainer=!1;var r=new pC(e,t,this);return this._dragSources.push(r),r}createDragSourceFromEvent(e,t){return this.config.settings.constrainDragToContainer=!1,new bC(e,this,t)}selectItem(e,t){if(this.config.settings.selectionEnabled!==!0)throw new Error("Please set selectionEnabled to true to use this feature");e!==this.selectedItem&&(this.selectedItem!==null&&this.selectedItem.deselect(),e&&t!==!0&&e.select(),this.selectedItem=e,this.emit("selectionChanged",e))}_$maximiseItem(e){var t,r;this._maximisedItem!==null&&this._$minimiseItem(this._maximisedItem),this._maximisedItem=e,this._maximisedItem.addId("__glMaximised"),e.element.addClass("lm_maximised"),e.element.after(this._maximisePlaceholder),this.root.element.prepend(e.element),e.element.width((t=this.container.width())!==null&&t!==void 0?t:0),e.element.height((r=this.container.height())!==null&&r!==void 0?r:0),e.callDownwards("setSize"),this._maximisedItem.emit("maximised"),this.emit("stateChanged")}_$minimiseItem(e){var t;e.element.removeClass("lm_maximised"),e.removeId("__glMaximised"),this._maximisePlaceholder.after(e.element),this._maximisePlaceholder.remove(),(t=e.parent)===null||t===void 0||t.callDownwards("setSize"),this._maximisedItem=null,e.emit("minimised"),this.emit("stateChanged")}_$closeWindow(){window.setTimeout(function(){window.close()},1)}_$getArea(e,t){for(var r=1/0,i=null,a=0;a<this._itemAreas.length;a++){var o=this._itemAreas[a];e>o.x1&&e<o.x2&&t>o.y1&&t<o.y2&&r>o.surface&&(r=o.surface,i=o)}return i}_$createRootItemAreas(){var e=50,t=cr({},this.root._$getArea()),r=[cr(cr({},t),{},{side:"left",x2:t.x1+e}),cr(cr({},t),{},{side:"right",x1:t.x2-e}),cr(cr({},t),{},{side:"top",y2:t.y1+e}),cr(cr({},t),{},{side:"bottom",y1:t.y2-e})];r.forEach(i=>{i.surface=(i.x2-i.x1)*(i.y2-i.y1)}),this._itemAreas.push(...r)}_$calculateItemAreas(){var e=this._getAllContentItems();if(this._itemAreas=[],e.length===1){this._itemAreas.push(this.root._$getArea());return}this._$createRootItemAreas();for(var t=0;t<e.length;t++){var r=e[t];if(Ns(r)){var i=r._$getArea();if(i!==null)if(i instanceof Array)this._itemAreas=this._itemAreas.concat(i);else{var a;this._itemAreas.push(i);var o=cr(cr({},i),(a=i.contentItem._contentAreaDimensions)===null||a===void 0?void 0:a.header.highlightArea);o.surface=(o.x2-o.x1)*(o.y2-o.y1),this._itemAreas.push(o)}}}}_$normalizeContentItem(e,t){if(!e)throw new Error("No content item defined");if(typeof e=="function"&&(e=e()),e instanceof Vt)return e;if(ge.isPlainObject(e)&&e.type){var r=this.createContentItem(e,t);return r.callDownwards("_$init"),r}else throw new Error("Invalid contentItem")}_$reconcilePopoutWindows(){for(var e=[],t=0;t<this.openPopouts.length;t++){var r;((r=this.openPopouts[t].getWindow())===null||r===void 0?void 0:r.closed)===!1?e.push(this.openPopouts[t]):this.emit("windowClosed",this.openPopouts[t])}this.openPopouts.length!==e.length&&(this.emit("stateChanged"),this.openPopouts=e)}_getAllContentItems(){var e=[],t=r=>{if(e.push(r),r.contentItems instanceof Array)for(var i=0;i<r.contentItems.length;i++)t(r.contentItems[i])};return t(this.root),e}_bindEvents(){this._isFullPage&&ge(window).resize(this._onResize),ge(window).on("unload beforeunload",this._onUnload).on("blur.lm",this._windowBlur).on("focus.lm",this._windowFocus)}_windowBlur(){this.root.element.addClass("lm_window_blur")}_windowFocus(){this.root.element.removeClass("lm_window_blur")}_onResize(){clearTimeout(this._resizeTimeoutId),this._resizeTimeoutId=window.setTimeout(this.updateSize.bind(this),100)}_createConfig(e){var t,r=mC("gl-window");r&&(this.isSubWindow=!0,e=JSON.parse(localStorage.getItem(r)||"{}"),e=ph(e),localStorage.removeItem(r)),e=ge.extend(!0,{},dC,e);var i=function a(o){for(var s in o){var l=o[s];s!=="props"&&typeof l=="object"&&l!=null?a(l):s==="type"&&l==="react-component"&&(o.type="component",o.componentName="lm-react-component")}};return i(e),((t=e.settings)===null||t===void 0?void 0:t.hasHeaders)===!1&&(e.dimensions.headerHeight=0),e}_adjustToWindowMode(){var e,t=ge('<div class="lm_popin" title="'+this.config.labels.popin+'"><div class="lm_icon"></div><div class="lm_bg"></div></div>');t.click(()=>{this.emit("popIn")}),document.title=gc((e=this.config.content[0].title)!==null&&e!==void 0?e:""),ge("head").append(ge("body link, body style, template, .gl_keep")),this.container=ge("body").html("").css("visibility","visible").append(t),document.body.offsetHeight,window.__glInstance=this}_createSubWindows(){if(this.config.openPopouts)for(var e=0;e<this.config.openPopouts.length;e++){var t=this.config.openPopouts[e];this.createPopout(t.content,t.dimensions,t.parentId,t.indexInParent)}}_getContainer(){var e=this._originalContainer?ge(this._originalContainer):ge("body");if(e.length===0)throw new Error("GoldenLayout container not found");if(e.length>1)throw new Error("GoldenLayout more than one container element specified");return e}_setContainer(){var e=this._getContainer();e[0]===document.body&&(this._isFullPage=!0,ge("html, body").css({height:"100%",margin:0,padding:0,overflow:"hidden"})),this.container=e}_create(e){var t;if(!(e.content instanceof Array))throw e.content===void 0?t="Missing setting 'content' on top level of configuration":t="Configuration parameter 'content' must be an array",new Da(t,e);if(e.content.length>1)throw t="Top level content can't contain more then one element.",new Da(t,e);this.root=new Sh(this,{content:e.content},this.container),this.root.callDownwards("_$init"),e.maximisedItemId==="__glMaximised"&&this.root.getItemsById(e.maximisedItemId)[0].toggleMaximise()}_onUnload(){if(this.config.settings.closePopoutsOnUnload===!0)for(var e=0;e<this.openPopouts.length;e++)this.openPopouts[e].close()}_adjustColumnsResponsive(){if(!this._useResponsiveLayout()||this._updatingColumnsResponsive||!this.config.dimensions||!this.config.dimensions.minItemWidth||this.root.contentItems.length===0||!this.root.contentItems[0].isRow){this._firstLoad=!1;return}this._firstLoad=!1;var e=this.root.contentItems[0].contentItems.length;if(!(e<=1)){var t=this.config.dimensions.minItemWidth,r=e*t;if(!(this.width==null||r<=this.width)){this._updatingColumnsResponsive=!0;for(var i=Math.max(Math.floor(this.width/t),1),a=e-i,o=this.root.contentItems[0],s=this._findAllStackContainers()[0],l=0;l<a;l++){var d=o.contentItems[o.contentItems.length-1];this._addChildContentItemsToContainer(s,d)}this._updatingColumnsResponsive=!1}}}_useResponsiveLayout(){return this.config.settings&&(this.config.settings.responsiveMode=="always"||this.config.settings.responsiveMode=="onload"&&this._firstLoad)}_addChildContentItemsToContainer(e,t){t.type==="stack"?t.contentItems.forEach(function(r){e.addChild(r),t.removeChild(r,!0)}):t.contentItems.forEach(r=>{this._addChildContentItemsToContainer(e,r)})}_findAllStackContainers(){var e=[];return this._findAllStackContainersRecursive(e,this.root),e}_findAllStackContainersRecursive(e,t){t.contentItems.forEach(r=>{Ns(r)?e.push(r):r.isComponent||this._findAllStackContainersRecursive(e,r)})}}We(EC,"__lm",jD);const BD=EC,UD="_lm_dragging_1qalq_1",VD="_lm_goldenlayout_1qalq_1",GD="_lm_header_1qalq_1",WD="_lm_controls_1qalq_1",zD="_lm_tabpreviousbutton_1qalq_1",KD="_lm_tabnextbutton_1qalq_1",qD="_lm_tab_1qalq_1",YD="_lm_active_1qalq_1",XD="_lm_close_tab_1qalq_1",QD="_lm_content_1qalq_1",ZD="_lm_dragProxy_1qalq_1",JD="_lm_dropTargetIndicator_1qalq_1",eN="_march_1qalq_1",tN="_lm_inner_1qalq_1",rN="_lm_splitter_1qalq_1",nN="_lm_selectable_1qalq_1",iN="_lm_tabdropdown_list_1qalq_1",aN="_lm_title_1qalq_1",oN="_lm_title_before_1qalq_1",sN="_lm_selected_1qalq_1",lN="_lm_focusin_1qalq_1",dN="_lm_window_blur_1qalq_1",uN="_lm_popout_1qalq_1",hN="_lm_maximise_1qalq_1",cN="_lm_tabdropdown_1qalq_1",mN="_lm_close_1qalq_1",vN="_lm_tabdropdown_search_1qalq_1",fN="_lm_tabs_1qalq_1",gN="_lm_keyboard_active_1qalq_1",pN="_lm_maximised_1qalq_1",bN="_lm_items_1qalq_1",Pv={"tab-height":"28px","drag-border-width":"5px",lm_dragging:UD,lm_goldenlayout:VD,lm_header:GD,lm_controls:WD,lm_tabpreviousbutton:zD,lm_tabnextbutton:KD,lm_tab:qD,lm_active:YD,lm_close_tab:XD,lm_content:QD,lm_dragProxy:ZD,lm_dropTargetIndicator:JD,march:eN,lm_inner:tN,lm_splitter:rN,lm_selectable:nN,lm_tabdropdown_list:iN,lm_title:aN,lm_title_before:oN,lm_selected:sN,lm_focusin:lN,lm_window_blur:dN,lm_popout:uN,lm_maximise:hN,lm_tabdropdown:cN,lm_close:mN,lm_tabdropdown_search:vN,lm_tabs:fN,lm_keyboard_active:gN,lm_maximised:pN,lm_items:bN},Ov=Object.freeze({tabHeight:parseInt(Pv["tab-height"],10),dragBorderWidth:parseInt(Pv["drag-border-width"],10)});function Dv(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function ni(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Dv(Object(t),!0).forEach(function(r){TC(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Dv(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function TC(n,e,t){return e=CN(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function CN(n){var e=SN(n,"string");return typeof e=="symbol"?e:String(e)}function SN(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var Ri=ie.module("LayoutUtils");function PC(n){return n.componentName!==void 0}function lo(n){var e=n;return(PC(n)&&n.componentName==="lm-react-component"||n.type==="react-component")&&e.component!==void 0}function ml(n){return n.focus!==void 0}function Nv(n){return n.type==="stack"}class ee{static activateTab(e,t){var r=ee.getStackForRoot(e,t,!1);if(!r){Ri.error("Could not find stack for config",t);return}var i=ee.getContentItemInStack(r,t);i&&r.setActiveContentItem(i)}static isActiveTab(e,t){var r=ee.getStackForRoot(e,t,!1);if(!r)return Ri.error("Could not find stack for config",t),!1;var i=ee.getContentItemInStack(r,t),a=r.getActiveContentItem();return a===i}static addStack(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,r=t?"column":"row";if(SC(e)){(e.contentItems==null||e.contentItems.length===0)&&e.addChild({type:r});var i=e.contentItems[0],a=t?i.isColumn:i.isRow;if(!a){e.removeChild(i,!0),e.addChild({type:r});var o=document.activeElement;e.contentItems[0].addChild(i),o&&o.focus!=null&&o.focus()}return this.addStack(e.contentItems[0],t)}if(e.contentItems.length<2)return e.addChild({type:"stack"}),e.contentItems[e.contentItems.length-1];var s=e.contentItems[e.contentItems.length-1],l=t?s.isRow:s.isColumn;return l||(e.addChild({type:t?"row":"column"}),e.removeChild(s,!0),e.contentItems[e.contentItems.length-1].addChild(s),s=e.contentItems[e.contentItems.length-1]),this.addStack(s,!t)}static getStackForConfig(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;if(r&&Ns(e)&&e.contentItems.length===0)return e;if(e.contentItems==null)return null;for(var i=0;i<e.contentItems.length;i+=1){var a=e.contentItems[i];if(a.isComponent&&a.config!=null&&cm(a.config,t))return e;var o=this.getStackForConfig(a,t,r);if(o)return o}return null}static getStackForRoot(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,o=this.getStackForConfig(e,t);return!o&&i&&(o=this.getStackForConfig(e,{component:t.component},a)),!o&&r&&(o=this.addStack(e)),o}static getStackForComponentTypes(e,t){for(var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,o=0;o<t.length;o+=1){var s=t[o],l=o===t.length-1,d=ee.getStackForRoot(e,{component:s},r&&l,i,a);if(d)return d}return null}static getContentItemInStack(e,t){if(!e)return null;for(var r=0;r<e.contentItems.length;r+=1){var i=e.contentItems[r];if(i.isComponent&&i.config!=null&&cm(i.config,t))return i}return null}static dehydrateLayoutConfig(e,t){if(e==null||!e.length)return[];for(var r=[],i=0;i<e.length;i+=1){var a=e[i],{component:o,content:s}=a;if(o){var l=t(o,a);l!=null?r.push(l):Ri.debug2('dehydrateLayoutConfig: skipping unmapped component "'.concat(o,'"'))}else if(s){var d=ni(ni({},a),{},{content:ee.dehydrateLayoutConfig(s,t)});r.push(d)}else r.push(a)}return r}static getTabPoint(e){var{tab:t}=e;if(t==null)throw new Error("Cannot get tab for panel container ".concat(e));var r=t.element[0].getBoundingClientRect();return[r.left+r.width*.5,r.bottom-8]}static dropLayoutMinorChange(e){for(var t=0;t<e.length;t+=1){var r=e[t],{content:i}=r;i!==void 0?(Nv(r)&&delete r.activeItemIndex,ee.dropLayoutMinorChange(i)):lo(r)&&r.component==="IrisGridPanel"&&r.props.panelState!=null&&(delete r.id,r.props.panelState.irisGridState.sorts=[],r.props.panelState.irisGridState.quickFilters=[],r.props.panelState.gridState.isStuckToBottom=!1,r.props.panelState.gridState.isStuckToRight=!1)}}static isEqual(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;if(r){var i=ee.cloneLayout(e),a=ee.cloneLayout(t);return ee.dropLayoutMinorChange(i),ee.dropLayoutMinorChange(a),mt(i,a)}return mt(e,t)}static cloneLayout(e){return JSON.parse(JSON.stringify(e))}static hydrateLayoutConfig(e,t){if(e==null||!e.length)return[];for(var r=[],i=0;i<e.length;i+=1){var a=e[i];if(lo(a)){var o,{component:s,props:l={}}=a;r.push(ni(ni({},a),{},{id:(o=a==null?void 0:a.id)!==null&&o!==void 0?o:qe(),props:t(s,l)}))}else if(a.content!==void 0){var d=ee.hydrateLayoutConfig(a.content,t);Nv(a)&&a.activeItemIndex!=null&&a.activeItemIndex>=d.length&&(Ri.warn("Fixing bad activeItemIndex!",a.activeItemIndex,a),a.activeItemIndex=0),r.push(ni(ni({},a),{},{content:d}))}else r.push(a)}return r}static openComponent(){var{root:e,config:t,replaceExisting:r=!0,replaceConfig:i=void 0,createNewStack:a=!1,focusElement:o=void 0,dragEvent:s=void 0}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},l=document.activeElement,d=ni({},t);if(d.id==null&&(d.id=qe.generate()),s!=null){e==null||e.layoutManager.createDragSourceFromEvent(d,s);return}var u=i||{id:d.id,component:d.component};j(e);var c=a?ee.addStack(e):ee.getStackForRoot(e,u);j(c);var m=ee.getContentItemInStack(c,u);if(o!=null){var v=g=>{Ri.debug("Component created, focusing element",o),c.off("componentCreated",v);var{element:p}=g.origin;requestAnimationFrame(()=>{ee.focusElement(p[0],o)})};c.on("componentCreated",v)}if(r&&m){var f=c.contentItems.indexOf(m);c.addChild(d,f+1),c.removeChild(m),c.setActiveContentItem(c.contentItems[f])}else c.addChild(d);o==null&&l&&ml(l)&&l.focus()}static openComponentInStack(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,i=document.activeElement,a={id:t.id},o=ee.getContentItemInStack(e,a);if(r&&o&&e){var s=e==null?void 0:e.contentItems.indexOf(o);e.addChild(t,s+1),e.removeChild(o),e.setActiveContentItem(e.contentItems[s])}else e==null||e.addChild(t);i&&ml(i)&&i.focus()}static closeComponent(e,t,r){var i=ee.getStackForRoot(e,t,!1,!1,!1);if(!i){Ri.warn("Cannot find stack for component, ignoring close",t);return}var a=ee.getContentItemInStack(i,t),o=document.activeElement;a&&(xr(a)?a.container.close(r):i.removeChild(a)),o&&document.contains(o)&&ml(o)&&o.focus()}static renameComponent(e,t,r){var i=ee.getStackForRoot(e,t,!1);if(!i){Ri.error("Could not find stack for config",t);return}var a=ee.getContentItemInStack(i,t);a&&a.setTitle(r)}static cloneComponent(e,t){var r=ee.getStackForRoot(e,t,!1);if(!r)return Ri.error("Could not find stack for config",t),null;var{props:i={}}=t,a=ee.getPanelComponentState(t),o={type:"react-component",component:t.component,props:ni(ni({},i),{},{panelState:a}),title:"".concat(t.title," Copy"),id:qe.generate()};return ee.openComponentInStack(r,o),o}static getPanelComponentState(e){if(PC(e)){var t;return(t=e.componentState)===null||t===void 0?void 0:t.panelState}if(lo(e)){var r;return(r=e.props)===null||r===void 0?void 0:r.panelState}return null}static makeDefaultLayout(){return{dimensions:{headerHeight:Ov.tabHeight,borderWidth:Ov.dragBorderWidth,borderGrabWidth:10},settings:{showPopoutIcon:!1,showCloseIcon:!1,constrainDragToContainer:!1}}}static getRootFromContainer(e){return e.layoutManager.root}static getComponentConfigFromContainer(e){return e?e.tab!=null&&e.tab.contentItem!=null?e.tab.contentItem.config:e._config:null}static getTitleFromContainer(e){return e!=null&&e.tab!=null&&e.tab.contentItem!=null?e.tab.contentItem.config.title:null}static getTitleFromTab(e){return e!=null&&e.contentItem!=null?e.contentItem.config.title:null}static getIdFromContainer(e){var t=ee.getComponentConfigFromContainer(e);return t?t.id:null}static getIdFromPanel(e){var{glContainer:t}=e.props;return ee.getIdFromContainer(t)}static getComponentNameFromPanel(e){var{glContainer:t}=e.props,r=ee.getComponentConfigFromContainer(t);if(r&&lo(r)){var i;return(i=r.component)!==null&&i!==void 0?i:null}return null}static getComponentName(e){var t,r,i=(t=(r=e.WrappedComponent)===null||r===void 0?void 0:r.displayName)!==null&&t!==void 0?t:e.displayName;if(i==null)throw new Error("Component displayName not defined ".concat(e));return i}static focusElement(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:ee.DEFAULT_FOCUS_SELECTOR;if(e==null)return null;var r=e.querySelector(t);return r==null?null:(ml(r)&&r.focus(),r)}static onInitialized(e){return new Promise(t=>{if(e.isInitialised){t();return}var r=()=>{e.off("initialised",r),t()};e.on("initialised",r)})}}TC(ee,"DEFAULT_FOCUS_SELECTOR","input, select, textarea, button");var wN=oe.forwardRef((n,e)=>{var t=ee.getComponentNameFromPanel({props:n});return h.jsx("div",{ref:e,className:"panel-placeholder",children:h.jsxs("div",{children:['Component "',t,'" is not registered.']})})});wN.displayName="PanelPlaceholder";const Oe=Object.freeze({FOCUS:"PanelEvent.FOCUS",MOUNT:"PanelEvent.MOUNT",UNMOUNT:"PanelEvent.UNMOUNT",TITLE_CHANGED:"PanelEvent.TITLE_CHANGED",REOPEN:"PanelEvent.REOPEN",DELETE:"PanelEvent.DELETE",CLONED:"PanelEvent.CLONED",CLOSED:"PanelEvent.CLOSED",OPEN:"PanelEvent.OPEN",CLOSE:"PanelEvent.CLOSE",DRAGGING:"PanelEvent.DRAGGING",DROPPED:"PanelEvent.DROPPED"});function Jl(n){return(n==null?void 0:n.WrappedComponent)!==void 0}function yN(n){return typeof n.id=="string"&&n.layout instanceof BD&&n.panelManager instanceof Cc&&typeof n.registerComponent=="function"}function Fo(n){if(!yN(n))throw new Error("Expected dashboard plugin props, but instead received ".concat(n))}function Rv(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function Iv(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Rv(Object(t),!0).forEach(function(r){Gi(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Rv(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function Gi(n,e,t){return e=EN(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function EN(n){var e=TN(n,"string");return typeof e=="symbol"?e:String(e)}function TN(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var Yr=ie.module("PanelManager");class Cc{constructor(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:(s,l)=>l,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:(s,l)=>l,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:new Map,a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:[],o=arguments.length>5&&arguments[5]!==void 0?arguments[5]:()=>{};Gi(this,"layout",void 0),Gi(this,"hydrateComponent",void 0),Gi(this,"dehydrateComponent",void 0),Gi(this,"onPanelsUpdated",void 0),Gi(this,"closed",void 0),Gi(this,"openedMap",void 0),this.handleFocus=this.handleFocus.bind(this),this.handleMount=this.handleMount.bind(this),this.handleUnmount=this.handleUnmount.bind(this),this.handleReopen=this.handleReopen.bind(this),this.handleDeleted=this.handleDeleted.bind(this),this.handleClosed=this.handleClosed.bind(this),this.handleControlClose=this.handleControlClose.bind(this),this.layout=e,this.hydrateComponent=t,this.dehydrateComponent=r,this.onPanelsUpdated=o,this.openedMap=new Map(i),this.closed=[...a],this.startListening()}startListening(){var{eventHub:e}=this.layout;e.on(Oe.FOCUS,this.handleFocus),e.on(Oe.MOUNT,this.handleMount),e.on(Oe.UNMOUNT,this.handleUnmount),e.on(Oe.REOPEN,this.handleReopen),e.on(Oe.DELETE,this.handleDeleted),e.on(Oe.CLOSED,this.handleClosed),e.on(Oe.CLOSE,this.handleControlClose)}stopListening(){var{eventHub:e}=this.layout;e.off(Oe.FOCUS,this.handleFocus),e.off(Oe.MOUNT,this.handleMount),e.off(Oe.UNMOUNT,this.handleUnmount),e.off(Oe.REOPEN,this.handleReopen),e.off(Oe.DELETE,this.handleDeleted),e.off(Oe.CLOSED,this.handleClosed),e.off(Oe.CLOSE,this.handleControlClose)}getClosedPanelConfigsOfType(e){return this.closed.filter(t=>t.component===e)}getOpenedPanels(){return Array.from(this.openedMap.values())}getOpenedPanelConfigs(){return this.getOpenedPanels().map(e=>{var{glContainer:t}=e.props;return ee.getComponentConfigFromContainer(t)})}getOpenedPanelConfigsOfType(e){return this.getOpenedPanelConfigs().filter(t=>t!=null&&lo(t)&&t.component===e)}getOpenedPanelById(e){return this.openedMap.get(e)}getContainerByPanelId(e){var t,r=ee.getStackForConfig(this.layout.root,{id:e});return(t=r&&ee.getContentItemInStack(r,{id:e}))!==null&&t!==void 0?t:null}getLastUsedPanel(e){for(var t=this.getOpenedPanels(),r=t.length-1;r>=0;r-=1){var i=t[r];if(e==null||e(i))return i}}getLastUsedPanelOfType(e){return this.getLastUsedPanelOfTypes([e])}getLastUsedPanelOfTypes(e){return this.getLastUsedPanel(t=>e.some(r=>Jl(r)&&t instanceof r.WrappedComponent||!Jl(r)&&t instanceof r))}updatePanel(e){var t=ee.getIdFromPanel(e);if(t==null){Yr.error("updatePanel Panel did not have an ID",e);return}Yr.debug2("Updating panel ID ".concat(t," in open panels map")),this.openedMap.delete(t),this.openedMap.set(t,e)}removePanel(e){var t=ee.getIdFromPanel(e);if(t==null){Yr.error("removePanel Panel did not have an ID",e);return}if(!this.openedMap.has(t)){Yr.error("Missing panel ID ".concat(t," in open panels map"));return}if(this.openedMap.get(t)!==e){Yr.debug("Panel argument doesn't match the open panels map entry for ".concat(t,", removePanel ignored"));return}Yr.debug2("Removing panel ID ".concat(t," from open panels map")),this.openedMap.delete(t)}removeClosedPanelConfig(e){var t=this.closed.findIndex(r=>r===e||r.id!=null&&e.id!=null&&r.id===e.id);t>=0&&this.closed.splice(t,1)}handleFocus(e){Yr.debug2("Focus: ",e),this.updatePanel(e)}handleMount(e){Yr.debug2("Mount: ",e),this.updatePanel(e),this.sendUpdate()}handleUnmount(e){Yr.debug2("Unmount: ",e),this.removePanel(e),this.sendUpdate()}handleReopen(e,t){Yr.debug2("Reopen:",e,t),this.removeClosedPanelConfig(e);var{component:r}=e,{props:i}=e;i=this.hydrateComponent(r,i);var a=Iv(Iv({},e),{},{props:i}),{root:o}=this.layout;ee.openComponent({root:o,config:a,replaceConfig:t})}handleDeleted(e){Yr.debug2("Deleted:",e),this.removeClosedPanelConfig(e),this.sendUpdate()}handleClosed(e,t){Yr.debug2("Closed: ",e),this.addClosedPanel(t),this.sendUpdate()}handleControlClose(e){var t={id:e},{root:r}=this.layout;ee.closeComponent(r,t)}addClosedPanel(e){var t=ee.getComponentConfigFromContainer(e);if(t&&lo(t)){var r=this.dehydrateComponent(t.component,t);r!=null&&this.closed.push(r)}}sendUpdate(){var{closed:e,openedMap:t}=this;this.onPanelsUpdated({closed:[...e],openedMap:new Map(t)})}}Gi(Cc,"MAX_CLOSED_PANEL_COUNT",100);var PN=ie.module("PanelErrorBoundary");class ON extends w.Component{constructor(e){super(e),this.state={error:null}}componentDidCatch(e){this.setState({error:e})}componentWillUnmount(){var{glContainer:e,glEventHub:t}=this.props,r=ee.getIdFromContainer(e);PN.debug("componentWillUnmount",r),t.emit(Oe.CLOSED,r,e)}render(){var{children:e}=this.props,{error:t}=this.state;return t!=null?h.jsx("div",{className:"panel-error-boundary",children:h.jsx(As,{errorMessage:"".concat(t),isLoading:!1,isLoaded:!1})}):e}}function Fv(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function ed(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Fv(Object(t),!0).forEach(function(r){DN(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Fv(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function DN(n,e,t){return e=NN(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function NN(n){var e=RN(n,"string");return typeof e=="symbol"?e:String(e)}function RN(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function Sc(n){var{props:e,componentState:t}=n,{metadata:r}=e,{panelState:i=null}=e;t&&({panelState:i}=t);var a={};return r!=null&&(a.metadata=r),i!=null&&(a.panelState=i),ed(ed({},n),{},{componentState:null,props:a,type:"react-component"})}function wc(n){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";return ed(ed({metadata:{}},n),{},{localDashboardId:e})}function OC(n){var e=Jl(n)&&n.WrappedComponent.prototype!=null&&n.WrappedComponent.prototype.isReactComponent!=null||n.prototype!=null&&n.prototype.isReactComponent!=null,t=!Jl(n)&&"$$typeof"in n&&n.$$typeof===uy.ForwardRef;return e||t}const IN={dehydrate:Sc,hydrate:wc};var FN=oe.createContext(void 0),_N=V.shape({on:V.func,off:V.func,isHidden:V.bool,tab:V.shape({header:V.shape({tabs:V.arrayOf(V.shape({contentItem:V.shape({})}))})}),title:V.string,setTitle:V.func,close:V.func}),DC=V.shape({on:V.func,off:V.func,emit:V.func}),MN=V.shape({registerComponent:V.func,root:V.shape({addChild:V.func}),on:V.func,off:V.func,eventHub:DC}),yc=Object.freeze({Container:_N,EventHub:DC,Layout:MN});function Ye(n,e,t){w.useEffect(function(){return n.on(e,t),()=>{n.off(e,t)}},[n,e,t])}function qo(n,e,t,r){var i,a=(i=e.COMPONENT)!==null&&i!==void 0?i:e.displayName;if(a==null)throw new Error("ComponentType must have a `COMPONENT` or `displayName` attribute.");oe.useEffect(()=>{var o=n(a,e,t,r);return()=>{o()}},[e,r,t,a,n])}function _v(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function xN(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?_v(Object(t),!0).forEach(function(r){AN(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):_v(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function AN(n,e,t){return e=LN(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function LN(n){var e=kN(n,"string");return typeof e=="symbol"?e:String(e)}function kN(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var jN=Object.freeze({}),$N=new Map,NC=n=>n.api,HN=n=>n.user,RC=n=>n.storage,IC=n=>RC(n).commandHistoryStorage,FC=n=>RC(n).fileStorage,BN=n=>n.defaultWorkspaceSettings,_C=n=>{var{workspace:e}=n;return e},Us=n=>{for(var e=_C(n).data.settings,t=xN({},BN(n)),r=Object.keys(e),i=0;i<r.length;i+=1){var a=r[i];e[a]!==void 0&&(t[a]=e[a])}return t},Ec=n=>Us(n).timeZone,UN=n=>{var e;return(e=Us(n).defaultNotebookSettings)!==null&&e!==void 0?e:jN},Tc=n=>n.activeTool,VN=n=>{var e;return(e=n.plugins)!==null&&e!==void 0?e:$N},MC="SET_ACTIVE_TOOL",GN="SET_API",WN="SET_COMMAND_HISTORY_STORAGE",zN="SET_FILE_STORAGE",KN="SET_PLUGINS",qN="SET_USER",xC="SET_WORKSPACE",YN="SET_DEFAULT_WORKSPACE_SETTINGS",XN="SET_WORKSPACE_STORAGE",QN="SET_SERVER_CONFIG_VALUES";function Mv(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function va(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Mv(Object(t),!0).forEach(function(r){ZN(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Mv(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function ZN(n,e,t){return e=JN(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function JN(n){var e=eR(n,"string");return typeof e=="symbol"?e:String(e)}function eR(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var tR=n=>({type:xC,payload:n}),rR=n=>(e,t)=>{e(tR(n));var{storage:r}=t(),{workspaceStorage:i}=r;return i.save(n)},nR=n=>(e,t)=>{var{workspace:r}=t(),{data:i}=r,a=va(va({},r),{},{data:va(va(va({},i),n),{},{settings:va(va({},i.settings),n.settings)})});return e(rR(a))},iR=n=>e=>e(nR({settings:n})),AC=n=>({type:MC,payload:n});function xv(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function Hu(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?xv(Object(t),!0).forEach(function(r){aR(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):xv(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function aR(n,e,t){return e=oR(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function oR(n){var e=sR(n,"string");return typeof e=="symbol"?e:String(e)}function sR(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function LC(n,e){return function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:e,r=arguments.length>1?arguments[1]:void 0;switch(r.type){case n:{var i=r.payload;return i==null?null:t!=null?Hu(Hu({},t),i):Hu({},i)}default:return t}}}function Av(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function Lv(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Av(Object(t),!0).forEach(function(r){lR(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Av(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function lR(n,e,t){return e=dR(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function dR(n){var e=uR(n,"string");return typeof e=="symbol"?e:String(e)}function uR(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function hR(n){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;return function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:e,i=arguments.length>1?arguments[1]:void 0;switch(i.type){case n:{var{id:a,payload:o}=i;return t&&mt({payload:o},{payload:r[a]})?r:Lv(Lv({},r),{},{[a]:o})}default:return r}}}function sa(n,e){return function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:e,r=arguments.length>1?arguments[1]:void 0;switch(r.type){case n:return r.payload;default:return t}}}const cR=sa(GN,null),mR=sa(MC,null),vR=sa(KN,null),fR=sa(WN,null),gR=sa(zN,null),pR=sa(XN,null),bR=Vh({commandHistoryStorage:fR,fileStorage:gR,workspaceStorage:pR}),CR=LC(qN,null),SR=LC(xC,null),wR=sa(YN,null),yR=sa(QN,null);var ER={activeTool:mR,api:cR,plugins:vR,storage:bR,user:CR,workspace:SR,defaultWorkspaceSettings:wR,serverConfigValues:yR};const TR=ER;function kv(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function jv(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?kv(Object(t),!0).forEach(function(r){yh(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):kv(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function yh(n,e,t){return e=PR(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function PR(n){var e=OR(n,"string");return typeof e=="symbol"?e:String(e)}function OR(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class DR{constructor(){yh(this,"reducers",{}),yh(this,"listener",null)}register(e,t){var r;this.reducers=jv(jv({},this.reducers),{},{[e]:t}),(r=this.listener)===null||r===void 0||r.call(this,this.reducers)}setListener(e){this.listener=e}}var NR=new DR;const $d=NR;var $v=ie.module("redux-logger"),RR=n=>e=>t=>{$v.debug("dispatching",t);var r=e(t);return $v.debug("next state",n.getState()),r};const IR=RR;var FR=ie.module("redux-crashReporter"),_R=n=>e=>t=>{try{return e(t)}catch(r){throw FR.error("Error executing",t," with state ",n.getState(),":",r),r}};const MR=_R,xR=[IR,MR,hy];var Bu;Object.entries(TR).map(n=>{var[e,t]=n;return $d.register(e,t)});var AR=(Bu=window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__)!==null&&Bu!==void 0?Bu:vy,kC=cy(Vh($d.reducers),AR(my(...xR)));$d.setListener(n=>{kC.replaceReducer(Vh(n))});const LR=kC;var jC="SET_DASHBOARD_DATA";const kR=hR(jC,{},!1),jR={dashboardData:kR};var $R=new Map,$C=Object.freeze({}),HR=Object.freeze([]),BR=n=>n.dashboardData,Zt=(n,e)=>{var t;return(t=BR(n)[e])!==null&&t!==void 0?t:$C},UR=(n,e)=>{var t;return(t=Zt(n,e).closed)!==null&&t!==void 0?t:HR},HC=(n,e)=>{var t;return(t=Zt(n,e).openedMap)!==null&&t!==void 0?t:$R},BC=(n,e)=>{var t;return(t=Zt(n,e).pluginDataMap)!==null&&t!==void 0?t:$C},Z2=(n,e,t)=>BC(n,e)[t];function Hv(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function uo(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Hv(Object(t),!0).forEach(function(r){VR(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Hv(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function VR(n,e,t){return e=GR(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function GR(n){var e=WR(n,"string");return typeof e=="symbol"?e:String(e)}function WR(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var UC=(n,e)=>({type:jC,id:n,payload:e}),Ci=(n,e)=>(t,r)=>t(UC(n,uo(uo({},Zt(r(),n)),e))),J2=(n,e,t)=>(r,i)=>r(UC(n,uo(uo({},Zt(i(),n)),{},{pluginDataMap:uo(uo({},BC(i(),n)),{},{[e]:t})})));Object.entries(jR).map(n=>{var[e,t]=n;return $d.register(e,t)});function zR(n){var{children:e}=n;return h.jsx(h.Fragment,{children:e})}function Bv(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function Yo(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Bv(Object(t),!0).forEach(function(r){KR(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Bv(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function KR(n,e,t){return e=qR(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function qR(n){var e=YR(n,"string");return typeof e=="symbol"?e:String(e)}function YR(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var vl=ie.module("DashboardLayout"),XR=Object.freeze({}),QR=[],Uv=()=>{},Vv=n=>n;function ZR(n){var e,t,{id:r,children:i,emptyDashboard:a=h.jsx("div",{children:"Dashboard is empty."}),layout:o,layoutConfig:s=QR,onLayoutChange:l=Uv,onLayoutInitialized:d=Uv,hydrate:u=wc,dehydrate:c=Sc,panelWrapper:m=zR}=n,v=Gh(),f=(e=fy(D=>Zt(D,r)))!==null&&e!==void 0?e:XR,[g,p]=w.useState(!1),[b,S]=w.useState(!1),[C,y]=w.useState(),[E]=w.useState((t=f==null?void 0:f.closed)!==null&&t!==void 0?t:[]),[T,O]=w.useState(!1),[N,P]=w.useState(o.getReactChildren()),R=w.useMemo(()=>new Map,[]),A=w.useMemo(()=>new Map,[]),M=w.useCallback(function(D,L){var H,z=arguments.length>2&&arguments[2]!==void 0?arguments[2]:u,te=arguments.length>3&&arguments[3]!==void 0?arguments[3]:c;vl.debug2("registerComponent",D,L,z,te);function W(re,se){var Ce=L,Me=m,rt=OC(Ce),{glContainer:nt,glEventHub:Xe}=re;return h.jsx(ON,{glContainer:nt,glEventHub:Xe,children:h.jsx(Me,Yo(Yo({},re),{},{children:rt?h.jsx(Ce,Yo(Yo({},re),{},{ref:se})):h.jsx(Ce,Yo({},re))}))})}W.displayName="DashboardWrapper(".concat((H=L.displayName)!==null&&H!==void 0?H:D,")");var ne=o.registerComponent(D,oe.forwardRef(W));return R.set(D,z),A.set(D,te),ne},[u,c,R,A,o,m]),I=w.useCallback((D,L)=>{var H;return((H=R.get(D))!==null&&H!==void 0?H:Vv)(L,r)},[R,r]),x=w.useCallback((D,L)=>{var H;return((H=A.get(D))!==null&&H!==void 0?H:Vv)(L,r)},[A,r]),_=w.useMemo(()=>new Cc(o,I,x,new Map,E,D=>{var{closed:L,openedMap:H}=D;v(Ci(r,{closed:L,openedMap:H}))}),[x,v,I,r,E,o]),k=w.useCallback(()=>{if(!b){T||(d(),O(!0));var D=o.toConfig(),L=D.content,H=ee.dehydrateLayoutConfig(L,x),z=C==null||!ee.isEqual(C,H);vl.debug("handleLayoutStateChanged",z,L,H),z&&(p(o.root.contentItems.length===0),y(H),l(H),P(o.getReactChildren()))}},[x,T,b,C,o,l,d]),U=w.useCallback(D=>{var L=ee.getIdFromContainer(D);o.eventHub.emit(Oe.DRAGGING,L),S(!0)},[o.eventHub]),G=w.useCallback(D=>{var L=ee.getIdFromContainer(D);o.eventHub.emit(Oe.DROPPED,L),S(!1)},[o.eventHub]),Y=w.useCallback(D=>{if(vl.debug2("handleComponentCreated",D),!(D==null||D.config==null||D.config.component==null||D.element==null)){var L=D.config.component.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),H="".concat(L,"-component");D.element.addClass(H)}},[]),Z=w.useCallback(()=>{P(o.getReactChildren())},[o]);Ye(o,"stateChanged",k),Ye(o,"itemPickedUp",U),Ye(o,"itemDropped",G),Ye(o,"componentCreated",Y),Ye(o.eventHub,Oe.TITLE_CHANGED,k),Ye(o,"reactChildrenChanged",Z);var $=Nd(s);return w.useEffect(function(){if($!==s&&s!==C){vl.debug("Setting new layout content...");for(var L=ee.hydrateLayoutConfig(s,I);o.root.contentItems.length>0;)o.root.contentItems[0].remove();for(var H=0;H<L.length;H+=1)o.root.addChild(L[H]);p(o.root.contentItems.length===0)}},[I,o,s,C,_,$]),h.jsxs(h.Fragment,{children:[g&&a,N,oe.Children.map(i,D=>D!=null?oe.cloneElement(D,{id:r,layout:o,panelManager:_,registerComponent:M}):null)]})}ZR.propTypes={id:V.string.isRequired,children:V.node,data:V.shape({}),emptyDashboard:V.node,layout:yc.Layout.isRequired,layoutConfig:V.arrayOf(V.shape({})),onLayoutChange:V.func,onLayoutInitialized:V.func};var JR="default";function eI(n,e,t){return e=tI(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function tI(n){var e=rI(n,"string");return typeof e=="symbol"?e:String(e)}function rI(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class nI extends Error{constructor(){super(...arguments),eI(this,"isAssertionFailed",!0)}}const VC=nI;function Gv(n){if(n==null)throw new VC("Expected 'val' to be defined, but received ".concat(n))}function iI(n,e,t){return e=aI(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function aI(n){var e=oI(n,"string");return typeof e=="symbol"?e:String(e)}function oI(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class sI extends Error{constructor(){super(...arguments),iI(this,"isPasteError",!0)}}const Uu=sI;function tt(n){return(n==null?void 0:n.isEditable)!==void 0}function Wv(n){if(!tt(n))throw new VC("Expected 'model' to be editable, but received ".concat(n))}function Ke(n){return(n==null?void 0:n.hasExpandableRows)!==void 0}function ds(n,e,t){return e=lI(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function lI(n){var e=dI(n,"string");return typeof e=="symbol"?e:String(e)}function dI(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var on;(function(n){n.DOWN="DOWN",n.UP="UP",n.LEFT="LEFT",n.RIGHT="RIGHT"})(on||(on={}));class Q{static normalize(e,t,r,i){var a=e,o=t,s=r,l=i;return a!=null&&s!=null&&s<a&&(a=s,s=e),o!=null&&l!=null&&l<o&&(o=l,l=t),[a,o,s,l]}static makeNormalized(e,t,r,i){return new Q(...Q.normalize(e,t,r,i))}static makeCell(e,t){return new Q(e,t,e,t)}static makeColumn(e){return new Q(e,null,e,null)}static makeRow(e){return new Q(null,e,null,e)}static minOrNull(e,t){return e==null||t==null?null:Math.min(e,t)}static maxOrNull(e,t){return e==null||t==null?null:Math.max(e,t)}static consolidate(e){for(var t=e.slice(),r=!0;r;){r=!1;for(var i=0;i<t.length&&!r;i+=1)for(var a=t[i],o=t.length-1;o>i;o-=1){var s=t[o];if(a.contains(s))t.splice(o,1);else if(s.contains(a)){r=!0,t[i]=s,t.splice(o,1);break}else if(a.startRow===s.startRow&&a.endRow===s.endRow){if(a.touches(s)){var{startRow:l,endRow:d}=a,u=Q.minOrNull(a.startColumn,s.startColumn),c=Q.maxOrNull(a.endColumn,s.endColumn);r=!0,t[i]=new Q(u,l,c,d),t.splice(o,1);break}}else if(a.startColumn===s.startColumn&&a.endColumn===s.endColumn&&a.touches(s)){var{startColumn:m,endColumn:v}=a,f=Q.minOrNull(a.startRow,s.startRow),g=Q.maxOrNull(a.endRow,s.endRow);r=!0,t[i]=new Q(m,f,v,g),t.splice(o,1);break}}}return t}static isAxisRangeTouching(e,t,r,i){return e==null?t==null||r==null?!0:r<=t+1:t==null?i==null?!0:i>=e-1:r==null?i==null?!0:e<=i+1:i==null?t>=r-1:r>=e-1?r<=t+1:i>=e-1}static rangeArraysEqual(e,t){if(e===t)return!0;if(e==null||t==null||e.length!==t.length)return!1;for(var r=0;r<e.length;r+=1)if(!e[r].equals(t[r]))return!1;return!0}static intersection(e,t){var r,i,a,o,s,l;if(e.equals(t))return e;var{startColumn:d,startRow:u,endColumn:c,endRow:m}=e;return d=d!=null&&t.startColumn!=null?Math.max(d,t.startColumn):(r=d)!==null&&r!==void 0?r:t.startColumn,c=c!=null&&t.endColumn!=null?Math.min(c,t.endColumn):(i=c)!==null&&i!==void 0?i:t.endColumn,u=u!=null&&t.startRow!=null?Math.max(u,t.startRow):(a=u)!==null&&a!==void 0?a:t.startRow,m=m!=null&&t.endRow!=null?Math.min(m,t.endRow):(o=m)!==null&&o!==void 0?o:t.endRow,d!=null&&d>((s=c)!==null&&s!==void 0?s:-1)||u!=null&&u>((l=m)!==null&&l!==void 0?l:-1)?null:new Q(d,u,c,m)}static subtractFromRange(e,t){var r=[],i=Q.intersection(e,t);return i==null?[e]:(i.startRow!=null&&(e.startRow==null||e.startRow<i.startRow)&&r.push(new Q(e.startColumn,e.startRow,e.endColumn,i.startRow-1)),i.startColumn!=null&&(e.startColumn==null||e.startColumn<i.startColumn)&&r.push(new Q(e.startColumn,i.startRow,i.startColumn-1,i.endRow)),i.endColumn!=null&&(e.endColumn==null||e.endColumn>i.endColumn)&&r.push(new Q(i.endColumn+1,i.startRow,e.endColumn,i.endRow)),i.endRow!=null&&(e.endRow==null||e.endRow>i.endRow)&&r.push(new Q(e.startColumn,i.endRow+1,e.endColumn,e.endRow)),r)}static subtractFromRanges(e,t){for(var r=[],i=0;i<e.length;i+=1)r.push(...Q.subtractFromRange(e[i],t));return r}static subtractRangesFromRanges(e,t){for(var r=[...e],i=0;i<t.length;i+=1)r=Q.subtractFromRanges(r,t[i]);return r}static isBounded(e){return e.startRow!=null&&e.startColumn!=null&&e.endRow!=null&&e.endColumn!=null}static boundedRange(e,t,r){var i,a,o,s;return Q.isBounded(e)?e:new Q((i=e.startColumn)!==null&&i!==void 0?i:0,(a=e.startRow)!==null&&a!==void 0?a:0,(o=e.endColumn)!==null&&o!==void 0?o:t-1,(s=e.endRow)!==null&&s!==void 0?s:r-1)}static boundedRanges(e,t,r){return e.map(i=>Q.boundedRange(i,t,r))}static offset(e,t,r){return new Q(e.startColumn!=null?e.startColumn+t:null,e.startRow!=null?e.startRow+r:null,e.endColumn!=null?e.endColumn+t:null,e.endRow!=null?e.endRow+r:null)}static nextCell(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:Q.SELECTION_DIRECTION.DOWN;if(e.length===0)return null;var a=-1;if(t!=null&&r!=null&&(a=e.findIndex(m=>m.containsCell(t,r)),a>=0)){var o=e[a],s=o.nextCell(t,r,i);if(s!=null)return s}switch(i){case Q.SELECTION_DIRECTION.DOWN:case Q.SELECTION_DIRECTION.RIGHT:{var l=a<e.length-1?a+1:0,d=e[l];return d.startCell(i)}case Q.SELECTION_DIRECTION.LEFT:case Q.SELECTION_DIRECTION.UP:{var u=a>0?a-1:e.length-1,c=e[u];return c.startCell(i)}default:throw new Error("Invalid direction: ".concat(i))}}static cellCount(e){return e.reduce((t,r)=>{var i,a,o,s;return t+(((i=r.endRow)!==null&&i!==void 0?i:NaN)-((a=r.startRow)!==null&&a!==void 0?a:NaN)+1)*(((o=r.endColumn)!==null&&o!==void 0?o:NaN)-((s=r.startColumn)!==null&&s!==void 0?s:NaN)+1)},0)}static rowCount(e){return e.reduce((t,r)=>{var i,a;return t+((i=r.endRow)!==null&&i!==void 0?i:NaN)-((a=r.startRow)!==null&&a!==void 0?a:NaN)+1},0)}static columnCount(e){return e.reduce((t,r)=>{var i,a;return t+((i=r.endColumn)!==null&&i!==void 0?i:NaN)-((a=r.startColumn)!==null&&a!==void 0?a:NaN)+1},0)}static containsCell(e,t,r){for(var i=0;i<e.length;i+=1){var a=e[i];if(a.containsCell(t,r))return!0}return!1}static forEachCell(e,t){for(var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Q.SELECTION_DIRECTION.RIGHT,i=0;i<e.length;i+=1)e[i].forEach(t,r)}constructor(e,t,r,i){ds(this,"startColumn",void 0),ds(this,"startRow",void 0),ds(this,"endColumn",void 0),ds(this,"endRow",void 0),this.startColumn=e,this.startRow=t,this.endColumn=r,this.endRow=i}equals(e){return this.startColumn===e.startColumn&&this.startRow===e.startRow&&this.endColumn===e.endColumn&&this.endRow===e.endRow}contains(e){return(this.startColumn==null||e.startColumn!=null&&this.startColumn<=e.startColumn)&&(this.startRow==null||e.startRow!=null&&this.startRow<=e.startRow)&&(this.endColumn==null||e.endColumn!=null&&this.endColumn>=e.endColumn)&&(this.endRow==null||e.endRow!=null&&this.endRow>=e.endRow)}containsCell(e,t){return e==null||t==null?!1:(this.startColumn==null||this.startColumn<=e)&&(this.endColumn==null||this.endColumn>=e)&&(this.startRow==null||this.startRow<=t)&&(this.endRow==null||this.endRow>=t)}touches(e){return Q.isAxisRangeTouching(this.startRow,this.endRow,e.startRow,e.endRow)&&Q.isAxisRangeTouching(this.startColumn,this.endColumn,e.startColumn,e.endColumn)}subtract(e){return Q.subtractFromRange(this,e)}startCell(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Q.SELECTION_DIRECTION.DOWN;if(!Q.isBounded(this))throw new Error("Cannot get the startCell of an unbounded range");switch(e){case Q.SELECTION_DIRECTION.DOWN:case Q.SELECTION_DIRECTION.RIGHT:return{column:this.startColumn,row:this.startRow};case Q.SELECTION_DIRECTION.LEFT:case Q.SELECTION_DIRECTION.UP:return{column:this.endColumn,row:this.endRow};default:throw new Error("Invalid direction: ".concat(e))}}nextCell(e,t,r){if(!Q.isBounded(this))throw new Error("Bounded range required");if(e==null||t==null)throw new Error("Require a non-null cursor");var{startColumn:i,endColumn:a,startRow:o,endRow:s}=this;switch(r){case Q.SELECTION_DIRECTION.DOWN:if(t<s)return{column:e,row:Math.max(t+1,o)};if(e<a)return{column:Math.max(e+1,i),row:o};break;case Q.SELECTION_DIRECTION.UP:if(t>o)return{column:e,row:Math.min(t-1,s)};if(e>i)return{column:Math.min(e-1,a),row:s};break;case Q.SELECTION_DIRECTION.RIGHT:if(e<a)return{column:Math.max(e+1,i),row:t};if(t<s)return{column:i,row:Math.max(t+1,o)};break;case Q.SELECTION_DIRECTION.LEFT:if(e>i)return{column:Math.min(e-1,a),row:t};if(t>o)return{column:a,row:Math.min(t-1,s)};break;default:throw new Error("Invalid direction: ".concat(r))}return null}forEach(e){for(var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Q.SELECTION_DIRECTION.RIGHT,r=0,{column:i,row:a}=this.startCell(t);i!=null&&a!=null;){var o;e(i,a,r),r+=1,{column:i,row:a}=(o=this.nextCell(i,a,t))!==null&&o!==void 0?o:{}}}}ds(Q,"SELECTION_DIRECTION",on);function uI(n){return Array.isArray(n)&&n.length===2&&(n[0]===null||typeof n[0]=="number")&&(n[1]===null||typeof n[1]=="number")}function fl(n){return uI(n)&&n[0]!=null&&n[1]!=null}function zv(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function gl(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?zv(Object(t),!0).forEach(function(r){GC(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):zv(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function GC(n,e,t){return e=hI(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function hI(n){var e=cI(n,"string");return typeof e=="symbol"?e:String(e)}function cI(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function td(n){return(n==null?void 0:n.href)!==void 0}class ae{static getGridPointFromXY(e,t,r){var i=ae.getColumnAtX(e,r),a=ae.getRowAtY(t,r),o=ae.getColumnHeaderDepthAtY(t,r);return{x:e,y:t,row:a,column:i,columnHeaderDepth:o}}static getCellInfoFromXY(e,t,r){var{row:i,column:a}=ae.getGridPointFromXY(e,t,r),{allColumnWidths:o,allRowHeights:s,allColumnXs:l,allRowYs:d,modelColumns:u,modelRows:c}=r,m=i!==null?c.get(i):null,v=a!==null?u.get(a):null,f=a!==null?l.get(a):null,g=i!==null?d.get(i):null,p=a!==null?o.get(a):null,b=i!==null?s.get(i):null;return{row:i,column:a,modelRow:m??null,modelColumn:v??null,left:f??null,top:g??null,columnWidth:p??null,rowHeight:b??null}}static getColumnHeaderDepthAtY(e,t){var r=ae.getRowAtY(e,t),{columnHeaderHeight:i,columnHeaderMaxDepth:a}=t;if(r===null&&e<=i*a)return Le(a-Math.ceil(e/i),0,a-1)}static iterateFloatingStart(e,t,r){for(var i=0;i<e&&i<t;i+=1){var a=r(i);if(a!==void 0)return a}}static iterateFloatingEnd(e,t,r){for(var i=0;i<e&&t-(e-i)>=0;i+=1){var a=r(t-(e-i));if(a!==void 0)return a}}static iterateFloating(e,t,r,i){var a=ae.iterateFloatingStart(e,r,i);return a!==void 0?a:ae.iterateFloatingEnd(t,r,i)}static iterateAllItems(e,t,r,i,a,o){var s=Math.max(e,r),l=Math.min(t,a-i-1),d=ae.iterateFloating(r,i,a,o);if(d!==void 0)return d;for(var u=s;u<=l;u+=1)if(d=o(u),d!==void 0)return d}static isInItem(e,t,r,i){var a,o,s=(a=t.get(e))!==null&&a!==void 0?a:0,l=(o=r.get(e))!==null&&o!==void 0?o:0;return s<=i&&i<=s+l}static getItemAtOffset(e,t,r,i,a,o,s){var l=arguments.length>7&&arguments[7]!==void 0?arguments[7]:!1,d=l?void 0:ae.iterateFloating(r,i,t,m=>{if(ae.isInItem(m,o,s,e))return m});if(!l&&d!==void 0)return d;for(var u=0;u<a.length;u+=1){var c=a[u];if(ae.isInItem(c,o,s,e))return c}return null}static getColumnAtX(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,{columnCount:i,floatingLeftColumnCount:a,floatingRightColumnCount:o,visibleColumns:s,allColumnXs:l,allColumnWidths:d,gridX:u}=t;return e<u?null:this.getItemAtOffset(e-u,i,a,o,s,l,d,r)}static getRowAtY(e,t){var{floatingTopRowCount:r,floatingBottomRowCount:i,rowCount:a,visibleRows:o,allRowYs:s,allRowHeights:l,gridY:d}=t;return e<d?null:this.getItemAtOffset(e-d,a,r,i,o,s,l)}static getNextShownItem(e,t,r,i){var a=r.findIndex(l=>l===e)||0;for(a-=1;a!=null&&a>=0;){var o=r[a],s=t.get(o);if(s!=null&&i.get(s)!==0)return o;a-=1}return null}static getNextShownColumn(e,t){var{modelColumns:r,visibleColumns:i,userColumnWidths:a}=t;return ae.getNextShownItem(e,r,i,a)}static getNextShownRow(e,t){var{modelRows:r,visibleRows:i,userRowHeights:a}=t;return ae.getNextShownItem(e,r,i,a)}static getColumnSeparatorIndex(e,t,r,i){var{rowHeaderWidth:a,columnHeaderHeight:o,floatingColumns:s,floatingLeftWidth:l,visibleColumns:d,allColumnXs:u,allColumnWidths:c,columnHeaderMaxDepth:m}=r,{allowColumnResize:v,headerSeparatorHandleSize:f}=i;if(m*o<t||!v||f<=0)return null;for(var g=e-a,p=f*.5,b=!1,S=s.length-1;S>=0;S-=1){var C,y,E=s[S],T=(C=u.get(E))!==null&&C!==void 0?C:0,O=(y=c.get(E))!==null&&y!==void 0?y:0,N=O===0;if(!b||!N){var P=T+O;N?P+=p:b&&(P-=p);var R=P-p,A=P+p;if(R<=g&&g<=A)return E;b=N}}b=!1;for(var M=d.length-1;M>=0;M-=1){var I,x,_=d[M],k=(I=u.get(_))!==null&&I!==void 0?I:0,U=(x=c.get(_))!==null&&x!==void 0?x:0,G=U===0;if(k<l-U)return null;if(!b||!G){var Y=k+U;G?Y+=p:b&&(Y-=p);var Z=Y-p,$=Y+p;if(Z<=g&&g<=$)return _;b=G}}return null}static isItemHidden(e,t){return t.get(e)===0}static isColumnHidden(e,t){var{allColumnWidths:r}=t;return ae.isItemHidden(e,r)}static isFloatingRow(e,t){if(e==null)return!1;var{floatingTopRowCount:r,floatingBottomRowCount:i,rowCount:a}=t;return e<r||e>=a-i}static isFloatingColumn(e,t){if(e==null)return!1;var{floatingLeftColumnCount:r,floatingRightColumnCount:i,columnCount:a}=t;return e<r||e>=a-i}static getHiddenItems(e,t,r){if(!ae.isItemHidden(e,t))return[];for(var i=[e],a=r.findIndex(l=>l===e),o=a-1;o>=0;o-=1){var s=r[o];if(!ae.isItemHidden(s,t))break;i.push(s)}return i}static getHiddenColumns(e,t){var{visibleColumns:r,allColumnWidths:i}=t;return ae.getHiddenItems(e,i,r)}static getRowSeparatorIndex(e,t,r,i){var{rowHeaderWidth:a,columnHeaderHeight:o,visibleRows:s,allRowYs:l,allRowHeights:d}=r,{allowRowResize:u,headerSeparatorHandleSize:c}=i;if(a<e||!u||c<=0)return null;for(var m=t-o,v=c*.5,f=!1,g=s.length-1;g>=0;g-=1){var p,b,S=s[g],C=(p=l.get(S))!==null&&p!==void 0?p:0,y=(b=d.get(S))!==null&&b!==void 0?b:0,E=y===0;if(!f||!E){var T=C+y;E?T+=v:f&&(T-=v);var O=T-v,N=T+v;if(O<=m&&m<=N)return S;f=E}}return null}static isRowHidden(e,t){var{allRowHeights:r}=t;return ae.isItemHidden(e,r)}static getHiddenRows(e,t){var{visibleRows:r,allRowHeights:i}=t;return ae.getHiddenItems(e,i,r)}static moveItem(e,t,r){if(e===t)return[...r];var i=[...r],a=i[i.length-1];return a!=null&&!fl(a.from)&&a.to===e?a.from===t?i.pop():i[i.length-1]=gl(gl({},a),{},{to:t}):i.push({from:e,to:t}),i}static moveRange(e,t,r){var i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(e[0]===e[1])return ae.moveItem(e[0],t,r);var a=t;if(i&&e[0]<t&&(a-=e[1]-e[0]),e[0]===a)return[...r];var o=[...r],s=o[o.length-1];s!=null&&fl(s.from)&&s.from[1]-s.from[0]===e[1]-e[0]&&s.to===e[0]?o[o.length-1]=gl(gl({},s),{},{to:a}):o.push({from:e,to:a});var l=o[o.length-1];return fl(l.from)&&l.from[0]===l.to&&o.pop(),o}static moveItemOrRange(e,t,r){var i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;return Array.isArray(e)?ae.moveRange(e,t,r,i):ae.moveItem(e,t,r)}static applyItemMoves(e,t,r){for(var i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1,a=[[e,t]],o=function(){var{from:d,to:u}=r[s],c=1,m;fl(d)?(c=d[1]-d[0]+1,[m]=d):m=d;for(var v=i?u:m,f=v+c-1,g=i?m:u,p=g-v,b=[],S=function(){var E,T,O=(E=a[C][0])!==null&&E!==void 0?E:Number.NEGATIVE_INFINITY,N=(T=a[C][1])!==null&&T!==void 0?T:Number.POSITIVE_INFINITY,P,R=[[O,v-1],[v,f],[f+1,N]].map(A=>{var[M,I]=A;return[Math.max(M,O),Math.min(I,N)]}).filter(A=>{var[M,I]=A;return M<=I}).map(A=>{var[M,I]=A;return v<=M&&f>=I?(P=[M+p,I+p],P):f<M?[M-c,I-c]:A}).map(A=>{var[M,I]=A;return g>M&&g<=I?[[M,g-1],[g+c,I+c]]:A===P?[A]:g<=M?[[M+c,I+c]]:[A]}).flat();b.push(...R)},C=0;C<a.length;C+=1)S();a=b.map(y=>{var[E,T]=y;return[Number.isFinite(E)?E:null,Number.isFinite(T)?T:null]})},s=i?r.length-1:0;i?s>=0:s<r.length;i?s-=1:s+=1)o();return a}static translateRange(e,t,r,i){for(var a=ae.applyItemMoves(e.startColumn,e.endColumn,t,i),o=ae.applyItemMoves(e.startRow,e.endRow,r,i),s=[],l=0;l<a.length;l+=1)for(var d=a[l],u=0;u<o.length;u+=1){var c=o[u];s.push(new Q(d[0],c[0],d[1],c[1]))}return s}static getModelIndex(e,t){var r=ae.applyItemMoves(e,e,t,!0)[0][0];return r}static getModelIndexes(e,t){return e.map(r=>ae.getModelIndex(r,t))}static getModelRangeIndexes(e,t,r){return ae.applyItemMoves(e,t,r,!0)}static getModelRange(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Te,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Te;return ae.translateRange(e,t,r,!0)}static getModelRanges(e){for(var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Te,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Te,i=[],a=0;a<e.length;a+=1)i.push(...ae.getModelRange(e[a],t,r));return i}static getVisibleRangeIndexes(e,t,r){return ae.applyItemMoves(e,t,r,!1)}static getVisibleRange(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Te,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Te;return this.translateRange(e,t,r,!1)}static getVisibleRanges(e){for(var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Te,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Te,i=[],a=0;a<e.length;a+=1)i.push(...ae.getVisibleRange(e[a],t,r));return i}static getVisibleIndex(e,t){var r=ae.applyItemMoves(e,e,t)[0][0];return r}static getVisibleIndexes(e,t){return e.map(r=>ae.getVisibleIndex(r,t))}static isMacPlatform(){var{platform:e}=window.navigator;return e.startsWith("Mac")}static getModifierKey(){return ae.isMacPlatform()?"metaKey":"ctrlKey"}static isModifierKeyDown(e){var t=ae.getModifierKey();return e[t]}static checkColumnHidden(e,t){return t.get(e)===0}static checkAllColumnsHidden(e,t){return t.size===0?!1:e.every(r=>t.get(r)===0)}static getScrollDragBounds(e,t,r){var{gridX:i,gridY:a,width:o,height:s,floatingTopRowCount:l,floatingBottomRowCount:d,floatingLeftColumnCount:u,floatingRightColumnCount:c,floatingLeftWidth:m,floatingRightWidth:v,floatingTopHeight:f,floatingBottomHeight:g,columnCount:p,rowCount:b}=e,S=i,C=a,y=o,E=s;return r!=null&&(r>u&&(S+=m),r<p-c&&(y-=v)),t!=null&&(t>l&&(C+=f),t<b-d&&(E-=g)),{x1:S,y1:C,x2:y,y2:E}}static getScrollDelta(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1024,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:768,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:20,a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:20,{deltaX:o,deltaY:s}=e;return!ae.isMacPlatform()&&e.shiftKey&&e.deltaX===0&&e.deltaY!==0&&(o=e.deltaY,s=e.deltaX),(e==null?void 0:e.deltaMode)===WheelEvent.DOM_DELTA_PAGE?(o*=t,s*=r):(e==null?void 0:e.deltaMode)===WheelEvent.DOM_DELTA_LINE&&(ae.isMacPlatform()?(o=Math.round(o*i),s=Math.round(s*a)):(o=Math.round(o*this.PIXELS_PER_LINE),s=Math.round(s*this.PIXELS_PER_LINE))),{deltaX:o,deltaY:s}}static compareRanges(e,t){return e[0]==null||e[1]==null||t[0]==null||t[1]==null?0:e[0]!==t[0]?e[0]-t[0]:e[1]-t[1]}static mergeSortedRanges(e){for(var t=[],r=0;r<e.length;r+=1){var i=e[r],a=i[0],o=i[1];r===0?t.push([a,o]):a-1<=t[t.length-1][1]?t[t.length-1][1]=Math.max(t[t.length-1][1],o):t.push([a,o])}return t}static translateTokenBox(e,t){var{x1:r,y1:i,x2:a,y2:o}=e,{gridX:s,gridY:l,width:d,height:u,verticalBarWidth:c,horizontalBarHeight:m}=t,v=Le(s+r,s,d-c),f=Le(s+a,s,d-c),g=Le(l+i,l,u-m),p=Le(l+o,l,u-m);return{x1:v,y1:g,x2:f,y2:p,token:e.token}}static getTextRenderMetrics(e,t,r){var{metrics:i,model:a,theme:o}=e,{firstColumn:s,allColumnXs:l,allColumnWidths:d,allRowYs:u,allRowHeights:c,modelRows:m,modelColumns:v}=i,{cellHorizontalPadding:f,treeDepthIndent:g,treeHorizontalPadding:p}=o,b=B(m,r),S=B(v,t),C=a.textAlignForCell(S,b),y=B(l,t),E=B(u,r),T=B(d,t),O=B(c,r),N=t===s,P=0;Ke(a)&&a.hasExpandableRows&&N&&(P=g*(a.depthForRow(r)+1)+p);var R=T-P,A=y+f,M=E+O*.5;return C==="right"?A=y+R-f:C==="center"&&(A=y+R*.5),A+=P,{width:R-f*2,x:A,y:M}}static findTokensWithProtocolInText(e){var t=pb(e);return t.filter(r=>r.type==="url"?/^https?:\/\//.test(r.value):!0)}}GC(ae,"PIXELS_PER_LINE",100/3);const me=ae;function Rr(n,e,t){return e=mI(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function mI(n){var e=vI(n,"string");return typeof e=="symbol"?e:String(e)}function vI(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function pl(n){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Ha.CACHE_SIZE,t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Math.floor(e/2);if(n.size>e)for(var r=n.keys();n.size>t;)n.delete(r.next().value)}function Kv(n,e,t,r,i){for(var a=new Map,o=0,s=0;s<n&&s<t;s+=1)a.set(s,o),o+=B(i,s);o=r;for(var l=0;l<e&&t-l-1>=0;l+=1)o-=B(i,t-l-1),a.set(t-l-1,o);return a}class Ha{constructor(){var{userColumnWidths:e=new Map,userRowHeights:t=new Map,calculatedColumnWidths:r=new Map,calculatedRowHeights:i=new Map,fontWidths:a=new Map,modelRows:o=new Map,modelColumns:s=new Map,movedRows:l=[],movedColumns:d=[],initialRowHeights:u=new Map,initialColumnWidths:c=new Map}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Rr(this,"initialRowHeights",void 0),Rr(this,"initialColumnWidths",void 0),Rr(this,"userColumnWidths",void 0),Rr(this,"userRowHeights",void 0),Rr(this,"calculatedColumnWidths",void 0),Rr(this,"calculatedRowHeights",void 0),Rr(this,"fontWidths",void 0),Rr(this,"modelRows",void 0),Rr(this,"modelColumns",void 0),Rr(this,"movedRows",void 0),Rr(this,"movedColumns",void 0),this.userColumnWidths=e,this.userRowHeights=t,this.calculatedRowHeights=i,this.calculatedColumnWidths=r,this.fontWidths=a,this.modelRows=o,this.modelColumns=s,this.movedRows=l,this.movedColumns=d,this.initialRowHeights=u,this.initialColumnWidths=c}getMetrics(e){var{left:t,top:r,leftOffset:i,topOffset:a,width:o,height:s,theme:l,model:d,movedRows:u,movedColumns:c,draggingColumn:m}=e,{rowHeight:v,rowHeaderWidth:f,rowFooterWidth:g,columnWidth:p,columnHeaderHeight:b,minScrollHandleSize:S,scrollBarSize:C}=l;u!==this.movedRows&&(this.movedRows=u,this.modelRows.clear()),c!==this.movedColumns&&(this.movedColumns=c,this.modelColumns.clear());var{columnCount:y,rowCount:E,floatingTopRowCount:T,floatingBottomRowCount:O,floatingLeftColumnCount:N,floatingRightColumnCount:P,columnHeaderMaxDepth:R}=d,A=this.getFirstRow(e),M=this.getFirstColumn(e),I=this.getGridX(e),x=this.getGridY(e),_=Ke(d)&&d.hasExpandableRows?this.calculateTreePaddingX(e):0,k=0,U=this.getVisibleRowHeights(e),G=this.getVisibleColumnWidths(e,M,_),Y=Array.from(U.keys()),Z=Array.from(G.keys()),$=new Map([...U,...this.getFloatingRowHeights(e)]),D=new Map([...G,...this.getFloatingColumnWidths(e)]),L=this.getVisibleColumnXs(D,Z,i),H=this.getVisibleRowYs($,Y,a),z=Y.length>0?Y[Y.length-1]:r,te=Z.length>0?Z[Z.length-1]:t,W=this.getBottomViewport(e,Y,H,$),ne=this.getRightViewport(e,Z,L,D),re=this.getFloatingTopHeight(e,$),se=this.getFloatingBottomHeight(e,$),Ce=this.getFloatingLeftWidth(e,D),Me=this.getFloatingRightWidth(e,D),rt=Array.from(D.values()),nt=Array.from($.values()),Xe=rt.reduce((Rn,ma)=>Rn+ma,0)-i,ft=nt.reduce((Rn,ma)=>Rn+ma,0)-a,Nt=i+Xe+g,He=a+ft,Rt=o-I,xt=s-x,Ur=this.getLastLeft(e,null,Rt-g),Er=this.getLastLeft(e,null,Rt-g-C),Qn=this.getLastTop(e,null,xt-se),dn=this.getLastTop(e,null,xt-se-C),Tr=Er,it=dn;Ur===0&&Qn===0&&(Tr=0,it=0);var Jt=Tr>0,Vr=Jt?C:0,Pr=it>0,Gr=Pr?C:0,yi=I,Wr=R*b,zr=o-yi-Gr,hr=s-Wr-Vr,Zn=y===1?zr/Nt:(y-Tr)/y,Jn=E===1?hr/He:(E-it)/E,ei=Jt?Le(zr*Zn,S,zr-1):0,Or=Pr?Le(hr*Jn,S,hr-1):0,un=B(D,t,0),Ei=B($,r,0),ua=un>0?i/un:0,Lo=Ei>0?a/Ei:0,ko=y===1?i/(Nt-Rt):(t+ua)/Tr,jo=E===1?a/(He-xt):(r+Lo)/it,$o=Jt?ko*(zr-ei):0,at=Pr?jo*(hr-Or):0,Qs=[...Array(T).keys(),...[...Array(O).keys()].map(Rn=>E-Rn-1)],ha=new Map([...H,...this.getFloatingRowYs(e,$,Math.floor(s-x-Vr))]),Ti=[...Array(N).keys(),...[...Array(P).keys()].map(Rn=>y-Rn-1)],ca=new Map([...L,...this.getFloatingColumnXs(e,D,Math.floor(o-I-Gr))]),Ho=[];if(m)for(var Nn=m.range[0];Nn<=m.range[1];Nn+=1)Ho.push(Nn),D.has(Nn)||D.set(Nn,this.getVisibleColumnWidth(Nn,e)),ca.has(Nn)||ca.set(Nn,0);var Zs=Y.concat(Qs),Js=Z.concat(Ti).concat(Ho),Bo=this.getModelRows(Zs,e),el=this.getModelColumns(Js,e),hu=this.getVisibleRowTreeBoxes($,Bo,e),tl=this.getTopVisible(e,ha,$,Y),rl=this.getLeftVisible(e,ca,D,Z),cu=it>0?this.getBottomVisible(e,ha,$,Y,x):z,mu=Tr>0?this.getRightVisible(e,ca,D,Z,I):te,{fontWidths:vu,userColumnWidths:fu,userRowHeights:gu,calculatedRowHeights:pu,calculatedColumnWidths:nl}=this;return{rowHeight:v,rowHeaderWidth:f,rowFooterWidth:g,rowCount:E,columnWidth:p,columnCount:y,columnHeaderHeight:b,floatingTopRowCount:T,floatingBottomRowCount:O,floatingLeftColumnCount:N,floatingRightColumnCount:P,gridX:I,gridY:x,firstRow:A,firstColumn:M,treePaddingX:_,treePaddingY:k,left:t,top:r,bottom:z,right:te,topOffset:a,leftOffset:i,topVisible:tl,leftVisible:rl,bottomVisible:cu,rightVisible:mu,bottomViewport:W,rightViewport:ne,width:o,height:s,maxX:Xe,maxY:ft,lastLeft:Tr,lastTop:it,barHeight:hr,barTop:Wr,barWidth:zr,barLeft:yi,handleHeight:Or,handleWidth:ei,hasHorizontalBar:Jt,hasVerticalBar:Pr,verticalBarWidth:Gr,horizontalBarHeight:Vr,scrollX:$o,scrollY:at,scrollableContentWidth:Nt,scrollableContentHeight:He,scrollableViewportWidth:Rt,scrollableViewportHeight:xt,visibleRows:Y,visibleColumns:Z,visibleRowHeights:U,visibleColumnWidths:G,floatingRows:Qs,floatingColumns:Ti,allRows:Zs,allColumns:Js,allRowHeights:$,allColumnWidths:D,floatingTopHeight:re,floatingBottomHeight:se,floatingLeftWidth:Ce,floatingRightWidth:Me,visibleRowYs:H,visibleColumnXs:L,allRowYs:ha,allColumnXs:ca,visibleRowTreeBoxes:hu,modelRows:Bo,modelColumns:el,movedRows:u,movedColumns:c,fontWidths:vu,userColumnWidths:fu,userRowHeights:gu,calculatedRowHeights:pu,calculatedColumnWidths:nl,columnHeaderMaxDepth:R}}getGridX(e){var{theme:t}=e,{rowHeaderWidth:r}=t;return r}getGridY(e){var{theme:t,model:r}=e,{columnHeaderHeight:i}=t,{columnHeaderMaxDepth:a}=r;return a*i}getVisibleHeight(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.getFloatingRowHeights(e),{height:r,theme:i}=e,{scrollBarSize:a}=i,o=this.getGridY(e),s=this.getFloatingBottomHeight(e,t),l=this.getFloatingTopHeight(e,t);return r-s-l-o-a}getVisibleWidth(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.getFloatingColumnWidths(e),{width:r,theme:i}=e,{scrollBarSize:a,rowFooterWidth:o}=i,s=this.getGridX(e),l=this.getFloatingRightWidth(e,t),d=this.getFloatingLeftWidth(e,t);return r-d-l-s-a-o}getFirstIndex(e,t,r){for(var i=e.size+1,a=0;a<i;a+=1){var o=t(a,r);if(e.get(o)!==0)return a}return 0}getFirstColumn(e){return this.getFirstIndex(this.userColumnWidths,this.getModelColumn.bind(this),e)}getFirstRow(e){return this.getFirstIndex(this.userRowHeights,this.getModelRow.bind(this),e)}getLastLeft(e,t,r){var{model:i}=e,{columnCount:a,floatingRightColumnCount:o}=i,s=Math.max(0,a-o-1);t!=null&&(s=t);for(var l=0;s>=0;){var d=this.getVisibleColumnWidth(s,e);if(l+=d,l>=r)return Le(s+1,0,t??a-1);s-=1}return 0}getLastTop(e,t,r){var{model:i}=e,{rowCount:a,floatingBottomRowCount:o}=i,s=Math.max(0,a-o-1);t!=null&&(s=t);for(var l=0;s>=0;){var d=this.getVisibleRowHeight(s,e);if(l+=d,l>=r)return Le(s+1,0,a-1);s-=1}return 0}getTopForTopVisible(e,t){for(var r=this.getFloatingTopHeight(e),i=t,a=0;i>0&&a<r;)i-=1,a+=this.getVisibleRowHeight(i,e);return i}getTopForBottomVisible(e,t){var{height:r}=e,i=this.getGridY(e),a=this.getFloatingBottomHeight(e),o=r-i-a;return this.getLastTop(e,t,o)}getLeftForLeftVisible(e,t){for(var r=this.getFloatingLeftWidth(e),i=t,a=0;i>0&&a<r;)i-=1,a+=this.getVisibleColumnWidth(i,e);return i}getLeftForRightVisible(e,t){var{width:r}=e,i=this.getGridX(e),a=this.getFloatingRightWidth(e),o=r-i-a;return this.getLastLeft(e,t,o)}getFloatingRowHeights(e){for(var{model:t}=e,{floatingTopRowCount:r,floatingBottomRowCount:i,rowCount:a}=t,o=new Map,s=0;s<r&&s<a;s+=1)o.set(s,this.getVisibleRowHeight(s,e));for(var l=0;l<i&&a-l-1>=0;l+=1){var d=a-l-1;o.set(d,this.getVisibleRowHeight(d,e))}return o}getVisibleRowHeights(e){for(var{top:t,topOffset:r,height:i,model:a}=e,o=0,s=t,l=new Map,{rowCount:d}=a;o<i+r&&s<d;){var u=this.getVisibleRowHeight(s,e);l.set(s,u),o+=u,s+=1}return l}getFloatingColumnWidths(e){for(var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.getFirstColumn(e),r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.calculateTreePaddingX(e),{model:i}=e,{columnCount:a,floatingLeftColumnCount:o,floatingRightColumnCount:s}=i,l=new Map,d=0;d<o&&d<a;d+=1)l.set(d,this.getVisibleColumnWidth(d,e,t,r));for(var u=0;u<s&&a-u-1>=0;u+=1){var c=a-u-1;l.set(c,this.getVisibleColumnWidth(c,e,t,r))}return l}getVisibleColumnWidths(e){for(var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.getFirstColumn(e),r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.calculateTreePaddingX(e),{left:i,leftOffset:a,width:o,model:s}=e,l=0,d=i,u=new Map,{columnCount:c}=s;l<o+a&&d<c;){var m=this.getVisibleColumnWidth(d,e,t,r);u.set(d,m),l+=m,d+=1}return u}getFloatingColumnXs(e,t,r){var{model:i}=e,{columnCount:a,floatingLeftColumnCount:o,floatingRightColumnCount:s}=i;return Kv(o,s,a,r,t)}getVisibleColumnXs(e,t,r){for(var i=new Map,a=-r,o=0;o<t.length;o+=1){var s=t[o],l=B(e,s);i.set(s,a),a+=l}return i}getFloatingRowYs(e,t,r){var{model:i}=e,{floatingTopRowCount:a,floatingBottomRowCount:o,rowCount:s}=i;return Kv(a,o,s,r,t)}getVisibleRowYs(e,t,r){for(var i=new Map,a=-r,o=0;o<t.length;o+=1){var s=t[o],l=B(e,s);i.set(s,a),a+=l}return i}getVisibleRowTreeBoxes(e,t,r){var i=new Map,{model:a,theme:o}=r,{treeDepthIndent:s,treeHorizontalPadding:l}=o;return Ke(a)&&a.hasExpandableRows&&e.forEach((d,u)=>{var c=B(t,u);if(a.isRowExpandable(c)){var m=a.depthForRow(c),v=m*s+l,f=(m+1)*s+l,g=0,p=d;i.set(u,{x1:v,y1:g,x2:f,y2:p})}}),i}getFloatingLeftWidth(e){for(var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.getFloatingColumnWidths(e),{model:r}=e,{floatingLeftColumnCount:i}=r,a=0,o=0;o<i;o+=1)a+=B(t,o);return a}getFloatingRightWidth(e){for(var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.getFloatingColumnWidths(e),{model:r}=e,{floatingRightColumnCount:i,columnCount:a}=r,o=0,s=0;s<i;s+=1)o+=B(t,a-s-1);return o}getFloatingTopHeight(e){for(var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.getFloatingRowHeights(e),{model:r}=e,{floatingTopRowCount:i}=r,a=0,o=0;o<i;o+=1)a+=B(t,o);return a}getFloatingBottomHeight(e){for(var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.getFloatingRowHeights(e),{model:r}=e,{floatingBottomRowCount:i,rowCount:a}=r,o=0,s=0;s<i;s+=1)o+=B(t,a-s-1);return o}getTopVisible(e,t,r,i){for(var a=this.getFloatingTopHeight(e,r),o=0;o<i.length;o+=1){var s=i[o],l=B(t,s);if(l>=a)return s}return 0}getLeftVisible(e,t,r,i){for(var a=this.getFloatingLeftWidth(e,r),o=0;o<i.length;o+=1){var s=i[o],l=B(t,s);if(l>=a)return s}return 0}getBottomVisible(e,t,r,i,a){for(var{height:o,theme:s}=e,{scrollBarSize:l}=s,d=this.getFloatingBottomHeight(e,r),u=o-a-l-d,c=i.length-1;c>=0;c-=1){var m=i[c],v=B(t,m),f=B(r,m);if(v+f<=u)return m}return 0}getRightVisible(e,t,r,i,a){for(var{width:o,theme:s}=e,{scrollBarSize:l}=s,d=this.getFloatingRightWidth(e,r),u=o-a-l-d,c=i.length-1;c>=0;c-=1){var m=i[c],v=B(t,m),f=B(r,m);if(v+f<=u)return m}return 0}getBottomViewport(e,t,r,i){var{height:a,theme:o}=e,{rowHeight:s}=o;return this.getLastIndexViewport(t,r,i,a,s)}getRightViewport(e,t,r,i){var{width:a,theme:o}=e,{columnWidth:s}=o;return this.getLastIndexViewport(t,r,i,a,s)}getLastIndexViewport(e,t,r,i,a){var o=0,s=0;return e.length>0&&(o=e[e.length-1],s=B(t,o)+B(r,o)),s<i&&(o+=Math.ceil((i-s)/a)),o}getVisibleItemSize(e,t,r){var i;return(i=t.get(e))!==null&&i!==void 0?i:r()}getVisibleRowHeight(e,t){var r=this.getModelRow(e,t),i=this.calculateRowHeight(e,r,t);return this.getVisibleItemSize(r,this.userRowHeights,()=>{var a=this.initialRowHeights.get(r);return a!==void 0?a:i})}getVisibleColumnWidth(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.getFirstColumn(t),i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:this.calculateTreePaddingX(t),a=this.getModelColumn(e,t),o=this.calculateColumnWidth(e,a,t,r,i);return this.getVisibleItemSize(a,this.userColumnWidths,()=>{var s=this.initialColumnWidths.get(a);return s!==void 0?s:o})}getModelRows(e,t){for(var r=new Map,i=0;i<e.length;i+=1){var a=e[i],o=this.getModelRow(a,t);r.set(a,o)}return r}getModelRow(e,t){if(this.modelRows.has(e))return B(this.modelRows,e);var{movedRows:r}=t,i=me.getModelIndex(e,r);return this.modelRows.set(e,i),i}getModelColumns(e,t){for(var r=new Map,i=0;i<e.length;i+=1){var a=e[i],o=this.getModelColumn(a,t);r.set(a,o)}return r}getModelColumn(e,t){var r=this.modelColumns.has(e);if(r)return B(this.modelColumns,e);var{movedColumns:i}=t,a=me.getModelIndex(e,i);return this.modelColumns.set(e,a),a}calculateRowHeight(e,t,r){var{theme:i}=r,{autoSizeRows:a,rowHeight:o}=i;if(!a)return o;var s=this.calculatedRowHeights.get(t);return s??(this.calculatedRowHeights.set(t,Math.ceil(o)),pl(this.calculatedRowHeights),o)}calculateColumnWidth(e,t,r){var i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:this.getFirstColumn(r),a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:this.calculateTreePaddingX(r),{theme:o}=r,{autoSizeColumns:s,minColumnWidth:l,maxColumnWidth:d}=o;if(!s){var{columnWidth:u}=o;return u}var c=this.calculateColumnHeaderWidth(t,r),m=this.calculateColumnDataWidth(t,r),v=this.calculatedColumnWidths.get(t),f=Math.ceil(Math.max(c,m));return f=Math.max(l,f),f=Math.min(d,f),v!=null&&v>f?f=v:(this.calculatedColumnWidths.set(t,f),pl(this.calculatedColumnWidths)),e===i&&(f+=a),f}calculateColumnHeaderWidth(e,t){var{model:r,theme:i}=t,{headerFont:a,headerHorizontalPadding:o}=i,s=r.textForColumnHeader(e,0);if(s!==void 0&&s!==""){var l=this.getWidthForFont(a,t);return s.length*l+o*2}return o*2}calculateColumnDataWidth(e,t){var{top:r,height:i,width:a,model:o,theme:s}=t,{floatingTopRowCount:l,floatingBottomRowCount:d,rowCount:u}=o,{font:c,cellHorizontalPadding:m,rowHeight:v,rowHeaderWidth:f,rowFooterWidth:g,scrollBarSize:p,dataBarHorizontalPadding:b}=s,S=0,C=this.getWidthForFont(c,t),y=i/v,E=Math.ceil(r+y);return me.iterateAllItems(r,E,l,d,u,T=>{var O=this.getModelRow(T,t),N=o.textForCell(e,O),P=o.renderTypeForCell(e,O),R=0;if(N){var A=m*2;R=N.length*C+A}P==="dataBar"&&(R+=b),S=Math.max(S,R)}),S=Math.max(Math.min(S,(a-f-p-g)*Ha.MAX_COLUMN_WIDTH),m*2),S}calculateTreePaddingX(e){var{top:t,height:r,model:i,theme:a}=e,{rowHeight:o,treeDepthIndent:s}=a;if(!Ke(i)||!i.hasExpandableRows)return 0;for(var l=0,d=r/o,u=Math.ceil(t+d),c=t;c<=u;c+=1){var m=this.getModelRow(c,e),v=i.depthForRow(m);l=Math.max(l,s*(v+1))}return l}getWidthForFont(e,t){if(this.fontWidths.has(e))return B(this.fontWidths,e);var{context:r}=t;r.font=e;var i=r.measureText("8"),{width:a}=i;return this.fontWidths.set(e,a),this.fontWidths.set(r.font,a),a}setColumnWidth(e,t){var r=new Map(this.userColumnWidths);r.set(e,Math.ceil(t)),pl(r),this.userColumnWidths=r}resetColumnWidth(e){var t=new Map(this.userColumnWidths);t.delete(e),this.userColumnWidths=t}setRowHeight(e,t){var r=new Map(this.userRowHeights);r.set(e,Math.ceil(t)),pl(r),this.userRowHeights=r}resetRowHeight(e){var t=new Map(this.userRowHeights);t.delete(e),this.userRowHeights=t,this.calculatedRowHeights.delete(e)}}Rr(Ha,"CACHE_SIZE",1e4);Rr(Ha,"MAX_COLUMN_WIDTH",.8);var fI=Object.freeze({allowColumnResize:!0,allowRowResize:!0,autoSelectRow:!1,autoSelectColumn:!1,autoSizeColumns:!0,autoSizeRows:!0,backgroundColor:"#000000",black:"#000000",white:"#ffffff",cellHorizontalPadding:5,headerHorizontalPadding:5,font:"12px Arial, sans-serif",gridColumnColor:"#8f8f8f66",gridRowColor:"#8f8f8f66",headerBackgroundColor:"#222222",headerSeparatorColor:"#000000",headerSeparatorHoverColor:"#888888",headerSeparatorHandleSize:5,headerHiddenSeparatorSize:5,headerHiddenSeparatorHoverColor:"#8888FF",headerColor:"#d5d5d5",headerFont:"10px Arial, sans-serif",columnHoverBackgroundColor:"#444444",selectedColumnHoverBackgroundColor:"#494949",rowBackgroundColors:"#333333 #222222",rowHoverBackgroundColor:"#444444",selectedRowHoverBackgroundColor:"#494949",minScrollHandleSize:50,scrollBarBackgroundColor:"#111111",scrollBarHoverBackgroundColor:"#333333",scrollBarCasingColor:"#000000",scrollBarCornerColor:"#000000",scrollBarColor:"#555555",scrollBarHoverColor:"#888888",scrollBarActiveColor:"#AAAAAA",scrollBarSize:12,scrollBarHoverSize:16,scrollBarCasingWidth:1,scrollSnapToColumn:!1,scrollSnapToRow:!1,selectionColor:"#4286f433",selectionOutlineColor:"#4286f4",selectionOutlineCasingColor:"#222222",scrollBarSelectionTick:!0,scrollBarSelectionTickColor:"#4286f433",scrollBarActiveSelectionTickColor:"#4286f480",shadowBlur:8,shadowAlpha:.15,shadowColor:"#000000",textColor:"#ffffff",hyperlinkColor:"#4878ea",maxDepth:6,treeDepthIndent:10,treeHorizontalPadding:5,treeLineColor:"#888888",treeMarkerColor:"#cccccc",treeMarkerHoverColor:"#ffffff",rowHeight:20,columnWidth:100,minRowHeight:20,minColumnWidth:55,maxColumnWidth:600,columnHeaderHeight:20,rowHeaderWidth:30,rowFooterWidth:0,headerResizeSnapThreshold:10,headerResizeHiddenSnapThreshold:8,allowColumnReorder:!0,allowRowReorder:!0,reorderOffset:2,floatingGridColumnColor:"#8f8f8f66",floatingGridRowColor:"#8f8f8f66",floatingRowBackgroundColors:"#393939 #292929",floatingDividerOuterColor:"#000000",floatingDividerInnerColor:"#cccccc",zeroLineColor:"#888888",positiveBarColor:"#00ff00",negativeBarColor:"#ff0000",markerBarColor:"#ffffff",dataBarHorizontalPadding:90});const WC=fI;function qv(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function Yv(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?qv(Object(t),!0).forEach(function(r){gI(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):qv(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function gI(n,e,t){return e=pI(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function pI(n){var e=bI(n,"string");return typeof e=="symbol"?e:String(e)}function bI(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var CI=(n,e)=>{var t=!1,r=Se(n,Yv(Yv({},e),{},{dispose:()=>{t||(t=!0,r.clear(),t=!1)}}));return r};const On=CI;function SI(n,e){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:6,r=dh.hex.lab.raw(n),i=r[0]<50?17:10;return r[0]=Math.max(r[0]-i/t*e,0),"#".concat(dh.lab.hex(r))}function wI(n,e){var[t,r,i]=dh.hex.rgb(n);return"rgba(".concat(t,", ").concat(r,", ").concat(i,", ").concat(e,")")}var yI=n=>{var{r:e,g:t,b:r}=n,i=.4122214708*e+.5363325363*t+.0514459929*r,a=.2119034982*e+.6806995451*t+.1073969566*r,o=.0883024619*e+.2817188376*t+.6299787005*r,s=Math.cbrt(i),l=Math.cbrt(a),d=Math.cbrt(o);return{L:.2104542553*s+.793617785*l-.0040720468*d,a:1.9779984951*s-2.428592205*l+.4505937099*d,b:.0259040371*s+.7827717662*l-.808675766*d}},EI=n=>{var{L:e,a:t,b:r}=n,i=e+.3963377774*t+.2158037573*r,a=e-.1055613458*t-.0638541728*r,o=e-.0894841775*t-1.291485548*r,s=i*i*i,l=a*a*a,d=o*o*o;return{r:Le(4.0767416621*s-3.3077115913*l+.2309699292*d,0,255),g:Le(-1.2684380046*s+2.6097574011*l-.3413193965*d,0,255),b:Le(-.0041960863*s-.7034186147*l+1.707614701*d,0,255)}},TI=n=>{var e,t,r=(e=(t=n.replace(/^#?([a-f\d])([a-f\d])([a-f\d])$/i,(i,a,o,s)=>"#".concat(a).concat(a).concat(o).concat(o).concat(s).concat(s)).substring(1).match(/.{2}/g))===null||t===void 0?void 0:t.map(i=>parseInt(i,16)))!==null&&e!==void 0?e:[0,0,0];return{r:r[0],g:r[1],b:r[2]}},PI=n=>{var e=Math.round(n.r),t=Math.round(n.g),r=Math.round(n.b);return"#".concat([e,t,r].map(i=>{var a=i.toString(16);return a.length===1?"0".concat(a):a}).join(""))},OI=(n,e,t)=>{var{L:r,a:i,b:a}=n,{L:o,a:s,b:l}=e,d=r+(o-r)*t,u=i+(s-i)*t,c=a+(l-a)*t;return{L:d,a:u,b:c}};const ya={colorWithAlpha:wI,darkenForDepth:SI,linearSRGBToOklab:yI,OklabToLinearSRGB:EI,hexToRgb:TI,rgbToHex:PI,lerpColor:OI};function Xv(n,e,t){return e=DI(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function DI(n){var e=NI(n,"string");return typeof e=="symbol"?e:String(e)}function NI(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class yt{constructor(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:5e3;Xv(this,"order",void 0),Xv(this,"cursor",null),this.order=e}onDown(e,t,r){return!1}onMove(e,t,r){return!1}onDrag(e,t,r){return!1}onLeave(e,t,r){return!1}onClick(e,t,r){return!1}onContextMenu(e,t,r){return!1}onDoubleClick(e,t,r){return!1}onUp(e,t,r){return!1}onWheel(e,t,r){return!1}}function Xo(n,e,t){return e=RI(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function RI(n){var e=II(n,"string");return typeof e=="symbol"?e:String(e)}function II(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class FI extends yt{constructor(){super(...arguments),Xo(this,"draggingIndex",void 0),Xo(this,"resizingItems",[]),Xo(this,"hiddenItems",[]),Xo(this,"targetSizes",new Map),Xo(this,"dragOffset",0)}onDown(e,t){var{metrics:r}=t,{model:i}=t.props,a=t.getTheme();if(!r)throw new Error("metrics not set");var o=this.getSeparator(e,r,i,a);if(o!=null){var s=o.index;return this.dragOffset=0,this.draggingIndex=s,this.resizingItems=[s],this.hiddenItems=this.getHiddenItems(s,r).reverse(),this.targetSizes.clear(),this.addTargetSize(r,s),this.updateCursor(r,s),this.updateSeparator(t,o),!0}return!1}onMove(e,t){var{metrics:r}=t,{model:i}=t.props,a=t.getTheme();if(!r)throw new Error("metrics not set");var o=this.getSeparator(e,r,i,a);return o!=null?(this.updateCursor(r,o.index),!0):!1}onDrag(e,t){if(this.draggingIndex==null)return!1;var r=e[this.pointProperty],{metricCalculator:i,metrics:a}=t;if(!a)throw new Error("metrics not set");for(var o=t.getTheme(),s=a[this.visibleOffsetProperty],l=a[this.marginProperty],d=a[this.calculatedSizesProperty],u=a[this.modelIndexesProperty],c=a[this.firstIndexProperty],m=a[this.treePaddingProperty],v=new Map,f=this.resizingItems[this.resizingItems.length-1];f!=null;){var g=B(s,f),p=r-l-g-this.dragOffset,b=B(u,f),S=this.targetSizes.get(b),C=this.resizingItems.length>1,y=this.hiddenItems.indexOf(f),E=B(d,b);f===c&&(E+=m);var T=p;if(Math.abs(p-E)<=o.headerResizeSnapThreshold?T=E:S!==void 0&&p>S&&(C&&y!==0||y>0)?T=S:p<=o.headerResizeHiddenSnapThreshold&&(T=0),v.set(b,T),p<-o.headerResizeSnapThreshold&&T===0)if(y>=0&&C){var O;this.resizingItems.pop(),this.removeTargetSize(a,f),f=this.resizingItems[this.resizingItems.length-1],this.dragOffset-=(O=this.targetSizes.get(B(u,f)))!==null&&O!==void 0?O:0}else f=this.getNextShownItem(f,a),f!==null&&(this.resizingItems.push(f),this.addTargetSize(a,f));else S!==void 0&&p>S+o.headerResizeSnapThreshold&&T===S?y>0?(this.dragOffset+=T,f=this.hiddenItems[y-1],this.resizingItems.push(f),this.addTargetSize(a,f)):C?(this.resizingItems.pop(),this.removeTargetSize(a,f),f=this.resizingItems[this.resizingItems.length-1]):f=null:f=null}return v.forEach((N,P)=>{var R,A=(R=i[this.initialSizesProperty].get(P))!==null&&R!==void 0?R:d.get(P);N===A?this.resetSize(i,P):this.setSize(i,P,N)}),this.updateCursor(a,this.draggingIndex),!0}onUp(e,t){return this.draggingIndex!=null&&(this.draggingIndex=void 0,this.resizingItems=[],this.hiddenItems=[],this.targetSizes.clear(),this.updateSeparator(t,null)),!1}onDoubleClick(e,t){var{metrics:r,metricCalculator:i}=t,{model:a}=t.props,o=t.getTheme();if(!r)throw new Error("metrics not set");var s=this.getSeparator(e,r,a,o);if(s!=null){var l=r[this.modelIndexesProperty],d=B(l,s.index),u=B(r[this.calculatedSizesProperty],d),c=i[this.initialSizesProperty].get(d);return u===c?this.resetSize(i,d):this.setSize(i,d,u),t.forceUpdate(),!0}return!1}updateCursor(e,t){var r=e[this.visibleSizesProperty],i=B(r,t);i===0?this.cursor=this.hiddenCursor:this.cursor=this.defaultCursor}addTargetSize(e,t){var r=e[this.modelIndexesProperty],i=e[this.userSizesProperty],a=e[this.calculatedSizesProperty],o=t===0?e[this.treePaddingProperty]:0,s=B(r,t),l=i.get(s);(l==null||l===0)&&(l=B(a,s)+o),this.targetSizes.set(s,l)}removeTargetSize(e,t){var r=e[this.modelIndexesProperty],i=B(r,t);this.targetSizes.delete(i)}}const zC=FI;function er(n,e,t){return e=_I(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function _I(n){var e=MI(n,"string");return typeof e=="symbol"?e:String(e)}function MI(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class Pc extends zC{constructor(){super(...arguments),er(this,"hiddenCursor","e-resize"),er(this,"defaultCursor","col-resize"),er(this,"pointProperty","x"),er(this,"userSizesProperty","userColumnWidths"),er(this,"visibleOffsetProperty","visibleColumnXs"),er(this,"visibleSizesProperty","visibleColumnWidths"),er(this,"marginProperty","rowHeaderWidth"),er(this,"calculatedSizesProperty","calculatedColumnWidths"),er(this,"initialSizesProperty","initialColumnWidths"),er(this,"modelIndexesProperty","modelColumns"),er(this,"firstIndexProperty","firstColumn"),er(this,"treePaddingProperty","treePaddingX"),er(this,"getHiddenItems",me.getHiddenColumns),er(this,"getNextShownItem",me.getNextShownColumn),er(this,"getSeparator",Pc.getColumnSeparator)}static getColumnSeparator(e,t,r,i){if(!i.allowColumnResize)return null;var{x:a,y:o,columnHeaderDepth:s}=e,{modelColumns:l}=t,d=me.getColumnSeparatorIndex(a,o,t,i);if(d==null||s==null||s>0)return null;var u=l.get(d);return u!=null?{index:d,depth:0}:null}setSize(e,t,r){e.setColumnWidth(t,r)}resetSize(e,t){e.resetColumnWidth(t)}updateSeparator(e,t){e.setState({draggingColumnSeparator:t,isDragging:t!==null})}}const KC=Pc;var xa=10;function xI(n,e,t){return e=AI(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function AI(n){var e=LI(n,"string");return typeof e=="symbol"?e:String(e)}function LI(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class kI{constructor(){xI(this,"getCachedTruncatedString",On((e,t,r,i,a)=>Tn.truncateToWidth(e,t,r,i,a),{max:1e4}))}drawCellRowTreeMarker(e,t,r){var{metrics:i,model:a,mouseX:o,mouseY:s,theme:l}=t,{firstColumn:d,gridX:u,gridY:c,allColumnXs:m,allColumnWidths:v,allRowYs:f,allRowHeights:g,visibleRowTreeBoxes:p}=i,{treeMarkerColor:b,treeMarkerHoverColor:S}=l,C=B(m,d),y=B(v,d),E=B(f,r),T=B(g,r);if(!(!Ke(a)||!a.isRowExpandable(r))){var O=B(p,r),N=o!=null&&s!=null&&o>=u+C&&o<=u+C+y&&s>=c+E&&s<=c+E+T?S:b;this.drawTreeMarker(e,t,C,E,O,N,a.isRowExpanded(r))}}drawTreeMarker(e,t,r,i,a,o,s){var{x1:l,y1:d,x2:u,y2:c}=a,m=s?"⊟":"⊞",v=r+(l+u)*.5+.5,f=i+(d+c)*.5+.5;e.fillStyle=o,e.textAlign="center",e.fillText(m,v,f)}}const qC=kI;function Qv(n){return(n==null?void 0:n.dataBarOptionsForCell)!==void 0}function Zv(n,e,t){return e=jI(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function jI(n){var e=$I(n,"string");return typeof e=="symbol"?e:String(e)}function $I(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class HI extends qC{constructor(){super(...arguments),Zv(this,"heightOfDigits",void 0),Zv(this,"getCachedWidestValueForColumn",On((e,t,r,i,a)=>{for(var o=0,s=0;s<t.length;s+=1){var l=t[s],d=B(r,l),u=i.textForCell(a,d);o=Math.max(o,e.measureText(u).width)}return o},{max:1e3}))}drawCellContent(e,t,r,i){var a,{metrics:o,model:s,theme:l}=t;if(Qv(s)){var{modelColumns:d,modelRows:u,allRowHeights:c,allRowYs:m,firstColumn:v,fontWidths:f}=o,g=r===v,p=B(c,i),b=B(u,i),S=B(d,r),C=B(m,i),y=s.textAlignForCell(S,b),E=s.textForCell(S,b),{x:T,width:O}=me.getTextRenderMetrics(t,r,i),N=(a=f==null?void 0:f.get(e.font))!==null&&a!==void 0?a:xa,P=s.truncationCharForCell(S,b),R=this.getCachedTruncatedString(e,E,O,N,P),{columnMin:A,columnMax:M,axis:I,color:x,valuePlacement:_,opacity:k,markers:U,direction:G,value:Y}=s.dataBarOptionsForCell(S,b,l),Z=Array.isArray(x);if(!(A==null||M==null)){var{maxWidth:$,x:D,y:L,zeroPosition:H,leftmostPosition:z,markerXs:te,totalValueRange:W,dataBarWidth:ne}=this.getDataBarRenderMetrics(e,t,r,i);if(this.heightOfDigits===void 0){var{actualBoundingBoxAscent:re,actualBoundingBoxDescent:se}=e.measureText("1234567890");this.heightOfDigits=re+se}if(e.save(),e.textAlign=y,Z){var Ce=Y>=0?x[x.length-1]:x[0];e.fillStyle=Ce}else e.fillStyle=x;if(e.textBaseline="top",e.font=l.font,_!=="hide"&&e.fillText(R,T,C+(p-this.heightOfDigits)/2),Z){var Me=x.map(Or=>ya.linearSRGBToOklab(ya.hexToRgb(Or)));if(e.save(),e.beginPath(),e.roundRect(D,L,ne,p-2,1),e.clip(),Y<0){if(G==="LTR")for(var rt=Math.round(Math.abs(A)/W*$),nt=rt/(x.length-1),Xe=Math.round(z),ft=0;ft<x.length-1;ft+=1){var Nt=Me[ft],He=Me[ft+1];this.drawGradient(e,Nt,He,Xe,C+1,nt,p),Xe+=nt}else if(G==="RTL")for(var Rt=Math.round($-Math.abs(M)/W*$),xt=Rt/(x.length-1),Ur=Math.round(H),Er=x.length-1;Er>0;Er-=1){var Qn=Me[Er],dn=Me[Er-1];this.drawGradient(e,Qn,dn,Ur,C+1,xt,p),Ur+=xt}}else if(G==="LTR")for(var Tr=Math.round($-Math.abs(A)/W*$)-1,it=Tr/(x.length-1),Jt=Math.round(H),Vr=0;Vr<x.length-1;Vr+=1){var Pr=Me[Vr],Gr=Me[Vr+1];this.drawGradient(e,Pr,Gr,Jt,C+1,it,p-2),Jt+=it}else if(G==="RTL")for(var yi=Math.round(Math.abs(M)/W*$),Wr=yi/(x.length-1),zr=Math.round(z),hr=x.length-1;hr>0;hr-=1){var Zn=Me[hr],Jn=Me[hr-1];this.drawGradient(e,Zn,Jn,zr,C+1,Wr,p-2),zr+=Wr}e.restore()}else e.save(),e.globalAlpha=k,e.beginPath(),e.roundRect(D,L,ne,p-2,1),e.fill(),e.restore();$>0&&te.forEach((Or,un)=>{e.fillStyle=U[un].color,e.fillRect(Or,L,1,p-2)});var ei=!(I==="directional"&&(_==="beside"&&y==="right"&&G==="LTR"||_==="beside"&&y==="left"&&G==="RTL"||_!=="beside"));ei&&(e.strokeStyle=l.zeroLineColor,e.beginPath(),e.setLineDash([2,1]),e.moveTo(H,C),e.lineTo(H,C+p),e.stroke()),e.restore(),g&&Ke(s)&&s.hasExpandableRows&&this.drawCellRowTreeMarker(e,t,i)}}}getDataBarRenderMetrics(e,t,r,i){var{metrics:a,model:o,theme:s}=t;if(!Qv(o))throw new Error("Grid model is not a data bar grid model");var{firstColumn:l,allColumnXs:d,allColumnWidths:u,allRowYs:c,modelColumns:m,modelRows:v,visibleRows:f}=a,{cellHorizontalPadding:g,treeDepthIndent:p,treeHorizontalPadding:b}=s,S=B(m,r),C=B(v,i),y=B(d,r),E=B(c,i),T=B(u,r),O=r===l,N=0;Ke(o)&&o.hasExpandableRows&&O&&(N=p*(o.depthForRow(i)+1)+b);var P=o.textAlignForCell(S,C),{columnMin:R,columnMax:A,axis:M,valuePlacement:I,markers:x,direction:_,value:k}=o.dataBarOptionsForCell(S,C,s),U=this.getCachedWidestValueForColumn(e,f,v,o,S),G=2,Y=I==="beside"&&P==="right"?2:1,Z=A-R;A>=0&&R>=0||R===A?Z=A:A<=0&&R<=0&&(Z=Math.abs(R));var $=T-N-Y-G;I==="beside"&&($=$-g-U),$<0&&($=0);var D=Math.max(Math.abs(R),Math.abs(A)),L=Math.abs(k)/Z*$;$===0?L=0:M==="middle"?L=Math.abs(k)/D*($/2):M==="directional"&&(L=Math.abs(k)/D*$);var H=R>=0?0:Math.abs(R)/Z*$,z=k>=0?H:H-Math.abs(k)/Z*$,te=x.map(re=>{var{value:se}=re,Ce=Math.abs(se)/Z*$;return se>=0?H+Ce:H-Ce}),W=I==="beside"&&P==="left"?g+U+G:G,ne=I==="beside"&&P==="right"?T-g-U-Y:Y;return _==="RTL"&&(H=R>=0?T:T-Math.abs(R)/Z*$,z=k>=0?H-k/Z*$:H,te=x.map(re=>{var{value:se}=re;return se>=0?H-Math.abs(se)/Z*$:H+Math.abs(se)/Z*$})),M==="middle"?(H=$/2,_==="LTR"?(z=k>=0?H:H-Math.abs(k)/D*($/2),te=x.map(re=>{var{value:se}=re;return se>=0?H+Math.abs(se)/D*($/2):H-Math.abs(se)/D*($/2)})):_==="RTL"&&(z=k<=0?H:H-Math.abs(k)/D*($/2),te=x.map(re=>{var{value:se}=re;return se<=0?H+Math.abs(se)/D*($/2):H-Math.abs(se)/D*($/2)}))):M==="directional"&&(_==="LTR"?(H=0,z=H,te=x.map(re=>{var{value:se}=re;return H+Math.abs(se)/D*$})):_==="RTL"&&(H=T,z=H-Math.abs(k)/D*$,te=x.map(re=>{var{value:se}=re;return H-Math.abs(se)/D*$}))),_==="LTR"?(H+=y+G+N,z+=y+G+N,te=te.map(re=>re+y+G+N),I==="beside"&&P==="left"&&(H+=U+g,z+=U+g,te=te.map(re=>re+U+g))):_==="RTL"&&(H=H+y-Y,z=z+y-Y,te=te.map(re=>re+y-Y),I==="beside"&&P==="right"&&(H=H-g-U,z=z-g-U,te=te.map(re=>re-g-U))),W+=y+N,ne+=y,{maxWidth:$,x:z,y:E+1.5,zeroPosition:H,leftmostPosition:W,rightmostPosition:ne,totalValueRange:Z,dataBarWidth:L,markerXs:te}}drawGradient(e,t,r,i,a,o,s){for(var l=t,d=i;d<=i+o;d+=.5)this.drawGradientPart(e,d,a,1,s,ya.rgbToHex(ya.OklabToLinearSRGB(l))),l=ya.lerpColor(t,r,(d-i)/o)}drawGradientPart(e,t,r,i,a,o){e.fillStyle=o,e.fillRect(t,r,i,a)}}const YC=HI;function BI(n,e,t){return e=UI(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function UI(n){var e=VI(n,"string");return typeof e=="symbol"?e:String(e)}function VI(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class GI extends qC{constructor(){super(...arguments),BI(this,"getCachedTokenBoxesForVisibleCell",On((e,t,r,i,a,o)=>{for(var s=0,l=a,d=[],u=0,c=0,m=0;m<t.length;m+=1){var v=t[m],{start:f,end:g}=v,p=g>e.length?e.substring(f):v.value;c+=o.measureText(e.substring(u,f)).width;var b=o.measureText(p).width,S=c,C=S+b,y={x1:S,y1:s,x2:C,y2:l,token:v};d.push(y),u=g,c+=b}return d},{max:1e4}))}drawCellContent(e,t,r,i){var{metrics:a,model:o,theme:s}=t,{fontWidths:l,modelColumns:d,modelRows:u,allRowHeights:c,firstColumn:m}=a,v=r===m,{textColor:f}=s,g=B(c,i),p=B(u,i),b=B(d,r),S=o.textForCell(b,p),C=o.truncationCharForCell(b,p);if(S&&g>0){var y,E=o.textAlignForCell(b,p)||"left";e.textAlign=E;var T=o.colorForCell(b,p,s)||f;e.fillStyle=T,e.save();var{width:O,x:N,y:P}=me.getTextRenderMetrics(t,r,i),R=(y=l.get(e.font))!==null&&y!==void 0?y:xa,A=this.getCachedTruncatedString(e,S,O,R,C),M=o.tokensForCell(b,p,A.length);if(A)for(var I=0,x=0,_=N,{actualBoundingBoxDescent:k}=e.measureText(A);x<A.length;){var U,G,Y=M[I],Z=x===(Y==null?void 0:Y.start)?Y:null,$=(U=(G=Z==null?void 0:Z.end)!==null&&G!==void 0?G:Y==null?void 0:Y.start)!==null&&U!==void 0?U:A.length,D=A.substring(x,$),{width:L}=e.measureText(D),H=D.endsWith("…")?e.measureText(D.substring(0,D.length-1)).width:L;Z!=null?(e.fillStyle=s.hyperlinkColor,e.fillText(D,_,P),e.fillRect(_,P+k,H,1)):(e.fillStyle=T,e.fillText(D,_,P)),_+=L,x=$,Z!=null&&(I+=1)}e.restore()}v&&Ke(o)&&o.hasExpandableRows&&this.drawCellRowTreeMarker(e,t,i)}getTokenBoxesForVisibleCell(e,t,r){var i,{metrics:a,context:o,model:s,theme:l}=r;if(o==null||a==null)return Te;var{modelRows:d,modelColumns:u}=a,c=B(d,t),m=B(u,e),v=s.textForCell(m,c),{width:f,x:g,y:p}=me.getTextRenderMetrics(r,e,t),{fontWidths:b}=a;o.save(),this.configureContext(o,r);var S=(i=b==null?void 0:b.get(o.font))!==null&&i!==void 0?i:xa,C=s.truncationCharForCell(m,c),y=this.getCachedTruncatedString(o,v,f,S,C),{actualBoundingBoxAscent:E,actualBoundingBoxDescent:T}=o.measureText(y),O=E+T,N=s.tokensForCell(m,c,y.length);if(N.length===0)return o.restore(),Te;var P=this.getCachedTokenBoxesForVisibleCell(y,N,l.font,"middle",O,o).map(R=>({x1:R.x1+g,y1:R.y1+(p-E),x2:R.x2+g,y2:R.y2+(p-E),token:R.token}));return o.restore(),P}configureContext(e,t){var{theme:r}=t;e.font=r.font,e.textBaseline="middle",e.lineCap="butt"}}const XC=GI;function Ea(n,e,t){return e=WI(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function WI(n){var e=zI(n,"string");return typeof e=="symbol"?e:String(e)}function zI(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class Tn{constructor(){Ea(this,"textCellRenderer",new XC),Ea(this,"dataBarCellRenderer",new YC),Ea(this,"getCachedBackgroundColors",On((e,t)=>e.split(" ").map(r=>{for(var i=[],a=0;a<t;a+=1)i.push(ya.darkenForDepth(r,a,t));return i}),{max:1e3})),Ea(this,"getCachedColorWithAlpha",On((e,t)=>ya.colorWithAlpha(e,t),{max:1e3})),Ea(this,"getCachedColorIsDark",On(e=>Pd.isDark(e),{max:1e3}))}static truncate(e,t){return t<e.length?e.substr(0,t)+"…":e}static binaryTruncateToWidth(e,t,r){var i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:t.length,o=arguments.length>5?arguments[5]:void 0;if(a>=t.length&&e.measureText(t).width<=r)return t;if(o!==void 0){var s=e.measureText(o).width;return o.repeat(Math.max(1,Math.floor(r/s)))}for(var l=i,d=Math.min(t.length-1,a),u=t;d>=l;){var c=Math.ceil((d+l)/2),m=Tn.truncate(t,c);if(e.measureText(m).width<=r){if(u=m,l===c)break;l=c}else if(c===0){u=m;break}else d=c-1}return u}static truncateToWidth(e,t,r){var i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:xa,a=arguments.length>4?arguments[4]:void 0;if(r<=0||t.length<=0)return"";var o=Math.min(Math.max(0,Math.floor(r/i/2)-5),t.length),s=Math.min(Math.ceil(r/i*2),t.length);return Tn.binaryTruncateToWidth(e,t,r,o,s,a)}drawCanvas(e){var{context:t}=e;t.save(),this.configureContext(t,e),this.drawBackground(t,e),this.drawGrid(t,e),this.drawHeaders(t,e),this.drawFooters(t,e),this.drawDraggingColumn(t,e),this.drawDraggingRow(t,e),this.drawScrollBars(t,e),t.restore()}configureContext(e,t){var{theme:r}=t;e.font=r.font,e.textBaseline="middle",e.lineCap="butt"}drawBackground(e,t){var{theme:r,metrics:i}=t,{width:a,height:o}=i;e.fillStyle=r.backgroundColor,e.fillRect(0,0,a,o)}drawGrid(e,t){var{metrics:r,draggingRow:i,draggingColumn:a}=t,{gridX:o,gridY:s}=r;e.translate(o,s),this.drawGridBackground(e,t,i==null&&a==null),this.drawCellContents(e,t),this.drawFloatingRows(e,t),this.drawFloatingColumns(e,t),e.translate(-o,-s)}drawFloatingRows(e,t){var{draggingRow:r,draggingColumn:i,metrics:a,theme:o}=t,{floatingTopRowCount:s,floatingBottomRowCount:l,floatingRows:d,rowCount:u,visibleColumns:c,allRowYs:m,allRowHeights:v}=a;if(d.length!==0){o.floatingRowBackgroundColors&&this.drawRowStripesForRows(e,t,d,o.floatingRowBackgroundColors),r==null&&i==null&&this.drawFloatingMouseRowHover(e,t),this.drawGridLinesForItems(e,t,c,d,o.floatingGridColumnColor,o.floatingGridRowColor),this.drawCellBackgroundsForItems(e,t,c,d),this.drawFloatingBorders(e,t),s>0&&this.drawSelectedRanges(e,t,{top:0,bottom:s-1,maxY:B(m,s-1)+B(v,s-1)-.5}),l>0&&this.drawSelectedRanges(e,t,{top:u-l-1,bottom:u-1,minY:B(m,u-l)+.5,maxY:B(m,u-1)+B(v,u-1)-.5});for(var f=0;f<c.length;f+=1)for(var g=c[f],p=0;p<d.length;p+=1){var b=d[p];this.drawCellContent(e,t,g,b)}}}drawFloatingColumns(e,t){var{draggingRow:r,draggingColumn:i,metrics:a,theme:o}=t,{floatingLeftColumnCount:s,floatingRightColumnCount:l,floatingLeftWidth:d,floatingRightWidth:u,floatingColumns:c,gridX:m,maxX:v,columnCount:f,visibleRows:g,allColumnXs:p,allColumnWidths:b,width:S,height:C}=a;if(c.length!==0){o.floatingRowBackgroundColors&&(this.drawRowStripesForRows(e,t,g,o.floatingRowBackgroundColors,0,d),this.drawRowStripesForRows(e,t,g,o.floatingRowBackgroundColors,S-m-u,v)),r==null&&i==null&&this.drawFloatingMouseRowHover(e,t),e.save(),e.beginPath(),e.rect(0,0,d,C),e.clip(),this.drawGridLinesForItems(e,t,c,g,o.floatingGridColumnColor,o.floatingGridRowColor),e.restore(),this.drawCellBackgroundsForItems(e,t,c,g),this.drawFloatingBorders(e,t),s>0&&this.drawSelectedRanges(e,t,{left:0,maxX:B(p,s-1)+B(b,s-1)}),l>0&&this.drawSelectedRanges(e,t,{left:f-l,right:f-1,minX:B(p,f-l)+.5,maxX:B(p,f-1)+B(b,f-1)});for(var y=0;y<c.length;y+=1)for(var E=c[y],T=0;T<g.length;T+=1){var O=g[T];this.drawCellContent(e,t,E,O)}}}drawFloatingBorders(e,t){var{metrics:r,theme:i}=t,{floatingTopRowCount:a,floatingBottomRowCount:o,floatingLeftColumnCount:s,floatingRightColumnCount:l,rowCount:d,columnCount:u,allRowYs:c,allColumnXs:m,allRowHeights:v,allColumnWidths:f,maxX:g,maxY:p}=r,{floatingDividerOuterColor:b,floatingDividerInnerColor:S}=i;if(e.lineWidth=3,e.beginPath(),e.strokeStyle=b,a>0){var C=B(c,a-1)+B(v,a-1)+.5;e.moveTo(0,C),e.lineTo(g,C)}if(o>0){var y=B(c,d-o)-.5;e.moveTo(0,y),e.lineTo(g,y)}if(s>0){var E=B(m,s-1)+B(f,s-1)+.5;e.moveTo(E,0),e.lineTo(E,p)}if(l>0){var T=B(m,u-l)-.5;e.moveTo(T,0),e.lineTo(T,p)}if(e.stroke(),e.beginPath(),e.lineWidth=1,e.strokeStyle=S,a>0){var O=B(c,a-1)+B(v,a-1)+.5;e.moveTo(0,O),e.lineTo(g,O)}if(o>0){var N=B(c,d-o)-.5;e.moveTo(0,N),e.lineTo(g,N)}if(s>0){var P=B(m,s-1)+B(f,s-1)+.5;e.moveTo(P,0),e.lineTo(P,p)}if(l>0){var R=B(m,u-l)-.5;e.moveTo(R,0),e.lineTo(R,p)}e.stroke()}drawGridBackground(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;this.drawRowStripes(e,t),r&&(this.drawMouseColumnHover(e,t),this.drawMouseRowHover(e,t)),this.drawGridLines(e,t),this.drawCellBackgrounds(e,t);var{metrics:i}=t,{bottom:a,right:o,floatingBottomRowCount:s,floatingLeftColumnCount:l,floatingRightColumnCount:d,floatingTopRowCount:u,columnCount:c,rowCount:m,allRowHeights:v,allRowYs:f,allColumnXs:g,allColumnWidths:p,width:b,height:S}=i;this.drawSelectedRanges(e,t,{bottom:Math.min(a,m-s-1),right:Math.min(o,c-d-1),minX:l>0&&g.has(l+1)?B(g,l+1):-10,minY:u>0&&f.has(u+1)?B(f,u+1):-10,maxX:d>0&&g.has(c-d-1)?B(g,c-d-1)+B(p,c-d-1)-.5:b+10,maxY:s>0&&f.has(m-s-1)?B(f,m-s-1)+B(v,m-s-1)-.5:S+10})}drawRowStripes(e,t){var{metrics:r,theme:i}=t,{visibleRows:a}=r,{rowBackgroundColors:o}=i;o&&this.drawRowStripesForRows(e,t,a,o)}drawRowStripesForRows(e,t,r,i){for(var a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0,o=arguments.length>5&&arguments[5]!==void 0?arguments[5]:t.metrics.maxX,{theme:s,metrics:l,model:d}=t,{maxDepth:u,shadowBlur:c,shadowColor:m,shadowAlpha:v}=s,f=this.getCachedBackgroundColors(i,u),{allRowYs:g,allRowHeights:p}=l,b=new Map,S=[],C=[],y=(D,L)=>{var H=Ke(d)?d.depthForRow(D):0,z=f[D%f.length],te=z[Math.min(H,z.length-1)];if(b.has(te)||b.set(te,[]),b.get(te).push(D),L!=null){var W=Ke(d)?d.depthForRow(L):0;W<H?S.push(D):W>H&&C.push(L)}},E=0;E<r.length;E+=1){var T=r[E],O=E>0?r[E-1]:void 0;y(T,O)}if(b.forEach((D,L)=>{e.fillStyle=L,e.beginPath();for(var H=0;H<D.length;H+=1){var z=D[H],te=B(g,z),W=B(p,z);e.rect(a,te,o,W)}e.fill()}),S.length>0){e.save();var N=this.getCachedColorWithAlpha(m,v),P=this.getCachedColorWithAlpha(m,0),R=e.createLinearGradient(0,0,0,c);R.addColorStop(0,N),R.addColorStop(1,P),e.fillStyle=R;for(var A=0;A<S.length;A+=1){var M=S[A],I=B(g,M);e.translate(0,I),e.fillRect(a,0,o,c),e.translate(0,-I)}e.restore()}if(C.length>0){e.save();var x=this.getCachedColorWithAlpha(m,0),_=this.getCachedColorWithAlpha(m,v),k=e.createLinearGradient(0,0,0,c);k.addColorStop(0,x),k.addColorStop(1,_),e.fillStyle=k;for(var U=0;U<C.length;U+=1){var G=C[U],Y=B(g,G),Z=B(p,G),$=Y+Z-c;e.translate(0,$),e.fillRect(a,0,o,c),e.translate(0,-$)}e.restore()}}drawMouseColumnHover(e,t){var{mouseX:r,mouseY:i,theme:a,metrics:o}=t;if(!(r==null||i==null)){var s=me.getColumnAtX(r,o);if(!(s==null||a.columnHoverBackgroundColor==null)){var{allColumnWidths:l,allColumnXs:d,maxY:u}=o;if(!(i>u)){var c=B(d,s),m=B(l,s);e.fillStyle=a.columnHoverBackgroundColor,e.fillRect(c,0,m,u)}}}}drawMouseRowHover(e,t){var{mouseX:r,mouseY:i,theme:a,metrics:o}=t;if(!(r==null||i==null)){var{maxX:s}=o;if(!(r>s||a.rowHoverBackgroundColor==null)){var l=me.getRowAtY(i,o);l!=null&&this.drawMouseRowHoverForRow(e,t,l)}}}drawFloatingMouseRowHover(e,t){var{mouseX:r,mouseY:i,theme:a,metrics:o}=t,{maxX:s,floatingTopRowCount:l,floatingBottomRowCount:d,rowCount:u,rowFooterWidth:c}=o;if(!(r==null||i==null||r>s+c||a.rowHoverBackgroundColor==null)){var m=me.getRowAtY(i,o);m!=null&&(m<l||u-d<=m)&&this.drawMouseRowHoverForRow(e,t,m)}}drawMouseRowHoverForRow(e,t,r){var{metrics:i,selectedRanges:a,theme:o}=t,{allRowHeights:s,allRowYs:l,maxX:d}=i,u=B(l,r),c=B(s,r);o.rowHoverBackgroundColor!=null&&(e.fillStyle=o.rowHoverBackgroundColor);for(var m=0;m<a.length;m+=1){var{startRow:v,endRow:f}=a[m];if(v!=null&&f!=null&&v<=r&&f>=r){o.selectedRowHoverBackgroundColor!=null&&(e.fillStyle=o.selectedRowHoverBackgroundColor);break}}e.fillRect(0,u,d,c)}drawGridLines(e,t){var{metrics:r,theme:i}=t,{visibleColumns:a,visibleRows:o}=r;this.drawGridLinesForItems(e,t,a,o,i.gridColumnColor,i.gridRowColor)}drawGridLinesForItems(e,t,r,i,a,o){a==null&&o==null||(e.lineWidth=1,e.beginPath(),a!=null&&(e.strokeStyle=a,this.drawGridLinesForColumns(e,t,r)),o!=null&&(e.strokeStyle=o,this.drawGridLinesForRows(e,t,i)),e.stroke())}drawGridLinesForColumns(e,t,r){for(var{metrics:i}=t,{allColumnXs:a,maxY:o}=i,s=0;s<r.length;s+=1){var l=r[s],d=B(a,l)+.5;e.moveTo(d,0),e.lineTo(d,o)}}drawGridLinesForRows(e,t,r){for(var{metrics:i}=t,{allRowYs:a,maxX:o}=i,s=o,l=0;l<r.length;l+=1){var d=r[l],u=B(a,d)+.5;e.moveTo(.5,u),e.lineTo(s-.5,u)}}drawCellBackgrounds(e,t){var{metrics:r}=t,{visibleColumns:i,visibleRows:a}=r;this.drawCellBackgroundsForItems(e,t,i,a)}drawCellBackgroundsForItems(e,t,r,i){e.save();for(var a=0;a<r.length;a+=1)for(var o=r[a],s=0;s<i.length;s+=1){var l=i[s],d=s+1<i.length?i[s+1]:void 0;this.drawCellBackground(e,t,o,l,d)}e.restore()}drawCellBackground(e,t,r,i,a){var{metrics:o,model:s,theme:l}=t,{firstColumn:d,modelColumns:u,modelRows:c,allColumnXs:m,allColumnWidths:v,allRowYs:f,allRowHeights:g}=o,p=B(c,i),b=B(u,r),S=s.backgroundColorForCell(b,p,l),C=r===d,y=Ke(s)&&s.hasExpandableRows;if(S!=null){var E=B(m,r)+1,T=B(f,i)+1,O=B(v,r)-1,N=B(g,i)-1;e.fillStyle=S,e.fillRect(E,T,O,N)}C&&y&&this.drawCellRowTreeDepthLines(e,t,i,a)}drawCellContents(e,t){for(var{metrics:r}=t,{visibleColumns:i}=r,a=0;a<i.length;a+=1){var o=i[a];this.drawColumnCellContents(e,t,o)}}drawColumnCellContents(e,t,r){var{metrics:i}=t,{allColumnXs:a,allColumnWidths:o,visibleRows:s,height:l}=i,d=B(a,r),u=B(o,r);e.save(),e.beginPath(),e.rect(d,0,u,l),e.clip();for(var c=0;c<s.length;c+=1){var m=s[c];this.drawCellContent(e,t,r,m)}e.restore()}drawCellContent(e,t,r,i){var{metrics:a,model:o}=t,{modelColumns:s,modelRows:l}=a,d=B(l,i),u=B(s,r),c=o.renderTypeForCell(u,d),m=this.getCellRenderer(c);m.drawCellContent(e,t,r,i)}getCellRenderer(e){switch(e){case"dataBar":return this.dataBarCellRenderer;default:return this.textCellRenderer}}drawCellRowTreeDepthLines(e,t,r,i){var{metrics:a,model:o,theme:s}=t;if(Ke(o)){var l=o.depthForRow(r);if(l!==0){var{firstColumn:d,allColumnXs:u,allRowYs:c,allRowHeights:m}=a,{treeDepthIndent:v,treeHorizontalPadding:f,treeLineColor:g}=s,p=B(u,d),b=B(c,r),S=B(m,r),C=i!==void 0?o.depthForRow(i):0,y=l>C?l-C:0;if(e.strokeStyle=g,e.lineWidth=1,l-y>0){e.beginPath();for(var E=0;E<l-y;E+=1){var T=p+E*v+v*.5+f+.5;e.moveTo(T,b),e.lineTo(T,b+S)}e.stroke()}if(y>0){e.beginPath();for(var O=l-y;O<l;O+=1){var N=p+O*v+v*.5+f+.5;e.moveTo(N,b),e.lineTo(N,b+Math.ceil(S/2)),e.moveTo(N-.5,b+Math.ceil(S/2)+.5),e.lineTo(N+v-.5,b+Math.ceil(S/2)+.5)}e.stroke()}}}}drawHeaders(e,t){var{theme:r}=t;e.font=r.headerFont,this.drawColumnHeaders(e,t),this.drawRowHeaders(e,t)}drawFooters(e,t){var{theme:r}=t;e.font=r.headerFont,this.drawRowFooters(e,t)}drawColumnHeaders(e,t){var{mouseX:r,mouseY:i,theme:a,metrics:o,draggingColumnSeparator:s,isDragging:l,model:d}=t,{columnHeaderHeight:u,floatingColumns:c,gridX:m,width:v,visibleColumns:f,allColumnWidths:g,allColumnXs:p,floatingLeftColumnCount:b,floatingLeftWidth:S,floatingRightWidth:C,modelColumns:y,columnHeaderMaxDepth:E}=o;if(!(u<=0)){var{headerHiddenSeparatorSize:T,headerHiddenSeparatorHoverColor:O,headerSeparatorColor:N,headerSeparatorHoverColor:P}=a,R=u*.5,A=u*(E-1)+u*.5-R*.5,M=b>0;if(e.save(),this.drawColumnHeadersForRange(e,t,[f[0],f[f.length-1]],{minX:m+S,maxX:v-C}),M&&this.drawColumnHeadersForRange(e,t,[c[0],c[c.length-1]],{minX:m,maxX:m+S}),N){e.strokeStyle=N;var I=[...g.entries()].filter(rt=>{var[nt,Xe]=rt;return Xe===0}).map(rt=>{var[nt]=rt;return nt});e.beginPath(),e.fillStyle=N;for(var x=0;x<I.length;x+=1){var _=I[x],k=B(p,_),U=B(g,_),G=m+k+U+.5-T*.5;e.rect(G,A,T,R)}e.fill()}if(P){var{index:Y,depth:Z}=s??{};if(Y==null&&r!=null&&i!=null){var $=KC.getColumnSeparator(me.getGridPointFromXY(r,i,o),o,d,a);Y=$==null?void 0:$.index,Z=$==null?void 0:$.depth}var D;if(Y==null)D=!1;else{var L=y.get(Y),H=y.get(Y+1);L==null||H==null?D=!1:D=d.textForColumnHeader(L,Z)!==d.textForColumnHeader(H,Z)}if(D&&Y!=null&&Z!=null&&(!l||s!=null)){e.strokeStyle=P;var z=B(p,Y),te=B(g,Y),W=m+z+te+.5,ne=f.indexOf(Y),re=ne<f.length-1?f[ne+1]:null,se=re!=null?g.get(re):null,Ce=te===0,Me=se!=null&&se===0;Ce?(e.strokeStyle=O,e.fillStyle=O,e.fillRect(W,A,T*.5,R)):Me&&(e.fillStyle=P,e.fillRect(W-T*.5,A,T*.5,R)),e.beginPath(),e.moveTo(W,(E-Z-1)*u),e.lineTo(W,(E-Z)*u-1),e.stroke()}}e.restore()}}drawColumnHeadersForRange(e,t,r,i){var{model:a}=t,{columnHeaderMaxDepth:o}=a;if(o!==0)for(var s=0;s<=o;s+=1)this.drawColumnHeadersAtDepth(e,t,r,i,s)}drawColumnHeadersAtDepth(e,t,r,i,a){var{metrics:o,model:s,theme:l}=t,{modelColumns:d,allColumnXs:u,gridX:c,userColumnWidths:m,allColumnWidths:v,movedColumns:f}=o,{columnHeaderHeight:g,columnWidth:p}=l,{columnHeaderMaxDepth:b}=s,{minX:S,maxX:C}=i,y=C-S;if(b!==0){var E=r[0],T=r[1];if(e.save(),e.translate(0,(b-a-1)*g),a===0){this.drawColumnHeader(e,t,"",S,C);for(var O=E;O<=T;O+=1)this.drawColumnHeaderAtIndex(e,t,O,i)}if(a>0)for(var N=E;N<=T;){var{columnCount:P}=o,R=B(d,N),A=s.textForColumnHeader(R,a),M=s.colorForColumnHeader(R,a),I=B(u,N)+c,x=I+B(v,N);if(A!=null){for(var _=N-1;_>=0&&(x-I<y||I>S);){var k,U,G,Y=(k=d.get(_))!==null&&k!==void 0?k:me.getModelIndex(_,f);if(Y==null||s.textForColumnHeader(Y,a)!==A)break;var Z=(U=(G=m.get(Y))!==null&&G!==void 0?G:v.get(_))!==null&&U!==void 0?U:p;I-=Z,_-=1}for(var $=N+1;$<P&&(x-I<y||x<C);){var D,L,H,z=(D=d.get($))!==null&&D!==void 0?D:me.getModelIndex($,f);if(s.textForColumnHeader(z,a)!==A)break;var te=(L=(H=m.get(z))!==null&&H!==void 0?H:v.get($))!==null&&L!==void 0?L:p;x+=te,$+=1}N=$-1;var W=x-I>=y,ne=I;W&&(x<C?ne=x-y:I<S&&(ne=S)),this.drawColumnHeader(e,t,A,ne,Math.min(x-I,y),{backgroundColor:M??void 0},i)}N+=1}e.restore()}}drawColumnHeaderAtIndex(e,t,r,i){var a,{metrics:o,model:s}=t,{modelColumns:l,allColumnWidths:d,allColumnXs:u,gridX:c}=o,m=B(d,r),v=B(u,r)+c,f=B(l,r),g=s.textForColumnHeader(f);g!=null&&this.drawColumnHeader(e,t,g,v,m,{backgroundColor:(a=s.colorForColumnHeader(f))!==null&&a!==void 0?a:void 0},i)}drawColumnHeader(e,t,r,i,a,o,s){var l;if(!(a<=0)){var{metrics:d,theme:u}=t,{headerHorizontalPadding:c,columnHeaderHeight:m,headerBackgroundColor:v,headerColor:f,headerSeparatorColor:g,black:p,white:b}=u,{fontWidths:S,width:C}=d,y=(l=S.get(e.font))!==null&&l!==void 0?l:xa,E=a-c*2,T=E/y,{backgroundColor:O=v,separatorColor:N=g}=o??{},{textColor:P=f}=o??{};try{var R=this.getCachedColorIsDark(O),A=this.getCachedColorIsDark(P);R&&A?P=b:!R&&!A&&(P=p)}catch{}var{minX:M=0,maxX:I=C}=s??{};e.save(),e.rect(M,0,I-M,m),e.clip(),O!=null&&(e.fillStyle=O,e.fillRect(i,0,a,m)),N!=null&&(e.strokeStyle=N,e.beginPath(),i>0&&(e.moveTo(i+.5,0),e.lineTo(i+.5,m)),e.moveTo(i+a+.5,0),e.lineTo(i+a+.5,m),e.moveTo(i,m-.5),e.lineTo(i+a,m-.5),e.stroke()),e.beginPath(),e.rect(i,0,a,m),e.clip(),e.fillStyle=P;var x=r;T<=0?x="":x.length>T&&(x="".concat(x.substring(0,T-1),"…"));var _=x.length*y,k=i+a*.5,U=m*.5;M+=c,I-=c;var G=i+c,Y=Le(G,M,I),Z=i+a-c,$=Le(Z,M,I),D=$-Y,L=k-_*.5<M,H=k+_*.5>I;L?_<D?k=M+_*.5:k=Z-_*.5:H&&(_<D?k=I-_*.5:k=G+_*.5),e.textAlign="center",e.fillText(x,k,U),e.restore()}}drawRowHeaders(e,t){var{mouseX:r,mouseY:i,metrics:a,theme:o,draggingRowSeparator:s}=t,{gridY:l,rowHeaderWidth:d,height:u,visibleRows:c,allRowHeights:m,allRowYs:v}=a;if(!(d<=0)){var{headerBackgroundColor:f,headerColor:g,headerHiddenSeparatorSize:p,headerHiddenSeparatorHoverColor:b,headerSeparatorColor:S,headerSeparatorHoverColor:C}=o,y=d*.5,E=d*.5-y*.5;if(e.save(),e.beginPath(),e.fillStyle=f,e.fillRect(0,0,d,u),S){e.strokeStyle=S,e.beginPath(),e.moveTo(0,l+.5),e.lineTo(d,l+.5);for(var T=[],O=!1,N=0;N<c.length;N+=1){var P=c[N],R=B(v,P),A=B(m,P);if(A>0){var M=l+R+A+.5;e.moveTo(0,M),e.lineTo(d,M),O=!1}else O||(O=!0,T.push(P))}e.moveTo(d-.5,0),e.lineTo(d-.5,u),e.stroke(),e.beginPath(),e.fillStyle=S;for(var I=0;I<T.length;I+=1){var x=T[I],_=B(v,x),k=B(m,x),U=l+_+k+.5-p*.5;e.rect(E,U,y,p)}e.fill()}if(C){var{index:G=null}=s??{};if(G==null&&r!=null&&i!=null&&(G=me.getRowSeparatorIndex(r,i,a,o)),G!=null){e.strokeStyle=C;var Y=B(v,G),Z=B(m,G),$=l+Y+Z+.5,D=c.indexOf(G),L=D<c.length-1?c[D+1]:null,H=L!=null?m.get(L):null,z=Z===0,te=H!=null&&H===0;z?(e.strokeStyle=b,e.fillStyle=b,e.fillRect(E,$,y,p*.5)):te&&(e.fillStyle=C,e.fillRect(E,$-p*.5,y,p*.5)),e.beginPath(),e.moveTo(.5,$),e.lineTo(d+.5,$),e.stroke()}}e.beginPath(),e.rect(0,l,d,u),e.clip(),e.fillStyle=g,e.textAlign="right";for(var W=0;W<c.length;W+=1){var ne=c[W],re=B(m,ne),se=B(v,ne)+l;this.drawRowHeader(e,t,ne,se,re)}e.restore()}}drawRowHeader(e,t,r,i,a){if(!(a<=0)){var{metrics:o,model:s,theme:l}=t,{modelRows:d,rowHeaderWidth:u}=o,c=B(d,r),m=u-l.cellHorizontalPadding,v=i+a*.5;e.fillText(s.textForRowHeader(c),m,v)}}drawRowFooters(e,t){var{mouseX:r,mouseY:i,metrics:a,model:o,theme:s,draggingRowSeparator:l}=t,{gridY:d,gridX:u,maxX:c,modelRows:m,rowFooterWidth:v,height:f,verticalBarWidth:g,visibleRows:p,allRowHeights:b,allRowYs:S,width:C}=a;if(!(v<=0)){var{cellHorizontalPadding:y,headerBackgroundColor:E,headerColor:T,headerHiddenSeparatorSize:O,headerHiddenSeparatorHoverColor:N,headerSeparatorColor:P,headerSeparatorHoverColor:R}=s,A=v*.5,M=v*.5-A*.5,I=Math.min(u+c,C-v-g);if(e.save(),e.beginPath(),e.fillStyle=E,e.fillRect(I,d,v,f),P){e.strokeStyle=P,e.beginPath(),e.moveTo(I,d+.5),e.lineTo(v,d+.5);for(var x=[],_=!1,k=0;k<p.length;k+=1){var U=p[k],G=B(S,U),Y=B(b,U);if(Y>0){var Z=d+G+Y+.5;e.moveTo(I+.5,Z),e.lineTo(I+v-.5,Z),_=!1}else _||(_=!0,x.push(U))}e.moveTo(I+.5,d),e.lineTo(I+.5,f),e.stroke(),e.beginPath(),e.fillStyle=P;for(var $=0;$<x.length;$+=1){var D=x[$],L=B(S,D),H=B(b,D),z=d+L+H+.5-O*.5;e.rect(I+M,z,A,O)}e.fill()}if(R){var{index:te=null}=l??{};if(te==null&&r!=null&&i!=null&&(te=me.getRowSeparatorIndex(r,i,a,s)),te!=null){e.strokeStyle=R;var W=B(S,te),ne=B(b,te),re=d+W+ne+.5,se=p.indexOf(te),Ce=se<p.length-1?p[se+1]:null,Me=Ce!=null?b.get(Ce):null,rt=ne===0,nt=Me!=null&&Me===0;rt?(e.strokeStyle=N,e.fillStyle=N,e.fillRect(M,re,A,O*.5)):nt&&(e.fillStyle=R,e.fillRect(M,re-O*.5,A,O*.5)),e.beginPath(),e.moveTo(I+.5,re),e.lineTo(I+v+.5,re),e.stroke()}}e.beginPath(),e.rect(I,d,v,f),e.clip(),e.fillStyle=T,e.textAlign="left";for(var Xe=I+y,ft=0;ft<p.length;ft+=1){var Nt=p[ft],He=B(b,Nt);if(He>0){var Rt=B(S,Nt)+d,xt=B(m,Nt),Ur=Rt+He*.5;e.fillText(o.textForRowFooter(xt),Xe,Ur)}}e.restore()}}drawSelectedRanges(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},{cursorColumn:i,cursorRow:a,draggingRow:o,draggingColumn:s,editingCell:l,metrics:d,model:u,selectedRanges:c,theme:m}=t,{allColumnWidths:v,allColumnXs:f,allRowHeights:g,allRowYs:p,width:b,height:S}=d,{left:C=d.left,top:y=d.top,right:E=d.right,bottom:T=d.bottom,minY:O=-10,maxY:N=S+10,minX:P=-10,maxX:R=b+10}=r;if(c.length!==0){var A=tt(u)&&u.isEditable&&l==null&&o==null&&s==null&&i!=null&&a!=null&&f.has(i)&&p.has(a);if(A){var M=B(f,i),I=B(p,a),x=B(v,i),_=B(g,a);e.save(),e.beginPath(),e.rect(0,0,b,S),e.rect(M,I,x,_),e.clip("evenodd")}e.beginPath();for(var k=0;k<c.length;k+=1){var U=c[k],G=U.startColumn!==null?U.startColumn:C,Y=U.startRow!==null?U.startRow:y,Z=U.endColumn!==null?U.endColumn:E,$=U.endRow!==null?U.endRow:T;if($>=y&&T>=Y&&Z>=C&&E>=G){var D=G>=C&&f.has(G)?Math.round(B(f,G))+.5:P,L=Y>=y&&p.has(Y)?Math.max(Math.round(B(p,Y))+.5,.5):O,H=Z<=E&&f.has(Z)?Math.round(B(f,Z)+B(v,Z))-.5:R,z=$<=T&&p.has($)?Math.round(B(p,$)+B(g,$))-.5:N;e.rect(D,L,H-D,z-L)}}e.fillStyle=m.selectionColor,e.fill(),e.save(),e.clip(),e.strokeStyle=m.selectionOutlineCasingColor,e.lineWidth=3,e.stroke(),e.restore(),e.strokeStyle=m.selectionOutlineColor,e.lineWidth=1,e.stroke(),A&&i!=null&&a!=null&&(e.restore(),this.drawActiveCell(e,t,i,a))}}drawActiveCell(e,t,r,i){var a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:Tn.ACTIVE_CELL_BORDER_WIDTH,{metrics:o,theme:s}=t,{allColumnWidths:l,allColumnXs:d,allRowHeights:u,allRowYs:c}=o,m=B(d,r),v=B(c,i),f=B(l,r),g=B(u,i),p=m-a*.5,b=v-a*.5,S=f+a,C=g+a;p<=0&&(S+=p-1,p=1),b<=0&&(C+=b-1,b=1);var{lineWidth:y}=e;e.beginPath(),e.lineWidth=a,e.strokeStyle=s.selectionOutlineColor,this.drawRoundedRect(e,p,b,S,C),e.stroke(),e.lineWidth=y}drawRoundedRect(e,t,r,i,a){var o=arguments.length>5&&arguments[5]!==void 0?arguments[5]:Tn.DEFAULT_EDGE_RADIUS;e.beginPath(),e.moveTo(t+o,r),e.lineTo(t+i-o,r),e.quadraticCurveTo(t+i,r,t+i,r+o),e.lineTo(t+i,r+a-o),e.quadraticCurveTo(t+i,r+a,t+i-o,r+a),e.lineTo(t+o,r+a),e.quadraticCurveTo(t,r+a,t,r+a-o),e.lineTo(t,r+o),e.quadraticCurveTo(t,r,t+o,r),e.closePath()}drawDraggingColumn(e,t){var r,{draggingColumn:i,metrics:a,mouseX:o,theme:s,model:l}=t;if(!(i==null||o==null)){var{range:d,depth:u}=i,{gridX:c,gridY:m,allColumnXs:v,allColumnWidths:f,height:g,width:p,columnHeaderMaxDepth:b,columnHeaderHeight:S,movedColumns:C,modelColumns:y,floatingLeftWidth:E}=a,T=(r=y.get(d[0]))!==null&&r!==void 0?r:me.getModelIndex(d[0],C),O=l.getColumnHeaderGroup(T,u);if(!(u>0&&!O)){var[N,P]=d,R=B(v,N),A=B(v,P)+B(f,P),M=A-R,I=i.left,{backgroundColor:x,font:_,headerFont:k,reorderOffset:U,shadowBlur:G,shadowColor:Y}=s,Z=(b-u-1)*S;e.save(),e.translate(c,0),e.save(),e.beginPath(),e.rect(E,0,p,g),e.clip(),e.fillStyle=x,e.fillRect(R,Z,M,g),e.restore(),e.translate(0,U),e.save(),e.shadowColor=Y,e.shadowBlur=G,e.fillStyle=x,e.fillRect(i.left,Z+U,i.width,g),e.restore(),e.beginPath(),e.rect(i.left,Z,i.width+1,g),e.clip(),e.translate(I-R,0),e.font=k;for(var $=[],D=i.range[0];D<=i.range[1];D+=1)$.push(D);this.drawColumnHeaders(e,t),this.drawColumnHeadersForRange(e,t,[$[0],$[$.length-1]],{minX:R,maxX:p}),e.translate(0,m),e.font=_,this.drawGridBackground(e,t);for(var L=N;L<=P;L+=1)this.drawColumnCellContents(e,t,L);e.restore()}}}drawDraggingRow(e,t){var{draggingRow:r,draggingRowOffset:i,metrics:a,mouseY:o,theme:s}=t;if(!(r==null||o==null)){var{gridX:l,gridY:d,allRowYs:u,allRowHeights:c,width:m}=a,v=B(u,r),f=B(c,r)+1,{backgroundColor:g,font:p,headerFont:b,reorderOffset:S,shadowBlur:C,shadowColor:y}=s;e.save(),e.translate(0,d),e.fillStyle=g,e.fillRect(0,v,m,f),e.translate(l+S,o-v-d-(i??0)),e.save(),e.shadowColor=y,e.shadowBlur=C,e.fillStyle=g,e.fillRect(-l,v,m,f),e.restore(),e.beginPath(),e.rect(-l,v,m,f),e.clip(),e.font=p,this.drawGridBackground(e,t),this.drawCellContents(e,t),e.translate(-l,-d),e.font=b,this.drawRowHeaders(e,t),e.restore()}}drawScrollBars(e,t){var{isDraggingHorizontalScrollBar:r,isDraggingVerticalScrollBar:i,isDragging:a,metrics:o,mouseX:s,mouseY:l,theme:d}=t;if(!(d.scrollBarSize<=0)){var{width:u,height:c,handleHeight:m,handleWidth:v,scrollX:f,scrollY:g,hasHorizontalBar:p,hasVerticalBar:b,barWidth:S,barHeight:C,barLeft:y,barTop:E}=o,{scrollBarBackgroundColor:T,scrollBarHoverBackgroundColor:O,scrollBarCasingColor:N,scrollBarCornerColor:P,scrollBarColor:R,scrollBarHoverColor:A,scrollBarActiveColor:M,scrollBarSize:I,scrollBarHoverSize:x,scrollBarCasingWidth:_,scrollBarSelectionTick:k,scrollBarSelectionTickColor:U,scrollBarActiveSelectionTickColor:G,autoSelectRow:Y,autoSelectColumn:Z}=d,$=s!=null&&l!=null&&s<=u&&l<=c,D=i||b&&!r&&!a&&s!=null&&l!=null&&s>=u-x&&l>=E&&$,L=r||p&&!i&&!a&&!D&&s!=null&&l!=null&&l>=c-x&&s>=y&&$,H=L?x:I,z=D?x:I;if(e.translate(y,E),p&&b&&(e.fillStyle=N,e.fillRect(u-y-I,c-E-I,I,I),e.fillStyle=P,e.fillRect(u-y-I+_,c-E-I+_,I-_,I-_)),p){var te=f,W=c-E-H;if(e.fillStyle=N,e.fillRect(0,W,S,H-_),e.fillStyle=L?O:T,e.fillRect(0,W+_,S,H-_),r?e.fillStyle=M:L?e.fillStyle=A:e.fillStyle=R,e.fillRect(te,W+_,v,H-_),!Y&&k&&U!=null&&G!=null){e.fillStyle=U;for(var{selectedRanges:ne,cursorColumn:re}=t,{lastLeft:se,columnCount:Ce}=o,Me=[...ne].filter(at=>at.startColumn!=null&&at.endColumn!=null),rt=Me.map(at=>[at.startColumn,at.endColumn]).sort(me.compareRanges),nt=me.mergeSortedRanges(rt),Xe=at=>at<=se?at/se*(S-v):S-v+(at-se)/(Ce-se)*v,ft=0;ft<nt.length;ft+=1){var Nt=nt[ft],He=Nt[0],Rt=Nt[1];if(He!=null&&Rt!=null&&(He!==re||Rt!==re)){var xt=Xe(He),Ur=Math.max(1,Math.round(Xe(Rt+1)-xt)),Er=H-_;e.fillRect(xt,W+_+Math.round(Er/3),Ur,Math.round(Er/3))}}if(re!=null){var Qn=Xe(re),dn=2,Tr=H-_;e.fillStyle=G,e.fillRect(Qn,W+_,dn,Tr)}}}if(b){var it=u-y-z,Jt=g;if(e.fillStyle=N,e.fillRect(it,0,z-_,C),e.fillStyle=D?O:T,e.fillRect(it+_,0,z-_,C),i?e.fillStyle=M:D?e.fillStyle=A:e.fillStyle=R,e.fillRect(it+_,Jt,z-_,m),!Z&&k&&U!=null&&G!=null){var{selectedRanges:Vr,cursorRow:Pr}=t,{lastTop:Gr,rowCount:yi}=o,Wr=at=>at<=Gr?at/Gr*(C-m):C-m+(at-Gr)/(yi-Gr)*m;e.fillStyle=U;for(var zr=[...Vr].filter(at=>at.startRow!=null&&at.endRow!=null),hr=zr.map(at=>[at.startRow,at.endRow]).sort(me.compareRanges),Zn=me.mergeSortedRanges(hr),Jn=0;Jn<Zn.length;Jn+=1){var ei=Zn[Jn],Or=ei[0],un=ei[1];if(Or!=null&&un!=null&&(Or!==Pr||un!==Pr)){var Ei=Wr(Or),ua=z-_,Lo=Math.max(1,Math.round(Wr(un+1)-Ei));e.fillRect(it+_+Math.round(ua/3),Ei,Math.round(ua/3),Lo)}}if(Pr!=null){var ko=Math.round(Wr(Pr)),jo=z-_,$o=2;e.fillStyle=G,e.fillRect(it+_,ko,jo,$o)}}}e.translate(-y,-E)}}}Ea(Tn,"DEFAULT_EDGE_RADIUS",2);Ea(Tn,"ACTIVE_CELL_BORDER_WIDTH",2);function Qo(n,e,t){return e=KI(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function KI(n){var e=qI(n,"string");return typeof e=="symbol"?e:String(e)}function qI(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var Jv=100;class YI extends yt{constructor(){super(...arguments),Qo(this,"startPoint",void 0),Qo(this,"hasExtendedFloating",!1),Qo(this,"timer",void 0),Qo(this,"lastTriggerTime",void 0),Qo(this,"dragBounds",void 0)}onDown(e,t,r){var{x:i,y:a,column:o,row:s}=e,{metrics:l}=t;if(!l)throw new Error("metrics not set");var{gridX:d,gridY:u,maxX:c,maxY:m}=l,v=i-d,f=a-u;if(v<0||f<0||o==null&&v>c||s==null&&f>m)return!1;var g=me.isModifierKeyDown(r),p=r.shiftKey;g||(p?t.trimSelectedRanges():t.clearSelectedRanges());var b=t.getTheme(),{autoSelectRow:S,autoSelectColumn:C}=b;return(o!==null||!C)&&(s!==null||!S)&&(t.focus(),t.moveCursorToPosition(o,s,p,!1,p&&g)),this.startPoint=e,this.hasExtendedFloating=!1,this.dragBounds=me.getScrollDragBounds(l,s,o),!0}onDrag(e,t){if(this.startPoint===void 0)return!1;this.stopTimer();var{row:r,column:i}=this.startPoint,{x:a,y:o}=e,{row:s,column:l}=e,{metrics:d}=t;if(!d)throw new Error("metrics not set");var{left:u,lastLeft:c,top:m,lastTop:v,columnWidth:f,rowHeight:g}=d,p=me.getScrollDragBounds(d,r,i),b=0,S=0;if(u<c&&(a<p.x1?b=a-p.x1:a>p.x2&&(b=a-p.x2)),m<v&&(o<p.y1?S=o-p.y1:o>p.y2&&(S=o-p.y2)),b!==0||S!==0)this.startTimer(t,e,b>0?Math.ceil(b/f):Math.floor(b/f),S>0?Math.ceil(S/g):Math.floor(S/g));else if(s!=null&&l!=null){var{floatingTopRowCount:C,floatingBottomRowCount:y,floatingLeftColumnCount:E,floatingRightColumnCount:T,columnCount:O,rowCount:N,bottom:P,right:R,topVisible:A,bottomVisible:M,leftVisible:I,rightVisible:x}=d;this.hasExtendedFloating||(r!==null&&r<C&&s>=C?(s=C,this.hasExtendedFloating=!0):r!==null&&r>=N-y&&s<N-y&&(s=N-y-1,this.hasExtendedFloating=!0),i!==null&&i<E&&l>=E?(l=E,this.hasExtendedFloating=!0):i!==null&&i>=O-T&&l<O-T&&(l=O-T-1,this.hasExtendedFloating=!0)),r!==null&&!me.isFloatingRow(r,d)&&me.isFloatingRow(s,d)&&(r>s&&s<m?s=A-1:r<s&&s>P&&(s=M+1)),i!==null&&!me.isFloatingColumn(i,d)&&me.isFloatingColumn(l,d)&&(i>l&&l<u?l=I-1:i<l&&l>R&&(l=x+1)),t.moveCursorToPosition(l,s,!0,!0)}return!0}onUp(e,t){return this.startPoint!==void 0&&(this.startPoint=void 0,this.dragBounds=void 0,this.stopTimer(),t.commitSelection()),!1}moveSelection(e,t,r,i){var{row:a,column:o}=t,{metrics:s}=e;if(!s)throw new Error("metrics not set");var{selectionEndRow:l,selectionEndColumn:d}=e.state;if(l==null||d==null)throw new Error("selection not set");var{rowCount:u,columnCount:c}=s,m=r<0&&o!=null?o:0,v=r>0&&o!=null?o:c-1,f=i<0&&a!=null?a:0,g=i>0&&a!=null?a:u-1;e.moveCursorToPosition(Math.min(Math.max(m,d+r),v),Math.min(Math.max(f,l+i),g),!0),this.lastTriggerTime=Date.now()}startTimer(e,t,r,i){this.stopTimer();var a=this.lastTriggerTime!=null?Jv-Math.min(Jv,Date.now()-this.lastTriggerTime):0;this.timer=setTimeout(()=>{this.moveSelection(e,t,r,i),this.startTimer(e,t,r,i)},a)}stopTimer(){this.timer!==void 0&&(clearTimeout(this.timer),this.timer=void 0)}}const XI=YI;function ef(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function mr(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?ef(Object(t),!0).forEach(function(r){$i(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):ef(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function $i(n,e,t){return e=QI(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function QI(n){var e=ZI(n,"string");return typeof e=="symbol"?e:String(e)}function ZI(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var tf=5,JI=1e3/60,bl=10;function Ii(n,e,t,r){var i,{modelColumns:a,movedColumns:o,allColumnXs:s,columnCount:l,allColumnWidths:d,userColumnWidths:u,calculatedColumnWidths:c,floatingLeftWidth:m,maxX:v}=t;if(e==null||n==null||n>l||n<0)return null;var f=(i=a.get(n))!==null&&i!==void 0?i:me.getModelIndex(n,o),g=r.getColumnHeaderGroup(f,e),p=g!=null,b,S,C;if(g!=null){var y,E,T,[O,N]=g.getVisibleRange(o);b=(y=s.get(O))!==null&&y!==void 0?y:m,S=((E=s.get(N))!==null&&E!==void 0?E:v)+((T=d.get(N))!==null&&T!==void 0?T:0),C=[O,N]}else{var P,R,A,M=s.get(n);if(M==null)return null;b=M,S=b+((P=(R=(A=d.get(n))!==null&&A!==void 0?A:u.get(f))!==null&&R!==void 0?R:c.get(f))!==null&&P!==void 0?P:0),C=[n,n]}return{visibleIndex:n,modelIndex:f,left:b,right:S,width:S-b,isColumnGroup:p,range:C,depth:e}}class eF extends yt{constructor(){super(...arguments),$i(this,"cursor",null),$i(this,"draggingOffset",void 0),$i(this,"initialOffset",void 0),$i(this,"initialGridPoint",void 0),$i(this,"scrollingInterval",void 0),$i(this,"scrollingDirection",void 0),$i(this,"draggingColumn",null)}setScrollInterval(e,t){this.scrollingInterval!=null&&t===this.scrollingDirection||(this.scrollingDirection=t,this.scrollingInterval=window.setInterval(()=>{var{metrics:r}=e;if(r){var{left:i,lastLeft:a,leftOffset:o,userColumnWidths:s,calculatedColumnWidths:l,movedColumns:d,allColumnWidths:u}=r,c=i,m=o;if(t==="left")for(m-=bl;m<0;){var v;c-=1;var f=me.getModelIndex(i-1,d),g=(v=s.get(f))!==null&&v!==void 0?v:l.get(f);g===void 0?m=0:m+=g,c<0&&(m=0,c=0)}else{m+=bl;for(var p=u.get(i);p!==void 0&&m>p;){var b;c+=1,m-=p;var S=me.getModelIndex(i+1,d);p=(b=s.get(S))!==null&&b!==void 0?b:l.get(S),c>a&&(m=0,c=a)}}var{mouseX:C,mouseY:y}=e.state;r==null||C==null||y==null||(this.moveDraggingColumn(C,e,t==="left"?-bl:bl),e.setState({left:c,leftOffset:m}),(t==="left"&&c===0&&o===0||t==="right"&&c===a)&&this.clearScrollInterval())}},JI))}clearScrollInterval(){this.scrollingDirection=void 0,window.clearInterval(this.scrollingInterval),this.scrollingInterval=void 0}onLeave(){return this.clearScrollInterval(),!1}onDown(e,t){var{model:r}=t.props,{x:i,column:a,columnHeaderDepth:o}=e,{metrics:s}=t;if(!s)throw new Error("Metrics not set");var l=Ii(a,o,s,r);if(a==null||l==null||o==null||o>0&&!l.isColumnGroup)return!1;var{rowHeaderWidth:d}=s;return this.initialGridPoint=e,this.draggingColumn=null,this.cursor=null,l.modelIndex!=null&&o!=null&&r.isColumnMovable(l.modelIndex,o)&&(this.draggingOffset=i-l.left-d,this.initialOffset=this.draggingOffset),!1}onDrag(e,t,r){if(this.draggingOffset===void 0||this.initialGridPoint===void 0||this.initialOffset===void 0)return!1;var{x:i,y:a}=e,{columnHeaderDepth:o}=this.initialGridPoint,{model:s}=t.props,{draggingColumn:l}=this,{metrics:d}=t;if(!d)throw new Error("Metrics not set");if(!l&&Math.abs(this.initialGridPoint.x-i)<tf&&Math.abs(this.initialGridPoint.y-a)<tf)return!1;if(l==null){var u=Ii(this.initialGridPoint.column,o,d,s);if(!u||o==null||!s.isColumnMovable(u.modelIndex)||o>0&&!u.isColumnGroup||u.range[0]==null)return!1;l={range:u.range,depth:o,left:u.left,width:u.width};var c=Ii(l.range[0],0,d,s),m=Ii(l.range[1],0,d,s);if(!c||!m)return!1;this.draggingColumn=l,t.setState({draggingColumn:l,isDragging:!0})}return this.cursor="move",this.moveDraggingColumn(e.x,t,r.movementX),!0}moveDraggingColumn(e,t,r){var i;if(!(this.draggingOffset===void 0||this.initialGridPoint===void 0||this.initialOffset===void 0||this.draggingColumn==null||r===0)){if(this.initialOffset!==this.draggingOffset){this.draggingOffset<this.initialOffset&&this.initialOffset<this.draggingOffset+r||this.draggingOffset>this.initialOffset&&this.initialOffset>this.draggingOffset+r?this.draggingOffset=this.initialOffset:this.draggingOffset+=r,this.draggingColumn=mr(mr({},this.draggingColumn),{},{left:e-this.draggingOffset}),t.setState({draggingColumn:this.draggingColumn});return}var{depth:a}=this.draggingColumn,{model:o}=t.props,{movedColumns:s}=t.state,{metrics:l}=t;if(!l)throw new Error("Metrics not set");var{floatingLeftWidth:d,width:u,columnHeaderMaxDepth:c,allColumnXs:m}=l,v=r<0,f=Ii(this.draggingColumn.range[0],a,l,o);if(f){var g=e-this.draggingOffset,p=g+f.width;this.draggingColumn=mr(mr({},this.draggingColumn),{},{left:g}),t.setState({draggingColumn:this.draggingColumn});var b=Ii(me.getColumnAtX(Le(v?g:p,d,u),l,!0),a,l,o),S=o.getColumnHeaderParentGroup(f.modelIndex,f.depth);if(b){if(S!==void 0){var C=S.getVisibleRange(s);if(b.visibleIndex<C[0]){var y,E=this.moveColumn(f,C[0],s);this.draggingOffset=e-((y=m.get(C[0]))!==null&&y!==void 0?y:0),this.draggingColumn=mr(mr({},this.draggingColumn),{},{left:e-this.draggingOffset}),this.clearScrollInterval(),t.setState({draggingColumn:this.draggingColumn,movedColumns:E});return}if(b.visibleIndex>C[1]){var T,O=this.moveColumn(f,C[1]-(f.range[1]-f.range[0]),s),{right:N=0}=(T=Ii(C[1],0,l,o))!==null&&T!==void 0?T:{};this.draggingOffset=e-(N-f.width),this.draggingColumn=mr(mr({},this.draggingColumn),{},{left:e-this.draggingOffset}),this.clearScrollInterval(),t.setState({draggingColumn:this.draggingColumn,movedColumns:O});return}}if(!o.isColumnMovable(b.modelIndex)){var P=b.visibleIndex;if(v)for(P+=1;P<f.visibleIndex&&!o.isColumnMovable(me.getModelIndex(P,s));)P+=1;else for(P-=1;P>f.visibleIndex&&!o.isColumnMovable(me.getModelIndex(P,s));)P-=1;if(P!==f.visibleIndex){v||(P-=f.range[1]-f.range[0]);var R=this.moveColumn(f,P,s);t.setState({movedColumns:R,draggingColumn:this.draggingColumn})}var A=Ii(P,0,l,o);if(v){var M;this.draggingOffset=e-((M=A==null?void 0:A.left)!==null&&M!==void 0?M:0)}else{var I;this.draggingOffset=e-(((I=A==null?void 0:A.right)!==null&&I!==void 0?I:0)-f.width)}this.draggingColumn=mr(mr({},this.draggingColumn),{},{left:e-this.draggingOffset}),t.setState({draggingColumn:this.draggingColumn});return}if(g<=d?this.setScrollInterval(t,"left"):p>u?this.setScrollInterval(t,"right"):this.clearScrollInterval(),b.visibleIndex!==f.visibleIndex&&!(v&&f.visibleIndex<b.visibleIndex||!v&&f.visibleIndex>b.visibleIndex)){for(var x=b.left+b.width*.5,_=o.getColumnHeaderParentGroup(f.modelIndex,f.depth),k,U=((i=_==null?void 0:_.depth)!==null&&i!==void 0?i:c)-1;U>=0&&k===void 0;)k=o.getColumnHeaderGroup(b.modelIndex,U),U-=1;var G;v&&g<x&&(!k||b.visibleIndex===k.getVisibleRange(s)[0])&&(G=this.moveColumn(f,b.range[0],s)),!v&&p>x&&(!k||b.visibleIndex===k.getVisibleRange(s)[1])&&(G=this.moveColumn(f,b.range[1]-(f.range[1]-f.range[0]),s)),G&&(this.draggingColumn=mr(mr({},this.draggingColumn),{},{left:g}),t.setState({movedColumns:G,draggingColumn:this.draggingColumn}))}}}}}moveColumn(e,t,r){var i=e.isColumnGroup?me.moveRange(e.range,t,r):me.moveItem(e.visibleIndex,t,r),a=t-e.range[0],o=[e.range[0]+a,e.range[1]+a];return this.draggingColumn&&(this.draggingColumn=mr(mr({},this.draggingColumn),{},{range:o})),i}onUp(e,t){return this.cursor=null,this.clearScrollInterval(),this.draggingOffset!=null?(this.draggingOffset=void 0,t.setState({draggingColumn:null,isDragging:!1}),!0):!1}}const tF=eF;function rf(n,e,t){return e=rF(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function rF(n){var e=nF(n,"string");return typeof e=="symbol"?e:String(e)}function nF(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class Oc extends yt{constructor(){super(...arguments),rf(this,"dragOffset",void 0),rf(this,"cursor","default")}static getLeftWithOffsetFromRawLeft(e,t){var r=e.getTheme(),{metrics:i,metricCalculator:a}=e;if(!i)throw new Error("metrics not set");if(r.scrollSnapToColumn){var o=Math.round(t),s=0;return{left:o,leftOffset:s}}var l=Math.floor(t),d=t-l,u=i.allColumnWidths.get(l);if(u==null){var c=e.getMetricState();u=a.getVisibleColumnWidth(l,c)}var m=u*d;return{left:l,leftOffset:m}}isInScrollBar(e,t){var r=t.getTheme(),{scrollBarSize:i,scrollBarHoverSize:a}=r,{metrics:o}=t;if(!o)throw new Error("metrics not set");var{x:s,y:l}=e,{barLeft:d,barWidth:u,height:c,hasHorizontalBar:m}=o;return m&&i>0&&l>=c-a&&l<c&&s>d&&s<d+u}getLeftWithOffset(e,t){var r,{metrics:i}=t;if(!i)throw new Error("metrics not set");var{x:a}=e,{barWidth:o,handleWidth:s,lastLeft:l,barLeft:d,columnCount:u,scrollableContentWidth:c,scrollableViewportWidth:m}=i,v=a-d,f=Le((v-((r=this.dragOffset)!==null&&r!==void 0?r:0))/(o-s),0,1);if(u===1)return{left:0,leftOffset:f*(c-m)};var g=f*l;return Oc.getLeftWithOffsetFromRawLeft(t,g)}onDown(e,t){var{metrics:r}=t;if(!r)throw new Error("metrics not set");var{x:i}=e,{handleWidth:a,barLeft:o,scrollX:s}=r;if(!this.isInScrollBar(e,t))return!1;var l=i-o;if(l>=s&&l<=s+a)this.dragOffset=l-s,t.setState({isDraggingHorizontalScrollBar:!0});else{this.dragOffset=0;var{left:d,leftOffset:u}=this.getLeftWithOffset(e,t);t.setViewState({left:d,leftOffset:u,isDraggingHorizontalScrollBar:!0,isDragging:!0})}return!0}onDrag(e,t){if(this.dragOffset!=null){var{left:r,leftOffset:i}=this.getLeftWithOffset(e,t);return t.setViewState({left:r,leftOffset:i,isDraggingHorizontalScrollBar:!0,isDragging:!0}),!0}return!1}onMove(e,t){return this.isInScrollBar(e,t)}onUp(e,t){return this.dragOffset!==void 0&&(this.dragOffset=void 0,t.setState({isDraggingHorizontalScrollBar:!1,isDragging:!1})),this.isInScrollBar(e,t)}onClick(e,t){return this.isInScrollBar(e,t)}}const iF=Oc;function nf(n,e,t){return e=aF(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function aF(n){var e=oF(n,"string");return typeof e=="symbol"?e:String(e)}function oF(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class sF extends yt{constructor(){super(...arguments),nf(this,"cursor","move"),nf(this,"draggingOffset",void 0)}onDown(e,t){var{model:r}=t.props,{x:i,y:a,row:o}=e,{metrics:s}=t;if(!s)throw new Error("metrics not set");var{columnHeaderHeight:l,rowHeaderWidth:d,allRowYs:u}=s;if(i<=d&&o!==null&&r.isRowMovable(o)){var c=B(u,o);this.draggingOffset=a-c-l,t.setState({draggingRowOffset:this.draggingOffset})}return!1}onDrag(e,t){if(this.draggingOffset==null)return!1;var{model:r}=t.props,{draggingRow:i}=t.state,{mouseX:a,mouseY:o}=t.state;if(a==null||o==null)return!1;if(i==null){var{row:s}=t.getGridPointFromXY(a,o);if(s!=null&&!r.isRowMovable(s)||(i=s,t.setState({draggingRow:i,isDragging:!0}),i==null))return!1}var{metrics:l}=t;if(!l)throw new Error("metrics not set");var{top:d,lastTop:u,bottom:c,bottomVisible:m,rowCount:v,columnHeaderHeight:f,allRowHeights:g,allRowYs:p,height:b}=l,S=f;if(d<i){var C=i-1;S=B(p,C)+B(g,C)*.5+f}var y=b;if(i<c){var E=i+1;y=B(p,E)+B(g,E)*.5+f}var{movedRows:T}=t.state;o<S&&i>0&&r.isRowMovable(i-1)?(T=me.moveItem(i,i-1,T),i-=1):y<o&&i<v-1&&r.isRowMovable(i+1)&&(T=me.moveItem(i,i+1,T),i+=1),t.setState({movedRows:T,draggingRow:i});var O=f+B(g,d)*.5,N=f+B(p,m)+B(g,m)*.5;return o<O&&d>0?t.setState({top:d-1}):o>N&&d<u&&t.setState({top:d+1}),!0}onUp(e,t){return this.draggingOffset!==void 0?(this.draggingOffset=void 0,t.setState({draggingRowOffset:null,draggingRow:null,isDragging:!1}),!0):!1}}const lF=sF;function tr(n,e,t){return e=dF(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function dF(n){var e=uF(n,"string");return typeof e=="symbol"?e:String(e)}function uF(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class Dc extends zC{constructor(){super(...arguments),tr(this,"hiddenCursor","s-resize"),tr(this,"defaultCursor","row-resize"),tr(this,"pointProperty","y"),tr(this,"userSizesProperty","userRowHeights"),tr(this,"visibleOffsetProperty","visibleRowYs"),tr(this,"visibleSizesProperty","visibleRowHeights"),tr(this,"marginProperty","columnHeaderHeight"),tr(this,"calculatedSizesProperty","calculatedRowHeights"),tr(this,"initialSizesProperty","initialRowHeights"),tr(this,"modelIndexesProperty","modelRows"),tr(this,"firstIndexProperty","firstRow"),tr(this,"treePaddingProperty","treePaddingY"),tr(this,"getHiddenItems",me.getHiddenRows),tr(this,"getNextShownItem",me.getNextShownRow),tr(this,"getSeparator",Dc.getRowSeparator)}static getRowSeparator(e,t,r,i){if(!i.allowRowResize)return null;var{x:a,y:o}=e,s=me.getRowSeparatorIndex(a,o,t,i);return s!=null?{index:s,depth:0}:null}setSize(e,t,r){e.setRowHeight(t,r)}resetSize(e,t){e.resetRowHeight(t)}updateSeparator(e,t){e.setState({draggingRowSeparator:t,isDragging:t!==null})}}const hF=Dc;class rd extends yt{static isInTreeBox(e,t){var{column:r,row:i,x:a,y:o}=e,{metrics:s}=t;if(!s)throw new Error("metrics not set");var{gridX:l,gridY:d,firstColumn:u,allColumnXs:c,allColumnWidths:m,allRowHeights:v,allRowYs:f,visibleRowTreeBoxes:g}=s;if(r===u&&i!=null&&g.get(i)!=null&&a>l&&o>d){var p=B(c,r),b=B(m,r),S=B(f,i),C=B(v,i);if(a>=l+p&&a<=l+p+b&&o>=d+S&&o<=d+S+C)return!0}return!1}onDown(e,t){return rd.isInTreeBox(e,t)}onClick(e,t,r){if(rd.isInTreeBox(e,t)){var{row:i}=e;if(i!==null)return t.toggleRowExpanded(i,me.isModifierKeyDown(r)),!0}return!1}}const Eh=rd;class cF extends yt{isInCorner(e,t){var r=t.getTheme(),{scrollBarSize:i}=r,{metrics:a}=t;if(!a)throw new Error("metrics not set");var{x:o,y:s}=e,{width:l,height:d,hasVerticalBar:u,hasHorizontalBar:c}=a;return i>0&&u&&c&&o>=l-i&&s>=d-i&&o<=l&&s<=d}onDown(e,t){return this.isInCorner(e,t)}onUp(e,t){return this.isInCorner(e,t)}onClick(e,t){return this.isInCorner(e,t)}}const mF=cF;function af(n,e,t){return e=vF(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function vF(n){var e=fF(n,"string");return typeof e=="symbol"?e:String(e)}function fF(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class Nc extends yt{constructor(){super(...arguments),af(this,"dragOffset",void 0),af(this,"cursor","default")}static getTopWithOffsetFromRawTop(e,t){var r=e.getTheme(),{metrics:i,metricCalculator:a}=e;if(!i)throw new Error("metrics not set");if(r.scrollSnapToRow){var o=Math.round(t),s=0;return{top:o,topOffset:s}}var l=Math.floor(t),d=t-l,u=i.allRowHeights.get(l);if(u==null){var c=e.getMetricState();u=a.getVisibleRowHeight(l,c)}var m=u*d;return{top:l,topOffset:m}}isInScrollBar(e,t){var r=t.getTheme(),{scrollBarSize:i,scrollBarHoverSize:a}=r,{metrics:o}=t;if(!o)throw new Error("metrics not set");var{x:s,y:l}=e,{barTop:d,barHeight:u,width:c,hasVerticalBar:m}=o;return m&&i>0&&s>=c-a&&s<c&&l>d&&l<d+u}getTopWithOffset(e,t){var r,{metrics:i}=t;if(!i)throw new Error("metrics not set");var{y:a}=e,{barHeight:o,handleHeight:s,lastTop:l,barTop:d,rowCount:u,scrollableContentHeight:c,scrollableViewportHeight:m}=i,v=a-d,f=Le((v-((r=this.dragOffset)!==null&&r!==void 0?r:0))/(o-s),0,1);if(u===1)return{top:0,topOffset:f*(c-m)};var g=f*l;return Nc.getTopWithOffsetFromRawTop(t,g)}onDown(e,t){var{metrics:r}=t;if(!r)throw new Error("metrics not set");var{y:i}=e,{handleHeight:a,barTop:o,scrollY:s}=r;if(!this.isInScrollBar(e,t))return!1;var l=i-o;if(l>=s&&l<=s+a)this.dragOffset=l-s,t.setState({isDraggingVerticalScrollBar:!0});else{this.dragOffset=0;var{top:d,topOffset:u}=this.getTopWithOffset(e,t);t.setViewState({top:d,topOffset:u,isDraggingVerticalScrollBar:!0,isDragging:!0})}return!0}onMove(e,t){return this.isInScrollBar(e,t)}onDrag(e,t){if(this.dragOffset!=null){var{top:r,topOffset:i}=this.getTopWithOffset(e,t);return t.setViewState({top:r,topOffset:i,isDraggingVerticalScrollBar:!0,isDragging:!0}),!0}return!1}onUp(e,t){return this.dragOffset!==void 0&&(this.dragOffset=void 0,t.setState({isDraggingVerticalScrollBar:!1,isDragging:!1})),this.isInScrollBar(e,t)}onClick(e,t){return this.isInScrollBar(e,t)}}const gF=Nc;class pF extends yt{onDoubleClick(e,t){var{column:r,row:i}=e,{model:a}=t.props;return tt(a)&&r!=null&&i!=null&&a.isEditableRange(Q.makeCell(r,i))?(t.startEditing(r,i),!0):!1}}const bF=pF;function QC(n){return(n==null?void 0:n.getTokenBoxesForVisibleCell)!==void 0}function us(n,e,t){return e=CF(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function CF(n){var e=SF(n,"string");return typeof e=="symbol"?e:String(e)}function SF(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class Hd extends yt{constructor(){super(...arguments),us(this,"timeoutId",void 0),us(this,"isHold",!1),us(this,"isDown",!1),us(this,"currentLinkBox",void 0)}isHoveringLink(e,t){var{column:r,row:i,x:a,y:o}=e,{renderer:s,metrics:l,props:d}=t,{model:u}=d;if(r==null||i==null||l==null)return this.currentLinkBox=void 0,!1;var{modelRows:c,modelColumns:m}=l,v=B(c,i),f=B(m,r),g=u.renderTypeForCell(f,v),p=s.getCellRenderer(g);if(!QC(p))return!1;if(this.currentLinkBox!=null){var{x1:b,y1:S,x2:C,y2:y}=this.currentLinkBox;if(a>=b&&a<=C&&o>=S&&o<=y)return!0}for(var E=t.updateRenderState(),T=p.getTokenBoxesForVisibleCell(r,i,E),O=0;O<T.length;O+=1)if(td(T[O].token)){var N=me.translateTokenBox(T[O],l),{x1:P,x2:R,y1:A,y2:M}=N;if(a>=P&&a<=R&&o>=A&&o<=M)return this.currentLinkBox=N,!0}return this.currentLinkBox=void 0,!1}setCursor(e,t){return this.isHoveringLink(e,t)?this.cursor="pointer":this.cursor=null,!1}onMove(e,t){return this.setCursor(e,t)}onDown(e,t,r){var i=this.isHoveringLink(e,t);return me.isModifierKeyDown(r)||r.shiftKey||!i?!1:(this.isDown=!0,this.timeoutId!=null&&clearTimeout(this.timeoutId),this.isHold=!1,this.timeoutId=setTimeout(()=>{this.isHold=!0;var{column:a,row:o}=e,{model:s}=t.props;t.clearSelectedRanges(),t.focus(),t.moveCursorToPosition(a,o),tt(s)&&a!=null&&o!=null&&s.isEditableRange(Q.makeCell(a,o))&&t.startEditing(a,o)},Hd.HOLD_LENGTH),!0)}onClick(e,t){var r=this.isHoveringLink(e,t);if(!r||!this.isDown||this.currentLinkBox==null)return this.isDown=!1,this.isHold=!1,!1;if(!this.isHold){var i;this.timeoutId!=null&&clearTimeout(this.timeoutId),this.timeoutId=void 0,t.props.onTokenClicked((i=this.currentLinkBox)===null||i===void 0?void 0:i.token)}return this.isHold=!1,this.isDown=!1,!0}}us(Hd,"HOLD_LENGTH",1e3);const wF=Hd;function yF(n,e,t){return e=EF(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function EF(n){var e=TF(n,"string");return typeof e=="symbol"?e:String(e)}function TF(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class PF{constructor(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:5e3;yF(this,"order",void 0),this.order=e}onDown(e,t){return!1}onUp(e,t){return!1}}const Ba=PF;class OF extends Ba{onDown(e,t){switch(e.key){case"a":if(me.isModifierKeyDown(e))return t.selectAll(),!0;break;case"ArrowUp":return this.handleArrowMove(0,-1,e,t);case"ArrowDown":return this.handleArrowMove(0,1,e,t);case"ArrowRight":return this.handleArrowMove(1,0,e,t);case"ArrowLeft":return this.handleArrowMove(-1,0,e,t);case"k":case"K":return me.isModifierKeyDown(e)?!1:this.handlePageUp(e,t);case"j":case"J":return me.isModifierKeyDown(e)?!1:this.handlePageDown(e,t);case"h":case"H":return me.isModifierKeyDown(e)?!1:(e.shiftKey||t.clearSelectedRanges(),t.moveCursorToPosition(0,t.state.cursorRow,e.shiftKey),!0);case"l":case"L":{if(me.isModifierKeyDown(e))return!1;var{model:r}=t.props,{columnCount:i}=r;return e.shiftKey||t.clearSelectedRanges(),t.moveCursorToPosition(i-1,t.state.cursorRow,e.shiftKey),!0}case"PageDown":return this.handlePageDown(e,t);case"PageUp":return this.handlePageUp(e,t);case"Home":return e.shiftKey||t.clearSelectedRanges(),t.moveCursorToPosition(me.isModifierKeyDown(e)?t.state.cursorColumn:0,me.isModifierKeyDown(e)?0:t.state.cursorRow,e.shiftKey,!0,!0),!0;case"End":{var{model:a}=t.props,{columnCount:o,rowCount:s}=a;return e.shiftKey||t.clearSelectedRanges(),t.moveCursorToPosition(me.isModifierKeyDown(e)?t.state.cursorColumn:o-1,me.isModifierKeyDown(e)?s-1:t.state.cursorRow,e.shiftKey,!0,!0),!0}case"Escape":return t.clearSelectedRanges(),{preventDefault:!1,stopPropagation:!1};case"Enter":if(t.state.selectedRanges.length>0)return t.moveCursorInDirection(e.shiftKey?Q.SELECTION_DIRECTION.UP:Q.SELECTION_DIRECTION.DOWN),!0;break;case"Tab":if(t.state.selectedRanges.length>0)return t.moveCursorInDirection(e.shiftKey?Q.SELECTION_DIRECTION.LEFT:Q.SELECTION_DIRECTION.RIGHT),!0;break}return!1}handleArrowMove(e,t,r,i){var a=r.shiftKey,o=me.isModifierKeyDown(r);a?i.trimSelectedRanges():i.clearSelectedRanges();var{cursorRow:s,cursorColumn:l,selectionEndColumn:d,selectionEndRow:u}=i.state,c=a?d:l,m=a?u:s;if(o){var{model:v}=i.props,{columnCount:f,rowCount:g}=v,p=o&&a,b=null,S=null;e<0?(b=0,S=m):e>0?(b=f-1,S=m):t<0?(b=c,S=0):t>0&&(b=c,S=g-1),b!=null&&S!=null&&i.moveCursorToPosition(b,S,a,!0,p)}else{if(!i.metrics)throw new Error("grid.metrics are not set");var{theme:C}=i.props,{autoSelectRow:y=!1,autoSelectColumn:E=!1}=C;if(y&&e!==0){var{lastLeft:T}=i.metrics,{left:O}=i.state;O=Le(O+e,0,T),i.moveCursorToPosition(O,s,a,!1),i.setViewState({left:O})}else if(E&&t!==0){var{lastTop:N}=i.metrics,{top:P}=i.state;P=Le(P+t,0,N),i.moveCursorToPosition(P,l,a,!1),i.setViewState({top:P})}else i.moveCursor(e,t,a)}return!0}handlePageUp(e,t){var r=e.shiftKey;r?t.trimSelectedRanges():t.clearSelectedRanges();var{cursorColumn:i,selectionEndRow:a}=t.state,o=a,s=i;if(o==null)return!1;var l=t.getMetricState(),{metricCalculator:d}=t,{bottomVisible:u,topVisible:c,hasHorizontalBar:m}=d.getMetrics(l),v=o-(u-c);v-=m?0:1,v=Math.max(v,0);var f=Math.max(v-(o-c),0);return t.moveCursorToPosition(s,v,r,!1),t.setViewState({top:f}),!0}handlePageDown(e,t){var r=e.shiftKey;r?t.trimSelectedRanges():t.clearSelectedRanges();var{selectionEndRow:i,cursorColumn:a}=t.state,o=i,s=a;if(o===null)return!1;var l=t.getMetricState(),{metricCalculator:d}=t,{bottomVisible:u,topVisible:c,hasHorizontalBar:m,rowCount:v,lastTop:f}=d.getMetrics(l),g=v-1,p=u-c+o;p+=m?0:1,p=Math.min(p,g);var b=Math.min(f,p-(o-c));return t.moveCursorToPosition(s,p,r,!1),t.setViewState({top:b}),!0}}const DF=OF;class NF extends Ba{onDown(e,t){switch(e.key){case"Enter":case" ":return this.handleExpandKey(e,t)}return!1}handleExpandKey(e,t){var{selectedRanges:r}=t.state;if(r.length===1){var i=r[0];if(i.startRow===i.endRow&&i.startColumn===i.endColumn){if(!t.metrics)throw new Error("grid.metrics not set");var{model:a}=t.props,{startRow:o,startColumn:s}=i;if(o!=null){var l=t.getModelRow(o);if((s===0||s==null)&&Ke(a)&&a.isRowExpandable(l))return t.toggleRowExpanded(o),!0}}}return!1}}const RF=NF;class IF extends Ba{onDown(e,t){if(me.isModifierKeyDown(e))return!1;var{model:r}=t.props,{cursorColumn:i,cursorRow:a}=t.state;if(i==null||a==null||!tt(r)||!r.isEditableRange(Q.makeCell(i,a)))return!1;var o=i,s=a;return o==null||s==null?!1:e.key.length===1?(t.startEditing(o,s,!0,[1,1],e.key),!0):e.key==="F2"?(t.startEditing(o,s),!0):e.key==="Backspace"?(t.startEditing(o,s,!0,void 0,""),!0):e.key==="Delete"?(t.setValueForCell(o,s,""),!0):!1}}const FF=IF;function _F(n){for(var e=[],t=n.querySelectorAll("tr"),r=0;r<t.length;r+=1){for(var i=t[r],a=i.querySelectorAll("td"),o=[],s=0;s<a.length;s+=1){var l,d,u=a[s];o.push((l=(d=u.textContent)===null||d===void 0?void 0:d.trim())!==null&&l!==void 0?l:"")}e.push(o)}return e}function MF(n){var e=[];return n.forEach(t=>{var r,i=(r=t.textContent)!==null&&r!==void 0?r:"";i.length>0&&e.push(i.split(/\t|\u00a0\u00a0 \u00a0/))}),e}function xF(n){var e,t,r=n.querySelector("table");if(r!=null)return _F(r);var i=(e=(t=n.textContent)===null||t===void 0?void 0:t.trim())!==null&&e!==void 0?e:"";if(i.length>0){var{childNodes:a}=n,o=i.includes(" "),s=i.includes(" ");return o&&a.length!==0&&(a.length===1||a.length>1&&(a[0].textContent==null||!a[0].textContent.includes(" ")))?i.split(`
|
|
3
3
|
`).map(l=>l.split(" ")):a.length>1||s?MF(n.childNodes):i}return null}class AF extends Ba{onDown(e,t){switch(e.key){case"v":if(me.isModifierKeyDown(e)){var r=document.createElement("div");document.body.appendChild(r),r.setAttribute("contenteditable","true"),r.setAttribute("style",'clip-path: "inset(50%)"; height: 1px; width: 1px; margin: -1px; overflow: hidden; padding 0; position: absolute;');var i=()=>{r.removeEventListener("input",i),r.remove(),t.focus();var a=xF(r);a!=null&&t.pasteValue(a)};return r.addEventListener("input",i),r.focus(),{preventDefault:!1,stopPropagation:!0}}break}return!1}}const LF=AF;var kF=n=>{switch(n){case"ArrowDown":return on.DOWN;case"ArrowUp":return on.UP;case"ArrowLeft":return on.LEFT;case"ArrowRight":return on.RIGHT;default:return}};function Rc(n){var{selectionRange:e=void 0,className:t="",disabled:r=!1,value:i="",isQuickEdit:a=!0,onChange:o=()=>{},onCancel:s=()=>{},onDone:l=()=>{},onContextMenu:d=()=>{},style:u={}}=n,c=w.useRef(null),m=w.useRef(!1),[v]=w.useState(i),[f,g]=w.useState(!1),[p,b]=w.useState(a),[S,C]=w.useState(i);w.useEffect(function(){var{current:I}=c;I!=null&&(I.focus(),e?I.setSelectionRange(e[0],e[1]):I.setSelectionRange(I.value.length,I.value.length))},[e]);var y=w.useCallback(M=>{o(M)},[o]),E=w.useCallback(M=>{var{value:I}=M.target;C(I),g(!0),y(I)},[y,C,g]),T=w.useCallback(()=>{m.current=!0,f&&y(v),g(!1),s()},[v,f,s,y]),O=w.useCallback(()=>{b(!1)},[b]),N=w.useCallback(function(M){var I=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;l(S,{direction:M,fillRange:I})},[l,S]),P=w.useCallback(()=>{m.current||N(null)},[m,N]),R=w.useCallback(M=>{switch(M.stopPropagation(),M.key){case"Escape":M.preventDefault(),T();break;case"Enter":if(M.preventDefault(),me.isModifierKeyDown(M))N(void 0,!0);else if(M.altKey){var I="".concat(S,`
|
|
4
4
|
`);C(I),g(!0),y(I)}else N(M.shiftKey?on.UP:on.DOWN);break;case"Tab":M.preventDefault(),N(M.shiftKey?on.LEFT:on.RIGHT);break;case"ArrowDown":case"ArrowUp":case"ArrowLeft":case"ArrowRight":p&&(M.preventDefault(),N(kF(M.key)));break}},[T,N,p,C,g,y,S]),A=w.useCallback(M=>{d(M)},[d]);return h.jsx("textarea",{ref:c,className:X("grid-cell-input-field",t),value:S,onBlur:P,onChange:E,onKeyDown:R,onContextMenu:A,onClick:O,autoComplete:"off",autoCorrect:"off",autoCapitalize:"off",spellCheck:"false",disabled:r,style:u})}Rc.propTypes={selectionRange:V.arrayOf(V.number),className:V.string,disabled:V.bool,isQuickEdit:V.bool,value:V.string,onChange:V.func,onCancel:V.func,onDone:V.func,onContextMenu:V.func,style:V.shape({})};Rc.defaultProps={selectionRange:null,className:"",disabled:!1,value:"",isQuickEdit:!0,onChange:()=>{},onCancel:()=>{},onDone:()=>{},onContextMenu:()=>{},style:{}};var jF=oe.createContext({});const $F=jF;function of(n,e,t,r,i,a,o){try{var s=n[a](o),l=s.value}catch(d){t(d);return}s.done?e(l):Promise.resolve(l).then(r,i)}function HF(n){return function(){var e=this,t=arguments;return new Promise(function(r,i){var a=n.apply(e,t);function o(l){of(a,r,i,o,s,"next",l)}function s(l){of(a,r,i,o,s,"throw",l)}o(void 0)})}}function sf(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function Na(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?sf(Object(t),!0).forEach(function(r){ct(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):sf(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function ct(n,e,t){return e=BF(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function BF(n){var e=UF(n,"string");return typeof e=="symbol"?e:String(e)}function UF(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class Lr extends w.PureComponent{static getScale(e){var t,r,i,a,o,s=window.devicePixelRatio||1,l=e,d=(t=(r=(i=(a=(o=l.webkitBackingStorePixelRatio)!==null&&o!==void 0?o:l.mozBackingStorePixelRatio)!==null&&a!==void 0?a:l.msBackingStorePixelRatio)!==null&&i!==void 0?i:l.oBackingStorePixelRatio)!==null&&r!==void 0?r:l.backingStorePixelRatio)!==null&&t!==void 0?t:1;return s/d}static getCursorClassName(e){return e!=null&&e!==""?"grid-cursor-".concat(e):null}constructor(e){super(e),ct(this,"renderer",void 0),ct(this,"metricCalculator",void 0),ct(this,"canvas",void 0),ct(this,"canvasContext",void 0),ct(this,"canvasWrapper",void 0),ct(this,"resizeObserver",void 0),ct(this,"animationFrame",void 0),ct(this,"prevMetrics",void 0),ct(this,"metrics",void 0),ct(this,"renderState",void 0),ct(this,"documentCursor",void 0),ct(this,"dragTimer",void 0),ct(this,"keyHandlers",void 0),ct(this,"mouseHandlers",void 0),ct(this,"getCachedKeyHandlers",be(l=>[...l,...this.keyHandlers].sort((d,u)=>d.order-u.order))),ct(this,"getCachedMouseHandlers",be(l=>[...l,...this.mouseHandlers].sort((d,u)=>d.order-u.order))),this.handleClick=this.handleClick.bind(this),this.handleContextMenu=this.handleContextMenu.bind(this),this.handleEditCellCancel=this.handleEditCellCancel.bind(this),this.handleEditCellChange=this.handleEditCellChange.bind(this),this.handleEditCellCommit=this.handleEditCellCommit.bind(this),this.handleDoubleClick=this.handleDoubleClick.bind(this),this.notifyKeyboardHandlers=this.notifyKeyboardHandlers.bind(this),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleKeyUp=this.handleKeyUp.bind(this),this.handleMouseDown=this.handleMouseDown.bind(this),this.handleMouseDrag=this.handleMouseDrag.bind(this),this.handleMouseMove=this.handleMouseMove.bind(this),this.handleMouseLeave=this.handleMouseLeave.bind(this),this.handleMouseUp=this.handleMouseUp.bind(this),this.handleResize=this.handleResize.bind(this),this.handleWheel=this.handleWheel.bind(this);var{isStuckToBottom:t,isStuckToRight:r,metricCalculator:i,movedColumns:a,movedRows:o,renderer:s}=e;this.renderer=s||new Tn,this.metricCalculator=i||new Ha,this.canvas=null,this.canvasContext=null,this.canvasWrapper=oe.createRef(),this.resizeObserver=new window.ResizeObserver(this.handleResize),this.animationFrame=null,this.prevMetrics=null,this.metrics=null,this.renderState={},this.documentCursor=null,this.dragTimer=null,this.keyHandlers=[new FF(400),new LF(450),new DF(500),new RF(900)],this.mouseHandlers=[new hF(100),new KC(200),new lF(300),new tF(400),new bF(450),new gF(500),new iF(600),new mF(700),new Eh(800),new wF(875),new XI(900)],this.state={top:0,left:0,topOffset:0,leftOffset:0,draggingColumn:null,draggingRow:null,draggingRowOffset:null,draggingColumnSeparator:null,draggingRowSeparator:null,isDraggingHorizontalScrollBar:!1,isDraggingVerticalScrollBar:!1,isDragging:!1,mouseX:null,mouseY:null,movedColumns:a,movedRows:o,cursorRow:null,cursorColumn:null,selectionStartRow:null,selectionStartColumn:null,selectionEndRow:null,selectionEndColumn:null,selectedRanges:Te,lastSelectedRanges:Te,cursor:null,editingCell:null,isStuckToBottom:t,isStuckToRight:r}}componentDidMount(){var e;this.initContext(),(e=this.canvas)===null||e===void 0||e.addEventListener("wheel",this.handleWheel,{passive:!1}),this.canvasWrapper.current!=null&&this.resizeObserver.observe(this.canvasWrapper.current),this.updateCanvas();var{isStuckToBottom:t,isStuckToRight:r}=this.props;t&&this.scrollToBottom(),r&&this.scrollToRight()}componentDidUpdate(e,t){var r=Om(e,this.props),i=Om(t,this.state);if(!(r.length===1&&r[0]==="children"&&i.length===0)){var{isStickyBottom:a,isStickyRight:o,movedColumns:s,movedRows:l,onMovedColumnsChanged:d,onMoveColumnComplete:u,onMovedRowsChanged:c,onMoveRowComplete:m}=this.props,{isStickyBottom:v,isStickyRight:f,movedColumns:g,movedRows:p}=e,{movedColumns:b,movedRows:S}=t,{draggingColumn:C,draggingRow:y,movedColumns:E,movedRows:T}=this.state;g!==s&&this.setState({movedColumns:s}),p!==l&&this.setState({movedRows:l}),b!==E&&d(E),t.draggingColumn!=null&&C==null&&u(E),S!==T&&c(T),t.draggingRow!=null&&y==null&&m(T),a!==v&&this.setState({isStuckToBottom:!1}),o!==f&&this.setState({isStuckToRight:!1}),this.updateMetrics(),this.requestUpdateCanvas(),this.checkStickyScroll(),this.validateSelection()&&this.checkSelectionChange(t)}}componentWillUnmount(){var e;this.animationFrame!=null&&cancelAnimationFrame(this.animationFrame),(e=this.canvas)===null||e===void 0||e.removeEventListener("wheel",this.handleWheel),window.removeEventListener("mousemove",this.handleMouseDrag,!0),window.removeEventListener("mouseup",this.handleMouseUp,!0),this.resizeObserver.disconnect(),this.stopDragTimer()}getTheme(){var{theme:e}=this.props;return Lr.getTheme(this.context,e)}getGridPointFromEvent(e){Gv(this.canvas);var t=this.canvas.getBoundingClientRect(),r=e.clientX-t.left,i=e.clientY-t.top;return this.getGridPointFromXY(r,i)}getGridPointFromXY(e,t){if(!this.metrics)throw new Error("metrics must be set");return me.getGridPointFromXY(e,t,this.metrics)}getMetricState(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.state,t=this.getTheme(),{model:r,stateOverride:i}=this.props;if(!this.canvasContext||!this.canvas)throw new Error("Canvas and context must be defined to get metrics");var a=this.canvasContext,o=this.canvas.clientWidth,s=this.canvas.clientHeight,{left:l,top:d,leftOffset:u,topOffset:c,movedColumns:m,movedRows:v,isDraggingHorizontalScrollBar:f,isDraggingVerticalScrollBar:g,draggingColumn:p}=e;return Na({left:l,top:d,leftOffset:u,topOffset:c,width:o,height:s,context:a,theme:t,model:r,movedColumns:m,movedRows:v,isDraggingHorizontalScrollBar:f,isDraggingVerticalScrollBar:g,draggingColumn:p},i)}getKeyHandlers(){var{keyHandlers:e}=this.props;return this.getCachedKeyHandlers(e)}getMouseHandlers(){var{mouseHandlers:e}=this.props;return this.getCachedMouseHandlers(e)}getModelColumn(e){var t,r,i=(t=this.metrics)===null||t===void 0||(r=t.modelColumns)===null||r===void 0?void 0:r.get(e);if(i===void 0)throw new Error("Unable to get ModelIndex for column ".concat(e));return i}getModelRow(e){var t,r,i=(t=this.metrics)===null||t===void 0||(r=t.modelRows)===null||r===void 0?void 0:r.get(e);if(i===void 0)throw new Error("Unable to get ModelIndex for row ".concat(e));return i}toggleRowExpanded(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,r=this.getModelRow(e),{model:i}=this.props;Ke(i)&&i.isRowExpandable(r)&&i.setRowExpanded(r,!i.isRowExpanded(r),t),this.clearSelectedRanges(),this.commitSelection(),this.moveCursorToPosition(0,e),this.commitSelection(),this.setState({isStuckToBottom:!1})}scrollToBottom(){if(this.metrics){var{bottomVisible:e,rowCount:t,top:r,lastTop:i}=this.metrics;(e<t-1&&e>0||r>i)&&this.setState({top:i})}}scrollToRight(){if(this.metrics){var{rightVisible:e,columnCount:t,left:r,lastLeft:i}=this.metrics;(e<t-1&&e>0||r>i)&&this.setState({left:i})}}setSelectedRanges(e){var{model:t}=this.props,{columnCount:r,rowCount:i}=t,{cursorRow:a,cursorColumn:o,selectedRanges:s}=this.state;if(this.setState({selectedRanges:e,lastSelectedRanges:s}),e.length>0){var l=Q.boundedRange(e[0],r,i),d=a,u=o;l.containsCell(o,a)||({row:d,column:u}=l.startCell()),this.setState({selectionStartColumn:l.startColumn,selectionStartRow:l.startRow,selectionEndColumn:l.endColumn,selectionEndRow:l.endRow,cursorColumn:u,cursorRow:d})}}initContext(){var{canvas:e}=this,{canvasOptions:t}=this.props;if(!e)throw new Error("Canvas not set");this.canvasContext=e.getContext("2d",t)}requestUpdateCanvas(){this.animationFrame==null&&(this.animationFrame=requestAnimationFrame(()=>{this.animationFrame=null,this.updateCanvas()}))}updateCanvas(){this.updateCanvasScale(),this.updateMetrics(),this.updateRenderState();var{canvasContext:e,metrics:t,renderState:r}=this;j(e),j(t),j(r),this.renderer.configureContext(e,r);var{onViewChanged:i}=this.props;i(t),this.drawCanvas(t)}updateCanvasScale(){var{canvas:e,canvasContext:t,canvasWrapper:r}=this;if(!e)throw new Error("canvas not set");if(!t)throw new Error("canvasContext not set");if(!r.current)throw new Error("canvasWrapper not set");var i=r.current.getBoundingClientRect(),a=Math.floor(i.width),o=Math.floor(i.height);if(!(parseFloat(e.style.width)===a&&parseFloat(e.style.height)===o)){var s=Lr.getScale(t);e.style.width="".concat(a,"px"),e.style.height="".concat(o,"px"),e.width=a*s,e.height=o*s,t.scale(s,s)}}updateScrollBounds(){if(!this.metrics)throw new Error("metrics not set");var{left:e,top:t}=this.state,{lastLeft:r,lastTop:i}=this.metrics;e>r&&this.setState({left:r,leftOffset:0}),t>i&&this.setState({top:i,topOffset:0})}checkStickyScroll(){if(this.metrics){if(this.prevMetrics){var{rowCount:e,columnCount:t,height:r,width:i}=this.metrics,{rowCount:a,columnCount:o,height:s,width:l}=this.prevMetrics;if(a!==e||r!==s){var{isStuckToBottom:d}=this.state;d&&this.scrollToBottom()}if(o!==t||i!==l){var{isStuckToRight:u}=this.state;u&&this.scrollToRight()}}this.prevMetrics=this.metrics}}updateMetrics(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.state;this.prevMetrics=this.metrics;var{metricCalculator:t}=this,r=this.getMetricState(e);return this.metrics=t.getMetrics(r),this.updateScrollBounds(),this.metrics}checkSelectionChange(e){var{selectedRanges:t}=e,{selectedRanges:r}=this.state;if(r!==t){var{onSelectionChanged:i}=this.props;i(r)}}validateSelection(){for(var{model:e}=this.props,{selectedRanges:t}=this.state,{columnCount:r,rowCount:i}=e,a=0;a<t.length;a+=1){var o=t[a];if(o.endColumn!=null&&o.endColumn>=r||o.endRow!=null&&o.endRow>=i)return this.setState({selectedRanges:[],lastSelectedRanges:[]}),!1}return!0}clearSelectedRanges(){var{selectedRanges:e}=this.state;this.setState({selectedRanges:[],lastSelectedRanges:e})}trimSelectedRanges(){var{selectedRanges:e}=this.state;e.length>0&&this.setState({selectedRanges:e.slice(e.length-1)})}beginSelection(e,t){this.setState({selectionStartColumn:e,selectionStartRow:t,selectionEndColumn:e,selectionEndRow:t,cursorColumn:e,cursorRow:t})}moveSelection(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;this.setState(a=>{var{selectedRanges:o,selectionStartRow:s,selectionStartColumn:l}=a,{theme:d}=this.props,{autoSelectRow:u,autoSelectColumn:c}=d;if(r&&o.length>0){var m=o[o.length-1],v=null,f=null,g=null,p=null;if(i){var b,S,C,y;v=u!==void 0&&u?null:Math.min(e??0,(b=m.startColumn)!==null&&b!==void 0?b:0),f=c!==void 0&&c?null:Math.min(t??0,(S=m.startRow)!==null&&S!==void 0?S:0),g=u!==void 0&&u?null:Math.max(e??0,(C=m.endColumn)!==null&&C!==void 0?C:0),p=c!==void 0&&c?null:Math.max(t??0,(y=m.endRow)!==null&&y!==void 0?y:0)}else v=m.startColumn,f=m.startRow,(l!=null||s!=null)&&((u===void 0||!u)&&(v=l),(c===void 0||!c)&&(f=s)),g=u!==void 0&&u?null:e,p=c!==void 0&&c?null:t;var E=Q.makeNormalized(v,f,g,p);if(m.equals(E))return null;var T=[...o];return T[T.length-1]=E,{selectedRanges:T,selectionEndColumn:e,selectionEndRow:t}}var O=[...o],N=u!==void 0&&u?null:e,P=c!==void 0&&c?null:t;return O.push(Q.makeNormalized(N,P,N,P)),{selectedRanges:O,selectionEndColumn:e,selectionEndRow:t}})}commitSelection(){this.setState(e=>{var{theme:t}=this.props,{autoSelectRow:r}=t,{selectedRanges:i,lastSelectedRanges:a,cursorRow:o,cursorColumn:s}=e;if(i.length===1&&(r!==void 0&&r?Q.rowCount(i)===1:Q.cellCount(i)===1)&&Q.rangeArraysEqual(i,a))return{selectedRanges:[],lastSelectedRanges:[],cursorColumn:null,cursorRow:null};var l=i.slice();if(l.length>1){for(var d=l[l.length-1],u=0;u<l.length-1;u+=1){var c=l[u];if(c.contains(d)){var m=c.subtract(d);l.pop(),l.splice(u,1),l=l.concat(m);break}}l=Q.consolidate(l)}var v=s,f=o;if(!Q.containsCell(l,s,o)){var{model:g}=this.props,{columnCount:p,rowCount:b}=g,S=Q.nextCell(Q.boundedRanges(i,p,b));S!=null?{column:v,row:f}=S:(v=null,f=null)}return l.length===0&&(v=null,f=null),{cursorRow:f,cursorColumn:v,selectedRanges:l,lastSelectedRanges:i}})}setFocusRow(e){var t;if(!(!this.metrics||!this.prevMetrics)){var{gridY:r,height:i,lastTop:a,userRowHeights:o,rowHeight:s}=this.metrics,l=i-r,d=Math.round(l/2)+((t=o.get(e))!==null&&t!==void 0?t:s),u=this.getMetricState(),c=this.metricCalculator.getLastTop(u,e+1,d);this.setState({top:Math.min(a,c),selectedRanges:[new Q(null,e,null,e)],isStuckToBottom:!1});var{cursorColumn:m}=this.state;this.moveCursorToPosition(m,e,!1,!1)}}selectAll(){var{model:e,theme:t}=this.props,{autoSelectRow:r,autoSelectColumn:i}=t,a=i!==void 0&&i?null:0,o=i!==void 0&&i?null:e.rowCount-1,s=r!==void 0&&r?null:0,l=r!==void 0&&r?null:e.columnCount-1;this.setSelectedRanges([new Q(s,a,l,o)])}moveCursor(e,t,r){var{cursorRow:i,cursorColumn:a,selectionEndColumn:o,selectionEndRow:s}=this.state,l=r?o:a,d=r?s:i;if(d===null||l===null){var{left:u,top:c}=this.state;this.moveCursorToPosition(u,c,r)}else{var{model:m}=this.props,{columnCount:v,rowCount:f}=m,g=Le(l+e,0,v-1),p=Le(d+t,0,f-1);this.moveCursorToPosition(g,p,r)}}moveCursorInDirection(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Q.SELECTION_DIRECTION.DOWN,{model:t}=this.props,{columnCount:r,rowCount:i}=t,{cursorRow:a,cursorColumn:o,selectedRanges:s}=this.state,l=s.length>0?s:[Q.makeCell(o,a)],d=null;if(l.length===1&&Q.cellCount(l)===1){var u,c=new Q(0,0,r-1,i-1);d=(u=c.nextCell(o,a,e))!==null&&u!==void 0?u:c.startCell(e)}else d=Q.nextCell(Q.boundedRanges(l,r,i),o,a,e);if(d!=null){var{column:m,row:v}=d;this.setState({cursorColumn:m,cursorRow:v}),Q.containsCell(s,m,v)||this.setState({selectedRanges:[Q.makeCell(m,v)],selectionStartColumn:m,selectionStartRow:v,selectionEndColumn:m,selectionEndRow:v}),this.moveViewToCell(d.column,d.row)}}moveCursorToPosition(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!1;r||this.beginSelection(e,t),this.moveSelection(e,t,r,a),i&&this.moveViewToCell(e,t)}moveViewToCell(e,t){if(!this.metrics)throw new Error("metrics not set");var{metricCalculator:r}=this,{bottomVisible:i,rightVisible:a,topVisible:o,leftVisible:s}=this.metrics,l=this.getMetricState(this.state),{top:d,left:u,topOffset:c,leftOffset:m}=this.state;t!=null&&!me.isFloatingRow(t,this.metrics)&&(t<o?(d=r.getTopForTopVisible(l,t),c=0):t>i&&(d=r.getTopForBottomVisible(l,t),c=0)),e!=null&&!me.isFloatingColumn(e,this.metrics)&&(e<s?(u=r.getLeftForLeftVisible(l,e),m=0):e>a&&(u=r.getLeftForRightVisible(l,e),m=0)),this.setViewState({top:d,left:u,topOffset:c,leftOffset:m})}setViewState(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(!this.metrics)throw new Error("metrics not set");var{isStickyBottom:r,isStickyRight:i}=this.props,{top:a,left:o}=e,{lastTop:s,lastLeft:l,hasVerticalBar:d,hasHorizontalBar:u}=this.metrics;a!=null&&d&&this.setState({isStuckToBottom:r&&a>=s}),o!=null&&u&&this.setState({isStuckToRight:i&&o>=l}),this.setState(e),t&&this.forceUpdate()}startEditing(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,i=arguments.length>3?arguments[3]:void 0,a=arguments.length>4?arguments[4]:void 0,{model:o}=this.props;if(!tt(o))throw new Error("model is not editable");var s=this.getModelColumn(e),l=this.getModelRow(t),d={column:e,row:t,selectionRange:i,value:a!==void 0?a:o.editValueForCell(s,l),isQuickEdit:r};this.setState({editingCell:d,cursorColumn:e,cursorRow:t}),this.moveViewToCell(e,t)}isValidForCell(e,t,r){var{model:i}=this.props,a=this.getModelColumn(e),o=this.getModelRow(t);return tt(i)&&i.isValidForCell(a,o,r)}pasteValue(e){var t=this;return HF(function*(){var{model:r}=t.props,{movedColumns:i,movedRows:a,selectedRanges:o}=t.state;try{if(Wv(r),!r.isEditable||!o.every(p=>r.isEditableRange(p)))throw new Uu("Can't paste in to read-only area.");if(o.length<=0)throw new Uu("Select an area to paste to.");if(typeof e=="string"){var s=[],l=me.getModelRanges(o,i,a);Q.forEachCell(l,(p,b)=>{s.push({column:p,row:b,text:e})}),yield r.setValues(s);return}var d=e.length,u=e[0].length,{columnCount:c,rowCount:m}=r,v=o;if(v.every(p=>{var b,S;return Q.cellCount([p])===1&&((b=p.startColumn)!==null&&b!==void 0?b:0)+u<=c&&((S=p.startRow)!==null&&S!==void 0?S:0)+d<=m})&&(v=v.map(p=>{var b,S;return new Q(p.startColumn,p.startRow,((b=p.startColumn)!==null&&b!==void 0?b:0)+u-1,((S=p.startRow)!==null&&S!==void 0?S:0)+d-1)}),t.setSelectedRanges(v)),!v.every(p=>Q.rowCount([p])===d&&Q.columnCount([p])===u))throw new Uu("Copy and paste area are not same size.");var f=[];v.forEach(p=>{for(var b=0;b<u;b+=1)for(var S=0;S<d;S+=1){var C,y;f.push({column:((C=p.startColumn)!==null&&C!==void 0?C:0)+b,row:((y=p.startRow)!==null&&y!==void 0?y:0)+S,text:e[S][b]})}}),yield r.setValues(f)}catch(p){var{onError:g}=t.props;g(p instanceof Error?p:new Error("".concat(p)))}})()}setValueForCell(e,t,r){var{model:i}=this.props;Wv(i);var a=this.getModelColumn(e),o=this.getModelRow(t);return i.isValidForCell(a,o,r)?(i.setValueForCell(a,o,r),!0):!1}setValueForRanges(e,t){var{model:r}=this.props,{movedColumns:i,movedRows:a}=this.state,o=me.getModelRanges(e,i,a);tt(r)&&r.setValueForRanges(o,t)}isSelected(e,t){for(var{selectedRanges:r}=this.state,i=0;i<r.length;i+=1){var a,o,s=r[i],l=s.startRow===null||s.startRow<=e&&e<=((a=s.endRow)!==null&&a!==void 0?a:0),d=s.startColumn===null||s.startColumn<=t&&t<=((o=s.endColumn)!==null&&o!==void 0?o:0);if(l&&d)return!0}return!1}addDocumentCursor(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null;this.documentCursor!==Lr.getCursorClassName(e)&&(this.documentCursor!=null&&document.documentElement.classList.remove(this.documentCursor),this.documentCursor=Lr.getCursorClassName(e),this.documentCursor!=null&&document.documentElement.classList.add(this.documentCursor),document.documentElement.classList.add("grid-block-events"))}removeDocumentCursor(){this.documentCursor!=null&&(document.documentElement.classList.remove(this.documentCursor),document.documentElement.classList.remove("grid-block-events"),this.documentCursor=null)}startDragTimer(e){this.stopDragTimer();var t=new MouseEvent("custom",e.nativeEvent);this.dragTimer=setTimeout(()=>{this.handleMouseDrag(t)},Lr.dragTimeout)}stopDragTimer(){this.dragTimer&&(clearTimeout(this.dragTimer),this.dragTimer=null)}drawCanvas(){if(arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.updateMetrics(),!this.canvas)throw new Error("canvas is not set");if(!this.canvasContext)throw new Error("context not set");var{renderer:e,canvasContext:t,renderState:r}=this;t.save(),e.drawCanvas(r),t.restore()}focus(){var e;(e=this.canvas)===null||e===void 0||e.focus()}isFocused(){return document.activeElement===this.canvas}handleClick(e){for(var t,r=this.getGridPointFromEvent(e),i=this.getMouseHandlers(),a=0;a<i.length;a+=1){var o=i[a];if(o.onClick(r,this,e)!==!1){e.stopPropagation(),e.preventDefault();break}}(t=this.canvas)===null||t===void 0||t.focus()}handleContextMenu(e){for(var t=this.getGridPointFromEvent(e),r=this.getMouseHandlers(),i=0;i<r.length;i+=1){var a=r[i];if(a.onContextMenu(t,this,e)!==!1){e.stopPropagation(),e.preventDefault();break}}}notifyKeyboardHandlers(e,t){for(var r=this.getKeyHandlers(),i=0;i<r.length;i+=1){var a=r[i],o=a[e]!=null&&a[e](t,this);if(o!==!1){var s,l,d=o;(!((s=d==null?void 0:d.stopPropagation)!==null&&s!==void 0)||s)&&t.stopPropagation(),(!((l=d==null?void 0:d.preventDefault)!==null&&l!==void 0)||l)&&t.preventDefault();break}}}handleKeyDown(e){this.notifyKeyboardHandlers("onDown",e)}handleKeyUp(e){this.notifyKeyboardHandlers("onUp",e)}notifyMouseHandlers(e,t){for(var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1,a=this.getGridPointFromEvent(t),o=this.getMouseHandlers(),s=null,l=0;l<o.length;l+=1){var d=o[l],u=d[e]!=null&&d[e](a,this,t);if(u!==!1){var c,m;d.cursor!=null&&({cursor:s}=d,i&&this.addDocumentCursor(s));var v=u;(!((c=v==null?void 0:v.stopPropagation)!==null&&c!==void 0)||c)&&t.stopPropagation(),(!((m=v==null?void 0:v.preventDefault)!==null&&m!==void 0)||m)&&t.preventDefault();break}}if(this.setState({cursor:s}),r){var{x:f,y:g}=a;this.setState({mouseX:f,mouseY:g})}}handleMouseDown(e){window.addEventListener("mousemove",this.handleMouseDrag,!0),window.addEventListener("mouseup",this.handleMouseUp,!0),!(e.button!=null&&e.button!==0)&&(this.notifyMouseHandlers("onDown",e),this.startDragTimer(e))}handleDoubleClick(e){this.notifyMouseHandlers("onDoubleClick",e)}handleMouseMove(e){this.notifyMouseHandlers("onMove",e)}handleMouseLeave(e){this.notifyMouseHandlers("onLeave",e,!1),this.setState({mouseX:null,mouseY:null})}handleMouseDrag(e){this.setState({isDragging:!0}),this.notifyMouseHandlers("onDrag",e,!0,!0),this.stopDragTimer()}handleMouseUp(e){window.removeEventListener("mousemove",this.handleMouseDrag,!0),window.removeEventListener("mouseup",this.handleMouseUp,!0),!(e.button!=null&&e.button!==0)&&(this.notifyMouseHandlers("onUp",e,!1),this.stopDragTimer(),this.removeDocumentCursor())}handleResize(){if(this.updateCanvas(),!this.metrics)throw new Error("metrics not set");this.forceUpdate()}handleWheel(e){if(this.notifyMouseHandlers("onWheel",e),!e.defaultPrevented){var{metricCalculator:t,metrics:r}=this,i=this.getMetricState();if(!r)throw new Error("metrics not set");for(var{lastTop:a,lastLeft:o,columnCount:s,rowCount:l,scrollableContentWidth:d,scrollableViewportWidth:u,scrollableContentHeight:c,scrollableViewportHeight:m,hasHorizontalBar:v,hasVerticalBar:f}=r,{top:g,left:p,topOffset:b,leftOffset:S}=r,C=this.getTheme(),{deltaX:y,deltaY:E}=me.getScrollDelta(e,r.barWidth,r.barHeight,r.rowHeight,r.rowHeight);v&&y!==0;){if(S+=y,y=0,s>1){if(S>0&&p>=o||S<0&&p<=0){S=0;break}}else{if(S<=0){S=0;break}var T=d-u;if(S>=T){S=T;break}}if(S>0){var O,N=(O=r.allColumnWidths.get(p))!==null&&O!==void 0?O:t.getVisibleColumnWidth(p,i);S>=N?(y=S-N,S=0,p+=1):C.scrollSnapToColumn&&s>1&&(S=0,p+=1)}else if(S<0){var P,R=(P=r.allColumnWidths.get(p-1))!==null&&P!==void 0?P:t.getVisibleColumnWidth(p-1,i);Math.abs(S)<=R&&C.scrollSnapToColumn&&s>1?(S=0,p-=1):(y=S+R,S=0,p-=1)}}for(;f&&E!==0;){if(b+=E,E=0,l>1){if(b>0&&g>=a||b<0&&g<=0){b=0;break}}else{if(b<=0){b=0;break}var A=c-m;if(b>=A){b=A;break}}if(b>0){var M,I=(M=r.allRowHeights.get(g))!==null&&M!==void 0?M:t.getVisibleRowHeight(g,i);b>=I?(E=b-I,b=0,g+=1):C.scrollSnapToRow&&l>1&&(b=0,g+=1)}else if(b<0){var x,_=(x=r.allRowHeights.get(g-1))!==null&&x!==void 0?x:t.getVisibleRowHeight(g-1,i);Math.abs(b)<=_&&C.scrollSnapToRow&&l>1?(b=0,g-=1):(E=b+_,b=0,g-=1)}}this.setViewState({top:g,left:p,leftOffset:S,topOffset:b}),e.stopPropagation(),e.preventDefault()}}handleEditCellCancel(){this.setState({editingCell:null}),this.focus()}handleEditCellChange(e){this.setState(t=>{var{editingCell:r}=t;try{return Gv(r),{editingCell:Na(Na({},r),{},{value:e})}}catch(a){var{onError:i}=this.props;return i(a instanceof Error?a:new Error("".concat(a))),null}})}handleEditCellCommit(e){var{direction:t=on.DOWN,fillRange:r=!1}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},{editingCell:i,selectedRanges:a}=this.state;if(!i)throw new Error("editingCell not set");var{column:o,row:s}=i;if(!this.isValidForCell(o,s,e)){t===null&&this.setState({editingCell:null});return}r?this.setValueForRanges(a,e):this.setValueForCell(o,s,e),t!==null&&this.moveCursorInDirection(t),this.setState({editingCell:null}),this.focus()}renderInputField(){var{model:e}=this.props,{editingCell:t}=this.state,{metrics:r}=this;if(t==null||r==null||!tt(e))return null;var{selectionRange:i,value:a,isQuickEdit:o}=t,{column:s,row:l}=t,{gridX:d,gridY:u,allColumnXs:c,allRowYs:m,allColumnWidths:v,allRowHeights:f}=r,g=c.get(s),p=m.get(l),b=v.get(s),S=f.get(l),C=g!=null&&p!=null&&b!=null&&S!=null?{position:"absolute",left:d+g,top:u+p,width:b,height:S}:{opacity:0},y=this.getModelColumn(s),E=this.getModelRow(l),T=y!=null&&E!=null?{textAlign:e.textAlignForCell(y,E)}:void 0,O=e.isValidForCell(y,E,a);return h.jsx("div",{style:C,children:h.jsx(Rc,{selectionRange:i,className:X({error:!O}),onCancel:this.handleEditCellCancel,onChange:this.handleEditCellChange,onDone:this.handleEditCellCommit,isQuickEdit:o,style:T,value:a},"".concat(s,",").concat(l))})}updateRenderState(){if(!this.canvas)throw new Error("canvas is not set");if(!this.canvasContext)throw new Error("context not set");var{cursorColumn:e,cursorRow:t,draggingColumn:r,draggingColumnSeparator:i,draggingRow:a,draggingRowOffset:o,draggingRowSeparator:s,editingCell:l,isDraggingHorizontalScrollBar:d,isDraggingVerticalScrollBar:u,isDragging:c,mouseX:m,mouseY:v,selectedRanges:f}=this.state,{model:g,stateOverride:p}=this.props,{metrics:b}=this,S=this.canvasContext,C=this.getTheme(),y=this.canvas.clientWidth,E=this.canvas.clientHeight;return j(b),this.renderState=Na({width:y,height:E,context:S,theme:C,model:g,metrics:b,mouseX:m,mouseY:v,selectedRanges:f,draggingColumn:r,draggingColumnSeparator:i,draggingRow:a,draggingRowOffset:o,draggingRowSeparator:s,editingCell:l,isDraggingHorizontalScrollBar:d,isDraggingVerticalScrollBar:u,isDragging:c,cursorColumn:e,cursorRow:t},p),this.renderState}render(){var{children:e}=this.props,{cursor:t}=this.state;return h.jsxs("div",{className:"grid-wrapper",ref:this.canvasWrapper,children:[h.jsx("canvas",{className:X("grid-canvas",Lr.getCursorClassName(t)),ref:r=>{this.canvas=r},onClick:this.handleClick,onContextMenu:this.handleContextMenu,onDoubleClick:this.handleDoubleClick,onKeyDown:this.handleKeyDown,onKeyUp:this.handleKeyUp,onMouseDown:this.handleMouseDown,onMouseMove:this.handleMouseMove,onMouseLeave:this.handleMouseLeave,tabIndex:0,children:"Your browser does not support HTML canvas. Update your browser?"}),this.renderInputField(),e]})}}ct(Lr,"contextType",$F);ct(Lr,"defaultProps",{canvasOptions:{alpha:!1},isStickyBottom:!1,isStickyRight:!1,isStuckToBottom:!1,isStuckToRight:!1,keyHandlers:Te,mouseHandlers:Te,movedColumns:Te,movedRows:Te,onError:()=>{},onSelectionChanged:()=>{},onMovedColumnsChanged:n=>{},onMoveColumnComplete:()=>{},onMovedRowsChanged:()=>{},onMoveRowComplete:()=>{},onViewChanged:n=>{},onTokenClicked:n=>{td(n)&&window.open(n.href,"_blank","noopener,noreferrer")},stateOverride:{},theme:{autoSelectColumn:!1,autoSelectRow:!1}});ct(Lr,"pixelsPerLine",100/3);ct(Lr,"dragTimeout",1e3);ct(Lr,"getTheme",be((n,e)=>Na(Na(Na({},WC),n),e)));const VF=Lr;function GF(n,e,t){return e=WF(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function WF(n){var e=zF(n,"string");return typeof e=="symbol"?e:String(e)}function zF(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var Vu=5e3;class KF extends Bh{constructor(){super(...arguments),GF(this,"getCachedTokensInText",On((e,t)=>{if(t>=e.length)return me.findTokensWithProtocolInText(e);var r=e.slice(t-1,Vu).search(/\s/),i=t+r;r===-1&&(i=Math.min(Vu,e.length));var a=e.substring(0,i);return me.findTokensWithProtocolInText(a)}))}get floatingTopRowCount(){return 0}get floatingBottomRowCount(){return 0}get floatingLeftColumnCount(){return 0}get floatingRightColumnCount(){return 0}get columnHeaderMaxDepth(){return 1}truncationCharForCell(e,t){}textAlignForCell(e,t){return"left"}colorForCell(e,t,r){return r.textColor}backgroundColorForCell(e,t,r){return null}colorForColumnHeader(e){return null}textForRowHeader(e){return""}textForRowFooter(e){return""}isColumnMovable(e){return!0}isRowMovable(e){return!0}getColumnHeaderGroup(e,t){}getColumnHeaderParentGroup(e,t){}tokensForCell(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Vu,i=this.textForCell(e,t);return this.getCachedTokensInText(i,r)}renderTypeForCell(e,t){return"text"}}const qF=KF;function YF(n,e){var t=ZF(n);if(t!==void 0){var r=i_(n);return"".concat(r," ? ").concat(t," : ").concat(e)}}function XF(n,e){return n.Column.formatRowColor(e)}function QF(n,e){return n.formatColor(e)}var Ss=ie.module("ConditionalFormattingUtils"),wr;(function(n){n.CONDITIONAL="conditional",n.ROWS="rows"})(wr||(wr={}));var pe;(function(n){n.IS_EQUAL="is-equal",n.IS_NOT_EQUAL="is-not-equal",n.IS_BETWEEN="is-between",n.GREATER_THAN="greater-than",n.GREATER_THAN_OR_EQUAL="greater-than-or-equal",n.LESS_THAN="less-than",n.LESS_THAN_OR_EQUAL="less-than-or-equal",n.IS_NULL="is-null",n.IS_NOT_NULL="is-not-null"})(pe||(pe={}));var Ie;(function(n){n.IS_EXACTLY="is-exactly",n.IS_NOT_EXACTLY="is-not-exactly",n.CONTAINS="contains",n.DOES_NOT_CONTAIN="does-not-contain",n.STARTS_WITH="starts-with",n.ENDS_WITH="ends-with",n.IS_NULL="is-null",n.IS_NOT_NULL="is-not-null"})(Ie||(Ie={}));var De;(function(n){n.IS_EXACTLY="is-exactly",n.IS_NOT_EXACTLY="is-not-exactly",n.IS_BEFORE="is-before",n.IS_BEFORE_OR_EQUAL="is-before-or-equal",n.IS_AFTER="is-after",n.IS_AFTER_OR_EQUAL="is-after-or-equal",n.IS_NULL="is-null",n.IS_NOT_NULL="is-not-null"})(De||(De={}));var _t;(function(n){n.IS_TRUE="is-true",n.IS_FALSE="is-false",n.IS_NULL="is-null",n.IS_NOT_NULL="is-not-null"})(_t||(_t={}));var St;(function(n){n.IS_EQUAL="is-equal",n.IS_NOT_EQUAL="is-not-equal",n.IS_NULL="is-null",n.IS_NOT_NULL="is-not-null"})(St||(St={}));var Fe;(function(n){n.NO_FORMATTING="no-formatting",n.POSITIVE="positive",n.NEGATIVE="negative",n.WARN="warn",n.NEUTRAL="neutral",n.ACCENT_1="accent-1",n.ACCENT_2="accent-2",n.CUSTOM="custom"})(Fe||(Fe={}));function lf(n){switch(n){case Fe.NO_FORMATTING:return"No formatting";case Fe.POSITIVE:return"Positive";case Fe.NEGATIVE:return"Negative";case Fe.WARN:return"Warn";case Fe.NEUTRAL:return"Neutral";case Fe.ACCENT_1:return"Accent 1";case Fe.ACCENT_2:return"Accent 2";case Fe.CUSTOM:return"Custom..."}}function nd(n){var{type:e,customConfig:t}=n;switch(e){case Fe.NO_FORMATTING:return;case Fe.POSITIVE:return"#9fde6f";case Fe.NEGATIVE:return"#ff6087";case Fe.WARN:return"#f67f40";case Fe.NEUTRAL:return"#ffd95c";case Fe.ACCENT_1:return"#78dce8";case Fe.ACCENT_2:return"#ab9bf5";case Fe.CUSTOM:return t==null?void 0:t.background;default:return}}function id(n){var{type:e,customConfig:t}=n;switch(e){case Fe.NO_FORMATTING:return;case Fe.POSITIVE:return"#526a3f";case Fe.NEGATIVE:return"#802f44";case Fe.WARN:return"#663318";case Fe.NEUTRAL:return"#63562b";case Fe.ACCENT_1:return"#3f6469";case Fe.ACCENT_2:return"#554d72";case Fe.CUSTOM:return t==null?void 0:t.color;default:return}}function ZF(n){var e=id(n.style),t=nd(n.style);if(!(e===void 0||t===void 0))return"bgfg(`".concat(t,"`, `").concat(e,"`)")}function JF(n){var{column:e,value:t,start:r,end:i}=n;return f_(e.name,n.condition,t,r,i)}function e_(n){var{column:e,value:t}=n;return g_(e.name,n.condition,t)}function t_(n){var{column:e,value:t}=n;return p_(e.name,n.condition,t)}function r_(n){var{column:e}=n;return b_(e.name,n.condition)}function n_(n){var{column:e,value:t}=n;return C_(e.name,n.condition,t)}function i_(n){var{column:e}=n;if(F.isNumberType(e.type))return JF(n);if(F.isCharType(e.type))return n_(n);if(F.isStringType(e.type))return e_(n);if(F.isDateType(e.type))return t_(n);if(F.isBooleanType(e.type))return r_(n);throw new Error("Invalid column type")}function a_(n){switch(n){case pe.IS_EQUAL:return"is equal to";case pe.IS_NOT_EQUAL:return"is not equal to";case pe.IS_BETWEEN:return"is between";case pe.GREATER_THAN:return"greater than";case pe.GREATER_THAN_OR_EQUAL:return"greater than or equal to";case pe.LESS_THAN:return"less than";case pe.LESS_THAN_OR_EQUAL:return"less than or equal to";case pe.IS_NULL:return"is null";case pe.IS_NOT_NULL:return"is not null"}}function o_(n){switch(n){case Ie.IS_EXACTLY:return"is exactly";case Ie.IS_NOT_EXACTLY:return"is not exactly";case Ie.CONTAINS:return"contains";case Ie.DOES_NOT_CONTAIN:return"does not contain";case Ie.STARTS_WITH:return"starts with";case Ie.ENDS_WITH:return"ends with";case Ie.IS_NULL:return"is null";case Ie.IS_NOT_NULL:return"is not null"}}function s_(n){switch(n){case De.IS_EXACTLY:return"is";case De.IS_NOT_EXACTLY:return"is not";case De.IS_BEFORE:return"is before";case De.IS_BEFORE_OR_EQUAL:return"is before or equal";case De.IS_AFTER:return"is after";case De.IS_AFTER_OR_EQUAL:return"is after or equal";case De.IS_NULL:return"is null";case De.IS_NOT_NULL:return"is not null"}}function l_(n){switch(n){case _t.IS_TRUE:return"is true";case _t.IS_FALSE:return"is false";case _t.IS_NULL:return"is null";case _t.IS_NOT_NULL:return"is not null"}}function d_(n){switch(n){case St.IS_EQUAL:return"is";case St.IS_NOT_EQUAL:return"is not";case St.IS_NULL:return"is null";case St.IS_NOT_NULL:return"is not null"}}function ZC(n){if(F.isNumberType(n))return pe.IS_EQUAL;if(F.isCharType(n))return St.IS_EQUAL;if(F.isStringType(n))return Ie.IS_EXACTLY;if(F.isDateType(n))return De.IS_EXACTLY;if(F.isBooleanType(n))return _t.IS_TRUE;throw new Error("Invalid column type")}function JC(n){if(F.isCharType(n)||F.isStringType(n))return""}function eS(n){var{condition:e,value:t,start:r,end:i}=n;return{condition:e,value:t,start:r,end:i}}function Bd(n){return{condition:ZC(n),value:JC(n),start:void 0,end:void 0}}function tS(){return{type:Fe.NO_FORMATTING}}function u_(n){switch(n){case Ie.IS_EXACTLY:return"==";case Ie.IS_NOT_EXACTLY:return"!=";case Ie.CONTAINS:return"contains";case Ie.DOES_NOT_CONTAIN:return"does not contain";case Ie.STARTS_WITH:return"starts with";case Ie.ENDS_WITH:return"ends with";case Ie.IS_NULL:return"is null";case Ie.IS_NOT_NULL:return"is not null"}}function h_(n){switch(n){case De.IS_EXACTLY:return"==";case De.IS_NOT_EXACTLY:return"!=";case De.IS_BEFORE:return"<";case De.IS_BEFORE_OR_EQUAL:return"<=";case De.IS_AFTER:return">";case De.IS_AFTER_OR_EQUAL:return">=";case De.IS_NULL:return"is null";case De.IS_NOT_NULL:return"is not null"}}function c_(n){switch(n){case _t.IS_TRUE:return"is true";case _t.IS_FALSE:return"is false";case _t.IS_NULL:return"is null";case _t.IS_NOT_NULL:return"is not null"}}function m_(n){switch(n){case St.IS_EQUAL:return"==";case St.IS_NOT_EQUAL:return"!=";case St.IS_NULL:return"is null";case St.IS_NOT_NULL:return"is not null"}}function v_(n){switch(n){case pe.IS_EQUAL:return"==";case pe.IS_NOT_EQUAL:return"!=";case pe.IS_BETWEEN:return"==";case pe.GREATER_THAN:return">";case pe.GREATER_THAN_OR_EQUAL:return">=";case pe.LESS_THAN:return"<";case pe.LESS_THAN_OR_EQUAL:return"<=";case pe.IS_NULL:return"is null";case pe.IS_NOT_NULL:return"is not null"}}function f_(n,e,t,r,i){switch(e){case pe.IS_EQUAL:return"".concat(n," == ").concat(t);case pe.IS_NOT_EQUAL:return"".concat(n," != ").concat(t);case pe.IS_BETWEEN:return"".concat(n," > ").concat(r," && ").concat(n," < ").concat(i);case pe.GREATER_THAN:return"".concat(n," > ").concat(t);case pe.GREATER_THAN_OR_EQUAL:return"".concat(n," >= ").concat(t);case pe.LESS_THAN:return"".concat(n," < ").concat(t);case pe.LESS_THAN_OR_EQUAL:return"".concat(n," <= ").concat(t);case pe.IS_NULL:return"".concat(n," == null");case pe.IS_NOT_NULL:return"".concat(n," != null")}}function g_(n,e,t){switch(e){case Ie.IS_EXACTLY:return"".concat(n,' == "').concat(t,'"');case Ie.IS_NOT_EXACTLY:return"".concat(n,' != "').concat(t,'"');case Ie.CONTAINS:return"".concat(n," != null && ").concat(n,'.contains("').concat(t,'")');case Ie.DOES_NOT_CONTAIN:return"".concat(n," != null && !").concat(n,'.contains("').concat(t,'")');case Ie.STARTS_WITH:return"".concat(n," != null && ").concat(n,'.startsWith("').concat(t,'")');case Ie.ENDS_WITH:return"".concat(n," != null && ").concat(n,'.endsWith("').concat(t,'")');case Ie.IS_NULL:return"".concat(n," == null");case Ie.IS_NOT_NULL:return"".concat(n," != null")}}function p_(n,e,t){switch(e){case De.IS_EXACTLY:return"".concat(n,' == convertDateTime("').concat(t,'")');case De.IS_NOT_EXACTLY:return"".concat(n," != convertDateTime(`").concat(t,"`)");case De.IS_BEFORE:return"".concat(n," < convertDateTime(`").concat(t,"`)");case De.IS_BEFORE_OR_EQUAL:return"".concat(n,' <= convertDateTime("').concat(t,'")');case De.IS_AFTER:return"".concat(n," > convertDateTime(`").concat(t,"`)");case De.IS_AFTER_OR_EQUAL:return"".concat(n," >= convertDateTime(`").concat(t,"`)");case De.IS_NULL:return"".concat(n," == null");case De.IS_NOT_NULL:return"".concat(n," != null")}}function b_(n,e){switch(e){case _t.IS_TRUE:return"".concat(n," == true");case _t.IS_FALSE:return"".concat(n," == false");case _t.IS_NULL:return"".concat(n," == null");case _t.IS_NOT_NULL:return"".concat(n," != null")}}function C_(n,e,t){switch(e){case St.IS_EQUAL:return"".concat(n," == '").concat(t,"'");case St.IS_NOT_EQUAL:return"".concat(n," != '").concat(t,"'");case St.IS_NULL:return"isNull(".concat(n,")");case St.IS_NOT_NULL:return"!isNull(".concat(n,")")}}function S_(n,e){if(F.isNumberType(n))return v_(e);if(F.isCharType(n))return m_(e);if(F.isStringType(n))return u_(e);if(F.isDateType(n))return h_(e);if(F.isBooleanType(n))return c_(e);throw new Error("Invalid column type")}function w_(n,e,t){if(t===void 0)return Ss.debug("no rules passed."),[];var r=[],i,a=new Map;return t.forEach(o=>{var s,{config:l,type:d}=o,{column:u}=l,c=e.find(b=>{var{name:S,type:C}=b;return S===u.name&&C===u.type});if(c===void 0){Ss.debug("Column ".concat(u.name,":").concat(u.type," not found. Ignoring format rule."),l);return}var[m,v]=(s=d===wr.CONDITIONAL?a.get(c.name):i)!==null&&s!==void 0?s:["null",void 0],f=YF(l,m);if(f===void 0){Ss.debug("Ignoring format rule.",l);return}var g=v===void 0?-1:r.indexOf(v);g>-1&&r.splice(g,1);var p=d===wr.CONDITIONAL?QF(c,f):XF(n,f);r.push(p),d===wr.CONDITIONAL?a.set(c.name,[f,p]):i=[f,p]}),r}function y_(n,e,t){switch(e){case De.IS_NULL:case De.IS_NOT_NULL:return!0;default:{var[r,...i]=(t??"").split(" "),a=i.join(" ");try{Ze.parseDateTimeString(r)}catch{return Ss.debug("Invalid datetime string",r),!1}try{n.i18n.TimeZone.getTimeZone(a)}catch{return Ss.debug("Invalid timezone string",a),!1}return!0}}}function E_(n){var{type:e}=n;return F.isNumberType(e)||F.isCharType(e)||F.isStringType(e)||F.isDateType(e)||F.isBooleanType(e)}function Ud(n){var{animation:e="iris-grid-bottom-bar-slide-up",children:t,className:r,isShown:i,onClick:a,onEntering:o,onEntered:s,onExiting:l,onExited:d}=n;return h.jsx(Sr,{in:i,timeout:et.transitionMs,classNames:e,onEntering:o,onEntered:s,onExiting:l,onExited:d,mountOnEnter:!0,unmountOnExit:!0,children:h.jsx("div",{className:X("iris-grid-bottom-bar",r),role:"presentation",onClick:a,onKeyPress:a,children:t})})}var T_=3e3,P_=5;function O_(n){var{isSaving:e=!1,onSave:t,onDiscard:r,discardTooltip:i,saveTooltip:a,error:o,pendingDataErrors:s,pendingDataMap:l,onEntering:d,onEntered:u,onExiting:c,onExited:m}=n,[v,f]=w.useState(!1),[g,p]=w.useState(!1),b=w.useRef(),S=Nd(e),C=w.useMemo(()=>s.size===0?o:s.size<=P_?"Key can't be empty (on pending row".concat(s.size>1?"s":""," ").concat(Array.from(s.keys()).join(", ").trim(),")"):"Key can't be empty (on ".concat(s.size," rows)"),[o,s]);w.useEffect(function(){S!=null&&S&&!e&&C==null&&(f(!0),p(!0),b.current=setTimeout(()=>{f(!1)},T_))},[C,e,S]),w.useEffect(function(){b.current&&l.size>0&&(clearTimeout(b.current),f(!1),p(!1))},[l]),w.useEffect(function(){return()=>b.current?clearTimeout(b.current):void 0},[]);var y=l.size,E;return e?E=h.jsx(ia,{className:"loading-spinner-vertical-align"}):g&&(E=zh),h.jsxs(Ud,{className:"pending-data-bottom-bar",isShown:y>0||v||C!=null,onEntering:d,onEntered:u,onExiting:c,onExited:()=>{p(!1),m&&m()},children:[C!=null&&C!==""&&h.jsxs("div",{className:"error-message",children:[h.jsx(ue,{icon:ta}),h.jsx("span",{children:"".concat(C)})]}),(C==null||C==="")&&h.jsx("div",{className:"status-message",children:y>0&&h.jsx("span",{children:"".concat(y," row").concat(y>1?"s":""," pending")})}),h.jsxs("div",{className:"buttons-container",children:[!e&&!g&&h.jsx(K,{kind:"secondary",onClick:r,tooltip:i,children:"Discard"}),h.jsxs(K,{kind:g?"success":"primary",onClick:t,icon:E,disabled:e||g||C!=null,tooltip:a,children:[e&&"Committing...",!e&&g&&"Success",!e&&!g&&"Commit"]})]})]})}var Th;(function(n){n.COUNT="Count",n.MIN="Min",n.MAX="Max",n.SUM="Sum",n.ABS_SUM="AbsSum",n.VAR="Var",n.AVG="Avg",n.STD="Std",n.FIRST="First",n.LAST="Last",n.SKIP="Skip",n.COUNT_DISTINCT="CountDistinct",n.DISTINCT="Distinct",n.UNIQUE="Unique"})(Th||(Th={}));const ke=Th;var D_=[ke.SUM,ke.ABS_SUM,ke.MIN,ke.MAX,ke.VAR,ke.AVG,ke.STD,ke.FIRST,ke.LAST,ke.COUNT_DISTINCT,ke.DISTINCT,ke.COUNT,ke.UNIQUE],N_=n=>{switch(n){default:return!1}},R_=(n,e)=>{switch(n){case ke.COUNT:case ke.FIRST:case ke.LAST:case ke.COUNT_DISTINCT:case ke.DISTINCT:case ke.UNIQUE:return!0;case ke.MIN:case ke.MAX:return F.isNumberType(e)||F.isDateType(e)||F.isTextType(e);case ke.SUM:case ke.ABS_SUM:case ke.VAR:case ke.AVG:case ke.STD:return F.isNumberType(e);case ke.SKIP:return!1}},Ic=(n,e)=>n.filter(t=>t.isProxy!==!0&&R_(e,t.type)),I_=(n,e,t,r)=>Ic(n,e).map(i=>{var{name:a}=i;return a}).filter(i=>t.includes(i)?!r:r);const Zi={isRollupOperation:N_,filterValidColumns:Ic,getOperationColumnNames:I_};var Ph;(function(n){n.FILTER_CONTROL_CHANGE_CLEARS_ALL_FILTERS="filter-control-change-clears-all-filters",n.LINK_CHANGE_CLEARS_ALL_FILTERS="link-change-clears-all-filters"})(Ph||(Ph={}));const So=Ph;var F_=Object.freeze([[So.FILTER_CONTROL_CHANGE_CLEARS_ALL_FILTERS,!1],[So.LINK_CHANGE_CLEARS_ALL_FILTERS,!1]]);const rS={DEFAULTS:F_};function Hi(n,e,t){return e=__(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function __(n){var e=M_(n,"string");return typeof e=="symbol"?e:String(e)}function M_(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var x_=ie.module("ColumnHeaderGroup");function Gu(n){return n instanceof nn}class nn{constructor(e){var{name:t,children:r,color:i,depth:a,childIndexes:o,parent:s}=e;Hi(this,"name",void 0),Hi(this,"children",void 0),Hi(this,"depth",void 0),Hi(this,"parent",void 0),Hi(this,"color",void 0),Hi(this,"childIndexes",void 0),Hi(this,"getVisibleRange",be(l=>{var d=this.childIndexes.flat(),u=ae.getVisibleIndexes(d,l),c=Math.min(...u),m=Math.max(...u);return m-c!==d.length-1&&x_.warn("Column header group ".concat(this.name," is not contiguous")),[c,m]})),this.name=t,this.children=r,this.color=i,this.depth=a,this.childIndexes=o,this.parent=s}setParent(e){this.parent=e}addChildren(e){var t=new Set(this.children.concat(e));this.children=[...t]}removeChildren(e){var t=new Set(this.children);e.forEach(r=>t.delete(r)),this.children=[...t]}get isNew(){return this.name.startsWith(nn.NEW_GROUP_PREFIX)}}Hi(nn,"NEW_GROUP_PREFIX",":newGroup");function Ln(n){return(n==null?void 0:n.isPartitionRequired)!==void 0&&(n==null?void 0:n.partitionColumns)!==void 0&&(n==null?void 0:n.partitionKeysTable)!==void 0&&(n==null?void 0:n.partitionMergedTable)!==void 0&&(n==null?void 0:n.partitionTable)!==void 0}function Oh(n){return Ln(n)&&n.partitionConfig!==void 0}var A_=["selectedValues"],L_=["selectedValues"];function df(n,e){if(n==null)return{};var t=k_(n,e),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(n);for(i=0;i<a.length;i++)r=a[i],!(e.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(n,r)&&(t[r]=n[r])}return t}function k_(n,e){if(n==null)return{};var t={},r=Object.keys(n),i,a;for(a=0;a<r.length;a++)i=r[a],!(e.indexOf(i)>=0)&&(t[i]=n[i]);return t}function uf(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function Nr(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?uf(Object(t),!0).forEach(function(r){Dh(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):uf(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function Dh(n,e,t){return e=j_(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function j_(n){var e=$_(n,"string");return typeof e=="symbol"?e:String(e)}function $_(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var Zo=ie.module("IrisGridUtils");function eG(n){return n.partition!==void 0}function hf(n){return Array.isArray(n.partitions)}function Fi(n,e){return n>=0&&n<e.length}function H_(n){return(n==null?void 0:n.asDate)!=null}class Je{static dehydrateGridState(e,t){var{isStuckToBottom:r,isStuckToRight:i,movedColumns:a,movedRows:o}=t,{columns:s}=e;return{isStuckToBottom:r,isStuckToRight:i,movedColumns:[...a].filter(l=>{var{to:d,from:u}=l;return Fi(d,s)&&(typeof u=="number"&&Fi(u,s)||Array.isArray(u)&&Fi(u[0],s)&&Fi(u[1],s))}).map(l=>{var{to:d,from:u}=l;return{to:s[d].name,from:Array.isArray(u)?[s[u[0]].name,s[u[1]].name]:s[u].name}}),movedRows:[...o]}}static hydrateGridState(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[],{isStuckToBottom:i,isStuckToRight:a,movedColumns:o,movedRows:s}=t,{columns:l}=e,d=Je.parseCustomColumnNames(r),u=l.map(c=>{var{name:m}=c;return m}).concat(d);return{isStuckToBottom:i,isStuckToRight:a,movedColumns:[...o].map(c=>{var{to:m,from:v}=c,f=g=>typeof g=="string"?u.findIndex(p=>p===g):g;return{to:f(m),from:Array.isArray(v)?[f(v[0]),f(v[1])]:f(v)}}).filter(c=>{var{to:m,from:v}=c;return Fi(m,u)&&(typeof v=="number"&&Fi(v,u)||Array.isArray(v)&&Fi(v[0],u)&&Fi(v[1],u))}),movedRows:[...s]}}static dehydrateIrisGridPanelState(e,t){var{isSelectingPartition:r,partitions:i,advancedSettings:a}=t;return{isSelectingPartition:r,partitions:i,advancedSettings:[...a]}}static hydrateIrisGridPanelState(e,t){var{isSelectingPartition:r,advancedSettings:i}=t,a=hf(t)?t.partitions:[t.partition];return{isSelectingPartition:r,partitions:a,advancedSettings:new Map([...rS.DEFAULTS,...i])}}static dehydrateQuickFilters(e){return[...e].map(t=>{var[r,i]=t,{text:a}=i;return[r,{text:a}]})}static dehydrateLong(e){return e!=null?"".concat(e):null}static dehydrateSort(e){return e.map(t=>{var{column:r,isAbs:i,direction:a}=t;return{column:r.name,isAbs:i,direction:a}})}static extractTableSettings(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],{irisGridPanelState:r,irisGridState:i}=e,a=hf(r)?r.partitions:[r.partition],{advancedFilters:o,quickFilters:s,sorts:l}=i;return{advancedFilters:o,inputFilters:t,partitions:a,quickFilters:s,sorts:l}}static getInputFiltersForColumns(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];return t.filter(r=>{var{name:i,type:a}=r;return e.find(o=>{var{name:s,type:l}=o;return s===i&&l===a})})}static getFiltersFromFilterMap(e){for(var t=[],r=Array.from(e.keys()),i=0;i<r.length;i+=1){var a=r[i],o=e.get(a);(o==null?void 0:o.filter)!=null&&t.push(o.filter)}return t}static getHiddenColumns(e){return[...e.entries()].filter(t=>{var[,r]=t;return r===0}).map(t=>{var[r]=t;return r})}static parseCustomColumnNames(e){return e.map(t=>t.split("=")[0])}static getRemovedCustomColumnNames(e,t){var r=Je.parseCustomColumnNames(e),i=Je.parseCustomColumnNames(t);return r.filter(a=>!i.includes(a))}static removeSortsInColumns(e,t){return e.filter(r=>!t.includes(r.column.name))}static removeFiltersInColumns(e,t,r){var i=e.map(o=>{var{name:s}=o;return s}),a=new Map(t);return r.forEach(o=>a.delete(i.indexOf(o))),a}static removeColumnFromMovedColumns(e,t,r){for(var i=e.map(l=>{var{name:d}=l;return d}),a=[...t],o=function(){for(var d=r[s],u=i.findIndex(b=>b===d),c=[],m=0;m<a.length;m+=1){var v=a[m],f=Nr({},v),[g,p]=Array.isArray(v.from)?v.from:[v.from,v.from];u<=v.to&&(f.to-=1),u<g&&(g-=1),u<=p&&(p-=1),g<=p&&g!==f.to&&(g===p?c.push(Nr(Nr({},f),{},{from:g})):c.push(Nr(Nr({},f),{},{from:[g,p]}))),u=ae.applyItemMoves(u,u,[v])[0][0]}a=c,i.splice(i.findIndex(b=>b===d),1)},s=0;s<r.length;s+=1)o();return a}static removeColumnsFromSelectDistinctColumns(e,t){return e.filter(r=>!t.includes(r))}static getVisibleColumnsInRange(e,t,r,i,a){for(var o=[],s=t;s<=r;s+=1){var l=ae.getModelIndex(s,i);l>=0&&l<e.length&&!a.includes(l)&&o.push(e[l])}return o}static getPrevVisibleColumns(e,t,r,i,a){for(var o=[],s=t;s>=0&&o.length<r;){var l=ae.getModelIndex(s,i);l>=0&&l<e.length&&!a.includes(l)&&o.unshift(e[l]),s-=1}return o}static getNextVisibleColumns(e,t,r,i,a){for(var o=[],s=t;s<e.length&&o.length<r;){var l=ae.getModelIndex(s,i);l>=0&&l<e.length&&!a.includes(l)&&o.push(e[l]),s+=1}return o}static getColumnsToFetch(e,t,r){var i=[...t];return r.forEach(a=>{var o=e.find(s=>{var{name:l}=s;return l===a});o!=null&&!t.includes(o)&&i.push(o)}),i}static getModelViewportColumns(e,t,r,i){var a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:[],o=arguments.length>5&&arguments[5]!==void 0?arguments[5]:[],s=arguments.length>6&&arguments[6]!==void 0?arguments[6]:0;if(!(t==null||r==null)){var l=Je.getVisibleColumnsInRange(e,t,r,i,a),d=l.length*s,u=Je.getPrevVisibleColumns(e,t-1,d,i,a),c=Je.getNextVisibleColumns(e,r+1,d,i,a),m=[...u,...l,...c];return Je.getColumnsToFetch(e,m,o)}}static isValidSnapshotRanges(e){if(e==null||e.length===0)return!1;for(var t=new Map,r=0;r<e.length;r+=1){var i=e[r],a="".concat(i.startRow,":").concat(i.endRow),o="".concat(i.startColumn,":").concat(i.endColumn);t.has(a)||t.set(a,[]),t.get(a).push(o)}for(var s=[...t.keys()],l=t.get(s[0]).sort().join(","),d=1;d<s.length;d+=1)if(t.get(s[d]).sort().join(",")!==l)return!1;return!0}static isValidIndex(e){return!Number.isInteger(e)||typeof e!="number"?!1:e>=0}static columnsFromRanges(e,t){if(e==null||e.length===0)return[];if(e[0].startColumn===null&&e[0].endColumn===null)return[...t];for(var r=new Set,i=0;i<e.length;i+=1){var a=e[i];j(a.startColumn),j(a.endColumn);for(var o=(s=a.startColumn)!==null&&s!==void 0?s:0;o<=((l=a.endColumn)!==null&&l!==void 0?l:t.length-1);o+=1){var s,l;r.add(o)}}return[...r].map(d=>t[d])}static snapshotDataToMatrix(e){for(var{columns:t,rows:r}=e,i=[],a=0;a<r.length;a+=1){for(var o=r[a],s=[],l=0;l<t.length;l+=1){var d=t[l],u=o.get(d);s.push(u)}i.push(s)}return i}static getModelRollupConfig(e,t,r){var i,a;if(((i=t==null||(a=t.columns)===null||a===void 0?void 0:a.length)!==null&&i!==void 0?i:0)===0)return null;for(var{columns:o=[],showConstituents:s=!0,showNonAggregatedColumns:l=!0,includeDescriptions:d=!0}=t??{},{aggregations:u=[]}=r??{},c=u.map(b=>{var{operation:S,selected:C,invert:y}=b;return Zi.isRollupOperation(S)?[]:Zi.getOperationColumnNames(e,S,C,y)}),m={},v=0;v<u.length;v+=1)m[u[v].operation]=c[v];if(l){var f=new Set(e.map(b=>b.name).filter(b=>!o.includes(b)));if(c.forEach(b=>{b.forEach(S=>f.delete(S))}),f.size>0){var g,p=(g=m[ke.FIRST])!==null&&g!==void 0?g:[];m[ke.FIRST]=[...p,...f]}}return{groupingColumns:o,includeConstituents:s,includeDescriptions:d,aggregations:m}}static getPendingErrors(e){e.forEach((t,r)=>{if(!Je.isValidIndex(r))throw new Error("Invalid rowIndex ".concat(r));var{data:i}=t;i.forEach((a,o)=>{if(!Je.isValidIndex(o))throw new Error("Invalid columnIndex ".concat(o))})})}static getColumn(e,t){return t<e.length?e[t]:(Zo.error("Unable to retrieve column",t,">=",e.length),null)}static getColumnByName(e,t){var r=e.find(i=>{var{name:a}=i;return a===t});return r==null&&Zo.error("Unable to retrieve column by name",t,e.map(i=>{var{name:a}=i;return a})),r}static changeFilterColumnNamesToIndexes(e,t){return t.map(r=>{var{name:i,filter:a}=r,o=e.findIndex(s=>s.name===i);return o<0?null:[o,a]}).filter(r=>r!=null)}static combineFiltersFromList(e,t){t.sort((u,c)=>u.operator==="eq"&&c.operator!=="eq"?1:u.operator!=="eq"&&c.operator==="eq"?-1:u.startColumnIndex-c.startColumnIndex);for(var r="",i=0;i<t.length;i+=1){var{text:a,value:o,operator:s}=t[i];if(o!==void 0){var l="";s!==void 0&&(o==null&&s==="eq"?l="=":s!=="eq"&&(s==="startsWith"||s==="endsWith"?l="*":l=F.getFilterOperatorString(s)));var d="".concat(l).concat(a);s==="startsWith"&&(d="".concat(a).concat(l)),e!=null&&o!==null&&F.isCharType(e)&&(d="".concat(l).concat(String.fromCharCode(parseInt(a,10)))),i!==0&&(r+=s==="eq"?" || ":" && "),r+=d}}return r}static parseColumnHeaderGroups(e,t){var r=1,i=new Map,a=new Map,o=t==null?void 0:t.filter(c=>{var{children:m}=c;return m.length>0});if(o.length===0)return{groups:[],maxDepth:r,parentMap:i,groupMap:a};var s=new Map(o.map(c=>[c.name,c])),l=new Set,d=c=>{var{name:m}=c;if(e.getColumnIndexByName(m)!=null)throw new Error("Column header group has same name as column: ".concat(m));var v=a.get(m);if(v)return v;var f=[],g=1;c.children.forEach(b=>{if(l.has(b))throw new Error("Column group child ".concat(b," specified in multiple groups"));l.add(b);var S=s.get(b),C=e.getColumnIndexByName(b);if(S){var y=d(S);f.push(...y.childIndexes),g=Math.max(g,y.depth+1)}else if(C!=null)f.push(C),g=Math.max(g,1);else throw new Error("Unknown child ".concat(b," in group ").concat(m))});var p=new nn(Nr(Nr({},c),{},{depth:g,childIndexes:f.flat()}));return a.set(m,p),c.children.forEach(b=>i.set(b,p)),r=Math.max(r,p.depth+1),p},u=new Set;return o.forEach(c=>{var{name:m}=c;if(u.has(m))throw new Error("Duplicate column group name: ".concat(m));u.add(m),d(c)}),a.forEach(c=>{var m;c.setParent((m=i.get(c.name))===null||m===void 0?void 0:m.name)}),{groups:[...a.values()],maxDepth:r,groupMap:a,parentMap:i}}static convertValueToText(e,t){if(t!=null&&F.isCharType(t)&&e!=null&&typeof e=="number")return String.fromCharCode(e);if(F.isDateType(t)&&H_(e)){var r=new Date(e.asDate()),i=r.getTimezoneOffset(),a=new Date(r.getTime()-i*60*1e3),o=a.toISOString(),s=o.replace("T"," ").substring(0,23);return s}return e==null?"":"".concat(e)}constructor(e){Dh(this,"dh",void 0),Dh(this,"tableUtils",void 0),this.dh=e,this.tableUtils=new F(e)}dehydrateIrisGridState(e,t){var{aggregationSettings:r={aggregations:Te,showOnTop:!1},advancedFilters:i,customColumnFormatMap:a,isFilterBarShown:o,metrics:s,quickFilters:l,customColumns:d,conditionalFormats:u=Te,reverseType:c,rollupConfig:m=void 0,showSearchBar:v,searchValue:f,selectDistinctColumns:g=Te,selectedSearchColumns:p,sorts:b,invertSearchColumns:S,pendingDataMap:C=Jr,frozenColumns:y,columnHeaderGroups:E,partitionConfig:T=void 0}=t;j(s);var{userColumnWidths:O,userRowHeights:N}=s,{columns:P}=e,R=Ln(e)?e.partitionColumns:[];return{advancedFilters:this.dehydrateAdvancedFilters(P,i),aggregationSettings:r,customColumnFormatMap:[...a],isFilterBarShown:o,quickFilters:Je.dehydrateQuickFilters(l),sorts:Je.dehydrateSort(b),userColumnWidths:[...O].filter(A=>{var[M]=A;return M!=null&&M>=0&&M<P.length}).map(A=>{var[M,I]=A;return[P[M].name,I]}),userRowHeights:[...N],customColumns:[...d],conditionalFormats:[...u],reverseType:c,rollupConfig:m,showSearchBar:v,searchValue:f,selectDistinctColumns:[...g],selectedSearchColumns:p,invertSearchColumns:S,pendingDataMap:this.dehydratePendingDataMap(P,C),frozenColumns:y,columnHeaderGroups:E==null?void 0:E.map(A=>({name:A.name,children:A.children,color:A.color})),partitionConfig:this.dehydratePartitionConfig(R,T)}}hydrateIrisGridState(e,t){var r,i,{advancedFilters:a,aggregationSettings:o={aggregations:[],showOnTop:!1},customColumnFormatMap:s,isFilterBarShown:l,quickFilters:d,sorts:u,customColumns:c,conditionalFormats:m,userColumnWidths:v,userRowHeights:f,reverseType:g,rollupConfig:p=void 0,showSearchBar:b,searchValue:S,selectDistinctColumns:C,selectedSearchColumns:y,invertSearchColumns:E=!0,pendingDataMap:T=[],frozenColumns:O,columnHeaderGroups:N,partitionConfig:P}=t,{columns:R,formatter:A}=e,M=Ln(e)?e.partitionColumns:[];return{advancedFilters:this.hydrateAdvancedFilters(R,a,A.timeZone),aggregationSettings:o,customColumnFormatMap:new Map(s),isFilterBarShown:l,quickFilters:this.hydrateQuickFilters(R,d,A.timeZone),sorts:this.hydrateSort(R,u),userColumnWidths:new Map(v.map(I=>{var[x,_]=I;return typeof x=="string"||x instanceof String?[R.findIndex(k=>{var{name:U}=k;return U===x}),_]:[x,_]}).filter(I=>{var[x]=I;return x!=null&&x>=0&&x<R.length})),customColumns:c,conditionalFormats:m,userRowHeights:new Map(f),reverseType:g,rollupConfig:p,showSearchBar:b,searchValue:S,selectDistinctColumns:C,selectedSearchColumns:y,invertSearchColumns:E,pendingDataMap:this.hydratePendingDataMap(R,T),frozenColumns:O,columnHeaderGroups:Je.parseColumnHeaderGroups(e,(r=N??((i=e.layoutHints)===null||i===void 0?void 0:i.columnGroups))!==null&&r!==void 0?r:[]).groups,partitionConfig:this.hydratePartitionConfig(M,P)}}hydrateQuickFilters(e,t,r){var i=t.map(a=>{var[o,s]=a,{text:l}=s,d=null;try{var u=Je.getColumn(e,o);u!=null&&(d=this.tableUtils.makeQuickFilter(u,l,r))}catch(c){Zo.error("hydrateQuickFilters error with",l,c)}return[o,{text:l,filter:d}]});return new Map(i)}dehydrateAdvancedFilters(e,t){return[...t].map(r=>{var[i,a]=r,o=Je.getColumn(e,i);j(o);var s=this.dehydrateAdvancedFilterOptions(o,a.options);return[i,{options:s}]})}hydrateAdvancedFilters(e,t,r){var i=t.map(a=>{var[o,s]=a,l=Je.getColumn(e,o);j(l);var d=this.hydrateAdvancedFilterOptions(l,s.options),u=null;try{var c=Je.getColumn(e,o);c!=null&&(u=this.tableUtils.makeAdvancedFilter(l,d,r))}catch(m){Zo.error("hydrateAdvancedFilters error with",d,m)}return[o,{options:d,filter:u}]});return new Map(i)}dehydrateAdvancedFilterOptions(e,t){var{selectedValues:r}=t,i=df(t,A_);return Nr({selectedValues:r==null?void 0:r.map(a=>this.dehydrateValue(a,e==null?void 0:e.type))},i)}hydrateAdvancedFilterOptions(e,t){var{selectedValues:r}=t,i=df(t,L_);return Nr({selectedValues:r==null?void 0:r.map(a=>this.hydrateValue(a,e==null?void 0:e.type))},i)}dehydratePendingDataMap(e,t){return[...t].map(r=>{var[i,{data:a}]=r;return[i,{data:[...a].map(o=>{var[s,l]=o;return[e[s].name,this.dehydrateValue(l,e[s].type)]})}]})}hydratePendingDataMap(e,t){var r=new Map,i=a=>(r.has(a)||r.set(a,e.findIndex(o=>{var{name:s}=o;return s===a})),r.get(a));return new Map(t.map(a=>{var[o,{data:s}]=a;return[o,{data:new Map(s.map(l=>{var d,[u,c]=l,m=i(u);return j(m),[(d=i(u))!==null&&d!==void 0?d:null,this.hydrateValue(c,e[m].type)]}))}]}))}dehydratePartitionConfig(e,t){return t==null?t:Nr(Nr({},t),{},{partitions:t.partitions.map((r,i)=>this.dehydrateValue(r,e[i].type))})}hydratePartitionConfig(e,t){return t==null?t:Nr(Nr({},t),{},{partitions:t.partitions.map((r,i)=>this.hydrateValue(r,e[i].type))})}dehydrateValue(e,t){return F.isDateType(t)?this.dehydrateDateTime(e):F.isLongType(t)?Je.dehydrateLong(e):e}hydrateValue(e,t){return F.isDateType(t)?this.hydrateDateTime(e):F.isLongType(t)?this.hydrateLong(e):e}dehydrateDateTime(e){return e!=null?this.dh.i18n.DateTimeFormat.format(Ze.FULL_DATE_FORMAT,e):null}hydrateDateTime(e){return e!=null?this.dh.i18n.DateTimeFormat.parse(Ze.FULL_DATE_FORMAT,e):null}hydrateLong(e){return e!=null?this.dh.LongWrapper.ofString(e):null}hydrateSort(e,t){var{dh:r}=this;return t.map(i=>{var{column:a,isAbs:o,direction:s}=i;if(s===F.sortDirection.reverse)return r.Table.reverse();var l=typeof a=="string"?Je.getColumnByName(e,a):Je.getColumn(e,a);if(l!=null){var d=l.sort();return o&&(d=d.abs()),s===F.sortDirection.descending?d=d.desc():d=d.asc(),d}return null}).filter(i=>i!=null&&i.direction!==F.sortDirection.reverse)}applyTableSettings(e,t,r){var{columns:i}=e,a=[];t.quickFilters&&(a=Je.getFiltersFromFilterMap(this.hydrateQuickFilters(i,t.quickFilters,r)));var o=[];t.advancedFilters&&(o=Je.getFiltersFromFilterMap(this.hydrateAdvancedFilters(i,t.advancedFilters,r)));var s=this.getFiltersFromInputFilters(i,t.inputFilters,r),l=[];t.sorts&&(l=this.hydrateSort(i,t.sorts));var d=[...a,...o],{partitions:u,partitionColumns:c}=t;if(u&&u.length&&c&&c!==null&&c!==void 0&&c.length){for(var m=c.map(g=>Je.getColumnByName(i,g)),v=0;v<m.length;v+=1)if(m[v]!==void 0&&u[v]!=null){var f=m[v].filter().eq(this.dh.FilterValue.ofString(u[v]));d=[f,...d]}}d=[...s,...d],e.applyFilter(d),e.applySort(l)}getFiltersFromInputFilters(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],r=arguments.length>2?arguments[2]:void 0;return t.map(i=>{var{name:a,type:o,value:s}=i,l=e.find(d=>{var{name:u,type:c}=d;return u===a&&c===o});if(l)try{return this.tableUtils.makeQuickFilter(l,s,r)}catch(d){Zo.debug("Unable to create input filter",d)}return null}).filter(i=>i!=null)}rangeSetFromRanges(e){var{dh:t}=this,r=e.slice().sort((i,a)=>(j(i.startRow),j(a.startRow),i.startRow-a.startRow)).map(i=>{var{startRow:a,endRow:o}=i;return j(a),j(o),t.RangeSet.ofRange(a,o)});return t.RangeSet.ofRanges(r)}}const Pe=Je;function cf(n,e,t,r,i,a,o){try{var s=n[a](o),l=s.value}catch(d){t(d);return}s.done?e(l):Promise.resolve(l).then(r,i)}function Wu(n){return function(){var e=this,t=arguments;return new Promise(function(r,i){var a=n.apply(e,t);function o(l){cf(a,r,i,o,s,"next",l)}function s(l){cf(a,r,i,o,s,"throw",l)}o(void 0)})}}function ra(n,e,t){return e=B_(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function B_(n){var e=U_(n,"string");return typeof e=="symbol"?e:String(e)}function U_(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var rr=ie.module("IrisGridCopyHandler");function V_(n){return n.ranges!=null}function G_(n){return n.columnIndex!=null}class Ne extends w.Component{static getStatusMessageText(e,t){switch(e){case Ne.COPY_STATES.CONFIRMATION_REQUIRED:return"Are you sure you want to copy ".concat(t.toLocaleString()," rows to your clipboard?");case Ne.COPY_STATES.CLICK_REQUIRED:return"Fetched ".concat(t.toLocaleString()," rows!");case Ne.COPY_STATES.FETCH_ERROR:return"Unable to copy data.";case Ne.COPY_STATES.FETCH_RANGES_IN_PROGRESS:return"Fetching ".concat(t.toLocaleString()," rows for clipboard...");case Ne.COPY_STATES.FETCH_HEADER_IN_PROGRESS:return"Fetching header for clipboard...";case Ne.COPY_STATES.DONE:return"Copied to Clipboard!";default:return""}}static getCopyButtonText(e){switch(e){case Ne.BUTTON_STATES.FETCH_IN_PROGRESS:return"Fetching";case Ne.BUTTON_STATES.CLICK_TO_COPY:return"Click to Copy";case Ne.BUTTON_STATES.RETRY:return"Retry";default:return"Copy"}}constructor(e){super(e),ra(this,"textData",void 0),ra(this,"hideTimer",void 0),ra(this,"fetchPromise",void 0),this.handleBackgroundClick=this.handleBackgroundClick.bind(this),this.handleCancelClick=this.handleCancelClick.bind(this),this.handleCopyClick=this.handleCopyClick.bind(this),this.handleHideTimeout=this.handleHideTimeout.bind(this),this.state={error:void 0,copyState:Ne.COPY_STATES.IDLE,buttonState:Ne.BUTTON_STATES.COPY,isShown:!1,rowCount:0}}componentDidMount(){var{copyOperation:e}=this.props;e!=null&&this.startCopy()}componentDidUpdate(e){var{copyOperation:t}=this.props;e.copyOperation!==t&&this.startCopy()}componentWillUnmount(){this.stopCopy()}startCopy(){rr.debug2("startCopy"),this.stopCopy();var{copyOperation:e}=this.props;if(e==null){rr.debug2("No copy operation set, cancelling out"),this.setState({isShown:!1});return}var{error:t}=e;if(t!=null){rr.debug("Showing copy error",t),this.setState({isShown:!0,copyState:Ne.COPY_STATES.DONE,error:t}),this.startHideTimer();return}if(this.setState({isShown:!0,error:void 0}),V_(e)){var{ranges:r}=e,i=Q.rowCount(r);if(this.setState({rowCount:i}),i>Ne.NO_PROMPT_THRESHOLD){this.setState({buttonState:Ne.BUTTON_STATES.COPY,copyState:Ne.COPY_STATES.CONFIRMATION_REQUIRED});return}}this.startFetch()}stopCopy(){this.textData=void 0,this.stopFetch(),this.stopHideTimer()}handleBackgroundClick(){rr.debug2("handleBackgroundClick");var{copyState:e}=this.state;e===Ne.COPY_STATES.DONE&&this.setState({isShown:!1})}handleCancelClick(){rr.debug2("handleCancelClick"),this.stopFetch(),this.setState({isShown:!1})}handleCopyClick(){var e=this;return Wu(function*(){if(rr.debug2("handleCopyClick"),e.textData!=null)try{yield e.copyText(e.textData),e.showCopyDone()}catch(t){rr.error("Error copying text",t),e.setState({error:"Unable to copy. Verify your browser permissions."})}else e.startFetch()})()}handleHideTimeout(){rr.debug2("handleHideTimeout"),this.stopHideTimer(),this.setState({isShown:!1})}copyText(e){var t=this;return Wu(function*(){rr.debug2("copyText",e),t.textData=e,yield Ro(e)})()}showCopyDone(){this.setState({copyState:Ne.COPY_STATES.DONE}),this.startHideTimer()}startFetch(){var e=this;return Wu(function*(){e.stopFetch();var{model:t,copyOperation:r}=e.props;if(G_(r)){var{columnIndex:i,columnDepth:a,movedColumns:o}=r;rr.debug("startFetch copyHeader",i,a),e.setState({buttonState:Ne.BUTTON_STATES.FETCH_IN_PROGRESS,copyState:Ne.COPY_STATES.FETCH_HEADER_IN_PROGRESS});var s=ae.getModelIndex(i,o),l=t.textForColumnHeader(s,a);if(l===void 0){e.fetchPromise=void 0,e.setState({error:"Invalid column header selected.",copyState:Ne.COPY_STATES.DONE});return}e.fetchPromise=Re.makeCancelable(l)}else{var{ranges:d,includeHeaders:u,userColumnWidths:c,movedColumns:m,formatValues:v}=r;rr.debug("startFetch copyRanges",d),e.setState({buttonState:Ne.BUTTON_STATES.FETCH_IN_PROGRESS,copyState:Ne.COPY_STATES.FETCH_RANGES_IN_PROGRESS});var f=Pe.getHiddenColumns(c),g=ae.getModelRanges(d,m);if(f.length>0){var p=f.map(Q.makeColumn);g=Q.subtractRangesFromRanges(g,p)}var b=v!=null&&v?(C,y)=>t.displayString(C,y.type,y.name):C=>"".concat(C);e.fetchPromise=Re.makeCancelable(t.textSnapshot(g,u,b))}try{var S=yield e.fetchPromise;e.fetchPromise=void 0;try{yield e.copyText(S),e.showCopyDone()}catch(C){rr.error("Error copying text",C),e.setState({buttonState:Ne.BUTTON_STATES.CLICK_TO_COPY,copyState:Ne.COPY_STATES.CLICK_REQUIRED})}}catch(C){C instanceof Fb?rr.debug("User cancelled copy."):(rr.error("Error fetching contents",C),e.fetchPromise=void 0,e.setState({buttonState:Ne.BUTTON_STATES.RETRY,copyState:Ne.COPY_STATES.FETCH_ERROR}))}})()}stopFetch(){this.fetchPromise&&(rr.debug2("stopFetch"),this.fetchPromise.cancel(),this.fetchPromise=void 0)}startHideTimer(){this.stopHideTimer(),this.hideTimer=setTimeout(this.handleHideTimeout,Ne.HIDE_TIMEOUT)}stopHideTimer(){this.hideTimer!=null&&(clearTimeout(this.hideTimer),this.hideTimer=void 0)}render(){var{onEntering:e,onEntered:t,onExiting:r,onExited:i}=this.props,{buttonState:a,copyState:o,isShown:s,rowCount:l,error:d}=this.state,u=o===Ne.COPY_STATES.DONE?"fade":"copy-slide-up",c=Ne.getCopyButtonText(a),m=d??Ne.getStatusMessageText(o,l),v=o!==Ne.COPY_STATES.DONE,f=a===Ne.BUTTON_STATES.FETCH_IN_PROGRESS,g=o===Ne.COPY_STATES.DONE;return h.jsxs(Ud,{animation:u,isShown:s,className:X("iris-grid-copy-handler",{"copy-done":g}),onClick:this.handleBackgroundClick,onEntering:e,onEntered:t,onExiting:r,onExited:i,children:[h.jsx("div",{className:"status-message",children:h.jsx("span",{children:m})}),h.jsx(Sr,{in:v,timeout:et.transitionMs,classNames:"fade",mountOnEnter:!0,unmountOnExit:!0,children:h.jsxs("div",{className:"buttons-container",children:[h.jsx("button",{type:"button",className:"btn btn-outline-secondary btn-cancel",onClick:this.handleCancelClick,children:"Cancel"}),h.jsxs(K,{kind:f?"tertiary":"primary",className:X("btn-copy",{"btn-spinner":f}),onClick:this.handleCopyClick,disabled:f,children:[f&&h.jsx(ia,{className:"loading-spinner-vertical-align"}),c]})]})})]})}}ra(Ne,"NO_PROMPT_THRESHOLD",1e4);ra(Ne,"HIDE_TIMEOUT",3e3);ra(Ne,"COPY_STATES",{IDLE:"IDLE",CONFIRMATION_REQUIRED:"CONFIRMATION_REQUIRED",FETCH_RANGES_IN_PROGRESS:"FETCH_RANGES_IN_PROGRESS",FETCH_HEADER_IN_PROGRESS:"FETCH_HEADER_IN_PROGRESS",FETCH_ERROR:"FETCH_ERROR",CLICK_REQUIRED:"CLICK_REQUIRED",DONE:"DONE"});ra(Ne,"BUTTON_STATES",{COPY:"COPY",FETCH_IN_PROGRESS:"FETCH_IN_PROGRESS",CLICK_TO_COPY:"CLICK_TO_COPY",RETRY:"RETRY"});ra(Ne,"defaultProps",{copyOperation:null,onEntering:()=>{},onEntered:()=>{},onExiting:()=>{},onExited:()=>{}});const W_=Ne;function Ul(n,e,t){return e=z_(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function z_(n){var e=K_(n,"string");return typeof e=="symbol"?e:String(e)}function K_(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class nS extends w.PureComponent{constructor(e){super(e),Ul(this,"inputField",void 0),Ul(this,"initialValue",void 0),Ul(this,"debouncedSendUpdate",void 0);var{debounceMs:t}=e;this.debouncedSendUpdate=wt(this.sendUpdate.bind(this),t),this.handleCancel=this.handleCancel.bind(this),this.handleChange=this.handleChange.bind(this),this.handleCommit=this.handleCommit.bind(this),this.handleFocus=this.handleFocus.bind(this),this.handleBlur=this.handleBlur.bind(this),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleContextMenu=this.handleContextMenu.bind(this),this.inputField=null;var{value:r}=e;this.initialValue=r,this.state={isChanged:!1,value:r}}componentDidMount(){var e;(e=this.inputField)===null||e===void 0||e.focus()}componentDidUpdate(e){var{debounceMs:t}=this.props;e.debounceMs!==t&&(this.debouncedSendUpdate.flush(),this.debouncedSendUpdate=wt(this.sendUpdate.bind(this),t))}componentWillUnmount(){this.debouncedSendUpdate.cancel()}setValue(e){this.initialValue=e,this.setState({value:e})}focus(){var e;(e=this.inputField)===null||e===void 0||e.focus()}handleChange(e){var{value:t}=e.target;this.setState({value:t,isChanged:!0}),this.debouncedSendUpdate(t)}handleCancel(){this.debouncedSendUpdate.cancel();var{initialValue:e}=this,{isChanged:t}=this.state;t&&this.sendUpdate(e);var{onDone:r}=this.props;r()}handleCommit(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0,t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;this.debouncedSendUpdate.flush();var{onDone:r}=this.props;r(e,t)}handleFocus(){var e;(e=this.inputField)===null||e===void 0||e.select()}handleBlur(e){var{relatedTarget:t}=e;t!=null&&t.classList.contains("context-menu-container")?this.handleCommit(!1,!0):t!=null&&t.classList.contains("advanced-filter-button")?this.handleCommit(!1,!1):this.handleCommit(!0,!0)}handleTab(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;this.debouncedSendUpdate.flush();var{onTab:t}=this.props;t(e)}handleKeyDown(e){switch(e.key){case"Escape":e.stopPropagation(),e.preventDefault(),this.handleCancel();break;case"Enter":e.stopPropagation(),e.preventDefault(),this.handleCommit();break;case"Tab":e.stopPropagation(),e.preventDefault(),this.handleTab(e.shiftKey);break}}handleContextMenu(e){var{onContextMenu:t}=this.props;t(e)}sendUpdate(e){var{onChange:t}=this.props;t(e)}render(){var{className:e,style:t,isAdvancedFilterSet:r,onAdvancedFiltersTriggered:i}=this.props,{value:a}=this.state;return h.jsxs("div",{style:t,className:"iris-grid-input-autosized-wrapper","data-value":a,children:[h.jsx("input",{ref:o=>{this.inputField=o},className:X("iris-grid-input-field",e),type:"text",value:a,onBlur:this.handleBlur,onFocus:this.handleFocus,onChange:this.handleChange,onKeyDown:this.handleKeyDown,onContextMenu:this.handleContextMenu,autoComplete:"off",autoCorrect:"off",autoCapitalize:"off",spellCheck:"false"}),h.jsx("div",{className:"advanced-filter-button-container",children:h.jsx(K,{kind:"ghost",className:X("btn-link-icon advanced-filter-button",{"filter-set":r}),onClick:i,onContextMenu:this.handleContextMenu,children:h.jsxs("div",{className:"fa-layers ",children:[h.jsx(ue,{icon:Kh,className:"filter-solid"}),h.jsx(ue,{icon:Kl,className:"filter-light"})]})})})]})}}Ul(nS,"defaultProps",{style:{},className:"",value:"",isAdvancedFilterSet:!1,onAdvancedFiltersTriggered:()=>{},onChange:()=>{},onDone:()=>{},onTab:()=>{},onContextMenu:()=>{},debounceMs:150});const q_=nS;function Y_(n,e,t){return e=X_(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function X_(n){var e=Q_(n,"string");return typeof e=="symbol"?e:String(e)}function Q_(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class Z_ extends Ba{constructor(e){super(),Y_(this,"irisGrid",void 0),this.irisGrid=e}onDown(e){var{selectedRanges:t}=this.irisGrid.state;return e.key==="c"&<.isModifierKeyDown(e)?(Pe.isValidSnapshotRanges(t)?this.irisGrid.copyRanges(t):this.irisGrid.copyRanges(t,!1,!1,"Invalid copy ranges"),!0):!1}}const J_=Z_;var eM={TOGGLE_QUICK_FILTER:$e.createAndAdd({id:"TABLE.TOGGLE_QUICK_FILTER",name:"Toggle Quick Filter",shortcut:[he.CTRL,de.F],macShortcut:[he.CMD,de.F]}),CLEAR_ALL_FILTERS:$e.createAndAdd({id:"TABLE.CLEAR_ALL_FILTERS",name:"Clear All Table Filters",shortcut:[he.CTRL,de.E],macShortcut:[he.CMD,de.E]}),CLEAR_FILTERS:$e.createAndAdd({id:"TABLE.CLEAR_FILTERS",name:"Clear Active Table Filters",shortcut:[he.CTRL,he.SHIFT,de.E],macShortcut:[he.CMD,he.SHIFT,de.E]}),REVERSE:$e.createAndAdd({id:"TABLE.REVERSE",name:"Reverse",shortcut:[he.CTRL,de.I],macShortcut:[he.CMD,de.I]}),TOGGLE_SEARCH:$e.createAndAdd({id:"TABLE.TOGGLE_SEARCH",name:"Toggle Search",shortcut:[he.CTRL,he.SHIFT,de.F],macShortcut:[he.CMD,he.SHIFT,de.F]}),GOTO_ROW:$e.createAndAdd({id:"TABLE.GOTO_ROW",name:"Go to Row",shortcut:[he.CTRL,de.G],macShortcut:[he.CMD,de.G]})},tM={COMMIT:$e.createAndAdd({id:"INPUT_TABLE.COMMIT",name:"Commit",shortcut:[he.CTRL,de.S],macShortcut:[he.CMD,de.S]}),DISCARD:$e.createAndAdd({id:"INPUT_TABLE.DISCARD",name:"Discard",shortcut:[he.CTRL,he.ALT,de.S],macShortcut:[he.CMD,he.OPTION,de.S]})},rM={TABLE:eM,INPUT_TABLE:tM};const Sn=rM;function nM(n,e,t){return e=iM(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function iM(n){var e=aM(n,"string");return typeof e=="symbol"?e:String(e)}function aM(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class oM extends Ba{constructor(e){super(),nM(this,"irisGrid",void 0),this.irisGrid=e}onDown(e){if(Sn.TABLE.REVERSE.matchesEvent(e)){if(!this.irisGrid.isReversible())return!1;var{reverseType:t}=this.irisGrid.state;return t===F.REVERSE_TYPE.NONE?this.irisGrid.reverse(F.REVERSE_TYPE.POST_SORT):this.irisGrid.reverse(F.REVERSE_TYPE.NONE),!0}return!1}}const sM=oM;function lM(n,e,t){return e=dM(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function dM(n){var e=uM(n,"string");return typeof e=="symbol"?e:String(e)}function uM(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class hM extends Ba{constructor(e){super(),lM(this,"irisGrid",void 0),this.irisGrid=e}onDown(e){return Sn.TABLE.CLEAR_FILTERS.matchesEvent(e)?(this.irisGrid.clearAllFilters(),!0):!1}}const cM=hM;function mM(n,e,t){return e=vM(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function vM(n){var e=fM(n,"string");return typeof e=="symbol"?e:String(e)}function fM(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class gM extends yt{constructor(e){super(850),mM(this,"irisGrid",void 0),this.irisGrid=e}destroyColumnTooltip(){this.irisGrid.setState({overflowButtonTooltipProps:null})}setCursor(e){return this.isHoveringOverflowButton(e)?(this.cursor="pointer",{stopPropagation:!1,preventDefault:!1}):(this.cursor=null,!1)}getButtonPosition(e){var{x:t,y:r,column:i,row:a}=e;if(i==null||a==null)return null;var{renderer:o,grid:s,state:l,props:d}=this.irisGrid;if(!s)return null;var{metrics:u}=l,{model:c}=d,{canvasContext:m}=s,v=s.getTheme(),f={context:m,mouseX:t,mouseY:r,metrics:u,model:c,theme:v},{left:g,top:p,width:b,height:S}=o.getCellOverflowButtonPosition(f);return g==null||b==null||p==null||S==null?null:{left:g,top:p,width:b,height:S}}isHoveringOverflowButton(e){var t,{x:r,y:i}=e,{left:a,top:o,width:s,height:l}=(t=this.getButtonPosition(e))!==null&&t!==void 0?t:{};if(a==null||s==null||o==null||l==null)return!1;var{renderer:d,grid:u,state:c,props:m}=this.irisGrid;if(!u)return!1;var{metrics:v}=c,{model:f}=m,{canvasContext:g}=u,p=u.getTheme(),b={context:g,mouseX:r,mouseY:i,metrics:v,model:f,theme:p};return d.shouldRenderOverflowButton(b)&&r>=a&&r<=a+s&&i>=o&&i<=o+l}onMove(e){if(this.isHoveringOverflowButton(e)){var{overflowButtonTooltipProps:t}=this.irisGrid.state,r=this.getButtonPosition(e);mt(t,r)||this.irisGrid.setState({overflowButtonTooltipProps:r})}else this.destroyColumnTooltip();return this.setCursor(e)}onWheel(e){return this.destroyColumnTooltip(),this.onMove(e)}onDown(e){this.destroyColumnTooltip();var{column:t,row:r}=e;return this.isHoveringOverflowButton(e)&&this.irisGrid.setState({showOverflowModal:!0,overflowText:this.irisGrid.getValueForCell(t,r)}),!1}onContextMenu(){return this.destroyColumnTooltip(),!1}onLeave(){return this.destroyColumnTooltip(),!1}}const pM=gM;function bM(n,e,t){return e=CM(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function CM(n){var e=SM(n,"string");return typeof e=="symbol"?e:String(e)}function SM(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class wM extends yt{constructor(e){super(),bM(this,"irisGrid",void 0),this.irisGrid=e,this.cursor=null}isActive(){var{isSelectingColumn:e}=this.irisGrid.props;return e}isValidColumn(e){if(e==null||e.isProxy===!0)return!1;var{columnSelectionValidator:t}=this.irisGrid.props;return t!=null?t(e):!0}updateColumnSelectionStatus(){var{columnSelectionValidator:e}=this.irisGrid.props;e!=null&&e(null)}getTableColumn(e){if(e==null)return null;var{model:t}=this.irisGrid.props,r=this.irisGrid.getModelColumn(e);return r==null?null:t.columns[r]}onMove(e){if(!this.isActive())return!1;var{columnAllowedCursor:t,columnNotAllowedCursor:r}=this.irisGrid.props,{column:i}=e,a=this.getTableColumn(i);return this.isValidColumn(a)?(this.cursor=t,this.irisGrid.setState({hoverSelectColumn:i})):(this.cursor=r,this.irisGrid.setState({hoverSelectColumn:null})),!0}onWheel(e){if(!this.isActive())return!1;var{columnAllowedCursor:t,columnNotAllowedCursor:r}=this.irisGrid.props,{column:i}=e,a=this.getTableColumn(i);return this.isValidColumn(a)?(this.cursor=t,this.irisGrid.setState({hoverSelectColumn:i})):(this.cursor=r,this.irisGrid.setState({hoverSelectColumn:null})),{preventDefault:!1,stopPropagation:!1}}onLeave(){return this.isActive()&&this.irisGrid.setState({hoverSelectColumn:null}),this.updateColumnSelectionStatus(),!1}onDown(){return this.isActive()}onClick(e){if(!this.isActive())return!1;var{column:t}=e,r=this.getTableColumn(t);return r!=null&&this.isValidColumn(r)&&this.irisGrid.selectColumn(r),!0}}const yM=wM;function EM(n,e,t){return e=TM(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function TM(n){var e=PM(n,"string");return typeof e=="symbol"?e:String(e)}function PM(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class OM extends yt{constructor(e){super(),EM(this,"irisGrid",void 0),this.irisGrid=e}hideColumnTooltip(){var{tooltip:e}=this.irisGrid;e&&(e.stopTimer(),e.hide())}onDown(){return this.hideColumnTooltip(),!1}onContextMenu(){return this.hideColumnTooltip(),!1}onWheel(){return this.hideColumnTooltip(),!1}onLeave(e,t,r){var{relatedTarget:i}=r instanceof MouseEvent?r:r.nativeEvent,{tooltip:a}=this.irisGrid;if(!a)return!1;var o=a.popper.current;return o&&i instanceof Element&&o.element.contains(i)||this.hideColumnTooltip(),!1}onMove(e){var{column:t,row:r,columnHeaderDepth:i}=e,{shownColumnTooltip:a}=this.irisGrid.state,o=null;return t!==null&&r===null&&i===0&&(o=t),o!==a&&this.irisGrid.setState({shownColumnTooltip:o}),!1}}const DM=OM;function iS(n,e,t){return e=NM(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function NM(n){var e=RM(n,"string");return typeof e=="symbol"?e:String(e)}function RM(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class Vd extends w.Component{constructor(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Vd.defaultProps;super(e),iS(this,"inputRef",void 0),this.handleInputChange=this.handleInputChange.bind(this),this.handleKeyDown=this.handleKeyDown.bind(this),this.inputRef=oe.createRef()}handleInputChange(){var{onChange:e}=this.props;this.inputRef.current&&e(this.inputRef.current.value)}closeContextMenu(){var{forwardedProps:e}=this.props,{closeMenu:t}=e;t(!0)}revertToDefault(){var{onChange:e}=this.props;e(null)}returnFocusToContextMenu(){var e=Yy.getClosestByClassName(this.inputRef.current,"context-menu-container");e instanceof HTMLElement&&e.focus()}handleKeyDown(e){switch(e.key){case"Enter":e.stopPropagation(),this.closeContextMenu();break;case"Escape":e.stopPropagation(),this.revertToDefault(),this.closeContextMenu();break;case"ArrowRight":case"ArrowLeft":e.stopPropagation();break;case"ArrowUp":case"ArrowDown":this.returnFocusToContextMenu();break;default:e.stopPropagation()}}render(){var{formatString:e,forwardedProps:t,placeholder:r,title:i}=this.props,{menuItem:{description:a},iconElement:o}=t;return h.jsxs("div",{className:"form-group flex-grow mb-0",children:[h.jsxs("div",{className:"custom-format-title",children:[h.jsx("span",{className:"icon",children:o}),h.jsxs("label",{className:"title mb-0",htmlFor:"custom-format-input",children:[i,a!=null&&h.jsx(Ot,{children:a})]})]}),h.jsx("div",{className:"pl-2 pr-2 pb-2",children:h.jsx("input",{id:"custom-format-input",className:"form-control text-right mb-0",type:"text",defaultValue:e,ref:this.inputRef,placeholder:r,onKeyDown:this.handleKeyDown,onChange:this.handleInputChange,autoComplete:"off",autoCorrect:"off",autoCapitalize:"off",spellCheck:"false"})})]})}}iS(Vd,"defaultProps",{formatString:"",forwardedProps:{menuItem:{},closeMenu(n){},iconElement:null},placeholder:"",title:"",onChange(n){}});const IM=Vd;class FM{static isDefaultSelected(e){return!e||![Dt.TYPE_CONTEXT_CUSTOM,Dt.TYPE_CONTEXT_PRESET].includes(e.type)}static isCustomSelected(e){return e!=null&&e.type===Dt.TYPE_CONTEXT_CUSTOM}static makeOption(e,t,r,i){return{title:e,description:e,group:r,format:t,isSelected:i}}static makeCustomFormatOption(e,t,r,i,a){return{title:e.label,description:e.label,format:e,group:t,isSelected:i,menuElement:h.jsx(IM,{formatString:e.formatString,title:e.label,placeholder:r,onChange:a})}}}const jr=FM;function Fc(n,e,t){return e=_M(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function _M(n){var e=MM(n,"string");return typeof e=="symbol"?e:String(e)}function MM(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class br{static getOptions(e,t){var r=new Date,i=[{group:br.dateGroup,formatString:"yyyy-MM-dd"},{group:br.dateGroup,formatString:"MM-dd-yyyy"},{group:br.timeGroup,formatString:"HH:mm:ss"},{group:br.timeGroup,formatString:"HH:mm:ss.SSS"},{group:br.timeGroup,formatString:"HH:mm:ss.SSSSSSSSS"},{group:br.dateTimeGroup,formatString:"yyyy-MM-dd HH:mm:ss"},{group:br.dateTimeGroup,formatString:"yyyy-MM-dd HH:mm:ss.SSS"},{group:br.dateTimeGroup,formatString:"yyyy-MM-dd HH:mm:ss.SSSSSSSSS"}],a=i.map(s=>{var l=Ut.makeFormat("",s.formatString,Ut.TYPE_CONTEXT_PRESET),d=e.getFormattedString(r,F.dataType.DATETIME,"",l);return jr.makeOption(d,l,s.group,Ut.isSameFormat(l,t))}),o=jr.makeOption("Default",null,br.dateGroup,jr.isDefaultSelected(t));return[o,...a]}}Fc(br,"dateGroup",10);Fc(br,"timeGroup",20);Fc(br,"dateTimeGroup",30);const xM=br;function Gd(n,e,t){return e=AM(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function AM(n){var e=LM(n,"string");return typeof e=="symbol"?e:String(e)}function LM(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class or{static getOptions(e,t,r){var i=[{format:je.FORMAT_PERCENT,group:or.presetGroup},{format:je.FORMAT_BASIS_POINTS,group:or.presetGroup},{format:je.FORMAT_MILLIONS,group:or.presetGroup},{format:je.FORMAT_SCIENTIFIC_NOTATION,group:or.presetGroup},{format:je.FORMAT_ROUND,group:or.presetRoundGroup},{format:je.FORMAT_ROUND_TWO_DECIMALS,group:or.presetRoundGroup},{format:je.FORMAT_ROUND_FOUR_DECIMALS,group:or.presetRoundGroup}],a=jr.makeOption("Default",null,or.defaultGroup,jr.isDefaultSelected(t)),o=i.map(u=>jr.makeOption(u.format.label,u.format,u.group,je.isSameFormat(u.format,t))),s=jr.isCustomSelected(t),l=s?t:je.makeCustomFormat(),d=jr.makeCustomFormatOption(l,or.customGroup,je.DEFAULT_FORMAT_STRING,s,u=>{if(u!=null){var c=je.makeCustomFormat(u);je.isValid(e,c)&&r(c)}else r(null)});return[a,...o,d]}}Gd(or,"defaultGroup",10);Gd(or,"presetGroup",20);Gd(or,"presetRoundGroup",30);Gd(or,"customGroup",40);const kM=or;function _c(n,e,t){return e=jM(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function jM(n){var e=$M(n,"string");return typeof e=="symbol"?e:String(e)}function $M(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class mi{static getOptions(e,t,r){var i=[{format:Bt.FORMAT_MILLIONS,group:mi.presetGroup},{format:Bt.FORMAT_SCIENTIFIC_NOTATION,group:mi.presetGroup}],a=jr.makeOption("Default",null,mi.defaultGroup,jr.isDefaultSelected(t)),o=i.map(u=>jr.makeOption(u.format.label,u.format,u.group,Bt.isSameFormat(u.format,t))),s=jr.isCustomSelected(t),l=s?t:Bt.makeCustomFormat(),d=jr.makeCustomFormatOption(l,mi.customGroup,Bt.DEFAULT_FORMAT_STRING,s,u=>{if(u!=null){var c=Bt.makeCustomFormat(u);Bt.isValid(e,c)&&r(c)}else r(null)});return[a,...o,d]}}_c(mi,"defaultGroup",10);_c(mi,"presetGroup",20);_c(mi,"customGroup",30);const HM=mi;function mf(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function vf(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?mf(Object(t),!0).forEach(function(r){yr(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):mf(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function yr(n,e,t){return e=BM(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function BM(n){var e=UM(n,"string");return typeof e=="symbol"?e:String(e)}function UM(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var ff=ie.module("IrisGridContextMenuHandler"),VM=150,gf="yyyy-MM-dd HH:mm:ss.SSSSSSSSS";class J extends yt{static getQuickFilterCondition(e,t,r){return e&&r==="&&"?e.and(t):e&&r==="||"?e.or(t):t}static getQuickFilterText(e,t,r){return r&&e!=null?"".concat(e," ").concat(r," ").concat(t):t}static getOperatorAsText(e){return e==="&&"?"And":"Or"}static getRowOptionFormatted(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:30;return"".concat(e,' "').concat(Tn.truncate(t,r-e.length-3),'"')}constructor(e,t){super(),yr(this,"irisGrid",void 0),yr(this,"debouncedUpdateCustomFormat",void 0),yr(this,"dh",void 0),this.debouncedUpdateCustomFormat=wt(e.handleFormatSelection,VM),this.dh=t,this.irisGrid=e}componentWillUnmount(){this.debouncedUpdateCustomFormat.flush()}getHeaderActions(e,t){var{irisGrid:r}=this,{column:i}=t;j(i);var{model:a}=r.props,{columns:o}=a,s=o[e],l=[],{metrics:d,reverseType:u,quickFilters:c,advancedFilters:m,searchFilter:v}=r.state,f=r.getTheme();j(d);var{filterIconColor:g,filterBarActiveColor:p,contextMenuSortIconColor:b,contextMenuReverseIconColor:S}=f,C=a.sort,y=F.getSortForColumn(C,s.name),E=u!==F.REVERSE_TYPE.NONE,{userColumnWidths:T}=d,O=[...T.values()].some(M=>M===0),N=a.getColumnHeaderParentGroup(e,0)===void 0&&!(Ke(a)&&a.hasExpandableRows),P=a.isColumnFrozen(e),R=a.isColumnSortable(e);if(l.push({title:"Hide Column",group:J.GROUP_HIDE_COLUMNS,action:()=>{this.irisGrid.hideColumnByVisibleIndex(i)}}),l.push({title:P?"Unfreeze Column":"Freeze Column",group:J.GROUP_HIDE_COLUMNS,disabled:!N,action:()=>{P?this.irisGrid.unFreezeColumnByColumnName(s.name):this.irisGrid.freezeColumnByColumnName(s.name)},order:10}),l.push({title:"Show All Columns",group:J.GROUP_HIDE_COLUMNS,action:()=>{this.irisGrid.showAllColumns()},disabled:!O}),l.push({title:"Quick Filters",icon:ti,iconColor:p,shortcut:Sn.TABLE.TOGGLE_QUICK_FILTER,group:J.GROUP_FILTER,order:10,action:()=>{this.irisGrid.toggleFilterBar(i)}}),l.push({title:"Advanced Filters",icon:m.get(e)?Kh:Kl,iconColor:g,group:J.GROUP_FILTER,order:20,action:()=>{this.irisGrid.handleAdvancedMenuOpened(i)}}),l.push({title:"Clear Table Filters",group:J.GROUP_FILTER,order:40,shortcut:Sn.TABLE.CLEAR_FILTERS,action:()=>{this.irisGrid.clearAllFilters()},disabled:!(c.size>0||m.size>0||v!=null)}),l.push({title:"Sort by",icon:ti,iconColor:b,group:J.GROUP_SORT,order:10,actions:this.sortByActions(s,e,y),disabled:!R}),l.push({title:"Add Additional Sort",disabled:y&&C.length===1||E&&C.length===1||y&&E&&C.length===2||C.length===0||!R,group:J.GROUP_SORT,order:20,actions:this.additionalSortActions(s,e)}),l.push({title:"Clear Table Sorting",disabled:C.length===0||E&&C.length===1,group:J.GROUP_SORT,action:()=>{this.irisGrid.sortColumn(i,J.COLUMN_SORT_DIRECTION.none)},order:30}),l.push({title:u===F.REVERSE_TYPE.NONE?"Reverse Table":"Clear Reverse Table",icon:ti,iconColor:S,group:J.GROUP_SORT,order:40,disabled:!a.isReversible,shortcut:Sn.TABLE.REVERSE,action:()=>{u===F.REVERSE_TYPE.NONE?this.irisGrid.reverse(F.REVERSE_TYPE.POST_SORT):this.irisGrid.reverse(F.REVERSE_TYPE.NONE)}}),l.push({title:"Copy Column Name",group:J.GROUP_COPY,shortcutText:lt.isMacPlatform()?"⌥Click":"Alt+Click",action:()=>{var M;Ro((M=a.textForColumnHeader(e))!==null&&M!==void 0?M:"").catch(I=>ff.error("Unable to copy header",I))}}),F.isDateType(s.type))l.push({title:"Date/Time Format",group:J.GROUP_FORMAT,actions:this.dateFormatActions(s)});else if(F.isNumberType(s.type)){var A;l.push({title:"Number Format",group:J.GROUP_FORMAT,actions:(A=this.numberFormatActions(s))!==null&&A!==void 0?A:void 0})}return l}getCellActions(e,t,r){var{dh:i,irisGrid:a}=this,{column:o,row:s}=r,{model:l,canCopy:d}=a.props,{columns:u}=l,c=a.getModelRow(s);j(c);var m=l.sourceForCell(e,c),{column:v,row:f}=m,g=l.valueForCell(v,f),p=l.textForCell(v,f),b=u[v],S=[],{quickFilters:C}=a.state,y=a.getTheme(),{filterIconColor:E}=y,{settings:T}=a.props,O=new Ut(i,{timeZone:T==null?void 0:T.timeZone,showTimeZone:!1,showTSeparator:!0,defaultDateTimeFormatString:gf}),N=new Ut(i,{timeZone:T==null?void 0:T.timeZone,showTimeZone:T==null?void 0:T.showTimeZone,showTSeparator:T==null?void 0:T.showTSeparator,defaultDateTimeFormatString:gf});if(b==null||s==null)return S;if(l.isFilterable(v)){var P={title:"Filter by Value",icon:ti,iconColor:E,group:J.GROUP_FILTER,order:10,actions:[]};if(g==null)C.get(v)&&P.actions.push({title:"And",actions:this.nullFilterActions(b,C.get(v),"&&"),order:2,group:le.groups.high}),P.actions.push(...this.nullFilterActions(b));else if(g==="")C.get(v)&&P.actions.push({title:"And",actions:this.emptyStringFilterActions(b,C.get(v),"&&"),order:2,group:le.groups.high}),P.actions.push(...this.emptyStringFilterActions(b));else if(F.isBooleanType(b.type))C.get(v)&&P.actions.push({title:"Or",actions:this.booleanFilterActions(b,p,C.get(v),"||"),order:2,group:le.groups.high}),P.actions.push(...this.booleanFilterActions(b,p));else if(F.isNumberType(b.type)||F.isCharType(b.type)){j(v);var R=F.isCharType(b.type)?String.fromCharCode(g):"".concat(g);C.get(v)&&P.actions.push({title:"And",actions:this.numberFilterActions(b,R,g,C.get(v),"&&"),order:2,group:le.groups.high}),P.actions.push(...this.numberFilterActions(b,R,g,C.get(v)))}else if(F.isDateType(b.type)){var A=O.format(g),M=N.format(g);C.get(v)&&P.actions.push({title:"And",actions:this.dateFilterActions(b,A,M,g,C.get(v),"&&"),order:2,group:le.groups.high}),P.actions.push(...this.dateFilterActions(b,A,M,g,C.get(v)))}else C.get(v)&&P.actions.push({title:"And",actions:this.stringFilterActions(b,p,g,C.get(v),"&&"),order:2,group:le.groups.high}),P.actions.push(...this.stringFilterActions(b,p,g));P.actions!=null&&P.actions.length>0&&S.push(P)}if(Ke(l)&&l.isRowExpandable(f)){var I=0,x=l.valueForCell(I,f),_=x==null?"null":l.textForCell(I,f);S.push({title:J.getRowOptionFormatted(l.isRowExpanded(f)?"Collapse":"Expand",_),group:J.GROUP_EXPAND_COLLAPSE,order:10,action:()=>{l.setRowExpanded(f,!l.isRowExpanded(f))}}),l.isExpandAllAvailable===!0&&S.push({title:J.getRowOptionFormatted("Expand All in",_),group:J.GROUP_EXPAND_COLLAPSE,order:20,action:()=>{l.setRowExpanded(f,!0,!0)}})}Ke(l)&&l.hasExpandableRows&&l.isExpandAllAvailable===!0&&(S.push({title:"Expand Entire Table",group:J.GROUP_EXPAND_COLLAPSE,order:30,action:()=>{l.expandAll()}}),S.push({title:"Collapse Entire Table",group:J.GROUP_EXPAND_COLLAPSE,order:40,action:()=>{l.collapseAll()}}));var k={title:"Go to",iconColor:E,shortcut:Sn.TABLE.GOTO_ROW,group:J.GROUP_GOTO,order:10,action:()=>this.irisGrid.toggleGotoRow("".concat(s+1),"".concat(g),b.name)};return S.push(k),d&&(S.push({title:"Copy Cell",group:J.GROUP_COPY,shortcutText:lt.isMacPlatform()?"⌥Click":"Alt+Click",order:10,action:()=>{a.copyCell(o,s)}}),S.push({title:"Copy Cell Unformatted",group:J.GROUP_COPY,order:20,action:()=>{a.copyCell(o,s,!0)}})),S.push({title:"View Cell Contents",group:J.GROUP_VIEW_CONTENTS,order:10,action:()=>{a.setState({showOverflowModal:!0,overflowText:a.getValueForCell(o,s)})}}),S}getNumberValueEqualsFilter(e,t){var{dh:r}=this,i=e.filter();if(t===Number.POSITIVE_INFINITY)return r.FilterCondition.invoke("isInf",i).and(i.greaterThan(r.FilterValue.ofNumber(0)));if(t===Number.NEGATIVE_INFINITY)return r.FilterCondition.invoke("isInf",i).and(i.lessThan(r.FilterValue.ofNumber(0)));if(Number.isNaN(t))return r.FilterCondition.invoke("isNaN",i);var a=this.getFilterValueForNumberOrChar(e.type,t);return i.eq(a)}getFilterValueForNumberOrChar(e,t){var{dh:r}=this;return F.isCharType(e)?r.FilterValue.ofString(String.fromCharCode(t)):r.FilterValue.ofNumber(t)}onContextMenu(e,t,r){var{irisGrid:i}=this,{y:a,column:o,row:s,columnHeaderDepth:l}=e,d=i.getModelColumn(o),u=i.getModelRow(s),{model:c,canCopy:m}=i.props,{columns:v}=c,{metrics:f,isFilterBarShown:g,quickFilters:p,advancedFilters:b,selectedRanges:S}=i.state;j(f);var{columnHeaderHeight:C,gridY:y,columnHeaderMaxDepth:E}=f,T=[];if(d!=null&&u!=null){var O=c.sourceForCell(d,u??0),{column:N,row:P}=O,R=c.valueForCell(N,P),A=c.textForCell(N,P),M=v[N],{onContextMenu:I}=i.props;M!=null&&T.push(...I({model:c,value:R,valueText:A,column:M,rowIndex:s,columnIndex:o,modelRow:u,modelColumn:d}))}if(d!=null){var x=c.getClearFilterRange(d);x!=null&&x.length>0&&T.push({title:x[1]-x[0]>0?"Clear Group Filter":"Clear Column Filter",group:J.GROUP_FILTER,order:30,action:()=>{this.irisGrid.removeColumnFilter(x)},disabled:!Array.from(p.keys()).some(_=>_>=x[0]&&_<=x[1])&&!Array.from(b.keys()).some(_=>_>=x[0]&&_<=x[1])})}return(g?a<=y:a<=C*E&&l===0)?d!=null&&T.push(...this.getHeaderActions(d,e)):(d!=null&&u!=null&&T.push(...this.getCellActions(d,t,e)),m&&S.length>0&&(T.push({title:"Copy Selection",shortcut:Vn.COPY,group:J.GROUP_COPY,order:30,action:()=>{i.copyRanges(S)}}),T.push({title:"Copy Selection w/ Headers",group:J.GROUP_COPY,order:40,action:()=>{i.copyRanges(S,!0)}})),tt(c)&&c.isEditable&&S.length>0&&T.push({title:"Delete Selected Rows",group:J.GROUP_EDIT,order:50,action:()=>{this.irisGrid.deleteRanges(S)}})),T.length===0?!1:(j(i.gridWrapper),le.triggerMenu(i.gridWrapper,r.clientX,r.clientY,T),!0)}dateFormatActions(e){for(var t=this,{model:r}=this.irisGrid.props,{formatter:i}=r,a=i.getColumnFormat(e.type,e.name),o=xM.getOptions(i,a),s=[],l=function(){var{description:c,format:m,group:v,isSelected:f,title:g}=o[d];s.push({title:g,description:c,icon:f?vi:void 0,group:v,order:d,action:()=>{var p=r.getColumnIndexByName(e.name);j(p),t.irisGrid.handleFormatSelection(p,m)}})},d=0;d<o.length;d+=1)l();return s}numberFormatActions(e){var t=this,{model:r}=this.irisGrid.props,{formatter:i}=r,{dh:a}=this,o=i.getColumnFormat(e.type,e.name),s,l=r.getColumnIndexByName(e.name);if(F.isDecimalType(e.type))s=kM.getOptions(a,o,m=>{j(l),this.debouncedUpdateCustomFormat(l,m)});else if(F.isIntegerType(e.type))s=HM.getOptions(a,o,m=>{j(l),this.debouncedUpdateCustomFormat(l,m)});else return ff.error("Invalid column type in numberFormatActions"),null;for(var d=[],u=function(){var{format:v,isSelected:f}=s[c];d.push(vf(vf({},s[c]),{},{icon:f?vi:void 0,order:c,action:()=>{l===void 0&&v&&v.type===Dt.TYPE_CONTEXT_CUSTOM||(j(l),t.irisGrid.handleFormatSelection(l,v))}}))},c=0;c<s.length;c+=1)u();return d}stringFilterActions(e,t,r,i,a){var{dh:o}=this,s=o.FilterValue.ofString(r),l=i;l||(l={filter:null,text:null});var{filter:d,text:u}=l,c=[],{model:m}=this.irisGrid.props,v=m.getColumnIndexByName(e.name),f=F.escapeQuickTextFilter(t);return j(v),c.push({menuElement:h.jsxs("div",{className:"iris-grid-filter-menu-item-value",children:[a?J.getOperatorAsText(a):""," ",'"',t,'"']}),order:1,group:le.groups.high}),c.push({title:"text is exactly",description:"Show only rows where ".concat(e.name," is ").concat(r," (case sensitive)"),action:()=>{this.irisGrid.setQuickFilter(v,J.getQuickFilterCondition(d,e.filter().eq(s),a),J.getQuickFilterText(u,"".concat(f),a))},order:10,group:le.groups.low}),c.push({title:"text is not exactly",description:"Show only rows where ".concat(e.name," is not ").concat(t," (case sensitive)"),action:()=>{this.irisGrid.setQuickFilter(v,J.getQuickFilterCondition(d,e.filter().notEq(s),a),J.getQuickFilterText(u,"!=".concat(f),a))},order:20,group:le.groups.low}),c.push({title:"text contains",description:"Show only rows where ".concat(e.name," contains ").concat(t),action:()=>{this.irisGrid.setQuickFilter(v,J.getQuickFilterCondition(d,e.filter().isNull().not().and(e.filter().contains(s)),a),J.getQuickFilterText(u,"~".concat(f),a))},order:30,group:le.groups.low}),c.push({title:"text does not contain",description:"Show only rows where ".concat(e.name," does not contain ").concat(r),action:()=>{this.irisGrid.setQuickFilter(v,J.getQuickFilterCondition(d,e.filter().isNull().or(e.filter().contains(s).not()),a),J.getQuickFilterText(u,"!~".concat(f),a))},order:40,group:le.groups.low}),c.push({title:"text starts with",description:"Show only rows where ".concat(e.name," starts with ").concat(t),action:()=>{this.irisGrid.setQuickFilter(v,J.getQuickFilterCondition(d,e.filter().isNull().not().and(e.filter().invoke("startsWith",s)),a),J.getQuickFilterText(u,"".concat(f,"*"),a))},order:50,group:le.groups.low}),c.push({title:"text ends with",description:"Show only rows where ".concat(e.name," ends with ").concat(t),action:()=>{this.irisGrid.setQuickFilter(v,J.getQuickFilterCondition(d,e.filter().isNull().not().and(e.filter().invoke("endsWith",s)),a),J.getQuickFilterText(u,"*".concat(f),a))},order:60,group:le.groups.low}),c}numberFilterActions(e,t,r,i,a){var o=this.getFilterValueForNumberOrChar(e.type,r),s=null,l=null;i&&(s=i.filter,l=i.text);var d=[],u=r!==Number.POSITIVE_INFINITY&&r!==Number.NEGATIVE_INFINITY&&!Number.isNaN(r),{model:c}=this.irisGrid.props,m=c.getColumnIndexByName(e.name);return j(m),d.push({menuElement:h.jsxs("div",{className:"iris-grid-filter-menu-item-value",children:[a?J.getOperatorAsText(a):""," ",'"',t,'"']}),order:1,group:le.groups.high}),d.push({title:"is equal to",description:"Show only rows where ".concat(e.name," is ").concat(t),action:()=>{var v=this.getNumberValueEqualsFilter(e,r);this.irisGrid.setQuickFilter(m,J.getQuickFilterCondition(s,v,a),J.getQuickFilterText(l,"=".concat(t),a))},order:10,group:le.groups.low}),d.push({title:"is not equal to",description:"Show only rows where ".concat(e.name," is not ").concat(t),action:()=>{var v=this.getNumberValueEqualsFilter(e,r).not();this.irisGrid.setQuickFilter(m,J.getQuickFilterCondition(s,v,a),J.getQuickFilterText(l,"!=".concat(t),a))},order:20,group:le.groups.low}),u&&!F.isCharType(e.type)&&(d.push({title:"greater than",description:"Show only rows where ".concat(e.name," is greater than ").concat(t),action:()=>{this.irisGrid.setQuickFilter(m,J.getQuickFilterCondition(s,e.filter().greaterThan(o),a),J.getQuickFilterText(l,">".concat(t),a))},order:30,group:le.groups.low}),d.push({title:"greater than or equal to",description:"Show only rows where ".concat(e.name," is greater than or equal to ").concat(t),action:()=>{this.irisGrid.setQuickFilter(m,J.getQuickFilterCondition(s,e.filter().greaterThanOrEqualTo(o),a),J.getQuickFilterText(l,">=".concat(t),a))},order:40,group:le.groups.low}),d.push({title:"less than",description:"Show only rows where ".concat(e.name," is less than ").concat(t),action:()=>{this.irisGrid.setQuickFilter(m,J.getQuickFilterCondition(s,e.filter().lessThan(o),a),J.getQuickFilterText(l,"<".concat(t),a))},order:50,group:le.groups.low}),d.push({title:"less than or equal to",description:"Show only rows where ".concat(e.name," is less than or equal to ").concat(t),action:()=>{this.irisGrid.setQuickFilter(m,J.getQuickFilterCondition(s,e.filter().lessThanOrEqualTo(o),a),J.getQuickFilterText(l,"<=".concat(t),a))},order:60,group:le.groups.low})),d}booleanFilterActions(e,t,r,i){var a=[],{model:o}=this.irisGrid.props,{filter:s,text:l}=r||{},d=o.getColumnIndexByName(e.name);return j(d),a.push({menuElement:h.jsxs("div",{className:"iris-grid-filter-menu-item-value",children:[i?J.getOperatorAsText(i):""," ",'"',t??"null",'"']}),order:1,group:le.groups.high}),a.push({title:"true",description:"Show only rows where ".concat(e.name," is true"),action:()=>{this.irisGrid.setQuickFilter(d,J.getQuickFilterCondition(s,e.filter().isTrue(),i),J.getQuickFilterText(l,"true",i))},order:10,group:le.groups.low}),a.push({title:"false",description:"Show only rows where ".concat(e.name," is false"),action:()=>{this.irisGrid.setQuickFilter(d,J.getQuickFilterCondition(s,e.filter().isFalse(),i),J.getQuickFilterText(l,"false",i))},order:20,group:le.groups.low}),a.push({title:"is null",description:"Show only rows where ".concat(e.name," is null"),action:()=>{this.irisGrid.setQuickFilter(d,J.getQuickFilterCondition(s,e.filter().isNull(),i),J.getQuickFilterText(l,"null",i))},order:30,group:le.groups.low}),a.push({title:"is not null",description:"Show only rows where ".concat(e.name," is not null"),action:()=>{this.irisGrid.setQuickFilter(d,J.getQuickFilterCondition(s,e.filter().isNull().not(),i),J.getQuickFilterText(l,"!null",i))},order:40,group:le.groups.low}),a}dateFilterActions(e,t,r,i,a,o){var{dh:s}=this,l=s.FilterValue.ofNumber(i),d=null,u=null;a&&(d=a.filter,u=a.text);var{model:c}=this.irisGrid.props,m=c.getColumnIndexByName(e.name);j(m);var v=[];return v.push({menuElement:h.jsxs("div",{className:"iris-grid-filter-menu-item-value",children:[o?J.getOperatorAsText(o):""," ",'"',r,'"']}),order:1,group:le.groups.high}),v.push({title:"date is",description:"Show only rows where ".concat(e.name," is ").concat(r),action:()=>{this.irisGrid.setQuickFilter(m,J.getQuickFilterCondition(d,e.filter().eq(l),o),J.getQuickFilterText(u,"=".concat(t),o))},order:10,group:le.groups.low}),v.push({title:"date is not",description:"Show only rows where ".concat(e.name," is not ").concat(r),action:()=>{this.irisGrid.setQuickFilter(m,J.getQuickFilterCondition(d,e.filter().notEq(l),o),J.getQuickFilterText(u,"!=".concat(t),o))},order:20,group:le.groups.low}),v.push({title:"date is before",description:"Show only rows where ".concat(e.name," is before ").concat(r),action:()=>{this.irisGrid.setQuickFilter(m,J.getQuickFilterCondition(d,e.filter().lessThan(l),o),J.getQuickFilterText(u,"<".concat(t),o))},order:30,group:le.groups.low}),v.push({title:"date is before or equal",description:"Show only rows where ".concat(e.name," is before or equal to ").concat(r),action:()=>{this.irisGrid.setQuickFilter(m,J.getQuickFilterCondition(d,e.filter().lessThanOrEqualTo(l),o),J.getQuickFilterText(u,"<=".concat(t),o))},order:40,group:le.groups.low}),v.push({title:"date is after",description:"Show only rows where ".concat(e.name," is greater than ").concat(r),action:()=>{this.irisGrid.setQuickFilter(m,J.getQuickFilterCondition(d,e.filter().greaterThan(l),o),J.getQuickFilterText(u,">".concat(t),o))},order:50,group:le.groups.low}),v.push({title:"date is after or equal",description:"Show only rows where ".concat(e.name," is after or equal to ").concat(r),action:()=>{this.irisGrid.setQuickFilter(m,J.getQuickFilterCondition(d,e.filter().greaterThanOrEqualTo(l),o),J.getQuickFilterText(u,">=".concat(t),o))},order:60,group:le.groups.low}),v}emptyStringFilterActions(e,t,r){var{dh:i}=this,a=i.FilterValue.ofString(""),o=t;o||(o={filter:null,text:null});var{filter:s,text:l}=o,d=[],{model:u}=this.irisGrid.props,c=u.getColumnIndexByName(e.name);return j(c),d.push({menuElement:h.jsxs("div",{className:"iris-grid-filter-menu-item-value",children:[r?J.getOperatorAsText(r):""," ",h.jsx("i",{className:"text-muted",children:"empty"})]}),order:1,group:le.groups.high}),d.push({title:"is empty string",description:"Show only rows where ".concat(e.name," is empty"),action:()=>{this.irisGrid.setQuickFilter(c,J.getQuickFilterCondition(s,e.filter().eq(a),r),J.getQuickFilterText(l,"=",r))},order:10,group:le.groups.low}),d.push({title:"is not empty string",description:"Show only rows where ".concat(e.name," is not empty"),action:()=>{this.irisGrid.setQuickFilter(c,J.getQuickFilterCondition(s,e.filter().notEq(a),r),J.getQuickFilterText(l,"!=",r))},order:20,group:le.groups.low}),d}nullFilterActions(e,t,r){var i=null,a=null;t&&(i=t.filter,a=t.text);var o=[],{model:s}=this.irisGrid.props,l=s.getColumnIndexByName(e.name);return j(l),o.push({menuElement:h.jsxs("div",{className:"iris-grid-filter-menu-item-value",children:[r?J.getOperatorAsText(r):""," ",h.jsx("i",{className:"text-muted",children:"null"})]}),order:1,group:le.groups.high}),o.push({title:"is null",description:"Show only rows where ".concat(e.name," is null"),action:()=>{this.irisGrid.setQuickFilter(l,J.getQuickFilterCondition(i,e.filter().isNull(),r),J.getQuickFilterText(a,"null",r))},order:10,group:le.groups.low}),o.push({title:"is not null",description:"Show only rows where ".concat(e.name," is not null"),action:()=>{this.irisGrid.setQuickFilter(l,J.getQuickFilterCondition(i,e.filter().isNull().not(),r),J.getQuickFilterText(a,"!null",r))},order:20,group:le.groups.low}),o}sortByActions(e,t,r){var i=this.irisGrid.getTheme(),{contextMenuSortIconColor:a}=i,o=[{title:"".concat(e.name," Ascending"),order:10,action:()=>{this.irisGrid.sortColumn(t,J.COLUMN_SORT_DIRECTION.ascending)},icon:this.checkColumnSort(r,J.COLUMN_SORT_DIRECTION.ascending)?ti:void 0,iconColor:a},{title:"".concat(e.name," Descending"),order:20,action:()=>{this.irisGrid.sortColumn(t,J.COLUMN_SORT_DIRECTION.descending)},icon:this.checkColumnSort(r,J.COLUMN_SORT_DIRECTION.descending)?ti:void 0,iconColor:a},{title:"Remove Sort",order:50,action:()=>{this.irisGrid.sortColumn(t,J.COLUMN_SORT_DIRECTION.none,!1,!0)},disabled:!r}];return F.isNumberType(e.type)&&(o.push({title:"ABS(".concat(e.name,") Ascending"),order:30,action:()=>{this.irisGrid.sortColumn(t,J.COLUMN_SORT_DIRECTION.ascending,!0)},icon:this.checkColumnSort(r,J.COLUMN_SORT_DIRECTION.ascending,!0)?ti:void 0,iconColor:a}),o.push({title:"ABS(".concat(e.name,") Descending"),order:40,action:()=>{this.irisGrid.sortColumn(t,J.COLUMN_SORT_DIRECTION.descending,!0)},icon:this.checkColumnSort(r,J.COLUMN_SORT_DIRECTION.descending,!0)?ti:void 0,iconColor:a})),o}additionalSortActions(e,t){var r=this.irisGrid.getTheme(),{contextMenuSortIconColor:i}=r,a=[{title:"Add Sort By",menuElement:h.jsxs("div",{className:"btn-context-menu menu-title",children:[h.jsx("span",{className:"icon",children:h.jsx(ue,{icon:ti,style:{color:i??void 0}})}),h.jsx("span",{className:"title",children:"Add Additional Sort"}),h.jsx("span",{className:"shortcut",children:lt.isMacPlatform()?"⌘Click":"Ctrl+Click"})]}),order:1},{title:"".concat(e.name," Ascending"),order:10,action:()=>{this.irisGrid.sortColumn(t,J.COLUMN_SORT_DIRECTION.ascending,!1,!0)}},{title:"".concat(e.name," Descending"),order:20,action:()=>{this.irisGrid.sortColumn(t,J.COLUMN_SORT_DIRECTION.descending,!1,!0)}}];return F.isNumberType(e.type)&&(a.push({title:"ABS(".concat(e.name,") Ascending"),order:30,action:()=>{this.irisGrid.sortColumn(t,J.COLUMN_SORT_DIRECTION.ascending,!0,!0)}}),a.push({title:"ABS(".concat(e.name,") Descending"),order:40,action:()=>{this.irisGrid.sortColumn(t,J.COLUMN_SORT_DIRECTION.descending,!0,!0)}})),a}checkColumnSort(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return e?e.direction===t&&e.isAbs===r:!1}}yr(J,"GROUP_EDIT",le.groups.high+10);yr(J,"GROUP_HIDE_COLUMNS",le.groups.high+25);yr(J,"GROUP_FILTER",le.groups.high+50);yr(J,"GROUP_EXPAND_COLLAPSE",le.groups.high+55);yr(J,"GROUP_GOTO",le.groups.high+60);yr(J,"GROUP_SORT",le.groups.high+75);yr(J,"GROUP_COPY",le.groups.high+100);yr(J,"GROUP_FORMAT",le.groups.high+150);yr(J,"GROUP_VIEW_CONTENTS",le.groups.high+175);yr(J,"COLUMN_SORT_DIRECTION",{ascending:"ASC",descending:"DESC",none:null});const GM=J;function WM(n,e,t){return e=zM(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function zM(n){var e=KM(n,"string");return typeof e=="symbol"?e:String(e)}function KM(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class qM extends yt{constructor(e){super(250),WM(this,"irisGrid",void 0),this.irisGrid=e,this.cursor=null}onClick(e,t,r){return r.altKey&&!lt.isModifierKeyDown(r)&&!r.shiftKey?(this.cursor=null,e.columnHeaderDepth!==void 0?this.irisGrid.copyColumnHeader(e.column,e.columnHeaderDepth):this.irisGrid.copyRanges([Q.makeCell(e.column,e.row)]),!0):!1}onMove(e,t,r){return r.altKey&&!lt.isModifierKeyDown(r)&&!r.shiftKey&&e.column!=null&&(e.row!=null||e.columnHeaderDepth!=null)?(this.cursor=this.irisGrid.props.copyCursor,!0):!1}}const YM=qM;function XM(n,e,t){return e=QM(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function QM(n){var e=ZM(n,"string");return typeof e=="symbol"?e:String(e)}function ZM(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class JM extends yt{constructor(e){super(),XM(this,"irisGrid",void 0),this.irisGrid=e}onDoubleClick(e,t){var{column:r,row:i}=e;return i==null||r==null?!1:(this.irisGrid.selectData(r,i),t.moveCursorToPosition(r,i),!0)}}const ex=JM;function tx(n,e,t){return e=rx(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function rx(n){var e=nx(n,"string");return typeof e=="symbol"?e:String(e)}function nx(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class ix extends yt{constructor(e){super(),tx(this,"irisGrid",void 0),this.irisGrid=e}onDown(e){var{y:t,column:r,row:i}=e;if(r!==null&&i===null){var{isFilterBarShown:a,metrics:o}=this.irisGrid.state;if(!o)throw new Error("Metrics not set");var{columnHeaderMaxDepth:s}=o,l=this.irisGrid.getTheme();if(a&&l.columnHeaderHeight!=null&&l.filterBarHeight!=null&&t>l.columnHeaderHeight*s&&t<=l.columnHeaderHeight*s+l.filterBarHeight)return this.irisGrid.focusFilterBar(r),!0}return!1}onMove(e){var{y:t,column:r}=e,{isFilterBarShown:i,hoverAdvancedFilter:a,metrics:o}=this.irisGrid.state;if(!o)throw new Error("Metrics not set");var{columnHeaderMaxDepth:s}=o,l=this.irisGrid.getTheme(),d=null;return i&&l.columnHeaderHeight!=null&&l.filterBarHeight!=null&&r!==null&&t>=l.columnHeaderHeight*s&&t<=l.columnHeaderHeight*s+l.filterBarHeight&&(d=r),d!==a&&this.irisGrid.setState({hoverAdvancedFilter:d}),!1}onLeave(e){var{column:t}=e,{hoverAdvancedFilter:r}=this.irisGrid.state;return r!==null&&t!==r&&this.irisGrid.setState({hoverAdvancedFilter:null}),!1}}const ax=ix;function ox(n,e,t){return e=sx(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function sx(n){var e=lx(n,"string");return typeof e=="symbol"?e:String(e)}function lx(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class dx extends yt{constructor(e){super(750),ox(this,"irisGrid",void 0),this.irisGrid=e}destroyTooltip(){this.irisGrid.setState({expandCellTooltipProps:null})}setCursor(e,t){return Eh.isInTreeBox(e,t)?(this.cursor="pointer",{stopPropagation:!1,preventDefault:!1}):(this.cursor=null,!1)}getButtonPosition(e){var{x:t,y:r,column:i,row:a}=e;if(i==null||a==null)return null;var{renderer:o,grid:s,state:l,props:d}=this.irisGrid;if(!s)return null;var{metrics:u}=l,{model:c}=d,{canvasContext:m}=s,v=s.getTheme(),f={context:m,mouseX:t,mouseY:r,metrics:u,model:c,theme:v},g=Ke(c)?c.depthForRow(a):null,{left:p,top:b,width:S,height:C}=o.getExpandButtonPosition(f,g);return p==null||S==null||b==null||C==null?null:{left:p,top:b,width:S,height:C}}onMove(e,t){if(Eh.isInTreeBox(e,t)){var{expandCellTooltipProps:r}=this.irisGrid.state,{model:i}=this.irisGrid.props,a=this.getButtonPosition(e),{row:o}=e;j(o);var s=Ke(i)&&i.isRowExpanded(o);mt(r,a)||this.irisGrid.setState({expandCellTooltipProps:a,expandTooltipDisplayValue:s?"collapse":"expand"})}else this.destroyTooltip();return this.setCursor(e,t)}onDown(){return this.destroyTooltip(),!1}onContextMenu(){return this.destroyTooltip(),!1}onWheel(){return this.destroyTooltip(),!1}onLeave(){return this.destroyTooltip(),!1}}const ux=dx;function pf(n,e,t){return e=hx(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function hx(n){var e=cx(n,"string");return typeof e=="symbol"?e:String(e)}function cx(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class mx extends yt{constructor(e){super(),pf(this,"irisGrid",void 0),pf(this,"column",void 0),this.column=null,this.irisGrid=e}getColumnFromGridPoint(e){var{column:t,row:r,columnHeaderDepth:i}=e;return t!==null&&r===null&&i===0?t:null}onDown(e){return this.column=this.getColumnFromGridPoint(e),!1}onClick(e,t,r){var i=this.getColumnFromGridPoint(e);if(i!=null&&i===this.column){var a=lt.isModifierKeyDown(r);return this.irisGrid.toggleSort(i,a),!0}return!1}}const vx=mx;class fx extends yt{constructor(e){super(),this.irisGrid=e}onWheel(e,t,r){var{irisGrid:i}=this,{model:a}=i.props,{metrics:o,pendingRowCount:s}=i.state;j(o);var{bottom:l,rowCount:d,rowHeight:u}=o,{deltaY:c}=ae.getScrollDelta(r);return tt(a)&&a.isEditable&&l>=d-1&&c>0&&i.setState({pendingRowCount:s+Math.ceil(c/u)}),!1}}const gx=fx;function bf(n,e,t){return e=px(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function px(n){var e=bx(n,"string");return typeof e=="symbol"?e:String(e)}function bx(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class Cx extends yt{constructor(e){super(),bf(this,"irisGrid",void 0),bf(this,"currentLinkBox",void 0),this.irisGrid=e}destroyTooltip(){this.irisGrid.setState({linkHoverTooltipProps:null})}isHoveringLink(e,t){var{column:r,row:i,x:a,y:o}=e,{renderer:s,metrics:l,props:d}=t,{model:u}=d;if(r==null||i==null||l==null)return this.currentLinkBox=void 0,!1;var{modelRows:c,modelColumns:m}=l,v=B(c,i),f=B(m,r),g=u.renderTypeForCell(f,v),p=s.getCellRenderer(g);if(!QC(p))return!1;if(this.currentLinkBox!=null){var{x1:b,y1:S,x2:C,y2:y}=this.currentLinkBox;if(a>=b&&a<=C&&o>=S&&o<=y)return!0}for(var E=t.updateRenderState(),T=p.getTokenBoxesForVisibleCell(r,i,E),O=0;O<T.length;O+=1)if(td(T[O].token)){var N=ae.translateTokenBox(T[O],l),{x1:P,x2:R,y1:A,y2:M}=N;if(a>=P&&a<=R&&o>=A&&o<=M)return this.currentLinkBox=N,!0}return this.currentLinkBox=void 0,!1}setCursor(e,t){return this.isHoveringLink(e,t)?(this.cursor="pointer",{stopPropagation:!1,preventDefault:!1}):(this.cursor=null,!1)}onMove(e,t){var r=this.isHoveringLink(e,t);if(r&&this.currentLinkBox!=null&&td(this.currentLinkBox.token)){var{linkHoverTooltipProps:i}=this.irisGrid.state;if(this.currentLinkBox==null)return!1;var{x1:a,y1:o,x2:s,y2:l}=this.currentLinkBox,{href:d}=this.currentLinkBox.token,u=s-a,c=l-o,m={left:a,top:o+1,width:u,height:c};mt(i,m)||this.irisGrid.setState({linkHoverTooltipProps:m,linkHoverDisplayValue:d})}else this.destroyTooltip();return this.setCursor(e,t)}onDown(){return this.destroyTooltip(),!1}onContextMenu(){return this.destroyTooltip(),!1}onWheel(){return this.destroyTooltip(),!1}onLeave(){return this.destroyTooltip(),!1}}const Sx=Cx;var wx=3e3;function yx(n){var{children:e=null,onEntering:t,onEntered:r,onExiting:i,onExited:a}=n,[o,s]=w.useState(!1),l=w.useRef(),d=Nd(e),u=w.useCallback(()=>{s(!0),l.current&&clearTimeout(l.current),l.current=setTimeout(()=>{s(!1)},wx)},[s,l]);return w.useEffect(()=>{d!==e&&e!=null&&u()},[e,d,s,u]),w.useEffect(()=>()=>l.current?clearTimeout(l.current):void 0,[]),h.jsx(Ud,{className:"toast-bottom-bar",isShown:o,onEntering:t,onEntered:r,onExiting:i,onExited:a,children:e})}class Ex extends Ha{getGridY(e){var t=super.getGridY(e),{isFilterBarShown:r,theme:i,advancedFilters:a,quickFilters:o,sorts:s,reverseType:l}=e;return r?t+=i.filterBarHeight:(o!=null&&o.size>0||a!=null&&a.size>0)&&(t+=i.filterBarCollapsedHeight),l!==F.REVERSE_TYPE.NONE&&s!=null&&s.length>0&&(t+=i.reverseHeaderBarHeight),t}getUserColumnWidths(){return this.userColumnWidths}}var Tx=1,aS=oe.memo(n=>{var{model:e,modelColumns:t,top:r,bottom:i,left:a,right:o,filter:s,formatter:l,reverseType:d=F.REVERSE_TYPE.NONE,sorts:u,customColumns:c,movedColumns:m,hiddenColumns:v,alwaysFetchColumns:f,rollupConfig:g=null,totalsConfig:p=null,selectDistinctColumns:b=Te,pendingRowCount:S=0,pendingDataMap:C=Jr,frozenColumns:y,formatColumns:E,columnHeaderGroups:T,partitionConfig:O}=n,N=w.useMemo(()=>Pe.getModelViewportColumns(t,a,o,m,v,f,Tx),[t,a,o,m,v,f]);return w.useEffect(function(){e.filter=s},[e,s]),w.useEffect(function(){var R=[...u];d!==F.REVERSE_TYPE.NONE&&R.push(e.dh.Table.reverse()),e.sort=R},[e,u,d]),w.useEffect(function(){e.formatter=l},[e,l]),w.useEffect(function(){e.isCustomColumnsAvailable&&(e.customColumns=c)},[e,c]),w.useEffect(function(){e.isFormatColumnsAvailable&&(e.formatColumns=E)},[e,E]),w.useEffect(function(){e.setViewport(r,i,N)},[e,r,i,N]),w.useEffect(function(){e.isRollupAvailable&&(e.rollupConfig=g)},[e,e.isRollupAvailable,g]),w.useEffect(function(){e.isSelectDistinctAvailable&&(e.selectDistinctColumns=b)},[e,b]),w.useEffect(function(){e.isTotalsAvailable&&(e.totalsConfig=p)},[e,e.isTotalsAvailable,p]),w.useEffect(function(){e.pendingRowCount=S},[e,S]),w.useEffect(function(){e.pendingDataMap=C},[e,C]),w.useEffect(function(){y&&e.updateFrozenColumns(y)},[e,y]),w.useEffect(function(){e.columnHeaderGroups=T},[e,T]),w.useEffect(function(){O&&Oh(e)&&(e.partitionConfig=O)},[e,O]),null});aS.displayName="IrisGridModelUpdater";const Px=aS;var Nh=16,Ox=new Map([["sortUp",Xy],["sortDown",Qy],["caretDown",Pa],["caretRight",Pb],["cellOverflow",Zy]]),Dx=On(n=>{var e=Ox.get(n);if(e===void 0)throw new Error("Icon is undefined");var t=Array.isArray(e.icon[4])?e.icon[4][0]:e.icon[4],r=new Path2D(t),i=new Path2D,a={a:Nh/e.icon[0],d:Nh/e.icon[1]};return i.addPath(r,a),i},{max:1e3});function ws(n){return Dx(n)}class Nx{static drawTreeMarker(e,t,r,i,a,o,s){e.save();var{x1:l,y1:d}=a,u=ws(s?"caretDown":"caretRight"),c=r+l-2,m=i+d+2.5;e.fillStyle=o,e.textAlign="center",e.translate(c,m),e.fill(u),e.restore()}}const oS=Nx;class Rx extends XC{drawCellContent(e,t,r,i){var a,{metrics:o,model:s}=t,{modelColumns:l,modelRows:d}=o,u=B(d,i),c=l.get(r);if(c!==void 0){var m=s.valueForCell(c,u);if(F.isTextType((a=s.columns[c])===null||a===void 0?void 0:a.type)&&(m===null||m==="")){var v=e.font;e.font="italic ".concat(v),super.drawCellContent(e,t,r,i),e.font=v;return}super.drawCellContent(e,t,r,i)}}getTextRenderMetrics(e,t,r){var i=ae.getTextRenderMetrics(e,t,r),{mouseX:a,mouseY:o,metrics:s,theme:l}=e;if(a==null||o==null)return i;var{column:d,row:u}=ae.getGridPointFromXY(a,o,s);if(t===d&&r===u){var{left:c}=this.getCellOverflowButtonPosition(a,o,s,l);this.shouldRenderOverflowButton(e)&&c!=null&&(i.width=c-s.gridX-i.x)}return i}getCellOverflowButtonPosition(e,t,r,i){var a={left:null,top:null,width:null,height:null};if(e==null||t==null||r==null)return a;var{rowHeight:o,columnWidth:s,left:l,top:d}=ae.getCellInfoFromXY(e,t,r);if(l==null||s==null||d==null)return a;var{width:u,verticalBarWidth:c}=r,{cellHorizontalPadding:m}=i,v=Nh+2*m,f=o,g=Math.min(r.gridX+l+s,u-c),p=g-v,b=r.gridY+d;return{left:p,top:b,width:v,height:f}}shouldRenderOverflowButton(e){var t,r,{context:i,mouseX:a,mouseY:o,metrics:s,model:l,theme:d}=e;if(a==null||o==null)return!1;var{row:u,column:c,modelRow:m,modelColumn:v}=ae.getCellInfoFromXY(a,o,s);if(u==null||c==null||m==null||v==null||!F.isStringType(l.columns[v].type))return!1;var f=(t=l.textForCell(v,m))!==null&&t!==void 0?t:"",{width:g}=ae.getTextRenderMetrics(e,c,u),p=(r=s.fontWidths.get(d.font))!==null&&r!==void 0?r:xa;i.save(),i.font=d.font;var b=this.getCachedTruncatedString(i,f,g,p,l.truncationCharForCell(v,m));return i.restore(),f!==""&&b!==f}drawTreeMarker(e,t,r,i,a,o,s){oS.drawTreeMarker(e,t,r,i,a,o,s)}}const Ix=Rx;class Fx extends YC{drawTreeMarker(e,t,r,i,a,o,s){oS.drawTreeMarker(e,t,r,i,a,o,s)}}const _x=Fx;function Cf(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function Sf(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Cf(Object(t),!0).forEach(function(r){Rh(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Cf(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function Rh(n,e,t){return e=Mx(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Mx(n){var e=xx(n,"string");return typeof e=="symbol"?e:String(e)}function xx(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var zu=Object.freeze({SORT_UP:"sortUp",SORT_DOWN:"sortDown",CARET_DOWN:"caretDown",CARET_RIGHT:"caretRight",CELL_OVERFLOW:"cellOverflow"}),wf=10;class ad extends Tn{constructor(){super(...arguments),Rh(this,"textCellRenderer",new Ix),Rh(this,"dataBarCellRenderer",new _x)}static isFilterValid(e,t){var r=e==null||e.filter!=null,i=t==null||t.filter!=null;return r&&i}getSortIcon(e){return e?e.direction===F.sortDirection.ascending?ws(zu.SORT_UP):e.direction===F.sortDirection.descending?ws(zu.SORT_DOWN):null:null}drawCanvas(e){super.drawCanvas(e),this.drawScrim(e)}drawGrid(e,t){super.drawGrid(e,t),this.drawCellOverflowButton(t)}drawGridLines(e,t){super.drawGridLines(e,t),this.drawGroupedColumnLine(e,t),this.drawPendingRowLine(e,t)}drawCellContent(e,t,r,i){var{metrics:a,model:o}=t,{modelColumns:s,modelRows:l}=a,d=s.get(r),u=B(l,i);if(d!==void 0){var c=o.renderTypeForCell(d,u),m=this.getCellRenderer(c);m.drawCellContent(e,t,r,i)}}getCellOverflowButtonPosition(e){var{mouseX:t,mouseY:r,metrics:i,theme:a}=e;return this.textCellRenderer.getCellOverflowButtonPosition(t,r,i,a)}shouldRenderOverflowButton(e){return this.textCellRenderer.shouldRenderOverflowButton(e)}drawCellOverflowButton(e){var{context:t,mouseX:r,mouseY:i,theme:a}=e;if(!(r==null||i==null)&&this.shouldRenderOverflowButton(e)){var{left:o,top:s,width:l,height:d}=this.getCellOverflowButtonPosition(e),{cellHorizontalPadding:u,overflowButtonColor:c,overflowButtonHoverColor:m}=a;t.save(),m!=null&&o!=null&&l!=null&&s!=null&&d!=null&&r>=o&&r<=o+l&&i>=s&&i<=s+d?t.fillStyle=m:c!=null&&(t.fillStyle=c);var v=ws(zu.CELL_OVERFLOW);o!=null&&s!=null&&t.translate(o+u,s+2),t.fill(v),t.restore()}}drawGroupedColumnLine(e,t){var{metrics:r,model:i,theme:a}=t,{groupedColumns:o}=i,{maxY:s,allColumnWidths:l,allColumnXs:d}=r;if(!(o.length===0||a.groupedColumnDividerColor==null)){var u=o.length-1,c=d.get(u),m=l.get(u);if(!(c==null||m==null)){var v=c+m+.5;e.strokeStyle=a.groupedColumnDividerColor,e.lineWidth=1,e.beginPath(),e.moveTo(v,0),e.lineTo(v,s),e.stroke()}}}drawPendingRowLine(e,t){var{metrics:r,model:i,theme:a}=t,{allRowYs:o,maxX:s}=r,{pendingRowCount:l}=i;if(!(l<=0)){var d=i.rowCount-i.pendingRowCount-i.floatingBottomRowCount,u=o.get(d);u!=null&&(u-=.5,e.save(),e.setLineDash([4,2]),e.strokeStyle=a.pendingTextColor,e.lineWidth=1,e.beginPath(),e.moveTo(0,u),e.lineTo(s,u),e.stroke(),e.restore())}}drawMouseColumnHover(e,t){var{theme:r,metrics:i,hoverSelectColumn:a}=t;if(!(a==null||r.linkerColumnHoverBackgroundColor==null)){var{allColumnWidths:o,allColumnXs:s,maxY:l}=i,d=B(s,a),u=B(o,a);e.fillStyle=r.linkerColumnHoverBackgroundColor,e.fillRect(d,0,u,l)}}drawMouseRowHover(e,t){var{isSelectingColumn:r}=t;r||super.drawMouseRowHover(e,t)}drawScrim(e){var{context:t,loadingScrimProgress:r,metrics:i,theme:a}=e;if(r!=null){var{width:o,height:s,gridY:l}=i,{scrimBlurSize:d,scrimColor:u}=a;t.save(),t.globalCompositeOperation="color",t.filter="blur(".concat(d,"px)"),u!=null&&(t.fillStyle=u),t.beginPath(),t.rect(0,l,o,s-l),t.clip(),t.fillRect(-d,-d+l,d*2+o,(d*2+(s-l))*r),t.globalCompositeOperation="source-over",t.filter="blur(".concat(d,"px) opacity(15%)"),t.fillRect(-d,-d+l,d*2+o,(d*2+(s-l))*r),t.restore()}}drawColumnHeaders(e,t){super.drawColumnHeaders(e,t);var{theme:r,metrics:i,model:a,reverseType:o}=t,{columnHeaderHeight:s}=i;if(this.drawFilterHeaders(e,t),!(s<=0)){var{sort:l}=a;if(l.length===1){var d=o!==F.REVERSE_TYPE.NONE,u;d?u=r.headerReverseBarColor:u=r.headerSortBarColor,this.drawHeaderBar(e,t,u,d?r.reverseHeaderBarHeight:r.sortHeaderBarHeight)}else l.length>1&&(o!==F.REVERSE_TYPE.NONE&&this.drawHeaderBar(e,t,r.headerReverseBarColor,r.reverseHeaderBarHeight,!1),this.drawHeaderBar(e,t,r.headerSortBarColor,r.sortHeaderBarHeight))}}drawHeaderBar(e,t,r,i){var a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,{theme:o,metrics:s,model:l}=t,{columnHeaderHeight:d,width:u}=s,c=0;a||(c=i),e.fillStyle=o.headerBarCasingColor,e.fillRect(0,l.columnHeaderMaxDepth*d-i-2+c,u,i+2),e.fillStyle=r,e.fillRect(0,l.columnHeaderMaxDepth*d-i-1+c,u,i)}drawColumnHeadersAtDepth(e,t,r,i,a){var{metrics:o,model:s,isMenuShown:l}=t,{columnHeaderMaxDepth:d}=s,{width:u}=o,c=Sf(Sf({},i),{},{maxX:a===d-1&&i.maxX===u?u-(l?0:30):i.maxX});super.drawColumnHeadersAtDepth(e,t,r,c,a)}drawColumnHeaderAtIndex(e,t,r,i){var a,o;super.drawColumnHeaderAtIndex(e,t,r,i);var{metrics:s,model:l,theme:d}=t,{modelColumns:u,allColumnWidths:c,allColumnXs:m,gridX:v,columnHeaderHeight:f,fontWidths:g}=s,{headerHorizontalPadding:p}=d,b=B(c,r,0),S=B(m,r)+v,C=u.get(r);if(C!=null){var y=(a=l.columns[C])===null||a===void 0?void 0:a.name;if(y!=null){var E=F.getSortForColumn(l.sort,y);if(E){var T=this.getSortIcon(E);if(T){var O=l.textForColumnHeader(C);if(O!==void 0){var N=(o=g.get(e.font))!==null&&o!==void 0?o:xa;j(N);var P=O.length*N,R=v+S+P+p,{maxX:A}=i;A-=p;var M=v+S+b-p-1,I=R>A?R+1:Math.min(A,M),x=E.direction===F.sortDirection.ascending?-6:-12,_=f*.5+x;e.save(),e.beginPath(),e.rect(S,0,b,f),e.clip(),e.fillStyle=d.headerSortBarColor,e.translate(I,_),e.fill(T),e.restore()}}}}}}drawFilterHeaders(e,t){var{isFilterBarShown:r,quickFilters:i,advancedFilters:a}=t;r?this.drawExpandedFilterHeaders(e,t):(i!=null&&i.size>0||a!=null&&a.size>0)&&this.drawCollapsedFilterHeaders(e,t)}drawExpandedFilterHeaders(e,t){var{metrics:r,model:i,theme:a,quickFilters:o,advancedFilters:s}=t,{filterBarHeight:l}=a;if(!(l<=0)){var{gridX:d,gridY:u,maxX:c,modelColumns:m,visibleColumns:v,allColumnWidths:f,allColumnXs:g}=r,p=u-l;e.save(),e.font=a.font,e.textAlign="left",o!=null&&o.size>0||s!=null&&s.size>0?e.fillStyle=a.filterBarExpandedActiveBackgroundColor:e.fillStyle=a.filterBarExpandedBackgroundColor,e.fillRect(d,p,c,l-1),e.fillStyle=a.headerBarCasingColor,e.fillRect(d,p+l-1,c,1);var b=p;e.strokeStyle=a.filterBarSeparatorColor,e.beginPath();for(var S=0;S<v.length;S+=1){var C=v[S],y=B(m,C),E=B(g,C),T=B(f,C);if(i.isFilterable(y)&&T>0){var O=d+(E??0);e.rect(O+.5,b+.5,T,l-2)}}e.stroke();for(var N=0;N<v.length;N+=1){var P=v[N],R=B(f,P),A=B(g,P),M=A+d;this.drawExpandedFilterHeader(e,t,P,M,R)}e.restore()}}drawExpandedFilterHeader(e,t,r,i,a){if(!(a<=0)){var{metrics:o,theme:s,quickFilters:l,advancedFilters:d}=t,{modelColumns:u,gridY:c}=o,{filterBarHeight:m,filterBarExpandedActiveCellBackgroundColor:v,filterBarErrorColor:f,filterBarHorizontalPadding:g,headerColor:p}=s,b=c-m,S=u.get(r);if(S!==void 0){var C=l.get(S),y=d.get(S);if(!(C==null&&y==null)){var E=null;if(C!=null){var{text:T}=C;if(E=T,E||(E=F.getFilterText(C.filter)),E!=null){var{fontWidths:O}=o,N=O.get(e.font);(N==null||N===0)&&(N=e.measureText("8").width,N||(N=10));var P=(a-g*2)/N;P<=0?E="":E.length>P&&(E="".concat(E.substring(0,P-1),"…"))}}e.save();var R=ad.isFilterValid(y,C);if(R&&v!=null)e.fillStyle=v,e.fillRect(i+1,b+1,a-1,m-3);else if(f!=null){e.fillStyle=f,e.lineWidth=2,e.strokeStyle=f;var A=i+2,M=b+2,I=a-3,x=m-5;e.strokeRect(A,M,I,x)}if(E!=null&&E!==""){var _=i+g,k=b+m*.5+1;e.fillStyle=p,e.fillText(E,_,k)}e.restore()}}}}drawCollapsedFilterHeaders(e,t){var{metrics:r,theme:i}=t,{headerSeparatorColor:a,filterBarCollapsedHeight:o}=i;if(!(o<=0)){var{gridX:s,gridY:l,maxX:d,visibleColumns:u,allColumnWidths:c,allColumnXs:m}=r,v=l-o;e.save(),e.fillStyle=a,e.fillRect(s,v,d,o);for(var f=0;f<u.length;f+=1){var g=u[f],p=c.get(g),b=m.get(g);if(b!=null&&p!=null){var S=b+s;this.drawCollapsedFilterHeader(e,t,g,S,p)}}e.restore()}}drawCollapsedFilterHeader(e,t,r,i,a){if(!(a<=0)){var{metrics:o,theme:s,quickFilters:l,advancedFilters:d}=t,{modelColumns:u,gridY:c}=o,m=u.get(r);if(m!==void 0){var v=l.get(m),f=d.get(m),{filterBarCollapsedHeight:g,filterBarActiveColor:p,filterBarActiveBackgroundColor:b,filterBarErrorColor:S}=s;e.save();var C=ad.isFilterValid(f,v);b!=null&&v==null&&f==null?e.fillStyle=b:p!=null&&C?e.fillStyle=p:S!=null&&(e.fillStyle=S);var y=i+1,E=c-g,T=a-1,O=g-1;e.fillRect(y,E,T,O),e.restore()}}}drawRowFooters(e,t){var{metrics:r,model:i,mouseX:a,mouseY:o,theme:s}=t,{gridY:l,gridX:d,maxX:u,modelRows:c,floatingTopHeight:m,floatingBottomHeight:v,floatingRows:f,rowFooterWidth:g,height:p,horizontalBarHeight:b,verticalBarWidth:S,allRowHeights:C,allRowYs:y,width:E}=r;if(!(g<=0||f.length===0)){var{cellHorizontalPadding:T,floatingGridRowColor:O,floatingRowBackgroundColors:N,headerColor:P,rowHoverBackgroundColor:R}=s;e.translate(d,l),e.beginPath();var A=Math.min(u,E-g-S-d);e.fillStyle=N,m>0&&e.rect(A,0,g,m),v>0&&e.rect(A,p-l-b-v,g,v),e.fill();var M=a!=null&&o!=null&&a>=d&&a<=u+g?ae.getRowAtY(o,r):null;if(R!=null&&M!==null&&f.includes(M)){e.fillStyle=R;var I=y.get(M),x=C.get(M);j(I),j(x),e.fillRect(A,I,g,x)}if(e.beginPath(),O!=null&&(e.strokeStyle=O),m>0&&(e.moveTo(A+.5,.5),e.lineTo(A+.5,m-.5)),v>0){var _=p-l-b-v;e.moveTo(A-.5,_+.5),e.lineTo(A-.5,_+v-.5)}e.stroke(),e.fillStyle=P,e.textAlign="left";for(var k=A+T,U=0;U<f.length;U+=1){var G=f[U],Y=C.get(G),Z=y.get(G),$=c.get(G);if(Z!=null&&Y!=null&&$!=null){var D=Z+Y*.5;e.fillText(i.textForRowFooter($),k,D)}}e.translate(-d,-l)}}getExpandButtonPosition(e,t){var{mouseX:r,mouseY:i,metrics:a,theme:o}=e,s={left:null,top:null,width:null,height:null};if(r==null||i==null||t==null||!a)return s;var{rowHeight:l,left:d,top:u}=ae.getCellInfoFromXY(r,i,a);j(d),j(l),j(u);var{cellHorizontalPadding:c}=o,m=wf+2*c,v=Math.max(d+wf*t,a.gridX),f=a.gridY+u;return{left:v,top:f,width:m,height:l}}}const Ax="12px Fira Sans, sans-serif",Lx="var(--dh-color-white)",kx="var(--dh-color-black)",yf={"grid-bg":"var(--dh-color-grid-bg)",font:Ax,white:Lx,black:kx,"header-bg":"var(--dh-color-grid-header-bg)","header-color":"var(--dh-color-grid-header-text)","header-height":"30px","header-separator-color":"var(--dh-color-grid-header-separator)","header-separator-hover-color":"var(--dh-color-grid-header-separator-hover)","header-hidden-separator-hover-color":"var(--dh-color-grid-header-separator-hidden-hover)","header-sort-bar-color":"var(--dh-color-grid-header-sort-bar)","header-reverse-bar-color":"var(--dh-color-grid-header-reverse-bar)","header-bar-casing-color":"var(--dh-color-grid-header-bar-casing)","header-font":"600 12px Fira Sans, sans-serif","row-height":"19px","row-background-colors":"var(--dh-color-grid-row-0-bg) var(--dh-color-grid-row-1-bg)","selection-color":"var(--dh-color-grid-selection)","selection-outline-color":"var(--dh-color-grid-selection-outline)","selection-outline-casing-color":"var(--dh-color-grid-selection-outline-casing)","row-hover-bg":"var(--dh-color-grid-row-hover-bg)","row-shadow-alpha":"var(--dh-color-grid-row-shadow-alpha)","selected-row-hover-bg":"var(--dh-color-grid-row-hover-bg-selected)","scroll-bar-active-selection-tick-color":"var(--dh-color-grid-scroll-bar-active-selection-tick)","scroll-bar-bg":"var(--dh-color-grid-scroll-bar-bg)","scroll-bar-hover-bg":"var(--dh-color-grid-scroll-bar-hover-bg)","scroll-bar-casing-color":"var(--dh-color-grid-scroll-bar-casing)","scroll-bar-corner-color":"var(--dh-color-grid-scroll-bar-corner)","scroll-bar-color":"var(--dh-color-grid-scroll-bar)","scroll-bar-hover-color":"var(--dh-color-grid-scroll-bar-hover)","scroll-bar-active-color":"var(--dh-color-grid-scroll-bar-active)","text-color":"var(--dh-color-grid-text)","hyperlink-color":"var(--dh-color-grid-text-hyperlink)","positive-number-color":"var(--dh-color-grid-number-positive)","negative-number-color":"var(--dh-color-grid-number-negative)","zero-number-color":"var(--dh-color-grid-number-zero)","date-color":"var(--dh-color-grid-date)","pending-text-color":"var(--dh-color-grid-text-pending)","error-text-color":"var(--dh-color-grid-text-error)","null-string-color":"var(--dh-color-grid-string-null)","filter-bar-active-bg":"var(--dh-color-grid-filter-bar-active-bg)","filter-bar-active-color":"var(--dh-color-grid-filter-bar-active)","filter-bar-expanded-bg":"var(--dh-color-grid-filter-bar-expanded-bg)","filter-bar-expanded-active-bg":"var(--dh-color-grid-filter-bar-expanded-active-bg)","filter-bar-expanded-active-cell-bg":"var(--dh-color-grid-filter-bar-expanded-active-cell-bg)","filter-bar-separator-color":"var(--dh-color-grid-filter-bar-separator)","filter-bar-error-color":"var(--dh-color-grid-filter-bar-error)","filter-icon-color":"var(--dh-color-grid-filter-icon)","scrim-color":"var(--dh-color-grid-scrim)","context-menu-sort-icon-color":"var(--dh-color-grid-context-menu-sort-icon)","context-menu-reverse-icon-color":"var(--dh-color-grid-context-menu-reverse-icon)","linker-column-hover-bg":"var(--dh-color-grid-column-linker-hover-bg)","tree-line-color":"var(--dh-color-grid-tree-line)","tree-marker-color":"var(--dh-color-grid-tree-marker)","tree-marker-hover-color":"var(--dh-color-grid-tree-marker-hover)","grouped-column-divider-color":"var(--dh-color-grid-column-grouped-divider)","floating-grid-row-color":"var(--dh-color-grid-floating-row)","floating-row-background-colors":"var(--dh-color-grid-floating-row-bg)","floating-divider-inner-color":"var(--dh-color-grid-floating-divider-inner)","floating-divider-outer-color":"var(--dh-color-grid-floating-divider-outer)","overflow-button-color":"var(--dh-color-grid-overflow-button)","overflow-button-hover-color":"var(--dh-color-grid-overflow-button-hover)","zero-line-color":"var(--dh-color-grid-data-bar-zero-line)","positive-bar-color":"var(--dh-color-grid-data-bar-positive)","negative-bar-color":"var(--dh-color-grid-data-bar-negative)","marker-bar-color":"var(--dh-color-grid-data-bar-marker)"};function Ef(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function Tf(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Ef(Object(t),!0).forEach(function(r){jx(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Ef(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function jx(n,e,t){return e=$x(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function $x(n){var e=Hx(n,"string");return typeof e=="symbol"?e:String(e)}function Hx(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var Pf=ie.module("IrisGridTheme");function sS(){var n,e=Wh(yf);return e["row-background-colors"]=Tb((n=e["row-background-colors"])!==null&&n!==void 0?n:"").map(t=>{var[r,i]=t;return Pd.normalizeCssColor(e["row-background-colors"].substring(r,i+1))}).join(" "),Pf.debug2("Iris grid theme:",yf),Pf.debug2("Iris grid theme derived:",e),Object.freeze(Tf(Tf({},WC),{},{backgroundColor:e["grid-bg"],white:e.white,black:e.black,font:e.font,headerBackgroundColor:e["header-bg"],headerColor:e["header-color"],headerSeparatorColor:e["header-separator-color"],headerSeparatorHoverColor:e["header-separator-hover-color"],headerHiddenSeparatorHoverColor:e["header-hidden-separator-hover-color"],headerSortBarColor:e["header-sort-bar-color"],headerReverseBarColor:e["header-reverse-bar-color"],headerBarCasingColor:e["header-bar-casing-color"],headerFont:e["header-font"],rowBackgroundColors:e["row-background-colors"],rowHoverBackgroundColor:e["row-hover-bg"],selectionColor:e["selection-color"],selectionOutlineColor:e["selection-outline-color"],selectionOutlineCasingColor:e["selection-outline-casing-color"],selectedRowHoverBackgroundColor:e["selected-row-hover-bg"],scrollBarBackgroundColor:e["scroll-bar-bg"],scrollBarHoverBackgroundColor:e["scroll-bar-hover-bg"],scrollBarCasingColor:e["scroll-bar-casing-color"],scrollBarCornerColor:e["scroll-bar-corner-color"],scrollBarColor:e["scroll-bar-color"],scrollBarHoverColor:e["scroll-bar-hover-color"],scrollBarActiveColor:e["scroll-bar-active-color"],scrollBarSelectionTickColor:e["selected-row-hover-bg"],scrollBarActiveSelectionTickColor:e["scroll-bar-active-selection-tick-color"],textColor:e["text-color"],hyperlinkColor:e["hyperlink-color"],positiveNumberColor:e["positive-number-color"],negativeNumberColor:e["negative-number-color"],zeroNumberColor:e["zero-number-color"],dateColor:e["date-color"],pendingTextColor:e["pending-text-color"],errorTextColor:e["error-text-color"],nullStringColor:e["null-string-color"],filterBarActiveBackgroundColor:e["filter-bar-active-bg"],filterBarExpandedBackgroundColor:e["filter-bar-expanded-bg"],filterBarExpandedActiveBackgroundColor:e["filter-bar-expanded-active-bg"],filterBarExpandedActiveCellBackgroundColor:e["filter-bar-expanded-active-cell-bg"],filterBarSeparatorColor:e["filter-bar-separator-color"],filterBarActiveColor:e["filter-bar-active-color"],filterBarErrorColor:e["filter-bar-error-color"],filterIconColor:e["filter-icon-color"],scrimColor:e["scrim-color"],contextMenuSortIconColor:e["context-menu-sort-icon-color"],contextMenuReverseIconColor:e["context-menu-reverse-icon-color"],allowRowResize:!1,autoSelectRow:!0,gridColumnColor:null,gridRowColor:null,groupedColumnDividerColor:e["grouped-column-divider-color"],columnHoverBackgroundColor:null,headerHorizontalPadding:12,scrollBarSize:13,scrollBarHoverSize:16,minScrollHandleSize:24,rowHeight:parseInt(e["row-height"],10)||19,columnWidth:100,rowHeaderWidth:0,rowFooterWidth:60,columnHeaderHeight:parseInt(e["header-height"],10)||30,filterBarHeight:30,filterBarCollapsedHeight:5,sortHeaderBarHeight:2,reverseHeaderBarHeight:4,filterBarHorizontalPadding:4,shadowAlpha:parseFloat(e["row-shadow-alpha"])||.15,scrimBlurSize:25,minScrimTransitionTime:150,maxScrimTransitionTime:350,scrollSnapToRow:!0,linkerColumnHoverBackgroundColor:e["linker-column-hover-bg"],treeLineColor:e["tree-line-color"],treeMarkerColor:e["tree-marker-color"],treeMarkerHoverColor:e["tree-marker-hover-color"],floatingGridColumnColor:null,floatingGridRowColor:e["floating-grid-row-color"],floatingRowBackgroundColors:e["floating-row-background-colors"],floatingDividerInnerColor:e["floating-divider-inner-color"],floatingDividerOuterColor:e["floating-divider-outer-color"],overflowButtonColor:e["overflow-button-color"],overflowButtonHoverColor:e["overflow-button-hover-color"],zeroLineColor:e["zero-line-color"],positiveBarColor:e["positive-bar-color"],negativeBarColor:e["negative-bar-color"],markerBarColor:e["marker-bar-color"]}))}function lS(n,e,t){return e=Bx(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Bx(n){var e=Ux(n,"string");return typeof e=="symbol"?e:String(e)}function Ux(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var Ku=ie.module("ColumnStatistics"),Vx={SIZE:"Number of Rows"};class Rs extends w.Component{static getStatsLabel(e){var t;return(t=Vx[e])!==null&&t!==void 0?t:e.split(" ").map(r=>r[0].toUpperCase()+r.substr(1).toLowerCase()).join(" ")}constructor(e){super(e),lS(this,"cancelablePromise",void 0),this.handleError=this.handleError.bind(this),this.handleGenerateStatistics=this.handleGenerateStatistics.bind(this),this.handleStatistics=this.handleStatistics.bind(this),this.cancelablePromise=null,this.state={error:null,loading:!1,statistics:null,numRows:0}}componentDidMount(){this.maybeGenerateStatistics()}componentWillUnmount(){this.cancelablePromise&&this.cancelablePromise.cancel()}maybeGenerateStatistics(){var{column:e,model:t}=this.props,r=t.rowCount-t.pendingRowCount-t.floatingBottomRowCount-t.floatingTopRowCount;this.setState({numRows:r}),!t.isColumnStatisticsAvailable||e.isProxy===!0?this.setState({loading:!1}):r<Rs.AUTO_GENERATE_LIMIT&&this.handleGenerateStatistics()}handleGenerateStatistics(){this.setState({loading:!0});var{column:e,model:t}=this.props;this.cancelablePromise=Re.makeCancelable(t.columnStatistics(e)),this.cancelablePromise.then(this.handleStatistics).catch(this.handleError)}handleStatistics(e){Ku.debug("Received statistics",e);var{model:t,onStatistics:r}=this.props,i=[];e.statisticsMap.forEach((a,o)=>{i.push({operation:Rs.getStatsLabel(o),value:a,type:e.getType(o)})}),e.uniqueValues.forEach((a,o)=>{i.push({operation:o,className:"column-statistics-unique-value",value:a,type:"long"})}),this.setState({loading:!1,statistics:i,numRows:t.rowCount-t.pendingRowCount-t.floatingBottomRowCount-t.floatingTopRowCount}),r()}handleError(e){if(e!=null&&Re.isCanceled(e)){Ku.debug("Called handleError on a cancelled promise result");return}Ku.error("Error generating statistics",e),this.setState({error:e,loading:!1,statistics:null})}render(){var e,{column:t,model:r}=this.props,{error:i,loading:a,statistics:o,numRows:s}=this.state,l=!a&&i==null&&o==null&&r.isColumnStatisticsAvailable,d=[],u=t.type.substring(t.type.lastIndexOf(".")+1),c=t.description===null?null:t.description;if(o!=null)for(var m=0;m<o.length;m+=1){var{operation:v,className:f,value:g,type:p}=o[m],b=p?r.displayString(g,p):r.displayString(g,t.type,t.name),S=h.jsxs(oe.Fragment,{children:[h.jsx("div",{className:X("column-statistic-operation",f),children:v}),h.jsx("div",{className:"column-statistic-value",children:b})]},v);d.push(S)}var C=Ke(r)&&r.hasExpandableRows?"Expanded Rows":"Number of Rows",y=r.displayString(s,"long"),E=r.getColumnIndexByName(t.name);return h.jsxs("div",{className:"column-statistics",children:[h.jsxs("div",{className:"column-statistics-title",children:[(e=t.displayName)!==null&&e!==void 0?e:t.name,h.jsxs("span",{className:"column-statistics-type",children:[" (",u,")"]}),h.jsx(Md,{className:"column-statistics-copy",tooltip:"Copy column name",copy:t.name})]}),c!=null&&h.jsx("div",{className:"column-statistics-description",children:c}),E!=null&&!r.isColumnSortable(E)&&h.jsxs("div",{className:"column-statistics-status",children:[h.jsx(ue,{icon:Jy,className:"mr-1"}),"Not sortable"]}),E!=null&&!r.isColumnMovable(E)&&h.jsxs("div",{className:"column-statistics-status",children:[h.jsx(ue,{icon:r.isColumnFrozen(E)?e0:t0,className:"mr-1"}),r.isColumnFrozen(E)?"Frozen":"Not movable"]}),h.jsxs("div",{className:"column-statistics-grid",children:[o==null&&h.jsxs(h.Fragment,{children:[h.jsx("div",{className:"column-statistic-operation",children:C}),h.jsx("div",{className:"column-statistic-value",children:y})]}),d]}),l&&h.jsx(K,{kind:"ghost",className:"px-0",onClick:this.handleGenerateStatistics,children:"Generate Stats"}),i!=null&&h.jsx("div",{className:"error-message",children:"".concat(i)}),o&&!a&&h.jsx(K,{kind:"ghost",className:"px-0",onClick:this.handleGenerateStatistics,icon:h.jsx(ue,{icon:qh,className:"mr-1"}),children:"Refresh"}),a&&h.jsxs("div",{className:"column-statistics-loading",children:[h.jsx(ia,{className:"loading-spinner-vertical-align"}),"Calculating Stats..."]})]})}}lS(Rs,"AUTO_GENERATE_LIMIT",1e5);const Gx=Rs;function Of(n,e,t){return e=Wx(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Wx(n){var e=zx(n,"string");return typeof e=="symbol"?e:String(e)}function zx(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var Cl=ie.module("AdvancedFilterCreatorFilterItem");class Mc extends w.PureComponent{static getLabelForFilter(e,t){try{if(F.isNumberType(e)||F.isCharType(e))return iC(t);if(F.isTextType(e))return nC(t);if(F.isDateType(e))return aC(t);if(F.isBooleanType(e))return XP(t);throw new Error("Unrecognized column type: ".concat(e))}catch(r){return Cl.warn(r),""}}constructor(e){super(e),Of(this,"typeDropdown",void 0),Of(this,"getCachedIsValid",be((a,o,s,l,d)=>{try{return!s||d.makeAdvancedValueFilter(a,o,s,l)!=null}catch{return!1}})),this.handleDelete=this.handleDelete.bind(this),this.handleTypeChange=this.handleTypeChange.bind(this),this.handleValueChange=this.handleValueChange.bind(this),this.typeDropdown=null;var{value:t="",filterTypes:r,selectedType:i=r[0]}=e;this.state={selectedType:i,value:t}}componentDidMount(){var e;(e=this.typeDropdown)===null||e===void 0||e.focus()}componentDidUpdate(e){var{value:t,selectedType:r}=this.props;r!==void 0&&e.selectedType!==r&&this.setState({selectedType:r}),t!==void 0&&e.value!==t&&this.setState({value:t})}handleTypeChange(e){var t=e;Cl.debug2("typeChange",t),this.setState({selectedType:t});var{onChange:r}=this.props,{value:i}=this.state;i!=null&&i.length>0&&r(t,i)}handleValueChange(e){Cl.debug2("valueChange");var{value:t}=e.target;this.setState({value:t});var{onChange:r}=this.props,{selectedType:i}=this.state;i!=null&&r(i,t)}handleDelete(){Cl.debug("delete");var{onDelete:e}=this.props;e()}render(){for(var{column:e,filterTypes:t,formatter:r,tableUtils:i}=this.props,{selectedType:a,value:o}=this.state,s=!F.isBooleanType(e.type),l=[],d=this.getCachedIsValid(e,a,o,r.timeZone,i),u=0;u<t.length;u+=1){var c=t[u],m=Mc.getLabelForFilter(e.type,c),v=h.jsx("option",{value:c,children:m},c);l.push(v)}return h.jsx("div",{className:"advanced-filter-creator-filter-item",children:h.jsxs("div",{className:"form-row",children:[h.jsx("div",{className:"form-group col",children:h.jsx(Gt,{className:"form-control",value:a,onChange:this.handleTypeChange,ref:f=>{this.typeDropdown=f},children:l})}),s&&h.jsx("div",{className:"form-group col",children:h.jsx("div",{className:"input-group",children:h.jsx("input",{type:"text",className:X("form-control",{error:!d}),placeholder:"Enter value",value:o,onChange:this.handleValueChange})})}),h.jsx("div",{className:"form-group col-1 px-0",children:h.jsx(K,{kind:"ghost",className:"w-100 h-100 p-0 m-0",onClick:this.handleDelete,icon:Br,tooltip:"Remove Filter"})})]})})}}const Kx=Mc;function Ih(n,e,t){return e=qx(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function qx(n){var e=Yx(n,"string");return typeof e=="symbol"?e:String(e)}function Yx(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var Df=ie.module("AdvancedFilterCreatorSelectValueList");class Is extends w.PureComponent{static indexOf(e,t){for(var r=0;r<t.length;r+=1){var i=t[r];if(i===e||i!=null&&i.valueOf!=null&&e!=null&&e.valueOf!=null&&i.valueOf()===e.valueOf())return r}return-1}constructor(e){super(e),Ih(this,"dh",void 0),Ih(this,"list",void 0),this.handleSelect=this.handleSelect.bind(this),this.handleViewportChange=this.handleViewportChange.bind(this),this.handleSelectionUpdate=this.handleSelectionUpdate.bind(this),this.handleTableUpdate=this.handleTableUpdate.bind(this);var{selectedValues:t,dh:r}=this.props;this.dh=r,this.list=null,this.state={itemCount:0,items:[],offset:0,selectedValues:t,isLoading:!0}}componentDidMount(){var{table:e}=this.props;e&&this.startListening(e)}componentDidUpdate(e){var{filters:t,invertSelection:r,selectedValues:i,table:a}=this.props;e.table!==a&&(e.table&&this.stopListening(e.table),a&&this.startListening(a),this.resetViewport()),e.invertSelection!==r&&this.setState({selectedValues:[]},this.handleSelectionUpdate),e.selectedValues!==i&&this.setState({selectedValues:i},this.handleSelectionUpdate),e.filters!==t&&(a==null||a.applyFilter(t),this.resetViewport())}componentWillUnmount(){var{table:e}=this.props;e&&this.stopListening(e)}handleSelect(e,t){var{invertSelection:r}=this.props,{selectedValues:i}=this.state;i=[...i];var a=Is.indexOf(t,i);a>=0?i.splice(a,1):i.push(t);var o=a<0;r&&(o=!o);var{offset:s}=this.state,{items:l}=this.state;l=[...l];var d=e-s;d>=0&&d<l.length&&(l[d].isSelected=o),this.setState({items:l,selectedValues:i});var{onChange:u}=this.props;u(i,r)}handleViewportChange(e,t){this.updateViewport(e,t)}handleSelectionUpdate(){this.updateItemSelection()}handleTableUpdate(e){var{table:t,formatter:r}=this.props;if(t){for(var i=e.detail,{offset:a}=i,o=[],s=t.columns[0],l=0;l<i.rows.length;l+=1){var d=i.rows[l],u=d.get(s),c=void 0;u==null?c=h.jsx("i",{className:"text-muted",children:"null"}):u===""?c=h.jsx("i",{className:"text-muted",children:"empty"}):c=r.getFormattedString(u,s.type,s.name);var m=this.isValueSelected(u);o.push({displayValue:c,value:u,isSelected:m})}Df.debug2("Received table update:",a,o.length);var v=t.size;this.setState({itemCount:v,items:o,offset:a,isLoading:!1})}}isValueSelected(e){var{invertSelection:t}=this.props,{selectedValues:r}=this.state,i=Is.indexOf(e,r);return t?i<0:i>=0}startListening(e){e.addEventListener(this.dh.Table.EVENT_UPDATED,this.handleTableUpdate)}stopListening(e){e.removeEventListener(this.dh.Table.EVENT_UPDATED,this.handleTableUpdate)}resetViewport(){this.list&&this.list.topRow!=null&&this.list.bottomRow!=null&&this.updateViewport(this.list.topRow,this.list.bottomRow,!0)}updateItemSelection(){var{items:e}=this.state;e=[...e];for(var t=0;t<e.length;t+=1){var r=e[t],{value:i}=r;r.isSelected=this.isValueSelected(i)}this.setState({items:e})}updateViewport(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,{table:i}=this.props;if(i!=null){r&&this.setState({isLoading:!0});var a=t-e+1,o=Math.max(0,e-a*3),s=Math.max(o,t+a*3);Df.debug2("Setting viewport",o,",",s),i.setViewport(o,s)}}render(){var{offset:e,isLoading:t,items:r,itemCount:i}=this.state;return h.jsxs("div",{className:"select-value-list-wrapper",children:[h.jsx(TP,{itemCount:i,items:r,offset:e,onSelect:this.handleSelect,onViewportChange:this.handleViewportChange,ref:a=>{this.list=a}}),h.jsx(Sr,{in:t,timeout:250,classNames:"fade",mountOnEnter:!0,unmountOnExit:!0,children:h.jsx("div",{className:"loading-list",children:h.jsx(ia,{className:"loading-spinner-large"})})})]})}}Ih(Is,"defaultProps",{invertSelection:!0,selectedValues:[],onChange:()=>{}});const Xx=Is;function ys(n,e,t){return e=Qx(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Qx(n){var e=Zx(n,"string");return typeof e=="symbol"?e:String(e)}function Zx(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class Vs extends w.PureComponent{constructor(e){super(e),ys(this,"searchTablePromise",void 0),ys(this,"tableUtils",void 0),ys(this,"updateFilterTimer",void 0),this.handleSelectAllClick=this.handleSelectAllClick.bind(this),this.handleClearAllClick=this.handleClearAllClick.bind(this),this.handleListChange=this.handleListChange.bind(this),this.handleSearchChange=this.handleSearchChange.bind(this),this.handleUpdateFilterTimeout=this.handleUpdateFilterTimeout.bind(this);var{dh:t,invertSelection:r,selectedValues:i}=e;this.tableUtils=new F(t),this.state={filters:[],invertSelection:r,selectedValues:i,searchText:""}}componentDidMount(){this.initSearchTable()}componentDidUpdate(e,t){var{invertSelection:r,selectedValues:i,table:a}=this.props;e.table!==a&&this.initSearchTable(),e.invertSelection!==r&&this.setState({invertSelection:r}),e.selectedValues!==i&&this.setState({selectedValues:i});var{table:o,searchText:s}=this.state;o!==t.table&&(t.table!=null&&t.table.close(),o!=null&&this.startUpdateFilterTimer()),s!==t.searchText&&this.startUpdateFilterTimer()}componentWillUnmount(){var{table:e}=this.state;e!=null&&e.close(),this.searchTablePromise=void 0,this.stopUpdateFilterTimer()}getColumnName(){var{table:e}=this.props;return e!=null?e.columns[0].name:""}getDisplayedValuesCount(){var{invertSelection:e,selectedValues:t,table:r}=this.state;return r==null?null:e?r.totalSize-t.length:t.length}getDisplayedValueText(){var e=this.getDisplayedValuesCount(),{table:t}=this.state,{formatter:r}=this.props;if(e!=null&&t!=null){var i=r.getFormattedString(e,"long"),a=r.getFormattedString(t.totalSize,"long"),o="";return e<1e6&&(o="Displaying "),"".concat(o).concat(i," of ").concat(a)}return null}initSearchTable(){var{table:e}=this.props;if(e!=null){var t=e.copy();this.searchTablePromise=t,this.searchTablePromise.then(r=>{this.searchTablePromise===t?(this.setState({table:r}),this.searchTablePromise=void 0):r.close()})}}handleListChange(e,t){this.setState({selectedValues:e,invertSelection:t});var{onChange:r}=this.props;r(e,t)}handleSearchChange(e){var t=e.target.value;this.setState({searchText:t})}handleSelectAllClick(){this.resetSelection(!0)}handleClearAllClick(){this.resetSelection(!1)}handleUpdateFilterTimeout(){this.updateFilterTimer=void 0,this.updateTableFilter()}resetSelection(e){var t=[];this.setState({invertSelection:e,selectedValues:t});var{onChange:r}=this.props;r(t,e)}startUpdateFilterTimer(){this.stopUpdateFilterTimer(),this.updateFilterTimer=setTimeout(this.handleUpdateFilterTimeout,Vs.searchDebounceTime)}stopUpdateFilterTimer(){this.updateFilterTimer!=null&&(clearTimeout(this.updateFilterTimer),this.updateFilterTimer=void 0)}updateTableFilter(){var{table:e,searchText:t}=this.state,{timeZone:r}=this.props,{tableUtils:i}=this,a=e==null?void 0:e.columns[0],o=[];if(a!=null){var s;if(t.length>0){var l=null;F.isCharType(a.type)?l=i.makeQuickFilter(a,t):F.isTextType(a.type)?l=i.makeQuickFilter(a,"~".concat(t),r):l=i.makeQuickFilter(a,">=".concat(t),r),l!=null?o.push(l):s="Invalid search text"}this.setState({filters:o,error:s})}}render(){var{error:e,filters:t,invertSelection:r,selectedValues:i,searchText:a,table:o}=this.state,{dh:s,formatter:l,showSearch:d}=this.props,u=this.getColumnName(),c=this.getDisplayedValueText(),m=u?"Find ".concat(u,"..."):"";return h.jsxs("div",{className:"advanced-filter-creator-select-value",children:[h.jsxs("div",{className:d?"form-group":"",children:[h.jsx("label",{htmlFor:"advanced-filter-creator-select-value-input",children:"Select Values"}),d&&h.jsx("input",{type:"text",className:X("form-control",{"is-invalid":e!=null}),id:"advanced-filter-creator-select-value-input",placeholder:m,value:a,onChange:this.handleSearchChange})]}),h.jsx(Xx,{dh:s,table:o,filters:t,invertSelection:r,selectedValues:i,formatter:l,onChange:this.handleListChange}),h.jsxs("div",{className:"advanced-filter-creator-select-meta-row",children:[h.jsxs("div",{children:[h.jsx(K,{kind:"ghost",onClick:this.handleSelectAllClick,children:"Select All"}),h.jsx(K,{kind:"ghost",onClick:this.handleClearAllClick,children:"Clear"})]}),h.jsx(Sr,{in:c!=null,timeout:250,classNames:"fade",mountOnEnter:!0,unmountOnExit:!0,children:h.jsx("div",{className:"row-count-info",children:c})})]})]})}}ys(Vs,"searchDebounceTime",250);ys(Vs,"defaultProps",{invertSelection:!0,selectedValues:[],onChange:()=>{},showSearch:!0});const Jx=Vs;function ho(n,e,t){return e=eA(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function eA(n){var e=tA(n,"string");return typeof e=="symbol"?e:String(e)}function tA(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var Jo=ie.module("AdvancedFilterCreator");class kn extends w.PureComponent{static makeFilterItem(){return{key:qe()}}constructor(e){var t,r;super(e),ho(this,"focusTrapContainer",void 0),ho(this,"debounceTimeout",void 0),ho(this,"valuesTablePromise",void 0),ho(this,"getFilterTypes",be(v=>F.getFilterTypes(v))),this.handleAddAnd=this.handleAddAnd.bind(this),this.handleAddOr=this.handleAddOr.bind(this),this.handleChangeFilterOperator=this.handleChangeFilterOperator.bind(this),this.handleDone=this.handleDone.bind(this),this.handleFilterChange=this.handleFilterChange.bind(this),this.handleFilterDelete=this.handleFilterDelete.bind(this),this.handleSelectValueChange=this.handleSelectValueChange.bind(this),this.handleReset=this.handleReset.bind(this),this.handleSortDown=this.handleSortDown.bind(this),this.handleSortUp=this.handleSortUp.bind(this),this.handleSubmit=this.handleSubmit.bind(this),this.handleFocusTrapStart=this.handleFocusTrapStart.bind(this),this.handleFocusTrapEnd=this.handleFocusTrapEnd.bind(this),this.handleUpdateTimeout=this.handleUpdateTimeout.bind(this),this.focusTrapContainer=oe.createRef();var{model:i,column:a,options:o}=e,{filterOperators:s,invertSelection:l,selectedValues:d}=o,u=(t=(r=o.filterItems)===null||r===void 0?void 0:r.map(v=>{var{selectedType:f,value:g}=v;return{selectedType:f,value:g,key:qe()}}))!==null&&t!==void 0?t:[];u.length===0&&u.push(kn.makeFilterItem()),s==null&&(s=[]),l==null&&(l=!0),d==null&&(d=[]);var c=i.getColumnIndexByName(a.name);j(c);var m=i.isColumnSortable(c);this.state={filterItems:u,filterOperators:s,invertSelection:l,selectedValues:d,valuesTableError:null,valuesTable:void 0,isSortable:m}}componentDidMount(){this.initValuesTable()}componentWillUnmount(){this.debounceTimeout!=null&&(clearTimeout(this.debounceTimeout),this.sendUpdate()),this.valuesTablePromise!=null&&this.valuesTablePromise.cancel()}getFilterChangeHandler(e){return this.handleFilterChange.bind(this,e)}getFilterDeleteHandler(e){return this.handleFilterDelete.bind(this,e)}initValuesTable(){var{model:e,column:t}=this.props;if(!e.isValuesTableAvailable){Jo.debug("No values table for this model, just ignore");return}this.valuesTablePromise=F.makeCancelableTablePromise(e.valuesTable(t)),this.valuesTablePromise.then(r=>{var i;if(!((i=r.columns[0].isSortable)!==null&&i!==void 0)||i){var a=r.columns[0].sort().asc();r.applySort([a])}this.setState({valuesTable:r})}).catch(r=>{Re.isCanceled(r)||(Jo.error("Unable to open values table",r),this.setState({valuesTableError:r}))})}handleFocusTrapEnd(){var e,t;((e=this.focusTrapContainer)===null||e===void 0||(t=e.current)===null||t===void 0?void 0:t.querySelector("button,select,input,textarea")).focus()}handleFocusTrapStart(){var e,t,r=(e=this.focusTrapContainer)===null||e===void 0||(t=e.current)===null||t===void 0?void 0:t.querySelectorAll("button,select,input,textarea");if(r&&r.length>0){var i=r[r.length-1];i.focus()}}handleAddAnd(){var{filterItems:e,filterOperators:t}=this.state;e=e.concat(kn.makeFilterItem()),t=t.concat(Hn.and),this.setState({filterItems:e,filterOperators:t})}handleAddOr(){var{filterItems:e,filterOperators:t}=this.state;e=e.concat(kn.makeFilterItem()),t=t.concat(Hn.or),this.setState({filterItems:e,filterOperators:t})}handleChangeFilterOperator(e,t){var{filterOperators:r}=this.state;r=[...r],KP(t),r[e]=t,this.setState({filterOperators:r}),this.startUpdateTimer()}handleFilterChange(e,t,r){var{filterItems:i}=this.state;i=[...i];var{key:a}=i[e];i[e]={key:a,selectedType:t,value:r},this.setState({filterItems:i}),this.startUpdateTimer()}handleFilterDelete(e){var{filterItems:t,filterOperators:r}=this.state;t=[...t],r=[...r],e<t.length&&t.splice(e,1),e<r.length?r.splice(e,1):e===r.length&&r.splice(r.length-1,1),t.length===0&&t.push(kn.makeFilterItem()),this.setState({filterItems:t,filterOperators:r}),this.startUpdateTimer()}handleSelectValueChange(e,t){this.setState({selectedValues:e,invertSelection:t}),this.startUpdateTimer()}handleReset(){Jo.debug("Resetting Advanced Filter"),this.setState({filterItems:[kn.makeFilterItem()],filterOperators:[],selectedValues:[],invertSelection:!0}),this.startUpdateTimer()}handleSortDown(e){var t=lt.isModifierKeyDown(e);this.sortTable(F.sortDirection.descending,t)}handleSortUp(e){var t=lt.isModifierKeyDown(e);this.sortTable(F.sortDirection.ascending,t)}handleSubmit(e){Jo.debug("Submitting Advanced Filter"),this.stopUpdateTimer(),this.sendUpdate(),e.preventDefault()}handleDone(e){Jo.debug("Submitting and Closing Advanced Filter"),this.stopUpdateTimer(),this.sendUpdate();var{onDone:t}=this.props;t(),e.preventDefault()}handleUpdateTimeout(){this.debounceTimeout=void 0,this.sendUpdate()}shouldShowAddFilter(){var{filterItems:e}=this.state;if(e.length===0)return!1;var t=e[e.length-1],{selectedType:r,value:i}=t;return r!=null&&r.length>0&&i!=null&&i.length>0}sortTable(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,{column:r,onSortChange:i}=this.props,{isSortable:a}=this.state;a&&i(r,e,t)}startUpdateTimer(){this.stopUpdateTimer(),this.debounceTimeout=setTimeout(this.handleUpdateTimeout,kn.debounceFilterUpdate)}stopUpdateTimer(){this.debounceTimeout!==void 0&&(clearTimeout(this.debounceTimeout),this.debounceTimeout=void 0)}sendUpdate(){var{filterItems:e,filterOperators:t,invertSelection:r,selectedValues:i}=this.state,{column:a,onFilterChange:o,model:s,tableUtils:l}=this.props,{formatter:d}=s,u=e.filter(f=>{var{selectedType:g,value:p}=f;return g!=null&&p!=null&&p!==""}),c=t.filter((f,g)=>f!=null&&e[g].selectedType!=null&&e[g].value!=null&&e[g].value!=="").slice(0,u.length-1),m={filterItems:u,filterOperators:c,invertSelection:r,selectedValues:i},v=l.makeAdvancedFilter(a,m,d.timeZone);o(a,v,m)}render(){var e=this,{column:t,model:r,sortDirection:i,formatter:a,tableUtils:o}=this.props,{filterItems:s,filterOperators:l,invertSelection:d,selectedValues:u,valuesTable:c,valuesTableError:m,isSortable:v}=this.state,{dh:f,isValuesTableAvailable:g}=r,p=F.isBooleanType(t.type),b=F.isDateType(t.type),S=this.getFilterTypes(t.type),C=t.type.substring(t.type.lastIndexOf(".")+1),y=[];if(!p&&S.length)for(var E=function(R){var A=s[R],{key:M,selectedType:I,value:x}=A,_=h.jsx(Kx,{column:t,filterTypes:S,onChange:e.getFilterChangeHandler(R),onDelete:e.getFilterDeleteHandler(R),selectedType:I,value:x,formatter:a,tableUtils:o},M);if(y.push(_),R<l.length){var k=l[R],U=k===Hn.and,G=h.jsxs("div",{className:"form-row justify-content-end advanced-filter-creator-filter-operator",children:[h.jsx(K,{kind:"ghost",className:X("filter-operator",{active:U}),onClick:()=>e.handleChangeFilterOperator(R,Hn.and),children:"AND"}),h.jsx(K,{kind:"ghost",className:X("filter-operator",{active:!U}),onClick:()=>e.handleChangeFilterOperator(R,Hn.or),children:"OR"})]},"filterOperator".concat(M));y.push(G)}},T=0;T<s.length;T+=1)E(T);var O=this.shouldShowAddFilter(),N=h.jsxs("div",{className:X("form-row justify-content-end add-filter-item",{hidden:!O}),children:[h.jsx("span",{className:"text-muted",children:h.jsx(ue,{icon:Aa})}),h.jsx(K,{kind:"ghost",className:"btn-filter-item",onClick:this.handleAddAnd,disabled:!O,tooltip:"Add filter with AND",children:"AND"}),h.jsx(K,{kind:"ghost",className:"btn-filter-item",onClick:this.handleAddOr,disabled:!O,tooltip:"Add filter with OR",children:"OR"})]},"addFilterItem");return y.push(N),h.jsxs("div",{className:"advanced-filter-creator",role:"presentation",children:[h.jsx("div",{tabIndex:0,onFocus:this.handleFocusTrapStart}),h.jsxs("form",{onSubmit:this.handleSubmit,ref:this.focusTrapContainer,children:[h.jsxs("div",{className:"title-bar",children:[h.jsx("h6",{className:"advanced-filter-title",children:"Advanced Filters"}),h.jsxs("div",{className:"advanced-filter-menu-buttons",children:[h.jsx(K,{kind:"ghost",className:X("sort-operator",{active:i===F.sortDirection.descending}),onClick:this.handleSortDown,icon:gm,tooltip:v?"Sort ".concat(t.name," Descending"):"Not sortable",disabled:!v}),h.jsx(K,{kind:"ghost",className:X("sort-operator",{active:i===F.sortDirection.ascending}),onClick:this.handleSortUp,icon:h.jsx(ue,{icon:gm,rotation:180}),tooltip:v?"Sort ".concat(t.name," Ascending"):"Not sortable",disabled:!v})]})]}),h.jsx("hr",{}),h.jsxs("div",{className:"advanced-filter-column-name",children:[t.name," ",h.jsxs("span",{className:"column-type",children:["(",C,")"]})]}),y,g&&m==null&&h.jsxs(h.Fragment,{children:[!p&&h.jsx("hr",{}),h.jsx("div",{className:"form-group",children:h.jsx(Jx,{dh:f,table:c,onChange:this.handleSelectValueChange,invertSelection:d,selectedValues:u,formatter:a,showSearch:!b,timeZone:a.timeZone})})]}),h.jsxs("div",{className:"form-row justify-content-end",children:[h.jsx(K,{kind:"secondary",className:"mr-2",onClick:this.handleReset,children:"Reset"}),h.jsx(K,{kind:"primary",onClick:this.handleDone,children:"Done"})]})]}),h.jsx("div",{tabIndex:0,onFocus:this.handleFocusTrapEnd})]})}}ho(kn,"debounceFilterUpdate",250);ho(kn,"defaultProps",{options:{filterItems:null,filterOperators:null,invertSelection:!0,selectedValues:[]},sortDirection:null});const rA=kn;function Nf(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function Rf(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Nf(Object(t),!0).forEach(function(r){nA(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Nf(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function nA(n,e,t){return e=iA(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function iA(n){var e=aA(n,"string");return typeof e=="symbol"?e:String(e)}function aA(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var If=ie.module("Aggregations");function oA(n){var{isRollup:e,settings:t,onChange:r,onEdit:i}=n,{aggregations:a,showOnTop:o}=t,s=w.useMemo(()=>D_.filter(R=>!a.some(A=>A.operation===R)),[a]),[l,d]=w.useState(s[0]),[u,c]=w.useState([]),m=w.useCallback(R=>{r(Rf(Rf({},t),R))},[r,t]),v=w.useCallback(R=>{m({aggregations:R})},[m]),f=w.useCallback(R=>{m({showOnTop:R})},[m]),g=w.useCallback(()=>{If.debug("handleDragStart"),En.startDragging()},[]),p=w.useCallback(R=>{var{destination:A,source:M}=R;if(If.debug("handleDragEnd",A,M),En.stopDragging(),A!==null){var I=A.index;M.index<A.index&&(I+=1);var x=[...a],_=En.reorder(x,u,x,I),k=En.adjustDestinationIndex(I,u),U=[[k,k+_.length-1]];v(x),c(U)}},[v,a,u,c]),b=w.useCallback(R=>{d(R)},[d]),S=w.useCallback(()=>{v([...a,{operation:l,selected:[],invert:!0}])},[a,l,v]),C=w.useCallback(R=>{v(a.filter((A,M)=>M!==R))},[a,v]),y=w.useCallback(R=>{c(R)},[c]),E=w.useCallback(R=>{var A=a[R];Zi.isRollupOperation(A.operation)||i(A)},[a,i]),T=w.useCallback(R=>{f(R.target.value==="true")},[f]);w.useEffect(function(){s.length>0&&!s.includes(l)&&d(s[0])},[s,l]);var O=w.useCallback(R=>{var{item:A,itemIndex:M,isClone:I=!1,selectedCount:x}=R,_=A.operation,k=I?"".concat(x):void 0,U=I?"item-list-item-clone":void 0,G=Zi.isRollupOperation(A.operation),Y=!I&&!G;return h.jsxs(h.Fragment,{children:[h.jsxs("div",{className:X("item-list-item-content","draggable-item-list-item-content",U),children:[h.jsxs("span",{className:"title",children:[_,!e&&G&&h.jsxs("span",{className:"small text-warning",children:[h.jsx(ue,{icon:hh})," Requires rollup"]})]}),gn.renderBadge({text:k}),gn.renderHandle()]}),!I&&h.jsxs(h.Fragment,{children:[h.jsx(K,{kind:"ghost",className:"btn-edit",icon:Ls,tooltip:"Edit Columns",onClick:()=>i(A),disabled:!Y}),h.jsx(K,{kind:"ghost",className:"btn-delete",icon:Br,tooltip:"Delete Aggregation",onClick:()=>C(M)})]})]})},[C,i,e]),N=s.length>0,P=a.length>0;return h.jsxs("div",{className:"aggregations",children:[N&&h.jsxs("div",{className:"form-inline",children:[h.jsx(Gt,{onChange:b,value:l,children:s.map(R=>h.jsx(Xb,{value:R,children:R},R))}),h.jsxs("button",{type:"button",className:"btn btn-link btn-add",onClick:S,children:[h.jsx(ue,{icon:Aa}),"Add Aggregation"]})]}),N&&P&&h.jsx("hr",{}),P&&h.jsxs(h.Fragment,{children:[!e&&h.jsxs("div",{className:"form-inline",children:[h.jsx("label",{children:"Placement: "}),h.jsxs(Ad,{onChange:T,value:"".concat(o),children:[h.jsx(fi,{value:"true",children:"Top"}),h.jsx(fi,{value:"false",children:"Bottom"})]})]}),h.jsx(Sd,{onDragStart:g,onDragEnd:p,children:h.jsx(gn,{className:"selected-aggregations",itemCount:a.length,items:a,renderItem:O,offset:0,onSelectionChange:y,onSelect:E,selectedRanges:u,isMultiSelect:!0})})]})]})}function Ff(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function _i(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Ff(Object(t),!0).forEach(function(r){sA(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Ff(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function sA(n,e,t){return e=lA(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function lA(n){var e=dA(n,"string");return typeof e=="symbol"?e:String(e)}function dA(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var vn;(function(n){n[n.NONE=0]="NONE",n[n.ASCENDING=1]="ASCENDING",n[n.DESCENDING=2]="DESCENDING"})(vn||(vn={}));var uA=30;function hA(n){var{aggregation:e,columns:t,onChange:r}=n,[i,a]=w.useState(-1),[o,s]=w.useState(-1),[l,d]=w.useState(vn.NONE),{invert:u,selected:c}=e,m=w.useRef(null),v=w.useCallback(T=>c.includes(T)?!u:u,[u,c]),f=w.useMemo(()=>{var T=Ic(t,e.operation);return l!==vn.NONE&&(T=F.sortColumns(T,l===vn.ASCENDING)),T},[t,e.operation,l]),g=w.useMemo(()=>i>=0?f.slice(i,o+1).map(T=>({value:T.name,displayValue:T.name,isSelected:v(T.name)})):[],[f,v,o,i]),p=w.useCallback(T=>{var{name:O}=f[T],N=c.indexOf(O),P=[...c],R=u;N>=0?P.splice(N,1):(P.push(O),P.length===f.length&&(P=[],R=!u)),r(_i(_i({},e),{},{selected:P,invert:R}))},[e,u,f,c,r]),b=w.useCallback(()=>{d(vn.NONE),r(_i(_i({},e),{},{selected:[],invert:!0}))},[e,r]),S=w.useCallback((T,O)=>{a(T),s(O)},[a,s]),C=w.useCallback(()=>{c.length===0?r(_i(_i({},e),{},{invert:!u})):r(_i(_i({},e),{},{selected:[],invert:!0}))},[e,u,r,c]),y=c.length===0?u:null,E=c.length!==0||!u||l!==vn.NONE;return h.jsxs("div",{role:"menu",className:"aggregation-edit",children:[h.jsx("div",{className:"top-menu",children:h.jsxs("div",{className:"form-inline",children:[h.jsx(zn,{checked:y,onChange:C,children:"Toggle All"}),h.jsx("div",{className:"spacer"}),h.jsx(Sr,{in:E,timeout:et.transitionSlowMs,classNames:"fade",mountOnEnter:!0,unmountOnExit:!0,children:h.jsx(K,{kind:"ghost",className:"btn-reset",onClick:b,children:"Reset"})}),h.jsx(K,{kind:"ghost",className:X({active:l===vn.ASCENDING}),icon:Yh,tooltip:"Sort ascending",onClick:()=>d(vn.ASCENDING)}),h.jsx(K,{kind:"ghost",className:X({active:l===vn.DESCENDING}),icon:Xh,tooltip:"Sort descending",onClick:()=>d(vn.DESCENDING)})]})}),h.jsx("div",{className:"aggregation-edit-item-list",children:h.jsx(Qt,{itemCount:f.length,items:g,offset:i,renderItem:T=>{var{item:O}=T;return h.jsx(zn,{checked:v(O.value),children:O.displayValue})},onSelect:p,onViewportChange:S,rowHeight:uA,focusSelector:"input",ref:m})})]})}function _f(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function Mf(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?_f(Object(t),!0).forEach(function(r){cA(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):_f(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function cA(n,e,t){return e=mA(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function mA(n){var e=vA(n,"string");return typeof e=="symbol"?e:String(e)}function vA(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function fA(n){return h.jsx("svg",Mf(Mf({width:48,height:48,xmlns:"http://www.w3.org/2000/svg"},n),{},{children:h.jsxs("g",{fill:"none",fillRule:"evenodd",children:[h.jsx("path",{fill:"#C1C0C0",d:"M44 43v1H4v-1z"}),h.jsx("path",{fill:"#7DA4FF",d:"M8 26h4v15H8zM15 17h4v24h-4zM22 21h4v20h-4zM29 17h4v24h-4zM36 11h4v30h-4z"})]})}))}function xf(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function Af(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?xf(Object(t),!0).forEach(function(r){gA(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):xf(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function gA(n,e,t){return e=pA(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function pA(n){var e=bA(n,"string");return typeof e=="symbol"?e:String(e)}function bA(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function CA(n){return h.jsx("svg",Af(Af({width:48,height:48,xmlns:"http://www.w3.org/2000/svg"},n),{},{children:h.jsxs("g",{fill:"none",fillRule:"evenodd",children:[h.jsx("path",{fill:"#C1C0C0",d:"M44 43v1H4v-1z"}),h.jsx("path",{fill:"#7DA4FF",d:"M7 34h4v8H7zM12 31h4v11h-4zM17 27h4v15h-4zM22 22h4v20h-4zM27 27h4v15h-4zM32 29h4v13h-4zM37 31h4v11h-4z"})]})}))}function Lf(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function kf(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Lf(Object(t),!0).forEach(function(r){SA(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Lf(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function SA(n,e,t){return e=wA(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function wA(n){var e=yA(n,"string");return typeof e=="symbol"?e:String(e)}function yA(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function EA(n){return h.jsx("svg",kf(kf({width:48,height:48,xmlns:"http://www.w3.org/2000/svg"},n),{},{children:h.jsxs("g",{fill:"none",fillRule:"evenodd",children:[h.jsx("path",{fill:"#C1C0C0",d:"M4 4h1v40H4zM44 43v1H5v-1z"}),h.jsx("path",{stroke:"#7DA4FF",d:"M7.984 32.44l7.982-11.378 5.273 3.739 9.952-10.838 2.826 1.894 7.45-5.802"}),h.jsx("path",{stroke:"#BECDEF",d:"M8.244 37.926L17 33.496l5 .87 10.637-10.35 10.615-1.381"})]})}))}function jf(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function $f(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?jf(Object(t),!0).forEach(function(r){TA(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):jf(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function TA(n,e,t){return e=PA(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function PA(n){var e=OA(n,"string");return typeof e=="symbol"?e:String(e)}function OA(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function DA(n){return h.jsx("svg",$f($f({width:48,height:48,xmlns:"http://www.w3.org/2000/svg"},n),{},{children:h.jsxs("g",{fill:"none",fillRule:"evenodd",children:[h.jsx("path",{d:"M24 10c7.732 0 14 6.268 14 14s-6.268 14-14 14-14-6.268-14-14h14V10z",fill:"#80A6FF"}),h.jsx("path",{d:"M10 24c0-7.732 6.268-14 14-14v14H10z",fill:"#C1C0C0"})]})}))}function Hf(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function Bf(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Hf(Object(t),!0).forEach(function(r){NA(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Hf(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function NA(n,e,t){return e=RA(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function RA(n){var e=IA(n,"string");return typeof e=="symbol"?e:String(e)}function IA(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function FA(n){return h.jsx("svg",Bf(Bf({width:48,height:48,xmlns:"http://www.w3.org/2000/svg"},n),{},{children:h.jsxs("g",{fill:"none",fillRule:"evenodd",children:[h.jsx("path",{fill:"#C1C0C0",d:"M44 43v1H4v-1z"}),h.jsx("path",{fill:"#939293",d:"M44 34v1H4v-1zM44 25v1H4v-1zM44 16v1H4v-1z"}),h.jsx("circle",{fill:"#7DA4FF",cx:9.5,cy:37.5,r:1.5}),h.jsx("circle",{fill:"#7DA4FF",cx:16.5,cy:30.5,r:1.5}),h.jsx("circle",{fill:"#7DA4FF",cx:22.5,cy:36.5,r:1.5}),h.jsx("circle",{fill:"#7DA4FF",cx:28.5,cy:30.5,r:1.5}),h.jsx("circle",{fill:"#7DA4FF",cx:15.5,cy:38.5,r:1.5}),h.jsx("circle",{fill:"#7DA4FF",cx:23.5,cy:25.5,r:1.5}),h.jsx("circle",{fill:"#7DA4FF",cx:19.5,cy:19.5,r:1.5}),h.jsx("circle",{fill:"#7DA4FF",cx:29.5,cy:19.5,r:1.5}),h.jsx("circle",{fill:"#7DA4FF",cx:32.5,cy:26.5,r:1.5}),h.jsx("circle",{fill:"#7DA4FF",cx:36.5,cy:13.5,r:1.5})]})}))}function Uf(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function Vf(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Uf(Object(t),!0).forEach(function(r){_A(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Uf(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function _A(n,e,t){return e=MA(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function MA(n){var e=xA(n,"string");return typeof e=="symbol"?e:String(e)}function xA(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function AA(n){return h.jsxs("svg",Vf(Vf({width:"48",height:"48",viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg"},n),{},{children:[h.jsx("rect",{width:"48",height:"48",fill:"none"}),h.jsx("rect",{x:"26",y:"10",width:"15",height:"4",fill:"#9FDE70"}),h.jsx("rect",{x:"26",y:"22",width:"15",height:"4",fill:"#9FDE70"}),h.jsx("rect",{x:"26",y:"28",width:"15",height:"4",fill:"#FFD95C"}),h.jsx("rect",{x:"26",y:"34",width:"15",height:"4",fill:"#9FDE70"})]}))}function Gf(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function Wf(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Gf(Object(t),!0).forEach(function(r){LA(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Gf(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function LA(n,e,t){return e=kA(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function kA(n){var e=jA(n,"string");return typeof e=="symbol"?e:String(e)}function jA(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function $A(n){return h.jsxs("svg",Wf(Wf({width:"48",height:"48",viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg"},n),{},{children:[h.jsx("rect",{width:"48",height:"48",fill:"none"}),h.jsx("rect",{x:"4",y:"16",width:"40",height:"4",fill:"#FFD95C"}),h.jsx("rect",{x:"4",y:"10",width:"40",height:"4",fill:"#78DCE8"}),h.jsx("rect",{x:"4",y:"34",width:"40",height:"4",fill:"#78DCE8"})]}))}var zf=ie.module("ChartBuilder");class fn extends w.PureComponent{static getMaxSeriesCount(e,t){switch(t){case e.plot.SeriesPlotStyle.PIE:return 1;case e.plot.SeriesPlotStyle.HISTOGRAM:return 0;default:return 100}}static makeSeriesItem(e){return{id:qe.generate(),value:e}}static makeDefaultSeriesItems(e,t,r){var i=fn.getMaxSeriesCount(e,t);if(i===0||r==null||r.length===0)return[];var a=r.length>1?r[1].name:r[0].name;return[fn.makeSeriesItem(a)]}static getDefaultXAxis(e,t){return t!=null&&t.length>0?t[0].name:null}constructor(e){super(e),this.handleAddSeries=this.handleAddSeries.bind(this),this.handleLinkStateChange=this.handleLinkStateChange.bind(this),this.handleReset=this.handleReset.bind(this),this.handleSeriesChange=this.handleSeriesChange.bind(this),this.handleSeriesDeleteClick=this.handleSeriesDeleteClick.bind(this),this.handleSubmit=this.handleSubmit.bind(this),this.handleTypeClick=this.handleTypeClick.bind(this),this.handleXAxisChange=this.handleXAxisChange.bind(this),this.sendChange=this.sendChange.bind(this);var{model:t}=e,{columns:r,dh:i}=t,a=this.getTypes()[0],o=fn.getDefaultXAxis(a,r),s=fn.makeDefaultSeriesItems(i,a,r);this.state={type:a,seriesItems:s,xAxis:o,isLinked:!0}}getTypes(){var{model:e}=this.props,{dh:t}=e;return[t.plot.SeriesPlotStyle.LINE,t.plot.SeriesPlotStyle.BAR,t.plot.SeriesPlotStyle.SCATTER,t.plot.SeriesPlotStyle.PIE]}getTypeName(e){var{model:t}=this.props,{dh:r}=t;switch(e){case r.plot.SeriesPlotStyle.LINE:return"Line";case r.plot.SeriesPlotStyle.BAR:return"Bar";case r.plot.SeriesPlotStyle.SCATTER:return"Scatter";case r.plot.SeriesPlotStyle.PIE:return"Pie";case r.plot.SeriesPlotStyle.HISTOGRAM:return"Histogram";default:return e}}getTypeIcon(e){var{model:t}=this.props,{dh:r}=t;switch(e){case r.plot.SeriesPlotStyle.LINE:return h.jsx(EA,{});case r.plot.SeriesPlotStyle.BAR:return h.jsx(fA,{});case r.plot.SeriesPlotStyle.SCATTER:return h.jsx(FA,{});case r.plot.SeriesPlotStyle.PIE:return h.jsx(DA,{});case r.plot.SeriesPlotStyle.HISTOGRAM:return h.jsx(CA,{});default:return null}}getXAxisLabel(e){var{model:t}=this.props,{dh:r}=t;switch(e){case r.plot.SeriesPlotStyle.PIE:return"Labels";case r.plot.SeriesPlotStyle.HISTOGRAM:return"Data";default:return"X-Axis"}}getSeriesLabel(e){var{model:t}=this.props,{dh:r}=t;switch(e){case r.plot.SeriesPlotStyle.PIE:return"Values";default:return"Series"}}handleAddSeries(){this.setState(e=>{var{seriesItems:t}=e,r=[...t],{model:i}=this.props,{columns:a}=i;return r.push({id:qe.generate(),value:a[0].name}),{seriesItems:r}},this.sendChange)}handleLinkStateChange(e){this.setState({isLinked:e.target.value==="true"},this.sendChange)}handleReset(){var{model:e}=this.props,{columns:t,dh:r}=e,i=this.getTypes()[0],a=fn.getDefaultXAxis(i,t),o=fn.makeDefaultSeriesItems(r,i,t),s=!0;this.setState({type:i,seriesItems:o,xAxis:a,isLinked:s},this.sendChange)}handleSeriesChange(e,t){var r=e;this.setState(i=>{var{seriesItems:a}=i;return a=[...a],a[t].value=r,{seriesItems:a}},this.sendChange)}handleSeriesDeleteClick(e){this.setState(t=>{var{seriesItems:r}=t,i=[...r];return i.splice(e,1),{seriesItems:i}},this.sendChange)}handleSubmit(e){e.preventDefault();var{onSubmit:t}=this.props,{type:r,seriesItems:i,xAxis:a,isLinked:o}=this.state,s=i.map(l=>l.value);t({type:r,series:s,xAxis:a,isLinked:o})}handleTypeClick(e){var t=this.getTypes()[e];zf.debug2("handleTypeSelect",t),this.setState(r=>{var{model:i}=this.props,{dh:a}=i,o=fn.getMaxSeriesCount(a,t),{seriesItems:s}=r;if(s=s.slice(0,o),s.length===0&&o>0){var{columns:l}=i;s=fn.makeDefaultSeriesItems(a,t,l)}return{type:t,seriesItems:s}},this.sendChange)}handleXAxisChange(e){var t=e;zf.debug2("x-axis change",t),this.setState({xAxis:t},this.sendChange)}sendChange(){var{onChange:e}=this.props,{isLinked:t,type:r,seriesItems:i,xAxis:a}=this.state,o=i.map(s=>s.value);e({type:r,series:o,xAxis:a,isLinked:t})}render(){var{model:e}=this.props,{columns:t,dh:r}=e,{seriesItems:i,type:a,xAxis:o,isLinked:s}=this.state,l=fn.getMaxSeriesCount(r,a),d=this.getXAxisLabel(a),u=this.getSeriesLabel(a),c=i.length>0,m=i.length<l;return h.jsx("div",{className:"chart-builder",children:h.jsxs("form",{onSubmit:this.handleSubmit,children:[h.jsxs("div",{className:"form-row",children:[h.jsx("label",{children:"Select Chart Type"}),h.jsx("div",{className:"form-row",children:this.getTypes().map((v,f)=>{var g=v;return h.jsx("div",{className:"col col-chart-type",children:h.jsxs("button",{type:"button",className:X("btn","btn-icon","btn-chart-type",{active:v===a}),onClick:()=>this.handleTypeClick(f),children:[this.getTypeIcon(v),this.getTypeName(v)]})},g)})})]}),h.jsx("hr",{}),h.jsxs("div",{className:"form-row form-inline",children:[h.jsx("label",{className:"col-2 label-left",children:d}),h.jsx(Gt,{className:"form-control select-x-axis col",value:o,onChange:this.handleXAxisChange,children:t.map(v=>h.jsx("option",{value:v.name,children:v.name},v.name))})]}),c&&h.jsx("hr",{}),i.map((v,f)=>h.jsxs("div",{className:"form-row form-inline form-series-item","data-testid":"form-series-item-".concat(f),children:[h.jsx("label",{className:"col-2 label-left",children:f===0?u:""}),h.jsx(Gt,{className:"form-control select-series col",value:v.value,onChange:g=>this.handleSeriesChange(g,f),"data-testid":"select-series-item-".concat(f),children:t.map(g=>h.jsx("option",{value:g.name,children:g.name},g.name))}),i.length>1&&h.jsx(K,{kind:"ghost",className:"btn-delete-series ml-2 px-2","data-testid":"delete-series-".concat(f),onClick:()=>{this.handleSeriesDeleteClick(f)},icon:Br,tooltip:"Delete"})]},v.id)),m&&h.jsxs("div",{className:"form-row",children:[h.jsx("div",{className:"col-2"}),h.jsx(K,{kind:"ghost",className:"btn-add-series mt-1",onClick:this.handleAddSeries,icon:Aa,children:"Add Series"})]}),h.jsxs("div",{className:"form-row chart-builder-link",children:[h.jsx("label",{className:"col-2 label-right",children:h.jsxs("div",{className:"fa-md fa-layers",children:[h.jsx(ue,{mask:Od,icon:Co,transform:"right-5 down-5"}),h.jsx(ue,{icon:s?Eb:r0,transform:"grow-2 right-8 down-6"})]})}),h.jsxs(Ad,{onChange:this.handleLinkStateChange,value:"".concat(s),children:[h.jsx(fi,{value:"true",children:"Sync State"}),h.jsx(fi,{value:"false",children:"Freeze State"})]})]}),h.jsxs("div",{className:"form-row",children:[h.jsx("div",{className:"col-2 label-right"}),h.jsx("div",{className:"col chart-builder-link-info",children:s?"Charts with synced state will update to match any filters or user modifications applied to the parent table.":"Freeze State disconnects the chart state from the parent table. New filters or user modifications on the parent table will not be applied."})]}),h.jsxs("div",{className:X("form-row","justify-content-end","my-3"),children:[h.jsx(K,{kind:"secondary",className:"btn-reset",onClick:this.handleReset,children:"Reset"}),h.jsx(K,{kind:"primary",type:"submit",className:"btn-submit",children:"Create"})]})]})})}}const HA=fn;function Kf(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function BA(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Kf(Object(t),!0).forEach(function(r){od(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Kf(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function od(n,e,t){return e=UA(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function UA(n){var e=VA(n,"string");return typeof e=="symbol"?e:String(e)}function VA(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class dS extends w.Component{constructor(e){super(e),od(this,"editorContainer",void 0),od(this,"editor",void 0),this.handleContentChanged=this.handleContentChanged.bind(this),this.handleEditorFocus=this.handleEditorFocus.bind(this),this.handleEditorBlur=this.handleEditorBlur.bind(this),this.handleContainerClick=this.handleContainerClick.bind(this),this.handleKeyDown=this.handleKeyDown.bind(this),this.state={isEditorFocused:!1,isEditorEmpty:!0},this.editorContainer=null}componentDidMount(){this.initEditor()}componentWillUnmount(){this.destroyEditor()}initEditor(){var e,{value:t,editorSettings:r}=this.props,i=BA({copyWithSyntaxHighlighting:"false",fixedOverflowWidgets:!0,folding:!1,fontFamily:"Fira Mono",glyphMargin:!1,language:"groovyDB",lineDecorationsWidth:8,lineNumbers:"off",minimap:{enabled:!1},renderLineHighlight:"none",scrollbar:{arrowSize:0,horizontal:"hidden",horizontalScrollbarSize:0},scrollBeyondLastLine:!1,padding:{top:6,bottom:6},tabCompletion:"off",useTabStops:!0,value:t,wordWrap:"on",automaticLayout:!0},r);if(!this.editorContainer)throw new Error("editorContainer is null");this.editor=rn.create(this.editorContainer,i),this.editor.layout(),(e=this.editor.getModel())===null||e===void 0||e.updateOptions({tabSize:0}),this.editor.onKeyDown(this.handleKeyDown),this.editor.onDidChangeModelContent(this.handleContentChanged),this.editor.onDidFocusEditorText(this.handleEditorFocus),this.editor.onDidBlurEditorText(this.handleEditorBlur)}destroyEditor(){var e;(e=this.editor)===null||e===void 0||e.dispose(),this.editor=void 0}handleContentChanged(){var e,t,{onContentChanged:r}=this.props,i=(e=this.editor)===null||e===void 0||(t=e.getModel())===null||t===void 0?void 0:t.getValue();i!==void 0&&this.setState({isEditorEmpty:i.length===0}),r(i)}handleEditorFocus(){this.setState({isEditorFocused:!0})}handleEditorBlur(){var e,t,r,i=(e=(t=this.editor)===null||t===void 0||(r=t.getModel())===null||r===void 0?void 0:r.getValue())!==null&&e!==void 0?e:"";this.setState({isEditorEmpty:i.length===0,isEditorFocused:!1})}handleContainerClick(){var e,{isEditorFocused:t}=this.state;t||(e=this.editor)===null||e===void 0||e.focus()}handleKeyDown(e){var{onTab:t,editorIndex:r}=this.props;e.code==="Tab"&&(e.stopPropagation(),e.preventDefault(),t(r,e.shiftKey))}render(){var{className:e,invalid:t,placeholder:r="",value:i}=this.props,{isEditorFocused:a,isEditorEmpty:o}=this.state;return h.jsxs("div",{className:X("input-editor-wrapper",{focused:a,invalid:t},e),role:"presentation",onClick:this.handleContainerClick,children:[h.jsx("div",{className:"editor-container",ref:s=>{this.editorContainer=s},"data-testid":"custom-column-formula"}),o&&!i&&r.length>0&&h.jsx("div",{className:"editor-placeholder text-muted",children:r})]})}}od(dS,"defaultProps",{value:"",onContentChanged:()=>{},editorSettings:{},editorIndex:0,onTab:()=>{},invalid:!1});function qf(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function Sl(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?qf(Object(t),!0).forEach(function(r){GA(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):qf(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function GA(n,e,t){return e=WA(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function WA(n){var e=zA(n,"string");return typeof e=="symbol"?e:String(e)}function zA(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var Yf=Object.freeze({NAME:"name",FORMULA:"formula"}),KA=()=>{};function qA(n){var{eventKey:e,name:t,inputIndex:r,formula:i,onChange:a,onDeleteColumn:o,onTabInEditor:s,invalid:l,isDuplicate:d}=n,u=t===""||ks.isValidColumnName(t),c=w.useCallback(m=>{m!==void 0&&(m.replace(/(\r\n|\n|\r)/gm,""),a(e,Yf.FORMULA,m))},[a,e]);return h.jsx(Uh,{draggableId:e,index:r,disableInteractiveElementBlocking:!0,children:(m,v)=>h.jsxs("div",Sl(Sl({className:X("draggable-container",{dragging:v.isDragging}),ref:m.innerRef},m.draggableProps),{},{children:[h.jsxs("div",{className:"custom-column-input-container",children:[h.jsxs("div",{className:"pb-3",children:[h.jsxs("div",{className:"d-flex flex-row custom-column-name",children:[h.jsx("input",{className:X("form-control custom-column-input",{"is-invalid":l||!u||d}),placeholder:"Column Name",value:t,onChange:f=>{a(e,Yf.NAME,f.target.value)}}),h.jsx(K,{kind:"ghost",className:"ml-1 px-2",onClick:()=>{o(e)},icon:Br,tooltip:"Delete custom column"}),h.jsx(K,Sl(Sl({kind:"ghost",className:"btn-drag-handle",onClick:KA},m.dragHandleProps),{},{icon:xs,tooltip:"Drag column to re-order"}))]}),(!u||d)&&h.jsx("p",{className:"validate-label-error text-danger mb-0 mt-2 pl-1",children:u?"Duplicate name":"Invalid name"})]}),h.jsx(dS,{editorSettings:{language:"deephavenDb"},editorIndex:r,placeholder:"Column Formula",value:i,onContentChanged:c,onTab:s,invalid:l})]}),h.jsx("hr",{})]}))})}function Fh(n,e,t){return e=YA(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function YA(n){var e=XA(n,"string");return typeof e=="symbol"?e:String(e)}function XA(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var fa=[];class uS extends qF{constructor(e){super(),Fh(this,"dh",void 0),Fh(this,"listenerCount",void 0),this.dh=e,this.listenerCount=0}addEventListener(e,t,r){super.addEventListener(e,t,r),this.listenerCount+=1,this.listenerCount===1&&this.startListening()}removeEventListener(e,t,r){super.removeEventListener(e,t,r),this.listenerCount-=1,this.listenerCount===0&&this.stopListening()}startListening(){}stopListening(){}get groupedColumns(){return fa}get originalColumns(){return this.columns}sourceForCell(e,t){return{column:e,row:t}}getClearFilterRange(e){return this.isFilterable(e)?[e,e]:null}get initialMovedColumns(){return fa}get initialMovedRows(){return fa}get initialColumnHeaderGroups(){return fa}get layoutHints(){return null}get frontColumns(){return fa}get backColumns(){return fa}get frozenColumns(){return fa}isColumnFrozen(e){return!1}isColumnSortable(e){return!1}get isFilterRequired(){return!1}get isReversible(){return!0}get isColumnStatisticsAvailable(){return!1}get description(){return""}get isCustomColumnsAvailable(){return!1}get isFormatColumnsAvailable(){return!1}get isExportAvailable(){return!1}get isValuesTableAvailable(){return!1}get isChartBuilderAvailable(){return!1}get isRollupAvailable(){return!1}get isSelectDistinctAvailable(){return!1}get isTotalsAvailable(){return!1}isFilterable(e){return!1}close(){}isRowMovable(){return!1}get isSeekRowAvailable(){return!1}dataBarOptionsForCell(e,t,r){throw new Error("Method not implemented.")}}Fh(uS,"EVENT",Object.freeze({UPDATED:"UPDATED",FORMATTER_UPDATED:"FORMATTER_UPDATED",REQUEST_FAILED:"REQUEST_FAILED",COLUMNS_CHANGED:"COLUMNS_CHANGED",TABLE_CHANGED:"TABLE_CHANGED",FILTERS_CHANGED:"FILTERS_CHANGED",SORTS_CHANGED:"SORTS_CHANGED",DISCONNECT:"DISCONNECT",RECONNECT:"RECONNECT",TOTALS_UPDATED:"TOTALS_UPDATED",PENDING_DATA_UPDATED:"PENDING_DATA_UPDATED"}));const we=uS;function Xf(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function qu(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Xf(Object(t),!0).forEach(function(r){co(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Xf(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function co(n,e,t){return e=QA(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function QA(n){var e=ZA(n,"string");return typeof e=="symbol"?e:String(e)}function ZA(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class qi extends w.Component{static makeCustomColumnInputEventKey(){return qe.generate()}static createCustomColumnInput(){return{eventKey:qe.generate(),name:"",formula:""}}constructor(e){super(e),co(this,"container",void 0),co(this,"successButtonTimer",void 0),co(this,"getInput",be((t,r)=>t.find(i=>i.eventKey===r))),co(this,"getInputIndex",be((t,r)=>t.findIndex(i=>i.eventKey===r))),this.handleAddColumnClick=this.handleAddColumnClick.bind(this),this.handleSaveClick=this.handleSaveClick.bind(this),this.handleInputChange=this.handleInputChange.bind(this),this.handleDeleteColumn=this.handleDeleteColumn.bind(this),this.handleCustomColumnUpdated=this.handleCustomColumnUpdated.bind(this),this.handleRequestFailed=this.handleRequestFailed.bind(this),this.handleDragEnd=this.handleDragEnd.bind(this),this.resetRequestFailed=this.resetRequestFailed.bind(this),this.handleEditorTabNavigation=this.handleEditorTabNavigation.bind(this),this.state={inputs:[],isCustomColumnApplying:!1,errorMessage:null,hasRequestFailed:!1,isSuccessShowing:!1},this.container=null,this.successButtonTimer=null}componentDidMount(){var{customColumns:e}=this.props;this.parseCustomColumns(e),this.startListening()}componentWillUnmount(){this.stopListening(),this.successButtonTimer&&clearTimeout(this.successButtonTimer)}resetErrorMessage(){this.setState({errorMessage:null})}startListening(){var{model:e}=this.props;e.addEventListener(we.EVENT.COLUMNS_CHANGED,this.handleCustomColumnUpdated),e.addEventListener(we.EVENT.UPDATED,this.handleCustomColumnUpdated),e.addEventListener(we.EVENT.REQUEST_FAILED,this.handleRequestFailed)}stopListening(){var{model:e}=this.props;e.removeEventListener(we.EVENT.COLUMNS_CHANGED,this.handleCustomColumnUpdated),e.removeEventListener(we.EVENT.UPDATED,this.handleCustomColumnUpdated),e.removeEventListener(we.EVENT.REQUEST_FAILED,this.handleRequestFailed)}parseCustomColumns(e){if(e.length>0){var t=e.map(r=>{var i=r.split(/=(.+)/,2);return{eventKey:qi.makeCustomColumnInputEventKey(),name:i[0],formula:i[1]}});this.setState({inputs:t})}else this.setState({inputs:[qi.createCustomColumnInput()]})}handleAddColumnClick(){var{inputs:e}=this.state,t=[...e];t.push(qi.createCustomColumnInput()),this.setState({inputs:t})}handleDeleteColumn(e){var{inputs:t}=this.state,r=this.getInputIndex(t,e),i=[...t];i.splice(r,1),i.length===0&&i.push(qi.createCustomColumnInput()),this.setState({inputs:i})}handleInputChange(e,t,r){var{inputs:i}=this.state,a=this.getInputIndex(i,e),o=this.getInput(i,e),s=qu({},o);s[t]=r;var l=[...i];l.splice(a,1,s),this.setState({inputs:l})}handleCustomColumnUpdated(){var{isCustomColumnApplying:e}=this.state;e&&this.setState({isCustomColumnApplying:!1,isSuccessShowing:!0},()=>{this.successButtonTimer=setTimeout(()=>this.setState({isSuccessShowing:!1}),qi.SUCCESS_SHOW_DURATION)})}handleRequestFailed(e){var t=e,{isCustomColumnApplying:r}=this.state;r&&this.setState({isCustomColumnApplying:!1,errorMessage:h.jsxs(h.Fragment,{children:[h.jsxs("p",{children:[h.jsx(ue,{icon:ta})," Failed to apply custom columns."]}),h.jsxs("div",{className:"error-box",children:[t.detail.errorMessage,h.jsx("br",{}),"Table configuration:"," ",JSON.stringify(t.detail.configuration)]})]}),hasRequestFailed:!0})}handleDragEnd(e){if(En.stopDragging(),!!e.destination){var{inputs:t}=this.state,r=e.source.index,i=e.destination.index,a=[...t],o=t[r];a.splice(r,1),a.splice(i,0,o),this.setState({inputs:a})}}handleEditorTabNavigation(e,t){var{inputs:r}=this.state;if(t){var i;((i=this.container)===null||i===void 0?void 0:i.querySelectorAll(".btn-drag-handle")[e]).focus();return}if(e===r.length-1){var a,o;(a=this.container)===null||a===void 0||(o=a.querySelector(".btn-add-column"))===null||o===void 0||o.focus()}else{var s,l=e+1;((s=this.container)===null||s===void 0?void 0:s.querySelectorAll(".custom-column-input")[l]).focus()}}handleSaveClick(){var{onSave:e,customColumns:t}=this.props,{inputs:r,isCustomColumnApplying:i}=this.state;if(!i){var a=[];r.forEach(o=>{var{name:s,formula:l}=o;s&&l&&a.push("".concat(s,"=").concat(l))}),this.resetErrorMessage(),this.setState({isCustomColumnApplying:a.length>0||t.length>0}),e(a)}}resetRequestFailed(){this.setState(e=>{var{hasRequestFailed:t}=e;return t?{hasRequestFailed:!1}:null})}renderInputs(){var{inputs:e,hasRequestFailed:t}=this.state,r=new Map;return e.forEach(i=>{var a,{name:o}=i;return r.set(o,((a=r.get(o))!==null&&a!==void 0?a:0)+1)}),e.map((i,a)=>{var o,{eventKey:s,name:l,formula:d}=i,u=((o=r.get(l))!==null&&o!==void 0?o:0)>1;return h.jsx(qA,{inputIndex:a,eventKey:s,name:l,formula:d,onChange:this.handleInputChange,onDeleteColumn:this.handleDeleteColumn,onTabInEditor:this.handleEditorTabNavigation,invalid:t,isDuplicate:u},s)})}renderSaveButton(){var{inputs:e,isCustomColumnApplying:t,isSuccessShowing:r}=this.state,i=e.length>1?"Save Columns":"Save Column",a=e.every(l=>{var{name:d}=l;return d===""||ks.isValidColumnName(d)}),o=e.filter(l=>{var{name:d}=l;return d!==""}).map(l=>{var{name:d}=l;return d}),s=new Set(o).size===o.length;return h.jsxs(K,{kind:r?"success":"primary",className:X("btn-apply",{"btn-spinner":t}),disabled:r||t||!a||!s,onClick:this.handleSaveClick,icon:r?zh:void 0,children:[t&&h.jsxs("span",{children:[h.jsx(ia,{className:"mr-2 loading-spinner-vertical-align"}),h.jsx("span",{className:"btn-normal-content",children:"Applying"})]}),!r&&!t&&i,r&&"Success"]})}render(){var{onCancel:e}=this.props,{errorMessage:t}=this.state;return h.jsxs("div",{role:"presentation",className:"custom-column-builder-container",ref:r=>{this.container=r},onClick:this.resetRequestFailed,onFocus:this.resetRequestFailed,children:[h.jsx("hr",{}),h.jsx(Sd,{onDragStart:En.startDragging,onDragEnd:this.handleDragEnd,children:h.jsx(Cd,{droppableId:"droppable-custom-columns",children:(r,i)=>h.jsxs("div",qu(qu({ref:r.innerRef},r.droppableProps),{},{className:X("droppable-container",{dragging:i.draggingFromThisWith}),children:[this.renderInputs(),r.placeholder]}))})}),h.jsx("div",{className:"pt-1 px-3",children:h.jsx(K,{kind:"ghost",className:"btn-add-column",onClick:this.handleAddColumnClick,icon:Aa,children:"Add Another Column"})}),h.jsxs("div",{className:"custom-column-builder-footer",children:[t&&h.jsx("div",{className:"error-message",children:t}),h.jsxs("div",{className:"d-flex justify-content-end",children:[h.jsx(K,{kind:"secondary",className:"mr-2",onClick:e,children:"Cancel"}),this.renderSaveButton()]})]})]})}}co(qi,"SUCCESS_SHOW_DURATION",750);const JA=qi;var _h;(function(n){n.ADVANCED_SETTINGS="ADVANCED_SETTINGS",n.AGGREGATIONS="AGGREGATIONS",n.AGGREGATION_EDIT="AGGREGATIONS_EDIT",n.CHART_BUILDER="CHART_BUILDER",n.CUSTOM_COLUMN_BUILDER="CUSTOM_COLUMN_BUILDER",n.QUICK_FILTERS="QUICK_FILTERS",n.ROLLUP_ROWS="ROLLUP_ROWS",n.SEARCH_BAR="SEARCH_BAR",n.SELECT_DISTINCT="SELECT_DISTINCT",n.TABLE_EXPORTER="TABLE_EXPORTER",n.VISIBILITY_ORDERING_BUILDER="VISIBILITY_ORDERING_BUILDER",n.CONDITIONAL_FORMATTING="CONDITIONAL_FORMATTING",n.CONDITIONAL_FORMATTING_EDIT="CONDITIONAL_FORMATTING_EDIT",n.GOTO="GOTO"})(_h||(_h={}));const xe=_h;function Qf(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function Zf(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Qf(Object(t),!0).forEach(function(r){Yi(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Qf(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function Yi(n,e,t){return e=eL(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function eL(n){var e=tL(n,"string");return typeof e=="symbol"?e:String(e)}function tL(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var es=ie.module("RollupRows"),rL=150,wl="grouped-rollup-rows",yl="ungrouped-rollup-rows";class pr extends w.Component{static renderColumn(e){var{item:t,isClone:r,selectedCount:i}=e,a=t==null?void 0:t.name,o=r!==void 0&&r?"".concat(i):void 0,s=r!==void 0&&r?"item-list-item-clone":"";return gn.renderTextItem({text:a,badgeText:o,className:s})}static addGroupings(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e.length;if(t==null||t.length===0)return e;var i=r,a=e.filter((o,s)=>t.includes(o)?(s<i&&(i-=1),!1):!0);return a.splice(i,0,...t),a}static isGroupable(e){return!F.isDecimalType(e.type)}constructor(e){super(e),Yi(this,"ungroupedList",void 0),Yi(this,"groupedList",void 0),Yi(this,"search",wt(o=>{for(var s=this.getSortedUngroupedColumns(),l=[],d=null,u=0;u<s.length;u+=1){var c=s[u];c.name.toLowerCase().includes(o.toLowerCase())&&(d==null&&(d=u),l.push([u,u]))}j(d),this.setState({ungroupedSelectedRanges:l}),l.length>0&&this.ungroupedList.current&&this.ungroupedList.current.scrollToItem(d)},rL)),Yi(this,"getCachedUngroupedColumns",Se((o,s)=>o.filter(l=>pr.isGroupable(l)&&s.find(d=>d===l.name)==null))),Yi(this,"getCachedSortedColumns",Se((o,s)=>s==null?[...o]:F.sortColumns(o,s===pr.SORT.ASCENDING))),this.handleDeleteClicked=this.handleDeleteClicked.bind(this),this.handleSearchChange=this.handleSearchChange.bind(this),this.handleUngroupedSelect=this.handleUngroupedSelect.bind(this),this.handleUngroupedSelectionChange=this.handleUngroupedSelectionChange.bind(this),this.handleDragStart=this.handleDragStart.bind(this),this.handleDragEnd=this.handleDragEnd.bind(this),this.handleGroupedSelectionChange=this.handleGroupedSelectionChange.bind(this),this.handleShowConstituentsChange=this.handleShowConstituentsChange.bind(this),this.handleShowNonAggregatedColumnsChange=this.handleShowNonAggregatedColumnsChange.bind(this),this.handleSortAscending=this.handleSortAscending.bind(this),this.handleSortDescending=this.handleSortDescending.bind(this),this.renderGroupedItem=this.renderGroupedItem.bind(this),this.ungroupedList=oe.createRef(),this.groupedList=oe.createRef();var{config:t}=e,{columns:r=[],showConstituents:i=!0,showNonAggregatedColumns:a=!0}=t??{};this.state={ungroupedSelectedRanges:[],columns:r,groupedSelectedRanges:[],searchFilter:"",showConstituents:i,showNonAggregatedColumns:a,dragSource:null,sort:null}}componentDidUpdate(e,t){var{config:r}=this.props,{columns:i,showConstituents:a,showNonAggregatedColumns:o}=this.state;r!==e.config?this.updateFromConfig():(i!==t.columns||a!==t.showConstituents||o!==t.showNonAggregatedColumns)&&(r==null||i!==r.columns||a!==r.showConstituents||o!==r.showNonAggregatedColumns)&&this.sendChange()}componentWillUnmount(){this.search.cancel()}handleSearchChange(e){var t=e.target.value;if(this.setState({searchFilter:t}),!t){this.search.cancel(),this.resetSelection();return}this.search(t)}handleSortAscending(){this.setState(e=>{var{sort:t}=e;return{sort:t===pr.SORT.ASCENDING?null:pr.SORT.ASCENDING}})}handleSortDescending(){this.setState(e=>{var{sort:t}=e;return{sort:t===pr.SORT.DESCENDING?null:pr.SORT.DESCENDING}})}resetSelection(){this.setState({ungroupedSelectedRanges:[],groupedSelectedRanges:[]})}handleDragStart(e){es.debug("handleDragStart",e),document.documentElement.classList.add("drag-pointer-events-none"),this.setState({dragSource:e.source})}handleDragEnd(e){es.debug("handleDragEnd",e),document.documentElement.classList.remove("drag-pointer-events-none"),this.setState({dragSource:null});var{destination:t,source:r}=e;if(!(t==null||r==null)){if(t.droppableId===yl){this.setState(o=>{var{groupedSelectedRanges:s,columns:l}=o,d=[...l];return En.reorder(d,s,[],0),{columns:d,ungroupedSelectedRanges:[],groupedSelectedRanges:[]}});return}var i=r.droppableId===wl,a=t.index;i&&r.index<t.index&&(a+=1),this.setState(o=>{var{columns:s,ungroupedSelectedRanges:l,groupedSelectedRanges:d}=o,u=[...s],c=i?u:this.getSortedUngroupedColumns().map(p=>p.name),m=i?d:l,v=En.reorder(c,m,u,a),f=i?En.adjustDestinationIndex(a,d):a,g=[[f,f+v.length-1]];return{columns:u,ungroupedSelectedRanges:[],groupedSelectedRanges:g}}),this.resetSelection()}}handleUngroupedSelect(e){es.debug("handleUngroupedSelect"),this.setState(t=>{var{columns:r}=t;return{columns:pr.addGroupings(r,[this.getSortedUngroupedColumns()[e].name]),ungroupedSelectedRanges:[],groupedSelectedRanges:[]}})}handleUngroupedSelectionChange(e){es.debug2("handleUngroupedSelectionChange",e),this.setState(t=>{var{ungroupedSelectedRanges:r}=t;return e===r?null:{ungroupedSelectedRanges:e,groupedSelectedRanges:[]}})}handleGroupedSelectionChange(e){es.debug2("handleGroupedSelectedRanges",e),this.setState(t=>{var{groupedSelectedRanges:r}=t;return e===r?null:{groupedSelectedRanges:e,ungroupedSelectedRanges:[]}})}handleDeleteClicked(e){this.setState(t=>{var{columns:r}=t,i=r.slice();return i.splice(e,1),{columns:i}})}handleShowConstituentsChange(){this.setState(e=>{var{showConstituents:t}=e;return{showConstituents:!t}})}handleShowNonAggregatedColumnsChange(){this.setState(e=>{var{showNonAggregatedColumns:t}=e;return{showNonAggregatedColumns:!t}})}updateFromConfig(){var{config:e}=this.props,{columns:t=[],showConstituents:r=!0,showNonAggregatedColumns:i=!0}=e??{};this.setState({columns:t,showConstituents:r,showNonAggregatedColumns:i})}sendChange(){var{onChange:e}=this.props,{columns:t,showConstituents:r,showNonAggregatedColumns:i}=this.state;e({columns:t,showConstituents:r,showNonAggregatedColumns:i})}getUngroupedColumns(){var{model:e}=this.props,{columns:t}=this.state,{originalColumns:r}=e;return this.getCachedUngroupedColumns(r,t)}getSortedUngroupedColumns(){var{sort:e}=this.state,t=this.getUngroupedColumns();return this.getCachedSortedColumns(t,e)}renderGroupedItem(e){var{item:t,itemIndex:r,isClone:i,selectedCount:a}=e,o=i!==void 0&&i?"":" ".repeat(r),s="".concat(o).concat(t),l=i!==void 0&&i?"".concat(a):void 0,d=i!==void 0&&i?"item-list-item-clone":"";return h.jsxs(h.Fragment,{children:[gn.renderTextItem({text:s,badgeText:l,className:d}),(i===void 0||!i)&&h.jsx(K,{kind:"ghost",className:"btn btn-link btn-link-icon btn-delete-grouping float-right",onClick:()=>this.handleDeleteClicked(r),children:h.jsx(ue,{icon:Br})})]})}render(){var{columns:e,dragSource:t,searchFilter:r,groupedSelectedRanges:i,ungroupedSelectedRanges:a,showConstituents:o,showNonAggregatedColumns:s,sort:l}=this.state,d=this.getSortedUngroupedColumns(),u=e.length*gn.DEFAULT_ROW_HEIGHT;(t==null?void 0:t.droppableId)===yl&&(u+=gn.DEFAULT_ROW_HEIGHT);var c=d.length*gn.DEFAULT_ROW_HEIGHT+10,m=Math.min(3*gn.DEFAULT_ROW_HEIGHT,c);return h.jsx("div",{role:"menu",className:X("rollup-rows",{"is-dragging":t!=null}),tabIndex:0,children:h.jsxs(Sd,{onDragEnd:this.handleDragEnd,onDragStart:this.handleDragStart,children:[h.jsxs("div",{className:"rollup-rows-group-by",children:[h.jsx("div",{className:"section-title",children:"Group By"}),e.length===0&&h.jsx(Cd,{droppableId:"placeholder",children:(v,f)=>h.jsx("div",Zf(Zf({className:X("placeholder","text-muted",{"is-dragging-from-this":f.draggingFromThisWith,"is-dragging-over":f.isDraggingOver,"is-dropping":f.draggingOverWith}),ref:v.innerRef},v.droppableProps),{},{children:"To create a rollup, drag columns from the list below and drop them into this area."}))}),e.length>0&&h.jsx(gn,{draggingItemClassName:"rollup-rows-dragging-grouped-item",draggablePrefix:wl,droppableId:wl,itemCount:e.length,items:e,offset:0,onSelectionChange:this.handleGroupedSelectionChange,ref:this.groupedList,renderItem:this.renderGroupedItem,selectedRanges:i,style:{height:u},isMultiSelect:!0})]}),h.jsxs("div",{className:"rollup-rows-available-columns",children:[h.jsx("div",{className:"section-title",children:"Available Grouping Columns"}),h.jsxs("div",{className:"top-menu",children:[h.jsx(ka,{className:"w-100",value:r,matchCount:r?a.length:void 0,placeholder:"Find column...",onChange:this.handleSearchChange}),h.jsxs(K,{kind:"ghost",className:X("btn-link btn-link-icon",{active:l===pr.SORT.ASCENDING}),onClick:this.handleSortAscending,children:[h.jsx(ue,{icon:Yh}),h.jsx(Ot,{children:"Sort ascending"})]}),h.jsxs(K,{kind:"ghost",className:X("btn-link btn-link-icon",{active:l===pr.SORT.DESCENDING}),onClick:this.handleSortDescending,children:[h.jsx(ue,{icon:Xh}),h.jsx(Ot,{children:"Sort descending"})]})]}),h.jsx(gn,{className:"rollup-available-grouping-columns",draggablePrefix:yl,droppableId:yl,itemCount:d.length,items:d,renderItem:pr.renderColumn,offset:0,onSelect:this.handleUngroupedSelect,onSelectionChange:this.handleUngroupedSelectionChange,ref:this.ungroupedList,selectedRanges:a,style:{maxHeight:c,minHeight:m},isDropDisabled:(t==null?void 0:t.droppableId)!==wl,isMultiSelect:!0}),h.jsxs("div",{className:"bottom-menu",children:[h.jsx("div",{className:"label",children:"Show:"}),h.jsx(zn,{checked:o,onChange:this.handleShowConstituentsChange,children:"Constituents"}),h.jsx(zn,{checked:s,onChange:this.handleShowNonAggregatedColumnsChange,children:"Non-Aggregated Columns"})]})]})]})})}}Yi(pr,"SORT",Object.freeze({ASCENDING:"ASC",DESCENDING:"DESC"}));Yi(pr,"defaultProps",{config:null,onChange:()=>{}});const nL=pr;function Jf(n,e,t,r,i,a,o){try{var s=n[a](o),l=s.value}catch(d){t(d);return}s.done?e(l):Promise.resolve(l).then(r,i)}function iL(n){return function(){var e=this,t=arguments;return new Promise(function(r,i){var a=n.apply(e,t);function o(l){Jf(a,r,i,o,s,"next",l)}function s(l){Jf(a,r,i,o,s,"throw",l)}o(void 0)})}}function eg(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function tg(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?eg(Object(t),!0).forEach(function(r){Ua(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):eg(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function Ua(n,e,t){return e=aL(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function aL(n){var e=oL(n,"string");return typeof e=="symbol"?e:String(e)}function oL(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var sL=ie.module("TableCsvExporter");class Ae extends w.Component{static getDateString(e){return e.i18n.DateTimeFormat.format(Ae.FILENAME_DATE_FORMAT,new Date)}constructor(e){super(e),this.handleDownloadClick=this.handleDownloadClick.bind(this),this.handleDownloadRowOptionChanged=this.handleDownloadRowOptionChanged.bind(this),this.handleCustomizedDownloadRowOptionChanged=this.handleCustomizedDownloadRowOptionChanged.bind(this),this.handleCustomizedDownloadRowsChanged=this.handleCustomizedDownloadRowsChanged.bind(this),this.handleIncludeColumnHeadersChanged=this.handleIncludeColumnHeadersChanged.bind(this),this.handleIncludeHiddenColumnsChanged=this.handleIncludeHiddenColumnsChanged.bind(this),this.handleUseUnformattedValuesChanged=this.handleUseUnformattedValuesChanged.bind(this);var{model:t,name:r}=e;this.state={fileName:"".concat(r,"-").concat(Ae.getDateString(t.dh),".csv"),downloadRowOption:Ae.DOWNLOAD_ROW_OPTIONS.ALL_ROWS,customizedDownloadRowOption:Ae.CUSTOMIZED_ROWS_OPTIONS.FIRST,customizedDownloadRows:Ae.DEFAULT_DOWNLOAD_ROWS,includeColumnHeaders:!0,includeHiddenColumns:!1,useUnformattedValues:!1,errorMessage:null,id:qe.generate()}}getSnapshotRanges(){var{model:e,selectedRanges:t}=this.props,{downloadRowOption:r,customizedDownloadRowOption:i,customizedDownloadRows:a}=this.state,{rowCount:o,columnCount:s}=e,l=[];switch(r){case Ae.DOWNLOAD_ROW_OPTIONS.ALL_ROWS:l.push(new Q(0,0,s-1,o-1));break;case Ae.DOWNLOAD_ROW_OPTIONS.SELECTED_ROWS:l=t.map(d=>tg(tg({},d),{},{startColumn:0,endColumn:s-1})).sort((d,u)=>d.startRow!=null&&u.startRow!=null?d.startRow-u.startRow:0);break;case Ae.DOWNLOAD_ROW_OPTIONS.CUSTOMIZED_ROWS:switch(i){case Ae.CUSTOMIZED_ROWS_OPTIONS.FIRST:l.push(new Q(0,0,s-1,Math.min(a-1,o-1)));break;case Ae.CUSTOMIZED_ROWS_OPTIONS.LAST:l.push(new Q(0,Math.max(0,o-a),s-1,o-1));break}break}return l}getModelRanges(e){var{userColumnWidths:t,movedColumns:r}=this.props,{includeHiddenColumns:i}=this.state,a=Pe.getHiddenColumns(t),o=ae.getModelRanges(e,r);if(!i&&a.length>0){var s=a.map(Q.makeColumn);o=Q.subtractRangesFromRanges(o,s)}return o}resetDownloadState(){this.setState({errorMessage:null})}handleDownloadClick(){var e=this;return iL(function*(){var{model:t,isDownloading:r,onDownloadStart:i,onDownload:a,onCancel:o}=e.props,{fileName:s,includeColumnHeaders:l,useUnformattedValues:d}=e.state;if(r){o();return}e.resetDownloadState();var u=e.getSnapshotRanges(),c=e.getModelRanges(u);if(e.validateOptionInput()){i();try{var m=yield t.export(),v=m.setViewport(0,0);yield v.getViewportData(),a(s,m,v,u,c,l,d)}catch(f){sL.error("CSV download failed",f),e.setState({errorMessage:h.jsxs("p",{children:[h.jsx(ue,{icon:ta})," ","".concat(f)]})}),o()}}})()}handleDownloadRowOptionChanged(e){this.setState({downloadRowOption:e.target.value})}handleCustomizedDownloadRowOptionChanged(e){this.setState({customizedDownloadRowOption:e})}handleCustomizedDownloadRowsChanged(e){this.setState({customizedDownloadRows:parseInt(e.target.value,10)})}handleIncludeColumnHeadersChanged(){this.setState(e=>{var{includeColumnHeaders:t}=e;return{includeColumnHeaders:!t}})}handleIncludeHiddenColumnsChanged(){this.setState(e=>{var{includeHiddenColumns:t}=e;return{includeHiddenColumns:!t}})}handleUseUnformattedValuesChanged(){this.setState(e=>{var{useUnformattedValues:t}=e;return{useUnformattedValues:!t}})}validateOptionInput(){var{selectedRanges:e}=this.props,{downloadRowOption:t,customizedDownloadRows:r}=this.state;return t===Ae.DOWNLOAD_ROW_OPTIONS.SELECTED_ROWS&&e.length===0?(this.setState({errorMessage:h.jsxs("p",{children:[h.jsx(ue,{icon:ta})," No rows selected. Please select some rows in the table."]})}),!1):t===Ae.DOWNLOAD_ROW_OPTIONS.CUSTOMIZED_ROWS&&r<=0?(this.setState({errorMessage:h.jsxs("p",{children:[h.jsx(ue,{icon:ta})," Number of rows to output must be greater than 0"]})}),!1):!0}render(){var{model:e,isDownloading:t,tableDownloadProgress:r,tableDownloadEstimatedTime:i,selectedRanges:a,tableDownloadStatus:o}=this.props,{fileName:s,downloadRowOption:l,customizedDownloadRowOption:d,customizedDownloadRows:u,includeColumnHeaders:c,includeHiddenColumns:m,useUnformattedValues:v,errorMessage:f,id:g}=this.state,{rowCount:p}=e;return h.jsxs("div",{className:"table-csv-exporter",children:[h.jsx("div",{className:"section-title",children:"Download Rows"}),h.jsx("div",{className:"form-group",children:h.jsxs(Ad,{onChange:this.handleDownloadRowOptionChanged,value:l,disabled:t,children:[h.jsxs(fi,{value:Ae.DOWNLOAD_ROW_OPTIONS.ALL_ROWS,"data-testid":"radio-csv-exporter-download-all",children:["All Rows",h.jsx("span",{className:"text-muted ml-2",children:"(".concat(p.toString().replace(/(\d)(?=(\d{3})+(?!\d))/g,"$1,")," rows)")})]}),h.jsxs(fi,{value:Ae.DOWNLOAD_ROW_OPTIONS.SELECTED_ROWS,"data-testid":"radio-csv-exporter-only-selected",children:["Only Selected Rows",h.jsx("span",{className:"text-muted ml-2",children:a.length>0?"(".concat(Q.rowCount(a).toString().replace(/(\d)(?=(\d{3})+(?!\d))/g,"$1,")," rows)"):null})]}),h.jsx(fi,{value:Ae.DOWNLOAD_ROW_OPTIONS.CUSTOMIZED_ROWS,"data-testid":"radio-csv-exporter-customized-rows",children:h.jsxs("div",{className:"radio-input-row",role:"presentation",onClick:()=>{this.setState({downloadRowOption:Ae.DOWNLOAD_ROW_OPTIONS.CUSTOMIZED_ROWS})},children:[h.jsxs(Gt,{value:d,"data-testid":"select-csv-exporter-customized-rows",className:"custom-select",disabled:t,onChange:this.handleCustomizedDownloadRowOptionChanged,children:[h.jsx("option",{value:"FIRST",children:"First"}),h.jsx("option",{value:"LAST",children:"Last"})]}),h.jsx("input",{type:"number",className:"form-control",id:"customizedRows-".concat(g),"data-testid":"input-csv-exporter-customized-rows",name:"customizedRows-".concat(g),placeholder:"100",value:u,disabled:t,onChange:this.handleCustomizedDownloadRowsChanged}),h.jsx("div",{children:"Rows"})]})})]})}),h.jsxs("div",{className:"form-group",children:[h.jsx("label",{htmlFor:"customizedRows-".concat(g),children:"File Name"}),h.jsx("input",{type:"text",className:"form-control",id:"filename-".concat(g),"data-testid":"input-csv-exporter-file-name",name:"filename-".concat(g),value:s,onChange:b=>{this.setState({fileName:b.target.value})},disabled:t})]}),h.jsxs("div",{className:"checkbox-options",children:[h.jsx(zn,{checked:c,onChange:this.handleIncludeColumnHeadersChanged,children:"Include column headers"}),h.jsx(zn,{checked:m,onChange:this.handleIncludeHiddenColumnsChanged,children:"Include hidden columns"}),h.jsx(zn,{checked:v,onChange:this.handleUseUnformattedValuesChanged,children:"Use unformatted values"})]}),h.jsxs("div",{className:"section-footer flex-column",children:[f!=null&&h.jsx("div",{className:"error-message",children:f}),o&&h.jsxs("div",{className:"download-status",children:[(o===Ae.DOWNLOAD_STATUS.DOWNLOADING||o===Ae.DOWNLOAD_STATUS.INITIATING)&&h.jsxs(h.Fragment,{children:[o===Ae.DOWNLOAD_STATUS.INITIATING&&h.jsx("div",{className:"text-muted",children:"Starting Download..."}),o===Ae.DOWNLOAD_STATUS.DOWNLOADING&&h.jsxs("div",{className:"text-muted d-flex justify-content-between",children:[h.jsx("span",{children:i||i===0?"Estimated time: ".concat(rc.formatElapsedTime(i)):null}),h.jsx("span",{children:"".concat(r,"%")})]})]}),o===Ae.DOWNLOAD_STATUS.FINISHED&&h.jsx("div",{className:"text-muted text-right",children:"Download Completed"}),o===Ae.DOWNLOAD_STATUS.CANCELED&&h.jsx("div",{className:"text-muted",children:"Download Canceled"}),(o===Ae.DOWNLOAD_STATUS.DOWNLOADING||o===Ae.DOWNLOAD_STATUS.INITIATING)&&h.jsx("div",{className:"progress",children:h.jsx("div",{className:"progress-bar progress-bar-striped progress-bar-animated",style:{width:"".concat(r,"%")}})}),o===Ae.DOWNLOAD_STATUS.FINISHED&&h.jsx("div",{className:"progress",children:h.jsx("div",{className:"progress-bar bg-success",style:{width:"".concat(r,"%")}})})]}),h.jsxs(K,{kind:"primary","data-testid":"btn-csv-exporter-download",className:X("btn-downloading",{"btn-spinner btn-cancelable":t}),onClick:this.handleDownloadClick,children:[t&&h.jsxs("span",{children:[h.jsx(ia,{className:"mr-2 loading-spinner-vertical-align"}),h.jsx("span",{className:"btn-normal-content",children:"Downloading"}),h.jsx("span",{className:"btn-hover-content",children:"Cancel"})]}),!t&&"Download"]})]})]})}}Ua(Ae,"FILENAME_DATE_FORMAT","yyyy-MM-dd-HHmmss");Ua(Ae,"DOWNLOAD_STATUS",{INITIATING:"INITIATING",DOWNLOADING:"DOWNLOADING",FINISHED:"FINISHED",CANCELED:"CANCELED"});Ua(Ae,"DOWNLOAD_ROW_OPTIONS",{ALL_ROWS:"ALL_ROWS",SELECTED_ROWS:"SELECTED_ROWS",CUSTOMIZED_ROWS:"CUSTOMIZED_ROWS"});Ua(Ae,"CUSTOMIZED_ROWS_OPTIONS",{FIRST:"FIRST",LAST:"LAST"});Ua(Ae,"DEFAULT_DOWNLOAD_ROWS",100);Ua(Ae,"defaultProps",{onDownloadStart:()=>{},isDownloading:!1,tableDownloadStatus:"",tableDownloadProgress:0,tableDownloadEstimatedTime:null,selectedRanges:[]});const ga=Ae;function Ve(n,e,t){return e=lL(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function lL(n){var e=dL(n,"string");return typeof e=="symbol"?e:String(e)}function dL(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var ii=ie.module("TableSaver"),uL="yyyy-MM-dd'T'HH:mm:ss.SSSSSSSSS z";function hL(n){return n.added!==void 0}function cL(n){if(!hL(n))throw new Error("event is not UpdateEventData")}class Cr extends w.PureComponent{static csvEscapeString(e){return'"'.concat(e.replace(/"/g,'""'),'"')}constructor(e){super(e),Ve(this,"sw",void 0),Ve(this,"port",void 0),Ve(this,"fileWriter",void 0),Ve(this,"table",void 0),Ve(this,"tableSubscription",void 0),Ve(this,"columns",void 0),Ve(this,"fileName",void 0),Ve(this,"includeColumnHeaders",void 0),Ve(this,"useUnformattedValues",void 0),Ve(this,"chunkRows",void 0),Ve(this,"gridRanges",void 0),Ve(this,"gridRangeCounter",void 0),Ve(this,"rangedSnapshotsTotal",void 0),Ve(this,"rangedSnapshotCounter",void 0),Ve(this,"snapshotsTotal",void 0),Ve(this,"snapshotCounter",void 0),Ve(this,"snapshotsBuffer",void 0),Ve(this,"currentSnapshotIndex",void 0),Ve(this,"snapshotPending",void 0),Ve(this,"cancelableSnapshots",void 0),Ve(this,"streamTimeout",void 0),Ve(this,"snapshotHandlerTimeout",void 0),Ve(this,"downloadStartTime",void 0),Ve(this,"iframe",void 0),Ve(this,"useBlobFallback",void 0),Ve(this,"getCachedCustomColumnFormatFlag",On(gi.isCustomColumnFormatDefined,{max:1e4})),this.handlePortMessage=this.handlePortMessage.bind(this),this.handleSnapshotResolved=this.handleSnapshotResolved.bind(this),this.handleDownloadTimeout=this.handleDownloadTimeout.bind(this),this.state={},this.gridRanges=[],this.gridRangeCounter=0,this.rangedSnapshotsTotal=[],this.rangedSnapshotCounter=0,this.includeColumnHeaders=!0,this.useUnformattedValues=!1,this.snapshotsTotal=0,this.snapshotCounter=0,this.snapshotsBuffer=new Map,this.currentSnapshotIndex=0,this.snapshotPending=0,this.cancelableSnapshots=[],this.useBlobFallback=!1}componentDidMount(){var{getDownloadWorker:e}=this.props;e().then(t=>{ii.info("found active service worker"),this.sw=t,this.sw.postMessage("ping")}).catch(t=>{ii.warn("Download csv is not optimized.",t),this.useBlobFallback=!0})}componentWillUnmount(){this.removeIframe(),this.streamTimeout&&clearTimeout(this.streamTimeout),this.snapshotHandlerTimeout&&clearTimeout(this.snapshotHandlerTimeout)}createWriterStream(e){var t=this.useBlobFallback,r=[],i=null;t&&(i=TextEncoder.prototype.encode.bind(new TextEncoder));var{fileName:a}=this,o={};return t?(o.write=s=>{j(i),s.header!==void 0&&r.push(i(s.header)),s.rows!==void 0&&r.push(i(s.rows))},o.close=()=>{j(a);var s=new Blob(r,{type:"application/octet-stream; charset=utf-8"}),l=document.createElement("a");l.href=URL.createObjectURL(s),l.download=a,l.click()},o.abort=()=>{e.postMessage({cancel:!0}),e.close()}):(o.write=s=>{e.postMessage(s)},o.close=()=>{e.postMessage({end:!0}),e.close()},o.abort=()=>{e.postMessage({cancel:!0}),e.close()}),new WritableStream(o)}startDownload(e,t,r,i,a,o,s){var{isDownloading:l}=this.props;if(!l){this.downloadStartTime=Date.now(),ii.info("start downloading ".concat(e)),this.table=t,this.columns=Pe.columnsFromRanges(a,t.columns),this.tableSubscription=r,this.gridRanges=i,this.includeColumnHeaders=o,this.useUnformattedValues=s;var d=encodeURIComponent(e.replace(/\//g,":")).replace(/['()]/g,escape).replace(/\*/g,"%2A"),u=new MessageChannel;if(this.port=u.port1,this.fileName=e,this.fileWriter=this.createWriterStream(this.port).getWriter(),this.useBlobFallback){this.writeCsvTable(o);return}this.sw&&this.sw.postMessage({encodedFileName:d},[u.port2]),this.port.onmessage=this.handlePortMessage}}finishDownload(){this.table&&this.table.close(),this.tableSubscription&&this.tableSubscription.close(),this.fileWriter&&this.fileWriter.close();var{onDownloadCompleted:e}=this.props;e(),this.resetTableSaver(),this.downloadStartTime!==void 0&&ii.info("download finished, total elapsed time ".concat((Date.now()-this.downloadStartTime)/1e3," seconds"))}cancelDownload(){var e,t,r;(e=this.table)===null||e===void 0||e.close(),(t=this.tableSubscription)===null||t===void 0||t.close(),(r=this.fileWriter)===null||r===void 0||r.abort(),this.cancelableSnapshots.forEach(a=>{a&&(a.catch(()=>null),a.cancel())});var{onDownloadCanceled:i}=this.props;i(),this.resetTableSaver()}resetTableSaver(){this.table=void 0,this.tableSubscription=void 0,this.columns=void 0,this.chunkRows=void 0,this.removeIframe(),this.gridRanges=[],this.gridRangeCounter=0,this.rangedSnapshotsTotal=[],this.rangedSnapshotCounter=0,this.includeColumnHeaders=!0,this.useUnformattedValues=!1,this.snapshotsTotal=0,this.snapshotCounter=0,this.snapshotsBuffer=new Map,this.currentSnapshotIndex=0,this.snapshotPending=0,this.cancelableSnapshots=[],this.streamTimeout!=null&&clearTimeout(this.streamTimeout),this.snapshotHandlerTimeout!=null&&clearTimeout(this.snapshotHandlerTimeout),this.streamTimeout=void 0,this.snapshotHandlerTimeout=void 0}handleDownloadTimeout(){ii.info("download canceled"),this.cancelDownload()}writeTableHeader(){var e,t="";if(this.columns)for(var r=0;r<this.columns.length;r+=1)t+=this.columns[r].name,t+=r===this.columns.length-1?`
|
|
5
5
|
`:",";(e=this.fileWriter)===null||e===void 0||e.write({header:t}).then(()=>null)}startWriteTableBody(){this.columns&&this.gridRanges!=null&&(this.chunkRows=Math.floor(Cr.DOWNLOAD_CELL_CHUNK/this.columns.length),this.rangedSnapshotsTotal=this.gridRanges.map(e=>(j(e.endRow),j(e.startRow),j(this.chunkRows),Math.ceil((e.endRow-e.startRow+1)/this.chunkRows))),this.snapshotsTotal=this.rangedSnapshotsTotal.reduce((e,t)=>e+t),ii.info("start writing table, total snapshots: ",this.snapshotsTotal),this.makeSnapshot(Math.min(Cr.SNAPSHOT_BUFFER_SIZE,this.snapshotsTotal)))}writeCsvTable(e){e&&this.writeTableHeader(),this.startWriteTableBody()}writeSnapshot(e,t,r){if(this.currentSnapshotIndex===e&&this.fileWriter){for(;this.snapshotsBuffer.has(this.currentSnapshotIndex);){var i=this.snapshotsBuffer.get(this.currentSnapshotIndex);j(i),this.fileWriter.write({rows:this.convertSnapshotIntoCsv(i)}),this.snapshotsBuffer.delete(this.currentSnapshotIndex),this.currentSnapshotIndex+=1,this.updateDownloadProgress(e)}if(this.snapshotsTotal&&this.currentSnapshotIndex>=this.snapshotsTotal){this.finishDownload();return}}this.snapshotCounter&&this.snapshotsTotal&&this.snapshotCounter<this.snapshotsTotal&&(ii.debug2(`
|
|
@@ -38,4 +38,4 @@ Check your internet connection.`;if(t&&r)return"Disconnected from server.";if(r)
|
|
|
38
38
|
`).concat(po.makeCirclePath(o,s,ob)),N="link-select-clip-".concat(l),P=Math.atan2(s-E,o-y),R=P-ab+Math.PI,A=P+ab+Math.PI,M=o+Math.cos(P)*ib,I=s+Math.sin(P)*ib,x=M+Math.cos(R)*$l,_=I+Math.sin(R)*$l,k=M+Math.cos(A)*$l,U=I+Math.sin(A)*$l,G="".concat(M,",").concat(I," ").concat(x,",").concat(_," ").concat(k,",").concat(U),Y=.25*i+.5*y+.25*o,Z=.25*a+.5*E+.25*s,$=y-i+(o-y),D=E-a+(s-E),L=D/$,H=20,z=H/Math.sqrt(1+L**2),te=z*L,W=z*-1,ne=te*-1;Number.isFinite(L)?L>0?(z*=-1,te*=-1,W*=-1,ne*=-1,W-=50-10*(Math.abs(v)%ki),ne+=10*(Math.abs(v)%ki),z-=50-10*(Math.abs(v)%ki),te+=10*(Math.abs(v)%ki)):L<0?(W+=10*(Math.abs(v)%ki),ne+=10*(Math.abs(v)%ki),z+=10*(Math.abs(v)%ki),te+=10*(Math.abs(v)%ki)):(W=15,ne=10,z=-25,te=10):(W=10,ne=5,z=10,te=-35);var re="";t!==void 0&&(t==="startsWith"?re="a*":t==="endsWith"?re="*z":re=F.getFilterOperatorString(t));var se=u!=="chartLink"&&u!=="filterSource";return h.jsxs(h.Fragment,{children:[h.jsxs("svg",{className:X(e,{hovering:c}),children:[h.jsx("clipPath",{id:N,children:h.jsx("path",{d:O,clipRule:"evenodd"})}),h.jsx("path",{className:"link-select",d:T,onClick:this.handleClick,onMouseEnter:this.handleMouseEnter,onMouseLeave:this.handleMouseLeave,clipPath:"url(#".concat(N,")"),"data-testid":"link-select"}),h.jsx("path",{className:"link-background",d:T}),h.jsx("path",{className:"link-foreground",d:T}),h.jsx("circle",{className:"link-dot",cx:i,cy:a,r:"5"}),h.jsx("polygon",{className:"link-triangle",points:G})]}),d!=null&&r&&h.jsxs(h.Fragment,{children:[se&&h.jsx(K,{kind:"primary",className:"btn-fab btn-operator",style:{top:Z+(L>=0?te:ne),left:Y+(L>=0?z:W)},onClick:()=>{},icon:h.jsxs("div",{className:"fa-md fa-layers",children:[h.jsx("b",{children:re}),h.jsx(ue,{icon:Pa,transform:"right-8 down-9 shrink-5"})]}),tooltip:"Change comparison operator",children:h.jsx(Ia,{actions:this.getDropdownActions,popperOptions:{placement:"bottom-start"}})}),h.jsx(K,{kind:"primary",className:"btn-fab btn-delete",style:{top:Z+(L<0?te:ne),left:Y+(L<0?z:W)},onClick:this.handleDelete,icon:Br,tooltip:"Delete"})]})]})}}Iw(po,"defaultProps",{className:"",isSelected:!1,onClick(){},onDelete(){}});const GV=po;function sb(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function lb(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?sb(Object(t),!0).forEach(function(r){Qc(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):sb(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function Qc(n,e,t){return e=WV(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function WV(n){var e=zV(n,"string");return typeof e=="symbol"?e:String(e)}function zV(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var oh=ie.module("LinkerOverlayContent");class Mw extends w.Component{constructor(e){super(e),Qc(this,"dialogRef",void 0),this.handleBlur=this.handleBlur.bind(this),this.handleResize=this.handleResize.bind(this),this.handleMouseMove=this.handleMouseMove.bind(this),this.handleMouseDown=this.handleMouseDown.bind(this),this.handleMouseUp=this.handleMouseUp.bind(this),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleKeyUp=this.handleKeyUp.bind(this),this.handleEscapePressed=this.handleEscapePressed.bind(this),this.handleOperatorChanged=this.handleOperatorChanged.bind(this),this.dialogRef=oe.createRef(),this.state={mouse:void 0,dialog:void 0,offset:{x:0,y:0},isDragging:!1,mode:"select"}}componentDidMount(){window.addEventListener("blur",this.handleBlur,!0),window.addEventListener("mousemove",this.handleMouseMove,!0),window.addEventListener("mouseup",this.handleMouseUp,!0),window.addEventListener("keydown",this.handleKeyDown,!0),window.addEventListener("keyup",this.handleKeyUp,!0),window.addEventListener("resize",this.handleResize,!0)}componentDidCatch(e,t){oh.error("componentDidCatch",e,t)}componentWillUnmount(){window.removeEventListener("blur",this.handleBlur,!0),window.removeEventListener("mousemove",this.handleMouseMove,!0),window.removeEventListener("mouseup",this.handleMouseUp,!0),window.removeEventListener("keydown",this.handleKeyDown,!0),window.removeEventListener("keyup",this.handleKeyUp,!0),window.removeEventListener("resize",this.handleResize,!0)}getPointFromLinkPoint(e){var{panelManager:t}=this.props,{panelId:r,columnName:i}=e,a=t.getOpenedPanelById(r);if(a!=null){if(!Rw(a))throw new Error("Panel does not have getCoordinateForColumn method: ".concat(r));try{var o=a.getCoordinateForColumn(i);if(o!=null)return o}catch{oh.error("Could not get coordinate for column",i,a)}}var s=t.getContainerByPanelId(r);if(s==null)throw new Error("Unable to find panel container for id: ".concat(r));return ee.getTabPoint(s)}handleOperatorChanged(e,t){var{links:r,onLinksUpdated:i}=this.props,a=r.map(o=>o.id===e?lb(lb({},o),{},{operator:t}):o);i(a)}handleBlur(){this.setState({mode:"select"})}handleResize(){var{dialog:e}=this.state;if(e&&this.dialogRef.current){var t=this.dialogRef.current.getBoundingClientRect(),r=Le(e.x,0,window.innerWidth-t.width),i=Le(e.y,0,window.innerHeight-t.height);this.setState({dialog:{x:r,y:i}})}}handleMouseMove(e){var{offset:t,isDragging:r}=this.state;if(this.setState({mouse:{x:e.clientX,y:e.clientY}}),r&&this.dialogRef.current){var i=this.dialogRef.current.getBoundingClientRect(),a=Le(window.innerWidth-(e.clientX+i.width+t.x),0,window.innerWidth-i.width),o=Le(window.innerHeight-(e.clientY+i.height+t.y),0,window.innerHeight-i.height);this.setState({dialog:{x:a,y:o}})}}handleMouseDown(e){e.preventDefault();var t={x:0,y:0};if(this.dialogRef.current){var r=this.dialogRef.current.getBoundingClientRect();t.x=r.right-(r.width+e.clientX),t.y=r.bottom-(r.height+e.clientY)}this.setState({isDragging:!0,offset:t})}handleMouseUp(){this.setState({isDragging:!1})}handleKeyDown(e){if(e.key==="Alt")e.preventDefault(),this.setState({mode:"delete"});else if(e.key==="Delete"||e.key==="Backspace"){var{selectedIds:t,onLinkDeleted:r}=this.props;e.preventDefault(),t.forEach(i=>r(i))}}handleKeyUp(e){e.key==="Alt"&&(e.preventDefault(),this.setState({mode:"select"}))}handleEscapePressed(){var{onCancel:e}=this.props;e()}render(){var{disabled:e,links:t,selectedIds:r,messageText:i,onLinkSelected:a,onLinkDeleted:o,onAllLinksDeleted:s,onDone:l}=this.props,{mouse:d,dialog:u,isDragging:c,mode:m}=this.state,v=t.map(f=>{try{var g,p,{id:b,type:S,isReversed:C,start:y,end:E,operator:T}=f,O=y.columnType,[N,P]=this.getPointFromLinkPoint(y),R=(g=d==null?void 0:d.x)!==null&&g!==void 0?g:N,A=(p=d==null?void 0:d.y)!==null&&p!==void 0?p:P;if(E!=null&&([R,A]=this.getPointFromLinkPoint(E)),C!=null&&C){var[M,I]=[N,P];[N,P]=[R,A],[R,A]=[M,I]}var x=X("linker-link",{disabled:e},{"link-filter-source":S==="filterSource"},{"link-invalid":S==="invalid"},{interactive:f.end==null},{"link-is-selected":r.has(b)},{"danger-delete":m==="delete"});return{x1:N,y1:P,x2:R,y2:A,id:b,className:x,operator:T,startColumnType:O,type:S}}catch(_){return oh.warn("Unable to get point for link",f,_),null}}).filter(f=>f!=null);return h.jsxs("div",{className:X("linker-overlay",{"danger-delete":m==="delete"}),children:[v.map(f=>{var{x1:g,y1:p,x2:b,y2:S,id:C,className:y,operator:E,startColumnType:T,type:O}=f;return h.jsx(GV,{className:y,id:C,x1:g,y1:p,x2:b,y2:S,onClick:a,onDelete:o,isSelected:r.has(C),operator:E,startColumnType:T,type:O,onOperatorChanged:this.handleOperatorChanged},C)}),h.jsxs("div",{className:X("linker-toast-dialog",{dragging:c}),ref:this.dialogRef,style:{bottom:u==null?void 0:u.y,right:u==null?void 0:u.x},"data-testid":"linker-toast-dialog",children:[h.jsx(K,{draggable:!0,kind:"inline",className:"btn-drag-handle",icon:xs,onClick:()=>{},onMouseDown:this.handleMouseDown,children:!c&&h.jsx(Ot,{children:"Drag to reposition"})}),h.jsx("div",{className:"toast-body",children:i}),h.jsxs("div",{className:"toast-footer",children:[h.jsx(K,{kind:"secondary",onClick:s,children:"Clear All"}),h.jsx(K,{kind:"primary",onClick:l,children:"Done"})]})]}),h.jsx(le,{actions:[{action:this.handleEscapePressed,shortcut:Vn.LINKER_CLOSE,isGlobal:!0}]})]})}}Qc(Mw,"defaultProps",{disabled:"false"});const KV=Mw;function db(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function ub(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?db(Object(t),!0).forEach(function(r){xw(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):db(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function xw(n,e,t){return e=qV(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function qV(n){var e=YV(n,"string");return typeof e=="symbol"?e:String(e)}function YV(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var kt=ie.module("Linker"),XV=(n,e)=>({activeTool:Tc(n),dh:NC(n),isolatedLinkerPanelId:Jd(n,e.localDashboardId),links:za(n,e.localDashboardId),timeZone:Ec(n)}),QV=ln(XV,{setActiveTool:AC,setDashboardLinks:tu,addDashboardLinks:ZS,deleteDashboardLinks:JS,setDashboardIsolatedLinkerPanelId:Bc,setDashboardColumnSelectionValidator:ew});class ZV extends w.Component{constructor(e){super(e),xw(this,"getCachedLinks",be((t,r,i)=>{var a=[...t];return r!=null&&r.start!=null&&a.push(r),i!==void 0?a.filter(o=>{var s,l;return(o==null||(s=o.start)===null||s===void 0?void 0:s.panelId)===i||(o==null||(l=o.end)===null||l===void 0?void 0:l.panelId)===i||(o==null?void 0:o.end)==null}):a})),this.handleCancel=this.handleCancel.bind(this),this.handleDone=this.handleDone.bind(this),this.handlePanelCloned=this.handlePanelCloned.bind(this),this.handleFilterColumnSelect=this.handleFilterColumnSelect.bind(this),this.handleColumnsChanged=this.handleColumnsChanged.bind(this),this.handlePanelClosed=this.handlePanelClosed.bind(this),this.handleLayoutStateChanged=this.handleLayoutStateChanged.bind(this),this.handleAllLinksDeleted=this.handleAllLinksDeleted.bind(this),this.handleLinkDeleted=this.handleLinkDeleted.bind(this),this.handleLinksUpdated=this.handleLinksUpdated.bind(this),this.handleChartColumnSelect=this.handleChartColumnSelect.bind(this),this.handleGridColumnSelect=this.handleGridColumnSelect.bind(this),this.handleUpdateValues=this.handleUpdateValues.bind(this),this.handleStateChange=this.handleStateChange.bind(this),this.handleExited=this.handleExited.bind(this),this.handleLinkSelected=this.handleLinkSelected.bind(this),this.handlePanelDragging=this.handlePanelDragging.bind(this),this.handlePanelDropped=this.handlePanelDropped.bind(this),this.isColumnSelectionValid=this.isColumnSelectionValid.bind(this),this.state={linkInProgress:void 0,selectedIds:new Set,isDraggingPanel:!1}}componentDidMount(){var{layout:e}=this.props;this.startListening(e),this.updateSelectionValidators()}componentDidUpdate(e){var{activeTool:t,layout:r}=this.props;r!==e.layout&&(this.stopListening(e.layout),this.startListening(r)),t!==e.activeTool&&(this.updateSelectionValidators(),t===Cn.DEFAULT&&this.reset())}componentDidCatch(e,t){kt.error("componentDidCatch",e,t)}componentWillUnmount(){var{layout:e}=this.props;this.stopListening(e)}startListening(e){e.on("stateChanged",this.handleLayoutStateChanged);var{eventHub:t}=e;t.on(an.COLUMN_SELECTED,this.handleGridColumnSelect),t.on(an.DATA_SELECTED,this.handleUpdateValues),t.on(an.STATE_CHANGED,this.handleStateChange),t.on(vd.COLUMN_SELECTED,this.handleChartColumnSelect),t.on(Oe.CLONED,this.handlePanelCloned),t.on(Ct.COLUMN_SELECTED,this.handleFilterColumnSelect),t.on(Ct.COLUMNS_CHANGED,this.handleColumnsChanged),t.on(Oe.CLOSE,this.handlePanelClosed),t.on(Oe.CLOSED,this.handlePanelClosed),t.on(Oe.DRAGGING,this.handlePanelDragging),t.on(Oe.DROPPED,this.handlePanelDropped)}stopListening(e){e.off("stateChanged",this.handleLayoutStateChanged);var{eventHub:t}=e;t.off(an.COLUMN_SELECTED,this.handleGridColumnSelect),t.off(an.DATA_SELECTED,this.handleUpdateValues),t.off(an.STATE_CHANGED,this.handleStateChange),t.off(vd.COLUMN_SELECTED,this.handleChartColumnSelect),t.off(Oe.CLONED,this.handlePanelCloned),t.off(Ct.COLUMN_SELECTED,this.handleFilterColumnSelect),t.off(Ct.COLUMNS_CHANGED,this.handleColumnsChanged),t.off(Oe.CLOSE,this.handlePanelClosed),t.off(Oe.CLOSED,this.handlePanelClosed),t.off(Oe.DRAGGING,this.handlePanelDragging),t.off(Oe.DROPPED,this.handlePanelDropped)}reset(){this.setState({linkInProgress:void 0,selectedIds:new Set})}handleCancel(){var{linkInProgress:e}=this.state;if(e==null){var{setActiveTool:t}=this.props;t(Cn.DEFAULT)}this.setState({linkInProgress:void 0})}handleDone(){var{setActiveTool:e}=this.props;e(Cn.DEFAULT)}handleChartColumnSelect(e,t){this.columnSelected(e,t,!0)}handleFilterColumnSelect(e,t){kt.debug("handleFilterColumnSelect",this.isOverlayShown());var{links:r,localDashboardId:i,setActiveTool:a,setDashboardIsolatedLinkerPanelId:o}=this.props,s=ee.getIdFromPanel(e),l=r.filter(d=>{var u,c;return((u=d.start)===null||u===void 0?void 0:u.panelId)===s||((c=d.end)===null||c===void 0?void 0:c.panelId)===s});if(!this.isOverlayShown()&&s!=null){a(Cn.LINKER),o(i,s),l.length===0&&this.columnSelected(e,t,!0,s);return}this.columnSelected(e,t,!0)}handleColumnsChanged(e,t){kt.debug("handleColumnsChanged",e,t);var{links:r}=this.props,i=ee.getIdFromPanel(e);if(i==null){kt.error("Invalid panelId",e);return}var a=r.filter(o=>{var{start:s,end:l}=o;return s.panelId===i&&wa.findColumn(t,s)==null||l!=null&&l.panelId===i&&wa.findColumn(t,l)==null});this.deleteLinks(a)}handleGridColumnSelect(e,t){if(!tb(t)){kt.debug2("Column is not filterable");return}this.columnSelected(e,t)}columnSelected(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,i=arguments.length>3?arguments[3]:void 0;if(!(i===void 0&&!this.isOverlayShown())){var{isolatedLinkerPanelId:a}=this.props,{linkInProgress:o}=this.state,s=ee.getIdFromPanel(e);if(s!=null){var l=ee.getComponentNameFromPanel(e),{name:d,type:u}=t;if(o==null||o.start==null){var c={id:qe.generate(),start:{panelId:s,panelComponent:l,columnName:d,columnType:u},type:"invalid",isReversed:r};kt.debug("starting link",c),this.setState({linkInProgress:c})}else{var{links:m}=this.props,{start:v,id:f,isReversed:g}=o,p={panelId:s,panelComponent:l,columnName:d,columnType:u},b=wa.getLinkType(g!==void 0&&g?p:v,g!==void 0&&g?v:p,i??a);switch(b){case"invalid":kt.debug("Ignore invalid link connection",o,p);return;case"filterSource":{var S=g!==void 0&&g?v.panelId:p.panelId,C=m.filter(N=>{var{end:P}=N;return(P==null?void 0:P.panelId)===S});this.deleteLinks(C);break}case"chartLink":{var y=g===!0?v:p,E=g===!0?p:v;kt.debug("creating chartlink",{existingLinkEnd:y,start:v,end:p});var T=m.filter(N=>{var{end:P,start:R}=N;return(R==null?void 0:R.panelId)===E.panelId&&(P==null?void 0:P.panelId)===y.panelId&&(P==null?void 0:P.columnName)===y.columnName&&(P==null?void 0:P.columnType)===y.columnType});this.deleteLinks(T);break}}var O={start:g!==void 0&&g?p:v,end:g!==void 0&&g?v:p,id:f,type:b,operator:q.eq};kt.info("creating link",O),this.setState({linkInProgress:void 0,selectedIds:new Set([f])},()=>{this.addLinks([O])})}}}}unsetFilterValueForLink(e){var{panelManager:t}=this.props;if(e.end){var{end:r}=e,{panelId:i,columnName:a,columnType:o}=r,s=t.getOpenedPanelById(i);s?eb(s)?s.unsetFilterValue(a,o):kt.debug("endPanel.unsetFilterValue not implemented",s):kt.debug("endPanel no longer exists, ignoring unsetFilterValue",i)}}setPanelFilterMap(e,t){kt.debug("Set filter data for panel:",e,t);var{panelManager:r}=this.props,i=r.getOpenedPanelById(e);i?eb(i)?i.setFilterMap(t):kt.debug("panel.setFilterMap not implemented",e,i):kt.debug("panel no longer exists, ignoring setFilterMap",e)}addLinks(e){var{addDashboardLinks:t,localDashboardId:r}=this.props;t(r,e)}deleteLinks(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,{localDashboardId:r}=this.props;if(e.forEach(o=>this.unsetFilterValueForLink(o)),t){var{setDashboardLinks:i}=this.props;i(r,[])}else if(e.length>0){var{deleteDashboardLinks:a}=this.props;a(r,e.map(o=>{var{id:s}=o;return s}))}}handleAllLinksDeleted(){var{links:e,isolatedLinkerPanelId:t}=this.props;if(t===void 0)this.deleteLinks(e,!0);else{var r=e.filter(i=>{var a,o;return(i==null||(a=i.start)===null||a===void 0?void 0:a.panelId)===t||(i==null||(o=i.end)===null||o===void 0?void 0:o.panelId)===t});this.deleteLinks(r)}this.reset()}handleLinkDeleted(e){var{links:t}=this.props,r=t.find(i=>i.id===e);r?this.deleteLinks([r]):kt.error("Unable to find link to delete",e)}handleUpdateValues(e,t){for(var r=ee.getIdFromPanel(e),{dh:i,links:a,timeZone:o}=this.props,s=new Map,l=0;l<a.length;l+=1){var{start:d,end:u,operator:c}=a[l];if(d.panelId===r&&u!=null){var{panelId:m,columnName:v,columnType:f}=u,g=s.has(m)?s.get(m):new Map,p=g.has(v)===!0?g.get(v).filterList:[],{visibleIndex:b,isExpandable:S,isGrouped:C}=t[d.columnName],{value:y}=t[d.columnName],E="".concat(y);if(y===null&&S&&C&&(y=void 0),f!=null&&F.isDateType(f)){var T=new Ut(i,{timeZone:o,showTimeZone:!1,showTSeparator:!0,defaultDateTimeFormatString:Ze.FULL_DATE_FORMAT});E=T.format(y)}var O={operator:c,text:E,value:y,startColumnIndex:b};p.push(O),g.set(v,{columnType:f,filterList:p}),s.set(m,g)}}s.forEach((N,P)=>{this.setPanelFilterMap(P,N)})}handlePanelCloned(e,t){var{links:r}=this.props,i=ee.getIdFromPanel(e),a=t.id;if(i!=null){var o=wa.cloneLinksForPanel(r,i,a);this.addLinks(o)}}handlePanelDragging(e){for(var{links:t}=this.props,r=0;r<t.length;r+=1){var i=t[r],{start:a,end:o}=i;if(a.panelId===e||(o==null?void 0:o.panelId)===e){this.setState({isDraggingPanel:!0});return}}}handlePanelDropped(){this.setState({isDraggingPanel:!1})}handlePanelClosed(e){kt.debug("Panel ".concat(e," closed, deleting links.")),this.deleteLinksForPanelId(e)}handleLinkSelected(e){this.setState({selectedIds:new Set([e])})}handleLinksUpdated(e){var{localDashboardId:t,setDashboardLinks:r}=this.props;r(t,e)}handleLayoutStateChanged(){this.forceUpdate()}handleStateChange(){this.forceUpdate()}handleExited(){var{localDashboardId:e,setDashboardIsolatedLinkerPanelId:t}=this.props;t(e,void 0)}deleteLinksForPanelId(e){for(var{links:t}=this.props,r=0;r<t.length;r+=1){var i=t[r],{start:a,end:o,id:s}=i;(a.panelId===e||(o==null?void 0:o.panelId)===e)&&this.handleLinkDeleted(s)}}isOverlayShown(){var{activeTool:e}=this.props;return e===Cn.LINKER}updateSelectionValidators(){var{activeTool:e,setDashboardColumnSelectionValidator:t,localDashboardId:r}=this.props;switch(e){case Cn.LINKER:t(r,this.isColumnSelectionValid);break;default:t(r,void 0);break}}updateLinkInProgressType(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"invalid";this.setState(t=>{var{linkInProgress:r}=t;return r!==void 0?{linkInProgress:ub(ub({},r),{},{type:e})}:null})}isColumnSelectionValid(e,t){var{linkInProgress:r}=this.state,{isolatedLinkerPanelId:i}=this.props;if(t==null)return(r==null?void 0:r.start)!=null&&this.updateLinkInProgressType(),!1;if(!tb(t))return kt.debug2("Column is not filterable",t.description),(r==null?void 0:r.start)!=null&&this.updateLinkInProgressType("invalid"),!1;if((r==null?void 0:r.start)==null)return!0;var{isReversed:a,start:o}=r,s=ee.getIdFromPanel(e);if(s==null)return!1;var l={panelId:s,panelComponent:ee.getComponentNameFromPanel(e),columnName:t.name,columnType:t.type},d=a!==void 0&&a?wa.getLinkType(l,o,i):wa.getLinkType(o,l,i);return this.updateLinkInProgressType(d),d!=="invalid"}render(){var{links:e,isolatedLinkerPanelId:t,panelManager:r}=this.props,{linkInProgress:i,selectedIds:a,isDraggingPanel:o}=this.state,s=this.isOverlayShown(),l=i!=null&&i.start!=null,d=t===void 0?"Click a column source, then click a column target to create a filter link. The filter comparison operator used by a selected link can be changed. Delete a filter link by clicking the delete button or with alt+click. Click done when finished.":"Create a link between the source column button and a table column by clicking on one, then the other. Delete a filter link by clicking the delete button or with alt+click. Click done when finished.";return o?null:h.jsx(Sr,{in:s,timeout:et.transitionMs,classNames:"fade",mountOnEnter:!0,unmountOnExit:!0,onExited:this.handleExited,children:h.jsx(KV,{disabled:l,panelManager:r,links:this.getCachedLinks(e,i,t),selectedIds:a,messageText:d,onLinkSelected:this.handleLinkSelected,onLinkDeleted:this.handleLinkDeleted,onAllLinksDeleted:this.handleAllLinksDeleted,onLinksUpdated:this.handleLinksUpdated,onDone:this.handleDone,onCancel:this.handleCancel})})}}var JV=QV(ZV);const e2=JV;function Aw(n){Fo(n);var{id:e,layout:t,panelManager:r}=n;return h.jsx(e2,{layout:t,localDashboardId:e,panelManager:r})}var t2={name:"LinkerPlugin",type:aa.DASHBOARD_PLUGIN,component:Aw};const r2=t2;function Lw(n,e,t){return e=n2(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function n2(n){var e=i2(n,"string");return typeof e=="symbol"?e:String(e)}function i2(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class No{static getNewMarkdownTitle(e){for(var t="".concat(No.DEFAULT_TITLE),r=0;e.indexOf(t)>=0;)r+=1,t="".concat(No.DEFAULT_TITLE,"-").concat(r);return t}}Lw(No,"DEFAULT_TITLE","Note");Lw(No,"DEFAULT_CONTENT",`# Markdown Note
|
|
39
39
|
|
|
40
40
|
This note can be edited using **markdown** for styling.`);const sh=No;function kw(n){Fo(n);var{id:e,layout:t,panelManager:r,registerComponent:i}=n,a=w.useCallback(s=>{var{title:l,componentState:d,props:u}=s,{panelState:c=null}=u;return d!=null&&({panelState:c=null}=d),l==null||c==null||c.content==null||c.content.length===0||c.content===sh.DEFAULT_CONTENT?null:Sc(s)},[]),o=w.useCallback(function(){var{title:s="",metadata:l={},id:d=qe.generate(),focusElement:u=ee.DEFAULT_FOCUS_SELECTOR,createNewStack:c=!1,dragEvent:m=null}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},v=r.getOpenedPanelConfigsOfType(oo.COMPONENT),f=r.getClosedPanelConfigsOfType(oo.COMPONENT),g=v.map(y=>{var E;return(E=y.title)!==null&&E!==void 0?E:""}),p=s!=null&&s!==""?s:sh.getNewMarkdownTitle(g),b=f.length>0?null:sh.DEFAULT_CONTENT,S={type:"react-component",component:oo.COMPONENT,props:{id:d,metadata:l,panelState:{content:b},localDashboardId:e},title:p,id:d},{root:C}=t;ee.openComponent({root:C,config:S,focusElement:u,createNewStack:c,dragEvent:m})},[e,t,r]);return w.useEffect(function(){var l=[i(oo.COMPONENT,oo,wc,a)];return()=>{l.forEach(d=>d())}},[a,i]),Ye(t.eventHub,VS.OPEN,o),null}var a2={name:"MarkdownPlugin",type:aa.DASHBOARD_PLUGIN,component:kw};const o2=a2;function hb(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function cb(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?hb(Object(t),!0).forEach(function(r){s2(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):hb(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function s2(n,e,t){return e=l2(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function l2(n){var e=d2(n,"string");return typeof e=="symbol"?e:String(e)}function d2(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var Zc=w.forwardRef((n,e)=>{var{localDashboardId:t,fetch:r}=n,i=Ow(r,t);return h.jsx(ww,cb(cb({ref:e},n),i))});Zc.displayName="PandasPanelPlugin";const u2=Zc;function mb(n,e,t,r,i,a,o){try{var s=n[a](o),l=s.value}catch(d){t(d);return}s.done?e(l):Promise.resolve(l).then(r,i)}function lh(n){return function(){var e=this,t=arguments;return new Promise(function(r,i){var a=n.apply(e,t);function o(l){mb(a,r,i,o,s,"next",l)}function s(l){mb(a,r,i,o,s,"throw",l)}o(void 0)})}}function jw(n){var e=oa(),[t,r]=w.useState(),[i,a]=w.useState(!0),[o,s]=w.useState(!1),{fetch:l}=n,d=w.useCallback(lh(function*(){var c=yield l();return kc.makeModel(e,c)}),[e,l]),u=w.useCallback(lh(function*(){a(!0);var c=yield d();r(c),a(!1)}),[d]);return w.useEffect(()=>{var c=!1;function m(){return v.apply(this,arguments)}function v(){return v=lh(function*(){var f=yield d();c||(r(f),s(!0),a(!1))}),v.apply(this,arguments)}return m(),a(!0),()=>{c=!0}},[d]),h.jsxs(h.Fragment,{children:[h.jsx(As,{isLoaded:o,isLoading:i}),t&&h.jsx(qd,{model:t,children:h.jsx(Sw,{onClick:u})})]})}var h2={name:"PandasPanel",title:"Pandas",type:aa.WIDGET_PLUGIN,component:jw,panelComponent:Zc,supportedTypes:"pandas.DataFrame",icon:Db};const c2=h2;function vb(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function ss(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?vb(Object(t),!0).forEach(function(r){m2(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):vb(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function m2(n,e,t){return e=v2(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function v2(n){var e=f2(n,"string");return typeof e=="symbol"?e:String(e)}function f2(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var g2=ie.module("WidgetLoaderPlugin");function p2(n){var e;function t(r,i){var a=n.component,{metadata:o}=r,s=OC(a);return h.jsx(Ks,ss(ss({widgetName:o==null?void 0:o.name,widgetType:n.title},r),{},{children:s?h.jsx(a,ss(ss({},r),{},{ref:i})):h.jsx(a,ss({},r))}))}return t.displayName="WidgetLoaderPlugin(".concat((e=n.component.displayName)!==null&&e!==void 0?e:n.name,")"),w.forwardRef(t)}function $w(n){var e=_b(),t=w.useMemo(()=>{var s=new Map;return e.forEach(l=>{eE(l)&&[l.supportedTypes].flat().forEach(d=>{if(d!=null&&d!==""){if(s.has(d)){var u;g2.warn("Multiple WidgetPlugins handling type ".concat(d,". Replacing ").concat((u=s.get(d))===null||u===void 0?void 0:u.name," with ").concat(l.name," to handle ").concat(d))}s.set(d,l)}})}),s},[e]);Fo(n);var{id:r,layout:i,registerComponent:a}=n,o=w.useCallback(s=>{var l,{dragEvent:d,fetch:u,panelId:c=qe.generate(),widget:m}=s,{id:v,type:f}=m,g=(l=m.title)!==null&&l!==void 0?l:m.name,p=t.get(f);if(p!=null){var b={id:v,name:g,type:f},S={localDashboardId:r,metadata:b,fetch:u},C={type:"react-component",component:p.name,props:S,title:g,id:c},{root:y}=i;ee.openComponent({root:y,config:C,dragEvent:d})}},[r,i,t]);return w.useEffect(()=>{var s=[...new Set(t.values())].map(l=>{var{panelComponent:d}=l;return d==null?a(l.name,p2(l)):a(l.name,d)});return()=>{s.forEach(l=>l())}},[a,t]),Ye(i.eventHub,Oe.OPEN,o),null}var b2={name:"WidgetLoaderPlugin",type:aa.DASHBOARD_PLUGIN,component:$w};const C2=b2;function uu(n,e,t){return e=S2(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function S2(n){var e=w2(n,"string");return typeof e=="symbol"?e:String(e)}function w2(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class Xs{}uu(Xs,"DROPDOWN_FILTER","ControlType.DROPDOWN_FILTER");uu(Xs,"INPUT_FILTER","ControlType.INPUT_FILTER");uu(Xs,"MARKDOWN","ControlType.MARKDOWN");uu(Xs,"FILTER_SET_MANAGER","ControlType.FILTER_SET_MANAGER");const y2=Xs;var E2=V.shape({state:V.shape({panelState:V.shape({})})}),T2=V.shape({panelId:V.string.isRequired,columnName:V.string.isRequired,columnType:V.string.isRequired}),fb=V.shape({panelId:V.string.isRequired,columnName:V.string.isRequired}),Hw=V.shape({start:fb,end:fb,id:V.string,isReversed:V.bool}),P2=V.arrayOf(Hw),O2=V.shape({name:V.string.isRequired,operateAs:V.string.isRequired,groups:V.arrayOf(V.string).isRequired,permissions:V.shape({canUsePanels:V.bool.isRequired,canCopy:V.bool.isRequired,canDownloadCsv:V.bool.isRequired,canLogout:V.bool.isRequired}).isRequired}),D2=Object.freeze({LinkPoint:T2,Link:Hw,Links:P2,Panel:E2,User:O2});const N2=D2;var R2=(n,e)=>n[e]===null?null:V.bool,I2=(n,e)=>n[e]===null?null:V.string,F2=Object.freeze({nullableBoolean:R2,nullableString:I2});const _2=F2,nG=Object.freeze(Object.defineProperty({__proto__:null,ChartBuilderPlugin:Ew,ChartBuilderPluginConfig:yV,ChartEvent:vd,ChartPanel:qs,ChartPanelPlugin:pV,ChartPluginConfig:SV,ChartWidgetPlugin:yw,CommandHistoryPanel:ow,CommonPropTypes:_2,ConsoleEvent:$r,ConsolePanel:Vl,ConsolePlugin:DV,ControlType:y2,DropdownFilterPanel:na,FileExplorerPanel:uw,FilterPlugin:Tw,FilterPluginConfig:RV,FilterSetManager:hw,FilterSetManagerPanel:Wl,GridPanelPlugin:AV,GridPluginConfig:jV,GridWidgetPlugin:Dw,InputFilterEvent:Ct,InputFilterPanel:go,IrisGridEvent:an,IrisGridPanel:Po,LinkerPlugin:Aw,LinkerPluginConfig:r2,LinkerUtils:wa,LogPanel:vw,MarkdownEvent:VS,MarkdownPanel:oo,MarkdownPlugin:kw,MarkdownPluginConfig:o2,MockFileStorage:hV,NotebookEvent:ze,NotebookPanel:Bi,PandasEvent:jH,PandasPanel:ww,PandasPanelPlugin:u2,PandasPluginConfig:c2,PandasWidgetPlugin:jw,Panel:Xn,TabEvent:fs,ToolType:Cn,UIPropTypes:N2,WidgetLoaderPlugin:$w,WidgetLoaderPluginConfig:C2,WidgetPanel:Ks,WidgetPanelTooltip:zs,addDashboardLinks:ZS,deleteDashboardLinks:JS,getColumnSelectionValidatorForDashboard:eu,getColumnsForDashboard:Hc,getDashboardConnection:tB,getDashboardConsoleSettings:eB,getDashboardSessionWrapper:Ao,getFilterSetsForDashboard:QS,getInputFiltersForDashboard:Qd,getIsolatedLinkerPanelIdForDashboard:Jd,getLinksForDashboard:za,getTableMapForDashboard:Zd,isChartPanelDehydratedProps:aw,isChartPanelFigureMetadata:Uc,isChartPanelTableMetadata:fo,isGLChartPanelState:iw,isIrisGridPanelMetadata:mw,isLegacyIrisGridPanelMetadata:cw,setDashboardColumnSelectionValidator:ew,setDashboardConnection:rB,setDashboardConsoleSettings:tw,setDashboardFilterSets:rw,setDashboardIsolatedLinkerPanelId:Bc,setDashboardLinks:tu,setDashboardSessionWrapper:nB,useLoadTablePlugin:Pw},Symbol.toStringTag,{value:"Module"}));export{oa as $,Qm as A,K as B,zn as C,Hb as D,Ad as E,fi as F,Vn as G,Gt as H,Qt as I,TP as J,de as K,pt as L,ST as M,$e as N,Xb as O,La as P,eC as Q,An as R,ka as S,Ot as T,KT as U,Qb as V,H2 as W,qb as X,fT as Y,mP as Z,jm as _,$E as a,OC as a$,NP as a0,IP as a1,Ut as a2,Ze as a3,je as a4,kP as a5,ur as a6,gi as a7,Bt as a8,BP as a9,Cs as aA,lC as aB,X2 as aC,yO as aD,gv as aE,_O as aF,Sv as aG,jd as aH,ee as aI,qo as aJ,Ye as aK,Oe as aL,FN as aM,Z2 as aN,J2 as aO,BD as aP,ZR as aQ,wN as aR,JR as aS,nR as aT,Ci as aU,IN as aV,yc as aW,ON as aX,Cc as aY,jC as aZ,Fo as a_,Dt as aa,F as ab,B2 as ac,rC as ad,QP as ae,G2 as af,z2 as ag,U2 as ah,V2 as ai,W2 as aj,GP as ak,K2 as al,q2 as am,iO as an,aO as ao,ZP as ap,JP as aq,oO as ar,Y2 as as,k2 as at,Lu as au,dO as av,Mn as aw,FO as ax,Yt as ay,sC as az,ic as b,Sc as b0,BR as b1,UR as b2,Zt as b3,HC as b4,BC as b5,wc as b6,yN as b7,Jl as b8,jR as b9,jS as bA,tG as bB,bH as bC,Pe as bD,EA as bE,xe as bF,DA as bG,nL as bH,Sn as bI,FA as bJ,ga as bK,Cr as bL,c1 as bM,sS as bN,Ra as bO,eG as bP,hf as bQ,Oh as bR,Ln as bS,nG as bT,UC as ba,kr as bb,EH as bc,ae as bd,qd as be,rS as bf,So as bg,hA as bh,Zi as bi,oA as bj,fA as bk,HA as bl,nn as bm,JA as bn,p1 as bo,AA as bp,$A as bq,CA as br,dS as bs,Ex as bt,we as bu,kc as bv,cH as bw,ad as bx,US as by,BS as bz,Ab as c,Nd as d,rc as e,Ia as f,j2 as g,DT as h,le as i,En as j,dc as k,Ma as l,Rd as m,_m as n,oc as o,$b as p,Md as q,xT as r,kT as s,gn as t,LE as u,BT as v,he as w,Yb as x,zT as y,ac as z};
|
|
41
|
-
//# sourceMappingURL=index-
|
|
41
|
+
//# sourceMappingURL=index-17d5f9c5.js.map
|