@deephaven/code-studio 0.87.1-beta.2 → 0.87.1-beta.3

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.
Files changed (42) hide show
  1. package/build/assets/{AppRoot-86742342.js → AppRoot-da3f0cd2.js} +3 -3
  2. package/build/assets/{AppRoot-86742342.js.map → AppRoot-da3f0cd2.js.map} +1 -1
  3. package/build/assets/{Chart-c6123f85.js → Chart-7f58199a.js} +2 -2
  4. package/build/assets/{Chart-c6123f85.js.map → Chart-7f58199a.js.map} +1 -1
  5. package/build/assets/{ControlType-4f27532d.js → ControlType-101b91d6.js} +4 -4
  6. package/build/assets/ControlType-101b91d6.js.map +1 -0
  7. package/build/assets/{FontBootstrap-2cf66175.js → FontBootstrap-3cef6864.js} +2 -2
  8. package/build/assets/{FontBootstrap-2cf66175.js.map → FontBootstrap-3cef6864.js.map} +1 -1
  9. package/build/assets/{FormatterUtils-7d1d725c.js → FormatterUtils-b25a5ce9.js} +2 -2
  10. package/build/assets/{FormatterUtils-7d1d725c.js.map → FormatterUtils-b25a5ce9.js.map} +1 -1
  11. package/build/assets/{Grid-12a11fb7.js → Grid-741a18ce.js} +2 -2
  12. package/build/assets/{Grid-12a11fb7.js.map → Grid-741a18ce.js.map} +1 -1
  13. package/build/assets/{IrisGrid-4d9589fa.js → IrisGrid-15062b6d.js} +2 -2
  14. package/build/assets/{IrisGrid-4d9589fa.js.map → IrisGrid-15062b6d.js.map} +1 -1
  15. package/build/assets/{IrisGridModel-604bd72b.js → IrisGridModel-8e01e9b5.js} +2 -2
  16. package/build/assets/{IrisGridModel-604bd72b.js.map → IrisGridModel-8e01e9b5.js.map} +1 -1
  17. package/build/assets/{IrisGridShortcuts-b79f65a8.js → IrisGridShortcuts-7ea5d586.js} +2 -2
  18. package/build/assets/{IrisGridShortcuts-b79f65a8.js.map → IrisGridShortcuts-7ea5d586.js.map} +1 -1
  19. package/build/assets/{IrisGridThemeProvider-8a3ff460.js → IrisGridThemeProvider-75f40052.js} +2 -2
  20. package/build/assets/{IrisGridThemeProvider-8a3ff460.js.map → IrisGridThemeProvider-75f40052.js.map} +1 -1
  21. package/build/assets/{LocalWorkspaceStorage-4def1710.js → LocalWorkspaceStorage-5f7bd793.js} +2 -2
  22. package/build/assets/{LocalWorkspaceStorage-4def1710.js.map → LocalWorkspaceStorage-5f7bd793.js.map} +1 -1
  23. package/build/assets/{MarkdownEditor-dc02f676.js → MarkdownEditor-83d7318f.js} +2 -2
  24. package/build/assets/{MarkdownEditor-dc02f676.js.map → MarkdownEditor-83d7318f.js.map} +1 -1
  25. package/build/assets/{MarkdownNotebook-9a104d0b.js → MarkdownNotebook-6fe964de.js} +2 -2
  26. package/build/assets/{MarkdownNotebook-9a104d0b.js.map → MarkdownNotebook-6fe964de.js.map} +1 -1
  27. package/build/assets/{MissingPartitionError-c12fe818.js → MissingPartitionError-07e8453b.js} +2 -2
  28. package/build/assets/{MissingPartitionError-c12fe818.js.map → MissingPartitionError-07e8453b.js.map} +1 -1
  29. package/build/assets/{StyleGuideRoot-463082bd.js → StyleGuideRoot-98282b1d.js} +2 -2
  30. package/build/assets/{StyleGuideRoot-463082bd.js.map → StyleGuideRoot-98282b1d.js.map} +1 -1
  31. package/build/assets/{TokenBoxCellRenderer-d5c53cf7.js → TokenBoxCellRenderer-6ac44f61.js} +2 -2
  32. package/build/assets/{TokenBoxCellRenderer-d5c53cf7.js.map → TokenBoxCellRenderer-6ac44f61.js.map} +1 -1
  33. package/build/assets/{index-6e674491.js → index-70ee43d5.js} +3 -3
  34. package/build/assets/{index-6e674491.js.map → index-70ee43d5.js.map} +1 -1
  35. package/build/assets/{index-4f71a71b.js → index-bdb64cb2.js} +4 -4
  36. package/build/assets/index-bdb64cb2.js.map +1 -0
  37. package/build/assets/{index-fd464c96.js → index-e196f176.js} +2 -2
  38. package/build/assets/{index-fd464c96.js.map → index-e196f176.js.map} +1 -1
  39. package/build/index.html +1 -1
  40. package/package.json +30 -30
  41. package/build/assets/ControlType-4f27532d.js.map +0 -1
  42. package/build/assets/index-4f71a71b.js.map +0 -1
@@ -1,5 +1,5 @@
1
- import{r as m,bk as Pi,V as H,bn as Kl,J as u,L as za,M as X,R as jr,a2 as S,bo as zl,N as ue,I as zt,bp as Gl,H as Ga,a0 as _n,a1 as pn,bq as ql,br as Zl,bs as Xl,bm as qn,bt as Yl,bu as Ql,ab as yt,bv as Wn,aq as Gi,bw as M,bx as qi,ac as qa,a5 as Ti,by as Jl,_ as In}from"./vendor-3cb40e4b.js";import{L as V,ax as Za,T as Xa,a3 as ed,a6 as td,P as nd,a2 as rd,a7 as id,_ as od,ac as ad,S as sd,M as Ya,b as Qa,c as Ja,al as ld,ay as dd,az as es,aA as ts,aB as ud,aC as hd,J as dn,ag as cd,aD as md,aE as fd,aF as vd,aG as gd,aH as pd,aI as bd,aJ as yd,aK as Cd,aL as Sd,aM as wd,B as ns,aw as Ed,at as rs,au as is,U as os,j as _d,e as R,d as Rn,aN as Pd,aa as as,aO as Zi,aP as Td,aQ as Od,aR as Id,aS as Dd,f as ss,am as ls,aT as ds,aU as Un,as as xd,aV as Md,F as Xi,aW as us,aX as Yi,aY as hs,aZ as Nd,I as Ad,a_ as Ld,a4 as Fd,a$ as kd,A as Rd,a5 as jd,b0 as $d,b1 as Hd,b2 as Bd,b3 as Wd,b4 as Ud,b5 as Vd,b6 as Kd,ao as zd,b7 as Gd,b8 as qd}from"./index-4f71a71b.js";import{e as lt,l as pt,K as ze,a as Gt,b as Qi,R as Zd,_ as cs}from"./monaco-b5248072.js";var Xd=Object.freeze([]),Ay=new Map,Ly=()=>{};function Fy(r){return Array.isArray(r)?r:[r]}function Jr(){for(var r=arguments.length,e=new Array(r),t=0;t<r;t++)e[t]=arguments[t];return e.filter(n=>n!=null)}function Yd(r,e,t){return e=Qd(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Qd(r){var e=Jd(r,"string");return typeof e=="symbol"?e:String(e)}function Jd(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class eu extends Error{constructor(){super(...arguments),Yd(this,"isCanceled",!0)}}const ui=eu;function tu(r){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,t=nu(r,e);t.forEach(n=>{r[n]=r[n].bind(r)})}function nu(r,e){for(var t=new Set,n=r,i=0;n!=null&&n!==Object.prototype&&(i<=1||e);){for(var o of Object.getOwnPropertyNames(n)){var a;o!=="constructor"&&typeof((a=Object.getOwnPropertyDescriptor(n,o))===null||a===void 0?void 0:a.value)=="function"&&t.add(o)}n=Object.getPrototypeOf(n),i+=1}return[...t.keys()]}function Ji(r,e,t,n,i,o,a){try{var s=r[o](a),l=s.value}catch(d){t(d);return}s.done?e(l):Promise.resolve(l).then(n,i)}function ru(r){return function(){var e=this,t=arguments;return new Promise(function(n,i){var o=r.apply(e,t);function a(l){Ji(o,n,i,a,s,"next",l)}function s(l){Ji(o,n,i,a,s,"throw",l)}a(void 0)})}}function ms(r){return hi.apply(this,arguments)}function hi(){return hi=ru(function*(r){var{clipboard:e}=navigator;if(e!==void 0)try{return yield navigator.clipboard.writeText(r)}catch{}iu(r)}),hi.apply(this,arguments)}function iu(r){var e=document.activeElement,t=document.createElement("textarea");t.value=r,document.body.appendChild(t),t.focus(),t.select();var n=document.execCommand("copy");if(document.body.removeChild(t),e instanceof HTMLElement&&e.focus(),!n)throw new Error("Unable to execute copy command")}function Dn(r,e,t){return e=ou(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function ou(r){var e=au(r,"string");return typeof e=="symbol"?e:String(e)}function au(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}var su="table_",fs="column_",lu=new Set(["in","not","i","ii","k"]),du=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"]),uu=/[^a-zA-Z0-9_$+@-]/g,hu=/[^A-Za-z0-9_$]/g;class ot{}Dn(ot,"legalize",(r,e,t,n,i)=>{var o=r.trim().replace(/[- ]/g,"_");return n&&(lu.has(o)||du.has(o))&&(o=e+o),o=o.replace(t,""),o||(o=e+i),Number.isNaN(Number(o.charAt(0)))||(o=e+o),o});Dn(ot,"legalizeTableName",r=>ot.legalize(r,su,uu,!1,0));Dn(ot,"legalizeColumnNames",r=>{var e=[];return r.forEach((t,n)=>{var i=ot.legalizeColumnName(t,n);e.includes(i)&&(i=fs+n),e.push(i)}),e});Dn(ot,"legalizeColumnName",function(r){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return ot.legalize(r,fs,hu,!0,e)});Dn(ot,"isValidTableName",r=>ot.legalizeTableName(r)===r);Dn(ot,"isValidColumnName",r=>ot.legalizeColumnName(r)===r);const vs=ot;class gs extends CustomEvent{constructor(e,t){super(e,t)}}function cu(r,e,t){return e=mu(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function mu(r){var e=fu(r,"string");return typeof e=="symbol"?e:String(e)}function fu(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class vu extends Error{constructor(){super(...arguments),cu(this,"isTimeout",!0)}}const ps=vu;class Ee{static makeCancelable(e,t){var n=!1,i,o,a=new Promise((s,l)=>{o=l,Promise.resolve(e).then(d=>{n?t&&t(d):(i=d,s(d))}).catch(d=>l(d))});return a.cancel=()=>{n=!0,o(new ui),i!=null&&t&&t(i)},a}static isCanceled(e){return e instanceof ui}static isTimedOut(e){return e instanceof ps}static withTimeout(e,t){return new Promise((n,i)=>{setTimeout(()=>{try{n(t())}catch(o){i(o)}},e)})}}function eo(r,e,t){return e=gu(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function gu(r){var e=pu(r,"string");return typeof e=="symbol"?e:String(e)}function pu(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class bu{constructor(){eo(this,"pending",[]),eo(this,"resolved",[])}add(e,t){var n=Ee.makeCancelable(e,t);return this.pending.push(n),n.then(()=>{this.resolve(n)},()=>{this.resolve(n)}),n}remove(e){for(var t=0;t<this.pending.length;t+=1)if(this.pending[t]===e){this.pending.splice(t,1);return}}resolve(e){this.remove(e),this.resolved.push(e)}cancel(){for(var e=[...this.pending,...this.resolved],t=0;t<e.length;t+=1)e[t].cancel();this.pending=[],this.resolved=[]}}const xn=bu;class Oi{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(!Oi.isValidRange(e))throw new Error("Invalid range! ".concat(e))}static isSelected(e,t){for(var n=0;n<e.length;n+=1){var i=e[n],o=i[0],a=i[1];if(o<=t&&t<=a)return!0}return!1}static selectRange(e,t){for(var[n,i]=t,o=[...e],a=o.length-1;a>=0;a-=1){var s=o[a],l=s[0],d=s[1];if(l<=n&&i<=d)return o;n<=d&&l<=i&&(n=Math.min(n,l),i=Math.max(i,d),o.splice(a,1))}return o.push([n,i]),o}static deselectRange(e,t){for(var[n,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<n))if(l<n&&i<d){o[a]=[l,n-1],o.splice(a+1,0,[i+1,d]);break}else n<=l&&d<=i?o.splice(a,1):l<n?o[a]=[l,n-1]:o[a]=[i+1,d]}return o}static count(e){return e.reduce((t,n)=>t+(n[1]-n[0]+1),0)}static getItemsInRanges(e,t){return t.reduce((n,i)=>{for(var o=[...n],a=i[0];a<=i[1];a+=1)o.push(e[a]);return o},[])}}const It=Oi;function*ky(r,e){for(var t=r;t<=e;++t)yield t}var Ry=" ";class bs{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 n=e.slice(0,e.length-1).join(", "),i=e[e.length-1];return"".concat(n,", ").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 n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;return e<t?n?-1:1:e>t?n?1:-1:0}}function ys(r,e,t){return e=yu(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function yu(r){var e=Cu(r,"string");return typeof e=="symbol"?e:String(e)}function Cu(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class er{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),n=Math.floor(e%3600/60),i=e%60;return"".concat(t>0?"".concat(t,"h "):"")+"".concat(n>0||t>0?"".concat(n,"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"),n=e%(60*60),i=String(Math.floor(n/60)).padStart(2,"0"),o=n%60,a=String(Math.ceil(o)).padStart(2,"0");return"".concat(t,":").concat(i,":").concat(a)}static isTimeString(e){return new RegExp(er.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])}}ys(er,"TIME_PATTERN","([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]");ys(er,"TIME_ZONES",Object.freeze([{label:"Tokyo UTC+9 No DST",value:"Asia/Tokyo"},{label:"Seoul UTC+9 No DST",value:"Asia/Seoul"},{label:"Hong Kong UTC+8 No DST",value:"Asia/Hong_Kong"},{label:"Singapore UTC+8 No DST",value:"Asia/Singapore"},{label:"Kolkata UTC+5:30 No DST",value:"Asia/Kolkata"},{label:"Berlin UTC+1",value:"Europe/Berlin"},{label:"UTC UTC±0 No DST",value:"UTC"},{label:"London UTC±0",value:"Europe/London"},{label:"Sao Paulo UTC-2",value:"America/Sao_Paulo"},{label:"Newfoundland UTC-3:30",value:"America/St_Johns"},{label:"Halifax UTC-4",value:"America/Halifax"},{label:"New York UTC−5",value:"America/New_York"},{label:"Chicago UTC-6",value:"America/Chicago"},{label:"Denver UTC-7",value:"America/Denver"},{label:"Los Angeles UTC-8",value:"America/Los_Angeles"},{label:"Anchorage UTC-9",value:"America/Anchorage"},{label:"Honolulu UTC-10 No DST",value:"Pacific/Honolulu"},{label:"Zurich UTC+1",value:"Europe/Zurich"},{label:"Amsterdam UTC+1",value:"Europe/Amsterdam"},{label:"Taipei UTC+8 No DST",value:"Asia/Taipei"},{label:"Sydney UTC+10",value:"Australia/Sydney"}]));const Cs=er;function Su(r,e,t){return e=wu(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function wu(r){var e=Eu(r,"string");return typeof e=="symbol"?e:String(e)}function Eu(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class _u extends Error{constructor(){super(...arguments),Su(this,"isInvalid",!0)}}const Vn=_u;function Ss(){var r=m.useRef(!1);return m.useEffect(()=>(r.current=!0,()=>{r.current=!1}),[]),r}function to(r,e,t,n,i,o,a){try{var s=r[o](a),l=s.value}catch(d){t(d);return}s.done?e(l):Promise.resolve(l).then(n,i)}function Pu(r){return function(){var e=this,t=arguments;return new Promise(function(n,i){var o=r.apply(e,t);function a(l){to(o,n,i,a,s,"next",l)}function s(l){to(o,n,i,a,s,"throw",l)}a(void 0)})}}var Tu=V.module("useAsyncInterval");function Ou(r,e){var t=Ss(),n=m.useRef(0),i=m.useRef(0),o=m.useRef(null),a=m.useCallback(Pu(function*(){var s=Date.now();i.current+=1;var l=o.current==null?e:s-o.current;o.current=s;try{yield r()}catch(c){Tu.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);n.current=window.setTimeout(a,h)}}),[r,t,e]);m.useEffect(()=>(o.current=null,a(),()=>{window.clearTimeout(n.current)}),[e,a])}function tr(r){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(r);if(t==null)throw new Error(e);return t}function Iu(r,e,t){var n=m.useRef(t),i=m.useRef(r);i.current=r;var o=m.useMemo(()=>Pi(function(){return i.current(...arguments)},e,n.current),[e]);return m.useEffect(()=>()=>{var a,s;(a=(s=n.current)===null||s===void 0?void 0:s.flushOnUnmount)!==null&&a!==void 0&&a?o.flush():o.cancel()},[o]),o}function Du(r){var e=m.useRef();return m.useEffect(function(){e.current=r}),e.current}function ws(r){var e=m.useRef(null);return m.useEffect(function(){r&&(typeof r=="function"?r(e.current):r.current=e.current)}),e}var xu=3500,Mu=V.module("useCopyToClipboard");function Nu(){var[r,e]=m.useState(!1),t=m.useRef(null),n=m.useCallback(i=>{ms(i).then(()=>{e(!0)}).catch(o=>Mu.error("Unable to copy ".concat(i),`
2
- `,o))},[]);return m.useEffect(()=>(t.current&&clearTimeout(t.current),r&&(t.current=setTimeout(()=>{e(!1)},xu)),()=>{t.current&&clearTimeout(t.current)}),[r]),[r,n]}function no(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,n)}return t}function Au(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?no(Object(t),!0).forEach(function(n){wn(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):no(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function wn(r,e,t){return e=Lu(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Lu(r){var e=Fu(r,"string");return typeof e=="symbol"?e:String(e)}function Fu(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}var ro="popper";class Ii extends m.Component{constructor(e){super(e),wn(this,"element",void 0),wn(this,"container",void 0),wn(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=H.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:n}=this.props;if(!e&&this.container.current!==null){var{options:i}=this.props;i=Au({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 Kl(n||o,this.element,i),e.scheduleUpdate(),cancelAnimationFrame(this.rAF),this.rAF=window.requestAnimationFrame(()=>{if(t){var a=this.element.querySelector(".".concat(ro));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:n,interactive:i,closeOnBlur:o}=this.props,{show:a}=this.state;return u.jsx(Za,{isPortal:!0,children:u.jsx(za,{in:a,timeout:n,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(ro,{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&&jr.createPortal(this.renderContent(),this.element)})}}wn(Ii,"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});wn(Ii,"defaultProps",{options:{},className:"",timeout:Xa.transitionMs,onEntered(){},onExited(){},isShown:!1,interactive:!1,closeOnBlur:!1,referenceObject:null,"data-testid":void 0});const Di=Ii;function io(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,n)}return t}function ku(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?io(Object(t),!0).forEach(function(n){ut(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):io(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function ut(r,e,t){return e=Ru(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Ru(r){var e=ju(r,"string");return typeof e=="symbol"?e:String(e)}function ju(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}var $u=V.module("Tooltip");class ye extends m.Component{static handleHidden(){ye.shownTooltipCount-=1,ye.shownTooltipCount===0&&(ye.lastHiddenTime=Date.now())}static handleShown(){ye.shownTooltipCount+=1}constructor(e){super(e),ut(this,"container",void 0),ut(this,"popper",void 0),ut(this,"parent",void 0),ut(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=H.createRef(),this.popper=H.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:n}=t,{isShown:i}=this.state;i!==n&&(i?ye.handleShown():ye.handleHidden())}componentWillUnmount(){this.stopListening(),this.stopListeningWindow(),this.stopTimer();var{isShown:e}=this.state;e&&ye.handleHidden()}startListening(){if(!this.container.current||!this.container.current.parentElement){$u.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,n=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&&n>=o.top&&n<=o.top+o.height?this.handleMouseMove():t>=a.left&&t<=a.left+a.width&&n>=a.top&&n<=a.top+a.height?this.handleMouseMove():i&&(this.stopTimer(),this.hide())}}startTimer(){this.stopTimer();var{timeout:e,reshowTimeout:t}=this.props,n=e;(ye.shownTooltipCount>0||Date.now()-ye.lastHiddenTime<ye.triggerReshowThreshold)&&(n=t),this.timer=window.setTimeout(this.handleTimeout,n)}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:n}=this.props;n&&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:n,popperClassName:i,"data-testid":o,onEntered:a}=this.props,{isShown:s}=this.state,{options:l}=this.props;return l=ku({placement:"bottom"},l),u.jsx("div",{ref:this.container,style:{display:"none"},"data-testid":o,children:u.jsx(Di,{className:X(i,"popper-tooltip"),options:l,ref:this.popper,onEntered:a,onExited:this.handleExited,interactive:e,referenceObject:n,children:u.jsxs("div",{className:"tooltip-content",children:[" ",s&&t]})})})}}ut(ye,"defaultTimeout",500);ut(ye,"defaultReshowTimeout",100);ut(ye,"triggerReshowThreshold",300);ut(ye,"shownTooltipCount",0);ut(ye,"lastHiddenTime",Date.now());ut(ye,"defaultProps",{interactive:!1,options:{},popperClassName:"",reshowTimeout:ye.defaultReshowTimeout,timeout:ye.defaultTimeout,onEntered:()=>{},onExited:()=>{},"data-testid":void 0});const qt=ye;var Hu=V.module("ThemeProvider"),Es=m.createContext(null);function jy(r){var{themes:e,defaultPreloadValues:t=sd,children:n}=r,i=m.useMemo(()=>ed(),[]),[o,a]=m.useState(null),[s,l]=m.useState(()=>{var c,f;return(c=(f=td())===null||f===void 0?void 0:f.themeKey)!==null&&c!==void 0?c:nd}),d=m.useMemo(()=>e==null?null:rd(s,{base:i,custom:e??[]}),[i,s,e]),h=m.useMemo(()=>[...i,...e??[]],[i,e]);return m.useEffect(function(){if(!(d==null||e==null)){id(t);var f=od(t);Hu.debug2("updateThemePreloadData:",{active:d.map(v=>v.themeKey),custom:e.map(v=>v.themeKey),preloadStyleContent:f,selectedThemeKey:s}),ad({themeKey:s,preloadStyleContent:f})}},[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(Es.Provider,{value:o,children:u.jsx(Za,{children:n})})]})}function _s(){return tr(Es,"No ThemeContext value found. Component must be wrapped in a ThemeContext.Provider")}function $r(r){var{children:e,className:t,style:n,"data-testid":i}=r;return u.jsx("div",{className:X("btn-group",t),style:n,role:"group","data-testid":i,children:e})}$r.displayName="SplitButtonGroup";$r.propTypes={children:S.node.isRequired,className:S.string,style:S.object,"data-testid":S.string};$r.defaultProps={className:null,style:{},"data-testid":void 0};var Bu=["kind","variant","type","tooltip","icon","disabled","active","onClick","onContextMenu","onMouseDown","onMouseUp","onMouseEnter","onMouseLeave","onKeyDown","className","style","children","tabIndex","data-testid","aria-label"];function oo(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,n)}return t}function ao(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?oo(Object(t),!0).forEach(function(n){Wu(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):oo(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function Wu(r,e,t){return e=Uu(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Uu(r){var e=Vu(r,"string");return typeof e=="symbol"?e:String(e)}function Vu(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}function Ku(r,e){if(r==null)return{};var t=zu(r,e),n,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(r);for(i=0;i<o.length;i++)n=o[i],!(e.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(r,n)&&(t[n]=r[n])}return t}function zu(r,e){if(r==null)return{};var t={},n=Object.keys(r),i,o;for(o=0;o<n.length;o++)i=n[o],!(e.indexOf(i)>=0)&&(t[i]=r[i]);return t}var Gu=["primary","secondary","tertiary","success","danger","inline","ghost"],qu=["group-end"];function Zu(r,e){switch(r){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 Xu(r){switch(r){case"group-end":return X("pl-2","pr-3")}}var se=H.forwardRef((r,e)=>{var{kind:t,variant:n,type:i,tooltip:o,icon:a,disabled:s=!1,active:l,onClick:d,onContextMenu:h,onMouseDown:c,onMouseUp:f,onMouseEnter:v,onMouseLeave:p,onKeyDown:g,className:y,style:P,children:O,tabIndex:_,"data-testid":k,"aria-label":W}=r,Q=Ku(r,Bu),{UNSAFE_className:N}=zl({},"button"),B;n&&(B=Xu(n));var j;a&&(j=H.isValidElement(a)?a:u.jsx(ue,{icon:a}));var Y=j!=null&&O==null,ne=Zu(t,Y),F;o!==void 0&&(F=typeof o=="string"?u.jsx(qt,{children:o}):o);var q=W;W===void 0&&Y&&o!=null&&typeof o=="string"&&(q=o);var K=u.jsxs("button",ao(ao({"data-testid":k,ref:e,type:i,className:X("btn",ne,B,{active:l},y,N),onClick:d,onContextMenu:h,onMouseUp:f,onMouseDown:c,onMouseEnter:v,onMouseLeave:p,onKeyDown:g,style:P,disabled:s,tabIndex:_,"aria-label":q},Q),{},{children:[a&&j,O,o!=null&&!s&&F]}));return s&&o!=null?u.jsxs("span",{className:"btn-disabled-wrapper",children:[K,F]}):K});se.displayName="Button";se.propTypes={kind:S.oneOf(Gu).isRequired,variant:S.oneOf(qu),type:S.oneOf(["submit","reset","button"]),tooltip(r){var{tooltip:e,icon:t,children:n}=r;return e===void 0&&t!=null&&n==null?new Error("Tooltip is required for icon only buttons"):null},icon(r){var{children:e,icon:t}=r;return t==null&&e==null?new Error("Icon is required if no children are provided"):e==null&&!H.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(r){var{onClick:e,type:t}=r;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};se.defaultProps={type:"button",onClick:void 0,onContextMenu:void 0,onMouseUp:void 0,onMouseDown:void 0,onMouseEnter:void 0,onMouseLeave:void 0,onKeyDown:void 0,variant:void 0,tooltip:void 0,icon:void 0,disabled:!1,active:void 0,tabIndex:void 0,children:void 0,className:void 0,style:{},"data-testid":void 0};const En=se;function Ps(r){var{className:e="modal-footer",children:t,"data-testid":n}=r;return u.jsx("div",{className:e,"data-testid":n,children:t})}function ln(r){var{isOpen:e,headerText:t,bodyText:n,onCancel:i,onConfirm:o,onDiscard:a,onModalDisable:s,cancelButtonText:l="Cancel",confirmButtonText:d="Okay",discardButtonText:h="Discard",isConfirmDanger:c=!1,children:f,"data-testid":v}=r,p=m.useRef(null),g=m.useRef(null),y=m.useCallback(()=>{g.current!==null&&g.current.checked&&s&&s(),o()},[o,s]),P=m.useCallback(()=>{var _;(_=p.current)===null||_===void 0||_.focus()},[]),O="";return e&&(O=typeof n=="function"?n():n),u.jsxs(Ya,{isOpen:e,onOpened:P,children:[u.jsx(Qa,{closeButton:!1,children:t}),u.jsx(Ja,{children:O}),u.jsxs(Ps,{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:g,"data-testid":v!==void 0?"".concat(v,"-checkbox-confirm"):void 0}),u.jsx("label",{className:"custom-control-label",htmlFor:"move-confirmation-checkbox",children:"Don't ask me again"})]}),a&&u.jsx(En,{kind:"secondary",className:"mr-auto","data-dismiss":"modal",onClick:a,"data-testid":v!==void 0?"".concat(v,"-btn-discard"):void 0,children:h}),i&&u.jsx(En,{kind:"secondary","data-dismiss":"modal",onClick:i,"data-testid":v!==void 0?"".concat(v,"-btn-cancel"):void 0,children:l}),u.jsxs($r,{children:[u.jsx(En,{kind:c?"danger":"primary",onClick:y,ref:p,"data-testid":v!==void 0?"".concat(v,"-btn-confirm"):void 0,children:d}),f]})]})]})}ln.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};ln.defaultProps={children:void 0,cancelButtonText:"Cancel",confirmButtonText:"Okay",discardButtonText:"Discard",onCancel:void 0,onDiscard:void 0,onModalDisable:void 0,"data-testid":void 0};function Yu(r,e,t){return e=Qu(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Qu(r){var e=Ju(r,"string");return typeof e=="symbol"?e:String(e)}function Ju(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}function ei(r){return r.then!==void 0}class Wt{static disableAllActions(){Wt.actionsDisabled=!0}static enableAllActions(){Wt.actionsDisabled=!1}static isContextActionEvent(e){return Array.isArray(e.contextActions)}static compareActions(e,t){if(e.group!==t.group){var n,i;return((n=e.group)!==null&&n!==void 0?n: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(Wt.compareActions),t}static isMacPlatform(){var{platform:e}=window.navigator;return e.startsWith("Mac")}static getModifierKey(){return Wt.isMacPlatform()?"metaKey":"ctrlKey"}static isModifierKeyDown(e){var t=Wt.getModifierKey();return e[t]}static getMenuItems(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,n=[],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&&n.push(s):Array.isArray(s)?n=n.concat(s):n.push(s))}return n=n.filter(l=>l.title!==void 0||l.then!=null||l.menuElement),n}static getNextMenuItem(e,t,n){var i=e;i<0&&t<0&&(i=n.length);for(var o=1;o<n.length+1;o+=1){var a=(i+t*o+n.length)%n.length,s=n[a];if(!(s instanceof Promise)&&s.disabled!==!0)return a}return e}}Yu(Wt,"actionsDisabled",!1);const Xe=Wt;var so=V.module("GlobalContextAction");class eh 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:n}=this.props;n.title==null&&!n.menuElement||(t.contextActions==null&&(t.contextActions=[]),t.contextActions.push(n),so.debug("Received context menu event at global action! Menu items are now: ",t.contextActions))}handleKeyDown(e){var{action:t}=this.props;if(!Xe.actionsDisabled&&t.shortcut!==void 0&&t.shortcut.matchesEvent(e)){var n;so.debug("Global hotkey matched!",e),(n=t.action)===null||n===void 0||n.call(t,e),e.preventDefault(),e.stopPropagation()}}render(){return null}}const th=eh;class nh extends m.Component{render(){for(var{actions:e,"data-testid":t}=this.props,n=[],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(th,{action:o,"data-testid":t},"".concat(o.title,".").concat(a?.id));n.push(s)}}return n}}const rh=nh;function Ts(r,e,t){return e=ih(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function ih(r){var e=oh(r,"string");return typeof e=="symbol"?e:String(e)}function oh(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}var mr=V.module("ContextActions");class Os extends m.Component{static triggerMenu(e,t,n,i){if(i.length!==0){var o=new MouseEvent("contextmenu",{clientX:t,clientY:n,bubbles:!0,cancelable:!0});o.contextActions=i,e.dispatchEvent(o)}}constructor(e){super(e),Ts(this,"container",void 0),this.handleContextMenu=this.handleContextMenu.bind(this),this.handleKeyDown=this.handleKeyDown.bind(this),this.container=H.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=>!ei(i)&&typeof i!="function"&&i.isGlobal),n=e.actions.filter(i=>!ei(i)&&typeof i!="function"&&(i.isGlobal===void 0||!i.isGlobal)&&i.shortcut!=null);return{globalActions:t,keyboardActions:n}}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 n=e.target,i=function(){var{classList:d}=n,h=t.find(c=>d.contains(c));if(h!==void 0)return mr.debug2('Contextmenu event ignored based on the target className "'.concat(h,'"')),{v:void 0};n=n.parentElement};n!=null;){var o=i();if(typeof o=="object")return o.v}if(Xe.isContextActionEvent(e)||(e.contextActions=[]),!!Xe.isContextActionEvent(e)){var{actions:a}=this.props;if(a!=null){var s=a;Array.isArray(s)&&(s=s.filter(l=>ei(l)||typeof l=="function"||l.isGlobal===void 0||!l.isGlobal)),e.contextActions=e.contextActions.concat(s)}mr.debug("Received context menu event! Menu items are now: ",e.contextActions)}}handleKeyDown(e){for(var{keyboardActions:t}=this.state,n=0;n<t.length;n+=1){var i=t[n];if(!Xe.actionsDisabled&&i.shortcut!=null&&i.shortcut.matchesEvent(e)){var o;mr.debug("Context hotkey matched!",e),(o=i.action)===null||o===void 0||o.call(i,e),e.stopPropagation(),e.preventDefault(),mr.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(rh,{actions:t})})}}Ts(Os,"groups",{default:void 0,high:100,medium:5e3,low:1e4,global:1e5,edit:100});const ee=Os;var xi=H.forwardRef((r,e)=>{var t,n;function i(N){var{menuItem:B,onMenuItemClick:j}=r;j(B,N)}function o(N){var{menuItem:B,onMenuItemMouseMove:j}=r;j(B,N)}function a(N){var{menuItem:B,onMenuItemContextMenu:j}=r;j(B,N)}function s(N,B,j){if(typeof N.type=="string")return N;var{closeMenu:Y,menuItem:ne,isKeyboardSelected:F,isMouseSelected:q,"data-testid":K}=r,A={menuItem:ne,closeMenu:Y,isKeyboardSelected:F,isMouseSelected:q,iconElement:B,displayShortcut:j,"data-testid":K};return H.cloneElement(N,{forwardedProps:A})}var{children:l,menuItem:d,isKeyboardSelected:h=!1,isMouseSelected:c=!1,"data-testid":f}=r,v=(t=d.shortcutText)!==null&&t!==void 0?t:(n=d.shortcut)===null||n===void 0?void 0:n.getDisplayText(),p=null;if(d.icon){var g=d.icon;if(H.isValidElement(g))p=g;else{var y;d.iconColor!=null&&(d.disabled===void 0||!d.disabled)&&(y={color:d.iconColor}),p=u.jsx(ue,{icon:g,style:y})}}var P=null,O=!!l;d.actions&&(P=u.jsx(ue,{icon:ld}));var _=null;if(d.menuElement)_=u.jsx("div",{className:"custom-menu-item",onMouseMove:o,children:s(d.menuElement,p,v)});else{var k,W=d.disabled,Q=d.iconOutline;_=u.jsx("button",{type:"button",className:X("btn-context-menu",{disabled:W},{active:(O||c)&&(W===void 0||!W)},{"keyboard-active":h&&(W===void 0||!W)}),onClick:i,onMouseMove:o,onContextMenu:a,title:(k=d.description)!==null&&k!==void 0?k:"",children:u.jsxs("div",{className:"btn-context-menu-wrapper",children:[u.jsx("span",{className:X("icon",{outline:Q}),children:p}),u.jsx("span",{className:"title",children:d.title}),v!==void 0&&u.jsx("span",{className:"shortcut",children:v}),P&&u.jsx("span",{className:X("submenu-indicator",{disabled:W}),children:P})]})})}return u.jsxs("div",{className:"context-menu-item",ref:e,"data-testid":f,children:[l,_]})});xi.displayName="ContextMenuItem";xi.defaultProps={children:null,isKeyboardSelected:!1,isMouseSelected:!1,"data-testid":void 0};const ah=xi;var Hr=H.forwardRef((r,e)=>{var{checked:t=!1,children:n,className:i,disabled:o,inputClassName:a,isInvalid:s,labelClassName:l,name:d,onChange:h,"data-testid":c}=r,[f]=m.useState(zt()),v=ws(e);m.useEffect(function(){v.current&&(v.current.indeterminate=t===null)},[v,t]);var p=m.useCallback(g=>{v.current&&(v.current.indeterminate=t===null),h&&h(g)},[v,t,h]);return u.jsxs("div",{className:X("custom-control custom-checkbox",i),children:[u.jsx("input",{type:"checkbox",ref:v,checked:t??!1,className:X("custom-control-input",a,{"is-invalid":s}),disabled:o,id:f,name:d,onChange:p,"data-testid":c}),u.jsx("label",{className:X("custom-control-label",l),htmlFor:f,children:n})]})});Hr.displayName="Checkbox";Hr.propTypes={checked:(r,e)=>{var{[e]:t}=r;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};Hr.defaultProps={checked:!1,className:"",disabled:!1,inputClassName:"",isInvalid:!1,labelClassName:"",name:void 0,onChange:void 0,"data-testid":void 0};const sh=Hr;function Ir(r){return r?.WrappedComponent!==void 0}function Is(r){return Ir(r)&&Is(r.WrappedComponent)?!0:r.prototype!=null&&r.prototype.isReactComponent!=null}function lh(r){return!Ir(r)&&"$$typeof"in r&&r.$$typeof===Gl.ForwardRef}function dh(r){return Is(r)||lh(r)}function $y(r){var{copy:e,kind:t="ghost",tooltip:n="Copy",className:i,style:o,"data-testid":a,children:s}=r,[l,d]=Nu();return u.jsx(En,{kind:t,className:i,style:o,"data-testid":a,icon:l?dd:es,tooltip:l?"Copied":n,onClick:()=>{d(typeof e=="function"?e():e)},children:s})}function lo(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,n)}return t}function uh(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?lo(Object(t),!0).forEach(function(n){Kn(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):lo(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function Kn(r,e,t){return e=hh(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function hh(r){var e=ch(r,"string");return typeof e=="symbol"?e:String(e)}function ch(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class Ds 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=H.createRef(),this.oldFocus=document.activeElement,this.rAF=0;var{options:n}=e,i=(t=n.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=Xe.getMenuItems(e,!1);t.length>0&&this.setState(n=>({menuItems:Xe.sortActions(n.menuItems.concat(t))}))}handleKeyDown(e){var{menuItems:t}=this.state,n=this.getKeyboardIndex(),i=n;if(e.key==="Enter"||e.key===" "){n!=null&&n>=0&&n<t.length&&this.handleMenuItemClick(t[n],e);return}if(e.key==="Escape")i=null;else if(e.key==="ArrowUp"||e.key==="Tab"&&e.shiftKey===!0){var o;i=Xe.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=Xe.getNextMenuItem((a=i)!==null&&a!==void 0?a:0,1,t)}n!==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:n}=this.props;cancelAnimationFrame(this.rAF),this.rAF=window.requestAnimationFrame(()=>{t(e),n(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,n=t.indexOf(e);this.setMouseIndex(n)}handleMouseLeave(){this.setMouseIndex(-1)}render(){for(var e=[],{"data-testid":t}=this.props,{keyboardIndex:n,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(ah,{isKeyboardSelected:n===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:uh({},d),ref:this.container,onKeyDown:this.handleKeyDown,onMouseLeave:this.handleMouseLeave,role:"menuitem",tabIndex:0,"data-testid":t,children:e})}}Kn(Ds,"defaultProps",{closeMenu(){},onMenuOpened(){},onMenuClosed(){},options:{},menuStyle:{},"data-testid":void 0});const mh=Ds;function uo(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,n)}return t}function ho(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?uo(Object(t),!0).forEach(function(n){yn(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):uo(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function yn(r,e,t){return e=fh(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function fh(r){var e=vh(r,"string");return typeof e=="symbol"?e:String(e)}function vh(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class xs extends m.PureComponent{constructor(e){super(e),yn(this,"container",void 0),yn(this,"parent",void 0),yn(this,"popper",void 0),yn(this,"isOpen",void 0),this.handleClick=this.handleClick.bind(this),this.handleCloseMenu=this.handleCloseMenu.bind(this),this.handleExited=this.handleExited.bind(this),this.container=H.createRef(),this.parent=null,this.popper=H.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:n,"data-testid":i}=this.props,{menuStyle:o}=this.props,{options:a,popperOptions:s}=this.props;return s=ho({placement:"bottom"},s),a=ho({separateKeyboardMouse:!0},a),u.jsx("div",{className:"menu-actions-listener",ref:this.container,"data-testid":i,children:u.jsx(Di,{ref:this.popper,options:s,className:X("menu-popper",n),onExited:this.handleExited,closeOnBlur:!0,interactive:!0,children:u.jsx(mh,{actions:e,closeMenu:this.handleCloseMenu,onMenuOpened:t,options:a,menuStyle:o})})})}}yn(xs,"defaultProps",{isShown:null,onMenuClosed(){},onMenuOpened(){},options:{},popperOptions:{},popperClassName:"",menuStyle:{},"data-testid":void 0});const zn=xs;function jt(r,e,t){return e=gh(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function gh(r){var e=ph(r,"string");return typeof e=="symbol"?e:String(e)}function ph(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}var co=V.module("Shortcut"),L;(function(r){r.CTRL="MODIFIER_CTRL",r.CMD="MODIFIER_CMD",r.ALT="MODIFIER_ALT",r.OPTION="MODIFIER_OPTION",r.SHIFT="MODIFIER_SHIFT"})(L||(L={}));var D;(function(r){r.A="A",r.B="B",r.C="C",r.D="D",r.E="E",r.F="F",r.G="G",r.H="H",r.I="I",r.J="J",r.K="K",r.L="L",r.M="M",r.N="N",r.O="O",r.P="P",r.Q="Q",r.R="R",r.S="S",r.T="T",r.U="U",r.V="V",r.W="W",r.X="X",r.Y="Y",r.Z="Z",r.ZERO="0",r.ONE="1",r.TWO="2",r.THREE="3",r.FOUR="4",r.FIVE="5",r.SIX="6",r.SEVEN="7",r.EIGHT="8",r.NINE="9",r.BACKSPACE="Backspace",r.ESCAPE="Escape",r.ENTER="Enter",r.DELETE="Delete",r.SLASH="/",r.QUESTION_MARK="?",r.BACKSLASH="\\",r.PIPE="|",r.MINUS="-",r.UNDERSCORE="_",r.EQUALS="=",r.PLUS="+",r.BACKTICK="`",r.TILDE="~",r.COMMA=",",r.LEFT_CHEVRON="<",r.PERIOD=".",r.RIGHT_CHEVRON=">",r.SEMICOLON=";",r.COLON=":",r.SINGLE_QUOTE="'",r.DOUBLE_QUOTE='"',r.LEFT_BRACKET="[",r.RIGHT_BRACKET="]",r.LEFT_CURLY="{",r.RIGHT_CURLY="}",r.F1="F1",r.F2="F2",r.F3="F3",r.F4="F4",r.F5="F5",r.F6="F6",r.F7="F7",r.F8="F8",r.F9="F9",r.F10="F10",r.F11="F11",r.F12="F12"})(D||(D={}));var bh=new Set([D.ENTER,D.DELETE,D.F1,D.F2,D.F3,D.F4,D.F5,D.F6,D.F7,D.F8,D.F9,D.F10,D.F11,D.F12]);class ge extends Ga{static isAllowedKey(e){return Object.values(D).includes(e)}static isValidKeyState(e){var{keyValue:t}=e;if(t===null)return!0;if(!ge.isMacPlatform&&e.metaKey||!ge.isAllowedKey(t))return!1;var n=!e.altKey&&!e.ctrlKey&&!e.metaKey&&!e.shiftKey;return!n||bh.has(t)}static createKeyState(e){var t={altKey:!1,ctrlKey:!1,metaKey:!1,shiftKey:!1,keyValue:e[e.length-1]};return e.forEach(n=>{switch(n){case L.CTRL:t.ctrlKey=!0;break;case L.ALT:case L.OPTION:t.altKey=!0;break;case L.CMD:t.metaKey=!0;break;case L.SHIFT:t.shiftKey=!0;break}}),t}static getKeyStateFromEvent(e){var{key:t,keyCode:n}=e,i="";return t==="Shift"||t==="Meta"||t==="Control"||t==="Alt"?i="":!ge.isAllowedKey(t)&&ge.isAllowedKey(String.fromCharCode(n))?i=String.fromCharCode(n):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===D.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 D.ENTER:t+="⏎";break;case D.ESCAPE:t+="⎋";break;case D.BACKSPACE:t+="⌫";break;case D.DELETE:t+="⌦";break;case null:break;default:t+=e.keyValue}return t}static doKeyStatesMatch(e,t){var n,i;return((n=e.keyValue)===null||n===void 0?void 0:n.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?"":ge.isMacPlatform?ge.getMacDisplayText(e):ge.getWindowsDisplayText(e)}constructor(e){var{id:t,shortcut:n,macShortcut:i,isEditable:o=!0,name:a,tooltip:s}=e;super(),jt(this,"id",void 0),jt(this,"name",void 0),jt(this,"tooltip",void 0),jt(this,"isEditable",void 0),jt(this,"defaultKeyState",void 0),jt(this,"keyState",void 0),this.id=t,this.name=a,this.tooltip=s,this.isEditable=o;var l=ge.isMacPlatform,d=l?i:n;this.defaultKeyState=ge.createKeyState(d),this.keyState=this.defaultKeyState}getDisplayText(){return ge.getDisplayText(this.keyState)}getKeyState(){return this.keyState}setKeyState(e){ge.isValidKeyState(e)?(co.debug2("Shortcut ".concat(this.id," updated to ").concat(JSON.stringify(e))),this.keyState=e,this.dispatchEvent(new gs("onUpdate",{detail:this}))):co.debug2("Shortcut ".concat(this.id," tried to update to invalid keyState ").concat(JSON.stringify(e)))}getDefaultKeyState(){return this.defaultKeyState}isDefault(){return ge.doKeyStatesMatch(this.getDefaultKeyState(),this.getKeyState())}setToNull(){this.setKeyState(ge.NULL_KEY_STATE)}isNull(){return ge.doKeyStatesMatch(this.keyState,ge.NULL_KEY_STATE)}setToDefault(){this.setKeyState(this.defaultKeyState)}matchesKeyState(e){return ge.doKeyStatesMatch(e,this.keyState)}matchesEvent(e){return this.matchesKeyState(ge.getKeyStateFromEvent(e))}}jt(ge,"NULL_KEY_STATE",{metaKey:!1,shiftKey:!1,altKey:!1,ctrlKey:!1,keyValue:null});jt(ge,"isMacPlatform",Xe.isMacPlatform());function mo(r,e,t){return e=yh(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function yh(r){var e=Ch(r,"string");return typeof e=="symbol"?e:String(e)}function Ch(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}var fo=V.module("ShortcutRegistry");class Sh extends Ga{constructor(){super(...arguments),mo(this,"shortcutMap",new Map),mo(this,"shortcutsByCategory",new Map)}createAndAdd(e){var t=new ge(e);return this.add(t)}add(e){var t=this.shortcutMap.get(e.id);if(t)return fo.warn("Skipping attempt to add duplicate shortcut ID to registry: ".concat(e.id)),t;fo.debug2("Adding shortcut to registry: ".concat(e.id)),e.addEventListener("onUpdate",o=>{var{detail:a}=o;return this.dispatchEvent(new gs("onUpdate",{detail:a}))});var n=e.id.split(".")[0];if(this.shortcutMap.set(e.id,e),this.shortcutsByCategory.has(n)){var i;(i=this.shortcutsByCategory.get(n))===null||i===void 0||i.push(e)}else this.shortcutsByCategory.set(n,[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 wh=Object.freeze(new Sh);const ce=wh;var Eh={COPY:ce.createAndAdd({id:"GLOBAL.COPY",name:"Copy",shortcut:[L.CTRL,D.C],macShortcut:[L.CMD,D.C],isEditable:!1}),PASTE:ce.createAndAdd({id:"GLOBAL.PASTE",name:"Paste",shortcut:[L.CTRL,D.V],macShortcut:[L.CMD,D.V],isEditable:!1}),SAVE:ce.createAndAdd({id:"GLOBAL.SAVE",name:"Save",shortcut:[L.CTRL,D.S],macShortcut:[L.CMD,D.S],isEditable:!1}),SELECT_ALL:ce.createAndAdd({id:"GLOBAL.SELECT_ALL",name:"Select All",shortcut:[L.CTRL,D.A],macShortcut:[L.CMD,D.A],isEditable:!1}),REOPEN_CLOSED_PANEL:ce.createAndAdd({id:"GLOBAL.REOPEN_CLOSED_PANEL",name:"Re-open Closed Panel",shortcut:[L.ALT,L.SHIFT,D.T],macShortcut:[L.OPTION,L.SHIFT,D.T],isEditable:!0}),LINKER:ce.createAndAdd({id:"GLOBAL.LINKER",name:"Linker",shortcut:[L.CTRL,D.L],macShortcut:[L.CMD,D.L]}),LINKER_CLOSE:ce.createAndAdd({id:"GLOBAL.LINKER_CLOSE",name:"Close Linker Overlay",shortcut:[D.ESCAPE],macShortcut:[D.ESCAPE],isEditable:!1}),COPY_VERSION_INFO:ce.createAndAdd({id:"GLOBAL.COPY_VERSION_INFO",name:"Copy Version Info",shortcut:[L.CTRL,L.ALT,D.I],macShortcut:[L.CMD,L.SHIFT,D.I],isEditable:!0}),NEXT:ce.createAndAdd({id:"GLOBAL.NEXT",name:"Next",shortcut:[D.ENTER],macShortcut:[D.ENTER],isEditable:!1}),PREVIOUS:ce.createAndAdd({id:"GLOBAL.PREVIOUS",name:"Previous",shortcut:[L.SHIFT,D.ENTER],macShortcut:[L.SHIFT,D.ENTER],isEditable:!1})};const Vt=Eh;function ci(r,e,t){return e=_h(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function _h(r){var e=Ph(r,"string");return typeof e=="symbol"?e:String(e)}function Ph(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class Ms extends m.PureComponent{constructor(e){super(e),ci(this,"inputField",void 0),ci(this,"searchChangeSelection",void 0),this.inputField=H.createRef(),this.searchChangeSelection=H.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 n=t.getBoundingClientRect().width;e.style.paddingRight="".concat(n,"px")}}render(){var{value:e,placeholder:t,onBlur:n,onChange:i,className:o,disabled:a,matchCount:s,id:l,onKeyDown:d,"data-testid":h,cursor:c}=this.props,f,v=[{action:()=>c?.next("forward"),shortcut:Vt.NEXT},{action:()=>c?.next("back"),shortcut:Vt.PREVIOUS}];return c&&s>1?f=u.jsxs(u.Fragment,{children:[u.jsx(En,{kind:"ghost",className:"search-change-button",type:"button",onClick:()=>{c.next("back")},icon:ts,tooltip:"Previous match (".concat(Vt.PREVIOUS.getDisplayText(),")")}),u.jsxs("span",{className:"search-change-text",children:[c.index!==void 0&&"".concat(c.index+1," of "),s]}),u.jsx(En,{kind:"ghost",className:"search-change-button",type:"button",onClick:()=>{c.next("forward")},icon:ud,tooltip:"Next match (".concat(Vt.NEXT.getDisplayText(),")")})]}):f=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:n,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:f}),u.jsx(ee,{actions:v})]}):u.jsx("span",{className:"search-icon",children:u.jsx(ue,{icon:hd})})]})}}ci(Ms,"defaultProps",{placeholder:"Search",className:"",matchCount:null,onKeyDown(){},id:"","data-testid":void 0,cursor:void 0});const Mi=Ms;function Ns(r,e,t){return e=Th(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Th(r){var e=Oh(r,"string");return typeof e=="symbol"?e:String(e)}function Oh(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class As extends m.PureComponent{constructor(e){super(e),Ns(this,"searchInput",void 0),this.searchInput=H.createRef(),this.handleChange=this.handleChange.bind(this),this.sendUpdate=_n(this.sendUpdate.bind(this),e.debounceMs),this.state={value:e.value}}componentDidUpdate(e){var{value:t}=this.props;e.value!==t&&this.setState({value:t})}focus(){var e;(e=this.searchInput.current)===null||e===void 0||e.focus()}handleChange(e){this.setState({value:e.target.value},this.sendUpdate)}sendUpdate(){var{onChange:e}=this.props,{value:t}=this.state;e(t)}render(){var{placeholder:e,className:t,matchCount:n,id:i,"data-testid":o}=this.props,{value:a}=this.state;return u.jsx(Mi,{value:a,placeholder:e,onChange:this.handleChange,className:t,matchCount:n,ref:this.searchInput,id:i,"data-testid":o})}}Ns(As,"defaultProps",{placeholder:"Search",className:"",matchCount:null,debounceMs:250,id:"","data-testid":void 0});const Ih=As;function Ls(r,e,t){return e=Dh(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Dh(r){var e=xh(r,"string");return typeof e=="symbol"?e:String(e)}function xh(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}var Mh=V.module("ItemListItem");class Br extends m.Component{static handleKeyDown(){return Mh.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=H.createRef()}handleBlur(e){var{itemIndex:t,onBlur:n}=this.props;n(t,e)}handleFocus(e){var{itemIndex:t,onFocus:n}=this.props;n(t,e)}handleClick(e){var{itemIndex:t,onClick:n}=this.props;n(t,e)}handleContextMenu(e){var{itemIndex:t,onContextMenu:n}=this.props;n(t,e)}handleDragStart(e){var{itemIndex:t,onDragStart:n}=this.props;n(t,e)}handleDrag(e){var{itemIndex:t,onDrag:n}=this.props;n(t,e)}handleDragOver(e){e.preventDefault();var{itemIndex:t,onDragOver:n}=this.props;n(t,e)}handleDragEnd(e){var{itemIndex:t,onDragEnd:n}=this.props;n(t,e)}handleDrop(e){var{itemIndex:t,onDrop:n}=this.props;n(t,e)}handleDoubleClick(e){var{itemIndex:t,onDoubleClick:n}=this.props;n(t,e)}handleMouseMove(e){var{itemIndex:t,onMouseMove:n}=this.props;n(t,e)}handleMouseDown(e){var{itemIndex:t,onMouseDown:n}=this.props;n(t,e)}handleMouseUp(e){var{itemIndex:t,onMouseUp:n}=this.props;n(t,e)}render(){var{isDraggable:e,isFocused:t,isSelected:n,style:i,children:o,"data-testid":a}=this.props;return u.jsx("div",{className:X("item-list-item",{active:n},{"is-focused":t},{"is-draggable":e}),onKeyDown:Br.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(Br,"defaultProps",{children:null,isDraggable:!1,isFocused:!1,isSelected:!1,itemIndex:0,"data-testid":void 0,onBlur(){},onClick(){},onContextMenu(){},onDragStart(){},onDrag(){},onDragOver(){},onDragEnd(){},onDrop(){},onDoubleClick(){},onFocus(){},onMouseDown(){},onMouseMove(){},onMouseUp(){},style:{}});const Nh=Br;function vo(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,n)}return t}function go(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?vo(Object(t),!0).forEach(function(n){rt(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):vo(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function rt(r,e,t){return e=Ah(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Ah(r){var e=Lh(r,"string");return typeof e=="symbol"?e:String(e)}function Lh(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}var po=V.module("ItemList"),bo=5;class Ye extends m.PureComponent{static renderItem(e){var t,n,{item:i}=e;return u.jsx("div",{className:"item-list-item-content",children:i!=null&&((t=(n=i.displayValue)!==null&&n!==void 0?n:i.value)!==null&&t!==void 0?t:"".concat(i))})}constructor(e){super(e),rt(this,"list",void 0),rt(this,"listContainer",void 0),rt(this,"getItemSelected",pn((i,o)=>It.isSelected(o,i),{max:Ye.CACHE_SIZE})),rt(this,"getCachedItem",pn((i,o,a,s,l,d,h,c)=>{var f=d({item:a,itemIndex:i,isFocused:s,isSelected:l,style:h});return u.jsx(Nh,{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:f},o)},{max:Ye.CACHE_SIZE})),rt(this,"getOuterElement",pn(i=>{var o=H.forwardRef((a,s)=>u.jsx("div",go({ref:s,tabIndex:-1,onKeyDown:i,role:"presentation"},a)));return o.displayName="ItemListOuterElement",o})),rt(this,"getInnerElement",pn(()=>{var i=H.forwardRef((o,a)=>u.jsx("div",go({className:"item-list-inner-element",ref:a},o)));return i.displayName="ItemListInnerElement",i})),rt(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=H.createRef(),this.listContainer=H.createRef();var{isStickyBottom:t,selectedRanges:n}=e;this.state={focusIndex:null,mouseDownIndex:null,selectedRanges:n,overscanStartIndex:0,height:null,isDragging:!1,isStuckToBottom:t,scrollOffset:null,mouseX:null,mouseY:null}}componentDidUpdate(e,t){var{selectedRanges:n,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(),n!==e.selectedRanges&&n!==d)this.setSelectedRanges(n);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:n}=this.state,i=this.listContainer.current.querySelectorAll(t),o=e-n;return i[o]}focusItem(e){var{disableSelect:t}=this.props;if(!t){this.setState({focusIndex:e});var n=this.getElement(e);n instanceof HTMLElement&&n.focus()}}scrollToItem(e){var t=this.getElement(e);t?.scrollIntoView({block:"center"})}handleItemContextMenu(e,t){this.setState({focusIndex:e});var{selectedRanges:n}=this.state,i=It.isSelected(n,e),o=i||Xe.isModifierKeyDown(t);this.toggleSelect(e,t.shiftKey,o,!1)}handleItemDoubleClick(e,t){var{isDoubleClickSelect:n,onSelect:i}=this.props;n&&this.setState(o=>{var{selectedRanges:a}=o;return{selectedRanges:It.selectRange(a,[e,e])}},()=>{i(e,t)})}handleItemMouseDown(e,t){var{selectedRanges:n}=this.state;if(!(t.target instanceof HTMLElement&&["button","select","input","textarea"].indexOf(t.target.tagName.toLowerCase())!==-1)){if(t.button===2&&n.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){po.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){po.debug2("item focus",e,t.target),this.setState(n=>{var{focusIndex:i}=n;return i!==e?{focusIndex:e}:null})}handleItemMouseMove(e,t){var{isDragSelect:n,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>bo&&c>bo&&this.setState({isDragging:!0}),(n||a===e)&&(this.focusItem(e),i?(!n&&!this.getItemSelected(e,s)&&!Xe.isModifierKeyDown(t)&&this.deselectAll(),this.selectRange([Math.min(a,e),Math.max(a,e)])):this.toggleSelect(e,t.shiftKey,Xe.isModifierKeyDown(t),!1))}}handleItemMouseUp(e,t){var{isDeselectOnClick:n,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=Xe.isModifierKeyDown(t);this.focusItem(e),this.toggleSelect(e,l,d,n),!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:n,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=n-1;else if(e.key==="ArrowDown")a!=null&&a>=0?a=Math.min(a+1,n-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:n}=e;this.setState(i=>{if(t)return{scrollOffset:n};var{isStickyBottom:o}=this.props,{height:a}=i,s=o&&this.isListAtBottom({scrollOffset:n,height:a});return{isStuckToBottom:s,scrollOffset:n}})}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,n){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&&n?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){It.validateRange(e),this.setState(t=>{var{selectedRanges:n}=t;return{selectedRanges:It.deselectRange(n,e)}})}selectItem(e){var{disableSelect:t}=this.props;t||this.selectRange([e,e])}selectRange(e){It.validateRange(e),this.setState(t=>{var{selectedRanges:n}=t;return{selectedRanges:It.selectRange(n,e)}})}setSelectedRanges(e){this.setState({selectedRanges:e})}sendViewportUpdate(){var{scrollOffset:e,height:t}=this.state;if(e!=null&&t!=null){var{onViewportChange:n,rowHeight:i}=this.props,o=Math.floor(e/i),a=o+Math.ceil(t/i);n(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:n,rowHeight:i}=this.props;return e+t>=n*i}renderInnerElement(e){var{index:t,style:n}=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,n,s)}render(){var{items:e,itemCount:t,overscanCount:n,renderItem:i,rowHeight:o,"data-testid":a}=this.props,{selectedRanges:s,isStuckToBottom:l}=this.state;return u.jsx(ql,{className:"item-list-auto-sizer",onResize:this.handleResize,children:d=>{var{width:h,height:c}=d;return u.jsx(Zl,{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:n,"data-testid":a,children:this.renderInnerElement})}})}}rt(Ye,"CACHE_SIZE",1e3);rt(Ye,"DEFAULT_ROW_HEIGHT",20);rt(Ye,"DEFAULT_OVERSCAN",10);rt(Ye,"defaultProps",{offset:0,items:[],rowHeight:Ye.DEFAULT_ROW_HEIGHT,isDeselectOnClick:!0,isDoubleClickSelect:!1,isDragSelect:!0,isMultiSelect:!1,isStickyBottom:!1,disableSelect:!1,onFocusChange(){},onSelect(){},onSelectionChange(){},onViewportChange(){},overscanCount:Ye.DEFAULT_OVERSCAN,renderItem:Ye.renderItem,selectedRanges:[],focusSelector:".item-list-item","data-testid":void 0});var Fh=V.module("ErrorBoundary");class kh extends m.Component{static getDerivedStateFromError(e){return{error:e}}constructor(e){super(e),this.state={error:void 0}}componentDidCatch(e,t){var{onError:n}=this.props;Fh.error("Error caught by ErrorBoundary",e,t),n?.(e,t)}render(){var{children:e,className:t,fallback:n}=this.props,{error:i}=this.state;return i!=null?n??u.jsx("div",{className:t,children:u.jsx(dn,{errorMessage:"".concat(i),isLoading:!1,isLoaded:!1})}):e}}function Rh(r){var{on:e,id:t,className:n,isInvalid:i,disabled:o=!1,onClick:a,"data-testid":s}=r;return u.jsx("button",{type:"button",className:X("btn","btn-switch",n,{active:e},{"is-invalid":i}),id:t,onClick:a,disabled:o,"data-testid":s,children:u.jsx("div",{className:"handle"})})}var jh=["className","timeout"];function yo(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,n)}return t}function $h(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?yo(Object(t),!0).forEach(function(n){Hh(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):yo(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function Hh(r,e,t){return e=Bh(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Bh(r){var e=Wh(r,"string");return typeof e=="symbol"?e:String(e)}function Wh(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}function Uh(r,e){if(r==null)return{};var t=Vh(r,e),n,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(r);for(i=0;i<o.length;i++)n=o[i],!(e.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(r,n)&&(t[n]=r[n])}return t}function Vh(r,e){if(r==null)return{};var t={},n=Object.keys(r),i,o;for(o=0;o<n.length;o++)i=n[o],!(e.indexOf(i)>=0)&&(t[i]=r[i]);return t}function Hy(r){var{className:e,timeout:t=Xa.transitionMs}=r,n=Uh(r,jh);return u.jsx(za,$h({timeout:t,classNames:X("fade",e)},n))}var Kh=["children","className","isInvalid","onChange","data-testid"];function Co(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,n)}return t}function So(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Co(Object(t),!0).forEach(function(n){zh(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):Co(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function zh(r,e,t){return e=Gh(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Gh(r){var e=qh(r,"string");return typeof e=="symbol"?e:String(e)}function qh(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}function Zh(r,e){if(r==null)return{};var t=Xh(r,e),n,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(r);for(i=0;i<o.length;i++)n=o[i],!(e.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(r,n)&&(t[n]=r[n])}return t}function Xh(r,e){if(r==null)return{};var t={},n=Object.keys(r),i,o;for(o=0;o<n.length;o++)i=n[o],!(e.indexOf(i)>=0)&&(t[i]=r[i]);return t}var Fs=H.forwardRef((r,e)=>{var{children:t,className:n,isInvalid:i,onChange:o,"data-testid":a}=r,s=Zh(r,Kh),l=ws(e),d=m.useCallback(h=>{o(h.target.value)},[o]);return u.jsx("select",So(So({ref:l,className:X("custom-select",n,{"is-invalid":i}),onChange:d,"data-testid":a},s),{},{children:t}))});Fs.displayName="Select";const Yh=Fs;function Qh(){return tr(cd,"No API available in useApi. Was code wrapped in ApiBootstrap or ApiContext.Provider?")}function ks(r){return typeof r=="object"&&r!=null&&typeof r.type=="string"&&r.name!=null}function Rs(r){return typeof r=="object"&&r!=null&&typeof r.type=="string"&&r.id!=null}function By(r){return ks(r)||Rs(r)}var Jh=m.createContext(null);function Wy(r){if(Rs(r))return{id:r.id,type:r.type};if(ks(r)){var e;return{name:(e=r.name)!==null&&e!==void 0?e:"",type:r.type}}throw new Error("Invalid descriptor: ".concat(r))}function ec(r){var e,t;return{type:(e=r.type)!==null&&e!==void 0?e:"",name:(t=r.title)!==null&&t!==void 0?t:r.name,id:r.id}}function Uy(){return tr(Jh,"No ObjectFetcher available in useObjectFetcher. Was code wrapped in ObjectFetcherContext.Provider?")}function wo(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,n)}return t}function tc(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?wo(Object(t),!0).forEach(function(n){nc(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):wo(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function nc(r,e,t){return e=rc(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function rc(r){var e=ic(r,"string");return typeof e=="symbol"?e:String(e)}function ic(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}var Ni=Object.freeze({}),oc=new Map,Vy=r=>r.api,Ky=r=>r.user,js=r=>r.storage,$s=r=>js(r).commandHistoryStorage,Hs=r=>js(r).fileStorage,ac=r=>r.defaultWorkspaceSettings,Bs=r=>{var{workspace:e}=r;return e},We=Xl(r=>{for(var e,t,n=(e=(t=Bs(r))===null||t===void 0?void 0:t.data.settings)!==null&&e!==void 0?e:{},i=tc({},ac(r)),o=Object.keys(n),a=0;a<o.length;a+=1){var s=o[a];n[s]!==void 0&&(i[s]=n[s])}return i}),zy=r=>r.defaultWorkspaceSettings,Gy=r=>We(r).defaultDateTimeFormat,qy=r=>{var e;return(e=We(r).defaultDecimalFormatOptions)!==null&&e!==void 0?e:Ni},Zy=r=>{var e;return(e=We(r).defaultIntegerFormatOptions)!==null&&e!==void 0?e:Ni},Xy=r=>{var e;return(e=We(r).formatter)!==null&&e!==void 0?e:[]},sc=r=>We(r).timeZone,Yy=r=>We(r).showTimeZone,Qy=r=>We(r).showTSeparator,Jy=r=>We(r).truncateNumbersWithPound,eC=r=>We(r).showEmptyStrings,tC=r=>We(r).showNullStrings,nC=r=>We(r).shortcutOverrides,rC=r=>We(r).webgl,iC=r=>We(r).webglEditable,lc=r=>{var e;return(e=We(r).defaultNotebookSettings)!==null&&e!==void 0?e:Ni},oC=r=>r.activeTool,dc=r=>{var e;return(e=r.plugins)!==null&&e!==void 0?e:oc};function Eo(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,n)}return t}function Qt(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Eo(Object(t),!0).forEach(function(n){uc(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):Eo(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function uc(r,e,t){return e=hc(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function hc(r){var e=cc(r,"string");return typeof e=="symbol"?e:String(e)}function cc(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}var aC=r=>({type:gd,payload:r}),sC=r=>({type:pd,payload:r}),Ws=r=>({type:md,payload:r}),lC=r=>({type:bd,payload:r}),dC=r=>({type:yd,payload:r}),uC=r=>({type:Cd,payload:r}),hC=r=>({type:Sd,payload:r}),mc=r=>(e,t)=>{e(Ws(r));var{storage:n}=t(),{workspaceStorage:i}=n;return i?.save(r)},fc=r=>(e,t)=>{var{workspace:n}=t(),{data:i}=n??{},o=Qt(Qt({},n),{},{data:Qt(Qt(Qt({},i),r),{},{settings:Qt(Qt({},i?.settings),r.settings)})});return e(mc(o))},vc=r=>e=>e(fc({settings:r})),cC=r=>({type:fd,payload:r}),mC=r=>({type:vd,payload:r}),fC=r=>({type:wd,payload:r});function _o(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,n)}return t}function Po(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?_o(Object(t),!0).forEach(function(n){gc(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):_o(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function gc(r,e,t){return e=pc(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function pc(r){var e=bc(r,"string");return typeof e=="symbol"?e:String(e)}function bc(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}function yc(r){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 n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:e,i=arguments.length>1?arguments[1]:void 0;switch(i.type){case r:{var{id:o,payload:a}=i;return t&&qn({payload:a},{payload:n[o]})?n:Po(Po({},n),{},{[o]:a})}default:return n}}}function Cc(r){var{type:e}=r,t=Qh();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(ue,{icon:is});case t.VariableType.FIGURE:return u.jsx(ue,{icon:rs});case t.VariableType.PANDAS:return u.jsx(ue,{icon:Ed});default:return u.jsx(ue,{icon:ns})}}function To(r,e,t,n,i,o,a){try{var s=r[o](a),l=s.value}catch(d){t(d);return}s.done?e(l):Promise.resolve(l).then(n,i)}function Sc(r){return function(){var e=this,t=arguments;return new Promise(function(n,i){var o=r.apply(e,t);function a(l){To(o,n,i,a,s,"next",l)}function s(l){To(o,n,i,a,s,"throw",l)}a(void 0)})}}function Us(r){var{children:e,language:t}=r,[n,i]=m.useState(null),{activeThemes:o}=_s();return m.useEffect(()=>{var a=!1;function s(){return l.apply(this,arguments)}function l(){return l=Sc(function*(){if(e!=null&&o!=null){var d=yield lt.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:n!=null?{__html:n}:void 0})}class wc{static get LANGUAGE_MAP(){return new Map([["python","Python"],["groovy","Groovy"],["scala","Scala"]])}}const Vs=wc;class Dr{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)?[]:Yl.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"),n="".concat(e.getMinutes()).padStart(2,"0"),i="".concat(e.getSeconds()).padStart(2,"0"),o="".concat(e.getMilliseconds()).padStart(3,"0");return"".concat(t,":").concat(n,":").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 Dr.isTableType(e,t)||Dr.isWidgetType(e,t)}static isFigureType(e,t){return t===e.VariableType.FIGURE}static isPandas(e,t){return t===e.VariableType.PANDAS}}const mi=Dr;function Ks(r){var{children:e}=r;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})]})}Ks.propTypes={children:S.node.isRequired};function fi(r,e,t){return e=Ec(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Ec(r){var e=_c(r,"string");return typeof e=="symbol"?e:String(e)}function _c(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class zs extends m.Component{constructor(e){super(e),fi(this,"timer",void 0),fi(this,"startTime",void 0),this.updateElapsed=this.updateElapsed.bind(this),this.startTime=Date.now(),this.state={elapsed:0}}componentDidMount(){this.timer=setInterval(this.updateElapsed,1e3)}componentWillUnmount(){this.timer&&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:n}=this.state;return u.jsx("div",{className:X("console-history-result-in-progress",{disabled:e}),children:u.jsxs("span",{className:"badge",children:[u.jsx(os,{className:"ml-2"}),"Running... ",Cs.formatElapsedTime(n)," ",u.jsx(se,{className:"console-history-result-in-progress-cancel",kind:"ghost",icon:_d,tooltip:"Cancel",onClick:t,disabled:e})]})})}}fi(zs,"defaultProps",{disabled:!1});const Pc=zs;function Gn(r,e,t){return e=Tc(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Tc(r){var e=Oc(r,"string");return typeof e=="symbol"?e:String(e)}function Oc(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class Pn extends m.PureComponent{constructor(e){super(e),Gn(this,"mouseX",void 0),Gn(this,"mouseY",void 0),Gn(this,"isClicking",void 0),this.handleKeyPress=this.handleKeyPress.bind(this),this.handleMouseDown=this.handleMouseDown.bind(this),this.handleMouseMove=this.handleMouseMove.bind(this),this.handleMouseUp=this.handleMouseUp.bind(this),this.handleToggleError=this.handleToggleError.bind(this),this.handleMouseEnter=this.handleMouseEnter.bind(this),this.handleMouseLeave=this.handleMouseLeave.bind(this),this.mouseX=null,this.mouseY=null,this.isClicking=!1,this.state={isExpanded:!1,isTriggerHovered:!1}}handleKeyPress(e){switch(e.key){case"Enter":case" ":this.handleToggleError(),e.stopPropagation(),e.preventDefault();break}}handleMouseDown(e){this.mouseX=e.clientX,this.mouseY=e.clientY,this.isClicking=!0}handleMouseMove(e){this.mouseX!=null&&this.mouseY!=null?(Math.abs(e.clientX-this.mouseX)>=Pn.mouseDragThreshold||Math.abs(e.clientY-this.mouseY)>=Pn.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:n}=this.props;R(n);var i=n.indexOf(`
1
+ import{r as m,bk as Pi,V as H,bn as Kl,J as u,L as za,M as X,R as jr,a2 as S,bo as zl,N as ue,I as zt,bp as Gl,H as Ga,a0 as _n,a1 as pn,bq as ql,br as Zl,bs as Xl,bm as qn,bt as Yl,bu as Ql,ab as yt,bv as Wn,aq as Gi,bw as M,bx as qi,ac as qa,a5 as Ti,by as Jl,_ as In}from"./vendor-3cb40e4b.js";import{L as V,ax as Za,T as Xa,a3 as ed,a6 as td,P as nd,a2 as rd,a7 as id,_ as od,ac as ad,S as sd,M as Ya,b as Qa,c as Ja,al as ld,ay as dd,az as es,aA as ts,aB as ud,aC as hd,J as dn,ag as cd,aD as md,aE as fd,aF as vd,aG as gd,aH as pd,aI as bd,aJ as yd,aK as Cd,aL as Sd,aM as wd,B as ns,aw as Ed,at as rs,au as is,U as os,j as _d,e as R,d as Rn,aN as Pd,aa as as,aO as Zi,aP as Td,aQ as Od,aR as Id,aS as Dd,f as ss,am as ls,aT as ds,aU as Un,as as xd,aV as Md,F as Xi,aW as us,aX as Yi,aY as hs,aZ as Nd,I as Ad,a_ as Ld,a4 as Fd,a$ as kd,A as Rd,a5 as jd,b0 as $d,b1 as Hd,b2 as Bd,b3 as Wd,b4 as Ud,b5 as Vd,b6 as Kd,ao as zd,b7 as Gd,b8 as qd}from"./index-bdb64cb2.js";import{e as lt,l as pt,K as ze,a as Gt,b as Qi,R as Zd,_ as cs}from"./monaco-b5248072.js";var Xd=Object.freeze([]),Ay=new Map,Ly=()=>{};function Fy(r){return Array.isArray(r)?r:[r]}function Jr(){for(var r=arguments.length,e=new Array(r),t=0;t<r;t++)e[t]=arguments[t];return e.filter(n=>n!=null)}function Yd(r,e,t){return e=Qd(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Qd(r){var e=Jd(r,"string");return typeof e=="symbol"?e:String(e)}function Jd(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class eu extends Error{constructor(){super(...arguments),Yd(this,"isCanceled",!0)}}const ui=eu;function tu(r){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,t=nu(r,e);t.forEach(n=>{r[n]=r[n].bind(r)})}function nu(r,e){for(var t=new Set,n=r,i=0;n!=null&&n!==Object.prototype&&(i<=1||e);){for(var o of Object.getOwnPropertyNames(n)){var a;o!=="constructor"&&typeof((a=Object.getOwnPropertyDescriptor(n,o))===null||a===void 0?void 0:a.value)=="function"&&t.add(o)}n=Object.getPrototypeOf(n),i+=1}return[...t.keys()]}function Ji(r,e,t,n,i,o,a){try{var s=r[o](a),l=s.value}catch(d){t(d);return}s.done?e(l):Promise.resolve(l).then(n,i)}function ru(r){return function(){var e=this,t=arguments;return new Promise(function(n,i){var o=r.apply(e,t);function a(l){Ji(o,n,i,a,s,"next",l)}function s(l){Ji(o,n,i,a,s,"throw",l)}a(void 0)})}}function ms(r){return hi.apply(this,arguments)}function hi(){return hi=ru(function*(r){var{clipboard:e}=navigator;if(e!==void 0)try{return yield navigator.clipboard.writeText(r)}catch{}iu(r)}),hi.apply(this,arguments)}function iu(r){var e=document.activeElement,t=document.createElement("textarea");t.value=r,document.body.appendChild(t),t.focus(),t.select();var n=document.execCommand("copy");if(document.body.removeChild(t),e instanceof HTMLElement&&e.focus(),!n)throw new Error("Unable to execute copy command")}function Dn(r,e,t){return e=ou(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function ou(r){var e=au(r,"string");return typeof e=="symbol"?e:String(e)}function au(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}var su="table_",fs="column_",lu=new Set(["in","not","i","ii","k"]),du=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"]),uu=/[^a-zA-Z0-9_$+@-]/g,hu=/[^A-Za-z0-9_$]/g;class ot{}Dn(ot,"legalize",(r,e,t,n,i)=>{var o=r.trim().replace(/[- ]/g,"_");return n&&(lu.has(o)||du.has(o))&&(o=e+o),o=o.replace(t,""),o||(o=e+i),Number.isNaN(Number(o.charAt(0)))||(o=e+o),o});Dn(ot,"legalizeTableName",r=>ot.legalize(r,su,uu,!1,0));Dn(ot,"legalizeColumnNames",r=>{var e=[];return r.forEach((t,n)=>{var i=ot.legalizeColumnName(t,n);e.includes(i)&&(i=fs+n),e.push(i)}),e});Dn(ot,"legalizeColumnName",function(r){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return ot.legalize(r,fs,hu,!0,e)});Dn(ot,"isValidTableName",r=>ot.legalizeTableName(r)===r);Dn(ot,"isValidColumnName",r=>ot.legalizeColumnName(r)===r);const vs=ot;class gs extends CustomEvent{constructor(e,t){super(e,t)}}function cu(r,e,t){return e=mu(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function mu(r){var e=fu(r,"string");return typeof e=="symbol"?e:String(e)}function fu(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class vu extends Error{constructor(){super(...arguments),cu(this,"isTimeout",!0)}}const ps=vu;class Ee{static makeCancelable(e,t){var n=!1,i,o,a=new Promise((s,l)=>{o=l,Promise.resolve(e).then(d=>{n?t&&t(d):(i=d,s(d))}).catch(d=>l(d))});return a.cancel=()=>{n=!0,o(new ui),i!=null&&t&&t(i)},a}static isCanceled(e){return e instanceof ui}static isTimedOut(e){return e instanceof ps}static withTimeout(e,t){return new Promise((n,i)=>{setTimeout(()=>{try{n(t())}catch(o){i(o)}},e)})}}function eo(r,e,t){return e=gu(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function gu(r){var e=pu(r,"string");return typeof e=="symbol"?e:String(e)}function pu(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class bu{constructor(){eo(this,"pending",[]),eo(this,"resolved",[])}add(e,t){var n=Ee.makeCancelable(e,t);return this.pending.push(n),n.then(()=>{this.resolve(n)},()=>{this.resolve(n)}),n}remove(e){for(var t=0;t<this.pending.length;t+=1)if(this.pending[t]===e){this.pending.splice(t,1);return}}resolve(e){this.remove(e),this.resolved.push(e)}cancel(){for(var e=[...this.pending,...this.resolved],t=0;t<e.length;t+=1)e[t].cancel();this.pending=[],this.resolved=[]}}const xn=bu;class Oi{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(!Oi.isValidRange(e))throw new Error("Invalid range! ".concat(e))}static isSelected(e,t){for(var n=0;n<e.length;n+=1){var i=e[n],o=i[0],a=i[1];if(o<=t&&t<=a)return!0}return!1}static selectRange(e,t){for(var[n,i]=t,o=[...e],a=o.length-1;a>=0;a-=1){var s=o[a],l=s[0],d=s[1];if(l<=n&&i<=d)return o;n<=d&&l<=i&&(n=Math.min(n,l),i=Math.max(i,d),o.splice(a,1))}return o.push([n,i]),o}static deselectRange(e,t){for(var[n,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<n))if(l<n&&i<d){o[a]=[l,n-1],o.splice(a+1,0,[i+1,d]);break}else n<=l&&d<=i?o.splice(a,1):l<n?o[a]=[l,n-1]:o[a]=[i+1,d]}return o}static count(e){return e.reduce((t,n)=>t+(n[1]-n[0]+1),0)}static getItemsInRanges(e,t){return t.reduce((n,i)=>{for(var o=[...n],a=i[0];a<=i[1];a+=1)o.push(e[a]);return o},[])}}const It=Oi;function*ky(r,e){for(var t=r;t<=e;++t)yield t}var Ry=" ";class bs{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 n=e.slice(0,e.length-1).join(", "),i=e[e.length-1];return"".concat(n,", ").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 n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;return e<t?n?-1:1:e>t?n?1:-1:0}}function ys(r,e,t){return e=yu(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function yu(r){var e=Cu(r,"string");return typeof e=="symbol"?e:String(e)}function Cu(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class er{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),n=Math.floor(e%3600/60),i=e%60;return"".concat(t>0?"".concat(t,"h "):"")+"".concat(n>0||t>0?"".concat(n,"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"),n=e%(60*60),i=String(Math.floor(n/60)).padStart(2,"0"),o=n%60,a=String(Math.ceil(o)).padStart(2,"0");return"".concat(t,":").concat(i,":").concat(a)}static isTimeString(e){return new RegExp(er.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])}}ys(er,"TIME_PATTERN","([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]");ys(er,"TIME_ZONES",Object.freeze([{label:"Tokyo UTC+9 No DST",value:"Asia/Tokyo"},{label:"Seoul UTC+9 No DST",value:"Asia/Seoul"},{label:"Hong Kong UTC+8 No DST",value:"Asia/Hong_Kong"},{label:"Singapore UTC+8 No DST",value:"Asia/Singapore"},{label:"Kolkata UTC+5:30 No DST",value:"Asia/Kolkata"},{label:"Berlin UTC+1",value:"Europe/Berlin"},{label:"UTC UTC±0 No DST",value:"UTC"},{label:"London UTC±0",value:"Europe/London"},{label:"Sao Paulo UTC-2",value:"America/Sao_Paulo"},{label:"Newfoundland UTC-3:30",value:"America/St_Johns"},{label:"Halifax UTC-4",value:"America/Halifax"},{label:"New York UTC−5",value:"America/New_York"},{label:"Chicago UTC-6",value:"America/Chicago"},{label:"Denver UTC-7",value:"America/Denver"},{label:"Los Angeles UTC-8",value:"America/Los_Angeles"},{label:"Anchorage UTC-9",value:"America/Anchorage"},{label:"Honolulu UTC-10 No DST",value:"Pacific/Honolulu"},{label:"Zurich UTC+1",value:"Europe/Zurich"},{label:"Amsterdam UTC+1",value:"Europe/Amsterdam"},{label:"Taipei UTC+8 No DST",value:"Asia/Taipei"},{label:"Sydney UTC+10",value:"Australia/Sydney"}]));const Cs=er;function Su(r,e,t){return e=wu(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function wu(r){var e=Eu(r,"string");return typeof e=="symbol"?e:String(e)}function Eu(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class _u extends Error{constructor(){super(...arguments),Su(this,"isInvalid",!0)}}const Vn=_u;function Ss(){var r=m.useRef(!1);return m.useEffect(()=>(r.current=!0,()=>{r.current=!1}),[]),r}function to(r,e,t,n,i,o,a){try{var s=r[o](a),l=s.value}catch(d){t(d);return}s.done?e(l):Promise.resolve(l).then(n,i)}function Pu(r){return function(){var e=this,t=arguments;return new Promise(function(n,i){var o=r.apply(e,t);function a(l){to(o,n,i,a,s,"next",l)}function s(l){to(o,n,i,a,s,"throw",l)}a(void 0)})}}var Tu=V.module("useAsyncInterval");function Ou(r,e){var t=Ss(),n=m.useRef(0),i=m.useRef(0),o=m.useRef(null),a=m.useCallback(Pu(function*(){var s=Date.now();i.current+=1;var l=o.current==null?e:s-o.current;o.current=s;try{yield r()}catch(c){Tu.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);n.current=window.setTimeout(a,h)}}),[r,t,e]);m.useEffect(()=>(o.current=null,a(),()=>{window.clearTimeout(n.current)}),[e,a])}function tr(r){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(r);if(t==null)throw new Error(e);return t}function Iu(r,e,t){var n=m.useRef(t),i=m.useRef(r);i.current=r;var o=m.useMemo(()=>Pi(function(){return i.current(...arguments)},e,n.current),[e]);return m.useEffect(()=>()=>{var a,s;(a=(s=n.current)===null||s===void 0?void 0:s.flushOnUnmount)!==null&&a!==void 0&&a?o.flush():o.cancel()},[o]),o}function Du(r){var e=m.useRef();return m.useEffect(function(){e.current=r}),e.current}function ws(r){var e=m.useRef(null);return m.useEffect(function(){r&&(typeof r=="function"?r(e.current):r.current=e.current)}),e}var xu=3500,Mu=V.module("useCopyToClipboard");function Nu(){var[r,e]=m.useState(!1),t=m.useRef(null),n=m.useCallback(i=>{ms(i).then(()=>{e(!0)}).catch(o=>Mu.error("Unable to copy ".concat(i),`
2
+ `,o))},[]);return m.useEffect(()=>(t.current&&clearTimeout(t.current),r&&(t.current=setTimeout(()=>{e(!1)},xu)),()=>{t.current&&clearTimeout(t.current)}),[r]),[r,n]}function no(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,n)}return t}function Au(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?no(Object(t),!0).forEach(function(n){wn(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):no(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function wn(r,e,t){return e=Lu(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Lu(r){var e=Fu(r,"string");return typeof e=="symbol"?e:String(e)}function Fu(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}var ro="popper";class Ii extends m.Component{constructor(e){super(e),wn(this,"element",void 0),wn(this,"container",void 0),wn(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=H.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:n}=this.props;if(!e&&this.container.current!==null){var{options:i}=this.props;i=Au({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 Kl(n||o,this.element,i),e.scheduleUpdate(),cancelAnimationFrame(this.rAF),this.rAF=window.requestAnimationFrame(()=>{if(t){var a=this.element.querySelector(".".concat(ro));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:n,interactive:i,closeOnBlur:o}=this.props,{show:a}=this.state;return u.jsx(Za,{isPortal:!0,children:u.jsx(za,{in:a,timeout:n,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(ro,{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&&jr.createPortal(this.renderContent(),this.element)})}}wn(Ii,"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});wn(Ii,"defaultProps",{options:{},className:"",timeout:Xa.transitionMs,onEntered(){},onExited(){},isShown:!1,interactive:!1,closeOnBlur:!1,referenceObject:null,"data-testid":void 0});const Di=Ii;function io(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,n)}return t}function ku(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?io(Object(t),!0).forEach(function(n){ut(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):io(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function ut(r,e,t){return e=Ru(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Ru(r){var e=ju(r,"string");return typeof e=="symbol"?e:String(e)}function ju(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}var $u=V.module("Tooltip");class ye extends m.Component{static handleHidden(){ye.shownTooltipCount-=1,ye.shownTooltipCount===0&&(ye.lastHiddenTime=Date.now())}static handleShown(){ye.shownTooltipCount+=1}constructor(e){super(e),ut(this,"container",void 0),ut(this,"popper",void 0),ut(this,"parent",void 0),ut(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=H.createRef(),this.popper=H.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:n}=t,{isShown:i}=this.state;i!==n&&(i?ye.handleShown():ye.handleHidden())}componentWillUnmount(){this.stopListening(),this.stopListeningWindow(),this.stopTimer();var{isShown:e}=this.state;e&&ye.handleHidden()}startListening(){if(!this.container.current||!this.container.current.parentElement){$u.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,n=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&&n>=o.top&&n<=o.top+o.height?this.handleMouseMove():t>=a.left&&t<=a.left+a.width&&n>=a.top&&n<=a.top+a.height?this.handleMouseMove():i&&(this.stopTimer(),this.hide())}}startTimer(){this.stopTimer();var{timeout:e,reshowTimeout:t}=this.props,n=e;(ye.shownTooltipCount>0||Date.now()-ye.lastHiddenTime<ye.triggerReshowThreshold)&&(n=t),this.timer=window.setTimeout(this.handleTimeout,n)}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:n}=this.props;n&&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:n,popperClassName:i,"data-testid":o,onEntered:a}=this.props,{isShown:s}=this.state,{options:l}=this.props;return l=ku({placement:"bottom"},l),u.jsx("div",{ref:this.container,style:{display:"none"},"data-testid":o,children:u.jsx(Di,{className:X(i,"popper-tooltip"),options:l,ref:this.popper,onEntered:a,onExited:this.handleExited,interactive:e,referenceObject:n,children:u.jsxs("div",{className:"tooltip-content",children:[" ",s&&t]})})})}}ut(ye,"defaultTimeout",500);ut(ye,"defaultReshowTimeout",100);ut(ye,"triggerReshowThreshold",300);ut(ye,"shownTooltipCount",0);ut(ye,"lastHiddenTime",Date.now());ut(ye,"defaultProps",{interactive:!1,options:{},popperClassName:"",reshowTimeout:ye.defaultReshowTimeout,timeout:ye.defaultTimeout,onEntered:()=>{},onExited:()=>{},"data-testid":void 0});const qt=ye;var Hu=V.module("ThemeProvider"),Es=m.createContext(null);function jy(r){var{themes:e,defaultPreloadValues:t=sd,children:n}=r,i=m.useMemo(()=>ed(),[]),[o,a]=m.useState(null),[s,l]=m.useState(()=>{var c,f;return(c=(f=td())===null||f===void 0?void 0:f.themeKey)!==null&&c!==void 0?c:nd}),d=m.useMemo(()=>e==null?null:rd(s,{base:i,custom:e??[]}),[i,s,e]),h=m.useMemo(()=>[...i,...e??[]],[i,e]);return m.useEffect(function(){if(!(d==null||e==null)){id(t);var f=od(t);Hu.debug2("updateThemePreloadData:",{active:d.map(v=>v.themeKey),custom:e.map(v=>v.themeKey),preloadStyleContent:f,selectedThemeKey:s}),ad({themeKey:s,preloadStyleContent:f})}},[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(Es.Provider,{value:o,children:u.jsx(Za,{children:n})})]})}function _s(){return tr(Es,"No ThemeContext value found. Component must be wrapped in a ThemeContext.Provider")}function $r(r){var{children:e,className:t,style:n,"data-testid":i}=r;return u.jsx("div",{className:X("btn-group",t),style:n,role:"group","data-testid":i,children:e})}$r.displayName="SplitButtonGroup";$r.propTypes={children:S.node.isRequired,className:S.string,style:S.object,"data-testid":S.string};$r.defaultProps={className:null,style:{},"data-testid":void 0};var Bu=["kind","variant","type","tooltip","icon","disabled","active","onClick","onContextMenu","onMouseDown","onMouseUp","onMouseEnter","onMouseLeave","onKeyDown","className","style","children","tabIndex","data-testid","aria-label"];function oo(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,n)}return t}function ao(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?oo(Object(t),!0).forEach(function(n){Wu(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):oo(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function Wu(r,e,t){return e=Uu(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Uu(r){var e=Vu(r,"string");return typeof e=="symbol"?e:String(e)}function Vu(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}function Ku(r,e){if(r==null)return{};var t=zu(r,e),n,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(r);for(i=0;i<o.length;i++)n=o[i],!(e.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(r,n)&&(t[n]=r[n])}return t}function zu(r,e){if(r==null)return{};var t={},n=Object.keys(r),i,o;for(o=0;o<n.length;o++)i=n[o],!(e.indexOf(i)>=0)&&(t[i]=r[i]);return t}var Gu=["primary","secondary","tertiary","success","danger","inline","ghost"],qu=["group-end"];function Zu(r,e){switch(r){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 Xu(r){switch(r){case"group-end":return X("pl-2","pr-3")}}var se=H.forwardRef((r,e)=>{var{kind:t,variant:n,type:i,tooltip:o,icon:a,disabled:s=!1,active:l,onClick:d,onContextMenu:h,onMouseDown:c,onMouseUp:f,onMouseEnter:v,onMouseLeave:p,onKeyDown:g,className:y,style:P,children:O,tabIndex:_,"data-testid":k,"aria-label":W}=r,Q=Ku(r,Bu),{UNSAFE_className:N}=zl({},"button"),B;n&&(B=Xu(n));var j;a&&(j=H.isValidElement(a)?a:u.jsx(ue,{icon:a}));var Y=j!=null&&O==null,ne=Zu(t,Y),F;o!==void 0&&(F=typeof o=="string"?u.jsx(qt,{children:o}):o);var q=W;W===void 0&&Y&&o!=null&&typeof o=="string"&&(q=o);var K=u.jsxs("button",ao(ao({"data-testid":k,ref:e,type:i,className:X("btn",ne,B,{active:l},y,N),onClick:d,onContextMenu:h,onMouseUp:f,onMouseDown:c,onMouseEnter:v,onMouseLeave:p,onKeyDown:g,style:P,disabled:s,tabIndex:_,"aria-label":q},Q),{},{children:[a&&j,O,o!=null&&!s&&F]}));return s&&o!=null?u.jsxs("span",{className:"btn-disabled-wrapper",children:[K,F]}):K});se.displayName="Button";se.propTypes={kind:S.oneOf(Gu).isRequired,variant:S.oneOf(qu),type:S.oneOf(["submit","reset","button"]),tooltip(r){var{tooltip:e,icon:t,children:n}=r;return e===void 0&&t!=null&&n==null?new Error("Tooltip is required for icon only buttons"):null},icon(r){var{children:e,icon:t}=r;return t==null&&e==null?new Error("Icon is required if no children are provided"):e==null&&!H.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(r){var{onClick:e,type:t}=r;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};se.defaultProps={type:"button",onClick:void 0,onContextMenu:void 0,onMouseUp:void 0,onMouseDown:void 0,onMouseEnter:void 0,onMouseLeave:void 0,onKeyDown:void 0,variant:void 0,tooltip:void 0,icon:void 0,disabled:!1,active:void 0,tabIndex:void 0,children:void 0,className:void 0,style:{},"data-testid":void 0};const En=se;function Ps(r){var{className:e,children:t,"data-testid":n}=r;return u.jsx("div",{className:X("modal-footer",e),"data-testid":n,children:t})}function ln(r){var{isOpen:e,headerText:t,bodyText:n,onCancel:i,onConfirm:o,onDiscard:a,onModalDisable:s,cancelButtonText:l="Cancel",confirmButtonText:d="Okay",discardButtonText:h="Discard",isConfirmDanger:c=!1,children:f,"data-testid":v}=r,p=m.useRef(null),g=m.useRef(null),y=m.useCallback(()=>{g.current!==null&&g.current.checked&&s&&s(),o()},[o,s]),P=m.useCallback(()=>{var _;(_=p.current)===null||_===void 0||_.focus()},[]),O="";return e&&(O=typeof n=="function"?n():n),u.jsxs(Ya,{isOpen:e,onOpened:P,children:[u.jsx(Qa,{closeButton:!1,children:t}),u.jsx(Ja,{children:O}),u.jsxs(Ps,{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:g,"data-testid":v!==void 0?"".concat(v,"-checkbox-confirm"):void 0}),u.jsx("label",{className:"custom-control-label",htmlFor:"move-confirmation-checkbox",children:"Don't ask me again"})]}),a&&u.jsx(En,{kind:"secondary",className:"mr-auto","data-dismiss":"modal",onClick:a,"data-testid":v!==void 0?"".concat(v,"-btn-discard"):void 0,children:h}),i&&u.jsx(En,{kind:"secondary","data-dismiss":"modal",onClick:i,"data-testid":v!==void 0?"".concat(v,"-btn-cancel"):void 0,children:l}),u.jsxs($r,{children:[u.jsx(En,{kind:c?"danger":"primary",onClick:y,ref:p,"data-testid":v!==void 0?"".concat(v,"-btn-confirm"):void 0,children:d}),f]})]})]})}ln.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};ln.defaultProps={children:void 0,cancelButtonText:"Cancel",confirmButtonText:"Okay",discardButtonText:"Discard",onCancel:void 0,onDiscard:void 0,onModalDisable:void 0,"data-testid":void 0};function Yu(r,e,t){return e=Qu(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Qu(r){var e=Ju(r,"string");return typeof e=="symbol"?e:String(e)}function Ju(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}function ei(r){return r.then!==void 0}class Wt{static disableAllActions(){Wt.actionsDisabled=!0}static enableAllActions(){Wt.actionsDisabled=!1}static isContextActionEvent(e){return Array.isArray(e.contextActions)}static compareActions(e,t){if(e.group!==t.group){var n,i;return((n=e.group)!==null&&n!==void 0?n: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(Wt.compareActions),t}static isMacPlatform(){var{platform:e}=window.navigator;return e.startsWith("Mac")}static getModifierKey(){return Wt.isMacPlatform()?"metaKey":"ctrlKey"}static isModifierKeyDown(e){var t=Wt.getModifierKey();return e[t]}static getMenuItems(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,n=[],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&&n.push(s):Array.isArray(s)?n=n.concat(s):n.push(s))}return n=n.filter(l=>l.title!==void 0||l.then!=null||l.menuElement),n}static getNextMenuItem(e,t,n){var i=e;i<0&&t<0&&(i=n.length);for(var o=1;o<n.length+1;o+=1){var a=(i+t*o+n.length)%n.length,s=n[a];if(!(s instanceof Promise)&&s.disabled!==!0)return a}return e}}Yu(Wt,"actionsDisabled",!1);const Xe=Wt;var so=V.module("GlobalContextAction");class eh 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:n}=this.props;n.title==null&&!n.menuElement||(t.contextActions==null&&(t.contextActions=[]),t.contextActions.push(n),so.debug("Received context menu event at global action! Menu items are now: ",t.contextActions))}handleKeyDown(e){var{action:t}=this.props;if(!Xe.actionsDisabled&&t.shortcut!==void 0&&t.shortcut.matchesEvent(e)){var n;so.debug("Global hotkey matched!",e),(n=t.action)===null||n===void 0||n.call(t,e),e.preventDefault(),e.stopPropagation()}}render(){return null}}const th=eh;class nh extends m.Component{render(){for(var{actions:e,"data-testid":t}=this.props,n=[],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(th,{action:o,"data-testid":t},"".concat(o.title,".").concat(a?.id));n.push(s)}}return n}}const rh=nh;function Ts(r,e,t){return e=ih(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function ih(r){var e=oh(r,"string");return typeof e=="symbol"?e:String(e)}function oh(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}var mr=V.module("ContextActions");class Os extends m.Component{static triggerMenu(e,t,n,i){if(i.length!==0){var o=new MouseEvent("contextmenu",{clientX:t,clientY:n,bubbles:!0,cancelable:!0});o.contextActions=i,e.dispatchEvent(o)}}constructor(e){super(e),Ts(this,"container",void 0),this.handleContextMenu=this.handleContextMenu.bind(this),this.handleKeyDown=this.handleKeyDown.bind(this),this.container=H.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=>!ei(i)&&typeof i!="function"&&i.isGlobal),n=e.actions.filter(i=>!ei(i)&&typeof i!="function"&&(i.isGlobal===void 0||!i.isGlobal)&&i.shortcut!=null);return{globalActions:t,keyboardActions:n}}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 n=e.target,i=function(){var{classList:d}=n,h=t.find(c=>d.contains(c));if(h!==void 0)return mr.debug2('Contextmenu event ignored based on the target className "'.concat(h,'"')),{v:void 0};n=n.parentElement};n!=null;){var o=i();if(typeof o=="object")return o.v}if(Xe.isContextActionEvent(e)||(e.contextActions=[]),!!Xe.isContextActionEvent(e)){var{actions:a}=this.props;if(a!=null){var s=a;Array.isArray(s)&&(s=s.filter(l=>ei(l)||typeof l=="function"||l.isGlobal===void 0||!l.isGlobal)),e.contextActions=e.contextActions.concat(s)}mr.debug("Received context menu event! Menu items are now: ",e.contextActions)}}handleKeyDown(e){for(var{keyboardActions:t}=this.state,n=0;n<t.length;n+=1){var i=t[n];if(!Xe.actionsDisabled&&i.shortcut!=null&&i.shortcut.matchesEvent(e)){var o;mr.debug("Context hotkey matched!",e),(o=i.action)===null||o===void 0||o.call(i,e),e.stopPropagation(),e.preventDefault(),mr.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(rh,{actions:t})})}}Ts(Os,"groups",{default:void 0,high:100,medium:5e3,low:1e4,global:1e5,edit:100});const ee=Os;var xi=H.forwardRef((r,e)=>{var t,n;function i(N){var{menuItem:B,onMenuItemClick:j}=r;j(B,N)}function o(N){var{menuItem:B,onMenuItemMouseMove:j}=r;j(B,N)}function a(N){var{menuItem:B,onMenuItemContextMenu:j}=r;j(B,N)}function s(N,B,j){if(typeof N.type=="string")return N;var{closeMenu:Y,menuItem:ne,isKeyboardSelected:F,isMouseSelected:q,"data-testid":K}=r,A={menuItem:ne,closeMenu:Y,isKeyboardSelected:F,isMouseSelected:q,iconElement:B,displayShortcut:j,"data-testid":K};return H.cloneElement(N,{forwardedProps:A})}var{children:l,menuItem:d,isKeyboardSelected:h=!1,isMouseSelected:c=!1,"data-testid":f}=r,v=(t=d.shortcutText)!==null&&t!==void 0?t:(n=d.shortcut)===null||n===void 0?void 0:n.getDisplayText(),p=null;if(d.icon){var g=d.icon;if(H.isValidElement(g))p=g;else{var y;d.iconColor!=null&&(d.disabled===void 0||!d.disabled)&&(y={color:d.iconColor}),p=u.jsx(ue,{icon:g,style:y})}}var P=null,O=!!l;d.actions&&(P=u.jsx(ue,{icon:ld}));var _=null;if(d.menuElement)_=u.jsx("div",{className:"custom-menu-item",onMouseMove:o,children:s(d.menuElement,p,v)});else{var k,W=d.disabled,Q=d.iconOutline;_=u.jsx("button",{type:"button",className:X("btn-context-menu",{disabled:W},{active:(O||c)&&(W===void 0||!W)},{"keyboard-active":h&&(W===void 0||!W)}),onClick:i,onMouseMove:o,onContextMenu:a,title:(k=d.description)!==null&&k!==void 0?k:"",children:u.jsxs("div",{className:"btn-context-menu-wrapper",children:[u.jsx("span",{className:X("icon",{outline:Q}),children:p}),u.jsx("span",{className:"title",children:d.title}),v!==void 0&&u.jsx("span",{className:"shortcut",children:v}),P&&u.jsx("span",{className:X("submenu-indicator",{disabled:W}),children:P})]})})}return u.jsxs("div",{className:"context-menu-item",ref:e,"data-testid":f,children:[l,_]})});xi.displayName="ContextMenuItem";xi.defaultProps={children:null,isKeyboardSelected:!1,isMouseSelected:!1,"data-testid":void 0};const ah=xi;var Hr=H.forwardRef((r,e)=>{var{checked:t=!1,children:n,className:i,disabled:o,inputClassName:a,isInvalid:s,labelClassName:l,name:d,onChange:h,"data-testid":c}=r,[f]=m.useState(zt()),v=ws(e);m.useEffect(function(){v.current&&(v.current.indeterminate=t===null)},[v,t]);var p=m.useCallback(g=>{v.current&&(v.current.indeterminate=t===null),h&&h(g)},[v,t,h]);return u.jsxs("div",{className:X("custom-control custom-checkbox",i),children:[u.jsx("input",{type:"checkbox",ref:v,checked:t??!1,className:X("custom-control-input",a,{"is-invalid":s}),disabled:o,id:f,name:d,onChange:p,"data-testid":c}),u.jsx("label",{className:X("custom-control-label",l),htmlFor:f,children:n})]})});Hr.displayName="Checkbox";Hr.propTypes={checked:(r,e)=>{var{[e]:t}=r;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};Hr.defaultProps={checked:!1,className:"",disabled:!1,inputClassName:"",isInvalid:!1,labelClassName:"",name:void 0,onChange:void 0,"data-testid":void 0};const sh=Hr;function Ir(r){return r?.WrappedComponent!==void 0}function Is(r){return Ir(r)&&Is(r.WrappedComponent)?!0:r.prototype!=null&&r.prototype.isReactComponent!=null}function lh(r){return!Ir(r)&&"$$typeof"in r&&r.$$typeof===Gl.ForwardRef}function dh(r){return Is(r)||lh(r)}function $y(r){var{copy:e,kind:t="ghost",tooltip:n="Copy",className:i,style:o,"data-testid":a,children:s}=r,[l,d]=Nu();return u.jsx(En,{kind:t,className:i,style:o,"data-testid":a,icon:l?dd:es,tooltip:l?"Copied":n,onClick:()=>{d(typeof e=="function"?e():e)},children:s})}function lo(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,n)}return t}function uh(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?lo(Object(t),!0).forEach(function(n){Kn(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):lo(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function Kn(r,e,t){return e=hh(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function hh(r){var e=ch(r,"string");return typeof e=="symbol"?e:String(e)}function ch(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class Ds 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=H.createRef(),this.oldFocus=document.activeElement,this.rAF=0;var{options:n}=e,i=(t=n.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=Xe.getMenuItems(e,!1);t.length>0&&this.setState(n=>({menuItems:Xe.sortActions(n.menuItems.concat(t))}))}handleKeyDown(e){var{menuItems:t}=this.state,n=this.getKeyboardIndex(),i=n;if(e.key==="Enter"||e.key===" "){n!=null&&n>=0&&n<t.length&&this.handleMenuItemClick(t[n],e);return}if(e.key==="Escape")i=null;else if(e.key==="ArrowUp"||e.key==="Tab"&&e.shiftKey===!0){var o;i=Xe.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=Xe.getNextMenuItem((a=i)!==null&&a!==void 0?a:0,1,t)}n!==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:n}=this.props;cancelAnimationFrame(this.rAF),this.rAF=window.requestAnimationFrame(()=>{t(e),n(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,n=t.indexOf(e);this.setMouseIndex(n)}handleMouseLeave(){this.setMouseIndex(-1)}render(){for(var e=[],{"data-testid":t}=this.props,{keyboardIndex:n,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(ah,{isKeyboardSelected:n===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:uh({},d),ref:this.container,onKeyDown:this.handleKeyDown,onMouseLeave:this.handleMouseLeave,role:"menuitem",tabIndex:0,"data-testid":t,children:e})}}Kn(Ds,"defaultProps",{closeMenu(){},onMenuOpened(){},onMenuClosed(){},options:{},menuStyle:{},"data-testid":void 0});const mh=Ds;function uo(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,n)}return t}function ho(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?uo(Object(t),!0).forEach(function(n){yn(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):uo(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function yn(r,e,t){return e=fh(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function fh(r){var e=vh(r,"string");return typeof e=="symbol"?e:String(e)}function vh(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class xs extends m.PureComponent{constructor(e){super(e),yn(this,"container",void 0),yn(this,"parent",void 0),yn(this,"popper",void 0),yn(this,"isOpen",void 0),this.handleClick=this.handleClick.bind(this),this.handleCloseMenu=this.handleCloseMenu.bind(this),this.handleExited=this.handleExited.bind(this),this.container=H.createRef(),this.parent=null,this.popper=H.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:n,"data-testid":i}=this.props,{menuStyle:o}=this.props,{options:a,popperOptions:s}=this.props;return s=ho({placement:"bottom"},s),a=ho({separateKeyboardMouse:!0},a),u.jsx("div",{className:"menu-actions-listener",ref:this.container,"data-testid":i,children:u.jsx(Di,{ref:this.popper,options:s,className:X("menu-popper",n),onExited:this.handleExited,closeOnBlur:!0,interactive:!0,children:u.jsx(mh,{actions:e,closeMenu:this.handleCloseMenu,onMenuOpened:t,options:a,menuStyle:o})})})}}yn(xs,"defaultProps",{isShown:null,onMenuClosed(){},onMenuOpened(){},options:{},popperOptions:{},popperClassName:"",menuStyle:{},"data-testid":void 0});const zn=xs;function jt(r,e,t){return e=gh(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function gh(r){var e=ph(r,"string");return typeof e=="symbol"?e:String(e)}function ph(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}var co=V.module("Shortcut"),L;(function(r){r.CTRL="MODIFIER_CTRL",r.CMD="MODIFIER_CMD",r.ALT="MODIFIER_ALT",r.OPTION="MODIFIER_OPTION",r.SHIFT="MODIFIER_SHIFT"})(L||(L={}));var D;(function(r){r.A="A",r.B="B",r.C="C",r.D="D",r.E="E",r.F="F",r.G="G",r.H="H",r.I="I",r.J="J",r.K="K",r.L="L",r.M="M",r.N="N",r.O="O",r.P="P",r.Q="Q",r.R="R",r.S="S",r.T="T",r.U="U",r.V="V",r.W="W",r.X="X",r.Y="Y",r.Z="Z",r.ZERO="0",r.ONE="1",r.TWO="2",r.THREE="3",r.FOUR="4",r.FIVE="5",r.SIX="6",r.SEVEN="7",r.EIGHT="8",r.NINE="9",r.BACKSPACE="Backspace",r.ESCAPE="Escape",r.ENTER="Enter",r.DELETE="Delete",r.SLASH="/",r.QUESTION_MARK="?",r.BACKSLASH="\\",r.PIPE="|",r.MINUS="-",r.UNDERSCORE="_",r.EQUALS="=",r.PLUS="+",r.BACKTICK="`",r.TILDE="~",r.COMMA=",",r.LEFT_CHEVRON="<",r.PERIOD=".",r.RIGHT_CHEVRON=">",r.SEMICOLON=";",r.COLON=":",r.SINGLE_QUOTE="'",r.DOUBLE_QUOTE='"',r.LEFT_BRACKET="[",r.RIGHT_BRACKET="]",r.LEFT_CURLY="{",r.RIGHT_CURLY="}",r.F1="F1",r.F2="F2",r.F3="F3",r.F4="F4",r.F5="F5",r.F6="F6",r.F7="F7",r.F8="F8",r.F9="F9",r.F10="F10",r.F11="F11",r.F12="F12"})(D||(D={}));var bh=new Set([D.ENTER,D.DELETE,D.F1,D.F2,D.F3,D.F4,D.F5,D.F6,D.F7,D.F8,D.F9,D.F10,D.F11,D.F12]);class ge extends Ga{static isAllowedKey(e){return Object.values(D).includes(e)}static isValidKeyState(e){var{keyValue:t}=e;if(t===null)return!0;if(!ge.isMacPlatform&&e.metaKey||!ge.isAllowedKey(t))return!1;var n=!e.altKey&&!e.ctrlKey&&!e.metaKey&&!e.shiftKey;return!n||bh.has(t)}static createKeyState(e){var t={altKey:!1,ctrlKey:!1,metaKey:!1,shiftKey:!1,keyValue:e[e.length-1]};return e.forEach(n=>{switch(n){case L.CTRL:t.ctrlKey=!0;break;case L.ALT:case L.OPTION:t.altKey=!0;break;case L.CMD:t.metaKey=!0;break;case L.SHIFT:t.shiftKey=!0;break}}),t}static getKeyStateFromEvent(e){var{key:t,keyCode:n}=e,i="";return t==="Shift"||t==="Meta"||t==="Control"||t==="Alt"?i="":!ge.isAllowedKey(t)&&ge.isAllowedKey(String.fromCharCode(n))?i=String.fromCharCode(n):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===D.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 D.ENTER:t+="⏎";break;case D.ESCAPE:t+="⎋";break;case D.BACKSPACE:t+="⌫";break;case D.DELETE:t+="⌦";break;case null:break;default:t+=e.keyValue}return t}static doKeyStatesMatch(e,t){var n,i;return((n=e.keyValue)===null||n===void 0?void 0:n.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?"":ge.isMacPlatform?ge.getMacDisplayText(e):ge.getWindowsDisplayText(e)}constructor(e){var{id:t,shortcut:n,macShortcut:i,isEditable:o=!0,name:a,tooltip:s}=e;super(),jt(this,"id",void 0),jt(this,"name",void 0),jt(this,"tooltip",void 0),jt(this,"isEditable",void 0),jt(this,"defaultKeyState",void 0),jt(this,"keyState",void 0),this.id=t,this.name=a,this.tooltip=s,this.isEditable=o;var l=ge.isMacPlatform,d=l?i:n;this.defaultKeyState=ge.createKeyState(d),this.keyState=this.defaultKeyState}getDisplayText(){return ge.getDisplayText(this.keyState)}getKeyState(){return this.keyState}setKeyState(e){ge.isValidKeyState(e)?(co.debug2("Shortcut ".concat(this.id," updated to ").concat(JSON.stringify(e))),this.keyState=e,this.dispatchEvent(new gs("onUpdate",{detail:this}))):co.debug2("Shortcut ".concat(this.id," tried to update to invalid keyState ").concat(JSON.stringify(e)))}getDefaultKeyState(){return this.defaultKeyState}isDefault(){return ge.doKeyStatesMatch(this.getDefaultKeyState(),this.getKeyState())}setToNull(){this.setKeyState(ge.NULL_KEY_STATE)}isNull(){return ge.doKeyStatesMatch(this.keyState,ge.NULL_KEY_STATE)}setToDefault(){this.setKeyState(this.defaultKeyState)}matchesKeyState(e){return ge.doKeyStatesMatch(e,this.keyState)}matchesEvent(e){return this.matchesKeyState(ge.getKeyStateFromEvent(e))}}jt(ge,"NULL_KEY_STATE",{metaKey:!1,shiftKey:!1,altKey:!1,ctrlKey:!1,keyValue:null});jt(ge,"isMacPlatform",Xe.isMacPlatform());function mo(r,e,t){return e=yh(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function yh(r){var e=Ch(r,"string");return typeof e=="symbol"?e:String(e)}function Ch(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}var fo=V.module("ShortcutRegistry");class Sh extends Ga{constructor(){super(...arguments),mo(this,"shortcutMap",new Map),mo(this,"shortcutsByCategory",new Map)}createAndAdd(e){var t=new ge(e);return this.add(t)}add(e){var t=this.shortcutMap.get(e.id);if(t)return fo.warn("Skipping attempt to add duplicate shortcut ID to registry: ".concat(e.id)),t;fo.debug2("Adding shortcut to registry: ".concat(e.id)),e.addEventListener("onUpdate",o=>{var{detail:a}=o;return this.dispatchEvent(new gs("onUpdate",{detail:a}))});var n=e.id.split(".")[0];if(this.shortcutMap.set(e.id,e),this.shortcutsByCategory.has(n)){var i;(i=this.shortcutsByCategory.get(n))===null||i===void 0||i.push(e)}else this.shortcutsByCategory.set(n,[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 wh=Object.freeze(new Sh);const ce=wh;var Eh={COPY:ce.createAndAdd({id:"GLOBAL.COPY",name:"Copy",shortcut:[L.CTRL,D.C],macShortcut:[L.CMD,D.C],isEditable:!1}),PASTE:ce.createAndAdd({id:"GLOBAL.PASTE",name:"Paste",shortcut:[L.CTRL,D.V],macShortcut:[L.CMD,D.V],isEditable:!1}),SAVE:ce.createAndAdd({id:"GLOBAL.SAVE",name:"Save",shortcut:[L.CTRL,D.S],macShortcut:[L.CMD,D.S],isEditable:!1}),SELECT_ALL:ce.createAndAdd({id:"GLOBAL.SELECT_ALL",name:"Select All",shortcut:[L.CTRL,D.A],macShortcut:[L.CMD,D.A],isEditable:!1}),REOPEN_CLOSED_PANEL:ce.createAndAdd({id:"GLOBAL.REOPEN_CLOSED_PANEL",name:"Re-open Closed Panel",shortcut:[L.ALT,L.SHIFT,D.T],macShortcut:[L.OPTION,L.SHIFT,D.T],isEditable:!0}),LINKER:ce.createAndAdd({id:"GLOBAL.LINKER",name:"Linker",shortcut:[L.CTRL,D.L],macShortcut:[L.CMD,D.L]}),LINKER_CLOSE:ce.createAndAdd({id:"GLOBAL.LINKER_CLOSE",name:"Close Linker Overlay",shortcut:[D.ESCAPE],macShortcut:[D.ESCAPE],isEditable:!1}),COPY_VERSION_INFO:ce.createAndAdd({id:"GLOBAL.COPY_VERSION_INFO",name:"Copy Version Info",shortcut:[L.CTRL,L.ALT,D.I],macShortcut:[L.CMD,L.SHIFT,D.I],isEditable:!0}),NEXT:ce.createAndAdd({id:"GLOBAL.NEXT",name:"Next",shortcut:[D.ENTER],macShortcut:[D.ENTER],isEditable:!1}),PREVIOUS:ce.createAndAdd({id:"GLOBAL.PREVIOUS",name:"Previous",shortcut:[L.SHIFT,D.ENTER],macShortcut:[L.SHIFT,D.ENTER],isEditable:!1})};const Vt=Eh;function ci(r,e,t){return e=_h(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function _h(r){var e=Ph(r,"string");return typeof e=="symbol"?e:String(e)}function Ph(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class Ms extends m.PureComponent{constructor(e){super(e),ci(this,"inputField",void 0),ci(this,"searchChangeSelection",void 0),this.inputField=H.createRef(),this.searchChangeSelection=H.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 n=t.getBoundingClientRect().width;e.style.paddingRight="".concat(n,"px")}}render(){var{value:e,placeholder:t,onBlur:n,onChange:i,className:o,disabled:a,matchCount:s,id:l,onKeyDown:d,"data-testid":h,cursor:c}=this.props,f,v=[{action:()=>c?.next("forward"),shortcut:Vt.NEXT},{action:()=>c?.next("back"),shortcut:Vt.PREVIOUS}];return c&&s>1?f=u.jsxs(u.Fragment,{children:[u.jsx(En,{kind:"ghost",className:"search-change-button",type:"button",onClick:()=>{c.next("back")},icon:ts,tooltip:"Previous match (".concat(Vt.PREVIOUS.getDisplayText(),")")}),u.jsxs("span",{className:"search-change-text",children:[c.index!==void 0&&"".concat(c.index+1," of "),s]}),u.jsx(En,{kind:"ghost",className:"search-change-button",type:"button",onClick:()=>{c.next("forward")},icon:ud,tooltip:"Next match (".concat(Vt.NEXT.getDisplayText(),")")})]}):f=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:n,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:f}),u.jsx(ee,{actions:v})]}):u.jsx("span",{className:"search-icon",children:u.jsx(ue,{icon:hd})})]})}}ci(Ms,"defaultProps",{placeholder:"Search",className:"",matchCount:null,onKeyDown(){},id:"","data-testid":void 0,cursor:void 0});const Mi=Ms;function Ns(r,e,t){return e=Th(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Th(r){var e=Oh(r,"string");return typeof e=="symbol"?e:String(e)}function Oh(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class As extends m.PureComponent{constructor(e){super(e),Ns(this,"searchInput",void 0),this.searchInput=H.createRef(),this.handleChange=this.handleChange.bind(this),this.sendUpdate=_n(this.sendUpdate.bind(this),e.debounceMs),this.state={value:e.value}}componentDidUpdate(e){var{value:t}=this.props;e.value!==t&&this.setState({value:t})}focus(){var e;(e=this.searchInput.current)===null||e===void 0||e.focus()}handleChange(e){this.setState({value:e.target.value},this.sendUpdate)}sendUpdate(){var{onChange:e}=this.props,{value:t}=this.state;e(t)}render(){var{placeholder:e,className:t,matchCount:n,id:i,"data-testid":o}=this.props,{value:a}=this.state;return u.jsx(Mi,{value:a,placeholder:e,onChange:this.handleChange,className:t,matchCount:n,ref:this.searchInput,id:i,"data-testid":o})}}Ns(As,"defaultProps",{placeholder:"Search",className:"",matchCount:null,debounceMs:250,id:"","data-testid":void 0});const Ih=As;function Ls(r,e,t){return e=Dh(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Dh(r){var e=xh(r,"string");return typeof e=="symbol"?e:String(e)}function xh(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}var Mh=V.module("ItemListItem");class Br extends m.Component{static handleKeyDown(){return Mh.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=H.createRef()}handleBlur(e){var{itemIndex:t,onBlur:n}=this.props;n(t,e)}handleFocus(e){var{itemIndex:t,onFocus:n}=this.props;n(t,e)}handleClick(e){var{itemIndex:t,onClick:n}=this.props;n(t,e)}handleContextMenu(e){var{itemIndex:t,onContextMenu:n}=this.props;n(t,e)}handleDragStart(e){var{itemIndex:t,onDragStart:n}=this.props;n(t,e)}handleDrag(e){var{itemIndex:t,onDrag:n}=this.props;n(t,e)}handleDragOver(e){e.preventDefault();var{itemIndex:t,onDragOver:n}=this.props;n(t,e)}handleDragEnd(e){var{itemIndex:t,onDragEnd:n}=this.props;n(t,e)}handleDrop(e){var{itemIndex:t,onDrop:n}=this.props;n(t,e)}handleDoubleClick(e){var{itemIndex:t,onDoubleClick:n}=this.props;n(t,e)}handleMouseMove(e){var{itemIndex:t,onMouseMove:n}=this.props;n(t,e)}handleMouseDown(e){var{itemIndex:t,onMouseDown:n}=this.props;n(t,e)}handleMouseUp(e){var{itemIndex:t,onMouseUp:n}=this.props;n(t,e)}render(){var{isDraggable:e,isFocused:t,isSelected:n,style:i,children:o,"data-testid":a}=this.props;return u.jsx("div",{className:X("item-list-item",{active:n},{"is-focused":t},{"is-draggable":e}),onKeyDown:Br.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(Br,"defaultProps",{children:null,isDraggable:!1,isFocused:!1,isSelected:!1,itemIndex:0,"data-testid":void 0,onBlur(){},onClick(){},onContextMenu(){},onDragStart(){},onDrag(){},onDragOver(){},onDragEnd(){},onDrop(){},onDoubleClick(){},onFocus(){},onMouseDown(){},onMouseMove(){},onMouseUp(){},style:{}});const Nh=Br;function vo(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,n)}return t}function go(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?vo(Object(t),!0).forEach(function(n){rt(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):vo(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function rt(r,e,t){return e=Ah(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Ah(r){var e=Lh(r,"string");return typeof e=="symbol"?e:String(e)}function Lh(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}var po=V.module("ItemList"),bo=5;class Ye extends m.PureComponent{static renderItem(e){var t,n,{item:i}=e;return u.jsx("div",{className:"item-list-item-content",children:i!=null&&((t=(n=i.displayValue)!==null&&n!==void 0?n:i.value)!==null&&t!==void 0?t:"".concat(i))})}constructor(e){super(e),rt(this,"list",void 0),rt(this,"listContainer",void 0),rt(this,"getItemSelected",pn((i,o)=>It.isSelected(o,i),{max:Ye.CACHE_SIZE})),rt(this,"getCachedItem",pn((i,o,a,s,l,d,h,c)=>{var f=d({item:a,itemIndex:i,isFocused:s,isSelected:l,style:h});return u.jsx(Nh,{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:f},o)},{max:Ye.CACHE_SIZE})),rt(this,"getOuterElement",pn(i=>{var o=H.forwardRef((a,s)=>u.jsx("div",go({ref:s,tabIndex:-1,onKeyDown:i,role:"presentation"},a)));return o.displayName="ItemListOuterElement",o})),rt(this,"getInnerElement",pn(()=>{var i=H.forwardRef((o,a)=>u.jsx("div",go({className:"item-list-inner-element",ref:a},o)));return i.displayName="ItemListInnerElement",i})),rt(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=H.createRef(),this.listContainer=H.createRef();var{isStickyBottom:t,selectedRanges:n}=e;this.state={focusIndex:null,mouseDownIndex:null,selectedRanges:n,overscanStartIndex:0,height:null,isDragging:!1,isStuckToBottom:t,scrollOffset:null,mouseX:null,mouseY:null}}componentDidUpdate(e,t){var{selectedRanges:n,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(),n!==e.selectedRanges&&n!==d)this.setSelectedRanges(n);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:n}=this.state,i=this.listContainer.current.querySelectorAll(t),o=e-n;return i[o]}focusItem(e){var{disableSelect:t}=this.props;if(!t){this.setState({focusIndex:e});var n=this.getElement(e);n instanceof HTMLElement&&n.focus()}}scrollToItem(e){var t=this.getElement(e);t?.scrollIntoView({block:"center"})}handleItemContextMenu(e,t){this.setState({focusIndex:e});var{selectedRanges:n}=this.state,i=It.isSelected(n,e),o=i||Xe.isModifierKeyDown(t);this.toggleSelect(e,t.shiftKey,o,!1)}handleItemDoubleClick(e,t){var{isDoubleClickSelect:n,onSelect:i}=this.props;n&&this.setState(o=>{var{selectedRanges:a}=o;return{selectedRanges:It.selectRange(a,[e,e])}},()=>{i(e,t)})}handleItemMouseDown(e,t){var{selectedRanges:n}=this.state;if(!(t.target instanceof HTMLElement&&["button","select","input","textarea"].indexOf(t.target.tagName.toLowerCase())!==-1)){if(t.button===2&&n.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){po.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){po.debug2("item focus",e,t.target),this.setState(n=>{var{focusIndex:i}=n;return i!==e?{focusIndex:e}:null})}handleItemMouseMove(e,t){var{isDragSelect:n,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>bo&&c>bo&&this.setState({isDragging:!0}),(n||a===e)&&(this.focusItem(e),i?(!n&&!this.getItemSelected(e,s)&&!Xe.isModifierKeyDown(t)&&this.deselectAll(),this.selectRange([Math.min(a,e),Math.max(a,e)])):this.toggleSelect(e,t.shiftKey,Xe.isModifierKeyDown(t),!1))}}handleItemMouseUp(e,t){var{isDeselectOnClick:n,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=Xe.isModifierKeyDown(t);this.focusItem(e),this.toggleSelect(e,l,d,n),!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:n,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=n-1;else if(e.key==="ArrowDown")a!=null&&a>=0?a=Math.min(a+1,n-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:n}=e;this.setState(i=>{if(t)return{scrollOffset:n};var{isStickyBottom:o}=this.props,{height:a}=i,s=o&&this.isListAtBottom({scrollOffset:n,height:a});return{isStuckToBottom:s,scrollOffset:n}})}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,n){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&&n?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){It.validateRange(e),this.setState(t=>{var{selectedRanges:n}=t;return{selectedRanges:It.deselectRange(n,e)}})}selectItem(e){var{disableSelect:t}=this.props;t||this.selectRange([e,e])}selectRange(e){It.validateRange(e),this.setState(t=>{var{selectedRanges:n}=t;return{selectedRanges:It.selectRange(n,e)}})}setSelectedRanges(e){this.setState({selectedRanges:e})}sendViewportUpdate(){var{scrollOffset:e,height:t}=this.state;if(e!=null&&t!=null){var{onViewportChange:n,rowHeight:i}=this.props,o=Math.floor(e/i),a=o+Math.ceil(t/i);n(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:n,rowHeight:i}=this.props;return e+t>=n*i}renderInnerElement(e){var{index:t,style:n}=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,n,s)}render(){var{items:e,itemCount:t,overscanCount:n,renderItem:i,rowHeight:o,"data-testid":a}=this.props,{selectedRanges:s,isStuckToBottom:l}=this.state;return u.jsx(ql,{className:"item-list-auto-sizer",onResize:this.handleResize,children:d=>{var{width:h,height:c}=d;return u.jsx(Zl,{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:n,"data-testid":a,children:this.renderInnerElement})}})}}rt(Ye,"CACHE_SIZE",1e3);rt(Ye,"DEFAULT_ROW_HEIGHT",20);rt(Ye,"DEFAULT_OVERSCAN",10);rt(Ye,"defaultProps",{offset:0,items:[],rowHeight:Ye.DEFAULT_ROW_HEIGHT,isDeselectOnClick:!0,isDoubleClickSelect:!1,isDragSelect:!0,isMultiSelect:!1,isStickyBottom:!1,disableSelect:!1,onFocusChange(){},onSelect(){},onSelectionChange(){},onViewportChange(){},overscanCount:Ye.DEFAULT_OVERSCAN,renderItem:Ye.renderItem,selectedRanges:[],focusSelector:".item-list-item","data-testid":void 0});var Fh=V.module("ErrorBoundary");class kh extends m.Component{static getDerivedStateFromError(e){return{error:e}}constructor(e){super(e),this.state={error:void 0}}componentDidCatch(e,t){var{onError:n}=this.props;Fh.error("Error caught by ErrorBoundary",e,t),n?.(e,t)}render(){var{children:e,className:t,fallback:n}=this.props,{error:i}=this.state;return i!=null?n??u.jsx("div",{className:t,children:u.jsx(dn,{errorMessage:"".concat(i),isLoading:!1,isLoaded:!1})}):e}}function Rh(r){var{on:e,id:t,className:n,isInvalid:i,disabled:o=!1,onClick:a,"data-testid":s}=r;return u.jsx("button",{type:"button",className:X("btn","btn-switch",n,{active:e},{"is-invalid":i}),id:t,onClick:a,disabled:o,"data-testid":s,children:u.jsx("div",{className:"handle"})})}var jh=["className","timeout"];function yo(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,n)}return t}function $h(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?yo(Object(t),!0).forEach(function(n){Hh(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):yo(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function Hh(r,e,t){return e=Bh(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Bh(r){var e=Wh(r,"string");return typeof e=="symbol"?e:String(e)}function Wh(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}function Uh(r,e){if(r==null)return{};var t=Vh(r,e),n,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(r);for(i=0;i<o.length;i++)n=o[i],!(e.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(r,n)&&(t[n]=r[n])}return t}function Vh(r,e){if(r==null)return{};var t={},n=Object.keys(r),i,o;for(o=0;o<n.length;o++)i=n[o],!(e.indexOf(i)>=0)&&(t[i]=r[i]);return t}function Hy(r){var{className:e,timeout:t=Xa.transitionMs}=r,n=Uh(r,jh);return u.jsx(za,$h({timeout:t,classNames:X("fade",e)},n))}var Kh=["children","className","isInvalid","onChange","data-testid"];function Co(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,n)}return t}function So(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Co(Object(t),!0).forEach(function(n){zh(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):Co(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function zh(r,e,t){return e=Gh(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Gh(r){var e=qh(r,"string");return typeof e=="symbol"?e:String(e)}function qh(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}function Zh(r,e){if(r==null)return{};var t=Xh(r,e),n,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(r);for(i=0;i<o.length;i++)n=o[i],!(e.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(r,n)&&(t[n]=r[n])}return t}function Xh(r,e){if(r==null)return{};var t={},n=Object.keys(r),i,o;for(o=0;o<n.length;o++)i=n[o],!(e.indexOf(i)>=0)&&(t[i]=r[i]);return t}var Fs=H.forwardRef((r,e)=>{var{children:t,className:n,isInvalid:i,onChange:o,"data-testid":a}=r,s=Zh(r,Kh),l=ws(e),d=m.useCallback(h=>{o(h.target.value)},[o]);return u.jsx("select",So(So({ref:l,className:X("custom-select",n,{"is-invalid":i}),onChange:d,"data-testid":a},s),{},{children:t}))});Fs.displayName="Select";const Yh=Fs;function Qh(){return tr(cd,"No API available in useApi. Was code wrapped in ApiBootstrap or ApiContext.Provider?")}function ks(r){return typeof r=="object"&&r!=null&&typeof r.type=="string"&&r.name!=null}function Rs(r){return typeof r=="object"&&r!=null&&typeof r.type=="string"&&r.id!=null}function By(r){return ks(r)||Rs(r)}var Jh=m.createContext(null);function Wy(r){if(Rs(r))return{id:r.id,type:r.type};if(ks(r)){var e;return{name:(e=r.name)!==null&&e!==void 0?e:"",type:r.type}}throw new Error("Invalid descriptor: ".concat(r))}function ec(r){var e,t;return{type:(e=r.type)!==null&&e!==void 0?e:"",name:(t=r.title)!==null&&t!==void 0?t:r.name,id:r.id}}function Uy(){return tr(Jh,"No ObjectFetcher available in useObjectFetcher. Was code wrapped in ObjectFetcherContext.Provider?")}function wo(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,n)}return t}function tc(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?wo(Object(t),!0).forEach(function(n){nc(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):wo(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function nc(r,e,t){return e=rc(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function rc(r){var e=ic(r,"string");return typeof e=="symbol"?e:String(e)}function ic(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}var Ni=Object.freeze({}),oc=new Map,Vy=r=>r.api,Ky=r=>r.user,js=r=>r.storage,$s=r=>js(r).commandHistoryStorage,Hs=r=>js(r).fileStorage,ac=r=>r.defaultWorkspaceSettings,Bs=r=>{var{workspace:e}=r;return e},We=Xl(r=>{for(var e,t,n=(e=(t=Bs(r))===null||t===void 0?void 0:t.data.settings)!==null&&e!==void 0?e:{},i=tc({},ac(r)),o=Object.keys(n),a=0;a<o.length;a+=1){var s=o[a];n[s]!==void 0&&(i[s]=n[s])}return i}),zy=r=>r.defaultWorkspaceSettings,Gy=r=>We(r).defaultDateTimeFormat,qy=r=>{var e;return(e=We(r).defaultDecimalFormatOptions)!==null&&e!==void 0?e:Ni},Zy=r=>{var e;return(e=We(r).defaultIntegerFormatOptions)!==null&&e!==void 0?e:Ni},Xy=r=>{var e;return(e=We(r).formatter)!==null&&e!==void 0?e:[]},sc=r=>We(r).timeZone,Yy=r=>We(r).showTimeZone,Qy=r=>We(r).showTSeparator,Jy=r=>We(r).truncateNumbersWithPound,eC=r=>We(r).showEmptyStrings,tC=r=>We(r).showNullStrings,nC=r=>We(r).shortcutOverrides,rC=r=>We(r).webgl,iC=r=>We(r).webglEditable,lc=r=>{var e;return(e=We(r).defaultNotebookSettings)!==null&&e!==void 0?e:Ni},oC=r=>r.activeTool,dc=r=>{var e;return(e=r.plugins)!==null&&e!==void 0?e:oc};function Eo(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,n)}return t}function Qt(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Eo(Object(t),!0).forEach(function(n){uc(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):Eo(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function uc(r,e,t){return e=hc(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function hc(r){var e=cc(r,"string");return typeof e=="symbol"?e:String(e)}function cc(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}var aC=r=>({type:gd,payload:r}),sC=r=>({type:pd,payload:r}),Ws=r=>({type:md,payload:r}),lC=r=>({type:bd,payload:r}),dC=r=>({type:yd,payload:r}),uC=r=>({type:Cd,payload:r}),hC=r=>({type:Sd,payload:r}),mc=r=>(e,t)=>{e(Ws(r));var{storage:n}=t(),{workspaceStorage:i}=n;return i?.save(r)},fc=r=>(e,t)=>{var{workspace:n}=t(),{data:i}=n??{},o=Qt(Qt({},n),{},{data:Qt(Qt(Qt({},i),r),{},{settings:Qt(Qt({},i?.settings),r.settings)})});return e(mc(o))},vc=r=>e=>e(fc({settings:r})),cC=r=>({type:fd,payload:r}),mC=r=>({type:vd,payload:r}),fC=r=>({type:wd,payload:r});function _o(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,n)}return t}function Po(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?_o(Object(t),!0).forEach(function(n){gc(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):_o(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function gc(r,e,t){return e=pc(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function pc(r){var e=bc(r,"string");return typeof e=="symbol"?e:String(e)}function bc(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}function yc(r){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 n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:e,i=arguments.length>1?arguments[1]:void 0;switch(i.type){case r:{var{id:o,payload:a}=i;return t&&qn({payload:a},{payload:n[o]})?n:Po(Po({},n),{},{[o]:a})}default:return n}}}function Cc(r){var{type:e}=r,t=Qh();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(ue,{icon:is});case t.VariableType.FIGURE:return u.jsx(ue,{icon:rs});case t.VariableType.PANDAS:return u.jsx(ue,{icon:Ed});default:return u.jsx(ue,{icon:ns})}}function To(r,e,t,n,i,o,a){try{var s=r[o](a),l=s.value}catch(d){t(d);return}s.done?e(l):Promise.resolve(l).then(n,i)}function Sc(r){return function(){var e=this,t=arguments;return new Promise(function(n,i){var o=r.apply(e,t);function a(l){To(o,n,i,a,s,"next",l)}function s(l){To(o,n,i,a,s,"throw",l)}a(void 0)})}}function Us(r){var{children:e,language:t}=r,[n,i]=m.useState(null),{activeThemes:o}=_s();return m.useEffect(()=>{var a=!1;function s(){return l.apply(this,arguments)}function l(){return l=Sc(function*(){if(e!=null&&o!=null){var d=yield lt.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:n!=null?{__html:n}:void 0})}class wc{static get LANGUAGE_MAP(){return new Map([["python","Python"],["groovy","Groovy"],["scala","Scala"]])}}const Vs=wc;class Dr{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)?[]:Yl.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"),n="".concat(e.getMinutes()).padStart(2,"0"),i="".concat(e.getSeconds()).padStart(2,"0"),o="".concat(e.getMilliseconds()).padStart(3,"0");return"".concat(t,":").concat(n,":").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 Dr.isTableType(e,t)||Dr.isWidgetType(e,t)}static isFigureType(e,t){return t===e.VariableType.FIGURE}static isPandas(e,t){return t===e.VariableType.PANDAS}}const mi=Dr;function Ks(r){var{children:e}=r;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})]})}Ks.propTypes={children:S.node.isRequired};function fi(r,e,t){return e=Ec(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Ec(r){var e=_c(r,"string");return typeof e=="symbol"?e:String(e)}function _c(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class zs extends m.Component{constructor(e){super(e),fi(this,"timer",void 0),fi(this,"startTime",void 0),this.updateElapsed=this.updateElapsed.bind(this),this.startTime=Date.now(),this.state={elapsed:0}}componentDidMount(){this.timer=setInterval(this.updateElapsed,1e3)}componentWillUnmount(){this.timer&&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:n}=this.state;return u.jsx("div",{className:X("console-history-result-in-progress",{disabled:e}),children:u.jsxs("span",{className:"badge",children:[u.jsx(os,{className:"ml-2"}),"Running... ",Cs.formatElapsedTime(n)," ",u.jsx(se,{className:"console-history-result-in-progress-cancel",kind:"ghost",icon:_d,tooltip:"Cancel",onClick:t,disabled:e})]})})}}fi(zs,"defaultProps",{disabled:!1});const Pc=zs;function Gn(r,e,t){return e=Tc(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Tc(r){var e=Oc(r,"string");return typeof e=="symbol"?e:String(e)}function Oc(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class Pn extends m.PureComponent{constructor(e){super(e),Gn(this,"mouseX",void 0),Gn(this,"mouseY",void 0),Gn(this,"isClicking",void 0),this.handleKeyPress=this.handleKeyPress.bind(this),this.handleMouseDown=this.handleMouseDown.bind(this),this.handleMouseMove=this.handleMouseMove.bind(this),this.handleMouseUp=this.handleMouseUp.bind(this),this.handleToggleError=this.handleToggleError.bind(this),this.handleMouseEnter=this.handleMouseEnter.bind(this),this.handleMouseLeave=this.handleMouseLeave.bind(this),this.mouseX=null,this.mouseY=null,this.isClicking=!1,this.state={isExpanded:!1,isTriggerHovered:!1}}handleKeyPress(e){switch(e.key){case"Enter":case" ":this.handleToggleError(),e.stopPropagation(),e.preventDefault();break}}handleMouseDown(e){this.mouseX=e.clientX,this.mouseY=e.clientY,this.isClicking=!0}handleMouseMove(e){this.mouseX!=null&&this.mouseY!=null?(Math.abs(e.clientX-this.mouseX)>=Pn.mouseDragThreshold||Math.abs(e.clientY-this.mouseY)>=Pn.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:n}=this.props;R(n);var i=n.indexOf(`
3
3
  `),o=i>-1,a=n;o&&(a=n.slice(0,i));var s=n.slice(i),l=t?"error-btn-link error-btn-link--active":"error-btn-link";return u.jsxs("div",{className:X("error-message",{expanded:e}),children:[o&&u.jsxs(u.Fragment,{children:[u.jsx("div",{className:"error-gutter",children:u.jsx("button",{type:"button",onClick:this.handleToggleError,className:l,tabIndex:-1,children:u.jsx(ue,{icon:e?Rn:Pd,transform:"left-3"})})}),u.jsxs("div",{className:"error-content",children:[u.jsx("div",{className:"console-error-text-trigger",role:"button",tabIndex:0,onKeyPress:this.handleKeyPress,onMouseDown:this.handleMouseDown,onMouseMove:this.handleMouseMove,onMouseEnter:this.handleMouseEnter,onMouseLeave:this.handleMouseLeave,onMouseUp:this.handleMouseUp,children:a}),e?s:""]})]}),!o&&u.jsx("div",{className:"error-content",children:u.jsx("div",{className:"console-error-text",children:a})})]},"error")}}Gn(Pn,"defaultProps",{message:""});Gn(Pn,"mouseDragThreshold",5);const Ic=Pn;function Dc(r,e,t){return e=xc(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function xc(r){var e=Mc(r,"string");return typeof e=="symbol"?e:String(e)}function Mc(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}var Oo=V.module("ConsoleHistoryItem");class Gs extends m.PureComponent{constructor(e){super(e),this.handleCancelClick=this.handleCancelClick.bind(this),this.handleObjectClick=this.handleObjectClick.bind(this)}handleObjectClick(e){Oo.debug("handleObjectClick",e);var{openObject:t}=this.props;t(e)}handleCancelClick(){var{item:e}=this.props;e!=null&&e.cancelResult&&(Oo.debug("Cancelling command: ".concat(e.command)),e.cancelResult())}render(){var{disabled:e,item:t,language:n,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(Us,{language:n,children:t.command})})]}));var d=[],h=!1;if(a){var{error:c,message:f,changes:v}=a;if(v){var{created:p,updated:g}=v;[...p,...g].forEach(Q=>{h=!0;var{title:N}=Q,B="".concat(N),j=e===void 0||e||(o??[]).indexOf(B)>=0,Y=u.jsx(se,{kind:"primary",onClick:()=>this.handleObjectClick(Q),className:"btn-console-object",disabled:j,icon:i(Q.type),children:N},B);d.push(Y)})}if(c!=null&&!s){var y,P="".concat((y=c.message)!==null&&y!==void 0?y:c);P||(P=c);var O=u.jsx(Ic,{message:P},"result-error");d.push(O)}if(f!==void 0&&f!==""){var _=u.jsx("div",{className:"log-message",children:f},"log-message");d.push(_)}}else{h=!0;var k=u.jsx(Pc,{onCancelClick:this.handleCancelClick,disabled:e},"in_progress");d.push(k)}var W=null;return d.length>0&&(W=u.jsx(Ks,{children:d})),u.jsxs("div",{className:X("console-command-result",{"console-result-buttons":h}),children:[l,W]})}}Dc(Gs,"defaultProps",{disabled:!1});const Nc=Gs;function Ac(r,e){return"".concat(r,".").concat(e.command,".").concat(e.result&&e.result.message,".").concat(e.result&&e.result.error)}function Lc(r){for(var{disabled:e=!1,items:t,language:n,openObject:i,supportsType:o,iconForType:a}=r,s=[],l=0;l<t.length;l+=1){var d=t[l],h=u.jsx(Nc,{disabled:e,item:d,openObject:i,language:n,supportsType:o,iconForType:a},Ac(l,d));s.push(h)}return u.jsx("div",{className:"container-fluid console-history",children:s})}var Fc={name:"Console",CLEAR:ce.createAndAdd({id:"CONSOLE.CLEAR",name:"Clear",shortcut:[L.CTRL,D.L],macShortcut:[L.CTRL,D.C]}),FOCUS_HISTORY:ce.createAndAdd({id:"CONSOLE.FOCUS_HISTORY",name:"Focus History",shortcut:[L.CTRL,D.H],macShortcut:[L.CTRL,L.OPTION,D.H]})},kc={name:"Command History",FOCUS_HISTORY:ce.createAndAdd({id:"COMMAND_HISTORY.FOCUS_HISTORY",name:"Focus History Search",shortcut:[L.CTRL,D.H],macShortcut:[L.CTRL,L.OPTION,D.H]}),SEND_TO_CONSOLE:ce.createAndAdd({id:"COMMAND_HISTORY.SEND_TO_CONSOLE",name:"Send to Console",shortcut:[D.ENTER],macShortcut:[D.ENTER]}),SEND_TO_NOTEBOOK:ce.createAndAdd({id:"COMMAND_HISTORY.SEND_TO_NOTEBOOK",name:"Send to Notebook",shortcut:[L.CTRL,D.ENTER],macShortcut:[L.CMD,D.ENTER]}),RUN:ce.createAndAdd({id:"COMMAND_HISTORY.RUN",name:"Run",shortcut:[L.ALT,D.R],macShortcut:[L.OPTION,D.R]})},Rc={name:"Notebook",RUN:ce.createAndAdd({id:"NOTEBOOK.RUN",name:"Run",shortcut:[L.ALT,D.R],macShortcut:[L.OPTION,D.R]}),RUN_SELECTED:ce.createAndAdd({id:"NOTEBOOK.RUN_SELECTED",name:"Run Selected",shortcut:[L.ALT,L.SHIFT,D.R],macShortcut:[L.OPTION,L.SHIFT,D.R]}),FIND:ce.createAndAdd({id:"NOTEBOOK.FIND",name:"Find",shortcut:[L.CTRL,D.F],macShortcut:[L.CMD,D.F],isEditable:!1}),MINIMAP:ce.createAndAdd({id:"NOTEBOOK.MINIMAP",name:"Show Minimap",shortcut:[L.ALT,D.M],macShortcut:[L.OPTION,D.M]}),WORDWRAP:ce.createAndAdd({id:"NOTEBOOK.WORDWRAP",name:"Word Wrap",shortcut:[L.ALT,D.Z],macShortcut:[L.OPTION,D.Z]})},jc={CONSOLE:Fc,COMMAND_HISTORY:kc,NOTEBOOK:Rc};const Re=jc,Oe=Object.freeze({FATAL:"FATAL",STDERR:"STDERR",ERROR:"ERROR",WARN:"WARN",STDOUT:"STDOUT",INFO:"INFO",DEBUG:"DEBUG",TRACE:"TRACE"}),$c="var(--dh-color-editor-bg)",Hc="var(--dh-color-editor-fg)",Bc="var(--dh-color-editor-string)",Wc="var(--dh-color-editor-delimiter)",Uc="var(--dh-color-editor-predefined)",Vc="var(--dh-color-editor-keyword)",Kc="var(--dh-color-editor-storage)",zc="var(--dh-color-editor-number)",Gc="var(--dh-color-editor-operator)",qc="var(--dh-color-editor-identifier)",Zc="var(--dh-color-editor-comment)",vi={"error-foreground":"var(--dh-color-editor-error-fg)",background:$c,foreground:Hc,"line-height":"19px",string:Bc,"string-delim":"var(--dh-color-editor-string-delim)",delimiter:Wc,predefined:Uc,keyword:Vc,storage:Kc,number:zc,operator:Gc,identifier:qc,"namespace-identifier":"var(--dh-color-editor-identifier-namespace)","identifier-js":"var(--dh-color-editor-identifier-js)",comment:Zc,"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 Xc="python",Yc={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/}}},Qc={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"]]}},Jc={id:Xc,conf:Yc,language:Qc};const em=Jc;var tm="groovy",nm={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/}}},rm={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"]]}},im={id:tm,conf:nm,language:rm};const om=im;var am="scala",sm={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>))/}}},lm={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"]]}},dm={id:am,conf:sm,language:lm};const um=dm;var hm="deephavenDb",cm={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/}}},mm={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"]]}},fm={id:hm,conf:cm,language:mm};const vm=fm;var gm="log",pm={},bm={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"}]]}},ym={id:gm,conf:pm,language:bm};const Cm=ym;function Io(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,n)}return t}function Do(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Io(Object(t),!0).forEach(function(n){Sm(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):Io(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function Sm(r,e,t){return e=wm(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function wm(r){var e=Em(r,"string");return typeof e=="symbol"?e:String(e)}function Em(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}var Et=V.module("MonacoUtils");class Dt{static init(){var{getWorker:e}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Et.debug("Initializing Monaco..."),e!==void 0&&Dt.registerGetWorker(e);var{initTheme:t,registerLanguages:n}=Dt;t(),n([vm,em,om,Cm,um]),Dt.removeConflictingKeybindings(),Et.debug("Monaco initialized.")}static initTheme(){var e,t,{removeHashtag:n}=Dt,i=as(vi);Et.debug2("Monaco theme:",vi),Et.debug2("Monaco theme derived:",i);var o=[{token:"",foreground:n(i.foreground)},{token:"string",foreground:n(i.string)},{token:"string.delim",foreground:n(i["string-delim"])},{token:"keyword",foreground:n(i.keyword)},{token:"identifier.js",foreground:n(i["identifier-js"])},{token:"delimiter",foreground:n(i.delimiter)},{token:"comment",foreground:n(i.comment)},{token:"number",foreground:n(i.number)},{token:"storage",foreground:n(i.storage)},{token:"identifier",foreground:n(i.identifier)},{token:"namespace.identifier",foreground:n(i["namespace-identifier"])},{token:"operator",foreground:n(i.operator)},{token:"predefined",foreground:n(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:n(i["log-warn"])},{token:"info.log",foreground:n(i["log-info"])},{token:"stdout.log",foreground:n(i["log-stdout"])},{token:"trace.log",foreground:n(i["log-trace"])},{token:"debug.log",foreground:n(i["log-debug"])},{token:"date.log",foreground:n(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"]};lt.defineTheme("dh-dark",{base:"vs-dark",inherit:!0,rules:o,colors:a});try{lt.setTheme("dh-dark")}catch(s){Et.error("Failed to set 'dh-dark' Monaco theme, falling back to vs-dark",s),lt.setTheme("vs-dark")}}static registerGetWorker(e){window.MonacoEnvironment=Do(Do({},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(n=>{var{id:i}=n;return i});pt.getLanguages().filter(n=>{var{id:i}=n;return t.includes(i)}).forEach(n=>{var i=n;Et.debug2("Overriding default language loader:",i.id)}),e.forEach(n=>{Dt.registerLanguage(n)})}static registerLanguage(e){Et.debug2("Registering language: ",e.id),pt.register(e),pt.onLanguage(e.id,()=>{pt.setLanguageConfiguration(e.id,e.conf),pt.setMonarchTokensProvider(e.id,e.language)})}static setEOL(e){var t,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:lt.EndOfLineSequence.LF;(t=e.getModel())===null||t===void 0||t.setEOL(n)}static openDocument(e,t){var n=e.getModel();R(n);var i={textDocument:{uri:"".concat(n.uri),languageId:n.getLanguageId(),version:n.getVersionId(),text:n.getValue()}};Et.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:f,rangeLength:v,text:p}=c,g={range:{start:{line:f.startLineNumber-1,character:f.startColumn-1},end:{line:f.endLineNumber-1,character:f.endColumn-1}},rangeLength:v,text:p};d.push(g)}if(d.length>0){var y={textDocument:{version:l,uri:"".concat(n.uri)},contentChanges:d};Et.debug2("didChangeDocumentParams",y),t.changeDocument(y)}});return o}static closeDocument(e,t){var n=e.getModel();R(n);var i={textDocument:{uri:"".concat(n.uri)}};t.closeDocument(i)}static registerPasteHandler(e){e.onDidPaste(t=>{var n=/“|”/g,i=/\u200b/g,o=/\u00A0/g,a=e.getModel();R(a);var s=a.getValueInRange(t.range);(n.test(s)||i.test(s)||o.test(s))&&a.applyEdits([{range:t.range,text:s.replace(n,'"').replace(i,"").replace(o," ")}])})}static isMacPlatform(){var{platform:e}=window.navigator;return e.startsWith("Mac")}static removeConflictingKeybindings(){lt.addKeybindingRule({keybinding:ze.CtrlCmd|Gt.KeyD,command:null}),Dt.isMacPlatform()||lt.addKeybindingRule({keybinding:ze.CtrlCmd|Gt.KeyH,command:null})}static disableKeyBindings(e,t){e.addAction({id:"disable-keybindings-".concat(zt()),label:"",keybindings:t,run:()=>{}})}static getMonacoKeyCodeFromShortcut(e){var{keyState:t}=e,{keyValue:n}=t;if(n===null)return 0;var i=Dt.isMacPlatform();return i?(t.metaKey?ze.CtrlCmd:0)|(t.shiftKey?ze.Shift:0)|(t.altKey?ze.Alt:0)|(t.ctrlKey?ze.WinCtrl:0)|Qi.fromString(n):(t.ctrlKey?ze.CtrlCmd:0)|(t.shiftKey?ze.Shift:0)|(t.altKey?ze.Alt:0)|(t.metaKey?ze.WinCtrl:0)|Qi.fromString(n)}static provideLinks(e){for(var t=[],n=function(a){var s=e.getLineContent(a),l=Ql(s),d=l.filter(h=>h.type==="url"?/^https?:\/\//.test(h.value):!0);d.forEach(h=>{t.push({url:h.href,range:new Zd(a,h.start+1,a,h.end+1)})})},i=1;i<=e.getLineCount();i+=1)n(i);return{links:t}}}const Ze=Dt;function ti(r,e,t){return e=_m(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function _m(r){var e=Pm(r,"string");return typeof e=="symbol"?e:String(e)}function Pm(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}var _t=V.module("MonacoCompletionProvider");class nn extends m.PureComponent{static lspToMonacoKind(e){var t=pt.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:n}=e;return{startLineNumber:t.line+1,startColumn:t.character+1,endLineNumber:n.line+1,endColumn:n.character+1}}static monacoToLspPosition(e){return{line:e.lineNumber-1,character:e.column-1}}constructor(e){super(e),ti(this,"registeredCompletionProvider",void 0),ti(this,"registeredSignatureProvider",void 0),ti(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=pt.registerCompletionItemProvider(e,{provideCompletionItems:this.handleCompletionRequest,triggerCharacters:[".",'"',"'"]}),t.getSignatureHelp!=null&&(this.registeredSignatureProvider=pt.registerSignatureHelpProvider(e,{provideSignatureHelp:this.handleSignatureRequest,signatureHelpTriggerCharacters:["(",","]})),t.getHover!=null&&(this.registeredHoverProvider=pt.registerHoverProvider(e,{provideHover:this.handleHoverRequest}))}componentWillUnmount(){var e,t,n;(e=this.registeredCompletionProvider)===null||e===void 0||e.dispose(),(t=this.registeredSignatureProvider)===null||t===void 0||t.dispose(),(n=this.registeredHoverProvider)===null||n===void 0||n.dispose()}handleCompletionRequest(e,t,n){var{model:i,session:o}=this.props;if(e!==i)return null;var a={textDocument:{uri:"".concat(e.uri),version:e.getVersionId()},position:nn.monacoToLspPosition(t),context:n},s=o.getCompletionItems(a);_t.debug("Requested completion items",a);var l=s.then(d=>{_t.debug("Completion items received: ",a,d);var h=d.map(c=>{var{label:f,kind:v,detail:p,documentation:g,sortText:y,filterText:P,textEdit:O,insertTextFormat:_}=c;return{label:f,kind:nn.lspToMonacoKind(v),detail:p,documentation:g?.kind==="markdown"?g:g?.value,sortText:y,filterText:P,insertText:O.text,insertTextRules:_===2?4:_,range:nn.lspToMonacoRange(O.range)}});return{incomplete:!0,suggestions:h}}).catch(d=>(_t.error("There was an error retrieving completion items",d),{suggestions:[]}));return l}handleSignatureRequest(e,t,n,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:nn.monacoToLspPosition(t),context:i},d=s.getSignatureHelp(l);_t.debug("Requested signature help",l);var h=d.then(c=>{_t.debug("Signatures received: ",l,d);var f=c.map(p=>{var{label:g,documentation:y,parameters:P}=p;return{documentation:y?.kind==="markdown"?y:y?.value,label:g,parameters:P??[]}});if(f.length===0)return o;var v=0;return{value:{signatures:f,activeSignature:v,activeParameter:c[v].activeParameter},dispose:()=>{}}}).catch(c=>(_t.error("There was an error retrieving completion items",c),o));return h}handleHoverRequest(e,t){var{model:n,session:i}=this.props;if(e!==n||i.getHover==null)return null;var o={textDocument:{uri:"".concat(e.uri),version:e.getVersionId()},position:nn.monacoToLspPosition(t)},a=i.getHover(o);_t.debug("Requested hover",o);var s=a.then(l=>{_t.debug("Hover received: ",o,l);var{contents:d}=l;return{contents:d!=null?[d]:[]}}).catch(l=>(_t.error("There was an error retrieving hover",l),{contents:[]}));return s}render(){return null}}const qs=nn;function xo(r,e,t,n,i,o,a){try{var s=r[o](a),l=s.value}catch(d){t(d);return}s.done?e(l):Promise.resolve(l).then(n,i)}function Tm(r){return function(){var e=this,t=arguments;return new Promise(function(n,i){var o=r.apply(e,t);function a(l){xo(o,n,i,a,s,"next",l)}function s(l){xo(o,n,i,a,s,"throw",l)}a(void 0)})}}function Ke(r,e,t){return e=Om(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Om(r){var e=Im(r,"string");return typeof e=="symbol"?e:String(e)}function Im(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}var ni=V.module("ConsoleInput"),xr=parseInt(vi["line-height"],10),Zs=6,Xs=6,Dm=xr+Zs+Xs,ri=100;class nr extends m.PureComponent{constructor(e){super(e),Ke(this,"cancelListener",void 0),Ke(this,"resizeObserver",void 0),Ke(this,"commandContainer",void 0),Ke(this,"commandEditor",void 0),Ke(this,"commandHistoryIndex",void 0),Ke(this,"commandSuggestionContainer",void 0),Ke(this,"loadingPromise",void 0),Ke(this,"timestamp",void 0),Ke(this,"bufferIndex",void 0),Ke(this,"history",void 0),Ke(this,"modifiedCommands",void 0),this.handleResize=this.handleResize.bind(this),this.commandContainer=H.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:xr,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,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;if(e){if(ni.debug("Command received: ",e),!n){var i;this.commandHistoryIndex=null,(i=this.commandEditor)===null||i===void 0||i.setValue(e)}t&&this.focusEnd(),this.updateDimensions(),n&&this.processCommand(e)}}initCommandEditor(){var{language:e,session:t}=this.props,n={copyWithSyntaxHighlighting:!1,cursorStyle:"block",fixedOverflowWidgets:!0,folding:!1,fontFamily:"Fira Mono",glyphMargin:!1,language:e,lineHeight:xr,lineDecorationsWidth:3,lineNumbers:"off",minimap:{enabled:!1},renderLineHighlight:"none",scrollBeyondLastLine:!1,scrollbar:{arrowSize:0,horizontal:"hidden",horizontalScrollbarSize:0},padding:{top:Zs,bottom:Xs},value:"",wordWrap:"on",autoClosingBrackets:"beforeWhitespace"},i=this.commandContainer.current;R(i),this.commandEditor=lt.create(i,n),Ze.setEOL(this.commandEditor),Ze.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===Gt.Enter&&!this.isSuggestionMenuPopulated()){var c;o.stopPropagation(),o.preventDefault();var f=(c=this.commandEditor)===null||c===void 0?void 0:c.getValue().trim();if(f!==void 0){var v;this.processCommand(f),(v=this.commandEditor)===null||v===void 0||v.setValue("")}}}),Ze.disableKeyBindings(this.commandEditor,[ze.CtrlCmd|Gt.KeyF]),Ze.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&&(Ze.closeDocument(this.commandEditor,e),this.commandEditor.dispose(),this.commandEditor=void 0)}handleResize(){this.updateDimensions()}isSuggestionMenuActive(){var e;if(!this.commandSuggestionContainer){var t,n;this.commandSuggestionContainer=(t=this.commandEditor)===null||t===void 0||(n=t.getDomNode())===null||n===void 0?void 0:n.querySelector(".suggest-widget")}return(e=this.commandSuggestionContainer&&this.commandSuggestionContainer.classList.contains("visible"))!==null&&e!==void 0?e:!1}isSuggestionMenuPopulated(){var e,t,n;return this.isSuggestionMenuActive()&&((e=(t=this.commandSuggestionContainer)===null||t===void 0||(n=t.querySelector(".monaco-list-rows"))===null||n===void 0?void 0:n.childElementCount)!==null&&e!==void 0?e:0)>0}focus(){var e;(e=this.commandEditor)===null||e===void 0||e.focus()}focusStart(){var e,t,n,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),(n=this.commandEditor)===null||n===void 0||n.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,n,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),(n=this.commandEditor)===null||n===void 0||n.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,n;(e=this.commandEditor)===null||e===void 0||e.focus(),(t=this.commandEditor)===null||t===void 0||(n=t.getModel())===null||n===void 0||n.setValue(""),this.commandHistoryIndex=null}layoutEditor(){this.commandEditor&&this.commandEditor.layout()}loadCommand(e){var t,n;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||(n=t.getModel())===null||n===void 0||n.setValue(i??o),e!==null&&e>this.history.length-ri&&this.loadMoreHistory()}}loadMoreHistory(){var e=this;return Tm(function*(){try{if(e.loadingPromise!=null||e.bufferIndex==null)return;var{commandHistoryStorage:t,language:n,scope:i}=e.props;e.loadingPromise=Ee.makeCancelable(t.getTable(n,i??"",e.timestamp),s=>s.close());var o=yield e.loadingPromise;o.setReversed(!0),o.setViewport({top:e.bufferIndex,bottom:e.bufferIndex+ri-1}),e.loadingPromise=Ee.makeCancelable(o.getViewportData(),()=>o.close());var a=yield e.loadingPromise;e.bufferIndex+=ri,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,Ee.isCanceled(s)){ni.debug2("Promise canceled, not loading history");return}ni.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(),n=Math.max(Math.min(t,e),Dm),i=t>n,o={overviewRulerLanes:i?void 0:0};this.setState({commandEditorHeight:n},()=>{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:n}=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:nr.INPUT_CLASS_NAME,ref:this.commandContainer,style:{height:i}}),a&&u.jsx(qs,{model:a,language:t,session:n})]})})}}Ke(nr,"defaultProps",{maxHeight:xr*10,scope:null,disabled:!1});Ke(nr,"INPUT_CLASS_NAME","console-input");const Mo=nr;function Ut(r,e,t){return e=xm(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function xm(r){var e=Mm(r,"string");return typeof e=="symbol"?e:String(e)}function Mm(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}var No="pasted values",Nm=[/^audio.*/,/^font.*/,/^image.*/,/^video.*/],ii=[".csv",".tsv",".tab",".psv",".dsv",".txt"],Ao=[".zip"];class bt extends m.Component{static isValidDropItem(e){return e!=null&&e.kind==="file"&&!Nm.find(t=>t.test(e.type))}static isValidExtension(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return ii.some(n=>e.endsWith(n))||t&&Ao.some(n=>e.endsWith(n))}static handleDragOver(e){e.preventDefault(),e.stopPropagation()}static getIcon(e){return e===No?Zi:e.endsWith(".csv")?Td:e.endsWith(".zip")?Od:Id}constructor(e){super(e),Ut(this,"fileElem",void 0),Ut(this,"divElem",void 0),Ut(this,"getValidExtensions",yt(t=>t?[...ii,...Ao]:[...ii])),Ut(this,"getAcceptString",yt(t=>this.getValidExtensions(t).join(", "))),Ut(this,"getFileTypeErrorString",yt(t=>bs.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=H.createRef(),this.divElem=H.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:n,dragError:i}=this.props;if(e.preventDefault(),e.stopPropagation(),i!=null){n();return}if(!(e.dataTransfer==null||e.dataTransfer.items==null||e.dataTransfer.items.length===0)){var o=e.dataTransfer.items[0].getAsFile();R(o),bt.isValidExtension(o.name,t)?this.handleFile(o):this.setState({dropError:bt.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:n}=this.props;n||navigator.clipboard.readText().then(i=>{e(i),this.setState({selectedFileName:No,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:Zi,action:this.handleMenuPaste,shortcut:Vt.PASTE,disabled:e}]}render(){var{allowZip:e,dragError:t,uploadInProgress:n}=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:bt.handleDragOver,onDrop:this.handleDrop,tabIndex:-1,children:[u.jsx(ee,{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(ue,{icon:Dd})}),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(se,{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(ue,{icon:bt.getIcon(i)})}),u.jsxs("div",{className:"selected-text",children:[u.jsx("label",{children:"Selected File"}),u.jsxs("label",{className:"selected-name",children:[i,!n&&u.jsx(se,{kind:"ghost",className:"ml-2",onClick:this.unstageFile,icon:ss,tooltip:"Remove"})]})]})]}),!!a&&u.jsxs("div",{className:"message-content",children:[u.jsx("div",{className:"message-icon",children:u.jsx(ue,{icon:ls})}),u.jsx("label",{children:a}),a===bt.FILE_TYPE_ERROR&&u.jsx("div",{className:"message-small",children:u.jsx("label",{children:this.getFileTypeErrorString(e)})})]})]})}}Ut(bt,"defaultProps",{allowZip:!1,dragError:null});Ut(bt,"MULTIPLE_FILE_ERROR","Please select only one file");Ut(bt,"FILE_TYPE_ERROR","Filetype not supported.");const bn=bt;function un(r,e,t){return e=Am(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Am(r){var e=Lm(r,"string");return typeof e=="symbol"?e:String(e)}function Lm(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class Zt{}un(Zt,"INTEGER","int");un(Zt,"LONG","long");un(Zt,"DOUBLE","double");un(Zt,"BOOLEAN","bool");un(Zt,"STRING","string");un(Zt,"DATE_TIME","datetime");un(Zt,"LOCAL_TIME","localtime");const oe=Zt;function Ys(r,e){var t=r.internalStream("string");return t.readable=!0,t.read=()=>!1,t.removeListener=()=>!1,t.on("data",(n,i)=>e(i)),t}function Lo(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,n)}return t}function Fo(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Lo(Object(t),!0).forEach(function(n){Fe(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):Lo(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function Fe(r,e,t){return e=Fm(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Fm(r){var e=km(r,"string");return typeof e=="symbol"?e:String(e)}function km(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}var ko="unknown",Rm=2147483647,jm=-2147483648,Ro=/^[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]+)?$/,jo=/^([0-9]+T)?([0-9]+):([0-9]+)(:[0-9]+)?(?:\.[0-9]{1,9})?$/;class xe{static determineType(e,t,n){if(!e||e===n)return t;switch(t){case oe.STRING:return oe.STRING;case oe.INTEGER:return xe.checkInteger(e);case oe.LONG:return xe.checkLong(e);case oe.DOUBLE:return xe.checkDouble(e);case oe.BOOLEAN:return xe.checkBoolean(e);case oe.DATE_TIME:return xe.checkDateTime(e);case oe.LOCAL_TIME:return xe.checkLocalTime(e);default:return xe.getTypeFromUnknown(e)}}static isNotParsableNumber(e){return isNaN(e)||e==="Infinity"||e==="-Infinity"}static checkInteger(e){var t=e.replace(/,/g,"");return xe.isNotParsableNumber(t)?oe.STRING:xe.getNumberType(t)}static checkLong(e){var t=e.replace(/,/g,"");return xe.isNotParsableNumber(t)?oe.STRING:t.includes(".")?oe.DOUBLE:oe.LONG}static checkDouble(e){var t=e.replace(/,/g,"");return xe.isNotParsableNumber(t)?oe.STRING:oe.DOUBLE}static checkBoolean(e){var t=e.toLowerCase();return t==="true"||t==="false"?oe.BOOLEAN:oe.STRING}static checkDateTime(e){return Ro.test(e)?oe.DATE_TIME:oe.STRING}static checkLocalTime(e){return jo.test(e)?oe.LOCAL_TIME:oe.STRING}static getTypeFromUnknown(e){var t=e.replace(/,/g,"");if(xe.isNotParsableNumber(t)){var n=e.toLowerCase();return n==="true"||n==="false"?oe.BOOLEAN:Ro.test(e)&&e.includes(":")?oe.DATE_TIME:jo.test(e)?oe.LOCAL_TIME:oe.STRING}return xe.getNumberType(t)}static getNumberType(e){if(e.includes("."))return oe.DOUBLE;var t=e.startsWith("-")?11:10;if(e.length>t)return oe.LONG;var n=parseInt(e,10);return n>Rm||n<jm?oe.LONG:oe.INTEGER}constructor(e,t,n,i,o,a,s,l,d,h){Fe(this,"onFileCompleted",void 0),Fe(this,"file",void 0),Fe(this,"readHeaders",void 0),Fe(this,"nullString",void 0),Fe(this,"onProgress",void 0),Fe(this,"onError",void 0),Fe(this,"types",void 0),Fe(this,"chunks",void 0),Fe(this,"totalChunks",void 0),Fe(this,"rowCount",void 0),Fe(this,"isZip",void 0),Fe(this,"shouldTrim",void 0),Fe(this,"zipProgress",void 0),Fe(this,"config",void 0),this.onFileCompleted=e,this.file=t,this.readHeaders=n,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=Fo(Fo({},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=Ys(this.file,this.handleNodeUpdate);Wn.parse(e,this.config),e.resume()}}handleChunk(e,t){var{data:n}=e;if(!this.types){if(n==null||n.length===0){t.abort(),this.onError("Error parsing CSV: no data in file.");return}this.types=new Array(n[0].length).fill(ko),this.readHeaders&&(n=n.slice(1))}this.rowCount+=n.length,R(this.types);var i=[...this.types];n.forEach(s=>{if(s.length>=i.length){for(var l=0;l<i.length;l+=1)i[l]=xe.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.
4
4
  Expected length `.concat(i.length," but found ").concat(s.length,`.
5
5
  Row = `).concat(s))}),this.chunks+=1;var o=0;this.totalChunks>0?o=Math.round(this.chunks/this.totalChunks*50):o=Math.round(this.zipProgress/2);var a=this.onProgress(o);a&&t.abort()}handleComplete(e){var{types:t,onFileCompleted:n}=this;R(t),(e==null||!e.meta.aborted)&&n(t.map(i=>i===ko||i===oe.LOCAL_TIME?oe.STRING:i),this.rowCount)}handleError(e){var{onError:t}=this;t(e)}handleNodeUpdate(e){this.zipProgress=e.percent}}const $m=xe;function fe(r,e,t){return e=Hm(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Hm(r){var e=Bm(r,"string");return typeof e=="symbol"?e:String(e)}function Bm(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}var fr=V.module("CsvParser"),Wm=650;class Tn{static generateHeaderRecursive(e){var t="",n=e;return e>=26&&(t=t.concat(Tn.generateHeaderRecursive(Math.floor(e/26)-1)),n=e%26),t.concat(String.fromCharCode(65+n))}constructor(e){var{onFileCompleted:t,session:n,file:i,type:o,readHeaders:a=!0,onProgress:s,onError:l,timeZone:d,isZip:h}=e;fe(this,"onFileCompleted",void 0),fe(this,"session",void 0),fe(this,"file",void 0),fe(this,"isZip",void 0),fe(this,"type",void 0),fe(this,"readHeaders",void 0),fe(this,"timeZone",void 0),fe(this,"onProgress",void 0),fe(this,"onError",void 0),fe(this,"tables",void 0),fe(this,"headers",void 0),fe(this,"types",void 0),fe(this,"rowCount",void 0),fe(this,"rowsProcessed",void 0),fe(this,"chunks",void 0),fe(this,"totalChunks",void 0),fe(this,"isComplete",void 0),fe(this,"zipProgress",void 0),fe(this,"consolidatedChunks",void 0),fe(this,"numConsolidated",void 0),fe(this,"isCancelled",void 0),fe(this,"config",void 0),this.onFileCompleted=t,this.session=n,this.file=i,this.isZip=h,this.type=o,this.readHeaders=a,this.timeZone=d,this.onProgress=s,this.onError=l,this.tables=[],this.rowCount=0,this.rowsProcessed=0,this.chunks=0,this.totalChunks=h?0:Math.ceil(i.size/Wn.LocalChunkSize),this.isComplete=!1,this.zipProgress=0,this.numConsolidated=0,this.isCancelled=!1,this.handleChunk=this.handleChunk.bind(this),this.handleError=this.handleError.bind(this),this.handleComplete=this.handleComplete.bind(this),this.handleNodeUpdate=this.handleNodeUpdate.bind(this),this.handleCreateTable=this.handleCreateTable.bind(this),this.config={delimiter:o.delimiter,newline:o.newline,escapeChar:o.escapeChar,dynamicTyping:!1,error:this.handleError,skipEmptyLines:o.skipEmptyLines,chunk:this.handleChunk,complete:this.handleComplete,fastMode:!1}}cancel(){this.isCancelled=!0}transpose(e,t){for(var n=t.length,i=new Array(e).fill(null).map(()=>new Array(n)),o=0;o<n;o+=1){var a=t[o];if(a.length<e)throw new Error("Insufficient columns. Expected ".concat(e," but found ").concat(a.length,`
@@ -18,5 +18,5 @@ Row = `).concat(s))}),this.chunks+=1;var o=0;this.totalChunks>0?o=Math.round(thi
18
18
  `&&(n+=`
19
19
  `))}}if(n=n.trimRight(),this.editor.setValue(n),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>pe.maxLogSize&&(this.messages=this.messages.splice(this.messages.length-pe.truncateSize))}scrollToBottom(){var e,t,n;if(this.editor){var i=(e=this.editor)===null||e===void 0||(t=e.getModel)===null||t===void 0||(n=t.call(e))===null||n===void 0?void 0:n.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,n=(t=this.editor)===null||t===void 0?void 0:t.getVisibleRanges();if(n==null||n.length===0)return!1;for(var i=0;i<n.length;i+=1){var o=n[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 n=this.bufferedMessages[t],i=pe.getLogText(n);e+=i,i.charAt(i.length-1)!==`
20
20
  `&&(e+=`
21
- `)}this.bufferedMessages=[],this.appendLogText(e)}queue(e){this.bufferedMessages.push(e),this.bufferedMessages.length===1&&(this.flushTimer=setTimeout(this.handleFlushTimeout,pe.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,n=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(se,{kind:"ghost",className:"btn-clear-logs",onClick:this.handleClearClick,icon:Nd,tooltip:"Clear log"}),u.jsx(se,{kind:"ghost",className:"btn-link-icon btn-overflow",icon:Ad,tooltip:"Log Settings",onClick:()=>{},children:u.jsx(zn,{actions:n,popperClassName:"log-level-menu-popper",popperOptions:e})})]}),u.jsx("div",{className:"log-pane-editor h-100 w-100",ref:i=>{this.editorContainer=i}})]})}}Ge(pe,"DefaultLogLevels",[Oe.STDOUT,Oe.ERROR,Oe.FATAL,Oe.STDERR,Oe.WARN]);Ge(pe,"AllLogLevels",[Oe.INFO,Oe.STDOUT,Oe.ERROR,Oe.FATAL,Oe.STDERR,Oe.WARN,Oe.DEBUG,Oe.TRACE]);Ge(pe,"bufferTimeout",16);Ge(pe,"maxLogSize",131072);Ge(pe,"truncateSize",65536);const Af=pe;function Li(r,e,t){return e=Lf(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Lf(r){var e=Ff(r,"string");return typeof e=="symbol"?e:String(e)}function Ff(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class Vr{static isValid(e,t){return!0}static isSameFormat(e,t){throw new Error("isSameFormat not implemented")}static makeFormat(e,t,n){return{label:e,formatString:t,type:n}}format(e,t){return""}}Li(Vr,"TYPE_GLOBAL","type-global");Li(Vr,"TYPE_CONTEXT_PRESET","type-context-preset");Li(Vr,"TYPE_CONTEXT_CUSTOM","type-context-custom");const Be=Vr;class kf extends Be{format(e){switch(e){case 1:case!0:return"true";case 0:case!1:return"false";default:return""}}}const Rf=kf;class jf extends Be{format(e){return String.fromCharCode(e)}}const $f=jf;function $t(r,e,t){return e=Hf(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Hf(r){var e=Bf(r,"string");return typeof e=="symbol"?e:String(e)}function Bf(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}var Xo=V.module("DateTimeColumnFormatter");class dt extends Be{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 n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Be.TYPE_CONTEXT_PRESET;return{label:e,formatString:t,type:n}}static isSameFormat(e,t){return e===t||e!==null&&t!==null&&e.type===t.type&&e.formatString===t.formatString}static makeGlobalFormatStringMap(e,t){var n=t?"'T'":" ",i=e?" z":"";return new Map([["yyyy-MM-dd HH:mm:ss","yyyy-MM-dd".concat(n,"HH:mm:ss").concat(i)],["yyyy-MM-dd HH:mm:ss.SSS","yyyy-MM-dd".concat(n,"HH:mm:ss.SSS").concat(i)],["yyyy-MM-dd HH:mm:ss.SSSSSSSSS","yyyy-MM-dd".concat(n,"HH:mm:ss.SSSSSSSSS").concat(i)]])}static getGlobalFormats(e,t){var n=dt.makeGlobalFormatStringMap(e,t);return[...n.keys()]}static makeFormatStringMap(e,t){var n=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(n,"HH:mm:ss").concat(i)],["yyyy-MM-dd HH:mm:ss.SSS","yyyy-MM-dd".concat(n,"HH:mm:ss.SSS").concat(i)],["yyyy-MM-dd HH:mm:ss.SSSSSSSSS","yyyy-MM-dd".concat(n,"HH:mm:ss.SSSSSSSSS").concat(i)]])}static getFormats(e,t){var n=dt.makeFormatStringMap(e,t);return[...n.keys()]}constructor(e){var{timeZone:t="",showTimeZone:n=!0,showTSeparator:i=!1,defaultDateTimeFormatString:o=dt.DEFAULT_DATETIME_FORMAT_STRING}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};super(),$t(this,"dh",void 0),$t(this,"dhTimeZone",void 0),$t(this,"defaultDateTimeFormatString",void 0),$t(this,"showTimeZone",void 0),$t(this,"showTSeparator",void 0),$t(this,"formatStringMap",void 0);var a=t||dt.DEFAULT_TIME_ZONE_ID;try{this.dhTimeZone=e.i18n.TimeZone.getTimeZone(a)}catch{Xo.error("Unsupported time zone id",a),this.dhTimeZone=e.i18n.TimeZone.getTimeZone(dt.DEFAULT_TIME_ZONE_ID)}this.dh=e,this.defaultDateTimeFormatString=o,this.showTimeZone=n,this.showTSeparator=i,this.formatStringMap=dt.makeFormatStringMap(n,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]:{},n=t.formatString!=null&&t.formatString!==""?t.formatString:this.defaultDateTimeFormatString,i=this.getEffectiveFormatString(n);try{return this.dh.i18n.DateTimeFormat.format(i,e,this.dhTimeZone)}catch{Xo.error("Invalid format arguments")}return""}}$t(dt,"DEFAULT_DATETIME_FORMAT_STRING","yyyy-MM-dd HH:mm:ss.SSS");$t(dt,"DEFAULT_TIME_ZONE_ID","America/New_York");function St(r,e,t){return e=Wf(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Wf(r){var e=Uf(r,"string");return typeof e=="symbol"?e:String(e)}function Uf(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}var Vf=V.module("DecimalColumnFormatter");class Ce extends Be{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 n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Be.TYPE_CONTEXT_PRESET,i=arguments.length>3?arguments[3]:void 0;return{label:e,type:n,formatString:t,multiplier:i}}static makePresetFormat(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",n=arguments.length>2?arguments[2]:void 0;return Ce.makeFormat(e,t,Be.TYPE_CONTEXT_PRESET,n)}static makeCustomFormat(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",t=arguments.length>1?arguments[1]:void 0;return Ce.makeFormat("Custom Format",e,Be.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=Ce.DEFAULT_FORMAT_STRING}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};super(),St(this,"defaultFormatString",void 0),St(this,"dh",void 0),this.dh=e,this.defaultFormatString=t}format(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=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(n,i)}catch{Vf.error("Invalid format arguments")}return""}}St(Ce,"DEFAULT_FORMAT_STRING","###,##0.0000");St(Ce,"FORMAT_PERCENT",Ce.makePresetFormat("Percent","##0.00%"));St(Ce,"FORMAT_BASIS_POINTS",Ce.makePresetFormat("Basis Points","###,##0 bp",1e4));St(Ce,"FORMAT_MILLIONS",Ce.makePresetFormat("Millions","###,##0.000 mm",1e-6));St(Ce,"FORMAT_SCIENTIFIC_NOTATION",Ce.makePresetFormat("Scientific Notation","0.0000E0"));St(Ce,"FORMAT_ROUND",Ce.makePresetFormat("Round","###,##0"));St(Ce,"FORMAT_ROUND_TWO_DECIMALS",Ce.makePresetFormat("0.00","###,##0.00"));St(Ce,"FORMAT_ROUND_FOUR_DECIMALS",Ce.makePresetFormat("0.0000","###,##0.0000"));class Kf extends Be{format(e){return"".concat(e)}}const zf=Kf;function Zn(r,e,t){return e=Gf(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Gf(r){var e=qf(r,"string");return typeof e=="symbol"?e:String(e)}function qf(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}var Zf=V.module("IntegerColumnFormatter");class Ct extends Be{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 n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Be.TYPE_CONTEXT_PRESET,i=arguments.length>3?arguments[3]:void 0;return{label:e,type:n,formatString:t,multiplier:i}}static makePresetFormat(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",n=arguments.length>2?arguments[2]:void 0;return Ct.makeFormat(e,t,Be.TYPE_CONTEXT_PRESET,n)}static makeCustomFormat(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",t=arguments.length>1?arguments[1]:void 0;return Ct.makeFormat("Custom Format",e,Be.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=Ct.DEFAULT_FORMAT_STRING}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};super(),Zn(this,"dh",void 0),Zn(this,"defaultFormatString",void 0),this.dh=e,this.defaultFormatString=t}format(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=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(n,i)}catch{Zf.error("Invalid format arguments")}return""}}Zn(Ct,"DEFAULT_FORMAT_STRING","###,##0");Zn(Ct,"FORMAT_MILLIONS",Ct.makePresetFormat("Millions","###,##0.000 mm",1e-6));Zn(Ct,"FORMAT_SCIENTIFIC_NOTATION",Ct.makePresetFormat("Scientific Notation","0.0000E0"));class Xf extends Be{format(e){return e}}function Yo(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,n)}return t}function Qo(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Yo(Object(t),!0).forEach(function(n){Fi(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):Yo(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function Fi(r,e,t){return e=Yf(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Yf(r){var e=Qf(r,"string");return typeof e=="symbol"?e:String(e)}function Qf(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}var Jf=/\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,n){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(n).padStart(4,"0"),c="".concat(i+1).padStart(2,"0"),f="".concat(o).padStart(2,"0"),v="".concat(a).padStart(2,"0"),p="".concat(s).padStart(2,"0"),g="".concat(l).padStart(2,"0"),y="".concat(d).padStart(9,"0"),P="".concat(h,"-").concat(c,"-").concat(f," ").concat(v,":").concat(p,":").concat(g,".").concat(y);return e.i18n.DateTimeFormat.parse(we.FULL_DATE_FORMAT,P,e.i18n.TimeZone.getTimeZone(t))}static getNextNanos(e){var t=parseInt(e,10),n="0".repeat(9-e.length),i="".concat(t+1).concat(n);return parseInt(i,10)}static getNextDate(e,t,n,i){var{year:o,month:a,date:s,hours:l,minutes:d,seconds:h,nanos:c}=n;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 f=new Date(o,a,s,l,d,h);return we.makeDateWrapper(e,i,f.getFullYear(),f.getMonth(),f.getDate(),f.getHours(),f.getMinutes(),f.getSeconds(),c)}static parseMonth(e){var t=parseInt(e,10);if(!Number.isNaN(t))return t>=1&&t<=12?t-1:NaN;var n=e.trim().toLowerCase();if(n.length>=3){for(var i=0;i<we.months.length;i+=1)if(we.months[i].startsWith(n))return i}return NaN}static parseDateValues(e,t,n,i,o,a,s){var l=parseInt(e,10),d=t!=null?this.parseMonth(t):0,h=n!=null?parseInt(n,10):1,c=i!=null?parseInt(i,10):0,f=o!=null?parseInt(o,10):0,v=a!=null?parseInt(a,10):0,p=s!=null?parseInt(s.padEnd(9,"0"),10):0;return Number.isNaN(l)||Number.isNaN(d)||Number.isNaN(h)||Number.isNaN(c)||Number.isNaN(f)||Number.isNaN(v)||Number.isNaN(p)?null:{year:l,month:d,date:h,hours:c,minutes:f,seconds:v,nanos:p}}static parseDateTimeString(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,n=Jf.exec(e);if(n==null)throw new Error("Unexpected date string: ".concat(e));var[,i,,o,,a,,s,,l,,d,,h,c]=n;if(!t&&c!=null&&c.length>0)throw new Error("Unexpected characters after date string '".concat(e,"': ").concat(c));var f={year:i,month:o,date:a,hours:s,minutes:l,seconds:d,nanos:h};return t?Qo(Qo({},f),{},{overflow:c}):f}static parseDateRange(e,t,n){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,n,o.getFullYear(),o.getMonth(),o.getDate()),s=new Date(o.getFullYear(),o.getMonth(),o.getDate()+1),l=we.makeDateWrapper(e,n,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,n,h.getFullYear(),h.getMonth(),h.getDate()),f=we.makeDateWrapper(e,n,d.getFullYear(),d.getMonth(),d.getDate());return[c,f]}if(i==="now"){var v=new Date(Date.now()),p=e.DateWrapper.ofJsDate(v);return[p,null]}var g=we.parseDateTimeString(i);if(g.year==null&&g.month==null&&g.date==null)throw new Error("Unable to extract year, month, or day ".concat(i));var y=we.parseDateValues(g.year,g.month,g.date,g.hours,g.minutes,g.seconds,g.nanos);if(y==null)throw new Error("Unable to extract date values from ".concat(g));var P=we.makeDateWrapper(e,n,y.year,y.month,y.date,y.hours,y.minutes,y.seconds,y.nanos),O=we.getNextDate(e,g,y,n);return[P,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)}}Fi(we,"FULL_DATE_FORMAT","yyyy-MM-dd HH:mm:ss.SSSSSSSSS");Fi(we,"months",["january","february","march","april","may","june","july","august","september","october","november","december"]);const oi=we;function vC(r,e){return r===e?{operator:"notEq",value:""}:{operator:"eq",value:r}}function gC(r,e,t,n){return function(o){var a=t.trim();if(a==="")return null;var s=ol(e,l=>r.makeSearchTextFilter(l,a,n),"or");return s(o)}}function ol(r,e){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"or";return function(i){var o=i?.findColumns(typeof r=="string"?[r]:r);if(o==null||o.length===0)return null;var a=o.map(e);return a.reduce((s,l)=>s[t](l))}}function ev(r,e,t,n){return ol(e,i=>i.filter()[n](r.makeFilterValue(i.type,t)),"or")}function pC(r,e,t,n,i){return function(a){var s=a?.findColumn(e),l=t==="all"||n&&t.size===0;return s==null||l?null:r.makeSelectValueFilter(s,[...t.keys()],i)}}function bC(r){return function(t){return t.filter().isNull().not().and(t.filter().notEq(r.makeFilterValue(t.type,"")))}}function yC(r,e){return function(n){var i=n.filter(),o=r.makeFilterValue(n.type,""),a=i.eq(o);return e?i.isNull().or(a):a.or(i.notEq(o))}}function ki(r,e,t){return e=tv(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function tv(r){var e=nv(r,"string");return typeof e=="symbol"?e:String(e)}function nv(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class Xn{}ki(Xn,"not","not");ki(Xn,"and","and");ki(Xn,"or","or");function CC(r){if(!(r==="not"||r==="and"||r==="or"))throw new Error("operator is not a valid FilterOperatorValue")}function ve(r,e,t){return e=rv(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function rv(r){var e=iv(r,"string");return typeof e=="symbol"?e:String(e)}function iv(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class E{}ve(E,"eq","eq");ve(E,"eqIgnoreCase","eqIgnoreCase");ve(E,"notEq","notEq");ve(E,"notEqIgnoreCase","notEqIgnoreCase");ve(E,"greaterThan","greaterThan");ve(E,"greaterThanOrEqualTo","greaterThanOrEqualTo");ve(E,"lessThan","lessThan");ve(E,"lessThanOrEqualTo","lessThanOrEqualTo");ve(E,"in","in");ve(E,"inIgnoreCase","inIgnoreCase");ve(E,"notIn","notIn");ve(E,"notInIgnoreCase","notInIgnoreCase");ve(E,"isTrue","isTrue");ve(E,"isFalse","isFalse");ve(E,"isNull","isNull");ve(E,"invoke","invoke");ve(E,"contains","contains");ve(E,"notContains","notContains");ve(E,"containsIgnoreCase","containsIgnoreCase");ve(E,"startsWith","startsWith");ve(E,"endsWith","endsWith");ve(E,"containsAny","containsAny");var ov="DH_ITEM_KEY",Jo=V.module("ViewportDataUtils");function al(r){return"".concat(ov,"_").concat(r)}function av(r,e){return al(r.offsetInSnapshot+e)}function SC(r,e){var{bulkUpdate:t}=r;return function(i){var{columns:o,offset:a,rows:s}=i.detail;Jo.debug("table updated",i.detail);var l=new Map;s.forEach(d=>{var h=e(d,o),c=av(d,a);l.set(c,{key:c,item:h})}),Jo.debug("update keys",l),t(l)}}function wC(r,e){return e.reduce((t,n)=>(t[n.name]=r.get(n),t),{})}function*EC(r,e){for(var t=r;t<=e;++t)yield{key:al(t)}}function sv(r){return r==null||lv(r)?0:r.size}function lv(r){return"isClosed"in r?r.isClosed:!1}function _C(r,e,t,n){var i=r+e-1,[o,a]=[0,n-1],s=Gi(r-t,o,a),l=Gi(i+t,o,a);return[s,l]}function ea(r,e,t,n,i,o,a){try{var s=r[o](a),l=s.value}catch(d){t(d);return}s.done?e(l):Promise.resolve(l).then(n,i)}function Rt(r){return function(){var e=this,t=arguments;return new Promise(function(n,i){var o=r.apply(e,t);function a(l){ea(o,n,i,a,s,"next",l)}function s(l){ea(o,n,i,a,s,"throw",l)}a(void 0)})}}function hn(r,e,t){return e=dv(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function dv(r){var e=uv(r,"string");return typeof e=="symbol"?e:String(e)}function uv(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}var Pt=V.module("TableUtils");function PC(r){return r===C.sortDirection.ascending||r===C.sortDirection.descending||r===C.sortDirection.reverse||r===C.sortDirection.none}class C{static copyTableAndApplyFilters(e){var t=arguments;return Rt(function*(){if(e==null)return null;for(var n=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 n.applyFilter(Jr(...o.map(s=>s(n)))),n})()}static getSortIndex(e,t){for(var n=0;n<e.length;n+=1){var i,o=e[n];if(((i=o.column)===null||i===void 0?void 0:i.name)===t)return n}return null}static getSortForColumn(e,t){var n=C.getSortIndex(e,t);return n!=null?e[n]: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,n){if(n<0||n>=e.length)return null;var i=C.getSortForColumn(t,e[n].name);return i===null?e[n].sort().asc():i.direction===C.sortDirection.ascending?i.desc():null}static makeColumnSort(e,t,n,i){if(t<0||t>=e.length||n===C.sortDirection.none)return null;var o=e[t].sort();switch(n){case C.sortDirection.ascending:o=o.asc();break;case C.sortDirection.descending:o=o.desc();break}return i&&(o=o.abs()),o}static toggleSortForColumn(e,t,n){var i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(n<0||n>=t.length)return[];var o=C.getNextSort(t,e,n);return C.setSortForColumn(e,t[n].name,o,i)}static sortColumn(e,t,n,i,o,a){if(n<0||n>=t.length)return[];var s=C.makeColumnSort(t,n,i,o);return C.setSortForColumn(e,t[n].name,s,a)}static setSortForColumn(e,t,n){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)),n!==null&&a.push(n),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,n){switch(t){case"=":return e.eq(n);case"<":return e.lessThan(n);case"<=":case"=<":return e.lessThanOrEqualTo(n);case">":return e.greaterThan(n);case">=":case"=>":return e.greaterThanOrEqualTo(n);case"!=":case"!":return e.notEq(n);default:return null}}static makeCancelableTablePromise(e){return Ee.makeCancelable(e,t=>{t.close()})}static makeCancelableTableEventPromise(e,t){var n=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 ps('Event "'.concat(t,'" timed out.')))},n),o=e.addEventListener(t,c=>{if(i!=null&&!i(c)){Pt.debug2("Event triggered, but matcher returned false.");return}Pt.debug2("Event triggered, resolving."),o(),clearTimeout(a),s=!1,d(c)})});return l.cancel=()=>{if(s){Pt.debug2("Pending promise cleanup."),o(),clearTimeout(a),s=!1;return}Pt.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 n=C.removeCommas(t);if(C.NUMBER_REGEX.test(n))return parseFloat(n);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((n,i)=>{var o=n.name.toUpperCase(),a=i.name.toUpperCase();return bs.sort(o,a,t)})}constructor(e){hn(this,"dh",void 0),this.dh=e,tu(this)}createDistinctSortedColumnTable(e,t,n){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(Jr(...l.map(v=>v(a)))));var h=a.findColumn(t),c=yield a.selectDistinct([h]);a!==e&&a.close();var f=c.findColumn(t).sort()[n]();return o.applySort(c,[f])})()}doesColumnValueExist(e,t,n,i){var o=this;return Rt(function*(){if(e==null)return null;var a=ev(o,t,n,i?"eq":"eqIgnoreCase"),s=yield e.copy();yield o.applyFilter(s,Jr(a(s)));var l=sv(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,n){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 f=this.makeQuickFilterFromComponent(e,c,n);if(f)d?d=d.and(f):d=f;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,n){var{type:i}=e;return C.isNumberType(i)?this.makeQuickNumberFilter(e,t):C.isBooleanType(i)?this.makeQuickBooleanFilter(e,t):n!=null&&C.isDateType(i)?this.makeQuickDateFilter(e,t,n):C.isCharType(i)?this.makeQuickCharFilter(e,t):this.makeQuickTextFilter(e,t)}makeQuickNumberFilter(e,t){var n=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,f=null;if(s!==null&&s.length>3&&([,l,d,h,c,f]=s),f!=null&&f.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=n.isNull();break;case"nan":o=i.FilterCondition.invoke("isNaN",n);break;case"infinity":case"inf":case"∞":d!=null?o=i.FilterCondition.invoke("isInf",n).and(n.lessThan(i.FilterValue.ofNumber(0))):o=i.FilterCondition.invoke("isInf",n).and(n.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(v){return Pt.warn("Unable to create long filter",v),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,n;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((n=l)!==null&&n!==void 0?n:"")}static unescapeQuickTextFilter(e){var t,n,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((n=l)!==null&&n!==void 0?n:"")}makeQuickTextFilter(e,t){var{dh:n}=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",n.FilterValue.ofString("(?s)(?i).*\\Q".concat(l,"\\E.*"))));case"!~":return d.isNull().or(d.invoke("matches",n.FilterValue.ofString("(?s)(?i).*\\Q".concat(l,"\\E.*"))).not());case"!=":return h==="*"?d.isNull().or(d.invoke("matches",n.FilterValue.ofString("(?s)(?i).*\\Q".concat(l,"\\E$"))).not()):c==="*"?d.isNull().or(d.invoke("matches",n.FilterValue.ofString("(?s)(?i)^\\Q".concat(l,"\\E.*"))).not()):d.notEqIgnoreCase(n.FilterValue.ofString(l.toLowerCase()));case"=":return h==="*"?d.isNull().not().and(d.invoke("matches",n.FilterValue.ofString("(?s)(?i).*\\Q".concat(l,"\\E$")))):c==="*"?d.isNull().not().and(d.invoke("matches",n.FilterValue.ofString("(?s)(?i)^\\Q".concat(l,"\\E.*")))):d.eqIgnoreCase(n.FilterValue.ofString(l.toLowerCase()))}return null}makeQuickBooleanFilter(e,t){var n=/^(!=|=|!)?(.*)/,i=n.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,n){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,n)}makeQuickDateFilterWithOperation(e,t,n,i){var{dh:o}=this,[a,s]=oi.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 n===E.notEq?h.isNull().not():h.isNull();switch(n){case E.eq:{if(d!=null){var c=h.greaterThanOrEqualTo(l),f=h.lessThan(d);return c.and(f)}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 v=h.lessThan(l),p=h.greaterThanOrEqualTo(d);return v.or(p)}return h.notEq(l)}default:throw new Error("Invalid operator: ".concat(n))}}makeQuickCharFilter(e,t){var{dh:n}=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=n.FilterValue.ofString(C.isRangeOperation(s)?C.quoteValue(l):l);return C.makeRangeFilterWithOperation(h,s,c)}makeAdvancedFilter(e,t,n){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:f}=h;if(c!=null&&c.length>0&&f!=null&&f.length>0)try{var v=this.makeAdvancedValueFilter(e,c,f,n);if(v!=null){if(d===0)l=v;else if(l!==null&&d-1<o.length){var p=o[d-1];if(p===Xn.and)l=l.and(v);else if(p===Xn.or)l=l.or(v);else{Pt.error("Unexpected filter operator",p,v),l=null;break}}}else Pt.debug2("Empty filter ignored for",c,f)}catch(y){Pt.error("Unable to create filter",y),l=null;break}}var g=this.makeSelectValueFilter(e,s,a);return g!=null&&(l!=null?l=l.and(g):l=g),l}makeAdvancedValueFilter(e,t,n,i){var{dh:o}=this;if(C.isDateType(e.type))return this.makeQuickDateFilterWithOperation(e,n,t,i);if(C.isNumberType(e.type)||C.isCharType(e.type))return this.makeQuickFilter(e,"".concat(C.getFilterOperatorString(t)).concat(n));var a=this.makeFilterValue(e.type,n),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(n,"\\E.*"))));case E.notContains:return s.isNull().or(s.invoke("matches",o.FilterValue.ofString("(?s)(?i).*\\Q".concat(n,"\\E.*"))).not());case E.startsWith:return s.isNull().not().and(s.invoke("matches",o.FilterValue.ofString("(?s)(?i)^\\Q".concat(n,"\\E.*"))));case E.endsWith:return s.isNull().not().and(s.invoke("matches",o.FilterValue.ofString("(?s)(?i).*\\Q".concat(n,"\\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,n){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,oi.trimDateTimeStringTimeZone(t),"eq",n);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 n=arguments,i=this;return Rt(function*(){var o=n.length>2&&n[2]!==void 0?n[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 n=arguments,i=this;return Rt(function*(){var o=n.length>2&&n[2]!==void 0?n[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 n=arguments,i=this;return Rt(function*(){var o=n.length>2&&n[2]!==void 0?n[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 n=arguments,i=this;return Rt(function*(){var o=n.length>2&&n[2]!==void 0?n[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,n=null;C.isTextType(e.type)?n=t.FilterValue.ofString("a"):C.isBooleanType(e.type)?n=t.FilterValue.ofBoolean(!0):C.isDateType(e.type)?n=t.FilterValue.ofNumber(t.DateWrapper.ofJsDate(new Date)):n=t.FilterValue.ofNumber(0);var i=e.filter().eq(n),o=e.filter().notEq(n);return i.and(o)}makeFilterValue(e,t){var{dh:n}=this,i=C.getBaseType(e);return C.isTextType(i)?n.FilterValue.ofString(t):C.isLongType(i)?n.FilterValue.ofNumber(n.LongWrapper.ofString(C.removeCommas(t))):n.FilterValue.ofNumber(C.removeCommas(t))}makeFilterRawValue(e,t){var{dh:n}=this;return C.isCharType(e)?n.FilterValue.ofString(typeof t=="number"?String.fromCharCode(t):t):C.isTextType(e)?n.FilterValue.ofString(t):C.isBooleanType(e)?n.FilterValue.ofBoolean(t):n.FilterValue.ofNumber(t)}makeNullableEqFilter(e,t){return t==null?e.filter().isNull():e.filter().eq(this.makeFilterRawValue(e.type,t))}makeValue(e,t,n){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]=oi.parseDateRange(i,t,n);return o}return C.isNumberType(e)?C.makeNumberValue(t):(Pt.error("Unexpected column type",e),null)}makeSelectValueFilter(e,t,n){var{dh:i}=this;if(t.length===0)return n?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?n?e.filter().isNull().not().and(e.filter().notIn(o)):e.filter().isNull().or(e.filter().in(o)):n?e.filter().isNull().not():e.filter().isNull():n?e.filter().notIn(o):e.filter().in(o)}}hn(C,"dataType",{BOOLEAN:"boolean",CHAR:"char",DATETIME:"datetime",DECIMAL:"decimal",INT:"int",STRING:"string",UNKNOWN:"unknown"});hn(C,"sortDirection",{ascending:"ASC",descending:"DESC",reverse:"REVERSE",none:null});hn(C,"APPLY_TABLE_CHANGE_TIMEOUT_MS",3e4);hn(C,"REVERSE_TYPE",Object.freeze({NONE:"none",PRE_SORT:"pre-sort",POST_SORT:"post-sort"}));hn(C,"NUMBER_REGEX",/^-?\d+(\.\d+)?$/);hn(C,"executeAndWaitForEvent",function(){var r=Rt(function*(e,t,n){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,n,i);return e(t),yield o,t});return function(e,t,n){return r.apply(this,arguments)}}());function fn(r,e,t){return e=hv(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function hv(r){var e=cv(r,"string");return typeof e=="symbol"?e:String(e)}function cv(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class sl{static makeColumnFormatMap(e){return e==null?new Map:e.reduce((t,n)=>{var i=C.getNormalizedType(n.columnType);if(i===null)return t;t.has(i)||t.set(i,new Map);var o=t.get(i);return o?.set(n.columnName,n.format),t},new Map)}static makeColumnFormattingRule(e,t,n){return{columnType:e,columnName:t,format:n}}constructor(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],n=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;fn(this,"defaultColumnFormatter",void 0),fn(this,"typeFormatterMap",void 0),fn(this,"columnFormatMap",void 0),fn(this,"truncateNumbersWithPound",void 0),fn(this,"showEmptyStrings",void 0),fn(this,"showNullStrings",void 0),this.defaultColumnFormatter=new zf,this.typeFormatterMap=new Map([[C.dataType.BOOLEAN,new Rf],[C.dataType.CHAR,new $f],[C.dataType.DATETIME,new dt(e,n)],[C.dataType.DECIMAL,new Ce(e,i)],[C.dataType.INT,new Ct(e,o)],[C.dataType.STRING,new Xf]]),this.columnFormatMap=sl.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,n=C.getNormalizedType(e);if(n!==null)return t&&!this.columnFormatMap.has(n)&&this.columnFormatMap.set(n,new Map),this.columnFormatMap.get(n)}getColumnFormat(e,t){var n,i=this.getColumnFormatMapForType(e);return(n=i?.get(t))!==null&&n!==void 0?n:null}getColumnTypeFormatter(e){var t=C.getNormalizedType(e),n=this.defaultColumnFormatter;if(t){var i;n=(i=this.typeFormatterMap.get(t))!==null&&i!==void 0?i:n}return n}getFormattedString(e,t){var n=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,n);return o.format(e,a??void 0)}get timeZone(){var e=this.typeFormatterMap.get(C.dataType.DATETIME);return Ld(e,dt),e.dhTimeZone.id}}const mv="var(--dh-color-chart-colorway)",fv="var(--dh-color-chart-grid)",vv="var(--dh-color-chart-axis-line)",gv="var(--dh-color-chart-axis-line-zero)",ta={"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:mv,gridcolor:fv,linecolor:vv,zerolinecolor:gv,"error-band-line-color":"var(--dh-color-chart-error-band-line)","ohlc-increasing":"var(--dh-color-chart-ohlc-increase)","ohlc-decreasing":"var(--dh-color-chart-ohlc-decrease)","coastline-color":"var(--dh-color-chart-geo-coastline)","land-color":"var(--dh-color-chart-geo-land)","ocean-color":"var(--dh-color-chart-geo-ocean)","lake-color":"var(--dh-color-chart-geo-lake)","river-color":"var(--dh-color-chart-geo-river)"};var na=V.module("ChartTheme");function pv(){var r,e=as(ta);return e.colorway=Fd((r=e.colorway)!==null&&r!==void 0?r:"").map(t=>{var[n,i]=t;return kd.normalizeCssColor(e.colorway.substring(n,i+1))}).join(" "),na.debug2("Chart theme:",ta),na.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"]})}function ra(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,n)}return t}function bv(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?ra(Object(t),!0).forEach(function(n){yv(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):ra(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function yv(r,e,t){return e=Cv(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Cv(r){var e=Sv(r,"string");return typeof e=="symbol"?e:String(e)}function Sv(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}var wv=m.lazy(()=>cs(()=>import("./Plot-daaa69b5.js"),["./Plot-daaa69b5.js","./Plotly-5ec4bf1b.js","./plotly-cb87b4a3.js","./helpers-de833af9.js","./vendor-3cb40e4b.js","./vendor-fb3fd713.css"],import.meta.url));function Ev(r){return u.jsx(m.Suspense,{fallback:u.jsx(dn,{}),children:u.jsx(wv,bv({},r))})}var ll=m.createContext(null);function TC(r){var{children:e}=r,{activeThemes:t}=_s(),n=m.useMemo(pv,[t]);return u.jsx(ll.Provider,{value:n,children:e})}function _v(){return tr(ll,"No ChartThemeContext value found.")}function ia(r,e,t,n,i,o,a){try{var s=r[o](a),l=s.value}catch(d){t(d);return}s.done?e(l):Promise.resolve(l).then(n,i)}function Pv(r){return function(){var e=this,t=arguments;return new Promise(function(n,i){var o=r.apply(e,t);function a(l){ia(o,n,i,a,s,"next",l)}function s(l){ia(o,n,i,a,s,"throw",l)}a(void 0)})}}var Tv=V.module("HeapUsage");function Ov(r){var e,{connection:t,defaultUpdateInterval:n,hoverUpdateInterval:i,bgMonitoring:o=!0,monitorDuration:a}=r,s=_v(),[l,d]=m.useState({freeMemory:0,maximumHeapSize:999,totalHeapSize:0}),[h,c]=m.useState(!1),f=m.useRef({timestamps:[],usages:[]}),v=Ss(),p=m.useCallback(Pv(function*(){try{var A=yield t.getWorkerHeapInfo();if(!v.current)return;if(d(A),o||h){for(var U=(A.totalHeapSize-A.freeMemory)/A.maximumHeapSize,z=Date.now(),{timestamps:me,usages:je}=f.current;me.length!==0&&z-me[0]>a*1.5;)me.shift(),je.shift();me.push(z),je.push(U)}else f.current={timestamps:[],usages:[]}}catch(De){Tv.warn("Unable to get heap usage",De)}}),[t,v,o,h,a]);Ou(p,h?i:n);var g=(A,U)=>Math.round(A*10**U)/10**U,y=2,P=1024**3,{freeMemory:O,totalHeapSize:_,maximumHeapSize:k}=l,W=g(O/P,y),Q=g(_/P,y),N=g(k/P,y),B=Q-W,j=function(U,z){var me=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return u.jsxs("div",{className:X("heap-usage-info-row",{"heading-bottom-border":me}),children:[u.jsx("div",{className:"font-weight-bold",children:U}),u.jsx("div",{children:z})]})},{timestamps:Y,usages:ne}=f.current,F=(e=Y[Y.length-1])!==null&&e!==void 0?e:0,q=_/k,K=(_-O)/k;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":(_-O)/k>.95}),style:{width:"calc(".concat(K*100,"% - ").concat(K*2,"px")}}),u.jsxs("div",{className:"memory-text",children:[N.toFixed(1)," GB"]}),u.jsx(qt,{onEntered:()=>c(!0),onExited:()=>c(!1),interactive:!0,children:u.jsxs("div",{className:"heap-tooltip",children:[j("In use:","".concat(B.toFixed(y)," of ").concat(N.toFixed(y)," GB"),!0),j("Free:","".concat(W.toFixed(y)," GB")),j("Total:","".concat(Q.toFixed(y)," GB")),j("Max:","".concat(N.toFixed(y)," GB")),u.jsx("div",{className:"heap-plot",children:u.jsx(Ev,{data:[{x:[...Y],y:[...ne],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:[F-a,F],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 dl=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 ul(r){return r.componentName!==void 0}function Iv(r){return r.component!==void 0}var hl=Object.freeze({type:"default",isClosable:!0,isFocusOnShow:!0,reorderEnabled:!0,title:""});const Dv=Object.freeze(Object.defineProperty({__proto__:null,defaultConfig:dl,isGLComponentConfig:ul,isReactComponentConfig:Iv,itemDefaultConfig:hl},Symbol.toStringTag,{value:"Module"}));function Tr(r,e,t){return e=xv(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function xv(r){var e=Mv(r,"string");return typeof e=="symbol"?e:String(e)}function Mv(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class Yn{constructor(){Tr(this,"_mSubscriptions",void 0),Tr(this,"off",this.unbind),Tr(this,"trigger",this.emit),this._mSubscriptions={},this._mSubscriptions[Yn.ALL_EVENT]=[]}on(e,t,n){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:n})}emit(e){for(var t=this._mSubscriptions[e],n=arguments.length,i=new Array(n>1?n-1:0),o=1;o<n;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[Yn.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,n){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)&&(!n||n===this._mSubscriptions[e][o].ctx)&&(this._mSubscriptions[e].splice(o,1),i=!0);if(i===!1)throw new Error("Nothing to unbind for "+e)}}Tr(Yn,"ALL_EVENT","__all");const ct=Yn;function st(r,e,t){return e=Nv(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Nv(r){var e=Av(r,"string");return typeof e=="symbol"?e:String(e)}function Av(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class pi extends ct{constructor(e,t,n){super(),st(this,"width",void 0),st(this,"height",void 0),st(this,"title",void 0),st(this,"parent",void 0),st(this,"layoutManager",void 0),st(this,"tab",void 0),st(this,"_config",void 0),st(this,"isHidden",!1),st(this,"beforeCloseHandler",void 0),st(this,"_element",M(['<div class="lm_item_container">','<div class="lm_content" tabindex="-1"></div>',"</div>"].join(""))),st(this,"_contentElement",void 0),this.title=ul(e)?e.componentName:"",this.parent=t,this.layoutManager=n,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 n,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=((n=this[d])!==null&&n!==void 0?n:0)*(1/(((i=s.config[d])!==null&&i!==void 0?i:0)/100)),f=h/c*100,v=(((o=s.config[d])!==null&&o!==void 0?o:0)-f)/(a.contentItems.length-1),p=0;p<a.contentItems.length;p++)if(a.contentItems[p]===s)a.contentItems[p].config[d]=f;else{var g;a.contentItems[p].config[d]=((g=a.contentItems[p].config[d])!==null&&g!==void 0?g:0)+v}return a.callDownwards("setSize"),!0}close(e){var t,n;this._config.isClosable&&(!((t=(n=this.beforeCloseHandler)===null||n===void 0?void 0:n.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(M.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 n=this._contentElement[0],i=n.offsetWidth-n.clientWidth,o=n.offsetHeight-n.clientHeight;this._contentElement.width(this.width-i).height(this.height-o),this.emit("resize")}}}const Lv=Object.freeze(Object.defineProperty({__proto__:null,Container:pi,ItemContainer:pi},Symbol.toStringTag,{value:"Module"}));function cl(r){var e=location.hash.match(new RegExp(r+"=([^&]*)"));return e?e[1]:null}function ml(r){if(window.location.hash)return cl(r);if(!window.location.search)return null;var e=window.location.search.substr(1).split("&"),t={},n,i;for(i=0;i<e.length;i++)n=e[i].split("="),t[n[0]]=n[1];return t[r]||null}function Ri(r){return window.requestAnimationFrame(r)}function Fv(r,e){var t=e.indexOf(r);if(t===-1)throw new Error("Can't remove item from array. Item is not in the array");e.splice(t,1)}function Lr(){return zt()}function kv(r,e){var t=r.replace(/javascript/gi,"j&#97;vascript").replace(/expression/gi,"expr&#101;ssion").replace(/onload/gi,"onlo&#97;d").replace(/script/gi,"&#115;cript").replace(/onerror/gi,"on&#101;rror");return e===!0?t:t.replace(/>/g,"&gt;").replace(/</g,"&lt;")}function ji(r){return M.trim(r.replace(/(<([^>]+)>)/gi,""))}function Ue(r,e,t){return e=Rv(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Rv(r){var e=jv(r,"string");return typeof e=="symbol"?e:String(e)}function jv(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class $v extends ct{constructor(e){var t,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;super(),Ue(this,"_eElement",void 0),Ue(this,"_oDocument",void 0),Ue(this,"_eBody",void 0),Ue(this,"_destroyAfterMouseUp",void 0),Ue(this,"_nDelay",400),Ue(this,"_timeout",void 0),Ue(this,"timeout",void 0),Ue(this,"_nDistance",10),Ue(this,"_nX",0),Ue(this,"_nY",0),Ue(this,"_nOriginalX",0),Ue(this,"_nOriginalY",0),Ue(this,"_bDragging",!1),this._eElement=e,this._oDocument=M(document),this._eBody=M(document.body),this._destroyAfterMouseUp=n,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,n,i,o,a=this._getCoordinates(e);this._nOriginalX=(t=a.x)!==null&&t!==void 0?t:0,this._nOriginalY=(n=a.y)!==null&&n!==void 0?n: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,n;e.preventDefault();var i=this._getCoordinates(e);this._nX=((t=i.x)!==null&&t!==void 0?t:0)-this._nOriginalX,this._nY=((n=i.y)!==null&&n!==void 0?n: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,n,i,o,a;if(clearTimeout(this._timeout),(t=this._oDocument)===null||t===void 0||t.unbind("mousemove",this.onMouseMove),(n=this._oDocument)===null||n===void 0||n.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,n,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"),(n=this._oDocument)===null||n===void 0||(i=n.find("iframe"))===null||i===void 0||i.css("pointer-events","none"),this.emit("dragStart",this._nOriginalX,this._nOriginalY)}_getCoordinates(e){var t,n;return{x:(t=e.pageX)!==null&&t!==void 0?t:0,y:(n=e.pageY)!==null&&n!==void 0?n:0}}}const rr=$v;function vn(r,e,t){return e=Hv(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Hv(r){var e=Bv(r,"string");return typeof e=="symbol"?e:String(e)}function Bv(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class fl{constructor(e,t){vn(this,"_container",void 0),vn(this,"_reactComponent",null),vn(this,"_portalComponent",null),vn(this,"_originalComponentWillUpdate",null),vn(this,"_initialState",void 0),vn(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=jr.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 n;this._container.setState(t),(n=this._originalComponentWillUpdate)===null||n===void 0||n.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=M.extend(e,this._container._config.props);return H.createElement(this._reactClass,t)}}var Fr=["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"],Wv=[!0,!1,"row","column","stack","component","close","maximise","minimise","open in new window"];function $i(r){if(Fr.length>36)throw new Error("Too many keys in config minifier map");var e={};return Hi(r,e,"_min"),e}function bi(r){if(Fr.length>36)throw new Error("Too many keys in config minifier map");var e={};return Hi(r,e,"_max"),e}function Hi(r,e,t){var n=t==="_min"?Uv:Vv;for(var i in r)if(r.hasOwnProperty(i)){var o=Array.isArray(r)?r[Number.parseInt(i,10)]:r[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=n(i,Fr);e[s]=a}Hi(o,a,t)}else{var l=n(o,Wv);if(Array.isArray(e))e[Number.parseInt(i,10)]=l;else{var d=n(i,Fr);e[d]=l}}}}function Uv(r,e){if(typeof r=="string"&&r.length===1)return"___"+r;var t=e.indexOf(r);return t===-1?r:t.toString(36)}function Vv(r,e){return typeof r=="string"&&r.length===1?e[parseInt(r,36)]:typeof r=="string"&&r.substr(0,3)==="___"?r[3]:r}function ai(r,e,t){return e=Kv(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Kv(r){var e=zv(r,"string");return typeof e=="symbol"?e:String(e)}function zv(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class yi{constructor(e,t){ai(this,"name",void 0),ai(this,"origin",void 0),ai(this,"isPropagationStopped",void 0),this.name=e,this.origin=t,this.isPropagationStopped=!1}stopPropagation(){this.isPropagationStopped=!0}}function gr(r,e,t){return e=Gv(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Gv(r){var e=qv(r,"string");return typeof e=="symbol"?e:String(e)}function qv(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}let Zv=class extends ct{constructor(e){super(),gr(this,"_layoutManager",void 0),gr(this,"_dontPropagateToParent",void 0),gr(this,"_childEventSource",void 0),gr(this,"_boundOnEventFromChild",void 0),this._layoutManager=e,this._dontPropagateToParent=null,this._childEventSource=null,this.on(ct.ALL_EVENT,this._onEventFromThis.bind(this)),this._boundOnEventFromChild=this._onEventFromChild.bind(this),M(window).on("gl_child_event",this._boundOnEventFromChild)}_onEventFromThis(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];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,n="gl_child_event",i=(t=window.opener)===null||t===void 0?void 0:t.document.createEvent("HTMLEvents");i.initEvent(n,!0,!0),i.eventName=n,i.__glArgs=e,i.__gl=this._layoutManager,window.opener.dispatchEvent(i)}_propagateToChildren(e){for(var t=0;t<this._layoutManager.openPopouts.length;t++){var n=this._layoutManager.openPopouts[t].getGlInstance();n&&n!==this._childEventSource&&n.eventHub._$onEventFromParent(e)}}destroy(){M(window).off("gl_child_event",this._boundOnEventFromChild)}};const vl=Zv;function Bi(r,e,t){return r.on(e,t),()=>{r.off(e,t)}}function gl(r){return(e,t)=>Bi(e,r,t)}function pl(r){return(e,t)=>{e.emit(r,t)}}function bl(r){return(e,t)=>{m.useEffect(()=>Bi(e,r,t),[e,t])}}function yl(r){return{listen:gl(r),emit:pl(r),useListener:bl(r)}}const Xv=Object.freeze(Object.defineProperty({__proto__:null,BubblingEvent:yi,DragListener:rr,EventEmitter:ct,EventHub:vl,ReactComponentHandler:fl,animFrame:Ri,filterXss:kv,getHashValue:cl,getQueryStringParam:ml,getUniqueId:Lr,listenForEvent:Bi,makeEmitFunction:pl,makeEventFunctions:yl,makeListenFunction:gl,makeUseListenerFunction:bl,minifyConfig:$i,removeFromArray:Fv,stripTags:ji,unminifyConfig:bi},Symbol.toStringTag,{value:"Module"}));function Ft(r,e,t){return e=Yv(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Yv(r){var e=Qv(r,"string");return typeof e=="symbol"?e:String(e)}function Qv(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class Cl extends ct{constructor(e,t,n,i,o){super(),Ft(this,"isInitialised",!1),Ft(this,"_config",void 0),Ft(this,"_dimensions",void 0),Ft(this,"_parentId",void 0),Ft(this,"_indexInParent",void 0),Ft(this,"_layoutManager",void 0),Ft(this,"_popoutWindow",null),Ft(this,"_id",null),this._config=e,this._dimensions=t,this._parentId=n,this._indexInParent=i,this._layoutManager=o,this._createWindow()}toConfig(){var e,t,n,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:(n=(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&&n!==void 0?n: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,n=null;if(this._parentId){var i;if(t=M.extend(!0,{},(i=this.getGlInstance())===null||i===void 0?void 0:i.toConfig()).content[0],n=this._layoutManager.root.getItemsById(this._parentId)[0],!n){var o;((o=this._layoutManager.root.contentItems.length)!==null&&o!==void 0?o:0)>0?n=this._layoutManager.root.contentItems[0]:n=this._layoutManager.root}}t&&((e=n)===null||e===void 0||e.addChild(t,this._indexInParent),this.close())}_createWindow(){var e=this._createUrl(),t=Math.floor(Math.random()*1e6).toString(36),n=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,n),!this._popoutWindow)if(this._layoutManager.config.settings.blockedPopoutsThrowError===!0){var i=new Error("Popout blocked");throw i.type="popoutBlocked",i}else return;M(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=[],n;for(n in e)t.push(n+"="+e[n]);return t.join(",")}_createUrl(){var e={content:this._config},t="gl-window-config-"+Lr();e=$i(e);try{localStorage.setItem(t,JSON.stringify(e))}catch(i){throw new Error("Error while writing to localStorage "+i.toString())}var n=document.location.href.split("?");return n.length===1?n[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 Pe(r,e,t){return e=Jv(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Jv(r){var e=eg(r,"string");return typeof e=="symbol"?e:String(e)}function eg(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class cn extends ct{constructor(e,t,n,i,o,a){var s,l,d,h,c,f,v,p;if(super(),Pe(this,"_dragListener",void 0),Pe(this,"_layoutManager",void 0),Pe(this,"_contentItem",void 0),Pe(this,"_originalParent",void 0),Pe(this,"_area",null),Pe(this,"_lastValidArea",null),Pe(this,"_minX",void 0),Pe(this,"_maxX",void 0),Pe(this,"_minY",void 0),Pe(this,"_maxY",void 0),Pe(this,"_width",void 0),Pe(this,"_height",void 0),Pe(this,"_sided",void 0),Pe(this,"element",void 0),Pe(this,"childElementContainer",void 0),Pe(this,"_proxyTab",void 0),this._dragListener=n,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 g,y;this._layoutManager.tabDropPlaceholder.width((g=this._contentItem.tab.element.outerWidth(!0))!==null&&g!==void 0?g:0),this._layoutManager.tabDropPlaceholder.height((y=this._contentItem.tab.element.outerHeight(!0))!==null&&y!==void 0?y:0)}if(this.element=M(cn._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",ji((s=this._contentItem.config.title)!==null&&s!==void 0?s:"")),this.element.find(".lm_title").html((l=this._contentItem.config.title)!==null&&l!==void 0?l:""),this.childElementContainer=this.element.find(".lm_content"),this.childElementContainer.append(o.element),this._updateTree(),this._layoutManager._$calculateItemAreas(),M(document.body).append(this.element),this._setDimensions(),!this._contentItem.tab&&this._proxyTab.length){var P,O;this._layoutManager.tabDropPlaceholder.width((P=this._proxyTab.outerWidth(!0))!==null&&P!==void 0?P:0),this._layoutManager.tabDropPlaceholder.height((O=this._proxyTab.outerHeight(!0))!==null&&O!==void 0?O:0)}var _=this._layoutManager.container.offset();this._minX=(d=_?.left)!==null&&d!==void 0?d:0,this._minY=(h=_?.top)!==null&&h!==void 0?h:0,this._maxX=((c=this._layoutManager.container.width())!==null&&c!==void 0?c:0)+this._minX,this._maxY=((f=this._layoutManager.container.height())!==null&&f!==void 0?f:0)+this._minY,this._width=(v=this.element.width())!==null&&v!==void 0?v:0,this._height=(p=this.element.height())!==null&&p!==void 0?p:0,this._setDropPosition(e,t),this._layoutManager.emit("itemPickedUp",this._contentItem)}_onDrag(e,t,n){var i,o,a=(i=n.pageX)!==null&&i!==void 0?i:0,s=(o=n.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,n=e.dragProxyHeight;this.element.width(t),this.element.height(n),t-=this._sided?e.headerHeight:0,n-=this._sided?0:e.headerHeight,this.childElementContainer.width(t),this.childElementContainer.height(n),this._contentItem.element.width(t),this._contentItem.element.height(n),this._contentItem.callDownwards("_$show"),this._contentItem.callDownwards("setSize")}}Pe(cn,"_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 pr(r,e,t){return e=tg(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function tg(r){var e=ng(r,"string");return typeof e=="symbol"?e:String(e)}function ng(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class Sl{constructor(e,t,n){pr(this,"_element",void 0),pr(this,"_itemConfig",void 0),pr(this,"_layoutManager",void 0),pr(this,"_dragListener",void 0),this._element=e,this._itemConfig=t,this._layoutManager=n,this._dragListener=this._createDragListener()}_createDragListener(){return this._dragListener=new rr(this._element,!0),this._dragListener.on("dragStart",this._onDragStart,this),this._dragListener.on("dragStop",this._createDragListener,this),this._dragListener}_onDragStart(e,t){var n=this._itemConfig;typeof n=="function"&&(n=n());var i=this._layoutManager._$normalizeContentItem(M.extend(!0,{},n));new cn(e,t,this._dragListener,this._layoutManager,i,null)}}function br(r,e,t){return e=rg(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function rg(r){var e=ig(r,"string");return typeof e=="symbol"?e:String(e)}function ig(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class wl{constructor(e,t,n){br(this,"_element",M(window)),br(this,"_itemConfig",void 0),br(this,"_layoutManager",void 0),br(this,"_dragListener",void 0),this._itemConfig=e,this._layoutManager=t,this._createDragListener(n)}_createDragListener(e){this._dragListener&&this._dragListener.destroy(),this._element&&(this._dragListener=new rr(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 n=this._itemConfig;typeof n=="function"&&(n=n());var i=this._layoutManager._$normalizeContentItem(M.extend(!0,{},n));new cn(e,t,this._dragListener,this._layoutManager,i,null)}}}function El(r,e,t){return e=og(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function og(r){var e=ag(r,"string");return typeof e=="symbol"?e:String(e)}function ag(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class ir{constructor(){El(this,"element",M(ir._template)),M(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()}}El(ir,"_template",'<div class="lm_dropTargetIndicator"><div class="lm_inner"></div></div>');function si(r,e,t){return e=sg(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function sg(r){var e=lg(r,"string");return typeof e=="symbol"?e:String(e)}function lg(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class Bn{constructor(e,t,n,i){si(this,"element",void 0),si(this,"_header",void 0),si(this,"_action",void 0),this._header=e,this.element=M('<li class="'+n+'" 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 dg(r,e,t){return e=ug(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function ug(r){var e=hg(r,"string");return typeof e=="symbol"?e:String(e)}function hg(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class cg extends Error{constructor(e,t){super(),dg(this,"node",void 0),this.name="Configuration Error",this.message=e,this.node=t}}const rn=cg,mg=Object.freeze(Object.defineProperty({__proto__:null,ConfigurationError:rn},Symbol.toStringTag,{value:"Module"}));function Se(r,e,t){return e=fg(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function fg(r){var e=vg(r,"string");return typeof e=="symbol"?e:String(e)}function vg(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}function on(r){return r.isStack}function qe(r){return r.isComponent}function _l(r){return r.isRoot}class Ie extends ct{constructor(e,t,n,i){super(),Se(this,"config",void 0),Se(this,"type",void 0),Se(this,"contentItems",void 0),Se(this,"parent",void 0),Se(this,"layoutManager",void 0),Se(this,"element",void 0),Se(this,"childElementContainer",void 0),Se(this,"componentName",void 0),Se(this,"isInitialised",!1),Se(this,"isMaximised",!1),Se(this,"isRoot",!1),Se(this,"isRow",!1),Se(this,"isColumn",!1),Se(this,"isStack",!1),Se(this,"isComponent",!1),Se(this,"tab",void 0),Se(this,"_pendingEventPropagations",void 0),Se(this,"_throttledEvents",void 0),this.element=i,this.config=this._extendItemNode(t),this.type=t.type,this.contentItems=[],this.parent=n,this.layoutManager=e,this._pendingEventPropagations={},this._throttledEvents=["stateChanged"],this.on(ct.ALL_EVENT,this._propagateEvent,this),t.content&&this._createContentItems(t)}callDownwards(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;n!==!0&&i!==!0&&this[e].apply(this,t);for(var o=0;o<this.contentItems.length;o++)this.contentItems[o].callDownwards(e,t,n);n===!0&&i!==!0&&this[e].apply(this,t)}removeChild(e){var t,n=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(n!==!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 n=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]),n===!0&&(e.parent=null,e._$destroy()),this.contentItems[i]=t,t.parent=this,on(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=[],n=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 n(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),n=[],i=0;i<t.length;i++)n.push(t[i].instance);return n}_$getItemsByProperty(e,t){return this.getItemsByFilter(function(n){return n[e]===t})}_$setParent(e){this.parent=e}_$highlightDropZone(e,t,n){var i;(i=this.layoutManager.dropTargetIndicator)===null||i===void 0||i.highlightArea(n)}_$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"),n=null,i=0;i<t.length;i++)n=t[i].getActiveContentItem(),n&&qe(n)&&n.container[e]()}_$destroy(){this.emitBubblingEvent("beforeItemDestroyed"),this.callDownwards("_$destroy",[],!0,!0),this.element.remove(),this.emitBubblingEvent("itemDestroyed")}_$getArea(e){var t,n,i;e=e||this.element;var o=(t=e.offset())!==null&&t!==void 0?t:{left:0,top:0},a=(n=e.width())!==null&&n!==void 0?n: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 yi(e,this);this.emit(e,t)}_createContentItems(e){var t;if(!(e.content instanceof Array))throw new rn("content must be an Array",e);for(var n=0;n<e.content.length;n++)t=this.layoutManager.createContentItem(e.content[n],this),this.contentItems.push(t)}_extendItemNode(e){for(var[t,n]of Object.entries(hl)){var i=t;e[i]===void 0&&(e[i]=n)}return e}_propagateEvent(e,t){t instanceof yi&&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,Ri(this._propagateEventToLayoutManager.bind(this,e,t)))}_propagateEventToLayoutManager(e,t){this._pendingEventPropagations[e]=!1,this.layoutManager.emit(e,t)}}function An(r,e,t){return e=gg(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function gg(r){var e=pg(r,"string");return typeof e=="symbol"?e:String(e)}function pg(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class Pl extends Ie{constructor(e,t,n){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,n,M()),An(this,"config",void 0),An(this,"componentName",void 0),An(this,"container",void 0),An(this,"parent",void 0),An(this,"instance",void 0),this.config=t,this.parent=n;var o=e.getComponent(this.config.componentName)||e.getFallbackComponent(),a=M.extend(!0,{},this.config.componentState||{});if(o==null)throw new rn('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 pi(this.config,this,e),this.instance=new o(this.container,a),this.element=this.container._element}close(){var e;(e=this.parent)===null||e===void 0||e.removeChild(this)}setSize(){this.element.is(":visible")&&this.container._$setSize(this.element.width(),this.element.height())}_$init(){Ie.prototype._$init.call(this),this.container.emit("open")}_$hide(){this.container.hide(),Ie.prototype._$hide.call(this)}_$show(){this.container.show(),this.container._config.isFocusOnShow&&this.container._contentElement[0].focus({preventScroll:!0}),Ie.prototype._$show.call(this)}_$destroy(){this.container.emit("destroy",this),Ie.prototype._$destroy.call(this)}_$getArea(){return null}}function et(r,e,t){return e=bg(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function bg(r){var e=yg(r,"string");return typeof e=="symbol"?e:String(e)}function yg(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class Qn extends Ie{constructor(e,t,n,i){super(t,n,i,M('<div class="lm_item lm_'+(e?"column":"row")+'"></div>')),et(this,"isRow",void 0),et(this,"isColumn",void 0),et(this,"childElementContainer",void 0),et(this,"parent",void 0),et(this,"_splitter",[]),et(this,"_splitterSize",void 0),et(this,"_splitterGrabSize",void 0),et(this,"_isColumn",void 0),et(this,"_dimension",void 0),et(this,"_splitterPosition",null),et(this,"_splitterMinPosition",null),et(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,n){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),Ie.prototype.addChild.call(this,e,t),i=1/this.contentItems.length*100,n===!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 n,i=(n=e.config[this._dimension])!==null&&n!==void 0?n: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)}if(Ie.prototype.removeChild.call(this,e,t),this.contentItems.length===1&&this.config.isClosable===!0){var h;l=this.contentItems[0],this.contentItems=[],(h=this.parent)===null||h===void 0||h.replaceChild(this,l,!0)}else this.callDownwards("setSize"),this.emitBubblingEvent("stateChanged")}replaceChild(e,t){var n=e.config[this._dimension];super.replaceChild(e,t),t.config[this._dimension]=n,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(Ie.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,n=(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-=n:i-=n;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 f=Math.floor((this._isColumn?o:i)-a);return{itemSizes:s,additionalPixel:f,totalWidth:i,totalHeight:o}}_calculateRelativeSizes(){for(var e=0,t=[],n=this._isColumn?"height":"width",i=0;i<this.contentItems.length;i++){var o=this.contentItems[i].config[n];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[n]=(100-e)/t.length;this._respectMinItemWidth();return}if(Math.round(e)>100)for(var s=0;s<t.length;s++)t[s].config[n]=50,e+=50;for(var l=0;l<this.contentItems.length;l++){var d;this.contentItems[l].config[n]=((d=this.contentItems[l].config[n])!==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,n=[],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},n.push(l)),s.push(l)}if(!(o===0||o>i)){var f=o/i;a=o;for(var v=0;v<n.length;v++){l=n[v];var p=Math.round((l.width-t)*f);a-=p,l.width-=p}a!==0&&(s[s.length-1].width-=a);for(var g=0;g<this.contentItems.length;g++)this.contentItems[g].config.width=s[g].width/d.totalWidth*100}}}_createSplitter(e){var t;return t=new Tl(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,n=0,i=0;i<e.length;++i){var o,a;t=Math.max((o=e[i].minWidth)!==null&&o!==void 0?o:0,t),n=Math.max((a=e[i].minHeight)!==null&&a!==void 0?a:0,n)}return{horizontal:t,vertical:n}}_onSplitterDragStart(e){var t,n,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((n=a.after.config.content)!==null&&n!==void 0?n:[]),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,n){var i=this._isColumn?n: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,n,i,o,a,s=this._getItemsForSplitter(e),l=(t=s.before.element[this._dimension]())!==null&&t!==void 0?t:0,d=(n=s.after.element[this._dimension]())!==null&&n!==void 0?n: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}),Ri(this.callDownwards.bind(this,"setSize",void 0,void 0,void 0))}}function oa(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,n)}return t}function aa(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?oa(Object(t),!0).forEach(function(n){Ci(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):oa(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function Ci(r,e,t){return e=Cg(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Cg(r){var e=Sg(r,"string");return typeof e=="symbol"?e:String(e)}function Sg(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class Si extends Ie{constructor(e,t,n){super(e,aa(aa({},t),{},{type:"root"}),null,M('<div class="lm_goldenlayout lm_item lm_root"></div>')),Ci(this,"childElementContainer",void 0),Ci(this,"_containerElement",void 0),this.isRoot=!0,this.type="root",this.childElementContainer=this.element,this._containerElement=n,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 n,i;e=typeof e>"u"?(n=this._containerElement.width())!==null&&n!==void 0?n: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,n){this.layoutManager.tabDropPlaceholder.remove(),super._$highlightDropZone(e,t,n)}_$onDrop(e,t){var n;if(qe(e)&&(n=this.layoutManager.createContentItem({type:"stack",header:e.config.header||{}},this),n._$init(),n.addChild(e),e=n),!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 Qn)||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 sa(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,n)}return t}function gn(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?sa(Object(t),!0).forEach(function(n){Ve(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):sa(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function Ve(r,e,t){return e=wg(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function wg(r){var e=Eg(r,"string");return typeof e=="symbol"?e:String(e)}function Eg(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class wi extends Ie{constructor(e,t,n){var i,o,a,s,l,d,h,c,f;super(e,t,n,M('<div class="lm_item lm_stack"></div>')),Ve(this,"_activeContentItem",null),Ve(this,"_header",void 0),Ve(this,"childElementContainer",M('<div class="lm_items"></div>')),Ve(this,"header",void 0),Ve(this,"parent",void 0),Ve(this,"isStack",!0),Ve(this,"_dropSegment",null),Ve(this,"_contentAreaDimensions",null),Ve(this,"_dropIndex",void 0),Ve(this,"_side",void 0),Ve(this,"_sided",!1),Ve(this,"config",void 0),this.parent=n,this.config=t;var v=e.config;this._side=!1,this._header={show:((i=v.settings)===null||i===void 0?void 0:i.hasHeaders)&&t.hasHeaders!==!1,popout:(o=v.settings)!==null&&o!==void 0&&o.showPopoutIcon?(a=v.labels)===null||a===void 0?void 0:a.popout:void 0,maximise:(s=v.settings)!==null&&s!==void 0&&s.showMaximiseIcon?(l=v.labels)===null||l===void 0?void 0:l.maximise:void 0,close:(d=v.settings)!==null&&d!==void 0&&d.showCloseIcon?(h=v.labels)===null||h===void 0?void 0:h.close:void 0,minimise:(c=(f=v.labels)===null||f===void 0?void 0:f.minimise)!==null&&c!==void 0?c:void 0},v.header&&(this._header=gn(gn({},this._header),v.header)),t.header&&(this._header=gn(gn({},this._header),t.header)),t.content&&t.content[0]&&t.content[0].header&&(this._header=gn(gn({},this._header),t.content[0].header)),this.header=new Mt(e,this),this.element.append(this.header.element),this.element.append(this.childElementContainer),this._setupHeaderPosition(),this._$validateClosability()}setSize(){var e,t,n,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=((n=this.element.width())!==null&&n!==void 0?n: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,n=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(n-1,0)]):this._activeContentItem=null),this._$validateClosability(),this.emitBubblingEvent("stateChanged")}_$validateClosability(){for(var e=this.header._isClosable(),t=0,n=this.contentItems.length;t<n;t++){var i;if(!e)break;e=(i=this.contentItems[t].config.isClosable)!==null&&i!==void 0?i:!1}this.header._$setClosable(e)}_$destroy(){Ie.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",n=this._dropSegment==="left"||this._dropSegment==="right",i=this._dropSegment==="top"||this._dropSegment==="left",o=this.parent instanceof Qn&&(t&&this.parent.isColumn||n&&this.parent.isRow),a=t?"column":"row",s=t?"height":"width";if(qe(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,f=this.layoutManager.createContentItem({type:a},this);(c=this.parent)===null||c===void 0||c.replaceChild(this,f),f.addChild(e,i?0:void 0,!0),f.addChild(this,i?void 0:0,!0),this.config[s]=50,e.config[s]=50,f.callDownwards("setSize")}}_$highlightDropZone(e,t){if(this._contentAreaDimensions)for(var[n,i]of Object.entries(this._contentAreaDimensions)){var o=i.hoverArea;if(o.x1<e&&o.x2>e&&o.y1<t&&o.y2>t){n==="header"?(this._dropSegment="header",this._highlightHeaderDropZone(e)):(this._resetHeaderDropZone(),this._highlightBodyDropZone(n));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 n=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+n*.25,y2:t.y2},highlightArea:{x1:t.x1,y1:t.y1,x2:t.x1+n*.5,y2:t.y2}},this._contentAreaDimensions.top={hoverArea:{x1:t.x1+n*.25,y1:t.y1,x2:t.x1+n*.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+n*.75,y1:t.y1,x2:t.x2,y2:t.y2},highlightArea:{x1:t.x1+n*.5,y1:t.y1,x2:t.x2,y2:t.y2}},this._contentAreaDimensions.bottom={hoverArea:{x1:t.x1+n*.25,y1:t.y1+i*.5,x2:t.x1+n*.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,n,i,o,a,s,l,d,h,c,f,v,p,g,y,P,O=this.header.tabs.length;if(O===0){var _,k,W,Q,N,B,j,Y,ne=this.header.element.offset();(_=this.layoutManager.dropTargetIndicator)===null||_===void 0||_.highlightArea({x1:(k=ne?.left)!==null&&k!==void 0?k:0,x2:((W=ne?.left)!==null&&W!==void 0?W:0)+100,y1:(Q=(N=this.header.element.offset())===null||N===void 0?void 0:N.top)!==null&&Q!==void 0?Q:0,y2:((B=(j=this.header.element.offset())===null||j===void 0?void 0:j.top)!==null&&B!==void 0?B:0)+((Y=this.header.element.innerHeight())!==null&&Y!==void 0?Y:0)});return}var F=this.header.tabsContainer,q=(t=F.get(0))===null||t===void 0?void 0:t.getBoundingClientRect(),K=(n=this.layoutManager.tabDropPlaceholder.get(0))===null||n===void 0?void 0:n.getBoundingClientRect();if(!(!q||!K)){e<q.left?e=q.left+1:e>q.right&&(e=q.right-1);var A,U;if(!(K.left<e&&e<K.right)){for(var z=0;z<O;z++){var me;if(A=this.header.tabs[z].element,U=(me=A.get(0))===null||me===void 0?void 0:me.getBoundingClientRect(),U&&U.left<e&&e<U.right){this._dropIndex=z;break}}if(A&&U&&e<U.left+U.width*.5)A.before(this.layoutManager.tabDropPlaceholder);else if(A){var je;this._dropIndex=Math.min(((je=this._dropIndex)!==null&&je!==void 0?je:0)+1,O),A.after(this.layoutManager.tabDropPlaceholder)}}var De=(i=(o=this.layoutManager.tabDropPlaceholder.offset())===null||o===void 0?void 0:o.left)!==null&&i!==void 0?i:0;De=Math.max(De,(a=(s=this.header.tabsContainer.offset())===null||s===void 0?void 0:s.left)!==null&&a!==void 0?a:0);var b=De+((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)),(f=this.layoutManager.dropTargetIndicator)===null||f===void 0||f.highlightArea({x1:De,x2:b,y1:(v=(p=this.header.element.offset())===null||p===void 0?void 0:p.top)!==null&&v!==void 0?v:0,y2:((g=(y=this.header.element.offset())===null||y===void 0?void 0:y.top)!==null&&g!==void 0?g:0)+((P=this.header.element.innerHeight())!==null&&P!==void 0?P:0)})}}_resetHeaderDropZone(){this.layoutManager.tabDropPlaceholder.remove()}_setupHeaderPosition(){var e=["right","left","bottom"].some(n=>n===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,n,i=(t=this._contentAreaDimensions)===null||t===void 0||(n=t[e])===null||n===void 0?void 0:n.highlightArea;if(i){var o;(o=this.layoutManager.dropTargetIndicator)===null||o===void 0||o.highlightArea(i)}this._dropSegment=e}}const _g=Object.freeze(Object.defineProperty({__proto__:null,AbstractContentItem:Ie,Component:Pl,ContentItem:Ie,Root:Si,RowOrColumn:Qn,Stack:wi,isComponent:qe,isRoot:_l,isStack:on},Symbol.toStringTag,{value:"Module"}));function Ot(r,e,t){return e=Pg(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Pg(r){var e=Tg(r,"string");return typeof e=="symbol"?e:String(e)}function Tg(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class or{constructor(e,t){var n;Ot(this,"header",void 0),Ot(this,"contentItem",void 0),Ot(this,"element",M(or._template)),Ot(this,"titleElement",void 0),Ot(this,"closeElement",void 0),Ot(this,"isActive",!1),Ot(this,"_layoutManager",void 0),Ot(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,(n=this._layoutManager.config.settings)!==null&&n!==void 0&&n.reorderEnabled&&t.config.reorderEnabled&&(this._dragListener=new rr(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),qe(this.contentItem)&&(this.contentItem.container._contentElement.on("focusin",this._onTabContentFocusIn).on("focusout",this._onTabContentFocusOut),this.contentItem.container.tab=this,this.contentItem.container.emit("tab",this))}setTitle(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"";this.titleElement.html(e)}setActive(e){e!==this.isActive&&(this.isActive=e,e?this.element.addClass("lm_active"):this.element.removeClass("lm_active"))}_$destroy(){this.element.off("click",this._onTabClick),this.element.off("auxclick",this._onTabClick),this.closeElement.off("click",this._onCloseClick),qe(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 n;(n=this.contentItem.parent)!==null&&n!==void 0&&n.isMaximised&&this.contentItem.parent.toggleMaximise(),this._dragListener&&new cn(e,t,this._dragListener,this._layoutManager,this.contentItem,this.header.parent)}_onTabContentFocusIn(){M(".lm_focusin",this._layoutManager.root.element).removeClass("lm_focusin"),this.element.addClass("lm_focusin")}_onTabContentFocusOut(){qe(this.contentItem)&&!this.contentItem.container._contentElement[0].contains(document.activeElement)&&this.element.removeClass("lm_focusin")}_onTabClick(e){if(!e||e.button===0){var t,n=this.header.parent.getActiveContentItem();this.contentItem!==n&&qe(this.contentItem)?this.header.parent.setActiveContentItem(this.contentItem):qe(this.contentItem)&&!this.contentItem.container._contentElement[0].contains(document.activeElement)&&this.contentItem.container._contentElement.focus(),qe(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(),qe(this.contentItem)?this.contentItem.container.close():this.header.parent.removeChild(this.contentItem)}_onCloseMousedown(e){e.stopPropagation()}}Ot(or,"_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 ie(r,e,t){return e=Og(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Og(r){var e=Ig(r,"string");return typeof e=="symbol"?e:String(e)}function Ig(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class Mt extends ct{constructor(e,t){var n,i;super(),ie(this,"layoutManager",void 0),ie(this,"element",M(Mt._template)),ie(this,"tabsContainer",void 0),ie(this,"tabDropdownContainer",void 0),ie(this,"tabDropdownSearch",void 0),ie(this,"tabDropdownList",null),ie(this,"controlsContainer",void 0),ie(this,"parent",void 0),ie(this,"tabs",[]),ie(this,"activeContentItem",null),ie(this,"closeButton",null),ie(this,"tabDropdownButton",null),ie(this,"tabNextButton",M(Mt._nextButtonTemplate)),ie(this,"tabPreviousButton",M(Mt._previousButtonTemplate)),ie(this,"holdTimer",null),ie(this,"rAF",null),ie(this,"CLICK_TIMEOUT",500),ie(this,"START_SPEED",.01),ie(this,"ACCELERATION",5e-4),ie(this,"PADDING",10),ie(this,"SCROLL_LEFT","left"),ie(this,"SCROLL_RIGHT","right"),ie(this,"isDraggingTab",!1),ie(this,"isOverflowing",!1),ie(this,"isDropdownShown",!1),ie(this,"dropdownKeyIndex",0),ie(this,"_lastVisibleTabIndex",-1),ie(this,"_tabControlOffset",void 0),this.layoutManager=e,(n=this.layoutManager.config.settings)!==null&&n!==void 0&&n.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 n=0;n<this.tabs.length;n++)if(this.tabs[n].contentItem===e)return;var i=new or(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,n,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||(n=t.scrollIntoView)===null||n===void 0||n.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 n=Math.abs(e.deltaY)>Math.abs(e.deltaX)?e.deltaY:e.deltaX;if(e.deltaMode===WheelEvent.DOM_DELTA_PAGE){var i;n*=(i=this.tabsContainer.innerWidth())!==null&&i!==void 0?i:1}else e.deltaMode===WheelEvent.DOM_DELTA_LINE&&(n*=100/3);t.scrollLeft+=Math.round(n)}}_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 n,i,o,a,s;if(((n=(i=this.tabs[t].element.get(0))===null||i===void 0?void 0:i.offsetLeft)!==null&&n!==void 0?n: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 n,i,o;if(((n=(i=this.tabs[t].element.get(0))===null||i===void 0?void 0:i.offsetLeft)!==null&&n!==void 0?n: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,n;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)===((n=this.tabsContainer.get(0))===null||n===void 0?void 0:n.scrollWidth)?this.tabNextButton.prop("disabled",!0):(this.tabNextButton.prop("disabled",!1),this.tabPreviousButton.first().prop("disabled",!1))}_handleScrollRepeat(e,t){var n,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((n=this.rAF)!==null&&n!==void 0?n:-1),this.rAF=window.requestAnimationFrame(h=>{var c,f,v=o||h,p=h-v,g=this.START_SPEED*p+.5*this.ACCELERATION*(p*p);g=Math.min(g,(c=(f=this.tabsContainer.get(0))===null||f===void 0?void 0:f.scrollWidth)!==null&&c!==void 0?c:1/0),this._handleScrollRepeat(e,t,g,v)})}}_$setClosable(e){return this.closeButton&&this._isClosable()?(this.closeButton.element[e?"show":"hide"](),!0):!1}_$destroy(){this.emit("destroy",this);for(var e=0;e<this.tabs.length;e++)this.tabs[e]._$destroy();this._detachWheelListener(),this._handleItemDropped(),M(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,n,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),n=this._getHeaderSetting("popout"),new Bn(this,n,"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),n=this._getHeaderSetting("close"),this.closeButton=new Bn(this,n,"lm_close",e))}_showAdditionalTabsDropdown(){if(this.isDropdownShown){this._hideAdditionalTabsDropdown();return}this.tabDropdownList=this.tabsContainer.clone(!0).appendTo(this.tabDropdownContainer).children().removeClass("lm_active"),M(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"),M(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 n,i;e.preventDefault(),(n=this.tabDropdownList)===null||n===void 0||n.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 n,i;((n=(i=this.tabs[t].contentItem.config.title)===null||i===void 0?void 0:i.toLowerCase().indexOf(e.target.value.toLowerCase()))!==null&&n!==void 0?n:-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,n;this.isDropdownShown&&(e&&(t=this.tabDropdownContainer.get(0))!==null&&t!==void 0&&t.contains(e.target)||e&&((n=this.tabDropdownButton)===null||n===void 0?void 0:n.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(),M(document).off("mousedown",this._hideAdditionalTabsDropdown)))}_updateAdditionalTabsDropdown(){var e,t,n,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=(n=M(window).height())!==null&&n!==void 0?n:0,l=(i=M(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,f=Math.min(d.left+(c?d.width:0),l-a.width-this.PADDING),v=c?Math.max(d.top-o,this.PADDING):d.bottom,p=s-v-this.PADDING;this.tabDropdownContainer.css({"max-height":p,top:v,left:f})}}}}_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 n;(n=this.tabDropdownButton)===null||n===void 0||n.element.hide(),this.tabNextButton.hide(),this.tabPreviousButton.hide(),this.isOverflowing=!1}this.isOverflowing&&this._checkScrollArrows()}}}}ie(Mt,"_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(""));ie(Mt,"_previousButtonTemplate",['<ul class="lm_controls">','<li class="lm_tabpreviousbutton"></li>',"</ul>"].join(""));ie(Mt,"_nextButtonTemplate",['<li class="lm_tabnextbutton"></li>'].join(""));function Ln(r,e,t){return e=Dg(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Dg(r){var e=xg(r,"string");return typeof e=="symbol"?e:String(e)}function xg(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class Tl{constructor(e,t,n){Ln(this,"_isVertical",void 0),Ln(this,"_size",void 0),Ln(this,"_grabSize",void 0),Ln(this,"_dragListener",void 0),Ln(this,"element",void 0),this._isVertical=e,this._size=t,this._grabSize=n<t?t:n,this.element=this._createElement(),this._dragListener=new rr(this.element)}on(e,t,n){var i;(i=this._dragListener)===null||i===void 0||i.on(e,t,n)}_$destroy(){var e;(e=this._dragListener)===null||e===void 0||e.destroy(),this._dragListener=null,this.element.remove()}_createElement(){var e=M('<div class="lm_drag_handle"></div>'),t=M('<div class="lm_splitter"></div>');t.append(e);var n=this._grabSize-this._size,i=n/2;return this._isVertical?(e.css("top",-i),e.css("height",this._size+n),t.addClass("lm_vertical"),t.height(this._size)):(e.css("left",-i),e.css("width",this._size+n),t.addClass("lm_horizontal"),t.width(this._size)),t}}const Mg=Object.freeze(Object.defineProperty({__proto__:null,BrowserPopout:Cl,DragProxy:cn,DragSource:Sl,DragSourceFromEvent:wl,DropTargetIndicator:ir,Header:Mt,HeaderButton:Bn,Splitter:Tl,Tab:or},Symbol.toStringTag,{value:"Module"}));var Ng={config:Dv,container:Lv,controls:Mg,errors:mg,items:_g,utils:Xv};const Ag=Ng;function la(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,n)}return t}function $e(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?la(Object(t),!0).forEach(function(n){ae(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):la(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function ae(r,e,t){return e=Lg(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Lg(r){var e=Fg(r,"string");return typeof e=="symbol"?e:String(e)}function Fg(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}var da=["column","row","stack","component"];class Kr extends ct{static isLayoutItemConfig(e){return da.includes(e.type)}static minifyConfig(e){return $i(e)}static unminifyConfig(e){return bi(e)}constructor(e,t){super(),ae(this,"isInitialised",!1),ae(this,"_isFullPage",!1),ae(this,"_resizeTimeoutId",void 0),ae(this,"_components",{"lm-react-component":fl}),ae(this,"_fallbackComponent",void 0),ae(this,"_itemAreas",[]),ae(this,"_maximisedItem",null),ae(this,"_maximisePlaceholder",M('<div class="lm_maximise_place"></div>')),ae(this,"_creationTimeoutPassed",!1),ae(this,"_subWindowsCreated",!1),ae(this,"_dragSources",[]),ae(this,"_updatingColumnsResponsive",!1),ae(this,"_firstLoad",!0),ae(this,"_reactChildMap",new Map),ae(this,"_reactChildren",null),ae(this,"_initialHeaderHeight",void 0),ae(this,"width",null),ae(this,"height",null),ae(this,"root",void 0),ae(this,"openPopouts",[]),ae(this,"selectedItem",null),ae(this,"isSubWindow",!1),ae(this,"eventHub",new vl(this)),ae(this,"config",void 0),ae(this,"container",void 0),ae(this,"_originalContainer",void 0),ae(this,"dropTargetIndicator",null),ae(this,"tabDropPlaceholder",M('<div class="lm_drop_tab_placeholder"></div>')),this._onResize=this._onResize.bind(this),this._onUnload=this._onUnload.bind(this),this._windowBlur=this._windowBlur.bind(this),this._windowFocus=this._windowFocus.bind(this),this.config=this._createConfig(e),this._originalContainer=t,this.container=this._getContainer(),this._initialHeaderHeight=this.config.dimensions.headerHeight,this.isSubWindow&&M("body").css("visibility","hidden")}registerComponent(e,t){if(typeof t!="function"&&(t==null||t.render==null||typeof t.render!="function"))throw new Error("Please register a constructor function");if(this._components[e]!==void 0)throw new Error("Component "+e+" is already registered");this._components[e]=t;var n=()=>{if(this._components[e]===void 0)throw new Error("Component "+e+" is not registered");delete this._components[e]};return n}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 Ie))throw new Error("Root must be a ContentItem");var t={settings:$e({},this.config.settings),dimensions:$e({},this.config.dimensions),labels:$e({},this.config.labels),content:[]},n=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?n(t,{contentItems:[e]}):n(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){M(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 ir,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 n=this._reactChildMap.get(e);n===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 n,i;if(this.width=(n=e??this.container.width())!==null&&n!==void 0?n: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(),M(window).off("resize",this._onResize),M(window).off("unload beforeunload",this._onUnload),M(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 n,i;if(typeof e.type!="string")throw new rn("Missing parameter 'type'",e);if(e.type==="react-component"&&(e.type="component",e.componentName="lm-react-component"),!Kr.isLayoutItemConfig(e))throw i="Unknown type '"+e.type+"'. Valid types are "+da.join(","),new rn(i);return e.type==="component"&&!(t instanceof wi)&&t&&!(this.isSubWindow===!0&&t instanceof Si)&&(e={type:"stack",width:e.width,height:e.height,content:[e]}),e.id=(n=e.id)!==null&&n!==void 0?n:Lr(),e.type==="stack"?new wi(this,e,t):e.type==="row"?new Qn(!1,this,e,t):e.type==="column"?new Qn(!0,this,e,t):new Pl(this,e,t)}createPopout(e,t,n,i){var o=[],a=e instanceof Ie,s=this;if(a){var l;o=this.toConfig(e).content,n=Lr();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(n),i==null||Number.isNaN(i)){var f;i=(f=d)===null||f===void 0?void 0:f.contentItems.indexOf(h)}}else e instanceof Array?o=e:o=[e];if(!t&&a){var v,p,g,y=window.screenX||window.screenLeft,P=window.screenY||window.screenTop,O=(v=e.element.offset())!==null&&v!==void 0?v:{left:0,top:0};t={left:y+O.left,top:P+O.top,width:(p=e.element.width())!==null&&p!==void 0?p:0,height:(g=e.element.height())!==null&&g!==void 0?g: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||!n||i===void 0)){var _=new Cl(o,t,n,i,this);return _.on("initialised",function(){s.emit("windowOpened",_)}),_.on("closed",function(){s._$reconcilePopoutWindows()}),this.openPopouts.push(_),_}}createDragSource(e,t){this.config.settings.constrainDragToContainer=!1;var n=new Sl(e,t,this);return this._dragSources.push(n),n}createDragSourceFromEvent(e,t){return this.config.settings.constrainDragToContainer=!1,new wl(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,n;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((n=this.container.height())!==null&&n!==void 0?n: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 n=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&&n>a.surface&&(n=a.surface,i=a)}return i}_$createRootItemAreas(){var e=50,t=$e({},this.root._$getArea()),n=[$e($e({},t),{},{side:"left",x2:t.x1+e}),$e($e({},t),{},{side:"right",x1:t.x2-e}),$e($e({},t),{},{side:"top",y2:t.y1+e}),$e($e({},t),{},{side:"bottom",y1:t.y2-e})];n.forEach(i=>{i.surface=(i.x2-i.x1)*(i.y2-i.y1)}),this._itemAreas.push(...n)}_$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 n=e[t];if(on(n)){var i=n._$getArea();if(i!==null)if(i instanceof Array)this._itemAreas=this._itemAreas.concat(i);else{var o;this._itemAreas.push(i);var a=$e($e({},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 Ie)return e;if(M.isPlainObject(e)&&e.type){var n=this.createContentItem(e,t??null);return n.callDownwards("_$init"),n}else throw new Error("Invalid contentItem")}_$reconcilePopoutWindows(){for(var e=[],t=0;t<this.openPopouts.length;t++){var n;((n=this.openPopouts[t].getWindow())===null||n===void 0?void 0:n.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=n=>{if(e.push(n),n.contentItems instanceof Array)for(var i=0;i<n.contentItems.length;i++)t(n.contentItems[i])};return t(this.root),e}_bindEvents(){this._isFullPage&&M(window).resize(this._onResize),M(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,n=ml("gl-window");n&&(this.isSubWindow=!0,e=JSON.parse(localStorage.getItem(n)||"{}"),e=bi(e),localStorage.removeItem(n)),e=M.extend(!0,{},dl,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=M('<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=ji((e=this.config.content[0].title)!==null&&e!==void 0?e:""),M("head").append(M("body link, body style, template, .gl_keep")),this.container=M("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?M(this._originalContainer):M("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,M("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 rn(t,e);if(e.content.length>1)throw t="Top level content can't contain more then one element.",new rn(t,e);this.root=new Si(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,n=e*t;if(!(this.width==null||n<=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(n){e.addChild(n),t.removeChild(n,!0)}):t.contentItems.forEach(n=>{this._addChildContentItemsToContainer(e,n)})}_findAllStackContainers(){var e=[];return this._findAllStackContainersRecursive(e,this.root),e}_findAllStackContainersRecursive(e,t){t.contentItems.forEach(n=>{on(n)?e.push(n):n.isComponent||this._findAllStackContainersRecursive(e,n)})}}ae(Kr,"__lm",Ag);const kg=Kr,Rg="_lm_dragging_k4a5m_1",jg="_lm_goldenlayout_k4a5m_1",$g="_lm_header_k4a5m_1",Hg="_lm_controls_k4a5m_1",Bg="_lm_tabpreviousbutton_k4a5m_1",Wg="_lm_tabnextbutton_k4a5m_1",Ug="_lm_tab_k4a5m_1",Vg="_lm_active_k4a5m_1",Kg="_lm_close_tab_k4a5m_1",zg="_lm_content_k4a5m_1",Gg="_lm_dragProxy_k4a5m_1",qg="_lm_dropTargetIndicator_k4a5m_1",Zg="_march_k4a5m_1",Xg="_lm_inner_k4a5m_1",Yg="_lm_splitter_k4a5m_1",Qg="_lm_selectable_k4a5m_1",Jg="_lm_tabdropdown_list_k4a5m_1",ep="_lm_title_k4a5m_1",tp="_lm_title_before_k4a5m_1",np="_lm_selected_k4a5m_1",rp="_lm_focusin_k4a5m_1",ip="_lm_window_blur_k4a5m_1",op="_lm_popout_k4a5m_1",ap="_lm_maximise_k4a5m_1",sp="_lm_tabdropdown_k4a5m_1",lp="_lm_close_k4a5m_1",dp="_lm_tabdropdown_search_k4a5m_1",up="_lm_tabs_k4a5m_1",hp="_lm_keyboard_active_k4a5m_1",cp="_lm_maximised_k4a5m_1",mp="_lm_items_k4a5m_1",ua={"tab-height":"28px","drag-border-width":"5px",lm_dragging:Rg,lm_goldenlayout:jg,lm_header:$g,lm_controls:Hg,lm_tabpreviousbutton:Bg,lm_tabnextbutton:Wg,lm_tab:Ug,lm_active:Vg,lm_close_tab:Kg,lm_content:zg,lm_dragProxy:Gg,lm_dropTargetIndicator:qg,march:Zg,lm_inner:Xg,lm_splitter:Yg,lm_selectable:Qg,lm_tabdropdown_list:Jg,lm_title:ep,lm_title_before:tp,lm_selected:np,lm_focusin:rp,lm_window_blur:ip,lm_popout:op,lm_maximise:ap,lm_tabdropdown:sp,lm_close:lp,lm_tabdropdown_search:dp,lm_tabs:up,lm_keyboard_active:hp,lm_maximised:cp,lm_items:mp},ha=Object.freeze({tabHeight:parseInt(ua["tab-height"],10),dragBorderWidth:parseInt(ua["drag-border-width"],10)});function ca(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,n)}return t}function Tt(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?ca(Object(t),!0).forEach(function(n){Ol(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):ca(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function Ol(r,e,t){return e=fp(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function fp(r){var e=vp(r,"string");return typeof e=="symbol"?e:String(e)}function vp(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}var kt=V.module("LayoutUtils");function Il(r){return r.componentName!==void 0}function Cn(r){var e=r;return(Il(r)&&r.componentName==="lm-react-component"||r.type==="react-component")&&e.component!==void 0}function yr(r){return r.focus!==void 0}function ma(r){return r.type==="stack"}class x{static activateTab(e,t){var n=x.getStackForRoot(e,t,!1);if(!n){kt.error("Could not find stack for config",t);return}var i=x.getContentItemInStack(n,t);i&&n.setActiveContentItem(i)}static isActiveTab(e,t){var n=x.getStackForRoot(e,t,!1);if(!n)return kt.error("Could not find stack for config",t),!1;var i=x.getContentItemInStack(n,t),o=n.getActiveContentItem();return o===i}static addStack(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;if(_l(e)){var n={type:t?"column":"row"};(e.contentItems==null||e.contentItems.length===0)&&e.addChild(n);var i=e.contentItems[0],o=t?i.isColumn:i.isRow;if(!o){e.removeChild(i,!0),e.addChild(n);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;if(!l){var d={type:t?"row":"column"};e.addChild(d),e.removeChild(s,!0),e.contentItems[e.contentItems.length-1].addChild(s),s=e.contentItems[e.contentItems.length-1]}return this.addStack(s,!t)}static getStackById(e,t){var n,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;if(i&&on(e)&&e.contentItems.length===0)return e;if(t===((n=e.config)===null||n===void 0?void 0:n.id)){if(on(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]:{},n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;if(n&&on(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&&qi(o.config,t))return e;var a=this.getStackForConfig(o,t,n);if(a)return a}return null}static getStackForRoot(e,t){var n=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&&n&&(a=this.addStack(e)),a}static getStackForComponentTypes(e,t){for(var n=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=x.getStackForRoot(e,{component:s},n&&l,i,o);if(d)return d}return null}static getContentItemInStack(e,t){if(!e)return null;for(var n=0;n<e.contentItems.length;n+=1){var i=e.contentItems[n];if(i.isComponent&&i.config!=null&&qi(i.config,t))return i}return null}static dehydrateLayoutConfig(e,t){if(e==null||!e.length)return[];for(var n=[],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?n.push(l):kt.debug2('dehydrateLayoutConfig: skipping unmapped component "'.concat(a,'"'))}else if(s){var d=Tt(Tt({},o),{},{content:x.dehydrateLayoutConfig(s,t)});n.push(d)}else n.push(o)}return n}static getTabPoint(e){var{tab:t}=e;if(t==null)throw new Error("Cannot get tab for panel container ".concat(e));var n=t.element[0].getBoundingClientRect();return[n.left+n.width*.5,n.bottom-8]}static dropLayoutMinorChange(e){for(var t=0;t<e.length;t+=1){var n=e[t],{content:i}=n;i!==void 0?(ma(n)&&delete n.activeItemIndex,x.dropLayoutMinorChange(i)):Cn(n)&&n.component==="IrisGridPanel"&&n.props.panelState!=null&&(delete n.id,n.props.panelState.irisGridState.sorts=[],n.props.panelState.irisGridState.quickFilters=[],n.props.panelState.gridState.isStuckToBottom=!1,n.props.panelState.gridState.isStuckToRight=!1)}}static isEqual(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,i=x.cloneLayout(e),o=x.cloneLayout(t);return n?(x.dropLayoutMinorChange(i),x.dropLayoutMinorChange(o),qn(i,o)):qn(i,o)}static cloneLayout(e){return JSON.parse(JSON.stringify(e))}static hydrateLayoutConfig(e,t){if(e==null||!e.length)return[];for(var n=[],i=0;i<e.length;i+=1){var o=e[i];if(Cn(o)){var a,{component:s,props:l={}}=o;n.push(Tt(Tt({},o),{},{id:(a=o?.id)!==null&&a!==void 0?a:zt(),props:t(s,l)}))}else if(o.content!==void 0){var d=x.hydrateLayoutConfig(o.content,t);ma(o)&&o.activeItemIndex!=null&&o.activeItemIndex>=d.length&&(kt.warn("Fixing bad activeItemIndex!",o.activeItemIndex,o),o.activeItemIndex=0),n.push(Tt(Tt({},o),{},{content:d}))}else n.push(o)}return n}static openComponent(){var{root:e,config:t,stack:n=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=Tt({},t);if(h.id==null&&(h.id=zt()),l!=null){e?.layoutManager.createDragSourceFromEvent(h,l);return}var c=o||{id:h.id,component:h.component};R(e);var f=n??(a?x.addStack(e):x.getStackForRoot(e,c));R(f);var v=x.getContentItemInStack(f,c);if(s!=null){var p=y=>{kt.debug("Component created, focusing element",s),f.off("componentCreated",p);var{element:P}=y.origin;requestAnimationFrame(()=>{x.focusElement(P[0],s)})};f.on("componentCreated",p)}if(i&&v){var g=f.contentItems.indexOf(v);f.addChild(h,g+1),f.removeChild(v),f.setActiveContentItem(f.contentItems[g])}else f.addChild(h);s==null&&d&&yr(d)&&d.focus()}static openComponentInStack(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,i=document.activeElement,o={id:t.id},a=x.getContentItemInStack(e,o);if(n&&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&&yr(i)&&i.focus()}static closeComponent(e,t,n){var i=x.getStackForRoot(e,t,!1,!1,!1);if(!i){kt.warn("Cannot find stack for component, ignoring close",t);return}var o=x.getContentItemInStack(i,t),a=document.activeElement;o&&(qe(o)?o.container.close(n):i.removeChild(o)),a&&document.contains(a)&&yr(a)&&a.focus()}static renameComponent(e,t,n){var i=x.getStackForRoot(e,t,!1);if(!i){kt.error("Could not find stack for config",t);return}var o=x.getContentItemInStack(i,t);o&&o.setTitle(n)}static cloneComponent(e,t){var n=x.getStackForRoot(e,t,!1);if(!n)return kt.error("Could not find stack for config",t),null;var{props:i={}}=t,o=x.getPanelComponentState(t),a={type:"react-component",component:t.component,props:Tt(Tt({},i),{},{panelState:o}),title:"".concat(t.title," Copy"),id:zt()};return x.openComponentInStack(n,a),a}static getPanelComponentState(e){if(Il(e)){var t;return(t=e.componentState)===null||t===void 0?void 0:t.panelState}if(Cn(e)){var n;return(n=e.props)===null||n===void 0?void 0:n.panelState}return null}static makeDefaultLayout(){return{dimensions:{headerHeight:ha.tabHeight,borderWidth:ha.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=x.getComponentConfigFromContainer(e);return t?t.id:null}static getIdFromPanel(e){var{glContainer:t}=e.props;return x.getIdFromContainer(t)}static getComponentNameFromPanel(e){var{glContainer:t}=e.props,n=x.getComponentConfigFromContainer(t);if(n&&Cn(n)){var i;return(i=n.component)!==null&&i!==void 0?i:null}return null}static getComponentName(e){var t,n,i=(t=(n=e.WrappedComponent)===null||n===void 0?void 0:n.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]:x.DEFAULT_FOCUS_SELECTOR;if(e==null)return null;var n=e.querySelector(t);return n==null?null:(yr(n)&&n.focus(),n)}static onInitialized(e){return new Promise(t=>{if(e.isInitialised){t();return}var n=()=>{e.off("initialised",n),t()};e.on("initialised",n)})}}Ol(x,"DEFAULT_FOCUS_SELECTOR","input, select, textarea, button");var gp=H.forwardRef((r,e)=>{var t=x.getComponentNameFromPanel({props:r});return u.jsx("div",{ref:e,className:"panel-placeholder",children:u.jsxs("div",{children:['Component "',t,'" is not registered.']})})});gp.displayName="PanelPlaceholder";var te=Object.freeze({FOCUS:"PanelEvent.FOCUS",MOUNT:"PanelEvent.MOUNT",UNMOUNT:"PanelEvent.UNMOUNT",TITLE_CHANGED:"PanelEvent.TITLE_CHANGED",REOPEN:"PanelEvent.REOPEN",REOPEN_LAST:"PanelEvent.REOPEN_LAST",DELETE:"PanelEvent.DELETE",CLONED:"PanelEvent.CLONED",CLOSED:"PanelEvent.CLOSED",OPEN:"PanelEvent.OPEN",CLOSE:"PanelEvent.CLOSE",DRAGGING:"PanelEvent.DRAGGING",DROPPED:"PanelEvent.DROPPED"}),{listen:IC,emit:pp,useListener:DC}=yl(te.OPEN);function bp(r){return typeof r.id=="string"&&r.layout instanceof kg&&r.panelManager instanceof Wi&&typeof r.registerComponent=="function"}function yp(r){if(!bp(r))throw new Error("Expected dashboard plugin props, but instead received ".concat(r))}function fa(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,n)}return t}function va(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?fa(Object(t),!0).forEach(function(n){Ht(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):fa(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function Ht(r,e,t){return e=Cp(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Cp(r){var e=Sp(r,"string");return typeof e=="symbol"?e:String(e)}function Sp(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}var tt=V.module("PanelManager");class Wi{constructor(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:(s,l)=>l,n=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]:()=>{};Ht(this,"layout",void 0),Ht(this,"hydrateComponent",void 0),Ht(this,"dehydrateComponent",void 0),Ht(this,"onPanelsUpdated",void 0),Ht(this,"closed",void 0),Ht(this,"openedMap",void 0),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=n,this.onPanelsUpdated=a,this.openedMap=new Map(i),this.closed=[...o],this.startListening()}startListening(){var{eventHub:e}=this.layout;e.on(te.FOCUS,this.handleFocus),e.on(te.MOUNT,this.handleMount),e.on(te.UNMOUNT,this.handleUnmount),e.on(te.REOPEN,this.handleReopen),e.on(te.REOPEN_LAST,this.handleReopenLast),e.on(te.DELETE,this.handleDeleted),e.on(te.CLOSED,this.handleClosed),e.on(te.CLOSE,this.handleControlClose)}stopListening(){var{eventHub:e}=this.layout;e.off(te.FOCUS,this.handleFocus),e.off(te.MOUNT,this.handleMount),e.off(te.UNMOUNT,this.handleUnmount),e.off(te.REOPEN,this.handleReopen),e.off(te.REOPEN_LAST,this.handleReopenLast),e.off(te.DELETE,this.handleDeleted),e.off(te.CLOSED,this.handleClosed),e.off(te.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 x.getComponentConfigFromContainer(t)})}getOpenedPanelConfigsOfType(e){return this.getOpenedPanelConfigs().filter(t=>t!=null&&Cn(t)&&t.component===e)}getOpenedPanelById(e){return this.openedMap.get(e)}getContainerByPanelId(e){var t,n=x.getStackForConfig(this.layout.root,{id:e});return(t=n&&x.getContentItemInStack(n,{id:e}))!==null&&t!==void 0?t:null}getLastUsedPanel(e){for(var t=this.getOpenedPanels(),n=t.length-1;n>=0;n-=1){var i=t[n];if(e==null||e(i))return i}}getLastUsedPanelOfType(e){return this.getLastUsedPanelOfTypes([e])}getLastUsedPanelOfTypes(e){return this.getLastUsedPanel(t=>e.some(n=>Ir(n)&&t instanceof n.WrappedComponent||!Ir(n)&&t instanceof n))}updatePanel(e){var t=x.getIdFromPanel(e);if(t==null){tt.error("updatePanel Panel did not have an ID",e);return}tt.debug2("Updating panel ID ".concat(t," in open panels map")),this.openedMap.delete(t),this.openedMap.set(t,e)}removePanel(e){var t=x.getIdFromPanel(e);if(t==null){tt.error("removePanel Panel did not have an ID",e);return}if(!this.openedMap.has(t)){tt.error("Missing panel ID ".concat(t," in open panels map"));return}if(this.openedMap.get(t)!==e){tt.debug("Panel argument doesn't match the open panels map entry for ".concat(t,", removePanel ignored"));return}tt.debug2("Removing panel ID ".concat(t," from open panels map")),this.openedMap.delete(t)}removeClosedPanelConfig(e){var t=this.closed.findIndex(n=>n===e||n.id!=null&&e.id!=null&&n.id===e.id);t>=0&&this.closed.splice(t,1)}handleFocus(e){tt.debug2("Focus: ",e),this.updatePanel(e)}handleMount(e){tt.debug2("Mount: ",e),this.updatePanel(e),this.sendUpdate()}handleUnmount(e){tt.debug2("Unmount: ",e),this.removePanel(e),this.sendUpdate()}handleReopen(e,t){tt.debug2("Reopen:",e,t),this.removeClosedPanelConfig(e);var{component:n}=e,{props:i}=e;i=this.hydrateComponent(n,i);var o=va(va({},e),{},{props:i}),{root:a}=this.layout,s=e.parentStackId===void 0?void 0:x.getStackById(a,e.parentStackId);x.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 n=(t=x.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===n){this.handleReopen(o);return}}}}handleDeleted(e){tt.debug2("Deleted:",e),this.removeClosedPanelConfig(e),this.sendUpdate()}handleClosed(e,t){tt.debug2("Closed: ",e),this.addClosedPanel(t),this.sendUpdate()}handleControlClose(e){var t={id:e},{root:n}=this.layout;x.closeComponent(n,t)}addClosedPanel(e){var{root:t}=this.layout,n=x.getComponentConfigFromContainer(e);if(n&&Cn(n)){var i=this.dehydrateComponent(n.component,n);if(i!=null){var o;i.parentStackId=(o=x.getStackForConfig(t,n))===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)})}}Ht(Wi,"MAX_CLOSED_PANEL_COUNT",100);var wp=V.module("PanelErrorBoundary");class Ep 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,n=x.getIdFromContainer(e);wp.debug("componentWillUnmount",n),t.emit(te.CLOSED,n,e)}render(){var{children:e}=this.props,{error:t}=this.state;return t!=null?u.jsx("div",{className:"panel-error-boundary",children:u.jsx(dn,{errorMessage:"".concat(t),isLoading:!1,isLoaded:!1})}):e}}function ga(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,n)}return t}function kr(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?ga(Object(t),!0).forEach(function(n){_p(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):ga(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function _p(r,e,t){return e=Pp(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Pp(r){var e=Tp(r,"string");return typeof e=="symbol"?e:String(e)}function Tp(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}function Dl(r){var{props:e,componentState:t}=r,{metadata:n}=e,{panelState:i=null}=e;t&&({panelState:i}=t);var o={};return n!=null&&(o.metadata=n),i!=null&&(o.panelState=i),kr(kr({},r),{},{componentState:null,props:o,type:"react-component"})}function xl(r){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";return kr(kr({},r),{},{localDashboardId:e})}const Op={dehydrate:Dl,hydrate:xl};var Ip=H.createContext(void 0),Dp=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}),Ml=S.shape({on:S.func,off:S.func,emit:S.func}),xp=S.shape({registerComponent:S.func,root:S.shape({addChild:S.func}),on:S.func,off:S.func,eventHub:Ml}),Mp=Object.freeze({Container:Dp,EventHub:Ml,Layout:xp});function Fn(r,e,t,n){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.");H.useEffect(()=>{var a=r(o,e,t,n);return()=>{a()}},[e,n,t,o,r])}function Me(r,e,t){m.useEffect(function(){return r.on(e,t),()=>{r.off(e,t)}},[r,e,t])}var Nl="SET_DASHBOARD_DATA";const Np=yc(Nl,{},!1),Ap={dashboardData:Np};var Lp=new Map,Al=Object.freeze({}),Fp=Object.freeze([]),xC=Ti,MC=qa,NC=Jl,kp=r=>r.dashboardData,Ae=(r,e)=>{var t;return(t=kp(r)[e])!==null&&t!==void 0?t:Al},AC=(r,e)=>{var t;return(t=Ae(r,e).closed)!==null&&t!==void 0?t:Fp},LC=(r,e)=>{var t;return(t=Ae(r,e).openedMap)!==null&&t!==void 0?t:Lp},Ll=(r,e)=>{var t;return(t=Ae(r,e).pluginDataMap)!==null&&t!==void 0?t:Al},FC=(r,e,t)=>Ll(r,e)[t];function pa(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,n)}return t}function Sn(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?pa(Object(t),!0).forEach(function(n){Rp(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):pa(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function Rp(r,e,t){return e=jp(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function jp(r){var e=$p(r,"string");return typeof e=="symbol"?e:String(e)}function $p(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}var Fl=(r,e)=>({type:Nl,id:r,payload:e}),Xt=(r,e)=>(t,n)=>t(Fl(r,Sn(Sn({},Ae(n(),r)),e))),kC=(r,e,t)=>(n,i)=>n(Fl(r,Sn(Sn({},Ae(i(),r)),{},{pluginDataMap:Sn(Sn({},Ll(i(),r)),{},{[e]:t})})));Object.entries(Ap).map(r=>{var[e,t]=r;return Rd.register(e,t)});function Hp(r){var{children:e}=r;return u.jsx(u.Fragment,{children:e})}function ba(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,n)}return t}function kn(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?ba(Object(t),!0).forEach(function(n){Bp(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):ba(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function Bp(r,e,t){return e=Wp(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Wp(r){var e=Up(r,"string");return typeof e=="symbol"?e:String(e)}function Up(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}var Cr=V.module("DashboardLayout"),Vp=Object.freeze({}),Kp=[],ya=()=>{},zp=1e3,Ca=r=>r;function Gp(r){var e,t,{id:n,children:i,emptyDashboard:o=u.jsx("div",{children:"Dashboard is empty."}),layout:a,layoutConfig:s=Kp,onLayoutChange:l=ya,onLayoutInitialized:d=ya,hydrate:h=xl,dehydrate:c=Dl,panelWrapper:f=Hp}=r,v=Ti(),p=(e=qa(b=>Ae(b,n)))!==null&&e!==void 0?e:Vp,[g,y]=m.useState(!1),[P,O]=m.useState(!1),[_,k]=m.useState(),[W]=m.useState((t=p?.closed)!==null&&t!==void 0?t:[]),[Q,N]=m.useState(a.getReactChildren()),B=m.useMemo(()=>new Map,[]),j=m.useMemo(()=>new Map,[]),Y=m.useCallback(function(b,w){var T,G=arguments.length>2&&arguments[2]!==void 0?arguments[2]:h,J=arguments.length>3&&arguments[3]!==void 0?arguments[3]:c;Cr.debug2("registerComponent",b,w,G,J);function Qe(Z,re){var he=w,_e=f,Xr=dh(he),{glContainer:cr,glEventHub:Yr}=Z;return u.jsx(Ep,{glContainer:cr,glEventHub:Yr,children:u.jsx(_e,kn(kn({},Z),{},{children:Xr?u.jsx(he,kn(kn({},Z),{},{ref:re})):u.jsx(he,kn({},Z))}))})}Qe.displayName="DashboardWrapper(".concat((T=w.displayName)!==null&&T!==void 0?T:b,")");var I=a.registerComponent(b,H.forwardRef(Qe));return B.set(b,G),j.set(b,J),I},[h,c,B,j,a,f]),ne=m.useCallback((b,w)=>{var T;return((T=B.get(b))!==null&&T!==void 0?T:Ca)(w,n)},[B,n]),F=m.useCallback((b,w)=>{var T;return((T=j.get(b))!==null&&T!==void 0?T:Ca)(w,n)},[j,n]),q=m.useMemo(()=>new Wi(a,ne,F,new Map,W,b=>{var{closed:w,openedMap:T}=b;v(Xt(n,{closed:w,openedMap:T}))}),[F,v,ne,n,W,a]),K=Iu(b=>{var w=_==null||!x.isEqual(_,b);Cr.debug("handleLayoutStateChanged",w,b),w&&(y(a.root.contentItems.length===0),k(b),l(b),N(a.getReactChildren()))},zp,{flushOnUnmount:!0});m.useEffect(()=>()=>K.flush(),[K]);var A=m.useCallback(()=>{if(!P){var b=a.toConfig(),w=b.content,T=x.dehydrateLayoutConfig(w,F);K(T)}},[F,P,a,K]),U=m.useCallback(b=>{var w=x.getIdFromContainer(b);a.eventHub.emit(te.DRAGGING,w),O(!0)},[a.eventHub]),z=m.useCallback(b=>{var w=x.getIdFromContainer(b);a.eventHub.emit(te.DROPPED,w),O(!1)},[a.eventHub]),me=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(),T="".concat(w,"-component");b.element.addClass(T)}},[]),je=m.useCallback(()=>{N(a.getReactChildren())},[a]);Me(a,"stateChanged",A),Me(a,"itemPickedUp",U),Me(a,"itemDropped",z),Me(a,"componentCreated",me),Me(a.eventHub,te.TITLE_CHANGED,A),Me(a,"reactChildrenChanged",je);var De=Du(s);return m.useEffect(function(){if(De!==s&&s!==_){Cr.debug("Setting new layout content...");for(var w=x.hydrateLayoutConfig(s,ne);a.root.contentItems.length>0;)a.root.contentItems[0].remove();for(var T=0;T<w.length;T+=1)a.root.addChild(w[T]);y(a.root.contentItems.length===0)}},[ne,a,s,_,q,De]),m.useEffect(()=>d(),[]),u.jsxs(u.Fragment,{children:[g&&o,Q,H.Children.map(i,b=>b!=null?u.jsx(kh,{fallback:[],children:H.cloneElement(b,{id:n,layout:a,panelManager:q,registerComponent:Y})}):null)]})}Gp.propTypes={id:S.string.isRequired,children:S.node,data:S.shape({}),emptyDashboard:S.node,layout:Mp.Layout.isRequired,layoutConfig:S.arrayOf(S.shape({})),onLayoutChange:S.func,onLayoutInitialized:S.func};var RC="default";function ar(r,e,t){return e=qp(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function qp(r){var e=Zp(r,"string");return typeof e=="symbol"?e:String(e)}function Zp(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class Mn{}ar(Mn,"SESSION_OPENED","ConsoleEvent.SESSION_OPENED");ar(Mn,"SESSION_CLOSED","ConsoleEvent.SESSION_CLOSED");ar(Mn,"FOCUS_HISTORY","ConsoleEvent.FOCUS_HISTORY");ar(Mn,"SEND_COMMAND","ConsoleEvent.SEND_COMMAND");ar(Mn,"SETTINGS_CHANGED","ConsoleEvent.SETTINGS_CHANGED");const it=Mn;function Yt(r,e,t){return e=Xp(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Xp(r){var e=Yp(r,"string");return typeof e=="symbol"?e:String(e)}function Yp(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class Nt{}Yt(Nt,"TABLE_CHANGED","InputFilterEvent.TABLE_CHANGED");Yt(Nt,"COLUMNS_CHANGED","InputFilterEvent.COLUMNS_CHANGED");Yt(Nt,"FILTERS_CHANGED","InputFilterEvent.FILTERS_CHANGED");Yt(Nt,"CLEAR_ALL_FILTERS","InputFilterEvent.CLEAR_ALL_FILTERS");Yt(Nt,"COLUMN_SELECTED","InputFilterEvent.COLUMN_SELECTED");Yt(Nt,"OPEN_DROPDOWN","InputFilterEvent.OPEN_DROPDOWN");Yt(Nt,"OPEN_INPUT","InputFilterEvent.OPEN_INPUT");Yt(Nt,"OPEN_FILTER_SET_MANAGER","InputFilterEvent.OPEN_FILTER_SET_MANAGER");const Sa=Nt,jC=Object.freeze({OPEN:"MarkdownEvent.OPEN"});function At(r,e,t){return e=Qp(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Qp(r){var e=Jp(r,"string");return typeof e=="symbol"?e:String(e)}function Jp(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class wt{}At(wt,"CREATE_NOTEBOOK","NotebookEvent.createNotebook");At(wt,"SELECT_NOTEBOOK","NotebookEvent.selectNotebook");At(wt,"CLOSE_FILE","NotebookEvent.closeFile");At(wt,"RENAME","NotebookEvent.rename");At(wt,"RENAME_FILE","NotebookEvent.renameFile");At(wt,"REGISTER_FILE","NotebookEvent.registerFile");At(wt,"SEND_TO_NOTEBOOK","NotebookEvent.sendToNotebook");At(wt,"UNREGISTER_FILE","NotebookEvent.unregisterFile");At(wt,"PROMOTE_FROM_PREVIEW","NotebookEvent.promoteFromPreview");const de=wt;function Nn(r,e,t){return e=eb(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function eb(r){var e=tb(r,"string");return typeof e=="symbol"?e:String(e)}function tb(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class mn{}Nn(mn,"focus","TabEvent.focus");Nn(mn,"blur","TabEvent.blur");Nn(mn,"openPQObject","TabEvent.openPQObject");Nn(mn,"openControl","TabEvent.openControl");Nn(mn,"reload","TabEvent.reload");Nn(mn,"clearAllFilters","TabEvent.clearAllFilters");const Sr=mn;function nb(r,e,t){return e=rb(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function rb(r){var e=ib(r,"string");return typeof e=="symbol"?e:String(e)}function ib(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class kl 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,n,{glContainer:i}=this.props;return[...(e=i==null||(t=i.tab)===null||t===void 0||(n=t.header)===null||n===void 0?void 0:n.tabs)!==null&&e!==void 0?e:[]]}handleCloseTab(){var{glContainer:e}=this.props;e.close()}handleCloseTabsAll(){var e=this.getAllTabs();e.forEach(t=>{var n;return(n=(t?.contentItem).container)===null||n===void 0?void 0:n.close()})}handleCloseTabsRight(){for(var{glContainer:e}=this.props,t=this.getAllTabs(),n=t.length-1;n>0;n-=1){var i,o,a,s,l,d,h;if(((i=t[n].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[n])===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(te.REOPEN_LAST,e)}canCloseTabsRight(){for(var{glContainer:e}=this.props,t=this.getAllTabs(),n=!0,i=t.length-1;i>0;i-=1){var o,a,s,l,d,h,c,f;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 v=!!(!((h=t[i])===null||h===void 0||(c=h.contentItem)===null||c===void 0||(f=c.config)===null||f===void 0)&&f.isClosable);if(v){n=!1;break}}return n}canCloseAny(){for(var e=this.getAllTabs(),t=!0,n=e.length-1;n>0;n-=1){var i,o,a,s=!!(!((i=e[n])===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:n,glContainer:i}=this.props,o=(e=x.getStackForConfig(i.layoutManager.root,i.getConfig()))===null||e===void 0?void 0:e.config.id;return!((t=n.data.closed)!==null&&t!==void 0&&t.some(a=>a.parentStackId===o))}render(){var e,t,n,{additionalActions:i,glContainer:o}=this.props,a=[...i];a.push(()=>({title:"Re-open closed panel",group:ee.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||(n=t.config)===null||n===void 0?void 0:n.isClosable;return a.push({title:"Close",order:10,group:ee.groups.low,action:this.handleCloseTab,disabled:s===void 0||!s}),a.push(()=>({title:"Close Tabs to Right",order:20,group:ee.groups.low,action:this.handleCloseTabsRight,disabled:this.canCloseTabsRight()})),a.push(()=>({title:"Close All",order:30,group:ee.groups.low,action:this.handleCloseTabsAll,disabled:this.canCloseAny()})),u.jsx(ee,{actions:a})}}nb(kl,"defaultProps",{additionalActions:[]});var ob=r=>({workspace:Bs(r)}),ab=In(ob,{setWorkspace:Ws})(kl);const sb=ab;function Rl(r,e,t){return e=lb(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function lb(r){var e=db(r,"string");return typeof e=="symbol"?e:String(e)}function db(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class jl extends m.PureComponent{constructor(e){super(e),Rl(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=H.createRef();var{value:t}=e;this.state={value:t,valueWasValidated:!1}}componentDidUpdate(e){var{isShown:t}=e,{isShown:n}=this.props;n&&!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,n=t?.trim();if(n!==void 0&&n!==""){var{onSubmit:i}=this.props;i(n)}else this.setState({value:n,valueWasValidated:!0})}renderRenameDialog(){var{isShared:e,isOwner:t,itemType:n}=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(n,"-input"),children:["Rename ",n]}),u.jsx("input",{type:"text",className:"form-control",id:"rename-dialog-".concat(n,"-input"),value:i??void 0,ref:this.renameInputRef,onChange:this.handleRenameInputChange,required:!0}),u.jsxs("div",{className:"invalid-feedback",children:[n," name cannot be empty"]}),(e||!t)&&u.jsxs("div",{className:"pt-2",children:["Renaming this ",n," will rename for all users."]})]}),u.jsxs("div",{className:"text-right",children:[u.jsx(se,{kind:"secondary",className:"mr-2",onClick:this.handleRenameCancel,children:"Cancel"}),u.jsx(se,{kind:"primary",type:"submit",children:"Rename"})]})]})}render(){var{isShown:e,onCancel:t}=this.props;return u.jsx(Di,{isShown:e,onEntered:this.handleRenameDialogOpened,onExited:t,options:{placement:"bottom"},interactive:!0,closeOnBlur:!0,children:this.renderRenameDialog()})}}Rl(jl,"defaultProps",{isShared:!1,isOwner:!0,itemType:"Item",value:""});function wa(r,e,t){return e=ub(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function ub(r){var e=hb(r,"string");return typeof e=="symbol"?e:String(e)}function hb(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}var cb=V.module("Panel");class mb extends m.PureComponent{constructor(e){super(e),wa(this,"ref",void 0),wa(this,"getAdditionalActions",yt((n,i,o)=>{var a=[];return i&&a.push(this.getCloneAction()),o&&a.push(this.getRenameAction()),[...a,...n]})),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=H.createRef();var{glContainer:t}=this.props;this.state={title:x.getTitleFromContainer(t),showRenameDialog:!1,isWithinPanel:!0}}componentDidMount(){var e,t,{componentPanel:n,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(it.SESSION_CLOSED,this.handleSessionClosed),o.on(it.SESSION_OPENED,this.handleSessionOpened),o.on(Sr.focus,this.handleTabFocus),o.on(Sr.blur,this.handleTabBlur),o.on(Sa.CLEAR_ALL_FILTERS,this.handleClearAllFilters),o.emit(te.MOUNT,n??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:n}=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),n.off(it.SESSION_CLOSED,this.handleSessionClosed),n.off(it.SESSION_OPENED,this.handleSessionOpened),n.off(Sr.focus,this.handleTabFocus),n.off(Sr.blur,this.handleTabBlur),n.off(Sa.CLEAR_ALL_FILTERS,this.handleClearAllFilters),n.emit(te.UNMOUNT,e??this)}handleTab(e){e!=null&&this.setState({title:x.getTitleFromTab(e)}),this.forceUpdate();var{onTab:t}=this.props;t?.(e)}handleTabClicked(e){var{onTabClicked:t}=this.props;t?.(e)}handleClearAllFilters(){for(var{onClearAllFilters:e}=this.props,t=arguments.length,n=new Array(t),i=0;i<t;i++)n[i]=arguments[i];e?.(...n)}handleFocus(e){var{componentPanel:t,glEventHub:n}=this.props;n.emit(te.FOCUS,t??this);var{onFocus:i}=this.props;i?.(e)}handleBlur(e){var{onBlur:t}=this.props;t?.(e)}handleHide(){for(var{onHide:e}=this.props,t=arguments.length,n=new Array(t),i=0;i<t;i++)n[i]=arguments[i];e?.(...n)}handleResize(){for(var{onResize:e}=this.props,t=arguments.length,n=new Array(t),i=0;i<t;i++)n[i]=arguments[i];e?.(...n)}handleSessionClosed(e){var{onSessionClose:t}=this.props;t?.(e)}handleSessionOpened(e,t){var{onSessionOpen:n}=this.props;n?.(e,t)}handleBeforeShow(){for(var{onBeforeShow:e}=this.props,t=arguments.length,n=new Array(t),i=0;i<t;i++)n[i]=arguments[i];e?.(...n)}handleShow(){for(var{onShow:e}=this.props,t=arguments.length,n=new Array(t),i=0;i<t;i++)n[i]=arguments[i];e?.(...n)}handleTabBlur(){for(var{onTabBlur:e}=this.props,t=arguments.length,n=new Array(t),i=0;i<t;i++)n[i]=arguments[i];e?.(...n)}handleTabFocus(){for(var{onTabFocus:e}=this.props,t=arguments.length,n=new Array(t),i=0;i<t;i++)n[i]=arguments[i];e?.(...n)}handleRenameCancel(){this.setState({showRenameDialog:!1})}handleShowRenameDialog(){this.setState({showRenameDialog:!0})}handleRenameSubmit(e){var{glContainer:t}=this.props;this.setState({showRenameDialog:!1,title:e});var n=x.getRootFromContainer(t),i=x.getComponentConfigFromContainer(t);R(i),x.renameComponent(n,i,e)}handleCopyPanel(){var{glContainer:e,glEventHub:t}=this.props,n=x.getRootFromContainer(e),i=x.getComponentConfigFromContainer(e);if(i==null){cb.error("Could not get component config from container",e);return}var o=x.cloneComponent(n,i);o!==null&&t.emit(te.CLONED,this,o)}getCloneAction(){return{title:"Copy Panel",order:10,group:ee.groups.high,action:this.handleCopyPanel}}getRenameAction(){return{title:"Rename",order:10,group:ee.groups.medium,action:this.handleShowRenameDialog}}render(){var{children:e,className:t,renderTabTooltip:n,glContainer:i,glEventHub:o,additionalActions:a=Xd,errorMessage:s,isLoaded:l=!0,isLoading:d=!1,isClonable:h=!1,isRenamable:c=!1}=this.props,{tab:f}=i,{showRenameDialog:v,title:p,isWithinPanel:g}=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(dn,{errorMessage:s,isLoaded:l,isLoading:d}),!g&&f!=null&&jr.createPortal(u.jsxs(u.Fragment,{children:[u.jsx(sb,{glContainer:i,glEventHub:o,additionalActions:this.getAdditionalActions(a,h,c)}),c&&u.jsx(jl,{isShown:v,value:p,itemType:"Panel",onCancel:this.handleRenameCancel,onSubmit:this.handleRenameSubmit}),n!=null&&u.jsx(qt,{interactive:!0,options:{placement:"bottom"},popperClassName:"panel-tab-popper",children:n()})]}),f.element[0])]})}}const sr=mb,$C=Object.freeze({DEFAULT:"DEFAULT",LINKER:"LINKER"});var fb=Object.freeze({}),vb=new Map,zr=Object.freeze([]),HC=(r,e)=>{var t;return(t=Ae(r,e).columns)!==null&&t!==void 0?t:zr},BC=(r,e)=>{var t;return(t=Ae(r,e).filterSets)!==null&&t!==void 0?t:zr},WC=(r,e)=>{var t;return(t=Ae(r,e).filters)!==null&&t!==void 0?t:zr},UC=(r,e)=>{var t;return(t=Ae(r,e).tableMap)!==null&&t!==void 0?t:vb},VC=(r,e)=>Ae(r,e).isolatedLinkerPanelId,$l=(r,e)=>{var t;return(t=Ae(r,e).links)!==null&&t!==void 0?t:zr},KC=(r,e)=>Ae(r,e).columnSelectionValidator,zC=(r,e)=>{var t;return(t=Ae(r,e).consoleSettings)!==null&&t!==void 0?t:fb},GC=(r,e)=>Ae(r,e).connection,lr=(r,e)=>Ae(r,e).sessionWrapper,qC=(r,e)=>t=>t(Xt(r,{connection:e})),ZC=(r,e)=>t=>t(Xt(r,{sessionWrapper:e})),Hl=(r,e)=>t=>t(Xt(r,{links:e})),XC=(r,e)=>(t,n)=>{var i=$l(n(),r),o=e.filter(a=>i.findIndex(s=>qn(s.start,a.start)&&qn(s.end,a.end))<0);return t(Hl(r,i.concat(o)))},YC=(r,e)=>(t,n)=>{var i=$l(n(),r),o=i.filter(a=>!e.includes(a.id));return t(Hl(r,o))},QC=(r,e)=>t=>t(Xt(r,{isolatedLinkerPanelId:e})),JC=(r,e)=>t=>t(Xt(r,{columnSelectionValidator:e})),gb=(r,e)=>t=>t(Xt(r,{consoleSettings:e})),eS=(r,e)=>t=>t(Xt(r,{filterSets:e}));function Rr(r,e,t){return e=pb(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function pb(r){var e=bb(r,"string");return typeof e=="symbol"?e:String(e)}function bb(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}var wr=V.module("CommandHistoryPanel");class dr extends m.Component{static handleError(e){wr.error(e)}constructor(e){super(e),Rr(this,"container",void 0),Rr(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=H.createRef(),this.pending=new xn;var{session:t,sessionId:n,language:i}=e;this.state={panelState:{},session:t,sessionId:n,language:i,contextActions:[{action:this.handleFocusHistory,shortcut:Re.COMMAND_HISTORY.FOCUS_HISTORY}]}}componentDidMount(){var{glEventHub:e,session:t}=this.props;e.on(it.FOCUS_HISTORY,this.handleFocusHistory),t!=null&&this.loadTable()}componentWillUnmount(){var{glEventHub:e}=this.props;e.off(it.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:n,sessionId:i}=t;this.setState({session:e,sessionId:i,language:n},()=>{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:n,language:i}=this.state;if(wr.debug("handleSendToNotebook",n,e),!n){wr.error("Session is not connected.");return}var{glEventHub:o}=this.props;o.emit(t?de.CREATE_NOTEBOOK:de.SEND_TO_NOTEBOOK,n,i,e)}handleSendToConsole(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;wr.debug("handleSendToConsole",e);var{glEventHub:i}=this.props;i.emit(it.SEND_COMMAND,e,t,n)}loadTable(){var{commandHistoryStorage:e}=this.props,{language:t,sessionId:n}=this.state;R(t),R(n),this.pending.add(e.getTable(t,n,Date.now()),i=>i.close()).then(i=>{this.setState({table:i})}).catch(dr.handleError)}render(){var{glContainer:e,glEventHub:t,commandHistoryStorage:n}=this.props,{language:i,contextActions:o,table:a}=this.state;return u.jsxs(sr,{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(If,{ref:this.container,language:i,sendToNotebook:this.handleSendToNotebook,sendToConsole:this.handleSendToConsole,table:a,commandHistoryStorage:n}),u.jsx(ee,{actions:o})]})]})}}Rr(dr,"COMPONENT","CommandHistoryPanel");Rr(dr,"TITLE","Command History");var yb=(r,e)=>{var t=$s(r),n=lr(r,e.localDashboardId),{session:i,config:o}=n??{},{type:a,id:s}=o??{};return{commandHistoryStorage:t,language:a,session:i,sessionId:s}},Cb=In(yb,null,null,{forwardRef:!0})(dr);const Sb=Cb;var wb=m.createContext(null),ur=Object.freeze({AUTH_PLUGIN:"AuthPlugin",DASHBOARD_PLUGIN:"DashboardPlugin",WIDGET_PLUGIN:"WidgetPlugin",TABLE_PLUGIN:"TablePlugin",THEME_PLUGIN:"ThemePlugin"});function Eb(r){return"DashboardPlugin"in r}function _b(r){return"AuthPlugin"in r}function Pb(r){return"TablePlugin"in r}function tS(r){return Eb(r)||_b(r)||Pb(r)}function Tb(r){return"type"in r&&r.type===ur.DASHBOARD_PLUGIN}function Ui(r){return"type"in r&&r.type===ur.WIDGET_PLUGIN}function Ob(r){return"type"in r&&r.type===ur.TABLE_PLUGIN}function Ib(r){return"type"in r&&r.type===ur.AUTH_PLUGIN}function Bl(r){return"type"in r&&r.type===ur.THEME_PLUGIN}function nS(r){return Tb(r)||Ib(r)||Ob(r)||Bl(r)||Ui(r)}var Db=V.module("@deephaven/plugin.PluginUtils");function Ea(r,e){return r==null||!Ui(r)?!1:[r.supportedTypes].flat().some(t=>t===e)}function xb(r){var e=u.jsx(ue,{icon:ns});if(!Ui(r))return e;var{icon:t}=r;return t==null?e:m.isValidElement(t)?t:u.jsx(ue,{icon:t})}function rS(r){var e=[...r.entries()].filter(t=>Bl(t[1]));return Db.debug("Getting theme data from plugins",e),e.map(t=>{var[n,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:jd(n,s),name:s,styleContent:d}})}).flat()}function iS(){return tr(wb,"No Plugins available in usePlugins. This can happen when plugins have not finished loading or if code is not wrapped in PluginsContext.Provider.")}function _a(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,n)}return t}function Er(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?_a(Object(t),!0).forEach(function(n){an(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):_a(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function an(r,e,t){return e=Mb(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Mb(r){var e=Nb(r,"string");return typeof e=="symbol"?e:String(e)}function Nb(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}var _r=V.module("ConsolePanel"),Ab=500,Lb=Object.freeze({consoleSettings:{},itemIds:[]});class Gr extends m.PureComponent{constructor(e){super(e),an(this,"consoleRef",void 0),an(this,"objectSubscriptionCleanup",void 0),an(this,"savePanelState",_n(()=>{var{consoleSettings:a,itemIds:s}=this.state,l={consoleSettings:a,itemIds:[...s]};_r.debug("Saving panel state",l),this.setState({panelState:l})},Ab)),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=H.createRef();var{panelState:t}=e,n=Er(Er({},Lb),t||{}),{consoleSettings:i,itemIds:o}=n;this.state={consoleSettings:i,itemIds:new Map(o),objectMap:new Map,error:void 0,panelState:n}}componentDidMount(){var{glEventHub:e}=this.props;this.closeDisconnectedPanels(),e.on(te.MOUNT,this.handlePanelMount),this.subscribeToFieldUpdates()}componentDidUpdate(e,t){var{consoleSettings:n,itemIds:i}=this.state;(t.consoleSettings!==n||t.itemIds!==i)&&this.savePanelState()}componentWillUnmount(){var e,{glEventHub:t}=this.props;this.savePanelState.flush(),t.off(te.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(n=>{_r.debug("Got updates",n),this.setState(i=>{var{objectMap:o}=i,{updated:a,created:s,removed:l}=n,d=[...a,...l],h=new Map(o);d.forEach(f=>{var{title:v}=f;v!==void 0&&h.delete(v)});var c=[...a,...s];return c.forEach(f=>{f.title!==void 0&&h.set(f.title,f)}),{objectMap:h}})})}}setItemId(e,t){this.setState(n=>{var{itemIds:i}=n,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:n}=this.state,i=n.get(e);return i==null&&t&&(i=zt(),this.setItemId(e,i)),i}handleTabFocus(){var e;(e=this.consoleRef.current)===null||e===void 0||e.focus()}handlePanelMount(e){var t,n,i,{itemIds:o}=this.state,a=e==null||(t=e.props)===null||t===void 0?void 0:t.id,s=e==null||(n=e.props)===null||n===void 0||(i=n.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(it.FOCUS_HISTORY)}handleResize(){this.updateDimensions()}handleShow(){this.updateDimensions()}handleOpenObject(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,{root:n}=this.context,i=e.title!=null?this.getItemId(e.title,!1):null;(t||i!=null&&x.getStackForRoot(n,{id:i},!1,!1,!1)!=null)&&this.openWidget(e)}handleCloseObject(e){var{title:t}=e;if(t!==void 0){var n=this.getItemId(t,!1);if(n!=null){var{glEventHub:i}=this.props;i.emit(te.CLOSE,n)}}}handleSettingsChange(e){var{glEventHub:t}=this.props;_r.debug("handleSettingsChange",e),this.setState({consoleSettings:e}),t.emit(it.SETTINGS_CHANGED,e)}openWidget(e){var{glEventHub:t,sessionWrapper:n}=this.props;R(n);var{config:i,session:o}=n,{title:a=e.name}=e;R(a);var s=this.getItemId(a),l={fetch:()=>o.getObject(e),panelId:s,widget:Er(Er({},ec(e)),{},{sessionId:i.id})};_r.debug("openWidget",l),pp(t,l)}addCommand(e){var t,n=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,n,i)}closeDisconnectedPanels(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,{consoleSettings:t,itemIds:n}=this.state,{isClosePanelsOnDisconnectEnabled:i=!0}=t;if(!(!i&&!e)){var o=[...n.values()],{glEventHub:a}=this.props;o.forEach(s=>{a.emit(te.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(n=>Ea(n,e))}iconForType(e){var{plugins:t}=this.props,n=[...t.values()].find(i=>Ea(i,e));return n!=null?xb(n):u.jsx(Cc,{type:e})}render(){var{commandHistoryStorage:e,glContainer:t,glEventHub:n,sessionWrapper:i,timeZone:o,unzip:a}=this.props;if(i==null)return u.jsx(dn,{isLoading:!1,errorMessage:"Console is disabled."});var{consoleSettings:s,error:l,objectMap:d}=this.state,{config:h,session:c,connection:f,details:v={},dh:p}=i,{workerName:g,processInfoId:y}=v,{id:P,type:O}=h;return u.jsx(sr,{className:"iris-panel-console",componentPanel:this,glContainer:t,glEventHub:n,onResize:this.handleResize,onShow:this.handleShow,onTabFocus:this.handleTabFocus,errorMessage:l!=null?"".concat(l):void 0,children:c!=null&&u.jsx(sf,{dh:p,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:Vs.LANGUAGE_MAP.get(O)}),g!=null&&u.jsxs(u.Fragment,{children:[u.jsx("div",{children:"•"}),g]}),y!=null&&u.jsxs(u.Fragment,{children:[u.jsx("div",{children:"•"}),y,u.jsx("div",{children:"•"})]}),u.jsx(Ov,{connection:f,defaultUpdateInterval:10*1e3,hoverUpdateInterval:3*1e3,monitorDuration:10*60*1e3})]}),scope:P,timeZone:o,objectMap:d,unzip:a,supportsType:this.supportsType,iconForType:this.iconForType})})}}an(Gr,"COMPONENT","ConsolePanel");an(Gr,"TITLE","Console");an(Gr,"contextType",Ip);var Fb=(r,e)=>({commandHistoryStorage:$s(r),sessionWrapper:lr(r,e.localDashboardId),timeZone:sc(r),plugins:dc(r)}),kb=In(Fb,null,null,{forwardRef:!0})(Gr);const li=kb;function oS(r){return r==="file"||r==="directory"}function ht(r){return r.type==="directory"}function Rb(r,e,t){return e=jb(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function jb(r){var e=$b(r,"string");return typeof e=="symbol"?e:String(e)}function $b(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class Hb extends Error{constructor(){super("No file exists at the path specified"),Rb(this,"isFileNotFound",!0)}}const Vi=Hb;function Pa(r,e,t,n,i,o,a){try{var s=r[o](a),l=s.value}catch(d){t(d);return}s.done?e(l):Promise.resolve(l).then(n,i)}function Ta(r){return function(){var e=this,t=arguments;return new Promise(function(n,i){var o=r.apply(e,t);function a(l){Pa(o,n,i,a,s,"next",l)}function s(l){Pa(o,n,i,a,s,"throw",l)}a(void 0)})}}var xt;(function(r){r.GROOVY="text/x-groovy",r.PLAIN_TEXT="text/plain",r.PYTHON="text/x-python",r.PYTHON_COMPILED="application/x-python-code",r.SCALA="text/x-scala",r.UNKNOWN=""})(xt||(xt={}));class vt{static fileExists(e,t){return Ta(function*(){try{return yield e.info(t),!0}catch(n){if(!(n instanceof Vi))throw n;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(!vt.hasPath(e))throw new Error("Invalid path provided: ".concat(e));var n=(t=e.match(/\//g))!==null&&t!==void 0?t:[];return n.length-1}static getExtension(e){var t=this.getBaseName(e).split(".");if(t.length>1){var n;return(n=t.pop())!==null&&n!==void 0?n:""}return""}static getBaseName(e){var t;return(t=e.split("/").pop())!==null&&t!==void 0?t:""}static getCopyFileName(e){var t=e.lastIndexOf("."),n=null,i=null;t<0?i=e:(i=e.substring(0,t),n=e.substring(t+1));var o=i?"".concat(i,"-copy"):"Copy";return n!==null?"".concat(o,".").concat(n):o}static getUniqueCopyFileName(e,t){return Ta(function*(){for(var n=vt.getCopyFileName(t);yield vt.fileExists(e,n);)n=vt.getCopyFileName(n);return n})()}static getMimeType(e){var t=this.getExtension(e).toLowerCase();switch(t){case"groovy":return xt.GROOVY;case"py":return xt.PYTHON;case"pyc":return xt.PYTHON_COMPILED;case"scala":return xt.SCALA;case"txt":return xt.PLAIN_TEXT;default:return xt.UNKNOWN}}static getParent(e){if(!vt.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(!vt.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]:"",n=e.lastIndexOf("."),i=n>-1?e.substring(0,n):e,o=vt.fileExtensionToString(t);return"".concat(i).concat(o)}static validateName(e){var t=[".",".."],n=/[\\/\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(n.test(e)){var o,a;throw new Vn('Invalid characters in name: "'.concat((o=(a=e.match(n))===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(n=>vt.isPath(n));return e.filter(n=>!t.some(i=>n!==i&&n.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)}}const $=vt;var Ki=26;function Ei(r){return ht(r)?$.makePath(r.filename):$.getPath(r.filename)}function Oa(r,e){if(r.length===0||e==null)throw new Error("No items to move");var t=Ei(e);if(r.some(n=>{var{filename:i}=n;return $.getPath(i)===t}))throw new Error("File already in the destination folder");if(r.some(n=>ht(n)&&t.startsWith($.makePath(n.filename))))throw new Error("Destination folder cannot be a child of a dragged folder");return{files:r,targetPath:t}}function Bb(r){if(ht(r))return r.isExpanded?$d:Hd;var e=$.getMimeType(r.basename);switch(e){case xt.PYTHON:return Wd;default:return Bd}}function _i(r){var e,{children:t,draggedItems:n,isDragInProgress:i,isDropTargetValid:o,isSelected:a,item:s,itemIndex:l,dropTargetItem:d,onDragStart:h,onDragOver:c,onDragEnd:f,onDrop:v}=r,p=(e=n?.some(N=>N.id===s.id))!==null&&e!==void 0?e:!1,g=Ei(s),y=i&&d?Ei(d):null,P=i&&o&&ht(s)&&y===g,O=i&&o&&y===g,_=i&&!o&&y===g,k=Bb(s),W=$.getDepth(s.filename),Q=Array(W).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":p,"is-exact-drop-target":P,"is-in-drop-target":O,"is-invalid-drop-target":_,"is-selected":a}),onDragStart:N=>h(l,N),onDragOver:N=>c(l,N),onDragEnd:N=>f(l,N),onDrop:N=>v(l,N),draggable:!0,role:"presentation","aria-label":s.basename,children:[Q," ",u.jsx(ue,{icon:k,className:"item-icon",fixedWidth:!0})," ",u.jsx("span",{className:"truncation-wrapper",children:t??u.jsxs(u.Fragment,{children:[s.basename,u.jsx(qt,{children:s.basename})]})})]})}function Ia(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,n)}return t}function Pr(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Ia(Object(t),!0).forEach(function(n){Wb(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):Ia(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function Wb(r,e,t){return e=Ub(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Ub(r){var e=Vb(r,"string");return typeof e=="symbol"?e:String(e)}function Vb(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}var Le=V.module("FileList"),Kb=500,Da="item-list-scroll-pane";function zb(r){var{isMultiSelect:e=!1,table:t,onFocusChange:n=()=>{},onMove:i,onSelect:o,onSelectionChange:a=()=>{},renderItem:s=_i,rowHeight:l=Ki,overscanCount:d=Ye.DEFAULT_OVERSCAN}=r,[h,c]=m.useState(()=>({items:[],offset:0,itemCount:0})),[f,v]=m.useState({top:0,bottom:0}),[p,g]=m.useState(),[y,P]=m.useState(),[O,_]=m.useState(),[k,W]=m.useState([]),Q=m.useRef(),N=m.useRef(null),B=m.useRef(null),j=m.useCallback(I=>{if(I.length===0||h==null)return[];for(var Z=[],re=0;re<I.length;re+=1)for(var he=I[re],_e=he[0];_e<=he[1];_e+=1)_e>=h.offset&&_e<h.offset+h.items.length&&Z.push(h.items[_e-h.offset]);return Z},[h]),Y=m.useCallback(I=>{var Z=j([[I,I]]);if(Z.length>0)return Z[0]},[j]),ne=m.useCallback(()=>{var I=It.count(k);if(I===0)return null;if(I===1){var Z=k[0][0],re=Y(Z);if(re!=null)return re.filename}return"".concat(I," items")},[Y,k]),F=m.useCallback(I=>{if(!(!y||!p)){Le.debug("dropItems",y,"to",I);try{var{files:Z,targetPath:re}=Oa(y,p);if(i?.(Z,re),I!=null){var he;W([[I,I]]),(he=N.current)===null||he===void 0||he.focusItem(I)}}catch(_e){Le.error("Unable to complete move",_e)}}},[y,p,i]),q=m.useCallback((I,Z)=>{var re=h.items[I-h.offset];re!==void 0&&(Le.debug("handleItemClick",re),o(re,Z),ht(re)&&t?.setExpanded(re.filename,!re.isExpanded))},[h,o,t]),K=m.useCallback((I,Z)=>{var re;Le.debug2("handleItemDragStart",I,k);var he=k;It.isSelected(k,I)||(he=[[I,I]],W(he)),P(j(he)),(re=N.current)===null||re===void 0||re.resetMouseState();var _e=document.createElement("div");_e.innerHTML='<div class="dnd-placeholder-content">'.concat(ne(),"</div>"),_e.className="file-list-dnd-placeholder",document.body.appendChild(_e),Z.dataTransfer.setDragImage(_e,0,0),Z.dataTransfer.effectAllowed="move",_(_e)},[ne,j,k]),A=m.useCallback((I,Z)=>{Z.preventDefault(),Le.debug2("handleItemDragOver",Z),g(Y(I))},[Y]),U=m.useCallback((I,Z)=>{Le.debug("handleItemDragEnd",I),O?.remove(),P(void 0),g(void 0),_(void 0)},[O]),z=m.useCallback((I,Z)=>{F(I)},[F]),me=m.useCallback(()=>{Le.debug2("handleItemDragExit"),g(void 0)},[]),je=m.useCallback(I=>{I.target instanceof Element&&I.target.classList.contains(Da)&&(I.preventDefault(),Le.debug2("handleListDragOver",I),g({type:"directory",filename:"/",basename:"/",id:"/"}))},[]),De=m.useCallback(I=>{I.target instanceof Element&&I.target.classList.contains(Da)&&(Le.debug("handleListDrop"),F())},[F]),b=m.useCallback(function(I){var Z=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(Le.debug2("handleSelectionChange",I),Z===!0||I!==k){W(I);var re=j(I);a(re)}},[j,a,k]),w=m.useCallback(I=>{if(Le.debug2("handleFocusChange",I),I!=null){var[Z]=j([[I,I]]);n(Z)}else n();Q.current=I},[j,n]),T=m.useCallback((I,Z)=>{Le.debug("handleViewportChange",I,Z),(I!==f.top||Z!==f.bottom)&&v({top:I,bottom:Z})},[f]),G=m.useMemo(()=>{if(!y||!p)return!1;try{return Oa(y,p),Le.debug("handleValidateDropTarget true"),!0}catch{return Le.debug("handleValidateDropTarget false"),!1}},[y,p]),{focusedPath:J}=r;m.useEffect(()=>{J!==void 0&&(J==="/"?t.collapseAll():(t.setExpanded(J,!1),t.setExpanded(J,!0)))},[t,J]),m.useEffect(function(){Le.debug("updating table viewport",f),t?.setViewport({top:Math.max(0,f.top-d),bottom:f.bottom+d})},[d,t,f]),m.useEffect(function(){var Z=t.onUpdate(re=>{c({items:re.items.map(he=>Pr(Pr({},he),{},{itemName:he.basename})),offset:re.offset,itemCount:t.size})});return()=>{Z()}},[t]),m.useEffect(function(){Q.current!=null&&w(Q.current),k.length>0&&b(k,!0)},[h,w,b,k]),m.useEffect(function(){if(p!=null&&ht(p)&&p.filename!=="/"){var Z=setTimeout(()=>{p.isExpanded||t?.setExpanded(p.filename,!0)},Kb);return()=>clearTimeout(Z)}},[p,t]);var Qe=m.useCallback(I=>s(Pr(Pr({},I),{},{isDragInProgress:y!=null,dropTargetItem:p,draggedItems:y,isDropTargetValid:G,onDragStart:K,onDragEnd:U,onDragOver:A,onDragExit:me,onDrop:z})),[U,me,A,K,z,y,p,G,s]);return u.jsx("div",{ref:B,className:X("file-list",{"is-dragging":y!=null}),onDragOver:je,onDrop:De,children:u.jsx(Ye,{ref:N,items:h.items,itemCount:h.itemCount,offset:h.offset,onFocusChange:w,onSelect:q,onSelectionChange:b,onViewportChange:T,selectedRanges:k,renderItem:Qe,rowHeight:l,isMultiSelect:e,isDragSelect:!1,isDeselectOnClick:!1})})}var Gb={name:"File Explorer",DELETE:ce.createAndAdd({id:"FILE_EXPLORER.DELETE",name:"Delete",shortcut:[D.DELETE],macShortcut:[L.CMD,D.BACKSPACE]}),RENAME:ce.createAndAdd({id:"FILE_EXPLORER.RENAME",name:"Rename",shortcut:[D.ENTER],macShortcut:[D.ENTER]})};const xa={FILE_EXPLORER:Gb};var Ma=V.module("FileListItemEditor"),qb=()=>Promise.resolve();function Zb(r){var{item:e,onCancel:t,onSubmit:n,validate:i=qb}=r,o=m.useRef(null),[a,s]=m.useState(e.basename),[l,d]=m.useState(),[h,c]=m.useState(Promise.resolve()),f=m.useCallback(()=>{var O;(O=o.current)===null||O===void 0||O.focus()},[o]),v=m.useCallback(O=>O.stopPropagation(),[]),p=m.useCallback(()=>{h.then(()=>{n(a)}).catch(O=>Ma.info("Unable to validate name",O))},[n,a,h]);m.useEffect(function(){var _=Ee.makeCancelable(i(a));return _.then(()=>d(void 0)).catch(k=>{Ee.isCanceled(k)||d(k)}),c(_),()=>_.cancel()},[i,a]),m.useEffect(function(){f()},[f]);var g=m.useCallback(()=>{Ma.debug2("handleBlur"),p()},[p]),y=m.useCallback(O=>{var{value:_}=O.target;s(_)},[]),P=m.useCallback(O=>{O.stopPropagation();var{key:_}=O;switch(_){case"Enter":{p();break}case"Escape":{t();break}}},[t,p]);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:g,onKeyDown:P,onChange:y,onClick:v,onDoubleClick:v,onMouseDown:v}),l&&u.jsx("div",{className:"invalid-feedback",children:"".concat(l)})]})}function Na(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,n)}return t}function di(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Na(Object(t),!0).forEach(function(n){Xb(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):Na(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function Xb(r,e,t){return e=Yb(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Yb(r){var e=Qb(r,"string");return typeof e=="symbol"?e:String(e)}function Qb(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}function Wl(r){var{isMultiSelect:e=!1,focusedPath:t,showContextMenu:n=!1,onCreateFile:i,onCreateFolder:o,onCopy:a,onDelete:s,onMove:l,onRename:d,onSelect:h,onSelectionChange:c,table:f,rowHeight:v=Ki,validateRename:p=()=>Promise.resolve()}=r,[g,y]=m.useState(),[P,O]=m.useState([]),[_,k]=m.useState(),W=m.useCallback(z=>{O(z),c?.(z)},[c]),Q=m.useCallback(z=>{k(z)},[]),N=m.useCallback(()=>{_&&a?.(_)},[_,a]),B=m.useCallback(()=>{P.length>0&&s?.(P)},[s,P]),j=m.useCallback(()=>{i?.()},[i]),Y=m.useCallback(()=>{_&&o?.($.getPath(_.filename))},[_,o]),ne=m.useCallback(()=>{_&&y(_)},[_]),F=m.useCallback(()=>{y(void 0)},[]),q=m.useCallback(z=>{g&&(d?.(g,z),y(void 0))},[d,g]),K=m.useMemo(()=>{if(g)return[];var z=[];return i&&z.push({title:"New File",description:"Create new file",action:j,group:ee.groups.medium}),o&&z.push({title:"New Folder",description:"Create new folder",action:Y,group:ee.groups.medium}),a&&z.push({title:"Copy File",description:"Copy the selected file",action:N,group:ee.groups.low,disabled:_==null||ht(_)}),s&&P.length>0&&z.push({title:"Delete",description:"Delete",shortcut:xa.FILE_EXPLORER.DELETE,action:B,group:ee.groups.low}),d&&z.push({title:"Rename",description:"Rename",shortcut:xa.FILE_EXPLORER.RENAME,action:ne,group:ee.groups.low,disabled:_==null}),z},[N,B,j,Y,ne,_,a,i,o,s,d,P,g]),A=m.useCallback(z=>(R(g),p(g,z)),[g,p]),U=m.useCallback(z=>{var{item:me}=z;return g&&g.filename===me.filename?u.jsx(_i,di(di({},z),{},{children:u.jsx(Zb,{item:me,validate:A,onSubmit:q,onCancel:F})})):u.jsx(_i,di({},z))},[F,q,g,A]);return u.jsxs("div",{className:"file-list-container",children:[f!=null&&u.jsx(zb,{onMove:l,onSelect:h,onSelectionChange:W,onFocusChange:Q,renderItem:U,rowHeight:v,table:f,isMultiSelect:e,focusedPath:t}),n&&u.jsx(ee,{actions:K})]})}Wl.displayName="FileListContainer";function Aa(r,e,t){return e=Jb(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Jb(r){var e=ey(r,"string");return typeof e=="symbol"?e:String(e)}function ey(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class ty extends Vn{constructor(e){super("Name already exists"),Aa(this,"isExistingFile",!0),Aa(this,"info",void 0),this.info=e}}const Or=ty;function La(r,e,t,n,i,o,a){try{var s=r[o](a),l=s.value}catch(d){t(d);return}s.done?e(l):Promise.resolve(l).then(n,i)}function Fa(r){return function(){var e=this,t=arguments;return new Promise(function(n,i){var o=r.apply(e,t);function a(l){La(o,n,i,a,s,"next",l)}function s(l){La(o,n,i,a,s,"throw",l)}a(void 0)})}}var ft=V.module("FileExplorer");function zi(r){var{storage:e,isMultiSelect:t=!1,focusedPath:n,onCopy:i=()=>{},onDelete:o=()=>{},onRename:a=()=>{},onCreateFile:s=()=>{},onCreateFolder:l=()=>{},onSelect:d,onSelectionChange:h,rowHeight:c=Ki}=r,[f,v]=m.useState([]),[p,g]=m.useState();m.useEffect(function(){var q;function K(){return A.apply(this,arguments)}function A(){return A=Fa(function*(){ft.debug("initTable"),q=Ee.makeCancelable(e.getTable(),U=>U.close());try{g(yield q)}catch(U){Ee.isCanceled(U)||ft.error("Unable to initialize table",U)}}),A.apply(this,arguments)}return K(),()=>{q.cancel()}},[e]);var y=m.useCallback(F=>{Ee.isCanceled(F)||ft.error(F)},[]),P=m.useCallback(()=>{ft.debug("handleCreateFile"),s()},[s]),O=m.useCallback(()=>{ft.debug("handleCreateFolder"),l()},[l]),_=m.useCallback(F=>{ft.debug("handleCopyFile",F.filename),i(F)},[i]),k=m.useCallback(F=>{ft.debug("handleDelete, pending confirmation",F),v(F)},[]),W=m.useCallback(()=>{ft.debug("handleDeleteConfirm",f),f.forEach(F=>e.deleteFile(ht(F)?$.makePath(F.filename):F.filename)),o(f),v([])},[f,o,e]),Q=m.useCallback(()=>{ft.debug("handleDeleteCancel"),v([])},[]),N=m.useCallback((F,q)=>{var K=$.reducePaths(F.map(A=>ht(A)?$.makePath(A.filename):A.filename));K.forEach(A=>{var U=$.isPath(A)?"".concat(q).concat($.getBaseName(A.substring(0,A.length-1)),"/"):"".concat(q).concat($.getBaseName(A));e.moveFile(A,U).then(()=>{a(A,U)}).catch(y)})},[y,a,e]),B=m.useCallback((F,q)=>{var K=F.filename,A=ht(F);A&&!K.endsWith("/")&&(K="".concat(K,"/"));var U="".concat($.getParent(K)).concat(q);A&&!U.endsWith("/")&&(U="".concat(U,"/")),ft.debug2("handleRename",K,U),e.moveFile(K,U).catch(y),a(K,U)},[y,a,e]),j=m.useCallback(function(){var F=Fa(function*(q,K){if(K!==q.basename){$.validateName(K);var A="".concat($.getPath(q.filename)).concat(K);try{var U=yield e.info(A);throw new Or(U)}catch(z){if(!(z instanceof Vi))throw z}}});return function(q,K){return F.apply(this,arguments)}}(),[e]),Y=f.length>0,ne=m.useMemo(()=>f.length===1?'Are you sure you want to delete "'.concat(f[0].filename,'"?'):"Are you sure you want to delete the selected files?",[f]);return u.jsxs("div",{className:"file-explorer",children:[p&&u.jsx(Wl,{isMultiSelect:t,focusedPath:n,showContextMenu:!0,onCopy:_,onCreateFolder:O,onCreateFile:P,onMove:N,onDelete:k,onRename:B,onSelect:d,onSelectionChange:h,rowHeight:c,table:p,validateRename:j}),u.jsx(ln,{isOpen:Y,headerText:ne,bodyText:"You cannot undo this action.",onCancel:Q,onConfirm:W,confirmButtonText:"Delete"})]})}zi.displayName="FileExplorer";function ka(r,e,t,n,i,o,a){try{var s=r[o](a),l=s.value}catch(d){t(d);return}s.done?e(l):Promise.resolve(l).then(n,i)}function ny(r){return function(){var e=this,t=arguments;return new Promise(function(n,i){var o=r.apply(e,t);function a(l){ka(o,n,i,a,s,"next",l)}function s(l){ka(o,n,i,a,s,"throw",l)}a(void 0)})}}function Bt(r,e,t){return e=ry(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function ry(r){var e=iy(r,"string");return typeof e=="symbol"?e:String(e)}function iy(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}var Jt=V.module("NewItemModal");class sn extends m.PureComponent{static getValidationMessage(e){return e instanceof Or&&e.info.type==="directory"?"Error: Cannot overwrite existing directory":"".concat(e)}static handleError(e){Ee.isCanceled(e)||Jt.error(e)}constructor(e){super(e),Bt(this,"inputRef",H.createRef()),Bt(this,"cancelableValidatePromise",void 0),Bt(this,"cancelableExistingItemPromise",void 0),Bt(this,"pending",new xn),Bt(this,"pathMap",new Map),Bt(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,n=$.hasPath(t)?$.getPath(t):"/";this.state={isSubmitting:!1,path:n,prevExtension:$.getExtension(t),showExtensionChangeModal:!1,showOverwriteModal:!1,value:$.getBaseName(t)}}componentDidUpdate(e,t){var{isOpen:n}=this.props,{isOpen:i}=e,{value:o,path:a}=this.state;!i&&n&&(this.resetValue(),this.isInitialLoad=!0),i&&n&&(!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=$.hasPath(e)?$.getPath(e):"/";this.setState({path:t,value:$.getBaseName(e),validationError:void 0,prevExtension:$.getExtension(e),isSubmitting:!1})}getValidationPromise(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return this.cancelableValidatePromise&&this.cancelableValidatePromise.cancel(),this.cancelableValidatePromise=Ee.makeCancelable(this.validateName(e,t,n)),this.cancelableValidatePromise}validateName(e,t,n){var i=this;return ny(function*(){$.validateName(t);var{defaultValue:o,storage:a}=i.props;if(n){var s="".concat(e).concat(t);if(s!==o)try{var l=yield a.info(s);throw new Or(l)}catch(d){if(!(d instanceof Vi))throw d}}return t})()}updateValidationStatus(e,t){this.getValidationPromise(e,t).then(()=>{this.setState({validationError:void 0})}).catch(this.handleValidationError).catch(sn.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:$.makePath(e.filename)});else{var t=e.basename,n=$.getPath(e.filename);this.setState({value:t,path:n},()=>{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:n}=this.props;n();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:n}=this.state;Jt.debug("handleOverwriteConfirm",t,n),e("".concat(t).concat(n),!0)}handleExtensionChangeCancel(){Jt.debug("handleExtensionChangeCancel"),this.setState(e=>{var{value:t,prevExtension:n}=e,i=$.replaceExtension(t,n);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:n}=e,i=t==="directory"?n.length:n.lastIndexOf(".");e.focus(),e.setSelectionRange(0,i>0?i:n.length)}}submitModal(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;this.setState(t=>{var{prevExtension:n,value:i,path:o}=t,{notifyOnExtensionChange:a,type:s}=this.props;Jt.debug("submitModal",n,i);var l=$.getExtension(i);return a&&!e&&n!==null&&n!==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 Or&&s!=="directory"&&d.info.type!=="directory"){this.setState({showOverwriteModal:!0});return}throw d}).catch(d=>{throw Ee.isCanceled(d)&&this.setState({isSubmitting:!1}),d}).catch(this.handleValidationError).catch(sn.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((n,i)=>{for(var o="",a=0;a<i;a+=1)o+="".concat(t[a],"/");return o+="".concat(n,"/"),u.jsxs(H.Fragment,{children:[u.jsx(se,{kind:"ghost",className:"directory-breadcrumbs",onClick:()=>this.handleBreadcrumbSelect(o),"aria-label":i===0?"Home":void 0,icon:i===0?u.jsx(ue,{icon:Ud,transform:"right-1.6"}):void 0,tooltip:i===0?"Home":void 0,children:n}),"/"]},o)})}render(){var{storage:e,isOpen:t,onCancel:n,placeholder:i,title:o,type:a}=this.props,{isSubmitting:s,path:l,showExtensionChangeModal:d,showOverwriteModal:h,validationError:c,value:f,prevExtension:v,newExtension:p}=this.state,g=a==="directory",y=$.fileExtensionToString(v),P=$.fileExtensionToString(p),O=g?"Create":"Save",_=g?"New folder name":"Save file as";return u.jsxs(u.Fragment,{children:[u.jsxs(Ya,{isOpen:t,toggle:n,onOpened:this.handleModalOpened,className:"modal-dialog-centered new-file-modal",children:[u.jsx(Qa,{toggle:n,children:o}),u.jsx(Ja,{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:_}),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:f,placeholder:i,ref:this.inputRef,onKeyDown:this.handleKeyDown,onChange:this.handleChange}),c&&u.jsx("div",{className:"invalid-feedback",children:sn.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(zi,{onSelect:this.handleSelect,storage:e,focusedPath:l})})]})})}),u.jsxs(Ps,{children:[u.jsx(se,{kind:"secondary",onClick:n,children:"Cancel"}),u.jsx(se,{kind:"primary",disabled:s,onClick:this.handleModalSubmit,children:O})]})]}),u.jsx(ln,{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(ln,{isOpen:d,headerText:"Confirm extension change",bodyText:'Are you sure you want to change extension from "'.concat(y,'" to "').concat(P,'"?'),onCancel:this.handleExtensionChangeCancel,onConfirm:this.handleExtensionChangeConfirm,cancelButtonText:'Keep "'.concat(y,'"'),confirmButtonText:'Use "'.concat(P,'"')})]})}}Bt(sn,"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});Bt(sn,"defaultProps",{isOpen:!1,defaultValue:"/",notifyOnExtensionChange:!1,placeholder:"",onSubmit:(r,e)=>{},onCancel:()=>{}});const Ul=sn;function oy(r){var{createFile:e,createFolder:t,onSearchChange:n,defaultSearchText:i=""}=r;return u.jsxs("div",{className:"file-explorer-toolbar",children:[u.jsxs("div",{className:"file-explorer-toolbar-buttons",children:[u.jsx(se,{kind:"ghost",icon:hs,tooltip:"New notebook",onClick:e,"aria-label":"New notebook"}),u.jsx(se,{kind:"ghost",icon:Vd,tooltip:"New folder",onClick:t,"aria-label":"New folder"})]}),n&&u.jsx("div",{className:"file-explorer-toolbar-search",children:u.jsx(Ih,{value:i,onChange:n,placeholder:"Search by name"})})]})}function Ra(r,e,t,n,i,o,a){try{var s=r[o](a),l=s.value}catch(d){t(d);return}s.done?e(l):Promise.resolve(l).then(n,i)}function ay(r){return function(){var e=this,t=arguments;return new Promise(function(n,i){var o=r.apply(e,t);function a(l){Ra(o,n,i,a,s,"next",l)}function s(l){Ra(o,n,i,a,s,"throw",l)}a(void 0)})}}function Vl(r,e,t){return e=sy(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function sy(r){var e=ly(r,"string");return typeof e=="symbol"?e:String(e)}function ly(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}var en=V.module("FileExplorerPanel"),dy=(r,e)=>{var t=Hs(r),n=lr(r,e.localDashboardId),{session:i,config:o}=n??{},a=o?.type;return{fileStorage:t,language:a,session:i}},uy=In(dy,null,null,{forwardRef:!0});function hy(r){var e=r;return e!=null&&typeof e.button=="number"}class On extends H.Component{static handleError(e){en.error(e)}static isFocusEvent(e){return hy(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:n}=e;this.state={isShown:!1,language:n,session:t,showCreateFolder:!1,focusedFilePath:"/"}}componentDidMount(){this.isHidden()||this.setState({isShown:!0})}handleCreateFile(){var{glEventHub:e}=this.props,{session:t,language:n}=this.state,i={language:n,value:""};en.debug("handleCreateFile",t,n,i),e.emit(de.CREATE_NOTEBOOK,t,n,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 ay(function*(){var{fileStorage:n}=t.props;if(ht(e)){en.error("Invalid item in handleCopyItem",e);return}var i=yield $.getUniqueCopyFileName(n,e.filename);yield n.copyFile(e.filename,i)})()}handleDelete(e){var{glEventHub:t}=this.props;e.forEach(n=>{t.emit(de.CLOSE_FILE,{id:n.filename,itemName:n.filename})})}handleSelectionChange(e){var t="/";e.length===1&&(e[0].type==="directory"?t=$.makePath(e[0].filename):t=$.getPath(e[0].filename)),this.setState({focusedFilePath:t})}handleFileSelect(e,t){if(en.debug("fileSelect",e),e.type!=="directory"){var n=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(de.SELECT_NOTEBOOK,a,s,l,i,n)}}handleRename(e,t){var{glEventHub:n}=this.props;en.debug("handleRename",e,t),n.emit(de.RENAME_FILE,e,t)}handleSessionOpened(e,t){var{language:n}=t;this.setState({session:e,language:n})}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:n}=this.props,{isShown:i,showCreateFolder:o,focusedFilePath:a}=this.state;return u.jsxs(sr,{className:"file-explorer-panel",componentPanel:this,glContainer:t,glEventHub:n,onSessionOpen:this.handleSessionOpened,onSessionClose:this.handleSessionClosed,onShow:this.handleShow,children:[u.jsx(oy,{createFile:this.handleCreateFile,createFolder:this.handleCreateDirectory}),i&&u.jsx(zi,{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(Ul,{isOpen:o,type:"directory",title:"Create New Folder",storage:e,onSubmit:this.handleCreateDirectorySubmit,onCancel:this.handleCreateDirectoryCancel,defaultValue:a})]})}}Vl(On,"COMPONENT","FileExplorerPanel");Vl(On,"TITLE","File Explorer");var cy=uy(On);const my=cy;function Jn(r,e,t){return e=fy(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function fy(r){var e=vy(r,"string");return typeof e=="symbol"?e:String(e)}function vy(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}var ja=V.module("LogPanel");class qr extends m.PureComponent{constructor(e){super(e),Jn(this,"isBottomVisible",void 0),Jn(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){ja.debug("Session opened",[e]),this.setState({session:e})}handleSessionClosed(e){ja.debug("Session closed",e)}updateDimensions(){this.logView&&this.logView.updateDimensions()}render(){var{glContainer:e,glEventHub:t}=this.props,{session:n}=this.state;return u.jsxs(sr,{componentPanel:this,glContainer:e,glEventHub:t,onResize:this.handleResize,onHide:this.handleHide,onShow:this.handleShow,onSessionOpen:this.handleSessionOpened,onSessionClose:this.handleSessionClosed,children:[n==null&&u.jsx("div",{className:"log-panel-disconnected-message",children:"Waiting for session connection"}),n!=null&&u.jsx(Af,{session:n,ref:i=>{this.logView=i}})]})}}Jn(qr,"defaultProps",{session:null});Jn(qr,"COMPONENT","LogPanel");Jn(qr,"TITLE","Log");var gy=(r,e)=>{var t;return{session:(t=lr(r,e.localDashboardId))===null||t===void 0?void 0:t.session}},py=In(gy,null,null,{forwardRef:!0})(qr);const by=py;function $a(r,e,t,n,i,o,a){try{var s=r[o](a),l=s.value}catch(d){t(d);return}s.done?e(l):Promise.resolve(l).then(n,i)}function Ha(r){return function(){var e=this,t=arguments;return new Promise(function(n,i){var o=r.apply(e,t);function a(l){$a(o,n,i,a,s,"next",l)}function s(l){$a(o,n,i,a,s,"throw",l)}a(void 0)})}}function Ba(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,n)}return t}function He(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Ba(Object(t),!0).forEach(function(n){Ne(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):Ba(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function Ne(r,e,t){return e=yy(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function yy(r){var e=Cy(r,"string");return typeof e=="symbol"?e:String(e)}function Cy(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}var Sy=m.lazy(()=>cs(()=>import("./MarkdownNotebook-9a104d0b.js"),["./MarkdownNotebook-9a104d0b.js","./vendor-3cb40e4b.js","./helpers-de833af9.js","./vendor-fb3fd713.css","./index-4f71a71b.js","./monaco-b5248072.js","./monaco-f18fde03.css","./index-7d08f7c0.css","./mathjax-cb1613e2.js","./MarkdownNotebook-9207e775.css"],import.meta.url)),le=V.module("NotebookPanel"),Wa=400;class Te extends m.Component{static handleError(e){Ee.isCanceled(e)||le.error(e)}static unsavedNotebookCount(){return document.querySelectorAll(".".concat(Te.UNSAVED_INDICATOR_CLASS_NAME,".").concat(Te.UNSAVED_STATUS_CLASS_NAME)).length}static languageFromFileName(e){var t=$.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),Ne(this,"pending",void 0),Ne(this,"debouncedSavePanelState",void 0),Ne(this,"debouncedLoad",void 0),Ne(this,"notebook",void 0),Ne(this,"tabTitleElement",void 0),Ne(this,"tabInitOnce",void 0),Ne(this,"editor",void 0),Ne(this,"getSettings",yt((f,v)=>He(He({},f),{},{minimap:{enabled:v}}))),Ne(this,"getOverflowActions",yt((f,v)=>[{title:"Find",icon:Gd,action:this.handleFind,group:ee.groups.high,shortcut:Re.NOTEBOOK.FIND,order:10},{title:"Copy File",icon:es,action:this.handleCopy,group:ee.groups.medium,order:20},{title:"Rename File",icon:qd,action:this.handleShowRename,group:ee.groups.medium,order:30},{title:"Delete File",icon:ss,action:this.handleDelete,group:ee.groups.medium,order:40},{title:"Show Minimap",icon:f?Un:void 0,action:this.handleMinimapChange,group:ee.groups.low,shortcut:Re.NOTEBOOK.MINIMAP,order:20},{title:"Word Wrap",icon:v?Un:void 0,action:this.handleWordWrapChange,group:ee.groups.low,shortcut:Re.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 xn,this.debouncedSavePanelState=_n(this.savePanelState.bind(this),Wa),this.debouncedLoad=_n(this.load.bind(this),Wa),this.notebook=null,this.tabTitleElement=null,this.tabInitOnce=!1;var{isDashboardActive:t,session:n,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&&$.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:n,sessionLanguage:i,panelState:{fileMetadata:s,settings:a},showCloseModal:!1,showDeleteModal:!1,showSaveAsModal:!1,scriptCode:""},le.debug("constructor",e,this.state)}componentDidMount(){var{glContainer:e,glEventHub:t}=this.props,{tab:n}=e;n!=null&&this.initTab(n),this.initNotebookContent(),t.on(de.RENAME_FILE,this.handleRenameFile),t.on(te.DROPPED,this.handlePanelDropped),e.on(de.PROMOTE_FROM_PREVIEW,this.handlePreviewPromotion)}componentDidUpdate(e,t){var{isPreview:n,settings:i}=this.state,{wordWrap:o}=i,{defaultNotebookSettings:a}=this.props;n!==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:n,isPreview:i}=this.state;e.off(de.RENAME_FILE,this.handleRenameFile),e.off(te.DROPPED,this.handlePanelDropped),t.off(de.PROMOTE_FROM_PREVIEW,this.handlePreviewPromotion),e.emit(de.UNREGISTER_FILE,n,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:n,savedChangeCount:i}=this.state;return n!==i?(this.setState({showCloseModal:!0}),!1):!0})}initTabClasses(e){var t=e.element.get(0);R(t);var n=t.querySelector(".lm_title");this.tabTitleElement=n,n?.classList.add("notebook-title"),this.setPreviewStatus()}getNotebookValue(){var{changeCount:e,savedChangeCount:t,settings:n}=this.state,{value:i}=n;if(e!==t&&this.notebook){var o=this.notebook.getValue();return o??i}return i}initNotebookContent(){var{fileMetadata:e,settings:t,isPreview:n}=this.state;if(e&&e.id){le.debug("Init content from file"),this.registerFileMetadata(e,n),this.load();return}if(t.value!=null){le.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(de.CLOSE_FILE,{id:e})}registerFileMetadata(e,t){var{glEventHub:n,metadata:i}=this.props,{id:o}=i;n.emit(de.REGISTER_FILE,o,e,t)}renameTab(e,t){var{glEventHub:n}=this.props;n.emit(de.RENAME,e,t)}load(){var{fileMetadata:e,settings:t}=this.state;R(e);var{id:n}=e,{fileStorage:i}=this.props;this.pending.add(i.loadFile(n)).then(o=>{var a;le.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,$.getBaseName(s))}var c=He(He({},t),{},{language:(a=Te.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&&$.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){le.debug("saveContent",e,t),this.updateSavedChangeCount();var{fileStorage:n}=this.props;this.pending.add(n.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;le.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:n,fileMetadata:i,isPreview:o,settings:a}=e,s=this.getNotebookValue(),l=t!==n?s:void 0,d=He(He({},a),{},{value:s}),h=He(He({},a),{},{value:l}),c={settings:h,fileMetadata:i,isPreview:o};return le.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(de.CLOSE_FILE,{id:e,itemName:e},{force:!0}),this.focus()}handleCopy(){var e=this;return Ha(function*(){var{fileStorage:t,glEventHub:n,session:i}=e.props,{fileMetadata:o,settings:a}=e.state;R(o);var{language:s}=a,{itemName:l}=o,d=yield $.getUniqueCopyFileName(t,l);le.debug("handleCopy",o,l,d),yield t.copyFile(l,d);var h={id:d,itemName:d},c={value:null,language:s};n.emit(de.SELECT_NOTEBOOK,i,s,c,h,!0)})()}handleDelete(){le.debug("handleDelete, pending confirmation"),this.setState({showDeleteModal:!0})}handleDeleteConfirm(){var e=this;return Ha(function*(){var{fileStorage:t,glContainer:n,glEventHub:i}=e.props,{fileMetadata:o}=e.state;le.debug("handleDeleteConfirm",o?.itemName),e.setState({showDeleteModal:!1}),o&&($.hasPath(o.itemName)&&(yield $.fileExists(t,o.itemName))?(i.emit(de.CLOSE_FILE,o,{force:!0}),t.deleteFile(o.itemName)):n.close({force:!0}))})()}handleDeleteCancel(){this.setState({showDeleteModal:!1})}handleEditorInitialized(e){this.editor=e}handleEditorWillDestroy(){this.editor=void 0}handleEditorChange(e){le.debug2("handleEditorChanged",e),this.removePreviewStatus(),this.setState(t=>{var{changeCount:n,savedChangeCount:i}=t,{isUndoing:o,isRedoing:a}=e;return o?{changeCount:n-1,savedChangeCount:i}:!a&&n<i?{changeCount:n+1,savedChangeCount:0}:{changeCount:n+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:n}=this.props,i={defaultNotebookSettings:{isMinimapEnabled:!((e=t.isMinimapEnabled)!==null&&e!==void 0&&e)}};n(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,n=t.wordWrap==="on"?"off":"on";return{settings:He(He({},t),{},{wordWrap:n})}})}handleLinkClick(e){var{notebooksUrl:t,session:n,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==="/"){le.debug("Ignoring invalid notebook link",a);return}le.debug("Notebook link clicked, opening",a);var{glEventHub:s}=this.props,l={value:null,language:i},d={id:a,itemName:a};s.emit(de.SELECT_NOTEBOOK,n,i,l,d)}}handleLoadSuccess(){this.setState({error:void 0,isLoaded:!0,isLoading:!1})}handleLoadError(e){var t=e;Ee.isCanceled(t)||(Ee.isTimedOut(t)&&(t=new Error("File not found.")),le.error(t),this.setState({error:t,isLoading:!1}))}handleSave(){le.debug("handleSave"),this.save()}handleSaveSuccess(e){var t,{fileStorage:n}=this.props,i={id:e.filename,itemName:e.filename},o=(t=Te.languageFromFileName(e.filename))!==null&&t!==void 0?t:"";this.setState(a=>{var{fileMetadata:s}=a,l=He(He({},a.settings),{},{language:o});return le.debug("handleSaveSuccess",i,s,l),s&&$.hasPath(s.itemName)&&s.itemName!==i.itemName&&(le.debug("handleSaveSuccess deleting old file",s.itemName),n.deleteFile(s.itemName).catch(Te.handleError)),{fileMetadata:i,settings:l,isPreview:!1}}),this.debouncedSavePanelState(),this.registerFileMetadata(i,!1)}handleSaveError(e){Ee.isCanceled(e)||(this.setState({savedChangeCount:0}),le.error(e))}handleSaveAsCancel(){this.setState({showSaveAsModal:!1})}handleSaveAsSubmit(e){var t,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;n&&this.handleOverwrite(e),le.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}),$.getBaseName(o)!==$.getBaseName(e)){var{metadata:s}=this.props,{id:l}=s;this.renameTab(l,$.getBaseName(e))}this.saveContent(e,a)}}handleRenameFile(e,t,n){var{fileMetadata:i,panelState:o}=this.state,{glContainer:a}=this.props;if(i?.itemName==="/".concat(t)&&n&&JSON.stringify(o)!==JSON.stringify(n)){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){le.error("Editor is not initialized.");return}this.runCommand((e=this.notebook.getValue())!==null&&e!==void 0?e:void 0)}handleRunSelected(){if(!this.notebook){le.error("Editor is not initialized.");return}this.runCommand(this.notebook.getSelectedCommand())}handleSessionOpened(e,t){var{language:n}=t;this.setState({session:e,sessionLanguage:n})}handleSessionClosed(){this.setState({session:void 0,sessionLanguage:void 0})}handleShow(){var e;le.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){le.debug("NotebookPanel tab event",e),this.initTab(e)}handleTabFocus(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];le.debug("handleTabFocus",...t);var{glContainer:i}=this.props;this.setState({isDashboardActive:!0}),this.notebook&&!i.isHidden&&this.notebook.updateDimensions()}handleTabBlur(){le.debug("handleTabBlur"),this.setState({isDashboardActive:!1})}handleTabClick(e){le.debug("handle NotebookPanel tab click"),this.focus(),e.detail===2&&this.removePreviewStatus()}handleTransformLinkUri(e){var{notebooksUrl:t}=this.props,{fileMetadata:n}=this.state;if(e.endsWith("/"))return e;if(e.startsWith("/"))return"".concat(t).concat(e.substring(1));var i=n?.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 n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"",{glEventHub:i}=this.props,{session:o,sessionLanguage:a,settings:s}=this.state,l=He(He({},s),{},{language:t,value:n}),d={id:null,itemName:e};le.debug("handleCreateNotebook",o,a,l,d),i.emit(de.CREATE_NOTEBOOK,o,a,l,d)}runCommand(e){if(e===void 0||e===""){le.debug("Ignoring empty command.");return}this.removePreviewStatus();var{glEventHub:t}=this.props;t.emit(it.SEND_COMMAND,e,!1,!0)}removePreviewStatus(){this.setState(e=>{var{isPreview:t}=e;if(t){var{fileMetadata:n}=this.state;return n&&this.registerFileMetadata(n,!1),{isPreview:!1}}return null})}getDropdownOverflowActions(){var e,t,{defaultNotebookSettings:n}=this.props,{settings:i}=this.state;return this.getOverflowActions((e=n.isMinimapEnabled)!==null&&e!==void 0?e:!1,this.getSettings(i,(t=n.isMinimapEnabled)!==null&&t!==void 0?t:!1).wordWrap==="on")}render(){var e,t,n,{fileStorage:i,glContainer:o,glContainer:{tab:a},glEventHub:s,defaultNotebookSettings:l}=this.props,{changeCount:d,savedChangeCount:h,error:c,isDashboardActive:f,isLoaded:v,isLoading:p,isPreview:g,fileMetadata:y,session:P,sessionLanguage:O,settings:_,showCloseModal:k,showDeleteModal:W,showSaveAsModal:Q}=this.state,N=f&&!o.isHidden&&!g,B=(e=y?.itemName)!==null&&e!==void 0?e:Te.DEFAULT_NAME,j=B.endsWith(".md"),Y=y?.id!=null,ne=this.getSettings(_,(t=l.isMinimapEnabled)!==null&&t!==void 0?t:!1),F=P!=null,q=O===ne.language,K=!v||!F||!q,A=!v,U=[{action:this.handleSave,shortcut:Vt.SAVE},{action:this.handleMinimapChange,shortcut:Re.NOTEBOOK.MINIMAP},{action:this.handleWordWrapChange,shortcut:Re.NOTEBOOK.WORDWRAP}],z=gi.getDisabledRunTooltip(F,q,"Notebook extension","Run"),me=gi.getDisabledRunTooltip(F,q,"Notebook extension","Run Selected"),je=[{title:Y?"Rename":"Save As…",order:10,group:ee.groups.high,action:this.handleShowRename},{title:"Copy File",action:this.handleCopy,group:ee.groups.high,order:20}],De=a?.element.find(".lm_title_before").get(0);return u.jsxs(u.Fragment,{children:[De!=null&&jr.createPortal(u.jsx("span",{className:X(Te.UNSAVED_INDICATOR_CLASS_NAME,{[Te.UNSAVED_STATUS_CLASS_NAME]:d!==h})}),De),u.jsxs(sr,{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:je,renderTabTooltip:()=>B,children:[!j&&u.jsxs(u.Fragment,{children:[u.jsxs("div",{className:"notebook-toolbar",children:[u.jsxs("span",{children:[u.jsx(se,{kind:"ghost",className:"btn-play",onClick:this.handleRunAll,disabled:K,icon:u.jsx(ue,{icon:us,transform:"grow-4"}),tooltip:"Run ".concat(Re.NOTEBOOK.RUN.getDisplayText()),"aria-label":"Run"}),z!=null&&u.jsx(qt,{children:z})]}),u.jsxs("span",{children:[u.jsx(se,{kind:"ghost",className:"btn-play",onClick:this.handleRunSelected,disabled:K,icon:u.jsx(ue,{icon:Kd,transform:"grow-4"}),tooltip:"Run Selected ".concat(Re.NOTEBOOK.RUN_SELECTED.getDisplayText()),"aria-label":"Run Selected"}),me!=null&&u.jsx(qt,{children:me})]}),u.jsx(se,{kind:"ghost",className:"mr-auto",disabled:A,onClick:this.handleSave,icon:zd,tooltip:"Save ".concat(Vt.SAVE.getDisplayText()),"aria-label":"Save"}),u.jsx(se,{kind:"ghost",className:"btn-overflow",disabled:A,icon:ds,tooltip:"More Actions...",onClick:()=>{},children:u.jsx(zn,{actions:this.getDropdownOverflowActions,popperOptions:Te.POPPER_OPTIONS})})]}),u.jsx(gf,{isLoaded:v,isLoading:p,error:c,onChange:this.handleEditorChange,onRunCommand:this.handleRunCommand,session:P,sessionLanguage:O,onEditorInitialized:this.handleEditorInitialized,onEditorWillDestroy:this.handleEditorWillDestroy,settings:ne,focusOnMount:N,ref:b=>{this.notebook=b}})]}),j&&u.jsx(m.Suspense,{fallback:u.jsx(dn,{}),children:u.jsx(Sy,{content:(n=ne.value)!==null&&n!==void 0?n:"",onLinkClick:this.handleLinkClick,onRunCode:this.handleRunCommand,transformImageUri:this.handleTransformLinkUri,transformLinkUri:this.handleTransformLinkUri})}),u.jsx(Ul,{isOpen:Q,type:"file",defaultValue:B,title:Y?"Rename":"Save file as",onSubmit:this.handleSaveAsSubmit,onCancel:this.handleSaveAsCancel,notifyOnExtensionChange:!0,storage:i}),u.jsx(ln,{isOpen:W,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(ln,{isOpen:k,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(ee,{actions:U})]})]})}}Ne(Te,"COMPONENT","NotebookPanel");Ne(Te,"POPPER_OPTIONS",{placement:"bottom-end"});Ne(Te,"DEFAULT_NAME","Untitled");Ne(Te,"UNSAVED_INDICATOR_CLASS_NAME","editor-unsaved-indicator");Ne(Te,"UNSAVED_STATUS_CLASS_NAME","is-unsaved");Ne(Te,"defaultProps",{isDashboardActive:!0,isPreview:!1,session:null,sessionLanguage:null,defaultNotebookSettings:{isMinimapEnabled:!0}});var wy=(r,e)=>{var t=Hs(r),n=lc(r),i=lr(r,e.localDashboardId),{session:o,config:a}=i??{},{type:s}=a??{};return{fileStorage:t,defaultNotebookSettings:n,session:o,sessionLanguage:s}},Ey=In(wy,{updateSettings:vc},null,{forwardRef:!0})(Te);const tn=Ey;function Ua(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,n)}return t}function Va(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Ua(Object(t),!0).forEach(function(n){_y(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):Ua(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function _y(r,e,t){return e=Py(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Py(r){var e=Ty(r,"string");return typeof e=="symbol"?e:String(e)}function Ty(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}var be=V.module("ConsolePlugin");function Ka(r){return r.notebook!==void 0}function Oy(r){yp(r)}function aS(r){Oy(r);var{id:e,hydrateConsole:t,layout:n,panelManager:i,registerComponent:o,notebooksUrl:a}=r,s=m.useRef(0),[l,d]=m.useState(new Map),[h,c]=m.useState(new Map),f=Ti(),v=m.useCallback(()=>i.getLastUsedPanelOfType(li),[i]),p=m.useCallback((b,w)=>{d(T=>new Map(T.set(b,w)))},[d]),g=m.useCallback(b=>{d(w=>(w.delete(b),new Map(w)))},[d]),y=m.useCallback((b,w)=>{c(T=>new Map(T.set(b,w)))},[c]),P=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,T=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,G=b&&b.trim();if(!G)be.info("Ignoring empty code");else{var J=v();if(!J||!(J instanceof li.WrappedComponent)){be.error("Console panel not found");return}be.debug("Send command: ",b,w,T),J.addCommand(b,w,T)}},[v]),_=m.useCallback(b=>{f(gb(e,b))},[f,e]),k=m.useCallback(b=>{var{language:w}=b,T=w==="python"?"py":w,G=null;return T==null?(be.debug("No extension for language",w),G="Untitled-".concat(s.current)):G="Untitled-".concat(s.current,".").concat(T),s.current+=1,G},[]),W=m.useCallback(function(b){var w=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,{id:T}=b;if(T!=null&&l.has(T))return l.get(T);if(T!=null&&h.has(T))return h.get(T);if(w)return zt()},[l,h]),Q=m.useCallback((b,w)=>{x.renameComponent(n.root,{id:b},w)},[n.root]),N=m.useCallback((b,w)=>{be.debug("Rename file panel",b,w);var T;if(l.has(b)&&(T=l.get(b),g(b),T!=null&&p(w,T)),h.has(b)&&(T=h.get(b),P(b),T!=null&&y(w,T)),T===void 0){be.debug2("File ".concat(b," isn't open, no need to rename the tab"));return}Q(T,$.getBaseName(w))},[l,h,Q,p,y,g,P]),B=m.useCallback(b=>{var w=W(b,!1);if(w==null){be.error("Could not find panel id for file metadata",b);return}x.activateTab(n.root,{id:w})},[W,n.root]),j=m.useCallback((b,w,T)=>{if(be.debug("registerFilePanel",b,w,T),w==null||w.id==null){be.debug("Ignore empty file id",w);return}var{id:G}=w;if(T){y(G,b);return}if(l.has(G)){var J=l.get(G);if(b===J){be.debug("Update tab title for file ".concat(G));var{itemName:Qe}=w;N(G,Qe)}else be.error("File ".concat(G," already associated with a different tab ").concat(J));return}p(G,b),h.has(G)&&P(G)},[l,h,N,p,y,P]),Y=m.useCallback((b,w)=>{if(be.debug("unregisterFileTab",b,w),b==null||b.id==null){be.debug("Ignore empty file id",b);return}var{id:T}=b;if(w){P(T);return}g(T)},[g,P]),ne=m.useCallback((b,w)=>{be.debug("closeFilePanel",b);var{id:T}=b,G=null,J=!1;if(l.has(T))G=l.get(T);else if(h.has(T))G=h.get(T),J=!0;else{be.debug("File ".concat(T," isn't open, ignore close event"));return}Y(b,J),x.closeComponent(n.root,{id:G},w)},[n.root,l,h,Y]),F=m.useCallback(b=>{var{itemName:w}=b;return $.getBaseName(w)},[]),q=m.useCallback(b=>{var{id:w}=b;return be.debug("fileIsOpen",b,w,l),w!=null&&l.has(w)},[l]),K=m.useCallback(b=>{var{id:w}=b;return be.debug("fileIsOpenAsPreview",b,w,h),w!=null&&h.has(w)},[h]),A=m.useCallback(b=>{if(b!=null){var w=i.getOpenedPanelById(b);w&&Ka(w)&&w.focus()}},[i]),U=m.useCallback(b=>{var{id:w,settings:T,fileMetadata:G,session:J,sessionLanguage:Qe,isPreview:I=!1}=b,Z={settings:T,fileMetadata:G},re=F(G);return{type:"react-component",component:tn.COMPONENT,isFocusOnShow:!1,props:{localDashboardId:e,metadata:{id:w},session:J,sessionLanguage:Qe,panelState:Z,isPreview:I,notebooksUrl:a},title:re,id:w}},[F,e,a]),z=m.useCallback(function(b,w,T){var G=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{id:null,itemName:k(T)},J=W(G);if(q(G)&&J!=null){be.debug("File is already open, focus panel"),B(G),A(J);return}var Qe=x.getStackForComponentTypes(n.root,[tn.COMPONENT]),I=U({id:J,settings:T,fileMetadata:G,session:b,sessionLanguage:w});be.debug("createNotebook",I,l),x.openComponentInStack(Qe,I)},[q,A,k,W,n.root,U,l,B]),me=m.useCallback(function(b,w,T,G){var J=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!1;be.debug("selectNotebook",G,J);var Qe=q(G),I=K(G),[Z]=[...h.values()],re=!J,he=re&&Z?Z:W(G);if(he==null||he==="")throw new Error("Unable to retrieve or create panelId for metadata",G);if(Qe||I)B(G);else{var _e=x.getStackForComponentTypes(n.root,[tn.COMPONENT]),Xr=U({id:he,settings:T,fileMetadata:G,session:b,sessionLanguage:w,isPreview:re});x.openComponentInStack(_e,Xr)}if(I&&J){var cr=G.id,Yr=x.getStackForConfig(n.root,{component:tn.COMPONENT,id:he}),Qr=x.getContentItemInStack(Yr,{component:tn.COMPONENT,id:he});Qr&&qe(Qr)&&(Qr.container.emit(de.PROMOTE_FROM_PREVIEW),P(cr),p(cr,he))}J&&A(he)},[B,q,K,A,W,n.root,U,h,P,p]),je=m.useCallback(function(b,w){var T=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},G=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,J=i.getLastUsedPanelOfType(tn);J&&Ka(J)?T!=null&&T.value!=null&&J.notebook!=null&&J.notebook.append(T.value):G&&z(b,w,T)},[z,i]),De=m.useCallback((b,w)=>Op.hydrate(Va(Va({},b),{},{notebooksUrl:a}),w),[a]);return Fn(o,li,t),Fn(o,Sb),Fn(o,my),Fn(o,by),Fn(o,tn,De),Me(n.eventHub,it.SEND_COMMAND,O),Me(n.eventHub,it.SETTINGS_CHANGED,_),Me(n.eventHub,de.CLOSE_FILE,ne),Me(n.eventHub,de.CREATE_NOTEBOOK,z),Me(n.eventHub,de.SELECT_NOTEBOOK,me),Me(n.eventHub,de.RENAME,Q),Me(n.eventHub,de.RENAME_FILE,N),Me(n.eventHub,de.SEND_TO_NOTEBOOK,je),Me(n.eventHub,de.REGISTER_FILE,j),Me(n.eventHub,de.UNREGISTER_FILE,Y),null}function Zr(r,e,t){return e=Iy(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Iy(r){var e=Dy(r,"string");return typeof e=="symbol"?e:String(e)}function Dy(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class hr{}Zr(hr,"DROPDOWN_FILTER","ControlType.DROPDOWN_FILTER");Zr(hr,"INPUT_FILTER","ControlType.INPUT_FILTER");Zr(hr,"MARKDOWN","ControlType.MARKDOWN");Zr(hr,"FILTER_SET_MANAGER","ControlType.FILTER_SET_MANAGER");const sS=hr;export{Ae as $,iC as A,se as B,sh as C,vs as D,_s as E,sl as F,We as G,Vt as H,Ct as I,$y as J,D as K,sS as L,$C as M,zn as N,Xn as O,Ee as P,Cc as Q,Mi as R,Yh as S,E as T,cC as U,Fl as V,kC as W,Xt as X,fc as Y,oC as Z,kp as _,Ce as a,Wy as a$,dc as a0,GC as a1,lr as a2,Ky as a3,Bs as a4,Op as a5,tu as a6,ms as a7,RC as a8,de as a9,tr as aA,Nu as aB,ws as aC,Ss as aD,Du as aE,Iu as aF,It as aG,Ye as aH,En as aI,ah as aJ,Ih as aK,kh as aL,Nh as aM,L as aN,Ps as aO,$r as aP,Es as aQ,jy as aR,Rh as aS,dh as aT,Is as aU,lh as aV,Ir as aW,Jh as aX,Rs as aY,ks as aZ,By as a_,Sa as aa,te as ab,jC as ac,tn as ad,pp as ae,ec as af,Xd as ag,Di as ah,aS as ai,ee as aj,ln as ak,iS as al,mC as am,sC as an,fC as ao,uC as ap,hC as aq,qC as ar,ZC as as,aC as at,dC as au,Ws as av,lC as aw,Ze as ax,ky as ay,Ou as az,dt as b,Pb as b$,Uy as b0,ps as b1,Rf as b2,$f as b3,we as b4,zf as b5,ov as b6,Xf as b7,Be as b8,vC as b9,Gp as bA,Mp as bB,Ep as bC,Wi as bD,Nl as bE,yp as bF,Dl as bG,AC as bH,LC as bI,Ll as bJ,xl as bK,bp as bL,IC as bM,Ap as bN,xC as bO,NC as bP,Me as bQ,Ui as bR,ur as bS,wb as bT,xb as bU,rS as bV,Ib as bW,Tb as bX,_b as bY,Eb as bZ,tS as b_,ol as ba,av as bb,al as bc,bC as bd,SC as be,gC as bf,pC as bg,yC as bh,ev as bi,wC as bj,EC as bk,sv as bl,lv as bm,PC as bn,_C as bo,ll as bp,TC as bq,Ev as br,pv as bs,_v as bt,Ly as bu,x as bv,Fn as bw,DC as bx,Ip as by,FC as bz,C as c,nS as c0,Ob as c1,Bl as c2,Ea as c3,ui as c4,kg as c5,gp as c6,$ as c7,Vi as c8,oS as c9,gb as cA,hf as cB,Ry as cC,Fy as cD,Jr as cE,Us as cF,CC as cG,Vn as cH,li as ca,by as cb,Sb as cc,my as cd,gs as ce,Ay as cf,sr as cg,bs as ch,QC as ci,xn as cj,UC as ck,VC as cl,KC as cm,WC as cn,$l as co,HC as cp,eS as cq,BC as cr,ht as cs,Hl as ct,XC as cu,YC as cv,JC as cw,it as cx,Sr as cy,zC as cz,Cs as d,vc as e,qy as f,Gy as g,Zy as h,Vy as i,Yy as j,Qy as k,Jy as l,eC as m,tC as n,sc as o,zy as p,ge as q,ce as r,qt as s,Xe as t,Qh as u,nC as v,Hy as w,Xy as x,MC as y,rC as z};
22
- //# sourceMappingURL=ControlType-4f27532d.js.map
21
+ `)}this.bufferedMessages=[],this.appendLogText(e)}queue(e){this.bufferedMessages.push(e),this.bufferedMessages.length===1&&(this.flushTimer=setTimeout(this.handleFlushTimeout,pe.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,n=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(se,{kind:"ghost",className:"btn-clear-logs",onClick:this.handleClearClick,icon:Nd,tooltip:"Clear log"}),u.jsx(se,{kind:"ghost",className:"btn-link-icon btn-overflow",icon:Ad,tooltip:"Log Settings",onClick:()=>{},children:u.jsx(zn,{actions:n,popperClassName:"log-level-menu-popper",popperOptions:e})})]}),u.jsx("div",{className:"log-pane-editor h-100 w-100",ref:i=>{this.editorContainer=i}})]})}}Ge(pe,"DefaultLogLevels",[Oe.STDOUT,Oe.ERROR,Oe.FATAL,Oe.STDERR,Oe.WARN]);Ge(pe,"AllLogLevels",[Oe.INFO,Oe.STDOUT,Oe.ERROR,Oe.FATAL,Oe.STDERR,Oe.WARN,Oe.DEBUG,Oe.TRACE]);Ge(pe,"bufferTimeout",16);Ge(pe,"maxLogSize",131072);Ge(pe,"truncateSize",65536);const Af=pe;function Li(r,e,t){return e=Lf(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Lf(r){var e=Ff(r,"string");return typeof e=="symbol"?e:String(e)}function Ff(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class Vr{static isValid(e,t){return!0}static isSameFormat(e,t){throw new Error("isSameFormat not implemented")}static makeFormat(e,t,n){return{label:e,formatString:t,type:n}}format(e,t){return""}}Li(Vr,"TYPE_GLOBAL","type-global");Li(Vr,"TYPE_CONTEXT_PRESET","type-context-preset");Li(Vr,"TYPE_CONTEXT_CUSTOM","type-context-custom");const Be=Vr;class kf extends Be{format(e){switch(e){case 1:case!0:return"true";case 0:case!1:return"false";default:return""}}}const Rf=kf;class jf extends Be{format(e){return String.fromCharCode(e)}}const $f=jf;function $t(r,e,t){return e=Hf(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Hf(r){var e=Bf(r,"string");return typeof e=="symbol"?e:String(e)}function Bf(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}var Xo=V.module("DateTimeColumnFormatter");class dt extends Be{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 n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Be.TYPE_CONTEXT_PRESET;return{label:e,formatString:t,type:n}}static isSameFormat(e,t){return e===t||e!==null&&t!==null&&e.type===t.type&&e.formatString===t.formatString}static makeGlobalFormatStringMap(e,t){var n=t?"'T'":" ",i=e?" z":"";return new Map([["yyyy-MM-dd HH:mm:ss","yyyy-MM-dd".concat(n,"HH:mm:ss").concat(i)],["yyyy-MM-dd HH:mm:ss.SSS","yyyy-MM-dd".concat(n,"HH:mm:ss.SSS").concat(i)],["yyyy-MM-dd HH:mm:ss.SSSSSSSSS","yyyy-MM-dd".concat(n,"HH:mm:ss.SSSSSSSSS").concat(i)]])}static getGlobalFormats(e,t){var n=dt.makeGlobalFormatStringMap(e,t);return[...n.keys()]}static makeFormatStringMap(e,t){var n=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(n,"HH:mm:ss").concat(i)],["yyyy-MM-dd HH:mm:ss.SSS","yyyy-MM-dd".concat(n,"HH:mm:ss.SSS").concat(i)],["yyyy-MM-dd HH:mm:ss.SSSSSSSSS","yyyy-MM-dd".concat(n,"HH:mm:ss.SSSSSSSSS").concat(i)]])}static getFormats(e,t){var n=dt.makeFormatStringMap(e,t);return[...n.keys()]}constructor(e){var{timeZone:t="",showTimeZone:n=!0,showTSeparator:i=!1,defaultDateTimeFormatString:o=dt.DEFAULT_DATETIME_FORMAT_STRING}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};super(),$t(this,"dh",void 0),$t(this,"dhTimeZone",void 0),$t(this,"defaultDateTimeFormatString",void 0),$t(this,"showTimeZone",void 0),$t(this,"showTSeparator",void 0),$t(this,"formatStringMap",void 0);var a=t||dt.DEFAULT_TIME_ZONE_ID;try{this.dhTimeZone=e.i18n.TimeZone.getTimeZone(a)}catch{Xo.error("Unsupported time zone id",a),this.dhTimeZone=e.i18n.TimeZone.getTimeZone(dt.DEFAULT_TIME_ZONE_ID)}this.dh=e,this.defaultDateTimeFormatString=o,this.showTimeZone=n,this.showTSeparator=i,this.formatStringMap=dt.makeFormatStringMap(n,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]:{},n=t.formatString!=null&&t.formatString!==""?t.formatString:this.defaultDateTimeFormatString,i=this.getEffectiveFormatString(n);try{return this.dh.i18n.DateTimeFormat.format(i,e,this.dhTimeZone)}catch{Xo.error("Invalid format arguments")}return""}}$t(dt,"DEFAULT_DATETIME_FORMAT_STRING","yyyy-MM-dd HH:mm:ss.SSS");$t(dt,"DEFAULT_TIME_ZONE_ID","America/New_York");function St(r,e,t){return e=Wf(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Wf(r){var e=Uf(r,"string");return typeof e=="symbol"?e:String(e)}function Uf(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}var Vf=V.module("DecimalColumnFormatter");class Ce extends Be{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 n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Be.TYPE_CONTEXT_PRESET,i=arguments.length>3?arguments[3]:void 0;return{label:e,type:n,formatString:t,multiplier:i}}static makePresetFormat(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",n=arguments.length>2?arguments[2]:void 0;return Ce.makeFormat(e,t,Be.TYPE_CONTEXT_PRESET,n)}static makeCustomFormat(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",t=arguments.length>1?arguments[1]:void 0;return Ce.makeFormat("Custom Format",e,Be.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=Ce.DEFAULT_FORMAT_STRING}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};super(),St(this,"defaultFormatString",void 0),St(this,"dh",void 0),this.dh=e,this.defaultFormatString=t}format(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=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(n,i)}catch{Vf.error("Invalid format arguments")}return""}}St(Ce,"DEFAULT_FORMAT_STRING","###,##0.0000");St(Ce,"FORMAT_PERCENT",Ce.makePresetFormat("Percent","##0.00%"));St(Ce,"FORMAT_BASIS_POINTS",Ce.makePresetFormat("Basis Points","###,##0 bp",1e4));St(Ce,"FORMAT_MILLIONS",Ce.makePresetFormat("Millions","###,##0.000 mm",1e-6));St(Ce,"FORMAT_SCIENTIFIC_NOTATION",Ce.makePresetFormat("Scientific Notation","0.0000E0"));St(Ce,"FORMAT_ROUND",Ce.makePresetFormat("Round","###,##0"));St(Ce,"FORMAT_ROUND_TWO_DECIMALS",Ce.makePresetFormat("0.00","###,##0.00"));St(Ce,"FORMAT_ROUND_FOUR_DECIMALS",Ce.makePresetFormat("0.0000","###,##0.0000"));class Kf extends Be{format(e){return"".concat(e)}}const zf=Kf;function Zn(r,e,t){return e=Gf(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Gf(r){var e=qf(r,"string");return typeof e=="symbol"?e:String(e)}function qf(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}var Zf=V.module("IntegerColumnFormatter");class Ct extends Be{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 n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Be.TYPE_CONTEXT_PRESET,i=arguments.length>3?arguments[3]:void 0;return{label:e,type:n,formatString:t,multiplier:i}}static makePresetFormat(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",n=arguments.length>2?arguments[2]:void 0;return Ct.makeFormat(e,t,Be.TYPE_CONTEXT_PRESET,n)}static makeCustomFormat(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",t=arguments.length>1?arguments[1]:void 0;return Ct.makeFormat("Custom Format",e,Be.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=Ct.DEFAULT_FORMAT_STRING}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};super(),Zn(this,"dh",void 0),Zn(this,"defaultFormatString",void 0),this.dh=e,this.defaultFormatString=t}format(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=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(n,i)}catch{Zf.error("Invalid format arguments")}return""}}Zn(Ct,"DEFAULT_FORMAT_STRING","###,##0");Zn(Ct,"FORMAT_MILLIONS",Ct.makePresetFormat("Millions","###,##0.000 mm",1e-6));Zn(Ct,"FORMAT_SCIENTIFIC_NOTATION",Ct.makePresetFormat("Scientific Notation","0.0000E0"));class Xf extends Be{format(e){return e}}function Yo(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,n)}return t}function Qo(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Yo(Object(t),!0).forEach(function(n){Fi(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):Yo(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function Fi(r,e,t){return e=Yf(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Yf(r){var e=Qf(r,"string");return typeof e=="symbol"?e:String(e)}function Qf(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}var Jf=/\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,n){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(n).padStart(4,"0"),c="".concat(i+1).padStart(2,"0"),f="".concat(o).padStart(2,"0"),v="".concat(a).padStart(2,"0"),p="".concat(s).padStart(2,"0"),g="".concat(l).padStart(2,"0"),y="".concat(d).padStart(9,"0"),P="".concat(h,"-").concat(c,"-").concat(f," ").concat(v,":").concat(p,":").concat(g,".").concat(y);return e.i18n.DateTimeFormat.parse(we.FULL_DATE_FORMAT,P,e.i18n.TimeZone.getTimeZone(t))}static getNextNanos(e){var t=parseInt(e,10),n="0".repeat(9-e.length),i="".concat(t+1).concat(n);return parseInt(i,10)}static getNextDate(e,t,n,i){var{year:o,month:a,date:s,hours:l,minutes:d,seconds:h,nanos:c}=n;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 f=new Date(o,a,s,l,d,h);return we.makeDateWrapper(e,i,f.getFullYear(),f.getMonth(),f.getDate(),f.getHours(),f.getMinutes(),f.getSeconds(),c)}static parseMonth(e){var t=parseInt(e,10);if(!Number.isNaN(t))return t>=1&&t<=12?t-1:NaN;var n=e.trim().toLowerCase();if(n.length>=3){for(var i=0;i<we.months.length;i+=1)if(we.months[i].startsWith(n))return i}return NaN}static parseDateValues(e,t,n,i,o,a,s){var l=parseInt(e,10),d=t!=null?this.parseMonth(t):0,h=n!=null?parseInt(n,10):1,c=i!=null?parseInt(i,10):0,f=o!=null?parseInt(o,10):0,v=a!=null?parseInt(a,10):0,p=s!=null?parseInt(s.padEnd(9,"0"),10):0;return Number.isNaN(l)||Number.isNaN(d)||Number.isNaN(h)||Number.isNaN(c)||Number.isNaN(f)||Number.isNaN(v)||Number.isNaN(p)?null:{year:l,month:d,date:h,hours:c,minutes:f,seconds:v,nanos:p}}static parseDateTimeString(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,n=Jf.exec(e);if(n==null)throw new Error("Unexpected date string: ".concat(e));var[,i,,o,,a,,s,,l,,d,,h,c]=n;if(!t&&c!=null&&c.length>0)throw new Error("Unexpected characters after date string '".concat(e,"': ").concat(c));var f={year:i,month:o,date:a,hours:s,minutes:l,seconds:d,nanos:h};return t?Qo(Qo({},f),{},{overflow:c}):f}static parseDateRange(e,t,n){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,n,o.getFullYear(),o.getMonth(),o.getDate()),s=new Date(o.getFullYear(),o.getMonth(),o.getDate()+1),l=we.makeDateWrapper(e,n,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,n,h.getFullYear(),h.getMonth(),h.getDate()),f=we.makeDateWrapper(e,n,d.getFullYear(),d.getMonth(),d.getDate());return[c,f]}if(i==="now"){var v=new Date(Date.now()),p=e.DateWrapper.ofJsDate(v);return[p,null]}var g=we.parseDateTimeString(i);if(g.year==null&&g.month==null&&g.date==null)throw new Error("Unable to extract year, month, or day ".concat(i));var y=we.parseDateValues(g.year,g.month,g.date,g.hours,g.minutes,g.seconds,g.nanos);if(y==null)throw new Error("Unable to extract date values from ".concat(g));var P=we.makeDateWrapper(e,n,y.year,y.month,y.date,y.hours,y.minutes,y.seconds,y.nanos),O=we.getNextDate(e,g,y,n);return[P,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)}}Fi(we,"FULL_DATE_FORMAT","yyyy-MM-dd HH:mm:ss.SSSSSSSSS");Fi(we,"months",["january","february","march","april","may","june","july","august","september","october","november","december"]);const oi=we;function vC(r,e){return r===e?{operator:"notEq",value:""}:{operator:"eq",value:r}}function gC(r,e,t,n){return function(o){var a=t.trim();if(a==="")return null;var s=ol(e,l=>r.makeSearchTextFilter(l,a,n),"or");return s(o)}}function ol(r,e){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"or";return function(i){var o=i?.findColumns(typeof r=="string"?[r]:r);if(o==null||o.length===0)return null;var a=o.map(e);return a.reduce((s,l)=>s[t](l))}}function ev(r,e,t,n){return ol(e,i=>i.filter()[n](r.makeFilterValue(i.type,t)),"or")}function pC(r,e,t,n,i){return function(a){var s=a?.findColumn(e),l=t==="all"||n&&t.size===0;return s==null||l?null:r.makeSelectValueFilter(s,[...t.keys()],i)}}function bC(r){return function(t){return t.filter().isNull().not().and(t.filter().notEq(r.makeFilterValue(t.type,"")))}}function yC(r,e){return function(n){var i=n.filter(),o=r.makeFilterValue(n.type,""),a=i.eq(o);return e?i.isNull().or(a):a.or(i.notEq(o))}}function ki(r,e,t){return e=tv(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function tv(r){var e=nv(r,"string");return typeof e=="symbol"?e:String(e)}function nv(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class Xn{}ki(Xn,"not","not");ki(Xn,"and","and");ki(Xn,"or","or");function CC(r){if(!(r==="not"||r==="and"||r==="or"))throw new Error("operator is not a valid FilterOperatorValue")}function ve(r,e,t){return e=rv(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function rv(r){var e=iv(r,"string");return typeof e=="symbol"?e:String(e)}function iv(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class E{}ve(E,"eq","eq");ve(E,"eqIgnoreCase","eqIgnoreCase");ve(E,"notEq","notEq");ve(E,"notEqIgnoreCase","notEqIgnoreCase");ve(E,"greaterThan","greaterThan");ve(E,"greaterThanOrEqualTo","greaterThanOrEqualTo");ve(E,"lessThan","lessThan");ve(E,"lessThanOrEqualTo","lessThanOrEqualTo");ve(E,"in","in");ve(E,"inIgnoreCase","inIgnoreCase");ve(E,"notIn","notIn");ve(E,"notInIgnoreCase","notInIgnoreCase");ve(E,"isTrue","isTrue");ve(E,"isFalse","isFalse");ve(E,"isNull","isNull");ve(E,"invoke","invoke");ve(E,"contains","contains");ve(E,"notContains","notContains");ve(E,"containsIgnoreCase","containsIgnoreCase");ve(E,"startsWith","startsWith");ve(E,"endsWith","endsWith");ve(E,"containsAny","containsAny");var ov="DH_ITEM_KEY",Jo=V.module("ViewportDataUtils");function al(r){return"".concat(ov,"_").concat(r)}function av(r,e){return al(r.offsetInSnapshot+e)}function SC(r,e){var{bulkUpdate:t}=r;return function(i){var{columns:o,offset:a,rows:s}=i.detail;Jo.debug("table updated",i.detail);var l=new Map;s.forEach(d=>{var h=e(d,o),c=av(d,a);l.set(c,{key:c,item:h})}),Jo.debug("update keys",l),t(l)}}function wC(r,e){return e.reduce((t,n)=>(t[n.name]=r.get(n),t),{})}function*EC(r,e){for(var t=r;t<=e;++t)yield{key:al(t)}}function sv(r){return r==null||lv(r)?0:r.size}function lv(r){return"isClosed"in r?r.isClosed:!1}function _C(r,e,t,n){var i=r+e-1,[o,a]=[0,n-1],s=Gi(r-t,o,a),l=Gi(i+t,o,a);return[s,l]}function ea(r,e,t,n,i,o,a){try{var s=r[o](a),l=s.value}catch(d){t(d);return}s.done?e(l):Promise.resolve(l).then(n,i)}function Rt(r){return function(){var e=this,t=arguments;return new Promise(function(n,i){var o=r.apply(e,t);function a(l){ea(o,n,i,a,s,"next",l)}function s(l){ea(o,n,i,a,s,"throw",l)}a(void 0)})}}function hn(r,e,t){return e=dv(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function dv(r){var e=uv(r,"string");return typeof e=="symbol"?e:String(e)}function uv(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}var Pt=V.module("TableUtils");function PC(r){return r===C.sortDirection.ascending||r===C.sortDirection.descending||r===C.sortDirection.reverse||r===C.sortDirection.none}class C{static copyTableAndApplyFilters(e){var t=arguments;return Rt(function*(){if(e==null)return null;for(var n=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 n.applyFilter(Jr(...o.map(s=>s(n)))),n})()}static getSortIndex(e,t){for(var n=0;n<e.length;n+=1){var i,o=e[n];if(((i=o.column)===null||i===void 0?void 0:i.name)===t)return n}return null}static getSortForColumn(e,t){var n=C.getSortIndex(e,t);return n!=null?e[n]: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,n){if(n<0||n>=e.length)return null;var i=C.getSortForColumn(t,e[n].name);return i===null?e[n].sort().asc():i.direction===C.sortDirection.ascending?i.desc():null}static makeColumnSort(e,t,n,i){if(t<0||t>=e.length||n===C.sortDirection.none)return null;var o=e[t].sort();switch(n){case C.sortDirection.ascending:o=o.asc();break;case C.sortDirection.descending:o=o.desc();break}return i&&(o=o.abs()),o}static toggleSortForColumn(e,t,n){var i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(n<0||n>=t.length)return[];var o=C.getNextSort(t,e,n);return C.setSortForColumn(e,t[n].name,o,i)}static sortColumn(e,t,n,i,o,a){if(n<0||n>=t.length)return[];var s=C.makeColumnSort(t,n,i,o);return C.setSortForColumn(e,t[n].name,s,a)}static setSortForColumn(e,t,n){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)),n!==null&&a.push(n),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,n){switch(t){case"=":return e.eq(n);case"<":return e.lessThan(n);case"<=":case"=<":return e.lessThanOrEqualTo(n);case">":return e.greaterThan(n);case">=":case"=>":return e.greaterThanOrEqualTo(n);case"!=":case"!":return e.notEq(n);default:return null}}static makeCancelableTablePromise(e){return Ee.makeCancelable(e,t=>{t.close()})}static makeCancelableTableEventPromise(e,t){var n=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 ps('Event "'.concat(t,'" timed out.')))},n),o=e.addEventListener(t,c=>{if(i!=null&&!i(c)){Pt.debug2("Event triggered, but matcher returned false.");return}Pt.debug2("Event triggered, resolving."),o(),clearTimeout(a),s=!1,d(c)})});return l.cancel=()=>{if(s){Pt.debug2("Pending promise cleanup."),o(),clearTimeout(a),s=!1;return}Pt.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 n=C.removeCommas(t);if(C.NUMBER_REGEX.test(n))return parseFloat(n);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((n,i)=>{var o=n.name.toUpperCase(),a=i.name.toUpperCase();return bs.sort(o,a,t)})}constructor(e){hn(this,"dh",void 0),this.dh=e,tu(this)}createDistinctSortedColumnTable(e,t,n){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(Jr(...l.map(v=>v(a)))));var h=a.findColumn(t),c=yield a.selectDistinct([h]);a!==e&&a.close();var f=c.findColumn(t).sort()[n]();return o.applySort(c,[f])})()}doesColumnValueExist(e,t,n,i){var o=this;return Rt(function*(){if(e==null)return null;var a=ev(o,t,n,i?"eq":"eqIgnoreCase"),s=yield e.copy();yield o.applyFilter(s,Jr(a(s)));var l=sv(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,n){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 f=this.makeQuickFilterFromComponent(e,c,n);if(f)d?d=d.and(f):d=f;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,n){var{type:i}=e;return C.isNumberType(i)?this.makeQuickNumberFilter(e,t):C.isBooleanType(i)?this.makeQuickBooleanFilter(e,t):n!=null&&C.isDateType(i)?this.makeQuickDateFilter(e,t,n):C.isCharType(i)?this.makeQuickCharFilter(e,t):this.makeQuickTextFilter(e,t)}makeQuickNumberFilter(e,t){var n=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,f=null;if(s!==null&&s.length>3&&([,l,d,h,c,f]=s),f!=null&&f.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=n.isNull();break;case"nan":o=i.FilterCondition.invoke("isNaN",n);break;case"infinity":case"inf":case"∞":d!=null?o=i.FilterCondition.invoke("isInf",n).and(n.lessThan(i.FilterValue.ofNumber(0))):o=i.FilterCondition.invoke("isInf",n).and(n.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(v){return Pt.warn("Unable to create long filter",v),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,n;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((n=l)!==null&&n!==void 0?n:"")}static unescapeQuickTextFilter(e){var t,n,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((n=l)!==null&&n!==void 0?n:"")}makeQuickTextFilter(e,t){var{dh:n}=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",n.FilterValue.ofString("(?s)(?i).*\\Q".concat(l,"\\E.*"))));case"!~":return d.isNull().or(d.invoke("matches",n.FilterValue.ofString("(?s)(?i).*\\Q".concat(l,"\\E.*"))).not());case"!=":return h==="*"?d.isNull().or(d.invoke("matches",n.FilterValue.ofString("(?s)(?i).*\\Q".concat(l,"\\E$"))).not()):c==="*"?d.isNull().or(d.invoke("matches",n.FilterValue.ofString("(?s)(?i)^\\Q".concat(l,"\\E.*"))).not()):d.notEqIgnoreCase(n.FilterValue.ofString(l.toLowerCase()));case"=":return h==="*"?d.isNull().not().and(d.invoke("matches",n.FilterValue.ofString("(?s)(?i).*\\Q".concat(l,"\\E$")))):c==="*"?d.isNull().not().and(d.invoke("matches",n.FilterValue.ofString("(?s)(?i)^\\Q".concat(l,"\\E.*")))):d.eqIgnoreCase(n.FilterValue.ofString(l.toLowerCase()))}return null}makeQuickBooleanFilter(e,t){var n=/^(!=|=|!)?(.*)/,i=n.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,n){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,n)}makeQuickDateFilterWithOperation(e,t,n,i){var{dh:o}=this,[a,s]=oi.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 n===E.notEq?h.isNull().not():h.isNull();switch(n){case E.eq:{if(d!=null){var c=h.greaterThanOrEqualTo(l),f=h.lessThan(d);return c.and(f)}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 v=h.lessThan(l),p=h.greaterThanOrEqualTo(d);return v.or(p)}return h.notEq(l)}default:throw new Error("Invalid operator: ".concat(n))}}makeQuickCharFilter(e,t){var{dh:n}=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=n.FilterValue.ofString(C.isRangeOperation(s)?C.quoteValue(l):l);return C.makeRangeFilterWithOperation(h,s,c)}makeAdvancedFilter(e,t,n){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:f}=h;if(c!=null&&c.length>0&&f!=null&&f.length>0)try{var v=this.makeAdvancedValueFilter(e,c,f,n);if(v!=null){if(d===0)l=v;else if(l!==null&&d-1<o.length){var p=o[d-1];if(p===Xn.and)l=l.and(v);else if(p===Xn.or)l=l.or(v);else{Pt.error("Unexpected filter operator",p,v),l=null;break}}}else Pt.debug2("Empty filter ignored for",c,f)}catch(y){Pt.error("Unable to create filter",y),l=null;break}}var g=this.makeSelectValueFilter(e,s,a);return g!=null&&(l!=null?l=l.and(g):l=g),l}makeAdvancedValueFilter(e,t,n,i){var{dh:o}=this;if(C.isDateType(e.type))return this.makeQuickDateFilterWithOperation(e,n,t,i);if(C.isNumberType(e.type)||C.isCharType(e.type))return this.makeQuickFilter(e,"".concat(C.getFilterOperatorString(t)).concat(n));var a=this.makeFilterValue(e.type,n),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(n,"\\E.*"))));case E.notContains:return s.isNull().or(s.invoke("matches",o.FilterValue.ofString("(?s)(?i).*\\Q".concat(n,"\\E.*"))).not());case E.startsWith:return s.isNull().not().and(s.invoke("matches",o.FilterValue.ofString("(?s)(?i)^\\Q".concat(n,"\\E.*"))));case E.endsWith:return s.isNull().not().and(s.invoke("matches",o.FilterValue.ofString("(?s)(?i).*\\Q".concat(n,"\\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,n){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,oi.trimDateTimeStringTimeZone(t),"eq",n);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 n=arguments,i=this;return Rt(function*(){var o=n.length>2&&n[2]!==void 0?n[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 n=arguments,i=this;return Rt(function*(){var o=n.length>2&&n[2]!==void 0?n[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 n=arguments,i=this;return Rt(function*(){var o=n.length>2&&n[2]!==void 0?n[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 n=arguments,i=this;return Rt(function*(){var o=n.length>2&&n[2]!==void 0?n[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,n=null;C.isTextType(e.type)?n=t.FilterValue.ofString("a"):C.isBooleanType(e.type)?n=t.FilterValue.ofBoolean(!0):C.isDateType(e.type)?n=t.FilterValue.ofNumber(t.DateWrapper.ofJsDate(new Date)):n=t.FilterValue.ofNumber(0);var i=e.filter().eq(n),o=e.filter().notEq(n);return i.and(o)}makeFilterValue(e,t){var{dh:n}=this,i=C.getBaseType(e);return C.isTextType(i)?n.FilterValue.ofString(t):C.isLongType(i)?n.FilterValue.ofNumber(n.LongWrapper.ofString(C.removeCommas(t))):n.FilterValue.ofNumber(C.removeCommas(t))}makeFilterRawValue(e,t){var{dh:n}=this;return C.isCharType(e)?n.FilterValue.ofString(typeof t=="number"?String.fromCharCode(t):t):C.isTextType(e)?n.FilterValue.ofString(t):C.isBooleanType(e)?n.FilterValue.ofBoolean(t):n.FilterValue.ofNumber(t)}makeNullableEqFilter(e,t){return t==null?e.filter().isNull():e.filter().eq(this.makeFilterRawValue(e.type,t))}makeValue(e,t,n){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]=oi.parseDateRange(i,t,n);return o}return C.isNumberType(e)?C.makeNumberValue(t):(Pt.error("Unexpected column type",e),null)}makeSelectValueFilter(e,t,n){var{dh:i}=this;if(t.length===0)return n?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?n?e.filter().isNull().not().and(e.filter().notIn(o)):e.filter().isNull().or(e.filter().in(o)):n?e.filter().isNull().not():e.filter().isNull():n?e.filter().notIn(o):e.filter().in(o)}}hn(C,"dataType",{BOOLEAN:"boolean",CHAR:"char",DATETIME:"datetime",DECIMAL:"decimal",INT:"int",STRING:"string",UNKNOWN:"unknown"});hn(C,"sortDirection",{ascending:"ASC",descending:"DESC",reverse:"REVERSE",none:null});hn(C,"APPLY_TABLE_CHANGE_TIMEOUT_MS",3e4);hn(C,"REVERSE_TYPE",Object.freeze({NONE:"none",PRE_SORT:"pre-sort",POST_SORT:"post-sort"}));hn(C,"NUMBER_REGEX",/^-?\d+(\.\d+)?$/);hn(C,"executeAndWaitForEvent",function(){var r=Rt(function*(e,t,n){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,n,i);return e(t),yield o,t});return function(e,t,n){return r.apply(this,arguments)}}());function fn(r,e,t){return e=hv(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function hv(r){var e=cv(r,"string");return typeof e=="symbol"?e:String(e)}function cv(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class sl{static makeColumnFormatMap(e){return e==null?new Map:e.reduce((t,n)=>{var i=C.getNormalizedType(n.columnType);if(i===null)return t;t.has(i)||t.set(i,new Map);var o=t.get(i);return o?.set(n.columnName,n.format),t},new Map)}static makeColumnFormattingRule(e,t,n){return{columnType:e,columnName:t,format:n}}constructor(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],n=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;fn(this,"defaultColumnFormatter",void 0),fn(this,"typeFormatterMap",void 0),fn(this,"columnFormatMap",void 0),fn(this,"truncateNumbersWithPound",void 0),fn(this,"showEmptyStrings",void 0),fn(this,"showNullStrings",void 0),this.defaultColumnFormatter=new zf,this.typeFormatterMap=new Map([[C.dataType.BOOLEAN,new Rf],[C.dataType.CHAR,new $f],[C.dataType.DATETIME,new dt(e,n)],[C.dataType.DECIMAL,new Ce(e,i)],[C.dataType.INT,new Ct(e,o)],[C.dataType.STRING,new Xf]]),this.columnFormatMap=sl.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,n=C.getNormalizedType(e);if(n!==null)return t&&!this.columnFormatMap.has(n)&&this.columnFormatMap.set(n,new Map),this.columnFormatMap.get(n)}getColumnFormat(e,t){var n,i=this.getColumnFormatMapForType(e);return(n=i?.get(t))!==null&&n!==void 0?n:null}getColumnTypeFormatter(e){var t=C.getNormalizedType(e),n=this.defaultColumnFormatter;if(t){var i;n=(i=this.typeFormatterMap.get(t))!==null&&i!==void 0?i:n}return n}getFormattedString(e,t){var n=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,n);return o.format(e,a??void 0)}get timeZone(){var e=this.typeFormatterMap.get(C.dataType.DATETIME);return Ld(e,dt),e.dhTimeZone.id}}const mv="var(--dh-color-chart-colorway)",fv="var(--dh-color-chart-grid)",vv="var(--dh-color-chart-axis-line)",gv="var(--dh-color-chart-axis-line-zero)",ta={"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:mv,gridcolor:fv,linecolor:vv,zerolinecolor:gv,"error-band-line-color":"var(--dh-color-chart-error-band-line)","ohlc-increasing":"var(--dh-color-chart-ohlc-increase)","ohlc-decreasing":"var(--dh-color-chart-ohlc-decrease)","coastline-color":"var(--dh-color-chart-geo-coastline)","land-color":"var(--dh-color-chart-geo-land)","ocean-color":"var(--dh-color-chart-geo-ocean)","lake-color":"var(--dh-color-chart-geo-lake)","river-color":"var(--dh-color-chart-geo-river)"};var na=V.module("ChartTheme");function pv(){var r,e=as(ta);return e.colorway=Fd((r=e.colorway)!==null&&r!==void 0?r:"").map(t=>{var[n,i]=t;return kd.normalizeCssColor(e.colorway.substring(n,i+1))}).join(" "),na.debug2("Chart theme:",ta),na.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"]})}function ra(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,n)}return t}function bv(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?ra(Object(t),!0).forEach(function(n){yv(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):ra(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function yv(r,e,t){return e=Cv(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Cv(r){var e=Sv(r,"string");return typeof e=="symbol"?e:String(e)}function Sv(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}var wv=m.lazy(()=>cs(()=>import("./Plot-daaa69b5.js"),["./Plot-daaa69b5.js","./Plotly-5ec4bf1b.js","./plotly-cb87b4a3.js","./helpers-de833af9.js","./vendor-3cb40e4b.js","./vendor-fb3fd713.css"],import.meta.url));function Ev(r){return u.jsx(m.Suspense,{fallback:u.jsx(dn,{}),children:u.jsx(wv,bv({},r))})}var ll=m.createContext(null);function TC(r){var{children:e}=r,{activeThemes:t}=_s(),n=m.useMemo(pv,[t]);return u.jsx(ll.Provider,{value:n,children:e})}function _v(){return tr(ll,"No ChartThemeContext value found.")}function ia(r,e,t,n,i,o,a){try{var s=r[o](a),l=s.value}catch(d){t(d);return}s.done?e(l):Promise.resolve(l).then(n,i)}function Pv(r){return function(){var e=this,t=arguments;return new Promise(function(n,i){var o=r.apply(e,t);function a(l){ia(o,n,i,a,s,"next",l)}function s(l){ia(o,n,i,a,s,"throw",l)}a(void 0)})}}var Tv=V.module("HeapUsage");function Ov(r){var e,{connection:t,defaultUpdateInterval:n,hoverUpdateInterval:i,bgMonitoring:o=!0,monitorDuration:a}=r,s=_v(),[l,d]=m.useState({freeMemory:0,maximumHeapSize:999,totalHeapSize:0}),[h,c]=m.useState(!1),f=m.useRef({timestamps:[],usages:[]}),v=Ss(),p=m.useCallback(Pv(function*(){try{var A=yield t.getWorkerHeapInfo();if(!v.current)return;if(d(A),o||h){for(var U=(A.totalHeapSize-A.freeMemory)/A.maximumHeapSize,z=Date.now(),{timestamps:me,usages:je}=f.current;me.length!==0&&z-me[0]>a*1.5;)me.shift(),je.shift();me.push(z),je.push(U)}else f.current={timestamps:[],usages:[]}}catch(De){Tv.warn("Unable to get heap usage",De)}}),[t,v,o,h,a]);Ou(p,h?i:n);var g=(A,U)=>Math.round(A*10**U)/10**U,y=2,P=1024**3,{freeMemory:O,totalHeapSize:_,maximumHeapSize:k}=l,W=g(O/P,y),Q=g(_/P,y),N=g(k/P,y),B=Q-W,j=function(U,z){var me=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return u.jsxs("div",{className:X("heap-usage-info-row",{"heading-bottom-border":me}),children:[u.jsx("div",{className:"font-weight-bold",children:U}),u.jsx("div",{children:z})]})},{timestamps:Y,usages:ne}=f.current,F=(e=Y[Y.length-1])!==null&&e!==void 0?e:0,q=_/k,K=(_-O)/k;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":(_-O)/k>.95}),style:{width:"calc(".concat(K*100,"% - ").concat(K*2,"px")}}),u.jsxs("div",{className:"memory-text",children:[N.toFixed(1)," GB"]}),u.jsx(qt,{onEntered:()=>c(!0),onExited:()=>c(!1),interactive:!0,children:u.jsxs("div",{className:"heap-tooltip",children:[j("In use:","".concat(B.toFixed(y)," of ").concat(N.toFixed(y)," GB"),!0),j("Free:","".concat(W.toFixed(y)," GB")),j("Total:","".concat(Q.toFixed(y)," GB")),j("Max:","".concat(N.toFixed(y)," GB")),u.jsx("div",{className:"heap-plot",children:u.jsx(Ev,{data:[{x:[...Y],y:[...ne],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:[F-a,F],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 dl=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 ul(r){return r.componentName!==void 0}function Iv(r){return r.component!==void 0}var hl=Object.freeze({type:"default",isClosable:!0,isFocusOnShow:!0,reorderEnabled:!0,title:""});const Dv=Object.freeze(Object.defineProperty({__proto__:null,defaultConfig:dl,isGLComponentConfig:ul,isReactComponentConfig:Iv,itemDefaultConfig:hl},Symbol.toStringTag,{value:"Module"}));function Tr(r,e,t){return e=xv(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function xv(r){var e=Mv(r,"string");return typeof e=="symbol"?e:String(e)}function Mv(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class Yn{constructor(){Tr(this,"_mSubscriptions",void 0),Tr(this,"off",this.unbind),Tr(this,"trigger",this.emit),this._mSubscriptions={},this._mSubscriptions[Yn.ALL_EVENT]=[]}on(e,t,n){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:n})}emit(e){for(var t=this._mSubscriptions[e],n=arguments.length,i=new Array(n>1?n-1:0),o=1;o<n;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[Yn.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,n){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)&&(!n||n===this._mSubscriptions[e][o].ctx)&&(this._mSubscriptions[e].splice(o,1),i=!0);if(i===!1)throw new Error("Nothing to unbind for "+e)}}Tr(Yn,"ALL_EVENT","__all");const ct=Yn;function st(r,e,t){return e=Nv(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Nv(r){var e=Av(r,"string");return typeof e=="symbol"?e:String(e)}function Av(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class pi extends ct{constructor(e,t,n){super(),st(this,"width",void 0),st(this,"height",void 0),st(this,"title",void 0),st(this,"parent",void 0),st(this,"layoutManager",void 0),st(this,"tab",void 0),st(this,"_config",void 0),st(this,"isHidden",!1),st(this,"beforeCloseHandler",void 0),st(this,"_element",M(['<div class="lm_item_container">','<div class="lm_content" tabindex="-1"></div>',"</div>"].join(""))),st(this,"_contentElement",void 0),this.title=ul(e)?e.componentName:"",this.parent=t,this.layoutManager=n,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 n,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=((n=this[d])!==null&&n!==void 0?n:0)*(1/(((i=s.config[d])!==null&&i!==void 0?i:0)/100)),f=h/c*100,v=(((o=s.config[d])!==null&&o!==void 0?o:0)-f)/(a.contentItems.length-1),p=0;p<a.contentItems.length;p++)if(a.contentItems[p]===s)a.contentItems[p].config[d]=f;else{var g;a.contentItems[p].config[d]=((g=a.contentItems[p].config[d])!==null&&g!==void 0?g:0)+v}return a.callDownwards("setSize"),!0}close(e){var t,n;this._config.isClosable&&(!((t=(n=this.beforeCloseHandler)===null||n===void 0?void 0:n.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(M.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 n=this._contentElement[0],i=n.offsetWidth-n.clientWidth,o=n.offsetHeight-n.clientHeight;this._contentElement.width(this.width-i).height(this.height-o),this.emit("resize")}}}const Lv=Object.freeze(Object.defineProperty({__proto__:null,Container:pi,ItemContainer:pi},Symbol.toStringTag,{value:"Module"}));function cl(r){var e=location.hash.match(new RegExp(r+"=([^&]*)"));return e?e[1]:null}function ml(r){if(window.location.hash)return cl(r);if(!window.location.search)return null;var e=window.location.search.substr(1).split("&"),t={},n,i;for(i=0;i<e.length;i++)n=e[i].split("="),t[n[0]]=n[1];return t[r]||null}function Ri(r){return window.requestAnimationFrame(r)}function Fv(r,e){var t=e.indexOf(r);if(t===-1)throw new Error("Can't remove item from array. Item is not in the array");e.splice(t,1)}function Lr(){return zt()}function kv(r,e){var t=r.replace(/javascript/gi,"j&#97;vascript").replace(/expression/gi,"expr&#101;ssion").replace(/onload/gi,"onlo&#97;d").replace(/script/gi,"&#115;cript").replace(/onerror/gi,"on&#101;rror");return e===!0?t:t.replace(/>/g,"&gt;").replace(/</g,"&lt;")}function ji(r){return M.trim(r.replace(/(<([^>]+)>)/gi,""))}function Ue(r,e,t){return e=Rv(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Rv(r){var e=jv(r,"string");return typeof e=="symbol"?e:String(e)}function jv(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class $v extends ct{constructor(e){var t,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;super(),Ue(this,"_eElement",void 0),Ue(this,"_oDocument",void 0),Ue(this,"_eBody",void 0),Ue(this,"_destroyAfterMouseUp",void 0),Ue(this,"_nDelay",400),Ue(this,"_timeout",void 0),Ue(this,"timeout",void 0),Ue(this,"_nDistance",10),Ue(this,"_nX",0),Ue(this,"_nY",0),Ue(this,"_nOriginalX",0),Ue(this,"_nOriginalY",0),Ue(this,"_bDragging",!1),this._eElement=e,this._oDocument=M(document),this._eBody=M(document.body),this._destroyAfterMouseUp=n,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,n,i,o,a=this._getCoordinates(e);this._nOriginalX=(t=a.x)!==null&&t!==void 0?t:0,this._nOriginalY=(n=a.y)!==null&&n!==void 0?n: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,n;e.preventDefault();var i=this._getCoordinates(e);this._nX=((t=i.x)!==null&&t!==void 0?t:0)-this._nOriginalX,this._nY=((n=i.y)!==null&&n!==void 0?n: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,n,i,o,a;if(clearTimeout(this._timeout),(t=this._oDocument)===null||t===void 0||t.unbind("mousemove",this.onMouseMove),(n=this._oDocument)===null||n===void 0||n.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,n,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"),(n=this._oDocument)===null||n===void 0||(i=n.find("iframe"))===null||i===void 0||i.css("pointer-events","none"),this.emit("dragStart",this._nOriginalX,this._nOriginalY)}_getCoordinates(e){var t,n;return{x:(t=e.pageX)!==null&&t!==void 0?t:0,y:(n=e.pageY)!==null&&n!==void 0?n:0}}}const rr=$v;function vn(r,e,t){return e=Hv(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Hv(r){var e=Bv(r,"string");return typeof e=="symbol"?e:String(e)}function Bv(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class fl{constructor(e,t){vn(this,"_container",void 0),vn(this,"_reactComponent",null),vn(this,"_portalComponent",null),vn(this,"_originalComponentWillUpdate",null),vn(this,"_initialState",void 0),vn(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=jr.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 n;this._container.setState(t),(n=this._originalComponentWillUpdate)===null||n===void 0||n.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=M.extend(e,this._container._config.props);return H.createElement(this._reactClass,t)}}var Fr=["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"],Wv=[!0,!1,"row","column","stack","component","close","maximise","minimise","open in new window"];function $i(r){if(Fr.length>36)throw new Error("Too many keys in config minifier map");var e={};return Hi(r,e,"_min"),e}function bi(r){if(Fr.length>36)throw new Error("Too many keys in config minifier map");var e={};return Hi(r,e,"_max"),e}function Hi(r,e,t){var n=t==="_min"?Uv:Vv;for(var i in r)if(r.hasOwnProperty(i)){var o=Array.isArray(r)?r[Number.parseInt(i,10)]:r[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=n(i,Fr);e[s]=a}Hi(o,a,t)}else{var l=n(o,Wv);if(Array.isArray(e))e[Number.parseInt(i,10)]=l;else{var d=n(i,Fr);e[d]=l}}}}function Uv(r,e){if(typeof r=="string"&&r.length===1)return"___"+r;var t=e.indexOf(r);return t===-1?r:t.toString(36)}function Vv(r,e){return typeof r=="string"&&r.length===1?e[parseInt(r,36)]:typeof r=="string"&&r.substr(0,3)==="___"?r[3]:r}function ai(r,e,t){return e=Kv(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Kv(r){var e=zv(r,"string");return typeof e=="symbol"?e:String(e)}function zv(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class yi{constructor(e,t){ai(this,"name",void 0),ai(this,"origin",void 0),ai(this,"isPropagationStopped",void 0),this.name=e,this.origin=t,this.isPropagationStopped=!1}stopPropagation(){this.isPropagationStopped=!0}}function gr(r,e,t){return e=Gv(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Gv(r){var e=qv(r,"string");return typeof e=="symbol"?e:String(e)}function qv(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}let Zv=class extends ct{constructor(e){super(),gr(this,"_layoutManager",void 0),gr(this,"_dontPropagateToParent",void 0),gr(this,"_childEventSource",void 0),gr(this,"_boundOnEventFromChild",void 0),this._layoutManager=e,this._dontPropagateToParent=null,this._childEventSource=null,this.on(ct.ALL_EVENT,this._onEventFromThis.bind(this)),this._boundOnEventFromChild=this._onEventFromChild.bind(this),M(window).on("gl_child_event",this._boundOnEventFromChild)}_onEventFromThis(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];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,n="gl_child_event",i=(t=window.opener)===null||t===void 0?void 0:t.document.createEvent("HTMLEvents");i.initEvent(n,!0,!0),i.eventName=n,i.__glArgs=e,i.__gl=this._layoutManager,window.opener.dispatchEvent(i)}_propagateToChildren(e){for(var t=0;t<this._layoutManager.openPopouts.length;t++){var n=this._layoutManager.openPopouts[t].getGlInstance();n&&n!==this._childEventSource&&n.eventHub._$onEventFromParent(e)}}destroy(){M(window).off("gl_child_event",this._boundOnEventFromChild)}};const vl=Zv;function Bi(r,e,t){return r.on(e,t),()=>{r.off(e,t)}}function gl(r){return(e,t)=>Bi(e,r,t)}function pl(r){return(e,t)=>{e.emit(r,t)}}function bl(r){return(e,t)=>{m.useEffect(()=>Bi(e,r,t),[e,t])}}function yl(r){return{listen:gl(r),emit:pl(r),useListener:bl(r)}}const Xv=Object.freeze(Object.defineProperty({__proto__:null,BubblingEvent:yi,DragListener:rr,EventEmitter:ct,EventHub:vl,ReactComponentHandler:fl,animFrame:Ri,filterXss:kv,getHashValue:cl,getQueryStringParam:ml,getUniqueId:Lr,listenForEvent:Bi,makeEmitFunction:pl,makeEventFunctions:yl,makeListenFunction:gl,makeUseListenerFunction:bl,minifyConfig:$i,removeFromArray:Fv,stripTags:ji,unminifyConfig:bi},Symbol.toStringTag,{value:"Module"}));function Ft(r,e,t){return e=Yv(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Yv(r){var e=Qv(r,"string");return typeof e=="symbol"?e:String(e)}function Qv(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class Cl extends ct{constructor(e,t,n,i,o){super(),Ft(this,"isInitialised",!1),Ft(this,"_config",void 0),Ft(this,"_dimensions",void 0),Ft(this,"_parentId",void 0),Ft(this,"_indexInParent",void 0),Ft(this,"_layoutManager",void 0),Ft(this,"_popoutWindow",null),Ft(this,"_id",null),this._config=e,this._dimensions=t,this._parentId=n,this._indexInParent=i,this._layoutManager=o,this._createWindow()}toConfig(){var e,t,n,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:(n=(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&&n!==void 0?n: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,n=null;if(this._parentId){var i;if(t=M.extend(!0,{},(i=this.getGlInstance())===null||i===void 0?void 0:i.toConfig()).content[0],n=this._layoutManager.root.getItemsById(this._parentId)[0],!n){var o;((o=this._layoutManager.root.contentItems.length)!==null&&o!==void 0?o:0)>0?n=this._layoutManager.root.contentItems[0]:n=this._layoutManager.root}}t&&((e=n)===null||e===void 0||e.addChild(t,this._indexInParent),this.close())}_createWindow(){var e=this._createUrl(),t=Math.floor(Math.random()*1e6).toString(36),n=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,n),!this._popoutWindow)if(this._layoutManager.config.settings.blockedPopoutsThrowError===!0){var i=new Error("Popout blocked");throw i.type="popoutBlocked",i}else return;M(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=[],n;for(n in e)t.push(n+"="+e[n]);return t.join(",")}_createUrl(){var e={content:this._config},t="gl-window-config-"+Lr();e=$i(e);try{localStorage.setItem(t,JSON.stringify(e))}catch(i){throw new Error("Error while writing to localStorage "+i.toString())}var n=document.location.href.split("?");return n.length===1?n[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 Pe(r,e,t){return e=Jv(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Jv(r){var e=eg(r,"string");return typeof e=="symbol"?e:String(e)}function eg(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class cn extends ct{constructor(e,t,n,i,o,a){var s,l,d,h,c,f,v,p;if(super(),Pe(this,"_dragListener",void 0),Pe(this,"_layoutManager",void 0),Pe(this,"_contentItem",void 0),Pe(this,"_originalParent",void 0),Pe(this,"_area",null),Pe(this,"_lastValidArea",null),Pe(this,"_minX",void 0),Pe(this,"_maxX",void 0),Pe(this,"_minY",void 0),Pe(this,"_maxY",void 0),Pe(this,"_width",void 0),Pe(this,"_height",void 0),Pe(this,"_sided",void 0),Pe(this,"element",void 0),Pe(this,"childElementContainer",void 0),Pe(this,"_proxyTab",void 0),this._dragListener=n,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 g,y;this._layoutManager.tabDropPlaceholder.width((g=this._contentItem.tab.element.outerWidth(!0))!==null&&g!==void 0?g:0),this._layoutManager.tabDropPlaceholder.height((y=this._contentItem.tab.element.outerHeight(!0))!==null&&y!==void 0?y:0)}if(this.element=M(cn._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",ji((s=this._contentItem.config.title)!==null&&s!==void 0?s:"")),this.element.find(".lm_title").html((l=this._contentItem.config.title)!==null&&l!==void 0?l:""),this.childElementContainer=this.element.find(".lm_content"),this.childElementContainer.append(o.element),this._updateTree(),this._layoutManager._$calculateItemAreas(),M(document.body).append(this.element),this._setDimensions(),!this._contentItem.tab&&this._proxyTab.length){var P,O;this._layoutManager.tabDropPlaceholder.width((P=this._proxyTab.outerWidth(!0))!==null&&P!==void 0?P:0),this._layoutManager.tabDropPlaceholder.height((O=this._proxyTab.outerHeight(!0))!==null&&O!==void 0?O:0)}var _=this._layoutManager.container.offset();this._minX=(d=_?.left)!==null&&d!==void 0?d:0,this._minY=(h=_?.top)!==null&&h!==void 0?h:0,this._maxX=((c=this._layoutManager.container.width())!==null&&c!==void 0?c:0)+this._minX,this._maxY=((f=this._layoutManager.container.height())!==null&&f!==void 0?f:0)+this._minY,this._width=(v=this.element.width())!==null&&v!==void 0?v:0,this._height=(p=this.element.height())!==null&&p!==void 0?p:0,this._setDropPosition(e,t),this._layoutManager.emit("itemPickedUp",this._contentItem)}_onDrag(e,t,n){var i,o,a=(i=n.pageX)!==null&&i!==void 0?i:0,s=(o=n.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,n=e.dragProxyHeight;this.element.width(t),this.element.height(n),t-=this._sided?e.headerHeight:0,n-=this._sided?0:e.headerHeight,this.childElementContainer.width(t),this.childElementContainer.height(n),this._contentItem.element.width(t),this._contentItem.element.height(n),this._contentItem.callDownwards("_$show"),this._contentItem.callDownwards("setSize")}}Pe(cn,"_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 pr(r,e,t){return e=tg(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function tg(r){var e=ng(r,"string");return typeof e=="symbol"?e:String(e)}function ng(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class Sl{constructor(e,t,n){pr(this,"_element",void 0),pr(this,"_itemConfig",void 0),pr(this,"_layoutManager",void 0),pr(this,"_dragListener",void 0),this._element=e,this._itemConfig=t,this._layoutManager=n,this._dragListener=this._createDragListener()}_createDragListener(){return this._dragListener=new rr(this._element,!0),this._dragListener.on("dragStart",this._onDragStart,this),this._dragListener.on("dragStop",this._createDragListener,this),this._dragListener}_onDragStart(e,t){var n=this._itemConfig;typeof n=="function"&&(n=n());var i=this._layoutManager._$normalizeContentItem(M.extend(!0,{},n));new cn(e,t,this._dragListener,this._layoutManager,i,null)}}function br(r,e,t){return e=rg(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function rg(r){var e=ig(r,"string");return typeof e=="symbol"?e:String(e)}function ig(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class wl{constructor(e,t,n){br(this,"_element",M(window)),br(this,"_itemConfig",void 0),br(this,"_layoutManager",void 0),br(this,"_dragListener",void 0),this._itemConfig=e,this._layoutManager=t,this._createDragListener(n)}_createDragListener(e){this._dragListener&&this._dragListener.destroy(),this._element&&(this._dragListener=new rr(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 n=this._itemConfig;typeof n=="function"&&(n=n());var i=this._layoutManager._$normalizeContentItem(M.extend(!0,{},n));new cn(e,t,this._dragListener,this._layoutManager,i,null)}}}function El(r,e,t){return e=og(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function og(r){var e=ag(r,"string");return typeof e=="symbol"?e:String(e)}function ag(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class ir{constructor(){El(this,"element",M(ir._template)),M(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()}}El(ir,"_template",'<div class="lm_dropTargetIndicator"><div class="lm_inner"></div></div>');function si(r,e,t){return e=sg(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function sg(r){var e=lg(r,"string");return typeof e=="symbol"?e:String(e)}function lg(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class Bn{constructor(e,t,n,i){si(this,"element",void 0),si(this,"_header",void 0),si(this,"_action",void 0),this._header=e,this.element=M('<li class="'+n+'" 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 dg(r,e,t){return e=ug(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function ug(r){var e=hg(r,"string");return typeof e=="symbol"?e:String(e)}function hg(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class cg extends Error{constructor(e,t){super(),dg(this,"node",void 0),this.name="Configuration Error",this.message=e,this.node=t}}const rn=cg,mg=Object.freeze(Object.defineProperty({__proto__:null,ConfigurationError:rn},Symbol.toStringTag,{value:"Module"}));function Se(r,e,t){return e=fg(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function fg(r){var e=vg(r,"string");return typeof e=="symbol"?e:String(e)}function vg(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}function on(r){return r.isStack}function qe(r){return r.isComponent}function _l(r){return r.isRoot}class Ie extends ct{constructor(e,t,n,i){super(),Se(this,"config",void 0),Se(this,"type",void 0),Se(this,"contentItems",void 0),Se(this,"parent",void 0),Se(this,"layoutManager",void 0),Se(this,"element",void 0),Se(this,"childElementContainer",void 0),Se(this,"componentName",void 0),Se(this,"isInitialised",!1),Se(this,"isMaximised",!1),Se(this,"isRoot",!1),Se(this,"isRow",!1),Se(this,"isColumn",!1),Se(this,"isStack",!1),Se(this,"isComponent",!1),Se(this,"tab",void 0),Se(this,"_pendingEventPropagations",void 0),Se(this,"_throttledEvents",void 0),this.element=i,this.config=this._extendItemNode(t),this.type=t.type,this.contentItems=[],this.parent=n,this.layoutManager=e,this._pendingEventPropagations={},this._throttledEvents=["stateChanged"],this.on(ct.ALL_EVENT,this._propagateEvent,this),t.content&&this._createContentItems(t)}callDownwards(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;n!==!0&&i!==!0&&this[e].apply(this,t);for(var o=0;o<this.contentItems.length;o++)this.contentItems[o].callDownwards(e,t,n);n===!0&&i!==!0&&this[e].apply(this,t)}removeChild(e){var t,n=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(n!==!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 n=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]),n===!0&&(e.parent=null,e._$destroy()),this.contentItems[i]=t,t.parent=this,on(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=[],n=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 n(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),n=[],i=0;i<t.length;i++)n.push(t[i].instance);return n}_$getItemsByProperty(e,t){return this.getItemsByFilter(function(n){return n[e]===t})}_$setParent(e){this.parent=e}_$highlightDropZone(e,t,n){var i;(i=this.layoutManager.dropTargetIndicator)===null||i===void 0||i.highlightArea(n)}_$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"),n=null,i=0;i<t.length;i++)n=t[i].getActiveContentItem(),n&&qe(n)&&n.container[e]()}_$destroy(){this.emitBubblingEvent("beforeItemDestroyed"),this.callDownwards("_$destroy",[],!0,!0),this.element.remove(),this.emitBubblingEvent("itemDestroyed")}_$getArea(e){var t,n,i;e=e||this.element;var o=(t=e.offset())!==null&&t!==void 0?t:{left:0,top:0},a=(n=e.width())!==null&&n!==void 0?n: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 yi(e,this);this.emit(e,t)}_createContentItems(e){var t;if(!(e.content instanceof Array))throw new rn("content must be an Array",e);for(var n=0;n<e.content.length;n++)t=this.layoutManager.createContentItem(e.content[n],this),this.contentItems.push(t)}_extendItemNode(e){for(var[t,n]of Object.entries(hl)){var i=t;e[i]===void 0&&(e[i]=n)}return e}_propagateEvent(e,t){t instanceof yi&&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,Ri(this._propagateEventToLayoutManager.bind(this,e,t)))}_propagateEventToLayoutManager(e,t){this._pendingEventPropagations[e]=!1,this.layoutManager.emit(e,t)}}function An(r,e,t){return e=gg(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function gg(r){var e=pg(r,"string");return typeof e=="symbol"?e:String(e)}function pg(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class Pl extends Ie{constructor(e,t,n){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,n,M()),An(this,"config",void 0),An(this,"componentName",void 0),An(this,"container",void 0),An(this,"parent",void 0),An(this,"instance",void 0),this.config=t,this.parent=n;var o=e.getComponent(this.config.componentName)||e.getFallbackComponent(),a=M.extend(!0,{},this.config.componentState||{});if(o==null)throw new rn('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 pi(this.config,this,e),this.instance=new o(this.container,a),this.element=this.container._element}close(){var e;(e=this.parent)===null||e===void 0||e.removeChild(this)}setSize(){this.element.is(":visible")&&this.container._$setSize(this.element.width(),this.element.height())}_$init(){Ie.prototype._$init.call(this),this.container.emit("open")}_$hide(){this.container.hide(),Ie.prototype._$hide.call(this)}_$show(){this.container.show(),this.container._config.isFocusOnShow&&this.container._contentElement[0].focus({preventScroll:!0}),Ie.prototype._$show.call(this)}_$destroy(){this.container.emit("destroy",this),Ie.prototype._$destroy.call(this)}_$getArea(){return null}}function et(r,e,t){return e=bg(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function bg(r){var e=yg(r,"string");return typeof e=="symbol"?e:String(e)}function yg(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class Qn extends Ie{constructor(e,t,n,i){super(t,n,i,M('<div class="lm_item lm_'+(e?"column":"row")+'"></div>')),et(this,"isRow",void 0),et(this,"isColumn",void 0),et(this,"childElementContainer",void 0),et(this,"parent",void 0),et(this,"_splitter",[]),et(this,"_splitterSize",void 0),et(this,"_splitterGrabSize",void 0),et(this,"_isColumn",void 0),et(this,"_dimension",void 0),et(this,"_splitterPosition",null),et(this,"_splitterMinPosition",null),et(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,n){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),Ie.prototype.addChild.call(this,e,t),i=1/this.contentItems.length*100,n===!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 n,i=(n=e.config[this._dimension])!==null&&n!==void 0?n: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)}if(Ie.prototype.removeChild.call(this,e,t),this.contentItems.length===1&&this.config.isClosable===!0){var h;l=this.contentItems[0],this.contentItems=[],(h=this.parent)===null||h===void 0||h.replaceChild(this,l,!0)}else this.callDownwards("setSize"),this.emitBubblingEvent("stateChanged")}replaceChild(e,t){var n=e.config[this._dimension];super.replaceChild(e,t),t.config[this._dimension]=n,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(Ie.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,n=(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-=n:i-=n;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 f=Math.floor((this._isColumn?o:i)-a);return{itemSizes:s,additionalPixel:f,totalWidth:i,totalHeight:o}}_calculateRelativeSizes(){for(var e=0,t=[],n=this._isColumn?"height":"width",i=0;i<this.contentItems.length;i++){var o=this.contentItems[i].config[n];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[n]=(100-e)/t.length;this._respectMinItemWidth();return}if(Math.round(e)>100)for(var s=0;s<t.length;s++)t[s].config[n]=50,e+=50;for(var l=0;l<this.contentItems.length;l++){var d;this.contentItems[l].config[n]=((d=this.contentItems[l].config[n])!==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,n=[],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},n.push(l)),s.push(l)}if(!(o===0||o>i)){var f=o/i;a=o;for(var v=0;v<n.length;v++){l=n[v];var p=Math.round((l.width-t)*f);a-=p,l.width-=p}a!==0&&(s[s.length-1].width-=a);for(var g=0;g<this.contentItems.length;g++)this.contentItems[g].config.width=s[g].width/d.totalWidth*100}}}_createSplitter(e){var t;return t=new Tl(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,n=0,i=0;i<e.length;++i){var o,a;t=Math.max((o=e[i].minWidth)!==null&&o!==void 0?o:0,t),n=Math.max((a=e[i].minHeight)!==null&&a!==void 0?a:0,n)}return{horizontal:t,vertical:n}}_onSplitterDragStart(e){var t,n,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((n=a.after.config.content)!==null&&n!==void 0?n:[]),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,n){var i=this._isColumn?n: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,n,i,o,a,s=this._getItemsForSplitter(e),l=(t=s.before.element[this._dimension]())!==null&&t!==void 0?t:0,d=(n=s.after.element[this._dimension]())!==null&&n!==void 0?n: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}),Ri(this.callDownwards.bind(this,"setSize",void 0,void 0,void 0))}}function oa(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,n)}return t}function aa(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?oa(Object(t),!0).forEach(function(n){Ci(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):oa(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function Ci(r,e,t){return e=Cg(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Cg(r){var e=Sg(r,"string");return typeof e=="symbol"?e:String(e)}function Sg(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class Si extends Ie{constructor(e,t,n){super(e,aa(aa({},t),{},{type:"root"}),null,M('<div class="lm_goldenlayout lm_item lm_root"></div>')),Ci(this,"childElementContainer",void 0),Ci(this,"_containerElement",void 0),this.isRoot=!0,this.type="root",this.childElementContainer=this.element,this._containerElement=n,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 n,i;e=typeof e>"u"?(n=this._containerElement.width())!==null&&n!==void 0?n: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,n){this.layoutManager.tabDropPlaceholder.remove(),super._$highlightDropZone(e,t,n)}_$onDrop(e,t){var n;if(qe(e)&&(n=this.layoutManager.createContentItem({type:"stack",header:e.config.header||{}},this),n._$init(),n.addChild(e),e=n),!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 Qn)||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 sa(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,n)}return t}function gn(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?sa(Object(t),!0).forEach(function(n){Ve(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):sa(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function Ve(r,e,t){return e=wg(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function wg(r){var e=Eg(r,"string");return typeof e=="symbol"?e:String(e)}function Eg(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class wi extends Ie{constructor(e,t,n){var i,o,a,s,l,d,h,c,f;super(e,t,n,M('<div class="lm_item lm_stack"></div>')),Ve(this,"_activeContentItem",null),Ve(this,"_header",void 0),Ve(this,"childElementContainer",M('<div class="lm_items"></div>')),Ve(this,"header",void 0),Ve(this,"parent",void 0),Ve(this,"isStack",!0),Ve(this,"_dropSegment",null),Ve(this,"_contentAreaDimensions",null),Ve(this,"_dropIndex",void 0),Ve(this,"_side",void 0),Ve(this,"_sided",!1),Ve(this,"config",void 0),this.parent=n,this.config=t;var v=e.config;this._side=!1,this._header={show:((i=v.settings)===null||i===void 0?void 0:i.hasHeaders)&&t.hasHeaders!==!1,popout:(o=v.settings)!==null&&o!==void 0&&o.showPopoutIcon?(a=v.labels)===null||a===void 0?void 0:a.popout:void 0,maximise:(s=v.settings)!==null&&s!==void 0&&s.showMaximiseIcon?(l=v.labels)===null||l===void 0?void 0:l.maximise:void 0,close:(d=v.settings)!==null&&d!==void 0&&d.showCloseIcon?(h=v.labels)===null||h===void 0?void 0:h.close:void 0,minimise:(c=(f=v.labels)===null||f===void 0?void 0:f.minimise)!==null&&c!==void 0?c:void 0},v.header&&(this._header=gn(gn({},this._header),v.header)),t.header&&(this._header=gn(gn({},this._header),t.header)),t.content&&t.content[0]&&t.content[0].header&&(this._header=gn(gn({},this._header),t.content[0].header)),this.header=new Mt(e,this),this.element.append(this.header.element),this.element.append(this.childElementContainer),this._setupHeaderPosition(),this._$validateClosability()}setSize(){var e,t,n,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=((n=this.element.width())!==null&&n!==void 0?n: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,n=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(n-1,0)]):this._activeContentItem=null),this._$validateClosability(),this.emitBubblingEvent("stateChanged")}_$validateClosability(){for(var e=this.header._isClosable(),t=0,n=this.contentItems.length;t<n;t++){var i;if(!e)break;e=(i=this.contentItems[t].config.isClosable)!==null&&i!==void 0?i:!1}this.header._$setClosable(e)}_$destroy(){Ie.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",n=this._dropSegment==="left"||this._dropSegment==="right",i=this._dropSegment==="top"||this._dropSegment==="left",o=this.parent instanceof Qn&&(t&&this.parent.isColumn||n&&this.parent.isRow),a=t?"column":"row",s=t?"height":"width";if(qe(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,f=this.layoutManager.createContentItem({type:a},this);(c=this.parent)===null||c===void 0||c.replaceChild(this,f),f.addChild(e,i?0:void 0,!0),f.addChild(this,i?void 0:0,!0),this.config[s]=50,e.config[s]=50,f.callDownwards("setSize")}}_$highlightDropZone(e,t){if(this._contentAreaDimensions)for(var[n,i]of Object.entries(this._contentAreaDimensions)){var o=i.hoverArea;if(o.x1<e&&o.x2>e&&o.y1<t&&o.y2>t){n==="header"?(this._dropSegment="header",this._highlightHeaderDropZone(e)):(this._resetHeaderDropZone(),this._highlightBodyDropZone(n));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 n=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+n*.25,y2:t.y2},highlightArea:{x1:t.x1,y1:t.y1,x2:t.x1+n*.5,y2:t.y2}},this._contentAreaDimensions.top={hoverArea:{x1:t.x1+n*.25,y1:t.y1,x2:t.x1+n*.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+n*.75,y1:t.y1,x2:t.x2,y2:t.y2},highlightArea:{x1:t.x1+n*.5,y1:t.y1,x2:t.x2,y2:t.y2}},this._contentAreaDimensions.bottom={hoverArea:{x1:t.x1+n*.25,y1:t.y1+i*.5,x2:t.x1+n*.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,n,i,o,a,s,l,d,h,c,f,v,p,g,y,P,O=this.header.tabs.length;if(O===0){var _,k,W,Q,N,B,j,Y,ne=this.header.element.offset();(_=this.layoutManager.dropTargetIndicator)===null||_===void 0||_.highlightArea({x1:(k=ne?.left)!==null&&k!==void 0?k:0,x2:((W=ne?.left)!==null&&W!==void 0?W:0)+100,y1:(Q=(N=this.header.element.offset())===null||N===void 0?void 0:N.top)!==null&&Q!==void 0?Q:0,y2:((B=(j=this.header.element.offset())===null||j===void 0?void 0:j.top)!==null&&B!==void 0?B:0)+((Y=this.header.element.innerHeight())!==null&&Y!==void 0?Y:0)});return}var F=this.header.tabsContainer,q=(t=F.get(0))===null||t===void 0?void 0:t.getBoundingClientRect(),K=(n=this.layoutManager.tabDropPlaceholder.get(0))===null||n===void 0?void 0:n.getBoundingClientRect();if(!(!q||!K)){e<q.left?e=q.left+1:e>q.right&&(e=q.right-1);var A,U;if(!(K.left<e&&e<K.right)){for(var z=0;z<O;z++){var me;if(A=this.header.tabs[z].element,U=(me=A.get(0))===null||me===void 0?void 0:me.getBoundingClientRect(),U&&U.left<e&&e<U.right){this._dropIndex=z;break}}if(A&&U&&e<U.left+U.width*.5)A.before(this.layoutManager.tabDropPlaceholder);else if(A){var je;this._dropIndex=Math.min(((je=this._dropIndex)!==null&&je!==void 0?je:0)+1,O),A.after(this.layoutManager.tabDropPlaceholder)}}var De=(i=(o=this.layoutManager.tabDropPlaceholder.offset())===null||o===void 0?void 0:o.left)!==null&&i!==void 0?i:0;De=Math.max(De,(a=(s=this.header.tabsContainer.offset())===null||s===void 0?void 0:s.left)!==null&&a!==void 0?a:0);var b=De+((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)),(f=this.layoutManager.dropTargetIndicator)===null||f===void 0||f.highlightArea({x1:De,x2:b,y1:(v=(p=this.header.element.offset())===null||p===void 0?void 0:p.top)!==null&&v!==void 0?v:0,y2:((g=(y=this.header.element.offset())===null||y===void 0?void 0:y.top)!==null&&g!==void 0?g:0)+((P=this.header.element.innerHeight())!==null&&P!==void 0?P:0)})}}_resetHeaderDropZone(){this.layoutManager.tabDropPlaceholder.remove()}_setupHeaderPosition(){var e=["right","left","bottom"].some(n=>n===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,n,i=(t=this._contentAreaDimensions)===null||t===void 0||(n=t[e])===null||n===void 0?void 0:n.highlightArea;if(i){var o;(o=this.layoutManager.dropTargetIndicator)===null||o===void 0||o.highlightArea(i)}this._dropSegment=e}}const _g=Object.freeze(Object.defineProperty({__proto__:null,AbstractContentItem:Ie,Component:Pl,ContentItem:Ie,Root:Si,RowOrColumn:Qn,Stack:wi,isComponent:qe,isRoot:_l,isStack:on},Symbol.toStringTag,{value:"Module"}));function Ot(r,e,t){return e=Pg(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Pg(r){var e=Tg(r,"string");return typeof e=="symbol"?e:String(e)}function Tg(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class or{constructor(e,t){var n;Ot(this,"header",void 0),Ot(this,"contentItem",void 0),Ot(this,"element",M(or._template)),Ot(this,"titleElement",void 0),Ot(this,"closeElement",void 0),Ot(this,"isActive",!1),Ot(this,"_layoutManager",void 0),Ot(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,(n=this._layoutManager.config.settings)!==null&&n!==void 0&&n.reorderEnabled&&t.config.reorderEnabled&&(this._dragListener=new rr(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),qe(this.contentItem)&&(this.contentItem.container._contentElement.on("focusin",this._onTabContentFocusIn).on("focusout",this._onTabContentFocusOut),this.contentItem.container.tab=this,this.contentItem.container.emit("tab",this))}setTitle(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"";this.titleElement.html(e)}setActive(e){e!==this.isActive&&(this.isActive=e,e?this.element.addClass("lm_active"):this.element.removeClass("lm_active"))}_$destroy(){this.element.off("click",this._onTabClick),this.element.off("auxclick",this._onTabClick),this.closeElement.off("click",this._onCloseClick),qe(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 n;(n=this.contentItem.parent)!==null&&n!==void 0&&n.isMaximised&&this.contentItem.parent.toggleMaximise(),this._dragListener&&new cn(e,t,this._dragListener,this._layoutManager,this.contentItem,this.header.parent)}_onTabContentFocusIn(){M(".lm_focusin",this._layoutManager.root.element).removeClass("lm_focusin"),this.element.addClass("lm_focusin")}_onTabContentFocusOut(){qe(this.contentItem)&&!this.contentItem.container._contentElement[0].contains(document.activeElement)&&this.element.removeClass("lm_focusin")}_onTabClick(e){if(!e||e.button===0){var t,n=this.header.parent.getActiveContentItem();this.contentItem!==n&&qe(this.contentItem)?this.header.parent.setActiveContentItem(this.contentItem):qe(this.contentItem)&&!this.contentItem.container._contentElement[0].contains(document.activeElement)&&this.contentItem.container._contentElement.focus(),qe(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(),qe(this.contentItem)?this.contentItem.container.close():this.header.parent.removeChild(this.contentItem)}_onCloseMousedown(e){e.stopPropagation()}}Ot(or,"_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 ie(r,e,t){return e=Og(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Og(r){var e=Ig(r,"string");return typeof e=="symbol"?e:String(e)}function Ig(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class Mt extends ct{constructor(e,t){var n,i;super(),ie(this,"layoutManager",void 0),ie(this,"element",M(Mt._template)),ie(this,"tabsContainer",void 0),ie(this,"tabDropdownContainer",void 0),ie(this,"tabDropdownSearch",void 0),ie(this,"tabDropdownList",null),ie(this,"controlsContainer",void 0),ie(this,"parent",void 0),ie(this,"tabs",[]),ie(this,"activeContentItem",null),ie(this,"closeButton",null),ie(this,"tabDropdownButton",null),ie(this,"tabNextButton",M(Mt._nextButtonTemplate)),ie(this,"tabPreviousButton",M(Mt._previousButtonTemplate)),ie(this,"holdTimer",null),ie(this,"rAF",null),ie(this,"CLICK_TIMEOUT",500),ie(this,"START_SPEED",.01),ie(this,"ACCELERATION",5e-4),ie(this,"PADDING",10),ie(this,"SCROLL_LEFT","left"),ie(this,"SCROLL_RIGHT","right"),ie(this,"isDraggingTab",!1),ie(this,"isOverflowing",!1),ie(this,"isDropdownShown",!1),ie(this,"dropdownKeyIndex",0),ie(this,"_lastVisibleTabIndex",-1),ie(this,"_tabControlOffset",void 0),this.layoutManager=e,(n=this.layoutManager.config.settings)!==null&&n!==void 0&&n.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 n=0;n<this.tabs.length;n++)if(this.tabs[n].contentItem===e)return;var i=new or(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,n,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||(n=t.scrollIntoView)===null||n===void 0||n.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 n=Math.abs(e.deltaY)>Math.abs(e.deltaX)?e.deltaY:e.deltaX;if(e.deltaMode===WheelEvent.DOM_DELTA_PAGE){var i;n*=(i=this.tabsContainer.innerWidth())!==null&&i!==void 0?i:1}else e.deltaMode===WheelEvent.DOM_DELTA_LINE&&(n*=100/3);t.scrollLeft+=Math.round(n)}}_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 n,i,o,a,s;if(((n=(i=this.tabs[t].element.get(0))===null||i===void 0?void 0:i.offsetLeft)!==null&&n!==void 0?n: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 n,i,o;if(((n=(i=this.tabs[t].element.get(0))===null||i===void 0?void 0:i.offsetLeft)!==null&&n!==void 0?n: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,n;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)===((n=this.tabsContainer.get(0))===null||n===void 0?void 0:n.scrollWidth)?this.tabNextButton.prop("disabled",!0):(this.tabNextButton.prop("disabled",!1),this.tabPreviousButton.first().prop("disabled",!1))}_handleScrollRepeat(e,t){var n,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((n=this.rAF)!==null&&n!==void 0?n:-1),this.rAF=window.requestAnimationFrame(h=>{var c,f,v=o||h,p=h-v,g=this.START_SPEED*p+.5*this.ACCELERATION*(p*p);g=Math.min(g,(c=(f=this.tabsContainer.get(0))===null||f===void 0?void 0:f.scrollWidth)!==null&&c!==void 0?c:1/0),this._handleScrollRepeat(e,t,g,v)})}}_$setClosable(e){return this.closeButton&&this._isClosable()?(this.closeButton.element[e?"show":"hide"](),!0):!1}_$destroy(){this.emit("destroy",this);for(var e=0;e<this.tabs.length;e++)this.tabs[e]._$destroy();this._detachWheelListener(),this._handleItemDropped(),M(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,n,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),n=this._getHeaderSetting("popout"),new Bn(this,n,"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),n=this._getHeaderSetting("close"),this.closeButton=new Bn(this,n,"lm_close",e))}_showAdditionalTabsDropdown(){if(this.isDropdownShown){this._hideAdditionalTabsDropdown();return}this.tabDropdownList=this.tabsContainer.clone(!0).appendTo(this.tabDropdownContainer).children().removeClass("lm_active"),M(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"),M(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 n,i;e.preventDefault(),(n=this.tabDropdownList)===null||n===void 0||n.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 n,i;((n=(i=this.tabs[t].contentItem.config.title)===null||i===void 0?void 0:i.toLowerCase().indexOf(e.target.value.toLowerCase()))!==null&&n!==void 0?n:-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,n;this.isDropdownShown&&(e&&(t=this.tabDropdownContainer.get(0))!==null&&t!==void 0&&t.contains(e.target)||e&&((n=this.tabDropdownButton)===null||n===void 0?void 0:n.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(),M(document).off("mousedown",this._hideAdditionalTabsDropdown)))}_updateAdditionalTabsDropdown(){var e,t,n,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=(n=M(window).height())!==null&&n!==void 0?n:0,l=(i=M(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,f=Math.min(d.left+(c?d.width:0),l-a.width-this.PADDING),v=c?Math.max(d.top-o,this.PADDING):d.bottom,p=s-v-this.PADDING;this.tabDropdownContainer.css({"max-height":p,top:v,left:f})}}}}_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 n;(n=this.tabDropdownButton)===null||n===void 0||n.element.hide(),this.tabNextButton.hide(),this.tabPreviousButton.hide(),this.isOverflowing=!1}this.isOverflowing&&this._checkScrollArrows()}}}}ie(Mt,"_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(""));ie(Mt,"_previousButtonTemplate",['<ul class="lm_controls">','<li class="lm_tabpreviousbutton"></li>',"</ul>"].join(""));ie(Mt,"_nextButtonTemplate",['<li class="lm_tabnextbutton"></li>'].join(""));function Ln(r,e,t){return e=Dg(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Dg(r){var e=xg(r,"string");return typeof e=="symbol"?e:String(e)}function xg(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class Tl{constructor(e,t,n){Ln(this,"_isVertical",void 0),Ln(this,"_size",void 0),Ln(this,"_grabSize",void 0),Ln(this,"_dragListener",void 0),Ln(this,"element",void 0),this._isVertical=e,this._size=t,this._grabSize=n<t?t:n,this.element=this._createElement(),this._dragListener=new rr(this.element)}on(e,t,n){var i;(i=this._dragListener)===null||i===void 0||i.on(e,t,n)}_$destroy(){var e;(e=this._dragListener)===null||e===void 0||e.destroy(),this._dragListener=null,this.element.remove()}_createElement(){var e=M('<div class="lm_drag_handle"></div>'),t=M('<div class="lm_splitter"></div>');t.append(e);var n=this._grabSize-this._size,i=n/2;return this._isVertical?(e.css("top",-i),e.css("height",this._size+n),t.addClass("lm_vertical"),t.height(this._size)):(e.css("left",-i),e.css("width",this._size+n),t.addClass("lm_horizontal"),t.width(this._size)),t}}const Mg=Object.freeze(Object.defineProperty({__proto__:null,BrowserPopout:Cl,DragProxy:cn,DragSource:Sl,DragSourceFromEvent:wl,DropTargetIndicator:ir,Header:Mt,HeaderButton:Bn,Splitter:Tl,Tab:or},Symbol.toStringTag,{value:"Module"}));var Ng={config:Dv,container:Lv,controls:Mg,errors:mg,items:_g,utils:Xv};const Ag=Ng;function la(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,n)}return t}function $e(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?la(Object(t),!0).forEach(function(n){ae(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):la(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function ae(r,e,t){return e=Lg(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Lg(r){var e=Fg(r,"string");return typeof e=="symbol"?e:String(e)}function Fg(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}var da=["column","row","stack","component"];class Kr extends ct{static isLayoutItemConfig(e){return da.includes(e.type)}static minifyConfig(e){return $i(e)}static unminifyConfig(e){return bi(e)}constructor(e,t){super(),ae(this,"isInitialised",!1),ae(this,"_isFullPage",!1),ae(this,"_resizeTimeoutId",void 0),ae(this,"_components",{"lm-react-component":fl}),ae(this,"_fallbackComponent",void 0),ae(this,"_itemAreas",[]),ae(this,"_maximisedItem",null),ae(this,"_maximisePlaceholder",M('<div class="lm_maximise_place"></div>')),ae(this,"_creationTimeoutPassed",!1),ae(this,"_subWindowsCreated",!1),ae(this,"_dragSources",[]),ae(this,"_updatingColumnsResponsive",!1),ae(this,"_firstLoad",!0),ae(this,"_reactChildMap",new Map),ae(this,"_reactChildren",null),ae(this,"_initialHeaderHeight",void 0),ae(this,"width",null),ae(this,"height",null),ae(this,"root",void 0),ae(this,"openPopouts",[]),ae(this,"selectedItem",null),ae(this,"isSubWindow",!1),ae(this,"eventHub",new vl(this)),ae(this,"config",void 0),ae(this,"container",void 0),ae(this,"_originalContainer",void 0),ae(this,"dropTargetIndicator",null),ae(this,"tabDropPlaceholder",M('<div class="lm_drop_tab_placeholder"></div>')),this._onResize=this._onResize.bind(this),this._onUnload=this._onUnload.bind(this),this._windowBlur=this._windowBlur.bind(this),this._windowFocus=this._windowFocus.bind(this),this.config=this._createConfig(e),this._originalContainer=t,this.container=this._getContainer(),this._initialHeaderHeight=this.config.dimensions.headerHeight,this.isSubWindow&&M("body").css("visibility","hidden")}registerComponent(e,t){if(typeof t!="function"&&(t==null||t.render==null||typeof t.render!="function"))throw new Error("Please register a constructor function");if(this._components[e]!==void 0)throw new Error("Component "+e+" is already registered");this._components[e]=t;var n=()=>{if(this._components[e]===void 0)throw new Error("Component "+e+" is not registered");delete this._components[e]};return n}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 Ie))throw new Error("Root must be a ContentItem");var t={settings:$e({},this.config.settings),dimensions:$e({},this.config.dimensions),labels:$e({},this.config.labels),content:[]},n=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?n(t,{contentItems:[e]}):n(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){M(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 ir,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 n=this._reactChildMap.get(e);n===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 n,i;if(this.width=(n=e??this.container.width())!==null&&n!==void 0?n: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(),M(window).off("resize",this._onResize),M(window).off("unload beforeunload",this._onUnload),M(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 n,i;if(typeof e.type!="string")throw new rn("Missing parameter 'type'",e);if(e.type==="react-component"&&(e.type="component",e.componentName="lm-react-component"),!Kr.isLayoutItemConfig(e))throw i="Unknown type '"+e.type+"'. Valid types are "+da.join(","),new rn(i);return e.type==="component"&&!(t instanceof wi)&&t&&!(this.isSubWindow===!0&&t instanceof Si)&&(e={type:"stack",width:e.width,height:e.height,content:[e]}),e.id=(n=e.id)!==null&&n!==void 0?n:Lr(),e.type==="stack"?new wi(this,e,t):e.type==="row"?new Qn(!1,this,e,t):e.type==="column"?new Qn(!0,this,e,t):new Pl(this,e,t)}createPopout(e,t,n,i){var o=[],a=e instanceof Ie,s=this;if(a){var l;o=this.toConfig(e).content,n=Lr();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(n),i==null||Number.isNaN(i)){var f;i=(f=d)===null||f===void 0?void 0:f.contentItems.indexOf(h)}}else e instanceof Array?o=e:o=[e];if(!t&&a){var v,p,g,y=window.screenX||window.screenLeft,P=window.screenY||window.screenTop,O=(v=e.element.offset())!==null&&v!==void 0?v:{left:0,top:0};t={left:y+O.left,top:P+O.top,width:(p=e.element.width())!==null&&p!==void 0?p:0,height:(g=e.element.height())!==null&&g!==void 0?g: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||!n||i===void 0)){var _=new Cl(o,t,n,i,this);return _.on("initialised",function(){s.emit("windowOpened",_)}),_.on("closed",function(){s._$reconcilePopoutWindows()}),this.openPopouts.push(_),_}}createDragSource(e,t){this.config.settings.constrainDragToContainer=!1;var n=new Sl(e,t,this);return this._dragSources.push(n),n}createDragSourceFromEvent(e,t){return this.config.settings.constrainDragToContainer=!1,new wl(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,n;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((n=this.container.height())!==null&&n!==void 0?n: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 n=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&&n>a.surface&&(n=a.surface,i=a)}return i}_$createRootItemAreas(){var e=50,t=$e({},this.root._$getArea()),n=[$e($e({},t),{},{side:"left",x2:t.x1+e}),$e($e({},t),{},{side:"right",x1:t.x2-e}),$e($e({},t),{},{side:"top",y2:t.y1+e}),$e($e({},t),{},{side:"bottom",y1:t.y2-e})];n.forEach(i=>{i.surface=(i.x2-i.x1)*(i.y2-i.y1)}),this._itemAreas.push(...n)}_$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 n=e[t];if(on(n)){var i=n._$getArea();if(i!==null)if(i instanceof Array)this._itemAreas=this._itemAreas.concat(i);else{var o;this._itemAreas.push(i);var a=$e($e({},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 Ie)return e;if(M.isPlainObject(e)&&e.type){var n=this.createContentItem(e,t??null);return n.callDownwards("_$init"),n}else throw new Error("Invalid contentItem")}_$reconcilePopoutWindows(){for(var e=[],t=0;t<this.openPopouts.length;t++){var n;((n=this.openPopouts[t].getWindow())===null||n===void 0?void 0:n.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=n=>{if(e.push(n),n.contentItems instanceof Array)for(var i=0;i<n.contentItems.length;i++)t(n.contentItems[i])};return t(this.root),e}_bindEvents(){this._isFullPage&&M(window).resize(this._onResize),M(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,n=ml("gl-window");n&&(this.isSubWindow=!0,e=JSON.parse(localStorage.getItem(n)||"{}"),e=bi(e),localStorage.removeItem(n)),e=M.extend(!0,{},dl,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=M('<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=ji((e=this.config.content[0].title)!==null&&e!==void 0?e:""),M("head").append(M("body link, body style, template, .gl_keep")),this.container=M("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?M(this._originalContainer):M("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,M("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 rn(t,e);if(e.content.length>1)throw t="Top level content can't contain more then one element.",new rn(t,e);this.root=new Si(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,n=e*t;if(!(this.width==null||n<=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(n){e.addChild(n),t.removeChild(n,!0)}):t.contentItems.forEach(n=>{this._addChildContentItemsToContainer(e,n)})}_findAllStackContainers(){var e=[];return this._findAllStackContainersRecursive(e,this.root),e}_findAllStackContainersRecursive(e,t){t.contentItems.forEach(n=>{on(n)?e.push(n):n.isComponent||this._findAllStackContainersRecursive(e,n)})}}ae(Kr,"__lm",Ag);const kg=Kr,Rg="_lm_dragging_k4a5m_1",jg="_lm_goldenlayout_k4a5m_1",$g="_lm_header_k4a5m_1",Hg="_lm_controls_k4a5m_1",Bg="_lm_tabpreviousbutton_k4a5m_1",Wg="_lm_tabnextbutton_k4a5m_1",Ug="_lm_tab_k4a5m_1",Vg="_lm_active_k4a5m_1",Kg="_lm_close_tab_k4a5m_1",zg="_lm_content_k4a5m_1",Gg="_lm_dragProxy_k4a5m_1",qg="_lm_dropTargetIndicator_k4a5m_1",Zg="_march_k4a5m_1",Xg="_lm_inner_k4a5m_1",Yg="_lm_splitter_k4a5m_1",Qg="_lm_selectable_k4a5m_1",Jg="_lm_tabdropdown_list_k4a5m_1",ep="_lm_title_k4a5m_1",tp="_lm_title_before_k4a5m_1",np="_lm_selected_k4a5m_1",rp="_lm_focusin_k4a5m_1",ip="_lm_window_blur_k4a5m_1",op="_lm_popout_k4a5m_1",ap="_lm_maximise_k4a5m_1",sp="_lm_tabdropdown_k4a5m_1",lp="_lm_close_k4a5m_1",dp="_lm_tabdropdown_search_k4a5m_1",up="_lm_tabs_k4a5m_1",hp="_lm_keyboard_active_k4a5m_1",cp="_lm_maximised_k4a5m_1",mp="_lm_items_k4a5m_1",ua={"tab-height":"28px","drag-border-width":"5px",lm_dragging:Rg,lm_goldenlayout:jg,lm_header:$g,lm_controls:Hg,lm_tabpreviousbutton:Bg,lm_tabnextbutton:Wg,lm_tab:Ug,lm_active:Vg,lm_close_tab:Kg,lm_content:zg,lm_dragProxy:Gg,lm_dropTargetIndicator:qg,march:Zg,lm_inner:Xg,lm_splitter:Yg,lm_selectable:Qg,lm_tabdropdown_list:Jg,lm_title:ep,lm_title_before:tp,lm_selected:np,lm_focusin:rp,lm_window_blur:ip,lm_popout:op,lm_maximise:ap,lm_tabdropdown:sp,lm_close:lp,lm_tabdropdown_search:dp,lm_tabs:up,lm_keyboard_active:hp,lm_maximised:cp,lm_items:mp},ha=Object.freeze({tabHeight:parseInt(ua["tab-height"],10),dragBorderWidth:parseInt(ua["drag-border-width"],10)});function ca(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,n)}return t}function Tt(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?ca(Object(t),!0).forEach(function(n){Ol(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):ca(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function Ol(r,e,t){return e=fp(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function fp(r){var e=vp(r,"string");return typeof e=="symbol"?e:String(e)}function vp(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}var kt=V.module("LayoutUtils");function Il(r){return r.componentName!==void 0}function Cn(r){var e=r;return(Il(r)&&r.componentName==="lm-react-component"||r.type==="react-component")&&e.component!==void 0}function yr(r){return r.focus!==void 0}function ma(r){return r.type==="stack"}class x{static activateTab(e,t){var n=x.getStackForRoot(e,t,!1);if(!n){kt.error("Could not find stack for config",t);return}var i=x.getContentItemInStack(n,t);i&&n.setActiveContentItem(i)}static isActiveTab(e,t){var n=x.getStackForRoot(e,t,!1);if(!n)return kt.error("Could not find stack for config",t),!1;var i=x.getContentItemInStack(n,t),o=n.getActiveContentItem();return o===i}static addStack(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;if(_l(e)){var n={type:t?"column":"row"};(e.contentItems==null||e.contentItems.length===0)&&e.addChild(n);var i=e.contentItems[0],o=t?i.isColumn:i.isRow;if(!o){e.removeChild(i,!0),e.addChild(n);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;if(!l){var d={type:t?"row":"column"};e.addChild(d),e.removeChild(s,!0),e.contentItems[e.contentItems.length-1].addChild(s),s=e.contentItems[e.contentItems.length-1]}return this.addStack(s,!t)}static getStackById(e,t){var n,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;if(i&&on(e)&&e.contentItems.length===0)return e;if(t===((n=e.config)===null||n===void 0?void 0:n.id)){if(on(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]:{},n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;if(n&&on(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&&qi(o.config,t))return e;var a=this.getStackForConfig(o,t,n);if(a)return a}return null}static getStackForRoot(e,t){var n=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&&n&&(a=this.addStack(e)),a}static getStackForComponentTypes(e,t){for(var n=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=x.getStackForRoot(e,{component:s},n&&l,i,o);if(d)return d}return null}static getContentItemInStack(e,t){if(!e)return null;for(var n=0;n<e.contentItems.length;n+=1){var i=e.contentItems[n];if(i.isComponent&&i.config!=null&&qi(i.config,t))return i}return null}static dehydrateLayoutConfig(e,t){if(e==null||!e.length)return[];for(var n=[],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?n.push(l):kt.debug2('dehydrateLayoutConfig: skipping unmapped component "'.concat(a,'"'))}else if(s){var d=Tt(Tt({},o),{},{content:x.dehydrateLayoutConfig(s,t)});n.push(d)}else n.push(o)}return n}static getTabPoint(e){var{tab:t}=e;if(t==null)throw new Error("Cannot get tab for panel container ".concat(e));var n=t.element[0].getBoundingClientRect();return[n.left+n.width*.5,n.bottom-8]}static dropLayoutMinorChange(e){for(var t=0;t<e.length;t+=1){var n=e[t],{content:i}=n;i!==void 0?(ma(n)&&delete n.activeItemIndex,x.dropLayoutMinorChange(i)):Cn(n)&&n.component==="IrisGridPanel"&&n.props.panelState!=null&&(delete n.id,n.props.panelState.irisGridState.sorts=[],n.props.panelState.irisGridState.quickFilters=[],n.props.panelState.gridState.isStuckToBottom=!1,n.props.panelState.gridState.isStuckToRight=!1)}}static isEqual(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,i=x.cloneLayout(e),o=x.cloneLayout(t);return n?(x.dropLayoutMinorChange(i),x.dropLayoutMinorChange(o),qn(i,o)):qn(i,o)}static cloneLayout(e){return JSON.parse(JSON.stringify(e))}static hydrateLayoutConfig(e,t){if(e==null||!e.length)return[];for(var n=[],i=0;i<e.length;i+=1){var o=e[i];if(Cn(o)){var a,{component:s,props:l={}}=o;n.push(Tt(Tt({},o),{},{id:(a=o?.id)!==null&&a!==void 0?a:zt(),props:t(s,l)}))}else if(o.content!==void 0){var d=x.hydrateLayoutConfig(o.content,t);ma(o)&&o.activeItemIndex!=null&&o.activeItemIndex>=d.length&&(kt.warn("Fixing bad activeItemIndex!",o.activeItemIndex,o),o.activeItemIndex=0),n.push(Tt(Tt({},o),{},{content:d}))}else n.push(o)}return n}static openComponent(){var{root:e,config:t,stack:n=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=Tt({},t);if(h.id==null&&(h.id=zt()),l!=null){e?.layoutManager.createDragSourceFromEvent(h,l);return}var c=o||{id:h.id,component:h.component};R(e);var f=n??(a?x.addStack(e):x.getStackForRoot(e,c));R(f);var v=x.getContentItemInStack(f,c);if(s!=null){var p=y=>{kt.debug("Component created, focusing element",s),f.off("componentCreated",p);var{element:P}=y.origin;requestAnimationFrame(()=>{x.focusElement(P[0],s)})};f.on("componentCreated",p)}if(i&&v){var g=f.contentItems.indexOf(v);f.addChild(h,g+1),f.removeChild(v),f.setActiveContentItem(f.contentItems[g])}else f.addChild(h);s==null&&d&&yr(d)&&d.focus()}static openComponentInStack(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,i=document.activeElement,o={id:t.id},a=x.getContentItemInStack(e,o);if(n&&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&&yr(i)&&i.focus()}static closeComponent(e,t,n){var i=x.getStackForRoot(e,t,!1,!1,!1);if(!i){kt.warn("Cannot find stack for component, ignoring close",t);return}var o=x.getContentItemInStack(i,t),a=document.activeElement;o&&(qe(o)?o.container.close(n):i.removeChild(o)),a&&document.contains(a)&&yr(a)&&a.focus()}static renameComponent(e,t,n){var i=x.getStackForRoot(e,t,!1);if(!i){kt.error("Could not find stack for config",t);return}var o=x.getContentItemInStack(i,t);o&&o.setTitle(n)}static cloneComponent(e,t){var n=x.getStackForRoot(e,t,!1);if(!n)return kt.error("Could not find stack for config",t),null;var{props:i={}}=t,o=x.getPanelComponentState(t),a={type:"react-component",component:t.component,props:Tt(Tt({},i),{},{panelState:o}),title:"".concat(t.title," Copy"),id:zt()};return x.openComponentInStack(n,a),a}static getPanelComponentState(e){if(Il(e)){var t;return(t=e.componentState)===null||t===void 0?void 0:t.panelState}if(Cn(e)){var n;return(n=e.props)===null||n===void 0?void 0:n.panelState}return null}static makeDefaultLayout(){return{dimensions:{headerHeight:ha.tabHeight,borderWidth:ha.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=x.getComponentConfigFromContainer(e);return t?t.id:null}static getIdFromPanel(e){var{glContainer:t}=e.props;return x.getIdFromContainer(t)}static getComponentNameFromPanel(e){var{glContainer:t}=e.props,n=x.getComponentConfigFromContainer(t);if(n&&Cn(n)){var i;return(i=n.component)!==null&&i!==void 0?i:null}return null}static getComponentName(e){var t,n,i=(t=(n=e.WrappedComponent)===null||n===void 0?void 0:n.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]:x.DEFAULT_FOCUS_SELECTOR;if(e==null)return null;var n=e.querySelector(t);return n==null?null:(yr(n)&&n.focus(),n)}static onInitialized(e){return new Promise(t=>{if(e.isInitialised){t();return}var n=()=>{e.off("initialised",n),t()};e.on("initialised",n)})}}Ol(x,"DEFAULT_FOCUS_SELECTOR","input, select, textarea, button");var gp=H.forwardRef((r,e)=>{var t=x.getComponentNameFromPanel({props:r});return u.jsx("div",{ref:e,className:"panel-placeholder",children:u.jsxs("div",{children:['Component "',t,'" is not registered.']})})});gp.displayName="PanelPlaceholder";var te=Object.freeze({FOCUS:"PanelEvent.FOCUS",MOUNT:"PanelEvent.MOUNT",UNMOUNT:"PanelEvent.UNMOUNT",TITLE_CHANGED:"PanelEvent.TITLE_CHANGED",REOPEN:"PanelEvent.REOPEN",REOPEN_LAST:"PanelEvent.REOPEN_LAST",DELETE:"PanelEvent.DELETE",CLONED:"PanelEvent.CLONED",CLOSED:"PanelEvent.CLOSED",OPEN:"PanelEvent.OPEN",CLOSE:"PanelEvent.CLOSE",DRAGGING:"PanelEvent.DRAGGING",DROPPED:"PanelEvent.DROPPED"}),{listen:IC,emit:pp,useListener:DC}=yl(te.OPEN);function bp(r){return typeof r.id=="string"&&r.layout instanceof kg&&r.panelManager instanceof Wi&&typeof r.registerComponent=="function"}function yp(r){if(!bp(r))throw new Error("Expected dashboard plugin props, but instead received ".concat(r))}function fa(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,n)}return t}function va(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?fa(Object(t),!0).forEach(function(n){Ht(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):fa(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function Ht(r,e,t){return e=Cp(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Cp(r){var e=Sp(r,"string");return typeof e=="symbol"?e:String(e)}function Sp(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}var tt=V.module("PanelManager");class Wi{constructor(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:(s,l)=>l,n=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]:()=>{};Ht(this,"layout",void 0),Ht(this,"hydrateComponent",void 0),Ht(this,"dehydrateComponent",void 0),Ht(this,"onPanelsUpdated",void 0),Ht(this,"closed",void 0),Ht(this,"openedMap",void 0),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=n,this.onPanelsUpdated=a,this.openedMap=new Map(i),this.closed=[...o],this.startListening()}startListening(){var{eventHub:e}=this.layout;e.on(te.FOCUS,this.handleFocus),e.on(te.MOUNT,this.handleMount),e.on(te.UNMOUNT,this.handleUnmount),e.on(te.REOPEN,this.handleReopen),e.on(te.REOPEN_LAST,this.handleReopenLast),e.on(te.DELETE,this.handleDeleted),e.on(te.CLOSED,this.handleClosed),e.on(te.CLOSE,this.handleControlClose)}stopListening(){var{eventHub:e}=this.layout;e.off(te.FOCUS,this.handleFocus),e.off(te.MOUNT,this.handleMount),e.off(te.UNMOUNT,this.handleUnmount),e.off(te.REOPEN,this.handleReopen),e.off(te.REOPEN_LAST,this.handleReopenLast),e.off(te.DELETE,this.handleDeleted),e.off(te.CLOSED,this.handleClosed),e.off(te.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 x.getComponentConfigFromContainer(t)})}getOpenedPanelConfigsOfType(e){return this.getOpenedPanelConfigs().filter(t=>t!=null&&Cn(t)&&t.component===e)}getOpenedPanelById(e){return this.openedMap.get(e)}getContainerByPanelId(e){var t,n=x.getStackForConfig(this.layout.root,{id:e});return(t=n&&x.getContentItemInStack(n,{id:e}))!==null&&t!==void 0?t:null}getLastUsedPanel(e){for(var t=this.getOpenedPanels(),n=t.length-1;n>=0;n-=1){var i=t[n];if(e==null||e(i))return i}}getLastUsedPanelOfType(e){return this.getLastUsedPanelOfTypes([e])}getLastUsedPanelOfTypes(e){return this.getLastUsedPanel(t=>e.some(n=>Ir(n)&&t instanceof n.WrappedComponent||!Ir(n)&&t instanceof n))}updatePanel(e){var t=x.getIdFromPanel(e);if(t==null){tt.error("updatePanel Panel did not have an ID",e);return}tt.debug2("Updating panel ID ".concat(t," in open panels map")),this.openedMap.delete(t),this.openedMap.set(t,e)}removePanel(e){var t=x.getIdFromPanel(e);if(t==null){tt.error("removePanel Panel did not have an ID",e);return}if(!this.openedMap.has(t)){tt.error("Missing panel ID ".concat(t," in open panels map"));return}if(this.openedMap.get(t)!==e){tt.debug("Panel argument doesn't match the open panels map entry for ".concat(t,", removePanel ignored"));return}tt.debug2("Removing panel ID ".concat(t," from open panels map")),this.openedMap.delete(t)}removeClosedPanelConfig(e){var t=this.closed.findIndex(n=>n===e||n.id!=null&&e.id!=null&&n.id===e.id);t>=0&&this.closed.splice(t,1)}handleFocus(e){tt.debug2("Focus: ",e),this.updatePanel(e)}handleMount(e){tt.debug2("Mount: ",e),this.updatePanel(e),this.sendUpdate()}handleUnmount(e){tt.debug2("Unmount: ",e),this.removePanel(e),this.sendUpdate()}handleReopen(e,t){tt.debug2("Reopen:",e,t),this.removeClosedPanelConfig(e);var{component:n}=e,{props:i}=e;i=this.hydrateComponent(n,i);var o=va(va({},e),{},{props:i}),{root:a}=this.layout,s=e.parentStackId===void 0?void 0:x.getStackById(a,e.parentStackId);x.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 n=(t=x.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===n){this.handleReopen(o);return}}}}handleDeleted(e){tt.debug2("Deleted:",e),this.removeClosedPanelConfig(e),this.sendUpdate()}handleClosed(e,t){tt.debug2("Closed: ",e),this.addClosedPanel(t),this.sendUpdate()}handleControlClose(e){var t={id:e},{root:n}=this.layout;x.closeComponent(n,t)}addClosedPanel(e){var{root:t}=this.layout,n=x.getComponentConfigFromContainer(e);if(n&&Cn(n)){var i=this.dehydrateComponent(n.component,n);if(i!=null){var o;i.parentStackId=(o=x.getStackForConfig(t,n))===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)})}}Ht(Wi,"MAX_CLOSED_PANEL_COUNT",100);var wp=V.module("PanelErrorBoundary");class Ep 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,n=x.getIdFromContainer(e);wp.debug("componentWillUnmount",n),t.emit(te.CLOSED,n,e)}render(){var{children:e}=this.props,{error:t}=this.state;return t!=null?u.jsx("div",{className:"panel-error-boundary",children:u.jsx(dn,{errorMessage:"".concat(t),isLoading:!1,isLoaded:!1})}):e}}function ga(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,n)}return t}function kr(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?ga(Object(t),!0).forEach(function(n){_p(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):ga(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function _p(r,e,t){return e=Pp(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Pp(r){var e=Tp(r,"string");return typeof e=="symbol"?e:String(e)}function Tp(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}function Dl(r){var{props:e,componentState:t}=r,{metadata:n}=e,{panelState:i=null}=e;t&&({panelState:i}=t);var o={};return n!=null&&(o.metadata=n),i!=null&&(o.panelState=i),kr(kr({},r),{},{componentState:null,props:o,type:"react-component"})}function xl(r){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";return kr(kr({},r),{},{localDashboardId:e})}const Op={dehydrate:Dl,hydrate:xl};var Ip=H.createContext(void 0),Dp=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}),Ml=S.shape({on:S.func,off:S.func,emit:S.func}),xp=S.shape({registerComponent:S.func,root:S.shape({addChild:S.func}),on:S.func,off:S.func,eventHub:Ml}),Mp=Object.freeze({Container:Dp,EventHub:Ml,Layout:xp});function Fn(r,e,t,n){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.");H.useEffect(()=>{var a=r(o,e,t,n);return()=>{a()}},[e,n,t,o,r])}function Me(r,e,t){m.useEffect(function(){return r.on(e,t),()=>{r.off(e,t)}},[r,e,t])}var Nl="SET_DASHBOARD_DATA";const Np=yc(Nl,{},!1),Ap={dashboardData:Np};var Lp=new Map,Al=Object.freeze({}),Fp=Object.freeze([]),xC=Ti,MC=qa,NC=Jl,kp=r=>r.dashboardData,Ae=(r,e)=>{var t;return(t=kp(r)[e])!==null&&t!==void 0?t:Al},AC=(r,e)=>{var t;return(t=Ae(r,e).closed)!==null&&t!==void 0?t:Fp},LC=(r,e)=>{var t;return(t=Ae(r,e).openedMap)!==null&&t!==void 0?t:Lp},Ll=(r,e)=>{var t;return(t=Ae(r,e).pluginDataMap)!==null&&t!==void 0?t:Al},FC=(r,e,t)=>Ll(r,e)[t];function pa(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,n)}return t}function Sn(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?pa(Object(t),!0).forEach(function(n){Rp(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):pa(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function Rp(r,e,t){return e=jp(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function jp(r){var e=$p(r,"string");return typeof e=="symbol"?e:String(e)}function $p(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}var Fl=(r,e)=>({type:Nl,id:r,payload:e}),Xt=(r,e)=>(t,n)=>t(Fl(r,Sn(Sn({},Ae(n(),r)),e))),kC=(r,e,t)=>(n,i)=>n(Fl(r,Sn(Sn({},Ae(i(),r)),{},{pluginDataMap:Sn(Sn({},Ll(i(),r)),{},{[e]:t})})));Object.entries(Ap).map(r=>{var[e,t]=r;return Rd.register(e,t)});function Hp(r){var{children:e}=r;return u.jsx(u.Fragment,{children:e})}function ba(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,n)}return t}function kn(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?ba(Object(t),!0).forEach(function(n){Bp(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):ba(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function Bp(r,e,t){return e=Wp(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Wp(r){var e=Up(r,"string");return typeof e=="symbol"?e:String(e)}function Up(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}var Cr=V.module("DashboardLayout"),Vp=Object.freeze({}),Kp=[],ya=()=>{},zp=1e3,Ca=r=>r;function Gp(r){var e,t,{id:n,children:i,emptyDashboard:o=u.jsx("div",{children:"Dashboard is empty."}),layout:a,layoutConfig:s=Kp,onLayoutChange:l=ya,onLayoutInitialized:d=ya,hydrate:h=xl,dehydrate:c=Dl,panelWrapper:f=Hp}=r,v=Ti(),p=(e=qa(b=>Ae(b,n)))!==null&&e!==void 0?e:Vp,[g,y]=m.useState(!1),[P,O]=m.useState(!1),[_,k]=m.useState(),[W]=m.useState((t=p?.closed)!==null&&t!==void 0?t:[]),[Q,N]=m.useState(a.getReactChildren()),B=m.useMemo(()=>new Map,[]),j=m.useMemo(()=>new Map,[]),Y=m.useCallback(function(b,w){var T,G=arguments.length>2&&arguments[2]!==void 0?arguments[2]:h,J=arguments.length>3&&arguments[3]!==void 0?arguments[3]:c;Cr.debug2("registerComponent",b,w,G,J);function Qe(Z,re){var he=w,_e=f,Xr=dh(he),{glContainer:cr,glEventHub:Yr}=Z;return u.jsx(Ep,{glContainer:cr,glEventHub:Yr,children:u.jsx(_e,kn(kn({},Z),{},{children:Xr?u.jsx(he,kn(kn({},Z),{},{ref:re})):u.jsx(he,kn({},Z))}))})}Qe.displayName="DashboardWrapper(".concat((T=w.displayName)!==null&&T!==void 0?T:b,")");var I=a.registerComponent(b,H.forwardRef(Qe));return B.set(b,G),j.set(b,J),I},[h,c,B,j,a,f]),ne=m.useCallback((b,w)=>{var T;return((T=B.get(b))!==null&&T!==void 0?T:Ca)(w,n)},[B,n]),F=m.useCallback((b,w)=>{var T;return((T=j.get(b))!==null&&T!==void 0?T:Ca)(w,n)},[j,n]),q=m.useMemo(()=>new Wi(a,ne,F,new Map,W,b=>{var{closed:w,openedMap:T}=b;v(Xt(n,{closed:w,openedMap:T}))}),[F,v,ne,n,W,a]),K=Iu(b=>{var w=_==null||!x.isEqual(_,b);Cr.debug("handleLayoutStateChanged",w,b),w&&(y(a.root.contentItems.length===0),k(b),l(b),N(a.getReactChildren()))},zp,{flushOnUnmount:!0});m.useEffect(()=>()=>K.flush(),[K]);var A=m.useCallback(()=>{if(!P){var b=a.toConfig(),w=b.content,T=x.dehydrateLayoutConfig(w,F);K(T)}},[F,P,a,K]),U=m.useCallback(b=>{var w=x.getIdFromContainer(b);a.eventHub.emit(te.DRAGGING,w),O(!0)},[a.eventHub]),z=m.useCallback(b=>{var w=x.getIdFromContainer(b);a.eventHub.emit(te.DROPPED,w),O(!1)},[a.eventHub]),me=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(),T="".concat(w,"-component");b.element.addClass(T)}},[]),je=m.useCallback(()=>{N(a.getReactChildren())},[a]);Me(a,"stateChanged",A),Me(a,"itemPickedUp",U),Me(a,"itemDropped",z),Me(a,"componentCreated",me),Me(a.eventHub,te.TITLE_CHANGED,A),Me(a,"reactChildrenChanged",je);var De=Du(s);return m.useEffect(function(){if(De!==s&&s!==_){Cr.debug("Setting new layout content...");for(var w=x.hydrateLayoutConfig(s,ne);a.root.contentItems.length>0;)a.root.contentItems[0].remove();for(var T=0;T<w.length;T+=1)a.root.addChild(w[T]);y(a.root.contentItems.length===0)}},[ne,a,s,_,q,De]),m.useEffect(()=>d(),[]),u.jsxs(u.Fragment,{children:[g&&o,Q,H.Children.map(i,b=>b!=null?u.jsx(kh,{fallback:[],children:H.cloneElement(b,{id:n,layout:a,panelManager:q,registerComponent:Y})}):null)]})}Gp.propTypes={id:S.string.isRequired,children:S.node,data:S.shape({}),emptyDashboard:S.node,layout:Mp.Layout.isRequired,layoutConfig:S.arrayOf(S.shape({})),onLayoutChange:S.func,onLayoutInitialized:S.func};var RC="default";function ar(r,e,t){return e=qp(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function qp(r){var e=Zp(r,"string");return typeof e=="symbol"?e:String(e)}function Zp(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class Mn{}ar(Mn,"SESSION_OPENED","ConsoleEvent.SESSION_OPENED");ar(Mn,"SESSION_CLOSED","ConsoleEvent.SESSION_CLOSED");ar(Mn,"FOCUS_HISTORY","ConsoleEvent.FOCUS_HISTORY");ar(Mn,"SEND_COMMAND","ConsoleEvent.SEND_COMMAND");ar(Mn,"SETTINGS_CHANGED","ConsoleEvent.SETTINGS_CHANGED");const it=Mn;function Yt(r,e,t){return e=Xp(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Xp(r){var e=Yp(r,"string");return typeof e=="symbol"?e:String(e)}function Yp(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class Nt{}Yt(Nt,"TABLE_CHANGED","InputFilterEvent.TABLE_CHANGED");Yt(Nt,"COLUMNS_CHANGED","InputFilterEvent.COLUMNS_CHANGED");Yt(Nt,"FILTERS_CHANGED","InputFilterEvent.FILTERS_CHANGED");Yt(Nt,"CLEAR_ALL_FILTERS","InputFilterEvent.CLEAR_ALL_FILTERS");Yt(Nt,"COLUMN_SELECTED","InputFilterEvent.COLUMN_SELECTED");Yt(Nt,"OPEN_DROPDOWN","InputFilterEvent.OPEN_DROPDOWN");Yt(Nt,"OPEN_INPUT","InputFilterEvent.OPEN_INPUT");Yt(Nt,"OPEN_FILTER_SET_MANAGER","InputFilterEvent.OPEN_FILTER_SET_MANAGER");const Sa=Nt,jC=Object.freeze({OPEN:"MarkdownEvent.OPEN"});function At(r,e,t){return e=Qp(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Qp(r){var e=Jp(r,"string");return typeof e=="symbol"?e:String(e)}function Jp(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class wt{}At(wt,"CREATE_NOTEBOOK","NotebookEvent.createNotebook");At(wt,"SELECT_NOTEBOOK","NotebookEvent.selectNotebook");At(wt,"CLOSE_FILE","NotebookEvent.closeFile");At(wt,"RENAME","NotebookEvent.rename");At(wt,"RENAME_FILE","NotebookEvent.renameFile");At(wt,"REGISTER_FILE","NotebookEvent.registerFile");At(wt,"SEND_TO_NOTEBOOK","NotebookEvent.sendToNotebook");At(wt,"UNREGISTER_FILE","NotebookEvent.unregisterFile");At(wt,"PROMOTE_FROM_PREVIEW","NotebookEvent.promoteFromPreview");const de=wt;function Nn(r,e,t){return e=eb(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function eb(r){var e=tb(r,"string");return typeof e=="symbol"?e:String(e)}function tb(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class mn{}Nn(mn,"focus","TabEvent.focus");Nn(mn,"blur","TabEvent.blur");Nn(mn,"openPQObject","TabEvent.openPQObject");Nn(mn,"openControl","TabEvent.openControl");Nn(mn,"reload","TabEvent.reload");Nn(mn,"clearAllFilters","TabEvent.clearAllFilters");const Sr=mn;function nb(r,e,t){return e=rb(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function rb(r){var e=ib(r,"string");return typeof e=="symbol"?e:String(e)}function ib(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class kl 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,n,{glContainer:i}=this.props;return[...(e=i==null||(t=i.tab)===null||t===void 0||(n=t.header)===null||n===void 0?void 0:n.tabs)!==null&&e!==void 0?e:[]]}handleCloseTab(){var{glContainer:e}=this.props;e.close()}handleCloseTabsAll(){var e=this.getAllTabs();e.forEach(t=>{var n;return(n=(t?.contentItem).container)===null||n===void 0?void 0:n.close()})}handleCloseTabsRight(){for(var{glContainer:e}=this.props,t=this.getAllTabs(),n=t.length-1;n>0;n-=1){var i,o,a,s,l,d,h;if(((i=t[n].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[n])===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(te.REOPEN_LAST,e)}canCloseTabsRight(){for(var{glContainer:e}=this.props,t=this.getAllTabs(),n=!0,i=t.length-1;i>0;i-=1){var o,a,s,l,d,h,c,f;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 v=!!(!((h=t[i])===null||h===void 0||(c=h.contentItem)===null||c===void 0||(f=c.config)===null||f===void 0)&&f.isClosable);if(v){n=!1;break}}return n}canCloseAny(){for(var e=this.getAllTabs(),t=!0,n=e.length-1;n>0;n-=1){var i,o,a,s=!!(!((i=e[n])===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:n,glContainer:i}=this.props,o=(e=x.getStackForConfig(i.layoutManager.root,i.getConfig()))===null||e===void 0?void 0:e.config.id;return!((t=n.data.closed)!==null&&t!==void 0&&t.some(a=>a.parentStackId===o))}render(){var e,t,n,{additionalActions:i,glContainer:o}=this.props,a=[...i];a.push(()=>({title:"Re-open closed panel",group:ee.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||(n=t.config)===null||n===void 0?void 0:n.isClosable;return a.push({title:"Close",order:10,group:ee.groups.low,action:this.handleCloseTab,disabled:s===void 0||!s}),a.push(()=>({title:"Close Tabs to Right",order:20,group:ee.groups.low,action:this.handleCloseTabsRight,disabled:this.canCloseTabsRight()})),a.push(()=>({title:"Close All",order:30,group:ee.groups.low,action:this.handleCloseTabsAll,disabled:this.canCloseAny()})),u.jsx(ee,{actions:a})}}nb(kl,"defaultProps",{additionalActions:[]});var ob=r=>({workspace:Bs(r)}),ab=In(ob,{setWorkspace:Ws})(kl);const sb=ab;function Rl(r,e,t){return e=lb(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function lb(r){var e=db(r,"string");return typeof e=="symbol"?e:String(e)}function db(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class jl extends m.PureComponent{constructor(e){super(e),Rl(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=H.createRef();var{value:t}=e;this.state={value:t,valueWasValidated:!1}}componentDidUpdate(e){var{isShown:t}=e,{isShown:n}=this.props;n&&!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,n=t?.trim();if(n!==void 0&&n!==""){var{onSubmit:i}=this.props;i(n)}else this.setState({value:n,valueWasValidated:!0})}renderRenameDialog(){var{isShared:e,isOwner:t,itemType:n}=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(n,"-input"),children:["Rename ",n]}),u.jsx("input",{type:"text",className:"form-control",id:"rename-dialog-".concat(n,"-input"),value:i??void 0,ref:this.renameInputRef,onChange:this.handleRenameInputChange,required:!0}),u.jsxs("div",{className:"invalid-feedback",children:[n," name cannot be empty"]}),(e||!t)&&u.jsxs("div",{className:"pt-2",children:["Renaming this ",n," will rename for all users."]})]}),u.jsxs("div",{className:"text-right",children:[u.jsx(se,{kind:"secondary",className:"mr-2",onClick:this.handleRenameCancel,children:"Cancel"}),u.jsx(se,{kind:"primary",type:"submit",children:"Rename"})]})]})}render(){var{isShown:e,onCancel:t}=this.props;return u.jsx(Di,{isShown:e,onEntered:this.handleRenameDialogOpened,onExited:t,options:{placement:"bottom"},interactive:!0,closeOnBlur:!0,children:this.renderRenameDialog()})}}Rl(jl,"defaultProps",{isShared:!1,isOwner:!0,itemType:"Item",value:""});function wa(r,e,t){return e=ub(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function ub(r){var e=hb(r,"string");return typeof e=="symbol"?e:String(e)}function hb(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}var cb=V.module("Panel");class mb extends m.PureComponent{constructor(e){super(e),wa(this,"ref",void 0),wa(this,"getAdditionalActions",yt((n,i,o)=>{var a=[];return i&&a.push(this.getCloneAction()),o&&a.push(this.getRenameAction()),[...a,...n]})),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=H.createRef();var{glContainer:t}=this.props;this.state={title:x.getTitleFromContainer(t),showRenameDialog:!1,isWithinPanel:!0}}componentDidMount(){var e,t,{componentPanel:n,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(it.SESSION_CLOSED,this.handleSessionClosed),o.on(it.SESSION_OPENED,this.handleSessionOpened),o.on(Sr.focus,this.handleTabFocus),o.on(Sr.blur,this.handleTabBlur),o.on(Sa.CLEAR_ALL_FILTERS,this.handleClearAllFilters),o.emit(te.MOUNT,n??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:n}=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),n.off(it.SESSION_CLOSED,this.handleSessionClosed),n.off(it.SESSION_OPENED,this.handleSessionOpened),n.off(Sr.focus,this.handleTabFocus),n.off(Sr.blur,this.handleTabBlur),n.off(Sa.CLEAR_ALL_FILTERS,this.handleClearAllFilters),n.emit(te.UNMOUNT,e??this)}handleTab(e){e!=null&&this.setState({title:x.getTitleFromTab(e)}),this.forceUpdate();var{onTab:t}=this.props;t?.(e)}handleTabClicked(e){var{onTabClicked:t}=this.props;t?.(e)}handleClearAllFilters(){for(var{onClearAllFilters:e}=this.props,t=arguments.length,n=new Array(t),i=0;i<t;i++)n[i]=arguments[i];e?.(...n)}handleFocus(e){var{componentPanel:t,glEventHub:n}=this.props;n.emit(te.FOCUS,t??this);var{onFocus:i}=this.props;i?.(e)}handleBlur(e){var{onBlur:t}=this.props;t?.(e)}handleHide(){for(var{onHide:e}=this.props,t=arguments.length,n=new Array(t),i=0;i<t;i++)n[i]=arguments[i];e?.(...n)}handleResize(){for(var{onResize:e}=this.props,t=arguments.length,n=new Array(t),i=0;i<t;i++)n[i]=arguments[i];e?.(...n)}handleSessionClosed(e){var{onSessionClose:t}=this.props;t?.(e)}handleSessionOpened(e,t){var{onSessionOpen:n}=this.props;n?.(e,t)}handleBeforeShow(){for(var{onBeforeShow:e}=this.props,t=arguments.length,n=new Array(t),i=0;i<t;i++)n[i]=arguments[i];e?.(...n)}handleShow(){for(var{onShow:e}=this.props,t=arguments.length,n=new Array(t),i=0;i<t;i++)n[i]=arguments[i];e?.(...n)}handleTabBlur(){for(var{onTabBlur:e}=this.props,t=arguments.length,n=new Array(t),i=0;i<t;i++)n[i]=arguments[i];e?.(...n)}handleTabFocus(){for(var{onTabFocus:e}=this.props,t=arguments.length,n=new Array(t),i=0;i<t;i++)n[i]=arguments[i];e?.(...n)}handleRenameCancel(){this.setState({showRenameDialog:!1})}handleShowRenameDialog(){this.setState({showRenameDialog:!0})}handleRenameSubmit(e){var{glContainer:t}=this.props;this.setState({showRenameDialog:!1,title:e});var n=x.getRootFromContainer(t),i=x.getComponentConfigFromContainer(t);R(i),x.renameComponent(n,i,e)}handleCopyPanel(){var{glContainer:e,glEventHub:t}=this.props,n=x.getRootFromContainer(e),i=x.getComponentConfigFromContainer(e);if(i==null){cb.error("Could not get component config from container",e);return}var o=x.cloneComponent(n,i);o!==null&&t.emit(te.CLONED,this,o)}getCloneAction(){return{title:"Copy Panel",order:10,group:ee.groups.high,action:this.handleCopyPanel}}getRenameAction(){return{title:"Rename",order:10,group:ee.groups.medium,action:this.handleShowRenameDialog}}render(){var{children:e,className:t,renderTabTooltip:n,glContainer:i,glEventHub:o,additionalActions:a=Xd,errorMessage:s,isLoaded:l=!0,isLoading:d=!1,isClonable:h=!1,isRenamable:c=!1}=this.props,{tab:f}=i,{showRenameDialog:v,title:p,isWithinPanel:g}=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(dn,{errorMessage:s,isLoaded:l,isLoading:d}),!g&&f!=null&&jr.createPortal(u.jsxs(u.Fragment,{children:[u.jsx(sb,{glContainer:i,glEventHub:o,additionalActions:this.getAdditionalActions(a,h,c)}),c&&u.jsx(jl,{isShown:v,value:p,itemType:"Panel",onCancel:this.handleRenameCancel,onSubmit:this.handleRenameSubmit}),n!=null&&u.jsx(qt,{interactive:!0,options:{placement:"bottom"},popperClassName:"panel-tab-popper",children:n()})]}),f.element[0])]})}}const sr=mb,$C=Object.freeze({DEFAULT:"DEFAULT",LINKER:"LINKER"});var fb=Object.freeze({}),vb=new Map,zr=Object.freeze([]),HC=(r,e)=>{var t;return(t=Ae(r,e).columns)!==null&&t!==void 0?t:zr},BC=(r,e)=>{var t;return(t=Ae(r,e).filterSets)!==null&&t!==void 0?t:zr},WC=(r,e)=>{var t;return(t=Ae(r,e).filters)!==null&&t!==void 0?t:zr},UC=(r,e)=>{var t;return(t=Ae(r,e).tableMap)!==null&&t!==void 0?t:vb},VC=(r,e)=>Ae(r,e).isolatedLinkerPanelId,$l=(r,e)=>{var t;return(t=Ae(r,e).links)!==null&&t!==void 0?t:zr},KC=(r,e)=>Ae(r,e).columnSelectionValidator,zC=(r,e)=>{var t;return(t=Ae(r,e).consoleSettings)!==null&&t!==void 0?t:fb},GC=(r,e)=>Ae(r,e).connection,lr=(r,e)=>Ae(r,e).sessionWrapper,qC=(r,e)=>t=>t(Xt(r,{connection:e})),ZC=(r,e)=>t=>t(Xt(r,{sessionWrapper:e})),Hl=(r,e)=>t=>t(Xt(r,{links:e})),XC=(r,e)=>(t,n)=>{var i=$l(n(),r),o=e.filter(a=>i.findIndex(s=>qn(s.start,a.start)&&qn(s.end,a.end))<0);return t(Hl(r,i.concat(o)))},YC=(r,e)=>(t,n)=>{var i=$l(n(),r),o=i.filter(a=>!e.includes(a.id));return t(Hl(r,o))},QC=(r,e)=>t=>t(Xt(r,{isolatedLinkerPanelId:e})),JC=(r,e)=>t=>t(Xt(r,{columnSelectionValidator:e})),gb=(r,e)=>t=>t(Xt(r,{consoleSettings:e})),eS=(r,e)=>t=>t(Xt(r,{filterSets:e}));function Rr(r,e,t){return e=pb(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function pb(r){var e=bb(r,"string");return typeof e=="symbol"?e:String(e)}function bb(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}var wr=V.module("CommandHistoryPanel");class dr extends m.Component{static handleError(e){wr.error(e)}constructor(e){super(e),Rr(this,"container",void 0),Rr(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=H.createRef(),this.pending=new xn;var{session:t,sessionId:n,language:i}=e;this.state={panelState:{},session:t,sessionId:n,language:i,contextActions:[{action:this.handleFocusHistory,shortcut:Re.COMMAND_HISTORY.FOCUS_HISTORY}]}}componentDidMount(){var{glEventHub:e,session:t}=this.props;e.on(it.FOCUS_HISTORY,this.handleFocusHistory),t!=null&&this.loadTable()}componentWillUnmount(){var{glEventHub:e}=this.props;e.off(it.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:n,sessionId:i}=t;this.setState({session:e,sessionId:i,language:n},()=>{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:n,language:i}=this.state;if(wr.debug("handleSendToNotebook",n,e),!n){wr.error("Session is not connected.");return}var{glEventHub:o}=this.props;o.emit(t?de.CREATE_NOTEBOOK:de.SEND_TO_NOTEBOOK,n,i,e)}handleSendToConsole(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;wr.debug("handleSendToConsole",e);var{glEventHub:i}=this.props;i.emit(it.SEND_COMMAND,e,t,n)}loadTable(){var{commandHistoryStorage:e}=this.props,{language:t,sessionId:n}=this.state;R(t),R(n),this.pending.add(e.getTable(t,n,Date.now()),i=>i.close()).then(i=>{this.setState({table:i})}).catch(dr.handleError)}render(){var{glContainer:e,glEventHub:t,commandHistoryStorage:n}=this.props,{language:i,contextActions:o,table:a}=this.state;return u.jsxs(sr,{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(If,{ref:this.container,language:i,sendToNotebook:this.handleSendToNotebook,sendToConsole:this.handleSendToConsole,table:a,commandHistoryStorage:n}),u.jsx(ee,{actions:o})]})]})}}Rr(dr,"COMPONENT","CommandHistoryPanel");Rr(dr,"TITLE","Command History");var yb=(r,e)=>{var t=$s(r),n=lr(r,e.localDashboardId),{session:i,config:o}=n??{},{type:a,id:s}=o??{};return{commandHistoryStorage:t,language:a,session:i,sessionId:s}},Cb=In(yb,null,null,{forwardRef:!0})(dr);const Sb=Cb;var wb=m.createContext(null),ur=Object.freeze({AUTH_PLUGIN:"AuthPlugin",DASHBOARD_PLUGIN:"DashboardPlugin",WIDGET_PLUGIN:"WidgetPlugin",TABLE_PLUGIN:"TablePlugin",THEME_PLUGIN:"ThemePlugin"});function Eb(r){return"DashboardPlugin"in r}function _b(r){return"AuthPlugin"in r}function Pb(r){return"TablePlugin"in r}function tS(r){return Eb(r)||_b(r)||Pb(r)}function Tb(r){return"type"in r&&r.type===ur.DASHBOARD_PLUGIN}function Ui(r){return"type"in r&&r.type===ur.WIDGET_PLUGIN}function Ob(r){return"type"in r&&r.type===ur.TABLE_PLUGIN}function Ib(r){return"type"in r&&r.type===ur.AUTH_PLUGIN}function Bl(r){return"type"in r&&r.type===ur.THEME_PLUGIN}function nS(r){return Tb(r)||Ib(r)||Ob(r)||Bl(r)||Ui(r)}var Db=V.module("@deephaven/plugin.PluginUtils");function Ea(r,e){return r==null||!Ui(r)?!1:[r.supportedTypes].flat().some(t=>t===e)}function xb(r){var e=u.jsx(ue,{icon:ns});if(!Ui(r))return e;var{icon:t}=r;return t==null?e:m.isValidElement(t)?t:u.jsx(ue,{icon:t})}function rS(r){var e=[...r.entries()].filter(t=>Bl(t[1]));return Db.debug("Getting theme data from plugins",e),e.map(t=>{var[n,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:jd(n,s),name:s,styleContent:d}})}).flat()}function iS(){return tr(wb,"No Plugins available in usePlugins. This can happen when plugins have not finished loading or if code is not wrapped in PluginsContext.Provider.")}function _a(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,n)}return t}function Er(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?_a(Object(t),!0).forEach(function(n){an(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):_a(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function an(r,e,t){return e=Mb(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Mb(r){var e=Nb(r,"string");return typeof e=="symbol"?e:String(e)}function Nb(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}var _r=V.module("ConsolePanel"),Ab=500,Lb=Object.freeze({consoleSettings:{},itemIds:[]});class Gr extends m.PureComponent{constructor(e){super(e),an(this,"consoleRef",void 0),an(this,"objectSubscriptionCleanup",void 0),an(this,"savePanelState",_n(()=>{var{consoleSettings:a,itemIds:s}=this.state,l={consoleSettings:a,itemIds:[...s]};_r.debug("Saving panel state",l),this.setState({panelState:l})},Ab)),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=H.createRef();var{panelState:t}=e,n=Er(Er({},Lb),t||{}),{consoleSettings:i,itemIds:o}=n;this.state={consoleSettings:i,itemIds:new Map(o),objectMap:new Map,error:void 0,panelState:n}}componentDidMount(){var{glEventHub:e}=this.props;this.closeDisconnectedPanels(),e.on(te.MOUNT,this.handlePanelMount),this.subscribeToFieldUpdates()}componentDidUpdate(e,t){var{consoleSettings:n,itemIds:i}=this.state;(t.consoleSettings!==n||t.itemIds!==i)&&this.savePanelState()}componentWillUnmount(){var e,{glEventHub:t}=this.props;this.savePanelState.flush(),t.off(te.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(n=>{_r.debug("Got updates",n),this.setState(i=>{var{objectMap:o}=i,{updated:a,created:s,removed:l}=n,d=[...a,...l],h=new Map(o);d.forEach(f=>{var{title:v}=f;v!==void 0&&h.delete(v)});var c=[...a,...s];return c.forEach(f=>{f.title!==void 0&&h.set(f.title,f)}),{objectMap:h}})})}}setItemId(e,t){this.setState(n=>{var{itemIds:i}=n,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:n}=this.state,i=n.get(e);return i==null&&t&&(i=zt(),this.setItemId(e,i)),i}handleTabFocus(){var e;(e=this.consoleRef.current)===null||e===void 0||e.focus()}handlePanelMount(e){var t,n,i,{itemIds:o}=this.state,a=e==null||(t=e.props)===null||t===void 0?void 0:t.id,s=e==null||(n=e.props)===null||n===void 0||(i=n.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(it.FOCUS_HISTORY)}handleResize(){this.updateDimensions()}handleShow(){this.updateDimensions()}handleOpenObject(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,{root:n}=this.context,i=e.title!=null?this.getItemId(e.title,!1):null;(t||i!=null&&x.getStackForRoot(n,{id:i},!1,!1,!1)!=null)&&this.openWidget(e)}handleCloseObject(e){var{title:t}=e;if(t!==void 0){var n=this.getItemId(t,!1);if(n!=null){var{glEventHub:i}=this.props;i.emit(te.CLOSE,n)}}}handleSettingsChange(e){var{glEventHub:t}=this.props;_r.debug("handleSettingsChange",e),this.setState({consoleSettings:e}),t.emit(it.SETTINGS_CHANGED,e)}openWidget(e){var{glEventHub:t,sessionWrapper:n}=this.props;R(n);var{config:i,session:o}=n,{title:a=e.name}=e;R(a);var s=this.getItemId(a),l={fetch:()=>o.getObject(e),panelId:s,widget:Er(Er({},ec(e)),{},{sessionId:i.id})};_r.debug("openWidget",l),pp(t,l)}addCommand(e){var t,n=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,n,i)}closeDisconnectedPanels(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,{consoleSettings:t,itemIds:n}=this.state,{isClosePanelsOnDisconnectEnabled:i=!0}=t;if(!(!i&&!e)){var o=[...n.values()],{glEventHub:a}=this.props;o.forEach(s=>{a.emit(te.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(n=>Ea(n,e))}iconForType(e){var{plugins:t}=this.props,n=[...t.values()].find(i=>Ea(i,e));return n!=null?xb(n):u.jsx(Cc,{type:e})}render(){var{commandHistoryStorage:e,glContainer:t,glEventHub:n,sessionWrapper:i,timeZone:o,unzip:a}=this.props;if(i==null)return u.jsx(dn,{isLoading:!1,errorMessage:"Console is disabled."});var{consoleSettings:s,error:l,objectMap:d}=this.state,{config:h,session:c,connection:f,details:v={},dh:p}=i,{workerName:g,processInfoId:y}=v,{id:P,type:O}=h;return u.jsx(sr,{className:"iris-panel-console",componentPanel:this,glContainer:t,glEventHub:n,onResize:this.handleResize,onShow:this.handleShow,onTabFocus:this.handleTabFocus,errorMessage:l!=null?"".concat(l):void 0,children:c!=null&&u.jsx(sf,{dh:p,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:Vs.LANGUAGE_MAP.get(O)}),g!=null&&u.jsxs(u.Fragment,{children:[u.jsx("div",{children:"•"}),g]}),y!=null&&u.jsxs(u.Fragment,{children:[u.jsx("div",{children:"•"}),y,u.jsx("div",{children:"•"})]}),u.jsx(Ov,{connection:f,defaultUpdateInterval:10*1e3,hoverUpdateInterval:3*1e3,monitorDuration:10*60*1e3})]}),scope:P,timeZone:o,objectMap:d,unzip:a,supportsType:this.supportsType,iconForType:this.iconForType})})}}an(Gr,"COMPONENT","ConsolePanel");an(Gr,"TITLE","Console");an(Gr,"contextType",Ip);var Fb=(r,e)=>({commandHistoryStorage:$s(r),sessionWrapper:lr(r,e.localDashboardId),timeZone:sc(r),plugins:dc(r)}),kb=In(Fb,null,null,{forwardRef:!0})(Gr);const li=kb;function oS(r){return r==="file"||r==="directory"}function ht(r){return r.type==="directory"}function Rb(r,e,t){return e=jb(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function jb(r){var e=$b(r,"string");return typeof e=="symbol"?e:String(e)}function $b(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class Hb extends Error{constructor(){super("No file exists at the path specified"),Rb(this,"isFileNotFound",!0)}}const Vi=Hb;function Pa(r,e,t,n,i,o,a){try{var s=r[o](a),l=s.value}catch(d){t(d);return}s.done?e(l):Promise.resolve(l).then(n,i)}function Ta(r){return function(){var e=this,t=arguments;return new Promise(function(n,i){var o=r.apply(e,t);function a(l){Pa(o,n,i,a,s,"next",l)}function s(l){Pa(o,n,i,a,s,"throw",l)}a(void 0)})}}var xt;(function(r){r.GROOVY="text/x-groovy",r.PLAIN_TEXT="text/plain",r.PYTHON="text/x-python",r.PYTHON_COMPILED="application/x-python-code",r.SCALA="text/x-scala",r.UNKNOWN=""})(xt||(xt={}));class vt{static fileExists(e,t){return Ta(function*(){try{return yield e.info(t),!0}catch(n){if(!(n instanceof Vi))throw n;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(!vt.hasPath(e))throw new Error("Invalid path provided: ".concat(e));var n=(t=e.match(/\//g))!==null&&t!==void 0?t:[];return n.length-1}static getExtension(e){var t=this.getBaseName(e).split(".");if(t.length>1){var n;return(n=t.pop())!==null&&n!==void 0?n:""}return""}static getBaseName(e){var t;return(t=e.split("/").pop())!==null&&t!==void 0?t:""}static getCopyFileName(e){var t=e.lastIndexOf("."),n=null,i=null;t<0?i=e:(i=e.substring(0,t),n=e.substring(t+1));var o=i?"".concat(i,"-copy"):"Copy";return n!==null?"".concat(o,".").concat(n):o}static getUniqueCopyFileName(e,t){return Ta(function*(){for(var n=vt.getCopyFileName(t);yield vt.fileExists(e,n);)n=vt.getCopyFileName(n);return n})()}static getMimeType(e){var t=this.getExtension(e).toLowerCase();switch(t){case"groovy":return xt.GROOVY;case"py":return xt.PYTHON;case"pyc":return xt.PYTHON_COMPILED;case"scala":return xt.SCALA;case"txt":return xt.PLAIN_TEXT;default:return xt.UNKNOWN}}static getParent(e){if(!vt.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(!vt.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]:"",n=e.lastIndexOf("."),i=n>-1?e.substring(0,n):e,o=vt.fileExtensionToString(t);return"".concat(i).concat(o)}static validateName(e){var t=[".",".."],n=/[\\/\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(n.test(e)){var o,a;throw new Vn('Invalid characters in name: "'.concat((o=(a=e.match(n))===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(n=>vt.isPath(n));return e.filter(n=>!t.some(i=>n!==i&&n.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)}}const $=vt;var Ki=26;function Ei(r){return ht(r)?$.makePath(r.filename):$.getPath(r.filename)}function Oa(r,e){if(r.length===0||e==null)throw new Error("No items to move");var t=Ei(e);if(r.some(n=>{var{filename:i}=n;return $.getPath(i)===t}))throw new Error("File already in the destination folder");if(r.some(n=>ht(n)&&t.startsWith($.makePath(n.filename))))throw new Error("Destination folder cannot be a child of a dragged folder");return{files:r,targetPath:t}}function Bb(r){if(ht(r))return r.isExpanded?$d:Hd;var e=$.getMimeType(r.basename);switch(e){case xt.PYTHON:return Wd;default:return Bd}}function _i(r){var e,{children:t,draggedItems:n,isDragInProgress:i,isDropTargetValid:o,isSelected:a,item:s,itemIndex:l,dropTargetItem:d,onDragStart:h,onDragOver:c,onDragEnd:f,onDrop:v}=r,p=(e=n?.some(N=>N.id===s.id))!==null&&e!==void 0?e:!1,g=Ei(s),y=i&&d?Ei(d):null,P=i&&o&&ht(s)&&y===g,O=i&&o&&y===g,_=i&&!o&&y===g,k=Bb(s),W=$.getDepth(s.filename),Q=Array(W).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":p,"is-exact-drop-target":P,"is-in-drop-target":O,"is-invalid-drop-target":_,"is-selected":a}),onDragStart:N=>h(l,N),onDragOver:N=>c(l,N),onDragEnd:N=>f(l,N),onDrop:N=>v(l,N),draggable:!0,role:"presentation","aria-label":s.basename,children:[Q," ",u.jsx(ue,{icon:k,className:"item-icon",fixedWidth:!0})," ",u.jsx("span",{className:"truncation-wrapper",children:t??u.jsxs(u.Fragment,{children:[s.basename,u.jsx(qt,{children:s.basename})]})})]})}function Ia(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,n)}return t}function Pr(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Ia(Object(t),!0).forEach(function(n){Wb(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):Ia(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function Wb(r,e,t){return e=Ub(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Ub(r){var e=Vb(r,"string");return typeof e=="symbol"?e:String(e)}function Vb(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}var Le=V.module("FileList"),Kb=500,Da="item-list-scroll-pane";function zb(r){var{isMultiSelect:e=!1,table:t,onFocusChange:n=()=>{},onMove:i,onSelect:o,onSelectionChange:a=()=>{},renderItem:s=_i,rowHeight:l=Ki,overscanCount:d=Ye.DEFAULT_OVERSCAN}=r,[h,c]=m.useState(()=>({items:[],offset:0,itemCount:0})),[f,v]=m.useState({top:0,bottom:0}),[p,g]=m.useState(),[y,P]=m.useState(),[O,_]=m.useState(),[k,W]=m.useState([]),Q=m.useRef(),N=m.useRef(null),B=m.useRef(null),j=m.useCallback(I=>{if(I.length===0||h==null)return[];for(var Z=[],re=0;re<I.length;re+=1)for(var he=I[re],_e=he[0];_e<=he[1];_e+=1)_e>=h.offset&&_e<h.offset+h.items.length&&Z.push(h.items[_e-h.offset]);return Z},[h]),Y=m.useCallback(I=>{var Z=j([[I,I]]);if(Z.length>0)return Z[0]},[j]),ne=m.useCallback(()=>{var I=It.count(k);if(I===0)return null;if(I===1){var Z=k[0][0],re=Y(Z);if(re!=null)return re.filename}return"".concat(I," items")},[Y,k]),F=m.useCallback(I=>{if(!(!y||!p)){Le.debug("dropItems",y,"to",I);try{var{files:Z,targetPath:re}=Oa(y,p);if(i?.(Z,re),I!=null){var he;W([[I,I]]),(he=N.current)===null||he===void 0||he.focusItem(I)}}catch(_e){Le.error("Unable to complete move",_e)}}},[y,p,i]),q=m.useCallback((I,Z)=>{var re=h.items[I-h.offset];re!==void 0&&(Le.debug("handleItemClick",re),o(re,Z),ht(re)&&t?.setExpanded(re.filename,!re.isExpanded))},[h,o,t]),K=m.useCallback((I,Z)=>{var re;Le.debug2("handleItemDragStart",I,k);var he=k;It.isSelected(k,I)||(he=[[I,I]],W(he)),P(j(he)),(re=N.current)===null||re===void 0||re.resetMouseState();var _e=document.createElement("div");_e.innerHTML='<div class="dnd-placeholder-content">'.concat(ne(),"</div>"),_e.className="file-list-dnd-placeholder",document.body.appendChild(_e),Z.dataTransfer.setDragImage(_e,0,0),Z.dataTransfer.effectAllowed="move",_(_e)},[ne,j,k]),A=m.useCallback((I,Z)=>{Z.preventDefault(),Le.debug2("handleItemDragOver",Z),g(Y(I))},[Y]),U=m.useCallback((I,Z)=>{Le.debug("handleItemDragEnd",I),O?.remove(),P(void 0),g(void 0),_(void 0)},[O]),z=m.useCallback((I,Z)=>{F(I)},[F]),me=m.useCallback(()=>{Le.debug2("handleItemDragExit"),g(void 0)},[]),je=m.useCallback(I=>{I.target instanceof Element&&I.target.classList.contains(Da)&&(I.preventDefault(),Le.debug2("handleListDragOver",I),g({type:"directory",filename:"/",basename:"/",id:"/"}))},[]),De=m.useCallback(I=>{I.target instanceof Element&&I.target.classList.contains(Da)&&(Le.debug("handleListDrop"),F())},[F]),b=m.useCallback(function(I){var Z=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(Le.debug2("handleSelectionChange",I),Z===!0||I!==k){W(I);var re=j(I);a(re)}},[j,a,k]),w=m.useCallback(I=>{if(Le.debug2("handleFocusChange",I),I!=null){var[Z]=j([[I,I]]);n(Z)}else n();Q.current=I},[j,n]),T=m.useCallback((I,Z)=>{Le.debug("handleViewportChange",I,Z),(I!==f.top||Z!==f.bottom)&&v({top:I,bottom:Z})},[f]),G=m.useMemo(()=>{if(!y||!p)return!1;try{return Oa(y,p),Le.debug("handleValidateDropTarget true"),!0}catch{return Le.debug("handleValidateDropTarget false"),!1}},[y,p]),{focusedPath:J}=r;m.useEffect(()=>{J!==void 0&&(J==="/"?t.collapseAll():(t.setExpanded(J,!1),t.setExpanded(J,!0)))},[t,J]),m.useEffect(function(){Le.debug("updating table viewport",f),t?.setViewport({top:Math.max(0,f.top-d),bottom:f.bottom+d})},[d,t,f]),m.useEffect(function(){var Z=t.onUpdate(re=>{c({items:re.items.map(he=>Pr(Pr({},he),{},{itemName:he.basename})),offset:re.offset,itemCount:t.size})});return()=>{Z()}},[t]),m.useEffect(function(){Q.current!=null&&w(Q.current),k.length>0&&b(k,!0)},[h,w,b,k]),m.useEffect(function(){if(p!=null&&ht(p)&&p.filename!=="/"){var Z=setTimeout(()=>{p.isExpanded||t?.setExpanded(p.filename,!0)},Kb);return()=>clearTimeout(Z)}},[p,t]);var Qe=m.useCallback(I=>s(Pr(Pr({},I),{},{isDragInProgress:y!=null,dropTargetItem:p,draggedItems:y,isDropTargetValid:G,onDragStart:K,onDragEnd:U,onDragOver:A,onDragExit:me,onDrop:z})),[U,me,A,K,z,y,p,G,s]);return u.jsx("div",{ref:B,className:X("file-list",{"is-dragging":y!=null}),onDragOver:je,onDrop:De,children:u.jsx(Ye,{ref:N,items:h.items,itemCount:h.itemCount,offset:h.offset,onFocusChange:w,onSelect:q,onSelectionChange:b,onViewportChange:T,selectedRanges:k,renderItem:Qe,rowHeight:l,isMultiSelect:e,isDragSelect:!1,isDeselectOnClick:!1})})}var Gb={name:"File Explorer",DELETE:ce.createAndAdd({id:"FILE_EXPLORER.DELETE",name:"Delete",shortcut:[D.DELETE],macShortcut:[L.CMD,D.BACKSPACE]}),RENAME:ce.createAndAdd({id:"FILE_EXPLORER.RENAME",name:"Rename",shortcut:[D.ENTER],macShortcut:[D.ENTER]})};const xa={FILE_EXPLORER:Gb};var Ma=V.module("FileListItemEditor"),qb=()=>Promise.resolve();function Zb(r){var{item:e,onCancel:t,onSubmit:n,validate:i=qb}=r,o=m.useRef(null),[a,s]=m.useState(e.basename),[l,d]=m.useState(),[h,c]=m.useState(Promise.resolve()),f=m.useCallback(()=>{var O;(O=o.current)===null||O===void 0||O.focus()},[o]),v=m.useCallback(O=>O.stopPropagation(),[]),p=m.useCallback(()=>{h.then(()=>{n(a)}).catch(O=>Ma.info("Unable to validate name",O))},[n,a,h]);m.useEffect(function(){var _=Ee.makeCancelable(i(a));return _.then(()=>d(void 0)).catch(k=>{Ee.isCanceled(k)||d(k)}),c(_),()=>_.cancel()},[i,a]),m.useEffect(function(){f()},[f]);var g=m.useCallback(()=>{Ma.debug2("handleBlur"),p()},[p]),y=m.useCallback(O=>{var{value:_}=O.target;s(_)},[]),P=m.useCallback(O=>{O.stopPropagation();var{key:_}=O;switch(_){case"Enter":{p();break}case"Escape":{t();break}}},[t,p]);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:g,onKeyDown:P,onChange:y,onClick:v,onDoubleClick:v,onMouseDown:v}),l&&u.jsx("div",{className:"invalid-feedback",children:"".concat(l)})]})}function Na(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,n)}return t}function di(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Na(Object(t),!0).forEach(function(n){Xb(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):Na(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function Xb(r,e,t){return e=Yb(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Yb(r){var e=Qb(r,"string");return typeof e=="symbol"?e:String(e)}function Qb(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}function Wl(r){var{isMultiSelect:e=!1,focusedPath:t,showContextMenu:n=!1,onCreateFile:i,onCreateFolder:o,onCopy:a,onDelete:s,onMove:l,onRename:d,onSelect:h,onSelectionChange:c,table:f,rowHeight:v=Ki,validateRename:p=()=>Promise.resolve()}=r,[g,y]=m.useState(),[P,O]=m.useState([]),[_,k]=m.useState(),W=m.useCallback(z=>{O(z),c?.(z)},[c]),Q=m.useCallback(z=>{k(z)},[]),N=m.useCallback(()=>{_&&a?.(_)},[_,a]),B=m.useCallback(()=>{P.length>0&&s?.(P)},[s,P]),j=m.useCallback(()=>{i?.()},[i]),Y=m.useCallback(()=>{_&&o?.($.getPath(_.filename))},[_,o]),ne=m.useCallback(()=>{_&&y(_)},[_]),F=m.useCallback(()=>{y(void 0)},[]),q=m.useCallback(z=>{g&&(d?.(g,z),y(void 0))},[d,g]),K=m.useMemo(()=>{if(g)return[];var z=[];return i&&z.push({title:"New File",description:"Create new file",action:j,group:ee.groups.medium}),o&&z.push({title:"New Folder",description:"Create new folder",action:Y,group:ee.groups.medium}),a&&z.push({title:"Copy File",description:"Copy the selected file",action:N,group:ee.groups.low,disabled:_==null||ht(_)}),s&&P.length>0&&z.push({title:"Delete",description:"Delete",shortcut:xa.FILE_EXPLORER.DELETE,action:B,group:ee.groups.low}),d&&z.push({title:"Rename",description:"Rename",shortcut:xa.FILE_EXPLORER.RENAME,action:ne,group:ee.groups.low,disabled:_==null}),z},[N,B,j,Y,ne,_,a,i,o,s,d,P,g]),A=m.useCallback(z=>(R(g),p(g,z)),[g,p]),U=m.useCallback(z=>{var{item:me}=z;return g&&g.filename===me.filename?u.jsx(_i,di(di({},z),{},{children:u.jsx(Zb,{item:me,validate:A,onSubmit:q,onCancel:F})})):u.jsx(_i,di({},z))},[F,q,g,A]);return u.jsxs("div",{className:"file-list-container",children:[f!=null&&u.jsx(zb,{onMove:l,onSelect:h,onSelectionChange:W,onFocusChange:Q,renderItem:U,rowHeight:v,table:f,isMultiSelect:e,focusedPath:t}),n&&u.jsx(ee,{actions:K})]})}Wl.displayName="FileListContainer";function Aa(r,e,t){return e=Jb(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Jb(r){var e=ey(r,"string");return typeof e=="symbol"?e:String(e)}function ey(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class ty extends Vn{constructor(e){super("Name already exists"),Aa(this,"isExistingFile",!0),Aa(this,"info",void 0),this.info=e}}const Or=ty;function La(r,e,t,n,i,o,a){try{var s=r[o](a),l=s.value}catch(d){t(d);return}s.done?e(l):Promise.resolve(l).then(n,i)}function Fa(r){return function(){var e=this,t=arguments;return new Promise(function(n,i){var o=r.apply(e,t);function a(l){La(o,n,i,a,s,"next",l)}function s(l){La(o,n,i,a,s,"throw",l)}a(void 0)})}}var ft=V.module("FileExplorer");function zi(r){var{storage:e,isMultiSelect:t=!1,focusedPath:n,onCopy:i=()=>{},onDelete:o=()=>{},onRename:a=()=>{},onCreateFile:s=()=>{},onCreateFolder:l=()=>{},onSelect:d,onSelectionChange:h,rowHeight:c=Ki}=r,[f,v]=m.useState([]),[p,g]=m.useState();m.useEffect(function(){var q;function K(){return A.apply(this,arguments)}function A(){return A=Fa(function*(){ft.debug("initTable"),q=Ee.makeCancelable(e.getTable(),U=>U.close());try{g(yield q)}catch(U){Ee.isCanceled(U)||ft.error("Unable to initialize table",U)}}),A.apply(this,arguments)}return K(),()=>{q.cancel()}},[e]);var y=m.useCallback(F=>{Ee.isCanceled(F)||ft.error(F)},[]),P=m.useCallback(()=>{ft.debug("handleCreateFile"),s()},[s]),O=m.useCallback(()=>{ft.debug("handleCreateFolder"),l()},[l]),_=m.useCallback(F=>{ft.debug("handleCopyFile",F.filename),i(F)},[i]),k=m.useCallback(F=>{ft.debug("handleDelete, pending confirmation",F),v(F)},[]),W=m.useCallback(()=>{ft.debug("handleDeleteConfirm",f),f.forEach(F=>e.deleteFile(ht(F)?$.makePath(F.filename):F.filename)),o(f),v([])},[f,o,e]),Q=m.useCallback(()=>{ft.debug("handleDeleteCancel"),v([])},[]),N=m.useCallback((F,q)=>{var K=$.reducePaths(F.map(A=>ht(A)?$.makePath(A.filename):A.filename));K.forEach(A=>{var U=$.isPath(A)?"".concat(q).concat($.getBaseName(A.substring(0,A.length-1)),"/"):"".concat(q).concat($.getBaseName(A));e.moveFile(A,U).then(()=>{a(A,U)}).catch(y)})},[y,a,e]),B=m.useCallback((F,q)=>{var K=F.filename,A=ht(F);A&&!K.endsWith("/")&&(K="".concat(K,"/"));var U="".concat($.getParent(K)).concat(q);A&&!U.endsWith("/")&&(U="".concat(U,"/")),ft.debug2("handleRename",K,U),e.moveFile(K,U).catch(y),a(K,U)},[y,a,e]),j=m.useCallback(function(){var F=Fa(function*(q,K){if(K!==q.basename){$.validateName(K);var A="".concat($.getPath(q.filename)).concat(K);try{var U=yield e.info(A);throw new Or(U)}catch(z){if(!(z instanceof Vi))throw z}}});return function(q,K){return F.apply(this,arguments)}}(),[e]),Y=f.length>0,ne=m.useMemo(()=>f.length===1?'Are you sure you want to delete "'.concat(f[0].filename,'"?'):"Are you sure you want to delete the selected files?",[f]);return u.jsxs("div",{className:"file-explorer",children:[p&&u.jsx(Wl,{isMultiSelect:t,focusedPath:n,showContextMenu:!0,onCopy:_,onCreateFolder:O,onCreateFile:P,onMove:N,onDelete:k,onRename:B,onSelect:d,onSelectionChange:h,rowHeight:c,table:p,validateRename:j}),u.jsx(ln,{isOpen:Y,headerText:ne,bodyText:"You cannot undo this action.",onCancel:Q,onConfirm:W,confirmButtonText:"Delete"})]})}zi.displayName="FileExplorer";function ka(r,e,t,n,i,o,a){try{var s=r[o](a),l=s.value}catch(d){t(d);return}s.done?e(l):Promise.resolve(l).then(n,i)}function ny(r){return function(){var e=this,t=arguments;return new Promise(function(n,i){var o=r.apply(e,t);function a(l){ka(o,n,i,a,s,"next",l)}function s(l){ka(o,n,i,a,s,"throw",l)}a(void 0)})}}function Bt(r,e,t){return e=ry(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function ry(r){var e=iy(r,"string");return typeof e=="symbol"?e:String(e)}function iy(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}var Jt=V.module("NewItemModal");class sn extends m.PureComponent{static getValidationMessage(e){return e instanceof Or&&e.info.type==="directory"?"Error: Cannot overwrite existing directory":"".concat(e)}static handleError(e){Ee.isCanceled(e)||Jt.error(e)}constructor(e){super(e),Bt(this,"inputRef",H.createRef()),Bt(this,"cancelableValidatePromise",void 0),Bt(this,"cancelableExistingItemPromise",void 0),Bt(this,"pending",new xn),Bt(this,"pathMap",new Map),Bt(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,n=$.hasPath(t)?$.getPath(t):"/";this.state={isSubmitting:!1,path:n,prevExtension:$.getExtension(t),showExtensionChangeModal:!1,showOverwriteModal:!1,value:$.getBaseName(t)}}componentDidUpdate(e,t){var{isOpen:n}=this.props,{isOpen:i}=e,{value:o,path:a}=this.state;!i&&n&&(this.resetValue(),this.isInitialLoad=!0),i&&n&&(!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=$.hasPath(e)?$.getPath(e):"/";this.setState({path:t,value:$.getBaseName(e),validationError:void 0,prevExtension:$.getExtension(e),isSubmitting:!1})}getValidationPromise(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return this.cancelableValidatePromise&&this.cancelableValidatePromise.cancel(),this.cancelableValidatePromise=Ee.makeCancelable(this.validateName(e,t,n)),this.cancelableValidatePromise}validateName(e,t,n){var i=this;return ny(function*(){$.validateName(t);var{defaultValue:o,storage:a}=i.props;if(n){var s="".concat(e).concat(t);if(s!==o)try{var l=yield a.info(s);throw new Or(l)}catch(d){if(!(d instanceof Vi))throw d}}return t})()}updateValidationStatus(e,t){this.getValidationPromise(e,t).then(()=>{this.setState({validationError:void 0})}).catch(this.handleValidationError).catch(sn.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:$.makePath(e.filename)});else{var t=e.basename,n=$.getPath(e.filename);this.setState({value:t,path:n},()=>{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:n}=this.props;n();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:n}=this.state;Jt.debug("handleOverwriteConfirm",t,n),e("".concat(t).concat(n),!0)}handleExtensionChangeCancel(){Jt.debug("handleExtensionChangeCancel"),this.setState(e=>{var{value:t,prevExtension:n}=e,i=$.replaceExtension(t,n);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:n}=e,i=t==="directory"?n.length:n.lastIndexOf(".");e.focus(),e.setSelectionRange(0,i>0?i:n.length)}}submitModal(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;this.setState(t=>{var{prevExtension:n,value:i,path:o}=t,{notifyOnExtensionChange:a,type:s}=this.props;Jt.debug("submitModal",n,i);var l=$.getExtension(i);return a&&!e&&n!==null&&n!==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 Or&&s!=="directory"&&d.info.type!=="directory"){this.setState({showOverwriteModal:!0});return}throw d}).catch(d=>{throw Ee.isCanceled(d)&&this.setState({isSubmitting:!1}),d}).catch(this.handleValidationError).catch(sn.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((n,i)=>{for(var o="",a=0;a<i;a+=1)o+="".concat(t[a],"/");return o+="".concat(n,"/"),u.jsxs(H.Fragment,{children:[u.jsx(se,{kind:"ghost",className:"directory-breadcrumbs",onClick:()=>this.handleBreadcrumbSelect(o),"aria-label":i===0?"Home":void 0,icon:i===0?u.jsx(ue,{icon:Ud,transform:"right-1.6"}):void 0,tooltip:i===0?"Home":void 0,children:n}),"/"]},o)})}render(){var{storage:e,isOpen:t,onCancel:n,placeholder:i,title:o,type:a}=this.props,{isSubmitting:s,path:l,showExtensionChangeModal:d,showOverwriteModal:h,validationError:c,value:f,prevExtension:v,newExtension:p}=this.state,g=a==="directory",y=$.fileExtensionToString(v),P=$.fileExtensionToString(p),O=g?"Create":"Save",_=g?"New folder name":"Save file as";return u.jsxs(u.Fragment,{children:[u.jsxs(Ya,{isOpen:t,toggle:n,onOpened:this.handleModalOpened,className:"modal-dialog-centered new-file-modal",children:[u.jsx(Qa,{toggle:n,children:o}),u.jsx(Ja,{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:_}),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:f,placeholder:i,ref:this.inputRef,onKeyDown:this.handleKeyDown,onChange:this.handleChange}),c&&u.jsx("div",{className:"invalid-feedback",children:sn.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(zi,{onSelect:this.handleSelect,storage:e,focusedPath:l})})]})})}),u.jsxs(Ps,{children:[u.jsx(se,{kind:"secondary",onClick:n,children:"Cancel"}),u.jsx(se,{kind:"primary",disabled:s,onClick:this.handleModalSubmit,children:O})]})]}),u.jsx(ln,{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(ln,{isOpen:d,headerText:"Confirm extension change",bodyText:'Are you sure you want to change extension from "'.concat(y,'" to "').concat(P,'"?'),onCancel:this.handleExtensionChangeCancel,onConfirm:this.handleExtensionChangeConfirm,cancelButtonText:'Keep "'.concat(y,'"'),confirmButtonText:'Use "'.concat(P,'"')})]})}}Bt(sn,"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});Bt(sn,"defaultProps",{isOpen:!1,defaultValue:"/",notifyOnExtensionChange:!1,placeholder:"",onSubmit:(r,e)=>{},onCancel:()=>{}});const Ul=sn;function oy(r){var{createFile:e,createFolder:t,onSearchChange:n,defaultSearchText:i=""}=r;return u.jsxs("div",{className:"file-explorer-toolbar",children:[u.jsxs("div",{className:"file-explorer-toolbar-buttons",children:[u.jsx(se,{kind:"ghost",icon:hs,tooltip:"New notebook",onClick:e,"aria-label":"New notebook"}),u.jsx(se,{kind:"ghost",icon:Vd,tooltip:"New folder",onClick:t,"aria-label":"New folder"})]}),n&&u.jsx("div",{className:"file-explorer-toolbar-search",children:u.jsx(Ih,{value:i,onChange:n,placeholder:"Search by name"})})]})}function Ra(r,e,t,n,i,o,a){try{var s=r[o](a),l=s.value}catch(d){t(d);return}s.done?e(l):Promise.resolve(l).then(n,i)}function ay(r){return function(){var e=this,t=arguments;return new Promise(function(n,i){var o=r.apply(e,t);function a(l){Ra(o,n,i,a,s,"next",l)}function s(l){Ra(o,n,i,a,s,"throw",l)}a(void 0)})}}function Vl(r,e,t){return e=sy(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function sy(r){var e=ly(r,"string");return typeof e=="symbol"?e:String(e)}function ly(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}var en=V.module("FileExplorerPanel"),dy=(r,e)=>{var t=Hs(r),n=lr(r,e.localDashboardId),{session:i,config:o}=n??{},a=o?.type;return{fileStorage:t,language:a,session:i}},uy=In(dy,null,null,{forwardRef:!0});function hy(r){var e=r;return e!=null&&typeof e.button=="number"}class On extends H.Component{static handleError(e){en.error(e)}static isFocusEvent(e){return hy(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:n}=e;this.state={isShown:!1,language:n,session:t,showCreateFolder:!1,focusedFilePath:"/"}}componentDidMount(){this.isHidden()||this.setState({isShown:!0})}handleCreateFile(){var{glEventHub:e}=this.props,{session:t,language:n}=this.state,i={language:n,value:""};en.debug("handleCreateFile",t,n,i),e.emit(de.CREATE_NOTEBOOK,t,n,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 ay(function*(){var{fileStorage:n}=t.props;if(ht(e)){en.error("Invalid item in handleCopyItem",e);return}var i=yield $.getUniqueCopyFileName(n,e.filename);yield n.copyFile(e.filename,i)})()}handleDelete(e){var{glEventHub:t}=this.props;e.forEach(n=>{t.emit(de.CLOSE_FILE,{id:n.filename,itemName:n.filename})})}handleSelectionChange(e){var t="/";e.length===1&&(e[0].type==="directory"?t=$.makePath(e[0].filename):t=$.getPath(e[0].filename)),this.setState({focusedFilePath:t})}handleFileSelect(e,t){if(en.debug("fileSelect",e),e.type!=="directory"){var n=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(de.SELECT_NOTEBOOK,a,s,l,i,n)}}handleRename(e,t){var{glEventHub:n}=this.props;en.debug("handleRename",e,t),n.emit(de.RENAME_FILE,e,t)}handleSessionOpened(e,t){var{language:n}=t;this.setState({session:e,language:n})}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:n}=this.props,{isShown:i,showCreateFolder:o,focusedFilePath:a}=this.state;return u.jsxs(sr,{className:"file-explorer-panel",componentPanel:this,glContainer:t,glEventHub:n,onSessionOpen:this.handleSessionOpened,onSessionClose:this.handleSessionClosed,onShow:this.handleShow,children:[u.jsx(oy,{createFile:this.handleCreateFile,createFolder:this.handleCreateDirectory}),i&&u.jsx(zi,{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(Ul,{isOpen:o,type:"directory",title:"Create New Folder",storage:e,onSubmit:this.handleCreateDirectorySubmit,onCancel:this.handleCreateDirectoryCancel,defaultValue:a})]})}}Vl(On,"COMPONENT","FileExplorerPanel");Vl(On,"TITLE","File Explorer");var cy=uy(On);const my=cy;function Jn(r,e,t){return e=fy(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function fy(r){var e=vy(r,"string");return typeof e=="symbol"?e:String(e)}function vy(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}var ja=V.module("LogPanel");class qr extends m.PureComponent{constructor(e){super(e),Jn(this,"isBottomVisible",void 0),Jn(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){ja.debug("Session opened",[e]),this.setState({session:e})}handleSessionClosed(e){ja.debug("Session closed",e)}updateDimensions(){this.logView&&this.logView.updateDimensions()}render(){var{glContainer:e,glEventHub:t}=this.props,{session:n}=this.state;return u.jsxs(sr,{componentPanel:this,glContainer:e,glEventHub:t,onResize:this.handleResize,onHide:this.handleHide,onShow:this.handleShow,onSessionOpen:this.handleSessionOpened,onSessionClose:this.handleSessionClosed,children:[n==null&&u.jsx("div",{className:"log-panel-disconnected-message",children:"Waiting for session connection"}),n!=null&&u.jsx(Af,{session:n,ref:i=>{this.logView=i}})]})}}Jn(qr,"defaultProps",{session:null});Jn(qr,"COMPONENT","LogPanel");Jn(qr,"TITLE","Log");var gy=(r,e)=>{var t;return{session:(t=lr(r,e.localDashboardId))===null||t===void 0?void 0:t.session}},py=In(gy,null,null,{forwardRef:!0})(qr);const by=py;function $a(r,e,t,n,i,o,a){try{var s=r[o](a),l=s.value}catch(d){t(d);return}s.done?e(l):Promise.resolve(l).then(n,i)}function Ha(r){return function(){var e=this,t=arguments;return new Promise(function(n,i){var o=r.apply(e,t);function a(l){$a(o,n,i,a,s,"next",l)}function s(l){$a(o,n,i,a,s,"throw",l)}a(void 0)})}}function Ba(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,n)}return t}function He(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Ba(Object(t),!0).forEach(function(n){Ne(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):Ba(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function Ne(r,e,t){return e=yy(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function yy(r){var e=Cy(r,"string");return typeof e=="symbol"?e:String(e)}function Cy(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}var Sy=m.lazy(()=>cs(()=>import("./MarkdownNotebook-6fe964de.js"),["./MarkdownNotebook-6fe964de.js","./vendor-3cb40e4b.js","./helpers-de833af9.js","./vendor-fb3fd713.css","./index-bdb64cb2.js","./monaco-b5248072.js","./monaco-f18fde03.css","./index-7d08f7c0.css","./mathjax-cb1613e2.js","./MarkdownNotebook-9207e775.css"],import.meta.url)),le=V.module("NotebookPanel"),Wa=400;class Te extends m.Component{static handleError(e){Ee.isCanceled(e)||le.error(e)}static unsavedNotebookCount(){return document.querySelectorAll(".".concat(Te.UNSAVED_INDICATOR_CLASS_NAME,".").concat(Te.UNSAVED_STATUS_CLASS_NAME)).length}static languageFromFileName(e){var t=$.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),Ne(this,"pending",void 0),Ne(this,"debouncedSavePanelState",void 0),Ne(this,"debouncedLoad",void 0),Ne(this,"notebook",void 0),Ne(this,"tabTitleElement",void 0),Ne(this,"tabInitOnce",void 0),Ne(this,"editor",void 0),Ne(this,"getSettings",yt((f,v)=>He(He({},f),{},{minimap:{enabled:v}}))),Ne(this,"getOverflowActions",yt((f,v)=>[{title:"Find",icon:Gd,action:this.handleFind,group:ee.groups.high,shortcut:Re.NOTEBOOK.FIND,order:10},{title:"Copy File",icon:es,action:this.handleCopy,group:ee.groups.medium,order:20},{title:"Rename File",icon:qd,action:this.handleShowRename,group:ee.groups.medium,order:30},{title:"Delete File",icon:ss,action:this.handleDelete,group:ee.groups.medium,order:40},{title:"Show Minimap",icon:f?Un:void 0,action:this.handleMinimapChange,group:ee.groups.low,shortcut:Re.NOTEBOOK.MINIMAP,order:20},{title:"Word Wrap",icon:v?Un:void 0,action:this.handleWordWrapChange,group:ee.groups.low,shortcut:Re.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 xn,this.debouncedSavePanelState=_n(this.savePanelState.bind(this),Wa),this.debouncedLoad=_n(this.load.bind(this),Wa),this.notebook=null,this.tabTitleElement=null,this.tabInitOnce=!1;var{isDashboardActive:t,session:n,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&&$.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:n,sessionLanguage:i,panelState:{fileMetadata:s,settings:a},showCloseModal:!1,showDeleteModal:!1,showSaveAsModal:!1,scriptCode:""},le.debug("constructor",e,this.state)}componentDidMount(){var{glContainer:e,glEventHub:t}=this.props,{tab:n}=e;n!=null&&this.initTab(n),this.initNotebookContent(),t.on(de.RENAME_FILE,this.handleRenameFile),t.on(te.DROPPED,this.handlePanelDropped),e.on(de.PROMOTE_FROM_PREVIEW,this.handlePreviewPromotion)}componentDidUpdate(e,t){var{isPreview:n,settings:i}=this.state,{wordWrap:o}=i,{defaultNotebookSettings:a}=this.props;n!==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:n,isPreview:i}=this.state;e.off(de.RENAME_FILE,this.handleRenameFile),e.off(te.DROPPED,this.handlePanelDropped),t.off(de.PROMOTE_FROM_PREVIEW,this.handlePreviewPromotion),e.emit(de.UNREGISTER_FILE,n,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:n,savedChangeCount:i}=this.state;return n!==i?(this.setState({showCloseModal:!0}),!1):!0})}initTabClasses(e){var t=e.element.get(0);R(t);var n=t.querySelector(".lm_title");this.tabTitleElement=n,n?.classList.add("notebook-title"),this.setPreviewStatus()}getNotebookValue(){var{changeCount:e,savedChangeCount:t,settings:n}=this.state,{value:i}=n;if(e!==t&&this.notebook){var o=this.notebook.getValue();return o??i}return i}initNotebookContent(){var{fileMetadata:e,settings:t,isPreview:n}=this.state;if(e&&e.id){le.debug("Init content from file"),this.registerFileMetadata(e,n),this.load();return}if(t.value!=null){le.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(de.CLOSE_FILE,{id:e})}registerFileMetadata(e,t){var{glEventHub:n,metadata:i}=this.props,{id:o}=i;n.emit(de.REGISTER_FILE,o,e,t)}renameTab(e,t){var{glEventHub:n}=this.props;n.emit(de.RENAME,e,t)}load(){var{fileMetadata:e,settings:t}=this.state;R(e);var{id:n}=e,{fileStorage:i}=this.props;this.pending.add(i.loadFile(n)).then(o=>{var a;le.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,$.getBaseName(s))}var c=He(He({},t),{},{language:(a=Te.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&&$.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){le.debug("saveContent",e,t),this.updateSavedChangeCount();var{fileStorage:n}=this.props;this.pending.add(n.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;le.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:n,fileMetadata:i,isPreview:o,settings:a}=e,s=this.getNotebookValue(),l=t!==n?s:void 0,d=He(He({},a),{},{value:s}),h=He(He({},a),{},{value:l}),c={settings:h,fileMetadata:i,isPreview:o};return le.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(de.CLOSE_FILE,{id:e,itemName:e},{force:!0}),this.focus()}handleCopy(){var e=this;return Ha(function*(){var{fileStorage:t,glEventHub:n,session:i}=e.props,{fileMetadata:o,settings:a}=e.state;R(o);var{language:s}=a,{itemName:l}=o,d=yield $.getUniqueCopyFileName(t,l);le.debug("handleCopy",o,l,d),yield t.copyFile(l,d);var h={id:d,itemName:d},c={value:null,language:s};n.emit(de.SELECT_NOTEBOOK,i,s,c,h,!0)})()}handleDelete(){le.debug("handleDelete, pending confirmation"),this.setState({showDeleteModal:!0})}handleDeleteConfirm(){var e=this;return Ha(function*(){var{fileStorage:t,glContainer:n,glEventHub:i}=e.props,{fileMetadata:o}=e.state;le.debug("handleDeleteConfirm",o?.itemName),e.setState({showDeleteModal:!1}),o&&($.hasPath(o.itemName)&&(yield $.fileExists(t,o.itemName))?(i.emit(de.CLOSE_FILE,o,{force:!0}),t.deleteFile(o.itemName)):n.close({force:!0}))})()}handleDeleteCancel(){this.setState({showDeleteModal:!1})}handleEditorInitialized(e){this.editor=e}handleEditorWillDestroy(){this.editor=void 0}handleEditorChange(e){le.debug2("handleEditorChanged",e),this.removePreviewStatus(),this.setState(t=>{var{changeCount:n,savedChangeCount:i}=t,{isUndoing:o,isRedoing:a}=e;return o?{changeCount:n-1,savedChangeCount:i}:!a&&n<i?{changeCount:n+1,savedChangeCount:0}:{changeCount:n+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:n}=this.props,i={defaultNotebookSettings:{isMinimapEnabled:!((e=t.isMinimapEnabled)!==null&&e!==void 0&&e)}};n(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,n=t.wordWrap==="on"?"off":"on";return{settings:He(He({},t),{},{wordWrap:n})}})}handleLinkClick(e){var{notebooksUrl:t,session:n,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==="/"){le.debug("Ignoring invalid notebook link",a);return}le.debug("Notebook link clicked, opening",a);var{glEventHub:s}=this.props,l={value:null,language:i},d={id:a,itemName:a};s.emit(de.SELECT_NOTEBOOK,n,i,l,d)}}handleLoadSuccess(){this.setState({error:void 0,isLoaded:!0,isLoading:!1})}handleLoadError(e){var t=e;Ee.isCanceled(t)||(Ee.isTimedOut(t)&&(t=new Error("File not found.")),le.error(t),this.setState({error:t,isLoading:!1}))}handleSave(){le.debug("handleSave"),this.save()}handleSaveSuccess(e){var t,{fileStorage:n}=this.props,i={id:e.filename,itemName:e.filename},o=(t=Te.languageFromFileName(e.filename))!==null&&t!==void 0?t:"";this.setState(a=>{var{fileMetadata:s}=a,l=He(He({},a.settings),{},{language:o});return le.debug("handleSaveSuccess",i,s,l),s&&$.hasPath(s.itemName)&&s.itemName!==i.itemName&&(le.debug("handleSaveSuccess deleting old file",s.itemName),n.deleteFile(s.itemName).catch(Te.handleError)),{fileMetadata:i,settings:l,isPreview:!1}}),this.debouncedSavePanelState(),this.registerFileMetadata(i,!1)}handleSaveError(e){Ee.isCanceled(e)||(this.setState({savedChangeCount:0}),le.error(e))}handleSaveAsCancel(){this.setState({showSaveAsModal:!1})}handleSaveAsSubmit(e){var t,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;n&&this.handleOverwrite(e),le.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}),$.getBaseName(o)!==$.getBaseName(e)){var{metadata:s}=this.props,{id:l}=s;this.renameTab(l,$.getBaseName(e))}this.saveContent(e,a)}}handleRenameFile(e,t,n){var{fileMetadata:i,panelState:o}=this.state,{glContainer:a}=this.props;if(i?.itemName==="/".concat(t)&&n&&JSON.stringify(o)!==JSON.stringify(n)){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){le.error("Editor is not initialized.");return}this.runCommand((e=this.notebook.getValue())!==null&&e!==void 0?e:void 0)}handleRunSelected(){if(!this.notebook){le.error("Editor is not initialized.");return}this.runCommand(this.notebook.getSelectedCommand())}handleSessionOpened(e,t){var{language:n}=t;this.setState({session:e,sessionLanguage:n})}handleSessionClosed(){this.setState({session:void 0,sessionLanguage:void 0})}handleShow(){var e;le.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){le.debug("NotebookPanel tab event",e),this.initTab(e)}handleTabFocus(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];le.debug("handleTabFocus",...t);var{glContainer:i}=this.props;this.setState({isDashboardActive:!0}),this.notebook&&!i.isHidden&&this.notebook.updateDimensions()}handleTabBlur(){le.debug("handleTabBlur"),this.setState({isDashboardActive:!1})}handleTabClick(e){le.debug("handle NotebookPanel tab click"),this.focus(),e.detail===2&&this.removePreviewStatus()}handleTransformLinkUri(e){var{notebooksUrl:t}=this.props,{fileMetadata:n}=this.state;if(e.endsWith("/"))return e;if(e.startsWith("/"))return"".concat(t).concat(e.substring(1));var i=n?.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 n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"",{glEventHub:i}=this.props,{session:o,sessionLanguage:a,settings:s}=this.state,l=He(He({},s),{},{language:t,value:n}),d={id:null,itemName:e};le.debug("handleCreateNotebook",o,a,l,d),i.emit(de.CREATE_NOTEBOOK,o,a,l,d)}runCommand(e){if(e===void 0||e===""){le.debug("Ignoring empty command.");return}this.removePreviewStatus();var{glEventHub:t}=this.props;t.emit(it.SEND_COMMAND,e,!1,!0)}removePreviewStatus(){this.setState(e=>{var{isPreview:t}=e;if(t){var{fileMetadata:n}=this.state;return n&&this.registerFileMetadata(n,!1),{isPreview:!1}}return null})}getDropdownOverflowActions(){var e,t,{defaultNotebookSettings:n}=this.props,{settings:i}=this.state;return this.getOverflowActions((e=n.isMinimapEnabled)!==null&&e!==void 0?e:!1,this.getSettings(i,(t=n.isMinimapEnabled)!==null&&t!==void 0?t:!1).wordWrap==="on")}render(){var e,t,n,{fileStorage:i,glContainer:o,glContainer:{tab:a},glEventHub:s,defaultNotebookSettings:l}=this.props,{changeCount:d,savedChangeCount:h,error:c,isDashboardActive:f,isLoaded:v,isLoading:p,isPreview:g,fileMetadata:y,session:P,sessionLanguage:O,settings:_,showCloseModal:k,showDeleteModal:W,showSaveAsModal:Q}=this.state,N=f&&!o.isHidden&&!g,B=(e=y?.itemName)!==null&&e!==void 0?e:Te.DEFAULT_NAME,j=B.endsWith(".md"),Y=y?.id!=null,ne=this.getSettings(_,(t=l.isMinimapEnabled)!==null&&t!==void 0?t:!1),F=P!=null,q=O===ne.language,K=!v||!F||!q,A=!v,U=[{action:this.handleSave,shortcut:Vt.SAVE},{action:this.handleMinimapChange,shortcut:Re.NOTEBOOK.MINIMAP},{action:this.handleWordWrapChange,shortcut:Re.NOTEBOOK.WORDWRAP}],z=gi.getDisabledRunTooltip(F,q,"Notebook extension","Run"),me=gi.getDisabledRunTooltip(F,q,"Notebook extension","Run Selected"),je=[{title:Y?"Rename":"Save As…",order:10,group:ee.groups.high,action:this.handleShowRename},{title:"Copy File",action:this.handleCopy,group:ee.groups.high,order:20}],De=a?.element.find(".lm_title_before").get(0);return u.jsxs(u.Fragment,{children:[De!=null&&jr.createPortal(u.jsx("span",{className:X(Te.UNSAVED_INDICATOR_CLASS_NAME,{[Te.UNSAVED_STATUS_CLASS_NAME]:d!==h})}),De),u.jsxs(sr,{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:je,renderTabTooltip:()=>B,children:[!j&&u.jsxs(u.Fragment,{children:[u.jsxs("div",{className:"notebook-toolbar",children:[u.jsxs("span",{children:[u.jsx(se,{kind:"ghost",className:"btn-play",onClick:this.handleRunAll,disabled:K,icon:u.jsx(ue,{icon:us,transform:"grow-4"}),tooltip:"Run ".concat(Re.NOTEBOOK.RUN.getDisplayText()),"aria-label":"Run"}),z!=null&&u.jsx(qt,{children:z})]}),u.jsxs("span",{children:[u.jsx(se,{kind:"ghost",className:"btn-play",onClick:this.handleRunSelected,disabled:K,icon:u.jsx(ue,{icon:Kd,transform:"grow-4"}),tooltip:"Run Selected ".concat(Re.NOTEBOOK.RUN_SELECTED.getDisplayText()),"aria-label":"Run Selected"}),me!=null&&u.jsx(qt,{children:me})]}),u.jsx(se,{kind:"ghost",className:"mr-auto",disabled:A,onClick:this.handleSave,icon:zd,tooltip:"Save ".concat(Vt.SAVE.getDisplayText()),"aria-label":"Save"}),u.jsx(se,{kind:"ghost",className:"btn-overflow",disabled:A,icon:ds,tooltip:"More Actions...",onClick:()=>{},children:u.jsx(zn,{actions:this.getDropdownOverflowActions,popperOptions:Te.POPPER_OPTIONS})})]}),u.jsx(gf,{isLoaded:v,isLoading:p,error:c,onChange:this.handleEditorChange,onRunCommand:this.handleRunCommand,session:P,sessionLanguage:O,onEditorInitialized:this.handleEditorInitialized,onEditorWillDestroy:this.handleEditorWillDestroy,settings:ne,focusOnMount:N,ref:b=>{this.notebook=b}})]}),j&&u.jsx(m.Suspense,{fallback:u.jsx(dn,{}),children:u.jsx(Sy,{content:(n=ne.value)!==null&&n!==void 0?n:"",onLinkClick:this.handleLinkClick,onRunCode:this.handleRunCommand,transformImageUri:this.handleTransformLinkUri,transformLinkUri:this.handleTransformLinkUri})}),u.jsx(Ul,{isOpen:Q,type:"file",defaultValue:B,title:Y?"Rename":"Save file as",onSubmit:this.handleSaveAsSubmit,onCancel:this.handleSaveAsCancel,notifyOnExtensionChange:!0,storage:i}),u.jsx(ln,{isOpen:W,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(ln,{isOpen:k,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(ee,{actions:U})]})]})}}Ne(Te,"COMPONENT","NotebookPanel");Ne(Te,"POPPER_OPTIONS",{placement:"bottom-end"});Ne(Te,"DEFAULT_NAME","Untitled");Ne(Te,"UNSAVED_INDICATOR_CLASS_NAME","editor-unsaved-indicator");Ne(Te,"UNSAVED_STATUS_CLASS_NAME","is-unsaved");Ne(Te,"defaultProps",{isDashboardActive:!0,isPreview:!1,session:null,sessionLanguage:null,defaultNotebookSettings:{isMinimapEnabled:!0}});var wy=(r,e)=>{var t=Hs(r),n=lc(r),i=lr(r,e.localDashboardId),{session:o,config:a}=i??{},{type:s}=a??{};return{fileStorage:t,defaultNotebookSettings:n,session:o,sessionLanguage:s}},Ey=In(wy,{updateSettings:vc},null,{forwardRef:!0})(Te);const tn=Ey;function Ua(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,n)}return t}function Va(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Ua(Object(t),!0).forEach(function(n){_y(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):Ua(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function _y(r,e,t){return e=Py(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Py(r){var e=Ty(r,"string");return typeof e=="symbol"?e:String(e)}function Ty(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}var be=V.module("ConsolePlugin");function Ka(r){return r.notebook!==void 0}function Oy(r){yp(r)}function aS(r){Oy(r);var{id:e,hydrateConsole:t,layout:n,panelManager:i,registerComponent:o,notebooksUrl:a}=r,s=m.useRef(0),[l,d]=m.useState(new Map),[h,c]=m.useState(new Map),f=Ti(),v=m.useCallback(()=>i.getLastUsedPanelOfType(li),[i]),p=m.useCallback((b,w)=>{d(T=>new Map(T.set(b,w)))},[d]),g=m.useCallback(b=>{d(w=>(w.delete(b),new Map(w)))},[d]),y=m.useCallback((b,w)=>{c(T=>new Map(T.set(b,w)))},[c]),P=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,T=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,G=b&&b.trim();if(!G)be.info("Ignoring empty code");else{var J=v();if(!J||!(J instanceof li.WrappedComponent)){be.error("Console panel not found");return}be.debug("Send command: ",b,w,T),J.addCommand(b,w,T)}},[v]),_=m.useCallback(b=>{f(gb(e,b))},[f,e]),k=m.useCallback(b=>{var{language:w}=b,T=w==="python"?"py":w,G=null;return T==null?(be.debug("No extension for language",w),G="Untitled-".concat(s.current)):G="Untitled-".concat(s.current,".").concat(T),s.current+=1,G},[]),W=m.useCallback(function(b){var w=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,{id:T}=b;if(T!=null&&l.has(T))return l.get(T);if(T!=null&&h.has(T))return h.get(T);if(w)return zt()},[l,h]),Q=m.useCallback((b,w)=>{x.renameComponent(n.root,{id:b},w)},[n.root]),N=m.useCallback((b,w)=>{be.debug("Rename file panel",b,w);var T;if(l.has(b)&&(T=l.get(b),g(b),T!=null&&p(w,T)),h.has(b)&&(T=h.get(b),P(b),T!=null&&y(w,T)),T===void 0){be.debug2("File ".concat(b," isn't open, no need to rename the tab"));return}Q(T,$.getBaseName(w))},[l,h,Q,p,y,g,P]),B=m.useCallback(b=>{var w=W(b,!1);if(w==null){be.error("Could not find panel id for file metadata",b);return}x.activateTab(n.root,{id:w})},[W,n.root]),j=m.useCallback((b,w,T)=>{if(be.debug("registerFilePanel",b,w,T),w==null||w.id==null){be.debug("Ignore empty file id",w);return}var{id:G}=w;if(T){y(G,b);return}if(l.has(G)){var J=l.get(G);if(b===J){be.debug("Update tab title for file ".concat(G));var{itemName:Qe}=w;N(G,Qe)}else be.error("File ".concat(G," already associated with a different tab ").concat(J));return}p(G,b),h.has(G)&&P(G)},[l,h,N,p,y,P]),Y=m.useCallback((b,w)=>{if(be.debug("unregisterFileTab",b,w),b==null||b.id==null){be.debug("Ignore empty file id",b);return}var{id:T}=b;if(w){P(T);return}g(T)},[g,P]),ne=m.useCallback((b,w)=>{be.debug("closeFilePanel",b);var{id:T}=b,G=null,J=!1;if(l.has(T))G=l.get(T);else if(h.has(T))G=h.get(T),J=!0;else{be.debug("File ".concat(T," isn't open, ignore close event"));return}Y(b,J),x.closeComponent(n.root,{id:G},w)},[n.root,l,h,Y]),F=m.useCallback(b=>{var{itemName:w}=b;return $.getBaseName(w)},[]),q=m.useCallback(b=>{var{id:w}=b;return be.debug("fileIsOpen",b,w,l),w!=null&&l.has(w)},[l]),K=m.useCallback(b=>{var{id:w}=b;return be.debug("fileIsOpenAsPreview",b,w,h),w!=null&&h.has(w)},[h]),A=m.useCallback(b=>{if(b!=null){var w=i.getOpenedPanelById(b);w&&Ka(w)&&w.focus()}},[i]),U=m.useCallback(b=>{var{id:w,settings:T,fileMetadata:G,session:J,sessionLanguage:Qe,isPreview:I=!1}=b,Z={settings:T,fileMetadata:G},re=F(G);return{type:"react-component",component:tn.COMPONENT,isFocusOnShow:!1,props:{localDashboardId:e,metadata:{id:w},session:J,sessionLanguage:Qe,panelState:Z,isPreview:I,notebooksUrl:a},title:re,id:w}},[F,e,a]),z=m.useCallback(function(b,w,T){var G=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{id:null,itemName:k(T)},J=W(G);if(q(G)&&J!=null){be.debug("File is already open, focus panel"),B(G),A(J);return}var Qe=x.getStackForComponentTypes(n.root,[tn.COMPONENT]),I=U({id:J,settings:T,fileMetadata:G,session:b,sessionLanguage:w});be.debug("createNotebook",I,l),x.openComponentInStack(Qe,I)},[q,A,k,W,n.root,U,l,B]),me=m.useCallback(function(b,w,T,G){var J=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!1;be.debug("selectNotebook",G,J);var Qe=q(G),I=K(G),[Z]=[...h.values()],re=!J,he=re&&Z?Z:W(G);if(he==null||he==="")throw new Error("Unable to retrieve or create panelId for metadata",G);if(Qe||I)B(G);else{var _e=x.getStackForComponentTypes(n.root,[tn.COMPONENT]),Xr=U({id:he,settings:T,fileMetadata:G,session:b,sessionLanguage:w,isPreview:re});x.openComponentInStack(_e,Xr)}if(I&&J){var cr=G.id,Yr=x.getStackForConfig(n.root,{component:tn.COMPONENT,id:he}),Qr=x.getContentItemInStack(Yr,{component:tn.COMPONENT,id:he});Qr&&qe(Qr)&&(Qr.container.emit(de.PROMOTE_FROM_PREVIEW),P(cr),p(cr,he))}J&&A(he)},[B,q,K,A,W,n.root,U,h,P,p]),je=m.useCallback(function(b,w){var T=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},G=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,J=i.getLastUsedPanelOfType(tn);J&&Ka(J)?T!=null&&T.value!=null&&J.notebook!=null&&J.notebook.append(T.value):G&&z(b,w,T)},[z,i]),De=m.useCallback((b,w)=>Op.hydrate(Va(Va({},b),{},{notebooksUrl:a}),w),[a]);return Fn(o,li,t),Fn(o,Sb),Fn(o,my),Fn(o,by),Fn(o,tn,De),Me(n.eventHub,it.SEND_COMMAND,O),Me(n.eventHub,it.SETTINGS_CHANGED,_),Me(n.eventHub,de.CLOSE_FILE,ne),Me(n.eventHub,de.CREATE_NOTEBOOK,z),Me(n.eventHub,de.SELECT_NOTEBOOK,me),Me(n.eventHub,de.RENAME,Q),Me(n.eventHub,de.RENAME_FILE,N),Me(n.eventHub,de.SEND_TO_NOTEBOOK,je),Me(n.eventHub,de.REGISTER_FILE,j),Me(n.eventHub,de.UNREGISTER_FILE,Y),null}function Zr(r,e,t){return e=Iy(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Iy(r){var e=Dy(r,"string");return typeof e=="symbol"?e:String(e)}function Dy(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class hr{}Zr(hr,"DROPDOWN_FILTER","ControlType.DROPDOWN_FILTER");Zr(hr,"INPUT_FILTER","ControlType.INPUT_FILTER");Zr(hr,"MARKDOWN","ControlType.MARKDOWN");Zr(hr,"FILTER_SET_MANAGER","ControlType.FILTER_SET_MANAGER");const sS=hr;export{Ae as $,iC as A,se as B,sh as C,vs as D,_s as E,sl as F,We as G,Vt as H,Ct as I,$y as J,D as K,sS as L,$C as M,zn as N,Xn as O,Ee as P,Cc as Q,Mi as R,Yh as S,E as T,cC as U,Fl as V,kC as W,Xt as X,fc as Y,oC as Z,kp as _,Ce as a,Wy as a$,dc as a0,GC as a1,lr as a2,Ky as a3,Bs as a4,Op as a5,tu as a6,ms as a7,RC as a8,de as a9,tr as aA,Nu as aB,ws as aC,Ss as aD,Du as aE,Iu as aF,It as aG,Ye as aH,En as aI,ah as aJ,Ih as aK,kh as aL,Nh as aM,L as aN,Ps as aO,$r as aP,Es as aQ,jy as aR,Rh as aS,dh as aT,Is as aU,lh as aV,Ir as aW,Jh as aX,Rs as aY,ks as aZ,By as a_,Sa as aa,te as ab,jC as ac,tn as ad,pp as ae,ec as af,Xd as ag,Di as ah,aS as ai,ee as aj,ln as ak,iS as al,mC as am,sC as an,fC as ao,uC as ap,hC as aq,qC as ar,ZC as as,aC as at,dC as au,Ws as av,lC as aw,Ze as ax,ky as ay,Ou as az,dt as b,Pb as b$,Uy as b0,ps as b1,Rf as b2,$f as b3,we as b4,zf as b5,ov as b6,Xf as b7,Be as b8,vC as b9,Gp as bA,Mp as bB,Ep as bC,Wi as bD,Nl as bE,yp as bF,Dl as bG,AC as bH,LC as bI,Ll as bJ,xl as bK,bp as bL,IC as bM,Ap as bN,xC as bO,NC as bP,Me as bQ,Ui as bR,ur as bS,wb as bT,xb as bU,rS as bV,Ib as bW,Tb as bX,_b as bY,Eb as bZ,tS as b_,ol as ba,av as bb,al as bc,bC as bd,SC as be,gC as bf,pC as bg,yC as bh,ev as bi,wC as bj,EC as bk,sv as bl,lv as bm,PC as bn,_C as bo,ll as bp,TC as bq,Ev as br,pv as bs,_v as bt,Ly as bu,x as bv,Fn as bw,DC as bx,Ip as by,FC as bz,C as c,nS as c0,Ob as c1,Bl as c2,Ea as c3,ui as c4,kg as c5,gp as c6,$ as c7,Vi as c8,oS as c9,gb as cA,hf as cB,Ry as cC,Fy as cD,Jr as cE,Us as cF,CC as cG,Vn as cH,li as ca,by as cb,Sb as cc,my as cd,gs as ce,Ay as cf,sr as cg,bs as ch,QC as ci,xn as cj,UC as ck,VC as cl,KC as cm,WC as cn,$l as co,HC as cp,eS as cq,BC as cr,ht as cs,Hl as ct,XC as cu,YC as cv,JC as cw,it as cx,Sr as cy,zC as cz,Cs as d,vc as e,qy as f,Gy as g,Zy as h,Vy as i,Yy as j,Qy as k,Jy as l,eC as m,tC as n,sc as o,zy as p,ge as q,ce as r,qt as s,Xe as t,Qh as u,nC as v,Hy as w,Xy as x,MC as y,rC as z};
22
+ //# sourceMappingURL=ControlType-101b91d6.js.map