@deephaven/embed-widget 1.9.0 → 1.9.1-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/assets/{App-CFlr91GL.js → App-CV0gpAwo.js} +2 -2
- package/build/assets/{App-CFlr91GL.js.map → App-CV0gpAwo.js.map} +1 -1
- package/build/assets/{Chart-Cr3L76W-.js → Chart-BRD5mdU1.js} +2 -2
- package/build/assets/{Chart-Cr3L76W-.js.map → Chart-BRD5mdU1.js.map} +1 -1
- package/build/assets/{IrisGrid-BfxM49cL.js → IrisGrid-CGPmoqEH.js} +2 -2
- package/build/assets/{IrisGrid-BfxM49cL.js.map → IrisGrid-CGPmoqEH.js.map} +1 -1
- package/build/assets/IrisGridThemeProvider-Cm1ftf4E.css +1 -0
- package/build/assets/{IrisGridThemeProvider-DiJESSgt.js → IrisGridThemeProvider-Cz6mM6Fn.js} +4 -4
- package/build/assets/IrisGridThemeProvider-Cz6mM6Fn.js.map +1 -0
- package/build/assets/{LocalWorkspaceStorage-BRRChx67.js → LocalWorkspaceStorage-CtMdxBaw.js} +2 -2
- package/build/assets/{LocalWorkspaceStorage-BRRChx67.js.map → LocalWorkspaceStorage-CtMdxBaw.js.map} +1 -1
- package/build/assets/{LogPanel-BbETU5h9.js → LogPanel-Ah0favpj.js} +2 -2
- package/build/assets/{LogPanel-BbETU5h9.js.map → LogPanel-Ah0favpj.js.map} +1 -1
- package/build/assets/{MarkdownEditor-BcCyroMG.js → MarkdownEditor-BUpqmmL5.js} +2 -2
- package/build/assets/{MarkdownEditor-BcCyroMG.js.map → MarkdownEditor-BUpqmmL5.js.map} +1 -1
- package/build/assets/{MarkdownNotebook-BkH4RAdi.js → MarkdownNotebook-CMQPBWeW.js} +2 -2
- package/build/assets/{MarkdownNotebook-BkH4RAdi.js.map → MarkdownNotebook-CMQPBWeW.js.map} +1 -1
- package/build/assets/index-BhYcqBU-.js +84 -0
- package/build/assets/index-BhYcqBU-.js.map +1 -0
- package/build/assets/{index-BzsGKKTc.js → index-CRKnUt4w.js} +5 -5
- package/build/assets/{index-BzsGKKTc.js.map → index-CRKnUt4w.js.map} +1 -1
- package/build/assets/{index-CAyxGtoW.js → index-DDfPR1jK.js} +3 -3
- package/build/assets/{index-CAyxGtoW.js.map → index-DDfPR1jK.js.map} +1 -1
- package/build/index.html +1 -1
- package/package.json +17 -17
- package/build/assets/IrisGridThemeProvider-B-lFNKEF.css +0 -1
- package/build/assets/IrisGridThemeProvider-DiJESSgt.js.map +0 -1
- package/build/assets/index-8E-zZgSR.js +0 -84
- package/build/assets/index-8E-zZgSR.js.map +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./Plot-D1YMDgMj.js","./Plotly-Dr_nndVR.js","./plotly-DLXEvtCz.js","./helpers-BosuxZz1.js","./vendor-DDL65YSs.js","./vendor-CdNlUFKS.css"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{ao as Ya,a as R,aP as as,T as Ja,z as Qa,X as el,Y as tl,V as nl,a4 as rl,O as il,a8 as ol,d as ls,G as ds,e as us,q as sl,aQ as hs,aR as al,aS as ll,L as _n,ac as dl,_ as ul,aT as cs,t as ms,Z as hl,aU as cl,u as L,aO as ml,aK as ps,aL as pl,f as vs,n as vl,aM as Or,aV as fl,aW as hi,aX as gl,aY as bl,aZ as yl,a_ as Cl,v as wl,k as fs,aH as Sl,h as fr,aC as _l,a$ as El,b0 as ci,aF as Pl,b1 as mi,b2 as gs,b3 as Tl,aw as Ol,b4 as xl,b5 as Il,b6 as Dl,b7 as Ml,b8 as kl,b9 as jl}from"./index-CAyxGtoW.js";import{r as c,ag as En,bo as nr,J as O,bE as bs,bF as xr,D as u,H as Nl,G as $,R as Gr,bq as Al,I as le,C as ct,bG as Ll,E as ys,af as qt,bH as Rl,bI as Fl,bJ as Hl,bB as Ir,_ as $l,bK as T,bL as pi,bD as ae,N as Cs,L as ws,bM as Ul,bC as Pn,by as Qt,bd as Ee,bN as Bl,bg as vi,bO as Kl,bP as fi,bf as ze,bQ as Ss,bR as Wl,bz as We,bA as Ft,bS as gi,be as zl,bx as Vl,bT as gn}from"./vendor-DDL65YSs.js";var Gl=Object.freeze([]),Wf=new Map,_s=()=>{};function zf(n){return Array.isArray(n)?n:[n]}function Vf(){for(var n=arguments.length,e=new Array(n),t=0;t<n;t++)e[t]=arguments[t];return e.filter(r=>r!=null)}function ql(n,e,t){return(e=Xl(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Xl(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 r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class bi extends Error{constructor(){super(...arguments),ql(this,"isCanceled",!0)}}function Yl(n,e,t){return(e=Jl(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Jl(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 r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class ed extends Error{constructor(){super(...arguments),Yl(this,"isClipboardPermissionsDeniedError",!0)}}function td(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=rd(n,"string");return typeof e=="symbol"?e:e+""}function rd(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class gr extends Error{constructor(){super(...arguments),td(this,"isClipboardUnavailableError",!0)}}function id(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 r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class Es extends Error{constructor(){super(...arguments),id(this,"isPermissionUnsupported",!0)}}function yi(n,e,t,r,i,s,o){try{var a=n[s](o),l=a.value}catch(d){return void t(d)}a.done?e(l):Promise.resolve(l).then(r,i)}function ad(n){return function(){var e=this,t=arguments;return new Promise(function(r,i){var s=n.apply(e,t);function o(l){yi(s,r,i,o,a,"next",l)}function a(l){yi(s,r,i,o,a,"throw",l)}o(void 0)})}}function Ci(n){return Dr.apply(this,arguments)}function Dr(){return Dr=ad(function*(n){try{var e=n;return(yield navigator.permissions.query({name:e})).state}catch(t){throw t instanceof TypeError?new Es:t}}),Dr.apply(this,arguments)}function wi(n,e,t,r,i,s,o){try{var a=n[s](o),l=a.value}catch(d){return void t(d)}a.done?e(l):Promise.resolve(l).then(r,i)}function Ps(n){return function(){var e=this,t=arguments;return new Promise(function(r,i){var s=n.apply(e,t);function o(l){wi(s,r,i,o,a,"next",l)}function a(l){wi(s,r,i,o,a,"throw",l)}o(void 0)})}}function ld(n){return Mr.apply(this,arguments)}function Mr(){return Mr=Ps(function*(n){var{clipboard:e}=navigator;if(e!==void 0)try{return yield navigator.clipboard.writeText(n)}catch{}dd(n)}),Mr.apply(this,arguments)}function dd(n){var e=document.activeElement,t=document.createElement("textarea");t.value=n,document.body.appendChild(t),t.focus(),t.select();var r=document.execCommand("copy");if(document.body.removeChild(t),e instanceof HTMLElement&&e.focus(),!r)throw new Error("Unable to execute copy command")}function Gf(){return kr.apply(this,arguments)}function kr(){return kr=Ps(function*(){try{var{clipboard:n}=navigator;if(n===void 0)throw new gr;var e=yield Ci("clipboard-read");if(e==="granted"){var t=yield n.readText();return t}if(e==="prompt"){try{yield n.readText()}catch{}if(e=yield Ci("clipboard-read"),e==="granted"){var r=yield n.readText();return r}}if(e==="prompt"||e==="denied")throw new ed}catch(i){throw i instanceof Es?new gr:i}throw new gr}),kr.apply(this,arguments)}var ln;function Ut(n,e,t){return(e=ud(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function ud(n){var e=hd(n,"string");return typeof e=="symbol"?e:e+""}function hd(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var cd="table_",Ts="column_",md=new Set(["in","not","i","ii","k"]),pd=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"]),vd=/[^a-zA-Z0-9_$\-+@]/g,fd=/[^A-Za-z0-9_$]/g,gd=/^[a-zA-Z_$][a-zA-Z0-9_$\-+@]*$/,bd=/[^a-zA-Z0-9_]/g;function yd(n){return n.replace(/[ -]/g,"_")}function Cd(n){return n.replace(/\s/g,"_")}class ot{}ln=ot;Ut(ot,"legalize",(n,e,t,r,i,s)=>{var o=e(n.trim());return i&&(md.has(o)||pd.has(o))&&(o=t+o),o=o.replace(r,""),o?(/^[0-9-]/.test(o)&&(o=t+o),o):t+s});Ut(ot,"legalizeTableName",n=>ln.legalize(n,Cd,cd,vd,!1,0));Ut(ot,"makeVariableName",n=>ln.legalizeTableName(n).replace(bd,"_"));Ut(ot,"legalizeColumnNames",n=>{var e=[];return n.forEach((t,r)=>{var i=ln.legalizeColumnName(t,r);e.includes(i)&&(i=Ts+r),e.push(i)}),e});Ut(ot,"legalizeColumnName",function(n){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return ln.legalize(n,yd,Ts,fd,!0,e)});Ut(ot,"isValidTableName",n=>gd.test(n));Ut(ot,"isValidColumnName",n=>ln.legalizeColumnName(n)===n);class Os extends CustomEvent{constructor(e,t){super(e,t)}}class He{static makeCancelable(e,t){var r=!1,i,s,o=new Promise((a,l)=>{s=l,Promise.resolve(e).then(d=>{r?t&&t(d):(i=d,a(d))}).catch(d=>l(d))});return o.cancel=()=>{r=!0,s(new bi),i!=null&&t&&t(i)},o}static isCanceled(e){return e instanceof bi}static isTimedOut(e){return e instanceof Ya}static withTimeout(e,t){return new Promise((r,i)=>{setTimeout(()=>{try{r(t())}catch(s){i(s)}},e)})}}function Si(n,e,t){return(e=wd(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function wd(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 r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class rr{constructor(){Si(this,"pending",[]),Si(this,"resolved",[])}add(e,t){var r=He.makeCancelable(e,t);return this.pending.push(r),r.then(()=>{this.resolve(r)},()=>{this.resolve(r)}),r}remove(e){for(var t=0;t<this.pending.length;t+=1)if(this.pending[t]===e){this.pending.splice(t,1);return}}resolve(e){this.remove(e),this.resolved.push(e)}cancel(){for(var e=[...this.pending,...this.resolved],t=0;t<e.length;t+=1)e[t].cancel();this.pending=[],this.resolved=[]}}function qf(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 Ze{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(!Ze.isValidRange(e))throw new Error("Invalid range! ".concat(e))}static isSelected(e,t){for(var r=0;r<e.length;r+=1){var i=e[r],s=i[0],o=i[1];if(s<=t&&t<=o)return!0}return!1}static selectRange(e,t){for(var[r,i]=t,s=[...e],o=s.length-1;o>=0;o-=1){var a=s[o],l=a[0],d=a[1];if(l<=r&&i<=d)return s;r<=d&&l<=i&&(r=Math.min(r,l),i=Math.max(i,d),s.splice(o,1))}return s.push([r,i]),s}static deselectRange(e,t){for(var[r,i]=t,s=[...e],o=s.length-1;o>=0;o-=1){var a=s[o],l=a[0],d=a[1];if(!(i<l||d<r))if(l<r&&i<d){s[o]=[l,r-1],s.splice(o+1,0,[i+1,d]);break}else r<=l&&d<=i?s.splice(o,1):l<r?s[o]=[l,r-1]:s[o]=[i+1,d]}return s}static count(e){return e.reduce((t,r)=>t+(r[1]-r[0]+1),0)}static getItemsInRanges(e,t){return t.reduce((r,i)=>{for(var s=[...r],o=i[0];o<=i[1];o+=1)s.push(e[o]);return s},[])}}function*Xf(n,e){for(var t=n;t<=e;++t)yield t}var Zf=" ";class _d{static join(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"and";if(e==null||e.length===0)return"";if(e.length===1)return e[0];if(e.length===2)return"".concat(e[0]," ").concat(t," ").concat(e[1]);var r=e.slice(0,e.length-1).join(", "),i=e[e.length-1];return"".concat(r,", ").concat(t," ").concat(i)}static toLower(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;if(e==null){if(t)return"";throw new Error("Null string passed in to TextUtils.toLower")}return e.toLowerCase()}static sort(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;return e<t?r?-1:1:e>t?r?1:-1:0}static pluralize(e,t,r){return e===1?t:r??"".concat(t,"s")}}function xs(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=Pd(n,"string");return typeof e=="symbol"?e:e+""}function Pd(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class dn{static formatElapsedTime(e){if(typeof e!="number"||!Number.isInteger(e))throw new Error("".concat(e," is not a number that can be expressed as a formatted time"));var t=Math.floor(e/3600),r=Math.floor(e%3600/60),i=e%60;return"".concat(t>0?"".concat(t,"h "):"")+"".concat(r>0||t>0?"".concat(r,"m "):"")+"".concat(e>=60?"".concat(i,"s").padStart(3,"0"):"".concat(i,"s"))}static formatTime(e){if(typeof e!="number"||!Number.isInteger(e)||e<0)throw new Error("".concat(e," is not a number that can be expressed as a formatted time"));var t=String(Math.floor(e/(60*60))).padStart(2,"0"),r=e%(60*60),i=String(Math.floor(r/60)).padStart(2,"0"),s=r%60,o=String(Math.ceil(s)).padStart(2,"0");return"".concat(t,":").concat(i,":").concat(o)}static isTimeString(e){return new RegExp(dn.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])}}xs(dn,"TIME_PATTERN","([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]");xs(dn,"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 Td(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=xd(n,"string");return typeof e=="symbol"?e:e+""}function xd(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class bn extends Error{constructor(){super(...arguments),Td(this,"isInvalid",!0)}}function Is(){var n=c.useRef(!1);return c.useEffect(()=>(n.current=!0,()=>{n.current=!1}),[]),n}function _i(n,e,t,r,i,s,o){try{var a=n[s](o),l=a.value}catch(d){return void t(d)}a.done?e(l):Promise.resolve(l).then(r,i)}function Id(n){return function(){var e=this,t=arguments;return new Promise(function(r,i){var s=n.apply(e,t);function o(l){_i(s,r,i,o,a,"next",l)}function a(l){_i(s,r,i,o,a,"throw",l)}o(void 0)})}}var Dd=R.module("useAsyncInterval");function Md(n,e){var t=Is(),r=c.useRef(0),i=c.useRef(0),s=c.useRef(null),o=c.useCallback(Id(function*(){var a=Date.now();i.current+=1;var l=s.current==null?e:a-s.current;s.current=a;try{yield n()}catch(p){Dd.error("A tick error occurred:",p)}if(t.current){l+=Date.now()-s.current;var d=Math.max(0,l-e),h=Math.max(0,e-d);r.current=window.setTimeout(o,h)}}),[n,t,e]);c.useEffect(()=>(s.current=null,o(),()=>{window.clearTimeout(r.current)}),[e,o])}function Tn(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 kd(n,e){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},{leading:r=!1,trailing:i=!0,maxWait:s}=t,o=c.useMemo(()=>En(n,e,s!=null?{leading:r,trailing:i,maxWait:s}:{leading:r,trailing:i}),[n,e,r,i,s]);return c.useEffect(()=>()=>o.cancel(),[o]),o}function jd(n){var e=c.useRef();return c.useEffect(function(){e.current=n}),e.current}function Nd(n,e,t){var r=c.useRef(t),i=c.useRef(n);i.current=n;var s=c.useMemo(()=>nr(function(){return i.current(...arguments)},e,r.current),[e]);return c.useEffect(()=>()=>{var o,a;(o=(a=r.current)===null||a===void 0?void 0:a.flushOnUnmount)!==null&&o!==void 0&&o?s.flush():s.cancel()},[s]),s}function Ds(n){var e=c.useRef(null);return c.useEffect(function(){n&&(typeof n=="function"?n(e.current):n.current=e.current)}),e}function Ei(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function bt(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Ei(Object(t),!0).forEach(function(r){Xt(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Ei(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function Xt(n,e,t){return(e=Ad(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Ad(n){var e=Ld(n,"string");return typeof e=="symbol"?e:e+""}function Ld(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var Pi="popper",Rd={placement:"bottom-end",modifiers:{preventOverflow:{boundariesElement:"scrollParent",fn:(n,e)=>{var t,r,i=(t=bs.Defaults.modifiers)===null||t===void 0||(t=t.preventOverflow)===null||t===void 0||(r=t.fn)===null||r===void 0?void 0:r.call(t,n,e);return i==null?n:(i.styles.maxHeight="".concat(document.documentElement.clientHeight-n.offsets.popper.top-2*e.padding,"px"),i??n)}},flip:{enabled:!1}}};class ir extends c.Component{constructor(e){super(e),Xt(this,"element",void 0),Xt(this,"container",void 0),Xt(this,"nodeRef",O.createRef()),Xt(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=O.createRef(),this.rAF=0;var{isShown:t}=this.props;this.state={show:t,popper:null}}componentDidUpdate(e){var{isShown:t}=this.props,{popper:r}=this.state;e.isShown!==t&&(cancelAnimationFrame(this.rAF),this.rAF=window.requestAnimationFrame(()=>{t?this.show():this.hide()})),r&&r.scheduleUpdate()}componentWillUnmount(){this.destroyPopper(!1)}getVisibleElement(e){return e==null||e.clientHeight>0||e.clientWidth>0?e:this.getVisibleElement(e.parentElement)}initPopper(){var e,t,{popper:r}=this.state,{closeOnBlur:i,referenceObject:s}=this.props;if(!r&&this.container.current!==null){var{options:o,keepInParent:a}=this.props,l=a?Rd:{placement:"auto",modifiers:{preventOverflow:{boundariesElement:"viewport"}}},d=bt(bt(bt({},l),o),{},{modifiers:bt(bt(bt({},l.modifiers),o.modifiers),{},{preventOverflow:bt(bt({},(e=l.modifiers)===null||e===void 0?void 0:e.preventOverflow),(t=o.modifiers)===null||t===void 0?void 0:t.preventOverflow)})});document.body.appendChild(this.element);var h=this.getVisibleElement(this.container.current);h==null&&(h=this.container.current);var p=new bs(s||h,this.element,d);p.scheduleUpdate(),cancelAnimationFrame(this.rAF),this.rAF=window.requestAnimationFrame(()=>{if(i){var m=this.element.querySelector(".".concat(Pi));m instanceof HTMLElement&&!m.contains(document.activeElement)&&m.focus()}}),xr.flushSync(()=>{this.setState({popper:p})})}}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(),xr.flushSync(()=>{this.setState({show:!0})})}hide(){this.setState({show:!1})}scheduleUpdate(){var{popper:e}=this.state;e&&e.scheduleUpdate()}handleBlur(e){var{closeOnBlur:t,onBlur:r}=this.props;e.relatedTarget instanceof HTMLElement&&(this.element.contains(e.relatedTarget)||(r==null||r(e),t&&this.hide()))}handleEnter(){var{onEntered:e}=this.props;e()}handleExit(){var{onExited:e}=this.props,{show:t}=this.state;t||this.destroyPopper(),e()}renderContent(){var{className:e,children:t,timeout:r,interactive:i,closeOnBlur:s}=this.props,{show:o}=this.state;return u.jsx(as,{isPortal:!0,children:u.jsx(Nl,{in:o,timeout:r,classNames:"popper-transition",onEntered:this.handleEnter,onExited:this.handleExit,nodeRef:this.nodeRef,children:u.jsx("div",{ref:this.nodeRef,onClick:a=>{a.stopPropagation()},onKeyDown:a=>{a.key==="Escape"&&this.hide()},className:$(Pi,{interactive:i},e),onBlur:this.handleBlur,tabIndex:s?-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&&Gr.createPortal(this.renderContent(),this.element)})}}Xt(ir,"defaultProps",{options:{},className:"",timeout:Ja.transitionMs,onEntered(){},onExited(){},onBlur(){},isShown:!1,interactive:!1,closeOnBlur:!1,keepInParent:!1,referenceObject:null,"data-testid":void 0});var jr;function Ti(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function Fd(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Ti(Object(t),!0).forEach(function(r){Ye(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Ti(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function Ye(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=$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 r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var Ud=R.module("Tooltip");class ie extends c.Component{static handleHidden(){ie.shownTooltipCount-=1,ie.shownTooltipCount===0&&(ie.lastHiddenTime=Date.now())}static handleShown(){ie.shownTooltipCount+=1}constructor(e){super(e),Ye(this,"container",void 0),Ye(this,"popper",void 0),Ye(this,"parent",void 0),Ye(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=O.createRef(),this.popper=O.createRef(),this.parent=null,this.timer=null,this.state={isShown:!1}}componentDidMount(){this.startListening();var{timeout:e}=this.props;e===0&&this.show()}componentDidUpdate(e,t){var{isShown:r}=t,{isShown:i}=this.state;i!==r&&(i?ie.handleShown():ie.handleHidden())}componentWillUnmount(){this.stopListening(),this.stopListeningWindow(),this.stopTimer();var{isShown:e}=this.state;e&&ie.handleHidden()}startListening(){if(!this.container.current||!this.container.current.parentElement){Ud.error("Tooltip doesn't have a container or a parent set!");return}this.parent=this.container.current.parentElement,this.parent.addEventListener("mousemove",this.handleMouseMove),this.parent.addEventListener("mouseleave",this.handleMouseLeave),this.parent.addEventListener("mousedown",this.stopShowingTooltip)}stopListening(){this.parent&&(this.parent.removeEventListener("mousemove",this.handleMouseMove),this.parent.removeEventListener("mouseleave",this.handleMouseLeave),this.parent.removeEventListener("mousedown",this.stopShowingTooltip))}startListeningWindow(){window.addEventListener("mousemove",this.handleWindowMouseMove,!0),window.addEventListener("contextmenu",this.stopShowingTooltip,!0),window.addEventListener("wheel",this.handleWheel)}stopListeningWindow(){window.removeEventListener("mousemove",this.handleWindowMouseMove,!0),window.removeEventListener("contextmenu",this.stopShowingTooltip,!0),window.removeEventListener("wheel",this.handleWheel)}handleMouseMove(){this.startTimer()}handleWheel(){var{isShown:e}=this.state;this.popper.current&&this.parent&&e&&!this.popper.current.element.matches(":hover")&&!this.parent.matches(":hover")&&(this.stopTimer(),this.hide())}handleMouseLeave(){var{isShown:e}=this.state;this.stopTimer();var{interactive:t}=this.props;!t&&e&&this.hide()}handleTimeout(){this.show()}handleWindowMouseMove(e){var t=e.clientX,r=e.clientY,{isShown:i}=this.state;if(!(!this.popper.current||!this.parent)){var s=this.popper.current.element.getBoundingClientRect(),o=this.parent.getBoundingClientRect();t>=s.left&&t<=s.left+s.width&&r>=s.top&&r<=s.top+s.height?this.handleMouseMove():t>=o.left&&t<=o.left+o.width&&r>=o.top&&r<=o.top+o.height?this.handleMouseMove():i&&(this.stopTimer(),this.hide())}}startTimer(){this.stopTimer();var{timeout:e,reshowTimeout:t}=this.props,r=e;(ie.shownTooltipCount>0||Date.now()-ie.lastHiddenTime<ie.triggerReshowThreshold)&&(r=t),this.timer=window.setTimeout(this.handleTimeout,r)}stopTimer(){this.timer!=null&&(clearTimeout(this.timer),this.timer=null)}show(){var{isShown:e}=this.state;if(this.stopTimer(),!e){var t;(t=this.popper.current)===null||t===void 0||t.show(),xr.flushSync(()=>{this.setState({isShown:!0})});var{interactive:r}=this.props;r&&this.startListeningWindow()}}hide(){var e;(e=this.popper.current)===null||e===void 0||e.hide(),this.stopListeningWindow()}update(){var e;(e=this.popper.current)===null||e===void 0||e.scheduleUpdate()}handleExited(){this.setState({isShown:!1});var{onExited:e}=this.props;e()}stopShowingTooltip(){var{isShown:e}=this.state;this.stopTimer(),e&&this.hide()}render(){var{interactive:e,children:t,referenceObject:r,popperClassName:i,"data-testid":s,onEntered:o}=this.props,{isShown:a}=this.state,{options:l}=this.props;return l=Fd({placement:"bottom"},l),u.jsx("div",{ref:this.container,style:{display:"none"},"data-testid":s,children:u.jsx(ir,{className:$(i,"popper-tooltip"),options:l,ref:this.popper,onEntered:o,onExited:this.handleExited,interactive:e,referenceObject:r,children:u.jsxs("div",{className:"tooltip-content",children:[" ",a&&t]})})})}}jr=ie;Ye(ie,"defaultTimeout",500);Ye(ie,"defaultReshowTimeout",100);Ye(ie,"triggerReshowThreshold",300);Ye(ie,"shownTooltipCount",0);Ye(ie,"lastHiddenTime",Date.now());Ye(ie,"defaultProps",{interactive:!1,options:{},popperClassName:"",reshowTimeout:jr.defaultReshowTimeout,timeout:jr.defaultTimeout,onEntered:()=>{},onExited:()=>{},"data-testid":void 0});var Bd=R.module("ThemeProvider"),qr=c.createContext(null);qr.displayName="ThemeContext";function Yf(n){var{themes:e,waitForActivation:t=!1,defaultPreloadValues:r=Qa,children:i}=n,s=c.useMemo(()=>el(),[]),[o,a]=c.useState(null),[l,d]=c.useState(tl),h=c.useMemo(()=>e==null?null:nl(l,{base:s,custom:e??[]}),[s,l,e]),p=c.useMemo(()=>[...s,...e??[]],[s,e]);return c.useEffect(function(){if(!(h==null||e==null)){rl(r);var v=il(r);Bd.debug2("updateThemePreloadData:",{active:h.map(f=>f.themeKey),custom:e.map(f=>f.themeKey),preloadStyleContent:v,selectedThemeKey:l}),ol({themeKey:l,preloadStyleContent:v})}},[h,l,e,r]),c.useEffect(()=>{a({activeThemes:h,selectedThemeKey:l,themes:p,setSelectedThemeKey:d})},[h,l,p]),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))}),o==null?null:u.jsx(qr.Provider,{value:o,children:u.jsx(as,{children:i})})]})}function Ms(){return Tn(qr,"No ThemeContext value found. Component must be wrapped in a ThemeContext.Provider")}function Kd(n){var{children:e,className:t,style:r,"data-testid":i}=n;return u.jsx("div",{className:$("btn-group",t),style:r,role:"group","data-testid":i,children:e})}var Wd=["kind","variant","type","tooltip","icon","disabled","active","onClick","onContextMenu","onMouseDown","onMouseUp","onMouseEnter","onMouseLeave","onKeyDown","className","style","children","tabIndex","data-testid","aria-label"];function Oi(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function xi(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Oi(Object(t),!0).forEach(function(r){zd(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Oi(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function zd(n,e,t){return(e=Vd(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Vd(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 r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function qd(n,e){if(n==null)return{};var t,r,i=Xd(n,e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(n);for(r=0;r<s.length;r++)t=s[r],e.indexOf(t)===-1&&{}.propertyIsEnumerable.call(n,t)&&(i[t]=n[t])}return i}function Xd(n,e){if(n==null)return{};var t={};for(var r in n)if({}.hasOwnProperty.call(n,r)){if(e.indexOf(r)!==-1)continue;t[r]=n[r]}return t}function Zd(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 $("btn-link",{"btn-link-icon":e,"btn-link-icon-only":e})}}function Yd(n){switch(n){case"group-end":return $("pl-2","pr-3")}}var te=O.forwardRef((n,e)=>{var{kind:t,variant:r,type:i="button",tooltip:s,icon:o,disabled:a=!1,active:l,onClick:d,onContextMenu:h,onMouseDown:p,onMouseUp:m,onMouseEnter:v,onMouseLeave:f,onKeyDown:g,className:b,style:S,children:w,tabIndex:y,"data-testid":D,"aria-label":V}=n,X=qd(n,Wd),{UNSAFE_className:G}=Al({},"button"),A;r&&(A=Yd(r));var M;o&&(M=O.isValidElement(o)?o:u.jsx(le,{icon:o}));var J=M!=null&&w==null,W=Zd(t,J),k;s!==void 0&&(k=typeof s=="string"?u.jsx(ie,{children:s}):s);var z=V;V===void 0&&J&&s!=null&&typeof s=="string"&&(z=s);var F=u.jsxs("button",xi(xi({"data-testid":D,ref:e,type:i,className:$("btn",W,A,{active:l},b,G),onClick:d,onContextMenu:h,onMouseUp:m,onMouseDown:p,onMouseEnter:v,onMouseLeave:f,onKeyDown:g,style:S,disabled:a,tabIndex:y,"aria-label":z},X),{},{children:[o&&M,w,s!=null&&!a&&k]}));return a&&s!=null?u.jsxs("span",{className:"btn-disabled-wrapper",children:[F,k]}):F});te.displayName="Button";function ks(n){var{className:e,children:t,"data-testid":r}=n;return u.jsx("div",{className:$("modal-footer",e),"data-testid":r,children:t})}function Nr(n){var{isOpen:e,headerText:t,bodyText:r,onCancel:i,onConfirm:s,onDiscard:o,onModalDisable:a,cancelButtonText:l="Cancel",confirmButtonText:d="Okay",discardButtonText:h="Discard",isConfirmDanger:p=!1,children:m,"data-testid":v}=n,f=c.useRef(null),g=c.useRef(null),b=c.useCallback(()=>{g.current!==null&&g.current.checked&&a&&a(),s()},[s,a]),S=c.useCallback(()=>{var y;(y=f.current)===null||y===void 0||y.focus()},[]),w="";return e&&(w=typeof r=="function"?r():r),u.jsxs(ls,{isOpen:e,onOpened:S,children:[u.jsx(ds,{closeButton:!1,children:t}),u.jsx(us,{children:w}),u.jsxs(ks,{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":v!==void 0?"".concat(v,"-checkbox-confirm"):void 0}),u.jsx("label",{className:"custom-control-label",htmlFor:"move-confirmation-checkbox",children:"Don't ask me again"})]}),o&&u.jsx(te,{kind:"secondary",className:"mr-auto","data-dismiss":"modal",onClick:o,"data-testid":v!==void 0?"".concat(v,"-btn-discard"):void 0,children:h}),i&&u.jsx(te,{kind:"secondary","data-dismiss":"modal",onClick:i,"data-testid":v!==void 0?"".concat(v,"-btn-cancel"):void 0,children:l}),u.jsxs(Kd,{children:[u.jsx(te,{kind:p?"danger":"primary",onClick:b,ref:f,"data-testid":v!==void 0?"".concat(v,"-btn-confirm"):void 0,children:d}),m]})]})]})}function Jd(n,e,t){return(e=Qd(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Qd(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 r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function br(n){return n.then!==void 0}class he{static disableAllActions(){he.actionsDisabled=!0}static enableAllActions(){he.actionsDisabled=!1}static isContextActionEvent(e){return Array.isArray(e.contextActions)}static compareActions(e,t){if(e.group!==t.group){var r,i;return((r=e.group)!==null&&r!==void 0?r:0)>((i=t.group)!==null&&i!==void 0?i:0)?1:-1}if(e.order!==t.order){var s,o;return((s=e.order)!==null&&s!==void 0?s:0)>((o=t.order)!==null&&o!==void 0?o: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(he.compareActions),t}static isMacPlatform(){var{platform:e}=window.navigator;return e.startsWith("Mac")}static getModifierKey(){return he.isMacPlatform()?"metaKey":"ctrlKey"}static isModifierKeyDown(e){var t=he.getModifierKey();return e[t]}static getMenuItems(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,r=[],i=e;Array.isArray(i)||(i=[i]);for(var s=0;s<i.length;s+=1){var o=i[s],a=void 0;typeof o=="function"?a=o():a=o,a!=null&&(a instanceof Promise?t&&r.push(a):Array.isArray(a)?r=r.concat(a):r.push(a))}return r=r.filter(l=>l.title!==void 0||l.then!=null||l.menuElement),r}static getNextMenuItem(e,t,r){var i=e;i<0&&t<0&&(i=r.length);for(var s=1;s<r.length+1;s+=1){var o=(i+t*s+r.length)%r.length,a=r[o];if(!(a instanceof Promise)&&a.disabled!==!0)return o}return e}}Jd(he,"actionsDisabled",!1);var Ii=R.module("GlobalContextAction");class tu 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:r}=this.props;r.title==null&&!r.menuElement||(t.contextActions==null&&(t.contextActions=[]),t.contextActions.push(r),Ii.debug("Received context menu event at global action! Menu items are now: ",t.contextActions))}handleKeyDown(e){var{action:t}=this.props;if(!he.actionsDisabled&&t.shortcut!==void 0&&t.shortcut.matchesEvent(e)){var r;Ii.debug("Global hotkey matched!",e),(r=t.action)===null||r===void 0||r.call(t,e),e.preventDefault(),e.stopPropagation()}}render(){return null}}class nu extends c.Component{render(){for(var{actions:e,"data-testid":t}=this.props,r=[],i=0;i<e.length;i+=1){var s=e[i],{shortcut:o}=s;if(s.title!=null||s.menuElement||o){var a=u.jsx(tu,{action:s,"data-testid":t},"".concat(s.title,".").concat(o==null?void 0:o.id));r.push(a)}}return r}}function js(n,e,t){return(e=ru(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function ru(n){var e=iu(n,"string");return typeof e=="symbol"?e:e+""}function iu(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var jn=R.module("ContextActions");class re extends c.Component{static triggerMenu(e,t,r,i){if(i.length!==0){var s=new MouseEvent("contextmenu",{clientX:t,clientY:r,bubbles:!0,cancelable:!0});s.contextActions=i,e.dispatchEvent(s)}}constructor(e){super(e),js(this,"container",void 0),this.handleContextMenu=this.handleContextMenu.bind(this),this.handleKeyDown=this.handleKeyDown.bind(this),this.container=O.createRef(),this.state={globalActions:[],keyboardActions:[]}}static getDerivedStateFromProps(e){if(e.actions==null||!Array.isArray(e.actions))return{globalActions:[],keyboardActions:[]};var t=e.actions.filter(i=>!br(i)&&typeof i!="function"&&i.isGlobal),r=e.actions.filter(i=>!br(i)&&typeof i!="function"&&(i.isGlobal===void 0||!i.isGlobal)&&i.shortcut!=null);return{globalActions:t,keyboardActions:r}}componentDidMount(){var e;(e=this.container.current)!==null&&e!==void 0&&e.parentElement&&(this.container.current.parentElement.addEventListener("contextmenu",this.handleContextMenu),this.container.current.parentElement.addEventListener("keydown",this.handleKeyDown))}componentWillUnmount(){var e;(e=this.container.current)!==null&&e!==void 0&&e.parentElement&&(this.container.current.parentElement.removeEventListener("contextmenu",this.handleContextMenu),this.container.current.parentElement.removeEventListener("keydown",this.handleKeyDown))}handleContextMenu(e){var{ignoreClassNames:t=[]}=this.props;if(t.length>0){for(var r=e.target,i=function(){var{classList:d}=r,h=t.find(p=>d.contains(p));if(h!==void 0)return jn.debug2('Contextmenu event ignored based on the target className "'.concat(h,'"')),{v:void 0};r=r.parentElement},s;r!=null;)if(s=i(),s)return s.v}if(he.isContextActionEvent(e)||(e.contextActions=[]),!!he.isContextActionEvent(e)){var{actions:o}=this.props;if(o!=null){var a=o;Array.isArray(a)&&(a=a.filter(l=>br(l)||typeof l=="function"||l.isGlobal===void 0||!l.isGlobal)),e.contextActions=e.contextActions.concat(a)}jn.debug("Received context menu event! Menu items are now: ",e.contextActions)}}handleKeyDown(e){for(var{keyboardActions:t}=this.state,r=0;r<t.length;r+=1){var i=t[r];if(!he.actionsDisabled&&i.shortcut!=null&&i.shortcut.matchesEvent(e)){var s;jn.debug("Context hotkey matched!",e),(s=i.action)===null||s===void 0||s.call(i,e),e.stopPropagation(),e.preventDefault(),jn.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(nu,{actions:t})})}}js(re,"groups",{default:void 0,high:100,medium:5e3,low:1e4,global:1e5,edit:100});var Ns=O.forwardRef((n,e)=>{var t,r,{closeMenu:i,children:s,menuItem:o,onMenuItemClick:a,onMenuItemMouseMove:l,onMenuItemContextMenu:d,isKeyboardSelected:h=!1,isMouseSelected:p=!1,"data-testid":m}=n,v=c.useCallback(W=>{a(o,W)},[o,a]),f=c.useCallback(W=>{l(o,W)},[o,l]),g=c.useCallback(W=>{d(o,W)},[o,d]);function b(W,k,z){if(typeof W.type=="string")return W;var F={menuItem:o,closeMenu:i,isKeyboardSelected:h,isMouseSelected:p,iconElement:k,displayShortcut:z,"data-testid":m};return O.cloneElement(W,{forwardedProps:F})}var S=(t=o.shortcutText)!==null&&t!==void 0?t:(r=o.shortcut)===null||r===void 0?void 0:r.getDisplayText(),w=null;if(o.icon){var y=o.icon;if(O.isValidElement(y))w=y;else{var D;o.iconColor!=null&&(o.disabled===void 0||!o.disabled)&&(D={color:o.iconColor}),w=u.jsx(le,{icon:y,style:D})}}var V=null,X=!!s;o.actions&&(V=u.jsx(le,{icon:sl}));var G=null;if(o.menuElement)G=u.jsx("div",{className:"custom-menu-item",onMouseMove:f,children:b(o.menuElement,w,S)});else{var A,M=o.disabled,J=o.iconOutline;G=u.jsx("button",{type:"button",className:$("btn-context-menu",{disabled:M},{active:(X||p)&&(M===void 0||!M)},{"keyboard-active":h&&(M===void 0||!M)}),onClick:v,onMouseMove:f,onContextMenu:g,title:(A=o.description)!==null&&A!==void 0?A:"",children:u.jsxs("div",{className:"btn-context-menu-wrapper",children:[u.jsx("span",{className:$("icon",{outline:J}),children:w}),u.jsx("span",{className:"title",children:o.title}),S!==void 0&&u.jsx("span",{className:"shortcut",children:S}),V&&u.jsx("span",{className:$("submenu-indicator",{disabled:M}),children:V})]})})}return u.jsxs("div",{className:"context-menu-item",ref:e,"data-testid":m,children:[s,G]})});Ns.displayName="ContextMenuItem";var As=O.forwardRef((n,e)=>{var{checked:t=!1,children:r,className:i,disabled:s=!1,inputClassName:o,isInvalid:a=!1,labelClassName:l,name:d,onChange:h,"data-testid":p}=n,[m]=c.useState(ct()),v=Ds(e);c.useEffect(function(){v.current&&(v.current.indeterminate=t===null)},[v,t]);var f=c.useCallback(g=>{v.current&&(v.current.indeterminate=t===null),h&&h(g)},[v,t,h]);return u.jsxs("div",{className:$("custom-control custom-checkbox",i),children:[u.jsx("input",{type:"checkbox",ref:v,checked:t??!1,className:$("custom-control-input",o,{"is-invalid":a}),disabled:s,id:m,name:d,onChange:f,"data-testid":p}),u.jsx("label",{className:$("custom-control-label",l),htmlFor:m,children:r})]})});As.displayName="Checkbox";function qn(n){return(n==null?void 0:n.WrappedComponent)!==void 0}function Ls(n){return qn(n)&&Ls(n.WrappedComponent)?!0:n.prototype!=null&&n.prototype.isReactComponent!=null}function ou(n){return!qn(n)&&"$$typeof"in n&&n.$$typeof===Ll.ForwardRef}function Rs(n){return Ls(n)||ou(n)}function Di(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function su(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Di(Object(t),!0).forEach(function(r){yn(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Di(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function yn(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 r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class Fs extends c.PureComponent{constructor(e){var t;super(e),yn(this,"container",void 0),yn(this,"oldFocus",void 0),yn(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=O.createRef(),this.oldFocus=document.activeElement,this.rAF=0;var{options:r}=e,i=(t=r.initialKeyboardIndex)!==null&&t!==void 0?t:-1;this.state={menuItems:[],keyboardIndex:i,mouseIndex:-1}}componentDidMount(){this.initMenu(),this.rAF=window.requestAnimationFrame(()=>{var e;(e=this.container.current)===null||e===void 0||e.focus();var{onMenuOpened:t}=this.props;t(this)})}componentDidUpdate(e){var{actions:t}=this.props;e.actions!==t&&this.initMenu()}componentWillUnmount(){cancelAnimationFrame(this.rAF)}getKeyboardIndex(){var{options:e}=this.props;if(e.separateKeyboardMouse!==void 0&&e.separateKeyboardMouse){var{keyboardIndex:t}=this.state;return t}return this.getMouseIndex()}setKeyboardIndex(e){var{options:t}=this.props;t.separateKeyboardMouse!==void 0&&t.separateKeyboardMouse?this.setState({keyboardIndex:e}):this.setMouseIndex(e)}getMouseIndex(){var{mouseIndex:e}=this.state;return e}setMouseIndex(e){this.setState({mouseIndex:e})}initMenu(){cancelAnimationFrame(this.rAF),this.setState({menuItems:[]});var{actions:e}=this.props,t=he.getMenuItems(e,!1);t.length>0&&this.setState(r=>({menuItems:he.sortActions(r.menuItems.concat(t))}))}handleKeyDown(e){var{menuItems:t}=this.state,r=this.getKeyboardIndex(),i=r;if(e.key==="Enter"||e.key===" "){r!=null&&r>=0&&r<t.length&&this.handleMenuItemClick(t[r],e);return}e.key==="Escape"?i=null:e.key==="ArrowUp"||e.key==="Tab"&&e.shiftKey===!0?i=he.getNextMenuItem(i??0,-1,t):(e.key==="ArrowDown"||e.key==="Tab"&&e.shiftKey===!1)&&(i=he.getNextMenuItem(i??0,1,t)),r!==i&&(i!==null?this.setKeyboardIndex(i):(this.closeMenu(),this.oldFocus instanceof HTMLElement&&this.oldFocus.focus()),e.preventDefault(),e.stopPropagation())}closeMenu(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,{closeMenu:t,onMenuClosed:r}=this.props;cancelAnimationFrame(this.rAF),this.rAF=window.requestAnimationFrame(()=>{t(e),r(this)})}handleCloseMenu(){this.closeMenu()}handleMenuItemClick(e,t){t.preventDefault(),t.stopPropagation(),e!=null&&(e.disabled===void 0||!e.disabled)&&e.action!=null&&(e.action(t.nativeEvent),this.closeMenu(!0))}handleMenuItemMouseMove(e){var{menuItems:t}=this.state,r=t.indexOf(e);this.setMouseIndex(r)}handleMouseLeave(){this.setMouseIndex(-1)}render(){for(var e=[],{"data-testid":t}=this.props,{keyboardIndex:r,menuItems:i,mouseIndex:s}=this.state,o=0;o<i.length;o+=1){var a=i[o];o>0&&a.group!==i[o-1].group&&e.push(u.jsx("hr",{},"".concat(o,".separator")));var l=u.jsx(Ns,{isKeyboardSelected:r===o,isMouseSelected:s===o,menuItem:a,closeMenu:this.handleCloseMenu,onMenuItemClick:this.handleMenuItemClick,onMenuItemMouseMove:this.handleMenuItemMouseMove,onMenuItemContextMenu:()=>!1},o);e.push(l)}var{menuStyle:d}=this.props;return u.jsx("div",{className:"context-menu-container",style:su({},d),ref:this.container,onKeyDown:this.handleKeyDown,onMouseLeave:this.handleMouseLeave,role:"menuitem",tabIndex:0,"data-testid":t,children:e})}}yn(Fs,"defaultProps",{closeMenu(){},onMenuOpened(){},onMenuClosed(){},options:{},menuStyle:{},"data-testid":void 0});function Mi(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function ki(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Mi(Object(t),!0).forEach(function(r){Zt(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Mi(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function Zt(n,e,t){return(e=du(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function du(n){var e=uu(n,"string");return typeof e=="symbol"?e:e+""}function uu(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class or extends c.PureComponent{constructor(e){super(e),Zt(this,"container",void 0),Zt(this,"parent",void 0),Zt(this,"popper",void 0),Zt(this,"isOpen",void 0),this.handleClick=this.handleClick.bind(this),this.handleCloseMenu=this.handleCloseMenu.bind(this),this.handleExited=this.handleExited.bind(this),this.container=O.createRef(),this.parent=null,this.popper=O.createRef(),this.isOpen=!1}componentDidMount(){var{isShown:e}=this.props;if(e===null){var t;(t=this.container.current)!==null&&t!==void 0&&t.parentElement&&(this.parent=this.container.current.parentElement,this.parent.addEventListener("click",this.handleClick))}else e&&this.openMenu()}componentDidUpdate(e){var{isShown:t}=this.props;e.isShown!==t&&(t!==null&&t?window.requestAnimationFrame(()=>{this.openMenu()}):this.closeMenu())}componentWillUnmount(){this.parent&&this.parent.removeEventListener("click",this.handleClick)}closeMenu(){var e;(e=this.popper.current)===null||e===void 0||e.hide()}openMenu(){this.popper.current&&!this.isOpen&&(this.popper.current.show(),this.isOpen=!0)}scheduleUpdate(){var e;(e=this.popper.current)===null||e===void 0||e.scheduleUpdate()}handleClick(e){e.preventDefault(),e.stopPropagation(),this.openMenu()}handleCloseMenu(){this.closeMenu()}handleExited(){this.isOpen=!1;var{onMenuClosed:e}=this.props;e()}render(){var{actions:e,onMenuOpened:t,popperClassName:r,"data-testid":i}=this.props,{menuStyle:s}=this.props,{options:o,popperOptions:a}=this.props;return a=ki({placement:"bottom"},a),o=ki({separateKeyboardMouse:!0},o),u.jsx("div",{className:"menu-actions-listener",ref:this.container,"data-testid":i,children:u.jsx(ir,{ref:this.popper,options:a,className:$("menu-popper",r),onExited:this.handleExited,closeOnBlur:!0,interactive:!0,children:u.jsx(Fs,{actions:e,closeMenu:this.handleCloseMenu,onMenuOpened:t,options:o,menuStyle:s})})})}}Zt(or,"defaultProps",{isShown:null,onMenuClosed(){},onMenuOpened(){},options:{},popperOptions:{},popperClassName:"",menuStyle:{},"data-testid":void 0});function St(n,e,t){return(e=hu(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function hu(n){var e=cu(n,"string");return typeof e=="symbol"?e:e+""}function cu(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var ji=R.module("Shortcut"),_=function(n){return n.CTRL="MODIFIER_CTRL",n.CMD="MODIFIER_CMD",n.ALT="MODIFIER_ALT",n.OPTION="MODIFIER_OPTION",n.SHIFT="MODIFIER_SHIFT",n}({}),C=function(n){return 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",n}({}),mu=new Set([C.ENTER,C.DELETE,C.F1,C.F2,C.F3,C.F4,C.F5,C.F6,C.F7,C.F8,C.F9,C.F10,C.F11,C.F12]);class de extends ys{static isAllowedKey(e){return Object.values(C).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 r=!e.altKey&&!e.ctrlKey&&!e.metaKey&&!e.shiftKey;return!r||mu.has(t)}static createKeyState(e){var t={altKey:!1,ctrlKey:!1,metaKey:!1,shiftKey:!1,keyValue:e[e.length-1]};return e.forEach(r=>{switch(r){case _.CTRL:t.ctrlKey=!0;break;case _.ALT:case _.OPTION:t.altKey=!0;break;case _.CMD:t.metaKey=!0;break;case _.SHIFT:t.shiftKey=!0;break}}),t}static getKeyStateFromEvent(e){var{key:t,keyCode:r}=e,i="";return t==="Shift"||t==="Meta"||t==="Control"||t==="Alt"?i="":!de.isAllowedKey(t)&&de.isAllowedKey(String.fromCharCode(r))?i=String.fromCharCode(r):i=t,{keyValue:i,altKey:e.altKey,ctrlKey:e.ctrlKey,metaKey:e.metaKey,shiftKey:e.shiftKey}}static getWindowsDisplayText(e){var t="";return e.ctrlKey&&(t+="Ctrl+"),e.altKey&&(t+="Alt+"),e.shiftKey&&(t+="Shift+"),e.keyValue===C.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 C.ENTER:t+="⏎";break;case C.ESCAPE:t+="⎋";break;case C.BACKSPACE:t+="⌫";break;case C.DELETE:t+="⌦";break;case null:break;default:t+=e.keyValue}return t}static doKeyStatesMatch(e,t){var r,i;return((r=e.keyValue)===null||r===void 0?void 0:r.toUpperCase())===((i=t.keyValue)===null||i===void 0?void 0:i.toUpperCase())&&e.altKey===t.altKey&&e.ctrlKey===t.ctrlKey&&e.metaKey===t.metaKey&&e.shiftKey===t.shiftKey}static getDisplayText(e){return e.keyValue===null?"":de.isMacPlatform?de.getMacDisplayText(e):de.getWindowsDisplayText(e)}constructor(e){var{id:t,shortcut:r,macShortcut:i,isEditable:s=!0,name:o,tooltip:a}=e;super(),St(this,"id",void 0),St(this,"name",void 0),St(this,"tooltip",void 0),St(this,"isEditable",void 0),St(this,"defaultKeyState",void 0),St(this,"keyState",void 0),this.id=t,this.name=o,this.tooltip=a,this.isEditable=s;var l=de.isMacPlatform,d=l?i:r;this.defaultKeyState=de.createKeyState(d),this.keyState=this.defaultKeyState}getDisplayText(){return de.getDisplayText(this.keyState)}getKeyState(){return this.keyState}setKeyState(e){de.isValidKeyState(e)?(ji.debug2("Shortcut ".concat(this.id," updated to ").concat(JSON.stringify(e))),this.keyState=e,this.dispatchEvent(new Os("onUpdate",{detail:this}))):ji.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))}}St(de,"NULL_KEY_STATE",{metaKey:!1,shiftKey:!1,altKey:!1,ctrlKey:!1,keyValue:null});St(de,"isMacPlatform",he.isMacPlatform());function Ni(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=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 r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var Ai=R.module("ShortcutRegistry");class fu extends ys{constructor(){super(...arguments),Ni(this,"shortcutMap",new Map),Ni(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 Ai.warn("Skipping attempt to add duplicate shortcut ID to registry: ".concat(e.id)),t;Ai.debug2("Adding shortcut to registry: ".concat(e.id)),e.addEventListener("onUpdate",s=>{var{detail:o}=s;return this.dispatchEvent(new Os("onUpdate",{detail:o}))});var r=e.id.split(".")[0];if(this.shortcutMap.set(e.id,e),this.shortcutsByCategory.has(r)){var i;(i=this.shortcutsByCategory.get(r))===null||i===void 0||i.push(e)}else this.shortcutsByCategory.set(r,[e]);return e}get(e){return this.shortcutMap.get(e)}getConflictingShortcuts(e){return Array.from(this.shortcutMap.values()).filter(t=>!t.isNull()&&t.matchesKeyState(e))}}var ee=Object.freeze(new fu),Yt={COPY:ee.createAndAdd({id:"GLOBAL.COPY",name:"Copy",shortcut:[_.CTRL,C.C],macShortcut:[_.CMD,C.C],isEditable:!1}),PASTE:ee.createAndAdd({id:"GLOBAL.PASTE",name:"Paste",shortcut:[_.CTRL,C.V],macShortcut:[_.CMD,C.V],isEditable:!1}),SAVE:ee.createAndAdd({id:"GLOBAL.SAVE",name:"Save",shortcut:[_.CTRL,C.S],macShortcut:[_.CMD,C.S],isEditable:!1}),SELECT_ALL:ee.createAndAdd({id:"GLOBAL.SELECT_ALL",name:"Select All",shortcut:[_.CTRL,C.A],macShortcut:[_.CMD,C.A],isEditable:!1}),REOPEN_CLOSED_PANEL:ee.createAndAdd({id:"GLOBAL.REOPEN_CLOSED_PANEL",name:"Re-open Closed Panel",shortcut:[_.ALT,_.SHIFT,C.T],macShortcut:[_.OPTION,_.SHIFT,C.T],isEditable:!0}),LINKER:ee.createAndAdd({id:"GLOBAL.LINKER",name:"Linker",shortcut:[_.CTRL,C.L],macShortcut:[_.CMD,C.L]}),LINKER_CLOSE:ee.createAndAdd({id:"GLOBAL.LINKER_CLOSE",name:"Close Linker Overlay",shortcut:[C.ESCAPE],macShortcut:[C.ESCAPE],isEditable:!1}),COPY_VERSION_INFO:ee.createAndAdd({id:"GLOBAL.COPY_VERSION_INFO",name:"Copy Version Info",shortcut:[_.CTRL,_.ALT,C.I],macShortcut:[_.CMD,_.SHIFT,C.I],isEditable:!0}),EXPORT_LOGS:ee.createAndAdd({id:"GLOBAL.EXPORT_LOGS",name:"Export Logs",shortcut:[_.CTRL,_.ALT,_.SHIFT,C.L],macShortcut:[_.CMD,_.OPTION,_.SHIFT,C.L],isEditable:!0}),OPEN_DASHBOARD_LIST:ee.createAndAdd({id:"GLOBAL.OPEN_DASHBOARD_LIST",name:"Open Dashboard List",shortcut:[_.CTRL,_.SHIFT,C.D],macShortcut:[_.CMD,_.SHIFT,C.D],isEditable:!0}),NEXT:ee.createAndAdd({id:"GLOBAL.NEXT",name:"Next",shortcut:[C.ENTER],macShortcut:[C.ENTER],isEditable:!1}),PREVIOUS:ee.createAndAdd({id:"GLOBAL.PREVIOUS",name:"Previous",shortcut:[_.SHIFT,C.ENTER],macShortcut:[_.SHIFT,C.ENTER],isEditable:!1}),UNDO:ee.createAndAdd({id:"GLOBAL.UNDO",name:"Undo",shortcut:[_.CTRL,C.Z],macShortcut:[_.CMD,C.Z],isEditable:!1}),REDO:ee.createAndAdd({id:"GLOBAL.REDO",name:"Redo",shortcut:[_.CTRL,_.SHIFT,C.Z],macShortcut:[_.CMD,_.SHIFT,C.Z],isEditable:!1})};function Ar(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 r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class sr extends c.PureComponent{constructor(e){super(e),Ar(this,"inputField",void 0),Ar(this,"searchChangeSelection",void 0),this.inputField=O.createRef(),this.searchChangeSelection=O.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 r=t.getBoundingClientRect().width;e.style.paddingRight="".concat(r,"px")}}render(){var{value:e,placeholder:t,endPlaceholder:r,onBlur:i,onChange:s,className:o,disabled:a,matchCount:l,id:d,onKeyDown:h,"data-testid":p,cursor:m}=this.props,v,f=[{action:()=>m==null?void 0:m.next("forward"),shortcut:Yt.NEXT},{action:()=>m==null?void 0:m.next("back"),shortcut:Yt.PREVIOUS}];return m&&l>1?v=u.jsxs(u.Fragment,{children:[u.jsx(te,{kind:"ghost",className:"search-change-button",type:"button",onClick:()=>{m.next("back")},icon:hs,tooltip:"Previous match (".concat(Yt.PREVIOUS.getDisplayText(),")")}),u.jsxs("span",{className:"search-change-text",children:[m.index!==void 0&&"".concat(m.index+1," of "),l]}),u.jsx(te,{kind:"ghost",className:"search-change-button",type:"button",onClick:()=>{m.next("forward")},icon:al,tooltip:"Next match (".concat(Yt.NEXT.getDisplayText(),")")})]}):v=l>0&&u.jsx("span",{className:"search-match",children:l}),u.jsxs("div",{className:$("search-group",o),children:[u.jsx("input",{type:"search",value:e,onBlur:i,onChange:s,onKeyDown:h,className:"form-control",disabled:a,placeholder:t,ref:this.inputField,id:d,"data-testid":p}),l!=null?u.jsxs(u.Fragment,{children:[u.jsx("div",{className:"search-change-selection",ref:this.searchChangeSelection,children:v}),u.jsx(re,{actions:f})]}):u.jsxs("span",{className:"search-end-content",children:[(r??"")!==""&&e===""&&u.jsx("span",{className:"search-end-placeholder",children:r}),u.jsx(le,{icon:ll})]})]})}}Ar(sr,"defaultProps",{placeholder:"Search",className:"",matchCount:null,onKeyDown(){},id:"","data-testid":void 0,cursor:void 0});function Hs(n,e,t){return(e=yu(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function yu(n){var e=Cu(n,"string");return typeof e=="symbol"?e:e+""}function Cu(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class $s extends c.PureComponent{constructor(e){super(e),Hs(this,"searchInput",void 0),this.searchInput=O.createRef(),this.handleChange=this.handleChange.bind(this),this.sendUpdate=En(this.sendUpdate.bind(this),e.debounceMs),this.state={value:e.value}}componentDidUpdate(e){var{value:t}=this.props;e.value!==t&&this.setState({value:t})}focus(){var e;(e=this.searchInput.current)===null||e===void 0||e.focus()}handleChange(e){this.setState({value:e.target.value},this.sendUpdate)}sendUpdate(){var{onChange:e}=this.props,{value:t}=this.state;e(t)}render(){var{placeholder:e,className:t,matchCount:r,id:i,"data-testid":s}=this.props,{value:o}=this.state;return u.jsx(sr,{value:o,placeholder:e,onChange:this.handleChange,className:t,matchCount:r,ref:this.searchInput,id:i,"data-testid":s})}}Hs($s,"defaultProps",{placeholder:"Search",className:"",matchCount:null,debounceMs:250,id:"","data-testid":void 0});function Us(n,e,t){return(e=wu(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function wu(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 r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var _u=R.module("ItemListItem");class ar extends c.Component{static handleKeyDown(){return _u.log("ItemListItem.handleKeyDown false"),!1}constructor(e){super(e),Us(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=O.createRef()}handleBlur(e){var{itemIndex:t,onBlur:r}=this.props;r(t,e)}handleFocus(e){var{itemIndex:t,onFocus:r}=this.props;r(t,e)}handleClick(e){var{itemIndex:t,onClick:r}=this.props;r(t,e)}handleContextMenu(e){var{itemIndex:t,onContextMenu:r}=this.props;r(t,e)}handleDragStart(e){var{itemIndex:t,onDragStart:r}=this.props;r(t,e)}handleDrag(e){var{itemIndex:t,onDrag:r}=this.props;r(t,e)}handleDragOver(e){e.preventDefault();var{itemIndex:t,onDragOver:r}=this.props;r(t,e)}handleDragEnd(e){var{itemIndex:t,onDragEnd:r}=this.props;r(t,e)}handleDrop(e){var{itemIndex:t,onDrop:r}=this.props;r(t,e)}handleDoubleClick(e){var{itemIndex:t,onDoubleClick:r}=this.props;r(t,e)}handleMouseMove(e){var{itemIndex:t,onMouseMove:r}=this.props;r(t,e)}handleMouseDown(e){var{itemIndex:t,onMouseDown:r}=this.props;r(t,e)}handleMouseUp(e){var{itemIndex:t,onMouseUp:r}=this.props;r(t,e)}render(){var{isDraggable:e,isFocused:t,isSelected:r,style:i,children:s,"data-testid":o}=this.props;return u.jsx("div",{className:$("item-list-item",{active:r},{"is-focused":t},{"is-draggable":e}),onKeyDown:ar.handleKeyDown,onContextMenuCapture:this.handleContextMenu,onClick:this.handleClick,onDrag:this.handleDrag,onDragStart:this.handleDragStart,onDragOver:this.handleDragOver,onDragEnd:this.handleDragEnd,onDrop:this.handleDrop,onDoubleClick:this.handleDoubleClick,onMouseDown:this.handleMouseDown,onMouseMove:this.handleMouseMove,onMouseUp:this.handleMouseUp,tabIndex:-1,ref:this.itemRef,role:"listitem",style:i,onFocus:this.handleFocus,onBlur:this.handleBlur,draggable:e,"data-testid":o,children:s})}}Us(ar,"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:{}});var zn;function Li(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function Ri(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Li(Object(t),!0).forEach(function(r){Ve(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Li(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function Ve(n,e,t){return(e=Eu(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Eu(n){var e=Pu(n,"string");return typeof e=="symbol"?e:e+""}function Pu(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var Fi=R.module("ItemList"),Hi=5;class Qe extends c.PureComponent{static renderItem(e){var t,r,{item:i}=e;return u.jsx("div",{className:"item-list-item-content",children:i!=null&&((t=(r=i.displayValue)!==null&&r!==void 0?r:i.value)!==null&&t!==void 0?t:"".concat(i))})}constructor(e){super(e),Ve(this,"list",void 0),Ve(this,"listContainer",void 0),Ve(this,"getItemSelected",qt((i,s)=>Ze.isSelected(s,i),{max:Qe.CACHE_SIZE})),Ve(this,"getCachedItem",qt((i,s,o,a,l,d,h,p)=>{var m=d({item:o,itemIndex:i,isFocused:a,isSelected:l,style:h});return u.jsx(ar,{onContextMenu:this.handleItemContextMenu,onDoubleClick:this.handleItemDoubleClick,onMouseDown:this.handleItemMouseDown,onFocus:this.handleItemFocus,onBlur:this.handleItemBlur,disableSelect:p,onMouseMove:this.handleItemMouseMove,onMouseUp:this.handleItemMouseUp,isFocused:a,isSelected:l,itemIndex:i,style:h,children:m},s)},{max:Qe.CACHE_SIZE})),Ve(this,"getOuterElement",qt(i=>{var s=O.forwardRef((o,a)=>u.jsx("div",Ri({ref:a,tabIndex:-1,onKeyDown:i,role:"presentation"},o)));return s.displayName="ItemListOuterElement",s},{max:1e3})),Ve(this,"getInnerElement",qt(()=>{var i=O.forwardRef((s,o)=>u.jsx("div",Ri({className:"item-list-inner-element",ref:o},s)));return i.displayName="ItemListInnerElement",i},{max:1e3})),Ve(this,"getItemData",qt((i,s,o)=>({items:i,selectedRanges:s,renderItem:o}),{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=O.createRef(),this.listContainer=O.createRef();var{isStickyBottom:t,selectedRanges:r}=e;this.state={focusIndex:null,mouseDownIndex:null,selectedRanges:r,overscanStartIndex:0,height:null,isDragging:!1,isStuckToBottom:t,scrollOffset:null,mouseX:null,mouseY:null}}componentDidUpdate(e,t){var{selectedRanges:r,itemCount:i}=this.props,{focusIndex:s,isStuckToBottom:o,scrollOffset:a,height:l,selectedRanges:d}=this.state;if(o&&!this.isListAtBottom()&&i>0&&this.scrollToBottom(),(a!==t.scrollOffset||l!==t.height)&&this.sendViewportUpdate(),r!==e.selectedRanges&&r!==d)this.setSelectedRanges(r);else if(d!==t.selectedRanges){var{onSelectionChange:h}=this.props;h(d)}if(s!==t.focusIndex){var{onFocusChange:p}=this.props;p(s)}}componentWillUnmount(){window.removeEventListener("mouseup",this.handleWindowMouseUp)}focus(){var e;(e=this.listContainer.current)===null||e===void 0||e.focus()}restoreScrollPosition(){var{scrollOffset:e}=this.state;if(e!=null){var t;(t=this.listContainer.current)===null||t===void 0||t.scrollTo(0,e)}}getElement(e){if(this.listContainer.current==null)return null;var{focusSelector:t}=this.props,{overscanStartIndex:r}=this.state,i=this.listContainer.current.querySelectorAll(t),s=e-r;return i[s]}focusItem(e){var{disableSelect:t}=this.props;if(!t){this.setState({focusIndex:e});var r=this.getElement(e);r instanceof HTMLElement&&r.focus()}}scrollToItem(e){var t=this.getElement(e);t!=null&&t.scrollIntoView({block:"center"})}handleItemContextMenu(e,t){this.setState({focusIndex:e});var{selectedRanges:r}=this.state,i=Ze.isSelected(r,e),s=i||he.isModifierKeyDown(t);this.toggleSelect(e,t.shiftKey,s,!1)}handleItemDoubleClick(e,t){var{isDoubleClickSelect:r,onSelect:i}=this.props;r&&this.setState(s=>{var{selectedRanges:o}=s;return{selectedRanges:Ze.selectRange(o,[e,e])}},()=>{i(e,t)})}handleItemMouseDown(e,t){var{selectedRanges:r}=this.state;if(!(t.target instanceof HTMLElement&&["button","select","input","textarea"].indexOf(t.target.tagName.toLowerCase())!==-1)){if(t.button===2&&r.length===0){this.focusItem(e),this.selectItem(e);return}t.button!=null&&t.button!==0||(this.setState({mouseDownIndex:e,mouseX:t.clientX,mouseY:t.clientY}),window.addEventListener("mouseup",this.handleWindowMouseUp))}}handleItemBlur(e,t){Fi.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){Fi.debug2("item focus",e,t.target),this.setState(r=>{var{focusIndex:i}=r;return i!==e?{focusIndex:e}:null})}handleItemMouseMove(e,t){var{isDragSelect:r,isMultiSelect:i,disableSelect:s}=this.props,{mouseDownIndex:o,selectedRanges:a,mouseX:l,mouseY:d}=this.state;if(!(o==null||s)){var h=Math.abs(t.clientX-(l??0)),p=Math.abs(t.clientY-(d??0));h>Hi&&p>Hi&&this.setState({isDragging:!0}),(r||o===e)&&(this.focusItem(e),i?(!r&&!this.getItemSelected(e,a)&&!he.isModifierKeyDown(t)&&this.deselectAll(),this.selectRange([Math.min(o,e),Math.max(o,e)])):this.toggleSelect(e,t.shiftKey,he.isModifierKeyDown(t),!1))}}handleItemMouseUp(e,t){var{isDeselectOnClick:r,isDoubleClickSelect:i,onSelect:s}=this.props,{mouseDownIndex:o,isDragging:a}=this.state;if(!(t.target instanceof HTMLElement&&["button","select","input","textarea"].indexOf(t.target.tagName.toLowerCase())!==-1)){if(o===e&&!a){var l=t.shiftKey,d=he.isModifierKeyDown(t);this.focusItem(e),this.toggleSelect(e,l,d,r),!i&&!l&&!d&&s(e,t)}this.resetMouseState()}}handleItemsRendered(e){var{overscanStartIndex:t}=e;this.setState({overscanStartIndex:t})}handleResize(e){var{height:t}=e;this.setState({height:t})}handleMouseLeave(){this.setState({mouseDownIndex:null})}handleWindowMouseUp(){this.resetMouseState(),window.removeEventListener("mouseup",this.handleWindowMouseUp)}handleKeyDown(e){var{isMultiSelect:t,itemCount:r,onSelect:i}=this.props,{focusIndex:s}=this.state,o=s;if(e.key==="Enter"||e.key===" "){!t&&o!=null&&this.setState({selectedRanges:[[o,o]]},()=>{o!=null&&i(o,e)});return}if(e.key==="ArrowUp")o!=null&&o>=0?o=Math.max(0,o-1):o=r-1;else if(e.key==="ArrowDown")o!=null&&o>=0?o=Math.min(o+1,r-1):o=0;else return;if(s!==o){e.stopPropagation(),e.preventDefault(),this.focusItem(o);var{selectedRanges:a}=this.state;if(e.shiftKey&&a.length>0){var l=a[a.length-1];this.selectRange([Math.min(o,l[0]),Math.max(o,l[1])])}else if(this.deselectAll(),o!==null)this.selectItem(o);else{var d;(d=this.listContainer.current)===null||d===void 0||d.focus()}this.scrollIntoView(o)}}handleScroll(e){var{scrollUpdateWasRequested:t,scrollOffset:r}=e;this.setState(i=>{if(t)return{scrollOffset:r};var{isStickyBottom:s}=this.props,{height:o}=i,a=s&&this.isListAtBottom({scrollOffset:r,height:o});return{isStuckToBottom:a,scrollOffset:r}})}resetMouseState(){this.setState({mouseDownIndex:null,isDragging:!1})}scrollToBottom(){var{itemCount:e}=this.props;this.list.current&&this.list.current.scrollToItem(e)}scrollIntoView(e){this.list.current&&this.list.current.scrollToItem(e)}toggleSelect(e,t,r){var i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,{isMultiSelect:s}=this.props,{selectedRanges:o}=this.state;if(s&&t&&o.length>0){var a=o[o.length-1];this.selectRange([Math.min(a[0],e),Math.max(e,a[1])])}else s&&o.length===1&&o[0][0]===e&&o[0][1]===e?i&&this.deselectItem(e):s&&r?this.getItemSelected(e,o)?i&&this.deselectItem(e):this.selectItem(e):(this.deselectAll(),this.selectItem(e))}deselectAll(){var{itemCount:e}=this.props;this.deselectRange([0,e])}deselectItem(e){this.deselectRange([e,e])}deselectRange(e){Ze.validateRange(e),this.setState(t=>{var{selectedRanges:r}=t;return{selectedRanges:Ze.deselectRange(r,e)}})}selectItem(e){var{disableSelect:t}=this.props;t||this.selectRange([e,e])}selectRange(e){Ze.validateRange(e),this.setState(t=>{var{selectedRanges:r}=t;return{selectedRanges:Ze.selectRange(r,e)}})}setSelectedRanges(e){this.setState({selectedRanges:e})}sendViewportUpdate(){var{scrollOffset:e,height:t}=this.state;if(e!=null&&t!=null){var{onViewportChange:r,rowHeight:i}=this.props,s=Math.floor(e/i),o=s+Math.ceil(t/i);r(s,o)}}isListAtBottom(){var{scrollOffset:e,height:t}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.state;if(t==null||e==null)return!1;var{itemCount:r,rowHeight:i}=this.props;return e+t>=r*i}renderInnerElement(e){var{index:t,style:r}=e,{items:i,offset:s,renderItem:o,disableSelect:a}=this.props,{focusIndex:l,selectedRanges:d}=this.state;if(t<s||t>=s+i.length)return null;var h=i[t-s];return this.getCachedItem(t,t,h,t===l&&!a,this.getItemSelected(t,d),o,r,a)}render(){var{items:e,itemCount:t,overscanCount:r,renderItem:i,rowHeight:s,"data-testid":o}=this.props,{selectedRanges:a,isStuckToBottom:l}=this.state;return u.jsx(Rl,{className:"item-list-auto-sizer",onResize:this.handleResize,children:d=>{var{width:h,height:p}=d;return u.jsx(Fl,{className:"item-list-scroll-pane",height:p,width:h,initialScrollOffset:l?t*s:0,itemCount:t,itemSize:s,itemData:this.getItemData(e,a,i),onScroll:this.handleScroll,onItemsRendered:this.handleItemsRendered,ref:this.list,outerElementType:this.getOuterElement(this.handleKeyDown),outerRef:this.listContainer,innerElementType:this.getInnerElement(),overscanCount:r,"data-testid":o,children:this.renderInnerElement})}})}}zn=Qe;Ve(Qe,"CACHE_SIZE",1e3);Ve(Qe,"DEFAULT_ROW_HEIGHT",20);Ve(Qe,"DEFAULT_OVERSCAN",10);Ve(Qe,"defaultProps",{offset:0,items:[],rowHeight:zn.DEFAULT_ROW_HEIGHT,isDeselectOnClick:!0,isDoubleClickSelect:!1,isDragSelect:!0,isMultiSelect:!1,isStickyBottom:!1,disableSelect:!1,onFocusChange(){},onSelect(){},onSelectionChange(){},onViewportChange(){},overscanCount:zn.DEFAULT_OVERSCAN,renderItem:zn.renderItem,selectedRanges:[],focusSelector:".item-list-item","data-testid":void 0});var Tu=R.module("ErrorBoundary");class Ou extends c.Component{static getDerivedStateFromError(e){return{error:e}}constructor(e){super(e),this.state={error:void 0}}componentDidCatch(e,t){var{onError:r}=this.props;Tu.error("Error caught by ErrorBoundary",e,t),r==null||r(e,t)}render(){var{children:e,className:t,fallback:r}=this.props,{error:i}=this.state;return i!=null?r??u.jsx("div",{className:t,children:u.jsx(_n,{errorMessage:"".concat(i),isLoading:!1,isLoaded:!1,"data-testid":"error-boundary-loading"})}):e??null}}function xu(n){var{on:e,id:t,className:r,isInvalid:i,disabled:s=!1,onClick:o,"data-testid":a}=n;return u.jsx("button",{type:"button",className:$("btn","btn-switch",r,{active:e},{"is-invalid":i}),id:t,onClick:o,disabled:s,"data-testid":a,children:u.jsx("div",{className:"handle"})})}var Iu=["children","className","isInvalid","onChange","data-testid"];function $i(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function Ui(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?$i(Object(t),!0).forEach(function(r){Du(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):$i(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function Du(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=ku(n,"string");return typeof e=="symbol"?e:e+""}function ku(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function ju(n,e){if(n==null)return{};var t,r,i=Nu(n,e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(n);for(r=0;r<s.length;r++)t=s[r],e.indexOf(t)===-1&&{}.propertyIsEnumerable.call(n,t)&&(i[t]=n[t])}return i}function Nu(n,e){if(n==null)return{};var t={};for(var r in n)if({}.hasOwnProperty.call(n,r)){if(e.indexOf(r)!==-1)continue;t[r]=n[r]}return t}var Bs=O.forwardRef((n,e)=>{var{children:t,className:r,isInvalid:i,onChange:s,"data-testid":o}=n,a=ju(n,Iu),l=Ds(e),d=c.useCallback(h=>{s(h.target.value)},[s]);return u.jsx("select",Ui(Ui({ref:l,className:$("custom-select",r,{"is-invalid":i}),onChange:d,"data-testid":o},a),{},{children:t}))});Bs.displayName="Select";var Xr=O.createContext(new Map);Xr.displayName="XComponentMapContext";var Jf=Xr.Provider;function Au(n){var e,t=c.useContext(Xr);return(e=t.get(n))!==null&&e!==void 0?e:n.Original}function Bi(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function yr(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Bi(Object(t),!0).forEach(function(r){Lu(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Bi(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function Lu(n,e,t){return(e=Ru(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Ru(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 r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function Ks(n){var e,t;function r(i,s){var o=Au(t);return Rs(n)?u.jsx(o,yr(yr({},i),{},{ref:s})):u.jsx(o,yr({},i))}return r.displayName="XComponent(".concat((e=n.displayName)!==null&&e!==void 0?e:n.name,")"),t=c.forwardRef(r),t.Original=n,t.isXComponent=!0,t}function Hu(){return Tn(dl,"No API available in useApi. Was code wrapped in ApiBootstrap or ApiContext.Provider?")}function Ws(n){return typeof n=="object"&&n!=null&&typeof n.type=="string"&&n.name!=null}function zs(n){return typeof n=="object"&&n!=null&&typeof n.type=="string"&&n.id!=null}function Qf(n){return Ws(n)||zs(n)}var Vs=c.createContext(null);Vs.displayName="ObjectFetcherContext";function eg(n){if(zs(n))return{id:n.id,type:n.type};if(Ws(n)){var e;return{name:(e=n.name)!==null&&e!==void 0?e:"",type:n.type}}throw new Error("Invalid descriptor: ".concat(n))}function $u(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 tg(){return Tn(Vs,"No ObjectFetcher available in useObjectFetcher. Was code wrapped in ObjectFetcherContext.Provider?")}function Ki(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function Uu(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Ki(Object(t),!0).forEach(function(r){Bu(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Ki(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function Bu(n,e,t){return(e=Ku(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Ku(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 r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var zu=Object.freeze({}),Vu=new Map,ng=n=>n.api,rg=n=>n.user,Gs=n=>n.storage,qs=n=>Gs(n).commandHistoryStorage,Gu=n=>Gs(n).fileStorage,qu=n=>n.defaultWorkspaceSettings,Xs=n=>{var{workspace:e}=n;return e},Zr=Hl(n=>{for(var e,t,r=(e=(t=Xs(n))===null||t===void 0?void 0:t.data.settings)!==null&&e!==void 0?e:{},i=Uu({},qu(n)),s=Object.keys(r),o=0;o<s.length;o+=1){var a=s[o];r[a]!==void 0&&(i[a]=r[a])}return i}),Xu=n=>Zr(n).timeZone,ig=n=>{var e;return(e=Zr(n).notebookSettings)!==null&&e!==void 0?e:zu},og=n=>n.activeTool,Zu=n=>{var e;return(e=n.plugins)!==null&&e!==void 0?e:Vu},Yu="SET_ACTIVE_TOOL",Ju="SET_API",sg="SET_COMMAND_HISTORY_STORAGE",ag="SET_FILE_STORAGE",lg="SET_PLUGINS",Qu="SET_USER",eh="SET_WORKSPACE",th="SET_DEFAULT_WORKSPACE_SETTINGS",dg="SET_WORKSPACE_STORAGE",nh="SET_SERVER_CONFIG_VALUES";function Wi(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function dt(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Wi(Object(t),!0).forEach(function(r){rh(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Wi(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function rh(n,e,t){return(e=ih(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function ih(n){var e=oh(n,"string");return typeof e=="symbol"?e:e+""}function oh(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var ug=n=>({type:Qu,payload:n}),hg=n=>({type:Ju,payload:n}),Zs=n=>({type:eh,payload:n}),cg=n=>({type:th,payload:n}),sh=n=>(e,t)=>{e(Zs(n));var{storage:r}=t(),{workspaceStorage:i}=r;return i==null?void 0:i.save(n)},ah=n=>(e,t)=>{var{workspace:r}=t(),{data:i}=r??{},s=dt(dt({},r),{},{data:dt(dt(dt({},i),n),{},{settings:dt(dt({},i==null?void 0:i.settings),n.settings)})});return e(sh(s))},mg=n=>(e,t)=>{var{notebookSettings:r}=Zr(t()),i=dt(dt({},r),n);return e(lh({notebookSettings:i}))},lh=n=>e=>e(ah({settings:n})),pg=n=>({type:Yu,payload:n}),vg=n=>({type:nh,payload:n});function zi(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function Vi(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?zi(Object(t),!0).forEach(function(r){dh(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):zi(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function dh(n,e,t){return(e=uh(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function uh(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 r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function ch(n){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;return function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:e,i=arguments.length>1?arguments[1]:void 0;switch(i==null?void 0:i.type){case n:{var{id:s,payload:o}=i;return t&&Ir({payload:o},{payload:r[s]})?r:Vi(Vi({},r),{},{[s]:o})}default:return r}}}function Gi(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function qi(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Gi(Object(t),!0).forEach(function(r){Lr(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Gi(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function Lr(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=ph(n,"string");return typeof e=="symbol"?e:e+""}function ph(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class vh{constructor(){Lr(this,"reducers",{}),Lr(this,"listener",null)}register(e,t){var r;this.reducers=qi(qi({},this.reducers),{},{[e]:t}),(r=this.listener)===null||r===void 0||r.call(this,this.reducers)}setListener(e){this.listener=e}}var fh=new vh;function Yr(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 r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class Fe{static isValid(e,t){return!0}static isSameFormat(e,t){throw new Error("isSameFormat not implemented")}static makeFormat(e,t,r){return{label:e,formatString:t,type:r}}format(e,t){return""}}Yr(Fe,"TYPE_GLOBAL","type-global");Yr(Fe,"TYPE_CONTEXT_PRESET","type-context-preset");Yr(Fe,"TYPE_CONTEXT_CUSTOM","type-context-custom");function _t(n,e,t){return(e=yh(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function yh(n){var e=Ch(n,"string");return typeof e=="symbol"?e:e+""}function Ch(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var Xi=R.module("DateTimeColumnFormatter");class ht extends Fe{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 r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Fe.TYPE_CONTEXT_PRESET;return{label:e,formatString:t,type:r}}static isSameFormat(e,t){return e===t||e!==null&&t!==null&&e.type===t.type&&e.formatString===t.formatString}static makeGlobalFormatStringMap(e,t){var r=t?"'T'":" ",i=e?" z":"";return new Map([["yyyy-MM-dd HH:mm:ss","yyyy-MM-dd".concat(r,"HH:mm:ss").concat(i)],["yyyy-MM-dd HH:mm:ss.SSS","yyyy-MM-dd".concat(r,"HH:mm:ss.SSS").concat(i)],["yyyy-MM-dd HH:mm:ss.SSSSSSSSS","yyyy-MM-dd".concat(r,"HH:mm:ss.SSSSSSSSS").concat(i)]])}static getGlobalFormats(e,t){var r=ht.makeGlobalFormatStringMap(e,t);return[...r.keys()]}static makeFormatStringMap(e,t){var r=t!==void 0&&t?"'T'":" ",i=e!==void 0&&e?" z":"";return new Map([["yyyy-MM-dd","yyyy-MM-dd".concat(i)],["MM-dd-yyyy","MM-dd-yyyy".concat(i)],["HH:mm:ss","HH:mm:ss".concat(i)],["HH:mm:ss.SSS","HH:mm:ss.SSS".concat(i)],["HH:mm:ss.SSSSSSSSS","HH:mm:ss.SSSSSSSSS".concat(i)],["yyyy-MM-dd HH:mm:ss","yyyy-MM-dd".concat(r,"HH:mm:ss").concat(i)],["yyyy-MM-dd HH:mm:ss.SSS","yyyy-MM-dd".concat(r,"HH:mm:ss.SSS").concat(i)],["yyyy-MM-dd HH:mm:ss.SSSSSSSSS","yyyy-MM-dd".concat(r,"HH:mm:ss.SSSSSSSSS").concat(i)]])}static getFormats(e,t){var r=ht.makeFormatStringMap(e,t);return[...r.keys()]}constructor(e){var{timeZone:t="",showTimeZone:r=!0,showTSeparator:i=!1,defaultDateTimeFormatString:s=ht.DEFAULT_DATETIME_FORMAT_STRING}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};super(),_t(this,"dh",void 0),_t(this,"dhTimeZone",void 0),_t(this,"defaultDateTimeFormatString",void 0),_t(this,"showTimeZone",void 0),_t(this,"showTSeparator",void 0),_t(this,"formatStringMap",void 0);var o=t||ht.DEFAULT_TIME_ZONE_ID;try{this.dhTimeZone=e.i18n.TimeZone.getTimeZone(o)}catch{Xi.error("Unsupported time zone id",o),this.dhTimeZone=e.i18n.TimeZone.getTimeZone(ht.DEFAULT_TIME_ZONE_ID)}this.dh=e,this.defaultDateTimeFormatString=s,this.showTimeZone=r,this.showTSeparator=i,this.formatStringMap=ht.makeFormatStringMap(r,i)}getEffectiveFormatString(e){var t;return(t=this.formatStringMap.get(e))!==null&&t!==void 0?t:e}format(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=t.formatString!=null&&t.formatString!==""?t.formatString:this.defaultDateTimeFormatString,i=this.getEffectiveFormatString(r);try{return this.dh.i18n.DateTimeFormat.format(i,e,this.dhTimeZone)}catch{Xi.error("Invalid format arguments")}return""}}_t(ht,"DEFAULT_DATETIME_FORMAT_STRING","yyyy-MM-dd HH:mm:ss.SSS");_t(ht,"DEFAULT_TIME_ZONE_ID","America/New_York");var vt;function et(n,e,t){return(e=wh(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function wh(n){var e=Sh(n,"string");return typeof e=="symbol"?e:e+""}function Sh(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var _h=R.module("DecimalColumnFormatter");class ke extends Fe{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 r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Fe.TYPE_CONTEXT_PRESET,i=arguments.length>3?arguments[3]:void 0;return{label:e,type:r,formatString:t,multiplier:i}}static makePresetFormat(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",r=arguments.length>2?arguments[2]:void 0;return ke.makeFormat(e,t,Fe.TYPE_CONTEXT_PRESET,r)}static makeCustomFormat(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",t=arguments.length>1?arguments[1]:void 0;return ke.makeFormat("Custom Format",e,Fe.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=ke.DEFAULT_FORMAT_STRING}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};super(),et(this,"defaultFormatString",void 0),et(this,"dh",void 0),this.dh=e,this.defaultFormatString=t}format(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=t.formatString!=null&&t.formatString!==""?t.formatString:this.defaultFormatString,i=t.multiplier!=null&&t.multiplier!==0?e*t.multiplier:e;try{return this.dh.i18n.NumberFormat.format(r,i)}catch{_h.error("Invalid format arguments")}return""}}vt=ke;et(ke,"DEFAULT_FORMAT_STRING","###,##0.0000");et(ke,"FORMAT_PERCENT",vt.makePresetFormat("Percent","##0.00%"));et(ke,"FORMAT_BASIS_POINTS",vt.makePresetFormat("Basis Points","###,##0 bp",1e4));et(ke,"FORMAT_THOUSANDS",vt.makePresetFormat("Thousands","##0.000 k",.001));et(ke,"FORMAT_MILLIONS",vt.makePresetFormat("Millions","###,##0.000 mm",1e-6));et(ke,"FORMAT_SCIENTIFIC_NOTATION",vt.makePresetFormat("Scientific Notation","0.0000E0"));et(ke,"FORMAT_ROUND",vt.makePresetFormat("Round","###,##0"));et(ke,"FORMAT_ROUND_TWO_DECIMALS",vt.makePresetFormat("0.00","###,##0.00"));et(ke,"FORMAT_ROUND_FOUR_DECIMALS",vt.makePresetFormat("0.0000","###,##0.0000"));var lr;function nn(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=Ph(n,"string");return typeof e=="symbol"?e:e+""}function Ph(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var Th=R.module("IntegerColumnFormatter");class mt extends Fe{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 r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Fe.TYPE_CONTEXT_PRESET,i=arguments.length>3?arguments[3]:void 0;return{label:e,type:r,formatString:t,multiplier:i}}static makePresetFormat(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",r=arguments.length>2?arguments[2]:void 0;return mt.makeFormat(e,t,Fe.TYPE_CONTEXT_PRESET,r)}static makeCustomFormat(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",t=arguments.length>1?arguments[1]:void 0;return mt.makeFormat("Custom Format",e,Fe.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=mt.DEFAULT_FORMAT_STRING}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};super(),nn(this,"dh",void 0),nn(this,"defaultFormatString",void 0),this.dh=e,this.defaultFormatString=t}format(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=t.formatString!=null&&t.formatString!==""?t.formatString:this.defaultFormatString,i=t.multiplier!=null&&t.multiplier!==0?e*t.multiplier:e;try{return this.dh.i18n.NumberFormat.format(r,i)}catch{Th.error("Invalid format arguments")}return""}}lr=mt;nn(mt,"DEFAULT_FORMAT_STRING","###,##0");nn(mt,"FORMAT_THOUSANDS",lr.makePresetFormat("Thousands","##0.000 k",.001));nn(mt,"FORMAT_MILLIONS",lr.makePresetFormat("Millions","###,##0.000 mm",1e-6));nn(mt,"FORMAT_SCIENTIFIC_NOTATION",lr.makePresetFormat("Scientific Notation","0.0000E0"));function Bt(n,e,t){return(e=Oh(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Oh(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 r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class B{}Bt(B,"INTEGER","int");Bt(B,"LONG","long");Bt(B,"DOUBLE","double");Bt(B,"BOOLEAN","bool");Bt(B,"STRING","string");Bt(B,"DATE_TIME","datetime");Bt(B,"LOCAL_TIME","localtime");var Ys=c.createContext(null);Ys.displayName="PluginsContext";var un=Object.freeze({AUTH_PLUGIN:"AuthPlugin",DASHBOARD_PLUGIN:"DashboardPlugin",WIDGET_PLUGIN:"WidgetPlugin",TABLE_PLUGIN:"TablePlugin",THEME_PLUGIN:"ThemePlugin",ELEMENT_PLUGIN:"ElementPlugin"});function Ih(n){return"DashboardPlugin"in n}function Dh(n){return"AuthPlugin"in n}function Mh(n){return"TablePlugin"in n}function fg(n){return Ih(n)||Dh(n)||Mh(n)}function kh(n){return"type"in n&&n.type===un.DASHBOARD_PLUGIN}function Jr(n){return"type"in n&&n.type===un.WIDGET_PLUGIN}function jh(n){return"type"in n&&n.type===un.TABLE_PLUGIN}function Nh(n){return"type"in n&&n.type===un.AUTH_PLUGIN}function Js(n){return"type"in n&&n.type===un.THEME_PLUGIN}function Qs(n){return"type"in n&&n.type===un.ELEMENT_PLUGIN}function gg(n){return kh(n)||Nh(n)||jh(n)||Js(n)||Jr(n)||Qs(n)}var ea=R.module("@deephaven/plugin.PluginUtils");function Zi(n,e){return n==null||!Jr(n)?!1:[n.supportedTypes].flat().some(t=>t===e)}function Ah(n){var e=u.jsx(le,{icon:cs});if(!Jr(n))return e;var{icon:t}=n;return t==null?e:c.isValidElement(t)?t:u.jsx(le,{icon:t})}function bg(n){var e=[...n.entries()].filter(t=>Js(t[1]));return ea.debug("Getting theme data from plugins",e),e.map(t=>{var[r,i]=t,s=Array.isArray(i.themes)?i.themes:[i.themes];return s.map(o=>{var{name:a,baseTheme:l,styleContent:d}=o;return{baseThemeKey:"default-".concat(l??"dark"),themeKey:ul(r,a),name:a,styleContent:d}})}).flat()}function yg(n){var e=[...n.entries()].filter(t=>Qs(t[1])&&t[1].mapping!=null);return ea.debug("Getting element plugin mapping",e),new Map(e.flatMap(t=>{var[,r]=t;return Object.entries(r.mapping)}))}function Cg(){return Tn(Ys,"No Plugins available in usePlugins. This can happen when plugins have not finished loading or if code is not wrapped in PluginsContext.Provider.")}var ta=c.createContext(null);ta.displayName="PersistentStateContext";function wg(n){var{initialState:e,onChange:t,children:r}=n,[i,s]=O.useState(0),o=c.useRef({initial:e,initialStateMap:new Map,state:new Map,isTracking:!0}),a=c.useCallback((m,v)=>{o.current.isTracking&&o.current.state.set(m,v)},[]),l=c.useCallback(()=>{o.current.isTracking||(o.current.isTracking=!0,o.current.state=new Map,s(m=>m+1))},[]),d=c.useRef(o.current.initial[Symbol.iterator]()),h=c.useCallback(function(v){var f=o.current.initialStateMap.get(v);if(f)return f;var{value:g,done:b}=d.current.next(),S={value:g,done:b??!1};return o.current.initialStateMap.set(v,S),S},[]);c.useEffect(function(){o.current.isTracking&&(t([...o.current.state.values()]),o.current.isTracking=!1)},[i,t]);var p=c.useMemo(()=>({addState:a,scheduleStateUpdate:l,getInitialState:h,updateId:i}),[a,h,l,i]);return u.jsx(ta.Provider,{value:p,children:r})}const Lh="var(--dh-color-chart-colorway)",Rh="var(--dh-color-chart-grid)",Fh="var(--dh-color-chart-axis-line)",Hh="var(--dh-color-chart-axis-line-zero)",Yi={"paper-bgcolor":"var(--dh-color-chart-bg)","plot-bgcolor":"var(--dh-color-chart-plot-bg)","title-color":"var(--dh-color-chart-title)","legend-color":"var(--dh-color-chart-legend-fg)",colorway:Lh,gridcolor:Rh,linecolor:Fh,zerolinecolor:Hh,"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 Ji=R.module("ChartTheme");function $h(){var n,e=ms(Yi);return e.colorway=hl((n=e.colorway)!==null&&n!==void 0?n:"").map(t=>{var[r,i]=t;return cl.normalizeCssColor(e.colorway.substring(r,i+1))}).join(" "),Ji.debug2("Chart theme:",Yi),Ji.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 Qi(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function Uh(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Qi(Object(t),!0).forEach(function(r){Bh(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Qi(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function Bh(n,e,t){return(e=Kh(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Kh(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 r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var zh=c.lazy(()=>$l(()=>import("./Plot-D1YMDgMj.js"),__vite__mapDeps([0,1,2,3,4,5]),import.meta.url));function Vh(n){return u.jsx(c.Suspense,{fallback:u.jsx(_n,{"data-testid":"lazy-plot-loading"}),children:u.jsx(zh,Uh({},n))})}var Qr=c.createContext(null);Qr.displayName="ChartThemeContext";function Sg(n){var{children:e}=n,{activeThemes:t}=Ms(),r=c.useMemo($h,[t]);return u.jsx(Qr.Provider,{value:r,children:e})}function Gh(){return Tn(Qr,"No ChartThemeContext value found.")}var na=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 ra(n){return n.componentName!==void 0}function qh(n){return n.component!==void 0}var ia=Object.freeze({type:"default",isClosable:!0,isFocusOnShow:!0,reorderEnabled:!0,title:""});const Xh=Object.freeze(Object.defineProperty({__proto__:null,defaultConfig:na,isGLComponentConfig:ra,isReactComponentConfig:qh,itemDefaultConfig:ia},Symbol.toStringTag,{value:"Module"}));function Vn(n,e,t){return(e=Zh(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Zh(n){var e=Yh(n,"string");return typeof e=="symbol"?e:e+""}function Yh(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class Oe{constructor(){Vn(this,"_mSubscriptions",void 0),Vn(this,"off",this.unbind),Vn(this,"trigger",this.emit),this._mSubscriptions={},this._mSubscriptions[Oe.ALL_EVENT]=[]}on(e,t,r){if(typeof t!="function")throw new Error("Tried to listen to event "+e+" with non-function callback "+t);this._mSubscriptions[e]||(this._mSubscriptions[e]=[]),this._mSubscriptions[e].push({fn:t,ctx:r})}emit(e){for(var t=this._mSubscriptions[e],r=arguments.length,i=new Array(r>1?r-1:0),s=1;s<r;s++)i[s-1]=arguments[s];if(t)for(var o=0;o<t.length;o++){var a=t[o].ctx||{};try{t[o].fn.apply(a,i)}catch(p){console.error("Error while emitting event:",p)}}i.unshift(e);for(var l=this._mSubscriptions[Oe.ALL_EVENT],d=0;d<l.length;d++){var h=l[d].ctx||{};try{l[d].fn.apply(h,i)}catch(p){console.error("Error while emitting event to allEventSubs:",p)}}}unbind(e,t,r){if(!this._mSubscriptions[e])throw new Error("No subscriptions to unsubscribe for event "+e);for(var i=!1,s=0;s<this._mSubscriptions[e].length;s++)(!t||this._mSubscriptions[e][s].fn===t)&&(!r||r===this._mSubscriptions[e][s].ctx)&&(this._mSubscriptions[e].splice(s,1),i=!0);if(i===!1)throw new Error("Nothing to unbind for "+e)}}Vn(Oe,"ALL_EVENT","__all");function qe(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=Qh(n,"string");return typeof e=="symbol"?e:e+""}function Qh(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class Rr extends Oe{constructor(e,t,r){super(),qe(this,"width",void 0),qe(this,"height",void 0),qe(this,"title",void 0),qe(this,"parent",void 0),qe(this,"layoutManager",void 0),qe(this,"tab",void 0),qe(this,"_config",void 0),qe(this,"isHidden",!1),qe(this,"beforeCloseHandler",void 0),qe(this,"_element",T(['<div class="lm_item_container">','<div class="lm_content" tabindex="-1"></div>',"</div>"].join(""))),qe(this,"_contentElement",void 0),this.title=ra(e)?e.componentName:"",this.parent=t,this.layoutManager=r,this._config=e,this._contentElement=this._element.find(".lm_content"),this.beforeCloseHandler=null}getElement(){return this._contentElement}hide(){this.emit("hide"),this.isHidden=!0,this._element.hide()}show(){this.emit("show"),this.isHidden=!1,this._element.show(),(this.height!=0||this.width!=0)&&this.emit("shown")}setSize(e,t){for(var r,i,s,o=this.parent,a=null;o&&!o.isColumn&&!o.isRow;){var l;if(a=o,o=o.parent,(l=o)!==null&&l!==void 0&&l.isRoot)return!1}if(!o||!a)return!1;for(var d=o.isColumn?"height":"width",h=d==="height"?t:e,p=((r=this[d])!==null&&r!==void 0?r:0)*(1/(((i=a.config[d])!==null&&i!==void 0?i:0)/100)),m=h/p*100,v=(((s=a.config[d])!==null&&s!==void 0?s:0)-m)/(o.contentItems.length-1),f=0;f<o.contentItems.length;f++)if(o.contentItems[f]===a)o.contentItems[f].config[d]=m;else{var g;o.contentItems[f].config[d]=((g=o.contentItems[f].config[d])!==null&&g!==void 0?g:0)+v}return o.callDownwards("setSize"),!0}close(e){var t,r;this._config.isClosable&&(!((t=(r=this.beforeCloseHandler)===null||r===void 0?void 0:r.call(this,e))!==null&&t!==void 0)||t)&&(this.emit("close"),this.parent.close())}beforeClose(e){this.beforeCloseHandler=e}getState(){return this._config.componentState}getConfig(){return this._config}extendState(e){this.setState(T.extend(!0,this.getState(),e))}setState(e){this._config.componentState=e,this.parent.emitBubblingEvent("stateChanged")}setTitle(e){this.parent.setTitle(e)}_$setSize(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;if(e!==this.width||t!==this.height){this.width=e,this.height=t;var r=this._contentElement[0],i=r.offsetWidth-r.clientWidth,s=r.offsetHeight-r.clientHeight;this._contentElement.width(this.width-i).height(this.height-s),this.emit("resize")}}}const ec=Object.freeze(Object.defineProperty({__proto__:null,Container:Rr,ItemContainer:Rr},Symbol.toStringTag,{value:"Module"}));function oa(n){var e=location.hash.match(new RegExp(n+"=([^&]*)"));return e?e[1]:null}function sa(n){if(window.location.hash)return oa(n);if(!window.location.search)return null;var e=window.location.search.substr(1).split("&"),t={},r,i;for(i=0;i<e.length;i++)r=e[i].split("="),t[r[0]]=r[1];return t[n]||null}function ei(n){return window.requestAnimationFrame(n)}function tc(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 Xn(){return ct()}function nc(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 ti(n){return T.trim(n.replace(/(<([^>]+)>)/gi,""))}function xe(n,e,t){return(e=rc(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function rc(n){var e=ic(n,"string");return typeof e=="symbol"?e:e+""}function ic(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class On extends Oe{constructor(e,t){var r,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;super(),xe(this,"_eElement",void 0),xe(this,"_oDocument",void 0),xe(this,"_eBody",void 0),xe(this,"_root",void 0),xe(this,"_destroyAfterMouseUp",void 0),xe(this,"_nDelay",400),xe(this,"_timeout",void 0),xe(this,"timeout",void 0),xe(this,"_nDistance",10),xe(this,"_nX",0),xe(this,"_nY",0),xe(this,"_nOriginalX",0),xe(this,"_nOriginalY",0),xe(this,"_bDragging",!1),this._eElement=e,this._oDocument=T(document),this._eBody=T(document.body),this._root=t,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),(r=this._eElement)===null||r===void 0||r.on("mousedown",this.onMouseDown)}destroy(){var e,t;(e=this._eElement)===null||e===void 0||e.unbind("mousedown",this.onMouseDown),(t=this._oDocument)===null||t===void 0||t.unbind("mouseup",this.onMouseUp),this._eElement=void 0,this._oDocument=void 0,this._eBody=void 0,clearTimeout(this._timeout),this._timeout=void 0}onMouseDown(e){if(e.preventDefault(),e.button===0){var t,r,i,s,o=this._getCoordinates(e);this._nOriginalX=(t=o.x)!==null&&t!==void 0?t:0,this._nOriginalY=(r=o.y)!==null&&r!==void 0?r:0,(i=this._oDocument)===null||i===void 0||i.on("mousemove",this.onMouseMove),(s=this._oDocument)===null||s===void 0||s.on("mouseup",this.onMouseUp),this._timeout=window.setTimeout(this._startDrag,this._nDelay)}}onMouseMove(e){if(this._timeout!=null){var t,r;e.preventDefault();var i=this._getCoordinates(e);this._nX=((t=i.x)!==null&&t!==void 0?t:0)-this._nOriginalX,this._nY=((r=i.y)!==null&&r!==void 0?r:0)-this._nOriginalY,this._bDragging===!1&&(Math.abs(this._nX)>this._nDistance||Math.abs(this._nY)>this._nDistance)&&this._startDrag(),this._bDragging&&this.emit("drag",this._nX,this._nY,e)}}onMouseUp(e){if(this._timeout!=null){var t,r,i,s,o;if(clearTimeout(this._timeout),(t=this._oDocument)===null||t===void 0||t.unbind("mousemove",this.onMouseMove),(r=this._oDocument)===null||r===void 0||r.unbind("mouseup",this.onMouseUp),(i=this._oDocument)===null||i===void 0||(i=i.find("iframe"))===null||i===void 0||i.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"),(o=this._root)===null||o===void 0||o.childElementContainer.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,r,i;window.clearTimeout(this._timeout),this._bDragging=!0,(e=this._eBody)===null||e===void 0||e.addClass("lm_dragging"),(t=this._eElement)===null||t===void 0||t.addClass("lm_dragging"),(r=this._root)===null||r===void 0||r.childElementContainer.addClass("lm_dragging"),(i=this._oDocument)===null||i===void 0||(i=i.find("iframe"))===null||i===void 0||i.css("pointer-events","none"),this.emit("dragStart",this._nOriginalX,this._nOriginalY)}_getCoordinates(e){var t,r;return{x:(t=e.pageX)!==null&&t!==void 0?t:0,y:(r=e.pageY)!==null&&r!==void 0?r:0}}}function zt(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=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 r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class aa{constructor(e,t){zt(this,"_container",void 0),zt(this,"_reactComponent",null),zt(this,"_portalComponent",null),zt(this,"_originalComponentWillUpdate",null),zt(this,"_initialState",void 0),zt(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=Gr.createPortal(this._getReactComponent(),this._container.getElement()[0],e),this._container.layoutManager.addReactChild(e,this._portalComponent)}_gotReactComponent(e){if(e){this._reactComponent=e,this._originalComponentWillUpdate=this._reactComponent.componentWillUpdate||function(){},this._reactComponent.componentWillUpdate=this._onUpdate.bind(this);var t=this._container.getState();t&&this._reactComponent.setState(t)}}_destroy(){this._container.layoutManager.removeReactChild(this._key(),this._portalComponent),this._container.off("open",this._render,this),this._container.off("destroy",this._destroy,this)}_onUpdate(e,t){var r;this._container.setState(t),(r=this._originalComponentWillUpdate)===null||r===void 0||r.call(this._reactComponent,e,t)}_getReactClass(){var e=this._container._config.component;if(!e)throw new Error("No react component name. type: react-component needs a field `component`");var t=this._container.layoutManager.getComponent(e)||this._container.layoutManager.getFallbackComponent();if(!t)throw new Error('React component "'+e+'" not found. Please register all components with GoldenLayout using `registerComponent(name, component)`');return t}_getReactComponent(){var e={glEventHub:this._container.layoutManager.eventHub,glContainer:this._container,ref:this._gotReactComponent.bind(this)},t=T.extend(e,this._container._config.props);return O.createElement(this._reactClass,t)}}var Zn=["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"],ac=[!0,!1,"row","column","stack","component","close","maximise","minimise","open in new window"];function ni(n){if(Zn.length>36)throw new Error("Too many keys in config minifier map");var e={};return ri(n,e,"_min"),e}function Fr(n){if(Zn.length>36)throw new Error("Too many keys in config minifier map");var e={};return ri(n,e,"_max"),e}function ri(n,e,t){var r=t==="_min"?lc:dc;for(var i in n)if(n.hasOwnProperty(i)){var s=Array.isArray(n)?n[Number.parseInt(i,10)]:n[i];if(typeof s=="object"&&s!=null){var o=s instanceof Array?[]:{};if(Array.isArray(e))e[Number.parseInt(i,10)]=o;else{var a=r(i,Zn);e[a]=o}ri(s,o,t)}else{var l=r(s,ac);if(Array.isArray(e))e[Number.parseInt(i,10)]=l;else{var d=r(i,Zn);e[d]=l}}}}function lc(n,e){if(typeof n=="string"&&n.length===1)return"___"+n;var t=e.indexOf(n);return t===-1?n:t.toString(36)}function dc(n,e){return typeof n=="string"&&n.length===1?e[parseInt(n,36)]:typeof n=="string"&&n.substr(0,3)==="___"?n[3]:n}function Cr(n,e,t){return(e=uc(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function uc(n){var e=hc(n,"string");return typeof e=="symbol"?e:e+""}function hc(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class Hr{constructor(e,t){Cr(this,"name",void 0),Cr(this,"origin",void 0),Cr(this,"isPropagationStopped",void 0),this.name=e,this.origin=t,this.isPropagationStopped=!1}stopPropagation(){this.isPropagationStopped=!0}}function Nn(n,e,t){return(e=cc(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function cc(n){var e=mc(n,"string");return typeof e=="symbol"?e:e+""}function mc(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}let la=class extends Oe{constructor(e){super(),Nn(this,"_layoutManager",void 0),Nn(this,"_dontPropagateToParent",void 0),Nn(this,"_childEventSource",void 0),Nn(this,"_boundOnEventFromChild",void 0),this._layoutManager=e,this._dontPropagateToParent=null,this._childEventSource=null,this.on(Oe.ALL_EVENT,this._onEventFromThis.bind(this)),this._boundOnEventFromChild=this._onEventFromChild.bind(this),T(window).on("gl_child_event",this._boundOnEventFromChild)}_onEventFromThis(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];this._layoutManager.isSubWindow&&t[0]!==this._dontPropagateToParent&&this._propagateToParent(t),this._propagateToChildren(t),this._dontPropagateToParent=null,this._childEventSource=null}_$onEventFromParent(e){this._dontPropagateToParent=e[0],this.emit.apply(this,e)}_onEventFromChild(e){this._childEventSource=e.originalEvent.__gl,this.emit.apply(this,e.originalEvent.__glArgs)}_propagateToParent(e){var t,r="gl_child_event",i=(t=window.opener)===null||t===void 0?void 0:t.document.createEvent("HTMLEvents");i.initEvent(r,!0,!0),i.eventName=r,i.__glArgs=e,i.__gl=this._layoutManager,window.opener.dispatchEvent(i)}_propagateToChildren(e){for(var t=0;t<this._layoutManager.openPopouts.length;t++){var r=this._layoutManager.openPopouts[t].getGlInstance();r&&r!==this._childEventSource&&r.eventHub._$onEventFromParent(e)}}destroy(){T(window).off("gl_child_event",this._boundOnEventFromChild)}};function da(n,e,t){return n.on(e,t),()=>{n.off(e,t)}}function ua(n){return(e,t)=>da(e,n,t)}function ha(n){return function(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),i=1;i<t;i++)r[i-1]=arguments[i];e.emit(n,...r)}}function ca(n){return(e,t)=>{var r=c.useRef(null),i=c.useRef(()=>!1);if(r.current!=e||i.current!=t){var s;(s=r.current)===null||s===void 0||s.off(n,i.current),e==null||e.on(n,t)}r.current=e,i.current=t,c.useEffect(()=>()=>{var o;return(o=r.current)===null||o===void 0?void 0:o.off(n,i.current)},[])}}function It(n){return{listen:ua(n),emit:ha(n),useListener:ca(n)}}const pc=Object.freeze(Object.defineProperty({__proto__:null,BubblingEvent:Hr,DragListener:On,EventEmitter:Oe,EventHub:la,ReactComponentHandler:aa,animFrame:ei,filterXss:nc,getHashValue:oa,getQueryStringParam:sa,getUniqueId:Xn,listenForEvent:da,makeEmitFunction:ha,makeEventFunctions:It,makeListenFunction:ua,makeUseListenerFunction:ca,minifyConfig:ni,removeFromArray:tc,stripTags:ti,unminifyConfig:Fr},Symbol.toStringTag,{value:"Module"}));function yt(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=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 r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class ma extends Oe{constructor(e,t,r,i,s){super(),yt(this,"isInitialised",!1),yt(this,"_config",void 0),yt(this,"_dimensions",void 0),yt(this,"_parentId",void 0),yt(this,"_indexInParent",void 0),yt(this,"_layoutManager",void 0),yt(this,"_popoutWindow",null),yt(this,"_id",null),this._config=e,this._dimensions=t,this._parentId=r,this._indexInParent=i,this._layoutManager=s,this._createWindow()}toConfig(){var e,t,r,i,s,o,a,l,d,h,p;if(this.isInitialised===!1)throw new Error("Can't create config, layout not yet initialised");return{dimensions:{width:(e=this.getGlInstance())===null||e===void 0?void 0:e.width,height:(t=this.getGlInstance())===null||t===void 0?void 0:t.height,left:(r=(i=(s=this._popoutWindow)===null||s===void 0?void 0:s.screenX)!==null&&i!==void 0?i:(o=this._popoutWindow)===null||o===void 0?void 0:o.screenLeft)!==null&&r!==void 0?r: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:(p=this.getGlInstance())===null||p===void 0?void 0:p.toConfig().content,parentId:this._parentId,indexInParent:this._indexInParent}}getGlInstance(){var e;return(e=this._popoutWindow)===null||e===void 0?void 0:e.__glInstance}getWindow(){return this._popoutWindow}close(){if(this.getGlInstance()){var e;(e=this.getGlInstance())===null||e===void 0||e._$closeWindow()}else try{var t;(t=this.getWindow())===null||t===void 0||t.close()}catch{}}popIn(){var e;this._indexInParent;var t=null,r=null;if(this._parentId){var i;if(t=T.extend(!0,{},(i=this.getGlInstance())===null||i===void 0?void 0:i.toConfig()).content[0],r=this._layoutManager.root.getItemsById(this._parentId)[0],!r){var s;((s=this._layoutManager.root.contentItems.length)!==null&&s!==void 0?s:0)>0?r=this._layoutManager.root.contentItems[0]:r=this._layoutManager.root}}t&&((e=r)===null||e===void 0||e.addChild(t,this._indexInParent),this.close())}_createWindow(){var e=this._createUrl(),t=Math.floor(Math.random()*1e6).toString(36),r=this._serializeWindowOptions({width:this._dimensions.width,height:this._dimensions.height,innerWidth:this._dimensions.width,innerHeight:this._dimensions.height,menubar:"no",toolbar:"no",location:"no",personalbar:"no",resizable:"yes",scrollbars:"no",status:"no"});if(this._popoutWindow=window.open(e,t,r),!this._popoutWindow)if(this._layoutManager.config.settings.blockedPopoutsThrowError===!0){var i=new Error("Popout blocked");throw i.type="popoutBlocked",i}else return;T(this._popoutWindow).on("load",this._positionWindow.bind(this)).on("unload beforeunload",this._onClose.bind(this));var s=window.setInterval(()=>{var o;(o=this._popoutWindow)!==null&&o!==void 0&&o.__glInstance&&this._popoutWindow.__glInstance.isInitialised&&(this._onInitialised(),window.clearInterval(s))},10)}_serializeWindowOptions(e){var t=[],r;for(r in e)t.push(r+"="+e[r]);return t.join(",")}_createUrl(){var e={content:this._config},t="gl-window-config-"+Xn();e=ni(e);try{localStorage.setItem(t,JSON.stringify(e))}catch(i){throw new Error("Error while writing to localStorage "+i.toString())}var r=document.location.href.split("?");return r.length===1?r[0]+"?gl-window="+t:document.location.href+"&gl-window="+t}_positionWindow(){var e,t;(e=this._popoutWindow)===null||e===void 0||e.moveTo(this._dimensions.left,this._dimensions.top),(t=this._popoutWindow)===null||t===void 0||t.focus()}_onInitialised(){var e;this.isInitialised=!0,(e=this.getGlInstance())===null||e===void 0||e.on("popIn",this.popIn,this),this.emit("initialised")}_onClose(){setTimeout(this.emit.bind(this,"closed"),50)}}function ve(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 r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class Kt extends Oe{constructor(e,t,r,i,s,o){var a,l,d,h,p,m,v,f;if(super(),ve(this,"_dragListener",void 0),ve(this,"_layoutManager",void 0),ve(this,"_contentItem",void 0),ve(this,"_originalParent",void 0),ve(this,"_area",null),ve(this,"_lastValidArea",null),ve(this,"_minX",void 0),ve(this,"_maxX",void 0),ve(this,"_minY",void 0),ve(this,"_maxY",void 0),ve(this,"_width",void 0),ve(this,"_height",void 0),ve(this,"_sided",void 0),ve(this,"element",void 0),ve(this,"childElementContainer",void 0),ve(this,"_proxyTab",void 0),this._dragListener=r,this._layoutManager=i,this._contentItem=s,this._originalParent=o,this._dragListener.on("drag",this._onDrag,this),this._dragListener.on("dragStop",this._onDrop,this),this._contentItem.tab&&this._contentItem.tab.element){var g,b;this._layoutManager.tabDropPlaceholder.width((g=this._contentItem.tab.element.outerWidth(!0))!==null&&g!==void 0?g:0),this._layoutManager.tabDropPlaceholder.height((b=this._contentItem.tab.element.outerHeight(!0))!==null&&b!==void 0?b:0)}if(this.element=T(Kt._template),o&&o._side&&(this._sided=o._sided,this.element.addClass("lm_"+o._side),["right","bottom"].indexOf(o._side.toString())>=0&&this.element.find(".lm_content").after(this.element.find(".lm_header"))),this.element.css({left:e,top:t}),this._proxyTab=this.element.find(".lm_tab"),this._proxyTab.attr("title",ti((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(s.element),this._updateTree(),this._layoutManager._$calculateItemAreas(),T(document.body).append(this.element),this._setDimensions(),!this._contentItem.tab&&this._proxyTab.length){var S,w;this._layoutManager.tabDropPlaceholder.width((S=this._proxyTab.outerWidth(!0))!==null&&S!==void 0?S:0),this._layoutManager.tabDropPlaceholder.height((w=this._proxyTab.outerHeight(!0))!==null&&w!==void 0?w:0)}var y=this._layoutManager.container.offset();this._minX=(d=y==null?void 0:y.left)!==null&&d!==void 0?d:0,this._minY=(h=y==null?void 0:y.top)!==null&&h!==void 0?h:0,this._maxX=((p=this._layoutManager.container.width())!==null&&p!==void 0?p:0)+this._minX,this._maxY=((m=this._layoutManager.container.height())!==null&&m!==void 0?m:0)+this._minY,this._width=(v=this.element.width())!==null&&v!==void 0?v:0,this._height=(f=this.element.height())!==null&&f!==void 0?f:0,this._setDropPosition(e,t),this._layoutManager.emit("itemPickedUp",this._contentItem)}_onDrag(e,t,r){var i,s,o=(i=r.pageX)!==null&&i!==void 0?i:0,a=(s=r.pageY)!==null&&s!==void 0?s:0,l=o>this._minX&&o<this._maxX&&a>this._minY&&a<this._maxY;!l&&this._layoutManager.config.settings.constrainDragToContainer===!0||this._setDropPosition(o,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,r=e.dragProxyHeight;this.element.width(t),this.element.height(r),t-=this._sided?e.headerHeight:0,r-=this._sided?0:e.headerHeight,this.childElementContainer.width(t),this.childElementContainer.height(r),this._contentItem.element.width(t),this._contentItem.element.height(r),this._contentItem.callDownwards("_$show"),this._contentItem.callDownwards("setSize")}}ve(Kt,"_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 An(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 r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class pa{constructor(e,t,r){An(this,"_element",void 0),An(this,"_itemConfig",void 0),An(this,"_layoutManager",void 0),An(this,"_dragListener",void 0),this._element=e,this._itemConfig=t,this._layoutManager=r,this._dragListener=this._createDragListener()}_createDragListener(){return this._dragListener=new On(this._element,this._layoutManager.root,!0),this._dragListener.on("dragStart",this._onDragStart,this),this._dragListener.on("dragStop",this._createDragListener,this),this._dragListener}_onDragStart(e,t){var r=this._itemConfig;typeof r=="function"&&(r=r());var i=this._layoutManager._$normalizeContentItem(T.extend(!0,{},r));new Kt(e,t,this._dragListener,this._layoutManager,i,null)}}function Ln(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 r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class va{constructor(e,t,r){Ln(this,"_element",T(window)),Ln(this,"_itemConfig",void 0),Ln(this,"_layoutManager",void 0),Ln(this,"_dragListener",void 0),this._itemConfig=e,this._layoutManager=t,this._createDragListener(r)}_createDragListener(e){this._dragListener&&this._dragListener.destroy(),this._element&&this._layoutManager&&(this._dragListener=new On(this._element,this._layoutManager.root,!0),this._dragListener.on("dragStart",this._onDragStart,this),this._dragListener.on("dragStop",this._destroy,this),this._dragListener.onMouseDown(e),this._dragListener._startDrag())}_destroy(){this._dragListener=void 0,this._element=void 0,this._itemConfig=void 0,this._layoutManager=void 0}_onDragStart(e,t){if(!(!this._dragListener||!this._layoutManager)){var r=this._itemConfig;typeof r=="function"&&(r=r());var i=this._layoutManager._$normalizeContentItem(T.extend(!0,{},r));new Kt(e,t,this._dragListener,this._layoutManager,i,null)}}}function fa(n,e,t){return(e=_c(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function _c(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 r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class xn{constructor(){fa(this,"element",T(xn._template)),T(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()}}fa(xn,"_template",'<div class="lm_dropTargetIndicator"><div class="lm_inner"></div></div>');function wr(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=Tc(n,"string");return typeof e=="symbol"?e:e+""}function Tc(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class vn{constructor(e,t,r,i){wr(this,"element",void 0),wr(this,"_header",void 0),wr(this,"_action",void 0),this._header=e,this.element=T('<li class="'+r+'" title="'+t+'"></li>'),this._header.on("destroy",this._$destroy,this),this._action=i,this.element.on("click",this._action),this._header.controlsContainer.append(this.element)}_$destroy(){this.element.off(),this.element.remove()}}function Oc(n,e,t){return(e=xc(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function xc(n){var e=Ic(n,"string");return typeof e=="symbol"?e:e+""}function Ic(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class Rt extends Error{constructor(e,t){super(),Oc(this,"node",void 0),this.name="Configuration Error",this.message=e,this.node=t}}const Dc=Object.freeze(Object.defineProperty({__proto__:null,ConfigurationError:Rt},Symbol.toStringTag,{value:"Module"}));function me(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 r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function Ht(n){return n.isStack}function Le(n){return n.isComponent}function ga(n){return n.isRoot}class ge extends Oe{constructor(e,t,r,i){super(),me(this,"config",void 0),me(this,"type",void 0),me(this,"contentItems",void 0),me(this,"parent",void 0),me(this,"layoutManager",void 0),me(this,"element",void 0),me(this,"childElementContainer",void 0),me(this,"componentName",void 0),me(this,"isInitialised",!1),me(this,"isMaximised",!1),me(this,"isRoot",!1),me(this,"isRow",!1),me(this,"isColumn",!1),me(this,"isStack",!1),me(this,"isComponent",!1),me(this,"tab",void 0),me(this,"_pendingEventPropagations",void 0),me(this,"_throttledEvents",void 0),this.element=i,this.config=this._extendItemNode(t),this.type=t.type,this.contentItems=[],this.parent=r,this.layoutManager=e,this._pendingEventPropagations={},this._throttledEvents=["stateChanged"],this.on(Oe.ALL_EVENT,this._propagateEvent,this),t.content&&this._createContentItems(t)}callDownwards(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;r!==!0&&i!==!0&&this[e].apply(this,t);for(var s=0;s<this.contentItems.length;s++)this.contentItems[s].callDownwards(e,t,r);r===!0&&i!==!0&&this[e].apply(this,t)}removeChild(e){var t,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,i=this.contentItems.indexOf(e);if(i===-1)throw new Error("Can't remove child item. Unknown content item");if(r!==!0&&this.contentItems[i]._$destroy(),this.contentItems.splice(i,1),(t=this.config.content)===null||t===void 0||t.splice(i,1),this.contentItems.length>0)this.callDownwards("setSize");else if(this.type!=="root"&&this.config.isClosable){var s;(s=this.parent)===null||s===void 0||s.removeChild(this)}}addChild(e,t){e=this.layoutManager._$normalizeContentItem(e,this),t===void 0&&(t=this.contentItems.length),this.contentItems.splice(t,0,e),this.config.content===void 0&&(this.config.content=[]),this.config.content.splice(t,0,e.config),e.parent=this,e.parent.isInitialised===!0&&e.isInitialised===!1&&e._$init()}replaceChild(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;t=this.layoutManager._$normalizeContentItem(t);var i=this.contentItems.indexOf(e),s=e.element[0].parentNode;if(i===-1)throw new Error("Can't replace child. oldChild is not child of this");s==null||s.replaceChild(t.element[0],e.element[0]),r===!0&&(e.parent=null,e._$destroy()),this.contentItems[i]=t,t.parent=this,Ht(this)&&(this.header.tabs[i].contentItem=t),t.parent.isInitialised===!0&&t.isInitialised===!1&&t._$init(),this.callDownwards("setSize")}remove(){var e;(e=this.parent)===null||e===void 0||e.removeChild(this)}popout(){var e=this.layoutManager.createPopout(this);return this.emitBubblingEvent("stateChanged"),e}toggleMaximise(e){e&&e.preventDefault(),this.isMaximised===!0?this.layoutManager._$minimiseItem(this):this.layoutManager._$maximiseItem(this),this.isMaximised=!this.isMaximised,this.emitBubblingEvent("stateChanged")}select(){this.layoutManager.selectedItem!==this&&(this.layoutManager.selectItem(this,!0),this.element.addClass("lm_selected"))}deselect(){this.layoutManager.selectedItem===this&&(this.layoutManager.selectedItem=null,this.element.removeClass("lm_selected"))}setTitle(e){this.config.title=e,this.emit("titleChanged",e),this.emitBubblingEvent("stateChanged")}hasId(e){if(this.config.id){if(typeof this.config.id=="string")return this.config.id===e;if(this.config.id instanceof Array)return this.config.id.indexOf(e)!==-1}else return!1}addId(e){this.hasId(e)||(this.config.id?typeof this.config.id=="string"?this.config.id=[this.config.id,e]:this.config.id instanceof Array&&this.config.id.push(e):this.config.id=e)}removeId(e){if(!this.hasId(e))throw new Error("Id not found");if(typeof this.config.id=="string")delete this.config.id;else if(this.config.id instanceof Array){var t=this.config.id.indexOf(e);this.config.id.splice(t,1)}}getItemsByFilter(e){var t=[],r=function(s){for(var o=0;o<s.contentItems.length;o++)e(s.contentItems[o])===!0&&t.push(s.contentItems[o]),r(s.contentItems[o])};return r(this),t}getItemsById(e){return this.getItemsByFilter(function(t){return t.config.id instanceof Array?t.config.id.indexOf(e)!==-1:t.config.id===e})}getItemsByType(e){return this._$getItemsByProperty("type",e)}getComponentsByName(e){for(var t=this._$getItemsByProperty("componentName",e),r=[],i=0;i<t.length;i++)r.push(t[i].instance);return r}_$getItemsByProperty(e,t){return this.getItemsByFilter(function(r){return r[e]===t})}_$setParent(e){this.parent=e}_$highlightDropZone(e,t,r){var i;(i=this.layoutManager.dropTargetIndicator)===null||i===void 0||i.highlightArea(r)}_$onDrop(e,t){this.addChild(e)}_$hide(){this._callOnActiveComponents("hide"),this.element.hide(),this.layoutManager.updateSize()}_$show(){this._callOnActiveComponents("show"),this.element.show(),this.layoutManager.updateSize()}_callOnActiveComponents(e){for(var t=this.getItemsByType("stack"),r=null,i=0;i<t.length;i++)r=t[i].getActiveContentItem(),r&&Le(r)&&r.container[e]()}_$destroy(){this.emitBubblingEvent("beforeItemDestroyed"),this.callDownwards("_$destroy",[],!0,!0),this.element.remove(),this.emitBubblingEvent("itemDestroyed")}_$getArea(e){var t,r,i;e=e||this.element;var s=(t=e.offset())!==null&&t!==void 0?t:{left:0,top:0},o=(r=e.width())!==null&&r!==void 0?r:0,a=(i=e.height())!==null&&i!==void 0?i:0;return{x1:s.left,y1:s.top,x2:s.left+o,y2:s.top+a,surface:o*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 Hr(e,this);this.emit(e,t)}_createContentItems(e){var t;if(!(e.content instanceof Array))throw new Rt("content must be an Array",e);for(var r=0;r<e.content.length;r++)t=this.layoutManager.createContentItem(e.content[r],this),this.contentItems.push(t)}_extendItemNode(e){for(var[t,r]of Object.entries(ia)){var i=t;e[i]===void 0&&(e[i]=r)}return e}_propagateEvent(e,t){t instanceof Hr&&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,ei(this._propagateEventToLayoutManager.bind(this,e,t)))}_propagateEventToLayoutManager(e,t){this._pendingEventPropagations[e]=!1,this.layoutManager.emit(e,t)}}function cn(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 r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class ba extends ge{constructor(e,t,r){var i;Object.entries((i=e.config.settings.defaultComponentConfig)!==null&&i!==void 0?i:{}).forEach(a=>{var[l,d]=a;t[l]===void 0&&(t[l]=d)}),super(e,t,r,T()),cn(this,"config",void 0),cn(this,"componentName",void 0),cn(this,"container",void 0),cn(this,"parent",void 0),cn(this,"instance",void 0),this.config=t,this.parent=r;var s=e.getComponent(this.config.componentName)||e.getFallbackComponent(),o=T.extend(!0,{},this.config.componentState||{});if(s==null)throw new Rt('Unknown component "'+this.config.componentName+'"');o.componentName=this.config.componentName,this.componentName=this.config.componentName,this.config.title===""&&(this.config.title=this.config.componentName),this.isComponent=!0,this.container=new Rr(this.config,this,e),this.instance=new s(this.container,o),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(){ge.prototype._$init.call(this),this.container.emit("open")}_$hide(){this.container.hide(),ge.prototype._$hide.call(this)}_$show(e){this.container.show(),(this.container._config.isFocusOnShow||e)&&this.container._contentElement[0].focus({preventScroll:!0}),ge.prototype._$show.call(this)}_$destroy(){this.container.emit("destroy",this),ge.prototype._$destroy.call(this)}_$getArea(){return null}}function $e(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 r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class wn extends ge{constructor(e,t,r,i){super(t,r,i,T('<div class="lm_item lm_'+(e?"column":"row")+'"></div>')),$e(this,"isRow",void 0),$e(this,"isColumn",void 0),$e(this,"childElementContainer",void 0),$e(this,"parent",void 0),$e(this,"_splitter",[]),$e(this,"_splitterSize",void 0),$e(this,"_splitterGrabSize",void 0),$e(this,"_isColumn",void 0),$e(this,"_dimension",void 0),$e(this,"_splitterPosition",null),$e(this,"_splitterMinPosition",null),$e(this,"_splitterMaxPosition",null),this.parent=i,this.isRow=!e,this.isColumn=e,this.childElementContainer=this.element,this._splitterSize=t.config.dimensions.borderWidth,this._splitterGrabSize=t.config.dimensions.borderGrabWidth,this._isColumn=e,this._dimension=e?"height":"width",this._splitterPosition=null,this._splitterMinPosition=null,this._splitterMaxPosition=null}addChild(e,t,r){var i,s,o,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),ge.prototype.addChild.call(this,e,t),i=1/this.contentItems.length*100,r===!0){this.emitBubblingEvent("stateChanged");return}for(o=0;o<this.contentItems.length;o++)if(this.contentItems[o]===e)e.config[this._dimension]=i;else{var l;s=((l=this.contentItems[o].config[this._dimension])!==null&&l!==void 0?l:0)*(100-i)/100,this.contentItems[o].config[this._dimension]=s}this.callDownwards("setSize"),this.emitBubblingEvent("stateChanged")}removeChild(e,t){var r,i=(r=e.config[this._dimension])!==null&&r!==void 0?r:0,s=this.contentItems.indexOf(e),o=Math.max(s-1,0),a,l;if(s===-1)throw new Error("Can't remove child. ContentItem is not child of this Row or Column");for(this._splitter[o]&&(this._splitter[o]._$destroy(),this._splitter.splice(o,1)),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)+i/(this.contentItems.length-1)}if(ge.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 r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,i=e.config[this._dimension];t.config[this._dimension]=i,super.replaceChild(e,t,r),this.callDownwards("setSize"),this.emitBubblingEvent("stateChanged")}setSize(){this.contentItems.length>0&&(this._calculateRelativeSizes(),this._setAbsoluteSizes()),this.emitBubblingEvent("stateChanged"),this.emit("resize")}_$init(){if(this.isInitialised!==!0){var e;for(ge.prototype._$init.call(this),e=0;e<this.contentItems.length-1;e++)this.contentItems[e].element.after(this._createSplitter(e).element)}}_setAbsoluteSizes(){var e,t=this._calculateAbsoluteSizes();for(e=0;e<this.contentItems.length;e++)t.additionalPixel-e>0&&t.itemSizes[e]++,this._isColumn?(this.contentItems[e].element.width(t.totalWidth),this.contentItems[e].element.height(t.itemSizes[e])):(this.contentItems[e].element.width(t.itemSizes[e]),this.contentItems[e].element.height(t.totalHeight))}_calculateAbsoluteSizes(){var e,t,r=(this.contentItems.length-1)*this._splitterSize,i=(e=this.element.width())!==null&&e!==void 0?e:0,s=(t=this.element.height())!==null&&t!==void 0?t:0,o=0,a=[];this._isColumn?s-=r:i-=r;for(var l=0;l<this.contentItems.length;l++){var d,h,p=this._isColumn?Math.floor(s*(((d=this.contentItems[l].config.height)!==null&&d!==void 0?d:0)/100)):Math.floor(i*(((h=this.contentItems[l].config.width)!==null&&h!==void 0?h:0)/100));o+=p,a.push(p)}var m=Math.floor((this._isColumn?s:i)-o);return{itemSizes:a,additionalPixel:m,totalWidth:i,totalHeight:s}}_calculateRelativeSizes(){for(var e=0,t=[],r=this._isColumn?"height":"width",i=0;i<this.contentItems.length;i++){var s=this.contentItems[i].config[r];s!=null?e+=s:t.push(this.contentItems[i])}if(Math.round(e)===100){this._respectMinItemWidth();return}if(Math.round(e)<100&&t.length>0){for(var o=0;o<t.length;o++)t[o].config[r]=(100-e)/t.length;this._respectMinItemWidth();return}if(Math.round(e)>100)for(var a=0;a<t.length;a++)t[a].config[r]=50,e+=50;for(var l=0;l<this.contentItems.length;l++){var d;this.contentItems[l].config[r]=((d=this.contentItems[l].config[r])!==null&&d!==void 0?d:0)/e*100}this._respectMinItemWidth()}_respectMinItemWidth(){var e,t=this.layoutManager.config.dimensions&&(e=this.layoutManager.config.dimensions.minItemWidth)!==null&&e!==void 0?e:0,r=[],i=0,s=0,o=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 p=d.itemSizes[h];p<t?(s+=t-p,l={width:t}):(i+=p-t,l={width:p},r.push(l)),a.push(l)}if(!(s===0||s>i)){var m=s/i;o=s;for(var v=0;v<r.length;v++){l=r[v];var f=Math.round((l.width-t)*m);o-=f,l.width-=f}o!==0&&(a[a.length-1].width-=o);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 ya(this._isColumn,this._splitterSize,this._splitterGrabSize),t.on("drag",this._onSplitterDrag.bind(this,t),this),t.on("dragStop",this._onSplitterDragStop.bind(this,t),this),t.on("dragStart",this._onSplitterDragStart.bind(this,t),this),this._splitter.splice(e,0,t),t}_getItemsForSplitter(e){var t=this._splitter.indexOf(e);if(t<0)throw new Error("Splitter not found in RowOrColumn");return{before:this.contentItems[t],after:this.contentItems[t+1]}}_getMinimumDimensions(e){for(var t=0,r=0,i=0;i<e.length;++i){var s,o;t=Math.max((s=e[i].minWidth)!==null&&s!==void 0?s:0,t),r=Math.max((o=e[i].minHeight)!==null&&o!==void 0?o:0,r)}return{horizontal:t,vertical:r}}_onSplitterDragStart(e){var t,r,i,s,o=this._getItemsForSplitter(e),a=this.layoutManager.config.dimensions[this._isColumn?"minItemHeight":"minItemWidth"],l=this._getMinimumDimensions((t=o.before.config.content)!==null&&t!==void 0?t:[]),d=this._isColumn?l.vertical:l.horizontal,h=this._getMinimumDimensions((r=o.after.config.content)!==null&&r!==void 0?r:[]),p=this._isColumn?h.vertical:h.horizontal;this._splitterPosition=0,this._splitterMinPosition=-1*(((i=o.before.element[this._dimension]())!==null&&i!==void 0?i:0)-(d||a)),this._splitterMaxPosition=((s=o.after.element[this._dimension]())!==null&&s!==void 0?s:0)-(p||a)}_onSplitterDrag(e,t,r){var i=this._isColumn?r:t;this._splitterMaxPosition==null||this._splitterMinPosition==null||i>this._splitterMinPosition&&i<this._splitterMaxPosition&&(this._splitterPosition=i,e.element.css(this._isColumn?"top":"left",i))}_onSplitterDragStop(e){var t,r,i,s,o,a=this._getItemsForSplitter(e),l=(t=a.before.element[this._dimension]())!==null&&t!==void 0?t:0,d=(r=a.after.element[this._dimension]())!==null&&r!==void 0?r:0,h=(((i=this._splitterPosition)!==null&&i!==void 0?i:0)+l)/(l+d),p=((s=a.before.config[this._dimension])!==null&&s!==void 0?s:0)+((o=a.after.config[this._dimension])!==null&&o!==void 0?o:0);a.before.config[this._dimension]=h*p,a.after.config[this._dimension]=(1-h)*p,e.element.css({top:0,left:0}),ei(this.callDownwards.bind(this,"setSize",void 0,void 0,void 0))}}function eo(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function to(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?eo(Object(t),!0).forEach(function(r){$r(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):eo(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function $r(n,e,t){return(e=Rc(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Rc(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 r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class Ur extends ge{constructor(e,t,r){super(e,to(to({},t),{},{type:"root"}),null,T('<div class="lm_goldenlayout lm_item lm_root"></div>')),$r(this,"childElementContainer",void 0),$r(this,"_containerElement",void 0),this.isRoot=!0,this.type="root",this.childElementContainer=this.element,this._containerElement=r,this._containerElement.append(this.element)}addChild(e,t){if(this.contentItems.length>0)throw new Error("Root node can only have a single child");e=this.layoutManager._$normalizeContentItem(e,this),this.childElementContainer.append(e.element),super.addChild(e,t),this.callDownwards("setSize"),this.emitBubblingEvent("stateChanged")}setSize(e,t){var r,i;e=typeof e>"u"?(r=this._containerElement.width())!==null&&r!==void 0?r:0:e,t=typeof t>"u"?(i=this._containerElement.height())!==null&&i!==void 0?i:0:t,this.element.width(e),this.element.height(t),this.contentItems[0]&&(this.contentItems[0].element.width(e),this.contentItems[0].element.height(t))}_$getArea(){var e=super._$getArea();if(e==null)throw new Error("Unable to get root area");return e}_$highlightDropZone(e,t,r){this.layoutManager.tabDropPlaceholder.remove(),super._$highlightDropZone(e,t,r)}_$onDrop(e,t){var r;if(Le(e)&&(r=this.layoutManager.createContentItem({type:"stack",header:e.config.header||{}},this),r._$init(),r.addChild(e),e=r),!this.contentItems.length)this.addChild(e);else{var{side:i}=t,s=i==="left"||i==="right"?"row":"column",o=i==="left"||i==="right"?"width":"height",a=i==="left"||i==="top",l=this.contentItems[0];if(!(l instanceof wn)||l.type!=s){var d=this.layoutManager.createContentItem({type:s},this);this.replaceChild(l,d),d.addChild(e,a?0:void 0,!0),d.addChild(l,a?void 0:0,!0),l.config[o]=50,e.config[o]=50,d.callDownwards("setSize")}else{var h,p=l.contentItems[a?0:l.contentItems.length-1];l.addChild(e,a?0:void 0,!0),p.config[o]=((h=p.config[o])!==null&&h!==void 0?h:0)*.5,e.config[o]=p.config[o],l.callDownwards("setSize")}}}}function no(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function Vt(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?no(Object(t),!0).forEach(function(r){Ne(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):no(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function Ne(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=$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 r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class Br extends ge{constructor(e,t,r){var i,s,o,a,l,d,h,p,m;super(e,t,r,T('<div class="lm_item lm_stack"></div>')),Ne(this,"_activeContentItem",null),Ne(this,"_header",void 0),Ne(this,"childElementContainer",T('<div class="lm_items"></div>')),Ne(this,"header",void 0),Ne(this,"parent",void 0),Ne(this,"isStack",!0),Ne(this,"_dropSegment",null),Ne(this,"_contentAreaDimensions",null),Ne(this,"_dropIndex",void 0),Ne(this,"_side",void 0),Ne(this,"_sided",!1),Ne(this,"config",void 0),this.parent=r,this.config=t;var v=e.config;this._side=!1,this._header={show:((i=v.settings)===null||i===void 0?void 0:i.hasHeaders)&&t.hasHeaders!==!1,popout:(s=v.settings)!==null&&s!==void 0&&s.showPopoutIcon?(o=v.labels)===null||o===void 0?void 0:o.popout:void 0,maximise:(a=v.settings)!==null&&a!==void 0&&a.showMaximiseIcon?(l=v.labels)===null||l===void 0?void 0:l.maximise:void 0,close:(d=v.settings)!==null&&d!==void 0&&d.showCloseIcon?(h=v.labels)===null||h===void 0?void 0:h.close:void 0,minimise:(p=(m=v.labels)===null||m===void 0?void 0:m.minimise)!==null&&p!==void 0?p:void 0},v.header&&(this._header=Vt(Vt({},this._header),v.header)),t.header&&(this._header=Vt(Vt({},this._header),t.header)),t.content&&t.content[0]&&t.content[0].header&&(this._header=Vt(Vt({},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,r,i,s,o=this._header.show&&(e=(t=this.layoutManager.config.dimensions)===null||t===void 0?void 0:t.headerHeight)!==null&&e!==void 0?e:0,a=((r=this.element.width())!==null&&r!==void 0?r:0)-(this._sided?o:0),l=((i=this.element.height())!==null&&i!==void 0?i:0)-(this._sided?0:o);for(this.childElementContainer.width(a),this.childElementContainer.height(l),s=0;s<this.contentItems.length;s++)this.contentItems[s].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),Le(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,r=this.contentItems.indexOf(e);super.removeChild(e,t),this.header.removeTab(e),this.header.activeContentItem===e&&(this.contentItems.length>0?this.setActiveContentItem(this.contentItems[Math.max(r-1,0)]):this._activeContentItem=null),this._$validateClosability(),this.emitBubblingEvent("stateChanged")}_$validateClosability(){for(var e=this.header._isClosable(),t=0,r=this.contentItems.length;t<r;t++){var i;if(!e)break;e=(i=this.contentItems[t].config.isClosable)!==null&&i!==void 0?i:!1}this.header._$setClosable(e)}_$destroy(){ge.prototype._$destroy.call(this),this.header._$destroy()}_$onDrop(e){if(this._dropSegment==="header"){this._resetHeaderDropZone(),this.addChild(e,this._dropIndex);return}if(this._dropSegment==="body"){this.addChild(e);return}var t=this._dropSegment==="top"||this._dropSegment==="bottom",r=this._dropSegment==="left"||this._dropSegment==="right",i=this._dropSegment==="top"||this._dropSegment==="left",s=this.parent instanceof wn&&(t&&this.parent.isColumn||r&&this.parent.isRow),o=t?"column":"row",a=t?"height":"width";if(Le(e)){var l=this.layoutManager.createContentItem({type:"stack",header:e.config.header||{}},this);l._$init(),l.addChild(e),e=l}if(s){var d,h=this.parent.contentItems.indexOf(this);this.parent.addChild(e,i?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 p,m=this.layoutManager.createContentItem({type:o},this);(p=this.parent)===null||p===void 0||p.replaceChild(this,m),m.addChild(e,i?0:void 0,!0),m.addChild(this,i?void 0:0,!0),this.config[a]=50,e.config[a]=50,m.callDownwards("setSize")}}_$highlightDropZone(e,t){if(this._contentAreaDimensions)for(var[r,i]of Object.entries(this._contentAreaDimensions)){var s=i.hoverArea;if(s.x1<e&&s.x2>e&&s.y1<t&&s.y2>t){r==="header"?(this._dropSegment="header",this._highlightHeaderDropZone(e)):(this._resetHeaderDropZone(),this._highlightBodyDropZone(r));return}}}_$getArea(){if(this.element.is(":visible")===!1)return null;var e=super._$getArea(this.header.element),t=super._$getArea(this.childElementContainer);if(e==null||t==null)return null;var r=t.x2-t.x1,i=t.y2-t.y1;return this._contentAreaDimensions={header:{hoverArea:{x1:e.x1,y1:e.y1,x2:e.x2,y2:e.y2},highlightArea:{x1:e.x1,y1:e.y1,x2:e.x2,y2:e.y2}}},this._activeContentItem&&this._activeContentItem.isComponent===!1?e:this.contentItems.length===0?(this._contentAreaDimensions.body={hoverArea:{x1:t.x1,y1:t.y1,x2:t.x2,y2:t.y2},highlightArea:{x1:t.x1,y1:t.y1,x2:t.x2,y2:t.y2}},super._$getArea(this.element)):(this._contentAreaDimensions.left={hoverArea:{x1:t.x1,y1:t.y1,x2:t.x1+r*.25,y2:t.y2},highlightArea:{x1:t.x1,y1:t.y1,x2:t.x1+r*.5,y2:t.y2}},this._contentAreaDimensions.top={hoverArea:{x1:t.x1+r*.25,y1:t.y1,x2:t.x1+r*.75,y2:t.y1+i*.5},highlightArea:{x1:t.x1,y1:t.y1,x2:t.x2,y2:t.y1+i*.5}},this._contentAreaDimensions.right={hoverArea:{x1:t.x1+r*.75,y1:t.y1,x2:t.x2,y2:t.y2},highlightArea:{x1:t.x1+r*.5,y1:t.y1,x2:t.x2,y2:t.y2}},this._contentAreaDimensions.bottom={hoverArea:{x1:t.x1+r*.25,y1:t.y1+i*.5,x2:t.x1+r*.75,y2:t.y2},highlightArea:{x1:t.x1,y1:t.y1+i*.5,x2:t.x2,y2:t.y2}},super._$getArea(this.element))}_highlightHeaderDropZone(e){var t,r,i,s,o,a,l,d,h,p,m,v,f,g,b,S,w=this.header.tabs.length;if(w===0){var y,D,V,X,G,A,M,J,W=this.header.element.offset();(y=this.layoutManager.dropTargetIndicator)===null||y===void 0||y.highlightArea({x1:(D=W==null?void 0:W.left)!==null&&D!==void 0?D:0,x2:((V=W==null?void 0:W.left)!==null&&V!==void 0?V:0)+100,y1:(X=(G=this.header.element.offset())===null||G===void 0?void 0:G.top)!==null&&X!==void 0?X:0,y2:((A=(M=this.header.element.offset())===null||M===void 0?void 0:M.top)!==null&&A!==void 0?A:0)+((J=this.header.element.innerHeight())!==null&&J!==void 0?J:0)});return}var k=this.header.tabsContainer,z=(t=k.get(0))===null||t===void 0?void 0:t.getBoundingClientRect(),F=(r=this.layoutManager.tabDropPlaceholder.get(0))===null||r===void 0?void 0:r.getBoundingClientRect();if(!(!z||!F)){e<z.left?e=z.left+1:e>z.right&&(e=z.right-1);var j,H;if(!(F.left<e&&e<F.right)){for(var U=0;U<w;U++){var ce;if(j=this.header.tabs[U].element,H=(ce=j.get(0))===null||ce===void 0?void 0:ce.getBoundingClientRect(),H&&H.left<e&&e<H.right){this._dropIndex=U;break}}if(j&&H&&e<H.left+H.width*.5)j.before(this.layoutManager.tabDropPlaceholder);else if(j){var tt;this._dropIndex=Math.min(((tt=this._dropIndex)!==null&&tt!==void 0?tt:0)+1,w),j.after(this.layoutManager.tabDropPlaceholder)}}var Ge=(i=(s=this.layoutManager.tabDropPlaceholder.offset())===null||s===void 0?void 0:s.left)!==null&&i!==void 0?i:0;Ge=Math.max(Ge,(o=(a=this.header.tabsContainer.offset())===null||a===void 0?void 0:a.left)!==null&&o!==void 0?o:0);var x=Ge+((l=this.layoutManager.tabDropPlaceholder.width())!==null&&l!==void 0?l:0);x=Math.min(x,((d=(h=this.header.tabsContainer.offset())===null||h===void 0?void 0:h.left)!==null&&d!==void 0?d:0)+((p=this.header.tabsContainer.innerWidth())!==null&&p!==void 0?p:0)),(m=this.layoutManager.dropTargetIndicator)===null||m===void 0||m.highlightArea({x1:Ge,x2:x,y1:(v=(f=this.header.element.offset())===null||f===void 0?void 0:f.top)!==null&&v!==void 0?v:0,y2:((g=(b=this.header.element.offset())===null||b===void 0?void 0:b.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(r=>r===this._header.show)?this._header.show:void 0;if(this.header.element.toggle(!!this._header.show),!!e&&(this._side=e,this._sided=["right","left"].indexOf(this._side.toString())>=0,this.element.removeClass("lm_left lm_right lm_bottom"),this._side&&this.element.addClass("lm_"+this._side),this.element.find(".lm_header").length&&this.childElementContainer)){var t=["right","bottom"].indexOf(this._side.toString())>=0?"before":"after";this.header.element[t](this.childElementContainer),this.callDownwards("setSize")}}_highlightBodyDropZone(e){var t,r=(t=this._contentAreaDimensions)===null||t===void 0||(t=t[e])===null||t===void 0?void 0:t.highlightArea;if(r){var i;(i=this.layoutManager.dropTargetIndicator)===null||i===void 0||i.highlightArea(r)}this._dropSegment=e}}const Uc=Object.freeze(Object.defineProperty({__proto__:null,AbstractContentItem:ge,Component:ba,ContentItem:ge,Root:Ur,RowOrColumn:wn,Stack:Br,isComponent:Le,isRoot:ga,isStack:Ht},Symbol.toStringTag,{value:"Module"}));function lt(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 r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class In{constructor(e,t){var r;lt(this,"header",void 0),lt(this,"contentItem",void 0),lt(this,"element",T(In._template)),lt(this,"titleElement",void 0),lt(this,"closeElement",void 0),lt(this,"isActive",!1),lt(this,"_layoutManager",void 0),lt(this,"_dragListener",void 0),this.header=e,this.contentItem=t,this.titleElement=this.element.find(".lm_title"),this.closeElement=this.element.find(".lm_close_tab"),this.closeElement[t.config.isClosable?"show":"hide"](),this.setTitle(t.config.title),this.contentItem.on("titleChanged",this.setTitle,this),this._layoutManager=this.contentItem.layoutManager,(r=this._layoutManager.config.settings)!==null&&r!==void 0&&r.reorderEnabled&&t.config.reorderEnabled&&(this._dragListener=new On(this.element,this._layoutManager.root),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),Le(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),Le(this.contentItem)&&(this.contentItem.container._contentElement.off(),this.contentItem.container._contentElement[0].removeEventListener("click",this._onTabContentFocusIn,!0)),this._dragListener&&(this.contentItem.off("destroy",this._dragListener.destroy,this._dragListener),this._dragListener.off("dragStart",this._onDragStart),this._dragListener=void 0),this.element.remove()}_onDragStart(e,t){var r;(r=this.contentItem.parent)!==null&&r!==void 0&&r.isMaximised&&this.contentItem.parent.toggleMaximise(),this._dragListener&&new Kt(e,t,this._dragListener,this._layoutManager,this.contentItem,this.header.parent)}_onTabContentFocusIn(){T(".lm_focusin",this._layoutManager.root.element).removeClass("lm_focusin"),this.element.addClass("lm_focusin")}_onTabContentFocusOut(){Le(this.contentItem)&&!this.contentItem.container._contentElement[0].contains(document.activeElement)&&this.element.removeClass("lm_focusin")}_onTabClick(e){if(!e||e.button===0){var t,r=this.header.parent.getActiveContentItem();this.contentItem!==r&&Le(this.contentItem)?this.header.parent.setActiveContentItem(this.contentItem):Le(this.contentItem)&&!this.contentItem.container._contentElement[0].contains(document.activeElement)&&this.contentItem.container._contentElement.focus(),Le(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(),Le(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()}}lt(In,"_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=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=zc(n,"string");return typeof e=="symbol"?e:e+""}function zc(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class pt extends Oe{constructor(e,t){var r,i;super(),q(this,"layoutManager",void 0),q(this,"element",T(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",T(pt._nextButtonTemplate)),q(this,"tabPreviousButton",T(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,(r=this.layoutManager.config.settings)!==null&&r!==void 0&&r.selectionEnabled&&(this.element.addClass("lm_selectable"),this.element.on("click",this._onHeaderClick.bind(this))),this.tabsContainer=this.element.find(".lm_tabs"),this.tabDropdownContainer=this.element.find(".lm_tabdropdown_list"),this.tabDropdownContainer.hide(),this.tabDropdownSearch=this.element.find(".lm_tabdropdown_search input"),this._handleFilterInput=this._handleFilterInput.bind(this),this._handleFilterKeydown=this._handleFilterKeydown.bind(this),this.tabDropdownSearch.on("input",this._handleFilterInput),this.tabDropdownSearch.on("keydown",this._handleFilterKeydown),this.controlsContainer=this.element.find(".lm_controls"),this.parent=t,this.parent.on("resize",this._updateTabSizes,this),this._handleItemPickedUp=this._handleItemPickedUp.bind(this),this._handleItemDropped=this._handleItemDropped.bind(this),this._handleNextMouseEnter=this._handleNextMouseEnter.bind(this),this._handleNextMouseLeave=this._handleNextMouseLeave.bind(this),this._handlePreviousMouseEnter=this._handlePreviousMouseEnter.bind(this),this._handlePreviousMouseLeave=this._handlePreviousMouseLeave.bind(this),this._handleScrollRepeat=this._handleScrollRepeat.bind(this),this._handleNextButtonMouseDown=this._handleNextButtonMouseDown.bind(this),this._handlePreviousButtonMouseDown=this._handlePreviousButtonMouseDown.bind(this),this._handleScrollButtonMouseDown=this._handleScrollButtonMouseDown.bind(this),this._handleScrollButtonMouseUp=this._handleScrollButtonMouseUp.bind(this),this._handleScrollEvent=this._handleScrollEvent.bind(this),this.tabNextButton.on("mousedown",this._handleNextButtonMouseDown),this.tabPreviousButton.on("mousedown",this._handlePreviousButtonMouseDown),this.tabsContainer.on("scroll",this._handleScrollEvent),this.layoutManager.on("itemPickedUp",this._handleItemPickedUp),this.layoutManager.on("itemDropped",this._handleItemDropped),this.tabsContainer.before(this.tabPreviousButton),this.tabPreviousButton=this.tabPreviousButton.find(">:first-child"),this.tabPreviousButton.hide(),this._showAdditionalTabsDropdown=this._showAdditionalTabsDropdown.bind(this),this._hideAdditionalTabsDropdown=this._hideAdditionalTabsDropdown.bind(this),this._tabControlOffset=(i=this.layoutManager.config.settings)===null||i===void 0?void 0:i.tabControlOffset,this._createControls()}createTab(e,t){for(var r=0;r<this.tabs.length;r++)if(this.tabs[r].contentItem===e)return;var i=new In(this,e);if(this.tabs.length===0){this.tabs.push(i),this.tabsContainer.append(i.element);return}t===void 0&&(t=this.tabs.length),t>0?this.tabs[t-1].element.after(i.element):this.tabs[0].element.before(i.element),this.tabs.splice(t,0,i),this._updateTabSizes()}removeTab(e){for(var t=0;t<this.tabs.length;t++)if(this.tabs[t].contentItem===e){this.tabs[t]._$destroy(),this.tabs.splice(t,1);return}throw new Error("contentItem is not controlled by this header")}setActiveContentItem(e){for(var t,r,i,s,o=0;o<this.tabs.length;o++)s=this.tabs[o].contentItem===e,this.tabs[o].setActive(s),s===!0&&(this.activeContentItem=e,this.parent.config.activeItemIndex=o);(t=this.tabs[(i=this.parent.config.activeItemIndex)!==null&&i!==void 0?i:0].element.get(0))===null||t===void 0||(r=t.scrollIntoView)===null||r===void 0||r.call(t,{inline:"nearest"}),this._hideAdditionalTabsDropdown(),this._updateTabSizes(),this.parent.emitBubblingEvent("stateChanged")}position(e){var t=this.parent._header.show;return t&&!this.parent._side&&(t="top"),e!==void 0&&this.parent._header.show!==e&&(this.parent._header.show=e,this.parent._setupHeaderPosition()),t}_attachWheelListener(){var e;(e=this.tabsContainer.get(0))===null||e===void 0||e.addEventListener("wheel",this._handleWheelEvent,{passive:!0})}_detachWheelListener(){var e;(e=this.tabsContainer.get(0))===null||e===void 0||e.removeEventListener("wheel",this._handleWheelEvent)}_handleWheelEvent(e){var t=e.currentTarget;if(t instanceof HTMLElement){var r=Math.abs(e.deltaY)>Math.abs(e.deltaX)?e.deltaY:e.deltaX;if(e.deltaMode===WheelEvent.DOM_DELTA_PAGE){var i;r*=(i=this.tabsContainer.innerWidth())!==null&&i!==void 0?i:1}else e.deltaMode===WheelEvent.DOM_DELTA_LINE&&(r*=100/3);t.scrollLeft+=Math.round(r)}}_handleScrollEvent(){this._checkScrollArrows()}_handleItemPickedUp(){this.isDraggingTab=!0,this.isDropdownShown&&this._hideAdditionalTabsDropdown(),this.controlsContainer.on("mouseenter",this._handleNextMouseEnter),this.tabPreviousButton.on("mouseenter",this._handlePreviousMouseEnter)}_handleItemDropped(){var e;this.isDraggingTab=!1,window.cancelAnimationFrame((e=this.rAF)!==null&&e!==void 0?e:-1),this.rAF=null,this.controlsContainer.off("mouseenter",this._handleNextMouseEnter),this.controlsContainer.off("mouseleave",this._handleNextMouseLeave),this.tabPreviousButton.off("mouseenter",this._handlePreviousMouseEnter),this.tabPreviousButton.off("mouseleave",this._handlePreviousMouseLeave)}_handleNextMouseEnter(){var e;this.controlsContainer.on("mouseleave",this._handleNextMouseLeave),this._handleScrollRepeat(this.SCROLL_RIGHT,(e=this.tabsContainer.scrollLeft())!==null&&e!==void 0?e:0)}_handlePreviousMouseEnter(){var e;this.tabPreviousButton.on("mouseleave",this._handlePreviousMouseLeave),this._handleScrollRepeat(this.SCROLL_LEFT,(e=this.tabsContainer.scrollLeft())!==null&&e!==void 0?e:0)}_handleNextMouseLeave(){var e;window.cancelAnimationFrame((e=this.rAF)!==null&&e!==void 0?e:-1),this.rAF=null,this.controlsContainer.off("mouseleave",this._handleNextMouseLeave)}_handlePreviousMouseLeave(){var e;window.cancelAnimationFrame((e=this.rAF)!==null&&e!==void 0?e:-1),this.rAF=null,this.tabPreviousButton.off("mouseleave",this._handlePreviousMouseLeave)}_handleNextButtonMouseDown(){for(var e,t=0;t<this.tabs.length;t+=1){var r,i,s,o,a;if(((r=(i=this.tabs[t].element.get(0))===null||i===void 0?void 0:i.offsetLeft)!==null&&r!==void 0?r:0)>((s=(o=this.tabsContainer.get(0))===null||o===void 0?void 0:o.offsetWidth)!==null&&s!==void 0?s: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 r,i,s;if(((r=(i=this.tabs[t].element.get(0))===null||i===void 0?void 0:i.offsetLeft)!==null&&r!==void 0?r:0)<((s=this.tabsContainer.scrollLeft())!==null&&s!==void 0?s:0)){e=this.tabs[t].element.get(0);break}}if(e)e.scrollIntoView({behavior:"smooth",inline:"start"}),this._handleScrollButtonMouseDown(this.SCROLL_LEFT);else{var o=this.tabsContainer.get(0);o&&(o.scrollLeft=0)}}_handleScrollButtonMouseDown(e){this.holdTimer=window.setTimeout(()=>{var t;this._handleScrollRepeat(e,(t=this.tabsContainer.scrollLeft())!==null&&t!==void 0?t:0,100)},this.CLICK_TIMEOUT),window.addEventListener("mouseup",this._handleScrollButtonMouseUp)}_handleScrollButtonMouseUp(){var e,t;clearTimeout((e=this.holdTimer)!==null&&e!==void 0?e:-1),this.holdTimer=null,cancelAnimationFrame((t=this.rAF)!==null&&t!==void 0?t:-1),this.rAF=null,window.removeEventListener("mouseup",this._handleScrollButtonMouseUp)}_checkScrollArrows(){var e,t,r;this.tabsContainer.scrollLeft()===0?this.tabPreviousButton.first().prop("disabled",!0):((e=this.tabsContainer.scrollLeft())!==null&&e!==void 0?e:0)+((t=this.tabsContainer.innerWidth())!==null&&t!==void 0?t:0)===((r=this.tabsContainer.get(0))===null||r===void 0?void 0:r.scrollWidth)?this.tabNextButton.prop("disabled",!0):(this.tabNextButton.prop("disabled",!1),this.tabPreviousButton.first().prop("disabled",!1))}_handleScrollRepeat(e,t){var r,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,s=arguments.length>3?arguments[3]:void 0,o=this.tabsContainer.get(0);if(o){var a=o.getBoundingClientRect();if(e===this.SCROLL_LEFT){if(this.tabsContainer.scrollLeft(t-i),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+i),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)===o.scrollWidth){this._checkScrollArrows();return}}window.cancelAnimationFrame((r=this.rAF)!==null&&r!==void 0?r:-1),this.rAF=window.requestAnimationFrame(h=>{var p,m,v=s||h,f=h-v,g=this.START_SPEED*f+.5*this.ACCELERATION*(f*f);g=Math.min(g,(p=(m=this.tabsContainer.get(0))===null||m===void 0?void 0:m.scrollWidth)!==null&&p!==void 0?p:1/0),this._handleScrollRepeat(e,t,g,v)})}}_$setClosable(e){return this.closeButton&&this._isClosable()?(this.closeButton.element[e?"show":"hide"](),!0):!1}_$destroy(){this.emit("destroy",this);for(var e=0;e<this.tabs.length;e++)this.tabs[e]._$destroy();this._detachWheelListener(),this._handleItemDropped(),T(document).off("mouseup",this._hideAdditionalTabsDropdown),this.tabDropdownSearch.off("input",this._handleFilterInput),this.tabDropdownSearch.off("keydown",this._handleFilterKeydown),this.element.remove()}_getHeaderSetting(e){if(e in this.parent._header)return this.parent._header[e]}_createControls(){var e,t,r,i,s;if(s=this.layoutManager.config.labels.tabDropdown,this.layoutManager.config.labels.tabNextLabel,this.layoutManager.config.labels.tabPreviousLabel,this.tabDropdownButton=new vn(this,s,"lm_tabdropdown",this._showAdditionalTabsDropdown),this.tabDropdownButton.element.hide(),this.controlsContainer.prepend(this.tabNextButton),this.tabNextButton.hide(),this._getHeaderSetting("popout")&&(t=this._onPopoutClick.bind(this),r=this._getHeaderSetting("popout"),new vn(this,r,"lm_popout",t)),this._getHeaderSetting("maximise")){i=this.parent.toggleMaximise.bind(this.parent);var o=this._getHeaderSetting("maximise"),a=this._getHeaderSetting("minimise"),l=new vn(this,o,"lm_maximise",i);this.parent.on("maximised",function(){l.element.attr("title",a??"")}),this.parent.on("minimised",function(){l.element.attr("title",o??"")})}this._isClosable()&&(e=this.parent.remove.bind(this.parent),r=this._getHeaderSetting("close"),this.closeButton=new vn(this,r,"lm_close",e))}_showAdditionalTabsDropdown(){if(this.isDropdownShown){this._hideAdditionalTabsDropdown();return}this.tabDropdownList=this.tabsContainer.clone(!0).appendTo(this.tabDropdownContainer).children().removeClass("lm_active"),T(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"),T(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 r,i;e.preventDefault(),(r=this.tabDropdownList)===null||r===void 0||r.eq(this.dropdownKeyIndex).removeClass("lm_keyboard_active"),this.dropdownKeyIndex=t(this.dropdownKeyIndex,1,this.tabDropdownList),(i=this.tabDropdownList)===null||i===void 0||i.eq(this.dropdownKeyIndex).addClass("lm_keyboard_active")}else if(e.key==="ArrowUp"||e.key==="Tab"){var s,o;e.preventDefault(),(s=this.tabDropdownList)===null||s===void 0||s.eq(this.dropdownKeyIndex).removeClass("lm_keyboard_active"),this.dropdownKeyIndex=t(this.dropdownKeyIndex,-1,this.tabDropdownList),(o=this.tabDropdownList)===null||o===void 0||o.eq(this.dropdownKeyIndex).addClass("lm_keyboard_active")}}_handleFilterInput(e){if(this.tabDropdownList!=null){this.tabDropdownList.eq(this.dropdownKeyIndex).removeClass("lm_keyboard_active"),this.dropdownKeyIndex=-1;for(var t=0;t<this.tabDropdownList.length;t++){var r,i;((r=(i=this.tabs[t].contentItem.config.title)===null||i===void 0?void 0:i.toLowerCase().indexOf(e.target.value.toLowerCase()))!==null&&r!==void 0?r:-1)!==-1?(this.tabDropdownList.eq(t).css("display",""),this.dropdownKeyIndex===-1&&(this.dropdownKeyIndex=t)):this.tabDropdownList.eq(t).css("display","none")}this.dropdownKeyIndex!==-1&&this.tabDropdownList.eq(this.dropdownKeyIndex).addClass("lm_keyboard_active")}}_hideAdditionalTabsDropdown(e){var t,r;this.isDropdownShown&&(e&&(t=this.tabDropdownContainer.get(0))!==null&&t!==void 0&&t.contains(e.target)||e&&((r=this.tabDropdownButton)===null||r===void 0?void 0:r.element.get(0))===e.target||(this.element.removeClass("lm_dropdown_open"),this.tabDropdownContainer.hide(),this.isDropdownShown=!1,this.element.append(this.tabDropdownContainer),this.tabDropdownContainer.find(".lm_tabs").remove(),T(document).off("mousedown",this._hideAdditionalTabsDropdown)))}_updateAdditionalTabsDropdown(){var e,t,r,i;if(this.isDropdownShown&&!(!this.tabDropdownList||this.tabDropdownList.length==0)){var s=(e=(t=this.tabDropdownContainer.get(0))===null||t===void 0?void 0:t.scrollHeight)!==null&&e!==void 0?e:0;if(s!==0){var o=this.tabDropdownContainer[0].getBoundingClientRect(),a=(r=T(window).height())!==null&&r!==void 0?r:0,l=(i=T(window).width())!==null&&i!==void 0?i:0;if(this.tabDropdownButton){var d=this.tabDropdownButton.element[0].getBoundingClientRect(),h=s<a-d.bottom,p=!h&&d.bottom>a*.6,m=Math.min(d.left+(p?d.width:0),l-o.width-this.PADDING),v=p?Math.max(d.top-s,this.PADDING):d.bottom,f=a-v-this.PADDING;this.tabDropdownContainer.css({"max-height":f,top:v,left:m})}}}}_isClosable(){return!!(this.parent.config.isClosable&&this.layoutManager.config.settings.showCloseIcon)}_onPopoutClick(){if(this.layoutManager.config.settings.popoutWholeStack===!0)this.parent.popout();else{var e;(e=this.activeContentItem)===null||e===void 0||e.popout()}}_onHeaderClick(e){e.target===this.element[0]&&this.parent.select()}_updateTabSizes(){if(this.tabs.length!==0){var e=this.tabsContainer.get(0);if(this.isDropdownShown&&this._updateAdditionalTabsDropdown(),!!e){if(!this.isOverflowing&&e.scrollWidth>e.clientWidth){var t;(t=this.tabDropdownButton)===null||t===void 0||t.element.show(),this.tabNextButton.show(),this.tabPreviousButton.show(),this.isOverflowing=!0}else if(this.isOverflowing&&e.scrollWidth<=e.clientWidth){var r;(r=this.tabDropdownButton)===null||r===void 0||r.element.hide(),this.tabNextButton.hide(),this.tabPreviousButton.hide(),this.isOverflowing=!1}this.isOverflowing&&this._checkScrollArrows()}}}}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 mn(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 r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class ya{constructor(e,t,r){mn(this,"_isVertical",void 0),mn(this,"_size",void 0),mn(this,"_grabSize",void 0),mn(this,"_dragListener",void 0),mn(this,"element",void 0),this._isVertical=e,this._size=t,this._grabSize=r<t?t:r,this.element=this._createElement(),this._dragListener=new On(this.element)}on(e,t,r){var i;(i=this._dragListener)===null||i===void 0||i.on(e,t,r)}_$destroy(){var e;(e=this._dragListener)===null||e===void 0||e.destroy(),this._dragListener=null,this.element.remove()}_createElement(){var e=T('<div class="lm_drag_handle"></div>'),t=T('<div class="lm_splitter"></div>');t.append(e);var r=this._grabSize-this._size,i=r/2;return this._isVertical?(e.css("top",-i),e.css("height",this._size+r),t.addClass("lm_vertical"),t.height(this._size)):(e.css("left",-i),e.css("width",this._size+r),t.addClass("lm_horizontal"),t.width(this._size)),t}}const qc=Object.freeze(Object.defineProperty({__proto__:null,BrowserPopout:ma,DragProxy:Kt,DragSource:pa,DragSourceFromEvent:va,DropTargetIndicator:xn,Header:pt,HeaderButton:vn,Splitter:ya,Tab:In},Symbol.toStringTag,{value:"Module"}));var Xc={config:Xh,container:ec,controls:qc,errors:Dc,items:Uc,utils:pc};function ro(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function Ie(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?ro(Object(t),!0).forEach(function(r){Z(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):ro(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function Z(n,e,t){return(e=Zc(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Zc(n){var e=Yc(n,"string");return typeof e=="symbol"?e:e+""}function Yc(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var io=["column","row","stack","component"];class ii extends Oe{static isLayoutItemConfig(e){return io.includes(e.type)}static minifyConfig(e){return ni(e)}static unminifyConfig(e){return Fr(e)}constructor(e,t){super(),Z(this,"isInitialised",!1),Z(this,"_isFullPage",!1),Z(this,"_resizeTimeoutId",void 0),Z(this,"_components",{"lm-react-component":aa}),Z(this,"_fallbackComponent",void 0),Z(this,"_itemAreas",[]),Z(this,"_maximisedItem",null),Z(this,"_maximisePlaceholder",T('<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 la(this)),Z(this,"config",void 0),Z(this,"container",void 0),Z(this,"_originalContainer",void 0),Z(this,"dropTargetIndicator",null),Z(this,"tabDropPlaceholder",T('<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&&T("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 r=()=>{if(this._components[e]===void 0)throw new Error("Component "+e+" is not registered");delete this._components[e]};return r}setFallbackComponent(e){this._fallbackComponent=e}toConfig(e){if(this.isInitialised===!1)throw new Error("Can't create config, layout not yet initialised");if(e&&!(e instanceof ge))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:[]},r=function(o,a){for(var l in a.config)l!=="content"&&(o[l]=a.config[l]);if(o.componentName==="lm-react-component"&&(o.type="react-component"),a.contentItems.length){o.content=[];for(var d=0;d<a.contentItems.length;d++)o.content[d]={},r(o.content[d],a.contentItems[d])}};e?r(t,{contentItems:[e]}):r(t,this.root),this._$reconcilePopoutWindows(),t.openPopouts=[];for(var i=0;i<this.openPopouts.length;i++)t.openPopouts.push(this.openPopouts[i].toConfig());return t.maximisedItemId=this._maximisedItem?"__glMaximised":void 0,t}getComponent(e){return this._components[e]}getFallbackComponent(){return this._fallbackComponent}init(){if(this._subWindowsCreated===!1&&(this._createSubWindows(),this._subWindowsCreated=!0),document.readyState==="loading"||document.body===null){T(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 xn,this.updateSize(),this._create(this.config),this._bindEvents(),this.isInitialised=!0,this._adjustColumnsResponsive(),this.emit("initialised")}addReactChild(e,t){this._reactChildMap.set(e,t),this._reactChildren=[...this._reactChildMap.values()],this.emit("reactChildrenChanged")}removeReactChild(e,t){var r=this._reactChildMap.get(e);r===t&&(this._reactChildMap.delete(e),this._reactChildren=[...this._reactChildMap.values()],this.emit("reactChildrenChanged"))}getReactChildren(){return this._reactChildren}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 r,i;if(this.width=(r=e??this.container.width())!==null&&r!==void 0?r:0,this.height=(i=t??this.container.height())!==null&&i!==void 0?i:0,this.isInitialised===!0){if(this.root.callDownwards("setSize",[this.width,this.height]),this._maximisedItem){var s,o;this._maximisedItem.element.width((s=this.container.width())!==null&&s!==void 0?s:0),this._maximisedItem.element.height((o=this.container.height())!==null&&o!==void 0?o:0),this._maximisedItem.callDownwards("setSize")}this._adjustColumnsResponsive()}}destroy(){var e;this.isInitialised===!1||!this.root||(this._onUnload(),T(window).off("resize",this._onResize),T(window).off("unload beforeunload",this._onUnload),T(window).off("blur.lm").off("focus.lm"),T(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 r,i;if(typeof e.type!="string")throw new Rt("Missing parameter 'type'",e);if(e.type==="react-component"&&(e.type="component",e.componentName="lm-react-component"),!ii.isLayoutItemConfig(e))throw i="Unknown type '"+e.type+"'. Valid types are "+io.join(","),new Rt(i);return e.type==="component"&&!(t instanceof Br)&&t&&!(this.isSubWindow===!0&&t instanceof Ur)&&(e={type:"stack",width:e.width,height:e.height,content:[e]}),e.id=(r=e.id)!==null&&r!==void 0?r:Xn(),e.type==="stack"?new Br(this,e,t):e.type==="row"?new wn(!1,this,e,t):e.type==="column"?new wn(!0,this,e,t):new ba(this,e,t)}createPopout(e,t,r,i){var s=[],o=e instanceof ge,a=this;if(o){var l;s=this.toConfig(e).content,r=Xn();for(var d=e.parent,h=e;((p=d)===null||p===void 0?void 0:p.contentItems.length)===1&&!d.isRoot;){var p;h=d,d=d.parent}if((l=d)===null||l===void 0||l.addId(r),i==null||Number.isNaN(i)){var m;i=(m=d)===null||m===void 0?void 0:m.contentItems.indexOf(h)}}else e instanceof Array?s=e:s=[e];if(!t&&o){var v,f,g,b=window.screenX||window.screenLeft,S=window.screenY||window.screenTop,w=(v=e.element.offset())!==null&&v!==void 0?v:{left:0,top:0};t={left:b+w.left,top:S+w.top,width:(f=e.element.width())!==null&&f!==void 0?f:0,height:(g=e.element.height())!==null&&g!==void 0?g:0}}if(!t&&!o&&(t={left:window.screenX||window.screenLeft+20,top:window.screenY||window.screenTop+20,width:500,height:309}),o&&e.remove(),!(!t||!r||i===void 0)){var y=new ma(s,t,r,i,this);return y.on("initialised",function(){a.emit("windowOpened",y)}),y.on("closed",function(){a._$reconcilePopoutWindows()}),this.openPopouts.push(y),y}}createDragSource(e,t){this.config.settings.constrainDragToContainer=!1;var r=new pa(e,t,this);return this._dragSources.push(r),r}createDragSourceFromEvent(e,t){return this.config.settings.constrainDragToContainer=!1,new va(e,this,t)}selectItem(e,t){if(this.config.settings.selectionEnabled!==!0)throw new Error("Please set selectionEnabled to true to use this feature");e!==this.selectedItem&&(this.selectedItem!==null&&this.selectedItem.deselect(),e&&t!==!0&&e.select(),this.selectedItem=e,this.emit("selectionChanged",e))}_$maximiseItem(e){var t,r;this._maximisedItem!==null&&this._$minimiseItem(this._maximisedItem),this._maximisedItem=e,this._maximisedItem.addId("__glMaximised"),e.element.addClass("lm_maximised"),e.element.after(this._maximisePlaceholder),this.root.element.prepend(e.element),e.element.width((t=this.container.width())!==null&&t!==void 0?t:0),e.element.height((r=this.container.height())!==null&&r!==void 0?r:0),e.callDownwards("setSize"),this._maximisedItem.emit("maximised"),this.emit("stateChanged")}_$minimiseItem(e){var t;e.element.removeClass("lm_maximised"),e.removeId("__glMaximised"),this._maximisePlaceholder.after(e.element),this._maximisePlaceholder.remove(),(t=e.parent)===null||t===void 0||t.callDownwards("setSize"),this._maximisedItem=null,e.emit("minimised"),this.emit("stateChanged")}_$closeWindow(){window.setTimeout(function(){window.close()},1)}_$getArea(e,t){for(var r=1/0,i=null,s=0;s<this._itemAreas.length;s++){var o=this._itemAreas[s];e>o.x1&&e<o.x2&&t>o.y1&&t<o.y2&&r>o.surface&&(r=o.surface,i=o)}return i}_$createRootItemAreas(){var e=50,t=Ie({},this.root._$getArea()),r=[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})];r.forEach(i=>{i.surface=(i.x2-i.x1)*(i.y2-i.y1)}),this._itemAreas.push(...r)}_$calculateItemAreas(){var e=this._getAllContentItems();if(this._itemAreas=[],e.length===1){this._itemAreas.push(this.root._$getArea());return}this._$createRootItemAreas();for(var t=0;t<e.length;t++){var r=e[t];if(Ht(r)){var i=r._$getArea();if(i!==null)if(i instanceof Array)this._itemAreas=this._itemAreas.concat(i);else{var s;this._itemAreas.push(i);var o=Ie(Ie({},i),(s=i.contentItem._contentAreaDimensions)===null||s===void 0?void 0:s.header.highlightArea);o.surface=(o.x2-o.x1)*(o.y2-o.y1),this._itemAreas.push(o)}}}}_$normalizeContentItem(e,t){if(!e)throw new Error("No content item defined");if(typeof e=="function"&&(e=e()),e instanceof ge)return e;if(T.isPlainObject(e)&&e.type){var r=this.createContentItem(e,t??null);return r.callDownwards("_$init"),r}else throw new Error("Invalid contentItem")}_$reconcilePopoutWindows(){for(var e=[],t=0;t<this.openPopouts.length;t++){var r;((r=this.openPopouts[t].getWindow())===null||r===void 0?void 0:r.closed)===!1?e.push(this.openPopouts[t]):this.emit("windowClosed",this.openPopouts[t])}this.openPopouts.length!==e.length&&(this.emit("stateChanged"),this.openPopouts=e)}_getAllContentItems(){var e=[],t=r=>{if(e.push(r),r.contentItems instanceof Array)for(var i=0;i<r.contentItems.length;i++)t(r.contentItems[i])};return t(this.root),e}_bindEvents(){this._isFullPage&&T(window).resize(this._onResize),T(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,r=sa("gl-window");r&&(this.isSubWindow=!0,e=JSON.parse(localStorage.getItem(r)||"{}"),e=Fr(e),localStorage.removeItem(r)),e=T.extend(!0,{},na,e);var i=function(o){for(var a in o){var l=o[a];a!=="props"&&typeof l=="object"&&l!=null?i(l):a==="type"&&l==="react-component"&&(o.type="component",o.componentName="lm-react-component")}};return i(e),((t=e.settings)===null||t===void 0?void 0:t.hasHeaders)===!1&&(e.dimensions.headerHeight=0),e}_adjustToWindowMode(){var e,t=T('<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=ti((e=this.config.content[0].title)!==null&&e!==void 0?e:""),T("head").append(T("body link, body style, template, .gl_keep")),this.container=T("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?T(this._originalContainer):T("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,T("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 Rt(t,e);if(e.content.length>1)throw t="Top level content can't contain more then one element.",new Rt(t,e);this.root=new Ur(this,{content:e.content},this.container),this.root.callDownwards("_$init"),e.maximisedItemId==="__glMaximised"&&this.root.getItemsById(e.maximisedItemId)[0].toggleMaximise()}_onUnload(){if(this.config.settings.closePopoutsOnUnload===!0)for(var e=0;e<this.openPopouts.length;e++)this.openPopouts[e].close()}_adjustColumnsResponsive(){if(!this._useResponsiveLayout()||this._updatingColumnsResponsive||!this.config.dimensions||!this.config.dimensions.minItemWidth||this.root.contentItems.length===0||!this.root.contentItems[0].isRow){this._firstLoad=!1;return}this._firstLoad=!1;var e=this.root.contentItems[0].contentItems.length;if(!(e<=1)){var t=this.config.dimensions.minItemWidth,r=e*t;if(!(this.width==null||r<=this.width)){this._updatingColumnsResponsive=!0;for(var i=Math.max(Math.floor(this.width/t),1),s=e-i,o=this.root.contentItems[0],a=this._findAllStackContainers()[0],l=0;l<s;l++){var d=o.contentItems[o.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(r){e.addChild(r),t.removeChild(r,!0)}):t.contentItems.forEach(r=>{this._addChildContentItemsToContainer(e,r)})}_findAllStackContainers(){var e=[];return this._findAllStackContainersRecursive(e,this.root),e}_findAllStackContainersRecursive(e,t){t.contentItems.forEach(r=>{Ht(r)?e.push(r):r.isComponent||this._findAllStackContainersRecursive(e,r)})}}Z(ii,"__lm",Xc);const oo={"tab-height":"28px","drag-border-width":"5px"},so=Object.freeze({tabHeight:parseInt(oo["tab-height"],10),dragBorderWidth:parseInt(oo["drag-border-width"],10)});function ao(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function st(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?ao(Object(t),!0).forEach(function(r){Ca(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):ao(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function Ca(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=Qc(n,"string");return typeof e=="symbol"?e:e+""}function Qc(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var Ct=R.module("LayoutUtils");function wa(n){return n.componentName!==void 0}function Et(n){var e=n;return(wa(n)&&n.componentName==="lm-react-component"||n.type==="react-component")&&e.component!==void 0}function Rn(n){return n.focus!==void 0}function lo(n){return n.type==="stack"}class E{static activateTab(e,t){var r=E.getStackForRoot(e,t,!1);if(!r){Ct.error("Could not find stack for config",t);return}var i=E.getContentItemInStack(r,t);i&&r.setActiveContentItem(i)}static isActiveTab(e,t){var r=E.getStackForRoot(e,t,!1);if(!r)return Ct.error("Could not find stack for config",t),!1;var i=E.getContentItemInStack(r,t),s=r.getActiveContentItem();return s===i}static addStack(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;if(ga(e)){var r={type:t?"column":"row"};(e.contentItems==null||e.contentItems.length===0)&&e.addChild(r);var i=e.contentItems[0],s=t?i.isColumn:i.isRow;if(!s){e.removeChild(i,!0),e.addChild(r);var o=document.activeElement;e.contentItems[0].addChild(i),o&&o.focus!=null&&o.focus()}return this.addStack(e.contentItems[0],t)}if(e.contentItems.length<2)return e.addChild({type:"stack"}),e.contentItems[e.contentItems.length-1];var a=e.contentItems[e.contentItems.length-1],l=t?a.isRow:a.isColumn;if(!l){var d,h,p=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,p),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(r=>r.element[0].classList.contains("lm_focusin")))}static getFocusedStack(e){var t=E.getAllStackContainers(e),r=E.getFocusedStackIndex(t);return t[r]}static getStackById(e,t){var r,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;if(i&&Ht(e)&&e.contentItems.length===0)return e;if(t===((r=e.config)===null||r===void 0?void 0:r.id)){if(Ht(e))return e;throw new Error("Item with ID ".concat(t," is not a stack"))}if(e.contentItems==null)return null;for(var s=0;s<e.contentItems.length;s+=1){var o=this.getStackById(e.contentItems[s],t,i);if(o)return o}return null}static getContentItemById(e,t){var r;if(((r=e.config)===null||r===void 0?void 0:r.id)===t)return e;if(e.contentItems==null)return null;for(var i=0;i<e.contentItems.length;i+=1){var s=this.getContentItemById(e.contentItems[i],t);if(s)return s}return null}static getStackForConfig(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;if(r&&Ht(e)&&e.contentItems.length===0)return e;if(e.contentItems==null)return null;for(var i=0;i<e.contentItems.length;i+=1){var s=e.contentItems[i];if(s.isComponent&&s.config!=null&&pi(s.config,t))return e;var o=this.getStackForConfig(s,t,r);if(o)return o}return null}static getStackForRoot(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,s=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,o=this.getStackForConfig(e,t);return!o&&i&&(o=this.getStackForConfig(e,{component:t.component},s)),!o&&r&&(o=this.addStack(e)),o}static getStackForComponentTypes(e,t){for(var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,s=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,o=0;o<t.length;o+=1){var a=t[o],l=o===t.length-1,d=E.getStackForRoot(e,{component:a},r&&l,i,s);if(d)return d}return null}static getContentItemInStack(e,t){if(!e)return null;for(var r=0;r<e.contentItems.length;r+=1){var i=e.contentItems[r];if(i.isComponent&&i.config!=null&&pi(i.config,t))return i}return null}static dehydrateLayoutConfig(e,t){if(e==null||!e.length)return[];for(var r=[],i=0;i<e.length;i+=1){var s=e[i],{content:o}=s;if(Et(s)){var a=t(s.component,s);a!=null?r.push(a):Ct.debug2('dehydrateLayoutConfig: skipping unmapped component "'.concat(s.component,'"'))}else if(o){var l=st(st({},s),{},{content:E.dehydrateLayoutConfig(o,t)});r.push(l)}else r.push(s)}return r}static getTabPoint(e){var{tab:t}=e;if(t==null)throw new Error("Cannot get tab for panel container ".concat(e));var r=t.element[0].getBoundingClientRect();return[r.left+r.width*.5,r.bottom-8]}static dropLayoutMinorChange(e){for(var t=0;t<e.length;t+=1){var r=e[t],{content:i}=r;i!==void 0?(lo(r)&&delete r.activeItemIndex,E.dropLayoutMinorChange(i)):Et(r)&&r.component==="IrisGridPanel"&&r.props.panelState!=null&&(delete r.id,r.props.panelState.irisGridState.sorts=[],r.props.panelState.irisGridState.quickFilters=[],r.props.panelState.gridState.isStuckToBottom=!1,r.props.panelState.gridState.isStuckToRight=!1)}}static isEqual(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,i=E.cloneLayout(e),s=E.cloneLayout(t);return r?(E.dropLayoutMinorChange(i),E.dropLayoutMinorChange(s),Ir(i,s)):Ir(i,s)}static cloneLayout(e){return JSON.parse(JSON.stringify(e))}static hydrateLayoutConfig(e,t){if(e==null||!e.length)return[];for(var r=[],i=0;i<e.length;i+=1){var s=e[i];if(Et(s)){var o,{component:a,props:l={}}=s;r.push(st(st({},s),{},{id:(o=s==null?void 0:s.id)!==null&&o!==void 0?o:ct(),props:t(a,l)}))}else if(s.content!==void 0){var d=E.hydrateLayoutConfig(s.content,t);lo(s)&&s.activeItemIndex!=null&&s.activeItemIndex>=d.length&&(Ct.warn("Fixing bad activeItemIndex!",s.activeItemIndex,s),s.activeItemIndex=0),r.push(st(st({},s),{},{content:d}))}else r.push(s)}return r}static openComponent(){var{root:e,config:t,stack:r=void 0,replaceExisting:i=!0,replaceConfig:s=void 0,createNewStack:o=!1,focusElement:a=void 0,dragEvent:l=void 0}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},d=document.activeElement,h=st({},t);if(h.id==null&&(h.id=ct()),l!=null){e==null||e.layoutManager.createDragSourceFromEvent(h,l);return}var p=s||{id:h.id,component:h.component};L(e);var m=r??(o?E.addStack(e):E.getStackForRoot(e,p));L(m);var v=E.getContentItemInStack(m,p);if(a!=null){var f=b=>{Ct.debug("Component created, focusing element",a),m.off("componentCreated",f);var{element:S}=b.origin;requestAnimationFrame(()=>{E.focusElement(S[0],a)})};m.on("componentCreated",f)}if(i&&v){var g=m.contentItems.indexOf(v);m.addChild(h,g+1),m.removeChild(v),m.setActiveContentItem(m.contentItems[g])}else m.addChild(h);a==null&&d&&Rn(d)&&d.focus()}static openComponentInStack(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,i=document.activeElement,s={id:t.id},o=E.getContentItemInStack(e,s);if(r&&o&&e){var a=e==null?void 0:e.contentItems.indexOf(o);e.addChild(t,a+1),e.removeChild(o),e.setActiveContentItem(e.contentItems[a])}else e==null||e.addChild(t);i&&Rn(i)&&i.focus()}static closeComponent(e,t,r){var i=E.getStackForRoot(e,t,!1,!1,!1);if(!i){Ct.warn("Cannot find stack for component, ignoring close",t);return}var s=E.getContentItemInStack(i,t),o=document.activeElement;s&&(Le(s)?s.container.close(r):i.removeChild(s)),o&&document.contains(o)&&Rn(o)&&o.focus()}static renameComponent(e,t,r){var i=E.getStackForRoot(e,t,!1);if(!i){Ct.error("Could not find stack for config",t);return}var s=E.getContentItemInStack(i,t);s&&s.setTitle(r)}static cloneComponent(e,t){var r=E.getStackForRoot(e,t,!1);if(!r)return Ct.error("Could not find stack for config",t),null;var{props:i={}}=t,s=E.getPanelComponentState(t),o={type:"react-component",component:t.component,props:st(st({},i),{},{panelState:s}),title:"".concat(t.title," Copy"),id:ct()};return E.openComponentInStack(r,o),o}static getPanelComponentState(e){if(wa(e)){var t;return(t=e.componentState)===null||t===void 0?void 0:t.panelState}if(Et(e)){var r;return(r=e.props)===null||r===void 0?void 0:r.panelState}return null}static makeDefaultLayout(){return{dimensions:{headerHeight:so.tabHeight,borderWidth:so.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,r=E.getComponentConfigFromContainer(t);if(r&&Et(r)){var i;return(i=r.component)!==null&&i!==void 0?i:null}return null}static getComponentName(e){var t,r,i=(t=(r=e.WrappedComponent)===null||r===void 0?void 0:r.displayName)!==null&&t!==void 0?t:e.displayName;if(i==null)throw new Error("Component displayName not defined ".concat(e));return i}static focusElement(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:E.DEFAULT_FOCUS_SELECTOR;if(e==null)return null;var r=e.querySelector(t);return r==null?null:(Rn(r)&&r.focus(),r)}static onInitialized(e){return new Promise(t=>{if(e.isInitialised){t();return}var r=()=>{e.off("initialised",r),t()};e.on("initialised",r)})}}Ca(E,"DEFAULT_FOCUS_SELECTOR","input, select, textarea, button");var em=O.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.']})})});em.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:Eg,emit:tm,useListener:Pg}=It(Y.OPEN),dr=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:nm,emit:Tg,useListener:Og}=It(dr.CYCLE_TO_NEXT_STACK),{listen:rm,emit:xg,useListener:Ig}=It(dr.CYCLE_TO_PREVIOUS_STACK),{listen:im,emit:Dg,useListener:Mg}=It(dr.CYCLE_TO_NEXT_TAB),{listen:om,emit:kg,useListener:jg}=It(dr.CYCLE_TO_PREVIOUS_TAB);function uo(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function ho(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?uo(Object(t),!0).forEach(function(r){ut(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):uo(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function ut(n,e,t){return(e=sm(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function sm(n){var e=am(n,"string");return typeof e=="symbol"?e:e+""}function am(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var Ue=R.module("PanelManager"),Nt=function(n){return n[n.Next=0]="Next",n[n.Previous=1]="Previous",n}(Nt||{});class Sa{constructor(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:(a,l)=>l,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:(a,l)=>l,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:new Map,s=arguments.length>4&&arguments[4]!==void 0?arguments[4]:[],o=arguments.length>5&&arguments[5]!==void 0?arguments[5]:()=>{};ut(this,"layout",void 0),ut(this,"hydrateComponent",void 0),ut(this,"dehydrateComponent",void 0),ut(this,"onPanelsUpdated",void 0),ut(this,"closed",void 0),ut(this,"openedMap",void 0),ut(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=r,this.onPanelsUpdated=o,this.openedMap=new Map(i),this.closed=[...s],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(nm(e,this.handleCycleToNextStack)),this.navigationEventListenerRemovers.push(rm(e,this.handleCycleToPreviousStack)),this.navigationEventListenerRemovers.push(im(e,this.handleCycleToNextTab)),this.navigationEventListenerRemovers.push(om(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&&Et(t)&&t.component===e)}getOpenedPanelById(e){return this.openedMap.get(e)}getContainerByPanelId(e){var t,r=E.getStackForConfig(this.layout.root,{id:e});return(t=r&&E.getContentItemInStack(r,{id:e}))!==null&&t!==void 0?t:null}getLastUsedPanel(e){for(var t=this.getOpenedPanels(),r=t.length-1;r>=0;r-=1){var i=t[r];if(e==null||e(i))return i}}getLastUsedPanelOfType(e){return this.getLastUsedPanelOfTypes([e])}getLastUsedPanelOfTypes(e){return this.getLastUsedPanel(t=>e.some(r=>qn(r)&&t instanceof r.WrappedComponent||!qn(r)&&t instanceof r))}updatePanel(e){var t=E.getIdFromPanel(e);if(t==null){Ue.error("updatePanel Panel did not have an ID",e);return}Ue.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){Ue.error("removePanel Panel did not have an ID",e);return}if(!this.openedMap.has(t)){Ue.error("Missing panel ID ".concat(t," in open panels map"));return}if(this.openedMap.get(t)!==e){Ue.debug("Panel argument doesn't match the open panels map entry for ".concat(t,", removePanel ignored"));return}Ue.debug2("Removing panel ID ".concat(t," from open panels map")),this.openedMap.delete(t)}removeClosedPanelConfig(e){var t=this.closed.findIndex(r=>r===e||r.id!=null&&e.id!=null&&r.id===e.id);t>=0&&this.closed.splice(t,1)}handleFocus(e){Ue.debug2("Focus: ",e),this.updatePanel(e)}handleMount(e){Ue.debug2("Mount: ",e),this.updatePanel(e),this.sendUpdate()}handleUnmount(e){Ue.debug2("Unmount: ",e),this.removePanel(e),this.sendUpdate()}cycleStack(e){var t=E.getAllStackContainers(this.layout);if(!(t.length<=1)){var r=E.getFocusedStackIndex(t);if(r===-1){var i=t[0],s=i.config.activeItemIndex,o=s!=null?i.contentItems[s]:i.contentItems[0];i.setActiveContentItem(o,!0);return}var a=e===Nt.Next?(r+1)%t.length:(r-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(Nt.Next)}handleCycleToPreviousStack(){this.cycleStack(Nt.Previous)}cycleTab(e){var t,r=E.getFocusedStack(this.layout);if(r!==void 0){var{contentItems:i}=r;if(!(i.length<=1)){var s=(t=r.config.activeItemIndex)!==null&&t!==void 0?t:0,o=e===Nt.Next?(s+1)%i.length:(s-1+i.length)%i.length,a=i[o];r.setActiveContentItem(a,!0)}}}handleCycleToNextTab(){this.cycleTab(Nt.Next)}handleCycleToPreviousTab(){this.cycleTab(Nt.Previous)}handleReopen(e,t){Ue.debug2("Reopen:",e,t),this.removeClosedPanelConfig(e);var{component:r}=e,{props:i}=e;i=this.hydrateComponent(r,i);var s=ho(ho({},e),{},{props:i}),{root:o}=this.layout,a=e.parentStackId===void 0?void 0:E.getStackById(o,e.parentStackId);E.openComponent({root:o,config:s,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 r=(t=E.getStackForConfig(this.layout.root,e.getConfig()))===null||t===void 0?void 0:t.config.id,i=this.closed.length-1;i>=0;i-=1){var s=this.closed[i];if(s.parentStackId===r){this.handleReopen(s);return}}}}handleDeleted(e){Ue.debug2("Deleted:",e),this.removeClosedPanelConfig(e),this.sendUpdate()}handleClosed(e,t){Ue.debug2("Closed: ",e),this.addClosedPanel(t),this.sendUpdate()}handleControlClose(e){var t={id:e},{root:r}=this.layout;E.closeComponent(r,t)}addClosedPanel(e){var t=E.getComponentConfigFromContainer(e);if(t&&Et(t)){var r=this.dehydrateComponent(t.component,t);if(r!=null){var i;r.parentStackId=(i=e.tab)===null||i===void 0?void 0:i.header.parent.config.id,this.closed.push(r)}}}sendUpdate(){var{closed:e,openedMap:t}=this;this.onPanelsUpdated({closed:[...e],openedMap:new Map(t)})}}ut(Sa,"MAX_CLOSED_PANEL_COUNT",100);var lm=R.module("PanelErrorBoundary");class dm extends c.Component{constructor(e){super(e),this.state={error:null}}componentDidCatch(e){this.setState({error:e})}componentWillUnmount(){var{glContainer:e,glEventHub:t}=this.props,r=E.getIdFromContainer(e);lm.debug("componentWillUnmount",r),t.emit(Y.CLOSED,r,e)}render(){var{children:e}=this.props,{error:t}=this.state;return t!=null?u.jsx("div",{className:"panel-error-boundary",children:u.jsx(_n,{"data-testid":"panel-error-boundary-loading-error",errorMessage:"".concat(t),isLoading:!1,isLoaded:!1})}):e??null}}function co(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function Yn(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?co(Object(t),!0).forEach(function(r){um(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):co(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function um(n,e,t){return(e=hm(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function hm(n){var e=cm(n,"string");return typeof e=="symbol"?e:e+""}function cm(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function _a(n){var{props:e,componentState:t}=n,{metadata:r}=e,{panelState:i=null}=e;t&&({panelState:i}=t);var s={};return r!=null&&(s.metadata=r),i!=null&&(s.panelState=i),Yn(Yn({},n),{},{componentState:null,props:s,type:"react-component"})}function Ea(n,e){return Yn(Yn({},n),{},{localDashboardId:e})}const Ng={dehydrate:_a,hydrate:Ea};var Pa=O.createContext(void 0);Pa.displayName="LayoutManagerContext";var mm=ae.shape({on:ae.func,off:ae.func,isHidden:ae.bool,tab:ae.shape({header:ae.shape({tabs:ae.arrayOf(ae.shape({contentItem:ae.shape({})}))})}),title:ae.string,setTitle:ae.func,close:ae.func}),Ta=ae.shape({on:ae.func,off:ae.func,emit:ae.func}),pm=ae.shape({registerComponent:ae.func,root:ae.shape({addChild:ae.func}),on:ae.func,off:ae.func,eventHub:Ta}),Ag=Object.freeze({Container:mm,EventHub:Ta,Layout:pm});function Gt(n,e,t){c.useEffect(function(){return n.on(e,t),()=>{n.off(e,t)}},[n,e,t])}var Oa="SET_DASHBOARD_DATA";const vm=ch(Oa,{},!1),fm={dashboardData:vm};var gm=new Map,xa=Object.freeze({}),bm=Object.freeze([]),Lg=ws,Rg=Cs,Fg=Ul,ym=n=>n.dashboardData,Ce=(n,e)=>{var t;return(t=ym(n)[e])!==null&&t!==void 0?t:xa},Hg=(n,e)=>{var t;return(t=Ce(n,e).closed)!==null&&t!==void 0?t:bm},$g=(n,e)=>{var t;return(t=Ce(n,e).openedMap)!==null&&t!==void 0?t:gm},Ia=(n,e)=>{var t;return(t=Ce(n,e).pluginDataMap)!==null&&t!==void 0?t:xa},Ug=(n,e,t)=>Ia(n,e)[t];function mo(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function Jt(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?mo(Object(t),!0).forEach(function(r){Cm(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):mo(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function Cm(n,e,t){return(e=wm(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function wm(n){var e=Sm(n,"string");return typeof e=="symbol"?e:e+""}function Sm(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var Da=(n,e)=>({type:Oa,id:n,payload:e}),_m=(n,e)=>(t,r)=>t(Da(n,Jt(Jt({},Ce(r(),n)),e))),Bg=(n,e,t)=>(r,i)=>r(Da(n,Jt(Jt({},Ce(i(),n)),{},{pluginDataMap:Jt(Jt({},Ia(i(),n)),{},{[e]:t})})));Object.entries(fm).map(n=>{var[e,t]=n;return fh.register(e,t)});function Em(n){var{children:e}=n;return u.jsx(u.Fragment,{children:e})}var oi=c.createContext(null);oi.displayName="PanelIdContext";function Pm(){return c.useContext(oi)}function po(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function pn(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?po(Object(t),!0).forEach(function(r){Tm(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):po(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function Tm(n,e,t){return(e=Om(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Om(n){var e=xm(n,"string");return typeof e=="symbol"?e:e+""}function xm(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var Fn=R.module("DashboardLayout"),Im=Object.freeze({}),Dm=[],vo=()=>{},Mm=1e3,fo=n=>n;function Kg(n){var e,t,{id:r,children:i,emptyDashboard:s=u.jsx("div",{className:"dashboard-empty",children:"Dashboard is empty."}),layout:o,layoutConfig:a=Dm,onLayoutChange:l=vo,onLayoutInitialized:d=vo,hydrate:h=Ea,dehydrate:p=_a,panelWrapper:m=Em}=n,v=ws(),f=(e=Cs(x=>Ce(x,r)))!==null&&e!==void 0?e:Im,[g,b]=c.useState(!1),[S,w]=c.useState(!1),[y,D]=c.useState(),[V]=c.useState((t=f==null?void 0:f.closed)!==null&&t!==void 0?t:[]),[X,G]=c.useState(o.getReactChildren()),A=c.useMemo(()=>new Map,[]),M=c.useMemo(()=>new Map,[]),J=c.useCallback(function(x,Q){var oe,hn=arguments.length>2&&arguments[2]!==void 0?arguments[2]:h,gt=arguments.length>3&&arguments[3]!==void 0?arguments[3]:p;Fn.debug2("registerComponent",x,Q,hn,gt);function kn(K,ne){var pe=Q,je=m,Mt=Rs(pe),{glContainer:Wt,glEventHub:Xa}=K,Za=E.getIdFromContainer(Wt);return u.jsx(dm,{glContainer:Wt,glEventHub:Xa,children:u.jsx(oi.Provider,{value:Za,children:u.jsx(je,pn(pn({},K),{},{children:Mt?u.jsx(pe,pn(pn({},K),{},{ref:ne})):u.jsx(pe,pn({},K))}))})})}kn.displayName="DashboardWrapper(".concat((oe=Q.displayName)!==null&&oe!==void 0?oe:x,")");var P=o.registerComponent(x,O.forwardRef(kn));return A.set(x,hn),M.set(x,gt),P},[h,p,A,M,o,m]),W=c.useCallback((x,Q)=>{var oe;return((oe=A.get(x))!==null&&oe!==void 0?oe:fo)(Q,r)},[A,r]),k=c.useCallback((x,Q)=>{var oe;return((oe=M.get(x))!==null&&oe!==void 0?oe:fo)(Q,r)},[M,r]),z=c.useMemo(()=>new Sa(o,W,k,new Map,V,x=>{var{closed:Q,openedMap:oe}=x;v(_m(r,{closed:Q,openedMap:oe}))}),[k,v,W,r,V,o]),F=Nd(x=>{var Q=y==null||!E.isEqual(y,x);Fn.debug("handleLayoutStateChanged",Q,x),Q&&(b(o.root.contentItems.length===0),D(x),l(x),G(o.getReactChildren()))},Mm,{flushOnUnmount:!0});c.useEffect(()=>()=>F.flush(),[F]);var j=c.useCallback(()=>{if(!S){var x=o.toConfig(),Q=x.content,oe=E.dehydrateLayoutConfig(Q,k);F(oe)}},[k,S,o,F]),H=c.useCallback(x=>{var Q=E.getIdFromContainer(x);o.eventHub.emit(Y.DRAGGING,Q),w(!0)},[o.eventHub]),U=c.useCallback(x=>{var Q=E.getIdFromContainer(x);o.eventHub.emit(Y.DROPPED,Q),w(!1)},[o.eventHub]),ce=c.useCallback(x=>{if(Fn.debug2("handleComponentCreated",x),!(x==null||x.config==null||!Et(x.config)||x.config.component==null||x.element==null)){var Q=x.config.component.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),oe="".concat(Q,"-component");x.element.addClass(oe)}},[]),tt=c.useCallback(()=>{G(o.getReactChildren())},[o]);Gt(o,"stateChanged",j),Gt(o,"itemPickedUp",H),Gt(o,"itemDropped",U),Gt(o,"componentCreated",ce),Gt(o.eventHub,Y.TITLE_CHANGED,j),Gt(o,"reactChildrenChanged",tt);var Ge=jd(a);return c.useEffect(function(){if(Ge!==a&&a!==y){Fn.debug("Setting new layout content...");for(var Q=E.hydrateLayoutConfig(a,W);o.root.contentItems.length>0;)o.root.contentItems[0].remove();for(var oe=0;oe<Q.length;oe+=1)o.root.addChild(Q[oe]);b(o.root.contentItems.length===0)}},[W,o,a,y,z,Ge]),c.useEffect(()=>d(),[]),u.jsxs(u.Fragment,{children:[g&&s,X,O.Children.map(i,x=>x!=null?u.jsx(Ou,{fallback:[],children:O.cloneElement(x,{id:r,layout:o,panelManager:z,registerComponent:J})}):null)]})}var Ma=c.createContext(null);Ma.displayName="DashboardIdContext";function Wg(){var n=c.useContext(Ma);if(n==null)throw new Error("useDashboardId must be used within a DashboardIdContext provider");return n}function km(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 r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function ka(n,e,t){if(n){if(t(n)===!0)return n;for(var r=n.child;r;){var i=ka(r,e,t);if(i)return i;r=r.sibling}}}function Am(n){try{return Object.defineProperties(n,{_currentRenderer:{get(){return null},set(){}},_currentRenderer2:{get(){return null},set(){}}})}catch{return n}}var si=Am(c.createContext(null));si.displayName="FiberContext";class zg extends c.Component{constructor(){super(...arguments),km(this,"_reactInternals",void 0)}render(){var{children:e}=this.props;return u.jsx(si.Provider,{value:this._reactInternals,children:e})}}function Lm(){var n=c.useContext(si);if(n===null)throw new Error("useFiber must be called within a <FiberProvider />!");var[e]=c.useState(()=>ct()),t=c.useMemo(()=>{for(var r of[n,n==null?void 0:n.alternate].filter(s=>s!=null)){var i=ka(r,!1,s=>{for(var o=s.memoizedState;o!=null;){if(o.memoizedState===e)return!0;o=o.next}});if(i)return i}},[n,e]);return t}var Vg="default",Rm="CREATE_DASHBOARD",Fm="CLOSE_DASHBOARD",{listen:Gg,emit:qg,useListener:Xg}=It(Rm),{listen:Zg,emit:Hm,useListener:Yg}=It(Fm);function $m(n,e,t){return(e=Um(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Um(n){var e=Bm(n,"string");return typeof e=="symbol"?e:e+""}function Bm(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class ja 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,{glContainer:r}=this.props;return[...(e=r==null||(t=r.tab)===null||t===void 0||(t=t.header)===null||t===void 0?void 0:t.tabs)!==null&&e!==void 0?e:[]]}handleCloseTab(){var{glContainer:e}=this.props;e.close()}handleCloseTabsAll(){var e=this.getAllTabs();e.forEach(t=>{var r;return(r=(t==null?void 0:t.contentItem).container)===null||r===void 0?void 0:r.close()})}handleCloseTabsRight(){for(var{glContainer:e}=this.props,t=this.getAllTabs(),r=t.length-1;r>0;r-=1){var i,s,o,a;if(((i=t[r].contentItem)===null||i===void 0||(i=i.config)===null||i===void 0?void 0:i.id)===((s=e.tab)===null||s===void 0||(s=s.contentItem)===null||s===void 0||(s=s.config)===null||s===void 0?void 0:s.id))break;(o=((a=t[r])===null||a===void 0?void 0:a.contentItem).container)===null||o===void 0||o.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(),r=!0,i=t.length-1;i>0;i-=1){var s,o,a;if(((s=t[i].contentItem)===null||s===void 0||(s=s.config)===null||s===void 0?void 0:s.id)===((o=e.tab)===null||o===void 0||(o=o.contentItem)===null||o===void 0||(o=o.config)===null||o===void 0?void 0:o.id))break;var l=!!(!((a=t[i])===null||a===void 0||(a=a.contentItem)===null||a===void 0||(a=a.config)===null||a===void 0)&&a.isClosable);if(l){r=!1;break}}return r}canCloseAny(){for(var e=this.getAllTabs(),t=!0,r=e.length-1;r>0;r-=1){var i,s=!!(!((i=e[r])===null||i===void 0||(i=i.contentItem)===null||i===void 0||(i=i.config)===null||i===void 0)&&i.isClosable);if(s){t=!1;break}}return t}canReopenLast(){var e,t,{workspace:r,glContainer:i}=this.props,s=(e=E.getStackForConfig(i.layoutManager.root,i.getConfig()))===null||e===void 0?void 0:e.config.id;return!((t=r.data.closed)!==null&&t!==void 0&&t.some(o=>o.parentStackId===s))}render(){var e,{additionalActions:t,glContainer:r}=this.props,i=[...t];i.push(()=>({title:"Re-open closed panel",group:re.groups.medium+2004,action:this.handleReopenLast,disabled:this.canReopenLast()}));var s=(e=r.tab)===null||e===void 0||(e=e.contentItem)===null||e===void 0||(e=e.config)===null||e===void 0?void 0:e.isClosable;return i.push({title:"Close",order:10,group:re.groups.low,action:this.handleCloseTab,disabled:s===void 0||!s}),i.push(()=>({title:"Close Tabs to Right",order:20,group:re.groups.low,action:this.handleCloseTabsRight,disabled:this.canCloseTabsRight()})),i.push(()=>({title:"Close All",order:30,group:re.groups.low,action:this.handleCloseTabsAll,disabled:this.canCloseAny()})),u.jsx(re,{actions:i})}}$m(ja,"defaultProps",{additionalActions:[]});var Km=n=>({workspace:Xs(n)}),Wm=Pn(Km,{setWorkspace:Zs})(ja);function Na(n,e,t){return(e=zm(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function zm(n){var e=Vm(n,"string");return typeof e=="symbol"?e:e+""}function Vm(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class Aa extends c.PureComponent{constructor(e){super(e),Na(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=O.createRef();var{value:t}=e;this.state={value:t,valueWasValidated:!1}}componentDidUpdate(e){var{isShown:t}=e,{isShown:r}=this.props;r&&!t&&this.resetState()}resetState(){var{value:e}=this.props;this.setState({value:e,valueWasValidated:!1})}handleRenameDialogOpened(){var e;(e=this.renameInputRef)===null||e===void 0||(e=e.current)===null||e===void 0||e.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,r=t==null?void 0:t.trim();if(r!==void 0&&r!==""){var{onSubmit:i}=this.props;i(r)}else this.setState({value:r,valueWasValidated:!0})}renderRenameDialog(){var{isShared:e,isOwner:t,itemType:r}=this.props,{value:i,valueWasValidated:s}=this.state;return u.jsxs("form",{className:$("p-3",{"was-validated":s}),onSubmit:this.handleRenameSubmit,noValidate:!0,role:"presentation",onMouseDown:o=>{o.stopPropagation()},onMouseUp:o=>{o.stopPropagation()},children:[u.jsxs("div",{className:"form-group",children:[u.jsxs("label",{htmlFor:"rename-dialog-".concat(r,"-input"),children:["Rename ",r]}),u.jsx("input",{type:"text",className:"form-control",id:"rename-dialog-".concat(r,"-input"),value:i??void 0,ref:this.renameInputRef,onChange:this.handleRenameInputChange,required:!0}),u.jsxs("div",{className:"invalid-feedback",children:[r," name cannot be empty"]}),(e||!t)&&u.jsxs("div",{className:"pt-2",children:["Renaming this ",r," will rename for all users."]})]}),u.jsxs("div",{className:"text-right",children:[u.jsx(te,{kind:"secondary",className:"mr-2",onClick:this.handleRenameCancel,children:"Cancel"}),u.jsx(te,{kind:"primary",type:"submit",children:"Rename"})]})]})}render(){var{isShown:e,onCancel:t}=this.props;return u.jsx(ir,{isShown:e,onEntered:this.handleRenameDialogOpened,onExited:t,options:{placement:"bottom"},interactive:!0,closeOnBlur:!0,children:this.renderRenameDialog()})}}Na(Aa,"defaultProps",{isShared:!1,isOwner:!0,itemType:"Item",value:""});var Hn=Object.freeze({focus:"TabEvent.focus",blur:"TabEvent.blur"});function go(n,e,t){return(e=Gm(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Gm(n){var e=qm(n,"string");return typeof e=="symbol"?e:e+""}function qm(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var Xm=R.module("Panel");class Zm extends c.PureComponent{constructor(e){super(e),go(this,"ref",void 0),go(this,"getAdditionalActions",Qt((r,i,s)=>{var o=[];return i&&o.push(this.getCloneAction()),s&&o.push(this.getRenameAction()),[...o,...r]})),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=O.createRef();var{glContainer:t}=this.props;this.state={title:E.getTitleFromContainer(t),showRenameDialog:!1,isWithinPanel:!0}}componentDidMount(){var e,{componentPanel:t,glContainer:r,glEventHub:i}=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),i.on(Hn.focus,this.handleTabFocus),i.on(Hn.blur,this.handleTabBlur),i.emit(Y.MOUNT,t??this),this.setState({isWithinPanel:((e=this.ref.current)===null||e===void 0||(e=e.parentElement)===null||e===void 0?void 0:e.closest(".dh-panel"))!=null})}componentWillUnmount(){var{componentPanel:e,glContainer:t,glEventHub:r}=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),r.off(Hn.focus,this.handleTabFocus),r.off(Hn.blur,this.handleTabBlur),r.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:r}=this.props;r.emit(Y.FOCUS,t??this);var{onFocus:i}=this.props;i==null||i(e)}handleBlur(e){var{onBlur:t}=this.props;t==null||t(e)}handleHide(){for(var{onHide:e}=this.props,t=arguments.length,r=new Array(t),i=0;i<t;i++)r[i]=arguments[i];e==null||e(...r)}handleResize(){for(var{onResize:e}=this.props,t=arguments.length,r=new Array(t),i=0;i<t;i++)r[i]=arguments[i];e==null||e(...r)}handleBeforeShow(){for(var{onBeforeShow:e}=this.props,t=arguments.length,r=new Array(t),i=0;i<t;i++)r[i]=arguments[i];e==null||e(...r)}handleShow(){for(var{onShow:e}=this.props,t=arguments.length,r=new Array(t),i=0;i<t;i++)r[i]=arguments[i];e==null||e(...r)}handleTabBlur(){for(var{onTabBlur:e}=this.props,t=arguments.length,r=new Array(t),i=0;i<t;i++)r[i]=arguments[i];e==null||e(...r)}handleTabFocus(){for(var{onTabFocus:e}=this.props,t=arguments.length,r=new Array(t),i=0;i<t;i++)r[i]=arguments[i];e==null||e(...r)}handleRenameCancel(){this.setState({showRenameDialog:!1})}handleShowRenameDialog(){this.setState({showRenameDialog:!0})}handleRenameSubmit(e){var{glContainer:t}=this.props;this.setState({showRenameDialog:!1,title:e});var r=E.getRootFromContainer(t),i=E.getComponentConfigFromContainer(t);L(i),E.renameComponent(r,i,e)}handleCopyPanel(){var{glContainer:e,glEventHub:t}=this.props,r=E.getRootFromContainer(e),i=E.getComponentConfigFromContainer(e);if(i==null){Xm.error("Could not get component config from container",e);return}var s=E.cloneComponent(r,i);s!==null&&t.emit(Y.CLONED,this,s)}getCloneAction(){return{title:"Copy Panel",order:10,group:re.groups.high,action:this.handleCopyPanel}}getRenameAction(){return{title:"Rename",order:10,group:re.groups.medium,action:this.handleShowRenameDialog}}render(){var{children:e,className:t,renderTabTooltip:r,glContainer:i,glEventHub:s,additionalActions:o=Gl,errorMessage:a,isLoaded:l=!0,isLoading:d=!1,isClonable:h=!1,isRenamable:p=!1}=this.props,{tab:m}=i,{showRenameDialog:v,title:f,isWithinPanel:g}=this.state;return u.jsxs("div",{className:$("h-100 w-100 dh-panel",t),onFocusCapture:this.handleFocus,onBlurCapture:this.handleBlur,ref:this.ref,children:[e,u.jsx(_n,{"data-testid":"base-panel-loading",errorMessage:a,isLoaded:l,isLoading:d}),!g&&m!=null&&Gr.createPortal(u.jsxs(u.Fragment,{children:[u.jsx(Wm,{glContainer:i,glEventHub:s,additionalActions:this.getAdditionalActions(o,h,p)}),p&&u.jsx(Aa,{isShown:v,value:f,itemType:"Panel",onCancel:this.handleRenameCancel,onSubmit:this.handleRenameSubmit}),r!=null&&u.jsx(ie,{interactive:!0,options:{placement:"bottom"},popperClassName:"panel-tab-popper",children:r()})]}),m.element[0])]})}}var Ym=Ks(Zm),Jm=R.module("useDhId"),Sr="__dhId";function Jg(){var n,e,t=(n=(e=Lm())===null||e===void 0?void 0:e.pendingProps)!==null&&n!==void 0?n:{},r=t[Sr],i=Pm();if(r!=null){if(typeof r!="string")throw new Error("useDhId expected prop ".concat(Sr," to be a string, but got ").concat(typeof r));return r}return i??(Jm.warn("useDhId must be used within a PanelIdContext provider if there is no ".concat(Sr," prop. Defaulting to null.")),null)}function La(n){var{type:e}=n,t=Hu();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:pl});case t.VariableType.FIGURE:return u.jsx(le,{icon:ps});case t.VariableType.PANDAS:return u.jsx(le,{icon:ml});default:return u.jsx(le,{icon:cs})}}function bo(n,e,t,r,i,s,o){try{var a=n[s](o),l=a.value}catch(d){return void t(d)}a.done?e(l):Promise.resolve(l).then(r,i)}function Qm(n){return function(){var e=this,t=arguments;return new Promise(function(r,i){var s=n.apply(e,t);function o(l){bo(s,r,i,o,a,"next",l)}function a(l){bo(s,r,i,o,a,"throw",l)}o(void 0)})}}function Ra(n){var{children:e,language:t}=n,[r,i]=c.useState(null),{activeThemes:s}=Ms();return c.useEffect(()=>{var o=!1;function a(){return l.apply(this,arguments)}function l(){return l=Qm(function*(){if(e!=null&&s!=null){var d=yield Ee.colorize(e.toString(),t,{});o||i(d)}}),l.apply(this,arguments)}return a(),()=>{o=!0}},[s,e,t]),u.jsx("div",{style:{pointerEvents:"none"},dangerouslySetInnerHTML:r!=null?{__html:r}:void 0})}class Fa{static get LANGUAGE_MAP(){return new Map([["python","Python"],["groovy","Groovy"],["scala","Scala"]])}}class Jn{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)?[]:Bl.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"),r="".concat(e.getMinutes()).padStart(2,"0"),i="".concat(e.getSeconds()).padStart(2,"0"),s="".concat(e.getMilliseconds()).padStart(3,"0");return"".concat(t,":").concat(r,":").concat(i,".").concat(s)}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 Jn.isTableType(e,t)||Jn.isWidgetType(e,t)}static isFigureType(e,t){return t===e.VariableType.FIGURE}static isPandas(e,t){return t===e.VariableType.PANDAS}}function ep(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})]})}function Kr(n,e,t){return(e=tp(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function tp(n){var e=np(n,"string");return typeof e=="symbol"?e:e+""}function np(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class Ha extends c.Component{constructor(e){super(e),Kr(this,"timer",void 0),Kr(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:r}=this.state;return u.jsx("div",{className:$("console-history-result-in-progress",{disabled:e}),children:u.jsxs("span",{className:"badge",children:[u.jsx(vs,{className:"ml-2"}),"Running... ",dn.formatElapsedTime(r)," ",u.jsx(te,{className:"console-history-result-in-progress-cancel",kind:"ghost",icon:vl,tooltip:"Cancel",onClick:t,disabled:e})]})})}}Kr(Ha,"defaultProps",{disabled:!1});function Cn(n,e,t){return(e=rp(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function rp(n){var e=ip(n,"string");return typeof e=="symbol"?e:e+""}function ip(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class rn extends c.PureComponent{constructor(e){super(e),Cn(this,"mouseX",void 0),Cn(this,"mouseY",void 0),Cn(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)>=rn.mouseDragThreshold||Math.abs(e.clientY-this.mouseY)>=rn.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:r}=this.props;L(r);var i=r.trimEnd(),s=i.indexOf(`
|
|
2
|
+
import{ao as Ya,a as R,aP as as,T as Ja,z as Qa,X as el,Y as tl,V as nl,a4 as rl,O as il,a8 as ol,d as ls,G as ds,e as us,q as sl,aQ as hs,aR as al,aS as ll,L as _n,ac as dl,_ as ul,aT as cs,t as ms,Z as hl,aU as cl,u as L,aO as ml,aK as ps,aL as pl,f as vs,n as vl,aM as Or,aV as fl,aW as hi,aX as gl,aY as bl,aZ as yl,a_ as Cl,v as wl,k as fs,aH as Sl,h as fr,aC as _l,a$ as El,b0 as ci,aF as Pl,b1 as mi,b2 as gs,b3 as Tl,aw as Ol,b4 as xl,b5 as Il,b6 as Dl,b7 as Ml,b8 as kl,b9 as jl}from"./index-DDfPR1jK.js";import{r as c,ag as En,bo as nr,J as O,bE as bs,bF as xr,D as u,H as Nl,G as $,R as Gr,bq as Al,I as le,C as ct,bG as Ll,E as ys,af as qt,bH as Rl,bI as Fl,bJ as Hl,bB as Ir,_ as $l,bK as T,bL as pi,bD as ae,N as Cs,L as ws,bM as Ul,bC as Pn,by as Qt,bd as Ee,bN as Bl,bg as vi,bO as Kl,bP as fi,bf as ze,bQ as Ss,bR as Wl,bz as We,bA as Ft,bS as gi,be as zl,bx as Vl,bT as gn}from"./vendor-DDL65YSs.js";var Gl=Object.freeze([]),Wf=new Map,_s=()=>{};function zf(n){return Array.isArray(n)?n:[n]}function Vf(){for(var n=arguments.length,e=new Array(n),t=0;t<n;t++)e[t]=arguments[t];return e.filter(r=>r!=null)}function ql(n,e,t){return(e=Xl(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Xl(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 r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class bi extends Error{constructor(){super(...arguments),ql(this,"isCanceled",!0)}}function Yl(n,e,t){return(e=Jl(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Jl(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 r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class ed extends Error{constructor(){super(...arguments),Yl(this,"isClipboardPermissionsDeniedError",!0)}}function td(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=rd(n,"string");return typeof e=="symbol"?e:e+""}function rd(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class gr extends Error{constructor(){super(...arguments),td(this,"isClipboardUnavailableError",!0)}}function id(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 r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class Es extends Error{constructor(){super(...arguments),id(this,"isPermissionUnsupported",!0)}}function yi(n,e,t,r,i,s,o){try{var a=n[s](o),l=a.value}catch(d){return void t(d)}a.done?e(l):Promise.resolve(l).then(r,i)}function ad(n){return function(){var e=this,t=arguments;return new Promise(function(r,i){var s=n.apply(e,t);function o(l){yi(s,r,i,o,a,"next",l)}function a(l){yi(s,r,i,o,a,"throw",l)}o(void 0)})}}function Ci(n){return Dr.apply(this,arguments)}function Dr(){return Dr=ad(function*(n){try{var e=n;return(yield navigator.permissions.query({name:e})).state}catch(t){throw t instanceof TypeError?new Es:t}}),Dr.apply(this,arguments)}function wi(n,e,t,r,i,s,o){try{var a=n[s](o),l=a.value}catch(d){return void t(d)}a.done?e(l):Promise.resolve(l).then(r,i)}function Ps(n){return function(){var e=this,t=arguments;return new Promise(function(r,i){var s=n.apply(e,t);function o(l){wi(s,r,i,o,a,"next",l)}function a(l){wi(s,r,i,o,a,"throw",l)}o(void 0)})}}function ld(n){return Mr.apply(this,arguments)}function Mr(){return Mr=Ps(function*(n){var{clipboard:e}=navigator;if(e!==void 0)try{return yield navigator.clipboard.writeText(n)}catch{}dd(n)}),Mr.apply(this,arguments)}function dd(n){var e=document.activeElement,t=document.createElement("textarea");t.value=n,document.body.appendChild(t),t.focus(),t.select();var r=document.execCommand("copy");if(document.body.removeChild(t),e instanceof HTMLElement&&e.focus(),!r)throw new Error("Unable to execute copy command")}function Gf(){return kr.apply(this,arguments)}function kr(){return kr=Ps(function*(){try{var{clipboard:n}=navigator;if(n===void 0)throw new gr;var e=yield Ci("clipboard-read");if(e==="granted"){var t=yield n.readText();return t}if(e==="prompt"){try{yield n.readText()}catch{}if(e=yield Ci("clipboard-read"),e==="granted"){var r=yield n.readText();return r}}if(e==="prompt"||e==="denied")throw new ed}catch(i){throw i instanceof Es?new gr:i}throw new gr}),kr.apply(this,arguments)}var ln;function Ut(n,e,t){return(e=ud(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function ud(n){var e=hd(n,"string");return typeof e=="symbol"?e:e+""}function hd(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var cd="table_",Ts="column_",md=new Set(["in","not","i","ii","k"]),pd=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"]),vd=/[^a-zA-Z0-9_$\-+@]/g,fd=/[^A-Za-z0-9_$]/g,gd=/^[a-zA-Z_$][a-zA-Z0-9_$\-+@]*$/,bd=/[^a-zA-Z0-9_]/g;function yd(n){return n.replace(/[ -]/g,"_")}function Cd(n){return n.replace(/\s/g,"_")}class ot{}ln=ot;Ut(ot,"legalize",(n,e,t,r,i,s)=>{var o=e(n.trim());return i&&(md.has(o)||pd.has(o))&&(o=t+o),o=o.replace(r,""),o?(/^[0-9-]/.test(o)&&(o=t+o),o):t+s});Ut(ot,"legalizeTableName",n=>ln.legalize(n,Cd,cd,vd,!1,0));Ut(ot,"makeVariableName",n=>ln.legalizeTableName(n).replace(bd,"_"));Ut(ot,"legalizeColumnNames",n=>{var e=[];return n.forEach((t,r)=>{var i=ln.legalizeColumnName(t,r);e.includes(i)&&(i=Ts+r),e.push(i)}),e});Ut(ot,"legalizeColumnName",function(n){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return ln.legalize(n,yd,Ts,fd,!0,e)});Ut(ot,"isValidTableName",n=>gd.test(n));Ut(ot,"isValidColumnName",n=>ln.legalizeColumnName(n)===n);class Os extends CustomEvent{constructor(e,t){super(e,t)}}class He{static makeCancelable(e,t){var r=!1,i,s,o=new Promise((a,l)=>{s=l,Promise.resolve(e).then(d=>{r?t&&t(d):(i=d,a(d))}).catch(d=>l(d))});return o.cancel=()=>{r=!0,s(new bi),i!=null&&t&&t(i)},o}static isCanceled(e){return e instanceof bi}static isTimedOut(e){return e instanceof Ya}static withTimeout(e,t){return new Promise((r,i)=>{setTimeout(()=>{try{r(t())}catch(s){i(s)}},e)})}}function Si(n,e,t){return(e=wd(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function wd(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 r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class rr{constructor(){Si(this,"pending",[]),Si(this,"resolved",[])}add(e,t){var r=He.makeCancelable(e,t);return this.pending.push(r),r.then(()=>{this.resolve(r)},()=>{this.resolve(r)}),r}remove(e){for(var t=0;t<this.pending.length;t+=1)if(this.pending[t]===e){this.pending.splice(t,1);return}}resolve(e){this.remove(e),this.resolved.push(e)}cancel(){for(var e=[...this.pending,...this.resolved],t=0;t<e.length;t+=1)e[t].cancel();this.pending=[],this.resolved=[]}}function qf(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 Ze{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(!Ze.isValidRange(e))throw new Error("Invalid range! ".concat(e))}static isSelected(e,t){for(var r=0;r<e.length;r+=1){var i=e[r],s=i[0],o=i[1];if(s<=t&&t<=o)return!0}return!1}static selectRange(e,t){for(var[r,i]=t,s=[...e],o=s.length-1;o>=0;o-=1){var a=s[o],l=a[0],d=a[1];if(l<=r&&i<=d)return s;r<=d&&l<=i&&(r=Math.min(r,l),i=Math.max(i,d),s.splice(o,1))}return s.push([r,i]),s}static deselectRange(e,t){for(var[r,i]=t,s=[...e],o=s.length-1;o>=0;o-=1){var a=s[o],l=a[0],d=a[1];if(!(i<l||d<r))if(l<r&&i<d){s[o]=[l,r-1],s.splice(o+1,0,[i+1,d]);break}else r<=l&&d<=i?s.splice(o,1):l<r?s[o]=[l,r-1]:s[o]=[i+1,d]}return s}static count(e){return e.reduce((t,r)=>t+(r[1]-r[0]+1),0)}static getItemsInRanges(e,t){return t.reduce((r,i)=>{for(var s=[...r],o=i[0];o<=i[1];o+=1)s.push(e[o]);return s},[])}}function*Xf(n,e){for(var t=n;t<=e;++t)yield t}var Zf=" ";class _d{static join(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"and";if(e==null||e.length===0)return"";if(e.length===1)return e[0];if(e.length===2)return"".concat(e[0]," ").concat(t," ").concat(e[1]);var r=e.slice(0,e.length-1).join(", "),i=e[e.length-1];return"".concat(r,", ").concat(t," ").concat(i)}static toLower(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;if(e==null){if(t)return"";throw new Error("Null string passed in to TextUtils.toLower")}return e.toLowerCase()}static sort(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;return e<t?r?-1:1:e>t?r?1:-1:0}static pluralize(e,t,r){return e===1?t:r??"".concat(t,"s")}}function xs(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=Pd(n,"string");return typeof e=="symbol"?e:e+""}function Pd(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class dn{static formatElapsedTime(e){if(typeof e!="number"||!Number.isInteger(e))throw new Error("".concat(e," is not a number that can be expressed as a formatted time"));var t=Math.floor(e/3600),r=Math.floor(e%3600/60),i=e%60;return"".concat(t>0?"".concat(t,"h "):"")+"".concat(r>0||t>0?"".concat(r,"m "):"")+"".concat(e>=60?"".concat(i,"s").padStart(3,"0"):"".concat(i,"s"))}static formatTime(e){if(typeof e!="number"||!Number.isInteger(e)||e<0)throw new Error("".concat(e," is not a number that can be expressed as a formatted time"));var t=String(Math.floor(e/(60*60))).padStart(2,"0"),r=e%(60*60),i=String(Math.floor(r/60)).padStart(2,"0"),s=r%60,o=String(Math.ceil(s)).padStart(2,"0");return"".concat(t,":").concat(i,":").concat(o)}static isTimeString(e){return new RegExp(dn.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])}}xs(dn,"TIME_PATTERN","([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]");xs(dn,"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 Td(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=xd(n,"string");return typeof e=="symbol"?e:e+""}function xd(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class bn extends Error{constructor(){super(...arguments),Td(this,"isInvalid",!0)}}function Is(){var n=c.useRef(!1);return c.useEffect(()=>(n.current=!0,()=>{n.current=!1}),[]),n}function _i(n,e,t,r,i,s,o){try{var a=n[s](o),l=a.value}catch(d){return void t(d)}a.done?e(l):Promise.resolve(l).then(r,i)}function Id(n){return function(){var e=this,t=arguments;return new Promise(function(r,i){var s=n.apply(e,t);function o(l){_i(s,r,i,o,a,"next",l)}function a(l){_i(s,r,i,o,a,"throw",l)}o(void 0)})}}var Dd=R.module("useAsyncInterval");function Md(n,e){var t=Is(),r=c.useRef(0),i=c.useRef(0),s=c.useRef(null),o=c.useCallback(Id(function*(){var a=Date.now();i.current+=1;var l=s.current==null?e:a-s.current;s.current=a;try{yield n()}catch(p){Dd.error("A tick error occurred:",p)}if(t.current){l+=Date.now()-s.current;var d=Math.max(0,l-e),h=Math.max(0,e-d);r.current=window.setTimeout(o,h)}}),[n,t,e]);c.useEffect(()=>(s.current=null,o(),()=>{window.clearTimeout(r.current)}),[e,o])}function Tn(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 kd(n,e){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},{leading:r=!1,trailing:i=!0,maxWait:s}=t,o=c.useMemo(()=>En(n,e,s!=null?{leading:r,trailing:i,maxWait:s}:{leading:r,trailing:i}),[n,e,r,i,s]);return c.useEffect(()=>()=>o.cancel(),[o]),o}function jd(n){var e=c.useRef();return c.useEffect(function(){e.current=n}),e.current}function Nd(n,e,t){var r=c.useRef(t),i=c.useRef(n);i.current=n;var s=c.useMemo(()=>nr(function(){return i.current(...arguments)},e,r.current),[e]);return c.useEffect(()=>()=>{var o,a;(o=(a=r.current)===null||a===void 0?void 0:a.flushOnUnmount)!==null&&o!==void 0&&o?s.flush():s.cancel()},[s]),s}function Ds(n){var e=c.useRef(null);return c.useEffect(function(){n&&(typeof n=="function"?n(e.current):n.current=e.current)}),e}function Ei(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function bt(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Ei(Object(t),!0).forEach(function(r){Xt(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Ei(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function Xt(n,e,t){return(e=Ad(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Ad(n){var e=Ld(n,"string");return typeof e=="symbol"?e:e+""}function Ld(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var Pi="popper",Rd={placement:"bottom-end",modifiers:{preventOverflow:{boundariesElement:"scrollParent",fn:(n,e)=>{var t,r,i=(t=bs.Defaults.modifiers)===null||t===void 0||(t=t.preventOverflow)===null||t===void 0||(r=t.fn)===null||r===void 0?void 0:r.call(t,n,e);return i==null?n:(i.styles.maxHeight="".concat(document.documentElement.clientHeight-n.offsets.popper.top-2*e.padding,"px"),i??n)}},flip:{enabled:!1}}};class ir extends c.Component{constructor(e){super(e),Xt(this,"element",void 0),Xt(this,"container",void 0),Xt(this,"nodeRef",O.createRef()),Xt(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=O.createRef(),this.rAF=0;var{isShown:t}=this.props;this.state={show:t,popper:null}}componentDidUpdate(e){var{isShown:t}=this.props,{popper:r}=this.state;e.isShown!==t&&(cancelAnimationFrame(this.rAF),this.rAF=window.requestAnimationFrame(()=>{t?this.show():this.hide()})),r&&r.scheduleUpdate()}componentWillUnmount(){this.destroyPopper(!1)}getVisibleElement(e){return e==null||e.clientHeight>0||e.clientWidth>0?e:this.getVisibleElement(e.parentElement)}initPopper(){var e,t,{popper:r}=this.state,{closeOnBlur:i,referenceObject:s}=this.props;if(!r&&this.container.current!==null){var{options:o,keepInParent:a}=this.props,l=a?Rd:{placement:"auto",modifiers:{preventOverflow:{boundariesElement:"viewport"}}},d=bt(bt(bt({},l),o),{},{modifiers:bt(bt(bt({},l.modifiers),o.modifiers),{},{preventOverflow:bt(bt({},(e=l.modifiers)===null||e===void 0?void 0:e.preventOverflow),(t=o.modifiers)===null||t===void 0?void 0:t.preventOverflow)})});document.body.appendChild(this.element);var h=this.getVisibleElement(this.container.current);h==null&&(h=this.container.current);var p=new bs(s||h,this.element,d);p.scheduleUpdate(),cancelAnimationFrame(this.rAF),this.rAF=window.requestAnimationFrame(()=>{if(i){var m=this.element.querySelector(".".concat(Pi));m instanceof HTMLElement&&!m.contains(document.activeElement)&&m.focus()}}),xr.flushSync(()=>{this.setState({popper:p})})}}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(),xr.flushSync(()=>{this.setState({show:!0})})}hide(){this.setState({show:!1})}scheduleUpdate(){var{popper:e}=this.state;e&&e.scheduleUpdate()}handleBlur(e){var{closeOnBlur:t,onBlur:r}=this.props;e.relatedTarget instanceof HTMLElement&&(this.element.contains(e.relatedTarget)||(r==null||r(e),t&&this.hide()))}handleEnter(){var{onEntered:e}=this.props;e()}handleExit(){var{onExited:e}=this.props,{show:t}=this.state;t||this.destroyPopper(),e()}renderContent(){var{className:e,children:t,timeout:r,interactive:i,closeOnBlur:s}=this.props,{show:o}=this.state;return u.jsx(as,{isPortal:!0,children:u.jsx(Nl,{in:o,timeout:r,classNames:"popper-transition",onEntered:this.handleEnter,onExited:this.handleExit,nodeRef:this.nodeRef,children:u.jsx("div",{ref:this.nodeRef,onClick:a=>{a.stopPropagation()},onKeyDown:a=>{a.key==="Escape"&&this.hide()},className:$(Pi,{interactive:i},e),onBlur:this.handleBlur,tabIndex:s?-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&&Gr.createPortal(this.renderContent(),this.element)})}}Xt(ir,"defaultProps",{options:{},className:"",timeout:Ja.transitionMs,onEntered(){},onExited(){},onBlur(){},isShown:!1,interactive:!1,closeOnBlur:!1,keepInParent:!1,referenceObject:null,"data-testid":void 0});var jr;function Ti(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function Fd(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Ti(Object(t),!0).forEach(function(r){Ye(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Ti(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function Ye(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=$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 r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var Ud=R.module("Tooltip");class ie extends c.Component{static handleHidden(){ie.shownTooltipCount-=1,ie.shownTooltipCount===0&&(ie.lastHiddenTime=Date.now())}static handleShown(){ie.shownTooltipCount+=1}constructor(e){super(e),Ye(this,"container",void 0),Ye(this,"popper",void 0),Ye(this,"parent",void 0),Ye(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=O.createRef(),this.popper=O.createRef(),this.parent=null,this.timer=null,this.state={isShown:!1}}componentDidMount(){this.startListening();var{timeout:e}=this.props;e===0&&this.show()}componentDidUpdate(e,t){var{isShown:r}=t,{isShown:i}=this.state;i!==r&&(i?ie.handleShown():ie.handleHidden())}componentWillUnmount(){this.stopListening(),this.stopListeningWindow(),this.stopTimer();var{isShown:e}=this.state;e&&ie.handleHidden()}startListening(){if(!this.container.current||!this.container.current.parentElement){Ud.error("Tooltip doesn't have a container or a parent set!");return}this.parent=this.container.current.parentElement,this.parent.addEventListener("mousemove",this.handleMouseMove),this.parent.addEventListener("mouseleave",this.handleMouseLeave),this.parent.addEventListener("mousedown",this.stopShowingTooltip)}stopListening(){this.parent&&(this.parent.removeEventListener("mousemove",this.handleMouseMove),this.parent.removeEventListener("mouseleave",this.handleMouseLeave),this.parent.removeEventListener("mousedown",this.stopShowingTooltip))}startListeningWindow(){window.addEventListener("mousemove",this.handleWindowMouseMove,!0),window.addEventListener("contextmenu",this.stopShowingTooltip,!0),window.addEventListener("wheel",this.handleWheel)}stopListeningWindow(){window.removeEventListener("mousemove",this.handleWindowMouseMove,!0),window.removeEventListener("contextmenu",this.stopShowingTooltip,!0),window.removeEventListener("wheel",this.handleWheel)}handleMouseMove(){this.startTimer()}handleWheel(){var{isShown:e}=this.state;this.popper.current&&this.parent&&e&&!this.popper.current.element.matches(":hover")&&!this.parent.matches(":hover")&&(this.stopTimer(),this.hide())}handleMouseLeave(){var{isShown:e}=this.state;this.stopTimer();var{interactive:t}=this.props;!t&&e&&this.hide()}handleTimeout(){this.show()}handleWindowMouseMove(e){var t=e.clientX,r=e.clientY,{isShown:i}=this.state;if(!(!this.popper.current||!this.parent)){var s=this.popper.current.element.getBoundingClientRect(),o=this.parent.getBoundingClientRect();t>=s.left&&t<=s.left+s.width&&r>=s.top&&r<=s.top+s.height?this.handleMouseMove():t>=o.left&&t<=o.left+o.width&&r>=o.top&&r<=o.top+o.height?this.handleMouseMove():i&&(this.stopTimer(),this.hide())}}startTimer(){this.stopTimer();var{timeout:e,reshowTimeout:t}=this.props,r=e;(ie.shownTooltipCount>0||Date.now()-ie.lastHiddenTime<ie.triggerReshowThreshold)&&(r=t),this.timer=window.setTimeout(this.handleTimeout,r)}stopTimer(){this.timer!=null&&(clearTimeout(this.timer),this.timer=null)}show(){var{isShown:e}=this.state;if(this.stopTimer(),!e){var t;(t=this.popper.current)===null||t===void 0||t.show(),xr.flushSync(()=>{this.setState({isShown:!0})});var{interactive:r}=this.props;r&&this.startListeningWindow()}}hide(){var e;(e=this.popper.current)===null||e===void 0||e.hide(),this.stopListeningWindow()}update(){var e;(e=this.popper.current)===null||e===void 0||e.scheduleUpdate()}handleExited(){this.setState({isShown:!1});var{onExited:e}=this.props;e()}stopShowingTooltip(){var{isShown:e}=this.state;this.stopTimer(),e&&this.hide()}render(){var{interactive:e,children:t,referenceObject:r,popperClassName:i,"data-testid":s,onEntered:o}=this.props,{isShown:a}=this.state,{options:l}=this.props;return l=Fd({placement:"bottom"},l),u.jsx("div",{ref:this.container,style:{display:"none"},"data-testid":s,children:u.jsx(ir,{className:$(i,"popper-tooltip"),options:l,ref:this.popper,onEntered:o,onExited:this.handleExited,interactive:e,referenceObject:r,children:u.jsxs("div",{className:"tooltip-content",children:[" ",a&&t]})})})}}jr=ie;Ye(ie,"defaultTimeout",500);Ye(ie,"defaultReshowTimeout",100);Ye(ie,"triggerReshowThreshold",300);Ye(ie,"shownTooltipCount",0);Ye(ie,"lastHiddenTime",Date.now());Ye(ie,"defaultProps",{interactive:!1,options:{},popperClassName:"",reshowTimeout:jr.defaultReshowTimeout,timeout:jr.defaultTimeout,onEntered:()=>{},onExited:()=>{},"data-testid":void 0});var Bd=R.module("ThemeProvider"),qr=c.createContext(null);qr.displayName="ThemeContext";function Yf(n){var{themes:e,waitForActivation:t=!1,defaultPreloadValues:r=Qa,children:i}=n,s=c.useMemo(()=>el(),[]),[o,a]=c.useState(null),[l,d]=c.useState(tl),h=c.useMemo(()=>e==null?null:nl(l,{base:s,custom:e??[]}),[s,l,e]),p=c.useMemo(()=>[...s,...e??[]],[s,e]);return c.useEffect(function(){if(!(h==null||e==null)){rl(r);var v=il(r);Bd.debug2("updateThemePreloadData:",{active:h.map(f=>f.themeKey),custom:e.map(f=>f.themeKey),preloadStyleContent:v,selectedThemeKey:l}),ol({themeKey:l,preloadStyleContent:v})}},[h,l,e,r]),c.useEffect(()=>{a({activeThemes:h,selectedThemeKey:l,themes:p,setSelectedThemeKey:d})},[h,l,p]),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))}),o==null?null:u.jsx(qr.Provider,{value:o,children:u.jsx(as,{children:i})})]})}function Ms(){return Tn(qr,"No ThemeContext value found. Component must be wrapped in a ThemeContext.Provider")}function Kd(n){var{children:e,className:t,style:r,"data-testid":i}=n;return u.jsx("div",{className:$("btn-group",t),style:r,role:"group","data-testid":i,children:e})}var Wd=["kind","variant","type","tooltip","icon","disabled","active","onClick","onContextMenu","onMouseDown","onMouseUp","onMouseEnter","onMouseLeave","onKeyDown","className","style","children","tabIndex","data-testid","aria-label"];function Oi(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function xi(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Oi(Object(t),!0).forEach(function(r){zd(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Oi(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function zd(n,e,t){return(e=Vd(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Vd(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 r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function qd(n,e){if(n==null)return{};var t,r,i=Xd(n,e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(n);for(r=0;r<s.length;r++)t=s[r],e.indexOf(t)===-1&&{}.propertyIsEnumerable.call(n,t)&&(i[t]=n[t])}return i}function Xd(n,e){if(n==null)return{};var t={};for(var r in n)if({}.hasOwnProperty.call(n,r)){if(e.indexOf(r)!==-1)continue;t[r]=n[r]}return t}function Zd(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 $("btn-link",{"btn-link-icon":e,"btn-link-icon-only":e})}}function Yd(n){switch(n){case"group-end":return $("pl-2","pr-3")}}var te=O.forwardRef((n,e)=>{var{kind:t,variant:r,type:i="button",tooltip:s,icon:o,disabled:a=!1,active:l,onClick:d,onContextMenu:h,onMouseDown:p,onMouseUp:m,onMouseEnter:v,onMouseLeave:f,onKeyDown:g,className:b,style:S,children:w,tabIndex:y,"data-testid":D,"aria-label":V}=n,X=qd(n,Wd),{UNSAFE_className:G}=Al({},"button"),A;r&&(A=Yd(r));var M;o&&(M=O.isValidElement(o)?o:u.jsx(le,{icon:o}));var J=M!=null&&w==null,W=Zd(t,J),k;s!==void 0&&(k=typeof s=="string"?u.jsx(ie,{children:s}):s);var z=V;V===void 0&&J&&s!=null&&typeof s=="string"&&(z=s);var F=u.jsxs("button",xi(xi({"data-testid":D,ref:e,type:i,className:$("btn",W,A,{active:l},b,G),onClick:d,onContextMenu:h,onMouseUp:m,onMouseDown:p,onMouseEnter:v,onMouseLeave:f,onKeyDown:g,style:S,disabled:a,tabIndex:y,"aria-label":z},X),{},{children:[o&&M,w,s!=null&&!a&&k]}));return a&&s!=null?u.jsxs("span",{className:"btn-disabled-wrapper",children:[F,k]}):F});te.displayName="Button";function ks(n){var{className:e,children:t,"data-testid":r}=n;return u.jsx("div",{className:$("modal-footer",e),"data-testid":r,children:t})}function Nr(n){var{isOpen:e,headerText:t,bodyText:r,onCancel:i,onConfirm:s,onDiscard:o,onModalDisable:a,cancelButtonText:l="Cancel",confirmButtonText:d="Okay",discardButtonText:h="Discard",isConfirmDanger:p=!1,children:m,"data-testid":v}=n,f=c.useRef(null),g=c.useRef(null),b=c.useCallback(()=>{g.current!==null&&g.current.checked&&a&&a(),s()},[s,a]),S=c.useCallback(()=>{var y;(y=f.current)===null||y===void 0||y.focus()},[]),w="";return e&&(w=typeof r=="function"?r():r),u.jsxs(ls,{isOpen:e,onOpened:S,children:[u.jsx(ds,{closeButton:!1,children:t}),u.jsx(us,{children:w}),u.jsxs(ks,{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":v!==void 0?"".concat(v,"-checkbox-confirm"):void 0}),u.jsx("label",{className:"custom-control-label",htmlFor:"move-confirmation-checkbox",children:"Don't ask me again"})]}),o&&u.jsx(te,{kind:"secondary",className:"mr-auto","data-dismiss":"modal",onClick:o,"data-testid":v!==void 0?"".concat(v,"-btn-discard"):void 0,children:h}),i&&u.jsx(te,{kind:"secondary","data-dismiss":"modal",onClick:i,"data-testid":v!==void 0?"".concat(v,"-btn-cancel"):void 0,children:l}),u.jsxs(Kd,{children:[u.jsx(te,{kind:p?"danger":"primary",onClick:b,ref:f,"data-testid":v!==void 0?"".concat(v,"-btn-confirm"):void 0,children:d}),m]})]})]})}function Jd(n,e,t){return(e=Qd(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Qd(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 r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function br(n){return n.then!==void 0}class he{static disableAllActions(){he.actionsDisabled=!0}static enableAllActions(){he.actionsDisabled=!1}static isContextActionEvent(e){return Array.isArray(e.contextActions)}static compareActions(e,t){if(e.group!==t.group){var r,i;return((r=e.group)!==null&&r!==void 0?r:0)>((i=t.group)!==null&&i!==void 0?i:0)?1:-1}if(e.order!==t.order){var s,o;return((s=e.order)!==null&&s!==void 0?s:0)>((o=t.order)!==null&&o!==void 0?o: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(he.compareActions),t}static isMacPlatform(){var{platform:e}=window.navigator;return e.startsWith("Mac")}static getModifierKey(){return he.isMacPlatform()?"metaKey":"ctrlKey"}static isModifierKeyDown(e){var t=he.getModifierKey();return e[t]}static getMenuItems(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,r=[],i=e;Array.isArray(i)||(i=[i]);for(var s=0;s<i.length;s+=1){var o=i[s],a=void 0;typeof o=="function"?a=o():a=o,a!=null&&(a instanceof Promise?t&&r.push(a):Array.isArray(a)?r=r.concat(a):r.push(a))}return r=r.filter(l=>l.title!==void 0||l.then!=null||l.menuElement),r}static getNextMenuItem(e,t,r){var i=e;i<0&&t<0&&(i=r.length);for(var s=1;s<r.length+1;s+=1){var o=(i+t*s+r.length)%r.length,a=r[o];if(!(a instanceof Promise)&&a.disabled!==!0)return o}return e}}Jd(he,"actionsDisabled",!1);var Ii=R.module("GlobalContextAction");class tu 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:r}=this.props;r.title==null&&!r.menuElement||(t.contextActions==null&&(t.contextActions=[]),t.contextActions.push(r),Ii.debug("Received context menu event at global action! Menu items are now: ",t.contextActions))}handleKeyDown(e){var{action:t}=this.props;if(!he.actionsDisabled&&t.shortcut!==void 0&&t.shortcut.matchesEvent(e)){var r;Ii.debug("Global hotkey matched!",e),(r=t.action)===null||r===void 0||r.call(t,e),e.preventDefault(),e.stopPropagation()}}render(){return null}}class nu extends c.Component{render(){for(var{actions:e,"data-testid":t}=this.props,r=[],i=0;i<e.length;i+=1){var s=e[i],{shortcut:o}=s;if(s.title!=null||s.menuElement||o){var a=u.jsx(tu,{action:s,"data-testid":t},"".concat(s.title,".").concat(o==null?void 0:o.id));r.push(a)}}return r}}function js(n,e,t){return(e=ru(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function ru(n){var e=iu(n,"string");return typeof e=="symbol"?e:e+""}function iu(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var jn=R.module("ContextActions");class re extends c.Component{static triggerMenu(e,t,r,i){if(i.length!==0){var s=new MouseEvent("contextmenu",{clientX:t,clientY:r,bubbles:!0,cancelable:!0});s.contextActions=i,e.dispatchEvent(s)}}constructor(e){super(e),js(this,"container",void 0),this.handleContextMenu=this.handleContextMenu.bind(this),this.handleKeyDown=this.handleKeyDown.bind(this),this.container=O.createRef(),this.state={globalActions:[],keyboardActions:[]}}static getDerivedStateFromProps(e){if(e.actions==null||!Array.isArray(e.actions))return{globalActions:[],keyboardActions:[]};var t=e.actions.filter(i=>!br(i)&&typeof i!="function"&&i.isGlobal),r=e.actions.filter(i=>!br(i)&&typeof i!="function"&&(i.isGlobal===void 0||!i.isGlobal)&&i.shortcut!=null);return{globalActions:t,keyboardActions:r}}componentDidMount(){var e;(e=this.container.current)!==null&&e!==void 0&&e.parentElement&&(this.container.current.parentElement.addEventListener("contextmenu",this.handleContextMenu),this.container.current.parentElement.addEventListener("keydown",this.handleKeyDown))}componentWillUnmount(){var e;(e=this.container.current)!==null&&e!==void 0&&e.parentElement&&(this.container.current.parentElement.removeEventListener("contextmenu",this.handleContextMenu),this.container.current.parentElement.removeEventListener("keydown",this.handleKeyDown))}handleContextMenu(e){var{ignoreClassNames:t=[]}=this.props;if(t.length>0){for(var r=e.target,i=function(){var{classList:d}=r,h=t.find(p=>d.contains(p));if(h!==void 0)return jn.debug2('Contextmenu event ignored based on the target className "'.concat(h,'"')),{v:void 0};r=r.parentElement},s;r!=null;)if(s=i(),s)return s.v}if(he.isContextActionEvent(e)||(e.contextActions=[]),!!he.isContextActionEvent(e)){var{actions:o}=this.props;if(o!=null){var a=o;Array.isArray(a)&&(a=a.filter(l=>br(l)||typeof l=="function"||l.isGlobal===void 0||!l.isGlobal)),e.contextActions=e.contextActions.concat(a)}jn.debug("Received context menu event! Menu items are now: ",e.contextActions)}}handleKeyDown(e){for(var{keyboardActions:t}=this.state,r=0;r<t.length;r+=1){var i=t[r];if(!he.actionsDisabled&&i.shortcut!=null&&i.shortcut.matchesEvent(e)){var s;jn.debug("Context hotkey matched!",e),(s=i.action)===null||s===void 0||s.call(i,e),e.stopPropagation(),e.preventDefault(),jn.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(nu,{actions:t})})}}js(re,"groups",{default:void 0,high:100,medium:5e3,low:1e4,global:1e5,edit:100});var Ns=O.forwardRef((n,e)=>{var t,r,{closeMenu:i,children:s,menuItem:o,onMenuItemClick:a,onMenuItemMouseMove:l,onMenuItemContextMenu:d,isKeyboardSelected:h=!1,isMouseSelected:p=!1,"data-testid":m}=n,v=c.useCallback(W=>{a(o,W)},[o,a]),f=c.useCallback(W=>{l(o,W)},[o,l]),g=c.useCallback(W=>{d(o,W)},[o,d]);function b(W,k,z){if(typeof W.type=="string")return W;var F={menuItem:o,closeMenu:i,isKeyboardSelected:h,isMouseSelected:p,iconElement:k,displayShortcut:z,"data-testid":m};return O.cloneElement(W,{forwardedProps:F})}var S=(t=o.shortcutText)!==null&&t!==void 0?t:(r=o.shortcut)===null||r===void 0?void 0:r.getDisplayText(),w=null;if(o.icon){var y=o.icon;if(O.isValidElement(y))w=y;else{var D;o.iconColor!=null&&(o.disabled===void 0||!o.disabled)&&(D={color:o.iconColor}),w=u.jsx(le,{icon:y,style:D})}}var V=null,X=!!s;o.actions&&(V=u.jsx(le,{icon:sl}));var G=null;if(o.menuElement)G=u.jsx("div",{className:"custom-menu-item",onMouseMove:f,children:b(o.menuElement,w,S)});else{var A,M=o.disabled,J=o.iconOutline;G=u.jsx("button",{type:"button",className:$("btn-context-menu",{disabled:M},{active:(X||p)&&(M===void 0||!M)},{"keyboard-active":h&&(M===void 0||!M)}),onClick:v,onMouseMove:f,onContextMenu:g,title:(A=o.description)!==null&&A!==void 0?A:"",children:u.jsxs("div",{className:"btn-context-menu-wrapper",children:[u.jsx("span",{className:$("icon",{outline:J}),children:w}),u.jsx("span",{className:"title",children:o.title}),S!==void 0&&u.jsx("span",{className:"shortcut",children:S}),V&&u.jsx("span",{className:$("submenu-indicator",{disabled:M}),children:V})]})})}return u.jsxs("div",{className:"context-menu-item",ref:e,"data-testid":m,children:[s,G]})});Ns.displayName="ContextMenuItem";var As=O.forwardRef((n,e)=>{var{checked:t=!1,children:r,className:i,disabled:s=!1,inputClassName:o,isInvalid:a=!1,labelClassName:l,name:d,onChange:h,"data-testid":p}=n,[m]=c.useState(ct()),v=Ds(e);c.useEffect(function(){v.current&&(v.current.indeterminate=t===null)},[v,t]);var f=c.useCallback(g=>{v.current&&(v.current.indeterminate=t===null),h&&h(g)},[v,t,h]);return u.jsxs("div",{className:$("custom-control custom-checkbox",i),children:[u.jsx("input",{type:"checkbox",ref:v,checked:t??!1,className:$("custom-control-input",o,{"is-invalid":a}),disabled:s,id:m,name:d,onChange:f,"data-testid":p}),u.jsx("label",{className:$("custom-control-label",l),htmlFor:m,children:r})]})});As.displayName="Checkbox";function qn(n){return(n==null?void 0:n.WrappedComponent)!==void 0}function Ls(n){return qn(n)&&Ls(n.WrappedComponent)?!0:n.prototype!=null&&n.prototype.isReactComponent!=null}function ou(n){return!qn(n)&&"$$typeof"in n&&n.$$typeof===Ll.ForwardRef}function Rs(n){return Ls(n)||ou(n)}function Di(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function su(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Di(Object(t),!0).forEach(function(r){yn(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Di(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function yn(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 r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class Fs extends c.PureComponent{constructor(e){var t;super(e),yn(this,"container",void 0),yn(this,"oldFocus",void 0),yn(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=O.createRef(),this.oldFocus=document.activeElement,this.rAF=0;var{options:r}=e,i=(t=r.initialKeyboardIndex)!==null&&t!==void 0?t:-1;this.state={menuItems:[],keyboardIndex:i,mouseIndex:-1}}componentDidMount(){this.initMenu(),this.rAF=window.requestAnimationFrame(()=>{var e;(e=this.container.current)===null||e===void 0||e.focus();var{onMenuOpened:t}=this.props;t(this)})}componentDidUpdate(e){var{actions:t}=this.props;e.actions!==t&&this.initMenu()}componentWillUnmount(){cancelAnimationFrame(this.rAF)}getKeyboardIndex(){var{options:e}=this.props;if(e.separateKeyboardMouse!==void 0&&e.separateKeyboardMouse){var{keyboardIndex:t}=this.state;return t}return this.getMouseIndex()}setKeyboardIndex(e){var{options:t}=this.props;t.separateKeyboardMouse!==void 0&&t.separateKeyboardMouse?this.setState({keyboardIndex:e}):this.setMouseIndex(e)}getMouseIndex(){var{mouseIndex:e}=this.state;return e}setMouseIndex(e){this.setState({mouseIndex:e})}initMenu(){cancelAnimationFrame(this.rAF),this.setState({menuItems:[]});var{actions:e}=this.props,t=he.getMenuItems(e,!1);t.length>0&&this.setState(r=>({menuItems:he.sortActions(r.menuItems.concat(t))}))}handleKeyDown(e){var{menuItems:t}=this.state,r=this.getKeyboardIndex(),i=r;if(e.key==="Enter"||e.key===" "){r!=null&&r>=0&&r<t.length&&this.handleMenuItemClick(t[r],e);return}e.key==="Escape"?i=null:e.key==="ArrowUp"||e.key==="Tab"&&e.shiftKey===!0?i=he.getNextMenuItem(i??0,-1,t):(e.key==="ArrowDown"||e.key==="Tab"&&e.shiftKey===!1)&&(i=he.getNextMenuItem(i??0,1,t)),r!==i&&(i!==null?this.setKeyboardIndex(i):(this.closeMenu(),this.oldFocus instanceof HTMLElement&&this.oldFocus.focus()),e.preventDefault(),e.stopPropagation())}closeMenu(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,{closeMenu:t,onMenuClosed:r}=this.props;cancelAnimationFrame(this.rAF),this.rAF=window.requestAnimationFrame(()=>{t(e),r(this)})}handleCloseMenu(){this.closeMenu()}handleMenuItemClick(e,t){t.preventDefault(),t.stopPropagation(),e!=null&&(e.disabled===void 0||!e.disabled)&&e.action!=null&&(e.action(t.nativeEvent),this.closeMenu(!0))}handleMenuItemMouseMove(e){var{menuItems:t}=this.state,r=t.indexOf(e);this.setMouseIndex(r)}handleMouseLeave(){this.setMouseIndex(-1)}render(){for(var e=[],{"data-testid":t}=this.props,{keyboardIndex:r,menuItems:i,mouseIndex:s}=this.state,o=0;o<i.length;o+=1){var a=i[o];o>0&&a.group!==i[o-1].group&&e.push(u.jsx("hr",{},"".concat(o,".separator")));var l=u.jsx(Ns,{isKeyboardSelected:r===o,isMouseSelected:s===o,menuItem:a,closeMenu:this.handleCloseMenu,onMenuItemClick:this.handleMenuItemClick,onMenuItemMouseMove:this.handleMenuItemMouseMove,onMenuItemContextMenu:()=>!1},o);e.push(l)}var{menuStyle:d}=this.props;return u.jsx("div",{className:"context-menu-container",style:su({},d),ref:this.container,onKeyDown:this.handleKeyDown,onMouseLeave:this.handleMouseLeave,role:"menuitem",tabIndex:0,"data-testid":t,children:e})}}yn(Fs,"defaultProps",{closeMenu(){},onMenuOpened(){},onMenuClosed(){},options:{},menuStyle:{},"data-testid":void 0});function Mi(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function ki(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Mi(Object(t),!0).forEach(function(r){Zt(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Mi(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function Zt(n,e,t){return(e=du(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function du(n){var e=uu(n,"string");return typeof e=="symbol"?e:e+""}function uu(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class or extends c.PureComponent{constructor(e){super(e),Zt(this,"container",void 0),Zt(this,"parent",void 0),Zt(this,"popper",void 0),Zt(this,"isOpen",void 0),this.handleClick=this.handleClick.bind(this),this.handleCloseMenu=this.handleCloseMenu.bind(this),this.handleExited=this.handleExited.bind(this),this.container=O.createRef(),this.parent=null,this.popper=O.createRef(),this.isOpen=!1}componentDidMount(){var{isShown:e}=this.props;if(e===null){var t;(t=this.container.current)!==null&&t!==void 0&&t.parentElement&&(this.parent=this.container.current.parentElement,this.parent.addEventListener("click",this.handleClick))}else e&&this.openMenu()}componentDidUpdate(e){var{isShown:t}=this.props;e.isShown!==t&&(t!==null&&t?window.requestAnimationFrame(()=>{this.openMenu()}):this.closeMenu())}componentWillUnmount(){this.parent&&this.parent.removeEventListener("click",this.handleClick)}closeMenu(){var e;(e=this.popper.current)===null||e===void 0||e.hide()}openMenu(){this.popper.current&&!this.isOpen&&(this.popper.current.show(),this.isOpen=!0)}scheduleUpdate(){var e;(e=this.popper.current)===null||e===void 0||e.scheduleUpdate()}handleClick(e){e.preventDefault(),e.stopPropagation(),this.openMenu()}handleCloseMenu(){this.closeMenu()}handleExited(){this.isOpen=!1;var{onMenuClosed:e}=this.props;e()}render(){var{actions:e,onMenuOpened:t,popperClassName:r,"data-testid":i}=this.props,{menuStyle:s}=this.props,{options:o,popperOptions:a}=this.props;return a=ki({placement:"bottom"},a),o=ki({separateKeyboardMouse:!0},o),u.jsx("div",{className:"menu-actions-listener",ref:this.container,"data-testid":i,children:u.jsx(ir,{ref:this.popper,options:a,className:$("menu-popper",r),onExited:this.handleExited,closeOnBlur:!0,interactive:!0,children:u.jsx(Fs,{actions:e,closeMenu:this.handleCloseMenu,onMenuOpened:t,options:o,menuStyle:s})})})}}Zt(or,"defaultProps",{isShown:null,onMenuClosed(){},onMenuOpened(){},options:{},popperOptions:{},popperClassName:"",menuStyle:{},"data-testid":void 0});function St(n,e,t){return(e=hu(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function hu(n){var e=cu(n,"string");return typeof e=="symbol"?e:e+""}function cu(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var ji=R.module("Shortcut"),_=function(n){return n.CTRL="MODIFIER_CTRL",n.CMD="MODIFIER_CMD",n.ALT="MODIFIER_ALT",n.OPTION="MODIFIER_OPTION",n.SHIFT="MODIFIER_SHIFT",n}({}),C=function(n){return 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",n}({}),mu=new Set([C.ENTER,C.DELETE,C.F1,C.F2,C.F3,C.F4,C.F5,C.F6,C.F7,C.F8,C.F9,C.F10,C.F11,C.F12]);class de extends ys{static isAllowedKey(e){return Object.values(C).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 r=!e.altKey&&!e.ctrlKey&&!e.metaKey&&!e.shiftKey;return!r||mu.has(t)}static createKeyState(e){var t={altKey:!1,ctrlKey:!1,metaKey:!1,shiftKey:!1,keyValue:e[e.length-1]};return e.forEach(r=>{switch(r){case _.CTRL:t.ctrlKey=!0;break;case _.ALT:case _.OPTION:t.altKey=!0;break;case _.CMD:t.metaKey=!0;break;case _.SHIFT:t.shiftKey=!0;break}}),t}static getKeyStateFromEvent(e){var{key:t,keyCode:r}=e,i="";return t==="Shift"||t==="Meta"||t==="Control"||t==="Alt"?i="":!de.isAllowedKey(t)&&de.isAllowedKey(String.fromCharCode(r))?i=String.fromCharCode(r):i=t,{keyValue:i,altKey:e.altKey,ctrlKey:e.ctrlKey,metaKey:e.metaKey,shiftKey:e.shiftKey}}static getWindowsDisplayText(e){var t="";return e.ctrlKey&&(t+="Ctrl+"),e.altKey&&(t+="Alt+"),e.shiftKey&&(t+="Shift+"),e.keyValue===C.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 C.ENTER:t+="⏎";break;case C.ESCAPE:t+="⎋";break;case C.BACKSPACE:t+="⌫";break;case C.DELETE:t+="⌦";break;case null:break;default:t+=e.keyValue}return t}static doKeyStatesMatch(e,t){var r,i;return((r=e.keyValue)===null||r===void 0?void 0:r.toUpperCase())===((i=t.keyValue)===null||i===void 0?void 0:i.toUpperCase())&&e.altKey===t.altKey&&e.ctrlKey===t.ctrlKey&&e.metaKey===t.metaKey&&e.shiftKey===t.shiftKey}static getDisplayText(e){return e.keyValue===null?"":de.isMacPlatform?de.getMacDisplayText(e):de.getWindowsDisplayText(e)}constructor(e){var{id:t,shortcut:r,macShortcut:i,isEditable:s=!0,name:o,tooltip:a}=e;super(),St(this,"id",void 0),St(this,"name",void 0),St(this,"tooltip",void 0),St(this,"isEditable",void 0),St(this,"defaultKeyState",void 0),St(this,"keyState",void 0),this.id=t,this.name=o,this.tooltip=a,this.isEditable=s;var l=de.isMacPlatform,d=l?i:r;this.defaultKeyState=de.createKeyState(d),this.keyState=this.defaultKeyState}getDisplayText(){return de.getDisplayText(this.keyState)}getKeyState(){return this.keyState}setKeyState(e){de.isValidKeyState(e)?(ji.debug2("Shortcut ".concat(this.id," updated to ").concat(JSON.stringify(e))),this.keyState=e,this.dispatchEvent(new Os("onUpdate",{detail:this}))):ji.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))}}St(de,"NULL_KEY_STATE",{metaKey:!1,shiftKey:!1,altKey:!1,ctrlKey:!1,keyValue:null});St(de,"isMacPlatform",he.isMacPlatform());function Ni(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=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 r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var Ai=R.module("ShortcutRegistry");class fu extends ys{constructor(){super(...arguments),Ni(this,"shortcutMap",new Map),Ni(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 Ai.warn("Skipping attempt to add duplicate shortcut ID to registry: ".concat(e.id)),t;Ai.debug2("Adding shortcut to registry: ".concat(e.id)),e.addEventListener("onUpdate",s=>{var{detail:o}=s;return this.dispatchEvent(new Os("onUpdate",{detail:o}))});var r=e.id.split(".")[0];if(this.shortcutMap.set(e.id,e),this.shortcutsByCategory.has(r)){var i;(i=this.shortcutsByCategory.get(r))===null||i===void 0||i.push(e)}else this.shortcutsByCategory.set(r,[e]);return e}get(e){return this.shortcutMap.get(e)}getConflictingShortcuts(e){return Array.from(this.shortcutMap.values()).filter(t=>!t.isNull()&&t.matchesKeyState(e))}}var ee=Object.freeze(new fu),Yt={COPY:ee.createAndAdd({id:"GLOBAL.COPY",name:"Copy",shortcut:[_.CTRL,C.C],macShortcut:[_.CMD,C.C],isEditable:!1}),PASTE:ee.createAndAdd({id:"GLOBAL.PASTE",name:"Paste",shortcut:[_.CTRL,C.V],macShortcut:[_.CMD,C.V],isEditable:!1}),SAVE:ee.createAndAdd({id:"GLOBAL.SAVE",name:"Save",shortcut:[_.CTRL,C.S],macShortcut:[_.CMD,C.S],isEditable:!1}),SELECT_ALL:ee.createAndAdd({id:"GLOBAL.SELECT_ALL",name:"Select All",shortcut:[_.CTRL,C.A],macShortcut:[_.CMD,C.A],isEditable:!1}),REOPEN_CLOSED_PANEL:ee.createAndAdd({id:"GLOBAL.REOPEN_CLOSED_PANEL",name:"Re-open Closed Panel",shortcut:[_.ALT,_.SHIFT,C.T],macShortcut:[_.OPTION,_.SHIFT,C.T],isEditable:!0}),LINKER:ee.createAndAdd({id:"GLOBAL.LINKER",name:"Linker",shortcut:[_.CTRL,C.L],macShortcut:[_.CMD,C.L]}),LINKER_CLOSE:ee.createAndAdd({id:"GLOBAL.LINKER_CLOSE",name:"Close Linker Overlay",shortcut:[C.ESCAPE],macShortcut:[C.ESCAPE],isEditable:!1}),COPY_VERSION_INFO:ee.createAndAdd({id:"GLOBAL.COPY_VERSION_INFO",name:"Copy Version Info",shortcut:[_.CTRL,_.ALT,C.I],macShortcut:[_.CMD,_.SHIFT,C.I],isEditable:!0}),EXPORT_LOGS:ee.createAndAdd({id:"GLOBAL.EXPORT_LOGS",name:"Export Logs",shortcut:[_.CTRL,_.ALT,_.SHIFT,C.L],macShortcut:[_.CMD,_.OPTION,_.SHIFT,C.L],isEditable:!0}),OPEN_DASHBOARD_LIST:ee.createAndAdd({id:"GLOBAL.OPEN_DASHBOARD_LIST",name:"Open Dashboard List",shortcut:[_.CTRL,_.SHIFT,C.D],macShortcut:[_.CMD,_.SHIFT,C.D],isEditable:!0}),NEXT:ee.createAndAdd({id:"GLOBAL.NEXT",name:"Next",shortcut:[C.ENTER],macShortcut:[C.ENTER],isEditable:!1}),PREVIOUS:ee.createAndAdd({id:"GLOBAL.PREVIOUS",name:"Previous",shortcut:[_.SHIFT,C.ENTER],macShortcut:[_.SHIFT,C.ENTER],isEditable:!1}),UNDO:ee.createAndAdd({id:"GLOBAL.UNDO",name:"Undo",shortcut:[_.CTRL,C.Z],macShortcut:[_.CMD,C.Z],isEditable:!1}),REDO:ee.createAndAdd({id:"GLOBAL.REDO",name:"Redo",shortcut:[_.CTRL,_.SHIFT,C.Z],macShortcut:[_.CMD,_.SHIFT,C.Z],isEditable:!1})};function Ar(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 r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class sr extends c.PureComponent{constructor(e){super(e),Ar(this,"inputField",void 0),Ar(this,"searchChangeSelection",void 0),this.inputField=O.createRef(),this.searchChangeSelection=O.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 r=t.getBoundingClientRect().width;e.style.paddingRight="".concat(r,"px")}}render(){var{value:e,placeholder:t,endPlaceholder:r,onBlur:i,onChange:s,className:o,disabled:a,matchCount:l,id:d,onKeyDown:h,"data-testid":p,cursor:m}=this.props,v,f=[{action:()=>m==null?void 0:m.next("forward"),shortcut:Yt.NEXT},{action:()=>m==null?void 0:m.next("back"),shortcut:Yt.PREVIOUS}];return m&&l>1?v=u.jsxs(u.Fragment,{children:[u.jsx(te,{kind:"ghost",className:"search-change-button",type:"button",onClick:()=>{m.next("back")},icon:hs,tooltip:"Previous match (".concat(Yt.PREVIOUS.getDisplayText(),")")}),u.jsxs("span",{className:"search-change-text",children:[m.index!==void 0&&"".concat(m.index+1," of "),l]}),u.jsx(te,{kind:"ghost",className:"search-change-button",type:"button",onClick:()=>{m.next("forward")},icon:al,tooltip:"Next match (".concat(Yt.NEXT.getDisplayText(),")")})]}):v=l>0&&u.jsx("span",{className:"search-match",children:l}),u.jsxs("div",{className:$("search-group",o),children:[u.jsx("input",{type:"search",value:e,onBlur:i,onChange:s,onKeyDown:h,className:"form-control",disabled:a,placeholder:t,ref:this.inputField,id:d,"data-testid":p}),l!=null?u.jsxs(u.Fragment,{children:[u.jsx("div",{className:"search-change-selection",ref:this.searchChangeSelection,children:v}),u.jsx(re,{actions:f})]}):u.jsxs("span",{className:"search-end-content",children:[(r??"")!==""&&e===""&&u.jsx("span",{className:"search-end-placeholder",children:r}),u.jsx(le,{icon:ll})]})]})}}Ar(sr,"defaultProps",{placeholder:"Search",className:"",matchCount:null,onKeyDown(){},id:"","data-testid":void 0,cursor:void 0});function Hs(n,e,t){return(e=yu(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function yu(n){var e=Cu(n,"string");return typeof e=="symbol"?e:e+""}function Cu(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class $s extends c.PureComponent{constructor(e){super(e),Hs(this,"searchInput",void 0),this.searchInput=O.createRef(),this.handleChange=this.handleChange.bind(this),this.sendUpdate=En(this.sendUpdate.bind(this),e.debounceMs),this.state={value:e.value}}componentDidUpdate(e){var{value:t}=this.props;e.value!==t&&this.setState({value:t})}focus(){var e;(e=this.searchInput.current)===null||e===void 0||e.focus()}handleChange(e){this.setState({value:e.target.value},this.sendUpdate)}sendUpdate(){var{onChange:e}=this.props,{value:t}=this.state;e(t)}render(){var{placeholder:e,className:t,matchCount:r,id:i,"data-testid":s}=this.props,{value:o}=this.state;return u.jsx(sr,{value:o,placeholder:e,onChange:this.handleChange,className:t,matchCount:r,ref:this.searchInput,id:i,"data-testid":s})}}Hs($s,"defaultProps",{placeholder:"Search",className:"",matchCount:null,debounceMs:250,id:"","data-testid":void 0});function Us(n,e,t){return(e=wu(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function wu(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 r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var _u=R.module("ItemListItem");class ar extends c.Component{static handleKeyDown(){return _u.log("ItemListItem.handleKeyDown false"),!1}constructor(e){super(e),Us(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=O.createRef()}handleBlur(e){var{itemIndex:t,onBlur:r}=this.props;r(t,e)}handleFocus(e){var{itemIndex:t,onFocus:r}=this.props;r(t,e)}handleClick(e){var{itemIndex:t,onClick:r}=this.props;r(t,e)}handleContextMenu(e){var{itemIndex:t,onContextMenu:r}=this.props;r(t,e)}handleDragStart(e){var{itemIndex:t,onDragStart:r}=this.props;r(t,e)}handleDrag(e){var{itemIndex:t,onDrag:r}=this.props;r(t,e)}handleDragOver(e){e.preventDefault();var{itemIndex:t,onDragOver:r}=this.props;r(t,e)}handleDragEnd(e){var{itemIndex:t,onDragEnd:r}=this.props;r(t,e)}handleDrop(e){var{itemIndex:t,onDrop:r}=this.props;r(t,e)}handleDoubleClick(e){var{itemIndex:t,onDoubleClick:r}=this.props;r(t,e)}handleMouseMove(e){var{itemIndex:t,onMouseMove:r}=this.props;r(t,e)}handleMouseDown(e){var{itemIndex:t,onMouseDown:r}=this.props;r(t,e)}handleMouseUp(e){var{itemIndex:t,onMouseUp:r}=this.props;r(t,e)}render(){var{isDraggable:e,isFocused:t,isSelected:r,style:i,children:s,"data-testid":o}=this.props;return u.jsx("div",{className:$("item-list-item",{active:r},{"is-focused":t},{"is-draggable":e}),onKeyDown:ar.handleKeyDown,onContextMenuCapture:this.handleContextMenu,onClick:this.handleClick,onDrag:this.handleDrag,onDragStart:this.handleDragStart,onDragOver:this.handleDragOver,onDragEnd:this.handleDragEnd,onDrop:this.handleDrop,onDoubleClick:this.handleDoubleClick,onMouseDown:this.handleMouseDown,onMouseMove:this.handleMouseMove,onMouseUp:this.handleMouseUp,tabIndex:-1,ref:this.itemRef,role:"listitem",style:i,onFocus:this.handleFocus,onBlur:this.handleBlur,draggable:e,"data-testid":o,children:s})}}Us(ar,"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:{}});var zn;function Li(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function Ri(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Li(Object(t),!0).forEach(function(r){Ve(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Li(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function Ve(n,e,t){return(e=Eu(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Eu(n){var e=Pu(n,"string");return typeof e=="symbol"?e:e+""}function Pu(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var Fi=R.module("ItemList"),Hi=5;class Qe extends c.PureComponent{static renderItem(e){var t,r,{item:i}=e;return u.jsx("div",{className:"item-list-item-content",children:i!=null&&((t=(r=i.displayValue)!==null&&r!==void 0?r:i.value)!==null&&t!==void 0?t:"".concat(i))})}constructor(e){super(e),Ve(this,"list",void 0),Ve(this,"listContainer",void 0),Ve(this,"getItemSelected",qt((i,s)=>Ze.isSelected(s,i),{max:Qe.CACHE_SIZE})),Ve(this,"getCachedItem",qt((i,s,o,a,l,d,h,p)=>{var m=d({item:o,itemIndex:i,isFocused:a,isSelected:l,style:h});return u.jsx(ar,{onContextMenu:this.handleItemContextMenu,onDoubleClick:this.handleItemDoubleClick,onMouseDown:this.handleItemMouseDown,onFocus:this.handleItemFocus,onBlur:this.handleItemBlur,disableSelect:p,onMouseMove:this.handleItemMouseMove,onMouseUp:this.handleItemMouseUp,isFocused:a,isSelected:l,itemIndex:i,style:h,children:m},s)},{max:Qe.CACHE_SIZE})),Ve(this,"getOuterElement",qt(i=>{var s=O.forwardRef((o,a)=>u.jsx("div",Ri({ref:a,tabIndex:-1,onKeyDown:i,role:"presentation"},o)));return s.displayName="ItemListOuterElement",s},{max:1e3})),Ve(this,"getInnerElement",qt(()=>{var i=O.forwardRef((s,o)=>u.jsx("div",Ri({className:"item-list-inner-element",ref:o},s)));return i.displayName="ItemListInnerElement",i},{max:1e3})),Ve(this,"getItemData",qt((i,s,o)=>({items:i,selectedRanges:s,renderItem:o}),{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=O.createRef(),this.listContainer=O.createRef();var{isStickyBottom:t,selectedRanges:r}=e;this.state={focusIndex:null,mouseDownIndex:null,selectedRanges:r,overscanStartIndex:0,height:null,isDragging:!1,isStuckToBottom:t,scrollOffset:null,mouseX:null,mouseY:null}}componentDidUpdate(e,t){var{selectedRanges:r,itemCount:i}=this.props,{focusIndex:s,isStuckToBottom:o,scrollOffset:a,height:l,selectedRanges:d}=this.state;if(o&&!this.isListAtBottom()&&i>0&&this.scrollToBottom(),(a!==t.scrollOffset||l!==t.height)&&this.sendViewportUpdate(),r!==e.selectedRanges&&r!==d)this.setSelectedRanges(r);else if(d!==t.selectedRanges){var{onSelectionChange:h}=this.props;h(d)}if(s!==t.focusIndex){var{onFocusChange:p}=this.props;p(s)}}componentWillUnmount(){window.removeEventListener("mouseup",this.handleWindowMouseUp)}focus(){var e;(e=this.listContainer.current)===null||e===void 0||e.focus()}restoreScrollPosition(){var{scrollOffset:e}=this.state;if(e!=null){var t;(t=this.listContainer.current)===null||t===void 0||t.scrollTo(0,e)}}getElement(e){if(this.listContainer.current==null)return null;var{focusSelector:t}=this.props,{overscanStartIndex:r}=this.state,i=this.listContainer.current.querySelectorAll(t),s=e-r;return i[s]}focusItem(e){var{disableSelect:t}=this.props;if(!t){this.setState({focusIndex:e});var r=this.getElement(e);r instanceof HTMLElement&&r.focus()}}scrollToItem(e){var t=this.getElement(e);t!=null&&t.scrollIntoView({block:"center"})}handleItemContextMenu(e,t){this.setState({focusIndex:e});var{selectedRanges:r}=this.state,i=Ze.isSelected(r,e),s=i||he.isModifierKeyDown(t);this.toggleSelect(e,t.shiftKey,s,!1)}handleItemDoubleClick(e,t){var{isDoubleClickSelect:r,onSelect:i}=this.props;r&&this.setState(s=>{var{selectedRanges:o}=s;return{selectedRanges:Ze.selectRange(o,[e,e])}},()=>{i(e,t)})}handleItemMouseDown(e,t){var{selectedRanges:r}=this.state;if(!(t.target instanceof HTMLElement&&["button","select","input","textarea"].indexOf(t.target.tagName.toLowerCase())!==-1)){if(t.button===2&&r.length===0){this.focusItem(e),this.selectItem(e);return}t.button!=null&&t.button!==0||(this.setState({mouseDownIndex:e,mouseX:t.clientX,mouseY:t.clientY}),window.addEventListener("mouseup",this.handleWindowMouseUp))}}handleItemBlur(e,t){Fi.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){Fi.debug2("item focus",e,t.target),this.setState(r=>{var{focusIndex:i}=r;return i!==e?{focusIndex:e}:null})}handleItemMouseMove(e,t){var{isDragSelect:r,isMultiSelect:i,disableSelect:s}=this.props,{mouseDownIndex:o,selectedRanges:a,mouseX:l,mouseY:d}=this.state;if(!(o==null||s)){var h=Math.abs(t.clientX-(l??0)),p=Math.abs(t.clientY-(d??0));h>Hi&&p>Hi&&this.setState({isDragging:!0}),(r||o===e)&&(this.focusItem(e),i?(!r&&!this.getItemSelected(e,a)&&!he.isModifierKeyDown(t)&&this.deselectAll(),this.selectRange([Math.min(o,e),Math.max(o,e)])):this.toggleSelect(e,t.shiftKey,he.isModifierKeyDown(t),!1))}}handleItemMouseUp(e,t){var{isDeselectOnClick:r,isDoubleClickSelect:i,onSelect:s}=this.props,{mouseDownIndex:o,isDragging:a}=this.state;if(!(t.target instanceof HTMLElement&&["button","select","input","textarea"].indexOf(t.target.tagName.toLowerCase())!==-1)){if(o===e&&!a){var l=t.shiftKey,d=he.isModifierKeyDown(t);this.focusItem(e),this.toggleSelect(e,l,d,r),!i&&!l&&!d&&s(e,t)}this.resetMouseState()}}handleItemsRendered(e){var{overscanStartIndex:t}=e;this.setState({overscanStartIndex:t})}handleResize(e){var{height:t}=e;this.setState({height:t})}handleMouseLeave(){this.setState({mouseDownIndex:null})}handleWindowMouseUp(){this.resetMouseState(),window.removeEventListener("mouseup",this.handleWindowMouseUp)}handleKeyDown(e){var{isMultiSelect:t,itemCount:r,onSelect:i}=this.props,{focusIndex:s}=this.state,o=s;if(e.key==="Enter"||e.key===" "){!t&&o!=null&&this.setState({selectedRanges:[[o,o]]},()=>{o!=null&&i(o,e)});return}if(e.key==="ArrowUp")o!=null&&o>=0?o=Math.max(0,o-1):o=r-1;else if(e.key==="ArrowDown")o!=null&&o>=0?o=Math.min(o+1,r-1):o=0;else return;if(s!==o){e.stopPropagation(),e.preventDefault(),this.focusItem(o);var{selectedRanges:a}=this.state;if(e.shiftKey&&a.length>0){var l=a[a.length-1];this.selectRange([Math.min(o,l[0]),Math.max(o,l[1])])}else if(this.deselectAll(),o!==null)this.selectItem(o);else{var d;(d=this.listContainer.current)===null||d===void 0||d.focus()}this.scrollIntoView(o)}}handleScroll(e){var{scrollUpdateWasRequested:t,scrollOffset:r}=e;this.setState(i=>{if(t)return{scrollOffset:r};var{isStickyBottom:s}=this.props,{height:o}=i,a=s&&this.isListAtBottom({scrollOffset:r,height:o});return{isStuckToBottom:a,scrollOffset:r}})}resetMouseState(){this.setState({mouseDownIndex:null,isDragging:!1})}scrollToBottom(){var{itemCount:e}=this.props;this.list.current&&this.list.current.scrollToItem(e)}scrollIntoView(e){this.list.current&&this.list.current.scrollToItem(e)}toggleSelect(e,t,r){var i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,{isMultiSelect:s}=this.props,{selectedRanges:o}=this.state;if(s&&t&&o.length>0){var a=o[o.length-1];this.selectRange([Math.min(a[0],e),Math.max(e,a[1])])}else s&&o.length===1&&o[0][0]===e&&o[0][1]===e?i&&this.deselectItem(e):s&&r?this.getItemSelected(e,o)?i&&this.deselectItem(e):this.selectItem(e):(this.deselectAll(),this.selectItem(e))}deselectAll(){var{itemCount:e}=this.props;this.deselectRange([0,e])}deselectItem(e){this.deselectRange([e,e])}deselectRange(e){Ze.validateRange(e),this.setState(t=>{var{selectedRanges:r}=t;return{selectedRanges:Ze.deselectRange(r,e)}})}selectItem(e){var{disableSelect:t}=this.props;t||this.selectRange([e,e])}selectRange(e){Ze.validateRange(e),this.setState(t=>{var{selectedRanges:r}=t;return{selectedRanges:Ze.selectRange(r,e)}})}setSelectedRanges(e){this.setState({selectedRanges:e})}sendViewportUpdate(){var{scrollOffset:e,height:t}=this.state;if(e!=null&&t!=null){var{onViewportChange:r,rowHeight:i}=this.props,s=Math.floor(e/i),o=s+Math.ceil(t/i);r(s,o)}}isListAtBottom(){var{scrollOffset:e,height:t}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.state;if(t==null||e==null)return!1;var{itemCount:r,rowHeight:i}=this.props;return e+t>=r*i}renderInnerElement(e){var{index:t,style:r}=e,{items:i,offset:s,renderItem:o,disableSelect:a}=this.props,{focusIndex:l,selectedRanges:d}=this.state;if(t<s||t>=s+i.length)return null;var h=i[t-s];return this.getCachedItem(t,t,h,t===l&&!a,this.getItemSelected(t,d),o,r,a)}render(){var{items:e,itemCount:t,overscanCount:r,renderItem:i,rowHeight:s,"data-testid":o}=this.props,{selectedRanges:a,isStuckToBottom:l}=this.state;return u.jsx(Rl,{className:"item-list-auto-sizer",onResize:this.handleResize,children:d=>{var{width:h,height:p}=d;return u.jsx(Fl,{className:"item-list-scroll-pane",height:p,width:h,initialScrollOffset:l?t*s:0,itemCount:t,itemSize:s,itemData:this.getItemData(e,a,i),onScroll:this.handleScroll,onItemsRendered:this.handleItemsRendered,ref:this.list,outerElementType:this.getOuterElement(this.handleKeyDown),outerRef:this.listContainer,innerElementType:this.getInnerElement(),overscanCount:r,"data-testid":o,children:this.renderInnerElement})}})}}zn=Qe;Ve(Qe,"CACHE_SIZE",1e3);Ve(Qe,"DEFAULT_ROW_HEIGHT",20);Ve(Qe,"DEFAULT_OVERSCAN",10);Ve(Qe,"defaultProps",{offset:0,items:[],rowHeight:zn.DEFAULT_ROW_HEIGHT,isDeselectOnClick:!0,isDoubleClickSelect:!1,isDragSelect:!0,isMultiSelect:!1,isStickyBottom:!1,disableSelect:!1,onFocusChange(){},onSelect(){},onSelectionChange(){},onViewportChange(){},overscanCount:zn.DEFAULT_OVERSCAN,renderItem:zn.renderItem,selectedRanges:[],focusSelector:".item-list-item","data-testid":void 0});var Tu=R.module("ErrorBoundary");class Ou extends c.Component{static getDerivedStateFromError(e){return{error:e}}constructor(e){super(e),this.state={error:void 0}}componentDidCatch(e,t){var{onError:r}=this.props;Tu.error("Error caught by ErrorBoundary",e,t),r==null||r(e,t)}render(){var{children:e,className:t,fallback:r}=this.props,{error:i}=this.state;return i!=null?r??u.jsx("div",{className:t,children:u.jsx(_n,{errorMessage:"".concat(i),isLoading:!1,isLoaded:!1,"data-testid":"error-boundary-loading"})}):e??null}}function xu(n){var{on:e,id:t,className:r,isInvalid:i,disabled:s=!1,onClick:o,"data-testid":a}=n;return u.jsx("button",{type:"button",className:$("btn","btn-switch",r,{active:e},{"is-invalid":i}),id:t,onClick:o,disabled:s,"data-testid":a,children:u.jsx("div",{className:"handle"})})}var Iu=["children","className","isInvalid","onChange","data-testid"];function $i(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function Ui(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?$i(Object(t),!0).forEach(function(r){Du(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):$i(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function Du(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=ku(n,"string");return typeof e=="symbol"?e:e+""}function ku(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function ju(n,e){if(n==null)return{};var t,r,i=Nu(n,e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(n);for(r=0;r<s.length;r++)t=s[r],e.indexOf(t)===-1&&{}.propertyIsEnumerable.call(n,t)&&(i[t]=n[t])}return i}function Nu(n,e){if(n==null)return{};var t={};for(var r in n)if({}.hasOwnProperty.call(n,r)){if(e.indexOf(r)!==-1)continue;t[r]=n[r]}return t}var Bs=O.forwardRef((n,e)=>{var{children:t,className:r,isInvalid:i,onChange:s,"data-testid":o}=n,a=ju(n,Iu),l=Ds(e),d=c.useCallback(h=>{s(h.target.value)},[s]);return u.jsx("select",Ui(Ui({ref:l,className:$("custom-select",r,{"is-invalid":i}),onChange:d,"data-testid":o},a),{},{children:t}))});Bs.displayName="Select";var Xr=O.createContext(new Map);Xr.displayName="XComponentMapContext";var Jf=Xr.Provider;function Au(n){var e,t=c.useContext(Xr);return(e=t.get(n))!==null&&e!==void 0?e:n.Original}function Bi(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function yr(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Bi(Object(t),!0).forEach(function(r){Lu(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Bi(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function Lu(n,e,t){return(e=Ru(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Ru(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 r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function Ks(n){var e,t;function r(i,s){var o=Au(t);return Rs(n)?u.jsx(o,yr(yr({},i),{},{ref:s})):u.jsx(o,yr({},i))}return r.displayName="XComponent(".concat((e=n.displayName)!==null&&e!==void 0?e:n.name,")"),t=c.forwardRef(r),t.Original=n,t.isXComponent=!0,t}function Hu(){return Tn(dl,"No API available in useApi. Was code wrapped in ApiBootstrap or ApiContext.Provider?")}function Ws(n){return typeof n=="object"&&n!=null&&typeof n.type=="string"&&n.name!=null}function zs(n){return typeof n=="object"&&n!=null&&typeof n.type=="string"&&n.id!=null}function Qf(n){return Ws(n)||zs(n)}var Vs=c.createContext(null);Vs.displayName="ObjectFetcherContext";function eg(n){if(zs(n))return{id:n.id,type:n.type};if(Ws(n)){var e;return{name:(e=n.name)!==null&&e!==void 0?e:"",type:n.type}}throw new Error("Invalid descriptor: ".concat(n))}function $u(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 tg(){return Tn(Vs,"No ObjectFetcher available in useObjectFetcher. Was code wrapped in ObjectFetcherContext.Provider?")}function Ki(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function Uu(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Ki(Object(t),!0).forEach(function(r){Bu(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Ki(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function Bu(n,e,t){return(e=Ku(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Ku(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 r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var zu=Object.freeze({}),Vu=new Map,ng=n=>n.api,rg=n=>n.user,Gs=n=>n.storage,qs=n=>Gs(n).commandHistoryStorage,Gu=n=>Gs(n).fileStorage,qu=n=>n.defaultWorkspaceSettings,Xs=n=>{var{workspace:e}=n;return e},Zr=Hl(n=>{for(var e,t,r=(e=(t=Xs(n))===null||t===void 0?void 0:t.data.settings)!==null&&e!==void 0?e:{},i=Uu({},qu(n)),s=Object.keys(r),o=0;o<s.length;o+=1){var a=s[o];r[a]!==void 0&&(i[a]=r[a])}return i}),Xu=n=>Zr(n).timeZone,ig=n=>{var e;return(e=Zr(n).notebookSettings)!==null&&e!==void 0?e:zu},og=n=>n.activeTool,Zu=n=>{var e;return(e=n.plugins)!==null&&e!==void 0?e:Vu},Yu="SET_ACTIVE_TOOL",Ju="SET_API",sg="SET_COMMAND_HISTORY_STORAGE",ag="SET_FILE_STORAGE",lg="SET_PLUGINS",Qu="SET_USER",eh="SET_WORKSPACE",th="SET_DEFAULT_WORKSPACE_SETTINGS",dg="SET_WORKSPACE_STORAGE",nh="SET_SERVER_CONFIG_VALUES";function Wi(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function dt(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Wi(Object(t),!0).forEach(function(r){rh(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Wi(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function rh(n,e,t){return(e=ih(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function ih(n){var e=oh(n,"string");return typeof e=="symbol"?e:e+""}function oh(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var ug=n=>({type:Qu,payload:n}),hg=n=>({type:Ju,payload:n}),Zs=n=>({type:eh,payload:n}),cg=n=>({type:th,payload:n}),sh=n=>(e,t)=>{e(Zs(n));var{storage:r}=t(),{workspaceStorage:i}=r;return i==null?void 0:i.save(n)},ah=n=>(e,t)=>{var{workspace:r}=t(),{data:i}=r??{},s=dt(dt({},r),{},{data:dt(dt(dt({},i),n),{},{settings:dt(dt({},i==null?void 0:i.settings),n.settings)})});return e(sh(s))},mg=n=>(e,t)=>{var{notebookSettings:r}=Zr(t()),i=dt(dt({},r),n);return e(lh({notebookSettings:i}))},lh=n=>e=>e(ah({settings:n})),pg=n=>({type:Yu,payload:n}),vg=n=>({type:nh,payload:n});function zi(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function Vi(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?zi(Object(t),!0).forEach(function(r){dh(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):zi(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function dh(n,e,t){return(e=uh(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function uh(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 r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function ch(n){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;return function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:e,i=arguments.length>1?arguments[1]:void 0;switch(i==null?void 0:i.type){case n:{var{id:s,payload:o}=i;return t&&Ir({payload:o},{payload:r[s]})?r:Vi(Vi({},r),{},{[s]:o})}default:return r}}}function Gi(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function qi(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Gi(Object(t),!0).forEach(function(r){Lr(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Gi(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function Lr(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=ph(n,"string");return typeof e=="symbol"?e:e+""}function ph(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class vh{constructor(){Lr(this,"reducers",{}),Lr(this,"listener",null)}register(e,t){var r;this.reducers=qi(qi({},this.reducers),{},{[e]:t}),(r=this.listener)===null||r===void 0||r.call(this,this.reducers)}setListener(e){this.listener=e}}var fh=new vh;function Yr(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 r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class Fe{static isValid(e,t){return!0}static isSameFormat(e,t){throw new Error("isSameFormat not implemented")}static makeFormat(e,t,r){return{label:e,formatString:t,type:r}}format(e,t){return""}}Yr(Fe,"TYPE_GLOBAL","type-global");Yr(Fe,"TYPE_CONTEXT_PRESET","type-context-preset");Yr(Fe,"TYPE_CONTEXT_CUSTOM","type-context-custom");function _t(n,e,t){return(e=yh(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function yh(n){var e=Ch(n,"string");return typeof e=="symbol"?e:e+""}function Ch(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var Xi=R.module("DateTimeColumnFormatter");class ht extends Fe{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 r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Fe.TYPE_CONTEXT_PRESET;return{label:e,formatString:t,type:r}}static isSameFormat(e,t){return e===t||e!==null&&t!==null&&e.type===t.type&&e.formatString===t.formatString}static makeGlobalFormatStringMap(e,t){var r=t?"'T'":" ",i=e?" z":"";return new Map([["yyyy-MM-dd HH:mm:ss","yyyy-MM-dd".concat(r,"HH:mm:ss").concat(i)],["yyyy-MM-dd HH:mm:ss.SSS","yyyy-MM-dd".concat(r,"HH:mm:ss.SSS").concat(i)],["yyyy-MM-dd HH:mm:ss.SSSSSSSSS","yyyy-MM-dd".concat(r,"HH:mm:ss.SSSSSSSSS").concat(i)]])}static getGlobalFormats(e,t){var r=ht.makeGlobalFormatStringMap(e,t);return[...r.keys()]}static makeFormatStringMap(e,t){var r=t!==void 0&&t?"'T'":" ",i=e!==void 0&&e?" z":"";return new Map([["yyyy-MM-dd","yyyy-MM-dd".concat(i)],["MM-dd-yyyy","MM-dd-yyyy".concat(i)],["HH:mm:ss","HH:mm:ss".concat(i)],["HH:mm:ss.SSS","HH:mm:ss.SSS".concat(i)],["HH:mm:ss.SSSSSSSSS","HH:mm:ss.SSSSSSSSS".concat(i)],["yyyy-MM-dd HH:mm:ss","yyyy-MM-dd".concat(r,"HH:mm:ss").concat(i)],["yyyy-MM-dd HH:mm:ss.SSS","yyyy-MM-dd".concat(r,"HH:mm:ss.SSS").concat(i)],["yyyy-MM-dd HH:mm:ss.SSSSSSSSS","yyyy-MM-dd".concat(r,"HH:mm:ss.SSSSSSSSS").concat(i)]])}static getFormats(e,t){var r=ht.makeFormatStringMap(e,t);return[...r.keys()]}constructor(e){var{timeZone:t="",showTimeZone:r=!0,showTSeparator:i=!1,defaultDateTimeFormatString:s=ht.DEFAULT_DATETIME_FORMAT_STRING}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};super(),_t(this,"dh",void 0),_t(this,"dhTimeZone",void 0),_t(this,"defaultDateTimeFormatString",void 0),_t(this,"showTimeZone",void 0),_t(this,"showTSeparator",void 0),_t(this,"formatStringMap",void 0);var o=t||ht.DEFAULT_TIME_ZONE_ID;try{this.dhTimeZone=e.i18n.TimeZone.getTimeZone(o)}catch{Xi.error("Unsupported time zone id",o),this.dhTimeZone=e.i18n.TimeZone.getTimeZone(ht.DEFAULT_TIME_ZONE_ID)}this.dh=e,this.defaultDateTimeFormatString=s,this.showTimeZone=r,this.showTSeparator=i,this.formatStringMap=ht.makeFormatStringMap(r,i)}getEffectiveFormatString(e){var t;return(t=this.formatStringMap.get(e))!==null&&t!==void 0?t:e}format(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=t.formatString!=null&&t.formatString!==""?t.formatString:this.defaultDateTimeFormatString,i=this.getEffectiveFormatString(r);try{return this.dh.i18n.DateTimeFormat.format(i,e,this.dhTimeZone)}catch{Xi.error("Invalid format arguments")}return""}}_t(ht,"DEFAULT_DATETIME_FORMAT_STRING","yyyy-MM-dd HH:mm:ss.SSS");_t(ht,"DEFAULT_TIME_ZONE_ID","America/New_York");var vt;function et(n,e,t){return(e=wh(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function wh(n){var e=Sh(n,"string");return typeof e=="symbol"?e:e+""}function Sh(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var _h=R.module("DecimalColumnFormatter");class ke extends Fe{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 r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Fe.TYPE_CONTEXT_PRESET,i=arguments.length>3?arguments[3]:void 0;return{label:e,type:r,formatString:t,multiplier:i}}static makePresetFormat(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",r=arguments.length>2?arguments[2]:void 0;return ke.makeFormat(e,t,Fe.TYPE_CONTEXT_PRESET,r)}static makeCustomFormat(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",t=arguments.length>1?arguments[1]:void 0;return ke.makeFormat("Custom Format",e,Fe.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=ke.DEFAULT_FORMAT_STRING}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};super(),et(this,"defaultFormatString",void 0),et(this,"dh",void 0),this.dh=e,this.defaultFormatString=t}format(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=t.formatString!=null&&t.formatString!==""?t.formatString:this.defaultFormatString,i=t.multiplier!=null&&t.multiplier!==0?e*t.multiplier:e;try{return this.dh.i18n.NumberFormat.format(r,i)}catch{_h.error("Invalid format arguments")}return""}}vt=ke;et(ke,"DEFAULT_FORMAT_STRING","###,##0.0000");et(ke,"FORMAT_PERCENT",vt.makePresetFormat("Percent","##0.00%"));et(ke,"FORMAT_BASIS_POINTS",vt.makePresetFormat("Basis Points","###,##0 bp",1e4));et(ke,"FORMAT_THOUSANDS",vt.makePresetFormat("Thousands","##0.000 k",.001));et(ke,"FORMAT_MILLIONS",vt.makePresetFormat("Millions","###,##0.000 mm",1e-6));et(ke,"FORMAT_SCIENTIFIC_NOTATION",vt.makePresetFormat("Scientific Notation","0.0000E0"));et(ke,"FORMAT_ROUND",vt.makePresetFormat("Round","###,##0"));et(ke,"FORMAT_ROUND_TWO_DECIMALS",vt.makePresetFormat("0.00","###,##0.00"));et(ke,"FORMAT_ROUND_FOUR_DECIMALS",vt.makePresetFormat("0.0000","###,##0.0000"));var lr;function nn(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=Ph(n,"string");return typeof e=="symbol"?e:e+""}function Ph(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var Th=R.module("IntegerColumnFormatter");class mt extends Fe{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 r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Fe.TYPE_CONTEXT_PRESET,i=arguments.length>3?arguments[3]:void 0;return{label:e,type:r,formatString:t,multiplier:i}}static makePresetFormat(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",r=arguments.length>2?arguments[2]:void 0;return mt.makeFormat(e,t,Fe.TYPE_CONTEXT_PRESET,r)}static makeCustomFormat(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",t=arguments.length>1?arguments[1]:void 0;return mt.makeFormat("Custom Format",e,Fe.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=mt.DEFAULT_FORMAT_STRING}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};super(),nn(this,"dh",void 0),nn(this,"defaultFormatString",void 0),this.dh=e,this.defaultFormatString=t}format(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=t.formatString!=null&&t.formatString!==""?t.formatString:this.defaultFormatString,i=t.multiplier!=null&&t.multiplier!==0?e*t.multiplier:e;try{return this.dh.i18n.NumberFormat.format(r,i)}catch{Th.error("Invalid format arguments")}return""}}lr=mt;nn(mt,"DEFAULT_FORMAT_STRING","###,##0");nn(mt,"FORMAT_THOUSANDS",lr.makePresetFormat("Thousands","##0.000 k",.001));nn(mt,"FORMAT_MILLIONS",lr.makePresetFormat("Millions","###,##0.000 mm",1e-6));nn(mt,"FORMAT_SCIENTIFIC_NOTATION",lr.makePresetFormat("Scientific Notation","0.0000E0"));function Bt(n,e,t){return(e=Oh(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Oh(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 r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class B{}Bt(B,"INTEGER","int");Bt(B,"LONG","long");Bt(B,"DOUBLE","double");Bt(B,"BOOLEAN","bool");Bt(B,"STRING","string");Bt(B,"DATE_TIME","datetime");Bt(B,"LOCAL_TIME","localtime");var Ys=c.createContext(null);Ys.displayName="PluginsContext";var un=Object.freeze({AUTH_PLUGIN:"AuthPlugin",DASHBOARD_PLUGIN:"DashboardPlugin",WIDGET_PLUGIN:"WidgetPlugin",TABLE_PLUGIN:"TablePlugin",THEME_PLUGIN:"ThemePlugin",ELEMENT_PLUGIN:"ElementPlugin"});function Ih(n){return"DashboardPlugin"in n}function Dh(n){return"AuthPlugin"in n}function Mh(n){return"TablePlugin"in n}function fg(n){return Ih(n)||Dh(n)||Mh(n)}function kh(n){return"type"in n&&n.type===un.DASHBOARD_PLUGIN}function Jr(n){return"type"in n&&n.type===un.WIDGET_PLUGIN}function jh(n){return"type"in n&&n.type===un.TABLE_PLUGIN}function Nh(n){return"type"in n&&n.type===un.AUTH_PLUGIN}function Js(n){return"type"in n&&n.type===un.THEME_PLUGIN}function Qs(n){return"type"in n&&n.type===un.ELEMENT_PLUGIN}function gg(n){return kh(n)||Nh(n)||jh(n)||Js(n)||Jr(n)||Qs(n)}var ea=R.module("@deephaven/plugin.PluginUtils");function Zi(n,e){return n==null||!Jr(n)?!1:[n.supportedTypes].flat().some(t=>t===e)}function Ah(n){var e=u.jsx(le,{icon:cs});if(!Jr(n))return e;var{icon:t}=n;return t==null?e:c.isValidElement(t)?t:u.jsx(le,{icon:t})}function bg(n){var e=[...n.entries()].filter(t=>Js(t[1]));return ea.debug("Getting theme data from plugins",e),e.map(t=>{var[r,i]=t,s=Array.isArray(i.themes)?i.themes:[i.themes];return s.map(o=>{var{name:a,baseTheme:l,styleContent:d}=o;return{baseThemeKey:"default-".concat(l??"dark"),themeKey:ul(r,a),name:a,styleContent:d}})}).flat()}function yg(n){var e=[...n.entries()].filter(t=>Qs(t[1])&&t[1].mapping!=null);return ea.debug("Getting element plugin mapping",e),new Map(e.flatMap(t=>{var[,r]=t;return Object.entries(r.mapping)}))}function Cg(){return Tn(Ys,"No Plugins available in usePlugins. This can happen when plugins have not finished loading or if code is not wrapped in PluginsContext.Provider.")}var ta=c.createContext(null);ta.displayName="PersistentStateContext";function wg(n){var{initialState:e,onChange:t,children:r}=n,[i,s]=O.useState(0),o=c.useRef({initial:e,initialStateMap:new Map,state:new Map,isTracking:!0}),a=c.useCallback((m,v)=>{o.current.isTracking&&o.current.state.set(m,v)},[]),l=c.useCallback(()=>{o.current.isTracking||(o.current.isTracking=!0,o.current.state=new Map,s(m=>m+1))},[]),d=c.useRef(o.current.initial[Symbol.iterator]()),h=c.useCallback(function(v){var f=o.current.initialStateMap.get(v);if(f)return f;var{value:g,done:b}=d.current.next(),S={value:g,done:b??!1};return o.current.initialStateMap.set(v,S),S},[]);c.useEffect(function(){o.current.isTracking&&(t([...o.current.state.values()]),o.current.isTracking=!1)},[i,t]);var p=c.useMemo(()=>({addState:a,scheduleStateUpdate:l,getInitialState:h,updateId:i}),[a,h,l,i]);return u.jsx(ta.Provider,{value:p,children:r})}const Lh="var(--dh-color-chart-colorway)",Rh="var(--dh-color-chart-grid)",Fh="var(--dh-color-chart-axis-line)",Hh="var(--dh-color-chart-axis-line-zero)",Yi={"paper-bgcolor":"var(--dh-color-chart-bg)","plot-bgcolor":"var(--dh-color-chart-plot-bg)","title-color":"var(--dh-color-chart-title)","legend-color":"var(--dh-color-chart-legend-fg)",colorway:Lh,gridcolor:Rh,linecolor:Fh,zerolinecolor:Hh,"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 Ji=R.module("ChartTheme");function $h(){var n,e=ms(Yi);return e.colorway=hl((n=e.colorway)!==null&&n!==void 0?n:"").map(t=>{var[r,i]=t;return cl.normalizeCssColor(e.colorway.substring(r,i+1))}).join(" "),Ji.debug2("Chart theme:",Yi),Ji.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 Qi(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function Uh(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Qi(Object(t),!0).forEach(function(r){Bh(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Qi(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function Bh(n,e,t){return(e=Kh(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Kh(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 r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var zh=c.lazy(()=>$l(()=>import("./Plot-D1YMDgMj.js"),__vite__mapDeps([0,1,2,3,4,5]),import.meta.url));function Vh(n){return u.jsx(c.Suspense,{fallback:u.jsx(_n,{"data-testid":"lazy-plot-loading"}),children:u.jsx(zh,Uh({},n))})}var Qr=c.createContext(null);Qr.displayName="ChartThemeContext";function Sg(n){var{children:e}=n,{activeThemes:t}=Ms(),r=c.useMemo($h,[t]);return u.jsx(Qr.Provider,{value:r,children:e})}function Gh(){return Tn(Qr,"No ChartThemeContext value found.")}var na=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 ra(n){return n.componentName!==void 0}function qh(n){return n.component!==void 0}var ia=Object.freeze({type:"default",isClosable:!0,isFocusOnShow:!0,reorderEnabled:!0,title:""});const Xh=Object.freeze(Object.defineProperty({__proto__:null,defaultConfig:na,isGLComponentConfig:ra,isReactComponentConfig:qh,itemDefaultConfig:ia},Symbol.toStringTag,{value:"Module"}));function Vn(n,e,t){return(e=Zh(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Zh(n){var e=Yh(n,"string");return typeof e=="symbol"?e:e+""}function Yh(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class Oe{constructor(){Vn(this,"_mSubscriptions",void 0),Vn(this,"off",this.unbind),Vn(this,"trigger",this.emit),this._mSubscriptions={},this._mSubscriptions[Oe.ALL_EVENT]=[]}on(e,t,r){if(typeof t!="function")throw new Error("Tried to listen to event "+e+" with non-function callback "+t);this._mSubscriptions[e]||(this._mSubscriptions[e]=[]),this._mSubscriptions[e].push({fn:t,ctx:r})}emit(e){for(var t=this._mSubscriptions[e],r=arguments.length,i=new Array(r>1?r-1:0),s=1;s<r;s++)i[s-1]=arguments[s];if(t)for(var o=0;o<t.length;o++){var a=t[o].ctx||{};try{t[o].fn.apply(a,i)}catch(p){console.error("Error while emitting event:",p)}}i.unshift(e);for(var l=this._mSubscriptions[Oe.ALL_EVENT],d=0;d<l.length;d++){var h=l[d].ctx||{};try{l[d].fn.apply(h,i)}catch(p){console.error("Error while emitting event to allEventSubs:",p)}}}unbind(e,t,r){if(!this._mSubscriptions[e])throw new Error("No subscriptions to unsubscribe for event "+e);for(var i=!1,s=0;s<this._mSubscriptions[e].length;s++)(!t||this._mSubscriptions[e][s].fn===t)&&(!r||r===this._mSubscriptions[e][s].ctx)&&(this._mSubscriptions[e].splice(s,1),i=!0);if(i===!1)throw new Error("Nothing to unbind for "+e)}}Vn(Oe,"ALL_EVENT","__all");function qe(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=Qh(n,"string");return typeof e=="symbol"?e:e+""}function Qh(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class Rr extends Oe{constructor(e,t,r){super(),qe(this,"width",void 0),qe(this,"height",void 0),qe(this,"title",void 0),qe(this,"parent",void 0),qe(this,"layoutManager",void 0),qe(this,"tab",void 0),qe(this,"_config",void 0),qe(this,"isHidden",!1),qe(this,"beforeCloseHandler",void 0),qe(this,"_element",T(['<div class="lm_item_container">','<div class="lm_content" tabindex="-1"></div>',"</div>"].join(""))),qe(this,"_contentElement",void 0),this.title=ra(e)?e.componentName:"",this.parent=t,this.layoutManager=r,this._config=e,this._contentElement=this._element.find(".lm_content"),this.beforeCloseHandler=null}getElement(){return this._contentElement}hide(){this.emit("hide"),this.isHidden=!0,this._element.hide()}show(){this.emit("show"),this.isHidden=!1,this._element.show(),(this.height!=0||this.width!=0)&&this.emit("shown")}setSize(e,t){for(var r,i,s,o=this.parent,a=null;o&&!o.isColumn&&!o.isRow;){var l;if(a=o,o=o.parent,(l=o)!==null&&l!==void 0&&l.isRoot)return!1}if(!o||!a)return!1;for(var d=o.isColumn?"height":"width",h=d==="height"?t:e,p=((r=this[d])!==null&&r!==void 0?r:0)*(1/(((i=a.config[d])!==null&&i!==void 0?i:0)/100)),m=h/p*100,v=(((s=a.config[d])!==null&&s!==void 0?s:0)-m)/(o.contentItems.length-1),f=0;f<o.contentItems.length;f++)if(o.contentItems[f]===a)o.contentItems[f].config[d]=m;else{var g;o.contentItems[f].config[d]=((g=o.contentItems[f].config[d])!==null&&g!==void 0?g:0)+v}return o.callDownwards("setSize"),!0}close(e){var t,r;this._config.isClosable&&(!((t=(r=this.beforeCloseHandler)===null||r===void 0?void 0:r.call(this,e))!==null&&t!==void 0)||t)&&(this.emit("close"),this.parent.close())}beforeClose(e){this.beforeCloseHandler=e}getState(){return this._config.componentState}getConfig(){return this._config}extendState(e){this.setState(T.extend(!0,this.getState(),e))}setState(e){this._config.componentState=e,this.parent.emitBubblingEvent("stateChanged")}setTitle(e){this.parent.setTitle(e)}_$setSize(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;if(e!==this.width||t!==this.height){this.width=e,this.height=t;var r=this._contentElement[0],i=r.offsetWidth-r.clientWidth,s=r.offsetHeight-r.clientHeight;this._contentElement.width(this.width-i).height(this.height-s),this.emit("resize")}}}const ec=Object.freeze(Object.defineProperty({__proto__:null,Container:Rr,ItemContainer:Rr},Symbol.toStringTag,{value:"Module"}));function oa(n){var e=location.hash.match(new RegExp(n+"=([^&]*)"));return e?e[1]:null}function sa(n){if(window.location.hash)return oa(n);if(!window.location.search)return null;var e=window.location.search.substr(1).split("&"),t={},r,i;for(i=0;i<e.length;i++)r=e[i].split("="),t[r[0]]=r[1];return t[n]||null}function ei(n){return window.requestAnimationFrame(n)}function tc(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 Xn(){return ct()}function nc(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 ti(n){return T.trim(n.replace(/(<([^>]+)>)/gi,""))}function xe(n,e,t){return(e=rc(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function rc(n){var e=ic(n,"string");return typeof e=="symbol"?e:e+""}function ic(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class On extends Oe{constructor(e,t){var r,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;super(),xe(this,"_eElement",void 0),xe(this,"_oDocument",void 0),xe(this,"_eBody",void 0),xe(this,"_root",void 0),xe(this,"_destroyAfterMouseUp",void 0),xe(this,"_nDelay",400),xe(this,"_timeout",void 0),xe(this,"timeout",void 0),xe(this,"_nDistance",10),xe(this,"_nX",0),xe(this,"_nY",0),xe(this,"_nOriginalX",0),xe(this,"_nOriginalY",0),xe(this,"_bDragging",!1),this._eElement=e,this._oDocument=T(document),this._eBody=T(document.body),this._root=t,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),(r=this._eElement)===null||r===void 0||r.on("mousedown",this.onMouseDown)}destroy(){var e,t;(e=this._eElement)===null||e===void 0||e.unbind("mousedown",this.onMouseDown),(t=this._oDocument)===null||t===void 0||t.unbind("mouseup",this.onMouseUp),this._eElement=void 0,this._oDocument=void 0,this._eBody=void 0,clearTimeout(this._timeout),this._timeout=void 0}onMouseDown(e){if(e.preventDefault(),e.button===0){var t,r,i,s,o=this._getCoordinates(e);this._nOriginalX=(t=o.x)!==null&&t!==void 0?t:0,this._nOriginalY=(r=o.y)!==null&&r!==void 0?r:0,(i=this._oDocument)===null||i===void 0||i.on("mousemove",this.onMouseMove),(s=this._oDocument)===null||s===void 0||s.on("mouseup",this.onMouseUp),this._timeout=window.setTimeout(this._startDrag,this._nDelay)}}onMouseMove(e){if(this._timeout!=null){var t,r;e.preventDefault();var i=this._getCoordinates(e);this._nX=((t=i.x)!==null&&t!==void 0?t:0)-this._nOriginalX,this._nY=((r=i.y)!==null&&r!==void 0?r:0)-this._nOriginalY,this._bDragging===!1&&(Math.abs(this._nX)>this._nDistance||Math.abs(this._nY)>this._nDistance)&&this._startDrag(),this._bDragging&&this.emit("drag",this._nX,this._nY,e)}}onMouseUp(e){if(this._timeout!=null){var t,r,i,s,o;if(clearTimeout(this._timeout),(t=this._oDocument)===null||t===void 0||t.unbind("mousemove",this.onMouseMove),(r=this._oDocument)===null||r===void 0||r.unbind("mouseup",this.onMouseUp),(i=this._oDocument)===null||i===void 0||(i=i.find("iframe"))===null||i===void 0||i.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"),(o=this._root)===null||o===void 0||o.childElementContainer.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,r,i;window.clearTimeout(this._timeout),this._bDragging=!0,(e=this._eBody)===null||e===void 0||e.addClass("lm_dragging"),(t=this._eElement)===null||t===void 0||t.addClass("lm_dragging"),(r=this._root)===null||r===void 0||r.childElementContainer.addClass("lm_dragging"),(i=this._oDocument)===null||i===void 0||(i=i.find("iframe"))===null||i===void 0||i.css("pointer-events","none"),this.emit("dragStart",this._nOriginalX,this._nOriginalY)}_getCoordinates(e){var t,r;return{x:(t=e.pageX)!==null&&t!==void 0?t:0,y:(r=e.pageY)!==null&&r!==void 0?r:0}}}function zt(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=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 r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class aa{constructor(e,t){zt(this,"_container",void 0),zt(this,"_reactComponent",null),zt(this,"_portalComponent",null),zt(this,"_originalComponentWillUpdate",null),zt(this,"_initialState",void 0),zt(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=Gr.createPortal(this._getReactComponent(),this._container.getElement()[0],e),this._container.layoutManager.addReactChild(e,this._portalComponent)}_gotReactComponent(e){if(e){this._reactComponent=e,this._originalComponentWillUpdate=this._reactComponent.componentWillUpdate||function(){},this._reactComponent.componentWillUpdate=this._onUpdate.bind(this);var t=this._container.getState();t&&this._reactComponent.setState(t)}}_destroy(){this._container.layoutManager.removeReactChild(this._key(),this._portalComponent),this._container.off("open",this._render,this),this._container.off("destroy",this._destroy,this)}_onUpdate(e,t){var r;this._container.setState(t),(r=this._originalComponentWillUpdate)===null||r===void 0||r.call(this._reactComponent,e,t)}_getReactClass(){var e=this._container._config.component;if(!e)throw new Error("No react component name. type: react-component needs a field `component`");var t=this._container.layoutManager.getComponent(e)||this._container.layoutManager.getFallbackComponent();if(!t)throw new Error('React component "'+e+'" not found. Please register all components with GoldenLayout using `registerComponent(name, component)`');return t}_getReactComponent(){var e={glEventHub:this._container.layoutManager.eventHub,glContainer:this._container,ref:this._gotReactComponent.bind(this)},t=T.extend(e,this._container._config.props);return O.createElement(this._reactClass,t)}}var Zn=["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"],ac=[!0,!1,"row","column","stack","component","close","maximise","minimise","open in new window"];function ni(n){if(Zn.length>36)throw new Error("Too many keys in config minifier map");var e={};return ri(n,e,"_min"),e}function Fr(n){if(Zn.length>36)throw new Error("Too many keys in config minifier map");var e={};return ri(n,e,"_max"),e}function ri(n,e,t){var r=t==="_min"?lc:dc;for(var i in n)if(n.hasOwnProperty(i)){var s=Array.isArray(n)?n[Number.parseInt(i,10)]:n[i];if(typeof s=="object"&&s!=null){var o=s instanceof Array?[]:{};if(Array.isArray(e))e[Number.parseInt(i,10)]=o;else{var a=r(i,Zn);e[a]=o}ri(s,o,t)}else{var l=r(s,ac);if(Array.isArray(e))e[Number.parseInt(i,10)]=l;else{var d=r(i,Zn);e[d]=l}}}}function lc(n,e){if(typeof n=="string"&&n.length===1)return"___"+n;var t=e.indexOf(n);return t===-1?n:t.toString(36)}function dc(n,e){return typeof n=="string"&&n.length===1?e[parseInt(n,36)]:typeof n=="string"&&n.substr(0,3)==="___"?n[3]:n}function Cr(n,e,t){return(e=uc(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function uc(n){var e=hc(n,"string");return typeof e=="symbol"?e:e+""}function hc(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class Hr{constructor(e,t){Cr(this,"name",void 0),Cr(this,"origin",void 0),Cr(this,"isPropagationStopped",void 0),this.name=e,this.origin=t,this.isPropagationStopped=!1}stopPropagation(){this.isPropagationStopped=!0}}function Nn(n,e,t){return(e=cc(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function cc(n){var e=mc(n,"string");return typeof e=="symbol"?e:e+""}function mc(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}let la=class extends Oe{constructor(e){super(),Nn(this,"_layoutManager",void 0),Nn(this,"_dontPropagateToParent",void 0),Nn(this,"_childEventSource",void 0),Nn(this,"_boundOnEventFromChild",void 0),this._layoutManager=e,this._dontPropagateToParent=null,this._childEventSource=null,this.on(Oe.ALL_EVENT,this._onEventFromThis.bind(this)),this._boundOnEventFromChild=this._onEventFromChild.bind(this),T(window).on("gl_child_event",this._boundOnEventFromChild)}_onEventFromThis(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];this._layoutManager.isSubWindow&&t[0]!==this._dontPropagateToParent&&this._propagateToParent(t),this._propagateToChildren(t),this._dontPropagateToParent=null,this._childEventSource=null}_$onEventFromParent(e){this._dontPropagateToParent=e[0],this.emit.apply(this,e)}_onEventFromChild(e){this._childEventSource=e.originalEvent.__gl,this.emit.apply(this,e.originalEvent.__glArgs)}_propagateToParent(e){var t,r="gl_child_event",i=(t=window.opener)===null||t===void 0?void 0:t.document.createEvent("HTMLEvents");i.initEvent(r,!0,!0),i.eventName=r,i.__glArgs=e,i.__gl=this._layoutManager,window.opener.dispatchEvent(i)}_propagateToChildren(e){for(var t=0;t<this._layoutManager.openPopouts.length;t++){var r=this._layoutManager.openPopouts[t].getGlInstance();r&&r!==this._childEventSource&&r.eventHub._$onEventFromParent(e)}}destroy(){T(window).off("gl_child_event",this._boundOnEventFromChild)}};function da(n,e,t){return n.on(e,t),()=>{n.off(e,t)}}function ua(n){return(e,t)=>da(e,n,t)}function ha(n){return function(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),i=1;i<t;i++)r[i-1]=arguments[i];e.emit(n,...r)}}function ca(n){return(e,t)=>{var r=c.useRef(null),i=c.useRef(()=>!1);if(r.current!=e||i.current!=t){var s;(s=r.current)===null||s===void 0||s.off(n,i.current),e==null||e.on(n,t)}r.current=e,i.current=t,c.useEffect(()=>()=>{var o;return(o=r.current)===null||o===void 0?void 0:o.off(n,i.current)},[])}}function It(n){return{listen:ua(n),emit:ha(n),useListener:ca(n)}}const pc=Object.freeze(Object.defineProperty({__proto__:null,BubblingEvent:Hr,DragListener:On,EventEmitter:Oe,EventHub:la,ReactComponentHandler:aa,animFrame:ei,filterXss:nc,getHashValue:oa,getQueryStringParam:sa,getUniqueId:Xn,listenForEvent:da,makeEmitFunction:ha,makeEventFunctions:It,makeListenFunction:ua,makeUseListenerFunction:ca,minifyConfig:ni,removeFromArray:tc,stripTags:ti,unminifyConfig:Fr},Symbol.toStringTag,{value:"Module"}));function yt(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=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 r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class ma extends Oe{constructor(e,t,r,i,s){super(),yt(this,"isInitialised",!1),yt(this,"_config",void 0),yt(this,"_dimensions",void 0),yt(this,"_parentId",void 0),yt(this,"_indexInParent",void 0),yt(this,"_layoutManager",void 0),yt(this,"_popoutWindow",null),yt(this,"_id",null),this._config=e,this._dimensions=t,this._parentId=r,this._indexInParent=i,this._layoutManager=s,this._createWindow()}toConfig(){var e,t,r,i,s,o,a,l,d,h,p;if(this.isInitialised===!1)throw new Error("Can't create config, layout not yet initialised");return{dimensions:{width:(e=this.getGlInstance())===null||e===void 0?void 0:e.width,height:(t=this.getGlInstance())===null||t===void 0?void 0:t.height,left:(r=(i=(s=this._popoutWindow)===null||s===void 0?void 0:s.screenX)!==null&&i!==void 0?i:(o=this._popoutWindow)===null||o===void 0?void 0:o.screenLeft)!==null&&r!==void 0?r: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:(p=this.getGlInstance())===null||p===void 0?void 0:p.toConfig().content,parentId:this._parentId,indexInParent:this._indexInParent}}getGlInstance(){var e;return(e=this._popoutWindow)===null||e===void 0?void 0:e.__glInstance}getWindow(){return this._popoutWindow}close(){if(this.getGlInstance()){var e;(e=this.getGlInstance())===null||e===void 0||e._$closeWindow()}else try{var t;(t=this.getWindow())===null||t===void 0||t.close()}catch{}}popIn(){var e;this._indexInParent;var t=null,r=null;if(this._parentId){var i;if(t=T.extend(!0,{},(i=this.getGlInstance())===null||i===void 0?void 0:i.toConfig()).content[0],r=this._layoutManager.root.getItemsById(this._parentId)[0],!r){var s;((s=this._layoutManager.root.contentItems.length)!==null&&s!==void 0?s:0)>0?r=this._layoutManager.root.contentItems[0]:r=this._layoutManager.root}}t&&((e=r)===null||e===void 0||e.addChild(t,this._indexInParent),this.close())}_createWindow(){var e=this._createUrl(),t=Math.floor(Math.random()*1e6).toString(36),r=this._serializeWindowOptions({width:this._dimensions.width,height:this._dimensions.height,innerWidth:this._dimensions.width,innerHeight:this._dimensions.height,menubar:"no",toolbar:"no",location:"no",personalbar:"no",resizable:"yes",scrollbars:"no",status:"no"});if(this._popoutWindow=window.open(e,t,r),!this._popoutWindow)if(this._layoutManager.config.settings.blockedPopoutsThrowError===!0){var i=new Error("Popout blocked");throw i.type="popoutBlocked",i}else return;T(this._popoutWindow).on("load",this._positionWindow.bind(this)).on("unload beforeunload",this._onClose.bind(this));var s=window.setInterval(()=>{var o;(o=this._popoutWindow)!==null&&o!==void 0&&o.__glInstance&&this._popoutWindow.__glInstance.isInitialised&&(this._onInitialised(),window.clearInterval(s))},10)}_serializeWindowOptions(e){var t=[],r;for(r in e)t.push(r+"="+e[r]);return t.join(",")}_createUrl(){var e={content:this._config},t="gl-window-config-"+Xn();e=ni(e);try{localStorage.setItem(t,JSON.stringify(e))}catch(i){throw new Error("Error while writing to localStorage "+i.toString())}var r=document.location.href.split("?");return r.length===1?r[0]+"?gl-window="+t:document.location.href+"&gl-window="+t}_positionWindow(){var e,t;(e=this._popoutWindow)===null||e===void 0||e.moveTo(this._dimensions.left,this._dimensions.top),(t=this._popoutWindow)===null||t===void 0||t.focus()}_onInitialised(){var e;this.isInitialised=!0,(e=this.getGlInstance())===null||e===void 0||e.on("popIn",this.popIn,this),this.emit("initialised")}_onClose(){setTimeout(this.emit.bind(this,"closed"),50)}}function ve(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 r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class Kt extends Oe{constructor(e,t,r,i,s,o){var a,l,d,h,p,m,v,f;if(super(),ve(this,"_dragListener",void 0),ve(this,"_layoutManager",void 0),ve(this,"_contentItem",void 0),ve(this,"_originalParent",void 0),ve(this,"_area",null),ve(this,"_lastValidArea",null),ve(this,"_minX",void 0),ve(this,"_maxX",void 0),ve(this,"_minY",void 0),ve(this,"_maxY",void 0),ve(this,"_width",void 0),ve(this,"_height",void 0),ve(this,"_sided",void 0),ve(this,"element",void 0),ve(this,"childElementContainer",void 0),ve(this,"_proxyTab",void 0),this._dragListener=r,this._layoutManager=i,this._contentItem=s,this._originalParent=o,this._dragListener.on("drag",this._onDrag,this),this._dragListener.on("dragStop",this._onDrop,this),this._contentItem.tab&&this._contentItem.tab.element){var g,b;this._layoutManager.tabDropPlaceholder.width((g=this._contentItem.tab.element.outerWidth(!0))!==null&&g!==void 0?g:0),this._layoutManager.tabDropPlaceholder.height((b=this._contentItem.tab.element.outerHeight(!0))!==null&&b!==void 0?b:0)}if(this.element=T(Kt._template),o&&o._side&&(this._sided=o._sided,this.element.addClass("lm_"+o._side),["right","bottom"].indexOf(o._side.toString())>=0&&this.element.find(".lm_content").after(this.element.find(".lm_header"))),this.element.css({left:e,top:t}),this._proxyTab=this.element.find(".lm_tab"),this._proxyTab.attr("title",ti((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(s.element),this._updateTree(),this._layoutManager._$calculateItemAreas(),T(document.body).append(this.element),this._setDimensions(),!this._contentItem.tab&&this._proxyTab.length){var S,w;this._layoutManager.tabDropPlaceholder.width((S=this._proxyTab.outerWidth(!0))!==null&&S!==void 0?S:0),this._layoutManager.tabDropPlaceholder.height((w=this._proxyTab.outerHeight(!0))!==null&&w!==void 0?w:0)}var y=this._layoutManager.container.offset();this._minX=(d=y==null?void 0:y.left)!==null&&d!==void 0?d:0,this._minY=(h=y==null?void 0:y.top)!==null&&h!==void 0?h:0,this._maxX=((p=this._layoutManager.container.width())!==null&&p!==void 0?p:0)+this._minX,this._maxY=((m=this._layoutManager.container.height())!==null&&m!==void 0?m:0)+this._minY,this._width=(v=this.element.width())!==null&&v!==void 0?v:0,this._height=(f=this.element.height())!==null&&f!==void 0?f:0,this._setDropPosition(e,t),this._layoutManager.emit("itemPickedUp",this._contentItem)}_onDrag(e,t,r){var i,s,o=(i=r.pageX)!==null&&i!==void 0?i:0,a=(s=r.pageY)!==null&&s!==void 0?s:0,l=o>this._minX&&o<this._maxX&&a>this._minY&&a<this._maxY;!l&&this._layoutManager.config.settings.constrainDragToContainer===!0||this._setDropPosition(o,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,r=e.dragProxyHeight;this.element.width(t),this.element.height(r),t-=this._sided?e.headerHeight:0,r-=this._sided?0:e.headerHeight,this.childElementContainer.width(t),this.childElementContainer.height(r),this._contentItem.element.width(t),this._contentItem.element.height(r),this._contentItem.callDownwards("_$show"),this._contentItem.callDownwards("setSize")}}ve(Kt,"_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 An(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 r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class pa{constructor(e,t,r){An(this,"_element",void 0),An(this,"_itemConfig",void 0),An(this,"_layoutManager",void 0),An(this,"_dragListener",void 0),this._element=e,this._itemConfig=t,this._layoutManager=r,this._dragListener=this._createDragListener()}_createDragListener(){return this._dragListener=new On(this._element,this._layoutManager.root,!0),this._dragListener.on("dragStart",this._onDragStart,this),this._dragListener.on("dragStop",this._createDragListener,this),this._dragListener}_onDragStart(e,t){var r=this._itemConfig;typeof r=="function"&&(r=r());var i=this._layoutManager._$normalizeContentItem(T.extend(!0,{},r));new Kt(e,t,this._dragListener,this._layoutManager,i,null)}}function Ln(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 r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class va{constructor(e,t,r){Ln(this,"_element",T(window)),Ln(this,"_itemConfig",void 0),Ln(this,"_layoutManager",void 0),Ln(this,"_dragListener",void 0),this._itemConfig=e,this._layoutManager=t,this._createDragListener(r)}_createDragListener(e){this._dragListener&&this._dragListener.destroy(),this._element&&this._layoutManager&&(this._dragListener=new On(this._element,this._layoutManager.root,!0),this._dragListener.on("dragStart",this._onDragStart,this),this._dragListener.on("dragStop",this._destroy,this),this._dragListener.onMouseDown(e),this._dragListener._startDrag())}_destroy(){this._dragListener=void 0,this._element=void 0,this._itemConfig=void 0,this._layoutManager=void 0}_onDragStart(e,t){if(!(!this._dragListener||!this._layoutManager)){var r=this._itemConfig;typeof r=="function"&&(r=r());var i=this._layoutManager._$normalizeContentItem(T.extend(!0,{},r));new Kt(e,t,this._dragListener,this._layoutManager,i,null)}}}function fa(n,e,t){return(e=_c(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function _c(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 r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class xn{constructor(){fa(this,"element",T(xn._template)),T(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()}}fa(xn,"_template",'<div class="lm_dropTargetIndicator"><div class="lm_inner"></div></div>');function wr(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=Tc(n,"string");return typeof e=="symbol"?e:e+""}function Tc(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class vn{constructor(e,t,r,i){wr(this,"element",void 0),wr(this,"_header",void 0),wr(this,"_action",void 0),this._header=e,this.element=T('<li class="'+r+'" title="'+t+'"></li>'),this._header.on("destroy",this._$destroy,this),this._action=i,this.element.on("click",this._action),this._header.controlsContainer.append(this.element)}_$destroy(){this.element.off(),this.element.remove()}}function Oc(n,e,t){return(e=xc(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function xc(n){var e=Ic(n,"string");return typeof e=="symbol"?e:e+""}function Ic(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class Rt extends Error{constructor(e,t){super(),Oc(this,"node",void 0),this.name="Configuration Error",this.message=e,this.node=t}}const Dc=Object.freeze(Object.defineProperty({__proto__:null,ConfigurationError:Rt},Symbol.toStringTag,{value:"Module"}));function me(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 r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function Ht(n){return n.isStack}function Le(n){return n.isComponent}function ga(n){return n.isRoot}class ge extends Oe{constructor(e,t,r,i){super(),me(this,"config",void 0),me(this,"type",void 0),me(this,"contentItems",void 0),me(this,"parent",void 0),me(this,"layoutManager",void 0),me(this,"element",void 0),me(this,"childElementContainer",void 0),me(this,"componentName",void 0),me(this,"isInitialised",!1),me(this,"isMaximised",!1),me(this,"isRoot",!1),me(this,"isRow",!1),me(this,"isColumn",!1),me(this,"isStack",!1),me(this,"isComponent",!1),me(this,"tab",void 0),me(this,"_pendingEventPropagations",void 0),me(this,"_throttledEvents",void 0),this.element=i,this.config=this._extendItemNode(t),this.type=t.type,this.contentItems=[],this.parent=r,this.layoutManager=e,this._pendingEventPropagations={},this._throttledEvents=["stateChanged"],this.on(Oe.ALL_EVENT,this._propagateEvent,this),t.content&&this._createContentItems(t)}callDownwards(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;r!==!0&&i!==!0&&this[e].apply(this,t);for(var s=0;s<this.contentItems.length;s++)this.contentItems[s].callDownwards(e,t,r);r===!0&&i!==!0&&this[e].apply(this,t)}removeChild(e){var t,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,i=this.contentItems.indexOf(e);if(i===-1)throw new Error("Can't remove child item. Unknown content item");if(r!==!0&&this.contentItems[i]._$destroy(),this.contentItems.splice(i,1),(t=this.config.content)===null||t===void 0||t.splice(i,1),this.contentItems.length>0)this.callDownwards("setSize");else if(this.type!=="root"&&this.config.isClosable){var s;(s=this.parent)===null||s===void 0||s.removeChild(this)}}addChild(e,t){e=this.layoutManager._$normalizeContentItem(e,this),t===void 0&&(t=this.contentItems.length),this.contentItems.splice(t,0,e),this.config.content===void 0&&(this.config.content=[]),this.config.content.splice(t,0,e.config),e.parent=this,e.parent.isInitialised===!0&&e.isInitialised===!1&&e._$init()}replaceChild(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;t=this.layoutManager._$normalizeContentItem(t);var i=this.contentItems.indexOf(e),s=e.element[0].parentNode;if(i===-1)throw new Error("Can't replace child. oldChild is not child of this");s==null||s.replaceChild(t.element[0],e.element[0]),r===!0&&(e.parent=null,e._$destroy()),this.contentItems[i]=t,t.parent=this,Ht(this)&&(this.header.tabs[i].contentItem=t),t.parent.isInitialised===!0&&t.isInitialised===!1&&t._$init(),this.callDownwards("setSize")}remove(){var e;(e=this.parent)===null||e===void 0||e.removeChild(this)}popout(){var e=this.layoutManager.createPopout(this);return this.emitBubblingEvent("stateChanged"),e}toggleMaximise(e){e&&e.preventDefault(),this.isMaximised===!0?this.layoutManager._$minimiseItem(this):this.layoutManager._$maximiseItem(this),this.isMaximised=!this.isMaximised,this.emitBubblingEvent("stateChanged")}select(){this.layoutManager.selectedItem!==this&&(this.layoutManager.selectItem(this,!0),this.element.addClass("lm_selected"))}deselect(){this.layoutManager.selectedItem===this&&(this.layoutManager.selectedItem=null,this.element.removeClass("lm_selected"))}setTitle(e){this.config.title=e,this.emit("titleChanged",e),this.emitBubblingEvent("stateChanged")}hasId(e){if(this.config.id){if(typeof this.config.id=="string")return this.config.id===e;if(this.config.id instanceof Array)return this.config.id.indexOf(e)!==-1}else return!1}addId(e){this.hasId(e)||(this.config.id?typeof this.config.id=="string"?this.config.id=[this.config.id,e]:this.config.id instanceof Array&&this.config.id.push(e):this.config.id=e)}removeId(e){if(!this.hasId(e))throw new Error("Id not found");if(typeof this.config.id=="string")delete this.config.id;else if(this.config.id instanceof Array){var t=this.config.id.indexOf(e);this.config.id.splice(t,1)}}getItemsByFilter(e){var t=[],r=function(s){for(var o=0;o<s.contentItems.length;o++)e(s.contentItems[o])===!0&&t.push(s.contentItems[o]),r(s.contentItems[o])};return r(this),t}getItemsById(e){return this.getItemsByFilter(function(t){return t.config.id instanceof Array?t.config.id.indexOf(e)!==-1:t.config.id===e})}getItemsByType(e){return this._$getItemsByProperty("type",e)}getComponentsByName(e){for(var t=this._$getItemsByProperty("componentName",e),r=[],i=0;i<t.length;i++)r.push(t[i].instance);return r}_$getItemsByProperty(e,t){return this.getItemsByFilter(function(r){return r[e]===t})}_$setParent(e){this.parent=e}_$highlightDropZone(e,t,r){var i;(i=this.layoutManager.dropTargetIndicator)===null||i===void 0||i.highlightArea(r)}_$onDrop(e,t){this.addChild(e)}_$hide(){this._callOnActiveComponents("hide"),this.element.hide(),this.layoutManager.updateSize()}_$show(){this._callOnActiveComponents("show"),this.element.show(),this.layoutManager.updateSize()}_callOnActiveComponents(e){for(var t=this.getItemsByType("stack"),r=null,i=0;i<t.length;i++)r=t[i].getActiveContentItem(),r&&Le(r)&&r.container[e]()}_$destroy(){this.emitBubblingEvent("beforeItemDestroyed"),this.callDownwards("_$destroy",[],!0,!0),this.element.remove(),this.emitBubblingEvent("itemDestroyed")}_$getArea(e){var t,r,i;e=e||this.element;var s=(t=e.offset())!==null&&t!==void 0?t:{left:0,top:0},o=(r=e.width())!==null&&r!==void 0?r:0,a=(i=e.height())!==null&&i!==void 0?i:0;return{x1:s.left,y1:s.top,x2:s.left+o,y2:s.top+a,surface:o*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 Hr(e,this);this.emit(e,t)}_createContentItems(e){var t;if(!(e.content instanceof Array))throw new Rt("content must be an Array",e);for(var r=0;r<e.content.length;r++)t=this.layoutManager.createContentItem(e.content[r],this),this.contentItems.push(t)}_extendItemNode(e){for(var[t,r]of Object.entries(ia)){var i=t;e[i]===void 0&&(e[i]=r)}return e}_propagateEvent(e,t){t instanceof Hr&&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,ei(this._propagateEventToLayoutManager.bind(this,e,t)))}_propagateEventToLayoutManager(e,t){this._pendingEventPropagations[e]=!1,this.layoutManager.emit(e,t)}}function cn(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 r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class ba extends ge{constructor(e,t,r){var i;Object.entries((i=e.config.settings.defaultComponentConfig)!==null&&i!==void 0?i:{}).forEach(a=>{var[l,d]=a;t[l]===void 0&&(t[l]=d)}),super(e,t,r,T()),cn(this,"config",void 0),cn(this,"componentName",void 0),cn(this,"container",void 0),cn(this,"parent",void 0),cn(this,"instance",void 0),this.config=t,this.parent=r;var s=e.getComponent(this.config.componentName)||e.getFallbackComponent(),o=T.extend(!0,{},this.config.componentState||{});if(s==null)throw new Rt('Unknown component "'+this.config.componentName+'"');o.componentName=this.config.componentName,this.componentName=this.config.componentName,this.config.title===""&&(this.config.title=this.config.componentName),this.isComponent=!0,this.container=new Rr(this.config,this,e),this.instance=new s(this.container,o),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(){ge.prototype._$init.call(this),this.container.emit("open")}_$hide(){this.container.hide(),ge.prototype._$hide.call(this)}_$show(e){this.container.show(),(this.container._config.isFocusOnShow||e)&&this.container._contentElement[0].focus({preventScroll:!0}),ge.prototype._$show.call(this)}_$destroy(){this.container.emit("destroy",this),ge.prototype._$destroy.call(this)}_$getArea(){return null}}function $e(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 r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class wn extends ge{constructor(e,t,r,i){super(t,r,i,T('<div class="lm_item lm_'+(e?"column":"row")+'"></div>')),$e(this,"isRow",void 0),$e(this,"isColumn",void 0),$e(this,"childElementContainer",void 0),$e(this,"parent",void 0),$e(this,"_splitter",[]),$e(this,"_splitterSize",void 0),$e(this,"_splitterGrabSize",void 0),$e(this,"_isColumn",void 0),$e(this,"_dimension",void 0),$e(this,"_splitterPosition",null),$e(this,"_splitterMinPosition",null),$e(this,"_splitterMaxPosition",null),this.parent=i,this.isRow=!e,this.isColumn=e,this.childElementContainer=this.element,this._splitterSize=t.config.dimensions.borderWidth,this._splitterGrabSize=t.config.dimensions.borderGrabWidth,this._isColumn=e,this._dimension=e?"height":"width",this._splitterPosition=null,this._splitterMinPosition=null,this._splitterMaxPosition=null}addChild(e,t,r){var i,s,o,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),ge.prototype.addChild.call(this,e,t),i=1/this.contentItems.length*100,r===!0){this.emitBubblingEvent("stateChanged");return}for(o=0;o<this.contentItems.length;o++)if(this.contentItems[o]===e)e.config[this._dimension]=i;else{var l;s=((l=this.contentItems[o].config[this._dimension])!==null&&l!==void 0?l:0)*(100-i)/100,this.contentItems[o].config[this._dimension]=s}this.callDownwards("setSize"),this.emitBubblingEvent("stateChanged")}removeChild(e,t){var r,i=(r=e.config[this._dimension])!==null&&r!==void 0?r:0,s=this.contentItems.indexOf(e),o=Math.max(s-1,0),a,l;if(s===-1)throw new Error("Can't remove child. ContentItem is not child of this Row or Column");for(this._splitter[o]&&(this._splitter[o]._$destroy(),this._splitter.splice(o,1)),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)+i/(this.contentItems.length-1)}if(ge.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 r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,i=e.config[this._dimension];t.config[this._dimension]=i,super.replaceChild(e,t,r),this.callDownwards("setSize"),this.emitBubblingEvent("stateChanged")}setSize(){this.contentItems.length>0&&(this._calculateRelativeSizes(),this._setAbsoluteSizes()),this.emitBubblingEvent("stateChanged"),this.emit("resize")}_$init(){if(this.isInitialised!==!0){var e;for(ge.prototype._$init.call(this),e=0;e<this.contentItems.length-1;e++)this.contentItems[e].element.after(this._createSplitter(e).element)}}_setAbsoluteSizes(){var e,t=this._calculateAbsoluteSizes();for(e=0;e<this.contentItems.length;e++)t.additionalPixel-e>0&&t.itemSizes[e]++,this._isColumn?(this.contentItems[e].element.width(t.totalWidth),this.contentItems[e].element.height(t.itemSizes[e])):(this.contentItems[e].element.width(t.itemSizes[e]),this.contentItems[e].element.height(t.totalHeight))}_calculateAbsoluteSizes(){var e,t,r=(this.contentItems.length-1)*this._splitterSize,i=(e=this.element.width())!==null&&e!==void 0?e:0,s=(t=this.element.height())!==null&&t!==void 0?t:0,o=0,a=[];this._isColumn?s-=r:i-=r;for(var l=0;l<this.contentItems.length;l++){var d,h,p=this._isColumn?Math.floor(s*(((d=this.contentItems[l].config.height)!==null&&d!==void 0?d:0)/100)):Math.floor(i*(((h=this.contentItems[l].config.width)!==null&&h!==void 0?h:0)/100));o+=p,a.push(p)}var m=Math.floor((this._isColumn?s:i)-o);return{itemSizes:a,additionalPixel:m,totalWidth:i,totalHeight:s}}_calculateRelativeSizes(){for(var e=0,t=[],r=this._isColumn?"height":"width",i=0;i<this.contentItems.length;i++){var s=this.contentItems[i].config[r];s!=null?e+=s:t.push(this.contentItems[i])}if(Math.round(e)===100){this._respectMinItemWidth();return}if(Math.round(e)<100&&t.length>0){for(var o=0;o<t.length;o++)t[o].config[r]=(100-e)/t.length;this._respectMinItemWidth();return}if(Math.round(e)>100)for(var a=0;a<t.length;a++)t[a].config[r]=50,e+=50;for(var l=0;l<this.contentItems.length;l++){var d;this.contentItems[l].config[r]=((d=this.contentItems[l].config[r])!==null&&d!==void 0?d:0)/e*100}this._respectMinItemWidth()}_respectMinItemWidth(){var e,t=this.layoutManager.config.dimensions&&(e=this.layoutManager.config.dimensions.minItemWidth)!==null&&e!==void 0?e:0,r=[],i=0,s=0,o=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 p=d.itemSizes[h];p<t?(s+=t-p,l={width:t}):(i+=p-t,l={width:p},r.push(l)),a.push(l)}if(!(s===0||s>i)){var m=s/i;o=s;for(var v=0;v<r.length;v++){l=r[v];var f=Math.round((l.width-t)*m);o-=f,l.width-=f}o!==0&&(a[a.length-1].width-=o);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 ya(this._isColumn,this._splitterSize,this._splitterGrabSize),t.on("drag",this._onSplitterDrag.bind(this,t),this),t.on("dragStop",this._onSplitterDragStop.bind(this,t),this),t.on("dragStart",this._onSplitterDragStart.bind(this,t),this),this._splitter.splice(e,0,t),t}_getItemsForSplitter(e){var t=this._splitter.indexOf(e);if(t<0)throw new Error("Splitter not found in RowOrColumn");return{before:this.contentItems[t],after:this.contentItems[t+1]}}_getMinimumDimensions(e){for(var t=0,r=0,i=0;i<e.length;++i){var s,o;t=Math.max((s=e[i].minWidth)!==null&&s!==void 0?s:0,t),r=Math.max((o=e[i].minHeight)!==null&&o!==void 0?o:0,r)}return{horizontal:t,vertical:r}}_onSplitterDragStart(e){var t,r,i,s,o=this._getItemsForSplitter(e),a=this.layoutManager.config.dimensions[this._isColumn?"minItemHeight":"minItemWidth"],l=this._getMinimumDimensions((t=o.before.config.content)!==null&&t!==void 0?t:[]),d=this._isColumn?l.vertical:l.horizontal,h=this._getMinimumDimensions((r=o.after.config.content)!==null&&r!==void 0?r:[]),p=this._isColumn?h.vertical:h.horizontal;this._splitterPosition=0,this._splitterMinPosition=-1*(((i=o.before.element[this._dimension]())!==null&&i!==void 0?i:0)-(d||a)),this._splitterMaxPosition=((s=o.after.element[this._dimension]())!==null&&s!==void 0?s:0)-(p||a)}_onSplitterDrag(e,t,r){var i=this._isColumn?r:t;this._splitterMaxPosition==null||this._splitterMinPosition==null||i>this._splitterMinPosition&&i<this._splitterMaxPosition&&(this._splitterPosition=i,e.element.css(this._isColumn?"top":"left",i))}_onSplitterDragStop(e){var t,r,i,s,o,a=this._getItemsForSplitter(e),l=(t=a.before.element[this._dimension]())!==null&&t!==void 0?t:0,d=(r=a.after.element[this._dimension]())!==null&&r!==void 0?r:0,h=(((i=this._splitterPosition)!==null&&i!==void 0?i:0)+l)/(l+d),p=((s=a.before.config[this._dimension])!==null&&s!==void 0?s:0)+((o=a.after.config[this._dimension])!==null&&o!==void 0?o:0);a.before.config[this._dimension]=h*p,a.after.config[this._dimension]=(1-h)*p,e.element.css({top:0,left:0}),ei(this.callDownwards.bind(this,"setSize",void 0,void 0,void 0))}}function eo(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function to(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?eo(Object(t),!0).forEach(function(r){$r(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):eo(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function $r(n,e,t){return(e=Rc(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Rc(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 r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class Ur extends ge{constructor(e,t,r){super(e,to(to({},t),{},{type:"root"}),null,T('<div class="lm_goldenlayout lm_item lm_root"></div>')),$r(this,"childElementContainer",void 0),$r(this,"_containerElement",void 0),this.isRoot=!0,this.type="root",this.childElementContainer=this.element,this._containerElement=r,this._containerElement.append(this.element)}addChild(e,t){if(this.contentItems.length>0)throw new Error("Root node can only have a single child");e=this.layoutManager._$normalizeContentItem(e,this),this.childElementContainer.append(e.element),super.addChild(e,t),this.callDownwards("setSize"),this.emitBubblingEvent("stateChanged")}setSize(e,t){var r,i;e=typeof e>"u"?(r=this._containerElement.width())!==null&&r!==void 0?r:0:e,t=typeof t>"u"?(i=this._containerElement.height())!==null&&i!==void 0?i:0:t,this.element.width(e),this.element.height(t),this.contentItems[0]&&(this.contentItems[0].element.width(e),this.contentItems[0].element.height(t))}_$getArea(){var e=super._$getArea();if(e==null)throw new Error("Unable to get root area");return e}_$highlightDropZone(e,t,r){this.layoutManager.tabDropPlaceholder.remove(),super._$highlightDropZone(e,t,r)}_$onDrop(e,t){var r;if(Le(e)&&(r=this.layoutManager.createContentItem({type:"stack",header:e.config.header||{}},this),r._$init(),r.addChild(e),e=r),!this.contentItems.length)this.addChild(e);else{var{side:i}=t,s=i==="left"||i==="right"?"row":"column",o=i==="left"||i==="right"?"width":"height",a=i==="left"||i==="top",l=this.contentItems[0];if(!(l instanceof wn)||l.type!=s){var d=this.layoutManager.createContentItem({type:s},this);this.replaceChild(l,d),d.addChild(e,a?0:void 0,!0),d.addChild(l,a?void 0:0,!0),l.config[o]=50,e.config[o]=50,d.callDownwards("setSize")}else{var h,p=l.contentItems[a?0:l.contentItems.length-1];l.addChild(e,a?0:void 0,!0),p.config[o]=((h=p.config[o])!==null&&h!==void 0?h:0)*.5,e.config[o]=p.config[o],l.callDownwards("setSize")}}}}function no(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function Vt(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?no(Object(t),!0).forEach(function(r){Ne(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):no(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function Ne(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=$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 r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class Br extends ge{constructor(e,t,r){var i,s,o,a,l,d,h,p,m;super(e,t,r,T('<div class="lm_item lm_stack"></div>')),Ne(this,"_activeContentItem",null),Ne(this,"_header",void 0),Ne(this,"childElementContainer",T('<div class="lm_items"></div>')),Ne(this,"header",void 0),Ne(this,"parent",void 0),Ne(this,"isStack",!0),Ne(this,"_dropSegment",null),Ne(this,"_contentAreaDimensions",null),Ne(this,"_dropIndex",void 0),Ne(this,"_side",void 0),Ne(this,"_sided",!1),Ne(this,"config",void 0),this.parent=r,this.config=t;var v=e.config;this._side=!1,this._header={show:((i=v.settings)===null||i===void 0?void 0:i.hasHeaders)&&t.hasHeaders!==!1,popout:(s=v.settings)!==null&&s!==void 0&&s.showPopoutIcon?(o=v.labels)===null||o===void 0?void 0:o.popout:void 0,maximise:(a=v.settings)!==null&&a!==void 0&&a.showMaximiseIcon?(l=v.labels)===null||l===void 0?void 0:l.maximise:void 0,close:(d=v.settings)!==null&&d!==void 0&&d.showCloseIcon?(h=v.labels)===null||h===void 0?void 0:h.close:void 0,minimise:(p=(m=v.labels)===null||m===void 0?void 0:m.minimise)!==null&&p!==void 0?p:void 0},v.header&&(this._header=Vt(Vt({},this._header),v.header)),t.header&&(this._header=Vt(Vt({},this._header),t.header)),t.content&&t.content[0]&&t.content[0].header&&(this._header=Vt(Vt({},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,r,i,s,o=this._header.show&&(e=(t=this.layoutManager.config.dimensions)===null||t===void 0?void 0:t.headerHeight)!==null&&e!==void 0?e:0,a=((r=this.element.width())!==null&&r!==void 0?r:0)-(this._sided?o:0),l=((i=this.element.height())!==null&&i!==void 0?i:0)-(this._sided?0:o);for(this.childElementContainer.width(a),this.childElementContainer.height(l),s=0;s<this.contentItems.length;s++)this.contentItems[s].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),Le(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,r=this.contentItems.indexOf(e);super.removeChild(e,t),this.header.removeTab(e),this.header.activeContentItem===e&&(this.contentItems.length>0?this.setActiveContentItem(this.contentItems[Math.max(r-1,0)]):this._activeContentItem=null),this._$validateClosability(),this.emitBubblingEvent("stateChanged")}_$validateClosability(){for(var e=this.header._isClosable(),t=0,r=this.contentItems.length;t<r;t++){var i;if(!e)break;e=(i=this.contentItems[t].config.isClosable)!==null&&i!==void 0?i:!1}this.header._$setClosable(e)}_$destroy(){ge.prototype._$destroy.call(this),this.header._$destroy()}_$onDrop(e){if(this._dropSegment==="header"){this._resetHeaderDropZone(),this.addChild(e,this._dropIndex);return}if(this._dropSegment==="body"){this.addChild(e);return}var t=this._dropSegment==="top"||this._dropSegment==="bottom",r=this._dropSegment==="left"||this._dropSegment==="right",i=this._dropSegment==="top"||this._dropSegment==="left",s=this.parent instanceof wn&&(t&&this.parent.isColumn||r&&this.parent.isRow),o=t?"column":"row",a=t?"height":"width";if(Le(e)){var l=this.layoutManager.createContentItem({type:"stack",header:e.config.header||{}},this);l._$init(),l.addChild(e),e=l}if(s){var d,h=this.parent.contentItems.indexOf(this);this.parent.addChild(e,i?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 p,m=this.layoutManager.createContentItem({type:o},this);(p=this.parent)===null||p===void 0||p.replaceChild(this,m),m.addChild(e,i?0:void 0,!0),m.addChild(this,i?void 0:0,!0),this.config[a]=50,e.config[a]=50,m.callDownwards("setSize")}}_$highlightDropZone(e,t){if(this._contentAreaDimensions)for(var[r,i]of Object.entries(this._contentAreaDimensions)){var s=i.hoverArea;if(s.x1<e&&s.x2>e&&s.y1<t&&s.y2>t){r==="header"?(this._dropSegment="header",this._highlightHeaderDropZone(e)):(this._resetHeaderDropZone(),this._highlightBodyDropZone(r));return}}}_$getArea(){if(this.element.is(":visible")===!1)return null;var e=super._$getArea(this.header.element),t=super._$getArea(this.childElementContainer);if(e==null||t==null)return null;var r=t.x2-t.x1,i=t.y2-t.y1;return this._contentAreaDimensions={header:{hoverArea:{x1:e.x1,y1:e.y1,x2:e.x2,y2:e.y2},highlightArea:{x1:e.x1,y1:e.y1,x2:e.x2,y2:e.y2}}},this._activeContentItem&&this._activeContentItem.isComponent===!1?e:this.contentItems.length===0?(this._contentAreaDimensions.body={hoverArea:{x1:t.x1,y1:t.y1,x2:t.x2,y2:t.y2},highlightArea:{x1:t.x1,y1:t.y1,x2:t.x2,y2:t.y2}},super._$getArea(this.element)):(this._contentAreaDimensions.left={hoverArea:{x1:t.x1,y1:t.y1,x2:t.x1+r*.25,y2:t.y2},highlightArea:{x1:t.x1,y1:t.y1,x2:t.x1+r*.5,y2:t.y2}},this._contentAreaDimensions.top={hoverArea:{x1:t.x1+r*.25,y1:t.y1,x2:t.x1+r*.75,y2:t.y1+i*.5},highlightArea:{x1:t.x1,y1:t.y1,x2:t.x2,y2:t.y1+i*.5}},this._contentAreaDimensions.right={hoverArea:{x1:t.x1+r*.75,y1:t.y1,x2:t.x2,y2:t.y2},highlightArea:{x1:t.x1+r*.5,y1:t.y1,x2:t.x2,y2:t.y2}},this._contentAreaDimensions.bottom={hoverArea:{x1:t.x1+r*.25,y1:t.y1+i*.5,x2:t.x1+r*.75,y2:t.y2},highlightArea:{x1:t.x1,y1:t.y1+i*.5,x2:t.x2,y2:t.y2}},super._$getArea(this.element))}_highlightHeaderDropZone(e){var t,r,i,s,o,a,l,d,h,p,m,v,f,g,b,S,w=this.header.tabs.length;if(w===0){var y,D,V,X,G,A,M,J,W=this.header.element.offset();(y=this.layoutManager.dropTargetIndicator)===null||y===void 0||y.highlightArea({x1:(D=W==null?void 0:W.left)!==null&&D!==void 0?D:0,x2:((V=W==null?void 0:W.left)!==null&&V!==void 0?V:0)+100,y1:(X=(G=this.header.element.offset())===null||G===void 0?void 0:G.top)!==null&&X!==void 0?X:0,y2:((A=(M=this.header.element.offset())===null||M===void 0?void 0:M.top)!==null&&A!==void 0?A:0)+((J=this.header.element.innerHeight())!==null&&J!==void 0?J:0)});return}var k=this.header.tabsContainer,z=(t=k.get(0))===null||t===void 0?void 0:t.getBoundingClientRect(),F=(r=this.layoutManager.tabDropPlaceholder.get(0))===null||r===void 0?void 0:r.getBoundingClientRect();if(!(!z||!F)){e<z.left?e=z.left+1:e>z.right&&(e=z.right-1);var j,H;if(!(F.left<e&&e<F.right)){for(var U=0;U<w;U++){var ce;if(j=this.header.tabs[U].element,H=(ce=j.get(0))===null||ce===void 0?void 0:ce.getBoundingClientRect(),H&&H.left<e&&e<H.right){this._dropIndex=U;break}}if(j&&H&&e<H.left+H.width*.5)j.before(this.layoutManager.tabDropPlaceholder);else if(j){var tt;this._dropIndex=Math.min(((tt=this._dropIndex)!==null&&tt!==void 0?tt:0)+1,w),j.after(this.layoutManager.tabDropPlaceholder)}}var Ge=(i=(s=this.layoutManager.tabDropPlaceholder.offset())===null||s===void 0?void 0:s.left)!==null&&i!==void 0?i:0;Ge=Math.max(Ge,(o=(a=this.header.tabsContainer.offset())===null||a===void 0?void 0:a.left)!==null&&o!==void 0?o:0);var x=Ge+((l=this.layoutManager.tabDropPlaceholder.width())!==null&&l!==void 0?l:0);x=Math.min(x,((d=(h=this.header.tabsContainer.offset())===null||h===void 0?void 0:h.left)!==null&&d!==void 0?d:0)+((p=this.header.tabsContainer.innerWidth())!==null&&p!==void 0?p:0)),(m=this.layoutManager.dropTargetIndicator)===null||m===void 0||m.highlightArea({x1:Ge,x2:x,y1:(v=(f=this.header.element.offset())===null||f===void 0?void 0:f.top)!==null&&v!==void 0?v:0,y2:((g=(b=this.header.element.offset())===null||b===void 0?void 0:b.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(r=>r===this._header.show)?this._header.show:void 0;if(this.header.element.toggle(!!this._header.show),!!e&&(this._side=e,this._sided=["right","left"].indexOf(this._side.toString())>=0,this.element.removeClass("lm_left lm_right lm_bottom"),this._side&&this.element.addClass("lm_"+this._side),this.element.find(".lm_header").length&&this.childElementContainer)){var t=["right","bottom"].indexOf(this._side.toString())>=0?"before":"after";this.header.element[t](this.childElementContainer),this.callDownwards("setSize")}}_highlightBodyDropZone(e){var t,r=(t=this._contentAreaDimensions)===null||t===void 0||(t=t[e])===null||t===void 0?void 0:t.highlightArea;if(r){var i;(i=this.layoutManager.dropTargetIndicator)===null||i===void 0||i.highlightArea(r)}this._dropSegment=e}}const Uc=Object.freeze(Object.defineProperty({__proto__:null,AbstractContentItem:ge,Component:ba,ContentItem:ge,Root:Ur,RowOrColumn:wn,Stack:Br,isComponent:Le,isRoot:ga,isStack:Ht},Symbol.toStringTag,{value:"Module"}));function lt(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 r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class In{constructor(e,t){var r;lt(this,"header",void 0),lt(this,"contentItem",void 0),lt(this,"element",T(In._template)),lt(this,"titleElement",void 0),lt(this,"closeElement",void 0),lt(this,"isActive",!1),lt(this,"_layoutManager",void 0),lt(this,"_dragListener",void 0),this.header=e,this.contentItem=t,this.titleElement=this.element.find(".lm_title"),this.closeElement=this.element.find(".lm_close_tab"),this.closeElement[t.config.isClosable?"show":"hide"](),this.setTitle(t.config.title),this.contentItem.on("titleChanged",this.setTitle,this),this._layoutManager=this.contentItem.layoutManager,(r=this._layoutManager.config.settings)!==null&&r!==void 0&&r.reorderEnabled&&t.config.reorderEnabled&&(this._dragListener=new On(this.element,this._layoutManager.root),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),Le(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),Le(this.contentItem)&&(this.contentItem.container._contentElement.off(),this.contentItem.container._contentElement[0].removeEventListener("click",this._onTabContentFocusIn,!0)),this._dragListener&&(this.contentItem.off("destroy",this._dragListener.destroy,this._dragListener),this._dragListener.off("dragStart",this._onDragStart),this._dragListener=void 0),this.element.remove()}_onDragStart(e,t){var r;(r=this.contentItem.parent)!==null&&r!==void 0&&r.isMaximised&&this.contentItem.parent.toggleMaximise(),this._dragListener&&new Kt(e,t,this._dragListener,this._layoutManager,this.contentItem,this.header.parent)}_onTabContentFocusIn(){T(".lm_focusin",this._layoutManager.root.element).removeClass("lm_focusin"),this.element.addClass("lm_focusin")}_onTabContentFocusOut(){Le(this.contentItem)&&!this.contentItem.container._contentElement[0].contains(document.activeElement)&&this.element.removeClass("lm_focusin")}_onTabClick(e){if(!e||e.button===0){var t,r=this.header.parent.getActiveContentItem();this.contentItem!==r&&Le(this.contentItem)?this.header.parent.setActiveContentItem(this.contentItem):Le(this.contentItem)&&!this.contentItem.container._contentElement[0].contains(document.activeElement)&&this.contentItem.container._contentElement.focus(),Le(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(),Le(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()}}lt(In,"_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=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=zc(n,"string");return typeof e=="symbol"?e:e+""}function zc(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class pt extends Oe{constructor(e,t){var r,i;super(),q(this,"layoutManager",void 0),q(this,"element",T(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",T(pt._nextButtonTemplate)),q(this,"tabPreviousButton",T(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,(r=this.layoutManager.config.settings)!==null&&r!==void 0&&r.selectionEnabled&&(this.element.addClass("lm_selectable"),this.element.on("click",this._onHeaderClick.bind(this))),this.tabsContainer=this.element.find(".lm_tabs"),this.tabDropdownContainer=this.element.find(".lm_tabdropdown_list"),this.tabDropdownContainer.hide(),this.tabDropdownSearch=this.element.find(".lm_tabdropdown_search input"),this._handleFilterInput=this._handleFilterInput.bind(this),this._handleFilterKeydown=this._handleFilterKeydown.bind(this),this.tabDropdownSearch.on("input",this._handleFilterInput),this.tabDropdownSearch.on("keydown",this._handleFilterKeydown),this.controlsContainer=this.element.find(".lm_controls"),this.parent=t,this.parent.on("resize",this._updateTabSizes,this),this._handleItemPickedUp=this._handleItemPickedUp.bind(this),this._handleItemDropped=this._handleItemDropped.bind(this),this._handleNextMouseEnter=this._handleNextMouseEnter.bind(this),this._handleNextMouseLeave=this._handleNextMouseLeave.bind(this),this._handlePreviousMouseEnter=this._handlePreviousMouseEnter.bind(this),this._handlePreviousMouseLeave=this._handlePreviousMouseLeave.bind(this),this._handleScrollRepeat=this._handleScrollRepeat.bind(this),this._handleNextButtonMouseDown=this._handleNextButtonMouseDown.bind(this),this._handlePreviousButtonMouseDown=this._handlePreviousButtonMouseDown.bind(this),this._handleScrollButtonMouseDown=this._handleScrollButtonMouseDown.bind(this),this._handleScrollButtonMouseUp=this._handleScrollButtonMouseUp.bind(this),this._handleScrollEvent=this._handleScrollEvent.bind(this),this.tabNextButton.on("mousedown",this._handleNextButtonMouseDown),this.tabPreviousButton.on("mousedown",this._handlePreviousButtonMouseDown),this.tabsContainer.on("scroll",this._handleScrollEvent),this.layoutManager.on("itemPickedUp",this._handleItemPickedUp),this.layoutManager.on("itemDropped",this._handleItemDropped),this.tabsContainer.before(this.tabPreviousButton),this.tabPreviousButton=this.tabPreviousButton.find(">:first-child"),this.tabPreviousButton.hide(),this._showAdditionalTabsDropdown=this._showAdditionalTabsDropdown.bind(this),this._hideAdditionalTabsDropdown=this._hideAdditionalTabsDropdown.bind(this),this._tabControlOffset=(i=this.layoutManager.config.settings)===null||i===void 0?void 0:i.tabControlOffset,this._createControls()}createTab(e,t){for(var r=0;r<this.tabs.length;r++)if(this.tabs[r].contentItem===e)return;var i=new In(this,e);if(this.tabs.length===0){this.tabs.push(i),this.tabsContainer.append(i.element);return}t===void 0&&(t=this.tabs.length),t>0?this.tabs[t-1].element.after(i.element):this.tabs[0].element.before(i.element),this.tabs.splice(t,0,i),this._updateTabSizes()}removeTab(e){for(var t=0;t<this.tabs.length;t++)if(this.tabs[t].contentItem===e){this.tabs[t]._$destroy(),this.tabs.splice(t,1);return}throw new Error("contentItem is not controlled by this header")}setActiveContentItem(e){for(var t,r,i,s,o=0;o<this.tabs.length;o++)s=this.tabs[o].contentItem===e,this.tabs[o].setActive(s),s===!0&&(this.activeContentItem=e,this.parent.config.activeItemIndex=o);(t=this.tabs[(i=this.parent.config.activeItemIndex)!==null&&i!==void 0?i:0].element.get(0))===null||t===void 0||(r=t.scrollIntoView)===null||r===void 0||r.call(t,{inline:"nearest"}),this._hideAdditionalTabsDropdown(),this._updateTabSizes(),this.parent.emitBubblingEvent("stateChanged")}position(e){var t=this.parent._header.show;return t&&!this.parent._side&&(t="top"),e!==void 0&&this.parent._header.show!==e&&(this.parent._header.show=e,this.parent._setupHeaderPosition()),t}_attachWheelListener(){var e;(e=this.tabsContainer.get(0))===null||e===void 0||e.addEventListener("wheel",this._handleWheelEvent,{passive:!0})}_detachWheelListener(){var e;(e=this.tabsContainer.get(0))===null||e===void 0||e.removeEventListener("wheel",this._handleWheelEvent)}_handleWheelEvent(e){var t=e.currentTarget;if(t instanceof HTMLElement){var r=Math.abs(e.deltaY)>Math.abs(e.deltaX)?e.deltaY:e.deltaX;if(e.deltaMode===WheelEvent.DOM_DELTA_PAGE){var i;r*=(i=this.tabsContainer.innerWidth())!==null&&i!==void 0?i:1}else e.deltaMode===WheelEvent.DOM_DELTA_LINE&&(r*=100/3);t.scrollLeft+=Math.round(r)}}_handleScrollEvent(){this._checkScrollArrows()}_handleItemPickedUp(){this.isDraggingTab=!0,this.isDropdownShown&&this._hideAdditionalTabsDropdown(),this.controlsContainer.on("mouseenter",this._handleNextMouseEnter),this.tabPreviousButton.on("mouseenter",this._handlePreviousMouseEnter)}_handleItemDropped(){var e;this.isDraggingTab=!1,window.cancelAnimationFrame((e=this.rAF)!==null&&e!==void 0?e:-1),this.rAF=null,this.controlsContainer.off("mouseenter",this._handleNextMouseEnter),this.controlsContainer.off("mouseleave",this._handleNextMouseLeave),this.tabPreviousButton.off("mouseenter",this._handlePreviousMouseEnter),this.tabPreviousButton.off("mouseleave",this._handlePreviousMouseLeave)}_handleNextMouseEnter(){var e;this.controlsContainer.on("mouseleave",this._handleNextMouseLeave),this._handleScrollRepeat(this.SCROLL_RIGHT,(e=this.tabsContainer.scrollLeft())!==null&&e!==void 0?e:0)}_handlePreviousMouseEnter(){var e;this.tabPreviousButton.on("mouseleave",this._handlePreviousMouseLeave),this._handleScrollRepeat(this.SCROLL_LEFT,(e=this.tabsContainer.scrollLeft())!==null&&e!==void 0?e:0)}_handleNextMouseLeave(){var e;window.cancelAnimationFrame((e=this.rAF)!==null&&e!==void 0?e:-1),this.rAF=null,this.controlsContainer.off("mouseleave",this._handleNextMouseLeave)}_handlePreviousMouseLeave(){var e;window.cancelAnimationFrame((e=this.rAF)!==null&&e!==void 0?e:-1),this.rAF=null,this.tabPreviousButton.off("mouseleave",this._handlePreviousMouseLeave)}_handleNextButtonMouseDown(){for(var e,t=0;t<this.tabs.length;t+=1){var r,i,s,o,a;if(((r=(i=this.tabs[t].element.get(0))===null||i===void 0?void 0:i.offsetLeft)!==null&&r!==void 0?r:0)>((s=(o=this.tabsContainer.get(0))===null||o===void 0?void 0:o.offsetWidth)!==null&&s!==void 0?s: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 r,i,s;if(((r=(i=this.tabs[t].element.get(0))===null||i===void 0?void 0:i.offsetLeft)!==null&&r!==void 0?r:0)<((s=this.tabsContainer.scrollLeft())!==null&&s!==void 0?s:0)){e=this.tabs[t].element.get(0);break}}if(e)e.scrollIntoView({behavior:"smooth",inline:"start"}),this._handleScrollButtonMouseDown(this.SCROLL_LEFT);else{var o=this.tabsContainer.get(0);o&&(o.scrollLeft=0)}}_handleScrollButtonMouseDown(e){this.holdTimer=window.setTimeout(()=>{var t;this._handleScrollRepeat(e,(t=this.tabsContainer.scrollLeft())!==null&&t!==void 0?t:0,100)},this.CLICK_TIMEOUT),window.addEventListener("mouseup",this._handleScrollButtonMouseUp)}_handleScrollButtonMouseUp(){var e,t;clearTimeout((e=this.holdTimer)!==null&&e!==void 0?e:-1),this.holdTimer=null,cancelAnimationFrame((t=this.rAF)!==null&&t!==void 0?t:-1),this.rAF=null,window.removeEventListener("mouseup",this._handleScrollButtonMouseUp)}_checkScrollArrows(){var e,t,r;this.tabsContainer.scrollLeft()===0?this.tabPreviousButton.first().prop("disabled",!0):((e=this.tabsContainer.scrollLeft())!==null&&e!==void 0?e:0)+((t=this.tabsContainer.innerWidth())!==null&&t!==void 0?t:0)===((r=this.tabsContainer.get(0))===null||r===void 0?void 0:r.scrollWidth)?this.tabNextButton.prop("disabled",!0):(this.tabNextButton.prop("disabled",!1),this.tabPreviousButton.first().prop("disabled",!1))}_handleScrollRepeat(e,t){var r,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,s=arguments.length>3?arguments[3]:void 0,o=this.tabsContainer.get(0);if(o){var a=o.getBoundingClientRect();if(e===this.SCROLL_LEFT){if(this.tabsContainer.scrollLeft(t-i),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+i),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)===o.scrollWidth){this._checkScrollArrows();return}}window.cancelAnimationFrame((r=this.rAF)!==null&&r!==void 0?r:-1),this.rAF=window.requestAnimationFrame(h=>{var p,m,v=s||h,f=h-v,g=this.START_SPEED*f+.5*this.ACCELERATION*(f*f);g=Math.min(g,(p=(m=this.tabsContainer.get(0))===null||m===void 0?void 0:m.scrollWidth)!==null&&p!==void 0?p:1/0),this._handleScrollRepeat(e,t,g,v)})}}_$setClosable(e){return this.closeButton&&this._isClosable()?(this.closeButton.element[e?"show":"hide"](),!0):!1}_$destroy(){this.emit("destroy",this);for(var e=0;e<this.tabs.length;e++)this.tabs[e]._$destroy();this._detachWheelListener(),this._handleItemDropped(),T(document).off("mouseup",this._hideAdditionalTabsDropdown),this.tabDropdownSearch.off("input",this._handleFilterInput),this.tabDropdownSearch.off("keydown",this._handleFilterKeydown),this.element.remove()}_getHeaderSetting(e){if(e in this.parent._header)return this.parent._header[e]}_createControls(){var e,t,r,i,s;if(s=this.layoutManager.config.labels.tabDropdown,this.layoutManager.config.labels.tabNextLabel,this.layoutManager.config.labels.tabPreviousLabel,this.tabDropdownButton=new vn(this,s,"lm_tabdropdown",this._showAdditionalTabsDropdown),this.tabDropdownButton.element.hide(),this.controlsContainer.prepend(this.tabNextButton),this.tabNextButton.hide(),this._getHeaderSetting("popout")&&(t=this._onPopoutClick.bind(this),r=this._getHeaderSetting("popout"),new vn(this,r,"lm_popout",t)),this._getHeaderSetting("maximise")){i=this.parent.toggleMaximise.bind(this.parent);var o=this._getHeaderSetting("maximise"),a=this._getHeaderSetting("minimise"),l=new vn(this,o,"lm_maximise",i);this.parent.on("maximised",function(){l.element.attr("title",a??"")}),this.parent.on("minimised",function(){l.element.attr("title",o??"")})}this._isClosable()&&(e=this.parent.remove.bind(this.parent),r=this._getHeaderSetting("close"),this.closeButton=new vn(this,r,"lm_close",e))}_showAdditionalTabsDropdown(){if(this.isDropdownShown){this._hideAdditionalTabsDropdown();return}this.tabDropdownList=this.tabsContainer.clone(!0).appendTo(this.tabDropdownContainer).children().removeClass("lm_active"),T(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"),T(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 r,i;e.preventDefault(),(r=this.tabDropdownList)===null||r===void 0||r.eq(this.dropdownKeyIndex).removeClass("lm_keyboard_active"),this.dropdownKeyIndex=t(this.dropdownKeyIndex,1,this.tabDropdownList),(i=this.tabDropdownList)===null||i===void 0||i.eq(this.dropdownKeyIndex).addClass("lm_keyboard_active")}else if(e.key==="ArrowUp"||e.key==="Tab"){var s,o;e.preventDefault(),(s=this.tabDropdownList)===null||s===void 0||s.eq(this.dropdownKeyIndex).removeClass("lm_keyboard_active"),this.dropdownKeyIndex=t(this.dropdownKeyIndex,-1,this.tabDropdownList),(o=this.tabDropdownList)===null||o===void 0||o.eq(this.dropdownKeyIndex).addClass("lm_keyboard_active")}}_handleFilterInput(e){if(this.tabDropdownList!=null){this.tabDropdownList.eq(this.dropdownKeyIndex).removeClass("lm_keyboard_active"),this.dropdownKeyIndex=-1;for(var t=0;t<this.tabDropdownList.length;t++){var r,i;((r=(i=this.tabs[t].contentItem.config.title)===null||i===void 0?void 0:i.toLowerCase().indexOf(e.target.value.toLowerCase()))!==null&&r!==void 0?r:-1)!==-1?(this.tabDropdownList.eq(t).css("display",""),this.dropdownKeyIndex===-1&&(this.dropdownKeyIndex=t)):this.tabDropdownList.eq(t).css("display","none")}this.dropdownKeyIndex!==-1&&this.tabDropdownList.eq(this.dropdownKeyIndex).addClass("lm_keyboard_active")}}_hideAdditionalTabsDropdown(e){var t,r;this.isDropdownShown&&(e&&(t=this.tabDropdownContainer.get(0))!==null&&t!==void 0&&t.contains(e.target)||e&&((r=this.tabDropdownButton)===null||r===void 0?void 0:r.element.get(0))===e.target||(this.element.removeClass("lm_dropdown_open"),this.tabDropdownContainer.hide(),this.isDropdownShown=!1,this.element.append(this.tabDropdownContainer),this.tabDropdownContainer.find(".lm_tabs").remove(),T(document).off("mousedown",this._hideAdditionalTabsDropdown)))}_updateAdditionalTabsDropdown(){var e,t,r,i;if(this.isDropdownShown&&!(!this.tabDropdownList||this.tabDropdownList.length==0)){var s=(e=(t=this.tabDropdownContainer.get(0))===null||t===void 0?void 0:t.scrollHeight)!==null&&e!==void 0?e:0;if(s!==0){var o=this.tabDropdownContainer[0].getBoundingClientRect(),a=(r=T(window).height())!==null&&r!==void 0?r:0,l=(i=T(window).width())!==null&&i!==void 0?i:0;if(this.tabDropdownButton){var d=this.tabDropdownButton.element[0].getBoundingClientRect(),h=s<a-d.bottom,p=!h&&d.bottom>a*.6,m=Math.min(d.left+(p?d.width:0),l-o.width-this.PADDING),v=p?Math.max(d.top-s,this.PADDING):d.bottom,f=a-v-this.PADDING;this.tabDropdownContainer.css({"max-height":f,top:v,left:m})}}}}_isClosable(){return!!(this.parent.config.isClosable&&this.layoutManager.config.settings.showCloseIcon)}_onPopoutClick(){if(this.layoutManager.config.settings.popoutWholeStack===!0)this.parent.popout();else{var e;(e=this.activeContentItem)===null||e===void 0||e.popout()}}_onHeaderClick(e){e.target===this.element[0]&&this.parent.select()}_updateTabSizes(){if(this.tabs.length!==0){var e=this.tabsContainer.get(0);if(this.isDropdownShown&&this._updateAdditionalTabsDropdown(),!!e){if(!this.isOverflowing&&e.scrollWidth>e.clientWidth){var t;(t=this.tabDropdownButton)===null||t===void 0||t.element.show(),this.tabNextButton.show(),this.tabPreviousButton.show(),this.isOverflowing=!0}else if(this.isOverflowing&&e.scrollWidth<=e.clientWidth){var r;(r=this.tabDropdownButton)===null||r===void 0||r.element.hide(),this.tabNextButton.hide(),this.tabPreviousButton.hide(),this.isOverflowing=!1}this.isOverflowing&&this._checkScrollArrows()}}}}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 mn(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 r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class ya{constructor(e,t,r){mn(this,"_isVertical",void 0),mn(this,"_size",void 0),mn(this,"_grabSize",void 0),mn(this,"_dragListener",void 0),mn(this,"element",void 0),this._isVertical=e,this._size=t,this._grabSize=r<t?t:r,this.element=this._createElement(),this._dragListener=new On(this.element)}on(e,t,r){var i;(i=this._dragListener)===null||i===void 0||i.on(e,t,r)}_$destroy(){var e;(e=this._dragListener)===null||e===void 0||e.destroy(),this._dragListener=null,this.element.remove()}_createElement(){var e=T('<div class="lm_drag_handle"></div>'),t=T('<div class="lm_splitter"></div>');t.append(e);var r=this._grabSize-this._size,i=r/2;return this._isVertical?(e.css("top",-i),e.css("height",this._size+r),t.addClass("lm_vertical"),t.height(this._size)):(e.css("left",-i),e.css("width",this._size+r),t.addClass("lm_horizontal"),t.width(this._size)),t}}const qc=Object.freeze(Object.defineProperty({__proto__:null,BrowserPopout:ma,DragProxy:Kt,DragSource:pa,DragSourceFromEvent:va,DropTargetIndicator:xn,Header:pt,HeaderButton:vn,Splitter:ya,Tab:In},Symbol.toStringTag,{value:"Module"}));var Xc={config:Xh,container:ec,controls:qc,errors:Dc,items:Uc,utils:pc};function ro(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function Ie(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?ro(Object(t),!0).forEach(function(r){Z(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):ro(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function Z(n,e,t){return(e=Zc(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Zc(n){var e=Yc(n,"string");return typeof e=="symbol"?e:e+""}function Yc(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var io=["column","row","stack","component"];class ii extends Oe{static isLayoutItemConfig(e){return io.includes(e.type)}static minifyConfig(e){return ni(e)}static unminifyConfig(e){return Fr(e)}constructor(e,t){super(),Z(this,"isInitialised",!1),Z(this,"_isFullPage",!1),Z(this,"_resizeTimeoutId",void 0),Z(this,"_components",{"lm-react-component":aa}),Z(this,"_fallbackComponent",void 0),Z(this,"_itemAreas",[]),Z(this,"_maximisedItem",null),Z(this,"_maximisePlaceholder",T('<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 la(this)),Z(this,"config",void 0),Z(this,"container",void 0),Z(this,"_originalContainer",void 0),Z(this,"dropTargetIndicator",null),Z(this,"tabDropPlaceholder",T('<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&&T("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 r=()=>{if(this._components[e]===void 0)throw new Error("Component "+e+" is not registered");delete this._components[e]};return r}setFallbackComponent(e){this._fallbackComponent=e}toConfig(e){if(this.isInitialised===!1)throw new Error("Can't create config, layout not yet initialised");if(e&&!(e instanceof ge))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:[]},r=function(o,a){for(var l in a.config)l!=="content"&&(o[l]=a.config[l]);if(o.componentName==="lm-react-component"&&(o.type="react-component"),a.contentItems.length){o.content=[];for(var d=0;d<a.contentItems.length;d++)o.content[d]={},r(o.content[d],a.contentItems[d])}};e?r(t,{contentItems:[e]}):r(t,this.root),this._$reconcilePopoutWindows(),t.openPopouts=[];for(var i=0;i<this.openPopouts.length;i++)t.openPopouts.push(this.openPopouts[i].toConfig());return t.maximisedItemId=this._maximisedItem?"__glMaximised":void 0,t}getComponent(e){return this._components[e]}getFallbackComponent(){return this._fallbackComponent}init(){if(this._subWindowsCreated===!1&&(this._createSubWindows(),this._subWindowsCreated=!0),document.readyState==="loading"||document.body===null){T(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 xn,this.updateSize(),this._create(this.config),this._bindEvents(),this.isInitialised=!0,this._adjustColumnsResponsive(),this.emit("initialised")}addReactChild(e,t){this._reactChildMap.set(e,t),this._reactChildren=[...this._reactChildMap.values()],this.emit("reactChildrenChanged")}removeReactChild(e,t){var r=this._reactChildMap.get(e);r===t&&(this._reactChildMap.delete(e),this._reactChildren=[...this._reactChildMap.values()],this.emit("reactChildrenChanged"))}getReactChildren(){return this._reactChildren}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 r,i;if(this.width=(r=e??this.container.width())!==null&&r!==void 0?r:0,this.height=(i=t??this.container.height())!==null&&i!==void 0?i:0,this.isInitialised===!0){if(this.root.callDownwards("setSize",[this.width,this.height]),this._maximisedItem){var s,o;this._maximisedItem.element.width((s=this.container.width())!==null&&s!==void 0?s:0),this._maximisedItem.element.height((o=this.container.height())!==null&&o!==void 0?o:0),this._maximisedItem.callDownwards("setSize")}this._adjustColumnsResponsive()}}destroy(){var e;this.isInitialised===!1||!this.root||(this._onUnload(),T(window).off("resize",this._onResize),T(window).off("unload beforeunload",this._onUnload),T(window).off("blur.lm").off("focus.lm"),T(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 r,i;if(typeof e.type!="string")throw new Rt("Missing parameter 'type'",e);if(e.type==="react-component"&&(e.type="component",e.componentName="lm-react-component"),!ii.isLayoutItemConfig(e))throw i="Unknown type '"+e.type+"'. Valid types are "+io.join(","),new Rt(i);return e.type==="component"&&!(t instanceof Br)&&t&&!(this.isSubWindow===!0&&t instanceof Ur)&&(e={type:"stack",width:e.width,height:e.height,content:[e]}),e.id=(r=e.id)!==null&&r!==void 0?r:Xn(),e.type==="stack"?new Br(this,e,t):e.type==="row"?new wn(!1,this,e,t):e.type==="column"?new wn(!0,this,e,t):new ba(this,e,t)}createPopout(e,t,r,i){var s=[],o=e instanceof ge,a=this;if(o){var l;s=this.toConfig(e).content,r=Xn();for(var d=e.parent,h=e;((p=d)===null||p===void 0?void 0:p.contentItems.length)===1&&!d.isRoot;){var p;h=d,d=d.parent}if((l=d)===null||l===void 0||l.addId(r),i==null||Number.isNaN(i)){var m;i=(m=d)===null||m===void 0?void 0:m.contentItems.indexOf(h)}}else e instanceof Array?s=e:s=[e];if(!t&&o){var v,f,g,b=window.screenX||window.screenLeft,S=window.screenY||window.screenTop,w=(v=e.element.offset())!==null&&v!==void 0?v:{left:0,top:0};t={left:b+w.left,top:S+w.top,width:(f=e.element.width())!==null&&f!==void 0?f:0,height:(g=e.element.height())!==null&&g!==void 0?g:0}}if(!t&&!o&&(t={left:window.screenX||window.screenLeft+20,top:window.screenY||window.screenTop+20,width:500,height:309}),o&&e.remove(),!(!t||!r||i===void 0)){var y=new ma(s,t,r,i,this);return y.on("initialised",function(){a.emit("windowOpened",y)}),y.on("closed",function(){a._$reconcilePopoutWindows()}),this.openPopouts.push(y),y}}createDragSource(e,t){this.config.settings.constrainDragToContainer=!1;var r=new pa(e,t,this);return this._dragSources.push(r),r}createDragSourceFromEvent(e,t){return this.config.settings.constrainDragToContainer=!1,new va(e,this,t)}selectItem(e,t){if(this.config.settings.selectionEnabled!==!0)throw new Error("Please set selectionEnabled to true to use this feature");e!==this.selectedItem&&(this.selectedItem!==null&&this.selectedItem.deselect(),e&&t!==!0&&e.select(),this.selectedItem=e,this.emit("selectionChanged",e))}_$maximiseItem(e){var t,r;this._maximisedItem!==null&&this._$minimiseItem(this._maximisedItem),this._maximisedItem=e,this._maximisedItem.addId("__glMaximised"),e.element.addClass("lm_maximised"),e.element.after(this._maximisePlaceholder),this.root.element.prepend(e.element),e.element.width((t=this.container.width())!==null&&t!==void 0?t:0),e.element.height((r=this.container.height())!==null&&r!==void 0?r:0),e.callDownwards("setSize"),this._maximisedItem.emit("maximised"),this.emit("stateChanged")}_$minimiseItem(e){var t;e.element.removeClass("lm_maximised"),e.removeId("__glMaximised"),this._maximisePlaceholder.after(e.element),this._maximisePlaceholder.remove(),(t=e.parent)===null||t===void 0||t.callDownwards("setSize"),this._maximisedItem=null,e.emit("minimised"),this.emit("stateChanged")}_$closeWindow(){window.setTimeout(function(){window.close()},1)}_$getArea(e,t){for(var r=1/0,i=null,s=0;s<this._itemAreas.length;s++){var o=this._itemAreas[s];e>o.x1&&e<o.x2&&t>o.y1&&t<o.y2&&r>o.surface&&(r=o.surface,i=o)}return i}_$createRootItemAreas(){var e=50,t=Ie({},this.root._$getArea()),r=[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})];r.forEach(i=>{i.surface=(i.x2-i.x1)*(i.y2-i.y1)}),this._itemAreas.push(...r)}_$calculateItemAreas(){var e=this._getAllContentItems();if(this._itemAreas=[],e.length===1){this._itemAreas.push(this.root._$getArea());return}this._$createRootItemAreas();for(var t=0;t<e.length;t++){var r=e[t];if(Ht(r)){var i=r._$getArea();if(i!==null)if(i instanceof Array)this._itemAreas=this._itemAreas.concat(i);else{var s;this._itemAreas.push(i);var o=Ie(Ie({},i),(s=i.contentItem._contentAreaDimensions)===null||s===void 0?void 0:s.header.highlightArea);o.surface=(o.x2-o.x1)*(o.y2-o.y1),this._itemAreas.push(o)}}}}_$normalizeContentItem(e,t){if(!e)throw new Error("No content item defined");if(typeof e=="function"&&(e=e()),e instanceof ge)return e;if(T.isPlainObject(e)&&e.type){var r=this.createContentItem(e,t??null);return r.callDownwards("_$init"),r}else throw new Error("Invalid contentItem")}_$reconcilePopoutWindows(){for(var e=[],t=0;t<this.openPopouts.length;t++){var r;((r=this.openPopouts[t].getWindow())===null||r===void 0?void 0:r.closed)===!1?e.push(this.openPopouts[t]):this.emit("windowClosed",this.openPopouts[t])}this.openPopouts.length!==e.length&&(this.emit("stateChanged"),this.openPopouts=e)}_getAllContentItems(){var e=[],t=r=>{if(e.push(r),r.contentItems instanceof Array)for(var i=0;i<r.contentItems.length;i++)t(r.contentItems[i])};return t(this.root),e}_bindEvents(){this._isFullPage&&T(window).resize(this._onResize),T(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,r=sa("gl-window");r&&(this.isSubWindow=!0,e=JSON.parse(localStorage.getItem(r)||"{}"),e=Fr(e),localStorage.removeItem(r)),e=T.extend(!0,{},na,e);var i=function(o){for(var a in o){var l=o[a];a!=="props"&&typeof l=="object"&&l!=null?i(l):a==="type"&&l==="react-component"&&(o.type="component",o.componentName="lm-react-component")}};return i(e),((t=e.settings)===null||t===void 0?void 0:t.hasHeaders)===!1&&(e.dimensions.headerHeight=0),e}_adjustToWindowMode(){var e,t=T('<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=ti((e=this.config.content[0].title)!==null&&e!==void 0?e:""),T("head").append(T("body link, body style, template, .gl_keep")),this.container=T("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?T(this._originalContainer):T("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,T("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 Rt(t,e);if(e.content.length>1)throw t="Top level content can't contain more then one element.",new Rt(t,e);this.root=new Ur(this,{content:e.content},this.container),this.root.callDownwards("_$init"),e.maximisedItemId==="__glMaximised"&&this.root.getItemsById(e.maximisedItemId)[0].toggleMaximise()}_onUnload(){if(this.config.settings.closePopoutsOnUnload===!0)for(var e=0;e<this.openPopouts.length;e++)this.openPopouts[e].close()}_adjustColumnsResponsive(){if(!this._useResponsiveLayout()||this._updatingColumnsResponsive||!this.config.dimensions||!this.config.dimensions.minItemWidth||this.root.contentItems.length===0||!this.root.contentItems[0].isRow){this._firstLoad=!1;return}this._firstLoad=!1;var e=this.root.contentItems[0].contentItems.length;if(!(e<=1)){var t=this.config.dimensions.minItemWidth,r=e*t;if(!(this.width==null||r<=this.width)){this._updatingColumnsResponsive=!0;for(var i=Math.max(Math.floor(this.width/t),1),s=e-i,o=this.root.contentItems[0],a=this._findAllStackContainers()[0],l=0;l<s;l++){var d=o.contentItems[o.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(r){e.addChild(r),t.removeChild(r,!0)}):t.contentItems.forEach(r=>{this._addChildContentItemsToContainer(e,r)})}_findAllStackContainers(){var e=[];return this._findAllStackContainersRecursive(e,this.root),e}_findAllStackContainersRecursive(e,t){t.contentItems.forEach(r=>{Ht(r)?e.push(r):r.isComponent||this._findAllStackContainersRecursive(e,r)})}}Z(ii,"__lm",Xc);const oo={"tab-height":"28px","drag-border-width":"5px"},so=Object.freeze({tabHeight:parseInt(oo["tab-height"],10),dragBorderWidth:parseInt(oo["drag-border-width"],10)});function ao(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function st(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?ao(Object(t),!0).forEach(function(r){Ca(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):ao(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function Ca(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=Qc(n,"string");return typeof e=="symbol"?e:e+""}function Qc(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var Ct=R.module("LayoutUtils");function wa(n){return n.componentName!==void 0}function Et(n){var e=n;return(wa(n)&&n.componentName==="lm-react-component"||n.type==="react-component")&&e.component!==void 0}function Rn(n){return n.focus!==void 0}function lo(n){return n.type==="stack"}class E{static activateTab(e,t){var r=E.getStackForRoot(e,t,!1);if(!r){Ct.error("Could not find stack for config",t);return}var i=E.getContentItemInStack(r,t);i&&r.setActiveContentItem(i)}static isActiveTab(e,t){var r=E.getStackForRoot(e,t,!1);if(!r)return Ct.error("Could not find stack for config",t),!1;var i=E.getContentItemInStack(r,t),s=r.getActiveContentItem();return s===i}static addStack(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;if(ga(e)){var r={type:t?"column":"row"};(e.contentItems==null||e.contentItems.length===0)&&e.addChild(r);var i=e.contentItems[0],s=t?i.isColumn:i.isRow;if(!s){e.removeChild(i,!0),e.addChild(r);var o=document.activeElement;e.contentItems[0].addChild(i),o&&o.focus!=null&&o.focus()}return this.addStack(e.contentItems[0],t)}if(e.contentItems.length<2)return e.addChild({type:"stack"}),e.contentItems[e.contentItems.length-1];var a=e.contentItems[e.contentItems.length-1],l=t?a.isRow:a.isColumn;if(!l){var d,h,p=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,p),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(r=>r.element[0].classList.contains("lm_focusin")))}static getFocusedStack(e){var t=E.getAllStackContainers(e),r=E.getFocusedStackIndex(t);return t[r]}static getStackById(e,t){var r,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;if(i&&Ht(e)&&e.contentItems.length===0)return e;if(t===((r=e.config)===null||r===void 0?void 0:r.id)){if(Ht(e))return e;throw new Error("Item with ID ".concat(t," is not a stack"))}if(e.contentItems==null)return null;for(var s=0;s<e.contentItems.length;s+=1){var o=this.getStackById(e.contentItems[s],t,i);if(o)return o}return null}static getContentItemById(e,t){var r;if(((r=e.config)===null||r===void 0?void 0:r.id)===t)return e;if(e.contentItems==null)return null;for(var i=0;i<e.contentItems.length;i+=1){var s=this.getContentItemById(e.contentItems[i],t);if(s)return s}return null}static getStackForConfig(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;if(r&&Ht(e)&&e.contentItems.length===0)return e;if(e.contentItems==null)return null;for(var i=0;i<e.contentItems.length;i+=1){var s=e.contentItems[i];if(s.isComponent&&s.config!=null&&pi(s.config,t))return e;var o=this.getStackForConfig(s,t,r);if(o)return o}return null}static getStackForRoot(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,s=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,o=this.getStackForConfig(e,t);return!o&&i&&(o=this.getStackForConfig(e,{component:t.component},s)),!o&&r&&(o=this.addStack(e)),o}static getStackForComponentTypes(e,t){for(var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,s=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,o=0;o<t.length;o+=1){var a=t[o],l=o===t.length-1,d=E.getStackForRoot(e,{component:a},r&&l,i,s);if(d)return d}return null}static getContentItemInStack(e,t){if(!e)return null;for(var r=0;r<e.contentItems.length;r+=1){var i=e.contentItems[r];if(i.isComponent&&i.config!=null&&pi(i.config,t))return i}return null}static dehydrateLayoutConfig(e,t){if(e==null||!e.length)return[];for(var r=[],i=0;i<e.length;i+=1){var s=e[i],{content:o}=s;if(Et(s)){var a=t(s.component,s);a!=null?r.push(a):Ct.debug2('dehydrateLayoutConfig: skipping unmapped component "'.concat(s.component,'"'))}else if(o){var l=st(st({},s),{},{content:E.dehydrateLayoutConfig(o,t)});r.push(l)}else r.push(s)}return r}static getTabPoint(e){var{tab:t}=e;if(t==null)throw new Error("Cannot get tab for panel container ".concat(e));var r=t.element[0].getBoundingClientRect();return[r.left+r.width*.5,r.bottom-8]}static dropLayoutMinorChange(e){for(var t=0;t<e.length;t+=1){var r=e[t],{content:i}=r;i!==void 0?(lo(r)&&delete r.activeItemIndex,E.dropLayoutMinorChange(i)):Et(r)&&r.component==="IrisGridPanel"&&r.props.panelState!=null&&(delete r.id,r.props.panelState.irisGridState.sorts=[],r.props.panelState.irisGridState.quickFilters=[],r.props.panelState.gridState.isStuckToBottom=!1,r.props.panelState.gridState.isStuckToRight=!1)}}static isEqual(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,i=E.cloneLayout(e),s=E.cloneLayout(t);return r?(E.dropLayoutMinorChange(i),E.dropLayoutMinorChange(s),Ir(i,s)):Ir(i,s)}static cloneLayout(e){return JSON.parse(JSON.stringify(e))}static hydrateLayoutConfig(e,t){if(e==null||!e.length)return[];for(var r=[],i=0;i<e.length;i+=1){var s=e[i];if(Et(s)){var o,{component:a,props:l={}}=s;r.push(st(st({},s),{},{id:(o=s==null?void 0:s.id)!==null&&o!==void 0?o:ct(),props:t(a,l)}))}else if(s.content!==void 0){var d=E.hydrateLayoutConfig(s.content,t);lo(s)&&s.activeItemIndex!=null&&s.activeItemIndex>=d.length&&(Ct.warn("Fixing bad activeItemIndex!",s.activeItemIndex,s),s.activeItemIndex=0),r.push(st(st({},s),{},{content:d}))}else r.push(s)}return r}static openComponent(){var{root:e,config:t,stack:r=void 0,replaceExisting:i=!0,replaceConfig:s=void 0,createNewStack:o=!1,focusElement:a=void 0,dragEvent:l=void 0}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},d=document.activeElement,h=st({},t);if(h.id==null&&(h.id=ct()),l!=null){e==null||e.layoutManager.createDragSourceFromEvent(h,l);return}var p=s||{id:h.id,component:h.component};L(e);var m=r??(o?E.addStack(e):E.getStackForRoot(e,p));L(m);var v=E.getContentItemInStack(m,p);if(a!=null){var f=b=>{Ct.debug("Component created, focusing element",a),m.off("componentCreated",f);var{element:S}=b.origin;requestAnimationFrame(()=>{E.focusElement(S[0],a)})};m.on("componentCreated",f)}if(i&&v){var g=m.contentItems.indexOf(v);m.addChild(h,g+1),m.removeChild(v),m.setActiveContentItem(m.contentItems[g])}else m.addChild(h);a==null&&d&&Rn(d)&&d.focus()}static openComponentInStack(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,i=document.activeElement,s={id:t.id},o=E.getContentItemInStack(e,s);if(r&&o&&e){var a=e==null?void 0:e.contentItems.indexOf(o);e.addChild(t,a+1),e.removeChild(o),e.setActiveContentItem(e.contentItems[a])}else e==null||e.addChild(t);i&&Rn(i)&&i.focus()}static closeComponent(e,t,r){var i=E.getStackForRoot(e,t,!1,!1,!1);if(!i){Ct.warn("Cannot find stack for component, ignoring close",t);return}var s=E.getContentItemInStack(i,t),o=document.activeElement;s&&(Le(s)?s.container.close(r):i.removeChild(s)),o&&document.contains(o)&&Rn(o)&&o.focus()}static renameComponent(e,t,r){var i=E.getStackForRoot(e,t,!1);if(!i){Ct.error("Could not find stack for config",t);return}var s=E.getContentItemInStack(i,t);s&&s.setTitle(r)}static cloneComponent(e,t){var r=E.getStackForRoot(e,t,!1);if(!r)return Ct.error("Could not find stack for config",t),null;var{props:i={}}=t,s=E.getPanelComponentState(t),o={type:"react-component",component:t.component,props:st(st({},i),{},{panelState:s}),title:"".concat(t.title," Copy"),id:ct()};return E.openComponentInStack(r,o),o}static getPanelComponentState(e){if(wa(e)){var t;return(t=e.componentState)===null||t===void 0?void 0:t.panelState}if(Et(e)){var r;return(r=e.props)===null||r===void 0?void 0:r.panelState}return null}static makeDefaultLayout(){return{dimensions:{headerHeight:so.tabHeight,borderWidth:so.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,r=E.getComponentConfigFromContainer(t);if(r&&Et(r)){var i;return(i=r.component)!==null&&i!==void 0?i:null}return null}static getComponentName(e){var t,r,i=(t=(r=e.WrappedComponent)===null||r===void 0?void 0:r.displayName)!==null&&t!==void 0?t:e.displayName;if(i==null)throw new Error("Component displayName not defined ".concat(e));return i}static focusElement(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:E.DEFAULT_FOCUS_SELECTOR;if(e==null)return null;var r=e.querySelector(t);return r==null?null:(Rn(r)&&r.focus(),r)}static onInitialized(e){return new Promise(t=>{if(e.isInitialised){t();return}var r=()=>{e.off("initialised",r),t()};e.on("initialised",r)})}}Ca(E,"DEFAULT_FOCUS_SELECTOR","input, select, textarea, button");var em=O.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.']})})});em.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:Eg,emit:tm,useListener:Pg}=It(Y.OPEN),dr=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:nm,emit:Tg,useListener:Og}=It(dr.CYCLE_TO_NEXT_STACK),{listen:rm,emit:xg,useListener:Ig}=It(dr.CYCLE_TO_PREVIOUS_STACK),{listen:im,emit:Dg,useListener:Mg}=It(dr.CYCLE_TO_NEXT_TAB),{listen:om,emit:kg,useListener:jg}=It(dr.CYCLE_TO_PREVIOUS_TAB);function uo(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function ho(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?uo(Object(t),!0).forEach(function(r){ut(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):uo(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function ut(n,e,t){return(e=sm(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function sm(n){var e=am(n,"string");return typeof e=="symbol"?e:e+""}function am(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var Ue=R.module("PanelManager"),Nt=function(n){return n[n.Next=0]="Next",n[n.Previous=1]="Previous",n}(Nt||{});class Sa{constructor(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:(a,l)=>l,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:(a,l)=>l,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:new Map,s=arguments.length>4&&arguments[4]!==void 0?arguments[4]:[],o=arguments.length>5&&arguments[5]!==void 0?arguments[5]:()=>{};ut(this,"layout",void 0),ut(this,"hydrateComponent",void 0),ut(this,"dehydrateComponent",void 0),ut(this,"onPanelsUpdated",void 0),ut(this,"closed",void 0),ut(this,"openedMap",void 0),ut(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=r,this.onPanelsUpdated=o,this.openedMap=new Map(i),this.closed=[...s],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(nm(e,this.handleCycleToNextStack)),this.navigationEventListenerRemovers.push(rm(e,this.handleCycleToPreviousStack)),this.navigationEventListenerRemovers.push(im(e,this.handleCycleToNextTab)),this.navigationEventListenerRemovers.push(om(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&&Et(t)&&t.component===e)}getOpenedPanelById(e){return this.openedMap.get(e)}getContainerByPanelId(e){var t,r=E.getStackForConfig(this.layout.root,{id:e});return(t=r&&E.getContentItemInStack(r,{id:e}))!==null&&t!==void 0?t:null}getLastUsedPanel(e){for(var t=this.getOpenedPanels(),r=t.length-1;r>=0;r-=1){var i=t[r];if(e==null||e(i))return i}}getLastUsedPanelOfType(e){return this.getLastUsedPanelOfTypes([e])}getLastUsedPanelOfTypes(e){return this.getLastUsedPanel(t=>e.some(r=>qn(r)&&t instanceof r.WrappedComponent||!qn(r)&&t instanceof r))}updatePanel(e){var t=E.getIdFromPanel(e);if(t==null){Ue.error("updatePanel Panel did not have an ID",e);return}Ue.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){Ue.error("removePanel Panel did not have an ID",e);return}if(!this.openedMap.has(t)){Ue.error("Missing panel ID ".concat(t," in open panels map"));return}if(this.openedMap.get(t)!==e){Ue.debug("Panel argument doesn't match the open panels map entry for ".concat(t,", removePanel ignored"));return}Ue.debug2("Removing panel ID ".concat(t," from open panels map")),this.openedMap.delete(t)}removeClosedPanelConfig(e){var t=this.closed.findIndex(r=>r===e||r.id!=null&&e.id!=null&&r.id===e.id);t>=0&&this.closed.splice(t,1)}handleFocus(e){Ue.debug2("Focus: ",e),this.updatePanel(e)}handleMount(e){Ue.debug2("Mount: ",e),this.updatePanel(e),this.sendUpdate()}handleUnmount(e){Ue.debug2("Unmount: ",e),this.removePanel(e),this.sendUpdate()}cycleStack(e){var t=E.getAllStackContainers(this.layout);if(!(t.length<=1)){var r=E.getFocusedStackIndex(t);if(r===-1){var i=t[0],s=i.config.activeItemIndex,o=s!=null?i.contentItems[s]:i.contentItems[0];i.setActiveContentItem(o,!0);return}var a=e===Nt.Next?(r+1)%t.length:(r-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(Nt.Next)}handleCycleToPreviousStack(){this.cycleStack(Nt.Previous)}cycleTab(e){var t,r=E.getFocusedStack(this.layout);if(r!==void 0){var{contentItems:i}=r;if(!(i.length<=1)){var s=(t=r.config.activeItemIndex)!==null&&t!==void 0?t:0,o=e===Nt.Next?(s+1)%i.length:(s-1+i.length)%i.length,a=i[o];r.setActiveContentItem(a,!0)}}}handleCycleToNextTab(){this.cycleTab(Nt.Next)}handleCycleToPreviousTab(){this.cycleTab(Nt.Previous)}handleReopen(e,t){Ue.debug2("Reopen:",e,t),this.removeClosedPanelConfig(e);var{component:r}=e,{props:i}=e;i=this.hydrateComponent(r,i);var s=ho(ho({},e),{},{props:i}),{root:o}=this.layout,a=e.parentStackId===void 0?void 0:E.getStackById(o,e.parentStackId);E.openComponent({root:o,config:s,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 r=(t=E.getStackForConfig(this.layout.root,e.getConfig()))===null||t===void 0?void 0:t.config.id,i=this.closed.length-1;i>=0;i-=1){var s=this.closed[i];if(s.parentStackId===r){this.handleReopen(s);return}}}}handleDeleted(e){Ue.debug2("Deleted:",e),this.removeClosedPanelConfig(e),this.sendUpdate()}handleClosed(e,t){Ue.debug2("Closed: ",e),this.addClosedPanel(t),this.sendUpdate()}handleControlClose(e){var t={id:e},{root:r}=this.layout;E.closeComponent(r,t)}addClosedPanel(e){var t=E.getComponentConfigFromContainer(e);if(t&&Et(t)){var r=this.dehydrateComponent(t.component,t);if(r!=null){var i;r.parentStackId=(i=e.tab)===null||i===void 0?void 0:i.header.parent.config.id,this.closed.push(r)}}}sendUpdate(){var{closed:e,openedMap:t}=this;this.onPanelsUpdated({closed:[...e],openedMap:new Map(t)})}}ut(Sa,"MAX_CLOSED_PANEL_COUNT",100);var lm=R.module("PanelErrorBoundary");class dm extends c.Component{constructor(e){super(e),this.state={error:null}}componentDidCatch(e){this.setState({error:e})}componentWillUnmount(){var{glContainer:e,glEventHub:t}=this.props,r=E.getIdFromContainer(e);lm.debug("componentWillUnmount",r),t.emit(Y.CLOSED,r,e)}render(){var{children:e}=this.props,{error:t}=this.state;return t!=null?u.jsx("div",{className:"panel-error-boundary",children:u.jsx(_n,{"data-testid":"panel-error-boundary-loading-error",errorMessage:"".concat(t),isLoading:!1,isLoaded:!1})}):e??null}}function co(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function Yn(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?co(Object(t),!0).forEach(function(r){um(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):co(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function um(n,e,t){return(e=hm(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function hm(n){var e=cm(n,"string");return typeof e=="symbol"?e:e+""}function cm(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function _a(n){var{props:e,componentState:t}=n,{metadata:r}=e,{panelState:i=null}=e;t&&({panelState:i}=t);var s={};return r!=null&&(s.metadata=r),i!=null&&(s.panelState=i),Yn(Yn({},n),{},{componentState:null,props:s,type:"react-component"})}function Ea(n,e){return Yn(Yn({},n),{},{localDashboardId:e})}const Ng={dehydrate:_a,hydrate:Ea};var Pa=O.createContext(void 0);Pa.displayName="LayoutManagerContext";var mm=ae.shape({on:ae.func,off:ae.func,isHidden:ae.bool,tab:ae.shape({header:ae.shape({tabs:ae.arrayOf(ae.shape({contentItem:ae.shape({})}))})}),title:ae.string,setTitle:ae.func,close:ae.func}),Ta=ae.shape({on:ae.func,off:ae.func,emit:ae.func}),pm=ae.shape({registerComponent:ae.func,root:ae.shape({addChild:ae.func}),on:ae.func,off:ae.func,eventHub:Ta}),Ag=Object.freeze({Container:mm,EventHub:Ta,Layout:pm});function Gt(n,e,t){c.useEffect(function(){return n.on(e,t),()=>{n.off(e,t)}},[n,e,t])}var Oa="SET_DASHBOARD_DATA";const vm=ch(Oa,{},!1),fm={dashboardData:vm};var gm=new Map,xa=Object.freeze({}),bm=Object.freeze([]),Lg=ws,Rg=Cs,Fg=Ul,ym=n=>n.dashboardData,Ce=(n,e)=>{var t;return(t=ym(n)[e])!==null&&t!==void 0?t:xa},Hg=(n,e)=>{var t;return(t=Ce(n,e).closed)!==null&&t!==void 0?t:bm},$g=(n,e)=>{var t;return(t=Ce(n,e).openedMap)!==null&&t!==void 0?t:gm},Ia=(n,e)=>{var t;return(t=Ce(n,e).pluginDataMap)!==null&&t!==void 0?t:xa},Ug=(n,e,t)=>Ia(n,e)[t];function mo(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function Jt(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?mo(Object(t),!0).forEach(function(r){Cm(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):mo(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function Cm(n,e,t){return(e=wm(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function wm(n){var e=Sm(n,"string");return typeof e=="symbol"?e:e+""}function Sm(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var Da=(n,e)=>({type:Oa,id:n,payload:e}),_m=(n,e)=>(t,r)=>t(Da(n,Jt(Jt({},Ce(r(),n)),e))),Bg=(n,e,t)=>(r,i)=>r(Da(n,Jt(Jt({},Ce(i(),n)),{},{pluginDataMap:Jt(Jt({},Ia(i(),n)),{},{[e]:t})})));Object.entries(fm).map(n=>{var[e,t]=n;return fh.register(e,t)});function Em(n){var{children:e}=n;return u.jsx(u.Fragment,{children:e})}var oi=c.createContext(null);oi.displayName="PanelIdContext";function Pm(){return c.useContext(oi)}function po(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function pn(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?po(Object(t),!0).forEach(function(r){Tm(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):po(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function Tm(n,e,t){return(e=Om(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Om(n){var e=xm(n,"string");return typeof e=="symbol"?e:e+""}function xm(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var Fn=R.module("DashboardLayout"),Im=Object.freeze({}),Dm=[],vo=()=>{},Mm=1e3,fo=n=>n;function Kg(n){var e,t,{id:r,children:i,emptyDashboard:s=u.jsx("div",{className:"dashboard-empty",children:"Dashboard is empty."}),layout:o,layoutConfig:a=Dm,onLayoutChange:l=vo,onLayoutInitialized:d=vo,hydrate:h=Ea,dehydrate:p=_a,panelWrapper:m=Em}=n,v=ws(),f=(e=Cs(x=>Ce(x,r)))!==null&&e!==void 0?e:Im,[g,b]=c.useState(!1),[S,w]=c.useState(!1),[y,D]=c.useState(),[V]=c.useState((t=f==null?void 0:f.closed)!==null&&t!==void 0?t:[]),[X,G]=c.useState(o.getReactChildren()),A=c.useMemo(()=>new Map,[]),M=c.useMemo(()=>new Map,[]),J=c.useCallback(function(x,Q){var oe,hn=arguments.length>2&&arguments[2]!==void 0?arguments[2]:h,gt=arguments.length>3&&arguments[3]!==void 0?arguments[3]:p;Fn.debug2("registerComponent",x,Q,hn,gt);function kn(K,ne){var pe=Q,je=m,Mt=Rs(pe),{glContainer:Wt,glEventHub:Xa}=K,Za=E.getIdFromContainer(Wt);return u.jsx(dm,{glContainer:Wt,glEventHub:Xa,children:u.jsx(oi.Provider,{value:Za,children:u.jsx(je,pn(pn({},K),{},{children:Mt?u.jsx(pe,pn(pn({},K),{},{ref:ne})):u.jsx(pe,pn({},K))}))})})}kn.displayName="DashboardWrapper(".concat((oe=Q.displayName)!==null&&oe!==void 0?oe:x,")");var P=o.registerComponent(x,O.forwardRef(kn));return A.set(x,hn),M.set(x,gt),P},[h,p,A,M,o,m]),W=c.useCallback((x,Q)=>{var oe;return((oe=A.get(x))!==null&&oe!==void 0?oe:fo)(Q,r)},[A,r]),k=c.useCallback((x,Q)=>{var oe;return((oe=M.get(x))!==null&&oe!==void 0?oe:fo)(Q,r)},[M,r]),z=c.useMemo(()=>new Sa(o,W,k,new Map,V,x=>{var{closed:Q,openedMap:oe}=x;v(_m(r,{closed:Q,openedMap:oe}))}),[k,v,W,r,V,o]),F=Nd(x=>{var Q=y==null||!E.isEqual(y,x);Fn.debug("handleLayoutStateChanged",Q,x),Q&&(b(o.root.contentItems.length===0),D(x),l(x),G(o.getReactChildren()))},Mm,{flushOnUnmount:!0});c.useEffect(()=>()=>F.flush(),[F]);var j=c.useCallback(()=>{if(!S){var x=o.toConfig(),Q=x.content,oe=E.dehydrateLayoutConfig(Q,k);F(oe)}},[k,S,o,F]),H=c.useCallback(x=>{var Q=E.getIdFromContainer(x);o.eventHub.emit(Y.DRAGGING,Q),w(!0)},[o.eventHub]),U=c.useCallback(x=>{var Q=E.getIdFromContainer(x);o.eventHub.emit(Y.DROPPED,Q),w(!1)},[o.eventHub]),ce=c.useCallback(x=>{if(Fn.debug2("handleComponentCreated",x),!(x==null||x.config==null||!Et(x.config)||x.config.component==null||x.element==null)){var Q=x.config.component.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),oe="".concat(Q,"-component");x.element.addClass(oe)}},[]),tt=c.useCallback(()=>{G(o.getReactChildren())},[o]);Gt(o,"stateChanged",j),Gt(o,"itemPickedUp",H),Gt(o,"itemDropped",U),Gt(o,"componentCreated",ce),Gt(o.eventHub,Y.TITLE_CHANGED,j),Gt(o,"reactChildrenChanged",tt);var Ge=jd(a);return c.useEffect(function(){if(Ge!==a&&a!==y){Fn.debug("Setting new layout content...");for(var Q=E.hydrateLayoutConfig(a,W);o.root.contentItems.length>0;)o.root.contentItems[0].remove();for(var oe=0;oe<Q.length;oe+=1)o.root.addChild(Q[oe]);b(o.root.contentItems.length===0)}},[W,o,a,y,z,Ge]),c.useEffect(()=>d(),[]),u.jsxs(u.Fragment,{children:[g&&s,X,O.Children.map(i,x=>x!=null?u.jsx(Ou,{fallback:[],children:O.cloneElement(x,{id:r,layout:o,panelManager:z,registerComponent:J})}):null)]})}var Ma=c.createContext(null);Ma.displayName="DashboardIdContext";function Wg(){var n=c.useContext(Ma);if(n==null)throw new Error("useDashboardId must be used within a DashboardIdContext provider");return n}function km(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 r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function ka(n,e,t){if(n){if(t(n)===!0)return n;for(var r=n.child;r;){var i=ka(r,e,t);if(i)return i;r=r.sibling}}}function Am(n){try{return Object.defineProperties(n,{_currentRenderer:{get(){return null},set(){}},_currentRenderer2:{get(){return null},set(){}}})}catch{return n}}var si=Am(c.createContext(null));si.displayName="FiberContext";class zg extends c.Component{constructor(){super(...arguments),km(this,"_reactInternals",void 0)}render(){var{children:e}=this.props;return u.jsx(si.Provider,{value:this._reactInternals,children:e})}}function Lm(){var n=c.useContext(si);if(n===null)throw new Error("useFiber must be called within a <FiberProvider />!");var[e]=c.useState(()=>ct()),t=c.useMemo(()=>{for(var r of[n,n==null?void 0:n.alternate].filter(s=>s!=null)){var i=ka(r,!1,s=>{for(var o=s.memoizedState;o!=null;){if(o.memoizedState===e)return!0;o=o.next}});if(i)return i}},[n,e]);return t}var Vg="default",Rm="CREATE_DASHBOARD",Fm="CLOSE_DASHBOARD",{listen:Gg,emit:qg,useListener:Xg}=It(Rm),{listen:Zg,emit:Hm,useListener:Yg}=It(Fm);function $m(n,e,t){return(e=Um(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Um(n){var e=Bm(n,"string");return typeof e=="symbol"?e:e+""}function Bm(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class ja 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,{glContainer:r}=this.props;return[...(e=r==null||(t=r.tab)===null||t===void 0||(t=t.header)===null||t===void 0?void 0:t.tabs)!==null&&e!==void 0?e:[]]}handleCloseTab(){var{glContainer:e}=this.props;e.close()}handleCloseTabsAll(){var e=this.getAllTabs();e.forEach(t=>{var r;return(r=(t==null?void 0:t.contentItem).container)===null||r===void 0?void 0:r.close()})}handleCloseTabsRight(){for(var{glContainer:e}=this.props,t=this.getAllTabs(),r=t.length-1;r>0;r-=1){var i,s,o,a;if(((i=t[r].contentItem)===null||i===void 0||(i=i.config)===null||i===void 0?void 0:i.id)===((s=e.tab)===null||s===void 0||(s=s.contentItem)===null||s===void 0||(s=s.config)===null||s===void 0?void 0:s.id))break;(o=((a=t[r])===null||a===void 0?void 0:a.contentItem).container)===null||o===void 0||o.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(),r=!0,i=t.length-1;i>0;i-=1){var s,o,a;if(((s=t[i].contentItem)===null||s===void 0||(s=s.config)===null||s===void 0?void 0:s.id)===((o=e.tab)===null||o===void 0||(o=o.contentItem)===null||o===void 0||(o=o.config)===null||o===void 0?void 0:o.id))break;var l=!!(!((a=t[i])===null||a===void 0||(a=a.contentItem)===null||a===void 0||(a=a.config)===null||a===void 0)&&a.isClosable);if(l){r=!1;break}}return r}canCloseAny(){for(var e=this.getAllTabs(),t=!0,r=e.length-1;r>0;r-=1){var i,s=!!(!((i=e[r])===null||i===void 0||(i=i.contentItem)===null||i===void 0||(i=i.config)===null||i===void 0)&&i.isClosable);if(s){t=!1;break}}return t}canReopenLast(){var e,t,{workspace:r,glContainer:i}=this.props,s=(e=E.getStackForConfig(i.layoutManager.root,i.getConfig()))===null||e===void 0?void 0:e.config.id;return!((t=r.data.closed)!==null&&t!==void 0&&t.some(o=>o.parentStackId===s))}render(){var e,{additionalActions:t,glContainer:r}=this.props,i=[...t];i.push(()=>({title:"Re-open closed panel",group:re.groups.medium+2004,action:this.handleReopenLast,disabled:this.canReopenLast()}));var s=(e=r.tab)===null||e===void 0||(e=e.contentItem)===null||e===void 0||(e=e.config)===null||e===void 0?void 0:e.isClosable;return i.push({title:"Close",order:10,group:re.groups.low,action:this.handleCloseTab,disabled:s===void 0||!s}),i.push(()=>({title:"Close Tabs to Right",order:20,group:re.groups.low,action:this.handleCloseTabsRight,disabled:this.canCloseTabsRight()})),i.push(()=>({title:"Close All",order:30,group:re.groups.low,action:this.handleCloseTabsAll,disabled:this.canCloseAny()})),u.jsx(re,{actions:i})}}$m(ja,"defaultProps",{additionalActions:[]});var Km=n=>({workspace:Xs(n)}),Wm=Pn(Km,{setWorkspace:Zs})(ja);function Na(n,e,t){return(e=zm(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function zm(n){var e=Vm(n,"string");return typeof e=="symbol"?e:e+""}function Vm(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class Aa extends c.PureComponent{constructor(e){super(e),Na(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=O.createRef();var{value:t}=e;this.state={value:t,valueWasValidated:!1}}componentDidUpdate(e){var{isShown:t}=e,{isShown:r}=this.props;r&&!t&&this.resetState()}resetState(){var{value:e}=this.props;this.setState({value:e,valueWasValidated:!1})}handleRenameDialogOpened(){var e;(e=this.renameInputRef)===null||e===void 0||(e=e.current)===null||e===void 0||e.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,r=t==null?void 0:t.trim();if(r!==void 0&&r!==""){var{onSubmit:i}=this.props;i(r)}else this.setState({value:r,valueWasValidated:!0})}renderRenameDialog(){var{isShared:e,isOwner:t,itemType:r}=this.props,{value:i,valueWasValidated:s}=this.state;return u.jsxs("form",{className:$("p-3",{"was-validated":s}),onSubmit:this.handleRenameSubmit,noValidate:!0,role:"presentation",onMouseDown:o=>{o.stopPropagation()},onMouseUp:o=>{o.stopPropagation()},children:[u.jsxs("div",{className:"form-group",children:[u.jsxs("label",{htmlFor:"rename-dialog-".concat(r,"-input"),children:["Rename ",r]}),u.jsx("input",{type:"text",className:"form-control",id:"rename-dialog-".concat(r,"-input"),value:i??void 0,ref:this.renameInputRef,onChange:this.handleRenameInputChange,required:!0}),u.jsxs("div",{className:"invalid-feedback",children:[r," name cannot be empty"]}),(e||!t)&&u.jsxs("div",{className:"pt-2",children:["Renaming this ",r," will rename for all users."]})]}),u.jsxs("div",{className:"text-right",children:[u.jsx(te,{kind:"secondary",className:"mr-2",onClick:this.handleRenameCancel,children:"Cancel"}),u.jsx(te,{kind:"primary",type:"submit",children:"Rename"})]})]})}render(){var{isShown:e,onCancel:t}=this.props;return u.jsx(ir,{isShown:e,onEntered:this.handleRenameDialogOpened,onExited:t,options:{placement:"bottom"},interactive:!0,closeOnBlur:!0,children:this.renderRenameDialog()})}}Na(Aa,"defaultProps",{isShared:!1,isOwner:!0,itemType:"Item",value:""});var Hn=Object.freeze({focus:"TabEvent.focus",blur:"TabEvent.blur"});function go(n,e,t){return(e=Gm(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Gm(n){var e=qm(n,"string");return typeof e=="symbol"?e:e+""}function qm(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var Xm=R.module("Panel");class Zm extends c.PureComponent{constructor(e){super(e),go(this,"ref",void 0),go(this,"getAdditionalActions",Qt((r,i,s)=>{var o=[];return i&&o.push(this.getCloneAction()),s&&o.push(this.getRenameAction()),[...o,...r]})),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=O.createRef();var{glContainer:t}=this.props;this.state={title:E.getTitleFromContainer(t),showRenameDialog:!1,isWithinPanel:!0}}componentDidMount(){var e,{componentPanel:t,glContainer:r,glEventHub:i}=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),i.on(Hn.focus,this.handleTabFocus),i.on(Hn.blur,this.handleTabBlur),i.emit(Y.MOUNT,t??this),this.setState({isWithinPanel:((e=this.ref.current)===null||e===void 0||(e=e.parentElement)===null||e===void 0?void 0:e.closest(".dh-panel"))!=null})}componentWillUnmount(){var{componentPanel:e,glContainer:t,glEventHub:r}=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),r.off(Hn.focus,this.handleTabFocus),r.off(Hn.blur,this.handleTabBlur),r.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:r}=this.props;r.emit(Y.FOCUS,t??this);var{onFocus:i}=this.props;i==null||i(e)}handleBlur(e){var{onBlur:t}=this.props;t==null||t(e)}handleHide(){for(var{onHide:e}=this.props,t=arguments.length,r=new Array(t),i=0;i<t;i++)r[i]=arguments[i];e==null||e(...r)}handleResize(){for(var{onResize:e}=this.props,t=arguments.length,r=new Array(t),i=0;i<t;i++)r[i]=arguments[i];e==null||e(...r)}handleBeforeShow(){for(var{onBeforeShow:e}=this.props,t=arguments.length,r=new Array(t),i=0;i<t;i++)r[i]=arguments[i];e==null||e(...r)}handleShow(){for(var{onShow:e}=this.props,t=arguments.length,r=new Array(t),i=0;i<t;i++)r[i]=arguments[i];e==null||e(...r)}handleTabBlur(){for(var{onTabBlur:e}=this.props,t=arguments.length,r=new Array(t),i=0;i<t;i++)r[i]=arguments[i];e==null||e(...r)}handleTabFocus(){for(var{onTabFocus:e}=this.props,t=arguments.length,r=new Array(t),i=0;i<t;i++)r[i]=arguments[i];e==null||e(...r)}handleRenameCancel(){this.setState({showRenameDialog:!1})}handleShowRenameDialog(){this.setState({showRenameDialog:!0})}handleRenameSubmit(e){var{glContainer:t}=this.props;this.setState({showRenameDialog:!1,title:e});var r=E.getRootFromContainer(t),i=E.getComponentConfigFromContainer(t);L(i),E.renameComponent(r,i,e)}handleCopyPanel(){var{glContainer:e,glEventHub:t}=this.props,r=E.getRootFromContainer(e),i=E.getComponentConfigFromContainer(e);if(i==null){Xm.error("Could not get component config from container",e);return}var s=E.cloneComponent(r,i);s!==null&&t.emit(Y.CLONED,this,s)}getCloneAction(){return{title:"Copy Panel",order:10,group:re.groups.high,action:this.handleCopyPanel}}getRenameAction(){return{title:"Rename",order:10,group:re.groups.medium,action:this.handleShowRenameDialog}}render(){var{children:e,className:t,renderTabTooltip:r,glContainer:i,glEventHub:s,additionalActions:o=Gl,errorMessage:a,isLoaded:l=!0,isLoading:d=!1,isClonable:h=!1,isRenamable:p=!1}=this.props,{tab:m}=i,{showRenameDialog:v,title:f,isWithinPanel:g}=this.state;return u.jsxs("div",{className:$("h-100 w-100 dh-panel",t),onFocusCapture:this.handleFocus,onBlurCapture:this.handleBlur,ref:this.ref,children:[e,u.jsx(_n,{"data-testid":"base-panel-loading",errorMessage:a,isLoaded:l,isLoading:d}),!g&&m!=null&&Gr.createPortal(u.jsxs(u.Fragment,{children:[u.jsx(Wm,{glContainer:i,glEventHub:s,additionalActions:this.getAdditionalActions(o,h,p)}),p&&u.jsx(Aa,{isShown:v,value:f,itemType:"Panel",onCancel:this.handleRenameCancel,onSubmit:this.handleRenameSubmit}),r!=null&&u.jsx(ie,{interactive:!0,options:{placement:"bottom"},popperClassName:"panel-tab-popper",children:r()})]}),m.element[0])]})}}var Ym=Ks(Zm),Jm=R.module("useDhId"),Sr="__dhId";function Jg(){var n,e,t=(n=(e=Lm())===null||e===void 0?void 0:e.pendingProps)!==null&&n!==void 0?n:{},r=t[Sr],i=Pm();if(r!=null){if(typeof r!="string")throw new Error("useDhId expected prop ".concat(Sr," to be a string, but got ").concat(typeof r));return r}return i??(Jm.warn("useDhId must be used within a PanelIdContext provider if there is no ".concat(Sr," prop. Defaulting to null.")),null)}function La(n){var{type:e}=n,t=Hu();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:pl});case t.VariableType.FIGURE:return u.jsx(le,{icon:ps});case t.VariableType.PANDAS:return u.jsx(le,{icon:ml});default:return u.jsx(le,{icon:cs})}}function bo(n,e,t,r,i,s,o){try{var a=n[s](o),l=a.value}catch(d){return void t(d)}a.done?e(l):Promise.resolve(l).then(r,i)}function Qm(n){return function(){var e=this,t=arguments;return new Promise(function(r,i){var s=n.apply(e,t);function o(l){bo(s,r,i,o,a,"next",l)}function a(l){bo(s,r,i,o,a,"throw",l)}o(void 0)})}}function Ra(n){var{children:e,language:t}=n,[r,i]=c.useState(null),{activeThemes:s}=Ms();return c.useEffect(()=>{var o=!1;function a(){return l.apply(this,arguments)}function l(){return l=Qm(function*(){if(e!=null&&s!=null){var d=yield Ee.colorize(e.toString(),t,{});o||i(d)}}),l.apply(this,arguments)}return a(),()=>{o=!0}},[s,e,t]),u.jsx("div",{style:{pointerEvents:"none"},dangerouslySetInnerHTML:r!=null?{__html:r}:void 0})}class Fa{static get LANGUAGE_MAP(){return new Map([["python","Python"],["groovy","Groovy"],["scala","Scala"]])}}class Jn{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)?[]:Bl.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"),r="".concat(e.getMinutes()).padStart(2,"0"),i="".concat(e.getSeconds()).padStart(2,"0"),s="".concat(e.getMilliseconds()).padStart(3,"0");return"".concat(t,":").concat(r,":").concat(i,".").concat(s)}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 Jn.isTableType(e,t)||Jn.isWidgetType(e,t)}static isFigureType(e,t){return t===e.VariableType.FIGURE}static isPandas(e,t){return t===e.VariableType.PANDAS}}function ep(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})]})}function Kr(n,e,t){return(e=tp(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function tp(n){var e=np(n,"string");return typeof e=="symbol"?e:e+""}function np(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class Ha extends c.Component{constructor(e){super(e),Kr(this,"timer",void 0),Kr(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:r}=this.state;return u.jsx("div",{className:$("console-history-result-in-progress",{disabled:e}),children:u.jsxs("span",{className:"badge",children:[u.jsx(vs,{className:"ml-2"}),"Running... ",dn.formatElapsedTime(r)," ",u.jsx(te,{className:"console-history-result-in-progress-cancel",kind:"ghost",icon:vl,tooltip:"Cancel",onClick:t,disabled:e})]})})}}Kr(Ha,"defaultProps",{disabled:!1});function Cn(n,e,t){return(e=rp(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function rp(n){var e=ip(n,"string");return typeof e=="symbol"?e:e+""}function ip(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class rn extends c.PureComponent{constructor(e){super(e),Cn(this,"mouseX",void 0),Cn(this,"mouseY",void 0),Cn(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)>=rn.mouseDragThreshold||Math.abs(e.clientY-this.mouseY)>=rn.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:r}=this.props;L(r);var i=r.trimEnd(),s=i.indexOf(`
|
|
3
3
|
`),o=s>-1,a=i;o&&(a=i.slice(0,s));var l=i.slice(s),d=t?"error-btn-link error-btn-link--active":"error-btn-link";return u.jsxs("div",{className:$("error-message",{expanded:e}),children:[o&&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?Or:fl,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:""]})]}),!o&&u.jsx("div",{className:"error-content",children:u.jsx("div",{className:"console-error-text",children:a})})]},"error")}}Cn(rn,"defaultProps",{message:""});Cn(rn,"mouseDragThreshold",5);function op(n,e,t){return(e=sp(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function sp(n){var e=ap(n,"string");return typeof e=="symbol"?e:e+""}function ap(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var yo=R.module("ConsoleHistoryItem");class $a extends c.PureComponent{constructor(e){super(e),this.handleCancelClick=this.handleCancelClick.bind(this),this.handleObjectClick=this.handleObjectClick.bind(this)}handleObjectClick(e){yo.debug("handleObjectClick",e);var{openObject:t}=this.props;t(e)}handleCancelClick(){var{item:e}=this.props;e!=null&&e.cancelResult&&(yo.debug("Cancelling command: ".concat(e.command)),e.cancelResult())}render(){var{disabled:e,item:t,language:r,iconForType:i}=this.props,{disabledObjects:s,result:o}=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(Ra,{language:r,children:t.command})})]}));var d=[],h=!1;if(o){var{error:p,message:m,changes:v}=o;if(v){var{created:f,updated:g}=v;[...f,...g].forEach(X=>{h=!0;var{title:G}=X,A="".concat(G),M=e===void 0||e||(s??[]).indexOf(A)>=0,J=u.jsx(te,{kind:"primary",onClick:()=>this.handleObjectClick(X),className:"btn-console-object",disabled:M,icon:i(X.type),children:G},A);d.push(J)})}if(p!=null&&!a){var b,S="".concat((b=p.message)!==null&&b!==void 0?b:p);S||(S=p);var w=u.jsx(rn,{message:S},"result-error");d.push(w)}if(m!==void 0&&m!==""){var y=u.jsx("div",{className:"log-message",children:m},"log-message");d.push(y)}}else{h=!0;var D=u.jsx(Ha,{onCancelClick:this.handleCancelClick,disabled:e},"in_progress");d.push(D)}var V=null;return d.length>0&&(V=u.jsx(ep,{children:d})),u.jsxs("div",{className:$("console-command-result",{"console-result-buttons":h}),children:[l,V]})}}op($a,"defaultProps",{disabled:!1});function lp(n,e){return"".concat(n,".").concat(e.command,".").concat(e.result&&e.result.message,".").concat(e.result&&e.result.error)}var dp=O.forwardRef(function(e,t){for(var{disabled:r=!1,items:i,language:s,openObject:o,supportsType:a,iconForType:l}=e,d=[],h=0;h<i.length;h+=1){var p=i[h],m=u.jsx($a,{disabled:r,item:p,openObject:o,language:s,supportsType:a,iconForType:l},lp(h,p));d.push(m)}return u.jsx("div",{ref:t,className:"container-fluid console-history",children:d})}),up={name:"Console",CLEAR:ee.createAndAdd({id:"CONSOLE.CLEAR",name:"Clear",shortcut:[_.CTRL,C.L],macShortcut:[_.CTRL,C.C]}),FOCUS_HISTORY:ee.createAndAdd({id:"CONSOLE.FOCUS_HISTORY",name:"Focus History",shortcut:[_.CTRL,C.H],macShortcut:[_.CTRL,_.OPTION,C.H]})},hp={name:"Command History",FOCUS_HISTORY:ee.createAndAdd({id:"COMMAND_HISTORY.FOCUS_HISTORY",name:"Focus History Search",shortcut:[_.CTRL,C.H],macShortcut:[_.CTRL,_.OPTION,C.H]}),SEND_TO_CONSOLE:ee.createAndAdd({id:"COMMAND_HISTORY.SEND_TO_CONSOLE",name:"Send to Console",shortcut:[C.ENTER],macShortcut:[C.ENTER]}),SEND_TO_NOTEBOOK:ee.createAndAdd({id:"COMMAND_HISTORY.SEND_TO_NOTEBOOK",name:"Send to Notebook",shortcut:[_.CTRL,C.ENTER],macShortcut:[_.CMD,C.ENTER]}),RUN:ee.createAndAdd({id:"COMMAND_HISTORY.RUN",name:"Run",shortcut:[_.ALT,C.R],macShortcut:[_.OPTION,C.R]})},cp={name:"Notebook",RUN:ee.createAndAdd({id:"NOTEBOOK.RUN",name:"Run",shortcut:[_.ALT,C.R],macShortcut:[_.OPTION,C.R]}),RUN_SELECTED:ee.createAndAdd({id:"NOTEBOOK.RUN_SELECTED",name:"Run Selected",shortcut:[_.ALT,_.SHIFT,C.R],macShortcut:[_.OPTION,_.SHIFT,C.R]}),FIND:ee.createAndAdd({id:"NOTEBOOK.FIND",name:"Find",shortcut:[_.CTRL,C.F],macShortcut:[_.CMD,C.F],isEditable:!1}),MINIMAP:ee.createAndAdd({id:"NOTEBOOK.MINIMAP",name:"Show Minimap",shortcut:[_.ALT,C.M],macShortcut:[_.OPTION,C.M]}),WORDWRAP:ee.createAndAdd({id:"NOTEBOOK.WORDWRAP",name:"Word Wrap",shortcut:[_.ALT,C.Z],macShortcut:[_.OPTION,C.Z]})},en={CONSOLE:up,COMMAND_HISTORY:hp,NOTEBOOK:cp};const fe=Object.freeze({FATAL:"FATAL",STDERR:"STDERR",ERROR:"ERROR",WARN:"WARN",STDOUT:"STDOUT",INFO:"INFO",DEBUG:"DEBUG",TRACE:"TRACE"}),mp="var(--dh-color-editor-bg)",pp="var(--dh-color-editor-fg)",vp="var(--dh-color-editor-string)",fp="var(--dh-color-editor-delimiter)",gp="var(--dh-color-editor-predefined)",bp="var(--dh-color-editor-keyword)",yp="var(--dh-color-editor-storage)",Cp="var(--dh-color-editor-number)",wp="var(--dh-color-editor-operator)",Sp="var(--dh-color-editor-identifier)",_p="var(--dh-color-editor-comment)",Wr={"error-foreground":"var(--dh-color-editor-error-fg)",background:mp,foreground:pp,"line-height":"19px",string:vp,"string-delim":"var(--dh-color-editor-string-delim)",delimiter:fp,predefined:gp,keyword:bp,storage:yp,number:Cp,operator:wp,identifier:Sp,"namespace-identifier":"var(--dh-color-editor-identifier-namespace)","identifier-js":"var(--dh-color-editor-identifier-js)",comment:_p,"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 Ep="python",Pp={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/}}},Tp={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"]]}},Op={id:Ep,conf:Pp,language:Tp},xp="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/}}},Dp={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"]]}},Mp={id:xp,conf:Ip,language:Dp},kp="scala",jp={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>))/}}},Np={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"]]}},Ap={id:kp,conf:jp,language:Np},Lp="deephavenDb",Rp={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/}}},Fp={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"]]}},Hp={id:Lp,conf:Rp,language:Fp},$p="log",Up={},Bp={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"}]]}},Kp={id:$p,conf:Up,language:Bp},Wp={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 Co(n,e,t,r,i,s,o){try{var a=n[s](o),l=a.value}catch(d){return void t(d)}a.done?e(l):Promise.resolve(l).then(r,i)}function zp(n){return function(){var e=this,t=arguments;return new Promise(function(r,i){var s=n.apply(e,t);function o(l){Co(s,r,i,o,a,"next",l)}function a(l){Co(s,r,i,o,a,"throw",l)}o(void 0)})}}function xt(n,e,t){return(e=Vp(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Vp(n){var e=Gp(n,"string");return typeof e=="symbol"?e:e+""}function Gp(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var Be=R.module("MonacoCompletionProvider");class I extends c.PureComponent{static initRuff(){return zp(function*(){if(I.isRuffEnabled)return I.initRuffPromise||(I.initRuffPromise=Wl({}).then(()=>{Be.debug("Initialized Ruff",vi.version()),I.isRuffInitialized=!0,I.updateRuffWorkspace()})),I.initRuffPromise})()}static updateRuffWorkspace(){if(I.isRuffInitialized){var e=console.log;try{console.log=()=>{},I.ruffWorkspace=new vi(I.ruffSettings)}finally{console.log=e}I.lintAllPython()}}static setRuffSettings(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:I.ruffSettings;if(I.ruffSettings=e,!I.isRuffInitialized){I.initRuff();return}I.updateRuffWorkspace()}static getDiagnostics(e){if(!I.ruffWorkspace)return[];var t=I.ruffWorkspace.check(e.getValue());return ye.isConsoleModel(e)?t.filter(r=>r.code==null):t}static lintAllPython(){if(!I.isRuffEnabled){Ee.removeAllMarkers("ruff");return}Ee.getModels().filter(e=>e.getLanguageId()==="python").forEach(I.lintPython)}static lintPython(e){if(I.isRuffEnabled&&I.ruffWorkspace){var t=I.getDiagnostics(e);Be.debug("Linting Python document: ".concat(e.uri.toString()),t),Ee.setModelMarkers(e,"ruff",t.map(r=>{var i=r.code==="F401"||r.code==="F841",s=r.code==null;return{startLineNumber:r.location.row,startColumn:r.location.column,endLineNumber:r.end_location.row,endColumn:r.end_location.column,message:s?r.message:"".concat(r.code,": ").concat(r.message),severity:s?fi.Error:fi.Warning,tags:i?[Kl.Unnecessary]:[]}}))}}static lspToMonacoKind(e){var t=ze.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:r}=e;return{startLineNumber:t.line+1,startColumn:t.character+1,endLineNumber:r.line+1,endColumn:r.character+1}}static monacoToLspPosition(e){return{line:e.lineNumber-1,character:e.column-1}}static handlePythonCodeActionRequest(e,t){if(!I.isRuffEnabled||!I.ruffWorkspace)return{actions:[],dispose:()=>{}};var r=I.getDiagnostics(e).filter(d=>{var h=new Ss(d.location.row,d.location.column,d.end_location.row,d.end_location.column);return d.code!=null&&h.intersectRanges(t)}),i=r.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(p=>{var m;return{resource:e.uri,versionId:e.getVersionId(),textEdit:{range:{startLineNumber:p.location.row,startColumn:p.location.column,endLineNumber:p.end_location.row,endColumn:p.end_location.column},text:(m=p.content)!==null&&m!==void 0?m:""}}})}:void 0}}),s=new Set,o=new Set;r.forEach(d=>{d.code!=null&&(s.has(d.code)&&o.add(d.code),s.add(d.code))});var a=r.map(d=>{if(d.code==null)return[];var h=e.getLineContent(d.location.row),p=Ee.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 p!=null&&p.type.startsWith("comment")&&(m.text="# noqa: ".concat(d.code," "),h.startsWith("# noqa:",p.offset)?(m.range.startColumn=p.offset+1,m.range.endColumn=p.offset+9):(m.range.startColumn=p.offset+1,m.range.endColumn=h.startsWith("# ",p.offset)?p.offset+3:p.offset+2)),[{title:"Disable ".concat(d.code," for ").concat(o.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,p)=>p.find(m=>m.title===d.title)===d),l=[...s].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:[...i,...a,...l],dispose:()=>{}}}static handlePythonFormatRequest(e,t,r){if(I.ruffWorkspace)return Be.debug("Formatting Python document: ".concat(e.uri.toString)),[{range:e.getFullModelRange(),text:I.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=ze.registerCompletionItemProvider(e,{provideCompletionItems:this.handleCompletionRequest,triggerCharacters:[".",'"',"'"]}),t.getSignatureHelp!=null&&(this.registeredSignatureProvider=ze.registerSignatureHelpProvider(e,{provideSignatureHelp:this.handleSignatureRequest,signatureHelpTriggerCharacters:["(",","]})),t.getHover!=null&&(this.registeredHoverProvider=ze.registerHoverProvider(e,{provideHover:this.handleHoverRequest}))}componentWillUnmount(){var e,t,r;(e=this.registeredCompletionProvider)===null||e===void 0||e.dispose(),(t=this.registeredSignatureProvider)===null||t===void 0||t.dispose(),(r=this.registeredHoverProvider)===null||r===void 0||r.dispose()}handleCompletionRequest(e,t,r){var{model:i,session:s}=this.props;if(e!==i)return null;var o={textDocument:{uri:"".concat(e.uri),version:e.getVersionId()},position:I.monacoToLspPosition(t),context:r},a=s.getCompletionItems(o);Be.debug("Requested completion items",o);var l=a.then(d=>{Be.debug("Completion items received: ",o,d);var h=d.map(p=>{var{label:m,kind:v,detail:f,documentation:g,sortText:b,filterText:S,textEdit:w,insertTextFormat:y}=p;return{label:m,kind:I.lspToMonacoKind(v),detail:f,documentation:(g==null?void 0:g.kind)==="markdown"?g:g==null?void 0:g.value,sortText:b,filterText:S,insertText:w.text,insertTextRules:y===2?4:y,range:I.lspToMonacoRange(w.range)}});return{incomplete:!0,suggestions:h}}).catch(d=>(Be.error("There was an error retrieving completion items",d),{suggestions:[]}));return l}handleSignatureRequest(e,t,r,i){var s={value:{signatures:[],activeSignature:0,activeParameter:0},dispose:()=>{}},{model:o,session:a}=this.props;if(e!==o||a.getSignatureHelp==null)return null;var l={textDocument:{uri:"".concat(e.uri),version:e.getVersionId()},position:I.monacoToLspPosition(t),context:i},d=a.getSignatureHelp(l);Be.debug("Requested signature help",l);var h=d.then(p=>{Be.debug("Signatures received: ",l,d);var m=p.map(f=>{var{label:g,documentation:b,parameters:S}=f;return{documentation:(b==null?void 0:b.kind)==="markdown"?b:b==null?void 0:b.value,label:g,parameters:S??[]}});if(m.length===0)return s;var v=0;return{value:{signatures:m,activeSignature:v,activeParameter:p[v].activeParameter},dispose:()=>{}}}).catch(p=>(Be.error("There was an error retrieving completion items",p),s));return h}handleHoverRequest(e,t){var{model:r,session:i}=this.props;if(e!==r||i.getHover==null)return null;var s={textDocument:{uri:"".concat(e.uri),version:e.getVersionId()},position:I.monacoToLspPosition(t)},o=i.getHover(s);Be.debug("Requested hover",s);var a=o.then(l=>{Be.debug("Hover received: ",s,l);var{contents:d}=l;return{contents:d!=null?[d]:[]}}).catch(l=>(Be.error("There was an error retrieving hover",l),{contents:[]}));return a}render(){return null}}xt(I,"ruffWorkspace",void 0);xt(I,"initRuffPromise",void 0);xt(I,"isRuffInitialized",!1);xt(I,"isRuffEnabled",!0);xt(I,"ruffSettings",Wp);function wo(n,e,t,r,i,s,o){try{var a=n[s](o),l=a.value}catch(d){return void t(d)}a.done?e(l):Promise.resolve(l).then(r,i)}function qp(n){return function(){var e=this,t=arguments;return new Promise(function(r,i){var s=n.apply(e,t);function o(l){wo(s,r,i,o,a,"next",l)}function a(l){wo(s,r,i,o,a,"throw",l)}o(void 0)})}}function So(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function _o(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?So(Object(t),!0).forEach(function(r){Xp(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):So(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function Xp(n,e,t){return(e=Zp(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Zp(n){var e=Yp(n,"string");return typeof e=="symbol"?e:e+""}function Yp(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var at=R.module("MonacoUtils"),Eo="inmemory://dh-console/";class ye{static init(){var{getWorker:e}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};at.debug("Initializing Monaco..."),e!==void 0&&ye.registerGetWorker(e);var{initTheme:t,registerLanguages:r}=ye;t(),r([Hp,Op,Mp,Kp,Ap]),ze.onLanguage("python",()=>{ze.registerCodeActionProvider("python",{provideCodeActions:I.handlePythonCodeActionRequest},{providedCodeActionKinds:["quickfix"]}),ze.registerDocumentFormattingEditProvider("python",{provideDocumentFormattingEdits:I.handlePythonFormatRequest})}),Ee.onDidCreateModel(i=>{if(i.getLanguageId()==="python"){I.ruffWorkspace!=null&&I.lintPython(i);var s=nr(o=>I.lintPython(o),250);i.onDidChangeContent(()=>{s(i)})}}),ye.removeConflictingKeybindings(),at.debug("Monaco initialized.")}static initTheme(){var e,t,{removeHashtag:r}=ye,i=ms(Wr);at.debug2("Monaco theme:",Wr),at.debug2("Monaco theme derived:",i);var s=[{token:"",foreground:r(i.foreground)},{token:"string",foreground:r(i.string)},{token:"string.delim",foreground:r(i["string-delim"])},{token:"keyword",foreground:r(i.keyword)},{token:"identifier.js",foreground:r(i["identifier-js"])},{token:"delimiter",foreground:r(i.delimiter)},{token:"comment",foreground:r(i.comment)},{token:"number",foreground:r(i.number)},{token:"storage",foreground:r(i.storage)},{token:"identifier",foreground:r(i.identifier)},{token:"namespace.identifier",foreground:r(i["namespace-identifier"])},{token:"operator",foreground:r(i.operator)},{token:"predefined",foreground:r(i.predefined)},{token:"error.log",foreground:(e=(t=i["log-error"])===null||t===void 0?void 0:t.substring(1))!==null&&e!==void 0?e:""},{token:"warn.log",foreground:r(i["log-warn"])},{token:"info.log",foreground:r(i["log-info"])},{token:"stdout.log",foreground:r(i["log-stdout"])},{token:"trace.log",foreground:r(i["log-trace"])},{token:"debug.log",foreground:r(i["log-debug"])},{token:"date.log",foreground:r(i["log-date"])}],o={foreground:i.foreground,errorForeground:i["error-foreground"],"inputOption.activeBorder":i["input-option-active-border"],"editor.background":i.background,"editor.foreground":i.foreground,"editor.lineHighlightBackground":i["editor-line-highlight-background"],"editorLineNumber.foreground":i["editor-line-number-foreground"],"editorLineNumber.activeForeground":i["editor-line-number-active-foreground"],"editor.selectionBackground":i["editor-selection-background"],"editor.inactiveSelectionBackground":i["editor-inactive-selection-background"],"editor.selectionHighlightBackground":i["editor-selection-highlight-background"],"editor.wordHighlightBackground":i["editor-word-highlight-background"],"editor.findMatchBackground":i["editor-find-match-background"],"editor.findMatchHighlightBackground":i["editor-find-match-highlight-background"],"editorSuggestWidget.background":i["editor-suggest-widget-background"],"editorSuggestWidget.border":i["editor-suggest-widget-border"],"editorSuggestWidget.foreground":i["editor-suggest-widget-foreground"],"editorSuggestWidget.selectedBackground":i["editor-suggest-widget-selected-background"],"list.activeSelectionBackground":i["editor-suggest-widget-selected-background"],"editorSuggestWidget.selectedForeground":i["editor-suggest-widget-selected-foreground"],"list.activeSelectionForeground":i["editor-suggest-widget-selected-foreground"],"editorSuggestWidget.highlightForeground":i["editor-suggest-widget-highlightForeground"],"editorSuggestWidget.focusHighlightForeground":i["editor-suggest-widget-focus-highlight-foreground"],"list.hoverBackground":i["list-hover-background"],"dropdown.background":i["context-menu-background"],"dropdown.foreground":i["context-menu-foreground"],"menu.selectionBackground":i["menu-selection-background"],"menu.selectionForeground":i["menu-selection-foreground"],"keybindingLabel.foreground":i["menu-selection-foreground"],"list.focusBackground":i["menu-selection-background"],"editorWidget.background":i["editor-widget-background"],"inputOption.activeBackground":i["input-option-active-background"],"inputOption.activeForeground":i["input-option-active-foreground"],focusBorder:i["focus-border"],"input.background":i["input-background"],"input.foreground":i["input-foreground"],"input.border":i["input-border"],"textLink.foreground":i["text-link-foreground"],"textLink.activeForeground":i["text-link-active-foreground"],"editorLink.activeForeground":i["editor-link-active-foreground"],"editorBracketHighlight.foreground1":i["editor-bracket-foreground1"],"editorBracketHighlight.foreground2":i["editor-bracket-foreground2"],"editorBracketHighlight.foreground3":i["editor-bracket-foreground3"],"editorBracketHighlight.foreground4":i["editor-bracket-foreground4"],"editorBracketHighlight.foreground5":i["editor-bracket-foreground5"],"editorBracketHighlight.foreground6":i["editor-bracket-foreground6"],"editorBracketHighlight.unexpectedBracket.foreground":i["editor-unexpected-bracket-foreground"]};Ee.defineTheme("dh-dark",{base:"vs-dark",inherit:!0,rules:s,colors:o});try{Ee.setTheme("dh-dark")}catch(a){at.error("Failed to set 'dh-dark' Monaco theme, falling back to vs-dark",a),Ee.setTheme("vs-dark")}}static registerGetWorker(e){window.MonacoEnvironment=_o(_o({},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(r=>{var{id:i}=r;return i});ze.getLanguages().filter(r=>{var{id:i}=r;return t.includes(i)}).forEach(r=>{var i=r;at.debug2("Overriding default language loader:",i.id)}),e.forEach(r=>{ye.registerLanguage(r)})}static registerLanguage(e){at.debug2("Registering language: ",e.id),ze.register(e),ze.onLanguage(e.id,()=>{ze.setLanguageConfiguration(e.id,e.conf),ze.setMonarchTokensProvider(e.id,e.language)})}static setEOL(e){var t,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Ee.EndOfLineSequence.LF;(t=e.getModel())===null||t===void 0||t.setEOL(r)}static openDocument(e,t){var r=e.getModel();L(r);var i={textDocument:{uri:"".concat(r.uri),languageId:r.getLanguageId(),version:r.getVersionId(),text:r.getValue()}};at.debug2("didOpenDocumentParams: ",i),t.openDocument(i);var s=e.onDidChangeModelContent(o=>{for(var{changes:a,versionId:l}=o,d=[],h=0;h<a.length;h+=1){var p=a[h],{range:m,rangeLength:v,text:f}=p,g={range:{start:{line:m.startLineNumber-1,character:m.startColumn-1},end:{line:m.endLineNumber-1,character:m.endColumn-1}},rangeLength:v,text:f};d.push(g)}if(d.length>0){var b={textDocument:{version:l,uri:"".concat(r.uri)},contentChanges:d};at.debug2("didChangeDocumentParams",b),t.changeDocument(b)}});return s}static closeDocument(e,t){var r=e.getModel();L(r);var i={textDocument:{uri:"".concat(r.uri)}};t.closeDocument(i)}static registerPasteHandler(e){e.onDidPaste(t=>{var r=/“|”/g,i=/\u200b/g,s=/\u00A0/g,o=e.getModel();L(o);var a=o.getValueInRange(t.range);(r.test(a)||i.test(a)||s.test(a))&&o.applyEdits([{range:t.range,text:a.replace(r,'"').replace(i,"").replace(s," ")}])})}static isMacPlatform(){var{platform:e}=window.navigator;return e.startsWith("Mac")}static removeConflictingKeybindings(){Ee.addKeybindingRule({keybinding:We.CtrlCmd|Ft.KeyD,command:null}),ye.isMacPlatform()||Ee.addKeybindingRule({keybinding:We.CtrlCmd|Ft.KeyH,command:null})}static disableKeyBindings(e,t){e.addAction({id:"disable-keybindings-".concat(ct()),label:"",keybindings:t,run:()=>{}})}static getMonacoKeyCodeFromShortcut(e){var{keyState:t}=e,{keyValue:r}=t;if(r===null)return 0;var i=ye.isMacPlatform();return i?(t.metaKey?We.CtrlCmd:0)|(t.shiftKey?We.Shift:0)|(t.altKey?We.Alt:0)|(t.ctrlKey?We.WinCtrl:0)|gi.fromString(r):(t.ctrlKey?We.CtrlCmd:0)|(t.shiftKey?We.Shift:0)|(t.altKey?We.Alt:0)|(t.metaKey?We.WinCtrl:0)|gi.fromString(r)}static provideLinks(e){for(var t=[],r=function(o){var a=e.getLineContent(o),l=Vl(a),d=l.filter(h=>h.type==="url"?/^https?:\/\//.test(h.value):!0);d.forEach(h=>{t.push({url:h.href,range:new Ss(o,h.start+1,o,h.end+1)})})},i=1;i<=e.getLineCount();i+=1)r(i);return{links:t}}static generateConsoleUri(){return zl.parse("".concat(Eo).concat(ct()))}static isConsoleModel(e){return e.uri.toString().startsWith(Eo)}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 qp(function*(){var t;yield(t=e.getAction("editor.action.formatDocument"))===null||t===void 0?void 0:t.run()})()}}function Po(n,e,t,r,i,s,o){try{var a=n[s](o),l=a.value}catch(d){return void t(d)}a.done?e(l):Promise.resolve(l).then(r,i)}function Jp(n){return function(){var e=this,t=arguments;return new Promise(function(r,i){var s=n.apply(e,t);function o(l){Po(s,r,i,o,a,"next",l)}function a(l){Po(s,r,i,o,a,"throw",l)}o(void 0)})}}function Ae(n,e,t){return(e=Qp(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Qp(n){var e=ev(n,"string");return typeof e=="symbol"?e:e+""}function ev(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var _r=R.module("ConsoleInput"),Qn=parseInt(Wr["line-height"],10),Ua=6,Ba=6,tv=Qn+Ua+Ba,Er=100;class on extends c.PureComponent{constructor(e){super(e),Ae(this,"cancelListener",void 0),Ae(this,"resizeObserver",void 0),Ae(this,"commandContainer",void 0),Ae(this,"commandEditor",void 0),Ae(this,"commandHistoryIndex",void 0),Ae(this,"commandSuggestionContainer",void 0),Ae(this,"loadingPromise",void 0),Ae(this,"timestamp",void 0),Ae(this,"bufferIndex",void 0),Ae(this,"history",void 0),Ae(this,"modifiedCommands",void 0),this.handleResize=this.handleResize.bind(this),this.commandContainer=O.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:Qn,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,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;if(e){if(_r.debug("Command received: ",e),!r){var i;this.commandHistoryIndex=null,(i=this.commandEditor)===null||i===void 0||i.setValue(e)}t&&this.focusEnd(),this.updateDimensions(),r&&this.processCommand(e)}}initCommandEditor(){var{language:e,session:t}=this.props,r=Ee.createModel("",e,ye.generateConsoleUri()),i={copyWithSyntaxHighlighting:!1,cursorStyle:"block",fixedOverflowWidgets:!0,folding:!1,fontFamily:"Fira Mono",glyphMargin:!1,language:e,lineHeight:Qn,lineDecorationsWidth:3,lineNumbers:"off",minimap:{enabled:!1},renderLineHighlight:"none",scrollBeyondLastLine:!1,scrollbar:{arrowSize:0,horizontal:"hidden",horizontalScrollbarSize:0},padding:{top:Ua,bottom:Ba},value:"",wordWrap:"on",autoClosingBrackets:"beforeWhitespace",model:r},s=this.commandContainer.current;L(s),this.commandEditor=Ee.create(s,i),ye.setEOL(this.commandEditor),ye.openDocument(this.commandEditor,t),this.commandEditor.onDidChangeModelContent(()=>{var o,a=(o=this.commandEditor)===null||o===void 0?void 0:o.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(o=>{var{commandEditor:a,commandHistoryIndex:l}=this,d=a==null?void 0:a.getPosition();L(d);var{lineNumber:h}=d;if(!o.altKey&&!o.shiftKey&&!o.metaKey){if(o.code==="ArrowUp"&&!this.isSuggestionMenuPopulated()&&h===1){l!=null?this.loadCommand(l+1):this.loadCommand(0),this.focusStart(),o.stopPropagation(),o.preventDefault();return}if(o.code==="ArrowDown"&&!this.isSuggestionMenuPopulated()&&h===(r==null?void 0:r.getLineCount())){l!=null&&l>0?this.loadCommand(l-1):this.loadCommand(null),this.focusEnd(),o.stopPropagation(),o.preventDefault();return}if(o.keyCode===Ft.Enter&&!this.isSuggestionMenuPopulated()){var p;o.stopPropagation(),o.preventDefault();var m=(p=this.commandEditor)===null||p===void 0?void 0:p.getValue().trim();if(m!==void 0){var v;this.processCommand(m),(v=this.commandEditor)===null||v===void 0||v.setValue("")}}}}),ye.disableKeyBindings(this.commandEditor,[We.CtrlCmd|Ft.KeyF]),ye.registerPasteHandler(this.commandEditor),this.commandEditor.focus(),this.resizeObserver.observe(s),this.updateDimensions(),this.setState({model:this.commandEditor.getModel()})}destroyCommandEditor(){var{session:e}=this.props;this.commandEditor&&(ye.closeDocument(this.commandEditor,e),this.commandEditor.dispose(),this.commandEditor=void 0)}handleResize(){this.updateDimensions()}isSuggestionMenuActive(){var e;if(!this.commandSuggestionContainer){var t;this.commandSuggestionContainer=(t=this.commandEditor)===null||t===void 0||(t=t.getDomNode())===null||t===void 0?void 0:t.querySelector(".suggest-widget")}return(e=this.commandSuggestionContainer&&this.commandSuggestionContainer.classList.contains("visible"))!==null&&e!==void 0?e:!1}isSuggestionMenuPopulated(){var e,t;return this.isSuggestionMenuActive()&&((e=(t=this.commandSuggestionContainer)===null||t===void 0||(t=t.querySelector(".monaco-list-rows"))===null||t===void 0?void 0:t.childElementCount)!==null&&e!==void 0?e:0)>0}focus(){var e;(e=this.commandEditor)===null||e===void 0||e.focus()}focusStart(){var e,t,r,i,s,o=(e=this.commandEditor)===null||e===void 0?void 0:e.getModel();L(o);var a=o.getLineLength(1)+1,l=(t=this.commandEditor)===null||t===void 0?void 0:t.getTopForPosition(1,a);L(l),(r=this.commandEditor)===null||r===void 0||r.setPosition({lineNumber:1,column:a}),(i=this.commandEditor)===null||i===void 0||i.setScrollTop(l),(s=this.commandEditor)===null||s===void 0||s.focus()}focusEnd(){var e,t,r,i,s,o=(e=this.commandEditor)===null||e===void 0?void 0:e.getModel();L(o);var a=o.getLineCount(),l=o.getLineLength(a)+1,d=(t=this.commandEditor)===null||t===void 0?void 0:t.getTopForPosition(a,l);L(d),(r=this.commandEditor)===null||r===void 0||r.setPosition({lineNumber:a,column:l}),(i=this.commandEditor)===null||i===void 0||i.setScrollTop(d),(s=this.commandEditor)===null||s===void 0||s.focus()}clear(){var e,t;(e=this.commandEditor)===null||e===void 0||e.focus(),(t=this.commandEditor)===null||t===void 0||(t=t.getModel())===null||t===void 0||t.setValue(""),this.commandHistoryIndex=null}layoutEditor(){this.commandEditor&&this.commandEditor.layout()}loadCommand(e){var t;if(!(e!==null&&e>=this.history.length)){var r=this.modifiedCommands.get(e),i=e===null?"":this.history[this.history.length-e-1];this.commandHistoryIndex=e,(t=this.commandEditor)===null||t===void 0||(t=t.getModel())===null||t===void 0||t.setValue(r??i),e!==null&&e>this.history.length-Er&&this.loadMoreHistory()}}loadMoreHistory(){var e=this;return Jp(function*(){try{if(e.loadingPromise!=null||e.bufferIndex==null)return;var{commandHistoryStorage:t,language:r,scope:i}=e.props;e.loadingPromise=He.makeCancelable(t.getTable(r,i??"",e.timestamp),a=>a.close());var s=yield e.loadingPromise;s.setReversed(!0),s.setViewport({top:e.bufferIndex,bottom:e.bufferIndex+Er-1}),e.loadingPromise=He.makeCancelable(s.getViewportData(),()=>s.close());var o=yield e.loadingPromise;e.bufferIndex+=Er,e.bufferIndex>=s.size&&(e.bufferIndex=null),e.history=[...o.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,s.close()}catch(a){if(e.loadingPromise=void 0,He.isCanceled(a)){_r.debug2("Promise canceled, not loading history");return}_r.error("Error fetching history",a)}})()}processCommand(e){this.commandHistoryIndex=null,this.modifiedCommands.clear(),L(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;L(e);var t=this.commandEditor.getContentHeight(),r=Math.max(Math.min(t,e),tv),i=t>r,s={overviewRulerLanes:i?void 0:0};this.setState({commandEditorHeight:r},()=>{var o,a;(o=this.commandEditor)===null||o===void 0||o.updateOptions(s),(a=this.commandEditor)===null||a===void 0||a.layout()})}}render(){var{disabled:e,language:t,session:r}=this.props,{commandEditorHeight:i,isFocused:s,model:o}=this.state;return u.jsx("div",{className:$("console-input-wrapper",{disabled:e}),children:u.jsxs("div",{className:$("console-input-inner-wrapper",{focus:s}),children:[u.jsx("div",{className:on.INPUT_CLASS_NAME,ref:this.commandContainer,style:{height:i}}),o&&u.jsx(I,{model:o,language:t,session:r})]})})}}Ae(on,"defaultProps",{maxHeight:Qn*10,scope:null,disabled:!1});Ae(on,"INPUT_CLASS_NAME","console-input");function Pt(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=rv(n,"string");return typeof e=="symbol"?e:e+""}function rv(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var To="pasted values",iv=[/^audio.*/,/^font.*/,/^image.*/,/^video.*/],Pr=[".csv",".tsv",".tab",".psv",".dsv",".txt"],Oo=[".zip"];class Pe extends c.Component{static isValidDropItem(e){return e!=null&&e.kind==="file"&&!iv.find(t=>t.test(e.type))}static isValidExtension(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return Pr.some(r=>e.endsWith(r))||t&&Oo.some(r=>e.endsWith(r))}static handleDragOver(e){e.preventDefault(),e.stopPropagation()}static getIcon(e){return e===To?hi:e.endsWith(".csv")?gl:e.endsWith(".zip")?bl:yl}constructor(e){super(e),Pt(this,"fileElem",void 0),Pt(this,"divElem",void 0),Pt(this,"getValidExtensions",Qt(t=>t?[...Pr,...Oo]:[...Pr])),Pt(this,"getAcceptString",Qt(t=>this.getValidExtensions(t).join(", "))),Pt(this,"getFileTypeErrorString",Qt(t=>_d.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=O.createRef(),this.divElem=O.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:r,dragError:i}=this.props;if(e.preventDefault(),e.stopPropagation(),i!=null){r();return}if(!(e.dataTransfer==null||e.dataTransfer.items==null||e.dataTransfer.items.length===0)){var s=e.dataTransfer.items[0].getAsFile();L(s),Pe.isValidExtension(s.name,t)?this.handleFile(s):this.setState({dropError:Pe.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:r}=this.props;r||navigator.clipboard.readText().then(i=>{e(i),this.setState({selectedFileName:To,dropError:void 0})}).catch(i=>t(i))}handlePasteEvent(e){e.stopPropagation(),e.preventDefault(),this.handleMenuPaste()}makeContextMenuItems(){var{uploadInProgress:e}=this.props;return[{title:"Paste",icon:hi,action:this.handleMenuPaste,shortcut:Yt.PASTE,disabled:e}]}render(){var{allowZip:e,dragError:t,uploadInProgress:r}=this.props,{selectedFileName:i,dropError:s}=this.state,o=t??s,a=this.makeContextMenuItems();return u.jsxs("div",{ref:this.divElem,className:"csv-overlay fill-parent-absolute",onDragOver:Pe.handleDragOver,onDrop:this.handleDrop,tabIndex:-1,children:[u.jsx(re,{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"}),!i&&(o===void 0||o==="")&&u.jsxs("div",{className:"message-content",children:[u.jsx("div",{className:"message-icon",children:u.jsx(le,{icon:Cl})}),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(te,{kind:"primary",onClick:this.handleSelectFile,children:"Select File..."})]}),i&&(o===void 0||o==="")&&u.jsxs("div",{className:"selected-content",children:[u.jsx("div",{className:"selected-icon",children:u.jsx(le,{icon:Pe.getIcon(i)})}),u.jsxs("div",{className:"selected-text",children:[u.jsx("label",{children:"Selected File"}),u.jsxs("label",{className:"selected-name",children:[i,!r&&u.jsx(te,{kind:"ghost",className:"ml-2",onClick:this.unstageFile,icon:wl,tooltip:"Remove"})]})]})]}),!!o&&u.jsxs("div",{className:"message-content",children:[u.jsx("div",{className:"message-icon",children:u.jsx(le,{icon:fs})}),u.jsx("label",{children:o}),o===Pe.FILE_TYPE_ERROR&&u.jsx("div",{className:"message-small",children:u.jsx("label",{children:this.getFileTypeErrorString(e)})})]})]})}}Pt(Pe,"defaultProps",{allowZip:!1,dragError:null});Pt(Pe,"MULTIPLE_FILE_ERROR","Please select only one file");Pt(Pe,"FILE_TYPE_ERROR","Filetype not supported.");function Ka(n,e){var t=n.internalStream("string");return t.readable=!0,t.read=()=>!1,t.removeListener=()=>!1,t.on("data",(r,i)=>e(i)),t}function xo(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function Io(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?xo(Object(t),!0).forEach(function(r){Se(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):xo(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function Se(n,e,t){return(e=ov(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function ov(n){var e=sv(n,"string");return typeof e=="symbol"?e:e+""}function sv(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var Do="unknown",av=2147483647,lv=-2147483648,Mo=/^[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]+)?$/,ko=/^([0-9]+T)?([0-9]+):([0-9]+)(:[0-9]+)?(?:\.[0-9]{1,9})?$/;class be{static determineType(e,t,r){if(!e||e===r)return t;switch(t){case B.STRING:return B.STRING;case B.INTEGER:return be.checkInteger(e);case B.LONG:return be.checkLong(e);case B.DOUBLE:return be.checkDouble(e);case B.BOOLEAN:return be.checkBoolean(e);case B.DATE_TIME:return be.checkDateTime(e);case B.LOCAL_TIME:return be.checkLocalTime(e);default:return be.getTypeFromUnknown(e)}}static isNotParsableNumber(e){return isNaN(e)||e==="Infinity"||e==="-Infinity"}static checkInteger(e){var t=e.replace(/,/g,"");return be.isNotParsableNumber(t)?B.STRING:be.getNumberType(t)}static checkLong(e){var t=e.replace(/,/g,"");return be.isNotParsableNumber(t)?B.STRING:t.includes(".")?B.DOUBLE:B.LONG}static checkDouble(e){var t=e.replace(/,/g,"");return be.isNotParsableNumber(t)?B.STRING:B.DOUBLE}static checkBoolean(e){var t=e.toLowerCase();return t==="true"||t==="false"?B.BOOLEAN:B.STRING}static checkDateTime(e){return Mo.test(e)?B.DATE_TIME:B.STRING}static checkLocalTime(e){return ko.test(e)?B.LOCAL_TIME:B.STRING}static getTypeFromUnknown(e){var t=e.replace(/,/g,"");if(be.isNotParsableNumber(t)){var r=e.toLowerCase();return r==="true"||r==="false"?B.BOOLEAN:Mo.test(e)&&e.includes(":")?B.DATE_TIME:ko.test(e)?B.LOCAL_TIME:B.STRING}return be.getNumberType(t)}static getNumberType(e){if(e.includes("."))return B.DOUBLE;var t=e.startsWith("-")?11:10;if(e.length>t)return B.LONG;var r=parseInt(e,10);return r>av||r<lv?B.LONG:B.INTEGER}constructor(e,t,r,i,s,o,a,l,d,h){Se(this,"onFileCompleted",void 0),Se(this,"file",void 0),Se(this,"readHeaders",void 0),Se(this,"nullString",void 0),Se(this,"onProgress",void 0),Se(this,"onError",void 0),Se(this,"types",void 0),Se(this,"chunks",void 0),Se(this,"totalChunks",void 0),Se(this,"rowCount",void 0),Se(this,"isZip",void 0),Se(this,"shouldTrim",void 0),Se(this,"zipProgress",void 0),Se(this,"config",void 0),this.onFileCompleted=e,this.file=t,this.readHeaders=r,this.nullString=s,this.onProgress=o,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=Io(Io({},i),{},{error:this.handleError,chunk:this.handleChunk,complete:this.handleComplete})}parse(){if(this.file instanceof File||this.file instanceof Blob)gn.parse(this.file,this.config);else{var e=Ka(this.file,this.handleNodeUpdate);gn.parse(e,this.config),e.resume()}}handleChunk(e,t){var{data:r}=e;if(!this.types){if(r==null||r.length===0){t.abort(),this.onError("Error parsing CSV: no data in file.");return}this.types=new Array(r[0].length).fill(Do),this.readHeaders&&(r=r.slice(1))}this.rowCount+=r.length,L(this.types);var i=[...this.types];r.forEach(a=>{if(a.length>=i.length){for(var l=0;l<i.length;l+=1)i[l]=be.determineType(this.shouldTrim?a[l].trim():a[l],i[l],this.nullString);this.types=i}else t.abort(),this.onError(`Error parsing CSV: Insufficient data in row.
|
|
5
5
|
Expected length `.concat(i.length," but found ").concat(a.length,`.
|
|
@@ -17,4 +17,4 @@ Row = `).concat(a))}),this.chunks+=1;var s=0;this.totalChunks>0?s=Math.round(thi
|
|
|
17
17
|
`))}}if(r=r.trimRight(),this.editor.setValue(r),t){var a,l=(a=this.editor.getModel())===null||a===void 0?void 0:a.getLineCount();L(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;if(this.editor){var r=(e=this.editor)===null||e===void 0||(t=e.getModel)===null||t===void 0||(t=t.call(e))===null||t===void 0?void 0:t.getLineCount();L(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 L(t),this.isLineVisible(t)}isLineVisible(e){var t,r=(t=this.editor)===null||t===void 0?void 0:t.getVisibleRanges();if(r==null||r.length===0)return!1;for(var i=0;i<r.length;i+=1){var s=r[i];if(s.startLineNumber<=e&&e<=s.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 r=this.bufferedMessages[t],i=ue.getLogText(r);e+=i,i.charAt(i.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,r=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(te,{kind:"ghost",className:"btn-clear-logs",onClick:this.handleClearClick,icon:Tl,tooltip:"Clear log"}),u.jsx(te,{kind:"ghost",className:"btn-link-icon btn-overflow",icon:Ol,tooltip:"Log Settings",onClick:()=>{},children:u.jsx(or,{actions:r,popperClassName:"log-level-menu-popper",popperOptions:e})})]}),u.jsx("div",{className:"log-pane-editor h-100 w-100",ref:i=>{this.editorContainer=i}})]})}}Re(ue,"DefaultLogLevels",[fe.STDOUT,fe.ERROR,fe.FATAL,fe.STDERR,fe.WARN]);Re(ue,"AllLogLevels",[fe.INFO,fe.STDOUT,fe.ERROR,fe.FATAL,fe.STDERR,fe.WARN,fe.DEBUG,fe.TRACE]);Re(ue,"bufferTimeout",16);Re(ue,"maxLogSize",131072);Re(ue,"truncateSize",65536);function Ko(n,e,t,r,i,s,o){try{var a=n[s](o),l=a.value}catch(d){return void t(d)}a.done?e(l):Promise.resolve(l).then(r,i)}function Hv(n){return function(){var e=this,t=arguments;return new Promise(function(r,i){var s=n.apply(e,t);function o(l){Ko(s,r,i,o,a,"next",l)}function a(l){Ko(s,r,i,o,a,"throw",l)}o(void 0)})}}var $v=R.module("HeapUsage");function Uv(n){var e,{connection:t,defaultUpdateInterval:r,hoverUpdateInterval:i,bgMonitoring:s=!0,monitorDuration:o}=n,a=Gh(),[l,d]=c.useState({freeMemory:0,maximumHeapSize:999,totalHeapSize:0}),[h,p]=c.useState(!1),m=c.useRef({timestamps:[],usages:[]}),v=Is(),f=c.useCallback(Hv(function*(){try{var j=yield t.getWorkerHeapInfo();if(!v.current)return;if(d(j),s||h){for(var H=(j.totalHeapSize-j.freeMemory)/j.maximumHeapSize,U=Date.now(),{timestamps:ce,usages:tt}=m.current;ce.length!==0&&U-ce[0]>o*1.5;)ce.shift(),tt.shift();ce.push(U),tt.push(H)}else m.current={timestamps:[],usages:[]}}catch(Ge){$v.warn("Unable to get heap usage",Ge)}}),[t,v,s,h,o]);Md(f,h?i:r);var g=(j,H)=>Math.round(j*10**H)/10**H,b=2,S=1024**3,{freeMemory:w,totalHeapSize:y,maximumHeapSize:D}=l,V=g(w/S,b),X=g(y/S,b),G=g(D/S,b),A=X-V,M=function(H,U){var ce=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return u.jsxs("div",{className:$("heap-usage-info-row",{"heading-bottom-border":ce}),children:[u.jsx("div",{className:"font-weight-bold",children:H}),u.jsx("div",{children:U})]})},{timestamps:J,usages:W}=m.current,k=(e=J[J.length-1])!==null&&e!==void 0?e:0,z=y/D,F=(y-w)/D;return u.jsxs("div",{className:"max-memory",children:[u.jsx("div",{className:"total-memory",style:{width:"calc(".concat(z*100,"% - ").concat(z*2,"px")}}),u.jsx("div",{className:$("used-memory",{"heap-overflow":(y-w)/D>.95}),style:{width:"calc(".concat(F*100,"% - ").concat(F*2,"px")}}),u.jsxs("div",{className:"memory-text",children:[G.toFixed(1)," GB"]}),u.jsx(ie,{onEntered:()=>p(!0),onExited:()=>p(!1),interactive:!0,children:u.jsxs("div",{className:"heap-tooltip",children:[M("In use:","".concat(A.toFixed(b)," of ").concat(G.toFixed(b)," GB"),!0),M("Free:","".concat(V.toFixed(b)," GB")),M("Total:","".concat(X.toFixed(b)," GB")),M("Max:","".concat(G.toFixed(b)," GB")),u.jsx("div",{className:"heap-plot",children:u.jsx(Vh,{data:[{x:[...J],y:[...W],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(o/6),gridcolor:a.linecolor,range:[k-o,k],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(o/1e3/60)," min."]})]})})]})}function Dn(n,e,t){return(e=Bv(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Bv(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 r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class Me{}Dn(Me,"SESSION_OPENED","ConsoleEvent.SESSION_OPENED");Dn(Me,"SESSION_CLOSED","ConsoleEvent.SESSION_CLOSED");Dn(Me,"FOCUS_HISTORY","ConsoleEvent.FOCUS_HISTORY");Dn(Me,"SEND_COMMAND","ConsoleEvent.SEND_COMMAND");Dn(Me,"SETTINGS_CHANGED","ConsoleEvent.SETTINGS_CHANGED");function Dt(n,e,t){return(e=Wv(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Wv(n){var e=zv(n,"string");return typeof e=="symbol"?e:e+""}function zv(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class it{}Dt(it,"TABLE_CHANGED","InputFilterEvent.TABLE_CHANGED");Dt(it,"COLUMNS_CHANGED","InputFilterEvent.COLUMNS_CHANGED");Dt(it,"FILTERS_CHANGED","InputFilterEvent.FILTERS_CHANGED");Dt(it,"CLEAR_ALL_FILTERS","InputFilterEvent.CLEAR_ALL_FILTERS");Dt(it,"COLUMN_SELECTED","InputFilterEvent.COLUMN_SELECTED");Dt(it,"OPEN_DROPDOWN","InputFilterEvent.OPEN_DROPDOWN");Dt(it,"OPEN_INPUT","InputFilterEvent.OPEN_INPUT");Dt(it,"OPEN_FILTER_SET_MANAGER","InputFilterEvent.OPEN_FILTER_SET_MANAGER");function ft(n,e,t){return(e=Vv(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Vv(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 r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class Te{}ft(Te,"CREATE_NOTEBOOK","NotebookEvent.createNotebook");ft(Te,"SELECT_NOTEBOOK","NotebookEvent.selectNotebook");ft(Te,"CLOSE_FILE","NotebookEvent.closeFile");ft(Te,"RENAME","NotebookEvent.rename");ft(Te,"RENAME_FILE","NotebookEvent.renameFile");ft(Te,"REGISTER_FILE","NotebookEvent.registerFile");ft(Te,"SEND_TO_NOTEBOOK","NotebookEvent.sendToNotebook");ft(Te,"UNREGISTER_FILE","NotebookEvent.unregisterFile");ft(Te,"PROMOTE_FROM_PREVIEW","NotebookEvent.promoteFromPreview");var qv=["children"];function Wo(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function zo(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Wo(Object(t),!0).forEach(function(r){Xv(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Wo(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function Xv(n,e,t){return(e=Zv(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Zv(n){var e=Yv(n,"string");return typeof e=="symbol"?e:e+""}function Yv(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function Jv(n,e){if(n==null)return{};var t,r,i=Qv(n,e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(n);for(r=0;r<s.length;r++)t=s[r],e.indexOf(t)===-1&&{}.propertyIsEnumerable.call(n,t)&&(i[t]=n[t])}return i}function Qv(n,e){if(n==null)return{};var t={};for(var r in n)if({}.hasOwnProperty.call(n,r)){if(e.indexOf(r)!==-1)continue;t[r]=n[r]}return t}class ef 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(it.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(it.CLEAR_ALL_FILTERS,this.handleClearAllFilters)}handleClearAllFilters(){for(var{onClearAllFilters:e}=this.props,t=arguments.length,r=new Array(t),i=0;i<t;i++)r[i]=arguments[i];e==null||e(...r)}handleSessionClosed(e){var{onSessionClose:t}=this.props;t==null||t(e)}handleSessionOpened(e,t){var{onSessionOpen:r}=this.props;r==null||r(e,t)}render(){var e=this.props,{children:t}=e,r=Jv(e,qv);return u.jsx(Ym,zo(zo({},r),{},{children:t}))}}var hr=Ks(ef),tf=Object.freeze({}),nf=new Map,cr=Object.freeze([]),Qg=(n,e)=>{var t;return(t=Ce(n,e).columns)!==null&&t!==void 0?t:cr},eb=(n,e)=>{var t;return(t=Ce(n,e).filterSets)!==null&&t!==void 0?t:cr},tb=(n,e)=>{var t;return(t=Ce(n,e).filters)!==null&&t!==void 0?t:cr},nb=(n,e)=>{var t;return(t=Ce(n,e).tableMap)!==null&&t!==void 0?t:nf},rb=(n,e)=>Ce(n,e).isolatedLinkerPanelId,ib=(n,e)=>{var t;return(t=Ce(n,e).links)!==null&&t!==void 0?t:cr},ob=(n,e)=>Ce(n,e).columnSelectionValidator,sb=(n,e)=>{var t;return(t=Ce(n,e).consoleSettings)!==null&&t!==void 0?t:tf},ab=(n,e)=>Ce(n,e).connection,mr=(n,e)=>Ce(n,e).sessionWrapper;function tr(n,e,t){return(e=rf(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function rf(n){var e=of(n,"string");return typeof e=="symbol"?e:e+""}function of(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var Un=R.module("CommandHistoryPanel");class Mn extends c.Component{static handleError(e){Un.error(e)}constructor(e){super(e),tr(this,"container",void 0),tr(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=O.createRef(),this.pending=new rr;var{session:t,sessionId:r,language:i}=e;this.state={panelState:{},session:t,sessionId:r,language:i,contextActions:[{action:this.handleFocusHistory,shortcut:en.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:r,sessionId:i}=t;this.setState({session:e,sessionId:i,language:r},()=>{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:r,language:i}=this.state;if(Un.debug("handleSendToNotebook",r,e),!r){Un.error("Session is not connected.");return}var{glEventHub:s}=this.props;s.emit(t?Te.CREATE_NOTEBOOK:Te.SEND_TO_NOTEBOOK,r,i,e)}handleSendToConsole(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;Un.debug("handleSendToConsole",e);var{glEventHub:i}=this.props;i.emit(Me.SEND_COMMAND,e,t,r)}loadTable(){var{commandHistoryStorage:e}=this.props,{language:t,sessionId:r}=this.state;L(t),L(r),this.pending.add(e.getTable(t,r,Date.now()),i=>i.close()).then(i=>{this.setState({table:i})}).catch(Mn.handleError)}render(){var{glContainer:e,glEventHub:t,commandHistoryStorage:r}=this.props,{language:i,contextActions:s,table:o}=this.state;return u.jsxs(hr,{className:"command-history-pane",componentPanel:this,glContainer:e,glEventHub:t,onSessionOpen:this.handleSessionOpened,onSessionClose:this.handleSessionClosed,onShow:this.handleShow,children:[!o&&u.jsx("div",{className:"command-history-disconnected-message",children:"Waiting for console connection"}),o&&i!=null&&u.jsxs(u.Fragment,{children:[u.jsx(_e,{ref:this.container,language:i,sendToNotebook:this.handleSendToNotebook,sendToConsole:this.handleSendToConsole,table:o,commandHistoryStorage:r}),u.jsx(re,{actions:s})]})]})}}tr(Mn,"COMPONENT","CommandHistoryPanel");tr(Mn,"TITLE","Command History");var sf=(n,e)=>{var t=qs(n),r=mr(n,e.localDashboardId),{session:i,config:s}=r??{},{type:o,id:a}=s??{};return{commandHistoryStorage:t,language:o,session:i,sessionId:a}},lb=Pn(sf,null,null,{forwardRef:!0})(Mn);function Vo(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function Bn(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Vo(Object(t),!0).forEach(function(r){$t(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Vo(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function $t(n,e,t){return(e=af(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function af(n){var e=lf(n,"string");return typeof e=="symbol"?e:e+""}function lf(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var Kn=R.module("ConsolePanel"),df=500,uf=Object.freeze({consoleSettings:{},itemIds:[]});class pr extends c.PureComponent{constructor(e){super(e),$t(this,"consoleRef",void 0),$t(this,"objectSubscriptionCleanup",void 0),$t(this,"savePanelState",En(()=>{var{consoleSettings:o,itemIds:a}=this.state,l={consoleSettings:o,itemIds:[...a]};Kn.debug("Saving panel state",l),this.setState({panelState:l})},df)),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=O.createRef();var{panelState:t}=e,r=Bn(Bn({},uf),t||{}),{consoleSettings:i,itemIds:s}=r;this.state={consoleSettings:i,itemIds:new Map(s),objectMap:new Map,error:void 0,panelState:r}}componentDidMount(){var{glEventHub:e}=this.props;this.closeDisconnectedPanels(),e.on(Y.MOUNT,this.handlePanelMount),this.subscribeToFieldUpdates()}componentDidUpdate(e,t){var{consoleSettings:r,itemIds:i}=this.state;(t.consoleSettings!==r||t.itemIds!==i)&&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(r=>{Kn.debug("Got updates",r),this.setState(i=>{var{objectMap:s}=i,{updated:o,created:a,removed:l}=r,d=[...o,...l],h=new Map(s);d.forEach(m=>{var{title:v}=m;v!==void 0&&h.delete(v)});var p=[...o,...a];return p.forEach(m=>{m.title!==void 0&&h.set(m.title,m)}),{objectMap:h}})})}}setItemId(e,t){this.setState(r=>{var{itemIds:i}=r,s=new Map(i);return s.set(e,t),{itemIds:s}})}getItemId(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,{itemIds:r}=this.state,i=r.get(e);return i==null&&t&&(i=ct(),this.setItemId(e,i)),i}handleTabFocus(){var e;(e=this.consoleRef.current)===null||e===void 0||e.focus()}handlePanelMount(e){var t,r,{itemIds:i}=this.state,s=e==null||(t=e.props)===null||t===void 0?void 0:t.id,o=e==null||(r=e.props)===null||r===void 0||(r=r.metadata)===null||r===void 0?void 0:r.sourcePanelId;if(s&&o){var a=new Set(i.values());a.has(o)&&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;L(this.context);var{root:r}=this.context,i=e.title!=null?this.getItemId(e.title,!1):null;(t||i!=null&&E.getStackForRoot(r,{id:i},!1,!1,!1)!=null)&&this.openWidget(e)}handleCloseObject(e){var{title:t}=e;if(t!==void 0){var r=this.getItemId(t,!1);if(r!=null){var{glEventHub:i}=this.props;i.emit(Y.CLOSE,r),Hm(i,t)}}}handleSettingsChange(e){var{glEventHub:t}=this.props;Kn.debug("handleSettingsChange",e),this.setState({consoleSettings:e}),t.emit(Me.SETTINGS_CHANGED,e)}openWidget(e){var{glEventHub:t,sessionWrapper:r}=this.props;L(r);var{config:i,session:s}=r,{title:o=e.name}=e;L(o);var a=this.getItemId(o),l={fetch:()=>s.getObject(e),panelId:a,widget:Bn(Bn({},$u(e)),{},{sessionId:i.id})};Kn.debug("openWidget",l),tm(t,l)}addCommand(e){var t,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;(t=this.consoleRef.current)===null||t===void 0||t.addCommand(e,r,i)}closeDisconnectedPanels(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,{consoleSettings:t,itemIds:r}=this.state,{isClosePanelsOnDisconnectEnabled:i=!0}=t;if(!(!i&&!e)){var s=[...r.values()],{glEventHub:o}=this.props;s.forEach(a=>{o.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(r=>Zi(r,e))}iconForType(e){var{plugins:t}=this.props,r=[...t.values()].find(i=>Zi(i,e));return r!=null?Ah(r):u.jsx(La,{type:e})}render(){var{commandHistoryStorage:e,glContainer:t,glEventHub:r,sessionWrapper:i,timeZone:s,unzip:o}=this.props;if(i==null)return u.jsx(_n,{isLoading:!1,errorMessage:"Console is disabled.","data-testid":"console-panel-loading-error"});var{consoleSettings:a,error:l,objectMap:d}=this.state,{config:h,session:p,connection:m,details:v={},dh:f}=i,{workerName:g,processInfoId:b}=v,{id:S,type:w}=h;return u.jsx(hr,{className:"iris-panel-console",componentPanel:this,glContainer:t,glEventHub:r,onResize:this.handleResize,onShow:this.handleShow,onTabFocus:this.handleTabFocus,errorMessage:l!=null?"".concat(l):void 0,children:p!=null&&u.jsx(Ot,{dh:f,ref:this.consoleRef,settings:a,session:p,focusCommandHistory:this.handleFocusCommandHistory,openObject:this.handleOpenObject,closeObject:this.handleCloseObject,commandHistoryStorage:e,onSettingsChange:this.handleSettingsChange,language:w,statusBarChildren:u.jsxs(u.Fragment,{children:[u.jsx("div",{children:Fa.LANGUAGE_MAP.get(w)}),g!=null&&u.jsxs(u.Fragment,{children:[u.jsx("div",{children:"•"}),g]}),b!=null&&u.jsxs(u.Fragment,{children:[u.jsx("div",{children:"•"}),b,u.jsx("div",{children:"•"})]}),u.jsx(Uv,{connection:m,defaultUpdateInterval:10*1e3,hoverUpdateInterval:3*1e3,monitorDuration:10*60*1e3})]}),showObjectsMenu:!1,scope:S,timeZone:s,objectMap:d,unzip:o,supportsType:this.supportsType,iconForType:this.iconForType})})}}$t(pr,"COMPONENT","ConsolePanel");$t(pr,"TITLE","Console");$t(pr,"contextType",Pa);var hf=(n,e)=>({commandHistoryStorage:qs(n),sessionWrapper:mr(n,e.localDashboardId),timeZone:Xu(n),plugins:Zu(n)}),db=Pn(hf,null,null,{forwardRef:!0})(pr);function ub(n){return n==="file"||n==="directory"}function Je(n){return n.type==="directory"}function cf(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=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 r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class li extends Error{constructor(){super("No file exists at the path specified"),cf(this,"isFileNotFound",!0)}}function Go(n,e,t,r,i,s,o){try{var a=n[s](o),l=a.value}catch(d){return void t(d)}a.done?e(l):Promise.resolve(l).then(r,i)}function qo(n){return function(){var e=this,t=arguments;return new Promise(function(r,i){var s=n.apply(e,t);function o(l){Go(s,r,i,o,a,"next",l)}function a(l){Go(s,r,i,o,a,"throw",l)}o(void 0)})}}var At=function(n){return 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="",n}({});class N{static fileExists(e,t){return qo(function*(){try{return yield e.info(t),!0}catch(r){if(!(r instanceof li))throw r;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(!N.hasPath(e))throw new Error("Invalid path provided: ".concat(e));var r=(t=e.match(/\//g))!==null&&t!==void 0?t:[];return r.length-1}static getExtension(e){var t=this.getBaseName(e).split(".");if(t.length>1){var r;return(r=t.pop())!==null&&r!==void 0?r:""}return""}static getBaseName(e){var t;return(t=e.split("/").pop())!==null&&t!==void 0?t:""}static getCopyFileName(e){var t=e.lastIndexOf("."),r=null,i=null;t<0?i=e:(i=e.substring(0,t),r=e.substring(t+1));var s=i?"".concat(i,"-copy"):"Copy";return r!==null?"".concat(s,".").concat(r):s}static getUniqueCopyFileName(e,t){return qo(function*(){for(var r=N.getCopyFileName(t);yield N.fileExists(e,r);)r=N.getCopyFileName(r);return r})()}static getMimeType(e){var t=this.getExtension(e).toLowerCase();switch(t){case"groovy":return At.GROOVY;case"py":return At.PYTHON;case"pyc":return At.PYTHON_COMPILED;case"scala":return At.SCALA;case"txt":return At.PLAIN_TEXT;default:return At.UNKNOWN}}static getParent(e){if(!N.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(!N.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]:"",r=e.lastIndexOf("."),i=r>-1?e.substring(0,r):e,s=N.fileExtensionToString(t);return"".concat(i).concat(s)}static validateName(e){var t=[".",".."],r=/[\\/\0]/g,i=new Map([["\0","null"]]);if(!e)throw new bn("Name cannot be empty");if(t.includes(e))throw new bn('"'.concat(e,'" is a reserved name'));if(r.test(e)){var s,o;throw new bn('Invalid characters in name: "'.concat((s=(o=e.match(r))===null||o===void 0?void 0:o.reduce((a,l)=>a.includes(l)?a:[...a,l],[]).map(a=>i.has(a)?i.get(a):a).join('", "'))!==null&&s!==void 0?s:"",'"'))}}static reducePaths(e){var t=e.filter(r=>N.isPath(r));return e.filter(r=>!t.some(i=>r!==i&&r.startsWith(i)))}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 di=26;function zr(n){return Je(n)?N.makePath(n.filename):N.getPath(n.filename)}function Xo(n,e){if(n.length===0||e==null)throw new Error("No items to move");var t=zr(e);if(n.some(r=>{var{filename:i}=r;return N.getPath(i)===t}))throw new Error("File already in the destination folder");if(n.some(r=>Je(r)&&t.startsWith(N.makePath(r.filename))))throw new Error("Destination folder cannot be a child of a dragged folder");return{files:n,targetPath:t}}function vf(n){if(Je(n))return n.isExpanded?xl:Il;var e=N.getMimeType(n.basename);switch(e){case At.PYTHON:return Ml;default:return Dl}}function Vr(n){var e,{children:t,draggedItems:r,isDragInProgress:i,isDropTargetValid:s,isSelected:o,item:a,itemIndex:l,dropTargetItem:d,onDragStart:h,onDragOver:p,onDragEnd:m,onDragExit:v,onDrop:f}=n,g=(e=r==null?void 0:r.some(A=>A.id===a.id))!==null&&e!==void 0?e:!1,b=zr(a),S=i&&d?zr(d):null,w=i&&s&&Je(a)&&S===b,y=i&&s&&S===b,D=i&&!s&&S===b,V=vf(a),X=N.getDepth(a.filename),G=Array(X).fill(null).map((A,M)=>u.jsx("span",{className:"file-list-depth-line"},M));return u.jsxs("div",{className:$("d-flex w-100 align-items-center","file-list-item",{"is-dragged":g,"is-exact-drop-target":w,"is-in-drop-target":y,"is-invalid-drop-target":D,"is-selected":o}),onDragStart:A=>h(l,A),onDragOver:A=>p(l,A),onDragEnd:A=>m(l,A),onDragExit:v,onDrop:A=>f(l,A),draggable:!0,role:"presentation","aria-label":a.basename,children:[G," ",u.jsx(le,{icon:V,className:"item-icon",fixedWidth:!0})," ",u.jsx("span",{className:"truncation-wrapper",children:t??u.jsxs(u.Fragment,{children:[a.basename,u.jsx(ie,{children:a.basename})]})})]})}function Zo(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function Wn(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Zo(Object(t),!0).forEach(function(r){ff(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Zo(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function ff(n,e,t){return(e=gf(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function gf(n){var e=bf(n,"string");return typeof e=="symbol"?e:e+""}function bf(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var we=R.module("FileList"),yf=500,Yo="item-list-scroll-pane";function Cf(n){var{isMultiSelect:e=!1,table:t,onFocusChange:r=()=>{},onMove:i,onSelect:s,onSelectionChange:o=()=>{},renderItem:a=Vr,rowHeight:l=di,overscanCount:d=Qe.DEFAULT_OVERSCAN}=n,[h,p]=c.useState(()=>({items:[],offset:0,itemCount:0})),[m,v]=c.useState({top:0,bottom:0}),[f,g]=c.useState(),[b,S]=c.useState(),[w,y]=c.useState(),[D,V]=c.useState([]),X=c.useRef(),G=c.useRef(null),A=c.useRef(null),M=c.useCallback(P=>{if(P.length===0||h==null)return[];for(var K=[],ne=0;ne<P.length;ne+=1)for(var pe=P[ne],je=pe[0];je<=pe[1];je+=1)je>=h.offset&&je<h.offset+h.items.length&&K.push(h.items[je-h.offset]);return K},[h]),J=c.useCallback(P=>{var K=M([[P,P]]);if(K.length>0)return K[0]},[M]),W=c.useCallback(()=>{var P=Ze.count(D);if(P===0)return null;if(P===1){var K=D[0][0],ne=J(K);if(ne!=null)return ne.filename}return"".concat(P," items")},[J,D]),k=c.useCallback(P=>{if(!(!b||!f)){we.debug("dropItems",b,"to",P);try{var{files:K,targetPath:ne}=Xo(b,f);if(i==null||i(K,ne),P!=null){var pe;V([[P,P]]),(pe=G.current)===null||pe===void 0||pe.focusItem(P)}}catch(je){we.error("Unable to complete move",je)}}},[b,f,i]),z=c.useCallback((P,K)=>{var ne=h.items[P-h.offset];ne!==void 0&&(we.debug("handleItemClick",ne),s(ne,K),Je(ne)&&(t==null||t.setExpanded(ne.filename,!ne.isExpanded)))},[h,s,t]),F=c.useCallback((P,K)=>{var ne,pe;we.debug2("handleItemDragStart",P,D);var je=D;Ze.isSelected(D,P)||(je=[[P,P]],V(je)),S(M(je)),(ne=G.current)===null||ne===void 0||ne.resetMouseState();var Mt=document.createElement("div"),Wt=document.createElement("div");Wt.className="dnd-placeholder-content",Wt.innerText=(pe=W())!==null&&pe!==void 0?pe:"",Mt.appendChild(Wt),Mt.className="file-list-dnd-placeholder",document.body.appendChild(Mt),K.dataTransfer.setDragImage(Mt,0,0),K.dataTransfer.effectAllowed="move",y(Mt)},[W,M,D]),j=c.useCallback((P,K)=>{K.preventDefault(),we.debug2("handleItemDragOver",K),g(J(P))},[J]),H=c.useCallback((P,K)=>{we.debug("handleItemDragEnd",P),w==null||w.remove(),S(void 0),g(void 0),y(void 0)},[w]),U=c.useCallback((P,K)=>{k(P)},[k]),ce=c.useCallback(()=>{we.debug2("handleItemDragExit"),g(void 0)},[]),tt=c.useCallback(P=>{P.target instanceof Element&&P.target.classList.contains(Yo)&&(P.preventDefault(),we.debug2("handleListDragOver",P),g({type:"directory",filename:"/",basename:"/",id:"/"}))},[]),Ge=c.useCallback(P=>{P.target instanceof Element&&P.target.classList.contains(Yo)&&(we.debug("handleListDrop"),k())},[k]),x=c.useCallback(function(P){var K=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(we.debug2("handleSelectionChange",P),K===!0||P!==D){V(P);var ne=M(P);o(ne)}},[M,o,D]),Q=c.useCallback(P=>{if(we.debug2("handleFocusChange",P),P!=null){var[K]=M([[P,P]]);r(K)}else r();X.current=P},[M,r]),oe=c.useCallback((P,K)=>{we.debug("handleViewportChange",P,K),(P!==m.top||K!==m.bottom)&&v({top:P,bottom:K})},[m]),hn=c.useMemo(()=>{if(!b||!f)return!1;try{return Xo(b,f),we.debug("handleValidateDropTarget true"),!0}catch{return we.debug("handleValidateDropTarget false"),!1}},[b,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(){we.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 K=t.onUpdate(ne=>{p({items:ne.items.map(pe=>Wn(Wn({},pe),{},{itemName:pe.basename})),offset:ne.offset,itemCount:t.size})});return()=>{K()}},[t]),c.useEffect(function(){X.current!=null&&Q(X.current),D.length>0&&x(D,!0)},[h,Q,x,D]),c.useEffect(function(){if(f!=null&&Je(f)&&f.filename!=="/"){var K=setTimeout(()=>{f.isExpanded||t==null||t.setExpanded(f.filename,!0)},yf);return()=>clearTimeout(K)}},[f,t]);var kn=c.useCallback(P=>a(Wn(Wn({},P),{},{isDragInProgress:b!=null,dropTargetItem:f,draggedItems:b,isDropTargetValid:hn,onDragStart:F,onDragEnd:H,onDragOver:j,onDragExit:ce,onDrop:U})),[H,ce,j,F,U,b,f,hn,a]);return u.jsx("div",{ref:A,className:$("file-list",{"is-dragging":b!=null}),onDragOver:tt,onDrop:Ge,children:u.jsx(Qe,{ref:G,items:h.items,itemCount:h.itemCount,offset:h.offset,onFocusChange:Q,onSelect:z,onSelectionChange:x,onViewportChange:oe,selectedRanges:D,renderItem:kn,rowHeight:l,isMultiSelect:e,isDragSelect:!1,isDeselectOnClick:!1})})}var wf={DELETE:ee.createAndAdd({id:"FILE_EXPLORER.DELETE",name:"Delete",shortcut:[C.DELETE],macShortcut:[_.CMD,C.BACKSPACE]}),RENAME:ee.createAndAdd({id:"FILE_EXPLORER.RENAME",name:"Rename",shortcut:[C.ENTER],macShortcut:[C.ENTER]})};const Jo={FILE_EXPLORER:wf};var Qo=R.module("FileListItemEditor"),Sf=()=>Promise.resolve();function _f(n){var{item:e,onCancel:t,onSubmit:r,validate:i=Sf}=n,s=c.useRef(null),[o,a]=c.useState(e.basename),[l,d]=c.useState(),[h,p]=c.useState(Promise.resolve()),m=c.useCallback(()=>{var w;(w=s.current)===null||w===void 0||w.focus()},[s]),v=c.useCallback(w=>w.stopPropagation(),[]),f=c.useCallback(()=>{h.then(()=>{r(o)}).catch(w=>Qo.info("Unable to validate name",w))},[r,o,h]);c.useEffect(function(){var y=He.makeCancelable(i(o));return y.then(()=>d(void 0)).catch(D=>{He.isCanceled(D)||d(D)}),p(y),()=>y.cancel()},[i,o]),c.useEffect(function(){m()},[m]);var g=c.useCallback(()=>{Qo.debug2("handleBlur"),f()},[f]),b=c.useCallback(w=>{var{value:y}=w.target;a(y)},[]),S=c.useCallback(w=>{w.stopPropagation();var{key:y}=w;switch(y){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:$("form-control file-list-item-editor-input",{"is-invalid":l}),value:o,ref:s,onBlur:g,onKeyDown:S,onChange:b,onClick:v,onDoubleClick:v,onMouseDown:v}),l&&u.jsx("div",{className:"invalid-feedback",children:"".concat(l)})]})}function es(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function Tr(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?es(Object(t),!0).forEach(function(r){Ef(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):es(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function Ef(n,e,t){return(e=Pf(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Pf(n){var e=Tf(n,"string");return typeof e=="symbol"?e:e+""}function Tf(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function Ga(n){var{isMultiSelect:e=!1,focusedPath:t,showContextMenu:r=!1,onCreateFile:i,onCreateFolder:s,onCopy:o,onDelete:a,onMove:l,onRename:d,onSelect:h,onSelectionChange:p,table:m,rowHeight:v=di,validateRename:f=()=>Promise.resolve()}=n,[g,b]=c.useState(),[S,w]=c.useState([]),[y,D]=c.useState(),V=c.useCallback(U=>{w(U),p==null||p(U)},[p]),X=c.useCallback(U=>{D(U)},[]),G=c.useCallback(()=>{y&&(o==null||o(y))},[y,o]),A=c.useCallback(()=>{S.length>0&&(a==null||a(S))},[a,S]),M=c.useCallback(()=>{i==null||i()},[i]),J=c.useCallback(()=>{y&&(s==null||s(N.getPath(y.filename)))},[y,s]),W=c.useCallback(()=>{y&&b(y)},[y]),k=c.useCallback(()=>{b(void 0)},[]),z=c.useCallback(U=>{g&&(d==null||d(g,U),b(void 0))},[d,g]),F=c.useMemo(()=>{if(g)return[];var U=[];return i&&U.push({title:"New File",description:"Create new file",action:M,group:re.groups.medium}),s&&U.push({title:"New Folder",description:"Create new folder",action:J,group:re.groups.medium}),o&&U.push({title:"Copy File",description:"Copy the selected file",action:G,group:re.groups.low,disabled:y==null||Je(y)}),a&&S.length>0&&U.push({title:"Delete",description:"Delete",shortcut:Jo.FILE_EXPLORER.DELETE,action:A,group:re.groups.low}),d&&U.push({title:"Rename",description:"Rename",shortcut:Jo.FILE_EXPLORER.RENAME,action:W,group:re.groups.low,disabled:y==null}),U},[G,A,M,J,W,y,o,i,s,a,d,S,g]),j=c.useCallback(U=>(L(g),f(g,U)),[g,f]),H=c.useCallback(U=>{var{item:ce}=U;return g&&g.filename===ce.filename?u.jsx(Vr,Tr(Tr({},U),{},{children:u.jsx(_f,{item:ce,validate:j,onSubmit:z,onCancel:k})})):u.jsx(Vr,Tr({},U))},[k,z,g,j]);return u.jsxs("div",{className:"file-list-container",children:[m!=null&&u.jsx(Cf,{onMove:l,onSelect:h,onSelectionChange:V,onFocusChange:X,renderItem:H,rowHeight:v,table:m,isMultiSelect:e,focusedPath:t}),r&&u.jsx(re,{actions:F})]})}Ga.displayName="FileListContainer";function ts(n,e,t){return(e=Of(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Of(n){var e=xf(n,"string");return typeof e=="symbol"?e:e+""}function xf(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class Gn extends bn{constructor(e){super("Name already exists"),ts(this,"isExistingFile",!0),ts(this,"info",void 0),this.info=e}}function ns(n,e,t,r,i,s,o){try{var a=n[s](o),l=a.value}catch(d){return void t(d)}a.done?e(l):Promise.resolve(l).then(r,i)}function rs(n){return function(){var e=this,t=arguments;return new Promise(function(r,i){var s=n.apply(e,t);function o(l){ns(s,r,i,o,a,"next",l)}function a(l){ns(s,r,i,o,a,"throw",l)}o(void 0)})}}var nt=R.module("FileExplorer");function ui(n){var{storage:e,isMultiSelect:t=!1,focusedPath:r,onCopy:i=()=>{},onDelete:s=()=>{},onRename:o=()=>{},onCreateFile:a=()=>{},onCreateFolder:l=()=>{},onSelect:d,onSelectionChange:h,rowHeight:p=di}=n,[m,v]=c.useState([]),[f,g]=c.useState();c.useEffect(function(){var z;function F(){return j.apply(this,arguments)}function j(){return j=rs(function*(){nt.debug("initTable"),z=He.makeCancelable(e.getTable(),H=>H.close());try{g(yield z)}catch(H){He.isCanceled(H)||nt.error("Unable to initialize table",H)}}),j.apply(this,arguments)}return F(),()=>{z.cancel()}},[e]);var b=c.useCallback(k=>{He.isCanceled(k)||nt.error(k)},[]),S=c.useCallback(()=>{nt.debug("handleCreateFile"),a()},[a]),w=c.useCallback(()=>{nt.debug("handleCreateFolder"),l()},[l]),y=c.useCallback(k=>{nt.debug("handleCopyFile",k.filename),i(k)},[i]),D=c.useCallback(k=>{nt.debug("handleDelete, pending confirmation",k),v(k)},[]),V=c.useCallback(()=>{nt.debug("handleDeleteConfirm",m),m.forEach(k=>e.deleteFile(Je(k)?N.makePath(k.filename):k.filename)),s(m),v([])},[m,s,e]),X=c.useCallback(()=>{nt.debug("handleDeleteCancel"),v([])},[]),G=c.useCallback((k,z)=>{var F=N.reducePaths(k.map(j=>Je(j)?N.makePath(j.filename):j.filename));F.forEach(j=>{var H=N.isPath(j)?"".concat(z).concat(N.getBaseName(j.substring(0,j.length-1)),"/"):"".concat(z).concat(N.getBaseName(j));e.moveFile(j,H).then(()=>{o(j,H)}).catch(b)})},[b,o,e]),A=c.useCallback((k,z)=>{var F=k.filename,j=Je(k);j&&!F.endsWith("/")&&(F="".concat(F,"/"));var H="".concat(N.getParent(F)).concat(z);j&&!H.endsWith("/")&&(H="".concat(H,"/")),nt.debug2("handleRename",F,H),e.moveFile(F,H).catch(b),o(F,H)},[b,o,e]),M=c.useCallback(function(){var k=rs(function*(z,F){if(F!==z.basename){N.validateName(F);var j="".concat(N.getPath(z.filename)).concat(F);try{var H=yield e.info(j);throw new Gn(H)}catch(U){if(!(U instanceof li))throw U}}});return function(z,F){return k.apply(this,arguments)}}(),[e]),J=m.length>0,W=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(Ga,{isMultiSelect:t,focusedPath:r,showContextMenu:!0,onCopy:y,onCreateFolder:w,onCreateFile:S,onMove:G,onDelete:D,onRename:A,onSelect:d,onSelectionChange:h,rowHeight:p,table:f,validateRename:M}),u.jsx(Nr,{isOpen:J,headerText:W,bodyText:"You cannot undo this action.",onCancel:X,onConfirm:V,confirmButtonText:"Delete"})]})}ui.displayName="FileExplorer";function is(n,e,t,r,i,s,o){try{var a=n[s](o),l=a.value}catch(d){return void t(d)}a.done?e(l):Promise.resolve(l).then(r,i)}function If(n){return function(){var e=this,t=arguments;return new Promise(function(r,i){var s=n.apply(e,t);function o(l){is(s,r,i,o,a,"next",l)}function a(l){is(s,r,i,o,a,"throw",l)}o(void 0)})}}function Lt(n,e,t){return(e=Df(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Df(n){var e=Mf(n,"string");return typeof e=="symbol"?e:e+""}function Mf(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var kt=R.module("NewItemModal");class tn extends c.PureComponent{static getValidationMessage(e){return e instanceof Gn&&e.info.type==="directory"?"Error: Cannot overwrite existing directory":"".concat(e)}static handleError(e){He.isCanceled(e)||kt.error(e)}constructor(e){super(e),Lt(this,"inputRef",O.createRef()),Lt(this,"cancelableValidatePromise",void 0),Lt(this,"cancelableExistingItemPromise",void 0),Lt(this,"pending",new rr),Lt(this,"pathMap",new Map),Lt(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,r=N.hasPath(t)?N.getPath(t):"/";this.state={isSubmitting:!1,path:r,prevExtension:N.getExtension(t),showExtensionChangeModal:!1,showOverwriteModal:!1,value:N.getBaseName(t)}}componentDidUpdate(e,t){var{isOpen:r}=this.props,{isOpen:i}=e,{value:s,path:o}=this.state;!i&&r&&(this.resetValue(),this.isInitialLoad=!0),i&&r&&(!this.isInitialLoad&&(o!==t.path||s!==t.value)&&this.updateValidationStatus(o,s),this.isInitialLoad=!1)}componentWillUnmount(){this.pending.cancel(),this.cancelableValidatePromise&&this.cancelableValidatePromise.cancel(),this.cancelableExistingItemPromise&&this.cancelableExistingItemPromise.cancel()}resetValue(){var{defaultValue:e}=this.props,t=N.hasPath(e)?N.getPath(e):"/";this.setState({path:t,value:N.getBaseName(e),validationError:void 0,prevExtension:N.getExtension(e),isSubmitting:!1})}getValidationPromise(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return this.cancelableValidatePromise&&this.cancelableValidatePromise.cancel(),this.cancelableValidatePromise=He.makeCancelable(this.validateName(e,t,r)),this.cancelableValidatePromise}validateName(e,t,r){var i=this;return If(function*(){N.validateName(t);var{defaultValue:s,storage:o}=i.props;if(r){var a="".concat(e).concat(t);if(a!==s)try{var l=yield o.info(a);throw new Gn(l)}catch(d){if(!(d instanceof li))throw d}}return t})()}updateValidationStatus(e,t){this.getValidationPromise(e,t).then(()=>{this.setState({validationError:void 0})}).catch(this.handleValidationError).catch(tn.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:N.makePath(e.filename)});else{var t=e.basename,r=N.getPath(e.filename);this.setState({value:t,path:r},()=>{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:r}=this.props;r();break}}}handleValidationError(e){if(!(e instanceof bn))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:r}=this.state;kt.debug("handleOverwriteConfirm",t,r),e("".concat(t).concat(r),!0)}handleExtensionChangeCancel(){kt.debug("handleExtensionChangeCancel"),this.setState(e=>{var{value:t,prevExtension:r}=e,i=N.replaceExtension(t,r);return{showExtensionChangeModal:!1,value:i}}),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:r}=e,i=t==="directory"?r.length:r.lastIndexOf(".");e.focus(),e.setSelectionRange(0,i>0?i:r.length)}}submitModal(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;this.setState(t=>{var{prevExtension:r,value:i,path:s}=t,{notifyOnExtensionChange:o,type:a}=this.props;kt.debug("submitModal",r,i);var l=N.getExtension(i);return o&&!e&&r!==null&&r!==l?{isSubmitting:!1,showExtensionChangeModal:!0,newExtension:l}:(this.getValidationPromise(s,i,!0).then(d=>{var{onSubmit:h}=this.props;h("".concat(s).concat(i))}).catch(d=>{if(d instanceof Gn&&a!=="directory"&&d.info.type!=="directory"){this.setState({showOverwriteModal:!0});return}throw d}).catch(d=>{throw He.isCanceled(d)&&this.setState({isSubmitting:!1}),d}).catch(this.handleValidationError).catch(tn.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((r,i)=>{for(var s="",o=0;o<i;o+=1)s+="".concat(t[o],"/");return s+="".concat(r,"/"),u.jsxs(O.Fragment,{children:[u.jsx(te,{kind:"ghost",className:"directory-breadcrumbs",onClick:()=>this.handleBreadcrumbSelect(s),"aria-label":i===0?"Home":void 0,icon:i===0?u.jsx(le,{icon:kl,transform:"right-1.6"}):void 0,tooltip:i===0?"Home":void 0,children:r}),"/"]},s)})}render(){var{storage:e,isOpen:t,onCancel:r,placeholder:i,title:s,type:o}=this.props,{isSubmitting:a,path:l,showExtensionChangeModal:d,showOverwriteModal:h,validationError:p,value:m,prevExtension:v,newExtension:f}=this.state,g=o==="directory",b=N.fileExtensionToString(v),S=N.fileExtensionToString(f),w=g?"Create":"Save",y=g?"New folder name":"Save file as";return u.jsxs(u.Fragment,{children:[u.jsxs(ls,{isOpen:t,toggle:r,onOpened:this.handleModalOpened,className:"modal-dialog-centered new-file-modal",children:[u.jsx(ds,{toggle:r,children:s}),u.jsx(us,{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:y}),u.jsx("input",{id:"file-name-input",type:"text",autoComplete:"off",autoCapitalize:"none",autoCorrect:"off",spellCheck:"false",className:$("form-control",{"is-invalid":p}),value:m,placeholder:i,ref:this.inputRef,onKeyDown:this.handleKeyDown,onChange:this.handleChange}),p&&u.jsx("div",{className:"invalid-feedback",children:tn.getValidationMessage(p)})]}),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(ui,{onSelect:this.handleSelect,storage:e,focusedPath:l})})]})})}),u.jsxs(ks,{children:[u.jsx(te,{kind:"secondary",onClick:r,children:"Cancel"}),u.jsx(te,{kind:"primary",disabled:a,onClick:this.handleModalSubmit,children:w})]})]}),u.jsx(Nr,{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(Nr,{isOpen:d,headerText:"Confirm extension change",bodyText:'Are you sure you want to change extension from "'.concat(b,'" to "').concat(S,'"?'),onCancel:this.handleExtensionChangeCancel,onConfirm:this.handleExtensionChangeConfirm,cancelButtonText:'Keep "'.concat(b,'"'),confirmButtonText:'Use "'.concat(S,'"')})]})}}Lt(tn,"defaultProps",{isOpen:!1,defaultValue:"/",notifyOnExtensionChange:!1,placeholder:"",onSubmit:(n,e)=>{},onCancel:()=>{}});function kf(n){var{createFile:e,createFolder:t,onSearchChange:r,defaultSearchText:i=""}=n;return u.jsxs("div",{className:"file-explorer-toolbar",children:[u.jsxs("div",{className:"file-explorer-toolbar-buttons",children:[u.jsx(te,{kind:"ghost",icon:gs,tooltip:"New notebook",onClick:e,"aria-label":"New notebook"}),u.jsx(te,{kind:"ghost",icon:jl,tooltip:"New folder",onClick:t,"aria-label":"New folder"})]}),r&&u.jsx("div",{className:"file-explorer-toolbar-search",children:u.jsx($s,{value:i,onChange:r,placeholder:"Search by name"})})]})}function os(n,e,t,r,i,s,o){try{var a=n[s](o),l=a.value}catch(d){return void t(d)}a.done?e(l):Promise.resolve(l).then(r,i)}function jf(n){return function(){var e=this,t=arguments;return new Promise(function(r,i){var s=n.apply(e,t);function o(l){os(s,r,i,o,a,"next",l)}function a(l){os(s,r,i,o,a,"throw",l)}o(void 0)})}}function qa(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 r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var jt=R.module("FileExplorerPanel"),Lf=(n,e)=>{var t=Gu(n),r=mr(n,e.localDashboardId),{session:i,config:s}=r??{},o=s==null?void 0:s.type;return{fileStorage:t,language:o,session:i}},Rf=Pn(Lf,null,null,{forwardRef:!0});function Ff(n){var e=n;return e!=null&&typeof e.button=="number"}class an extends O.Component{static handleError(e){jt.error(e)}static isFocusEvent(e){return Ff(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:r}=e;this.state={isShown:!1,language:r,session:t,showCreateFolder:!1,focusedFilePath:"/"}}componentDidMount(){this.isHidden()||this.setState({isShown:!0})}handleCreateFile(){var{glEventHub:e}=this.props,{session:t,language:r}=this.state,i={language:r,value:""};jt.debug("handleCreateFile",t,r,i),e.emit(Te.CREATE_NOTEBOOK,t,r,i)}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(an.handleError)}handleCopyFile(e){var t=this;return jf(function*(){var{fileStorage:r}=t.props;if(Je(e)){jt.error("Invalid item in handleCopyItem",e);return}var i=yield N.getUniqueCopyFileName(r,e.filename);yield r.copyFile(e.filename,i)})()}handleDelete(e){var{glEventHub:t}=this.props;e.forEach(r=>{t.emit(Te.CLOSE_FILE,{id:r.filename,itemName:r.filename})})}handleSelectionChange(e){var t="/";e.length===1&&(e[0].type==="directory"?t=N.makePath(e[0].filename):t=N.getPath(e[0].filename)),this.setState({focusedFilePath:t})}handleFileSelect(e,t){if(jt.debug("fileSelect",e),e.type!=="directory"){var r=an.isFocusEvent(t),i={id:e.filename,itemName:e.filename},{glEventHub:s}=this.props,{session:o,language:a}=this.state,l={value:null,language:a};s.emit(Te.SELECT_NOTEBOOK,o,a,l,i,r)}}handleRename(e,t){var{glEventHub:r}=this.props;jt.debug("handleRename",e,t),r.emit(Te.RENAME_FILE,e,t)}handleSessionOpened(e,t){var{language:r}=t;this.setState({session:e,language:r})}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:r}=this.props,{isShown:i,showCreateFolder:s,focusedFilePath:o}=this.state;return u.jsxs(hr,{className:"file-explorer-panel",componentPanel:this,glContainer:t,glEventHub:r,onSessionOpen:this.handleSessionOpened,onSessionClose:this.handleSessionClosed,onShow:this.handleShow,children:[u.jsx(kf,{createFile:this.handleCreateFile,createFolder:this.handleCreateDirectory}),i&&u.jsx(ui,{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(tn,{isOpen:s,type:"directory",title:"Create New Folder",storage:e,onSubmit:this.handleCreateDirectorySubmit,onCancel:this.handleCreateDirectoryCancel,defaultValue:o})]})}}qa(an,"COMPONENT","FileExplorerPanel");qa(an,"TITLE","File Explorer");var hb=Rf(an);function Sn(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=$f(n,"string");return typeof e=="symbol"?e:e+""}function $f(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var ss=R.module("LogPanel");class vr extends c.PureComponent{constructor(e){super(e),Sn(this,"isBottomVisible",void 0),Sn(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){ss.debug("Session opened",[e]),this.setState({session:e})}handleSessionClosed(e){ss.debug("Session closed",e)}updateDimensions(){this.logView&&this.logView.updateDimensions()}render(){var{glContainer:e,glEventHub:t}=this.props,{session:r}=this.state;return u.jsxs(hr,{componentPanel:this,glContainer:e,glEventHub:t,onResize:this.handleResize,onHide:this.handleHide,onShow:this.handleShow,onSessionOpen:this.handleSessionOpened,onSessionClose:this.handleSessionClosed,children:[r==null&&u.jsx("div",{className:"log-panel-disconnected-message",children:"Waiting for session connection"}),r!=null&&u.jsx(ue,{session:r,ref:i=>{this.logView=i}})]})}}Sn(vr,"defaultProps",{session:null});Sn(vr,"COMPONENT","LogPanel");Sn(vr,"TITLE","Log");var Uf=(n,e)=>{var t;return{session:(t=mr(n,e.localDashboardId))===null||t===void 0?void 0:t.session}},cb=Pn(Uf,null,null,{forwardRef:!0})(vr);export{Rs as $,dn as A,te as B,he as C,or as D,Gl as E,As as F,re as G,sr as H,Qe as I,Yt as J,C as K,Nr as L,_ as M,$s as N,ar as O,ir as P,ks as Q,Ze as R,de as S,ie as T,Bs as U,Kd as V,qr as W,Yf as X,xu as Y,Xr as Z,Jf as _,Xg as a,Hm as a$,Ks as a0,Ls as a1,ou as a2,qn as a3,Au as a4,Vs as a5,zs as a6,Ws as a7,Qf as a8,eg as a9,qf as aA,bi as aB,$h as aC,Qr as aD,Sg as aE,Vh as aF,Gh as aG,E as aH,Pg as aI,Ug as aJ,Ym as aK,Fm as aL,Rm as aM,Vg as aN,Sr as aO,Ma as aP,Kg as aQ,Ng as aR,Ag as aS,Pa as aT,dm as aU,Y as aV,oi as aW,Sa as aX,Oa as aY,Hn as aZ,_a as a_,tg as aa,ht as ab,ke as ac,mt as ad,B as ae,Fe as af,bg as ag,Cg as ah,Jr as ai,yg as aj,ta as ak,wg as al,un as am,Ys as an,Ah as ao,Nh as ap,kh as aq,Qs as ar,Dh as as,Ih as at,fg as au,Mh as av,gg as aw,jh as ax,Js as ay,Zi as az,ym as b,db as b$,qg as b0,Tg as b1,Dg as b2,xg as b3,kg as b4,Hg as b5,Ce as b6,$g as b7,Ia as b8,Ea as b9,Ra as bA,_e as bB,er as bC,Mv as bD,ur as bE,Fa as bF,dp as bG,$a as bH,ep as bI,rn as bJ,Ha as bK,on as bL,yv as bM,Jn as bN,Uv as bO,ue as bP,Wr as bQ,La as bR,en as bS,Zr as bT,N as bU,li as bV,ub as bW,em as bX,ii as bY,zg as bZ,ah as b_,Zg as ba,Gg as bb,nm as bc,im as bd,rm as be,om as bf,Eg as bg,fm as bh,Da as bi,_m as bj,Lg as bk,Rg as bl,Fg as bm,Yg as bn,Og as bo,Mg as bp,Ig as bq,jg as br,Wg as bs,Jg as bt,Gt as bu,Pm as bv,ye as bw,Wp as bx,I as by,Ot as bz,Ou as c,cb as c0,lb as c1,hb as c2,ld as c3,Ju as c4,Yu as c5,lg as c6,sg as c7,ag as c8,dg as c9,ig as cA,mr as cB,Te as cC,Me as cD,tn as cE,Je as cF,Xu as cG,Le as cH,ab as cI,sb as cJ,Zf as cK,ot as cL,Gf as cM,gr as cN,ed as cO,bn as cP,Qu as ca,eh as cb,th as cc,nh as cd,fh as ce,_d as cf,Vf as cg,Wf as ch,Os as ci,hr as cj,ib as ck,It as cl,it as cm,pg as cn,nb as co,og as cp,rb as cq,tb as cr,ob as cs,rr as ct,ng as cu,Qg as cv,rg as cw,eb as cx,mg as cy,Gu as cz,hg as d,tm as e,vg as f,$u as g,ug as h,Zs as i,cg as j,Xf as k,Md as l,Tn as m,kd as n,Ds as o,Is as p,jd as q,ee as r,Bg as s,Nd as t,Hu as u,Ms as v,_s as w,zf as x,He as y,Ns as z};
|
|
20
|
-
//# sourceMappingURL=LogPanel-
|
|
20
|
+
//# sourceMappingURL=LogPanel-Ah0favpj.js.map
|