@deephaven/code-studio 0.85.42 → 0.85.44
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/{AppRoot-BE9o3jQm.js → AppRoot-C6kDqTPG.js} +5 -5
- package/build/assets/{AppRoot-BE9o3jQm.js.map → AppRoot-C6kDqTPG.js.map} +1 -1
- package/build/assets/{Chart-CVVe2Wrn.js → Chart-nxkQ36AL.js} +2 -2
- package/build/assets/{Chart-CVVe2Wrn.js.map → Chart-nxkQ36AL.js.map} +1 -1
- package/build/assets/{ControlType-C3G8KL5r.js → ControlType-jO4itTaw.js} +4 -4
- package/build/assets/{ControlType-C3G8KL5r.js.map → ControlType-jO4itTaw.js.map} +1 -1
- package/build/assets/{FontBootstrap-T7G9mX1O.js → FontBootstrap-BKzvuf6E.js} +2 -2
- package/build/assets/{FontBootstrap-T7G9mX1O.js.map → FontBootstrap-BKzvuf6E.js.map} +1 -1
- package/build/assets/{FormatterUtils-CgbiAbYu.js → FormatterUtils-Cwpv404N.js} +2 -2
- package/build/assets/{FormatterUtils-CgbiAbYu.js.map → FormatterUtils-Cwpv404N.js.map} +1 -1
- package/build/assets/{Grid-BPd5Cp8S.js → Grid-C8zEQk55.js} +3 -3
- package/build/assets/Grid-C8zEQk55.js.map +1 -0
- package/build/assets/{IrisGrid-DLdEpZqW.js → IrisGrid-BEGXHYhk.js} +3 -3
- package/build/assets/IrisGrid-BEGXHYhk.js.map +1 -0
- package/build/assets/{IrisGridModel-DAXx34_0.js → IrisGridModel-YHztILtC.js} +3 -3
- package/build/assets/{IrisGridModel-DAXx34_0.js.map → IrisGridModel-YHztILtC.js.map} +1 -1
- package/build/assets/{IrisGridShortcuts-BLA6co0D.js → IrisGridShortcuts-BJQd46kO.js} +2 -2
- package/build/assets/{IrisGridShortcuts-BLA6co0D.js.map → IrisGridShortcuts-BJQd46kO.js.map} +1 -1
- package/build/assets/{IrisGridThemeProvider-DEHsxyC1.js → IrisGridThemeProvider-jOr-RZGC.js} +2 -2
- package/build/assets/{IrisGridThemeProvider-DEHsxyC1.js.map → IrisGridThemeProvider-jOr-RZGC.js.map} +1 -1
- package/build/assets/{LocalWorkspaceStorage-DbYhY_qG.js → LocalWorkspaceStorage-5CYTwmzN.js} +2 -2
- package/build/assets/{LocalWorkspaceStorage-DbYhY_qG.js.map → LocalWorkspaceStorage-5CYTwmzN.js.map} +1 -1
- package/build/assets/{MarkdownEditor-BenZTwzf.js → MarkdownEditor-D1cvoyMS.js} +2 -2
- package/build/assets/{MarkdownEditor-BenZTwzf.js.map → MarkdownEditor-D1cvoyMS.js.map} +1 -1
- package/build/assets/{MarkdownNotebook-BxXofSyL.js → MarkdownNotebook-DhNRFKM5.js} +2 -2
- package/build/assets/{MarkdownNotebook-BxXofSyL.js.map → MarkdownNotebook-DhNRFKM5.js.map} +1 -1
- package/build/assets/{MissingPartitionError-CQYoc6XY.js → MissingPartitionError-4MWvlLBA.js} +2 -2
- package/build/assets/{MissingPartitionError-CQYoc6XY.js.map → MissingPartitionError-4MWvlLBA.js.map} +1 -1
- package/build/assets/Plot-wDSZHXHD.js +2 -0
- package/build/assets/{Plot-CKt-TpBm.js.map → Plot-wDSZHXHD.js.map} +1 -1
- package/build/assets/{Plotly-CKCOSj6B.js → Plotly-vwyC0AnS.js} +2 -2
- package/build/assets/{Plotly-CKCOSj6B.js.map → Plotly-vwyC0AnS.js.map} +1 -1
- package/build/assets/{StyleGuideRoot-BstqHVIO.js → StyleGuideRoot-J2E8hBaN.js} +2 -2
- package/build/assets/{StyleGuideRoot-BstqHVIO.js.map → StyleGuideRoot-J2E8hBaN.js.map} +1 -1
- package/build/assets/{TokenBoxCellRenderer-Del1y61J.js → TokenBoxCellRenderer-CnLL13GQ.js} +2 -2
- package/build/assets/{TokenBoxCellRenderer-Del1y61J.js.map → TokenBoxCellRenderer-CnLL13GQ.js.map} +1 -1
- package/build/assets/{index-B2hEC56I.js → index-CPf_E9PV.js} +3 -3
- package/build/assets/{index-B2hEC56I.js.map → index-CPf_E9PV.js.map} +1 -1
- package/build/assets/{index-CrUitb97.js → index-LUB4MMxa.js} +4 -4
- package/build/assets/{index-CrUitb97.js.map → index-LUB4MMxa.js.map} +1 -1
- package/build/assets/{index-BmB6poVO.js → index-SEFnRmbU.js} +2 -2
- package/build/assets/{index-BmB6poVO.js.map → index-SEFnRmbU.js.map} +1 -1
- package/build/assets/plotly-B-tleqxD.js +7 -0
- package/build/assets/{plotly-DrshdwQD.js.map → plotly-B-tleqxD.js.map} +1 -1
- package/build/index.html +2 -2
- package/package.json +10 -10
- package/build/assets/Grid-BPd5Cp8S.js.map +0 -1
- package/build/assets/IrisGrid-DLdEpZqW.js.map +0 -1
- package/build/assets/Plot-CKt-TpBm.js +0 -2
- package/build/assets/plotly-DrshdwQD.js +0 -7
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./Plot-
|
|
2
|
-
import{r as m,by as mi,V as $,bB as Sl,J as u,L as _a,M as X,R as Dr,a3 as S,bC as wl,N as he,I as kt,H as Oa,a1 as Sn,a2 as pn,bD as El,bE as Pl,bF as Tl,bA as Gn,bG as _l,bH as Ol,ab as wt,bI as Wn,av as xi,bJ as k,bK as Mi,bL as Il,ad as Ia,a5 as vi,bM as Dl,a0 as In}from"./vendor-DKP6ul09.js";import{L as W,ax as Da,T as xa,S as xl,a3 as Ml,P as kl,a6 as Nl,a2 as jl,a7 as Al,_ as Ll,ac as Fl,M as Ma,b as ka,c as Na,al as Rl,ay as $l,az as ja,aA as Aa,aB as Hl,aC as Bl,J as sn,ag as Wl,aD as Ul,aE as Vl,aF as Kl,aG as zl,aH as Gl,aI as ql,aJ as Zl,aK as Xl,aL as Yl,aM as Ql,C as La,aw as Jl,at as Fa,au as Ra,U as $a,j as ed,e as R,d as Rn,aN as td,aa as Ha,aO as ki,aP as nd,aQ as rd,aR as id,aS as od,f as Ba,am as Wa,aT as Ua,aU as Un,as as ad,aV as sd,F as Ni,aW as Va,aX as ji,aY as Ka,aZ as ld,I as dd,a_ as ud,a4 as hd,a$ as cd,A as md,a5 as vd,b0 as pd,b1 as fd,b2 as gd,b3 as bd,b4 as yd,b5 as Cd,b6 as Sd,ao as wd,b7 as Ed,b8 as Pd}from"./index-B2hEC56I.js";import{e as mt,l as Ct,K as et,a as qt,b as Ai,R as Td,_ as za}from"./monaco-C4VaWq8m.js";var $g=Object.freeze([]),Hg=new Map,Bg=()=>{};function Wg(n){return Array.isArray(n)?n:[n]}function Br(){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 _d(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=Id(n,"string");return typeof e=="symbol"?e:e+""}function Id(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 Qr extends Error{constructor(){super(...arguments),_d(this,"isCanceled",!0)}}function Dd(n){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,t=xd(n,e);t.forEach(r=>{n[r]=n[r].bind(n)})}function xd(n,e){for(var t=new Set,r=n,i=0;r!=null&&r!==Object.prototype&&(i<=1||e);){for(var o of Object.getOwnPropertyNames(r)){var a;o!=="constructor"&&typeof((a=Object.getOwnPropertyDescriptor(r,o))===null||a===void 0?void 0:a.value)=="function"&&t.add(o)}r=Object.getPrototypeOf(r),i+=1}return[...t.keys()]}function Li(n,e,t,r,i,o,a){try{var s=n[o](a),l=s.value}catch(d){return void t(d)}s.done?e(l):Promise.resolve(l).then(r,i)}function Md(n){return function(){var e=this,t=arguments;return new Promise(function(r,i){var o=n.apply(e,t);function a(l){Li(o,r,i,a,s,"next",l)}function s(l){Li(o,r,i,a,s,"throw",l)}a(void 0)})}}function Ga(n){return Jr.apply(this,arguments)}function Jr(){return Jr=Md(function*(n){var{clipboard:e}=navigator;if(e!==void 0)try{return navigator.clipboard.writeText(n)}catch{return Fi(n)}Fi(n)}),Jr.apply(this,arguments)}function Fi(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 ln(n,e,t){return(e=kd(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function kd(n){var e=Nd(n,"string");return typeof e=="symbol"?e:e+""}function Nd(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 jd="table_",qa="column_",Ad=new Set(["in","not","i","ii","k"]),Ld=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"]),Fd=/[^a-zA-Z0-9_$\-+@]/g,Rd=/[^A-Za-z0-9_$]/g,$d=/^[a-zA-Z_$][a-zA-Z0-9_$\-+@]*$/,Hd=/[^a-zA-Z0-9_]/g;function Bd(n){return n.replace(/[ -]/g,"_")}function Wd(n){return n.replace(/\s/g,"_")}class Xe{}ln(Xe,"legalize",(n,e,t,r,i,o)=>{var a=e(n.trim());return i&&(Ad.has(a)||Ld.has(a))&&(a=t+a),a=a.replace(r,""),a?(/^[0-9-]/.test(a)&&(a=t+a),a):t+o});ln(Xe,"legalizeTableName",n=>Xe.legalize(n,Wd,jd,Fd,!1,0));ln(Xe,"makeVariableName",n=>Xe.legalizeTableName(n).replace(Hd,"_"));ln(Xe,"legalizeColumnNames",n=>{var e=[];return n.forEach((t,r)=>{var i=Xe.legalizeColumnName(t,r);e.includes(i)&&(i=qa+r),e.push(i)}),e});ln(Xe,"legalizeColumnName",function(n){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return Xe.legalize(n,Bd,qa,Rd,!0,e)});ln(Xe,"isValidTableName",n=>$d.test(n));ln(Xe,"isValidColumnName",n=>Xe.legalizeColumnName(n)===n);class Za extends CustomEvent{constructor(e,t){super(e,t)}}function Ud(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=Kd(n,"string");return typeof e=="symbol"?e:e+""}function Kd(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var 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 Xa extends Error{constructor(){super(...arguments),Ud(this,"isTimeout",!0)}}class Te{static makeCancelable(e,t){var r=!1,i,o,a=new Promise((s,l)=>{o=l,Promise.resolve(e).then(d=>{r?t&&t(d):(i=d,s(d))}).catch(d=>l(d))});return a.cancel=()=>{r=!0,o(new Qr),i!=null&&t&&t(i)},a}static isCanceled(e){return e instanceof Qr}static isTimedOut(e){return e instanceof Xa}static withTimeout(e,t){return new Promise((r,i)=>{setTimeout(()=>{try{r(t())}catch(o){i(o)}},e)})}}function Ri(n,e,t){return(e=zd(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function zd(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)}class Dn{constructor(){Ri(this,"pending",[]),Ri(this,"resolved",[])}add(e,t){var r=Te.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 Ug(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 ct{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(!ct.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],o=i[0],a=i[1];if(o<=t&&t<=a)return!0}return!1}static selectRange(e,t){for(var[r,i]=t,o=[...e],a=o.length-1;a>=0;a-=1){var s=o[a],l=s[0],d=s[1];if(l<=r&&i<=d)return o;r<=d&&l<=i&&(r=Math.min(r,l),i=Math.max(i,d),o.splice(a,1))}return o.push([r,i]),o}static deselectRange(e,t){for(var[r,i]=t,o=[...e],a=o.length-1;a>=0;a-=1){var s=o[a],l=s[0],d=s[1];if(!(i<l||d<r))if(l<r&&i<d){o[a]=[l,r-1],o.splice(a+1,0,[i+1,d]);break}else r<=l&&d<=i?o.splice(a,1):l<r?o[a]=[l,r-1]:o[a]=[i+1,d]}return o}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 o=[...r],a=i[0];a<=i[1];a+=1)o.push(e[a]);return o},[])}}function*Vg(n,e){for(var t=n;t<=e;++t)yield t}var Kg=" ";class Ya{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}}function Qa(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=Zd(n,"string");return typeof e=="symbol"?e:e+""}function Zd(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var 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{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"),o=r%60,a=String(Math.ceil(o)).padStart(2,"0");return"".concat(t,":").concat(i,":").concat(a)}static isTimeString(e){return new RegExp(xn.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])}}Qa(xn,"TIME_PATTERN","([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]");Qa(xn,"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 Xd(n,e,t){return(e=Yd(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Yd(n){var e=Qd(n,"string");return typeof e=="symbol"?e:e+""}function Qd(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 extends Error{constructor(){super(...arguments),Xd(this,"isInvalid",!0)}}function Ja(){var n=m.useRef(!1);return m.useEffect(()=>(n.current=!0,()=>{n.current=!1}),[]),n}function $i(n,e,t,r,i,o,a){try{var s=n[o](a),l=s.value}catch(d){return void t(d)}s.done?e(l):Promise.resolve(l).then(r,i)}function Jd(n){return function(){var e=this,t=arguments;return new Promise(function(r,i){var o=n.apply(e,t);function a(l){$i(o,r,i,a,s,"next",l)}function s(l){$i(o,r,i,a,s,"throw",l)}a(void 0)})}}var eu=W.module("useAsyncInterval");function tu(n,e){var t=Ja(),r=m.useRef(0),i=m.useRef(0),o=m.useRef(null),a=m.useCallback(Jd(function*(){var s=Date.now();i.current+=1;var l=o.current==null?e:s-o.current;o.current=s;try{yield n()}catch(c){eu.error("A tick error occurred:",c)}if(t.current){l+=Date.now()-o.current;var d=Math.max(0,l-e),h=Math.max(0,e-d);r.current=window.setTimeout(a,h)}}),[n,t,e]);m.useEffect(()=>(o.current=null,a(),()=>{window.clearTimeout(r.current)}),[e,a])}function Xn(n){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"No value available in context. Was code wrapped in a provider?",t=m.useContext(n);if(t==null)throw new Error(e);return t}function nu(n,e,t){var r=m.useRef(t),i=m.useRef(n);i.current=n;var o=m.useMemo(()=>mi(function(){return i.current(...arguments)},e,r.current),[e]);return m.useEffect(()=>()=>{var a,s;(a=(s=r.current)===null||s===void 0?void 0:s.flushOnUnmount)!==null&&a!==void 0&&a?o.flush():o.cancel()},[o]),o}function ru(n){var e=m.useRef();return m.useEffect(function(){e.current=n}),e.current}function es(n){var e=m.useRef(null);return m.useEffect(function(){n&&(typeof n=="function"?n(e.current):n.current=e.current)}),e}var iu=3500,ou=W.module("useCopyToClipboard");function au(){var[n,e]=m.useState(!1),t=m.useRef(null),r=m.useCallback(i=>{Ga(i).then(()=>{e(!0)}).catch(o=>ou.error("Unable to copy ".concat(i),`
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./Plot-wDSZHXHD.js","./Plotly-vwyC0AnS.js","./plotly-B-tleqxD.js","./helpers-BosuxZz1.js","./vendor-DKP6ul09.js","./vendor-dwDTpqeK.css","./MarkdownNotebook-DhNRFKM5.js","./index-CPf_E9PV.js","./monaco-C4VaWq8m.js","./monaco-BSe5n4Us.css","./index-QQhNGkua.css","./mathjax-CS2eaJoM.js","./MarkdownNotebook-CmpkKxys.css"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{r as m,by as mi,V as $,bB as Sl,J as u,L as _a,M as X,R as Dr,a3 as S,bC as wl,N as he,I as kt,H as Oa,a1 as Sn,a2 as pn,bD as El,bE as Pl,bF as Tl,bA as Gn,bG as _l,bH as Ol,ab as wt,bI as Wn,av as xi,bJ as k,bK as Mi,bL as Il,ad as Ia,a5 as vi,bM as Dl,a0 as In}from"./vendor-DKP6ul09.js";import{L as W,ax as Da,T as xa,S as xl,a3 as Ml,P as kl,a6 as Nl,a2 as jl,a7 as Al,_ as Ll,ac as Fl,M as Ma,b as ka,c as Na,al as Rl,ay as $l,az as ja,aA as Aa,aB as Hl,aC as Bl,J as sn,ag as Wl,aD as Ul,aE as Vl,aF as Kl,aG as zl,aH as Gl,aI as ql,aJ as Zl,aK as Xl,aL as Yl,aM as Ql,C as La,aw as Jl,at as Fa,au as Ra,U as $a,j as ed,e as R,d as Rn,aN as td,aa as Ha,aO as ki,aP as nd,aQ as rd,aR as id,aS as od,f as Ba,am as Wa,aT as Ua,aU as Un,as as ad,aV as sd,F as Ni,aW as Va,aX as ji,aY as Ka,aZ as ld,I as dd,a_ as ud,a4 as hd,a$ as cd,A as md,a5 as vd,b0 as pd,b1 as fd,b2 as gd,b3 as bd,b4 as yd,b5 as Cd,b6 as Sd,ao as wd,b7 as Ed,b8 as Pd}from"./index-CPf_E9PV.js";import{e as mt,l as Ct,K as et,a as qt,b as Ai,R as Td,_ as za}from"./monaco-C4VaWq8m.js";var $g=Object.freeze([]),Hg=new Map,Bg=()=>{};function Wg(n){return Array.isArray(n)?n:[n]}function Br(){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 _d(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=Id(n,"string");return typeof e=="symbol"?e:e+""}function Id(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 Qr extends Error{constructor(){super(...arguments),_d(this,"isCanceled",!0)}}function Dd(n){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,t=xd(n,e);t.forEach(r=>{n[r]=n[r].bind(n)})}function xd(n,e){for(var t=new Set,r=n,i=0;r!=null&&r!==Object.prototype&&(i<=1||e);){for(var o of Object.getOwnPropertyNames(r)){var a;o!=="constructor"&&typeof((a=Object.getOwnPropertyDescriptor(r,o))===null||a===void 0?void 0:a.value)=="function"&&t.add(o)}r=Object.getPrototypeOf(r),i+=1}return[...t.keys()]}function Li(n,e,t,r,i,o,a){try{var s=n[o](a),l=s.value}catch(d){return void t(d)}s.done?e(l):Promise.resolve(l).then(r,i)}function Md(n){return function(){var e=this,t=arguments;return new Promise(function(r,i){var o=n.apply(e,t);function a(l){Li(o,r,i,a,s,"next",l)}function s(l){Li(o,r,i,a,s,"throw",l)}a(void 0)})}}function Ga(n){return Jr.apply(this,arguments)}function Jr(){return Jr=Md(function*(n){var{clipboard:e}=navigator;if(e!==void 0)try{return navigator.clipboard.writeText(n)}catch{return Fi(n)}Fi(n)}),Jr.apply(this,arguments)}function Fi(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 ln(n,e,t){return(e=kd(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function kd(n){var e=Nd(n,"string");return typeof e=="symbol"?e:e+""}function Nd(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 jd="table_",qa="column_",Ad=new Set(["in","not","i","ii","k"]),Ld=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"]),Fd=/[^a-zA-Z0-9_$\-+@]/g,Rd=/[^A-Za-z0-9_$]/g,$d=/^[a-zA-Z_$][a-zA-Z0-9_$\-+@]*$/,Hd=/[^a-zA-Z0-9_]/g;function Bd(n){return n.replace(/[ -]/g,"_")}function Wd(n){return n.replace(/\s/g,"_")}class Xe{}ln(Xe,"legalize",(n,e,t,r,i,o)=>{var a=e(n.trim());return i&&(Ad.has(a)||Ld.has(a))&&(a=t+a),a=a.replace(r,""),a?(/^[0-9-]/.test(a)&&(a=t+a),a):t+o});ln(Xe,"legalizeTableName",n=>Xe.legalize(n,Wd,jd,Fd,!1,0));ln(Xe,"makeVariableName",n=>Xe.legalizeTableName(n).replace(Hd,"_"));ln(Xe,"legalizeColumnNames",n=>{var e=[];return n.forEach((t,r)=>{var i=Xe.legalizeColumnName(t,r);e.includes(i)&&(i=qa+r),e.push(i)}),e});ln(Xe,"legalizeColumnName",function(n){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return Xe.legalize(n,Bd,qa,Rd,!0,e)});ln(Xe,"isValidTableName",n=>$d.test(n));ln(Xe,"isValidColumnName",n=>Xe.legalizeColumnName(n)===n);class Za extends CustomEvent{constructor(e,t){super(e,t)}}function Ud(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=Kd(n,"string");return typeof e=="symbol"?e:e+""}function Kd(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var 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 Xa extends Error{constructor(){super(...arguments),Ud(this,"isTimeout",!0)}}class Te{static makeCancelable(e,t){var r=!1,i,o,a=new Promise((s,l)=>{o=l,Promise.resolve(e).then(d=>{r?t&&t(d):(i=d,s(d))}).catch(d=>l(d))});return a.cancel=()=>{r=!0,o(new Qr),i!=null&&t&&t(i)},a}static isCanceled(e){return e instanceof Qr}static isTimedOut(e){return e instanceof Xa}static withTimeout(e,t){return new Promise((r,i)=>{setTimeout(()=>{try{r(t())}catch(o){i(o)}},e)})}}function Ri(n,e,t){return(e=zd(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function zd(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)}class Dn{constructor(){Ri(this,"pending",[]),Ri(this,"resolved",[])}add(e,t){var r=Te.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 Ug(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 ct{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(!ct.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],o=i[0],a=i[1];if(o<=t&&t<=a)return!0}return!1}static selectRange(e,t){for(var[r,i]=t,o=[...e],a=o.length-1;a>=0;a-=1){var s=o[a],l=s[0],d=s[1];if(l<=r&&i<=d)return o;r<=d&&l<=i&&(r=Math.min(r,l),i=Math.max(i,d),o.splice(a,1))}return o.push([r,i]),o}static deselectRange(e,t){for(var[r,i]=t,o=[...e],a=o.length-1;a>=0;a-=1){var s=o[a],l=s[0],d=s[1];if(!(i<l||d<r))if(l<r&&i<d){o[a]=[l,r-1],o.splice(a+1,0,[i+1,d]);break}else r<=l&&d<=i?o.splice(a,1):l<r?o[a]=[l,r-1]:o[a]=[i+1,d]}return o}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 o=[...r],a=i[0];a<=i[1];a+=1)o.push(e[a]);return o},[])}}function*Vg(n,e){for(var t=n;t<=e;++t)yield t}var Kg=" ";class Ya{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}}function Qa(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=Zd(n,"string");return typeof e=="symbol"?e:e+""}function Zd(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var 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{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"),o=r%60,a=String(Math.ceil(o)).padStart(2,"0");return"".concat(t,":").concat(i,":").concat(a)}static isTimeString(e){return new RegExp(xn.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])}}Qa(xn,"TIME_PATTERN","([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]");Qa(xn,"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 Xd(n,e,t){return(e=Yd(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Yd(n){var e=Qd(n,"string");return typeof e=="symbol"?e:e+""}function Qd(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 extends Error{constructor(){super(...arguments),Xd(this,"isInvalid",!0)}}function Ja(){var n=m.useRef(!1);return m.useEffect(()=>(n.current=!0,()=>{n.current=!1}),[]),n}function $i(n,e,t,r,i,o,a){try{var s=n[o](a),l=s.value}catch(d){return void t(d)}s.done?e(l):Promise.resolve(l).then(r,i)}function Jd(n){return function(){var e=this,t=arguments;return new Promise(function(r,i){var o=n.apply(e,t);function a(l){$i(o,r,i,a,s,"next",l)}function s(l){$i(o,r,i,a,s,"throw",l)}a(void 0)})}}var eu=W.module("useAsyncInterval");function tu(n,e){var t=Ja(),r=m.useRef(0),i=m.useRef(0),o=m.useRef(null),a=m.useCallback(Jd(function*(){var s=Date.now();i.current+=1;var l=o.current==null?e:s-o.current;o.current=s;try{yield n()}catch(c){eu.error("A tick error occurred:",c)}if(t.current){l+=Date.now()-o.current;var d=Math.max(0,l-e),h=Math.max(0,e-d);r.current=window.setTimeout(a,h)}}),[n,t,e]);m.useEffect(()=>(o.current=null,a(),()=>{window.clearTimeout(r.current)}),[e,a])}function Xn(n){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"No value available in context. Was code wrapped in a provider?",t=m.useContext(n);if(t==null)throw new Error(e);return t}function nu(n,e,t){var r=m.useRef(t),i=m.useRef(n);i.current=n;var o=m.useMemo(()=>mi(function(){return i.current(...arguments)},e,r.current),[e]);return m.useEffect(()=>()=>{var a,s;(a=(s=r.current)===null||s===void 0?void 0:s.flushOnUnmount)!==null&&a!==void 0&&a?o.flush():o.cancel()},[o]),o}function ru(n){var e=m.useRef();return m.useEffect(function(){e.current=n}),e.current}function es(n){var e=m.useRef(null);return m.useEffect(function(){n&&(typeof n=="function"?n(e.current):n.current=e.current)}),e}var iu=3500,ou=W.module("useCopyToClipboard");function au(){var[n,e]=m.useState(!1),t=m.useRef(null),r=m.useCallback(i=>{Ga(i).then(()=>{e(!0)}).catch(o=>ou.error("Unable to copy ".concat(i),`
|
|
3
3
|
`,o))},[]);return m.useEffect(()=>(t.current&&clearTimeout(t.current),n&&(t.current=setTimeout(()=>{e(!1)},iu)),()=>{t.current&&clearTimeout(t.current)}),[n]),[n,r]}function Hi(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?Hi(Object(t),!0).forEach(function(r){yn(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Hi(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function yn(n,e,t){return(e=lu(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function lu(n){var e=du(n,"string");return typeof e=="symbol"?e:e+""}function du(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 Bi="popper";class Yn extends m.Component{constructor(e){super(e),yn(this,"element",void 0),yn(this,"container",void 0),yn(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=$.createRef(),this.rAF=0;var{isShown:t}=this.props;this.state={show:t,popper:null}}componentDidUpdate(e){var{isShown:t}=this.props;e.isShown!==t&&(t?(cancelAnimationFrame(this.rAF),this.rAF=window.requestAnimationFrame(()=>{this.show()})):this.hide())}componentWillUnmount(){this.destroyPopper(!1)}getVisibleElement(e){return e==null||e.clientHeight>0||e.clientWidth>0?e:this.getVisibleElement(e.parentElement)}initPopper(){var{popper:e}=this.state,{closeOnBlur:t,referenceObject:r}=this.props;if(!e&&this.container.current!==null){var{options:i}=this.props;i=su({placement:"auto",modifiers:{preventOverflow:{boundariesElement:"viewport"}}},i),document.body.appendChild(this.element);var o=this.getVisibleElement(this.container.current);o==null&&(o=this.container.current),e=new Sl(r||o,this.element,i),e.scheduleUpdate(),cancelAnimationFrame(this.rAF),this.rAF=window.requestAnimationFrame(()=>{if(t){var a=this.element.querySelector(".".concat(Bi));a instanceof HTMLElement&&!a.contains(document.activeElement)&&a.focus()}}),this.setState({popper:e})}}destroyPopper(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;cancelAnimationFrame(this.rAF);var{popper:t}=this.state;t&&(t.destroy(),document.body.contains(this.element)&&document.body.removeChild(this.element),e&&this.setState({popper:null}))}show(){this.initPopper(),this.setState({show:!0})}hide(){this.setState({show:!1})}scheduleUpdate(){var{popper:e}=this.state;e&&e.scheduleUpdate()}handleBlur(e){e.relatedTarget instanceof HTMLElement&&(this.element.contains(e.relatedTarget)||this.hide())}handleEnter(){var{onEntered:e}=this.props;e()}handleExit(){var{onExited:e}=this.props,{show:t}=this.state;t||this.destroyPopper(),e()}renderContent(){var{className:e,children:t,timeout:r,interactive:i,closeOnBlur:o}=this.props,{show:a}=this.state;return u.jsx(Da,{isPortal:!0,children:u.jsx(_a,{in:a,timeout:r,classNames:"popper-transition",onEntered:this.handleEnter,onExited:this.handleExit,children:u.jsx("div",{onClick:s=>{s.stopPropagation()},onKeyDown:s=>{s.key==="Escape"&&this.hide()},className:X(Bi,{interactive:i},e),onBlur:o?this.handleBlur:void 0,tabIndex:o?-1:void 0,role:"presentation",children:u.jsxs("div",{className:"popper-content",children:[t,u.jsx("div",{className:"popper-arrow","x-arrow":""})]})})})})}render(){var{popper:e}=this.state,{"data-testid":t}=this.props;return u.jsx("div",{className:"popper-parent-container",ref:this.container,style:{display:"none"},"data-testid":t,children:e&&Dr.createPortal(this.renderContent(),this.element)})}}yn(Yn,"propTypes",{children:S.node.isRequired,options:S.shape({}),className:S.string,timeout:S.number,onEntered:S.func,onExited:S.func,isShown:S.bool,closeOnBlur:S.bool,interactive:S.bool,referenceObject:S.shape({}),"data-testid":S.string});yn(Yn,"defaultProps",{options:{},className:"",timeout:xa.transitionMs,onEntered(){},onExited(){},isShown:!1,interactive:!1,closeOnBlur:!1,referenceObject:null,"data-testid":void 0});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 uu(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){pt(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 pt(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 mu=W.module("Tooltip");class ue extends m.Component{static handleHidden(){ue.shownTooltipCount-=1,ue.shownTooltipCount===0&&(ue.lastHiddenTime=Date.now())}static handleShown(){ue.shownTooltipCount+=1}constructor(e){super(e),pt(this,"container",void 0),pt(this,"popper",void 0),pt(this,"parent",void 0),pt(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=$.createRef(),this.popper=$.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?ue.handleShown():ue.handleHidden())}componentWillUnmount(){this.stopListening(),this.stopListeningWindow(),this.stopTimer();var{isShown:e}=this.state;e&&ue.handleHidden()}startListening(){if(!this.container.current||!this.container.current.parentElement){mu.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 o=this.popper.current.element.getBoundingClientRect(),a=this.parent.getBoundingClientRect();t>=o.left&&t<=o.left+o.width&&r>=o.top&&r<=o.top+o.height?this.handleMouseMove():t>=a.left&&t<=a.left+a.width&&r>=a.top&&r<=a.top+a.height?this.handleMouseMove():i&&(this.stopTimer(),this.hide())}}startTimer(){this.stopTimer();var{timeout:e,reshowTimeout:t}=this.props,r=e;(ue.shownTooltipCount>0||Date.now()-ue.lastHiddenTime<ue.triggerReshowThreshold)&&(r=t),this.timer=window.setTimeout(this.handleTimeout,r)}stopTimer(){this.timer!=null&&(clearTimeout(this.timer),this.timer=null)}show(){var{isShown:e}=this.state;if(this.stopTimer(),!e){var t;(t=this.popper.current)===null||t===void 0||t.show(),this.setState({isShown:!0});var{interactive:r}=this.props;r&&this.startListeningWindow()}}hide(){var e;(e=this.popper.current)===null||e===void 0||e.hide(),this.stopListeningWindow()}update(){var e;(e=this.popper.current)===null||e===void 0||e.scheduleUpdate()}handleExited(){this.setState({isShown:!1});var{onExited:e}=this.props;e()}stopShowingTooltip(){var{isShown:e}=this.state;this.stopTimer(),e&&this.hide()}render(){var{interactive:e,children:t,referenceObject:r,popperClassName:i,"data-testid":o,onEntered:a}=this.props,{isShown:s}=this.state,{options:l}=this.props;return l=uu({placement:"bottom"},l),u.jsx("div",{ref:this.container,style:{display:"none"},"data-testid":o,children:u.jsx(Yn,{className:X(i,"popper-tooltip"),options:l,ref:this.popper,onEntered:a,onExited:this.handleExited,interactive:e,referenceObject:r,children:u.jsxs("div",{className:"tooltip-content",children:[" ",s&&t]})})})}}pt(ue,"defaultTimeout",500);pt(ue,"defaultReshowTimeout",100);pt(ue,"triggerReshowThreshold",300);pt(ue,"shownTooltipCount",0);pt(ue,"lastHiddenTime",Date.now());pt(ue,"defaultProps",{interactive:!1,options:{},popperClassName:"",reshowTimeout:ue.defaultReshowTimeout,timeout:ue.defaultTimeout,onEntered:()=>{},onExited:()=>{},"data-testid":void 0});var vu=W.module("ThemeProvider"),ts=m.createContext(null);function zg(n){var{themes:e,defaultPreloadValues:t=xl,children:r}=n,i=m.useMemo(()=>Ml(),[]),[o,a]=m.useState(null),[s,l]=m.useState(()=>{var c,v;return(c=(v=Nl())===null||v===void 0?void 0:v.themeKey)!==null&&c!==void 0?c:kl}),d=m.useMemo(()=>e==null?null:jl(s,{base:i,custom:e??[]}),[i,s,e]),h=m.useMemo(()=>[...i,...e??[]],[i,e]);return m.useEffect(function(){if(!(d==null||e==null)){Al(t);var v=Ll(t);vu.debug2("updateThemePreloadData:",{active:d.map(p=>p.themeKey),custom:e.map(p=>p.themeKey),preloadStyleContent:v,selectedThemeKey:s}),Fl({themeKey:s,preloadStyleContent:v})}},[d,s,e,t]),m.useEffect(()=>{a({activeThemes:d,selectedThemeKey:s,themes:h,setSelectedThemeKey:l})},[d,s,h]),u.jsxs(u.Fragment,{children:[d==null?null:u.jsx(u.Fragment,{children:d.map(c=>u.jsx("style",{"data-theme-key":c.themeKey,children:c.styleContent},c.themeKey))}),o==null?null:u.jsx(ts.Provider,{value:o,children:u.jsx(Da,{children:r})})]})}function ns(){return Xn(ts,"No ThemeContext value found. Component must be wrapped in a ThemeContext.Provider")}function xr(n){var{children:e,className:t,style:r,"data-testid":i}=n;return u.jsx("div",{className:X("btn-group",t),style:r,role:"group","data-testid":i,children:e})}xr.displayName="SplitButtonGroup";xr.propTypes={children:S.node.isRequired,className:S.string,style:S.object,"data-testid":S.string};xr.defaultProps={className:null,style:{},"data-testid":void 0};var pu=["kind","variant","type","tooltip","icon","disabled","active","onClick","onContextMenu","onMouseDown","onMouseUp","onMouseEnter","onMouseLeave","onKeyDown","className","style","children","tabIndex","data-testid","aria-label"];function Ui(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?Ui(Object(t),!0).forEach(function(r){fu(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Ui(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function fu(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)}function yu(n,e){if(n==null)return{};var t,r,i=Cu(n,e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(n);for(r=0;r<o.length;r++)t=o[r],e.indexOf(t)===-1&&{}.propertyIsEnumerable.call(n,t)&&(i[t]=n[t])}return i}function Cu(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 Su=["primary","secondary","tertiary","success","danger","inline","ghost"],wu=["group-end"];function Eu(n,e){switch(n){case"primary":return"btn-primary";case"secondary":return"btn-outline-primary";case"tertiary":return"btn-secondary";case"success":return"btn-success";case"danger":return"btn-danger";case"inline":return"btn-inline";case"ghost":return X("btn-link",{"btn-link-icon":e,"btn-link-icon-only":e})}}function Pu(n){switch(n){case"group-end":return X("pl-2","pr-3")}}var ee=$.forwardRef((n,e)=>{var{kind:t,variant:r,type:i,tooltip:o,icon:a,disabled:s=!1,active:l,onClick:d,onContextMenu:h,onMouseDown:c,onMouseUp:v,onMouseEnter:p,onMouseLeave:g,onKeyDown:f,className:y,style:T,children:O,tabIndex:P,"data-testid":F,"aria-label":U}=n,te=yu(n,pu),{UNSAFE_className:N}=wl({},"button"),B;r&&(B=Pu(r));var H;a&&(H=$.isValidElement(a)?a:u.jsx(he,{icon:a}));var J=H!=null&&O==null,oe=Eu(t,J),L;o!==void 0&&(L=typeof o=="string"?u.jsx(ue,{children:o}):o);var q=U;U===void 0&&J&&o!=null&&typeof o=="string"&&(q=o);var K=u.jsxs("button",Vi(Vi({"data-testid":F,ref:e,type:i,className:X("btn",oe,B,{active:l},y,N),onClick:d,onContextMenu:h,onMouseUp:v,onMouseDown:c,onMouseEnter:p,onMouseLeave:g,onKeyDown:f,style:T,disabled:s,tabIndex:P,"aria-label":q},te),{},{children:[a&&H,O,o!=null&&!s&&L]}));return s&&o!=null?u.jsxs("span",{className:"btn-disabled-wrapper",children:[K,L]}):K});ee.displayName="Button";ee.propTypes={kind:S.oneOf(Su).isRequired,variant:S.oneOf(wu),type:S.oneOf(["submit","reset","button"]),tooltip(n){var{tooltip:e,icon:t,children:r}=n;return e===void 0&&t!=null&&r==null?new Error("Tooltip is required for icon only buttons"):null},icon(n){var{children:e,icon:t}=n;return t==null&&e==null?new Error("Icon is required if no children are provided"):e==null&&!$.isValidElement(t)&&(t==null||t.iconName===""||t.iconName==null)?new Error("Icon must be react element or fontawesome IconDefinition"):null},disabled:S.bool,active:S.bool,onClick(n){var{onClick:e,type:t}=n;return t==="button"&&typeof e!="function"?new Error("type button requires an onClick function"):e!==void 0&&typeof e!="function"?new Error("onClick must be a function"):null},onContextMenu:S.func,onMouseUp:S.func,onMouseDown:S.func,onMouseEnter:S.func,onMouseLeave:S.func,onKeyDown:S.func,tabIndex:S.number,children:S.node,className:S.string,style:S.object,"data-testid":S.string};ee.defaultProps={type:"button",onClick:void 0,onContextMenu:void 0,onMouseUp:void 0,onMouseDown:void 0,onMouseEnter:void 0,onMouseLeave:void 0,onKeyDown:void 0,variant:void 0,tooltip:void 0,icon:void 0,disabled:!1,active:void 0,tabIndex:void 0,children:void 0,className:void 0,style:{},"data-testid":void 0};function rs(n){var{className:e,children:t,"data-testid":r}=n;return u.jsx("div",{className:X("modal-footer",e),"data-testid":r,children:t})}function an(n){var{isOpen:e,headerText:t,bodyText:r,onCancel:i,onConfirm:o,onDiscard:a,onModalDisable:s,cancelButtonText:l="Cancel",confirmButtonText:d="Okay",discardButtonText:h="Discard",isConfirmDanger:c=!1,children:v,"data-testid":p}=n,g=m.useRef(null),f=m.useRef(null),y=m.useCallback(()=>{f.current!==null&&f.current.checked&&s&&s(),o()},[o,s]),T=m.useCallback(()=>{var P;(P=g.current)===null||P===void 0||P.focus()},[]),O="";return e&&(O=typeof r=="function"?r():r),u.jsxs(Ma,{isOpen:e,onOpened:T,children:[u.jsx(ka,{closeButton:!1,children:t}),u.jsx(Na,{children:O}),u.jsxs(rs,{children:[s&&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:f,"data-testid":p!==void 0?"".concat(p,"-checkbox-confirm"):void 0}),u.jsx("label",{className:"custom-control-label",htmlFor:"move-confirmation-checkbox",children:"Don't ask me again"})]}),a&&u.jsx(ee,{kind:"secondary",className:"mr-auto","data-dismiss":"modal",onClick:a,"data-testid":p!==void 0?"".concat(p,"-btn-discard"):void 0,children:h}),i&&u.jsx(ee,{kind:"secondary","data-dismiss":"modal",onClick:i,"data-testid":p!==void 0?"".concat(p,"-btn-cancel"):void 0,children:l}),u.jsxs(xr,{children:[u.jsx(ee,{kind:c?"danger":"primary",onClick:y,ref:g,"data-testid":p!==void 0?"".concat(p,"-btn-confirm"):void 0,children:d}),v]})]})]})}an.propTypes={isOpen:S.bool.isRequired,headerText:S.string.isRequired,bodyText:S.oneOfType([S.string,S.func]).isRequired,onCancel:S.func,onConfirm:S.func.isRequired,onDiscard:S.func,onModalDisable:S.func,cancelButtonText:S.string,confirmButtonText:S.string,discardButtonText:S.string,children:S.node,"data-testid":S.string};an.defaultProps={children:void 0,cancelButtonText:"Cancel",confirmButtonText:"Okay",discardButtonText:"Discard",onCancel:void 0,onDiscard:void 0,onModalDisable:void 0,"data-testid":void 0};function Tu(n,e,t){return(e=_u(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function _u(n){var e=Ou(n,"string");return typeof e=="symbol"?e:e+""}function Ou(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 Wr(n){return n.then!==void 0}class Ee{static disableAllActions(){Ee.actionsDisabled=!0}static enableAllActions(){Ee.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 o,a;return((o=e.order)!==null&&o!==void 0?o:0)>((a=t.order)!==null&&a!==void 0?a:0)?1:-1}if(e.title!==t.title){var s,l;return((s=e.title)!==null&&s!==void 0?s:"")>((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(Ee.compareActions),t}static isMacPlatform(){var{platform:e}=window.navigator;return e.startsWith("Mac")}static getModifierKey(){return Ee.isMacPlatform()?"metaKey":"ctrlKey"}static isModifierKeyDown(e){var t=Ee.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 o=0;o<i.length;o+=1){var a=i[o],s=void 0;typeof a=="function"?s=a():s=a,s!=null&&(s instanceof Promise?t&&r.push(s):Array.isArray(s)?r=r.concat(s):r.push(s))}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 o=1;o<r.length+1;o+=1){var a=(i+t*o+r.length)%r.length,s=r[a];if(!(s instanceof Promise)&&s.disabled!==!0)return a}return e}}Tu(Ee,"actionsDisabled",!1);var Ki=W.module("GlobalContextAction");class Iu extends m.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),Ki.debug("Received context menu event at global action! Menu items are now: ",t.contextActions))}handleKeyDown(e){var{action:t}=this.props;if(!Ee.actionsDisabled&&t.shortcut!==void 0&&t.shortcut.matchesEvent(e)){var r;Ki.debug("Global hotkey matched!",e),(r=t.action)===null||r===void 0||r.call(t,e),e.preventDefault(),e.stopPropagation()}}render(){return null}}class Du extends m.Component{render(){for(var{actions:e,"data-testid":t}=this.props,r=[],i=0;i<e.length;i+=1){var o=e[i],{shortcut:a}=o;if(o.title!=null||o.menuElement||a){var s=u.jsx(Iu,{action:o,"data-testid":t},"".concat(o.title,".").concat(a?.id));r.push(s)}}return r}}function is(n,e,t){return(e=xu(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function xu(n){var e=Mu(n,"string");return typeof e=="symbol"?e:e+""}function Mu(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 or=W.module("ContextActions");class re extends m.Component{static triggerMenu(e,t,r,i){if(i.length!==0){var o=new MouseEvent("contextmenu",{clientX:t,clientY:r,bubbles:!0,cancelable:!0});o.contextActions=i,e.dispatchEvent(o)}}constructor(e){super(e),is(this,"container",void 0),this.handleContextMenu=this.handleContextMenu.bind(this),this.handleKeyDown=this.handleKeyDown.bind(this),this.container=$.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=>!Wr(i)&&typeof i!="function"&&i.isGlobal),r=e.actions.filter(i=>!Wr(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(c=>d.contains(c));if(h!==void 0)return or.debug2('Contextmenu event ignored based on the target className "'.concat(h,'"')),{v:void 0};r=r.parentElement};r!=null;){var o=i();if(typeof o=="object")return o.v}if(Ee.isContextActionEvent(e)||(e.contextActions=[]),!!Ee.isContextActionEvent(e)){var{actions:a}=this.props;if(a!=null){var s=a;Array.isArray(s)&&(s=s.filter(l=>Wr(l)||typeof l=="function"||l.isGlobal===void 0||!l.isGlobal)),e.contextActions=e.contextActions.concat(s)}or.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(!Ee.actionsDisabled&&i.shortcut!=null&&i.shortcut.matchesEvent(e)){var o;or.debug("Context hotkey matched!",e),(o=i.action)===null||o===void 0||o.call(i,e),e.stopPropagation(),e.preventDefault(),or.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(Du,{actions:t})})}}is(re,"groups",{default:void 0,high:100,medium:5e3,low:1e4,global:1e5,edit:100});var pi=$.forwardRef((n,e)=>{var t,r;function i(N){var{menuItem:B,onMenuItemClick:H}=n;H(B,N)}function o(N){var{menuItem:B,onMenuItemMouseMove:H}=n;H(B,N)}function a(N){var{menuItem:B,onMenuItemContextMenu:H}=n;H(B,N)}function s(N,B,H){if(typeof N.type=="string")return N;var{closeMenu:J,menuItem:oe,isKeyboardSelected:L,isMouseSelected:q,"data-testid":K}=n,j={menuItem:oe,closeMenu:J,isKeyboardSelected:L,isMouseSelected:q,iconElement:B,displayShortcut:H,"data-testid":K};return $.cloneElement(N,{forwardedProps:j})}var{children:l,menuItem:d,isKeyboardSelected:h=!1,isMouseSelected:c=!1,"data-testid":v}=n,p=(t=d.shortcutText)!==null&&t!==void 0?t:(r=d.shortcut)===null||r===void 0?void 0:r.getDisplayText(),g=null;if(d.icon){var f=d.icon;if($.isValidElement(f))g=f;else{var y;d.iconColor!=null&&(d.disabled===void 0||!d.disabled)&&(y={color:d.iconColor}),g=u.jsx(he,{icon:f,style:y})}}var T=null,O=!!l;d.actions&&(T=u.jsx(he,{icon:Rl}));var P=null;if(d.menuElement)P=u.jsx("div",{className:"custom-menu-item",onMouseMove:o,children:s(d.menuElement,g,p)});else{var F,U=d.disabled,te=d.iconOutline;P=u.jsx("button",{type:"button",className:X("btn-context-menu",{disabled:U},{active:(O||c)&&(U===void 0||!U)},{"keyboard-active":h&&(U===void 0||!U)}),onClick:i,onMouseMove:o,onContextMenu:a,title:(F=d.description)!==null&&F!==void 0?F:"",children:u.jsxs("div",{className:"btn-context-menu-wrapper",children:[u.jsx("span",{className:X("icon",{outline:te}),children:g}),u.jsx("span",{className:"title",children:d.title}),p!==void 0&&u.jsx("span",{className:"shortcut",children:p}),T&&u.jsx("span",{className:X("submenu-indicator",{disabled:U}),children:T})]})})}return u.jsxs("div",{className:"context-menu-item",ref:e,"data-testid":v,children:[l,P]})});pi.displayName="ContextMenuItem";pi.defaultProps={children:null,isKeyboardSelected:!1,isMouseSelected:!1,"data-testid":void 0};var Mr=$.forwardRef((n,e)=>{var{checked:t=!1,children:r,className:i,disabled:o,inputClassName:a,isInvalid:s,labelClassName:l,name:d,onChange:h,"data-testid":c}=n,[v]=m.useState(kt()),p=es(e);m.useEffect(function(){p.current&&(p.current.indeterminate=t===null)},[p,t]);var g=m.useCallback(f=>{p.current&&(p.current.indeterminate=t===null),h&&h(f)},[p,t,h]);return u.jsxs("div",{className:X("custom-control custom-checkbox",i),children:[u.jsx("input",{type:"checkbox",ref:p,checked:t??!1,className:X("custom-control-input",a,{"is-invalid":s}),disabled:o,id:v,name:d,onChange:g,"data-testid":c}),u.jsx("label",{className:X("custom-control-label",l),htmlFor:v,children:r})]})});Mr.displayName="Checkbox";Mr.propTypes={checked:(n,e)=>{var{[e]:t}=n;return t!==null&&typeof t!="boolean"?new Error("Checked must be a boolean or null for indeterminate"):null},children:S.node.isRequired,className:S.string,disabled:S.bool,inputClassName:S.string,isInvalid:S.bool,labelClassName:S.string,name:S.string,onChange:S.func,"data-testid":S.string};Mr.defaultProps={checked:!1,className:"",disabled:!1,inputClassName:"",isInvalid:!1,labelClassName:"",name:void 0,onChange:void 0,"data-testid":void 0};function Gg(n){var{copy:e,kind:t="ghost",tooltip:r="Copy",className:i,style:o,"data-testid":a,children:s}=n,[l,d]=au();return u.jsx(ee,{kind:t,className:i,style:o,"data-testid":a,icon:l?$l:ja,tooltip:l?"Copied":r,onClick:()=>{d(typeof e=="function"?e():e)},children:s})}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 ku(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){Kn(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 Kn(n,e,t){return(e=Nu(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Nu(n){var e=ju(n,"string");return typeof e=="symbol"?e:e+""}function ju(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 os extends m.PureComponent{constructor(e){var t;super(e),Kn(this,"container",void 0),Kn(this,"oldFocus",void 0),Kn(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=$.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=Ee.getMenuItems(e,!1);t.length>0&&this.setState(r=>({menuItems:Ee.sortActions(r.menuItems.concat(t))}))}handleKeyDown(e){var{menuItems:t}=this.state,r=this.getKeyboardIndex(),i=r;if(e.key==="Enter"||e.key===" "){r!=null&&r>=0&&r<t.length&&this.handleMenuItemClick(t[r],e);return}if(e.key==="Escape")i=null;else if(e.key==="ArrowUp"||e.key==="Tab"&&e.shiftKey===!0){var o;i=Ee.getNextMenuItem((o=i)!==null&&o!==void 0?o:0,-1,t)}else if(e.key==="ArrowDown"||e.key==="Tab"&&e.shiftKey===!1){var a;i=Ee.getNextMenuItem((a=i)!==null&&a!==void 0?a: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:o}=this.state,a=0;a<i.length;a+=1){var s=i[a];a>0&&s.group!==i[a-1].group&&e.push(u.jsx("hr",{},"".concat(a,".separator")));var l=u.jsx(pi,{isKeyboardSelected:r===a,isMouseSelected:o===a,menuItem:s,closeMenu:this.handleCloseMenu,onMenuItemClick:this.handleMenuItemClick,onMenuItemMouseMove:this.handleMenuItemMouseMove,onMenuItemContextMenu:()=>!1},a);e.push(l)}var{menuStyle:d}=this.props;return u.jsx("div",{className:"context-menu-container",style:ku({},d),ref:this.container,onKeyDown:this.handleKeyDown,onMouseLeave:this.handleMouseLeave,role:"menuitem",tabIndex:0,"data-testid":t,children:e})}}Kn(os,"defaultProps",{closeMenu(){},onMenuOpened(){},onMenuClosed(){},options:{},menuStyle:{},"data-testid":void 0});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){fn(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 fn(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 Cn extends m.PureComponent{constructor(e){super(e),fn(this,"container",void 0),fn(this,"parent",void 0),fn(this,"popper",void 0),fn(this,"isOpen",void 0),this.handleClick=this.handleClick.bind(this),this.handleCloseMenu=this.handleCloseMenu.bind(this),this.handleExited=this.handleExited.bind(this),this.container=$.createRef(),this.parent=null,this.popper=$.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:o}=this.props,{options:a,popperOptions:s}=this.props;return s=qi({placement:"bottom"},s),a=qi({separateKeyboardMouse:!0},a),u.jsx("div",{className:"menu-actions-listener",ref:this.container,"data-testid":i,children:u.jsx(Yn,{ref:this.popper,options:s,className:X("menu-popper",r),onExited:this.handleExited,closeOnBlur:!0,interactive:!0,children:u.jsx(os,{actions:e,closeMenu:this.handleCloseMenu,onMenuOpened:t,options:a,menuStyle:o})})})}}fn(Cn,"defaultProps",{isShown:null,onMenuClosed(){},onMenuOpened(){},options:{},popperOptions:{},popperClassName:"",menuStyle:{},"data-testid":void 0});function $t(n,e,t){return(e=Fu(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Fu(n){var e=Ru(n,"string");return typeof e=="symbol"?e:e+""}function Ru(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var 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 Zi=W.module("Shortcut"),A;(function(n){n.CTRL="MODIFIER_CTRL",n.CMD="MODIFIER_CMD",n.ALT="MODIFIER_ALT",n.OPTION="MODIFIER_OPTION",n.SHIFT="MODIFIER_SHIFT"})(A||(A={}));var x;(function(n){n.A="A",n.B="B",n.C="C",n.D="D",n.E="E",n.F="F",n.G="G",n.H="H",n.I="I",n.J="J",n.K="K",n.L="L",n.M="M",n.N="N",n.O="O",n.P="P",n.Q="Q",n.R="R",n.S="S",n.T="T",n.U="U",n.V="V",n.W="W",n.X="X",n.Y="Y",n.Z="Z",n.ZERO="0",n.ONE="1",n.TWO="2",n.THREE="3",n.FOUR="4",n.FIVE="5",n.SIX="6",n.SEVEN="7",n.EIGHT="8",n.NINE="9",n.BACKSPACE="Backspace",n.ESCAPE="Escape",n.ENTER="Enter",n.DELETE="Delete",n.SLASH="/",n.QUESTION_MARK="?",n.BACKSLASH="\\",n.PIPE="|",n.MINUS="-",n.UNDERSCORE="_",n.EQUALS="=",n.PLUS="+",n.BACKTICK="`",n.TILDE="~",n.COMMA=",",n.LEFT_CHEVRON="<",n.PERIOD=".",n.RIGHT_CHEVRON=">",n.SEMICOLON=";",n.COLON=":",n.SINGLE_QUOTE="'",n.DOUBLE_QUOTE='"',n.LEFT_BRACKET="[",n.RIGHT_BRACKET="]",n.LEFT_CURLY="{",n.RIGHT_CURLY="}",n.F1="F1",n.F2="F2",n.F3="F3",n.F4="F4",n.F5="F5",n.F6="F6",n.F7="F7",n.F8="F8",n.F9="F9",n.F10="F10",n.F11="F11",n.F12="F12"})(x||(x={}));var $u=new Set([x.ENTER,x.DELETE,x.F1,x.F2,x.F3,x.F4,x.F5,x.F6,x.F7,x.F8,x.F9,x.F10,x.F11,x.F12]);class be extends Oa{static isAllowedKey(e){return Object.values(x).includes(e)}static isValidKeyState(e){var{keyValue:t}=e;if(t===null)return!0;if(!be.isMacPlatform&&e.metaKey||!be.isAllowedKey(t))return!1;var r=!e.altKey&&!e.ctrlKey&&!e.metaKey&&!e.shiftKey;return!r||$u.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 A.CTRL:t.ctrlKey=!0;break;case A.ALT:case A.OPTION:t.altKey=!0;break;case A.CMD:t.metaKey=!0;break;case A.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="":!be.isAllowedKey(t)&&be.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===x.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 x.ENTER:t+="⏎";break;case x.ESCAPE:t+="⎋";break;case x.BACKSPACE:t+="⌫";break;case x.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?"":be.isMacPlatform?be.getMacDisplayText(e):be.getWindowsDisplayText(e)}constructor(e){var{id:t,shortcut:r,macShortcut:i,isEditable:o=!0,name:a,tooltip:s}=e;super(),$t(this,"id",void 0),$t(this,"name",void 0),$t(this,"tooltip",void 0),$t(this,"isEditable",void 0),$t(this,"defaultKeyState",void 0),$t(this,"keyState",void 0),this.id=t,this.name=a,this.tooltip=s,this.isEditable=o;var l=be.isMacPlatform,d=l?i:r;this.defaultKeyState=be.createKeyState(d),this.keyState=this.defaultKeyState}getDisplayText(){return be.getDisplayText(this.keyState)}getKeyState(){return this.keyState}setKeyState(e){be.isValidKeyState(e)?(Zi.debug2("Shortcut ".concat(this.id," updated to ").concat(JSON.stringify(e))),this.keyState=e,this.dispatchEvent(new Za("onUpdate",{detail:this}))):Zi.debug2("Shortcut ".concat(this.id," tried to update to invalid keyState ").concat(JSON.stringify(e)))}getDefaultKeyState(){return this.defaultKeyState}isDefault(){return be.doKeyStatesMatch(this.getDefaultKeyState(),this.getKeyState())}setToNull(){this.setKeyState(be.NULL_KEY_STATE)}isNull(){return be.doKeyStatesMatch(this.keyState,be.NULL_KEY_STATE)}setToDefault(){this.setKeyState(this.defaultKeyState)}matchesKeyState(e){return be.doKeyStatesMatch(e,this.keyState)}matchesEvent(e){return this.matchesKeyState(be.getKeyStateFromEvent(e))}}$t(be,"NULL_KEY_STATE",{metaKey:!1,shiftKey:!1,altKey:!1,ctrlKey:!1,keyValue:null});$t(be,"isMacPlatform",Ee.isMacPlatform());function Xi(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=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)}var Yi=W.module("ShortcutRegistry");class Wu extends Oa{constructor(){super(...arguments),Xi(this,"shortcutMap",new Map),Xi(this,"shortcutsByCategory",new Map)}createAndAdd(e){var t=new be(e);return this.add(t)}add(e){var t=this.shortcutMap.get(e.id);if(t)return Yi.warn("Skipping attempt to add duplicate shortcut ID to registry: ".concat(e.id)),t;Yi.debug2("Adding shortcut to registry: ".concat(e.id)),e.addEventListener("onUpdate",o=>{var{detail:a}=o;return this.dispatchEvent(new Za("onUpdate",{detail:a}))});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 me=Object.freeze(new Wu),Kt={COPY:me.createAndAdd({id:"GLOBAL.COPY",name:"Copy",shortcut:[A.CTRL,x.C],macShortcut:[A.CMD,x.C],isEditable:!1}),PASTE:me.createAndAdd({id:"GLOBAL.PASTE",name:"Paste",shortcut:[A.CTRL,x.V],macShortcut:[A.CMD,x.V],isEditable:!1}),SAVE:me.createAndAdd({id:"GLOBAL.SAVE",name:"Save",shortcut:[A.CTRL,x.S],macShortcut:[A.CMD,x.S],isEditable:!1}),SELECT_ALL:me.createAndAdd({id:"GLOBAL.SELECT_ALL",name:"Select All",shortcut:[A.CTRL,x.A],macShortcut:[A.CMD,x.A],isEditable:!1}),REOPEN_CLOSED_PANEL:me.createAndAdd({id:"GLOBAL.REOPEN_CLOSED_PANEL",name:"Re-open Closed Panel",shortcut:[A.ALT,A.SHIFT,x.T],macShortcut:[A.OPTION,A.SHIFT,x.T],isEditable:!0}),LINKER:me.createAndAdd({id:"GLOBAL.LINKER",name:"Linker",shortcut:[A.CTRL,x.L],macShortcut:[A.CMD,x.L]}),LINKER_CLOSE:me.createAndAdd({id:"GLOBAL.LINKER_CLOSE",name:"Close Linker Overlay",shortcut:[x.ESCAPE],macShortcut:[x.ESCAPE],isEditable:!1}),COPY_VERSION_INFO:me.createAndAdd({id:"GLOBAL.COPY_VERSION_INFO",name:"Copy Version Info",shortcut:[A.CTRL,A.ALT,x.I],macShortcut:[A.CMD,A.SHIFT,x.I],isEditable:!0}),NEXT:me.createAndAdd({id:"GLOBAL.NEXT",name:"Next",shortcut:[x.ENTER],macShortcut:[x.ENTER],isEditable:!1}),PREVIOUS:me.createAndAdd({id:"GLOBAL.PREVIOUS",name:"Previous",shortcut:[A.SHIFT,x.ENTER],macShortcut:[A.SHIFT,x.ENTER],isEditable:!1})};function ei(n,e,t){return(e=Uu(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Uu(n){var e=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)}class kr extends m.PureComponent{constructor(e){super(e),ei(this,"inputField",void 0),ei(this,"searchChangeSelection",void 0),this.inputField=$.createRef(),this.searchChangeSelection=$.createRef()}componentDidMount(){this.setInputPaddingRight()}componentDidUpdate(){this.setInputPaddingRight()}focus(){var e;(e=this.inputField.current)===null||e===void 0||e.focus()}setInputPaddingRight(){var e=this.inputField.current,t=this.searchChangeSelection.current;if(e&&t){var r=t.getBoundingClientRect().width;e.style.paddingRight="".concat(r,"px")}}render(){var{value:e,placeholder:t,onBlur:r,onChange:i,className:o,disabled:a,matchCount:s,id:l,onKeyDown:d,"data-testid":h,cursor:c}=this.props,v,p=[{action:()=>c?.next("forward"),shortcut:Kt.NEXT},{action:()=>c?.next("back"),shortcut:Kt.PREVIOUS}];return c&&s>1?v=u.jsxs(u.Fragment,{children:[u.jsx(ee,{kind:"ghost",className:"search-change-button",type:"button",onClick:()=>{c.next("back")},icon:Aa,tooltip:"Previous match (".concat(Kt.PREVIOUS.getDisplayText(),")")}),u.jsxs("span",{className:"search-change-text",children:[c.index!==void 0&&"".concat(c.index+1," of "),s]}),u.jsx(ee,{kind:"ghost",className:"search-change-button",type:"button",onClick:()=>{c.next("forward")},icon:Hl,tooltip:"Next match (".concat(Kt.NEXT.getDisplayText(),")")})]}):v=s>0&&u.jsx("span",{className:"search-match",children:s}),u.jsxs("div",{className:X("search-group",o),children:[u.jsx("input",{type:"search",value:e,onBlur:r,onChange:i,onKeyDown:d,className:"form-control",disabled:a,placeholder:t,ref:this.inputField,id:l,"data-testid":h}),s!=null?u.jsxs(u.Fragment,{children:[u.jsx("div",{className:"search-change-selection",ref:this.searchChangeSelection,children:v}),u.jsx(re,{actions:p})]}):u.jsx("span",{className:"search-icon",children:u.jsx(he,{icon:Bl})})]})}}ei(kr,"defaultProps",{placeholder:"Search",className:"",matchCount:null,onKeyDown(){},id:"","data-testid":void 0,cursor:void 0});function as(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=zu(n,"string");return typeof e=="symbol"?e:e+""}function zu(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 ss extends m.PureComponent{constructor(e){super(e),as(this,"searchInput",void 0),this.searchInput=$.createRef(),this.handleChange=this.handleChange.bind(this),this.sendUpdate=Sn(this.sendUpdate.bind(this),e.debounceMs),this.state={value:e.value}}componentDidUpdate(e){var{value:t}=this.props;e.value!==t&&this.setState({value:t})}focus(){var e;(e=this.searchInput.current)===null||e===void 0||e.focus()}handleChange(e){this.setState({value:e.target.value},this.sendUpdate)}sendUpdate(){var{onChange:e}=this.props,{value:t}=this.state;e(t)}render(){var{placeholder:e,className:t,matchCount:r,id:i,"data-testid":o}=this.props,{value:a}=this.state;return u.jsx(kr,{value:a,placeholder:e,onChange:this.handleChange,className:t,matchCount:r,ref:this.searchInput,id:i,"data-testid":o})}}as(ss,"defaultProps",{placeholder:"Search",className:"",matchCount:null,debounceMs:250,id:"","data-testid":void 0});function ls(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=qu(n,"string");return typeof e=="symbol"?e:e+""}function qu(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=W.module("ItemListItem");class Nr extends m.Component{static handleKeyDown(){return Zu.log("ItemListItem.handleKeyDown false"),!1}constructor(e){super(e),ls(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=$.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:o,"data-testid":a}=this.props;return u.jsx("div",{className:X("item-list-item",{active:r},{"is-focused":t},{"is-draggable":e}),onKeyDown:Nr.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":a,children:o})}}ls(Nr,"defaultProps",{children:null,isDraggable:!1,isFocused:!1,isSelected:!1,itemIndex:0,"data-testid":void 0,onBlur(){},onClick(){},onContextMenu(){},onDragStart(){},onDrag(){},onDragOver(){},onDragEnd(){},onDrop(){},onDoubleClick(){},onFocus(){},onMouseDown(){},onMouseMove(){},onMouseUp(){},style:{}});function 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 Ji(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){lt(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 lt(n,e,t){return(e=Xu(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Xu(n){var e=Yu(n,"string");return typeof e=="symbol"?e:e+""}function Yu(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 eo=W.module("ItemList"),to=5;class rt extends m.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),lt(this,"list",void 0),lt(this,"listContainer",void 0),lt(this,"getItemSelected",pn((i,o)=>ct.isSelected(o,i),{max:rt.CACHE_SIZE})),lt(this,"getCachedItem",pn((i,o,a,s,l,d,h,c)=>{var v=d({item:a,itemIndex:i,isFocused:s,isSelected:l,style:h});return u.jsx(Nr,{onContextMenu:this.handleItemContextMenu,onDoubleClick:this.handleItemDoubleClick,onMouseDown:this.handleItemMouseDown,onFocus:this.handleItemFocus,onBlur:this.handleItemBlur,disableSelect:c,onMouseMove:this.handleItemMouseMove,onMouseUp:this.handleItemMouseUp,isFocused:s,isSelected:l,itemIndex:i,style:h,children:v},o)},{max:rt.CACHE_SIZE})),lt(this,"getOuterElement",pn(i=>{var o=$.forwardRef((a,s)=>u.jsx("div",Ji({ref:s,tabIndex:-1,onKeyDown:i,role:"presentation"},a)));return o.displayName="ItemListOuterElement",o})),lt(this,"getInnerElement",pn(()=>{var i=$.forwardRef((o,a)=>u.jsx("div",Ji({className:"item-list-inner-element",ref:a},o)));return i.displayName="ItemListInnerElement",i})),lt(this,"getItemData",pn((i,o,a)=>({items:i,selectedRanges:o,renderItem:a}))),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=$.createRef(),this.listContainer=$.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:o,isStuckToBottom:a,scrollOffset:s,height:l,selectedRanges:d}=this.state;if(a&&!this.isListAtBottom()&&i>0&&this.scrollToBottom(),(s!==t.scrollOffset||l!==t.height)&&this.sendViewportUpdate(),r!==e.selectedRanges&&r!==d)this.setSelectedRanges(r);else if(d!==t.selectedRanges){var{onSelectionChange:h}=this.props;h(d)}if(o!==t.focusIndex){var{onFocusChange:c}=this.props;c(o)}}componentWillUnmount(){window.removeEventListener("mouseup",this.handleWindowMouseUp)}focus(){var e;(e=this.listContainer.current)===null||e===void 0||e.focus()}restoreScrollPosition(){var{scrollOffset:e}=this.state;if(e!=null){var t;(t=this.listContainer.current)===null||t===void 0||t.scrollTo(0,e)}}getElement(e){if(this.listContainer.current==null)return null;var{focusSelector:t}=this.props,{overscanStartIndex:r}=this.state,i=this.listContainer.current.querySelectorAll(t),o=e-r;return i[o]}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?.scrollIntoView({block:"center"})}handleItemContextMenu(e,t){this.setState({focusIndex:e});var{selectedRanges:r}=this.state,i=ct.isSelected(r,e),o=i||Ee.isModifierKeyDown(t);this.toggleSelect(e,t.shiftKey,o,!1)}handleItemDoubleClick(e,t){var{isDoubleClickSelect:r,onSelect:i}=this.props;r&&this.setState(o=>{var{selectedRanges:a}=o;return{selectedRanges:ct.selectRange(a,[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){eo.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){eo.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:o}=this.props,{mouseDownIndex:a,selectedRanges:s,mouseX:l,mouseY:d}=this.state;if(!(a==null||o)){var h=Math.abs(t.clientX-(l??0)),c=Math.abs(t.clientY-(d??0));h>to&&c>to&&this.setState({isDragging:!0}),(r||a===e)&&(this.focusItem(e),i?(!r&&!this.getItemSelected(e,s)&&!Ee.isModifierKeyDown(t)&&this.deselectAll(),this.selectRange([Math.min(a,e),Math.max(a,e)])):this.toggleSelect(e,t.shiftKey,Ee.isModifierKeyDown(t),!1))}}handleItemMouseUp(e,t){var{isDeselectOnClick:r,isDoubleClickSelect:i,onSelect:o}=this.props,{mouseDownIndex:a,isDragging:s}=this.state;if(!(t.target instanceof HTMLElement&&["button","select","input","textarea"].indexOf(t.target.tagName.toLowerCase())!==-1)){if(a===e&&!s){var l=t.shiftKey,d=Ee.isModifierKeyDown(t);this.focusItem(e),this.toggleSelect(e,l,d,r),!i&&!l&&!d&&o(e,t)}this.resetMouseState()}}handleItemsRendered(e){var{overscanStartIndex:t}=e;this.setState({overscanStartIndex:t})}handleResize(e){var{height:t}=e;this.setState({height:t})}handleMouseLeave(){this.setState({mouseDownIndex:null})}handleWindowMouseUp(){this.resetMouseState(),window.removeEventListener("mouseup",this.handleWindowMouseUp)}handleKeyDown(e){var{isMultiSelect:t,itemCount:r,onSelect:i}=this.props,{focusIndex:o}=this.state,a=o;if(e.key==="Enter"||e.key===" "){!t&&a!=null&&this.setState({selectedRanges:[[a,a]]},()=>{a!=null&&i(a,e)});return}if(e.key==="ArrowUp")a!=null&&a>=0?a=Math.max(0,a-1):a=r-1;else if(e.key==="ArrowDown")a!=null&&a>=0?a=Math.min(a+1,r-1):a=0;else return;if(o!==a){e.stopPropagation(),e.preventDefault(),this.focusItem(a);var{selectedRanges:s}=this.state;if(e.shiftKey&&s.length>0){var l=s[s.length-1];this.selectRange([Math.min(a,l[0]),Math.max(a,l[1])])}else if(this.deselectAll(),a!==null)this.selectItem(a);else{var d;(d=this.listContainer.current)===null||d===void 0||d.focus()}this.scrollIntoView(a)}}handleScroll(e){var{scrollUpdateWasRequested:t,scrollOffset:r}=e;this.setState(i=>{if(t)return{scrollOffset:r};var{isStickyBottom:o}=this.props,{height:a}=i,s=o&&this.isListAtBottom({scrollOffset:r,height:a});return{isStuckToBottom:s,scrollOffset:r}})}resetMouseState(){this.setState({mouseDownIndex:null,isDragging:!1})}scrollToBottom(){var{itemCount:e}=this.props;this.list.current&&this.list.current.scrollToItem(e)}scrollIntoView(e){this.list.current&&this.list.current.scrollToItem(e)}toggleSelect(e,t,r){var i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,{isMultiSelect:o}=this.props,{selectedRanges:a}=this.state;if(o&&t&&a.length>0){var s=a[a.length-1];this.selectRange([Math.min(s[0],e),Math.max(e,s[1])])}else o&&a.length===1&&a[0][0]===e&&a[0][1]===e?i&&this.deselectItem(e):o&&r?this.getItemSelected(e,a)?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){ct.validateRange(e),this.setState(t=>{var{selectedRanges:r}=t;return{selectedRanges:ct.deselectRange(r,e)}})}selectItem(e){var{disableSelect:t}=this.props;t||this.selectRange([e,e])}selectRange(e){ct.validateRange(e),this.setState(t=>{var{selectedRanges:r}=t;return{selectedRanges:ct.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,o=Math.floor(e/i),a=o+Math.ceil(t/i);r(o,a)}}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:o,renderItem:a,disableSelect:s}=this.props,{focusIndex:l,selectedRanges:d}=this.state;if(t<o||t>=o+i.length)return null;var h=i[t-o];return this.getCachedItem(t,t,h,t===l&&!s,this.getItemSelected(t,d),a,r,s)}render(){var{items:e,itemCount:t,overscanCount:r,renderItem:i,rowHeight:o,"data-testid":a}=this.props,{selectedRanges:s,isStuckToBottom:l}=this.state;return u.jsx(El,{className:"item-list-auto-sizer",onResize:this.handleResize,children:d=>{var{width:h,height:c}=d;return u.jsx(Pl,{className:"item-list-scroll-pane",height:c,width:h,initialScrollOffset:l?t*o:0,itemCount:t,itemSize:o,itemData:this.getItemData(e,s,i),onScroll:this.handleScroll,onItemsRendered:this.handleItemsRendered,ref:this.list,outerElementType:this.getOuterElement(this.handleKeyDown),outerRef:this.listContainer,innerElementType:this.getInnerElement(),overscanCount:r,"data-testid":a,children:this.renderInnerElement})}})}}lt(rt,"CACHE_SIZE",1e3);lt(rt,"DEFAULT_ROW_HEIGHT",20);lt(rt,"DEFAULT_OVERSCAN",10);lt(rt,"defaultProps",{offset:0,items:[],rowHeight:rt.DEFAULT_ROW_HEIGHT,isDeselectOnClick:!0,isDoubleClickSelect:!1,isDragSelect:!0,isMultiSelect:!1,isStickyBottom:!1,disableSelect:!1,onFocusChange(){},onSelect(){},onSelectionChange(){},onViewportChange(){},overscanCount:rt.DEFAULT_OVERSCAN,renderItem:rt.renderItem,selectedRanges:[],focusSelector:".item-list-item","data-testid":void 0});var Qu=W.module("ErrorBoundary");class Ju extends m.Component{static getDerivedStateFromError(e){return{error:e}}constructor(e){super(e),this.state={error:void 0}}componentDidCatch(e,t){var{onError:r}=this.props;Qu.error("Error caught by ErrorBoundary",e,t),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(sn,{errorMessage:"".concat(i),isLoading:!1,isLoaded:!1})}):e}}function eh(n){var{on:e,id:t,className:r,isInvalid:i,disabled:o=!1,onClick:a,"data-testid":s}=n;return u.jsx("button",{type:"button",className:X("btn","btn-switch",r,{active:e},{"is-invalid":i}),id:t,onClick:a,disabled:o,"data-testid":s,children:u.jsx("div",{className:"handle"})})}var th=["className","timeout"];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 nh(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){rh(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 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)}function ah(n,e){if(n==null)return{};var t,r,i=sh(n,e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(n);for(r=0;r<o.length;r++)t=o[r],e.indexOf(t)===-1&&{}.propertyIsEnumerable.call(n,t)&&(i[t]=n[t])}return i}function sh(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 qg(n){var{className:e,timeout:t=xa.transitionMs}=n,r=ah(n,th);return u.jsx(_a,nh({timeout:t,classNames:X("fade",e)},r))}var lh=["children","className","isInvalid","onChange","data-testid"];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 io(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){dh(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 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,e){if(n==null)return{};var t,r,i=mh(n,e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(n);for(r=0;r<o.length;r++)t=o[r],e.indexOf(t)===-1&&{}.propertyIsEnumerable.call(n,t)&&(i[t]=n[t])}return i}function mh(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 ds=$.forwardRef((n,e)=>{var{children:t,className:r,isInvalid:i,onChange:o,"data-testid":a}=n,s=ch(n,lh),l=es(e),d=m.useCallback(h=>{o(h.target.value)},[o]);return u.jsx("select",io(io({ref:l,className:X("custom-select",r,{"is-invalid":i}),onChange:d,"data-testid":a},s),{},{children:t}))});ds.displayName="Select";function vh(){return Xn(Wl,"No API available in useApi. Was code wrapped in ApiBootstrap or ApiContext.Provider?")}function us(n){return typeof n=="object"&&n!=null&&typeof n.type=="string"&&n.name!=null}function hs(n){return typeof n=="object"&&n!=null&&typeof n.type=="string"&&n.id!=null}function Zg(n){return us(n)||hs(n)}var ph=m.createContext(null);function Xg(n){if(hs(n))return{id:n.id,type:n.type};if(us(n)){var e;return{name:(e=n.name)!==null&&e!==void 0?e:"",type:n.type}}throw new Error("Invalid descriptor: ".concat(n))}function fh(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 Yg(){return Xn(ph,"No ObjectFetcher available in useObjectFetcher. Was code wrapped in ObjectFetcherContext.Provider?")}function oo(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 gh(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?oo(Object(t),!0).forEach(function(r){bh(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):oo(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function bh(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 fi=Object.freeze({}),Sh=new Map,Qg=n=>n.api,Jg=n=>n.user,cs=n=>n.storage,ms=n=>cs(n).commandHistoryStorage,vs=n=>cs(n).fileStorage,wh=n=>n.defaultWorkspaceSettings,ps=n=>{var{workspace:e}=n;return e},Ye=Tl(n=>{for(var e,t,r=(e=(t=ps(n))===null||t===void 0?void 0:t.data.settings)!==null&&e!==void 0?e:{},i=gh({},wh(n)),o=Object.keys(r),a=0;a<o.length;a+=1){var s=o[a];r[s]!==void 0&&(i[s]=r[s])}return i}),eb=n=>n.defaultWorkspaceSettings,tb=n=>Ye(n).defaultDateTimeFormat,nb=n=>{var e;return(e=Ye(n).defaultDecimalFormatOptions)!==null&&e!==void 0?e:fi},rb=n=>{var e;return(e=Ye(n).defaultIntegerFormatOptions)!==null&&e!==void 0?e:fi},ib=n=>{var e;return(e=Ye(n).formatter)!==null&&e!==void 0?e:[]},Eh=n=>Ye(n).timeZone,ob=n=>Ye(n).showTimeZone,ab=n=>Ye(n).showTSeparator,sb=n=>Ye(n).truncateNumbersWithPound,lb=n=>Ye(n).showEmptyStrings,db=n=>Ye(n).showNullStrings,ub=n=>Ye(n).shortcutOverrides,hb=n=>Ye(n).webgl,cb=n=>Ye(n).webglEditable,Ph=n=>{var e;return(e=Ye(n).defaultNotebookSettings)!==null&&e!==void 0?e:fi},mb=n=>n.activeTool,Th=n=>{var e;return(e=n.plugins)!==null&&e!==void 0?e:Sh};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 Qt(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){_h(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 _h(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=Ih(n,"string");return typeof e=="symbol"?e:e+""}function Ih(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 vb=n=>({type:Xl,payload:n}),pb=n=>({type:zl,payload:n}),fs=n=>({type:Kl,payload:n}),fb=n=>({type:Ql,payload:n}),gb=n=>({type:Yl,payload:n}),bb=n=>({type:ql,payload:n}),yb=n=>({type:Zl,payload:n}),Dh=n=>(e,t)=>{e(fs(n));var{storage:r}=t(),{workspaceStorage:i}=r;return i?.save(n)},xh=n=>(e,t)=>{var{workspace:r}=t(),{data:i}=r??{},o=Qt(Qt({},r),{},{data:Qt(Qt(Qt({},i),n),{},{settings:Qt(Qt({},i?.settings),n.settings)})});return e(Dh(o))},Mh=n=>e=>e(xh({settings:n})),Cb=n=>({type:Ul,payload:n}),Sb=n=>({type:Vl,payload:n}),wb=n=>({type:Gl,payload:n});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 lo(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){kh(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 kh(n,e,t){return(e=Nh(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Nh(n){var e=jh(n,"string");return typeof e=="symbol"?e:e+""}function jh(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 Ah(n){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;return function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:e,i=arguments.length>1?arguments[1]:void 0;switch(i.type){case n:{var{id:o,payload:a}=i;return t&&Gn({payload:a},{payload:r[o]})?r:lo(lo({},r),{},{[o]:a})}default:return r}}}function Lh(n){var{type:e}=n,t=vh();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(he,{icon:Ra});case t.VariableType.FIGURE:return u.jsx(he,{icon:Fa});case t.VariableType.PANDAS:return u.jsx(he,{icon:Jl});default:return u.jsx(he,{icon:La})}}function uo(n,e,t,r,i,o,a){try{var s=n[o](a),l=s.value}catch(d){return void t(d)}s.done?e(l):Promise.resolve(l).then(r,i)}function Fh(n){return function(){var e=this,t=arguments;return new Promise(function(r,i){var o=n.apply(e,t);function a(l){uo(o,r,i,a,s,"next",l)}function s(l){uo(o,r,i,a,s,"throw",l)}a(void 0)})}}function gs(n){var{children:e,language:t}=n,[r,i]=m.useState(null),{activeThemes:o}=ns();return m.useEffect(()=>{var a=!1;function s(){return l.apply(this,arguments)}function l(){return l=Fh(function*(){if(e!=null&&o!=null){var d=yield mt.colorize(e.toString(),t,{});a||i(d)}}),l.apply(this,arguments)}return s(),()=>{a=!0}},[o,e,t]),u.jsx("div",{style:{pointerEvents:"none"},dangerouslySetInnerHTML:r!=null?{__html:r}:void 0})}class bs{static get LANGUAGE_MAP(){return new Map([["python","Python"],["groovy","Groovy"],["scala","Scala"]])}}class wn{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)?[]:_l.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"),o="".concat(e.getMilliseconds()).padStart(3,"0");return"".concat(t,":").concat(r,":").concat(i,".").concat(o)}static isTableType(e,t){return t===e.VariableType.TABLE||t===e.VariableType.TREETABLE||t===e.VariableType.HIERARCHICALTABLE||t===e.VariableType.PARTITIONEDTABLE}static isWidgetType(e,t){return t===e.VariableType.FIGURE||t===e.VariableType.OTHERWIDGET||t===e.VariableType.PANDAS}static isOpenableType(e,t){return wn.isTableType(e,t)||wn.isWidgetType(e,t)}static isFigureType(e,t){return t===e.VariableType.FIGURE}static isPandas(e,t){return t===e.VariableType.PANDAS}}function ys(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})]})}ys.propTypes={children:S.node.isRequired};function ti(n,e,t){return(e=Rh(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Rh(n){var e=$h(n,"string");return typeof e=="symbol"?e:e+""}function $h(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 Cs extends m.Component{constructor(e){super(e),ti(this,"timer",void 0),ti(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:X("console-history-result-in-progress",{disabled:e}),children:u.jsxs("span",{className:"badge",children:[u.jsx($a,{className:"ml-2"}),"Running... ",xn.formatElapsedTime(r)," ",u.jsx(ee,{className:"console-history-result-in-progress-cancel",kind:"ghost",icon:ed,tooltip:"Cancel",onClick:t,disabled:e})]})})}}ti(Cs,"defaultProps",{disabled:!1});function zn(n,e,t){return(e=Hh(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Hh(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 En extends m.PureComponent{constructor(e){super(e),zn(this,"mouseX",void 0),zn(this,"mouseY",void 0),zn(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)>=En.mouseDragThreshold||Math.abs(e.clientY-this.mouseY)>=En.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;R(r);var i=r.trimEnd(),o=i.indexOf(`
|
|
4
4
|
`),a=o>-1,s=i;a&&(s=i.slice(0,o));var l=i.slice(o),d=t?"error-btn-link error-btn-link--active":"error-btn-link";return u.jsxs("div",{className:X("error-message",{expanded:e}),children:[a&&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(he,{icon:e?Rn:td,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:s}),e?l:""]})]}),!a&&u.jsx("div",{className:"error-content",children:u.jsx("div",{className:"console-error-text",children:s})})]},"error")}}zn(En,"defaultProps",{message:""});zn(En,"mouseDragThreshold",5);function Wh(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=Vh(n,"string");return typeof e=="symbol"?e:e+""}function Vh(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var 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 ho=W.module("ConsoleHistoryItem");class Ss extends m.PureComponent{constructor(e){super(e),this.handleCancelClick=this.handleCancelClick.bind(this),this.handleObjectClick=this.handleObjectClick.bind(this)}handleObjectClick(e){ho.debug("handleObjectClick",e);var{openObject:t}=this.props;t(e)}handleCancelClick(){var{item:e}=this.props;e!=null&&e.cancelResult&&(ho.debug("Cancelling command: ".concat(e.command)),e.cancelResult())}render(){var{disabled:e,item:t,language:r,iconForType:i}=this.props,{disabledObjects:o,result:a}=t,s=t.command!=null&&t.command!=="",l=null;s&&(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(gs,{language:r,children:t.command})})]}));var d=[],h=!1;if(a){var{error:c,message:v,changes:p}=a;if(p){var{created:g,updated:f}=p;[...g,...f].forEach(te=>{h=!0;var{title:N}=te,B="".concat(N),H=e===void 0||e||(o??[]).indexOf(B)>=0,J=u.jsx(ee,{kind:"primary",onClick:()=>this.handleObjectClick(te),className:"btn-console-object",disabled:H,icon:i(te.type),children:N},B);d.push(J)})}if(c!=null&&!s){var y,T="".concat((y=c.message)!==null&&y!==void 0?y:c);T||(T=c);var O=u.jsx(En,{message:T},"result-error");d.push(O)}if(v!==void 0&&v!==""){var P=u.jsx("div",{className:"log-message",children:v},"log-message");d.push(P)}}else{h=!0;var F=u.jsx(Cs,{onCancelClick:this.handleCancelClick,disabled:e},"in_progress");d.push(F)}var U=null;return d.length>0&&(U=u.jsx(ys,{children:d})),u.jsxs("div",{className:X("console-command-result",{"console-result-buttons":h}),children:[l,U]})}}Wh(Ss,"defaultProps",{disabled:!1});function Kh(n,e){return"".concat(n,".").concat(e.command,".").concat(e.result&&e.result.message,".").concat(e.result&&e.result.error)}var zh=$.forwardRef(function(e,t){for(var{disabled:r=!1,items:i,language:o,openObject:a,supportsType:s,iconForType:l}=e,d=[],h=0;h<i.length;h+=1){var c=i[h],v=u.jsx(Ss,{disabled:r,item:c,openObject:a,language:o,supportsType:s,iconForType:l},Kh(h,c));d.push(v)}return u.jsx("div",{ref:t,className:"container-fluid console-history",children:d})}),Gh={name:"Console",CLEAR:me.createAndAdd({id:"CONSOLE.CLEAR",name:"Clear",shortcut:[A.CTRL,x.L],macShortcut:[A.CTRL,x.C]}),FOCUS_HISTORY:me.createAndAdd({id:"CONSOLE.FOCUS_HISTORY",name:"Focus History",shortcut:[A.CTRL,x.H],macShortcut:[A.CTRL,A.OPTION,x.H]})},qh={name:"Command History",FOCUS_HISTORY:me.createAndAdd({id:"COMMAND_HISTORY.FOCUS_HISTORY",name:"Focus History Search",shortcut:[A.CTRL,x.H],macShortcut:[A.CTRL,A.OPTION,x.H]}),SEND_TO_CONSOLE:me.createAndAdd({id:"COMMAND_HISTORY.SEND_TO_CONSOLE",name:"Send to Console",shortcut:[x.ENTER],macShortcut:[x.ENTER]}),SEND_TO_NOTEBOOK:me.createAndAdd({id:"COMMAND_HISTORY.SEND_TO_NOTEBOOK",name:"Send to Notebook",shortcut:[A.CTRL,x.ENTER],macShortcut:[A.CMD,x.ENTER]}),RUN:me.createAndAdd({id:"COMMAND_HISTORY.RUN",name:"Run",shortcut:[A.ALT,x.R],macShortcut:[A.OPTION,x.R]})},Zh={name:"Notebook",RUN:me.createAndAdd({id:"NOTEBOOK.RUN",name:"Run",shortcut:[A.ALT,x.R],macShortcut:[A.OPTION,x.R]}),RUN_SELECTED:me.createAndAdd({id:"NOTEBOOK.RUN_SELECTED",name:"Run Selected",shortcut:[A.ALT,A.SHIFT,x.R],macShortcut:[A.OPTION,A.SHIFT,x.R]}),FIND:me.createAndAdd({id:"NOTEBOOK.FIND",name:"Find",shortcut:[A.CTRL,x.F],macShortcut:[A.CMD,x.F],isEditable:!1}),MINIMAP:me.createAndAdd({id:"NOTEBOOK.MINIMAP",name:"Show Minimap",shortcut:[A.ALT,x.M],macShortcut:[A.OPTION,x.M]}),WORDWRAP:me.createAndAdd({id:"NOTEBOOK.WORDWRAP",name:"Word Wrap",shortcut:[A.ALT,x.Z],macShortcut:[A.OPTION,x.Z]})},Be={CONSOLE:Gh,COMMAND_HISTORY:qh,NOTEBOOK:Zh};const Ie=Object.freeze({FATAL:"FATAL",STDERR:"STDERR",ERROR:"ERROR",WARN:"WARN",STDOUT:"STDOUT",INFO:"INFO",DEBUG:"DEBUG",TRACE:"TRACE"}),Xh="var(--dh-color-editor-bg)",Yh="var(--dh-color-editor-fg)",Qh="var(--dh-color-editor-string)",Jh="var(--dh-color-editor-delimiter)",ec="var(--dh-color-editor-predefined)",tc="var(--dh-color-editor-keyword)",nc="var(--dh-color-editor-storage)",rc="var(--dh-color-editor-number)",ic="var(--dh-color-editor-operator)",oc="var(--dh-color-editor-identifier)",ac="var(--dh-color-editor-comment)",ni={"error-foreground":"var(--dh-color-editor-error-fg)",background:Xh,foreground:Yh,"line-height":"19px",string:Qh,"string-delim":"var(--dh-color-editor-string-delim)",delimiter:Jh,predefined:ec,keyword:tc,storage:nc,number:rc,operator:ic,identifier:oc,"namespace-identifier":"var(--dh-color-editor-identifier-namespace)","identifier-js":"var(--dh-color-editor-identifier-js)",comment:ac,"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 sc="python",lc={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/}}},dc={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"]]}},uc={id:sc,conf:lc,language:dc},hc="groovy",cc={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/}}},mc={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"]]}},vc={id:hc,conf:cc,language:mc},pc="scala",fc={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>))/}}},gc={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"]]}},bc={id:pc,conf:fc,language:gc},yc="deephavenDb",Cc={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/}}},Sc={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"]]}},wc={id:yc,conf:Cc,language:Sc},Ec="log",Pc={},Tc={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"}]]}},_c={id:Ec,conf:Pc,language:Tc};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 mo(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){Oc(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 Oc(n,e,t){return(e=Ic(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Ic(n){var e=Dc(n,"string");return typeof e=="symbol"?e:e+""}function Dc(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var 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 _t=W.module("MonacoUtils");class Ce{static init(){var{getWorker:e}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};_t.debug("Initializing Monaco..."),e!==void 0&&Ce.registerGetWorker(e);var{initTheme:t,registerLanguages:r}=Ce;t(),r([wc,uc,vc,_c,bc]),Ce.removeConflictingKeybindings(),_t.debug("Monaco initialized.")}static initTheme(){var e,t,{removeHashtag:r}=Ce,i=Ha(ni);_t.debug2("Monaco theme:",ni),_t.debug2("Monaco theme derived:",i);var o=[{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"])}],a={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"]};mt.defineTheme("dh-dark",{base:"vs-dark",inherit:!0,rules:o,colors:a});try{mt.setTheme("dh-dark")}catch(s){_t.error("Failed to set 'dh-dark' Monaco theme, falling back to vs-dark",s),mt.setTheme("vs-dark")}}static registerGetWorker(e){window.MonacoEnvironment=mo(mo({},window.MonacoEnvironment),{},{getWorker:e})}static removeHashtag(e){var t;return(t=e?.substring(1))!==null&&t!==void 0?t:""}static registerLanguages(e){var t=e.map(r=>{var{id:i}=r;return i});Ct.getLanguages().filter(r=>{var{id:i}=r;return t.includes(i)}).forEach(r=>{var i=r;_t.debug2("Overriding default language loader:",i.id)}),e.forEach(r=>{Ce.registerLanguage(r)})}static registerLanguage(e){_t.debug2("Registering language: ",e.id),Ct.register(e),Ct.onLanguage(e.id,()=>{Ct.setLanguageConfiguration(e.id,e.conf),Ct.setMonarchTokensProvider(e.id,e.language)})}static setEOL(e){var t,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:mt.EndOfLineSequence.LF;(t=e.getModel())===null||t===void 0||t.setEOL(r)}static openDocument(e,t){var r=e.getModel();R(r);var i={textDocument:{uri:"".concat(r.uri),languageId:r.getLanguageId(),version:r.getVersionId(),text:r.getValue()}};_t.debug2("didOpenDocumentParams: ",i),t.openDocument(i);var o=e.onDidChangeModelContent(a=>{for(var{changes:s,versionId:l}=a,d=[],h=0;h<s.length;h+=1){var c=s[h],{range:v,rangeLength:p,text:g}=c,f={range:{start:{line:v.startLineNumber-1,character:v.startColumn-1},end:{line:v.endLineNumber-1,character:v.endColumn-1}},rangeLength:p,text:g};d.push(f)}if(d.length>0){var y={textDocument:{version:l,uri:"".concat(r.uri)},contentChanges:d};_t.debug2("didChangeDocumentParams",y),t.changeDocument(y)}});return o}static closeDocument(e,t){var r=e.getModel();R(r);var i={textDocument:{uri:"".concat(r.uri)}};t.closeDocument(i)}static registerPasteHandler(e){e.onDidPaste(t=>{var r=/“|”/g,i=/\u200b/g,o=/\u00A0/g,a=e.getModel();R(a);var s=a.getValueInRange(t.range);(r.test(s)||i.test(s)||o.test(s))&&a.applyEdits([{range:t.range,text:s.replace(r,'"').replace(i,"").replace(o," ")}])})}static isMacPlatform(){var{platform:e}=window.navigator;return e.startsWith("Mac")}static removeConflictingKeybindings(){mt.addKeybindingRule({keybinding:et.CtrlCmd|qt.KeyD,command:null}),Ce.isMacPlatform()||mt.addKeybindingRule({keybinding:et.CtrlCmd|qt.KeyH,command:null})}static disableKeyBindings(e,t){e.addAction({id:"disable-keybindings-".concat(kt()),label:"",keybindings:t,run:()=>{}})}static getMonacoKeyCodeFromShortcut(e){var{keyState:t}=e,{keyValue:r}=t;if(r===null)return 0;var i=Ce.isMacPlatform();return i?(t.metaKey?et.CtrlCmd:0)|(t.shiftKey?et.Shift:0)|(t.altKey?et.Alt:0)|(t.ctrlKey?et.WinCtrl:0)|Ai.fromString(r):(t.ctrlKey?et.CtrlCmd:0)|(t.shiftKey?et.Shift:0)|(t.altKey?et.Alt:0)|(t.metaKey?et.WinCtrl:0)|Ai.fromString(r)}static provideLinks(e){for(var t=[],r=function(a){var s=e.getLineContent(a),l=Ol(s),d=l.filter(h=>h.type==="url"?/^https?:\/\//.test(h.value):!0);d.forEach(h=>{t.push({url:h.href,range:new Td(a,h.start+1,a,h.end+1)})})},i=1;i<=e.getLineCount();i+=1)r(i);return{links:t}}}function Ur(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=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)}var Ot=W.module("MonacoCompletionProvider");class Ut extends m.PureComponent{static lspToMonacoKind(e){var t=Ct.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}}constructor(e){super(e),Ur(this,"registeredCompletionProvider",void 0),Ur(this,"registeredSignatureProvider",void 0),Ur(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=Ct.registerCompletionItemProvider(e,{provideCompletionItems:this.handleCompletionRequest,triggerCharacters:[".",'"',"'"]}),t.getSignatureHelp!=null&&(this.registeredSignatureProvider=Ct.registerSignatureHelpProvider(e,{provideSignatureHelp:this.handleSignatureRequest,signatureHelpTriggerCharacters:["(",","]})),t.getHover!=null&&(this.registeredHoverProvider=Ct.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:o}=this.props;if(e!==i)return null;var a={textDocument:{uri:"".concat(e.uri),version:e.getVersionId()},position:Ut.monacoToLspPosition(t),context:r},s=o.getCompletionItems(a);Ot.debug("Requested completion items",a);var l=s.then(d=>{Ot.debug("Completion items received: ",a,d);var h=d.map(c=>{var{label:v,kind:p,detail:g,documentation:f,sortText:y,filterText:T,textEdit:O,insertTextFormat:P}=c;return{label:v,kind:Ut.lspToMonacoKind(p),detail:g,documentation:f?.kind==="markdown"?f:f?.value,sortText:y,filterText:T,insertText:O.text,insertTextRules:P===2?4:P,range:Ut.lspToMonacoRange(O.range)}});return{incomplete:!0,suggestions:h}}).catch(d=>(Ot.error("There was an error retrieving completion items",d),{suggestions:[]}));return l}handleSignatureRequest(e,t,r,i){var o={value:{signatures:[],activeSignature:0,activeParameter:0},dispose:()=>{}},{model:a,session:s}=this.props;if(e!==a||s.getSignatureHelp==null)return null;var l={textDocument:{uri:"".concat(e.uri),version:e.getVersionId()},position:Ut.monacoToLspPosition(t),context:i},d=s.getSignatureHelp(l);Ot.debug("Requested signature help",l);var h=d.then(c=>{Ot.debug("Signatures received: ",l,d);var v=c.map(g=>{var{label:f,documentation:y,parameters:T}=g;return{documentation:y?.kind==="markdown"?y:y?.value,label:f,parameters:T??[]}});if(v.length===0)return o;var p=0;return{value:{signatures:v,activeSignature:p,activeParameter:c[p].activeParameter},dispose:()=>{}}}).catch(c=>(Ot.error("There was an error retrieving completion items",c),o));return h}handleHoverRequest(e,t){var{model:r,session:i}=this.props;if(e!==r||i.getHover==null)return null;var o={textDocument:{uri:"".concat(e.uri),version:e.getVersionId()},position:Ut.monacoToLspPosition(t)},a=i.getHover(o);Ot.debug("Requested hover",o);var s=a.then(l=>{Ot.debug("Hover received: ",o,l);var{contents:d}=l;return{contents:d!=null?[d]:[]}}).catch(l=>(Ot.error("There was an error retrieving hover",l),{contents:[]}));return s}render(){return null}}function vo(n,e,t,r,i,o,a){try{var s=n[o](a),l=s.value}catch(d){return void t(d)}s.done?e(l):Promise.resolve(l).then(r,i)}function kc(n){return function(){var e=this,t=arguments;return new Promise(function(r,i){var o=n.apply(e,t);function a(l){vo(o,r,i,a,s,"next",l)}function s(l){vo(o,r,i,a,s,"throw",l)}a(void 0)})}}function Je(n,e,t){return(e=Nc(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Nc(n){var e=jc(n,"string");return typeof e=="symbol"?e:e+""}function jc(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 Vr=W.module("ConsoleInput"),yr=parseInt(ni["line-height"],10),ws=6,Es=6,Ac=yr+ws+Es,Kr=100;class Pn extends m.PureComponent{constructor(e){super(e),Je(this,"cancelListener",void 0),Je(this,"resizeObserver",void 0),Je(this,"commandContainer",void 0),Je(this,"commandEditor",void 0),Je(this,"commandHistoryIndex",void 0),Je(this,"commandSuggestionContainer",void 0),Je(this,"loadingPromise",void 0),Je(this,"timestamp",void 0),Je(this,"bufferIndex",void 0),Je(this,"history",void 0),Je(this,"modifiedCommands",void 0),this.handleResize=this.handleResize.bind(this),this.commandContainer=$.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:yr,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(Vr.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={copyWithSyntaxHighlighting:!1,cursorStyle:"block",fixedOverflowWidgets:!0,folding:!1,fontFamily:"Fira Mono",glyphMargin:!1,language:e,lineHeight:yr,lineDecorationsWidth:3,lineNumbers:"off",minimap:{enabled:!1},renderLineHighlight:"none",scrollBeyondLastLine:!1,scrollbar:{arrowSize:0,horizontal:"hidden",horizontalScrollbarSize:0},padding:{top:ws,bottom:Es},value:"",wordWrap:"on",autoClosingBrackets:"beforeWhitespace"},i=this.commandContainer.current;R(i),this.commandEditor=mt.create(i,r),Ce.setEOL(this.commandEditor),Ce.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:s}=this,l=a?.getPosition();R(l);var{lineNumber:d}=l,h=a?.getModel();if(o.code==="ArrowUp"&&!this.isSuggestionMenuPopulated()&&d===1){s!=null?this.loadCommand(s+1):this.loadCommand(0),this.focusStart(),o.stopPropagation(),o.preventDefault();return}if(o.code==="ArrowDown"&&!this.isSuggestionMenuPopulated()&&d===h?.getLineCount()){s!=null&&s>0?this.loadCommand(s-1):this.loadCommand(null),this.focusEnd(),o.stopPropagation(),o.preventDefault();return}if(!o.altKey&&!o.shiftKey&&!o.metaKey&&o.keyCode===qt.Enter&&!this.isSuggestionMenuPopulated()){var c;o.stopPropagation(),o.preventDefault();var v=(c=this.commandEditor)===null||c===void 0?void 0:c.getValue().trim();if(v!==void 0){var p;this.processCommand(v),(p=this.commandEditor)===null||p===void 0||p.setValue("")}}}),Ce.disableKeyBindings(this.commandEditor,[et.CtrlCmd|qt.KeyF]),Ce.registerPasteHandler(this.commandEditor),this.commandEditor.focus(),this.resizeObserver.observe(i),this.updateDimensions(),this.setState({model:this.commandEditor.getModel()})}destroyCommandEditor(){var{session:e}=this.props;this.commandEditor&&(Ce.closeDocument(this.commandEditor,e),this.commandEditor.dispose(),this.commandEditor=void 0)}handleResize(){this.updateDimensions()}isSuggestionMenuActive(){var e;if(!this.commandSuggestionContainer){var t,r;this.commandSuggestionContainer=(t=this.commandEditor)===null||t===void 0||(r=t.getDomNode())===null||r===void 0?void 0:r.querySelector(".suggest-widget")}return(e=this.commandSuggestionContainer&&this.commandSuggestionContainer.classList.contains("visible"))!==null&&e!==void 0?e:!1}isSuggestionMenuPopulated(){var e,t,r;return this.isSuggestionMenuActive()&&((e=(t=this.commandSuggestionContainer)===null||t===void 0||(r=t.querySelector(".monaco-list-rows"))===null||r===void 0?void 0:r.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,o,a=(e=this.commandEditor)===null||e===void 0?void 0:e.getModel();R(a);var s=a.getLineLength(1)+1,l=(t=this.commandEditor)===null||t===void 0?void 0:t.getTopForPosition(1,s);R(l),(r=this.commandEditor)===null||r===void 0||r.setPosition({lineNumber:1,column:s}),(i=this.commandEditor)===null||i===void 0||i.setScrollTop(l),(o=this.commandEditor)===null||o===void 0||o.focus()}focusEnd(){var e,t,r,i,o,a=(e=this.commandEditor)===null||e===void 0?void 0:e.getModel();R(a);var s=a.getLineCount(),l=a.getLineLength(s)+1,d=(t=this.commandEditor)===null||t===void 0?void 0:t.getTopForPosition(s,l);R(d),(r=this.commandEditor)===null||r===void 0||r.setPosition({lineNumber:s,column:l}),(i=this.commandEditor)===null||i===void 0||i.setScrollTop(d),(o=this.commandEditor)===null||o===void 0||o.focus()}clear(){var e,t,r;(e=this.commandEditor)===null||e===void 0||e.focus(),(t=this.commandEditor)===null||t===void 0||(r=t.getModel())===null||r===void 0||r.setValue(""),this.commandHistoryIndex=null}layoutEditor(){this.commandEditor&&this.commandEditor.layout()}loadCommand(e){var t,r;if(!(e!==null&&e>=this.history.length)){var i=this.modifiedCommands.get(e),o=e===null?"":this.history[this.history.length-e-1];this.commandHistoryIndex=e,(t=this.commandEditor)===null||t===void 0||(r=t.getModel())===null||r===void 0||r.setValue(i??o),e!==null&&e>this.history.length-Kr&&this.loadMoreHistory()}}loadMoreHistory(){var e=this;return kc(function*(){try{if(e.loadingPromise!=null||e.bufferIndex==null)return;var{commandHistoryStorage:t,language:r,scope:i}=e.props;e.loadingPromise=Te.makeCancelable(t.getTable(r,i??"",e.timestamp),s=>s.close());var o=yield e.loadingPromise;o.setReversed(!0),o.setViewport({top:e.bufferIndex,bottom:e.bufferIndex+Kr-1}),e.loadingPromise=Te.makeCancelable(o.getViewportData(),()=>o.close());var a=yield e.loadingPromise;e.bufferIndex+=Kr,e.bufferIndex>=o.size&&(e.bufferIndex=null),e.history=[...a.items.filter((s,l,d)=>{var{name:h}=s;return l===0||h!==d[l-1].name}).map(s=>{var{name:l}=s;return l}).reverse(),...e.history],e.loadingPromise=void 0,o.close()}catch(s){if(e.loadingPromise=void 0,Te.isCanceled(s)){Vr.debug2("Promise canceled, not loading history");return}Vr.error("Error fetching history",s)}})()}processCommand(e){this.commandHistoryIndex=null,this.modifiedCommands.clear(),R(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;R(e);var t=this.commandEditor.getContentHeight(),r=Math.max(Math.min(t,e),Ac),i=t>r,o={overviewRulerLanes:i?void 0:0};this.setState({commandEditorHeight:r},()=>{var a,s;(a=this.commandEditor)===null||a===void 0||a.updateOptions(o),(s=this.commandEditor)===null||s===void 0||s.layout()})}}render(){var{disabled:e,language:t,session:r}=this.props,{commandEditorHeight:i,isFocused:o,model:a}=this.state;return u.jsx("div",{className:X("console-input-wrapper",{disabled:e}),children:u.jsxs("div",{className:X("console-input-inner-wrapper",{focus:o}),children:[u.jsx("div",{className:Pn.INPUT_CLASS_NAME,ref:this.commandContainer,style:{height:i}}),a&&u.jsx(Ut,{model:a,language:t,session:r})]})})}}Je(Pn,"defaultProps",{maxHeight:yr*10,scope:null,disabled:!1});Je(Pn,"INPUT_CLASS_NAME","console-input");function Vt(n,e,t){return(e=Lc(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Lc(n){var e=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)}var po="pasted values",Rc=[/^audio.*/,/^font.*/,/^image.*/,/^video.*/],zr=[".csv",".tsv",".tab",".psv",".dsv",".txt"],fo=[".zip"];class We extends m.Component{static isValidDropItem(e){return e!=null&&e.kind==="file"&&!Rc.find(t=>t.test(e.type))}static isValidExtension(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return zr.some(r=>e.endsWith(r))||t&&fo.some(r=>e.endsWith(r))}static handleDragOver(e){e.preventDefault(),e.stopPropagation()}static getIcon(e){return e===po?ki:e.endsWith(".csv")?nd:e.endsWith(".zip")?rd:id}constructor(e){super(e),Vt(this,"fileElem",void 0),Vt(this,"divElem",void 0),Vt(this,"getValidExtensions",wt(t=>t?[...zr,...fo]:[...zr])),Vt(this,"getAcceptString",wt(t=>this.getValidExtensions(t).join(", "))),Vt(this,"getFileTypeErrorString",wt(t=>Ya.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=$.createRef(),this.divElem=$.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 o=e.dataTransfer.items[0].getAsFile();R(o),We.isValidExtension(o.name,t)?this.handleFile(o):this.setState({dropError:We.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:po,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:ki,action:this.handleMenuPaste,shortcut:Kt.PASTE,disabled:e}]}render(){var{allowZip:e,dragError:t,uploadInProgress:r}=this.props,{selectedFileName:i,dropError:o}=this.state,a=t??o,s=this.makeContextMenuItems();return u.jsxs("div",{ref:this.divElem,className:"csv-overlay fill-parent-absolute",onDragOver:We.handleDragOver,onDrop:this.handleDrop,tabIndex:-1,children:[u.jsx(re,{actions:s}),u.jsx("input",{ref:this.fileElem,type:"file",id:"fileElem",accept:this.getAcceptString(e),style:{display:"none"},onChange:this.handleFiles,"data-testid":"fileElem"}),!i&&(a===void 0||a==="")&&u.jsxs("div",{className:"message-content",children:[u.jsx("div",{className:"message-icon",children:u.jsx(he,{icon:od})}),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(ee,{kind:"primary",onClick:this.handleSelectFile,children:"Select File..."})]}),i&&(a===void 0||a==="")&&u.jsxs("div",{className:"selected-content",children:[u.jsx("div",{className:"selected-icon",children:u.jsx(he,{icon:We.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(ee,{kind:"ghost",className:"ml-2",onClick:this.unstageFile,icon:Ba,tooltip:"Remove"})]})]})]}),!!a&&u.jsxs("div",{className:"message-content",children:[u.jsx("div",{className:"message-icon",children:u.jsx(he,{icon:Wa})}),u.jsx("label",{children:a}),a===We.FILE_TYPE_ERROR&&u.jsx("div",{className:"message-small",children:u.jsx("label",{children:this.getFileTypeErrorString(e)})})]})]})}}Vt(We,"defaultProps",{allowZip:!1,dragError:null});Vt(We,"MULTIPLE_FILE_ERROR","Please select only one file");Vt(We,"FILE_TYPE_ERROR","Filetype not supported.");function dn(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=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 Y{}dn(Y,"INTEGER","int");dn(Y,"LONG","long");dn(Y,"DOUBLE","double");dn(Y,"BOOLEAN","bool");dn(Y,"STRING","string");dn(Y,"DATE_TIME","datetime");dn(Y,"LOCAL_TIME","localtime");function Ps(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 go(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 bo(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?go(Object(t),!0).forEach(function(r){$e(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):go(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function $e(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=Wc(n,"string");return typeof e=="symbol"?e:e+""}function Wc(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="unknown",Uc=2147483647,Vc=-2147483648,Co=/^[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]+)?$/,So=/^([0-9]+T)?([0-9]+):([0-9]+)(:[0-9]+)?(?:\.[0-9]{1,9})?$/;class Ne{static determineType(e,t,r){if(!e||e===r)return t;switch(t){case Y.STRING:return Y.STRING;case Y.INTEGER:return Ne.checkInteger(e);case Y.LONG:return Ne.checkLong(e);case Y.DOUBLE:return Ne.checkDouble(e);case Y.BOOLEAN:return Ne.checkBoolean(e);case Y.DATE_TIME:return Ne.checkDateTime(e);case Y.LOCAL_TIME:return Ne.checkLocalTime(e);default:return Ne.getTypeFromUnknown(e)}}static isNotParsableNumber(e){return isNaN(e)||e==="Infinity"||e==="-Infinity"}static checkInteger(e){var t=e.replace(/,/g,"");return Ne.isNotParsableNumber(t)?Y.STRING:Ne.getNumberType(t)}static checkLong(e){var t=e.replace(/,/g,"");return Ne.isNotParsableNumber(t)?Y.STRING:t.includes(".")?Y.DOUBLE:Y.LONG}static checkDouble(e){var t=e.replace(/,/g,"");return Ne.isNotParsableNumber(t)?Y.STRING:Y.DOUBLE}static checkBoolean(e){var t=e.toLowerCase();return t==="true"||t==="false"?Y.BOOLEAN:Y.STRING}static checkDateTime(e){return Co.test(e)?Y.DATE_TIME:Y.STRING}static checkLocalTime(e){return So.test(e)?Y.LOCAL_TIME:Y.STRING}static getTypeFromUnknown(e){var t=e.replace(/,/g,"");if(Ne.isNotParsableNumber(t)){var r=e.toLowerCase();return r==="true"||r==="false"?Y.BOOLEAN:Co.test(e)&&e.includes(":")?Y.DATE_TIME:So.test(e)?Y.LOCAL_TIME:Y.STRING}return Ne.getNumberType(t)}static getNumberType(e){if(e.includes("."))return Y.DOUBLE;var t=e.startsWith("-")?11:10;if(e.length>t)return Y.LONG;var r=parseInt(e,10);return r>Uc||r<Vc?Y.LONG:Y.INTEGER}constructor(e,t,r,i,o,a,s,l,d,h){$e(this,"onFileCompleted",void 0),$e(this,"file",void 0),$e(this,"readHeaders",void 0),$e(this,"nullString",void 0),$e(this,"onProgress",void 0),$e(this,"onError",void 0),$e(this,"types",void 0),$e(this,"chunks",void 0),$e(this,"totalChunks",void 0),$e(this,"rowCount",void 0),$e(this,"isZip",void 0),$e(this,"shouldTrim",void 0),$e(this,"zipProgress",void 0),$e(this,"config",void 0),this.onFileCompleted=e,this.file=t,this.readHeaders=r,this.nullString=o,this.onProgress=a,this.onError=s,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=bo(bo({},i),{},{error:this.handleError,chunk:this.handleChunk,complete:this.handleComplete})}parse(){if(this.file instanceof File||this.file instanceof Blob)Wn.parse(this.file,this.config);else{var e=Ps(this.file,this.handleNodeUpdate);Wn.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(yo),this.readHeaders&&(r=r.slice(1))}this.rowCount+=r.length,R(this.types);var i=[...this.types];r.forEach(s=>{if(s.length>=i.length){for(var l=0;l<i.length;l+=1)i[l]=Ne.determineType(this.shouldTrim?s[l].trim():s[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(s.length,`.
|
|
@@ -19,5 +19,5 @@ Row = `).concat(s))}),this.chunks+=1;var o=0;this.totalChunks>0?o=Math.round(thi
|
|
|
19
19
|
`&&(r+=`
|
|
20
20
|
`))}}if(r=r.trimRight(),this.editor.setValue(r),t){var s,l=(s=this.editor.getModel())===null||s===void 0?void 0:s.getLineCount();R(l),this.editor.revealLine(l,1)}this.stopFlushTimer(),this.bufferedMessages=[]}}truncateLogIfNecessary(){this.messages.length>ye.maxLogSize&&(this.messages=this.messages.splice(this.messages.length-ye.truncateSize))}scrollToBottom(){var e,t,r;if(this.editor){var i=(e=this.editor)===null||e===void 0||(t=e.getModel)===null||t===void 0||(r=t.call(e))===null||r===void 0?void 0:r.getLineCount();R(i),this.editor.revealLine(i,1)}}isBottomVisible(){if(!this.editor)return!0;var e=this.editor.getModel(),t=e?.getLineCount();return R(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 o=r[i];if(o.startLineNumber<=e&&e<=o.endLineNumber)return!0}return!1}isLogItemVisible(e){var{shownLogLevels:t}=this.state;return t[e.logLevel]}flush(){for(var e="",t=0;t<this.bufferedMessages.length;t+=1){var r=this.bufferedMessages[t],i=ye.getLogText(r);e+=i,i.charAt(i.length-1)!==`
|
|
21
21
|
`&&(e+=`
|
|
22
|
-
`)}this.bufferedMessages=[],this.appendLogText(e)}queue(e){this.bufferedMessages.push(e),this.bufferedMessages.length===1&&(this.flushTimer=setTimeout(this.handleFlushTimeout,ye.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(ee,{kind:"ghost",className:"btn-clear-logs",onClick:this.handleClearClick,icon:ld,tooltip:"Clear log"}),u.jsx(ee,{kind:"ghost",className:"btn-link-icon btn-overflow",icon:dd,tooltip:"Log Settings",onClick:()=>{},children:u.jsx(Cn,{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}})]})}}tt(ye,"DefaultLogLevels",[Ie.STDOUT,Ie.ERROR,Ie.FATAL,Ie.STDERR,Ie.WARN]);tt(ye,"AllLogLevels",[Ie.INFO,Ie.STDOUT,Ie.ERROR,Ie.FATAL,Ie.STDERR,Ie.WARN,Ie.DEBUG,Ie.TRACE]);tt(ye,"bufferTimeout",16);tt(ye,"maxLogSize",131072);tt(ye,"truncateSize",65536);function bi(n,e,t){return(e=Tm(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Tm(n){var e=_m(n,"string");return typeof e=="symbol"?e:e+""}function _m(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var 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 xe{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""}}bi(xe,"TYPE_GLOBAL","type-global");bi(xe,"TYPE_CONTEXT_PRESET","type-context-preset");bi(xe,"TYPE_CONTEXT_CUSTOM","type-context-custom");class Om extends xe{format(e){switch(e){case 1:case!0:return"true";case 0:case!1:return"false";default:return""}}}class Im extends xe{format(e){return String.fromCharCode(e)}}function Ht(n,e,t){return(e=Dm(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Dm(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 No=W.module("DateTimeColumnFormatter");class vt extends xe{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]:xe.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=vt.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=vt.makeFormatStringMap(e,t);return[...r.keys()]}constructor(e){var{timeZone:t="",showTimeZone:r=!0,showTSeparator:i=!1,defaultDateTimeFormatString:o=vt.DEFAULT_DATETIME_FORMAT_STRING}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};super(),Ht(this,"dh",void 0),Ht(this,"dhTimeZone",void 0),Ht(this,"defaultDateTimeFormatString",void 0),Ht(this,"showTimeZone",void 0),Ht(this,"showTSeparator",void 0),Ht(this,"formatStringMap",void 0);var a=t||vt.DEFAULT_TIME_ZONE_ID;try{this.dhTimeZone=e.i18n.TimeZone.getTimeZone(a)}catch{No.error("Unsupported time zone id",a),this.dhTimeZone=e.i18n.TimeZone.getTimeZone(vt.DEFAULT_TIME_ZONE_ID)}this.dh=e,this.defaultDateTimeFormatString=o,this.showTimeZone=r,this.showTSeparator=i,this.formatStringMap=vt.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{No.error("Invalid format arguments")}return""}}Ht(vt,"DEFAULT_DATETIME_FORMAT_STRING","yyyy-MM-dd HH:mm:ss.SSS");Ht(vt,"DEFAULT_TIME_ZONE_ID","America/New_York");function gt(n,e,t){return(e=Mm(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Mm(n){var e=km(n,"string");return typeof e=="symbol"?e:e+""}function km(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 Nm=W.module("DecimalColumnFormatter");class fe extends xe{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]:xe.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 fe.makeFormat(e,t,xe.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 fe.makeFormat("Custom Format",e,xe.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=fe.DEFAULT_FORMAT_STRING}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};super(),gt(this,"defaultFormatString",void 0),gt(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{Nm.error("Invalid format arguments")}return""}}gt(fe,"DEFAULT_FORMAT_STRING","###,##0.0000");gt(fe,"FORMAT_PERCENT",fe.makePresetFormat("Percent","##0.00%"));gt(fe,"FORMAT_BASIS_POINTS",fe.makePresetFormat("Basis Points","###,##0 bp",1e4));gt(fe,"FORMAT_THOUSANDS",fe.makePresetFormat("Thousands","##0.000 k",.001));gt(fe,"FORMAT_MILLIONS",fe.makePresetFormat("Millions","###,##0.000 mm",1e-6));gt(fe,"FORMAT_SCIENTIFIC_NOTATION",fe.makePresetFormat("Scientific Notation","0.0000E0"));gt(fe,"FORMAT_ROUND",fe.makePresetFormat("Round","###,##0"));gt(fe,"FORMAT_ROUND_TWO_DECIMALS",fe.makePresetFormat("0.00","###,##0.00"));gt(fe,"FORMAT_ROUND_FOUR_DECIMALS",fe.makePresetFormat("0.0000","###,##0.0000"));class jm extends xe{format(e){return"".concat(e)}}function _n(n,e,t){return(e=Am(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Am(n){var e=Lm(n,"string");return typeof e=="symbol"?e:e+""}function Lm(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 Fm=W.module("IntegerColumnFormatter");class dt extends xe{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]:xe.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 dt.makeFormat(e,t,xe.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 dt.makeFormat("Custom Format",e,xe.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=dt.DEFAULT_FORMAT_STRING}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};super(),_n(this,"dh",void 0),_n(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{Fm.error("Invalid format arguments")}return""}}_n(dt,"DEFAULT_FORMAT_STRING","###,##0");_n(dt,"FORMAT_THOUSANDS",dt.makePresetFormat("Thousands","##0.000 k",.001));_n(dt,"FORMAT_MILLIONS",dt.makePresetFormat("Millions","###,##0.000 mm",1e-6));_n(dt,"FORMAT_SCIENTIFIC_NOTATION",dt.makePresetFormat("Scientific Notation","0.0000E0"));class Rm extends xe{format(e){return e}}function jo(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 Ao(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?jo(Object(t),!0).forEach(function(r){yi(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):jo(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function yi(n,e,t){return(e=$m(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function $m(n){var e=Hm(n,"string");return typeof e=="symbol"?e:e+""}function Hm(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 Bm=/\s*(\d{4})([-./](\d{1,2}|[a-z]+))?([-./](\d{1,2}))?([tT\s](\d{2})([:](\d{2}))?([:](\d{2}))?([.](\d{1,9}))?)?(.*)/;class we{static makeDateWrapper(e,t,r){var i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:1,a=arguments.length>5&&arguments[5]!==void 0?arguments[5]:0,s=arguments.length>6&&arguments[6]!==void 0?arguments[6]:0,l=arguments.length>7&&arguments[7]!==void 0?arguments[7]:0,d=arguments.length>8&&arguments[8]!==void 0?arguments[8]:0;if(!t)throw new Error("No timezone provided");var h="".concat(r).padStart(4,"0"),c="".concat(i+1).padStart(2,"0"),v="".concat(o).padStart(2,"0"),p="".concat(a).padStart(2,"0"),g="".concat(s).padStart(2,"0"),f="".concat(l).padStart(2,"0"),y="".concat(d).padStart(9,"0"),T="".concat(h,"-").concat(c,"-").concat(v," ").concat(p,":").concat(g,":").concat(f,".").concat(y);return e.i18n.DateTimeFormat.parse(we.FULL_DATE_FORMAT,T,e.i18n.TimeZone.getTimeZone(t))}static getNextNanos(e){var t=parseInt(e,10),r="0".repeat(9-e.length),i="".concat(t+1).concat(r);return parseInt(i,10)}static getNextDate(e,t,r,i){var{year:o,month:a,date:s,hours:l,minutes:d,seconds:h,nanos:c}=r;if(t.nanos!=null){if(t.nanos.length===9)return null;c=we.getNextNanos(t.nanos),c>999999999&&(h+=1,c=0)}else t.seconds!=null?h+=1:t.minutes!=null?d+=1:t.hours!=null?l+=1:t.date!=null?s+=1:t.month!=null?a+=1:o+=1;var v=new Date(o,a,s,l,d,h);return we.makeDateWrapper(e,i,v.getFullYear(),v.getMonth(),v.getDate(),v.getHours(),v.getMinutes(),v.getSeconds(),c)}static parseMonth(e){var t=parseInt(e,10);if(!Number.isNaN(t))return t>=1&&t<=12?t-1:NaN;var r=e.trim().toLowerCase();if(r.length>=3){for(var i=0;i<we.months.length;i+=1)if(we.months[i].startsWith(r))return i}return NaN}static parseDateValues(e,t,r,i,o,a,s){var l=parseInt(e,10),d=t!=null?this.parseMonth(t):0,h=r!=null?parseInt(r,10):1,c=i!=null?parseInt(i,10):0,v=o!=null?parseInt(o,10):0,p=a!=null?parseInt(a,10):0,g=s!=null?parseInt(s.padEnd(9,"0"),10):0;return Number.isNaN(l)||Number.isNaN(d)||Number.isNaN(h)||Number.isNaN(c)||Number.isNaN(v)||Number.isNaN(p)||Number.isNaN(g)?null:{year:l,month:d,date:h,hours:c,minutes:v,seconds:p,nanos:g}}static parseDateTimeString(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,r=Bm.exec(e);if(r==null)throw new Error("Unexpected date string: ".concat(e));var[,i,,o,,a,,s,,l,,d,,h,c]=r;if(!t&&c!=null&&c.length>0)throw new Error("Unexpected characters after date string '".concat(e,"': ").concat(c));var v={year:i,month:o,date:a,hours:s,minutes:l,seconds:d,nanos:h};return t?Ao(Ao({},v),{},{overflow:c}):v}static parseDateRange(e,t,r){var i=t.trim().toLowerCase();if(i.length===0)throw new Error("Cannot parse date range from empty string");if(i==="null")return[null,null];if(i==="today"){var o=new Date(Date.now()),a=we.makeDateWrapper(e,r,o.getFullYear(),o.getMonth(),o.getDate()),s=new Date(o.getFullYear(),o.getMonth(),o.getDate()+1),l=we.makeDateWrapper(e,r,s.getFullYear(),s.getMonth(),s.getDate());return[a,l]}if(i==="yesterday"){var d=new Date(Date.now()),h=new Date(d.getFullYear(),d.getMonth(),d.getDate()-1),c=we.makeDateWrapper(e,r,h.getFullYear(),h.getMonth(),h.getDate()),v=we.makeDateWrapper(e,r,d.getFullYear(),d.getMonth(),d.getDate());return[c,v]}if(i==="now"){var p=new Date(Date.now()),g=e.DateWrapper.ofJsDate(p);return[g,null]}var f=we.parseDateTimeString(i);if(f.year==null&&f.month==null&&f.date==null)throw new Error("Unable to extract year, month, or day ".concat(i));var y=we.parseDateValues(f.year,f.month,f.date,f.hours,f.minutes,f.seconds,f.nanos);if(y==null)throw new Error("Unable to extract date values from ".concat(f));var T=we.makeDateWrapper(e,r,y.year,y.month,y.date,y.hours,y.minutes,y.seconds,y.nanos),O=we.getNextDate(e,f,y,r);return[T,O]}static getJsDate(e){return typeof e=="number"?new Date(e):e.asDate()}static trimDateTimeStringTimeZone(e){var{overflow:t=""}=we.parseDateTimeString(e,!0);if(t==="")return e;if(!/^\s[A-Za-z]+/.test(t))throw new Error("Unexpected timezone format in overflow: '".concat(e,"'"));return e.slice(0,-t.length)}}yi(we,"FULL_DATE_FORMAT","yyyy-MM-dd HH:mm:ss.SSSSSSSSS");yi(we,"months",["january","february","march","april","may","june","july","august","september","october","november","december"]);function Eb(n,e){return n===e?{operator:"notEq",value:""}:{operator:"eq",value:n}}function Pb(n,e,t,r){return function(o){var a=t.trim();if(a==="")return null;var s=ks(e,l=>n.makeSearchTextFilter(l,a,r),"or");return s(o)}}function ks(n,e){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"or";return function(i){var o=i?.findColumns(typeof n=="string"?[n]:n);if(o==null||o.length===0)return null;var a=o.map(e);return a.reduce((s,l)=>s[t](l))}}function Wm(n,e,t,r){return ks(e,i=>i.filter()[r](n.makeFilterValue(i.type,t)),"or")}function Tb(n,e,t,r,i){return function(a){var s=a?.findColumn(e),l=t==="all"||r&&t.size===0;return s==null||l?null:n.makeSelectValueFilter(s,[...t.keys()],i)}}function _b(n){return function(t){return t.filter().isNull().not().and(t.filter().notEq(n.makeFilterValue(t.type,"")))}}function Ob(n,e){return function(r){var i=r.filter(),o=n.makeFilterValue(r.type,""),a=i.eq(o);return e?i.isNull().or(a):a.or(i.notEq(o))}}function Ci(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=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 qn{}Ci(qn,"not","not");Ci(qn,"and","and");Ci(qn,"or","or");function Ib(n){if(!(n==="not"||n==="and"||n==="or"))throw new Error("operator is not a valid FilterOperatorValue")}function ge(n,e,t){return(e=Km(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Km(n){var e=zm(n,"string");return typeof e=="symbol"?e:e+""}function zm(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var 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 E{}ge(E,"eq","eq");ge(E,"eqIgnoreCase","eqIgnoreCase");ge(E,"notEq","notEq");ge(E,"notEqIgnoreCase","notEqIgnoreCase");ge(E,"greaterThan","greaterThan");ge(E,"greaterThanOrEqualTo","greaterThanOrEqualTo");ge(E,"lessThan","lessThan");ge(E,"lessThanOrEqualTo","lessThanOrEqualTo");ge(E,"in","in");ge(E,"inIgnoreCase","inIgnoreCase");ge(E,"notIn","notIn");ge(E,"notInIgnoreCase","notInIgnoreCase");ge(E,"isTrue","isTrue");ge(E,"isFalse","isFalse");ge(E,"isNull","isNull");ge(E,"invoke","invoke");ge(E,"contains","contains");ge(E,"notContains","notContains");ge(E,"containsIgnoreCase","containsIgnoreCase");ge(E,"startsWith","startsWith");ge(E,"endsWith","endsWith");ge(E,"containsAny","containsAny");var Gm="DH_ITEM_KEY",Lo=W.module("ViewportDataUtils");function Ns(n){return"".concat(Gm,"_").concat(n)}function Db(n,e){var{bulkUpdate:t}=n;return function(i){var{columns:o,offset:a,rows:s}=i.detail;Lo.debug("table updated",i.detail);var l=new Map;s.forEach((d,h)=>{var c=e(d,o),v=Ns(a+h);l.set(v,{key:v,item:c})}),Lo.debug("update keys",l),t(l)}}function xb(n,e){return e.reduce((t,r)=>(t[r.name]=n.get(r),t),{})}function*Mb(n,e){for(var t=n;t<=e;++t)yield{key:Ns(t)}}function qm(n){return n==null||Zm(n)?0:n.size}function Zm(n){return"isClosed"in n?n.isClosed:!1}function kb(n,e,t,r){var i=n+e-1,[o,a]=[0,r-1],s=xi(n-t,o,a),l=xi(i+t,o,a);return[s,l]}function Fo(n,e,t,r,i,o,a){try{var s=n[o](a),l=s.value}catch(d){return void t(d)}s.done?e(l):Promise.resolve(l).then(r,i)}function Rt(n){return function(){var e=this,t=arguments;return new Promise(function(r,i){var o=n.apply(e,t);function a(l){Fo(o,r,i,a,s,"next",l)}function s(l){Fo(o,r,i,a,s,"throw",l)}a(void 0)})}}function un(n,e,t){return(e=Xm(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Xm(n){var e=Ym(n,"string");return typeof e=="symbol"?e:e+""}function Ym(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 It=W.module("TableUtils");function Nb(n){return n===C.sortDirection.ascending||n===C.sortDirection.descending||n===C.sortDirection.reverse||n===C.sortDirection.none}class C{static copyTableAndApplyFilters(e){var t=arguments;return Rt(function*(){if(e==null)return null;for(var r=yield e.copy(),i=t.length,o=new Array(i>1?i-1:0),a=1;a<i;a++)o[a-1]=t[a];return r.applyFilter(Br(...o.map(s=>s(r)))),r})()}static getSortIndex(e,t){for(var r=0;r<e.length;r+=1){var i,o=e[r];if(((i=o.column)===null||i===void 0?void 0:i.name)===t)return r}return null}static getSortForColumn(e,t){var r=C.getSortIndex(e,t);return r!=null?e[r]:null}static getFilterText(e){return e?e.toString():null}static getFilterTypes(e){return C.isBooleanType(e)?[E.isTrue,E.isFalse,E.isNull]:C.isCharType(e)||C.isNumberType(e)||C.isDateType(e)?[E.eq,E.notEq,E.greaterThan,E.greaterThanOrEqualTo,E.lessThan,E.lessThanOrEqualTo]:C.isTextType(e)?[E.eq,E.eqIgnoreCase,E.notEq,E.notEqIgnoreCase,E.contains,E.notContains,E.startsWith,E.endsWith]:[]}static getNextSort(e,t,r){var i=e[r];if(i==null)return null;var o=C.getSortForColumn(t,i.name);return o===null?this.makeColumnSort(e,r,C.sortDirection.ascending,!1):o.direction===C.sortDirection.ascending?this.makeColumnSort(e,r,C.sortDirection.descending,!1):null}static makeColumnSort(e,t,r,i){var o=e[t];return o==null||r===C.sortDirection.none?null:{column:{name:o.name,type:o.type},isAbs:i,direction:r}}static toggleSortForColumn(e,t,r){var i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(t[r]==null)return[];var o=C.getNextSort(t,e,r);return C.setSortForColumn(e,t[r].name,o,i)}static sortColumn(e,t,r,i,o,a){if(r<0||r>=t.length)return[];var s=C.makeColumnSort(t,r,i,o);return C.setSortForColumn(e,t[r].name,s,a)}static setSortForColumn(e,t,r){var i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1,o=C.getSortIndex(e,t),a=[];return i&&(a=a.concat(e.filter(s=>{var{direction:l}=s;return l!==C.sortDirection.reverse})),o!==null&&a.splice(o,1)),r!==null&&a.push(r),a}static getNormalizedType(e){switch(e){case"boolean":case"java.lang.Boolean":case C.dataType.BOOLEAN:return C.dataType.BOOLEAN;case"char":case"java.lang.Character":case C.dataType.CHAR:return C.dataType.CHAR;case"java.lang.String":case C.dataType.STRING:return C.dataType.STRING;case"io.deephaven.db.tables.utils.DBDateTime":case"io.deephaven.time.DateTime":case"com.illumon.iris.db.tables.utils.DBDateTime":case"java.time.Instant":case"java.time.ZonedDateTime":case C.dataType.DATETIME:return C.dataType.DATETIME;case"double":case"java.lang.Double":case"float":case"java.lang.Float":case"java.math.BigDecimal":case C.dataType.DECIMAL:return C.dataType.DECIMAL;case"int":case"java.lang.Integer":case"long":case"java.lang.Long":case"short":case"java.lang.Short":case"byte":case"java.lang.Byte":case"java.math.BigInteger":case C.dataType.INT:return C.dataType.INT;default:return C.dataType.UNKNOWN}}static isLongType(e){switch(e){case"long":case"java.lang.Long":return!0;default:return!1}}static isDateType(e){switch(e){case"io.deephaven.db.tables.utils.DBDateTime":case"io.deephaven.time.DateTime":case"java.time.Instant":case"java.time.ZonedDateTime":case"com.illumon.iris.db.tables.utils.DBDateTime":return!0;default:return!1}}static isNumberType(e){return C.isIntegerType(e)||C.isDecimalType(e)}static isIntegerType(e){switch(e){case"int":case"java.lang.Integer":case"java.math.BigInteger":case"long":case"java.lang.Long":case"short":case"java.lang.Short":case"byte":case"java.lang.Byte":return!0;default:return!1}}static isDecimalType(e){switch(e){case"double":case"java.lang.Double":case"java.math.BigDecimal":case"float":case"java.lang.Float":return!0;default:return!1}}static isBigDecimalType(e){switch(e){case"java.math.BigDecimal":return!0;default:return!1}}static isBigIntegerType(e){switch(e){case"java.math.BigInteger":return!0;default:return!1}}static isBooleanType(e){switch(e){case"boolean":case"java.lang.Boolean":return!0;default:return!1}}static isCharType(e){switch(e){case"char":case"java.lang.Character":return!0;default:return!1}}static isStringType(e){switch(e){case"java.lang.String":return!0;default:return!1}}static isTextType(e){return this.isStringType(e)||this.isCharType(e)}static getBaseType(e){return e.split("[]")[0]}static isCompatibleType(e,t){return C.getNormalizedType(e)===C.getNormalizedType(t)}static quoteValue(e){return e.length>=2&&(e.charAt(0)==='"'&&e.charAt(e.length-1)==='"'||e.charAt(0)==="'"&&e.charAt(e.length-1)==="'")?e:'"'.concat(e,'"')}static isRangeOperation(e){switch(e){case"<":case"<=":case"=<":case">":case">=":case"=>":return!0;default:return!1}}static makeRangeFilterWithOperation(e,t,r){switch(t){case"=":return e.eq(r);case"<":return e.lessThan(r);case"<=":case"=<":return e.lessThanOrEqualTo(r);case">":return e.greaterThan(r);case">=":case"=>":return e.greaterThanOrEqualTo(r);case"!=":case"!":return e.notEq(r);default:return null}}static makeCancelableTablePromise(e){return Te.makeCancelable(e,t=>{t.close()})}static makeCancelableTableEventPromise(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null,o,a,s=!0,l=new Promise((d,h)=>{a=setTimeout(()=>{o(),s=!1,h(new Xa('Event "'.concat(t,'" timed out.')))},r),o=e.addEventListener(t,c=>{if(i!=null&&!i(c)){It.debug2("Event triggered, but matcher returned false.");return}It.debug2("Event triggered, resolving."),o(),clearTimeout(a),s=!1,d(c)})});return l.cancel=()=>{if(s){It.debug2("Pending promise cleanup."),o(),clearTimeout(a),s=!1;return}It.debug2("Ignoring non-pending promise cancel.")},l}static removeCommas(e){return e.replace(/[\s|,]/g,"")}static makeBooleanValue(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(e===""&&t)return null;switch(e?.toLowerCase()){case"null":return null;case"0":case"f":case"fa":case"fal":case"fals":case"false":case"n":case"no":return!1;case"1":case"t":case"tr":case"tru":case"true":case"y":case"ye":case"yes":return!0;default:throw new Error("Invalid boolean '".concat(e,"'"))}}static makeNumberValue(e){if(e==="null"||e==="")return null;var t=e.toLowerCase().trim();if(t==="∞"||t==="infinity"||t==="inf")return Number.POSITIVE_INFINITY;if(t==="-∞"||t==="-infinity"||t==="-inf")return Number.NEGATIVE_INFINITY;var r=C.removeCommas(t);if(C.NUMBER_REGEX.test(r))return parseFloat(r);throw new Error("Invalid number '".concat(e,"'"))}static getFilterOperatorString(e){switch(e){case E.eq:return"=";case E.notEq:return"!=";case E.greaterThan:return">";case E.greaterThanOrEqualTo:return">=";case E.lessThan:return"<";case E.lessThanOrEqualTo:return"<=";case E.contains:return"~";case E.notContains:return"!~";default:throw new Error("Unexpected filter type ".concat(e))}}static isPartitionedTable(e){return e!=null&&e.getMergedTable!==void 0&&e.getKeyTable!==void 0&&e.getKeys!==void 0}static isTreeTable(e){return e!=null&&e.expand!==void 0&&e.collapse!==void 0}static sortColumns(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return[...e].sort((r,i)=>{var o=r.name.toUpperCase(),a=i.name.toUpperCase();return Ya.sort(o,a,t)})}constructor(e){un(this,"dh",void 0),this.dh=e,Dd(this)}createDistinctSortedColumnTable(e,t,r){var i=arguments,o=this;return Rt(function*(){if(e==null)return null;for(var a=e,s=i.length,l=new Array(s>3?s-3:0),d=3;d<s;d++)l[d-3]=i[d];l.length>0&&(a=yield e.copy(),yield a.applyFilter(Br(...l.map(p=>p(a)))));var h=a.findColumn(t),c=yield a.selectDistinct([h]);a!==e&&a.close();var v=c.findColumn(t).sort()[r]();return o.applySort(c,[v])})()}doesColumnValueExist(e,t,r,i){var o=this;return Rt(function*(){if(e==null)return null;var a=Wm(o,t,r,i?"eq":"eqIgnoreCase"),s=yield e.copy();yield o.applyFilter(s,Br(a(s)));var l=qm(s);return s.close(),l>0})()}getValueType(e){if(e==null)return this.dh.ValueType.STRING;var t=C.getNormalizedType(e);switch(t){case C.dataType.BOOLEAN:return this.dh.ValueType.BOOLEAN;case C.dataType.CHAR:case C.dataType.STRING:return this.dh.ValueType.STRING;case C.dataType.DATETIME:return this.dh.ValueType.DATETIME;case C.dataType.DECIMAL:case C.dataType.INT:return C.isBigDecimalType(e)||C.isBigIntegerType(e)?this.dh.ValueType.STRING:this.dh.ValueType.NUMBER;default:return this.dh.ValueType.STRING}}makeQuickFilter(e,t,r){for(var i=t.split("||"),o=null,a=0;a<i.length;a+=1){for(var s=i[a],l=s.split("&&"),d=null,h=0;h<l.length;h+=1){var c=l[h].trim();if(c.length>0){var v=this.makeQuickFilterFromComponent(e,c,r);if(v)d?d=d.and(v):d=v;else throw new Error("Unable to parse quick filter from text ".concat(t))}}o&&d?o=o.or(d):o=d}return o}makeQuickFilterFromComponent(e,t,r){var{type:i}=e;return C.isNumberType(i)?this.makeQuickNumberFilter(e,t):C.isBooleanType(i)?this.makeQuickBooleanFilter(e,t):r!=null&&C.isDateType(i)?this.makeQuickDateFilter(e,t,r):C.isCharType(i)?this.makeQuickCharFilter(e,t):this.makeQuickTextFilter(e,t)}makeQuickNumberFilter(e,t){var r=e.filter(),{dh:i}=this,o=null,a=/\s*(>=|<=|=>|=<|>|<|!=|=|!)?(\s*-\s*)?(\s*\d*(?:,\d{3})*(?:\.\d*)?\s*)?(null|nan|infinity|inf|\u221E)?(.*)/i,s=a.exec(t),l=null,d=null,h=null,c=null,v=null;if(s!==null&&s.length>3&&([,l,d,h,c,v]=s),v!=null&&v.trim().length>0)return null;if(l==null&&(l="="),c!=null){if(!(l==="="||l==="!"||l==="!="))return null;switch(c=c.trim().toLowerCase(),c){case"null":o=r.isNull();break;case"nan":o=i.FilterCondition.invoke("isNaN",r);break;case"infinity":case"inf":case"∞":d!=null?o=i.FilterCondition.invoke("isInf",r).and(r.lessThan(i.FilterValue.ofNumber(0))):o=i.FilterCondition.invoke("isInf",r).and(r.greaterThan(i.FilterValue.ofNumber(0)));break}return o!==null&&(l==="!"||l==="!=")&&(o=o.not()),o}if(h==null)return null;if(h=C.removeCommas(h),C.isLongType(e.type))try{h=i.FilterValue.ofNumber(i.LongWrapper.ofString("".concat(d!=null?"-":"").concat(h)))}catch(p){return It.warn("Unable to create long filter",p),null}else{if(h=parseFloat(h),h==null||Number.isNaN(h))return null;h=i.FilterValue.ofNumber(d!=null?0-h:h)}return o=e.filter(),C.makeRangeFilterWithOperation(o,l,h)}static escapeQuickTextFilter(e){var t,r;if(e==null)return null;var i=/^(!~|!=|~|=|!)?(.*)/,o=/^\\*null$/,a=i.exec(e),s=null,l=null;if(a!==null&&a.length>2&&([,s,l]=a),s!=null){var d;return"\\".concat(s).concat((d=l)!==null&&d!==void 0?d:"")}return l!=null&&o.test(l.toLowerCase())||l!=null&&l.startsWith("*")?"\\".concat(l):l!=null&&l.endsWith("*")&&!l.endsWith("\\*")?(l=l.substring(0,l.length-1),"".concat(l,"\\*")):"".concat((t=s)!==null&&t!==void 0?t:"").concat((r=l)!==null&&r!==void 0?r:"")}static unescapeQuickTextFilter(e){var t,r,i=/^(\\!~|\\!=|\\~|\\=|\\!)?(.*)/,o=/^\\*null$/,a=i.exec(e),s=null,l=null;return a!==null&&a.length>2&&([,s,l]=a),s!=null&&(s=s.replace("\\","")),l!=null&&o.test(l.toLowerCase())&&(l=l.replace("\\","")),s==null&&l!=null&&l.startsWith("\\*")&&(l=l.substring(1)),s==null&&l!=null&&l.endsWith("\\*")?(l=l.substring(0,l.length-2),"".concat(l,"*")):"".concat((t=s)!==null&&t!==void 0?t:"").concat((r=l)!==null&&r!==void 0?r:"")}makeQuickTextFilter(e,t){var{dh:r}=this,i="".concat(t).trim(),o=/^(!~|!=|~|=|!)?(.*)/,a=o.exec(i),s=null,l=null;if(a!==null&&a.length>2&&([,s,l]=a,l!=null&&(l=l.trim())),l==null||l.length===0&&!(s==="="||s==="!="))return null;s==null&&(s="=");var d=e.filter();if(l.toLowerCase()==="null")switch(s){case"=":return d.isNull();case"!=":case"!":return d.isNull().not()}var h=null,c=null;switch(l.startsWith("*")?(h="*",l=l.substring(1)):l.endsWith("*")&&!l.endsWith("\\*")&&(c="*",l=l.substring(0,l.length-1)),l=C.unescapeQuickTextFilter(l),s){case"~":return d.isNull().not().and(d.invoke("matches",r.FilterValue.ofString("(?s)(?i).*\\Q".concat(l,"\\E.*"))));case"!~":return d.isNull().or(d.invoke("matches",r.FilterValue.ofString("(?s)(?i).*\\Q".concat(l,"\\E.*"))).not());case"!=":return h==="*"?d.isNull().or(d.invoke("matches",r.FilterValue.ofString("(?s)(?i).*\\Q".concat(l,"\\E$"))).not()):c==="*"?d.isNull().or(d.invoke("matches",r.FilterValue.ofString("(?s)(?i)^\\Q".concat(l,"\\E.*"))).not()):d.notEqIgnoreCase(r.FilterValue.ofString(l.toLowerCase()));case"=":return h==="*"?d.isNull().not().and(d.invoke("matches",r.FilterValue.ofString("(?s)(?i).*\\Q".concat(l,"\\E$")))):c==="*"?d.isNull().not().and(d.invoke("matches",r.FilterValue.ofString("(?s)(?i)^\\Q".concat(l,"\\E.*")))):d.eqIgnoreCase(r.FilterValue.ofString(l.toLowerCase()))}return null}makeQuickBooleanFilter(e,t){var r=/^(!=|=|!)?(.*)/,i=r.exec("".concat(t).trim());if(i===null)return null;var[,o,a]=i,s=o==="!"||o==="!=",l=a.trim().toLowerCase(),d=e.filter();try{var h=C.makeBooleanValue(l);return h!=null&&h?d=d.isTrue():h===null?d=d.isNull():d=d.isFalse(),s?d.not():d}catch{return null}}makeQuickDateFilter(e,t,r){var i=t.trim(),o=/\s*(>=|<=|=>|=<|>|<|!=|!|=)?(.*)/,a=o.exec(i);if(a==null||a.length<=2)throw new Error("Unable to parse date filter: ".concat(t));var s=null,l=null;[,s,l]=a;var d=E.eq;switch(s){case"<":d=E.lessThan;break;case"<=":case"=<":d=E.lessThanOrEqualTo;break;case">":d=E.greaterThan;break;case">=":case"=>":d=E.greaterThanOrEqualTo;break;case"!=":case"!":d=E.notEq;break;case"=":case"==":default:d=E.eq;break}return this.makeQuickDateFilterWithOperation(e,l,d,r)}makeQuickDateFilterWithOperation(e,t,r,i){var{dh:o}=this,[a,s]=we.parseDateRange(o,t,i),l=a!=null?o.FilterValue.ofNumber(a):null,d=s!=null?o.FilterValue.ofNumber(s):null,h=e.filter();if(l==null)return r===E.notEq?h.isNull().not():h.isNull();switch(r){case E.eq:{if(d!=null){var c=h.greaterThanOrEqualTo(l),v=h.lessThan(d);return c.and(v)}return h.eq(l)}case E.lessThan:return h.lessThan(l);case E.lessThanOrEqualTo:return d!=null?h.lessThan(d):h.lessThanOrEqualTo(l);case E.greaterThan:return d!=null?h.greaterThanOrEqualTo(d):h.greaterThan(l);case E.greaterThanOrEqualTo:return h.greaterThanOrEqualTo(l);case E.notEq:{if(d!=null){var p=h.lessThan(l),g=h.greaterThanOrEqualTo(d);return p.or(g)}return h.notEq(l)}default:throw new Error("Invalid operator: ".concat(r))}}makeQuickCharFilter(e,t){var{dh:r}=this,i="".concat(t).trim(),o=/^(>=|<=|=>|=<|>|<|!=|=|!)?(null|"."|'.'|.)?(.*)/,a=o.exec(i),s=null,l=null,d=null;if(a!==null&&a.length>3&&([,s,l,d]=a),d!=null&&d.trim().length>0||l==null||l.length===0)return null;s==null&&(s="=");var h=e.filter();if(l.toLowerCase()==="null")switch(s){case"=":return h.isNull();case"!=":case"!":return h.isNull().not();default:return null}var c=r.FilterValue.ofString(C.isRangeOperation(s)?C.quoteValue(l):l);return C.makeRangeFilterWithOperation(h,s,c)}makeAdvancedFilter(e,t,r){for(var{filterItems:i,filterOperators:o,invertSelection:a,selectedValues:s}=t,l=null,d=0;d<i.length;d+=1){var h=i[d],{selectedType:c,value:v}=h;if(c!=null&&c.length>0&&v!=null&&v.length>0)try{var p=this.makeAdvancedValueFilter(e,c,v,r);if(p!=null){if(d===0)l=p;else if(l!==null&&d-1<o.length){var g=o[d-1];if(g===qn.and)l=l.and(p);else if(g===qn.or)l=l.or(p);else{It.error("Unexpected filter operator",g,p),l=null;break}}}else It.debug2("Empty filter ignored for",c,v)}catch(y){It.error("Unable to create filter",y),l=null;break}}var f=this.makeSelectValueFilter(e,s,a);return f!=null&&(l!=null?l=l.and(f):l=f),l}makeAdvancedValueFilter(e,t,r,i){var{dh:o}=this;if(C.isDateType(e.type))return this.makeQuickDateFilterWithOperation(e,r,t,i);if(C.isNumberType(e.type)||C.isCharType(e.type))return this.makeQuickFilter(e,"".concat(C.getFilterOperatorString(t)).concat(r));var a=this.makeFilterValue(e.type,r),s=e.filter();switch(t){case E.eq:return s.eq(a);case E.eqIgnoreCase:return s.eqIgnoreCase(a);case E.notEq:return s.notEq(a);case E.notEqIgnoreCase:return s.notEqIgnoreCase(a);case E.greaterThan:return s.greaterThan(a);case E.greaterThanOrEqualTo:return s.greaterThanOrEqualTo(a);case E.lessThan:return s.lessThan(a);case E.lessThanOrEqualTo:return s.lessThanOrEqualTo(a);case E.isTrue:return s.isTrue();case E.isFalse:return s.isFalse();case E.isNull:return s.isNull();case E.contains:return s.isNull().not().and(s.invoke("matches",o.FilterValue.ofString("(?s)(?i).*\\Q".concat(r,"\\E.*"))));case E.notContains:return s.isNull().or(s.invoke("matches",o.FilterValue.ofString("(?s)(?i).*\\Q".concat(r,"\\E.*"))).not());case E.startsWith:return s.isNull().not().and(s.invoke("matches",o.FilterValue.ofString("(?s)(?i)^\\Q".concat(r,"\\E.*"))));case E.endsWith:return s.isNull().not().and(s.invoke("matches",o.FilterValue.ofString("(?s)(?i).*\\Q".concat(r,"\\E$"))));case E.in:case E.inIgnoreCase:case E.notIn:case E.notInIgnoreCase:case E.invoke:default:throw new Error("Unexpected filter operation: ".concat(t))}}makeSearchTextFilter(e,t,r){var i=this.getValueType(e.type);try{if(i===this.dh.ValueType.BOOLEAN){var o=this.makeQuickBooleanFilter(e,t);return R(o),o}if(i===this.dh.ValueType.DATETIME)return this.makeQuickDateFilterWithOperation(e,we.trimDateTimeStringTimeZone(t),"eq",r);if(i===this.dh.ValueType.NUMBER){var a=this.makeQuickNumberFilter(e,t);return R(a),a}return C.isBigDecimalType(e.type)||C.isBigIntegerType(e.type)?e.filter().eq(this.makeFilterValue(e.type,t)):e.filter().containsIgnoreCase(this.makeFilterValue(e.type,t))}catch{return this.makeNeverFilter(e)}}applyNeverFilter(e,t){var r=arguments,i=this;return Rt(function*(){var o=r.length>2&&r[2]!==void 0?r[2]:C.APPLY_TABLE_CHANGE_TIMEOUT_MS;if(e==null)return null;var a=e.findColumn(t),s=[i.makeNeverFilter(a)];return yield i.applyFilter(e,s,o),e})()}applyCustomColumns(e,t){var r=arguments,i=this;return Rt(function*(){var o=r.length>2&&r[2]!==void 0?r[2]:C.APPLY_TABLE_CHANGE_TIMEOUT_MS,{dh:a}=i;return C.executeAndWaitForEvent(s=>s?.applyCustomColumns(t),e,a.Table.EVENT_CUSTOMCOLUMNSCHANGED,o)})()}applyFilter(e,t){var r=arguments,i=this;return Rt(function*(){var o=r.length>2&&r[2]!==void 0?r[2]:C.APPLY_TABLE_CHANGE_TIMEOUT_MS,{dh:a}=i;return C.executeAndWaitForEvent(s=>s?.applyFilter(t),e,a.Table.EVENT_FILTERCHANGED,o)})()}applySort(e,t){var r=arguments,i=this;return Rt(function*(){var o=r.length>2&&r[2]!==void 0?r[2]:C.APPLY_TABLE_CHANGE_TIMEOUT_MS,{dh:a}=i;return C.executeAndWaitForEvent(s=>s?.applySort(t),e,a.Table.EVENT_SORTCHANGED,o)})()}makeNeverFilter(e){var{dh:t}=this,r=null;C.isTextType(e.type)?r=t.FilterValue.ofString("a"):C.isBooleanType(e.type)?r=t.FilterValue.ofBoolean(!0):C.isDateType(e.type)?r=t.FilterValue.ofNumber(t.DateWrapper.ofJsDate(new Date)):r=t.FilterValue.ofNumber(0);var i=e.filter().eq(r),o=e.filter().notEq(r);return i.and(o)}makeFilterValue(e,t){var{dh:r}=this,i=C.getBaseType(e);return C.isTextType(i)?r.FilterValue.ofString(t):C.isLongType(i)?r.FilterValue.ofNumber(r.LongWrapper.ofString(C.removeCommas(t))):r.FilterValue.ofNumber(C.removeCommas(t))}makeFilterRawValue(e,t){var{dh:r}=this;return C.isCharType(e)?r.FilterValue.ofString(typeof t=="number"?String.fromCharCode(t):t):C.isTextType(e)?r.FilterValue.ofString(t):C.isBooleanType(e)?r.FilterValue.ofBoolean(t):r.FilterValue.ofNumber(t)}makeNullableEqFilter(e,t){return t==null?e.filter().isNull():e.filter().eq(this.makeFilterRawValue(e.type,t))}makeValue(e,t,r){var{dh:i}=this;if(t==="null")return null;if(C.isTextType(e))return t;if(C.isLongType(e))return i.LongWrapper.ofString(C.removeCommas(t));if(C.isBooleanType(e))return C.makeBooleanValue(t,!0);if(C.isDateType(e)){var[o]=we.parseDateRange(i,t,r);return o}return C.isNumberType(e)?C.makeNumberValue(t):(It.error("Unexpected column type",e),null)}makeSelectValueFilter(e,t,r){var{dh:i}=this;if(t.length===0)return r?null:this.makeNeverFilter(e);for(var o=[],a=!1,s=0;s<t.length;s+=1){var l=t[s];l==null?a=!0:C.isTextType(e.type)?o.push(i.FilterValue.ofString(typeof l=="number"?String.fromCharCode(l):l)):C.isBooleanType(e.type)?o.push(i.FilterValue.ofBoolean(!!l)):o.push(i.FilterValue.ofNumber(l))}return a?o.length>0?r?e.filter().isNull().not().and(e.filter().notIn(o)):e.filter().isNull().or(e.filter().in(o)):r?e.filter().isNull().not():e.filter().isNull():r?e.filter().notIn(o):e.filter().in(o)}}un(C,"dataType",{BOOLEAN:"boolean",CHAR:"char",DATETIME:"datetime",DECIMAL:"decimal",INT:"int",STRING:"string",UNKNOWN:"unknown"});un(C,"sortDirection",{ascending:"ASC",descending:"DESC",reverse:"REVERSE",none:null});un(C,"APPLY_TABLE_CHANGE_TIMEOUT_MS",3e4);un(C,"REVERSE_TYPE",Object.freeze({NONE:"none",PRE_SORT:"pre-sort",POST_SORT:"post-sort"}));un(C,"NUMBER_REGEX",/^-?\d+(\.\d+)?$/);un(C,"executeAndWaitForEvent",function(){var n=Rt(function*(e,t,r){var i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:C.APPLY_TABLE_CHANGE_TIMEOUT_MS;if(t==null)return null;var o=C.makeCancelableTableEventPromise(t,r,i);return e(t),yield o,t});return function(e,t,r){return n.apply(this,arguments)}}());function cn(n,e,t){return(e=Qm(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Qm(n){var e=Jm(n,"string");return typeof e=="symbol"?e:e+""}function Jm(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 js{static makeColumnFormatMap(e){return e==null?new Map:e.reduce((t,r)=>{var i=C.getNormalizedType(r.columnType);if(i===null)return t;t.has(i)||t.set(i,new Map);var o=t.get(i);return o?.set(r.columnName,r.format),t},new Map)}static makeColumnFormattingRule(e,t,r){return{columnType:e,columnName:t,format:r}}constructor(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],r=arguments.length>2?arguments[2]:void 0,i=arguments.length>3?arguments[3]:void 0,o=arguments.length>4?arguments[4]:void 0,a=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!1,s=arguments.length>6&&arguments[6]!==void 0?arguments[6]:!0,l=arguments.length>7&&arguments[7]!==void 0?arguments[7]:!0;cn(this,"defaultColumnFormatter",void 0),cn(this,"typeFormatterMap",void 0),cn(this,"columnFormatMap",void 0),cn(this,"truncateNumbersWithPound",void 0),cn(this,"showEmptyStrings",void 0),cn(this,"showNullStrings",void 0),this.defaultColumnFormatter=new jm,this.typeFormatterMap=new Map([[C.dataType.BOOLEAN,new Om],[C.dataType.CHAR,new Im],[C.dataType.DATETIME,new vt(e,r)],[C.dataType.DECIMAL,new fe(e,i)],[C.dataType.INT,new dt(e,o)],[C.dataType.STRING,new Rm]]),this.columnFormatMap=js.makeColumnFormatMap(t),this.truncateNumbersWithPound=a,this.showEmptyStrings=s,this.showNullStrings=l}getColumnFormatMapForType(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,r=C.getNormalizedType(e);if(r!==null)return t&&!this.columnFormatMap.has(r)&&this.columnFormatMap.set(r,new Map),this.columnFormatMap.get(r)}getColumnFormat(e,t){var r,i=this.getColumnFormatMapForType(e);return(r=i?.get(t))!==null&&r!==void 0?r:null}getColumnTypeFormatter(e){var t=C.getNormalizedType(e),r=this.defaultColumnFormatter;if(t){var i;r=(i=this.typeFormatterMap.get(t))!==null&&i!==void 0?i:r}return r}getFormattedString(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"",i=arguments.length>3?arguments[3]:void 0;if(e==null)return"";var o=this.getColumnTypeFormatter(t),a=i||this.getColumnFormat(t,r);return o.format(e,a??void 0)}get timeZone(){var e=this.typeFormatterMap.get(C.dataType.DATETIME);return ud(e,vt),e.dhTimeZone.id}}const ev="var(--dh-color-chart-colorway)",tv="var(--dh-color-chart-grid)",nv="var(--dh-color-chart-axis-line)",rv="var(--dh-color-chart-axis-line-zero)",Ro={"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:ev,gridcolor:tv,linecolor:nv,zerolinecolor:rv,"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 $o=W.module("ChartTheme");function iv(){var n,e=Ha(Ro);return e.colorway=hd((n=e.colorway)!==null&&n!==void 0?n:"").map(t=>{var[r,i]=t;return cd.normalizeCssColor(e.colorway.substring(r,i+1))}).join(" "),$o.debug2("Chart theme:",Ro),$o.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 Ho(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 ov(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Ho(Object(t),!0).forEach(function(r){av(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Ho(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function av(n,e,t){return(e=sv(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function sv(n){var e=lv(n,"string");return typeof e=="symbol"?e:e+""}function lv(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 dv=m.lazy(()=>za(()=>import("./Plot-CKt-TpBm.js"),__vite__mapDeps([0,1,2,3,4,5]),import.meta.url));function uv(n){return u.jsx(m.Suspense,{fallback:u.jsx(sn,{}),children:u.jsx(dv,ov({},n))})}var As=m.createContext(null);function jb(n){var{children:e}=n,{activeThemes:t}=ns(),r=m.useMemo(iv,[t]);return u.jsx(As.Provider,{value:r,children:e})}function hv(){return Xn(As,"No ChartThemeContext value found.")}function Bo(n,e,t,r,i,o,a){try{var s=n[o](a),l=s.value}catch(d){return void t(d)}s.done?e(l):Promise.resolve(l).then(r,i)}function cv(n){return function(){var e=this,t=arguments;return new Promise(function(r,i){var o=n.apply(e,t);function a(l){Bo(o,r,i,a,s,"next",l)}function s(l){Bo(o,r,i,a,s,"throw",l)}a(void 0)})}}var mv=W.module("HeapUsage");function vv(n){var e,{connection:t,defaultUpdateInterval:r,hoverUpdateInterval:i,bgMonitoring:o=!0,monitorDuration:a}=n,s=hv(),[l,d]=m.useState({freeMemory:0,maximumHeapSize:999,totalHeapSize:0}),[h,c]=m.useState(!1),v=m.useRef({timestamps:[],usages:[]}),p=Ja(),g=m.useCallback(cv(function*(){try{var j=yield t.getWorkerHeapInfo();if(!p.current)return;if(d(j),o||h){for(var V=(j.totalHeapSize-j.freeMemory)/j.maximumHeapSize,z=Date.now(),{timestamps:ve,usages:Ve}=v.current;ve.length!==0&&z-ve[0]>a*1.5;)ve.shift(),Ve.shift();ve.push(z),Ve.push(V)}else v.current={timestamps:[],usages:[]}}catch(ke){mv.warn("Unable to get heap usage",ke)}}),[t,p,o,h,a]);tu(g,h?i:r);var f=(j,V)=>Math.round(j*10**V)/10**V,y=2,T=1024**3,{freeMemory:O,totalHeapSize:P,maximumHeapSize:F}=l,U=f(O/T,y),te=f(P/T,y),N=f(F/T,y),B=te-U,H=function(V,z){var ve=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return u.jsxs("div",{className:X("heap-usage-info-row",{"heading-bottom-border":ve}),children:[u.jsx("div",{className:"font-weight-bold",children:V}),u.jsx("div",{children:z})]})},{timestamps:J,usages:oe}=v.current,L=(e=J[J.length-1])!==null&&e!==void 0?e:0,q=P/F,K=(P-O)/F;return u.jsxs("div",{className:"max-memory",children:[u.jsx("div",{className:"total-memory",style:{width:"calc(".concat(q*100,"% - ").concat(q*2,"px")}}),u.jsx("div",{className:X("used-memory",{"heap-overflow":(P-O)/F>.95}),style:{width:"calc(".concat(K*100,"% - ").concat(K*2,"px")}}),u.jsxs("div",{className:"memory-text",children:[N.toFixed(1)," GB"]}),u.jsx(ue,{onEntered:()=>c(!0),onExited:()=>c(!1),interactive:!0,children:u.jsxs("div",{className:"heap-tooltip",children:[H("In use:","".concat(B.toFixed(y)," of ").concat(N.toFixed(y)," GB"),!0),H("Free:","".concat(U.toFixed(y)," GB")),H("Total:","".concat(te.toFixed(y)," GB")),H("Max:","".concat(N.toFixed(y)," GB")),u.jsx("div",{className:"heap-plot",children:u.jsx(uv,{data:[{x:[...J],y:[...oe],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(a/6),gridcolor:s.linecolor,range:[L-a,L],linecolor:s.linecolor,linewidth:2,mirror:!0},yaxis:{dtick:.2,gridcolor:s.linecolor,range:[0,1],linecolor:s.linecolor,linewidth:2,mirror:!0}}})}),u.jsxs("div",{className:"heap-utilisation-text",children:["% utilization over ",Math.round(a/1e3/60)," min."]})]})})]})}var Ls=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 Fs(n){return n.componentName!==void 0}function pv(n){return n.component!==void 0}var Rs=Object.freeze({type:"default",isClosable:!0,isFocusOnShow:!0,reorderEnabled:!0,title:""});const fv=Object.freeze(Object.defineProperty({__proto__:null,defaultConfig:Ls,isGLComponentConfig:Fs,isReactComponentConfig:pv,itemDefaultConfig:Rs},Symbol.toStringTag,{value:"Module"}));function gr(n,e,t){return(e=gv(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function gv(n){var e=bv(n,"string");return typeof e=="symbol"?e:e+""}function bv(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 Ue{constructor(){gr(this,"_mSubscriptions",void 0),gr(this,"off",this.unbind),gr(this,"trigger",this.emit),this._mSubscriptions={},this._mSubscriptions[Ue.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),o=1;o<r;o++)i[o-1]=arguments[o];if(t)for(var a=0;a<t.length;a++){var s=t[a].ctx||{};try{t[a].fn.apply(s,i)}catch(c){console.error("Error while emitting event:",c)}}i.unshift(e);for(var l=this._mSubscriptions[Ue.ALL_EVENT],d=0;d<l.length;d++){var h=l[d].ctx||{};try{l[d].fn.apply(h,i)}catch(c){console.error("Error while emitting event to allEventSubs:",c)}}}unbind(e,t,r){if(!this._mSubscriptions[e])throw new Error("No subscriptions to unsubscribe for event "+e);for(var i=!1,o=0;o<this._mSubscriptions[e].length;o++)(!t||this._mSubscriptions[e][o].fn===t)&&(!r||r===this._mSubscriptions[e][o].ctx)&&(this._mSubscriptions[e].splice(o,1),i=!0);if(i===!1)throw new Error("Nothing to unbind for "+e)}}gr(Ue,"ALL_EVENT","__all");function ht(n,e,t){return(e=yv(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function yv(n){var e=Cv(n,"string");return typeof e=="symbol"?e:e+""}function Cv(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 ii extends Ue{constructor(e,t,r){super(),ht(this,"width",void 0),ht(this,"height",void 0),ht(this,"title",void 0),ht(this,"parent",void 0),ht(this,"layoutManager",void 0),ht(this,"tab",void 0),ht(this,"_config",void 0),ht(this,"isHidden",!1),ht(this,"beforeCloseHandler",void 0),ht(this,"_element",k(['<div class="lm_item_container">','<div class="lm_content" tabindex="-1"></div>',"</div>"].join(""))),ht(this,"_contentElement",void 0),this.title=Fs(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,o,a=this.parent,s=null;a&&!a.isColumn&&!a.isRow;){var l;if(s=a,a=a.parent,(l=a)!==null&&l!==void 0&&l.isRoot)return!1}if(!a||!s)return!1;for(var d=a.isColumn?"height":"width",h=d==="height"?t:e,c=((r=this[d])!==null&&r!==void 0?r:0)*(1/(((i=s.config[d])!==null&&i!==void 0?i:0)/100)),v=h/c*100,p=(((o=s.config[d])!==null&&o!==void 0?o:0)-v)/(a.contentItems.length-1),g=0;g<a.contentItems.length;g++)if(a.contentItems[g]===s)a.contentItems[g].config[d]=v;else{var f;a.contentItems[g].config[d]=((f=a.contentItems[g].config[d])!==null&&f!==void 0?f:0)+p}return a.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(k.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,o=r.offsetHeight-r.clientHeight;this._contentElement.width(this.width-i).height(this.height-o),this.emit("resize")}}}const Sv=Object.freeze(Object.defineProperty({__proto__:null,Container:ii,ItemContainer:ii},Symbol.toStringTag,{value:"Module"}));function $s(n){var e=location.hash.match(new RegExp(n+"=([^&]*)"));return e?e[1]:null}function Hs(n){if(window.location.hash)return $s(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 Si(n){return window.requestAnimationFrame(n)}function wv(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 Er(){return kt()}function Ev(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 wi(n){return k.trim(n.replace(/(<([^>]+)>)/gi,""))}function Qe(n,e,t){return(e=Pv(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Pv(n){var e=Tv(n,"string");return typeof e=="symbol"?e:e+""}function Tv(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 Qn extends Ue{constructor(e){var t,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;super(),Qe(this,"_eElement",void 0),Qe(this,"_oDocument",void 0),Qe(this,"_eBody",void 0),Qe(this,"_destroyAfterMouseUp",void 0),Qe(this,"_nDelay",400),Qe(this,"_timeout",void 0),Qe(this,"timeout",void 0),Qe(this,"_nDistance",10),Qe(this,"_nX",0),Qe(this,"_nY",0),Qe(this,"_nOriginalX",0),Qe(this,"_nOriginalY",0),Qe(this,"_bDragging",!1),this._eElement=e,this._oDocument=k(document),this._eBody=k(document.body),this._destroyAfterMouseUp=r,this.onMouseMove=this.onMouseMove.bind(this),this.onMouseUp=this.onMouseUp.bind(this),this.onMouseDown=this.onMouseDown.bind(this),this._startDrag=this._startDrag.bind(this),(t=this._eElement)===null||t===void 0||t.on("mousedown",this.onMouseDown)}destroy(){var e,t;(e=this._eElement)===null||e===void 0||e.unbind("mousedown",this.onMouseDown),(t=this._oDocument)===null||t===void 0||t.unbind("mouseup",this.onMouseUp),this._eElement=void 0,this._oDocument=void 0,this._eBody=void 0,clearTimeout(this._timeout),this._timeout=void 0}onMouseDown(e){if(e.preventDefault(),e.button===0){var t,r,i,o,a=this._getCoordinates(e);this._nOriginalX=(t=a.x)!==null&&t!==void 0?t:0,this._nOriginalY=(r=a.y)!==null&&r!==void 0?r:0,(i=this._oDocument)===null||i===void 0||i.on("mousemove",this.onMouseMove),(o=this._oDocument)===null||o===void 0||o.on("mouseup",this.onMouseUp),this._timeout=window.setTimeout(this._startDrag,this._nDelay)}}onMouseMove(e){if(this._timeout!=null){var t,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,o,a;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||(o=i.find("iframe"))===null||o===void 0||o.css("pointer-events",""),this._bDragging===!0&&(this._bDragging=!1,this.emit("dragStop",e,this._nOriginalX+this._nX)),(a=this._eBody)===null||a===void 0||a.removeClass("lm_dragging"),!(this._eElement instanceof Window)){var s;(s=this._eElement)===null||s===void 0||s.removeClass("lm_dragging")}this._destroyAfterMouseUp&&this.destroy()}}_startDrag(){var e,t,r,i;window.clearTimeout(this._timeout),this._bDragging=!0,(e=this._eBody)===null||e===void 0||e.addClass("lm_dragging"),(t=this._eElement)===null||t===void 0||t.addClass("lm_dragging"),(r=this._oDocument)===null||r===void 0||(i=r.find("iframe"))===null||i===void 0||i.css("pointer-events","none"),this.emit("dragStart",this._nOriginalX,this._nOriginalY)}_getCoordinates(e){var t,r;return{x:(t=e.pageX)!==null&&t!==void 0?t:0,y:(r=e.pageY)!==null&&r!==void 0?r:0}}}function mn(n,e,t){return(e=_v(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function _v(n){var e=Ov(n,"string");return typeof e=="symbol"?e:e+""}function Ov(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 Bs{constructor(e,t){mn(this,"_container",void 0),mn(this,"_reactComponent",null),mn(this,"_portalComponent",null),mn(this,"_originalComponentWillUpdate",null),mn(this,"_initialState",void 0),mn(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=Dr.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=k.extend(e,this._container._config.props);return $.createElement(this._reactClass,t)}}var Pr=["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"],Iv=[!0,!1,"row","column","stack","component","close","maximise","minimise","open in new window"];function Ei(n){if(Pr.length>36)throw new Error("Too many keys in config minifier map");var e={};return Pi(n,e,"_min"),e}function oi(n){if(Pr.length>36)throw new Error("Too many keys in config minifier map");var e={};return Pi(n,e,"_max"),e}function Pi(n,e,t){var r=t==="_min"?Dv:xv;for(var i in n)if(n.hasOwnProperty(i)){var o=Array.isArray(n)?n[Number.parseInt(i,10)]:n[i];if(typeof o=="object"&&o!=null){var a=o instanceof Array?[]:{};if(Array.isArray(e))e[Number.parseInt(i,10)]=a;else{var s=r(i,Pr);e[s]=a}Pi(o,a,t)}else{var l=r(o,Iv);if(Array.isArray(e))e[Number.parseInt(i,10)]=l;else{var d=r(i,Pr);e[d]=l}}}}function Dv(n,e){if(typeof n=="string"&&n.length===1)return"___"+n;var t=e.indexOf(n);return t===-1?n:t.toString(36)}function xv(n,e){return typeof n=="string"&&n.length===1?e[parseInt(n,36)]:typeof n=="string"&&n.substr(0,3)==="___"?n[3]:n}function Gr(n,e,t){return(e=Mv(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Mv(n){var e=kv(n,"string");return typeof e=="symbol"?e:e+""}function kv(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var 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 ai{constructor(e,t){Gr(this,"name",void 0),Gr(this,"origin",void 0),Gr(this,"isPropagationStopped",void 0),this.name=e,this.origin=t,this.isPropagationStopped=!1}stopPropagation(){this.isPropagationStopped=!0}}function lr(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=jv(n,"string");return typeof e=="symbol"?e:e+""}function jv(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 Ws=class extends Ue{constructor(e){super(),lr(this,"_layoutManager",void 0),lr(this,"_dontPropagateToParent",void 0),lr(this,"_childEventSource",void 0),lr(this,"_boundOnEventFromChild",void 0),this._layoutManager=e,this._dontPropagateToParent=null,this._childEventSource=null,this.on(Ue.ALL_EVENT,this._onEventFromThis.bind(this)),this._boundOnEventFromChild=this._onEventFromChild.bind(this),k(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(){k(window).off("gl_child_event",this._boundOnEventFromChild)}};function Us(n,e,t){return n.on(e,t),()=>{n.off(e,t)}}function Vs(n){return(e,t)=>Us(e,n,t)}function Ks(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 zs(n){return(e,t)=>{var r=m.useRef(null),i=m.useRef(()=>!1);if(r.current!=e||i.current!=t){var o;(o=r.current)===null||o===void 0||o.off(n,i.current),e?.on(n,t)}r.current=e,i.current=t,m.useEffect(()=>()=>{var a;return(a=r.current)===null||a===void 0?void 0:a.off(n,i.current)},[])}}function Av(n){return{listen:Vs(n),emit:Ks(n),useListener:zs(n)}}const Lv=Object.freeze(Object.defineProperty({__proto__:null,BubblingEvent:ai,DragListener:Qn,EventEmitter:Ue,EventHub:Ws,ReactComponentHandler:Bs,animFrame:Si,filterXss:Ev,getHashValue:$s,getQueryStringParam:Hs,getUniqueId:Er,listenForEvent:Us,makeEmitFunction:Ks,makeEventFunctions:Av,makeListenFunction:Vs,makeUseListenerFunction:zs,minifyConfig:Ei,removeFromArray:wv,stripTags:wi,unminifyConfig:oi},Symbol.toStringTag,{value:"Module"}));function Lt(n,e,t){return(e=Fv(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Fv(n){var e=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)}class Gs extends Ue{constructor(e,t,r,i,o){super(),Lt(this,"isInitialised",!1),Lt(this,"_config",void 0),Lt(this,"_dimensions",void 0),Lt(this,"_parentId",void 0),Lt(this,"_indexInParent",void 0),Lt(this,"_layoutManager",void 0),Lt(this,"_popoutWindow",null),Lt(this,"_id",null),this._config=e,this._dimensions=t,this._parentId=r,this._indexInParent=i,this._layoutManager=o,this._createWindow()}toConfig(){var e,t,r,i,o,a,s,l,d,h,c;if(this.isInitialised===!1)throw new Error("Can't create config, layout not yet initialised");return{dimensions:{width:(e=this.getGlInstance())===null||e===void 0?void 0:e.width,height:(t=this.getGlInstance())===null||t===void 0?void 0:t.height,left:(r=(i=(o=this._popoutWindow)===null||o===void 0?void 0:o.screenX)!==null&&i!==void 0?i:(a=this._popoutWindow)===null||a===void 0?void 0:a.screenLeft)!==null&&r!==void 0?r:0,top:(s=(l=(d=this._popoutWindow)===null||d===void 0?void 0:d.screenY)!==null&&l!==void 0?l:(h=this._popoutWindow)===null||h===void 0?void 0:h.screenTop)!==null&&s!==void 0?s:0},content:(c=this.getGlInstance())===null||c===void 0?void 0:c.toConfig().content,parentId:this._parentId,indexInParent:this._indexInParent}}getGlInstance(){var e;return(e=this._popoutWindow)===null||e===void 0?void 0:e.__glInstance}getWindow(){return this._popoutWindow}close(){if(this.getGlInstance()){var e;(e=this.getGlInstance())===null||e===void 0||e._$closeWindow()}else try{var t;(t=this.getWindow())===null||t===void 0||t.close()}catch{}}popIn(){var e;this._indexInParent;var t=null,r=null;if(this._parentId){var i;if(t=k.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 o;((o=this._layoutManager.root.contentItems.length)!==null&&o!==void 0?o: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;k(this._popoutWindow).on("load",this._positionWindow.bind(this)).on("unload beforeunload",this._onClose.bind(this));var o=window.setInterval(()=>{var a;(a=this._popoutWindow)!==null&&a!==void 0&&a.__glInstance&&this._popoutWindow.__glInstance.isInitialised&&(this._onInitialised(),window.clearInterval(o))},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-"+Er();e=Ei(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 _e(n,e,t){return(e=$v(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function $v(n){var e=Hv(n,"string");return typeof e=="symbol"?e:e+""}function Hv(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 hn extends Ue{constructor(e,t,r,i,o,a){var s,l,d,h,c,v,p,g;if(super(),_e(this,"_dragListener",void 0),_e(this,"_layoutManager",void 0),_e(this,"_contentItem",void 0),_e(this,"_originalParent",void 0),_e(this,"_area",null),_e(this,"_lastValidArea",null),_e(this,"_minX",void 0),_e(this,"_maxX",void 0),_e(this,"_minY",void 0),_e(this,"_maxY",void 0),_e(this,"_width",void 0),_e(this,"_height",void 0),_e(this,"_sided",void 0),_e(this,"element",void 0),_e(this,"childElementContainer",void 0),_e(this,"_proxyTab",void 0),this._dragListener=r,this._layoutManager=i,this._contentItem=o,this._originalParent=a,this._dragListener.on("drag",this._onDrag,this),this._dragListener.on("dragStop",this._onDrop,this),this._contentItem.tab&&this._contentItem.tab.element){var f,y;this._layoutManager.tabDropPlaceholder.width((f=this._contentItem.tab.element.outerWidth(!0))!==null&&f!==void 0?f:0),this._layoutManager.tabDropPlaceholder.height((y=this._contentItem.tab.element.outerHeight(!0))!==null&&y!==void 0?y:0)}if(this.element=k(hn._template),a&&a._side&&(this._sided=a._sided,this.element.addClass("lm_"+a._side),["right","bottom"].indexOf(a._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",wi((s=this._contentItem.config.title)!==null&&s!==void 0?s:"")),this.element.find(".lm_title").text((l=this._contentItem.config.title)!==null&&l!==void 0?l:""),this.childElementContainer=this.element.find(".lm_content"),this.childElementContainer.append(o.element),this._updateTree(),this._layoutManager._$calculateItemAreas(),k(document.body).append(this.element),this._setDimensions(),!this._contentItem.tab&&this._proxyTab.length){var T,O;this._layoutManager.tabDropPlaceholder.width((T=this._proxyTab.outerWidth(!0))!==null&&T!==void 0?T:0),this._layoutManager.tabDropPlaceholder.height((O=this._proxyTab.outerHeight(!0))!==null&&O!==void 0?O:0)}var P=this._layoutManager.container.offset();this._minX=(d=P?.left)!==null&&d!==void 0?d:0,this._minY=(h=P?.top)!==null&&h!==void 0?h:0,this._maxX=((c=this._layoutManager.container.width())!==null&&c!==void 0?c:0)+this._minX,this._maxY=((v=this._layoutManager.container.height())!==null&&v!==void 0?v:0)+this._minY,this._width=(p=this.element.width())!==null&&p!==void 0?p:0,this._height=(g=this.element.height())!==null&&g!==void 0?g:0,this._setDropPosition(e,t),this._layoutManager.emit("itemPickedUp",this._contentItem)}_onDrag(e,t,r){var i,o,a=(i=r.pageX)!==null&&i!==void 0?i:0,s=(o=r.pageY)!==null&&o!==void 0?o:0,l=a>this._minX&&a<this._maxX&&s>this._minY&&s<this._maxY;!l&&this._layoutManager.config.settings.constrainDragToContainer===!0||this._setDropPosition(a,s)}_setDropPosition(e,t){this.element.css({left:e,top:t}),this._area=this._layoutManager._$getArea(e,t),this._area!==null&&(this._lastValidArea=this._area,this._area.contentItem._$highlightDropZone(e,t,this._area))}_onDrop(){var e;(e=this._layoutManager.dropTargetIndicator)===null||e===void 0||e.hide(),this._area!==null?this._area.contentItem._$onDrop(this._contentItem,this._area):this._lastValidArea!==null?this._lastValidArea.contentItem._$onDrop(this._contentItem,this._lastValidArea):this._originalParent?this._originalParent.addChild(this._contentItem):this._contentItem._$destroy(),this._dragListener.off("drag",this._onDrag,this),this._dragListener.off("dragStop",this._onDrop,this),this.element.remove(),this._layoutManager.emit("itemDropped",this._contentItem)}_updateTree(){this._contentItem.parent&&this._contentItem.parent.removeChild(this._contentItem,!0),this._contentItem._$setParent(null)}_setDimensions(){var e=this._layoutManager.config.dimensions,t=e.dragProxyWidth,r=e.dragProxyHeight;this.element.width(t),this.element.height(r),t-=this._sided?e.headerHeight:0,r-=this._sided?0:e.headerHeight,this.childElementContainer.width(t),this.childElementContainer.height(r),this._contentItem.element.width(t),this._contentItem.element.height(r),this._contentItem.callDownwards("_$show"),this._contentItem.callDownwards("setSize")}}_e(hn,"_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 dr(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=Wv(n,"string");return typeof e=="symbol"?e:e+""}function Wv(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var 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 qs{constructor(e,t,r){dr(this,"_element",void 0),dr(this,"_itemConfig",void 0),dr(this,"_layoutManager",void 0),dr(this,"_dragListener",void 0),this._element=e,this._itemConfig=t,this._layoutManager=r,this._dragListener=this._createDragListener()}_createDragListener(){return this._dragListener=new Qn(this._element,!0),this._dragListener.on("dragStart",this._onDragStart,this),this._dragListener.on("dragStop",this._createDragListener,this),this._dragListener}_onDragStart(e,t){var r=this._itemConfig;typeof r=="function"&&(r=r());var i=this._layoutManager._$normalizeContentItem(k.extend(!0,{},r));new hn(e,t,this._dragListener,this._layoutManager,i,null)}}function ur(n,e,t){return(e=Uv(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Uv(n){var e=Vv(n,"string");return typeof e=="symbol"?e:e+""}function Vv(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 Zs{constructor(e,t,r){ur(this,"_element",k(window)),ur(this,"_itemConfig",void 0),ur(this,"_layoutManager",void 0),ur(this,"_dragListener",void 0),this._itemConfig=e,this._layoutManager=t,this._createDragListener(r)}_createDragListener(e){this._dragListener&&this._dragListener.destroy(),this._element&&(this._dragListener=new Qn(this._element,!0),this._dragListener.on("dragStart",this._onDragStart,this),this._dragListener.on("dragStop",this._destroy,this),this._dragListener.onMouseDown(e),this._dragListener._startDrag())}_destroy(){this._dragListener=void 0,this._element=void 0,this._itemConfig=void 0,this._layoutManager=void 0}_onDragStart(e,t){if(!(!this._dragListener||!this._layoutManager)){var r=this._itemConfig;typeof r=="function"&&(r=r());var i=this._layoutManager._$normalizeContentItem(k.extend(!0,{},r));new hn(e,t,this._dragListener,this._layoutManager,i,null)}}}function Xs(n,e,t){return(e=Kv(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Kv(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 Jn{constructor(){Xs(this,"element",k(Jn._template)),k(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()}}Xs(Jn,"_template",'<div class="lm_dropTargetIndicator"><div class="lm_inner"></div></div>');function qr(n,e,t){return(e=Gv(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Gv(n){var e=qv(n,"string");return typeof e=="symbol"?e:e+""}function qv(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{constructor(e,t,r,i){qr(this,"element",void 0),qr(this,"_header",void 0),qr(this,"_action",void 0),this._header=e,this.element=k('<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 Zv(n,e,t){return(e=Xv(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Xv(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)}class nn extends Error{constructor(e,t){super(),Zv(this,"node",void 0),this.name="Configuration Error",this.message=e,this.node=t}}const Qv=Object.freeze(Object.defineProperty({__proto__:null,ConfigurationError:nn},Symbol.toStringTag,{value:"Module"}));function Pe(n,e,t){return(e=Jv(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Jv(n){var e=ep(n,"string");return typeof e=="symbol"?e:e+""}function ep(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 rn(n){return n.isStack}function nt(n){return n.isComponent}function Ys(n){return n.isRoot}class De extends Ue{constructor(e,t,r,i){super(),Pe(this,"config",void 0),Pe(this,"type",void 0),Pe(this,"contentItems",void 0),Pe(this,"parent",void 0),Pe(this,"layoutManager",void 0),Pe(this,"element",void 0),Pe(this,"childElementContainer",void 0),Pe(this,"componentName",void 0),Pe(this,"isInitialised",!1),Pe(this,"isMaximised",!1),Pe(this,"isRoot",!1),Pe(this,"isRow",!1),Pe(this,"isColumn",!1),Pe(this,"isStack",!1),Pe(this,"isComponent",!1),Pe(this,"tab",void 0),Pe(this,"_pendingEventPropagations",void 0),Pe(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(Ue.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 o=0;o<this.contentItems.length;o++)this.contentItems[o].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 o;(o=this.parent)===null||o===void 0||o.removeChild(this)}}addChild(e,t){e=this.layoutManager._$normalizeContentItem(e,this),t===void 0&&(t=this.contentItems.length),this.contentItems.splice(t,0,e),this.config.content===void 0&&(this.config.content=[]),this.config.content.splice(t,0,e.config),e.parent=this,e.parent.isInitialised===!0&&e.isInitialised===!1&&e._$init()}replaceChild(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;t=this.layoutManager._$normalizeContentItem(t);var i=this.contentItems.indexOf(e),o=e.element[0].parentNode;if(i===-1)throw new Error("Can't replace child. oldChild is not child of this");o?.replaceChild(t.element[0],e.element[0]),r===!0&&(e.parent=null,e._$destroy()),this.contentItems[i]=t,t.parent=this,rn(this)&&(this.header.tabs[i].contentItem=t),t.parent.isInitialised===!0&&t.isInitialised===!1&&t._$init(),this.callDownwards("setSize")}remove(){var e;(e=this.parent)===null||e===void 0||e.removeChild(this)}popout(){var e=this.layoutManager.createPopout(this);return this.emitBubblingEvent("stateChanged"),e}toggleMaximise(e){e&&e.preventDefault(),this.isMaximised===!0?this.layoutManager._$minimiseItem(this):this.layoutManager._$maximiseItem(this),this.isMaximised=!this.isMaximised,this.emitBubblingEvent("stateChanged")}select(){this.layoutManager.selectedItem!==this&&(this.layoutManager.selectItem(this,!0),this.element.addClass("lm_selected"))}deselect(){this.layoutManager.selectedItem===this&&(this.layoutManager.selectedItem=null,this.element.removeClass("lm_selected"))}setTitle(e){this.config.title=e,this.emit("titleChanged",e),this.emitBubblingEvent("stateChanged")}hasId(e){if(this.config.id){if(typeof this.config.id=="string")return this.config.id===e;if(this.config.id instanceof Array)return this.config.id.indexOf(e)!==-1}else return!1}addId(e){this.hasId(e)||(this.config.id?typeof this.config.id=="string"?this.config.id=[this.config.id,e]:this.config.id instanceof Array&&this.config.id.push(e):this.config.id=e)}removeId(e){if(!this.hasId(e))throw new Error("Id not found");if(typeof this.config.id=="string")delete this.config.id;else if(this.config.id instanceof Array){var t=this.config.id.indexOf(e);this.config.id.splice(t,1)}}getItemsByFilter(e){var t=[],r=function i(o){for(var a=0;a<o.contentItems.length;a++)e(o.contentItems[a])===!0&&t.push(o.contentItems[a]),i(o.contentItems[a])};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&&nt(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 o=(t=e.offset())!==null&&t!==void 0?t:{left:0,top:0},a=(r=e.width())!==null&&r!==void 0?r:0,s=(i=e.height())!==null&&i!==void 0?i:0;return{x1:o.left,y1:o.top,x2:o.left+a,y2:o.top+s,surface:a*s,contentItem:this,side:""}}_$init(){this.setSize();for(var e=0;e<this.contentItems.length;e++){var t;(t=this.childElementContainer)===null||t===void 0||t.append(this.contentItems[e].element)}this.isInitialised=!0,this.emitBubblingEvent("itemCreated"),this.emitBubblingEvent(this.type+"Created")}emitBubblingEvent(e){var t=new ai(e,this);this.emit(e,t)}_createContentItems(e){var t;if(!(e.content instanceof Array))throw new nn("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(Rs)){var i=t;e[i]===void 0&&(e[i]=r)}return e}_propagateEvent(e,t){t instanceof ai&&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,Si(this._propagateEventToLayoutManager.bind(this,e,t)))}_propagateEventToLayoutManager(e,t){this._pendingEventPropagations[e]=!1,this.layoutManager.emit(e,t)}}function jn(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 Qs extends De{constructor(e,t,r){var i;Object.entries((i=e.config.settings.defaultComponentConfig)!==null&&i!==void 0?i:{}).forEach(s=>{var[l,d]=s;t[l]===void 0&&(t[l]=d)}),super(e,t,r,k()),jn(this,"config",void 0),jn(this,"componentName",void 0),jn(this,"container",void 0),jn(this,"parent",void 0),jn(this,"instance",void 0),this.config=t,this.parent=r;var o=e.getComponent(this.config.componentName)||e.getFallbackComponent(),a=k.extend(!0,{},this.config.componentState||{});if(o==null)throw new nn('Unknown component "'+this.config.componentName+'"');a.componentName=this.config.componentName,this.componentName=this.config.componentName,this.config.title===""&&(this.config.title=this.config.componentName),this.isComponent=!0,this.container=new ii(this.config,this,e),this.instance=new o(this.container,a),this.element=this.container._element}close(){this.parent.removeChild(this)}setSize(){this.element.is(":visible")&&this.container._$setSize(this.element.width(),this.element.height())}_$init(){De.prototype._$init.call(this),this.container.emit("open")}_$hide(){this.container.hide(),De.prototype._$hide.call(this)}_$show(){this.container.show(),this.container._config.isFocusOnShow&&this.container._contentElement[0].focus({preventScroll:!0}),De.prototype._$show.call(this)}_$destroy(){this.container.emit("destroy",this),De.prototype._$destroy.call(this)}_$getArea(){return null}}function at(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 Tr extends De{constructor(e,t,r,i){super(t,r,i,k('<div class="lm_item lm_'+(e?"column":"row")+'"></div>')),at(this,"isRow",void 0),at(this,"isColumn",void 0),at(this,"childElementContainer",void 0),at(this,"parent",void 0),at(this,"_splitter",[]),at(this,"_splitterSize",void 0),at(this,"_splitterGrabSize",void 0),at(this,"_isColumn",void 0),at(this,"_dimension",void 0),at(this,"_splitterPosition",null),at(this,"_splitterMinPosition",null),at(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,o,a,s;if(e=this.layoutManager._$normalizeContentItem(e,this),t===void 0&&(t=this.contentItems.length),this.contentItems.length>0?(s=this._createSplitter(Math.max(0,t-1)).element,t>0?(this.contentItems[t-1].element.after(s),s.after(e.element)):(this.contentItems[0].element.before(s),s.before(e.element))):this.childElementContainer.append(e.element),De.prototype.addChild.call(this,e,t),i=1/this.contentItems.length*100,r===!0){this.emitBubblingEvent("stateChanged");return}for(a=0;a<this.contentItems.length;a++)if(this.contentItems[a]===e)e.config[this._dimension]=i;else{var l;o=((l=this.contentItems[a].config[this._dimension])!==null&&l!==void 0?l:0)*(100-i)/100,this.contentItems[a].config[this._dimension]=o}this.callDownwards("setSize"),this.emitBubblingEvent("stateChanged")}removeChild(e,t){var r,i=(r=e.config[this._dimension])!==null&&r!==void 0?r:0,o=this.contentItems.indexOf(e),a=Math.max(o-1,0),s,l;if(o===-1)throw new Error("Can't remove child. ContentItem is not child of this Row or Column");for(this._splitter[a]&&(this._splitter[a]._$destroy(),this._splitter.splice(a,1)),s=0;s<this.contentItems.length;s++)if(this.contentItems[s]!==e){var d;this.contentItems[s].config[this._dimension]=((d=this.contentItems[s].config[this._dimension])!==null&&d!==void 0?d:0)+i/(this.contentItems.length-1)}De.prototype.removeChild.call(this,e,t),this.contentItems.length===1&&this.config.isClosable===!0?(l=this.contentItems[0],this.contentItems=[],this.parent.replaceChild(this,l,!0)):(this.callDownwards("setSize"),this.emitBubblingEvent("stateChanged"))}replaceChild(e,t){var r=e.config[this._dimension];super.replaceChild(e,t),t.config[this._dimension]=r,this.callDownwards("setSize"),this.emitBubblingEvent("stateChanged")}setSize(){this.contentItems.length>0&&(this._calculateRelativeSizes(),this._setAbsoluteSizes()),this.emitBubblingEvent("stateChanged"),this.emit("resize")}_$init(){if(this.isInitialised!==!0){var e;for(De.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,o=(t=this.element.height())!==null&&t!==void 0?t:0,a=0,s=[];this._isColumn?o-=r:i-=r;for(var l=0;l<this.contentItems.length;l++){var d,h,c=this._isColumn?Math.floor(o*(((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));a+=c,s.push(c)}var v=Math.floor((this._isColumn?o:i)-a);return{itemSizes:s,additionalPixel:v,totalWidth:i,totalHeight:o}}_calculateRelativeSizes(){for(var e=0,t=[],r=this._isColumn?"height":"width",i=0;i<this.contentItems.length;i++){var o=this.contentItems[i].config[r];o!=null?e+=o:t.push(this.contentItems[i])}if(Math.round(e)===100){this._respectMinItemWidth();return}if(Math.round(e)<100&&t.length>0){for(var a=0;a<t.length;a++)t[a].config[r]=(100-e)/t.length;this._respectMinItemWidth();return}if(Math.round(e)>100)for(var s=0;s<t.length;s++)t[s].config[r]=50,e+=50;for(var l=0;l<this.contentItems.length;l++){var d;this.contentItems[l].config[r]=((d=this.contentItems[l].config[r])!==null&&d!==void 0?d:0)/e*100}this._respectMinItemWidth()}_respectMinItemWidth(){var e,t=this.layoutManager.config.dimensions&&(e=this.layoutManager.config.dimensions.minItemWidth)!==null&&e!==void 0?e:0,r=[],i=0,o=0,a=0,s=[],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 c=d.itemSizes[h];c<t?(o+=t-c,l={width:t}):(i+=c-t,l={width:c},r.push(l)),s.push(l)}if(!(o===0||o>i)){var v=o/i;a=o;for(var p=0;p<r.length;p++){l=r[p];var g=Math.round((l.width-t)*v);a-=g,l.width-=g}a!==0&&(s[s.length-1].width-=a);for(var f=0;f<this.contentItems.length;f++)this.contentItems[f].config.width=s[f].width/d.totalWidth*100}}}_createSplitter(e){var t;return t=new Js(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 o,a;t=Math.max((o=e[i].minWidth)!==null&&o!==void 0?o:0,t),r=Math.max((a=e[i].minHeight)!==null&&a!==void 0?a:0,r)}return{horizontal:t,vertical:r}}_onSplitterDragStart(e){var t,r,i,o,a=this._getItemsForSplitter(e),s=this.layoutManager.config.dimensions[this._isColumn?"minItemHeight":"minItemWidth"],l=this._getMinimumDimensions((t=a.before.config.content)!==null&&t!==void 0?t:[]),d=this._isColumn?l.vertical:l.horizontal,h=this._getMinimumDimensions((r=a.after.config.content)!==null&&r!==void 0?r:[]),c=this._isColumn?h.vertical:h.horizontal;this._splitterPosition=0,this._splitterMinPosition=-1*(((i=a.before.element[this._dimension]())!==null&&i!==void 0?i:0)-(d||s)),this._splitterMaxPosition=((o=a.after.element[this._dimension]())!==null&&o!==void 0?o:0)-(c||s)}_onSplitterDrag(e,t,r){var i=this._isColumn?r:t;this._splitterMaxPosition==null||this._splitterMinPosition==null||i>this._splitterMinPosition&&i<this._splitterMaxPosition&&(this._splitterPosition=i,e.element.css(this._isColumn?"top":"left",i))}_onSplitterDragStop(e){var t,r,i,o,a,s=this._getItemsForSplitter(e),l=(t=s.before.element[this._dimension]())!==null&&t!==void 0?t:0,d=(r=s.after.element[this._dimension]())!==null&&r!==void 0?r:0,h=(((i=this._splitterPosition)!==null&&i!==void 0?i:0)+l)/(l+d),c=((o=s.before.config[this._dimension])!==null&&o!==void 0?o:0)+((a=s.after.config[this._dimension])!==null&&a!==void 0?a:0);s.before.config[this._dimension]=h*c,s.after.config[this._dimension]=(1-h)*c,e.element.css({top:0,left:0}),Si(this.callDownwards.bind(this,"setSize",void 0,void 0,void 0))}}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 Uo(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){si(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 si(n,e,t){return(e=op(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function op(n){var e=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)}class li extends De{constructor(e,t,r){super(e,Uo(Uo({},t),{},{type:"root"}),null,k('<div class="lm_goldenlayout lm_item lm_root"></div>')),si(this,"childElementContainer",void 0),si(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(nt(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,o=i==="left"||i==="right"?"row":"column",a=i==="left"||i==="right"?"width":"height",s=i==="left"||i==="top",l=this.contentItems[0];if(!(l instanceof Tr)||l.type!=o){var d=this.layoutManager.createContentItem({type:o},this);this.replaceChild(l,d),d.addChild(e,s?0:void 0,!0),d.addChild(l,s?void 0:0,!0),l.config[a]=50,e.config[a]=50,d.callDownwards("setSize")}else{var h,c=l.contentItems[s?0:l.contentItems.length-1];l.addChild(e,s?0:void 0,!0),c.config[a]=((h=c.config[a])!==null&&h!==void 0?h:0)*.5,e.config[a]=c.config[a],l.callDownwards("setSize")}}}}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 vn(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){qe(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 qe(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=lp(n,"string");return typeof e=="symbol"?e:e+""}function lp(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 di extends De{constructor(e,t,r){var i,o,a,s,l,d,h,c,v;super(e,t,r,k('<div class="lm_item lm_stack"></div>')),qe(this,"_activeContentItem",null),qe(this,"_header",void 0),qe(this,"childElementContainer",k('<div class="lm_items"></div>')),qe(this,"header",void 0),qe(this,"parent",void 0),qe(this,"isStack",!0),qe(this,"_dropZones",{}),qe(this,"_dropSegment",null),qe(this,"_contentAreaDimensions",null),qe(this,"_dropIndex",void 0),qe(this,"_side",void 0),qe(this,"_sided",!1),qe(this,"config",void 0),this.parent=r,this.config=t;var p=e.config;this._side=!1,this._header={show:((i=p.settings)===null||i===void 0?void 0:i.hasHeaders)&&t.hasHeaders!==!1,popout:(o=p.settings)!==null&&o!==void 0&&o.showPopoutIcon?(a=p.labels)===null||a===void 0?void 0:a.popout:void 0,maximise:(s=p.settings)!==null&&s!==void 0&&s.showMaximiseIcon?(l=p.labels)===null||l===void 0?void 0:l.maximise:void 0,close:(d=p.settings)!==null&&d!==void 0&&d.showCloseIcon?(h=p.labels)===null||h===void 0?void 0:h.close:void 0,minimise:(c=(v=p.labels)===null||v===void 0?void 0:v.minimise)!==null&&c!==void 0?c:void 0},p.header&&(this._header=vn(vn({},this._header),p.header)),t.header&&(this._header=vn(vn({},this._header),t.header)),t.content&&t.content[0]&&t.content[0].header&&(this._header=vn(vn({},this._header),t.content[0].header)),this.header=new Nt(e,this),this.element.append(this.header.element),this.element.append(this.childElementContainer),this._setupHeaderPosition(),this._$validateClosability()}setSize(){var e,t,r,i,o,a=this._header.show&&(e=(t=this.layoutManager.config.dimensions)===null||t===void 0?void 0:t.headerHeight)!==null&&e!==void 0?e:0,s=((r=this.element.width())!==null&&r!==void 0?r:0)-(this._sided?a:0),l=((i=this.element.height())!==null&&i!==void 0?i:0)-(this._sided?0:a);for(this.childElementContainer.width(s),this.childElementContainer.height(l),o=0;o<this.contentItems.length;o++)this.contentItems[o].element.width(s).height(l);this.emit("resize"),this.emitBubblingEvent("stateChanged")}_$init(){if(this.isInitialised!==!0){this.header._attachWheelListener(),super._$init();for(var e=0;e<this.contentItems.length;e++)this.header.createTab(this.contentItems[e]),this.contentItems[e]._$hide();if(this.contentItems.length>0){var t=this.contentItems[this.config.activeItemIndex||0];if(!t)throw new Error("Configured activeItemIndex out of bounds");this.setActiveContentItem(t)}}}setActiveContentItem(e){if(this.contentItems.indexOf(e)===-1)throw new Error("contentItem is not a child of this stack");this._activeContentItem!==null&&this._activeContentItem._$hide(),this._activeContentItem=e,this.header.setActiveContentItem(e),e._$show(),this.emit("activeContentItemChanged",e),this.layoutManager.emit("activeContentItemChanged",e),this.emitBubblingEvent("stateChanged")}getActiveContentItem(){return this.header.activeContentItem}addChild(e,t){e=this.layoutManager._$normalizeContentItem(e,this),super.addChild(e,t),this.childElementContainer.append(e.element),this.header.createTab(e,t),this.setActiveContentItem(e),this.callDownwards("setSize"),this._$validateClosability(),this.emitBubblingEvent("stateChanged")}removeChild(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,r=this.contentItems.indexOf(e);super.removeChild(e,t),this.header.removeTab(e),this.header.activeContentItem===e&&(this.contentItems.length>0?this.setActiveContentItem(this.contentItems[Math.max(r-1,0)]):this._activeContentItem=null),this._$validateClosability(),this.emitBubblingEvent("stateChanged")}_$validateClosability(){for(var e=this.header._isClosable(),t=0,r=this.contentItems.length;t<r;t++){var i;if(!e)break;e=(i=this.contentItems[t].config.isClosable)!==null&&i!==void 0?i:!1}this.header._$setClosable(e)}_$destroy(){De.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",o=t&&this.parent.isColumn||r&&this.parent.isRow,a=t?"column":"row",s=t?"height":"width";if(nt(e)){var l=this.layoutManager.createContentItem({type:"stack",header:e.config.header||{}},this);l._$init(),l.addChild(e),e=l}if(o){var d,h=this.parent.contentItems.indexOf(this);this.parent.addChild(e,i?h:h+1,!0),this.config[s]=((d=this.config[s])!==null&&d!==void 0?d:0)*.5,e.config[s]=this.config[s],this.parent.callDownwards("setSize")}else{var c=this.layoutManager.createContentItem({type:a},this);this.parent.replaceChild(this,c),c.addChild(e,i?0:void 0,!0),c.addChild(this,i?void 0:0,!0),this.config[s]=50,e.config[s]=50,c.callDownwards("setSize")}}_$highlightDropZone(e,t){if(this._contentAreaDimensions)for(var[r,i]of Object.entries(this._contentAreaDimensions)){var o=i.hoverArea;if(o.x1<e&&o.x2>e&&o.y1<t&&o.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,o,a,s,l,d,h,c,v,p,g,f,y,T,O=this.header.tabs.length;if(O===0){var P,F,U,te,N,B,H,J,oe=this.header.element.offset();(P=this.layoutManager.dropTargetIndicator)===null||P===void 0||P.highlightArea({x1:(F=oe?.left)!==null&&F!==void 0?F:0,x2:((U=oe?.left)!==null&&U!==void 0?U:0)+100,y1:(te=(N=this.header.element.offset())===null||N===void 0?void 0:N.top)!==null&&te!==void 0?te:0,y2:((B=(H=this.header.element.offset())===null||H===void 0?void 0:H.top)!==null&&B!==void 0?B:0)+((J=this.header.element.innerHeight())!==null&&J!==void 0?J:0)});return}var L=this.header.tabsContainer,q=(t=L.get(0))===null||t===void 0?void 0:t.getBoundingClientRect(),K=(r=this.layoutManager.tabDropPlaceholder.get(0))===null||r===void 0?void 0:r.getBoundingClientRect();if(!(!q||!K)){e<q.left?e=q.left+1:e>q.right&&(e=q.right-1);var j,V;if(!(K.left<e&&e<K.right)){for(var z=0;z<O;z++){var ve;if(j=this.header.tabs[z].element,V=(ve=j.get(0))===null||ve===void 0?void 0:ve.getBoundingClientRect(),V&&V.left<e&&e<V.right){this._dropIndex=z;break}}if(j&&V&&e<V.left+V.width*.5)j.before(this.layoutManager.tabDropPlaceholder);else if(j){var Ve;this._dropIndex=Math.min(((Ve=this._dropIndex)!==null&&Ve!==void 0?Ve:0)+1,O),j.after(this.layoutManager.tabDropPlaceholder)}}var ke=(i=(o=this.layoutManager.tabDropPlaceholder.offset())===null||o===void 0?void 0:o.left)!==null&&i!==void 0?i:0;ke=Math.max(ke,(a=(s=this.header.tabsContainer.offset())===null||s===void 0?void 0:s.left)!==null&&a!==void 0?a:0);var b=ke+((l=this.layoutManager.tabDropPlaceholder.width())!==null&&l!==void 0?l:0);b=Math.min(b,((d=(h=this.header.tabsContainer.offset())===null||h===void 0?void 0:h.left)!==null&&d!==void 0?d:0)+((c=this.header.tabsContainer.innerWidth())!==null&&c!==void 0?c:0)),(v=this.layoutManager.dropTargetIndicator)===null||v===void 0||v.highlightArea({x1:ke,x2:b,y1:(p=(g=this.header.element.offset())===null||g===void 0?void 0:g.top)!==null&&p!==void 0?p:0,y2:((f=(y=this.header.element.offset())===null||y===void 0?void 0:y.top)!==null&&f!==void 0?f:0)+((T=this.header.element.innerHeight())!==null&&T!==void 0?T:0)})}}_resetHeaderDropZone(){this.layoutManager.tabDropPlaceholder.remove()}_setupHeaderPosition(){var e=["right","left","bottom"].some(r=>r===this._header.show)?this._header.show:void 0;if(this.header.element.toggle(!!this._header.show),!!e&&(this._side=e,this._sided=["right","left"].indexOf(this._side.toString())>=0,this.element.removeClass("lm_left lm_right lm_bottom"),this._side&&this.element.addClass("lm_"+this._side),this.element.find(".lm_header").length&&this.childElementContainer)){var t=["right","bottom"].indexOf(this._side.toString())>=0?"before":"after";this.header.element[t](this.childElementContainer),this.callDownwards("setSize")}}_highlightBodyDropZone(e){var t,r,i=(t=this._contentAreaDimensions)===null||t===void 0||(r=t[e])===null||r===void 0?void 0:r.highlightArea;if(i){var o;(o=this.layoutManager.dropTargetIndicator)===null||o===void 0||o.highlightArea(i)}this._dropSegment=e}}const dp=Object.freeze(Object.defineProperty({__proto__:null,AbstractContentItem:De,Component:Qs,ContentItem:De,Root:li,RowOrColumn:Tr,Stack:di,isComponent:nt,isRoot:Ys,isStack:rn},Symbol.toStringTag,{value:"Module"}));function xt(n,e,t){return(e=up(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function up(n){var e=hp(n,"string");return typeof e=="symbol"?e:e+""}function hp(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 er{constructor(e,t){var r;xt(this,"header",void 0),xt(this,"contentItem",void 0),xt(this,"element",k(er._template)),xt(this,"titleElement",void 0),xt(this,"closeElement",void 0),xt(this,"isActive",!1),xt(this,"_layoutManager",void 0),xt(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 Qn(this.element),this._dragListener.on("dragStart",this._onDragStart,this),this.contentItem.on("destroy",this._dragListener.destroy,this._dragListener)),this._onTabClick=this._onTabClick.bind(this),this._onCloseClick=this._onCloseClick.bind(this),this._onTabContentFocusIn=this._onTabContentFocusIn.bind(this),this._onTabContentFocusOut=this._onTabContentFocusOut.bind(this),this.element.on("click",this._onTabClick),this.element.on("auxclick",this._onTabClick),this.contentItem.config.isClosable?(this.closeElement.on("click",this._onCloseClick),this.closeElement.on("mousedown",this._onCloseMousedown)):this.closeElement.remove(),this.contentItem.tab=this,this.contentItem.emit("tab",this),this.contentItem.layoutManager.emit("tabCreated",this),nt(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.closeElement.off("click",this._onCloseClick),nt(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 hn(e,t,this._dragListener,this._layoutManager,this.contentItem,this.header.parent)}_onTabContentFocusIn(){k(".lm_focusin",this._layoutManager.root.element).removeClass("lm_focusin"),this.element.addClass("lm_focusin")}_onTabContentFocusOut(){nt(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&&nt(this.contentItem)?this.header.parent.setActiveContentItem(this.contentItem):nt(this.contentItem)&&!this.contentItem.container._contentElement[0].contains(document.activeElement)&&this.contentItem.container._contentElement.focus(),nt(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(),nt(this.contentItem)?this.contentItem.container.close():this.header.parent.removeChild(this.contentItem)}_onCloseMousedown(e){e.stopPropagation()}}xt(er,"_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 le(n,e,t){return(e=cp(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function cp(n){var e=mp(n,"string");return typeof e=="symbol"?e:e+""}function mp(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var 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 Nt extends Ue{constructor(e,t){var r,i;super(),le(this,"layoutManager",void 0),le(this,"element",k(Nt._template)),le(this,"tabsContainer",void 0),le(this,"tabDropdownContainer",void 0),le(this,"tabDropdownSearch",void 0),le(this,"tabDropdownList",null),le(this,"controlsContainer",void 0),le(this,"parent",void 0),le(this,"tabs",[]),le(this,"activeContentItem",null),le(this,"closeButton",null),le(this,"tabDropdownButton",null),le(this,"tabNextButton",k(Nt._nextButtonTemplate)),le(this,"tabPreviousButton",k(Nt._previousButtonTemplate)),le(this,"holdTimer",null),le(this,"rAF",null),le(this,"CLICK_TIMEOUT",500),le(this,"START_SPEED",.01),le(this,"ACCELERATION",5e-4),le(this,"PADDING",10),le(this,"SCROLL_LEFT","left"),le(this,"SCROLL_RIGHT","right"),le(this,"isDraggingTab",!1),le(this,"isOverflowing",!1),le(this,"isDropdownShown",!1),le(this,"dropdownKeyIndex",0),le(this,"_lastVisibleTabIndex",-1),le(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 er(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,o,a=0;a<this.tabs.length;a++)o=this.tabs[a].contentItem===e,this.tabs[a].setActive(o),o===!0&&(this.activeContentItem=e,this.parent.config.activeItemIndex=a);(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,o,a,s;if(((r=(i=this.tabs[t].element.get(0))===null||i===void 0?void 0:i.offsetLeft)!==null&&r!==void 0?r:0)>((o=(a=this.tabsContainer.get(0))===null||a===void 0?void 0:a.offsetWidth)!==null&&o!==void 0?o:0)+((s=this.tabsContainer.scrollLeft())!==null&&s!==void 0?s:0)){e=this.tabs[t].element.get(0);break}}if(e)e.scrollIntoView({behavior:"smooth",inline:"nearest"}),this._handleScrollButtonMouseDown(this.SCROLL_RIGHT);else{var l=this.tabsContainer.get(0);if(l){var d,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,o;if(((r=(i=this.tabs[t].element.get(0))===null||i===void 0?void 0:i.offsetLeft)!==null&&r!==void 0?r:0)<((o=this.tabsContainer.scrollLeft())!==null&&o!==void 0?o:0)){e=this.tabs[t].element.get(0);break}}if(e)e.scrollIntoView({behavior:"smooth",inline:"start"}),this._handleScrollButtonMouseDown(this.SCROLL_LEFT);else{var a=this.tabsContainer.get(0);a&&(a.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,o=arguments.length>3?arguments[3]:void 0,a=this.tabsContainer.get(0);if(a){var s=a.getBoundingClientRect();if(e===this.SCROLL_LEFT){if(this.tabsContainer.scrollLeft(t-i),this.isDraggingTab&&this.parent._highlightHeaderDropZone(s.left-1),this.tabsContainer.scrollLeft()===0){this._checkScrollArrows();return}}else if(e===this.SCROLL_RIGHT){var l,d;if(this.tabsContainer.scrollLeft(t+i),this.isDraggingTab&&this.parent._highlightHeaderDropZone(s.right+1),((l=this.tabsContainer.scrollLeft())!==null&&l!==void 0?l:0)+((d=this.tabsContainer.innerWidth())!==null&&d!==void 0?d:0)===a.scrollWidth){this._checkScrollArrows();return}}window.cancelAnimationFrame((r=this.rAF)!==null&&r!==void 0?r:-1),this.rAF=window.requestAnimationFrame(h=>{var c,v,p=o||h,g=h-p,f=this.START_SPEED*g+.5*this.ACCELERATION*(g*g);f=Math.min(f,(c=(v=this.tabsContainer.get(0))===null||v===void 0?void 0:v.scrollWidth)!==null&&c!==void 0?c:1/0),this._handleScrollRepeat(e,t,f,p)})}}_$setClosable(e){return this.closeButton&&this._isClosable()?(this.closeButton.element[e?"show":"hide"](),!0):!1}_$destroy(){this.emit("destroy",this);for(var e=0;e<this.tabs.length;e++)this.tabs[e]._$destroy();this._detachWheelListener(),this._handleItemDropped(),k(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,o;if(o=this.layoutManager.config.labels.tabDropdown,this.layoutManager.config.labels.tabNextLabel,this.layoutManager.config.labels.tabPreviousLabel,this.tabDropdownButton=new Bn(this,o,"lm_tabdropdown",this._showAdditionalTabsDropdown),this.tabDropdownButton.element.hide(),this.controlsContainer.prepend(this.tabNextButton),this.tabNextButton.hide(),this._getHeaderSetting("popout")&&(t=this._onPopoutClick.bind(this),r=this._getHeaderSetting("popout"),new Bn(this,r,"lm_popout",t)),this._getHeaderSetting("maximise")){i=this.parent.toggleMaximise.bind(this.parent);var a=this._getHeaderSetting("maximise"),s=this._getHeaderSetting("minimise"),l=new Bn(this,a,"lm_maximise",i);this.parent.on("maximised",function(){l.element.attr("title",s??"")}),this.parent.on("minimised",function(){l.element.attr("title",a??"")})}this._isClosable()&&(e=this.parent.remove.bind(this.parent),r=this._getHeaderSetting("close"),this.closeButton=new Bn(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"),k(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"),k(document).on("mousedown",this._hideAdditionalTabsDropdown),this._updateAdditionalTabsDropdown()}_handleFilterKeydown(e){if(e.key==="Escape"){this._hideAdditionalTabsDropdown();return}if(this.dropdownKeyIndex===-1)return;if(e.key==="Enter"||e.key===" "){this._hideAdditionalTabsDropdown(),this.tabs[this.dropdownKeyIndex]._onTabClick();return}function t(s,l,d){if(d==null||d.length<2)return-1;for(var h=(s+l+d.length)%d.length;h!==s;){if(d.eq(h).css("display")!=="none")return h;h=(h+l+d.length)%d.length}return s}if(e.key==="ArrowDown"||e.key==="Tab"&&e.shiftKey===!1){var r,i;e.preventDefault(),(r=this.tabDropdownList)===null||r===void 0||r.eq(this.dropdownKeyIndex).removeClass("lm_keyboard_active"),this.dropdownKeyIndex=t(this.dropdownKeyIndex,1,this.tabDropdownList),(i=this.tabDropdownList)===null||i===void 0||i.eq(this.dropdownKeyIndex).addClass("lm_keyboard_active")}else if(e.key==="ArrowUp"||e.key==="Tab"){var o,a;e.preventDefault(),(o=this.tabDropdownList)===null||o===void 0||o.eq(this.dropdownKeyIndex).removeClass("lm_keyboard_active"),this.dropdownKeyIndex=t(this.dropdownKeyIndex,-1,this.tabDropdownList),(a=this.tabDropdownList)===null||a===void 0||a.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(),k(document).off("mousedown",this._hideAdditionalTabsDropdown)))}_updateAdditionalTabsDropdown(){var e,t,r,i;if(this.isDropdownShown&&!(!this.tabDropdownList||this.tabDropdownList.length==0)){var o=(e=(t=this.tabDropdownContainer.get(0))===null||t===void 0?void 0:t.scrollHeight)!==null&&e!==void 0?e:0;if(o!==0){var a=this.tabDropdownContainer[0].getBoundingClientRect(),s=(r=k(window).height())!==null&&r!==void 0?r:0,l=(i=k(window).width())!==null&&i!==void 0?i:0;if(this.tabDropdownButton){var d=this.tabDropdownButton.element[0].getBoundingClientRect(),h=o<s-d.bottom,c=!h&&d.bottom>s*.6,v=Math.min(d.left+(c?d.width:0),l-a.width-this.PADDING),p=c?Math.max(d.top-o,this.PADDING):d.bottom,g=s-p-this.PADDING;this.tabDropdownContainer.css({"max-height":g,top:p,left:v})}}}}_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()}}}}le(Nt,"_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(""));le(Nt,"_previousButtonTemplate",['<ul class="lm_controls">','<li class="lm_tabpreviousbutton"></li>',"</ul>"].join(""));le(Nt,"_nextButtonTemplate",['<li class="lm_tabnextbutton"></li>'].join(""));function An(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=pp(n,"string");return typeof e=="symbol"?e:e+""}function pp(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var 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 Js{constructor(e,t,r){An(this,"_isVertical",void 0),An(this,"_size",void 0),An(this,"_grabSize",void 0),An(this,"_dragListener",void 0),An(this,"element",void 0),this._isVertical=e,this._size=t,this._grabSize=r<t?t:r,this.element=this._createElement(),this._dragListener=new Qn(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=k('<div class="lm_drag_handle"></div>'),t=k('<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 fp=Object.freeze(Object.defineProperty({__proto__:null,BrowserPopout:Gs,DragProxy:hn,DragSource:qs,DragSourceFromEvent:Zs,DropTargetIndicator:Jn,Header:Nt,HeaderButton:Bn,Splitter:Js,Tab:er},Symbol.toStringTag,{value:"Module"}));var gp={config:fv,container:Sv,controls:fp,errors:Qv,items:dp,utils:Lv};function Ko(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 ze(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Ko(Object(t),!0).forEach(function(r){se(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Ko(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function se(n,e,t){return(e=bp(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function bp(n){var e=yp(n,"string");return typeof e=="symbol"?e: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)}class el extends Ue{static minifyConfig(e){return Ei(e)}static unminifyConfig(e){return oi(e)}constructor(e,t){super(),se(this,"isInitialised",!1),se(this,"_isFullPage",!1),se(this,"_resizeTimeoutId",void 0),se(this,"_components",{"lm-react-component":Bs}),se(this,"_fallbackComponent",void 0),se(this,"_itemAreas",[]),se(this,"_maximisedItem",null),se(this,"_maximisePlaceholder",k('<div class="lm_maximise_place"></div>')),se(this,"_creationTimeoutPassed",!1),se(this,"_subWindowsCreated",!1),se(this,"_dragSources",[]),se(this,"_updatingColumnsResponsive",!1),se(this,"_firstLoad",!0),se(this,"_reactChildMap",new Map),se(this,"_reactChildren",null),se(this,"_initialHeaderHeight",void 0),se(this,"width",null),se(this,"height",null),se(this,"root",void 0),se(this,"openPopouts",[]),se(this,"selectedItem",null),se(this,"isSubWindow",!1),se(this,"eventHub",new Ws(this)),se(this,"config",void 0),se(this,"container",void 0),se(this,"_originalContainer",void 0),se(this,"dropTargetIndicator",null),se(this,"tabDropPlaceholder",k('<div class="lm_drop_tab_placeholder"></div>')),se(this,"_typeToItem",void 0),this._onResize=this._onResize.bind(this),this._onUnload=this._onUnload.bind(this),this._windowBlur=this._windowBlur.bind(this),this._windowFocus=this._windowFocus.bind(this),this.config=this._createConfig(e),this._originalContainer=t,this.container=this._getContainer(),this._initialHeaderHeight=this.config.dimensions.headerHeight,this.isSubWindow&&k("body").css("visibility","hidden"),this._typeToItem={column:Tr.bind(this,!0),row:Tr.bind(this,!1),stack:di,component:Qs}}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 De))throw new Error("Root must be a ContentItem");var t={settings:ze({},this.config.settings),dimensions:ze({},this.config.dimensions),labels:ze({},this.config.labels),content:[]},r=function o(a,s){for(var l in s.config)l!=="content"&&(a[l]=s.config[l]);if(a.componentName==="lm-react-component"&&(a.type="react-component"),s.contentItems.length){a.content=[];for(var d=0;d<s.contentItems.length;d++)a.content[d]={},o(a.content[d],s.contentItems[d])}};e?r(t,{contentItems:[e]}):r(t,this.root),this._$reconcilePopoutWindows(),t.openPopouts=[];for(var i=0;i<this.openPopouts.length;i++)t.openPopouts.push(this.openPopouts[i].toConfig());return t.maximisedItemId=this._maximisedItem?"__glMaximised":void 0,t}getComponent(e){return this._components[e]}getFallbackComponent(){return this._fallbackComponent}init(){if(this._subWindowsCreated===!1&&(this._createSubWindows(),this._subWindowsCreated=!0),document.readyState==="loading"||document.body===null){k(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 Jn,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 o,a;this._maximisedItem.element.width((o=this.container.width())!==null&&o!==void 0?o:0),this._maximisedItem.element.height((a=this.container.height())!==null&&a!==void 0?a:0),this._maximisedItem.callDownwards("setSize")}this._adjustColumnsResponsive()}}destroy(){var e;this.isInitialised===!1||!this.root||(this._onUnload(),k(window).off("resize",this._onResize),k(window).off("unload beforeunload",this._onUnload),k(window).off("blur.lm").off("focus.lm"),this.root.callDownwards("_$destroy",[],!0),this.root.contentItems=[],this.tabDropPlaceholder.remove(),(e=this.dropTargetIndicator)===null||e===void 0||e.destroy(),this.eventHub.destroy(),this._dragSources.forEach(function(t){t._dragListener.destroy()}),this._dragSources=[])}createContentItem(e,t){var r,i,o;if(typeof e.type!="string")throw new nn("Missing parameter 'type'",e);if(e.type==="react-component"&&(e.type="component",e.componentName="lm-react-component"),!this._typeToItem[e.type])throw i="Unknown type '"+e.type+"'. Valid types are "+Object.keys(this._typeToItem).join(","),new nn(i);return e.type==="component"&&!(t instanceof di)&&t&&!(this.isSubWindow===!0&&t instanceof li)&&(e={type:"stack",width:e.width,height:e.height,content:[e]}),e.id=(r=e.id)!==null&&r!==void 0?r:Er(),o=new this._typeToItem[e.type](this,e,t),o}createPopout(e,t,r,i){var o=[],a=e instanceof De,s=this;if(a){var l;o=this.toConfig(e).content,r=Er();for(var d=e.parent,h=e;((c=d)===null||c===void 0?void 0:c.contentItems.length)===1&&!d.isRoot;){var c;h=d,d=d.parent}if((l=d)===null||l===void 0||l.addId(r),i==null||Number.isNaN(i)){var v;i=(v=d)===null||v===void 0?void 0:v.contentItems.indexOf(h)}}else e instanceof Array?o=e:o=[e];if(!t&&a){var p,g,f,y=window.screenX||window.screenLeft,T=window.screenY||window.screenTop,O=(p=e.element.offset())!==null&&p!==void 0?p:{left:0,top:0};t={left:y+O.left,top:T+O.top,width:(g=e.element.width())!==null&&g!==void 0?g:0,height:(f=e.element.height())!==null&&f!==void 0?f:0}}if(!t&&!a&&(t={left:window.screenX||window.screenLeft+20,top:window.screenY||window.screenTop+20,width:500,height:309}),a&&e.remove(),!(!t||!r||i===void 0)){var P=new Gs(o,t,r,i,this);return P.on("initialised",function(){s.emit("windowOpened",P)}),P.on("closed",function(){s._$reconcilePopoutWindows()}),this.openPopouts.push(P),P}}createDragSource(e,t){this.config.settings.constrainDragToContainer=!1;var r=new qs(e,t,this);return this._dragSources.push(r),r}createDragSourceFromEvent(e,t){return this.config.settings.constrainDragToContainer=!1,new Zs(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,o=0;o<this._itemAreas.length;o++){var a=this._itemAreas[o];e>a.x1&&e<a.x2&&t>a.y1&&t<a.y2&&r>a.surface&&(r=a.surface,i=a)}return i}_$createRootItemAreas(){var e=50,t=ze({},this.root._$getArea()),r=[ze(ze({},t),{},{side:"left",x2:t.x1+e}),ze(ze({},t),{},{side:"right",x1:t.x2-e}),ze(ze({},t),{},{side:"top",y2:t.y1+e}),ze(ze({},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(rn(r)){var i=r._$getArea();if(i!==null)if(i instanceof Array)this._itemAreas=this._itemAreas.concat(i);else{var o;this._itemAreas.push(i);var a=ze(ze({},i),(o=i.contentItem._contentAreaDimensions)===null||o===void 0?void 0:o.header.highlightArea);a.surface=(a.x2-a.x1)*(a.y2-a.y1),this._itemAreas.push(a)}}}}_$normalizeContentItem(e,t){if(!e)throw new Error("No content item defined");if(typeof e=="function"&&(e=e()),e instanceof De)return e;if(k.isPlainObject(e)&&e.type){var r=this.createContentItem(e,t);return r.callDownwards("_$init"),r}else throw new Error("Invalid contentItem")}_$reconcilePopoutWindows(){for(var e=[],t=0;t<this.openPopouts.length;t++){var r;((r=this.openPopouts[t].getWindow())===null||r===void 0?void 0:r.closed)===!1?e.push(this.openPopouts[t]):this.emit("windowClosed",this.openPopouts[t])}this.openPopouts.length!==e.length&&(this.emit("stateChanged"),this.openPopouts=e)}_getAllContentItems(){var e=[],t=r=>{if(e.push(r),r.contentItems instanceof Array)for(var i=0;i<r.contentItems.length;i++)t(r.contentItems[i])};return t(this.root),e}_bindEvents(){this._isFullPage&&k(window).resize(this._onResize),k(window).on("unload beforeunload",this._onUnload).on("blur.lm",this._windowBlur).on("focus.lm",this._windowFocus)}_windowBlur(){this.root.element.addClass("lm_window_blur")}_windowFocus(){this.root.element.removeClass("lm_window_blur")}_onResize(){clearTimeout(this._resizeTimeoutId),this._resizeTimeoutId=window.setTimeout(this.updateSize.bind(this),100)}_createConfig(e){var t,r=Hs("gl-window");r&&(this.isSubWindow=!0,e=JSON.parse(localStorage.getItem(r)||"{}"),e=oi(e),localStorage.removeItem(r)),e=k.extend(!0,{},Ls,e);var i=function o(a){for(var s in a){var l=a[s];s!=="props"&&typeof l=="object"&&l!=null?o(l):s==="type"&&l==="react-component"&&(a.type="component",a.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=k('<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=wi((e=this.config.content[0].title)!==null&&e!==void 0?e:""),k("head").append(k("body link, body style, template, .gl_keep")),this.container=k("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?k(this._originalContainer):k("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,k("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 nn(t,e);if(e.content.length>1)throw t="Top level content can't contain more then one element.",new nn(t,e);this.root=new li(this,{content:e.content},this.container),this.root.callDownwards("_$init"),e.maximisedItemId==="__glMaximised"&&this.root.getItemsById(e.maximisedItemId)[0].toggleMaximise()}_onUnload(){if(this.config.settings.closePopoutsOnUnload===!0)for(var e=0;e<this.openPopouts.length;e++)this.openPopouts[e].close()}_adjustColumnsResponsive(){if(!this._useResponsiveLayout()||this._updatingColumnsResponsive||!this.config.dimensions||!this.config.dimensions.minItemWidth||this.root.contentItems.length===0||!this.root.contentItems[0].isRow){this._firstLoad=!1;return}this._firstLoad=!1;var e=this.root.contentItems[0].contentItems.length;if(!(e<=1)){var t=this.config.dimensions.minItemWidth,r=e*t;if(!(this.width==null||r<=this.width)){this._updatingColumnsResponsive=!0;for(var i=Math.max(Math.floor(this.width/t),1),o=e-i,a=this.root.contentItems[0],s=this._findAllStackContainers()[0],l=0;l<o;l++){var d=a.contentItems[a.contentItems.length-1];this._addChildContentItemsToContainer(s,d)}this._updatingColumnsResponsive=!1}}}_useResponsiveLayout(){return this.config.settings&&(this.config.settings.responsiveMode=="always"||this.config.settings.responsiveMode=="onload"&&this._firstLoad)}_addChildContentItemsToContainer(e,t){t.type==="stack"?t.contentItems.forEach(function(r){e.addChild(r),t.removeChild(r,!0)}):t.contentItems.forEach(r=>{this._addChildContentItemsToContainer(e,r)})}_findAllStackContainers(){var e=[];return this._findAllStackContainersRecursive(e,this.root),e}_findAllStackContainersRecursive(e,t){t.contentItems.forEach(r=>{rn(r)?e.push(r):r.isComponent||this._findAllStackContainersRecursive(e,r)})}}se(el,"__lm",gp);const zo={"tab-height":"28px","drag-border-width":"5px"},Go=Object.freeze({tabHeight:parseInt(zo["tab-height"],10),dragBorderWidth:parseInt(zo["drag-border-width"],10)});function qo(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?qo(Object(t),!0).forEach(function(r){tl(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):qo(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function tl(n,e,t){return(e=Cp(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Cp(n){var e=Sp(n,"string");return typeof e=="symbol"?e:e+""}function Sp(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 Ft=W.module("LayoutUtils");function nl(n){return n.componentName!==void 0}function gn(n){var e=n;return(nl(n)&&n.componentName==="lm-react-component"||n.type==="react-component")&&e.component!==void 0}function hr(n){return n.focus!==void 0}function Zo(n){return n.type==="stack"}class D{static activateTab(e,t){var r=D.getStackForRoot(e,t,!1);if(!r){Ft.error("Could not find stack for config",t);return}var i=D.getContentItemInStack(r,t);i&&r.setActiveContentItem(i)}static isActiveTab(e,t){var r=D.getStackForRoot(e,t,!1);if(!r)return Ft.error("Could not find stack for config",t),!1;var i=D.getContentItemInStack(r,t),o=r.getActiveContentItem();return o===i}static addStack(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,r=t?"column":"row";if(Ys(e)){(e.contentItems==null||e.contentItems.length===0)&&e.addChild({type:r});var i=e.contentItems[0],o=t?i.isColumn:i.isRow;if(!o){e.removeChild(i,!0),e.addChild({type:r});var a=document.activeElement;e.contentItems[0].addChild(i),a&&a.focus!=null&&a.focus()}return this.addStack(e.contentItems[0],t)}if(e.contentItems.length<2)return e.addChild({type:"stack"}),e.contentItems[e.contentItems.length-1];var s=e.contentItems[e.contentItems.length-1],l=t?s.isRow:s.isColumn;return l||(e.addChild({type:t?"row":"column"}),e.removeChild(s,!0),e.contentItems[e.contentItems.length-1].addChild(s),s=e.contentItems[e.contentItems.length-1]),this.addStack(s,!t)}static getStackById(e,t){var r,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;if(i&&rn(e)&&e.contentItems.length===0)return e;if(t===((r=e.config)===null||r===void 0?void 0:r.id)){if(rn(e))return e;throw new Error("Item with ID ".concat(t," is not a stack"))}if(e.contentItems==null)return null;for(var o=0;o<e.contentItems.length;o+=1){var a=this.getStackById(e.contentItems[o],t,i);if(a)return a}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&&rn(e)&&e.contentItems.length===0)return e;if(e.contentItems==null)return null;for(var i=0;i<e.contentItems.length;i+=1){var o=e.contentItems[i];if(o.isComponent&&o.config!=null&&Mi(o.config,t))return e;var a=this.getStackForConfig(o,t,r);if(a)return a}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,o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,a=this.getStackForConfig(e,t);return!a&&i&&(a=this.getStackForConfig(e,{component:t.component},o)),!a&&r&&(a=this.addStack(e)),a}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,o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,a=0;a<t.length;a+=1){var s=t[a],l=a===t.length-1,d=D.getStackForRoot(e,{component:s},r&&l,i,o);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&&Mi(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 o=e[i],{component:a,content:s}=o;if(a){var l=t(a,o);l!=null?r.push(l):Ft.debug2('dehydrateLayoutConfig: skipping unmapped component "'.concat(a,'"'))}else if(s){var d=Dt(Dt({},o),{},{content:D.dehydrateLayoutConfig(s,t)});r.push(d)}else r.push(o)}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?(Zo(r)&&delete r.activeItemIndex,D.dropLayoutMinorChange(i)):gn(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=D.cloneLayout(e),o=D.cloneLayout(t);return r?(D.dropLayoutMinorChange(i),D.dropLayoutMinorChange(o),Gn(i,o)):Gn(i,o)}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 o=e[i];if(gn(o)){var a,{component:s,props:l={}}=o;r.push(Dt(Dt({},o),{},{id:(a=o?.id)!==null&&a!==void 0?a:kt(),props:t(s,l)}))}else if(o.content!==void 0){var d=D.hydrateLayoutConfig(o.content,t);Zo(o)&&o.activeItemIndex!=null&&o.activeItemIndex>=d.length&&(Ft.warn("Fixing bad activeItemIndex!",o.activeItemIndex,o),o.activeItemIndex=0),r.push(Dt(Dt({},o),{},{content:d}))}else r.push(o)}return r}static openComponent(){var{root:e,config:t,stack:r=void 0,replaceExisting:i=!0,replaceConfig:o=void 0,createNewStack:a=!1,focusElement:s=void 0,dragEvent:l=void 0}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},d=document.activeElement,h=Dt({},t);if(h.id==null&&(h.id=kt()),l!=null){e?.layoutManager.createDragSourceFromEvent(h,l);return}var c=o||{id:h.id,component:h.component};R(e);var v=r??(a?D.addStack(e):D.getStackForRoot(e,c));R(v);var p=D.getContentItemInStack(v,c);if(s!=null){var g=y=>{Ft.debug("Component created, focusing element",s),v.off("componentCreated",g);var{element:T}=y.origin;requestAnimationFrame(()=>{D.focusElement(T[0],s)})};v.on("componentCreated",g)}if(i&&p){var f=v.contentItems.indexOf(p);v.addChild(h,f+1),v.removeChild(p),v.setActiveContentItem(v.contentItems[f])}else v.addChild(h);s==null&&d&&hr(d)&&d.focus()}static openComponentInStack(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,i=document.activeElement,o={id:t.id},a=D.getContentItemInStack(e,o);if(r&&a&&e){var s=e?.contentItems.indexOf(a);e.addChild(t,s+1),e.removeChild(a),e.setActiveContentItem(e.contentItems[s])}else e?.addChild(t);i&&hr(i)&&i.focus()}static closeComponent(e,t,r){var i=D.getStackForRoot(e,t,!1,!1,!1);if(!i){Ft.warn("Cannot find stack for component, ignoring close",t);return}var o=D.getContentItemInStack(i,t),a=document.activeElement;o&&(nt(o)?o.container.close(r):i.removeChild(o)),a&&document.contains(a)&&hr(a)&&a.focus()}static renameComponent(e,t,r){var i=D.getStackForRoot(e,t,!1);if(!i){Ft.error("Could not find stack for config",t);return}var o=D.getContentItemInStack(i,t);o&&o.setTitle(r)}static cloneComponent(e,t){var r=D.getStackForRoot(e,t,!1);if(!r)return Ft.error("Could not find stack for config",t),null;var{props:i={}}=t,o=D.getPanelComponentState(t),a={type:"react-component",component:t.component,props:Dt(Dt({},i),{},{panelState:o}),title:"".concat(t.title," Copy"),id:kt()};return D.openComponentInStack(r,a),a}static getPanelComponentState(e){if(nl(e)){var t;return(t=e.componentState)===null||t===void 0?void 0:t.panelState}if(gn(e)){var r;return(r=e.props)===null||r===void 0?void 0:r.panelState}return null}static makeDefaultLayout(){return{dimensions:{headerHeight:Go.tabHeight,borderWidth:Go.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=D.getComponentConfigFromContainer(e);return t?t.id:null}static getIdFromPanel(e){var{glContainer:t}=e.props;return D.getIdFromContainer(t)}static getComponentNameFromPanel(e){var{glContainer:t}=e.props,r=D.getComponentConfigFromContainer(t);if(r&&gn(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]:D.DEFAULT_FOCUS_SELECTOR;if(e==null)return null;var r=e.querySelector(t);return r==null?null:(hr(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)})}}tl(D,"DEFAULT_FOCUS_SELECTOR","input, select, textarea, button");var wp=$.forwardRef((n,e)=>{var t=D.getComponentNameFromPanel({props:n});return u.jsx("div",{ref:e,className:"panel-placeholder",children:u.jsxs("div",{children:['Component "',t,'" is not registered.']})})});wp.displayName="PanelPlaceholder";const ie=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"});function _r(n){return n?.WrappedComponent!==void 0}function Ep(n){return typeof n.id=="string"&&n.layout instanceof el&&n.panelManager instanceof Ti&&typeof n.registerComponent=="function"}function Pp(n){if(!Ep(n))throw new Error("Expected dashboard plugin props, but instead received ".concat(n))}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 Yo(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){Bt(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 Bt(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=_p(n,"string");return typeof e=="symbol"?e:e+""}function _p(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 st=W.module("PanelManager");class Ti{constructor(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:(s,l)=>l,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:(s,l)=>l,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:new Map,o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:[],a=arguments.length>5&&arguments[5]!==void 0?arguments[5]:()=>{};Bt(this,"layout",void 0),Bt(this,"hydrateComponent",void 0),Bt(this,"dehydrateComponent",void 0),Bt(this,"onPanelsUpdated",void 0),Bt(this,"closed",void 0),Bt(this,"openedMap",void 0),this.handleFocus=this.handleFocus.bind(this),this.handleMount=this.handleMount.bind(this),this.handleUnmount=this.handleUnmount.bind(this),this.handleReopen=this.handleReopen.bind(this),this.handleReopenLast=this.handleReopenLast.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=a,this.openedMap=new Map(i),this.closed=[...o],this.startListening()}startListening(){var{eventHub:e}=this.layout;e.on(ie.FOCUS,this.handleFocus),e.on(ie.MOUNT,this.handleMount),e.on(ie.UNMOUNT,this.handleUnmount),e.on(ie.REOPEN,this.handleReopen),e.on(ie.REOPEN_LAST,this.handleReopenLast),e.on(ie.DELETE,this.handleDeleted),e.on(ie.CLOSED,this.handleClosed),e.on(ie.CLOSE,this.handleControlClose)}stopListening(){var{eventHub:e}=this.layout;e.off(ie.FOCUS,this.handleFocus),e.off(ie.MOUNT,this.handleMount),e.off(ie.UNMOUNT,this.handleUnmount),e.off(ie.REOPEN,this.handleReopen),e.off(ie.REOPEN_LAST,this.handleReopenLast),e.off(ie.DELETE,this.handleDeleted),e.off(ie.CLOSED,this.handleClosed),e.off(ie.CLOSE,this.handleControlClose)}getClosedPanelConfigsOfType(e){return this.closed.filter(t=>t.component===e)}getOpenedPanels(){return Array.from(this.openedMap.values())}getOpenedPanelConfigs(){return this.getOpenedPanels().map(e=>{var{glContainer:t}=e.props;return D.getComponentConfigFromContainer(t)})}getOpenedPanelConfigsOfType(e){return this.getOpenedPanelConfigs().filter(t=>t!=null&&gn(t)&&t.component===e)}getOpenedPanelById(e){return this.openedMap.get(e)}getContainerByPanelId(e){var t,r=D.getStackForConfig(this.layout.root,{id:e});return(t=r&&D.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=>_r(r)&&t instanceof r.WrappedComponent||!_r(r)&&t instanceof r))}updatePanel(e){var t=D.getIdFromPanel(e);if(t==null){st.error("updatePanel Panel did not have an ID",e);return}st.debug2("Updating panel ID ".concat(t," in open panels map")),this.openedMap.delete(t),this.openedMap.set(t,e)}removePanel(e){var t=D.getIdFromPanel(e);if(t==null){st.error("removePanel Panel did not have an ID",e);return}if(!this.openedMap.has(t)){st.error("Missing panel ID ".concat(t," in open panels map"));return}if(this.openedMap.get(t)!==e){st.debug("Panel argument doesn't match the open panels map entry for ".concat(t,", removePanel ignored"));return}st.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){st.debug2("Focus: ",e),this.updatePanel(e)}handleMount(e){st.debug2("Mount: ",e),this.updatePanel(e),this.sendUpdate()}handleUnmount(e){st.debug2("Unmount: ",e),this.removePanel(e),this.sendUpdate()}handleReopen(e,t){st.debug2("Reopen:",e,t),this.removeClosedPanelConfig(e);var{component:r}=e,{props:i}=e;i=this.hydrateComponent(r,i);var o=Yo(Yo({},e),{},{props:i}),{root:a}=this.layout,s=e.parentStackId===void 0?void 0:D.getStackById(a,e.parentStackId);D.openComponent({root:a,config:o,replaceConfig:t,stack:s??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=D.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 o=this.closed[i];if(o.parentStackId===r){this.handleReopen(o);return}}}}handleDeleted(e){st.debug2("Deleted:",e),this.removeClosedPanelConfig(e),this.sendUpdate()}handleClosed(e,t){st.debug2("Closed: ",e),this.addClosedPanel(t),this.sendUpdate()}handleControlClose(e){var t={id:e},{root:r}=this.layout;D.closeComponent(r,t)}addClosedPanel(e){var{root:t}=this.layout,r=D.getComponentConfigFromContainer(e);if(r&&gn(r)){var i=this.dehydrateComponent(r.component,r);if(i!=null){var o;i.parentStackId=(o=D.getStackForConfig(t,r))===null||o===void 0?void 0:o.config.id,this.closed.push(i)}}}sendUpdate(){var{closed:e,openedMap:t}=this;this.onPanelsUpdated({closed:[...e],openedMap:new Map(t)})}}Bt(Ti,"MAX_CLOSED_PANEL_COUNT",100);var Op=W.module("PanelErrorBoundary");class Ip extends m.Component{constructor(e){super(e),this.state={error:null}}componentDidCatch(e){this.setState({error:e})}componentWillUnmount(){var{glContainer:e,glEventHub:t}=this.props,r=D.getIdFromContainer(e);Op.debug("componentWillUnmount",r),t.emit(ie.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(sn,{errorMessage:"".concat(t),isLoading:!1,isLoaded:!1})}):e}}function Qo(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 Or(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Qo(Object(t),!0).forEach(function(r){Dp(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Qo(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function Dp(n,e,t){return(e=xp(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function xp(n){var e=Mp(n,"string");return typeof e=="symbol"?e:e+""}function Mp(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var 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 rl(n){var{props:e,componentState:t}=n,{metadata:r}=e,{panelState:i=null}=e;t&&({panelState:i}=t);var o={};return r!=null&&(o.metadata=r),i!=null&&(o.panelState=i),Or(Or({},n),{},{componentState:null,props:o,type:"react-component"})}function il(n){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";return Or(Or({},n),{},{localDashboardId:e})}function kp(n){var e=_r(n)&&n.WrappedComponent.prototype!=null&&n.WrappedComponent.prototype.isReactComponent!=null||n.prototype!=null&&n.prototype.isReactComponent!=null,t=!_r(n)&&"$$typeof"in n&&n.$$typeof===Il.ForwardRef;return e||t}const Np={dehydrate:rl,hydrate:il};var jp=$.createContext(void 0),Ap=S.shape({on:S.func,off:S.func,isHidden:S.bool,tab:S.shape({header:S.shape({tabs:S.arrayOf(S.shape({contentItem:S.shape({})}))})}),title:S.string,setTitle:S.func,close:S.func}),ol=S.shape({on:S.func,off:S.func,emit:S.func}),Lp=S.shape({registerComponent:S.func,root:S.shape({addChild:S.func}),on:S.func,off:S.func,eventHub:ol}),Fp=Object.freeze({Container:Ap,EventHub:ol,Layout:Lp});function je(n,e,t){m.useEffect(function(){return n.on(e,t),()=>{n.off(e,t)}},[n,e,t])}function Ln(n,e,t,r){var i,o=(i=e.COMPONENT)!==null&&i!==void 0?i:e.displayName;if(o==null)throw new Error("ComponentType must have a `COMPONENT` or `displayName` attribute.");$.useEffect(()=>{var a=n(o,e,t,r);return()=>{a()}},[e,r,t,o,n])}var al="SET_DASHBOARD_DATA";const Rp=Ah(al,{},!1),$p={dashboardData:Rp};var Hp=new Map,sl=Object.freeze({}),Bp=Object.freeze([]),Lb=vi,Fb=Ia,Rb=Dl,Wp=n=>n.dashboardData,Le=(n,e)=>{var t;return(t=Wp(n)[e])!==null&&t!==void 0?t:sl},$b=(n,e)=>{var t;return(t=Le(n,e).closed)!==null&&t!==void 0?t:Bp},Hb=(n,e)=>{var t;return(t=Le(n,e).openedMap)!==null&&t!==void 0?t:Hp},ll=(n,e)=>{var t;return(t=Le(n,e).pluginDataMap)!==null&&t!==void 0?t:sl},Bb=(n,e,t)=>ll(n,e)[t];function Jo(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?Jo(Object(t),!0).forEach(function(r){Up(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Jo(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function Up(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=Kp(n,"string");return typeof e=="symbol"?e:e+""}function Kp(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 dl=(n,e)=>({type:al,id:n,payload:e}),Xt=(n,e)=>(t,r)=>t(dl(n,bn(bn({},Le(r(),n)),e))),Wb=(n,e,t)=>(r,i)=>r(dl(n,bn(bn({},Le(i(),n)),{},{pluginDataMap:bn(bn({},ll(i(),n)),{},{[e]:t})})));Object.entries($p).map(n=>{var[e,t]=n;return md.register(e,t)});function zp(n){var{children:e}=n;return u.jsx(u.Fragment,{children:e})}var ul=m.createContext(null);function Gp(){return m.useContext(ul)}function ea(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 Fn(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?ea(Object(t),!0).forEach(function(r){qp(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):ea(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function qp(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=Xp(n,"string");return typeof e=="symbol"?e:e+""}function Xp(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var 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 cr=W.module("DashboardLayout"),Yp=Object.freeze({}),Qp=[],ta=()=>{},Jp=1e3,na=n=>n;function ef(n){var e,t,{id:r,children:i,emptyDashboard:o=u.jsx("div",{children:"Dashboard is empty."}),layout:a,layoutConfig:s=Qp,onLayoutChange:l=ta,onLayoutInitialized:d=ta,hydrate:h=il,dehydrate:c=rl,panelWrapper:v=zp}=n,p=vi(),g=(e=Ia(b=>Le(b,r)))!==null&&e!==void 0?e:Yp,[f,y]=m.useState(!1),[T,O]=m.useState(!1),[P,F]=m.useState(),[U]=m.useState((t=g?.closed)!==null&&t!==void 0?t:[]),[te,N]=m.useState(a.getReactChildren()),B=m.useMemo(()=>new Map,[]),H=m.useMemo(()=>new Map,[]),J=m.useCallback(function(b,w){var _,G=arguments.length>2&&arguments[2]!==void 0?arguments[2]:h,ne=arguments.length>3&&arguments[3]!==void 0?arguments[3]:c;cr.debug2("registerComponent",b,w,G,ne);function it(Z,ae){var ce=w,Fe=v,Pt=kp(ce),{glContainer:Tt,glEventHub:Hr}=Z,Nn=D.getIdFromContainer(Tt);return u.jsx(Ip,{glContainer:Tt,glEventHub:Hr,children:u.jsx(ul.Provider,{value:Nn,children:u.jsx(Fe,Fn(Fn({},Z),{},{children:Pt?u.jsx(ce,Fn(Fn({},Z),{},{ref:ae})):u.jsx(ce,Fn({},Z))}))})})}it.displayName="DashboardWrapper(".concat((_=w.displayName)!==null&&_!==void 0?_:b,")");var I=a.registerComponent(b,$.forwardRef(it));return B.set(b,G),H.set(b,ne),I},[h,c,B,H,a,v]),oe=m.useCallback((b,w)=>{var _;return((_=B.get(b))!==null&&_!==void 0?_:na)(w,r)},[B,r]),L=m.useCallback((b,w)=>{var _;return((_=H.get(b))!==null&&_!==void 0?_:na)(w,r)},[H,r]),q=m.useMemo(()=>new Ti(a,oe,L,new Map,U,b=>{var{closed:w,openedMap:_}=b;p(Xt(r,{closed:w,openedMap:_}))}),[L,p,oe,r,U,a]),K=nu(b=>{var w=P==null||!D.isEqual(P,b);cr.debug("handleLayoutStateChanged",w,b),w&&(y(a.root.contentItems.length===0),F(b),l(b),N(a.getReactChildren()))},Jp,{flushOnUnmount:!0});m.useEffect(()=>()=>K.flush(),[K]);var j=m.useCallback(()=>{if(!T){var b=a.toConfig(),w=b.content,_=D.dehydrateLayoutConfig(w,L);K(_)}},[L,T,a,K]),V=m.useCallback(b=>{var w=D.getIdFromContainer(b);a.eventHub.emit(ie.DRAGGING,w),O(!0)},[a.eventHub]),z=m.useCallback(b=>{var w=D.getIdFromContainer(b);a.eventHub.emit(ie.DROPPED,w),O(!1)},[a.eventHub]),ve=m.useCallback(b=>{if(cr.debug2("handleComponentCreated",b),!(b==null||b.config==null||b.config.component==null||b.element==null)){var w=b.config.component.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),_="".concat(w,"-component");b.element.addClass(_)}},[]),Ve=m.useCallback(()=>{N(a.getReactChildren())},[a]);je(a,"stateChanged",j),je(a,"itemPickedUp",V),je(a,"itemDropped",z),je(a,"componentCreated",ve),je(a.eventHub,ie.TITLE_CHANGED,j),je(a,"reactChildrenChanged",Ve);var ke=ru(s);return m.useEffect(function(){if(ke!==s&&s!==P){cr.debug("Setting new layout content...");for(var w=D.hydrateLayoutConfig(s,oe);a.root.contentItems.length>0;)a.root.contentItems[0].remove();for(var _=0;_<w.length;_+=1)a.root.addChild(w[_]);y(a.root.contentItems.length===0)}},[oe,a,s,P,q,ke]),m.useEffect(()=>d(),[]),u.jsxs(u.Fragment,{children:[f&&o,te,$.Children.map(i,b=>b!=null?u.jsx(Ju,{fallback:[],children:$.cloneElement(b,{id:r,layout:a,panelManager:q,registerComponent:J})}):null)]})}ef.propTypes={id:S.string.isRequired,children:S.node,data:S.shape({}),emptyDashboard:S.node,layout:Fp.Layout.isRequired,layoutConfig:S.arrayOf(S.shape({})),onLayoutChange:S.func,onLayoutInitialized:S.func};var tf=m.createContext(null);function Ub(){var n=m.useContext(tf);if(n==null)throw new Error("useDashboardId must be used within a DashboardIdContext provider");return n}function nf(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)}function hl(n,e,t){if(n){if(t(n)===!0)return n;for(var r=n.child;r;){var i=hl(r,e,t);if(i)return i;r=r.sibling}}}function af(n){try{return Object.defineProperties(n,{_currentRenderer:{get(){return null},set(){}},_currentRenderer2:{get(){return null},set(){}}})}catch{return n}}var cl=af(m.createContext(null));class Vb extends m.Component{constructor(){super(...arguments),nf(this,"_reactInternals",void 0)}render(){var{children:e}=this.props;return u.jsx(cl.Provider,{value:this._reactInternals,children:e})}}function sf(){var n=m.useContext(cl);if(n===null)throw new Error("useFiber must be called within a <FiberProvider />!");var[e]=m.useState(()=>kt()),t=m.useMemo(()=>{for(var r of[n,n?.alternate].filter(o=>o!=null)){var i=hl(r,!1,o=>{for(var a=o.memoizedState;a!=null;){if(a.memoizedState===e)return!0;a=a.next}});if(i)return i}},[n,e]);return t}var Kb="default",lf=W.module("useDhId"),Zr="__dhId";function zb(){var n,e,t=(n=(e=sf())===null||e===void 0?void 0:e.pendingProps)!==null&&n!==void 0?n:{},r=t[Zr],i=Gp();if(r!=null){if(typeof r!="string")throw new Error("useDhId expected prop ".concat(Zr," to be a string, but got ").concat(typeof r));return r}return i??(lf.warn("useDhId must be used within a PanelIdContext provider if there is no ".concat(Zr," prop. Defaulting to null.")),null)}function tr(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=uf(n,"string");return typeof e=="symbol"?e:e+""}function uf(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var 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{}tr(Me,"SESSION_OPENED","ConsoleEvent.SESSION_OPENED");tr(Me,"SESSION_CLOSED","ConsoleEvent.SESSION_CLOSED");tr(Me,"FOCUS_HISTORY","ConsoleEvent.FOCUS_HISTORY");tr(Me,"SEND_COMMAND","ConsoleEvent.SEND_COMMAND");tr(Me,"SETTINGS_CHANGED","ConsoleEvent.SETTINGS_CHANGED");function Yt(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=cf(n,"string");return typeof e=="symbol"?e:e+""}function cf(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 Et{}Yt(Et,"TABLE_CHANGED","InputFilterEvent.TABLE_CHANGED");Yt(Et,"COLUMNS_CHANGED","InputFilterEvent.COLUMNS_CHANGED");Yt(Et,"FILTERS_CHANGED","InputFilterEvent.FILTERS_CHANGED");Yt(Et,"CLEAR_ALL_FILTERS","InputFilterEvent.CLEAR_ALL_FILTERS");Yt(Et,"COLUMN_SELECTED","InputFilterEvent.COLUMN_SELECTED");Yt(Et,"OPEN_DROPDOWN","InputFilterEvent.OPEN_DROPDOWN");Yt(Et,"OPEN_INPUT","InputFilterEvent.OPEN_INPUT");Yt(Et,"OPEN_FILTER_SET_MANAGER","InputFilterEvent.OPEN_FILTER_SET_MANAGER");const Gb=Object.freeze({OPEN:"MarkdownEvent.OPEN"});function jt(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=vf(n,"string");return typeof e=="symbol"?e:e+""}function vf(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 Q{}jt(Q,"CREATE_NOTEBOOK","NotebookEvent.createNotebook");jt(Q,"SELECT_NOTEBOOK","NotebookEvent.selectNotebook");jt(Q,"CLOSE_FILE","NotebookEvent.closeFile");jt(Q,"RENAME","NotebookEvent.rename");jt(Q,"RENAME_FILE","NotebookEvent.renameFile");jt(Q,"REGISTER_FILE","NotebookEvent.registerFile");jt(Q,"SEND_TO_NOTEBOOK","NotebookEvent.sendToNotebook");jt(Q,"UNREGISTER_FILE","NotebookEvent.unregisterFile");jt(Q,"PROMOTE_FROM_PREVIEW","NotebookEvent.promoteFromPreview");function Mn(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=ff(n,"string");return typeof e=="symbol"?e:e+""}function ff(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 St{}Mn(St,"focus","TabEvent.focus");Mn(St,"blur","TabEvent.blur");Mn(St,"openPQObject","TabEvent.openPQObject");Mn(St,"openControl","TabEvent.openControl");Mn(St,"reload","TabEvent.reload");Mn(St,"clearAllFilters","TabEvent.clearAllFilters");function gf(n,e,t){return(e=bf(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function bf(n){var e=yf(n,"string");return typeof e=="symbol"?e:e+""}function yf(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var 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 ml extends m.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,r,{glContainer:i}=this.props;return[...(e=i==null||(t=i.tab)===null||t===void 0||(r=t.header)===null||r===void 0?void 0:r.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?.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,o,a,s,l,d,h;if(((i=t[r].contentItem)===null||i===void 0||(o=i.config)===null||o===void 0?void 0:o.id)===((a=e.tab)===null||a===void 0||(s=a.contentItem)===null||s===void 0||(l=s.config)===null||l===void 0?void 0:l.id))break;(d=((h=t[r])===null||h===void 0?void 0:h.contentItem).container)===null||d===void 0||d.close()}}handleReopenLast(){var{glContainer:e,glEventHub:t}=this.props;t.emit(ie.REOPEN_LAST,e)}canCloseTabsRight(){for(var{glContainer:e}=this.props,t=this.getAllTabs(),r=!0,i=t.length-1;i>0;i-=1){var o,a,s,l,d,h,c,v;if(((o=t[i].contentItem)===null||o===void 0||(a=o.config)===null||a===void 0?void 0:a.id)===((s=e.tab)===null||s===void 0||(l=s.contentItem)===null||l===void 0||(d=l.config)===null||d===void 0?void 0:d.id))break;var p=!!(!((h=t[i])===null||h===void 0||(c=h.contentItem)===null||c===void 0||(v=c.config)===null||v===void 0)&&v.isClosable);if(p){r=!1;break}}return r}canCloseAny(){for(var e=this.getAllTabs(),t=!0,r=e.length-1;r>0;r-=1){var i,o,a,s=!!(!((i=e[r])===null||i===void 0||(o=i.contentItem)===null||o===void 0||(a=o.config)===null||a===void 0)&&a.isClosable);if(s){t=!1;break}}return t}canReopenLast(){var e,t,{workspace:r,glContainer:i}=this.props,o=(e=D.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(a=>a.parentStackId===o))}render(){var e,t,r,{additionalActions:i,glContainer:o}=this.props,a=[...i];a.push(()=>({title:"Re-open closed panel",group:re.groups.medium+2004,action:this.handleReopenLast,disabled:this.canReopenLast()}));var s=(e=o.tab)===null||e===void 0||(t=e.contentItem)===null||t===void 0||(r=t.config)===null||r===void 0?void 0:r.isClosable;return a.push({title:"Close",order:10,group:re.groups.low,action:this.handleCloseTab,disabled:s===void 0||!s}),a.push(()=>({title:"Close Tabs to Right",order:20,group:re.groups.low,action:this.handleCloseTabsRight,disabled:this.canCloseTabsRight()})),a.push(()=>({title:"Close All",order:30,group:re.groups.low,action:this.handleCloseTabsAll,disabled:this.canCloseAny()})),u.jsx(re,{actions:a})}}gf(ml,"defaultProps",{additionalActions:[]});var Cf=n=>({workspace:ps(n)}),Sf=In(Cf,{setWorkspace:fs})(ml);function vl(n,e,t){return(e=wf(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function wf(n){var e=Ef(n,"string");return typeof e=="symbol"?e:e+""}function Ef(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 pl extends m.PureComponent{constructor(e){super(e),vl(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=$.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,t;(e=this.renameInputRef)===null||e===void 0||(t=e.current)===null||t===void 0||t.focus()}handleRenameInputChange(e){this.setState({value:e.target.value})}handleRenameCancel(){var{onCancel:e}=this.props;e()}handleRenameSubmit(e){e.stopPropagation(),e.preventDefault();var{value:t}=this.state,r=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:o}=this.state;return u.jsxs("form",{className:X("p-3",{"was-validated":o}),onSubmit:this.handleRenameSubmit,noValidate:!0,role:"presentation",onMouseDown:a=>{a.stopPropagation()},onMouseUp:a=>{a.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(ee,{kind:"secondary",className:"mr-2",onClick:this.handleRenameCancel,children:"Cancel"}),u.jsx(ee,{kind:"primary",type:"submit",children:"Rename"})]})]})}render(){var{isShown:e,onCancel:t}=this.props;return u.jsx(Yn,{isShown:e,onEntered:this.handleRenameDialogOpened,onExited:t,options:{placement:"bottom"},interactive:!0,closeOnBlur:!0,children:this.renderRenameDialog()})}}vl(pl,"defaultProps",{isShared:!1,isOwner:!0,itemType:"Item",value:""});function ui(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)}var _f=W.module("Panel");class kn extends m.PureComponent{constructor(e){super(e),ui(this,"ref",void 0),ui(this,"getAdditionActions",wt((r,i,o)=>{var a=[];return i&&a.push(this.getCloneAction()),o&&a.push(this.getRenameAction()),[...a,...r]})),this.handleClearAllFilters=this.handleClearAllFilters.bind(this),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.handleSessionClosed=this.handleSessionClosed.bind(this),this.handleSessionOpened=this.handleSessionOpened.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=$.createRef();var{glContainer:t}=this.props;this.state={title:D.getTitleFromContainer(t),showRenameDialog:!1,isWithinPanel:!0}}componentDidMount(){var e,t,{componentPanel:r,glContainer:i,glEventHub:o}=this.props;i.on("resize",this.handleResize),i.on("show",this.handleBeforeShow),i.on("shown",this.handleShow),i.on("hide",this.handleHide),i.on("tab",this.handleTab),i.on("tabClicked",this.handleTabClicked),o.on(Me.SESSION_CLOSED,this.handleSessionClosed),o.on(Me.SESSION_OPENED,this.handleSessionOpened),o.on(St.focus,this.handleTabFocus),o.on(St.blur,this.handleTabBlur),o.on(Et.CLEAR_ALL_FILTERS,this.handleClearAllFilters),o.emit(ie.MOUNT,r??this),this.setState({isWithinPanel:((e=this.ref.current)===null||e===void 0||(t=e.parentElement)===null||t===void 0?void 0:t.closest(".dh-panel"))!=null})}componentWillUnmount(){var{componentPanel:e,glContainer:t,glEventHub: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(Me.SESSION_CLOSED,this.handleSessionClosed),r.off(Me.SESSION_OPENED,this.handleSessionOpened),r.off(St.focus,this.handleTabFocus),r.off(St.blur,this.handleTabBlur),r.off(Et.CLEAR_ALL_FILTERS,this.handleClearAllFilters),r.emit(ie.UNMOUNT,e??this)}handleTab(e){e!=null&&this.setState({title:D.getTitleFromTab(e)}),this.forceUpdate();var{onTab:t}=this.props;t(e)}handleTabClicked(e){var{onTabClicked:t}=this.props;t(e)}handleClearAllFilters(){var{onClearAllFilters:e}=this.props;e(...arguments)}handleFocus(e){var{componentPanel:t,glEventHub:r}=this.props;r.emit(ie.FOCUS,t??this);var{onFocus:i}=this.props;i(e)}handleBlur(e){var{onBlur:t}=this.props;t(e)}handleHide(){var{onHide:e}=this.props;e(...arguments)}handleResize(){var{onResize:e}=this.props;e(...arguments)}handleSessionClosed(e){var{onSessionClose:t}=this.props;t(e)}handleSessionOpened(e,t){var{onSessionOpen:r}=this.props;r(e,t)}handleBeforeShow(){var{onBeforeShow:e}=this.props;e(...arguments)}handleShow(){var{onShow:e}=this.props;e(...arguments)}handleTabBlur(){var{onTabBlur:e}=this.props;e(...arguments)}handleTabFocus(){var{onTabFocus:e}=this.props;e(...arguments)}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=D.getRootFromContainer(t),i=D.getComponentConfigFromContainer(t);R(i),D.renameComponent(r,i,e)}handleCopyPanel(){var{glContainer:e,glEventHub:t}=this.props,r=D.getRootFromContainer(e),i=D.getComponentConfigFromContainer(e);if(i==null){_f.error("Could not get component config from container",e);return}var o=D.cloneComponent(r,i);o!==null&&t.emit(ie.CLONED,this,o)}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:o,additionalActions:a,errorMessage:s,isLoaded:l,isLoading:d,isClonable:h,isRenamable:c}=this.props,{tab:v}=i,{showRenameDialog:p,title:g,isWithinPanel:f}=this.state;return u.jsxs("div",{className:X("h-100 w-100 dh-panel",t),onFocusCapture:this.handleFocus,onBlurCapture:this.handleBlur,ref:this.ref,children:[e,u.jsx(sn,{errorMessage:s,isLoaded:l,isLoading:d}),!f&&v!=null&&Dr.createPortal(u.jsxs(u.Fragment,{children:[u.jsx(Sf,{glContainer:i,glEventHub:o,additionalActions:this.getAdditionActions(a,h,c)}),c&&u.jsx(pl,{isShown:p,value:g,itemType:"Panel",onCancel:this.handleRenameCancel,onSubmit:this.handleRenameSubmit}),r!=null&&u.jsx(ue,{interactive:!0,options:{placement:"bottom"},popperClassName:"panel-tab-popper",children:r()})]}),v.element[0])]})}}ui(kn,"defaultProps",{className:"",onTab:()=>{},onTabClicked:()=>{},onClearAllFilters:()=>{},onFocus:()=>{},onBlur:()=>{},onHide:()=>{},onResize:()=>{},onSessionClose:()=>{},onSessionOpen:()=>{},onBeforeShow:()=>{},onShow:()=>{},onTabBlur:()=>{},onTabFocus:()=>{},renderTabTooltip:null,additionalActions:[],errorMessage:null,isLoading:!1,isLoaded:!0,isClonable:!1,isRenamable:!1});const qb=Object.freeze({DEFAULT:"DEFAULT",LINKER:"LINKER"});var Of=Object.freeze({}),If=new Map,Ar=Object.freeze([]),Zb=(n,e)=>{var t;return(t=Le(n,e).columns)!==null&&t!==void 0?t:Ar},Xb=(n,e)=>{var t;return(t=Le(n,e).filterSets)!==null&&t!==void 0?t:Ar},Yb=(n,e)=>{var t;return(t=Le(n,e).filters)!==null&&t!==void 0?t:Ar},Qb=(n,e)=>{var t;return(t=Le(n,e).tableMap)!==null&&t!==void 0?t:If},Jb=(n,e)=>Le(n,e).isolatedLinkerPanelId,fl=(n,e)=>{var t;return(t=Le(n,e).links)!==null&&t!==void 0?t:Ar},ey=(n,e)=>Le(n,e).columnSelectionValidator,ty=(n,e)=>{var t;return(t=Le(n,e).consoleSettings)!==null&&t!==void 0?t:Of},ny=(n,e)=>Le(n,e).connection,nr=(n,e)=>Le(n,e).sessionWrapper,ry=(n,e)=>t=>t(Xt(n,{connection:e})),iy=(n,e)=>t=>t(Xt(n,{sessionWrapper:e})),gl=(n,e)=>t=>t(Xt(n,{links:e})),oy=(n,e)=>(t,r)=>{var i=fl(r(),n),o=e.filter(a=>i.findIndex(s=>Gn(s.start,a.start)&&Gn(s.end,a.end))<0);return t(gl(n,i.concat(o)))},ay=(n,e)=>(t,r)=>{var i=fl(r(),n),o=i.filter(a=>!e.includes(a.id));return t(gl(n,o))},sy=(n,e)=>t=>t(Xt(n,{isolatedLinkerPanelId:e})),ly=(n,e)=>t=>t(Xt(n,{columnSelectionValidator:e})),Df=(n,e)=>t=>t(Xt(n,{consoleSettings:e})),dy=(n,e)=>t=>t(Xt(n,{filterSets:e}));function Ir(n,e,t){return(e=xf(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function xf(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 mr=W.module("CommandHistoryPanel");class rr extends m.Component{static handleError(e){mr.error(e)}constructor(e){super(e),Ir(this,"container",void 0),Ir(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=$.createRef(),this.pending=new Dn;var{session:t,sessionId:r,language:i}=e;this.state={panelState:{},session:t,sessionId:r,language:i,contextActions:[{action:this.handleFocusHistory,shortcut:Be.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(mr.debug("handleSendToNotebook",r,e),!r){mr.error("Session is not connected.");return}var{glEventHub:o}=this.props;o.emit(t?Q.CREATE_NOTEBOOK:Q.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;mr.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;R(t),R(r),this.pending.add(e.getTable(t,r,Date.now()),i=>i.close()).then(i=>{this.setState({table:i})}).catch(rr.handleError)}render(){var{glContainer:e,glEventHub:t,commandHistoryStorage:r}=this.props,{language:i,contextActions:o,table:a}=this.state;return u.jsxs(kn,{className:"command-history-pane",componentPanel:this,glContainer:e,glEventHub:t,onSessionOpen:this.handleSessionOpened,onSessionClose:this.handleSessionClosed,onShow:this.handleShow,children:[!a&&u.jsx("div",{className:"command-history-disconnected-message",children:"Waiting for console connection"}),a&&i!=null&&u.jsxs(u.Fragment,{children:[u.jsx(He,{ref:this.container,language:i,sendToNotebook:this.handleSendToNotebook,sendToConsole:this.handleSendToConsole,table:a,commandHistoryStorage:r}),u.jsx(re,{actions:o})]})]})}}Ir(rr,"COMPONENT","CommandHistoryPanel");Ir(rr,"TITLE","Command History");var kf=(n,e)=>{var t=ms(n),r=nr(n,e.localDashboardId),{session:i,config:o}=r??{},{type:a,id:s}=o??{};return{commandHistoryStorage:t,language:a,session:i,sessionId:s}},Nf=In(kf,null,null,{forwardRef:!0})(rr),jf=m.createContext(null),ir=Object.freeze({AUTH_PLUGIN:"AuthPlugin",DASHBOARD_PLUGIN:"DashboardPlugin",WIDGET_PLUGIN:"WidgetPlugin",TABLE_PLUGIN:"TablePlugin",THEME_PLUGIN:"ThemePlugin"});function Af(n){return"DashboardPlugin"in n}function Lf(n){return"AuthPlugin"in n}function Ff(n){return"TablePlugin"in n}function uy(n){return Af(n)||Lf(n)||Ff(n)}function Rf(n){return"type"in n&&n.type===ir.DASHBOARD_PLUGIN}function _i(n){return"type"in n&&n.type===ir.WIDGET_PLUGIN}function $f(n){return"type"in n&&n.type===ir.TABLE_PLUGIN}function Hf(n){return"type"in n&&n.type===ir.AUTH_PLUGIN}function bl(n){return"type"in n&&n.type===ir.THEME_PLUGIN}function hy(n){return Rf(n)||Hf(n)||$f(n)||bl(n)||_i(n)}var Bf=W.module("@deephaven/plugin.PluginUtils");function ra(n,e){return n==null||!_i(n)?!1:[n.supportedTypes].flat().some(t=>t===e)}function Wf(n){var e=u.jsx(he,{icon:La});if(!_i(n))return e;var{icon:t}=n;return t==null?e:m.isValidElement(t)?t:u.jsx(he,{icon:t})}function cy(n){var e=[...n.entries()].filter(t=>bl(t[1]));return Bf.debug("Getting theme data from plugins",e),e.map(t=>{var[r,i]=t,o=Array.isArray(i.themes)?i.themes:[i.themes];return o.map(a=>{var{name:s,baseTheme:l,styleContent:d}=a;return{baseThemeKey:"default-".concat(l??"dark"),themeKey:vd(r,s),name:s,styleContent:d}})}).flat()}function my(){return Xn(jf,"No Plugins available in usePlugins. This can happen when plugins have not finished loading or if code is not wrapped in PluginsContext.Provider.")}function ia(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function vr(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?ia(Object(t),!0).forEach(function(r){on(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):ia(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function on(n,e,t){return(e=Uf(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Uf(n){var e=Vf(n,"string");return typeof e=="symbol"?e:e+""}function Vf(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 pr=W.module("ConsolePanel"),Kf=500,zf=Object.freeze({consoleSettings:{},itemIds:[]});class Lr extends m.PureComponent{constructor(e){super(e),on(this,"consoleRef",void 0),on(this,"objectSubscriptionCleanup",void 0),on(this,"savePanelState",Sn(()=>{var{consoleSettings:a,itemIds:s}=this.state,l={consoleSettings:a,itemIds:[...s]};pr.debug("Saving panel state",l),this.setState({panelState:l})},Kf)),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=$.createRef();var{panelState:t}=e,r=vr(vr({},zf),t||{}),{consoleSettings:i,itemIds:o}=r;this.state={consoleSettings:i,itemIds:new Map(o),objectMap:new Map,error:void 0,panelState:r}}componentDidMount(){var{glEventHub:e}=this.props;this.closeDisconnectedPanels(),e.on(ie.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(ie.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=>{pr.debug("Got updates",r),this.setState(i=>{var{objectMap:o}=i,{updated:a,created:s,removed:l}=r,d=[...a,...l],h=new Map(o);d.forEach(v=>{var{title:p}=v;p!==void 0&&h.delete(p)});var c=[...a,...s];return c.forEach(v=>{v.title!==void 0&&h.set(v.title,v)}),{objectMap:h}})})}}setItemId(e,t){this.setState(r=>{var{itemIds:i}=r,o=new Map(i);return o.set(e,t),{itemIds:o}})}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=kt(),this.setItemId(e,i)),i}handleTabFocus(){var e;(e=this.consoleRef.current)===null||e===void 0||e.focus()}handlePanelMount(e){var t,r,i,{itemIds:o}=this.state,a=e==null||(t=e.props)===null||t===void 0?void 0:t.id,s=e==null||(r=e.props)===null||r===void 0||(i=r.metadata)===null||i===void 0?void 0:i.sourcePanelId;if(a&&s){var l=new Set(o.values());l.has(s)&&this.setItemId(a,a)}}handleFocusCommandHistory(){var{glEventHub:e}=this.props;e.emit(Me.FOCUS_HISTORY)}handleResize(){this.updateDimensions()}handleShow(){this.updateDimensions()}handleOpenObject(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,{root:r}=this.context,i=e.title!=null?this.getItemId(e.title,!1):null;(t||i!=null&&D.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(ie.CLOSE,r)}}}handleSettingsChange(e){var{glEventHub:t}=this.props;pr.debug("handleSettingsChange",e),this.setState({consoleSettings:e}),t.emit(Me.SETTINGS_CHANGED,e)}openWidget(e){var{glEventHub:t,sessionWrapper:r}=this.props;R(r);var{config:i,session:o}=r,{title:a=e.name}=e;R(a);var s=this.getItemId(a),l={fetch:()=>o.getObject(e),panelId:s,widget:vr(vr({},fh(e)),{},{sessionId:i.id})};pr.debug("openWidget",l),t.emit(ie.OPEN,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 o=[...r.values()],{glEventHub:a}=this.props;o.forEach(s=>{a.emit(ie.CLOSE,s)}),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=>ra(r,e))}iconForType(e){var{plugins:t}=this.props,r=[...t.values()].find(i=>ra(i,e));return r!=null?Wf(r):u.jsx(Lh,{type:e})}render(){var{commandHistoryStorage:e,glContainer:t,glEventHub:r,sessionWrapper:i,timeZone:o,unzip:a}=this.props;if(i==null)return u.jsx(sn,{isLoading:!1,errorMessage:"Console is disabled."});var{consoleSettings:s,error:l,objectMap:d}=this.state,{config:h,session:c,connection:v,details:p={},dh:g}=i,{workerName:f,processInfoId:y}=p,{id:T,type:O}=h;return u.jsx(kn,{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:c!=null&&u.jsx(Gt,{dh:g,ref:this.consoleRef,settings:s,session:c,focusCommandHistory:this.handleFocusCommandHistory,openObject:this.handleOpenObject,closeObject:this.handleCloseObject,commandHistoryStorage:e,onSettingsChange:this.handleSettingsChange,language:O,statusBarChildren:u.jsxs(u.Fragment,{children:[u.jsx("div",{children:bs.LANGUAGE_MAP.get(O)}),f!=null&&u.jsxs(u.Fragment,{children:[u.jsx("div",{children:"•"}),f]}),y!=null&&u.jsxs(u.Fragment,{children:[u.jsx("div",{children:"•"}),y,u.jsx("div",{children:"•"})]}),u.jsx(vv,{connection:v,defaultUpdateInterval:10*1e3,hoverUpdateInterval:3*1e3,monitorDuration:10*60*1e3})]}),scope:T,timeZone:o,objectMap:d,unzip:a,supportsType:this.supportsType,iconForType:this.iconForType})})}}on(Lr,"COMPONENT","ConsolePanel");on(Lr,"TITLE","Console");on(Lr,"contextType",jp);var Gf=(n,e)=>({commandHistoryStorage:ms(n),sessionWrapper:nr(n,e.localDashboardId),timeZone:Eh(n),plugins:Th(n)}),Xr=In(Gf,null,null,{forwardRef:!0})(Lr);function vy(n){return n==="file"||n==="directory"}function ft(n){return n.type==="directory"}function qf(n,e,t){return(e=Zf(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Zf(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 Oi extends Error{constructor(){super("No file exists at the path specified"),qf(this,"isFileNotFound",!0)}}function oa(n,e,t,r,i,o,a){try{var s=n[o](a),l=s.value}catch(d){return void t(d)}s.done?e(l):Promise.resolve(l).then(r,i)}function aa(n){return function(){var e=this,t=arguments;return new Promise(function(r,i){var o=n.apply(e,t);function a(l){oa(o,r,i,a,s,"next",l)}function s(l){oa(o,r,i,a,s,"throw",l)}a(void 0)})}}var Mt;(function(n){n.GROOVY="text/x-groovy",n.PLAIN_TEXT="text/plain",n.PYTHON="text/x-python",n.PYTHON_COMPILED="application/x-python-code",n.SCALA="text/x-scala",n.UNKNOWN=""})(Mt||(Mt={}));class M{static fileExists(e,t){return aa(function*(){try{return yield e.info(t),!0}catch(r){if(!(r instanceof Oi))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(!M.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 o=i?"".concat(i,"-copy"):"Copy";return r!==null?"".concat(o,".").concat(r):o}static getUniqueCopyFileName(e,t){return aa(function*(){for(var r=M.getCopyFileName(t);yield M.fileExists(e,r);)r=M.getCopyFileName(r);return r})()}static getMimeType(e){var t=this.getExtension(e).toLowerCase();switch(t){case"groovy":return Mt.GROOVY;case"py":return Mt.PYTHON;case"pyc":return Mt.PYTHON_COMPILED;case"scala":return Mt.SCALA;case"txt":return Mt.PLAIN_TEXT;default:return Mt.UNKNOWN}}static getParent(e){if(!M.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(!M.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,o=M.fileExtensionToString(t);return"".concat(i).concat(o)}static validateName(e){var t=[".",".."],r=/[\\/\0]/g,i=new Map([["\0","null"]]);if(!e)throw new Vn("Name cannot be empty");if(t.includes(e))throw new Vn('"'.concat(e,'" is a reserved name'));if(r.test(e)){var o,a;throw new Vn('Invalid characters in name: "'.concat((o=(a=e.match(r))===null||a===void 0?void 0:a.reduce((s,l)=>s.includes(l)?s:[...s,l],[]).map(s=>i.has(s)?i.get(s):s).join('", "'))!==null&&o!==void 0?o:"",'"'))}}static reducePaths(e){var t=e.filter(r=>M.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 Ii=26;function hi(n){return ft(n)?M.makePath(n.filename):M.getPath(n.filename)}function sa(n,e){if(n.length===0||e==null)throw new Error("No items to move");var t=hi(e);if(n.some(r=>{var{filename:i}=r;return M.getPath(i)===t}))throw new Error("File already in the destination folder");if(n.some(r=>ft(r)&&t.startsWith(M.makePath(r.filename))))throw new Error("Destination folder cannot be a child of a dragged folder");return{files:n,targetPath:t}}function Yf(n){if(ft(n))return n.isExpanded?pd:fd;var e=M.getMimeType(n.basename);switch(e){case Mt.PYTHON:return bd;default:return gd}}function ci(n){var e,{children:t,draggedItems:r,isDragInProgress:i,isDropTargetValid:o,isSelected:a,item:s,itemIndex:l,dropTargetItem:d,onDragStart:h,onDragOver:c,onDragEnd:v,onDrop:p}=n,g=(e=r?.some(N=>N.id===s.id))!==null&&e!==void 0?e:!1,f=hi(s),y=i&&d?hi(d):null,T=i&&o&&ft(s)&&y===f,O=i&&o&&y===f,P=i&&!o&&y===f,F=Yf(s),U=M.getDepth(s.filename),te=Array(U).fill(null).map((N,B)=>u.jsx("span",{className:"file-list-depth-line"},B));return u.jsxs("div",{className:X("d-flex w-100 align-items-center","file-list-item",{"is-dragged":g,"is-exact-drop-target":T,"is-in-drop-target":O,"is-invalid-drop-target":P,"is-selected":a}),onDragStart:N=>h(l,N),onDragOver:N=>c(l,N),onDragEnd:N=>v(l,N),onDrop:N=>p(l,N),draggable:!0,role:"presentation","aria-label":s.basename,children:[te," ",u.jsx(he,{icon:F,className:"item-icon",fixedWidth:!0})," ",u.jsx("span",{className:"truncation-wrapper",children:t??u.jsxs(u.Fragment,{children:[s.basename,u.jsx(ue,{children:s.basename})]})})]})}function la(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function fr(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?la(Object(t),!0).forEach(function(r){Qf(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):la(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function Qf(n,e,t){return(e=Jf(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Jf(n){var e=eg(n,"string");return typeof e=="symbol"?e:e+""}function eg(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 Re=W.module("FileList"),tg=500,da="item-list-scroll-pane";function ng(n){var{isMultiSelect:e=!1,table:t,onFocusChange:r=()=>{},onMove:i,onSelect:o,onSelectionChange:a=()=>{},renderItem:s=ci,rowHeight:l=Ii,overscanCount:d=rt.DEFAULT_OVERSCAN}=n,[h,c]=m.useState(()=>({items:[],offset:0,itemCount:0})),[v,p]=m.useState({top:0,bottom:0}),[g,f]=m.useState(),[y,T]=m.useState(),[O,P]=m.useState(),[F,U]=m.useState([]),te=m.useRef(),N=m.useRef(null),B=m.useRef(null),H=m.useCallback(I=>{if(I.length===0||h==null)return[];for(var Z=[],ae=0;ae<I.length;ae+=1)for(var ce=I[ae],Fe=ce[0];Fe<=ce[1];Fe+=1)Fe>=h.offset&&Fe<h.offset+h.items.length&&Z.push(h.items[Fe-h.offset]);return Z},[h]),J=m.useCallback(I=>{var Z=H([[I,I]]);if(Z.length>0)return Z[0]},[H]),oe=m.useCallback(()=>{var I=ct.count(F);if(I===0)return null;if(I===1){var Z=F[0][0],ae=J(Z);if(ae!=null)return ae.filename}return"".concat(I," items")},[J,F]),L=m.useCallback(I=>{if(!(!y||!g)){Re.debug("dropItems",y,"to",I);try{var{files:Z,targetPath:ae}=sa(y,g);if(i?.(Z,ae),I!=null){var ce;U([[I,I]]),(ce=N.current)===null||ce===void 0||ce.focusItem(I)}}catch(Fe){Re.error("Unable to complete move",Fe)}}},[y,g,i]),q=m.useCallback((I,Z)=>{var ae=h.items[I-h.offset];ae!==void 0&&(Re.debug("handleItemClick",ae),o(ae,Z),ft(ae)&&t?.setExpanded(ae.filename,!ae.isExpanded))},[h,o,t]),K=m.useCallback((I,Z)=>{var ae,ce;Re.debug2("handleItemDragStart",I,F);var Fe=F;ct.isSelected(F,I)||(Fe=[[I,I]],U(Fe)),T(H(Fe)),(ae=N.current)===null||ae===void 0||ae.resetMouseState();var Pt=document.createElement("div"),Tt=document.createElement("div");Tt.className="dnd-placeholder-content",Tt.innerText=(ce=oe())!==null&&ce!==void 0?ce:"",Pt.appendChild(Tt),Pt.className="file-list-dnd-placeholder",document.body.appendChild(Pt),Z.dataTransfer.setDragImage(Pt,0,0),Z.dataTransfer.effectAllowed="move",P(Pt)},[oe,H,F]),j=m.useCallback((I,Z)=>{Z.preventDefault(),Re.debug2("handleItemDragOver",Z),f(J(I))},[J]),V=m.useCallback((I,Z)=>{Re.debug("handleItemDragEnd",I),O?.remove(),T(void 0),f(void 0),P(void 0)},[O]),z=m.useCallback((I,Z)=>{L(I)},[L]),ve=m.useCallback(()=>{Re.debug2("handleItemDragExit"),f(void 0)},[]),Ve=m.useCallback(I=>{I.target instanceof Element&&I.target.classList.contains(da)&&(I.preventDefault(),Re.debug2("handleListDragOver",I),f({type:"directory",filename:"/",basename:"/",id:"/"}))},[]),ke=m.useCallback(I=>{I.target instanceof Element&&I.target.classList.contains(da)&&(Re.debug("handleListDrop"),L())},[L]),b=m.useCallback(function(I){var Z=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(Re.debug2("handleSelectionChange",I),Z===!0||I!==F){U(I);var ae=H(I);a(ae)}},[H,a,F]),w=m.useCallback(I=>{if(Re.debug2("handleFocusChange",I),I!=null){var[Z]=H([[I,I]]);r(Z)}else r();te.current=I},[H,r]),_=m.useCallback((I,Z)=>{Re.debug("handleViewportChange",I,Z),(I!==v.top||Z!==v.bottom)&&p({top:I,bottom:Z})},[v]),G=m.useMemo(()=>{if(!y||!g)return!1;try{return sa(y,g),Re.debug("handleValidateDropTarget true"),!0}catch{return Re.debug("handleValidateDropTarget false"),!1}},[y,g]),{focusedPath:ne}=n;m.useEffect(()=>{ne!==void 0&&(ne==="/"?t.collapseAll():(t.setExpanded(ne,!1),t.setExpanded(ne,!0)))},[t,ne]),m.useEffect(function(){Re.debug("updating table viewport",v),t?.setViewport({top:Math.max(0,v.top-d),bottom:v.bottom+d})},[d,t,v]),m.useEffect(function(){var Z=t.onUpdate(ae=>{c({items:ae.items.map(ce=>fr(fr({},ce),{},{itemName:ce.basename})),offset:ae.offset,itemCount:t.size})});return()=>{Z()}},[t]),m.useEffect(function(){te.current!=null&&w(te.current),F.length>0&&b(F,!0)},[h,w,b,F]),m.useEffect(function(){if(g!=null&&ft(g)&&g.filename!=="/"){var Z=setTimeout(()=>{g.isExpanded||t?.setExpanded(g.filename,!0)},tg);return()=>clearTimeout(Z)}},[g,t]);var it=m.useCallback(I=>s(fr(fr({},I),{},{isDragInProgress:y!=null,dropTargetItem:g,draggedItems:y,isDropTargetValid:G,onDragStart:K,onDragEnd:V,onDragOver:j,onDragExit:ve,onDrop:z})),[V,ve,j,K,z,y,g,G,s]);return u.jsx("div",{ref:B,className:X("file-list",{"is-dragging":y!=null}),onDragOver:Ve,onDrop:ke,children:u.jsx(rt,{ref:N,items:h.items,itemCount:h.itemCount,offset:h.offset,onFocusChange:w,onSelect:q,onSelectionChange:b,onViewportChange:_,selectedRanges:F,renderItem:it,rowHeight:l,isMultiSelect:e,isDragSelect:!1,isDeselectOnClick:!1})})}var rg={DELETE:me.createAndAdd({id:"FILE_EXPLORER.DELETE",name:"Delete",shortcut:[x.DELETE],macShortcut:[A.CMD,x.BACKSPACE]}),RENAME:me.createAndAdd({id:"FILE_EXPLORER.RENAME",name:"Rename",shortcut:[x.ENTER],macShortcut:[x.ENTER]})};const ua={FILE_EXPLORER:rg};var ha=W.module("FileListItemEditor"),ig=()=>Promise.resolve();function og(n){var{item:e,onCancel:t,onSubmit:r,validate:i=ig}=n,o=m.useRef(null),[a,s]=m.useState(e.basename),[l,d]=m.useState(),[h,c]=m.useState(Promise.resolve()),v=m.useCallback(()=>{var O;(O=o.current)===null||O===void 0||O.focus()},[o]),p=m.useCallback(O=>O.stopPropagation(),[]),g=m.useCallback(()=>{h.then(()=>{r(a)}).catch(O=>ha.info("Unable to validate name",O))},[r,a,h]);m.useEffect(function(){var P=Te.makeCancelable(i(a));return P.then(()=>d(void 0)).catch(F=>{Te.isCanceled(F)||d(F)}),c(P),()=>P.cancel()},[i,a]),m.useEffect(function(){v()},[v]);var f=m.useCallback(()=>{ha.debug2("handleBlur"),g()},[g]),y=m.useCallback(O=>{var{value:P}=O.target;s(P)},[]),T=m.useCallback(O=>{O.stopPropagation();var{key:P}=O;switch(P){case"Enter":{g();break}case"Escape":{t();break}}},[t,g]);return u.jsxs("div",{className:"file-list-item-editor",children:[u.jsx("input",{type:"text",className:X("form-control file-list-item-editor-input",{"is-invalid":l}),value:a,ref:o,onBlur:f,onKeyDown:T,onChange:y,onClick:p,onDoubleClick:p,onMouseDown:p}),l&&u.jsx("div",{className:"invalid-feedback",children:"".concat(l)})]})}function ca(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?ca(Object(t),!0).forEach(function(r){ag(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):ca(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function ag(n,e,t){return(e=sg(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function sg(n){var e=lg(n,"string");return typeof e=="symbol"?e:e+""}function lg(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var 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 yl(n){var{isMultiSelect:e=!1,focusedPath:t,showContextMenu:r=!1,onCreateFile:i,onCreateFolder:o,onCopy:a,onDelete:s,onMove:l,onRename:d,onSelect:h,onSelectionChange:c,table:v,rowHeight:p=Ii,validateRename:g=()=>Promise.resolve()}=n,[f,y]=m.useState(),[T,O]=m.useState([]),[P,F]=m.useState(),U=m.useCallback(z=>{O(z),c?.(z)},[c]),te=m.useCallback(z=>{F(z)},[]),N=m.useCallback(()=>{P&&a?.(P)},[P,a]),B=m.useCallback(()=>{T.length>0&&s?.(T)},[s,T]),H=m.useCallback(()=>{i?.()},[i]),J=m.useCallback(()=>{P&&o?.(M.getPath(P.filename))},[P,o]),oe=m.useCallback(()=>{P&&y(P)},[P]),L=m.useCallback(()=>{y(void 0)},[]),q=m.useCallback(z=>{f&&(d?.(f,z),y(void 0))},[d,f]),K=m.useMemo(()=>{if(f)return[];var z=[];return i&&z.push({title:"New File",description:"Create new file",action:H,group:re.groups.medium}),o&&z.push({title:"New Folder",description:"Create new folder",action:J,group:re.groups.medium}),a&&z.push({title:"Copy File",description:"Copy the selected file",action:N,group:re.groups.low,disabled:P==null||ft(P)}),s&&T.length>0&&z.push({title:"Delete",description:"Delete",shortcut:ua.FILE_EXPLORER.DELETE,action:B,group:re.groups.low}),d&&z.push({title:"Rename",description:"Rename",shortcut:ua.FILE_EXPLORER.RENAME,action:oe,group:re.groups.low,disabled:P==null}),z},[N,B,H,J,oe,P,a,i,o,s,d,T,f]),j=m.useCallback(z=>(R(f),g(f,z)),[f,g]),V=m.useCallback(z=>{var{item:ve}=z;return f&&f.filename===ve.filename?u.jsx(ci,Yr(Yr({},z),{},{children:u.jsx(og,{item:ve,validate:j,onSubmit:q,onCancel:L})})):u.jsx(ci,Yr({},z))},[L,q,f,j]);return u.jsxs("div",{className:"file-list-container",children:[v!=null&&u.jsx(ng,{onMove:l,onSelect:h,onSelectionChange:U,onFocusChange:te,renderItem:V,rowHeight:p,table:v,isMultiSelect:e,focusedPath:t}),r&&u.jsx(re,{actions:K})]})}yl.displayName="FileListContainer";function ma(n,e,t){return(e=dg(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function dg(n){var e=ug(n,"string");return typeof e=="symbol"?e:e+""}function ug(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 Vn{constructor(e){super("Name already exists"),ma(this,"isExistingFile",!0),ma(this,"info",void 0),this.info=e}}function va(n,e,t,r,i,o,a){try{var s=n[o](a),l=s.value}catch(d){return void t(d)}s.done?e(l):Promise.resolve(l).then(r,i)}function pa(n){return function(){var e=this,t=arguments;return new Promise(function(r,i){var o=n.apply(e,t);function a(l){va(o,r,i,a,s,"next",l)}function s(l){va(o,r,i,a,s,"throw",l)}a(void 0)})}}var bt=W.module("FileExplorer");function Di(n){var{storage:e,isMultiSelect:t=!1,focusedPath:r,onCopy:i=()=>{},onDelete:o=()=>{},onRename:a=()=>{},onCreateFile:s=()=>{},onCreateFolder:l=()=>{},onSelect:d,onSelectionChange:h,rowHeight:c=Ii}=n,[v,p]=m.useState([]),[g,f]=m.useState();m.useEffect(function(){var q;function K(){return j.apply(this,arguments)}function j(){return j=pa(function*(){bt.debug("initTable"),q=Te.makeCancelable(e.getTable(),V=>V.close());try{f(yield q)}catch(V){Te.isCanceled(V)||bt.error("Unable to initialize table",V)}}),j.apply(this,arguments)}return K(),()=>{q.cancel()}},[e]);var y=m.useCallback(L=>{Te.isCanceled(L)||bt.error(L)},[]),T=m.useCallback(()=>{bt.debug("handleCreateFile"),s()},[s]),O=m.useCallback(()=>{bt.debug("handleCreateFolder"),l()},[l]),P=m.useCallback(L=>{bt.debug("handleCopyFile",L.filename),i(L)},[i]),F=m.useCallback(L=>{bt.debug("handleDelete, pending confirmation",L),p(L)},[]),U=m.useCallback(()=>{bt.debug("handleDeleteConfirm",v),v.forEach(L=>e.deleteFile(ft(L)?M.makePath(L.filename):L.filename)),o(v),p([])},[v,o,e]),te=m.useCallback(()=>{bt.debug("handleDeleteCancel"),p([])},[]),N=m.useCallback((L,q)=>{var K=M.reducePaths(L.map(j=>ft(j)?M.makePath(j.filename):j.filename));K.forEach(j=>{var V=M.isPath(j)?"".concat(q).concat(M.getBaseName(j.substring(0,j.length-1)),"/"):"".concat(q).concat(M.getBaseName(j));e.moveFile(j,V).then(()=>{a(j,V)}).catch(y)})},[y,a,e]),B=m.useCallback((L,q)=>{var K=L.filename,j=ft(L);j&&!K.endsWith("/")&&(K="".concat(K,"/"));var V="".concat(M.getParent(K)).concat(q);j&&!V.endsWith("/")&&(V="".concat(V,"/")),bt.debug2("handleRename",K,V),e.moveFile(K,V).catch(y),a(K,V)},[y,a,e]),H=m.useCallback(function(){var L=pa(function*(q,K){if(K!==q.basename){M.validateName(K);var j="".concat(M.getPath(q.filename)).concat(K);try{var V=yield e.info(j);throw new br(V)}catch(z){if(!(z instanceof Oi))throw z}}});return function(q,K){return L.apply(this,arguments)}}(),[e]),J=v.length>0,oe=m.useMemo(()=>v.length===1?'Are you sure you want to delete "'.concat(v[0].filename,'"?'):"Are you sure you want to delete the selected files?",[v]);return u.jsxs("div",{className:"file-explorer",children:[g&&u.jsx(yl,{isMultiSelect:t,focusedPath:r,showContextMenu:!0,onCopy:P,onCreateFolder:O,onCreateFile:T,onMove:N,onDelete:F,onRename:B,onSelect:d,onSelectionChange:h,rowHeight:c,table:g,validateRename:H}),u.jsx(an,{isOpen:J,headerText:oe,bodyText:"You cannot undo this action.",onCancel:te,onConfirm:U,confirmButtonText:"Delete"})]})}Di.displayName="FileExplorer";function fa(n,e,t,r,i,o,a){try{var s=n[o](a),l=s.value}catch(d){return void t(d)}s.done?e(l):Promise.resolve(l).then(r,i)}function hg(n){return function(){var e=this,t=arguments;return new Promise(function(r,i){var o=n.apply(e,t);function a(l){fa(o,r,i,a,s,"next",l)}function s(l){fa(o,r,i,a,s,"throw",l)}a(void 0)})}}function Wt(n,e,t){return(e=cg(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function cg(n){var e=mg(n,"string");return typeof e=="symbol"?e:e+""}function mg(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var 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=W.module("NewItemModal");class Zt extends m.PureComponent{static getValidationMessage(e){return e instanceof br&&e.info.type==="directory"?"Error: Cannot overwrite existing directory":"".concat(e)}static handleError(e){Te.isCanceled(e)||Jt.error(e)}constructor(e){super(e),Wt(this,"inputRef",$.createRef()),Wt(this,"cancelableValidatePromise",void 0),Wt(this,"cancelableExistingItemPromise",void 0),Wt(this,"pending",new Dn),Wt(this,"pathMap",new Map),Wt(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=M.hasPath(t)?M.getPath(t):"/";this.state={isSubmitting:!1,path:r,prevExtension:M.getExtension(t),showExtensionChangeModal:!1,showOverwriteModal:!1,value:M.getBaseName(t)}}componentDidUpdate(e,t){var{isOpen:r}=this.props,{isOpen:i}=e,{value:o,path:a}=this.state;!i&&r&&(this.resetValue(),this.isInitialLoad=!0),i&&r&&(!this.isInitialLoad&&(a!==t.path||o!==t.value)&&this.updateValidationStatus(a,o),this.isInitialLoad=!1)}componentWillUnmount(){this.pending.cancel(),this.cancelableValidatePromise&&this.cancelableValidatePromise.cancel(),this.cancelableExistingItemPromise&&this.cancelableExistingItemPromise.cancel()}resetValue(){var{defaultValue:e}=this.props,t=M.hasPath(e)?M.getPath(e):"/";this.setState({path:t,value:M.getBaseName(e),validationError:void 0,prevExtension:M.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=Te.makeCancelable(this.validateName(e,t,r)),this.cancelableValidatePromise}validateName(e,t,r){var i=this;return hg(function*(){M.validateName(t);var{defaultValue:o,storage:a}=i.props;if(r){var s="".concat(e).concat(t);if(s!==o)try{var l=yield a.info(s);throw new br(l)}catch(d){if(!(d instanceof Oi))throw d}}return t})()}updateValidationStatus(e,t){this.getValidationPromise(e,t).then(()=>{this.setState({validationError:void 0})}).catch(this.handleValidationError).catch(Zt.handleError)}handleModalOpened(){this.focusRenameInput()}handleModalSubmit(){this.submitModal()}handleChange(e){var{value:t}=e.target;this.setState({value:t})}handleSelect(e){if(Jt.debug("handleSelect",e),e.type==="directory")this.setState({path:M.makePath(e.filename)});else{var t=e.basename,r=M.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 Vn))throw e;Jt.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;Jt.debug("handleOverwriteConfirm",t,r),e("".concat(t).concat(r),!0)}handleExtensionChangeCancel(){Jt.debug("handleExtensionChangeCancel"),this.setState(e=>{var{value:t,prevExtension:r}=e,i=M.replaceExtension(t,r);return{showExtensionChangeModal:!1,value:i}}),this.submitModal(!0)}handleExtensionChangeConfirm(){Jt.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:o}=t,{notifyOnExtensionChange:a,type:s}=this.props;Jt.debug("submitModal",r,i);var l=M.getExtension(i);return a&&!e&&r!==null&&r!==l?{isSubmitting:!1,showExtensionChangeModal:!0,newExtension:l}:(this.getValidationPromise(o,i,!0).then(d=>{var{onSubmit:h}=this.props;h("".concat(o).concat(i))}).catch(d=>{if(d instanceof br&&s!=="directory"&&d.info.type!=="directory"){this.setState({showOverwriteModal:!0});return}throw d}).catch(d=>{throw Te.isCanceled(d)&&this.setState({isSubmitting:!1}),d}).catch(this.handleValidationError).catch(Zt.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 o="",a=0;a<i;a+=1)o+="".concat(t[a],"/");return o+="".concat(r,"/"),u.jsxs($.Fragment,{children:[u.jsx(ee,{kind:"ghost",className:"directory-breadcrumbs",onClick:()=>this.handleBreadcrumbSelect(o),"aria-label":i===0?"Home":void 0,icon:i===0?u.jsx(he,{icon:yd,transform:"right-1.6"}):void 0,tooltip:i===0?"Home":void 0,children:r}),"/"]},o)})}render(){var{storage:e,isOpen:t,onCancel:r,placeholder:i,title:o,type:a}=this.props,{isSubmitting:s,path:l,showExtensionChangeModal:d,showOverwriteModal:h,validationError:c,value:v,prevExtension:p,newExtension:g}=this.state,f=a==="directory",y=M.fileExtensionToString(p),T=M.fileExtensionToString(g),O=f?"Create":"Save",P=f?"New folder name":"Save file as";return u.jsxs(u.Fragment,{children:[u.jsxs(Ma,{isOpen:t,toggle:r,onOpened:this.handleModalOpened,className:"modal-dialog-centered new-file-modal",children:[u.jsx(ka,{toggle:r,children:o}),u.jsx(Na,{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:P}),u.jsx("input",{id:"file-name-input",type:"text",autoComplete:"off",autoCapitalize:"none",autoCorrect:"off",spellCheck:"false",className:X("form-control",{"is-invalid":c}),value:v,placeholder:i,ref:this.inputRef,onKeyDown:this.handleKeyDown,onChange:this.handleChange}),c&&u.jsx("div",{className:"invalid-feedback",children:Zt.getValidationMessage(c)})]}),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(Di,{onSelect:this.handleSelect,storage:e,focusedPath:l})})]})})}),u.jsxs(rs,{children:[u.jsx(ee,{kind:"secondary",onClick:r,children:"Cancel"}),u.jsx(ee,{kind:"primary",disabled:s,onClick:this.handleModalSubmit,children:O})]})]}),u.jsx(an,{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(an,{isOpen:d,headerText:"Confirm extension change",bodyText:'Are you sure you want to change extension from "'.concat(y,'" to "').concat(T,'"?'),onCancel:this.handleExtensionChangeCancel,onConfirm:this.handleExtensionChangeConfirm,cancelButtonText:'Keep "'.concat(y,'"'),confirmButtonText:'Use "'.concat(T,'"')})]})}}Wt(Zt,"propTypes",{isOpen:S.bool,title:S.string.isRequired,defaultValue:S.string,type:S.oneOf(["file","directory"]).isRequired,onSubmit:S.func,onCancel:S.func,placeholder:S.string,storage:S.shape({}).isRequired,notifyOnExtensionChange:S.bool});Wt(Zt,"defaultProps",{isOpen:!1,defaultValue:"/",notifyOnExtensionChange:!1,placeholder:"",onSubmit:(n,e)=>{},onCancel:()=>{}});function vg(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(ee,{kind:"ghost",icon:Ka,tooltip:"New notebook",onClick:e,"aria-label":"New notebook"}),u.jsx(ee,{kind:"ghost",icon:Cd,tooltip:"New folder",onClick:t,"aria-label":"New folder"})]}),r&&u.jsx("div",{className:"file-explorer-toolbar-search",children:u.jsx(ss,{value:i,onChange:r,placeholder:"Search by name"})})]})}function ga(n,e,t,r,i,o,a){try{var s=n[o](a),l=s.value}catch(d){return void t(d)}s.done?e(l):Promise.resolve(l).then(r,i)}function pg(n){return function(){var e=this,t=arguments;return new Promise(function(r,i){var o=n.apply(e,t);function a(l){ga(o,r,i,a,s,"next",l)}function s(l){ga(o,r,i,a,s,"throw",l)}a(void 0)})}}function Cl(n,e,t){return(e=fg(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function fg(n){var e=gg(n,"string");return typeof e=="symbol"?e:e+""}function gg(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 en=W.module("FileExplorerPanel"),bg=(n,e)=>{var t=vs(n),r=nr(n,e.localDashboardId),{session:i,config:o}=r??{},a=o?.type;return{fileStorage:t,language:a,session:i}},yg=In(bg,null,null,{forwardRef:!0});function Cg(n){var e=n;return e!=null&&typeof e.button=="number"}class On extends $.Component{static handleError(e){en.error(e)}static isFocusEvent(e){return Cg(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:""};en.debug("handleCreateFile",t,r,i),e.emit(Q.CREATE_NOTEBOOK,t,r,i)}handleCreateDirectory(){this.setState({showCreateFolder:!0})}handleCreateDirectoryCancel(){en.debug("handleCreateDirectoryCancel"),this.setState({showCreateFolder:!1})}handleCreateDirectorySubmit(e){en.debug("handleCreateDirectorySubmit",e),this.setState({showCreateFolder:!1});var{fileStorage:t}=this.props;t.createDirectory(e).catch(On.handleError)}handleCopyFile(e){var t=this;return pg(function*(){var{fileStorage:r}=t.props;if(ft(e)){en.error("Invalid item in handleCopyItem",e);return}var i=yield M.getUniqueCopyFileName(r,e.filename);yield r.copyFile(e.filename,i)})()}handleDelete(e){var{glEventHub:t}=this.props;e.forEach(r=>{t.emit(Q.CLOSE_FILE,{id:r.filename,itemName:r.filename})})}handleSelectionChange(e){var t="/";e.length===1&&(e[0].type==="directory"?t=M.makePath(e[0].filename):t=M.getPath(e[0].filename)),this.setState({focusedFilePath:t})}handleFileSelect(e,t){if(en.debug("fileSelect",e),e.type!=="directory"){var r=On.isFocusEvent(t),i={id:e.filename,itemName:e.filename},{glEventHub:o}=this.props,{session:a,language:s}=this.state,l={value:null,language:s};o.emit(Q.SELECT_NOTEBOOK,a,s,l,i,r)}}handleRename(e,t){var{glEventHub:r}=this.props;en.debug("handleRename",e,t),r.emit(Q.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:o,focusedFilePath:a}=this.state;return u.jsxs(kn,{className:"file-explorer-panel",componentPanel:this,glContainer:t,glEventHub:r,onSessionOpen:this.handleSessionOpened,onSessionClose:this.handleSessionClosed,onShow:this.handleShow,children:[u.jsx(vg,{createFile:this.handleCreateFile,createFolder:this.handleCreateDirectory}),i&&u.jsx(Di,{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(Zt,{isOpen:o,type:"directory",title:"Create New Folder",storage:e,onSubmit:this.handleCreateDirectorySubmit,onCancel:this.handleCreateDirectoryCancel,defaultValue:a})]})}}Cl(On,"COMPONENT","FileExplorerPanel");Cl(On,"TITLE","File Explorer");var Sg=yg(On);function Zn(n,e,t){return(e=wg(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function wg(n){var e=Eg(n,"string");return typeof e=="symbol"?e:e+""}function Eg(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 ba=W.module("LogPanel");class Fr extends m.PureComponent{constructor(e){super(e),Zn(this,"isBottomVisible",void 0),Zn(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){ba.debug("Session opened",[e]),this.setState({session:e})}handleSessionClosed(e){ba.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(kn,{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(ye,{session:r,ref:i=>{this.logView=i}})]})}}Zn(Fr,"defaultProps",{session:null});Zn(Fr,"COMPONENT","LogPanel");Zn(Fr,"TITLE","Log");var Pg=(n,e)=>{var t;return{session:(t=nr(n,e.localDashboardId))===null||t===void 0?void 0:t.session}},Tg=In(Pg,null,null,{forwardRef:!0})(Fr);function ya(n,e,t,r,i,o,a){try{var s=n[o](a),l=s.value}catch(d){return void t(d)}s.done?e(l):Promise.resolve(l).then(r,i)}function Ca(n){return function(){var e=this,t=arguments;return new Promise(function(r,i){var o=n.apply(e,t);function a(l){ya(o,r,i,a,s,"next",l)}function s(l){ya(o,r,i,a,s,"throw",l)}a(void 0)})}}function Sa(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 Ge(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Sa(Object(t),!0).forEach(function(r){Ae(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Sa(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function Ae(n,e,t){return(e=_g(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function _g(n){var e=Og(n,"string");return typeof e=="symbol"?e:e+""}function Og(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 Ig=m.lazy(()=>za(()=>import("./MarkdownNotebook-BxXofSyL.js"),__vite__mapDeps([6,4,3,5,7,8,9,10,11,12]),import.meta.url)),de=W.module("NotebookPanel"),wa=400;class Oe extends m.Component{static handleError(e){Te.isCanceled(e)||de.error(e)}static unsavedNotebookCount(){return document.querySelectorAll(".".concat(Oe.UNSAVED_INDICATOR_CLASS_NAME,".").concat(Oe.UNSAVED_STATUS_CLASS_NAME)).length}static languageFromFileName(e){var t=M.getExtension(e).toLowerCase();switch(t){case"py":case"python":return"python";case"groovy":return"groovy";case"scala":return"scala";default:return null}}constructor(e){super(e),Ae(this,"pending",void 0),Ae(this,"debouncedSavePanelState",void 0),Ae(this,"debouncedLoad",void 0),Ae(this,"notebook",void 0),Ae(this,"tabTitleElement",void 0),Ae(this,"tabInitOnce",void 0),Ae(this,"editor",void 0),Ae(this,"getSettings",wt((v,p)=>Ge(Ge({},v),{},{minimap:{enabled:p}}))),Ae(this,"getOverflowActions",wt((v,p)=>[{title:"Find",icon:Ed,action:this.handleFind,group:re.groups.high,shortcut:Be.NOTEBOOK.FIND,order:10},{title:"Copy File",icon:ja,action:this.handleCopy,group:re.groups.medium,order:20},{title:"Rename File",icon:Pd,action:this.handleShowRename,group:re.groups.medium,order:30},{title:"Delete File",icon:Ba,action:this.handleDelete,group:re.groups.medium,order:40},{title:"Show Minimap",icon:v?Un:void 0,action:this.handleMinimapChange,group:re.groups.low,shortcut:Be.NOTEBOOK.MINIMAP,order:20},{title:"Word Wrap",icon:p?Un:void 0,action:this.handleWordWrapChange,group:re.groups.low,shortcut:Be.NOTEBOOK.WORDWRAP,order:30}])),this.handleCloseCancel=this.handleCloseCancel.bind(this),this.handleCloseDiscard=this.handleCloseDiscard.bind(this),this.handleCloseSave=this.handleCloseSave.bind(this),this.handleCopy=this.handleCopy.bind(this),this.handleDelete=this.handleDelete.bind(this),this.handleDeleteConfirm=this.handleDeleteConfirm.bind(this),this.handleDeleteCancel=this.handleDeleteCancel.bind(this),this.handleEditorInitialized=this.handleEditorInitialized.bind(this),this.handleEditorWillDestroy=this.handleEditorWillDestroy.bind(this),this.handleEditorChange=this.handleEditorChange.bind(this),this.handleFind=this.handleFind.bind(this),this.handleMinimapChange=this.handleMinimapChange.bind(this),this.handleWordWrapChange=this.handleWordWrapChange.bind(this),this.handleLinkClick=this.handleLinkClick.bind(this),this.handleLoadSuccess=this.handleLoadSuccess.bind(this),this.handleLoadError=this.handleLoadError.bind(this),this.handlePanelDropped=this.handlePanelDropped.bind(this),this.handleRenameFile=this.handleRenameFile.bind(this),this.handleResize=this.handleResize.bind(this),this.handleRunCommand=this.handleRunCommand.bind(this),this.handleRunAll=this.handleRunAll.bind(this),this.handleRunSelected=this.handleRunSelected.bind(this),this.handleSave=this.handleSave.bind(this),this.handleSaveAsCancel=this.handleSaveAsCancel.bind(this),this.handleSaveAsSubmit=this.handleSaveAsSubmit.bind(this),this.handleSaveError=this.handleSaveError.bind(this),this.handleSaveSuccess=this.handleSaveSuccess.bind(this),this.handleSessionOpened=this.handleSessionOpened.bind(this),this.handleSessionClosed=this.handleSessionClosed.bind(this),this.handleShow=this.handleShow.bind(this),this.handleShowRename=this.handleShowRename.bind(this),this.handleTab=this.handleTab.bind(this),this.handleTabBlur=this.handleTabBlur.bind(this),this.handleTabClick=this.handleTabClick.bind(this),this.handleTabFocus=this.handleTabFocus.bind(this),this.handleTransformLinkUri=this.handleTransformLinkUri.bind(this),this.handleOverwrite=this.handleOverwrite.bind(this),this.handlePreviewPromotion=this.handlePreviewPromotion.bind(this),this.getDropdownOverflowActions=this.getDropdownOverflowActions.bind(this),this.pending=new Dn,this.debouncedSavePanelState=Sn(this.savePanelState.bind(this),wa),this.debouncedLoad=Sn(this.load.bind(this),wa),this.notebook=null,this.tabTitleElement=null,this.tabInitOnce=!1;var{isDashboardActive:t,session:r,sessionLanguage:i,panelState:o}=e,a={value:"",language:"",wordWrap:"off"},s=null,{isPreview:l}=e;o!=null&&({fileMetadata:s=s,isPreview:l=l,settings:a=a}=o);var d=s!=null&&M.hasPath(s.itemName),h=d===!0&&a.value!=null||!d&&a.value!=null&&a.value.length>0,c=h?1:0;this.state={error:void 0,isDashboardActive:t,isLoading:!0,isLoaded:!1,isPreview:l,savedChangeCount:0,changeCount:c,fileMetadata:s,settings:a,session:r,sessionLanguage:i,panelState:{fileMetadata:s,settings:a},showCloseModal:!1,showDeleteModal:!1,showSaveAsModal:!1,scriptCode:""},de.debug("constructor",e,this.state)}componentDidMount(){var{glContainer:e,glEventHub:t}=this.props,{tab:r}=e;r!=null&&this.initTab(r),this.initNotebookContent(),t.on(Q.RENAME_FILE,this.handleRenameFile),t.on(ie.DROPPED,this.handlePanelDropped),e.on(Q.PROMOTE_FROM_PREVIEW,this.handlePreviewPromotion)}componentDidUpdate(e,t){var{isPreview:r,settings:i}=this.state,{wordWrap:o}=i,{defaultNotebookSettings:a}=this.props;r!==t.isPreview&&this.setPreviewStatus(),o!==t.settings.wordWrap&&(this.updateEditorWordWrap(),this.debouncedSavePanelState()),a.isMinimapEnabled!==e.defaultNotebookSettings.isMinimapEnabled&&this.updateEditorMinimap()}componentWillUnmount(){this.debouncedSavePanelState.flush(),this.pending.cancel();var{glEventHub:e,glContainer:t}=this.props,{fileMetadata:r,isPreview:i}=this.state;e.off(Q.RENAME_FILE,this.handleRenameFile),e.off(ie.DROPPED,this.handlePanelDropped),t.off(Q.PROMOTE_FROM_PREVIEW,this.handlePreviewPromotion),e.emit(Q.UNREGISTER_FILE,r,i)}initTab(e){this.tabInitOnce||(this.tabInitOnce=!0,this.initTabCloseOverride()),this.initTabClasses(e)}initTabCloseOverride(){var{glContainer:e}=this.props;e.beforeClose(t=>{if(t?.force===!0)return!0;var{changeCount:r,savedChangeCount:i}=this.state;return r!==i?(this.setState({showCloseModal:!0}),!1):!0})}initTabClasses(e){var t=e.element.get(0);R(t);var r=t.querySelector(".lm_title");this.tabTitleElement=r,r?.classList.add("notebook-title"),this.setPreviewStatus()}getNotebookValue(){var{changeCount:e,savedChangeCount:t,settings:r}=this.state,{value:i}=r;if(e!==t&&this.notebook){var o=this.notebook.getValue();return o??i}return i}initNotebookContent(){var{fileMetadata:e,settings:t,isPreview:r}=this.state;if(e&&e.id){de.debug("Init content from file"),this.registerFileMetadata(e,r),this.load();return}if(t.value!=null){de.debug("Use content passed in the settings prop"),this.handleLoadSuccess();return}this.handleLoadError(new Error("Missing file metadata"))}closeFileTabById(e){var{glEventHub:t}=this.props;t.emit(Q.CLOSE_FILE,{id:e})}registerFileMetadata(e,t){var{glEventHub:r,metadata:i}=this.props,{id:o}=i;r.emit(Q.REGISTER_FILE,o,e,t)}renameTab(e,t){var{glEventHub:r}=this.props;r.emit(Q.RENAME,e,t)}load(){var{fileMetadata:e,settings:t}=this.state;R(e);var{id:r}=e,{fileStorage:i}=this.props;this.pending.add(i.loadFile(r)).then(o=>{var a;de.debug("Loaded file",o);var{filename:s}=o,{itemName:l}=this.state;if(s!==l){var{metadata:d}=this.props,{id:h}=d;this.renameTab(h,M.getBaseName(s))}var c=Ge(Ge({},t),{},{language:(a=Oe.languageFromFileName(s))!==null&&a!==void 0?a:""});t.value==null&&(c.value=o.content),t.wordWrap===void 0&&(t.wordWrap="off"),this.setState({fileMetadata:{id:s,itemName:s},settings:c}),this.debouncedSavePanelState()}).then(this.handleLoadSuccess).catch(this.handleLoadError)}save(){var{fileMetadata:e}=this.state;if(e&&M.hasPath(e.itemName)){var t=this.getNotebookValue();return t!==void 0?(this.saveContent(e.itemName,t),!0):!1}return this.setState({showSaveAsModal:!0}),!1}saveContent(e,t){de.debug("saveContent",e,t),this.updateSavedChangeCount();var{fileStorage:r}=this.props;this.pending.add(r.saveFile({filename:e,content:t,basename:e})).then(this.handleSaveSuccess).catch(this.handleSaveError)}updateSavedChangeCount(){this.setState(e=>{var{changeCount:t}=e;return{savedChangeCount:t}})}setPreviewStatus(){if(this.tabTitleElement){var{isPreview:e}=this.state;de.debug("setPreviewStatus",this.tabTitleElement,e),e?this.tabTitleElement.classList.add("is-preview"):this.tabTitleElement.classList.remove("is-preview")}}handlePreviewPromotion(){this.removePreviewStatus()}savePanelState(){this.setState(e=>{var{changeCount:t,savedChangeCount:r,fileMetadata:i,isPreview:o,settings:a}=e,s=this.getNotebookValue(),l=t!==r?s:void 0,d=Ge(Ge({},a),{},{value:s}),h=Ge(Ge({},a),{},{value:l}),c={settings:h,fileMetadata:i,isPreview:o};return de.debug("Saving panel state",c),{settings:d,panelState:c}})}handleCloseDiscard(){this.setState({showCloseModal:!1});var{glContainer:e}=this.props;e.close({force:!0})}handleCloseSave(){if(this.setState({showCloseModal:!1}),this.save()){var{glContainer:e}=this.props;e.close({force:!0})}}handleCloseCancel(){this.setState({showCloseModal:!1})}handleOverwrite(e){var{glEventHub:t}=this.props;t.emit(Q.CLOSE_FILE,{id:e,itemName:e},{force:!0}),this.focus()}handleCopy(){var e=this;return Ca(function*(){var{fileStorage:t,glEventHub:r,session:i}=e.props,{fileMetadata:o,settings:a}=e.state;R(o);var{language:s}=a,{itemName:l}=o,d=yield M.getUniqueCopyFileName(t,l);de.debug("handleCopy",o,l,d),yield t.copyFile(l,d);var h={id:d,itemName:d},c={value:null,language:s};r.emit(Q.SELECT_NOTEBOOK,i,s,c,h,!0)})()}handleDelete(){de.debug("handleDelete, pending confirmation"),this.setState({showDeleteModal:!0})}handleDeleteConfirm(){var e=this;return Ca(function*(){var{fileStorage:t,glContainer:r,glEventHub:i}=e.props,{fileMetadata:o}=e.state;de.debug("handleDeleteConfirm",o?.itemName),e.setState({showDeleteModal:!1}),o&&(M.hasPath(o.itemName)&&(yield M.fileExists(t,o.itemName))?(i.emit(Q.CLOSE_FILE,o,{force:!0}),t.deleteFile(o.itemName)):r.close({force:!0}))})()}handleDeleteCancel(){this.setState({showDeleteModal:!1})}handleEditorInitialized(e){this.editor=e}handleEditorWillDestroy(){this.editor=void 0}handleEditorChange(e){de.debug2("handleEditorChanged",e),this.removePreviewStatus(),this.setState(t=>{var{changeCount:r,savedChangeCount:i}=t,{isUndoing:o,isRedoing:a}=e;return o?{changeCount:r-1,savedChangeCount:i}:!a&&r<i?{changeCount:r+1,savedChangeCount:0}:{changeCount:r+1,savedChangeCount:i}}),this.debouncedSavePanelState()}handleFind(){this.notebook&&this.notebook.toggleFind()}updateEditorMinimap(){if(this.editor){var{defaultNotebookSettings:e}=this.props;this.editor.updateOptions({minimap:{enabled:e.isMinimapEnabled}})}}handleMinimapChange(){var e,{defaultNotebookSettings:t,updateSettings:r}=this.props,i={defaultNotebookSettings:{isMinimapEnabled:!((e=t.isMinimapEnabled)!==null&&e!==void 0&&e)}};r(i)}updateEditorWordWrap(){if(this.editor){var{settings:e}=this.state,{wordWrap:t}=e;this.editor.updateOptions({wordWrap:t})}}handleWordWrapChange(){this.editor&&this.setState(e=>{var{settings:t}=e,r=t.wordWrap==="on"?"off":"on";return{settings:Ge(Ge({},t),{},{wordWrap:r})}})}handleLinkClick(e){var{notebooksUrl:t,session:r,sessionLanguage:i}=this.props,{href:o}=e.currentTarget;if(!(!o||!o.startsWith(t))){e.stopPropagation(),e.preventDefault();var a="/".concat(o.substring(t.length)).replace(/%20/g," ");if(a==="/"){de.debug("Ignoring invalid notebook link",a);return}de.debug("Notebook link clicked, opening",a);var{glEventHub:s}=this.props,l={value:null,language:i},d={id:a,itemName:a};s.emit(Q.SELECT_NOTEBOOK,r,i,l,d)}}handleLoadSuccess(){this.setState({error:void 0,isLoaded:!0,isLoading:!1})}handleLoadError(e){var t=e;Te.isCanceled(t)||(Te.isTimedOut(t)&&(t=new Error("File not found.")),de.error(t),this.setState({error:t,isLoading:!1}))}handleSave(){de.debug("handleSave"),this.save()}handleSaveSuccess(e){var t,{fileStorage:r}=this.props,i={id:e.filename,itemName:e.filename},o=(t=Oe.languageFromFileName(e.filename))!==null&&t!==void 0?t:"";this.setState(a=>{var{fileMetadata:s}=a,l=Ge(Ge({},a.settings),{},{language:o});return de.debug("handleSaveSuccess",i,s,l),s&&M.hasPath(s.itemName)&&s.itemName!==i.itemName&&(de.debug("handleSaveSuccess deleting old file",s.itemName),r.deleteFile(s.itemName).catch(Oe.handleError)),{fileMetadata:i,settings:l,isPreview:!1}}),this.debouncedSavePanelState(),this.registerFileMetadata(i,!1)}handleSaveError(e){Te.isCanceled(e)||(this.setState({savedChangeCount:0}),de.error(e))}handleSaveAsCancel(){this.setState({showSaveAsModal:!1})}handleSaveAsSubmit(e){var t,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;r&&this.handleOverwrite(e),de.debug("handleSaveAsSubmit",e);var{fileMetadata:i}=this.state;if(i){var{itemName:o}=i,a=(t=this.getNotebookValue())!==null&&t!==void 0?t:"";if(this.setState({showSaveAsModal:!1}),M.getBaseName(o)!==M.getBaseName(e)){var{metadata:s}=this.props,{id:l}=s;this.renameTab(l,M.getBaseName(e))}this.saveContent(e,a)}}handleRenameFile(e,t,r){var{fileMetadata:i,panelState:o}=this.state,{glContainer:a}=this.props;if(i?.itemName==="/".concat(t)&&r&&JSON.stringify(o)!==JSON.stringify(r)){a.close();return}i&&i.id===e&&(this.setState({fileMetadata:{id:t,itemName:t}}),this.debouncedSavePanelState())}handleResize(){var e;(e=this.notebook)===null||e===void 0||e.updateDimensions()}handleRunCommand(e){this.runCommand(e)}handleRunAll(){var e;if(!this.notebook){de.error("Editor is not initialized.");return}this.runCommand((e=this.notebook.getValue())!==null&&e!==void 0?e:void 0)}handleRunSelected(){if(!this.notebook){de.error("Editor is not initialized.");return}this.runCommand(this.notebook.getSelectedCommand())}handleSessionOpened(e,t){var{language:r}=t;this.setState({session:e,sessionLanguage:r})}handleSessionClosed(){this.setState({session:void 0,sessionLanguage:void 0})}handleShow(){var e;de.debug("handleShow"),(e=this.notebook)===null||e===void 0||e.updateDimensions()}handlePanelDropped(e){var{metadata:{id:t}}=this.props;e===t&&this.forceUpdate()}handleShowRename(){this.setState({showSaveAsModal:!0})}handleTab(e){de.debug("NotebookPanel tab event",e),this.initTab(e)}handleTabFocus(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];de.debug("handleTabFocus",...t);var{glContainer:i}=this.props;this.setState({isDashboardActive:!0}),this.notebook&&!i.isHidden&&this.notebook.updateDimensions()}handleTabBlur(){de.debug("handleTabBlur"),this.setState({isDashboardActive:!1})}handleTabClick(e){de.debug("handle NotebookPanel tab click"),this.focus(),e.detail===2&&this.removePreviewStatus()}handleTransformLinkUri(e){var{notebooksUrl:t}=this.props,{fileMetadata:r}=this.state;if(e.endsWith("/"))return e;if(e.startsWith("/"))return"".concat(t).concat(e.substring(1));var i=r?.itemName;if(i===void 0)return e;i.charAt(0)==="/"&&(i=i.substring(1));var o=new URL(i,t);return new URL(e,o).href}focus(){requestAnimationFrame(()=>{this.notebook&&this.notebook.focus()})}createNotebook(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"",{glEventHub:i}=this.props,{session:o,sessionLanguage:a,settings:s}=this.state,l=Ge(Ge({},s),{},{language:t,value:r}),d={id:null,itemName:e};de.debug("handleCreateNotebook",o,a,l,d),i.emit(Q.CREATE_NOTEBOOK,o,a,l,d)}runCommand(e){if(e===void 0||e===""){de.debug("Ignoring empty command.");return}this.removePreviewStatus();var{glEventHub:t}=this.props;t.emit(Me.SEND_COMMAND,e,!1,!0)}removePreviewStatus(){this.setState(e=>{var{isPreview:t}=e;if(t){var{fileMetadata:r}=this.state;return r&&this.registerFileMetadata(r,!1),{isPreview:!1}}return null})}getDropdownOverflowActions(){var e,t,{defaultNotebookSettings:r}=this.props,{settings:i}=this.state;return this.getOverflowActions((e=r.isMinimapEnabled)!==null&&e!==void 0?e:!1,this.getSettings(i,(t=r.isMinimapEnabled)!==null&&t!==void 0?t:!1).wordWrap==="on")}render(){var e,t,r,{fileStorage:i,glContainer:o,glContainer:{tab:a},glEventHub:s,defaultNotebookSettings:l}=this.props,{changeCount:d,savedChangeCount:h,error:c,isDashboardActive:v,isLoaded:p,isLoading:g,isPreview:f,fileMetadata:y,session:T,sessionLanguage:O,settings:P,showCloseModal:F,showDeleteModal:U,showSaveAsModal:te}=this.state,N=v&&!o.isHidden&&!f,B=(e=y?.itemName)!==null&&e!==void 0?e:Oe.DEFAULT_NAME,H=B.endsWith(".md"),J=y?.id!=null,oe=this.getSettings(P,(t=l.isMinimapEnabled)!==null&&t!==void 0?t:!1),L=T!=null,q=O===oe.language,K=!p||!L||!q,j=!p,V=[{action:this.handleSave,shortcut:Kt.SAVE},{action:this.handleMinimapChange,shortcut:Be.NOTEBOOK.MINIMAP},{action:this.handleWordWrapChange,shortcut:Be.NOTEBOOK.WORDWRAP}],z=ri.getDisabledRunTooltip(L,q,"Notebook extension","Run"),ve=ri.getDisabledRunTooltip(L,q,"Notebook extension","Run Selected"),Ve=[{title:J?"Rename":"Save As…",order:10,group:re.groups.high,action:this.handleShowRename},{title:"Copy File",action:this.handleCopy,group:re.groups.high,order:20}],ke=a?.element.find(".lm_title_before").get(0);return u.jsxs(u.Fragment,{children:[ke!=null&&Dr.createPortal(u.jsx("span",{className:X(Oe.UNSAVED_INDICATOR_CLASS_NAME,{[Oe.UNSAVED_STATUS_CLASS_NAME]:d!==h})}),ke),u.jsxs(kn,{className:"notebook-container",componentPanel:this,glContainer:o,glEventHub:s,onTab:this.handleTab,onResize:this.handleResize,onShow:this.handleShow,onTabClicked:this.handleTabClick,onTabFocus:this.handleTabFocus,onTabBlur:this.handleTabBlur,onSessionOpen:this.handleSessionOpened,onSessionClose:this.handleSessionClosed,additionalActions:Ve,renderTabTooltip:()=>B,children:[!H&&u.jsxs(u.Fragment,{children:[u.jsxs("div",{className:"notebook-toolbar",children:[u.jsxs("span",{children:[u.jsx(ee,{kind:"ghost",className:"btn-play",onClick:this.handleRunAll,disabled:K,icon:u.jsx(he,{icon:Va,transform:"grow-4"}),tooltip:"Run ".concat(Be.NOTEBOOK.RUN.getDisplayText()),"aria-label":"Run"}),z!=null&&u.jsx(ue,{children:z})]}),u.jsxs("span",{children:[u.jsx(ee,{kind:"ghost",className:"btn-play",onClick:this.handleRunSelected,disabled:K,icon:u.jsx(he,{icon:Sd,transform:"grow-4"}),tooltip:"Run Selected ".concat(Be.NOTEBOOK.RUN_SELECTED.getDisplayText()),"aria-label":"Run Selected"}),ve!=null&&u.jsx(ue,{children:ve})]}),u.jsx(ee,{kind:"ghost",className:"mr-auto",disabled:j,onClick:this.handleSave,icon:wd,tooltip:"Save ".concat(Kt.SAVE.getDisplayText()),"aria-label":"Save"}),u.jsx(ee,{kind:"ghost",className:"btn-overflow",disabled:j,icon:Ua,tooltip:"More Actions...",onClick:()=>{},children:u.jsx(Cn,{actions:this.getDropdownOverflowActions,popperOptions:Oe.POPPER_OPTIONS})})]}),u.jsx(xs,{isLoaded:p,isLoading:g,error:c,onChange:this.handleEditorChange,onRunCommand:this.handleRunCommand,session:T,sessionLanguage:O,onEditorInitialized:this.handleEditorInitialized,onEditorWillDestroy:this.handleEditorWillDestroy,settings:oe,focusOnMount:N,ref:b=>{this.notebook=b}})]}),H&&u.jsx(m.Suspense,{fallback:u.jsx(sn,{}),children:u.jsx(Ig,{content:(r=oe.value)!==null&&r!==void 0?r:"",onLinkClick:this.handleLinkClick,onRunCode:this.handleRunCommand,transformImageUri:this.handleTransformLinkUri,transformLinkUri:this.handleTransformLinkUri})}),u.jsx(Zt,{isOpen:te,type:"file",defaultValue:B,title:J?"Rename":"Save file as",onSubmit:this.handleSaveAsSubmit,onCancel:this.handleSaveAsCancel,notifyOnExtensionChange:!0,storage:i}),u.jsx(an,{isOpen:U,headerText:'Are you sure you want to delete "'.concat(B,'"?'),bodyText:"You cannot undo this action.",onCancel:this.handleDeleteCancel,onConfirm:this.handleDeleteConfirm,confirmButtonText:"Delete"}),u.jsx(an,{isOpen:F,headerText:"Do you want to save the changes you made to ".concat(B,"?"),bodyText:"Your changes will be lost if you don't save them.",onCancel:this.handleCloseCancel,onDiscard:this.handleCloseDiscard,onConfirm:this.handleCloseSave,discardButtonText:"Discard Changes",confirmButtonText:"Save"}),u.jsx(re,{actions:V})]})]})}}Ae(Oe,"COMPONENT","NotebookPanel");Ae(Oe,"POPPER_OPTIONS",{placement:"bottom-end"});Ae(Oe,"DEFAULT_NAME","Untitled");Ae(Oe,"UNSAVED_INDICATOR_CLASS_NAME","editor-unsaved-indicator");Ae(Oe,"UNSAVED_STATUS_CLASS_NAME","is-unsaved");Ae(Oe,"defaultProps",{isDashboardActive:!0,isPreview:!1,session:null,sessionLanguage:null,defaultNotebookSettings:{isMinimapEnabled:!0}});var Dg=(n,e)=>{var t=vs(n),r=Ph(n),i=nr(n,e.localDashboardId),{session:o,config:a}=i??{},{type:s}=a??{};return{fileStorage:t,defaultNotebookSettings:r,session:o,sessionLanguage:s}},tn=In(Dg,{updateSettings:Mh},null,{forwardRef:!0})(Oe);function Ea(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 Pa(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Ea(Object(t),!0).forEach(function(r){xg(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Ea(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function xg(n,e,t){return(e=Mg(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Mg(n){var e=kg(n,"string");return typeof e=="symbol"?e:e+""}function kg(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 Se=W.module("ConsolePlugin");function Ta(n){return n.notebook!==void 0}function Ng(n){Pp(n)}function py(n){Ng(n);var{id:e,hydrateConsole:t,layout:r,panelManager:i,registerComponent:o,notebooksUrl:a}=n,s=m.useRef(0),[l,d]=m.useState(new Map),[h,c]=m.useState(new Map),v=vi(),p=m.useCallback(()=>i.getLastUsedPanelOfType(Xr),[i]),g=m.useCallback((b,w)=>{d(_=>new Map(_.set(b,w)))},[d]),f=m.useCallback(b=>{d(w=>(w.delete(b),new Map(w)))},[d]),y=m.useCallback((b,w)=>{c(_=>new Map(_.set(b,w)))},[c]),T=m.useCallback(b=>{c(w=>(w.delete(b),new Map(w)))},[c]),O=m.useCallback(function(b){var w=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,_=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,G=b&&b.trim();if(!G)Se.info("Ignoring empty code");else{var ne=p();if(!ne||!(ne instanceof Xr.WrappedComponent)){Se.error("Console panel not found");return}Se.debug("Send command: ",b,w,_),ne.addCommand(b,w,_)}},[p]),P=m.useCallback(b=>{v(Df(e,b))},[v,e]),F=m.useCallback(b=>{var{language:w}=b,_=w==="python"?"py":w,G=null;return _==null?(Se.debug("No extension for language",w),G="Untitled-".concat(s.current)):G="Untitled-".concat(s.current,".").concat(_),s.current+=1,G},[]),U=m.useCallback(function(b){var w=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,{id:_}=b;if(_!=null&&l.has(_))return l.get(_);if(_!=null&&h.has(_))return h.get(_);if(w)return kt()},[l,h]),te=m.useCallback((b,w)=>{D.renameComponent(r.root,{id:b},w)},[r.root]),N=m.useCallback((b,w)=>{Se.debug("Rename file panel",b,w);var _;if(l.has(b)&&(_=l.get(b),f(b),_!=null&&g(w,_)),h.has(b)&&(_=h.get(b),T(b),_!=null&&y(w,_)),_===void 0){Se.debug2("File ".concat(b," isn't open, no need to rename the tab"));return}te(_,M.getBaseName(w))},[l,h,te,g,y,f,T]),B=m.useCallback(b=>{var w=U(b,!1);if(w==null){Se.error("Could not find panel id for file metadata",b);return}D.activateTab(r.root,{id:w})},[U,r.root]),H=m.useCallback((b,w,_)=>{if(Se.debug("registerFilePanel",b,w,_),w==null||w.id==null){Se.debug("Ignore empty file id",w);return}var{id:G}=w;if(_){y(G,b);return}if(l.has(G)){var ne=l.get(G);if(b===ne){Se.debug("Update tab title for file ".concat(G));var{itemName:it}=w;N(G,it)}else Se.error("File ".concat(G," already associated with a different tab ").concat(ne));return}g(G,b),h.has(G)&&T(G)},[l,h,N,g,y,T]),J=m.useCallback((b,w)=>{if(Se.debug("unregisterFileTab",b,w),b==null||b.id==null){Se.debug("Ignore empty file id",b);return}var{id:_}=b;if(w){T(_);return}f(_)},[f,T]),oe=m.useCallback((b,w)=>{Se.debug("closeFilePanel",b);var{id:_}=b,G=null,ne=!1;if(l.has(_))G=l.get(_);else if(h.has(_))G=h.get(_),ne=!0;else{Se.debug("File ".concat(_," isn't open, ignore close event"));return}J(b,ne),D.closeComponent(r.root,{id:G},w)},[r.root,l,h,J]),L=m.useCallback(b=>{var{itemName:w}=b;return M.getBaseName(w)},[]),q=m.useCallback(b=>{var{id:w}=b;return Se.debug("fileIsOpen",b,w,l),w!=null&&l.has(w)},[l]),K=m.useCallback(b=>{var{id:w}=b;return Se.debug("fileIsOpenAsPreview",b,w,h),w!=null&&h.has(w)},[h]),j=m.useCallback(b=>{if(b!=null){var w=i.getOpenedPanelById(b);w&&Ta(w)&&w.focus()}},[i]),V=m.useCallback(b=>{var{id:w,settings:_,fileMetadata:G,session:ne,sessionLanguage:it,isPreview:I=!1}=b,Z={settings:_,fileMetadata:G},ae=L(G);return{type:"react-component",component:tn.COMPONENT,isFocusOnShow:!1,props:{localDashboardId:e,metadata:{id:w},session:ne,sessionLanguage:it,panelState:Z,isPreview:I,notebooksUrl:a},title:ae,id:w}},[L,e,a]),z=m.useCallback(function(b,w,_){var G=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{id:null,itemName:F(_)},ne=U(G);if(q(G)&&ne!=null){Se.debug("File is already open, focus panel"),B(G),j(ne);return}var it=D.getStackForComponentTypes(r.root,[tn.COMPONENT]),I=V({id:ne,settings:_,fileMetadata:G,session:b,sessionLanguage:w});Se.debug("createNotebook",I,l),D.openComponentInStack(it,I)},[q,j,F,U,r.root,V,l,B]),ve=m.useCallback(function(b,w,_,G){var ne=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!1;Se.debug("selectNotebook",G,ne);var it=q(G),I=K(G),[Z]=[...h.values()],ae=!ne,ce=ae&&Z?Z:U(G);if(ce==null||ce==="")throw new Error("Unable to retrieve or create panelId for metadata",G);if(it||I)B(G);else{var Fe=D.getStackForComponentTypes(r.root,[tn.COMPONENT]),Pt=V({id:ce,settings:_,fileMetadata:G,session:b,sessionLanguage:w,isPreview:ae});D.openComponentInStack(Fe,Pt)}if(I&&ne){var Tt=G.id,Hr=D.getStackForConfig(r.root,{component:tn.COMPONENT,id:ce}),Nn=D.getContentItemInStack(Hr,{component:tn.COMPONENT,id:ce});Nn&&nt(Nn)&&(Nn.container.emit(Q.PROMOTE_FROM_PREVIEW),T(Tt),g(Tt,ce))}ne&&j(ce)},[B,q,K,j,U,r.root,V,h,T,g]),Ve=m.useCallback(function(b,w){var _=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},G=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,ne=i.getLastUsedPanelOfType(tn);ne&&Ta(ne)?_!=null&&_.value!=null&&ne.notebook!=null&&ne.notebook.append(_.value):G&&z(b,w,_)},[z,i]),ke=m.useCallback((b,w)=>Np.hydrate(Pa(Pa({},b),{},{notebooksUrl:a}),w),[a]);return Ln(o,Xr,t),Ln(o,Nf),Ln(o,Sg),Ln(o,Tg),Ln(o,tn,ke),je(r.eventHub,Me.SEND_COMMAND,O),je(r.eventHub,Me.SETTINGS_CHANGED,P),je(r.eventHub,Q.CLOSE_FILE,oe),je(r.eventHub,Q.CREATE_NOTEBOOK,z),je(r.eventHub,Q.SELECT_NOTEBOOK,ve),je(r.eventHub,Q.RENAME,te),je(r.eventHub,Q.RENAME_FILE,N),je(r.eventHub,Q.SEND_TO_NOTEBOOK,Ve),je(r.eventHub,Q.REGISTER_FILE,H),je(r.eventHub,Q.UNREGISTER_FILE,J),null}function Rr(n,e,t){return(e=jg(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function jg(n){var e=Ag(n,"string");return typeof e=="symbol"?e:e+""}function Ag(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 $r{}Rr($r,"DROPDOWN_FILTER","ControlType.DROPDOWN_FILTER");Rr($r,"INPUT_FILTER","ControlType.INPUT_FILTER");Rr($r,"MARKDOWN","ControlType.MARKDOWN");Rr($r,"FILTER_SET_MANAGER","ControlType.FILTER_SET_MANAGER");export{mb as $,cb as A,ee as B,Mr as C,fe as D,ns as E,js as F,Ye as G,Kt as H,dt as I,Gg as J,x as K,$r as L,qb as M,Cn as N,qn as O,Te as P,Lh as Q,kr as R,ds as S,E as T,ps as U,Jg as V,nr as W,ny as X,Th as Y,Le as Z,Wp as _,vt as a,jm as a$,xh as a0,Xt as a1,Wb as a2,dl as a3,Cb as a4,Kb as a5,Np as a6,Dd as a7,Ga as a8,Q as a9,au as aA,es as aB,Ja as aC,ru as aD,nu as aE,ct as aF,rt as aG,pi as aH,ss as aI,Ju as aJ,Nr as aK,A as aL,rs as aM,xr as aN,ts as aO,zg as aP,eh as aQ,ph as aR,hs as aS,us as aT,Zg as aU,Xg as aV,Yg as aW,Xa as aX,Om as aY,Im as aZ,we as a_,Et as aa,ie as ab,Gb as ac,tn as ad,fh as ae,$g as af,Yn as ag,py as ah,re as ai,an as aj,my as ak,Sb as al,pb as am,wb as an,bb as ao,yb as ap,ry as aq,iy as ar,vb as as,gb as at,fs as au,fb as av,Ce as aw,Vg as ax,tu as ay,Xn as az,Xe as b,$b as b$,Gm as b0,Rm as b1,xe as b2,Eb as b3,ks as b4,Ns as b5,_b as b6,Db as b7,Pb as b8,Tb as b9,Cr as bA,Is as bB,wn as bC,Ds as bD,vv as bE,ye as bF,Y as bG,Be as bH,xs as bI,ri as bJ,Bg as bK,D as bL,Ln as bM,je as bN,Bb as bO,Zr as bP,tf as bQ,ef as bR,Fp as bS,jp as bT,Ip as bU,ul as bV,Ti as bW,al as bX,Pp as bY,kp as bZ,rl as b_,Ob as ba,Wm as bb,xb as bc,Mb as bd,qm as be,Zm as bf,Nb as bg,kb as bh,As as bi,jb as bj,uv as bk,iv as bl,hv as bm,Gt as bn,gs as bo,He as bp,wr as bq,Ms as br,jr as bs,bs as bt,zh as bu,Ss as bv,ys as bw,En as bx,Cs as by,Pn as bz,C as c,Kg as c$,Hb as c0,ll as c1,il as c2,Ep as c3,_r as c4,$p as c5,Lb as c6,Rb as c7,Ub as c8,zb as c9,Nf as cA,Sg as cB,Za as cC,Hg as cD,kn as cE,Ya as cF,Av as cG,sy as cH,Qb as cI,Jb as cJ,fl as cK,Yb as cL,ey as cM,Dn as cN,Zb as cO,dy as cP,Xb as cQ,ft as cR,ly as cS,ay as cT,oy as cU,gl as cV,Me as cW,St as cX,ty as cY,Df as cZ,Wg as c_,Gp as ca,_i as cb,ir as cc,jf as cd,Wf as ce,cy as cf,Hf as cg,Rf as ch,Lf as ci,Af as cj,uy as ck,Ff as cl,hy as cm,$f as cn,bl as co,ra as cp,Ug as cq,Qr as cr,wp as cs,el as ct,Vb as cu,M as cv,Oi as cw,vy as cx,Xr as cy,Tg as cz,xn as d,Br as d0,Ib as d1,Vn as d2,Eh as e,db as f,eb as g,lb as h,sb as i,ab as j,ob as k,Qg as l,rb as m,nb as n,tb as o,Mh as p,be as q,me as r,ue as s,Ee as t,vh as u,ub as v,ib as w,qg as x,Fb as y,hb as z};
|
|
23
|
-
//# sourceMappingURL=ControlType-
|
|
22
|
+
`)}this.bufferedMessages=[],this.appendLogText(e)}queue(e){this.bufferedMessages.push(e),this.bufferedMessages.length===1&&(this.flushTimer=setTimeout(this.handleFlushTimeout,ye.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(ee,{kind:"ghost",className:"btn-clear-logs",onClick:this.handleClearClick,icon:ld,tooltip:"Clear log"}),u.jsx(ee,{kind:"ghost",className:"btn-link-icon btn-overflow",icon:dd,tooltip:"Log Settings",onClick:()=>{},children:u.jsx(Cn,{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}})]})}}tt(ye,"DefaultLogLevels",[Ie.STDOUT,Ie.ERROR,Ie.FATAL,Ie.STDERR,Ie.WARN]);tt(ye,"AllLogLevels",[Ie.INFO,Ie.STDOUT,Ie.ERROR,Ie.FATAL,Ie.STDERR,Ie.WARN,Ie.DEBUG,Ie.TRACE]);tt(ye,"bufferTimeout",16);tt(ye,"maxLogSize",131072);tt(ye,"truncateSize",65536);function bi(n,e,t){return(e=Tm(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Tm(n){var e=_m(n,"string");return typeof e=="symbol"?e:e+""}function _m(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var 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 xe{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""}}bi(xe,"TYPE_GLOBAL","type-global");bi(xe,"TYPE_CONTEXT_PRESET","type-context-preset");bi(xe,"TYPE_CONTEXT_CUSTOM","type-context-custom");class Om extends xe{format(e){switch(e){case 1:case!0:return"true";case 0:case!1:return"false";default:return""}}}class Im extends xe{format(e){return String.fromCharCode(e)}}function Ht(n,e,t){return(e=Dm(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Dm(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 No=W.module("DateTimeColumnFormatter");class vt extends xe{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]:xe.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=vt.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=vt.makeFormatStringMap(e,t);return[...r.keys()]}constructor(e){var{timeZone:t="",showTimeZone:r=!0,showTSeparator:i=!1,defaultDateTimeFormatString:o=vt.DEFAULT_DATETIME_FORMAT_STRING}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};super(),Ht(this,"dh",void 0),Ht(this,"dhTimeZone",void 0),Ht(this,"defaultDateTimeFormatString",void 0),Ht(this,"showTimeZone",void 0),Ht(this,"showTSeparator",void 0),Ht(this,"formatStringMap",void 0);var a=t||vt.DEFAULT_TIME_ZONE_ID;try{this.dhTimeZone=e.i18n.TimeZone.getTimeZone(a)}catch{No.error("Unsupported time zone id",a),this.dhTimeZone=e.i18n.TimeZone.getTimeZone(vt.DEFAULT_TIME_ZONE_ID)}this.dh=e,this.defaultDateTimeFormatString=o,this.showTimeZone=r,this.showTSeparator=i,this.formatStringMap=vt.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{No.error("Invalid format arguments")}return""}}Ht(vt,"DEFAULT_DATETIME_FORMAT_STRING","yyyy-MM-dd HH:mm:ss.SSS");Ht(vt,"DEFAULT_TIME_ZONE_ID","America/New_York");function gt(n,e,t){return(e=Mm(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Mm(n){var e=km(n,"string");return typeof e=="symbol"?e:e+""}function km(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 Nm=W.module("DecimalColumnFormatter");class fe extends xe{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]:xe.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 fe.makeFormat(e,t,xe.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 fe.makeFormat("Custom Format",e,xe.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=fe.DEFAULT_FORMAT_STRING}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};super(),gt(this,"defaultFormatString",void 0),gt(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{Nm.error("Invalid format arguments")}return""}}gt(fe,"DEFAULT_FORMAT_STRING","###,##0.0000");gt(fe,"FORMAT_PERCENT",fe.makePresetFormat("Percent","##0.00%"));gt(fe,"FORMAT_BASIS_POINTS",fe.makePresetFormat("Basis Points","###,##0 bp",1e4));gt(fe,"FORMAT_THOUSANDS",fe.makePresetFormat("Thousands","##0.000 k",.001));gt(fe,"FORMAT_MILLIONS",fe.makePresetFormat("Millions","###,##0.000 mm",1e-6));gt(fe,"FORMAT_SCIENTIFIC_NOTATION",fe.makePresetFormat("Scientific Notation","0.0000E0"));gt(fe,"FORMAT_ROUND",fe.makePresetFormat("Round","###,##0"));gt(fe,"FORMAT_ROUND_TWO_DECIMALS",fe.makePresetFormat("0.00","###,##0.00"));gt(fe,"FORMAT_ROUND_FOUR_DECIMALS",fe.makePresetFormat("0.0000","###,##0.0000"));class jm extends xe{format(e){return"".concat(e)}}function _n(n,e,t){return(e=Am(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Am(n){var e=Lm(n,"string");return typeof e=="symbol"?e:e+""}function Lm(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 Fm=W.module("IntegerColumnFormatter");class dt extends xe{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]:xe.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 dt.makeFormat(e,t,xe.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 dt.makeFormat("Custom Format",e,xe.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=dt.DEFAULT_FORMAT_STRING}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};super(),_n(this,"dh",void 0),_n(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{Fm.error("Invalid format arguments")}return""}}_n(dt,"DEFAULT_FORMAT_STRING","###,##0");_n(dt,"FORMAT_THOUSANDS",dt.makePresetFormat("Thousands","##0.000 k",.001));_n(dt,"FORMAT_MILLIONS",dt.makePresetFormat("Millions","###,##0.000 mm",1e-6));_n(dt,"FORMAT_SCIENTIFIC_NOTATION",dt.makePresetFormat("Scientific Notation","0.0000E0"));class Rm extends xe{format(e){return e}}function jo(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 Ao(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?jo(Object(t),!0).forEach(function(r){yi(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):jo(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function yi(n,e,t){return(e=$m(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function $m(n){var e=Hm(n,"string");return typeof e=="symbol"?e:e+""}function Hm(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 Bm=/\s*(\d{4})([-./](\d{1,2}|[a-z]+))?([-./](\d{1,2}))?([tT\s](\d{2})([:](\d{2}))?([:](\d{2}))?([.](\d{1,9}))?)?(.*)/;class we{static makeDateWrapper(e,t,r){var i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:1,a=arguments.length>5&&arguments[5]!==void 0?arguments[5]:0,s=arguments.length>6&&arguments[6]!==void 0?arguments[6]:0,l=arguments.length>7&&arguments[7]!==void 0?arguments[7]:0,d=arguments.length>8&&arguments[8]!==void 0?arguments[8]:0;if(!t)throw new Error("No timezone provided");var h="".concat(r).padStart(4,"0"),c="".concat(i+1).padStart(2,"0"),v="".concat(o).padStart(2,"0"),p="".concat(a).padStart(2,"0"),g="".concat(s).padStart(2,"0"),f="".concat(l).padStart(2,"0"),y="".concat(d).padStart(9,"0"),T="".concat(h,"-").concat(c,"-").concat(v," ").concat(p,":").concat(g,":").concat(f,".").concat(y);return e.i18n.DateTimeFormat.parse(we.FULL_DATE_FORMAT,T,e.i18n.TimeZone.getTimeZone(t))}static getNextNanos(e){var t=parseInt(e,10),r="0".repeat(9-e.length),i="".concat(t+1).concat(r);return parseInt(i,10)}static getNextDate(e,t,r,i){var{year:o,month:a,date:s,hours:l,minutes:d,seconds:h,nanos:c}=r;if(t.nanos!=null){if(t.nanos.length===9)return null;c=we.getNextNanos(t.nanos),c>999999999&&(h+=1,c=0)}else t.seconds!=null?h+=1:t.minutes!=null?d+=1:t.hours!=null?l+=1:t.date!=null?s+=1:t.month!=null?a+=1:o+=1;var v=new Date(o,a,s,l,d,h);return we.makeDateWrapper(e,i,v.getFullYear(),v.getMonth(),v.getDate(),v.getHours(),v.getMinutes(),v.getSeconds(),c)}static parseMonth(e){var t=parseInt(e,10);if(!Number.isNaN(t))return t>=1&&t<=12?t-1:NaN;var r=e.trim().toLowerCase();if(r.length>=3){for(var i=0;i<we.months.length;i+=1)if(we.months[i].startsWith(r))return i}return NaN}static parseDateValues(e,t,r,i,o,a,s){var l=parseInt(e,10),d=t!=null?this.parseMonth(t):0,h=r!=null?parseInt(r,10):1,c=i!=null?parseInt(i,10):0,v=o!=null?parseInt(o,10):0,p=a!=null?parseInt(a,10):0,g=s!=null?parseInt(s.padEnd(9,"0"),10):0;return Number.isNaN(l)||Number.isNaN(d)||Number.isNaN(h)||Number.isNaN(c)||Number.isNaN(v)||Number.isNaN(p)||Number.isNaN(g)?null:{year:l,month:d,date:h,hours:c,minutes:v,seconds:p,nanos:g}}static parseDateTimeString(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,r=Bm.exec(e);if(r==null)throw new Error("Unexpected date string: ".concat(e));var[,i,,o,,a,,s,,l,,d,,h,c]=r;if(!t&&c!=null&&c.length>0)throw new Error("Unexpected characters after date string '".concat(e,"': ").concat(c));var v={year:i,month:o,date:a,hours:s,minutes:l,seconds:d,nanos:h};return t?Ao(Ao({},v),{},{overflow:c}):v}static parseDateRange(e,t,r){var i=t.trim().toLowerCase();if(i.length===0)throw new Error("Cannot parse date range from empty string");if(i==="null")return[null,null];if(i==="today"){var o=new Date(Date.now()),a=we.makeDateWrapper(e,r,o.getFullYear(),o.getMonth(),o.getDate()),s=new Date(o.getFullYear(),o.getMonth(),o.getDate()+1),l=we.makeDateWrapper(e,r,s.getFullYear(),s.getMonth(),s.getDate());return[a,l]}if(i==="yesterday"){var d=new Date(Date.now()),h=new Date(d.getFullYear(),d.getMonth(),d.getDate()-1),c=we.makeDateWrapper(e,r,h.getFullYear(),h.getMonth(),h.getDate()),v=we.makeDateWrapper(e,r,d.getFullYear(),d.getMonth(),d.getDate());return[c,v]}if(i==="now"){var p=new Date(Date.now()),g=e.DateWrapper.ofJsDate(p);return[g,null]}var f=we.parseDateTimeString(i);if(f.year==null&&f.month==null&&f.date==null)throw new Error("Unable to extract year, month, or day ".concat(i));var y=we.parseDateValues(f.year,f.month,f.date,f.hours,f.minutes,f.seconds,f.nanos);if(y==null)throw new Error("Unable to extract date values from ".concat(f));var T=we.makeDateWrapper(e,r,y.year,y.month,y.date,y.hours,y.minutes,y.seconds,y.nanos),O=we.getNextDate(e,f,y,r);return[T,O]}static getJsDate(e){return typeof e=="number"?new Date(e):e.asDate()}static trimDateTimeStringTimeZone(e){var{overflow:t=""}=we.parseDateTimeString(e,!0);if(t==="")return e;if(!/^\s[A-Za-z]+/.test(t))throw new Error("Unexpected timezone format in overflow: '".concat(e,"'"));return e.slice(0,-t.length)}}yi(we,"FULL_DATE_FORMAT","yyyy-MM-dd HH:mm:ss.SSSSSSSSS");yi(we,"months",["january","february","march","april","may","june","july","august","september","october","november","december"]);function Eb(n,e){return n===e?{operator:"notEq",value:""}:{operator:"eq",value:n}}function Pb(n,e,t,r){return function(o){var a=t.trim();if(a==="")return null;var s=ks(e,l=>n.makeSearchTextFilter(l,a,r),"or");return s(o)}}function ks(n,e){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"or";return function(i){var o=i?.findColumns(typeof n=="string"?[n]:n);if(o==null||o.length===0)return null;var a=o.map(e);return a.reduce((s,l)=>s[t](l))}}function Wm(n,e,t,r){return ks(e,i=>i.filter()[r](n.makeFilterValue(i.type,t)),"or")}function Tb(n,e,t,r,i){return function(a){var s=a?.findColumn(e),l=t==="all"||r&&t.size===0;return s==null||l?null:n.makeSelectValueFilter(s,[...t.keys()],i)}}function _b(n){return function(t){return t.filter().isNull().not().and(t.filter().notEq(n.makeFilterValue(t.type,"")))}}function Ob(n,e){return function(r){var i=r.filter(),o=n.makeFilterValue(r.type,""),a=i.eq(o);return e?i.isNull().or(a):a.or(i.notEq(o))}}function Ci(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=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 qn{}Ci(qn,"not","not");Ci(qn,"and","and");Ci(qn,"or","or");function Ib(n){if(!(n==="not"||n==="and"||n==="or"))throw new Error("operator is not a valid FilterOperatorValue")}function ge(n,e,t){return(e=Km(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Km(n){var e=zm(n,"string");return typeof e=="symbol"?e:e+""}function zm(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var 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 E{}ge(E,"eq","eq");ge(E,"eqIgnoreCase","eqIgnoreCase");ge(E,"notEq","notEq");ge(E,"notEqIgnoreCase","notEqIgnoreCase");ge(E,"greaterThan","greaterThan");ge(E,"greaterThanOrEqualTo","greaterThanOrEqualTo");ge(E,"lessThan","lessThan");ge(E,"lessThanOrEqualTo","lessThanOrEqualTo");ge(E,"in","in");ge(E,"inIgnoreCase","inIgnoreCase");ge(E,"notIn","notIn");ge(E,"notInIgnoreCase","notInIgnoreCase");ge(E,"isTrue","isTrue");ge(E,"isFalse","isFalse");ge(E,"isNull","isNull");ge(E,"invoke","invoke");ge(E,"contains","contains");ge(E,"notContains","notContains");ge(E,"containsIgnoreCase","containsIgnoreCase");ge(E,"startsWith","startsWith");ge(E,"endsWith","endsWith");ge(E,"containsAny","containsAny");var Gm="DH_ITEM_KEY",Lo=W.module("ViewportDataUtils");function Ns(n){return"".concat(Gm,"_").concat(n)}function Db(n,e){var{bulkUpdate:t}=n;return function(i){var{columns:o,offset:a,rows:s}=i.detail;Lo.debug("table updated",i.detail);var l=new Map;s.forEach((d,h)=>{var c=e(d,o),v=Ns(a+h);l.set(v,{key:v,item:c})}),Lo.debug("update keys",l),t(l)}}function xb(n,e){return e.reduce((t,r)=>(t[r.name]=n.get(r),t),{})}function*Mb(n,e){for(var t=n;t<=e;++t)yield{key:Ns(t)}}function qm(n){return n==null||Zm(n)?0:n.size}function Zm(n){return"isClosed"in n?n.isClosed:!1}function kb(n,e,t,r){var i=n+e-1,[o,a]=[0,r-1],s=xi(n-t,o,a),l=xi(i+t,o,a);return[s,l]}function Fo(n,e,t,r,i,o,a){try{var s=n[o](a),l=s.value}catch(d){return void t(d)}s.done?e(l):Promise.resolve(l).then(r,i)}function Rt(n){return function(){var e=this,t=arguments;return new Promise(function(r,i){var o=n.apply(e,t);function a(l){Fo(o,r,i,a,s,"next",l)}function s(l){Fo(o,r,i,a,s,"throw",l)}a(void 0)})}}function un(n,e,t){return(e=Xm(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Xm(n){var e=Ym(n,"string");return typeof e=="symbol"?e:e+""}function Ym(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 It=W.module("TableUtils");function Nb(n){return n===C.sortDirection.ascending||n===C.sortDirection.descending||n===C.sortDirection.reverse||n===C.sortDirection.none}class C{static copyTableAndApplyFilters(e){var t=arguments;return Rt(function*(){if(e==null)return null;for(var r=yield e.copy(),i=t.length,o=new Array(i>1?i-1:0),a=1;a<i;a++)o[a-1]=t[a];return r.applyFilter(Br(...o.map(s=>s(r)))),r})()}static getSortIndex(e,t){for(var r=0;r<e.length;r+=1){var i,o=e[r];if(((i=o.column)===null||i===void 0?void 0:i.name)===t)return r}return null}static getSortForColumn(e,t){var r=C.getSortIndex(e,t);return r!=null?e[r]:null}static getFilterText(e){return e?e.toString():null}static getFilterTypes(e){return C.isBooleanType(e)?[E.isTrue,E.isFalse,E.isNull]:C.isCharType(e)||C.isNumberType(e)||C.isDateType(e)?[E.eq,E.notEq,E.greaterThan,E.greaterThanOrEqualTo,E.lessThan,E.lessThanOrEqualTo]:C.isTextType(e)?[E.eq,E.eqIgnoreCase,E.notEq,E.notEqIgnoreCase,E.contains,E.notContains,E.startsWith,E.endsWith]:[]}static getNextSort(e,t,r){var i=e[r];if(i==null)return null;var o=C.getSortForColumn(t,i.name);return o===null?this.makeColumnSort(e,r,C.sortDirection.ascending,!1):o.direction===C.sortDirection.ascending?this.makeColumnSort(e,r,C.sortDirection.descending,!1):null}static makeColumnSort(e,t,r,i){var o=e[t];return o==null||r===C.sortDirection.none?null:{column:{name:o.name,type:o.type},isAbs:i,direction:r}}static toggleSortForColumn(e,t,r){var i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(t[r]==null)return[];var o=C.getNextSort(t,e,r);return C.setSortForColumn(e,t[r].name,o,i)}static sortColumn(e,t,r,i,o,a){if(r<0||r>=t.length)return[];var s=C.makeColumnSort(t,r,i,o);return C.setSortForColumn(e,t[r].name,s,a)}static setSortForColumn(e,t,r){var i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1,o=C.getSortIndex(e,t),a=[];return i&&(a=a.concat(e.filter(s=>{var{direction:l}=s;return l!==C.sortDirection.reverse})),o!==null&&a.splice(o,1)),r!==null&&a.push(r),a}static getNormalizedType(e){switch(e){case"boolean":case"java.lang.Boolean":case C.dataType.BOOLEAN:return C.dataType.BOOLEAN;case"char":case"java.lang.Character":case C.dataType.CHAR:return C.dataType.CHAR;case"java.lang.String":case C.dataType.STRING:return C.dataType.STRING;case"io.deephaven.db.tables.utils.DBDateTime":case"io.deephaven.time.DateTime":case"com.illumon.iris.db.tables.utils.DBDateTime":case"java.time.Instant":case"java.time.ZonedDateTime":case C.dataType.DATETIME:return C.dataType.DATETIME;case"double":case"java.lang.Double":case"float":case"java.lang.Float":case"java.math.BigDecimal":case C.dataType.DECIMAL:return C.dataType.DECIMAL;case"int":case"java.lang.Integer":case"long":case"java.lang.Long":case"short":case"java.lang.Short":case"byte":case"java.lang.Byte":case"java.math.BigInteger":case C.dataType.INT:return C.dataType.INT;default:return C.dataType.UNKNOWN}}static isLongType(e){switch(e){case"long":case"java.lang.Long":return!0;default:return!1}}static isDateType(e){switch(e){case"io.deephaven.db.tables.utils.DBDateTime":case"io.deephaven.time.DateTime":case"java.time.Instant":case"java.time.ZonedDateTime":case"com.illumon.iris.db.tables.utils.DBDateTime":return!0;default:return!1}}static isNumberType(e){return C.isIntegerType(e)||C.isDecimalType(e)}static isIntegerType(e){switch(e){case"int":case"java.lang.Integer":case"java.math.BigInteger":case"long":case"java.lang.Long":case"short":case"java.lang.Short":case"byte":case"java.lang.Byte":return!0;default:return!1}}static isDecimalType(e){switch(e){case"double":case"java.lang.Double":case"java.math.BigDecimal":case"float":case"java.lang.Float":return!0;default:return!1}}static isBigDecimalType(e){switch(e){case"java.math.BigDecimal":return!0;default:return!1}}static isBigIntegerType(e){switch(e){case"java.math.BigInteger":return!0;default:return!1}}static isBooleanType(e){switch(e){case"boolean":case"java.lang.Boolean":return!0;default:return!1}}static isCharType(e){switch(e){case"char":case"java.lang.Character":return!0;default:return!1}}static isStringType(e){switch(e){case"java.lang.String":return!0;default:return!1}}static isTextType(e){return this.isStringType(e)||this.isCharType(e)}static getBaseType(e){return e.split("[]")[0]}static isCompatibleType(e,t){return C.getNormalizedType(e)===C.getNormalizedType(t)}static quoteValue(e){return e.length>=2&&(e.charAt(0)==='"'&&e.charAt(e.length-1)==='"'||e.charAt(0)==="'"&&e.charAt(e.length-1)==="'")?e:'"'.concat(e,'"')}static isRangeOperation(e){switch(e){case"<":case"<=":case"=<":case">":case">=":case"=>":return!0;default:return!1}}static makeRangeFilterWithOperation(e,t,r){switch(t){case"=":return e.eq(r);case"<":return e.lessThan(r);case"<=":case"=<":return e.lessThanOrEqualTo(r);case">":return e.greaterThan(r);case">=":case"=>":return e.greaterThanOrEqualTo(r);case"!=":case"!":return e.notEq(r);default:return null}}static makeCancelableTablePromise(e){return Te.makeCancelable(e,t=>{t.close()})}static makeCancelableTableEventPromise(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null,o,a,s=!0,l=new Promise((d,h)=>{a=setTimeout(()=>{o(),s=!1,h(new Xa('Event "'.concat(t,'" timed out.')))},r),o=e.addEventListener(t,c=>{if(i!=null&&!i(c)){It.debug2("Event triggered, but matcher returned false.");return}It.debug2("Event triggered, resolving."),o(),clearTimeout(a),s=!1,d(c)})});return l.cancel=()=>{if(s){It.debug2("Pending promise cleanup."),o(),clearTimeout(a),s=!1;return}It.debug2("Ignoring non-pending promise cancel.")},l}static removeCommas(e){return e.replace(/[\s|,]/g,"")}static makeBooleanValue(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(e===""&&t)return null;switch(e?.toLowerCase()){case"null":return null;case"0":case"f":case"fa":case"fal":case"fals":case"false":case"n":case"no":return!1;case"1":case"t":case"tr":case"tru":case"true":case"y":case"ye":case"yes":return!0;default:throw new Error("Invalid boolean '".concat(e,"'"))}}static makeNumberValue(e){if(e==="null"||e==="")return null;var t=e.toLowerCase().trim();if(t==="∞"||t==="infinity"||t==="inf")return Number.POSITIVE_INFINITY;if(t==="-∞"||t==="-infinity"||t==="-inf")return Number.NEGATIVE_INFINITY;var r=C.removeCommas(t);if(C.NUMBER_REGEX.test(r))return parseFloat(r);throw new Error("Invalid number '".concat(e,"'"))}static getFilterOperatorString(e){switch(e){case E.eq:return"=";case E.notEq:return"!=";case E.greaterThan:return">";case E.greaterThanOrEqualTo:return">=";case E.lessThan:return"<";case E.lessThanOrEqualTo:return"<=";case E.contains:return"~";case E.notContains:return"!~";default:throw new Error("Unexpected filter type ".concat(e))}}static isPartitionedTable(e){return e!=null&&e.getMergedTable!==void 0&&e.getKeyTable!==void 0&&e.getKeys!==void 0}static isTreeTable(e){return e!=null&&e.expand!==void 0&&e.collapse!==void 0}static sortColumns(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return[...e].sort((r,i)=>{var o=r.name.toUpperCase(),a=i.name.toUpperCase();return Ya.sort(o,a,t)})}constructor(e){un(this,"dh",void 0),this.dh=e,Dd(this)}createDistinctSortedColumnTable(e,t,r){var i=arguments,o=this;return Rt(function*(){if(e==null)return null;for(var a=e,s=i.length,l=new Array(s>3?s-3:0),d=3;d<s;d++)l[d-3]=i[d];l.length>0&&(a=yield e.copy(),yield a.applyFilter(Br(...l.map(p=>p(a)))));var h=a.findColumn(t),c=yield a.selectDistinct([h]);a!==e&&a.close();var v=c.findColumn(t).sort()[r]();return o.applySort(c,[v])})()}doesColumnValueExist(e,t,r,i){var o=this;return Rt(function*(){if(e==null)return null;var a=Wm(o,t,r,i?"eq":"eqIgnoreCase"),s=yield e.copy();yield o.applyFilter(s,Br(a(s)));var l=qm(s);return s.close(),l>0})()}getValueType(e){if(e==null)return this.dh.ValueType.STRING;var t=C.getNormalizedType(e);switch(t){case C.dataType.BOOLEAN:return this.dh.ValueType.BOOLEAN;case C.dataType.CHAR:case C.dataType.STRING:return this.dh.ValueType.STRING;case C.dataType.DATETIME:return this.dh.ValueType.DATETIME;case C.dataType.DECIMAL:case C.dataType.INT:return C.isBigDecimalType(e)||C.isBigIntegerType(e)?this.dh.ValueType.STRING:this.dh.ValueType.NUMBER;default:return this.dh.ValueType.STRING}}makeQuickFilter(e,t,r){for(var i=t.split("||"),o=null,a=0;a<i.length;a+=1){for(var s=i[a],l=s.split("&&"),d=null,h=0;h<l.length;h+=1){var c=l[h].trim();if(c.length>0){var v=this.makeQuickFilterFromComponent(e,c,r);if(v)d?d=d.and(v):d=v;else throw new Error("Unable to parse quick filter from text ".concat(t))}}o&&d?o=o.or(d):o=d}return o}makeQuickFilterFromComponent(e,t,r){var{type:i}=e;return C.isNumberType(i)?this.makeQuickNumberFilter(e,t):C.isBooleanType(i)?this.makeQuickBooleanFilter(e,t):r!=null&&C.isDateType(i)?this.makeQuickDateFilter(e,t,r):C.isCharType(i)?this.makeQuickCharFilter(e,t):this.makeQuickTextFilter(e,t)}makeQuickNumberFilter(e,t){var r=e.filter(),{dh:i}=this,o=null,a=/\s*(>=|<=|=>|=<|>|<|!=|=|!)?(\s*-\s*)?(\s*\d*(?:,\d{3})*(?:\.\d*)?\s*)?(null|nan|infinity|inf|\u221E)?(.*)/i,s=a.exec(t),l=null,d=null,h=null,c=null,v=null;if(s!==null&&s.length>3&&([,l,d,h,c,v]=s),v!=null&&v.trim().length>0)return null;if(l==null&&(l="="),c!=null){if(!(l==="="||l==="!"||l==="!="))return null;switch(c=c.trim().toLowerCase(),c){case"null":o=r.isNull();break;case"nan":o=i.FilterCondition.invoke("isNaN",r);break;case"infinity":case"inf":case"∞":d!=null?o=i.FilterCondition.invoke("isInf",r).and(r.lessThan(i.FilterValue.ofNumber(0))):o=i.FilterCondition.invoke("isInf",r).and(r.greaterThan(i.FilterValue.ofNumber(0)));break}return o!==null&&(l==="!"||l==="!=")&&(o=o.not()),o}if(h==null)return null;if(h=C.removeCommas(h),C.isLongType(e.type))try{h=i.FilterValue.ofNumber(i.LongWrapper.ofString("".concat(d!=null?"-":"").concat(h)))}catch(p){return It.warn("Unable to create long filter",p),null}else{if(h=parseFloat(h),h==null||Number.isNaN(h))return null;h=i.FilterValue.ofNumber(d!=null?0-h:h)}return o=e.filter(),C.makeRangeFilterWithOperation(o,l,h)}static escapeQuickTextFilter(e){var t,r;if(e==null)return null;var i=/^(!~|!=|~|=|!)?(.*)/,o=/^\\*null$/,a=i.exec(e),s=null,l=null;if(a!==null&&a.length>2&&([,s,l]=a),s!=null){var d;return"\\".concat(s).concat((d=l)!==null&&d!==void 0?d:"")}return l!=null&&o.test(l.toLowerCase())||l!=null&&l.startsWith("*")?"\\".concat(l):l!=null&&l.endsWith("*")&&!l.endsWith("\\*")?(l=l.substring(0,l.length-1),"".concat(l,"\\*")):"".concat((t=s)!==null&&t!==void 0?t:"").concat((r=l)!==null&&r!==void 0?r:"")}static unescapeQuickTextFilter(e){var t,r,i=/^(\\!~|\\!=|\\~|\\=|\\!)?(.*)/,o=/^\\*null$/,a=i.exec(e),s=null,l=null;return a!==null&&a.length>2&&([,s,l]=a),s!=null&&(s=s.replace("\\","")),l!=null&&o.test(l.toLowerCase())&&(l=l.replace("\\","")),s==null&&l!=null&&l.startsWith("\\*")&&(l=l.substring(1)),s==null&&l!=null&&l.endsWith("\\*")?(l=l.substring(0,l.length-2),"".concat(l,"*")):"".concat((t=s)!==null&&t!==void 0?t:"").concat((r=l)!==null&&r!==void 0?r:"")}makeQuickTextFilter(e,t){var{dh:r}=this,i="".concat(t).trim(),o=/^(!~|!=|~|=|!)?(.*)/,a=o.exec(i),s=null,l=null;if(a!==null&&a.length>2&&([,s,l]=a,l!=null&&(l=l.trim())),l==null||l.length===0&&!(s==="="||s==="!="))return null;s==null&&(s="=");var d=e.filter();if(l.toLowerCase()==="null")switch(s){case"=":return d.isNull();case"!=":case"!":return d.isNull().not()}var h=null,c=null;switch(l.startsWith("*")?(h="*",l=l.substring(1)):l.endsWith("*")&&!l.endsWith("\\*")&&(c="*",l=l.substring(0,l.length-1)),l=C.unescapeQuickTextFilter(l),s){case"~":return d.isNull().not().and(d.invoke("matches",r.FilterValue.ofString("(?s)(?i).*\\Q".concat(l,"\\E.*"))));case"!~":return d.isNull().or(d.invoke("matches",r.FilterValue.ofString("(?s)(?i).*\\Q".concat(l,"\\E.*"))).not());case"!=":return h==="*"?d.isNull().or(d.invoke("matches",r.FilterValue.ofString("(?s)(?i).*\\Q".concat(l,"\\E$"))).not()):c==="*"?d.isNull().or(d.invoke("matches",r.FilterValue.ofString("(?s)(?i)^\\Q".concat(l,"\\E.*"))).not()):d.notEqIgnoreCase(r.FilterValue.ofString(l.toLowerCase()));case"=":return h==="*"?d.isNull().not().and(d.invoke("matches",r.FilterValue.ofString("(?s)(?i).*\\Q".concat(l,"\\E$")))):c==="*"?d.isNull().not().and(d.invoke("matches",r.FilterValue.ofString("(?s)(?i)^\\Q".concat(l,"\\E.*")))):d.eqIgnoreCase(r.FilterValue.ofString(l.toLowerCase()))}return null}makeQuickBooleanFilter(e,t){var r=/^(!=|=|!)?(.*)/,i=r.exec("".concat(t).trim());if(i===null)return null;var[,o,a]=i,s=o==="!"||o==="!=",l=a.trim().toLowerCase(),d=e.filter();try{var h=C.makeBooleanValue(l);return h!=null&&h?d=d.isTrue():h===null?d=d.isNull():d=d.isFalse(),s?d.not():d}catch{return null}}makeQuickDateFilter(e,t,r){var i=t.trim(),o=/\s*(>=|<=|=>|=<|>|<|!=|!|=)?(.*)/,a=o.exec(i);if(a==null||a.length<=2)throw new Error("Unable to parse date filter: ".concat(t));var s=null,l=null;[,s,l]=a;var d=E.eq;switch(s){case"<":d=E.lessThan;break;case"<=":case"=<":d=E.lessThanOrEqualTo;break;case">":d=E.greaterThan;break;case">=":case"=>":d=E.greaterThanOrEqualTo;break;case"!=":case"!":d=E.notEq;break;case"=":case"==":default:d=E.eq;break}return this.makeQuickDateFilterWithOperation(e,l,d,r)}makeQuickDateFilterWithOperation(e,t,r,i){var{dh:o}=this,[a,s]=we.parseDateRange(o,t,i),l=a!=null?o.FilterValue.ofNumber(a):null,d=s!=null?o.FilterValue.ofNumber(s):null,h=e.filter();if(l==null)return r===E.notEq?h.isNull().not():h.isNull();switch(r){case E.eq:{if(d!=null){var c=h.greaterThanOrEqualTo(l),v=h.lessThan(d);return c.and(v)}return h.eq(l)}case E.lessThan:return h.lessThan(l);case E.lessThanOrEqualTo:return d!=null?h.lessThan(d):h.lessThanOrEqualTo(l);case E.greaterThan:return d!=null?h.greaterThanOrEqualTo(d):h.greaterThan(l);case E.greaterThanOrEqualTo:return h.greaterThanOrEqualTo(l);case E.notEq:{if(d!=null){var p=h.lessThan(l),g=h.greaterThanOrEqualTo(d);return p.or(g)}return h.notEq(l)}default:throw new Error("Invalid operator: ".concat(r))}}makeQuickCharFilter(e,t){var{dh:r}=this,i="".concat(t).trim(),o=/^(>=|<=|=>|=<|>|<|!=|=|!)?(null|"."|'.'|.)?(.*)/,a=o.exec(i),s=null,l=null,d=null;if(a!==null&&a.length>3&&([,s,l,d]=a),d!=null&&d.trim().length>0||l==null||l.length===0)return null;s==null&&(s="=");var h=e.filter();if(l.toLowerCase()==="null")switch(s){case"=":return h.isNull();case"!=":case"!":return h.isNull().not();default:return null}var c=r.FilterValue.ofString(C.isRangeOperation(s)?C.quoteValue(l):l);return C.makeRangeFilterWithOperation(h,s,c)}makeAdvancedFilter(e,t,r){for(var{filterItems:i,filterOperators:o,invertSelection:a,selectedValues:s}=t,l=null,d=0;d<i.length;d+=1){var h=i[d],{selectedType:c,value:v}=h;if(c!=null&&c.length>0&&v!=null&&v.length>0)try{var p=this.makeAdvancedValueFilter(e,c,v,r);if(p!=null){if(d===0)l=p;else if(l!==null&&d-1<o.length){var g=o[d-1];if(g===qn.and)l=l.and(p);else if(g===qn.or)l=l.or(p);else{It.error("Unexpected filter operator",g,p),l=null;break}}}else It.debug2("Empty filter ignored for",c,v)}catch(y){It.error("Unable to create filter",y),l=null;break}}var f=this.makeSelectValueFilter(e,s,a);return f!=null&&(l!=null?l=l.and(f):l=f),l}makeAdvancedValueFilter(e,t,r,i){var{dh:o}=this;if(C.isDateType(e.type))return this.makeQuickDateFilterWithOperation(e,r,t,i);if(C.isNumberType(e.type)||C.isCharType(e.type))return this.makeQuickFilter(e,"".concat(C.getFilterOperatorString(t)).concat(r));var a=this.makeFilterValue(e.type,r),s=e.filter();switch(t){case E.eq:return s.eq(a);case E.eqIgnoreCase:return s.eqIgnoreCase(a);case E.notEq:return s.notEq(a);case E.notEqIgnoreCase:return s.notEqIgnoreCase(a);case E.greaterThan:return s.greaterThan(a);case E.greaterThanOrEqualTo:return s.greaterThanOrEqualTo(a);case E.lessThan:return s.lessThan(a);case E.lessThanOrEqualTo:return s.lessThanOrEqualTo(a);case E.isTrue:return s.isTrue();case E.isFalse:return s.isFalse();case E.isNull:return s.isNull();case E.contains:return s.isNull().not().and(s.invoke("matches",o.FilterValue.ofString("(?s)(?i).*\\Q".concat(r,"\\E.*"))));case E.notContains:return s.isNull().or(s.invoke("matches",o.FilterValue.ofString("(?s)(?i).*\\Q".concat(r,"\\E.*"))).not());case E.startsWith:return s.isNull().not().and(s.invoke("matches",o.FilterValue.ofString("(?s)(?i)^\\Q".concat(r,"\\E.*"))));case E.endsWith:return s.isNull().not().and(s.invoke("matches",o.FilterValue.ofString("(?s)(?i).*\\Q".concat(r,"\\E$"))));case E.in:case E.inIgnoreCase:case E.notIn:case E.notInIgnoreCase:case E.invoke:default:throw new Error("Unexpected filter operation: ".concat(t))}}makeSearchTextFilter(e,t,r){var i=this.getValueType(e.type);try{if(i===this.dh.ValueType.BOOLEAN){var o=this.makeQuickBooleanFilter(e,t);return R(o),o}if(i===this.dh.ValueType.DATETIME)return this.makeQuickDateFilterWithOperation(e,we.trimDateTimeStringTimeZone(t),"eq",r);if(i===this.dh.ValueType.NUMBER){var a=this.makeQuickNumberFilter(e,t);return R(a),a}return C.isBigDecimalType(e.type)||C.isBigIntegerType(e.type)?e.filter().eq(this.makeFilterValue(e.type,t)):e.filter().containsIgnoreCase(this.makeFilterValue(e.type,t))}catch{return this.makeNeverFilter(e)}}applyNeverFilter(e,t){var r=arguments,i=this;return Rt(function*(){var o=r.length>2&&r[2]!==void 0?r[2]:C.APPLY_TABLE_CHANGE_TIMEOUT_MS;if(e==null)return null;var a=e.findColumn(t),s=[i.makeNeverFilter(a)];return yield i.applyFilter(e,s,o),e})()}applyCustomColumns(e,t){var r=arguments,i=this;return Rt(function*(){var o=r.length>2&&r[2]!==void 0?r[2]:C.APPLY_TABLE_CHANGE_TIMEOUT_MS,{dh:a}=i;return C.executeAndWaitForEvent(s=>s?.applyCustomColumns(t),e,a.Table.EVENT_CUSTOMCOLUMNSCHANGED,o)})()}applyFilter(e,t){var r=arguments,i=this;return Rt(function*(){var o=r.length>2&&r[2]!==void 0?r[2]:C.APPLY_TABLE_CHANGE_TIMEOUT_MS,{dh:a}=i;return C.executeAndWaitForEvent(s=>s?.applyFilter(t),e,a.Table.EVENT_FILTERCHANGED,o)})()}applySort(e,t){var r=arguments,i=this;return Rt(function*(){var o=r.length>2&&r[2]!==void 0?r[2]:C.APPLY_TABLE_CHANGE_TIMEOUT_MS,{dh:a}=i;return C.executeAndWaitForEvent(s=>s?.applySort(t),e,a.Table.EVENT_SORTCHANGED,o)})()}makeNeverFilter(e){var{dh:t}=this,r=null;C.isTextType(e.type)?r=t.FilterValue.ofString("a"):C.isBooleanType(e.type)?r=t.FilterValue.ofBoolean(!0):C.isDateType(e.type)?r=t.FilterValue.ofNumber(t.DateWrapper.ofJsDate(new Date)):r=t.FilterValue.ofNumber(0);var i=e.filter().eq(r),o=e.filter().notEq(r);return i.and(o)}makeFilterValue(e,t){var{dh:r}=this,i=C.getBaseType(e);return C.isTextType(i)?r.FilterValue.ofString(t):C.isLongType(i)?r.FilterValue.ofNumber(r.LongWrapper.ofString(C.removeCommas(t))):r.FilterValue.ofNumber(C.removeCommas(t))}makeFilterRawValue(e,t){var{dh:r}=this;return C.isCharType(e)?r.FilterValue.ofString(typeof t=="number"?String.fromCharCode(t):t):C.isTextType(e)?r.FilterValue.ofString(t):C.isBooleanType(e)?r.FilterValue.ofBoolean(t):r.FilterValue.ofNumber(t)}makeNullableEqFilter(e,t){return t==null?e.filter().isNull():e.filter().eq(this.makeFilterRawValue(e.type,t))}makeValue(e,t,r){var{dh:i}=this;if(t==="null")return null;if(C.isTextType(e))return t;if(C.isLongType(e))return i.LongWrapper.ofString(C.removeCommas(t));if(C.isBooleanType(e))return C.makeBooleanValue(t,!0);if(C.isDateType(e)){var[o]=we.parseDateRange(i,t,r);return o}return C.isNumberType(e)?C.makeNumberValue(t):(It.error("Unexpected column type",e),null)}makeSelectValueFilter(e,t,r){var{dh:i}=this;if(t.length===0)return r?null:this.makeNeverFilter(e);for(var o=[],a=!1,s=0;s<t.length;s+=1){var l=t[s];l==null?a=!0:C.isTextType(e.type)?o.push(i.FilterValue.ofString(typeof l=="number"?String.fromCharCode(l):l)):C.isBooleanType(e.type)?o.push(i.FilterValue.ofBoolean(!!l)):o.push(i.FilterValue.ofNumber(l))}return a?o.length>0?r?e.filter().isNull().not().and(e.filter().notIn(o)):e.filter().isNull().or(e.filter().in(o)):r?e.filter().isNull().not():e.filter().isNull():r?e.filter().notIn(o):e.filter().in(o)}}un(C,"dataType",{BOOLEAN:"boolean",CHAR:"char",DATETIME:"datetime",DECIMAL:"decimal",INT:"int",STRING:"string",UNKNOWN:"unknown"});un(C,"sortDirection",{ascending:"ASC",descending:"DESC",reverse:"REVERSE",none:null});un(C,"APPLY_TABLE_CHANGE_TIMEOUT_MS",3e4);un(C,"REVERSE_TYPE",Object.freeze({NONE:"none",PRE_SORT:"pre-sort",POST_SORT:"post-sort"}));un(C,"NUMBER_REGEX",/^-?\d+(\.\d+)?$/);un(C,"executeAndWaitForEvent",function(){var n=Rt(function*(e,t,r){var i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:C.APPLY_TABLE_CHANGE_TIMEOUT_MS;if(t==null)return null;var o=C.makeCancelableTableEventPromise(t,r,i);return e(t),yield o,t});return function(e,t,r){return n.apply(this,arguments)}}());function cn(n,e,t){return(e=Qm(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Qm(n){var e=Jm(n,"string");return typeof e=="symbol"?e:e+""}function Jm(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 js{static makeColumnFormatMap(e){return e==null?new Map:e.reduce((t,r)=>{var i=C.getNormalizedType(r.columnType);if(i===null)return t;t.has(i)||t.set(i,new Map);var o=t.get(i);return o?.set(r.columnName,r.format),t},new Map)}static makeColumnFormattingRule(e,t,r){return{columnType:e,columnName:t,format:r}}constructor(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],r=arguments.length>2?arguments[2]:void 0,i=arguments.length>3?arguments[3]:void 0,o=arguments.length>4?arguments[4]:void 0,a=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!1,s=arguments.length>6&&arguments[6]!==void 0?arguments[6]:!0,l=arguments.length>7&&arguments[7]!==void 0?arguments[7]:!0;cn(this,"defaultColumnFormatter",void 0),cn(this,"typeFormatterMap",void 0),cn(this,"columnFormatMap",void 0),cn(this,"truncateNumbersWithPound",void 0),cn(this,"showEmptyStrings",void 0),cn(this,"showNullStrings",void 0),this.defaultColumnFormatter=new jm,this.typeFormatterMap=new Map([[C.dataType.BOOLEAN,new Om],[C.dataType.CHAR,new Im],[C.dataType.DATETIME,new vt(e,r)],[C.dataType.DECIMAL,new fe(e,i)],[C.dataType.INT,new dt(e,o)],[C.dataType.STRING,new Rm]]),this.columnFormatMap=js.makeColumnFormatMap(t),this.truncateNumbersWithPound=a,this.showEmptyStrings=s,this.showNullStrings=l}getColumnFormatMapForType(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,r=C.getNormalizedType(e);if(r!==null)return t&&!this.columnFormatMap.has(r)&&this.columnFormatMap.set(r,new Map),this.columnFormatMap.get(r)}getColumnFormat(e,t){var r,i=this.getColumnFormatMapForType(e);return(r=i?.get(t))!==null&&r!==void 0?r:null}getColumnTypeFormatter(e){var t=C.getNormalizedType(e),r=this.defaultColumnFormatter;if(t){var i;r=(i=this.typeFormatterMap.get(t))!==null&&i!==void 0?i:r}return r}getFormattedString(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"",i=arguments.length>3?arguments[3]:void 0;if(e==null)return"";var o=this.getColumnTypeFormatter(t),a=i||this.getColumnFormat(t,r);return o.format(e,a??void 0)}get timeZone(){var e=this.typeFormatterMap.get(C.dataType.DATETIME);return ud(e,vt),e.dhTimeZone.id}}const ev="var(--dh-color-chart-colorway)",tv="var(--dh-color-chart-grid)",nv="var(--dh-color-chart-axis-line)",rv="var(--dh-color-chart-axis-line-zero)",Ro={"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:ev,gridcolor:tv,linecolor:nv,zerolinecolor:rv,"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 $o=W.module("ChartTheme");function iv(){var n,e=Ha(Ro);return e.colorway=hd((n=e.colorway)!==null&&n!==void 0?n:"").map(t=>{var[r,i]=t;return cd.normalizeCssColor(e.colorway.substring(r,i+1))}).join(" "),$o.debug2("Chart theme:",Ro),$o.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 Ho(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 ov(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Ho(Object(t),!0).forEach(function(r){av(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Ho(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function av(n,e,t){return(e=sv(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function sv(n){var e=lv(n,"string");return typeof e=="symbol"?e:e+""}function lv(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 dv=m.lazy(()=>za(()=>import("./Plot-wDSZHXHD.js"),__vite__mapDeps([0,1,2,3,4,5]),import.meta.url));function uv(n){return u.jsx(m.Suspense,{fallback:u.jsx(sn,{}),children:u.jsx(dv,ov({},n))})}var As=m.createContext(null);function jb(n){var{children:e}=n,{activeThemes:t}=ns(),r=m.useMemo(iv,[t]);return u.jsx(As.Provider,{value:r,children:e})}function hv(){return Xn(As,"No ChartThemeContext value found.")}function Bo(n,e,t,r,i,o,a){try{var s=n[o](a),l=s.value}catch(d){return void t(d)}s.done?e(l):Promise.resolve(l).then(r,i)}function cv(n){return function(){var e=this,t=arguments;return new Promise(function(r,i){var o=n.apply(e,t);function a(l){Bo(o,r,i,a,s,"next",l)}function s(l){Bo(o,r,i,a,s,"throw",l)}a(void 0)})}}var mv=W.module("HeapUsage");function vv(n){var e,{connection:t,defaultUpdateInterval:r,hoverUpdateInterval:i,bgMonitoring:o=!0,monitorDuration:a}=n,s=hv(),[l,d]=m.useState({freeMemory:0,maximumHeapSize:999,totalHeapSize:0}),[h,c]=m.useState(!1),v=m.useRef({timestamps:[],usages:[]}),p=Ja(),g=m.useCallback(cv(function*(){try{var j=yield t.getWorkerHeapInfo();if(!p.current)return;if(d(j),o||h){for(var V=(j.totalHeapSize-j.freeMemory)/j.maximumHeapSize,z=Date.now(),{timestamps:ve,usages:Ve}=v.current;ve.length!==0&&z-ve[0]>a*1.5;)ve.shift(),Ve.shift();ve.push(z),Ve.push(V)}else v.current={timestamps:[],usages:[]}}catch(ke){mv.warn("Unable to get heap usage",ke)}}),[t,p,o,h,a]);tu(g,h?i:r);var f=(j,V)=>Math.round(j*10**V)/10**V,y=2,T=1024**3,{freeMemory:O,totalHeapSize:P,maximumHeapSize:F}=l,U=f(O/T,y),te=f(P/T,y),N=f(F/T,y),B=te-U,H=function(V,z){var ve=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return u.jsxs("div",{className:X("heap-usage-info-row",{"heading-bottom-border":ve}),children:[u.jsx("div",{className:"font-weight-bold",children:V}),u.jsx("div",{children:z})]})},{timestamps:J,usages:oe}=v.current,L=(e=J[J.length-1])!==null&&e!==void 0?e:0,q=P/F,K=(P-O)/F;return u.jsxs("div",{className:"max-memory",children:[u.jsx("div",{className:"total-memory",style:{width:"calc(".concat(q*100,"% - ").concat(q*2,"px")}}),u.jsx("div",{className:X("used-memory",{"heap-overflow":(P-O)/F>.95}),style:{width:"calc(".concat(K*100,"% - ").concat(K*2,"px")}}),u.jsxs("div",{className:"memory-text",children:[N.toFixed(1)," GB"]}),u.jsx(ue,{onEntered:()=>c(!0),onExited:()=>c(!1),interactive:!0,children:u.jsxs("div",{className:"heap-tooltip",children:[H("In use:","".concat(B.toFixed(y)," of ").concat(N.toFixed(y)," GB"),!0),H("Free:","".concat(U.toFixed(y)," GB")),H("Total:","".concat(te.toFixed(y)," GB")),H("Max:","".concat(N.toFixed(y)," GB")),u.jsx("div",{className:"heap-plot",children:u.jsx(uv,{data:[{x:[...J],y:[...oe],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(a/6),gridcolor:s.linecolor,range:[L-a,L],linecolor:s.linecolor,linewidth:2,mirror:!0},yaxis:{dtick:.2,gridcolor:s.linecolor,range:[0,1],linecolor:s.linecolor,linewidth:2,mirror:!0}}})}),u.jsxs("div",{className:"heap-utilisation-text",children:["% utilization over ",Math.round(a/1e3/60)," min."]})]})})]})}var Ls=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 Fs(n){return n.componentName!==void 0}function pv(n){return n.component!==void 0}var Rs=Object.freeze({type:"default",isClosable:!0,isFocusOnShow:!0,reorderEnabled:!0,title:""});const fv=Object.freeze(Object.defineProperty({__proto__:null,defaultConfig:Ls,isGLComponentConfig:Fs,isReactComponentConfig:pv,itemDefaultConfig:Rs},Symbol.toStringTag,{value:"Module"}));function gr(n,e,t){return(e=gv(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function gv(n){var e=bv(n,"string");return typeof e=="symbol"?e:e+""}function bv(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 Ue{constructor(){gr(this,"_mSubscriptions",void 0),gr(this,"off",this.unbind),gr(this,"trigger",this.emit),this._mSubscriptions={},this._mSubscriptions[Ue.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),o=1;o<r;o++)i[o-1]=arguments[o];if(t)for(var a=0;a<t.length;a++){var s=t[a].ctx||{};try{t[a].fn.apply(s,i)}catch(c){console.error("Error while emitting event:",c)}}i.unshift(e);for(var l=this._mSubscriptions[Ue.ALL_EVENT],d=0;d<l.length;d++){var h=l[d].ctx||{};try{l[d].fn.apply(h,i)}catch(c){console.error("Error while emitting event to allEventSubs:",c)}}}unbind(e,t,r){if(!this._mSubscriptions[e])throw new Error("No subscriptions to unsubscribe for event "+e);for(var i=!1,o=0;o<this._mSubscriptions[e].length;o++)(!t||this._mSubscriptions[e][o].fn===t)&&(!r||r===this._mSubscriptions[e][o].ctx)&&(this._mSubscriptions[e].splice(o,1),i=!0);if(i===!1)throw new Error("Nothing to unbind for "+e)}}gr(Ue,"ALL_EVENT","__all");function ht(n,e,t){return(e=yv(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function yv(n){var e=Cv(n,"string");return typeof e=="symbol"?e:e+""}function Cv(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 ii extends Ue{constructor(e,t,r){super(),ht(this,"width",void 0),ht(this,"height",void 0),ht(this,"title",void 0),ht(this,"parent",void 0),ht(this,"layoutManager",void 0),ht(this,"tab",void 0),ht(this,"_config",void 0),ht(this,"isHidden",!1),ht(this,"beforeCloseHandler",void 0),ht(this,"_element",k(['<div class="lm_item_container">','<div class="lm_content" tabindex="-1"></div>',"</div>"].join(""))),ht(this,"_contentElement",void 0),this.title=Fs(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,o,a=this.parent,s=null;a&&!a.isColumn&&!a.isRow;){var l;if(s=a,a=a.parent,(l=a)!==null&&l!==void 0&&l.isRoot)return!1}if(!a||!s)return!1;for(var d=a.isColumn?"height":"width",h=d==="height"?t:e,c=((r=this[d])!==null&&r!==void 0?r:0)*(1/(((i=s.config[d])!==null&&i!==void 0?i:0)/100)),v=h/c*100,p=(((o=s.config[d])!==null&&o!==void 0?o:0)-v)/(a.contentItems.length-1),g=0;g<a.contentItems.length;g++)if(a.contentItems[g]===s)a.contentItems[g].config[d]=v;else{var f;a.contentItems[g].config[d]=((f=a.contentItems[g].config[d])!==null&&f!==void 0?f:0)+p}return a.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(k.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,o=r.offsetHeight-r.clientHeight;this._contentElement.width(this.width-i).height(this.height-o),this.emit("resize")}}}const Sv=Object.freeze(Object.defineProperty({__proto__:null,Container:ii,ItemContainer:ii},Symbol.toStringTag,{value:"Module"}));function $s(n){var e=location.hash.match(new RegExp(n+"=([^&]*)"));return e?e[1]:null}function Hs(n){if(window.location.hash)return $s(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 Si(n){return window.requestAnimationFrame(n)}function wv(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 Er(){return kt()}function Ev(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 wi(n){return k.trim(n.replace(/(<([^>]+)>)/gi,""))}function Qe(n,e,t){return(e=Pv(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Pv(n){var e=Tv(n,"string");return typeof e=="symbol"?e:e+""}function Tv(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 Qn extends Ue{constructor(e){var t,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;super(),Qe(this,"_eElement",void 0),Qe(this,"_oDocument",void 0),Qe(this,"_eBody",void 0),Qe(this,"_destroyAfterMouseUp",void 0),Qe(this,"_nDelay",400),Qe(this,"_timeout",void 0),Qe(this,"timeout",void 0),Qe(this,"_nDistance",10),Qe(this,"_nX",0),Qe(this,"_nY",0),Qe(this,"_nOriginalX",0),Qe(this,"_nOriginalY",0),Qe(this,"_bDragging",!1),this._eElement=e,this._oDocument=k(document),this._eBody=k(document.body),this._destroyAfterMouseUp=r,this.onMouseMove=this.onMouseMove.bind(this),this.onMouseUp=this.onMouseUp.bind(this),this.onMouseDown=this.onMouseDown.bind(this),this._startDrag=this._startDrag.bind(this),(t=this._eElement)===null||t===void 0||t.on("mousedown",this.onMouseDown)}destroy(){var e,t;(e=this._eElement)===null||e===void 0||e.unbind("mousedown",this.onMouseDown),(t=this._oDocument)===null||t===void 0||t.unbind("mouseup",this.onMouseUp),this._eElement=void 0,this._oDocument=void 0,this._eBody=void 0,clearTimeout(this._timeout),this._timeout=void 0}onMouseDown(e){if(e.preventDefault(),e.button===0){var t,r,i,o,a=this._getCoordinates(e);this._nOriginalX=(t=a.x)!==null&&t!==void 0?t:0,this._nOriginalY=(r=a.y)!==null&&r!==void 0?r:0,(i=this._oDocument)===null||i===void 0||i.on("mousemove",this.onMouseMove),(o=this._oDocument)===null||o===void 0||o.on("mouseup",this.onMouseUp),this._timeout=window.setTimeout(this._startDrag,this._nDelay)}}onMouseMove(e){if(this._timeout!=null){var t,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,o,a;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||(o=i.find("iframe"))===null||o===void 0||o.css("pointer-events",""),this._bDragging===!0&&(this._bDragging=!1,this.emit("dragStop",e,this._nOriginalX+this._nX)),(a=this._eBody)===null||a===void 0||a.removeClass("lm_dragging"),!(this._eElement instanceof Window)){var s;(s=this._eElement)===null||s===void 0||s.removeClass("lm_dragging")}this._destroyAfterMouseUp&&this.destroy()}}_startDrag(){var e,t,r,i;window.clearTimeout(this._timeout),this._bDragging=!0,(e=this._eBody)===null||e===void 0||e.addClass("lm_dragging"),(t=this._eElement)===null||t===void 0||t.addClass("lm_dragging"),(r=this._oDocument)===null||r===void 0||(i=r.find("iframe"))===null||i===void 0||i.css("pointer-events","none"),this.emit("dragStart",this._nOriginalX,this._nOriginalY)}_getCoordinates(e){var t,r;return{x:(t=e.pageX)!==null&&t!==void 0?t:0,y:(r=e.pageY)!==null&&r!==void 0?r:0}}}function mn(n,e,t){return(e=_v(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function _v(n){var e=Ov(n,"string");return typeof e=="symbol"?e:e+""}function Ov(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 Bs{constructor(e,t){mn(this,"_container",void 0),mn(this,"_reactComponent",null),mn(this,"_portalComponent",null),mn(this,"_originalComponentWillUpdate",null),mn(this,"_initialState",void 0),mn(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=Dr.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=k.extend(e,this._container._config.props);return $.createElement(this._reactClass,t)}}var Pr=["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"],Iv=[!0,!1,"row","column","stack","component","close","maximise","minimise","open in new window"];function Ei(n){if(Pr.length>36)throw new Error("Too many keys in config minifier map");var e={};return Pi(n,e,"_min"),e}function oi(n){if(Pr.length>36)throw new Error("Too many keys in config minifier map");var e={};return Pi(n,e,"_max"),e}function Pi(n,e,t){var r=t==="_min"?Dv:xv;for(var i in n)if(n.hasOwnProperty(i)){var o=Array.isArray(n)?n[Number.parseInt(i,10)]:n[i];if(typeof o=="object"&&o!=null){var a=o instanceof Array?[]:{};if(Array.isArray(e))e[Number.parseInt(i,10)]=a;else{var s=r(i,Pr);e[s]=a}Pi(o,a,t)}else{var l=r(o,Iv);if(Array.isArray(e))e[Number.parseInt(i,10)]=l;else{var d=r(i,Pr);e[d]=l}}}}function Dv(n,e){if(typeof n=="string"&&n.length===1)return"___"+n;var t=e.indexOf(n);return t===-1?n:t.toString(36)}function xv(n,e){return typeof n=="string"&&n.length===1?e[parseInt(n,36)]:typeof n=="string"&&n.substr(0,3)==="___"?n[3]:n}function Gr(n,e,t){return(e=Mv(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Mv(n){var e=kv(n,"string");return typeof e=="symbol"?e:e+""}function kv(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var 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 ai{constructor(e,t){Gr(this,"name",void 0),Gr(this,"origin",void 0),Gr(this,"isPropagationStopped",void 0),this.name=e,this.origin=t,this.isPropagationStopped=!1}stopPropagation(){this.isPropagationStopped=!0}}function lr(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=jv(n,"string");return typeof e=="symbol"?e:e+""}function jv(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 Ws=class extends Ue{constructor(e){super(),lr(this,"_layoutManager",void 0),lr(this,"_dontPropagateToParent",void 0),lr(this,"_childEventSource",void 0),lr(this,"_boundOnEventFromChild",void 0),this._layoutManager=e,this._dontPropagateToParent=null,this._childEventSource=null,this.on(Ue.ALL_EVENT,this._onEventFromThis.bind(this)),this._boundOnEventFromChild=this._onEventFromChild.bind(this),k(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(){k(window).off("gl_child_event",this._boundOnEventFromChild)}};function Us(n,e,t){return n.on(e,t),()=>{n.off(e,t)}}function Vs(n){return(e,t)=>Us(e,n,t)}function Ks(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 zs(n){return(e,t)=>{var r=m.useRef(null),i=m.useRef(()=>!1);if(r.current!=e||i.current!=t){var o;(o=r.current)===null||o===void 0||o.off(n,i.current),e?.on(n,t)}r.current=e,i.current=t,m.useEffect(()=>()=>{var a;return(a=r.current)===null||a===void 0?void 0:a.off(n,i.current)},[])}}function Av(n){return{listen:Vs(n),emit:Ks(n),useListener:zs(n)}}const Lv=Object.freeze(Object.defineProperty({__proto__:null,BubblingEvent:ai,DragListener:Qn,EventEmitter:Ue,EventHub:Ws,ReactComponentHandler:Bs,animFrame:Si,filterXss:Ev,getHashValue:$s,getQueryStringParam:Hs,getUniqueId:Er,listenForEvent:Us,makeEmitFunction:Ks,makeEventFunctions:Av,makeListenFunction:Vs,makeUseListenerFunction:zs,minifyConfig:Ei,removeFromArray:wv,stripTags:wi,unminifyConfig:oi},Symbol.toStringTag,{value:"Module"}));function Lt(n,e,t){return(e=Fv(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Fv(n){var e=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)}class Gs extends Ue{constructor(e,t,r,i,o){super(),Lt(this,"isInitialised",!1),Lt(this,"_config",void 0),Lt(this,"_dimensions",void 0),Lt(this,"_parentId",void 0),Lt(this,"_indexInParent",void 0),Lt(this,"_layoutManager",void 0),Lt(this,"_popoutWindow",null),Lt(this,"_id",null),this._config=e,this._dimensions=t,this._parentId=r,this._indexInParent=i,this._layoutManager=o,this._createWindow()}toConfig(){var e,t,r,i,o,a,s,l,d,h,c;if(this.isInitialised===!1)throw new Error("Can't create config, layout not yet initialised");return{dimensions:{width:(e=this.getGlInstance())===null||e===void 0?void 0:e.width,height:(t=this.getGlInstance())===null||t===void 0?void 0:t.height,left:(r=(i=(o=this._popoutWindow)===null||o===void 0?void 0:o.screenX)!==null&&i!==void 0?i:(a=this._popoutWindow)===null||a===void 0?void 0:a.screenLeft)!==null&&r!==void 0?r:0,top:(s=(l=(d=this._popoutWindow)===null||d===void 0?void 0:d.screenY)!==null&&l!==void 0?l:(h=this._popoutWindow)===null||h===void 0?void 0:h.screenTop)!==null&&s!==void 0?s:0},content:(c=this.getGlInstance())===null||c===void 0?void 0:c.toConfig().content,parentId:this._parentId,indexInParent:this._indexInParent}}getGlInstance(){var e;return(e=this._popoutWindow)===null||e===void 0?void 0:e.__glInstance}getWindow(){return this._popoutWindow}close(){if(this.getGlInstance()){var e;(e=this.getGlInstance())===null||e===void 0||e._$closeWindow()}else try{var t;(t=this.getWindow())===null||t===void 0||t.close()}catch{}}popIn(){var e;this._indexInParent;var t=null,r=null;if(this._parentId){var i;if(t=k.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 o;((o=this._layoutManager.root.contentItems.length)!==null&&o!==void 0?o: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;k(this._popoutWindow).on("load",this._positionWindow.bind(this)).on("unload beforeunload",this._onClose.bind(this));var o=window.setInterval(()=>{var a;(a=this._popoutWindow)!==null&&a!==void 0&&a.__glInstance&&this._popoutWindow.__glInstance.isInitialised&&(this._onInitialised(),window.clearInterval(o))},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-"+Er();e=Ei(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 _e(n,e,t){return(e=$v(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function $v(n){var e=Hv(n,"string");return typeof e=="symbol"?e:e+""}function Hv(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 hn extends Ue{constructor(e,t,r,i,o,a){var s,l,d,h,c,v,p,g;if(super(),_e(this,"_dragListener",void 0),_e(this,"_layoutManager",void 0),_e(this,"_contentItem",void 0),_e(this,"_originalParent",void 0),_e(this,"_area",null),_e(this,"_lastValidArea",null),_e(this,"_minX",void 0),_e(this,"_maxX",void 0),_e(this,"_minY",void 0),_e(this,"_maxY",void 0),_e(this,"_width",void 0),_e(this,"_height",void 0),_e(this,"_sided",void 0),_e(this,"element",void 0),_e(this,"childElementContainer",void 0),_e(this,"_proxyTab",void 0),this._dragListener=r,this._layoutManager=i,this._contentItem=o,this._originalParent=a,this._dragListener.on("drag",this._onDrag,this),this._dragListener.on("dragStop",this._onDrop,this),this._contentItem.tab&&this._contentItem.tab.element){var f,y;this._layoutManager.tabDropPlaceholder.width((f=this._contentItem.tab.element.outerWidth(!0))!==null&&f!==void 0?f:0),this._layoutManager.tabDropPlaceholder.height((y=this._contentItem.tab.element.outerHeight(!0))!==null&&y!==void 0?y:0)}if(this.element=k(hn._template),a&&a._side&&(this._sided=a._sided,this.element.addClass("lm_"+a._side),["right","bottom"].indexOf(a._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",wi((s=this._contentItem.config.title)!==null&&s!==void 0?s:"")),this.element.find(".lm_title").text((l=this._contentItem.config.title)!==null&&l!==void 0?l:""),this.childElementContainer=this.element.find(".lm_content"),this.childElementContainer.append(o.element),this._updateTree(),this._layoutManager._$calculateItemAreas(),k(document.body).append(this.element),this._setDimensions(),!this._contentItem.tab&&this._proxyTab.length){var T,O;this._layoutManager.tabDropPlaceholder.width((T=this._proxyTab.outerWidth(!0))!==null&&T!==void 0?T:0),this._layoutManager.tabDropPlaceholder.height((O=this._proxyTab.outerHeight(!0))!==null&&O!==void 0?O:0)}var P=this._layoutManager.container.offset();this._minX=(d=P?.left)!==null&&d!==void 0?d:0,this._minY=(h=P?.top)!==null&&h!==void 0?h:0,this._maxX=((c=this._layoutManager.container.width())!==null&&c!==void 0?c:0)+this._minX,this._maxY=((v=this._layoutManager.container.height())!==null&&v!==void 0?v:0)+this._minY,this._width=(p=this.element.width())!==null&&p!==void 0?p:0,this._height=(g=this.element.height())!==null&&g!==void 0?g:0,this._setDropPosition(e,t),this._layoutManager.emit("itemPickedUp",this._contentItem)}_onDrag(e,t,r){var i,o,a=(i=r.pageX)!==null&&i!==void 0?i:0,s=(o=r.pageY)!==null&&o!==void 0?o:0,l=a>this._minX&&a<this._maxX&&s>this._minY&&s<this._maxY;!l&&this._layoutManager.config.settings.constrainDragToContainer===!0||this._setDropPosition(a,s)}_setDropPosition(e,t){this.element.css({left:e,top:t}),this._area=this._layoutManager._$getArea(e,t),this._area!==null&&(this._lastValidArea=this._area,this._area.contentItem._$highlightDropZone(e,t,this._area))}_onDrop(){var e;(e=this._layoutManager.dropTargetIndicator)===null||e===void 0||e.hide(),this._area!==null?this._area.contentItem._$onDrop(this._contentItem,this._area):this._lastValidArea!==null?this._lastValidArea.contentItem._$onDrop(this._contentItem,this._lastValidArea):this._originalParent?this._originalParent.addChild(this._contentItem):this._contentItem._$destroy(),this._dragListener.off("drag",this._onDrag,this),this._dragListener.off("dragStop",this._onDrop,this),this.element.remove(),this._layoutManager.emit("itemDropped",this._contentItem)}_updateTree(){this._contentItem.parent&&this._contentItem.parent.removeChild(this._contentItem,!0),this._contentItem._$setParent(null)}_setDimensions(){var e=this._layoutManager.config.dimensions,t=e.dragProxyWidth,r=e.dragProxyHeight;this.element.width(t),this.element.height(r),t-=this._sided?e.headerHeight:0,r-=this._sided?0:e.headerHeight,this.childElementContainer.width(t),this.childElementContainer.height(r),this._contentItem.element.width(t),this._contentItem.element.height(r),this._contentItem.callDownwards("_$show"),this._contentItem.callDownwards("setSize")}}_e(hn,"_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 dr(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=Wv(n,"string");return typeof e=="symbol"?e:e+""}function Wv(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var 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 qs{constructor(e,t,r){dr(this,"_element",void 0),dr(this,"_itemConfig",void 0),dr(this,"_layoutManager",void 0),dr(this,"_dragListener",void 0),this._element=e,this._itemConfig=t,this._layoutManager=r,this._dragListener=this._createDragListener()}_createDragListener(){return this._dragListener=new Qn(this._element,!0),this._dragListener.on("dragStart",this._onDragStart,this),this._dragListener.on("dragStop",this._createDragListener,this),this._dragListener}_onDragStart(e,t){var r=this._itemConfig;typeof r=="function"&&(r=r());var i=this._layoutManager._$normalizeContentItem(k.extend(!0,{},r));new hn(e,t,this._dragListener,this._layoutManager,i,null)}}function ur(n,e,t){return(e=Uv(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Uv(n){var e=Vv(n,"string");return typeof e=="symbol"?e:e+""}function Vv(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 Zs{constructor(e,t,r){ur(this,"_element",k(window)),ur(this,"_itemConfig",void 0),ur(this,"_layoutManager",void 0),ur(this,"_dragListener",void 0),this._itemConfig=e,this._layoutManager=t,this._createDragListener(r)}_createDragListener(e){this._dragListener&&this._dragListener.destroy(),this._element&&(this._dragListener=new Qn(this._element,!0),this._dragListener.on("dragStart",this._onDragStart,this),this._dragListener.on("dragStop",this._destroy,this),this._dragListener.onMouseDown(e),this._dragListener._startDrag())}_destroy(){this._dragListener=void 0,this._element=void 0,this._itemConfig=void 0,this._layoutManager=void 0}_onDragStart(e,t){if(!(!this._dragListener||!this._layoutManager)){var r=this._itemConfig;typeof r=="function"&&(r=r());var i=this._layoutManager._$normalizeContentItem(k.extend(!0,{},r));new hn(e,t,this._dragListener,this._layoutManager,i,null)}}}function Xs(n,e,t){return(e=Kv(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Kv(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 Jn{constructor(){Xs(this,"element",k(Jn._template)),k(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()}}Xs(Jn,"_template",'<div class="lm_dropTargetIndicator"><div class="lm_inner"></div></div>');function qr(n,e,t){return(e=Gv(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Gv(n){var e=qv(n,"string");return typeof e=="symbol"?e:e+""}function qv(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{constructor(e,t,r,i){qr(this,"element",void 0),qr(this,"_header",void 0),qr(this,"_action",void 0),this._header=e,this.element=k('<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 Zv(n,e,t){return(e=Xv(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Xv(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)}class nn extends Error{constructor(e,t){super(),Zv(this,"node",void 0),this.name="Configuration Error",this.message=e,this.node=t}}const Qv=Object.freeze(Object.defineProperty({__proto__:null,ConfigurationError:nn},Symbol.toStringTag,{value:"Module"}));function Pe(n,e,t){return(e=Jv(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Jv(n){var e=ep(n,"string");return typeof e=="symbol"?e:e+""}function ep(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 rn(n){return n.isStack}function nt(n){return n.isComponent}function Ys(n){return n.isRoot}class De extends Ue{constructor(e,t,r,i){super(),Pe(this,"config",void 0),Pe(this,"type",void 0),Pe(this,"contentItems",void 0),Pe(this,"parent",void 0),Pe(this,"layoutManager",void 0),Pe(this,"element",void 0),Pe(this,"childElementContainer",void 0),Pe(this,"componentName",void 0),Pe(this,"isInitialised",!1),Pe(this,"isMaximised",!1),Pe(this,"isRoot",!1),Pe(this,"isRow",!1),Pe(this,"isColumn",!1),Pe(this,"isStack",!1),Pe(this,"isComponent",!1),Pe(this,"tab",void 0),Pe(this,"_pendingEventPropagations",void 0),Pe(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(Ue.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 o=0;o<this.contentItems.length;o++)this.contentItems[o].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 o;(o=this.parent)===null||o===void 0||o.removeChild(this)}}addChild(e,t){e=this.layoutManager._$normalizeContentItem(e,this),t===void 0&&(t=this.contentItems.length),this.contentItems.splice(t,0,e),this.config.content===void 0&&(this.config.content=[]),this.config.content.splice(t,0,e.config),e.parent=this,e.parent.isInitialised===!0&&e.isInitialised===!1&&e._$init()}replaceChild(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;t=this.layoutManager._$normalizeContentItem(t);var i=this.contentItems.indexOf(e),o=e.element[0].parentNode;if(i===-1)throw new Error("Can't replace child. oldChild is not child of this");o?.replaceChild(t.element[0],e.element[0]),r===!0&&(e.parent=null,e._$destroy()),this.contentItems[i]=t,t.parent=this,rn(this)&&(this.header.tabs[i].contentItem=t),t.parent.isInitialised===!0&&t.isInitialised===!1&&t._$init(),this.callDownwards("setSize")}remove(){var e;(e=this.parent)===null||e===void 0||e.removeChild(this)}popout(){var e=this.layoutManager.createPopout(this);return this.emitBubblingEvent("stateChanged"),e}toggleMaximise(e){e&&e.preventDefault(),this.isMaximised===!0?this.layoutManager._$minimiseItem(this):this.layoutManager._$maximiseItem(this),this.isMaximised=!this.isMaximised,this.emitBubblingEvent("stateChanged")}select(){this.layoutManager.selectedItem!==this&&(this.layoutManager.selectItem(this,!0),this.element.addClass("lm_selected"))}deselect(){this.layoutManager.selectedItem===this&&(this.layoutManager.selectedItem=null,this.element.removeClass("lm_selected"))}setTitle(e){this.config.title=e,this.emit("titleChanged",e),this.emitBubblingEvent("stateChanged")}hasId(e){if(this.config.id){if(typeof this.config.id=="string")return this.config.id===e;if(this.config.id instanceof Array)return this.config.id.indexOf(e)!==-1}else return!1}addId(e){this.hasId(e)||(this.config.id?typeof this.config.id=="string"?this.config.id=[this.config.id,e]:this.config.id instanceof Array&&this.config.id.push(e):this.config.id=e)}removeId(e){if(!this.hasId(e))throw new Error("Id not found");if(typeof this.config.id=="string")delete this.config.id;else if(this.config.id instanceof Array){var t=this.config.id.indexOf(e);this.config.id.splice(t,1)}}getItemsByFilter(e){var t=[],r=function i(o){for(var a=0;a<o.contentItems.length;a++)e(o.contentItems[a])===!0&&t.push(o.contentItems[a]),i(o.contentItems[a])};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&&nt(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 o=(t=e.offset())!==null&&t!==void 0?t:{left:0,top:0},a=(r=e.width())!==null&&r!==void 0?r:0,s=(i=e.height())!==null&&i!==void 0?i:0;return{x1:o.left,y1:o.top,x2:o.left+a,y2:o.top+s,surface:a*s,contentItem:this,side:""}}_$init(){this.setSize();for(var e=0;e<this.contentItems.length;e++){var t;(t=this.childElementContainer)===null||t===void 0||t.append(this.contentItems[e].element)}this.isInitialised=!0,this.emitBubblingEvent("itemCreated"),this.emitBubblingEvent(this.type+"Created")}emitBubblingEvent(e){var t=new ai(e,this);this.emit(e,t)}_createContentItems(e){var t;if(!(e.content instanceof Array))throw new nn("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(Rs)){var i=t;e[i]===void 0&&(e[i]=r)}return e}_propagateEvent(e,t){t instanceof ai&&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,Si(this._propagateEventToLayoutManager.bind(this,e,t)))}_propagateEventToLayoutManager(e,t){this._pendingEventPropagations[e]=!1,this.layoutManager.emit(e,t)}}function jn(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 Qs extends De{constructor(e,t,r){var i;Object.entries((i=e.config.settings.defaultComponentConfig)!==null&&i!==void 0?i:{}).forEach(s=>{var[l,d]=s;t[l]===void 0&&(t[l]=d)}),super(e,t,r,k()),jn(this,"config",void 0),jn(this,"componentName",void 0),jn(this,"container",void 0),jn(this,"parent",void 0),jn(this,"instance",void 0),this.config=t,this.parent=r;var o=e.getComponent(this.config.componentName)||e.getFallbackComponent(),a=k.extend(!0,{},this.config.componentState||{});if(o==null)throw new nn('Unknown component "'+this.config.componentName+'"');a.componentName=this.config.componentName,this.componentName=this.config.componentName,this.config.title===""&&(this.config.title=this.config.componentName),this.isComponent=!0,this.container=new ii(this.config,this,e),this.instance=new o(this.container,a),this.element=this.container._element}close(){this.parent.removeChild(this)}setSize(){this.element.is(":visible")&&this.container._$setSize(this.element.width(),this.element.height())}_$init(){De.prototype._$init.call(this),this.container.emit("open")}_$hide(){this.container.hide(),De.prototype._$hide.call(this)}_$show(){this.container.show(),this.container._config.isFocusOnShow&&this.container._contentElement[0].focus({preventScroll:!0}),De.prototype._$show.call(this)}_$destroy(){this.container.emit("destroy",this),De.prototype._$destroy.call(this)}_$getArea(){return null}}function at(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 Tr extends De{constructor(e,t,r,i){super(t,r,i,k('<div class="lm_item lm_'+(e?"column":"row")+'"></div>')),at(this,"isRow",void 0),at(this,"isColumn",void 0),at(this,"childElementContainer",void 0),at(this,"parent",void 0),at(this,"_splitter",[]),at(this,"_splitterSize",void 0),at(this,"_splitterGrabSize",void 0),at(this,"_isColumn",void 0),at(this,"_dimension",void 0),at(this,"_splitterPosition",null),at(this,"_splitterMinPosition",null),at(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,o,a,s;if(e=this.layoutManager._$normalizeContentItem(e,this),t===void 0&&(t=this.contentItems.length),this.contentItems.length>0?(s=this._createSplitter(Math.max(0,t-1)).element,t>0?(this.contentItems[t-1].element.after(s),s.after(e.element)):(this.contentItems[0].element.before(s),s.before(e.element))):this.childElementContainer.append(e.element),De.prototype.addChild.call(this,e,t),i=1/this.contentItems.length*100,r===!0){this.emitBubblingEvent("stateChanged");return}for(a=0;a<this.contentItems.length;a++)if(this.contentItems[a]===e)e.config[this._dimension]=i;else{var l;o=((l=this.contentItems[a].config[this._dimension])!==null&&l!==void 0?l:0)*(100-i)/100,this.contentItems[a].config[this._dimension]=o}this.callDownwards("setSize"),this.emitBubblingEvent("stateChanged")}removeChild(e,t){var r,i=(r=e.config[this._dimension])!==null&&r!==void 0?r:0,o=this.contentItems.indexOf(e),a=Math.max(o-1,0),s,l;if(o===-1)throw new Error("Can't remove child. ContentItem is not child of this Row or Column");for(this._splitter[a]&&(this._splitter[a]._$destroy(),this._splitter.splice(a,1)),s=0;s<this.contentItems.length;s++)if(this.contentItems[s]!==e){var d;this.contentItems[s].config[this._dimension]=((d=this.contentItems[s].config[this._dimension])!==null&&d!==void 0?d:0)+i/(this.contentItems.length-1)}De.prototype.removeChild.call(this,e,t),this.contentItems.length===1&&this.config.isClosable===!0?(l=this.contentItems[0],this.contentItems=[],this.parent.replaceChild(this,l,!0)):(this.callDownwards("setSize"),this.emitBubblingEvent("stateChanged"))}replaceChild(e,t){var r=e.config[this._dimension];super.replaceChild(e,t),t.config[this._dimension]=r,this.callDownwards("setSize"),this.emitBubblingEvent("stateChanged")}setSize(){this.contentItems.length>0&&(this._calculateRelativeSizes(),this._setAbsoluteSizes()),this.emitBubblingEvent("stateChanged"),this.emit("resize")}_$init(){if(this.isInitialised!==!0){var e;for(De.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,o=(t=this.element.height())!==null&&t!==void 0?t:0,a=0,s=[];this._isColumn?o-=r:i-=r;for(var l=0;l<this.contentItems.length;l++){var d,h,c=this._isColumn?Math.floor(o*(((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));a+=c,s.push(c)}var v=Math.floor((this._isColumn?o:i)-a);return{itemSizes:s,additionalPixel:v,totalWidth:i,totalHeight:o}}_calculateRelativeSizes(){for(var e=0,t=[],r=this._isColumn?"height":"width",i=0;i<this.contentItems.length;i++){var o=this.contentItems[i].config[r];o!=null?e+=o:t.push(this.contentItems[i])}if(Math.round(e)===100){this._respectMinItemWidth();return}if(Math.round(e)<100&&t.length>0){for(var a=0;a<t.length;a++)t[a].config[r]=(100-e)/t.length;this._respectMinItemWidth();return}if(Math.round(e)>100)for(var s=0;s<t.length;s++)t[s].config[r]=50,e+=50;for(var l=0;l<this.contentItems.length;l++){var d;this.contentItems[l].config[r]=((d=this.contentItems[l].config[r])!==null&&d!==void 0?d:0)/e*100}this._respectMinItemWidth()}_respectMinItemWidth(){var e,t=this.layoutManager.config.dimensions&&(e=this.layoutManager.config.dimensions.minItemWidth)!==null&&e!==void 0?e:0,r=[],i=0,o=0,a=0,s=[],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 c=d.itemSizes[h];c<t?(o+=t-c,l={width:t}):(i+=c-t,l={width:c},r.push(l)),s.push(l)}if(!(o===0||o>i)){var v=o/i;a=o;for(var p=0;p<r.length;p++){l=r[p];var g=Math.round((l.width-t)*v);a-=g,l.width-=g}a!==0&&(s[s.length-1].width-=a);for(var f=0;f<this.contentItems.length;f++)this.contentItems[f].config.width=s[f].width/d.totalWidth*100}}}_createSplitter(e){var t;return t=new Js(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 o,a;t=Math.max((o=e[i].minWidth)!==null&&o!==void 0?o:0,t),r=Math.max((a=e[i].minHeight)!==null&&a!==void 0?a:0,r)}return{horizontal:t,vertical:r}}_onSplitterDragStart(e){var t,r,i,o,a=this._getItemsForSplitter(e),s=this.layoutManager.config.dimensions[this._isColumn?"minItemHeight":"minItemWidth"],l=this._getMinimumDimensions((t=a.before.config.content)!==null&&t!==void 0?t:[]),d=this._isColumn?l.vertical:l.horizontal,h=this._getMinimumDimensions((r=a.after.config.content)!==null&&r!==void 0?r:[]),c=this._isColumn?h.vertical:h.horizontal;this._splitterPosition=0,this._splitterMinPosition=-1*(((i=a.before.element[this._dimension]())!==null&&i!==void 0?i:0)-(d||s)),this._splitterMaxPosition=((o=a.after.element[this._dimension]())!==null&&o!==void 0?o:0)-(c||s)}_onSplitterDrag(e,t,r){var i=this._isColumn?r:t;this._splitterMaxPosition==null||this._splitterMinPosition==null||i>this._splitterMinPosition&&i<this._splitterMaxPosition&&(this._splitterPosition=i,e.element.css(this._isColumn?"top":"left",i))}_onSplitterDragStop(e){var t,r,i,o,a,s=this._getItemsForSplitter(e),l=(t=s.before.element[this._dimension]())!==null&&t!==void 0?t:0,d=(r=s.after.element[this._dimension]())!==null&&r!==void 0?r:0,h=(((i=this._splitterPosition)!==null&&i!==void 0?i:0)+l)/(l+d),c=((o=s.before.config[this._dimension])!==null&&o!==void 0?o:0)+((a=s.after.config[this._dimension])!==null&&a!==void 0?a:0);s.before.config[this._dimension]=h*c,s.after.config[this._dimension]=(1-h)*c,e.element.css({top:0,left:0}),Si(this.callDownwards.bind(this,"setSize",void 0,void 0,void 0))}}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 Uo(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){si(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 si(n,e,t){return(e=op(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function op(n){var e=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)}class li extends De{constructor(e,t,r){super(e,Uo(Uo({},t),{},{type:"root"}),null,k('<div class="lm_goldenlayout lm_item lm_root"></div>')),si(this,"childElementContainer",void 0),si(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(nt(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,o=i==="left"||i==="right"?"row":"column",a=i==="left"||i==="right"?"width":"height",s=i==="left"||i==="top",l=this.contentItems[0];if(!(l instanceof Tr)||l.type!=o){var d=this.layoutManager.createContentItem({type:o},this);this.replaceChild(l,d),d.addChild(e,s?0:void 0,!0),d.addChild(l,s?void 0:0,!0),l.config[a]=50,e.config[a]=50,d.callDownwards("setSize")}else{var h,c=l.contentItems[s?0:l.contentItems.length-1];l.addChild(e,s?0:void 0,!0),c.config[a]=((h=c.config[a])!==null&&h!==void 0?h:0)*.5,e.config[a]=c.config[a],l.callDownwards("setSize")}}}}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 vn(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){qe(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 qe(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=lp(n,"string");return typeof e=="symbol"?e:e+""}function lp(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 di extends De{constructor(e,t,r){var i,o,a,s,l,d,h,c,v;super(e,t,r,k('<div class="lm_item lm_stack"></div>')),qe(this,"_activeContentItem",null),qe(this,"_header",void 0),qe(this,"childElementContainer",k('<div class="lm_items"></div>')),qe(this,"header",void 0),qe(this,"parent",void 0),qe(this,"isStack",!0),qe(this,"_dropZones",{}),qe(this,"_dropSegment",null),qe(this,"_contentAreaDimensions",null),qe(this,"_dropIndex",void 0),qe(this,"_side",void 0),qe(this,"_sided",!1),qe(this,"config",void 0),this.parent=r,this.config=t;var p=e.config;this._side=!1,this._header={show:((i=p.settings)===null||i===void 0?void 0:i.hasHeaders)&&t.hasHeaders!==!1,popout:(o=p.settings)!==null&&o!==void 0&&o.showPopoutIcon?(a=p.labels)===null||a===void 0?void 0:a.popout:void 0,maximise:(s=p.settings)!==null&&s!==void 0&&s.showMaximiseIcon?(l=p.labels)===null||l===void 0?void 0:l.maximise:void 0,close:(d=p.settings)!==null&&d!==void 0&&d.showCloseIcon?(h=p.labels)===null||h===void 0?void 0:h.close:void 0,minimise:(c=(v=p.labels)===null||v===void 0?void 0:v.minimise)!==null&&c!==void 0?c:void 0},p.header&&(this._header=vn(vn({},this._header),p.header)),t.header&&(this._header=vn(vn({},this._header),t.header)),t.content&&t.content[0]&&t.content[0].header&&(this._header=vn(vn({},this._header),t.content[0].header)),this.header=new Nt(e,this),this.element.append(this.header.element),this.element.append(this.childElementContainer),this._setupHeaderPosition(),this._$validateClosability()}setSize(){var e,t,r,i,o,a=this._header.show&&(e=(t=this.layoutManager.config.dimensions)===null||t===void 0?void 0:t.headerHeight)!==null&&e!==void 0?e:0,s=((r=this.element.width())!==null&&r!==void 0?r:0)-(this._sided?a:0),l=((i=this.element.height())!==null&&i!==void 0?i:0)-(this._sided?0:a);for(this.childElementContainer.width(s),this.childElementContainer.height(l),o=0;o<this.contentItems.length;o++)this.contentItems[o].element.width(s).height(l);this.emit("resize"),this.emitBubblingEvent("stateChanged")}_$init(){if(this.isInitialised!==!0){this.header._attachWheelListener(),super._$init();for(var e=0;e<this.contentItems.length;e++)this.header.createTab(this.contentItems[e]),this.contentItems[e]._$hide();if(this.contentItems.length>0){var t=this.contentItems[this.config.activeItemIndex||0];if(!t)throw new Error("Configured activeItemIndex out of bounds");this.setActiveContentItem(t)}}}setActiveContentItem(e){if(this.contentItems.indexOf(e)===-1)throw new Error("contentItem is not a child of this stack");this._activeContentItem!==null&&this._activeContentItem._$hide(),this._activeContentItem=e,this.header.setActiveContentItem(e),e._$show(),this.emit("activeContentItemChanged",e),this.layoutManager.emit("activeContentItemChanged",e),this.emitBubblingEvent("stateChanged")}getActiveContentItem(){return this.header.activeContentItem}addChild(e,t){e=this.layoutManager._$normalizeContentItem(e,this),super.addChild(e,t),this.childElementContainer.append(e.element),this.header.createTab(e,t),this.setActiveContentItem(e),this.callDownwards("setSize"),this._$validateClosability(),this.emitBubblingEvent("stateChanged")}removeChild(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,r=this.contentItems.indexOf(e);super.removeChild(e,t),this.header.removeTab(e),this.header.activeContentItem===e&&(this.contentItems.length>0?this.setActiveContentItem(this.contentItems[Math.max(r-1,0)]):this._activeContentItem=null),this._$validateClosability(),this.emitBubblingEvent("stateChanged")}_$validateClosability(){for(var e=this.header._isClosable(),t=0,r=this.contentItems.length;t<r;t++){var i;if(!e)break;e=(i=this.contentItems[t].config.isClosable)!==null&&i!==void 0?i:!1}this.header._$setClosable(e)}_$destroy(){De.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",o=t&&this.parent.isColumn||r&&this.parent.isRow,a=t?"column":"row",s=t?"height":"width";if(nt(e)){var l=this.layoutManager.createContentItem({type:"stack",header:e.config.header||{}},this);l._$init(),l.addChild(e),e=l}if(o){var d,h=this.parent.contentItems.indexOf(this);this.parent.addChild(e,i?h:h+1,!0),this.config[s]=((d=this.config[s])!==null&&d!==void 0?d:0)*.5,e.config[s]=this.config[s],this.parent.callDownwards("setSize")}else{var c=this.layoutManager.createContentItem({type:a},this);this.parent.replaceChild(this,c),c.addChild(e,i?0:void 0,!0),c.addChild(this,i?void 0:0,!0),this.config[s]=50,e.config[s]=50,c.callDownwards("setSize")}}_$highlightDropZone(e,t){if(this._contentAreaDimensions)for(var[r,i]of Object.entries(this._contentAreaDimensions)){var o=i.hoverArea;if(o.x1<e&&o.x2>e&&o.y1<t&&o.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,o,a,s,l,d,h,c,v,p,g,f,y,T,O=this.header.tabs.length;if(O===0){var P,F,U,te,N,B,H,J,oe=this.header.element.offset();(P=this.layoutManager.dropTargetIndicator)===null||P===void 0||P.highlightArea({x1:(F=oe?.left)!==null&&F!==void 0?F:0,x2:((U=oe?.left)!==null&&U!==void 0?U:0)+100,y1:(te=(N=this.header.element.offset())===null||N===void 0?void 0:N.top)!==null&&te!==void 0?te:0,y2:((B=(H=this.header.element.offset())===null||H===void 0?void 0:H.top)!==null&&B!==void 0?B:0)+((J=this.header.element.innerHeight())!==null&&J!==void 0?J:0)});return}var L=this.header.tabsContainer,q=(t=L.get(0))===null||t===void 0?void 0:t.getBoundingClientRect(),K=(r=this.layoutManager.tabDropPlaceholder.get(0))===null||r===void 0?void 0:r.getBoundingClientRect();if(!(!q||!K)){e<q.left?e=q.left+1:e>q.right&&(e=q.right-1);var j,V;if(!(K.left<e&&e<K.right)){for(var z=0;z<O;z++){var ve;if(j=this.header.tabs[z].element,V=(ve=j.get(0))===null||ve===void 0?void 0:ve.getBoundingClientRect(),V&&V.left<e&&e<V.right){this._dropIndex=z;break}}if(j&&V&&e<V.left+V.width*.5)j.before(this.layoutManager.tabDropPlaceholder);else if(j){var Ve;this._dropIndex=Math.min(((Ve=this._dropIndex)!==null&&Ve!==void 0?Ve:0)+1,O),j.after(this.layoutManager.tabDropPlaceholder)}}var ke=(i=(o=this.layoutManager.tabDropPlaceholder.offset())===null||o===void 0?void 0:o.left)!==null&&i!==void 0?i:0;ke=Math.max(ke,(a=(s=this.header.tabsContainer.offset())===null||s===void 0?void 0:s.left)!==null&&a!==void 0?a:0);var b=ke+((l=this.layoutManager.tabDropPlaceholder.width())!==null&&l!==void 0?l:0);b=Math.min(b,((d=(h=this.header.tabsContainer.offset())===null||h===void 0?void 0:h.left)!==null&&d!==void 0?d:0)+((c=this.header.tabsContainer.innerWidth())!==null&&c!==void 0?c:0)),(v=this.layoutManager.dropTargetIndicator)===null||v===void 0||v.highlightArea({x1:ke,x2:b,y1:(p=(g=this.header.element.offset())===null||g===void 0?void 0:g.top)!==null&&p!==void 0?p:0,y2:((f=(y=this.header.element.offset())===null||y===void 0?void 0:y.top)!==null&&f!==void 0?f:0)+((T=this.header.element.innerHeight())!==null&&T!==void 0?T:0)})}}_resetHeaderDropZone(){this.layoutManager.tabDropPlaceholder.remove()}_setupHeaderPosition(){var e=["right","left","bottom"].some(r=>r===this._header.show)?this._header.show:void 0;if(this.header.element.toggle(!!this._header.show),!!e&&(this._side=e,this._sided=["right","left"].indexOf(this._side.toString())>=0,this.element.removeClass("lm_left lm_right lm_bottom"),this._side&&this.element.addClass("lm_"+this._side),this.element.find(".lm_header").length&&this.childElementContainer)){var t=["right","bottom"].indexOf(this._side.toString())>=0?"before":"after";this.header.element[t](this.childElementContainer),this.callDownwards("setSize")}}_highlightBodyDropZone(e){var t,r,i=(t=this._contentAreaDimensions)===null||t===void 0||(r=t[e])===null||r===void 0?void 0:r.highlightArea;if(i){var o;(o=this.layoutManager.dropTargetIndicator)===null||o===void 0||o.highlightArea(i)}this._dropSegment=e}}const dp=Object.freeze(Object.defineProperty({__proto__:null,AbstractContentItem:De,Component:Qs,ContentItem:De,Root:li,RowOrColumn:Tr,Stack:di,isComponent:nt,isRoot:Ys,isStack:rn},Symbol.toStringTag,{value:"Module"}));function xt(n,e,t){return(e=up(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function up(n){var e=hp(n,"string");return typeof e=="symbol"?e:e+""}function hp(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 er{constructor(e,t){var r;xt(this,"header",void 0),xt(this,"contentItem",void 0),xt(this,"element",k(er._template)),xt(this,"titleElement",void 0),xt(this,"closeElement",void 0),xt(this,"isActive",!1),xt(this,"_layoutManager",void 0),xt(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 Qn(this.element),this._dragListener.on("dragStart",this._onDragStart,this),this.contentItem.on("destroy",this._dragListener.destroy,this._dragListener)),this._onTabClick=this._onTabClick.bind(this),this._onCloseClick=this._onCloseClick.bind(this),this._onTabContentFocusIn=this._onTabContentFocusIn.bind(this),this._onTabContentFocusOut=this._onTabContentFocusOut.bind(this),this.element.on("click",this._onTabClick),this.element.on("auxclick",this._onTabClick),this.contentItem.config.isClosable?(this.closeElement.on("click",this._onCloseClick),this.closeElement.on("mousedown",this._onCloseMousedown)):this.closeElement.remove(),this.contentItem.tab=this,this.contentItem.emit("tab",this),this.contentItem.layoutManager.emit("tabCreated",this),nt(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.closeElement.off("click",this._onCloseClick),nt(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 hn(e,t,this._dragListener,this._layoutManager,this.contentItem,this.header.parent)}_onTabContentFocusIn(){k(".lm_focusin",this._layoutManager.root.element).removeClass("lm_focusin"),this.element.addClass("lm_focusin")}_onTabContentFocusOut(){nt(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&&nt(this.contentItem)?this.header.parent.setActiveContentItem(this.contentItem):nt(this.contentItem)&&!this.contentItem.container._contentElement[0].contains(document.activeElement)&&this.contentItem.container._contentElement.focus(),nt(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(),nt(this.contentItem)?this.contentItem.container.close():this.header.parent.removeChild(this.contentItem)}_onCloseMousedown(e){e.stopPropagation()}}xt(er,"_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 le(n,e,t){return(e=cp(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function cp(n){var e=mp(n,"string");return typeof e=="symbol"?e:e+""}function mp(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var 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 Nt extends Ue{constructor(e,t){var r,i;super(),le(this,"layoutManager",void 0),le(this,"element",k(Nt._template)),le(this,"tabsContainer",void 0),le(this,"tabDropdownContainer",void 0),le(this,"tabDropdownSearch",void 0),le(this,"tabDropdownList",null),le(this,"controlsContainer",void 0),le(this,"parent",void 0),le(this,"tabs",[]),le(this,"activeContentItem",null),le(this,"closeButton",null),le(this,"tabDropdownButton",null),le(this,"tabNextButton",k(Nt._nextButtonTemplate)),le(this,"tabPreviousButton",k(Nt._previousButtonTemplate)),le(this,"holdTimer",null),le(this,"rAF",null),le(this,"CLICK_TIMEOUT",500),le(this,"START_SPEED",.01),le(this,"ACCELERATION",5e-4),le(this,"PADDING",10),le(this,"SCROLL_LEFT","left"),le(this,"SCROLL_RIGHT","right"),le(this,"isDraggingTab",!1),le(this,"isOverflowing",!1),le(this,"isDropdownShown",!1),le(this,"dropdownKeyIndex",0),le(this,"_lastVisibleTabIndex",-1),le(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 er(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,o,a=0;a<this.tabs.length;a++)o=this.tabs[a].contentItem===e,this.tabs[a].setActive(o),o===!0&&(this.activeContentItem=e,this.parent.config.activeItemIndex=a);(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,o,a,s;if(((r=(i=this.tabs[t].element.get(0))===null||i===void 0?void 0:i.offsetLeft)!==null&&r!==void 0?r:0)>((o=(a=this.tabsContainer.get(0))===null||a===void 0?void 0:a.offsetWidth)!==null&&o!==void 0?o:0)+((s=this.tabsContainer.scrollLeft())!==null&&s!==void 0?s:0)){e=this.tabs[t].element.get(0);break}}if(e)e.scrollIntoView({behavior:"smooth",inline:"nearest"}),this._handleScrollButtonMouseDown(this.SCROLL_RIGHT);else{var l=this.tabsContainer.get(0);if(l){var d,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,o;if(((r=(i=this.tabs[t].element.get(0))===null||i===void 0?void 0:i.offsetLeft)!==null&&r!==void 0?r:0)<((o=this.tabsContainer.scrollLeft())!==null&&o!==void 0?o:0)){e=this.tabs[t].element.get(0);break}}if(e)e.scrollIntoView({behavior:"smooth",inline:"start"}),this._handleScrollButtonMouseDown(this.SCROLL_LEFT);else{var a=this.tabsContainer.get(0);a&&(a.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,o=arguments.length>3?arguments[3]:void 0,a=this.tabsContainer.get(0);if(a){var s=a.getBoundingClientRect();if(e===this.SCROLL_LEFT){if(this.tabsContainer.scrollLeft(t-i),this.isDraggingTab&&this.parent._highlightHeaderDropZone(s.left-1),this.tabsContainer.scrollLeft()===0){this._checkScrollArrows();return}}else if(e===this.SCROLL_RIGHT){var l,d;if(this.tabsContainer.scrollLeft(t+i),this.isDraggingTab&&this.parent._highlightHeaderDropZone(s.right+1),((l=this.tabsContainer.scrollLeft())!==null&&l!==void 0?l:0)+((d=this.tabsContainer.innerWidth())!==null&&d!==void 0?d:0)===a.scrollWidth){this._checkScrollArrows();return}}window.cancelAnimationFrame((r=this.rAF)!==null&&r!==void 0?r:-1),this.rAF=window.requestAnimationFrame(h=>{var c,v,p=o||h,g=h-p,f=this.START_SPEED*g+.5*this.ACCELERATION*(g*g);f=Math.min(f,(c=(v=this.tabsContainer.get(0))===null||v===void 0?void 0:v.scrollWidth)!==null&&c!==void 0?c:1/0),this._handleScrollRepeat(e,t,f,p)})}}_$setClosable(e){return this.closeButton&&this._isClosable()?(this.closeButton.element[e?"show":"hide"](),!0):!1}_$destroy(){this.emit("destroy",this);for(var e=0;e<this.tabs.length;e++)this.tabs[e]._$destroy();this._detachWheelListener(),this._handleItemDropped(),k(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,o;if(o=this.layoutManager.config.labels.tabDropdown,this.layoutManager.config.labels.tabNextLabel,this.layoutManager.config.labels.tabPreviousLabel,this.tabDropdownButton=new Bn(this,o,"lm_tabdropdown",this._showAdditionalTabsDropdown),this.tabDropdownButton.element.hide(),this.controlsContainer.prepend(this.tabNextButton),this.tabNextButton.hide(),this._getHeaderSetting("popout")&&(t=this._onPopoutClick.bind(this),r=this._getHeaderSetting("popout"),new Bn(this,r,"lm_popout",t)),this._getHeaderSetting("maximise")){i=this.parent.toggleMaximise.bind(this.parent);var a=this._getHeaderSetting("maximise"),s=this._getHeaderSetting("minimise"),l=new Bn(this,a,"lm_maximise",i);this.parent.on("maximised",function(){l.element.attr("title",s??"")}),this.parent.on("minimised",function(){l.element.attr("title",a??"")})}this._isClosable()&&(e=this.parent.remove.bind(this.parent),r=this._getHeaderSetting("close"),this.closeButton=new Bn(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"),k(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"),k(document).on("mousedown",this._hideAdditionalTabsDropdown),this._updateAdditionalTabsDropdown()}_handleFilterKeydown(e){if(e.key==="Escape"){this._hideAdditionalTabsDropdown();return}if(this.dropdownKeyIndex===-1)return;if(e.key==="Enter"||e.key===" "){this._hideAdditionalTabsDropdown(),this.tabs[this.dropdownKeyIndex]._onTabClick();return}function t(s,l,d){if(d==null||d.length<2)return-1;for(var h=(s+l+d.length)%d.length;h!==s;){if(d.eq(h).css("display")!=="none")return h;h=(h+l+d.length)%d.length}return s}if(e.key==="ArrowDown"||e.key==="Tab"&&e.shiftKey===!1){var r,i;e.preventDefault(),(r=this.tabDropdownList)===null||r===void 0||r.eq(this.dropdownKeyIndex).removeClass("lm_keyboard_active"),this.dropdownKeyIndex=t(this.dropdownKeyIndex,1,this.tabDropdownList),(i=this.tabDropdownList)===null||i===void 0||i.eq(this.dropdownKeyIndex).addClass("lm_keyboard_active")}else if(e.key==="ArrowUp"||e.key==="Tab"){var o,a;e.preventDefault(),(o=this.tabDropdownList)===null||o===void 0||o.eq(this.dropdownKeyIndex).removeClass("lm_keyboard_active"),this.dropdownKeyIndex=t(this.dropdownKeyIndex,-1,this.tabDropdownList),(a=this.tabDropdownList)===null||a===void 0||a.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(),k(document).off("mousedown",this._hideAdditionalTabsDropdown)))}_updateAdditionalTabsDropdown(){var e,t,r,i;if(this.isDropdownShown&&!(!this.tabDropdownList||this.tabDropdownList.length==0)){var o=(e=(t=this.tabDropdownContainer.get(0))===null||t===void 0?void 0:t.scrollHeight)!==null&&e!==void 0?e:0;if(o!==0){var a=this.tabDropdownContainer[0].getBoundingClientRect(),s=(r=k(window).height())!==null&&r!==void 0?r:0,l=(i=k(window).width())!==null&&i!==void 0?i:0;if(this.tabDropdownButton){var d=this.tabDropdownButton.element[0].getBoundingClientRect(),h=o<s-d.bottom,c=!h&&d.bottom>s*.6,v=Math.min(d.left+(c?d.width:0),l-a.width-this.PADDING),p=c?Math.max(d.top-o,this.PADDING):d.bottom,g=s-p-this.PADDING;this.tabDropdownContainer.css({"max-height":g,top:p,left:v})}}}}_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()}}}}le(Nt,"_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(""));le(Nt,"_previousButtonTemplate",['<ul class="lm_controls">','<li class="lm_tabpreviousbutton"></li>',"</ul>"].join(""));le(Nt,"_nextButtonTemplate",['<li class="lm_tabnextbutton"></li>'].join(""));function An(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=pp(n,"string");return typeof e=="symbol"?e:e+""}function pp(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var 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 Js{constructor(e,t,r){An(this,"_isVertical",void 0),An(this,"_size",void 0),An(this,"_grabSize",void 0),An(this,"_dragListener",void 0),An(this,"element",void 0),this._isVertical=e,this._size=t,this._grabSize=r<t?t:r,this.element=this._createElement(),this._dragListener=new Qn(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=k('<div class="lm_drag_handle"></div>'),t=k('<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 fp=Object.freeze(Object.defineProperty({__proto__:null,BrowserPopout:Gs,DragProxy:hn,DragSource:qs,DragSourceFromEvent:Zs,DropTargetIndicator:Jn,Header:Nt,HeaderButton:Bn,Splitter:Js,Tab:er},Symbol.toStringTag,{value:"Module"}));var gp={config:fv,container:Sv,controls:fp,errors:Qv,items:dp,utils:Lv};function Ko(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 ze(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Ko(Object(t),!0).forEach(function(r){se(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Ko(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function se(n,e,t){return(e=bp(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function bp(n){var e=yp(n,"string");return typeof e=="symbol"?e: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)}class el extends Ue{static minifyConfig(e){return Ei(e)}static unminifyConfig(e){return oi(e)}constructor(e,t){super(),se(this,"isInitialised",!1),se(this,"_isFullPage",!1),se(this,"_resizeTimeoutId",void 0),se(this,"_components",{"lm-react-component":Bs}),se(this,"_fallbackComponent",void 0),se(this,"_itemAreas",[]),se(this,"_maximisedItem",null),se(this,"_maximisePlaceholder",k('<div class="lm_maximise_place"></div>')),se(this,"_creationTimeoutPassed",!1),se(this,"_subWindowsCreated",!1),se(this,"_dragSources",[]),se(this,"_updatingColumnsResponsive",!1),se(this,"_firstLoad",!0),se(this,"_reactChildMap",new Map),se(this,"_reactChildren",null),se(this,"_initialHeaderHeight",void 0),se(this,"width",null),se(this,"height",null),se(this,"root",void 0),se(this,"openPopouts",[]),se(this,"selectedItem",null),se(this,"isSubWindow",!1),se(this,"eventHub",new Ws(this)),se(this,"config",void 0),se(this,"container",void 0),se(this,"_originalContainer",void 0),se(this,"dropTargetIndicator",null),se(this,"tabDropPlaceholder",k('<div class="lm_drop_tab_placeholder"></div>')),se(this,"_typeToItem",void 0),this._onResize=this._onResize.bind(this),this._onUnload=this._onUnload.bind(this),this._windowBlur=this._windowBlur.bind(this),this._windowFocus=this._windowFocus.bind(this),this.config=this._createConfig(e),this._originalContainer=t,this.container=this._getContainer(),this._initialHeaderHeight=this.config.dimensions.headerHeight,this.isSubWindow&&k("body").css("visibility","hidden"),this._typeToItem={column:Tr.bind(this,!0),row:Tr.bind(this,!1),stack:di,component:Qs}}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 De))throw new Error("Root must be a ContentItem");var t={settings:ze({},this.config.settings),dimensions:ze({},this.config.dimensions),labels:ze({},this.config.labels),content:[]},r=function o(a,s){for(var l in s.config)l!=="content"&&(a[l]=s.config[l]);if(a.componentName==="lm-react-component"&&(a.type="react-component"),s.contentItems.length){a.content=[];for(var d=0;d<s.contentItems.length;d++)a.content[d]={},o(a.content[d],s.contentItems[d])}};e?r(t,{contentItems:[e]}):r(t,this.root),this._$reconcilePopoutWindows(),t.openPopouts=[];for(var i=0;i<this.openPopouts.length;i++)t.openPopouts.push(this.openPopouts[i].toConfig());return t.maximisedItemId=this._maximisedItem?"__glMaximised":void 0,t}getComponent(e){return this._components[e]}getFallbackComponent(){return this._fallbackComponent}init(){if(this._subWindowsCreated===!1&&(this._createSubWindows(),this._subWindowsCreated=!0),document.readyState==="loading"||document.body===null){k(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 Jn,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 o,a;this._maximisedItem.element.width((o=this.container.width())!==null&&o!==void 0?o:0),this._maximisedItem.element.height((a=this.container.height())!==null&&a!==void 0?a:0),this._maximisedItem.callDownwards("setSize")}this._adjustColumnsResponsive()}}destroy(){var e;this.isInitialised===!1||!this.root||(this._onUnload(),k(window).off("resize",this._onResize),k(window).off("unload beforeunload",this._onUnload),k(window).off("blur.lm").off("focus.lm"),this.root.callDownwards("_$destroy",[],!0),this.root.contentItems=[],this.tabDropPlaceholder.remove(),(e=this.dropTargetIndicator)===null||e===void 0||e.destroy(),this.eventHub.destroy(),this._dragSources.forEach(function(t){t._dragListener.destroy()}),this._dragSources=[])}createContentItem(e,t){var r,i,o;if(typeof e.type!="string")throw new nn("Missing parameter 'type'",e);if(e.type==="react-component"&&(e.type="component",e.componentName="lm-react-component"),!this._typeToItem[e.type])throw i="Unknown type '"+e.type+"'. Valid types are "+Object.keys(this._typeToItem).join(","),new nn(i);return e.type==="component"&&!(t instanceof di)&&t&&!(this.isSubWindow===!0&&t instanceof li)&&(e={type:"stack",width:e.width,height:e.height,content:[e]}),e.id=(r=e.id)!==null&&r!==void 0?r:Er(),o=new this._typeToItem[e.type](this,e,t),o}createPopout(e,t,r,i){var o=[],a=e instanceof De,s=this;if(a){var l;o=this.toConfig(e).content,r=Er();for(var d=e.parent,h=e;((c=d)===null||c===void 0?void 0:c.contentItems.length)===1&&!d.isRoot;){var c;h=d,d=d.parent}if((l=d)===null||l===void 0||l.addId(r),i==null||Number.isNaN(i)){var v;i=(v=d)===null||v===void 0?void 0:v.contentItems.indexOf(h)}}else e instanceof Array?o=e:o=[e];if(!t&&a){var p,g,f,y=window.screenX||window.screenLeft,T=window.screenY||window.screenTop,O=(p=e.element.offset())!==null&&p!==void 0?p:{left:0,top:0};t={left:y+O.left,top:T+O.top,width:(g=e.element.width())!==null&&g!==void 0?g:0,height:(f=e.element.height())!==null&&f!==void 0?f:0}}if(!t&&!a&&(t={left:window.screenX||window.screenLeft+20,top:window.screenY||window.screenTop+20,width:500,height:309}),a&&e.remove(),!(!t||!r||i===void 0)){var P=new Gs(o,t,r,i,this);return P.on("initialised",function(){s.emit("windowOpened",P)}),P.on("closed",function(){s._$reconcilePopoutWindows()}),this.openPopouts.push(P),P}}createDragSource(e,t){this.config.settings.constrainDragToContainer=!1;var r=new qs(e,t,this);return this._dragSources.push(r),r}createDragSourceFromEvent(e,t){return this.config.settings.constrainDragToContainer=!1,new Zs(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,o=0;o<this._itemAreas.length;o++){var a=this._itemAreas[o];e>a.x1&&e<a.x2&&t>a.y1&&t<a.y2&&r>a.surface&&(r=a.surface,i=a)}return i}_$createRootItemAreas(){var e=50,t=ze({},this.root._$getArea()),r=[ze(ze({},t),{},{side:"left",x2:t.x1+e}),ze(ze({},t),{},{side:"right",x1:t.x2-e}),ze(ze({},t),{},{side:"top",y2:t.y1+e}),ze(ze({},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(rn(r)){var i=r._$getArea();if(i!==null)if(i instanceof Array)this._itemAreas=this._itemAreas.concat(i);else{var o;this._itemAreas.push(i);var a=ze(ze({},i),(o=i.contentItem._contentAreaDimensions)===null||o===void 0?void 0:o.header.highlightArea);a.surface=(a.x2-a.x1)*(a.y2-a.y1),this._itemAreas.push(a)}}}}_$normalizeContentItem(e,t){if(!e)throw new Error("No content item defined");if(typeof e=="function"&&(e=e()),e instanceof De)return e;if(k.isPlainObject(e)&&e.type){var r=this.createContentItem(e,t);return r.callDownwards("_$init"),r}else throw new Error("Invalid contentItem")}_$reconcilePopoutWindows(){for(var e=[],t=0;t<this.openPopouts.length;t++){var r;((r=this.openPopouts[t].getWindow())===null||r===void 0?void 0:r.closed)===!1?e.push(this.openPopouts[t]):this.emit("windowClosed",this.openPopouts[t])}this.openPopouts.length!==e.length&&(this.emit("stateChanged"),this.openPopouts=e)}_getAllContentItems(){var e=[],t=r=>{if(e.push(r),r.contentItems instanceof Array)for(var i=0;i<r.contentItems.length;i++)t(r.contentItems[i])};return t(this.root),e}_bindEvents(){this._isFullPage&&k(window).resize(this._onResize),k(window).on("unload beforeunload",this._onUnload).on("blur.lm",this._windowBlur).on("focus.lm",this._windowFocus)}_windowBlur(){this.root.element.addClass("lm_window_blur")}_windowFocus(){this.root.element.removeClass("lm_window_blur")}_onResize(){clearTimeout(this._resizeTimeoutId),this._resizeTimeoutId=window.setTimeout(this.updateSize.bind(this),100)}_createConfig(e){var t,r=Hs("gl-window");r&&(this.isSubWindow=!0,e=JSON.parse(localStorage.getItem(r)||"{}"),e=oi(e),localStorage.removeItem(r)),e=k.extend(!0,{},Ls,e);var i=function o(a){for(var s in a){var l=a[s];s!=="props"&&typeof l=="object"&&l!=null?o(l):s==="type"&&l==="react-component"&&(a.type="component",a.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=k('<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=wi((e=this.config.content[0].title)!==null&&e!==void 0?e:""),k("head").append(k("body link, body style, template, .gl_keep")),this.container=k("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?k(this._originalContainer):k("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,k("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 nn(t,e);if(e.content.length>1)throw t="Top level content can't contain more then one element.",new nn(t,e);this.root=new li(this,{content:e.content},this.container),this.root.callDownwards("_$init"),e.maximisedItemId==="__glMaximised"&&this.root.getItemsById(e.maximisedItemId)[0].toggleMaximise()}_onUnload(){if(this.config.settings.closePopoutsOnUnload===!0)for(var e=0;e<this.openPopouts.length;e++)this.openPopouts[e].close()}_adjustColumnsResponsive(){if(!this._useResponsiveLayout()||this._updatingColumnsResponsive||!this.config.dimensions||!this.config.dimensions.minItemWidth||this.root.contentItems.length===0||!this.root.contentItems[0].isRow){this._firstLoad=!1;return}this._firstLoad=!1;var e=this.root.contentItems[0].contentItems.length;if(!(e<=1)){var t=this.config.dimensions.minItemWidth,r=e*t;if(!(this.width==null||r<=this.width)){this._updatingColumnsResponsive=!0;for(var i=Math.max(Math.floor(this.width/t),1),o=e-i,a=this.root.contentItems[0],s=this._findAllStackContainers()[0],l=0;l<o;l++){var d=a.contentItems[a.contentItems.length-1];this._addChildContentItemsToContainer(s,d)}this._updatingColumnsResponsive=!1}}}_useResponsiveLayout(){return this.config.settings&&(this.config.settings.responsiveMode=="always"||this.config.settings.responsiveMode=="onload"&&this._firstLoad)}_addChildContentItemsToContainer(e,t){t.type==="stack"?t.contentItems.forEach(function(r){e.addChild(r),t.removeChild(r,!0)}):t.contentItems.forEach(r=>{this._addChildContentItemsToContainer(e,r)})}_findAllStackContainers(){var e=[];return this._findAllStackContainersRecursive(e,this.root),e}_findAllStackContainersRecursive(e,t){t.contentItems.forEach(r=>{rn(r)?e.push(r):r.isComponent||this._findAllStackContainersRecursive(e,r)})}}se(el,"__lm",gp);const zo={"tab-height":"28px","drag-border-width":"5px"},Go=Object.freeze({tabHeight:parseInt(zo["tab-height"],10),dragBorderWidth:parseInt(zo["drag-border-width"],10)});function qo(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?qo(Object(t),!0).forEach(function(r){tl(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):qo(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function tl(n,e,t){return(e=Cp(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Cp(n){var e=Sp(n,"string");return typeof e=="symbol"?e:e+""}function Sp(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 Ft=W.module("LayoutUtils");function nl(n){return n.componentName!==void 0}function gn(n){var e=n;return(nl(n)&&n.componentName==="lm-react-component"||n.type==="react-component")&&e.component!==void 0}function hr(n){return n.focus!==void 0}function Zo(n){return n.type==="stack"}class D{static activateTab(e,t){var r=D.getStackForRoot(e,t,!1);if(!r){Ft.error("Could not find stack for config",t);return}var i=D.getContentItemInStack(r,t);i&&r.setActiveContentItem(i)}static isActiveTab(e,t){var r=D.getStackForRoot(e,t,!1);if(!r)return Ft.error("Could not find stack for config",t),!1;var i=D.getContentItemInStack(r,t),o=r.getActiveContentItem();return o===i}static addStack(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,r=t?"column":"row";if(Ys(e)){(e.contentItems==null||e.contentItems.length===0)&&e.addChild({type:r});var i=e.contentItems[0],o=t?i.isColumn:i.isRow;if(!o){e.removeChild(i,!0),e.addChild({type:r});var a=document.activeElement;e.contentItems[0].addChild(i),a&&a.focus!=null&&a.focus()}return this.addStack(e.contentItems[0],t)}if(e.contentItems.length<2)return e.addChild({type:"stack"}),e.contentItems[e.contentItems.length-1];var s=e.contentItems[e.contentItems.length-1],l=t?s.isRow:s.isColumn;return l||(e.addChild({type:t?"row":"column"}),e.removeChild(s,!0),e.contentItems[e.contentItems.length-1].addChild(s),s=e.contentItems[e.contentItems.length-1]),this.addStack(s,!t)}static getStackById(e,t){var r,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;if(i&&rn(e)&&e.contentItems.length===0)return e;if(t===((r=e.config)===null||r===void 0?void 0:r.id)){if(rn(e))return e;throw new Error("Item with ID ".concat(t," is not a stack"))}if(e.contentItems==null)return null;for(var o=0;o<e.contentItems.length;o+=1){var a=this.getStackById(e.contentItems[o],t,i);if(a)return a}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&&rn(e)&&e.contentItems.length===0)return e;if(e.contentItems==null)return null;for(var i=0;i<e.contentItems.length;i+=1){var o=e.contentItems[i];if(o.isComponent&&o.config!=null&&Mi(o.config,t))return e;var a=this.getStackForConfig(o,t,r);if(a)return a}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,o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,a=this.getStackForConfig(e,t);return!a&&i&&(a=this.getStackForConfig(e,{component:t.component},o)),!a&&r&&(a=this.addStack(e)),a}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,o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,a=0;a<t.length;a+=1){var s=t[a],l=a===t.length-1,d=D.getStackForRoot(e,{component:s},r&&l,i,o);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&&Mi(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 o=e[i],{component:a,content:s}=o;if(a){var l=t(a,o);l!=null?r.push(l):Ft.debug2('dehydrateLayoutConfig: skipping unmapped component "'.concat(a,'"'))}else if(s){var d=Dt(Dt({},o),{},{content:D.dehydrateLayoutConfig(s,t)});r.push(d)}else r.push(o)}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?(Zo(r)&&delete r.activeItemIndex,D.dropLayoutMinorChange(i)):gn(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=D.cloneLayout(e),o=D.cloneLayout(t);return r?(D.dropLayoutMinorChange(i),D.dropLayoutMinorChange(o),Gn(i,o)):Gn(i,o)}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 o=e[i];if(gn(o)){var a,{component:s,props:l={}}=o;r.push(Dt(Dt({},o),{},{id:(a=o?.id)!==null&&a!==void 0?a:kt(),props:t(s,l)}))}else if(o.content!==void 0){var d=D.hydrateLayoutConfig(o.content,t);Zo(o)&&o.activeItemIndex!=null&&o.activeItemIndex>=d.length&&(Ft.warn("Fixing bad activeItemIndex!",o.activeItemIndex,o),o.activeItemIndex=0),r.push(Dt(Dt({},o),{},{content:d}))}else r.push(o)}return r}static openComponent(){var{root:e,config:t,stack:r=void 0,replaceExisting:i=!0,replaceConfig:o=void 0,createNewStack:a=!1,focusElement:s=void 0,dragEvent:l=void 0}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},d=document.activeElement,h=Dt({},t);if(h.id==null&&(h.id=kt()),l!=null){e?.layoutManager.createDragSourceFromEvent(h,l);return}var c=o||{id:h.id,component:h.component};R(e);var v=r??(a?D.addStack(e):D.getStackForRoot(e,c));R(v);var p=D.getContentItemInStack(v,c);if(s!=null){var g=y=>{Ft.debug("Component created, focusing element",s),v.off("componentCreated",g);var{element:T}=y.origin;requestAnimationFrame(()=>{D.focusElement(T[0],s)})};v.on("componentCreated",g)}if(i&&p){var f=v.contentItems.indexOf(p);v.addChild(h,f+1),v.removeChild(p),v.setActiveContentItem(v.contentItems[f])}else v.addChild(h);s==null&&d&&hr(d)&&d.focus()}static openComponentInStack(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,i=document.activeElement,o={id:t.id},a=D.getContentItemInStack(e,o);if(r&&a&&e){var s=e?.contentItems.indexOf(a);e.addChild(t,s+1),e.removeChild(a),e.setActiveContentItem(e.contentItems[s])}else e?.addChild(t);i&&hr(i)&&i.focus()}static closeComponent(e,t,r){var i=D.getStackForRoot(e,t,!1,!1,!1);if(!i){Ft.warn("Cannot find stack for component, ignoring close",t);return}var o=D.getContentItemInStack(i,t),a=document.activeElement;o&&(nt(o)?o.container.close(r):i.removeChild(o)),a&&document.contains(a)&&hr(a)&&a.focus()}static renameComponent(e,t,r){var i=D.getStackForRoot(e,t,!1);if(!i){Ft.error("Could not find stack for config",t);return}var o=D.getContentItemInStack(i,t);o&&o.setTitle(r)}static cloneComponent(e,t){var r=D.getStackForRoot(e,t,!1);if(!r)return Ft.error("Could not find stack for config",t),null;var{props:i={}}=t,o=D.getPanelComponentState(t),a={type:"react-component",component:t.component,props:Dt(Dt({},i),{},{panelState:o}),title:"".concat(t.title," Copy"),id:kt()};return D.openComponentInStack(r,a),a}static getPanelComponentState(e){if(nl(e)){var t;return(t=e.componentState)===null||t===void 0?void 0:t.panelState}if(gn(e)){var r;return(r=e.props)===null||r===void 0?void 0:r.panelState}return null}static makeDefaultLayout(){return{dimensions:{headerHeight:Go.tabHeight,borderWidth:Go.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=D.getComponentConfigFromContainer(e);return t?t.id:null}static getIdFromPanel(e){var{glContainer:t}=e.props;return D.getIdFromContainer(t)}static getComponentNameFromPanel(e){var{glContainer:t}=e.props,r=D.getComponentConfigFromContainer(t);if(r&&gn(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]:D.DEFAULT_FOCUS_SELECTOR;if(e==null)return null;var r=e.querySelector(t);return r==null?null:(hr(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)})}}tl(D,"DEFAULT_FOCUS_SELECTOR","input, select, textarea, button");var wp=$.forwardRef((n,e)=>{var t=D.getComponentNameFromPanel({props:n});return u.jsx("div",{ref:e,className:"panel-placeholder",children:u.jsxs("div",{children:['Component "',t,'" is not registered.']})})});wp.displayName="PanelPlaceholder";const ie=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"});function _r(n){return n?.WrappedComponent!==void 0}function Ep(n){return typeof n.id=="string"&&n.layout instanceof el&&n.panelManager instanceof Ti&&typeof n.registerComponent=="function"}function Pp(n){if(!Ep(n))throw new Error("Expected dashboard plugin props, but instead received ".concat(n))}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 Yo(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){Bt(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 Bt(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=_p(n,"string");return typeof e=="symbol"?e:e+""}function _p(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 st=W.module("PanelManager");class Ti{constructor(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:(s,l)=>l,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:(s,l)=>l,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:new Map,o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:[],a=arguments.length>5&&arguments[5]!==void 0?arguments[5]:()=>{};Bt(this,"layout",void 0),Bt(this,"hydrateComponent",void 0),Bt(this,"dehydrateComponent",void 0),Bt(this,"onPanelsUpdated",void 0),Bt(this,"closed",void 0),Bt(this,"openedMap",void 0),this.handleFocus=this.handleFocus.bind(this),this.handleMount=this.handleMount.bind(this),this.handleUnmount=this.handleUnmount.bind(this),this.handleReopen=this.handleReopen.bind(this),this.handleReopenLast=this.handleReopenLast.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=a,this.openedMap=new Map(i),this.closed=[...o],this.startListening()}startListening(){var{eventHub:e}=this.layout;e.on(ie.FOCUS,this.handleFocus),e.on(ie.MOUNT,this.handleMount),e.on(ie.UNMOUNT,this.handleUnmount),e.on(ie.REOPEN,this.handleReopen),e.on(ie.REOPEN_LAST,this.handleReopenLast),e.on(ie.DELETE,this.handleDeleted),e.on(ie.CLOSED,this.handleClosed),e.on(ie.CLOSE,this.handleControlClose)}stopListening(){var{eventHub:e}=this.layout;e.off(ie.FOCUS,this.handleFocus),e.off(ie.MOUNT,this.handleMount),e.off(ie.UNMOUNT,this.handleUnmount),e.off(ie.REOPEN,this.handleReopen),e.off(ie.REOPEN_LAST,this.handleReopenLast),e.off(ie.DELETE,this.handleDeleted),e.off(ie.CLOSED,this.handleClosed),e.off(ie.CLOSE,this.handleControlClose)}getClosedPanelConfigsOfType(e){return this.closed.filter(t=>t.component===e)}getOpenedPanels(){return Array.from(this.openedMap.values())}getOpenedPanelConfigs(){return this.getOpenedPanels().map(e=>{var{glContainer:t}=e.props;return D.getComponentConfigFromContainer(t)})}getOpenedPanelConfigsOfType(e){return this.getOpenedPanelConfigs().filter(t=>t!=null&&gn(t)&&t.component===e)}getOpenedPanelById(e){return this.openedMap.get(e)}getContainerByPanelId(e){var t,r=D.getStackForConfig(this.layout.root,{id:e});return(t=r&&D.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=>_r(r)&&t instanceof r.WrappedComponent||!_r(r)&&t instanceof r))}updatePanel(e){var t=D.getIdFromPanel(e);if(t==null){st.error("updatePanel Panel did not have an ID",e);return}st.debug2("Updating panel ID ".concat(t," in open panels map")),this.openedMap.delete(t),this.openedMap.set(t,e)}removePanel(e){var t=D.getIdFromPanel(e);if(t==null){st.error("removePanel Panel did not have an ID",e);return}if(!this.openedMap.has(t)){st.error("Missing panel ID ".concat(t," in open panels map"));return}if(this.openedMap.get(t)!==e){st.debug("Panel argument doesn't match the open panels map entry for ".concat(t,", removePanel ignored"));return}st.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){st.debug2("Focus: ",e),this.updatePanel(e)}handleMount(e){st.debug2("Mount: ",e),this.updatePanel(e),this.sendUpdate()}handleUnmount(e){st.debug2("Unmount: ",e),this.removePanel(e),this.sendUpdate()}handleReopen(e,t){st.debug2("Reopen:",e,t),this.removeClosedPanelConfig(e);var{component:r}=e,{props:i}=e;i=this.hydrateComponent(r,i);var o=Yo(Yo({},e),{},{props:i}),{root:a}=this.layout,s=e.parentStackId===void 0?void 0:D.getStackById(a,e.parentStackId);D.openComponent({root:a,config:o,replaceConfig:t,stack:s??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=D.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 o=this.closed[i];if(o.parentStackId===r){this.handleReopen(o);return}}}}handleDeleted(e){st.debug2("Deleted:",e),this.removeClosedPanelConfig(e),this.sendUpdate()}handleClosed(e,t){st.debug2("Closed: ",e),this.addClosedPanel(t),this.sendUpdate()}handleControlClose(e){var t={id:e},{root:r}=this.layout;D.closeComponent(r,t)}addClosedPanel(e){var{root:t}=this.layout,r=D.getComponentConfigFromContainer(e);if(r&&gn(r)){var i=this.dehydrateComponent(r.component,r);if(i!=null){var o;i.parentStackId=(o=D.getStackForConfig(t,r))===null||o===void 0?void 0:o.config.id,this.closed.push(i)}}}sendUpdate(){var{closed:e,openedMap:t}=this;this.onPanelsUpdated({closed:[...e],openedMap:new Map(t)})}}Bt(Ti,"MAX_CLOSED_PANEL_COUNT",100);var Op=W.module("PanelErrorBoundary");class Ip extends m.Component{constructor(e){super(e),this.state={error:null}}componentDidCatch(e){this.setState({error:e})}componentWillUnmount(){var{glContainer:e,glEventHub:t}=this.props,r=D.getIdFromContainer(e);Op.debug("componentWillUnmount",r),t.emit(ie.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(sn,{errorMessage:"".concat(t),isLoading:!1,isLoaded:!1})}):e}}function Qo(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 Or(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Qo(Object(t),!0).forEach(function(r){Dp(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Qo(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function Dp(n,e,t){return(e=xp(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function xp(n){var e=Mp(n,"string");return typeof e=="symbol"?e:e+""}function Mp(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var 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 rl(n){var{props:e,componentState:t}=n,{metadata:r}=e,{panelState:i=null}=e;t&&({panelState:i}=t);var o={};return r!=null&&(o.metadata=r),i!=null&&(o.panelState=i),Or(Or({},n),{},{componentState:null,props:o,type:"react-component"})}function il(n){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";return Or(Or({},n),{},{localDashboardId:e})}function kp(n){var e=_r(n)&&n.WrappedComponent.prototype!=null&&n.WrappedComponent.prototype.isReactComponent!=null||n.prototype!=null&&n.prototype.isReactComponent!=null,t=!_r(n)&&"$$typeof"in n&&n.$$typeof===Il.ForwardRef;return e||t}const Np={dehydrate:rl,hydrate:il};var jp=$.createContext(void 0),Ap=S.shape({on:S.func,off:S.func,isHidden:S.bool,tab:S.shape({header:S.shape({tabs:S.arrayOf(S.shape({contentItem:S.shape({})}))})}),title:S.string,setTitle:S.func,close:S.func}),ol=S.shape({on:S.func,off:S.func,emit:S.func}),Lp=S.shape({registerComponent:S.func,root:S.shape({addChild:S.func}),on:S.func,off:S.func,eventHub:ol}),Fp=Object.freeze({Container:Ap,EventHub:ol,Layout:Lp});function je(n,e,t){m.useEffect(function(){return n.on(e,t),()=>{n.off(e,t)}},[n,e,t])}function Ln(n,e,t,r){var i,o=(i=e.COMPONENT)!==null&&i!==void 0?i:e.displayName;if(o==null)throw new Error("ComponentType must have a `COMPONENT` or `displayName` attribute.");$.useEffect(()=>{var a=n(o,e,t,r);return()=>{a()}},[e,r,t,o,n])}var al="SET_DASHBOARD_DATA";const Rp=Ah(al,{},!1),$p={dashboardData:Rp};var Hp=new Map,sl=Object.freeze({}),Bp=Object.freeze([]),Lb=vi,Fb=Ia,Rb=Dl,Wp=n=>n.dashboardData,Le=(n,e)=>{var t;return(t=Wp(n)[e])!==null&&t!==void 0?t:sl},$b=(n,e)=>{var t;return(t=Le(n,e).closed)!==null&&t!==void 0?t:Bp},Hb=(n,e)=>{var t;return(t=Le(n,e).openedMap)!==null&&t!==void 0?t:Hp},ll=(n,e)=>{var t;return(t=Le(n,e).pluginDataMap)!==null&&t!==void 0?t:sl},Bb=(n,e,t)=>ll(n,e)[t];function Jo(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?Jo(Object(t),!0).forEach(function(r){Up(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Jo(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function Up(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=Kp(n,"string");return typeof e=="symbol"?e:e+""}function Kp(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 dl=(n,e)=>({type:al,id:n,payload:e}),Xt=(n,e)=>(t,r)=>t(dl(n,bn(bn({},Le(r(),n)),e))),Wb=(n,e,t)=>(r,i)=>r(dl(n,bn(bn({},Le(i(),n)),{},{pluginDataMap:bn(bn({},ll(i(),n)),{},{[e]:t})})));Object.entries($p).map(n=>{var[e,t]=n;return md.register(e,t)});function zp(n){var{children:e}=n;return u.jsx(u.Fragment,{children:e})}var ul=m.createContext(null);function Gp(){return m.useContext(ul)}function ea(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 Fn(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?ea(Object(t),!0).forEach(function(r){qp(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):ea(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function qp(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=Xp(n,"string");return typeof e=="symbol"?e:e+""}function Xp(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var 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 cr=W.module("DashboardLayout"),Yp=Object.freeze({}),Qp=[],ta=()=>{},Jp=1e3,na=n=>n;function ef(n){var e,t,{id:r,children:i,emptyDashboard:o=u.jsx("div",{children:"Dashboard is empty."}),layout:a,layoutConfig:s=Qp,onLayoutChange:l=ta,onLayoutInitialized:d=ta,hydrate:h=il,dehydrate:c=rl,panelWrapper:v=zp}=n,p=vi(),g=(e=Ia(b=>Le(b,r)))!==null&&e!==void 0?e:Yp,[f,y]=m.useState(!1),[T,O]=m.useState(!1),[P,F]=m.useState(),[U]=m.useState((t=g?.closed)!==null&&t!==void 0?t:[]),[te,N]=m.useState(a.getReactChildren()),B=m.useMemo(()=>new Map,[]),H=m.useMemo(()=>new Map,[]),J=m.useCallback(function(b,w){var _,G=arguments.length>2&&arguments[2]!==void 0?arguments[2]:h,ne=arguments.length>3&&arguments[3]!==void 0?arguments[3]:c;cr.debug2("registerComponent",b,w,G,ne);function it(Z,ae){var ce=w,Fe=v,Pt=kp(ce),{glContainer:Tt,glEventHub:Hr}=Z,Nn=D.getIdFromContainer(Tt);return u.jsx(Ip,{glContainer:Tt,glEventHub:Hr,children:u.jsx(ul.Provider,{value:Nn,children:u.jsx(Fe,Fn(Fn({},Z),{},{children:Pt?u.jsx(ce,Fn(Fn({},Z),{},{ref:ae})):u.jsx(ce,Fn({},Z))}))})})}it.displayName="DashboardWrapper(".concat((_=w.displayName)!==null&&_!==void 0?_:b,")");var I=a.registerComponent(b,$.forwardRef(it));return B.set(b,G),H.set(b,ne),I},[h,c,B,H,a,v]),oe=m.useCallback((b,w)=>{var _;return((_=B.get(b))!==null&&_!==void 0?_:na)(w,r)},[B,r]),L=m.useCallback((b,w)=>{var _;return((_=H.get(b))!==null&&_!==void 0?_:na)(w,r)},[H,r]),q=m.useMemo(()=>new Ti(a,oe,L,new Map,U,b=>{var{closed:w,openedMap:_}=b;p(Xt(r,{closed:w,openedMap:_}))}),[L,p,oe,r,U,a]),K=nu(b=>{var w=P==null||!D.isEqual(P,b);cr.debug("handleLayoutStateChanged",w,b),w&&(y(a.root.contentItems.length===0),F(b),l(b),N(a.getReactChildren()))},Jp,{flushOnUnmount:!0});m.useEffect(()=>()=>K.flush(),[K]);var j=m.useCallback(()=>{if(!T){var b=a.toConfig(),w=b.content,_=D.dehydrateLayoutConfig(w,L);K(_)}},[L,T,a,K]),V=m.useCallback(b=>{var w=D.getIdFromContainer(b);a.eventHub.emit(ie.DRAGGING,w),O(!0)},[a.eventHub]),z=m.useCallback(b=>{var w=D.getIdFromContainer(b);a.eventHub.emit(ie.DROPPED,w),O(!1)},[a.eventHub]),ve=m.useCallback(b=>{if(cr.debug2("handleComponentCreated",b),!(b==null||b.config==null||b.config.component==null||b.element==null)){var w=b.config.component.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),_="".concat(w,"-component");b.element.addClass(_)}},[]),Ve=m.useCallback(()=>{N(a.getReactChildren())},[a]);je(a,"stateChanged",j),je(a,"itemPickedUp",V),je(a,"itemDropped",z),je(a,"componentCreated",ve),je(a.eventHub,ie.TITLE_CHANGED,j),je(a,"reactChildrenChanged",Ve);var ke=ru(s);return m.useEffect(function(){if(ke!==s&&s!==P){cr.debug("Setting new layout content...");for(var w=D.hydrateLayoutConfig(s,oe);a.root.contentItems.length>0;)a.root.contentItems[0].remove();for(var _=0;_<w.length;_+=1)a.root.addChild(w[_]);y(a.root.contentItems.length===0)}},[oe,a,s,P,q,ke]),m.useEffect(()=>d(),[]),u.jsxs(u.Fragment,{children:[f&&o,te,$.Children.map(i,b=>b!=null?u.jsx(Ju,{fallback:[],children:$.cloneElement(b,{id:r,layout:a,panelManager:q,registerComponent:J})}):null)]})}ef.propTypes={id:S.string.isRequired,children:S.node,data:S.shape({}),emptyDashboard:S.node,layout:Fp.Layout.isRequired,layoutConfig:S.arrayOf(S.shape({})),onLayoutChange:S.func,onLayoutInitialized:S.func};var tf=m.createContext(null);function Ub(){var n=m.useContext(tf);if(n==null)throw new Error("useDashboardId must be used within a DashboardIdContext provider");return n}function nf(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)}function hl(n,e,t){if(n){if(t(n)===!0)return n;for(var r=n.child;r;){var i=hl(r,e,t);if(i)return i;r=r.sibling}}}function af(n){try{return Object.defineProperties(n,{_currentRenderer:{get(){return null},set(){}},_currentRenderer2:{get(){return null},set(){}}})}catch{return n}}var cl=af(m.createContext(null));class Vb extends m.Component{constructor(){super(...arguments),nf(this,"_reactInternals",void 0)}render(){var{children:e}=this.props;return u.jsx(cl.Provider,{value:this._reactInternals,children:e})}}function sf(){var n=m.useContext(cl);if(n===null)throw new Error("useFiber must be called within a <FiberProvider />!");var[e]=m.useState(()=>kt()),t=m.useMemo(()=>{for(var r of[n,n?.alternate].filter(o=>o!=null)){var i=hl(r,!1,o=>{for(var a=o.memoizedState;a!=null;){if(a.memoizedState===e)return!0;a=a.next}});if(i)return i}},[n,e]);return t}var Kb="default",lf=W.module("useDhId"),Zr="__dhId";function zb(){var n,e,t=(n=(e=sf())===null||e===void 0?void 0:e.pendingProps)!==null&&n!==void 0?n:{},r=t[Zr],i=Gp();if(r!=null){if(typeof r!="string")throw new Error("useDhId expected prop ".concat(Zr," to be a string, but got ").concat(typeof r));return r}return i??(lf.warn("useDhId must be used within a PanelIdContext provider if there is no ".concat(Zr," prop. Defaulting to null.")),null)}function tr(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=uf(n,"string");return typeof e=="symbol"?e:e+""}function uf(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var 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{}tr(Me,"SESSION_OPENED","ConsoleEvent.SESSION_OPENED");tr(Me,"SESSION_CLOSED","ConsoleEvent.SESSION_CLOSED");tr(Me,"FOCUS_HISTORY","ConsoleEvent.FOCUS_HISTORY");tr(Me,"SEND_COMMAND","ConsoleEvent.SEND_COMMAND");tr(Me,"SETTINGS_CHANGED","ConsoleEvent.SETTINGS_CHANGED");function Yt(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=cf(n,"string");return typeof e=="symbol"?e:e+""}function cf(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 Et{}Yt(Et,"TABLE_CHANGED","InputFilterEvent.TABLE_CHANGED");Yt(Et,"COLUMNS_CHANGED","InputFilterEvent.COLUMNS_CHANGED");Yt(Et,"FILTERS_CHANGED","InputFilterEvent.FILTERS_CHANGED");Yt(Et,"CLEAR_ALL_FILTERS","InputFilterEvent.CLEAR_ALL_FILTERS");Yt(Et,"COLUMN_SELECTED","InputFilterEvent.COLUMN_SELECTED");Yt(Et,"OPEN_DROPDOWN","InputFilterEvent.OPEN_DROPDOWN");Yt(Et,"OPEN_INPUT","InputFilterEvent.OPEN_INPUT");Yt(Et,"OPEN_FILTER_SET_MANAGER","InputFilterEvent.OPEN_FILTER_SET_MANAGER");const Gb=Object.freeze({OPEN:"MarkdownEvent.OPEN"});function jt(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=vf(n,"string");return typeof e=="symbol"?e:e+""}function vf(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 Q{}jt(Q,"CREATE_NOTEBOOK","NotebookEvent.createNotebook");jt(Q,"SELECT_NOTEBOOK","NotebookEvent.selectNotebook");jt(Q,"CLOSE_FILE","NotebookEvent.closeFile");jt(Q,"RENAME","NotebookEvent.rename");jt(Q,"RENAME_FILE","NotebookEvent.renameFile");jt(Q,"REGISTER_FILE","NotebookEvent.registerFile");jt(Q,"SEND_TO_NOTEBOOK","NotebookEvent.sendToNotebook");jt(Q,"UNREGISTER_FILE","NotebookEvent.unregisterFile");jt(Q,"PROMOTE_FROM_PREVIEW","NotebookEvent.promoteFromPreview");function Mn(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=ff(n,"string");return typeof e=="symbol"?e:e+""}function ff(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 St{}Mn(St,"focus","TabEvent.focus");Mn(St,"blur","TabEvent.blur");Mn(St,"openPQObject","TabEvent.openPQObject");Mn(St,"openControl","TabEvent.openControl");Mn(St,"reload","TabEvent.reload");Mn(St,"clearAllFilters","TabEvent.clearAllFilters");function gf(n,e,t){return(e=bf(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function bf(n){var e=yf(n,"string");return typeof e=="symbol"?e:e+""}function yf(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var 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 ml extends m.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,r,{glContainer:i}=this.props;return[...(e=i==null||(t=i.tab)===null||t===void 0||(r=t.header)===null||r===void 0?void 0:r.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?.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,o,a,s,l,d,h;if(((i=t[r].contentItem)===null||i===void 0||(o=i.config)===null||o===void 0?void 0:o.id)===((a=e.tab)===null||a===void 0||(s=a.contentItem)===null||s===void 0||(l=s.config)===null||l===void 0?void 0:l.id))break;(d=((h=t[r])===null||h===void 0?void 0:h.contentItem).container)===null||d===void 0||d.close()}}handleReopenLast(){var{glContainer:e,glEventHub:t}=this.props;t.emit(ie.REOPEN_LAST,e)}canCloseTabsRight(){for(var{glContainer:e}=this.props,t=this.getAllTabs(),r=!0,i=t.length-1;i>0;i-=1){var o,a,s,l,d,h,c,v;if(((o=t[i].contentItem)===null||o===void 0||(a=o.config)===null||a===void 0?void 0:a.id)===((s=e.tab)===null||s===void 0||(l=s.contentItem)===null||l===void 0||(d=l.config)===null||d===void 0?void 0:d.id))break;var p=!!(!((h=t[i])===null||h===void 0||(c=h.contentItem)===null||c===void 0||(v=c.config)===null||v===void 0)&&v.isClosable);if(p){r=!1;break}}return r}canCloseAny(){for(var e=this.getAllTabs(),t=!0,r=e.length-1;r>0;r-=1){var i,o,a,s=!!(!((i=e[r])===null||i===void 0||(o=i.contentItem)===null||o===void 0||(a=o.config)===null||a===void 0)&&a.isClosable);if(s){t=!1;break}}return t}canReopenLast(){var e,t,{workspace:r,glContainer:i}=this.props,o=(e=D.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(a=>a.parentStackId===o))}render(){var e,t,r,{additionalActions:i,glContainer:o}=this.props,a=[...i];a.push(()=>({title:"Re-open closed panel",group:re.groups.medium+2004,action:this.handleReopenLast,disabled:this.canReopenLast()}));var s=(e=o.tab)===null||e===void 0||(t=e.contentItem)===null||t===void 0||(r=t.config)===null||r===void 0?void 0:r.isClosable;return a.push({title:"Close",order:10,group:re.groups.low,action:this.handleCloseTab,disabled:s===void 0||!s}),a.push(()=>({title:"Close Tabs to Right",order:20,group:re.groups.low,action:this.handleCloseTabsRight,disabled:this.canCloseTabsRight()})),a.push(()=>({title:"Close All",order:30,group:re.groups.low,action:this.handleCloseTabsAll,disabled:this.canCloseAny()})),u.jsx(re,{actions:a})}}gf(ml,"defaultProps",{additionalActions:[]});var Cf=n=>({workspace:ps(n)}),Sf=In(Cf,{setWorkspace:fs})(ml);function vl(n,e,t){return(e=wf(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function wf(n){var e=Ef(n,"string");return typeof e=="symbol"?e:e+""}function Ef(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 pl extends m.PureComponent{constructor(e){super(e),vl(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=$.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,t;(e=this.renameInputRef)===null||e===void 0||(t=e.current)===null||t===void 0||t.focus()}handleRenameInputChange(e){this.setState({value:e.target.value})}handleRenameCancel(){var{onCancel:e}=this.props;e()}handleRenameSubmit(e){e.stopPropagation(),e.preventDefault();var{value:t}=this.state,r=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:o}=this.state;return u.jsxs("form",{className:X("p-3",{"was-validated":o}),onSubmit:this.handleRenameSubmit,noValidate:!0,role:"presentation",onMouseDown:a=>{a.stopPropagation()},onMouseUp:a=>{a.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(ee,{kind:"secondary",className:"mr-2",onClick:this.handleRenameCancel,children:"Cancel"}),u.jsx(ee,{kind:"primary",type:"submit",children:"Rename"})]})]})}render(){var{isShown:e,onCancel:t}=this.props;return u.jsx(Yn,{isShown:e,onEntered:this.handleRenameDialogOpened,onExited:t,options:{placement:"bottom"},interactive:!0,closeOnBlur:!0,children:this.renderRenameDialog()})}}vl(pl,"defaultProps",{isShared:!1,isOwner:!0,itemType:"Item",value:""});function ui(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)}var _f=W.module("Panel");class kn extends m.PureComponent{constructor(e){super(e),ui(this,"ref",void 0),ui(this,"getAdditionActions",wt((r,i,o)=>{var a=[];return i&&a.push(this.getCloneAction()),o&&a.push(this.getRenameAction()),[...a,...r]})),this.handleClearAllFilters=this.handleClearAllFilters.bind(this),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.handleSessionClosed=this.handleSessionClosed.bind(this),this.handleSessionOpened=this.handleSessionOpened.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=$.createRef();var{glContainer:t}=this.props;this.state={title:D.getTitleFromContainer(t),showRenameDialog:!1,isWithinPanel:!0}}componentDidMount(){var e,t,{componentPanel:r,glContainer:i,glEventHub:o}=this.props;i.on("resize",this.handleResize),i.on("show",this.handleBeforeShow),i.on("shown",this.handleShow),i.on("hide",this.handleHide),i.on("tab",this.handleTab),i.on("tabClicked",this.handleTabClicked),o.on(Me.SESSION_CLOSED,this.handleSessionClosed),o.on(Me.SESSION_OPENED,this.handleSessionOpened),o.on(St.focus,this.handleTabFocus),o.on(St.blur,this.handleTabBlur),o.on(Et.CLEAR_ALL_FILTERS,this.handleClearAllFilters),o.emit(ie.MOUNT,r??this),this.setState({isWithinPanel:((e=this.ref.current)===null||e===void 0||(t=e.parentElement)===null||t===void 0?void 0:t.closest(".dh-panel"))!=null})}componentWillUnmount(){var{componentPanel:e,glContainer:t,glEventHub: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(Me.SESSION_CLOSED,this.handleSessionClosed),r.off(Me.SESSION_OPENED,this.handleSessionOpened),r.off(St.focus,this.handleTabFocus),r.off(St.blur,this.handleTabBlur),r.off(Et.CLEAR_ALL_FILTERS,this.handleClearAllFilters),r.emit(ie.UNMOUNT,e??this)}handleTab(e){e!=null&&this.setState({title:D.getTitleFromTab(e)}),this.forceUpdate();var{onTab:t}=this.props;t(e)}handleTabClicked(e){var{onTabClicked:t}=this.props;t(e)}handleClearAllFilters(){var{onClearAllFilters:e}=this.props;e(...arguments)}handleFocus(e){var{componentPanel:t,glEventHub:r}=this.props;r.emit(ie.FOCUS,t??this);var{onFocus:i}=this.props;i(e)}handleBlur(e){var{onBlur:t}=this.props;t(e)}handleHide(){var{onHide:e}=this.props;e(...arguments)}handleResize(){var{onResize:e}=this.props;e(...arguments)}handleSessionClosed(e){var{onSessionClose:t}=this.props;t(e)}handleSessionOpened(e,t){var{onSessionOpen:r}=this.props;r(e,t)}handleBeforeShow(){var{onBeforeShow:e}=this.props;e(...arguments)}handleShow(){var{onShow:e}=this.props;e(...arguments)}handleTabBlur(){var{onTabBlur:e}=this.props;e(...arguments)}handleTabFocus(){var{onTabFocus:e}=this.props;e(...arguments)}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=D.getRootFromContainer(t),i=D.getComponentConfigFromContainer(t);R(i),D.renameComponent(r,i,e)}handleCopyPanel(){var{glContainer:e,glEventHub:t}=this.props,r=D.getRootFromContainer(e),i=D.getComponentConfigFromContainer(e);if(i==null){_f.error("Could not get component config from container",e);return}var o=D.cloneComponent(r,i);o!==null&&t.emit(ie.CLONED,this,o)}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:o,additionalActions:a,errorMessage:s,isLoaded:l,isLoading:d,isClonable:h,isRenamable:c}=this.props,{tab:v}=i,{showRenameDialog:p,title:g,isWithinPanel:f}=this.state;return u.jsxs("div",{className:X("h-100 w-100 dh-panel",t),onFocusCapture:this.handleFocus,onBlurCapture:this.handleBlur,ref:this.ref,children:[e,u.jsx(sn,{errorMessage:s,isLoaded:l,isLoading:d}),!f&&v!=null&&Dr.createPortal(u.jsxs(u.Fragment,{children:[u.jsx(Sf,{glContainer:i,glEventHub:o,additionalActions:this.getAdditionActions(a,h,c)}),c&&u.jsx(pl,{isShown:p,value:g,itemType:"Panel",onCancel:this.handleRenameCancel,onSubmit:this.handleRenameSubmit}),r!=null&&u.jsx(ue,{interactive:!0,options:{placement:"bottom"},popperClassName:"panel-tab-popper",children:r()})]}),v.element[0])]})}}ui(kn,"defaultProps",{className:"",onTab:()=>{},onTabClicked:()=>{},onClearAllFilters:()=>{},onFocus:()=>{},onBlur:()=>{},onHide:()=>{},onResize:()=>{},onSessionClose:()=>{},onSessionOpen:()=>{},onBeforeShow:()=>{},onShow:()=>{},onTabBlur:()=>{},onTabFocus:()=>{},renderTabTooltip:null,additionalActions:[],errorMessage:null,isLoading:!1,isLoaded:!0,isClonable:!1,isRenamable:!1});const qb=Object.freeze({DEFAULT:"DEFAULT",LINKER:"LINKER"});var Of=Object.freeze({}),If=new Map,Ar=Object.freeze([]),Zb=(n,e)=>{var t;return(t=Le(n,e).columns)!==null&&t!==void 0?t:Ar},Xb=(n,e)=>{var t;return(t=Le(n,e).filterSets)!==null&&t!==void 0?t:Ar},Yb=(n,e)=>{var t;return(t=Le(n,e).filters)!==null&&t!==void 0?t:Ar},Qb=(n,e)=>{var t;return(t=Le(n,e).tableMap)!==null&&t!==void 0?t:If},Jb=(n,e)=>Le(n,e).isolatedLinkerPanelId,fl=(n,e)=>{var t;return(t=Le(n,e).links)!==null&&t!==void 0?t:Ar},ey=(n,e)=>Le(n,e).columnSelectionValidator,ty=(n,e)=>{var t;return(t=Le(n,e).consoleSettings)!==null&&t!==void 0?t:Of},ny=(n,e)=>Le(n,e).connection,nr=(n,e)=>Le(n,e).sessionWrapper,ry=(n,e)=>t=>t(Xt(n,{connection:e})),iy=(n,e)=>t=>t(Xt(n,{sessionWrapper:e})),gl=(n,e)=>t=>t(Xt(n,{links:e})),oy=(n,e)=>(t,r)=>{var i=fl(r(),n),o=e.filter(a=>i.findIndex(s=>Gn(s.start,a.start)&&Gn(s.end,a.end))<0);return t(gl(n,i.concat(o)))},ay=(n,e)=>(t,r)=>{var i=fl(r(),n),o=i.filter(a=>!e.includes(a.id));return t(gl(n,o))},sy=(n,e)=>t=>t(Xt(n,{isolatedLinkerPanelId:e})),ly=(n,e)=>t=>t(Xt(n,{columnSelectionValidator:e})),Df=(n,e)=>t=>t(Xt(n,{consoleSettings:e})),dy=(n,e)=>t=>t(Xt(n,{filterSets:e}));function Ir(n,e,t){return(e=xf(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function xf(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 mr=W.module("CommandHistoryPanel");class rr extends m.Component{static handleError(e){mr.error(e)}constructor(e){super(e),Ir(this,"container",void 0),Ir(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=$.createRef(),this.pending=new Dn;var{session:t,sessionId:r,language:i}=e;this.state={panelState:{},session:t,sessionId:r,language:i,contextActions:[{action:this.handleFocusHistory,shortcut:Be.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(mr.debug("handleSendToNotebook",r,e),!r){mr.error("Session is not connected.");return}var{glEventHub:o}=this.props;o.emit(t?Q.CREATE_NOTEBOOK:Q.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;mr.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;R(t),R(r),this.pending.add(e.getTable(t,r,Date.now()),i=>i.close()).then(i=>{this.setState({table:i})}).catch(rr.handleError)}render(){var{glContainer:e,glEventHub:t,commandHistoryStorage:r}=this.props,{language:i,contextActions:o,table:a}=this.state;return u.jsxs(kn,{className:"command-history-pane",componentPanel:this,glContainer:e,glEventHub:t,onSessionOpen:this.handleSessionOpened,onSessionClose:this.handleSessionClosed,onShow:this.handleShow,children:[!a&&u.jsx("div",{className:"command-history-disconnected-message",children:"Waiting for console connection"}),a&&i!=null&&u.jsxs(u.Fragment,{children:[u.jsx(He,{ref:this.container,language:i,sendToNotebook:this.handleSendToNotebook,sendToConsole:this.handleSendToConsole,table:a,commandHistoryStorage:r}),u.jsx(re,{actions:o})]})]})}}Ir(rr,"COMPONENT","CommandHistoryPanel");Ir(rr,"TITLE","Command History");var kf=(n,e)=>{var t=ms(n),r=nr(n,e.localDashboardId),{session:i,config:o}=r??{},{type:a,id:s}=o??{};return{commandHistoryStorage:t,language:a,session:i,sessionId:s}},Nf=In(kf,null,null,{forwardRef:!0})(rr),jf=m.createContext(null),ir=Object.freeze({AUTH_PLUGIN:"AuthPlugin",DASHBOARD_PLUGIN:"DashboardPlugin",WIDGET_PLUGIN:"WidgetPlugin",TABLE_PLUGIN:"TablePlugin",THEME_PLUGIN:"ThemePlugin"});function Af(n){return"DashboardPlugin"in n}function Lf(n){return"AuthPlugin"in n}function Ff(n){return"TablePlugin"in n}function uy(n){return Af(n)||Lf(n)||Ff(n)}function Rf(n){return"type"in n&&n.type===ir.DASHBOARD_PLUGIN}function _i(n){return"type"in n&&n.type===ir.WIDGET_PLUGIN}function $f(n){return"type"in n&&n.type===ir.TABLE_PLUGIN}function Hf(n){return"type"in n&&n.type===ir.AUTH_PLUGIN}function bl(n){return"type"in n&&n.type===ir.THEME_PLUGIN}function hy(n){return Rf(n)||Hf(n)||$f(n)||bl(n)||_i(n)}var Bf=W.module("@deephaven/plugin.PluginUtils");function ra(n,e){return n==null||!_i(n)?!1:[n.supportedTypes].flat().some(t=>t===e)}function Wf(n){var e=u.jsx(he,{icon:La});if(!_i(n))return e;var{icon:t}=n;return t==null?e:m.isValidElement(t)?t:u.jsx(he,{icon:t})}function cy(n){var e=[...n.entries()].filter(t=>bl(t[1]));return Bf.debug("Getting theme data from plugins",e),e.map(t=>{var[r,i]=t,o=Array.isArray(i.themes)?i.themes:[i.themes];return o.map(a=>{var{name:s,baseTheme:l,styleContent:d}=a;return{baseThemeKey:"default-".concat(l??"dark"),themeKey:vd(r,s),name:s,styleContent:d}})}).flat()}function my(){return Xn(jf,"No Plugins available in usePlugins. This can happen when plugins have not finished loading or if code is not wrapped in PluginsContext.Provider.")}function ia(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function vr(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?ia(Object(t),!0).forEach(function(r){on(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):ia(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function on(n,e,t){return(e=Uf(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Uf(n){var e=Vf(n,"string");return typeof e=="symbol"?e:e+""}function Vf(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 pr=W.module("ConsolePanel"),Kf=500,zf=Object.freeze({consoleSettings:{},itemIds:[]});class Lr extends m.PureComponent{constructor(e){super(e),on(this,"consoleRef",void 0),on(this,"objectSubscriptionCleanup",void 0),on(this,"savePanelState",Sn(()=>{var{consoleSettings:a,itemIds:s}=this.state,l={consoleSettings:a,itemIds:[...s]};pr.debug("Saving panel state",l),this.setState({panelState:l})},Kf)),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=$.createRef();var{panelState:t}=e,r=vr(vr({},zf),t||{}),{consoleSettings:i,itemIds:o}=r;this.state={consoleSettings:i,itemIds:new Map(o),objectMap:new Map,error:void 0,panelState:r}}componentDidMount(){var{glEventHub:e}=this.props;this.closeDisconnectedPanels(),e.on(ie.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(ie.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=>{pr.debug("Got updates",r),this.setState(i=>{var{objectMap:o}=i,{updated:a,created:s,removed:l}=r,d=[...a,...l],h=new Map(o);d.forEach(v=>{var{title:p}=v;p!==void 0&&h.delete(p)});var c=[...a,...s];return c.forEach(v=>{v.title!==void 0&&h.set(v.title,v)}),{objectMap:h}})})}}setItemId(e,t){this.setState(r=>{var{itemIds:i}=r,o=new Map(i);return o.set(e,t),{itemIds:o}})}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=kt(),this.setItemId(e,i)),i}handleTabFocus(){var e;(e=this.consoleRef.current)===null||e===void 0||e.focus()}handlePanelMount(e){var t,r,i,{itemIds:o}=this.state,a=e==null||(t=e.props)===null||t===void 0?void 0:t.id,s=e==null||(r=e.props)===null||r===void 0||(i=r.metadata)===null||i===void 0?void 0:i.sourcePanelId;if(a&&s){var l=new Set(o.values());l.has(s)&&this.setItemId(a,a)}}handleFocusCommandHistory(){var{glEventHub:e}=this.props;e.emit(Me.FOCUS_HISTORY)}handleResize(){this.updateDimensions()}handleShow(){this.updateDimensions()}handleOpenObject(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,{root:r}=this.context,i=e.title!=null?this.getItemId(e.title,!1):null;(t||i!=null&&D.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(ie.CLOSE,r)}}}handleSettingsChange(e){var{glEventHub:t}=this.props;pr.debug("handleSettingsChange",e),this.setState({consoleSettings:e}),t.emit(Me.SETTINGS_CHANGED,e)}openWidget(e){var{glEventHub:t,sessionWrapper:r}=this.props;R(r);var{config:i,session:o}=r,{title:a=e.name}=e;R(a);var s=this.getItemId(a),l={fetch:()=>o.getObject(e),panelId:s,widget:vr(vr({},fh(e)),{},{sessionId:i.id})};pr.debug("openWidget",l),t.emit(ie.OPEN,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 o=[...r.values()],{glEventHub:a}=this.props;o.forEach(s=>{a.emit(ie.CLOSE,s)}),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=>ra(r,e))}iconForType(e){var{plugins:t}=this.props,r=[...t.values()].find(i=>ra(i,e));return r!=null?Wf(r):u.jsx(Lh,{type:e})}render(){var{commandHistoryStorage:e,glContainer:t,glEventHub:r,sessionWrapper:i,timeZone:o,unzip:a}=this.props;if(i==null)return u.jsx(sn,{isLoading:!1,errorMessage:"Console is disabled."});var{consoleSettings:s,error:l,objectMap:d}=this.state,{config:h,session:c,connection:v,details:p={},dh:g}=i,{workerName:f,processInfoId:y}=p,{id:T,type:O}=h;return u.jsx(kn,{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:c!=null&&u.jsx(Gt,{dh:g,ref:this.consoleRef,settings:s,session:c,focusCommandHistory:this.handleFocusCommandHistory,openObject:this.handleOpenObject,closeObject:this.handleCloseObject,commandHistoryStorage:e,onSettingsChange:this.handleSettingsChange,language:O,statusBarChildren:u.jsxs(u.Fragment,{children:[u.jsx("div",{children:bs.LANGUAGE_MAP.get(O)}),f!=null&&u.jsxs(u.Fragment,{children:[u.jsx("div",{children:"•"}),f]}),y!=null&&u.jsxs(u.Fragment,{children:[u.jsx("div",{children:"•"}),y,u.jsx("div",{children:"•"})]}),u.jsx(vv,{connection:v,defaultUpdateInterval:10*1e3,hoverUpdateInterval:3*1e3,monitorDuration:10*60*1e3})]}),scope:T,timeZone:o,objectMap:d,unzip:a,supportsType:this.supportsType,iconForType:this.iconForType})})}}on(Lr,"COMPONENT","ConsolePanel");on(Lr,"TITLE","Console");on(Lr,"contextType",jp);var Gf=(n,e)=>({commandHistoryStorage:ms(n),sessionWrapper:nr(n,e.localDashboardId),timeZone:Eh(n),plugins:Th(n)}),Xr=In(Gf,null,null,{forwardRef:!0})(Lr);function vy(n){return n==="file"||n==="directory"}function ft(n){return n.type==="directory"}function qf(n,e,t){return(e=Zf(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Zf(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 Oi extends Error{constructor(){super("No file exists at the path specified"),qf(this,"isFileNotFound",!0)}}function oa(n,e,t,r,i,o,a){try{var s=n[o](a),l=s.value}catch(d){return void t(d)}s.done?e(l):Promise.resolve(l).then(r,i)}function aa(n){return function(){var e=this,t=arguments;return new Promise(function(r,i){var o=n.apply(e,t);function a(l){oa(o,r,i,a,s,"next",l)}function s(l){oa(o,r,i,a,s,"throw",l)}a(void 0)})}}var Mt;(function(n){n.GROOVY="text/x-groovy",n.PLAIN_TEXT="text/plain",n.PYTHON="text/x-python",n.PYTHON_COMPILED="application/x-python-code",n.SCALA="text/x-scala",n.UNKNOWN=""})(Mt||(Mt={}));class M{static fileExists(e,t){return aa(function*(){try{return yield e.info(t),!0}catch(r){if(!(r instanceof Oi))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(!M.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 o=i?"".concat(i,"-copy"):"Copy";return r!==null?"".concat(o,".").concat(r):o}static getUniqueCopyFileName(e,t){return aa(function*(){for(var r=M.getCopyFileName(t);yield M.fileExists(e,r);)r=M.getCopyFileName(r);return r})()}static getMimeType(e){var t=this.getExtension(e).toLowerCase();switch(t){case"groovy":return Mt.GROOVY;case"py":return Mt.PYTHON;case"pyc":return Mt.PYTHON_COMPILED;case"scala":return Mt.SCALA;case"txt":return Mt.PLAIN_TEXT;default:return Mt.UNKNOWN}}static getParent(e){if(!M.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(!M.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,o=M.fileExtensionToString(t);return"".concat(i).concat(o)}static validateName(e){var t=[".",".."],r=/[\\/\0]/g,i=new Map([["\0","null"]]);if(!e)throw new Vn("Name cannot be empty");if(t.includes(e))throw new Vn('"'.concat(e,'" is a reserved name'));if(r.test(e)){var o,a;throw new Vn('Invalid characters in name: "'.concat((o=(a=e.match(r))===null||a===void 0?void 0:a.reduce((s,l)=>s.includes(l)?s:[...s,l],[]).map(s=>i.has(s)?i.get(s):s).join('", "'))!==null&&o!==void 0?o:"",'"'))}}static reducePaths(e){var t=e.filter(r=>M.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 Ii=26;function hi(n){return ft(n)?M.makePath(n.filename):M.getPath(n.filename)}function sa(n,e){if(n.length===0||e==null)throw new Error("No items to move");var t=hi(e);if(n.some(r=>{var{filename:i}=r;return M.getPath(i)===t}))throw new Error("File already in the destination folder");if(n.some(r=>ft(r)&&t.startsWith(M.makePath(r.filename))))throw new Error("Destination folder cannot be a child of a dragged folder");return{files:n,targetPath:t}}function Yf(n){if(ft(n))return n.isExpanded?pd:fd;var e=M.getMimeType(n.basename);switch(e){case Mt.PYTHON:return bd;default:return gd}}function ci(n){var e,{children:t,draggedItems:r,isDragInProgress:i,isDropTargetValid:o,isSelected:a,item:s,itemIndex:l,dropTargetItem:d,onDragStart:h,onDragOver:c,onDragEnd:v,onDrop:p}=n,g=(e=r?.some(N=>N.id===s.id))!==null&&e!==void 0?e:!1,f=hi(s),y=i&&d?hi(d):null,T=i&&o&&ft(s)&&y===f,O=i&&o&&y===f,P=i&&!o&&y===f,F=Yf(s),U=M.getDepth(s.filename),te=Array(U).fill(null).map((N,B)=>u.jsx("span",{className:"file-list-depth-line"},B));return u.jsxs("div",{className:X("d-flex w-100 align-items-center","file-list-item",{"is-dragged":g,"is-exact-drop-target":T,"is-in-drop-target":O,"is-invalid-drop-target":P,"is-selected":a}),onDragStart:N=>h(l,N),onDragOver:N=>c(l,N),onDragEnd:N=>v(l,N),onDrop:N=>p(l,N),draggable:!0,role:"presentation","aria-label":s.basename,children:[te," ",u.jsx(he,{icon:F,className:"item-icon",fixedWidth:!0})," ",u.jsx("span",{className:"truncation-wrapper",children:t??u.jsxs(u.Fragment,{children:[s.basename,u.jsx(ue,{children:s.basename})]})})]})}function la(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function fr(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?la(Object(t),!0).forEach(function(r){Qf(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):la(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function Qf(n,e,t){return(e=Jf(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Jf(n){var e=eg(n,"string");return typeof e=="symbol"?e:e+""}function eg(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 Re=W.module("FileList"),tg=500,da="item-list-scroll-pane";function ng(n){var{isMultiSelect:e=!1,table:t,onFocusChange:r=()=>{},onMove:i,onSelect:o,onSelectionChange:a=()=>{},renderItem:s=ci,rowHeight:l=Ii,overscanCount:d=rt.DEFAULT_OVERSCAN}=n,[h,c]=m.useState(()=>({items:[],offset:0,itemCount:0})),[v,p]=m.useState({top:0,bottom:0}),[g,f]=m.useState(),[y,T]=m.useState(),[O,P]=m.useState(),[F,U]=m.useState([]),te=m.useRef(),N=m.useRef(null),B=m.useRef(null),H=m.useCallback(I=>{if(I.length===0||h==null)return[];for(var Z=[],ae=0;ae<I.length;ae+=1)for(var ce=I[ae],Fe=ce[0];Fe<=ce[1];Fe+=1)Fe>=h.offset&&Fe<h.offset+h.items.length&&Z.push(h.items[Fe-h.offset]);return Z},[h]),J=m.useCallback(I=>{var Z=H([[I,I]]);if(Z.length>0)return Z[0]},[H]),oe=m.useCallback(()=>{var I=ct.count(F);if(I===0)return null;if(I===1){var Z=F[0][0],ae=J(Z);if(ae!=null)return ae.filename}return"".concat(I," items")},[J,F]),L=m.useCallback(I=>{if(!(!y||!g)){Re.debug("dropItems",y,"to",I);try{var{files:Z,targetPath:ae}=sa(y,g);if(i?.(Z,ae),I!=null){var ce;U([[I,I]]),(ce=N.current)===null||ce===void 0||ce.focusItem(I)}}catch(Fe){Re.error("Unable to complete move",Fe)}}},[y,g,i]),q=m.useCallback((I,Z)=>{var ae=h.items[I-h.offset];ae!==void 0&&(Re.debug("handleItemClick",ae),o(ae,Z),ft(ae)&&t?.setExpanded(ae.filename,!ae.isExpanded))},[h,o,t]),K=m.useCallback((I,Z)=>{var ae,ce;Re.debug2("handleItemDragStart",I,F);var Fe=F;ct.isSelected(F,I)||(Fe=[[I,I]],U(Fe)),T(H(Fe)),(ae=N.current)===null||ae===void 0||ae.resetMouseState();var Pt=document.createElement("div"),Tt=document.createElement("div");Tt.className="dnd-placeholder-content",Tt.innerText=(ce=oe())!==null&&ce!==void 0?ce:"",Pt.appendChild(Tt),Pt.className="file-list-dnd-placeholder",document.body.appendChild(Pt),Z.dataTransfer.setDragImage(Pt,0,0),Z.dataTransfer.effectAllowed="move",P(Pt)},[oe,H,F]),j=m.useCallback((I,Z)=>{Z.preventDefault(),Re.debug2("handleItemDragOver",Z),f(J(I))},[J]),V=m.useCallback((I,Z)=>{Re.debug("handleItemDragEnd",I),O?.remove(),T(void 0),f(void 0),P(void 0)},[O]),z=m.useCallback((I,Z)=>{L(I)},[L]),ve=m.useCallback(()=>{Re.debug2("handleItemDragExit"),f(void 0)},[]),Ve=m.useCallback(I=>{I.target instanceof Element&&I.target.classList.contains(da)&&(I.preventDefault(),Re.debug2("handleListDragOver",I),f({type:"directory",filename:"/",basename:"/",id:"/"}))},[]),ke=m.useCallback(I=>{I.target instanceof Element&&I.target.classList.contains(da)&&(Re.debug("handleListDrop"),L())},[L]),b=m.useCallback(function(I){var Z=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(Re.debug2("handleSelectionChange",I),Z===!0||I!==F){U(I);var ae=H(I);a(ae)}},[H,a,F]),w=m.useCallback(I=>{if(Re.debug2("handleFocusChange",I),I!=null){var[Z]=H([[I,I]]);r(Z)}else r();te.current=I},[H,r]),_=m.useCallback((I,Z)=>{Re.debug("handleViewportChange",I,Z),(I!==v.top||Z!==v.bottom)&&p({top:I,bottom:Z})},[v]),G=m.useMemo(()=>{if(!y||!g)return!1;try{return sa(y,g),Re.debug("handleValidateDropTarget true"),!0}catch{return Re.debug("handleValidateDropTarget false"),!1}},[y,g]),{focusedPath:ne}=n;m.useEffect(()=>{ne!==void 0&&(ne==="/"?t.collapseAll():(t.setExpanded(ne,!1),t.setExpanded(ne,!0)))},[t,ne]),m.useEffect(function(){Re.debug("updating table viewport",v),t?.setViewport({top:Math.max(0,v.top-d),bottom:v.bottom+d})},[d,t,v]),m.useEffect(function(){var Z=t.onUpdate(ae=>{c({items:ae.items.map(ce=>fr(fr({},ce),{},{itemName:ce.basename})),offset:ae.offset,itemCount:t.size})});return()=>{Z()}},[t]),m.useEffect(function(){te.current!=null&&w(te.current),F.length>0&&b(F,!0)},[h,w,b,F]),m.useEffect(function(){if(g!=null&&ft(g)&&g.filename!=="/"){var Z=setTimeout(()=>{g.isExpanded||t?.setExpanded(g.filename,!0)},tg);return()=>clearTimeout(Z)}},[g,t]);var it=m.useCallback(I=>s(fr(fr({},I),{},{isDragInProgress:y!=null,dropTargetItem:g,draggedItems:y,isDropTargetValid:G,onDragStart:K,onDragEnd:V,onDragOver:j,onDragExit:ve,onDrop:z})),[V,ve,j,K,z,y,g,G,s]);return u.jsx("div",{ref:B,className:X("file-list",{"is-dragging":y!=null}),onDragOver:Ve,onDrop:ke,children:u.jsx(rt,{ref:N,items:h.items,itemCount:h.itemCount,offset:h.offset,onFocusChange:w,onSelect:q,onSelectionChange:b,onViewportChange:_,selectedRanges:F,renderItem:it,rowHeight:l,isMultiSelect:e,isDragSelect:!1,isDeselectOnClick:!1})})}var rg={DELETE:me.createAndAdd({id:"FILE_EXPLORER.DELETE",name:"Delete",shortcut:[x.DELETE],macShortcut:[A.CMD,x.BACKSPACE]}),RENAME:me.createAndAdd({id:"FILE_EXPLORER.RENAME",name:"Rename",shortcut:[x.ENTER],macShortcut:[x.ENTER]})};const ua={FILE_EXPLORER:rg};var ha=W.module("FileListItemEditor"),ig=()=>Promise.resolve();function og(n){var{item:e,onCancel:t,onSubmit:r,validate:i=ig}=n,o=m.useRef(null),[a,s]=m.useState(e.basename),[l,d]=m.useState(),[h,c]=m.useState(Promise.resolve()),v=m.useCallback(()=>{var O;(O=o.current)===null||O===void 0||O.focus()},[o]),p=m.useCallback(O=>O.stopPropagation(),[]),g=m.useCallback(()=>{h.then(()=>{r(a)}).catch(O=>ha.info("Unable to validate name",O))},[r,a,h]);m.useEffect(function(){var P=Te.makeCancelable(i(a));return P.then(()=>d(void 0)).catch(F=>{Te.isCanceled(F)||d(F)}),c(P),()=>P.cancel()},[i,a]),m.useEffect(function(){v()},[v]);var f=m.useCallback(()=>{ha.debug2("handleBlur"),g()},[g]),y=m.useCallback(O=>{var{value:P}=O.target;s(P)},[]),T=m.useCallback(O=>{O.stopPropagation();var{key:P}=O;switch(P){case"Enter":{g();break}case"Escape":{t();break}}},[t,g]);return u.jsxs("div",{className:"file-list-item-editor",children:[u.jsx("input",{type:"text",className:X("form-control file-list-item-editor-input",{"is-invalid":l}),value:a,ref:o,onBlur:f,onKeyDown:T,onChange:y,onClick:p,onDoubleClick:p,onMouseDown:p}),l&&u.jsx("div",{className:"invalid-feedback",children:"".concat(l)})]})}function ca(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?ca(Object(t),!0).forEach(function(r){ag(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):ca(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function ag(n,e,t){return(e=sg(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function sg(n){var e=lg(n,"string");return typeof e=="symbol"?e:e+""}function lg(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var 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 yl(n){var{isMultiSelect:e=!1,focusedPath:t,showContextMenu:r=!1,onCreateFile:i,onCreateFolder:o,onCopy:a,onDelete:s,onMove:l,onRename:d,onSelect:h,onSelectionChange:c,table:v,rowHeight:p=Ii,validateRename:g=()=>Promise.resolve()}=n,[f,y]=m.useState(),[T,O]=m.useState([]),[P,F]=m.useState(),U=m.useCallback(z=>{O(z),c?.(z)},[c]),te=m.useCallback(z=>{F(z)},[]),N=m.useCallback(()=>{P&&a?.(P)},[P,a]),B=m.useCallback(()=>{T.length>0&&s?.(T)},[s,T]),H=m.useCallback(()=>{i?.()},[i]),J=m.useCallback(()=>{P&&o?.(M.getPath(P.filename))},[P,o]),oe=m.useCallback(()=>{P&&y(P)},[P]),L=m.useCallback(()=>{y(void 0)},[]),q=m.useCallback(z=>{f&&(d?.(f,z),y(void 0))},[d,f]),K=m.useMemo(()=>{if(f)return[];var z=[];return i&&z.push({title:"New File",description:"Create new file",action:H,group:re.groups.medium}),o&&z.push({title:"New Folder",description:"Create new folder",action:J,group:re.groups.medium}),a&&z.push({title:"Copy File",description:"Copy the selected file",action:N,group:re.groups.low,disabled:P==null||ft(P)}),s&&T.length>0&&z.push({title:"Delete",description:"Delete",shortcut:ua.FILE_EXPLORER.DELETE,action:B,group:re.groups.low}),d&&z.push({title:"Rename",description:"Rename",shortcut:ua.FILE_EXPLORER.RENAME,action:oe,group:re.groups.low,disabled:P==null}),z},[N,B,H,J,oe,P,a,i,o,s,d,T,f]),j=m.useCallback(z=>(R(f),g(f,z)),[f,g]),V=m.useCallback(z=>{var{item:ve}=z;return f&&f.filename===ve.filename?u.jsx(ci,Yr(Yr({},z),{},{children:u.jsx(og,{item:ve,validate:j,onSubmit:q,onCancel:L})})):u.jsx(ci,Yr({},z))},[L,q,f,j]);return u.jsxs("div",{className:"file-list-container",children:[v!=null&&u.jsx(ng,{onMove:l,onSelect:h,onSelectionChange:U,onFocusChange:te,renderItem:V,rowHeight:p,table:v,isMultiSelect:e,focusedPath:t}),r&&u.jsx(re,{actions:K})]})}yl.displayName="FileListContainer";function ma(n,e,t){return(e=dg(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function dg(n){var e=ug(n,"string");return typeof e=="symbol"?e:e+""}function ug(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 Vn{constructor(e){super("Name already exists"),ma(this,"isExistingFile",!0),ma(this,"info",void 0),this.info=e}}function va(n,e,t,r,i,o,a){try{var s=n[o](a),l=s.value}catch(d){return void t(d)}s.done?e(l):Promise.resolve(l).then(r,i)}function pa(n){return function(){var e=this,t=arguments;return new Promise(function(r,i){var o=n.apply(e,t);function a(l){va(o,r,i,a,s,"next",l)}function s(l){va(o,r,i,a,s,"throw",l)}a(void 0)})}}var bt=W.module("FileExplorer");function Di(n){var{storage:e,isMultiSelect:t=!1,focusedPath:r,onCopy:i=()=>{},onDelete:o=()=>{},onRename:a=()=>{},onCreateFile:s=()=>{},onCreateFolder:l=()=>{},onSelect:d,onSelectionChange:h,rowHeight:c=Ii}=n,[v,p]=m.useState([]),[g,f]=m.useState();m.useEffect(function(){var q;function K(){return j.apply(this,arguments)}function j(){return j=pa(function*(){bt.debug("initTable"),q=Te.makeCancelable(e.getTable(),V=>V.close());try{f(yield q)}catch(V){Te.isCanceled(V)||bt.error("Unable to initialize table",V)}}),j.apply(this,arguments)}return K(),()=>{q.cancel()}},[e]);var y=m.useCallback(L=>{Te.isCanceled(L)||bt.error(L)},[]),T=m.useCallback(()=>{bt.debug("handleCreateFile"),s()},[s]),O=m.useCallback(()=>{bt.debug("handleCreateFolder"),l()},[l]),P=m.useCallback(L=>{bt.debug("handleCopyFile",L.filename),i(L)},[i]),F=m.useCallback(L=>{bt.debug("handleDelete, pending confirmation",L),p(L)},[]),U=m.useCallback(()=>{bt.debug("handleDeleteConfirm",v),v.forEach(L=>e.deleteFile(ft(L)?M.makePath(L.filename):L.filename)),o(v),p([])},[v,o,e]),te=m.useCallback(()=>{bt.debug("handleDeleteCancel"),p([])},[]),N=m.useCallback((L,q)=>{var K=M.reducePaths(L.map(j=>ft(j)?M.makePath(j.filename):j.filename));K.forEach(j=>{var V=M.isPath(j)?"".concat(q).concat(M.getBaseName(j.substring(0,j.length-1)),"/"):"".concat(q).concat(M.getBaseName(j));e.moveFile(j,V).then(()=>{a(j,V)}).catch(y)})},[y,a,e]),B=m.useCallback((L,q)=>{var K=L.filename,j=ft(L);j&&!K.endsWith("/")&&(K="".concat(K,"/"));var V="".concat(M.getParent(K)).concat(q);j&&!V.endsWith("/")&&(V="".concat(V,"/")),bt.debug2("handleRename",K,V),e.moveFile(K,V).catch(y),a(K,V)},[y,a,e]),H=m.useCallback(function(){var L=pa(function*(q,K){if(K!==q.basename){M.validateName(K);var j="".concat(M.getPath(q.filename)).concat(K);try{var V=yield e.info(j);throw new br(V)}catch(z){if(!(z instanceof Oi))throw z}}});return function(q,K){return L.apply(this,arguments)}}(),[e]),J=v.length>0,oe=m.useMemo(()=>v.length===1?'Are you sure you want to delete "'.concat(v[0].filename,'"?'):"Are you sure you want to delete the selected files?",[v]);return u.jsxs("div",{className:"file-explorer",children:[g&&u.jsx(yl,{isMultiSelect:t,focusedPath:r,showContextMenu:!0,onCopy:P,onCreateFolder:O,onCreateFile:T,onMove:N,onDelete:F,onRename:B,onSelect:d,onSelectionChange:h,rowHeight:c,table:g,validateRename:H}),u.jsx(an,{isOpen:J,headerText:oe,bodyText:"You cannot undo this action.",onCancel:te,onConfirm:U,confirmButtonText:"Delete"})]})}Di.displayName="FileExplorer";function fa(n,e,t,r,i,o,a){try{var s=n[o](a),l=s.value}catch(d){return void t(d)}s.done?e(l):Promise.resolve(l).then(r,i)}function hg(n){return function(){var e=this,t=arguments;return new Promise(function(r,i){var o=n.apply(e,t);function a(l){fa(o,r,i,a,s,"next",l)}function s(l){fa(o,r,i,a,s,"throw",l)}a(void 0)})}}function Wt(n,e,t){return(e=cg(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function cg(n){var e=mg(n,"string");return typeof e=="symbol"?e:e+""}function mg(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var 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=W.module("NewItemModal");class Zt extends m.PureComponent{static getValidationMessage(e){return e instanceof br&&e.info.type==="directory"?"Error: Cannot overwrite existing directory":"".concat(e)}static handleError(e){Te.isCanceled(e)||Jt.error(e)}constructor(e){super(e),Wt(this,"inputRef",$.createRef()),Wt(this,"cancelableValidatePromise",void 0),Wt(this,"cancelableExistingItemPromise",void 0),Wt(this,"pending",new Dn),Wt(this,"pathMap",new Map),Wt(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=M.hasPath(t)?M.getPath(t):"/";this.state={isSubmitting:!1,path:r,prevExtension:M.getExtension(t),showExtensionChangeModal:!1,showOverwriteModal:!1,value:M.getBaseName(t)}}componentDidUpdate(e,t){var{isOpen:r}=this.props,{isOpen:i}=e,{value:o,path:a}=this.state;!i&&r&&(this.resetValue(),this.isInitialLoad=!0),i&&r&&(!this.isInitialLoad&&(a!==t.path||o!==t.value)&&this.updateValidationStatus(a,o),this.isInitialLoad=!1)}componentWillUnmount(){this.pending.cancel(),this.cancelableValidatePromise&&this.cancelableValidatePromise.cancel(),this.cancelableExistingItemPromise&&this.cancelableExistingItemPromise.cancel()}resetValue(){var{defaultValue:e}=this.props,t=M.hasPath(e)?M.getPath(e):"/";this.setState({path:t,value:M.getBaseName(e),validationError:void 0,prevExtension:M.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=Te.makeCancelable(this.validateName(e,t,r)),this.cancelableValidatePromise}validateName(e,t,r){var i=this;return hg(function*(){M.validateName(t);var{defaultValue:o,storage:a}=i.props;if(r){var s="".concat(e).concat(t);if(s!==o)try{var l=yield a.info(s);throw new br(l)}catch(d){if(!(d instanceof Oi))throw d}}return t})()}updateValidationStatus(e,t){this.getValidationPromise(e,t).then(()=>{this.setState({validationError:void 0})}).catch(this.handleValidationError).catch(Zt.handleError)}handleModalOpened(){this.focusRenameInput()}handleModalSubmit(){this.submitModal()}handleChange(e){var{value:t}=e.target;this.setState({value:t})}handleSelect(e){if(Jt.debug("handleSelect",e),e.type==="directory")this.setState({path:M.makePath(e.filename)});else{var t=e.basename,r=M.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 Vn))throw e;Jt.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;Jt.debug("handleOverwriteConfirm",t,r),e("".concat(t).concat(r),!0)}handleExtensionChangeCancel(){Jt.debug("handleExtensionChangeCancel"),this.setState(e=>{var{value:t,prevExtension:r}=e,i=M.replaceExtension(t,r);return{showExtensionChangeModal:!1,value:i}}),this.submitModal(!0)}handleExtensionChangeConfirm(){Jt.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:o}=t,{notifyOnExtensionChange:a,type:s}=this.props;Jt.debug("submitModal",r,i);var l=M.getExtension(i);return a&&!e&&r!==null&&r!==l?{isSubmitting:!1,showExtensionChangeModal:!0,newExtension:l}:(this.getValidationPromise(o,i,!0).then(d=>{var{onSubmit:h}=this.props;h("".concat(o).concat(i))}).catch(d=>{if(d instanceof br&&s!=="directory"&&d.info.type!=="directory"){this.setState({showOverwriteModal:!0});return}throw d}).catch(d=>{throw Te.isCanceled(d)&&this.setState({isSubmitting:!1}),d}).catch(this.handleValidationError).catch(Zt.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 o="",a=0;a<i;a+=1)o+="".concat(t[a],"/");return o+="".concat(r,"/"),u.jsxs($.Fragment,{children:[u.jsx(ee,{kind:"ghost",className:"directory-breadcrumbs",onClick:()=>this.handleBreadcrumbSelect(o),"aria-label":i===0?"Home":void 0,icon:i===0?u.jsx(he,{icon:yd,transform:"right-1.6"}):void 0,tooltip:i===0?"Home":void 0,children:r}),"/"]},o)})}render(){var{storage:e,isOpen:t,onCancel:r,placeholder:i,title:o,type:a}=this.props,{isSubmitting:s,path:l,showExtensionChangeModal:d,showOverwriteModal:h,validationError:c,value:v,prevExtension:p,newExtension:g}=this.state,f=a==="directory",y=M.fileExtensionToString(p),T=M.fileExtensionToString(g),O=f?"Create":"Save",P=f?"New folder name":"Save file as";return u.jsxs(u.Fragment,{children:[u.jsxs(Ma,{isOpen:t,toggle:r,onOpened:this.handleModalOpened,className:"modal-dialog-centered new-file-modal",children:[u.jsx(ka,{toggle:r,children:o}),u.jsx(Na,{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:P}),u.jsx("input",{id:"file-name-input",type:"text",autoComplete:"off",autoCapitalize:"none",autoCorrect:"off",spellCheck:"false",className:X("form-control",{"is-invalid":c}),value:v,placeholder:i,ref:this.inputRef,onKeyDown:this.handleKeyDown,onChange:this.handleChange}),c&&u.jsx("div",{className:"invalid-feedback",children:Zt.getValidationMessage(c)})]}),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(Di,{onSelect:this.handleSelect,storage:e,focusedPath:l})})]})})}),u.jsxs(rs,{children:[u.jsx(ee,{kind:"secondary",onClick:r,children:"Cancel"}),u.jsx(ee,{kind:"primary",disabled:s,onClick:this.handleModalSubmit,children:O})]})]}),u.jsx(an,{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(an,{isOpen:d,headerText:"Confirm extension change",bodyText:'Are you sure you want to change extension from "'.concat(y,'" to "').concat(T,'"?'),onCancel:this.handleExtensionChangeCancel,onConfirm:this.handleExtensionChangeConfirm,cancelButtonText:'Keep "'.concat(y,'"'),confirmButtonText:'Use "'.concat(T,'"')})]})}}Wt(Zt,"propTypes",{isOpen:S.bool,title:S.string.isRequired,defaultValue:S.string,type:S.oneOf(["file","directory"]).isRequired,onSubmit:S.func,onCancel:S.func,placeholder:S.string,storage:S.shape({}).isRequired,notifyOnExtensionChange:S.bool});Wt(Zt,"defaultProps",{isOpen:!1,defaultValue:"/",notifyOnExtensionChange:!1,placeholder:"",onSubmit:(n,e)=>{},onCancel:()=>{}});function vg(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(ee,{kind:"ghost",icon:Ka,tooltip:"New notebook",onClick:e,"aria-label":"New notebook"}),u.jsx(ee,{kind:"ghost",icon:Cd,tooltip:"New folder",onClick:t,"aria-label":"New folder"})]}),r&&u.jsx("div",{className:"file-explorer-toolbar-search",children:u.jsx(ss,{value:i,onChange:r,placeholder:"Search by name"})})]})}function ga(n,e,t,r,i,o,a){try{var s=n[o](a),l=s.value}catch(d){return void t(d)}s.done?e(l):Promise.resolve(l).then(r,i)}function pg(n){return function(){var e=this,t=arguments;return new Promise(function(r,i){var o=n.apply(e,t);function a(l){ga(o,r,i,a,s,"next",l)}function s(l){ga(o,r,i,a,s,"throw",l)}a(void 0)})}}function Cl(n,e,t){return(e=fg(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function fg(n){var e=gg(n,"string");return typeof e=="symbol"?e:e+""}function gg(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 en=W.module("FileExplorerPanel"),bg=(n,e)=>{var t=vs(n),r=nr(n,e.localDashboardId),{session:i,config:o}=r??{},a=o?.type;return{fileStorage:t,language:a,session:i}},yg=In(bg,null,null,{forwardRef:!0});function Cg(n){var e=n;return e!=null&&typeof e.button=="number"}class On extends $.Component{static handleError(e){en.error(e)}static isFocusEvent(e){return Cg(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:""};en.debug("handleCreateFile",t,r,i),e.emit(Q.CREATE_NOTEBOOK,t,r,i)}handleCreateDirectory(){this.setState({showCreateFolder:!0})}handleCreateDirectoryCancel(){en.debug("handleCreateDirectoryCancel"),this.setState({showCreateFolder:!1})}handleCreateDirectorySubmit(e){en.debug("handleCreateDirectorySubmit",e),this.setState({showCreateFolder:!1});var{fileStorage:t}=this.props;t.createDirectory(e).catch(On.handleError)}handleCopyFile(e){var t=this;return pg(function*(){var{fileStorage:r}=t.props;if(ft(e)){en.error("Invalid item in handleCopyItem",e);return}var i=yield M.getUniqueCopyFileName(r,e.filename);yield r.copyFile(e.filename,i)})()}handleDelete(e){var{glEventHub:t}=this.props;e.forEach(r=>{t.emit(Q.CLOSE_FILE,{id:r.filename,itemName:r.filename})})}handleSelectionChange(e){var t="/";e.length===1&&(e[0].type==="directory"?t=M.makePath(e[0].filename):t=M.getPath(e[0].filename)),this.setState({focusedFilePath:t})}handleFileSelect(e,t){if(en.debug("fileSelect",e),e.type!=="directory"){var r=On.isFocusEvent(t),i={id:e.filename,itemName:e.filename},{glEventHub:o}=this.props,{session:a,language:s}=this.state,l={value:null,language:s};o.emit(Q.SELECT_NOTEBOOK,a,s,l,i,r)}}handleRename(e,t){var{glEventHub:r}=this.props;en.debug("handleRename",e,t),r.emit(Q.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:o,focusedFilePath:a}=this.state;return u.jsxs(kn,{className:"file-explorer-panel",componentPanel:this,glContainer:t,glEventHub:r,onSessionOpen:this.handleSessionOpened,onSessionClose:this.handleSessionClosed,onShow:this.handleShow,children:[u.jsx(vg,{createFile:this.handleCreateFile,createFolder:this.handleCreateDirectory}),i&&u.jsx(Di,{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(Zt,{isOpen:o,type:"directory",title:"Create New Folder",storage:e,onSubmit:this.handleCreateDirectorySubmit,onCancel:this.handleCreateDirectoryCancel,defaultValue:a})]})}}Cl(On,"COMPONENT","FileExplorerPanel");Cl(On,"TITLE","File Explorer");var Sg=yg(On);function Zn(n,e,t){return(e=wg(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function wg(n){var e=Eg(n,"string");return typeof e=="symbol"?e:e+""}function Eg(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 ba=W.module("LogPanel");class Fr extends m.PureComponent{constructor(e){super(e),Zn(this,"isBottomVisible",void 0),Zn(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){ba.debug("Session opened",[e]),this.setState({session:e})}handleSessionClosed(e){ba.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(kn,{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(ye,{session:r,ref:i=>{this.logView=i}})]})}}Zn(Fr,"defaultProps",{session:null});Zn(Fr,"COMPONENT","LogPanel");Zn(Fr,"TITLE","Log");var Pg=(n,e)=>{var t;return{session:(t=nr(n,e.localDashboardId))===null||t===void 0?void 0:t.session}},Tg=In(Pg,null,null,{forwardRef:!0})(Fr);function ya(n,e,t,r,i,o,a){try{var s=n[o](a),l=s.value}catch(d){return void t(d)}s.done?e(l):Promise.resolve(l).then(r,i)}function Ca(n){return function(){var e=this,t=arguments;return new Promise(function(r,i){var o=n.apply(e,t);function a(l){ya(o,r,i,a,s,"next",l)}function s(l){ya(o,r,i,a,s,"throw",l)}a(void 0)})}}function Sa(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 Ge(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Sa(Object(t),!0).forEach(function(r){Ae(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Sa(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function Ae(n,e,t){return(e=_g(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function _g(n){var e=Og(n,"string");return typeof e=="symbol"?e:e+""}function Og(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 Ig=m.lazy(()=>za(()=>import("./MarkdownNotebook-DhNRFKM5.js"),__vite__mapDeps([6,4,3,5,7,8,9,10,11,12]),import.meta.url)),de=W.module("NotebookPanel"),wa=400;class Oe extends m.Component{static handleError(e){Te.isCanceled(e)||de.error(e)}static unsavedNotebookCount(){return document.querySelectorAll(".".concat(Oe.UNSAVED_INDICATOR_CLASS_NAME,".").concat(Oe.UNSAVED_STATUS_CLASS_NAME)).length}static languageFromFileName(e){var t=M.getExtension(e).toLowerCase();switch(t){case"py":case"python":return"python";case"groovy":return"groovy";case"scala":return"scala";default:return null}}constructor(e){super(e),Ae(this,"pending",void 0),Ae(this,"debouncedSavePanelState",void 0),Ae(this,"debouncedLoad",void 0),Ae(this,"notebook",void 0),Ae(this,"tabTitleElement",void 0),Ae(this,"tabInitOnce",void 0),Ae(this,"editor",void 0),Ae(this,"getSettings",wt((v,p)=>Ge(Ge({},v),{},{minimap:{enabled:p}}))),Ae(this,"getOverflowActions",wt((v,p)=>[{title:"Find",icon:Ed,action:this.handleFind,group:re.groups.high,shortcut:Be.NOTEBOOK.FIND,order:10},{title:"Copy File",icon:ja,action:this.handleCopy,group:re.groups.medium,order:20},{title:"Rename File",icon:Pd,action:this.handleShowRename,group:re.groups.medium,order:30},{title:"Delete File",icon:Ba,action:this.handleDelete,group:re.groups.medium,order:40},{title:"Show Minimap",icon:v?Un:void 0,action:this.handleMinimapChange,group:re.groups.low,shortcut:Be.NOTEBOOK.MINIMAP,order:20},{title:"Word Wrap",icon:p?Un:void 0,action:this.handleWordWrapChange,group:re.groups.low,shortcut:Be.NOTEBOOK.WORDWRAP,order:30}])),this.handleCloseCancel=this.handleCloseCancel.bind(this),this.handleCloseDiscard=this.handleCloseDiscard.bind(this),this.handleCloseSave=this.handleCloseSave.bind(this),this.handleCopy=this.handleCopy.bind(this),this.handleDelete=this.handleDelete.bind(this),this.handleDeleteConfirm=this.handleDeleteConfirm.bind(this),this.handleDeleteCancel=this.handleDeleteCancel.bind(this),this.handleEditorInitialized=this.handleEditorInitialized.bind(this),this.handleEditorWillDestroy=this.handleEditorWillDestroy.bind(this),this.handleEditorChange=this.handleEditorChange.bind(this),this.handleFind=this.handleFind.bind(this),this.handleMinimapChange=this.handleMinimapChange.bind(this),this.handleWordWrapChange=this.handleWordWrapChange.bind(this),this.handleLinkClick=this.handleLinkClick.bind(this),this.handleLoadSuccess=this.handleLoadSuccess.bind(this),this.handleLoadError=this.handleLoadError.bind(this),this.handlePanelDropped=this.handlePanelDropped.bind(this),this.handleRenameFile=this.handleRenameFile.bind(this),this.handleResize=this.handleResize.bind(this),this.handleRunCommand=this.handleRunCommand.bind(this),this.handleRunAll=this.handleRunAll.bind(this),this.handleRunSelected=this.handleRunSelected.bind(this),this.handleSave=this.handleSave.bind(this),this.handleSaveAsCancel=this.handleSaveAsCancel.bind(this),this.handleSaveAsSubmit=this.handleSaveAsSubmit.bind(this),this.handleSaveError=this.handleSaveError.bind(this),this.handleSaveSuccess=this.handleSaveSuccess.bind(this),this.handleSessionOpened=this.handleSessionOpened.bind(this),this.handleSessionClosed=this.handleSessionClosed.bind(this),this.handleShow=this.handleShow.bind(this),this.handleShowRename=this.handleShowRename.bind(this),this.handleTab=this.handleTab.bind(this),this.handleTabBlur=this.handleTabBlur.bind(this),this.handleTabClick=this.handleTabClick.bind(this),this.handleTabFocus=this.handleTabFocus.bind(this),this.handleTransformLinkUri=this.handleTransformLinkUri.bind(this),this.handleOverwrite=this.handleOverwrite.bind(this),this.handlePreviewPromotion=this.handlePreviewPromotion.bind(this),this.getDropdownOverflowActions=this.getDropdownOverflowActions.bind(this),this.pending=new Dn,this.debouncedSavePanelState=Sn(this.savePanelState.bind(this),wa),this.debouncedLoad=Sn(this.load.bind(this),wa),this.notebook=null,this.tabTitleElement=null,this.tabInitOnce=!1;var{isDashboardActive:t,session:r,sessionLanguage:i,panelState:o}=e,a={value:"",language:"",wordWrap:"off"},s=null,{isPreview:l}=e;o!=null&&({fileMetadata:s=s,isPreview:l=l,settings:a=a}=o);var d=s!=null&&M.hasPath(s.itemName),h=d===!0&&a.value!=null||!d&&a.value!=null&&a.value.length>0,c=h?1:0;this.state={error:void 0,isDashboardActive:t,isLoading:!0,isLoaded:!1,isPreview:l,savedChangeCount:0,changeCount:c,fileMetadata:s,settings:a,session:r,sessionLanguage:i,panelState:{fileMetadata:s,settings:a},showCloseModal:!1,showDeleteModal:!1,showSaveAsModal:!1,scriptCode:""},de.debug("constructor",e,this.state)}componentDidMount(){var{glContainer:e,glEventHub:t}=this.props,{tab:r}=e;r!=null&&this.initTab(r),this.initNotebookContent(),t.on(Q.RENAME_FILE,this.handleRenameFile),t.on(ie.DROPPED,this.handlePanelDropped),e.on(Q.PROMOTE_FROM_PREVIEW,this.handlePreviewPromotion)}componentDidUpdate(e,t){var{isPreview:r,settings:i}=this.state,{wordWrap:o}=i,{defaultNotebookSettings:a}=this.props;r!==t.isPreview&&this.setPreviewStatus(),o!==t.settings.wordWrap&&(this.updateEditorWordWrap(),this.debouncedSavePanelState()),a.isMinimapEnabled!==e.defaultNotebookSettings.isMinimapEnabled&&this.updateEditorMinimap()}componentWillUnmount(){this.debouncedSavePanelState.flush(),this.pending.cancel();var{glEventHub:e,glContainer:t}=this.props,{fileMetadata:r,isPreview:i}=this.state;e.off(Q.RENAME_FILE,this.handleRenameFile),e.off(ie.DROPPED,this.handlePanelDropped),t.off(Q.PROMOTE_FROM_PREVIEW,this.handlePreviewPromotion),e.emit(Q.UNREGISTER_FILE,r,i)}initTab(e){this.tabInitOnce||(this.tabInitOnce=!0,this.initTabCloseOverride()),this.initTabClasses(e)}initTabCloseOverride(){var{glContainer:e}=this.props;e.beforeClose(t=>{if(t?.force===!0)return!0;var{changeCount:r,savedChangeCount:i}=this.state;return r!==i?(this.setState({showCloseModal:!0}),!1):!0})}initTabClasses(e){var t=e.element.get(0);R(t);var r=t.querySelector(".lm_title");this.tabTitleElement=r,r?.classList.add("notebook-title"),this.setPreviewStatus()}getNotebookValue(){var{changeCount:e,savedChangeCount:t,settings:r}=this.state,{value:i}=r;if(e!==t&&this.notebook){var o=this.notebook.getValue();return o??i}return i}initNotebookContent(){var{fileMetadata:e,settings:t,isPreview:r}=this.state;if(e&&e.id){de.debug("Init content from file"),this.registerFileMetadata(e,r),this.load();return}if(t.value!=null){de.debug("Use content passed in the settings prop"),this.handleLoadSuccess();return}this.handleLoadError(new Error("Missing file metadata"))}closeFileTabById(e){var{glEventHub:t}=this.props;t.emit(Q.CLOSE_FILE,{id:e})}registerFileMetadata(e,t){var{glEventHub:r,metadata:i}=this.props,{id:o}=i;r.emit(Q.REGISTER_FILE,o,e,t)}renameTab(e,t){var{glEventHub:r}=this.props;r.emit(Q.RENAME,e,t)}load(){var{fileMetadata:e,settings:t}=this.state;R(e);var{id:r}=e,{fileStorage:i}=this.props;this.pending.add(i.loadFile(r)).then(o=>{var a;de.debug("Loaded file",o);var{filename:s}=o,{itemName:l}=this.state;if(s!==l){var{metadata:d}=this.props,{id:h}=d;this.renameTab(h,M.getBaseName(s))}var c=Ge(Ge({},t),{},{language:(a=Oe.languageFromFileName(s))!==null&&a!==void 0?a:""});t.value==null&&(c.value=o.content),t.wordWrap===void 0&&(t.wordWrap="off"),this.setState({fileMetadata:{id:s,itemName:s},settings:c}),this.debouncedSavePanelState()}).then(this.handleLoadSuccess).catch(this.handleLoadError)}save(){var{fileMetadata:e}=this.state;if(e&&M.hasPath(e.itemName)){var t=this.getNotebookValue();return t!==void 0?(this.saveContent(e.itemName,t),!0):!1}return this.setState({showSaveAsModal:!0}),!1}saveContent(e,t){de.debug("saveContent",e,t),this.updateSavedChangeCount();var{fileStorage:r}=this.props;this.pending.add(r.saveFile({filename:e,content:t,basename:e})).then(this.handleSaveSuccess).catch(this.handleSaveError)}updateSavedChangeCount(){this.setState(e=>{var{changeCount:t}=e;return{savedChangeCount:t}})}setPreviewStatus(){if(this.tabTitleElement){var{isPreview:e}=this.state;de.debug("setPreviewStatus",this.tabTitleElement,e),e?this.tabTitleElement.classList.add("is-preview"):this.tabTitleElement.classList.remove("is-preview")}}handlePreviewPromotion(){this.removePreviewStatus()}savePanelState(){this.setState(e=>{var{changeCount:t,savedChangeCount:r,fileMetadata:i,isPreview:o,settings:a}=e,s=this.getNotebookValue(),l=t!==r?s:void 0,d=Ge(Ge({},a),{},{value:s}),h=Ge(Ge({},a),{},{value:l}),c={settings:h,fileMetadata:i,isPreview:o};return de.debug("Saving panel state",c),{settings:d,panelState:c}})}handleCloseDiscard(){this.setState({showCloseModal:!1});var{glContainer:e}=this.props;e.close({force:!0})}handleCloseSave(){if(this.setState({showCloseModal:!1}),this.save()){var{glContainer:e}=this.props;e.close({force:!0})}}handleCloseCancel(){this.setState({showCloseModal:!1})}handleOverwrite(e){var{glEventHub:t}=this.props;t.emit(Q.CLOSE_FILE,{id:e,itemName:e},{force:!0}),this.focus()}handleCopy(){var e=this;return Ca(function*(){var{fileStorage:t,glEventHub:r,session:i}=e.props,{fileMetadata:o,settings:a}=e.state;R(o);var{language:s}=a,{itemName:l}=o,d=yield M.getUniqueCopyFileName(t,l);de.debug("handleCopy",o,l,d),yield t.copyFile(l,d);var h={id:d,itemName:d},c={value:null,language:s};r.emit(Q.SELECT_NOTEBOOK,i,s,c,h,!0)})()}handleDelete(){de.debug("handleDelete, pending confirmation"),this.setState({showDeleteModal:!0})}handleDeleteConfirm(){var e=this;return Ca(function*(){var{fileStorage:t,glContainer:r,glEventHub:i}=e.props,{fileMetadata:o}=e.state;de.debug("handleDeleteConfirm",o?.itemName),e.setState({showDeleteModal:!1}),o&&(M.hasPath(o.itemName)&&(yield M.fileExists(t,o.itemName))?(i.emit(Q.CLOSE_FILE,o,{force:!0}),t.deleteFile(o.itemName)):r.close({force:!0}))})()}handleDeleteCancel(){this.setState({showDeleteModal:!1})}handleEditorInitialized(e){this.editor=e}handleEditorWillDestroy(){this.editor=void 0}handleEditorChange(e){de.debug2("handleEditorChanged",e),this.removePreviewStatus(),this.setState(t=>{var{changeCount:r,savedChangeCount:i}=t,{isUndoing:o,isRedoing:a}=e;return o?{changeCount:r-1,savedChangeCount:i}:!a&&r<i?{changeCount:r+1,savedChangeCount:0}:{changeCount:r+1,savedChangeCount:i}}),this.debouncedSavePanelState()}handleFind(){this.notebook&&this.notebook.toggleFind()}updateEditorMinimap(){if(this.editor){var{defaultNotebookSettings:e}=this.props;this.editor.updateOptions({minimap:{enabled:e.isMinimapEnabled}})}}handleMinimapChange(){var e,{defaultNotebookSettings:t,updateSettings:r}=this.props,i={defaultNotebookSettings:{isMinimapEnabled:!((e=t.isMinimapEnabled)!==null&&e!==void 0&&e)}};r(i)}updateEditorWordWrap(){if(this.editor){var{settings:e}=this.state,{wordWrap:t}=e;this.editor.updateOptions({wordWrap:t})}}handleWordWrapChange(){this.editor&&this.setState(e=>{var{settings:t}=e,r=t.wordWrap==="on"?"off":"on";return{settings:Ge(Ge({},t),{},{wordWrap:r})}})}handleLinkClick(e){var{notebooksUrl:t,session:r,sessionLanguage:i}=this.props,{href:o}=e.currentTarget;if(!(!o||!o.startsWith(t))){e.stopPropagation(),e.preventDefault();var a="/".concat(o.substring(t.length)).replace(/%20/g," ");if(a==="/"){de.debug("Ignoring invalid notebook link",a);return}de.debug("Notebook link clicked, opening",a);var{glEventHub:s}=this.props,l={value:null,language:i},d={id:a,itemName:a};s.emit(Q.SELECT_NOTEBOOK,r,i,l,d)}}handleLoadSuccess(){this.setState({error:void 0,isLoaded:!0,isLoading:!1})}handleLoadError(e){var t=e;Te.isCanceled(t)||(Te.isTimedOut(t)&&(t=new Error("File not found.")),de.error(t),this.setState({error:t,isLoading:!1}))}handleSave(){de.debug("handleSave"),this.save()}handleSaveSuccess(e){var t,{fileStorage:r}=this.props,i={id:e.filename,itemName:e.filename},o=(t=Oe.languageFromFileName(e.filename))!==null&&t!==void 0?t:"";this.setState(a=>{var{fileMetadata:s}=a,l=Ge(Ge({},a.settings),{},{language:o});return de.debug("handleSaveSuccess",i,s,l),s&&M.hasPath(s.itemName)&&s.itemName!==i.itemName&&(de.debug("handleSaveSuccess deleting old file",s.itemName),r.deleteFile(s.itemName).catch(Oe.handleError)),{fileMetadata:i,settings:l,isPreview:!1}}),this.debouncedSavePanelState(),this.registerFileMetadata(i,!1)}handleSaveError(e){Te.isCanceled(e)||(this.setState({savedChangeCount:0}),de.error(e))}handleSaveAsCancel(){this.setState({showSaveAsModal:!1})}handleSaveAsSubmit(e){var t,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;r&&this.handleOverwrite(e),de.debug("handleSaveAsSubmit",e);var{fileMetadata:i}=this.state;if(i){var{itemName:o}=i,a=(t=this.getNotebookValue())!==null&&t!==void 0?t:"";if(this.setState({showSaveAsModal:!1}),M.getBaseName(o)!==M.getBaseName(e)){var{metadata:s}=this.props,{id:l}=s;this.renameTab(l,M.getBaseName(e))}this.saveContent(e,a)}}handleRenameFile(e,t,r){var{fileMetadata:i,panelState:o}=this.state,{glContainer:a}=this.props;if(i?.itemName==="/".concat(t)&&r&&JSON.stringify(o)!==JSON.stringify(r)){a.close();return}i&&i.id===e&&(this.setState({fileMetadata:{id:t,itemName:t}}),this.debouncedSavePanelState())}handleResize(){var e;(e=this.notebook)===null||e===void 0||e.updateDimensions()}handleRunCommand(e){this.runCommand(e)}handleRunAll(){var e;if(!this.notebook){de.error("Editor is not initialized.");return}this.runCommand((e=this.notebook.getValue())!==null&&e!==void 0?e:void 0)}handleRunSelected(){if(!this.notebook){de.error("Editor is not initialized.");return}this.runCommand(this.notebook.getSelectedCommand())}handleSessionOpened(e,t){var{language:r}=t;this.setState({session:e,sessionLanguage:r})}handleSessionClosed(){this.setState({session:void 0,sessionLanguage:void 0})}handleShow(){var e;de.debug("handleShow"),(e=this.notebook)===null||e===void 0||e.updateDimensions()}handlePanelDropped(e){var{metadata:{id:t}}=this.props;e===t&&this.forceUpdate()}handleShowRename(){this.setState({showSaveAsModal:!0})}handleTab(e){de.debug("NotebookPanel tab event",e),this.initTab(e)}handleTabFocus(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];de.debug("handleTabFocus",...t);var{glContainer:i}=this.props;this.setState({isDashboardActive:!0}),this.notebook&&!i.isHidden&&this.notebook.updateDimensions()}handleTabBlur(){de.debug("handleTabBlur"),this.setState({isDashboardActive:!1})}handleTabClick(e){de.debug("handle NotebookPanel tab click"),this.focus(),e.detail===2&&this.removePreviewStatus()}handleTransformLinkUri(e){var{notebooksUrl:t}=this.props,{fileMetadata:r}=this.state;if(e.endsWith("/"))return e;if(e.startsWith("/"))return"".concat(t).concat(e.substring(1));var i=r?.itemName;if(i===void 0)return e;i.charAt(0)==="/"&&(i=i.substring(1));var o=new URL(i,t);return new URL(e,o).href}focus(){requestAnimationFrame(()=>{this.notebook&&this.notebook.focus()})}createNotebook(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"",{glEventHub:i}=this.props,{session:o,sessionLanguage:a,settings:s}=this.state,l=Ge(Ge({},s),{},{language:t,value:r}),d={id:null,itemName:e};de.debug("handleCreateNotebook",o,a,l,d),i.emit(Q.CREATE_NOTEBOOK,o,a,l,d)}runCommand(e){if(e===void 0||e===""){de.debug("Ignoring empty command.");return}this.removePreviewStatus();var{glEventHub:t}=this.props;t.emit(Me.SEND_COMMAND,e,!1,!0)}removePreviewStatus(){this.setState(e=>{var{isPreview:t}=e;if(t){var{fileMetadata:r}=this.state;return r&&this.registerFileMetadata(r,!1),{isPreview:!1}}return null})}getDropdownOverflowActions(){var e,t,{defaultNotebookSettings:r}=this.props,{settings:i}=this.state;return this.getOverflowActions((e=r.isMinimapEnabled)!==null&&e!==void 0?e:!1,this.getSettings(i,(t=r.isMinimapEnabled)!==null&&t!==void 0?t:!1).wordWrap==="on")}render(){var e,t,r,{fileStorage:i,glContainer:o,glContainer:{tab:a},glEventHub:s,defaultNotebookSettings:l}=this.props,{changeCount:d,savedChangeCount:h,error:c,isDashboardActive:v,isLoaded:p,isLoading:g,isPreview:f,fileMetadata:y,session:T,sessionLanguage:O,settings:P,showCloseModal:F,showDeleteModal:U,showSaveAsModal:te}=this.state,N=v&&!o.isHidden&&!f,B=(e=y?.itemName)!==null&&e!==void 0?e:Oe.DEFAULT_NAME,H=B.endsWith(".md"),J=y?.id!=null,oe=this.getSettings(P,(t=l.isMinimapEnabled)!==null&&t!==void 0?t:!1),L=T!=null,q=O===oe.language,K=!p||!L||!q,j=!p,V=[{action:this.handleSave,shortcut:Kt.SAVE},{action:this.handleMinimapChange,shortcut:Be.NOTEBOOK.MINIMAP},{action:this.handleWordWrapChange,shortcut:Be.NOTEBOOK.WORDWRAP}],z=ri.getDisabledRunTooltip(L,q,"Notebook extension","Run"),ve=ri.getDisabledRunTooltip(L,q,"Notebook extension","Run Selected"),Ve=[{title:J?"Rename":"Save As…",order:10,group:re.groups.high,action:this.handleShowRename},{title:"Copy File",action:this.handleCopy,group:re.groups.high,order:20}],ke=a?.element.find(".lm_title_before").get(0);return u.jsxs(u.Fragment,{children:[ke!=null&&Dr.createPortal(u.jsx("span",{className:X(Oe.UNSAVED_INDICATOR_CLASS_NAME,{[Oe.UNSAVED_STATUS_CLASS_NAME]:d!==h})}),ke),u.jsxs(kn,{className:"notebook-container",componentPanel:this,glContainer:o,glEventHub:s,onTab:this.handleTab,onResize:this.handleResize,onShow:this.handleShow,onTabClicked:this.handleTabClick,onTabFocus:this.handleTabFocus,onTabBlur:this.handleTabBlur,onSessionOpen:this.handleSessionOpened,onSessionClose:this.handleSessionClosed,additionalActions:Ve,renderTabTooltip:()=>B,children:[!H&&u.jsxs(u.Fragment,{children:[u.jsxs("div",{className:"notebook-toolbar",children:[u.jsxs("span",{children:[u.jsx(ee,{kind:"ghost",className:"btn-play",onClick:this.handleRunAll,disabled:K,icon:u.jsx(he,{icon:Va,transform:"grow-4"}),tooltip:"Run ".concat(Be.NOTEBOOK.RUN.getDisplayText()),"aria-label":"Run"}),z!=null&&u.jsx(ue,{children:z})]}),u.jsxs("span",{children:[u.jsx(ee,{kind:"ghost",className:"btn-play",onClick:this.handleRunSelected,disabled:K,icon:u.jsx(he,{icon:Sd,transform:"grow-4"}),tooltip:"Run Selected ".concat(Be.NOTEBOOK.RUN_SELECTED.getDisplayText()),"aria-label":"Run Selected"}),ve!=null&&u.jsx(ue,{children:ve})]}),u.jsx(ee,{kind:"ghost",className:"mr-auto",disabled:j,onClick:this.handleSave,icon:wd,tooltip:"Save ".concat(Kt.SAVE.getDisplayText()),"aria-label":"Save"}),u.jsx(ee,{kind:"ghost",className:"btn-overflow",disabled:j,icon:Ua,tooltip:"More Actions...",onClick:()=>{},children:u.jsx(Cn,{actions:this.getDropdownOverflowActions,popperOptions:Oe.POPPER_OPTIONS})})]}),u.jsx(xs,{isLoaded:p,isLoading:g,error:c,onChange:this.handleEditorChange,onRunCommand:this.handleRunCommand,session:T,sessionLanguage:O,onEditorInitialized:this.handleEditorInitialized,onEditorWillDestroy:this.handleEditorWillDestroy,settings:oe,focusOnMount:N,ref:b=>{this.notebook=b}})]}),H&&u.jsx(m.Suspense,{fallback:u.jsx(sn,{}),children:u.jsx(Ig,{content:(r=oe.value)!==null&&r!==void 0?r:"",onLinkClick:this.handleLinkClick,onRunCode:this.handleRunCommand,transformImageUri:this.handleTransformLinkUri,transformLinkUri:this.handleTransformLinkUri})}),u.jsx(Zt,{isOpen:te,type:"file",defaultValue:B,title:J?"Rename":"Save file as",onSubmit:this.handleSaveAsSubmit,onCancel:this.handleSaveAsCancel,notifyOnExtensionChange:!0,storage:i}),u.jsx(an,{isOpen:U,headerText:'Are you sure you want to delete "'.concat(B,'"?'),bodyText:"You cannot undo this action.",onCancel:this.handleDeleteCancel,onConfirm:this.handleDeleteConfirm,confirmButtonText:"Delete"}),u.jsx(an,{isOpen:F,headerText:"Do you want to save the changes you made to ".concat(B,"?"),bodyText:"Your changes will be lost if you don't save them.",onCancel:this.handleCloseCancel,onDiscard:this.handleCloseDiscard,onConfirm:this.handleCloseSave,discardButtonText:"Discard Changes",confirmButtonText:"Save"}),u.jsx(re,{actions:V})]})]})}}Ae(Oe,"COMPONENT","NotebookPanel");Ae(Oe,"POPPER_OPTIONS",{placement:"bottom-end"});Ae(Oe,"DEFAULT_NAME","Untitled");Ae(Oe,"UNSAVED_INDICATOR_CLASS_NAME","editor-unsaved-indicator");Ae(Oe,"UNSAVED_STATUS_CLASS_NAME","is-unsaved");Ae(Oe,"defaultProps",{isDashboardActive:!0,isPreview:!1,session:null,sessionLanguage:null,defaultNotebookSettings:{isMinimapEnabled:!0}});var Dg=(n,e)=>{var t=vs(n),r=Ph(n),i=nr(n,e.localDashboardId),{session:o,config:a}=i??{},{type:s}=a??{};return{fileStorage:t,defaultNotebookSettings:r,session:o,sessionLanguage:s}},tn=In(Dg,{updateSettings:Mh},null,{forwardRef:!0})(Oe);function Ea(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 Pa(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Ea(Object(t),!0).forEach(function(r){xg(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Ea(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function xg(n,e,t){return(e=Mg(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Mg(n){var e=kg(n,"string");return typeof e=="symbol"?e:e+""}function kg(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 Se=W.module("ConsolePlugin");function Ta(n){return n.notebook!==void 0}function Ng(n){Pp(n)}function py(n){Ng(n);var{id:e,hydrateConsole:t,layout:r,panelManager:i,registerComponent:o,notebooksUrl:a}=n,s=m.useRef(0),[l,d]=m.useState(new Map),[h,c]=m.useState(new Map),v=vi(),p=m.useCallback(()=>i.getLastUsedPanelOfType(Xr),[i]),g=m.useCallback((b,w)=>{d(_=>new Map(_.set(b,w)))},[d]),f=m.useCallback(b=>{d(w=>(w.delete(b),new Map(w)))},[d]),y=m.useCallback((b,w)=>{c(_=>new Map(_.set(b,w)))},[c]),T=m.useCallback(b=>{c(w=>(w.delete(b),new Map(w)))},[c]),O=m.useCallback(function(b){var w=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,_=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,G=b&&b.trim();if(!G)Se.info("Ignoring empty code");else{var ne=p();if(!ne||!(ne instanceof Xr.WrappedComponent)){Se.error("Console panel not found");return}Se.debug("Send command: ",b,w,_),ne.addCommand(b,w,_)}},[p]),P=m.useCallback(b=>{v(Df(e,b))},[v,e]),F=m.useCallback(b=>{var{language:w}=b,_=w==="python"?"py":w,G=null;return _==null?(Se.debug("No extension for language",w),G="Untitled-".concat(s.current)):G="Untitled-".concat(s.current,".").concat(_),s.current+=1,G},[]),U=m.useCallback(function(b){var w=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,{id:_}=b;if(_!=null&&l.has(_))return l.get(_);if(_!=null&&h.has(_))return h.get(_);if(w)return kt()},[l,h]),te=m.useCallback((b,w)=>{D.renameComponent(r.root,{id:b},w)},[r.root]),N=m.useCallback((b,w)=>{Se.debug("Rename file panel",b,w);var _;if(l.has(b)&&(_=l.get(b),f(b),_!=null&&g(w,_)),h.has(b)&&(_=h.get(b),T(b),_!=null&&y(w,_)),_===void 0){Se.debug2("File ".concat(b," isn't open, no need to rename the tab"));return}te(_,M.getBaseName(w))},[l,h,te,g,y,f,T]),B=m.useCallback(b=>{var w=U(b,!1);if(w==null){Se.error("Could not find panel id for file metadata",b);return}D.activateTab(r.root,{id:w})},[U,r.root]),H=m.useCallback((b,w,_)=>{if(Se.debug("registerFilePanel",b,w,_),w==null||w.id==null){Se.debug("Ignore empty file id",w);return}var{id:G}=w;if(_){y(G,b);return}if(l.has(G)){var ne=l.get(G);if(b===ne){Se.debug("Update tab title for file ".concat(G));var{itemName:it}=w;N(G,it)}else Se.error("File ".concat(G," already associated with a different tab ").concat(ne));return}g(G,b),h.has(G)&&T(G)},[l,h,N,g,y,T]),J=m.useCallback((b,w)=>{if(Se.debug("unregisterFileTab",b,w),b==null||b.id==null){Se.debug("Ignore empty file id",b);return}var{id:_}=b;if(w){T(_);return}f(_)},[f,T]),oe=m.useCallback((b,w)=>{Se.debug("closeFilePanel",b);var{id:_}=b,G=null,ne=!1;if(l.has(_))G=l.get(_);else if(h.has(_))G=h.get(_),ne=!0;else{Se.debug("File ".concat(_," isn't open, ignore close event"));return}J(b,ne),D.closeComponent(r.root,{id:G},w)},[r.root,l,h,J]),L=m.useCallback(b=>{var{itemName:w}=b;return M.getBaseName(w)},[]),q=m.useCallback(b=>{var{id:w}=b;return Se.debug("fileIsOpen",b,w,l),w!=null&&l.has(w)},[l]),K=m.useCallback(b=>{var{id:w}=b;return Se.debug("fileIsOpenAsPreview",b,w,h),w!=null&&h.has(w)},[h]),j=m.useCallback(b=>{if(b!=null){var w=i.getOpenedPanelById(b);w&&Ta(w)&&w.focus()}},[i]),V=m.useCallback(b=>{var{id:w,settings:_,fileMetadata:G,session:ne,sessionLanguage:it,isPreview:I=!1}=b,Z={settings:_,fileMetadata:G},ae=L(G);return{type:"react-component",component:tn.COMPONENT,isFocusOnShow:!1,props:{localDashboardId:e,metadata:{id:w},session:ne,sessionLanguage:it,panelState:Z,isPreview:I,notebooksUrl:a},title:ae,id:w}},[L,e,a]),z=m.useCallback(function(b,w,_){var G=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{id:null,itemName:F(_)},ne=U(G);if(q(G)&&ne!=null){Se.debug("File is already open, focus panel"),B(G),j(ne);return}var it=D.getStackForComponentTypes(r.root,[tn.COMPONENT]),I=V({id:ne,settings:_,fileMetadata:G,session:b,sessionLanguage:w});Se.debug("createNotebook",I,l),D.openComponentInStack(it,I)},[q,j,F,U,r.root,V,l,B]),ve=m.useCallback(function(b,w,_,G){var ne=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!1;Se.debug("selectNotebook",G,ne);var it=q(G),I=K(G),[Z]=[...h.values()],ae=!ne,ce=ae&&Z?Z:U(G);if(ce==null||ce==="")throw new Error("Unable to retrieve or create panelId for metadata",G);if(it||I)B(G);else{var Fe=D.getStackForComponentTypes(r.root,[tn.COMPONENT]),Pt=V({id:ce,settings:_,fileMetadata:G,session:b,sessionLanguage:w,isPreview:ae});D.openComponentInStack(Fe,Pt)}if(I&&ne){var Tt=G.id,Hr=D.getStackForConfig(r.root,{component:tn.COMPONENT,id:ce}),Nn=D.getContentItemInStack(Hr,{component:tn.COMPONENT,id:ce});Nn&&nt(Nn)&&(Nn.container.emit(Q.PROMOTE_FROM_PREVIEW),T(Tt),g(Tt,ce))}ne&&j(ce)},[B,q,K,j,U,r.root,V,h,T,g]),Ve=m.useCallback(function(b,w){var _=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},G=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,ne=i.getLastUsedPanelOfType(tn);ne&&Ta(ne)?_!=null&&_.value!=null&&ne.notebook!=null&&ne.notebook.append(_.value):G&&z(b,w,_)},[z,i]),ke=m.useCallback((b,w)=>Np.hydrate(Pa(Pa({},b),{},{notebooksUrl:a}),w),[a]);return Ln(o,Xr,t),Ln(o,Nf),Ln(o,Sg),Ln(o,Tg),Ln(o,tn,ke),je(r.eventHub,Me.SEND_COMMAND,O),je(r.eventHub,Me.SETTINGS_CHANGED,P),je(r.eventHub,Q.CLOSE_FILE,oe),je(r.eventHub,Q.CREATE_NOTEBOOK,z),je(r.eventHub,Q.SELECT_NOTEBOOK,ve),je(r.eventHub,Q.RENAME,te),je(r.eventHub,Q.RENAME_FILE,N),je(r.eventHub,Q.SEND_TO_NOTEBOOK,Ve),je(r.eventHub,Q.REGISTER_FILE,H),je(r.eventHub,Q.UNREGISTER_FILE,J),null}function Rr(n,e,t){return(e=jg(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function jg(n){var e=Ag(n,"string");return typeof e=="symbol"?e:e+""}function Ag(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 $r{}Rr($r,"DROPDOWN_FILTER","ControlType.DROPDOWN_FILTER");Rr($r,"INPUT_FILTER","ControlType.INPUT_FILTER");Rr($r,"MARKDOWN","ControlType.MARKDOWN");Rr($r,"FILTER_SET_MANAGER","ControlType.FILTER_SET_MANAGER");export{mb as $,cb as A,ee as B,Mr as C,fe as D,ns as E,js as F,Ye as G,Kt as H,dt as I,Gg as J,x as K,$r as L,qb as M,Cn as N,qn as O,Te as P,Lh as Q,kr as R,ds as S,E as T,ps as U,Jg as V,nr as W,ny as X,Th as Y,Le as Z,Wp as _,vt as a,jm as a$,xh as a0,Xt as a1,Wb as a2,dl as a3,Cb as a4,Kb as a5,Np as a6,Dd as a7,Ga as a8,Q as a9,au as aA,es as aB,Ja as aC,ru as aD,nu as aE,ct as aF,rt as aG,pi as aH,ss as aI,Ju as aJ,Nr as aK,A as aL,rs as aM,xr as aN,ts as aO,zg as aP,eh as aQ,ph as aR,hs as aS,us as aT,Zg as aU,Xg as aV,Yg as aW,Xa as aX,Om as aY,Im as aZ,we as a_,Et as aa,ie as ab,Gb as ac,tn as ad,fh as ae,$g as af,Yn as ag,py as ah,re as ai,an as aj,my as ak,Sb as al,pb as am,wb as an,bb as ao,yb as ap,ry as aq,iy as ar,vb as as,gb as at,fs as au,fb as av,Ce as aw,Vg as ax,tu as ay,Xn as az,Xe as b,$b as b$,Gm as b0,Rm as b1,xe as b2,Eb as b3,ks as b4,Ns as b5,_b as b6,Db as b7,Pb as b8,Tb as b9,Cr as bA,Is as bB,wn as bC,Ds as bD,vv as bE,ye as bF,Y as bG,Be as bH,xs as bI,ri as bJ,Bg as bK,D as bL,Ln as bM,je as bN,Bb as bO,Zr as bP,tf as bQ,ef as bR,Fp as bS,jp as bT,Ip as bU,ul as bV,Ti as bW,al as bX,Pp as bY,kp as bZ,rl as b_,Ob as ba,Wm as bb,xb as bc,Mb as bd,qm as be,Zm as bf,Nb as bg,kb as bh,As as bi,jb as bj,uv as bk,iv as bl,hv as bm,Gt as bn,gs as bo,He as bp,wr as bq,Ms as br,jr as bs,bs as bt,zh as bu,Ss as bv,ys as bw,En as bx,Cs as by,Pn as bz,C as c,Kg as c$,Hb as c0,ll as c1,il as c2,Ep as c3,_r as c4,$p as c5,Lb as c6,Rb as c7,Ub as c8,zb as c9,Nf as cA,Sg as cB,Za as cC,Hg as cD,kn as cE,Ya as cF,Av as cG,sy as cH,Qb as cI,Jb as cJ,fl as cK,Yb as cL,ey as cM,Dn as cN,Zb as cO,dy as cP,Xb as cQ,ft as cR,ly as cS,ay as cT,oy as cU,gl as cV,Me as cW,St as cX,ty as cY,Df as cZ,Wg as c_,Gp as ca,_i as cb,ir as cc,jf as cd,Wf as ce,cy as cf,Hf as cg,Rf as ch,Lf as ci,Af as cj,uy as ck,Ff as cl,hy as cm,$f as cn,bl as co,ra as cp,Ug as cq,Qr as cr,wp as cs,el as ct,Vb as cu,M as cv,Oi as cw,vy as cx,Xr as cy,Tg as cz,xn as d,Br as d0,Ib as d1,Vn as d2,Eh as e,db as f,eb as g,lb as h,sb as i,ab as j,ob as k,Qg as l,rb as m,nb as n,tb as o,Mh as p,be as q,me as r,ue as s,Ee as t,vh as u,ub as v,ib as w,qg as x,Fb as y,hb as z};
|
|
23
|
+
//# sourceMappingURL=ControlType-jO4itTaw.js.map
|