@deephaven/embed-widget 1.6.1-beta.1 → 1.7.1-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/assets/{App-yw8Fq-Yd.js → App-DfiXxKhF.js} +2 -2
- package/build/assets/{App-yw8Fq-Yd.js.map → App-DfiXxKhF.js.map} +1 -1
- package/build/assets/{Chart-CtACXdAO.js → Chart-kEHMwCAu.js} +2 -2
- package/build/assets/{Chart-CtACXdAO.js.map → Chart-kEHMwCAu.js.map} +1 -1
- package/build/assets/{IrisGrid-mgt1s_jo.js → IrisGrid-Clp1483Q.js} +2 -2
- package/build/assets/{IrisGrid-mgt1s_jo.js.map → IrisGrid-Clp1483Q.js.map} +1 -1
- package/build/assets/{IrisGridThemeProvider-D5gZn2xi.js → IrisGridThemeProvider-Cj_25rO-.js} +2 -2
- package/build/assets/{IrisGridThemeProvider-D5gZn2xi.js.map → IrisGridThemeProvider-Cj_25rO-.js.map} +1 -1
- package/build/assets/{LocalWorkspaceStorage-C_rJZDcD.js → LocalWorkspaceStorage-BJwYRxPN.js} +2 -2
- package/build/assets/{LocalWorkspaceStorage-C_rJZDcD.js.map → LocalWorkspaceStorage-BJwYRxPN.js.map} +1 -1
- package/build/assets/{LogPanel-Bz1GnoRZ.js → LogPanel-9olfEJUH.js} +2 -2
- package/build/assets/{LogPanel-Bz1GnoRZ.js.map → LogPanel-9olfEJUH.js.map} +1 -1
- package/build/assets/{MarkdownEditor-CYM6gJcI.js → MarkdownEditor-bhwZuzhK.js} +2 -2
- package/build/assets/{MarkdownEditor-CYM6gJcI.js.map → MarkdownEditor-bhwZuzhK.js.map} +1 -1
- package/build/assets/{MarkdownNotebook-C3_SMXgK.js → MarkdownNotebook-5JOWkv6a.js} +2 -2
- package/build/assets/{MarkdownNotebook-C3_SMXgK.js.map → MarkdownNotebook-5JOWkv6a.js.map} +1 -1
- package/build/assets/{index-BMfnHEg_.js → index-B5cvSdw-.js} +3 -3
- package/build/assets/{index-BMfnHEg_.js.map → index-B5cvSdw-.js.map} +1 -1
- package/build/assets/{index-B3VTAX4L.js → index-BW9NR34K.js} +5 -5
- package/build/assets/{index-B3VTAX4L.js.map → index-BW9NR34K.js.map} +1 -1
- package/build/assets/{index-C55fbSuA.js → index-BipBKZ6V.js} +2 -2
- package/build/assets/{index-C55fbSuA.js.map → index-BipBKZ6V.js.map} +1 -1
- package/build/index.html +2 -2
- package/package.json +17 -17
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./Plot--bRJIWPY.js","./Plotly-2ZtAYzx5.js","./plotly-Cqt-M9OB.js","./helpers-BosuxZz1.js","./vendor-B05kitGM.js","./vendor-CGsCwcB0.css"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{ao as za,L as R,aP as is,T as Va,X as Ga,Y as qa,V as Xa,a4 as Za,O as Ya,a8 as Qa,z as Ja,d as rs,G as os,e as ss,q as el,aQ as as,aR as tl,aS as nl,a as wn,ac as il,_ as rl,aT as ls,t as ds,Z as ol,aU as sl,u as H,aO as al,aK as us,aL as ll,f as hs,n as dl,aM as Pi,aV as ul,aW as ar,aX as hl,aY as cl,aZ as ml,a_ as vl,v as pl,k as cs,aH as fl,h as vi,aB as gl,a$ as bl,b0 as lr,aF as yl,b1 as dr,b2 as ms,b3 as Cl,aw as wl,b4 as Sl,b5 as _l,b6 as El,b7 as Pl,b8 as Tl,b9 as Ol}from"./index-BMfnHEg_.js";import{r as c,ae as Sn,bn as ei,J as x,bC as xl,D as u,G as Il,H as U,R as Bi,af as b,bp as Dl,I as le,C as vt,bD as Ml,E as vs,ad as Vt,bE as kl,bF as jl,bG as Nl,bA as Ti,_ as Al,bH as O,bI as ur,L as ps,K as fs,bJ as Ll,bB as _n,bx as Yt,bc as Pe,bK as Rl,bf as hr,bL as cr,bM as Fl,be as Ge,bN as gs,bO as $l,by as Ve,bz as At,bP as mr,bd as Hl,bw as Ul,bQ as vn}from"./vendor-B05kitGM.js";var Bl=Object.freeze([]),gg=new Map,bs=()=>{};function bg(n){return Array.isArray(n)?n:[n]}function yg(){for(var n=arguments.length,e=new Array(n),t=0;t<n;t++)e[t]=arguments[t];return e.filter(i=>i!=null)}function Kl(n,e,t){return(e=Wl(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Wl(n){var e=zl(n,"string");return typeof e=="symbol"?e:e+""}function zl(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class vr extends Error{constructor(){super(...arguments),Kl(this,"isCanceled",!0)}}function Vl(n,e,t){return(e=Gl(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Gl(n){var e=ql(n,"string");return typeof e=="symbol"?e:e+""}function ql(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class Xl extends Error{constructor(){super(...arguments),Vl(this,"isClipboardPermissionsDeniedError",!0)}}function Zl(n,e,t){return(e=Yl(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Yl(n){var e=Ql(n,"string");return typeof e=="symbol"?e:e+""}function Ql(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class pi extends Error{constructor(){super(...arguments),Zl(this,"isClipboardUnavailableError",!0)}}function Jl(n,e,t){return(e=ed(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:e+""}function td(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class ys extends Error{constructor(){super(...arguments),Jl(this,"isPermissionUnsupported",!0)}}function pr(n,e,t,i,r,o,s){try{var a=n[o](s),l=a.value}catch(d){return void t(d)}a.done?e(l):Promise.resolve(l).then(i,r)}function nd(n){return function(){var e=this,t=arguments;return new Promise(function(i,r){var o=n.apply(e,t);function s(l){pr(o,i,r,s,a,"next",l)}function a(l){pr(o,i,r,s,a,"throw",l)}s(void 0)})}}function fr(n){return Oi.apply(this,arguments)}function Oi(){return Oi=nd(function*(n){try{var e=n;return(yield navigator.permissions.query({name:e})).state}catch(t){throw t instanceof TypeError?new ys:t}}),Oi.apply(this,arguments)}function gr(n,e,t,i,r,o,s){try{var a=n[o](s),l=a.value}catch(d){return void t(d)}a.done?e(l):Promise.resolve(l).then(i,r)}function Cs(n){return function(){var e=this,t=arguments;return new Promise(function(i,r){var o=n.apply(e,t);function s(l){gr(o,i,r,s,a,"next",l)}function a(l){gr(o,i,r,s,a,"throw",l)}s(void 0)})}}function id(n){return xi.apply(this,arguments)}function xi(){return xi=Cs(function*(n){var{clipboard:e}=navigator;if(e!==void 0)try{return yield navigator.clipboard.writeText(n)}catch{}rd(n)}),xi.apply(this,arguments)}function rd(n){var e=document.activeElement,t=document.createElement("textarea");t.value=n,document.body.appendChild(t),t.focus(),t.select();var i=document.execCommand("copy");if(document.body.removeChild(t),e instanceof HTMLElement&&e.focus(),!i)throw new Error("Unable to execute copy command")}function Cg(){return Ii.apply(this,arguments)}function Ii(){return Ii=Cs(function*(){try{var{clipboard:n}=navigator;if(n===void 0)throw new pi;var e=yield fr("clipboard-read");if(e==="granted"){var t=yield n.readText();return t}if(e==="prompt"){try{yield n.readText()}catch{}if(e=yield fr("clipboard-read"),e==="granted"){var i=yield n.readText();return i}}if(e==="prompt"||e==="denied")throw new Xl}catch(r){throw r instanceof ys?new pi:r}throw new pi}),Ii.apply(this,arguments)}function $t(n,e,t){return(e=od(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:e+""}function sd(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var ad="table_",ws="column_",ld=new Set(["in","not","i","ii","k"]),dd=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"]),ud=/[^a-zA-Z0-9_$\-+@]/g,hd=/[^A-Za-z0-9_$]/g,cd=/^[a-zA-Z_$][a-zA-Z0-9_$\-+@]*$/,md=/[^a-zA-Z0-9_]/g;function vd(n){return n.replace(/[ -]/g,"_")}function pd(n){return n.replace(/\s/g,"_")}class ke{}$t(ke,"legalize",(n,e,t,i,r,o)=>{var s=e(n.trim());return r&&(ld.has(s)||dd.has(s))&&(s=t+s),s=s.replace(i,""),s?(/^[0-9-]/.test(s)&&(s=t+s),s):t+o});$t(ke,"legalizeTableName",n=>ke.legalize(n,pd,ad,ud,!1,0));$t(ke,"makeVariableName",n=>ke.legalizeTableName(n).replace(md,"_"));$t(ke,"legalizeColumnNames",n=>{var e=[];return n.forEach((t,i)=>{var r=ke.legalizeColumnName(t,i);e.includes(r)&&(r=ws+i),e.push(r)}),e});$t(ke,"legalizeColumnName",function(n){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return ke.legalize(n,vd,ws,hd,!0,e)});$t(ke,"isValidTableName",n=>cd.test(n));$t(ke,"isValidColumnName",n=>ke.legalizeColumnName(n)===n);class Ss extends CustomEvent{constructor(e,t){super(e,t)}}class Ue{static makeCancelable(e,t){var i=!1,r,o,s=new Promise((a,l)=>{o=l,Promise.resolve(e).then(d=>{i?t&&t(d):(r=d,a(d))}).catch(d=>l(d))});return s.cancel=()=>{i=!0,o(new vr),r!=null&&t&&t(r)},s}static isCanceled(e){return e instanceof vr}static isTimedOut(e){return e instanceof za}static withTimeout(e,t){return new Promise((i,r)=>{setTimeout(()=>{try{i(t())}catch(o){r(o)}},e)})}}function br(n,e,t){return(e=fd(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:e+""}function gd(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class ti{constructor(){br(this,"pending",[]),br(this,"resolved",[])}add(e,t){var i=Ue.makeCancelable(e,t);return this.pending.push(i),i.then(()=>{this.resolve(i)},()=>{this.resolve(i)}),i}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=[]}}function wg(n){var e=n;n instanceof CustomEvent&&(e=n.detail);var t="";if(e instanceof Error?t=e.message:e!=null&&(t="".concat(e)),t=t.trim(),t.length>0)return t}class Qe{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(!Qe.isValidRange(e))throw new Error("Invalid range! ".concat(e))}static isSelected(e,t){for(var i=0;i<e.length;i+=1){var r=e[i],o=r[0],s=r[1];if(o<=t&&t<=s)return!0}return!1}static selectRange(e,t){for(var[i,r]=t,o=[...e],s=o.length-1;s>=0;s-=1){var a=o[s],l=a[0],d=a[1];if(l<=i&&r<=d)return o;i<=d&&l<=r&&(i=Math.min(i,l),r=Math.max(r,d),o.splice(s,1))}return o.push([i,r]),o}static deselectRange(e,t){for(var[i,r]=t,o=[...e],s=o.length-1;s>=0;s-=1){var a=o[s],l=a[0],d=a[1];if(!(r<l||d<i))if(l<i&&r<d){o[s]=[l,i-1],o.splice(s+1,0,[r+1,d]);break}else i<=l&&d<=r?o.splice(s,1):l<i?o[s]=[l,i-1]:o[s]=[r+1,d]}return o}static count(e){return e.reduce((t,i)=>t+(i[1]-i[0]+1),0)}static getItemsInRanges(e,t){return t.reduce((i,r)=>{for(var o=[...i],s=r[0];s<=r[1];s+=1)o.push(e[s]);return o},[])}}function*Sg(n,e){for(var t=n;t<=e;++t)yield t}var _g=" ";class bd{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 i=e.slice(0,e.length-1).join(", "),r=e[e.length-1];return"".concat(i,", ").concat(t," ").concat(r)}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 i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;return e<t?i?-1:1:e>t?i?1:-1:0}}function _s(n,e,t){return(e=yd(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function yd(n){var e=Cd(n,"string");return typeof e=="symbol"?e:e+""}function Cd(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class sn{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),i=Math.floor(e%3600/60),r=e%60;return"".concat(t>0?"".concat(t,"h "):"")+"".concat(i>0||t>0?"".concat(i,"m "):"")+"".concat(e>=60?"".concat(r,"s").padStart(3,"0"):"".concat(r,"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"),i=e%(60*60),r=String(Math.floor(i/60)).padStart(2,"0"),o=i%60,s=String(Math.ceil(o)).padStart(2,"0");return"".concat(t,":").concat(r,":").concat(s)}static isTimeString(e){return new RegExp(sn.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])}}_s(sn,"TIME_PATTERN","([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]");_s(sn,"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"}]));function wd(n,e,t){return(e=Sd(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Sd(n){var e=_d(n,"string");return typeof e=="symbol"?e:e+""}function _d(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class pn extends Error{constructor(){super(...arguments),wd(this,"isInvalid",!0)}}function Es(){var n=c.useRef(!1);return c.useEffect(()=>(n.current=!0,()=>{n.current=!1}),[]),n}function yr(n,e,t,i,r,o,s){try{var a=n[o](s),l=a.value}catch(d){return void t(d)}a.done?e(l):Promise.resolve(l).then(i,r)}function Ed(n){return function(){var e=this,t=arguments;return new Promise(function(i,r){var o=n.apply(e,t);function s(l){yr(o,i,r,s,a,"next",l)}function a(l){yr(o,i,r,s,a,"throw",l)}s(void 0)})}}var Pd=R.module("useAsyncInterval");function Td(n,e){var t=Es(),i=c.useRef(0),r=c.useRef(0),o=c.useRef(null),s=c.useCallback(Ed(function*(){var a=Date.now();r.current+=1;var l=o.current==null?e:a-o.current;o.current=a;try{yield n()}catch(v){Pd.error("A tick error occurred:",v)}if(t.current){l+=Date.now()-o.current;var d=Math.max(0,l-e),h=Math.max(0,e-d);i.current=window.setTimeout(s,h)}}),[n,t,e]);c.useEffect(()=>(o.current=null,s(),()=>{window.clearTimeout(i.current)}),[e,s])}function En(n){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"No value available in context. Was code wrapped in a provider?",t=c.useContext(n);if(t==null)throw new Error(e);return t}function Od(n,e){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},{leading:i=!1,trailing:r=!0,maxWait:o}=t,s=c.useMemo(()=>Sn(n,e,o!=null?{leading:i,trailing:r,maxWait:o}:{leading:i,trailing:r}),[n,e,i,r,o]);return c.useEffect(()=>()=>s.cancel(),[s]),s}function xd(n){var e=c.useRef();return c.useEffect(function(){e.current=n}),e.current}function Id(n,e,t){var i=c.useRef(t),r=c.useRef(n);r.current=n;var o=c.useMemo(()=>ei(function(){return r.current(...arguments)},e,i.current),[e]);return c.useEffect(()=>()=>{var s,a;(s=(a=i.current)===null||a===void 0?void 0:a.flushOnUnmount)!==null&&s!==void 0&&s?o.flush():o.cancel()},[o]),o}function Ps(n){var e=c.useRef(null);return c.useEffect(function(){n&&(typeof n=="function"?n(e.current):n.current=e.current)}),e}function Cr(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(n);e&&(i=i.filter(function(r){return Object.getOwnPropertyDescriptor(n,r).enumerable})),t.push.apply(t,i)}return t}function Dd(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Cr(Object(t),!0).forEach(function(i){Qt(n,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Cr(Object(t)).forEach(function(i){Object.defineProperty(n,i,Object.getOwnPropertyDescriptor(t,i))})}return n}function Qt(n,e,t){return(e=Md(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Md(n){var e=kd(n,"string");return typeof e=="symbol"?e:e+""}function kd(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var wr="popper";class Pn extends c.Component{constructor(e){super(e),Qt(this,"element",void 0),Qt(this,"container",void 0),Qt(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=x.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:i}=this.props;if(!e&&this.container.current!==null){var{options:r}=this.props;r=Dd({placement:"auto",modifiers:{preventOverflow:{boundariesElement:"viewport"}}},r),document.body.appendChild(this.element);var o=this.getVisibleElement(this.container.current);o==null&&(o=this.container.current),e=new xl(i||o,this.element,r),e.scheduleUpdate(),cancelAnimationFrame(this.rAF),this.rAF=window.requestAnimationFrame(()=>{if(t){var s=this.element.querySelector(".".concat(wr));s instanceof HTMLElement&&!s.contains(document.activeElement)&&s.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:i,interactive:r,closeOnBlur:o}=this.props,{show:s}=this.state;return u.jsx(is,{isPortal:!0,children:u.jsx(Il,{in:s,timeout:i,classNames:"popper-transition",onEntered:this.handleEnter,onExited:this.handleExit,children:u.jsx("div",{onClick:a=>{a.stopPropagation()},onKeyDown:a=>{a.key==="Escape"&&this.hide()},className:U(wr,{interactive:r},e),onBlur:o?this.handleBlur:void 0,tabIndex:o?-1:void 0,role:"presentation",children:u.jsxs("div",{className:"popper-content",children:[t,u.jsx("div",{className:"popper-arrow","x-arrow":""})]})})})})}render(){var{popper:e}=this.state,{"data-testid":t}=this.props;return u.jsx("div",{className:"popper-parent-container",ref:this.container,style:{display:"none"},"data-testid":t,children:e&&Bi.createPortal(this.renderContent(),this.element)})}}Qt(Pn,"propTypes",{children:b.node.isRequired,options:b.shape({}),className:b.string,timeout:b.number,onEntered:b.func,onExited:b.func,isShown:b.bool,closeOnBlur:b.bool,interactive:b.bool,referenceObject:b.shape({}),"data-testid":b.string});Qt(Pn,"defaultProps",{options:{},className:"",timeout:Va.transitionMs,onEntered(){},onExited(){},isShown:!1,interactive:!1,closeOnBlur:!1,referenceObject:null,"data-testid":void 0});function Sr(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(n);e&&(i=i.filter(function(r){return Object.getOwnPropertyDescriptor(n,r).enumerable})),t.push.apply(t,i)}return t}function jd(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Sr(Object(t),!0).forEach(function(i){Je(n,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Sr(Object(t)).forEach(function(i){Object.defineProperty(n,i,Object.getOwnPropertyDescriptor(t,i))})}return n}function Je(n,e,t){return(e=Nd(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Nd(n){var e=Ad(n,"string");return typeof e=="symbol"?e:e+""}function Ad(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var Ld=R.module("Tooltip");class re extends c.Component{static handleHidden(){re.shownTooltipCount-=1,re.shownTooltipCount===0&&(re.lastHiddenTime=Date.now())}static handleShown(){re.shownTooltipCount+=1}constructor(e){super(e),Je(this,"container",void 0),Je(this,"popper",void 0),Je(this,"parent",void 0),Je(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=x.createRef(),this.popper=x.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:i}=t,{isShown:r}=this.state;r!==i&&(r?re.handleShown():re.handleHidden())}componentWillUnmount(){this.stopListening(),this.stopListeningWindow(),this.stopTimer();var{isShown:e}=this.state;e&&re.handleHidden()}startListening(){if(!this.container.current||!this.container.current.parentElement){Ld.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,i=e.clientY,{isShown:r}=this.state;if(!(!this.popper.current||!this.parent)){var o=this.popper.current.element.getBoundingClientRect(),s=this.parent.getBoundingClientRect();t>=o.left&&t<=o.left+o.width&&i>=o.top&&i<=o.top+o.height?this.handleMouseMove():t>=s.left&&t<=s.left+s.width&&i>=s.top&&i<=s.top+s.height?this.handleMouseMove():r&&(this.stopTimer(),this.hide())}}startTimer(){this.stopTimer();var{timeout:e,reshowTimeout:t}=this.props,i=e;(re.shownTooltipCount>0||Date.now()-re.lastHiddenTime<re.triggerReshowThreshold)&&(i=t),this.timer=window.setTimeout(this.handleTimeout,i)}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:i}=this.props;i&&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:i,popperClassName:r,"data-testid":o,onEntered:s}=this.props,{isShown:a}=this.state,{options:l}=this.props;return l=jd({placement:"bottom"},l),u.jsx("div",{ref:this.container,style:{display:"none"},"data-testid":o,children:u.jsx(Pn,{className:U(r,"popper-tooltip"),options:l,ref:this.popper,onEntered:s,onExited:this.handleExited,interactive:e,referenceObject:i,children:u.jsxs("div",{className:"tooltip-content",children:[" ",a&&t]})})})}}Je(re,"defaultTimeout",500);Je(re,"defaultReshowTimeout",100);Je(re,"triggerReshowThreshold",300);Je(re,"shownTooltipCount",0);Je(re,"lastHiddenTime",Date.now());Je(re,"defaultProps",{interactive:!1,options:{},popperClassName:"",reshowTimeout:re.defaultReshowTimeout,timeout:re.defaultTimeout,onEntered:()=>{},onExited:()=>{},"data-testid":void 0});var Rd=R.module("ThemeProvider"),Ki=c.createContext(null);Ki.displayName="ThemeContext";function Eg(n){var{themes:e,waitForActivation:t=!1,defaultPreloadValues:i=Ja,children:r}=n,o=c.useMemo(()=>Ga(),[]),[s,a]=c.useState(null),[l,d]=c.useState(qa),h=c.useMemo(()=>e==null?null:Xa(l,{base:o,custom:e??[]}),[o,l,e]),v=c.useMemo(()=>[...o,...e??[]],[o,e]);return c.useEffect(function(){if(!(h==null||e==null)){Za(i);var p=Ya(i);Rd.debug2("updateThemePreloadData:",{active:h.map(f=>f.themeKey),custom:e.map(f=>f.themeKey),preloadStyleContent:p,selectedThemeKey:l}),Qa({themeKey:l,preloadStyleContent:p})}},[h,l,e,i]),c.useEffect(()=>{a({activeThemes:h,selectedThemeKey:l,themes:v,setSelectedThemeKey:d})},[h,l,v]),t&&h==null?null:u.jsxs(u.Fragment,{children:[h==null?null:u.jsx(u.Fragment,{children:h.map(m=>u.jsx("style",{"data-theme-key":m.themeKey,children:m.styleContent},m.themeKey))}),s==null?null:u.jsx(Ki.Provider,{value:s,children:u.jsx(is,{children:r})})]})}function Ts(){return En(Ki,"No ThemeContext value found. Component must be wrapped in a ThemeContext.Provider")}function ni(n){var{children:e,className:t,style:i,"data-testid":r}=n;return u.jsx("div",{className:U("btn-group",t),style:i,role:"group","data-testid":r,children:e})}ni.displayName="SplitButtonGroup";ni.propTypes={children:b.node.isRequired,className:b.string,style:b.object,"data-testid":b.string};ni.defaultProps={className:null,style:{},"data-testid":void 0};var Fd=["kind","variant","type","tooltip","icon","disabled","active","onClick","onContextMenu","onMouseDown","onMouseUp","onMouseEnter","onMouseLeave","onKeyDown","className","style","children","tabIndex","data-testid","aria-label"];function _r(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(n);e&&(i=i.filter(function(r){return Object.getOwnPropertyDescriptor(n,r).enumerable})),t.push.apply(t,i)}return t}function Er(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?_r(Object(t),!0).forEach(function(i){$d(n,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):_r(Object(t)).forEach(function(i){Object.defineProperty(n,i,Object.getOwnPropertyDescriptor(t,i))})}return n}function $d(n,e,t){return(e=Hd(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Hd(n){var e=Ud(n,"string");return typeof e=="symbol"?e:e+""}function Ud(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function Bd(n,e){if(n==null)return{};var t,i,r=Kd(n,e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(n);for(i=0;i<o.length;i++)t=o[i],e.indexOf(t)===-1&&{}.propertyIsEnumerable.call(n,t)&&(r[t]=n[t])}return r}function Kd(n,e){if(n==null)return{};var t={};for(var i in n)if({}.hasOwnProperty.call(n,i)){if(e.indexOf(i)!==-1)continue;t[i]=n[i]}return t}var Wd=["primary","secondary","tertiary","success","danger","inline","ghost"],zd=["group-end"];function Vd(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 U("btn-link",{"btn-link-icon":e,"btn-link-icon-only":e})}}function Gd(n){switch(n){case"group-end":return U("pl-2","pr-3")}}var Q=x.forwardRef((n,e)=>{var{kind:t,variant:i,type:r,tooltip:o,icon:s,disabled:a=!1,active:l,onClick:d,onContextMenu:h,onMouseDown:v,onMouseUp:m,onMouseEnter:p,onMouseLeave:f,onKeyDown:g,className:y,style:S,children:_,tabIndex:C,"data-testid":D,"aria-label":W}=n,X=Bd(n,Fd),{UNSAFE_className:I}=Dl({},"button"),V;i&&(V=Gd(i));var A;s&&(A=x.isValidElement(s)?s:u.jsx(le,{icon:s}));var J=A!=null&&_==null,ee=Vd(t,J),j;o!==void 0&&(j=typeof o=="string"?u.jsx(re,{children:o}):o);var G=W;W===void 0&&J&&o!=null&&typeof o=="string"&&(G=o);var F=u.jsxs("button",Er(Er({"data-testid":D,ref:e,type:r,className:U("btn",ee,V,{active:l},y,I),onClick:d,onContextMenu:h,onMouseUp:m,onMouseDown:v,onMouseEnter:p,onMouseLeave:f,onKeyDown:g,style:S,disabled:a,tabIndex:C,"aria-label":G},X),{},{children:[s&&A,_,o!=null&&!a&&j]}));return a&&o!=null?u.jsxs("span",{className:"btn-disabled-wrapper",children:[F,j]}):F});Q.displayName="Button";Q.propTypes={kind:b.oneOf(Wd).isRequired,variant:b.oneOf(zd),type:b.oneOf(["submit","reset","button"]),tooltip(n){var{tooltip:e,icon:t,children:i}=n;return e===void 0&&t!=null&&i==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&&!x.isValidElement(t)&&(t==null||t.iconName===""||t.iconName==null)?new Error("Icon must be react element or fontawesome IconDefinition"):null},disabled:b.bool,active:b.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:b.func,onMouseUp:b.func,onMouseDown:b.func,onMouseEnter:b.func,onMouseLeave:b.func,onKeyDown:b.func,tabIndex:b.number,children:b.node,className:b.string,style:b.object,"data-testid":b.string};Q.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};function Os(n){var{className:e,children:t,"data-testid":i}=n;return u.jsx("div",{className:U("modal-footer",e),"data-testid":i,children:t})}function bn(n){var{isOpen:e,headerText:t,bodyText:i,onCancel:r,onConfirm:o,onDiscard:s,onModalDisable:a,cancelButtonText:l="Cancel",confirmButtonText:d="Okay",discardButtonText:h="Discard",isConfirmDanger:v=!1,children:m,"data-testid":p}=n,f=c.useRef(null),g=c.useRef(null),y=c.useCallback(()=>{g.current!==null&&g.current.checked&&a&&a(),o()},[o,a]),S=c.useCallback(()=>{var C;(C=f.current)===null||C===void 0||C.focus()},[]),_="";return e&&(_=typeof i=="function"?i():i),u.jsxs(rs,{isOpen:e,onOpened:S,children:[u.jsx(os,{closeButton:!1,children:t}),u.jsx(ss,{children:_}),u.jsxs(Os,{children:[a&&u.jsxs("div",{className:"custom-control custom-checkbox form-group mr-auto",children:[u.jsx("input",{type:"checkbox",className:"custom-control-input",id:"move-confirmation-checkbox",defaultChecked:!1,ref:g,"data-testid":p!==void 0?"".concat(p,"-checkbox-confirm"):void 0}),u.jsx("label",{className:"custom-control-label",htmlFor:"move-confirmation-checkbox",children:"Don't ask me again"})]}),s&&u.jsx(Q,{kind:"secondary",className:"mr-auto","data-dismiss":"modal",onClick:s,"data-testid":p!==void 0?"".concat(p,"-btn-discard"):void 0,children:h}),r&&u.jsx(Q,{kind:"secondary","data-dismiss":"modal",onClick:r,"data-testid":p!==void 0?"".concat(p,"-btn-cancel"):void 0,children:l}),u.jsxs(ni,{children:[u.jsx(Q,{kind:v?"danger":"primary",onClick:y,ref:f,"data-testid":p!==void 0?"".concat(p,"-btn-confirm"):void 0,children:d}),m]})]})]})}bn.propTypes={isOpen:b.bool.isRequired,headerText:b.string.isRequired,bodyText:b.oneOfType([b.string,b.func]).isRequired,onCancel:b.func,onConfirm:b.func.isRequired,onDiscard:b.func,onModalDisable:b.func,cancelButtonText:b.string,confirmButtonText:b.string,discardButtonText:b.string,children:b.node,"data-testid":b.string};bn.defaultProps={children:void 0,cancelButtonText:"Cancel",confirmButtonText:"Okay",discardButtonText:"Discard",onCancel:void 0,onDiscard:void 0,onModalDisable:void 0,"data-testid":void 0};function qd(n,e,t){return(e=Xd(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Xd(n){var e=Zd(n,"string");return typeof e=="symbol"?e:e+""}function Zd(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function fi(n){return n.then!==void 0}class ce{static disableAllActions(){ce.actionsDisabled=!0}static enableAllActions(){ce.actionsDisabled=!1}static isContextActionEvent(e){return Array.isArray(e.contextActions)}static compareActions(e,t){if(e.group!==t.group){var i,r;return((i=e.group)!==null&&i!==void 0?i:0)>((r=t.group)!==null&&r!==void 0?r:0)?1:-1}if(e.order!==t.order){var o,s;return((o=e.order)!==null&&o!==void 0?o:0)>((s=t.order)!==null&&s!==void 0?s:0)?1:-1}if(e.title!==t.title){var a,l;return((a=e.title)!==null&&a!==void 0?a:"")>((l=t.title)!==null&&l!==void 0?l:"")?1:-1}return e!==t?e>t?1:-1:0}static sortActions(e){if(e==null||!Array.isArray(e))return[];var t=e.slice();return t.sort(ce.compareActions),t}static isMacPlatform(){var{platform:e}=window.navigator;return e.startsWith("Mac")}static getModifierKey(){return ce.isMacPlatform()?"metaKey":"ctrlKey"}static isModifierKeyDown(e){var t=ce.getModifierKey();return e[t]}static getMenuItems(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,i=[],r=e;Array.isArray(r)||(r=[r]);for(var o=0;o<r.length;o+=1){var s=r[o],a=void 0;typeof s=="function"?a=s():a=s,a!=null&&(a instanceof Promise?t&&i.push(a):Array.isArray(a)?i=i.concat(a):i.push(a))}return i=i.filter(l=>l.title!==void 0||l.then!=null||l.menuElement),i}static getNextMenuItem(e,t,i){var r=e;r<0&&t<0&&(r=i.length);for(var o=1;o<i.length+1;o+=1){var s=(r+t*o+i.length)%i.length,a=i[s];if(!(a instanceof Promise)&&a.disabled!==!0)return s}return e}}qd(ce,"actionsDisabled",!1);var Pr=R.module("GlobalContextAction");class Yd extends c.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:i}=this.props;i.title==null&&!i.menuElement||(t.contextActions==null&&(t.contextActions=[]),t.contextActions.push(i),Pr.debug("Received context menu event at global action! Menu items are now: ",t.contextActions))}handleKeyDown(e){var{action:t}=this.props;if(!ce.actionsDisabled&&t.shortcut!==void 0&&t.shortcut.matchesEvent(e)){var i;Pr.debug("Global hotkey matched!",e),(i=t.action)===null||i===void 0||i.call(t,e),e.preventDefault(),e.stopPropagation()}}render(){return null}}class Qd extends c.Component{render(){for(var{actions:e,"data-testid":t}=this.props,i=[],r=0;r<e.length;r+=1){var o=e[r],{shortcut:s}=o;if(o.title!=null||o.menuElement||s){var a=u.jsx(Yd,{action:o,"data-testid":t},"".concat(o.title,".").concat(s==null?void 0:s.id));i.push(a)}}return i}}function xs(n,e,t){return(e=Jd(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Jd(n){var e=eu(n,"string");return typeof e=="symbol"?e:e+""}function eu(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var kn=R.module("ContextActions");class oe extends c.Component{static triggerMenu(e,t,i,r){if(r.length!==0){var o=new MouseEvent("contextmenu",{clientX:t,clientY:i,bubbles:!0,cancelable:!0});o.contextActions=r,e.dispatchEvent(o)}}constructor(e){super(e),xs(this,"container",void 0),this.handleContextMenu=this.handleContextMenu.bind(this),this.handleKeyDown=this.handleKeyDown.bind(this),this.container=x.createRef(),this.state={globalActions:[],keyboardActions:[]}}static getDerivedStateFromProps(e){if(e.actions==null||!Array.isArray(e.actions))return{globalActions:[],keyboardActions:[]};var t=e.actions.filter(r=>!fi(r)&&typeof r!="function"&&r.isGlobal),i=e.actions.filter(r=>!fi(r)&&typeof r!="function"&&(r.isGlobal===void 0||!r.isGlobal)&&r.shortcut!=null);return{globalActions:t,keyboardActions:i}}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 i=e.target,r=function(){var{classList:d}=i,h=t.find(v=>d.contains(v));if(h!==void 0)return kn.debug2('Contextmenu event ignored based on the target className "'.concat(h,'"')),{v:void 0};i=i.parentElement};i!=null;){var o=r();if(typeof o=="object")return o.v}if(ce.isContextActionEvent(e)||(e.contextActions=[]),!!ce.isContextActionEvent(e)){var{actions:s}=this.props;if(s!=null){var a=s;Array.isArray(a)&&(a=a.filter(l=>fi(l)||typeof l=="function"||l.isGlobal===void 0||!l.isGlobal)),e.contextActions=e.contextActions.concat(a)}kn.debug("Received context menu event! Menu items are now: ",e.contextActions)}}handleKeyDown(e){for(var{keyboardActions:t}=this.state,i=0;i<t.length;i+=1){var r=t[i];if(!ce.actionsDisabled&&r.shortcut!=null&&r.shortcut.matchesEvent(e)){var o;kn.debug("Context hotkey matched!",e),(o=r.action)===null||o===void 0||o.call(r,e),e.stopPropagation(),e.preventDefault(),kn.debug2("Matched hotkey returned false, key event not consumed")}}}render(){var{"data-testid":e}=this.props,{globalActions:t}=this.state;return u.jsx("div",{className:"context-actions-listener",ref:this.container,"data-testid":e,children:u.jsx(Qd,{actions:t})})}}xs(oe,"groups",{default:void 0,high:100,medium:5e3,low:1e4,global:1e5,edit:100});var Wi=x.forwardRef((n,e)=>{var t,i;function r(I){var{menuItem:V,onMenuItemClick:A}=n;A(V,I)}function o(I){var{menuItem:V,onMenuItemMouseMove:A}=n;A(V,I)}function s(I){var{menuItem:V,onMenuItemContextMenu:A}=n;A(V,I)}function a(I,V,A){if(typeof I.type=="string")return I;var{closeMenu:J,menuItem:ee,isKeyboardSelected:j,isMouseSelected:G,"data-testid":F}=n,M={menuItem:ee,closeMenu:J,isKeyboardSelected:j,isMouseSelected:G,iconElement:V,displayShortcut:A,"data-testid":F};return x.cloneElement(I,{forwardedProps:M})}var{children:l,menuItem:d,isKeyboardSelected:h=!1,isMouseSelected:v=!1,"data-testid":m}=n,p=(t=d.shortcutText)!==null&&t!==void 0?t:(i=d.shortcut)===null||i===void 0?void 0:i.getDisplayText(),f=null;if(d.icon){var g=d.icon;if(x.isValidElement(g))f=g;else{var y;d.iconColor!=null&&(d.disabled===void 0||!d.disabled)&&(y={color:d.iconColor}),f=u.jsx(le,{icon:g,style:y})}}var S=null,_=!!l;d.actions&&(S=u.jsx(le,{icon:el}));var C=null;if(d.menuElement)C=u.jsx("div",{className:"custom-menu-item",onMouseMove:o,children:a(d.menuElement,f,p)});else{var D,W=d.disabled,X=d.iconOutline;C=u.jsx("button",{type:"button",className:U("btn-context-menu",{disabled:W},{active:(_||v)&&(W===void 0||!W)},{"keyboard-active":h&&(W===void 0||!W)}),onClick:r,onMouseMove:o,onContextMenu:s,title:(D=d.description)!==null&&D!==void 0?D:"",children:u.jsxs("div",{className:"btn-context-menu-wrapper",children:[u.jsx("span",{className:U("icon",{outline:X}),children:f}),u.jsx("span",{className:"title",children:d.title}),p!==void 0&&u.jsx("span",{className:"shortcut",children:p}),S&&u.jsx("span",{className:U("submenu-indicator",{disabled:W}),children:S})]})})}return u.jsxs("div",{className:"context-menu-item",ref:e,"data-testid":m,children:[l,C]})});Wi.displayName="ContextMenuItem";Wi.defaultProps={children:null,isKeyboardSelected:!1,isMouseSelected:!1,"data-testid":void 0};var ii=x.forwardRef((n,e)=>{var{checked:t=!1,children:i,className:r,disabled:o,inputClassName:s,isInvalid:a,labelClassName:l,name:d,onChange:h,"data-testid":v}=n,[m]=c.useState(vt()),p=Ps(e);c.useEffect(function(){p.current&&(p.current.indeterminate=t===null)},[p,t]);var f=c.useCallback(g=>{p.current&&(p.current.indeterminate=t===null),h&&h(g)},[p,t,h]);return u.jsxs("div",{className:U("custom-control custom-checkbox",r),children:[u.jsx("input",{type:"checkbox",ref:p,checked:t??!1,className:U("custom-control-input",s,{"is-invalid":a}),disabled:o,id:m,name:d,onChange:f,"data-testid":v}),u.jsx("label",{className:U("custom-control-label",l),htmlFor:m,children:i})]})});ii.displayName="Checkbox";ii.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:b.node.isRequired,className:b.string,disabled:b.bool,inputClassName:b.string,isInvalid:b.bool,labelClassName:b.string,name:b.string,onChange:b.func,"data-testid":b.string};ii.defaultProps={checked:!1,className:"",disabled:!1,inputClassName:"",isInvalid:!1,labelClassName:"",name:void 0,onChange:void 0,"data-testid":void 0};function Vn(n){return(n==null?void 0:n.WrappedComponent)!==void 0}function Is(n){return Vn(n)&&Is(n.WrappedComponent)?!0:n.prototype!=null&&n.prototype.isReactComponent!=null}function tu(n){return!Vn(n)&&"$$typeof"in n&&n.$$typeof===Ml.ForwardRef}function Ds(n){return Is(n)||tu(n)}function Tr(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(n);e&&(i=i.filter(function(r){return Object.getOwnPropertyDescriptor(n,r).enumerable})),t.push.apply(t,i)}return t}function nu(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Tr(Object(t),!0).forEach(function(i){fn(n,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Tr(Object(t)).forEach(function(i){Object.defineProperty(n,i,Object.getOwnPropertyDescriptor(t,i))})}return n}function fn(n,e,t){return(e=iu(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function iu(n){var e=ru(n,"string");return typeof e=="symbol"?e:e+""}function ru(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class Ms extends c.PureComponent{constructor(e){var t;super(e),fn(this,"container",void 0),fn(this,"oldFocus",void 0),fn(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=x.createRef(),this.oldFocus=document.activeElement,this.rAF=0;var{options:i}=e,r=(t=i.initialKeyboardIndex)!==null&&t!==void 0?t:-1;this.state={menuItems:[],keyboardIndex:r,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=ce.getMenuItems(e,!1);t.length>0&&this.setState(i=>({menuItems:ce.sortActions(i.menuItems.concat(t))}))}handleKeyDown(e){var{menuItems:t}=this.state,i=this.getKeyboardIndex(),r=i;if(e.key==="Enter"||e.key===" "){i!=null&&i>=0&&i<t.length&&this.handleMenuItemClick(t[i],e);return}if(e.key==="Escape")r=null;else if(e.key==="ArrowUp"||e.key==="Tab"&&e.shiftKey===!0){var o;r=ce.getNextMenuItem((o=r)!==null&&o!==void 0?o:0,-1,t)}else if(e.key==="ArrowDown"||e.key==="Tab"&&e.shiftKey===!1){var s;r=ce.getNextMenuItem((s=r)!==null&&s!==void 0?s:0,1,t)}i!==r&&(r!==null?this.setKeyboardIndex(r):(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:i}=this.props;cancelAnimationFrame(this.rAF),this.rAF=window.requestAnimationFrame(()=>{t(e),i(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,i=t.indexOf(e);this.setMouseIndex(i)}handleMouseLeave(){this.setMouseIndex(-1)}render(){for(var e=[],{"data-testid":t}=this.props,{keyboardIndex:i,menuItems:r,mouseIndex:o}=this.state,s=0;s<r.length;s+=1){var a=r[s];s>0&&a.group!==r[s-1].group&&e.push(u.jsx("hr",{},"".concat(s,".separator")));var l=u.jsx(Wi,{isKeyboardSelected:i===s,isMouseSelected:o===s,menuItem:a,closeMenu:this.handleCloseMenu,onMenuItemClick:this.handleMenuItemClick,onMenuItemMouseMove:this.handleMenuItemMouseMove,onMenuItemContextMenu:()=>!1},s);e.push(l)}var{menuStyle:d}=this.props;return u.jsx("div",{className:"context-menu-container",style:nu({},d),ref:this.container,onKeyDown:this.handleKeyDown,onMouseLeave:this.handleMouseLeave,role:"menuitem",tabIndex:0,"data-testid":t,children:e})}}fn(Ms,"defaultProps",{closeMenu(){},onMenuOpened(){},onMenuClosed(){},options:{},menuStyle:{},"data-testid":void 0});function Or(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(n);e&&(i=i.filter(function(r){return Object.getOwnPropertyDescriptor(n,r).enumerable})),t.push.apply(t,i)}return t}function xr(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Or(Object(t),!0).forEach(function(i){Gt(n,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Or(Object(t)).forEach(function(i){Object.defineProperty(n,i,Object.getOwnPropertyDescriptor(t,i))})}return n}function Gt(n,e,t){return(e=ou(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function ou(n){var e=su(n,"string");return typeof e=="symbol"?e:e+""}function su(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class ri extends c.PureComponent{constructor(e){super(e),Gt(this,"container",void 0),Gt(this,"parent",void 0),Gt(this,"popper",void 0),Gt(this,"isOpen",void 0),this.handleClick=this.handleClick.bind(this),this.handleCloseMenu=this.handleCloseMenu.bind(this),this.handleExited=this.handleExited.bind(this),this.container=x.createRef(),this.parent=null,this.popper=x.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:i,"data-testid":r}=this.props,{menuStyle:o}=this.props,{options:s,popperOptions:a}=this.props;return a=xr({placement:"bottom"},a),s=xr({separateKeyboardMouse:!0},s),u.jsx("div",{className:"menu-actions-listener",ref:this.container,"data-testid":r,children:u.jsx(Pn,{ref:this.popper,options:a,className:U("menu-popper",i),onExited:this.handleExited,closeOnBlur:!0,interactive:!0,children:u.jsx(Ms,{actions:e,closeMenu:this.handleCloseMenu,onMenuOpened:t,options:s,menuStyle:o})})})}}Gt(ri,"defaultProps",{isShown:null,onMenuClosed(){},onMenuOpened(){},options:{},popperOptions:{},popperClassName:"",menuStyle:{},"data-testid":void 0});function wt(n,e,t){return(e=au(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function au(n){var e=lu(n,"string");return typeof e=="symbol"?e:e+""}function lu(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var Ir=R.module("Shortcut"),P;(function(n){n.CTRL="MODIFIER_CTRL",n.CMD="MODIFIER_CMD",n.ALT="MODIFIER_ALT",n.OPTION="MODIFIER_OPTION",n.SHIFT="MODIFIER_SHIFT"})(P||(P={}));var w;(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"})(w||(w={}));var du=new Set([w.ENTER,w.DELETE,w.F1,w.F2,w.F3,w.F4,w.F5,w.F6,w.F7,w.F8,w.F9,w.F10,w.F11,w.F12]);class de extends vs{static isAllowedKey(e){return Object.values(w).includes(e)}static isValidKeyState(e){var{keyValue:t}=e;if(t===null)return!0;if(!de.isMacPlatform&&e.metaKey||!de.isAllowedKey(t))return!1;var i=!e.altKey&&!e.ctrlKey&&!e.metaKey&&!e.shiftKey;return!i||du.has(t)}static createKeyState(e){var t={altKey:!1,ctrlKey:!1,metaKey:!1,shiftKey:!1,keyValue:e[e.length-1]};return e.forEach(i=>{switch(i){case P.CTRL:t.ctrlKey=!0;break;case P.ALT:case P.OPTION:t.altKey=!0;break;case P.CMD:t.metaKey=!0;break;case P.SHIFT:t.shiftKey=!0;break}}),t}static getKeyStateFromEvent(e){var{key:t,keyCode:i}=e,r="";return t==="Shift"||t==="Meta"||t==="Control"||t==="Alt"?r="":!de.isAllowedKey(t)&&de.isAllowedKey(String.fromCharCode(i))?r=String.fromCharCode(i):r=t,{keyValue:r,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===w.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 w.ENTER:t+="⏎";break;case w.ESCAPE:t+="⎋";break;case w.BACKSPACE:t+="⌫";break;case w.DELETE:t+="⌦";break;case null:break;default:t+=e.keyValue}return t}static doKeyStatesMatch(e,t){var i,r;return((i=e.keyValue)===null||i===void 0?void 0:i.toUpperCase())===((r=t.keyValue)===null||r===void 0?void 0:r.toUpperCase())&&e.altKey===t.altKey&&e.ctrlKey===t.ctrlKey&&e.metaKey===t.metaKey&&e.shiftKey===t.shiftKey}static getDisplayText(e){return e.keyValue===null?"":de.isMacPlatform?de.getMacDisplayText(e):de.getWindowsDisplayText(e)}constructor(e){var{id:t,shortcut:i,macShortcut:r,isEditable:o=!0,name:s,tooltip:a}=e;super(),wt(this,"id",void 0),wt(this,"name",void 0),wt(this,"tooltip",void 0),wt(this,"isEditable",void 0),wt(this,"defaultKeyState",void 0),wt(this,"keyState",void 0),this.id=t,this.name=s,this.tooltip=a,this.isEditable=o;var l=de.isMacPlatform,d=l?r:i;this.defaultKeyState=de.createKeyState(d),this.keyState=this.defaultKeyState}getDisplayText(){return de.getDisplayText(this.keyState)}getKeyState(){return this.keyState}setKeyState(e){de.isValidKeyState(e)?(Ir.debug2("Shortcut ".concat(this.id," updated to ").concat(JSON.stringify(e))),this.keyState=e,this.dispatchEvent(new Ss("onUpdate",{detail:this}))):Ir.debug2("Shortcut ".concat(this.id," tried to update to invalid keyState ").concat(JSON.stringify(e)))}getDefaultKeyState(){return this.defaultKeyState}isDefault(){return de.doKeyStatesMatch(this.getDefaultKeyState(),this.getKeyState())}setToNull(){this.setKeyState(de.NULL_KEY_STATE)}isNull(){return de.doKeyStatesMatch(this.keyState,de.NULL_KEY_STATE)}setToDefault(){this.setKeyState(this.defaultKeyState)}matchesKeyState(e){return de.doKeyStatesMatch(e,this.keyState)}matchesEvent(e){return this.matchesKeyState(de.getKeyStateFromEvent(e))}}wt(de,"NULL_KEY_STATE",{metaKey:!1,shiftKey:!1,altKey:!1,ctrlKey:!1,keyValue:null});wt(de,"isMacPlatform",ce.isMacPlatform());function Dr(n,e,t){return(e=uu(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function uu(n){var e=hu(n,"string");return typeof e=="symbol"?e:e+""}function hu(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var Mr=R.module("ShortcutRegistry");class cu extends vs{constructor(){super(...arguments),Dr(this,"shortcutMap",new Map),Dr(this,"shortcutsByCategory",new Map)}createAndAdd(e){var t=new de(e);return this.add(t)}add(e){var t=this.shortcutMap.get(e.id);if(t)return Mr.warn("Skipping attempt to add duplicate shortcut ID to registry: ".concat(e.id)),t;Mr.debug2("Adding shortcut to registry: ".concat(e.id)),e.addEventListener("onUpdate",o=>{var{detail:s}=o;return this.dispatchEvent(new Ss("onUpdate",{detail:s}))});var i=e.id.split(".")[0];if(this.shortcutMap.set(e.id,e),this.shortcutsByCategory.has(i)){var r;(r=this.shortcutsByCategory.get(i))===null||r===void 0||r.push(e)}else this.shortcutsByCategory.set(i,[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 ie=Object.freeze(new cu),qt={COPY:ie.createAndAdd({id:"GLOBAL.COPY",name:"Copy",shortcut:[P.CTRL,w.C],macShortcut:[P.CMD,w.C],isEditable:!1}),PASTE:ie.createAndAdd({id:"GLOBAL.PASTE",name:"Paste",shortcut:[P.CTRL,w.V],macShortcut:[P.CMD,w.V],isEditable:!1}),SAVE:ie.createAndAdd({id:"GLOBAL.SAVE",name:"Save",shortcut:[P.CTRL,w.S],macShortcut:[P.CMD,w.S],isEditable:!1}),SELECT_ALL:ie.createAndAdd({id:"GLOBAL.SELECT_ALL",name:"Select All",shortcut:[P.CTRL,w.A],macShortcut:[P.CMD,w.A],isEditable:!1}),REOPEN_CLOSED_PANEL:ie.createAndAdd({id:"GLOBAL.REOPEN_CLOSED_PANEL",name:"Re-open Closed Panel",shortcut:[P.ALT,P.SHIFT,w.T],macShortcut:[P.OPTION,P.SHIFT,w.T],isEditable:!0}),LINKER:ie.createAndAdd({id:"GLOBAL.LINKER",name:"Linker",shortcut:[P.CTRL,w.L],macShortcut:[P.CMD,w.L]}),LINKER_CLOSE:ie.createAndAdd({id:"GLOBAL.LINKER_CLOSE",name:"Close Linker Overlay",shortcut:[w.ESCAPE],macShortcut:[w.ESCAPE],isEditable:!1}),COPY_VERSION_INFO:ie.createAndAdd({id:"GLOBAL.COPY_VERSION_INFO",name:"Copy Version Info",shortcut:[P.CTRL,P.ALT,w.I],macShortcut:[P.CMD,P.SHIFT,w.I],isEditable:!0}),EXPORT_LOGS:ie.createAndAdd({id:"GLOBAL.EXPORT_LOGS",name:"Export Logs",shortcut:[P.CTRL,P.ALT,P.SHIFT,w.L],macShortcut:[P.CMD,P.OPTION,P.SHIFT,w.L],isEditable:!0}),OPEN_DASHBOARD_LIST:ie.createAndAdd({id:"GLOBAL.OPEN_DASHBOARD_LIST",name:"Open Dashboard List",shortcut:[P.CTRL,P.SHIFT,w.D],macShortcut:[P.CMD,P.SHIFT,w.D],isEditable:!0}),NEXT:ie.createAndAdd({id:"GLOBAL.NEXT",name:"Next",shortcut:[w.ENTER],macShortcut:[w.ENTER],isEditable:!1}),PREVIOUS:ie.createAndAdd({id:"GLOBAL.PREVIOUS",name:"Previous",shortcut:[P.SHIFT,w.ENTER],macShortcut:[P.SHIFT,w.ENTER],isEditable:!1})};function Di(n,e,t){return(e=mu(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function mu(n){var e=vu(n,"string");return typeof e=="symbol"?e:e+""}function vu(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class oi extends c.PureComponent{constructor(e){super(e),Di(this,"inputField",void 0),Di(this,"searchChangeSelection",void 0),this.inputField=x.createRef(),this.searchChangeSelection=x.createRef()}componentDidMount(){this.setInputPaddingRight()}componentDidUpdate(){this.setInputPaddingRight()}focus(){var e;(e=this.inputField.current)===null||e===void 0||e.focus()}select(){var e;(e=this.inputField.current)===null||e===void 0||e.select()}setInputPaddingRight(){var e=this.inputField.current,t=this.searchChangeSelection.current;if(e&&t){var i=t.getBoundingClientRect().width;e.style.paddingRight="".concat(i,"px")}}render(){var{value:e,placeholder:t,endPlaceholder:i,onBlur:r,onChange:o,className:s,disabled:a,matchCount:l,id:d,onKeyDown:h,"data-testid":v,cursor:m}=this.props,p,f=[{action:()=>m==null?void 0:m.next("forward"),shortcut:qt.NEXT},{action:()=>m==null?void 0:m.next("back"),shortcut:qt.PREVIOUS}];return m&&l>1?p=u.jsxs(u.Fragment,{children:[u.jsx(Q,{kind:"ghost",className:"search-change-button",type:"button",onClick:()=>{m.next("back")},icon:as,tooltip:"Previous match (".concat(qt.PREVIOUS.getDisplayText(),")")}),u.jsxs("span",{className:"search-change-text",children:[m.index!==void 0&&"".concat(m.index+1," of "),l]}),u.jsx(Q,{kind:"ghost",className:"search-change-button",type:"button",onClick:()=>{m.next("forward")},icon:tl,tooltip:"Next match (".concat(qt.NEXT.getDisplayText(),")")})]}):p=l>0&&u.jsx("span",{className:"search-match",children:l}),u.jsxs("div",{className:U("search-group",s),children:[u.jsx("input",{type:"search",value:e,onBlur:r,onChange:o,onKeyDown:h,className:"form-control",disabled:a,placeholder:t,ref:this.inputField,id:d,"data-testid":v}),l!=null?u.jsxs(u.Fragment,{children:[u.jsx("div",{className:"search-change-selection",ref:this.searchChangeSelection,children:p}),u.jsx(oe,{actions:f})]}):u.jsxs("span",{className:"search-end-content",children:[(i??"")!==""&&e===""&&u.jsx("span",{className:"search-end-placeholder",children:i}),u.jsx(le,{icon:nl})]})]})}}Di(oi,"defaultProps",{placeholder:"Search",className:"",matchCount:null,onKeyDown(){},id:"","data-testid":void 0,cursor:void 0});function ks(n,e,t){return(e=pu(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function pu(n){var e=fu(n,"string");return typeof e=="symbol"?e:e+""}function fu(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class js extends c.PureComponent{constructor(e){super(e),ks(this,"searchInput",void 0),this.searchInput=x.createRef(),this.handleChange=this.handleChange.bind(this),this.sendUpdate=Sn(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:i,id:r,"data-testid":o}=this.props,{value:s}=this.state;return u.jsx(oi,{value:s,placeholder:e,onChange:this.handleChange,className:t,matchCount:i,ref:this.searchInput,id:r,"data-testid":o})}}ks(js,"defaultProps",{placeholder:"Search",className:"",matchCount:null,debounceMs:250,id:"","data-testid":void 0});function Ns(n,e,t){return(e=gu(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function gu(n){var e=bu(n,"string");return typeof e=="symbol"?e:e+""}function bu(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var yu=R.module("ItemListItem");class si extends c.Component{static handleKeyDown(){return yu.log("ItemListItem.handleKeyDown false"),!1}constructor(e){super(e),Ns(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=x.createRef()}handleBlur(e){var{itemIndex:t,onBlur:i}=this.props;i(t,e)}handleFocus(e){var{itemIndex:t,onFocus:i}=this.props;i(t,e)}handleClick(e){var{itemIndex:t,onClick:i}=this.props;i(t,e)}handleContextMenu(e){var{itemIndex:t,onContextMenu:i}=this.props;i(t,e)}handleDragStart(e){var{itemIndex:t,onDragStart:i}=this.props;i(t,e)}handleDrag(e){var{itemIndex:t,onDrag:i}=this.props;i(t,e)}handleDragOver(e){e.preventDefault();var{itemIndex:t,onDragOver:i}=this.props;i(t,e)}handleDragEnd(e){var{itemIndex:t,onDragEnd:i}=this.props;i(t,e)}handleDrop(e){var{itemIndex:t,onDrop:i}=this.props;i(t,e)}handleDoubleClick(e){var{itemIndex:t,onDoubleClick:i}=this.props;i(t,e)}handleMouseMove(e){var{itemIndex:t,onMouseMove:i}=this.props;i(t,e)}handleMouseDown(e){var{itemIndex:t,onMouseDown:i}=this.props;i(t,e)}handleMouseUp(e){var{itemIndex:t,onMouseUp:i}=this.props;i(t,e)}render(){var{isDraggable:e,isFocused:t,isSelected:i,style:r,children:o,"data-testid":s}=this.props;return u.jsx("div",{className:U("item-list-item",{active:i},{"is-focused":t},{"is-draggable":e}),onKeyDown:si.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:r,onFocus:this.handleFocus,onBlur:this.handleBlur,draggable:e,"data-testid":s,children:o})}}Ns(si,"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:{}});function kr(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(n);e&&(i=i.filter(function(r){return Object.getOwnPropertyDescriptor(n,r).enumerable})),t.push.apply(t,i)}return t}function jr(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?kr(Object(t),!0).forEach(function(i){qe(n,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):kr(Object(t)).forEach(function(i){Object.defineProperty(n,i,Object.getOwnPropertyDescriptor(t,i))})}return n}function qe(n,e,t){return(e=Cu(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Cu(n){var e=wu(n,"string");return typeof e=="symbol"?e:e+""}function wu(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var Nr=R.module("ItemList"),Ar=5;class $e extends c.PureComponent{static renderItem(e){var t,i,{item:r}=e;return u.jsx("div",{className:"item-list-item-content",children:r!=null&&((t=(i=r.displayValue)!==null&&i!==void 0?i:r.value)!==null&&t!==void 0?t:"".concat(r))})}constructor(e){super(e),qe(this,"list",void 0),qe(this,"listContainer",void 0),qe(this,"getItemSelected",Vt((r,o)=>Qe.isSelected(o,r),{max:$e.CACHE_SIZE})),qe(this,"getCachedItem",Vt((r,o,s,a,l,d,h,v)=>{var m=d({item:s,itemIndex:r,isFocused:a,isSelected:l,style:h});return u.jsx(si,{onContextMenu:this.handleItemContextMenu,onDoubleClick:this.handleItemDoubleClick,onMouseDown:this.handleItemMouseDown,onFocus:this.handleItemFocus,onBlur:this.handleItemBlur,disableSelect:v,onMouseMove:this.handleItemMouseMove,onMouseUp:this.handleItemMouseUp,isFocused:a,isSelected:l,itemIndex:r,style:h,children:m},o)},{max:$e.CACHE_SIZE})),qe(this,"getOuterElement",Vt(r=>{var o=x.forwardRef((s,a)=>u.jsx("div",jr({ref:a,tabIndex:-1,onKeyDown:r,role:"presentation"},s)));return o.displayName="ItemListOuterElement",o},{max:1e3})),qe(this,"getInnerElement",Vt(()=>{var r=x.forwardRef((o,s)=>u.jsx("div",jr({className:"item-list-inner-element",ref:s},o)));return r.displayName="ItemListInnerElement",r},{max:1e3})),qe(this,"getItemData",Vt((r,o,s)=>({items:r,selectedRanges:o,renderItem:s}),{max:1e3})),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=x.createRef(),this.listContainer=x.createRef();var{isStickyBottom:t,selectedRanges:i}=e;this.state={focusIndex:null,mouseDownIndex:null,selectedRanges:i,overscanStartIndex:0,height:null,isDragging:!1,isStuckToBottom:t,scrollOffset:null,mouseX:null,mouseY:null}}componentDidUpdate(e,t){var{selectedRanges:i,itemCount:r}=this.props,{focusIndex:o,isStuckToBottom:s,scrollOffset:a,height:l,selectedRanges:d}=this.state;if(s&&!this.isListAtBottom()&&r>0&&this.scrollToBottom(),(a!==t.scrollOffset||l!==t.height)&&this.sendViewportUpdate(),i!==e.selectedRanges&&i!==d)this.setSelectedRanges(i);else if(d!==t.selectedRanges){var{onSelectionChange:h}=this.props;h(d)}if(o!==t.focusIndex){var{onFocusChange:v}=this.props;v(o)}}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:i}=this.state,r=this.listContainer.current.querySelectorAll(t),o=e-i;return r[o]}focusItem(e){var{disableSelect:t}=this.props;if(!t){this.setState({focusIndex:e});var i=this.getElement(e);i instanceof HTMLElement&&i.focus()}}scrollToItem(e){var t=this.getElement(e);t!=null&&t.scrollIntoView({block:"center"})}handleItemContextMenu(e,t){this.setState({focusIndex:e});var{selectedRanges:i}=this.state,r=Qe.isSelected(i,e),o=r||ce.isModifierKeyDown(t);this.toggleSelect(e,t.shiftKey,o,!1)}handleItemDoubleClick(e,t){var{isDoubleClickSelect:i,onSelect:r}=this.props;i&&this.setState(o=>{var{selectedRanges:s}=o;return{selectedRanges:Qe.selectRange(s,[e,e])}},()=>{r(e,t)})}handleItemMouseDown(e,t){var{selectedRanges:i}=this.state;if(!(t.target instanceof HTMLElement&&["button","select","input","textarea"].indexOf(t.target.tagName.toLowerCase())!==-1)){if(t.button===2&&i.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){Nr.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){Nr.debug2("item focus",e,t.target),this.setState(i=>{var{focusIndex:r}=i;return r!==e?{focusIndex:e}:null})}handleItemMouseMove(e,t){var{isDragSelect:i,isMultiSelect:r,disableSelect:o}=this.props,{mouseDownIndex:s,selectedRanges:a,mouseX:l,mouseY:d}=this.state;if(!(s==null||o)){var h=Math.abs(t.clientX-(l??0)),v=Math.abs(t.clientY-(d??0));h>Ar&&v>Ar&&this.setState({isDragging:!0}),(i||s===e)&&(this.focusItem(e),r?(!i&&!this.getItemSelected(e,a)&&!ce.isModifierKeyDown(t)&&this.deselectAll(),this.selectRange([Math.min(s,e),Math.max(s,e)])):this.toggleSelect(e,t.shiftKey,ce.isModifierKeyDown(t),!1))}}handleItemMouseUp(e,t){var{isDeselectOnClick:i,isDoubleClickSelect:r,onSelect:o}=this.props,{mouseDownIndex:s,isDragging:a}=this.state;if(!(t.target instanceof HTMLElement&&["button","select","input","textarea"].indexOf(t.target.tagName.toLowerCase())!==-1)){if(s===e&&!a){var l=t.shiftKey,d=ce.isModifierKeyDown(t);this.focusItem(e),this.toggleSelect(e,l,d,i),!r&&!l&&!d&&o(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:i,onSelect:r}=this.props,{focusIndex:o}=this.state,s=o;if(e.key==="Enter"||e.key===" "){!t&&s!=null&&this.setState({selectedRanges:[[s,s]]},()=>{s!=null&&r(s,e)});return}if(e.key==="ArrowUp")s!=null&&s>=0?s=Math.max(0,s-1):s=i-1;else if(e.key==="ArrowDown")s!=null&&s>=0?s=Math.min(s+1,i-1):s=0;else return;if(o!==s){e.stopPropagation(),e.preventDefault(),this.focusItem(s);var{selectedRanges:a}=this.state;if(e.shiftKey&&a.length>0){var l=a[a.length-1];this.selectRange([Math.min(s,l[0]),Math.max(s,l[1])])}else if(this.deselectAll(),s!==null)this.selectItem(s);else{var d;(d=this.listContainer.current)===null||d===void 0||d.focus()}this.scrollIntoView(s)}}handleScroll(e){var{scrollUpdateWasRequested:t,scrollOffset:i}=e;this.setState(r=>{if(t)return{scrollOffset:i};var{isStickyBottom:o}=this.props,{height:s}=r,a=o&&this.isListAtBottom({scrollOffset:i,height:s});return{isStuckToBottom:a,scrollOffset:i}})}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,i){var r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,{isMultiSelect:o}=this.props,{selectedRanges:s}=this.state;if(o&&t&&s.length>0){var a=s[s.length-1];this.selectRange([Math.min(a[0],e),Math.max(e,a[1])])}else o&&s.length===1&&s[0][0]===e&&s[0][1]===e?r&&this.deselectItem(e):o&&i?this.getItemSelected(e,s)?r&&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){Qe.validateRange(e),this.setState(t=>{var{selectedRanges:i}=t;return{selectedRanges:Qe.deselectRange(i,e)}})}selectItem(e){var{disableSelect:t}=this.props;t||this.selectRange([e,e])}selectRange(e){Qe.validateRange(e),this.setState(t=>{var{selectedRanges:i}=t;return{selectedRanges:Qe.selectRange(i,e)}})}setSelectedRanges(e){this.setState({selectedRanges:e})}sendViewportUpdate(){var{scrollOffset:e,height:t}=this.state;if(e!=null&&t!=null){var{onViewportChange:i,rowHeight:r}=this.props,o=Math.floor(e/r),s=o+Math.ceil(t/r);i(o,s)}}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:i,rowHeight:r}=this.props;return e+t>=i*r}renderInnerElement(e){var{index:t,style:i}=e,{items:r,offset:o,renderItem:s,disableSelect:a}=this.props,{focusIndex:l,selectedRanges:d}=this.state;if(t<o||t>=o+r.length)return null;var h=r[t-o];return this.getCachedItem(t,t,h,t===l&&!a,this.getItemSelected(t,d),s,i,a)}render(){var{items:e,itemCount:t,overscanCount:i,renderItem:r,rowHeight:o,"data-testid":s}=this.props,{selectedRanges:a,isStuckToBottom:l}=this.state;return u.jsx(kl,{className:"item-list-auto-sizer",onResize:this.handleResize,children:d=>{var{width:h,height:v}=d;return u.jsx(jl,{className:"item-list-scroll-pane",height:v,width:h,initialScrollOffset:l?t*o:0,itemCount:t,itemSize:o,itemData:this.getItemData(e,a,r),onScroll:this.handleScroll,onItemsRendered:this.handleItemsRendered,ref:this.list,outerElementType:this.getOuterElement(this.handleKeyDown),outerRef:this.listContainer,innerElementType:this.getInnerElement(),overscanCount:i,"data-testid":s,children:this.renderInnerElement})}})}}qe($e,"CACHE_SIZE",1e3);qe($e,"DEFAULT_ROW_HEIGHT",20);qe($e,"DEFAULT_OVERSCAN",10);qe($e,"defaultProps",{offset:0,items:[],rowHeight:$e.DEFAULT_ROW_HEIGHT,isDeselectOnClick:!0,isDoubleClickSelect:!1,isDragSelect:!0,isMultiSelect:!1,isStickyBottom:!1,disableSelect:!1,onFocusChange(){},onSelect(){},onSelectionChange(){},onViewportChange(){},overscanCount:$e.DEFAULT_OVERSCAN,renderItem:$e.renderItem,selectedRanges:[],focusSelector:".item-list-item","data-testid":void 0});var Su=R.module("ErrorBoundary");class _u extends c.Component{static getDerivedStateFromError(e){return{error:e}}constructor(e){super(e),this.state={error:void 0}}componentDidCatch(e,t){var{onError:i}=this.props;Su.error("Error caught by ErrorBoundary",e,t),i==null||i(e,t)}render(){var{children:e,className:t,fallback:i}=this.props,{error:r}=this.state;return r!=null?i??u.jsx("div",{className:t,children:u.jsx(wn,{errorMessage:"".concat(r),isLoading:!1,isLoaded:!1,"data-testid":"error-boundary-loading"})}):e??null}}function Eu(n){var{on:e,id:t,className:i,isInvalid:r,disabled:o=!1,onClick:s,"data-testid":a}=n;return u.jsx("button",{type:"button",className:U("btn","btn-switch",i,{active:e},{"is-invalid":r}),id:t,onClick:s,disabled:o,"data-testid":a,children:u.jsx("div",{className:"handle"})})}var Pu=["children","className","isInvalid","onChange","data-testid"];function Lr(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(n);e&&(i=i.filter(function(r){return Object.getOwnPropertyDescriptor(n,r).enumerable})),t.push.apply(t,i)}return t}function Rr(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Lr(Object(t),!0).forEach(function(i){Tu(n,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Lr(Object(t)).forEach(function(i){Object.defineProperty(n,i,Object.getOwnPropertyDescriptor(t,i))})}return n}function Tu(n,e,t){return(e=Ou(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Ou(n){var e=xu(n,"string");return typeof e=="symbol"?e:e+""}function xu(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function Iu(n,e){if(n==null)return{};var t,i,r=Du(n,e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(n);for(i=0;i<o.length;i++)t=o[i],e.indexOf(t)===-1&&{}.propertyIsEnumerable.call(n,t)&&(r[t]=n[t])}return r}function Du(n,e){if(n==null)return{};var t={};for(var i in n)if({}.hasOwnProperty.call(n,i)){if(e.indexOf(i)!==-1)continue;t[i]=n[i]}return t}var As=x.forwardRef((n,e)=>{var{children:t,className:i,isInvalid:r,onChange:o,"data-testid":s}=n,a=Iu(n,Pu),l=Ps(e),d=c.useCallback(h=>{o(h.target.value)},[o]);return u.jsx("select",Rr(Rr({ref:l,className:U("custom-select",i,{"is-invalid":r}),onChange:d,"data-testid":s},a),{},{children:t}))});As.displayName="Select";var zi=x.createContext(new Map);zi.displayName="XComponentMapContext";var Pg=zi.Provider;function Mu(n){var e,t=c.useContext(zi);return(e=t.get(n))!==null&&e!==void 0?e:n.Original}function Fr(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(n);e&&(i=i.filter(function(r){return Object.getOwnPropertyDescriptor(n,r).enumerable})),t.push.apply(t,i)}return t}function gi(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Fr(Object(t),!0).forEach(function(i){ku(n,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Fr(Object(t)).forEach(function(i){Object.defineProperty(n,i,Object.getOwnPropertyDescriptor(t,i))})}return n}function ku(n,e,t){return(e=ju(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function ju(n){var e=Nu(n,"string");return typeof e=="symbol"?e:e+""}function Nu(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function Ls(n){var e,t;function i(r,o){var s=Mu(t);return Ds(n)?u.jsx(s,gi(gi({},r),{},{ref:o})):u.jsx(s,gi({},r))}return i.displayName="XComponent(".concat((e=n.displayName)!==null&&e!==void 0?e:n.name,")"),t=c.forwardRef(i),t.Original=n,t.isXComponent=!0,t}function Au(){return En(il,"No API available in useApi. Was code wrapped in ApiBootstrap or ApiContext.Provider?")}function Rs(n){return typeof n=="object"&&n!=null&&typeof n.type=="string"&&n.name!=null}function Fs(n){return typeof n=="object"&&n!=null&&typeof n.type=="string"&&n.id!=null}function Tg(n){return Rs(n)||Fs(n)}var $s=c.createContext(null);$s.displayName="ObjectFetcherContext";function Og(n){if(Fs(n))return{id:n.id,type:n.type};if(Rs(n)){var e;return{name:(e=n.name)!==null&&e!==void 0?e:"",type:n.type}}throw new Error("Invalid descriptor: ".concat(n))}function Lu(n){var e,t;return{type:(e=n.type)!==null&&e!==void 0?e:"",name:(t=n.title)!==null&&t!==void 0?t:n.name,id:n.id}}function xg(){return En($s,"No ObjectFetcher available in useObjectFetcher. Was code wrapped in ObjectFetcherContext.Provider?")}function $r(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(n);e&&(i=i.filter(function(r){return Object.getOwnPropertyDescriptor(n,r).enumerable})),t.push.apply(t,i)}return t}function Ru(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?$r(Object(t),!0).forEach(function(i){Fu(n,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):$r(Object(t)).forEach(function(i){Object.defineProperty(n,i,Object.getOwnPropertyDescriptor(t,i))})}return n}function Fu(n,e,t){return(e=$u(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function $u(n){var e=Hu(n,"string");return typeof e=="symbol"?e:e+""}function Hu(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var Uu=Object.freeze({}),Bu=new Map,Ig=n=>n.api,Dg=n=>n.user,Hs=n=>n.storage,Us=n=>Hs(n).commandHistoryStorage,Ku=n=>Hs(n).fileStorage,Wu=n=>n.defaultWorkspaceSettings,Bs=n=>{var{workspace:e}=n;return e},Vi=Nl(n=>{for(var e,t,i=(e=(t=Bs(n))===null||t===void 0?void 0:t.data.settings)!==null&&e!==void 0?e:{},r=Ru({},Wu(n)),o=Object.keys(i),s=0;s<o.length;s+=1){var a=o[s];i[a]!==void 0&&(r[a]=i[a])}return r}),zu=n=>Vi(n).timeZone,Mg=n=>{var e;return(e=Vi(n).notebookSettings)!==null&&e!==void 0?e:Uu},kg=n=>n.activeTool,Vu=n=>{var e;return(e=n.plugins)!==null&&e!==void 0?e:Bu},Gu="SET_ACTIVE_TOOL",qu="SET_API",jg="SET_COMMAND_HISTORY_STORAGE",Ng="SET_FILE_STORAGE",Ag="SET_PLUGINS",Xu="SET_USER",Zu="SET_WORKSPACE",Yu="SET_DEFAULT_WORKSPACE_SETTINGS",Lg="SET_WORKSPACE_STORAGE",Qu="SET_SERVER_CONFIG_VALUES";function Hr(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(n);e&&(i=i.filter(function(r){return Object.getOwnPropertyDescriptor(n,r).enumerable})),t.push.apply(t,i)}return t}function ut(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Hr(Object(t),!0).forEach(function(i){Ju(n,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Hr(Object(t)).forEach(function(i){Object.defineProperty(n,i,Object.getOwnPropertyDescriptor(t,i))})}return n}function Ju(n,e,t){return(e=eh(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function eh(n){var e=th(n,"string");return typeof e=="symbol"?e:e+""}function th(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var Rg=n=>({type:Xu,payload:n}),Fg=n=>({type:qu,payload:n}),Ks=n=>({type:Zu,payload:n}),$g=n=>({type:Yu,payload:n}),nh=n=>(e,t)=>{e(Ks(n));var{storage:i}=t(),{workspaceStorage:r}=i;return r==null?void 0:r.save(n)},ih=n=>(e,t)=>{var{workspace:i}=t(),{data:r}=i??{},o=ut(ut({},i),{},{data:ut(ut(ut({},r),n),{},{settings:ut(ut({},r==null?void 0:r.settings),n.settings)})});return e(nh(o))},Hg=n=>(e,t)=>{var{notebookSettings:i}=Vi(t()),r=ut(ut({},i),n);return e(rh({notebookSettings:r}))},rh=n=>e=>e(ih({settings:n})),Ug=n=>({type:Gu,payload:n}),Bg=n=>({type:Qu,payload:n});function Ur(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(n);e&&(i=i.filter(function(r){return Object.getOwnPropertyDescriptor(n,r).enumerable})),t.push.apply(t,i)}return t}function Br(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Ur(Object(t),!0).forEach(function(i){oh(n,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Ur(Object(t)).forEach(function(i){Object.defineProperty(n,i,Object.getOwnPropertyDescriptor(t,i))})}return n}function oh(n,e,t){return(e=sh(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function sh(n){var e=ah(n,"string");return typeof e=="symbol"?e:e+""}function ah(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function lh(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 i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:e,r=arguments.length>1?arguments[1]:void 0;switch(r==null?void 0:r.type){case n:{var{id:o,payload:s}=r;return t&&Ti({payload:s},{payload:i[o]})?i:Br(Br({},i),{},{[o]:s})}default:return i}}}function Kr(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(n);e&&(i=i.filter(function(r){return Object.getOwnPropertyDescriptor(n,r).enumerable})),t.push.apply(t,i)}return t}function Wr(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Kr(Object(t),!0).forEach(function(i){Mi(n,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Kr(Object(t)).forEach(function(i){Object.defineProperty(n,i,Object.getOwnPropertyDescriptor(t,i))})}return n}function Mi(n,e,t){return(e=dh(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function dh(n){var e=uh(n,"string");return typeof e=="symbol"?e:e+""}function uh(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class hh{constructor(){Mi(this,"reducers",{}),Mi(this,"listener",null)}register(e,t){var i;this.reducers=Wr(Wr({},this.reducers),{},{[e]:t}),(i=this.listener)===null||i===void 0||i.call(this,this.reducers)}setListener(e){this.listener=e}}var ch=new hh;function Gi(n,e,t){return(e=mh(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function mh(n){var e=vh(n,"string");return typeof e=="symbol"?e:e+""}function vh(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class He{static isValid(e,t){return!0}static isSameFormat(e,t){throw new Error("isSameFormat not implemented")}static makeFormat(e,t,i){return{label:e,formatString:t,type:i}}format(e,t){return""}}Gi(He,"TYPE_GLOBAL","type-global");Gi(He,"TYPE_CONTEXT_PRESET","type-context-preset");Gi(He,"TYPE_CONTEXT_CUSTOM","type-context-custom");function St(n,e,t){return(e=ph(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function ph(n){var e=fh(n,"string");return typeof e=="symbol"?e:e+""}function fh(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var zr=R.module("DateTimeColumnFormatter");class ct extends He{static isValid(e,t){if(t.formatString==null)return!1;try{return e.i18n.DateTimeFormat.format(t.formatString,new Date),!0}catch{return!1}}static makeFormat(e,t){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:He.TYPE_CONTEXT_PRESET;return{label:e,formatString:t,type:i}}static isSameFormat(e,t){return e===t||e!==null&&t!==null&&e.type===t.type&&e.formatString===t.formatString}static makeGlobalFormatStringMap(e,t){var i=t?"'T'":" ",r=e?" z":"";return new Map([["yyyy-MM-dd HH:mm:ss","yyyy-MM-dd".concat(i,"HH:mm:ss").concat(r)],["yyyy-MM-dd HH:mm:ss.SSS","yyyy-MM-dd".concat(i,"HH:mm:ss.SSS").concat(r)],["yyyy-MM-dd HH:mm:ss.SSSSSSSSS","yyyy-MM-dd".concat(i,"HH:mm:ss.SSSSSSSSS").concat(r)]])}static getGlobalFormats(e,t){var i=ct.makeGlobalFormatStringMap(e,t);return[...i.keys()]}static makeFormatStringMap(e,t){var i=t!==void 0&&t?"'T'":" ",r=e!==void 0&&e?" z":"";return new Map([["yyyy-MM-dd","yyyy-MM-dd".concat(r)],["MM-dd-yyyy","MM-dd-yyyy".concat(r)],["HH:mm:ss","HH:mm:ss".concat(r)],["HH:mm:ss.SSS","HH:mm:ss.SSS".concat(r)],["HH:mm:ss.SSSSSSSSS","HH:mm:ss.SSSSSSSSS".concat(r)],["yyyy-MM-dd HH:mm:ss","yyyy-MM-dd".concat(i,"HH:mm:ss").concat(r)],["yyyy-MM-dd HH:mm:ss.SSS","yyyy-MM-dd".concat(i,"HH:mm:ss.SSS").concat(r)],["yyyy-MM-dd HH:mm:ss.SSSSSSSSS","yyyy-MM-dd".concat(i,"HH:mm:ss.SSSSSSSSS").concat(r)]])}static getFormats(e,t){var i=ct.makeFormatStringMap(e,t);return[...i.keys()]}constructor(e){var{timeZone:t="",showTimeZone:i=!0,showTSeparator:r=!1,defaultDateTimeFormatString:o=ct.DEFAULT_DATETIME_FORMAT_STRING}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};super(),St(this,"dh",void 0),St(this,"dhTimeZone",void 0),St(this,"defaultDateTimeFormatString",void 0),St(this,"showTimeZone",void 0),St(this,"showTSeparator",void 0),St(this,"formatStringMap",void 0);var s=t||ct.DEFAULT_TIME_ZONE_ID;try{this.dhTimeZone=e.i18n.TimeZone.getTimeZone(s)}catch{zr.error("Unsupported time zone id",s),this.dhTimeZone=e.i18n.TimeZone.getTimeZone(ct.DEFAULT_TIME_ZONE_ID)}this.dh=e,this.defaultDateTimeFormatString=o,this.showTimeZone=i,this.showTSeparator=r,this.formatStringMap=ct.makeFormatStringMap(i,r)}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]:{},i=t.formatString!=null&&t.formatString!==""?t.formatString:this.defaultDateTimeFormatString,r=this.getEffectiveFormatString(i);try{return this.dh.i18n.DateTimeFormat.format(r,e,this.dhTimeZone)}catch{zr.error("Invalid format arguments")}return""}}St(ct,"DEFAULT_DATETIME_FORMAT_STRING","yyyy-MM-dd HH:mm:ss.SSS");St(ct,"DEFAULT_TIME_ZONE_ID","America/New_York");function nt(n,e,t){return(e=gh(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function gh(n){var e=bh(n,"string");return typeof e=="symbol"?e:e+""}function bh(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var yh=R.module("DecimalColumnFormatter");class he extends He{static isValid(e,t){if(t.formatString==null)return!1;try{return e.i18n.NumberFormat.format(t.formatString,0),!0}catch{return!1}}static makeFormat(e,t){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:He.TYPE_CONTEXT_PRESET,r=arguments.length>3?arguments[3]:void 0;return{label:e,type:i,formatString:t,multiplier:r}}static makePresetFormat(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",i=arguments.length>2?arguments[2]:void 0;return he.makeFormat(e,t,He.TYPE_CONTEXT_PRESET,i)}static makeCustomFormat(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",t=arguments.length>1?arguments[1]:void 0;return he.makeFormat("Custom Format",e,He.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=he.DEFAULT_FORMAT_STRING}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};super(),nt(this,"defaultFormatString",void 0),nt(this,"dh",void 0),this.dh=e,this.defaultFormatString=t}format(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=t.formatString!=null&&t.formatString!==""?t.formatString:this.defaultFormatString,r=t.multiplier!=null&&t.multiplier!==0?e*t.multiplier:e;try{return this.dh.i18n.NumberFormat.format(i,r)}catch{yh.error("Invalid format arguments")}return""}}nt(he,"DEFAULT_FORMAT_STRING","###,##0.0000");nt(he,"FORMAT_PERCENT",he.makePresetFormat("Percent","##0.00%"));nt(he,"FORMAT_BASIS_POINTS",he.makePresetFormat("Basis Points","###,##0 bp",1e4));nt(he,"FORMAT_THOUSANDS",he.makePresetFormat("Thousands","##0.000 k",.001));nt(he,"FORMAT_MILLIONS",he.makePresetFormat("Millions","###,##0.000 mm",1e-6));nt(he,"FORMAT_SCIENTIFIC_NOTATION",he.makePresetFormat("Scientific Notation","0.0000E0"));nt(he,"FORMAT_ROUND",he.makePresetFormat("Round","###,##0"));nt(he,"FORMAT_ROUND_TWO_DECIMALS",he.makePresetFormat("0.00","###,##0.00"));nt(he,"FORMAT_ROUND_FOUR_DECIMALS",he.makePresetFormat("0.0000","###,##0.0000"));function en(n,e,t){return(e=Ch(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Ch(n){var e=wh(n,"string");return typeof e=="symbol"?e:e+""}function wh(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var Sh=R.module("IntegerColumnFormatter");class et extends He{static isValid(e,t){if(t.formatString==null)return!1;try{return e.i18n.NumberFormat.format(t.formatString,0),!0}catch{return!1}}static makeFormat(e,t){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:He.TYPE_CONTEXT_PRESET,r=arguments.length>3?arguments[3]:void 0;return{label:e,type:i,formatString:t,multiplier:r}}static makePresetFormat(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",i=arguments.length>2?arguments[2]:void 0;return et.makeFormat(e,t,He.TYPE_CONTEXT_PRESET,i)}static makeCustomFormat(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",t=arguments.length>1?arguments[1]:void 0;return et.makeFormat("Custom Format",e,He.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=et.DEFAULT_FORMAT_STRING}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};super(),en(this,"dh",void 0),en(this,"defaultFormatString",void 0),this.dh=e,this.defaultFormatString=t}format(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=t.formatString!=null&&t.formatString!==""?t.formatString:this.defaultFormatString,r=t.multiplier!=null&&t.multiplier!==0?e*t.multiplier:e;try{return this.dh.i18n.NumberFormat.format(i,r)}catch{Sh.error("Invalid format arguments")}return""}}en(et,"DEFAULT_FORMAT_STRING","###,##0");en(et,"FORMAT_THOUSANDS",et.makePresetFormat("Thousands","##0.000 k",.001));en(et,"FORMAT_MILLIONS",et.makePresetFormat("Millions","###,##0.000 mm",1e-6));en(et,"FORMAT_SCIENTIFIC_NOTATION",et.makePresetFormat("Scientific Notation","0.0000E0"));function Ht(n,e,t){return(e=_h(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function _h(n){var e=Eh(n,"string");return typeof e=="symbol"?e:e+""}function Eh(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class K{}Ht(K,"INTEGER","int");Ht(K,"LONG","long");Ht(K,"DOUBLE","double");Ht(K,"BOOLEAN","bool");Ht(K,"STRING","string");Ht(K,"DATE_TIME","datetime");Ht(K,"LOCAL_TIME","localtime");var Ws=c.createContext(null);Ws.displayName="PluginsContext";var an=Object.freeze({AUTH_PLUGIN:"AuthPlugin",DASHBOARD_PLUGIN:"DashboardPlugin",WIDGET_PLUGIN:"WidgetPlugin",TABLE_PLUGIN:"TablePlugin",THEME_PLUGIN:"ThemePlugin",ELEMENT_PLUGIN:"ElementPlugin"});function Ph(n){return"DashboardPlugin"in n}function Th(n){return"AuthPlugin"in n}function Oh(n){return"TablePlugin"in n}function Kg(n){return Ph(n)||Th(n)||Oh(n)}function xh(n){return"type"in n&&n.type===an.DASHBOARD_PLUGIN}function qi(n){return"type"in n&&n.type===an.WIDGET_PLUGIN}function Ih(n){return"type"in n&&n.type===an.TABLE_PLUGIN}function Dh(n){return"type"in n&&n.type===an.AUTH_PLUGIN}function zs(n){return"type"in n&&n.type===an.THEME_PLUGIN}function Vs(n){return"type"in n&&n.type===an.ELEMENT_PLUGIN}function Wg(n){return xh(n)||Dh(n)||Ih(n)||zs(n)||qi(n)||Vs(n)}var Gs=R.module("@deephaven/plugin.PluginUtils");function Vr(n,e){return n==null||!qi(n)?!1:[n.supportedTypes].flat().some(t=>t===e)}function Mh(n){var e=u.jsx(le,{icon:ls});if(!qi(n))return e;var{icon:t}=n;return t==null?e:c.isValidElement(t)?t:u.jsx(le,{icon:t})}function zg(n){var e=[...n.entries()].filter(t=>zs(t[1]));return Gs.debug("Getting theme data from plugins",e),e.map(t=>{var[i,r]=t,o=Array.isArray(r.themes)?r.themes:[r.themes];return o.map(s=>{var{name:a,baseTheme:l,styleContent:d}=s;return{baseThemeKey:"default-".concat(l??"dark"),themeKey:rl(i,a),name:a,styleContent:d}})}).flat()}function Vg(n){var e=[...n.entries()].filter(t=>Vs(t[1])&&t[1].mapping!=null);return Gs.debug("Getting element plugin mapping",e),new Map(e.flatMap(t=>{var[,i]=t;return Object.entries(i.mapping)}))}function Gg(){return En(Ws,"No Plugins available in usePlugins. This can happen when plugins have not finished loading or if code is not wrapped in PluginsContext.Provider.")}var qs=c.createContext(null);qs.displayName="PersistentStateContext";function qg(n){var{initialState:e,onChange:t,children:i}=n,[r,o]=x.useState(0),s=c.useRef({initial:e,initialStateMap:new Map,state:new Map,isTracking:!0}),a=c.useCallback((m,p)=>{s.current.isTracking&&s.current.state.set(m,p)},[]),l=c.useCallback(()=>{s.current.isTracking||(s.current.isTracking=!0,s.current.state=new Map,o(m=>m+1))},[]),d=c.useRef(s.current.initial[Symbol.iterator]()),h=c.useCallback(function(p){var f=s.current.initialStateMap.get(p);if(f)return f;var{value:g,done:y}=d.current.next(),S={value:g,done:y??!1};return s.current.initialStateMap.set(p,S),S},[]);c.useEffect(function(){s.current.isTracking&&(t([...s.current.state.values()]),s.current.isTracking=!1)},[r,t]);var v=c.useMemo(()=>({addState:a,scheduleStateUpdate:l,getInitialState:h,updateId:r}),[a,h,l,r]);return u.jsx(qs.Provider,{value:v,children:i})}const kh="var(--dh-color-chart-colorway)",jh="var(--dh-color-chart-grid)",Nh="var(--dh-color-chart-axis-line)",Ah="var(--dh-color-chart-axis-line-zero)",Gr={"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:kh,gridcolor:jh,linecolor:Nh,zerolinecolor:Ah,"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)","indicator-increasing":"var(--dh-color-chart-indicator-increase)","indicator-decreasing":"var(--dh-color-chart-indicator-decrease)","indicator-gauge":"var(--dh-color-chart-indicator-gauge)"};var qr=R.module("ChartTheme");function Lh(){var n,e=ds(Gr);return e.colorway=ol((n=e.colorway)!==null&&n!==void 0?n:"").map(t=>{var[i,r]=t;return sl.normalizeCssColor(e.colorway.substring(i,r+1))}).join(" "),qr.debug2("Chart theme:",Gr),qr.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"],indicator_increasing:e["indicator-increasing"],indicator_decreasing:e["indicator-decreasing"],indicator_gauge:e["indicator-gauge"]})}function Xr(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(n);e&&(i=i.filter(function(r){return Object.getOwnPropertyDescriptor(n,r).enumerable})),t.push.apply(t,i)}return t}function Rh(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Xr(Object(t),!0).forEach(function(i){Fh(n,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Xr(Object(t)).forEach(function(i){Object.defineProperty(n,i,Object.getOwnPropertyDescriptor(t,i))})}return n}function Fh(n,e,t){return(e=$h(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function $h(n){var e=Hh(n,"string");return typeof e=="symbol"?e:e+""}function Hh(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var Uh=c.lazy(()=>Al(()=>import("./Plot--bRJIWPY.js"),__vite__mapDeps([0,1,2,3,4,5]),import.meta.url));function Bh(n){return u.jsx(c.Suspense,{fallback:u.jsx(wn,{"data-testid":"lazy-plot-loading"}),children:u.jsx(Uh,Rh({},n))})}var Xi=c.createContext(null);Xi.displayName="ChartThemeContext";function Xg(n){var{children:e}=n,{activeThemes:t}=Ts(),i=c.useMemo(Lh,[t]);return u.jsx(Xi.Provider,{value:i,children:e})}function Kh(){return En(Xi,"No ChartThemeContext value found.")}var Xs=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 Zs(n){return n.componentName!==void 0}function Wh(n){return n.component!==void 0}var Ys=Object.freeze({type:"default",isClosable:!0,isFocusOnShow:!0,reorderEnabled:!0,title:""});const zh=Object.freeze(Object.defineProperty({__proto__:null,defaultConfig:Xs,isGLComponentConfig:Zs,isReactComponentConfig:Wh,itemDefaultConfig:Ys},Symbol.toStringTag,{value:"Module"}));function Wn(n,e,t){return(e=Vh(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Vh(n){var e=Gh(n,"string");return typeof e=="symbol"?e:e+""}function Gh(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class xe{constructor(){Wn(this,"_mSubscriptions",void 0),Wn(this,"off",this.unbind),Wn(this,"trigger",this.emit),this._mSubscriptions={},this._mSubscriptions[xe.ALL_EVENT]=[]}on(e,t,i){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:i})}emit(e){for(var t=this._mSubscriptions[e],i=arguments.length,r=new Array(i>1?i-1:0),o=1;o<i;o++)r[o-1]=arguments[o];if(t)for(var s=0;s<t.length;s++){var a=t[s].ctx||{};try{t[s].fn.apply(a,r)}catch(v){console.error("Error while emitting event:",v)}}r.unshift(e);for(var l=this._mSubscriptions[xe.ALL_EVENT],d=0;d<l.length;d++){var h=l[d].ctx||{};try{l[d].fn.apply(h,r)}catch(v){console.error("Error while emitting event to allEventSubs:",v)}}}unbind(e,t,i){if(!this._mSubscriptions[e])throw new Error("No subscriptions to unsubscribe for event "+e);for(var r=!1,o=0;o<this._mSubscriptions[e].length;o++)(!t||this._mSubscriptions[e][o].fn===t)&&(!i||i===this._mSubscriptions[e][o].ctx)&&(this._mSubscriptions[e].splice(o,1),r=!0);if(r===!1)throw new Error("Nothing to unbind for "+e)}}Wn(xe,"ALL_EVENT","__all");function Ze(n,e,t){return(e=qh(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function qh(n){var e=Xh(n,"string");return typeof e=="symbol"?e:e+""}function Xh(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class ki extends xe{constructor(e,t,i){super(),Ze(this,"width",void 0),Ze(this,"height",void 0),Ze(this,"title",void 0),Ze(this,"parent",void 0),Ze(this,"layoutManager",void 0),Ze(this,"tab",void 0),Ze(this,"_config",void 0),Ze(this,"isHidden",!1),Ze(this,"beforeCloseHandler",void 0),Ze(this,"_element",O(['<div class="lm_item_container">','<div class="lm_content" tabindex="-1"></div>',"</div>"].join(""))),Ze(this,"_contentElement",void 0),this.title=Zs(e)?e.componentName:"",this.parent=t,this.layoutManager=i,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 i,r,o,s=this.parent,a=null;s&&!s.isColumn&&!s.isRow;){var l;if(a=s,s=s.parent,(l=s)!==null&&l!==void 0&&l.isRoot)return!1}if(!s||!a)return!1;for(var d=s.isColumn?"height":"width",h=d==="height"?t:e,v=((i=this[d])!==null&&i!==void 0?i:0)*(1/(((r=a.config[d])!==null&&r!==void 0?r:0)/100)),m=h/v*100,p=(((o=a.config[d])!==null&&o!==void 0?o:0)-m)/(s.contentItems.length-1),f=0;f<s.contentItems.length;f++)if(s.contentItems[f]===a)s.contentItems[f].config[d]=m;else{var g;s.contentItems[f].config[d]=((g=s.contentItems[f].config[d])!==null&&g!==void 0?g:0)+p}return s.callDownwards("setSize"),!0}close(e){var t,i;this._config.isClosable&&(!((t=(i=this.beforeCloseHandler)===null||i===void 0?void 0:i.call(this,e))!==null&&t!==void 0)||t)&&(this.emit("close"),this.parent.close())}beforeClose(e){this.beforeCloseHandler=e}getState(){return this._config.componentState}getConfig(){return this._config}extendState(e){this.setState(O.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 i=this._contentElement[0],r=i.offsetWidth-i.clientWidth,o=i.offsetHeight-i.clientHeight;this._contentElement.width(this.width-r).height(this.height-o),this.emit("resize")}}}const Zh=Object.freeze(Object.defineProperty({__proto__:null,Container:ki,ItemContainer:ki},Symbol.toStringTag,{value:"Module"}));function Qs(n){var e=location.hash.match(new RegExp(n+"=([^&]*)"));return e?e[1]:null}function Js(n){if(window.location.hash)return Qs(n);if(!window.location.search)return null;var e=window.location.search.substr(1).split("&"),t={},i,r;for(r=0;r<e.length;r++)i=e[r].split("="),t[i[0]]=i[1];return t[n]||null}function Zi(n){return window.requestAnimationFrame(n)}function Yh(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 Gn(){return vt()}function Qh(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 Yi(n){return O.trim(n.replace(/(<([^>]+)>)/gi,""))}function Ne(n,e,t){return(e=Jh(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Jh(n){var e=ec(n,"string");return typeof e=="symbol"?e:e+""}function ec(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class Tn extends xe{constructor(e){var t,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;super(),Ne(this,"_eElement",void 0),Ne(this,"_oDocument",void 0),Ne(this,"_eBody",void 0),Ne(this,"_destroyAfterMouseUp",void 0),Ne(this,"_nDelay",400),Ne(this,"_timeout",void 0),Ne(this,"timeout",void 0),Ne(this,"_nDistance",10),Ne(this,"_nX",0),Ne(this,"_nY",0),Ne(this,"_nOriginalX",0),Ne(this,"_nOriginalY",0),Ne(this,"_bDragging",!1),this._eElement=e,this._oDocument=O(document),this._eBody=O(document.body),this._destroyAfterMouseUp=i,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,i,r,o,s=this._getCoordinates(e);this._nOriginalX=(t=s.x)!==null&&t!==void 0?t:0,this._nOriginalY=(i=s.y)!==null&&i!==void 0?i:0,(r=this._oDocument)===null||r===void 0||r.on("mousemove",this.onMouseMove),(o=this._oDocument)===null||o===void 0||o.on("mouseup",this.onMouseUp),this._timeout=window.setTimeout(this._startDrag,this._nDelay)}}onMouseMove(e){if(this._timeout!=null){var t,i;e.preventDefault();var r=this._getCoordinates(e);this._nX=((t=r.x)!==null&&t!==void 0?t:0)-this._nOriginalX,this._nY=((i=r.y)!==null&&i!==void 0?i: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,i,r,o,s;if(clearTimeout(this._timeout),(t=this._oDocument)===null||t===void 0||t.unbind("mousemove",this.onMouseMove),(i=this._oDocument)===null||i===void 0||i.unbind("mouseup",this.onMouseUp),(r=this._oDocument)===null||r===void 0||(o=r.find("iframe"))===null||o===void 0||o.css("pointer-events",""),this._bDragging===!0&&(this._bDragging=!1,this.emit("dragStop",e,this._nOriginalX+this._nX)),(s=this._eBody)===null||s===void 0||s.removeClass("lm_dragging"),!(this._eElement instanceof Window)){var a;(a=this._eElement)===null||a===void 0||a.removeClass("lm_dragging")}this._destroyAfterMouseUp&&this.destroy()}}_startDrag(){var e,t,i,r;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"),(i=this._oDocument)===null||i===void 0||(r=i.find("iframe"))===null||r===void 0||r.css("pointer-events","none"),this.emit("dragStart",this._nOriginalX,this._nOriginalY)}_getCoordinates(e){var t,i;return{x:(t=e.pageX)!==null&&t!==void 0?t:0,y:(i=e.pageY)!==null&&i!==void 0?i:0}}}function Kt(n,e,t){return(e=tc(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function tc(n){var e=nc(n,"string");return typeof e=="symbol"?e:e+""}function nc(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class ea{constructor(e,t){Kt(this,"_container",void 0),Kt(this,"_reactComponent",null),Kt(this,"_portalComponent",null),Kt(this,"_originalComponentWillUpdate",null),Kt(this,"_initialState",void 0),Kt(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=Bi.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 i;this._container.setState(t),(i=this._originalComponentWillUpdate)===null||i===void 0||i.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=O.extend(e,this._container._config.props);return x.createElement(this._reactClass,t)}}var qn=["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"],ic=[!0,!1,"row","column","stack","component","close","maximise","minimise","open in new window"];function Qi(n){if(qn.length>36)throw new Error("Too many keys in config minifier map");var e={};return Ji(n,e,"_min"),e}function ji(n){if(qn.length>36)throw new Error("Too many keys in config minifier map");var e={};return Ji(n,e,"_max"),e}function Ji(n,e,t){var i=t==="_min"?rc:oc;for(var r in n)if(n.hasOwnProperty(r)){var o=Array.isArray(n)?n[Number.parseInt(r,10)]:n[r];if(typeof o=="object"&&o!=null){var s=o instanceof Array?[]:{};if(Array.isArray(e))e[Number.parseInt(r,10)]=s;else{var a=i(r,qn);e[a]=s}Ji(o,s,t)}else{var l=i(o,ic);if(Array.isArray(e))e[Number.parseInt(r,10)]=l;else{var d=i(r,qn);e[d]=l}}}}function rc(n,e){if(typeof n=="string"&&n.length===1)return"___"+n;var t=e.indexOf(n);return t===-1?n:t.toString(36)}function oc(n,e){return typeof n=="string"&&n.length===1?e[parseInt(n,36)]:typeof n=="string"&&n.substr(0,3)==="___"?n[3]:n}function bi(n,e,t){return(e=sc(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function sc(n){var e=ac(n,"string");return typeof e=="symbol"?e:e+""}function ac(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class Ni{constructor(e,t){bi(this,"name",void 0),bi(this,"origin",void 0),bi(this,"isPropagationStopped",void 0),this.name=e,this.origin=t,this.isPropagationStopped=!1}stopPropagation(){this.isPropagationStopped=!0}}function jn(n,e,t){return(e=lc(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function lc(n){var e=dc(n,"string");return typeof e=="symbol"?e:e+""}function dc(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}let ta=class extends xe{constructor(e){super(),jn(this,"_layoutManager",void 0),jn(this,"_dontPropagateToParent",void 0),jn(this,"_childEventSource",void 0),jn(this,"_boundOnEventFromChild",void 0),this._layoutManager=e,this._dontPropagateToParent=null,this._childEventSource=null,this.on(xe.ALL_EVENT,this._onEventFromThis.bind(this)),this._boundOnEventFromChild=this._onEventFromChild.bind(this),O(window).on("gl_child_event",this._boundOnEventFromChild)}_onEventFromThis(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];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,i="gl_child_event",r=(t=window.opener)===null||t===void 0?void 0:t.document.createEvent("HTMLEvents");r.initEvent(i,!0,!0),r.eventName=i,r.__glArgs=e,r.__gl=this._layoutManager,window.opener.dispatchEvent(r)}_propagateToChildren(e){for(var t=0;t<this._layoutManager.openPopouts.length;t++){var i=this._layoutManager.openPopouts[t].getGlInstance();i&&i!==this._childEventSource&&i.eventHub._$onEventFromParent(e)}}destroy(){O(window).off("gl_child_event",this._boundOnEventFromChild)}};function na(n,e,t){return n.on(e,t),()=>{n.off(e,t)}}function ia(n){return(e,t)=>na(e,n,t)}function ra(n){return function(e){for(var t=arguments.length,i=new Array(t>1?t-1:0),r=1;r<t;r++)i[r-1]=arguments[r];e.emit(n,...i)}}function oa(n){return(e,t)=>{var i=c.useRef(null),r=c.useRef(()=>!1);if(i.current!=e||r.current!=t){var o;(o=i.current)===null||o===void 0||o.off(n,r.current),e==null||e.on(n,t)}i.current=e,r.current=t,c.useEffect(()=>()=>{var s;return(s=i.current)===null||s===void 0?void 0:s.off(n,r.current)},[])}}function It(n){return{listen:ia(n),emit:ra(n),useListener:oa(n)}}const uc=Object.freeze(Object.defineProperty({__proto__:null,BubblingEvent:Ni,DragListener:Tn,EventEmitter:xe,EventHub:ta,ReactComponentHandler:ea,animFrame:Zi,filterXss:Qh,getHashValue:Qs,getQueryStringParam:Js,getUniqueId:Gn,listenForEvent:na,makeEmitFunction:ra,makeEventFunctions:It,makeListenFunction:ia,makeUseListenerFunction:oa,minifyConfig:Qi,removeFromArray:Yh,stripTags:Yi,unminifyConfig:ji},Symbol.toStringTag,{value:"Module"}));function bt(n,e,t){return(e=hc(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function hc(n){var e=cc(n,"string");return typeof e=="symbol"?e:e+""}function cc(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class sa extends xe{constructor(e,t,i,r,o){super(),bt(this,"isInitialised",!1),bt(this,"_config",void 0),bt(this,"_dimensions",void 0),bt(this,"_parentId",void 0),bt(this,"_indexInParent",void 0),bt(this,"_layoutManager",void 0),bt(this,"_popoutWindow",null),bt(this,"_id",null),this._config=e,this._dimensions=t,this._parentId=i,this._indexInParent=r,this._layoutManager=o,this._createWindow()}toConfig(){var e,t,i,r,o,s,a,l,d,h,v;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:(i=(r=(o=this._popoutWindow)===null||o===void 0?void 0:o.screenX)!==null&&r!==void 0?r:(s=this._popoutWindow)===null||s===void 0?void 0:s.screenLeft)!==null&&i!==void 0?i:0,top:(a=(l=(d=this._popoutWindow)===null||d===void 0?void 0:d.screenY)!==null&&l!==void 0?l:(h=this._popoutWindow)===null||h===void 0?void 0:h.screenTop)!==null&&a!==void 0?a:0},content:(v=this.getGlInstance())===null||v===void 0?void 0:v.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,i=null;if(this._parentId){var r;if(t=O.extend(!0,{},(r=this.getGlInstance())===null||r===void 0?void 0:r.toConfig()).content[0],i=this._layoutManager.root.getItemsById(this._parentId)[0],!i){var o;((o=this._layoutManager.root.contentItems.length)!==null&&o!==void 0?o:0)>0?i=this._layoutManager.root.contentItems[0]:i=this._layoutManager.root}}t&&((e=i)===null||e===void 0||e.addChild(t,this._indexInParent),this.close())}_createWindow(){var e=this._createUrl(),t=Math.floor(Math.random()*1e6).toString(36),i=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,i),!this._popoutWindow)if(this._layoutManager.config.settings.blockedPopoutsThrowError===!0){var r=new Error("Popout blocked");throw r.type="popoutBlocked",r}else return;O(this._popoutWindow).on("load",this._positionWindow.bind(this)).on("unload beforeunload",this._onClose.bind(this));var o=window.setInterval(()=>{var s;(s=this._popoutWindow)!==null&&s!==void 0&&s.__glInstance&&this._popoutWindow.__glInstance.isInitialised&&(this._onInitialised(),window.clearInterval(o))},10)}_serializeWindowOptions(e){var t=[],i;for(i in e)t.push(i+"="+e[i]);return t.join(",")}_createUrl(){var e={content:this._config},t="gl-window-config-"+Gn();e=Qi(e);try{localStorage.setItem(t,JSON.stringify(e))}catch(r){throw new Error("Error while writing to localStorage "+r.toString())}var i=document.location.href.split("?");return i.length===1?i[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 fe(n,e,t){return(e=mc(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function mc(n){var e=vc(n,"string");return typeof e=="symbol"?e:e+""}function vc(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class Ut extends xe{constructor(e,t,i,r,o,s){var a,l,d,h,v,m,p,f;if(super(),fe(this,"_dragListener",void 0),fe(this,"_layoutManager",void 0),fe(this,"_contentItem",void 0),fe(this,"_originalParent",void 0),fe(this,"_area",null),fe(this,"_lastValidArea",null),fe(this,"_minX",void 0),fe(this,"_maxX",void 0),fe(this,"_minY",void 0),fe(this,"_maxY",void 0),fe(this,"_width",void 0),fe(this,"_height",void 0),fe(this,"_sided",void 0),fe(this,"element",void 0),fe(this,"childElementContainer",void 0),fe(this,"_proxyTab",void 0),this._dragListener=i,this._layoutManager=r,this._contentItem=o,this._originalParent=s,this._dragListener.on("drag",this._onDrag,this),this._dragListener.on("dragStop",this._onDrop,this),this._contentItem.tab&&this._contentItem.tab.element){var g,y;this._layoutManager.tabDropPlaceholder.width((g=this._contentItem.tab.element.outerWidth(!0))!==null&&g!==void 0?g:0),this._layoutManager.tabDropPlaceholder.height((y=this._contentItem.tab.element.outerHeight(!0))!==null&&y!==void 0?y:0)}if(this.element=O(Ut._template),s&&s._side&&(this._sided=s._sided,this.element.addClass("lm_"+s._side),["right","bottom"].indexOf(s._side.toString())>=0&&this.element.find(".lm_content").after(this.element.find(".lm_header"))),this.element.css({left:e,top:t}),this._proxyTab=this.element.find(".lm_tab"),this._proxyTab.attr("title",Yi((a=this._contentItem.config.title)!==null&&a!==void 0?a:"")),this.element.find(".lm_title").text((l=this._contentItem.config.title)!==null&&l!==void 0?l:""),this.childElementContainer=this.element.find(".lm_content"),this.childElementContainer.append(o.element),this._updateTree(),this._layoutManager._$calculateItemAreas(),O(document.body).append(this.element),this._setDimensions(),!this._contentItem.tab&&this._proxyTab.length){var S,_;this._layoutManager.tabDropPlaceholder.width((S=this._proxyTab.outerWidth(!0))!==null&&S!==void 0?S:0),this._layoutManager.tabDropPlaceholder.height((_=this._proxyTab.outerHeight(!0))!==null&&_!==void 0?_:0)}var C=this._layoutManager.container.offset();this._minX=(d=C==null?void 0:C.left)!==null&&d!==void 0?d:0,this._minY=(h=C==null?void 0:C.top)!==null&&h!==void 0?h:0,this._maxX=((v=this._layoutManager.container.width())!==null&&v!==void 0?v:0)+this._minX,this._maxY=((m=this._layoutManager.container.height())!==null&&m!==void 0?m:0)+this._minY,this._width=(p=this.element.width())!==null&&p!==void 0?p:0,this._height=(f=this.element.height())!==null&&f!==void 0?f:0,this._setDropPosition(e,t),this._layoutManager.emit("itemPickedUp",this._contentItem)}_onDrag(e,t,i){var r,o,s=(r=i.pageX)!==null&&r!==void 0?r:0,a=(o=i.pageY)!==null&&o!==void 0?o:0,l=s>this._minX&&s<this._maxX&&a>this._minY&&a<this._maxY;!l&&this._layoutManager.config.settings.constrainDragToContainer===!0||this._setDropPosition(s,a)}_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,i=e.dragProxyHeight;this.element.width(t),this.element.height(i),t-=this._sided?e.headerHeight:0,i-=this._sided?0:e.headerHeight,this.childElementContainer.width(t),this.childElementContainer.height(i),this._contentItem.element.width(t),this._contentItem.element.height(i),this._contentItem.callDownwards("_$show"),this._contentItem.callDownwards("setSize")}}fe(Ut,"_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 Nn(n,e,t){return(e=pc(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function pc(n){var e=fc(n,"string");return typeof e=="symbol"?e:e+""}function fc(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class aa{constructor(e,t,i){Nn(this,"_element",void 0),Nn(this,"_itemConfig",void 0),Nn(this,"_layoutManager",void 0),Nn(this,"_dragListener",void 0),this._element=e,this._itemConfig=t,this._layoutManager=i,this._dragListener=this._createDragListener()}_createDragListener(){return this._dragListener=new Tn(this._element,!0),this._dragListener.on("dragStart",this._onDragStart,this),this._dragListener.on("dragStop",this._createDragListener,this),this._dragListener}_onDragStart(e,t){var i=this._itemConfig;typeof i=="function"&&(i=i());var r=this._layoutManager._$normalizeContentItem(O.extend(!0,{},i));new Ut(e,t,this._dragListener,this._layoutManager,r,null)}}function An(n,e,t){return(e=gc(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function gc(n){var e=bc(n,"string");return typeof e=="symbol"?e:e+""}function bc(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class la{constructor(e,t,i){An(this,"_element",O(window)),An(this,"_itemConfig",void 0),An(this,"_layoutManager",void 0),An(this,"_dragListener",void 0),this._itemConfig=e,this._layoutManager=t,this._createDragListener(i)}_createDragListener(e){this._dragListener&&this._dragListener.destroy(),this._element&&(this._dragListener=new Tn(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 i=this._itemConfig;typeof i=="function"&&(i=i());var r=this._layoutManager._$normalizeContentItem(O.extend(!0,{},i));new Ut(e,t,this._dragListener,this._layoutManager,r,null)}}}function da(n,e,t){return(e=yc(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function yc(n){var e=Cc(n,"string");return typeof e=="symbol"?e:e+""}function Cc(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class On{constructor(){da(this,"element",O(On._template)),O(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()}}da(On,"_template",'<div class="lm_dropTargetIndicator"><div class="lm_inner"></div></div>');function yi(n,e,t){return(e=wc(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function wc(n){var e=Sc(n,"string");return typeof e=="symbol"?e:e+""}function Sc(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class cn{constructor(e,t,i,r){yi(this,"element",void 0),yi(this,"_header",void 0),yi(this,"_action",void 0),this._header=e,this.element=O('<li class="'+i+'" title="'+t+'"></li>'),this._header.on("destroy",this._$destroy,this),this._action=r,this.element.on("click",this._action),this._header.controlsContainer.append(this.element)}_$destroy(){this.element.off(),this.element.remove()}}function _c(n,e,t){return(e=Ec(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Ec(n){var e=Pc(n,"string");return typeof e=="symbol"?e:e+""}function Pc(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class Nt extends Error{constructor(e,t){super(),_c(this,"node",void 0),this.name="Configuration Error",this.message=e,this.node=t}}const Tc=Object.freeze(Object.defineProperty({__proto__:null,ConfigurationError:Nt},Symbol.toStringTag,{value:"Module"}));function ve(n,e,t){return(e=Oc(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Oc(n){var e=xc(n,"string");return typeof e=="symbol"?e:e+""}function xc(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function Lt(n){return n.isStack}function Re(n){return n.isComponent}function ua(n){return n.isRoot}class be extends xe{constructor(e,t,i,r){super(),ve(this,"config",void 0),ve(this,"type",void 0),ve(this,"contentItems",void 0),ve(this,"parent",void 0),ve(this,"layoutManager",void 0),ve(this,"element",void 0),ve(this,"childElementContainer",void 0),ve(this,"componentName",void 0),ve(this,"isInitialised",!1),ve(this,"isMaximised",!1),ve(this,"isRoot",!1),ve(this,"isRow",!1),ve(this,"isColumn",!1),ve(this,"isStack",!1),ve(this,"isComponent",!1),ve(this,"tab",void 0),ve(this,"_pendingEventPropagations",void 0),ve(this,"_throttledEvents",void 0),this.element=r,this.config=this._extendItemNode(t),this.type=t.type,this.contentItems=[],this.parent=i,this.layoutManager=e,this._pendingEventPropagations={},this._throttledEvents=["stateChanged"],this.on(xe.ALL_EVENT,this._propagateEvent,this),t.content&&this._createContentItems(t)}callDownwards(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;i!==!0&&r!==!0&&this[e].apply(this,t);for(var o=0;o<this.contentItems.length;o++)this.contentItems[o].callDownwards(e,t,i);i===!0&&r!==!0&&this[e].apply(this,t)}removeChild(e){var t,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,r=this.contentItems.indexOf(e);if(r===-1)throw new Error("Can't remove child item. Unknown content item");if(i!==!0&&this.contentItems[r]._$destroy(),this.contentItems.splice(r,1),(t=this.config.content)===null||t===void 0||t.splice(r,1),this.contentItems.length>0)this.callDownwards("setSize");else if(this.type!=="root"&&this.config.isClosable){var o;(o=this.parent)===null||o===void 0||o.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 i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;t=this.layoutManager._$normalizeContentItem(t);var r=this.contentItems.indexOf(e),o=e.element[0].parentNode;if(r===-1)throw new Error("Can't replace child. oldChild is not child of this");o==null||o.replaceChild(t.element[0],e.element[0]),i===!0&&(e.parent=null,e._$destroy()),this.contentItems[r]=t,t.parent=this,Lt(this)&&(this.header.tabs[r].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=[],i=function r(o){for(var s=0;s<o.contentItems.length;s++)e(o.contentItems[s])===!0&&t.push(o.contentItems[s]),r(o.contentItems[s])};return i(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),i=[],r=0;r<t.length;r++)i.push(t[r].instance);return i}_$getItemsByProperty(e,t){return this.getItemsByFilter(function(i){return i[e]===t})}_$setParent(e){this.parent=e}_$highlightDropZone(e,t,i){var r;(r=this.layoutManager.dropTargetIndicator)===null||r===void 0||r.highlightArea(i)}_$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"),i=null,r=0;r<t.length;r++)i=t[r].getActiveContentItem(),i&&Re(i)&&i.container[e]()}_$destroy(){this.emitBubblingEvent("beforeItemDestroyed"),this.callDownwards("_$destroy",[],!0,!0),this.element.remove(),this.emitBubblingEvent("itemDestroyed")}_$getArea(e){var t,i,r;e=e||this.element;var o=(t=e.offset())!==null&&t!==void 0?t:{left:0,top:0},s=(i=e.width())!==null&&i!==void 0?i:0,a=(r=e.height())!==null&&r!==void 0?r:0;return{x1:o.left,y1:o.top,x2:o.left+s,y2:o.top+a,surface:s*a,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 Ni(e,this);this.emit(e,t)}_createContentItems(e){var t;if(!(e.content instanceof Array))throw new Nt("content must be an Array",e);for(var i=0;i<e.content.length;i++)t=this.layoutManager.createContentItem(e.content[i],this),this.contentItems.push(t)}_extendItemNode(e){for(var[t,i]of Object.entries(Ys)){var r=t;e[r]===void 0&&(e[r]=i)}return e}_propagateEvent(e,t){t instanceof Ni&&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,Zi(this._propagateEventToLayoutManager.bind(this,e,t)))}_propagateEventToLayoutManager(e,t){this._pendingEventPropagations[e]=!1,this.layoutManager.emit(e,t)}}function dn(n,e,t){return(e=Ic(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Ic(n){var e=Dc(n,"string");return typeof e=="symbol"?e:e+""}function Dc(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class ha extends be{constructor(e,t,i){var r;Object.entries((r=e.config.settings.defaultComponentConfig)!==null&&r!==void 0?r:{}).forEach(a=>{var[l,d]=a;t[l]===void 0&&(t[l]=d)}),super(e,t,i,O()),dn(this,"config",void 0),dn(this,"componentName",void 0),dn(this,"container",void 0),dn(this,"parent",void 0),dn(this,"instance",void 0),this.config=t,this.parent=i;var o=e.getComponent(this.config.componentName)||e.getFallbackComponent(),s=O.extend(!0,{},this.config.componentState||{});if(o==null)throw new Nt('Unknown component "'+this.config.componentName+'"');s.componentName=this.config.componentName,this.componentName=this.config.componentName,this.config.title===""&&(this.config.title=this.config.componentName),this.isComponent=!0,this.container=new ki(this.config,this,e),this.instance=new o(this.container,s),this.element=this.container._element}close(){var e;(e=this.parent)===null||e===void 0||e.removeChild(this)}setSize(){this.element.is(":visible")&&this.container._$setSize(this.element.width(),this.element.height())}_$init(){be.prototype._$init.call(this),this.container.emit("open")}_$hide(){this.container.hide(),be.prototype._$hide.call(this)}_$show(e){this.container.show(),(this.container._config.isFocusOnShow||e)&&this.container._contentElement[0].focus({preventScroll:!0}),be.prototype._$show.call(this)}_$destroy(){this.container.emit("destroy",this),be.prototype._$destroy.call(this)}_$getArea(){return null}}function Be(n,e,t){return(e=Mc(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Mc(n){var e=kc(n,"string");return typeof e=="symbol"?e:e+""}function kc(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class yn extends be{constructor(e,t,i,r){super(t,i,r,O('<div class="lm_item lm_'+(e?"column":"row")+'"></div>')),Be(this,"isRow",void 0),Be(this,"isColumn",void 0),Be(this,"childElementContainer",void 0),Be(this,"parent",void 0),Be(this,"_splitter",[]),Be(this,"_splitterSize",void 0),Be(this,"_splitterGrabSize",void 0),Be(this,"_isColumn",void 0),Be(this,"_dimension",void 0),Be(this,"_splitterPosition",null),Be(this,"_splitterMinPosition",null),Be(this,"_splitterMaxPosition",null),this.parent=r,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,i){var r,o,s,a;if(e=this.layoutManager._$normalizeContentItem(e,this),t===void 0&&(t=this.contentItems.length),this.contentItems.length>0?(a=this._createSplitter(Math.max(0,t-1)).element,t>0?(this.contentItems[t-1].element.after(a),a.after(e.element)):(this.contentItems[0].element.before(a),a.before(e.element))):this.childElementContainer.append(e.element),be.prototype.addChild.call(this,e,t),r=1/this.contentItems.length*100,i===!0){this.emitBubblingEvent("stateChanged");return}for(s=0;s<this.contentItems.length;s++)if(this.contentItems[s]===e)e.config[this._dimension]=r;else{var l;o=((l=this.contentItems[s].config[this._dimension])!==null&&l!==void 0?l:0)*(100-r)/100,this.contentItems[s].config[this._dimension]=o}this.callDownwards("setSize"),this.emitBubblingEvent("stateChanged")}removeChild(e,t){var i,r=(i=e.config[this._dimension])!==null&&i!==void 0?i:0,o=this.contentItems.indexOf(e),s=Math.max(o-1,0),a,l;if(o===-1)throw new Error("Can't remove child. ContentItem is not child of this Row or Column");for(this._splitter[s]&&(this._splitter[s]._$destroy(),this._splitter.splice(s,1)),a=0;a<this.contentItems.length;a++)if(this.contentItems[a]!==e){var d;this.contentItems[a].config[this._dimension]=((d=this.contentItems[a].config[this._dimension])!==null&&d!==void 0?d:0)+r/(this.contentItems.length-1)}if(be.prototype.removeChild.call(this,e,t),this.contentItems.length===1&&this.config.isClosable===!0){var h;l=this.contentItems[0],this.contentItems=[],(h=this.parent)===null||h===void 0||h.replaceChild(this,l,!0)}else this.callDownwards("setSize"),this.emitBubblingEvent("stateChanged")}replaceChild(e,t){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,r=e.config[this._dimension];t.config[this._dimension]=r,super.replaceChild(e,t,i),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(be.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,i=(this.contentItems.length-1)*this._splitterSize,r=(e=this.element.width())!==null&&e!==void 0?e:0,o=(t=this.element.height())!==null&&t!==void 0?t:0,s=0,a=[];this._isColumn?o-=i:r-=i;for(var l=0;l<this.contentItems.length;l++){var d,h,v=this._isColumn?Math.floor(o*(((d=this.contentItems[l].config.height)!==null&&d!==void 0?d:0)/100)):Math.floor(r*(((h=this.contentItems[l].config.width)!==null&&h!==void 0?h:0)/100));s+=v,a.push(v)}var m=Math.floor((this._isColumn?o:r)-s);return{itemSizes:a,additionalPixel:m,totalWidth:r,totalHeight:o}}_calculateRelativeSizes(){for(var e=0,t=[],i=this._isColumn?"height":"width",r=0;r<this.contentItems.length;r++){var o=this.contentItems[r].config[i];o!=null?e+=o:t.push(this.contentItems[r])}if(Math.round(e)===100){this._respectMinItemWidth();return}if(Math.round(e)<100&&t.length>0){for(var s=0;s<t.length;s++)t[s].config[i]=(100-e)/t.length;this._respectMinItemWidth();return}if(Math.round(e)>100)for(var a=0;a<t.length;a++)t[a].config[i]=50,e+=50;for(var l=0;l<this.contentItems.length;l++){var d;this.contentItems[l].config[i]=((d=this.contentItems[l].config[i])!==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,i=[],r=0,o=0,s=0,a=[],l;if(!(this._isColumn||!t||this.contentItems.length<=1)){for(var d=this._calculateAbsoluteSizes(),h=0;h<this.contentItems.length;h++){this.contentItems[h];var v=d.itemSizes[h];v<t?(o+=t-v,l={width:t}):(r+=v-t,l={width:v},i.push(l)),a.push(l)}if(!(o===0||o>r)){var m=o/r;s=o;for(var p=0;p<i.length;p++){l=i[p];var f=Math.round((l.width-t)*m);s-=f,l.width-=f}s!==0&&(a[a.length-1].width-=s);for(var g=0;g<this.contentItems.length;g++)this.contentItems[g].config.width=a[g].width/d.totalWidth*100}}}_createSplitter(e){var t;return t=new ca(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,i=0,r=0;r<e.length;++r){var o,s;t=Math.max((o=e[r].minWidth)!==null&&o!==void 0?o:0,t),i=Math.max((s=e[r].minHeight)!==null&&s!==void 0?s:0,i)}return{horizontal:t,vertical:i}}_onSplitterDragStart(e){var t,i,r,o,s=this._getItemsForSplitter(e),a=this.layoutManager.config.dimensions[this._isColumn?"minItemHeight":"minItemWidth"],l=this._getMinimumDimensions((t=s.before.config.content)!==null&&t!==void 0?t:[]),d=this._isColumn?l.vertical:l.horizontal,h=this._getMinimumDimensions((i=s.after.config.content)!==null&&i!==void 0?i:[]),v=this._isColumn?h.vertical:h.horizontal;this._splitterPosition=0,this._splitterMinPosition=-1*(((r=s.before.element[this._dimension]())!==null&&r!==void 0?r:0)-(d||a)),this._splitterMaxPosition=((o=s.after.element[this._dimension]())!==null&&o!==void 0?o:0)-(v||a)}_onSplitterDrag(e,t,i){var r=this._isColumn?i:t;this._splitterMaxPosition==null||this._splitterMinPosition==null||r>this._splitterMinPosition&&r<this._splitterMaxPosition&&(this._splitterPosition=r,e.element.css(this._isColumn?"top":"left",r))}_onSplitterDragStop(e){var t,i,r,o,s,a=this._getItemsForSplitter(e),l=(t=a.before.element[this._dimension]())!==null&&t!==void 0?t:0,d=(i=a.after.element[this._dimension]())!==null&&i!==void 0?i:0,h=(((r=this._splitterPosition)!==null&&r!==void 0?r:0)+l)/(l+d),v=((o=a.before.config[this._dimension])!==null&&o!==void 0?o:0)+((s=a.after.config[this._dimension])!==null&&s!==void 0?s:0);a.before.config[this._dimension]=h*v,a.after.config[this._dimension]=(1-h)*v,e.element.css({top:0,left:0}),Zi(this.callDownwards.bind(this,"setSize",void 0,void 0,void 0))}}function Zr(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(n);e&&(i=i.filter(function(r){return Object.getOwnPropertyDescriptor(n,r).enumerable})),t.push.apply(t,i)}return t}function Yr(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Zr(Object(t),!0).forEach(function(i){Ai(n,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Zr(Object(t)).forEach(function(i){Object.defineProperty(n,i,Object.getOwnPropertyDescriptor(t,i))})}return n}function Ai(n,e,t){return(e=jc(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function jc(n){var e=Nc(n,"string");return typeof e=="symbol"?e:e+""}function Nc(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class Li extends be{constructor(e,t,i){super(e,Yr(Yr({},t),{},{type:"root"}),null,O('<div class="lm_goldenlayout lm_item lm_root"></div>')),Ai(this,"childElementContainer",void 0),Ai(this,"_containerElement",void 0),this.isRoot=!0,this.type="root",this.childElementContainer=this.element,this._containerElement=i,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 i,r;e=typeof e>"u"?(i=this._containerElement.width())!==null&&i!==void 0?i:0:e,t=typeof t>"u"?(r=this._containerElement.height())!==null&&r!==void 0?r: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,i){this.layoutManager.tabDropPlaceholder.remove(),super._$highlightDropZone(e,t,i)}_$onDrop(e,t){var i;if(Re(e)&&(i=this.layoutManager.createContentItem({type:"stack",header:e.config.header||{}},this),i._$init(),i.addChild(e),e=i),!this.contentItems.length)this.addChild(e);else{var{side:r}=t,o=r==="left"||r==="right"?"row":"column",s=r==="left"||r==="right"?"width":"height",a=r==="left"||r==="top",l=this.contentItems[0];if(!(l instanceof yn)||l.type!=o){var d=this.layoutManager.createContentItem({type:o},this);this.replaceChild(l,d),d.addChild(e,a?0:void 0,!0),d.addChild(l,a?void 0:0,!0),l.config[s]=50,e.config[s]=50,d.callDownwards("setSize")}else{var h,v=l.contentItems[a?0:l.contentItems.length-1];l.addChild(e,a?0:void 0,!0),v.config[s]=((h=v.config[s])!==null&&h!==void 0?h:0)*.5,e.config[s]=v.config[s],l.callDownwards("setSize")}}}}function Qr(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(n);e&&(i=i.filter(function(r){return Object.getOwnPropertyDescriptor(n,r).enumerable})),t.push.apply(t,i)}return t}function Wt(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Qr(Object(t),!0).forEach(function(i){Ae(n,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Qr(Object(t)).forEach(function(i){Object.defineProperty(n,i,Object.getOwnPropertyDescriptor(t,i))})}return n}function Ae(n,e,t){return(e=Ac(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Ac(n){var e=Lc(n,"string");return typeof e=="symbol"?e:e+""}function Lc(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class Ri extends be{constructor(e,t,i){var r,o,s,a,l,d,h,v,m;super(e,t,i,O('<div class="lm_item lm_stack"></div>')),Ae(this,"_activeContentItem",null),Ae(this,"_header",void 0),Ae(this,"childElementContainer",O('<div class="lm_items"></div>')),Ae(this,"header",void 0),Ae(this,"parent",void 0),Ae(this,"isStack",!0),Ae(this,"_dropSegment",null),Ae(this,"_contentAreaDimensions",null),Ae(this,"_dropIndex",void 0),Ae(this,"_side",void 0),Ae(this,"_sided",!1),Ae(this,"config",void 0),this.parent=i,this.config=t;var p=e.config;this._side=!1,this._header={show:((r=p.settings)===null||r===void 0?void 0:r.hasHeaders)&&t.hasHeaders!==!1,popout:(o=p.settings)!==null&&o!==void 0&&o.showPopoutIcon?(s=p.labels)===null||s===void 0?void 0:s.popout:void 0,maximise:(a=p.settings)!==null&&a!==void 0&&a.showMaximiseIcon?(l=p.labels)===null||l===void 0?void 0:l.maximise:void 0,close:(d=p.settings)!==null&&d!==void 0&&d.showCloseIcon?(h=p.labels)===null||h===void 0?void 0:h.close:void 0,minimise:(v=(m=p.labels)===null||m===void 0?void 0:m.minimise)!==null&&v!==void 0?v:void 0},p.header&&(this._header=Wt(Wt({},this._header),p.header)),t.header&&(this._header=Wt(Wt({},this._header),t.header)),t.content&&t.content[0]&&t.content[0].header&&(this._header=Wt(Wt({},this._header),t.content[0].header)),this.header=new pt(e,this),this.element.append(this.header.element),this.element.append(this.childElementContainer),this._setupHeaderPosition(),this._$validateClosability()}setSize(){var e,t,i,r,o,s=this._header.show&&(e=(t=this.layoutManager.config.dimensions)===null||t===void 0?void 0:t.headerHeight)!==null&&e!==void 0?e:0,a=((i=this.element.width())!==null&&i!==void 0?i:0)-(this._sided?s:0),l=((r=this.element.height())!==null&&r!==void 0?r:0)-(this._sided?0:s);for(this.childElementContainer.width(a),this.childElementContainer.height(l),o=0;o<this.contentItems.length;o++)this.contentItems[o].element.width(a).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,t){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),Re(e)?e._$show(t):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,i=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(i-1,0)]):this._activeContentItem=null),this._$validateClosability(),this.emitBubblingEvent("stateChanged")}_$validateClosability(){for(var e=this.header._isClosable(),t=0,i=this.contentItems.length;t<i;t++){var r;if(!e)break;e=(r=this.contentItems[t].config.isClosable)!==null&&r!==void 0?r:!1}this.header._$setClosable(e)}_$destroy(){be.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",i=this._dropSegment==="left"||this._dropSegment==="right",r=this._dropSegment==="top"||this._dropSegment==="left",o=this.parent instanceof yn&&(t&&this.parent.isColumn||i&&this.parent.isRow),s=t?"column":"row",a=t?"height":"width";if(Re(e)){var l=this.layoutManager.createContentItem({type:"stack",header:e.config.header||{}},this);l._$init(),l.addChild(e),e=l}if(o){var d,h=this.parent.contentItems.indexOf(this);this.parent.addChild(e,r?h:h+1,!0),this.config[a]=((d=this.config[a])!==null&&d!==void 0?d:0)*.5,e.config[a]=this.config[a],this.parent.callDownwards("setSize")}else{var v,m=this.layoutManager.createContentItem({type:s},this);(v=this.parent)===null||v===void 0||v.replaceChild(this,m),m.addChild(e,r?0:void 0,!0),m.addChild(this,r?void 0:0,!0),this.config[a]=50,e.config[a]=50,m.callDownwards("setSize")}}_$highlightDropZone(e,t){if(this._contentAreaDimensions)for(var[i,r]of Object.entries(this._contentAreaDimensions)){var o=r.hoverArea;if(o.x1<e&&o.x2>e&&o.y1<t&&o.y2>t){i==="header"?(this._dropSegment="header",this._highlightHeaderDropZone(e)):(this._resetHeaderDropZone(),this._highlightBodyDropZone(i));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 i=t.x2-t.x1,r=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+i*.25,y2:t.y2},highlightArea:{x1:t.x1,y1:t.y1,x2:t.x1+i*.5,y2:t.y2}},this._contentAreaDimensions.top={hoverArea:{x1:t.x1+i*.25,y1:t.y1,x2:t.x1+i*.75,y2:t.y1+r*.5},highlightArea:{x1:t.x1,y1:t.y1,x2:t.x2,y2:t.y1+r*.5}},this._contentAreaDimensions.right={hoverArea:{x1:t.x1+i*.75,y1:t.y1,x2:t.x2,y2:t.y2},highlightArea:{x1:t.x1+i*.5,y1:t.y1,x2:t.x2,y2:t.y2}},this._contentAreaDimensions.bottom={hoverArea:{x1:t.x1+i*.25,y1:t.y1+r*.5,x2:t.x1+i*.75,y2:t.y2},highlightArea:{x1:t.x1,y1:t.y1+r*.5,x2:t.x2,y2:t.y2}},super._$getArea(this.element))}_highlightHeaderDropZone(e){var t,i,r,o,s,a,l,d,h,v,m,p,f,g,y,S,_=this.header.tabs.length;if(_===0){var C,D,W,X,I,V,A,J,ee=this.header.element.offset();(C=this.layoutManager.dropTargetIndicator)===null||C===void 0||C.highlightArea({x1:(D=ee==null?void 0:ee.left)!==null&&D!==void 0?D:0,x2:((W=ee==null?void 0:ee.left)!==null&&W!==void 0?W:0)+100,y1:(X=(I=this.header.element.offset())===null||I===void 0?void 0:I.top)!==null&&X!==void 0?X:0,y2:((V=(A=this.header.element.offset())===null||A===void 0?void 0:A.top)!==null&&V!==void 0?V:0)+((J=this.header.element.innerHeight())!==null&&J!==void 0?J:0)});return}var j=this.header.tabsContainer,G=(t=j.get(0))===null||t===void 0?void 0:t.getBoundingClientRect(),F=(i=this.layoutManager.tabDropPlaceholder.get(0))===null||i===void 0?void 0:i.getBoundingClientRect();if(!(!G||!F)){e<G.left?e=G.left+1:e>G.right&&(e=G.right-1);var M,$;if(!(F.left<e&&e<F.right)){for(var B=0;B<_;B++){var me;if(M=this.header.tabs[B].element,$=(me=M.get(0))===null||me===void 0?void 0:me.getBoundingClientRect(),$&&$.left<e&&e<$.right){this._dropIndex=B;break}}if(M&&$&&e<$.left+$.width*.5)M.before(this.layoutManager.tabDropPlaceholder);else if(M){var it;this._dropIndex=Math.min(((it=this._dropIndex)!==null&&it!==void 0?it:0)+1,_),M.after(this.layoutManager.tabDropPlaceholder)}}var Xe=(r=(o=this.layoutManager.tabDropPlaceholder.offset())===null||o===void 0?void 0:o.left)!==null&&r!==void 0?r:0;Xe=Math.max(Xe,(s=(a=this.header.tabsContainer.offset())===null||a===void 0?void 0:a.left)!==null&&s!==void 0?s:0);var N=Xe+((l=this.layoutManager.tabDropPlaceholder.width())!==null&&l!==void 0?l:0);N=Math.min(N,((d=(h=this.header.tabsContainer.offset())===null||h===void 0?void 0:h.left)!==null&&d!==void 0?d:0)+((v=this.header.tabsContainer.innerWidth())!==null&&v!==void 0?v:0)),(m=this.layoutManager.dropTargetIndicator)===null||m===void 0||m.highlightArea({x1:Xe,x2:N,y1:(p=(f=this.header.element.offset())===null||f===void 0?void 0:f.top)!==null&&p!==void 0?p:0,y2:((g=(y=this.header.element.offset())===null||y===void 0?void 0:y.top)!==null&&g!==void 0?g:0)+((S=this.header.element.innerHeight())!==null&&S!==void 0?S:0)})}}_resetHeaderDropZone(){this.layoutManager.tabDropPlaceholder.remove()}_setupHeaderPosition(){var e=["right","left","bottom"].some(i=>i===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,i,r=(t=this._contentAreaDimensions)===null||t===void 0||(i=t[e])===null||i===void 0?void 0:i.highlightArea;if(r){var o;(o=this.layoutManager.dropTargetIndicator)===null||o===void 0||o.highlightArea(r)}this._dropSegment=e}}const Rc=Object.freeze(Object.defineProperty({__proto__:null,AbstractContentItem:be,Component:ha,ContentItem:be,Root:Li,RowOrColumn:yn,Stack:Ri,isComponent:Re,isRoot:ua,isStack:Lt},Symbol.toStringTag,{value:"Module"}));function dt(n,e,t){return(e=Fc(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Fc(n){var e=$c(n,"string");return typeof e=="symbol"?e:e+""}function $c(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class xn{constructor(e,t){var i;dt(this,"header",void 0),dt(this,"contentItem",void 0),dt(this,"element",O(xn._template)),dt(this,"titleElement",void 0),dt(this,"closeElement",void 0),dt(this,"isActive",!1),dt(this,"_layoutManager",void 0),dt(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,(i=this._layoutManager.config.settings)!==null&&i!==void 0&&i.reorderEnabled&&t.config.reorderEnabled&&(this._dragListener=new Tn(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.element.on("mouseup",this._onMouseUp),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),Re(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.text(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.element.off("mouseup",this._onMouseUp),this.closeElement.off("click",this._onCloseClick),Re(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 i;(i=this.contentItem.parent)!==null&&i!==void 0&&i.isMaximised&&this.contentItem.parent.toggleMaximise(),this._dragListener&&new Ut(e,t,this._dragListener,this._layoutManager,this.contentItem,this.header.parent)}_onTabContentFocusIn(){O(".lm_focusin",this._layoutManager.root.element).removeClass("lm_focusin"),this.element.addClass("lm_focusin")}_onTabContentFocusOut(){Re(this.contentItem)&&!this.contentItem.container._contentElement[0].contains(document.activeElement)&&this.element.removeClass("lm_focusin")}_onTabClick(e){if(!e||e.button===0){var t,i=this.header.parent.getActiveContentItem();this.contentItem!==i&&Re(this.contentItem)?this.header.parent.setActiveContentItem(this.contentItem):Re(this.contentItem)&&!this.contentItem.container._contentElement[0].contains(document.activeElement)&&this.contentItem.container._contentElement.focus(),Re(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(),Re(this.contentItem)?this.contentItem.container.close():this.header.parent.removeChild(this.contentItem)}_onMouseUp(e){e.button===1&&(e.preventDefault(),e.stopPropagation())}_onCloseMousedown(e){e.stopPropagation()}}dt(xn,"_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 q(n,e,t){return(e=Hc(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Hc(n){var e=Uc(n,"string");return typeof e=="symbol"?e:e+""}function Uc(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class pt extends xe{constructor(e,t){var i,r;super(),q(this,"layoutManager",void 0),q(this,"element",O(pt._template)),q(this,"tabsContainer",void 0),q(this,"tabDropdownContainer",void 0),q(this,"tabDropdownSearch",void 0),q(this,"tabDropdownList",null),q(this,"controlsContainer",void 0),q(this,"parent",void 0),q(this,"tabs",[]),q(this,"activeContentItem",null),q(this,"closeButton",null),q(this,"tabDropdownButton",null),q(this,"tabNextButton",O(pt._nextButtonTemplate)),q(this,"tabPreviousButton",O(pt._previousButtonTemplate)),q(this,"holdTimer",null),q(this,"rAF",null),q(this,"CLICK_TIMEOUT",500),q(this,"START_SPEED",.01),q(this,"ACCELERATION",5e-4),q(this,"PADDING",10),q(this,"SCROLL_LEFT","left"),q(this,"SCROLL_RIGHT","right"),q(this,"isDraggingTab",!1),q(this,"isOverflowing",!1),q(this,"isDropdownShown",!1),q(this,"dropdownKeyIndex",0),q(this,"_lastVisibleTabIndex",-1),q(this,"_tabControlOffset",void 0),this.layoutManager=e,(i=this.layoutManager.config.settings)!==null&&i!==void 0&&i.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=(r=this.layoutManager.config.settings)===null||r===void 0?void 0:r.tabControlOffset,this._createControls()}createTab(e,t){for(var i=0;i<this.tabs.length;i++)if(this.tabs[i].contentItem===e)return;var r=new xn(this,e);if(this.tabs.length===0){this.tabs.push(r),this.tabsContainer.append(r.element);return}t===void 0&&(t=this.tabs.length),t>0?this.tabs[t-1].element.after(r.element):this.tabs[0].element.before(r.element),this.tabs.splice(t,0,r),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,i,r,o,s=0;s<this.tabs.length;s++)o=this.tabs[s].contentItem===e,this.tabs[s].setActive(o),o===!0&&(this.activeContentItem=e,this.parent.config.activeItemIndex=s);(t=this.tabs[(r=this.parent.config.activeItemIndex)!==null&&r!==void 0?r:0].element.get(0))===null||t===void 0||(i=t.scrollIntoView)===null||i===void 0||i.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 i=Math.abs(e.deltaY)>Math.abs(e.deltaX)?e.deltaY:e.deltaX;if(e.deltaMode===WheelEvent.DOM_DELTA_PAGE){var r;i*=(r=this.tabsContainer.innerWidth())!==null&&r!==void 0?r:1}else e.deltaMode===WheelEvent.DOM_DELTA_LINE&&(i*=100/3);t.scrollLeft+=Math.round(i)}}_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 i,r,o,s,a;if(((i=(r=this.tabs[t].element.get(0))===null||r===void 0?void 0:r.offsetLeft)!==null&&i!==void 0?i:0)>((o=(s=this.tabsContainer.get(0))===null||s===void 0?void 0:s.offsetWidth)!==null&&o!==void 0?o: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:"nearest"}),this._handleScrollButtonMouseDown(this.SCROLL_RIGHT);else{var l=this.tabsContainer.get(0);if(l){var d,h;l.scrollLeft=(d=(h=this.tabsContainer.get(0))===null||h===void 0?void 0:h.scrollWidth)!==null&&d!==void 0?d:0}}}_handlePreviousButtonMouseDown(){for(var e,t=this.tabs.length-1;t>=0;t-=1){var i,r,o;if(((i=(r=this.tabs[t].element.get(0))===null||r===void 0?void 0:r.offsetLeft)!==null&&i!==void 0?i:0)<((o=this.tabsContainer.scrollLeft())!==null&&o!==void 0?o:0)){e=this.tabs[t].element.get(0);break}}if(e)e.scrollIntoView({behavior:"smooth",inline:"start"}),this._handleScrollButtonMouseDown(this.SCROLL_LEFT);else{var s=this.tabsContainer.get(0);s&&(s.scrollLeft=0)}}_handleScrollButtonMouseDown(e){this.holdTimer=window.setTimeout(()=>{var t;this._handleScrollRepeat(e,(t=this.tabsContainer.scrollLeft())!==null&&t!==void 0?t:0,100)},this.CLICK_TIMEOUT),window.addEventListener("mouseup",this._handleScrollButtonMouseUp)}_handleScrollButtonMouseUp(){var e,t;clearTimeout((e=this.holdTimer)!==null&&e!==void 0?e:-1),this.holdTimer=null,cancelAnimationFrame((t=this.rAF)!==null&&t!==void 0?t:-1),this.rAF=null,window.removeEventListener("mouseup",this._handleScrollButtonMouseUp)}_checkScrollArrows(){var e,t,i;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)===((i=this.tabsContainer.get(0))===null||i===void 0?void 0:i.scrollWidth)?this.tabNextButton.prop("disabled",!0):(this.tabNextButton.prop("disabled",!1),this.tabPreviousButton.first().prop("disabled",!1))}_handleScrollRepeat(e,t){var i,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,o=arguments.length>3?arguments[3]:void 0,s=this.tabsContainer.get(0);if(s){var a=s.getBoundingClientRect();if(e===this.SCROLL_LEFT){if(this.tabsContainer.scrollLeft(t-r),this.isDraggingTab&&this.parent._highlightHeaderDropZone(a.left-1),this.tabsContainer.scrollLeft()===0){this._checkScrollArrows();return}}else if(e===this.SCROLL_RIGHT){var l,d;if(this.tabsContainer.scrollLeft(t+r),this.isDraggingTab&&this.parent._highlightHeaderDropZone(a.right+1),((l=this.tabsContainer.scrollLeft())!==null&&l!==void 0?l:0)+((d=this.tabsContainer.innerWidth())!==null&&d!==void 0?d:0)===s.scrollWidth){this._checkScrollArrows();return}}window.cancelAnimationFrame((i=this.rAF)!==null&&i!==void 0?i:-1),this.rAF=window.requestAnimationFrame(h=>{var v,m,p=o||h,f=h-p,g=this.START_SPEED*f+.5*this.ACCELERATION*(f*f);g=Math.min(g,(v=(m=this.tabsContainer.get(0))===null||m===void 0?void 0:m.scrollWidth)!==null&&v!==void 0?v:1/0),this._handleScrollRepeat(e,t,g,p)})}}_$setClosable(e){return this.closeButton&&this._isClosable()?(this.closeButton.element[e?"show":"hide"](),!0):!1}_$destroy(){this.emit("destroy",this);for(var e=0;e<this.tabs.length;e++)this.tabs[e]._$destroy();this._detachWheelListener(),this._handleItemDropped(),O(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,i,r,o;if(o=this.layoutManager.config.labels.tabDropdown,this.layoutManager.config.labels.tabNextLabel,this.layoutManager.config.labels.tabPreviousLabel,this.tabDropdownButton=new cn(this,o,"lm_tabdropdown",this._showAdditionalTabsDropdown),this.tabDropdownButton.element.hide(),this.controlsContainer.prepend(this.tabNextButton),this.tabNextButton.hide(),this._getHeaderSetting("popout")&&(t=this._onPopoutClick.bind(this),i=this._getHeaderSetting("popout"),new cn(this,i,"lm_popout",t)),this._getHeaderSetting("maximise")){r=this.parent.toggleMaximise.bind(this.parent);var s=this._getHeaderSetting("maximise"),a=this._getHeaderSetting("minimise"),l=new cn(this,s,"lm_maximise",r);this.parent.on("maximised",function(){l.element.attr("title",a??"")}),this.parent.on("minimised",function(){l.element.attr("title",s??"")})}this._isClosable()&&(e=this.parent.remove.bind(this.parent),i=this._getHeaderSetting("close"),this.closeButton=new cn(this,i,"lm_close",e))}_showAdditionalTabsDropdown(){if(this.isDropdownShown){this._hideAdditionalTabsDropdown();return}this.tabDropdownList=this.tabsContainer.clone(!0).appendTo(this.tabDropdownContainer).children().removeClass("lm_active"),O(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"),O(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(a,l,d){if(d==null||d.length<2)return-1;for(var h=(a+l+d.length)%d.length;h!==a;){if(d.eq(h).css("display")!=="none")return h;h=(h+l+d.length)%d.length}return a}if(e.key==="ArrowDown"||e.key==="Tab"&&e.shiftKey===!1){var i,r;e.preventDefault(),(i=this.tabDropdownList)===null||i===void 0||i.eq(this.dropdownKeyIndex).removeClass("lm_keyboard_active"),this.dropdownKeyIndex=t(this.dropdownKeyIndex,1,this.tabDropdownList),(r=this.tabDropdownList)===null||r===void 0||r.eq(this.dropdownKeyIndex).addClass("lm_keyboard_active")}else if(e.key==="ArrowUp"||e.key==="Tab"){var o,s;e.preventDefault(),(o=this.tabDropdownList)===null||o===void 0||o.eq(this.dropdownKeyIndex).removeClass("lm_keyboard_active"),this.dropdownKeyIndex=t(this.dropdownKeyIndex,-1,this.tabDropdownList),(s=this.tabDropdownList)===null||s===void 0||s.eq(this.dropdownKeyIndex).addClass("lm_keyboard_active")}}_handleFilterInput(e){if(this.tabDropdownList!=null){this.tabDropdownList.eq(this.dropdownKeyIndex).removeClass("lm_keyboard_active"),this.dropdownKeyIndex=-1;for(var t=0;t<this.tabDropdownList.length;t++){var i,r;((i=(r=this.tabs[t].contentItem.config.title)===null||r===void 0?void 0:r.toLowerCase().indexOf(e.target.value.toLowerCase()))!==null&&i!==void 0?i:-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,i;this.isDropdownShown&&(e&&(t=this.tabDropdownContainer.get(0))!==null&&t!==void 0&&t.contains(e.target)||e&&((i=this.tabDropdownButton)===null||i===void 0?void 0:i.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(),O(document).off("mousedown",this._hideAdditionalTabsDropdown)))}_updateAdditionalTabsDropdown(){var e,t,i,r;if(this.isDropdownShown&&!(!this.tabDropdownList||this.tabDropdownList.length==0)){var o=(e=(t=this.tabDropdownContainer.get(0))===null||t===void 0?void 0:t.scrollHeight)!==null&&e!==void 0?e:0;if(o!==0){var s=this.tabDropdownContainer[0].getBoundingClientRect(),a=(i=O(window).height())!==null&&i!==void 0?i:0,l=(r=O(window).width())!==null&&r!==void 0?r:0;if(this.tabDropdownButton){var d=this.tabDropdownButton.element[0].getBoundingClientRect(),h=o<a-d.bottom,v=!h&&d.bottom>a*.6,m=Math.min(d.left+(v?d.width:0),l-s.width-this.PADDING),p=v?Math.max(d.top-o,this.PADDING):d.bottom,f=a-p-this.PADDING;this.tabDropdownContainer.css({"max-height":f,top:p,left:m})}}}}_isClosable(){return!!(this.parent.config.isClosable&&this.layoutManager.config.settings.showCloseIcon)}_onPopoutClick(){if(this.layoutManager.config.settings.popoutWholeStack===!0)this.parent.popout();else{var e;(e=this.activeContentItem)===null||e===void 0||e.popout()}}_onHeaderClick(e){e.target===this.element[0]&&this.parent.select()}_updateTabSizes(){if(this.tabs.length!==0){var e=this.tabsContainer.get(0);if(this.isDropdownShown&&this._updateAdditionalTabsDropdown(),!!e){if(!this.isOverflowing&&e.scrollWidth>e.clientWidth){var t;(t=this.tabDropdownButton)===null||t===void 0||t.element.show(),this.tabNextButton.show(),this.tabPreviousButton.show(),this.isOverflowing=!0}else if(this.isOverflowing&&e.scrollWidth<=e.clientWidth){var i;(i=this.tabDropdownButton)===null||i===void 0||i.element.hide(),this.tabNextButton.hide(),this.tabPreviousButton.hide(),this.isOverflowing=!1}this.isOverflowing&&this._checkScrollArrows()}}}}q(pt,"_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(""));q(pt,"_previousButtonTemplate",['<ul class="lm_controls">','<li class="lm_tabpreviousbutton"></li>',"</ul>"].join(""));q(pt,"_nextButtonTemplate",['<li class="lm_tabnextbutton"></li>'].join(""));function un(n,e,t){return(e=Bc(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Bc(n){var e=Kc(n,"string");return typeof e=="symbol"?e:e+""}function Kc(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class ca{constructor(e,t,i){un(this,"_isVertical",void 0),un(this,"_size",void 0),un(this,"_grabSize",void 0),un(this,"_dragListener",void 0),un(this,"element",void 0),this._isVertical=e,this._size=t,this._grabSize=i<t?t:i,this.element=this._createElement(),this._dragListener=new Tn(this.element)}on(e,t,i){var r;(r=this._dragListener)===null||r===void 0||r.on(e,t,i)}_$destroy(){var e;(e=this._dragListener)===null||e===void 0||e.destroy(),this._dragListener=null,this.element.remove()}_createElement(){var e=O('<div class="lm_drag_handle"></div>'),t=O('<div class="lm_splitter"></div>');t.append(e);var i=this._grabSize-this._size,r=i/2;return this._isVertical?(e.css("top",-r),e.css("height",this._size+i),t.addClass("lm_vertical"),t.height(this._size)):(e.css("left",-r),e.css("width",this._size+i),t.addClass("lm_horizontal"),t.width(this._size)),t}}const Wc=Object.freeze(Object.defineProperty({__proto__:null,BrowserPopout:sa,DragProxy:Ut,DragSource:aa,DragSourceFromEvent:la,DropTargetIndicator:On,Header:pt,HeaderButton:cn,Splitter:ca,Tab:xn},Symbol.toStringTag,{value:"Module"}));var zc={config:zh,container:Zh,controls:Wc,errors:Tc,items:Rc,utils:uc};function Jr(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(n);e&&(i=i.filter(function(r){return Object.getOwnPropertyDescriptor(n,r).enumerable})),t.push.apply(t,i)}return t}function Ie(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Jr(Object(t),!0).forEach(function(i){Z(n,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Jr(Object(t)).forEach(function(i){Object.defineProperty(n,i,Object.getOwnPropertyDescriptor(t,i))})}return n}function Z(n,e,t){return(e=Vc(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Vc(n){var e=Gc(n,"string");return typeof e=="symbol"?e:e+""}function Gc(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var eo=["column","row","stack","component"];class er extends xe{static isLayoutItemConfig(e){return eo.includes(e.type)}static minifyConfig(e){return Qi(e)}static unminifyConfig(e){return ji(e)}constructor(e,t){super(),Z(this,"isInitialised",!1),Z(this,"_isFullPage",!1),Z(this,"_resizeTimeoutId",void 0),Z(this,"_components",{"lm-react-component":ea}),Z(this,"_fallbackComponent",void 0),Z(this,"_itemAreas",[]),Z(this,"_maximisedItem",null),Z(this,"_maximisePlaceholder",O('<div class="lm_maximise_place"></div>')),Z(this,"_creationTimeoutPassed",!1),Z(this,"_subWindowsCreated",!1),Z(this,"_dragSources",[]),Z(this,"_updatingColumnsResponsive",!1),Z(this,"_firstLoad",!0),Z(this,"_reactChildMap",new Map),Z(this,"_reactChildren",null),Z(this,"_initialHeaderHeight",void 0),Z(this,"width",null),Z(this,"height",null),Z(this,"root",void 0),Z(this,"openPopouts",[]),Z(this,"selectedItem",null),Z(this,"isSubWindow",!1),Z(this,"eventHub",new ta(this)),Z(this,"config",void 0),Z(this,"container",void 0),Z(this,"_originalContainer",void 0),Z(this,"dropTargetIndicator",null),Z(this,"tabDropPlaceholder",O('<div class="lm_drop_tab_placeholder"></div>')),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._windowKeydown=this._windowKeydown.bind(this),this.config=this._createConfig(e),this._originalContainer=t,this.container=this._getContainer(),this._initialHeaderHeight=this.config.dimensions.headerHeight,this.isSubWindow&&O("body").css("visibility","hidden")}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 i=()=>{if(this._components[e]===void 0)throw new Error("Component "+e+" is not registered");delete this._components[e]};return i}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 be))throw new Error("Root must be a ContentItem");var t={settings:Ie({},this.config.settings),dimensions:Ie({},this.config.dimensions),labels:Ie({},this.config.labels),content:[]},i=function o(s,a){for(var l in a.config)l!=="content"&&(s[l]=a.config[l]);if(s.componentName==="lm-react-component"&&(s.type="react-component"),a.contentItems.length){s.content=[];for(var d=0;d<a.contentItems.length;d++)s.content[d]={},o(s.content[d],a.contentItems[d])}};e?i(t,{contentItems:[e]}):i(t,this.root),this._$reconcilePopoutWindows(),t.openPopouts=[];for(var r=0;r<this.openPopouts.length;r++)t.openPopouts.push(this.openPopouts[r].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){O(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 On,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 i=this._reactChildMap.get(e);i===t&&(this._reactChildMap.delete(e),this._reactChildren=[...this._reactChildMap.values()],this.emit("reactChildrenChanged"))}getReactChildren(){return this._reactChildren}enableHeaders(){this.config.settings.hasHeaders=!0,this.config.dimensions.headerHeight=this._initialHeaderHeight,this._findAllStackContainers().forEach(e=>{e._header.show=!0,e.header.element.toggle(!0)}),this.updateSize()}disableHeaders(){this.config.settings.hasHeaders=!1,this.config.dimensions.headerHeight=0,this._findAllStackContainers().forEach(e=>{e._header.show=!1,e.header.element.toggle(!1)}),this.updateSize()}updateSize(e,t){var i,r;if(this.width=(i=e??this.container.width())!==null&&i!==void 0?i:0,this.height=(r=t??this.container.height())!==null&&r!==void 0?r:0,this.isInitialised===!0){if(this.root.callDownwards("setSize",[this.width,this.height]),this._maximisedItem){var o,s;this._maximisedItem.element.width((o=this.container.width())!==null&&o!==void 0?o:0),this._maximisedItem.element.height((s=this.container.height())!==null&&s!==void 0?s:0),this._maximisedItem.callDownwards("setSize")}this._adjustColumnsResponsive()}}destroy(){var e;this.isInitialised===!1||!this.root||(this._onUnload(),O(window).off("resize",this._onResize),O(window).off("unload beforeunload",this._onUnload),O(window).off("blur.lm").off("focus.lm"),O(window).off("keydown",this._windowKeydown),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 i,r;if(typeof e.type!="string")throw new Nt("Missing parameter 'type'",e);if(e.type==="react-component"&&(e.type="component",e.componentName="lm-react-component"),!er.isLayoutItemConfig(e))throw r="Unknown type '"+e.type+"'. Valid types are "+eo.join(","),new Nt(r);return e.type==="component"&&!(t instanceof Ri)&&t&&!(this.isSubWindow===!0&&t instanceof Li)&&(e={type:"stack",width:e.width,height:e.height,content:[e]}),e.id=(i=e.id)!==null&&i!==void 0?i:Gn(),e.type==="stack"?new Ri(this,e,t):e.type==="row"?new yn(!1,this,e,t):e.type==="column"?new yn(!0,this,e,t):new ha(this,e,t)}createPopout(e,t,i,r){var o=[],s=e instanceof be,a=this;if(s){var l;o=this.toConfig(e).content,i=Gn();for(var d=e.parent,h=e;((v=d)===null||v===void 0?void 0:v.contentItems.length)===1&&!d.isRoot;){var v;h=d,d=d.parent}if((l=d)===null||l===void 0||l.addId(i),r==null||Number.isNaN(r)){var m;r=(m=d)===null||m===void 0?void 0:m.contentItems.indexOf(h)}}else e instanceof Array?o=e:o=[e];if(!t&&s){var p,f,g,y=window.screenX||window.screenLeft,S=window.screenY||window.screenTop,_=(p=e.element.offset())!==null&&p!==void 0?p:{left:0,top:0};t={left:y+_.left,top: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&&!s&&(t={left:window.screenX||window.screenLeft+20,top:window.screenY||window.screenTop+20,width:500,height:309}),s&&e.remove(),!(!t||!i||r===void 0)){var C=new sa(o,t,i,r,this);return C.on("initialised",function(){a.emit("windowOpened",C)}),C.on("closed",function(){a._$reconcilePopoutWindows()}),this.openPopouts.push(C),C}}createDragSource(e,t){this.config.settings.constrainDragToContainer=!1;var i=new aa(e,t,this);return this._dragSources.push(i),i}createDragSourceFromEvent(e,t){return this.config.settings.constrainDragToContainer=!1,new la(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,i;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((i=this.container.height())!==null&&i!==void 0?i: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 i=1/0,r=null,o=0;o<this._itemAreas.length;o++){var s=this._itemAreas[o];e>s.x1&&e<s.x2&&t>s.y1&&t<s.y2&&i>s.surface&&(i=s.surface,r=s)}return r}_$createRootItemAreas(){var e=50,t=Ie({},this.root._$getArea()),i=[Ie(Ie({},t),{},{side:"left",x2:t.x1+e}),Ie(Ie({},t),{},{side:"right",x1:t.x2-e}),Ie(Ie({},t),{},{side:"top",y2:t.y1+e}),Ie(Ie({},t),{},{side:"bottom",y1:t.y2-e})];i.forEach(r=>{r.surface=(r.x2-r.x1)*(r.y2-r.y1)}),this._itemAreas.push(...i)}_$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 i=e[t];if(Lt(i)){var r=i._$getArea();if(r!==null)if(r instanceof Array)this._itemAreas=this._itemAreas.concat(r);else{var o;this._itemAreas.push(r);var s=Ie(Ie({},r),(o=r.contentItem._contentAreaDimensions)===null||o===void 0?void 0:o.header.highlightArea);s.surface=(s.x2-s.x1)*(s.y2-s.y1),this._itemAreas.push(s)}}}}_$normalizeContentItem(e,t){if(!e)throw new Error("No content item defined");if(typeof e=="function"&&(e=e()),e instanceof be)return e;if(O.isPlainObject(e)&&e.type){var i=this.createContentItem(e,t??null);return i.callDownwards("_$init"),i}else throw new Error("Invalid contentItem")}_$reconcilePopoutWindows(){for(var e=[],t=0;t<this.openPopouts.length;t++){var i;((i=this.openPopouts[t].getWindow())===null||i===void 0?void 0:i.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=i=>{if(e.push(i),i.contentItems instanceof Array)for(var r=0;r<i.contentItems.length;r++)t(i.contentItems[r])};return t(this.root),e}_bindEvents(){this._isFullPage&&O(window).resize(this._onResize),O(window).on("unload beforeunload",this._onUnload).on("blur.lm",this._windowBlur).on("focus.lm",this._windowFocus).on("keydown",this._windowKeydown)}_windowBlur(){this.root.element.addClass("lm_window_blur")}_windowFocus(){this.root.element.removeClass("lm_window_blur")}_windowKeydown(e){if(e.key==="Escape"&&this._maximisedItem!==null){var t=document.activeElement;if(t&&(t.tagName==="INPUT"||t.tagName==="TEXTAREA"||t.tagName==="SELECT"||t.isContentEditable))return;this._maximisedItem.toggleMaximise()}}_onResize(){clearTimeout(this._resizeTimeoutId),this._resizeTimeoutId=window.setTimeout(this.updateSize.bind(this),100)}_createConfig(e){var t,i=Js("gl-window");i&&(this.isSubWindow=!0,e=JSON.parse(localStorage.getItem(i)||"{}"),e=ji(e),localStorage.removeItem(i)),e=O.extend(!0,{},Xs,e);var r=function o(s){for(var a in s){var l=s[a];a!=="props"&&typeof l=="object"&&l!=null?o(l):a==="type"&&l==="react-component"&&(s.type="component",s.componentName="lm-react-component")}};return r(e),((t=e.settings)===null||t===void 0?void 0:t.hasHeaders)===!1&&(e.dimensions.headerHeight=0),e}_adjustToWindowMode(){var e,t=O('<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=Yi((e=this.config.content[0].title)!==null&&e!==void 0?e:""),O("head").append(O("body link, body style, template, .gl_keep")),this.container=O("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?O(this._originalContainer):O("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,O("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 Nt(t,e);if(e.content.length>1)throw t="Top level content can't contain more then one element.",new Nt(t,e);this.root=new Li(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,i=e*t;if(!(this.width==null||i<=this.width)){this._updatingColumnsResponsive=!0;for(var r=Math.max(Math.floor(this.width/t),1),o=e-r,s=this.root.contentItems[0],a=this._findAllStackContainers()[0],l=0;l<o;l++){var d=s.contentItems[s.contentItems.length-1];this._addChildContentItemsToContainer(a,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(i){e.addChild(i),t.removeChild(i,!0)}):t.contentItems.forEach(i=>{this._addChildContentItemsToContainer(e,i)})}_findAllStackContainers(){var e=[];return this._findAllStackContainersRecursive(e,this.root),e}_findAllStackContainersRecursive(e,t){t.contentItems.forEach(i=>{Lt(i)?e.push(i):i.isComponent||this._findAllStackContainersRecursive(e,i)})}}Z(er,"__lm",zc);const qc="_lm_dragging_k4a5m_1",Xc="_lm_goldenlayout_k4a5m_1",Zc="_lm_header_k4a5m_1",Yc="_lm_controls_k4a5m_1",Qc="_lm_tabpreviousbutton_k4a5m_1",Jc="_lm_tabnextbutton_k4a5m_1",em="_lm_tab_k4a5m_1",tm="_lm_active_k4a5m_1",nm="_lm_close_tab_k4a5m_1",im="_lm_content_k4a5m_1",rm="_lm_dragProxy_k4a5m_1",om="_lm_dropTargetIndicator_k4a5m_1",sm="_march_k4a5m_1",am="_lm_inner_k4a5m_1",lm="_lm_splitter_k4a5m_1",dm="_lm_selectable_k4a5m_1",um="_lm_tabdropdown_list_k4a5m_1",hm="_lm_title_k4a5m_1",cm="_lm_title_before_k4a5m_1",mm="_lm_selected_k4a5m_1",vm="_lm_focusin_k4a5m_1",pm="_lm_window_blur_k4a5m_1",fm="_lm_popout_k4a5m_1",gm="_lm_maximise_k4a5m_1",bm="_lm_tabdropdown_k4a5m_1",ym="_lm_close_k4a5m_1",Cm="_lm_tabdropdown_search_k4a5m_1",wm="_lm_tabs_k4a5m_1",Sm="_lm_keyboard_active_k4a5m_1",_m="_lm_maximised_k4a5m_1",Em="_lm_items_k4a5m_1",to={"tab-height":"28px","drag-border-width":"5px",lm_dragging:qc,lm_goldenlayout:Xc,lm_header:Zc,lm_controls:Yc,lm_tabpreviousbutton:Qc,lm_tabnextbutton:Jc,lm_tab:em,lm_active:tm,lm_close_tab:nm,lm_content:im,lm_dragProxy:rm,lm_dropTargetIndicator:om,march:sm,lm_inner:am,lm_splitter:lm,lm_selectable:dm,lm_tabdropdown_list:um,lm_title:hm,lm_title_before:cm,lm_selected:mm,lm_focusin:vm,lm_window_blur:pm,lm_popout:fm,lm_maximise:gm,lm_tabdropdown:bm,lm_close:ym,lm_tabdropdown_search:Cm,lm_tabs:wm,lm_keyboard_active:Sm,lm_maximised:_m,lm_items:Em},no=Object.freeze({tabHeight:parseInt(to["tab-height"],10),dragBorderWidth:parseInt(to["drag-border-width"],10)});function io(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(n);e&&(i=i.filter(function(r){return Object.getOwnPropertyDescriptor(n,r).enumerable})),t.push.apply(t,i)}return t}function at(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?io(Object(t),!0).forEach(function(i){ma(n,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):io(Object(t)).forEach(function(i){Object.defineProperty(n,i,Object.getOwnPropertyDescriptor(t,i))})}return n}function ma(n,e,t){return(e=Pm(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Pm(n){var e=Tm(n,"string");return typeof e=="symbol"?e:e+""}function Tm(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var yt=R.module("LayoutUtils");function va(n){return n.componentName!==void 0}function Xt(n){var e=n;return(va(n)&&n.componentName==="lm-react-component"||n.type==="react-component")&&e.component!==void 0}function Ln(n){return n.focus!==void 0}function ro(n){return n.type==="stack"}class E{static activateTab(e,t){var i=E.getStackForRoot(e,t,!1);if(!i){yt.error("Could not find stack for config",t);return}var r=E.getContentItemInStack(i,t);r&&i.setActiveContentItem(r)}static isActiveTab(e,t){var i=E.getStackForRoot(e,t,!1);if(!i)return yt.error("Could not find stack for config",t),!1;var r=E.getContentItemInStack(i,t),o=i.getActiveContentItem();return o===r}static addStack(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;if(ua(e)){var i={type:t?"column":"row"};(e.contentItems==null||e.contentItems.length===0)&&e.addChild(i);var r=e.contentItems[0],o=t?r.isColumn:r.isRow;if(!o){e.removeChild(r,!0),e.addChild(i);var s=document.activeElement;e.contentItems[0].addChild(r),s&&s.focus!=null&&s.focus()}return this.addStack(e.contentItems[0],t)}if(e.contentItems.length<2)return e.addChild({type:"stack"}),e.contentItems[e.contentItems.length-1];var a=e.contentItems[e.contentItems.length-1],l=t?a.isRow:a.isColumn;if(!l){var d,h,v=e.layoutManager.createContentItem({type:t?"row":"column",height:(d=a.config)===null||d===void 0?void 0:d.height,width:(h=a.config)===null||h===void 0?void 0:h.width},e);e.replaceChild(a,v),e.contentItems[e.contentItems.length-1].addChild(a),a=e.contentItems[e.contentItems.length-1]}return this.addStack(a,!t)}static getAllStackContainers(e){return e._findAllStackContainers()}static getFocusedStackIndex(e){return e.findIndex(t=>t.header.tabs.some(i=>i.element[0].classList.contains("lm_focusin")))}static getFocusedStack(e){var t=E.getAllStackContainers(e),i=E.getFocusedStackIndex(t);return t[i]}static getStackById(e,t){var i,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;if(r&&Lt(e)&&e.contentItems.length===0)return e;if(t===((i=e.config)===null||i===void 0?void 0:i.id)){if(Lt(e))return e;throw new Error("Item with ID ".concat(t," is not a stack"))}if(e.contentItems==null)return null;for(var o=0;o<e.contentItems.length;o+=1){var s=this.getStackById(e.contentItems[o],t,r);if(s)return s}return null}static getContentItemById(e,t){var i;if(((i=e.config)===null||i===void 0?void 0:i.id)===t)return e;if(e.contentItems==null)return null;for(var r=0;r<e.contentItems.length;r+=1){var o=this.getContentItemById(e.contentItems[r],t);if(o)return o}return null}static getStackForConfig(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;if(i&&Lt(e)&&e.contentItems.length===0)return e;if(e.contentItems==null)return null;for(var r=0;r<e.contentItems.length;r+=1){var o=e.contentItems[r];if(o.isComponent&&o.config!=null&&ur(o.config,t))return e;var s=this.getStackForConfig(o,t,i);if(s)return s}return null}static getStackForRoot(e,t){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,s=this.getStackForConfig(e,t);return!s&&r&&(s=this.getStackForConfig(e,{component:t.component},o)),!s&&i&&(s=this.addStack(e)),s}static getStackForComponentTypes(e,t){for(var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,s=0;s<t.length;s+=1){var a=t[s],l=s===t.length-1,d=E.getStackForRoot(e,{component:a},i&&l,r,o);if(d)return d}return null}static getContentItemInStack(e,t){if(!e)return null;for(var i=0;i<e.contentItems.length;i+=1){var r=e.contentItems[i];if(r.isComponent&&r.config!=null&&ur(r.config,t))return r}return null}static dehydrateLayoutConfig(e,t){if(e==null||!e.length)return[];for(var i=[],r=0;r<e.length;r+=1){var o=e[r],{component:s,content:a}=o;if(s){var l=t(s,o);l!=null?i.push(l):yt.debug2('dehydrateLayoutConfig: skipping unmapped component "'.concat(s,'"'))}else if(a){var d=at(at({},o),{},{content:E.dehydrateLayoutConfig(a,t)});i.push(d)}else i.push(o)}return i}static getTabPoint(e){var{tab:t}=e;if(t==null)throw new Error("Cannot get tab for panel container ".concat(e));var i=t.element[0].getBoundingClientRect();return[i.left+i.width*.5,i.bottom-8]}static dropLayoutMinorChange(e){for(var t=0;t<e.length;t+=1){var i=e[t],{content:r}=i;r!==void 0?(ro(i)&&delete i.activeItemIndex,E.dropLayoutMinorChange(r)):Xt(i)&&i.component==="IrisGridPanel"&&i.props.panelState!=null&&(delete i.id,i.props.panelState.irisGridState.sorts=[],i.props.panelState.irisGridState.quickFilters=[],i.props.panelState.gridState.isStuckToBottom=!1,i.props.panelState.gridState.isStuckToRight=!1)}}static isEqual(e,t){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,r=E.cloneLayout(e),o=E.cloneLayout(t);return i?(E.dropLayoutMinorChange(r),E.dropLayoutMinorChange(o),Ti(r,o)):Ti(r,o)}static cloneLayout(e){return JSON.parse(JSON.stringify(e))}static hydrateLayoutConfig(e,t){if(e==null||!e.length)return[];for(var i=[],r=0;r<e.length;r+=1){var o=e[r];if(Xt(o)){var s,{component:a,props:l={}}=o;i.push(at(at({},o),{},{id:(s=o==null?void 0:o.id)!==null&&s!==void 0?s:vt(),props:t(a,l)}))}else if(o.content!==void 0){var d=E.hydrateLayoutConfig(o.content,t);ro(o)&&o.activeItemIndex!=null&&o.activeItemIndex>=d.length&&(yt.warn("Fixing bad activeItemIndex!",o.activeItemIndex,o),o.activeItemIndex=0),i.push(at(at({},o),{},{content:d}))}else i.push(o)}return i}static openComponent(){var{root:e,config:t,stack:i=void 0,replaceExisting:r=!0,replaceConfig:o=void 0,createNewStack:s=!1,focusElement:a=void 0,dragEvent:l=void 0}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},d=document.activeElement,h=at({},t);if(h.id==null&&(h.id=vt()),l!=null){e==null||e.layoutManager.createDragSourceFromEvent(h,l);return}var v=o||{id:h.id,component:h.component};H(e);var m=i??(s?E.addStack(e):E.getStackForRoot(e,v));H(m);var p=E.getContentItemInStack(m,v);if(a!=null){var f=y=>{yt.debug("Component created, focusing element",a),m.off("componentCreated",f);var{element:S}=y.origin;requestAnimationFrame(()=>{E.focusElement(S[0],a)})};m.on("componentCreated",f)}if(r&&p){var g=m.contentItems.indexOf(p);m.addChild(h,g+1),m.removeChild(p),m.setActiveContentItem(m.contentItems[g])}else m.addChild(h);a==null&&d&&Ln(d)&&d.focus()}static openComponentInStack(e,t){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,r=document.activeElement,o={id:t.id},s=E.getContentItemInStack(e,o);if(i&&s&&e){var a=e==null?void 0:e.contentItems.indexOf(s);e.addChild(t,a+1),e.removeChild(s),e.setActiveContentItem(e.contentItems[a])}else e==null||e.addChild(t);r&&Ln(r)&&r.focus()}static closeComponent(e,t,i){var r=E.getStackForRoot(e,t,!1,!1,!1);if(!r){yt.warn("Cannot find stack for component, ignoring close",t);return}var o=E.getContentItemInStack(r,t),s=document.activeElement;o&&(Re(o)?o.container.close(i):r.removeChild(o)),s&&document.contains(s)&&Ln(s)&&s.focus()}static renameComponent(e,t,i){var r=E.getStackForRoot(e,t,!1);if(!r){yt.error("Could not find stack for config",t);return}var o=E.getContentItemInStack(r,t);o&&o.setTitle(i)}static cloneComponent(e,t){var i=E.getStackForRoot(e,t,!1);if(!i)return yt.error("Could not find stack for config",t),null;var{props:r={}}=t,o=E.getPanelComponentState(t),s={type:"react-component",component:t.component,props:at(at({},r),{},{panelState:o}),title:"".concat(t.title," Copy"),id:vt()};return E.openComponentInStack(i,s),s}static getPanelComponentState(e){if(va(e)){var t;return(t=e.componentState)===null||t===void 0?void 0:t.panelState}if(Xt(e)){var i;return(i=e.props)===null||i===void 0?void 0:i.panelState}return null}static makeDefaultLayout(){return{dimensions:{headerHeight:no.tabHeight,borderWidth:no.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=E.getComponentConfigFromContainer(e);return t?t.id:null}static getIdFromPanel(e){var{glContainer:t}=e.props;return E.getIdFromContainer(t)}static getComponentNameFromPanel(e){var{glContainer:t}=e.props,i=E.getComponentConfigFromContainer(t);if(i&&Xt(i)){var r;return(r=i.component)!==null&&r!==void 0?r:null}return null}static getComponentName(e){var t,i,r=(t=(i=e.WrappedComponent)===null||i===void 0?void 0:i.displayName)!==null&&t!==void 0?t:e.displayName;if(r==null)throw new Error("Component displayName not defined ".concat(e));return r}static focusElement(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:E.DEFAULT_FOCUS_SELECTOR;if(e==null)return null;var i=e.querySelector(t);return i==null?null:(Ln(i)&&i.focus(),i)}static onInitialized(e){return new Promise(t=>{if(e.isInitialised){t();return}var i=()=>{e.off("initialised",i),t()};e.on("initialised",i)})}}ma(E,"DEFAULT_FOCUS_SELECTOR","input, select, textarea, button");var Om=x.forwardRef((n,e)=>{var t=E.getComponentNameFromPanel({props:n});return u.jsx("div",{ref:e,className:"panel-placeholder",children:u.jsxs("div",{children:['Component "',t,'" is not registered.']})})});Om.displayName="PanelPlaceholder";var Y=Object.freeze({FOCUS:"PanelEvent.FOCUS",MOUNT:"PanelEvent.MOUNT",UNMOUNT:"PanelEvent.UNMOUNT",TITLE_CHANGED:"PanelEvent.TITLE_CHANGED",REOPEN:"PanelEvent.REOPEN",REOPEN_LAST:"PanelEvent.REOPEN_LAST",DELETE:"PanelEvent.DELETE",CLONED:"PanelEvent.CLONED",CLOSED:"PanelEvent.CLOSED",OPEN:"PanelEvent.OPEN",CLOSE:"PanelEvent.CLOSE",DRAGGING:"PanelEvent.DRAGGING",DROPPED:"PanelEvent.DROPPED"}),{listen:Yg,emit:xm,useListener:Qg}=It(Y.OPEN),ai=Object.freeze({CYCLE_TO_NEXT_STACK:"NavigationEvent.CYCLE_TO_NEXT_STACK",CYCLE_TO_PREVIOUS_STACK:"NavigationEvent.CYCLE_TO_PREVIOUS_STACK",CYCLE_TO_NEXT_TAB:"NavigationEvent.CYCLE_TO_NEXT_TAB",CYCLE_TO_PREVIOUS_TAB:"NavigationEvent.CYCLE_TO_PREVIOUS_TAB"}),{listen:Im,emit:Jg,useListener:eb}=It(ai.CYCLE_TO_NEXT_STACK),{listen:Dm,emit:tb,useListener:nb}=It(ai.CYCLE_TO_PREVIOUS_STACK),{listen:Mm,emit:ib,useListener:rb}=It(ai.CYCLE_TO_NEXT_TAB),{listen:km,emit:ob,useListener:sb}=It(ai.CYCLE_TO_PREVIOUS_TAB);function oo(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(n);e&&(i=i.filter(function(r){return Object.getOwnPropertyDescriptor(n,r).enumerable})),t.push.apply(t,i)}return t}function so(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?oo(Object(t),!0).forEach(function(i){ht(n,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):oo(Object(t)).forEach(function(i){Object.defineProperty(n,i,Object.getOwnPropertyDescriptor(t,i))})}return n}function ht(n,e,t){return(e=jm(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function jm(n){var e=Nm(n,"string");return typeof e=="symbol"?e:e+""}function Nm(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var Ke=R.module("PanelManager"),_t;(function(n){n[n.Next=0]="Next",n[n.Previous=1]="Previous"})(_t||(_t={}));class pa{constructor(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:(a,l)=>l,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:(a,l)=>l,r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:new Map,o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:[],s=arguments.length>5&&arguments[5]!==void 0?arguments[5]:()=>{};ht(this,"layout",void 0),ht(this,"hydrateComponent",void 0),ht(this,"dehydrateComponent",void 0),ht(this,"onPanelsUpdated",void 0),ht(this,"closed",void 0),ht(this,"openedMap",void 0),ht(this,"navigationEventListenerRemovers",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.handleReopenLast=this.handleReopenLast.bind(this),this.handleCycleToNextStack=this.handleCycleToNextStack.bind(this),this.handleCycleToPreviousStack=this.handleCycleToPreviousStack.bind(this),this.handleCycleToNextTab=this.handleCycleToNextTab.bind(this),this.handleCycleToPreviousTab=this.handleCycleToPreviousTab.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=i,this.onPanelsUpdated=s,this.openedMap=new Map(r),this.closed=[...o],this.navigationEventListenerRemovers=[],this.startListening()}startListening(){var{eventHub:e}=this.layout;e.on(Y.FOCUS,this.handleFocus),e.on(Y.MOUNT,this.handleMount),e.on(Y.UNMOUNT,this.handleUnmount),e.on(Y.REOPEN,this.handleReopen),e.on(Y.REOPEN_LAST,this.handleReopenLast),e.on(Y.DELETE,this.handleDeleted),e.on(Y.CLOSED,this.handleClosed),e.on(Y.CLOSE,this.handleControlClose),this.navigationEventListenerRemovers.push(Im(e,this.handleCycleToNextStack)),this.navigationEventListenerRemovers.push(Dm(e,this.handleCycleToPreviousStack)),this.navigationEventListenerRemovers.push(Mm(e,this.handleCycleToNextTab)),this.navigationEventListenerRemovers.push(km(e,this.handleCycleToPreviousTab))}stopListening(){var{eventHub:e}=this.layout;e.off(Y.FOCUS,this.handleFocus),e.off(Y.MOUNT,this.handleMount),e.off(Y.UNMOUNT,this.handleUnmount),e.off(Y.REOPEN,this.handleReopen),e.off(Y.REOPEN_LAST,this.handleReopenLast),e.off(Y.DELETE,this.handleDeleted),e.off(Y.CLOSED,this.handleClosed),e.off(Y.CLOSE,this.handleControlClose),this.navigationEventListenerRemovers.forEach(t=>t()),this.navigationEventListenerRemovers=[]}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 E.getComponentConfigFromContainer(t)})}getOpenedPanelConfigsOfType(e){return this.getOpenedPanelConfigs().filter(t=>t!=null&&Xt(t)&&t.component===e)}getOpenedPanelById(e){return this.openedMap.get(e)}getContainerByPanelId(e){var t,i=E.getStackForConfig(this.layout.root,{id:e});return(t=i&&E.getContentItemInStack(i,{id:e}))!==null&&t!==void 0?t:null}getLastUsedPanel(e){for(var t=this.getOpenedPanels(),i=t.length-1;i>=0;i-=1){var r=t[i];if(e==null||e(r))return r}}getLastUsedPanelOfType(e){return this.getLastUsedPanelOfTypes([e])}getLastUsedPanelOfTypes(e){return this.getLastUsedPanel(t=>e.some(i=>Vn(i)&&t instanceof i.WrappedComponent||!Vn(i)&&t instanceof i))}updatePanel(e){var t=E.getIdFromPanel(e);if(t==null){Ke.error("updatePanel Panel did not have an ID",e);return}Ke.debug2("Updating panel ID ".concat(t," in open panels map")),this.openedMap.delete(t),this.openedMap.set(t,e)}removePanel(e){var t=E.getIdFromPanel(e);if(t==null){Ke.error("removePanel Panel did not have an ID",e);return}if(!this.openedMap.has(t)){Ke.error("Missing panel ID ".concat(t," in open panels map"));return}if(this.openedMap.get(t)!==e){Ke.debug("Panel argument doesn't match the open panels map entry for ".concat(t,", removePanel ignored"));return}Ke.debug2("Removing panel ID ".concat(t," from open panels map")),this.openedMap.delete(t)}removeClosedPanelConfig(e){var t=this.closed.findIndex(i=>i===e||i.id!=null&&e.id!=null&&i.id===e.id);t>=0&&this.closed.splice(t,1)}handleFocus(e){Ke.debug2("Focus: ",e),this.updatePanel(e)}handleMount(e){Ke.debug2("Mount: ",e),this.updatePanel(e),this.sendUpdate()}handleUnmount(e){Ke.debug2("Unmount: ",e),this.removePanel(e),this.sendUpdate()}cycleStack(e){var t=E.getAllStackContainers(this.layout);if(!(t.length<=1)){var i=E.getFocusedStackIndex(t);if(i===-1){var r=t[0],o=r.config.activeItemIndex,s=o!=null?r.contentItems[o]:r.contentItems[0];r.setActiveContentItem(s,!0);return}var a=e===_t.Next?(i+1)%t.length:(i-1+t.length)%t.length,l=t[a],d=l.config.activeItemIndex,h=d!=null?l.contentItems[d]:l.contentItems[0];l.setActiveContentItem(h,!0)}}handleCycleToNextStack(){this.cycleStack(_t.Next)}handleCycleToPreviousStack(){this.cycleStack(_t.Previous)}cycleTab(e){var t,i=E.getFocusedStack(this.layout);if(i!==void 0){var{contentItems:r}=i;if(!(r.length<=1)){var o=(t=i.config.activeItemIndex)!==null&&t!==void 0?t:0,s=e===_t.Next?(o+1)%r.length:(o-1+r.length)%r.length,a=r[s];i.setActiveContentItem(a,!0)}}}handleCycleToNextTab(){this.cycleTab(_t.Next)}handleCycleToPreviousTab(){this.cycleTab(_t.Previous)}handleReopen(e,t){Ke.debug2("Reopen:",e,t),this.removeClosedPanelConfig(e);var{component:i}=e,{props:r}=e;r=this.hydrateComponent(i,r);var o=so(so({},e),{},{props:r}),{root:s}=this.layout,a=e.parentStackId===void 0?void 0:E.getStackById(s,e.parentStackId);E.openComponent({root:s,config:o,replaceConfig:t,stack:a??void 0})}handleReopenLast(e){var t;if(this.closed.length!==0){if(e===void 0){this.handleReopen(this.closed[this.closed.length-1]);return}for(var i=(t=E.getStackForConfig(this.layout.root,e.getConfig()))===null||t===void 0?void 0:t.config.id,r=this.closed.length-1;r>=0;r-=1){var o=this.closed[r];if(o.parentStackId===i){this.handleReopen(o);return}}}}handleDeleted(e){Ke.debug2("Deleted:",e),this.removeClosedPanelConfig(e),this.sendUpdate()}handleClosed(e,t){Ke.debug2("Closed: ",e),this.addClosedPanel(t),this.sendUpdate()}handleControlClose(e){var t={id:e},{root:i}=this.layout;E.closeComponent(i,t)}addClosedPanel(e){var{root:t}=this.layout,i=E.getComponentConfigFromContainer(e);if(i&&Xt(i)){var r=this.dehydrateComponent(i.component,i);if(r!=null){var o;r.parentStackId=(o=E.getStackForConfig(t,i))===null||o===void 0?void 0:o.config.id,this.closed.push(r)}}}sendUpdate(){var{closed:e,openedMap:t}=this;this.onPanelsUpdated({closed:[...e],openedMap:new Map(t)})}}ht(pa,"MAX_CLOSED_PANEL_COUNT",100);var Am=R.module("PanelErrorBoundary");class Lm extends c.Component{constructor(e){super(e),this.state={error:null}}componentDidCatch(e){this.setState({error:e})}componentWillUnmount(){var{glContainer:e,glEventHub:t}=this.props,i=E.getIdFromContainer(e);Am.debug("componentWillUnmount",i),t.emit(Y.CLOSED,i,e)}render(){var{children:e}=this.props,{error:t}=this.state;return t!=null?u.jsx("div",{className:"panel-error-boundary",children:u.jsx(wn,{"data-testid":"panel-error-boundary-loading-error",errorMessage:"".concat(t),isLoading:!1,isLoaded:!1})}):e??null}}function ao(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(n);e&&(i=i.filter(function(r){return Object.getOwnPropertyDescriptor(n,r).enumerable})),t.push.apply(t,i)}return t}function Xn(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?ao(Object(t),!0).forEach(function(i){Rm(n,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):ao(Object(t)).forEach(function(i){Object.defineProperty(n,i,Object.getOwnPropertyDescriptor(t,i))})}return n}function Rm(n,e,t){return(e=Fm(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Fm(n){var e=$m(n,"string");return typeof e=="symbol"?e:e+""}function $m(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function fa(n){var{props:e,componentState:t}=n,{metadata:i}=e,{panelState:r=null}=e;t&&({panelState:r}=t);var o={};return i!=null&&(o.metadata=i),r!=null&&(o.panelState=r),Xn(Xn({},n),{},{componentState:null,props:o,type:"react-component"})}function ga(n){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";return Xn(Xn({},n),{},{localDashboardId:e})}const ab={dehydrate:fa,hydrate:ga};var ba=x.createContext(void 0);ba.displayName="LayoutManagerContext";var Hm=b.shape({on:b.func,off:b.func,isHidden:b.bool,tab:b.shape({header:b.shape({tabs:b.arrayOf(b.shape({contentItem:b.shape({})}))})}),title:b.string,setTitle:b.func,close:b.func}),ya=b.shape({on:b.func,off:b.func,emit:b.func}),Um=b.shape({registerComponent:b.func,root:b.shape({addChild:b.func}),on:b.func,off:b.func,eventHub:ya}),Bm=Object.freeze({Container:Hm,EventHub:ya,Layout:Um});function zt(n,e,t){c.useEffect(function(){return n.on(e,t),()=>{n.off(e,t)}},[n,e,t])}var Ca="SET_DASHBOARD_DATA";const Km=lh(Ca,{},!1),Wm={dashboardData:Km};var zm=new Map,wa=Object.freeze({}),Vm=Object.freeze([]),lb=fs,db=ps,ub=Ll,Gm=n=>n.dashboardData,we=(n,e)=>{var t;return(t=Gm(n)[e])!==null&&t!==void 0?t:wa},hb=(n,e)=>{var t;return(t=we(n,e).closed)!==null&&t!==void 0?t:Vm},cb=(n,e)=>{var t;return(t=we(n,e).openedMap)!==null&&t!==void 0?t:zm},Sa=(n,e)=>{var t;return(t=we(n,e).pluginDataMap)!==null&&t!==void 0?t:wa},mb=(n,e,t)=>Sa(n,e)[t];function lo(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(n);e&&(i=i.filter(function(r){return Object.getOwnPropertyDescriptor(n,r).enumerable})),t.push.apply(t,i)}return t}function Zt(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?lo(Object(t),!0).forEach(function(i){qm(n,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):lo(Object(t)).forEach(function(i){Object.defineProperty(n,i,Object.getOwnPropertyDescriptor(t,i))})}return n}function qm(n,e,t){return(e=Xm(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Xm(n){var e=Zm(n,"string");return typeof e=="symbol"?e:e+""}function Zm(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var _a=(n,e)=>({type:Ca,id:n,payload:e}),Ym=(n,e)=>(t,i)=>t(_a(n,Zt(Zt({},we(i(),n)),e))),vb=(n,e,t)=>(i,r)=>i(_a(n,Zt(Zt({},we(r(),n)),{},{pluginDataMap:Zt(Zt({},Sa(r(),n)),{},{[e]:t})})));Object.entries(Wm).map(n=>{var[e,t]=n;return ch.register(e,t)});function Qm(n){var{children:e}=n;return u.jsx(u.Fragment,{children:e})}var tr=c.createContext(null);tr.displayName="PanelIdContext";function Jm(){return c.useContext(tr)}function uo(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(n);e&&(i=i.filter(function(r){return Object.getOwnPropertyDescriptor(n,r).enumerable})),t.push.apply(t,i)}return t}function hn(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?uo(Object(t),!0).forEach(function(i){ev(n,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):uo(Object(t)).forEach(function(i){Object.defineProperty(n,i,Object.getOwnPropertyDescriptor(t,i))})}return n}function ev(n,e,t){return(e=tv(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function tv(n){var e=nv(n,"string");return typeof e=="symbol"?e:e+""}function nv(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var Rn=R.module("DashboardLayout"),iv=Object.freeze({}),rv=[],ho=()=>{},ov=1e3,co=n=>n;function sv(n){var e,t,{id:i,children:r,emptyDashboard:o=u.jsx("div",{children:"Dashboard is empty."}),layout:s,layoutConfig:a=rv,onLayoutChange:l=ho,onLayoutInitialized:d=ho,hydrate:h=ga,dehydrate:v=fa,panelWrapper:m=Qm}=n,p=fs(),f=(e=ps(N=>we(N,i)))!==null&&e!==void 0?e:iv,[g,y]=c.useState(!1),[S,_]=c.useState(!1),[C,D]=c.useState(),[W]=c.useState((t=f==null?void 0:f.closed)!==null&&t!==void 0?t:[]),[X,I]=c.useState(s.getReactChildren()),V=c.useMemo(()=>new Map,[]),A=c.useMemo(()=>new Map,[]),J=c.useCallback(function(N,te){var se,ln=arguments.length>2&&arguments[2]!==void 0?arguments[2]:h,gt=arguments.length>3&&arguments[3]!==void 0?arguments[3]:v;Rn.debug2("registerComponent",N,te,ln,gt);function Mn(z,ne){var pe=te,je=m,Mt=Ds(pe),{glContainer:Bt,glEventHub:Ka}=z,Wa=E.getIdFromContainer(Bt);return u.jsx(Lm,{glContainer:Bt,glEventHub:Ka,children:u.jsx(tr.Provider,{value:Wa,children:u.jsx(je,hn(hn({},z),{},{children:Mt?u.jsx(pe,hn(hn({},z),{},{ref:ne})):u.jsx(pe,hn({},z))}))})})}Mn.displayName="DashboardWrapper(".concat((se=te.displayName)!==null&&se!==void 0?se:N,")");var T=s.registerComponent(N,x.forwardRef(Mn));return V.set(N,ln),A.set(N,gt),T},[h,v,V,A,s,m]),ee=c.useCallback((N,te)=>{var se;return((se=V.get(N))!==null&&se!==void 0?se:co)(te,i)},[V,i]),j=c.useCallback((N,te)=>{var se;return((se=A.get(N))!==null&&se!==void 0?se:co)(te,i)},[A,i]),G=c.useMemo(()=>new pa(s,ee,j,new Map,W,N=>{var{closed:te,openedMap:se}=N;p(Ym(i,{closed:te,openedMap:se}))}),[j,p,ee,i,W,s]),F=Id(N=>{var te=C==null||!E.isEqual(C,N);Rn.debug("handleLayoutStateChanged",te,N),te&&(y(s.root.contentItems.length===0),D(N),l(N),I(s.getReactChildren()))},ov,{flushOnUnmount:!0});c.useEffect(()=>()=>F.flush(),[F]);var M=c.useCallback(()=>{if(!S){var N=s.toConfig(),te=N.content,se=E.dehydrateLayoutConfig(te,j);F(se)}},[j,S,s,F]),$=c.useCallback(N=>{var te=E.getIdFromContainer(N);s.eventHub.emit(Y.DRAGGING,te),_(!0)},[s.eventHub]),B=c.useCallback(N=>{var te=E.getIdFromContainer(N);s.eventHub.emit(Y.DROPPED,te),_(!1)},[s.eventHub]),me=c.useCallback(N=>{if(Rn.debug2("handleComponentCreated",N),!(N==null||N.config==null||N.config.component==null||N.element==null)){var te=N.config.component.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),se="".concat(te,"-component");N.element.addClass(se)}},[]),it=c.useCallback(()=>{I(s.getReactChildren())},[s]);zt(s,"stateChanged",M),zt(s,"itemPickedUp",$),zt(s,"itemDropped",B),zt(s,"componentCreated",me),zt(s.eventHub,Y.TITLE_CHANGED,M),zt(s,"reactChildrenChanged",it);var Xe=xd(a);return c.useEffect(function(){if(Xe!==a&&a!==C){Rn.debug("Setting new layout content...");for(var te=E.hydrateLayoutConfig(a,ee);s.root.contentItems.length>0;)s.root.contentItems[0].remove();for(var se=0;se<te.length;se+=1)s.root.addChild(te[se]);y(s.root.contentItems.length===0)}},[ee,s,a,C,G,Xe]),c.useEffect(()=>d(),[]),u.jsxs(u.Fragment,{children:[g&&o,X,x.Children.map(r,N=>N!=null?u.jsx(_u,{fallback:[],children:x.cloneElement(N,{id:i,layout:s,panelManager:G,registerComponent:J})}):null)]})}sv.propTypes={id:b.string.isRequired,children:b.node,data:b.shape({}),emptyDashboard:b.node,layout:Bm.Layout.isRequired,layoutConfig:b.arrayOf(b.shape({})),onLayoutChange:b.func,onLayoutInitialized:b.func};var Ea=c.createContext(null);Ea.displayName="DashboardIdContext";function pb(){var n=c.useContext(Ea);if(n==null)throw new Error("useDashboardId must be used within a DashboardIdContext provider");return n}function av(n,e,t){return(e=lv(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function lv(n){var e=dv(n,"string");return typeof e=="symbol"?e:e+""}function dv(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function Pa(n,e,t){if(n){if(t(n)===!0)return n;for(var i=n.child;i;){var r=Pa(i,e,t);if(r)return r;i=i.sibling}}}function uv(n){try{return Object.defineProperties(n,{_currentRenderer:{get(){return null},set(){}},_currentRenderer2:{get(){return null},set(){}}})}catch{return n}}var nr=uv(c.createContext(null));nr.displayName="FiberContext";class fb extends c.Component{constructor(){super(...arguments),av(this,"_reactInternals",void 0)}render(){var{children:e}=this.props;return u.jsx(nr.Provider,{value:this._reactInternals,children:e})}}function hv(){var n=c.useContext(nr);if(n===null)throw new Error("useFiber must be called within a <FiberProvider />!");var[e]=c.useState(()=>vt()),t=c.useMemo(()=>{for(var i of[n,n==null?void 0:n.alternate].filter(o=>o!=null)){var r=Pa(i,!1,o=>{for(var s=o.memoizedState;s!=null;){if(s.memoizedState===e)return!0;s=s.next}});if(r)return r}},[n,e]);return t}var gb="default",cv="CREATE_DASHBOARD",mv="CLOSE_DASHBOARD",{listen:bb,emit:yb,useListener:Cb}=It(cv),{listen:wb,emit:vv,useListener:Sb}=It(mv);function pv(n,e,t){return(e=fv(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function fv(n){var e=gv(n,"string");return typeof e=="symbol"?e:e+""}function gv(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class Ta extends c.PureComponent{constructor(e){super(e),this.handleCloseTab=this.handleCloseTab.bind(this),this.handleCloseTabsRight=this.handleCloseTabsRight.bind(this),this.handleCloseTabsAll=this.handleCloseTabsAll.bind(this),this.handleReopenLast=this.handleReopenLast.bind(this)}getAllTabs(){var e,t,i,{glContainer:r}=this.props;return[...(e=r==null||(t=r.tab)===null||t===void 0||(i=t.header)===null||i===void 0?void 0:i.tabs)!==null&&e!==void 0?e:[]]}handleCloseTab(){var{glContainer:e}=this.props;e.close()}handleCloseTabsAll(){var e=this.getAllTabs();e.forEach(t=>{var i;return(i=(t==null?void 0:t.contentItem).container)===null||i===void 0?void 0:i.close()})}handleCloseTabsRight(){for(var{glContainer:e}=this.props,t=this.getAllTabs(),i=t.length-1;i>0;i-=1){var r,o,s,a,l,d,h;if(((r=t[i].contentItem)===null||r===void 0||(o=r.config)===null||o===void 0?void 0:o.id)===((s=e.tab)===null||s===void 0||(a=s.contentItem)===null||a===void 0||(l=a.config)===null||l===void 0?void 0:l.id))break;(d=((h=t[i])===null||h===void 0?void 0:h.contentItem).container)===null||d===void 0||d.close()}}handleReopenLast(){var{glContainer:e,glEventHub:t}=this.props;t.emit(Y.REOPEN_LAST,e)}canCloseTabsRight(){for(var{glContainer:e}=this.props,t=this.getAllTabs(),i=!0,r=t.length-1;r>0;r-=1){var o,s,a,l,d,h,v,m;if(((o=t[r].contentItem)===null||o===void 0||(s=o.config)===null||s===void 0?void 0:s.id)===((a=e.tab)===null||a===void 0||(l=a.contentItem)===null||l===void 0||(d=l.config)===null||d===void 0?void 0:d.id))break;var p=!!(!((h=t[r])===null||h===void 0||(v=h.contentItem)===null||v===void 0||(m=v.config)===null||m===void 0)&&m.isClosable);if(p){i=!1;break}}return i}canCloseAny(){for(var e=this.getAllTabs(),t=!0,i=e.length-1;i>0;i-=1){var r,o,s,a=!!(!((r=e[i])===null||r===void 0||(o=r.contentItem)===null||o===void 0||(s=o.config)===null||s===void 0)&&s.isClosable);if(a){t=!1;break}}return t}canReopenLast(){var e,t,{workspace:i,glContainer:r}=this.props,o=(e=E.getStackForConfig(r.layoutManager.root,r.getConfig()))===null||e===void 0?void 0:e.config.id;return!((t=i.data.closed)!==null&&t!==void 0&&t.some(s=>s.parentStackId===o))}render(){var e,t,i,{additionalActions:r,glContainer:o}=this.props,s=[...r];s.push(()=>({title:"Re-open closed panel",group:oe.groups.medium+2004,action:this.handleReopenLast,disabled:this.canReopenLast()}));var a=(e=o.tab)===null||e===void 0||(t=e.contentItem)===null||t===void 0||(i=t.config)===null||i===void 0?void 0:i.isClosable;return s.push({title:"Close",order:10,group:oe.groups.low,action:this.handleCloseTab,disabled:a===void 0||!a}),s.push(()=>({title:"Close Tabs to Right",order:20,group:oe.groups.low,action:this.handleCloseTabsRight,disabled:this.canCloseTabsRight()})),s.push(()=>({title:"Close All",order:30,group:oe.groups.low,action:this.handleCloseTabsAll,disabled:this.canCloseAny()})),u.jsx(oe,{actions:s})}}pv(Ta,"defaultProps",{additionalActions:[]});var bv=n=>({workspace:Bs(n)}),yv=_n(bv,{setWorkspace:Ks})(Ta);function Oa(n,e,t){return(e=Cv(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Cv(n){var e=wv(n,"string");return typeof e=="symbol"?e:e+""}function wv(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class xa extends c.PureComponent{constructor(e){super(e),Oa(this,"renameInputRef",void 0),this.handleRenameDialogOpened=this.handleRenameDialogOpened.bind(this),this.handleRenameInputChange=this.handleRenameInputChange.bind(this),this.handleRenameCancel=this.handleRenameCancel.bind(this),this.handleRenameSubmit=this.handleRenameSubmit.bind(this),this.renameInputRef=x.createRef();var{value:t}=e;this.state={value:t,valueWasValidated:!1}}componentDidUpdate(e){var{isShown:t}=e,{isShown:i}=this.props;i&&!t&&this.resetState()}resetState(){var{value:e}=this.props;this.setState({value:e,valueWasValidated:!1})}handleRenameDialogOpened(){var e,t;(e=this.renameInputRef)===null||e===void 0||(t=e.current)===null||t===void 0||t.focus()}handleRenameInputChange(e){this.setState({value:e.target.value})}handleRenameCancel(){var{onCancel:e}=this.props;e()}handleRenameSubmit(e){e.stopPropagation(),e.preventDefault();var{value:t}=this.state,i=t==null?void 0:t.trim();if(i!==void 0&&i!==""){var{onSubmit:r}=this.props;r(i)}else this.setState({value:i,valueWasValidated:!0})}renderRenameDialog(){var{isShared:e,isOwner:t,itemType:i}=this.props,{value:r,valueWasValidated:o}=this.state;return u.jsxs("form",{className:U("p-3",{"was-validated":o}),onSubmit:this.handleRenameSubmit,noValidate:!0,role:"presentation",onMouseDown:s=>{s.stopPropagation()},onMouseUp:s=>{s.stopPropagation()},children:[u.jsxs("div",{className:"form-group",children:[u.jsxs("label",{htmlFor:"rename-dialog-".concat(i,"-input"),children:["Rename ",i]}),u.jsx("input",{type:"text",className:"form-control",id:"rename-dialog-".concat(i,"-input"),value:r??void 0,ref:this.renameInputRef,onChange:this.handleRenameInputChange,required:!0}),u.jsxs("div",{className:"invalid-feedback",children:[i," name cannot be empty"]}),(e||!t)&&u.jsxs("div",{className:"pt-2",children:["Renaming this ",i," will rename for all users."]})]}),u.jsxs("div",{className:"text-right",children:[u.jsx(Q,{kind:"secondary",className:"mr-2",onClick:this.handleRenameCancel,children:"Cancel"}),u.jsx(Q,{kind:"primary",type:"submit",children:"Rename"})]})]})}render(){var{isShown:e,onCancel:t}=this.props;return u.jsx(Pn,{isShown:e,onEntered:this.handleRenameDialogOpened,onExited:t,options:{placement:"bottom"},interactive:!0,closeOnBlur:!0,children:this.renderRenameDialog()})}}Oa(xa,"defaultProps",{isShared:!1,isOwner:!0,itemType:"Item",value:""});var Fn=Object.freeze({focus:"TabEvent.focus",blur:"TabEvent.blur"});function mo(n,e,t){return(e=Sv(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Sv(n){var e=_v(n,"string");return typeof e=="symbol"?e:e+""}function _v(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var Ev=R.module("Panel");class Pv extends c.PureComponent{constructor(e){super(e),mo(this,"ref",void 0),mo(this,"getAdditionalActions",Yt((i,r,o)=>{var s=[];return r&&s.push(this.getCloneAction()),o&&s.push(this.getRenameAction()),[...s,...i]})),this.handleCopyPanel=this.handleCopyPanel.bind(this),this.handleFocus=this.handleFocus.bind(this),this.handleBlur=this.handleBlur.bind(this),this.handleHide=this.handleHide.bind(this),this.handleResize=this.handleResize.bind(this),this.handleBeforeShow=this.handleBeforeShow.bind(this),this.handleShow=this.handleShow.bind(this),this.handleTabBlur=this.handleTabBlur.bind(this),this.handleTabFocus=this.handleTabFocus.bind(this),this.handleRenameCancel=this.handleRenameCancel.bind(this),this.handleRenameSubmit=this.handleRenameSubmit.bind(this),this.handleShowRenameDialog=this.handleShowRenameDialog.bind(this),this.handleTabClicked=this.handleTabClicked.bind(this),this.handleTab=this.handleTab.bind(this),this.ref=x.createRef();var{glContainer:t}=this.props;this.state={title:E.getTitleFromContainer(t),showRenameDialog:!1,isWithinPanel:!0}}componentDidMount(){var e,t,{componentPanel:i,glContainer:r,glEventHub:o}=this.props;r.on("resize",this.handleResize),r.on("show",this.handleBeforeShow),r.on("shown",this.handleShow),r.on("hide",this.handleHide),r.on("tab",this.handleTab),r.on("tabClicked",this.handleTabClicked),o.on(Fn.focus,this.handleTabFocus),o.on(Fn.blur,this.handleTabBlur),o.emit(Y.MOUNT,i??this),this.setState({isWithinPanel:((e=this.ref.current)===null||e===void 0||(t=e.parentElement)===null||t===void 0?void 0:t.closest(".dh-panel"))!=null})}componentWillUnmount(){var{componentPanel:e,glContainer:t,glEventHub:i}=this.props;t.off("resize",this.handleResize),t.off("show",this.handleBeforeShow),t.off("shown",this.handleShow),t.off("hide",this.handleHide),t.off("tab",this.handleTab),t.off("tabClicked",this.handleTabClicked),i.off(Fn.focus,this.handleTabFocus),i.off(Fn.blur,this.handleTabBlur),i.emit(Y.UNMOUNT,e??this)}handleTab(e){e!=null&&this.setState({title:E.getTitleFromTab(e)}),this.forceUpdate();var{onTab:t}=this.props;t==null||t(e)}handleTabClicked(e){var{onTabClicked:t}=this.props;t==null||t(e)}handleFocus(e){var{componentPanel:t,glEventHub:i}=this.props;i.emit(Y.FOCUS,t??this);var{onFocus:r}=this.props;r==null||r(e)}handleBlur(e){var{onBlur:t}=this.props;t==null||t(e)}handleHide(){for(var{onHide:e}=this.props,t=arguments.length,i=new Array(t),r=0;r<t;r++)i[r]=arguments[r];e==null||e(...i)}handleResize(){for(var{onResize:e}=this.props,t=arguments.length,i=new Array(t),r=0;r<t;r++)i[r]=arguments[r];e==null||e(...i)}handleBeforeShow(){for(var{onBeforeShow:e}=this.props,t=arguments.length,i=new Array(t),r=0;r<t;r++)i[r]=arguments[r];e==null||e(...i)}handleShow(){for(var{onShow:e}=this.props,t=arguments.length,i=new Array(t),r=0;r<t;r++)i[r]=arguments[r];e==null||e(...i)}handleTabBlur(){for(var{onTabBlur:e}=this.props,t=arguments.length,i=new Array(t),r=0;r<t;r++)i[r]=arguments[r];e==null||e(...i)}handleTabFocus(){for(var{onTabFocus:e}=this.props,t=arguments.length,i=new Array(t),r=0;r<t;r++)i[r]=arguments[r];e==null||e(...i)}handleRenameCancel(){this.setState({showRenameDialog:!1})}handleShowRenameDialog(){this.setState({showRenameDialog:!0})}handleRenameSubmit(e){var{glContainer:t}=this.props;this.setState({showRenameDialog:!1,title:e});var i=E.getRootFromContainer(t),r=E.getComponentConfigFromContainer(t);H(r),E.renameComponent(i,r,e)}handleCopyPanel(){var{glContainer:e,glEventHub:t}=this.props,i=E.getRootFromContainer(e),r=E.getComponentConfigFromContainer(e);if(r==null){Ev.error("Could not get component config from container",e);return}var o=E.cloneComponent(i,r);o!==null&&t.emit(Y.CLONED,this,o)}getCloneAction(){return{title:"Copy Panel",order:10,group:oe.groups.high,action:this.handleCopyPanel}}getRenameAction(){return{title:"Rename",order:10,group:oe.groups.medium,action:this.handleShowRenameDialog}}render(){var{children:e,className:t,renderTabTooltip:i,glContainer:r,glEventHub:o,additionalActions:s=Bl,errorMessage:a,isLoaded:l=!0,isLoading:d=!1,isClonable:h=!1,isRenamable:v=!1}=this.props,{tab:m}=r,{showRenameDialog:p,title:f,isWithinPanel:g}=this.state;return u.jsxs("div",{className:U("h-100 w-100 dh-panel",t),onFocusCapture:this.handleFocus,onBlurCapture:this.handleBlur,ref:this.ref,children:[e,u.jsx(wn,{"data-testid":"base-panel-loading",errorMessage:a,isLoaded:l,isLoading:d}),!g&&m!=null&&Bi.createPortal(u.jsxs(u.Fragment,{children:[u.jsx(yv,{glContainer:r,glEventHub:o,additionalActions:this.getAdditionalActions(s,h,v)}),v&&u.jsx(xa,{isShown:p,value:f,itemType:"Panel",onCancel:this.handleRenameCancel,onSubmit:this.handleRenameSubmit}),i!=null&&u.jsx(re,{interactive:!0,options:{placement:"bottom"},popperClassName:"panel-tab-popper",children:i()})]}),m.element[0])]})}}var Tv=Ls(Pv),Ov=R.module("useDhId"),Ci="__dhId";function _b(){var n,e,t=(n=(e=hv())===null||e===void 0?void 0:e.pendingProps)!==null&&n!==void 0?n:{},i=t[Ci],r=Jm();if(i!=null){if(typeof i!="string")throw new Error("useDhId expected prop ".concat(Ci," to be a string, but got ").concat(typeof i));return i}return r??(Ov.warn("useDhId must be used within a PanelIdContext provider if there is no ".concat(Ci," prop. Defaulting to null.")),null)}function Ia(n){var{type:e}=n,t=Au();switch(e){case t.VariableType.TABLE:case t.VariableType.TABLEMAP:case t.VariableType.TREETABLE:case t.VariableType.HIERARCHICALTABLE:case t.VariableType.PARTITIONEDTABLE:return u.jsx(le,{icon:ll});case t.VariableType.FIGURE:return u.jsx(le,{icon:us});case t.VariableType.PANDAS:return u.jsx(le,{icon:al});default:return u.jsx(le,{icon:ls})}}function vo(n,e,t,i,r,o,s){try{var a=n[o](s),l=a.value}catch(d){return void t(d)}a.done?e(l):Promise.resolve(l).then(i,r)}function xv(n){return function(){var e=this,t=arguments;return new Promise(function(i,r){var o=n.apply(e,t);function s(l){vo(o,i,r,s,a,"next",l)}function a(l){vo(o,i,r,s,a,"throw",l)}s(void 0)})}}function Da(n){var{children:e,language:t}=n,[i,r]=c.useState(null),{activeThemes:o}=Ts();return c.useEffect(()=>{var s=!1;function a(){return l.apply(this,arguments)}function l(){return l=xv(function*(){if(e!=null&&o!=null){var d=yield Pe.colorize(e.toString(),t,{});s||r(d)}}),l.apply(this,arguments)}return a(),()=>{s=!0}},[o,e,t]),u.jsx("div",{style:{pointerEvents:"none"},dangerouslySetInnerHTML:i!=null?{__html:i}:void 0})}class Ma{static get LANGUAGE_MAP(){return new Map([["python","Python"],["groovy","Groovy"],["scala","Scala"]])}}class Zn{static hasComment(e){return e.comment!==void 0}static hasPattern(e){return e.pattern!==void 0}static hasOp(e){return e.op!==void 0}static parseArguments(e){return e==null||!(typeof e=="string"||e instanceof String)?[]:Rl.parse(e).filter(t=>!this.hasComment(t)).map(t=>this.hasPattern(t)?t.pattern:this.hasOp(t)?t.op:"".concat(t))}static formatTimestamp(e){if(e==null||!(e instanceof Date))return null;var t="".concat(e.getHours()).padStart(2,"0"),i="".concat(e.getMinutes()).padStart(2,"0"),r="".concat(e.getSeconds()).padStart(2,"0"),o="".concat(e.getMilliseconds()).padStart(3,"0");return"".concat(t,":").concat(i,":").concat(r,".").concat(o)}static isTableType(e,t){return t===e.VariableType.TABLE||t===e.VariableType.TREETABLE||t===e.VariableType.HIERARCHICALTABLE||t===e.VariableType.PARTITIONEDTABLE}static isWidgetType(e,t){return t===e.VariableType.FIGURE||t===e.VariableType.OTHERWIDGET||t===e.VariableType.PANDAS}static isOpenableType(e,t){return Zn.isTableType(e,t)||Zn.isWidgetType(e,t)}static isFigureType(e,t){return t===e.VariableType.FIGURE}static isPandas(e,t){return t===e.VariableType.PANDAS}}function ka(n){var{children:e}=n;return u.jsxs("div",{className:"console-history-item-result",children:[u.jsx("div",{className:"console-history-gutter",children:"-"}),u.jsx("div",{className:"console-history-content",children:e})]})}ka.propTypes={children:b.node.isRequired};function Fi(n,e,t){return(e=Iv(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Iv(n){var e=Dv(n,"string");return typeof e=="symbol"?e:e+""}function Dv(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class ja extends c.Component{constructor(e){super(e),Fi(this,"timer",void 0),Fi(this,"startTime",void 0),this.updateElapsed=this.updateElapsed.bind(this),this.startTime=Date.now(),this.state={elapsed:0}}componentDidMount(){this.timer=window.setInterval(this.updateElapsed,1e3)}componentWillUnmount(){this.timer!=null&&clearInterval(this.timer),this.timer=void 0}updateElapsed(){this.setState({elapsed:Math.round((Date.now()-this.startTime)/1e3)})}render(){var{disabled:e,onCancelClick:t}=this.props,{elapsed:i}=this.state;return u.jsx("div",{className:U("console-history-result-in-progress",{disabled:e}),children:u.jsxs("span",{className:"badge",children:[u.jsx(hs,{className:"ml-2"}),"Running... ",sn.formatElapsedTime(i)," ",u.jsx(Q,{className:"console-history-result-in-progress-cancel",kind:"ghost",icon:dl,tooltip:"Cancel",onClick:t,disabled:e})]})})}}Fi(ja,"defaultProps",{disabled:!1});function gn(n,e,t){return(e=Mv(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Mv(n){var e=kv(n,"string");return typeof e=="symbol"?e:e+""}function kv(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class tn extends c.PureComponent{constructor(e){super(e),gn(this,"mouseX",void 0),gn(this,"mouseY",void 0),gn(this,"isClicking",void 0),this.handleKeyPress=this.handleKeyPress.bind(this),this.handleMouseDown=this.handleMouseDown.bind(this),this.handleMouseMove=this.handleMouseMove.bind(this),this.handleMouseUp=this.handleMouseUp.bind(this),this.handleToggleError=this.handleToggleError.bind(this),this.handleMouseEnter=this.handleMouseEnter.bind(this),this.handleMouseLeave=this.handleMouseLeave.bind(this),this.mouseX=null,this.mouseY=null,this.isClicking=!1,this.state={isExpanded:!1,isTriggerHovered:!1}}handleKeyPress(e){switch(e.key){case"Enter":case" ":this.handleToggleError(),e.stopPropagation(),e.preventDefault();break}}handleMouseDown(e){this.mouseX=e.clientX,this.mouseY=e.clientY,this.isClicking=!0}handleMouseMove(e){this.mouseX!=null&&this.mouseY!=null?(Math.abs(e.clientX-this.mouseX)>=tn.mouseDragThreshold||Math.abs(e.clientY-this.mouseY)>=tn.mouseDragThreshold)&&(this.isClicking=!1):this.isClicking&&(this.isClicking=!1)}handleMouseUp(e){this.isClicking&&!e.shiftKey&&!e.metaKey&&!e.altKey&&this.handleToggleError(),this.mouseX=null,this.mouseY=null,this.isClicking=!1}handleToggleError(){this.setState(e=>({isExpanded:!e.isExpanded}))}handleMouseEnter(){this.setState({isTriggerHovered:!0})}handleMouseLeave(){this.setState({isTriggerHovered:!1})}render(){var{isExpanded:e,isTriggerHovered:t}=this.state,{message:i}=this.props;H(i);var r=i.trimEnd(),o=r.indexOf(`
|
|
2
|
+
import{ao as za,L as R,aP as is,T as Va,X as Ga,Y as qa,V as Xa,a4 as Za,O as Ya,a8 as Qa,z as Ja,d as rs,G as os,e as ss,q as el,aQ as as,aR as tl,aS as nl,a as wn,ac as il,_ as rl,aT as ls,t as ds,Z as ol,aU as sl,u as H,aO as al,aK as us,aL as ll,f as hs,n as dl,aM as Pi,aV as ul,aW as ar,aX as hl,aY as cl,aZ as ml,a_ as vl,v as pl,k as cs,aH as fl,h as vi,aB as gl,a$ as bl,b0 as lr,aF as yl,b1 as dr,b2 as ms,b3 as Cl,aw as wl,b4 as Sl,b5 as _l,b6 as El,b7 as Pl,b8 as Tl,b9 as Ol}from"./index-B5cvSdw-.js";import{r as c,ae as Sn,bn as ei,J as x,bC as xl,D as u,G as Il,H as U,R as Bi,af as b,bp as Dl,I as le,C as vt,bD as Ml,E as vs,ad as Vt,bE as kl,bF as jl,bG as Nl,bA as Ti,_ as Al,bH as O,bI as ur,L as ps,K as fs,bJ as Ll,bB as _n,bx as Yt,bc as Pe,bK as Rl,bf as hr,bL as cr,bM as Fl,be as Ge,bN as gs,bO as $l,by as Ve,bz as At,bP as mr,bd as Hl,bw as Ul,bQ as vn}from"./vendor-B05kitGM.js";var Bl=Object.freeze([]),gg=new Map,bs=()=>{};function bg(n){return Array.isArray(n)?n:[n]}function yg(){for(var n=arguments.length,e=new Array(n),t=0;t<n;t++)e[t]=arguments[t];return e.filter(i=>i!=null)}function Kl(n,e,t){return(e=Wl(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Wl(n){var e=zl(n,"string");return typeof e=="symbol"?e:e+""}function zl(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class vr extends Error{constructor(){super(...arguments),Kl(this,"isCanceled",!0)}}function Vl(n,e,t){return(e=Gl(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Gl(n){var e=ql(n,"string");return typeof e=="symbol"?e:e+""}function ql(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class Xl extends Error{constructor(){super(...arguments),Vl(this,"isClipboardPermissionsDeniedError",!0)}}function Zl(n,e,t){return(e=Yl(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Yl(n){var e=Ql(n,"string");return typeof e=="symbol"?e:e+""}function Ql(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class pi extends Error{constructor(){super(...arguments),Zl(this,"isClipboardUnavailableError",!0)}}function Jl(n,e,t){return(e=ed(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:e+""}function td(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class ys extends Error{constructor(){super(...arguments),Jl(this,"isPermissionUnsupported",!0)}}function pr(n,e,t,i,r,o,s){try{var a=n[o](s),l=a.value}catch(d){return void t(d)}a.done?e(l):Promise.resolve(l).then(i,r)}function nd(n){return function(){var e=this,t=arguments;return new Promise(function(i,r){var o=n.apply(e,t);function s(l){pr(o,i,r,s,a,"next",l)}function a(l){pr(o,i,r,s,a,"throw",l)}s(void 0)})}}function fr(n){return Oi.apply(this,arguments)}function Oi(){return Oi=nd(function*(n){try{var e=n;return(yield navigator.permissions.query({name:e})).state}catch(t){throw t instanceof TypeError?new ys:t}}),Oi.apply(this,arguments)}function gr(n,e,t,i,r,o,s){try{var a=n[o](s),l=a.value}catch(d){return void t(d)}a.done?e(l):Promise.resolve(l).then(i,r)}function Cs(n){return function(){var e=this,t=arguments;return new Promise(function(i,r){var o=n.apply(e,t);function s(l){gr(o,i,r,s,a,"next",l)}function a(l){gr(o,i,r,s,a,"throw",l)}s(void 0)})}}function id(n){return xi.apply(this,arguments)}function xi(){return xi=Cs(function*(n){var{clipboard:e}=navigator;if(e!==void 0)try{return yield navigator.clipboard.writeText(n)}catch{}rd(n)}),xi.apply(this,arguments)}function rd(n){var e=document.activeElement,t=document.createElement("textarea");t.value=n,document.body.appendChild(t),t.focus(),t.select();var i=document.execCommand("copy");if(document.body.removeChild(t),e instanceof HTMLElement&&e.focus(),!i)throw new Error("Unable to execute copy command")}function Cg(){return Ii.apply(this,arguments)}function Ii(){return Ii=Cs(function*(){try{var{clipboard:n}=navigator;if(n===void 0)throw new pi;var e=yield fr("clipboard-read");if(e==="granted"){var t=yield n.readText();return t}if(e==="prompt"){try{yield n.readText()}catch{}if(e=yield fr("clipboard-read"),e==="granted"){var i=yield n.readText();return i}}if(e==="prompt"||e==="denied")throw new Xl}catch(r){throw r instanceof ys?new pi:r}throw new pi}),Ii.apply(this,arguments)}function $t(n,e,t){return(e=od(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:e+""}function sd(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var ad="table_",ws="column_",ld=new Set(["in","not","i","ii","k"]),dd=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"]),ud=/[^a-zA-Z0-9_$\-+@]/g,hd=/[^A-Za-z0-9_$]/g,cd=/^[a-zA-Z_$][a-zA-Z0-9_$\-+@]*$/,md=/[^a-zA-Z0-9_]/g;function vd(n){return n.replace(/[ -]/g,"_")}function pd(n){return n.replace(/\s/g,"_")}class ke{}$t(ke,"legalize",(n,e,t,i,r,o)=>{var s=e(n.trim());return r&&(ld.has(s)||dd.has(s))&&(s=t+s),s=s.replace(i,""),s?(/^[0-9-]/.test(s)&&(s=t+s),s):t+o});$t(ke,"legalizeTableName",n=>ke.legalize(n,pd,ad,ud,!1,0));$t(ke,"makeVariableName",n=>ke.legalizeTableName(n).replace(md,"_"));$t(ke,"legalizeColumnNames",n=>{var e=[];return n.forEach((t,i)=>{var r=ke.legalizeColumnName(t,i);e.includes(r)&&(r=ws+i),e.push(r)}),e});$t(ke,"legalizeColumnName",function(n){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return ke.legalize(n,vd,ws,hd,!0,e)});$t(ke,"isValidTableName",n=>cd.test(n));$t(ke,"isValidColumnName",n=>ke.legalizeColumnName(n)===n);class Ss extends CustomEvent{constructor(e,t){super(e,t)}}class Ue{static makeCancelable(e,t){var i=!1,r,o,s=new Promise((a,l)=>{o=l,Promise.resolve(e).then(d=>{i?t&&t(d):(r=d,a(d))}).catch(d=>l(d))});return s.cancel=()=>{i=!0,o(new vr),r!=null&&t&&t(r)},s}static isCanceled(e){return e instanceof vr}static isTimedOut(e){return e instanceof za}static withTimeout(e,t){return new Promise((i,r)=>{setTimeout(()=>{try{i(t())}catch(o){r(o)}},e)})}}function br(n,e,t){return(e=fd(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:e+""}function gd(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class ti{constructor(){br(this,"pending",[]),br(this,"resolved",[])}add(e,t){var i=Ue.makeCancelable(e,t);return this.pending.push(i),i.then(()=>{this.resolve(i)},()=>{this.resolve(i)}),i}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=[]}}function wg(n){var e=n;n instanceof CustomEvent&&(e=n.detail);var t="";if(e instanceof Error?t=e.message:e!=null&&(t="".concat(e)),t=t.trim(),t.length>0)return t}class Qe{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(!Qe.isValidRange(e))throw new Error("Invalid range! ".concat(e))}static isSelected(e,t){for(var i=0;i<e.length;i+=1){var r=e[i],o=r[0],s=r[1];if(o<=t&&t<=s)return!0}return!1}static selectRange(e,t){for(var[i,r]=t,o=[...e],s=o.length-1;s>=0;s-=1){var a=o[s],l=a[0],d=a[1];if(l<=i&&r<=d)return o;i<=d&&l<=r&&(i=Math.min(i,l),r=Math.max(r,d),o.splice(s,1))}return o.push([i,r]),o}static deselectRange(e,t){for(var[i,r]=t,o=[...e],s=o.length-1;s>=0;s-=1){var a=o[s],l=a[0],d=a[1];if(!(r<l||d<i))if(l<i&&r<d){o[s]=[l,i-1],o.splice(s+1,0,[r+1,d]);break}else i<=l&&d<=r?o.splice(s,1):l<i?o[s]=[l,i-1]:o[s]=[r+1,d]}return o}static count(e){return e.reduce((t,i)=>t+(i[1]-i[0]+1),0)}static getItemsInRanges(e,t){return t.reduce((i,r)=>{for(var o=[...i],s=r[0];s<=r[1];s+=1)o.push(e[s]);return o},[])}}function*Sg(n,e){for(var t=n;t<=e;++t)yield t}var _g=" ";class bd{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 i=e.slice(0,e.length-1).join(", "),r=e[e.length-1];return"".concat(i,", ").concat(t," ").concat(r)}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 i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;return e<t?i?-1:1:e>t?i?1:-1:0}}function _s(n,e,t){return(e=yd(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function yd(n){var e=Cd(n,"string");return typeof e=="symbol"?e:e+""}function Cd(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class sn{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),i=Math.floor(e%3600/60),r=e%60;return"".concat(t>0?"".concat(t,"h "):"")+"".concat(i>0||t>0?"".concat(i,"m "):"")+"".concat(e>=60?"".concat(r,"s").padStart(3,"0"):"".concat(r,"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"),i=e%(60*60),r=String(Math.floor(i/60)).padStart(2,"0"),o=i%60,s=String(Math.ceil(o)).padStart(2,"0");return"".concat(t,":").concat(r,":").concat(s)}static isTimeString(e){return new RegExp(sn.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])}}_s(sn,"TIME_PATTERN","([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]");_s(sn,"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"}]));function wd(n,e,t){return(e=Sd(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Sd(n){var e=_d(n,"string");return typeof e=="symbol"?e:e+""}function _d(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class pn extends Error{constructor(){super(...arguments),wd(this,"isInvalid",!0)}}function Es(){var n=c.useRef(!1);return c.useEffect(()=>(n.current=!0,()=>{n.current=!1}),[]),n}function yr(n,e,t,i,r,o,s){try{var a=n[o](s),l=a.value}catch(d){return void t(d)}a.done?e(l):Promise.resolve(l).then(i,r)}function Ed(n){return function(){var e=this,t=arguments;return new Promise(function(i,r){var o=n.apply(e,t);function s(l){yr(o,i,r,s,a,"next",l)}function a(l){yr(o,i,r,s,a,"throw",l)}s(void 0)})}}var Pd=R.module("useAsyncInterval");function Td(n,e){var t=Es(),i=c.useRef(0),r=c.useRef(0),o=c.useRef(null),s=c.useCallback(Ed(function*(){var a=Date.now();r.current+=1;var l=o.current==null?e:a-o.current;o.current=a;try{yield n()}catch(v){Pd.error("A tick error occurred:",v)}if(t.current){l+=Date.now()-o.current;var d=Math.max(0,l-e),h=Math.max(0,e-d);i.current=window.setTimeout(s,h)}}),[n,t,e]);c.useEffect(()=>(o.current=null,s(),()=>{window.clearTimeout(i.current)}),[e,s])}function En(n){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"No value available in context. Was code wrapped in a provider?",t=c.useContext(n);if(t==null)throw new Error(e);return t}function Od(n,e){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},{leading:i=!1,trailing:r=!0,maxWait:o}=t,s=c.useMemo(()=>Sn(n,e,o!=null?{leading:i,trailing:r,maxWait:o}:{leading:i,trailing:r}),[n,e,i,r,o]);return c.useEffect(()=>()=>s.cancel(),[s]),s}function xd(n){var e=c.useRef();return c.useEffect(function(){e.current=n}),e.current}function Id(n,e,t){var i=c.useRef(t),r=c.useRef(n);r.current=n;var o=c.useMemo(()=>ei(function(){return r.current(...arguments)},e,i.current),[e]);return c.useEffect(()=>()=>{var s,a;(s=(a=i.current)===null||a===void 0?void 0:a.flushOnUnmount)!==null&&s!==void 0&&s?o.flush():o.cancel()},[o]),o}function Ps(n){var e=c.useRef(null);return c.useEffect(function(){n&&(typeof n=="function"?n(e.current):n.current=e.current)}),e}function Cr(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(n);e&&(i=i.filter(function(r){return Object.getOwnPropertyDescriptor(n,r).enumerable})),t.push.apply(t,i)}return t}function Dd(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Cr(Object(t),!0).forEach(function(i){Qt(n,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Cr(Object(t)).forEach(function(i){Object.defineProperty(n,i,Object.getOwnPropertyDescriptor(t,i))})}return n}function Qt(n,e,t){return(e=Md(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Md(n){var e=kd(n,"string");return typeof e=="symbol"?e:e+""}function kd(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var wr="popper";class Pn extends c.Component{constructor(e){super(e),Qt(this,"element",void 0),Qt(this,"container",void 0),Qt(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=x.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:i}=this.props;if(!e&&this.container.current!==null){var{options:r}=this.props;r=Dd({placement:"auto",modifiers:{preventOverflow:{boundariesElement:"viewport"}}},r),document.body.appendChild(this.element);var o=this.getVisibleElement(this.container.current);o==null&&(o=this.container.current),e=new xl(i||o,this.element,r),e.scheduleUpdate(),cancelAnimationFrame(this.rAF),this.rAF=window.requestAnimationFrame(()=>{if(t){var s=this.element.querySelector(".".concat(wr));s instanceof HTMLElement&&!s.contains(document.activeElement)&&s.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:i,interactive:r,closeOnBlur:o}=this.props,{show:s}=this.state;return u.jsx(is,{isPortal:!0,children:u.jsx(Il,{in:s,timeout:i,classNames:"popper-transition",onEntered:this.handleEnter,onExited:this.handleExit,children:u.jsx("div",{onClick:a=>{a.stopPropagation()},onKeyDown:a=>{a.key==="Escape"&&this.hide()},className:U(wr,{interactive:r},e),onBlur:o?this.handleBlur:void 0,tabIndex:o?-1:void 0,role:"presentation",children:u.jsxs("div",{className:"popper-content",children:[t,u.jsx("div",{className:"popper-arrow","x-arrow":""})]})})})})}render(){var{popper:e}=this.state,{"data-testid":t}=this.props;return u.jsx("div",{className:"popper-parent-container",ref:this.container,style:{display:"none"},"data-testid":t,children:e&&Bi.createPortal(this.renderContent(),this.element)})}}Qt(Pn,"propTypes",{children:b.node.isRequired,options:b.shape({}),className:b.string,timeout:b.number,onEntered:b.func,onExited:b.func,isShown:b.bool,closeOnBlur:b.bool,interactive:b.bool,referenceObject:b.shape({}),"data-testid":b.string});Qt(Pn,"defaultProps",{options:{},className:"",timeout:Va.transitionMs,onEntered(){},onExited(){},isShown:!1,interactive:!1,closeOnBlur:!1,referenceObject:null,"data-testid":void 0});function Sr(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(n);e&&(i=i.filter(function(r){return Object.getOwnPropertyDescriptor(n,r).enumerable})),t.push.apply(t,i)}return t}function jd(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Sr(Object(t),!0).forEach(function(i){Je(n,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Sr(Object(t)).forEach(function(i){Object.defineProperty(n,i,Object.getOwnPropertyDescriptor(t,i))})}return n}function Je(n,e,t){return(e=Nd(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Nd(n){var e=Ad(n,"string");return typeof e=="symbol"?e:e+""}function Ad(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var Ld=R.module("Tooltip");class re extends c.Component{static handleHidden(){re.shownTooltipCount-=1,re.shownTooltipCount===0&&(re.lastHiddenTime=Date.now())}static handleShown(){re.shownTooltipCount+=1}constructor(e){super(e),Je(this,"container",void 0),Je(this,"popper",void 0),Je(this,"parent",void 0),Je(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=x.createRef(),this.popper=x.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:i}=t,{isShown:r}=this.state;r!==i&&(r?re.handleShown():re.handleHidden())}componentWillUnmount(){this.stopListening(),this.stopListeningWindow(),this.stopTimer();var{isShown:e}=this.state;e&&re.handleHidden()}startListening(){if(!this.container.current||!this.container.current.parentElement){Ld.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,i=e.clientY,{isShown:r}=this.state;if(!(!this.popper.current||!this.parent)){var o=this.popper.current.element.getBoundingClientRect(),s=this.parent.getBoundingClientRect();t>=o.left&&t<=o.left+o.width&&i>=o.top&&i<=o.top+o.height?this.handleMouseMove():t>=s.left&&t<=s.left+s.width&&i>=s.top&&i<=s.top+s.height?this.handleMouseMove():r&&(this.stopTimer(),this.hide())}}startTimer(){this.stopTimer();var{timeout:e,reshowTimeout:t}=this.props,i=e;(re.shownTooltipCount>0||Date.now()-re.lastHiddenTime<re.triggerReshowThreshold)&&(i=t),this.timer=window.setTimeout(this.handleTimeout,i)}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:i}=this.props;i&&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:i,popperClassName:r,"data-testid":o,onEntered:s}=this.props,{isShown:a}=this.state,{options:l}=this.props;return l=jd({placement:"bottom"},l),u.jsx("div",{ref:this.container,style:{display:"none"},"data-testid":o,children:u.jsx(Pn,{className:U(r,"popper-tooltip"),options:l,ref:this.popper,onEntered:s,onExited:this.handleExited,interactive:e,referenceObject:i,children:u.jsxs("div",{className:"tooltip-content",children:[" ",a&&t]})})})}}Je(re,"defaultTimeout",500);Je(re,"defaultReshowTimeout",100);Je(re,"triggerReshowThreshold",300);Je(re,"shownTooltipCount",0);Je(re,"lastHiddenTime",Date.now());Je(re,"defaultProps",{interactive:!1,options:{},popperClassName:"",reshowTimeout:re.defaultReshowTimeout,timeout:re.defaultTimeout,onEntered:()=>{},onExited:()=>{},"data-testid":void 0});var Rd=R.module("ThemeProvider"),Ki=c.createContext(null);Ki.displayName="ThemeContext";function Eg(n){var{themes:e,waitForActivation:t=!1,defaultPreloadValues:i=Ja,children:r}=n,o=c.useMemo(()=>Ga(),[]),[s,a]=c.useState(null),[l,d]=c.useState(qa),h=c.useMemo(()=>e==null?null:Xa(l,{base:o,custom:e??[]}),[o,l,e]),v=c.useMemo(()=>[...o,...e??[]],[o,e]);return c.useEffect(function(){if(!(h==null||e==null)){Za(i);var p=Ya(i);Rd.debug2("updateThemePreloadData:",{active:h.map(f=>f.themeKey),custom:e.map(f=>f.themeKey),preloadStyleContent:p,selectedThemeKey:l}),Qa({themeKey:l,preloadStyleContent:p})}},[h,l,e,i]),c.useEffect(()=>{a({activeThemes:h,selectedThemeKey:l,themes:v,setSelectedThemeKey:d})},[h,l,v]),t&&h==null?null:u.jsxs(u.Fragment,{children:[h==null?null:u.jsx(u.Fragment,{children:h.map(m=>u.jsx("style",{"data-theme-key":m.themeKey,children:m.styleContent},m.themeKey))}),s==null?null:u.jsx(Ki.Provider,{value:s,children:u.jsx(is,{children:r})})]})}function Ts(){return En(Ki,"No ThemeContext value found. Component must be wrapped in a ThemeContext.Provider")}function ni(n){var{children:e,className:t,style:i,"data-testid":r}=n;return u.jsx("div",{className:U("btn-group",t),style:i,role:"group","data-testid":r,children:e})}ni.displayName="SplitButtonGroup";ni.propTypes={children:b.node.isRequired,className:b.string,style:b.object,"data-testid":b.string};ni.defaultProps={className:null,style:{},"data-testid":void 0};var Fd=["kind","variant","type","tooltip","icon","disabled","active","onClick","onContextMenu","onMouseDown","onMouseUp","onMouseEnter","onMouseLeave","onKeyDown","className","style","children","tabIndex","data-testid","aria-label"];function _r(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(n);e&&(i=i.filter(function(r){return Object.getOwnPropertyDescriptor(n,r).enumerable})),t.push.apply(t,i)}return t}function Er(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?_r(Object(t),!0).forEach(function(i){$d(n,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):_r(Object(t)).forEach(function(i){Object.defineProperty(n,i,Object.getOwnPropertyDescriptor(t,i))})}return n}function $d(n,e,t){return(e=Hd(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Hd(n){var e=Ud(n,"string");return typeof e=="symbol"?e:e+""}function Ud(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function Bd(n,e){if(n==null)return{};var t,i,r=Kd(n,e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(n);for(i=0;i<o.length;i++)t=o[i],e.indexOf(t)===-1&&{}.propertyIsEnumerable.call(n,t)&&(r[t]=n[t])}return r}function Kd(n,e){if(n==null)return{};var t={};for(var i in n)if({}.hasOwnProperty.call(n,i)){if(e.indexOf(i)!==-1)continue;t[i]=n[i]}return t}var Wd=["primary","secondary","tertiary","success","danger","inline","ghost"],zd=["group-end"];function Vd(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 U("btn-link",{"btn-link-icon":e,"btn-link-icon-only":e})}}function Gd(n){switch(n){case"group-end":return U("pl-2","pr-3")}}var Q=x.forwardRef((n,e)=>{var{kind:t,variant:i,type:r,tooltip:o,icon:s,disabled:a=!1,active:l,onClick:d,onContextMenu:h,onMouseDown:v,onMouseUp:m,onMouseEnter:p,onMouseLeave:f,onKeyDown:g,className:y,style:S,children:_,tabIndex:C,"data-testid":D,"aria-label":W}=n,X=Bd(n,Fd),{UNSAFE_className:I}=Dl({},"button"),V;i&&(V=Gd(i));var A;s&&(A=x.isValidElement(s)?s:u.jsx(le,{icon:s}));var J=A!=null&&_==null,ee=Vd(t,J),j;o!==void 0&&(j=typeof o=="string"?u.jsx(re,{children:o}):o);var G=W;W===void 0&&J&&o!=null&&typeof o=="string"&&(G=o);var F=u.jsxs("button",Er(Er({"data-testid":D,ref:e,type:r,className:U("btn",ee,V,{active:l},y,I),onClick:d,onContextMenu:h,onMouseUp:m,onMouseDown:v,onMouseEnter:p,onMouseLeave:f,onKeyDown:g,style:S,disabled:a,tabIndex:C,"aria-label":G},X),{},{children:[s&&A,_,o!=null&&!a&&j]}));return a&&o!=null?u.jsxs("span",{className:"btn-disabled-wrapper",children:[F,j]}):F});Q.displayName="Button";Q.propTypes={kind:b.oneOf(Wd).isRequired,variant:b.oneOf(zd),type:b.oneOf(["submit","reset","button"]),tooltip(n){var{tooltip:e,icon:t,children:i}=n;return e===void 0&&t!=null&&i==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&&!x.isValidElement(t)&&(t==null||t.iconName===""||t.iconName==null)?new Error("Icon must be react element or fontawesome IconDefinition"):null},disabled:b.bool,active:b.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:b.func,onMouseUp:b.func,onMouseDown:b.func,onMouseEnter:b.func,onMouseLeave:b.func,onKeyDown:b.func,tabIndex:b.number,children:b.node,className:b.string,style:b.object,"data-testid":b.string};Q.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};function Os(n){var{className:e,children:t,"data-testid":i}=n;return u.jsx("div",{className:U("modal-footer",e),"data-testid":i,children:t})}function bn(n){var{isOpen:e,headerText:t,bodyText:i,onCancel:r,onConfirm:o,onDiscard:s,onModalDisable:a,cancelButtonText:l="Cancel",confirmButtonText:d="Okay",discardButtonText:h="Discard",isConfirmDanger:v=!1,children:m,"data-testid":p}=n,f=c.useRef(null),g=c.useRef(null),y=c.useCallback(()=>{g.current!==null&&g.current.checked&&a&&a(),o()},[o,a]),S=c.useCallback(()=>{var C;(C=f.current)===null||C===void 0||C.focus()},[]),_="";return e&&(_=typeof i=="function"?i():i),u.jsxs(rs,{isOpen:e,onOpened:S,children:[u.jsx(os,{closeButton:!1,children:t}),u.jsx(ss,{children:_}),u.jsxs(Os,{children:[a&&u.jsxs("div",{className:"custom-control custom-checkbox form-group mr-auto",children:[u.jsx("input",{type:"checkbox",className:"custom-control-input",id:"move-confirmation-checkbox",defaultChecked:!1,ref:g,"data-testid":p!==void 0?"".concat(p,"-checkbox-confirm"):void 0}),u.jsx("label",{className:"custom-control-label",htmlFor:"move-confirmation-checkbox",children:"Don't ask me again"})]}),s&&u.jsx(Q,{kind:"secondary",className:"mr-auto","data-dismiss":"modal",onClick:s,"data-testid":p!==void 0?"".concat(p,"-btn-discard"):void 0,children:h}),r&&u.jsx(Q,{kind:"secondary","data-dismiss":"modal",onClick:r,"data-testid":p!==void 0?"".concat(p,"-btn-cancel"):void 0,children:l}),u.jsxs(ni,{children:[u.jsx(Q,{kind:v?"danger":"primary",onClick:y,ref:f,"data-testid":p!==void 0?"".concat(p,"-btn-confirm"):void 0,children:d}),m]})]})]})}bn.propTypes={isOpen:b.bool.isRequired,headerText:b.string.isRequired,bodyText:b.oneOfType([b.string,b.func]).isRequired,onCancel:b.func,onConfirm:b.func.isRequired,onDiscard:b.func,onModalDisable:b.func,cancelButtonText:b.string,confirmButtonText:b.string,discardButtonText:b.string,children:b.node,"data-testid":b.string};bn.defaultProps={children:void 0,cancelButtonText:"Cancel",confirmButtonText:"Okay",discardButtonText:"Discard",onCancel:void 0,onDiscard:void 0,onModalDisable:void 0,"data-testid":void 0};function qd(n,e,t){return(e=Xd(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Xd(n){var e=Zd(n,"string");return typeof e=="symbol"?e:e+""}function Zd(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function fi(n){return n.then!==void 0}class ce{static disableAllActions(){ce.actionsDisabled=!0}static enableAllActions(){ce.actionsDisabled=!1}static isContextActionEvent(e){return Array.isArray(e.contextActions)}static compareActions(e,t){if(e.group!==t.group){var i,r;return((i=e.group)!==null&&i!==void 0?i:0)>((r=t.group)!==null&&r!==void 0?r:0)?1:-1}if(e.order!==t.order){var o,s;return((o=e.order)!==null&&o!==void 0?o:0)>((s=t.order)!==null&&s!==void 0?s:0)?1:-1}if(e.title!==t.title){var a,l;return((a=e.title)!==null&&a!==void 0?a:"")>((l=t.title)!==null&&l!==void 0?l:"")?1:-1}return e!==t?e>t?1:-1:0}static sortActions(e){if(e==null||!Array.isArray(e))return[];var t=e.slice();return t.sort(ce.compareActions),t}static isMacPlatform(){var{platform:e}=window.navigator;return e.startsWith("Mac")}static getModifierKey(){return ce.isMacPlatform()?"metaKey":"ctrlKey"}static isModifierKeyDown(e){var t=ce.getModifierKey();return e[t]}static getMenuItems(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,i=[],r=e;Array.isArray(r)||(r=[r]);for(var o=0;o<r.length;o+=1){var s=r[o],a=void 0;typeof s=="function"?a=s():a=s,a!=null&&(a instanceof Promise?t&&i.push(a):Array.isArray(a)?i=i.concat(a):i.push(a))}return i=i.filter(l=>l.title!==void 0||l.then!=null||l.menuElement),i}static getNextMenuItem(e,t,i){var r=e;r<0&&t<0&&(r=i.length);for(var o=1;o<i.length+1;o+=1){var s=(r+t*o+i.length)%i.length,a=i[s];if(!(a instanceof Promise)&&a.disabled!==!0)return s}return e}}qd(ce,"actionsDisabled",!1);var Pr=R.module("GlobalContextAction");class Yd extends c.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:i}=this.props;i.title==null&&!i.menuElement||(t.contextActions==null&&(t.contextActions=[]),t.contextActions.push(i),Pr.debug("Received context menu event at global action! Menu items are now: ",t.contextActions))}handleKeyDown(e){var{action:t}=this.props;if(!ce.actionsDisabled&&t.shortcut!==void 0&&t.shortcut.matchesEvent(e)){var i;Pr.debug("Global hotkey matched!",e),(i=t.action)===null||i===void 0||i.call(t,e),e.preventDefault(),e.stopPropagation()}}render(){return null}}class Qd extends c.Component{render(){for(var{actions:e,"data-testid":t}=this.props,i=[],r=0;r<e.length;r+=1){var o=e[r],{shortcut:s}=o;if(o.title!=null||o.menuElement||s){var a=u.jsx(Yd,{action:o,"data-testid":t},"".concat(o.title,".").concat(s==null?void 0:s.id));i.push(a)}}return i}}function xs(n,e,t){return(e=Jd(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Jd(n){var e=eu(n,"string");return typeof e=="symbol"?e:e+""}function eu(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var kn=R.module("ContextActions");class oe extends c.Component{static triggerMenu(e,t,i,r){if(r.length!==0){var o=new MouseEvent("contextmenu",{clientX:t,clientY:i,bubbles:!0,cancelable:!0});o.contextActions=r,e.dispatchEvent(o)}}constructor(e){super(e),xs(this,"container",void 0),this.handleContextMenu=this.handleContextMenu.bind(this),this.handleKeyDown=this.handleKeyDown.bind(this),this.container=x.createRef(),this.state={globalActions:[],keyboardActions:[]}}static getDerivedStateFromProps(e){if(e.actions==null||!Array.isArray(e.actions))return{globalActions:[],keyboardActions:[]};var t=e.actions.filter(r=>!fi(r)&&typeof r!="function"&&r.isGlobal),i=e.actions.filter(r=>!fi(r)&&typeof r!="function"&&(r.isGlobal===void 0||!r.isGlobal)&&r.shortcut!=null);return{globalActions:t,keyboardActions:i}}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 i=e.target,r=function(){var{classList:d}=i,h=t.find(v=>d.contains(v));if(h!==void 0)return kn.debug2('Contextmenu event ignored based on the target className "'.concat(h,'"')),{v:void 0};i=i.parentElement};i!=null;){var o=r();if(typeof o=="object")return o.v}if(ce.isContextActionEvent(e)||(e.contextActions=[]),!!ce.isContextActionEvent(e)){var{actions:s}=this.props;if(s!=null){var a=s;Array.isArray(a)&&(a=a.filter(l=>fi(l)||typeof l=="function"||l.isGlobal===void 0||!l.isGlobal)),e.contextActions=e.contextActions.concat(a)}kn.debug("Received context menu event! Menu items are now: ",e.contextActions)}}handleKeyDown(e){for(var{keyboardActions:t}=this.state,i=0;i<t.length;i+=1){var r=t[i];if(!ce.actionsDisabled&&r.shortcut!=null&&r.shortcut.matchesEvent(e)){var o;kn.debug("Context hotkey matched!",e),(o=r.action)===null||o===void 0||o.call(r,e),e.stopPropagation(),e.preventDefault(),kn.debug2("Matched hotkey returned false, key event not consumed")}}}render(){var{"data-testid":e}=this.props,{globalActions:t}=this.state;return u.jsx("div",{className:"context-actions-listener",ref:this.container,"data-testid":e,children:u.jsx(Qd,{actions:t})})}}xs(oe,"groups",{default:void 0,high:100,medium:5e3,low:1e4,global:1e5,edit:100});var Wi=x.forwardRef((n,e)=>{var t,i;function r(I){var{menuItem:V,onMenuItemClick:A}=n;A(V,I)}function o(I){var{menuItem:V,onMenuItemMouseMove:A}=n;A(V,I)}function s(I){var{menuItem:V,onMenuItemContextMenu:A}=n;A(V,I)}function a(I,V,A){if(typeof I.type=="string")return I;var{closeMenu:J,menuItem:ee,isKeyboardSelected:j,isMouseSelected:G,"data-testid":F}=n,M={menuItem:ee,closeMenu:J,isKeyboardSelected:j,isMouseSelected:G,iconElement:V,displayShortcut:A,"data-testid":F};return x.cloneElement(I,{forwardedProps:M})}var{children:l,menuItem:d,isKeyboardSelected:h=!1,isMouseSelected:v=!1,"data-testid":m}=n,p=(t=d.shortcutText)!==null&&t!==void 0?t:(i=d.shortcut)===null||i===void 0?void 0:i.getDisplayText(),f=null;if(d.icon){var g=d.icon;if(x.isValidElement(g))f=g;else{var y;d.iconColor!=null&&(d.disabled===void 0||!d.disabled)&&(y={color:d.iconColor}),f=u.jsx(le,{icon:g,style:y})}}var S=null,_=!!l;d.actions&&(S=u.jsx(le,{icon:el}));var C=null;if(d.menuElement)C=u.jsx("div",{className:"custom-menu-item",onMouseMove:o,children:a(d.menuElement,f,p)});else{var D,W=d.disabled,X=d.iconOutline;C=u.jsx("button",{type:"button",className:U("btn-context-menu",{disabled:W},{active:(_||v)&&(W===void 0||!W)},{"keyboard-active":h&&(W===void 0||!W)}),onClick:r,onMouseMove:o,onContextMenu:s,title:(D=d.description)!==null&&D!==void 0?D:"",children:u.jsxs("div",{className:"btn-context-menu-wrapper",children:[u.jsx("span",{className:U("icon",{outline:X}),children:f}),u.jsx("span",{className:"title",children:d.title}),p!==void 0&&u.jsx("span",{className:"shortcut",children:p}),S&&u.jsx("span",{className:U("submenu-indicator",{disabled:W}),children:S})]})})}return u.jsxs("div",{className:"context-menu-item",ref:e,"data-testid":m,children:[l,C]})});Wi.displayName="ContextMenuItem";Wi.defaultProps={children:null,isKeyboardSelected:!1,isMouseSelected:!1,"data-testid":void 0};var ii=x.forwardRef((n,e)=>{var{checked:t=!1,children:i,className:r,disabled:o,inputClassName:s,isInvalid:a,labelClassName:l,name:d,onChange:h,"data-testid":v}=n,[m]=c.useState(vt()),p=Ps(e);c.useEffect(function(){p.current&&(p.current.indeterminate=t===null)},[p,t]);var f=c.useCallback(g=>{p.current&&(p.current.indeterminate=t===null),h&&h(g)},[p,t,h]);return u.jsxs("div",{className:U("custom-control custom-checkbox",r),children:[u.jsx("input",{type:"checkbox",ref:p,checked:t??!1,className:U("custom-control-input",s,{"is-invalid":a}),disabled:o,id:m,name:d,onChange:f,"data-testid":v}),u.jsx("label",{className:U("custom-control-label",l),htmlFor:m,children:i})]})});ii.displayName="Checkbox";ii.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:b.node.isRequired,className:b.string,disabled:b.bool,inputClassName:b.string,isInvalid:b.bool,labelClassName:b.string,name:b.string,onChange:b.func,"data-testid":b.string};ii.defaultProps={checked:!1,className:"",disabled:!1,inputClassName:"",isInvalid:!1,labelClassName:"",name:void 0,onChange:void 0,"data-testid":void 0};function Vn(n){return(n==null?void 0:n.WrappedComponent)!==void 0}function Is(n){return Vn(n)&&Is(n.WrappedComponent)?!0:n.prototype!=null&&n.prototype.isReactComponent!=null}function tu(n){return!Vn(n)&&"$$typeof"in n&&n.$$typeof===Ml.ForwardRef}function Ds(n){return Is(n)||tu(n)}function Tr(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(n);e&&(i=i.filter(function(r){return Object.getOwnPropertyDescriptor(n,r).enumerable})),t.push.apply(t,i)}return t}function nu(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Tr(Object(t),!0).forEach(function(i){fn(n,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Tr(Object(t)).forEach(function(i){Object.defineProperty(n,i,Object.getOwnPropertyDescriptor(t,i))})}return n}function fn(n,e,t){return(e=iu(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function iu(n){var e=ru(n,"string");return typeof e=="symbol"?e:e+""}function ru(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class Ms extends c.PureComponent{constructor(e){var t;super(e),fn(this,"container",void 0),fn(this,"oldFocus",void 0),fn(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=x.createRef(),this.oldFocus=document.activeElement,this.rAF=0;var{options:i}=e,r=(t=i.initialKeyboardIndex)!==null&&t!==void 0?t:-1;this.state={menuItems:[],keyboardIndex:r,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=ce.getMenuItems(e,!1);t.length>0&&this.setState(i=>({menuItems:ce.sortActions(i.menuItems.concat(t))}))}handleKeyDown(e){var{menuItems:t}=this.state,i=this.getKeyboardIndex(),r=i;if(e.key==="Enter"||e.key===" "){i!=null&&i>=0&&i<t.length&&this.handleMenuItemClick(t[i],e);return}if(e.key==="Escape")r=null;else if(e.key==="ArrowUp"||e.key==="Tab"&&e.shiftKey===!0){var o;r=ce.getNextMenuItem((o=r)!==null&&o!==void 0?o:0,-1,t)}else if(e.key==="ArrowDown"||e.key==="Tab"&&e.shiftKey===!1){var s;r=ce.getNextMenuItem((s=r)!==null&&s!==void 0?s:0,1,t)}i!==r&&(r!==null?this.setKeyboardIndex(r):(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:i}=this.props;cancelAnimationFrame(this.rAF),this.rAF=window.requestAnimationFrame(()=>{t(e),i(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,i=t.indexOf(e);this.setMouseIndex(i)}handleMouseLeave(){this.setMouseIndex(-1)}render(){for(var e=[],{"data-testid":t}=this.props,{keyboardIndex:i,menuItems:r,mouseIndex:o}=this.state,s=0;s<r.length;s+=1){var a=r[s];s>0&&a.group!==r[s-1].group&&e.push(u.jsx("hr",{},"".concat(s,".separator")));var l=u.jsx(Wi,{isKeyboardSelected:i===s,isMouseSelected:o===s,menuItem:a,closeMenu:this.handleCloseMenu,onMenuItemClick:this.handleMenuItemClick,onMenuItemMouseMove:this.handleMenuItemMouseMove,onMenuItemContextMenu:()=>!1},s);e.push(l)}var{menuStyle:d}=this.props;return u.jsx("div",{className:"context-menu-container",style:nu({},d),ref:this.container,onKeyDown:this.handleKeyDown,onMouseLeave:this.handleMouseLeave,role:"menuitem",tabIndex:0,"data-testid":t,children:e})}}fn(Ms,"defaultProps",{closeMenu(){},onMenuOpened(){},onMenuClosed(){},options:{},menuStyle:{},"data-testid":void 0});function Or(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(n);e&&(i=i.filter(function(r){return Object.getOwnPropertyDescriptor(n,r).enumerable})),t.push.apply(t,i)}return t}function xr(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Or(Object(t),!0).forEach(function(i){Gt(n,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Or(Object(t)).forEach(function(i){Object.defineProperty(n,i,Object.getOwnPropertyDescriptor(t,i))})}return n}function Gt(n,e,t){return(e=ou(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function ou(n){var e=su(n,"string");return typeof e=="symbol"?e:e+""}function su(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class ri extends c.PureComponent{constructor(e){super(e),Gt(this,"container",void 0),Gt(this,"parent",void 0),Gt(this,"popper",void 0),Gt(this,"isOpen",void 0),this.handleClick=this.handleClick.bind(this),this.handleCloseMenu=this.handleCloseMenu.bind(this),this.handleExited=this.handleExited.bind(this),this.container=x.createRef(),this.parent=null,this.popper=x.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:i,"data-testid":r}=this.props,{menuStyle:o}=this.props,{options:s,popperOptions:a}=this.props;return a=xr({placement:"bottom"},a),s=xr({separateKeyboardMouse:!0},s),u.jsx("div",{className:"menu-actions-listener",ref:this.container,"data-testid":r,children:u.jsx(Pn,{ref:this.popper,options:a,className:U("menu-popper",i),onExited:this.handleExited,closeOnBlur:!0,interactive:!0,children:u.jsx(Ms,{actions:e,closeMenu:this.handleCloseMenu,onMenuOpened:t,options:s,menuStyle:o})})})}}Gt(ri,"defaultProps",{isShown:null,onMenuClosed(){},onMenuOpened(){},options:{},popperOptions:{},popperClassName:"",menuStyle:{},"data-testid":void 0});function wt(n,e,t){return(e=au(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function au(n){var e=lu(n,"string");return typeof e=="symbol"?e:e+""}function lu(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var Ir=R.module("Shortcut"),P;(function(n){n.CTRL="MODIFIER_CTRL",n.CMD="MODIFIER_CMD",n.ALT="MODIFIER_ALT",n.OPTION="MODIFIER_OPTION",n.SHIFT="MODIFIER_SHIFT"})(P||(P={}));var w;(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"})(w||(w={}));var du=new Set([w.ENTER,w.DELETE,w.F1,w.F2,w.F3,w.F4,w.F5,w.F6,w.F7,w.F8,w.F9,w.F10,w.F11,w.F12]);class de extends vs{static isAllowedKey(e){return Object.values(w).includes(e)}static isValidKeyState(e){var{keyValue:t}=e;if(t===null)return!0;if(!de.isMacPlatform&&e.metaKey||!de.isAllowedKey(t))return!1;var i=!e.altKey&&!e.ctrlKey&&!e.metaKey&&!e.shiftKey;return!i||du.has(t)}static createKeyState(e){var t={altKey:!1,ctrlKey:!1,metaKey:!1,shiftKey:!1,keyValue:e[e.length-1]};return e.forEach(i=>{switch(i){case P.CTRL:t.ctrlKey=!0;break;case P.ALT:case P.OPTION:t.altKey=!0;break;case P.CMD:t.metaKey=!0;break;case P.SHIFT:t.shiftKey=!0;break}}),t}static getKeyStateFromEvent(e){var{key:t,keyCode:i}=e,r="";return t==="Shift"||t==="Meta"||t==="Control"||t==="Alt"?r="":!de.isAllowedKey(t)&&de.isAllowedKey(String.fromCharCode(i))?r=String.fromCharCode(i):r=t,{keyValue:r,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===w.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 w.ENTER:t+="⏎";break;case w.ESCAPE:t+="⎋";break;case w.BACKSPACE:t+="⌫";break;case w.DELETE:t+="⌦";break;case null:break;default:t+=e.keyValue}return t}static doKeyStatesMatch(e,t){var i,r;return((i=e.keyValue)===null||i===void 0?void 0:i.toUpperCase())===((r=t.keyValue)===null||r===void 0?void 0:r.toUpperCase())&&e.altKey===t.altKey&&e.ctrlKey===t.ctrlKey&&e.metaKey===t.metaKey&&e.shiftKey===t.shiftKey}static getDisplayText(e){return e.keyValue===null?"":de.isMacPlatform?de.getMacDisplayText(e):de.getWindowsDisplayText(e)}constructor(e){var{id:t,shortcut:i,macShortcut:r,isEditable:o=!0,name:s,tooltip:a}=e;super(),wt(this,"id",void 0),wt(this,"name",void 0),wt(this,"tooltip",void 0),wt(this,"isEditable",void 0),wt(this,"defaultKeyState",void 0),wt(this,"keyState",void 0),this.id=t,this.name=s,this.tooltip=a,this.isEditable=o;var l=de.isMacPlatform,d=l?r:i;this.defaultKeyState=de.createKeyState(d),this.keyState=this.defaultKeyState}getDisplayText(){return de.getDisplayText(this.keyState)}getKeyState(){return this.keyState}setKeyState(e){de.isValidKeyState(e)?(Ir.debug2("Shortcut ".concat(this.id," updated to ").concat(JSON.stringify(e))),this.keyState=e,this.dispatchEvent(new Ss("onUpdate",{detail:this}))):Ir.debug2("Shortcut ".concat(this.id," tried to update to invalid keyState ").concat(JSON.stringify(e)))}getDefaultKeyState(){return this.defaultKeyState}isDefault(){return de.doKeyStatesMatch(this.getDefaultKeyState(),this.getKeyState())}setToNull(){this.setKeyState(de.NULL_KEY_STATE)}isNull(){return de.doKeyStatesMatch(this.keyState,de.NULL_KEY_STATE)}setToDefault(){this.setKeyState(this.defaultKeyState)}matchesKeyState(e){return de.doKeyStatesMatch(e,this.keyState)}matchesEvent(e){return this.matchesKeyState(de.getKeyStateFromEvent(e))}}wt(de,"NULL_KEY_STATE",{metaKey:!1,shiftKey:!1,altKey:!1,ctrlKey:!1,keyValue:null});wt(de,"isMacPlatform",ce.isMacPlatform());function Dr(n,e,t){return(e=uu(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function uu(n){var e=hu(n,"string");return typeof e=="symbol"?e:e+""}function hu(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var Mr=R.module("ShortcutRegistry");class cu extends vs{constructor(){super(...arguments),Dr(this,"shortcutMap",new Map),Dr(this,"shortcutsByCategory",new Map)}createAndAdd(e){var t=new de(e);return this.add(t)}add(e){var t=this.shortcutMap.get(e.id);if(t)return Mr.warn("Skipping attempt to add duplicate shortcut ID to registry: ".concat(e.id)),t;Mr.debug2("Adding shortcut to registry: ".concat(e.id)),e.addEventListener("onUpdate",o=>{var{detail:s}=o;return this.dispatchEvent(new Ss("onUpdate",{detail:s}))});var i=e.id.split(".")[0];if(this.shortcutMap.set(e.id,e),this.shortcutsByCategory.has(i)){var r;(r=this.shortcutsByCategory.get(i))===null||r===void 0||r.push(e)}else this.shortcutsByCategory.set(i,[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 ie=Object.freeze(new cu),qt={COPY:ie.createAndAdd({id:"GLOBAL.COPY",name:"Copy",shortcut:[P.CTRL,w.C],macShortcut:[P.CMD,w.C],isEditable:!1}),PASTE:ie.createAndAdd({id:"GLOBAL.PASTE",name:"Paste",shortcut:[P.CTRL,w.V],macShortcut:[P.CMD,w.V],isEditable:!1}),SAVE:ie.createAndAdd({id:"GLOBAL.SAVE",name:"Save",shortcut:[P.CTRL,w.S],macShortcut:[P.CMD,w.S],isEditable:!1}),SELECT_ALL:ie.createAndAdd({id:"GLOBAL.SELECT_ALL",name:"Select All",shortcut:[P.CTRL,w.A],macShortcut:[P.CMD,w.A],isEditable:!1}),REOPEN_CLOSED_PANEL:ie.createAndAdd({id:"GLOBAL.REOPEN_CLOSED_PANEL",name:"Re-open Closed Panel",shortcut:[P.ALT,P.SHIFT,w.T],macShortcut:[P.OPTION,P.SHIFT,w.T],isEditable:!0}),LINKER:ie.createAndAdd({id:"GLOBAL.LINKER",name:"Linker",shortcut:[P.CTRL,w.L],macShortcut:[P.CMD,w.L]}),LINKER_CLOSE:ie.createAndAdd({id:"GLOBAL.LINKER_CLOSE",name:"Close Linker Overlay",shortcut:[w.ESCAPE],macShortcut:[w.ESCAPE],isEditable:!1}),COPY_VERSION_INFO:ie.createAndAdd({id:"GLOBAL.COPY_VERSION_INFO",name:"Copy Version Info",shortcut:[P.CTRL,P.ALT,w.I],macShortcut:[P.CMD,P.SHIFT,w.I],isEditable:!0}),EXPORT_LOGS:ie.createAndAdd({id:"GLOBAL.EXPORT_LOGS",name:"Export Logs",shortcut:[P.CTRL,P.ALT,P.SHIFT,w.L],macShortcut:[P.CMD,P.OPTION,P.SHIFT,w.L],isEditable:!0}),OPEN_DASHBOARD_LIST:ie.createAndAdd({id:"GLOBAL.OPEN_DASHBOARD_LIST",name:"Open Dashboard List",shortcut:[P.CTRL,P.SHIFT,w.D],macShortcut:[P.CMD,P.SHIFT,w.D],isEditable:!0}),NEXT:ie.createAndAdd({id:"GLOBAL.NEXT",name:"Next",shortcut:[w.ENTER],macShortcut:[w.ENTER],isEditable:!1}),PREVIOUS:ie.createAndAdd({id:"GLOBAL.PREVIOUS",name:"Previous",shortcut:[P.SHIFT,w.ENTER],macShortcut:[P.SHIFT,w.ENTER],isEditable:!1})};function Di(n,e,t){return(e=mu(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function mu(n){var e=vu(n,"string");return typeof e=="symbol"?e:e+""}function vu(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class oi extends c.PureComponent{constructor(e){super(e),Di(this,"inputField",void 0),Di(this,"searchChangeSelection",void 0),this.inputField=x.createRef(),this.searchChangeSelection=x.createRef()}componentDidMount(){this.setInputPaddingRight()}componentDidUpdate(){this.setInputPaddingRight()}focus(){var e;(e=this.inputField.current)===null||e===void 0||e.focus()}select(){var e;(e=this.inputField.current)===null||e===void 0||e.select()}setInputPaddingRight(){var e=this.inputField.current,t=this.searchChangeSelection.current;if(e&&t){var i=t.getBoundingClientRect().width;e.style.paddingRight="".concat(i,"px")}}render(){var{value:e,placeholder:t,endPlaceholder:i,onBlur:r,onChange:o,className:s,disabled:a,matchCount:l,id:d,onKeyDown:h,"data-testid":v,cursor:m}=this.props,p,f=[{action:()=>m==null?void 0:m.next("forward"),shortcut:qt.NEXT},{action:()=>m==null?void 0:m.next("back"),shortcut:qt.PREVIOUS}];return m&&l>1?p=u.jsxs(u.Fragment,{children:[u.jsx(Q,{kind:"ghost",className:"search-change-button",type:"button",onClick:()=>{m.next("back")},icon:as,tooltip:"Previous match (".concat(qt.PREVIOUS.getDisplayText(),")")}),u.jsxs("span",{className:"search-change-text",children:[m.index!==void 0&&"".concat(m.index+1," of "),l]}),u.jsx(Q,{kind:"ghost",className:"search-change-button",type:"button",onClick:()=>{m.next("forward")},icon:tl,tooltip:"Next match (".concat(qt.NEXT.getDisplayText(),")")})]}):p=l>0&&u.jsx("span",{className:"search-match",children:l}),u.jsxs("div",{className:U("search-group",s),children:[u.jsx("input",{type:"search",value:e,onBlur:r,onChange:o,onKeyDown:h,className:"form-control",disabled:a,placeholder:t,ref:this.inputField,id:d,"data-testid":v}),l!=null?u.jsxs(u.Fragment,{children:[u.jsx("div",{className:"search-change-selection",ref:this.searchChangeSelection,children:p}),u.jsx(oe,{actions:f})]}):u.jsxs("span",{className:"search-end-content",children:[(i??"")!==""&&e===""&&u.jsx("span",{className:"search-end-placeholder",children:i}),u.jsx(le,{icon:nl})]})]})}}Di(oi,"defaultProps",{placeholder:"Search",className:"",matchCount:null,onKeyDown(){},id:"","data-testid":void 0,cursor:void 0});function ks(n,e,t){return(e=pu(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function pu(n){var e=fu(n,"string");return typeof e=="symbol"?e:e+""}function fu(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class js extends c.PureComponent{constructor(e){super(e),ks(this,"searchInput",void 0),this.searchInput=x.createRef(),this.handleChange=this.handleChange.bind(this),this.sendUpdate=Sn(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:i,id:r,"data-testid":o}=this.props,{value:s}=this.state;return u.jsx(oi,{value:s,placeholder:e,onChange:this.handleChange,className:t,matchCount:i,ref:this.searchInput,id:r,"data-testid":o})}}ks(js,"defaultProps",{placeholder:"Search",className:"",matchCount:null,debounceMs:250,id:"","data-testid":void 0});function Ns(n,e,t){return(e=gu(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function gu(n){var e=bu(n,"string");return typeof e=="symbol"?e:e+""}function bu(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var yu=R.module("ItemListItem");class si extends c.Component{static handleKeyDown(){return yu.log("ItemListItem.handleKeyDown false"),!1}constructor(e){super(e),Ns(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=x.createRef()}handleBlur(e){var{itemIndex:t,onBlur:i}=this.props;i(t,e)}handleFocus(e){var{itemIndex:t,onFocus:i}=this.props;i(t,e)}handleClick(e){var{itemIndex:t,onClick:i}=this.props;i(t,e)}handleContextMenu(e){var{itemIndex:t,onContextMenu:i}=this.props;i(t,e)}handleDragStart(e){var{itemIndex:t,onDragStart:i}=this.props;i(t,e)}handleDrag(e){var{itemIndex:t,onDrag:i}=this.props;i(t,e)}handleDragOver(e){e.preventDefault();var{itemIndex:t,onDragOver:i}=this.props;i(t,e)}handleDragEnd(e){var{itemIndex:t,onDragEnd:i}=this.props;i(t,e)}handleDrop(e){var{itemIndex:t,onDrop:i}=this.props;i(t,e)}handleDoubleClick(e){var{itemIndex:t,onDoubleClick:i}=this.props;i(t,e)}handleMouseMove(e){var{itemIndex:t,onMouseMove:i}=this.props;i(t,e)}handleMouseDown(e){var{itemIndex:t,onMouseDown:i}=this.props;i(t,e)}handleMouseUp(e){var{itemIndex:t,onMouseUp:i}=this.props;i(t,e)}render(){var{isDraggable:e,isFocused:t,isSelected:i,style:r,children:o,"data-testid":s}=this.props;return u.jsx("div",{className:U("item-list-item",{active:i},{"is-focused":t},{"is-draggable":e}),onKeyDown:si.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:r,onFocus:this.handleFocus,onBlur:this.handleBlur,draggable:e,"data-testid":s,children:o})}}Ns(si,"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:{}});function kr(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(n);e&&(i=i.filter(function(r){return Object.getOwnPropertyDescriptor(n,r).enumerable})),t.push.apply(t,i)}return t}function jr(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?kr(Object(t),!0).forEach(function(i){qe(n,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):kr(Object(t)).forEach(function(i){Object.defineProperty(n,i,Object.getOwnPropertyDescriptor(t,i))})}return n}function qe(n,e,t){return(e=Cu(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Cu(n){var e=wu(n,"string");return typeof e=="symbol"?e:e+""}function wu(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var Nr=R.module("ItemList"),Ar=5;class $e extends c.PureComponent{static renderItem(e){var t,i,{item:r}=e;return u.jsx("div",{className:"item-list-item-content",children:r!=null&&((t=(i=r.displayValue)!==null&&i!==void 0?i:r.value)!==null&&t!==void 0?t:"".concat(r))})}constructor(e){super(e),qe(this,"list",void 0),qe(this,"listContainer",void 0),qe(this,"getItemSelected",Vt((r,o)=>Qe.isSelected(o,r),{max:$e.CACHE_SIZE})),qe(this,"getCachedItem",Vt((r,o,s,a,l,d,h,v)=>{var m=d({item:s,itemIndex:r,isFocused:a,isSelected:l,style:h});return u.jsx(si,{onContextMenu:this.handleItemContextMenu,onDoubleClick:this.handleItemDoubleClick,onMouseDown:this.handleItemMouseDown,onFocus:this.handleItemFocus,onBlur:this.handleItemBlur,disableSelect:v,onMouseMove:this.handleItemMouseMove,onMouseUp:this.handleItemMouseUp,isFocused:a,isSelected:l,itemIndex:r,style:h,children:m},o)},{max:$e.CACHE_SIZE})),qe(this,"getOuterElement",Vt(r=>{var o=x.forwardRef((s,a)=>u.jsx("div",jr({ref:a,tabIndex:-1,onKeyDown:r,role:"presentation"},s)));return o.displayName="ItemListOuterElement",o},{max:1e3})),qe(this,"getInnerElement",Vt(()=>{var r=x.forwardRef((o,s)=>u.jsx("div",jr({className:"item-list-inner-element",ref:s},o)));return r.displayName="ItemListInnerElement",r},{max:1e3})),qe(this,"getItemData",Vt((r,o,s)=>({items:r,selectedRanges:o,renderItem:s}),{max:1e3})),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=x.createRef(),this.listContainer=x.createRef();var{isStickyBottom:t,selectedRanges:i}=e;this.state={focusIndex:null,mouseDownIndex:null,selectedRanges:i,overscanStartIndex:0,height:null,isDragging:!1,isStuckToBottom:t,scrollOffset:null,mouseX:null,mouseY:null}}componentDidUpdate(e,t){var{selectedRanges:i,itemCount:r}=this.props,{focusIndex:o,isStuckToBottom:s,scrollOffset:a,height:l,selectedRanges:d}=this.state;if(s&&!this.isListAtBottom()&&r>0&&this.scrollToBottom(),(a!==t.scrollOffset||l!==t.height)&&this.sendViewportUpdate(),i!==e.selectedRanges&&i!==d)this.setSelectedRanges(i);else if(d!==t.selectedRanges){var{onSelectionChange:h}=this.props;h(d)}if(o!==t.focusIndex){var{onFocusChange:v}=this.props;v(o)}}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:i}=this.state,r=this.listContainer.current.querySelectorAll(t),o=e-i;return r[o]}focusItem(e){var{disableSelect:t}=this.props;if(!t){this.setState({focusIndex:e});var i=this.getElement(e);i instanceof HTMLElement&&i.focus()}}scrollToItem(e){var t=this.getElement(e);t!=null&&t.scrollIntoView({block:"center"})}handleItemContextMenu(e,t){this.setState({focusIndex:e});var{selectedRanges:i}=this.state,r=Qe.isSelected(i,e),o=r||ce.isModifierKeyDown(t);this.toggleSelect(e,t.shiftKey,o,!1)}handleItemDoubleClick(e,t){var{isDoubleClickSelect:i,onSelect:r}=this.props;i&&this.setState(o=>{var{selectedRanges:s}=o;return{selectedRanges:Qe.selectRange(s,[e,e])}},()=>{r(e,t)})}handleItemMouseDown(e,t){var{selectedRanges:i}=this.state;if(!(t.target instanceof HTMLElement&&["button","select","input","textarea"].indexOf(t.target.tagName.toLowerCase())!==-1)){if(t.button===2&&i.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){Nr.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){Nr.debug2("item focus",e,t.target),this.setState(i=>{var{focusIndex:r}=i;return r!==e?{focusIndex:e}:null})}handleItemMouseMove(e,t){var{isDragSelect:i,isMultiSelect:r,disableSelect:o}=this.props,{mouseDownIndex:s,selectedRanges:a,mouseX:l,mouseY:d}=this.state;if(!(s==null||o)){var h=Math.abs(t.clientX-(l??0)),v=Math.abs(t.clientY-(d??0));h>Ar&&v>Ar&&this.setState({isDragging:!0}),(i||s===e)&&(this.focusItem(e),r?(!i&&!this.getItemSelected(e,a)&&!ce.isModifierKeyDown(t)&&this.deselectAll(),this.selectRange([Math.min(s,e),Math.max(s,e)])):this.toggleSelect(e,t.shiftKey,ce.isModifierKeyDown(t),!1))}}handleItemMouseUp(e,t){var{isDeselectOnClick:i,isDoubleClickSelect:r,onSelect:o}=this.props,{mouseDownIndex:s,isDragging:a}=this.state;if(!(t.target instanceof HTMLElement&&["button","select","input","textarea"].indexOf(t.target.tagName.toLowerCase())!==-1)){if(s===e&&!a){var l=t.shiftKey,d=ce.isModifierKeyDown(t);this.focusItem(e),this.toggleSelect(e,l,d,i),!r&&!l&&!d&&o(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:i,onSelect:r}=this.props,{focusIndex:o}=this.state,s=o;if(e.key==="Enter"||e.key===" "){!t&&s!=null&&this.setState({selectedRanges:[[s,s]]},()=>{s!=null&&r(s,e)});return}if(e.key==="ArrowUp")s!=null&&s>=0?s=Math.max(0,s-1):s=i-1;else if(e.key==="ArrowDown")s!=null&&s>=0?s=Math.min(s+1,i-1):s=0;else return;if(o!==s){e.stopPropagation(),e.preventDefault(),this.focusItem(s);var{selectedRanges:a}=this.state;if(e.shiftKey&&a.length>0){var l=a[a.length-1];this.selectRange([Math.min(s,l[0]),Math.max(s,l[1])])}else if(this.deselectAll(),s!==null)this.selectItem(s);else{var d;(d=this.listContainer.current)===null||d===void 0||d.focus()}this.scrollIntoView(s)}}handleScroll(e){var{scrollUpdateWasRequested:t,scrollOffset:i}=e;this.setState(r=>{if(t)return{scrollOffset:i};var{isStickyBottom:o}=this.props,{height:s}=r,a=o&&this.isListAtBottom({scrollOffset:i,height:s});return{isStuckToBottom:a,scrollOffset:i}})}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,i){var r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,{isMultiSelect:o}=this.props,{selectedRanges:s}=this.state;if(o&&t&&s.length>0){var a=s[s.length-1];this.selectRange([Math.min(a[0],e),Math.max(e,a[1])])}else o&&s.length===1&&s[0][0]===e&&s[0][1]===e?r&&this.deselectItem(e):o&&i?this.getItemSelected(e,s)?r&&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){Qe.validateRange(e),this.setState(t=>{var{selectedRanges:i}=t;return{selectedRanges:Qe.deselectRange(i,e)}})}selectItem(e){var{disableSelect:t}=this.props;t||this.selectRange([e,e])}selectRange(e){Qe.validateRange(e),this.setState(t=>{var{selectedRanges:i}=t;return{selectedRanges:Qe.selectRange(i,e)}})}setSelectedRanges(e){this.setState({selectedRanges:e})}sendViewportUpdate(){var{scrollOffset:e,height:t}=this.state;if(e!=null&&t!=null){var{onViewportChange:i,rowHeight:r}=this.props,o=Math.floor(e/r),s=o+Math.ceil(t/r);i(o,s)}}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:i,rowHeight:r}=this.props;return e+t>=i*r}renderInnerElement(e){var{index:t,style:i}=e,{items:r,offset:o,renderItem:s,disableSelect:a}=this.props,{focusIndex:l,selectedRanges:d}=this.state;if(t<o||t>=o+r.length)return null;var h=r[t-o];return this.getCachedItem(t,t,h,t===l&&!a,this.getItemSelected(t,d),s,i,a)}render(){var{items:e,itemCount:t,overscanCount:i,renderItem:r,rowHeight:o,"data-testid":s}=this.props,{selectedRanges:a,isStuckToBottom:l}=this.state;return u.jsx(kl,{className:"item-list-auto-sizer",onResize:this.handleResize,children:d=>{var{width:h,height:v}=d;return u.jsx(jl,{className:"item-list-scroll-pane",height:v,width:h,initialScrollOffset:l?t*o:0,itemCount:t,itemSize:o,itemData:this.getItemData(e,a,r),onScroll:this.handleScroll,onItemsRendered:this.handleItemsRendered,ref:this.list,outerElementType:this.getOuterElement(this.handleKeyDown),outerRef:this.listContainer,innerElementType:this.getInnerElement(),overscanCount:i,"data-testid":s,children:this.renderInnerElement})}})}}qe($e,"CACHE_SIZE",1e3);qe($e,"DEFAULT_ROW_HEIGHT",20);qe($e,"DEFAULT_OVERSCAN",10);qe($e,"defaultProps",{offset:0,items:[],rowHeight:$e.DEFAULT_ROW_HEIGHT,isDeselectOnClick:!0,isDoubleClickSelect:!1,isDragSelect:!0,isMultiSelect:!1,isStickyBottom:!1,disableSelect:!1,onFocusChange(){},onSelect(){},onSelectionChange(){},onViewportChange(){},overscanCount:$e.DEFAULT_OVERSCAN,renderItem:$e.renderItem,selectedRanges:[],focusSelector:".item-list-item","data-testid":void 0});var Su=R.module("ErrorBoundary");class _u extends c.Component{static getDerivedStateFromError(e){return{error:e}}constructor(e){super(e),this.state={error:void 0}}componentDidCatch(e,t){var{onError:i}=this.props;Su.error("Error caught by ErrorBoundary",e,t),i==null||i(e,t)}render(){var{children:e,className:t,fallback:i}=this.props,{error:r}=this.state;return r!=null?i??u.jsx("div",{className:t,children:u.jsx(wn,{errorMessage:"".concat(r),isLoading:!1,isLoaded:!1,"data-testid":"error-boundary-loading"})}):e??null}}function Eu(n){var{on:e,id:t,className:i,isInvalid:r,disabled:o=!1,onClick:s,"data-testid":a}=n;return u.jsx("button",{type:"button",className:U("btn","btn-switch",i,{active:e},{"is-invalid":r}),id:t,onClick:s,disabled:o,"data-testid":a,children:u.jsx("div",{className:"handle"})})}var Pu=["children","className","isInvalid","onChange","data-testid"];function Lr(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(n);e&&(i=i.filter(function(r){return Object.getOwnPropertyDescriptor(n,r).enumerable})),t.push.apply(t,i)}return t}function Rr(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Lr(Object(t),!0).forEach(function(i){Tu(n,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Lr(Object(t)).forEach(function(i){Object.defineProperty(n,i,Object.getOwnPropertyDescriptor(t,i))})}return n}function Tu(n,e,t){return(e=Ou(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Ou(n){var e=xu(n,"string");return typeof e=="symbol"?e:e+""}function xu(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function Iu(n,e){if(n==null)return{};var t,i,r=Du(n,e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(n);for(i=0;i<o.length;i++)t=o[i],e.indexOf(t)===-1&&{}.propertyIsEnumerable.call(n,t)&&(r[t]=n[t])}return r}function Du(n,e){if(n==null)return{};var t={};for(var i in n)if({}.hasOwnProperty.call(n,i)){if(e.indexOf(i)!==-1)continue;t[i]=n[i]}return t}var As=x.forwardRef((n,e)=>{var{children:t,className:i,isInvalid:r,onChange:o,"data-testid":s}=n,a=Iu(n,Pu),l=Ps(e),d=c.useCallback(h=>{o(h.target.value)},[o]);return u.jsx("select",Rr(Rr({ref:l,className:U("custom-select",i,{"is-invalid":r}),onChange:d,"data-testid":s},a),{},{children:t}))});As.displayName="Select";var zi=x.createContext(new Map);zi.displayName="XComponentMapContext";var Pg=zi.Provider;function Mu(n){var e,t=c.useContext(zi);return(e=t.get(n))!==null&&e!==void 0?e:n.Original}function Fr(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(n);e&&(i=i.filter(function(r){return Object.getOwnPropertyDescriptor(n,r).enumerable})),t.push.apply(t,i)}return t}function gi(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Fr(Object(t),!0).forEach(function(i){ku(n,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Fr(Object(t)).forEach(function(i){Object.defineProperty(n,i,Object.getOwnPropertyDescriptor(t,i))})}return n}function ku(n,e,t){return(e=ju(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function ju(n){var e=Nu(n,"string");return typeof e=="symbol"?e:e+""}function Nu(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function Ls(n){var e,t;function i(r,o){var s=Mu(t);return Ds(n)?u.jsx(s,gi(gi({},r),{},{ref:o})):u.jsx(s,gi({},r))}return i.displayName="XComponent(".concat((e=n.displayName)!==null&&e!==void 0?e:n.name,")"),t=c.forwardRef(i),t.Original=n,t.isXComponent=!0,t}function Au(){return En(il,"No API available in useApi. Was code wrapped in ApiBootstrap or ApiContext.Provider?")}function Rs(n){return typeof n=="object"&&n!=null&&typeof n.type=="string"&&n.name!=null}function Fs(n){return typeof n=="object"&&n!=null&&typeof n.type=="string"&&n.id!=null}function Tg(n){return Rs(n)||Fs(n)}var $s=c.createContext(null);$s.displayName="ObjectFetcherContext";function Og(n){if(Fs(n))return{id:n.id,type:n.type};if(Rs(n)){var e;return{name:(e=n.name)!==null&&e!==void 0?e:"",type:n.type}}throw new Error("Invalid descriptor: ".concat(n))}function Lu(n){var e,t;return{type:(e=n.type)!==null&&e!==void 0?e:"",name:(t=n.title)!==null&&t!==void 0?t:n.name,id:n.id}}function xg(){return En($s,"No ObjectFetcher available in useObjectFetcher. Was code wrapped in ObjectFetcherContext.Provider?")}function $r(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(n);e&&(i=i.filter(function(r){return Object.getOwnPropertyDescriptor(n,r).enumerable})),t.push.apply(t,i)}return t}function Ru(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?$r(Object(t),!0).forEach(function(i){Fu(n,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):$r(Object(t)).forEach(function(i){Object.defineProperty(n,i,Object.getOwnPropertyDescriptor(t,i))})}return n}function Fu(n,e,t){return(e=$u(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function $u(n){var e=Hu(n,"string");return typeof e=="symbol"?e:e+""}function Hu(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var Uu=Object.freeze({}),Bu=new Map,Ig=n=>n.api,Dg=n=>n.user,Hs=n=>n.storage,Us=n=>Hs(n).commandHistoryStorage,Ku=n=>Hs(n).fileStorage,Wu=n=>n.defaultWorkspaceSettings,Bs=n=>{var{workspace:e}=n;return e},Vi=Nl(n=>{for(var e,t,i=(e=(t=Bs(n))===null||t===void 0?void 0:t.data.settings)!==null&&e!==void 0?e:{},r=Ru({},Wu(n)),o=Object.keys(i),s=0;s<o.length;s+=1){var a=o[s];i[a]!==void 0&&(r[a]=i[a])}return r}),zu=n=>Vi(n).timeZone,Mg=n=>{var e;return(e=Vi(n).notebookSettings)!==null&&e!==void 0?e:Uu},kg=n=>n.activeTool,Vu=n=>{var e;return(e=n.plugins)!==null&&e!==void 0?e:Bu},Gu="SET_ACTIVE_TOOL",qu="SET_API",jg="SET_COMMAND_HISTORY_STORAGE",Ng="SET_FILE_STORAGE",Ag="SET_PLUGINS",Xu="SET_USER",Zu="SET_WORKSPACE",Yu="SET_DEFAULT_WORKSPACE_SETTINGS",Lg="SET_WORKSPACE_STORAGE",Qu="SET_SERVER_CONFIG_VALUES";function Hr(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(n);e&&(i=i.filter(function(r){return Object.getOwnPropertyDescriptor(n,r).enumerable})),t.push.apply(t,i)}return t}function ut(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Hr(Object(t),!0).forEach(function(i){Ju(n,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Hr(Object(t)).forEach(function(i){Object.defineProperty(n,i,Object.getOwnPropertyDescriptor(t,i))})}return n}function Ju(n,e,t){return(e=eh(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function eh(n){var e=th(n,"string");return typeof e=="symbol"?e:e+""}function th(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var Rg=n=>({type:Xu,payload:n}),Fg=n=>({type:qu,payload:n}),Ks=n=>({type:Zu,payload:n}),$g=n=>({type:Yu,payload:n}),nh=n=>(e,t)=>{e(Ks(n));var{storage:i}=t(),{workspaceStorage:r}=i;return r==null?void 0:r.save(n)},ih=n=>(e,t)=>{var{workspace:i}=t(),{data:r}=i??{},o=ut(ut({},i),{},{data:ut(ut(ut({},r),n),{},{settings:ut(ut({},r==null?void 0:r.settings),n.settings)})});return e(nh(o))},Hg=n=>(e,t)=>{var{notebookSettings:i}=Vi(t()),r=ut(ut({},i),n);return e(rh({notebookSettings:r}))},rh=n=>e=>e(ih({settings:n})),Ug=n=>({type:Gu,payload:n}),Bg=n=>({type:Qu,payload:n});function Ur(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(n);e&&(i=i.filter(function(r){return Object.getOwnPropertyDescriptor(n,r).enumerable})),t.push.apply(t,i)}return t}function Br(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Ur(Object(t),!0).forEach(function(i){oh(n,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Ur(Object(t)).forEach(function(i){Object.defineProperty(n,i,Object.getOwnPropertyDescriptor(t,i))})}return n}function oh(n,e,t){return(e=sh(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function sh(n){var e=ah(n,"string");return typeof e=="symbol"?e:e+""}function ah(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function lh(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 i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:e,r=arguments.length>1?arguments[1]:void 0;switch(r==null?void 0:r.type){case n:{var{id:o,payload:s}=r;return t&&Ti({payload:s},{payload:i[o]})?i:Br(Br({},i),{},{[o]:s})}default:return i}}}function Kr(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(n);e&&(i=i.filter(function(r){return Object.getOwnPropertyDescriptor(n,r).enumerable})),t.push.apply(t,i)}return t}function Wr(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Kr(Object(t),!0).forEach(function(i){Mi(n,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Kr(Object(t)).forEach(function(i){Object.defineProperty(n,i,Object.getOwnPropertyDescriptor(t,i))})}return n}function Mi(n,e,t){return(e=dh(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function dh(n){var e=uh(n,"string");return typeof e=="symbol"?e:e+""}function uh(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class hh{constructor(){Mi(this,"reducers",{}),Mi(this,"listener",null)}register(e,t){var i;this.reducers=Wr(Wr({},this.reducers),{},{[e]:t}),(i=this.listener)===null||i===void 0||i.call(this,this.reducers)}setListener(e){this.listener=e}}var ch=new hh;function Gi(n,e,t){return(e=mh(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function mh(n){var e=vh(n,"string");return typeof e=="symbol"?e:e+""}function vh(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class He{static isValid(e,t){return!0}static isSameFormat(e,t){throw new Error("isSameFormat not implemented")}static makeFormat(e,t,i){return{label:e,formatString:t,type:i}}format(e,t){return""}}Gi(He,"TYPE_GLOBAL","type-global");Gi(He,"TYPE_CONTEXT_PRESET","type-context-preset");Gi(He,"TYPE_CONTEXT_CUSTOM","type-context-custom");function St(n,e,t){return(e=ph(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function ph(n){var e=fh(n,"string");return typeof e=="symbol"?e:e+""}function fh(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var zr=R.module("DateTimeColumnFormatter");class ct extends He{static isValid(e,t){if(t.formatString==null)return!1;try{return e.i18n.DateTimeFormat.format(t.formatString,new Date),!0}catch{return!1}}static makeFormat(e,t){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:He.TYPE_CONTEXT_PRESET;return{label:e,formatString:t,type:i}}static isSameFormat(e,t){return e===t||e!==null&&t!==null&&e.type===t.type&&e.formatString===t.formatString}static makeGlobalFormatStringMap(e,t){var i=t?"'T'":" ",r=e?" z":"";return new Map([["yyyy-MM-dd HH:mm:ss","yyyy-MM-dd".concat(i,"HH:mm:ss").concat(r)],["yyyy-MM-dd HH:mm:ss.SSS","yyyy-MM-dd".concat(i,"HH:mm:ss.SSS").concat(r)],["yyyy-MM-dd HH:mm:ss.SSSSSSSSS","yyyy-MM-dd".concat(i,"HH:mm:ss.SSSSSSSSS").concat(r)]])}static getGlobalFormats(e,t){var i=ct.makeGlobalFormatStringMap(e,t);return[...i.keys()]}static makeFormatStringMap(e,t){var i=t!==void 0&&t?"'T'":" ",r=e!==void 0&&e?" z":"";return new Map([["yyyy-MM-dd","yyyy-MM-dd".concat(r)],["MM-dd-yyyy","MM-dd-yyyy".concat(r)],["HH:mm:ss","HH:mm:ss".concat(r)],["HH:mm:ss.SSS","HH:mm:ss.SSS".concat(r)],["HH:mm:ss.SSSSSSSSS","HH:mm:ss.SSSSSSSSS".concat(r)],["yyyy-MM-dd HH:mm:ss","yyyy-MM-dd".concat(i,"HH:mm:ss").concat(r)],["yyyy-MM-dd HH:mm:ss.SSS","yyyy-MM-dd".concat(i,"HH:mm:ss.SSS").concat(r)],["yyyy-MM-dd HH:mm:ss.SSSSSSSSS","yyyy-MM-dd".concat(i,"HH:mm:ss.SSSSSSSSS").concat(r)]])}static getFormats(e,t){var i=ct.makeFormatStringMap(e,t);return[...i.keys()]}constructor(e){var{timeZone:t="",showTimeZone:i=!0,showTSeparator:r=!1,defaultDateTimeFormatString:o=ct.DEFAULT_DATETIME_FORMAT_STRING}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};super(),St(this,"dh",void 0),St(this,"dhTimeZone",void 0),St(this,"defaultDateTimeFormatString",void 0),St(this,"showTimeZone",void 0),St(this,"showTSeparator",void 0),St(this,"formatStringMap",void 0);var s=t||ct.DEFAULT_TIME_ZONE_ID;try{this.dhTimeZone=e.i18n.TimeZone.getTimeZone(s)}catch{zr.error("Unsupported time zone id",s),this.dhTimeZone=e.i18n.TimeZone.getTimeZone(ct.DEFAULT_TIME_ZONE_ID)}this.dh=e,this.defaultDateTimeFormatString=o,this.showTimeZone=i,this.showTSeparator=r,this.formatStringMap=ct.makeFormatStringMap(i,r)}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]:{},i=t.formatString!=null&&t.formatString!==""?t.formatString:this.defaultDateTimeFormatString,r=this.getEffectiveFormatString(i);try{return this.dh.i18n.DateTimeFormat.format(r,e,this.dhTimeZone)}catch{zr.error("Invalid format arguments")}return""}}St(ct,"DEFAULT_DATETIME_FORMAT_STRING","yyyy-MM-dd HH:mm:ss.SSS");St(ct,"DEFAULT_TIME_ZONE_ID","America/New_York");function nt(n,e,t){return(e=gh(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function gh(n){var e=bh(n,"string");return typeof e=="symbol"?e:e+""}function bh(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var yh=R.module("DecimalColumnFormatter");class he extends He{static isValid(e,t){if(t.formatString==null)return!1;try{return e.i18n.NumberFormat.format(t.formatString,0),!0}catch{return!1}}static makeFormat(e,t){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:He.TYPE_CONTEXT_PRESET,r=arguments.length>3?arguments[3]:void 0;return{label:e,type:i,formatString:t,multiplier:r}}static makePresetFormat(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",i=arguments.length>2?arguments[2]:void 0;return he.makeFormat(e,t,He.TYPE_CONTEXT_PRESET,i)}static makeCustomFormat(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",t=arguments.length>1?arguments[1]:void 0;return he.makeFormat("Custom Format",e,He.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=he.DEFAULT_FORMAT_STRING}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};super(),nt(this,"defaultFormatString",void 0),nt(this,"dh",void 0),this.dh=e,this.defaultFormatString=t}format(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=t.formatString!=null&&t.formatString!==""?t.formatString:this.defaultFormatString,r=t.multiplier!=null&&t.multiplier!==0?e*t.multiplier:e;try{return this.dh.i18n.NumberFormat.format(i,r)}catch{yh.error("Invalid format arguments")}return""}}nt(he,"DEFAULT_FORMAT_STRING","###,##0.0000");nt(he,"FORMAT_PERCENT",he.makePresetFormat("Percent","##0.00%"));nt(he,"FORMAT_BASIS_POINTS",he.makePresetFormat("Basis Points","###,##0 bp",1e4));nt(he,"FORMAT_THOUSANDS",he.makePresetFormat("Thousands","##0.000 k",.001));nt(he,"FORMAT_MILLIONS",he.makePresetFormat("Millions","###,##0.000 mm",1e-6));nt(he,"FORMAT_SCIENTIFIC_NOTATION",he.makePresetFormat("Scientific Notation","0.0000E0"));nt(he,"FORMAT_ROUND",he.makePresetFormat("Round","###,##0"));nt(he,"FORMAT_ROUND_TWO_DECIMALS",he.makePresetFormat("0.00","###,##0.00"));nt(he,"FORMAT_ROUND_FOUR_DECIMALS",he.makePresetFormat("0.0000","###,##0.0000"));function en(n,e,t){return(e=Ch(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Ch(n){var e=wh(n,"string");return typeof e=="symbol"?e:e+""}function wh(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var Sh=R.module("IntegerColumnFormatter");class et extends He{static isValid(e,t){if(t.formatString==null)return!1;try{return e.i18n.NumberFormat.format(t.formatString,0),!0}catch{return!1}}static makeFormat(e,t){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:He.TYPE_CONTEXT_PRESET,r=arguments.length>3?arguments[3]:void 0;return{label:e,type:i,formatString:t,multiplier:r}}static makePresetFormat(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",i=arguments.length>2?arguments[2]:void 0;return et.makeFormat(e,t,He.TYPE_CONTEXT_PRESET,i)}static makeCustomFormat(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",t=arguments.length>1?arguments[1]:void 0;return et.makeFormat("Custom Format",e,He.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=et.DEFAULT_FORMAT_STRING}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};super(),en(this,"dh",void 0),en(this,"defaultFormatString",void 0),this.dh=e,this.defaultFormatString=t}format(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=t.formatString!=null&&t.formatString!==""?t.formatString:this.defaultFormatString,r=t.multiplier!=null&&t.multiplier!==0?e*t.multiplier:e;try{return this.dh.i18n.NumberFormat.format(i,r)}catch{Sh.error("Invalid format arguments")}return""}}en(et,"DEFAULT_FORMAT_STRING","###,##0");en(et,"FORMAT_THOUSANDS",et.makePresetFormat("Thousands","##0.000 k",.001));en(et,"FORMAT_MILLIONS",et.makePresetFormat("Millions","###,##0.000 mm",1e-6));en(et,"FORMAT_SCIENTIFIC_NOTATION",et.makePresetFormat("Scientific Notation","0.0000E0"));function Ht(n,e,t){return(e=_h(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function _h(n){var e=Eh(n,"string");return typeof e=="symbol"?e:e+""}function Eh(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class K{}Ht(K,"INTEGER","int");Ht(K,"LONG","long");Ht(K,"DOUBLE","double");Ht(K,"BOOLEAN","bool");Ht(K,"STRING","string");Ht(K,"DATE_TIME","datetime");Ht(K,"LOCAL_TIME","localtime");var Ws=c.createContext(null);Ws.displayName="PluginsContext";var an=Object.freeze({AUTH_PLUGIN:"AuthPlugin",DASHBOARD_PLUGIN:"DashboardPlugin",WIDGET_PLUGIN:"WidgetPlugin",TABLE_PLUGIN:"TablePlugin",THEME_PLUGIN:"ThemePlugin",ELEMENT_PLUGIN:"ElementPlugin"});function Ph(n){return"DashboardPlugin"in n}function Th(n){return"AuthPlugin"in n}function Oh(n){return"TablePlugin"in n}function Kg(n){return Ph(n)||Th(n)||Oh(n)}function xh(n){return"type"in n&&n.type===an.DASHBOARD_PLUGIN}function qi(n){return"type"in n&&n.type===an.WIDGET_PLUGIN}function Ih(n){return"type"in n&&n.type===an.TABLE_PLUGIN}function Dh(n){return"type"in n&&n.type===an.AUTH_PLUGIN}function zs(n){return"type"in n&&n.type===an.THEME_PLUGIN}function Vs(n){return"type"in n&&n.type===an.ELEMENT_PLUGIN}function Wg(n){return xh(n)||Dh(n)||Ih(n)||zs(n)||qi(n)||Vs(n)}var Gs=R.module("@deephaven/plugin.PluginUtils");function Vr(n,e){return n==null||!qi(n)?!1:[n.supportedTypes].flat().some(t=>t===e)}function Mh(n){var e=u.jsx(le,{icon:ls});if(!qi(n))return e;var{icon:t}=n;return t==null?e:c.isValidElement(t)?t:u.jsx(le,{icon:t})}function zg(n){var e=[...n.entries()].filter(t=>zs(t[1]));return Gs.debug("Getting theme data from plugins",e),e.map(t=>{var[i,r]=t,o=Array.isArray(r.themes)?r.themes:[r.themes];return o.map(s=>{var{name:a,baseTheme:l,styleContent:d}=s;return{baseThemeKey:"default-".concat(l??"dark"),themeKey:rl(i,a),name:a,styleContent:d}})}).flat()}function Vg(n){var e=[...n.entries()].filter(t=>Vs(t[1])&&t[1].mapping!=null);return Gs.debug("Getting element plugin mapping",e),new Map(e.flatMap(t=>{var[,i]=t;return Object.entries(i.mapping)}))}function Gg(){return En(Ws,"No Plugins available in usePlugins. This can happen when plugins have not finished loading or if code is not wrapped in PluginsContext.Provider.")}var qs=c.createContext(null);qs.displayName="PersistentStateContext";function qg(n){var{initialState:e,onChange:t,children:i}=n,[r,o]=x.useState(0),s=c.useRef({initial:e,initialStateMap:new Map,state:new Map,isTracking:!0}),a=c.useCallback((m,p)=>{s.current.isTracking&&s.current.state.set(m,p)},[]),l=c.useCallback(()=>{s.current.isTracking||(s.current.isTracking=!0,s.current.state=new Map,o(m=>m+1))},[]),d=c.useRef(s.current.initial[Symbol.iterator]()),h=c.useCallback(function(p){var f=s.current.initialStateMap.get(p);if(f)return f;var{value:g,done:y}=d.current.next(),S={value:g,done:y??!1};return s.current.initialStateMap.set(p,S),S},[]);c.useEffect(function(){s.current.isTracking&&(t([...s.current.state.values()]),s.current.isTracking=!1)},[r,t]);var v=c.useMemo(()=>({addState:a,scheduleStateUpdate:l,getInitialState:h,updateId:r}),[a,h,l,r]);return u.jsx(qs.Provider,{value:v,children:i})}const kh="var(--dh-color-chart-colorway)",jh="var(--dh-color-chart-grid)",Nh="var(--dh-color-chart-axis-line)",Ah="var(--dh-color-chart-axis-line-zero)",Gr={"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:kh,gridcolor:jh,linecolor:Nh,zerolinecolor:Ah,"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)","indicator-increasing":"var(--dh-color-chart-indicator-increase)","indicator-decreasing":"var(--dh-color-chart-indicator-decrease)","indicator-gauge":"var(--dh-color-chart-indicator-gauge)"};var qr=R.module("ChartTheme");function Lh(){var n,e=ds(Gr);return e.colorway=ol((n=e.colorway)!==null&&n!==void 0?n:"").map(t=>{var[i,r]=t;return sl.normalizeCssColor(e.colorway.substring(i,r+1))}).join(" "),qr.debug2("Chart theme:",Gr),qr.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"],indicator_increasing:e["indicator-increasing"],indicator_decreasing:e["indicator-decreasing"],indicator_gauge:e["indicator-gauge"]})}function Xr(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(n);e&&(i=i.filter(function(r){return Object.getOwnPropertyDescriptor(n,r).enumerable})),t.push.apply(t,i)}return t}function Rh(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Xr(Object(t),!0).forEach(function(i){Fh(n,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Xr(Object(t)).forEach(function(i){Object.defineProperty(n,i,Object.getOwnPropertyDescriptor(t,i))})}return n}function Fh(n,e,t){return(e=$h(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function $h(n){var e=Hh(n,"string");return typeof e=="symbol"?e:e+""}function Hh(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var Uh=c.lazy(()=>Al(()=>import("./Plot--bRJIWPY.js"),__vite__mapDeps([0,1,2,3,4,5]),import.meta.url));function Bh(n){return u.jsx(c.Suspense,{fallback:u.jsx(wn,{"data-testid":"lazy-plot-loading"}),children:u.jsx(Uh,Rh({},n))})}var Xi=c.createContext(null);Xi.displayName="ChartThemeContext";function Xg(n){var{children:e}=n,{activeThemes:t}=Ts(),i=c.useMemo(Lh,[t]);return u.jsx(Xi.Provider,{value:i,children:e})}function Kh(){return En(Xi,"No ChartThemeContext value found.")}var Xs=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 Zs(n){return n.componentName!==void 0}function Wh(n){return n.component!==void 0}var Ys=Object.freeze({type:"default",isClosable:!0,isFocusOnShow:!0,reorderEnabled:!0,title:""});const zh=Object.freeze(Object.defineProperty({__proto__:null,defaultConfig:Xs,isGLComponentConfig:Zs,isReactComponentConfig:Wh,itemDefaultConfig:Ys},Symbol.toStringTag,{value:"Module"}));function Wn(n,e,t){return(e=Vh(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Vh(n){var e=Gh(n,"string");return typeof e=="symbol"?e:e+""}function Gh(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class xe{constructor(){Wn(this,"_mSubscriptions",void 0),Wn(this,"off",this.unbind),Wn(this,"trigger",this.emit),this._mSubscriptions={},this._mSubscriptions[xe.ALL_EVENT]=[]}on(e,t,i){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:i})}emit(e){for(var t=this._mSubscriptions[e],i=arguments.length,r=new Array(i>1?i-1:0),o=1;o<i;o++)r[o-1]=arguments[o];if(t)for(var s=0;s<t.length;s++){var a=t[s].ctx||{};try{t[s].fn.apply(a,r)}catch(v){console.error("Error while emitting event:",v)}}r.unshift(e);for(var l=this._mSubscriptions[xe.ALL_EVENT],d=0;d<l.length;d++){var h=l[d].ctx||{};try{l[d].fn.apply(h,r)}catch(v){console.error("Error while emitting event to allEventSubs:",v)}}}unbind(e,t,i){if(!this._mSubscriptions[e])throw new Error("No subscriptions to unsubscribe for event "+e);for(var r=!1,o=0;o<this._mSubscriptions[e].length;o++)(!t||this._mSubscriptions[e][o].fn===t)&&(!i||i===this._mSubscriptions[e][o].ctx)&&(this._mSubscriptions[e].splice(o,1),r=!0);if(r===!1)throw new Error("Nothing to unbind for "+e)}}Wn(xe,"ALL_EVENT","__all");function Ze(n,e,t){return(e=qh(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function qh(n){var e=Xh(n,"string");return typeof e=="symbol"?e:e+""}function Xh(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class ki extends xe{constructor(e,t,i){super(),Ze(this,"width",void 0),Ze(this,"height",void 0),Ze(this,"title",void 0),Ze(this,"parent",void 0),Ze(this,"layoutManager",void 0),Ze(this,"tab",void 0),Ze(this,"_config",void 0),Ze(this,"isHidden",!1),Ze(this,"beforeCloseHandler",void 0),Ze(this,"_element",O(['<div class="lm_item_container">','<div class="lm_content" tabindex="-1"></div>',"</div>"].join(""))),Ze(this,"_contentElement",void 0),this.title=Zs(e)?e.componentName:"",this.parent=t,this.layoutManager=i,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 i,r,o,s=this.parent,a=null;s&&!s.isColumn&&!s.isRow;){var l;if(a=s,s=s.parent,(l=s)!==null&&l!==void 0&&l.isRoot)return!1}if(!s||!a)return!1;for(var d=s.isColumn?"height":"width",h=d==="height"?t:e,v=((i=this[d])!==null&&i!==void 0?i:0)*(1/(((r=a.config[d])!==null&&r!==void 0?r:0)/100)),m=h/v*100,p=(((o=a.config[d])!==null&&o!==void 0?o:0)-m)/(s.contentItems.length-1),f=0;f<s.contentItems.length;f++)if(s.contentItems[f]===a)s.contentItems[f].config[d]=m;else{var g;s.contentItems[f].config[d]=((g=s.contentItems[f].config[d])!==null&&g!==void 0?g:0)+p}return s.callDownwards("setSize"),!0}close(e){var t,i;this._config.isClosable&&(!((t=(i=this.beforeCloseHandler)===null||i===void 0?void 0:i.call(this,e))!==null&&t!==void 0)||t)&&(this.emit("close"),this.parent.close())}beforeClose(e){this.beforeCloseHandler=e}getState(){return this._config.componentState}getConfig(){return this._config}extendState(e){this.setState(O.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 i=this._contentElement[0],r=i.offsetWidth-i.clientWidth,o=i.offsetHeight-i.clientHeight;this._contentElement.width(this.width-r).height(this.height-o),this.emit("resize")}}}const Zh=Object.freeze(Object.defineProperty({__proto__:null,Container:ki,ItemContainer:ki},Symbol.toStringTag,{value:"Module"}));function Qs(n){var e=location.hash.match(new RegExp(n+"=([^&]*)"));return e?e[1]:null}function Js(n){if(window.location.hash)return Qs(n);if(!window.location.search)return null;var e=window.location.search.substr(1).split("&"),t={},i,r;for(r=0;r<e.length;r++)i=e[r].split("="),t[i[0]]=i[1];return t[n]||null}function Zi(n){return window.requestAnimationFrame(n)}function Yh(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 Gn(){return vt()}function Qh(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 Yi(n){return O.trim(n.replace(/(<([^>]+)>)/gi,""))}function Ne(n,e,t){return(e=Jh(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Jh(n){var e=ec(n,"string");return typeof e=="symbol"?e:e+""}function ec(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class Tn extends xe{constructor(e){var t,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;super(),Ne(this,"_eElement",void 0),Ne(this,"_oDocument",void 0),Ne(this,"_eBody",void 0),Ne(this,"_destroyAfterMouseUp",void 0),Ne(this,"_nDelay",400),Ne(this,"_timeout",void 0),Ne(this,"timeout",void 0),Ne(this,"_nDistance",10),Ne(this,"_nX",0),Ne(this,"_nY",0),Ne(this,"_nOriginalX",0),Ne(this,"_nOriginalY",0),Ne(this,"_bDragging",!1),this._eElement=e,this._oDocument=O(document),this._eBody=O(document.body),this._destroyAfterMouseUp=i,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,i,r,o,s=this._getCoordinates(e);this._nOriginalX=(t=s.x)!==null&&t!==void 0?t:0,this._nOriginalY=(i=s.y)!==null&&i!==void 0?i:0,(r=this._oDocument)===null||r===void 0||r.on("mousemove",this.onMouseMove),(o=this._oDocument)===null||o===void 0||o.on("mouseup",this.onMouseUp),this._timeout=window.setTimeout(this._startDrag,this._nDelay)}}onMouseMove(e){if(this._timeout!=null){var t,i;e.preventDefault();var r=this._getCoordinates(e);this._nX=((t=r.x)!==null&&t!==void 0?t:0)-this._nOriginalX,this._nY=((i=r.y)!==null&&i!==void 0?i: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,i,r,o,s;if(clearTimeout(this._timeout),(t=this._oDocument)===null||t===void 0||t.unbind("mousemove",this.onMouseMove),(i=this._oDocument)===null||i===void 0||i.unbind("mouseup",this.onMouseUp),(r=this._oDocument)===null||r===void 0||(o=r.find("iframe"))===null||o===void 0||o.css("pointer-events",""),this._bDragging===!0&&(this._bDragging=!1,this.emit("dragStop",e,this._nOriginalX+this._nX)),(s=this._eBody)===null||s===void 0||s.removeClass("lm_dragging"),!(this._eElement instanceof Window)){var a;(a=this._eElement)===null||a===void 0||a.removeClass("lm_dragging")}this._destroyAfterMouseUp&&this.destroy()}}_startDrag(){var e,t,i,r;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"),(i=this._oDocument)===null||i===void 0||(r=i.find("iframe"))===null||r===void 0||r.css("pointer-events","none"),this.emit("dragStart",this._nOriginalX,this._nOriginalY)}_getCoordinates(e){var t,i;return{x:(t=e.pageX)!==null&&t!==void 0?t:0,y:(i=e.pageY)!==null&&i!==void 0?i:0}}}function Kt(n,e,t){return(e=tc(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function tc(n){var e=nc(n,"string");return typeof e=="symbol"?e:e+""}function nc(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class ea{constructor(e,t){Kt(this,"_container",void 0),Kt(this,"_reactComponent",null),Kt(this,"_portalComponent",null),Kt(this,"_originalComponentWillUpdate",null),Kt(this,"_initialState",void 0),Kt(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=Bi.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 i;this._container.setState(t),(i=this._originalComponentWillUpdate)===null||i===void 0||i.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=O.extend(e,this._container._config.props);return x.createElement(this._reactClass,t)}}var qn=["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"],ic=[!0,!1,"row","column","stack","component","close","maximise","minimise","open in new window"];function Qi(n){if(qn.length>36)throw new Error("Too many keys in config minifier map");var e={};return Ji(n,e,"_min"),e}function ji(n){if(qn.length>36)throw new Error("Too many keys in config minifier map");var e={};return Ji(n,e,"_max"),e}function Ji(n,e,t){var i=t==="_min"?rc:oc;for(var r in n)if(n.hasOwnProperty(r)){var o=Array.isArray(n)?n[Number.parseInt(r,10)]:n[r];if(typeof o=="object"&&o!=null){var s=o instanceof Array?[]:{};if(Array.isArray(e))e[Number.parseInt(r,10)]=s;else{var a=i(r,qn);e[a]=s}Ji(o,s,t)}else{var l=i(o,ic);if(Array.isArray(e))e[Number.parseInt(r,10)]=l;else{var d=i(r,qn);e[d]=l}}}}function rc(n,e){if(typeof n=="string"&&n.length===1)return"___"+n;var t=e.indexOf(n);return t===-1?n:t.toString(36)}function oc(n,e){return typeof n=="string"&&n.length===1?e[parseInt(n,36)]:typeof n=="string"&&n.substr(0,3)==="___"?n[3]:n}function bi(n,e,t){return(e=sc(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function sc(n){var e=ac(n,"string");return typeof e=="symbol"?e:e+""}function ac(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class Ni{constructor(e,t){bi(this,"name",void 0),bi(this,"origin",void 0),bi(this,"isPropagationStopped",void 0),this.name=e,this.origin=t,this.isPropagationStopped=!1}stopPropagation(){this.isPropagationStopped=!0}}function jn(n,e,t){return(e=lc(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function lc(n){var e=dc(n,"string");return typeof e=="symbol"?e:e+""}function dc(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}let ta=class extends xe{constructor(e){super(),jn(this,"_layoutManager",void 0),jn(this,"_dontPropagateToParent",void 0),jn(this,"_childEventSource",void 0),jn(this,"_boundOnEventFromChild",void 0),this._layoutManager=e,this._dontPropagateToParent=null,this._childEventSource=null,this.on(xe.ALL_EVENT,this._onEventFromThis.bind(this)),this._boundOnEventFromChild=this._onEventFromChild.bind(this),O(window).on("gl_child_event",this._boundOnEventFromChild)}_onEventFromThis(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];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,i="gl_child_event",r=(t=window.opener)===null||t===void 0?void 0:t.document.createEvent("HTMLEvents");r.initEvent(i,!0,!0),r.eventName=i,r.__glArgs=e,r.__gl=this._layoutManager,window.opener.dispatchEvent(r)}_propagateToChildren(e){for(var t=0;t<this._layoutManager.openPopouts.length;t++){var i=this._layoutManager.openPopouts[t].getGlInstance();i&&i!==this._childEventSource&&i.eventHub._$onEventFromParent(e)}}destroy(){O(window).off("gl_child_event",this._boundOnEventFromChild)}};function na(n,e,t){return n.on(e,t),()=>{n.off(e,t)}}function ia(n){return(e,t)=>na(e,n,t)}function ra(n){return function(e){for(var t=arguments.length,i=new Array(t>1?t-1:0),r=1;r<t;r++)i[r-1]=arguments[r];e.emit(n,...i)}}function oa(n){return(e,t)=>{var i=c.useRef(null),r=c.useRef(()=>!1);if(i.current!=e||r.current!=t){var o;(o=i.current)===null||o===void 0||o.off(n,r.current),e==null||e.on(n,t)}i.current=e,r.current=t,c.useEffect(()=>()=>{var s;return(s=i.current)===null||s===void 0?void 0:s.off(n,r.current)},[])}}function It(n){return{listen:ia(n),emit:ra(n),useListener:oa(n)}}const uc=Object.freeze(Object.defineProperty({__proto__:null,BubblingEvent:Ni,DragListener:Tn,EventEmitter:xe,EventHub:ta,ReactComponentHandler:ea,animFrame:Zi,filterXss:Qh,getHashValue:Qs,getQueryStringParam:Js,getUniqueId:Gn,listenForEvent:na,makeEmitFunction:ra,makeEventFunctions:It,makeListenFunction:ia,makeUseListenerFunction:oa,minifyConfig:Qi,removeFromArray:Yh,stripTags:Yi,unminifyConfig:ji},Symbol.toStringTag,{value:"Module"}));function bt(n,e,t){return(e=hc(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function hc(n){var e=cc(n,"string");return typeof e=="symbol"?e:e+""}function cc(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class sa extends xe{constructor(e,t,i,r,o){super(),bt(this,"isInitialised",!1),bt(this,"_config",void 0),bt(this,"_dimensions",void 0),bt(this,"_parentId",void 0),bt(this,"_indexInParent",void 0),bt(this,"_layoutManager",void 0),bt(this,"_popoutWindow",null),bt(this,"_id",null),this._config=e,this._dimensions=t,this._parentId=i,this._indexInParent=r,this._layoutManager=o,this._createWindow()}toConfig(){var e,t,i,r,o,s,a,l,d,h,v;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:(i=(r=(o=this._popoutWindow)===null||o===void 0?void 0:o.screenX)!==null&&r!==void 0?r:(s=this._popoutWindow)===null||s===void 0?void 0:s.screenLeft)!==null&&i!==void 0?i:0,top:(a=(l=(d=this._popoutWindow)===null||d===void 0?void 0:d.screenY)!==null&&l!==void 0?l:(h=this._popoutWindow)===null||h===void 0?void 0:h.screenTop)!==null&&a!==void 0?a:0},content:(v=this.getGlInstance())===null||v===void 0?void 0:v.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,i=null;if(this._parentId){var r;if(t=O.extend(!0,{},(r=this.getGlInstance())===null||r===void 0?void 0:r.toConfig()).content[0],i=this._layoutManager.root.getItemsById(this._parentId)[0],!i){var o;((o=this._layoutManager.root.contentItems.length)!==null&&o!==void 0?o:0)>0?i=this._layoutManager.root.contentItems[0]:i=this._layoutManager.root}}t&&((e=i)===null||e===void 0||e.addChild(t,this._indexInParent),this.close())}_createWindow(){var e=this._createUrl(),t=Math.floor(Math.random()*1e6).toString(36),i=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,i),!this._popoutWindow)if(this._layoutManager.config.settings.blockedPopoutsThrowError===!0){var r=new Error("Popout blocked");throw r.type="popoutBlocked",r}else return;O(this._popoutWindow).on("load",this._positionWindow.bind(this)).on("unload beforeunload",this._onClose.bind(this));var o=window.setInterval(()=>{var s;(s=this._popoutWindow)!==null&&s!==void 0&&s.__glInstance&&this._popoutWindow.__glInstance.isInitialised&&(this._onInitialised(),window.clearInterval(o))},10)}_serializeWindowOptions(e){var t=[],i;for(i in e)t.push(i+"="+e[i]);return t.join(",")}_createUrl(){var e={content:this._config},t="gl-window-config-"+Gn();e=Qi(e);try{localStorage.setItem(t,JSON.stringify(e))}catch(r){throw new Error("Error while writing to localStorage "+r.toString())}var i=document.location.href.split("?");return i.length===1?i[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 fe(n,e,t){return(e=mc(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function mc(n){var e=vc(n,"string");return typeof e=="symbol"?e:e+""}function vc(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class Ut extends xe{constructor(e,t,i,r,o,s){var a,l,d,h,v,m,p,f;if(super(),fe(this,"_dragListener",void 0),fe(this,"_layoutManager",void 0),fe(this,"_contentItem",void 0),fe(this,"_originalParent",void 0),fe(this,"_area",null),fe(this,"_lastValidArea",null),fe(this,"_minX",void 0),fe(this,"_maxX",void 0),fe(this,"_minY",void 0),fe(this,"_maxY",void 0),fe(this,"_width",void 0),fe(this,"_height",void 0),fe(this,"_sided",void 0),fe(this,"element",void 0),fe(this,"childElementContainer",void 0),fe(this,"_proxyTab",void 0),this._dragListener=i,this._layoutManager=r,this._contentItem=o,this._originalParent=s,this._dragListener.on("drag",this._onDrag,this),this._dragListener.on("dragStop",this._onDrop,this),this._contentItem.tab&&this._contentItem.tab.element){var g,y;this._layoutManager.tabDropPlaceholder.width((g=this._contentItem.tab.element.outerWidth(!0))!==null&&g!==void 0?g:0),this._layoutManager.tabDropPlaceholder.height((y=this._contentItem.tab.element.outerHeight(!0))!==null&&y!==void 0?y:0)}if(this.element=O(Ut._template),s&&s._side&&(this._sided=s._sided,this.element.addClass("lm_"+s._side),["right","bottom"].indexOf(s._side.toString())>=0&&this.element.find(".lm_content").after(this.element.find(".lm_header"))),this.element.css({left:e,top:t}),this._proxyTab=this.element.find(".lm_tab"),this._proxyTab.attr("title",Yi((a=this._contentItem.config.title)!==null&&a!==void 0?a:"")),this.element.find(".lm_title").text((l=this._contentItem.config.title)!==null&&l!==void 0?l:""),this.childElementContainer=this.element.find(".lm_content"),this.childElementContainer.append(o.element),this._updateTree(),this._layoutManager._$calculateItemAreas(),O(document.body).append(this.element),this._setDimensions(),!this._contentItem.tab&&this._proxyTab.length){var S,_;this._layoutManager.tabDropPlaceholder.width((S=this._proxyTab.outerWidth(!0))!==null&&S!==void 0?S:0),this._layoutManager.tabDropPlaceholder.height((_=this._proxyTab.outerHeight(!0))!==null&&_!==void 0?_:0)}var C=this._layoutManager.container.offset();this._minX=(d=C==null?void 0:C.left)!==null&&d!==void 0?d:0,this._minY=(h=C==null?void 0:C.top)!==null&&h!==void 0?h:0,this._maxX=((v=this._layoutManager.container.width())!==null&&v!==void 0?v:0)+this._minX,this._maxY=((m=this._layoutManager.container.height())!==null&&m!==void 0?m:0)+this._minY,this._width=(p=this.element.width())!==null&&p!==void 0?p:0,this._height=(f=this.element.height())!==null&&f!==void 0?f:0,this._setDropPosition(e,t),this._layoutManager.emit("itemPickedUp",this._contentItem)}_onDrag(e,t,i){var r,o,s=(r=i.pageX)!==null&&r!==void 0?r:0,a=(o=i.pageY)!==null&&o!==void 0?o:0,l=s>this._minX&&s<this._maxX&&a>this._minY&&a<this._maxY;!l&&this._layoutManager.config.settings.constrainDragToContainer===!0||this._setDropPosition(s,a)}_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,i=e.dragProxyHeight;this.element.width(t),this.element.height(i),t-=this._sided?e.headerHeight:0,i-=this._sided?0:e.headerHeight,this.childElementContainer.width(t),this.childElementContainer.height(i),this._contentItem.element.width(t),this._contentItem.element.height(i),this._contentItem.callDownwards("_$show"),this._contentItem.callDownwards("setSize")}}fe(Ut,"_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 Nn(n,e,t){return(e=pc(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function pc(n){var e=fc(n,"string");return typeof e=="symbol"?e:e+""}function fc(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class aa{constructor(e,t,i){Nn(this,"_element",void 0),Nn(this,"_itemConfig",void 0),Nn(this,"_layoutManager",void 0),Nn(this,"_dragListener",void 0),this._element=e,this._itemConfig=t,this._layoutManager=i,this._dragListener=this._createDragListener()}_createDragListener(){return this._dragListener=new Tn(this._element,!0),this._dragListener.on("dragStart",this._onDragStart,this),this._dragListener.on("dragStop",this._createDragListener,this),this._dragListener}_onDragStart(e,t){var i=this._itemConfig;typeof i=="function"&&(i=i());var r=this._layoutManager._$normalizeContentItem(O.extend(!0,{},i));new Ut(e,t,this._dragListener,this._layoutManager,r,null)}}function An(n,e,t){return(e=gc(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function gc(n){var e=bc(n,"string");return typeof e=="symbol"?e:e+""}function bc(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class la{constructor(e,t,i){An(this,"_element",O(window)),An(this,"_itemConfig",void 0),An(this,"_layoutManager",void 0),An(this,"_dragListener",void 0),this._itemConfig=e,this._layoutManager=t,this._createDragListener(i)}_createDragListener(e){this._dragListener&&this._dragListener.destroy(),this._element&&(this._dragListener=new Tn(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 i=this._itemConfig;typeof i=="function"&&(i=i());var r=this._layoutManager._$normalizeContentItem(O.extend(!0,{},i));new Ut(e,t,this._dragListener,this._layoutManager,r,null)}}}function da(n,e,t){return(e=yc(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function yc(n){var e=Cc(n,"string");return typeof e=="symbol"?e:e+""}function Cc(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class On{constructor(){da(this,"element",O(On._template)),O(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()}}da(On,"_template",'<div class="lm_dropTargetIndicator"><div class="lm_inner"></div></div>');function yi(n,e,t){return(e=wc(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function wc(n){var e=Sc(n,"string");return typeof e=="symbol"?e:e+""}function Sc(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class cn{constructor(e,t,i,r){yi(this,"element",void 0),yi(this,"_header",void 0),yi(this,"_action",void 0),this._header=e,this.element=O('<li class="'+i+'" title="'+t+'"></li>'),this._header.on("destroy",this._$destroy,this),this._action=r,this.element.on("click",this._action),this._header.controlsContainer.append(this.element)}_$destroy(){this.element.off(),this.element.remove()}}function _c(n,e,t){return(e=Ec(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Ec(n){var e=Pc(n,"string");return typeof e=="symbol"?e:e+""}function Pc(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class Nt extends Error{constructor(e,t){super(),_c(this,"node",void 0),this.name="Configuration Error",this.message=e,this.node=t}}const Tc=Object.freeze(Object.defineProperty({__proto__:null,ConfigurationError:Nt},Symbol.toStringTag,{value:"Module"}));function ve(n,e,t){return(e=Oc(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Oc(n){var e=xc(n,"string");return typeof e=="symbol"?e:e+""}function xc(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function Lt(n){return n.isStack}function Re(n){return n.isComponent}function ua(n){return n.isRoot}class be extends xe{constructor(e,t,i,r){super(),ve(this,"config",void 0),ve(this,"type",void 0),ve(this,"contentItems",void 0),ve(this,"parent",void 0),ve(this,"layoutManager",void 0),ve(this,"element",void 0),ve(this,"childElementContainer",void 0),ve(this,"componentName",void 0),ve(this,"isInitialised",!1),ve(this,"isMaximised",!1),ve(this,"isRoot",!1),ve(this,"isRow",!1),ve(this,"isColumn",!1),ve(this,"isStack",!1),ve(this,"isComponent",!1),ve(this,"tab",void 0),ve(this,"_pendingEventPropagations",void 0),ve(this,"_throttledEvents",void 0),this.element=r,this.config=this._extendItemNode(t),this.type=t.type,this.contentItems=[],this.parent=i,this.layoutManager=e,this._pendingEventPropagations={},this._throttledEvents=["stateChanged"],this.on(xe.ALL_EVENT,this._propagateEvent,this),t.content&&this._createContentItems(t)}callDownwards(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;i!==!0&&r!==!0&&this[e].apply(this,t);for(var o=0;o<this.contentItems.length;o++)this.contentItems[o].callDownwards(e,t,i);i===!0&&r!==!0&&this[e].apply(this,t)}removeChild(e){var t,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,r=this.contentItems.indexOf(e);if(r===-1)throw new Error("Can't remove child item. Unknown content item");if(i!==!0&&this.contentItems[r]._$destroy(),this.contentItems.splice(r,1),(t=this.config.content)===null||t===void 0||t.splice(r,1),this.contentItems.length>0)this.callDownwards("setSize");else if(this.type!=="root"&&this.config.isClosable){var o;(o=this.parent)===null||o===void 0||o.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 i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;t=this.layoutManager._$normalizeContentItem(t);var r=this.contentItems.indexOf(e),o=e.element[0].parentNode;if(r===-1)throw new Error("Can't replace child. oldChild is not child of this");o==null||o.replaceChild(t.element[0],e.element[0]),i===!0&&(e.parent=null,e._$destroy()),this.contentItems[r]=t,t.parent=this,Lt(this)&&(this.header.tabs[r].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=[],i=function r(o){for(var s=0;s<o.contentItems.length;s++)e(o.contentItems[s])===!0&&t.push(o.contentItems[s]),r(o.contentItems[s])};return i(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),i=[],r=0;r<t.length;r++)i.push(t[r].instance);return i}_$getItemsByProperty(e,t){return this.getItemsByFilter(function(i){return i[e]===t})}_$setParent(e){this.parent=e}_$highlightDropZone(e,t,i){var r;(r=this.layoutManager.dropTargetIndicator)===null||r===void 0||r.highlightArea(i)}_$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"),i=null,r=0;r<t.length;r++)i=t[r].getActiveContentItem(),i&&Re(i)&&i.container[e]()}_$destroy(){this.emitBubblingEvent("beforeItemDestroyed"),this.callDownwards("_$destroy",[],!0,!0),this.element.remove(),this.emitBubblingEvent("itemDestroyed")}_$getArea(e){var t,i,r;e=e||this.element;var o=(t=e.offset())!==null&&t!==void 0?t:{left:0,top:0},s=(i=e.width())!==null&&i!==void 0?i:0,a=(r=e.height())!==null&&r!==void 0?r:0;return{x1:o.left,y1:o.top,x2:o.left+s,y2:o.top+a,surface:s*a,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 Ni(e,this);this.emit(e,t)}_createContentItems(e){var t;if(!(e.content instanceof Array))throw new Nt("content must be an Array",e);for(var i=0;i<e.content.length;i++)t=this.layoutManager.createContentItem(e.content[i],this),this.contentItems.push(t)}_extendItemNode(e){for(var[t,i]of Object.entries(Ys)){var r=t;e[r]===void 0&&(e[r]=i)}return e}_propagateEvent(e,t){t instanceof Ni&&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,Zi(this._propagateEventToLayoutManager.bind(this,e,t)))}_propagateEventToLayoutManager(e,t){this._pendingEventPropagations[e]=!1,this.layoutManager.emit(e,t)}}function dn(n,e,t){return(e=Ic(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Ic(n){var e=Dc(n,"string");return typeof e=="symbol"?e:e+""}function Dc(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class ha extends be{constructor(e,t,i){var r;Object.entries((r=e.config.settings.defaultComponentConfig)!==null&&r!==void 0?r:{}).forEach(a=>{var[l,d]=a;t[l]===void 0&&(t[l]=d)}),super(e,t,i,O()),dn(this,"config",void 0),dn(this,"componentName",void 0),dn(this,"container",void 0),dn(this,"parent",void 0),dn(this,"instance",void 0),this.config=t,this.parent=i;var o=e.getComponent(this.config.componentName)||e.getFallbackComponent(),s=O.extend(!0,{},this.config.componentState||{});if(o==null)throw new Nt('Unknown component "'+this.config.componentName+'"');s.componentName=this.config.componentName,this.componentName=this.config.componentName,this.config.title===""&&(this.config.title=this.config.componentName),this.isComponent=!0,this.container=new ki(this.config,this,e),this.instance=new o(this.container,s),this.element=this.container._element}close(){var e;(e=this.parent)===null||e===void 0||e.removeChild(this)}setSize(){this.element.is(":visible")&&this.container._$setSize(this.element.width(),this.element.height())}_$init(){be.prototype._$init.call(this),this.container.emit("open")}_$hide(){this.container.hide(),be.prototype._$hide.call(this)}_$show(e){this.container.show(),(this.container._config.isFocusOnShow||e)&&this.container._contentElement[0].focus({preventScroll:!0}),be.prototype._$show.call(this)}_$destroy(){this.container.emit("destroy",this),be.prototype._$destroy.call(this)}_$getArea(){return null}}function Be(n,e,t){return(e=Mc(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Mc(n){var e=kc(n,"string");return typeof e=="symbol"?e:e+""}function kc(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class yn extends be{constructor(e,t,i,r){super(t,i,r,O('<div class="lm_item lm_'+(e?"column":"row")+'"></div>')),Be(this,"isRow",void 0),Be(this,"isColumn",void 0),Be(this,"childElementContainer",void 0),Be(this,"parent",void 0),Be(this,"_splitter",[]),Be(this,"_splitterSize",void 0),Be(this,"_splitterGrabSize",void 0),Be(this,"_isColumn",void 0),Be(this,"_dimension",void 0),Be(this,"_splitterPosition",null),Be(this,"_splitterMinPosition",null),Be(this,"_splitterMaxPosition",null),this.parent=r,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,i){var r,o,s,a;if(e=this.layoutManager._$normalizeContentItem(e,this),t===void 0&&(t=this.contentItems.length),this.contentItems.length>0?(a=this._createSplitter(Math.max(0,t-1)).element,t>0?(this.contentItems[t-1].element.after(a),a.after(e.element)):(this.contentItems[0].element.before(a),a.before(e.element))):this.childElementContainer.append(e.element),be.prototype.addChild.call(this,e,t),r=1/this.contentItems.length*100,i===!0){this.emitBubblingEvent("stateChanged");return}for(s=0;s<this.contentItems.length;s++)if(this.contentItems[s]===e)e.config[this._dimension]=r;else{var l;o=((l=this.contentItems[s].config[this._dimension])!==null&&l!==void 0?l:0)*(100-r)/100,this.contentItems[s].config[this._dimension]=o}this.callDownwards("setSize"),this.emitBubblingEvent("stateChanged")}removeChild(e,t){var i,r=(i=e.config[this._dimension])!==null&&i!==void 0?i:0,o=this.contentItems.indexOf(e),s=Math.max(o-1,0),a,l;if(o===-1)throw new Error("Can't remove child. ContentItem is not child of this Row or Column");for(this._splitter[s]&&(this._splitter[s]._$destroy(),this._splitter.splice(s,1)),a=0;a<this.contentItems.length;a++)if(this.contentItems[a]!==e){var d;this.contentItems[a].config[this._dimension]=((d=this.contentItems[a].config[this._dimension])!==null&&d!==void 0?d:0)+r/(this.contentItems.length-1)}if(be.prototype.removeChild.call(this,e,t),this.contentItems.length===1&&this.config.isClosable===!0){var h;l=this.contentItems[0],this.contentItems=[],(h=this.parent)===null||h===void 0||h.replaceChild(this,l,!0)}else this.callDownwards("setSize"),this.emitBubblingEvent("stateChanged")}replaceChild(e,t){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,r=e.config[this._dimension];t.config[this._dimension]=r,super.replaceChild(e,t,i),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(be.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,i=(this.contentItems.length-1)*this._splitterSize,r=(e=this.element.width())!==null&&e!==void 0?e:0,o=(t=this.element.height())!==null&&t!==void 0?t:0,s=0,a=[];this._isColumn?o-=i:r-=i;for(var l=0;l<this.contentItems.length;l++){var d,h,v=this._isColumn?Math.floor(o*(((d=this.contentItems[l].config.height)!==null&&d!==void 0?d:0)/100)):Math.floor(r*(((h=this.contentItems[l].config.width)!==null&&h!==void 0?h:0)/100));s+=v,a.push(v)}var m=Math.floor((this._isColumn?o:r)-s);return{itemSizes:a,additionalPixel:m,totalWidth:r,totalHeight:o}}_calculateRelativeSizes(){for(var e=0,t=[],i=this._isColumn?"height":"width",r=0;r<this.contentItems.length;r++){var o=this.contentItems[r].config[i];o!=null?e+=o:t.push(this.contentItems[r])}if(Math.round(e)===100){this._respectMinItemWidth();return}if(Math.round(e)<100&&t.length>0){for(var s=0;s<t.length;s++)t[s].config[i]=(100-e)/t.length;this._respectMinItemWidth();return}if(Math.round(e)>100)for(var a=0;a<t.length;a++)t[a].config[i]=50,e+=50;for(var l=0;l<this.contentItems.length;l++){var d;this.contentItems[l].config[i]=((d=this.contentItems[l].config[i])!==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,i=[],r=0,o=0,s=0,a=[],l;if(!(this._isColumn||!t||this.contentItems.length<=1)){for(var d=this._calculateAbsoluteSizes(),h=0;h<this.contentItems.length;h++){this.contentItems[h];var v=d.itemSizes[h];v<t?(o+=t-v,l={width:t}):(r+=v-t,l={width:v},i.push(l)),a.push(l)}if(!(o===0||o>r)){var m=o/r;s=o;for(var p=0;p<i.length;p++){l=i[p];var f=Math.round((l.width-t)*m);s-=f,l.width-=f}s!==0&&(a[a.length-1].width-=s);for(var g=0;g<this.contentItems.length;g++)this.contentItems[g].config.width=a[g].width/d.totalWidth*100}}}_createSplitter(e){var t;return t=new ca(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,i=0,r=0;r<e.length;++r){var o,s;t=Math.max((o=e[r].minWidth)!==null&&o!==void 0?o:0,t),i=Math.max((s=e[r].minHeight)!==null&&s!==void 0?s:0,i)}return{horizontal:t,vertical:i}}_onSplitterDragStart(e){var t,i,r,o,s=this._getItemsForSplitter(e),a=this.layoutManager.config.dimensions[this._isColumn?"minItemHeight":"minItemWidth"],l=this._getMinimumDimensions((t=s.before.config.content)!==null&&t!==void 0?t:[]),d=this._isColumn?l.vertical:l.horizontal,h=this._getMinimumDimensions((i=s.after.config.content)!==null&&i!==void 0?i:[]),v=this._isColumn?h.vertical:h.horizontal;this._splitterPosition=0,this._splitterMinPosition=-1*(((r=s.before.element[this._dimension]())!==null&&r!==void 0?r:0)-(d||a)),this._splitterMaxPosition=((o=s.after.element[this._dimension]())!==null&&o!==void 0?o:0)-(v||a)}_onSplitterDrag(e,t,i){var r=this._isColumn?i:t;this._splitterMaxPosition==null||this._splitterMinPosition==null||r>this._splitterMinPosition&&r<this._splitterMaxPosition&&(this._splitterPosition=r,e.element.css(this._isColumn?"top":"left",r))}_onSplitterDragStop(e){var t,i,r,o,s,a=this._getItemsForSplitter(e),l=(t=a.before.element[this._dimension]())!==null&&t!==void 0?t:0,d=(i=a.after.element[this._dimension]())!==null&&i!==void 0?i:0,h=(((r=this._splitterPosition)!==null&&r!==void 0?r:0)+l)/(l+d),v=((o=a.before.config[this._dimension])!==null&&o!==void 0?o:0)+((s=a.after.config[this._dimension])!==null&&s!==void 0?s:0);a.before.config[this._dimension]=h*v,a.after.config[this._dimension]=(1-h)*v,e.element.css({top:0,left:0}),Zi(this.callDownwards.bind(this,"setSize",void 0,void 0,void 0))}}function Zr(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(n);e&&(i=i.filter(function(r){return Object.getOwnPropertyDescriptor(n,r).enumerable})),t.push.apply(t,i)}return t}function Yr(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Zr(Object(t),!0).forEach(function(i){Ai(n,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Zr(Object(t)).forEach(function(i){Object.defineProperty(n,i,Object.getOwnPropertyDescriptor(t,i))})}return n}function Ai(n,e,t){return(e=jc(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function jc(n){var e=Nc(n,"string");return typeof e=="symbol"?e:e+""}function Nc(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class Li extends be{constructor(e,t,i){super(e,Yr(Yr({},t),{},{type:"root"}),null,O('<div class="lm_goldenlayout lm_item lm_root"></div>')),Ai(this,"childElementContainer",void 0),Ai(this,"_containerElement",void 0),this.isRoot=!0,this.type="root",this.childElementContainer=this.element,this._containerElement=i,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 i,r;e=typeof e>"u"?(i=this._containerElement.width())!==null&&i!==void 0?i:0:e,t=typeof t>"u"?(r=this._containerElement.height())!==null&&r!==void 0?r: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,i){this.layoutManager.tabDropPlaceholder.remove(),super._$highlightDropZone(e,t,i)}_$onDrop(e,t){var i;if(Re(e)&&(i=this.layoutManager.createContentItem({type:"stack",header:e.config.header||{}},this),i._$init(),i.addChild(e),e=i),!this.contentItems.length)this.addChild(e);else{var{side:r}=t,o=r==="left"||r==="right"?"row":"column",s=r==="left"||r==="right"?"width":"height",a=r==="left"||r==="top",l=this.contentItems[0];if(!(l instanceof yn)||l.type!=o){var d=this.layoutManager.createContentItem({type:o},this);this.replaceChild(l,d),d.addChild(e,a?0:void 0,!0),d.addChild(l,a?void 0:0,!0),l.config[s]=50,e.config[s]=50,d.callDownwards("setSize")}else{var h,v=l.contentItems[a?0:l.contentItems.length-1];l.addChild(e,a?0:void 0,!0),v.config[s]=((h=v.config[s])!==null&&h!==void 0?h:0)*.5,e.config[s]=v.config[s],l.callDownwards("setSize")}}}}function Qr(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(n);e&&(i=i.filter(function(r){return Object.getOwnPropertyDescriptor(n,r).enumerable})),t.push.apply(t,i)}return t}function Wt(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Qr(Object(t),!0).forEach(function(i){Ae(n,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Qr(Object(t)).forEach(function(i){Object.defineProperty(n,i,Object.getOwnPropertyDescriptor(t,i))})}return n}function Ae(n,e,t){return(e=Ac(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Ac(n){var e=Lc(n,"string");return typeof e=="symbol"?e:e+""}function Lc(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class Ri extends be{constructor(e,t,i){var r,o,s,a,l,d,h,v,m;super(e,t,i,O('<div class="lm_item lm_stack"></div>')),Ae(this,"_activeContentItem",null),Ae(this,"_header",void 0),Ae(this,"childElementContainer",O('<div class="lm_items"></div>')),Ae(this,"header",void 0),Ae(this,"parent",void 0),Ae(this,"isStack",!0),Ae(this,"_dropSegment",null),Ae(this,"_contentAreaDimensions",null),Ae(this,"_dropIndex",void 0),Ae(this,"_side",void 0),Ae(this,"_sided",!1),Ae(this,"config",void 0),this.parent=i,this.config=t;var p=e.config;this._side=!1,this._header={show:((r=p.settings)===null||r===void 0?void 0:r.hasHeaders)&&t.hasHeaders!==!1,popout:(o=p.settings)!==null&&o!==void 0&&o.showPopoutIcon?(s=p.labels)===null||s===void 0?void 0:s.popout:void 0,maximise:(a=p.settings)!==null&&a!==void 0&&a.showMaximiseIcon?(l=p.labels)===null||l===void 0?void 0:l.maximise:void 0,close:(d=p.settings)!==null&&d!==void 0&&d.showCloseIcon?(h=p.labels)===null||h===void 0?void 0:h.close:void 0,minimise:(v=(m=p.labels)===null||m===void 0?void 0:m.minimise)!==null&&v!==void 0?v:void 0},p.header&&(this._header=Wt(Wt({},this._header),p.header)),t.header&&(this._header=Wt(Wt({},this._header),t.header)),t.content&&t.content[0]&&t.content[0].header&&(this._header=Wt(Wt({},this._header),t.content[0].header)),this.header=new pt(e,this),this.element.append(this.header.element),this.element.append(this.childElementContainer),this._setupHeaderPosition(),this._$validateClosability()}setSize(){var e,t,i,r,o,s=this._header.show&&(e=(t=this.layoutManager.config.dimensions)===null||t===void 0?void 0:t.headerHeight)!==null&&e!==void 0?e:0,a=((i=this.element.width())!==null&&i!==void 0?i:0)-(this._sided?s:0),l=((r=this.element.height())!==null&&r!==void 0?r:0)-(this._sided?0:s);for(this.childElementContainer.width(a),this.childElementContainer.height(l),o=0;o<this.contentItems.length;o++)this.contentItems[o].element.width(a).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,t){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),Re(e)?e._$show(t):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,i=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(i-1,0)]):this._activeContentItem=null),this._$validateClosability(),this.emitBubblingEvent("stateChanged")}_$validateClosability(){for(var e=this.header._isClosable(),t=0,i=this.contentItems.length;t<i;t++){var r;if(!e)break;e=(r=this.contentItems[t].config.isClosable)!==null&&r!==void 0?r:!1}this.header._$setClosable(e)}_$destroy(){be.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",i=this._dropSegment==="left"||this._dropSegment==="right",r=this._dropSegment==="top"||this._dropSegment==="left",o=this.parent instanceof yn&&(t&&this.parent.isColumn||i&&this.parent.isRow),s=t?"column":"row",a=t?"height":"width";if(Re(e)){var l=this.layoutManager.createContentItem({type:"stack",header:e.config.header||{}},this);l._$init(),l.addChild(e),e=l}if(o){var d,h=this.parent.contentItems.indexOf(this);this.parent.addChild(e,r?h:h+1,!0),this.config[a]=((d=this.config[a])!==null&&d!==void 0?d:0)*.5,e.config[a]=this.config[a],this.parent.callDownwards("setSize")}else{var v,m=this.layoutManager.createContentItem({type:s},this);(v=this.parent)===null||v===void 0||v.replaceChild(this,m),m.addChild(e,r?0:void 0,!0),m.addChild(this,r?void 0:0,!0),this.config[a]=50,e.config[a]=50,m.callDownwards("setSize")}}_$highlightDropZone(e,t){if(this._contentAreaDimensions)for(var[i,r]of Object.entries(this._contentAreaDimensions)){var o=r.hoverArea;if(o.x1<e&&o.x2>e&&o.y1<t&&o.y2>t){i==="header"?(this._dropSegment="header",this._highlightHeaderDropZone(e)):(this._resetHeaderDropZone(),this._highlightBodyDropZone(i));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 i=t.x2-t.x1,r=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+i*.25,y2:t.y2},highlightArea:{x1:t.x1,y1:t.y1,x2:t.x1+i*.5,y2:t.y2}},this._contentAreaDimensions.top={hoverArea:{x1:t.x1+i*.25,y1:t.y1,x2:t.x1+i*.75,y2:t.y1+r*.5},highlightArea:{x1:t.x1,y1:t.y1,x2:t.x2,y2:t.y1+r*.5}},this._contentAreaDimensions.right={hoverArea:{x1:t.x1+i*.75,y1:t.y1,x2:t.x2,y2:t.y2},highlightArea:{x1:t.x1+i*.5,y1:t.y1,x2:t.x2,y2:t.y2}},this._contentAreaDimensions.bottom={hoverArea:{x1:t.x1+i*.25,y1:t.y1+r*.5,x2:t.x1+i*.75,y2:t.y2},highlightArea:{x1:t.x1,y1:t.y1+r*.5,x2:t.x2,y2:t.y2}},super._$getArea(this.element))}_highlightHeaderDropZone(e){var t,i,r,o,s,a,l,d,h,v,m,p,f,g,y,S,_=this.header.tabs.length;if(_===0){var C,D,W,X,I,V,A,J,ee=this.header.element.offset();(C=this.layoutManager.dropTargetIndicator)===null||C===void 0||C.highlightArea({x1:(D=ee==null?void 0:ee.left)!==null&&D!==void 0?D:0,x2:((W=ee==null?void 0:ee.left)!==null&&W!==void 0?W:0)+100,y1:(X=(I=this.header.element.offset())===null||I===void 0?void 0:I.top)!==null&&X!==void 0?X:0,y2:((V=(A=this.header.element.offset())===null||A===void 0?void 0:A.top)!==null&&V!==void 0?V:0)+((J=this.header.element.innerHeight())!==null&&J!==void 0?J:0)});return}var j=this.header.tabsContainer,G=(t=j.get(0))===null||t===void 0?void 0:t.getBoundingClientRect(),F=(i=this.layoutManager.tabDropPlaceholder.get(0))===null||i===void 0?void 0:i.getBoundingClientRect();if(!(!G||!F)){e<G.left?e=G.left+1:e>G.right&&(e=G.right-1);var M,$;if(!(F.left<e&&e<F.right)){for(var B=0;B<_;B++){var me;if(M=this.header.tabs[B].element,$=(me=M.get(0))===null||me===void 0?void 0:me.getBoundingClientRect(),$&&$.left<e&&e<$.right){this._dropIndex=B;break}}if(M&&$&&e<$.left+$.width*.5)M.before(this.layoutManager.tabDropPlaceholder);else if(M){var it;this._dropIndex=Math.min(((it=this._dropIndex)!==null&&it!==void 0?it:0)+1,_),M.after(this.layoutManager.tabDropPlaceholder)}}var Xe=(r=(o=this.layoutManager.tabDropPlaceholder.offset())===null||o===void 0?void 0:o.left)!==null&&r!==void 0?r:0;Xe=Math.max(Xe,(s=(a=this.header.tabsContainer.offset())===null||a===void 0?void 0:a.left)!==null&&s!==void 0?s:0);var N=Xe+((l=this.layoutManager.tabDropPlaceholder.width())!==null&&l!==void 0?l:0);N=Math.min(N,((d=(h=this.header.tabsContainer.offset())===null||h===void 0?void 0:h.left)!==null&&d!==void 0?d:0)+((v=this.header.tabsContainer.innerWidth())!==null&&v!==void 0?v:0)),(m=this.layoutManager.dropTargetIndicator)===null||m===void 0||m.highlightArea({x1:Xe,x2:N,y1:(p=(f=this.header.element.offset())===null||f===void 0?void 0:f.top)!==null&&p!==void 0?p:0,y2:((g=(y=this.header.element.offset())===null||y===void 0?void 0:y.top)!==null&&g!==void 0?g:0)+((S=this.header.element.innerHeight())!==null&&S!==void 0?S:0)})}}_resetHeaderDropZone(){this.layoutManager.tabDropPlaceholder.remove()}_setupHeaderPosition(){var e=["right","left","bottom"].some(i=>i===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,i,r=(t=this._contentAreaDimensions)===null||t===void 0||(i=t[e])===null||i===void 0?void 0:i.highlightArea;if(r){var o;(o=this.layoutManager.dropTargetIndicator)===null||o===void 0||o.highlightArea(r)}this._dropSegment=e}}const Rc=Object.freeze(Object.defineProperty({__proto__:null,AbstractContentItem:be,Component:ha,ContentItem:be,Root:Li,RowOrColumn:yn,Stack:Ri,isComponent:Re,isRoot:ua,isStack:Lt},Symbol.toStringTag,{value:"Module"}));function dt(n,e,t){return(e=Fc(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Fc(n){var e=$c(n,"string");return typeof e=="symbol"?e:e+""}function $c(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class xn{constructor(e,t){var i;dt(this,"header",void 0),dt(this,"contentItem",void 0),dt(this,"element",O(xn._template)),dt(this,"titleElement",void 0),dt(this,"closeElement",void 0),dt(this,"isActive",!1),dt(this,"_layoutManager",void 0),dt(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,(i=this._layoutManager.config.settings)!==null&&i!==void 0&&i.reorderEnabled&&t.config.reorderEnabled&&(this._dragListener=new Tn(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.element.on("mouseup",this._onMouseUp),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),Re(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.text(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.element.off("mouseup",this._onMouseUp),this.closeElement.off("click",this._onCloseClick),Re(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 i;(i=this.contentItem.parent)!==null&&i!==void 0&&i.isMaximised&&this.contentItem.parent.toggleMaximise(),this._dragListener&&new Ut(e,t,this._dragListener,this._layoutManager,this.contentItem,this.header.parent)}_onTabContentFocusIn(){O(".lm_focusin",this._layoutManager.root.element).removeClass("lm_focusin"),this.element.addClass("lm_focusin")}_onTabContentFocusOut(){Re(this.contentItem)&&!this.contentItem.container._contentElement[0].contains(document.activeElement)&&this.element.removeClass("lm_focusin")}_onTabClick(e){if(!e||e.button===0){var t,i=this.header.parent.getActiveContentItem();this.contentItem!==i&&Re(this.contentItem)?this.header.parent.setActiveContentItem(this.contentItem):Re(this.contentItem)&&!this.contentItem.container._contentElement[0].contains(document.activeElement)&&this.contentItem.container._contentElement.focus(),Re(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(),Re(this.contentItem)?this.contentItem.container.close():this.header.parent.removeChild(this.contentItem)}_onMouseUp(e){e.button===1&&(e.preventDefault(),e.stopPropagation())}_onCloseMousedown(e){e.stopPropagation()}}dt(xn,"_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 q(n,e,t){return(e=Hc(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Hc(n){var e=Uc(n,"string");return typeof e=="symbol"?e:e+""}function Uc(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class pt extends xe{constructor(e,t){var i,r;super(),q(this,"layoutManager",void 0),q(this,"element",O(pt._template)),q(this,"tabsContainer",void 0),q(this,"tabDropdownContainer",void 0),q(this,"tabDropdownSearch",void 0),q(this,"tabDropdownList",null),q(this,"controlsContainer",void 0),q(this,"parent",void 0),q(this,"tabs",[]),q(this,"activeContentItem",null),q(this,"closeButton",null),q(this,"tabDropdownButton",null),q(this,"tabNextButton",O(pt._nextButtonTemplate)),q(this,"tabPreviousButton",O(pt._previousButtonTemplate)),q(this,"holdTimer",null),q(this,"rAF",null),q(this,"CLICK_TIMEOUT",500),q(this,"START_SPEED",.01),q(this,"ACCELERATION",5e-4),q(this,"PADDING",10),q(this,"SCROLL_LEFT","left"),q(this,"SCROLL_RIGHT","right"),q(this,"isDraggingTab",!1),q(this,"isOverflowing",!1),q(this,"isDropdownShown",!1),q(this,"dropdownKeyIndex",0),q(this,"_lastVisibleTabIndex",-1),q(this,"_tabControlOffset",void 0),this.layoutManager=e,(i=this.layoutManager.config.settings)!==null&&i!==void 0&&i.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=(r=this.layoutManager.config.settings)===null||r===void 0?void 0:r.tabControlOffset,this._createControls()}createTab(e,t){for(var i=0;i<this.tabs.length;i++)if(this.tabs[i].contentItem===e)return;var r=new xn(this,e);if(this.tabs.length===0){this.tabs.push(r),this.tabsContainer.append(r.element);return}t===void 0&&(t=this.tabs.length),t>0?this.tabs[t-1].element.after(r.element):this.tabs[0].element.before(r.element),this.tabs.splice(t,0,r),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,i,r,o,s=0;s<this.tabs.length;s++)o=this.tabs[s].contentItem===e,this.tabs[s].setActive(o),o===!0&&(this.activeContentItem=e,this.parent.config.activeItemIndex=s);(t=this.tabs[(r=this.parent.config.activeItemIndex)!==null&&r!==void 0?r:0].element.get(0))===null||t===void 0||(i=t.scrollIntoView)===null||i===void 0||i.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 i=Math.abs(e.deltaY)>Math.abs(e.deltaX)?e.deltaY:e.deltaX;if(e.deltaMode===WheelEvent.DOM_DELTA_PAGE){var r;i*=(r=this.tabsContainer.innerWidth())!==null&&r!==void 0?r:1}else e.deltaMode===WheelEvent.DOM_DELTA_LINE&&(i*=100/3);t.scrollLeft+=Math.round(i)}}_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 i,r,o,s,a;if(((i=(r=this.tabs[t].element.get(0))===null||r===void 0?void 0:r.offsetLeft)!==null&&i!==void 0?i:0)>((o=(s=this.tabsContainer.get(0))===null||s===void 0?void 0:s.offsetWidth)!==null&&o!==void 0?o: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:"nearest"}),this._handleScrollButtonMouseDown(this.SCROLL_RIGHT);else{var l=this.tabsContainer.get(0);if(l){var d,h;l.scrollLeft=(d=(h=this.tabsContainer.get(0))===null||h===void 0?void 0:h.scrollWidth)!==null&&d!==void 0?d:0}}}_handlePreviousButtonMouseDown(){for(var e,t=this.tabs.length-1;t>=0;t-=1){var i,r,o;if(((i=(r=this.tabs[t].element.get(0))===null||r===void 0?void 0:r.offsetLeft)!==null&&i!==void 0?i:0)<((o=this.tabsContainer.scrollLeft())!==null&&o!==void 0?o:0)){e=this.tabs[t].element.get(0);break}}if(e)e.scrollIntoView({behavior:"smooth",inline:"start"}),this._handleScrollButtonMouseDown(this.SCROLL_LEFT);else{var s=this.tabsContainer.get(0);s&&(s.scrollLeft=0)}}_handleScrollButtonMouseDown(e){this.holdTimer=window.setTimeout(()=>{var t;this._handleScrollRepeat(e,(t=this.tabsContainer.scrollLeft())!==null&&t!==void 0?t:0,100)},this.CLICK_TIMEOUT),window.addEventListener("mouseup",this._handleScrollButtonMouseUp)}_handleScrollButtonMouseUp(){var e,t;clearTimeout((e=this.holdTimer)!==null&&e!==void 0?e:-1),this.holdTimer=null,cancelAnimationFrame((t=this.rAF)!==null&&t!==void 0?t:-1),this.rAF=null,window.removeEventListener("mouseup",this._handleScrollButtonMouseUp)}_checkScrollArrows(){var e,t,i;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)===((i=this.tabsContainer.get(0))===null||i===void 0?void 0:i.scrollWidth)?this.tabNextButton.prop("disabled",!0):(this.tabNextButton.prop("disabled",!1),this.tabPreviousButton.first().prop("disabled",!1))}_handleScrollRepeat(e,t){var i,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,o=arguments.length>3?arguments[3]:void 0,s=this.tabsContainer.get(0);if(s){var a=s.getBoundingClientRect();if(e===this.SCROLL_LEFT){if(this.tabsContainer.scrollLeft(t-r),this.isDraggingTab&&this.parent._highlightHeaderDropZone(a.left-1),this.tabsContainer.scrollLeft()===0){this._checkScrollArrows();return}}else if(e===this.SCROLL_RIGHT){var l,d;if(this.tabsContainer.scrollLeft(t+r),this.isDraggingTab&&this.parent._highlightHeaderDropZone(a.right+1),((l=this.tabsContainer.scrollLeft())!==null&&l!==void 0?l:0)+((d=this.tabsContainer.innerWidth())!==null&&d!==void 0?d:0)===s.scrollWidth){this._checkScrollArrows();return}}window.cancelAnimationFrame((i=this.rAF)!==null&&i!==void 0?i:-1),this.rAF=window.requestAnimationFrame(h=>{var v,m,p=o||h,f=h-p,g=this.START_SPEED*f+.5*this.ACCELERATION*(f*f);g=Math.min(g,(v=(m=this.tabsContainer.get(0))===null||m===void 0?void 0:m.scrollWidth)!==null&&v!==void 0?v:1/0),this._handleScrollRepeat(e,t,g,p)})}}_$setClosable(e){return this.closeButton&&this._isClosable()?(this.closeButton.element[e?"show":"hide"](),!0):!1}_$destroy(){this.emit("destroy",this);for(var e=0;e<this.tabs.length;e++)this.tabs[e]._$destroy();this._detachWheelListener(),this._handleItemDropped(),O(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,i,r,o;if(o=this.layoutManager.config.labels.tabDropdown,this.layoutManager.config.labels.tabNextLabel,this.layoutManager.config.labels.tabPreviousLabel,this.tabDropdownButton=new cn(this,o,"lm_tabdropdown",this._showAdditionalTabsDropdown),this.tabDropdownButton.element.hide(),this.controlsContainer.prepend(this.tabNextButton),this.tabNextButton.hide(),this._getHeaderSetting("popout")&&(t=this._onPopoutClick.bind(this),i=this._getHeaderSetting("popout"),new cn(this,i,"lm_popout",t)),this._getHeaderSetting("maximise")){r=this.parent.toggleMaximise.bind(this.parent);var s=this._getHeaderSetting("maximise"),a=this._getHeaderSetting("minimise"),l=new cn(this,s,"lm_maximise",r);this.parent.on("maximised",function(){l.element.attr("title",a??"")}),this.parent.on("minimised",function(){l.element.attr("title",s??"")})}this._isClosable()&&(e=this.parent.remove.bind(this.parent),i=this._getHeaderSetting("close"),this.closeButton=new cn(this,i,"lm_close",e))}_showAdditionalTabsDropdown(){if(this.isDropdownShown){this._hideAdditionalTabsDropdown();return}this.tabDropdownList=this.tabsContainer.clone(!0).appendTo(this.tabDropdownContainer).children().removeClass("lm_active"),O(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"),O(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(a,l,d){if(d==null||d.length<2)return-1;for(var h=(a+l+d.length)%d.length;h!==a;){if(d.eq(h).css("display")!=="none")return h;h=(h+l+d.length)%d.length}return a}if(e.key==="ArrowDown"||e.key==="Tab"&&e.shiftKey===!1){var i,r;e.preventDefault(),(i=this.tabDropdownList)===null||i===void 0||i.eq(this.dropdownKeyIndex).removeClass("lm_keyboard_active"),this.dropdownKeyIndex=t(this.dropdownKeyIndex,1,this.tabDropdownList),(r=this.tabDropdownList)===null||r===void 0||r.eq(this.dropdownKeyIndex).addClass("lm_keyboard_active")}else if(e.key==="ArrowUp"||e.key==="Tab"){var o,s;e.preventDefault(),(o=this.tabDropdownList)===null||o===void 0||o.eq(this.dropdownKeyIndex).removeClass("lm_keyboard_active"),this.dropdownKeyIndex=t(this.dropdownKeyIndex,-1,this.tabDropdownList),(s=this.tabDropdownList)===null||s===void 0||s.eq(this.dropdownKeyIndex).addClass("lm_keyboard_active")}}_handleFilterInput(e){if(this.tabDropdownList!=null){this.tabDropdownList.eq(this.dropdownKeyIndex).removeClass("lm_keyboard_active"),this.dropdownKeyIndex=-1;for(var t=0;t<this.tabDropdownList.length;t++){var i,r;((i=(r=this.tabs[t].contentItem.config.title)===null||r===void 0?void 0:r.toLowerCase().indexOf(e.target.value.toLowerCase()))!==null&&i!==void 0?i:-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,i;this.isDropdownShown&&(e&&(t=this.tabDropdownContainer.get(0))!==null&&t!==void 0&&t.contains(e.target)||e&&((i=this.tabDropdownButton)===null||i===void 0?void 0:i.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(),O(document).off("mousedown",this._hideAdditionalTabsDropdown)))}_updateAdditionalTabsDropdown(){var e,t,i,r;if(this.isDropdownShown&&!(!this.tabDropdownList||this.tabDropdownList.length==0)){var o=(e=(t=this.tabDropdownContainer.get(0))===null||t===void 0?void 0:t.scrollHeight)!==null&&e!==void 0?e:0;if(o!==0){var s=this.tabDropdownContainer[0].getBoundingClientRect(),a=(i=O(window).height())!==null&&i!==void 0?i:0,l=(r=O(window).width())!==null&&r!==void 0?r:0;if(this.tabDropdownButton){var d=this.tabDropdownButton.element[0].getBoundingClientRect(),h=o<a-d.bottom,v=!h&&d.bottom>a*.6,m=Math.min(d.left+(v?d.width:0),l-s.width-this.PADDING),p=v?Math.max(d.top-o,this.PADDING):d.bottom,f=a-p-this.PADDING;this.tabDropdownContainer.css({"max-height":f,top:p,left:m})}}}}_isClosable(){return!!(this.parent.config.isClosable&&this.layoutManager.config.settings.showCloseIcon)}_onPopoutClick(){if(this.layoutManager.config.settings.popoutWholeStack===!0)this.parent.popout();else{var e;(e=this.activeContentItem)===null||e===void 0||e.popout()}}_onHeaderClick(e){e.target===this.element[0]&&this.parent.select()}_updateTabSizes(){if(this.tabs.length!==0){var e=this.tabsContainer.get(0);if(this.isDropdownShown&&this._updateAdditionalTabsDropdown(),!!e){if(!this.isOverflowing&&e.scrollWidth>e.clientWidth){var t;(t=this.tabDropdownButton)===null||t===void 0||t.element.show(),this.tabNextButton.show(),this.tabPreviousButton.show(),this.isOverflowing=!0}else if(this.isOverflowing&&e.scrollWidth<=e.clientWidth){var i;(i=this.tabDropdownButton)===null||i===void 0||i.element.hide(),this.tabNextButton.hide(),this.tabPreviousButton.hide(),this.isOverflowing=!1}this.isOverflowing&&this._checkScrollArrows()}}}}q(pt,"_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(""));q(pt,"_previousButtonTemplate",['<ul class="lm_controls">','<li class="lm_tabpreviousbutton"></li>',"</ul>"].join(""));q(pt,"_nextButtonTemplate",['<li class="lm_tabnextbutton"></li>'].join(""));function un(n,e,t){return(e=Bc(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Bc(n){var e=Kc(n,"string");return typeof e=="symbol"?e:e+""}function Kc(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class ca{constructor(e,t,i){un(this,"_isVertical",void 0),un(this,"_size",void 0),un(this,"_grabSize",void 0),un(this,"_dragListener",void 0),un(this,"element",void 0),this._isVertical=e,this._size=t,this._grabSize=i<t?t:i,this.element=this._createElement(),this._dragListener=new Tn(this.element)}on(e,t,i){var r;(r=this._dragListener)===null||r===void 0||r.on(e,t,i)}_$destroy(){var e;(e=this._dragListener)===null||e===void 0||e.destroy(),this._dragListener=null,this.element.remove()}_createElement(){var e=O('<div class="lm_drag_handle"></div>'),t=O('<div class="lm_splitter"></div>');t.append(e);var i=this._grabSize-this._size,r=i/2;return this._isVertical?(e.css("top",-r),e.css("height",this._size+i),t.addClass("lm_vertical"),t.height(this._size)):(e.css("left",-r),e.css("width",this._size+i),t.addClass("lm_horizontal"),t.width(this._size)),t}}const Wc=Object.freeze(Object.defineProperty({__proto__:null,BrowserPopout:sa,DragProxy:Ut,DragSource:aa,DragSourceFromEvent:la,DropTargetIndicator:On,Header:pt,HeaderButton:cn,Splitter:ca,Tab:xn},Symbol.toStringTag,{value:"Module"}));var zc={config:zh,container:Zh,controls:Wc,errors:Tc,items:Rc,utils:uc};function Jr(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(n);e&&(i=i.filter(function(r){return Object.getOwnPropertyDescriptor(n,r).enumerable})),t.push.apply(t,i)}return t}function Ie(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Jr(Object(t),!0).forEach(function(i){Z(n,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Jr(Object(t)).forEach(function(i){Object.defineProperty(n,i,Object.getOwnPropertyDescriptor(t,i))})}return n}function Z(n,e,t){return(e=Vc(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Vc(n){var e=Gc(n,"string");return typeof e=="symbol"?e:e+""}function Gc(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var eo=["column","row","stack","component"];class er extends xe{static isLayoutItemConfig(e){return eo.includes(e.type)}static minifyConfig(e){return Qi(e)}static unminifyConfig(e){return ji(e)}constructor(e,t){super(),Z(this,"isInitialised",!1),Z(this,"_isFullPage",!1),Z(this,"_resizeTimeoutId",void 0),Z(this,"_components",{"lm-react-component":ea}),Z(this,"_fallbackComponent",void 0),Z(this,"_itemAreas",[]),Z(this,"_maximisedItem",null),Z(this,"_maximisePlaceholder",O('<div class="lm_maximise_place"></div>')),Z(this,"_creationTimeoutPassed",!1),Z(this,"_subWindowsCreated",!1),Z(this,"_dragSources",[]),Z(this,"_updatingColumnsResponsive",!1),Z(this,"_firstLoad",!0),Z(this,"_reactChildMap",new Map),Z(this,"_reactChildren",null),Z(this,"_initialHeaderHeight",void 0),Z(this,"width",null),Z(this,"height",null),Z(this,"root",void 0),Z(this,"openPopouts",[]),Z(this,"selectedItem",null),Z(this,"isSubWindow",!1),Z(this,"eventHub",new ta(this)),Z(this,"config",void 0),Z(this,"container",void 0),Z(this,"_originalContainer",void 0),Z(this,"dropTargetIndicator",null),Z(this,"tabDropPlaceholder",O('<div class="lm_drop_tab_placeholder"></div>')),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._windowKeydown=this._windowKeydown.bind(this),this.config=this._createConfig(e),this._originalContainer=t,this.container=this._getContainer(),this._initialHeaderHeight=this.config.dimensions.headerHeight,this.isSubWindow&&O("body").css("visibility","hidden")}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 i=()=>{if(this._components[e]===void 0)throw new Error("Component "+e+" is not registered");delete this._components[e]};return i}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 be))throw new Error("Root must be a ContentItem");var t={settings:Ie({},this.config.settings),dimensions:Ie({},this.config.dimensions),labels:Ie({},this.config.labels),content:[]},i=function o(s,a){for(var l in a.config)l!=="content"&&(s[l]=a.config[l]);if(s.componentName==="lm-react-component"&&(s.type="react-component"),a.contentItems.length){s.content=[];for(var d=0;d<a.contentItems.length;d++)s.content[d]={},o(s.content[d],a.contentItems[d])}};e?i(t,{contentItems:[e]}):i(t,this.root),this._$reconcilePopoutWindows(),t.openPopouts=[];for(var r=0;r<this.openPopouts.length;r++)t.openPopouts.push(this.openPopouts[r].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){O(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 On,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 i=this._reactChildMap.get(e);i===t&&(this._reactChildMap.delete(e),this._reactChildren=[...this._reactChildMap.values()],this.emit("reactChildrenChanged"))}getReactChildren(){return this._reactChildren}enableHeaders(){this.config.settings.hasHeaders=!0,this.config.dimensions.headerHeight=this._initialHeaderHeight,this._findAllStackContainers().forEach(e=>{e._header.show=!0,e.header.element.toggle(!0)}),this.updateSize()}disableHeaders(){this.config.settings.hasHeaders=!1,this.config.dimensions.headerHeight=0,this._findAllStackContainers().forEach(e=>{e._header.show=!1,e.header.element.toggle(!1)}),this.updateSize()}updateSize(e,t){var i,r;if(this.width=(i=e??this.container.width())!==null&&i!==void 0?i:0,this.height=(r=t??this.container.height())!==null&&r!==void 0?r:0,this.isInitialised===!0){if(this.root.callDownwards("setSize",[this.width,this.height]),this._maximisedItem){var o,s;this._maximisedItem.element.width((o=this.container.width())!==null&&o!==void 0?o:0),this._maximisedItem.element.height((s=this.container.height())!==null&&s!==void 0?s:0),this._maximisedItem.callDownwards("setSize")}this._adjustColumnsResponsive()}}destroy(){var e;this.isInitialised===!1||!this.root||(this._onUnload(),O(window).off("resize",this._onResize),O(window).off("unload beforeunload",this._onUnload),O(window).off("blur.lm").off("focus.lm"),O(window).off("keydown",this._windowKeydown),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 i,r;if(typeof e.type!="string")throw new Nt("Missing parameter 'type'",e);if(e.type==="react-component"&&(e.type="component",e.componentName="lm-react-component"),!er.isLayoutItemConfig(e))throw r="Unknown type '"+e.type+"'. Valid types are "+eo.join(","),new Nt(r);return e.type==="component"&&!(t instanceof Ri)&&t&&!(this.isSubWindow===!0&&t instanceof Li)&&(e={type:"stack",width:e.width,height:e.height,content:[e]}),e.id=(i=e.id)!==null&&i!==void 0?i:Gn(),e.type==="stack"?new Ri(this,e,t):e.type==="row"?new yn(!1,this,e,t):e.type==="column"?new yn(!0,this,e,t):new ha(this,e,t)}createPopout(e,t,i,r){var o=[],s=e instanceof be,a=this;if(s){var l;o=this.toConfig(e).content,i=Gn();for(var d=e.parent,h=e;((v=d)===null||v===void 0?void 0:v.contentItems.length)===1&&!d.isRoot;){var v;h=d,d=d.parent}if((l=d)===null||l===void 0||l.addId(i),r==null||Number.isNaN(r)){var m;r=(m=d)===null||m===void 0?void 0:m.contentItems.indexOf(h)}}else e instanceof Array?o=e:o=[e];if(!t&&s){var p,f,g,y=window.screenX||window.screenLeft,S=window.screenY||window.screenTop,_=(p=e.element.offset())!==null&&p!==void 0?p:{left:0,top:0};t={left:y+_.left,top: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&&!s&&(t={left:window.screenX||window.screenLeft+20,top:window.screenY||window.screenTop+20,width:500,height:309}),s&&e.remove(),!(!t||!i||r===void 0)){var C=new sa(o,t,i,r,this);return C.on("initialised",function(){a.emit("windowOpened",C)}),C.on("closed",function(){a._$reconcilePopoutWindows()}),this.openPopouts.push(C),C}}createDragSource(e,t){this.config.settings.constrainDragToContainer=!1;var i=new aa(e,t,this);return this._dragSources.push(i),i}createDragSourceFromEvent(e,t){return this.config.settings.constrainDragToContainer=!1,new la(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,i;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((i=this.container.height())!==null&&i!==void 0?i: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 i=1/0,r=null,o=0;o<this._itemAreas.length;o++){var s=this._itemAreas[o];e>s.x1&&e<s.x2&&t>s.y1&&t<s.y2&&i>s.surface&&(i=s.surface,r=s)}return r}_$createRootItemAreas(){var e=50,t=Ie({},this.root._$getArea()),i=[Ie(Ie({},t),{},{side:"left",x2:t.x1+e}),Ie(Ie({},t),{},{side:"right",x1:t.x2-e}),Ie(Ie({},t),{},{side:"top",y2:t.y1+e}),Ie(Ie({},t),{},{side:"bottom",y1:t.y2-e})];i.forEach(r=>{r.surface=(r.x2-r.x1)*(r.y2-r.y1)}),this._itemAreas.push(...i)}_$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 i=e[t];if(Lt(i)){var r=i._$getArea();if(r!==null)if(r instanceof Array)this._itemAreas=this._itemAreas.concat(r);else{var o;this._itemAreas.push(r);var s=Ie(Ie({},r),(o=r.contentItem._contentAreaDimensions)===null||o===void 0?void 0:o.header.highlightArea);s.surface=(s.x2-s.x1)*(s.y2-s.y1),this._itemAreas.push(s)}}}}_$normalizeContentItem(e,t){if(!e)throw new Error("No content item defined");if(typeof e=="function"&&(e=e()),e instanceof be)return e;if(O.isPlainObject(e)&&e.type){var i=this.createContentItem(e,t??null);return i.callDownwards("_$init"),i}else throw new Error("Invalid contentItem")}_$reconcilePopoutWindows(){for(var e=[],t=0;t<this.openPopouts.length;t++){var i;((i=this.openPopouts[t].getWindow())===null||i===void 0?void 0:i.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=i=>{if(e.push(i),i.contentItems instanceof Array)for(var r=0;r<i.contentItems.length;r++)t(i.contentItems[r])};return t(this.root),e}_bindEvents(){this._isFullPage&&O(window).resize(this._onResize),O(window).on("unload beforeunload",this._onUnload).on("blur.lm",this._windowBlur).on("focus.lm",this._windowFocus).on("keydown",this._windowKeydown)}_windowBlur(){this.root.element.addClass("lm_window_blur")}_windowFocus(){this.root.element.removeClass("lm_window_blur")}_windowKeydown(e){if(e.key==="Escape"&&this._maximisedItem!==null){var t=document.activeElement;if(t&&(t.tagName==="INPUT"||t.tagName==="TEXTAREA"||t.tagName==="SELECT"||t.isContentEditable))return;this._maximisedItem.toggleMaximise()}}_onResize(){clearTimeout(this._resizeTimeoutId),this._resizeTimeoutId=window.setTimeout(this.updateSize.bind(this),100)}_createConfig(e){var t,i=Js("gl-window");i&&(this.isSubWindow=!0,e=JSON.parse(localStorage.getItem(i)||"{}"),e=ji(e),localStorage.removeItem(i)),e=O.extend(!0,{},Xs,e);var r=function o(s){for(var a in s){var l=s[a];a!=="props"&&typeof l=="object"&&l!=null?o(l):a==="type"&&l==="react-component"&&(s.type="component",s.componentName="lm-react-component")}};return r(e),((t=e.settings)===null||t===void 0?void 0:t.hasHeaders)===!1&&(e.dimensions.headerHeight=0),e}_adjustToWindowMode(){var e,t=O('<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=Yi((e=this.config.content[0].title)!==null&&e!==void 0?e:""),O("head").append(O("body link, body style, template, .gl_keep")),this.container=O("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?O(this._originalContainer):O("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,O("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 Nt(t,e);if(e.content.length>1)throw t="Top level content can't contain more then one element.",new Nt(t,e);this.root=new Li(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,i=e*t;if(!(this.width==null||i<=this.width)){this._updatingColumnsResponsive=!0;for(var r=Math.max(Math.floor(this.width/t),1),o=e-r,s=this.root.contentItems[0],a=this._findAllStackContainers()[0],l=0;l<o;l++){var d=s.contentItems[s.contentItems.length-1];this._addChildContentItemsToContainer(a,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(i){e.addChild(i),t.removeChild(i,!0)}):t.contentItems.forEach(i=>{this._addChildContentItemsToContainer(e,i)})}_findAllStackContainers(){var e=[];return this._findAllStackContainersRecursive(e,this.root),e}_findAllStackContainersRecursive(e,t){t.contentItems.forEach(i=>{Lt(i)?e.push(i):i.isComponent||this._findAllStackContainersRecursive(e,i)})}}Z(er,"__lm",zc);const qc="_lm_dragging_k4a5m_1",Xc="_lm_goldenlayout_k4a5m_1",Zc="_lm_header_k4a5m_1",Yc="_lm_controls_k4a5m_1",Qc="_lm_tabpreviousbutton_k4a5m_1",Jc="_lm_tabnextbutton_k4a5m_1",em="_lm_tab_k4a5m_1",tm="_lm_active_k4a5m_1",nm="_lm_close_tab_k4a5m_1",im="_lm_content_k4a5m_1",rm="_lm_dragProxy_k4a5m_1",om="_lm_dropTargetIndicator_k4a5m_1",sm="_march_k4a5m_1",am="_lm_inner_k4a5m_1",lm="_lm_splitter_k4a5m_1",dm="_lm_selectable_k4a5m_1",um="_lm_tabdropdown_list_k4a5m_1",hm="_lm_title_k4a5m_1",cm="_lm_title_before_k4a5m_1",mm="_lm_selected_k4a5m_1",vm="_lm_focusin_k4a5m_1",pm="_lm_window_blur_k4a5m_1",fm="_lm_popout_k4a5m_1",gm="_lm_maximise_k4a5m_1",bm="_lm_tabdropdown_k4a5m_1",ym="_lm_close_k4a5m_1",Cm="_lm_tabdropdown_search_k4a5m_1",wm="_lm_tabs_k4a5m_1",Sm="_lm_keyboard_active_k4a5m_1",_m="_lm_maximised_k4a5m_1",Em="_lm_items_k4a5m_1",to={"tab-height":"28px","drag-border-width":"5px",lm_dragging:qc,lm_goldenlayout:Xc,lm_header:Zc,lm_controls:Yc,lm_tabpreviousbutton:Qc,lm_tabnextbutton:Jc,lm_tab:em,lm_active:tm,lm_close_tab:nm,lm_content:im,lm_dragProxy:rm,lm_dropTargetIndicator:om,march:sm,lm_inner:am,lm_splitter:lm,lm_selectable:dm,lm_tabdropdown_list:um,lm_title:hm,lm_title_before:cm,lm_selected:mm,lm_focusin:vm,lm_window_blur:pm,lm_popout:fm,lm_maximise:gm,lm_tabdropdown:bm,lm_close:ym,lm_tabdropdown_search:Cm,lm_tabs:wm,lm_keyboard_active:Sm,lm_maximised:_m,lm_items:Em},no=Object.freeze({tabHeight:parseInt(to["tab-height"],10),dragBorderWidth:parseInt(to["drag-border-width"],10)});function io(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(n);e&&(i=i.filter(function(r){return Object.getOwnPropertyDescriptor(n,r).enumerable})),t.push.apply(t,i)}return t}function at(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?io(Object(t),!0).forEach(function(i){ma(n,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):io(Object(t)).forEach(function(i){Object.defineProperty(n,i,Object.getOwnPropertyDescriptor(t,i))})}return n}function ma(n,e,t){return(e=Pm(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Pm(n){var e=Tm(n,"string");return typeof e=="symbol"?e:e+""}function Tm(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var yt=R.module("LayoutUtils");function va(n){return n.componentName!==void 0}function Xt(n){var e=n;return(va(n)&&n.componentName==="lm-react-component"||n.type==="react-component")&&e.component!==void 0}function Ln(n){return n.focus!==void 0}function ro(n){return n.type==="stack"}class E{static activateTab(e,t){var i=E.getStackForRoot(e,t,!1);if(!i){yt.error("Could not find stack for config",t);return}var r=E.getContentItemInStack(i,t);r&&i.setActiveContentItem(r)}static isActiveTab(e,t){var i=E.getStackForRoot(e,t,!1);if(!i)return yt.error("Could not find stack for config",t),!1;var r=E.getContentItemInStack(i,t),o=i.getActiveContentItem();return o===r}static addStack(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;if(ua(e)){var i={type:t?"column":"row"};(e.contentItems==null||e.contentItems.length===0)&&e.addChild(i);var r=e.contentItems[0],o=t?r.isColumn:r.isRow;if(!o){e.removeChild(r,!0),e.addChild(i);var s=document.activeElement;e.contentItems[0].addChild(r),s&&s.focus!=null&&s.focus()}return this.addStack(e.contentItems[0],t)}if(e.contentItems.length<2)return e.addChild({type:"stack"}),e.contentItems[e.contentItems.length-1];var a=e.contentItems[e.contentItems.length-1],l=t?a.isRow:a.isColumn;if(!l){var d,h,v=e.layoutManager.createContentItem({type:t?"row":"column",height:(d=a.config)===null||d===void 0?void 0:d.height,width:(h=a.config)===null||h===void 0?void 0:h.width},e);e.replaceChild(a,v),e.contentItems[e.contentItems.length-1].addChild(a),a=e.contentItems[e.contentItems.length-1]}return this.addStack(a,!t)}static getAllStackContainers(e){return e._findAllStackContainers()}static getFocusedStackIndex(e){return e.findIndex(t=>t.header.tabs.some(i=>i.element[0].classList.contains("lm_focusin")))}static getFocusedStack(e){var t=E.getAllStackContainers(e),i=E.getFocusedStackIndex(t);return t[i]}static getStackById(e,t){var i,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;if(r&&Lt(e)&&e.contentItems.length===0)return e;if(t===((i=e.config)===null||i===void 0?void 0:i.id)){if(Lt(e))return e;throw new Error("Item with ID ".concat(t," is not a stack"))}if(e.contentItems==null)return null;for(var o=0;o<e.contentItems.length;o+=1){var s=this.getStackById(e.contentItems[o],t,r);if(s)return s}return null}static getContentItemById(e,t){var i;if(((i=e.config)===null||i===void 0?void 0:i.id)===t)return e;if(e.contentItems==null)return null;for(var r=0;r<e.contentItems.length;r+=1){var o=this.getContentItemById(e.contentItems[r],t);if(o)return o}return null}static getStackForConfig(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;if(i&&Lt(e)&&e.contentItems.length===0)return e;if(e.contentItems==null)return null;for(var r=0;r<e.contentItems.length;r+=1){var o=e.contentItems[r];if(o.isComponent&&o.config!=null&&ur(o.config,t))return e;var s=this.getStackForConfig(o,t,i);if(s)return s}return null}static getStackForRoot(e,t){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,s=this.getStackForConfig(e,t);return!s&&r&&(s=this.getStackForConfig(e,{component:t.component},o)),!s&&i&&(s=this.addStack(e)),s}static getStackForComponentTypes(e,t){for(var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,s=0;s<t.length;s+=1){var a=t[s],l=s===t.length-1,d=E.getStackForRoot(e,{component:a},i&&l,r,o);if(d)return d}return null}static getContentItemInStack(e,t){if(!e)return null;for(var i=0;i<e.contentItems.length;i+=1){var r=e.contentItems[i];if(r.isComponent&&r.config!=null&&ur(r.config,t))return r}return null}static dehydrateLayoutConfig(e,t){if(e==null||!e.length)return[];for(var i=[],r=0;r<e.length;r+=1){var o=e[r],{component:s,content:a}=o;if(s){var l=t(s,o);l!=null?i.push(l):yt.debug2('dehydrateLayoutConfig: skipping unmapped component "'.concat(s,'"'))}else if(a){var d=at(at({},o),{},{content:E.dehydrateLayoutConfig(a,t)});i.push(d)}else i.push(o)}return i}static getTabPoint(e){var{tab:t}=e;if(t==null)throw new Error("Cannot get tab for panel container ".concat(e));var i=t.element[0].getBoundingClientRect();return[i.left+i.width*.5,i.bottom-8]}static dropLayoutMinorChange(e){for(var t=0;t<e.length;t+=1){var i=e[t],{content:r}=i;r!==void 0?(ro(i)&&delete i.activeItemIndex,E.dropLayoutMinorChange(r)):Xt(i)&&i.component==="IrisGridPanel"&&i.props.panelState!=null&&(delete i.id,i.props.panelState.irisGridState.sorts=[],i.props.panelState.irisGridState.quickFilters=[],i.props.panelState.gridState.isStuckToBottom=!1,i.props.panelState.gridState.isStuckToRight=!1)}}static isEqual(e,t){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,r=E.cloneLayout(e),o=E.cloneLayout(t);return i?(E.dropLayoutMinorChange(r),E.dropLayoutMinorChange(o),Ti(r,o)):Ti(r,o)}static cloneLayout(e){return JSON.parse(JSON.stringify(e))}static hydrateLayoutConfig(e,t){if(e==null||!e.length)return[];for(var i=[],r=0;r<e.length;r+=1){var o=e[r];if(Xt(o)){var s,{component:a,props:l={}}=o;i.push(at(at({},o),{},{id:(s=o==null?void 0:o.id)!==null&&s!==void 0?s:vt(),props:t(a,l)}))}else if(o.content!==void 0){var d=E.hydrateLayoutConfig(o.content,t);ro(o)&&o.activeItemIndex!=null&&o.activeItemIndex>=d.length&&(yt.warn("Fixing bad activeItemIndex!",o.activeItemIndex,o),o.activeItemIndex=0),i.push(at(at({},o),{},{content:d}))}else i.push(o)}return i}static openComponent(){var{root:e,config:t,stack:i=void 0,replaceExisting:r=!0,replaceConfig:o=void 0,createNewStack:s=!1,focusElement:a=void 0,dragEvent:l=void 0}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},d=document.activeElement,h=at({},t);if(h.id==null&&(h.id=vt()),l!=null){e==null||e.layoutManager.createDragSourceFromEvent(h,l);return}var v=o||{id:h.id,component:h.component};H(e);var m=i??(s?E.addStack(e):E.getStackForRoot(e,v));H(m);var p=E.getContentItemInStack(m,v);if(a!=null){var f=y=>{yt.debug("Component created, focusing element",a),m.off("componentCreated",f);var{element:S}=y.origin;requestAnimationFrame(()=>{E.focusElement(S[0],a)})};m.on("componentCreated",f)}if(r&&p){var g=m.contentItems.indexOf(p);m.addChild(h,g+1),m.removeChild(p),m.setActiveContentItem(m.contentItems[g])}else m.addChild(h);a==null&&d&&Ln(d)&&d.focus()}static openComponentInStack(e,t){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,r=document.activeElement,o={id:t.id},s=E.getContentItemInStack(e,o);if(i&&s&&e){var a=e==null?void 0:e.contentItems.indexOf(s);e.addChild(t,a+1),e.removeChild(s),e.setActiveContentItem(e.contentItems[a])}else e==null||e.addChild(t);r&&Ln(r)&&r.focus()}static closeComponent(e,t,i){var r=E.getStackForRoot(e,t,!1,!1,!1);if(!r){yt.warn("Cannot find stack for component, ignoring close",t);return}var o=E.getContentItemInStack(r,t),s=document.activeElement;o&&(Re(o)?o.container.close(i):r.removeChild(o)),s&&document.contains(s)&&Ln(s)&&s.focus()}static renameComponent(e,t,i){var r=E.getStackForRoot(e,t,!1);if(!r){yt.error("Could not find stack for config",t);return}var o=E.getContentItemInStack(r,t);o&&o.setTitle(i)}static cloneComponent(e,t){var i=E.getStackForRoot(e,t,!1);if(!i)return yt.error("Could not find stack for config",t),null;var{props:r={}}=t,o=E.getPanelComponentState(t),s={type:"react-component",component:t.component,props:at(at({},r),{},{panelState:o}),title:"".concat(t.title," Copy"),id:vt()};return E.openComponentInStack(i,s),s}static getPanelComponentState(e){if(va(e)){var t;return(t=e.componentState)===null||t===void 0?void 0:t.panelState}if(Xt(e)){var i;return(i=e.props)===null||i===void 0?void 0:i.panelState}return null}static makeDefaultLayout(){return{dimensions:{headerHeight:no.tabHeight,borderWidth:no.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=E.getComponentConfigFromContainer(e);return t?t.id:null}static getIdFromPanel(e){var{glContainer:t}=e.props;return E.getIdFromContainer(t)}static getComponentNameFromPanel(e){var{glContainer:t}=e.props,i=E.getComponentConfigFromContainer(t);if(i&&Xt(i)){var r;return(r=i.component)!==null&&r!==void 0?r:null}return null}static getComponentName(e){var t,i,r=(t=(i=e.WrappedComponent)===null||i===void 0?void 0:i.displayName)!==null&&t!==void 0?t:e.displayName;if(r==null)throw new Error("Component displayName not defined ".concat(e));return r}static focusElement(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:E.DEFAULT_FOCUS_SELECTOR;if(e==null)return null;var i=e.querySelector(t);return i==null?null:(Ln(i)&&i.focus(),i)}static onInitialized(e){return new Promise(t=>{if(e.isInitialised){t();return}var i=()=>{e.off("initialised",i),t()};e.on("initialised",i)})}}ma(E,"DEFAULT_FOCUS_SELECTOR","input, select, textarea, button");var Om=x.forwardRef((n,e)=>{var t=E.getComponentNameFromPanel({props:n});return u.jsx("div",{ref:e,className:"panel-placeholder",children:u.jsxs("div",{children:['Component "',t,'" is not registered.']})})});Om.displayName="PanelPlaceholder";var Y=Object.freeze({FOCUS:"PanelEvent.FOCUS",MOUNT:"PanelEvent.MOUNT",UNMOUNT:"PanelEvent.UNMOUNT",TITLE_CHANGED:"PanelEvent.TITLE_CHANGED",REOPEN:"PanelEvent.REOPEN",REOPEN_LAST:"PanelEvent.REOPEN_LAST",DELETE:"PanelEvent.DELETE",CLONED:"PanelEvent.CLONED",CLOSED:"PanelEvent.CLOSED",OPEN:"PanelEvent.OPEN",CLOSE:"PanelEvent.CLOSE",DRAGGING:"PanelEvent.DRAGGING",DROPPED:"PanelEvent.DROPPED"}),{listen:Yg,emit:xm,useListener:Qg}=It(Y.OPEN),ai=Object.freeze({CYCLE_TO_NEXT_STACK:"NavigationEvent.CYCLE_TO_NEXT_STACK",CYCLE_TO_PREVIOUS_STACK:"NavigationEvent.CYCLE_TO_PREVIOUS_STACK",CYCLE_TO_NEXT_TAB:"NavigationEvent.CYCLE_TO_NEXT_TAB",CYCLE_TO_PREVIOUS_TAB:"NavigationEvent.CYCLE_TO_PREVIOUS_TAB"}),{listen:Im,emit:Jg,useListener:eb}=It(ai.CYCLE_TO_NEXT_STACK),{listen:Dm,emit:tb,useListener:nb}=It(ai.CYCLE_TO_PREVIOUS_STACK),{listen:Mm,emit:ib,useListener:rb}=It(ai.CYCLE_TO_NEXT_TAB),{listen:km,emit:ob,useListener:sb}=It(ai.CYCLE_TO_PREVIOUS_TAB);function oo(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(n);e&&(i=i.filter(function(r){return Object.getOwnPropertyDescriptor(n,r).enumerable})),t.push.apply(t,i)}return t}function so(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?oo(Object(t),!0).forEach(function(i){ht(n,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):oo(Object(t)).forEach(function(i){Object.defineProperty(n,i,Object.getOwnPropertyDescriptor(t,i))})}return n}function ht(n,e,t){return(e=jm(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function jm(n){var e=Nm(n,"string");return typeof e=="symbol"?e:e+""}function Nm(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var Ke=R.module("PanelManager"),_t;(function(n){n[n.Next=0]="Next",n[n.Previous=1]="Previous"})(_t||(_t={}));class pa{constructor(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:(a,l)=>l,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:(a,l)=>l,r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:new Map,o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:[],s=arguments.length>5&&arguments[5]!==void 0?arguments[5]:()=>{};ht(this,"layout",void 0),ht(this,"hydrateComponent",void 0),ht(this,"dehydrateComponent",void 0),ht(this,"onPanelsUpdated",void 0),ht(this,"closed",void 0),ht(this,"openedMap",void 0),ht(this,"navigationEventListenerRemovers",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.handleReopenLast=this.handleReopenLast.bind(this),this.handleCycleToNextStack=this.handleCycleToNextStack.bind(this),this.handleCycleToPreviousStack=this.handleCycleToPreviousStack.bind(this),this.handleCycleToNextTab=this.handleCycleToNextTab.bind(this),this.handleCycleToPreviousTab=this.handleCycleToPreviousTab.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=i,this.onPanelsUpdated=s,this.openedMap=new Map(r),this.closed=[...o],this.navigationEventListenerRemovers=[],this.startListening()}startListening(){var{eventHub:e}=this.layout;e.on(Y.FOCUS,this.handleFocus),e.on(Y.MOUNT,this.handleMount),e.on(Y.UNMOUNT,this.handleUnmount),e.on(Y.REOPEN,this.handleReopen),e.on(Y.REOPEN_LAST,this.handleReopenLast),e.on(Y.DELETE,this.handleDeleted),e.on(Y.CLOSED,this.handleClosed),e.on(Y.CLOSE,this.handleControlClose),this.navigationEventListenerRemovers.push(Im(e,this.handleCycleToNextStack)),this.navigationEventListenerRemovers.push(Dm(e,this.handleCycleToPreviousStack)),this.navigationEventListenerRemovers.push(Mm(e,this.handleCycleToNextTab)),this.navigationEventListenerRemovers.push(km(e,this.handleCycleToPreviousTab))}stopListening(){var{eventHub:e}=this.layout;e.off(Y.FOCUS,this.handleFocus),e.off(Y.MOUNT,this.handleMount),e.off(Y.UNMOUNT,this.handleUnmount),e.off(Y.REOPEN,this.handleReopen),e.off(Y.REOPEN_LAST,this.handleReopenLast),e.off(Y.DELETE,this.handleDeleted),e.off(Y.CLOSED,this.handleClosed),e.off(Y.CLOSE,this.handleControlClose),this.navigationEventListenerRemovers.forEach(t=>t()),this.navigationEventListenerRemovers=[]}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 E.getComponentConfigFromContainer(t)})}getOpenedPanelConfigsOfType(e){return this.getOpenedPanelConfigs().filter(t=>t!=null&&Xt(t)&&t.component===e)}getOpenedPanelById(e){return this.openedMap.get(e)}getContainerByPanelId(e){var t,i=E.getStackForConfig(this.layout.root,{id:e});return(t=i&&E.getContentItemInStack(i,{id:e}))!==null&&t!==void 0?t:null}getLastUsedPanel(e){for(var t=this.getOpenedPanels(),i=t.length-1;i>=0;i-=1){var r=t[i];if(e==null||e(r))return r}}getLastUsedPanelOfType(e){return this.getLastUsedPanelOfTypes([e])}getLastUsedPanelOfTypes(e){return this.getLastUsedPanel(t=>e.some(i=>Vn(i)&&t instanceof i.WrappedComponent||!Vn(i)&&t instanceof i))}updatePanel(e){var t=E.getIdFromPanel(e);if(t==null){Ke.error("updatePanel Panel did not have an ID",e);return}Ke.debug2("Updating panel ID ".concat(t," in open panels map")),this.openedMap.delete(t),this.openedMap.set(t,e)}removePanel(e){var t=E.getIdFromPanel(e);if(t==null){Ke.error("removePanel Panel did not have an ID",e);return}if(!this.openedMap.has(t)){Ke.error("Missing panel ID ".concat(t," in open panels map"));return}if(this.openedMap.get(t)!==e){Ke.debug("Panel argument doesn't match the open panels map entry for ".concat(t,", removePanel ignored"));return}Ke.debug2("Removing panel ID ".concat(t," from open panels map")),this.openedMap.delete(t)}removeClosedPanelConfig(e){var t=this.closed.findIndex(i=>i===e||i.id!=null&&e.id!=null&&i.id===e.id);t>=0&&this.closed.splice(t,1)}handleFocus(e){Ke.debug2("Focus: ",e),this.updatePanel(e)}handleMount(e){Ke.debug2("Mount: ",e),this.updatePanel(e),this.sendUpdate()}handleUnmount(e){Ke.debug2("Unmount: ",e),this.removePanel(e),this.sendUpdate()}cycleStack(e){var t=E.getAllStackContainers(this.layout);if(!(t.length<=1)){var i=E.getFocusedStackIndex(t);if(i===-1){var r=t[0],o=r.config.activeItemIndex,s=o!=null?r.contentItems[o]:r.contentItems[0];r.setActiveContentItem(s,!0);return}var a=e===_t.Next?(i+1)%t.length:(i-1+t.length)%t.length,l=t[a],d=l.config.activeItemIndex,h=d!=null?l.contentItems[d]:l.contentItems[0];l.setActiveContentItem(h,!0)}}handleCycleToNextStack(){this.cycleStack(_t.Next)}handleCycleToPreviousStack(){this.cycleStack(_t.Previous)}cycleTab(e){var t,i=E.getFocusedStack(this.layout);if(i!==void 0){var{contentItems:r}=i;if(!(r.length<=1)){var o=(t=i.config.activeItemIndex)!==null&&t!==void 0?t:0,s=e===_t.Next?(o+1)%r.length:(o-1+r.length)%r.length,a=r[s];i.setActiveContentItem(a,!0)}}}handleCycleToNextTab(){this.cycleTab(_t.Next)}handleCycleToPreviousTab(){this.cycleTab(_t.Previous)}handleReopen(e,t){Ke.debug2("Reopen:",e,t),this.removeClosedPanelConfig(e);var{component:i}=e,{props:r}=e;r=this.hydrateComponent(i,r);var o=so(so({},e),{},{props:r}),{root:s}=this.layout,a=e.parentStackId===void 0?void 0:E.getStackById(s,e.parentStackId);E.openComponent({root:s,config:o,replaceConfig:t,stack:a??void 0})}handleReopenLast(e){var t;if(this.closed.length!==0){if(e===void 0){this.handleReopen(this.closed[this.closed.length-1]);return}for(var i=(t=E.getStackForConfig(this.layout.root,e.getConfig()))===null||t===void 0?void 0:t.config.id,r=this.closed.length-1;r>=0;r-=1){var o=this.closed[r];if(o.parentStackId===i){this.handleReopen(o);return}}}}handleDeleted(e){Ke.debug2("Deleted:",e),this.removeClosedPanelConfig(e),this.sendUpdate()}handleClosed(e,t){Ke.debug2("Closed: ",e),this.addClosedPanel(t),this.sendUpdate()}handleControlClose(e){var t={id:e},{root:i}=this.layout;E.closeComponent(i,t)}addClosedPanel(e){var{root:t}=this.layout,i=E.getComponentConfigFromContainer(e);if(i&&Xt(i)){var r=this.dehydrateComponent(i.component,i);if(r!=null){var o;r.parentStackId=(o=E.getStackForConfig(t,i))===null||o===void 0?void 0:o.config.id,this.closed.push(r)}}}sendUpdate(){var{closed:e,openedMap:t}=this;this.onPanelsUpdated({closed:[...e],openedMap:new Map(t)})}}ht(pa,"MAX_CLOSED_PANEL_COUNT",100);var Am=R.module("PanelErrorBoundary");class Lm extends c.Component{constructor(e){super(e),this.state={error:null}}componentDidCatch(e){this.setState({error:e})}componentWillUnmount(){var{glContainer:e,glEventHub:t}=this.props,i=E.getIdFromContainer(e);Am.debug("componentWillUnmount",i),t.emit(Y.CLOSED,i,e)}render(){var{children:e}=this.props,{error:t}=this.state;return t!=null?u.jsx("div",{className:"panel-error-boundary",children:u.jsx(wn,{"data-testid":"panel-error-boundary-loading-error",errorMessage:"".concat(t),isLoading:!1,isLoaded:!1})}):e??null}}function ao(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(n);e&&(i=i.filter(function(r){return Object.getOwnPropertyDescriptor(n,r).enumerable})),t.push.apply(t,i)}return t}function Xn(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?ao(Object(t),!0).forEach(function(i){Rm(n,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):ao(Object(t)).forEach(function(i){Object.defineProperty(n,i,Object.getOwnPropertyDescriptor(t,i))})}return n}function Rm(n,e,t){return(e=Fm(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Fm(n){var e=$m(n,"string");return typeof e=="symbol"?e:e+""}function $m(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function fa(n){var{props:e,componentState:t}=n,{metadata:i}=e,{panelState:r=null}=e;t&&({panelState:r}=t);var o={};return i!=null&&(o.metadata=i),r!=null&&(o.panelState=r),Xn(Xn({},n),{},{componentState:null,props:o,type:"react-component"})}function ga(n){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";return Xn(Xn({},n),{},{localDashboardId:e})}const ab={dehydrate:fa,hydrate:ga};var ba=x.createContext(void 0);ba.displayName="LayoutManagerContext";var Hm=b.shape({on:b.func,off:b.func,isHidden:b.bool,tab:b.shape({header:b.shape({tabs:b.arrayOf(b.shape({contentItem:b.shape({})}))})}),title:b.string,setTitle:b.func,close:b.func}),ya=b.shape({on:b.func,off:b.func,emit:b.func}),Um=b.shape({registerComponent:b.func,root:b.shape({addChild:b.func}),on:b.func,off:b.func,eventHub:ya}),Bm=Object.freeze({Container:Hm,EventHub:ya,Layout:Um});function zt(n,e,t){c.useEffect(function(){return n.on(e,t),()=>{n.off(e,t)}},[n,e,t])}var Ca="SET_DASHBOARD_DATA";const Km=lh(Ca,{},!1),Wm={dashboardData:Km};var zm=new Map,wa=Object.freeze({}),Vm=Object.freeze([]),lb=fs,db=ps,ub=Ll,Gm=n=>n.dashboardData,we=(n,e)=>{var t;return(t=Gm(n)[e])!==null&&t!==void 0?t:wa},hb=(n,e)=>{var t;return(t=we(n,e).closed)!==null&&t!==void 0?t:Vm},cb=(n,e)=>{var t;return(t=we(n,e).openedMap)!==null&&t!==void 0?t:zm},Sa=(n,e)=>{var t;return(t=we(n,e).pluginDataMap)!==null&&t!==void 0?t:wa},mb=(n,e,t)=>Sa(n,e)[t];function lo(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(n);e&&(i=i.filter(function(r){return Object.getOwnPropertyDescriptor(n,r).enumerable})),t.push.apply(t,i)}return t}function Zt(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?lo(Object(t),!0).forEach(function(i){qm(n,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):lo(Object(t)).forEach(function(i){Object.defineProperty(n,i,Object.getOwnPropertyDescriptor(t,i))})}return n}function qm(n,e,t){return(e=Xm(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Xm(n){var e=Zm(n,"string");return typeof e=="symbol"?e:e+""}function Zm(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var _a=(n,e)=>({type:Ca,id:n,payload:e}),Ym=(n,e)=>(t,i)=>t(_a(n,Zt(Zt({},we(i(),n)),e))),vb=(n,e,t)=>(i,r)=>i(_a(n,Zt(Zt({},we(r(),n)),{},{pluginDataMap:Zt(Zt({},Sa(r(),n)),{},{[e]:t})})));Object.entries(Wm).map(n=>{var[e,t]=n;return ch.register(e,t)});function Qm(n){var{children:e}=n;return u.jsx(u.Fragment,{children:e})}var tr=c.createContext(null);tr.displayName="PanelIdContext";function Jm(){return c.useContext(tr)}function uo(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(n);e&&(i=i.filter(function(r){return Object.getOwnPropertyDescriptor(n,r).enumerable})),t.push.apply(t,i)}return t}function hn(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?uo(Object(t),!0).forEach(function(i){ev(n,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):uo(Object(t)).forEach(function(i){Object.defineProperty(n,i,Object.getOwnPropertyDescriptor(t,i))})}return n}function ev(n,e,t){return(e=tv(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function tv(n){var e=nv(n,"string");return typeof e=="symbol"?e:e+""}function nv(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var Rn=R.module("DashboardLayout"),iv=Object.freeze({}),rv=[],ho=()=>{},ov=1e3,co=n=>n;function sv(n){var e,t,{id:i,children:r,emptyDashboard:o=u.jsx("div",{children:"Dashboard is empty."}),layout:s,layoutConfig:a=rv,onLayoutChange:l=ho,onLayoutInitialized:d=ho,hydrate:h=ga,dehydrate:v=fa,panelWrapper:m=Qm}=n,p=fs(),f=(e=ps(N=>we(N,i)))!==null&&e!==void 0?e:iv,[g,y]=c.useState(!1),[S,_]=c.useState(!1),[C,D]=c.useState(),[W]=c.useState((t=f==null?void 0:f.closed)!==null&&t!==void 0?t:[]),[X,I]=c.useState(s.getReactChildren()),V=c.useMemo(()=>new Map,[]),A=c.useMemo(()=>new Map,[]),J=c.useCallback(function(N,te){var se,ln=arguments.length>2&&arguments[2]!==void 0?arguments[2]:h,gt=arguments.length>3&&arguments[3]!==void 0?arguments[3]:v;Rn.debug2("registerComponent",N,te,ln,gt);function Mn(z,ne){var pe=te,je=m,Mt=Ds(pe),{glContainer:Bt,glEventHub:Ka}=z,Wa=E.getIdFromContainer(Bt);return u.jsx(Lm,{glContainer:Bt,glEventHub:Ka,children:u.jsx(tr.Provider,{value:Wa,children:u.jsx(je,hn(hn({},z),{},{children:Mt?u.jsx(pe,hn(hn({},z),{},{ref:ne})):u.jsx(pe,hn({},z))}))})})}Mn.displayName="DashboardWrapper(".concat((se=te.displayName)!==null&&se!==void 0?se:N,")");var T=s.registerComponent(N,x.forwardRef(Mn));return V.set(N,ln),A.set(N,gt),T},[h,v,V,A,s,m]),ee=c.useCallback((N,te)=>{var se;return((se=V.get(N))!==null&&se!==void 0?se:co)(te,i)},[V,i]),j=c.useCallback((N,te)=>{var se;return((se=A.get(N))!==null&&se!==void 0?se:co)(te,i)},[A,i]),G=c.useMemo(()=>new pa(s,ee,j,new Map,W,N=>{var{closed:te,openedMap:se}=N;p(Ym(i,{closed:te,openedMap:se}))}),[j,p,ee,i,W,s]),F=Id(N=>{var te=C==null||!E.isEqual(C,N);Rn.debug("handleLayoutStateChanged",te,N),te&&(y(s.root.contentItems.length===0),D(N),l(N),I(s.getReactChildren()))},ov,{flushOnUnmount:!0});c.useEffect(()=>()=>F.flush(),[F]);var M=c.useCallback(()=>{if(!S){var N=s.toConfig(),te=N.content,se=E.dehydrateLayoutConfig(te,j);F(se)}},[j,S,s,F]),$=c.useCallback(N=>{var te=E.getIdFromContainer(N);s.eventHub.emit(Y.DRAGGING,te),_(!0)},[s.eventHub]),B=c.useCallback(N=>{var te=E.getIdFromContainer(N);s.eventHub.emit(Y.DROPPED,te),_(!1)},[s.eventHub]),me=c.useCallback(N=>{if(Rn.debug2("handleComponentCreated",N),!(N==null||N.config==null||N.config.component==null||N.element==null)){var te=N.config.component.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),se="".concat(te,"-component");N.element.addClass(se)}},[]),it=c.useCallback(()=>{I(s.getReactChildren())},[s]);zt(s,"stateChanged",M),zt(s,"itemPickedUp",$),zt(s,"itemDropped",B),zt(s,"componentCreated",me),zt(s.eventHub,Y.TITLE_CHANGED,M),zt(s,"reactChildrenChanged",it);var Xe=xd(a);return c.useEffect(function(){if(Xe!==a&&a!==C){Rn.debug("Setting new layout content...");for(var te=E.hydrateLayoutConfig(a,ee);s.root.contentItems.length>0;)s.root.contentItems[0].remove();for(var se=0;se<te.length;se+=1)s.root.addChild(te[se]);y(s.root.contentItems.length===0)}},[ee,s,a,C,G,Xe]),c.useEffect(()=>d(),[]),u.jsxs(u.Fragment,{children:[g&&o,X,x.Children.map(r,N=>N!=null?u.jsx(_u,{fallback:[],children:x.cloneElement(N,{id:i,layout:s,panelManager:G,registerComponent:J})}):null)]})}sv.propTypes={id:b.string.isRequired,children:b.node,data:b.shape({}),emptyDashboard:b.node,layout:Bm.Layout.isRequired,layoutConfig:b.arrayOf(b.shape({})),onLayoutChange:b.func,onLayoutInitialized:b.func};var Ea=c.createContext(null);Ea.displayName="DashboardIdContext";function pb(){var n=c.useContext(Ea);if(n==null)throw new Error("useDashboardId must be used within a DashboardIdContext provider");return n}function av(n,e,t){return(e=lv(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function lv(n){var e=dv(n,"string");return typeof e=="symbol"?e:e+""}function dv(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function Pa(n,e,t){if(n){if(t(n)===!0)return n;for(var i=n.child;i;){var r=Pa(i,e,t);if(r)return r;i=i.sibling}}}function uv(n){try{return Object.defineProperties(n,{_currentRenderer:{get(){return null},set(){}},_currentRenderer2:{get(){return null},set(){}}})}catch{return n}}var nr=uv(c.createContext(null));nr.displayName="FiberContext";class fb extends c.Component{constructor(){super(...arguments),av(this,"_reactInternals",void 0)}render(){var{children:e}=this.props;return u.jsx(nr.Provider,{value:this._reactInternals,children:e})}}function hv(){var n=c.useContext(nr);if(n===null)throw new Error("useFiber must be called within a <FiberProvider />!");var[e]=c.useState(()=>vt()),t=c.useMemo(()=>{for(var i of[n,n==null?void 0:n.alternate].filter(o=>o!=null)){var r=Pa(i,!1,o=>{for(var s=o.memoizedState;s!=null;){if(s.memoizedState===e)return!0;s=s.next}});if(r)return r}},[n,e]);return t}var gb="default",cv="CREATE_DASHBOARD",mv="CLOSE_DASHBOARD",{listen:bb,emit:yb,useListener:Cb}=It(cv),{listen:wb,emit:vv,useListener:Sb}=It(mv);function pv(n,e,t){return(e=fv(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function fv(n){var e=gv(n,"string");return typeof e=="symbol"?e:e+""}function gv(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class Ta extends c.PureComponent{constructor(e){super(e),this.handleCloseTab=this.handleCloseTab.bind(this),this.handleCloseTabsRight=this.handleCloseTabsRight.bind(this),this.handleCloseTabsAll=this.handleCloseTabsAll.bind(this),this.handleReopenLast=this.handleReopenLast.bind(this)}getAllTabs(){var e,t,i,{glContainer:r}=this.props;return[...(e=r==null||(t=r.tab)===null||t===void 0||(i=t.header)===null||i===void 0?void 0:i.tabs)!==null&&e!==void 0?e:[]]}handleCloseTab(){var{glContainer:e}=this.props;e.close()}handleCloseTabsAll(){var e=this.getAllTabs();e.forEach(t=>{var i;return(i=(t==null?void 0:t.contentItem).container)===null||i===void 0?void 0:i.close()})}handleCloseTabsRight(){for(var{glContainer:e}=this.props,t=this.getAllTabs(),i=t.length-1;i>0;i-=1){var r,o,s,a,l,d,h;if(((r=t[i].contentItem)===null||r===void 0||(o=r.config)===null||o===void 0?void 0:o.id)===((s=e.tab)===null||s===void 0||(a=s.contentItem)===null||a===void 0||(l=a.config)===null||l===void 0?void 0:l.id))break;(d=((h=t[i])===null||h===void 0?void 0:h.contentItem).container)===null||d===void 0||d.close()}}handleReopenLast(){var{glContainer:e,glEventHub:t}=this.props;t.emit(Y.REOPEN_LAST,e)}canCloseTabsRight(){for(var{glContainer:e}=this.props,t=this.getAllTabs(),i=!0,r=t.length-1;r>0;r-=1){var o,s,a,l,d,h,v,m;if(((o=t[r].contentItem)===null||o===void 0||(s=o.config)===null||s===void 0?void 0:s.id)===((a=e.tab)===null||a===void 0||(l=a.contentItem)===null||l===void 0||(d=l.config)===null||d===void 0?void 0:d.id))break;var p=!!(!((h=t[r])===null||h===void 0||(v=h.contentItem)===null||v===void 0||(m=v.config)===null||m===void 0)&&m.isClosable);if(p){i=!1;break}}return i}canCloseAny(){for(var e=this.getAllTabs(),t=!0,i=e.length-1;i>0;i-=1){var r,o,s,a=!!(!((r=e[i])===null||r===void 0||(o=r.contentItem)===null||o===void 0||(s=o.config)===null||s===void 0)&&s.isClosable);if(a){t=!1;break}}return t}canReopenLast(){var e,t,{workspace:i,glContainer:r}=this.props,o=(e=E.getStackForConfig(r.layoutManager.root,r.getConfig()))===null||e===void 0?void 0:e.config.id;return!((t=i.data.closed)!==null&&t!==void 0&&t.some(s=>s.parentStackId===o))}render(){var e,t,i,{additionalActions:r,glContainer:o}=this.props,s=[...r];s.push(()=>({title:"Re-open closed panel",group:oe.groups.medium+2004,action:this.handleReopenLast,disabled:this.canReopenLast()}));var a=(e=o.tab)===null||e===void 0||(t=e.contentItem)===null||t===void 0||(i=t.config)===null||i===void 0?void 0:i.isClosable;return s.push({title:"Close",order:10,group:oe.groups.low,action:this.handleCloseTab,disabled:a===void 0||!a}),s.push(()=>({title:"Close Tabs to Right",order:20,group:oe.groups.low,action:this.handleCloseTabsRight,disabled:this.canCloseTabsRight()})),s.push(()=>({title:"Close All",order:30,group:oe.groups.low,action:this.handleCloseTabsAll,disabled:this.canCloseAny()})),u.jsx(oe,{actions:s})}}pv(Ta,"defaultProps",{additionalActions:[]});var bv=n=>({workspace:Bs(n)}),yv=_n(bv,{setWorkspace:Ks})(Ta);function Oa(n,e,t){return(e=Cv(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Cv(n){var e=wv(n,"string");return typeof e=="symbol"?e:e+""}function wv(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class xa extends c.PureComponent{constructor(e){super(e),Oa(this,"renameInputRef",void 0),this.handleRenameDialogOpened=this.handleRenameDialogOpened.bind(this),this.handleRenameInputChange=this.handleRenameInputChange.bind(this),this.handleRenameCancel=this.handleRenameCancel.bind(this),this.handleRenameSubmit=this.handleRenameSubmit.bind(this),this.renameInputRef=x.createRef();var{value:t}=e;this.state={value:t,valueWasValidated:!1}}componentDidUpdate(e){var{isShown:t}=e,{isShown:i}=this.props;i&&!t&&this.resetState()}resetState(){var{value:e}=this.props;this.setState({value:e,valueWasValidated:!1})}handleRenameDialogOpened(){var e,t;(e=this.renameInputRef)===null||e===void 0||(t=e.current)===null||t===void 0||t.focus()}handleRenameInputChange(e){this.setState({value:e.target.value})}handleRenameCancel(){var{onCancel:e}=this.props;e()}handleRenameSubmit(e){e.stopPropagation(),e.preventDefault();var{value:t}=this.state,i=t==null?void 0:t.trim();if(i!==void 0&&i!==""){var{onSubmit:r}=this.props;r(i)}else this.setState({value:i,valueWasValidated:!0})}renderRenameDialog(){var{isShared:e,isOwner:t,itemType:i}=this.props,{value:r,valueWasValidated:o}=this.state;return u.jsxs("form",{className:U("p-3",{"was-validated":o}),onSubmit:this.handleRenameSubmit,noValidate:!0,role:"presentation",onMouseDown:s=>{s.stopPropagation()},onMouseUp:s=>{s.stopPropagation()},children:[u.jsxs("div",{className:"form-group",children:[u.jsxs("label",{htmlFor:"rename-dialog-".concat(i,"-input"),children:["Rename ",i]}),u.jsx("input",{type:"text",className:"form-control",id:"rename-dialog-".concat(i,"-input"),value:r??void 0,ref:this.renameInputRef,onChange:this.handleRenameInputChange,required:!0}),u.jsxs("div",{className:"invalid-feedback",children:[i," name cannot be empty"]}),(e||!t)&&u.jsxs("div",{className:"pt-2",children:["Renaming this ",i," will rename for all users."]})]}),u.jsxs("div",{className:"text-right",children:[u.jsx(Q,{kind:"secondary",className:"mr-2",onClick:this.handleRenameCancel,children:"Cancel"}),u.jsx(Q,{kind:"primary",type:"submit",children:"Rename"})]})]})}render(){var{isShown:e,onCancel:t}=this.props;return u.jsx(Pn,{isShown:e,onEntered:this.handleRenameDialogOpened,onExited:t,options:{placement:"bottom"},interactive:!0,closeOnBlur:!0,children:this.renderRenameDialog()})}}Oa(xa,"defaultProps",{isShared:!1,isOwner:!0,itemType:"Item",value:""});var Fn=Object.freeze({focus:"TabEvent.focus",blur:"TabEvent.blur"});function mo(n,e,t){return(e=Sv(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Sv(n){var e=_v(n,"string");return typeof e=="symbol"?e:e+""}function _v(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var Ev=R.module("Panel");class Pv extends c.PureComponent{constructor(e){super(e),mo(this,"ref",void 0),mo(this,"getAdditionalActions",Yt((i,r,o)=>{var s=[];return r&&s.push(this.getCloneAction()),o&&s.push(this.getRenameAction()),[...s,...i]})),this.handleCopyPanel=this.handleCopyPanel.bind(this),this.handleFocus=this.handleFocus.bind(this),this.handleBlur=this.handleBlur.bind(this),this.handleHide=this.handleHide.bind(this),this.handleResize=this.handleResize.bind(this),this.handleBeforeShow=this.handleBeforeShow.bind(this),this.handleShow=this.handleShow.bind(this),this.handleTabBlur=this.handleTabBlur.bind(this),this.handleTabFocus=this.handleTabFocus.bind(this),this.handleRenameCancel=this.handleRenameCancel.bind(this),this.handleRenameSubmit=this.handleRenameSubmit.bind(this),this.handleShowRenameDialog=this.handleShowRenameDialog.bind(this),this.handleTabClicked=this.handleTabClicked.bind(this),this.handleTab=this.handleTab.bind(this),this.ref=x.createRef();var{glContainer:t}=this.props;this.state={title:E.getTitleFromContainer(t),showRenameDialog:!1,isWithinPanel:!0}}componentDidMount(){var e,t,{componentPanel:i,glContainer:r,glEventHub:o}=this.props;r.on("resize",this.handleResize),r.on("show",this.handleBeforeShow),r.on("shown",this.handleShow),r.on("hide",this.handleHide),r.on("tab",this.handleTab),r.on("tabClicked",this.handleTabClicked),o.on(Fn.focus,this.handleTabFocus),o.on(Fn.blur,this.handleTabBlur),o.emit(Y.MOUNT,i??this),this.setState({isWithinPanel:((e=this.ref.current)===null||e===void 0||(t=e.parentElement)===null||t===void 0?void 0:t.closest(".dh-panel"))!=null})}componentWillUnmount(){var{componentPanel:e,glContainer:t,glEventHub:i}=this.props;t.off("resize",this.handleResize),t.off("show",this.handleBeforeShow),t.off("shown",this.handleShow),t.off("hide",this.handleHide),t.off("tab",this.handleTab),t.off("tabClicked",this.handleTabClicked),i.off(Fn.focus,this.handleTabFocus),i.off(Fn.blur,this.handleTabBlur),i.emit(Y.UNMOUNT,e??this)}handleTab(e){e!=null&&this.setState({title:E.getTitleFromTab(e)}),this.forceUpdate();var{onTab:t}=this.props;t==null||t(e)}handleTabClicked(e){var{onTabClicked:t}=this.props;t==null||t(e)}handleFocus(e){var{componentPanel:t,glEventHub:i}=this.props;i.emit(Y.FOCUS,t??this);var{onFocus:r}=this.props;r==null||r(e)}handleBlur(e){var{onBlur:t}=this.props;t==null||t(e)}handleHide(){for(var{onHide:e}=this.props,t=arguments.length,i=new Array(t),r=0;r<t;r++)i[r]=arguments[r];e==null||e(...i)}handleResize(){for(var{onResize:e}=this.props,t=arguments.length,i=new Array(t),r=0;r<t;r++)i[r]=arguments[r];e==null||e(...i)}handleBeforeShow(){for(var{onBeforeShow:e}=this.props,t=arguments.length,i=new Array(t),r=0;r<t;r++)i[r]=arguments[r];e==null||e(...i)}handleShow(){for(var{onShow:e}=this.props,t=arguments.length,i=new Array(t),r=0;r<t;r++)i[r]=arguments[r];e==null||e(...i)}handleTabBlur(){for(var{onTabBlur:e}=this.props,t=arguments.length,i=new Array(t),r=0;r<t;r++)i[r]=arguments[r];e==null||e(...i)}handleTabFocus(){for(var{onTabFocus:e}=this.props,t=arguments.length,i=new Array(t),r=0;r<t;r++)i[r]=arguments[r];e==null||e(...i)}handleRenameCancel(){this.setState({showRenameDialog:!1})}handleShowRenameDialog(){this.setState({showRenameDialog:!0})}handleRenameSubmit(e){var{glContainer:t}=this.props;this.setState({showRenameDialog:!1,title:e});var i=E.getRootFromContainer(t),r=E.getComponentConfigFromContainer(t);H(r),E.renameComponent(i,r,e)}handleCopyPanel(){var{glContainer:e,glEventHub:t}=this.props,i=E.getRootFromContainer(e),r=E.getComponentConfigFromContainer(e);if(r==null){Ev.error("Could not get component config from container",e);return}var o=E.cloneComponent(i,r);o!==null&&t.emit(Y.CLONED,this,o)}getCloneAction(){return{title:"Copy Panel",order:10,group:oe.groups.high,action:this.handleCopyPanel}}getRenameAction(){return{title:"Rename",order:10,group:oe.groups.medium,action:this.handleShowRenameDialog}}render(){var{children:e,className:t,renderTabTooltip:i,glContainer:r,glEventHub:o,additionalActions:s=Bl,errorMessage:a,isLoaded:l=!0,isLoading:d=!1,isClonable:h=!1,isRenamable:v=!1}=this.props,{tab:m}=r,{showRenameDialog:p,title:f,isWithinPanel:g}=this.state;return u.jsxs("div",{className:U("h-100 w-100 dh-panel",t),onFocusCapture:this.handleFocus,onBlurCapture:this.handleBlur,ref:this.ref,children:[e,u.jsx(wn,{"data-testid":"base-panel-loading",errorMessage:a,isLoaded:l,isLoading:d}),!g&&m!=null&&Bi.createPortal(u.jsxs(u.Fragment,{children:[u.jsx(yv,{glContainer:r,glEventHub:o,additionalActions:this.getAdditionalActions(s,h,v)}),v&&u.jsx(xa,{isShown:p,value:f,itemType:"Panel",onCancel:this.handleRenameCancel,onSubmit:this.handleRenameSubmit}),i!=null&&u.jsx(re,{interactive:!0,options:{placement:"bottom"},popperClassName:"panel-tab-popper",children:i()})]}),m.element[0])]})}}var Tv=Ls(Pv),Ov=R.module("useDhId"),Ci="__dhId";function _b(){var n,e,t=(n=(e=hv())===null||e===void 0?void 0:e.pendingProps)!==null&&n!==void 0?n:{},i=t[Ci],r=Jm();if(i!=null){if(typeof i!="string")throw new Error("useDhId expected prop ".concat(Ci," to be a string, but got ").concat(typeof i));return i}return r??(Ov.warn("useDhId must be used within a PanelIdContext provider if there is no ".concat(Ci," prop. Defaulting to null.")),null)}function Ia(n){var{type:e}=n,t=Au();switch(e){case t.VariableType.TABLE:case t.VariableType.TABLEMAP:case t.VariableType.TREETABLE:case t.VariableType.HIERARCHICALTABLE:case t.VariableType.PARTITIONEDTABLE:return u.jsx(le,{icon:ll});case t.VariableType.FIGURE:return u.jsx(le,{icon:us});case t.VariableType.PANDAS:return u.jsx(le,{icon:al});default:return u.jsx(le,{icon:ls})}}function vo(n,e,t,i,r,o,s){try{var a=n[o](s),l=a.value}catch(d){return void t(d)}a.done?e(l):Promise.resolve(l).then(i,r)}function xv(n){return function(){var e=this,t=arguments;return new Promise(function(i,r){var o=n.apply(e,t);function s(l){vo(o,i,r,s,a,"next",l)}function a(l){vo(o,i,r,s,a,"throw",l)}s(void 0)})}}function Da(n){var{children:e,language:t}=n,[i,r]=c.useState(null),{activeThemes:o}=Ts();return c.useEffect(()=>{var s=!1;function a(){return l.apply(this,arguments)}function l(){return l=xv(function*(){if(e!=null&&o!=null){var d=yield Pe.colorize(e.toString(),t,{});s||r(d)}}),l.apply(this,arguments)}return a(),()=>{s=!0}},[o,e,t]),u.jsx("div",{style:{pointerEvents:"none"},dangerouslySetInnerHTML:i!=null?{__html:i}:void 0})}class Ma{static get LANGUAGE_MAP(){return new Map([["python","Python"],["groovy","Groovy"],["scala","Scala"]])}}class Zn{static hasComment(e){return e.comment!==void 0}static hasPattern(e){return e.pattern!==void 0}static hasOp(e){return e.op!==void 0}static parseArguments(e){return e==null||!(typeof e=="string"||e instanceof String)?[]:Rl.parse(e).filter(t=>!this.hasComment(t)).map(t=>this.hasPattern(t)?t.pattern:this.hasOp(t)?t.op:"".concat(t))}static formatTimestamp(e){if(e==null||!(e instanceof Date))return null;var t="".concat(e.getHours()).padStart(2,"0"),i="".concat(e.getMinutes()).padStart(2,"0"),r="".concat(e.getSeconds()).padStart(2,"0"),o="".concat(e.getMilliseconds()).padStart(3,"0");return"".concat(t,":").concat(i,":").concat(r,".").concat(o)}static isTableType(e,t){return t===e.VariableType.TABLE||t===e.VariableType.TREETABLE||t===e.VariableType.HIERARCHICALTABLE||t===e.VariableType.PARTITIONEDTABLE}static isWidgetType(e,t){return t===e.VariableType.FIGURE||t===e.VariableType.OTHERWIDGET||t===e.VariableType.PANDAS}static isOpenableType(e,t){return Zn.isTableType(e,t)||Zn.isWidgetType(e,t)}static isFigureType(e,t){return t===e.VariableType.FIGURE}static isPandas(e,t){return t===e.VariableType.PANDAS}}function ka(n){var{children:e}=n;return u.jsxs("div",{className:"console-history-item-result",children:[u.jsx("div",{className:"console-history-gutter",children:"-"}),u.jsx("div",{className:"console-history-content",children:e})]})}ka.propTypes={children:b.node.isRequired};function Fi(n,e,t){return(e=Iv(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Iv(n){var e=Dv(n,"string");return typeof e=="symbol"?e:e+""}function Dv(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class ja extends c.Component{constructor(e){super(e),Fi(this,"timer",void 0),Fi(this,"startTime",void 0),this.updateElapsed=this.updateElapsed.bind(this),this.startTime=Date.now(),this.state={elapsed:0}}componentDidMount(){this.timer=window.setInterval(this.updateElapsed,1e3)}componentWillUnmount(){this.timer!=null&&clearInterval(this.timer),this.timer=void 0}updateElapsed(){this.setState({elapsed:Math.round((Date.now()-this.startTime)/1e3)})}render(){var{disabled:e,onCancelClick:t}=this.props,{elapsed:i}=this.state;return u.jsx("div",{className:U("console-history-result-in-progress",{disabled:e}),children:u.jsxs("span",{className:"badge",children:[u.jsx(hs,{className:"ml-2"}),"Running... ",sn.formatElapsedTime(i)," ",u.jsx(Q,{className:"console-history-result-in-progress-cancel",kind:"ghost",icon:dl,tooltip:"Cancel",onClick:t,disabled:e})]})})}}Fi(ja,"defaultProps",{disabled:!1});function gn(n,e,t){return(e=Mv(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Mv(n){var e=kv(n,"string");return typeof e=="symbol"?e:e+""}function kv(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class tn extends c.PureComponent{constructor(e){super(e),gn(this,"mouseX",void 0),gn(this,"mouseY",void 0),gn(this,"isClicking",void 0),this.handleKeyPress=this.handleKeyPress.bind(this),this.handleMouseDown=this.handleMouseDown.bind(this),this.handleMouseMove=this.handleMouseMove.bind(this),this.handleMouseUp=this.handleMouseUp.bind(this),this.handleToggleError=this.handleToggleError.bind(this),this.handleMouseEnter=this.handleMouseEnter.bind(this),this.handleMouseLeave=this.handleMouseLeave.bind(this),this.mouseX=null,this.mouseY=null,this.isClicking=!1,this.state={isExpanded:!1,isTriggerHovered:!1}}handleKeyPress(e){switch(e.key){case"Enter":case" ":this.handleToggleError(),e.stopPropagation(),e.preventDefault();break}}handleMouseDown(e){this.mouseX=e.clientX,this.mouseY=e.clientY,this.isClicking=!0}handleMouseMove(e){this.mouseX!=null&&this.mouseY!=null?(Math.abs(e.clientX-this.mouseX)>=tn.mouseDragThreshold||Math.abs(e.clientY-this.mouseY)>=tn.mouseDragThreshold)&&(this.isClicking=!1):this.isClicking&&(this.isClicking=!1)}handleMouseUp(e){this.isClicking&&!e.shiftKey&&!e.metaKey&&!e.altKey&&this.handleToggleError(),this.mouseX=null,this.mouseY=null,this.isClicking=!1}handleToggleError(){this.setState(e=>({isExpanded:!e.isExpanded}))}handleMouseEnter(){this.setState({isTriggerHovered:!0})}handleMouseLeave(){this.setState({isTriggerHovered:!1})}render(){var{isExpanded:e,isTriggerHovered:t}=this.state,{message:i}=this.props;H(i);var r=i.trimEnd(),o=r.indexOf(`
|
|
3
3
|
`),s=o>-1,a=r;s&&(a=r.slice(0,o));var l=r.slice(o),d=t?"error-btn-link error-btn-link--active":"error-btn-link";return u.jsxs("div",{className:U("error-message",{expanded:e}),children:[s&&u.jsxs(u.Fragment,{children:[u.jsx("div",{className:"error-gutter",children:u.jsx("button",{type:"button",onClick:this.handleToggleError,className:d,tabIndex:-1,children:u.jsx(le,{icon:e?Pi:ul,transform:"left-3"})})}),u.jsxs("div",{className:"error-content",children:[u.jsx("div",{className:"console-error-text-trigger",role:"button",tabIndex:0,onKeyPress:this.handleKeyPress,onMouseDown:this.handleMouseDown,onMouseMove:this.handleMouseMove,onMouseEnter:this.handleMouseEnter,onMouseLeave:this.handleMouseLeave,onMouseUp:this.handleMouseUp,children:a}),e?l:""]})]}),!s&&u.jsx("div",{className:"error-content",children:u.jsx("div",{className:"console-error-text",children:a})})]},"error")}}gn(tn,"defaultProps",{message:""});gn(tn,"mouseDragThreshold",5);function jv(n,e,t){return(e=Nv(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Nv(n){var e=Av(n,"string");return typeof e=="symbol"?e:e+""}function Av(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var po=R.module("ConsoleHistoryItem");class Na extends c.PureComponent{constructor(e){super(e),this.handleCancelClick=this.handleCancelClick.bind(this),this.handleObjectClick=this.handleObjectClick.bind(this)}handleObjectClick(e){po.debug("handleObjectClick",e);var{openObject:t}=this.props;t(e)}handleCancelClick(){var{item:e}=this.props;e!=null&&e.cancelResult&&(po.debug("Cancelling command: ".concat(e.command)),e.cancelResult())}render(){var{disabled:e,item:t,language:i,iconForType:r}=this.props,{disabledObjects:o,result:s}=t,a=t.command!=null&&t.command!=="",l=null;a&&(l=u.jsxs("div",{className:"console-history-item-command",children:[u.jsx("div",{className:"console-history-gutter",children:">"}),u.jsx("div",{className:"console-history-content",children:u.jsx(Da,{language:i,children:t.command})})]}));var d=[],h=!1;if(s){var{error:v,message:m,changes:p}=s;if(p){var{created:f,updated:g}=p;[...f,...g].forEach(X=>{h=!0;var{title:I}=X,V="".concat(I),A=e===void 0||e||(o??[]).indexOf(V)>=0,J=u.jsx(Q,{kind:"primary",onClick:()=>this.handleObjectClick(X),className:"btn-console-object",disabled:A,icon:r(X.type),children:I},V);d.push(J)})}if(v!=null&&!a){var y,S="".concat((y=v.message)!==null&&y!==void 0?y:v);S||(S=v);var _=u.jsx(tn,{message:S},"result-error");d.push(_)}if(m!==void 0&&m!==""){var C=u.jsx("div",{className:"log-message",children:m},"log-message");d.push(C)}}else{h=!0;var D=u.jsx(ja,{onCancelClick:this.handleCancelClick,disabled:e},"in_progress");d.push(D)}var W=null;return d.length>0&&(W=u.jsx(ka,{children:d})),u.jsxs("div",{className:U("console-command-result",{"console-result-buttons":h}),children:[l,W]})}}jv(Na,"defaultProps",{disabled:!1});function Lv(n,e){return"".concat(n,".").concat(e.command,".").concat(e.result&&e.result.message,".").concat(e.result&&e.result.error)}var Rv=x.forwardRef(function(e,t){for(var{disabled:i=!1,items:r,language:o,openObject:s,supportsType:a,iconForType:l}=e,d=[],h=0;h<r.length;h+=1){var v=r[h],m=u.jsx(Na,{disabled:i,item:v,openObject:s,language:o,supportsType:a,iconForType:l},Lv(h,v));d.push(m)}return u.jsx("div",{ref:t,className:"container-fluid console-history",children:d})}),Fv={name:"Console",CLEAR:ie.createAndAdd({id:"CONSOLE.CLEAR",name:"Clear",shortcut:[P.CTRL,w.L],macShortcut:[P.CTRL,w.C]}),FOCUS_HISTORY:ie.createAndAdd({id:"CONSOLE.FOCUS_HISTORY",name:"Focus History",shortcut:[P.CTRL,w.H],macShortcut:[P.CTRL,P.OPTION,w.H]})},$v={name:"Command History",FOCUS_HISTORY:ie.createAndAdd({id:"COMMAND_HISTORY.FOCUS_HISTORY",name:"Focus History Search",shortcut:[P.CTRL,w.H],macShortcut:[P.CTRL,P.OPTION,w.H]}),SEND_TO_CONSOLE:ie.createAndAdd({id:"COMMAND_HISTORY.SEND_TO_CONSOLE",name:"Send to Console",shortcut:[w.ENTER],macShortcut:[w.ENTER]}),SEND_TO_NOTEBOOK:ie.createAndAdd({id:"COMMAND_HISTORY.SEND_TO_NOTEBOOK",name:"Send to Notebook",shortcut:[P.CTRL,w.ENTER],macShortcut:[P.CMD,w.ENTER]}),RUN:ie.createAndAdd({id:"COMMAND_HISTORY.RUN",name:"Run",shortcut:[P.ALT,w.R],macShortcut:[P.OPTION,w.R]})},Hv={name:"Notebook",RUN:ie.createAndAdd({id:"NOTEBOOK.RUN",name:"Run",shortcut:[P.ALT,w.R],macShortcut:[P.OPTION,w.R]}),RUN_SELECTED:ie.createAndAdd({id:"NOTEBOOK.RUN_SELECTED",name:"Run Selected",shortcut:[P.ALT,P.SHIFT,w.R],macShortcut:[P.OPTION,P.SHIFT,w.R]}),FIND:ie.createAndAdd({id:"NOTEBOOK.FIND",name:"Find",shortcut:[P.CTRL,w.F],macShortcut:[P.CMD,w.F],isEditable:!1}),MINIMAP:ie.createAndAdd({id:"NOTEBOOK.MINIMAP",name:"Show Minimap",shortcut:[P.ALT,w.M],macShortcut:[P.OPTION,w.M]}),WORDWRAP:ie.createAndAdd({id:"NOTEBOOK.WORDWRAP",name:"Word Wrap",shortcut:[P.ALT,w.Z],macShortcut:[P.OPTION,w.Z]})},Jt={CONSOLE:Fv,COMMAND_HISTORY:$v,NOTEBOOK:Hv};const ge=Object.freeze({FATAL:"FATAL",STDERR:"STDERR",ERROR:"ERROR",WARN:"WARN",STDOUT:"STDOUT",INFO:"INFO",DEBUG:"DEBUG",TRACE:"TRACE"}),Uv="var(--dh-color-editor-bg)",Bv="var(--dh-color-editor-fg)",Kv="var(--dh-color-editor-string)",Wv="var(--dh-color-editor-delimiter)",zv="var(--dh-color-editor-predefined)",Vv="var(--dh-color-editor-keyword)",Gv="var(--dh-color-editor-storage)",qv="var(--dh-color-editor-number)",Xv="var(--dh-color-editor-operator)",Zv="var(--dh-color-editor-identifier)",Yv="var(--dh-color-editor-comment)",$i={"error-foreground":"var(--dh-color-editor-error-fg)",background:Uv,foreground:Bv,"line-height":"19px",string:Kv,"string-delim":"var(--dh-color-editor-string-delim)",delimiter:Wv,predefined:zv,keyword:Vv,storage:Gv,number:qv,operator:Xv,identifier:Zv,"namespace-identifier":"var(--dh-color-editor-identifier-namespace)","identifier-js":"var(--dh-color-editor-identifier-js)",comment:Yv,"editor-bracket-foreground1":"var(--dh-color-editor-bracket-fg1)","editor-bracket-foreground2":"var(--dh-color-editor-bracket-fg2)","editor-bracket-foreground3":"var(--dh-color-editor-bracket-fg3)","editor-bracket-foreground4":"var(--dh-color-editor-bracket-fg4)","editor-bracket-foreground5":"var(--dh-color-editor-bracket-fg5)","editor-bracket-foreground6":"var(--dh-color-editor-bracket-fg6)","editor-unexpected-bracket-foreground":"var(--dh-color-editor-unexpected-bracket-fg)","input-option-active-border":"var(--dh-color-editor-input-option-active-border)","focus-border":"var(--dh-color-editor-focus-border)","input-background":"var(--dh-color-editor-input-bg)","input-foreground":"var(--dh-color-editor-input-fg)","input-border":"var(--dh-color-editor-input-border)","editor-line-number-foreground":"var(--dh-color-editor-line-number-fg)","editor-line-number-active-foreground":"var(--dh-color-editor-line-number-active-fg)","editor-selection-background":"var(--dh-color-editor-selection-bg)","editor-inactive-selection-background":"var(--dh-color-editor-inactive-selection-bg)","editor-selection-highlight-background":"var(--dh-color-editor-selection-highlight-bg)","editor-line-highlight-background":"var(--dh-color-editor-line-highlight-bg)","editor-word-highlight-background":"var(--dh-color-editor-word-highlight-bg)","context-menu-background":"var(--dh-color-editor-context-menu-bg)","context-menu-foreground":"var(--dh-color-editor-context-menu-fg)","menu-selection-background":"var(--dh-color-editor-menu-selection-bg)","menu-selection-foreground":"var(--dh-color-editor-menu-selection-fg)","log-date":"var(--dh-color-editor-log-date)","log-error":"var(--dh-color-editor-log-error)","log-info":"var(--dh-color-editor-log-info)","log-stdout":"var(--dh-color-editor-log-stdout)","log-warn":"var(--dh-color-editor-log-warn)","log-debug":"var(--dh-color-editor-log-debug)","log-trace":"var(--dh-color-editor-log-trace)","editor-find-match-background":"var(--dh-color-editor-find-match-bg)","editor-find-match-highlight-background":"var(--dh-color-editor-find-match-highlight-bg)","editor-widget-background":"var(--dh-color-editor-find-bg)","input-option-active-background":"var(--dh-color-editor-find-option-active-bg)","input-option-active-foreground":"var(--dh-color-editor-find-option-active-fg)","editor-suggest-widget-background":"var(--dh-color-editor-suggest-bg)","editor-suggest-widget-border":"var(--dh-color-editor-suggest-border)","editor-suggest-widget-foreground":"var(--dh-color-editor-suggest-fg)","editor-suggest-widget-selected-background":"var(--dh-color-editor-suggest-selected-bg)","editor-suggest-widget-selected-foreground":"var(--dh-color-editor-suggest-selected-fg)","editor-suggest-widget-highlightForeground":"var(--dh-color-editor-suggest-highlight-fg)","editor-suggest-widget-focus-highlight-foreground":"var(--dh-color-editor-suggest-focus-highlight-fg)","list-hover-background":"var(--dh-color-editor-suggest-hover-bg)","text-link-foreground":"var(--dh-color-editor-link-foreground)","text-link-active-foreground":"var(--dh-color-editor-link-active-fg)","editor-link-active-foreground":"var(--dh-color-editor-link-active-fg)"};var Qv="python",Jv={comments:{lineComment:"#",blockComment:["'''","'''"]},brackets:[["{","}"],["[","]"],["(",")"]],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"',notIn:["string"]},{open:"'",close:"'",notIn:["string","comment"]}],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"}],onEnterRules:[{beforeText:/^\s*(?:def|class|for|if|elif|else|while|try|with|finally|except|async).*?:\s*$/,action:{indentAction:1}}],folding:{offSide:!0,markers:{start:/^\s*#region\b/,end:/^\s*#endregion\b/}}},ep={keywords:["and","del","from","not","while","as","elif","global","or","with","assert","else","if","pass","yield","break","except","import","print","exec","in","raise","continue","finally","is","return","for","try",":","=","isinstance","__debug__"],storage:["class","def","async","lambda"],operators:["+","-","*","**","/","//","%","<<",">>","&","|","^","~","<",">","<=",">=","==","!=","<>","+=","-=","*=","/","//=","%=","&=","|=","^=",">>=","<<=","**="],brackets:[{open:"{",close:"}",token:"delimiter.curly"},{open:"[",close:"]",token:"delimiter.square"},{open:"(",close:")",token:"delimiter.parenthesis"}],symbols:/[=><!~&|+\-*/^%]+/,delimiters:/[;=.@:,`]/,escapes:/\\(?:[abfnrtv\\"'\n\r]|x[0-9A-Fa-f]{2}|[0-7]{3}|u[0-9A-Fa-f]{4}|U[0-9A-Fa-f]{8}|N\{\w+\})/,rawpre:/(?:[rR]|ur|Ur|uR|UR|br|Br|bR|BR)/,strpre:/(?:[buBU])/,tokenizer:{root:[[/@strpre?("""|''')/,{token:"string.delim",bracket:"@open",next:"@mstring.$1"}],[/@strpre?"([^"\\]|\\.)*$/,"string.invalid"],[/@strpre?'([^'\\]|\\.)*$/,"string.invalid"],[/@strpre?(["])/,{token:"string.delim",bracket:"@open",next:"@sstring.$1",nextEmbedded:"deephavenDb"}],[/@strpre?(["'])/,{token:"string.delim",bracket:"@open",next:"@string.$1"}],[/@rawpre("""|''')/,{token:"string.delim",bracket:"@open",next:"@mrawstring.$1"}],[/@rawpre"([^"\\]|\\.)*$/,"string.invalid"],[/@rawpre'([^'\\]|\\.)*$/,"string.invalid"],[/@rawpre(["'])/,{token:"string.delim",bracket:"@open",next:"@rawstring.$1"}],[/__[\w$]*/,"predefined"],[/[a-z_$][\w$]*/,{cases:{"@keywords":"keyword","@storage":"storage","@default":"identifier"}}],[/[A-Z][\w]*/,{cases:{"~[A-Z0-9_]+":"constructor.identifier","@default":"namespace.identifier"}}],{include:"@whitespace"},[/[{}()[\]]/,"@brackets"],[/@symbols/,{cases:{"@keywords":"keyword","@operators":"operator","@default":""}}],[/\d*\.\d+([eE][-+]?\d+)?/,"number.float"],[/0[xX][0-9a-fA-F]+[lL]?/,"number.hex"],[/0[bB][0-1]+[lL]?/,"number.binary"],[/(0[oO][0-7]+|0[0-7]+)[lL]?/,"number.octal"],[/(0|[1-9]\d*)[lL]?/,"number"],[":",{token:"keyword",bracket:"@open"}],[/@delimiters/,{cases:{"@keywords":"keyword","@default":"delimiter"}}]],comment:[[/[^/*]+/,"comment"],[/\/\*/,"comment","@push"],["\\*/","comment","@pop"],[/[/*]/,"comment"]],mstring:[{include:"@strcontent"},[/"""|'''/,{cases:{"$#==$S2":{token:"string.delim",bracket:"@close",next:"@pop"},"@default":{token:"string"}}}],[/["']/,"string"],[/./,"string.invalid"]],sstring:[{include:"@strcontent"},[/["]/,{token:"string.delim",bracket:"@close",next:"@pop",nextEmbedded:"@pop"}],[/./,"string.invalid"]],string:[{include:"@strcontent"},[/[']/,{token:"string.delim",bracket:"@close",next:"@pop"}],[/./,"string.invalid"]],strcontent:[[/[^\\"']+/,"string"],[/\\$/,"string.escape"],[/@escapes/,"string.escape"],[/\\./,"string.escape.invalid"]],mrawstring:[{include:"@rawstrcontent"},[/"""|'''/,{cases:{"$#==$S2":{token:"string.delim",bracket:"@close",next:"@pop"},"@default":{token:"string"}}}],[/["']/,"string"],[/./,"string.invalid"]],rawstring:[{include:"@rawstrcontent"},[/["']/,{cases:{"$#==$S2":{token:"string.delim",bracket:"@close",next:"@pop"},"@default":{token:"string"}}}],[/./,"string.invalid"]],rawstrcontent:[[/[^\\"']+/,"string"],[/\\["']/,"string"],[/\\u[0-9A-Fa-f]{4}/,"string.escape"],[/\\/,"string"]],whitespace:[[/\s+/,"white"],[/(^#.*$)/,"comment"],[/'''/,"string","@endDocString"],[/"""/,"string","@endDblDocString"]],endDocString:[[/[^']+/,"string"],[/\\'/,"string"],[/'''/,"string","@popall"],[/'/,"string"]],endDblDocString:[[/[^"]+/,"string"],[/\\"/,"string"],[/"""/,"string","@popall"],[/"/,"string"]]}},tp={id:Qv,conf:Jv,language:ep},np="groovy",ip={comments:{lineComment:"//",blockComment:["/*","*/"]},brackets:[["{","}"],["[","]"],["(",")"]],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"',notIn:["string"]},{open:"'",close:"'",notIn:["string","comment"]}],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"}],onEnterRules:[{beforeText:/^\s*(?:def|class|for|if|elif|else|while|try|with|finally|except|async).*?:\s*$/,action:{indentAction:1}}],folding:{offSide:!0,markers:{start:/^\s*#region\b/,end:/^\s*#endregion\b/}}},rp={keywords:["and","del","from","not","while","as","elif","global","or","with","assert","else","if","pass","yield","break","except","import","print","println","class","exec","in","raise","continue","finally","is","return","def","for","lambda","try",":","=","isinstance","__debug__"],operators:["+","-","*","**","/","//","%","<<",">>","&","|","^","~","<",">","<=",">=","==","!=","<>","+=","-=","*=","/","//=","%=","&=","|=","^=",">>=","<<=","**="],brackets:[{open:"{",close:"}",token:"delimiter.curly"},{open:"[",close:"]",token:"delimiter.square"},{open:"(",close:")",token:"delimiter.parenthesis"}],symbols:/[=><!~&|+\-*/^%]+/,delimiters:/[;=.@:,`]/,escapes:/\\(?:[abfnrtv\\"'\n\r]|x[0-9A-Fa-f]{2}|[0-7]{3}|u[0-9A-Fa-f]{4}|U[0-9A-Fa-f]{8}|N\{\w+\})/,rawpre:/(?:[rR]|ur|Ur|uR|UR|br|Br|bR|BR)/,strpre:/(?:[buBU])/,tokenizer:{root:[[/@strpre?("""|''')/,{token:"string.delim",bracket:"@open",next:"@mstring.$1"}],[/@strpre?"([^"\\]|\\.)*$/,"string.invalid"],[/@strpre?'([^'\\]|\\.)*$/,"string.invalid"],[/@strpre?(["])/,{token:"string.delim",bracket:"@open",next:"@sstring.$1",nextEmbedded:"deephavenDb"}],[/@strpre?(["'])/,{token:"string.delim",bracket:"@open",next:"@string.$1"}],[/@rawpre("""|''')/,{token:"string.delim",bracket:"@open",next:"@mrawstring.$1"}],[/@rawpre"([^"\\]|\\.)*$/,"string.invalid"],[/@rawpre'([^'\\]|\\.)*$/,"string.invalid"],[/@rawpre(["'])/,{token:"string.delim",bracket:"@open",next:"@rawstring.$1"}],[/__[\w$]*/,"predefined"],[/[a-z_$][\w$]*/,{cases:{"@keywords":"keyword","@default":"identifier"}}],[/[A-Z][\w]*/,{cases:{"~[A-Z0-9_]+":"constructor.identifier","@default":"namespace.identifier"}}],{include:"@whitespace"},[/[{}()[\]]/,"@brackets"],[/@symbols/,{cases:{"@keywords":"keyword","@operators":"operator","@default":""}}],[/\d*\.\d+([eE][-+]?\d+)?/,"number.float"],[/0[xX][0-9a-fA-F]+[lL]?/,"number.hex"],[/0[bB][0-1]+[lL]?/,"number.binary"],[/(0[oO][0-7]+|0[0-7]+)[lL]?/,"number.octal"],[/(0|[1-9]\d*)[lL]?/,"number"],[":",{token:"keyword",bracket:"@open"}],[/@delimiters/,{cases:{"@keywords":"keyword","@default":"delimiter"}}]],mstring:[{include:"@strcontent"},[/"""|'''/,{cases:{"$#==$S2":{token:"string.delim",bracket:"@close",next:"@pop"},"@default":{token:"string"}}}],[/["']/,"string"],[/./,"string.invalid"]],sstring:[{include:"@strcontent"},[/["]/,{token:"string.delim",bracket:"@close",next:"@pop",nextEmbedded:"@pop"}],[/./,"string.invalid"]],string:[{include:"@strcontent"},[/[']/,{token:"string.delim",bracket:"@close",next:"@pop"}],[/./,"string.invalid"]],strcontent:[[/[^\\"']+/,"string"],[/\\$/,"string.escape"],[/@escapes/,"string.escape"],[/\\./,"string.escape.invalid"]],mrawstring:[{include:"@rawstrcontent"},[/"""|'''/,{cases:{"$#==$S2":{token:"string.delim",bracket:"@close",next:"@pop"},"@default":{token:"string"}}}],[/["']/,"string"],[/./,"string.invalid"]],rawstring:[{include:"@rawstrcontent"},[/["']/,{cases:{"$#==$S2":{token:"string.delim",bracket:"@close",next:"@pop"},"@default":{token:"string"}}}],[/./,"string.invalid"]],rawstrcontent:[[/[^\\"']+/,"string"],[/\\["']/,"string"],[/\\u[0-9A-Fa-f]{4}/,"string.escape"],[/\\/,"string"]],whitespace:[[/[ \t\r\n]+/,""],[/\/\*\*(?!\/)/,"comment.doc","@doccomment"],[/\/\*/,"comment","@comment"],[/\/\/.*$/,"comment"]],comment:[[/[^/*]+/,"comment"],[/\*\//,"comment","@pop"],[/[/*]/,"comment"]],doccomment:[[/[^/*]+/,"comment.doc"],[/\*\//,"comment.doc","@pop"],[/[/*]/,"comment.doc"]]}},op={id:np,conf:ip,language:rp},sp="scala",ap={wordPattern:/(unary_[@~!#%^&*()\-=+\\|:<>/?]+)|([a-zA-Z_$][\w$]*?_=)|(`[^`]+`)|([a-zA-Z_$][\w$]*)/g,comments:{lineComment:"//",blockComment:["/*","*/"]},brackets:[["{","}"],["[","]"],["(",")"]],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"}],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"}],folding:{markers:{start:/^\s*\/\/\s*(?:(?:#?region\b)|(?:<editor-fold\b))/,end:/^\s*\/\/\s*(?:(?:#?endregion\b)|(?:<\/editor-fold>))/}}},lp={keywords:["asInstanceOf","catch","class","classOf","def","do","else","extends","finally","for","foreach","forSome","if","import","isInstanceOf","macro","match","new","object","package","return","throw","trait","try","type","until","val","var","while","with","yield","given","enum","then"],softKeywords:["as","export","extension","end","derives","on"],constants:["true","false","null","this","super"],modifiers:["abstract","final","implicit","lazy","override","private","protected","sealed"],softModifiers:["inline","opaque","open","transparent","using"],name:/(?:[a-z_$][\w$]*|`[^`]+`)/,type:/(?:[A-Z][\w$]*)/,symbols:/[=><!~?:&|+\-*/^\\%@#]+/,digits:/\d+(_+\d+)*/,hexdigits:/[[0-9a-fA-F]+(_+[0-9a-fA-F]+)*/,escapes:/\\(?:[btnfr\\"']|x[0-9A-Fa-f]{1,4}|u[0-9A-Fa-f]{4}|U[0-9A-Fa-f]{8})/,fstring_conv:/[bBhHsScCdoxXeEfgGaAt]|[Tn](?:[HIklMSLNpzZsQ]|[BbhAaCYyjmde]|[RTrDFC])/,tokenizer:{root:[[/\braw"""/,{token:"string.quote",bracket:"@open",next:"@rawstringt"}],[/\braw"/,{token:"string.quote",bracket:"@open",next:"@rawstring"}],[/\bs"""/,{token:"string.quote",bracket:"@open",next:"@sstringt"}],[/\bs"/,{token:"string.quote",bracket:"@open",next:"@sstring"}],[/\bf""""/,{token:"string.quote",bracket:"@open",next:"@fstringt"}],[/\bf"/,{token:"string.quote",bracket:"@open",next:"@fstring"}],[/"""/,{token:"string.quote",bracket:"@open",next:"@stringt"}],[/"/,{token:"string.quote",bracket:"@open",next:"@string"}],[/(@digits)[eE]([-+]?(@digits))?[fFdD]?/,"number.float","@allowMethod"],[/(@digits)\.(@digits)([eE][-+]?(@digits))?[fFdD]?/,"number.float","@allowMethod"],[/0[xX](@hexdigits)[Ll]?/,"number.hex","@allowMethod"],[/(@digits)[fFdD]/,"number.float","@allowMethod"],[/(@digits)[lL]?/,"number","@allowMethod"],[/\b_\*/,"key"],[/\b(_)\b/,"keyword","@allowMethod"],[/\bimport\b/,"keyword","@import"],[/\b(case)([ \t]+)(class)\b/,["keyword.modifier","white","keyword"]],[/\bcase\b/,"keyword","@case"],[/\bva[lr]\b/,"keyword","@vardef"],[/\b(def)([ \t]+)((?:unary_)?@symbols|@name(?:_=)|@name)/,["keyword","white","identifier"]],[/@name(?=[ \t]*:(?!:))/,"variable"],[/(\.)(@name|@symbols)/,[{token:"operator"},{token:"@rematch",next:"@allowMethod"}]],[/([{(])(\s*)(@name(?=\s*=>))/,["@brackets","white","variable"]],[/@name/,{cases:{"@keywords":"keyword","@softKeywords":"keyword","@modifiers":"keyword.modifier","@softModifiers":"keyword.modifier","@constants":{token:"constant",next:"@allowMethod"},"@default":{token:"identifier",next:"@allowMethod"}}}],[/@type/,"type","@allowMethod"],{include:"@whitespace"},[/@[a-zA-Z_$][\w$]*(?:\.[a-zA-Z_$][\w$]*)*/,"annotation"],[/[{(]/,"@brackets"],[/[})]/,"@brackets","@allowMethod"],[/\[/,"operator.square"],[/](?!\s*(?:va[rl]|def|type)\b)/,"operator.square","@allowMethod"],[/]/,"operator.square"],[/([=-]>|<-|>:|<:|:>|<%)(?=[\s\w()[\]{},."'`])/,"keyword"],[/@symbols/,"operator"],[/[;,.]/,"delimiter"],[/'[a-zA-Z$][\w$]*(?!')/,"attribute.name"],[/'[^\\']'/,"string","@allowMethod"],[/(')(@escapes)(')/,[{token:"string"},{token:"string.escape"},{token:"string",next:"@allowMethod"}]],[/'/,"string.invalid"]],import:[[/;/,"delimiter","@pop"],[/^|$/,"","@pop"],[/[ \t]+/,"white"],[/[\n\r]+/,"white","@pop"],[/\/\*/,"comment","@comment"],[/@name|@type/,"type"],[/[(){}]/,"@brackets"],[/[[\]]/,"operator.square"],[/[.,]/,"delimiter"]],allowMethod:[[/^|$/,"","@pop"],[/[ \t]+/,"white"],[/[\n\r]+/,"white","@pop"],[/\/\*/,"comment","@comment"],[/(?==>[\s\w([{])/,"keyword","@pop"],[/(@name|@symbols)(?=[ \t]*[[({"'`]|[ \t]+(?:[+-]?\.?\d|\w))/,{cases:{"@keywords":{token:"keyword",next:"@pop"},"->|<-|>:|<:|<%":{token:"keyword",next:"@pop"},"@default":{token:"@rematch",next:"@pop"}}}],["","","@pop"]],comment:[[/[^/*]+/,"comment"],[/\/\*/,"comment","@push"],[/\*\//,"comment","@pop"],[/[/*]/,"comment"]],case:[[/\b_\*/,"key"],[/\b(_|true|false|null|this|super)\b/,"keyword","@allowMethod"],[/\bif\b|=>/,"keyword","@pop"],[/`[^`]+`/,"identifier","@allowMethod"],[/@name/,"variable","@allowMethod"],[/:::?|\||@(?![a-z_$])/,"keyword"],{include:"@root"}],vardef:[[/\b_\*/,"key"],[/\b(_|true|false|null|this|super)\b/,"keyword"],[/@name/,"variable"],[/:::?|\||@(?![a-z_$])/,"keyword"],[/=|:(?!:)/,"operator","@pop"],[/$/,"white","@pop"],{include:"@root"}],string:[[/[^\\"\n\r]+/,"string"],[/@escapes/,"string.escape"],[/\\./,"string.escape.invalid"],[/"/,{token:"string.quote",bracket:"@close",switchTo:"@allowMethod"}]],stringt:[[/[^\\"\n\r]+/,"string"],[/@escapes/,"string.escape"],[/\\./,"string.escape.invalid"],[/"(?=""")/,"string"],[/"""/,{token:"string.quote",bracket:"@close",switchTo:"@allowMethod"}],[/"/,"string"]],fstring:[[/@escapes/,"string.escape"],[/"/,{token:"string.quote",bracket:"@close",switchTo:"@allowMethod"}],[/\$\$/,"string"],[/(\$)([a-z_]\w*)/,["operator","identifier"]],[/\$\{/,"operator","@interp"],[/%%/,"string"],[/(%)([-#+ 0,(])(\d+|\.\d+|\d+\.\d+)(@fstring_conv)/,["metatag","keyword.modifier","number","metatag"]],[/(%)(\d+|\.\d+|\d+\.\d+)(@fstring_conv)/,["metatag","number","metatag"]],[/(%)([-#+ 0,(])(@fstring_conv)/,["metatag","keyword.modifier","metatag"]],[/(%)(@fstring_conv)/,["metatag","metatag"]],[/./,"string"]],fstringt:[[/@escapes/,"string.escape"],[/"(?=""")/,"string"],[/"""/,{token:"string.quote",bracket:"@close",switchTo:"@allowMethod"}],[/\$\$/,"string"],[/(\$)([a-z_]\w*)/,["operator","identifier"]],[/\$\{/,"operator","@interp"],[/%%/,"string"],[/(%)([-#+ 0,(])(\d+|\.\d+|\d+\.\d+)(@fstring_conv)/,["metatag","keyword.modifier","number","metatag"]],[/(%)(\d+|\.\d+|\d+\.\d+)(@fstring_conv)/,["metatag","number","metatag"]],[/(%)([-#+ 0,(])(@fstring_conv)/,["metatag","keyword.modifier","metatag"]],[/(%)(@fstring_conv)/,["metatag","metatag"]],[/./,"string"]],sstring:[[/@escapes/,"string.escape"],[/"/,{token:"string.quote",bracket:"@close",switchTo:"@allowMethod"}],[/\$\$/,"string"],[/(\$)([a-z_]\w*)/,["operator","identifier"]],[/\$\{/,"operator","@interp"],[/./,"string"]],sstringt:[[/@escapes/,"string.escape"],[/"(?=""")/,"string"],[/"""/,{token:"string.quote",bracket:"@close",switchTo:"@allowMethod"}],[/\$\$/,"string"],[/(\$)([a-z_]\w*)/,["operator","identifier"]],[/\$\{/,"operator","@interp"],[/./,"string"]],interp:[[/{/,"operator","@push"],[/}/,"operator","@pop"],{include:"@root"}],rawstring:[[/[^"]/,"string"],[/"/,{token:"string.quote",bracket:"@close",switchTo:"@allowMethod"}]],rawstringt:[[/[^"]/,"string"],[/"(?=""")/,"string"],[/"""/,{token:"string.quote",bracket:"@close",switchTo:"@allowMethod"}],[/"/,"string"]],whitespace:[[/[ \t\r\n]+/,"white"],[/\/\*/,"comment","@comment"],[/\/\/.*$/,"comment"]]}},dp={id:sp,conf:ap,language:lp},up="deephavenDb",hp={comments:{lineComment:"#",blockComment:["'''","'''"]},brackets:[["{","}"],["[","]"],["(",")"]],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"',notIn:["string"]},{open:"'",close:"'",notIn:["string","comment"]}],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"}],onEnterRules:[{beforeText:/^\s*(?:def|class|for|if|elif|else|while|try|with|finally|except|async).*?:\s*$/,action:{indentAction:1}}],folding:{offSide:!0,markers:{start:/^\s*#region\b/,end:/^\s*#endregion\b/}}},cp={tokenPostfix:".js",keywords:["boolean","break","byte","case","catch","char","class","const","continue","debugger","default","delete","do","double","else","enum","export","extends","false","final","finally","float","for","function","goto","if","implements","import","in","instanceof","int","interface","long","native","new","null","package","private","protected","public","return","short","static","super","switch","synchronized","this","throw","throws","transient","true","try","typeof","var","void","volatile","while","with"],builtins:["define","require","window","document","undefined"],operators:["=",">","<","!","~","?",":","==","<=",">=","!=","&&","||","++","--","+","-","*","/","&","|","^","%","<<",">>",">>>","+=","-=","*=","/=","&=","|=","^=","%=","<<=",">>=",">>>="],brackets:[{open:"{",close:"}",token:"delimiter.curly"},{open:"[",close:"]",token:"delimiter.bracket"},{open:"(",close:")",token:"delimiter.parenthesis"}],symbols:/[~!@#%\^&*-+=|\\:`<>.?\/]+/,escapes:/\\(?:[btnfr\\"']|[0-7][0-7]?|[0-3][0-7]{2})/,exponent:/[eE][\-+]?[0-9]+/,regexpctl:/[(){}\[\]\$\^|\-*+?\.]/,regexpesc:/\\(?:[bBdDfnrstvwWn0\\\/]|@regexpctl|c[A-Z]|x[0-9a-fA-F]{2}|u[0-9a-fA-F]{4})/,tokenizer:{root:[[/([a-zA-Z_\$][\w\$]*)(\s*)(:?)/,{cases:{"$1@keywords":["keyword","white","delimiter"],$3:["key.identifier","white","delimiter"],"$1@builtins":["predefined.identifier","white","delimiter"],"@default":["identifier","white","delimiter"]}}],{include:"@whitespace"},[/\/(?=([^\\\/]|\\.)+\/)/,{token:"regexp.slash",bracket:"@open",next:"@regexp"}],[/[{}()\[\]]/,"@brackets"],[/[;,.]/,"delimiter"],[/@symbols/,{cases:{"@operators":"operator","@default":""}}],[/\d+\.\d*(@exponent)?/,"number.float"],[/\.\d+(@exponent)?/,"number.float"],[/\d+@exponent/,"number.float"],[/0[xX][\da-fA-F]+/,"number.hex"],[/0[0-7]+/,"number.octal"],[/\d+/,"number"],[/"([^"\\]|\\.)*$/,"string.invalid"],[/'([^'\\]|\\.)*$/,"string.invalid"],[/"/,"string",'@string."'],[/'/,"string","@string.'"]],whitespace:[[/[ \t\r\n]+/,"white"],[/\/\*/,"comment","@comment"],[/\/\/.*$/,"comment"]],comment:[[/[^\/*]+/,"comment"],[/\/\*/,"comment.invalid"],["\\*/","comment","@pop"],[/[\/*]/,"comment"]],string:[[/[^\\"']+/,"string"],[/@escapes/,"string.escape"],[/\\./,"string.escape.invalid"],[/["']/,{cases:{"$#==$S2":{token:"string",next:"@pop"},"@default":"string"}}]],regexp:[[/(\{)(\d+(?:,\d*)?)(\})/,["@brackets.regexp.escape.control","regexp.escape.control","@brackets.regexp.escape.control"]],[/(\[)(\^?)(?=(?:[^\]\\\/]|\\.)+)/,[{token:"@brackets.regexp.escape.control"},{token:"regexp.escape.control",next:"@regexrange"}]],[/(\()(\?:|\?=|\?!)/,["@brackets.regexp.escape.control","regexp.escape.control"]],[/[()]/,"@brackets.regexp.escape.control"],[/@regexpctl/,"regexp.escape.control"],[/[^\\\/]/,"regexp"],[/@regexpesc/,"regexp.escape"],[/\\\./,"regexp.invalid"],["/",{token:"regexp.slash",bracket:"@close"},"@pop"]],regexrange:[[/-/,"regexp.escape.control"],[/\^/,"regexp.invalid"],[/@regexpesc/,"regexp.escape"],[/[^\]]/,"regexp"],[/\]/,"@brackets.regexp.escape.control","@pop"]]}},mp={id:up,conf:hp,language:cp},vp="log",pp={},fp={tokenizer:{root:[[/ FATAL[\s\S]*/,{token:"error",next:"@error"}],[/ ERROR[\s\S]*/,{token:"error",next:"@error"}],[/ STDERR[\s\S]*/,{token:"error",next:"@error"}],[/ STDOUT.*/,{token:"stdout",next:"@stdout"}],[/ INFO[\s\S]*/,{token:"info",next:"@info"}],[/ WARN.*/,{token:"warn",next:"@warn"}],[/ TRACE[\s\S]*/,{token:"trace",next:"@trace"}],[/ DEBUG[.\s\S]*/,{token:"debug",next:"@debug"}],[/^\d{2}:\d{2}:\d{2}.\d{3}/,"date"]],error:[{include:"@body"}],info:[{include:"@body"}],warn:[{include:"@body"}],stdout:[{include:"@body"}],trace:[{include:"@body"}],debug:[{include:"@body"}],body:[[/^\d{2}:\d{2}:\d{2}.\d{3}/,{token:"date",next:"@pop"}],[/[\s\S]*/,{token:"$S0"}]]}},gp={id:vp,conf:pp,language:fp},bp={preview:!0,"target-version":"py38","line-length":88,"indent-width":4,format:{"indent-style":"space","quote-style":"double"},lint:{"flake8-implicit-str-concat":{"allow-multiline":!1},ignore:["ISC003"],select:["F","E1","E9","E711","W291","W293","W605","B","A","COM818","ISC","PLE","RUF001","RUF021","RUF027","PLR1704","LOG","ASYNC","RET501","RET502","RET503","PLC2401","PLC2403","NPY","PERF","C4"]}};function fo(n,e,t,i,r,o,s){try{var a=n[o](s),l=a.value}catch(d){return void t(d)}a.done?e(l):Promise.resolve(l).then(i,r)}function yp(n){return function(){var e=this,t=arguments;return new Promise(function(i,r){var o=n.apply(e,t);function s(l){fo(o,i,r,s,a,"next",l)}function a(l){fo(o,i,r,s,a,"throw",l)}s(void 0)})}}function xt(n,e,t){return(e=Cp(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Cp(n){var e=wp(n,"string");return typeof e=="symbol"?e:e+""}function wp(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var We=R.module("MonacoCompletionProvider");class k extends c.PureComponent{static initRuff(){return yp(function*(){if(k.isRuffEnabled)return k.initRuffPromise||(k.initRuffPromise=$l({}).then(()=>{We.debug("Initialized Ruff",hr.version()),k.isRuffInitialized=!0,k.updateRuffWorkspace()})),k.initRuffPromise})()}static updateRuffWorkspace(){if(k.isRuffInitialized){var e=console.log;try{console.log=()=>{},k.ruffWorkspace=new hr(k.ruffSettings)}finally{console.log=e}k.lintAllPython()}}static setRuffSettings(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:k.ruffSettings;if(k.ruffSettings=e,!k.isRuffInitialized){k.initRuff();return}k.updateRuffWorkspace()}static getDiagnostics(e){if(!k.ruffWorkspace)return[];var t=k.ruffWorkspace.check(e.getValue());return Ce.isConsoleModel(e)?t.filter(i=>i.code==null):t}static lintAllPython(){if(!k.isRuffEnabled){Pe.removeAllMarkers("ruff");return}Pe.getModels().filter(e=>e.getLanguageId()==="python").forEach(k.lintPython)}static lintPython(e){if(k.isRuffEnabled&&k.ruffWorkspace){var t=k.getDiagnostics(e);We.debug("Linting Python document: ".concat(e.uri.toString()),t),Pe.setModelMarkers(e,"ruff",t.map(i=>{var r=i.code==="F401"||i.code==="F841",o=i.code==null;return{startLineNumber:i.location.row,startColumn:i.location.column,endLineNumber:i.end_location.row,endColumn:i.end_location.column,message:o?i.message:"".concat(i.code,": ").concat(i.message),severity:o?cr.Error:cr.Warning,tags:r?[Fl.Unnecessary]:[]}}))}}static lspToMonacoKind(e){var t=Ge.CompletionItemKind;switch(e){case 1:return t.Text;case 2:return t.Method;case 3:return t.Function;case 4:return t.Constructor;case 5:return t.Field;case 6:return t.Variable;case 7:return t.Class;case 8:return t.Interface;case 9:return t.Module;case 10:return t.Property;case 11:return t.Unit;case 12:return t.Value;case 13:return t.Enum;case 14:return t.Keyword;case 15:return t.Snippet;case 16:return t.Color;case 17:return t.File;case 18:return t.Reference;case 19:return t.Folder;case 20:return t.EnumMember;case 21:return t.Constant;case 22:return t.Struct;case 23:return t.Event;case 24:return t.Operator;case 25:return t.TypeParameter;default:return t.Variable}}static lspToMonacoRange(e){var{start:t,end:i}=e;return{startLineNumber:t.line+1,startColumn:t.character+1,endLineNumber:i.line+1,endColumn:i.character+1}}static monacoToLspPosition(e){return{line:e.lineNumber-1,character:e.column-1}}static handlePythonCodeActionRequest(e,t){if(!k.isRuffEnabled||!k.ruffWorkspace)return{actions:[],dispose:()=>{}};var i=k.getDiagnostics(e).filter(d=>{var h=new gs(d.location.row,d.location.column,d.end_location.row,d.end_location.column);return d.code!=null&&h.intersectRanges(t)}),r=i.filter(d=>{var{fix:h}=d;return h!=null}).map(d=>{var h="Fix";return d.fix!=null&&(d.fix.message!=null&&d.fix.message!==""?h="".concat(d.code,": ").concat(d.fix.message):h="Fix ".concat(d.code)),{title:h,id:"fix-".concat(d.code),kind:"quickfix",edit:d.fix?{edits:d.fix.edits.map(v=>{var m;return{resource:e.uri,versionId:e.getVersionId(),textEdit:{range:{startLineNumber:v.location.row,startColumn:v.location.column,endLineNumber:v.end_location.row,endColumn:v.end_location.column},text:(m=v.content)!==null&&m!==void 0?m:""}}})}:void 0}}),o=new Set,s=new Set;i.forEach(d=>{d.code!=null&&(o.has(d.code)&&s.add(d.code),o.add(d.code))});var a=i.map(d=>{if(d.code==null)return[];var h=e.getLineContent(d.location.row),v=Pe.tokenize(h,e.getLanguageId())[0].at(-1),m={range:{startLineNumber:d.location.row,startColumn:h.length+1,endLineNumber:d.location.row,endColumn:h.length+1},text:" # noqa: ".concat(d.code)};return v!=null&&v.type.startsWith("comment")&&(m.text="# noqa: ".concat(d.code," "),h.startsWith("# noqa:",v.offset)?(m.range.startColumn=v.offset+1,m.range.endColumn=v.offset+9):(m.range.startColumn=v.offset+1,m.range.endColumn=h.startsWith("# ",v.offset)?v.offset+3:v.offset+2)),[{title:"Disable ".concat(d.code," for ").concat(s.has(d.code)?"line ".concat(d.location.row):"this line"),kind:"quickfix",edit:{edits:[{resource:e.uri,versionId:e.getVersionId(),textEdit:m}]}}]}).flat().filter((d,h,v)=>v.find(m=>m.title===d.title)===d),l=[...o].map(d=>({title:"Disable ".concat(d," for this file"),kind:"quickfix",edit:{edits:[{resource:e.uri,versionId:e.getVersionId(),textEdit:{range:{startLineNumber:1,startColumn:1,endLineNumber:1,endColumn:1},text:"# ruff: noqa: ".concat(d,`
|
|
4
4
|
`)}}]}}));return{actions:[...r,...a,...l],dispose:()=>{}}}static handlePythonFormatRequest(e,t,i){if(k.ruffWorkspace)return We.debug("Formatting Python document: ".concat(e.uri.toString)),[{range:e.getFullModelRange(),text:k.ruffWorkspace.format(e.getValue())}]}constructor(e){super(e),xt(this,"registeredCompletionProvider",void 0),xt(this,"registeredSignatureProvider",void 0),xt(this,"registeredHoverProvider",void 0),this.handleCompletionRequest=this.handleCompletionRequest.bind(this),this.handleSignatureRequest=this.handleSignatureRequest.bind(this),this.handleHoverRequest=this.handleHoverRequest.bind(this)}componentDidMount(){var{language:e,session:t}=this.props;this.registeredCompletionProvider=Ge.registerCompletionItemProvider(e,{provideCompletionItems:this.handleCompletionRequest,triggerCharacters:[".",'"',"'"]}),t.getSignatureHelp!=null&&(this.registeredSignatureProvider=Ge.registerSignatureHelpProvider(e,{provideSignatureHelp:this.handleSignatureRequest,signatureHelpTriggerCharacters:["(",","]})),t.getHover!=null&&(this.registeredHoverProvider=Ge.registerHoverProvider(e,{provideHover:this.handleHoverRequest}))}componentWillUnmount(){var e,t,i;(e=this.registeredCompletionProvider)===null||e===void 0||e.dispose(),(t=this.registeredSignatureProvider)===null||t===void 0||t.dispose(),(i=this.registeredHoverProvider)===null||i===void 0||i.dispose()}handleCompletionRequest(e,t,i){var{model:r,session:o}=this.props;if(e!==r)return null;var s={textDocument:{uri:"".concat(e.uri),version:e.getVersionId()},position:k.monacoToLspPosition(t),context:i},a=o.getCompletionItems(s);We.debug("Requested completion items",s);var l=a.then(d=>{We.debug("Completion items received: ",s,d);var h=d.map(v=>{var{label:m,kind:p,detail:f,documentation:g,sortText:y,filterText:S,textEdit:_,insertTextFormat:C}=v;return{label:m,kind:k.lspToMonacoKind(p),detail:f,documentation:(g==null?void 0:g.kind)==="markdown"?g:g==null?void 0:g.value,sortText:y,filterText:S,insertText:_.text,insertTextRules:C===2?4:C,range:k.lspToMonacoRange(_.range)}});return{incomplete:!0,suggestions:h}}).catch(d=>(We.error("There was an error retrieving completion items",d),{suggestions:[]}));return l}handleSignatureRequest(e,t,i,r){var o={value:{signatures:[],activeSignature:0,activeParameter:0},dispose:()=>{}},{model:s,session:a}=this.props;if(e!==s||a.getSignatureHelp==null)return null;var l={textDocument:{uri:"".concat(e.uri),version:e.getVersionId()},position:k.monacoToLspPosition(t),context:r},d=a.getSignatureHelp(l);We.debug("Requested signature help",l);var h=d.then(v=>{We.debug("Signatures received: ",l,d);var m=v.map(f=>{var{label:g,documentation:y,parameters:S}=f;return{documentation:(y==null?void 0:y.kind)==="markdown"?y:y==null?void 0:y.value,label:g,parameters:S??[]}});if(m.length===0)return o;var p=0;return{value:{signatures:m,activeSignature:p,activeParameter:v[p].activeParameter},dispose:()=>{}}}).catch(v=>(We.error("There was an error retrieving completion items",v),o));return h}handleHoverRequest(e,t){var{model:i,session:r}=this.props;if(e!==i||r.getHover==null)return null;var o={textDocument:{uri:"".concat(e.uri),version:e.getVersionId()},position:k.monacoToLspPosition(t)},s=r.getHover(o);We.debug("Requested hover",o);var a=s.then(l=>{We.debug("Hover received: ",o,l);var{contents:d}=l;return{contents:d!=null?[d]:[]}}).catch(l=>(We.error("There was an error retrieving hover",l),{contents:[]}));return a}render(){return null}}xt(k,"ruffWorkspace",void 0);xt(k,"initRuffPromise",void 0);xt(k,"isRuffInitialized",!1);xt(k,"isRuffEnabled",!0);xt(k,"ruffSettings",bp);function go(n,e,t,i,r,o,s){try{var a=n[o](s),l=a.value}catch(d){return void t(d)}a.done?e(l):Promise.resolve(l).then(i,r)}function Sp(n){return function(){var e=this,t=arguments;return new Promise(function(i,r){var o=n.apply(e,t);function s(l){go(o,i,r,s,a,"next",l)}function a(l){go(o,i,r,s,a,"throw",l)}s(void 0)})}}function bo(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(n);e&&(i=i.filter(function(r){return Object.getOwnPropertyDescriptor(n,r).enumerable})),t.push.apply(t,i)}return t}function yo(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?bo(Object(t),!0).forEach(function(i){_p(n,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):bo(Object(t)).forEach(function(i){Object.defineProperty(n,i,Object.getOwnPropertyDescriptor(t,i))})}return n}function _p(n,e,t){return(e=Ep(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Ep(n){var e=Pp(n,"string");return typeof e=="symbol"?e:e+""}function Pp(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var lt=R.module("MonacoUtils"),Co="inmemory://dh-console/";class Ce{static init(){var{getWorker:e}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};lt.debug("Initializing Monaco..."),e!==void 0&&Ce.registerGetWorker(e);var{initTheme:t,registerLanguages:i}=Ce;t(),i([mp,tp,op,gp,dp]),Ge.onLanguage("python",()=>{Ge.registerCodeActionProvider("python",{provideCodeActions:k.handlePythonCodeActionRequest},{providedCodeActionKinds:["quickfix"]}),Ge.registerDocumentFormattingEditProvider("python",{provideDocumentFormattingEdits:k.handlePythonFormatRequest})}),Pe.onDidCreateModel(r=>{if(r.getLanguageId()==="python"){k.ruffWorkspace!=null&&k.lintPython(r);var o=ei(s=>k.lintPython(s),250);r.onDidChangeContent(()=>{o(r)})}}),Ce.removeConflictingKeybindings(),lt.debug("Monaco initialized.")}static initTheme(){var e,t,{removeHashtag:i}=Ce,r=ds($i);lt.debug2("Monaco theme:",$i),lt.debug2("Monaco theme derived:",r);var o=[{token:"",foreground:i(r.foreground)},{token:"string",foreground:i(r.string)},{token:"string.delim",foreground:i(r["string-delim"])},{token:"keyword",foreground:i(r.keyword)},{token:"identifier.js",foreground:i(r["identifier-js"])},{token:"delimiter",foreground:i(r.delimiter)},{token:"comment",foreground:i(r.comment)},{token:"number",foreground:i(r.number)},{token:"storage",foreground:i(r.storage)},{token:"identifier",foreground:i(r.identifier)},{token:"namespace.identifier",foreground:i(r["namespace-identifier"])},{token:"operator",foreground:i(r.operator)},{token:"predefined",foreground:i(r.predefined)},{token:"error.log",foreground:(e=(t=r["log-error"])===null||t===void 0?void 0:t.substring(1))!==null&&e!==void 0?e:""},{token:"warn.log",foreground:i(r["log-warn"])},{token:"info.log",foreground:i(r["log-info"])},{token:"stdout.log",foreground:i(r["log-stdout"])},{token:"trace.log",foreground:i(r["log-trace"])},{token:"debug.log",foreground:i(r["log-debug"])},{token:"date.log",foreground:i(r["log-date"])}],s={foreground:r.foreground,errorForeground:r["error-foreground"],"inputOption.activeBorder":r["input-option-active-border"],"editor.background":r.background,"editor.foreground":r.foreground,"editor.lineHighlightBackground":r["editor-line-highlight-background"],"editorLineNumber.foreground":r["editor-line-number-foreground"],"editorLineNumber.activeForeground":r["editor-line-number-active-foreground"],"editor.selectionBackground":r["editor-selection-background"],"editor.inactiveSelectionBackground":r["editor-inactive-selection-background"],"editor.selectionHighlightBackground":r["editor-selection-highlight-background"],"editor.wordHighlightBackground":r["editor-word-highlight-background"],"editor.findMatchBackground":r["editor-find-match-background"],"editor.findMatchHighlightBackground":r["editor-find-match-highlight-background"],"editorSuggestWidget.background":r["editor-suggest-widget-background"],"editorSuggestWidget.border":r["editor-suggest-widget-border"],"editorSuggestWidget.foreground":r["editor-suggest-widget-foreground"],"editorSuggestWidget.selectedBackground":r["editor-suggest-widget-selected-background"],"list.activeSelectionBackground":r["editor-suggest-widget-selected-background"],"editorSuggestWidget.selectedForeground":r["editor-suggest-widget-selected-foreground"],"list.activeSelectionForeground":r["editor-suggest-widget-selected-foreground"],"editorSuggestWidget.highlightForeground":r["editor-suggest-widget-highlightForeground"],"editorSuggestWidget.focusHighlightForeground":r["editor-suggest-widget-focus-highlight-foreground"],"list.hoverBackground":r["list-hover-background"],"dropdown.background":r["context-menu-background"],"dropdown.foreground":r["context-menu-foreground"],"menu.selectionBackground":r["menu-selection-background"],"menu.selectionForeground":r["menu-selection-foreground"],"keybindingLabel.foreground":r["menu-selection-foreground"],"list.focusBackground":r["menu-selection-background"],"editorWidget.background":r["editor-widget-background"],"inputOption.activeBackground":r["input-option-active-background"],"inputOption.activeForeground":r["input-option-active-foreground"],focusBorder:r["focus-border"],"input.background":r["input-background"],"input.foreground":r["input-foreground"],"input.border":r["input-border"],"textLink.foreground":r["text-link-foreground"],"textLink.activeForeground":r["text-link-active-foreground"],"editorLink.activeForeground":r["editor-link-active-foreground"],"editorBracketHighlight.foreground1":r["editor-bracket-foreground1"],"editorBracketHighlight.foreground2":r["editor-bracket-foreground2"],"editorBracketHighlight.foreground3":r["editor-bracket-foreground3"],"editorBracketHighlight.foreground4":r["editor-bracket-foreground4"],"editorBracketHighlight.foreground5":r["editor-bracket-foreground5"],"editorBracketHighlight.foreground6":r["editor-bracket-foreground6"],"editorBracketHighlight.unexpectedBracket.foreground":r["editor-unexpected-bracket-foreground"]};Pe.defineTheme("dh-dark",{base:"vs-dark",inherit:!0,rules:o,colors:s});try{Pe.setTheme("dh-dark")}catch(a){lt.error("Failed to set 'dh-dark' Monaco theme, falling back to vs-dark",a),Pe.setTheme("vs-dark")}}static registerGetWorker(e){window.MonacoEnvironment=yo(yo({},window.MonacoEnvironment),{},{getWorker:e})}static removeHashtag(e){var t;return(t=e==null?void 0:e.substring(1))!==null&&t!==void 0?t:""}static registerLanguages(e){var t=e.map(i=>{var{id:r}=i;return r});Ge.getLanguages().filter(i=>{var{id:r}=i;return t.includes(r)}).forEach(i=>{var r=i;lt.debug2("Overriding default language loader:",r.id)}),e.forEach(i=>{Ce.registerLanguage(i)})}static registerLanguage(e){lt.debug2("Registering language: ",e.id),Ge.register(e),Ge.onLanguage(e.id,()=>{Ge.setLanguageConfiguration(e.id,e.conf),Ge.setMonarchTokensProvider(e.id,e.language)})}static setEOL(e){var t,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Pe.EndOfLineSequence.LF;(t=e.getModel())===null||t===void 0||t.setEOL(i)}static openDocument(e,t){var i=e.getModel();H(i);var r={textDocument:{uri:"".concat(i.uri),languageId:i.getLanguageId(),version:i.getVersionId(),text:i.getValue()}};lt.debug2("didOpenDocumentParams: ",r),t.openDocument(r);var o=e.onDidChangeModelContent(s=>{for(var{changes:a,versionId:l}=s,d=[],h=0;h<a.length;h+=1){var v=a[h],{range:m,rangeLength:p,text:f}=v,g={range:{start:{line:m.startLineNumber-1,character:m.startColumn-1},end:{line:m.endLineNumber-1,character:m.endColumn-1}},rangeLength:p,text:f};d.push(g)}if(d.length>0){var y={textDocument:{version:l,uri:"".concat(i.uri)},contentChanges:d};lt.debug2("didChangeDocumentParams",y),t.changeDocument(y)}});return o}static closeDocument(e,t){var i=e.getModel();H(i);var r={textDocument:{uri:"".concat(i.uri)}};t.closeDocument(r)}static registerPasteHandler(e){e.onDidPaste(t=>{var i=/“|”/g,r=/\u200b/g,o=/\u00A0/g,s=e.getModel();H(s);var a=s.getValueInRange(t.range);(i.test(a)||r.test(a)||o.test(a))&&s.applyEdits([{range:t.range,text:a.replace(i,'"').replace(r,"").replace(o," ")}])})}static isMacPlatform(){var{platform:e}=window.navigator;return e.startsWith("Mac")}static removeConflictingKeybindings(){Pe.addKeybindingRule({keybinding:Ve.CtrlCmd|At.KeyD,command:null}),Ce.isMacPlatform()||Pe.addKeybindingRule({keybinding:Ve.CtrlCmd|At.KeyH,command:null})}static disableKeyBindings(e,t){e.addAction({id:"disable-keybindings-".concat(vt()),label:"",keybindings:t,run:()=>{}})}static getMonacoKeyCodeFromShortcut(e){var{keyState:t}=e,{keyValue:i}=t;if(i===null)return 0;var r=Ce.isMacPlatform();return r?(t.metaKey?Ve.CtrlCmd:0)|(t.shiftKey?Ve.Shift:0)|(t.altKey?Ve.Alt:0)|(t.ctrlKey?Ve.WinCtrl:0)|mr.fromString(i):(t.ctrlKey?Ve.CtrlCmd:0)|(t.shiftKey?Ve.Shift:0)|(t.altKey?Ve.Alt:0)|(t.metaKey?Ve.WinCtrl:0)|mr.fromString(i)}static provideLinks(e){for(var t=[],i=function(s){var a=e.getLineContent(s),l=Ul(a),d=l.filter(h=>h.type==="url"?/^https?:\/\//.test(h.value):!0);d.forEach(h=>{t.push({url:h.href,range:new gs(s,h.start+1,s,h.end+1)})})},r=1;r<=e.getLineCount();r+=1)i(r);return{links:t}}static generateConsoleUri(){return Hl.parse("".concat(Co).concat(vt()))}static isConsoleModel(e){return e.uri.toString().startsWith(Co)}static canFormat(e){var t;return((t=e.getAction("editor.action.formatDocument"))===null||t===void 0?void 0:t.isSupported())===!0}static formatDocument(e){return Sp(function*(){var t;yield(t=e.getAction("editor.action.formatDocument"))===null||t===void 0?void 0:t.run()})()}}function wo(n,e,t,i,r,o,s){try{var a=n[o](s),l=a.value}catch(d){return void t(d)}a.done?e(l):Promise.resolve(l).then(i,r)}function Tp(n){return function(){var e=this,t=arguments;return new Promise(function(i,r){var o=n.apply(e,t);function s(l){wo(o,i,r,s,a,"next",l)}function a(l){wo(o,i,r,s,a,"throw",l)}s(void 0)})}}function Le(n,e,t){return(e=Op(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Op(n){var e=xp(n,"string");return typeof e=="symbol"?e:e+""}function xp(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var wi=R.module("ConsoleInput"),Yn=parseInt($i["line-height"],10),Aa=6,La=6,Ip=Yn+Aa+La,Si=100;class nn extends c.PureComponent{constructor(e){super(e),Le(this,"cancelListener",void 0),Le(this,"resizeObserver",void 0),Le(this,"commandContainer",void 0),Le(this,"commandEditor",void 0),Le(this,"commandHistoryIndex",void 0),Le(this,"commandSuggestionContainer",void 0),Le(this,"loadingPromise",void 0),Le(this,"timestamp",void 0),Le(this,"bufferIndex",void 0),Le(this,"history",void 0),Le(this,"modifiedCommands",void 0),this.handleResize=this.handleResize.bind(this),this.commandContainer=x.createRef(),this.commandHistoryIndex=null,this.timestamp=Date.now(),this.bufferIndex=0,this.history=[],this.modifiedCommands=new Map,this.resizeObserver=new window.ResizeObserver(this.handleResize),this.state={commandEditorHeight:Yn,isFocused:!1,model:null}}componentDidMount(){this.initCommandEditor(),this.loadMoreHistory()}componentDidUpdate(){this.layoutEditor()}componentWillUnmount(){this.resizeObserver.disconnect(),this.loadingPromise!=null&&this.loadingPromise.cancel(),this.destroyCommandEditor()}setConsoleText(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;if(e){if(wi.debug("Command received: ",e),!i){var r;this.commandHistoryIndex=null,(r=this.commandEditor)===null||r===void 0||r.setValue(e)}t&&this.focusEnd(),this.updateDimensions(),i&&this.processCommand(e)}}initCommandEditor(){var{language:e,session:t}=this.props,i=Pe.createModel("",e,Ce.generateConsoleUri()),r={copyWithSyntaxHighlighting:!1,cursorStyle:"block",fixedOverflowWidgets:!0,folding:!1,fontFamily:"Fira Mono",glyphMargin:!1,language:e,lineHeight:Yn,lineDecorationsWidth:3,lineNumbers:"off",minimap:{enabled:!1},renderLineHighlight:"none",scrollBeyondLastLine:!1,scrollbar:{arrowSize:0,horizontal:"hidden",horizontalScrollbarSize:0},padding:{top:Aa,bottom:La},value:"",wordWrap:"on",autoClosingBrackets:"beforeWhitespace",model:i},o=this.commandContainer.current;H(o),this.commandEditor=Pe.create(o,r),Ce.setEOL(this.commandEditor),Ce.openDocument(this.commandEditor,t),this.commandEditor.onDidChangeModelContent(()=>{var s,a=(s=this.commandEditor)===null||s===void 0?void 0:s.getValue();this.modifiedCommands.set(this.commandHistoryIndex,a??null),this.updateDimensions()}),this.commandEditor.onDidFocusEditorText(()=>{this.setState({isFocused:!0})}),this.commandEditor.onDidBlurEditorText(()=>{this.setState({isFocused:!1})}),this.commandEditor.onKeyDown(s=>{var{commandEditor:a,commandHistoryIndex:l}=this,d=a==null?void 0:a.getPosition();H(d);var{lineNumber:h}=d;if(!s.altKey&&!s.shiftKey&&!s.metaKey){if(s.code==="ArrowUp"&&!this.isSuggestionMenuPopulated()&&h===1){l!=null?this.loadCommand(l+1):this.loadCommand(0),this.focusStart(),s.stopPropagation(),s.preventDefault();return}if(s.code==="ArrowDown"&&!this.isSuggestionMenuPopulated()&&h===(i==null?void 0:i.getLineCount())){l!=null&&l>0?this.loadCommand(l-1):this.loadCommand(null),this.focusEnd(),s.stopPropagation(),s.preventDefault();return}if(s.keyCode===At.Enter&&!this.isSuggestionMenuPopulated()){var v;s.stopPropagation(),s.preventDefault();var m=(v=this.commandEditor)===null||v===void 0?void 0:v.getValue().trim();if(m!==void 0){var p;this.processCommand(m),(p=this.commandEditor)===null||p===void 0||p.setValue("")}}}}),Ce.disableKeyBindings(this.commandEditor,[Ve.CtrlCmd|At.KeyF]),Ce.registerPasteHandler(this.commandEditor),this.commandEditor.focus(),this.resizeObserver.observe(o),this.updateDimensions(),this.setState({model:this.commandEditor.getModel()})}destroyCommandEditor(){var{session:e}=this.props;this.commandEditor&&(Ce.closeDocument(this.commandEditor,e),this.commandEditor.dispose(),this.commandEditor=void 0)}handleResize(){this.updateDimensions()}isSuggestionMenuActive(){var e;if(!this.commandSuggestionContainer){var t,i;this.commandSuggestionContainer=(t=this.commandEditor)===null||t===void 0||(i=t.getDomNode())===null||i===void 0?void 0:i.querySelector(".suggest-widget")}return(e=this.commandSuggestionContainer&&this.commandSuggestionContainer.classList.contains("visible"))!==null&&e!==void 0?e:!1}isSuggestionMenuPopulated(){var e,t,i;return this.isSuggestionMenuActive()&&((e=(t=this.commandSuggestionContainer)===null||t===void 0||(i=t.querySelector(".monaco-list-rows"))===null||i===void 0?void 0:i.childElementCount)!==null&&e!==void 0?e:0)>0}focus(){var e;(e=this.commandEditor)===null||e===void 0||e.focus()}focusStart(){var e,t,i,r,o,s=(e=this.commandEditor)===null||e===void 0?void 0:e.getModel();H(s);var a=s.getLineLength(1)+1,l=(t=this.commandEditor)===null||t===void 0?void 0:t.getTopForPosition(1,a);H(l),(i=this.commandEditor)===null||i===void 0||i.setPosition({lineNumber:1,column:a}),(r=this.commandEditor)===null||r===void 0||r.setScrollTop(l),(o=this.commandEditor)===null||o===void 0||o.focus()}focusEnd(){var e,t,i,r,o,s=(e=this.commandEditor)===null||e===void 0?void 0:e.getModel();H(s);var a=s.getLineCount(),l=s.getLineLength(a)+1,d=(t=this.commandEditor)===null||t===void 0?void 0:t.getTopForPosition(a,l);H(d),(i=this.commandEditor)===null||i===void 0||i.setPosition({lineNumber:a,column:l}),(r=this.commandEditor)===null||r===void 0||r.setScrollTop(d),(o=this.commandEditor)===null||o===void 0||o.focus()}clear(){var e,t,i;(e=this.commandEditor)===null||e===void 0||e.focus(),(t=this.commandEditor)===null||t===void 0||(i=t.getModel())===null||i===void 0||i.setValue(""),this.commandHistoryIndex=null}layoutEditor(){this.commandEditor&&this.commandEditor.layout()}loadCommand(e){var t,i;if(!(e!==null&&e>=this.history.length)){var r=this.modifiedCommands.get(e),o=e===null?"":this.history[this.history.length-e-1];this.commandHistoryIndex=e,(t=this.commandEditor)===null||t===void 0||(i=t.getModel())===null||i===void 0||i.setValue(r??o),e!==null&&e>this.history.length-Si&&this.loadMoreHistory()}}loadMoreHistory(){var e=this;return Tp(function*(){try{if(e.loadingPromise!=null||e.bufferIndex==null)return;var{commandHistoryStorage:t,language:i,scope:r}=e.props;e.loadingPromise=Ue.makeCancelable(t.getTable(i,r??"",e.timestamp),a=>a.close());var o=yield e.loadingPromise;o.setReversed(!0),o.setViewport({top:e.bufferIndex,bottom:e.bufferIndex+Si-1}),e.loadingPromise=Ue.makeCancelable(o.getViewportData(),()=>o.close());var s=yield e.loadingPromise;e.bufferIndex+=Si,e.bufferIndex>=o.size&&(e.bufferIndex=null),e.history=[...s.items.filter((a,l,d)=>{var{name:h}=a;return l===0||h!==d[l-1].name}).map(a=>{var{name:l}=a;return l}).reverse(),...e.history],e.loadingPromise=void 0,o.close()}catch(a){if(e.loadingPromise=void 0,Ue.isCanceled(a)){wi.debug2("Promise canceled, not loading history");return}wi.error("Error fetching history",a)}})()}processCommand(e){this.commandHistoryIndex=null,this.modifiedCommands.clear(),H(e),e!==""&&(this.history.length===0||e!==this.history[this.history.length-1])&&this.history.push(e),this.updateDimensions();var{onSubmit:t}=this.props;t(e)}updateDimensions(){if(this.commandEditor){var{maxHeight:e}=this.props;H(e);var t=this.commandEditor.getContentHeight(),i=Math.max(Math.min(t,e),Ip),r=t>i,o={overviewRulerLanes:r?void 0:0};this.setState({commandEditorHeight:i},()=>{var s,a;(s=this.commandEditor)===null||s===void 0||s.updateOptions(o),(a=this.commandEditor)===null||a===void 0||a.layout()})}}render(){var{disabled:e,language:t,session:i}=this.props,{commandEditorHeight:r,isFocused:o,model:s}=this.state;return u.jsx("div",{className:U("console-input-wrapper",{disabled:e}),children:u.jsxs("div",{className:U("console-input-inner-wrapper",{focus:o}),children:[u.jsx("div",{className:nn.INPUT_CLASS_NAME,ref:this.commandContainer,style:{height:r}}),s&&u.jsx(k,{model:s,language:t,session:i})]})})}}Le(nn,"defaultProps",{maxHeight:Yn*10,scope:null,disabled:!1});Le(nn,"INPUT_CLASS_NAME","console-input");function Pt(n,e,t){return(e=Dp(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Dp(n){var e=Mp(n,"string");return typeof e=="symbol"?e:e+""}function Mp(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var So="pasted values",kp=[/^audio.*/,/^font.*/,/^image.*/,/^video.*/],_i=[".csv",".tsv",".tab",".psv",".dsv",".txt"],_o=[".zip"];class Te extends c.Component{static isValidDropItem(e){return e!=null&&e.kind==="file"&&!kp.find(t=>t.test(e.type))}static isValidExtension(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return _i.some(i=>e.endsWith(i))||t&&_o.some(i=>e.endsWith(i))}static handleDragOver(e){e.preventDefault(),e.stopPropagation()}static getIcon(e){return e===So?ar:e.endsWith(".csv")?hl:e.endsWith(".zip")?cl:ml}constructor(e){super(e),Pt(this,"fileElem",void 0),Pt(this,"divElem",void 0),Pt(this,"getValidExtensions",Yt(t=>t?[..._i,..._o]:[..._i])),Pt(this,"getAcceptString",Yt(t=>this.getValidExtensions(t).join(", "))),Pt(this,"getFileTypeErrorString",Yt(t=>bd.join(this.getValidExtensions(t),"or"))),this.handleSelectFile=this.handleSelectFile.bind(this),this.handleFiles=this.handleFiles.bind(this),this.handleDrop=this.handleDrop.bind(this),this.unstageFile=this.unstageFile.bind(this),this.handleMenuPaste=this.handleMenuPaste.bind(this),this.handlePasteEvent=this.handlePasteEvent.bind(this),this.fileElem=x.createRef(),this.divElem=x.createRef(),this.state={selectedFileName:""}}componentDidMount(){var e,t;(e=this.divElem.current)===null||e===void 0||e.addEventListener("paste",this.handlePasteEvent),(t=this.divElem.current)===null||t===void 0||t.focus()}componentWillUnmount(){var e;(e=this.divElem.current)===null||e===void 0||e.removeEventListener("paste",this.handlePasteEvent)}handleSelectFile(){if(this.fileElem.current){var e;this.fileElem.current.value="",(e=this.fileElem.current)===null||e===void 0||e.click()}}handleFiles(e){e.stopPropagation(),e.preventDefault();var{files:t}=e.target;t!=null&&this.handleFile(t[0])}handleDrop(e){var{allowZip:t,clearDragError:i,dragError:r}=this.props;if(e.preventDefault(),e.stopPropagation(),r!=null){i();return}if(!(e.dataTransfer==null||e.dataTransfer.items==null||e.dataTransfer.items.length===0)){var o=e.dataTransfer.items[0].getAsFile();H(o),Te.isValidExtension(o.name,t)?this.handleFile(o):this.setState({dropError:Te.FILE_TYPE_ERROR})}}unstageFile(e){var{onCancel:t}=this.props;e.stopPropagation(),e.preventDefault(),t(),this.setState({selectedFileName:"",dropError:void 0})}handleFile(e){var{onFileOpened:t}=this.props;t(e),this.setState({selectedFileName:e.name,dropError:void 0})}handleMenuPaste(){var{onPaste:e,onError:t,uploadInProgress:i}=this.props;i||navigator.clipboard.readText().then(r=>{e(r),this.setState({selectedFileName:So,dropError:void 0})}).catch(r=>t(r))}handlePasteEvent(e){e.stopPropagation(),e.preventDefault(),this.handleMenuPaste()}makeContextMenuItems(){var{uploadInProgress:e}=this.props;return[{title:"Paste",icon:ar,action:this.handleMenuPaste,shortcut:qt.PASTE,disabled:e}]}render(){var{allowZip:e,dragError:t,uploadInProgress:i}=this.props,{selectedFileName:r,dropError:o}=this.state,s=t??o,a=this.makeContextMenuItems();return u.jsxs("div",{ref:this.divElem,className:"csv-overlay fill-parent-absolute",onDragOver:Te.handleDragOver,onDrop:this.handleDrop,tabIndex:-1,children:[u.jsx(oe,{actions:a}),u.jsx("input",{ref:this.fileElem,type:"file",id:"fileElem",accept:this.getAcceptString(e),style:{display:"none"},onChange:this.handleFiles,"data-testid":"fileElem"}),!r&&(s===void 0||s==="")&&u.jsxs("div",{className:"message-content",children:[u.jsx("div",{className:"message-icon",children:u.jsx(le,{icon:vl})}),u.jsx("label",{children:"Drop file (or paste values) here to import"}),u.jsx("div",{className:"message-small",children:u.jsx("label",{children:"or"})}),u.jsx(Q,{kind:"primary",onClick:this.handleSelectFile,children:"Select File..."})]}),r&&(s===void 0||s==="")&&u.jsxs("div",{className:"selected-content",children:[u.jsx("div",{className:"selected-icon",children:u.jsx(le,{icon:Te.getIcon(r)})}),u.jsxs("div",{className:"selected-text",children:[u.jsx("label",{children:"Selected File"}),u.jsxs("label",{className:"selected-name",children:[r,!i&&u.jsx(Q,{kind:"ghost",className:"ml-2",onClick:this.unstageFile,icon:pl,tooltip:"Remove"})]})]})]}),!!s&&u.jsxs("div",{className:"message-content",children:[u.jsx("div",{className:"message-icon",children:u.jsx(le,{icon:cs})}),u.jsx("label",{children:s}),s===Te.FILE_TYPE_ERROR&&u.jsx("div",{className:"message-small",children:u.jsx("label",{children:this.getFileTypeErrorString(e)})})]})]})}}Pt(Te,"defaultProps",{allowZip:!1,dragError:null});Pt(Te,"MULTIPLE_FILE_ERROR","Please select only one file");Pt(Te,"FILE_TYPE_ERROR","Filetype not supported.");function Ra(n,e){var t=n.internalStream("string");return t.readable=!0,t.read=()=>!1,t.removeListener=()=>!1,t.on("data",(i,r)=>e(r)),t}function Eo(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(n);e&&(i=i.filter(function(r){return Object.getOwnPropertyDescriptor(n,r).enumerable})),t.push.apply(t,i)}return t}function Po(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Eo(Object(t),!0).forEach(function(i){_e(n,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Eo(Object(t)).forEach(function(i){Object.defineProperty(n,i,Object.getOwnPropertyDescriptor(t,i))})}return n}function _e(n,e,t){return(e=jp(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function jp(n){var e=Np(n,"string");return typeof e=="symbol"?e:e+""}function Np(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var To="unknown",Ap=2147483647,Lp=-2147483648,Oo=/^[0-9]{4}-[0-1][0-9]-[0-3][0-9][ T][0-2][0-9]:[0-5][0-9]:[0-6][0-9](?:\.[0-9]{1,9})?(?: [a-zA-Z]+)?$/,xo=/^([0-9]+T)?([0-9]+):([0-9]+)(:[0-9]+)?(?:\.[0-9]{1,9})?$/;class ye{static determineType(e,t,i){if(!e||e===i)return t;switch(t){case K.STRING:return K.STRING;case K.INTEGER:return ye.checkInteger(e);case K.LONG:return ye.checkLong(e);case K.DOUBLE:return ye.checkDouble(e);case K.BOOLEAN:return ye.checkBoolean(e);case K.DATE_TIME:return ye.checkDateTime(e);case K.LOCAL_TIME:return ye.checkLocalTime(e);default:return ye.getTypeFromUnknown(e)}}static isNotParsableNumber(e){return isNaN(e)||e==="Infinity"||e==="-Infinity"}static checkInteger(e){var t=e.replace(/,/g,"");return ye.isNotParsableNumber(t)?K.STRING:ye.getNumberType(t)}static checkLong(e){var t=e.replace(/,/g,"");return ye.isNotParsableNumber(t)?K.STRING:t.includes(".")?K.DOUBLE:K.LONG}static checkDouble(e){var t=e.replace(/,/g,"");return ye.isNotParsableNumber(t)?K.STRING:K.DOUBLE}static checkBoolean(e){var t=e.toLowerCase();return t==="true"||t==="false"?K.BOOLEAN:K.STRING}static checkDateTime(e){return Oo.test(e)?K.DATE_TIME:K.STRING}static checkLocalTime(e){return xo.test(e)?K.LOCAL_TIME:K.STRING}static getTypeFromUnknown(e){var t=e.replace(/,/g,"");if(ye.isNotParsableNumber(t)){var i=e.toLowerCase();return i==="true"||i==="false"?K.BOOLEAN:Oo.test(e)&&e.includes(":")?K.DATE_TIME:xo.test(e)?K.LOCAL_TIME:K.STRING}return ye.getNumberType(t)}static getNumberType(e){if(e.includes("."))return K.DOUBLE;var t=e.startsWith("-")?11:10;if(e.length>t)return K.LONG;var i=parseInt(e,10);return i>Ap||i<Lp?K.LONG:K.INTEGER}constructor(e,t,i,r,o,s,a,l,d,h){_e(this,"onFileCompleted",void 0),_e(this,"file",void 0),_e(this,"readHeaders",void 0),_e(this,"nullString",void 0),_e(this,"onProgress",void 0),_e(this,"onError",void 0),_e(this,"types",void 0),_e(this,"chunks",void 0),_e(this,"totalChunks",void 0),_e(this,"rowCount",void 0),_e(this,"isZip",void 0),_e(this,"shouldTrim",void 0),_e(this,"zipProgress",void 0),_e(this,"config",void 0),this.onFileCompleted=e,this.file=t,this.readHeaders=i,this.nullString=o,this.onProgress=s,this.onError=a,this.chunks=0,this.totalChunks=l,this.rowCount=0,this.isZip=d,this.shouldTrim=h,this.zipProgress=0,this.handleChunk=this.handleChunk.bind(this),this.handleComplete=this.handleComplete.bind(this),this.handleError=this.handleError.bind(this),this.handleNodeUpdate=this.handleNodeUpdate.bind(this),this.config=Po(Po({},r),{},{error:this.handleError,chunk:this.handleChunk,complete:this.handleComplete})}parse(){if(this.file instanceof File||this.file instanceof Blob)vn.parse(this.file,this.config);else{var e=Ra(this.file,this.handleNodeUpdate);vn.parse(e,this.config),e.resume()}}handleChunk(e,t){var{data:i}=e;if(!this.types){if(i==null||i.length===0){t.abort(),this.onError("Error parsing CSV: no data in file.");return}this.types=new Array(i[0].length).fill(To),this.readHeaders&&(i=i.slice(1))}this.rowCount+=i.length,H(this.types);var r=[...this.types];i.forEach(a=>{if(a.length>=r.length){for(var l=0;l<r.length;l+=1)r[l]=ye.determineType(this.shouldTrim?a[l].trim():a[l],r[l],this.nullString);this.types=r}else t.abort(),this.onError(`Error parsing CSV: Insufficient data in row.
|
|
5
5
|
Expected length `.concat(r.length," but found ").concat(a.length,`.
|
|
@@ -17,4 +17,4 @@ Row = `).concat(a))}),this.chunks+=1;var o=0;this.totalChunks>0?o=Math.round(thi
|
|
|
17
17
|
`))}}if(i=i.trimRight(),this.editor.setValue(i),t){var a,l=(a=this.editor.getModel())===null||a===void 0?void 0:a.getLineCount();H(l),this.editor.revealLine(l,1)}this.stopFlushTimer(),this.bufferedMessages=[]}}truncateLogIfNecessary(){this.messages.length>ue.maxLogSize&&(this.messages=this.messages.splice(this.messages.length-ue.truncateSize))}scrollToBottom(){var e,t,i;if(this.editor){var r=(e=this.editor)===null||e===void 0||(t=e.getModel)===null||t===void 0||(i=t.call(e))===null||i===void 0?void 0:i.getLineCount();H(r),this.editor.revealLine(r,1)}}isBottomVisible(){if(!this.editor)return!0;var e=this.editor.getModel(),t=e==null?void 0:e.getLineCount();return H(t),this.isLineVisible(t)}isLineVisible(e){var t,i=(t=this.editor)===null||t===void 0?void 0:t.getVisibleRanges();if(i==null||i.length===0)return!1;for(var r=0;r<i.length;r+=1){var o=i[r];if(o.startLineNumber<=e&&e<=o.endLineNumber)return!0}return!1}isLogItemVisible(e){var{shownLogLevels:t}=this.state;return t[e.logLevel]}flush(){for(var e="",t=0;t<this.bufferedMessages.length;t+=1){var i=this.bufferedMessages[t],r=ue.getLogText(i);e+=r,r.charAt(r.length-1)!==`
|
|
18
18
|
`&&(e+=`
|
|
19
19
|
`)}this.bufferedMessages=[],this.appendLogText(e)}queue(e){this.bufferedMessages.push(e),this.bufferedMessages.length===1&&(this.flushTimer=setTimeout(this.handleFlushTimeout,ue.bufferTimeout))}stopFlushTimer(){this.flushTimer&&(clearTimeout(this.flushTimer),this.flushTimer=void 0)}updateDimensions(){this.editor&&this.editor.layout()}handleClearClick(){this.clearLogs()}clearLogs(){this.messages=[],this.refreshLogText()}handleFlushTimeout(){this.stopFlushTimer(),this.flush()}handleLogMessage(e){this.messages.push(e),this.editor&&this.isLogItemVisible(e)&&this.queue(e)}handleMenuItemClick(e){this.toggleLogLevel(e)}handleResetClick(){this.resetLogLevels()}handleResize(){this.updateDimensions()}handleToggleAllClick(){this.toggleAll()}render(){var e={placement:"bottom-end"},{shownLogLevels:t}=this.state,i=this.getMenuActions(t);return u.jsxs("div",{className:"log-pane h-100 w-100",children:[u.jsxs("div",{className:"log-pane-menu",children:[u.jsx(Q,{kind:"ghost",className:"btn-clear-logs",onClick:this.handleClearClick,icon:Cl,tooltip:"Clear log"}),u.jsx(Q,{kind:"ghost",className:"btn-link-icon btn-overflow",icon:wl,tooltip:"Log Settings",onClick:()=>{},children:u.jsx(ri,{actions:i,popperClassName:"log-level-menu-popper",popperOptions:e})})]}),u.jsx("div",{className:"log-pane-editor h-100 w-100",ref:r=>{this.editorContainer=r}})]})}}Fe(ue,"DefaultLogLevels",[ge.STDOUT,ge.ERROR,ge.FATAL,ge.STDERR,ge.WARN]);Fe(ue,"AllLogLevels",[ge.INFO,ge.STDOUT,ge.ERROR,ge.FATAL,ge.STDERR,ge.WARN,ge.DEBUG,ge.TRACE]);Fe(ue,"bufferTimeout",16);Fe(ue,"maxLogSize",131072);Fe(ue,"truncateSize",65536);function $o(n,e,t,i,r,o,s){try{var a=n[o](s),l=a.value}catch(d){return void t(d)}a.done?e(l):Promise.resolve(l).then(i,r)}function mf(n){return function(){var e=this,t=arguments;return new Promise(function(i,r){var o=n.apply(e,t);function s(l){$o(o,i,r,s,a,"next",l)}function a(l){$o(o,i,r,s,a,"throw",l)}s(void 0)})}}var vf=R.module("HeapUsage");function pf(n){var e,{connection:t,defaultUpdateInterval:i,hoverUpdateInterval:r,bgMonitoring:o=!0,monitorDuration:s}=n,a=Kh(),[l,d]=c.useState({freeMemory:0,maximumHeapSize:999,totalHeapSize:0}),[h,v]=c.useState(!1),m=c.useRef({timestamps:[],usages:[]}),p=Es(),f=c.useCallback(mf(function*(){try{var M=yield t.getWorkerHeapInfo();if(!p.current)return;if(d(M),o||h){for(var $=(M.totalHeapSize-M.freeMemory)/M.maximumHeapSize,B=Date.now(),{timestamps:me,usages:it}=m.current;me.length!==0&&B-me[0]>s*1.5;)me.shift(),it.shift();me.push(B),it.push($)}else m.current={timestamps:[],usages:[]}}catch(Xe){vf.warn("Unable to get heap usage",Xe)}}),[t,p,o,h,s]);Td(f,h?r:i);var g=(M,$)=>Math.round(M*10**$)/10**$,y=2,S=1024**3,{freeMemory:_,totalHeapSize:C,maximumHeapSize:D}=l,W=g(_/S,y),X=g(C/S,y),I=g(D/S,y),V=X-W,A=function($,B){var me=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return u.jsxs("div",{className:U("heap-usage-info-row",{"heading-bottom-border":me}),children:[u.jsx("div",{className:"font-weight-bold",children:$}),u.jsx("div",{children:B})]})},{timestamps:J,usages:ee}=m.current,j=(e=J[J.length-1])!==null&&e!==void 0?e:0,G=C/D,F=(C-_)/D;return u.jsxs("div",{className:"max-memory",children:[u.jsx("div",{className:"total-memory",style:{width:"calc(".concat(G*100,"% - ").concat(G*2,"px")}}),u.jsx("div",{className:U("used-memory",{"heap-overflow":(C-_)/D>.95}),style:{width:"calc(".concat(F*100,"% - ").concat(F*2,"px")}}),u.jsxs("div",{className:"memory-text",children:[I.toFixed(1)," GB"]}),u.jsx(re,{onEntered:()=>v(!0),onExited:()=>v(!1),interactive:!0,children:u.jsxs("div",{className:"heap-tooltip",children:[A("In use:","".concat(V.toFixed(y)," of ").concat(I.toFixed(y)," GB"),!0),A("Free:","".concat(W.toFixed(y)," GB")),A("Total:","".concat(X.toFixed(y)," GB")),A("Max:","".concat(I.toFixed(y)," GB")),u.jsx("div",{className:"heap-plot",children:u.jsx(Bh,{data:[{x:[...J],y:[...ee],type:"scatter",mode:"lines"}],config:{staticPlot:!0,responsive:!0},style:{width:"196px",height:"100px"},layout:{margin:{l:2,t:2,r:2,b:2},plot_bgcolor:"transparent",paper_bgcolor:"transparent",colorway:["#4878ea"],xaxis:{dtick:Math.round(s/6),gridcolor:a.linecolor,range:[j-s,j],linecolor:a.linecolor,linewidth:2,mirror:!0},yaxis:{dtick:.2,gridcolor:a.linecolor,range:[0,1],linecolor:a.linecolor,linewidth:2,mirror:!0}}})}),u.jsxs("div",{className:"heap-utilisation-text",children:["% utilization over ",Math.round(s/1e3/60)," min."]})]})})]})}function In(n,e,t){return(e=ff(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function ff(n){var e=gf(n,"string");return typeof e=="symbol"?e:e+""}function gf(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class Me{}In(Me,"SESSION_OPENED","ConsoleEvent.SESSION_OPENED");In(Me,"SESSION_CLOSED","ConsoleEvent.SESSION_CLOSED");In(Me,"FOCUS_HISTORY","ConsoleEvent.FOCUS_HISTORY");In(Me,"SEND_COMMAND","ConsoleEvent.SEND_COMMAND");In(Me,"SETTINGS_CHANGED","ConsoleEvent.SETTINGS_CHANGED");function Dt(n,e,t){return(e=bf(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function bf(n){var e=yf(n,"string");return typeof e=="symbol"?e:e+""}function yf(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class st{}Dt(st,"TABLE_CHANGED","InputFilterEvent.TABLE_CHANGED");Dt(st,"COLUMNS_CHANGED","InputFilterEvent.COLUMNS_CHANGED");Dt(st,"FILTERS_CHANGED","InputFilterEvent.FILTERS_CHANGED");Dt(st,"CLEAR_ALL_FILTERS","InputFilterEvent.CLEAR_ALL_FILTERS");Dt(st,"COLUMN_SELECTED","InputFilterEvent.COLUMN_SELECTED");Dt(st,"OPEN_DROPDOWN","InputFilterEvent.OPEN_DROPDOWN");Dt(st,"OPEN_INPUT","InputFilterEvent.OPEN_INPUT");Dt(st,"OPEN_FILTER_SET_MANAGER","InputFilterEvent.OPEN_FILTER_SET_MANAGER");function ft(n,e,t){return(e=Cf(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Cf(n){var e=wf(n,"string");return typeof e=="symbol"?e:e+""}function wf(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class Oe{}ft(Oe,"CREATE_NOTEBOOK","NotebookEvent.createNotebook");ft(Oe,"SELECT_NOTEBOOK","NotebookEvent.selectNotebook");ft(Oe,"CLOSE_FILE","NotebookEvent.closeFile");ft(Oe,"RENAME","NotebookEvent.rename");ft(Oe,"RENAME_FILE","NotebookEvent.renameFile");ft(Oe,"REGISTER_FILE","NotebookEvent.registerFile");ft(Oe,"SEND_TO_NOTEBOOK","NotebookEvent.sendToNotebook");ft(Oe,"UNREGISTER_FILE","NotebookEvent.unregisterFile");ft(Oe,"PROMOTE_FROM_PREVIEW","NotebookEvent.promoteFromPreview");var Sf=["children"];function Ho(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(n);e&&(i=i.filter(function(r){return Object.getOwnPropertyDescriptor(n,r).enumerable})),t.push.apply(t,i)}return t}function Uo(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Ho(Object(t),!0).forEach(function(i){_f(n,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Ho(Object(t)).forEach(function(i){Object.defineProperty(n,i,Object.getOwnPropertyDescriptor(t,i))})}return n}function _f(n,e,t){return(e=Ef(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Ef(n){var e=Pf(n,"string");return typeof e=="symbol"?e:e+""}function Pf(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function Tf(n,e){if(n==null)return{};var t,i,r=Of(n,e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(n);for(i=0;i<o.length;i++)t=o[i],e.indexOf(t)===-1&&{}.propertyIsEnumerable.call(n,t)&&(r[t]=n[t])}return r}function Of(n,e){if(n==null)return{};var t={};for(var i in n)if({}.hasOwnProperty.call(n,i)){if(e.indexOf(i)!==-1)continue;t[i]=n[i]}return t}class xf extends c.PureComponent{constructor(e){super(e),this.handleClearAllFilters=this.handleClearAllFilters.bind(this),this.handleSessionClosed=this.handleSessionClosed.bind(this),this.handleSessionOpened=this.handleSessionOpened.bind(this)}componentDidMount(){var{glEventHub:e}=this.props;e.on(Me.SESSION_CLOSED,this.handleSessionClosed),e.on(Me.SESSION_OPENED,this.handleSessionOpened),e.on(st.CLEAR_ALL_FILTERS,this.handleClearAllFilters)}componentWillUnmount(){var{glEventHub:e}=this.props;e.off(Me.SESSION_CLOSED,this.handleSessionClosed),e.off(Me.SESSION_OPENED,this.handleSessionOpened),e.off(st.CLEAR_ALL_FILTERS,this.handleClearAllFilters)}handleClearAllFilters(){for(var{onClearAllFilters:e}=this.props,t=arguments.length,i=new Array(t),r=0;r<t;r++)i[r]=arguments[r];e==null||e(...i)}handleSessionClosed(e){var{onSessionClose:t}=this.props;t==null||t(e)}handleSessionOpened(e,t){var{onSessionOpen:i}=this.props;i==null||i(e,t)}render(){var e=this.props,{children:t}=e,i=Tf(e,Sf);return u.jsx(Tv,Uo(Uo({},i),{},{children:t}))}}var di=Ls(xf),If=Object.freeze({}),Df=new Map,ui=Object.freeze([]),Eb=(n,e)=>{var t;return(t=we(n,e).columns)!==null&&t!==void 0?t:ui},Pb=(n,e)=>{var t;return(t=we(n,e).filterSets)!==null&&t!==void 0?t:ui},Tb=(n,e)=>{var t;return(t=we(n,e).filters)!==null&&t!==void 0?t:ui},Ob=(n,e)=>{var t;return(t=we(n,e).tableMap)!==null&&t!==void 0?t:Df},xb=(n,e)=>we(n,e).isolatedLinkerPanelId,Ib=(n,e)=>{var t;return(t=we(n,e).links)!==null&&t!==void 0?t:ui},Db=(n,e)=>we(n,e).columnSelectionValidator,Mb=(n,e)=>{var t;return(t=we(n,e).consoleSettings)!==null&&t!==void 0?t:If},kb=(n,e)=>we(n,e).connection,hi=(n,e)=>we(n,e).sessionWrapper;function Jn(n,e,t){return(e=Mf(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Mf(n){var e=kf(n,"string");return typeof e=="symbol"?e:e+""}function kf(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var Hn=R.module("CommandHistoryPanel");class Dn extends c.Component{static handleError(e){Hn.error(e)}constructor(e){super(e),Jn(this,"container",void 0),Jn(this,"pending",void 0),this.handleFocusHistory=this.handleFocusHistory.bind(this),this.handleSessionOpened=this.handleSessionOpened.bind(this),this.handleSessionClosed=this.handleSessionClosed.bind(this),this.handleShow=this.handleShow.bind(this),this.handleSendToConsole=this.handleSendToConsole.bind(this),this.handleSendToNotebook=this.handleSendToNotebook.bind(this),this.container=x.createRef(),this.pending=new ti;var{session:t,sessionId:i,language:r}=e;this.state={panelState:{},session:t,sessionId:i,language:r,contextActions:[{action:this.handleFocusHistory,shortcut:Jt.COMMAND_HISTORY.FOCUS_HISTORY}]}}componentDidMount(){var{glEventHub:e,session:t}=this.props;e.on(Me.FOCUS_HISTORY,this.handleFocusHistory),t!=null&&this.loadTable()}componentWillUnmount(){var{glEventHub:e}=this.props;e.off(Me.FOCUS_HISTORY,this.handleFocusHistory),this.pending.cancel()}handleFocusHistory(){this.container.current&&this.container.current.focus()}handleShow(){var e;(e=this.container.current)===null||e===void 0||e.restoreScrollPosition()}handleSessionOpened(e,t){var{language:i,sessionId:r}=t;this.setState({session:e,sessionId:r,language:i},()=>{this.loadTable()})}handleSessionClosed(){this.pending.cancel(),this.setState({session:void 0,language:void 0,table:void 0})}handleSendToNotebook(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,{session:i,language:r}=this.state;if(Hn.debug("handleSendToNotebook",i,e),!i){Hn.error("Session is not connected.");return}var{glEventHub:o}=this.props;o.emit(t?Oe.CREATE_NOTEBOOK:Oe.SEND_TO_NOTEBOOK,i,r,e)}handleSendToConsole(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;Hn.debug("handleSendToConsole",e);var{glEventHub:r}=this.props;r.emit(Me.SEND_COMMAND,e,t,i)}loadTable(){var{commandHistoryStorage:e}=this.props,{language:t,sessionId:i}=this.state;H(t),H(i),this.pending.add(e.getTable(t,i,Date.now()),r=>r.close()).then(r=>{this.setState({table:r})}).catch(Dn.handleError)}render(){var{glContainer:e,glEventHub:t,commandHistoryStorage:i}=this.props,{language:r,contextActions:o,table:s}=this.state;return u.jsxs(di,{className:"command-history-pane",componentPanel:this,glContainer:e,glEventHub:t,onSessionOpen:this.handleSessionOpened,onSessionClose:this.handleSessionClosed,onShow:this.handleShow,children:[!s&&u.jsx("div",{className:"command-history-disconnected-message",children:"Waiting for console connection"}),s&&r!=null&&u.jsxs(u.Fragment,{children:[u.jsx(Ee,{ref:this.container,language:r,sendToNotebook:this.handleSendToNotebook,sendToConsole:this.handleSendToConsole,table:s,commandHistoryStorage:i}),u.jsx(oe,{actions:o})]})]})}}Jn(Dn,"COMPONENT","CommandHistoryPanel");Jn(Dn,"TITLE","Command History");var jf=(n,e)=>{var t=Us(n),i=hi(n,e.localDashboardId),{session:r,config:o}=i??{},{type:s,id:a}=o??{};return{commandHistoryStorage:t,language:s,session:r,sessionId:a}},jb=_n(jf,null,null,{forwardRef:!0})(Dn);function Bo(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(n);e&&(i=i.filter(function(r){return Object.getOwnPropertyDescriptor(n,r).enumerable})),t.push.apply(t,i)}return t}function Un(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Bo(Object(t),!0).forEach(function(i){Rt(n,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Bo(Object(t)).forEach(function(i){Object.defineProperty(n,i,Object.getOwnPropertyDescriptor(t,i))})}return n}function Rt(n,e,t){return(e=Nf(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Nf(n){var e=Af(n,"string");return typeof e=="symbol"?e:e+""}function Af(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var Bn=R.module("ConsolePanel"),Lf=500,Rf=Object.freeze({consoleSettings:{},itemIds:[]});class ci extends c.PureComponent{constructor(e){super(e),Rt(this,"consoleRef",void 0),Rt(this,"objectSubscriptionCleanup",void 0),Rt(this,"savePanelState",Sn(()=>{var{consoleSettings:s,itemIds:a}=this.state,l={consoleSettings:s,itemIds:[...a]};Bn.debug("Saving panel state",l),this.setState({panelState:l})},Lf)),this.handleFocusCommandHistory=this.handleFocusCommandHistory.bind(this),this.handleOpenObject=this.handleOpenObject.bind(this),this.handleCloseObject=this.handleCloseObject.bind(this),this.handleResize=this.handleResize.bind(this),this.handleSettingsChange=this.handleSettingsChange.bind(this),this.handleShow=this.handleShow.bind(this),this.handlePanelMount=this.handlePanelMount.bind(this),this.supportsType=this.supportsType.bind(this),this.iconForType=this.iconForType.bind(this),this.consoleRef=x.createRef();var{panelState:t}=e,i=Un(Un({},Rf),t||{}),{consoleSettings:r,itemIds:o}=i;this.state={consoleSettings:r,itemIds:new Map(o),objectMap:new Map,error:void 0,panelState:i}}componentDidMount(){var{glEventHub:e}=this.props;this.closeDisconnectedPanels(),e.on(Y.MOUNT,this.handlePanelMount),this.subscribeToFieldUpdates()}componentDidUpdate(e,t){var{consoleSettings:i,itemIds:r}=this.state;(t.consoleSettings!==i||t.itemIds!==r)&&this.savePanelState()}componentWillUnmount(){var e,{glEventHub:t}=this.props;this.savePanelState.flush(),t.off(Y.MOUNT,this.handlePanelMount),(e=this.objectSubscriptionCleanup)===null||e===void 0||e.call(this)}subscribeToFieldUpdates(){var{sessionWrapper:e}=this.props;if(e!=null){var{session:t}=e;this.objectSubscriptionCleanup=t.subscribeToFieldUpdates(i=>{Bn.debug("Got updates",i),this.setState(r=>{var{objectMap:o}=r,{updated:s,created:a,removed:l}=i,d=[...s,...l],h=new Map(o);d.forEach(m=>{var{title:p}=m;p!==void 0&&h.delete(p)});var v=[...s,...a];return v.forEach(m=>{m.title!==void 0&&h.set(m.title,m)}),{objectMap:h}})})}}setItemId(e,t){this.setState(i=>{var{itemIds:r}=i,o=new Map(r);return o.set(e,t),{itemIds:o}})}getItemId(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,{itemIds:i}=this.state,r=i.get(e);return r==null&&t&&(r=vt(),this.setItemId(e,r)),r}handleTabFocus(){var e;(e=this.consoleRef.current)===null||e===void 0||e.focus()}handlePanelMount(e){var t,i,r,{itemIds:o}=this.state,s=e==null||(t=e.props)===null||t===void 0?void 0:t.id,a=e==null||(i=e.props)===null||i===void 0||(r=i.metadata)===null||r===void 0?void 0:r.sourcePanelId;if(s&&a){var l=new Set(o.values());l.has(a)&&this.setItemId(s,s)}}handleFocusCommandHistory(){var{glEventHub:e}=this.props;e.emit(Me.FOCUS_HISTORY)}handleResize(){this.updateDimensions()}handleShow(){this.updateDimensions()}handleOpenObject(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,{root:i}=this.context,r=e.title!=null?this.getItemId(e.title,!1):null;(t||r!=null&&E.getStackForRoot(i,{id:r},!1,!1,!1)!=null)&&this.openWidget(e)}handleCloseObject(e){var{title:t}=e;if(t!==void 0){var i=this.getItemId(t,!1);if(i!=null){var{glEventHub:r}=this.props;r.emit(Y.CLOSE,i),vv(r,t)}}}handleSettingsChange(e){var{glEventHub:t}=this.props;Bn.debug("handleSettingsChange",e),this.setState({consoleSettings:e}),t.emit(Me.SETTINGS_CHANGED,e)}openWidget(e){var{glEventHub:t,sessionWrapper:i}=this.props;H(i);var{config:r,session:o}=i,{title:s=e.name}=e;H(s);var a=this.getItemId(s),l={fetch:()=>o.getObject(e),panelId:a,widget:Un(Un({},Lu(e)),{},{sessionId:r.id})};Bn.debug("openWidget",l),xm(t,l)}addCommand(e){var t,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;(t=this.consoleRef.current)===null||t===void 0||t.addCommand(e,i,r)}closeDisconnectedPanels(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,{consoleSettings:t,itemIds:i}=this.state,{isClosePanelsOnDisconnectEnabled:r=!0}=t;if(!(!r&&!e)){var o=[...i.values()],{glEventHub:s}=this.props;o.forEach(a=>{s.emit(Y.CLOSE,a)}),this.setState({itemIds:new Map})}}updateDimensions(){var e;(e=this.consoleRef.current)===null||e===void 0||e.updateDimensions()}supportsType(e){var{plugins:t}=this.props;return[...t.values()].some(i=>Vr(i,e))}iconForType(e){var{plugins:t}=this.props,i=[...t.values()].find(r=>Vr(r,e));return i!=null?Mh(i):u.jsx(Ia,{type:e})}render(){var{commandHistoryStorage:e,glContainer:t,glEventHub:i,sessionWrapper:r,timeZone:o,unzip:s}=this.props;if(r==null)return u.jsx(wn,{isLoading:!1,errorMessage:"Console is disabled.","data-testid":"console-panel-loading-error"});var{consoleSettings:a,error:l,objectMap:d}=this.state,{config:h,session:v,connection:m,details:p={},dh:f}=r,{workerName:g,processInfoId:y}=p,{id:S,type:_}=h;return u.jsx(di,{className:"iris-panel-console",componentPanel:this,glContainer:t,glEventHub:i,onResize:this.handleResize,onShow:this.handleShow,onTabFocus:this.handleTabFocus,errorMessage:l!=null?"".concat(l):void 0,children:v!=null&&u.jsx(Ot,{dh:f,ref:this.consoleRef,settings:a,session:v,focusCommandHistory:this.handleFocusCommandHistory,openObject:this.handleOpenObject,closeObject:this.handleCloseObject,commandHistoryStorage:e,onSettingsChange:this.handleSettingsChange,language:_,statusBarChildren:u.jsxs(u.Fragment,{children:[u.jsx("div",{children:Ma.LANGUAGE_MAP.get(_)}),g!=null&&u.jsxs(u.Fragment,{children:[u.jsx("div",{children:"•"}),g]}),y!=null&&u.jsxs(u.Fragment,{children:[u.jsx("div",{children:"•"}),y,u.jsx("div",{children:"•"})]}),u.jsx(pf,{connection:m,defaultUpdateInterval:10*1e3,hoverUpdateInterval:3*1e3,monitorDuration:10*60*1e3})]}),showObjectsMenu:!1,scope:S,timeZone:o,objectMap:d,unzip:s,supportsType:this.supportsType,iconForType:this.iconForType})})}}Rt(ci,"COMPONENT","ConsolePanel");Rt(ci,"TITLE","Console");Rt(ci,"contextType",ba);var Ff=(n,e)=>({commandHistoryStorage:Us(n),sessionWrapper:hi(n,e.localDashboardId),timeZone:zu(n),plugins:Vu(n)}),Nb=_n(Ff,null,null,{forwardRef:!0})(ci);function Ab(n){return n==="file"||n==="directory"}function tt(n){return n.type==="directory"}function $f(n,e,t){return(e=Hf(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Hf(n){var e=Uf(n,"string");return typeof e=="symbol"?e:e+""}function Uf(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class rr extends Error{constructor(){super("No file exists at the path specified"),$f(this,"isFileNotFound",!0)}}function Ko(n,e,t,i,r,o,s){try{var a=n[o](s),l=a.value}catch(d){return void t(d)}a.done?e(l):Promise.resolve(l).then(i,r)}function Wo(n){return function(){var e=this,t=arguments;return new Promise(function(i,r){var o=n.apply(e,t);function s(l){Ko(o,i,r,s,a,"next",l)}function a(l){Ko(o,i,r,s,a,"throw",l)}s(void 0)})}}var mt;(function(n){n.GROOVY="text/x-groovy",n.PLAIN_TEXT="text/plain",n.PYTHON="text/x-python",n.PYTHON_COMPILED="application/x-python-code",n.SCALA="text/x-scala",n.UNKNOWN=""})(mt||(mt={}));class L{static fileExists(e,t){return Wo(function*(){try{return yield e.info(t),!0}catch(i){if(!(i instanceof rr))throw i;return!1}})()}static fileExtensionToString(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"";return e.length===0?"":".".concat(e)}static getDepth(e){var t;if(!L.hasPath(e))throw new Error("Invalid path provided: ".concat(e));var i=(t=e.match(/\//g))!==null&&t!==void 0?t:[];return i.length-1}static getExtension(e){var t=this.getBaseName(e).split(".");if(t.length>1){var i;return(i=t.pop())!==null&&i!==void 0?i:""}return""}static getBaseName(e){var t;return(t=e.split("/").pop())!==null&&t!==void 0?t:""}static getCopyFileName(e){var t=e.lastIndexOf("."),i=null,r=null;t<0?r=e:(r=e.substring(0,t),i=e.substring(t+1));var o=r?"".concat(r,"-copy"):"Copy";return i!==null?"".concat(o,".").concat(i):o}static getUniqueCopyFileName(e,t){return Wo(function*(){for(var i=L.getCopyFileName(t);yield L.fileExists(e,i);)i=L.getCopyFileName(i);return i})()}static getMimeType(e){var t=this.getExtension(e).toLowerCase();switch(t){case"groovy":return mt.GROOVY;case"py":return mt.PYTHON;case"pyc":return mt.PYTHON_COMPILED;case"scala":return mt.SCALA;case"txt":return mt.PLAIN_TEXT;default:return mt.UNKNOWN}}static getParent(e){if(!L.hasPath(e))throw new Error("Invalid name provided: ".concat(e));for(var t=e.split("/");t.pop()==="";);if(t.length===0)throw new Error("No parent for path provided: ".concat(e));return"".concat(t.join("/"),"/")}static getPath(e){if(!L.hasPath(e))throw new Error("Invalid filename provided: ".concat(e));var t=e.split("/");return t.pop(),"".concat(t.join("/"),"/")}static hasPath(e){return e.startsWith("/")}static isPath(e){return e.startsWith("/")&&e.endsWith("/")}static makePath(e){return e.endsWith("/")?e:"".concat(e,"/")}static replaceExtension(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",i=e.lastIndexOf("."),r=i>-1?e.substring(0,i):e,o=L.fileExtensionToString(t);return"".concat(r).concat(o)}static validateName(e){var t=[".",".."],i=/[\\/\0]/g,r=new Map([["\0","null"]]);if(!e)throw new pn("Name cannot be empty");if(t.includes(e))throw new pn('"'.concat(e,'" is a reserved name'));if(i.test(e)){var o,s;throw new pn('Invalid characters in name: "'.concat((o=(s=e.match(i))===null||s===void 0?void 0:s.reduce((a,l)=>a.includes(l)?a:[...a,l],[]).map(a=>r.has(a)?r.get(a):a).join('", "'))!==null&&o!==void 0?o:"",'"'))}}static reducePaths(e){var t=e.filter(i=>L.isPath(i));return e.filter(i=>!t.some(r=>i!==r&&i.startsWith(r)))}static removeRoot(e,t){if(e.length===0)return t;if(!t.startsWith(e))throw new Error("Filename ".concat(t," does not start with expected root ").concat(e));return t.substring(e.length)}static addRoot(e,t){return"".concat(e).concat(t)}}var or=26;function Hi(n){return tt(n)?L.makePath(n.filename):L.getPath(n.filename)}function zo(n,e){if(n.length===0||e==null)throw new Error("No items to move");var t=Hi(e);if(n.some(i=>{var{filename:r}=i;return L.getPath(r)===t}))throw new Error("File already in the destination folder");if(n.some(i=>tt(i)&&t.startsWith(L.makePath(i.filename))))throw new Error("Destination folder cannot be a child of a dragged folder");return{files:n,targetPath:t}}function Bf(n){if(tt(n))return n.isExpanded?Sl:_l;var e=L.getMimeType(n.basename);switch(e){case mt.PYTHON:return Pl;default:return El}}function Ui(n){var e,{children:t,draggedItems:i,isDragInProgress:r,isDropTargetValid:o,isSelected:s,item:a,itemIndex:l,dropTargetItem:d,onDragStart:h,onDragOver:v,onDragEnd:m,onDrop:p}=n,f=(e=i==null?void 0:i.some(I=>I.id===a.id))!==null&&e!==void 0?e:!1,g=Hi(a),y=r&&d?Hi(d):null,S=r&&o&&tt(a)&&y===g,_=r&&o&&y===g,C=r&&!o&&y===g,D=Bf(a),W=L.getDepth(a.filename),X=Array(W).fill(null).map((I,V)=>u.jsx("span",{className:"file-list-depth-line"},V));return u.jsxs("div",{className:U("d-flex w-100 align-items-center","file-list-item",{"is-dragged":f,"is-exact-drop-target":S,"is-in-drop-target":_,"is-invalid-drop-target":C,"is-selected":s}),onDragStart:I=>h(l,I),onDragOver:I=>v(l,I),onDragEnd:I=>m(l,I),onDrop:I=>p(l,I),draggable:!0,role:"presentation","aria-label":a.basename,children:[X," ",u.jsx(le,{icon:D,className:"item-icon",fixedWidth:!0})," ",u.jsx("span",{className:"truncation-wrapper",children:t??u.jsxs(u.Fragment,{children:[a.basename,u.jsx(re,{children:a.basename})]})})]})}function Vo(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(n);e&&(i=i.filter(function(r){return Object.getOwnPropertyDescriptor(n,r).enumerable})),t.push.apply(t,i)}return t}function Kn(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Vo(Object(t),!0).forEach(function(i){Kf(n,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Vo(Object(t)).forEach(function(i){Object.defineProperty(n,i,Object.getOwnPropertyDescriptor(t,i))})}return n}function Kf(n,e,t){return(e=Wf(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:e+""}function zf(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var Se=R.module("FileList"),Vf=500,Go="item-list-scroll-pane";function Gf(n){var{isMultiSelect:e=!1,table:t,onFocusChange:i=()=>{},onMove:r,onSelect:o,onSelectionChange:s=()=>{},renderItem:a=Ui,rowHeight:l=or,overscanCount:d=$e.DEFAULT_OVERSCAN}=n,[h,v]=c.useState(()=>({items:[],offset:0,itemCount:0})),[m,p]=c.useState({top:0,bottom:0}),[f,g]=c.useState(),[y,S]=c.useState(),[_,C]=c.useState(),[D,W]=c.useState([]),X=c.useRef(),I=c.useRef(null),V=c.useRef(null),A=c.useCallback(T=>{if(T.length===0||h==null)return[];for(var z=[],ne=0;ne<T.length;ne+=1)for(var pe=T[ne],je=pe[0];je<=pe[1];je+=1)je>=h.offset&&je<h.offset+h.items.length&&z.push(h.items[je-h.offset]);return z},[h]),J=c.useCallback(T=>{var z=A([[T,T]]);if(z.length>0)return z[0]},[A]),ee=c.useCallback(()=>{var T=Qe.count(D);if(T===0)return null;if(T===1){var z=D[0][0],ne=J(z);if(ne!=null)return ne.filename}return"".concat(T," items")},[J,D]),j=c.useCallback(T=>{if(!(!y||!f)){Se.debug("dropItems",y,"to",T);try{var{files:z,targetPath:ne}=zo(y,f);if(r==null||r(z,ne),T!=null){var pe;W([[T,T]]),(pe=I.current)===null||pe===void 0||pe.focusItem(T)}}catch(je){Se.error("Unable to complete move",je)}}},[y,f,r]),G=c.useCallback((T,z)=>{var ne=h.items[T-h.offset];ne!==void 0&&(Se.debug("handleItemClick",ne),o(ne,z),tt(ne)&&(t==null||t.setExpanded(ne.filename,!ne.isExpanded)))},[h,o,t]),F=c.useCallback((T,z)=>{var ne,pe;Se.debug2("handleItemDragStart",T,D);var je=D;Qe.isSelected(D,T)||(je=[[T,T]],W(je)),S(A(je)),(ne=I.current)===null||ne===void 0||ne.resetMouseState();var Mt=document.createElement("div"),Bt=document.createElement("div");Bt.className="dnd-placeholder-content",Bt.innerText=(pe=ee())!==null&&pe!==void 0?pe:"",Mt.appendChild(Bt),Mt.className="file-list-dnd-placeholder",document.body.appendChild(Mt),z.dataTransfer.setDragImage(Mt,0,0),z.dataTransfer.effectAllowed="move",C(Mt)},[ee,A,D]),M=c.useCallback((T,z)=>{z.preventDefault(),Se.debug2("handleItemDragOver",z),g(J(T))},[J]),$=c.useCallback((T,z)=>{Se.debug("handleItemDragEnd",T),_==null||_.remove(),S(void 0),g(void 0),C(void 0)},[_]),B=c.useCallback((T,z)=>{j(T)},[j]),me=c.useCallback(()=>{Se.debug2("handleItemDragExit"),g(void 0)},[]),it=c.useCallback(T=>{T.target instanceof Element&&T.target.classList.contains(Go)&&(T.preventDefault(),Se.debug2("handleListDragOver",T),g({type:"directory",filename:"/",basename:"/",id:"/"}))},[]),Xe=c.useCallback(T=>{T.target instanceof Element&&T.target.classList.contains(Go)&&(Se.debug("handleListDrop"),j())},[j]),N=c.useCallback(function(T){var z=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(Se.debug2("handleSelectionChange",T),z===!0||T!==D){W(T);var ne=A(T);s(ne)}},[A,s,D]),te=c.useCallback(T=>{if(Se.debug2("handleFocusChange",T),T!=null){var[z]=A([[T,T]]);i(z)}else i();X.current=T},[A,i]),se=c.useCallback((T,z)=>{Se.debug("handleViewportChange",T,z),(T!==m.top||z!==m.bottom)&&p({top:T,bottom:z})},[m]),ln=c.useMemo(()=>{if(!y||!f)return!1;try{return zo(y,f),Se.debug("handleValidateDropTarget true"),!0}catch{return Se.debug("handleValidateDropTarget false"),!1}},[y,f]),{focusedPath:gt}=n;c.useEffect(()=>{gt!==void 0&&(gt==="/"?t.collapseAll():(t.setExpanded(gt,!1),t.setExpanded(gt,!0)))},[t,gt]),c.useEffect(function(){Se.debug("updating table viewport",m),t==null||t.setViewport({top:Math.max(0,m.top-d),bottom:m.bottom+d})},[d,t,m]),c.useEffect(function(){var z=t.onUpdate(ne=>{v({items:ne.items.map(pe=>Kn(Kn({},pe),{},{itemName:pe.basename})),offset:ne.offset,itemCount:t.size})});return()=>{z()}},[t]),c.useEffect(function(){X.current!=null&&te(X.current),D.length>0&&N(D,!0)},[h,te,N,D]),c.useEffect(function(){if(f!=null&&tt(f)&&f.filename!=="/"){var z=setTimeout(()=>{f.isExpanded||t==null||t.setExpanded(f.filename,!0)},Vf);return()=>clearTimeout(z)}},[f,t]);var Mn=c.useCallback(T=>a(Kn(Kn({},T),{},{isDragInProgress:y!=null,dropTargetItem:f,draggedItems:y,isDropTargetValid:ln,onDragStart:F,onDragEnd:$,onDragOver:M,onDragExit:me,onDrop:B})),[$,me,M,F,B,y,f,ln,a]);return u.jsx("div",{ref:V,className:U("file-list",{"is-dragging":y!=null}),onDragOver:it,onDrop:Xe,children:u.jsx($e,{ref:I,items:h.items,itemCount:h.itemCount,offset:h.offset,onFocusChange:te,onSelect:G,onSelectionChange:N,onViewportChange:se,selectedRanges:D,renderItem:Mn,rowHeight:l,isMultiSelect:e,isDragSelect:!1,isDeselectOnClick:!1})})}var qf={name:"File Explorer",DELETE:ie.createAndAdd({id:"FILE_EXPLORER.DELETE",name:"Delete",shortcut:[w.DELETE],macShortcut:[P.CMD,w.BACKSPACE]}),RENAME:ie.createAndAdd({id:"FILE_EXPLORER.RENAME",name:"Rename",shortcut:[w.ENTER],macShortcut:[w.ENTER]})};const qo={FILE_EXPLORER:qf};var Xo=R.module("FileListItemEditor"),Xf=()=>Promise.resolve();function Zf(n){var{item:e,onCancel:t,onSubmit:i,validate:r=Xf}=n,o=c.useRef(null),[s,a]=c.useState(e.basename),[l,d]=c.useState(),[h,v]=c.useState(Promise.resolve()),m=c.useCallback(()=>{var _;(_=o.current)===null||_===void 0||_.focus()},[o]),p=c.useCallback(_=>_.stopPropagation(),[]),f=c.useCallback(()=>{h.then(()=>{i(s)}).catch(_=>Xo.info("Unable to validate name",_))},[i,s,h]);c.useEffect(function(){var C=Ue.makeCancelable(r(s));return C.then(()=>d(void 0)).catch(D=>{Ue.isCanceled(D)||d(D)}),v(C),()=>C.cancel()},[r,s]),c.useEffect(function(){m()},[m]);var g=c.useCallback(()=>{Xo.debug2("handleBlur"),f()},[f]),y=c.useCallback(_=>{var{value:C}=_.target;a(C)},[]),S=c.useCallback(_=>{_.stopPropagation();var{key:C}=_;switch(C){case"Enter":{f();break}case"Escape":{t();break}}},[t,f]);return u.jsxs("div",{className:"file-list-item-editor",children:[u.jsx("input",{type:"text",className:U("form-control file-list-item-editor-input",{"is-invalid":l}),value:s,ref:o,onBlur:g,onKeyDown:S,onChange:y,onClick:p,onDoubleClick:p,onMouseDown:p}),l&&u.jsx("div",{className:"invalid-feedback",children:"".concat(l)})]})}function Zo(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(n);e&&(i=i.filter(function(r){return Object.getOwnPropertyDescriptor(n,r).enumerable})),t.push.apply(t,i)}return t}function Ei(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Zo(Object(t),!0).forEach(function(i){Yf(n,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Zo(Object(t)).forEach(function(i){Object.defineProperty(n,i,Object.getOwnPropertyDescriptor(t,i))})}return n}function Yf(n,e,t){return(e=Qf(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Qf(n){var e=Jf(n,"string");return typeof e=="symbol"?e:e+""}function Jf(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function Ua(n){var{isMultiSelect:e=!1,focusedPath:t,showContextMenu:i=!1,onCreateFile:r,onCreateFolder:o,onCopy:s,onDelete:a,onMove:l,onRename:d,onSelect:h,onSelectionChange:v,table:m,rowHeight:p=or,validateRename:f=()=>Promise.resolve()}=n,[g,y]=c.useState(),[S,_]=c.useState([]),[C,D]=c.useState(),W=c.useCallback(B=>{_(B),v==null||v(B)},[v]),X=c.useCallback(B=>{D(B)},[]),I=c.useCallback(()=>{C&&(s==null||s(C))},[C,s]),V=c.useCallback(()=>{S.length>0&&(a==null||a(S))},[a,S]),A=c.useCallback(()=>{r==null||r()},[r]),J=c.useCallback(()=>{C&&(o==null||o(L.getPath(C.filename)))},[C,o]),ee=c.useCallback(()=>{C&&y(C)},[C]),j=c.useCallback(()=>{y(void 0)},[]),G=c.useCallback(B=>{g&&(d==null||d(g,B),y(void 0))},[d,g]),F=c.useMemo(()=>{if(g)return[];var B=[];return r&&B.push({title:"New File",description:"Create new file",action:A,group:oe.groups.medium}),o&&B.push({title:"New Folder",description:"Create new folder",action:J,group:oe.groups.medium}),s&&B.push({title:"Copy File",description:"Copy the selected file",action:I,group:oe.groups.low,disabled:C==null||tt(C)}),a&&S.length>0&&B.push({title:"Delete",description:"Delete",shortcut:qo.FILE_EXPLORER.DELETE,action:V,group:oe.groups.low}),d&&B.push({title:"Rename",description:"Rename",shortcut:qo.FILE_EXPLORER.RENAME,action:ee,group:oe.groups.low,disabled:C==null}),B},[I,V,A,J,ee,C,s,r,o,a,d,S,g]),M=c.useCallback(B=>(H(g),f(g,B)),[g,f]),$=c.useCallback(B=>{var{item:me}=B;return g&&g.filename===me.filename?u.jsx(Ui,Ei(Ei({},B),{},{children:u.jsx(Zf,{item:me,validate:M,onSubmit:G,onCancel:j})})):u.jsx(Ui,Ei({},B))},[j,G,g,M]);return u.jsxs("div",{className:"file-list-container",children:[m!=null&&u.jsx(Gf,{onMove:l,onSelect:h,onSelectionChange:W,onFocusChange:X,renderItem:$,rowHeight:p,table:m,isMultiSelect:e,focusedPath:t}),i&&u.jsx(oe,{actions:F})]})}Ua.displayName="FileListContainer";function Yo(n,e,t){return(e=eg(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function eg(n){var e=tg(n,"string");return typeof e=="symbol"?e:e+""}function tg(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class zn extends pn{constructor(e){super("Name already exists"),Yo(this,"isExistingFile",!0),Yo(this,"info",void 0),this.info=e}}function Qo(n,e,t,i,r,o,s){try{var a=n[o](s),l=a.value}catch(d){return void t(d)}a.done?e(l):Promise.resolve(l).then(i,r)}function Jo(n){return function(){var e=this,t=arguments;return new Promise(function(i,r){var o=n.apply(e,t);function s(l){Qo(o,i,r,s,a,"next",l)}function a(l){Qo(o,i,r,s,a,"throw",l)}s(void 0)})}}var rt=R.module("FileExplorer");function sr(n){var{storage:e,isMultiSelect:t=!1,focusedPath:i,onCopy:r=()=>{},onDelete:o=()=>{},onRename:s=()=>{},onCreateFile:a=()=>{},onCreateFolder:l=()=>{},onSelect:d,onSelectionChange:h,rowHeight:v=or}=n,[m,p]=c.useState([]),[f,g]=c.useState();c.useEffect(function(){var G;function F(){return M.apply(this,arguments)}function M(){return M=Jo(function*(){rt.debug("initTable"),G=Ue.makeCancelable(e.getTable(),$=>$.close());try{g(yield G)}catch($){Ue.isCanceled($)||rt.error("Unable to initialize table",$)}}),M.apply(this,arguments)}return F(),()=>{G.cancel()}},[e]);var y=c.useCallback(j=>{Ue.isCanceled(j)||rt.error(j)},[]),S=c.useCallback(()=>{rt.debug("handleCreateFile"),a()},[a]),_=c.useCallback(()=>{rt.debug("handleCreateFolder"),l()},[l]),C=c.useCallback(j=>{rt.debug("handleCopyFile",j.filename),r(j)},[r]),D=c.useCallback(j=>{rt.debug("handleDelete, pending confirmation",j),p(j)},[]),W=c.useCallback(()=>{rt.debug("handleDeleteConfirm",m),m.forEach(j=>e.deleteFile(tt(j)?L.makePath(j.filename):j.filename)),o(m),p([])},[m,o,e]),X=c.useCallback(()=>{rt.debug("handleDeleteCancel"),p([])},[]),I=c.useCallback((j,G)=>{var F=L.reducePaths(j.map(M=>tt(M)?L.makePath(M.filename):M.filename));F.forEach(M=>{var $=L.isPath(M)?"".concat(G).concat(L.getBaseName(M.substring(0,M.length-1)),"/"):"".concat(G).concat(L.getBaseName(M));e.moveFile(M,$).then(()=>{s(M,$)}).catch(y)})},[y,s,e]),V=c.useCallback((j,G)=>{var F=j.filename,M=tt(j);M&&!F.endsWith("/")&&(F="".concat(F,"/"));var $="".concat(L.getParent(F)).concat(G);M&&!$.endsWith("/")&&($="".concat($,"/")),rt.debug2("handleRename",F,$),e.moveFile(F,$).catch(y),s(F,$)},[y,s,e]),A=c.useCallback(function(){var j=Jo(function*(G,F){if(F!==G.basename){L.validateName(F);var M="".concat(L.getPath(G.filename)).concat(F);try{var $=yield e.info(M);throw new zn($)}catch(B){if(!(B instanceof rr))throw B}}});return function(G,F){return j.apply(this,arguments)}}(),[e]),J=m.length>0,ee=c.useMemo(()=>m.length===1?'Are you sure you want to delete "'.concat(m[0].filename,'"?'):"Are you sure you want to delete the selected files?",[m]);return u.jsxs("div",{className:"file-explorer",children:[f&&u.jsx(Ua,{isMultiSelect:t,focusedPath:i,showContextMenu:!0,onCopy:C,onCreateFolder:_,onCreateFile:S,onMove:I,onDelete:D,onRename:V,onSelect:d,onSelectionChange:h,rowHeight:v,table:f,validateRename:A}),u.jsx(bn,{isOpen:J,headerText:ee,bodyText:"You cannot undo this action.",onCancel:X,onConfirm:W,confirmButtonText:"Delete"})]})}sr.displayName="FileExplorer";function es(n,e,t,i,r,o,s){try{var a=n[o](s),l=a.value}catch(d){return void t(d)}a.done?e(l):Promise.resolve(l).then(i,r)}function ng(n){return function(){var e=this,t=arguments;return new Promise(function(i,r){var o=n.apply(e,t);function s(l){es(o,i,r,s,a,"next",l)}function a(l){es(o,i,r,s,a,"throw",l)}s(void 0)})}}function Et(n,e,t){return(e=ig(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function ig(n){var e=rg(n,"string");return typeof e=="symbol"?e:e+""}function rg(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var kt=R.module("NewItemModal");class Ft extends c.PureComponent{static getValidationMessage(e){return e instanceof zn&&e.info.type==="directory"?"Error: Cannot overwrite existing directory":"".concat(e)}static handleError(e){Ue.isCanceled(e)||kt.error(e)}constructor(e){super(e),Et(this,"inputRef",x.createRef()),Et(this,"cancelableValidatePromise",void 0),Et(this,"cancelableExistingItemPromise",void 0),Et(this,"pending",new ti),Et(this,"pathMap",new Map),Et(this,"isInitialLoad",!0),this.handleModalSubmit=this.handleModalSubmit.bind(this),this.handleModalOpened=this.handleModalOpened.bind(this),this.handleSelect=this.handleSelect.bind(this),this.handleChange=this.handleChange.bind(this),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleValidationError=this.handleValidationError.bind(this),this.handleOverwriteCancel=this.handleOverwriteCancel.bind(this),this.handleOverwriteConfirm=this.handleOverwriteConfirm.bind(this),this.handleExtensionChangeCancel=this.handleExtensionChangeCancel.bind(this),this.handleExtensionChangeConfirm=this.handleExtensionChangeConfirm.bind(this),this.handleBreadcrumbSelect=this.handleBreadcrumbSelect.bind(this);var{defaultValue:t}=e,i=L.hasPath(t)?L.getPath(t):"/";this.state={isSubmitting:!1,path:i,prevExtension:L.getExtension(t),showExtensionChangeModal:!1,showOverwriteModal:!1,value:L.getBaseName(t)}}componentDidUpdate(e,t){var{isOpen:i}=this.props,{isOpen:r}=e,{value:o,path:s}=this.state;!r&&i&&(this.resetValue(),this.isInitialLoad=!0),r&&i&&(!this.isInitialLoad&&(s!==t.path||o!==t.value)&&this.updateValidationStatus(s,o),this.isInitialLoad=!1)}componentWillUnmount(){this.pending.cancel(),this.cancelableValidatePromise&&this.cancelableValidatePromise.cancel(),this.cancelableExistingItemPromise&&this.cancelableExistingItemPromise.cancel()}resetValue(){var{defaultValue:e}=this.props,t=L.hasPath(e)?L.getPath(e):"/";this.setState({path:t,value:L.getBaseName(e),validationError:void 0,prevExtension:L.getExtension(e),isSubmitting:!1})}getValidationPromise(e,t){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return this.cancelableValidatePromise&&this.cancelableValidatePromise.cancel(),this.cancelableValidatePromise=Ue.makeCancelable(this.validateName(e,t,i)),this.cancelableValidatePromise}validateName(e,t,i){var r=this;return ng(function*(){L.validateName(t);var{defaultValue:o,storage:s}=r.props;if(i){var a="".concat(e).concat(t);if(a!==o)try{var l=yield s.info(a);throw new zn(l)}catch(d){if(!(d instanceof rr))throw d}}return t})()}updateValidationStatus(e,t){this.getValidationPromise(e,t).then(()=>{this.setState({validationError:void 0})}).catch(this.handleValidationError).catch(Ft.handleError)}handleModalOpened(){this.focusRenameInput()}handleModalSubmit(){this.submitModal()}handleChange(e){var{value:t}=e.target;this.setState({value:t})}handleSelect(e){if(kt.debug("handleSelect",e),e.type==="directory")this.setState({path:L.makePath(e.filename)});else{var t=e.basename,i=L.getPath(e.filename);this.setState({value:t,path:i},()=>{this.focusRenameInput()})}}handleKeyDown(e){var{key:t}=e;switch(e.stopPropagation(),t){case"Enter":{e.preventDefault(),this.submitModal();break}case"Escape":{e.preventDefault();var{onCancel:i}=this.props;i();break}}}handleValidationError(e){if(!(e instanceof pn))throw e;kt.debug("Validation error",e),this.setState({validationError:e})}handleOverwriteCancel(){this.setState({showOverwriteModal:!1,isSubmitting:!1})}handleOverwriteConfirm(){this.setState({showOverwriteModal:!1});var{onSubmit:e}=this.props,{path:t,value:i}=this.state;kt.debug("handleOverwriteConfirm",t,i),e("".concat(t).concat(i),!0)}handleExtensionChangeCancel(){kt.debug("handleExtensionChangeCancel"),this.setState(e=>{var{value:t,prevExtension:i}=e,r=L.replaceExtension(t,i);return{showExtensionChangeModal:!1,value:r}}),this.submitModal(!0)}handleExtensionChangeConfirm(){kt.debug("handleExtensionChangeConfirm"),this.setState({showExtensionChangeModal:!1}),this.submitModal(!0)}focusRenameInput(){var e=this.inputRef.current;if(e){var{type:t}=this.props,{value:i}=e,r=t==="directory"?i.length:i.lastIndexOf(".");e.focus(),e.setSelectionRange(0,r>0?r:i.length)}}submitModal(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;this.setState(t=>{var{prevExtension:i,value:r,path:o}=t,{notifyOnExtensionChange:s,type:a}=this.props;kt.debug("submitModal",i,r);var l=L.getExtension(r);return s&&!e&&i!==null&&i!==l?{isSubmitting:!1,showExtensionChangeModal:!0,newExtension:l}:(this.getValidationPromise(o,r,!0).then(d=>{var{onSubmit:h}=this.props;h("".concat(o).concat(r))}).catch(d=>{if(d instanceof zn&&a!=="directory"&&d.info.type!=="directory"){this.setState({showOverwriteModal:!0});return}throw d}).catch(d=>{throw Ue.isCanceled(d)&&this.setState({isSubmitting:!1}),d}).catch(this.handleValidationError).catch(Ft.handleError),{isSubmitting:!0,showExtensionChangeModal:!1,newExtension:void 0})})}handleBreadcrumbSelect(e){this.setState({path:e})}renderPathButtons(e){var t=e.split("/");return t.pop(),t.map((i,r)=>{for(var o="",s=0;s<r;s+=1)o+="".concat(t[s],"/");return o+="".concat(i,"/"),u.jsxs(x.Fragment,{children:[u.jsx(Q,{kind:"ghost",className:"directory-breadcrumbs",onClick:()=>this.handleBreadcrumbSelect(o),"aria-label":r===0?"Home":void 0,icon:r===0?u.jsx(le,{icon:Tl,transform:"right-1.6"}):void 0,tooltip:r===0?"Home":void 0,children:i}),"/"]},o)})}render(){var{storage:e,isOpen:t,onCancel:i,placeholder:r,title:o,type:s}=this.props,{isSubmitting:a,path:l,showExtensionChangeModal:d,showOverwriteModal:h,validationError:v,value:m,prevExtension:p,newExtension:f}=this.state,g=s==="directory",y=L.fileExtensionToString(p),S=L.fileExtensionToString(f),_=g?"Create":"Save",C=g?"New folder name":"Save file as";return u.jsxs(u.Fragment,{children:[u.jsxs(rs,{isOpen:t,toggle:i,onOpened:this.handleModalOpened,className:"modal-dialog-centered new-file-modal",children:[u.jsx(os,{toggle:i,children:o}),u.jsx(ss,{children:u.jsx("form",{children:u.jsxs("div",{className:"d-flex flex-column new-file-modal-content",children:[u.jsxs("div",{className:"flex-grow-0 mb-4",children:[u.jsx("label",{htmlFor:"file-name-input",children:C}),u.jsx("input",{id:"file-name-input",type:"text",autoComplete:"off",autoCapitalize:"none",autoCorrect:"off",spellCheck:"false",className:U("form-control",{"is-invalid":v}),value:m,placeholder:r,ref:this.inputRef,onKeyDown:this.handleKeyDown,onChange:this.handleChange}),v&&u.jsx("div",{className:"invalid-feedback",children:Ft.getValidationMessage(v)})]}),u.jsxs("div",{className:"flex-grow-0",children:[u.jsx("label",{children:"Directory: /"}),this.renderPathButtons(l)]}),u.jsx("div",{className:"flex-grow-1 file-explorer-container",children:u.jsx(sr,{onSelect:this.handleSelect,storage:e,focusedPath:l})})]})})}),u.jsxs(Os,{children:[u.jsx(Q,{kind:"secondary",onClick:i,children:"Cancel"}),u.jsx(Q,{kind:"primary",disabled:a,onClick:this.handleModalSubmit,children:_})]})]}),u.jsx(bn,{isOpen:h,headerText:"Confirm overwrite",bodyText:"File with this name already exists, are you sure you want to overwrite it?",onCancel:this.handleOverwriteCancel,onConfirm:this.handleOverwriteConfirm,cancelButtonText:"Cancel",confirmButtonText:"Overwrite"}),u.jsx(bn,{isOpen:d,headerText:"Confirm extension change",bodyText:'Are you sure you want to change extension from "'.concat(y,'" to "').concat(S,'"?'),onCancel:this.handleExtensionChangeCancel,onConfirm:this.handleExtensionChangeConfirm,cancelButtonText:'Keep "'.concat(y,'"'),confirmButtonText:'Use "'.concat(S,'"')})]})}}Et(Ft,"propTypes",{isOpen:b.bool,title:b.string.isRequired,defaultValue:b.string,type:b.oneOf(["file","directory"]).isRequired,onSubmit:b.func,onCancel:b.func,placeholder:b.string,storage:b.shape({}).isRequired,notifyOnExtensionChange:b.bool});Et(Ft,"defaultProps",{isOpen:!1,defaultValue:"/",notifyOnExtensionChange:!1,placeholder:"",onSubmit:(n,e)=>{},onCancel:()=>{}});function og(n){var{createFile:e,createFolder:t,onSearchChange:i,defaultSearchText:r=""}=n;return u.jsxs("div",{className:"file-explorer-toolbar",children:[u.jsxs("div",{className:"file-explorer-toolbar-buttons",children:[u.jsx(Q,{kind:"ghost",icon:ms,tooltip:"New notebook",onClick:e,"aria-label":"New notebook"}),u.jsx(Q,{kind:"ghost",icon:Ol,tooltip:"New folder",onClick:t,"aria-label":"New folder"})]}),i&&u.jsx("div",{className:"file-explorer-toolbar-search",children:u.jsx(js,{value:r,onChange:i,placeholder:"Search by name"})})]})}function ts(n,e,t,i,r,o,s){try{var a=n[o](s),l=a.value}catch(d){return void t(d)}a.done?e(l):Promise.resolve(l).then(i,r)}function sg(n){return function(){var e=this,t=arguments;return new Promise(function(i,r){var o=n.apply(e,t);function s(l){ts(o,i,r,s,a,"next",l)}function a(l){ts(o,i,r,s,a,"throw",l)}s(void 0)})}}function Ba(n,e,t){return(e=ag(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function ag(n){var e=lg(n,"string");return typeof e=="symbol"?e:e+""}function lg(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var jt=R.module("FileExplorerPanel"),dg=(n,e)=>{var t=Ku(n),i=hi(n,e.localDashboardId),{session:r,config:o}=i??{},s=o==null?void 0:o.type;return{fileStorage:t,language:s,session:r}},ug=_n(dg,null,null,{forwardRef:!0});function hg(n){var e=n;return e!=null&&typeof e.button=="number"}class on extends x.Component{static handleError(e){jt.error(e)}static isFocusEvent(e){return hg(e)?e.detail>=2:!0}constructor(e){super(e),this.handleFileSelect=this.handleFileSelect.bind(this),this.handleCopyFile=this.handleCopyFile.bind(this),this.handleCreateFile=this.handleCreateFile.bind(this),this.handleCreateDirectory=this.handleCreateDirectory.bind(this),this.handleCreateDirectoryCancel=this.handleCreateDirectoryCancel.bind(this),this.handleCreateDirectorySubmit=this.handleCreateDirectorySubmit.bind(this),this.handleDelete=this.handleDelete.bind(this),this.handleRename=this.handleRename.bind(this),this.handleSessionOpened=this.handleSessionOpened.bind(this),this.handleSessionClosed=this.handleSessionClosed.bind(this),this.handleShow=this.handleShow.bind(this),this.handleSelectionChange=this.handleSelectionChange.bind(this);var{session:t,language:i}=e;this.state={isShown:!1,language:i,session:t,showCreateFolder:!1,focusedFilePath:"/"}}componentDidMount(){this.isHidden()||this.setState({isShown:!0})}handleCreateFile(){var{glEventHub:e}=this.props,{session:t,language:i}=this.state,r={language:i,value:""};jt.debug("handleCreateFile",t,i,r),e.emit(Oe.CREATE_NOTEBOOK,t,i,r)}handleCreateDirectory(){this.setState({showCreateFolder:!0})}handleCreateDirectoryCancel(){jt.debug("handleCreateDirectoryCancel"),this.setState({showCreateFolder:!1})}handleCreateDirectorySubmit(e){jt.debug("handleCreateDirectorySubmit",e),this.setState({showCreateFolder:!1});var{fileStorage:t}=this.props;t.createDirectory(e).catch(on.handleError)}handleCopyFile(e){var t=this;return sg(function*(){var{fileStorage:i}=t.props;if(tt(e)){jt.error("Invalid item in handleCopyItem",e);return}var r=yield L.getUniqueCopyFileName(i,e.filename);yield i.copyFile(e.filename,r)})()}handleDelete(e){var{glEventHub:t}=this.props;e.forEach(i=>{t.emit(Oe.CLOSE_FILE,{id:i.filename,itemName:i.filename})})}handleSelectionChange(e){var t="/";e.length===1&&(e[0].type==="directory"?t=L.makePath(e[0].filename):t=L.getPath(e[0].filename)),this.setState({focusedFilePath:t})}handleFileSelect(e,t){if(jt.debug("fileSelect",e),e.type!=="directory"){var i=on.isFocusEvent(t),r={id:e.filename,itemName:e.filename},{glEventHub:o}=this.props,{session:s,language:a}=this.state,l={value:null,language:a};o.emit(Oe.SELECT_NOTEBOOK,s,a,l,r,i)}}handleRename(e,t){var{glEventHub:i}=this.props;jt.debug("handleRename",e,t),i.emit(Oe.RENAME_FILE,e,t)}handleSessionOpened(e,t){var{language:i}=t;this.setState({session:e,language:i})}handleSessionClosed(){this.setState({session:void 0,language:void 0})}handleShow(){this.setState({isShown:!0})}isHidden(){var{glContainer:e}=this.props,{isHidden:t}=e;return t}render(){var{fileStorage:e,glContainer:t,glEventHub:i}=this.props,{isShown:r,showCreateFolder:o,focusedFilePath:s}=this.state;return u.jsxs(di,{className:"file-explorer-panel",componentPanel:this,glContainer:t,glEventHub:i,onSessionOpen:this.handleSessionOpened,onSessionClose:this.handleSessionClosed,onShow:this.handleShow,children:[u.jsx(og,{createFile:this.handleCreateFile,createFolder:this.handleCreateDirectory}),r&&u.jsx(sr,{isMultiSelect:!0,storage:e,onCopy:this.handleCopyFile,onCreateFile:this.handleCreateFile,onCreateFolder:this.handleCreateDirectory,onDelete:this.handleDelete,onRename:this.handleRename,onSelect:this.handleFileSelect,onSelectionChange:this.handleSelectionChange}),u.jsx(Ft,{isOpen:o,type:"directory",title:"Create New Folder",storage:e,onSubmit:this.handleCreateDirectorySubmit,onCancel:this.handleCreateDirectoryCancel,defaultValue:s})]})}}Ba(on,"COMPONENT","FileExplorerPanel");Ba(on,"TITLE","File Explorer");var Lb=ug(on);function Cn(n,e,t){return(e=cg(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function cg(n){var e=mg(n,"string");return typeof e=="symbol"?e:e+""}function mg(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var ns=R.module("LogPanel");class mi extends c.PureComponent{constructor(e){super(e),Cn(this,"isBottomVisible",void 0),Cn(this,"logView",void 0),this.handleResize=this.handleResize.bind(this),this.handleShow=this.handleShow.bind(this),this.handleHide=this.handleHide.bind(this),this.handleSessionOpened=this.handleSessionOpened.bind(this),this.handleSessionClosed=this.handleSessionClosed.bind(this),this.isBottomVisible=!0,this.logView=null;var{session:t}=this.props;this.state={session:t}}handleResize(){this.updateDimensions()}handleShow(){this.updateDimensions(),this.logView&&(this.logView.triggerFindWidget(),this.isBottomVisible&&this.logView.scrollToBottom())}handleHide(){this.logView&&(this.isBottomVisible=this.logView.isBottomVisible())}handleSessionOpened(e){ns.debug("Session opened",[e]),this.setState({session:e})}handleSessionClosed(e){ns.debug("Session closed",e)}updateDimensions(){this.logView&&this.logView.updateDimensions()}render(){var{glContainer:e,glEventHub:t}=this.props,{session:i}=this.state;return u.jsxs(di,{componentPanel:this,glContainer:e,glEventHub:t,onResize:this.handleResize,onHide:this.handleHide,onShow:this.handleShow,onSessionOpen:this.handleSessionOpened,onSessionClose:this.handleSessionClosed,children:[i==null&&u.jsx("div",{className:"log-panel-disconnected-message",children:"Waiting for session connection"}),i!=null&&u.jsx(ue,{session:i,ref:r=>{this.logView=r}})]})}}Cn(mi,"defaultProps",{session:null});Cn(mi,"COMPONENT","LogPanel");Cn(mi,"TITLE","Log");var vg=(n,e)=>{var t;return{session:(t=hi(n,e.localDashboardId))===null||t===void 0?void 0:t.session}},Rb=_n(vg,null,null,{forwardRef:!0})(mi);export{Ds as $,sn as A,Q as B,ce as C,ri as D,Bl as E,ii as F,oe as G,oi as H,$e as I,qt as J,w as K,bn as L,P as M,js as N,si as O,Pn as P,Os as Q,Qe as R,de as S,re as T,As as U,ni as V,Ki as W,Eg as X,Eu as Y,zi as Z,Pg as _,Cb as a,vv as a$,Ls as a0,Is as a1,tu as a2,Vn as a3,Mu as a4,$s as a5,Fs as a6,Rs as a7,Tg as a8,Og as a9,wg as aA,vr as aB,Lh as aC,Xi as aD,Xg as aE,Bh as aF,Kh as aG,E as aH,Qg as aI,mb as aJ,Tv as aK,mv as aL,cv as aM,gb as aN,Ci as aO,Ea as aP,sv as aQ,ab as aR,Bm as aS,ba as aT,Lm as aU,Y as aV,tr as aW,pa as aX,Ca as aY,Fn as aZ,fa as a_,xg as aa,ct as ab,he as ac,et as ad,K as ae,He as af,zg as ag,Gg as ah,qi as ai,Vg as aj,qs as ak,qg as al,an as am,Ws as an,Mh as ao,Dh as ap,xh as aq,Vs as ar,Th as as,Ph as at,Kg as au,Oh as av,Wg as aw,Ih as ax,zs as ay,Vr as az,Gm as b,Nb as b$,yb as b0,Jg as b1,ib as b2,tb as b3,ob as b4,hb as b5,we as b6,cb as b7,Sa as b8,ga as b9,Da as bA,Ee as bB,Qn as bC,Ha as bD,li as bE,Ma as bF,Rv as bG,Na as bH,ka as bI,tn as bJ,ja as bK,nn as bL,Gp as bM,Zn as bN,pf as bO,ue as bP,$i as bQ,Ia as bR,Jt as bS,Vi as bT,L as bU,rr as bV,Ab as bW,er as bX,fb as bY,Om as bZ,ih as b_,wb as ba,bb,Im as bc,Mm as bd,Dm as be,km as bf,Yg as bg,Wm as bh,_a as bi,Ym as bj,lb as bk,db as bl,ub as bm,Sb as bn,eb as bo,rb as bp,nb as bq,sb as br,pb as bs,_b as bt,zt as bu,Jm as bv,Ce as bw,bp as bx,k as by,Ot as bz,_u as c,Rb as c0,jb as c1,Lb as c2,id as c3,qu as c4,Gu as c5,Ag as c6,jg as c7,Ng as c8,Lg as c9,Me as cA,Ft as cB,Ku as cC,Mg as cD,hi as cE,tt as cF,zu as cG,Re as cH,kb as cI,Mb as cJ,_g as cK,ke as cL,Cg as cM,pi as cN,Xl as cO,pn as cP,Xu as ca,Zu as cb,Yu as cc,Qu as cd,ch as ce,bd as cf,yg as cg,gg as ch,Ss as ci,di as cj,Ib as ck,It as cl,st as cm,Ug as cn,ti as co,Ob as cp,kg as cq,xb as cr,Db as cs,Tb as ct,Eb as cu,Ig as cv,Dg as cw,Pb as cx,Hg as cy,Oe as cz,Fg as d,xm as e,Bg as f,Lu as g,Rg as h,Ks as i,$g as j,Sg as k,Td as l,En as m,Od as n,Ps as o,Es as p,xd as q,ie as r,vb as s,Id as t,Au as u,Ts as v,bs as w,bg as x,Ue as y,Wi as z};
|
|
20
|
-
//# sourceMappingURL=LogPanel-
|
|
20
|
+
//# sourceMappingURL=LogPanel-9olfEJUH.js.map
|