@deephaven/code-studio 1.27.0 → 1.27.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (49) hide show
  1. package/build/assets/{AppRoot-BJiEOnck.js → AppRoot-BWFoMdei.js} +7 -7
  2. package/build/assets/{AppRoot-BJiEOnck.js.map → AppRoot-BWFoMdei.js.map} +1 -1
  3. package/build/assets/{Chart-Bk06tBmK.js → Chart-Du1wbqmT.js} +2 -2
  4. package/build/assets/{Chart-Bk06tBmK.js.map → Chart-Du1wbqmT.js.map} +1 -1
  5. package/build/assets/{ControlType-FgZ4S3v5.js → ControlType-CYwm2wcX.js} +5 -5
  6. package/build/assets/{ControlType-FgZ4S3v5.js.map → ControlType-CYwm2wcX.js.map} +1 -1
  7. package/build/assets/{FormatterUtils-2cpCmHL7.js → FormatterUtils-C5Z9ArAc.js} +2 -2
  8. package/build/assets/{FormatterUtils-2cpCmHL7.js.map → FormatterUtils-C5Z9ArAc.js.map} +1 -1
  9. package/build/assets/{Grid-fWiKabGX.js → Grid-XeWuqsQs.js} +2 -2
  10. package/build/assets/{Grid-fWiKabGX.js.map → Grid-XeWuqsQs.js.map} +1 -1
  11. package/build/assets/{IrisGrid-CW6QLKDx.js → IrisGrid-olgxc1Mt.js} +2 -2
  12. package/build/assets/{IrisGrid-CW6QLKDx.js.map → IrisGrid-olgxc1Mt.js.map} +1 -1
  13. package/build/assets/{IrisGridModel-Br5AXB6I.js → IrisGridModel-BUu3QKbv.js} +4 -4
  14. package/build/assets/{IrisGridModel-Br5AXB6I.js.map → IrisGridModel-BUu3QKbv.js.map} +1 -1
  15. package/build/assets/{IrisGridShortcuts-DfzzweUJ.js → IrisGridShortcuts-DdkDE4fB.js} +2 -2
  16. package/build/assets/{IrisGridShortcuts-DfzzweUJ.js.map → IrisGridShortcuts-DdkDE4fB.js.map} +1 -1
  17. package/build/assets/{LocalWorkspaceStorage-D6cPle9v.js → LocalWorkspaceStorage-COngkbKW.js} +2 -2
  18. package/build/assets/{LocalWorkspaceStorage-D6cPle9v.js.map → LocalWorkspaceStorage-COngkbKW.js.map} +1 -1
  19. package/build/assets/{MarkdownEditor-DLLrid9j.js → MarkdownEditor-OQ5NBiZe.js} +2 -2
  20. package/build/assets/{MarkdownEditor-DLLrid9j.js.map → MarkdownEditor-OQ5NBiZe.js.map} +1 -1
  21. package/build/assets/{MarkdownNotebook-BaRDz2Vu.js → MarkdownNotebook-CJJEAE11.js} +2 -2
  22. package/build/assets/{MarkdownNotebook-BaRDz2Vu.js.map → MarkdownNotebook-CJJEAE11.js.map} +1 -1
  23. package/build/assets/{MissingPartitionError-DhX7Mw8E.js → MissingPartitionError-Bj4Xem01.js} +2 -2
  24. package/build/assets/{MissingPartitionError-DhX7Mw8E.js.map → MissingPartitionError-Bj4Xem01.js.map} +1 -1
  25. package/build/assets/{MockChartModel-DIZkwf3K.js → MockChartModel-DV9ydyas.js} +2 -2
  26. package/build/assets/{MockChartModel-DIZkwf3K.js.map → MockChartModel-DV9ydyas.js.map} +1 -1
  27. package/build/assets/{PasteKeyHandler-DvBGfJmw.js → PasteKeyHandler-Ck2AFur4.js} +2 -2
  28. package/build/assets/{PasteKeyHandler-DvBGfJmw.js.map → PasteKeyHandler-Ck2AFur4.js.map} +1 -1
  29. package/build/assets/{Picker-BJxhc3mz.js → Picker-BVLQSkTB.js} +2 -2
  30. package/build/assets/{Picker-BJxhc3mz.js.map → Picker-BVLQSkTB.js.map} +1 -1
  31. package/build/assets/Plot-BCCHsuro.js +2 -0
  32. package/build/assets/{Plot-FV1P3wLe.js.map → Plot-BCCHsuro.js.map} +1 -1
  33. package/build/assets/{Plotly-BuZ884kN.js → Plotly-DxwcK67z.js} +2 -2
  34. package/build/assets/{Plotly-BuZ884kN.js.map → Plotly-DxwcK67z.js.map} +1 -1
  35. package/build/assets/{StyleGuideRoot-D6d1EpK9.js → StyleGuideRoot-DYJxg_qU.js} +2 -2
  36. package/build/assets/{StyleGuideRoot-D6d1EpK9.js.map → StyleGuideRoot-DYJxg_qU.js.map} +1 -1
  37. package/build/assets/{index-DOXtFZnK.js → index-B_MHaI8c.js} +25 -25
  38. package/build/assets/index-B_MHaI8c.js.map +1 -0
  39. package/build/assets/{index-gFVLtnGV.js → index-CYdLgoLi.js} +2 -2
  40. package/build/assets/{index-gFVLtnGV.js.map → index-CYdLgoLi.js.map} +1 -1
  41. package/build/assets/{index-Ci17vHKd.js → index-z-QlyugG.js} +3 -3
  42. package/build/assets/{index-Ci17vHKd.js.map → index-z-QlyugG.js.map} +1 -1
  43. package/build/assets/plotly-C8gv80ZK.js +7 -0
  44. package/build/assets/{plotly-B4USo6Aa.js.map → plotly-C8gv80ZK.js.map} +1 -1
  45. package/build/index.html +2 -2
  46. package/package.json +4 -4
  47. package/build/assets/Plot-FV1P3wLe.js +0 -2
  48. package/build/assets/index-DOXtFZnK.js.map +0 -1
  49. package/build/assets/plotly-B4USo6Aa.js +0 -7
@@ -1,5 +1,5 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./Plot-FV1P3wLe.js","./Plotly-BuZ884kN.js","./plotly-B4USo6Aa.js","./helpers-BosuxZz1.js","./vendor-COaLsbSW.js","./vendor-V6ynCsSj.css","./MarkdownNotebook-BaRDz2Vu.js","./index-Ci17vHKd.js","./monaco-DaE0jI-i.js","./monaco-CgHo24-M.css","./index-DzwhTd8W.css","./mathjax-CwMmYiH-.js","./MarkdownNotebook-CmpkKxys.css"])))=>i.map(i=>d[i]);
2
- import{r as f,a0 as Nn,bG as li,I as c,bL as Vd,U,K as q,bM as Dl,ac as Fi,L as Ml,R as ui,bN as Kd,bO as zd,M as Ce,H as Nt,bP as Gd,a8 as qd,a9 as Xd,G as kl,a1 as zn,bQ as Zd,bR as Yd,aw as jo,bS as Qd,bT as Jd,bJ as br,bU as ec,a6 as tc,a5 as nc,bF as Lo,bV as rc,bW as ic,ad as fn,bX as fr,bY as A,bZ as Fo,bK as Te,a3 as ao,af as Al,b_ as oc,_ as ir}from"./vendor-COaLsbSW.js";import{aB as Nl,L as z,aZ as jl,W as Ll,ai as ac,aj as sc,ah as lc,ar as uc,ad as dc,$ as cc,aw as hc,M as Fl,b as Rl,c as $l,aK as mc,a_ as fc,a$ as Hl,b0 as Bl,b1 as vc,b2 as pc,N as jn,aA as gc,e as W,b3 as bc,b4 as yc,b5 as Sc,b6 as Cc,b7 as wc,b8 as _c,b9 as Ec,ba as Pc,bb as Tc,bc as Oc,bd as Ic,E as Wl,aY as xc,aV as Ul,aW as Dc,a3 as Vl,k as Mc,d as Ri,be as kc,bf as Ac,au as Kl,bg as Ro,bh as Nc,bi as jc,bj as Lc,bk as Fc,f as zl,aO as Gl,bl as ql,bm as Yn,aU as Rc,bn as $c,H as $o,bo as $i,q as Ho,bp as Xl,bq as Hc,K as Bc,ak as Wc,br as Uc,C as Vc,al as Kc,bs as zc,bt as Gc,bu as qc,bv as Xc,bw as Zc,bx as Yc,by as Bo,aQ as Wo,bz as Qc,bA as Jc}from"./index-Ci17vHKd.js";import{e as He,M as eh,b as Uo,l as vt,R as Zl,K as ft,c as vn,d as Vo,U as th,_ as Yl}from"./monaco-DaE0jI-i.js";var Ql=Object.freeze([]),Bw=new Map,Jl=()=>{};function Ww(n){return Array.isArray(n)?n:[n]}function _i(){for(var n=arguments.length,e=new Array(n),t=0;t<n;t++)e[t]=arguments[t];return e.filter(r=>r!=null)}function nh(n,e,t){return(e=rh(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function rh(n){var e=ih(n,"string");return typeof e=="symbol"?e:e+""}function ih(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class Ko extends Error{constructor(){super(...arguments),nh(this,"isCanceled",!0)}}function oh(n){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,t=ah(n,e);t.forEach(r=>{n[r]=n[r].bind(n)})}function ah(n,e){for(var t=new Set,r=n,i=0;r!=null&&r!==Object.prototype&&(i<=1||e);){for(var o of Object.getOwnPropertyNames(r)){var a;o!=="constructor"&&typeof((a=Object.getOwnPropertyDescriptor(r,o))===null||a===void 0?void 0:a.value)=="function"&&t.add(o)}r=Object.getPrototypeOf(r),i+=1}return[...t.keys()]}function sh(n,e,t){return(e=lh(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function lh(n){var e=uh(n,"string");return typeof e=="symbol"?e:e+""}function uh(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class dh extends Error{constructor(){super(...arguments),sh(this,"isClipboardPermissionsDeniedError",!0)}}function ch(n,e,t){return(e=hh(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function hh(n){var e=mh(n,"string");return typeof e=="symbol"?e:e+""}function mh(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class Ei extends Error{constructor(){super(...arguments),ch(this,"isClipboardUnavailableError",!0)}}function fh(n,e,t){return(e=vh(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function vh(n){var e=ph(n,"string");return typeof e=="symbol"?e:e+""}function ph(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class eu extends Error{constructor(){super(...arguments),fh(this,"isPermissionUnsupported",!0)}}function zo(n,e,t,r,i,o,a){try{var s=n[o](a),l=s.value}catch(u){return void t(u)}s.done?e(l):Promise.resolve(l).then(r,i)}function gh(n){return function(){var e=this,t=arguments;return new Promise(function(r,i){var o=n.apply(e,t);function a(l){zo(o,r,i,a,s,"next",l)}function s(l){zo(o,r,i,a,s,"throw",l)}a(void 0)})}}function Go(n){return Hi.apply(this,arguments)}function Hi(){return Hi=gh(function*(n){try{var e=n;return(yield navigator.permissions.query({name:e})).state}catch(t){throw t instanceof TypeError?new eu:t}}),Hi.apply(this,arguments)}function qo(n,e,t,r,i,o,a){try{var s=n[o](a),l=s.value}catch(u){return void t(u)}s.done?e(l):Promise.resolve(l).then(r,i)}function tu(n){return function(){var e=this,t=arguments;return new Promise(function(r,i){var o=n.apply(e,t);function a(l){qo(o,r,i,a,s,"next",l)}function s(l){qo(o,r,i,a,s,"throw",l)}a(void 0)})}}function nu(n){return Bi.apply(this,arguments)}function Bi(){return Bi=tu(function*(n){var e=navigator,t=e.clipboard;if(t!==void 0)try{return yield navigator.clipboard.writeText(n)}catch{}bh(n)}),Bi.apply(this,arguments)}function bh(n){var e=document.activeElement,t=document.createElement("textarea");t.value=n,document.body.appendChild(t),t.focus(),t.select();var r=document.execCommand("copy");if(document.body.removeChild(t),e instanceof HTMLElement&&e.focus(),!r)throw new Error("Unable to execute copy command")}function Uw(){return Wi.apply(this,arguments)}function Wi(){return Wi=tu(function*(){try{var n=navigator,e=n.clipboard;if(e===void 0)throw new Ei;var t=yield Go("clipboard-read");if(t==="granted"){var r=yield e.readText();return r}if(t==="prompt"){try{yield e.readText()}catch{}if(t=yield Go("clipboard-read"),t==="granted"){var i=yield e.readText();return i}}if(t==="prompt"||t==="denied")throw new dh}catch(o){throw o instanceof eu?new Ei:o}throw new Ei}),Wi.apply(this,arguments)}var or;function Ln(n,e,t){return(e=yh(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function yh(n){var e=Sh(n,"string");return typeof e=="symbol"?e:e+""}function Sh(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var Ch="table_",ru="column_",wh=new Set(["in","not","i","ii","k"]),_h=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"]),Eh=/[^a-zA-Z0-9_$\-+@]/g,Ph=/[^A-Za-z0-9_$]/g,Th=/^[a-zA-Z_$][a-zA-Z0-9_$\-+@]*$/,Oh=/[^a-zA-Z0-9_]/g;function Ih(n){return n.replace(/[ -]/g,"_")}function xh(n){return n.replace(/\s/g,"_")}class Ft{}or=Ft;Ln(Ft,"legalize",(n,e,t,r,i,o)=>{var a=e(n.trim());return i&&(wh.has(a)||_h.has(a))&&(a=t+a),a=a.replace(r,""),a?(/^[0-9-]/.test(a)&&(a=t+a),a):t+o});Ln(Ft,"legalizeTableName",n=>or.legalize(n,xh,Ch,Eh,!1,0));Ln(Ft,"makeVariableName",n=>or.legalizeTableName(n).replace(Oh,"_"));Ln(Ft,"legalizeColumnNames",n=>{var e=[];return n.forEach((t,r)=>{var i=or.legalizeColumnName(t,r);e.includes(i)&&(i=ru+r),e.push(i)}),e});Ln(Ft,"legalizeColumnName",function(n){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return or.legalize(n,Ih,ru,Ph,!0,e)});Ln(Ft,"isValidTableName",n=>Th.test(n));Ln(Ft,"isValidColumnName",n=>or.legalizeColumnName(n)===n);class iu extends CustomEvent{constructor(e,t){super(e,t)}}class je{static makeCancelable(e,t){var r=!1,i,o,a=new Promise((s,l)=>{o=l,Promise.resolve(e).then(u=>{r?t&&t(u):(i=u,s(u))}).catch(u=>l(u))});return a.cancel=()=>{r=!0,o(new Ko),i!=null&&t&&t(i)},a}static isCanceled(e){return e instanceof Ko}static isTimedOut(e){return e instanceof Nl}static withTimeout(e,t){return new Promise((r,i)=>{setTimeout(()=>{try{r(t())}catch(o){i(o)}},e)})}}function Xo(n,e,t){return(e=Dh(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Dh(n){var e=Mh(n,"string");return typeof e=="symbol"?e:e+""}function Mh(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class wr{constructor(){Xo(this,"pending",[]),Xo(this,"resolved",[])}add(e,t){var r=je.makeCancelable(e,t);return this.pending.push(r),r.then(()=>{this.resolve(r)},()=>{this.resolve(r)}),r}remove(e){for(var t=0;t<this.pending.length;t+=1)if(this.pending[t]===e){this.pending.splice(t,1);return}}resolve(e){this.remove(e),this.resolved.push(e)}cancel(){for(var e=[...this.pending,...this.resolved],t=0;t<e.length;t+=1)e[t].cancel();this.pending=[],this.resolved=[]}}function Vw(n){var e=n;n instanceof CustomEvent&&(e=n.detail);var t="";if(e instanceof Error?t=e.message:e!=null&&(t="".concat(e)),t=t.trim(),t.length>0)return t}function Zo(n,e){return jh(n)||Nh(n,e)||Ah(n,e)||kh()}function kh(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./Plot-BCCHsuro.js","./Plotly-DxwcK67z.js","./plotly-C8gv80ZK.js","./helpers-BosuxZz1.js","./vendor-COaLsbSW.js","./vendor-V6ynCsSj.css","./MarkdownNotebook-CJJEAE11.js","./index-z-QlyugG.js","./monaco-DaE0jI-i.js","./monaco-CgHo24-M.css","./index-DzwhTd8W.css","./mathjax-CwMmYiH-.js","./MarkdownNotebook-CmpkKxys.css"])))=>i.map(i=>d[i]);
2
+ import{r as f,a0 as Nn,bG as li,I as c,bL as Vd,U,K as q,bM as Dl,ac as Fi,L as Ml,R as ui,bN as Kd,bO as zd,M as Ce,H as Nt,bP as Gd,a8 as qd,a9 as Xd,G as kl,a1 as zn,bQ as Zd,bR as Yd,aw as jo,bS as Qd,bT as Jd,bJ as br,bU as ec,a6 as tc,a5 as nc,bF as Lo,bV as rc,bW as ic,ad as fn,bX as fr,bY as A,bZ as Fo,bK as Te,a3 as ao,af as Al,b_ as oc,_ as ir}from"./vendor-COaLsbSW.js";import{aB as Nl,L as z,aZ as jl,W as Ll,ai as ac,aj as sc,ah as lc,ar as uc,ad as dc,$ as cc,aw as hc,M as Fl,b as Rl,c as $l,aK as mc,a_ as fc,a$ as Hl,b0 as Bl,b1 as vc,b2 as pc,N as jn,aA as gc,e as W,b3 as bc,b4 as yc,b5 as Sc,b6 as Cc,b7 as wc,b8 as _c,b9 as Ec,ba as Pc,bb as Tc,bc as Oc,bd as Ic,E as Wl,aY as xc,aV as Ul,aW as Dc,a3 as Vl,k as Mc,d as Ri,be as kc,bf as Ac,au as Kl,bg as Ro,bh as Nc,bi as jc,bj as Lc,bk as Fc,f as zl,aO as Gl,bl as ql,bm as Yn,aU as Rc,bn as $c,H as $o,bo as $i,q as Ho,bp as Xl,bq as Hc,K as Bc,ak as Wc,br as Uc,C as Vc,al as Kc,bs as zc,bt as Gc,bu as qc,bv as Xc,bw as Zc,bx as Yc,by as Bo,aQ as Wo,bz as Qc,bA as Jc}from"./index-z-QlyugG.js";import{e as He,M as eh,b as Uo,l as vt,R as Zl,K as ft,c as vn,d as Vo,U as th,_ as Yl}from"./monaco-DaE0jI-i.js";var Ql=Object.freeze([]),Bw=new Map,Jl=()=>{};function Ww(n){return Array.isArray(n)?n:[n]}function _i(){for(var n=arguments.length,e=new Array(n),t=0;t<n;t++)e[t]=arguments[t];return e.filter(r=>r!=null)}function nh(n,e,t){return(e=rh(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function rh(n){var e=ih(n,"string");return typeof e=="symbol"?e:e+""}function ih(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class Ko extends Error{constructor(){super(...arguments),nh(this,"isCanceled",!0)}}function oh(n){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,t=ah(n,e);t.forEach(r=>{n[r]=n[r].bind(n)})}function ah(n,e){for(var t=new Set,r=n,i=0;r!=null&&r!==Object.prototype&&(i<=1||e);){for(var o of Object.getOwnPropertyNames(r)){var a;o!=="constructor"&&typeof((a=Object.getOwnPropertyDescriptor(r,o))===null||a===void 0?void 0:a.value)=="function"&&t.add(o)}r=Object.getPrototypeOf(r),i+=1}return[...t.keys()]}function sh(n,e,t){return(e=lh(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function lh(n){var e=uh(n,"string");return typeof e=="symbol"?e:e+""}function uh(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class dh extends Error{constructor(){super(...arguments),sh(this,"isClipboardPermissionsDeniedError",!0)}}function ch(n,e,t){return(e=hh(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function hh(n){var e=mh(n,"string");return typeof e=="symbol"?e:e+""}function mh(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class Ei extends Error{constructor(){super(...arguments),ch(this,"isClipboardUnavailableError",!0)}}function fh(n,e,t){return(e=vh(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function vh(n){var e=ph(n,"string");return typeof e=="symbol"?e:e+""}function ph(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class eu extends Error{constructor(){super(...arguments),fh(this,"isPermissionUnsupported",!0)}}function zo(n,e,t,r,i,o,a){try{var s=n[o](a),l=s.value}catch(u){return void t(u)}s.done?e(l):Promise.resolve(l).then(r,i)}function gh(n){return function(){var e=this,t=arguments;return new Promise(function(r,i){var o=n.apply(e,t);function a(l){zo(o,r,i,a,s,"next",l)}function s(l){zo(o,r,i,a,s,"throw",l)}a(void 0)})}}function Go(n){return Hi.apply(this,arguments)}function Hi(){return Hi=gh(function*(n){try{var e=n;return(yield navigator.permissions.query({name:e})).state}catch(t){throw t instanceof TypeError?new eu:t}}),Hi.apply(this,arguments)}function qo(n,e,t,r,i,o,a){try{var s=n[o](a),l=s.value}catch(u){return void t(u)}s.done?e(l):Promise.resolve(l).then(r,i)}function tu(n){return function(){var e=this,t=arguments;return new Promise(function(r,i){var o=n.apply(e,t);function a(l){qo(o,r,i,a,s,"next",l)}function s(l){qo(o,r,i,a,s,"throw",l)}a(void 0)})}}function nu(n){return Bi.apply(this,arguments)}function Bi(){return Bi=tu(function*(n){var e=navigator,t=e.clipboard;if(t!==void 0)try{return yield navigator.clipboard.writeText(n)}catch{}bh(n)}),Bi.apply(this,arguments)}function bh(n){var e=document.activeElement,t=document.createElement("textarea");t.value=n,document.body.appendChild(t),t.focus(),t.select();var r=document.execCommand("copy");if(document.body.removeChild(t),e instanceof HTMLElement&&e.focus(),!r)throw new Error("Unable to execute copy command")}function Uw(){return Wi.apply(this,arguments)}function Wi(){return Wi=tu(function*(){try{var n=navigator,e=n.clipboard;if(e===void 0)throw new Ei;var t=yield Go("clipboard-read");if(t==="granted"){var r=yield e.readText();return r}if(t==="prompt"){try{yield e.readText()}catch{}if(t=yield Go("clipboard-read"),t==="granted"){var i=yield e.readText();return i}}if(t==="prompt"||t==="denied")throw new dh}catch(o){throw o instanceof eu?new Ei:o}throw new Ei}),Wi.apply(this,arguments)}var or;function Ln(n,e,t){return(e=yh(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function yh(n){var e=Sh(n,"string");return typeof e=="symbol"?e:e+""}function Sh(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var Ch="table_",ru="column_",wh=new Set(["in","not","i","ii","k"]),_h=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"]),Eh=/[^a-zA-Z0-9_$\-+@]/g,Ph=/[^A-Za-z0-9_$]/g,Th=/^[a-zA-Z_$][a-zA-Z0-9_$\-+@]*$/,Oh=/[^a-zA-Z0-9_]/g;function Ih(n){return n.replace(/[ -]/g,"_")}function xh(n){return n.replace(/\s/g,"_")}class Ft{}or=Ft;Ln(Ft,"legalize",(n,e,t,r,i,o)=>{var a=e(n.trim());return i&&(wh.has(a)||_h.has(a))&&(a=t+a),a=a.replace(r,""),a?(/^[0-9-]/.test(a)&&(a=t+a),a):t+o});Ln(Ft,"legalizeTableName",n=>or.legalize(n,xh,Ch,Eh,!1,0));Ln(Ft,"makeVariableName",n=>or.legalizeTableName(n).replace(Oh,"_"));Ln(Ft,"legalizeColumnNames",n=>{var e=[];return n.forEach((t,r)=>{var i=or.legalizeColumnName(t,r);e.includes(i)&&(i=ru+r),e.push(i)}),e});Ln(Ft,"legalizeColumnName",function(n){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return or.legalize(n,Ih,ru,Ph,!0,e)});Ln(Ft,"isValidTableName",n=>Th.test(n));Ln(Ft,"isValidColumnName",n=>or.legalizeColumnName(n)===n);class iu extends CustomEvent{constructor(e,t){super(e,t)}}class je{static makeCancelable(e,t){var r=!1,i,o,a=new Promise((s,l)=>{o=l,Promise.resolve(e).then(u=>{r?t&&t(u):(i=u,s(u))}).catch(u=>l(u))});return a.cancel=()=>{r=!0,o(new Ko),i!=null&&t&&t(i)},a}static isCanceled(e){return e instanceof Ko}static isTimedOut(e){return e instanceof Nl}static withTimeout(e,t){return new Promise((r,i)=>{setTimeout(()=>{try{r(t())}catch(o){i(o)}},e)})}}function Xo(n,e,t){return(e=Dh(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Dh(n){var e=Mh(n,"string");return typeof e=="symbol"?e:e+""}function Mh(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class wr{constructor(){Xo(this,"pending",[]),Xo(this,"resolved",[])}add(e,t){var r=je.makeCancelable(e,t);return this.pending.push(r),r.then(()=>{this.resolve(r)},()=>{this.resolve(r)}),r}remove(e){for(var t=0;t<this.pending.length;t+=1)if(this.pending[t]===e){this.pending.splice(t,1);return}}resolve(e){this.remove(e),this.resolved.push(e)}cancel(){for(var e=[...this.pending,...this.resolved],t=0;t<e.length;t+=1)e[t].cancel();this.pending=[],this.resolved=[]}}function Vw(n){var e=n;n instanceof CustomEvent&&(e=n.detail);var t="";if(e instanceof Error?t=e.message:e!=null&&(t="".concat(e)),t=t.trim(),t.length>0)return t}function Zo(n,e){return jh(n)||Nh(n,e)||Ah(n,e)||kh()}function kh(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
3
3
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Ah(n,e){if(n){if(typeof n=="string")return Yo(n,e);var t={}.toString.call(n).slice(8,-1);return t==="Object"&&n.constructor&&(t=n.constructor.name),t==="Map"||t==="Set"?Array.from(n):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?Yo(n,e):void 0}}function Yo(n,e){(e==null||e>n.length)&&(e=n.length);for(var t=0,r=Array(e);t<e;t++)r[t]=n[t];return r}function Nh(n,e){var t=n==null?null:typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(t!=null){var r,i,o,a,s=[],l=!0,u=!1;try{if(o=(t=t.call(n)).next,e!==0)for(;!(l=(r=o.call(t)).done)&&(s.push(r.value),s.length!==e);l=!0);}catch(d){u=!0,i=d}finally{try{if(!l&&t.return!=null&&(a=t.return(),Object(a)!==a))return}finally{if(u)throw i}}return s}}function jh(n){if(Array.isArray(n))return n}class Pt{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(!Pt.isValidRange(e))throw new Error("Invalid range! ".concat(e))}static isSelected(e,t){for(var r=0;r<e.length;r+=1){var i=e[r],o=i[0],a=i[1];if(o<=t&&t<=a)return!0}return!1}static selectRange(e,t){for(var r=Zo(t,2),i=r[0],o=r[1],a=[...e],s=a.length-1;s>=0;s-=1){var l=a[s],u=l[0],d=l[1];if(u<=i&&o<=d)return a;i<=d&&u<=o&&(i=Math.min(i,u),o=Math.max(o,d),a.splice(s,1))}return a.push([i,o]),a}static deselectRange(e,t){for(var r=Zo(t,2),i=r[0],o=r[1],a=[...e],s=a.length-1;s>=0;s-=1){var l=a[s],u=l[0],d=l[1];if(!(o<u||d<i))if(u<i&&o<d){a[s]=[u,i-1],a.splice(s+1,0,[o+1,d]);break}else i<=u&&d<=o?a.splice(s,1):u<i?a[s]=[u,i-1]:a[s]=[o+1,d]}return a}static count(e){return e.reduce((t,r)=>t+(r[1]-r[0]+1),0)}static getItemsInRanges(e,t){return t.reduce((r,i)=>{for(var o=[...r],a=i[0];a<=i[1];a+=1)o.push(e[a]);return o},[])}}function*Kw(n,e){for(var t=n;t<=e;++t)yield t}var zw=" ";class ou{static join(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"and";if(e==null||e.length===0)return"";if(e.length===1)return e[0];if(e.length===2)return"".concat(e[0]," ").concat(t," ").concat(e[1]);var r=e.slice(0,e.length-1).join(", "),i=e[e.length-1];return"".concat(r,", ").concat(t," ").concat(i)}static toLower(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;if(e==null){if(t)return"";throw new Error("Null string passed in to TextUtils.toLower")}return e.toLowerCase()}static sort(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;return e<t?r?-1:1:e>t?r?1:-1:0}static pluralize(e,t,r){return e===1?t:r??"".concat(t,"s")}}var _r;function gn(n,e,t){return(e=Lh(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Lh(n){var e=Fh(n,"string");return typeof e=="symbol"?e:e+""}function Fh(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class rt{static formatElapsedTime(e){if(typeof e!="number"||!Number.isInteger(e))throw new Error("".concat(e," is not a number that can be expressed as a formatted time"));var t=Math.floor(e/3600),r=Math.floor(e%3600/60),i=e%60;return"".concat(t>0?"".concat(t,"h "):"")+"".concat(r>0||t>0?"".concat(r,"m "):"")+"".concat(e>=60?"".concat(i,"s").padStart(3,"0"):"".concat(i,"s"))}static formatTime(e){if(typeof e!="number"||!Number.isInteger(e)||e<0)throw new Error("".concat(e," is not a number that can be expressed as a formatted time"));var t=String(Math.floor(e/(60*60))).padStart(2,"0"),r=e%(60*60),i=String(Math.floor(r/60)).padStart(2,"0"),o=r%60,a=String(Math.ceil(o)).padStart(2,"0");return"".concat(t,":").concat(i,":").concat(a)}static isTimeString(e){return new RegExp(rt.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])}static formatDuration(e){var t=Math.floor(e/3600),r=Math.floor(e%3600/60),i=e%60;return t>0?"".concat(t,"h ").concat(r,"m ").concat(i,"s"):r>0?"".concat(r,"m ").concat(i.toFixed(1),"s"):"".concat(i.toFixed(2),"s")}static formatConvertedDuration(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"ms";if(e==null||t===""||t===0||t==null)return null;var i=1,o=null,a=null;if(r==="ms")i=1e3,o=new Date(e).valueOf(),a=new Date(t).valueOf();else if(r==="ns")i=1e9,o=Number(e),a=Number(t);else return null;var s=(a-o)/i;return this.formatDuration(s)}}_r=rt;gn(rt,"TIME_PATTERN","([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]");gn(rt,"MILLIS_PER_SECOND",1e3);gn(rt,"NANOS_PER_SECOND",1e9);gn(rt,"NANOS_PER_MIN",60*_r.NANOS_PER_SECOND);gn(rt,"NANOS_PER_HOUR",60*_r.NANOS_PER_MIN);gn(rt,"MILLIS_PER_MIN",60*_r.MILLIS_PER_SECOND);gn(rt,"MILLIS_PER_HOUR",60*_r.MILLIS_PER_MIN);gn(rt,"TIME_ZONES",Object.freeze([{label:"Tokyo UTC+9 No DST",value:"Asia/Tokyo"},{label:"Seoul UTC+9 No DST",value:"Asia/Seoul"},{label:"Hong Kong UTC+8 No DST",value:"Asia/Hong_Kong"},{label:"Singapore UTC+8 No DST",value:"Asia/Singapore"},{label:"Kolkata UTC+5:30 No DST",value:"Asia/Kolkata"},{label:"Berlin UTC+1",value:"Europe/Berlin"},{label:"UTC UTC±0 No DST",value:"UTC"},{label:"London UTC±0",value:"Europe/London"},{label:"Sao Paulo UTC-2",value:"America/Sao_Paulo"},{label:"Newfoundland UTC-3:30",value:"America/St_Johns"},{label:"Halifax UTC-4",value:"America/Halifax"},{label:"New York UTC−5",value:"America/New_York"},{label:"Chicago UTC-6",value:"America/Chicago"},{label:"Denver UTC-7",value:"America/Denver"},{label:"Los Angeles UTC-8",value:"America/Los_Angeles"},{label:"Anchorage UTC-9",value:"America/Anchorage"},{label:"Honolulu UTC-10 No DST",value:"Pacific/Honolulu"},{label:"Zurich UTC+1",value:"Europe/Zurich"},{label:"Amsterdam UTC+1",value:"Europe/Amsterdam"},{label:"Taipei UTC+8 No DST",value:"Asia/Taipei"},{label:"Sydney UTC+10",value:"Australia/Sydney"}]));function Rh(n,e,t){return(e=$h(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function $h(n){var e=Hh(n,"string");return typeof e=="symbol"?e:e+""}function Hh(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class vr extends Error{constructor(){super(...arguments),Rh(this,"isInvalid",!0)}}function au(){var n=f.useRef(!1);return f.useEffect(()=>(n.current=!0,()=>{n.current=!1}),[]),n}function Qo(n,e,t,r,i,o,a){try{var s=n[o](a),l=s.value}catch(u){return void t(u)}s.done?e(l):Promise.resolve(l).then(r,i)}function Bh(n){return function(){var e=this,t=arguments;return new Promise(function(r,i){var o=n.apply(e,t);function a(l){Qo(o,r,i,a,s,"next",l)}function s(l){Qo(o,r,i,a,s,"throw",l)}a(void 0)})}}var Wh=z.module("useAsyncInterval");function Uh(n,e){var t=au(),r=f.useRef(0),i=f.useRef(0),o=f.useRef(null),a=f.useCallback(Bh(function*(){var s=Date.now();i.current+=1;var l=o.current==null?e:s-o.current;o.current=s;try{yield n()}catch(h){Wh.error("A tick error occurred:",h)}if(t.current){l+=Date.now()-o.current;var u=Math.max(0,l-e),d=Math.max(0,e-u);r.current=window.setTimeout(a,d)}}),[n,t,e]);f.useEffect(()=>(o.current=null,a(),()=>{window.clearTimeout(r.current)}),[e,a])}function Er(n){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"No value available in context. Was code wrapped in a provider?",t=f.useContext(n);if(t==null)throw new Error(e);return t}function Vh(n,e){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},r=t.leading,i=r===void 0?!1:r,o=t.trailing,a=o===void 0?!0:o,s=t.maxWait,l=f.useMemo(()=>Nn(n,e,s!=null?{leading:i,trailing:a,maxWait:s}:{leading:i,trailing:a}),[n,e,i,a,s]);return f.useEffect(()=>()=>l.cancel(),[l]),l}function Kh(n){var e=f.useRef();return f.useEffect(function(){e.current=n}),e.current}function zh(n,e,t){var r=f.useRef(t),i=f.useRef(n);i.current=n;var o=f.useMemo(()=>li(function(){return i.current(...arguments)},e,r.current),[e]);return f.useEffect(()=>()=>{var a,s;(a=(s=r.current)===null||s===void 0?void 0:s.flushOnUnmount)!==null&&a!==void 0&&a?o.flush():o.cancel()},[o]),o}function su(n){var e=f.useRef(null);return f.useEffect(function(){n&&(typeof n=="function"?n(e.current):n.current=e.current)}),e}function Gh(n,e){return Yh(n)||Zh(n,e)||Xh(n,e)||qh()}function qh(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
4
4
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Xh(n,e){if(n){if(typeof n=="string")return Jo(n,e);var t={}.toString.call(n).slice(8,-1);return t==="Object"&&n.constructor&&(t=n.constructor.name),t==="Map"||t==="Set"?Array.from(n):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?Jo(n,e):void 0}}function Jo(n,e){(e==null||e>n.length)&&(e=n.length);for(var t=0,r=Array(e);t<e;t++)r[t]=n[t];return r}function Zh(n,e){var t=n==null?null:typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(t!=null){var r,i,o,a,s=[],l=!0,u=!1;try{if(o=(t=t.call(n)).next,e!==0)for(;!(l=(r=o.call(t)).done)&&(s.push(r.value),s.length!==e);l=!0);}catch(d){u=!0,i=d}finally{try{if(!l&&t.return!=null&&(a=t.return(),Object(a)!==a))return}finally{if(u)throw i}}return s}}function Yh(n){if(Array.isArray(n))return n}var Qh=3500,Jh=z.module("useCopyToClipboard");function em(){var n=f.useState(!1),e=Gh(n,2),t=e[0],r=e[1],i=f.useRef(null),o=f.useCallback(a=>{nu(a).then(()=>{r(!0)}).catch(s=>Jh.error("Unable to copy ".concat(a),`
5
5
  `,s))},[]);return f.useEffect(()=>(i.current&&clearTimeout(i.current),t&&(i.current=setTimeout(()=>{r(!1)},Qh)),()=>{i.current&&clearTimeout(i.current)}),[t]),[t,o]}var tm=["gray-50","gray-75","gray-100","gray-200","gray-300","gray-400","gray-500","gray-600","gray-700","gray-800","gray-900","red-100","red-200","red-300","red-400","red-500","red-600","red-700","red-800","red-900","red-1000","red-1100","red-1200","red-1300","red-1400","orange-100","orange-200","orange-300","orange-400","orange-500","orange-600","orange-700","orange-800","orange-900","orange-1000","orange-1100","orange-1200","orange-1300","orange-1400","yellow-100","yellow-200","yellow-300","yellow-400","yellow-500","yellow-600","yellow-700","yellow-800","yellow-900","yellow-1000","yellow-1100","yellow-1200","yellow-1300","yellow-1400","chartreuse-100","chartreuse-200","chartreuse-300","chartreuse-400","chartreuse-500","chartreuse-600","chartreuse-700","chartreuse-800","chartreuse-900","chartreuse-1000","chartreuse-1100","chartreuse-1200","chartreuse-1300","chartreuse-1400","celery-100","celery-200","celery-300","celery-400","celery-500","celery-600","celery-700","celery-800","celery-900","celery-1000","celery-1100","celery-1200","celery-1300","celery-1400","green-100","green-200","green-300","green-400","green-500","green-600","green-700","green-800","green-900","green-1000","green-1100","green-1200","green-1300","green-1400","seafoam-100","seafoam-200","seafoam-300","seafoam-400","seafoam-500","seafoam-600","seafoam-700","seafoam-800","seafoam-900","seafoam-1000","seafoam-1100","seafoam-1200","seafoam-1300","seafoam-1400","cyan-100","cyan-200","cyan-300","cyan-400","cyan-500","cyan-600","cyan-700","cyan-800","cyan-900","cyan-1000","cyan-1100","cyan-1200","cyan-1300","cyan-1400","blue-100","blue-200","blue-300","blue-400","blue-500","blue-600","blue-700","blue-800","blue-900","blue-1000","blue-1100","blue-1200","blue-1300","blue-1400","indigo-100","indigo-200","indigo-300","indigo-400","indigo-500","indigo-600","indigo-700","indigo-800","indigo-900","indigo-1000","indigo-1100","indigo-1200","indigo-1300","indigo-1400","purple-100","purple-200","purple-300","purple-400","purple-500","purple-600","purple-700","purple-800","purple-900","purple-1000","purple-1100","purple-1200","purple-1300","purple-1400","fuchsia-100","fuchsia-200","fuchsia-300","fuchsia-400","fuchsia-500","fuchsia-600","fuchsia-700","fuchsia-800","fuchsia-900","fuchsia-1000","fuchsia-1100","fuchsia-1200","fuchsia-1300","fuchsia-1400","magenta-100","magenta-200","magenta-300","magenta-400","magenta-500","magenta-600","magenta-700","magenta-800","magenta-900","magenta-1000","magenta-1100","magenta-1200","magenta-1300","magenta-1400","negative","notice","positive","info","accent","accent-100","accent-200","accent-300","accent-400","accent-500","accent-600","accent-700","accent-800","accent-900","accent-1000","accent-1100","accent-1200","accent-1300","accent-1400","bg","content-bg","subdued-content-bg","surface-bg","fg"];function nm(n){return typeof n=="string"&&tm.includes(n)}function lu(n){return n!=null&&nm(n)?"var(--dh-color-".concat(n,")"):n}var rm=["color","UNSAFE_style"];function ea(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function jr(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?ea(Object(t),!0).forEach(function(r){im(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):ea(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function im(n,e,t){return(e=om(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function om(n){var e=am(n,"string");return typeof e=="symbol"?e:e+""}function am(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function sm(n,e){if(n==null)return{};var t,r,i=lm(n,e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(n);for(r=0;r<o.length;r++)t=o[r],e.indexOf(t)===-1&&{}.propertyIsEnumerable.call(n,t)&&(i[t]=n[t])}return i}function lm(n,e){if(n==null)return{};var t={};for(var r in n)if({}.hasOwnProperty.call(n,r)){if(e.indexOf(r)!==-1)continue;t[r]=n[r]}return t}var uu=f.forwardRef((n,e)=>{var t=n.color,r=n.UNSAFE_style,i=sm(n,rm),o=f.useMemo(()=>jr(jr({},r),{},{color:lu(t)}),[t,r]);return c.jsx(Vd,jr(jr({},i),{},{ref:e,UNSAFE_style:o}))});uu.displayName="Text";function ta(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function nn(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?ta(Object(t),!0).forEach(function(r){Gn(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):ta(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function Gn(n,e,t){return(e=um(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function um(n){var e=dm(n,"string");return typeof e=="symbol"?e:e+""}function dm(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var na="popper",cm="popper-container",hm={placement:"bottom-end",modifiers:{preventOverflow:{boundariesElement:"scrollParent",fn:(n,e)=>{var t,r,i=(t=Dl.Defaults.modifiers)===null||t===void 0||(t=t.preventOverflow)===null||t===void 0||(r=t.fn)===null||r===void 0?void 0:r.call(t,n,e);return i==null?n:(i.styles.maxHeight="".concat(document.documentElement.clientHeight-n.offsets.popper.top-2*e.padding,"px"),i??n)}},flip:{enabled:!1}}};class di extends f.Component{constructor(e){super(e),Gn(this,"element",void 0),Gn(this,"container",void 0),Gn(this,"nodeRef",U.createRef()),Gn(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.updateContainerClassName(e.containerClassName,e.isMaximized),this.container=U.createRef(),this.rAF=0;var t=this.props.isShown;this.state={show:t,popper:null}}componentDidUpdate(e){var t=this.props,r=t.isShown,i=t.containerClassName,o=t.isMaximized,a=this.state.popper;(e.containerClassName!==i||e.isMaximized!==o)&&this.updateContainerClassName(i,o),e.isShown!==r&&(cancelAnimationFrame(this.rAF),this.rAF=window.requestAnimationFrame(()=>{r?this.show():this.hide()})),a&&a.scheduleUpdate()}componentWillUnmount(){this.destroyPopper(!1)}updateContainerClassName(e,t){this.element.className=q(cm,e,{maximized:t})}getVisibleElement(e){return e==null||e.clientHeight>0||e.clientWidth>0?e:this.getVisibleElement(e.parentElement)}initPopper(){var e,t,r=this.state.popper,i=this.props,o=i.closeOnBlur,a=i.referenceObject;if(!r&&this.container.current!==null){var s=this.props,l=s.options,u=s.keepInParent,d=u?hm:{placement:"auto",modifiers:{preventOverflow:{boundariesElement:"viewport"}}},h=nn(nn(nn({},d),l),{},{modifiers:nn(nn(nn({},d.modifiers),l.modifiers),{},{preventOverflow:nn(nn({},(e=d.modifiers)===null||e===void 0?void 0:e.preventOverflow),(t=l.modifiers)===null||t===void 0?void 0:t.preventOverflow)})});document.body.appendChild(this.element);var m=this.getVisibleElement(this.container.current);m==null&&(m=this.container.current);var v=new Dl(a||m,this.element,h);v.scheduleUpdate(),cancelAnimationFrame(this.rAF),this.rAF=window.requestAnimationFrame(()=>{if(o){var p=this.element.querySelector(".".concat(na));p instanceof HTMLElement&&!p.contains(document.activeElement)&&p.focus()}}),Fi.flushSync(()=>{this.setState({popper:v})})}}destroyPopper(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;cancelAnimationFrame(this.rAF);var t=this.state.popper;t&&(t.destroy(),document.body.contains(this.element)&&document.body.removeChild(this.element),e&&this.setState({popper:null}))}show(){this.initPopper(),Fi.flushSync(()=>{this.setState({show:!0})})}hide(){this.setState({show:!1})}scheduleUpdate(){var e=this.state.popper;e&&e.scheduleUpdate()}handleBlur(e){var t=this.props,r=t.closeOnBlur,i=t.onBlur;e.relatedTarget instanceof HTMLElement&&(this.element.contains(e.relatedTarget)||(i==null||i(e),r&&this.hide()))}handleEnter(){var e=this.props.onEntered;e()}handleExit(){var e=this.props.onExited,t=this.state.show;t||this.destroyPopper(),e()}renderContent(){var e=this.props,t=e.className,r=e.children,i=e.timeout,o=e.interactive,a=e.closeOnBlur,s=this.state.show;return c.jsx(jl,{isPortal:!0,children:c.jsx(Ml,{in:s,timeout:i,classNames:"popper-transition",onEntered:this.handleEnter,onExited:this.handleExit,nodeRef:this.nodeRef,children:c.jsx("div",{ref:this.nodeRef,onClick:l=>{l.stopPropagation()},onKeyDown:l=>{l.key==="Escape"&&this.hide()},className:q(na,{interactive:o},t),onBlur:this.handleBlur,tabIndex:a?-1:void 0,role:"presentation",children:c.jsxs("div",{className:"popper-content",children:[r,c.jsx("div",{className:"popper-arrow","x-arrow":""})]})})})})}render(){var e=this.state.popper,t=this.props["data-testid"];return c.jsx("div",{className:"popper-parent-container",ref:this.container,style:{display:"none"},"data-testid":t,children:e&&ui.createPortal(this.renderContent(),this.element)})}}Gn(di,"defaultProps",{options:{},className:"",containerClassName:"",isMaximized:!1,timeout:Ll.transitionMs,onEntered(){},onExited(){},onBlur(){},isShown:!1,interactive:!1,closeOnBlur:!1,keepInParent:!1,referenceObject:null,"data-testid":void 0});var Ui;function ra(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function mm(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?ra(Object(t),!0).forEach(function(r){Ot(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):ra(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function Ot(n,e,t){return(e=fm(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function fm(n){var e=vm(n,"string");return typeof e=="symbol"?e:e+""}function vm(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var pm=z.module("Tooltip");class be extends f.Component{static handleHidden(){be.shownTooltipCount-=1,be.shownTooltipCount===0&&(be.lastHiddenTime=Date.now())}static handleShown(){be.shownTooltipCount+=1}constructor(e){super(e),Ot(this,"container",void 0),Ot(this,"popper",void 0),Ot(this,"parent",void 0),Ot(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=U.createRef(),this.popper=U.createRef(),this.parent=null,this.timer=null,this.state={isShown:!1}}componentDidMount(){this.startListening();var e=this.props.timeout;e===0&&this.show()}componentDidUpdate(e,t){var r=t.isShown,i=this.state.isShown;i!==r&&(i?be.handleShown():be.handleHidden())}componentWillUnmount(){this.stopListening(),this.stopListeningWindow(),this.stopTimer();var e=this.state.isShown;e&&be.handleHidden()}startListening(){if(!this.container.current||!this.container.current.parentElement){pm.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 e=this.state.isShown;this.popper.current&&this.parent&&e&&!this.popper.current.element.matches(":hover")&&!this.parent.matches(":hover")&&(this.stopTimer(),this.hide())}handleMouseLeave(){var e=this.state.isShown;this.stopTimer();var t=this.props.interactive;!t&&e&&this.hide()}handleTimeout(){this.show()}handleWindowMouseMove(e){var t=e.clientX,r=e.clientY,i=this.state.isShown;if(!(!this.popper.current||!this.parent)){var o=this.popper.current.element.getBoundingClientRect(),a=this.parent.getBoundingClientRect();t>=o.left&&t<=o.left+o.width&&r>=o.top&&r<=o.top+o.height?this.handleMouseMove():t>=a.left&&t<=a.left+a.width&&r>=a.top&&r<=a.top+a.height?this.handleMouseMove():i&&(this.stopTimer(),this.hide())}}startTimer(){this.stopTimer();var e=this.props,t=e.timeout,r=e.reshowTimeout,i=t;(be.shownTooltipCount>0||Date.now()-be.lastHiddenTime<be.triggerReshowThreshold)&&(i=r),this.timer=window.setTimeout(this.handleTimeout,i)}stopTimer(){this.timer!=null&&(clearTimeout(this.timer),this.timer=null)}show(){var e=this.state.isShown;if(this.stopTimer(),!e){var t;(t=this.popper.current)===null||t===void 0||t.show(),Fi.flushSync(()=>{this.setState({isShown:!0})});var r=this.props.interactive;r&&this.startListeningWindow()}}hide(){var e;(e=this.popper.current)===null||e===void 0||e.hide(),this.stopListeningWindow()}update(){var e;(e=this.popper.current)===null||e===void 0||e.scheduleUpdate()}handleExited(){this.setState({isShown:!1});var e=this.props.onExited;e()}stopShowingTooltip(){var e=this.state.isShown;this.stopTimer(),e&&this.hide()}render(){var e=this.props,t=e.interactive,r=e.children,i=e.referenceObject,o=e.popperClassName,a=e["data-testid"],s=e.onEntered,l=this.state.isShown,u=this.props.options;return u=mm({placement:"bottom"},u),c.jsx("div",{ref:this.container,style:{display:"none"},"data-testid":a,children:c.jsx(di,{className:q(o,"popper-tooltip"),options:u,ref:this.popper,onEntered:s,onExited:this.handleExited,interactive:t,referenceObject:i,children:c.jsxs("div",{className:"tooltip-content",children:[" ",l&&r]})})})}}Ui=be;Ot(be,"defaultTimeout",500);Ot(be,"defaultReshowTimeout",100);Ot(be,"triggerReshowThreshold",300);Ot(be,"shownTooltipCount",0);Ot(be,"lastHiddenTime",Date.now());Ot(be,"defaultProps",{interactive:!1,options:{},popperClassName:"",reshowTimeout:Ui.defaultReshowTimeout,timeout:Ui.defaultTimeout,onEntered:()=>{},onExited:()=>{},"data-testid":void 0});function ia(n,e){return Sm(n)||ym(n,e)||bm(n,e)||gm()}function gm(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
@@ -33,7 +33,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
33
33
  `))}}if(r=r.trimRight(),this.editor.setValue(r),t){var s,l=(s=this.editor.getModel())===null||s===void 0?void 0:s.getLineCount();W(l),this.editor.revealLine(l,1)}this.stopFlushTimer(),this.bufferedMessages=[]}}truncateLogIfNecessary(){this.messages.length>xe.maxLogSize&&(this.messages=this.messages.splice(this.messages.length-xe.truncateSize))}scrollToBottom(){var e,t;if(this.editor){var r=(e=this.editor)===null||e===void 0||(t=e.getModel)===null||t===void 0||(t=t.call(e))===null||t===void 0?void 0:t.getLineCount();W(r),this.editor.revealLine(r,1)}}isBottomVisible(){if(!this.editor)return!0;var e=this.editor.getModel(),t=e==null?void 0:e.getLineCount();return W(t),this.isLineVisible(t)}isLineVisible(e){var t,r=(t=this.editor)===null||t===void 0?void 0:t.getVisibleRanges();if(r==null||r.length===0)return!1;for(var i=0;i<r.length;i+=1){var o=r[i];if(o.startLineNumber<=e&&e<=o.endLineNumber)return!0}return!1}isLogItemVisible(e){var t=this.state.shownLogLevels;return t[e.logLevel]}flush(){for(var e="",t=0;t<this.bufferedMessages.length;t+=1){var r=this.bufferedMessages[t],i=xe.getLogText(r);e+=i,i.charAt(i.length-1)!==`
34
34
  `&&(e+=`
35
35
  `)}this.bufferedMessages=[],this.appendLogText(e)}queue(e){this.bufferedMessages.push(e),this.bufferedMessages.length===1&&(this.flushTimer=setTimeout(this.handleFlushTimeout,xe.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"},t=this.state.shownLogLevels,r=this.getMenuActions(t);return c.jsxs("div",{className:"log-pane h-100 w-100",children:[c.jsxs("div",{className:"log-pane-menu",children:[c.jsx(ae,{kind:"ghost",className:"btn-clear-logs",onClick:this.handleClearClick,icon:Hc,tooltip:"Clear log"}),c.jsx(ae,{kind:"ghost",className:"btn-link-icon btn-overflow",icon:Bc,tooltip:"Log Settings",onClick:()=>{},children:c.jsx(Pr,{actions:r,popperClassName:"log-level-menu-popper",popperOptions:e})})]}),c.jsx("div",{className:"log-pane-editor h-100 w-100",ref:i=>{this.editorContainer=i}})]})}}pt(xe,"DefaultLogLevels",[$e.STDOUT,$e.ERROR,$e.FATAL,$e.STDERR,$e.WARN]);pt(xe,"AllLogLevels",[$e.INFO,$e.STDOUT,$e.ERROR,$e.FATAL,$e.STDERR,$e.WARN,$e.DEBUG,$e.TRACE]);pt(xe,"bufferTimeout",16);pt(xe,"maxLogSize",131072);pt(xe,"truncateSize",65536);const db="var(--dh-color-chart-colorway)",cb="var(--dh-color-chart-grid)",hb="var(--dh-color-chart-axis-line)",mb="var(--dh-color-chart-axis-line-zero)",ps={"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:db,gridcolor:cb,linecolor:hb,zerolinecolor:mb,"error-band-line-color":"var(--dh-color-chart-error-band-line)","ohlc-increasing":"var(--dh-color-chart-ohlc-increase)","ohlc-decreasing":"var(--dh-color-chart-ohlc-decrease)","coastline-color":"var(--dh-color-chart-geo-coastline)","land-color":"var(--dh-color-chart-geo-land)","ocean-color":"var(--dh-color-chart-geo-ocean)","lake-color":"var(--dh-color-chart-geo-lake)","river-color":"var(--dh-color-chart-geo-river)","indicator-increasing":"var(--dh-color-chart-indicator-increase)","indicator-decreasing":"var(--dh-color-chart-indicator-decrease)","indicator-gauge":"var(--dh-color-chart-indicator-gauge)","map-style":"var(--dh-color-chart-map-style)"};function fb(n,e){return bb(n)||gb(n,e)||pb(n,e)||vb()}function vb(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
36
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function pb(n,e){if(n){if(typeof n=="string")return gs(n,e);var t={}.toString.call(n).slice(8,-1);return t==="Object"&&n.constructor&&(t=n.constructor.name),t==="Map"||t==="Set"?Array.from(n):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?gs(n,e):void 0}}function gs(n,e){(e==null||e>n.length)&&(e=n.length);for(var t=0,r=Array(e);t<e;t++)r[t]=n[t];return r}function gb(n,e){var t=n==null?null:typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(t!=null){var r,i,o,a,s=[],l=!0,u=!1;try{if(o=(t=t.call(n)).next,e!==0)for(;!(l=(r=o.call(t)).done)&&(s.push(r.value),s.length!==e);l=!0);}catch(d){u=!0,i=d}finally{try{if(!l&&t.return!=null&&(a=t.return(),Object(a)!==a))return}finally{if(u)throw i}}return s}}function bb(n){if(Array.isArray(n))return n}var bs=z.module("ChartTheme");function yb(){var n,e=Kl(ps);return e.colorway=Wc((n=e.colorway)!==null&&n!==void 0?n:"").map(t=>{var r=fb(t,2),i=r[0],o=r[1];return Uc.normalizeCssColor(e.colorway.substring(i,o+1))}).join(" "),bs.debug2("Chart theme:",ps),bs.debug2("Chart theme derived:",e),Object.freeze({paper_bgcolor:e["paper-bgcolor"],plot_bgcolor:e["plot-bgcolor"],title_color:e["title-color"],legend_color:e["legend-color"],colorway:e.colorway,gridcolor:e.gridcolor,linecolor:e.linecolor,zerolinecolor:e.zerolinecolor,error_band_line_color:e["error-band-line-color"],ohlc_increasing:e["ohlc-increasing"],ohlc_decreasing:e["ohlc-decreasing"],coastline_color:e["coastline-color"],land_color:e["land-color"],ocean_color:e["ocean-color"],lake_color:e["lake-color"],river_color:e["river-color"],indicator_increasing:e["indicator-increasing"],indicator_decreasing:e["indicator-decreasing"],indicator_gauge:e["indicator-gauge"],map_style:e["map-style"]})}function ys(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function Sb(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?ys(Object(t),!0).forEach(function(r){Cb(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):ys(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function Cb(n,e,t){return(e=wb(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function wb(n){var e=_b(n,"string");return typeof e=="symbol"?e:e+""}function _b(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var Eb=f.lazy(()=>Yl(()=>import("./Plot-FV1P3wLe.js"),__vite__mapDeps([0,1,2,3,4,5]),import.meta.url));function Pb(n){return c.jsx(f.Suspense,{fallback:c.jsx(jn,{"data-testid":"lazy-plot-loading"}),children:c.jsx(Eb,Sb({},n))})}var vo=f.createContext(null);vo.displayName="ChartThemeContext";function L_(n){var e=n.children,t=du(),r=t.activeThemes,i=f.useMemo(yb,[r]);return c.jsx(vo.Provider,{value:i,children:e})}function Tb(){return Er(vo,"No ChartThemeContext value found.")}function Ss(n,e,t,r,i,o,a){try{var s=n[o](a),l=s.value}catch(u){return void t(u)}s.done?e(l):Promise.resolve(l).then(r,i)}function Ob(n){return function(){var e=this,t=arguments;return new Promise(function(r,i){var o=n.apply(e,t);function a(l){Ss(o,r,i,a,s,"next",l)}function s(l){Ss(o,r,i,a,s,"throw",l)}a(void 0)})}}function Cs(n,e){return Mb(n)||Db(n,e)||xb(n,e)||Ib()}function Ib(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
36
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function pb(n,e){if(n){if(typeof n=="string")return gs(n,e);var t={}.toString.call(n).slice(8,-1);return t==="Object"&&n.constructor&&(t=n.constructor.name),t==="Map"||t==="Set"?Array.from(n):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?gs(n,e):void 0}}function gs(n,e){(e==null||e>n.length)&&(e=n.length);for(var t=0,r=Array(e);t<e;t++)r[t]=n[t];return r}function gb(n,e){var t=n==null?null:typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(t!=null){var r,i,o,a,s=[],l=!0,u=!1;try{if(o=(t=t.call(n)).next,e!==0)for(;!(l=(r=o.call(t)).done)&&(s.push(r.value),s.length!==e);l=!0);}catch(d){u=!0,i=d}finally{try{if(!l&&t.return!=null&&(a=t.return(),Object(a)!==a))return}finally{if(u)throw i}}return s}}function bb(n){if(Array.isArray(n))return n}var bs=z.module("ChartTheme");function yb(){var n,e=Kl(ps);return e.colorway=Wc((n=e.colorway)!==null&&n!==void 0?n:"").map(t=>{var r=fb(t,2),i=r[0],o=r[1];return Uc.normalizeCssColor(e.colorway.substring(i,o+1))}).join(" "),bs.debug2("Chart theme:",ps),bs.debug2("Chart theme derived:",e),Object.freeze({paper_bgcolor:e["paper-bgcolor"],plot_bgcolor:e["plot-bgcolor"],title_color:e["title-color"],legend_color:e["legend-color"],colorway:e.colorway,gridcolor:e.gridcolor,linecolor:e.linecolor,zerolinecolor:e.zerolinecolor,error_band_line_color:e["error-band-line-color"],ohlc_increasing:e["ohlc-increasing"],ohlc_decreasing:e["ohlc-decreasing"],coastline_color:e["coastline-color"],land_color:e["land-color"],ocean_color:e["ocean-color"],lake_color:e["lake-color"],river_color:e["river-color"],indicator_increasing:e["indicator-increasing"],indicator_decreasing:e["indicator-decreasing"],indicator_gauge:e["indicator-gauge"],map_style:e["map-style"]})}function ys(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function Sb(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?ys(Object(t),!0).forEach(function(r){Cb(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):ys(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function Cb(n,e,t){return(e=wb(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function wb(n){var e=_b(n,"string");return typeof e=="symbol"?e:e+""}function _b(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var Eb=f.lazy(()=>Yl(()=>import("./Plot-BCCHsuro.js"),__vite__mapDeps([0,1,2,3,4,5]),import.meta.url));function Pb(n){return c.jsx(f.Suspense,{fallback:c.jsx(jn,{"data-testid":"lazy-plot-loading"}),children:c.jsx(Eb,Sb({},n))})}var vo=f.createContext(null);vo.displayName="ChartThemeContext";function L_(n){var e=n.children,t=du(),r=t.activeThemes,i=f.useMemo(yb,[r]);return c.jsx(vo.Provider,{value:i,children:e})}function Tb(){return Er(vo,"No ChartThemeContext value found.")}function Ss(n,e,t,r,i,o,a){try{var s=n[o](a),l=s.value}catch(u){return void t(u)}s.done?e(l):Promise.resolve(l).then(r,i)}function Ob(n){return function(){var e=this,t=arguments;return new Promise(function(r,i){var o=n.apply(e,t);function a(l){Ss(o,r,i,a,s,"next",l)}function s(l){Ss(o,r,i,a,s,"throw",l)}a(void 0)})}}function Cs(n,e){return Mb(n)||Db(n,e)||xb(n,e)||Ib()}function Ib(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
37
37
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function xb(n,e){if(n){if(typeof n=="string")return ws(n,e);var t={}.toString.call(n).slice(8,-1);return t==="Object"&&n.constructor&&(t=n.constructor.name),t==="Map"||t==="Set"?Array.from(n):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?ws(n,e):void 0}}function ws(n,e){(e==null||e>n.length)&&(e=n.length);for(var t=0,r=Array(e);t<e;t++)r[t]=n[t];return r}function Db(n,e){var t=n==null?null:typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(t!=null){var r,i,o,a,s=[],l=!0,u=!1;try{if(o=(t=t.call(n)).next,e!==0)for(;!(l=(r=o.call(t)).done)&&(s.push(r.value),s.length!==e);l=!0);}catch(d){u=!0,i=d}finally{try{if(!l&&t.return!=null&&(a=t.return(),Object(a)!==a))return}finally{if(u)throw i}}return s}}function Mb(n){if(Array.isArray(n))return n}var kb=z.module("HeapUsage");function Ab(n){var e,t=n.connection,r=n.defaultUpdateInterval,i=n.hoverUpdateInterval,o=n.bgMonitoring,a=o===void 0?!0:o,s=n.monitorDuration,l=Tb(),u=f.useState({freeMemory:0,maximumHeapSize:999,totalHeapSize:0}),d=Cs(u,2),h=d[0],m=d[1],v=f.useState(!1),p=Cs(v,2),g=p[0],b=p[1],y=f.useRef({timestamps:[],usages:[]}),S=au(),E=f.useCallback(Ob(function*(){try{var de=yield t.getWorkerHeapInfo();if(!S.current)return;if(m(de),a||g){for(var te=(de.totalHeapSize-de.freeMemory)/de.maximumHeapSize,Y=Date.now(),ce=y.current,w=ce.timestamps,P=ce.usages;w.length!==0&&Y-w[0]>s*1.5;)w.shift(),P.shift();w.push(Y),P.push(te)}else y.current={timestamps:[],usages:[]}}catch(_){kb.warn("Unable to get heap usage",_)}}),[t,S,a,g,s]);Uh(E,g?i:r);var T=(de,te)=>Math.round(de*10**te)/10**te,O=2,L=1024**3,G=h.freeMemory,$=h.totalHeapSize,M=h.maximumHeapSize,j=T(G/L,O),H=T($/L,O),ee=T(M/L,O),F=H-j,X=function(te,Y){var ce=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return c.jsxs("div",{className:q("heap-usage-info-row",{"heading-bottom-border":ce}),children:[c.jsx("div",{className:"font-weight-bold",children:te}),c.jsx("div",{children:Y})]})},ie=y.current,oe=ie.timestamps,ge=ie.usages,we=(e=oe[oe.length-1])!==null&&e!==void 0?e:0,_e=$/M,Se=($-G)/M;return c.jsxs("div",{className:"max-memory",children:[c.jsx("div",{className:"total-memory",style:{width:"calc(".concat(_e*100,"% - ").concat(_e*2,"px")}}),c.jsx("div",{className:q("used-memory",{"heap-overflow":($-G)/M>.95}),style:{width:"calc(".concat(Se*100,"% - ").concat(Se*2,"px")}}),c.jsxs("div",{className:"memory-text",children:[ee.toFixed(1)," GB"]}),c.jsx(be,{onEntered:()=>b(!0),onExited:()=>b(!1),interactive:!0,children:c.jsxs("div",{className:"heap-tooltip",children:[X("In use:","".concat(F.toFixed(O)," of ").concat(ee.toFixed(O)," GB"),!0),X("Free:","".concat(j.toFixed(O)," GB")),X("Total:","".concat(H.toFixed(O)," GB")),X("Max:","".concat(ee.toFixed(O)," GB")),c.jsx("div",{className:"heap-plot",children:c.jsx(Pb,{data:[{x:[...oe],y:[...ge],type:"scatter",mode:"lines"}],config:{staticPlot:!0,responsive:!0},style:{width:"196px",height:"100px"},layout:{margin:{l:2,t:2,r:2,b:2},plot_bgcolor:"transparent",paper_bgcolor:"transparent",colorway:["#4878ea"],xaxis:{dtick:Math.round(s/6),gridcolor:l.linecolor,range:[we-s,we],linecolor:l.linecolor,linewidth:2,mirror:!0},yaxis:{dtick:.2,gridcolor:l.linecolor,range:[0,1],linecolor:l.linecolor,linewidth:2,mirror:!0}}})}),c.jsxs("div",{className:"heap-utilisation-text",children:["% utilization over ",Math.round(s/1e3/60)," min."]})]})})]})}var Ju=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 ed(n){return n.componentName!==void 0}function Nb(n){return n.component!==void 0}var td=Object.freeze({type:"default",isClosable:!0,isFocusOnShow:!0,reorderEnabled:!0,title:""});const jb=Object.freeze(Object.defineProperty({__proto__:null,defaultConfig:Ju,isGLComponentConfig:ed,isReactComponentConfig:Nb,itemDefaultConfig:td},Symbol.toStringTag,{value:"Module"}));function Yr(n,e,t){return(e=Lb(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Lb(n){var e=Fb(n,"string");return typeof e=="symbol"?e:e+""}function Fb(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class it{constructor(){Yr(this,"_mSubscriptions",void 0),Yr(this,"off",this.unbind),Yr(this,"trigger",this.emit),this._mSubscriptions={},this._mSubscriptions[it.ALL_EVENT]=[]}on(e,t,r){if(typeof t!="function")throw new Error("Tried to listen to event "+e+" with non-function callback "+t);this._mSubscriptions[e]||(this._mSubscriptions[e]=[]),this._mSubscriptions[e].push({fn:t,ctx:r})}emit(e){for(var t=this._mSubscriptions[e],r=arguments.length,i=new Array(r>1?r-1:0),o=1;o<r;o++)i[o-1]=arguments[o];if(t)for(var a=0;a<t.length;a++){var s=t[a].ctx||{};try{t[a].fn.apply(s,i)}catch(h){console.error("Error while emitting event:",h)}}i.unshift(e);for(var l=this._mSubscriptions[it.ALL_EVENT],u=0;u<l.length;u++){var d=l[u].ctx||{};try{l[u].fn.apply(d,i)}catch(h){console.error("Error while emitting event to allEventSubs:",h)}}}unbind(e,t,r){if(!this._mSubscriptions[e])throw new Error("No subscriptions to unsubscribe for event "+e);for(var i=!1,o=0;o<this._mSubscriptions[e].length;o++)(!t||this._mSubscriptions[e][o].fn===t)&&(!r||r===this._mSubscriptions[e][o].ctx)&&(this._mSubscriptions[e].splice(o,1),i=!0);if(i===!1)throw new Error("Nothing to unbind for "+e)}}Yr(it,"ALL_EVENT","__all");function Et(n,e,t){return(e=Rb(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Rb(n){var e=$b(n,"string");return typeof e=="symbol"?e:e+""}function $b(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class Xi extends it{constructor(e,t,r){super(),Et(this,"width",void 0),Et(this,"height",void 0),Et(this,"title",void 0),Et(this,"parent",void 0),Et(this,"layoutManager",void 0),Et(this,"tab",void 0),Et(this,"_config",void 0),Et(this,"isHidden",!1),Et(this,"beforeCloseHandler",void 0),Et(this,"_element",A(['<div class="lm_item_container">','<div class="lm_content" tabindex="-1"></div>',"</div>"].join(""))),Et(this,"_contentElement",void 0),this.title=ed(e)?e.componentName:"",this.parent=t,this.layoutManager=r,this._config=e,this._contentElement=this._element.find(".lm_content"),this.beforeCloseHandler=null}getElement(){return this._contentElement}hide(){this.emit("hide"),this.isHidden=!0,this._element.hide()}show(){this.emit("show"),this.isHidden=!1,this._element.show(),(this.height!=0||this.width!=0)&&this.emit("shown")}setSize(e,t){for(var r,i,o,a=this.parent,s=null;a&&!a.isColumn&&!a.isRow;){var l;if(s=a,a=a.parent,(l=a)!==null&&l!==void 0&&l.isRoot)return!1}if(!a||!s)return!1;for(var u=a.isColumn?"height":"width",d=u==="height"?t:e,h=((r=this[u])!==null&&r!==void 0?r:0)*(1/(((i=s.config[u])!==null&&i!==void 0?i:0)/100)),m=d/h*100,v=(((o=s.config[u])!==null&&o!==void 0?o:0)-m)/(a.contentItems.length-1),p=0;p<a.contentItems.length;p++)if(a.contentItems[p]===s)a.contentItems[p].config[u]=m;else{var g;a.contentItems[p].config[u]=((g=a.contentItems[p].config[u])!==null&&g!==void 0?g:0)+v}return a.callDownwards("setSize"),!0}close(e){var t,r;this._config.isClosable&&(!((t=(r=this.beforeCloseHandler)===null||r===void 0?void 0:r.call(this,e))!==null&&t!==void 0)||t)&&(this.emit("close"),this.parent.close())}beforeClose(e){this.beforeCloseHandler=e}getState(){return this._config.componentState}getConfig(){return this._config}setState(e){this._config.componentState=e,this.parent.emitBubblingEvent("stateChanged")}setPersistedState(e){this._config.persistedState=e,this.parent.emitBubblingEvent("stateChanged")}setTitle(e){this.parent.setTitle(e)}_$setSize(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;if(e!==this.width||t!==this.height){this.width=e,this.height=t;var r=this._contentElement[0],i=r.offsetWidth-r.clientWidth,o=r.offsetHeight-r.clientHeight;this._contentElement.width(this.width-i).height(this.height-o),this.emit("resize")}}}const Hb=Object.freeze(Object.defineProperty({__proto__:null,Container:Xi,ItemContainer:Xi},Symbol.toStringTag,{value:"Module"}));function nd(n){var e=location.hash.match(new RegExp(n+"=([^&]*)"));return e?e[1]:null}function rd(n){if(window.location.hash)return nd(n);if(!window.location.search)return null;var e=window.location.search.substr(1).split("&"),t={},r,i;for(i=0;i<e.length;i++)r=e[i].split("="),t[r[0]]=r[1];return t[n]||null}function Xn(n){return window.requestAnimationFrame(n)}function Bb(n,e){var t=e.indexOf(n);if(t===-1)throw new Error("Can't remove item from array. Item is not in the array");e.splice(t,1)}function ii(){return Nt()}function Wb(n,e){var t=n.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 po(n){return A.trim(n.replace(/(<([^>]+)>)/gi,""))}function st(n,e,t){return(e=Ub(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Ub(n){var e=Vb(n,"string");return typeof e=="symbol"?e:e+""}function Vb(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class ar extends it{constructor(e,t){var r,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;super(),st(this,"_eElement",void 0),st(this,"_oDocument",void 0),st(this,"_eBody",void 0),st(this,"_root",void 0),st(this,"_destroyAfterMouseUp",void 0),st(this,"_nDelay",400),st(this,"_timeout",void 0),st(this,"timeout",void 0),st(this,"_nDistance",10),st(this,"_nX",0),st(this,"_nY",0),st(this,"_nOriginalX",0),st(this,"_nOriginalY",0),st(this,"_bDragging",!1),this._eElement=e,this._oDocument=A(document),this._eBody=A(document.body),this._root=t,this._destroyAfterMouseUp=i,this.onMouseMove=this.onMouseMove.bind(this),this.onMouseUp=this.onMouseUp.bind(this),this.onMouseDown=this.onMouseDown.bind(this),this._startDrag=this._startDrag.bind(this),(r=this._eElement)===null||r===void 0||r.on("mousedown",this.onMouseDown)}destroy(){var e,t;(e=this._eElement)===null||e===void 0||e.unbind("mousedown",this.onMouseDown),(t=this._oDocument)===null||t===void 0||t.unbind("mouseup",this.onMouseUp),this._eElement=void 0,this._oDocument=void 0,this._eBody=void 0,clearTimeout(this._timeout),this._timeout=void 0}onMouseDown(e){if(e.preventDefault(),e.button===0){var t,r,i,o,a=this._getCoordinates(e);this._nOriginalX=(t=a.x)!==null&&t!==void 0?t:0,this._nOriginalY=(r=a.y)!==null&&r!==void 0?r:0,(i=this._oDocument)===null||i===void 0||i.on("mousemove",this.onMouseMove),(o=this._oDocument)===null||o===void 0||o.on("mouseup",this.onMouseUp),this._timeout=window.setTimeout(this._startDrag,this._nDelay)}}onMouseMove(e){if(this._timeout!=null){var t,r;e.preventDefault();var i=this._getCoordinates(e);this._nX=((t=i.x)!==null&&t!==void 0?t:0)-this._nOriginalX,this._nY=((r=i.y)!==null&&r!==void 0?r:0)-this._nOriginalY,this._bDragging===!1&&(Math.abs(this._nX)>this._nDistance||Math.abs(this._nY)>this._nDistance)&&this._startDrag(),this._bDragging&&this.emit("drag",this._nX,this._nY,e)}}onMouseUp(e){if(this._timeout!=null){var t,r,i,o,a;if(clearTimeout(this._timeout),(t=this._oDocument)===null||t===void 0||t.unbind("mousemove",this.onMouseMove),(r=this._oDocument)===null||r===void 0||r.unbind("mouseup",this.onMouseUp),(i=this._oDocument)===null||i===void 0||(i=i.find("iframe"))===null||i===void 0||i.css("pointer-events",""),this._bDragging===!0&&(this._bDragging=!1,this.emit("dragStop",e,this._nOriginalX+this._nX)),(o=this._eBody)===null||o===void 0||o.removeClass("lm_dragging"),(a=this._root)===null||a===void 0||a.childElementContainer.removeClass("lm_dragging"),!(this._eElement instanceof Window)){var s;(s=this._eElement)===null||s===void 0||s.removeClass("lm_dragging")}this._destroyAfterMouseUp&&this.destroy()}}_startDrag(){var e,t,r,i;window.clearTimeout(this._timeout),this._bDragging=!0,(e=this._eBody)===null||e===void 0||e.addClass("lm_dragging"),(t=this._eElement)===null||t===void 0||t.addClass("lm_dragging"),(r=this._root)===null||r===void 0||r.childElementContainer.addClass("lm_dragging"),(i=this._oDocument)===null||i===void 0||(i=i.find("iframe"))===null||i===void 0||i.css("pointer-events","none"),this.emit("dragStart",this._nOriginalX,this._nOriginalY)}_getCoordinates(e){var t,r;return{x:(t=e.pageX)!==null&&t!==void 0?t:0,y:(r=e.pageY)!==null&&r!==void 0?r:0}}}function Wn(n,e,t){return(e=Kb(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Kb(n){var e=zb(n,"string");return typeof e=="symbol"?e:e+""}function zb(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class id{constructor(e,t){Wn(this,"_container",void 0),Wn(this,"_reactComponent",null),Wn(this,"_portalComponent",null),Wn(this,"_originalComponentWillUpdate",void 0),Wn(this,"_initialState",void 0),Wn(this,"_reactClass",void 0),this._reactComponent=null,this._portalComponent=null,this._originalComponentWillUpdate=void 0,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=ui.createPortal(this._getReactComponent(),this._container.getElement()[0],e),this._container.layoutManager.addReactChild(e,this._portalComponent)}_gotReactComponent(e){if(e&&(this._reactComponent=e,this._reactComponent instanceof f.Component)){this._originalComponentWillUpdate=this._reactComponent.componentWillUpdate,this._reactComponent.componentWillUpdate=this._onUpdate.bind(this);var t=this._container.getState();t&&this._reactComponent.setState(t)}}_destroy(){this._container.layoutManager.removeReactChild(this._key(),this._portalComponent),this._container.off("open",this._render,this),this._container.off("destroy",this._destroy,this)}_onUpdate(e,t){var r;this._container.setState(t),(r=this._originalComponentWillUpdate)===null||r===void 0||r.call(this._reactComponent,e,t,void 0)}_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=A.extend(e,this._container._config.props);return U.createElement(this._reactClass,t)}}var oi=["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"],Gb=[!0,!1,"row","column","stack","component","close","maximise","minimise","open in new window"];function go(n){if(oi.length>36)throw new Error("Too many keys in config minifier map");var e={};return bo(n,e,"_min"),e}function Zi(n){if(oi.length>36)throw new Error("Too many keys in config minifier map");var e={};return bo(n,e,"_max"),e}function bo(n,e,t){var r=t==="_min"?qb:Xb;for(var i in n)if(n.hasOwnProperty(i)){var o=Array.isArray(n)?n[Number.parseInt(i,10)]:n[i];if(typeof o=="object"&&o!=null){var a=o instanceof Array?[]:{};if(Array.isArray(e))e[Number.parseInt(i,10)]=a;else{var s=r(i,oi);e[s]=a}bo(o,a,t)}else{var l=r(o,Gb);if(Array.isArray(e))e[Number.parseInt(i,10)]=l;else{var u=r(i,oi);e[u]=l}}}}function qb(n,e){if(typeof n=="string"&&n.length===1)return"___"+n;var t=e.indexOf(n);return t===-1?n:t.toString(36)}function Xb(n,e){return typeof n=="string"&&n.length===1?e[parseInt(n,36)]:typeof n=="string"&&n.substr(0,3)==="___"?n[3]:n}function Di(n,e,t){return(e=Zb(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Zb(n){var e=Yb(n,"string");return typeof e=="symbol"?e:e+""}function Yb(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class Yi{constructor(e,t){Di(this,"name",void 0),Di(this,"origin",void 0),Di(this,"isPropagationStopped",void 0),this.name=e,this.origin=t,this.isPropagationStopped=!1}stopPropagation(){this.isPropagationStopped=!0}}function $r(n,e,t){return(e=Qb(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Qb(n){var e=Jb(n,"string");return typeof e=="symbol"?e:e+""}function Jb(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}let od=class extends it{constructor(e){super(),$r(this,"_layoutManager",void 0),$r(this,"_dontPropagateToParent",void 0),$r(this,"_childEventSource",void 0),$r(this,"_boundOnEventFromChild",void 0),this._layoutManager=e,this._dontPropagateToParent=null,this._childEventSource=null,this.on(it.ALL_EVENT,this._onEventFromThis.bind(this)),this._boundOnEventFromChild=this._onEventFromChild.bind(this),A(window).on("gl_child_event",this._boundOnEventFromChild)}_onEventFromThis(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];this._layoutManager.isSubWindow&&t[0]!==this._dontPropagateToParent&&this._propagateToParent(t),this._propagateToChildren(t),this._dontPropagateToParent=null,this._childEventSource=null}_$onEventFromParent(e){this._dontPropagateToParent=e[0],this.emit.apply(this,e)}_onEventFromChild(e){this._childEventSource=e.originalEvent.__gl,this.emit.apply(this,e.originalEvent.__glArgs)}_propagateToParent(e){var t,r="gl_child_event",i=(t=window.opener)===null||t===void 0?void 0:t.document.createEvent("HTMLEvents");i.initEvent(r,!0,!0),i.eventName=r,i.__glArgs=e,i.__gl=this._layoutManager,window.opener.dispatchEvent(i)}_propagateToChildren(e){for(var t=0;t<this._layoutManager.openPopouts.length;t++){var r=this._layoutManager.openPopouts[t].getGlInstance();r&&r!==this._childEventSource&&r.eventHub._$onEventFromParent(e)}}destroy(){A(window).off("gl_child_event",this._boundOnEventFromChild)}};function ad(n,e,t){return n.on(e,t),()=>{n.off(e,t)}}function sd(n){return(e,t)=>ad(e,n,t)}function ld(n){return function(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),i=1;i<t;i++)r[i-1]=arguments[i];e.emit(n,...r)}}function ud(n){return(e,t)=>{var r=f.useRef(null),i=f.useRef(()=>!1);if(r.current!=e||i.current!=t){var o;(o=r.current)===null||o===void 0||o.off(n,i.current),e==null||e.on(n,t)}r.current=e,i.current=t,f.useEffect(()=>()=>{var a;return(a=r.current)===null||a===void 0?void 0:a.off(n,i.current)},[])}}function Mt(n){return{listen:sd(n),emit:ld(n),useListener:ud(n)}}const ey=Object.freeze(Object.defineProperty({__proto__:null,BubblingEvent:Yi,DragListener:ar,EventEmitter:it,EventHub:od,ReactComponentHandler:id,animFrame:Xn,filterXss:Wb,getHashValue:nd,getQueryStringParam:rd,getUniqueId:ii,listenForEvent:ad,makeEmitFunction:ld,makeEventFunctions:Mt,makeListenFunction:sd,makeUseListenerFunction:ud,minifyConfig:go,removeFromArray:Bb,stripTags:po,unminifyConfig:Zi},Symbol.toStringTag,{value:"Module"}));function on(n,e,t){return(e=ty(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function ty(n){var e=ny(n,"string");return typeof e=="symbol"?e:e+""}function ny(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class dd extends it{constructor(e,t,r,i,o){super(),on(this,"isInitialised",!1),on(this,"_config",void 0),on(this,"_dimensions",void 0),on(this,"_parentId",void 0),on(this,"_indexInParent",void 0),on(this,"_layoutManager",void 0),on(this,"_popoutWindow",null),on(this,"_id",null),this._config=e,this._dimensions=t,this._parentId=r,this._indexInParent=i,this._layoutManager=o,this._createWindow()}toConfig(){var e,t,r,i,o,a,s,l,u,d,h;if(this.isInitialised===!1)throw new Error("Can't create config, layout not yet initialised");return{dimensions:{width:(e=this.getGlInstance())===null||e===void 0?void 0:e.width,height:(t=this.getGlInstance())===null||t===void 0?void 0:t.height,left:(r=(i=(o=this._popoutWindow)===null||o===void 0?void 0:o.screenX)!==null&&i!==void 0?i:(a=this._popoutWindow)===null||a===void 0?void 0:a.screenLeft)!==null&&r!==void 0?r:0,top:(s=(l=(u=this._popoutWindow)===null||u===void 0?void 0:u.screenY)!==null&&l!==void 0?l:(d=this._popoutWindow)===null||d===void 0?void 0:d.screenTop)!==null&&s!==void 0?s:0},content:(h=this.getGlInstance())===null||h===void 0?void 0:h.toConfig().content,parentId:this._parentId,indexInParent:this._indexInParent}}getGlInstance(){var e;return(e=this._popoutWindow)===null||e===void 0?void 0:e.__glInstance}getWindow(){return this._popoutWindow}close(){if(this.getGlInstance()){var e;(e=this.getGlInstance())===null||e===void 0||e._$closeWindow()}else try{var t;(t=this.getWindow())===null||t===void 0||t.close()}catch{}}popIn(){var e;this._indexInParent;var t=null,r=null;if(this._parentId){var i;if(t=A.extend(!0,{},(i=this.getGlInstance())===null||i===void 0?void 0:i.toConfig()).content[0],r=this._layoutManager.root.getItemsById(this._parentId)[0],!r){var o;((o=this._layoutManager.root.contentItems.length)!==null&&o!==void 0?o:0)>0?r=this._layoutManager.root.contentItems[0]:r=this._layoutManager.root}}t&&((e=r)===null||e===void 0||e.addChild(t,this._indexInParent),this.close())}_createWindow(){var e=this._createUrl(),t=Math.floor(Math.random()*1e6).toString(36),r=this._serializeWindowOptions({width:this._dimensions.width,height:this._dimensions.height,innerWidth:this._dimensions.width,innerHeight:this._dimensions.height,menubar:"no",toolbar:"no",location:"no",personalbar:"no",resizable:"yes",scrollbars:"no",status:"no"});if(this._popoutWindow=window.open(e,t,r),!this._popoutWindow)if(this._layoutManager.config.settings.blockedPopoutsThrowError===!0){var i=new Error("Popout blocked");throw i.type="popoutBlocked",i}else return;A(this._popoutWindow).on("load",this._positionWindow.bind(this)).on("unload beforeunload",this._onClose.bind(this));var o=window.setInterval(()=>{var a;(a=this._popoutWindow)!==null&&a!==void 0&&a.__glInstance&&this._popoutWindow.__glInstance.isInitialised&&(this._onInitialised(),window.clearInterval(o))},10)}_serializeWindowOptions(e){var t=[],r;for(r in e)t.push(r+"="+e[r]);return t.join(",")}_createUrl(){var e={content:this._config},t="gl-window-config-"+ii();e=go(e);try{localStorage.setItem(t,JSON.stringify(e))}catch(i){throw new Error("Error while writing to localStorage "+i.toString())}var r=document.location.href.split("?");return r.length===1?r[0]+"?gl-window="+t:document.location.href+"&gl-window="+t}_positionWindow(){var e,t;(e=this._popoutWindow)===null||e===void 0||e.moveTo(this._dimensions.left,this._dimensions.top),(t=this._popoutWindow)===null||t===void 0||t.focus()}_onInitialised(){var e;this.isInitialised=!0,(e=this.getGlInstance())===null||e===void 0||e.on("popIn",this.popIn,this),this.emit("initialised")}_onClose(){setTimeout(this.emit.bind(this,"closed"),50)}}function Le(n,e,t){return(e=ry(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function ry(n){var e=iy(n,"string");return typeof e=="symbol"?e:e+""}function iy(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class $n extends it{constructor(e,t,r,i,o,a){var s,l,u,d,h,m,v,p;if(super(),Le(this,"_dragListener",void 0),Le(this,"_layoutManager",void 0),Le(this,"_contentItem",void 0),Le(this,"_originalParent",void 0),Le(this,"_area",null),Le(this,"_lastValidArea",null),Le(this,"_minX",void 0),Le(this,"_maxX",void 0),Le(this,"_minY",void 0),Le(this,"_maxY",void 0),Le(this,"_width",void 0),Le(this,"_height",void 0),Le(this,"_sided",void 0),Le(this,"element",void 0),Le(this,"childElementContainer",void 0),Le(this,"_proxyTab",void 0),this._dragListener=r,this._layoutManager=i,this._contentItem=o,this._originalParent=a,this._dragListener.on("drag",this._onDrag,this),this._dragListener.on("dragStop",this._onDrop,this),this._contentItem.tab&&this._contentItem.tab.element){var g,b;this._layoutManager.tabDropPlaceholder.width((g=this._contentItem.tab.element.outerWidth(!0))!==null&&g!==void 0?g:0),this._layoutManager.tabDropPlaceholder.height((b=this._contentItem.tab.element.outerHeight(!0))!==null&&b!==void 0?b:0)}if(this.element=A($n._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",po((s=this._contentItem.config.title)!==null&&s!==void 0?s:"")),this.element.find(".lm_title").text((l=this._contentItem.config.title)!==null&&l!==void 0?l:""),this.childElementContainer=this.element.find(".lm_content"),this.childElementContainer.append(o.element),this._updateTree(),this._layoutManager._$calculateItemAreas(),A(document.body).append(this.element),this._setDimensions(),!this._contentItem.tab&&this._proxyTab.length){var y,S;this._layoutManager.tabDropPlaceholder.width((y=this._proxyTab.outerWidth(!0))!==null&&y!==void 0?y:0),this._layoutManager.tabDropPlaceholder.height((S=this._proxyTab.outerHeight(!0))!==null&&S!==void 0?S:0)}var E=this._layoutManager.container.offset();this._minX=(u=E==null?void 0:E.left)!==null&&u!==void 0?u:0,this._minY=(d=E==null?void 0:E.top)!==null&&d!==void 0?d:0,this._maxX=((h=this._layoutManager.container.width())!==null&&h!==void 0?h:0)+this._minX,this._maxY=((m=this._layoutManager.container.height())!==null&&m!==void 0?m:0)+this._minY,this._width=(v=this.element.width())!==null&&v!==void 0?v:0,this._height=(p=this.element.height())!==null&&p!==void 0?p:0,this._setDropPosition(e,t),this._layoutManager.emit("itemPickedUp",this._contentItem)}_onDrag(e,t,r){var i,o,a=(i=r.pageX)!==null&&i!==void 0?i:0,s=(o=r.pageY)!==null&&o!==void 0?o:0,l=a>this._minX&&a<this._maxX&&s>this._minY&&s<this._maxY;!l&&this._layoutManager.config.settings.constrainDragToContainer===!0||this._setDropPosition(a,s)}_setDropPosition(e,t){this.element.css({left:e,top:t}),this._area=this._layoutManager._$getArea(e,t),this._area!==null&&(this._lastValidArea=this._area,this._area.contentItem._$highlightDropZone(e,t,this._area))}_onDrop(){var e;(e=this._layoutManager.dropTargetIndicator)===null||e===void 0||e.hide(),this._area!==null?this._area.contentItem._$onDrop(this._contentItem,this._area):this._lastValidArea!==null?this._lastValidArea.contentItem._$onDrop(this._contentItem,this._lastValidArea):this._originalParent?this._originalParent.addChild(this._contentItem):this._contentItem._$destroy(),this._dragListener.off("drag",this._onDrag,this),this._dragListener.off("dragStop",this._onDrop,this),this.element.remove(),this._layoutManager.emit("itemDropped",this._contentItem)}_updateTree(){this._contentItem.parent&&this._contentItem.parent.removeChild(this._contentItem,!0),this._contentItem._$setParent(null)}_setDimensions(){var e=this._layoutManager.config.dimensions,t=e.dragProxyWidth,r=e.dragProxyHeight;this.element.width(t),this.element.height(r),t-=this._sided?e.headerHeight:0,r-=this._sided?0:e.headerHeight,this.childElementContainer.width(t),this.childElementContainer.height(r),this._contentItem.element.width(t),this._contentItem.element.height(r),this._contentItem.callDownwards("_$show"),this._contentItem.callDownwards("setSize")}}Le($n,"_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 Hr(n,e,t){return(e=oy(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function oy(n){var e=ay(n,"string");return typeof e=="symbol"?e:e+""}function ay(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class cd{constructor(e,t,r){Hr(this,"_element",void 0),Hr(this,"_itemConfig",void 0),Hr(this,"_layoutManager",void 0),Hr(this,"_dragListener",void 0),this._element=e,this._itemConfig=t,this._layoutManager=r,this._dragListener=this._createDragListener()}_createDragListener(){return this._dragListener=new ar(this._element,this._layoutManager.root,!0),this._dragListener.on("dragStart",this._onDragStart,this),this._dragListener.on("dragStop",this._createDragListener,this),this._dragListener}_onDragStart(e,t){var r=this._itemConfig;typeof r=="function"&&(r=r());var i=this._layoutManager._$normalizeContentItem(A.extend(!0,{},r));new $n(e,t,this._dragListener,this._layoutManager,i,null)}}function Br(n,e,t){return(e=sy(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function sy(n){var e=ly(n,"string");return typeof e=="symbol"?e:e+""}function ly(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class hd{constructor(e,t,r){Br(this,"_element",A(window)),Br(this,"_itemConfig",void 0),Br(this,"_layoutManager",void 0),Br(this,"_dragListener",void 0),this._itemConfig=e,this._layoutManager=t,this._createDragListener(r)}_createDragListener(e){this._dragListener&&this._dragListener.destroy(),this._element&&this._layoutManager&&(this._dragListener=new ar(this._element,this._layoutManager.root,!0),this._dragListener.on("dragStart",this._onDragStart,this),this._dragListener.on("dragStop",this._destroy,this),this._dragListener.onMouseDown(e),this._dragListener._startDrag())}_destroy(){this._dragListener=void 0,this._element=void 0,this._itemConfig=void 0,this._layoutManager=void 0}_onDragStart(e,t){if(!(!this._dragListener||!this._layoutManager)){var r=this._itemConfig;typeof r=="function"&&(r=r());var i=this._layoutManager._$normalizeContentItem(A.extend(!0,{},r));new $n(e,t,this._dragListener,this._layoutManager,i,null)}}}function md(n,e,t){return(e=uy(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function uy(n){var e=dy(n,"string");return typeof e=="symbol"?e:e+""}function dy(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class Tr{constructor(){md(this,"element",A(Tr._template)),A(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()}}md(Tr,"_template",'<div class="lm_dropTargetIndicator"><div class="lm_inner"></div></div>');function Mi(n,e,t){return(e=cy(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function cy(n){var e=hy(n,"string");return typeof e=="symbol"?e:e+""}function hy(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class mr{constructor(e,t,r,i){Mi(this,"element",void 0),Mi(this,"_header",void 0),Mi(this,"_action",void 0),this._header=e,this.element=A('<li class="'+r+'" title="'+t+'"></li>'),this._header.on("destroy",this._$destroy,this),this._action=i,this.element.on("click",this._action),this._header.controlsContainer.append(this.element)}_$destroy(){this.element.off(),this.element.remove()}}function my(n,e,t){return(e=fy(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function fy(n){var e=vy(n,"string");return typeof e=="symbol"?e:e+""}function vy(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class Dn extends Error{constructor(e,t){super(),my(this,"node",void 0),this.name="Configuration Error",this.message=e,this.node=t}}const py=Object.freeze(Object.defineProperty({__proto__:null,ConfigurationError:Dn},Symbol.toStringTag,{value:"Module"}));function gy(n,e){return Cy(n)||Sy(n,e)||yy(n,e)||by()}function by(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
38
38
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function yy(n,e){if(n){if(typeof n=="string")return _s(n,e);var t={}.toString.call(n).slice(8,-1);return t==="Object"&&n.constructor&&(t=n.constructor.name),t==="Map"||t==="Set"?Array.from(n):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?_s(n,e):void 0}}function _s(n,e){(e==null||e>n.length)&&(e=n.length);for(var t=0,r=Array(e);t<e;t++)r[t]=n[t];return r}function Sy(n,e){var t=n==null?null:typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(t!=null){var r,i,o,a,s=[],l=!0,u=!1;try{if(o=(t=t.call(n)).next,e!==0)for(;!(l=(r=o.call(t)).done)&&(s.push(r.value),s.length!==e);l=!0);}catch(d){u=!0,i=d}finally{try{if(!l&&t.return!=null&&(a=t.return(),Object(a)!==a))return}finally{if(u)throw i}}return s}}function Cy(n){if(Array.isArray(n))return n}function Ae(n,e,t){return(e=wy(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function wy(n){var e=_y(n,"string");return typeof e=="symbol"?e:e+""}function _y(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function Mn(n){return n.isStack}function Ve(n){return n.isComponent}function fd(n){return n.isRoot}class Ne extends it{constructor(e,t,r,i){super(),Ae(this,"config",void 0),Ae(this,"type",void 0),Ae(this,"contentItems",void 0),Ae(this,"parent",void 0),Ae(this,"layoutManager",void 0),Ae(this,"element",void 0),Ae(this,"childElementContainer",void 0),Ae(this,"componentName",void 0),Ae(this,"isInitialised",!1),Ae(this,"isMaximised",!1),Ae(this,"isRoot",!1),Ae(this,"isRow",!1),Ae(this,"isColumn",!1),Ae(this,"isStack",!1),Ae(this,"isComponent",!1),Ae(this,"tab",void 0),Ae(this,"_pendingEventPropagations",void 0),Ae(this,"_throttledEvents",void 0),this.element=i,this.config=this._extendItemNode(t),this.type=t.type,this.contentItems=[],this.parent=r,this.layoutManager=e,this._pendingEventPropagations={},this._throttledEvents=["stateChanged"],this.on(it.ALL_EVENT,this._propagateEvent,this),t.content&&this._createContentItems(t)}callDownwards(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;r!==!0&&i!==!0&&this[e].apply(this,t);for(var o=0;o<this.contentItems.length;o++)this.contentItems[o].callDownwards(e,t,r);r===!0&&i!==!0&&this[e].apply(this,t)}removeChild(e){var t,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,i=this.contentItems.indexOf(e);if(i===-1)throw new Error("Can't remove child item. Unknown content item");if(r!==!0&&this.contentItems[i]._$destroy(),this.contentItems.splice(i,1),(t=this.config.content)===null||t===void 0||t.splice(i,1),this.contentItems.length>0)this.callDownwards("setSize");else if(this.type!=="root"&&this.config.isClosable){var o;(o=this.parent)===null||o===void 0||o.removeChild(this)}}addChild(e,t){e=this.layoutManager._$normalizeContentItem(e,this),t===void 0&&(t=this.contentItems.length),this.contentItems.splice(t,0,e),this.config.content===void 0&&(this.config.content=[]),this.config.content.splice(t,0,e.config),e.parent=this,e.parent.isInitialised===!0&&e.isInitialised===!1&&e._$init()}replaceChild(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;t=this.layoutManager._$normalizeContentItem(t);var i=this.contentItems.indexOf(e),o=e.element[0].parentNode;if(i===-1)throw new Error("Can't replace child. oldChild is not child of this");o==null||o.replaceChild(t.element[0],e.element[0]),r===!0&&(e.parent=null,e._$destroy()),this.contentItems[i]=t,t.parent=this,Mn(this)&&this.header.tabs[i].setContentItem(t),t.parent.isInitialised===!0&&t.isInitialised===!1&&t._$init(),this.callDownwards("setSize")}remove(){var e;(e=this.parent)===null||e===void 0||e.removeChild(this)}popout(){var e=this.layoutManager.createPopout(this);return this.emitBubblingEvent("stateChanged"),e}toggleMaximise(e){e&&e.preventDefault(),this.isMaximised===!0?this.layoutManager._$minimiseItem(this):this.layoutManager._$maximiseItem(this),this.isMaximised=!this.isMaximised,this.emitBubblingEvent("stateChanged")}select(){this.layoutManager.selectedItem!==this&&(this.layoutManager.selectItem(this,!0),this.element.addClass("lm_selected"))}deselect(){this.layoutManager.selectedItem===this&&(this.layoutManager.selectedItem=null,this.element.removeClass("lm_selected"))}setTitle(e){this.config.title=e,this.emit("titleChanged",e),this.emitBubblingEvent("stateChanged")}hasId(e){if(this.config.id){if(typeof this.config.id=="string")return this.config.id===e;if(this.config.id instanceof Array)return this.config.id.indexOf(e)!==-1}else return!1}addId(e){this.hasId(e)||(this.config.id?typeof this.config.id=="string"?this.config.id=[this.config.id,e]:this.config.id instanceof Array&&this.config.id.push(e):this.config.id=e)}removeId(e){if(!this.hasId(e))throw new Error("Id not found");if(typeof this.config.id=="string")delete this.config.id;else if(this.config.id instanceof Array){var t=this.config.id.indexOf(e);this.config.id.splice(t,1)}}getItemsByFilter(e){var t=[],r=function(o){for(var a=0;a<o.contentItems.length;a++)e(o.contentItems[a])===!0&&t.push(o.contentItems[a]),r(o.contentItems[a])};return r(this),t}getItemsById(e){return this.getItemsByFilter(function(t){return t.config.id instanceof Array?t.config.id.indexOf(e)!==-1:t.config.id===e})}getItemsByType(e){return this._$getItemsByProperty("type",e)}getComponentsByName(e){for(var t=this._$getItemsByProperty("componentName",e),r=[],i=0;i<t.length;i++)r.push(t[i].instance);return r}_$getItemsByProperty(e,t){return this.getItemsByFilter(function(r){return r[e]===t})}_$setParent(e){this.parent=e}_$highlightDropZone(e,t,r){var i;(i=this.layoutManager.dropTargetIndicator)===null||i===void 0||i.highlightArea(r)}_$onDrop(e,t){this.addChild(e)}_$hide(){this._callOnActiveComponents("hide"),this.element.hide(),this.layoutManager.updateSize()}_$show(){this._callOnActiveComponents("show"),this.element.show(),this.layoutManager.updateSize()}_callOnActiveComponents(e){for(var t=this.getItemsByType("stack"),r=null,i=0;i<t.length;i++)r=t[i].getActiveContentItem(),r&&Ve(r)&&r.container[e]()}_$destroy(){this.emitBubblingEvent("beforeItemDestroyed"),this.callDownwards("_$destroy",[],!0,!0),this.element.remove(),this.emitBubblingEvent("itemDestroyed")}_$getArea(e){var t,r,i;e=e||this.element;var o=(t=e.offset())!==null&&t!==void 0?t:{left:0,top:0},a=(r=e.width())!==null&&r!==void 0?r:0,s=(i=e.height())!==null&&i!==void 0?i:0;return{x1:o.left,y1:o.top,x2:o.left+a,y2:o.top+s,surface:a*s,contentItem:this,side:""}}_$init(){this.setSize();for(var e=0;e<this.contentItems.length;e++){var t;(t=this.childElementContainer)===null||t===void 0||t.append(this.contentItems[e].element)}this.isInitialised=!0,this.emitBubblingEvent("itemCreated"),this.emitBubblingEvent(this.type+"Created")}emitBubblingEvent(e){var t=new Yi(e,this);this.emit(e,t)}_createContentItems(e){var t;if(!(e.content instanceof Array))throw new Dn("content must be an Array",e);for(var r=0;r<e.content.length;r++)t=this.layoutManager.createContentItem(e.content[r],this),this.contentItems.push(t)}_extendItemNode(e){for(var t of Object.entries(td)){var r=gy(t,2),i=r[0],o=r[1],a=i;e[a]===void 0&&(e[a]=o)}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,Xn(this._propagateEventToLayoutManager.bind(this,e,t)))}_propagateEventToLayoutManager(e,t){this._pendingEventPropagations[e]=!1,this.layoutManager.emit(e,t)}}function Ey(n,e){return Iy(n)||Oy(n,e)||Ty(n,e)||Py()}function Py(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
39
39
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Ty(n,e){if(n){if(typeof n=="string")return Es(n,e);var t={}.toString.call(n).slice(8,-1);return t==="Object"&&n.constructor&&(t=n.constructor.name),t==="Map"||t==="Set"?Array.from(n):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?Es(n,e):void 0}}function Es(n,e){(e==null||e>n.length)&&(e=n.length);for(var t=0,r=Array(e);t<e;t++)r[t]=n[t];return r}function Oy(n,e){var t=n==null?null:typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(t!=null){var r,i,o,a,s=[],l=!0,u=!1;try{if(o=(t=t.call(n)).next,e!==0)for(;!(l=(r=o.call(t)).done)&&(s.push(r.value),s.length!==e);l=!0);}catch(d){u=!0,i=d}finally{try{if(!l&&t.return!=null&&(a=t.return(),Object(a)!==a))return}finally{if(u)throw i}}return s}}function Iy(n){if(Array.isArray(n))return n}function sr(n,e,t){return(e=xy(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function xy(n){var e=Dy(n,"string");return typeof e=="symbol"?e:e+""}function Dy(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class vd extends Ne{constructor(e,t,r){var i;Object.entries((i=e.config.settings.defaultComponentConfig)!==null&&i!==void 0?i:{}).forEach(s=>{var l=Ey(s,2),u=l[0],d=l[1];t[u]===void 0&&(t[u]=d)}),super(e,t,r,A()),sr(this,"config",void 0),sr(this,"componentName",void 0),sr(this,"container",void 0),sr(this,"parent",void 0),sr(this,"instance",void 0),this.config=t,this.parent=r;var o=e.getComponent(this.config.componentName)||e.getFallbackComponent(),a=A.extend(!0,{},this.config.componentState||{});if(o==null)throw new Dn('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 Xi(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(){Ne.prototype._$init.call(this),this.container.emit("open")}_$hide(){this.container.hide(),Ne.prototype._$hide.call(this)}_$show(e){this.container.show(),(this.container._config.isFocusOnShow||e)&&this.container._contentElement[0].focus({preventScroll:!0}),Ne.prototype._$show.call(this)}_$destroy(){this.container.emit("destroy",this),Ne.prototype._$destroy.call(this)}_$getArea(){return null}}function ke(n,e,t){return(e=My(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function My(n){var e=ky(n,"string");return typeof e=="symbol"?e:e+""}function ky(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class qt extends Ne{constructor(e,t,r,i){super(t,r,i,A('<div class="lm_item lm_'+(e?"column":"row")+'"></div>')),ke(this,"isRow",void 0),ke(this,"isColumn",void 0),ke(this,"childElementContainer",void 0),ke(this,"parent",void 0),ke(this,"_splitter",[]),ke(this,"_intersectionSplitter",[]),ke(this,"_splitterSize",void 0),ke(this,"_splitterGrabSize",void 0),ke(this,"_isColumn",void 0),ke(this,"_dimension",void 0),ke(this,"_splitterPosition",null),ke(this,"_splitterMinPosition",null),ke(this,"_splitterMaxPosition",null),ke(this,"_isIntersectionDragging",!1),ke(this,"_activeFourWayPartner",null),ke(this,"_activeFourWaySharedCenterMin",null),ke(this,"_activeFourWaySharedCenterMax",null),ke(this,"_activeFourWayBaseCenter",null),ke(this,"_activeFourWayPartnerBaseCenter",null),this.parent=i,this.isRow=!e,this.isColumn=e,this.childElementContainer=this.element,this._splitterSize=t.config.dimensions.borderWidth,this._splitterGrabSize=t.config.dimensions.borderGrabWidth,this._isColumn=e,this._dimension=e?"height":"width",this._splitterPosition=null,this._splitterMinPosition=null,this._splitterMaxPosition=null}addChild(e,t,r){var i,o,a,s;if(e=this.layoutManager._$normalizeContentItem(e,this),t===void 0&&(t=this.contentItems.length),this.contentItems.length>0?(s=this._createSplitter(Math.max(0,t-1)).element,t>0?(this.contentItems[t-1].element.after(s),s.after(e.element)):(this.contentItems[0].element.before(s),s.before(e.element))):this.childElementContainer.append(e.element),Ne.prototype.addChild.call(this,e,t),i=1/this.contentItems.length*100,r===!0){this.emitBubblingEvent("stateChanged");return}for(a=0;a<this.contentItems.length;a++)if(this.contentItems[a]===e)e.config[this._dimension]=i;else{var l;o=((l=this.contentItems[a].config[this._dimension])!==null&&l!==void 0?l:0)*(100-i)/100,this.contentItems[a].config[this._dimension]=o}this.callDownwards("setSize"),this.emitBubblingEvent("stateChanged")}removeChild(e,t){var r,i=(r=e.config[this._dimension])!==null&&r!==void 0?r:0,o=this.contentItems.indexOf(e),a=Math.max(o-1,0),s,l;if(o===-1)throw new Error("Can't remove child. ContentItem is not child of this Row or Column");for(this._splitter[a]&&(this._splitter[a]._$destroy(),this._splitter.splice(a,1)),s=0;s<this.contentItems.length;s++)if(this.contentItems[s]!==e){var u;this.contentItems[s].config[this._dimension]=((u=this.contentItems[s].config[this._dimension])!==null&&u!==void 0?u:0)+i/(this.contentItems.length-1)}if(Ne.prototype.removeChild.call(this,e,t),this.contentItems.length===1&&this.config.isClosable===!0){var d;l=this.contentItems[0],this.contentItems=[],(d=this.parent)===null||d===void 0||d.replaceChild(this,l,!0)}else this.callDownwards("setSize"),this.emitBubblingEvent("stateChanged")}replaceChild(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,i=e.config[this._dimension];t.config[this._dimension]=i,super.replaceChild(e,t,r),this.callDownwards("setSize"),this.emitBubblingEvent("stateChanged")}setSize(){this.contentItems.length>0&&(this._calculateRelativeSizes(),this._setAbsoluteSizes(),this._scheduleIntersectionRefresh()),this.emitBubblingEvent("stateChanged"),this.emit("resize")}_$init(){if(this.isInitialised!==!0){var e;for(Ne.prototype._$init.call(this),e=0;e<this.contentItems.length-1;e++)this.contentItems[e].element.after(this._createSplitter(e).element);for(e=0;e<this.contentItems.length;e++)this.contentItems[e].isInitialised!==!0&&this.contentItems[e]._$init();this._refreshIntersectionSplitters()}}_setAbsoluteSizes(){var e,t=this._calculateAbsoluteSizes();for(e=0;e<this.contentItems.length;e++)t.additionalPixel-e>0&&t.itemSizes[e]++,this._isColumn?(this.contentItems[e].element.width(t.totalWidth),this.contentItems[e].element.height(t.itemSizes[e])):(this.contentItems[e].element.width(t.itemSizes[e]),this.contentItems[e].element.height(t.totalHeight))}_calculateAbsoluteSizes(){var e,t,r=(this.contentItems.length-1)*this._splitterSize,i=(e=this.element.width())!==null&&e!==void 0?e:0,o=(t=this.element.height())!==null&&t!==void 0?t:0,a=0,s=[];this._isColumn?o-=r:i-=r;for(var l=0;l<this.contentItems.length;l++){var u,d,h=this._isColumn?Math.floor(o*(((u=this.contentItems[l].config.height)!==null&&u!==void 0?u:0)/100)):Math.floor(i*(((d=this.contentItems[l].config.width)!==null&&d!==void 0?d:0)/100));a+=h,s.push(h)}var m=Math.floor((this._isColumn?o:i)-a);return{itemSizes:s,additionalPixel:m,totalWidth:i,totalHeight:o}}_calculateRelativeSizes(){for(var e=0,t=[],r=this._isColumn?"height":"width",i=0;i<this.contentItems.length;i++){var o=this.contentItems[i].config[r];o!=null?e+=o:t.push(this.contentItems[i])}if(Math.round(e)===100){this._respectMinItemWidth();return}if(Math.round(e)<100&&t.length>0){for(var a=0;a<t.length;a++)t[a].config[r]=(100-e)/t.length;this._respectMinItemWidth();return}if(Math.round(e)>100)for(var s=0;s<t.length;s++)t[s].config[r]=50,e+=50;for(var l=0;l<this.contentItems.length;l++){var u;this.contentItems[l].config[r]=((u=this.contentItems[l].config[r])!==null&&u!==void 0?u:0)/e*100}this._respectMinItemWidth()}_respectMinItemWidth(){var e,t=this.layoutManager.config.dimensions&&(e=this.layoutManager.config.dimensions.minItemWidth)!==null&&e!==void 0?e:0,r=[],i=0,o=0,a=0,s=[],l;if(!(this._isColumn||!t||this.contentItems.length<=1)){for(var u=this._calculateAbsoluteSizes(),d=0;d<this.contentItems.length;d++){this.contentItems[d];var h=u.itemSizes[d];h<t?(o+=t-h,l={width:t}):(i+=h-t,l={width:h},r.push(l)),s.push(l)}if(!(o===0||o>i)){var m=o/i;a=o;for(var v=0;v<r.length;v++){l=r[v];var p=Math.round((l.width-t)*m);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/u.totalWidth*100}}}_createSplitter(e){var t;return t=new gd(this._isColumn,this._splitterSize,this._splitterGrabSize),t.on("drag",this._onSplitterDrag.bind(this,t),this),t.on("dragStop",this._onSplitterDragStop.bind(this,t),this),t.on("dragStart",this._onSplitterDragStart.bind(this,t),this),this._splitter.splice(e,0,t),t}_getItemsForSplitter(e){var t=this._splitter.indexOf(e);if(t<0)throw new Error("Splitter not found in RowOrColumn");return{before:this.contentItems[t],after:this.contentItems[t+1]}}_getMinimumDimensions(e){for(var t=0,r=0,i=0;i<e.length;++i){var o,a;t=Math.max((o=e[i].minWidth)!==null&&o!==void 0?o:0,t),r=Math.max((a=e[i].minHeight)!==null&&a!==void 0?a:0,r)}return{horizontal:t,vertical:r}}_onSplitterDragStart(e){var t,r,i,o,a=this._getItemsForSplitter(e),s=this.layoutManager.config.dimensions[this._isColumn?"minItemHeight":"minItemWidth"],l=this._getMinimumDimensions((t=a.before.config.content)!==null&&t!==void 0?t:[]),u=this._isColumn?l.vertical:l.horizontal,d=this._getMinimumDimensions((r=a.after.config.content)!==null&&r!==void 0?r:[]),h=this._isColumn?d.vertical:d.horizontal;this._splitterPosition=0,this._splitterMinPosition=-1*(((i=a.before.element[this._dimension]())!==null&&i!==void 0?i:0)-(u||s)),this._splitterMaxPosition=((o=a.after.element[this._dimension]())!==null&&o!==void 0?o:0)-(h||s)}_onSplitterDrag(e,t,r){var i=this._isColumn?r:t;this._splitterMaxPosition==null||this._splitterMinPosition==null||i>this._splitterMinPosition&&i<this._splitterMaxPosition&&(this._splitterPosition=i,e.element.css(this._isColumn?"top":"left",i))}_onSplitterDragStop(e){this._applySplitterDragStop(e),this._scheduleSetSize()}_applySplitterDragStop(e){var t,r,i,o,a,s=this._getItemsForSplitter(e),l=(t=s.before.element[this._dimension]())!==null&&t!==void 0?t:0,u=(r=s.after.element[this._dimension]())!==null&&r!==void 0?r:0,d=(((i=this._splitterPosition)!==null&&i!==void 0?i:0)+l)/(l+u),h=((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]=d*h,s.after.config[this._dimension]=(1-d)*h,e.element.css({top:0,left:0})}_scheduleSetSize(){Xn(this.callDownwards.bind(this,"setSize",void 0,void 0,void 0)),this._scheduleAncestorIntersectionRefresh()}_scheduleIntersectionRefresh(){Xn(()=>{Xn(this._refreshIntersectionSplitters.bind(this))})}_scheduleAncestorIntersectionRefresh(){for(var e=this.parent;e!=null;)e instanceof qt&&e._scheduleIntersectionRefresh(),e=e.parent}_createIntersectionSplitters(){this.childElementContainer.css("position","relative");for(var e=new Set,t=0;t<this._splitter.length;t++)for(var r=this.contentItems[t],i=this.contentItems[t+1],o=[...this._collectEdgeStemSplitters(r,!1,"b"),...this._collectEdgeStemSplitters(i,!0,"a")],a=0;a<o.length;a++){var s=o[a],l=t+":"+s.path;e.add(l),this._ensureIntersectionSplitter(l,t,s.stemOwner,s.stemSplitterIndex,s.junctionAtNearEdge)}return e}_collectEdgeStemSplitters(e,t,r){if(!(e instanceof qt))return[];if(e._isColumn!==this._isColumn){for(var i=[],o=0;o<e._splitter.length;o++)i.push({stemOwner:e,stemSplitterIndex:o,junctionAtNearEdge:t,path:r+":"+o});for(var a=0;a<e.contentItems.length;a++)i.push(...this._collectEdgeStemSplitters(e.contentItems[a],t,r+"."+a));return i}var s=t?0:e.contentItems.length-1;return this._collectEdgeStemSplitters(e.contentItems[s],t,r+"."+s)}_refreshIntersectionSplitters(){var e=this._intersectionSplitter.length,t=this._createIntersectionSplitters();this._intersectionSplitter=this._intersectionSplitter.filter(i=>t.has(i.key)?!0:(i.splitter._$destroy(),!1));for(var r=0;r<this._intersectionSplitter.length;r++)this._positionIntersectionSplitter(this._intersectionSplitter[r]);this._intersectionSplitter.length!==e&&Xn(()=>{for(var i=0;i<this._intersectionSplitter.length;i++)this._positionIntersectionSplitter(this._intersectionSplitter[i])})}_destroyIntersectionSplitters(){for(var e=0;e<this._intersectionSplitter.length;e++)this._intersectionSplitter[e].splitter._$destroy();this._intersectionSplitter=[]}_$destroy(){this._destroyIntersectionSplitters();for(var e=0;e<this._splitter.length;e++)this._splitter[e]._$destroy();this._splitter=[],Ne.prototype._$destroy.call(this)}static _isAnyDragInProgress(){return A(document.body).hasClass("lm_dragging")||A(document.body).hasClass("lm_intersection_dragging")}_ensureIntersectionSplitter(e,t,r,i,o){var a=this._intersectionSplitter.find(d=>d.key===e);if(a!=null){a.parentSplitterIndex=t,a.stemOwner=r,a.stemSplitterIndex=i,a.junctionAtNearEdge=o;return}var s=new pd(this._splitterSize,this._splitterGrabSize),l={splitter:s,key:e,parentSplitterIndex:t,stemOwner:r,stemSplitterIndex:i,junctionAtNearEdge:o};s.on("dragStart",()=>this._onIntersectionSplitterDragStart(l)),s.on("drag",(d,h)=>this._onIntersectionSplitterDrag(l,d,h)),s.on("dragStop",()=>this._onIntersectionSplitterDragStop(l));var u=null;s.element.on("mouseenter",()=>{this._isIntersectionDragging||qt._isAnyDragInProgress()||(this._setIntersectionHighlight(l,!0),u=this._findNearFourWayPartner(l),u!=null&&this._setIntersectionHighlight(u,!0))}),s.element.on("mouseleave",()=>{this._isIntersectionDragging||A(document.body).hasClass("lm_intersection_dragging")||(this._setIntersectionHighlight(l,!1),u!=null&&(this._setIntersectionHighlight(u,!1),u=null))}),s.element.css({position:"absolute",left:0,top:0,transform:"translate(-50%, -50%)",zIndex:60}),this.childElementContainer.append(s.element),this._intersectionSplitter.push(l)}_positionIntersectionSplitter(e){var t=this._getIntersectionPosition(e);t!=null&&e.splitter.element.css({left:t.left,top:t.top})}_getIntersectionPosition(e){var t,r=this._splitter[e.parentSplitterIndex],i=(t=e.stemOwner)===null||t===void 0?void 0:t._splitter[e.stemSplitterIndex],o=this.childElementContainer[0],a=r==null?void 0:r.element[0],s=i==null?void 0:i.element[0];if(o==null||a==null||s==null)return null;var l=o.getBoundingClientRect(),u=a.getBoundingClientRect(),d=s.getBoundingClientRect(),h=u.left+u.width/2-l.left,m=u.top+u.height/2-l.top,v=d.left+d.width/2-l.left,p=d.top+d.height/2-l.top;return this._isColumn?{left:v,top:m}:{left:h,top:p}}_setIntersectionHighlight(e,t){var r,i=this._splitter[e.parentSplitterIndex],o=(r=e.stemOwner)===null||r===void 0?void 0:r._splitter[e.stemSplitterIndex];i==null||i.element.toggleClass("lm_dragging",t),i==null||i.element.toggleClass("lm_intersection_line",t),o==null||o.element.toggleClass("lm_dragging",t),o==null||o.element.toggleClass("lm_intersection_line",t)}_findNearFourWayPartner(e){var t=this.childElementContainer[0],r=t==null?void 0:t.getBoundingClientRect();if(r==null||r.width===0&&r.height===0)return null;var i=this._getIntersectionPosition(e);if(i==null)return null;for(var o=8,a=null,s=Number.POSITIVE_INFINITY,l=0;l<this._intersectionSplitter.length;l++){var u=this._intersectionSplitter[l];if(!(u.key===e.key||u.parentSplitterIndex!==e.parentSplitterIndex)){var d=this._getIntersectionPosition(u);if(d!=null){var h=Math.abs(d.left-i.left),m=Math.abs(d.top-i.top);if(!(h>o||m>o)){var v=h+m;v<s&&(s=v,a=u)}}}}return a}_setSplitterDragOffset(e,t,r){var i=e._splitterMinPosition,o=e._splitterMaxPosition;if(!(i==null||o==null)){var a=Math.max(i,Math.min(o,r));e._splitterPosition=a,t.element.css(e._isColumn?"top":"left",a)}}_getSplitterAxisCenter(e,t){var r=t.element[0];if(r==null)return null;var i=r.getBoundingClientRect();return e._isColumn?i.top+i.height/2:i.left+i.width/2}_onIntersectionSplitterDragStart(e){var t=this._splitter[e.parentSplitterIndex],r=e.stemOwner._splitter[e.stemSplitterIndex],i=this._findNearFourWayPartner(e),o=i?i.stemOwner._splitter[i.stemSplitterIndex]:null;if(this._onSplitterDragStart(t),e.stemOwner._onSplitterDragStart(r),this._activeFourWaySharedCenterMin=null,this._activeFourWaySharedCenterMax=null,this._activeFourWayBaseCenter=null,this._activeFourWayPartnerBaseCenter=null,i!=null&&o!=null){i.stemOwner._onSplitterDragStart(o);var a=this._getSplitterAxisCenter(e.stemOwner,r),s=this._getSplitterAxisCenter(i.stemOwner,o),l=e.stemOwner._splitterMinPosition,u=e.stemOwner._splitterMaxPosition,d=i.stemOwner._splitterMinPosition,h=i.stemOwner._splitterMaxPosition;if(l!=null&&u!=null&&d!=null&&h!=null&&a!=null&&s!=null){var m=a+l,v=a+u,p=s+d,g=s+h,b=Math.max(m,p),y=Math.min(v,g);b<=y?(this._activeFourWayPartner=i,this._activeFourWaySharedCenterMin=b,this._activeFourWaySharedCenterMax=y,this._activeFourWayBaseCenter=a,this._activeFourWayPartnerBaseCenter=s):this._activeFourWayPartner=null}else this._activeFourWayPartner=null}else this._activeFourWayPartner=null;this._isIntersectionDragging=!0,this._setIntersectionHighlight(e,!0),this._activeFourWayPartner!=null&&this._setIntersectionHighlight(this._activeFourWayPartner,!0),A(document.body).addClass("lm_intersection_dragging")}_onIntersectionSplitterDrag(e,t,r){var i,o,a=this._splitter[e.parentSplitterIndex],s=e.stemOwner._splitter[e.stemSplitterIndex],l=this._activeFourWayPartner,u=l?l.stemOwner._splitter[l.stemSplitterIndex]:null;if(this._onSplitterDrag(a,t,r),l!=null&&u!=null){var d=e.stemOwner._isColumn?r:t,h=this._activeFourWaySharedCenterMin,m=this._activeFourWaySharedCenterMax,v=this._activeFourWayBaseCenter,p=this._activeFourWayPartnerBaseCenter;if(h!=null&&m!=null&&v!=null&&p!=null){var g=v+d,b=Math.max(h,Math.min(m,g));this._setSplitterDragOffset(e.stemOwner,s,b-v),this._setSplitterDragOffset(l.stemOwner,u,b-p)}}else e.stemOwner._onSplitterDrag(s,t,r);var y=(i=this._splitterPosition)!==null&&i!==void 0?i:0,S=(o=e.stemOwner.element[this._dimension]())!==null&&o!==void 0?o:0,E=e.junctionAtNearEdge?S-y:S+y,T=Math.max(this._splitterSize,1),O=Math.max(E,T),L=S>0?O/S:1,G=e.junctionAtNearEdge?this._isColumn?"bottom":"right":this._isColumn?"top":"left";if(s.element.css({"transform-origin":G,transform:this._isColumn?"scaleY(".concat(L,")"):"scaleX(".concat(L,")")}),l!=null&&u!=null){var $,M,j=($=this._splitterPosition)!==null&&$!==void 0?$:0,H=(M=l.stemOwner.element[this._dimension]())!==null&&M!==void 0?M:0,ee=l.junctionAtNearEdge?H-j:H+j,F=Math.max(this._splitterSize,1),X=Math.max(ee,F),ie=H>0?X/H:1,oe=l.junctionAtNearEdge?this._isColumn?"bottom":"right":this._isColumn?"top":"left";u.element.css({"transform-origin":oe,transform:this._isColumn?"scaleY(".concat(ie,")"):"scaleX(".concat(ie,")")})}}_onIntersectionSplitterDragStop(e){var t=this._splitter[e.parentSplitterIndex],r=e.stemOwner._splitter[e.stemSplitterIndex],i=this._activeFourWayPartner,o=i?i.stemOwner._splitter[i.stemSplitterIndex]:null;if(this._applySplitterDragStop(t),i!=null&&o!=null&&this._activeFourWaySharedCenterMin!=null&&this._activeFourWaySharedCenterMax!=null&&this._activeFourWayBaseCenter!=null&&this._activeFourWayPartnerBaseCenter!=null){var a,s=(a=e.stemOwner._splitterPosition)!==null&&a!==void 0?a:0,l=this._activeFourWayBaseCenter+s,u=Math.max(this._activeFourWaySharedCenterMin,Math.min(this._activeFourWaySharedCenterMax,l));this._setSplitterDragOffset(e.stemOwner,r,u-this._activeFourWayBaseCenter),this._setSplitterDragOffset(i.stemOwner,o,u-this._activeFourWayPartnerBaseCenter)}e.stemOwner._applySplitterDragStop(r),i!=null&&o!=null&&i.stemOwner._applySplitterDragStop(o),r.element.css({transform:"","transform-origin":""}),o!=null&&o.element.css({transform:"","transform-origin":""}),this._isIntersectionDragging=!1,this._setIntersectionHighlight(e,!1),i!=null&&this._setIntersectionHighlight(i,!1),this._activeFourWayPartner=null,this._activeFourWaySharedCenterMin=null,this._activeFourWaySharedCenterMax=null,this._activeFourWayBaseCenter=null,this._activeFourWayPartnerBaseCenter=null,A(document.body).removeClass("lm_intersection_dragging"),this._scheduleSetSize()}}function Ps(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function Ts(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Ps(Object(t),!0).forEach(function(r){Qi(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Ps(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function Qi(n,e,t){return(e=Ay(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Ay(n){var e=Ny(n,"string");return typeof e=="symbol"?e:e+""}function Ny(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class Ji extends Ne{constructor(e,t,r){super(e,Ts(Ts({},t),{},{type:"root"}),null,A('<div class="lm_goldenlayout lm_item lm_root"></div>')),Qi(this,"childElementContainer",void 0),Qi(this,"_containerElement",void 0),this.isRoot=!0,this.type="root",this.childElementContainer=this.element,this._containerElement=r,this._containerElement.append(this.element)}addChild(e,t){if(this.contentItems.length>0)throw new Error("Root node can only have a single child");e=this.layoutManager._$normalizeContentItem(e,this),this.childElementContainer.append(e.element),super.addChild(e,t),this.callDownwards("setSize"),this.emitBubblingEvent("stateChanged")}setSize(e,t){var r,i;e=typeof e>"u"?(r=this._containerElement.width())!==null&&r!==void 0?r:0:e,t=typeof t>"u"?(i=this._containerElement.height())!==null&&i!==void 0?i:0:t,this.element.width(e),this.element.height(t),this.contentItems[0]&&(this.contentItems[0].element.width(e),this.contentItems[0].element.height(t))}_$getArea(){var e=super._$getArea();if(e==null)throw new Error("Unable to get root area");return e}_$highlightDropZone(e,t,r){this.layoutManager.tabDropPlaceholder.remove(),super._$highlightDropZone(e,t,r)}_$onDrop(e,t){var r;if(Ve(e)&&(r=this.layoutManager.createContentItem({type:"stack",header:e.config.header||{}},this),r._$init(),r.addChild(e),e=r),!this.contentItems.length)this.addChild(e);else{var i=t.side,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 qt)||l.type!=o){var u=this.layoutManager.createContentItem({type:o},this);this.replaceChild(l,u),u.addChild(e,s?0:void 0,!0),u.addChild(l,s?void 0:0,!0),l.config[a]=50,e.config[a]=50,u.callDownwards("setSize")}else{var d,h=l.contentItems[s?0:l.contentItems.length-1];l.addChild(e,s?0:void 0,!0),h.config[a]=((d=h.config[a])!==null&&d!==void 0?d:0)*.5,e.config[a]=h.config[a],l.callDownwards("setSize")}}}}function jy(n,e){return $y(n)||Ry(n,e)||Fy(n,e)||Ly()}function Ly(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
@@ -47,6 +47,6 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
47
47
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function F0(n,e){if(n){if(typeof n=="string")return sl(n,e);var t={}.toString.call(n).slice(8,-1);return t==="Object"&&n.constructor&&(t=n.constructor.name),t==="Map"||t==="Set"?Array.from(n):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?sl(n,e):void 0}}function sl(n,e){(e==null||e>n.length)&&(e=n.length);for(var t=0,r=Array(e);t<e;t++)r[t]=n[t];return r}function R0(n,e){var t=n==null?null:typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(t!=null){var r,i,o,a,s=[],l=!0,u=!1;try{if(o=(t=t.call(n)).next,e===0){if(Object(t)!==t)return;l=!1}else for(;!(l=(r=o.call(t)).done)&&(s.push(r.value),s.length!==e);l=!0);}catch(d){u=!0,i=d}finally{try{if(!l&&t.return!=null&&(a=t.return(),Object(a)!==a))return}finally{if(u)throw i}}return s}}function $0(n){if(Array.isArray(n))return n}var Ye=z.module("FileList"),H0=500,ll="item-list-scroll-pane";function B0(n){var e=n.isMultiSelect,t=e===void 0?!1:e,r=n.table,i=n.onFocusChange,o=i===void 0?()=>{}:i,a=n.onMove,s=n.onSelect,l=n.onSelectionChange,u=l===void 0?()=>{}:l,d=n.renderItem,h=d===void 0?oo:d,m=n.rowHeight,v=m===void 0?Ao:m,p=n.overscanCount,g=p===void 0?xt.DEFAULT_OVERSCAN:p,b=f.useState(()=>({items:[],offset:0,itemCount:0})),y=_n(b,2),S=y[0],E=y[1],T=f.useState({top:0,bottom:0}),O=_n(T,2),L=O[0],G=O[1],$=f.useState(),M=_n($,2),j=M[0],H=M[1],ee=f.useState(),F=_n(ee,2),X=F[0],ie=F[1],oe=f.useState(),ge=_n(oe,2),we=ge[0],_e=ge[1],Se=f.useState([]),de=_n(Se,2),te=de[0],Y=de[1],ce=f.useRef(),w=f.useRef(null),P=f.useRef(null),_=f.useCallback(N=>{if(N.length===0||S==null)return[];for(var re=[],fe=0;fe<N.length;fe+=1)for(var Xe=N[fe],Ze=Xe[0];Ze<=Xe[1];Ze+=1)Ze>=S.offset&&Ze<S.offset+S.items.length&&re.push(S.items[Ze-S.offset]);return re},[S]),B=f.useCallback(N=>{var re=_([[N,N]]);if(re.length>0)return re[0]},[_]),se=f.useCallback(()=>{var N=Pt.count(te);if(N===0)return null;if(N===1){var re=te[0][0],fe=B(re);if(fe!=null)return fe.filename}return"".concat(N," items")},[B,te]),ot=f.useCallback(N=>{if(!(!X||!j)){Ye.debug("dropItems",X,"to",N);try{var re=ol(X,j),fe=re.files,Xe=re.targetPath;if(a==null||a(fe,Xe),N!=null){var Ze;Y([[N,N]]),(Ze=w.current)===null||Ze===void 0||Ze.focusItem(N)}}catch(Cn){Ye.error("Unable to complete move",Cn)}}},[X,j,a]),gt=f.useCallback((N,re)=>{var fe=S.items[N-S.offset];fe!==void 0&&(Ye.debug("handleItemClick",fe),s(fe,re),It(fe)&&(r==null||r.setExpanded(fe.filename,!fe.isExpanded)))},[S,s,r]),Qt=f.useCallback((N,re)=>{var fe,Xe;Ye.debug2("handleItemDragStart",N,te);var Ze=te;Pt.isSelected(te,N)||(Ze=[[N,N]],Y(Ze)),ie(_(Ze)),(fe=w.current)===null||fe===void 0||fe.resetMouseState();var Cn=document.createElement("div"),wi=document.createElement("div");wi.className="dnd-placeholder-content",wi.innerText=(Xe=se())!==null&&Xe!==void 0?Xe:"",Cn.appendChild(wi),Cn.className="file-list-dnd-placeholder",document.body.appendChild(Cn),re.dataTransfer.setDragImage(Cn,0,0),re.dataTransfer.effectAllowed="move",_e(Cn)},[se,_,te]),wt=f.useCallback((N,re)=>{re.preventDefault(),Ye.debug2("handleItemDragOver",re),H(B(N))},[B]),K=f.useCallback((N,re)=>{Ye.debug("handleItemDragEnd",N),we==null||we.remove(),ie(void 0),H(void 0),_e(void 0)},[we]),ne=f.useCallback((N,re)=>{ot(N)},[ot]),me=f.useCallback(()=>{Ye.debug2("handleItemDragExit"),H(void 0)},[]),Hn=f.useCallback(N=>{N.target instanceof Element&&N.target.classList.contains(ll)&&(N.preventDefault(),Ye.debug2("handleListDragOver",N),H({type:"directory",filename:"/",basename:"/",id:"/"}))},[]),Jt=f.useCallback(N=>{N.target instanceof Element&&N.target.classList.contains(ll)&&(Ye.debug("handleListDrop"),ot())},[ot]),en=f.useCallback(function(N){var re=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(Ye.debug2("handleSelectionChange",N),re===!0||N!==te){Y(N);var fe=_(N);u(fe)}},[_,u,te]),Rt=f.useCallback(N=>{if(Ye.debug2("handleFocusChange",N),N!=null){var re=_([[N,N]]),fe=_n(re,1),Xe=fe[0];o(Xe)}else o();ce.current=N},[_,o]),tn=f.useCallback((N,re)=>{Ye.debug("handleViewportChange",N,re),(N!==L.top||re!==L.bottom)&&G({top:N,bottom:re})},[L]),Ar=f.useMemo(()=>{if(!X||!j)return!1;try{return ol(X,j),Ye.debug("handleValidateDropTarget true"),!0}catch{return Ye.debug("handleValidateDropTarget false"),!1}},[X,j]),$t=n.focusedPath;f.useEffect(()=>{$t!==void 0&&($t==="/"?r.collapseAll():(r.setExpanded($t,!1),r.setExpanded($t,!0)))},[r,$t]),f.useEffect(function(){Ye.debug("updating table viewport",L),r==null||r.setViewport({top:Math.max(0,L.top-g),bottom:L.bottom+g})},[g,r,L]),f.useEffect(function(){var re=r.onUpdate(fe=>{E({items:fe.items.map(Xe=>qr(qr({},Xe),{},{itemName:Xe.basename})),offset:fe.offset,itemCount:r.size})});return()=>{re()}},[r]),f.useEffect(function(){ce.current!=null&&Rt(ce.current),te.length>0&&en(te,!0)},[S,Rt,en,te]),f.useEffect(function(){if(j!=null&&It(j)&&j.filename!=="/"){var re=setTimeout(()=>{j.isExpanded||r==null||r.setExpanded(j.filename,!0)},H0);return()=>clearTimeout(re)}},[j,r]);var Nr=f.useCallback(N=>h(qr(qr({},N),{},{isDragInProgress:X!=null,dropTargetItem:j,draggedItems:X,isDropTargetValid:Ar,onDragStart:Qt,onDragEnd:K,onDragOver:wt,onDragExit:me,onDrop:ne})),[K,me,wt,Qt,ne,X,j,Ar,h]);return c.jsx("div",{ref:P,className:q("file-list",{"is-dragging":X!=null}),onDragOver:Hn,onDrop:Jt,children:c.jsx(xt,{ref:w,items:S.items,itemCount:S.itemCount,offset:S.offset,onFocusChange:Rt,onSelect:gt,onSelectionChange:en,onViewportChange:tn,selectedRanges:te,renderItem:Nr,rowHeight:v,isMultiSelect:t,isDragSelect:!1,isDeselectOnClick:!1})})}var W0={DELETE:pe.createAndAdd({id:"FILE_EXPLORER.DELETE",name:"Delete",shortcut:[D.DELETE],macShortcut:[k.CMD,D.BACKSPACE]}),RENAME:pe.createAndAdd({id:"FILE_EXPLORER.RENAME",name:"Rename",shortcut:[D.ENTER],macShortcut:[D.ENTER]})};const ul={FILE_EXPLORER:W0};function Ni(n,e){return z0(n)||K0(n,e)||V0(n,e)||U0()}function U0(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
48
48
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function V0(n,e){if(n){if(typeof n=="string")return dl(n,e);var t={}.toString.call(n).slice(8,-1);return t==="Object"&&n.constructor&&(t=n.constructor.name),t==="Map"||t==="Set"?Array.from(n):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?dl(n,e):void 0}}function dl(n,e){(e==null||e>n.length)&&(e=n.length);for(var t=0,r=Array(e);t<e;t++)r[t]=n[t];return r}function K0(n,e){var t=n==null?null:typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(t!=null){var r,i,o,a,s=[],l=!0,u=!1;try{if(o=(t=t.call(n)).next,e!==0)for(;!(l=(r=o.call(t)).done)&&(s.push(r.value),s.length!==e);l=!0);}catch(d){u=!0,i=d}finally{try{if(!l&&t.return!=null&&(a=t.return(),Object(a)!==a))return}finally{if(u)throw i}}return s}}function z0(n){if(Array.isArray(n))return n}var cl=z.module("FileListItemEditor"),G0=()=>Promise.resolve();function q0(n){var e=n.item,t=n.onCancel,r=n.onSubmit,i=n.validate,o=i===void 0?G0:i,a=f.useRef(null),s=f.useState(e.basename),l=Ni(s,2),u=l[0],d=l[1],h=f.useState(),m=Ni(h,2),v=m[0],p=m[1],g=f.useState(Promise.resolve()),b=Ni(g,2),y=b[0],S=b[1],E=f.useCallback(()=>{var M;(M=a.current)===null||M===void 0||M.focus()},[a]),T=f.useCallback(M=>M.stopPropagation(),[]),O=f.useCallback(()=>{y.then(()=>{r(u)}).catch(M=>cl.info("Unable to validate name",M))},[r,u,y]);f.useEffect(function(){var j=je.makeCancelable(o(u));return j.then(()=>p(void 0)).catch(H=>{je.isCanceled(H)||p(H)}),S(j),()=>j.cancel()},[o,u]),f.useEffect(function(){E()},[E]);var L=f.useCallback(()=>{cl.debug2("handleBlur"),O()},[O]),G=f.useCallback(M=>{var j=M.target.value;d(j)},[]),$=f.useCallback(M=>{M.stopPropagation();var j=M.key;switch(j){case"Enter":{O();break}case"Escape":{t();break}}},[t,O]);return c.jsxs("div",{className:"file-list-item-editor",children:[c.jsx("input",{type:"text",className:q("form-control file-list-item-editor-input",{"is-invalid":v}),value:u,ref:a,onBlur:L,onKeyDown:$,onChange:G,onClick:T,onDoubleClick:T,onMouseDown:T}),v&&c.jsx("div",{className:"invalid-feedback",children:"".concat(v)})]})}function hl(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function ji(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?hl(Object(t),!0).forEach(function(r){X0(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):hl(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function X0(n,e,t){return(e=Z0(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Z0(n){var e=Y0(n,"string");return typeof e=="symbol"?e:e+""}function Y0(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function Li(n,e){return tw(n)||ew(n,e)||J0(n,e)||Q0()}function Q0(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
49
49
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function J0(n,e){if(n){if(typeof n=="string")return ml(n,e);var t={}.toString.call(n).slice(8,-1);return t==="Object"&&n.constructor&&(t=n.constructor.name),t==="Map"||t==="Set"?Array.from(n):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?ml(n,e):void 0}}function ml(n,e){(e==null||e>n.length)&&(e=n.length);for(var t=0,r=Array(e);t<e;t++)r[t]=n[t];return r}function ew(n,e){var t=n==null?null:typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(t!=null){var r,i,o,a,s=[],l=!0,u=!1;try{if(o=(t=t.call(n)).next,e!==0)for(;!(l=(r=o.call(t)).done)&&(s.push(r.value),s.length!==e);l=!0);}catch(d){u=!0,i=d}finally{try{if(!l&&t.return!=null&&(a=t.return(),Object(a)!==a))return}finally{if(u)throw i}}return s}}function tw(n){if(Array.isArray(n))return n}function Wd(n){var e=n.isMultiSelect,t=e===void 0?!1:e,r=n.focusedPath,i=n.showContextMenu,o=i===void 0?!1:i,a=n.onCreateFile,s=n.onCreateFolder,l=n.onCopy,u=n.onDelete,d=n.onMove,h=n.onRename,m=n.onSelect,v=n.onSelectionChange,p=n.table,g=n.rowHeight,b=g===void 0?Ao:g,y=n.validateRename,S=y===void 0?()=>Promise.resolve():y,E=f.useState(),T=Li(E,2),O=T[0],L=T[1],G=f.useState([]),$=Li(G,2),M=$[0],j=$[1],H=f.useState(),ee=Li(H,2),F=ee[0],X=ee[1],ie=f.useCallback(_=>{j(_),v==null||v(_)},[v]),oe=f.useCallback(_=>{X(_)},[]),ge=f.useCallback(()=>{F&&(l==null||l(F))},[F,l]),we=f.useCallback(()=>{M.length>0&&(u==null||u(M))},[u,M]),_e=f.useCallback(()=>{a==null||a()},[a]),Se=f.useCallback(()=>{F&&(s==null||s(R.getPath(F.filename)))},[F,s]),de=f.useCallback(()=>{F&&L(F)},[F]),te=f.useCallback(()=>{L(void 0)},[]),Y=f.useCallback(_=>{O&&(h==null||h(O,_),L(void 0))},[h,O]),ce=f.useMemo(()=>{if(O)return[];var _=[];return a&&_.push({title:"New File",description:"Create new file",action:_e,group:Z.groups.medium}),s&&_.push({title:"New Folder",description:"Create new folder",action:Se,group:Z.groups.medium}),l&&_.push({title:"Copy File",description:"Copy the selected file",action:ge,group:Z.groups.low,disabled:F==null||It(F)}),u&&M.length>0&&_.push({title:"Delete",description:"Delete",shortcut:ul.FILE_EXPLORER.DELETE,action:we,group:Z.groups.low}),h&&_.push({title:"Rename",description:"Rename",shortcut:ul.FILE_EXPLORER.RENAME,action:de,group:Z.groups.low,disabled:F==null}),_},[ge,we,_e,Se,de,F,l,a,s,u,h,M,O]),w=f.useCallback(_=>(W(O),S(O,_)),[O,S]),P=f.useCallback(_=>{var B=_.item;return O&&O.filename===B.filename?c.jsx(oo,ji(ji({},_),{},{children:c.jsx(q0,{item:B,validate:w,onSubmit:Y,onCancel:te})})):c.jsx(oo,ji({},_))},[te,Y,O,w]);return c.jsxs("div",{className:"file-list-container",children:[p!=null&&c.jsx(B0,{onMove:d,onSelect:m,onSelectionChange:ie,onFocusChange:oe,renderItem:P,rowHeight:b,table:p,isMultiSelect:t,focusedPath:r}),o&&c.jsx(Z,{actions:ce})]})}Wd.displayName="FileListContainer";function fl(n,e,t){return(e=nw(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function nw(n){var e=rw(n,"string");return typeof e=="symbol"?e:e+""}function rw(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class Qr extends vr{constructor(e){super("Name already exists"),fl(this,"isExistingFile",!0),fl(this,"info",void 0),this.info=e}}function vl(n,e,t,r,i,o,a){try{var s=n[o](a),l=s.value}catch(u){return void t(u)}s.done?e(l):Promise.resolve(l).then(r,i)}function pl(n){return function(){var e=this,t=arguments;return new Promise(function(r,i){var o=n.apply(e,t);function a(l){vl(o,r,i,a,s,"next",l)}function s(l){vl(o,r,i,a,s,"throw",l)}a(void 0)})}}function gl(n,e){return sw(n)||aw(n,e)||ow(n,e)||iw()}function iw(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
50
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ow(n,e){if(n){if(typeof n=="string")return bl(n,e);var t={}.toString.call(n).slice(8,-1);return t==="Object"&&n.constructor&&(t=n.constructor.name),t==="Map"||t==="Set"?Array.from(n):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?bl(n,e):void 0}}function bl(n,e){(e==null||e>n.length)&&(e=n.length);for(var t=0,r=Array(e);t<e;t++)r[t]=n[t];return r}function aw(n,e){var t=n==null?null:typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(t!=null){var r,i,o,a,s=[],l=!0,u=!1;try{if(o=(t=t.call(n)).next,e!==0)for(;!(l=(r=o.call(t)).done)&&(s.push(r.value),s.length!==e);l=!0);}catch(d){u=!0,i=d}finally{try{if(!l&&t.return!=null&&(a=t.return(),Object(a)!==a))return}finally{if(u)throw i}}return s}}function sw(n){if(Array.isArray(n))return n}var kt=z.module("FileExplorer");function No(n){var e=n.storage,t=n.isMultiSelect,r=t===void 0?!1:t,i=n.focusedPath,o=n.onCopy,a=o===void 0?()=>{}:o,s=n.onDelete,l=s===void 0?()=>{}:s,u=n.onRename,d=u===void 0?()=>{}:u,h=n.onCreateFile,m=h===void 0?()=>{}:h,v=n.onCreateFolder,p=v===void 0?()=>{}:v,g=n.onSelect,b=n.onSelectionChange,y=n.rowHeight,S=y===void 0?Ao:y,E=f.useState([]),T=gl(E,2),O=T[0],L=T[1],G=f.useState(),$=gl(G,2),M=$[0],j=$[1];f.useEffect(function(){var ce;function w(){return P.apply(this,arguments)}function P(){return P=pl(function*(){kt.debug("initTable"),ce=je.makeCancelable(e.getTable(),_=>_.close());try{j(yield ce)}catch(_){je.isCanceled(_)||kt.error("Unable to initialize table",_)}}),P.apply(this,arguments)}return w(),()=>{ce.cancel()}},[e]);var H=f.useCallback(Y=>{je.isCanceled(Y)||kt.error(Y)},[]),ee=f.useCallback(()=>{kt.debug("handleCreateFile"),m()},[m]),F=f.useCallback(()=>{kt.debug("handleCreateFolder"),p()},[p]),X=f.useCallback(Y=>{kt.debug("handleCopyFile",Y.filename),a(Y)},[a]),ie=f.useCallback(Y=>{kt.debug("handleDelete, pending confirmation",Y),L(Y)},[]),oe=f.useCallback(()=>{kt.debug("handleDeleteConfirm",O),O.forEach(Y=>e.deleteFile(It(Y)?R.makePath(Y.filename):Y.filename)),l(O),L([])},[O,l,e]),ge=f.useCallback(()=>{kt.debug("handleDeleteCancel"),L([])},[]),we=f.useCallback((Y,ce)=>{var w=R.reducePaths(Y.map(P=>It(P)?R.makePath(P.filename):P.filename));w.forEach(P=>{var _=R.isPath(P)?"".concat(ce).concat(R.getBaseName(P.substring(0,P.length-1)),"/"):"".concat(ce).concat(R.getBaseName(P));e.moveFile(P,_).then(()=>{d(P,_)}).catch(H)})},[H,d,e]),_e=f.useCallback((Y,ce)=>{var w=Y.filename,P=It(Y);P&&!w.endsWith("/")&&(w="".concat(w,"/"));var _="".concat(R.getParent(w)).concat(ce);P&&!_.endsWith("/")&&(_="".concat(_,"/")),kt.debug2("handleRename",w,_),e.moveFile(w,_).catch(H),d(w,_)},[H,d,e]),Se=f.useCallback(function(){var Y=pl(function*(ce,w){if(w!==ce.basename){R.validateName(w);var P="".concat(R.getPath(ce.filename)).concat(w);try{var _=yield e.info(P);throw new Qr(_)}catch(B){if(!(B instanceof ko))throw B}}});return function(ce,w){return Y.apply(this,arguments)}}(),[e]),de=O.length>0,te=f.useMemo(()=>O.length===1?'Are you sure you want to delete "'.concat(O[0].filename,'"?'):"Are you sure you want to delete the selected files?",[O]);return c.jsxs("div",{className:"file-explorer",children:[M&&c.jsx(Wd,{isMultiSelect:r,focusedPath:i,showContextMenu:!0,onCopy:X,onCreateFolder:F,onCreateFile:ee,onMove:we,onDelete:ie,onRename:_e,onSelect:g,onSelectionChange:b,rowHeight:S,table:M,validateRename:Se}),c.jsx(yr,{isOpen:de,headerText:te,bodyText:"You cannot undo this action.",onCancel:ge,onConfirm:oe,confirmButtonText:"Delete"})]})}No.displayName="FileExplorer";function yl(n,e,t,r,i,o,a){try{var s=n[o](a),l=s.value}catch(u){return void t(u)}s.done?e(l):Promise.resolve(l).then(r,i)}function lw(n){return function(){var e=this,t=arguments;return new Promise(function(r,i){var o=n.apply(e,t);function a(l){yl(o,r,i,a,s,"next",l)}function s(l){yl(o,r,i,a,s,"throw",l)}a(void 0)})}}function xn(n,e,t){return(e=uw(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function uw(n){var e=dw(n,"string");return typeof e=="symbol"?e:e+""}function dw(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var En=z.module("NewItemModal");class An extends f.PureComponent{static getValidationMessage(e){return e instanceof Qr&&e.info.type==="directory"?"Error: Cannot overwrite existing directory":"".concat(e)}static handleError(e){je.isCanceled(e)||En.error(e)}constructor(e){super(e),xn(this,"inputRef",U.createRef()),xn(this,"cancelableValidatePromise",void 0),xn(this,"cancelableExistingItemPromise",void 0),xn(this,"pending",new wr),xn(this,"pathMap",new Map),xn(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 t=e.defaultValue,r=R.hasPath(t)?R.getPath(t):"/";this.state={isSubmitting:!1,path:r,prevExtension:R.getExtension(t),showExtensionChangeModal:!1,showOverwriteModal:!1,value:R.getBaseName(t)}}componentDidUpdate(e,t){var r=this.props.isOpen,i=e.isOpen,o=this.state,a=o.value,s=o.path;!i&&r&&(this.resetValue(),this.isInitialLoad=!0),i&&r&&(!this.isInitialLoad&&(s!==t.path||a!==t.value)&&this.updateValidationStatus(s,a),this.isInitialLoad=!1)}componentWillUnmount(){this.pending.cancel(),this.cancelableValidatePromise&&this.cancelableValidatePromise.cancel(),this.cancelableExistingItemPromise&&this.cancelableExistingItemPromise.cancel()}resetValue(){var e=this.props,t=e.defaultValue,r=R.hasPath(t)?R.getPath(t):"/";this.setState({path:r,value:R.getBaseName(t),validationError:void 0,prevExtension:R.getExtension(t),isSubmitting:!1})}getValidationPromise(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return this.cancelableValidatePromise&&this.cancelableValidatePromise.cancel(),this.cancelableValidatePromise=je.makeCancelable(this.validateName(e,t,r)),this.cancelableValidatePromise}validateName(e,t,r){var i=this;return lw(function*(){R.validateName(t);var o=i.props,a=o.defaultValue,s=o.storage;if(r){var l="".concat(e).concat(t);if(l!==a)try{var u=yield s.info(l);throw new Qr(u)}catch(d){if(!(d instanceof ko))throw d}}return t})()}updateValidationStatus(e,t){this.getValidationPromise(e,t).then(()=>{this.setState({validationError:void 0})}).catch(this.handleValidationError).catch(An.handleError)}handleModalOpened(){this.focusRenameInput()}handleModalSubmit(){this.submitModal()}handleChange(e){var t=e.target.value;this.setState({value:t})}handleSelect(e){if(En.debug("handleSelect",e),e.type==="directory")this.setState({path:R.makePath(e.filename)});else{var t=e.basename,r=R.getPath(e.filename);this.setState({value:t,path:r},()=>{this.focusRenameInput()})}}handleKeyDown(e){var t=e.key;switch(e.stopPropagation(),t){case"Enter":{e.preventDefault(),this.submitModal();break}case"Escape":{e.preventDefault();var r=this.props.onCancel;r();break}}}handleValidationError(e){if(!(e instanceof vr))throw e;En.debug("Validation error",e),this.setState({validationError:e})}handleOverwriteCancel(){this.setState({showOverwriteModal:!1,isSubmitting:!1})}handleOverwriteConfirm(){this.setState({showOverwriteModal:!1});var e=this.props.onSubmit,t=this.state,r=t.path,i=t.value;En.debug("handleOverwriteConfirm",r,i),e("".concat(r).concat(i),!0)}handleExtensionChangeCancel(){En.debug("handleExtensionChangeCancel"),this.setState(e=>{var t=e.value,r=e.prevExtension,i=R.replaceExtension(t,r);return{showExtensionChangeModal:!1,value:i}}),this.submitModal(!0)}handleExtensionChangeConfirm(){En.debug("handleExtensionChangeConfirm"),this.setState({showExtensionChangeModal:!1}),this.submitModal(!0)}focusRenameInput(){var e=this.inputRef.current;if(e){var t=this.props.type,r=e.value,i=t==="directory"?r.length:r.lastIndexOf(".");e.focus(),e.setSelectionRange(0,i>0?i:r.length)}}submitModal(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;this.setState(t=>{var r=t.prevExtension,i=t.value,o=t.path,a=this.props,s=a.notifyOnExtensionChange,l=a.type;En.debug("submitModal",r,i);var u=R.getExtension(i);return s&&!e&&r!==null&&r!==u?{isSubmitting:!1,showExtensionChangeModal:!0,newExtension:u}:(this.getValidationPromise(o,i,!0).then(d=>{var h=this.props.onSubmit;h("".concat(o).concat(i))}).catch(d=>{if(d instanceof Qr&&l!=="directory"&&d.info.type!=="directory"){this.setState({showOverwriteModal:!0});return}throw d}).catch(d=>{throw je.isCanceled(d)&&this.setState({isSubmitting:!1}),d}).catch(this.handleValidationError).catch(An.handleError),{isSubmitting:!0,showExtensionChangeModal:!1,newExtension:void 0})})}handleBreadcrumbSelect(e){this.setState({path:e})}renderPathButtons(e){var t=e.split("/");return t.pop(),t.map((r,i)=>{for(var o="",a=0;a<i;a+=1)o+="".concat(t[a],"/");return o+="".concat(r,"/"),c.jsxs(U.Fragment,{children:[c.jsx(ae,{kind:"ghost",className:"directory-breadcrumbs",onClick:()=>this.handleBreadcrumbSelect(o),"aria-label":i===0?"Home":void 0,icon:i===0?c.jsx(Ce,{icon:Zc,transform:"right-1.6"}):void 0,tooltip:i===0?"Home":void 0,children:r}),"/"]},o)})}render(){var e=this.props,t=e.storage,r=e.isOpen,i=e.onCancel,o=e.placeholder,a=e.title,s=e.type,l=this.state,u=l.isSubmitting,d=l.path,h=l.showExtensionChangeModal,m=l.showOverwriteModal,v=l.validationError,p=l.value,g=l.prevExtension,b=l.newExtension,y=s==="directory",S=R.fileExtensionToString(g),E=R.fileExtensionToString(b),T=y?"Create":"Save",O=y?"New folder name":"Save file as";return c.jsxs(c.Fragment,{children:[c.jsxs(Fl,{isOpen:r,toggle:i,onOpened:this.handleModalOpened,className:"modal-dialog-centered new-file-modal",children:[c.jsx(Rl,{toggle:i,children:a}),c.jsx($l,{children:c.jsx("form",{children:c.jsxs("div",{className:"d-flex flex-column new-file-modal-content",children:[c.jsxs("div",{className:"flex-grow-0 mb-4",children:[c.jsx("label",{htmlFor:"file-name-input",children:O}),c.jsx("input",{id:"file-name-input",type:"text",autoComplete:"off",autoCapitalize:"none",autoCorrect:"off",spellCheck:"false",className:q("form-control",{"is-invalid":v}),value:p,placeholder:o,ref:this.inputRef,onKeyDown:this.handleKeyDown,onChange:this.handleChange}),v&&c.jsx("div",{className:"invalid-feedback",children:An.getValidationMessage(v)})]}),c.jsxs("div",{className:"flex-grow-0",children:[c.jsx("label",{children:"Directory: /"}),this.renderPathButtons(d)]}),c.jsx("div",{className:"flex-grow-1 file-explorer-container",children:c.jsx(No,{onSelect:this.handleSelect,storage:t,focusedPath:d})})]})})}),c.jsxs(hu,{children:[c.jsx(ae,{kind:"secondary",onClick:i,children:"Cancel"}),c.jsx(ae,{kind:"primary",disabled:u,onClick:this.handleModalSubmit,children:T})]})]}),c.jsx(yr,{isOpen:m,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"}),c.jsx(yr,{isOpen:h,headerText:"Confirm extension change",bodyText:'Are you sure you want to change extension from "'.concat(S,'" to "').concat(E,'"?'),onCancel:this.handleExtensionChangeCancel,onConfirm:this.handleExtensionChangeConfirm,cancelButtonText:'Keep "'.concat(S,'"'),confirmButtonText:'Use "'.concat(E,'"')})]})}}xn(An,"defaultProps",{isOpen:!1,defaultValue:"/",notifyOnExtensionChange:!1,placeholder:"",onSubmit:(n,e)=>{},onCancel:()=>{}});function cw(n){var e=n.createFile,t=n.createFolder,r=n.onSearchChange,i=n.defaultSearchText,o=i===void 0?"":i;return c.jsxs("div",{className:"file-explorer-toolbar",children:[c.jsxs("div",{className:"file-explorer-toolbar-buttons",children:[c.jsx(ae,{kind:"ghost",icon:Xl,tooltip:"New notebook",onClick:e,"aria-label":"New notebook"}),c.jsx(ae,{kind:"ghost",icon:Yc,tooltip:"New folder",onClick:t,"aria-label":"New folder"})]}),r&&c.jsx("div",{className:"file-explorer-toolbar-search",children:c.jsx(Cu,{value:o,onChange:r,placeholder:"Search by name"})})]})}function Sl(n,e,t,r,i,o,a){try{var s=n[o](a),l=s.value}catch(u){return void t(u)}s.done?e(l):Promise.resolve(l).then(r,i)}function hw(n){return function(){var e=this,t=arguments;return new Promise(function(r,i){var o=n.apply(e,t);function a(l){Sl(o,r,i,a,s,"next",l)}function s(l){Sl(o,r,i,a,s,"throw",l)}a(void 0)})}}function Ud(n,e,t){return(e=mw(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function mw(n){var e=fw(n,"string");return typeof e=="symbol"?e:e+""}function fw(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var Pn=z.module("FileExplorerPanel"),vw=(n,e)=>{var t=Au(n),r=Dr(n,e.localDashboardId),i=r??{},o=i.session,a=i.config,s=a==null?void 0:a.type;return{fileStorage:t,language:s,session:o}},pw=ir(vw,null,null,{forwardRef:!0});function gw(n){var e=n;return e!=null&&typeof e.button=="number"}class rr extends U.Component{static handleError(e){Pn.error(e)}static isFocusEvent(e){return gw(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 t=e.session,r=e.language;this.state={isShown:!1,language:r,session:t,showCreateFolder:!1,focusedFilePath:"/"}}componentDidMount(){this.isHidden()||this.setState({isShown:!0})}handleCreateFile(){var e=this.props.glEventHub,t=this.state,r=t.session,i=t.language,o={language:i,value:""};Pn.debug("handleCreateFile",r,i,o),e.emit(J.CREATE_NOTEBOOK,r,i,o)}handleCreateDirectory(){this.setState({showCreateFolder:!0})}handleCreateDirectoryCancel(){Pn.debug("handleCreateDirectoryCancel"),this.setState({showCreateFolder:!1})}handleCreateDirectorySubmit(e){Pn.debug("handleCreateDirectorySubmit",e),this.setState({showCreateFolder:!1});var t=this.props.fileStorage;t.createDirectory(e).catch(rr.handleError)}handleCopyFile(e){var t=this;return hw(function*(){var r=t.props.fileStorage;if(It(e)){Pn.error("Invalid item in handleCopyItem",e);return}var i=yield R.getUniqueCopyFileName(r,e.filename);yield r.copyFile(e.filename,i)})()}handleDelete(e){var t=this.props.glEventHub;e.forEach(r=>{t.emit(J.CLOSE_FILE,{id:r.filename,itemName:r.filename})})}handleSelectionChange(e){var t="/";e.length===1&&(e[0].type==="directory"?t=R.makePath(e[0].filename):t=R.getPath(e[0].filename)),this.setState({focusedFilePath:t})}handleFileSelect(e,t){if(Pn.debug("fileSelect",e),e.type!=="directory"){var r=rr.isFocusEvent(t),i={id:e.filename,itemName:e.filename},o=this.props.glEventHub,a=this.state,s=a.session,l=a.language,u={value:null,language:l};o.emit(J.SELECT_NOTEBOOK,s,l,u,i,r)}}handleRename(e,t){var r=this.props.glEventHub;Pn.debug("handleRename",e,t),r.emit(J.RENAME_FILE,e,t)}handleSessionOpened(e){var t=e.session,r=e.language;this.setState({session:t,language:r})}handleSessionClosed(){this.setState({session:void 0,language:void 0})}handleShow(){this.setState({isShown:!0})}isHidden(){var e=this.props.glContainer,t=e.isHidden;return t}render(){var e=this.props,t=e.fileStorage,r=e.glContainer,i=e.glEventHub,o=this.state,a=o.isShown,s=o.showCreateFolder,l=o.focusedFilePath;return c.jsxs(xr,{className:"file-explorer-panel",componentPanel:this,glContainer:r,glEventHub:i,onSessionOpen:this.handleSessionOpened,onSessionClose:this.handleSessionClosed,onShow:this.handleShow,children:[c.jsx(cw,{createFile:this.handleCreateFile,createFolder:this.handleCreateDirectory}),a&&c.jsx(No,{isMultiSelect:!0,storage:t,onCopy:this.handleCopyFile,onCreateFile:this.handleCreateFile,onCreateFolder:this.handleCreateDirectory,onDelete:this.handleDelete,onRename:this.handleRename,onSelect:this.handleFileSelect,onSelectionChange:this.handleSelectionChange}),c.jsx(An,{isOpen:s,type:"directory",title:"Create New Folder",storage:t,onSubmit:this.handleCreateDirectorySubmit,onCancel:this.handleCreateDirectoryCancel,defaultValue:l})]})}}Ud(rr,"COMPONENT","FileExplorerPanel");Ud(rr,"TITLE","File Explorer");var bw=pw(rr);function Cr(n,e,t){return(e=yw(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function yw(n){var e=Sw(n,"string");return typeof e=="symbol"?e:e+""}function Sw(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var Cl=z.module("LogPanel");class yi extends f.PureComponent{constructor(e){super(e),Cr(this,"isBottomVisible",void 0),Cr(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 t=this.props.session;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){var t=e.session;Cl.debug("Session opened",[t]),this.setState({session:t})}handleSessionClosed(e){Cl.debug("Session closed",e)}updateDimensions(){this.logView&&this.logView.updateDimensions()}render(){var e=this.props,t=e.glContainer,r=e.glEventHub,i=this.state.session;return c.jsxs(xr,{componentPanel:this,glContainer:t,glEventHub:r,onResize:this.handleResize,onHide:this.handleHide,onShow:this.handleShow,onSessionOpen:this.handleSessionOpened,onSessionClose:this.handleSessionClosed,children:[i==null&&c.jsx("div",{className:"log-panel-disconnected-message",children:"Waiting for session connection"}),i!=null&&c.jsx(xe,{session:i,ref:o=>{this.logView=o}})]})}}Cr(yi,"defaultProps",{session:null});Cr(yi,"COMPONENT","LogPanel");Cr(yi,"TITLE","Log");var Cw=(n,e)=>{var t;return{session:(t=Dr(n,e.localDashboardId))===null||t===void 0?void 0:t.session}},ww=ir(Cw,null,null,{forwardRef:!0})(yi);function wl(n,e,t,r,i,o,a){try{var s=n[o](a),l=s.value}catch(u){return void t(u)}s.done?e(l):Promise.resolve(l).then(r,i)}function Xr(n){return function(){var e=this,t=arguments;return new Promise(function(r,i){var o=n.apply(e,t);function a(l){wl(o,r,i,a,s,"next",l)}function s(l){wl(o,r,i,a,s,"throw",l)}a(void 0)})}}function _l(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function ut(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?_l(Object(t),!0).forEach(function(r){Ke(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):_l(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function Ke(n,e,t){return(e=_w(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function _w(n){var e=Ew(n,"string");return typeof e=="symbol"?e:e+""}function Ew(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var Pw=f.lazy(()=>Yl(()=>import("./MarkdownNotebook-BaRDz2Vu.js"),__vite__mapDeps([6,4,3,5,7,8,9,10,11,12]),import.meta.url)),ve=z.module("NotebookPanel"),El=400;class Re extends f.Component{static handleError(e){je.isCanceled(e)||ve.error(e)}static unsavedNotebookCount(){return document.querySelectorAll(".".concat(Re.UNSAVED_INDICATOR_CLASS_NAME,".").concat(Re.UNSAVED_STATUS_CLASS_NAME)).length}static languageFromFileName(e){var t=R.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),Ke(this,"pending",void 0),Ke(this,"debouncedSavePanelState",void 0),Ke(this,"debouncedLoad",void 0),Ke(this,"notebook",void 0),Ke(this,"tabTitleElement",void 0),Ke(this,"tabInitOnce",void 0),Ke(this,"editor",void 0),Ke(this,"getSettings",fn((g,b)=>ut(ut({},g),{},{minimap:{enabled:b}}))),Ke(this,"getOverflowActions",fn((g,b,y,S,E)=>{var T=[{title:"Run",icon:$i,action:this.handleRunAll,disabled:S,shortcut:Fe.NOTEBOOK.RUN,group:Z.groups.high,order:1},{title:"Run Selected",icon:Bo,action:this.handleRunSelected,disabled:S,shortcut:Fe.NOTEBOOK.RUN_SELECTED,group:Z.groups.high,order:2},{title:"Save",icon:Wo,action:this.handleSave,disabled:E,shortcut:Gt.SAVE,group:Z.groups.high,order:3},{title:"Find",icon:Qc,action:this.handleFind,group:Z.groups.high,shortcut:Fe.NOTEBOOK.FIND,order:10},{title:"Copy File",icon:Hl,action:this.handleCopy,group:Z.groups.medium,order:20},{title:"Rename File",icon:Jc,action:this.handleShowRename,group:Z.groups.medium,order:30},{title:"Delete File",icon:zl,action:this.handleDelete,group:Z.groups.medium,order:40},{title:"Show Minimap",icon:g?Yn:void 0,action:this.handleMinimapChange,group:Z.groups.low,shortcut:Fe.NOTEBOOK.MINIMAP,order:20},{title:"Word Wrap",icon:b?Yn:void 0,action:this.handleWordWrapChange,group:Z.groups.low,shortcut:Fe.NOTEBOOK.WORDWRAP,order:30}];return this.canFormat()&&(T.push({title:"Format Document",action:this.handleFormat,group:Z.groups.low,order:10}),T.push({title:"Format on Save",icon:y?Yn:void 0,action:this.handleFormatOnSaveChange,group:Z.groups.low,order:15})),T})),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.handleFormatOnSaveChange=this.handleFormatOnSaveChange.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.handleFormat=this.handleFormat.bind(this),this.canFormat=this.canFormat.bind(this),this.getDropdownOverflowActions=this.getDropdownOverflowActions.bind(this),this.pending=new wr,this.debouncedSavePanelState=Nn(this.savePanelState.bind(this),El),this.debouncedLoad=Nn(this.load.bind(this),El),this.notebook=null,this.tabTitleElement=null,this.tabInitOnce=!1;var t=e.isDashboardActive,r=e.session,i=e.sessionLanguage,o=e.panelState,a={value:"",language:"",wordWrap:"off"},s=null,l=e.isPreview;if(o!=null){var u=o.fileMetadata;s=u===void 0?s:u;var d=o.isPreview;l=d===void 0?l:d;var h=o.settings;a=h===void 0?a:h}var m=s!=null&&R.hasPath(s.itemName),v=m===!0&&a.value!=null||!m&&a.value!=null&&a.value.length>0,p=v?1:0;this.state={error:void 0,isDashboardActive:t,isLoading:!0,isLoaded:!1,isPreview:l,savedChangeCount:0,changeCount:p,fileMetadata:s,settings:a,session:r,sessionLanguage:i,panelState:{fileMetadata:s,settings:a},showCloseModal:!1,showDeleteModal:!1,showSaveAsModal:!1,scriptCode:"",formatOnSave:!1},ve.debug("constructor",e,this.state)}componentDidMount(){var e=this.props,t=e.glContainer,r=e.glEventHub,i=t.tab;i!=null&&this.initTab(i),this.initNotebookContent(),r.on(J.RENAME_FILE,this.handleRenameFile),r.on(ue.DROPPED,this.handlePanelDropped),t.on(J.PROMOTE_FROM_PREVIEW,this.handlePreviewPromotion)}componentDidUpdate(e,t){var r=this.state,i=r.isPreview,o=r.settings,a=o.wordWrap,s=this.props.notebookSettings;i!==t.isPreview&&this.setPreviewStatus(),a!==t.settings.wordWrap&&(this.updateEditorWordWrap(),this.debouncedSavePanelState()),s.isMinimapEnabled!==e.notebookSettings.isMinimapEnabled&&this.updateEditorMinimap()}componentWillUnmount(){this.debouncedSavePanelState.flush(),this.pending.cancel();var e=this.props,t=e.glEventHub,r=e.glContainer,i=this.state,o=i.fileMetadata,a=i.isPreview;t.off(J.RENAME_FILE,this.handleRenameFile),t.off(ue.DROPPED,this.handlePanelDropped),r.off(J.PROMOTE_FROM_PREVIEW,this.handlePreviewPromotion),t.emit(J.UNREGISTER_FILE,o,a)}initTab(e){this.tabInitOnce||(this.tabInitOnce=!0,this.initTabCloseOverride()),this.initTabClasses(e)}initTabCloseOverride(){var e=this.props.glContainer;e.beforeClose(t=>{if((t==null?void 0:t.force)===!0)return!0;var r=this.state,i=r.changeCount,o=r.savedChangeCount;return i!==o?(this.setState({showCloseModal:!0}),!1):!0})}initTabClasses(e){var t=e.element.get(0);W(t);var r=t.querySelector(".lm_title");this.tabTitleElement=r,r==null||r.classList.add("notebook-title"),this.setPreviewStatus()}getNotebookValue(){var e=this.state,t=e.changeCount,r=e.savedChangeCount,i=e.settings,o=i.value;if(t!==r&&this.notebook){var a=this.notebook.getValue();return a??o}return o}initNotebookContent(){var e=this.state,t=e.fileMetadata,r=e.settings,i=e.isPreview;if(t&&t.id){ve.debug("Init content from file"),this.registerFileMetadata(t,i),this.load();return}if(r.value!=null){ve.debug("Use content passed in the settings prop"),this.handleLoadSuccess();return}this.handleLoadError(new Error("Missing file metadata"))}closeFileTabById(e){var t=this.props.glEventHub;t.emit(J.CLOSE_FILE,{id:e})}registerFileMetadata(e,t){var r=this.props,i=r.glEventHub,o=r.metadata,a=o.id;i.emit(J.REGISTER_FILE,a,e,t)}renameTab(e,t){var r=this.props.glEventHub;r.emit(J.RENAME,e,t)}load(){var e=this.state,t=e.fileMetadata,r=e.settings;W(t);var i=t.id,o=this.props.fileStorage;this.pending.add(o.loadFile(i)).then(a=>{var s;ve.debug("Loaded file",a);var l=a.filename,u=this.state.itemName;if(l!==u){var d=this.props.metadata,h=d.id;this.renameTab(h,R.getBaseName(l))}var m=ut(ut({},r),{},{language:(s=Re.languageFromFileName(l))!==null&&s!==void 0?s:""});r.value==null&&(m.value=a.content),r.wordWrap===void 0&&(r.wordWrap="off"),this.setState({fileMetadata:{id:l,itemName:l},settings:m}),this.debouncedSavePanelState()}).then(this.handleLoadSuccess).catch(this.handleLoadError)}save(){var e=this.state.fileMetadata;if(e&&R.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){ve.debug("saveContent",e,t),this.updateSavedChangeCount();var r=this.props.fileStorage;this.pending.add(r.saveFile({filename:e,content:t,basename:e})).then(this.handleSaveSuccess).catch(this.handleSaveError)}updateSavedChangeCount(){this.setState(e=>{var t=e.changeCount;return{savedChangeCount:t}})}setPreviewStatus(){if(this.tabTitleElement){var e=this.state.isPreview;ve.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 t=e.changeCount,r=e.savedChangeCount,i=e.fileMetadata,o=e.isPreview,a=e.settings,s=this.getNotebookValue(),l=t!==r?s:void 0,u=ut(ut({},a),{},{value:s}),d=ut(ut({},a),{},{value:l}),h={settings:d,fileMetadata:i,isPreview:o};return ve.debug("Saving panel state",h),{settings:u,panelState:h}})}handleCloseDiscard(){this.setState({showCloseModal:!1});var e=this.props.glContainer;e.close({force:!0})}handleCloseSave(){if(this.setState({showCloseModal:!1}),this.save()){var e=this.props.glContainer;e.close({force:!0})}}handleCloseCancel(){this.setState({showCloseModal:!1})}handleOverwrite(e){var t=this.props.glEventHub;t.emit(J.CLOSE_FILE,{id:e,itemName:e},{force:!0}),this.focus()}handleCopy(){var e=this;return Xr(function*(){var t=e.props,r=t.fileStorage,i=t.glEventHub,o=t.session,a=e.state,s=a.fileMetadata,l=a.settings;W(s);var u=l.language,d=s.itemName,h=yield R.getUniqueCopyFileName(r,d);ve.debug("handleCopy",s,d,h),yield r.copyFile(d,h);var m={id:h,itemName:h},v={value:null,language:u};i.emit(J.SELECT_NOTEBOOK,o,u,v,m,!0)})()}handleDelete(){ve.debug("handleDelete, pending confirmation"),this.setState({showDeleteModal:!0})}handleDeleteConfirm(){var e=this;return Xr(function*(){var t=e.props,r=t.fileStorage,i=t.glContainer,o=t.glEventHub,a=e.state.fileMetadata;ve.debug("handleDeleteConfirm",a==null?void 0:a.itemName),e.setState({showDeleteModal:!1}),a&&(R.hasPath(a.itemName)&&(yield R.fileExists(r,a.itemName))?(o.emit(J.CLOSE_FILE,a,{force:!0}),r.deleteFile(a.itemName)):i.close({force:!0}))})()}handleDeleteCancel(){this.setState({showDeleteModal:!1})}handleEditorInitialized(e){this.editor=e}handleEditorWillDestroy(){this.editor=void 0}handleEditorChange(e){ve.debug2("handleEditorChanged",e),this.removePreviewStatus(),this.setState(t=>{var r=t.changeCount,i=t.savedChangeCount,o=e.isUndoing,a=e.isRedoing;return o?{changeCount:r-1,savedChangeCount:i}:!a&&r<i?{changeCount:r+1,savedChangeCount:0}:{changeCount:r+1,savedChangeCount:i}}),this.debouncedSavePanelState()}handleFind(){this.notebook&&this.notebook.toggleFind()}updateEditorMinimap(){if(this.editor){var e=this.props.notebookSettings;this.editor.updateOptions({minimap:{enabled:e.isMinimapEnabled}})}}handleMinimapChange(){var e,t=this.props,r=t.notebookSettings,i=t.updateNotebookSettings,o={isMinimapEnabled:!((e=r.isMinimapEnabled)!==null&&e!==void 0&&e)};i(o)}updateEditorWordWrap(){if(this.editor){var e=this.state.settings,t=e.wordWrap;this.editor.updateOptions({wordWrap:t})}}handleWordWrapChange(){this.editor&&this.setState(e=>{var t=e.settings,r=t.wordWrap==="on"?"off":"on";return{settings:ut(ut({},t),{},{wordWrap:r})}})}handleFormatOnSaveChange(){var e,t=this.props,r=t.notebookSettings,i=t.updateNotebookSettings,o={formatOnSave:!((e=r.formatOnSave)!==null&&e!==void 0&&e)};i(o)}handleLinkClick(e){var t=this.props,r=t.notebooksUrl,i=t.session,o=t.sessionLanguage,a=e.currentTarget.href;if(!(!a||!a.startsWith(r))){e.stopPropagation(),e.preventDefault();var s="/".concat(a.substring(r.length)).replace(/%20/g," ");if(s==="/"){ve.debug("Ignoring invalid notebook link",s);return}ve.debug("Notebook link clicked, opening",s);var l=this.props.glEventHub,u={value:null,language:o},d={id:s,itemName:s};l.emit(J.SELECT_NOTEBOOK,i,o,u,d)}}handleLoadSuccess(){this.setState({error:void 0,isLoaded:!0,isLoading:!1})}handleLoadError(e){var t=e;je.isCanceled(t)||(je.isTimedOut(t)&&(t=new Error("File not found.")),ve.error(t),this.setState({error:t,isLoading:!1}))}handleSave(){var e=this;return Xr(function*(){ve.debug("handleSave");var t=e.props.notebookSettings,r=t.formatOnSave,i=r===void 0?!1:r;i&&(yield e.handleFormat()),e.save()})()}handleSaveSuccess(e){var t,r=this.props.fileStorage,i={id:e.filename,itemName:e.filename},o=(t=Re.languageFromFileName(e.filename))!==null&&t!==void 0?t:"";this.setState(a=>{var s=a.fileMetadata,l=ut(ut({},a.settings),{},{language:o});return ve.debug("handleSaveSuccess",i,s,l),s&&R.hasPath(s.itemName)&&s.itemName!==i.itemName&&(ve.debug("handleSaveSuccess deleting old file",s.itemName),r.deleteFile(s.itemName).catch(Re.handleError)),{fileMetadata:i,settings:l,isPreview:!1}}),this.debouncedSavePanelState(),this.registerFileMetadata(i,!1)}handleSaveError(e){je.isCanceled(e)||(this.setState({savedChangeCount:0}),ve.error(e))}handleSaveAsCancel(){this.setState({showSaveAsModal:!1})}handleSaveAsSubmit(e){var t,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;r&&this.handleOverwrite(e),ve.debug("handleSaveAsSubmit",e);var i=this.state.fileMetadata;if(i){var o=i.itemName,a=(t=this.getNotebookValue())!==null&&t!==void 0?t:"";if(this.setState({showSaveAsModal:!1}),R.getBaseName(o)!==R.getBaseName(e)){var s=this.props.metadata,l=s.id;this.renameTab(l,R.getBaseName(e))}this.saveContent(e,a)}}canFormat(){var e;return((e=this.notebook)===null||e===void 0?void 0:e.editor)!=null?ye.canFormat(this.notebook.editor):!1}handleFormat(){var e=this;return Xr(function*(){var t;((t=e.notebook)===null||t===void 0?void 0:t.editor)!=null&&(yield ye.formatDocument(e.notebook.editor))})()}handleRenameFile(e,t,r){var i=this.state,o=i.fileMetadata,a=i.panelState,s=this.props.glContainer;if((o==null?void 0:o.itemName)==="/".concat(t)&&r&&JSON.stringify(a)!==JSON.stringify(r)){s.close();return}o&&o.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){ve.error("Editor is not initialized.");return}this.runCommand((e=this.notebook.getValue())!==null&&e!==void 0?e:void 0)}handleRunSelected(){if(!this.notebook){ve.error("Editor is not initialized.");return}this.runCommand(this.notebook.getSelectedCommand())}handleSessionOpened(e){var t=e.session,r=e.language;this.setState({session:t,sessionLanguage:r})}handleSessionClosed(){this.setState({session:void 0,sessionLanguage:void 0})}handleShow(){var e;ve.debug("handleShow"),(e=this.notebook)===null||e===void 0||e.updateDimensions()}handlePanelDropped(e){var t=this.props.metadata.id;e===t&&this.forceUpdate()}handleShowRename(){this.setState({showSaveAsModal:!0})}handleTab(e){ve.debug("NotebookPanel tab event",e),this.initTab(e)}handleTabFocus(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];ve.debug("handleTabFocus",...t);var i=this.props.glContainer;this.setState({isDashboardActive:!0}),this.notebook&&!i.isHidden&&this.notebook.updateDimensions()}handleTabBlur(){ve.debug("handleTabBlur"),this.setState({isDashboardActive:!1})}handleTabClick(e){ve.debug("handle NotebookPanel tab click"),this.focus(),e.detail===2&&this.removePreviewStatus()}handleTransformLinkUri(e){var t=this.props.notebooksUrl,r=this.state.fileMetadata;if(e.endsWith("/"))return e;if(e.startsWith("/"))return"".concat(t).concat(e.substring(1));var i=r==null?void 0:r.itemName;if(i===void 0)return e;i.charAt(0)==="/"&&(i=i.substring(1));var o=new URL(i,t);return new URL(e,o).href}focus(){requestAnimationFrame(()=>{this.notebook&&this.notebook.focus()})}createNotebook(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"",i=this.props.glEventHub,o=this.state,a=o.session,s=o.sessionLanguage,l=o.settings,u=ut(ut({},l),{},{language:t,value:r}),d={id:null,itemName:e};ve.debug("handleCreateNotebook",a,s,u,d),i.emit(J.CREATE_NOTEBOOK,a,s,u,d)}runCommand(e){if(e===void 0||e===""){ve.debug("Ignoring empty command.");return}this.removePreviewStatus();var t=this.props.glEventHub;t.emit(nt.SEND_COMMAND,e,!1,!0)}removePreviewStatus(){this.setState(e=>{var t=e.isPreview;if(t){var r=this.state.fileMetadata;return r&&this.registerFileMetadata(r,!1),{isPreview:!1}}return null})}getDropdownOverflowActions(){var e=this.props.notebookSettings,t=e.isMinimapEnabled,r=e.formatOnSave,i=this.state,o=i.settings,a=i.session,s=i.sessionLanguage,l=i.isLoaded,u=this.getSettings(o,t??!1),d=a!=null,h=s===u.language,m=!l||!d||!h,v=!l;return this.getOverflowActions(t??!1,u.wordWrap==="on",r??!1,m,v)}render(){var e,t,r,i=this.props,o=i.fileStorage,a=i.glContainer,s=i.glContainer.tab,l=i.glEventHub,u=i.notebookSettings,d=this.state,h=d.changeCount,m=d.savedChangeCount,v=d.error,p=d.isDashboardActive,g=d.isLoaded,b=d.isLoading,y=d.isPreview,S=d.fileMetadata,E=d.session,T=d.sessionLanguage,O=d.settings,L=d.showCloseModal,G=d.showDeleteModal,$=d.showSaveAsModal,M=p&&!a.isHidden&&!y,j=(e=S==null?void 0:S.itemName)!==null&&e!==void 0?e:Re.DEFAULT_NAME,H=j.endsWith(".md"),ee=(S==null?void 0:S.id)!=null,F=this.getSettings(O,(t=u.isMinimapEnabled)!==null&&t!==void 0?t:!1),X=E!=null,ie=T===F.language,oe=!g||!X||!ie,ge=!g,we=[{action:this.handleSave,shortcut:Gt.SAVE},{action:this.handleMinimapChange,shortcut:Fe.NOTEBOOK.MINIMAP},{action:this.handleWordWrapChange,shortcut:Fe.NOTEBOOK.WORDWRAP}],_e=qi.getDisabledRunTooltip(X,ie,"Notebook extension","Run"),Se=qi.getDisabledRunTooltip(X,ie,"Notebook extension","Run Selected"),de=[{title:ee?"Rename":"Save As…",order:10,group:Z.groups.high,action:this.handleShowRename},{title:"Copy File",action:this.handleCopy,group:Z.groups.high,order:20}],te=s==null?void 0:s.element.find(".lm_title_before").get(0);return c.jsxs(c.Fragment,{children:[te!=null&&ui.createPortal(c.jsx("span",{className:q(Re.UNSAVED_INDICATOR_CLASS_NAME,{[Re.UNSAVED_STATUS_CLASS_NAME]:h!==m})}),te),c.jsxs(xr,{className:"notebook-container",componentPanel:this,glContainer:a,glEventHub:l,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:de,renderTabTooltip:()=>j,children:[!H&&c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"notebook-toolbar",children:[c.jsxs("div",{className:"notebook-toolbar-actions",children:[c.jsxs("span",{children:[c.jsx(ae,{kind:"ghost",className:"btn-play btn-run",onClick:this.handleRunAll,disabled:oe,icon:c.jsx(Ce,{icon:$i,transform:"grow-4"}),tooltip:"Run ".concat(Fe.NOTEBOOK.RUN.getDisplayText()),"aria-label":"Run"}),_e!=null&&c.jsx(be,{children:_e})]}),c.jsxs("span",{children:[c.jsx(ae,{kind:"ghost",className:"btn-play btn-run-selected",onClick:this.handleRunSelected,disabled:oe,icon:c.jsx(Ce,{icon:Bo,transform:"grow-4"}),tooltip:"Run Selected ".concat(Fe.NOTEBOOK.RUN_SELECTED.getDisplayText()),"aria-label":"Run Selected"}),Se!=null&&c.jsx(be,{children:Se})]}),c.jsx(ae,{kind:"ghost",className:"btn-save",disabled:ge,onClick:this.handleSave,icon:Wo,tooltip:"Save ".concat(Gt.SAVE.getDisplayText()),"aria-label":"Save"})]}),c.jsx(ae,{kind:"ghost",className:"btn-overflow",disabled:ge,icon:ql,tooltip:"More Actions...",onClick:()=>{},children:c.jsx(Pr,{actions:this.getDropdownOverflowActions,popperOptions:Re.POPPER_OPTIONS})})]}),c.jsx(Yu,{isLoaded:g,isLoading:b,error:v,onChange:this.handleEditorChange,onRunCommand:this.handleRunCommand,session:E,sessionLanguage:T,onEditorInitialized:this.handleEditorInitialized,onEditorWillDestroy:this.handleEditorWillDestroy,settings:F,focusOnMount:M,ref:Y=>{this.notebook=Y}})]}),H&&c.jsx(f.Suspense,{fallback:c.jsx(jn,{"data-testid":"notebook-panel-loading"}),children:c.jsx(Pw,{content:(r=F.value)!==null&&r!==void 0?r:"",onLinkClick:this.handleLinkClick,onRunCode:this.handleRunCommand,transformImageUri:this.handleTransformLinkUri,transformLinkUri:this.handleTransformLinkUri})}),c.jsx(An,{isOpen:$,type:"file",defaultValue:j,title:ee?"Rename":"Save file as",onSubmit:this.handleSaveAsSubmit,onCancel:this.handleSaveAsCancel,notifyOnExtensionChange:!0,storage:o}),c.jsx(yr,{isOpen:G,headerText:'Are you sure you want to delete "'.concat(j,'"?'),bodyText:"You cannot undo this action.",onCancel:this.handleDeleteCancel,onConfirm:this.handleDeleteConfirm,confirmButtonText:"Delete"}),c.jsx(yr,{isOpen:L,headerText:"Do you want to save the changes you made to ".concat(j,"?"),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"}),c.jsx(Z,{actions:we})]})]})}}Ke(Re,"COMPONENT","NotebookPanel");Ke(Re,"POPPER_OPTIONS",{placement:"bottom-end"});Ke(Re,"DEFAULT_NAME","Untitled");Ke(Re,"UNSAVED_INDICATOR_CLASS_NAME","editor-unsaved-indicator");Ke(Re,"UNSAVED_STATUS_CLASS_NAME","is-unsaved");Ke(Re,"defaultProps",{isDashboardActive:!0,isPreview:!1,session:null,sessionLanguage:null,notebookSettings:{isMinimapEnabled:!0}});var Tw=(n,e)=>{var t=Au(n),r=ju(n),i=Dr(n,e.localDashboardId),o=i??{},a=o.session,s=o.config,l=s??{},u=l.type;return{fileStorage:t,notebookSettings:r,session:a,sessionLanguage:u}},Tn=ir(Tw,{updateNotebookSettings:Kv},null,{forwardRef:!0})(Re);function Ow(){var n=PS(ju),e=n.python,t=e===void 0?{}:e,r=t.linter,i=r===void 0?{}:r,o=i.isEnabled,a=o===void 0?!1:o,s=i.config;f.useEffect(function(){V.isRuffEnabled=a,V.setRuffSettings(s)},[a,s])}function Pl(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function Tl(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Pl(Object(t),!0).forEach(function(r){Iw(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Pl(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function Iw(n,e,t){return(e=xw(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function xw(n){var e=Dw(n,"string");return typeof e=="symbol"?e:e+""}function Dw(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function Ol(n,e){return Nw(n)||Aw(n,e)||kw(n,e)||Mw()}function Mw(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
50
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ow(n,e){if(n){if(typeof n=="string")return bl(n,e);var t={}.toString.call(n).slice(8,-1);return t==="Object"&&n.constructor&&(t=n.constructor.name),t==="Map"||t==="Set"?Array.from(n):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?bl(n,e):void 0}}function bl(n,e){(e==null||e>n.length)&&(e=n.length);for(var t=0,r=Array(e);t<e;t++)r[t]=n[t];return r}function aw(n,e){var t=n==null?null:typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(t!=null){var r,i,o,a,s=[],l=!0,u=!1;try{if(o=(t=t.call(n)).next,e!==0)for(;!(l=(r=o.call(t)).done)&&(s.push(r.value),s.length!==e);l=!0);}catch(d){u=!0,i=d}finally{try{if(!l&&t.return!=null&&(a=t.return(),Object(a)!==a))return}finally{if(u)throw i}}return s}}function sw(n){if(Array.isArray(n))return n}var kt=z.module("FileExplorer");function No(n){var e=n.storage,t=n.isMultiSelect,r=t===void 0?!1:t,i=n.focusedPath,o=n.onCopy,a=o===void 0?()=>{}:o,s=n.onDelete,l=s===void 0?()=>{}:s,u=n.onRename,d=u===void 0?()=>{}:u,h=n.onCreateFile,m=h===void 0?()=>{}:h,v=n.onCreateFolder,p=v===void 0?()=>{}:v,g=n.onSelect,b=n.onSelectionChange,y=n.rowHeight,S=y===void 0?Ao:y,E=f.useState([]),T=gl(E,2),O=T[0],L=T[1],G=f.useState(),$=gl(G,2),M=$[0],j=$[1];f.useEffect(function(){var ce;function w(){return P.apply(this,arguments)}function P(){return P=pl(function*(){kt.debug("initTable"),ce=je.makeCancelable(e.getTable(),_=>_.close());try{j(yield ce)}catch(_){je.isCanceled(_)||kt.error("Unable to initialize table",_)}}),P.apply(this,arguments)}return w(),()=>{ce.cancel()}},[e]);var H=f.useCallback(Y=>{je.isCanceled(Y)||kt.error(Y)},[]),ee=f.useCallback(()=>{kt.debug("handleCreateFile"),m()},[m]),F=f.useCallback(()=>{kt.debug("handleCreateFolder"),p()},[p]),X=f.useCallback(Y=>{kt.debug("handleCopyFile",Y.filename),a(Y)},[a]),ie=f.useCallback(Y=>{kt.debug("handleDelete, pending confirmation",Y),L(Y)},[]),oe=f.useCallback(()=>{kt.debug("handleDeleteConfirm",O),O.forEach(Y=>e.deleteFile(It(Y)?R.makePath(Y.filename):Y.filename)),l(O),L([])},[O,l,e]),ge=f.useCallback(()=>{kt.debug("handleDeleteCancel"),L([])},[]),we=f.useCallback((Y,ce)=>{var w=R.reducePaths(Y.map(P=>It(P)?R.makePath(P.filename):P.filename));w.forEach(P=>{var _=R.isPath(P)?"".concat(ce).concat(R.getBaseName(P.substring(0,P.length-1)),"/"):"".concat(ce).concat(R.getBaseName(P));e.moveFile(P,_).then(()=>{d(P,_)}).catch(H)})},[H,d,e]),_e=f.useCallback((Y,ce)=>{var w=Y.filename,P=It(Y);P&&!w.endsWith("/")&&(w="".concat(w,"/"));var _="".concat(R.getParent(w)).concat(ce);P&&!_.endsWith("/")&&(_="".concat(_,"/")),kt.debug2("handleRename",w,_),e.moveFile(w,_).catch(H),d(w,_)},[H,d,e]),Se=f.useCallback(function(){var Y=pl(function*(ce,w){if(w!==ce.basename){R.validateName(w);var P="".concat(R.getPath(ce.filename)).concat(w);try{var _=yield e.info(P);throw new Qr(_)}catch(B){if(!(B instanceof ko))throw B}}});return function(ce,w){return Y.apply(this,arguments)}}(),[e]),de=O.length>0,te=f.useMemo(()=>O.length===1?'Are you sure you want to delete "'.concat(O[0].filename,'"?'):"Are you sure you want to delete the selected files?",[O]);return c.jsxs("div",{className:"file-explorer",children:[M&&c.jsx(Wd,{isMultiSelect:r,focusedPath:i,showContextMenu:!0,onCopy:X,onCreateFolder:F,onCreateFile:ee,onMove:we,onDelete:ie,onRename:_e,onSelect:g,onSelectionChange:b,rowHeight:S,table:M,validateRename:Se}),c.jsx(yr,{isOpen:de,headerText:te,bodyText:"You cannot undo this action.",onCancel:ge,onConfirm:oe,confirmButtonText:"Delete"})]})}No.displayName="FileExplorer";function yl(n,e,t,r,i,o,a){try{var s=n[o](a),l=s.value}catch(u){return void t(u)}s.done?e(l):Promise.resolve(l).then(r,i)}function lw(n){return function(){var e=this,t=arguments;return new Promise(function(r,i){var o=n.apply(e,t);function a(l){yl(o,r,i,a,s,"next",l)}function s(l){yl(o,r,i,a,s,"throw",l)}a(void 0)})}}function xn(n,e,t){return(e=uw(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function uw(n){var e=dw(n,"string");return typeof e=="symbol"?e:e+""}function dw(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var En=z.module("NewItemModal");class An extends f.PureComponent{static getValidationMessage(e){return e instanceof Qr&&e.info.type==="directory"?"Error: Cannot overwrite existing directory":"".concat(e)}static handleError(e){je.isCanceled(e)||En.error(e)}constructor(e){super(e),xn(this,"inputRef",U.createRef()),xn(this,"cancelableValidatePromise",void 0),xn(this,"cancelableExistingItemPromise",void 0),xn(this,"pending",new wr),xn(this,"pathMap",new Map),xn(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 t=e.defaultValue,r=R.hasPath(t)?R.getPath(t):"/";this.state={isSubmitting:!1,path:r,prevExtension:R.getExtension(t),showExtensionChangeModal:!1,showOverwriteModal:!1,value:R.getBaseName(t)}}componentDidUpdate(e,t){var r=this.props.isOpen,i=e.isOpen,o=this.state,a=o.value,s=o.path;!i&&r&&(this.resetValue(),this.isInitialLoad=!0),i&&r&&(!this.isInitialLoad&&(s!==t.path||a!==t.value)&&this.updateValidationStatus(s,a),this.isInitialLoad=!1)}componentWillUnmount(){this.pending.cancel(),this.cancelableValidatePromise&&this.cancelableValidatePromise.cancel(),this.cancelableExistingItemPromise&&this.cancelableExistingItemPromise.cancel()}resetValue(){var e=this.props,t=e.defaultValue,r=R.hasPath(t)?R.getPath(t):"/";this.setState({path:r,value:R.getBaseName(t),validationError:void 0,prevExtension:R.getExtension(t),isSubmitting:!1})}getValidationPromise(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return this.cancelableValidatePromise&&this.cancelableValidatePromise.cancel(),this.cancelableValidatePromise=je.makeCancelable(this.validateName(e,t,r)),this.cancelableValidatePromise}validateName(e,t,r){var i=this;return lw(function*(){R.validateName(t);var o=i.props,a=o.defaultValue,s=o.storage;if(r){var l="".concat(e).concat(t);if(l!==a)try{var u=yield s.info(l);throw new Qr(u)}catch(d){if(!(d instanceof ko))throw d}}return t})()}updateValidationStatus(e,t){this.getValidationPromise(e,t).then(()=>{this.setState({validationError:void 0})}).catch(this.handleValidationError).catch(An.handleError)}handleModalOpened(){this.focusRenameInput()}handleModalSubmit(){this.submitModal()}handleChange(e){var t=e.target.value;this.setState({value:t})}handleSelect(e){if(En.debug("handleSelect",e),e.type==="directory")this.setState({path:R.makePath(e.filename)});else{var t=e.basename,r=R.getPath(e.filename);this.setState({value:t,path:r},()=>{this.focusRenameInput()})}}handleKeyDown(e){var t=e.key;switch(e.stopPropagation(),t){case"Enter":{e.preventDefault(),this.submitModal();break}case"Escape":{e.preventDefault();var r=this.props.onCancel;r();break}}}handleValidationError(e){if(!(e instanceof vr))throw e;En.debug("Validation error",e),this.setState({validationError:e})}handleOverwriteCancel(){this.setState({showOverwriteModal:!1,isSubmitting:!1})}handleOverwriteConfirm(){this.setState({showOverwriteModal:!1});var e=this.props.onSubmit,t=this.state,r=t.path,i=t.value;En.debug("handleOverwriteConfirm",r,i),e("".concat(r).concat(i),!0)}handleExtensionChangeCancel(){En.debug("handleExtensionChangeCancel"),this.setState(e=>{var t=e.value,r=e.prevExtension,i=R.replaceExtension(t,r);return{showExtensionChangeModal:!1,value:i}}),this.submitModal(!0)}handleExtensionChangeConfirm(){En.debug("handleExtensionChangeConfirm"),this.setState({showExtensionChangeModal:!1}),this.submitModal(!0)}focusRenameInput(){var e=this.inputRef.current;if(e){var t=this.props.type,r=e.value,i=t==="directory"?r.length:r.lastIndexOf(".");e.focus(),e.setSelectionRange(0,i>0?i:r.length)}}submitModal(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;this.setState(t=>{var r=t.prevExtension,i=t.value,o=t.path,a=this.props,s=a.notifyOnExtensionChange,l=a.type;En.debug("submitModal",r,i);var u=R.getExtension(i);return s&&!e&&r!==null&&r!==u?{isSubmitting:!1,showExtensionChangeModal:!0,newExtension:u}:(this.getValidationPromise(o,i,!0).then(d=>{var h=this.props.onSubmit;h("".concat(o).concat(i))}).catch(d=>{if(d instanceof Qr&&l!=="directory"&&d.info.type!=="directory"){this.setState({showOverwriteModal:!0});return}throw d}).catch(d=>{throw je.isCanceled(d)&&this.setState({isSubmitting:!1}),d}).catch(this.handleValidationError).catch(An.handleError),{isSubmitting:!0,showExtensionChangeModal:!1,newExtension:void 0})})}handleBreadcrumbSelect(e){this.setState({path:e})}renderPathButtons(e){var t=e.split("/");return t.pop(),t.map((r,i)=>{for(var o="",a=0;a<i;a+=1)o+="".concat(t[a],"/");return o+="".concat(r,"/"),c.jsxs(U.Fragment,{children:[c.jsx(ae,{kind:"ghost",className:"directory-breadcrumbs",onClick:()=>this.handleBreadcrumbSelect(o),"aria-label":i===0?"Home":void 0,icon:i===0?c.jsx(Ce,{icon:Zc,transform:"right-1.6"}):void 0,tooltip:i===0?"Home":void 0,children:r}),"/"]},o)})}render(){var e=this.props,t=e.storage,r=e.isOpen,i=e.onCancel,o=e.placeholder,a=e.title,s=e.type,l=this.state,u=l.isSubmitting,d=l.path,h=l.showExtensionChangeModal,m=l.showOverwriteModal,v=l.validationError,p=l.value,g=l.prevExtension,b=l.newExtension,y=s==="directory",S=R.fileExtensionToString(g),E=R.fileExtensionToString(b),T=y?"Create":"Save",O=y?"New folder name":"Save file as";return c.jsxs(c.Fragment,{children:[c.jsxs(Fl,{isOpen:r,toggle:i,onOpened:this.handleModalOpened,className:"modal-dialog-centered new-file-modal",children:[c.jsx(Rl,{toggle:i,children:a}),c.jsx($l,{children:c.jsx("form",{children:c.jsxs("div",{className:"d-flex flex-column new-file-modal-content",children:[c.jsxs("div",{className:"flex-grow-0 mb-4",children:[c.jsx("label",{htmlFor:"file-name-input",children:O}),c.jsx("input",{id:"file-name-input",type:"text",autoComplete:"off",autoCapitalize:"none",autoCorrect:"off",spellCheck:"false",className:q("form-control",{"is-invalid":v}),value:p,placeholder:o,ref:this.inputRef,onKeyDown:this.handleKeyDown,onChange:this.handleChange}),v&&c.jsx("div",{className:"invalid-feedback",children:An.getValidationMessage(v)})]}),c.jsxs("div",{className:"flex-grow-0",children:[c.jsx("label",{children:"Directory: /"}),this.renderPathButtons(d)]}),c.jsx("div",{className:"flex-grow-1 file-explorer-container",children:c.jsx(No,{onSelect:this.handleSelect,storage:t,focusedPath:d})})]})})}),c.jsxs(hu,{children:[c.jsx(ae,{kind:"secondary",onClick:i,children:"Cancel"}),c.jsx(ae,{kind:"primary",disabled:u,onClick:this.handleModalSubmit,children:T})]})]}),c.jsx(yr,{isOpen:m,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"}),c.jsx(yr,{isOpen:h,headerText:"Confirm extension change",bodyText:'Are you sure you want to change extension from "'.concat(S,'" to "').concat(E,'"?'),onCancel:this.handleExtensionChangeCancel,onConfirm:this.handleExtensionChangeConfirm,cancelButtonText:'Keep "'.concat(S,'"'),confirmButtonText:'Use "'.concat(E,'"')})]})}}xn(An,"defaultProps",{isOpen:!1,defaultValue:"/",notifyOnExtensionChange:!1,placeholder:"",onSubmit:(n,e)=>{},onCancel:()=>{}});function cw(n){var e=n.createFile,t=n.createFolder,r=n.onSearchChange,i=n.defaultSearchText,o=i===void 0?"":i;return c.jsxs("div",{className:"file-explorer-toolbar",children:[c.jsxs("div",{className:"file-explorer-toolbar-buttons",children:[c.jsx(ae,{kind:"ghost",icon:Xl,tooltip:"New notebook",onClick:e,"aria-label":"New notebook"}),c.jsx(ae,{kind:"ghost",icon:Yc,tooltip:"New folder",onClick:t,"aria-label":"New folder"})]}),r&&c.jsx("div",{className:"file-explorer-toolbar-search",children:c.jsx(Cu,{value:o,onChange:r,placeholder:"Search by name"})})]})}function Sl(n,e,t,r,i,o,a){try{var s=n[o](a),l=s.value}catch(u){return void t(u)}s.done?e(l):Promise.resolve(l).then(r,i)}function hw(n){return function(){var e=this,t=arguments;return new Promise(function(r,i){var o=n.apply(e,t);function a(l){Sl(o,r,i,a,s,"next",l)}function s(l){Sl(o,r,i,a,s,"throw",l)}a(void 0)})}}function Ud(n,e,t){return(e=mw(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function mw(n){var e=fw(n,"string");return typeof e=="symbol"?e:e+""}function fw(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var Pn=z.module("FileExplorerPanel"),vw=(n,e)=>{var t=Au(n),r=Dr(n,e.localDashboardId),i=r??{},o=i.session,a=i.config,s=a==null?void 0:a.type;return{fileStorage:t,language:s,session:o}},pw=ir(vw,null,null,{forwardRef:!0});function gw(n){var e=n;return e!=null&&typeof e.button=="number"}class rr extends U.Component{static handleError(e){Pn.error(e)}static isFocusEvent(e){return gw(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 t=e.session,r=e.language;this.state={isShown:!1,language:r,session:t,showCreateFolder:!1,focusedFilePath:"/"}}componentDidMount(){this.isHidden()||this.setState({isShown:!0})}handleCreateFile(){var e=this.props.glEventHub,t=this.state,r=t.session,i=t.language,o={language:i,value:""};Pn.debug("handleCreateFile",r,i,o),e.emit(J.CREATE_NOTEBOOK,r,i,o)}handleCreateDirectory(){this.setState({showCreateFolder:!0})}handleCreateDirectoryCancel(){Pn.debug("handleCreateDirectoryCancel"),this.setState({showCreateFolder:!1})}handleCreateDirectorySubmit(e){Pn.debug("handleCreateDirectorySubmit",e),this.setState({showCreateFolder:!1});var t=this.props.fileStorage;t.createDirectory(e).catch(rr.handleError)}handleCopyFile(e){var t=this;return hw(function*(){var r=t.props.fileStorage;if(It(e)){Pn.error("Invalid item in handleCopyItem",e);return}var i=yield R.getUniqueCopyFileName(r,e.filename);yield r.copyFile(e.filename,i)})()}handleDelete(e){var t=this.props.glEventHub;e.forEach(r=>{t.emit(J.CLOSE_FILE,{id:r.filename,itemName:r.filename})})}handleSelectionChange(e){var t="/";e.length===1&&(e[0].type==="directory"?t=R.makePath(e[0].filename):t=R.getPath(e[0].filename)),this.setState({focusedFilePath:t})}handleFileSelect(e,t){if(Pn.debug("fileSelect",e),e.type!=="directory"){var r=rr.isFocusEvent(t),i={id:e.filename,itemName:e.filename},o=this.props.glEventHub,a=this.state,s=a.session,l=a.language,u={value:null,language:l};o.emit(J.SELECT_NOTEBOOK,s,l,u,i,r)}}handleRename(e,t){var r=this.props.glEventHub;Pn.debug("handleRename",e,t),r.emit(J.RENAME_FILE,e,t)}handleSessionOpened(e){var t=e.session,r=e.language;this.setState({session:t,language:r})}handleSessionClosed(){this.setState({session:void 0,language:void 0})}handleShow(){this.setState({isShown:!0})}isHidden(){var e=this.props.glContainer,t=e.isHidden;return t}render(){var e=this.props,t=e.fileStorage,r=e.glContainer,i=e.glEventHub,o=this.state,a=o.isShown,s=o.showCreateFolder,l=o.focusedFilePath;return c.jsxs(xr,{className:"file-explorer-panel",componentPanel:this,glContainer:r,glEventHub:i,onSessionOpen:this.handleSessionOpened,onSessionClose:this.handleSessionClosed,onShow:this.handleShow,children:[c.jsx(cw,{createFile:this.handleCreateFile,createFolder:this.handleCreateDirectory}),a&&c.jsx(No,{isMultiSelect:!0,storage:t,onCopy:this.handleCopyFile,onCreateFile:this.handleCreateFile,onCreateFolder:this.handleCreateDirectory,onDelete:this.handleDelete,onRename:this.handleRename,onSelect:this.handleFileSelect,onSelectionChange:this.handleSelectionChange}),c.jsx(An,{isOpen:s,type:"directory",title:"Create New Folder",storage:t,onSubmit:this.handleCreateDirectorySubmit,onCancel:this.handleCreateDirectoryCancel,defaultValue:l})]})}}Ud(rr,"COMPONENT","FileExplorerPanel");Ud(rr,"TITLE","File Explorer");var bw=pw(rr);function Cr(n,e,t){return(e=yw(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function yw(n){var e=Sw(n,"string");return typeof e=="symbol"?e:e+""}function Sw(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var Cl=z.module("LogPanel");class yi extends f.PureComponent{constructor(e){super(e),Cr(this,"isBottomVisible",void 0),Cr(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 t=this.props.session;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){var t=e.session;Cl.debug("Session opened",[t]),this.setState({session:t})}handleSessionClosed(e){Cl.debug("Session closed",e)}updateDimensions(){this.logView&&this.logView.updateDimensions()}render(){var e=this.props,t=e.glContainer,r=e.glEventHub,i=this.state.session;return c.jsxs(xr,{componentPanel:this,glContainer:t,glEventHub:r,onResize:this.handleResize,onHide:this.handleHide,onShow:this.handleShow,onSessionOpen:this.handleSessionOpened,onSessionClose:this.handleSessionClosed,children:[i==null&&c.jsx("div",{className:"log-panel-disconnected-message",children:"Waiting for session connection"}),i!=null&&c.jsx(xe,{session:i,ref:o=>{this.logView=o}})]})}}Cr(yi,"defaultProps",{session:null});Cr(yi,"COMPONENT","LogPanel");Cr(yi,"TITLE","Log");var Cw=(n,e)=>{var t;return{session:(t=Dr(n,e.localDashboardId))===null||t===void 0?void 0:t.session}},ww=ir(Cw,null,null,{forwardRef:!0})(yi);function wl(n,e,t,r,i,o,a){try{var s=n[o](a),l=s.value}catch(u){return void t(u)}s.done?e(l):Promise.resolve(l).then(r,i)}function Xr(n){return function(){var e=this,t=arguments;return new Promise(function(r,i){var o=n.apply(e,t);function a(l){wl(o,r,i,a,s,"next",l)}function s(l){wl(o,r,i,a,s,"throw",l)}a(void 0)})}}function _l(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function ut(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?_l(Object(t),!0).forEach(function(r){Ke(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):_l(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function Ke(n,e,t){return(e=_w(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function _w(n){var e=Ew(n,"string");return typeof e=="symbol"?e:e+""}function Ew(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var Pw=f.lazy(()=>Yl(()=>import("./MarkdownNotebook-CJJEAE11.js"),__vite__mapDeps([6,4,3,5,7,8,9,10,11,12]),import.meta.url)),ve=z.module("NotebookPanel"),El=400;class Re extends f.Component{static handleError(e){je.isCanceled(e)||ve.error(e)}static unsavedNotebookCount(){return document.querySelectorAll(".".concat(Re.UNSAVED_INDICATOR_CLASS_NAME,".").concat(Re.UNSAVED_STATUS_CLASS_NAME)).length}static languageFromFileName(e){var t=R.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),Ke(this,"pending",void 0),Ke(this,"debouncedSavePanelState",void 0),Ke(this,"debouncedLoad",void 0),Ke(this,"notebook",void 0),Ke(this,"tabTitleElement",void 0),Ke(this,"tabInitOnce",void 0),Ke(this,"editor",void 0),Ke(this,"getSettings",fn((g,b)=>ut(ut({},g),{},{minimap:{enabled:b}}))),Ke(this,"getOverflowActions",fn((g,b,y,S,E)=>{var T=[{title:"Run",icon:$i,action:this.handleRunAll,disabled:S,shortcut:Fe.NOTEBOOK.RUN,group:Z.groups.high,order:1},{title:"Run Selected",icon:Bo,action:this.handleRunSelected,disabled:S,shortcut:Fe.NOTEBOOK.RUN_SELECTED,group:Z.groups.high,order:2},{title:"Save",icon:Wo,action:this.handleSave,disabled:E,shortcut:Gt.SAVE,group:Z.groups.high,order:3},{title:"Find",icon:Qc,action:this.handleFind,group:Z.groups.high,shortcut:Fe.NOTEBOOK.FIND,order:10},{title:"Copy File",icon:Hl,action:this.handleCopy,group:Z.groups.medium,order:20},{title:"Rename File",icon:Jc,action:this.handleShowRename,group:Z.groups.medium,order:30},{title:"Delete File",icon:zl,action:this.handleDelete,group:Z.groups.medium,order:40},{title:"Show Minimap",icon:g?Yn:void 0,action:this.handleMinimapChange,group:Z.groups.low,shortcut:Fe.NOTEBOOK.MINIMAP,order:20},{title:"Word Wrap",icon:b?Yn:void 0,action:this.handleWordWrapChange,group:Z.groups.low,shortcut:Fe.NOTEBOOK.WORDWRAP,order:30}];return this.canFormat()&&(T.push({title:"Format Document",action:this.handleFormat,group:Z.groups.low,order:10}),T.push({title:"Format on Save",icon:y?Yn:void 0,action:this.handleFormatOnSaveChange,group:Z.groups.low,order:15})),T})),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.handleFormatOnSaveChange=this.handleFormatOnSaveChange.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.handleFormat=this.handleFormat.bind(this),this.canFormat=this.canFormat.bind(this),this.getDropdownOverflowActions=this.getDropdownOverflowActions.bind(this),this.pending=new wr,this.debouncedSavePanelState=Nn(this.savePanelState.bind(this),El),this.debouncedLoad=Nn(this.load.bind(this),El),this.notebook=null,this.tabTitleElement=null,this.tabInitOnce=!1;var t=e.isDashboardActive,r=e.session,i=e.sessionLanguage,o=e.panelState,a={value:"",language:"",wordWrap:"off"},s=null,l=e.isPreview;if(o!=null){var u=o.fileMetadata;s=u===void 0?s:u;var d=o.isPreview;l=d===void 0?l:d;var h=o.settings;a=h===void 0?a:h}var m=s!=null&&R.hasPath(s.itemName),v=m===!0&&a.value!=null||!m&&a.value!=null&&a.value.length>0,p=v?1:0;this.state={error:void 0,isDashboardActive:t,isLoading:!0,isLoaded:!1,isPreview:l,savedChangeCount:0,changeCount:p,fileMetadata:s,settings:a,session:r,sessionLanguage:i,panelState:{fileMetadata:s,settings:a},showCloseModal:!1,showDeleteModal:!1,showSaveAsModal:!1,scriptCode:"",formatOnSave:!1},ve.debug("constructor",e,this.state)}componentDidMount(){var e=this.props,t=e.glContainer,r=e.glEventHub,i=t.tab;i!=null&&this.initTab(i),this.initNotebookContent(),r.on(J.RENAME_FILE,this.handleRenameFile),r.on(ue.DROPPED,this.handlePanelDropped),t.on(J.PROMOTE_FROM_PREVIEW,this.handlePreviewPromotion)}componentDidUpdate(e,t){var r=this.state,i=r.isPreview,o=r.settings,a=o.wordWrap,s=this.props.notebookSettings;i!==t.isPreview&&this.setPreviewStatus(),a!==t.settings.wordWrap&&(this.updateEditorWordWrap(),this.debouncedSavePanelState()),s.isMinimapEnabled!==e.notebookSettings.isMinimapEnabled&&this.updateEditorMinimap()}componentWillUnmount(){this.debouncedSavePanelState.flush(),this.pending.cancel();var e=this.props,t=e.glEventHub,r=e.glContainer,i=this.state,o=i.fileMetadata,a=i.isPreview;t.off(J.RENAME_FILE,this.handleRenameFile),t.off(ue.DROPPED,this.handlePanelDropped),r.off(J.PROMOTE_FROM_PREVIEW,this.handlePreviewPromotion),t.emit(J.UNREGISTER_FILE,o,a)}initTab(e){this.tabInitOnce||(this.tabInitOnce=!0,this.initTabCloseOverride()),this.initTabClasses(e)}initTabCloseOverride(){var e=this.props.glContainer;e.beforeClose(t=>{if((t==null?void 0:t.force)===!0)return!0;var r=this.state,i=r.changeCount,o=r.savedChangeCount;return i!==o?(this.setState({showCloseModal:!0}),!1):!0})}initTabClasses(e){var t=e.element.get(0);W(t);var r=t.querySelector(".lm_title");this.tabTitleElement=r,r==null||r.classList.add("notebook-title"),this.setPreviewStatus()}getNotebookValue(){var e=this.state,t=e.changeCount,r=e.savedChangeCount,i=e.settings,o=i.value;if(t!==r&&this.notebook){var a=this.notebook.getValue();return a??o}return o}initNotebookContent(){var e=this.state,t=e.fileMetadata,r=e.settings,i=e.isPreview;if(t&&t.id){ve.debug("Init content from file"),this.registerFileMetadata(t,i),this.load();return}if(r.value!=null){ve.debug("Use content passed in the settings prop"),this.handleLoadSuccess();return}this.handleLoadError(new Error("Missing file metadata"))}closeFileTabById(e){var t=this.props.glEventHub;t.emit(J.CLOSE_FILE,{id:e})}registerFileMetadata(e,t){var r=this.props,i=r.glEventHub,o=r.metadata,a=o.id;i.emit(J.REGISTER_FILE,a,e,t)}renameTab(e,t){var r=this.props.glEventHub;r.emit(J.RENAME,e,t)}load(){var e=this.state,t=e.fileMetadata,r=e.settings;W(t);var i=t.id,o=this.props.fileStorage;this.pending.add(o.loadFile(i)).then(a=>{var s;ve.debug("Loaded file",a);var l=a.filename,u=this.state.itemName;if(l!==u){var d=this.props.metadata,h=d.id;this.renameTab(h,R.getBaseName(l))}var m=ut(ut({},r),{},{language:(s=Re.languageFromFileName(l))!==null&&s!==void 0?s:""});r.value==null&&(m.value=a.content),r.wordWrap===void 0&&(r.wordWrap="off"),this.setState({fileMetadata:{id:l,itemName:l},settings:m}),this.debouncedSavePanelState()}).then(this.handleLoadSuccess).catch(this.handleLoadError)}save(){var e=this.state.fileMetadata;if(e&&R.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){ve.debug("saveContent",e,t),this.updateSavedChangeCount();var r=this.props.fileStorage;this.pending.add(r.saveFile({filename:e,content:t,basename:e})).then(this.handleSaveSuccess).catch(this.handleSaveError)}updateSavedChangeCount(){this.setState(e=>{var t=e.changeCount;return{savedChangeCount:t}})}setPreviewStatus(){if(this.tabTitleElement){var e=this.state.isPreview;ve.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 t=e.changeCount,r=e.savedChangeCount,i=e.fileMetadata,o=e.isPreview,a=e.settings,s=this.getNotebookValue(),l=t!==r?s:void 0,u=ut(ut({},a),{},{value:s}),d=ut(ut({},a),{},{value:l}),h={settings:d,fileMetadata:i,isPreview:o};return ve.debug("Saving panel state",h),{settings:u,panelState:h}})}handleCloseDiscard(){this.setState({showCloseModal:!1});var e=this.props.glContainer;e.close({force:!0})}handleCloseSave(){if(this.setState({showCloseModal:!1}),this.save()){var e=this.props.glContainer;e.close({force:!0})}}handleCloseCancel(){this.setState({showCloseModal:!1})}handleOverwrite(e){var t=this.props.glEventHub;t.emit(J.CLOSE_FILE,{id:e,itemName:e},{force:!0}),this.focus()}handleCopy(){var e=this;return Xr(function*(){var t=e.props,r=t.fileStorage,i=t.glEventHub,o=t.session,a=e.state,s=a.fileMetadata,l=a.settings;W(s);var u=l.language,d=s.itemName,h=yield R.getUniqueCopyFileName(r,d);ve.debug("handleCopy",s,d,h),yield r.copyFile(d,h);var m={id:h,itemName:h},v={value:null,language:u};i.emit(J.SELECT_NOTEBOOK,o,u,v,m,!0)})()}handleDelete(){ve.debug("handleDelete, pending confirmation"),this.setState({showDeleteModal:!0})}handleDeleteConfirm(){var e=this;return Xr(function*(){var t=e.props,r=t.fileStorage,i=t.glContainer,o=t.glEventHub,a=e.state.fileMetadata;ve.debug("handleDeleteConfirm",a==null?void 0:a.itemName),e.setState({showDeleteModal:!1}),a&&(R.hasPath(a.itemName)&&(yield R.fileExists(r,a.itemName))?(o.emit(J.CLOSE_FILE,a,{force:!0}),r.deleteFile(a.itemName)):i.close({force:!0}))})()}handleDeleteCancel(){this.setState({showDeleteModal:!1})}handleEditorInitialized(e){this.editor=e}handleEditorWillDestroy(){this.editor=void 0}handleEditorChange(e){ve.debug2("handleEditorChanged",e),this.removePreviewStatus(),this.setState(t=>{var r=t.changeCount,i=t.savedChangeCount,o=e.isUndoing,a=e.isRedoing;return o?{changeCount:r-1,savedChangeCount:i}:!a&&r<i?{changeCount:r+1,savedChangeCount:0}:{changeCount:r+1,savedChangeCount:i}}),this.debouncedSavePanelState()}handleFind(){this.notebook&&this.notebook.toggleFind()}updateEditorMinimap(){if(this.editor){var e=this.props.notebookSettings;this.editor.updateOptions({minimap:{enabled:e.isMinimapEnabled}})}}handleMinimapChange(){var e,t=this.props,r=t.notebookSettings,i=t.updateNotebookSettings,o={isMinimapEnabled:!((e=r.isMinimapEnabled)!==null&&e!==void 0&&e)};i(o)}updateEditorWordWrap(){if(this.editor){var e=this.state.settings,t=e.wordWrap;this.editor.updateOptions({wordWrap:t})}}handleWordWrapChange(){this.editor&&this.setState(e=>{var t=e.settings,r=t.wordWrap==="on"?"off":"on";return{settings:ut(ut({},t),{},{wordWrap:r})}})}handleFormatOnSaveChange(){var e,t=this.props,r=t.notebookSettings,i=t.updateNotebookSettings,o={formatOnSave:!((e=r.formatOnSave)!==null&&e!==void 0&&e)};i(o)}handleLinkClick(e){var t=this.props,r=t.notebooksUrl,i=t.session,o=t.sessionLanguage,a=e.currentTarget.href;if(!(!a||!a.startsWith(r))){e.stopPropagation(),e.preventDefault();var s="/".concat(a.substring(r.length)).replace(/%20/g," ");if(s==="/"){ve.debug("Ignoring invalid notebook link",s);return}ve.debug("Notebook link clicked, opening",s);var l=this.props.glEventHub,u={value:null,language:o},d={id:s,itemName:s};l.emit(J.SELECT_NOTEBOOK,i,o,u,d)}}handleLoadSuccess(){this.setState({error:void 0,isLoaded:!0,isLoading:!1})}handleLoadError(e){var t=e;je.isCanceled(t)||(je.isTimedOut(t)&&(t=new Error("File not found.")),ve.error(t),this.setState({error:t,isLoading:!1}))}handleSave(){var e=this;return Xr(function*(){ve.debug("handleSave");var t=e.props.notebookSettings,r=t.formatOnSave,i=r===void 0?!1:r;i&&(yield e.handleFormat()),e.save()})()}handleSaveSuccess(e){var t,r=this.props.fileStorage,i={id:e.filename,itemName:e.filename},o=(t=Re.languageFromFileName(e.filename))!==null&&t!==void 0?t:"";this.setState(a=>{var s=a.fileMetadata,l=ut(ut({},a.settings),{},{language:o});return ve.debug("handleSaveSuccess",i,s,l),s&&R.hasPath(s.itemName)&&s.itemName!==i.itemName&&(ve.debug("handleSaveSuccess deleting old file",s.itemName),r.deleteFile(s.itemName).catch(Re.handleError)),{fileMetadata:i,settings:l,isPreview:!1}}),this.debouncedSavePanelState(),this.registerFileMetadata(i,!1)}handleSaveError(e){je.isCanceled(e)||(this.setState({savedChangeCount:0}),ve.error(e))}handleSaveAsCancel(){this.setState({showSaveAsModal:!1})}handleSaveAsSubmit(e){var t,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;r&&this.handleOverwrite(e),ve.debug("handleSaveAsSubmit",e);var i=this.state.fileMetadata;if(i){var o=i.itemName,a=(t=this.getNotebookValue())!==null&&t!==void 0?t:"";if(this.setState({showSaveAsModal:!1}),R.getBaseName(o)!==R.getBaseName(e)){var s=this.props.metadata,l=s.id;this.renameTab(l,R.getBaseName(e))}this.saveContent(e,a)}}canFormat(){var e;return((e=this.notebook)===null||e===void 0?void 0:e.editor)!=null?ye.canFormat(this.notebook.editor):!1}handleFormat(){var e=this;return Xr(function*(){var t;((t=e.notebook)===null||t===void 0?void 0:t.editor)!=null&&(yield ye.formatDocument(e.notebook.editor))})()}handleRenameFile(e,t,r){var i=this.state,o=i.fileMetadata,a=i.panelState,s=this.props.glContainer;if((o==null?void 0:o.itemName)==="/".concat(t)&&r&&JSON.stringify(a)!==JSON.stringify(r)){s.close();return}o&&o.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){ve.error("Editor is not initialized.");return}this.runCommand((e=this.notebook.getValue())!==null&&e!==void 0?e:void 0)}handleRunSelected(){if(!this.notebook){ve.error("Editor is not initialized.");return}this.runCommand(this.notebook.getSelectedCommand())}handleSessionOpened(e){var t=e.session,r=e.language;this.setState({session:t,sessionLanguage:r})}handleSessionClosed(){this.setState({session:void 0,sessionLanguage:void 0})}handleShow(){var e;ve.debug("handleShow"),(e=this.notebook)===null||e===void 0||e.updateDimensions()}handlePanelDropped(e){var t=this.props.metadata.id;e===t&&this.forceUpdate()}handleShowRename(){this.setState({showSaveAsModal:!0})}handleTab(e){ve.debug("NotebookPanel tab event",e),this.initTab(e)}handleTabFocus(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];ve.debug("handleTabFocus",...t);var i=this.props.glContainer;this.setState({isDashboardActive:!0}),this.notebook&&!i.isHidden&&this.notebook.updateDimensions()}handleTabBlur(){ve.debug("handleTabBlur"),this.setState({isDashboardActive:!1})}handleTabClick(e){ve.debug("handle NotebookPanel tab click"),this.focus(),e.detail===2&&this.removePreviewStatus()}handleTransformLinkUri(e){var t=this.props.notebooksUrl,r=this.state.fileMetadata;if(e.endsWith("/"))return e;if(e.startsWith("/"))return"".concat(t).concat(e.substring(1));var i=r==null?void 0:r.itemName;if(i===void 0)return e;i.charAt(0)==="/"&&(i=i.substring(1));var o=new URL(i,t);return new URL(e,o).href}focus(){requestAnimationFrame(()=>{this.notebook&&this.notebook.focus()})}createNotebook(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"",i=this.props.glEventHub,o=this.state,a=o.session,s=o.sessionLanguage,l=o.settings,u=ut(ut({},l),{},{language:t,value:r}),d={id:null,itemName:e};ve.debug("handleCreateNotebook",a,s,u,d),i.emit(J.CREATE_NOTEBOOK,a,s,u,d)}runCommand(e){if(e===void 0||e===""){ve.debug("Ignoring empty command.");return}this.removePreviewStatus();var t=this.props.glEventHub;t.emit(nt.SEND_COMMAND,e,!1,!0)}removePreviewStatus(){this.setState(e=>{var t=e.isPreview;if(t){var r=this.state.fileMetadata;return r&&this.registerFileMetadata(r,!1),{isPreview:!1}}return null})}getDropdownOverflowActions(){var e=this.props.notebookSettings,t=e.isMinimapEnabled,r=e.formatOnSave,i=this.state,o=i.settings,a=i.session,s=i.sessionLanguage,l=i.isLoaded,u=this.getSettings(o,t??!1),d=a!=null,h=s===u.language,m=!l||!d||!h,v=!l;return this.getOverflowActions(t??!1,u.wordWrap==="on",r??!1,m,v)}render(){var e,t,r,i=this.props,o=i.fileStorage,a=i.glContainer,s=i.glContainer.tab,l=i.glEventHub,u=i.notebookSettings,d=this.state,h=d.changeCount,m=d.savedChangeCount,v=d.error,p=d.isDashboardActive,g=d.isLoaded,b=d.isLoading,y=d.isPreview,S=d.fileMetadata,E=d.session,T=d.sessionLanguage,O=d.settings,L=d.showCloseModal,G=d.showDeleteModal,$=d.showSaveAsModal,M=p&&!a.isHidden&&!y,j=(e=S==null?void 0:S.itemName)!==null&&e!==void 0?e:Re.DEFAULT_NAME,H=j.endsWith(".md"),ee=(S==null?void 0:S.id)!=null,F=this.getSettings(O,(t=u.isMinimapEnabled)!==null&&t!==void 0?t:!1),X=E!=null,ie=T===F.language,oe=!g||!X||!ie,ge=!g,we=[{action:this.handleSave,shortcut:Gt.SAVE},{action:this.handleMinimapChange,shortcut:Fe.NOTEBOOK.MINIMAP},{action:this.handleWordWrapChange,shortcut:Fe.NOTEBOOK.WORDWRAP}],_e=qi.getDisabledRunTooltip(X,ie,"Notebook extension","Run"),Se=qi.getDisabledRunTooltip(X,ie,"Notebook extension","Run Selected"),de=[{title:ee?"Rename":"Save As…",order:10,group:Z.groups.high,action:this.handleShowRename},{title:"Copy File",action:this.handleCopy,group:Z.groups.high,order:20}],te=s==null?void 0:s.element.find(".lm_title_before").get(0);return c.jsxs(c.Fragment,{children:[te!=null&&ui.createPortal(c.jsx("span",{className:q(Re.UNSAVED_INDICATOR_CLASS_NAME,{[Re.UNSAVED_STATUS_CLASS_NAME]:h!==m})}),te),c.jsxs(xr,{className:"notebook-container",componentPanel:this,glContainer:a,glEventHub:l,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:de,renderTabTooltip:()=>j,children:[!H&&c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"notebook-toolbar",children:[c.jsxs("div",{className:"notebook-toolbar-actions",children:[c.jsxs("span",{children:[c.jsx(ae,{kind:"ghost",className:"btn-play btn-run",onClick:this.handleRunAll,disabled:oe,icon:c.jsx(Ce,{icon:$i,transform:"grow-4"}),tooltip:"Run ".concat(Fe.NOTEBOOK.RUN.getDisplayText()),"aria-label":"Run"}),_e!=null&&c.jsx(be,{children:_e})]}),c.jsxs("span",{children:[c.jsx(ae,{kind:"ghost",className:"btn-play btn-run-selected",onClick:this.handleRunSelected,disabled:oe,icon:c.jsx(Ce,{icon:Bo,transform:"grow-4"}),tooltip:"Run Selected ".concat(Fe.NOTEBOOK.RUN_SELECTED.getDisplayText()),"aria-label":"Run Selected"}),Se!=null&&c.jsx(be,{children:Se})]}),c.jsx(ae,{kind:"ghost",className:"btn-save",disabled:ge,onClick:this.handleSave,icon:Wo,tooltip:"Save ".concat(Gt.SAVE.getDisplayText()),"aria-label":"Save"})]}),c.jsx(ae,{kind:"ghost",className:"btn-overflow",disabled:ge,icon:ql,tooltip:"More Actions...",onClick:()=>{},children:c.jsx(Pr,{actions:this.getDropdownOverflowActions,popperOptions:Re.POPPER_OPTIONS})})]}),c.jsx(Yu,{isLoaded:g,isLoading:b,error:v,onChange:this.handleEditorChange,onRunCommand:this.handleRunCommand,session:E,sessionLanguage:T,onEditorInitialized:this.handleEditorInitialized,onEditorWillDestroy:this.handleEditorWillDestroy,settings:F,focusOnMount:M,ref:Y=>{this.notebook=Y}})]}),H&&c.jsx(f.Suspense,{fallback:c.jsx(jn,{"data-testid":"notebook-panel-loading"}),children:c.jsx(Pw,{content:(r=F.value)!==null&&r!==void 0?r:"",onLinkClick:this.handleLinkClick,onRunCode:this.handleRunCommand,transformImageUri:this.handleTransformLinkUri,transformLinkUri:this.handleTransformLinkUri})}),c.jsx(An,{isOpen:$,type:"file",defaultValue:j,title:ee?"Rename":"Save file as",onSubmit:this.handleSaveAsSubmit,onCancel:this.handleSaveAsCancel,notifyOnExtensionChange:!0,storage:o}),c.jsx(yr,{isOpen:G,headerText:'Are you sure you want to delete "'.concat(j,'"?'),bodyText:"You cannot undo this action.",onCancel:this.handleDeleteCancel,onConfirm:this.handleDeleteConfirm,confirmButtonText:"Delete"}),c.jsx(yr,{isOpen:L,headerText:"Do you want to save the changes you made to ".concat(j,"?"),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"}),c.jsx(Z,{actions:we})]})]})}}Ke(Re,"COMPONENT","NotebookPanel");Ke(Re,"POPPER_OPTIONS",{placement:"bottom-end"});Ke(Re,"DEFAULT_NAME","Untitled");Ke(Re,"UNSAVED_INDICATOR_CLASS_NAME","editor-unsaved-indicator");Ke(Re,"UNSAVED_STATUS_CLASS_NAME","is-unsaved");Ke(Re,"defaultProps",{isDashboardActive:!0,isPreview:!1,session:null,sessionLanguage:null,notebookSettings:{isMinimapEnabled:!0}});var Tw=(n,e)=>{var t=Au(n),r=ju(n),i=Dr(n,e.localDashboardId),o=i??{},a=o.session,s=o.config,l=s??{},u=l.type;return{fileStorage:t,notebookSettings:r,session:a,sessionLanguage:u}},Tn=ir(Tw,{updateNotebookSettings:Kv},null,{forwardRef:!0})(Re);function Ow(){var n=PS(ju),e=n.python,t=e===void 0?{}:e,r=t.linter,i=r===void 0?{}:r,o=i.isEnabled,a=o===void 0?!1:o,s=i.config;f.useEffect(function(){V.isRuffEnabled=a,V.setRuffSettings(s)},[a,s])}function Pl(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function Tl(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Pl(Object(t),!0).forEach(function(r){Iw(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Pl(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function Iw(n,e,t){return(e=xw(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function xw(n){var e=Dw(n,"string");return typeof e=="symbol"?e:e+""}function Dw(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function Ol(n,e){return Nw(n)||Aw(n,e)||kw(n,e)||Mw()}function Mw(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
51
51
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function kw(n,e){if(n){if(typeof n=="string")return Il(n,e);var t={}.toString.call(n).slice(8,-1);return t==="Object"&&n.constructor&&(t=n.constructor.name),t==="Map"||t==="Set"?Array.from(n):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?Il(n,e):void 0}}function Il(n,e){(e==null||e>n.length)&&(e=n.length);for(var t=0,r=Array(e);t<e;t++)r[t]=n[t];return r}function Aw(n,e){var t=n==null?null:typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(t!=null){var r,i,o,a,s=[],l=!0,u=!1;try{if(o=(t=t.call(n)).next,e!==0)for(;!(l=(r=o.call(t)).done)&&(s.push(r.value),s.length!==e);l=!0);}catch(d){u=!0,i=d}finally{try{if(!l&&t.return!=null&&(a=t.return(),Object(a)!==a))return}finally{if(u)throw i}}return s}}function Nw(n){if(Array.isArray(n))return n}var Pe=z.module("ConsolePlugin");function xl(n){return n.notebook!==void 0}function jw(n){dS(n)}function UE(n){jw(n);var e=n.id,t=n.hydrateConsole,r=n.layout,i=n.panelManager,o=n.registerComponent,a=n.notebooksUrl,s=f.useRef(0),l=f.useState(new Map),u=Ol(l,2),d=u[0],h=u[1],m=f.useState(new Map),v=Ol(m,2),p=v[0],g=v[1];Ow();var b=ao(),y=f.useCallback(()=>i.getLastUsedPanelOfType(Ai),[i]),S=f.useCallback((w,P)=>{h(_=>new Map(_.set(w,P)))},[h]),E=f.useCallback(w=>{h(P=>(P.delete(w),new Map(P)))},[h]),T=f.useCallback((w,P)=>{g(_=>new Map(_.set(w,P)))},[g]),O=f.useCallback(w=>{g(P=>(P.delete(w),new Map(P)))},[g]),L=f.useCallback(function(w){var P=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,_=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,B=w&&w.trim();if(!B)Pe.info("Ignoring empty code");else{var se=y();if(!se||!(se instanceof Ai.WrappedComponent)){Pe.error("Console panel not found");return}Pe.debug("Send command: ",w,P,_),se.addCommand(w,P,_)}},[y]),G=f.useCallback(w=>{b(qC(e,w))},[b,e]),$=f.useCallback(w=>{var P=w.language,_=P==="python"?"py":P,B=null;return _==null?(Pe.debug("No extension for language",P),B="Untitled-".concat(s.current)):B="Untitled-".concat(s.current,".").concat(_),s.current+=1,B},[]),M=f.useCallback(function(w){var P=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,_=w.id;if(_!=null&&d.has(_))return d.get(_);if(_!=null&&p.has(_))return p.get(_);if(P)return Nt()},[d,p]),j=f.useCallback((w,P)=>{x.renameComponent(r.root,{id:w},P)},[r.root]),H=f.useCallback((w,P)=>{Pe.debug("Rename file panel",w,P);var _;if(d.has(w)&&(_=d.get(w),E(w),_!=null&&S(P,_)),p.has(w)&&(_=p.get(w),O(w),_!=null&&T(P,_)),_===void 0){Pe.debug2("File ".concat(w," isn't open, no need to rename the tab"));return}j(_,R.getBaseName(P))},[d,p,j,S,T,E,O]),ee=f.useCallback(w=>{var P=M(w,!1);if(P==null){Pe.error("Could not find panel id for file metadata",w);return}x.activateTab(r.root,{id:P})},[M,r.root]),F=f.useCallback((w,P,_)=>{if(Pe.debug("registerFilePanel",w,P,_),P==null||P.id==null){Pe.debug("Ignore empty file id",P);return}var B=P.id;if(_){T(B,w);return}if(d.has(B)){var se=d.get(B);if(w===se){Pe.debug("Update tab title for file ".concat(B));var ot=P.itemName;H(B,ot)}else Pe.error("File ".concat(B," already associated with a different tab ").concat(se));return}S(B,w),p.has(B)&&O(B)},[d,p,H,S,T,O]),X=f.useCallback((w,P)=>{if(Pe.debug("unregisterFileTab",w,P),w==null||w.id==null){Pe.debug("Ignore empty file id",w);return}var _=w.id;if(P){O(_);return}E(_)},[E,O]),ie=f.useCallback((w,P)=>{Pe.debug("closeFilePanel",w);var _=w.id;if(_==null){Pe.warn("File ID is null, ignore close event");return}var B=null,se=!1;if(d.has(_))B=d.get(_);else if(p.has(_))B=p.get(_),se=!0;else{Pe.debug("File ".concat(_," isn't open, ignore close event"));return}X(w,se),x.closeComponent(r.root,{id:B},P)},[r.root,d,p,X]),oe=f.useCallback(w=>{var P=w.itemName;return R.getBaseName(P)},[]),ge=f.useCallback(w=>{var P=w.id;return Pe.debug("fileIsOpen",w,P,d),P!=null&&d.has(P)},[d]),we=f.useCallback(w=>{var P=w.id;return Pe.debug("fileIsOpenAsPreview",w,P,p),P!=null&&p.has(P)},[p]),_e=f.useCallback(w=>{if(w!=null){var P=i.getOpenedPanelById(w);P&&xl(P)&&P.focus()}},[i]),Se=f.useCallback(w=>{var P=w.id,_=w.settings,B=w.fileMetadata,se=w.session,ot=w.sessionLanguage,gt=w.isPreview,Qt=gt===void 0?!1:gt,wt={settings:_,fileMetadata:B},K=oe(B);return{type:"react-component",component:Tn.COMPONENT,isFocusOnShow:!1,props:{localDashboardId:e,metadata:{id:P},session:se,sessionLanguage:ot,panelState:wt,isPreview:Qt,notebooksUrl:a},title:K,id:P}},[oe,e,a]),de=f.useCallback(function(w,P,_){var B=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{id:null,itemName:$(_)},se=M(B);if(ge(B)&&se!=null){Pe.debug("File is already open, focus panel"),ee(B),_e(se);return}if(se==null){Pe.error("Panel ID for file metadata is null");return}var ot=x.getStackForComponentTypes(r.root,[Tn.COMPONENT]),gt=Se({id:se,settings:_,fileMetadata:B,session:w,sessionLanguage:P});Pe.debug("createNotebook",gt,d),x.openComponentInStack(ot,gt)},[ge,_e,$,M,r.root,Se,d,ee]),te=f.useCallback(function(w,P,_,B){var se=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!1;Pe.debug("selectNotebook",B,se);var ot=ge(B),gt=we(B),Qt=[...p.values()],wt=Qt[0],K=!se,ne=K&&wt?wt:M(B);if(ne==null||ne==="")throw new Error("Unable to retrieve or create panelId for metadata: ".concat(JSON.stringify(B)));if(ot||gt)ee(B);else{var me=x.getStackForComponentTypes(r.root,[Tn.COMPONENT]),Hn=Se({id:ne,settings:_,fileMetadata:B,session:w,sessionLanguage:P,isPreview:K});x.openComponentInStack(me,Hn)}if(gt&&se){var Jt=B.id,en=x.getStackForConfig(r.root,{component:Tn.COMPONENT,id:ne}),Rt=x.getContentItemInStack(en,{component:Tn.COMPONENT,id:ne});Jt!=null&&Rt&&Ve(Rt)&&(Rt.container.emit(J.PROMOTE_FROM_PREVIEW),O(Jt),S(Jt,ne))}se&&_e(ne)},[ee,ge,we,_e,M,r.root,Se,p,O,S]),Y=f.useCallback(function(w,P){var _=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},B=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,se=i.getLastUsedPanelOfType(Tn);se&&xl(se)?_!=null&&_.value!=null&&se.notebook!=null&&se.notebook.append(_.value):B&&de(w,P,_)},[de,i]),ce=f.useCallback((w,P)=>bS.hydrate(Tl(Tl({},w),{},{notebooksUrl:a}),P),[a]);return dr(o,Ai,t),dr(o,QC),dr(o,bw),dr(o,ww),dr(o,Tn,ce),Ue(r.eventHub,nt.SEND_COMMAND,L),Ue(r.eventHub,nt.SETTINGS_CHANGED,G),Ue(r.eventHub,J.CLOSE_FILE,ie),Ue(r.eventHub,J.CREATE_NOTEBOOK,de),Ue(r.eventHub,J.SELECT_NOTEBOOK,te),Ue(r.eventHub,J.RENAME,j),Ue(r.eventHub,J.RENAME_FILE,H),Ue(r.eventHub,J.SEND_TO_NOTEBOOK,Y),Ue(r.eventHub,J.REGISTER_FILE,F),Ue(r.eventHub,J.UNREGISTER_FILE,X),null}function Si(n,e,t){return(e=Lw(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Lw(n){var e=Fw(n,"string");return typeof e=="symbol"?e:e+""}function Fw(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class Ci{}Si(Ci,"DROPDOWN_FILTER","ControlType.DROPDOWN_FILTER");Si(Ci,"INPUT_FILTER","ControlType.INPUT_FILTER");Si(Ci,"MARKDOWN","ControlType.MARKDOWN");Si(Ci,"FILTER_SET_MANAGER","ControlType.FILTER_SET_MANAGER");export{Vv as $,E_ as A,ae as B,vu as C,tt as D,P_ as E,Du as F,uu as G,cu as H,jt as I,du as J,D as K,Ge as L,ju as M,Kv as N,Sr as O,je as P,V as Q,qp as R,_u as S,I as T,Gt as U,bu as V,Ci as W,gE as X,Pr as Y,Fu as Z,ci as _,Tt as a,k as a$,bn as a0,nE as a1,Od as a2,A_ as a3,Nu as a4,c_ as a5,Dr as a6,PE as a7,$v as a8,qe as a9,I_ as aA,j_ as aB,M_ as aC,k_ as aD,TE as aE,OE as aF,O_ as aG,D_ as aH,Lu as aI,x_ as aJ,ye as aK,Kw as aL,Uh as aM,Er as aN,em as aO,Vh as aP,su as aQ,au as aR,Kh as aS,zh as aT,Pt as aU,xt as aV,tm as aW,fu as aX,Cu as aY,xf as aZ,hi as a_,aE as aa,TS as ab,T_ as ac,bS as ad,oh as ae,nu as af,J as ag,Lt as ah,W_ as ai,V_ as aj,z_ as ak,q_ as al,ue as am,hE as an,sE as ao,uE as ap,Tn as aq,iS as ar,Xf as as,Ql as at,di as au,UE as av,Z as aw,yr as ax,_0 as ay,N_ as az,Ft as b,ei as b$,hu as b0,Im as b1,so as b2,Gw as b3,Df as b4,lo as b5,Xw as b6,gu as b7,lu as b8,Eu as b9,u_ as bA,l_ as bB,Ou as bC,Tu as bD,Pu as bE,Zw as bF,Yw as bG,Qw as bH,vo as bI,L_ as bJ,Pb as bK,yb as bL,Tb as bM,mn as bN,Ru as bO,Je as bP,ri as bQ,nb as bR,Qu as bS,$u as bT,mp as bU,Uu as bV,rp as bW,er as bX,Hu as bY,tr as bZ,Lg as b_,pu as ba,nm as bb,Xm as bc,Jr as bd,Vf as be,Qf as bf,Jf as bg,De as bh,ov as bi,_v as bj,Q as bk,uv as bl,Be as bm,Jw as bn,Iu as bo,xu as bp,n_ as bq,o_ as br,e_ as bs,t_ as bt,r_ as bu,bv,a_ as bw,s_ as bx,Ev as by,Pv as bz,C as c,LE as c$,Vu as c0,Ab as c1,xe as c2,Gi as c3,Fe as c4,Yu as c5,qi as c6,Jl as c7,x as c8,dr as c9,uS as cA,oS as cB,sS as cC,aS as cD,lS as cE,H_ as cF,R_ as cG,wS as cH,Y_ as cI,Q_ as cJ,dE as cK,lE as cL,U_ as cM,G_ as cN,K_ as cO,X_ as cP,iE as cQ,cE as cR,Ue as cS,B_ as cT,qS as cU,NE as cV,jE as cW,Sn as cX,Ld as cY,BE as cZ,y0 as c_,$_ as ca,tE as cb,DC as cc,pC as cd,vC as ce,ki as cf,xd as cg,rE as ch,Z_ as ci,wd as cj,fS as ck,To as cl,Po as cm,Id as cn,HS as co,Ed as cp,Kr as cq,dS as cr,Sd as cs,bC as ct,gC as cu,js as cv,J_ as cw,eE as cx,Td as cy,Cd as cz,rt as d,qC as d$,FE as d0,RE as d1,b0 as d2,C0 as d3,w0 as d4,HE as d5,o0 as d6,r0 as d7,$d as d8,e0 as d9,bw as dA,iu as dB,Bw as dC,xr as dD,ou as dE,Mt as dF,DE as dG,CE as dH,wE as dI,Nd as dJ,SE as dK,_E as dL,wr as dM,bE as dN,kE as dO,yE as dP,It as dQ,ME as dR,xE as dS,IE as dT,jd as dU,nt as dV,vE as dW,mE as dX,EE as dY,$C as dZ,RC as d_,JC as da,n0 as db,t0 as dc,Hd as dd,ro as de,i0 as df,Rd as dg,Fd as dh,no as di,kr as dj,Js as dk,AE as dl,$E as dm,el as dn,Vw as dp,Ko as dq,fi as dr,rS as ds,oE as dt,R as du,ko as dv,WE as dw,Ai as dx,ww as dy,QC as dz,zv as e,Ow as e0,pE as e1,fE as e2,Ww as e3,zw as e4,Uw as e5,Ei as e6,dh as e7,_i as e8,i_ as e9,vr as ea,Rv as f,h_ as g,w_ as h,C_ as i,S_ as j,y_ as k,b_ as l,g_ as m,d_ as n,v_ as o,f_ as p,m_ as q,Ie as r,pe as s,be as t,qf as u,Me as v,__ as w,p_ as x,qw as y,PS as z};
52
- //# sourceMappingURL=ControlType-FgZ4S3v5.js.map
52
+ //# sourceMappingURL=ControlType-CYwm2wcX.js.map