@deephaven/code-studio 0.37.4-logout.1 → 0.37.4-logout.2

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.
@@ -1,4 +1,4 @@
1
- import{C as r,G as X,A as w,I as qu,B,F as K,J as La,H as ae,K as he,L as _a,M as Ts,N as Ge,O as Te,P as Pc,Q as Je,S as tr,T as Xu,U as Zu,V as Qu,W as Ju,X as de,R as ll,Y as ld,Z as ze,_ as nr,$ as em,a0 as tm,a1 as jc,a2 as Le,a3 as Pa,E as nm,D as $t,a4 as Ll,a5 as Hc,a6 as sr,a7 as sm,a8 as xn,a9 as im,aa as om,ab as lm,ac as am,ad as ja,ae as rm,af as dm,ag as cm,ah as ad,ai as hm,aj as rd,ak as um,al as mm,am as gm,an as pm,ao as fm,ap as Cm,aq as mt,ar as Uc,as as Sm,at as Vc,au as bm,av as Bc,aw as wm,ax as vm,ay as Tm,az as Em,aA as dd,aB as ym}from"./vendor-296104a6.js";import{P as ve,s as I,T as _l,B as _,a as N,S as Ve,M as Se,K as Ee,G as qn,b as en,C as se,c as nn,D as Wn,d as xi,e as Pl,f as tt,g as co,I as Ei,U as Rm,h as pe,i as F,j as Xs,F as Gn,k as gn,u as ir,E as Fe,l as k,m as jn,n as Es,o as tl,p as ot,q as We,r as it,t as jl,v as xm,O as Vn,w as Im,x as hn,y as rn,z as Dm,A as Fm,R as Hl,H as zn,J as Ul,L as $c,N as Wc,Q as Nm,V as km,W as cd,X as $e,Y as hd,Z as Gc,_ as or,$ as ud,a0 as io,a1 as zc,a2 as Mm,a3 as Kc,a4 as Om,a5 as sn,a6 as Am,a7 as Lm,a8 as _m,a9 as md,aa as Pm,ab as jm,ac as Hm,ad as Um,ae as Vm,af as Bm,ag as $m,ah as Wm,ai as Gm}from"./useConnection-efed3542.js";import{e as Kn,l as Rn,K as tn,a as gd,R as zm,b as Cs,W as Km}from"./monaco-a26f85af.js";import{v as Ha,d as Ym,a as Yc,b as lr,L as Fn,c as ho,e as $n,f as qc,g as ee,h as pd,i as qm,j as Xm,k as Zm,l as Qm,m as Wt,n as vs,o as Xc,p as Yn,q as Vl,r as yi,s as Jm,t as eg,u as fd,w as al,x as Cd,y as Zc,z as tg,A as uo,B as Qc,C as ng,D as sg,T as Xe,E as ar,F as rr,G as rl,H as On,I as ig,J as og,K as lg,M as ag,N as rg,O as dr,P as ys,Q as Sd,R as mo,S as cr,U as hr,V as Jc,W as dg,X as Bl,Y as cg,Z as dl,_ as hg,$ as ur,a0 as eh,a1 as Ws,a2 as ug,a3 as mg,a4 as gg,a5 as pg,a6 as fg,a7 as Cg,a8 as bd,a9 as ma,aa as Sg,ab as bg,ac as wg,ad as $l,ae as Wl,af as vg,ag as Tg,ah as Gl,ai as th,aj as Eg,ak as yg,al as Rg,am as nh,an as xg,ao as Ig,ap as Dg,aq as Fg,ar as Ng,as as kg,at as Mg,au as Og,av as Ag,aw as Lg,ax as _g,ay as Pg,az as jg,aA as sh,aB as Hg,aC as Ua,aD as Va,aE as Ug,aF as Vg,aG as Bg,aH as $g,aI as Wg,aJ as Gg,aK as zg,aL as Kg,aM as Yg,aN as qg,aO as Xg,aP as Zg,aQ as Qg,aR as wd,aS as Jg,aT as ep,aU as tp}from"./index-619dcc08.js";import{P as cl,b as np,h as sp,p as ip,o as op,s as lp,t as ap,c as ga}from"./plotly-b8a884be.js";import"./helpers-042e6b4d.js";class mr{static isDark(e){const t=document.createElement("div");t.style.display="none",t.style.color=e;const n=getComputedStyle(document.body.appendChild(t)).color,s=n.match(/\d+/g);let i=[];if(s)i=s.map(l=>parseInt(l,10));else throw new Error(`Invalid color received. Got ${n}`);return document.body.removeChild(t),mr.getBrightness(i)<125}static getBrightness(e){return Math.round((e[0]*299+e[1]*587+e[2]*114)/1e3)}}const ih=mr,rp="table_",vd="column_",dp=new Set(["in","not","i","ii","k"]),cp=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"]),hp=/[^a-zA-Z0-9_$+@-]/g,up=/[^A-Za-z0-9_$]/g;class js{static legalize=(e,t,n,s,i)=>{let o=e.trim().replace(/[- ]/g,"_");return s&&(dp.has(o)||cp.has(o))&&(o=t+o),o=o.replace(n,""),o||(o=t+i),Number.isNaN(Number(o.charAt(0)))||(o=t+o),o};static legalizeTableName=e=>js.legalize(e,rp,hp,!1,0);static legalizeColumnNames=e=>{const t=[];return e.forEach((n,s)=>{let i=js.legalizeColumnName(n,s);t.includes(i)&&(i=vd+s),t.push(i)}),t};static legalizeColumnName=(e,t=0)=>js.legalize(e,vd,up,!0,t);static isValidTableName=e=>js.legalizeTableName(e)===e;static isValidColumnName=e=>js.legalizeColumnName(e)===e}const Ii=js;function mp(c,e){return c?c.closest(`.${e}`):null}const gp={getClosestByClassName:mp};class pp{pending=[];resolved=[];add(e,t){const n=ve.makeCancelable(e,t);return this.pending.push(n),n.then(()=>{this.resolve(n)},()=>{this.resolve(n)}),n}remove(e){for(let 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(){const e=[...this.pending,...this.resolved];for(let t=0;t<e.length;t+=1)e[t].cancel();this.pending=[],this.resolved=[]}}const Xn=pp;class fp extends Error{isInvalid=!0}const wi=fp;function oh({type:c}){switch(c){case I.VariableType.TABLE:case I.VariableType.TABLEMAP:case I.VariableType.TREETABLE:case I.VariableType.HIERARCHICALTABLE:return r.jsx(X,{icon:lr});case I.VariableType.FIGURE:return r.jsx(X,{icon:Yc});case I.VariableType.PANDAS:return r.jsx(X,{icon:Ym});default:return r.jsx(X,{icon:Ha})}}class Cp extends w.Component{constructor(e){super(e),this.container=null}componentDidMount(){this.colorize()}container;colorize(){const{children:e}=this.props;this.container&&e!=null&&Kn.colorizeElement(this.container,{theme:"dh-dark"})}render(){const{children:e,language:t}=this.props;return r.jsx("div",{children:r.jsx("div",{"data-lang":t,ref:n=>{this.container=n},style:{pointerEvents:"none"},children:e})})}}const zl=Cp;class Sp{static get LANGUAGE_MAP(){return new Map([["python","Python"],["groovy","Groovy"],["scala","Scala"]])}}const lh=Sp;class hl{static hasComment(e){return e.comment!==void 0}static hasPattern(e){return e.pattern!==void 0}static hasOp(e){return e.op!==void 0}static parseArguments(e){return e==null||!(typeof e=="string"||e instanceof String)?[]:qu.parse(e).filter(t=>!this.hasComment(t)).map(t=>this.hasPattern(t)?t.pattern:this.hasOp(t)?t.op:`${t}`)}static formatTimestamp(e){if(e==null||!(e instanceof Date))return null;const t=`${e.getHours()}`.padStart(2,"0"),n=`${e.getMinutes()}`.padStart(2,"0"),s=`${e.getSeconds()}`.padStart(2,"0"),i=`${e.getMilliseconds()}`.padStart(3,"0");return`${t}:${n}:${s}.${i}`}static isTableType(e){return e===I.VariableType.TABLE||e===I.VariableType.TREETABLE||e===I.VariableType.HIERARCHICALTABLE}static isWidgetType(e){return e===I.VariableType.FIGURE||e===I.VariableType.OTHERWIDGET||e===I.VariableType.PANDAS}static isOpenableType(e){return hl.isTableType(e)||hl.isWidgetType(e)}static isFigureType(e){return e===I.VariableType.FIGURE}static isPandas(e){return e===I.VariableType.PANDAS}}const Ba=hl;function ah({children:c}){return r.jsxs("div",{className:"console-history-item-result",children:[r.jsx("div",{className:"console-history-gutter",children:"-"}),r.jsx("div",{className:"console-history-content",children:c})]})}ah.propTypes={children:B.node.isRequired};class bp extends w.Component{static defaultProps={disabled:!1};constructor(e){super(e),this.updateElapsed=this.updateElapsed.bind(this),this.startTime=Date.now(),this.state={elapsed:0}}componentDidMount(){this.timer=setInterval(this.updateElapsed,1e3)}componentWillUnmount(){this.timer&&clearInterval(this.timer),this.timer=void 0}timer;startTime;updateElapsed(){this.setState({elapsed:Math.round((Date.now()-this.startTime)/1e3)})}render(){const{disabled:e,onCancelClick:t}=this.props,{elapsed:n}=this.state;return r.jsx("div",{className:K("console-history-result-in-progress",{disabled:e}),children:r.jsxs("span",{className:"badge",children:[r.jsx(Fn,{})," Running... ",_l.formatElapsedTime(n)," ",r.jsx(_,{className:"console-history-result-in-progress-cancel",kind:"ghost",icon:ho,tooltip:"Cancel",onClick:t,disabled:e})]})})}}const wp=bp;class ul extends w.PureComponent{static defaultProps={message:""};static mouseDragThreshold=5;constructor(e){super(e),this.handleKeyPress=this.handleKeyPress.bind(this),this.handleMouseDown=this.handleMouseDown.bind(this),this.handleMouseMove=this.handleMouseMove.bind(this),this.handleMouseUp=this.handleMouseUp.bind(this),this.handleToggleError=this.handleToggleError.bind(this),this.handleMouseEnter=this.handleMouseEnter.bind(this),this.handleMouseLeave=this.handleMouseLeave.bind(this),this.mouseX=null,this.mouseY=null,this.isClicking=!1,this.state={isExpanded:!1,isTriggerHovered:!1}}mouseX;mouseY;isClicking;handleKeyPress(e){switch(e.key){case"Enter":case" ":this.handleToggleError(),e.stopPropagation(),e.preventDefault();break}}handleMouseDown(e){this.mouseX=e.clientX,this.mouseY=e.clientY,this.isClicking=!0}handleMouseMove(e){this.mouseX!=null&&this.mouseY!=null?(Math.abs(e.clientX-this.mouseX)>=ul.mouseDragThreshold||Math.abs(e.clientY-this.mouseY)>=ul.mouseDragThreshold)&&(this.isClicking=!1):this.isClicking&&(this.isClicking=!1)}handleMouseUp(e){this.isClicking&&!e.shiftKey&&!e.metaKey&&!e.altKey&&this.handleToggleError(),this.mouseX=null,this.mouseY=null,this.isClicking=!1}handleToggleError(){this.setState(e=>({isExpanded:!e.isExpanded}))}handleMouseEnter(){this.setState({isTriggerHovered:!0})}handleMouseLeave(){this.setState({isTriggerHovered:!1})}render(){const{isExpanded:e,isTriggerHovered:t}=this.state,{message:n}=this.props;N(n);const s=n.indexOf(`
1
+ import{C as r,G as X,A as w,I as qu,B,F as K,J as La,H as ae,K as he,L as _a,M as Ts,N as Ge,O as Te,P as Pc,Q as Je,S as tr,T as Xu,U as Zu,V as Qu,W as Ju,X as de,R as ll,Y as ld,Z as ze,_ as nr,$ as em,a0 as tm,a1 as jc,a2 as Le,a3 as Pa,E as nm,D as $t,a4 as Ll,a5 as Hc,a6 as sr,a7 as sm,a8 as xn,a9 as im,aa as om,ab as lm,ac as am,ad as ja,ae as rm,af as dm,ag as cm,ah as ad,ai as hm,aj as rd,ak as um,al as mm,am as gm,an as pm,ao as fm,ap as Cm,aq as mt,ar as Uc,as as Sm,at as Vc,au as bm,av as Bc,aw as wm,ax as vm,ay as Tm,az as Em,aA as dd,aB as ym}from"./vendor-296104a6.js";import{P as ve,s as I,T as _l,B as _,a as N,S as Ve,M as Se,K as Ee,G as qn,b as en,C as se,c as nn,D as Wn,d as xi,e as Pl,f as tt,g as co,I as Ei,U as Rm,h as pe,i as F,j as Xs,F as Gn,k as gn,u as ir,E as Fe,l as k,m as jn,n as Es,o as tl,p as ot,q as We,r as it,t as jl,v as xm,O as Vn,w as Im,x as hn,y as rn,z as Dm,A as Fm,R as Hl,H as zn,J as Ul,L as $c,N as Wc,Q as Nm,V as km,W as cd,X as $e,Y as hd,Z as Gc,_ as or,$ as ud,a0 as io,a1 as zc,a2 as Mm,a3 as Kc,a4 as Om,a5 as sn,a6 as Am,a7 as Lm,a8 as _m,a9 as md,aa as Pm,ab as jm,ac as Hm,ad as Um,ae as Vm,af as Bm,ag as $m,ah as Wm,ai as Gm}from"./useConnection-ae134ceb.js";import{e as Kn,l as Rn,K as tn,a as gd,R as zm,b as Cs,W as Km}from"./monaco-a26f85af.js";import{v as Ha,d as Ym,a as Yc,b as lr,L as Fn,c as ho,e as $n,f as qc,g as ee,h as pd,i as qm,j as Xm,k as Zm,l as Qm,m as Wt,n as vs,o as Xc,p as Yn,q as Vl,r as yi,s as Jm,t as eg,u as fd,w as al,x as Cd,y as Zc,z as tg,A as uo,B as Qc,C as ng,D as sg,T as Xe,E as ar,F as rr,G as rl,H as On,I as ig,J as og,K as lg,M as ag,N as rg,O as dr,P as ys,Q as Sd,R as mo,S as cr,U as hr,V as Jc,W as dg,X as Bl,Y as cg,Z as dl,_ as hg,$ as ur,a0 as eh,a1 as Ws,a2 as ug,a3 as mg,a4 as gg,a5 as pg,a6 as fg,a7 as Cg,a8 as bd,a9 as ma,aa as Sg,ab as bg,ac as wg,ad as $l,ae as Wl,af as vg,ag as Tg,ah as Gl,ai as th,aj as Eg,ak as yg,al as Rg,am as nh,an as xg,ao as Ig,ap as Dg,aq as Fg,ar as Ng,as as kg,at as Mg,au as Og,av as Ag,aw as Lg,ax as _g,ay as Pg,az as jg,aA as sh,aB as Hg,aC as Ua,aD as Va,aE as Ug,aF as Vg,aG as Bg,aH as $g,aI as Wg,aJ as Gg,aK as zg,aL as Kg,aM as Yg,aN as qg,aO as Xg,aP as Zg,aQ as Qg,aR as wd,aS as Jg,aT as ep,aU as tp}from"./index-7aad5caf.js";import{P as cl,b as np,h as sp,p as ip,o as op,s as lp,t as ap,c as ga}from"./plotly-b8a884be.js";import"./helpers-042e6b4d.js";class mr{static isDark(e){const t=document.createElement("div");t.style.display="none",t.style.color=e;const n=getComputedStyle(document.body.appendChild(t)).color,s=n.match(/\d+/g);let i=[];if(s)i=s.map(l=>parseInt(l,10));else throw new Error(`Invalid color received. Got ${n}`);return document.body.removeChild(t),mr.getBrightness(i)<125}static getBrightness(e){return Math.round((e[0]*299+e[1]*587+e[2]*114)/1e3)}}const ih=mr,rp="table_",vd="column_",dp=new Set(["in","not","i","ii","k"]),cp=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"]),hp=/[^a-zA-Z0-9_$+@-]/g,up=/[^A-Za-z0-9_$]/g;class js{static legalize=(e,t,n,s,i)=>{let o=e.trim().replace(/[- ]/g,"_");return s&&(dp.has(o)||cp.has(o))&&(o=t+o),o=o.replace(n,""),o||(o=t+i),Number.isNaN(Number(o.charAt(0)))||(o=t+o),o};static legalizeTableName=e=>js.legalize(e,rp,hp,!1,0);static legalizeColumnNames=e=>{const t=[];return e.forEach((n,s)=>{let i=js.legalizeColumnName(n,s);t.includes(i)&&(i=vd+s),t.push(i)}),t};static legalizeColumnName=(e,t=0)=>js.legalize(e,vd,up,!0,t);static isValidTableName=e=>js.legalizeTableName(e)===e;static isValidColumnName=e=>js.legalizeColumnName(e)===e}const Ii=js;function mp(c,e){return c?c.closest(`.${e}`):null}const gp={getClosestByClassName:mp};class pp{pending=[];resolved=[];add(e,t){const n=ve.makeCancelable(e,t);return this.pending.push(n),n.then(()=>{this.resolve(n)},()=>{this.resolve(n)}),n}remove(e){for(let 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(){const e=[...this.pending,...this.resolved];for(let t=0;t<e.length;t+=1)e[t].cancel();this.pending=[],this.resolved=[]}}const Xn=pp;class fp extends Error{isInvalid=!0}const wi=fp;function oh({type:c}){switch(c){case I.VariableType.TABLE:case I.VariableType.TABLEMAP:case I.VariableType.TREETABLE:case I.VariableType.HIERARCHICALTABLE:return r.jsx(X,{icon:lr});case I.VariableType.FIGURE:return r.jsx(X,{icon:Yc});case I.VariableType.PANDAS:return r.jsx(X,{icon:Ym});default:return r.jsx(X,{icon:Ha})}}class Cp extends w.Component{constructor(e){super(e),this.container=null}componentDidMount(){this.colorize()}container;colorize(){const{children:e}=this.props;this.container&&e!=null&&Kn.colorizeElement(this.container,{theme:"dh-dark"})}render(){const{children:e,language:t}=this.props;return r.jsx("div",{children:r.jsx("div",{"data-lang":t,ref:n=>{this.container=n},style:{pointerEvents:"none"},children:e})})}}const zl=Cp;class Sp{static get LANGUAGE_MAP(){return new Map([["python","Python"],["groovy","Groovy"],["scala","Scala"]])}}const lh=Sp;class hl{static hasComment(e){return e.comment!==void 0}static hasPattern(e){return e.pattern!==void 0}static hasOp(e){return e.op!==void 0}static parseArguments(e){return e==null||!(typeof e=="string"||e instanceof String)?[]:qu.parse(e).filter(t=>!this.hasComment(t)).map(t=>this.hasPattern(t)?t.pattern:this.hasOp(t)?t.op:`${t}`)}static formatTimestamp(e){if(e==null||!(e instanceof Date))return null;const t=`${e.getHours()}`.padStart(2,"0"),n=`${e.getMinutes()}`.padStart(2,"0"),s=`${e.getSeconds()}`.padStart(2,"0"),i=`${e.getMilliseconds()}`.padStart(3,"0");return`${t}:${n}:${s}.${i}`}static isTableType(e){return e===I.VariableType.TABLE||e===I.VariableType.TREETABLE||e===I.VariableType.HIERARCHICALTABLE}static isWidgetType(e){return e===I.VariableType.FIGURE||e===I.VariableType.OTHERWIDGET||e===I.VariableType.PANDAS}static isOpenableType(e){return hl.isTableType(e)||hl.isWidgetType(e)}static isFigureType(e){return e===I.VariableType.FIGURE}static isPandas(e){return e===I.VariableType.PANDAS}}const Ba=hl;function ah({children:c}){return r.jsxs("div",{className:"console-history-item-result",children:[r.jsx("div",{className:"console-history-gutter",children:"-"}),r.jsx("div",{className:"console-history-content",children:c})]})}ah.propTypes={children:B.node.isRequired};class bp extends w.Component{static defaultProps={disabled:!1};constructor(e){super(e),this.updateElapsed=this.updateElapsed.bind(this),this.startTime=Date.now(),this.state={elapsed:0}}componentDidMount(){this.timer=setInterval(this.updateElapsed,1e3)}componentWillUnmount(){this.timer&&clearInterval(this.timer),this.timer=void 0}timer;startTime;updateElapsed(){this.setState({elapsed:Math.round((Date.now()-this.startTime)/1e3)})}render(){const{disabled:e,onCancelClick:t}=this.props,{elapsed:n}=this.state;return r.jsx("div",{className:K("console-history-result-in-progress",{disabled:e}),children:r.jsxs("span",{className:"badge",children:[r.jsx(Fn,{})," Running... ",_l.formatElapsedTime(n)," ",r.jsx(_,{className:"console-history-result-in-progress-cancel",kind:"ghost",icon:ho,tooltip:"Cancel",onClick:t,disabled:e})]})})}}const wp=bp;class ul extends w.PureComponent{static defaultProps={message:""};static mouseDragThreshold=5;constructor(e){super(e),this.handleKeyPress=this.handleKeyPress.bind(this),this.handleMouseDown=this.handleMouseDown.bind(this),this.handleMouseMove=this.handleMouseMove.bind(this),this.handleMouseUp=this.handleMouseUp.bind(this),this.handleToggleError=this.handleToggleError.bind(this),this.handleMouseEnter=this.handleMouseEnter.bind(this),this.handleMouseLeave=this.handleMouseLeave.bind(this),this.mouseX=null,this.mouseY=null,this.isClicking=!1,this.state={isExpanded:!1,isTriggerHovered:!1}}mouseX;mouseY;isClicking;handleKeyPress(e){switch(e.key){case"Enter":case" ":this.handleToggleError(),e.stopPropagation(),e.preventDefault();break}}handleMouseDown(e){this.mouseX=e.clientX,this.mouseY=e.clientY,this.isClicking=!0}handleMouseMove(e){this.mouseX!=null&&this.mouseY!=null?(Math.abs(e.clientX-this.mouseX)>=ul.mouseDragThreshold||Math.abs(e.clientY-this.mouseY)>=ul.mouseDragThreshold)&&(this.isClicking=!1):this.isClicking&&(this.isClicking=!1)}handleMouseUp(e){this.isClicking&&!e.shiftKey&&!e.metaKey&&!e.altKey&&this.handleToggleError(),this.mouseX=null,this.mouseY=null,this.isClicking=!1}handleToggleError(){this.setState(e=>({isExpanded:!e.isExpanded}))}handleMouseEnter(){this.setState({isTriggerHovered:!0})}handleMouseLeave(){this.setState({isTriggerHovered:!1})}render(){const{isExpanded:e,isTriggerHovered:t}=this.state,{message:n}=this.props;N(n);const s=n.indexOf(`
2
2
  `),i=s>-1;let o=n;i&&(o=n.slice(0,s));const l=n.slice(s),a=t?"error-btn-link error-btn-link--active":"error-btn-link";return r.jsxs("div",{className:K("error-message",{expanded:e}),children:[i&&r.jsxs(r.Fragment,{children:[r.jsx("div",{className:"error-gutter",children:r.jsx("button",{type:"button",onClick:this.handleToggleError,className:a,tabIndex:-1,children:r.jsx(X,{icon:e?$n:qc,transform:"left-3"})})}),r.jsxs("div",{className:"error-content",children:[r.jsx("div",{className:"console-error-text-trigger",role:"button",tabIndex:0,onKeyPress:this.handleKeyPress,onMouseDown:this.handleMouseDown,onMouseMove:this.handleMouseMove,onMouseEnter:this.handleMouseEnter,onMouseLeave:this.handleMouseLeave,onMouseUp:this.handleMouseUp,children:o}),e?l:""]})]}),!i&&r.jsx("div",{className:"error-content",children:r.jsx("div",{className:"console-error-text",children:o})})]},"error")}}const vp=ul;const Td=ee.module("ConsoleHistoryItem");class Tp extends w.PureComponent{static defaultProps={disabled:!1};constructor(e){super(e),this.handleCancelClick=this.handleCancelClick.bind(this),this.handleObjectClick=this.handleObjectClick.bind(this)}handleObjectClick(e){Td.debug("handleObjectClick",e);const{openObject:t}=this.props;t(e)}handleCancelClick(){const{item:e}=this.props;e!=null&&e.cancelResult&&(Td.debug(`Cancelling command: ${e.command}`),e.cancelResult())}render(){const{disabled:e,item:t,language:n}=this.props,{disabledObjects:s,result:i}=t;let o=null;t.command!=null&&t.command!==""&&(o=r.jsxs("div",{className:"console-history-item-command",children:[r.jsx("div",{className:"console-history-gutter",children:">"}),r.jsx("div",{className:"console-history-content",children:r.jsx(zl,{language:n,children:t.command})})]}));const l=[];let a=!1;if(i){const{error:h,message:u,changes:m}=i;if(m){const{created:g,updated:p}=m;[...g,...p].forEach(C=>{a=!0;const{title:f}=C,S=`${f}`,v=e===void 0||e||(s??[]).indexOf(S)>=0,b=r.jsx(_,{kind:"primary",onClick:()=>this.handleObjectClick(C),className:"btn-console-object",disabled:v,icon:r.jsx(oh,{type:C.type}),children:f},S);l.push(b)})}if(h!=null&&t.command==null){let g=`${h.message??h}`;g||(g=h);const p=r.jsx(vp,{message:g},"result-error");l.push(p)}if(u!==void 0&&u!==""){const g=r.jsx("div",{className:"log-message",children:u},"log-message");l.push(g)}}else{a=!0;const h=r.jsx(wp,{onCancelClick:this.handleCancelClick,disabled:e},"in_progress");l.push(h)}let d=null;return l.length>0&&(d=r.jsx(ah,{children:l})),r.jsxs("div",{className:K("console-command-result",{"console-result-buttons":a}),children:[o,d]})}}const Ep=Tp;class gr extends w.Component{static defaultProps={disabled:!1};static itemKey(e,t){return`${e}.${t.command}.${t.result&&t.result.message}.${t.result&&t.result.error}`}render(){const{disabled:e,items:t,language:n,openObject:s}=this.props,i=[];for(let o=0;o<t.length;o+=1){const l=t[o],a=r.jsx(Ep,{disabled:e,item:l,openObject:s,language:n},gr.itemKey(o,l));i.push(a)}return r.jsx("div",{className:"container-fluid console-history",children:i})}}const yp=gr,Rp={name:"Console",CLEAR:Ve.createAndAdd({id:"CONSOLE.CLEAR",name:"Clear",shortcut:[Se.CTRL,Ee.L],macShortcut:[Se.CTRL,Ee.C]}),FOCUS_HISTORY:Ve.createAndAdd({id:"CONSOLE.FOCUS_HISTORY",name:"Focus History",shortcut:[Se.CTRL,Ee.H],macShortcut:[Se.CTRL,Se.OPTION,Ee.H]})},xp={name:"Command History",FOCUS_HISTORY:Ve.createAndAdd({id:"COMMAND_HISTORY.FOCUS_HISTORY",name:"Focus History Search",shortcut:[Se.CTRL,Ee.H],macShortcut:[Se.CTRL,Se.OPTION,Ee.H]}),SEND_TO_CONSOLE:Ve.createAndAdd({id:"COMMAND_HISTORY.SEND_TO_CONSOLE",name:"Send to Console",shortcut:[Ee.ENTER],macShortcut:[Ee.ENTER]}),SEND_TO_NOTEBOOK:Ve.createAndAdd({id:"COMMAND_HISTORY.SEND_TO_NOTEBOOK",name:"Send to Notebook",shortcut:[Se.CTRL,Ee.ENTER],macShortcut:[Se.CMD,Ee.ENTER]}),RUN:Ve.createAndAdd({id:"COMMAND_HISTORY.RUN",name:"Run",shortcut:[Se.ALT,Ee.R],macShortcut:[Se.OPTION,Ee.R]})},Ip={name:"Notebook",RUN:Ve.createAndAdd({id:"NOTEBOOK.RUN",name:"Run",shortcut:[Se.ALT,Ee.R],macShortcut:[Se.OPTION,Ee.R]}),RUN_SELECTED:Ve.createAndAdd({id:"NOTEBOOK.RUN_SELECTED",name:"Run Selected",shortcut:[Se.ALT,Se.SHIFT,Ee.R],macShortcut:[Se.OPTION,Se.SHIFT,Ee.R]}),FIND:Ve.createAndAdd({id:"NOTEBOOK.FIND",name:"Find",shortcut:[Se.CTRL,Ee.F],macShortcut:[Se.CMD,Ee.F],isEditable:!1}),MINIMAP:Ve.createAndAdd({id:"NOTEBOOK.MINIMAP",name:"Show Minimap",shortcut:[Se.ALT,Ee.M],macShortcut:[Se.OPTION,Ee.M]}),WORDWRAP:Ve.createAndAdd({id:"NOTEBOOK.WORDWRAP",name:"Word Wrap",shortcut:[Se.ALT,Ee.Z],macShortcut:[Se.OPTION,Ee.Z]})},Dp={CONSOLE:Rp,COMMAND_HISTORY:xp,NOTEBOOK:Ip},It=Dp,ht=Object.freeze({FATAL:"FATAL",STDERR:"STDERR",ERROR:"ERROR",WARN:"WARN",STDOUT:"STDOUT",INFO:"INFO",DEBUG:"DEBUG",TRACE:"TRACE"}),Fp="#2d2a2e",Np="#fcfcfa",kp="#fcd65b",Mp="#b2b1b2",Op="#9edc6f",Ap="#76d9e4",Lp="#f95d84",_p="#aa9af4",Pp="#f95d84",jp="#fcfcfa",Hp="#7c7b7c",ue={"error-foreground":"#f95d84",background:Fp,foreground:Np,"line-height":"19px",string:kp,"string-delim":"#929192",delimiter:Mp,predefined:Op,keyword:Ap,storage:Lp,number:_p,operator:Pp,identifier:jp,"namespace-identifier":"#f95d84","identifier-js":"#fcd65b",comment:Hp,"input-option-active-border":"#929192","focus-border":"rgba(72, 120, 234, 0.85)","input-background":"#555356","input-foreground":"#f0f0ee","input-border":"#929192","editor-line-number-foreground":"#929192","editor-selection-background":"#676368","editor-line-highlight-bg":"#373438","context-menu-background":"#555356","context-menu-foreground":"#f0f0ee","menu-selection-background":"#4878ea","log-date":"#929192","log-error":"#f95d84","log-info":"#76d9e4","log-stdout":"#f0f0ee","log-warn":"#fcd65b","log-debug":"#aa9af4","log-trace":"#9edc6f","editor-find-match-background":"#3c5595","editor-find-match-highlight-background":"#343e5d","editor-widget-background":"#403e41","input-option-active-background":"#4878ea","input-option-active-foreground":"#f0f0ee","editor-suggest-widget-background":"#403e41","editor-suggest-widget-border":"#5b5a5c","editor-suggest-widget-foreground":"#f0f0ee","editor-suggest-widget-selected-background":"#41475a","editor-suggest-widget-highlightForeground":"#4878ea","list-hover-background":"#555356","text-link-foreground":"#929192","text-link-active-foreground":"#f0f0ee","editor-link-active-foreground":"#f0f0ee"},Up="python",Vp={comments:{lineComment:"#",blockComment:["'''","'''"]},brackets:[["{","}"],["[","]"],["(",")"]],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"',notIn:["string"]},{open:"'",close:"'",notIn:["string","comment"]}],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"}],onEnterRules:[{beforeText:/^\s*(?:def|class|for|if|elif|else|while|try|with|finally|except|async).*?:\s*$/,action:{indentAction:1}}],folding:{offSide:!0,markers:{start:/^\s*#region\b/,end:/^\s*#endregion\b/}}},Bp={keywords:["and","del","from","not","while","as","elif","global","or","with","assert","else","if","pass","yield","break","except","import","print","exec","in","raise","continue","finally","is","return","for","try",":","=","isinstance","__debug__"],storage:["class","def","async","lambda"],operators:["+","-","*","**","/","//","%","<<",">>","&","|","^","~","<",">","<=",">=","==","!=","<>","+=","-=","*=","/","//=","%=","&=","|=","^=",">>=","<<=","**="],brackets:[{open:"{",close:"}",token:"delimiter.curly"},{open:"[",close:"]",token:"delimiter.square"},{open:"(",close:")",token:"delimiter.parenthesis"}],symbols:/[=><!~&|+\-*/^%]+/,delimiters:/[;=.@:,`]/,escapes:/\\(?:[abfnrtv\\"'\n\r]|x[0-9A-Fa-f]{2}|[0-7]{3}|u[0-9A-Fa-f]{4}|U[0-9A-Fa-f]{8}|N\{\w+\})/,rawpre:/(?:[rR]|ur|Ur|uR|UR|br|Br|bR|BR)/,strpre:/(?:[buBU])/,tokenizer:{root:[[/@strpre?("""|''')/,{token:"string.delim",bracket:"@open",next:"@mstring.$1"}],[/@strpre?"([^"\\]|\\.)*$/,"string.invalid"],[/@strpre?'([^'\\]|\\.)*$/,"string.invalid"],[/@strpre?(["])/,{token:"string.delim",bracket:"@open",next:"@sstring.$1",nextEmbedded:"deephavenDb"}],[/@strpre?(["'])/,{token:"string.delim",bracket:"@open",next:"@string.$1"}],[/@rawpre("""|''')/,{token:"string.delim",bracket:"@open",next:"@mrawstring.$1"}],[/@rawpre"([^"\\]|\\.)*$/,"string.invalid"],[/@rawpre'([^'\\]|\\.)*$/,"string.invalid"],[/@rawpre(["'])/,{token:"string.delim",bracket:"@open",next:"@rawstring.$1"}],[/__[\w$]*/,"predefined"],[/[a-z_$][\w$]*/,{cases:{"@keywords":"keyword","@storage":"storage","@default":"identifier"}}],[/[A-Z][\w]*/,{cases:{"~[A-Z0-9_]+":"constructor.identifier","@default":"namespace.identifier"}}],{include:"@whitespace"},[/[{}()[\]]/,"@brackets"],[/@symbols/,{cases:{"@keywords":"keyword","@operators":"operator","@default":""}}],[/\d*\.\d+([eE][-+]?\d+)?/,"number.float"],[/0[xX][0-9a-fA-F]+[lL]?/,"number.hex"],[/0[bB][0-1]+[lL]?/,"number.binary"],[/(0[oO][0-7]+|0[0-7]+)[lL]?/,"number.octal"],[/(0|[1-9]\d*)[lL]?/,"number"],[":",{token:"keyword",bracket:"@open"}],[/@delimiters/,{cases:{"@keywords":"keyword","@default":"delimiter"}}]],comment:[[/[^/*]+/,"comment"],[/\/\*/,"comment","@push"],["\\*/","comment","@pop"],[/[/*]/,"comment"]],mstring:[{include:"@strcontent"},[/"""|'''/,{cases:{"$#==$S2":{token:"string.delim",bracket:"@close",next:"@pop"},"@default":{token:"string"}}}],[/["']/,"string"],[/./,"string.invalid"]],sstring:[{include:"@strcontent"},[/["]/,{token:"string.delim",bracket:"@close",next:"@pop",nextEmbedded:"@pop"}],[/./,"string.invalid"]],string:[{include:"@strcontent"},[/[']/,{token:"string.delim",bracket:"@close",next:"@pop"}],[/./,"string.invalid"]],strcontent:[[/[^\\"']+/,"string"],[/\\$/,"string.escape"],[/@escapes/,"string.escape"],[/\\./,"string.escape.invalid"]],mrawstring:[{include:"@rawstrcontent"},[/"""|'''/,{cases:{"$#==$S2":{token:"string.delim",bracket:"@close",next:"@pop"},"@default":{token:"string"}}}],[/["']/,"string"],[/./,"string.invalid"]],rawstring:[{include:"@rawstrcontent"},[/["']/,{cases:{"$#==$S2":{token:"string.delim",bracket:"@close",next:"@pop"},"@default":{token:"string"}}}],[/./,"string.invalid"]],rawstrcontent:[[/[^\\"']+/,"string"],[/\\["']/,"string"],[/\\u[0-9A-Fa-f]{4}/,"string.escape"],[/\\/,"string"]],whitespace:[[/\s+/,"white"],[/(^#.*$)/,"comment"],[/'''/,"string","@endDocString"],[/"""/,"string","@endDblDocString"]],endDocString:[[/[^']+/,"string"],[/\\'/,"string"],[/'''/,"string","@popall"],[/'/,"string"]],endDblDocString:[[/[^"]+/,"string"],[/\\"/,"string"],[/"""/,"string","@popall"],[/"/,"string"]]}},$p={id:Up,conf:Vp,language:Bp},Wp=$p,Gp="groovy",zp={comments:{lineComment:"//",blockComment:["/*","*/"]},brackets:[["{","}"],["[","]"],["(",")"]],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"',notIn:["string"]},{open:"'",close:"'",notIn:["string","comment"]}],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"}],onEnterRules:[{beforeText:/^\s*(?:def|class|for|if|elif|else|while|try|with|finally|except|async).*?:\s*$/,action:{indentAction:1}}],folding:{offSide:!0,markers:{start:/^\s*#region\b/,end:/^\s*#endregion\b/}}},Kp={keywords:["and","del","from","not","while","as","elif","global","or","with","assert","else","if","pass","yield","break","except","import","print","println","class","exec","in","raise","continue","finally","is","return","def","for","lambda","try",":","=","isinstance","__debug__"],operators:["+","-","*","**","/","//","%","<<",">>","&","|","^","~","<",">","<=",">=","==","!=","<>","+=","-=","*=","/","//=","%=","&=","|=","^=",">>=","<<=","**="],brackets:[{open:"{",close:"}",token:"delimiter.curly"},{open:"[",close:"]",token:"delimiter.square"},{open:"(",close:")",token:"delimiter.parenthesis"}],symbols:/[=><!~&|+\-*/^%]+/,delimiters:/[;=.@:,`]/,escapes:/\\(?:[abfnrtv\\"'\n\r]|x[0-9A-Fa-f]{2}|[0-7]{3}|u[0-9A-Fa-f]{4}|U[0-9A-Fa-f]{8}|N\{\w+\})/,rawpre:/(?:[rR]|ur|Ur|uR|UR|br|Br|bR|BR)/,strpre:/(?:[buBU])/,tokenizer:{root:[[/@strpre?("""|''')/,{token:"string.delim",bracket:"@open",next:"@mstring.$1"}],[/@strpre?"([^"\\]|\\.)*$/,"string.invalid"],[/@strpre?'([^'\\]|\\.)*$/,"string.invalid"],[/@strpre?(["])/,{token:"string.delim",bracket:"@open",next:"@sstring.$1",nextEmbedded:"deephavenDb"}],[/@strpre?(["'])/,{token:"string.delim",bracket:"@open",next:"@string.$1"}],[/@rawpre("""|''')/,{token:"string.delim",bracket:"@open",next:"@mrawstring.$1"}],[/@rawpre"([^"\\]|\\.)*$/,"string.invalid"],[/@rawpre'([^'\\]|\\.)*$/,"string.invalid"],[/@rawpre(["'])/,{token:"string.delim",bracket:"@open",next:"@rawstring.$1"}],[/__[\w$]*/,"predefined"],[/[a-z_$][\w$]*/,{cases:{"@keywords":"keyword","@default":"identifier"}}],[/[A-Z][\w]*/,{cases:{"~[A-Z0-9_]+":"constructor.identifier","@default":"namespace.identifier"}}],{include:"@whitespace"},[/[{}()[\]]/,"@brackets"],[/@symbols/,{cases:{"@keywords":"keyword","@operators":"operator","@default":""}}],[/\d*\.\d+([eE][-+]?\d+)?/,"number.float"],[/0[xX][0-9a-fA-F]+[lL]?/,"number.hex"],[/0[bB][0-1]+[lL]?/,"number.binary"],[/(0[oO][0-7]+|0[0-7]+)[lL]?/,"number.octal"],[/(0|[1-9]\d*)[lL]?/,"number"],[":",{token:"keyword",bracket:"@open"}],[/@delimiters/,{cases:{"@keywords":"keyword","@default":"delimiter"}}]],mstring:[{include:"@strcontent"},[/"""|'''/,{cases:{"$#==$S2":{token:"string.delim",bracket:"@close",next:"@pop"},"@default":{token:"string"}}}],[/["']/,"string"],[/./,"string.invalid"]],sstring:[{include:"@strcontent"},[/["]/,{token:"string.delim",bracket:"@close",next:"@pop",nextEmbedded:"@pop"}],[/./,"string.invalid"]],string:[{include:"@strcontent"},[/[']/,{token:"string.delim",bracket:"@close",next:"@pop"}],[/./,"string.invalid"]],strcontent:[[/[^\\"']+/,"string"],[/\\$/,"string.escape"],[/@escapes/,"string.escape"],[/\\./,"string.escape.invalid"]],mrawstring:[{include:"@rawstrcontent"},[/"""|'''/,{cases:{"$#==$S2":{token:"string.delim",bracket:"@close",next:"@pop"},"@default":{token:"string"}}}],[/["']/,"string"],[/./,"string.invalid"]],rawstring:[{include:"@rawstrcontent"},[/["']/,{cases:{"$#==$S2":{token:"string.delim",bracket:"@close",next:"@pop"},"@default":{token:"string"}}}],[/./,"string.invalid"]],rawstrcontent:[[/[^\\"']+/,"string"],[/\\["']/,"string"],[/\\u[0-9A-Fa-f]{4}/,"string.escape"],[/\\/,"string"]],whitespace:[[/[ \t\r\n]+/,""],[/\/\*\*(?!\/)/,"comment.doc","@doccomment"],[/\/\*/,"comment","@comment"],[/\/\/.*$/,"comment"]],comment:[[/[^/*]+/,"comment"],[/\*\//,"comment","@pop"],[/[/*]/,"comment"]],doccomment:[[/[^/*]+/,"comment.doc"],[/\*\//,"comment.doc","@pop"],[/[/*]/,"comment.doc"]]}},Yp={id:Gp,conf:zp,language:Kp},qp=Yp,Xp="scala",Zp={wordPattern:/(unary_[@~!#%^&*()\-=+\\|:<>/?]+)|([a-zA-Z_$][\w$]*?_=)|(`[^`]+`)|([a-zA-Z_$][\w$]*)/g,comments:{lineComment:"//",blockComment:["/*","*/"]},brackets:[["{","}"],["[","]"],["(",")"]],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"}],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"}],folding:{markers:{start:/^\s*\/\/\s*(?:(?:#?region\b)|(?:<editor-fold\b))/,end:/^\s*\/\/\s*(?:(?:#?endregion\b)|(?:<\/editor-fold>))/}}},Qp={keywords:["asInstanceOf","catch","class","classOf","def","do","else","extends","finally","for","foreach","forSome","if","import","isInstanceOf","macro","match","new","object","package","return","throw","trait","try","type","until","val","var","while","with","yield","given","enum","then"],softKeywords:["as","export","extension","end","derives","on"],constants:["true","false","null","this","super"],modifiers:["abstract","final","implicit","lazy","override","private","protected","sealed"],softModifiers:["inline","opaque","open","transparent","using"],name:/(?:[a-z_$][\w$]*|`[^`]+`)/,type:/(?:[A-Z][\w$]*)/,symbols:/[=><!~?:&|+\-*/^\\%@#]+/,digits:/\d+(_+\d+)*/,hexdigits:/[[0-9a-fA-F]+(_+[0-9a-fA-F]+)*/,escapes:/\\(?:[btnfr\\"']|x[0-9A-Fa-f]{1,4}|u[0-9A-Fa-f]{4}|U[0-9A-Fa-f]{8})/,fstring_conv:/[bBhHsScCdoxXeEfgGaAt]|[Tn](?:[HIklMSLNpzZsQ]|[BbhAaCYyjmde]|[RTrDFC])/,tokenizer:{root:[[/\braw"""/,{token:"string.quote",bracket:"@open",next:"@rawstringt"}],[/\braw"/,{token:"string.quote",bracket:"@open",next:"@rawstring"}],[/\bs"""/,{token:"string.quote",bracket:"@open",next:"@sstringt"}],[/\bs"/,{token:"string.quote",bracket:"@open",next:"@sstring"}],[/\bf""""/,{token:"string.quote",bracket:"@open",next:"@fstringt"}],[/\bf"/,{token:"string.quote",bracket:"@open",next:"@fstring"}],[/"""/,{token:"string.quote",bracket:"@open",next:"@stringt"}],[/"/,{token:"string.quote",bracket:"@open",next:"@string"}],[/(@digits)[eE]([-+]?(@digits))?[fFdD]?/,"number.float","@allowMethod"],[/(@digits)\.(@digits)([eE][-+]?(@digits))?[fFdD]?/,"number.float","@allowMethod"],[/0[xX](@hexdigits)[Ll]?/,"number.hex","@allowMethod"],[/(@digits)[fFdD]/,"number.float","@allowMethod"],[/(@digits)[lL]?/,"number","@allowMethod"],[/\b_\*/,"key"],[/\b(_)\b/,"keyword","@allowMethod"],[/\bimport\b/,"keyword","@import"],[/\b(case)([ \t]+)(class)\b/,["keyword.modifier","white","keyword"]],[/\bcase\b/,"keyword","@case"],[/\bva[lr]\b/,"keyword","@vardef"],[/\b(def)([ \t]+)((?:unary_)?@symbols|@name(?:_=)|@name)/,["keyword","white","identifier"]],[/@name(?=[ \t]*:(?!:))/,"variable"],[/(\.)(@name|@symbols)/,[{token:"operator"},{token:"@rematch",next:"@allowMethod"}]],[/([{(])(\s*)(@name(?=\s*=>))/,["@brackets","white","variable"]],[/@name/,{cases:{"@keywords":"keyword","@softKeywords":"keyword","@modifiers":"keyword.modifier","@softModifiers":"keyword.modifier","@constants":{token:"constant",next:"@allowMethod"},"@default":{token:"identifier",next:"@allowMethod"}}}],[/@type/,"type","@allowMethod"],{include:"@whitespace"},[/@[a-zA-Z_$][\w$]*(?:\.[a-zA-Z_$][\w$]*)*/,"annotation"],[/[{(]/,"@brackets"],[/[})]/,"@brackets","@allowMethod"],[/\[/,"operator.square"],[/](?!\s*(?:va[rl]|def|type)\b)/,"operator.square","@allowMethod"],[/]/,"operator.square"],[/([=-]>|<-|>:|<:|:>|<%)(?=[\s\w()[\]{},."'`])/,"keyword"],[/@symbols/,"operator"],[/[;,.]/,"delimiter"],[/'[a-zA-Z$][\w$]*(?!')/,"attribute.name"],[/'[^\\']'/,"string","@allowMethod"],[/(')(@escapes)(')/,[{token:"string"},{token:"string.escape"},{token:"string",next:"@allowMethod"}]],[/'/,"string.invalid"]],import:[[/;/,"delimiter","@pop"],[/^|$/,"","@pop"],[/[ \t]+/,"white"],[/[\n\r]+/,"white","@pop"],[/\/\*/,"comment","@comment"],[/@name|@type/,"type"],[/[(){}]/,"@brackets"],[/[[\]]/,"operator.square"],[/[.,]/,"delimiter"]],allowMethod:[[/^|$/,"","@pop"],[/[ \t]+/,"white"],[/[\n\r]+/,"white","@pop"],[/\/\*/,"comment","@comment"],[/(?==>[\s\w([{])/,"keyword","@pop"],[/(@name|@symbols)(?=[ \t]*[[({"'`]|[ \t]+(?:[+-]?\.?\d|\w))/,{cases:{"@keywords":{token:"keyword",next:"@pop"},"->|<-|>:|<:|<%":{token:"keyword",next:"@pop"},"@default":{token:"@rematch",next:"@pop"}}}],["","","@pop"]],comment:[[/[^/*]+/,"comment"],[/\/\*/,"comment","@push"],[/\*\//,"comment","@pop"],[/[/*]/,"comment"]],case:[[/\b_\*/,"key"],[/\b(_|true|false|null|this|super)\b/,"keyword","@allowMethod"],[/\bif\b|=>/,"keyword","@pop"],[/`[^`]+`/,"identifier","@allowMethod"],[/@name/,"variable","@allowMethod"],[/:::?|\||@(?![a-z_$])/,"keyword"],{include:"@root"}],vardef:[[/\b_\*/,"key"],[/\b(_|true|false|null|this|super)\b/,"keyword"],[/@name/,"variable"],[/:::?|\||@(?![a-z_$])/,"keyword"],[/=|:(?!:)/,"operator","@pop"],[/$/,"white","@pop"],{include:"@root"}],string:[[/[^\\"\n\r]+/,"string"],[/@escapes/,"string.escape"],[/\\./,"string.escape.invalid"],[/"/,{token:"string.quote",bracket:"@close",switchTo:"@allowMethod"}]],stringt:[[/[^\\"\n\r]+/,"string"],[/@escapes/,"string.escape"],[/\\./,"string.escape.invalid"],[/"(?=""")/,"string"],[/"""/,{token:"string.quote",bracket:"@close",switchTo:"@allowMethod"}],[/"/,"string"]],fstring:[[/@escapes/,"string.escape"],[/"/,{token:"string.quote",bracket:"@close",switchTo:"@allowMethod"}],[/\$\$/,"string"],[/(\$)([a-z_]\w*)/,["operator","identifier"]],[/\$\{/,"operator","@interp"],[/%%/,"string"],[/(%)([-#+ 0,(])(\d+|\.\d+|\d+\.\d+)(@fstring_conv)/,["metatag","keyword.modifier","number","metatag"]],[/(%)(\d+|\.\d+|\d+\.\d+)(@fstring_conv)/,["metatag","number","metatag"]],[/(%)([-#+ 0,(])(@fstring_conv)/,["metatag","keyword.modifier","metatag"]],[/(%)(@fstring_conv)/,["metatag","metatag"]],[/./,"string"]],fstringt:[[/@escapes/,"string.escape"],[/"(?=""")/,"string"],[/"""/,{token:"string.quote",bracket:"@close",switchTo:"@allowMethod"}],[/\$\$/,"string"],[/(\$)([a-z_]\w*)/,["operator","identifier"]],[/\$\{/,"operator","@interp"],[/%%/,"string"],[/(%)([-#+ 0,(])(\d+|\.\d+|\d+\.\d+)(@fstring_conv)/,["metatag","keyword.modifier","number","metatag"]],[/(%)(\d+|\.\d+|\d+\.\d+)(@fstring_conv)/,["metatag","number","metatag"]],[/(%)([-#+ 0,(])(@fstring_conv)/,["metatag","keyword.modifier","metatag"]],[/(%)(@fstring_conv)/,["metatag","metatag"]],[/./,"string"]],sstring:[[/@escapes/,"string.escape"],[/"/,{token:"string.quote",bracket:"@close",switchTo:"@allowMethod"}],[/\$\$/,"string"],[/(\$)([a-z_]\w*)/,["operator","identifier"]],[/\$\{/,"operator","@interp"],[/./,"string"]],sstringt:[[/@escapes/,"string.escape"],[/"(?=""")/,"string"],[/"""/,{token:"string.quote",bracket:"@close",switchTo:"@allowMethod"}],[/\$\$/,"string"],[/(\$)([a-z_]\w*)/,["operator","identifier"]],[/\$\{/,"operator","@interp"],[/./,"string"]],interp:[[/{/,"operator","@push"],[/}/,"operator","@pop"],{include:"@root"}],rawstring:[[/[^"]/,"string"],[/"/,{token:"string.quote",bracket:"@close",switchTo:"@allowMethod"}]],rawstringt:[[/[^"]/,"string"],[/"(?=""")/,"string"],[/"""/,{token:"string.quote",bracket:"@close",switchTo:"@allowMethod"}],[/"/,"string"]],whitespace:[[/[ \t\r\n]+/,"white"],[/\/\*/,"comment","@comment"],[/\/\/.*$/,"comment"]]}},Jp={id:Xp,conf:Zp,language:Qp},ef=Jp,tf="deephavenDb",nf={comments:{lineComment:"#",blockComment:["'''","'''"]},brackets:[["{","}"],["[","]"],["(",")"]],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"',notIn:["string"]},{open:"'",close:"'",notIn:["string","comment"]}],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"}],onEnterRules:[{beforeText:/^\s*(?:def|class|for|if|elif|else|while|try|with|finally|except|async).*?:\s*$/,action:{indentAction:1}}],folding:{offSide:!0,markers:{start:/^\s*#region\b/,end:/^\s*#endregion\b/}}},sf={tokenPostfix:".js",keywords:["boolean","break","byte","case","catch","char","class","const","continue","debugger","default","delete","do","double","else","enum","export","extends","false","final","finally","float","for","function","goto","if","implements","import","in","instanceof","int","interface","long","native","new","null","package","private","protected","public","return","short","static","super","switch","synchronized","this","throw","throws","transient","true","try","typeof","var","void","volatile","while","with"],builtins:["define","require","window","document","undefined"],operators:["=",">","<","!","~","?",":","==","<=",">=","!=","&&","||","++","--","+","-","*","/","&","|","^","%","<<",">>",">>>","+=","-=","*=","/=","&=","|=","^=","%=","<<=",">>=",">>>="],brackets:[{open:"{",close:"}",token:"delimiter.curly"},{open:"[",close:"]",token:"delimiter.bracket"},{open:"(",close:")",token:"delimiter.parenthesis"}],symbols:/[~!@#%\^&*-+=|\\:`<>.?\/]+/,escapes:/\\(?:[btnfr\\"']|[0-7][0-7]?|[0-3][0-7]{2})/,exponent:/[eE][\-+]?[0-9]+/,regexpctl:/[(){}\[\]\$\^|\-*+?\.]/,regexpesc:/\\(?:[bBdDfnrstvwWn0\\\/]|@regexpctl|c[A-Z]|x[0-9a-fA-F]{2}|u[0-9a-fA-F]{4})/,tokenizer:{root:[[/([a-zA-Z_\$][\w\$]*)(\s*)(:?)/,{cases:{"$1@keywords":["keyword","white","delimiter"],$3:["key.identifier","white","delimiter"],"$1@builtins":["predefined.identifier","white","delimiter"],"@default":["identifier","white","delimiter"]}}],{include:"@whitespace"},[/\/(?=([^\\\/]|\\.)+\/)/,{token:"regexp.slash",bracket:"@open",next:"@regexp"}],[/[{}()\[\]]/,"@brackets"],[/[;,.]/,"delimiter"],[/@symbols/,{cases:{"@operators":"operator","@default":""}}],[/\d+\.\d*(@exponent)?/,"number.float"],[/\.\d+(@exponent)?/,"number.float"],[/\d+@exponent/,"number.float"],[/0[xX][\da-fA-F]+/,"number.hex"],[/0[0-7]+/,"number.octal"],[/\d+/,"number"],[/"([^"\\]|\\.)*$/,"string.invalid"],[/'([^'\\]|\\.)*$/,"string.invalid"],[/"/,"string",'@string."'],[/'/,"string","@string.'"]],whitespace:[[/[ \t\r\n]+/,"white"],[/\/\*/,"comment","@comment"],[/\/\/.*$/,"comment"]],comment:[[/[^\/*]+/,"comment"],[/\/\*/,"comment.invalid"],["\\*/","comment","@pop"],[/[\/*]/,"comment"]],string:[[/[^\\"']+/,"string"],[/@escapes/,"string.escape"],[/\\./,"string.escape.invalid"],[/["']/,{cases:{"$#==$S2":{token:"string",next:"@pop"},"@default":"string"}}]],regexp:[[/(\{)(\d+(?:,\d*)?)(\})/,["@brackets.regexp.escape.control","regexp.escape.control","@brackets.regexp.escape.control"]],[/(\[)(\^?)(?=(?:[^\]\\\/]|\\.)+)/,[{token:"@brackets.regexp.escape.control"},{token:"regexp.escape.control",next:"@regexrange"}]],[/(\()(\?:|\?=|\?!)/,["@brackets.regexp.escape.control","regexp.escape.control"]],[/[()]/,"@brackets.regexp.escape.control"],[/@regexpctl/,"regexp.escape.control"],[/[^\\\/]/,"regexp"],[/@regexpesc/,"regexp.escape"],[/\\\./,"regexp.invalid"],["/",{token:"regexp.slash",bracket:"@close"},"@pop"]],regexrange:[[/-/,"regexp.escape.control"],[/\^/,"regexp.invalid"],[/@regexpesc/,"regexp.escape"],[/[^\]]/,"regexp"],[/\]/,"@brackets.regexp.escape.control","@pop"]]}},of={id:tf,conf:nf,language:sf},lf=of,af="log",rf={},df={tokenizer:{root:[[/ FATAL[\s\S]*/,{token:"error",next:"@error"}],[/ ERROR[\s\S]*/,{token:"error",next:"@error"}],[/ STDERR[\s\S]*/,{token:"error",next:"@error"}],[/ STDOUT.*/,{token:"stdout",next:"@stdout"}],[/ INFO[\s\S]*/,{token:"info",next:"@info"}],[/ WARN.*/,{token:"warn",next:"@warn"}],[/ TRACE[\s\S]*/,{token:"trace",next:"@trace"}],[/ DEBUG[.\s\S]*/,{token:"debug",next:"@debug"}],[/^\d{2}:\d{2}:\d{2}.\d{3}/,"date"]],error:[{include:"@body"}],info:[{include:"@body"}],warn:[{include:"@body"}],stdout:[{include:"@body"}],trace:[{include:"@body"}],debug:[{include:"@body"}],body:[[/^\d{2}:\d{2}:\d{2}.\d{3}/,{token:"date",next:"@pop"}],[/[\s\S]*/,{token:"$S0"}]]}},cf={id:af,conf:rf,language:df},hf=cf,Sn=ee.module("MonacoUtils");class vn{static init({getWorker:e}={}){Sn.debug("Initializing Monaco..."),e!==void 0&&vn.registerGetWorker(e);const{registerLanguages:t,removeHashtag:n}=vn,s=[{token:"",foreground:n(ue.foreground)},{token:"string",foreground:n(ue.string)},{token:"string.delim",foreground:n(ue["string-delim"])},{token:"keyword",foreground:n(ue.keyword)},{token:"identifier.js",foreground:n(ue["identifier-js"])},{token:"delimiter",foreground:n(ue.delimiter)},{token:"comment",foreground:n(ue.comment)},{token:"number",foreground:n(ue.number)},{token:"storage",foreground:n(ue.storage)},{token:"identifier",foreground:n(ue.identifier)},{token:"namespace.identifier",foreground:n(ue["namespace-identifier"])},{token:"operator",foreground:n(ue.operator)},{token:"predefined",foreground:n(ue.predefined)},{token:"error.log",foreground:ue["log-error"].substring(1)},{token:"warn.log",foreground:n(ue["log-warn"])},{token:"info.log",foreground:n(ue["log-info"])},{token:"stdout.log",foreground:n(ue["log-stdout"])},{token:"trace.log",foreground:n(ue["log-trace"])},{token:"debug.log",foreground:n(ue["log-debug"])},{token:"date.log",foreground:n(ue["log-date"])}],i={errorForeground:ue["error-foreground"],"inputOption.activeBorder":ue["input-option-active-border"],"editor.background":ue.background,"editor.foreground":ue.foreground,"editor.lineHighlightBackground":ue["editor-line-highlight-bg"],"editorLineNumber.foreground":ue["editor-line-number-foreground"],"editor.selectionBackground":ue["editor-selection-background"],"editor.findMatchBackground":ue["editor-find-match-background"],"editor.findMatchHighlightBackground":ue["editor-find-match-highlight-background"],"editorSuggestWidget.background":ue["editor-suggest-widget-background"],"editorSuggestWidget.border":ue["editor-suggest-widget-border"],"editorSuggestWidget.foreground":ue["editor-suggest-widget-foreground"],"editorSuggestWidget.selectedBackground":ue["editor-suggest-widget-selected-background"],"editorSuggestWidget.highlightForeground":ue["editor-suggest-widget-highlightForeground"],"list.hoverBackground":ue["list-hover-background"],"dropdown.background":ue["context-menu-background"],"dropdown.foreground":ue["context-menu-foreground"],"menu.selectionBackground":ue["menu-selection-background"],"list.focusBackground":ue["menu-selection-background"],"editorWidget.background":ue["editor-widget-background"],"inputOption.activeBackground":ue["input-option-active-background"],"inputOption.activeForeground":ue["input-option-active-foreground"],focusBorder:ue["focus-border"],"input.background":ue["input-background"],"input.foreground":ue["input-foreground"],"input.border":ue["input-border"],"textLink.foreground":ue["text-link-foreground"],"textLink.activeForeground":ue["text-link-active-foreground"],"editorLink.activeForeground":ue["editor-link-active-foreground"]};Kn.defineTheme("dh-dark",{base:"vs-dark",inherit:!0,rules:s,colors:i}),Sn.debug2("monaco theme: ",ue),Kn.setTheme("dh-dark"),t([lf,Wp,qp,hf,ef]),Sn.debug("Monaco initialized.")}static registerGetWorker(e){window.MonacoEnvironment={...window.MonacoEnvironment,getWorker:e}}static removeHashtag(e){return e.substring(1)}static registerLanguages(e){const t=e.map(({id:n})=>n);Rn.getLanguages().filter(({id:n})=>t.includes(n)).forEach(n=>{const s=n;Sn.debug2("Overriding default language loader:",s.id)}),e.forEach(n=>{vn.registerLanguage(n)})}static registerLanguage(e){Sn.debug2("Registering language: ",e.id),Rn.register(e),Rn.onLanguage(e.id,()=>{Rn.setLanguageConfiguration(e.id,e.conf),Rn.setMonarchTokensProvider(e.id,e.language)})}static setEOL(e,t=Kn.EndOfLineSequence.LF){e.getModel()?.setEOL(t)}static openDocument(e,t){const n=e.getModel();N(n);const s={textDocument:{uri:`${n.uri}`,languageId:n.getLanguageId(),version:n.getVersionId(),text:n.getValue()}};return Sn.debug2("didOpenDocumentParams: ",s),t.openDocument(s),e.onDidChangeModelContent(o=>{const{changes:l,versionId:a}=o,d=[];for(let h=0;h<l.length;h+=1){const u=l[h],{range:m,rangeLength:g,text:p}=u,C={range:{start:{line:m.startLineNumber-1,character:m.startColumn-1},end:{line:m.endLineNumber-1,character:m.endColumn-1}},rangeLength:g,text:p};d.push(C)}if(d.length>0){const h={textDocument:{version:a,uri:`${n.uri}`},contentChanges:d};Sn.debug2("didChangeDocumentParams",h),t.changeDocument(h)}})}static closeDocument(e,t){const n=e.getModel();N(n);const s={textDocument:{uri:`${n.uri}`}};t.closeDocument(s)}static registerPasteHandler(e){e.onDidPaste(t=>{const n=/“|”/g,s=/\u200b/g,i=/\u00A0/g,o=e.getModel();N(o);const l=o.getValueInRange(t.range);(n.test(l)||s.test(l)||i.test(l))&&o.applyEdits([{range:t.range,text:l.replace(n,'"').replace(s,"").replace(i," ")}])})}static isMacPlatform(){const{platform:e}=window.navigator;return e.startsWith("Mac")}static removeConflictingKeybindings(e){const t=[{windows:"ctrl+D",mac:"meta+D"},{windows:"ctrl+H"}];try{t.forEach(n=>{vn.isMacPlatform()&&n.mac===""||!vn.isMacPlatform()&&n.windows===""||vn.removeKeybinding(e,vn.isMacPlatform()?n.mac:n.windows)})}catch(n){Sn.error(n)}}static removeKeybinding(e,t){if(t===void 0)return;const n=e._standaloneKeybindingService._getResolver()._map.get(t);n!=null?n.forEach(s=>{Sn.debug2(`Removing Monaco keybinding ${t} for ${s.command}`),e._standaloneKeybindingService.addDynamicKeybinding(`-${s.command}`,null,()=>{})}):Sn.warn(`Did not find any keybindings to remove for ${t}`)}static getMonacoKeyCodeFromShortcut(e){const{keyState:t}=e,{keyValue:n}=t;return n===null?0:vn.isMacPlatform()?(t.metaKey?tn.CtrlCmd:0)|(t.shiftKey?tn.Shift:0)|(t.altKey?tn.Alt:0)|(t.ctrlKey?tn.WinCtrl:0)|gd.fromString(n):(t.ctrlKey?tn.CtrlCmd:0)|(t.shiftKey?tn.Shift:0)|(t.altKey?tn.Alt:0)|(t.metaKey?tn.WinCtrl:0)|gd.fromString(n)}static provideLinks(e){const t=[];for(let n=1;n<=e.getLineCount();n+=1){const s=e.getLineContent(n);La(s).forEach(o=>{t.push({url:o.href,range:new zm(n,o.start+1,n,o.end+1)})})}return{links:t}}}const Lt=vn,An=ee.module("MonacoCompletionProvider");class Hs extends w.PureComponent{static lspToMonacoKind(e){const t=Rn.CompletionItemKind;switch(e){case 1:return t.Text;case 2:return t.Method;case 3:return t.Function;case 4:return t.Constructor;case 5:return t.Field;case 6:return t.Variable;case 7:return t.Class;case 8:return t.Interface;case 9:return t.Module;case 10:return t.Property;case 11:return t.Unit;case 12:return t.Value;case 13:return t.Enum;case 14:return t.Keyword;case 15:return t.Snippet;case 16:return t.Color;case 17:return t.File;case 18:return t.Reference;case 19:return t.Folder;case 20:return t.EnumMember;case 21:return t.Constant;case 22:return t.Struct;case 23:return t.Event;case 24:return t.Operator;case 25:return t.TypeParameter;default:return t.Variable}}static lspToMonacoRange(e){const{start:t,end:n}=e;return{startLineNumber:t.line+1,startColumn:t.character+1,endLineNumber:n.line+1,endColumn:n.character+1}}static monacoToLspPosition(e){return{line:e.lineNumber-1,character:e.column-1}}constructor(e){super(e),this.handleCompletionRequest=this.handleCompletionRequest.bind(this),this.handleSignatureRequest=this.handleSignatureRequest.bind(this),this.handleHoverRequest=this.handleHoverRequest.bind(this)}componentDidMount(){const{language:e,session:t}=this.props;this.registeredCompletionProvider=Rn.registerCompletionItemProvider(e,{provideCompletionItems:this.handleCompletionRequest,triggerCharacters:[".",'"',"'"]}),t.getSignatureHelp&&(this.registeredSignatureProvider=Rn.registerSignatureHelpProvider(e,{provideSignatureHelp:this.handleSignatureRequest,signatureHelpTriggerCharacters:["(",","]})),t.getHover&&(this.registeredHoverProvider=Rn.registerHoverProvider(e,{provideHover:this.handleHoverRequest}))}componentWillUnmount(){this.registeredCompletionProvider?.dispose(),this.registeredSignatureProvider?.dispose(),this.registeredHoverProvider?.dispose()}registeredCompletionProvider;registeredSignatureProvider;registeredHoverProvider;handleCompletionRequest(e,t,n){const{model:s,session:i}=this.props;if(e!==s)return null;const o={textDocument:{uri:`${e.uri}`,version:e.getVersionId()},position:Hs.monacoToLspPosition(t),context:n},l=i.getCompletionItems(o);return An.debug("Requested completion items",o),l.then(d=>(An.debug("Completion items received: ",o,d),{incomplete:!0,suggestions:d.map(u=>{const{label:m,kind:g,detail:p,documentation:C,sortText:f,filterText:S,textEdit:v,insertTextFormat:b}=u;return{label:m,kind:Hs.lspToMonacoKind(g),detail:p,documentation:C?.kind==="markdown"?C:C?.value,sortText:f,filterText:S,insertText:v.text,insertTextRules:b===2?4:b,range:Hs.lspToMonacoRange(v.range)}})})).catch(d=>(An.error("There was an error retrieving completion items",d),{suggestions:[]}))}handleSignatureRequest(e,t,n,s){const i={value:{signatures:[],activeSignature:0,activeParameter:0},dispose:()=>{}},{model:o,session:l}=this.props;if(e!==o||!l.getSignatureHelp)return null;const a={textDocument:{uri:`${e.uri}`,version:e.getVersionId()},position:Hs.monacoToLspPosition(t),context:s},d=l.getSignatureHelp(a);return An.debug("Requested signature help",a),d.then(u=>{An.debug("Signatures received: ",a,d);const m=u.map(p=>{const{label:C,documentation:f,parameters:S}=p;return{documentation:f?.kind==="markdown"?f:f?.value,label:C,parameters:S??[]}});if(m.length===0)return i;const g=0;return{value:{signatures:m,activeSignature:g,activeParameter:u[g].activeParameter},dispose:()=>{}}}).catch(u=>(An.error("There was an error retrieving completion items",u),i))}handleHoverRequest(e,t){const{model:n,session:s}=this.props;if(e!==n||!s.getHover)return null;const i={textDocument:{uri:`${e.uri}`,version:e.getVersionId()},position:Hs.monacoToLspPosition(t)},o=s.getHover(i);return An.debug("Requested hover",i),o.then(a=>{An.debug("Hover received: ",i,a);const{contents:d}=a;return{contents:d?[d]:[]}}).catch(a=>(An.error("There was an error retrieving hover",a),{contents:[]}))}render(){return null}}const rh=Hs;const pa=ee.module("ConsoleInput"),nl=parseInt(ue["line-height"],10),ch=6,hh=6,uf=nl+ch+hh,fa=100;class pr extends w.PureComponent{static defaultProps={maxHeight:nl*10,scope:null,disabled:!1};static INPUT_CLASS_NAME="console-input";constructor(e){super(e),this.handleWindowResize=this.handleWindowResize.bind(this),this.commandContainer=ae.createRef(),this.commandHistoryIndex=null,this.timestamp=Date.now(),this.bufferIndex=0,this.history=[],this.modifiedCommands=new Map,this.state={commandEditorHeight:nl,isFocused:!1,model:null}}componentDidMount(){this.initCommandEditor(),window.addEventListener("resize",this.handleWindowResize),this.loadMoreHistory()}componentDidUpdate(){this.layoutEditor()}componentWillUnmount(){window.removeEventListener("resize",this.handleWindowResize),this.loadingPromise!=null&&this.loadingPromise.cancel(),this.destroyCommandEditor()}cancelListener;commandContainer;commandEditor;commandHistoryIndex;commandSuggestionContainer;loadingPromise;timestamp;bufferIndex;history;modifiedCommands;setConsoleText(e,t=!0,n=!1){e&&(pa.debug("Command received: ",e),n||(this.commandHistoryIndex=null,this.commandEditor?.setValue(e)),t&&this.focusEnd(),this.updateDimensions(),n&&this.processCommand(e))}initCommandEditor(){const{language:e,session:t}=this.props,n={copyWithSyntaxHighlighting:!1,cursorStyle:"block",fixedOverflowWidgets:!0,folding:!1,fontFamily:"Fira Mono",glyphMargin:!1,language:e,lineHeight:nl,lineDecorationsWidth:3,lineNumbers:"off",minimap:{enabled:!1},renderLineHighlight:"none",scrollBeyondLastLine:!1,scrollbar:{arrowSize:0,horizontal:"hidden",horizontalScrollbarSize:0},padding:{top:ch,bottom:hh},tabCompletion:"on",value:"",wordWrap:"on"},s=this.commandContainer.current;N(s),this.commandEditor=Kn.create(s,n),Lt.setEOL(this.commandEditor),Lt.openDocument(this.commandEditor,t),this.commandEditor.onDidChangeModelContent(()=>{const i=this.commandEditor?.getValue();this.modifiedCommands.set(this.commandHistoryIndex,i??null),this.updateDimensions()}),this.commandEditor.onDidFocusEditorText(()=>{this.setState({isFocused:!0})}),this.commandEditor.onDidBlurEditorText(()=>{this.setState({isFocused:!1})}),this.commandEditor.onKeyDown(i=>{const{commandEditor:o,commandHistoryIndex:l}=this,a=o?.getPosition();N(a);const{lineNumber:d}=a,h=o?.getModel();if(i.code==="ArrowUp"&&!this.isSuggestionMenuPopulated()&&d===1){l!=null?this.loadCommand(l+1):this.loadCommand(0),this.focusStart(),i.stopPropagation(),i.preventDefault();return}if(i.code==="ArrowDown"&&!this.isSuggestionMenuPopulated()&&d===h?.getLineCount()){l!=null&&l>0?this.loadCommand(l-1):this.loadCommand(null),this.focusEnd(),i.stopPropagation(),i.preventDefault();return}if(!i.altKey&&!i.shiftKey&&!i.metaKey)if(i.keyCode===Cs.Enter){if(!this.isSuggestionMenuPopulated()){i.stopPropagation(),i.preventDefault();const u=this.commandEditor?.getValue().trim();u!==void 0&&(this.processCommand(u),this.commandEditor?.setValue(""))}}else i.keyCode===Cs.Tab&&(this.isSuggestionMenuActive()?this.isSuggestionMenuPopulated()||(i.stopPropagation(),i.preventDefault()):(i.stopPropagation(),i.preventDefault(),this.commandEditor?.trigger("Tab key trigger suggestions","editor.action.triggerSuggest",{})))}),this.commandEditor.addCommand(tn.CtrlCmd|Cs.KeyF,()=>{}),Lt.removeConflictingKeybindings(this.commandEditor),Lt.registerPasteHandler(this.commandEditor),this.commandEditor.focus(),this.updateDimensions(),this.setState({model:this.commandEditor.getModel()})}destroyCommandEditor(){const{session:e}=this.props;this.commandEditor&&(Lt.closeDocument(this.commandEditor,e),this.commandEditor.dispose(),this.commandEditor=void 0)}handleWindowResize(){this.updateDimensions()}isSuggestionMenuActive(){return this.commandSuggestionContainer||(this.commandSuggestionContainer=this.commandEditor?.getDomNode()?.querySelector(".suggest-widget")),(this.commandSuggestionContainer&&this.commandSuggestionContainer.classList.contains("visible"))??!1}isSuggestionMenuPopulated(){return this.isSuggestionMenuActive()&&(this.commandSuggestionContainer?.querySelector(".monaco-list-rows")?.childElementCount??0)>0}focus(){this.commandEditor?.focus()}focusStart(){const e=this.commandEditor?.getModel();N(e);const t=e.getLineLength(1)+1,n=this.commandEditor?.getTopForPosition(1,t);N(n),this.commandEditor?.setPosition({lineNumber:1,column:t}),this.commandEditor?.setScrollTop(n),this.commandEditor?.focus()}focusEnd(){const e=this.commandEditor?.getModel();N(e);const t=e.getLineCount(),n=e.getLineLength(t)+1,s=this.commandEditor?.getTopForPosition(t,n);N(s),this.commandEditor?.setPosition({lineNumber:t,column:n}),this.commandEditor?.setScrollTop(s),this.commandEditor?.focus()}clear(){this.commandEditor?.focus(),this.commandEditor?.getModel()?.setValue(""),this.commandHistoryIndex=null}layoutEditor(){this.commandEditor&&this.commandEditor.layout()}loadCommand(e){if(e!==null&&e>=this.history.length)return;const t=this.modifiedCommands.get(e),n=e===null?"":this.history[this.history.length-e-1];this.commandHistoryIndex=e,this.commandEditor?.getModel()?.setValue(t??n),e!==null&&e>this.history.length-fa&&this.loadMoreHistory()}async loadMoreHistory(){try{if(this.loadingPromise!=null||this.bufferIndex==null)return;const{commandHistoryStorage:e,language:t,scope:n}=this.props;this.loadingPromise=ve.makeCancelable(e.getTable(t,n??"",this.timestamp),o=>o.close());const s=await this.loadingPromise;s.setReversed(!0),s.setViewport({top:this.bufferIndex,bottom:this.bufferIndex+fa-1}),this.loadingPromise=ve.makeCancelable(s.getViewportData(),()=>s.close());const i=await this.loadingPromise;this.bufferIndex+=fa,this.bufferIndex>=s.size&&(this.bufferIndex=null),this.history=[...i.items.filter(({name:o},l,a)=>l===0||o!==a[l-1].name).map(({name:o})=>o).reverse(),...this.history],this.loadingPromise=void 0,s.close()}catch(e){if(this.loadingPromise=void 0,ve.isCanceled(e)){pa.debug2("Promise canceled, not loading history");return}pa.error("Error fetching history",e)}}processCommand(e){this.commandHistoryIndex=null,this.modifiedCommands.clear(),N(e),e!==""&&(this.history.length===0||e!==this.history[this.history.length-1])&&this.history.push(e),this.updateDimensions();const{onSubmit:t}=this.props;t(e)}updateDimensions(){if(!this.commandEditor)return;const{maxHeight:e}=this.props;N(e);const t=this.commandEditor.getContentHeight(),n=Math.max(Math.min(t,e),uf),i={overviewRulerLanes:t>n?void 0:0};this.setState({commandEditorHeight:n},()=>{this.commandEditor?.updateOptions(i),this.commandEditor?.layout()})}render(){const{disabled:e,language:t,session:n}=this.props,{commandEditorHeight:s,isFocused:i,model:o}=this.state;return r.jsx("div",{className:K("console-input-wrapper",{disabled:e}),children:r.jsxs("div",{className:K("console-input-inner-wrapper",{focus:i}),children:[r.jsx("div",{className:pr.INPUT_CLASS_NAME,ref:this.commandContainer,style:{height:s}}),o&&r.jsx(rh,{model:o,language:t,session:n})]})})}}const Ed=pr;const yd="pasted values",mf=[/^audio.*/,/^font.*/,/^image.*/,/^video.*/],Ca=[".csv",".tsv",".tab",".psv",".dsv",".txt"],Rd=[".zip"];class Us extends w.Component{static defaultProps={allowZip:!1,dragError:null};static MULTIPLE_FILE_ERROR="Please select only one file";static FILE_TYPE_ERROR="Filetype not supported.";static isValidDropItem(e){return e!=null&&e.kind==="file"&&!mf.find(t=>t.test(e.type))}static isValidExtension(e,t=!1){return Ca.some(n=>e.endsWith(n))||t&&Rd.some(n=>e.endsWith(n))}static handleDragOver(e){e.preventDefault(),e.stopPropagation()}static getIcon(e){return e===yd?pd:e.endsWith(".csv")?qm:e.endsWith(".zip")?Xm:Zm}constructor(e){super(e),this.handleSelectFile=this.handleSelectFile.bind(this),this.handleFiles=this.handleFiles.bind(this),this.handleDrop=this.handleDrop.bind(this),this.unstageFile=this.unstageFile.bind(this),this.handleMenuPaste=this.handleMenuPaste.bind(this),this.handlePasteEvent=this.handlePasteEvent.bind(this),this.fileElem=ae.createRef(),this.divElem=ae.createRef(),this.state={selectedFileName:""}}componentDidMount(){this.divElem.current?.addEventListener("paste",this.handlePasteEvent),this.divElem.current?.focus()}componentWillUnmount(){this.divElem.current?.removeEventListener("paste",this.handlePasteEvent)}fileElem;divElem;handleSelectFile(){this.fileElem.current&&(this.fileElem.current.value="",this.fileElem.current?.click())}handleFiles(e){e.stopPropagation(),e.preventDefault();const{files:t}=e.target;t!=null&&this.handleFile(t[0])}handleDrop(e){const{allowZip:t,clearDragError:n,dragError:s}=this.props;if(e.preventDefault(),e.stopPropagation(),s!=null){n();return}if(e.dataTransfer==null||e.dataTransfer.items==null||e.dataTransfer.items.length===0)return;const i=e.dataTransfer.items[0].getAsFile();N(i),Us.isValidExtension(i.name,t)?this.handleFile(i):this.setState({dropError:Us.FILE_TYPE_ERROR})}unstageFile(e){const{onCancel:t}=this.props;e.stopPropagation(),e.preventDefault(),t(),this.setState({selectedFileName:"",dropError:void 0})}handleFile(e){const{onFileOpened:t}=this.props;t(e),this.setState({selectedFileName:e.name,dropError:void 0})}handleMenuPaste(){const{onPaste:e,onError:t,uploadInProgress:n}=this.props;n||navigator.clipboard.readText().then(s=>{e(s),this.setState({selectedFileName:yd,dropError:void 0})}).catch(s=>t(s))}handlePasteEvent(e){e.stopPropagation(),e.preventDefault(),this.handleMenuPaste()}makeContextMenuItems(){const{uploadInProgress:e}=this.props;return[{title:"Paste",icon:pd,action:this.handleMenuPaste,shortcut:qn.PASTE,disabled:e}]}getValidExtensions=he(e=>e?[...Ca,...Rd]:[...Ca]);getAcceptString=he(e=>this.getValidExtensions(e).join(", "));getFileTypeErrorString=he(e=>en.join(this.getValidExtensions(e),"or"));render(){const{allowZip:e,dragError:t,uploadInProgress:n}=this.props,{selectedFileName:s,dropError:i}=this.state,o=t??i,l=this.makeContextMenuItems();return r.jsxs("div",{ref:this.divElem,className:"csv-overlay fill-parent-absolute",onDragOver:Us.handleDragOver,onDrop:this.handleDrop,tabIndex:-1,children:[r.jsx(se,{actions:l}),r.jsx("input",{ref:this.fileElem,type:"file",id:"fileElem",accept:this.getAcceptString(e),style:{display:"none"},onChange:this.handleFiles,"data-testid":"fileElem"}),!s&&(o===void 0||o==="")&&r.jsxs("div",{className:"message-content",children:[r.jsx("div",{className:"message-icon",children:r.jsx(X,{icon:Qm})}),r.jsx("label",{children:"Drop file (or paste values) here to import"}),r.jsx("div",{className:"message-small",children:r.jsx("label",{children:"or"})}),r.jsx(_,{kind:"primary",onClick:this.handleSelectFile,children:"Select File..."})]}),s&&(o===void 0||o==="")&&r.jsxs("div",{className:"selected-content",children:[r.jsx("div",{className:"selected-icon",children:r.jsx(X,{icon:Us.getIcon(s)})}),r.jsxs("div",{className:"selected-text",children:[r.jsx("label",{children:"Selected File"}),r.jsxs("label",{className:"selected-name",children:[s,!n&&r.jsx(_,{kind:"ghost",className:"ml-2",onClick:this.unstageFile,icon:Wt,tooltip:"Remove"})]})]})]}),Boolean(o)&&r.jsxs("div",{className:"message-content",children:[r.jsx("div",{className:"message-icon",children:r.jsx(X,{icon:vs})}),r.jsx("label",{children:o}),o===Us.FILE_TYPE_ERROR&&r.jsx("div",{className:"message-small",children:r.jsx("label",{children:this.getFileTypeErrorString(e)})})]})]})}}const hi=Us;class gf{static INTEGER="int";static LONG="long";static DOUBLE="double";static BOOLEAN="bool";static STRING="string";static DATE_TIME="datetime";static LOCAL_TIME="localtime"}const Oe=gf,xd="unknown",pf=2147483647,ff=-2147483648,Id=/^[0-9]{4}-[0-1][0-9]-[0-3][0-9][ T][0-2][0-9]:[0-5][0-9]:[0-6][0-9](?:\.[0-9]{1,9})?(?: [a-zA-Z]+)?$/,Dd=/^([0-9]+T)?([0-9]+):([0-9]+)(:[0-9]+)?(?:\.[0-9]{1,9})?$/;class bt{static determineType(e,t,n){if(!e||e===n)return t;switch(t){case Oe.STRING:return Oe.STRING;case Oe.INTEGER:return bt.checkInteger(e);case Oe.LONG:return bt.checkLong(e);case Oe.DOUBLE:return bt.checkDouble(e);case Oe.BOOLEAN:return bt.checkBoolean(e);case Oe.DATE_TIME:return bt.checkDateTime(e);case Oe.LOCAL_TIME:return bt.checkLocalTime(e);default:return bt.getTypeFromUnknown(e)}}static isNotParsableNumber(e){return isNaN(e)||e==="Infinity"||e==="-Infinity"}static checkInteger(e){const t=e.replace(/,/g,"");return bt.isNotParsableNumber(t)?Oe.STRING:bt.getNumberType(t)}static checkLong(e){const t=e.replace(/,/g,"");return bt.isNotParsableNumber(t)?Oe.STRING:t.includes(".")?Oe.DOUBLE:Oe.LONG}static checkDouble(e){const t=e.replace(/,/g,"");return bt.isNotParsableNumber(t)?Oe.STRING:Oe.DOUBLE}static checkBoolean(e){const t=e.toLowerCase();return t==="true"||t==="false"?Oe.BOOLEAN:Oe.STRING}static checkDateTime(e){return Id.test(e)?Oe.DATE_TIME:Oe.STRING}static checkLocalTime(e){return Dd.test(e)?Oe.LOCAL_TIME:Oe.STRING}static getTypeFromUnknown(e){const t=e.replace(/,/g,"");if(bt.isNotParsableNumber(t)){const n=e.toLowerCase();return n==="true"||n==="false"?Oe.BOOLEAN:Id.test(e)&&e.includes(":")?Oe.DATE_TIME:Dd.test(e)?Oe.LOCAL_TIME:Oe.STRING}return bt.getNumberType(t)}static getNumberType(e){if(e.includes("."))return Oe.DOUBLE;const t=e.startsWith("-")?11:10;if(e.length>t)return Oe.LONG;const n=parseInt(e,10);return n>pf||n<ff?Oe.LONG:Oe.INTEGER}constructor(e,t,n,s,i,o,l,a,d,h){this.onFileCompleted=e,this.file=t,this.readHeaders=n,this.nullString=i,this.onProgress=o,this.onError=l,this.chunks=0,this.totalChunks=a,this.isZip=d,this.shouldTrim=h,this.zipProgress=0,this.handleChunk=this.handleChunk.bind(this),this.handleComplete=this.handleComplete.bind(this),this.handleError=this.handleError.bind(this),this.handleNodeUpdate=this.handleNodeUpdate.bind(this),this.config={...s,error:this.handleError,chunk:this.handleChunk,complete:this.handleComplete}}onFileCompleted;file;readHeaders;nullString;onProgress;onError;types;chunks;totalChunks;isZip;shouldTrim;zipProgress;config;parse(){const e=this.isZip?this.file.nodeStream("nodebuffer",this.handleNodeUpdate):this.file;_a.parse(e,this.config)}handleChunk(e,t){let{data:n}=e;if(!this.types){if(n==null||n.length===0){t.abort(),this.onError("Error parsing CSV: no data in file.");return}this.types=new Array(n[0].length).fill(xd),this.readHeaders&&(n=n.slice(1))}N(this.types);const s=[...this.types];n.forEach(l=>{if(l.length>=s.length){for(let a=0;a<s.length;a+=1)s[a]=bt.determineType(this.shouldTrim?l[a].trim():l[a],s[a],this.nullString);this.types=s}else t.abort(),this.onError(`Error parsing CSV: Insufficient data in row.
3
3
  Expected length ${s.length} but found ${l.length}.
4
4
  Row = ${l}`)}),this.chunks+=1;let i=0;this.totalChunks>0?i=Math.round(this.chunks/this.totalChunks*50):i=Math.round(this.zipProgress/2),this.onProgress(i)&&t.abort()}handleComplete(e){const{types:t,onFileCompleted:n}=this;N(t),(e==null||!e.meta.aborted)&&n(t.map(s=>s===xd?Oe.STRING:s))}handleError(e){const{onError:t}=this;t(e)}handleNodeUpdate(e){this.zipProgress=e.percent}}const Cf=bt,_o=ee.module("CsvParser"),Sf=650;class Xi{static generateHeaders=e=>{const t=[];for(let n=0;n<e;n+=1)t.push(Xi.generateHeaderRecursive(n));return t};static generateHeaderRecursive(e){let t="",n=e;return e>=26&&(t=t.concat(Xi.generateHeaderRecursive(Math.floor(e/26)-1)),n=e%26),t.concat(String.fromCharCode(65+n))}constructor({onFileCompleted:e,session:t,file:n,type:s,readHeaders:i=!0,onProgress:o,onError:l,timeZone:a,isZip:d}){this.onFileCompleted=e,this.session=t,this.file=n,this.isZip=d,this.type=s,this.readHeaders=i,this.timeZone=a,this.onProgress=o,this.onError=l,this.tables=[],this.chunks=0,this.totalChunks=d?0:Math.ceil(n.size/_a.LocalChunkSize),this.isComplete=!1,this.zipProgress=0,this.numConsolidated=0,this.isCancelled=!1,this.handleChunk=this.handleChunk.bind(this),this.handleError=this.handleError.bind(this),this.handleComplete=this.handleComplete.bind(this),this.handleNodeUpdate=this.handleNodeUpdate.bind(this),this.handleCreateTable=this.handleCreateTable.bind(this),this.config={delimiter:s.delimiter,newline:s.newline,escapeChar:s.escapeChar,dynamicTyping:!1,error:this.handleError,skipEmptyLines:s.skipEmptyLines,chunk:this.handleChunk,complete:this.handleComplete,fastMode:!1}}onFileCompleted;session;file;isZip;type;readHeaders;timeZone;onProgress;onError;tables;headers;types;chunks;totalChunks;isComplete;zipProgress;consolidatedChunks;numConsolidated;isCancelled;config;cancel(){this.isCancelled=!0}transpose(e,t){const n=t.length,s=new Array(e).fill(null).map(()=>new Array(n));for(let i=0;i<n;i+=1){const o=t[i];if(o.length<e)throw new Error(`Insufficient columns. Expected ${e} but found ${o.length}
@@ -39,4 +39,4 @@ This note can be edited using **markdown** for styling.`;static getNewMarkdownTi
39
39
  Web UI Version: ${e}
40
40
  Java Version: ${l}
41
41
  Barrage Version: ${o}`,children:"Copy Versions"})]})]})]}),r.jsx("div",{className:"app-settings-footer-item",children:r.jsx(ax,{})})]}),r.jsx("div",{className:"app-settings-footer-section",children:r.jsx("div",{className:"logo",children:r.jsx("a",{target:"_blank",rel:"noreferrer noopener",href:"https://deephaven.io",className:"d-inline-block custom-link p-1",children:r.jsx("img",{src:Uu,alt:"Deephaven Data Labs",width:"230px"})})})})]})]})]})}}const Ac=10;function Ci(c){const{forwardedProps:{menuItem:{action:e,title:t,disabled:n},iconElement:s,displayShortcut:i,isMouseSelected:o,isKeyboardSelected:l,closeMenu:a}}=c,d=w.useRef(),h=w.useRef(),u=w.useRef(null),[m,g]=w.useState(!1),p=w.useCallback(S=>{d.current!=null&&h.current!=null&&u.current&&(Math.abs(d.current-S.clientX)>=Ac||Math.abs(h.current-S.clientY)>=Ac)&&(g(!0),window.removeEventListener("mousemove",p),a(),e(S),u.current=null)},[e,a]);function C(S){d.current=S.clientX,h.current=S.clientY,u.current=S.target,window.addEventListener("mousemove",p)}function f(S){u.current===S.target&&(g(!0),a(),e(),window.removeEventListener("mousemove",p)),u.current=null}return w.useEffect(function(){return function(){return window.removeEventListener("mousemove",p)}},[p]),r.jsxs("button",{type:"button",className:K("btn-context-menu",{disabled:n},{active:o&&!n},{"keyboard-active":l&&!n}),onMouseDown:C,onMouseUp:f,disabled:m,children:[r.jsx("span",{className:K("icon"),children:s}),r.jsx("span",{className:"title",children:t}),r.jsx("span",{className:"shortcut",children:i})]})}function sd(c){const{handleControlSelect:e,handleToolSelect:t,onClearFilter:n}=c,s=w.useMemo(()=>[{title:"Input Filter",icon:Xg,menuElement:r.jsx(Ci,{}),action:i=>{e(bs.INPUT_FILTER,i)},order:10},{title:"Dropdown Filter",icon:nh,menuElement:r.jsx(Ci,{}),action:i=>{e(bs.DROPDOWN_FILTER,i)},order:15},{title:"Markdown Widget",icon:Zg,menuElement:r.jsx(Ci,{}),action:i=>{e(bs.MARKDOWN,i)},order:20},{title:"Filter Sets",icon:Ua,menuElement:r.jsx(Ci,{}),action:i=>{e(bs.FILTER_SET_MANAGER,i)},order:25},{disabled:!0,menuElement:r.jsx("div",{className:"context-menu-group-header",children:"Tools"}),order:30},{title:"Linker",icon:Jc,action:()=>{t(_t.LINKER)},order:40,shortcut:qn.LINKER},{disabled:!0,menuElement:r.jsx("div",{className:"context-menu-group-header",children:"Actions"}),order:50},{title:"Clear All Filters",icon:Qg,action:()=>{n()},order:60,shortcut:Ut.TABLE.CLEAR_ALL_FILTERS}],[e,t,n]);return r.jsx(Wn,{popperClassName:"controls-menu-popper",actions:s})}sd.propTypes={handleControlSelect:B.func,handleToolSelect:B.func,onClearFilter:B.func};sd.defaultProps={handleControlSelect:()=>{},handleToolSelect:()=>{},onClearFilter:()=>{}};Ci.propTypes={forwardedProps:B.shape({iconElement:B.node,displayShortcut:B.string,isMouseSelected:B.bool.isRequired,isKeyboardSelected:B.bool.isRequired,closeMenu:B.func.isRequired,menuItem:B.shape({action:B.func,title:B.string,disabled:B.bool}).isRequired})};Ci.defaultProps={forwardedProps:null};const Tx=Qs(Hu,null),Ex={layoutStorage:Tx},yx=c=>c.layoutStorage,Rx=c=>c.serverConfigValues;Object.entries(Ex).map(([c,e])=>po.register(c,e));const Lc=10;function xx(c){const{onExportLayout:e,onImportLayout:t,onResetLayout:n,onSelect:s,widgets:i=[]}=c,[o,l]=w.useState(!1),[a,d]=w.useState(""),h=w.useRef(null),u=w.useRef(),m=w.useCallback((T,y)=>{T!=null&&s(T,y)},[s]),g=w.useCallback(T=>{d(T.target.value)},[]),p=w.useCallback(T=>{u.current!=null&&(Math.abs(u.current.x-T.clientX)>=Lc||Math.abs(u.current.y-T.clientY)>=Lc)&&(l(!0),window.removeEventListener("mousemove",p),m(u.current.widget,T),u.current=void 0)},[u,m]),C=w.useCallback((T,y)=>{u.current={x:T.clientX,y:T.clientY,widget:y},window.addEventListener("mousemove",p)},[p]),f=w.useCallback((T,y)=>{window.removeEventListener("mousemove",p),u.current?.widget===y&&(l(!0),m(y)),u.current=void 0},[p,u,m]),S=w.useMemo(()=>i.filter(T=>a?T.name?.toLowerCase().includes(a.toLowerCase()):!0),[a,i]).sort((T,y)=>T.name?.localeCompare(y.name??"")??0),v=w.useMemo(()=>S.map(T=>r.jsx("li",{children:r.jsxs(_,{kind:"ghost","data-testid":`panel-list-item-${T.name??""}-button`,onMouseDown:y=>{C(y,T)},onMouseUp:y=>{f(y,T)},onKeyDown:y=>{(y.key==="Enter"||y.key===" ")&&m(T)},disabled:o,onClick:()=>{},children:[r.jsx(oh,{type:T.type})," ",T.name??""]})},T.name)),[S,o,C,f,m]),b=w.useMemo(()=>v.length===0?r.jsx("span",{children:"No bound variables found."}):null,[v]);return r.jsxs("div",{className:"widget-list-container d-flex flex-column",children:[r.jsx("div",{className:"widget-list-header",children:r.jsx(xi,{value:a,placeholder:"Find Table, Plot or Widget",onChange:g,ref:h})}),r.jsxs("ul",{className:"widget-list flex-grow-1",children:[b&&r.jsx("li",{className:"widget-list-message",children:b}),!b&&v]}),r.jsx("div",{children:r.jsx("hr",{})}),r.jsxs("div",{className:"widget-list-footer",children:[r.jsxs(_,{kind:"ghost",onClick:e,children:[r.jsxs("div",{className:"fa-md fa-layers",children:[r.jsx(X,{mask:Ha,icon:wd,transform:"right-5 down-5"}),r.jsx(X,{icon:wd,transform:"right-8 down-6"})]}),"Export Layout"]}),r.jsxs(_,{kind:"ghost",onClick:t,children:[r.jsxs("div",{className:"fa-md fa-layers",children:[r.jsx(X,{mask:Ha,icon:Va,transform:"right-5 down-5"}),r.jsx(X,{icon:Va,transform:"right-8 down-6"})]}),"Import Layout"]}),r.jsx(_,{kind:"ghost",icon:Ws,onClick:n,tooltip:"Reset Layout"})]})]})}const Ix=async(c,e,t)=>{let n,s,i,o;if(sl(e)?(n=e.settings,s=e.table,i=void 0,o=e.tableSettings):(n={},s="",i=e.figure,o={}),t!==void 0&&(t.tableSettings!=null&&(o=t.tableSettings),t.table!=null&&(s=t.table),t.figure!=null&&(i=t.figure),t.settings!=null&&(n={...n,...t.settings})),i!==void 0){const d={title:i,name:i,type:I.VariableType.FIGURE},h=await c.getObject(d);return pl.makeModel(n,h)}const l={title:i,name:s,type:I.VariableType.TABLE},a=await c.getObject(l);return Ce.applyTableSettings(a,o,go(Tr.getState())),pl.makeModelFromSettings(n,a)},Dx=async(c,e,t=I.VariableType.TABLE)=>{const{table:n}=e,s={title:n,name:n,type:t},i=await c.getObject(s);return Br.makeModel(i)};function Fx({onAutoFillClick:c=()=>{}}){return r.jsxs("div",{className:"empty-dashboard-container",children:[r.jsxs("div",{className:"hint-container",children:[r.jsx(X,{icon:th})," ",r.jsx("br",{}),"Use the panel list to add objects from a query."]}),r.jsxs("div",{className:"empty-dashboard",children:[r.jsx("div",{className:"add-panels-hint",children:"Drag Panels Here"}),r.jsx(_,{kind:"tertiary",onClick:c,children:"Auto fill objects"})]})]})}function Nx(c){return c.version===2}function kx(c){return Array.isArray(c)}const Jo=ee.module("UserLayoutUtils"),Mx={layoutConfig:[{type:"column",content:[{type:"row",height:40,content:[{type:"stack",content:[{type:"react-component",component:fi.COMPONENT,title:fi.TITLE,isClosable:!1},{type:"react-component",component:Ml.COMPONENT,title:Ml.TITLE,isClosable:!1}]},{type:"stack",width:25,content:[{type:"react-component",component:xl.COMPONENT,title:xl.TITLE,isClosable:!1},{type:"react-component",component:Dl.COMPONENT,title:Dl.TITLE,isClosable:!1}]}]},{type:"row",content:[{type:"stack",title:"Notebooks",content:[]}]}]}],links:[],filterSets:[],version:2},Ox={layoutConfig:[],links:[],filterSets:[],version:2};function Ku(c){if(Nx(c))return c;if(kx(c))return{layoutConfig:c,links:[],filterSets:[],version:2};throw new Error(`Unexpected layout import format: ${c}`)}async function Ax(c,e=!0){try{const t=await c.getLayouts();if(t.length>0)try{const n=await c.getLayout(t[0]);return Ku(n)}catch(n){Jo.error("Unable to load layout",t[0],":",n),Jo.warn("No valid layouts found, falling back to default layout")}}catch(t){Jo.error("Unable to fetch layout list",t),Jo.warn("Falling back to default layout")}return e?Mx:Ox}function Lx(c){const{filterSets:e,layoutConfig:t,links:n}=c;return{filterSets:e,layoutConfig:t,links:n,version:2}}const ol={exportLayout:Lx,getDefaultLayout:Ax,normalizeLayout:Ku},el=ee.module("DownloadServiceWorkerUtils");class ro{static DOWNLOAD_PATH="/download/";static registerOnLoaded(){new URL("/ide/",window.location.href).origin===window.location.origin&&("serviceWorker"in navigator?window.addEventListener("load",()=>{const t=new URL("/ide/download/serviceWorker.js",window.location.href);navigator.serviceWorker.register(t).then(n=>{n.update(),el.info("Registering service worker on ",t,n)}).catch(n=>{el.error("Failed to register service worker",n)})}):el.info("Service worker is not supported."))}static async getServiceWorker(){if("serviceWorker"in navigator){const t=(await navigator.serviceWorker.getRegistrations()).find(n=>n.scope.endsWith(ro.DOWNLOAD_PATH));if(t&&t.active)return el.info("Download service worker is active."),t.active;throw new Error("Can not find download service worker.")}throw new Error("Download service worker is not available.")}static unregisterSW(){}}const St=ee.module("AppMainContainer");class Si extends w.Component{static handleWindowBeforeUnload(e){e.preventDefault(),e.returnValue=""}static hydrateConsole(e,t){return Ya.hydrate({...e,unzip:n=>Bc.loadAsync(n).then(s=>Object.values(s.files))},t)}static handleRefresh(){St.info("Refreshing application"),window.location.reload()}constructor(e){super(e),this.handleSettingsMenuHide=this.handleSettingsMenuHide.bind(this),this.handleSettingsMenuShow=this.handleSettingsMenuShow.bind(this),this.handleError=this.handleError.bind(this),this.handleControlSelect=this.handleControlSelect.bind(this),this.handleToolSelect=this.handleToolSelect.bind(this),this.handleClearFilter=this.handleClearFilter.bind(this),this.handleDataChange=this.handleDataChange.bind(this),this.handleAutoFillClick=this.handleAutoFillClick.bind(this),this.handleGoldenLayoutChange=this.handleGoldenLayoutChange.bind(this),this.handleLayoutConfigChange=this.handleLayoutConfigChange.bind(this),this.handleExportLayoutClick=this.handleExportLayoutClick.bind(this),this.handleImportLayoutClick=this.handleImportLayoutClick.bind(this),this.handleImportLayoutFiles=this.handleImportLayoutFiles.bind(this),this.handleLoadTablePlugin=this.handleLoadTablePlugin.bind(this),this.handleResetLayoutClick=this.handleResetLayoutClick.bind(this),this.handleWidgetMenuClick=this.handleWidgetMenuClick.bind(this),this.handleWidgetsMenuClose=this.handleWidgetsMenuClose.bind(this),this.handleWidgetSelect=this.handleWidgetSelect.bind(this),this.handlePaste=this.handlePaste.bind(this),this.hydrateChart=this.hydrateChart.bind(this),this.hydrateGrid=this.hydrateGrid.bind(this),this.hydratePandas=this.hydratePandas.bind(this),this.hydrateDefault=this.hydrateDefault.bind(this),this.openNotebookFromURL=this.openNotebookFromURL.bind(this),this.handleDisconnect=this.handleDisconnect.bind(this),this.handleReconnect=this.handleReconnect.bind(this),this.handleReconnectAuthFailed=this.handleReconnectAuthFailed.bind(this),this.importElement=ae.createRef(),this.state={contextActions:[{action:()=>{this.handleToolSelect(_t.LINKER)},shortcut:qn.LINKER,isGlobal:!0},{action:()=>{this.sendClearFilter()},shortcut:Ut.TABLE.CLEAR_ALL_FILTERS,isGlobal:!0},{action:()=>{St.debug("Consume unhandled save shortcut")},shortcut:qn.SAVE,isGlobal:!0}],isAuthFailed:!1,isDisconnected:!1,isPanelsMenuShown:!1,isSettingsMenuShown:!1,widgets:[]}}componentDidMount(){this.initWidgets(),this.startListeningForDisconnect(),window.addEventListener("beforeunload",Si.handleWindowBeforeUnload)}componentDidUpdate(e){const{dashboardData:t}=this.props;e.dashboardData!==t&&this.handleDataChange(t)}componentWillUnmount(){this.deinitWidgets(),this.stopListeningForDisconnect(),window.removeEventListener("beforeunload",Si.handleWindowBeforeUnload)}goldenLayout;importElement;widgetListenerRemover;initWidgets(){const{connection:e}=this.props;if(e.subscribeToFieldUpdates==null){St.warn("subscribeToFieldUpdates not supported, not initializing widgets");return}this.widgetListenerRemover=e.subscribeToFieldUpdates(t=>{St.debug("Got updates",t),this.setState(({widgets:n})=>{const{updated:s,created:i,removed:o}=t,l=[...s,...o],a=n.filter(h=>!l.some(u=>u.name===h.name));return[...s,...i].forEach(h=>{h.name!=null&&h.name!==""&&a.push(h)}),{widgets:a}})})}deinitWidgets(){this.widgetListenerRemover?.()}openNotebookFromURL(){const{match:e}=this.props,{notebookPath:t}=e.params;if(t){const{session:n,sessionConfig:s}=this.props;if(n==null||s==null){St.error("No session available to open notebook URL",t);return}const i={id:`/${t}`,itemName:`/${t}`},o=s.type,l={value:null,language:o};this.emitLayoutEvent(Pe.SELECT_NOTEBOOK,n,o,l,i,!0)}}sendClearFilter(){this.emitLayoutEvent(Ye.CLEAR_ALL_FILTERS)}emitLayoutEvent(e,...t){this.goldenLayout?.eventHub.emit(e,...t)}handleError(e){ve.isCanceled(e)||St.error(e)}handleSettingsMenuHide(){this.setState({isSettingsMenuShown:!1})}handleSettingsMenuShow(){this.setState({isSettingsMenuShown:!0})}handleControlSelect(e,t=null){switch(St.debug("handleControlSelect",e),e){case bs.DROPDOWN_FILTER:this.emitLayoutEvent(Ye.OPEN_DROPDOWN,{title:"DropdownFilter",type:e,createNewStack:!0,dragEvent:t});break;case bs.INPUT_FILTER:this.emitLayoutEvent(Ye.OPEN_INPUT,{title:"InputFilter",type:e,createNewStack:!0,dragEvent:t});break;case bs.MARKDOWN:this.emitLayoutEvent(Fu.OPEN,{title:"Markdown",type:e,dragEvent:t});break;case bs.FILTER_SET_MANAGER:this.emitLayoutEvent(Ye.OPEN_FILTER_SET_MANAGER,{title:"FilterSets",type:e,dragEvent:t});break;default:throw new Error(`Unrecognized control type ${e}`)}}handleToolSelect(e){St.debug("handleToolSelect",e);const{activeTool:t,setActiveTool:n}=this.props;n(t===e?_t.DEFAULT:e)}handleClearFilter(){this.sendClearFilter()}handleDataChange(e){const{updateWorkspaceData:t}=this.props,{closed:n,filterSets:s,links:i}=e;t({closed:n,filterSets:s,links:i})}handleGoldenLayoutChange(e){this.goldenLayout=e}handleLayoutConfigChange(e){const{updateWorkspaceData:t}=this.props;t({layoutConfig:e})}handleWidgetMenuClick(){this.setState(({isPanelsMenuShown:e})=>({isPanelsMenuShown:!e}))}handleWidgetSelect(e,t){this.setState({isPanelsMenuShown:!1}),St.debug("handleWidgetSelect",e,t),this.openWidget(e,t)}handleWidgetsMenuClose(){this.setState({isPanelsMenuShown:!1})}handleAutoFillClick(){const{widgets:e}=this.state;St.debug("handleAutoFillClick",e);const t=e.sort((n,s)=>n.title!=null&&s.title!=null?n.title.localeCompare(s.title):0);for(let n=0;n<t.length;n+=1)this.openWidget(t[n])}handleExportLayoutClick(){St.info("handleExportLayoutClick"),this.setState({isPanelsMenuShown:!1});try{const{workspace:e}=this.props,{data:t}=e,n=ol.exportLayout(t);St.info("handleExportLayoutClick exportedConfig",n);const s=new Blob([JSON.stringify(n)],{type:"application/json"}),i=I.i18n.DateTimeFormat.format("yyyy-MM-dd-HHmmss",new Date),o=document.createElement("a");o.href=URL.createObjectURL(s),o.download=`deephaven-app-layout-${i}.json`,o.click()}catch(e){St.error("Unable to export layout",e)}}handleImportLayoutClick(){St.info("handleImportLayoutClick"),this.setState({isPanelsMenuShown:!1}),this.importElement.current!=null&&(this.importElement.current.value="",this.importElement.current.click())}handleResetLayoutClick(){St.info("handleResetLayoutClick"),this.setState({isPanelsMenuShown:!1}),this.resetLayout()}handleImportLayoutFiles(e){e.stopPropagation(),e.preventDefault(),e.target.files!=null&&this.importLayoutFile(e.target.files?.[0])}handleDisconnect(){this.setState({isDisconnected:!0})}handleReconnect(){this.setState({isDisconnected:!1})}handleReconnectAuthFailed(){this.setState({isAuthFailed:!0})}async importLayoutFile(e){try{const{updateDashboardData:t,updateWorkspaceData:n}=this.props,s=await e.text(),i=JSON.parse(s),{filterSets:o,layoutConfig:l,links:a}=ol.normalizeLayout(i);n({layoutConfig:l}),t(un,{filterSets:o,links:a})}catch(t){St.error("Unable to import layout",t)}}async resetLayout(){const{layoutStorage:e,session:t}=this.props,{filterSets:n,layoutConfig:s,links:i}=await ol.getDefaultLayout(e,t!==void 0),{updateDashboardData:o,updateWorkspaceData:l}=this.props;l({layoutConfig:s}),o(un,{filterSets:n,links:i})}handlePaste(e){if(e.target instanceof HTMLElement&&e.target.closest(".monaco-editor"))return;const{clipboardData:t}=e,n=t.getData("Text"),s=/“|”/g;s.test(n)&&(e.preventDefault(),e.stopPropagation(),document.execCommand("insertText",!1,n.replace(s,'"')))}handleLoadTablePlugin(e){const{plugins:t}=this.props,n=t.get(e);if(n!=null&&n.TablePlugin!=null)return n.TablePlugin;const s=md("/ide/plugins/");return Pm(s,e)}startListeningForDisconnect(){const{connection:e}=this.props;e.addEventListener(I.IdeConnection.EVENT_DISCONNECT,this.handleDisconnect),e.addEventListener(I.IdeConnection.EVENT_RECONNECT,this.handleReconnect),e.addEventListener(I.CoreClient.EVENT_RECONNECT_AUTH_FAILED,this.handleReconnectAuthFailed)}stopListeningForDisconnect(){const{connection:e}=this.props;e.removeEventListener(I.IdeConnection.EVENT_DISCONNECT,this.handleDisconnect),e.removeEventListener(I.IdeConnection.EVENT_RECONNECT,this.handleReconnect),e.removeEventListener(I.CoreClient.EVENT_RECONNECT_AUTH_FAILED,this.handleReconnectAuthFailed)}hydrateDefault(e,t){const{connection:n}=this.props,{metadata:s}=e;if(s?.type!=null&&(s?.id!=null||s?.name!=null)){const i=s.id!=null?{type:s.type,id:s.id}:{type:s.type,name:s.name,title:s.name};return{fetch:()=>n.getObject(i),localDashboardId:t,...e}}return Ya.hydrate(e,t)}hydrateGrid(e,t){return this.hydrateTable(e,t,e.metadata.type??I.VariableType.TABLE)}hydratePandas(e,t){return this.hydrateTable(e,t,I.VariableType.PANDAS)}hydrateTable(e,t,n=I.VariableType.TABLE){const{connection:s}=this.props;return{...e,getDownloadWorker:ro.getServiceWorker,loadPlugin:this.handleLoadTablePlugin,localDashboardId:t,makeModel:()=>Dx(s,e.metadata,n)}}hydrateChart(e,t){const{connection:n}=this.props;return{...e,localDashboardId:t,makeModel:()=>{const{metadata:s,panelState:i}=e;return Ix(n,s,i)}}}openWidget(e,t){const{connection:n}=this.props;this.emitLayoutEvent(we.OPEN,{dragEvent:t,fetch:()=>n.getObject(e),widget:e})}getDashboardPlugins=he(e=>[...e.entries()].filter(([,t])=>t.DashboardPlugin!=null).map(([t,{DashboardPlugin:n}])=>r.jsx(n,{},t)));render(){const{activeTool:e,plugins:t,user:n,workspace:s,serverConfigValues:i}=this.props,{data:o}=s,{layoutConfig:l}=o,{permissions:a}=n,{canUsePanels:d}=a,{contextActions:h,isAuthFailed:u,isDisconnected:m,isPanelsMenuShown:g,isSettingsMenuShown:p,widgets:C}=this.state,f=this.getDashboardPlugins(t);return r.jsxs("div",{className:K("app-main-tabs","w-100","h-100","d-flex","flex-column",e?`active-tool-${e.toLowerCase()}`:""),onPaste:this.handlePaste,tabIndex:-1,children:[r.jsx("nav",{className:"nav-container",children:r.jsxs("div",{className:"app-main-top-nav-menus",children:[r.jsx("img",{src:Uu,alt:"Deephaven Data Labs",width:"115px",className:"ml-1"}),r.jsxs("div",{children:[r.jsxs(_,{kind:"ghost",className:"btn-panels-menu",icon:Jg,onClick:()=>{},children:["Controls",r.jsx(sd,{handleControlSelect:this.handleControlSelect,handleToolSelect:this.handleToolSelect,onClearFilter:this.handleClearFilter})]}),d&&r.jsxs(_,{kind:"ghost",className:"btn-panels-menu btn-show-panels","data-testid":"app-main-panels-button",onClick:this.handleWidgetMenuClick,icon:ep,children:["Panels",r.jsx(Ul,{isShown:g,className:"panels-menu-popper",onExited:this.handleWidgetsMenuClose,closeOnBlur:!0,interactive:!0,children:r.jsx(xx,{widgets:C,onExportLayout:this.handleExportLayoutClick,onImportLayout:this.handleImportLayoutClick,onResetLayout:this.handleResetLayoutClick,onSelect:this.handleWidgetSelect})})]}),r.jsx(_,{kind:"ghost",className:K("btn-settings-menu",{"text-warning":n.operateAs!=null&&n.operateAs!==n.name}),onClick:this.handleSettingsMenuShow,icon:r.jsx(X,{icon:uo,transform:"grow-3 right-1 down-1"}),tooltip:"User Settings"})]})]})}),r.jsxs(gb,{emptyDashboard:r.jsx(Fx,{onAutoFillClick:this.handleAutoFillClick}),id:un,layoutConfig:l,onGoldenLayoutChange:this.handleGoldenLayoutChange,onLayoutConfigChange:this.handleLayoutConfigChange,onLayoutInitialized:this.openNotebookFromURL,hydrate:this.hydrateDefault,children:[r.jsx(xR,{hydrate:this.hydrateGrid,getDownloadWorker:ro.getServiceWorker,loadPlugin:this.handleLoadTablePlugin}),r.jsx(wR,{hydrate:this.hydrateChart}),r.jsx(vR,{}),r.jsx(ER,{hydrateConsole:Si.hydrateConsole,notebooksUrl:md("/notebooks/").href}),r.jsx(yR,{}),r.jsx(jR,{hydrate:this.hydratePandas}),r.jsx(PR,{}),r.jsx(_R,{}),f]}),r.jsx($t,{in:p,timeout:Xe.transitionMidMs,classNames:"slide-left",mountOnEnter:!0,unmountOnExit:!0,children:r.jsx(yn,{serverConfigValues:i,onDone:this.handleSettingsMenuHide,user:n})}),r.jsx(se,{actions:h}),r.jsx("input",{ref:this.importElement,type:"file",accept:".json",style:{display:"none"},onChange:this.handleImportLayoutFiles}),r.jsx(jm,{isOpen:m&&!u,icon:tp,title:r.jsxs(r.Fragment,{children:[r.jsx(Fn,{})," Attempting to reconnect..."]}),subtitle:"Please check your network connection."}),r.jsx(io,{confirmButtonText:"Refresh",onConfirm:Si.handleRefresh,isOpen:u,headerText:"Authentication failed",bodyText:"Credentials are invalid. Please refresh your browser to try and reconnect."})]})}}const _x=c=>({activeTool:Yl(c),dashboardData:Pt(c,un),layoutStorage:yx(c),plugins:cC(c),connection:sy(c,un),session:Zs(c,un)?.session,sessionConfig:Zs(c,un)?.config,user:Ch(c),workspace:Kl(c),serverConfigValues:Rx(c)}),Px=mt(_x,{setActiveTool:Xl,updateDashboardData:Nn,updateWorkspaceData:_h})(vm(Si));function jx(){return r.jsxs("div",{className:"app",children:[r.jsx(Px,{}),r.jsx(Kc,{})]})}const Hx=ee.module("LocalWorkspaceStorage");class bi{static STORAGE_KEY="deephaven.WorkspaceStorage";static async makeDefaultWorkspaceData(e,t){const{filterSets:n,links:s,layoutConfig:i}=await ol.getDefaultLayout(e,t?.isConsoleAvailable);return{settings:{defaultDateTimeFormat:ot.DEFAULT_DATETIME_FORMAT_STRING,formatter:[],timeZone:ot.DEFAULT_TIME_ZONE_ID,showTimeZone:!1,showTSeparator:!0,disableMoveConfirmation:!1,defaultDecimalFormatOptions:{defaultFormatString:We.DEFAULT_FORMAT_STRING},defaultIntegerFormatOptions:{defaultFormatString:it.DEFAULT_FORMAT_STRING},truncateNumbersWithPound:!1,defaultNotebookSettings:{isMinimapEnabled:!1}},layoutConfig:i,closed:[{}],links:s,filterSets:n}}static async makeDefaultWorkspace(e,t){return{data:await bi.makeDefaultWorkspaceData(e,t)}}layoutStorage;constructor(e){this.layoutStorage=e}async load(e){try{return JSON.parse(localStorage.getItem(bi.STORAGE_KEY)??"")}catch{return Hx.info("Unable to load workspace data, initializing to default data"),bi.makeDefaultWorkspace(this.layoutStorage,e)}}async save(e){return localStorage.setItem(bi.STORAGE_KEY,JSON.stringify(e)),e}}class Ux{storageService;root;constructor(e,t=""){this.storageService=e,this.root=t}async getLayouts(){return(await this.storageService.listItems(this.root,"*.json")).map(t=>t.basename)}async getLayout(e){const n=await(await this.storageService.loadFile(`${this.root}/${e}`)).text();return JSON.parse(n)}}const zi=ee.module("GrpcFileStorageTable");class Al{static REFRESH_DEBOUNCE=50;storageService;baseRoot;root;currentSize=0;currentViewport;listeners=[];viewportUpdatePromise;currentViewportData;childTables=new Map;constructor(e,t="",n=t){this.storageService=e,this.baseRoot=t,this.root=n,n===t&&(this.doRefresh=Ge(this.doRefresh.bind(this),Al.REFRESH_DEBOUNCE))}removeBaseRoot(e){return me.removeRoot(this.baseRoot,e)}getViewportData(){return this.viewportUpdatePromise||this.refreshInternal(),this.viewportUpdatePromise??Promise.resolve({items:[],offset:0})}getSnapshot(e){throw new Error("Method not implemented.")}get size(){return this.currentSize}setExpanded(e,t){const n=e.split("/");let s=n.shift();if((s===void 0||s==="")&&(s=n.shift()),s===void 0||s==="")throw new Error(`Invalid path: ${e}`);const i=n.join("/");if(t){if(!this.childTables.has(s)){const o=new Al(this.storageService,this.baseRoot,`${this.root}/${s}`);this.childTables.set(s,o)}i&&this.childTables.get(s)?.setExpanded(i,t)}else this.childTables.has(s)&&(i?this.childTables.get(s)?.setExpanded(i,t):this.childTables.delete(s));this.currentViewport&&this.refreshInternal()}collapseAll(){this.childTables.clear(),this.currentViewport&&this.refreshInternal()}setSearch(e){throw new Error("Method not implemented.")}setViewport(e){this.currentViewport=e,this.refreshInternal()}setFilters(){throw new Error("Method not implemented.")}setSorts(){throw new Error("Method not implemented.")}setReversed(){throw new Error("Method not implemented.")}close(){this.listeners=[]}onUpdate(e){return this.listeners=[...this.listeners,e],()=>{this.listeners=this.listeners.filter(t=>t!==e)}}doRefresh(e){zi.debug2("doRefresh",this.root),e(this.fetchData())}refresh(){zi.debug2("refresh",this.root),this.viewportUpdatePromise?.cancel();const e=new Promise(n=>{this.doRefresh(n)}),t=ve.makeCancelable(e.then(n=>{if(this.viewportUpdatePromise!==t)throw new Pl;return this.currentViewportData=n,this.sendUpdate(),n}));t.catch(n=>{ve.isCanceled(n)||zi.error("Error updating viewport",n)}),this.viewportUpdatePromise=t}refreshInternal(){try{this.refresh()}catch(e){ve.isCanceled(e)||zi.error("Unable to refresh data",e)}}async fetchData(){const{currentViewport:e}=this;if(!e)throw new Error("No viewport set");let n=(await this.storageService.listItems(this.root)).map(s=>({type:s.type,filename:this.removeBaseRoot(s.filename),basename:s.basename,id:this.removeBaseRoot(s.filename),isExpanded:s.type==="directory"?this.childTables.has(s.basename):void 0})).sort((s,i)=>s.type!==i.type?s.type==="directory"?-1:1:s.basename.localeCompare(i.basename));for(let s=0;s<n.length;s+=1){const i=n[s],{basename:o,filename:l}=i;if(l===this.removeBaseRoot(`${this.root}/${o}`)&&i.type==="directory"){const a=this.childTables.get(o);if(a!=null){a.setViewport({top:0,bottom:e.bottom-s});const d=await a.getViewportData();n.splice(s+1,0,...d.items)}}}return this.currentSize=n.length,zi.debug2(this.root,"items",n,e),n=n.slice(e.top,e.bottom),{items:n,offset:e.top}}sendUpdate(){const{listeners:e}=this,t=this.currentViewportData??{items:[],offset:0};for(let n=0;n<e.length;n+=1)e[n](t)}}const Vx=ee.module("GrpcFileStorage");class id{static REFRESH_THROTTLE=150;storageService;tables=[];root;constructor(e,t=""){this.storageService=e,this.root=t}removeRoot(e){return me.removeRoot(this.root,e)}addRoot(e){return me.addRoot(this.root,e)}async createDirectory(e){return await this.storageService.createDirectory(this.addRoot(e)),this.refreshTables(),{type:"directory",id:e,filename:e,basename:me.getBaseName(e)}}async getTable(){const e=new Al(this.storageService,this.root);return this.tables.push(e),e}async saveFile(e){const t=dh.storage.FileContents.text(e.content);return await this.storageService.saveFile(this.addRoot(e.filename),t,!0),this.refreshTables(),e}async loadFile(e){const n=await(await this.storageService.loadFile(this.addRoot(e))).text();return{filename:e,basename:me.getBaseName(e),content:n}}async deleteFile(e){await this.storageService.deleteItem(this.addRoot(e)),this.refreshTables()}async moveFile(e,t){await this.storageService.moveItem(this.addRoot(e),this.addRoot(t)),this.refreshTables()}async info(e){const t=await this.storageService.listItems(this.addRoot(me.getPath(e)),me.getBaseName(e));if(t.length===0)throw new Zr;if(t.length>1)throw Vx.error("More than one matching file found, should never happen.",t),new Error("More than one matching file found");const n=t[0];return{filename:this.removeRoot(n.filename),basename:n.basename,id:this.removeRoot(n.filename),type:n.type}}refreshTables=Ts(()=>{this.tables.forEach(e=>e.refresh())},id.REFRESH_THROTTLE)}const Bx=ee.module("AppInit");function od(c){const{workspace:e,setActiveTool:t,setCommandHistoryStorage:n,setDashboardData:s,setFileStorage:i,setLayoutStorage:o,setDashboardConnection:l,setDashboardSessionWrapper:a,setPlugins:d,setUser:h,setWorkspace:u,setWorkspaceStorage:m,setServerConfigValues:g}=c,p=Hm(),C=Um(),f=Vm(),S=w.useContext(Bm),v=w.useContext($m),[b,T]=w.useState();w.useEffect(function(){d(f)},[f,d]),w.useEffect(function(){async function D(){try{const O=await Wm(),M=await Gm(C,O),j=p.getStorageService(),L=new Ux(j,"/layouts"),W=new id(j,"/notebooks"),H=new bi(L),U=new QR,[P,Q]=await Promise.all([p.getServerConfigValues(),H.load({isConsoleAvailable:M!==void 0})]),{data:G}=Q,{settings:ne}=G;ne.defaultDecimalFormatOptions===void 0&&(ne.defaultDecimalFormatOptions={defaultFormatString:We.DEFAULT_FORMAT_STRING}),ne.defaultIntegerFormatOptions===void 0&&(ne.defaultIntegerFormatOptions={defaultFormatString:it.DEFAULT_FORMAT_STRING}),ne.truncateNumbersWithPound===void 0&&(ne.truncateNumbersWithPound=!1);const{shortcutOverrides:V={}}=ne,Z=sn.isMacPlatform?V.mac??{}:V.windows??{};Object.entries(Z).forEach(([fe,Re])=>{Ve.get(fe)?.setKeyState(Re)});const oe={filterSets:G.filterSets,links:G.links},re=new Map(P),q="Anonymous",ie={name:q,operateAs:q,groups:[],...S,permissions:{isACLEditor:!1,isSuperUser:!1,isQueryViewOnly:!1,isNonInteractive:!1,canUsePanels:!0,canCreateDashboard:!0,canCreateCodeStudio:!0,canCreateQueryMonitor:!0,canCopy:re.get("internal.webClient.appInit.canCopy")!=="false",canDownloadCsv:re.get("internal.webClient.appInit.canDownloadCsv")!=="false",canLogout:!0,...v}};t(_t.DEFAULT),g(re),n(U),s(un,oe),i(W),o(L),l(un,C),M!==void 0&&a(un,M),h(ie),m(H),u(Q)}catch(O){Bx.error(O),T(O)}}D()},[p,C,t,n,s,i,o,l,a,h,u,m,g,S,v]);const y=e==null&&b==null,E=!y&&b==null,R=b!=null?`${b}`:null;return r.jsxs(r.Fragment,{children:[E&&r.jsx(jx,{}),r.jsx(Vl,{isLoading:y&&R==null,isLoaded:E,errorMessage:R})]})}od.propTypes={workspace:B.shape({}),workspaceStorage:B.shape({close:B.func}),setActiveTool:B.func.isRequired,setCommandHistoryStorage:B.func.isRequired,setDashboardData:B.func.isRequired,setFileStorage:B.func.isRequired,setLayoutStorage:B.func.isRequired,setDashboardConnection:B.func.isRequired,setDashboardSessionWrapper:B.func.isRequired,setPlugins:B.func.isRequired,setUser:B.func.isRequired,setWorkspace:B.func.isRequired,setWorkspaceStorage:B.func.isRequired};od.defaultProps={workspace:null,workspaceStorage:null};const $x=c=>({workspace:Kl(c),workspaceStorage:aC(c)}),_c=mt($x,{setActiveTool:Xl,setCommandHistoryStorage:mC,setDashboardData:lu,setFileStorage:gC,setLayoutStorage:JR,setDashboardConnection:iy,setDashboardSessionWrapper:oy,setPlugins:fC,setUser:hC,setWorkspace:Lh,setWorkspaceStorage:uC,setServerConfigValues:CC})(od);function Wx(){return r.jsx(Tm,{basename:"/ide/",children:r.jsxs(Em,{children:[r.jsx(dd,{exact:!0,path:"/",component:_c}),r.jsx(dd,{path:"/notebook/:notebookPath+",component:_c}),r.jsx(ym,{from:"*",to:"/"})]})})}function Qx(){return ro.registerOnLoaded(),Lt.init({getWorker:()=>new Km}),window["__react-beautiful-dnd-disable-dev-warnings"]=!0,r.jsx(jc,{store:Tr,children:r.jsx(Wx,{})})}export{Qx as AppRoot,Qx as default};
42
- //# sourceMappingURL=AppRoot-684237ad.js.map
42
+ //# sourceMappingURL=AppRoot-96464079.js.map