@deephaven/code-studio 0.30.1-beta.1 → 0.30.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/assets/{AppRoot.fbf673a6.js → AppRoot.7498c843.js} +5 -5
- package/build/assets/AppRoot.7498c843.js.map +1 -0
- package/build/assets/{index.fc8a0a17.js → index.f6d0d37c.js} +2 -2
- package/build/assets/{index.fc8a0a17.js.map → index.f6d0d37c.js.map} +1 -1
- package/build/index.html +2 -2
- package/package.json +28 -28
- package/build/assets/AppRoot.fbf673a6.js.map +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{A as b,F as T,E as Y,C as h,R as de,T as Sp,K as Z,D as Ht,L as be,M as $e,B as M,U as bp,V as ge,W as ra,X as Ln,J as Je,I as Ie,Y as mh,Z as ct,_ as xa,$ as wp,a0 as Tp,a1 as vp,a2 as Ep,a3 as pe,G as Nr,a4 as Hd,a5 as Oa,a6 as yp,a7 as Rp,a8 as ph,a9 as Ze,aa as la,H as Ip,ab as jr,Q as gh,S as Aa,ac as Ud,ad as Fp,ae as xn,af as Dp,ag as Np,ah as _p,ai as Mp,aj as aa,ak as kp,al as xp,am as Op,an as Vd,ao as Ap,ap as Lp,aq as Bd,ar as Pp,as as Hp,at as Up,au as Vp,av as Bp,aw as vt,ax as fh,ay as $p,az as Ch,aA as Gp,aB as Sh,aC as Wp,aD as zp,aE as qp,aF as Yp,aG as Kp,aH as Xp,aI as jp,aJ as Qp,aK as $d,aL as Zp}from"./vendor.bc49f178.js";import{P as ye,C as Pn,a as Jp,u as eg,B as U,v as tg,b as ng,c as sg,d as ig,e as Ui,T as Xe,f as da,g as og,h as bh,i as La,L as as,j as Qr,k as ts,l as wh,m as J,r as qe,M as Te,K as Fe,n as Gd,o as rg,p as lg,q as ag,G as ls,s as le,t as dg,w as sn,x as Os,D as Vi,y as mn,z as ns,A as Th,S as Bi,E as Zr,F as ut,H as ss,I as Jr,J as Mi,N as cg,O as hg,Q as Wd,R as _r,U as zd,V as vh,W as No,X as ki,Y as ug,Z as _o,_ as mg,$ as Eh,a0 as pg,a1 as gg,a2 as He,a3 as Pa,a4 as Jn,a5 as Ha,a6 as Mr,a7 as Wn,a8 as fg,a9 as Cg,aa as Sg,ab as bg,ac as wg,ad as Ua,ae as Tg,af as As,ag as qd,ah as Cn,ai as Mo,aj as is,ak as Va,al as Ba,am as yh,an as vg,ao as el,ap as Eg,aq as kr,ar as yg,as as $a,at as Rh,au as ei,av as Rg,aw as Ig,ax as Fg,ay as Dg,az as Ng,aA as _g,aB as tl,aC as Yd,aD as Vl,aE as Mg,aF as kg,aG as xg,aH as Ih,aI as nl,aJ as sl,aK as Og,aL as Ag,aM as il,aN as Fh,aO as Lg,aP as Pg,aQ as Hg,aR as Ug,aS as Dh,aT as Vg,aU as Bg,aV as $g,aW as Gg,aX as Wg,aY as zg,aZ as qg,a_ as Ke,a$ as Kd,b0 as Nh,b1 as Yg,b2 as Kg,b3 as Xg,b4 as jg,b5 as Xd,b6 as xr,b7 as Qg,b8 as _h,b9 as Zg,ba as Jg,bb as Mh,bc as ef,bd as ca,be as ha,bf as tf,bg as nf,bh as sf,bi as of,bj as fn,bk as rf,bl as lf,bm as af,bn as df,bo as cf,bp as hf,bq as uf,br as mf,bs as jd,bt as pf,bu as gf}from"./index.fc8a0a17.js";import{e as os,l as Ti,K as cn,a as Qd,b as Ds,_ as ff,W as Cf}from"./monaco.1292e04e.js";import{P as Or,b as Sf,h as bf,p as wf,o as Tf,s as vf,t as Ef,c as Bl}from"./plotly.23481c2c.js";import"./helpers.162e09a8.js";function Ga({className:t,isFlipped:e,children:n,"data-testid":s}){const i=a=>{if(n.length!==2)throw new Error("CardFlip requires 2 children to function");return n[a]},o=b.exports.useRef(null),r=b.exports.useCallback(a=>{a.target===a.currentTarget&&document.body.classList.add("card-flip--is-flipping")},[]),l=b.exports.useCallback(a=>{a.target===a.currentTarget&&document.body.classList.remove("card-flip--is-flipping")},[]);return b.exports.useEffect(function(){if(!o.current)throw Error("ref undefined");o.current.addEventListener("transitionstart",r);const d=o.current;return function(){if(d!=null)return d.removeEventListener("transitionstart",r)}},[r]),T("div",{className:Y(t,{"card-flip--show-front":e,"card-flip--show-back":!e}),"data-testid":s,children:[h("div",{className:"card-flip--back",children:i(0)}),h("div",{ref:o,className:"card-flip--front",onTransitionEnd:l,children:i(1)})]})}class ol{static isDark(e){const n=document.createElement("div");n.style.display="none",n.style.color=e;const s=getComputedStyle(document.body.appendChild(n)).color,i=s.match(/\d+/g);let o=[];if(i)o=i.map(l=>parseInt(l,10));else throw new Error(`Invalid color received. Got ${s}`);return document.body.removeChild(n),ol.getBrightness(o)<125}static getBrightness(e){return Math.round((e[0]*299+e[1]*587+e[2]*114)/1e3)}}function yf(t,e){return t?t.closest(`.${e}`):null}const Rf={getClosestByClassName:yf};class ds{constructor(){this.pending=[],this.resolved=[]}add(e,n){const s=ye.makeCancelable(e,n);return this.pending.push(s),s.then(()=>{this.resolve(s)},()=>{this.resolve(s)}),s}remove(e){for(let n=0;n<this.pending.length;n+=1)if(this.pending[n]===e){this.pending.splice(n,1);return}}resolve(e){this.remove(e),this.resolved.push(e)}cancel(){const e=[...this.pending,...this.resolved];for(let n=0;n<e.length;n+=1)e[n].cancel();this.pending=[],this.resolved=[]}}function k(t){if(t==null)throw new Error("Value is null or undefined")}class jt{static join(e,n="and"){if(e==null||e.length===0)return"";if(e.length===1)return e[0];if(e.length===2)return`${e[0]} ${n} ${e[1]}`;const s=e.slice(0,e.length-1).join(", "),i=e[e.length-1];return`${s}, ${n} ${i}`}static toLower(e,n=!0){if(e==null){if(n)return"";throw new Error("Null string passed in to TextUtils.toLower")}return e.toLowerCase()}static sort(e,n,s=!0){return e<n?s?-1:1:e>n?s?1:-1:0}}class Di extends Error{constructor(){super(...arguments),this.isInvalid=!0}}class kh extends b.exports.Component{constructor(e){super(e),this.handleMenuClose=this.handleMenuClose.bind(this),this.handleContextMenu=this.handleContextMenu.bind(this),this.container=de.createRef(),this.openMenu=de.createRef(),this.state={actions:null,left:0,top:0}}componentDidMount(){this.container.current?.parentElement&&this.container.current.parentElement.addEventListener("contextmenu",this.handleContextMenu)}componentWillUnmount(){this.container.current?.parentElement&&this.container.current.parentElement.removeEventListener("contextmenu",this.handleContextMenu)}handleContextMenu(e){if(!Pn.isContextActionEvent(e)||!this.container.current||e.metaKey||e.ctrlKey)return;const n=Pn.getMenuItems(e.contextActions),s=this.container.current.getBoundingClientRect(),i=e.clientY-s.top,o=e.clientX-s.left;if(n.length===0){if(e.target===this.container.current){e.preventDefault(),this.setState({actions:null},()=>{const r=document.elementFromPoint(o,i),l=new MouseEvent("contextmenu",{clientX:e.clientX,clientY:e.clientY,bubbles:!0,cancelable:!0});r?.dispatchEvent(l)});return}return}e.preventDefault(),this.setState({actions:n,top:i,left:o})}handleMenuClose(e){e===this.openMenu.current&&this.setState({actions:null})}render(){let e=null;const{"data-testid":n}=this.props,{actions:s,top:i,left:o}=this.state;return s&&(e=h(Jp,{ref:this.openMenu,actions:s,onMenuClosed:this.handleMenuClose,top:i,left:o,updatePosition:(r,l)=>{this.setState({top:r,left:l})},"data-testid":n})),h("div",{className:Y("context-menu-root",{active:s}),ref:this.container,children:e})}}function rl(t){const e=b.exports.useRef();return b.exports.useEffect(function(){e.current=t}),e.current}function ll({copy:t,kind:e="ghost",tooltip:n="Copy",className:s,"data-testid":i,children:o}){const[r,l]=eg();return h(U,{kind:e,className:s,"data-testid":i,icon:r?tg:ng,tooltip:r?"Copied":n,onClick:()=>{l(typeof t=="function"?t():t)},children:o})}class qt{static reorder(e,n,s,i){const o=e===s?qt.adjustDestinationIndex(i,n):i,r=qt.removeItems(e,n);return s.splice(o,0,...r),r}static removeItems(e,n){const s=[],i=n.map((o,r)=>({range:o,index:r})).sort((o,r)=>r.range[0]-o.range[0]);for(let o=0;o<i.length;o+=1){const{range:r,index:l}=i[o],[a,d]=r;s[l]=e.splice(a,d-a+1)}return Sp(s)}static adjustDestinationIndex(e,n){let s=e;for(let i=0;i<n.length;i+=1){const[o,r]=n[i];if(o>e)break;s-=Math.min(r,e-1)-o+1}return s}static startDragging(){document.documentElement.classList.add("drag-pointer-events-none")}static stopDragging(){document.documentElement.classList.remove("drag-pointer-events-none")}}function xh({on:t,id:e,className:n,isInvalid:s,disabled:i=!1,onClick:o,"data-testid":r}){return h("button",{type:"button",className:Y("btn","btn-switch",n,{active:t},{"is-invalid":s}),id:e,onClick:o,disabled:i,"data-testid":r,children:h("div",{className:"handle"})})}function Zd(t){return t.isOn!==void 0}function If({item:t,onSelect:e=()=>{},"data-testid":n}){const{icon:s,subtitle:i,title:o}=t,r=b.exports.useMemo(()=>Zd(t)?()=>{t.onChange(!t.isOn)}:e,[t,e]);return T("div",{className:"btn btn-navigation-menu-item","data-testid":`menu-item-${o}`,onClick:r,onKeyDown:l=>{(l.key==="Enter"||l.key===" ")&&r()},tabIndex:0,role:"menuitem",children:[s!==void 0&&h("div",{className:"icon",children:h(Z,{icon:s})}),h("div",{className:"title",children:o}),i!==void 0&&h("div",{className:"shortcut",children:i}),h("div",{className:"accessory","data-testid":n,children:Zd(t)?h(xh,{on:t.isOn,onClick:l=>{l.stopPropagation(),r()}}):h(Z,{icon:sg})})]})}function Oh({items:t,onSelect:e=()=>{},"data-testid":n}){return h("div",{className:"navigation-menu-view","data-testid":n,children:h("ul",{className:"navigation-menu-list",children:t.map((s,i)=>h("li",{children:h(If,{item:s,onSelect:()=>{e(i)}})},s.title))})})}function Jd({children:t,onBack:e,onClose:n,title:s,"data-testid":i}){return T("div",{className:"navigation-page","data-testid":i,children:[T("div",{className:"navigation-title-bar",children:[h("div",{className:"navigation-left-buttons",children:e!==void 0&&h(U,{kind:"ghost",className:"btn-back","data-testid":"btn-page-back",onClick:e,icon:ig,children:"Back"})}),h("div",{className:"navigation-title",children:s}),h("div",{className:"navigation-right-buttons",children:n!==void 0&&h(U,{kind:"ghost",className:"btn-close px-2 m-1","data-testid":"btn-page-close",onClick:n,icon:Ui,tooltip:"Close"})})]}),h("div",{className:"navigation-content",children:t})]})}function Ff({children:t,"data-testid":e}){const n=b.exports.useMemo(()=>de.Children.toArray(t),[t]),s=rl(n),[i,o]=b.exports.useState(n[n.length-1]),[r,l]=b.exports.useState(null),[a,d]=b.exports.useState(null);b.exports.useEffect(function(){if(s===void 0||n===s)return;const p=n[n.length-1];n.length===s.length||s.length===0||r!==null||a!==null?r!==null&&p!==r?l(p):p!==a&&p!==i&&o(p):n.length>s.length?l(p):n.length<s.length&&(o(p),d(s[s.length-1]))},[n,s,r,a,i]);const c=b.exports.useCallback(()=>{o(r),l(null)},[r]),u=b.exports.useCallback(()=>{d(null)},[]);return T("div",{className:"navigation-stack",children:[h("div",{className:"main-view","data-testid":e,children:i}),h(Ht,{in:a!=null,timeout:Xe.transitionMidMs,classNames:"slide-right",onEntered:u,children:h(be,{children:a!=null&&h("div",{className:"popping-view",children:a})})}),h(Ht,{in:r!=null,timeout:Xe.transitionMidMs,classNames:"slide-left",onEntered:c,children:h(be,{children:r!=null&&h("div",{className:"pushing-view",children:r})})})]})}function Df({children:t,disabled:e,value:n,"data-testid":s}){return h("option",{value:n,disabled:e,"data-testid":s,children:t})}function al(t){const{children:e,disabled:n=!1,name:s,onChange:i,value:o="","data-testid":r}=t,[l]=b.exports.useState(s??$e());return h(be,{children:de.Children.map(e,a=>a?de.cloneElement(a,{name:l,onChange:a.props.onChange??i,checked:o===a.props.value,disabled:a.props.disabled??n,"data-testid":r}):null)})}function Nf({children:t,onBlur:e,onChange:n,className:s,defaultValue:i,name:o,value:r,disabled:l,"data-testid":a}){const d=b.exports.useCallback(c=>{n(c.target.value)},[n]);return h("select",{className:Y("custom-select",s),onBlur:e,onChange:d,defaultValue:i,value:r,name:o,disabled:l,"data-testid":a,children:t})}const{dh:I}=globalThis,dl=M.exports.shape({name:M.exports.string.isRequired,type:M.exports.string.isRequired,description:M.exports.string,constituentType:M.exports.string}),Ah=M.exports.shape({not:M.exports.func.isRequired,and:M.exports.func.isRequired,or:M.exports.func.isRequired}),_f=M.exports.shape({asc:M.exports.func.isRequired,desc:M.exports.func.isRequired,abs:M.exports.func.isRequired,column:dl.isRequired,direction:M.exports.string.isRequired,isAbs:M.exports.bool.isRequired}),Mf=M.exports.shape({columns:M.exports.arrayOf(dl).isRequired,customColumns:M.exports.arrayOf(M.exports.string).isRequired,filter:M.exports.arrayOf(Ah),addEventListener:M.exports.func.isRequired,removeEventListener:M.exports.func.isRequired,size:M.exports.number.isRequired,sort:M.exports.arrayOf(M.exports.any),copy:M.exports.func.isRequired,applyFilter:M.exports.func.isRequired,applySort:M.exports.func.isRequired,applyCustomColumns:M.exports.func.isRequired,description:M.exports.string}),kf=M.exports.shape({columns:M.exports.arrayOf(dl),filter:M.exports.arrayOf(M.exports.any),isExpanded:M.exports.func.isRequired,saveExpandedState:M.exports.func.isRequired,addEventListener:M.exports.func.isRequired,removeEventListener:M.exports.func.isRequired,size:M.exports.number.isRequired,sort:M.exports.arrayOf(M.exports.any),applyFilter:M.exports.func.isRequired,applySort:M.exports.func.isRequired}),Tr=M.exports.shape({name:M.exports.string.isRequired,type:M.exports.string.isRequired}),xf=M.exports.shape({created:M.exports.arrayOf(Tr).isRequired,updated:M.exports.arrayOf(Tr).isRequired,removed:M.exports.arrayOf(Tr).isRequired}),Of=M.exports.shape({groupingColumns:M.exports.arrayOf(M.exports.string),aggregations:M.exports.shape({}),includeConstituents:M.exports.bool,includeOriginalColumns:M.exports.bool,includeDescriptions:M.exports.bool}),Af=M.exports.shape({addEventListener:M.exports.func.isRequired,removeEventListener:M.exports.func.isRequired,onLogMessage:M.exports.func,getTable:M.exports.func.isRequired,runCode:M.exports.func.isRequired});Object.freeze({Column:dl,FilterCondition:Ah,IdeSession:Af,RollupConfig:Of,Sort:_f,Table:Mf,TreeTable:kf,VariableChanges:xf,VariableDefinition:Tr});dh;function Lh({type:t}){switch(t){case I.VariableType.TABLE:case I.VariableType.TABLEMAP:case I.VariableType.TREETABLE:case I.VariableType.HIERARCHICALTABLE:return h(Z,{icon:La});case I.VariableType.FIGURE:return h(Z,{icon:bh});case I.VariableType.PANDAS:return h(Z,{icon:og});default:return h(Z,{icon:da})}}class cl extends b.exports.Component{constructor(e){super(e),this.container=null}componentDidMount(){this.colorize()}colorize(){const{children:e}=this.props;this.container&&e!=null&&os.colorizeElement(this.container,{theme:"dh-dark"})}render(){const{children:e,language:n}=this.props;return h("div",{children:h("div",{"data-lang":n,ref:s=>{this.container=s},style:{pointerEvents:"none"},children:e})})}}class Ph{static get LANGUAGE_MAP(){return new Map([["python","Python"],["groovy","Groovy"],["scala","Scala"]])}}class xi{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)?[]:bp.parse(e).filter(n=>!this.hasComment(n)).map(n=>this.hasPattern(n)?n.pattern:this.hasOp(n)?n.op:`${n}`)}static formatTimestamp(e){if(e==null||!(e instanceof Date))return null;const n=`${e.getHours()}`.padStart(2,"0"),s=`${e.getMinutes()}`.padStart(2,"0"),i=`${e.getSeconds()}`.padStart(2,"0"),o=`${e.getMilliseconds()}`.padStart(3,"0");return`${n}:${s}:${i}.${o}`}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 xi.isTableType(e)||xi.isWidgetType(e)}static isFigureType(e){return e===I.VariableType.FIGURE}static isPandas(e){return e===I.VariableType.PANDAS}}function Hh({children:t}){return T("div",{className:"console-history-item-result",children:[h("div",{className:"console-history-gutter",children:"-"}),h("div",{className:"console-history-content",children:t})]})}Hh.propTypes={children:M.exports.node.isRequired};class Uh extends b.exports.Component{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}updateElapsed(){this.setState({elapsed:Math.round((Date.now()-this.startTime)/1e3)})}render(){const{disabled:e,onCancelClick:n}=this.props,{elapsed:s}=this.state;return h("div",{className:Y("console-history-result-in-progress",{disabled:e}),children:T("span",{className:"badge",children:[h(as,{}),"\xA0Running... ",Qr.formatElapsedTime(s),"\xA0",h(U,{className:"console-history-result-in-progress-cancel",kind:"ghost",icon:Ui,tooltip:"Cancel",onClick:n,disabled:e})]})})}}Uh.defaultProps={disabled:!1};const ua=class extends b.exports.PureComponent{constructor(t){super(t),this.handleKeyPress=this.handleKeyPress.bind(this),this.handleMouseDown=this.handleMouseDown.bind(this),this.handleMouseMove=this.handleMouseMove.bind(this),this.handleMouseUp=this.handleMouseUp.bind(this),this.handleToggleError=this.handleToggleError.bind(this),this.handleMouseEnter=this.handleMouseEnter.bind(this),this.handleMouseLeave=this.handleMouseLeave.bind(this),this.mouseX=null,this.mouseY=null,this.isClicking=!1,this.state={isExpanded:!1,isTriggerHovered:!1}}handleKeyPress(t){switch(t.key){case"Enter":case" ":this.handleToggleError(),t.stopPropagation(),t.preventDefault();break}}handleMouseDown(t){this.mouseX=t.clientX,this.mouseY=t.clientY,this.isClicking=!0}handleMouseMove(t){this.mouseX!=null&&this.mouseY!=null?(Math.abs(t.clientX-this.mouseX)>=ua.mouseDragThreshold||Math.abs(t.clientY-this.mouseY)>=ua.mouseDragThreshold)&&(this.isClicking=!1):this.isClicking&&(this.isClicking=!1)}handleMouseUp(t){this.isClicking&&!t.shiftKey&&!t.metaKey&&!t.altKey&&this.handleToggleError(),this.mouseX=null,this.mouseY=null,this.isClicking=!1}handleToggleError(){this.setState(t=>({isExpanded:!t.isExpanded}))}handleMouseEnter(){this.setState({isTriggerHovered:!0})}handleMouseLeave(){this.setState({isTriggerHovered:!1})}render(){const{isExpanded:t,isTriggerHovered:e}=this.state,{message:n}=this.props;k(n);const s=n.indexOf(`
|
|
1
|
+
import{A as b,F as T,E as Y,C as h,R as de,T as Sp,K as Z,D as Ht,L as be,M as $e,B as M,U as bp,V as ge,W as ra,X as Ln,J as Je,I as Ie,Y as mh,Z as ct,_ as xa,$ as wp,a0 as Tp,a1 as vp,a2 as Ep,a3 as pe,G as Nr,a4 as Hd,a5 as Oa,a6 as yp,a7 as Rp,a8 as ph,a9 as Ze,aa as la,H as Ip,ab as jr,Q as gh,S as Aa,ac as Ud,ad as Fp,ae as xn,af as Dp,ag as Np,ah as _p,ai as Mp,aj as aa,ak as kp,al as xp,am as Op,an as Vd,ao as Ap,ap as Lp,aq as Bd,ar as Pp,as as Hp,at as Up,au as Vp,av as Bp,aw as vt,ax as fh,ay as $p,az as Ch,aA as Gp,aB as Sh,aC as Wp,aD as zp,aE as qp,aF as Yp,aG as Kp,aH as Xp,aI as jp,aJ as Qp,aK as $d,aL as Zp}from"./vendor.bc49f178.js";import{P as ye,C as Pn,a as Jp,u as eg,B as U,v as tg,b as ng,c as sg,d as ig,e as Ui,T as Xe,f as da,g as og,h as bh,i as La,L as as,j as Qr,k as ts,l as wh,m as J,r as qe,M as Te,K as Fe,n as Gd,o as rg,p as lg,q as ag,G as ls,s as le,t as dg,w as sn,x as Os,D as Vi,y as mn,z as ns,A as Th,S as Bi,E as Zr,F as ut,H as ss,I as Jr,J as Mi,N as cg,O as hg,Q as Wd,R as _r,U as zd,V as vh,W as No,X as ki,Y as ug,Z as _o,_ as mg,$ as Eh,a0 as pg,a1 as gg,a2 as He,a3 as Pa,a4 as Jn,a5 as Ha,a6 as Mr,a7 as Wn,a8 as fg,a9 as Cg,aa as Sg,ab as bg,ac as wg,ad as Ua,ae as Tg,af as As,ag as qd,ah as Cn,ai as Mo,aj as is,ak as Va,al as Ba,am as yh,an as vg,ao as el,ap as Eg,aq as kr,ar as yg,as as $a,at as Rh,au as ei,av as Rg,aw as Ig,ax as Fg,ay as Dg,az as Ng,aA as _g,aB as tl,aC as Yd,aD as Vl,aE as Mg,aF as kg,aG as xg,aH as Ih,aI as nl,aJ as sl,aK as Og,aL as Ag,aM as il,aN as Fh,aO as Lg,aP as Pg,aQ as Hg,aR as Ug,aS as Dh,aT as Vg,aU as Bg,aV as $g,aW as Gg,aX as Wg,aY as zg,aZ as qg,a_ as Ke,a$ as Kd,b0 as Nh,b1 as Yg,b2 as Kg,b3 as Xg,b4 as jg,b5 as Xd,b6 as xr,b7 as Qg,b8 as _h,b9 as Zg,ba as Jg,bb as Mh,bc as ef,bd as ca,be as ha,bf as tf,bg as nf,bh as sf,bi as of,bj as fn,bk as rf,bl as lf,bm as af,bn as df,bo as cf,bp as hf,bq as uf,br as mf,bs as jd,bt as pf,bu as gf}from"./index.f6d0d37c.js";import{e as os,l as Ti,K as cn,a as Qd,b as Ds,_ as ff,W as Cf}from"./monaco.1292e04e.js";import{P as Or,b as Sf,h as bf,p as wf,o as Tf,s as vf,t as Ef,c as Bl}from"./plotly.23481c2c.js";import"./helpers.162e09a8.js";function Ga({className:t,isFlipped:e,children:n,"data-testid":s}){const i=a=>{if(n.length!==2)throw new Error("CardFlip requires 2 children to function");return n[a]},o=b.exports.useRef(null),r=b.exports.useCallback(a=>{a.target===a.currentTarget&&document.body.classList.add("card-flip--is-flipping")},[]),l=b.exports.useCallback(a=>{a.target===a.currentTarget&&document.body.classList.remove("card-flip--is-flipping")},[]);return b.exports.useEffect(function(){if(!o.current)throw Error("ref undefined");o.current.addEventListener("transitionstart",r);const d=o.current;return function(){if(d!=null)return d.removeEventListener("transitionstart",r)}},[r]),T("div",{className:Y(t,{"card-flip--show-front":e,"card-flip--show-back":!e}),"data-testid":s,children:[h("div",{className:"card-flip--back",children:i(0)}),h("div",{ref:o,className:"card-flip--front",onTransitionEnd:l,children:i(1)})]})}class ol{static isDark(e){const n=document.createElement("div");n.style.display="none",n.style.color=e;const s=getComputedStyle(document.body.appendChild(n)).color,i=s.match(/\d+/g);let o=[];if(i)o=i.map(l=>parseInt(l,10));else throw new Error(`Invalid color received. Got ${s}`);return document.body.removeChild(n),ol.getBrightness(o)<125}static getBrightness(e){return Math.round((e[0]*299+e[1]*587+e[2]*114)/1e3)}}function yf(t,e){return t?t.closest(`.${e}`):null}const Rf={getClosestByClassName:yf};class ds{constructor(){this.pending=[],this.resolved=[]}add(e,n){const s=ye.makeCancelable(e,n);return this.pending.push(s),s.then(()=>{this.resolve(s)},()=>{this.resolve(s)}),s}remove(e){for(let n=0;n<this.pending.length;n+=1)if(this.pending[n]===e){this.pending.splice(n,1);return}}resolve(e){this.remove(e),this.resolved.push(e)}cancel(){const e=[...this.pending,...this.resolved];for(let n=0;n<e.length;n+=1)e[n].cancel();this.pending=[],this.resolved=[]}}function k(t){if(t==null)throw new Error("Value is null or undefined")}class jt{static join(e,n="and"){if(e==null||e.length===0)return"";if(e.length===1)return e[0];if(e.length===2)return`${e[0]} ${n} ${e[1]}`;const s=e.slice(0,e.length-1).join(", "),i=e[e.length-1];return`${s}, ${n} ${i}`}static toLower(e,n=!0){if(e==null){if(n)return"";throw new Error("Null string passed in to TextUtils.toLower")}return e.toLowerCase()}static sort(e,n,s=!0){return e<n?s?-1:1:e>n?s?1:-1:0}}class Di extends Error{constructor(){super(...arguments),this.isInvalid=!0}}class kh extends b.exports.Component{constructor(e){super(e),this.handleMenuClose=this.handleMenuClose.bind(this),this.handleContextMenu=this.handleContextMenu.bind(this),this.container=de.createRef(),this.openMenu=de.createRef(),this.state={actions:null,left:0,top:0}}componentDidMount(){this.container.current?.parentElement&&this.container.current.parentElement.addEventListener("contextmenu",this.handleContextMenu)}componentWillUnmount(){this.container.current?.parentElement&&this.container.current.parentElement.removeEventListener("contextmenu",this.handleContextMenu)}handleContextMenu(e){if(!Pn.isContextActionEvent(e)||!this.container.current||e.metaKey||e.ctrlKey)return;const n=Pn.getMenuItems(e.contextActions),s=this.container.current.getBoundingClientRect(),i=e.clientY-s.top,o=e.clientX-s.left;if(n.length===0){if(e.target===this.container.current){e.preventDefault(),this.setState({actions:null},()=>{const r=document.elementFromPoint(o,i),l=new MouseEvent("contextmenu",{clientX:e.clientX,clientY:e.clientY,bubbles:!0,cancelable:!0});r?.dispatchEvent(l)});return}return}e.preventDefault(),this.setState({actions:n,top:i,left:o})}handleMenuClose(e){e===this.openMenu.current&&this.setState({actions:null})}render(){let e=null;const{"data-testid":n}=this.props,{actions:s,top:i,left:o}=this.state;return s&&(e=h(Jp,{ref:this.openMenu,actions:s,onMenuClosed:this.handleMenuClose,top:i,left:o,updatePosition:(r,l)=>{this.setState({top:r,left:l})},"data-testid":n})),h("div",{className:Y("context-menu-root",{active:s}),ref:this.container,children:e})}}function rl(t){const e=b.exports.useRef();return b.exports.useEffect(function(){e.current=t}),e.current}function ll({copy:t,kind:e="ghost",tooltip:n="Copy",className:s,"data-testid":i,children:o}){const[r,l]=eg();return h(U,{kind:e,className:s,"data-testid":i,icon:r?tg:ng,tooltip:r?"Copied":n,onClick:()=>{l(typeof t=="function"?t():t)},children:o})}class qt{static reorder(e,n,s,i){const o=e===s?qt.adjustDestinationIndex(i,n):i,r=qt.removeItems(e,n);return s.splice(o,0,...r),r}static removeItems(e,n){const s=[],i=n.map((o,r)=>({range:o,index:r})).sort((o,r)=>r.range[0]-o.range[0]);for(let o=0;o<i.length;o+=1){const{range:r,index:l}=i[o],[a,d]=r;s[l]=e.splice(a,d-a+1)}return Sp(s)}static adjustDestinationIndex(e,n){let s=e;for(let i=0;i<n.length;i+=1){const[o,r]=n[i];if(o>e)break;s-=Math.min(r,e-1)-o+1}return s}static startDragging(){document.documentElement.classList.add("drag-pointer-events-none")}static stopDragging(){document.documentElement.classList.remove("drag-pointer-events-none")}}function xh({on:t,id:e,className:n,isInvalid:s,disabled:i=!1,onClick:o,"data-testid":r}){return h("button",{type:"button",className:Y("btn","btn-switch",n,{active:t},{"is-invalid":s}),id:e,onClick:o,disabled:i,"data-testid":r,children:h("div",{className:"handle"})})}function Zd(t){return t.isOn!==void 0}function If({item:t,onSelect:e=()=>{},"data-testid":n}){const{icon:s,subtitle:i,title:o}=t,r=b.exports.useMemo(()=>Zd(t)?()=>{t.onChange(!t.isOn)}:e,[t,e]);return T("div",{className:"btn btn-navigation-menu-item","data-testid":`menu-item-${o}`,onClick:r,onKeyDown:l=>{(l.key==="Enter"||l.key===" ")&&r()},tabIndex:0,role:"menuitem",children:[s!==void 0&&h("div",{className:"icon",children:h(Z,{icon:s})}),h("div",{className:"title",children:o}),i!==void 0&&h("div",{className:"shortcut",children:i}),h("div",{className:"accessory","data-testid":n,children:Zd(t)?h(xh,{on:t.isOn,onClick:l=>{l.stopPropagation(),r()}}):h(Z,{icon:sg})})]})}function Oh({items:t,onSelect:e=()=>{},"data-testid":n}){return h("div",{className:"navigation-menu-view","data-testid":n,children:h("ul",{className:"navigation-menu-list",children:t.map((s,i)=>h("li",{children:h(If,{item:s,onSelect:()=>{e(i)}})},s.title))})})}function Jd({children:t,onBack:e,onClose:n,title:s,"data-testid":i}){return T("div",{className:"navigation-page","data-testid":i,children:[T("div",{className:"navigation-title-bar",children:[h("div",{className:"navigation-left-buttons",children:e!==void 0&&h(U,{kind:"ghost",className:"btn-back","data-testid":"btn-page-back",onClick:e,icon:ig,children:"Back"})}),h("div",{className:"navigation-title",children:s}),h("div",{className:"navigation-right-buttons",children:n!==void 0&&h(U,{kind:"ghost",className:"btn-close px-2 m-1","data-testid":"btn-page-close",onClick:n,icon:Ui,tooltip:"Close"})})]}),h("div",{className:"navigation-content",children:t})]})}function Ff({children:t,"data-testid":e}){const n=b.exports.useMemo(()=>de.Children.toArray(t),[t]),s=rl(n),[i,o]=b.exports.useState(n[n.length-1]),[r,l]=b.exports.useState(null),[a,d]=b.exports.useState(null);b.exports.useEffect(function(){if(s===void 0||n===s)return;const p=n[n.length-1];n.length===s.length||s.length===0||r!==null||a!==null?r!==null&&p!==r?l(p):p!==a&&p!==i&&o(p):n.length>s.length?l(p):n.length<s.length&&(o(p),d(s[s.length-1]))},[n,s,r,a,i]);const c=b.exports.useCallback(()=>{o(r),l(null)},[r]),u=b.exports.useCallback(()=>{d(null)},[]);return T("div",{className:"navigation-stack",children:[h("div",{className:"main-view","data-testid":e,children:i}),h(Ht,{in:a!=null,timeout:Xe.transitionMidMs,classNames:"slide-right",onEntered:u,children:h(be,{children:a!=null&&h("div",{className:"popping-view",children:a})})}),h(Ht,{in:r!=null,timeout:Xe.transitionMidMs,classNames:"slide-left",onEntered:c,children:h(be,{children:r!=null&&h("div",{className:"pushing-view",children:r})})})]})}function Df({children:t,disabled:e,value:n,"data-testid":s}){return h("option",{value:n,disabled:e,"data-testid":s,children:t})}function al(t){const{children:e,disabled:n=!1,name:s,onChange:i,value:o="","data-testid":r}=t,[l]=b.exports.useState(s??$e());return h(be,{children:de.Children.map(e,a=>a?de.cloneElement(a,{name:l,onChange:a.props.onChange??i,checked:o===a.props.value,disabled:a.props.disabled??n,"data-testid":r}):null)})}function Nf({children:t,onBlur:e,onChange:n,className:s,defaultValue:i,name:o,value:r,disabled:l,"data-testid":a}){const d=b.exports.useCallback(c=>{n(c.target.value)},[n]);return h("select",{className:Y("custom-select",s),onBlur:e,onChange:d,defaultValue:i,value:r,name:o,disabled:l,"data-testid":a,children:t})}const{dh:I}=globalThis,dl=M.exports.shape({name:M.exports.string.isRequired,type:M.exports.string.isRequired,description:M.exports.string,constituentType:M.exports.string}),Ah=M.exports.shape({not:M.exports.func.isRequired,and:M.exports.func.isRequired,or:M.exports.func.isRequired}),_f=M.exports.shape({asc:M.exports.func.isRequired,desc:M.exports.func.isRequired,abs:M.exports.func.isRequired,column:dl.isRequired,direction:M.exports.string.isRequired,isAbs:M.exports.bool.isRequired}),Mf=M.exports.shape({columns:M.exports.arrayOf(dl).isRequired,customColumns:M.exports.arrayOf(M.exports.string).isRequired,filter:M.exports.arrayOf(Ah),addEventListener:M.exports.func.isRequired,removeEventListener:M.exports.func.isRequired,size:M.exports.number.isRequired,sort:M.exports.arrayOf(M.exports.any),copy:M.exports.func.isRequired,applyFilter:M.exports.func.isRequired,applySort:M.exports.func.isRequired,applyCustomColumns:M.exports.func.isRequired,description:M.exports.string}),kf=M.exports.shape({columns:M.exports.arrayOf(dl),filter:M.exports.arrayOf(M.exports.any),isExpanded:M.exports.func.isRequired,saveExpandedState:M.exports.func.isRequired,addEventListener:M.exports.func.isRequired,removeEventListener:M.exports.func.isRequired,size:M.exports.number.isRequired,sort:M.exports.arrayOf(M.exports.any),applyFilter:M.exports.func.isRequired,applySort:M.exports.func.isRequired}),Tr=M.exports.shape({name:M.exports.string.isRequired,type:M.exports.string.isRequired}),xf=M.exports.shape({created:M.exports.arrayOf(Tr).isRequired,updated:M.exports.arrayOf(Tr).isRequired,removed:M.exports.arrayOf(Tr).isRequired}),Of=M.exports.shape({groupingColumns:M.exports.arrayOf(M.exports.string),aggregations:M.exports.shape({}),includeConstituents:M.exports.bool,includeOriginalColumns:M.exports.bool,includeDescriptions:M.exports.bool}),Af=M.exports.shape({addEventListener:M.exports.func.isRequired,removeEventListener:M.exports.func.isRequired,onLogMessage:M.exports.func,getTable:M.exports.func.isRequired,runCode:M.exports.func.isRequired});Object.freeze({Column:dl,FilterCondition:Ah,IdeSession:Af,RollupConfig:Of,Sort:_f,Table:Mf,TreeTable:kf,VariableChanges:xf,VariableDefinition:Tr});function Lh({type:t}){switch(t){case I.VariableType.TABLE:case I.VariableType.TABLEMAP:case I.VariableType.TREETABLE:case I.VariableType.HIERARCHICALTABLE:return h(Z,{icon:La});case I.VariableType.FIGURE:return h(Z,{icon:bh});case I.VariableType.PANDAS:return h(Z,{icon:og});default:return h(Z,{icon:da})}}class cl extends b.exports.Component{constructor(e){super(e),this.container=null}componentDidMount(){this.colorize()}colorize(){const{children:e}=this.props;this.container&&e!=null&&os.colorizeElement(this.container,{theme:"dh-dark"})}render(){const{children:e,language:n}=this.props;return h("div",{children:h("div",{"data-lang":n,ref:s=>{this.container=s},style:{pointerEvents:"none"},children:e})})}}class Ph{static get LANGUAGE_MAP(){return new Map([["python","Python"],["groovy","Groovy"],["scala","Scala"]])}}class xi{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)?[]:bp.parse(e).filter(n=>!this.hasComment(n)).map(n=>this.hasPattern(n)?n.pattern:this.hasOp(n)?n.op:`${n}`)}static formatTimestamp(e){if(e==null||!(e instanceof Date))return null;const n=`${e.getHours()}`.padStart(2,"0"),s=`${e.getMinutes()}`.padStart(2,"0"),i=`${e.getSeconds()}`.padStart(2,"0"),o=`${e.getMilliseconds()}`.padStart(3,"0");return`${n}:${s}:${i}.${o}`}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 xi.isTableType(e)||xi.isWidgetType(e)}static isFigureType(e){return e===I.VariableType.FIGURE}static isPandas(e){return e===I.VariableType.PANDAS}}function Hh({children:t}){return T("div",{className:"console-history-item-result",children:[h("div",{className:"console-history-gutter",children:"-"}),h("div",{className:"console-history-content",children:t})]})}Hh.propTypes={children:M.exports.node.isRequired};class Uh extends b.exports.Component{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}updateElapsed(){this.setState({elapsed:Math.round((Date.now()-this.startTime)/1e3)})}render(){const{disabled:e,onCancelClick:n}=this.props,{elapsed:s}=this.state;return h("div",{className:Y("console-history-result-in-progress",{disabled:e}),children:T("span",{className:"badge",children:[h(as,{}),"\xA0Running... ",Qr.formatElapsedTime(s),"\xA0",h(U,{className:"console-history-result-in-progress-cancel",kind:"ghost",icon:Ui,tooltip:"Cancel",onClick:n,disabled:e})]})})}}Uh.defaultProps={disabled:!1};const ua=class extends b.exports.PureComponent{constructor(t){super(t),this.handleKeyPress=this.handleKeyPress.bind(this),this.handleMouseDown=this.handleMouseDown.bind(this),this.handleMouseMove=this.handleMouseMove.bind(this),this.handleMouseUp=this.handleMouseUp.bind(this),this.handleToggleError=this.handleToggleError.bind(this),this.handleMouseEnter=this.handleMouseEnter.bind(this),this.handleMouseLeave=this.handleMouseLeave.bind(this),this.mouseX=null,this.mouseY=null,this.isClicking=!1,this.state={isExpanded:!1,isTriggerHovered:!1}}handleKeyPress(t){switch(t.key){case"Enter":case" ":this.handleToggleError(),t.stopPropagation(),t.preventDefault();break}}handleMouseDown(t){this.mouseX=t.clientX,this.mouseY=t.clientY,this.isClicking=!0}handleMouseMove(t){this.mouseX!=null&&this.mouseY!=null?(Math.abs(t.clientX-this.mouseX)>=ua.mouseDragThreshold||Math.abs(t.clientY-this.mouseY)>=ua.mouseDragThreshold)&&(this.isClicking=!1):this.isClicking&&(this.isClicking=!1)}handleMouseUp(t){this.isClicking&&!t.shiftKey&&!t.metaKey&&!t.altKey&&this.handleToggleError(),this.mouseX=null,this.mouseY=null,this.isClicking=!1}handleToggleError(){this.setState(t=>({isExpanded:!t.isExpanded}))}handleMouseEnter(){this.setState({isTriggerHovered:!0})}handleMouseLeave(){this.setState({isTriggerHovered:!1})}render(){const{isExpanded:t,isTriggerHovered:e}=this.state,{message:n}=this.props;k(n);const s=n.indexOf(`
|
|
2
2
|
`),i=s>-1;let o=n;i&&(o=n.slice(0,s));const r=n.slice(s),l=e?"error-btn-link error-btn-link--active":"error-btn-link";return T("div",{className:Y("error-message",{expanded:t}),children:[i&&T(be,{children:[h("div",{className:"error-gutter",children:h("button",{type:"button",onClick:this.handleToggleError,className:l,tabIndex:-1,children:h(Z,{icon:t?ts:wh,transform:"left-3"})})}),T("div",{className:"error-content",children:[h("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}),t?r:""]})]}),!i&&h("div",{className:"error-content",children:h("div",{className:"console-error-text",children:o})})]},"error")}};let Wa=ua;Wa.defaultProps={message:""};Wa.mouseDragThreshold=5;const ec=J.module("ConsoleHistoryItem");class Vh extends b.exports.PureComponent{constructor(e){super(e),this.handleCancelClick=this.handleCancelClick.bind(this),this.handleObjectClick=this.handleObjectClick.bind(this)}handleObjectClick(e){ec.debug("handleObjectClick",e);const{openObject:n}=this.props;n(e)}handleCancelClick(){const{item:e}=this.props;e!=null&&e.cancelResult&&(ec.debug(`Cancelling command: ${e.command}`),e.cancelResult())}render(){const{disabled:e,item:n,language:s}=this.props,{disabledObjects:i,result:o}=n;let r=null;n.command!=null&&n.command!==""&&(r=T("div",{className:"console-history-item-command",children:[h("div",{className:"console-history-gutter",children:">"}),h("div",{className:"console-history-content",children:h(cl,{language:s,children:n.command})})]}));const l=[];let a=!1;if(o){const{error:c,message:u,changes:m}=o;if(m){const{created:p,updated:g}=m;[...p,...g].forEach(f=>{a=!0;const{title:C}=f,S=`${C}`,w=e===void 0||e||(i??[]).indexOf(S)>=0,v=h(U,{kind:"primary",onClick:()=>this.handleObjectClick(f),className:"btn-console-object",disabled:w,icon:h(Lh,{type:f.type}),children:C},S);l.push(v)})}if(c!=null&&n.command==null){let p=`${c.message??c}`;p||(p=c);const g=h(Wa,{message:p},"result-error");l.push(g)}if(u!==void 0&&u!==""){const p=h("div",{className:"log-message",children:u},"log-message");l.push(p)}}else{a=!0;const c=h(Uh,{onCancelClick:this.handleCancelClick,disabled:e},"in_progress");l.push(c)}let d=null;return l.length>0&&(d=h(Hh,{children:l})),T("div",{className:Y("console-command-result",{"console-result-buttons":a}),children:[r,d]})}}Vh.defaultProps={disabled:!1};const Bh=class extends b.exports.Component{static itemKey(t,e){return`${t}.${e.command}.${e.result&&e.result.message}.${e.result&&e.result.error}`}render(){const{disabled:t,items:e,language:n,openObject:s}=this.props,i=[];for(let o=0;o<e.length;o+=1){const r=e[o],l=h(Vh,{disabled:t,item:r,openObject:s,language:n},Bh.itemKey(o,r));i.push(l)}return h("div",{className:"container-fluid console-history",children:i})}};let $h=Bh;$h.defaultProps={disabled:!1};const Lf={name:"Console",CLEAR:qe.createAndAdd({id:"CONSOLE.CLEAR",name:"Clear",shortcut:[Te.CTRL,Fe.L],macShortcut:[Te.CTRL,Fe.C]}),FOCUS_HISTORY:qe.createAndAdd({id:"CONSOLE.FOCUS_HISTORY",name:"Focus History",shortcut:[Te.CTRL,Fe.H],macShortcut:[Te.CTRL,Te.OPTION,Fe.H]})},Pf={name:"Command History",FOCUS_HISTORY:qe.createAndAdd({id:"COMMAND_HISTORY.FOCUS_HISTORY",name:"Focus History Search",shortcut:[Te.CTRL,Fe.H],macShortcut:[Te.CTRL,Te.OPTION,Fe.H]}),SEND_TO_CONSOLE:qe.createAndAdd({id:"COMMAND_HISTORY.SEND_TO_CONSOLE",name:"Send to Console",shortcut:[Fe.ENTER],macShortcut:[Fe.ENTER]}),SEND_TO_NOTEBOOK:qe.createAndAdd({id:"COMMAND_HISTORY.SEND_TO_NOTEBOOK",name:"Send to Notebook",shortcut:[Te.CTRL,Fe.ENTER],macShortcut:[Te.CMD,Fe.ENTER]}),RUN:qe.createAndAdd({id:"COMMAND_HISTORY.RUN",name:"Run",shortcut:[Te.ALT,Fe.R],macShortcut:[Te.OPTION,Fe.R]})},Hf={name:"Notebook",RUN:qe.createAndAdd({id:"NOTEBOOK.RUN",name:"Run",shortcut:[Te.ALT,Fe.R],macShortcut:[Te.OPTION,Fe.R]}),RUN_SELECTED:qe.createAndAdd({id:"NOTEBOOK.RUN_SELECTED",name:"Run Selected",shortcut:[Te.ALT,Te.SHIFT,Fe.R],macShortcut:[Te.OPTION,Te.SHIFT,Fe.R]}),FIND:qe.createAndAdd({id:"NOTEBOOK.FIND",name:"Find",shortcut:[Te.CTRL,Fe.F],macShortcut:[Te.CMD,Fe.F],isEditable:!1}),MINIMAP:qe.createAndAdd({id:"NOTEBOOK.MINIMAP",name:"Show Minimap",shortcut:[Te.ALT,Fe.M],macShortcut:[Te.OPTION,Fe.M]}),WORDWRAP:qe.createAndAdd({id:"NOTEBOOK.WORDWRAP",name:"Word Wrap",shortcut:[Te.ALT,Fe.Z],macShortcut:[Te.OPTION,Fe.Z]})},Pt={CONSOLE:Lf,COMMAND_HISTORY:Pf,NOTEBOOK:Hf},St=Object.freeze({FATAL:"FATAL",STDERR:"STDERR",ERROR:"ERROR",WARN:"WARN",STDOUT:"STDOUT",INFO:"INFO",DEBUG:"DEBUG",TRACE:"TRACE"}),Uf="#2d2a2e",Vf="#fcfcfa",Bf="#fcd65b",$f="#b2b1b2",Gf="#9edc6f",Wf="#76d9e4",zf="#f95d84",qf="#aa9af4",Yf="#f95d84",Kf="#fcfcfa",Xf="#7c7b7c",we={"error-foreground":"#f95d84",background:Uf,foreground:Vf,"line-height":"19px",string:Bf,"string-delim":"#929192",delimiter:$f,predefined:Gf,keyword:Wf,storage:zf,number:qf,operator:Yf,identifier:Kf,"namespace-identifier":"#f95d84","identifier-js":"#fcd65b",comment:Xf,"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"},jf="python",Qf={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/}}},Zf={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"]]}},Jf={id:jf,conf:Qf,language:Zf},eC="groovy",tC={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/}}},nC={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"]]}},sC={id:eC,conf:tC,language:nC},iC="scala",oC={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>))/}}},rC={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"]]}},lC={id:iC,conf:oC,language:rC},aC="deephavenDb",dC={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/}}},cC={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"]]}},hC={id:aC,conf:dC,language:cC},uC="log",mC={},pC={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"}]]}},gC={id:uC,conf:mC,language:pC},In=J.module("MonacoUtils");class lt{static init({getWorker:e}={}){In.debug("Initializing Monaco..."),e!==void 0&<.registerGetWorker(e);const{registerLanguages:n,removeHashtag:s}=lt,i=[{token:"",foreground:s(we.foreground)},{token:"string",foreground:s(we.string)},{token:"string.delim",foreground:s(we["string-delim"])},{token:"keyword",foreground:s(we.keyword)},{token:"identifier.js",foreground:s(we["identifier-js"])},{token:"delimiter",foreground:s(we.delimiter)},{token:"comment",foreground:s(we.comment)},{token:"number",foreground:s(we.number)},{token:"storage",foreground:s(we.storage)},{token:"identifier",foreground:s(we.identifier)},{token:"namespace.identifier",foreground:s(we["namespace-identifier"])},{token:"operator",foreground:s(we.operator)},{token:"predefined",foreground:s(we.predefined)},{token:"error.log",foreground:we["log-error"].substring(1)},{token:"warn.log",foreground:s(we["log-warn"])},{token:"info.log",foreground:s(we["log-info"])},{token:"stdout.log",foreground:s(we["log-stdout"])},{token:"trace.log",foreground:s(we["log-trace"])},{token:"debug.log",foreground:s(we["log-debug"])},{token:"date.log",foreground:s(we["log-date"])}],o={errorForeground:we["error-foreground"],"inputOption.activeBorder":we["input-option-active-border"],"editor.background":we.background,"editor.foreground":we.foreground,"editor.lineHighlightBackground":we["editor-line-highlight-bg"],"editorLineNumber.foreground":we["editor-line-number-foreground"],"editor.selectionBackground":we["editor-selection-background"],"editor.findMatchBackground":we["editor-find-match-background"],"editor.findMatchHighlightBackground":we["editor-find-match-highlight-background"],"editorSuggestWidget.background":we["editor-suggest-widget-background"],"editorSuggestWidget.border":we["editor-suggest-widget-border"],"editorSuggestWidget.foreground":we["editor-suggest-widget-foreground"],"editorSuggestWidget.selectedBackground":we["editor-suggest-widget-selected-background"],"editorSuggestWidget.highlightForeground":we["editor-suggest-widget-highlightForeground"],"list.hoverBackground":we["list-hover-background"],"dropdown.background":we["context-menu-background"],"dropdown.foreground":we["context-menu-foreground"],"menu.selectionBackground":we["menu-selection-background"],"list.focusBackground":we["menu-selection-background"],"editorWidget.background":we["editor-widget-background"],"inputOption.activeBackground":we["input-option-active-background"],"inputOption.activeForeground":we["input-option-active-foreground"],focusBorder:we["focus-border"],"input.background":we["input-background"],"input.foreground":we["input-foreground"],"input.border":we["input-border"]};os.defineTheme("dh-dark",{base:"vs-dark",inherit:!0,rules:i,colors:o}),In.debug2("monaco theme: ",we),os.setTheme("dh-dark"),n([hC,Jf,sC,gC,lC]),In.debug("Monaco initialized.")}static registerGetWorker(e){window.MonacoEnvironment={...window.MonacoEnvironment,getWorker:e}}static removeHashtag(e){return e.substring(1)}static registerLanguages(e){const n=e.map(({id:s})=>s);Ti.getLanguages().filter(({id:s})=>n.includes(s)).forEach(s=>{const i=s;In.debug2("Overriding default language loader:",i.id)}),e.forEach(s=>{lt.registerLanguage(s)})}static registerLanguage(e){In.debug2("Registering language: ",e.id),Ti.register(e),Ti.onLanguage(e.id,()=>{Ti.setLanguageConfiguration(e.id,e.conf),Ti.setMonarchTokensProvider(e.id,e.language)})}static setEOL(e,n=os.EndOfLineSequence.LF){e.getModel()?.setEOL(n)}static openDocument(e,n){const s=e.getModel();k(s);const i={textDocument:{uri:`${s.uri}`,languageId:s.getLanguageId(),version:s.getVersionId(),text:s.getValue()}};return In.debug2("didOpenDocumentParams: ",i),n.openDocument(i),e.onDidChangeModelContent(r=>{const{changes:l,versionId:a}=r,d=[];for(let c=0;c<l.length;c+=1){const u=l[c],{range:m,rangeLength:p,text:g}=u,f={range:{start:{line:m.startLineNumber-1,character:m.startColumn-1},end:{line:m.endLineNumber-1,character:m.endColumn-1}},rangeLength:p,text:g};d.push(f)}if(d.length>0){const c={textDocument:{version:a,uri:`${s.uri}`},contentChanges:d};In.debug2("didChangeDocumentParams",c),n.changeDocument(c)}})}static closeDocument(e,n){const s=e.getModel();k(s);const i={textDocument:{uri:`${s.uri}`}};n.closeDocument(i)}static registerPasteHandler(e){e.onDidPaste(n=>{const s=/“|”/g,i=/\u200b/g,o=/\u00A0/g,r=e.getModel();k(r);const l=r.getValueInRange(n.range);(s.test(l)||i.test(l)||o.test(l))&&r.applyEdits([{range:n.range,text:l.replace(s,'"').replace(i,"").replace(o," ")}])})}static isMacPlatform(){const{platform:e}=window.navigator;return e.startsWith("Mac")}static removeConflictingKeybindings(e){const n=[{windows:"ctrl+D",mac:"meta+D"},{windows:"ctrl+H"}];try{n.forEach(s=>{lt.isMacPlatform()&&s.mac===""||!lt.isMacPlatform()&&s.windows===""||lt.removeKeybinding(e,lt.isMacPlatform()?s.mac:s.windows)})}catch(s){In.error(s)}}static removeKeybinding(e,n){if(n===void 0)return;const s=e._standaloneKeybindingService._getResolver()._map.get(n);s!=null?s.forEach(i=>{In.debug2(`Removing Monaco keybinding ${n} for ${i.command}`),e._standaloneKeybindingService.addDynamicKeybinding(`-${i.command}`,null,()=>{})}):In.warn(`Did not find any keybindings to remove for ${n}`)}static getMonacoKeyCodeFromShortcut(e){const{keyState:n}=e,{keyValue:s}=n;return s===null?0:lt.isMacPlatform()?(n.metaKey?cn.CtrlCmd:0)|(n.shiftKey?cn.Shift:0)|(n.altKey?cn.Alt:0)|(n.ctrlKey?cn.WinCtrl:0)|Qd.fromString(s):(n.ctrlKey?cn.CtrlCmd:0)|(n.shiftKey?cn.Shift:0)|(n.altKey?cn.Alt:0)|(n.metaKey?cn.WinCtrl:0)|Qd.fromString(s)}}const tc=J.module("MonacoCompletionProvider");class Gh extends b.exports.PureComponent{constructor(e){super(e),this.handleCompletionRequest=this.handleCompletionRequest.bind(this)}componentDidMount(){const{language:e}=this.props;this.registeredCompletionProvider=Ti.registerCompletionItemProvider(e??"",{provideCompletionItems:this.handleCompletionRequest,triggerCharacters:['"',".","'","(","[","{",","]})}componentWillUnmount(){this.registeredCompletionProvider?.dispose()}handleCompletionRequest(e,n,s){const{model:i,session:o}=this.props;if(e!==i)return null;const r={textDocument:{uri:`${e.uri}`,version:e.getVersionId()},position:{line:n.lineNumber-1,character:n.column-1},context:s},l=o.getCompletionItems(r);return tc.debug("Completion items received: ",r,l),l.then(d=>{const c=d.map(u=>{const{label:m,kind:p,detail:g,documentation:f,sortText:C,filterText:S,textEdit:w,insertTextFormat:v}=u,{start:y,end:E}=w.range,R={startLineNumber:y.line+1,startColumn:y.character+1,endLineNumber:E.line+1,endColumn:E.character+1};return{label:m,kind:p,detail:g,documentation:f,sortText:C,filterText:S,insertText:w.text,insertTextRules:v===2?4:v,range:R}});return{incomplete:!0,suggestions:c}}).catch(d=>(tc.error("There was an error retrieving completion items",d),{suggestions:[]}))}render(){return null}}const $l=J.module("ConsoleInput"),Ar=parseInt(we["line-height"],10),Wh=6,zh=6,fC=Ar+Wh+zh,Gl=100,qh=class extends b.exports.PureComponent{constructor(t){super(t),this.handleWindowResize=this.handleWindowResize.bind(this),this.commandContainer=de.createRef(),this.commandHistoryIndex=null,this.timestamp=Date.now(),this.bufferIndex=0,this.history=[],this.modifiedCommands=new Map,this.state={commandEditorHeight:Ar,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()}setConsoleText(t,e=!0,n=!1){!t||($l.debug("Command received: ",t),n||(this.commandHistoryIndex=null,this.commandEditor?.setValue(t)),e&&this.focusEnd(),this.updateDimensions(),n&&this.processCommand(t))}initCommandEditor(){const{language:t,session:e}=this.props,n={copyWithSyntaxHighlighting:!1,cursorStyle:"block",fixedOverflowWidgets:!0,folding:!1,fontFamily:"Fira Mono",glyphMargin:!1,language:t,lineHeight:Ar,lineDecorationsWidth:3,lineNumbers:"off",minimap:{enabled:!1},renderLineHighlight:"none",scrollBeyondLastLine:!1,scrollbar:{arrowSize:0,horizontal:"hidden",horizontalScrollbarSize:0},padding:{top:Wh,bottom:zh},tabCompletion:"on",value:"",wordWrap:"on"},s=this.commandContainer.current;k(s),this.commandEditor=os.create(s,n),lt.setEOL(this.commandEditor),lt.openDocument(this.commandEditor,e),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:r}=this,l=o?.getPosition();k(l);const{lineNumber:a}=l,d=o?.getModel();if(i.code==="ArrowUp"&&!this.isSuggestionMenuPopulated()&&a===1){r!=null?this.loadCommand(r+1):this.loadCommand(0),this.focusStart(),i.stopPropagation(),i.preventDefault();return}if(i.code==="ArrowDown"&&!this.isSuggestionMenuPopulated()&&a===d?.getLineCount()){r!=null&&r>0?this.loadCommand(r-1):this.loadCommand(null),this.focusEnd(),i.stopPropagation(),i.preventDefault();return}if(!i.altKey&&!i.shiftKey&&!i.metaKey)if(i.keyCode===Ds.Enter){if(!this.isSuggestionMenuPopulated()){i.stopPropagation(),i.preventDefault();const c=this.commandEditor?.getValue().trim();c!==void 0&&(this.processCommand(c),this.commandEditor?.setValue(""))}}else i.keyCode===Ds.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(cn.CtrlCmd|Ds.KeyF,()=>{}),lt.removeConflictingKeybindings(this.commandEditor),lt.registerPasteHandler(this.commandEditor),this.commandEditor.focus(),this.updateDimensions(),this.setState({model:this.commandEditor.getModel()})}destroyCommandEditor(){const{session:t}=this.props;this.commandEditor&&(lt.closeDocument(this.commandEditor,t),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 t=this.commandEditor?.getModel();k(t);const e=t.getLineLength(1)+1,n=this.commandEditor?.getTopForPosition(1,e);k(n),this.commandEditor?.setPosition({lineNumber:1,column:e}),this.commandEditor?.setScrollTop(n),this.commandEditor?.focus()}focusEnd(){const t=this.commandEditor?.getModel();k(t);const e=t.getLineCount(),n=t.getLineLength(e)+1,s=this.commandEditor?.getTopForPosition(e,n);k(s),this.commandEditor?.setPosition({lineNumber:e,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(t){if(t!==null&&t>=this.history.length)return;const e=this.modifiedCommands.get(t),n=t===null?"":this.history[this.history.length-t-1];this.commandHistoryIndex=t,this.commandEditor?.getModel()?.setValue(e??n),t!==null&&t>this.history.length-Gl&&this.loadMoreHistory()}async loadMoreHistory(){try{if(this.loadingPromise!=null||this.bufferIndex==null)return;const{commandHistoryStorage:t,language:e,scope:n}=this.props;this.loadingPromise=ye.makeCancelable(t.getTable(e,n??"",this.timestamp),o=>o.close());const s=await this.loadingPromise;s.setReversed(!0),s.setViewport({top:this.bufferIndex,bottom:this.bufferIndex+Gl-1}),this.loadingPromise=ye.makeCancelable(s.getViewportData(),()=>s.close());const i=await this.loadingPromise;this.bufferIndex+=Gl,this.bufferIndex>=s.size&&(this.bufferIndex=null),this.history=[...i.items.filter(({name:o},r,l)=>r===0||o!==l[r-1].name).map(({name:o})=>o).reverse(),...this.history],this.loadingPromise=void 0,s.close()}catch(t){if(this.loadingPromise=void 0,ye.isCanceled(t)){$l.debug2("Promise canceled, not loading history");return}$l.error("Error fetching history",t)}}processCommand(t){this.commandHistoryIndex=null,this.modifiedCommands.clear(),k(t),t!==""&&(this.history.length===0||t!==this.history[this.history.length-1])&&this.history.push(t),this.updateDimensions();const{onSubmit:e}=this.props;e(t)}updateDimensions(){if(!this.commandEditor)return;const{maxHeight:t}=this.props;k(t);const e=this.commandEditor.getContentHeight(),n=Math.max(Math.min(e,t),fC),i={overviewRulerLanes:e>n?void 0:0};this.setState({commandEditorHeight:n},()=>{this.commandEditor?.updateOptions(i),this.commandEditor?.layout()})}render(){const{disabled:t,language:e,session:n}=this.props,{commandEditorHeight:s,isFocused:i,model:o}=this.state;return h("div",{className:Y("console-input-wrapper",{disabled:t}),children:T("div",{className:Y("console-input-inner-wrapper",{focus:i}),children:[h("div",{className:qh.INPUT_CLASS_NAME,ref:this.commandContainer,style:{height:s}}),o&&h(Gh,{model:o,language:e,session:n})]})})}};let Lr=qh;Lr.defaultProps={maxHeight:Ar*10,scope:null,disabled:!1};Lr.INPUT_CLASS_NAME="console-input";const nc="pasted values",CC=[/^audio.*/,/^font.*/,/^image.*/,/^video.*/],Wl=[".csv",".tsv",".tab",".psv",".dsv",".txt"],sc=[".zip"],vi=class extends b.exports.Component{constructor(t){super(t),this.getValidExtensions=ge(e=>e?[...Wl,...sc]:[...Wl]),this.getAcceptString=ge(e=>this.getValidExtensions(e).join(", ")),this.getFileTypeErrorString=ge(e=>jt.join(this.getValidExtensions(e),"or")),this.handleSelectFile=this.handleSelectFile.bind(this),this.handleFiles=this.handleFiles.bind(this),this.handleDrop=this.handleDrop.bind(this),this.unstageFile=this.unstageFile.bind(this),this.handleMenuPaste=this.handleMenuPaste.bind(this),this.handlePasteEvent=this.handlePasteEvent.bind(this),this.fileElem=de.createRef(),this.divElem=de.createRef(),this.state={selectedFileName:""}}static isValidDropItem(t){return t!=null&&t.kind==="file"&&!CC.find(e=>e.test(t.type))}static isValidExtension(t,e=!1){return Wl.some(n=>t.endsWith(n))||e&&sc.some(n=>t.endsWith(n))}static handleDragOver(t){t.preventDefault(),t.stopPropagation()}static getIcon(t){return t===nc?Gd:t.endsWith(".csv")?rg:t.endsWith(".zip")?lg:ag}componentDidMount(){this.divElem.current?.addEventListener("paste",this.handlePasteEvent),this.divElem.current?.focus()}componentWillUnmount(){this.divElem.current?.removeEventListener("paste",this.handlePasteEvent)}handleSelectFile(){this.fileElem.current&&(this.fileElem.current.value="",this.fileElem.current?.click())}handleFiles(t){t.stopPropagation(),t.preventDefault();const{files:e}=t.target;e!=null&&this.handleFile(e[0])}handleDrop(t){const{allowZip:e,clearDragError:n,dragError:s}=this.props;if(t.preventDefault(),t.stopPropagation(),s!=null){n();return}if(t.dataTransfer==null||t.dataTransfer.items==null||t.dataTransfer.items.length===0)return;const i=t.dataTransfer.items[0].getAsFile();k(i),vi.isValidExtension(i.name,e)?this.handleFile(i):this.setState({dropError:vi.FILE_TYPE_ERROR})}unstageFile(t){const{onCancel:e}=this.props;t.stopPropagation(),t.preventDefault(),e(),this.setState({selectedFileName:"",dropError:void 0})}handleFile(t){const{onFileOpened:e}=this.props;e(t),this.setState({selectedFileName:t.name,dropError:void 0})}handleMenuPaste(){const{onPaste:t,onError:e,uploadInProgress:n}=this.props;n||navigator.clipboard.readText().then(s=>{t(s),this.setState({selectedFileName:nc,dropError:void 0})}).catch(s=>e(s))}handlePasteEvent(t){t.stopPropagation(),t.preventDefault(),this.handleMenuPaste()}makeContextMenuItems(){const{uploadInProgress:t}=this.props;return[{title:"Paste",icon:Gd,action:this.handleMenuPaste,shortcut:ls.PASTE,disabled:t}]}render(){const{allowZip:t,dragError:e,uploadInProgress:n}=this.props,{selectedFileName:s,dropError:i}=this.state,o=e??i,r=this.makeContextMenuItems();return T("div",{ref:this.divElem,className:"csv-overlay fill-parent-absolute",onDragOver:vi.handleDragOver,onDrop:this.handleDrop,tabIndex:-1,children:[h(le,{actions:r}),h("input",{ref:this.fileElem,type:"file",id:"fileElem",accept:this.getAcceptString(t),style:{display:"none"},onChange:this.handleFiles,"data-testid":"fileElem"}),!s&&(o===void 0||o==="")&&T("div",{className:"message-content",children:[h("div",{className:"message-icon",children:h(Z,{icon:dg})}),h("label",{children:"Drop file (or paste values) here to import"}),h("div",{className:"message-small",children:h("label",{children:"or"})}),h(U,{kind:"primary",onClick:this.handleSelectFile,children:"Select File..."})]}),s&&(o===void 0||o==="")&&T("div",{className:"selected-content",children:[h("div",{className:"selected-icon",children:h(Z,{icon:vi.getIcon(s)})}),T("div",{className:"selected-text",children:[h("label",{children:"Selected File"}),T("label",{className:"selected-name",children:[s,!n&&h(U,{kind:"ghost",className:"ml-2",onClick:this.unstageFile,icon:sn,tooltip:"Remove"})]})]})]}),Boolean(o)&&T("div",{className:"message-content",children:[h("div",{className:"message-icon",children:h(Z,{icon:Os})}),h("label",{children:o}),o===vi.FILE_TYPE_ERROR&&h("div",{className:"message-small",children:h("label",{children:this.getFileTypeErrorString(t)})})]})]})}};let es=vi;es.defaultProps={allowZip:!1,dragError:null};es.MULTIPLE_FILE_ERROR="Please select only one file";es.FILE_TYPE_ERROR="Filetype not supported.";class Me{}Me.INTEGER="int";Me.LONG="long";Me.DOUBLE="double";Me.BOOLEAN="bool";Me.STRING="string";Me.DATE_TIME="datetime";Me.LOCAL_TIME="localtime";const ic="unknown",SC=2147483647,bC=-2147483648,oc=/^[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]+)?$/,rc=/^([0-9]+T)?([0-9]+):([0-9]+)(:[0-9]+)?(?:\.[0-9]{1,9})?$/;class Nt{static determineType(e,n,s){if(!e||e===s)return n;switch(n){case Me.STRING:return Me.STRING;case Me.INTEGER:return Nt.checkInteger(e);case Me.LONG:return Nt.checkLong(e);case Me.DOUBLE:return Nt.checkDouble(e);case Me.BOOLEAN:return Nt.checkBoolean(e);case Me.DATE_TIME:return Nt.checkDateTime(e);case Me.LOCAL_TIME:return Nt.checkLocalTime(e);default:return Nt.getTypeFromUnknown(e)}}static isNotParsableNumber(e){return isNaN(e)||e==="Infinity"||e==="-Infinity"}static checkInteger(e){const n=e.replace(/,/g,"");return Nt.isNotParsableNumber(n)?Me.STRING:Nt.getNumberType(n)}static checkLong(e){const n=e.replace(/,/g,"");return Nt.isNotParsableNumber(n)?Me.STRING:n.includes(".")?Me.DOUBLE:Me.LONG}static checkDouble(e){const n=e.replace(/,/g,"");return Nt.isNotParsableNumber(n)?Me.STRING:Me.DOUBLE}static checkBoolean(e){const n=e.toLowerCase();return n==="true"||n==="false"?Me.BOOLEAN:Me.STRING}static checkDateTime(e){return oc.test(e)?Me.DATE_TIME:Me.STRING}static checkLocalTime(e){return rc.test(e)?Me.LOCAL_TIME:Me.STRING}static getTypeFromUnknown(e){const n=e.replace(/,/g,"");if(Nt.isNotParsableNumber(n)){const s=e.toLowerCase();return s==="true"||s==="false"?Me.BOOLEAN:oc.test(e)&&e.includes(":")?Me.DATE_TIME:rc.test(e)?Me.LOCAL_TIME:Me.STRING}return Nt.getNumberType(n)}static getNumberType(e){if(e.includes("."))return Me.DOUBLE;const n=e.startsWith("-")?11:10;if(e.length>n)return Me.LONG;const s=parseInt(e,10);return s>SC||s<bC?Me.LONG:Me.INTEGER}constructor(e,n,s,i,o,r,l,a,d,c){this.onFileCompleted=e,this.file=n,this.readHeaders=s,this.nullString=o,this.onProgress=r,this.onError=l,this.chunks=0,this.totalChunks=a,this.isZip=d,this.shouldTrim=c,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={...i,error:this.handleError,chunk:this.handleChunk,complete:this.handleComplete}}parse(){const e=this.isZip?this.file.nodeStream("nodebuffer",this.handleNodeUpdate):this.file;ra.parse(e,this.config)}handleChunk(e,n){let{data:s}=e;if(!this.types){if(s==null||s.length===0){n.abort(),this.onError("Error parsing CSV: no data in file.");return}this.types=new Array(s[0].length).fill(ic),this.readHeaders&&(s=s.slice(1))}k(this.types);const i=[...this.types];s.forEach(l=>{if(l.length>=i.length){for(let a=0;a<i.length;a+=1)i[a]=Nt.determineType(this.shouldTrim?l[a].trim():l[a],i[a],this.nullString);this.types=i}else n.abort(),this.onError(`Error parsing CSV: Insufficient data in row.
|
|
3
3
|
Expected length ${i.length} but found ${l.length}.
|
|
4
4
|
Row = ${l}`)}),this.chunks+=1;let o=0;this.totalChunks>0?o=Math.round(this.chunks/this.totalChunks*50):o=Math.round(this.zipProgress/2),this.onProgress(o)&&n.abort()}handleComplete(e){const{types:n,onFileCompleted:s}=this;k(n),(e==null||!e.meta.aborted)&&s(n.map(i=>i===ic?Me.STRING:i))}handleError(e){const{onError:n}=this;n(e)}handleNodeUpdate(e){this.zipProgress=e.percent}}const sr=J.module("CsvParser"),wC=650,Pr=class{static generateHeaderRecursive(t){let e="",n=t;return t>=26&&(e=e.concat(Pr.generateHeaderRecursive(Math.floor(t/26)-1)),n=t%26),e.concat(String.fromCharCode(65+n))}constructor({onFileCompleted:t,session:e,file:n,type:s,readHeaders:i=!0,onProgress:o,onError:r,timeZone:l,isZip:a}){this.onFileCompleted=t,this.session=e,this.file=n,this.isZip=a,this.type=s,this.readHeaders=i,this.timeZone=l,this.onProgress=o,this.onError=r,this.tables=[],this.chunks=0,this.totalChunks=a?0:Math.ceil(n.size/ra.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}}cancel(){this.isCancelled=!0}transpose(t,e){const n=e.length,s=new Array(t).fill(null).map(()=>new Array(n));for(let i=0;i<n;i+=1){const o=e[i];if(o.length<t)throw new Error(`Insufficient columns. Expected ${t} but found ${o.length}
|
|
@@ -34,9 +34,9 @@ ${l} does not exist yet.`}if(i){const{widgetName:r}=this.props;return`${r} is un
|
|
|
34
34
|
${Fr.makeCirclePath(s,i,ih)}
|
|
35
35
|
${Fr.makeCirclePath(o,r,ih)}`,R=`link-select-clip-${l}`,F=Math.atan2(r-v,o-w),D=F-sh+Math.PI,N=F+sh+Math.PI,P=o+Math.cos(F)*nh,H=r+Math.sin(F)*nh,A=P+Math.cos(D)*Sr,q=H+Math.sin(D)*Sr,B=P+Math.cos(N)*Sr,K=H+Math.sin(N)*Sr,x=`${P},${H} ${A},${q} ${B},${K}`,O=.25*s+.5*w+.25*o,G=.25*i+.5*v+.25*r,ee=w-s+(o-w),V=(v-i+(r-v))/ee;let X=20/Math.sqrt(1+V**2),se=X*V,ce=X*-1,Q=se*-1;Number.isFinite(V)?V>0?(X*=-1,se*=-1,ce*=-1,Q*=-1,ce-=50-10*(Math.abs(u)%ys),Q+=10*(Math.abs(u)%ys),X-=50-10*(Math.abs(u)%ys),se+=10*(Math.abs(u)%ys)):V<0?(ce+=10*(Math.abs(u)%ys),Q+=10*(Math.abs(u)%ys),X+=10*(Math.abs(u)%ys),se+=10*(Math.abs(u)%ys)):(ce=15,Q=10,X=-25,se=10):(ce=10,Q=5,X=10,se=-35);let he="";return e!==void 0&&(e==="startsWith"?he="a*":e==="endsWith"?he="*z":he=_.getFilterOperatorString(e)),T(be,{children:[T("svg",{className:Y(t,{hovering:d}),children:[h("clipPath",{id:R,children:h("path",{d:E,clipRule:"evenodd"})}),h("path",{className:"link-select",d:y,onClick:this.handleClick,onMouseEnter:this.handleMouseEnter,onMouseLeave:this.handleMouseLeave,clipPath:`url(#${R})`}),h("path",{className:"link-background",d:y}),h("path",{className:"link-foreground",d:y}),h("circle",{className:"link-dot",cx:s,cy:i,r:"5"}),h("polygon",{className:"link-triangle",points:x})]}),a!=null&&n&&T(be,{children:[h(U,{kind:"primary",className:"btn-fab btn-operator",style:{top:G+(V>=0?se:Q),left:O+(V>=0?X:ce)},onClick:()=>{},icon:T("div",{className:"fa-md fa-layers",children:[h("b",{children:he}),h(Z,{icon:ts,transform:"right-8 down-9 shrink-5"})]}),tooltip:"Change comparison operator",children:h(ns,{actions:this.getDropdownActions,popperOptions:{placement:"bottom-start"}})}),h(U,{kind:"primary",className:"btn-fab btn-delete",style:{top:G+(V<0?se:Q),left:O+(V<0?X:ce)},onClick:this.handleDelete,icon:sn,tooltip:"Delete"})]})]})}};let Xm=Fr;Xm.defaultProps={className:"",isSelected:!1,onClick(){},onDelete(){}};const sa=J.module("LinkerOverlayContent");class jm extends b.exports.Component{constructor(e){super(e),this.handleBlur=this.handleBlur.bind(this),this.handleResize=this.handleResize.bind(this),this.handleMouseMove=this.handleMouseMove.bind(this),this.handleMouseDown=this.handleMouseDown.bind(this),this.handleMouseUp=this.handleMouseUp.bind(this),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleKeyUp=this.handleKeyUp.bind(this),this.handleEscapePressed=this.handleEscapePressed.bind(this),this.handleOperatorChanged=this.handleOperatorChanged.bind(this),this.dialogRef=de.createRef(),this.state={mouse:void 0,dialog:void 0,offset:{x:0,y:0},isDragging:!1,mode:"select"}}componentDidMount(){window.addEventListener("blur",this.handleBlur,!0),window.addEventListener("mousemove",this.handleMouseMove,!0),window.addEventListener("mouseup",this.handleMouseUp,!0),window.addEventListener("keydown",this.handleKeyDown,!0),window.addEventListener("keyup",this.handleKeyUp,!0),window.addEventListener("resize",this.handleResize,!0)}componentDidCatch(e,n){sa.error("componentDidCatch",e,n)}componentWillUnmount(){window.removeEventListener("blur",this.handleBlur,!0),window.removeEventListener("mousemove",this.handleMouseMove,!0),window.removeEventListener("mouseup",this.handleMouseUp,!0),window.removeEventListener("keydown",this.handleKeyDown,!0),window.removeEventListener("keyup",this.handleKeyUp,!0),window.removeEventListener("resize",this.handleResize,!0)}getPointFromLinkPoint(e){const{panelManager:n}=this.props,{panelId:s,columnName:i}=e,o=n.getOpenedPanelById(s);if(o!=null){if(!zm(o))throw new Error(`Panel does not have getCoordinateForColumn method: ${s}`);try{const l=o.getCoordinateForColumn(i);if(l!=null)return l}catch{sa.error("Could not get coordinate for column",i,o)}}const r=n.getContainerByPanelId(s);if(r==null)throw new Error(`Unable to find panel container for id: ${s}`);return ie.getTabPoint(r)}handleOperatorChanged(e,n){const{links:s,onLinksUpdated:i}=this.props,o=s.map(r=>r.id===e?{...r,operator:n}:r);i(o)}handleBlur(){this.setState({mode:"select"})}handleResize(){const{dialog:e}=this.state;if(e&&this.dialogRef.current){const n=this.dialogRef.current.getBoundingClientRect(),s=Ze(e.x,0,window.innerWidth-n.width),i=Ze(e.y,0,window.innerHeight-n.height);this.setState({dialog:{x:s,y:i}})}}handleMouseMove(e){const{offset:n,isDragging:s}=this.state;if(this.setState({mouse:{x:e.clientX,y:e.clientY}}),s&&this.dialogRef.current){const i=this.dialogRef.current.getBoundingClientRect(),o=Ze(window.innerWidth-(e.clientX+i.width+n.x),0,window.innerWidth-i.width),r=Ze(window.innerHeight-(e.clientY+i.height+n.y),0,window.innerHeight-i.height);this.setState({dialog:{x:o,y:r}})}}handleMouseDown(e){const n={x:0,y:0};if(this.dialogRef.current){const s=this.dialogRef.current.getBoundingClientRect();n.x=s.right-(s.width+e.clientX),n.y=s.bottom-(s.height+e.clientY)}this.setState({isDragging:!0,offset:n})}handleMouseUp(){this.setState({isDragging:!1})}handleKeyDown(e){if(e.key==="Alt")e.preventDefault(),this.setState({mode:"delete"});else if(e.key==="Delete"||e.key==="Backspace"){const{selectedIds:n,onLinkDeleted:s}=this.props;e.preventDefault(),n.forEach(i=>s(i))}}handleKeyUp(e){e.key==="Alt"&&(e.preventDefault(),this.setState({mode:"select"}))}handleEscapePressed(){const{onCancel:e}=this.props;e()}render(){const{disabled:e,links:n,selectedIds:s,messageText:i,onLinkSelected:o,onLinkDeleted:r,onAllLinksDeleted:l,onDone:a}=this.props,{mouse:d,dialog:c,isDragging:u,mode:m}=this.state,p=n.map(g=>{try{const{id:f,type:C,isReversed:S,start:w,end:v,operator:y}=g,E=w.columnType;let[R,F]=this.getPointFromLinkPoint(w),D=d?.x??R,N=d?.y??F;if(v!=null&&([D,N]=this.getPointFromLinkPoint(v)),S!=null&&S){const[H,A]=[R,F];[R,F]=[D,N],[D,N]=[H,A]}const P=Y("linker-link",{disabled:e},{"link-filter-source":C==="filterSource"},{"link-invalid":C==="invalid"},{interactive:g.end==null},{"link-is-selected":s.has(f)},{"danger-delete":m==="delete"});return{x1:R,y1:F,x2:D,y2:N,id:f,className:P,operator:y,startColumnType:E}}catch(f){return sa.warn("Unable to get point for link",g,f),null}}).filter(g=>g!=null);return T("div",{className:Y("linker-overlay",{"danger-delete":m==="delete"}),children:[p.map(({x1:g,y1:f,x2:C,y2:S,id:w,className:v,operator:y,startColumnType:E})=>h(Xm,{className:v,id:w,x1:g,y1:f,x2:C,y2:S,onClick:o,onDelete:r,isSelected:s.has(w),operator:y,startColumnType:E,onOperatorChanged:this.handleOperatorChanged},w)),T("div",{className:Y("linker-toast-dialog",{dragging:u}),ref:this.dialogRef,style:{bottom:c?.y,right:c?.x},children:[h(U,{draggable:!0,kind:"inline",className:"btn-drag-handle",icon:el,onClick:()=>{},onMouseDown:this.handleMouseDown,children:!u&&h(ut,{children:"Drag to reposition"})}),h("div",{className:"toast-body",children:i}),T("div",{className:"toast-footer",children:[h(U,{kind:"secondary",onClick:l,children:"Clear All"}),h(U,{kind:"primary",onClick:a,children:"Done"})]})]}),h(le,{actions:[{action:this.handleEscapePressed,shortcut:ls.LINKER_CLOSE,isGlobal:!0}]})]})}}jm.defaultProps={disabled:"false"};const Dt=J.module("Linker"),hy=(t,e)=>({activeTool:pl(t),isolatedLinkerPanelId:Td(t,e.localDashboardId),links:Ki(t,e.localDashboardId),timeZone:ko(t)}),uy=vt(hy,{setActiveTool:fl,setDashboardLinks:Ed,addDashboardLinks:fE,deleteDashboardLinks:CE,setDashboardIsolatedLinkerPanelId:Lm,setDashboardColumnSelectionValidator:SE});class my extends b.exports.Component{constructor(e){super(e),this.getCachedLinks=ge((n,s,i)=>{const o=[...n];return s!=null&&s.start!=null&&o.push(s),i!==void 0?o.filter(r=>r?.start?.panelId===i||r?.end?.panelId===i||r?.end==null):o}),this.handleCancel=this.handleCancel.bind(this),this.handleDone=this.handleDone.bind(this),this.handlePanelCloned=this.handlePanelCloned.bind(this),this.handleFilterColumnSelect=this.handleFilterColumnSelect.bind(this),this.handleColumnsChanged=this.handleColumnsChanged.bind(this),this.handlePanelClosed=this.handlePanelClosed.bind(this),this.handleLayoutStateChanged=this.handleLayoutStateChanged.bind(this),this.handleAllLinksDeleted=this.handleAllLinksDeleted.bind(this),this.handleLinkDeleted=this.handleLinkDeleted.bind(this),this.handleLinksUpdated=this.handleLinksUpdated.bind(this),this.handleChartColumnSelect=this.handleChartColumnSelect.bind(this),this.handleGridColumnSelect=this.handleGridColumnSelect.bind(this),this.handleUpdateValues=this.handleUpdateValues.bind(this),this.handleStateChange=this.handleStateChange.bind(this),this.handleExited=this.handleExited.bind(this),this.handleLinkSelected=this.handleLinkSelected.bind(this),this.handlePanelDragging=this.handlePanelDragging.bind(this),this.handlePanelDropped=this.handlePanelDropped.bind(this),this.isColumnSelectionValid=this.isColumnSelectionValid.bind(this),this.state={linkInProgress:void 0,selectedIds:new Set,isDraggingPanel:!1}}componentDidMount(){const{layout:e}=this.props;this.startListening(e),this.updateSelectionValidators()}componentDidUpdate(e){const{activeTool:n,layout:s}=this.props;s!==e.layout&&(this.stopListening(e.layout),this.startListening(s)),n!==e.activeTool&&(this.updateSelectionValidators(),n===Wt.DEFAULT&&this.reset())}componentDidCatch(e,n){Dt.error("componentDidCatch",e,n)}componentWillUnmount(){const{layout:e}=this.props;this.stopListening(e)}startListening(e){e.on("stateChanged",this.handleLayoutStateChanged);const{eventHub:n}=e;n.on(wt.COLUMN_SELECTED,this.handleGridColumnSelect),n.on(wt.DATA_SELECTED,this.handleUpdateValues),n.on(wt.STATE_CHANGED,this.handleStateChange),n.on(Li.COLUMN_SELECTED,this.handleChartColumnSelect),n.on(Ee.CLONED,this.handlePanelCloned),n.on(Le.COLUMN_SELECTED,this.handleFilterColumnSelect),n.on(Le.COLUMNS_CHANGED,this.handleColumnsChanged),n.on(Ee.CLOSE,this.handlePanelClosed),n.on(Ee.CLOSED,this.handlePanelClosed),n.on(Ee.DRAGGING,this.handlePanelDragging),n.on(Ee.DROPPED,this.handlePanelDropped)}stopListening(e){e.off("stateChanged",this.handleLayoutStateChanged);const{eventHub:n}=e;n.off(wt.COLUMN_SELECTED,this.handleGridColumnSelect),n.off(wt.DATA_SELECTED,this.handleUpdateValues),n.off(wt.STATE_CHANGED,this.handleStateChange),n.off(Li.COLUMN_SELECTED,this.handleChartColumnSelect),n.off(Ee.CLONED,this.handlePanelCloned),n.off(Le.COLUMN_SELECTED,this.handleFilterColumnSelect),n.off(Le.COLUMNS_CHANGED,this.handleColumnsChanged),n.off(Ee.CLOSE,this.handlePanelClosed),n.off(Ee.CLOSED,this.handlePanelClosed),n.off(Ee.DRAGGING,this.handlePanelDragging),n.off(Ee.DROPPED,this.handlePanelDropped)}reset(){this.setState({linkInProgress:void 0,selectedIds:new Set})}handleCancel(){const{linkInProgress:e}=this.state;if(e==null){const{setActiveTool:n}=this.props;n(Wt.DEFAULT)}this.setState({linkInProgress:void 0})}handleDone(){const{setActiveTool:e}=this.props;e(Wt.DEFAULT)}handleChartColumnSelect(e,n){this.columnSelected(e,n,!0)}handleFilterColumnSelect(e,n){Dt.debug("handleFilterColumnSelect",this.isOverlayShown());const{links:s,localDashboardId:i,setActiveTool:o,setDashboardIsolatedLinkerPanelId:r}=this.props,l=ie.getIdFromPanel(e),a=s.filter(d=>d.start?.panelId===l||d.end?.panelId===l);if(!this.isOverlayShown()&&l!=null){o(Wt.LINKER),r(i,l),a.length===0&&this.columnSelected(e,n,!0,l);return}this.columnSelected(e,n,!0)}handleColumnsChanged(e,n){Dt.debug("handleColumnsChanged",e,n);const{links:s}=this.props,i=ie.getIdFromPanel(e);if(i==null){Dt.error("Invalid panelId",e);return}const o=s.filter(({start:r,end:l})=>r.panelId===i&&Js.findColumn(n,r)==null||l!=null&&l.panelId===i&&Js.findColumn(n,l)==null);this.deleteLinks(o)}handleGridColumnSelect(e,n){if(!Jc(n)){Dt.debug2("Column is not filterable");return}this.columnSelected(e,n)}columnSelected(e,n,s=!1,i){if(i===void 0&&!this.isOverlayShown())return;const{isolatedLinkerPanelId:o}=this.props,{linkInProgress:r}=this.state,l=ie.getIdFromPanel(e);if(l==null)return;const a=ie.getComponentNameFromPanel(e),{name:d,type:c}=n;if(r==null||r.start==null){const u={id:$e.generate(),start:{panelId:l,panelComponent:a,columnName:d,columnType:c},type:"invalid",isReversed:s};Dt.debug("starting link",u),this.setState({linkInProgress:u})}else{const{links:u}=this.props,{start:m,id:p,isReversed:g}=r,f={panelId:l,panelComponent:a,columnName:d,columnType:c},C=Js.getLinkType(g!==void 0&&g?f:m,g!==void 0&&g?m:f,i??o);switch(C){case"invalid":Dt.debug("Ignore invalid link connection",r,f);return;case"filterSource":{const w=g!==void 0&&g?m.panelId:f.panelId,v=u.filter(({end:y})=>y?.panelId===w);this.deleteLinks(v);break}}const S={start:g!==void 0&&g?f:m,end:g!==void 0&&g?m:f,id:p,type:C,operator:$.eq};Dt.info("creating link",S),this.setState({linkInProgress:void 0,selectedIds:new Set([p])},()=>{this.addLinks([S])})}}unsetFilterValueForLink(e){const{panelManager:n}=this.props;if(e.end){const{end:s}=e,{panelId:i,columnName:o,columnType:r}=s,l=n.getOpenedPanelById(i);l?Zc(l)?l.unsetFilterValue(o,r):Dt.debug("endPanel.unsetFilterValue not implemented",l):Dt.debug("endPanel no longer exists, ignoring unsetFilterValue",i)}}setPanelFilterMap(e,n){Dt.debug("Set filter data for panel:",e,n);const{panelManager:s}=this.props,i=s.getOpenedPanelById(e);i?Zc(i)?i.setFilterMap(n):Dt.debug("panel.setFilterMap not implemented",e,i):Dt.debug("panel no longer exists, ignoring setFilterMap",e)}addLinks(e){const{addDashboardLinks:n,localDashboardId:s}=this.props;n(s,e)}deleteLinks(e,n=!1){const{localDashboardId:s}=this.props;if(e.forEach(i=>this.unsetFilterValueForLink(i)),n){const{setDashboardLinks:i}=this.props;i(s,[])}else if(e.length>0){const{deleteDashboardLinks:i}=this.props;i(s,e.map(({id:o})=>o))}}handleAllLinksDeleted(){const{links:e,isolatedLinkerPanelId:n}=this.props;if(n===void 0)this.deleteLinks(e,!0);else{const s=e.filter(i=>i?.start?.panelId===n||i?.end?.panelId===n);this.deleteLinks(s)}this.reset()}handleLinkDeleted(e){const{links:n}=this.props,s=n.find(i=>i.id===e);s?this.deleteLinks([s]):Dt.error("Unable to find link to delete",e)}handleUpdateValues(e,n){const s=ie.getIdFromPanel(e),{links:i,timeZone:o}=this.props,r=new Map;for(let l=0;l<i.length;l+=1){const{start:a,end:d,operator:c}=i[l];if(a.panelId===s&&d!=null){const{panelId:u,columnName:m,columnType:p}=d,g=r.has(u)?r.get(u):new Map,f=g.has(m)===!0?g.get(m).filterList:[],{visibleIndex:C,isExpandable:S,isGrouped:w}=n[a.columnName];let{value:v}=n[a.columnName],y=`${v}`;v===null&&S&&w&&(v=void 0),p!=null&&_.isDateType(p)&&(y=new st({timeZone:o,showTimeZone:!1,showTSeparator:!0,defaultDateTimeFormatString:Hn.FULL_DATE_FORMAT}).format(v));const E={operator:c,text:y,value:v,startColumnIndex:C};f.push(E),g.set(m,{columnType:p,filterList:f}),r.set(u,g)}}r.forEach((l,a)=>{this.setPanelFilterMap(a,l)})}handlePanelCloned(e,n){const{links:s}=this.props,i=ie.getIdFromPanel(e),o=n.id;if(i!=null){const r=Js.cloneLinksForPanel(s,i,o);this.addLinks(r)}}handlePanelDragging(e){const{links:n}=this.props;for(let s=0;s<n.length;s+=1){const i=n[s],{start:o,end:r}=i;if(o.panelId===e||r?.panelId===e){this.setState({isDraggingPanel:!0});return}}}handlePanelDropped(){this.setState({isDraggingPanel:!1})}handlePanelClosed(e){Dt.debug(`Panel ${e} closed, deleting links.`),this.deleteLinksForPanelId(e)}handleLinkSelected(e){this.setState({selectedIds:new Set([e])})}handleLinksUpdated(e){const{localDashboardId:n,setDashboardLinks:s}=this.props;s(n,e)}handleLayoutStateChanged(){this.forceUpdate()}handleStateChange(){this.forceUpdate()}handleExited(){const{localDashboardId:e,setDashboardIsolatedLinkerPanelId:n}=this.props;n(e,void 0)}deleteLinksForPanelId(e){const{links:n}=this.props;for(let s=0;s<n.length;s+=1){const i=n[s],{start:o,end:r,id:l}=i;(o.panelId===e||r?.panelId===e)&&this.handleLinkDeleted(l)}}isOverlayShown(){const{activeTool:e}=this.props;return e===Wt.LINKER}updateSelectionValidators(){const{activeTool:e,setDashboardColumnSelectionValidator:n,localDashboardId:s}=this.props;switch(e){case Wt.LINKER:n(s,this.isColumnSelectionValid);break;default:n(s,void 0);break}}updateLinkInProgressType(e,n="invalid"){this.setState({linkInProgress:{...e,type:n}})}isColumnSelectionValid(e,n){const{linkInProgress:s}=this.state,{isolatedLinkerPanelId:i}=this.props;if(n==null)return s?.start!=null&&this.updateLinkInProgressType(s),!1;if(!Jc(n))return Dt.debug2("Column is not filterable",n.description),s?.start!=null&&this.updateLinkInProgressType(s,"invalid"),!1;if(s?.start==null)return!0;const{isReversed:o,start:r}=s,l=ie.getIdFromPanel(e);if(l==null)return!1;const a={panelId:l,panelComponent:ie.getComponentNameFromPanel(e),columnName:n.name,columnType:n.type},d=o!==void 0&&o?Js.getLinkType(a,r,i):Js.getLinkType(r,a,i);return this.updateLinkInProgressType(s,d),d!=="invalid"}render(){const{links:e,isolatedLinkerPanelId:n,panelManager:s}=this.props,{linkInProgress:i,selectedIds:o,isDraggingPanel:r}=this.state,l=this.isOverlayShown(),a=i!=null&&i.start!=null,d=n===void 0?"Click a column source, then click a column target to create a filter link. The filter comparison operator used by a selected link can be changed. Delete a filter link by clicking the delete button or with alt+click. Click done when finished.":"Create a link between the source column button and a table column by clicking on one, then the other. Delete a filter link by clicking the delete button or with alt+click. Click done when finished.";return r?null:h(Ht,{in:l,timeout:Xe.transitionMs,classNames:"fade",mountOnEnter:!0,unmountOnExit:!0,onExited:this.handleExited,children:h(jm,{disabled:a,panelManager:s,links:this.getCachedLinks(e,i,n),selectedIds:o,messageText:d,onLinkSelected:this.handleLinkSelected,onLinkDeleted:this.handleLinkDeleted,onAllLinksDeleted:this.handleAllLinksDeleted,onLinksUpdated:this.handleLinksUpdated,onDone:this.handleDone,onCancel:this.handleCancel})})}}const py=uy(my);function gy(t){Ps(t);const{id:e,layout:n,panelManager:s}=t;return h(py,{layout:n,localDashboardId:e,panelManager:s})}const Na=class{static getNewMarkdownTitle(t){let e=`${Na.DEFAULT_TITLE}`,n=0;for(;t.indexOf(e)>=0;)n+=1,e=`${Na.DEFAULT_TITLE}-${n}`;return e}};let yo=Na;yo.DEFAULT_TITLE="Note";yo.DEFAULT_CONTENT=`# Markdown Note
|
|
36
36
|
|
|
37
|
-
This note can be edited using **markdown** for styling.`;function fy(t){Ps(t);const{id:e,layout:n,panelManager:s,registerComponent:i}=t,o=b.exports.useCallback(l=>{const{title:a,componentState:d,props:c}=l;let{panelState:u=null}=c;return d!=null&&({panelState:u=null}=d),a==null||u==null||u.content==null||u.content.length===0||u.content===yo.DEFAULT_CONTENT?null:nd(l)},[]),r=b.exports.useCallback(({title:l="",metadata:a={},id:d=$e.generate(),focusElement:c=ie.DEFAULT_FOCUS_SELECTOR,createNewStack:u=!1,dragEvent:m=null}={})=>{const p=s.getOpenedPanelConfigsOfType(co.COMPONENT),g=s.getClosedPanelConfigsOfType(co.COMPONENT),f=p.map(y=>y.title??""),C=l!=null&&l!==""?l:yo.getNewMarkdownTitle(f),S=g.length>0?null:yo.DEFAULT_CONTENT,w={type:"react-component",component:co.COMPONENT,props:{id:d,metadata:a,panelState:{content:S},localDashboardId:e},title:C,id:d},{root:v}=n;ie.openComponent({root:v,config:w,focusElement:c,createNewStack:u,dragEvent:m})},[e,n,s]);return b.exports.useEffect(function(){const a=[i(co.COMPONENT,co,sd,o)];return()=>{a.forEach(d=>d())}},[o,i]),Be(n.eventHub,km.OPEN,r),null}function Cy(t){Ps(t);const{hydrate:e,id:n,layout:s,registerComponent:i}=t,o=b.exports.useCallback(({dragEvent:r,fetch:l,panelId:a=$e.generate(),widget:d})=>{const{name:c,type:u}=d;if(u!==dh.VariableType.PANDAS)return;const m={name:c,table:c},p=()=>l().then(C=>Cd.makeModel(C)),g={type:"react-component",component:Eo.COMPONENT,props:{localDashboardId:n,id:a,metadata:m,makeModel:p},title:c,id:a},{root:f}=s;ie.openComponent({root:f,config:g,dragEvent:r})},[n,s]);return b.exports.useEffect(function(){const l=[i(Eo.COMPONENT,Eo,e)];return()=>{l.forEach(a=>a())}},[e,i]),Be(s.eventHub,Ee.OPEN,o),null}class un{}un.DROPDOWN_FILTER="ControlType.DROPDOWN_FILTER";un.INPUT_FILTER="ControlType.INPUT_FILTER";un.MARKDOWN="ControlType.MARKDOWN";un.FILTER_SET_MANAGER="ControlType.FILTER_SET_MANAGER";const Sy=M.exports.shape({state:M.exports.shape({panelState:M.exports.shape({})})}),by=M.exports.shape({panelId:M.exports.string.isRequired,columnName:M.exports.string.isRequired,columnType:M.exports.string.isRequired}),oh=M.exports.shape({panelId:M.exports.string.isRequired,columnName:M.exports.string.isRequired}),Qm=M.exports.shape({start:oh,end:oh,id:M.exports.string,isReversed:M.exports.bool}),wy=M.exports.arrayOf(Qm),Ty=M.exports.shape({name:M.exports.string.isRequired,operateAs:M.exports.string.isRequired,groups:M.exports.arrayOf(M.exports.string).isRequired,permissions:M.exports.shape({isSuperUser:M.exports.bool.isRequired,isQueryViewOnly:M.exports.bool.isRequired,isNonInteractive:M.exports.bool.isRequired,canUsePanels:M.exports.bool.isRequired,canCreateDashboard:M.exports.bool.isRequired,canCreateCodeStudio:M.exports.bool.isRequired,canCreateQueryMonitor:M.exports.bool.isRequired,canCopy:M.exports.bool.isRequired,canDownloadCsv:M.exports.bool.isRequired}).isRequired});Object.freeze({LinkPoint:by,Link:Qm,Links:wy,Panel:Sy,User:Ty});const vy=(t,e)=>t[e]===null?null:M.exports.bool,Ey=(t,e)=>t[e]===null?null:M.exports.string;Object.freeze({nullableBoolean:vy,nullableString:Ey});J.module("StorageTableViewportUpdater");class rh{static makeSortConfig(e,n){return{column:e,direction:n}}static makeFilterConfig(e){const n=[],s=[];return e.forEach((i,o)=>{n.push(i),o>0&&s.push(zt.and)}),{filterItems:n,filterOperators:s}}static combineFilterConfigs(e,n,s=zt.and){return{filterItems:[...e.filterItems,...n.filterItems],filterOperators:[...e.filterOperators,s,...n.filterOperators]}}static makeFilterItem(e,n,s){return{columnName:e,type:n,value:s}}}const ia=J.module("PouchStorageTable"),yy="Deephaven.";Ch.plugin(Gp);function Ry(t,e){switch(t){case $.in:case $.contains:return{$regex:new RegExp(`${e}`)};case $.inIgnoreCase:return{$regex:new RegExp(`${e}`,"i")};case $.eq:return{$eq:e};case $.notEq:return{$neq:e};case $.greaterThan:return{$gt:e};case $.greaterThanOrEqualTo:return{$gte:e};case $.lessThan:return{$lt:e};case $.lessThanOrEqualTo:return{$lte:e};case $.startsWith:return{$regex:new RegExp(`^(?${e}).*`)};default:throw new Error(`Unsupported type: ${t}`)}}function Iy(t){const{filterItems:e,filterOperators:n}=t;let s=null;for(let i=0;i<e.length;i+=1){const o=e[i],{columnName:r,type:l,value:a}=o,d={[r]:Ry(l,a)};if(i===0)s=d;else if(s!==null&&i-1<n.length){const c=n[i-1];if(c===zt.and)s={$and:[s,d]};else if(c===zt.or)s={$or:[s,d]};else throw new Error(`Unexpected filter operator ${c}, ${d}`)}}if(s==null)throw new Error(`Invalid filter config ${t}`);return s}function oa(t=[]){return{$and:[...t.map(e=>Iy(e)),{name:{$gt:null}},{id:{$gt:null}}]}}function Fy(t,e=!1){return[{id:e?"desc":"asc"},...t?.map(n=>({[n.column]:n.direction}))??[]]}class Dy{constructor(e){this.listeners=[],this.itemListeners=new Map,this.currentSize=0,this.currentReverse=!1,this.currentFilter=null,this.currentSort=null,this.db=new Ch(`${yy}${e}`),this.db._remote=!1,this.db.changes({live:!0,since:"now",include_docs:!0}).on("change",this.dbUpdate.bind(this)),this.db.createIndex({index:{fields:["id","name"]}}),this.refreshInfo()}onUpdate(e){return this.listeners=[...this.listeners,e],()=>{this.listeners=this.listeners.filter(n=>n!==e)}}onItemUpdate(e,n){return this.itemListeners.has(e)||this.itemListeners.set(e,[]),this.itemListeners.set(e,[...this.itemListeners.get(e),n]),this.refreshItem(e),()=>{this.itemListeners.set(e,this.itemListeners.get(e).filter(s=>s!==n))}}close(){this.listeners=[]}get size(){return this.currentSize}get viewport(){return this.currentViewport}setReversed(e){this.currentReverse=e,this.currentViewportData=void 0,this.refreshData()}setViewport(e){this.currentViewport=e,this.refreshInfo(),this.refreshData()}setSorts(e){this.currentSort=e,this.currentViewportData=void 0,this.refreshData()}setFilters(e){this.currentFilter=e,this.currentViewportData=void 0,this.refreshInfo(),this.refreshData()}get data(){return this.currentViewportData}async getViewportData(){return this.viewportUpdatePromise||this.refreshData(),this.viewportUpdatePromise??Promise.resolve({items:[],offset:0})}async put(e){const n={...e,_id:e.id};return await this.db.put(n),n}sendUpdate(){const{listeners:e}=this,n=this.currentViewportData??{items:[],offset:0};for(let s=0;s<e.length;s+=1)e[s](n)}sendItemUpdate(e){const n=this.itemListeners.get(e.id);if(n!==void 0)for(let s=0;s<n.length;s+=1)n[s](e)}dbUpdate(e){ia.debug("Update received",e),this.refreshInfo(),e.doc!==void 0&&this.sendItemUpdate(e.doc),this.refreshData()}async refreshInfo(){try{this.infoUpdatePromise?.cancel(),this.infoUpdatePromise=ye.makeCancelable(this.db.find({selector:oa(this.currentFilter??[]),fields:[]}));const e=await this.infoUpdatePromise;this.currentSize=e.docs.length,this.sendUpdate()}catch(e){if(!ye.isCanceled(e))throw ia.error("Unable to refreshInfo",e),e}}async refreshData(){if(!!this.currentViewport)try{const{currentViewport:e}=this,n=Fy(this.currentSort,this.currentReverse);this.viewportUpdatePromise?.cancel(),this.viewportUpdatePromise=ye.makeCancelable(this.db.find({selector:oa(this.currentFilter??[]),skip:e.top,limit:e.bottom-e.top+1,sort:n,fields:["id","name"]}).then(i=>({items:i.docs,offset:e.top})));const s=await this.viewportUpdatePromise;return this.currentViewportData=s,this.sendUpdate(),s}catch(e){if(!ye.isCanceled(e))throw ia.error("Unable to refreshData",e),e}}async refreshItem(e){const s=(await this.db.find({selector:{id:e},limit:1})).docs[0];return s!==void 0&&this.sendItemUpdate(s),s}async getSnapshot(e){const n=new Map,s=[{id:this.currentReverse?"desc":"asc"}];return await Promise.all(e.map(async([i,o])=>{const r=o-i+1;return this.db.find({selector:oa(this.currentFilter??[]),skip:i,limit:r,sort:s,fields:["id","name"]}).then(l=>{for(let a=0;a<r;a+=1){const d=i+a;n.set(d,l.docs[a])}})})),n}}class lh extends Dy{constructor(e){super(`CommandHistoryStorage.${e}`)}setSearch(e){this.setFilters(e?[rh.makeFilterConfig([rh.makeFilterItem("name",$.contains,e)])]:[])}}const ah=J.module("PouchCommandHistoryStorage");class Ny{constructor(){this.updateTableMap=new Map}getUpdateTable(e){return this.updateTableMap.has(e)||this.updateTableMap.set(e,new lh(e)),this.updateTableMap.get(e)}async getTable(e){return new lh(e)}async addItem(e,n,s,i){return this.updateItem(e,{id:`${new Date().getTime()}`,name:s,data:i})}async updateItem(e,n){const s=this.getUpdateTable(e),o={...await s.refreshItem(n.id)??{},...n};return ah.debug("Updating item",o),await s.put(o),ah.debug("Update saved"),n}listenItem(e,n,s){return this.getUpdateTable(e).onItemUpdate(n,s)}}const Zm="SET_LAYOUT_STORAGE",_y=t=>({type:Zm,payload:t}),Jm="/ide/assets/community-wordmark-app.d2c5c1eb.svg";const My=J.module("FormattingSectionContent");function ky(t){return t.formatString!=null}function _a(t){const e=t?.querySelector("input, select, textarea");e&&e.focus()}function ep(t,e){return t.defaultFormatString===e.defaultFormatString}function xy(t,e){return ep(t,e)}function Oy(t,e){return ep(t,e)}function tp(t){return t!==""&&Vi.isValidColumnName(t)}function Ms(t,e){if(!t||e.formatString==null||!ky(e))return!1;switch(t){case"datetime":return st.isValid(e);case"decimal":return ke.isValid(e);case"int":return Qe.isValid(e);default:return My.warn("Trying to validate format of unknown type"),!0}}function np(t){const{id:e,isNewRule:n,...s}=t;return s}function sp(t){return tp(t.columnName)&&Ms(t.columnType,t.format)}function ip(t){const{timestamp:e,timeZone:n,showTimeZone:s,showTSeparator:i,isGlobalOptions:o,legacyGlobalFormat:r}=t,l=new nn([],{timeZone:n,showTimeZone:s,showTSeparator:i}),a=o?st.getGlobalFormats(s,i):st.getFormats(s,i);return r!=null&&!a.includes(r)&&a.unshift(r),h(be,{children:a.map(d=>{const c=st.makeFormat("",d,st.TYPE_GLOBAL);return h("option",{value:d,"data-testid":"time-format",children:l.getFormattedString(e,_.dataType.DATETIME,"",c)},d)})})}function Ay(){return h(be,{children:Qr.TIME_ZONES.map(t=>{const{label:e,value:n}=t;return h("option",{value:n,children:e},n)})})}const Ys=J.module("FormattingSectionContent"),op=class extends b.exports.PureComponent{constructor(t){super(t),this.getCachedDateTimeFormatOptions=Ie((c,u,m,p=!1,g)=>{const{timestampAtMenuOpen:f}=this.state;return h(ip,{timestamp:f,timeZone:c,showTimeZone:u,showTSeparator:m,isGlobalOptions:p,legacyGlobalFormat:g})}),this.debouncedCommitChanges=Je(this.commitChanges.bind(this),op.inputDebounceTime),this.handleDefaultDateTimeFormatChange=this.handleDefaultDateTimeFormatChange.bind(this),this.handleDefaultDecimalFormatChange=this.handleDefaultDecimalFormatChange.bind(this),this.handleDefaultIntegerFormatChange=this.handleDefaultIntegerFormatChange.bind(this),this.handleShowTimeZoneChange=this.handleShowTimeZoneChange.bind(this),this.handleShowTSeparatorChange=this.handleShowTSeparatorChange.bind(this),this.handleTimeZoneChange=this.handleTimeZoneChange.bind(this),this.handleResetDateTimeFormat=this.handleResetDateTimeFormat.bind(this),this.handleResetDecimalFormat=this.handleResetDecimalFormat.bind(this),this.handleResetIntegerFormat=this.handleResetIntegerFormat.bind(this),this.handleResetTimeZone=this.handleResetTimeZone.bind(this),this.handleTruncateNumbersWithPoundChange=this.handleTruncateNumbersWithPoundChange.bind(this);const{formatter:e,defaultDateTimeFormat:n,defaultDecimalFormatOptions:s,defaultIntegerFormatOptions:i,showTimeZone:o,showTSeparator:r,timeZone:l,truncateNumbersWithPound:a}=t,d=e.map((c,u)=>({...c,id:u}));this.containerRef=de.createRef(),this.state={formatSettings:d,showTimeZone:o,showTSeparator:r,timeZone:l,defaultDateTimeFormat:n,defaultDecimalFormatOptions:s,defaultIntegerFormatOptions:i,truncateNumbersWithPound:a,timestampAtMenuOpen:new Date}}componentDidMount(){_a(this.containerRef.current)}componentWillUnmount(){this.debouncedCommitChanges.flush()}handleDefaultDateTimeFormatChange(t){Ys.debug("handleDefaultDateTimeFormatChange",t.target.value),this.setState({defaultDateTimeFormat:t.target.value},()=>{this.debouncedCommitChanges()})}handleDefaultDecimalFormatChange(t){Ys.debug("handleDefaultDecimalFormatChange",t.target.value),this.setState({defaultDecimalFormatOptions:{defaultFormatString:t.target.value}},()=>{this.debouncedCommitChanges()})}handleDefaultIntegerFormatChange(t){Ys.debug("handleDefaultIntegerFormatChange",t.target.value),this.setState({defaultIntegerFormatOptions:{defaultFormatString:t.target.value}},()=>{this.debouncedCommitChanges()})}handleShowTimeZoneChange(){this.setState(t=>({showTimeZone:!t.showTimeZone}),()=>{this.debouncedCommitChanges()})}handleShowTSeparatorChange(){this.setState(t=>({showTSeparator:!t.showTSeparator}),()=>{this.debouncedCommitChanges()})}handleTimeZoneChange(t){this.setState({timeZone:t.target.value},()=>{this.debouncedCommitChanges()})}handleResetDateTimeFormat(){const{defaults:t}=this.props,{defaultDateTimeFormat:e,showTimeZone:n,showTSeparator:s}=t;Ys.debug("handleResetDateTimeFormat"),this.setState({defaultDateTimeFormat:e,showTimeZone:n,showTSeparator:s},()=>{this.debouncedCommitChanges()})}handleResetTimeZone(){const{defaults:t}=this.props,{timeZone:e}=t;Ys.debug("handleResetTimeZone"),this.setState({timeZone:e},()=>{this.debouncedCommitChanges()})}handleResetDecimalFormat(){const{defaults:t}=this.props,{defaultDecimalFormatOptions:e}=t;Ys.debug("handleResetDecimalFormat"),this.setState({defaultDecimalFormatOptions:e},()=>{this.debouncedCommitChanges()})}handleResetIntegerFormat(){const{defaults:t}=this.props,{defaultIntegerFormatOptions:e}=t;Ys.debug("handleResetIntegerFormat"),this.setState({defaultIntegerFormatOptions:e},()=>{this.debouncedCommitChanges()})}handleTruncateNumbersWithPoundChange(){this.setState(t=>({truncateNumbersWithPound:!t.truncateNumbersWithPound}),()=>{this.debouncedCommitChanges()})}commitChanges(){const{formatSettings:t,defaultDateTimeFormat:e,showTimeZone:n,showTSeparator:s,timeZone:i,defaultDecimalFormatOptions:o,defaultIntegerFormatOptions:r,truncateNumbersWithPound:l}=this.state,a=t.filter(sp).map(np)??[],{settings:d,saveSettings:c}=this.props,u={...d,formatter:a,defaultDateTimeFormat:e,showTimeZone:n,showTSeparator:s,timeZone:i,truncateNumbersWithPound:l};Ms(_.dataType.DECIMAL,ke.makeCustomFormat(o.defaultFormatString))&&(u.defaultDecimalFormatOptions=o),Ms(_.dataType.INT,Qe.makeCustomFormat(r.defaultFormatString))&&(u.defaultIntegerFormatOptions=r),c(u)}render(){const{defaults:t}=this.props,{defaultDateTimeFormat:e,defaultDecimalFormatOptions:n,defaultIntegerFormatOptions:s,timeZone:i,showTimeZone:o,showTSeparator:r,truncateNumbersWithPound:l}=this.state,{defaultFormatString:a=ke.DEFAULT_FORMAT_STRING}=n??{},{defaultFormatString:d=Qe.DEFAULT_FORMAT_STRING}=s??{},c=i===t.timeZone,u=r===t.showTSeparator&&o===t.showTimeZone&&e===t.defaultDateTimeFormat,m=xy(n,t.defaultDecimalFormatOptions),p=Oy(s,t.defaultIntegerFormatOptions);return h("div",{className:"app-settings-formatting-section",ref:this.containerRef,children:T("div",{className:"container-fluid p-0",children:[h("div",{children:"Default formatting for column types"}),h("div",{className:"app-settings-menu-description mb-3",children:"Applies a formatting rule to all columns of a set type."}),T("div",{className:"form-row mb-2",children:[h("label",{className:"col-form-label col-3",htmlFor:"select-reset-timezone",children:"Time zone"}),h("div",{className:"col pr-0",children:h("select",{className:"custom-select",value:i,onChange:this.handleTimeZoneChange,id:"select-reset-timezone",children:h(Ay,{})})}),h("div",{className:"col-1 btn-col",children:h(U,{kind:"ghost",icon:ei,onClick:this.handleResetTimeZone,tooltip:"Reset Time Zone",className:Y("btn-reset","btn-reset-time-zone",{hidden:c})})})]}),T("div",{className:"form-row mb-2",children:[h("label",{className:"col-form-label col-3",htmlFor:"select-default-time-format",children:"DateTime"}),h("div",{className:"col pr-0",children:h("select",{className:"custom-select",value:e,onChange:this.handleDefaultDateTimeFormatChange,id:"select-default-time-format",children:this.getCachedDateTimeFormatOptions(i,o,r,!0,e)})}),h("div",{className:"col-1 btn-col",children:h(U,{kind:"ghost",icon:ei,onClick:this.handleResetDateTimeFormat,tooltip:"Reset DateTime Options",className:Y("btn-reset","btn-reset-date-time",{hidden:u})})})]}),h("div",{className:"form-row",children:h("div",{className:"offset-3 col-9",children:h(mn,{checked:o??null,onChange:this.handleShowTimeZoneChange,children:"Show time zone in dates"})})}),h("div",{className:"form-row mb-3",children:h("div",{className:"offset-3 col-9",children:h(mn,{checked:r??null,onChange:this.handleShowTSeparatorChange,children:"Show 'T' separator"})})}),T("div",{className:"form-row mb-2",children:[h("label",{className:"col-form-label col-3",htmlFor:"default-decimal-format-input",children:"Decimal"}),h("div",{className:"col pr-0",children:h("input",{className:Y("form-control","flex-grow-1","default-decimal-format-input",{"is-invalid":!Ms(_.dataType.DECIMAL,ke.makeCustomFormat(a))}),"data-lpignore":!0,placeholder:ke.DEFAULT_FORMAT_STRING,type:"text",id:"default-decimal-format-input",value:a,onChange:this.handleDefaultDecimalFormatChange})}),h("div",{className:"col-1 btn-col",children:h(U,{kind:"ghost",icon:ei,onClick:this.handleResetDecimalFormat,tooltip:"Reset Decimal Formatting",className:Y("btn-reset","btn-reset-decimal",{hidden:m}),"data-testid":"btn-reset-decimal"})})]}),T("div",{className:"form-row mb-2",children:[h("label",{className:"col-form-label col-3",htmlFor:"default-integer-format-input",children:"Integer"}),h("div",{className:"col pr-0",children:h("input",{className:Y("form-control","flex-grow-1","default-integer-format-input",{"is-invalid":!Ms(_.dataType.INT,Qe.makeCustomFormat(d))}),"data-lpignore":!0,placeholder:Qe.DEFAULT_FORMAT_STRING,type:"text",id:"default-integer-format-input",value:d,onChange:this.handleDefaultIntegerFormatChange})}),h("div",{className:"col-1 btn-col",children:h(U,{kind:"ghost",icon:ei,onClick:this.handleResetIntegerFormat,tooltip:"Reset Integer Formatting",className:Y("btn-reset","btn-reset-integer",{hidden:p}),"data-testid":"btn-reset-integer"})})]}),h("div",{className:"form-row mb-3",children:h("div",{className:"offset-3 col-9",children:h(mn,{checked:l??null,onChange:this.handleTruncateNumbersWithPoundChange,children:"Truncate numbers with #"})})})]})})}};let Od=op;Od.defaultProps={scrollTo:()=>{},defaults:{defaultDateTimeFormat:st.DEFAULT_DATETIME_FORMAT_STRING,defaultDecimalFormatOptions:{defaultFormatString:ke.DEFAULT_FORMAT_STRING},defaultIntegerFormatOptions:{defaultFormatString:Qe.DEFAULT_FORMAT_STRING},showTimeZone:!1,showTSeparator:!0,timeZone:st.DEFAULT_TIME_ZONE_ID}};Od.inputDebounceTime=250;const Ly=t=>({formatter:uu(t),defaultDateTimeFormat:du(t),defaultDecimalFormatOptions:cu(t),defaultIntegerFormatOptions:hu(t),showTimeZone:mu(t),showTSeparator:pu(t),truncateNumbersWithPound:gu(t),timeZone:ko(t),settings:Et(t)}),Py=vt(Ly,{saveSettings:gl})(Od);function Hy(){const[t,e]=b.exports.useState(!1),n=()=>{e(!t)};return T(U,{kind:"ghost",onClick:n,icon:sf,children:["Legal Notices",T(nl,{isOpen:t,toggle:n,className:"theme-bg-light",children:[h(sl,{toggle:n,children:"Legal Notice"}),T(il,{children:[h("p",{children:"Deephaven software is protected by U.S. Patent Nos. 9,612,959; 9,613,018; 9,613,109; 9,619,210; 9,633,060; 9,639,570; 9,672,238; 9,679,006; 9,690,821; 9,710,511; 9,760,591; 9,805,084; 9,836,495; 9,836,494; 9,886,469; 9,898,496; 9,934,266; 10,002,153; 10,002,154; 10,002,155; 10,003,673; 10,019,138; 10,069,943; 10,176,211; 10,198,465; 10,198,466; 10,198,469; 10,212,257; 10,241,960; 10,241,965; 10,242,040; 10,242,041; 10,353,893; 10,346,394; 10,452,649; 10,496,639; 10,540,351; 10,552,412; 10,565,194; 10,565,206; 10,572,474; 10,621,168; 10,642,829; 10,657,184; 10,678,787; 10,691,686; and 10,783,191. Other patents pending."}),T("p",{children:["\xA9 2016-",new Date().getFullYear()," Deephaven Data Labs LLC. Patent Pending."]})]})]})]})}function Ro(t){const{children:e,isExpanded:n,sectionKey:s,title:i,onToggle:o}=t;return T(be,{children:[h("div",{children:T(U,{kind:"ghost",className:"btn-collapse-trigger",onClick:()=>o(s),children:[h("div",{className:"flex-grow-1",children:i}),h("div",{className:"flex-shrink-0",children:h(Z,{transform:n?"flip-v":"",icon:ts})})]})}),h(of,{in:n,autoFocusOnShow:!0,children:e})]})}Ro.propTypes={children:M.exports.node,isExpanded:M.exports.bool.isRequired,sectionKey:M.exports.string.isRequired,title:M.exports.node.isRequired,onToggle:M.exports.func};Ro.defaultProps={children:null,onToggle:()=>{}};function Uy({shortcut:t,displayText:e,categoryName:n,onChange:s}){const[i,o]=b.exports.useState(e),[r,l]=b.exports.useState(t.getKeyState()),[a,d]=b.exports.useState(!1),[c,u]=b.exports.useState("");b.exports.useEffect(function(){o(e),l(t.getKeyState())},[e,t]),b.exports.useEffect(function(){o(fn.getDisplayText(r)),t.matchesKeyState(r)&&d(!1)},[r,t]),b.exports.useEffect(function(){if(a){if(!fn.isValidKeyState(r)){fn.isAllowedKey(r.keyValue)?u("Must contain a modifier key"):u("Must contain an allowed action key");return}const y=qe.getConflictingShortcuts(r).filter(E=>E.id.startsWith(n)&&E!==t).map(E=>E.name);if(y.length){u(`Conflicts with ${y.join(", ")}`);return}u("")}else u("")},[a,r,n,t]);function m(v){if(v.stopPropagation(),v.preventDefault(),t.isEditable&&!v.repeat){const y=fn.getKeyStateFromEvent(v),E=fn.createKeyState([Fe.BACKSPACE]);fn.doKeyStatesMatch(y,E)?l(fn.NULL_KEY_STATE):l(y)}}function p(v){v.stopPropagation(),v.preventDefault(),t.matchesKeyState(r)||d(!0)}function g(){Pn.disableAllActions()}function f(){Pn.enableAllActions()}function C(){t.setKeyState(r),d(!1),s(t)}function S(){const v=t.getKeyState();l(v),d(!1)}function w(){d(!0),l(t.getDefaultKeyState())}return T(be,{children:[T("div",{className:"shortcut-item-container",children:[T("label",{className:"shortcut-item-name",children:[t.name,t.tooltip!==void 0&&h(ut,{children:t.tooltip})]}),T("div",{className:"shortcut-item-input-container",children:[h("input",{className:Y("form-control",{"is-invalid":c}),onKeyDown:m,onKeyUp:p,onFocus:g,onBlur:f,disabled:!t.isEditable,value:i,readOnly:!0}),!fn.doKeyStatesMatch(r,t.getDefaultKeyState())&&!c&&h(U,{className:"reset-to-default-button",kind:"ghost",icon:h(Z,{icon:ei,transform:{rotate:90,flipX:!0}}),tooltip:"Reset to default",onClick:w})]})]}),a&&T("div",{className:Y("shortcut-item-message-container",{"is-invalid":c}),children:[h("div",{className:"shortcut-item-message",children:c}),T("div",{className:"shortcut-item-message-buttons",children:[fn.isValidKeyState(r)&&h(U,{kind:"ghost",onClick:C,children:"Confirm"}),h(U,{kind:"ghost",onClick:S,children:"Undo"})]})]})]})}function Vy({shortcutOverrides:t={},settings:e,saveSettings:n}){const s=b.exports.useCallback(l=>{const a=fn.isMacPlatform,d={mac:{...t.mac},windows:{...t.windows}},c=a?d.mac:d.windows;l.forEach(u=>{u.isDefault()?delete c[u.id]:c[u.id]=u.getKeyState()}),n({...e,shortcutOverrides:d})},[e,n,t]);let i=Array.from(qe.shortcutsByCategory.entries()).map(([l,a])=>({name:l,shortcuts:a}));const o=i.findIndex(l=>l.name.toUpperCase()==="GLOBAL"),r=i.splice(o,1);return i=i.concat(r),T(be,{children:[h("div",{className:"app-settings-menu-description",children:"Customize shortcuts below. Assigning shortcuts that conflict with the browser or IDE shortcuts may cause unintended behavior"}),i.map(l=>h(By,{name:l.name,shortcuts:l.shortcuts,saveShortcutOverrides:s},l.name))]})}function By({name:t,shortcuts:e,saveShortcutOverrides:n}){function s(a){return a.split("_").map(d=>`${d[0].toUpperCase()}${d.slice(1).toLowerCase()}`).join(" ")}const[i,o]=b.exports.useState(e);function r(a){const d=i.filter(u=>u!==a&&!u.isNull()&&u.matchesKeyState(a.getKeyState()));d.forEach(u=>u.setToNull());const c=[a,...d];n(c),o(u=>[...u])}const l=b.exports.useMemo(()=>i.map(a=>a.getDisplayText()),[i]);return T("div",{className:"mt-3",children:[h("div",{className:"font-weight-bold",children:s(t)}),i.map((a,d)=>h(Uy,{shortcut:a,displayText:l[d],categoryName:t,onChange:r},a.id))]})}const $y=t=>({settings:Et(t),shortcutOverrides:eS(t)}),Gy={saveSettings:gl},Wy=vt($y,Gy)(Vy),zy="yyyy-MM-dd-HHmmss";function rp(t,e="root",n=new Map([[t,""]])){const s={};return Object.entries(t).forEach(([i,o])=>{try{JSON.stringify(o),s[i]=o}catch{const l=o;if(typeof o=="bigint")s[i]=o.toString();else if(n.has(l))s[i]=`Circular ref to ${n.get(l)}`;else{const a=`${e}.${i}`;n.set(l,a),s[i]=rp(o,a,n)}}}),s}function qy(){const t=Cl.getState();return JSON.stringify(rp(t),null,2)}function Yy(t){const e={uiVersion:"0.30.0",userAgent:navigator.userAgent,...t};return JSON.stringify(e,null,2)}async function Ky(t=`${I.i18n.DateTimeFormat.format(zy,new Date)}_support_logs`,e){const n=new Sh,s=n.folder(t);s.file("console.txt",rf.getFormattedHistory()),s.file("redux.json",qy()),s.file("metadata.json",Yy(e));const i=await n.generateAsync({type:"blob"}),o=document.createElement("a");o.href=URL.createObjectURL(i),o.download=`${t}.zip`,o.click()}const Xy=[{value:_.dataType.DATETIME,label:"DateTime"},{value:_.dataType.DECIMAL,label:"Decimal"},{value:_.dataType.INT,label:"Integer"}];function jy(){const t=Xy.map(e=>h("option",{value:e.value,children:e.label},`key-columnType-${e.value}`));return T(be,{children:[h("option",{disabled:!0,value:"",children:"Select Type"},"key-columnType-placeholder"),t]})}const lp=class extends b.exports.PureComponent{constructor(t){super(t),this.getCachedColumnTypeOptions=Ie(()=>h(jy,{})),this.getCachedDateTimeFormatOptions=Ie((c,u,m,p=!1,g)=>{const{timestampAtMenuOpen:f}=this.state;return h(ip,{timestamp:f,timeZone:c,showTimeZone:u,showTSeparator:m,isGlobalOptions:p,legacyGlobalFormat:g})}),this.debouncedCommitChanges=Je(this.commitChanges.bind(this),lp.inputDebounceTime),this.handleFormatRuleEntered=this.handleFormatRuleEntered.bind(this),this.handleFormatRuleChange=this.handleFormatRuleChange.bind(this),this.handleFormatRuleCreate=this.handleFormatRuleCreate.bind(this),this.handleFormatRuleDelete=this.handleFormatRuleDelete.bind(this);const{formatter:e,defaultDateTimeFormat:n,defaultDecimalFormatOptions:s,defaultIntegerFormatOptions:i,showTimeZone:o,showTSeparator:r,timeZone:l,truncateNumbersWithPound:a}=t,d=e.map((c,u)=>({...c,id:u}));this.containerRef=de.createRef(),this.addFormatRuleButtonRef=de.createRef(),this.lastFormatRuleIndex=d.length,this.state={formatSettings:d,formatRulesChanged:!1,showTimeZone:o,showTSeparator:r,timeZone:l,defaultDateTimeFormat:n,defaultDecimalFormatOptions:s,defaultIntegerFormatOptions:i,truncateNumbersWithPound:a,timestampAtMenuOpen:new Date}}componentDidMount(){_a(this.containerRef.current)}componentWillUnmount(){this.debouncedCommitChanges.flush()}isDuplicateRule(t){const{formatSettings:e}=this.state;return e.some(n=>n.id!==t.id&&n.columnName===t.columnName&&n.columnType===t.columnType)??!1}getAutoIncrementFormatRuleIndex(){const{lastFormatRuleIndex:t}=this;return this.lastFormatRuleIndex+=1,t}handleFormatRuleChange(t,e,n){this.setState(s=>{const{formatSettings:i}=s;k(i);const o=[...i];let r={};e==="columnType"&&(r={format:""});const l={...o[t],...r,[e]:n};return o[t]=l,{formatSettings:o}},()=>{this.debouncedCommitChanges()})}handleFormatRuleCreate(){this.setState(t=>{const{formatSettings:e}=t,n={columnType:_.dataType.DATETIME,columnName:"",format:{},id:this.getAutoIncrementFormatRuleIndex(),isNewRule:!0};return{formatSettings:e!=null?[...e,n]:[n],formatRulesChanged:!0}})}handleFormatRuleDelete(t){this.setState(e=>{const{formatSettings:n}=e;return{formatSettings:n.filter((i,o)=>o!==t),formatRulesChanged:!0}},()=>{this.debouncedCommitChanges()})}handleFormatRuleEntered(t){this.scrollToFormatBlockBottom(),_a(t)}commitChanges(){const{formatSettings:t,defaultDateTimeFormat:e,showTimeZone:n,showTSeparator:s,timeZone:i,defaultDecimalFormatOptions:o,defaultIntegerFormatOptions:r,truncateNumbersWithPound:l}=this.state,a=t.filter(sp).map(np)??[],{settings:d,saveSettings:c}=this.props,u={...d,formatter:a,defaultDateTimeFormat:e,showTimeZone:n,showTSeparator:s,timeZone:i,truncateNumbersWithPound:l};Ms(_.dataType.DECIMAL,ke.makeCustomFormat(o.defaultFormatString))&&(u.defaultDecimalFormatOptions=o),Ms(_.dataType.INT,Qe.makeCustomFormat(r.defaultFormatString))&&(u.defaultIntegerFormatOptions=r),c(u)}scrollToFormatBlockBottom(){const{scrollTo:t}=this.props;t(0,(this.addFormatRuleButtonRef.current?.offsetHeight??0)+(this.addFormatRuleButtonRef.current?.offsetTop??0))}getRuleError(t){const e={hasColumnNameError:!1,hasFormatError:!1,message:""},n=[];return t.isNewRule!==void 0&&t.isNewRule||(this.isDuplicateRule(t)&&(e.hasColumnNameError=!0,n.push("Duplicate column name/type combo.")),tp(t.columnName)||(e.hasColumnNameError=!0,n.push("Column names must start with a letter or underscore and contain only alphanumeric characters or underscores.")),t.format.formatString!==void 0&&t.format.formatString.length===0?(e.hasFormatError=!0,n.push("Empty formatting rule.")):Ms(t.columnType,t.format)||(e.hasFormatError=!0,n.push("Invalid formatting rule.")),e.message=n.join(`
|
|
38
|
-
`)),e}renderFormatRule(t,e){const n=`input-${t}-columnName`,s=`input-${t}-columnType`,i=`input-${t}-format`,o=this.getCachedColumnTypeOptions(),r=c=>this.handleFormatRuleChange(t,"columnName",c.target.value),l=()=>this.handleFormatRuleChange(t,"isNewRule",!1),a=c=>this.handleFormatRuleChange(t,"columnType",c.target.value),d=this.getRuleError(e);return T("fieldset",{className:"container-fluid format-rule-container",children:[T("div",{className:"form-row",children:[T("div",{className:"form-group col-7 mb-2",children:[h("label",{htmlFor:n,children:"Column Name"}),h("input",{id:n,className:Y("form-control",{"is-invalid":d.hasColumnNameError}),"data-lpignore":!0,type:"text",value:e.columnName,onChange:r,onBlur:l})]}),T("div",{className:"form-group col mb-2",children:[h(U,{kind:"ghost",className:"btn-delete-format-rule float-right",tabIndex:-1,onClick:()=>this.handleFormatRuleDelete(t),icon:sn,tooltip:"Delete","aria-label":"Delete Format Rule"}),h("label",{htmlFor:s,children:"Column Type"}),h("select",{id:s,className:"custom-select",value:e.columnType,onChange:a,children:o})]})]}),h("div",{className:"form-row",children:T("div",{className:"form-group col-12 d-flex mb-2",children:[h("label",{className:"flex-shrink-0 col-form-label mr-3",htmlFor:i,children:"Formatting Rule"}),this.renderFormatRuleInput(t,e.columnType,i,e.format,d.hasFormatError)]})}),h("div",{className:"form-row",children:h("div",{className:"form-group col-12 d-flex mb-2",children:d.message&&h("p",{className:"text-danger",children:d.message})})})]},t)}renderFormatRuleInput(t,e,n,s,i){switch(_.getNormalizedType(e)){case _.dataType.DATETIME:return this.renderDateTimeFormatRuleInput(t,n,s,i);case _.dataType.DECIMAL:return this.renderDecimalFormatRuleInput(t,n,s,i);case _.dataType.INT:return this.renderIntegerFormatRuleInput(t,n,s,i);default:throw new Error(`Unrecognized column type: ${e}`)}}renderDateTimeFormatRuleInput(t,e,n,s){const{showTimeZone:i,showTSeparator:o,timeZone:r}=this.state,l=n.formatString??"";return T("select",{className:Y("custom-select",{"is-invalid":s}),value:l,id:e,onChange:a=>{const d=st.makeFormat("",a.target.value,st.TYPE_GLOBAL);this.handleFormatRuleChange(t,"format",d)},children:[h("option",{value:"",disabled:!0,children:"Select format"},"default"),this.getCachedDateTimeFormatOptions(r,i,o)]})}renderIntegerFormatRuleInput(t,e,n,s){const i=n.formatString??"";return h("input",{className:Y("form-control","flex-grow-1",{"is-invalid":s}),"data-lpignore":!0,id:e,placeholder:Qe.DEFAULT_FORMAT_STRING,type:"text",value:i,onChange:o=>{const r=Qe.makeFormat("",o.target.value,Qe.TYPE_GLOBAL,void 0);this.handleFormatRuleChange(t,"format",r)}})}renderDecimalFormatRuleInput(t,e,n,s){const i=n.formatString??"";return h("input",{className:Y("form-control","flex-grow-1",{"is-invalid":s}),"data-lpignore":!0,id:e,placeholder:ke.DEFAULT_FORMAT_STRING,type:"text",value:i,onChange:o=>{const r=ke.makeFormat("",o.target.value,ke.TYPE_GLOBAL,void 0);this.handleFormatRuleChange(t,"format",r)}})}render(){const{formatRulesChanged:t,formatSettings:e}=this.state,n=e.map((i,o)=>h(Ht,{classNames:"fade",timeout:Xe.transitionMs,onEnter:this.handleFormatRuleEntered,children:this.renderFormatRule(o,i)},i.id)),s=h(U,{kind:"ghost",className:"mb-3",onClick:this.handleFormatRuleCreate,ref:this.addFormatRuleButtonRef,icon:As,children:"Add New Rule"});return T("div",{className:"app-settings-formatting-section",ref:this.containerRef,children:[h("div",{children:"Default formatting for matched column names"}),h("div",{className:"app-settings-menu-description mb-3",children:"Applies a formatting rule to all columns that match a specified name and type."}),h(Wp,{appear:t,enter:t,exit:t,children:n}),s]})}};let Ad=lp;Ad.defaultProps={scrollTo:()=>{},defaults:{defaultDateTimeFormat:st.DEFAULT_DATETIME_FORMAT_STRING,defaultDecimalFormatOptions:{defaultFormatString:ke.DEFAULT_FORMAT_STRING},defaultIntegerFormatOptions:{defaultFormatString:Qe.DEFAULT_FORMAT_STRING},showTimeZone:!1,showTSeparator:!0,timeZone:st.DEFAULT_TIME_ZONE_ID}};Ad.inputDebounceTime=250;const Qy=t=>({formatter:uu(t),defaultDateTimeFormat:du(t),defaultDecimalFormatOptions:cu(t),defaultIntegerFormatOptions:hu(t),showTimeZone:mu(t),showTSeparator:pu(t),truncateNumbersWithPound:gu(t),timeZone:ko(t),settings:Et(t)}),Zy=vt(Qy,{saveSettings:gl})(Ad),Zn=class extends b.exports.Component{constructor(t){super(t),this.handleClose=this.handleClose.bind(this),this.handleScrollTo=this.handleScrollTo.bind(this),this.handleSectionToggle=this.handleSectionToggle.bind(this),this.handleExportSupportLogs=this.handleExportSupportLogs.bind(this),this.menuContentRef=de.createRef(),this.state={expandedSectionKey:Zn.FORMATTING_SECTION_KEY}}static focusFirstInputInContainer(t){const e=t?.querySelector("input, select, textarea");e&&e.focus()}componentDidMount(){Zn.focusFirstInputInContainer(this.menuContentRef.current)}isSectionExpanded(t){const{expandedSectionKey:e}=this.state;return e===t}handleScrollTo(t,e){this.menuContentRef.current?.scrollTo(t,e)}handleSectionToggle(t){this.setState(e=>({expandedSectionKey:e.expandedSectionKey===t?void 0:t}))}handleClose(){const{onDone:t}=this.props;t()}handleExportSupportLogs(){const{serverConfigValues:t}=this.props;Ky(void 0,Object.fromEntries(t))}render(){const t="0.30.
|
|
37
|
+
This note can be edited using **markdown** for styling.`;function fy(t){Ps(t);const{id:e,layout:n,panelManager:s,registerComponent:i}=t,o=b.exports.useCallback(l=>{const{title:a,componentState:d,props:c}=l;let{panelState:u=null}=c;return d!=null&&({panelState:u=null}=d),a==null||u==null||u.content==null||u.content.length===0||u.content===yo.DEFAULT_CONTENT?null:nd(l)},[]),r=b.exports.useCallback(({title:l="",metadata:a={},id:d=$e.generate(),focusElement:c=ie.DEFAULT_FOCUS_SELECTOR,createNewStack:u=!1,dragEvent:m=null}={})=>{const p=s.getOpenedPanelConfigsOfType(co.COMPONENT),g=s.getClosedPanelConfigsOfType(co.COMPONENT),f=p.map(y=>y.title??""),C=l!=null&&l!==""?l:yo.getNewMarkdownTitle(f),S=g.length>0?null:yo.DEFAULT_CONTENT,w={type:"react-component",component:co.COMPONENT,props:{id:d,metadata:a,panelState:{content:S},localDashboardId:e},title:C,id:d},{root:v}=n;ie.openComponent({root:v,config:w,focusElement:c,createNewStack:u,dragEvent:m})},[e,n,s]);return b.exports.useEffect(function(){const a=[i(co.COMPONENT,co,sd,o)];return()=>{a.forEach(d=>d())}},[o,i]),Be(n.eventHub,km.OPEN,r),null}function Cy(t){Ps(t);const{hydrate:e,id:n,layout:s,registerComponent:i}=t,o=b.exports.useCallback(({dragEvent:r,fetch:l,panelId:a=$e.generate(),widget:d})=>{const{name:c,type:u}=d;if(u!==dh.VariableType.PANDAS)return;const m={name:c,table:c},p=()=>l().then(C=>Cd.makeModel(C)),g={type:"react-component",component:Eo.COMPONENT,props:{localDashboardId:n,id:a,metadata:m,makeModel:p},title:c,id:a},{root:f}=s;ie.openComponent({root:f,config:g,dragEvent:r})},[n,s]);return b.exports.useEffect(function(){const l=[i(Eo.COMPONENT,Eo,e)];return()=>{l.forEach(a=>a())}},[e,i]),Be(s.eventHub,Ee.OPEN,o),null}class un{}un.DROPDOWN_FILTER="ControlType.DROPDOWN_FILTER";un.INPUT_FILTER="ControlType.INPUT_FILTER";un.MARKDOWN="ControlType.MARKDOWN";un.FILTER_SET_MANAGER="ControlType.FILTER_SET_MANAGER";const Sy=M.exports.shape({state:M.exports.shape({panelState:M.exports.shape({})})}),by=M.exports.shape({panelId:M.exports.string.isRequired,columnName:M.exports.string.isRequired,columnType:M.exports.string.isRequired}),oh=M.exports.shape({panelId:M.exports.string.isRequired,columnName:M.exports.string.isRequired}),Qm=M.exports.shape({start:oh,end:oh,id:M.exports.string,isReversed:M.exports.bool}),wy=M.exports.arrayOf(Qm),Ty=M.exports.shape({name:M.exports.string.isRequired,operateAs:M.exports.string.isRequired,groups:M.exports.arrayOf(M.exports.string).isRequired,permissions:M.exports.shape({isSuperUser:M.exports.bool.isRequired,isQueryViewOnly:M.exports.bool.isRequired,isNonInteractive:M.exports.bool.isRequired,canUsePanels:M.exports.bool.isRequired,canCreateDashboard:M.exports.bool.isRequired,canCreateCodeStudio:M.exports.bool.isRequired,canCreateQueryMonitor:M.exports.bool.isRequired,canCopy:M.exports.bool.isRequired,canDownloadCsv:M.exports.bool.isRequired}).isRequired});Object.freeze({LinkPoint:by,Link:Qm,Links:wy,Panel:Sy,User:Ty});const vy=(t,e)=>t[e]===null?null:M.exports.bool,Ey=(t,e)=>t[e]===null?null:M.exports.string;Object.freeze({nullableBoolean:vy,nullableString:Ey});J.module("StorageTableViewportUpdater");class rh{static makeSortConfig(e,n){return{column:e,direction:n}}static makeFilterConfig(e){const n=[],s=[];return e.forEach((i,o)=>{n.push(i),o>0&&s.push(zt.and)}),{filterItems:n,filterOperators:s}}static combineFilterConfigs(e,n,s=zt.and){return{filterItems:[...e.filterItems,...n.filterItems],filterOperators:[...e.filterOperators,s,...n.filterOperators]}}static makeFilterItem(e,n,s){return{columnName:e,type:n,value:s}}}const ia=J.module("PouchStorageTable"),yy="Deephaven.";Ch.plugin(Gp);function Ry(t,e){switch(t){case $.in:case $.contains:return{$regex:new RegExp(`${e}`)};case $.inIgnoreCase:return{$regex:new RegExp(`${e}`,"i")};case $.eq:return{$eq:e};case $.notEq:return{$neq:e};case $.greaterThan:return{$gt:e};case $.greaterThanOrEqualTo:return{$gte:e};case $.lessThan:return{$lt:e};case $.lessThanOrEqualTo:return{$lte:e};case $.startsWith:return{$regex:new RegExp(`^(?${e}).*`)};default:throw new Error(`Unsupported type: ${t}`)}}function Iy(t){const{filterItems:e,filterOperators:n}=t;let s=null;for(let i=0;i<e.length;i+=1){const o=e[i],{columnName:r,type:l,value:a}=o,d={[r]:Ry(l,a)};if(i===0)s=d;else if(s!==null&&i-1<n.length){const c=n[i-1];if(c===zt.and)s={$and:[s,d]};else if(c===zt.or)s={$or:[s,d]};else throw new Error(`Unexpected filter operator ${c}, ${d}`)}}if(s==null)throw new Error(`Invalid filter config ${t}`);return s}function oa(t=[]){return{$and:[...t.map(e=>Iy(e)),{name:{$gt:null}},{id:{$gt:null}}]}}function Fy(t,e=!1){return[{id:e?"desc":"asc"},...t?.map(n=>({[n.column]:n.direction}))??[]]}class Dy{constructor(e){this.listeners=[],this.itemListeners=new Map,this.currentSize=0,this.currentReverse=!1,this.currentFilter=null,this.currentSort=null,this.db=new Ch(`${yy}${e}`),this.db._remote=!1,this.db.changes({live:!0,since:"now",include_docs:!0}).on("change",this.dbUpdate.bind(this)),this.db.createIndex({index:{fields:["id","name"]}}),this.refreshInfo()}onUpdate(e){return this.listeners=[...this.listeners,e],()=>{this.listeners=this.listeners.filter(n=>n!==e)}}onItemUpdate(e,n){return this.itemListeners.has(e)||this.itemListeners.set(e,[]),this.itemListeners.set(e,[...this.itemListeners.get(e),n]),this.refreshItem(e),()=>{this.itemListeners.set(e,this.itemListeners.get(e).filter(s=>s!==n))}}close(){this.listeners=[]}get size(){return this.currentSize}get viewport(){return this.currentViewport}setReversed(e){this.currentReverse=e,this.currentViewportData=void 0,this.refreshData()}setViewport(e){this.currentViewport=e,this.refreshInfo(),this.refreshData()}setSorts(e){this.currentSort=e,this.currentViewportData=void 0,this.refreshData()}setFilters(e){this.currentFilter=e,this.currentViewportData=void 0,this.refreshInfo(),this.refreshData()}get data(){return this.currentViewportData}async getViewportData(){return this.viewportUpdatePromise||this.refreshData(),this.viewportUpdatePromise??Promise.resolve({items:[],offset:0})}async put(e){const n={...e,_id:e.id};return await this.db.put(n),n}sendUpdate(){const{listeners:e}=this,n=this.currentViewportData??{items:[],offset:0};for(let s=0;s<e.length;s+=1)e[s](n)}sendItemUpdate(e){const n=this.itemListeners.get(e.id);if(n!==void 0)for(let s=0;s<n.length;s+=1)n[s](e)}dbUpdate(e){ia.debug("Update received",e),this.refreshInfo(),e.doc!==void 0&&this.sendItemUpdate(e.doc),this.refreshData()}async refreshInfo(){try{this.infoUpdatePromise?.cancel(),this.infoUpdatePromise=ye.makeCancelable(this.db.find({selector:oa(this.currentFilter??[]),fields:[]}));const e=await this.infoUpdatePromise;this.currentSize=e.docs.length,this.sendUpdate()}catch(e){if(!ye.isCanceled(e))throw ia.error("Unable to refreshInfo",e),e}}async refreshData(){if(!!this.currentViewport)try{const{currentViewport:e}=this,n=Fy(this.currentSort,this.currentReverse);this.viewportUpdatePromise?.cancel(),this.viewportUpdatePromise=ye.makeCancelable(this.db.find({selector:oa(this.currentFilter??[]),skip:e.top,limit:e.bottom-e.top+1,sort:n,fields:["id","name"]}).then(i=>({items:i.docs,offset:e.top})));const s=await this.viewportUpdatePromise;return this.currentViewportData=s,this.sendUpdate(),s}catch(e){if(!ye.isCanceled(e))throw ia.error("Unable to refreshData",e),e}}async refreshItem(e){const s=(await this.db.find({selector:{id:e},limit:1})).docs[0];return s!==void 0&&this.sendItemUpdate(s),s}async getSnapshot(e){const n=new Map,s=[{id:this.currentReverse?"desc":"asc"}];return await Promise.all(e.map(async([i,o])=>{const r=o-i+1;return this.db.find({selector:oa(this.currentFilter??[]),skip:i,limit:r,sort:s,fields:["id","name"]}).then(l=>{for(let a=0;a<r;a+=1){const d=i+a;n.set(d,l.docs[a])}})})),n}}class lh extends Dy{constructor(e){super(`CommandHistoryStorage.${e}`)}setSearch(e){this.setFilters(e?[rh.makeFilterConfig([rh.makeFilterItem("name",$.contains,e)])]:[])}}const ah=J.module("PouchCommandHistoryStorage");class Ny{constructor(){this.updateTableMap=new Map}getUpdateTable(e){return this.updateTableMap.has(e)||this.updateTableMap.set(e,new lh(e)),this.updateTableMap.get(e)}async getTable(e){return new lh(e)}async addItem(e,n,s,i){return this.updateItem(e,{id:`${new Date().getTime()}`,name:s,data:i})}async updateItem(e,n){const s=this.getUpdateTable(e),o={...await s.refreshItem(n.id)??{},...n};return ah.debug("Updating item",o),await s.put(o),ah.debug("Update saved"),n}listenItem(e,n,s){return this.getUpdateTable(e).onItemUpdate(n,s)}}const Zm="SET_LAYOUT_STORAGE",_y=t=>({type:Zm,payload:t}),Jm="/ide/assets/community-wordmark-app.d2c5c1eb.svg";const My=J.module("FormattingSectionContent");function ky(t){return t.formatString!=null}function _a(t){const e=t?.querySelector("input, select, textarea");e&&e.focus()}function ep(t,e){return t.defaultFormatString===e.defaultFormatString}function xy(t,e){return ep(t,e)}function Oy(t,e){return ep(t,e)}function tp(t){return t!==""&&Vi.isValidColumnName(t)}function Ms(t,e){if(!t||e.formatString==null||!ky(e))return!1;switch(t){case"datetime":return st.isValid(e);case"decimal":return ke.isValid(e);case"int":return Qe.isValid(e);default:return My.warn("Trying to validate format of unknown type"),!0}}function np(t){const{id:e,isNewRule:n,...s}=t;return s}function sp(t){return tp(t.columnName)&&Ms(t.columnType,t.format)}function ip(t){const{timestamp:e,timeZone:n,showTimeZone:s,showTSeparator:i,isGlobalOptions:o,legacyGlobalFormat:r}=t,l=new nn([],{timeZone:n,showTimeZone:s,showTSeparator:i}),a=o?st.getGlobalFormats(s,i):st.getFormats(s,i);return r!=null&&!a.includes(r)&&a.unshift(r),h(be,{children:a.map(d=>{const c=st.makeFormat("",d,st.TYPE_GLOBAL);return h("option",{value:d,"data-testid":"time-format",children:l.getFormattedString(e,_.dataType.DATETIME,"",c)},d)})})}function Ay(){return h(be,{children:Qr.TIME_ZONES.map(t=>{const{label:e,value:n}=t;return h("option",{value:n,children:e},n)})})}const Ys=J.module("FormattingSectionContent"),op=class extends b.exports.PureComponent{constructor(t){super(t),this.getCachedDateTimeFormatOptions=Ie((c,u,m,p=!1,g)=>{const{timestampAtMenuOpen:f}=this.state;return h(ip,{timestamp:f,timeZone:c,showTimeZone:u,showTSeparator:m,isGlobalOptions:p,legacyGlobalFormat:g})}),this.debouncedCommitChanges=Je(this.commitChanges.bind(this),op.inputDebounceTime),this.handleDefaultDateTimeFormatChange=this.handleDefaultDateTimeFormatChange.bind(this),this.handleDefaultDecimalFormatChange=this.handleDefaultDecimalFormatChange.bind(this),this.handleDefaultIntegerFormatChange=this.handleDefaultIntegerFormatChange.bind(this),this.handleShowTimeZoneChange=this.handleShowTimeZoneChange.bind(this),this.handleShowTSeparatorChange=this.handleShowTSeparatorChange.bind(this),this.handleTimeZoneChange=this.handleTimeZoneChange.bind(this),this.handleResetDateTimeFormat=this.handleResetDateTimeFormat.bind(this),this.handleResetDecimalFormat=this.handleResetDecimalFormat.bind(this),this.handleResetIntegerFormat=this.handleResetIntegerFormat.bind(this),this.handleResetTimeZone=this.handleResetTimeZone.bind(this),this.handleTruncateNumbersWithPoundChange=this.handleTruncateNumbersWithPoundChange.bind(this);const{formatter:e,defaultDateTimeFormat:n,defaultDecimalFormatOptions:s,defaultIntegerFormatOptions:i,showTimeZone:o,showTSeparator:r,timeZone:l,truncateNumbersWithPound:a}=t,d=e.map((c,u)=>({...c,id:u}));this.containerRef=de.createRef(),this.state={formatSettings:d,showTimeZone:o,showTSeparator:r,timeZone:l,defaultDateTimeFormat:n,defaultDecimalFormatOptions:s,defaultIntegerFormatOptions:i,truncateNumbersWithPound:a,timestampAtMenuOpen:new Date}}componentDidMount(){_a(this.containerRef.current)}componentWillUnmount(){this.debouncedCommitChanges.flush()}handleDefaultDateTimeFormatChange(t){Ys.debug("handleDefaultDateTimeFormatChange",t.target.value),this.setState({defaultDateTimeFormat:t.target.value},()=>{this.debouncedCommitChanges()})}handleDefaultDecimalFormatChange(t){Ys.debug("handleDefaultDecimalFormatChange",t.target.value),this.setState({defaultDecimalFormatOptions:{defaultFormatString:t.target.value}},()=>{this.debouncedCommitChanges()})}handleDefaultIntegerFormatChange(t){Ys.debug("handleDefaultIntegerFormatChange",t.target.value),this.setState({defaultIntegerFormatOptions:{defaultFormatString:t.target.value}},()=>{this.debouncedCommitChanges()})}handleShowTimeZoneChange(){this.setState(t=>({showTimeZone:!t.showTimeZone}),()=>{this.debouncedCommitChanges()})}handleShowTSeparatorChange(){this.setState(t=>({showTSeparator:!t.showTSeparator}),()=>{this.debouncedCommitChanges()})}handleTimeZoneChange(t){this.setState({timeZone:t.target.value},()=>{this.debouncedCommitChanges()})}handleResetDateTimeFormat(){const{defaults:t}=this.props,{defaultDateTimeFormat:e,showTimeZone:n,showTSeparator:s}=t;Ys.debug("handleResetDateTimeFormat"),this.setState({defaultDateTimeFormat:e,showTimeZone:n,showTSeparator:s},()=>{this.debouncedCommitChanges()})}handleResetTimeZone(){const{defaults:t}=this.props,{timeZone:e}=t;Ys.debug("handleResetTimeZone"),this.setState({timeZone:e},()=>{this.debouncedCommitChanges()})}handleResetDecimalFormat(){const{defaults:t}=this.props,{defaultDecimalFormatOptions:e}=t;Ys.debug("handleResetDecimalFormat"),this.setState({defaultDecimalFormatOptions:e},()=>{this.debouncedCommitChanges()})}handleResetIntegerFormat(){const{defaults:t}=this.props,{defaultIntegerFormatOptions:e}=t;Ys.debug("handleResetIntegerFormat"),this.setState({defaultIntegerFormatOptions:e},()=>{this.debouncedCommitChanges()})}handleTruncateNumbersWithPoundChange(){this.setState(t=>({truncateNumbersWithPound:!t.truncateNumbersWithPound}),()=>{this.debouncedCommitChanges()})}commitChanges(){const{formatSettings:t,defaultDateTimeFormat:e,showTimeZone:n,showTSeparator:s,timeZone:i,defaultDecimalFormatOptions:o,defaultIntegerFormatOptions:r,truncateNumbersWithPound:l}=this.state,a=t.filter(sp).map(np)??[],{settings:d,saveSettings:c}=this.props,u={...d,formatter:a,defaultDateTimeFormat:e,showTimeZone:n,showTSeparator:s,timeZone:i,truncateNumbersWithPound:l};Ms(_.dataType.DECIMAL,ke.makeCustomFormat(o.defaultFormatString))&&(u.defaultDecimalFormatOptions=o),Ms(_.dataType.INT,Qe.makeCustomFormat(r.defaultFormatString))&&(u.defaultIntegerFormatOptions=r),c(u)}render(){const{defaults:t}=this.props,{defaultDateTimeFormat:e,defaultDecimalFormatOptions:n,defaultIntegerFormatOptions:s,timeZone:i,showTimeZone:o,showTSeparator:r,truncateNumbersWithPound:l}=this.state,{defaultFormatString:a=ke.DEFAULT_FORMAT_STRING}=n??{},{defaultFormatString:d=Qe.DEFAULT_FORMAT_STRING}=s??{},c=i===t.timeZone,u=r===t.showTSeparator&&o===t.showTimeZone&&e===t.defaultDateTimeFormat,m=xy(n,t.defaultDecimalFormatOptions),p=Oy(s,t.defaultIntegerFormatOptions);return h("div",{className:"app-settings-formatting-section",ref:this.containerRef,children:T("div",{className:"container-fluid p-0",children:[h("div",{children:"Default formatting for column types"}),h("div",{className:"app-settings-menu-description mb-3",children:"Applies a formatting rule to all columns of a set type."}),T("div",{className:"form-row mb-2",children:[h("label",{className:"col-form-label col-3",htmlFor:"select-reset-timezone",children:"Time zone"}),h("div",{className:"col pr-0",children:h("select",{className:"custom-select",value:i,onChange:this.handleTimeZoneChange,id:"select-reset-timezone",children:h(Ay,{})})}),h("div",{className:"col-1 btn-col",children:h(U,{kind:"ghost",icon:ei,onClick:this.handleResetTimeZone,tooltip:"Reset Time Zone",className:Y("btn-reset","btn-reset-time-zone",{hidden:c})})})]}),T("div",{className:"form-row mb-2",children:[h("label",{className:"col-form-label col-3",htmlFor:"select-default-time-format",children:"DateTime"}),h("div",{className:"col pr-0",children:h("select",{className:"custom-select",value:e,onChange:this.handleDefaultDateTimeFormatChange,id:"select-default-time-format",children:this.getCachedDateTimeFormatOptions(i,o,r,!0,e)})}),h("div",{className:"col-1 btn-col",children:h(U,{kind:"ghost",icon:ei,onClick:this.handleResetDateTimeFormat,tooltip:"Reset DateTime Options",className:Y("btn-reset","btn-reset-date-time",{hidden:u})})})]}),h("div",{className:"form-row",children:h("div",{className:"offset-3 col-9",children:h(mn,{checked:o??null,onChange:this.handleShowTimeZoneChange,children:"Show time zone in dates"})})}),h("div",{className:"form-row mb-3",children:h("div",{className:"offset-3 col-9",children:h(mn,{checked:r??null,onChange:this.handleShowTSeparatorChange,children:"Show 'T' separator"})})}),T("div",{className:"form-row mb-2",children:[h("label",{className:"col-form-label col-3",htmlFor:"default-decimal-format-input",children:"Decimal"}),h("div",{className:"col pr-0",children:h("input",{className:Y("form-control","flex-grow-1","default-decimal-format-input",{"is-invalid":!Ms(_.dataType.DECIMAL,ke.makeCustomFormat(a))}),"data-lpignore":!0,placeholder:ke.DEFAULT_FORMAT_STRING,type:"text",id:"default-decimal-format-input",value:a,onChange:this.handleDefaultDecimalFormatChange})}),h("div",{className:"col-1 btn-col",children:h(U,{kind:"ghost",icon:ei,onClick:this.handleResetDecimalFormat,tooltip:"Reset Decimal Formatting",className:Y("btn-reset","btn-reset-decimal",{hidden:m}),"data-testid":"btn-reset-decimal"})})]}),T("div",{className:"form-row mb-2",children:[h("label",{className:"col-form-label col-3",htmlFor:"default-integer-format-input",children:"Integer"}),h("div",{className:"col pr-0",children:h("input",{className:Y("form-control","flex-grow-1","default-integer-format-input",{"is-invalid":!Ms(_.dataType.INT,Qe.makeCustomFormat(d))}),"data-lpignore":!0,placeholder:Qe.DEFAULT_FORMAT_STRING,type:"text",id:"default-integer-format-input",value:d,onChange:this.handleDefaultIntegerFormatChange})}),h("div",{className:"col-1 btn-col",children:h(U,{kind:"ghost",icon:ei,onClick:this.handleResetIntegerFormat,tooltip:"Reset Integer Formatting",className:Y("btn-reset","btn-reset-integer",{hidden:p}),"data-testid":"btn-reset-integer"})})]}),h("div",{className:"form-row mb-3",children:h("div",{className:"offset-3 col-9",children:h(mn,{checked:l??null,onChange:this.handleTruncateNumbersWithPoundChange,children:"Truncate numbers with #"})})})]})})}};let Od=op;Od.defaultProps={scrollTo:()=>{},defaults:{defaultDateTimeFormat:st.DEFAULT_DATETIME_FORMAT_STRING,defaultDecimalFormatOptions:{defaultFormatString:ke.DEFAULT_FORMAT_STRING},defaultIntegerFormatOptions:{defaultFormatString:Qe.DEFAULT_FORMAT_STRING},showTimeZone:!1,showTSeparator:!0,timeZone:st.DEFAULT_TIME_ZONE_ID}};Od.inputDebounceTime=250;const Ly=t=>({formatter:uu(t),defaultDateTimeFormat:du(t),defaultDecimalFormatOptions:cu(t),defaultIntegerFormatOptions:hu(t),showTimeZone:mu(t),showTSeparator:pu(t),truncateNumbersWithPound:gu(t),timeZone:ko(t),settings:Et(t)}),Py=vt(Ly,{saveSettings:gl})(Od);function Hy(){const[t,e]=b.exports.useState(!1),n=()=>{e(!t)};return T(U,{kind:"ghost",onClick:n,icon:sf,children:["Legal Notices",T(nl,{isOpen:t,toggle:n,className:"theme-bg-light",children:[h(sl,{toggle:n,children:"Legal Notice"}),T(il,{children:[h("p",{children:"Deephaven software is protected by U.S. Patent Nos. 9,612,959; 9,613,018; 9,613,109; 9,619,210; 9,633,060; 9,639,570; 9,672,238; 9,679,006; 9,690,821; 9,710,511; 9,760,591; 9,805,084; 9,836,495; 9,836,494; 9,886,469; 9,898,496; 9,934,266; 10,002,153; 10,002,154; 10,002,155; 10,003,673; 10,019,138; 10,069,943; 10,176,211; 10,198,465; 10,198,466; 10,198,469; 10,212,257; 10,241,960; 10,241,965; 10,242,040; 10,242,041; 10,353,893; 10,346,394; 10,452,649; 10,496,639; 10,540,351; 10,552,412; 10,565,194; 10,565,206; 10,572,474; 10,621,168; 10,642,829; 10,657,184; 10,678,787; 10,691,686; and 10,783,191. Other patents pending."}),T("p",{children:["\xA9 2016-",new Date().getFullYear()," Deephaven Data Labs LLC. Patent Pending."]})]})]})]})}function Ro(t){const{children:e,isExpanded:n,sectionKey:s,title:i,onToggle:o}=t;return T(be,{children:[h("div",{children:T(U,{kind:"ghost",className:"btn-collapse-trigger",onClick:()=>o(s),children:[h("div",{className:"flex-grow-1",children:i}),h("div",{className:"flex-shrink-0",children:h(Z,{transform:n?"flip-v":"",icon:ts})})]})}),h(of,{in:n,autoFocusOnShow:!0,children:e})]})}Ro.propTypes={children:M.exports.node,isExpanded:M.exports.bool.isRequired,sectionKey:M.exports.string.isRequired,title:M.exports.node.isRequired,onToggle:M.exports.func};Ro.defaultProps={children:null,onToggle:()=>{}};function Uy({shortcut:t,displayText:e,categoryName:n,onChange:s}){const[i,o]=b.exports.useState(e),[r,l]=b.exports.useState(t.getKeyState()),[a,d]=b.exports.useState(!1),[c,u]=b.exports.useState("");b.exports.useEffect(function(){o(e),l(t.getKeyState())},[e,t]),b.exports.useEffect(function(){o(fn.getDisplayText(r)),t.matchesKeyState(r)&&d(!1)},[r,t]),b.exports.useEffect(function(){if(a){if(!fn.isValidKeyState(r)){fn.isAllowedKey(r.keyValue)?u("Must contain a modifier key"):u("Must contain an allowed action key");return}const y=qe.getConflictingShortcuts(r).filter(E=>E.id.startsWith(n)&&E!==t).map(E=>E.name);if(y.length){u(`Conflicts with ${y.join(", ")}`);return}u("")}else u("")},[a,r,n,t]);function m(v){if(v.stopPropagation(),v.preventDefault(),t.isEditable&&!v.repeat){const y=fn.getKeyStateFromEvent(v),E=fn.createKeyState([Fe.BACKSPACE]);fn.doKeyStatesMatch(y,E)?l(fn.NULL_KEY_STATE):l(y)}}function p(v){v.stopPropagation(),v.preventDefault(),t.matchesKeyState(r)||d(!0)}function g(){Pn.disableAllActions()}function f(){Pn.enableAllActions()}function C(){t.setKeyState(r),d(!1),s(t)}function S(){const v=t.getKeyState();l(v),d(!1)}function w(){d(!0),l(t.getDefaultKeyState())}return T(be,{children:[T("div",{className:"shortcut-item-container",children:[T("label",{className:"shortcut-item-name",children:[t.name,t.tooltip!==void 0&&h(ut,{children:t.tooltip})]}),T("div",{className:"shortcut-item-input-container",children:[h("input",{className:Y("form-control",{"is-invalid":c}),onKeyDown:m,onKeyUp:p,onFocus:g,onBlur:f,disabled:!t.isEditable,value:i,readOnly:!0}),!fn.doKeyStatesMatch(r,t.getDefaultKeyState())&&!c&&h(U,{className:"reset-to-default-button",kind:"ghost",icon:h(Z,{icon:ei,transform:{rotate:90,flipX:!0}}),tooltip:"Reset to default",onClick:w})]})]}),a&&T("div",{className:Y("shortcut-item-message-container",{"is-invalid":c}),children:[h("div",{className:"shortcut-item-message",children:c}),T("div",{className:"shortcut-item-message-buttons",children:[fn.isValidKeyState(r)&&h(U,{kind:"ghost",onClick:C,children:"Confirm"}),h(U,{kind:"ghost",onClick:S,children:"Undo"})]})]})]})}function Vy({shortcutOverrides:t={},settings:e,saveSettings:n}){const s=b.exports.useCallback(l=>{const a=fn.isMacPlatform,d={mac:{...t.mac},windows:{...t.windows}},c=a?d.mac:d.windows;l.forEach(u=>{u.isDefault()?delete c[u.id]:c[u.id]=u.getKeyState()}),n({...e,shortcutOverrides:d})},[e,n,t]);let i=Array.from(qe.shortcutsByCategory.entries()).map(([l,a])=>({name:l,shortcuts:a}));const o=i.findIndex(l=>l.name.toUpperCase()==="GLOBAL"),r=i.splice(o,1);return i=i.concat(r),T(be,{children:[h("div",{className:"app-settings-menu-description",children:"Customize shortcuts below. Assigning shortcuts that conflict with the browser or IDE shortcuts may cause unintended behavior"}),i.map(l=>h(By,{name:l.name,shortcuts:l.shortcuts,saveShortcutOverrides:s},l.name))]})}function By({name:t,shortcuts:e,saveShortcutOverrides:n}){function s(a){return a.split("_").map(d=>`${d[0].toUpperCase()}${d.slice(1).toLowerCase()}`).join(" ")}const[i,o]=b.exports.useState(e);function r(a){const d=i.filter(u=>u!==a&&!u.isNull()&&u.matchesKeyState(a.getKeyState()));d.forEach(u=>u.setToNull());const c=[a,...d];n(c),o(u=>[...u])}const l=b.exports.useMemo(()=>i.map(a=>a.getDisplayText()),[i]);return T("div",{className:"mt-3",children:[h("div",{className:"font-weight-bold",children:s(t)}),i.map((a,d)=>h(Uy,{shortcut:a,displayText:l[d],categoryName:t,onChange:r},a.id))]})}const $y=t=>({settings:Et(t),shortcutOverrides:eS(t)}),Gy={saveSettings:gl},Wy=vt($y,Gy)(Vy),zy="yyyy-MM-dd-HHmmss";function rp(t,e="root",n=new Map([[t,""]])){const s={};return Object.entries(t).forEach(([i,o])=>{try{JSON.stringify(o),s[i]=o}catch{const l=o;if(typeof o=="bigint")s[i]=o.toString();else if(n.has(l))s[i]=`Circular ref to ${n.get(l)}`;else{const a=`${e}.${i}`;n.set(l,a),s[i]=rp(o,a,n)}}}),s}function qy(){const t=Cl.getState();return JSON.stringify(rp(t),null,2)}function Yy(t){const e={uiVersion:"0.30.1",userAgent:navigator.userAgent,...t};return JSON.stringify(e,null,2)}async function Ky(t=`${I.i18n.DateTimeFormat.format(zy,new Date)}_support_logs`,e){const n=new Sh,s=n.folder(t);s.file("console.txt",rf.getFormattedHistory()),s.file("redux.json",qy()),s.file("metadata.json",Yy(e));const i=await n.generateAsync({type:"blob"}),o=document.createElement("a");o.href=URL.createObjectURL(i),o.download=`${t}.zip`,o.click()}const Xy=[{value:_.dataType.DATETIME,label:"DateTime"},{value:_.dataType.DECIMAL,label:"Decimal"},{value:_.dataType.INT,label:"Integer"}];function jy(){const t=Xy.map(e=>h("option",{value:e.value,children:e.label},`key-columnType-${e.value}`));return T(be,{children:[h("option",{disabled:!0,value:"",children:"Select Type"},"key-columnType-placeholder"),t]})}const lp=class extends b.exports.PureComponent{constructor(t){super(t),this.getCachedColumnTypeOptions=Ie(()=>h(jy,{})),this.getCachedDateTimeFormatOptions=Ie((c,u,m,p=!1,g)=>{const{timestampAtMenuOpen:f}=this.state;return h(ip,{timestamp:f,timeZone:c,showTimeZone:u,showTSeparator:m,isGlobalOptions:p,legacyGlobalFormat:g})}),this.debouncedCommitChanges=Je(this.commitChanges.bind(this),lp.inputDebounceTime),this.handleFormatRuleEntered=this.handleFormatRuleEntered.bind(this),this.handleFormatRuleChange=this.handleFormatRuleChange.bind(this),this.handleFormatRuleCreate=this.handleFormatRuleCreate.bind(this),this.handleFormatRuleDelete=this.handleFormatRuleDelete.bind(this);const{formatter:e,defaultDateTimeFormat:n,defaultDecimalFormatOptions:s,defaultIntegerFormatOptions:i,showTimeZone:o,showTSeparator:r,timeZone:l,truncateNumbersWithPound:a}=t,d=e.map((c,u)=>({...c,id:u}));this.containerRef=de.createRef(),this.addFormatRuleButtonRef=de.createRef(),this.lastFormatRuleIndex=d.length,this.state={formatSettings:d,formatRulesChanged:!1,showTimeZone:o,showTSeparator:r,timeZone:l,defaultDateTimeFormat:n,defaultDecimalFormatOptions:s,defaultIntegerFormatOptions:i,truncateNumbersWithPound:a,timestampAtMenuOpen:new Date}}componentDidMount(){_a(this.containerRef.current)}componentWillUnmount(){this.debouncedCommitChanges.flush()}isDuplicateRule(t){const{formatSettings:e}=this.state;return e.some(n=>n.id!==t.id&&n.columnName===t.columnName&&n.columnType===t.columnType)??!1}getAutoIncrementFormatRuleIndex(){const{lastFormatRuleIndex:t}=this;return this.lastFormatRuleIndex+=1,t}handleFormatRuleChange(t,e,n){this.setState(s=>{const{formatSettings:i}=s;k(i);const o=[...i];let r={};e==="columnType"&&(r={format:""});const l={...o[t],...r,[e]:n};return o[t]=l,{formatSettings:o}},()=>{this.debouncedCommitChanges()})}handleFormatRuleCreate(){this.setState(t=>{const{formatSettings:e}=t,n={columnType:_.dataType.DATETIME,columnName:"",format:{},id:this.getAutoIncrementFormatRuleIndex(),isNewRule:!0};return{formatSettings:e!=null?[...e,n]:[n],formatRulesChanged:!0}})}handleFormatRuleDelete(t){this.setState(e=>{const{formatSettings:n}=e;return{formatSettings:n.filter((i,o)=>o!==t),formatRulesChanged:!0}},()=>{this.debouncedCommitChanges()})}handleFormatRuleEntered(t){this.scrollToFormatBlockBottom(),_a(t)}commitChanges(){const{formatSettings:t,defaultDateTimeFormat:e,showTimeZone:n,showTSeparator:s,timeZone:i,defaultDecimalFormatOptions:o,defaultIntegerFormatOptions:r,truncateNumbersWithPound:l}=this.state,a=t.filter(sp).map(np)??[],{settings:d,saveSettings:c}=this.props,u={...d,formatter:a,defaultDateTimeFormat:e,showTimeZone:n,showTSeparator:s,timeZone:i,truncateNumbersWithPound:l};Ms(_.dataType.DECIMAL,ke.makeCustomFormat(o.defaultFormatString))&&(u.defaultDecimalFormatOptions=o),Ms(_.dataType.INT,Qe.makeCustomFormat(r.defaultFormatString))&&(u.defaultIntegerFormatOptions=r),c(u)}scrollToFormatBlockBottom(){const{scrollTo:t}=this.props;t(0,(this.addFormatRuleButtonRef.current?.offsetHeight??0)+(this.addFormatRuleButtonRef.current?.offsetTop??0))}getRuleError(t){const e={hasColumnNameError:!1,hasFormatError:!1,message:""},n=[];return t.isNewRule!==void 0&&t.isNewRule||(this.isDuplicateRule(t)&&(e.hasColumnNameError=!0,n.push("Duplicate column name/type combo.")),tp(t.columnName)||(e.hasColumnNameError=!0,n.push("Column names must start with a letter or underscore and contain only alphanumeric characters or underscores.")),t.format.formatString!==void 0&&t.format.formatString.length===0?(e.hasFormatError=!0,n.push("Empty formatting rule.")):Ms(t.columnType,t.format)||(e.hasFormatError=!0,n.push("Invalid formatting rule.")),e.message=n.join(`
|
|
38
|
+
`)),e}renderFormatRule(t,e){const n=`input-${t}-columnName`,s=`input-${t}-columnType`,i=`input-${t}-format`,o=this.getCachedColumnTypeOptions(),r=c=>this.handleFormatRuleChange(t,"columnName",c.target.value),l=()=>this.handleFormatRuleChange(t,"isNewRule",!1),a=c=>this.handleFormatRuleChange(t,"columnType",c.target.value),d=this.getRuleError(e);return T("fieldset",{className:"container-fluid format-rule-container",children:[T("div",{className:"form-row",children:[T("div",{className:"form-group col-7 mb-2",children:[h("label",{htmlFor:n,children:"Column Name"}),h("input",{id:n,className:Y("form-control",{"is-invalid":d.hasColumnNameError}),"data-lpignore":!0,type:"text",value:e.columnName,onChange:r,onBlur:l})]}),T("div",{className:"form-group col mb-2",children:[h(U,{kind:"ghost",className:"btn-delete-format-rule float-right",tabIndex:-1,onClick:()=>this.handleFormatRuleDelete(t),icon:sn,tooltip:"Delete","aria-label":"Delete Format Rule"}),h("label",{htmlFor:s,children:"Column Type"}),h("select",{id:s,className:"custom-select",value:e.columnType,onChange:a,children:o})]})]}),h("div",{className:"form-row",children:T("div",{className:"form-group col-12 d-flex mb-2",children:[h("label",{className:"flex-shrink-0 col-form-label mr-3",htmlFor:i,children:"Formatting Rule"}),this.renderFormatRuleInput(t,e.columnType,i,e.format,d.hasFormatError)]})}),h("div",{className:"form-row",children:h("div",{className:"form-group col-12 d-flex mb-2",children:d.message&&h("p",{className:"text-danger",children:d.message})})})]},t)}renderFormatRuleInput(t,e,n,s,i){switch(_.getNormalizedType(e)){case _.dataType.DATETIME:return this.renderDateTimeFormatRuleInput(t,n,s,i);case _.dataType.DECIMAL:return this.renderDecimalFormatRuleInput(t,n,s,i);case _.dataType.INT:return this.renderIntegerFormatRuleInput(t,n,s,i);default:throw new Error(`Unrecognized column type: ${e}`)}}renderDateTimeFormatRuleInput(t,e,n,s){const{showTimeZone:i,showTSeparator:o,timeZone:r}=this.state,l=n.formatString??"";return T("select",{className:Y("custom-select",{"is-invalid":s}),value:l,id:e,onChange:a=>{const d=st.makeFormat("",a.target.value,st.TYPE_GLOBAL);this.handleFormatRuleChange(t,"format",d)},children:[h("option",{value:"",disabled:!0,children:"Select format"},"default"),this.getCachedDateTimeFormatOptions(r,i,o)]})}renderIntegerFormatRuleInput(t,e,n,s){const i=n.formatString??"";return h("input",{className:Y("form-control","flex-grow-1",{"is-invalid":s}),"data-lpignore":!0,id:e,placeholder:Qe.DEFAULT_FORMAT_STRING,type:"text",value:i,onChange:o=>{const r=Qe.makeFormat("",o.target.value,Qe.TYPE_GLOBAL,void 0);this.handleFormatRuleChange(t,"format",r)}})}renderDecimalFormatRuleInput(t,e,n,s){const i=n.formatString??"";return h("input",{className:Y("form-control","flex-grow-1",{"is-invalid":s}),"data-lpignore":!0,id:e,placeholder:ke.DEFAULT_FORMAT_STRING,type:"text",value:i,onChange:o=>{const r=ke.makeFormat("",o.target.value,ke.TYPE_GLOBAL,void 0);this.handleFormatRuleChange(t,"format",r)}})}render(){const{formatRulesChanged:t,formatSettings:e}=this.state,n=e.map((i,o)=>h(Ht,{classNames:"fade",timeout:Xe.transitionMs,onEnter:this.handleFormatRuleEntered,children:this.renderFormatRule(o,i)},i.id)),s=h(U,{kind:"ghost",className:"mb-3",onClick:this.handleFormatRuleCreate,ref:this.addFormatRuleButtonRef,icon:As,children:"Add New Rule"});return T("div",{className:"app-settings-formatting-section",ref:this.containerRef,children:[h("div",{children:"Default formatting for matched column names"}),h("div",{className:"app-settings-menu-description mb-3",children:"Applies a formatting rule to all columns that match a specified name and type."}),h(Wp,{appear:t,enter:t,exit:t,children:n}),s]})}};let Ad=lp;Ad.defaultProps={scrollTo:()=>{},defaults:{defaultDateTimeFormat:st.DEFAULT_DATETIME_FORMAT_STRING,defaultDecimalFormatOptions:{defaultFormatString:ke.DEFAULT_FORMAT_STRING},defaultIntegerFormatOptions:{defaultFormatString:Qe.DEFAULT_FORMAT_STRING},showTimeZone:!1,showTSeparator:!0,timeZone:st.DEFAULT_TIME_ZONE_ID}};Ad.inputDebounceTime=250;const Qy=t=>({formatter:uu(t),defaultDateTimeFormat:du(t),defaultDecimalFormatOptions:cu(t),defaultIntegerFormatOptions:hu(t),showTimeZone:mu(t),showTSeparator:pu(t),truncateNumbersWithPound:gu(t),timeZone:ko(t),settings:Et(t)}),Zy=vt(Qy,{saveSettings:gl})(Ad),Zn=class extends b.exports.Component{constructor(t){super(t),this.handleClose=this.handleClose.bind(this),this.handleScrollTo=this.handleScrollTo.bind(this),this.handleSectionToggle=this.handleSectionToggle.bind(this),this.handleExportSupportLogs=this.handleExportSupportLogs.bind(this),this.menuContentRef=de.createRef(),this.state={expandedSectionKey:Zn.FORMATTING_SECTION_KEY}}static focusFirstInputInContainer(t){const e=t?.querySelector("input, select, textarea");e&&e.focus()}componentDidMount(){Zn.focusFirstInputInContainer(this.menuContentRef.current)}isSectionExpanded(t){const{expandedSectionKey:e}=this.state;return e===t}handleScrollTo(t,e){this.menuContentRef.current?.scrollTo(t,e)}handleSectionToggle(t){this.setState(e=>({expandedSectionKey:e.expandedSectionKey===t?void 0:t}))}handleClose(){const{onDone:t}=this.props;t()}handleExportSupportLogs(){const{serverConfigValues:t}=this.props;Ky(void 0,Object.fromEntries(t))}render(){const t="0.30.1",e="https://github.com/deephaven/web-client-ui/",n="https://deephaven.io/core/docs/",{serverConfigValues:s}=this.props,i=s.get("barrage.version"),o=s.get("java.version"),r=s.get("deephaven.version"),l=(a,d)=>T(be,{children:[h("div",{children:a}),h("div",{children:d})]});return T("div",{className:"app-settings-menu",children:[T("header",{className:"app-settings-menu-header",children:[h("div",{className:"flex-spacer"}),h(U,{kind:"ghost",className:"btn-close-settings-menu",onClick:this.handleClose,icon:h(Z,{icon:Ui,transform:"grow-4"}),tooltip:"Close"})]}),T("div",{className:"app-settings-menu-content",ref:this.menuContentRef,children:[h("h5",{children:"Settings"}),h("hr",{className:"my-0"}),h(Ro,{sectionKey:Zn.FORMATTING_SECTION_KEY,isExpanded:this.isSectionExpanded(Zn.FORMATTING_SECTION_KEY),title:T(be,{children:[h(Z,{icon:lf,transform:"grow-4",className:"mr-2"}),"Default Formatting & Time zone"]}),onToggle:this.handleSectionToggle,children:h(Py,{})}),h(Ro,{sectionKey:Zn.COLUMN_SPECIFIC_SECTION_KEY,isExpanded:this.isSectionExpanded(Zn.COLUMN_SPECIFIC_SECTION_KEY),title:T(be,{children:[h(Z,{icon:af,transform:"grow-4",className:"mr-2"}),"Column Specific Formatting Rules"]}),onToggle:this.handleSectionToggle,children:h(Zy,{scrollTo:this.handleScrollTo})}),h(Ro,{sectionKey:Zn.SHORTCUT_SECTION_KEY,isExpanded:this.isSectionExpanded(Zn.SHORTCUT_SECTION_KEY),title:T(be,{children:[h(Z,{icon:df,transform:"grow-2"})," ","Keyboard Shortcuts"]}),onToggle:this.handleSectionToggle,children:h(Wy,{})}),T("div",{className:"app-settings-footer",children:[T("div",{className:"app-settings-footer-section",children:[T("div",{className:"app-settings-footer-item",children:[h("div",{className:"font-weight-bold",children:"Support"}),T("div",{children:["GitHub:\xA0",h("a",{href:e,className:"custom-link",target:"_blank",rel:"noopener noreferrer",children:e})]}),h(U,{kind:"tertiary",className:"mt-2 py-2",onClick:this.handleExportSupportLogs,children:"Export Logs"})]}),T("div",{className:"app-settings-footer-item",children:[h("div",{className:"font-weight-bold",children:"Documentation"}),h("a",{target:"_blank",rel:"noreferrer noopener",href:n,className:"custom-link",children:n})]}),T("div",{className:"app-settings-footer-item",children:[h("div",{className:"font-weight-bold",children:"Version"}),T("span",{className:"d-inline-block text-muted",children:[r," ",h(Z,{icon:cf}),T(ut,{interactive:!0,children:[T("div",{className:"detailed-server-config",children:[l("Engine Version",r),l("Web UI Version",t),l("Java Version",o),l("Barrage Version",i)]}),h(ll,{tooltip:"Copy version numbers",copy:`Engine Version: ${r}
|
|
39
39
|
Web UI Version: ${t}
|
|
40
40
|
Java Version: ${o}
|
|
41
|
-
Barrage Version: ${i}`,children:"Copy Versions"})]})]})]}),h("div",{className:"app-settings-footer-item",children:h(Hy,{})})]}),h("div",{className:"app-settings-footer-section",children:h("div",{className:"logo",children:h("a",{target:"_blank",rel:"noreferrer noopener",href:"https://deephaven.io",className:"d-inline-block custom-link p-1",children:h("img",{src:Jm,alt:"Deephaven Data Labs",width:"230px"})})})})]})]})]})}};let ji=Zn;ji.defaultProps={onDone:()=>{}};ji.FORMATTING_SECTION_KEY="SettingsMenu.formatting";ji.COLUMN_SPECIFIC_SECTION_KEY="SettingsMenu.columnFormatting";ji.APPLICATION_SECTION_KEY="ApplicationMenu.settings";ji.SHORTCUT_SECTION_KEY="SettingsMenu.shortcuts";const ch=10;function Fi(t){const{forwardedProps:{menuItem:{action:e,title:n,disabled:s},iconElement:i,displayShortcut:o,isMouseSelected:r,isKeyboardSelected:l,closeMenu:a}}=t,d=b.exports.useRef(),c=b.exports.useRef(),u=b.exports.useRef(null),[m,p]=b.exports.useState(!1),g=b.exports.useCallback(S=>{d.current!=null&&c.current!=null&&u.current&&(Math.abs(d.current-S.clientX)>=ch||Math.abs(c.current-S.clientY)>=ch)&&(p(!0),window.removeEventListener("mousemove",g),a(),e(S),u.current=null)},[e,a]);function f(S){d.current=S.clientX,c.current=S.clientY,u.current=S.target,window.addEventListener("mousemove",g)}function C(S){u.current===S.target&&(p(!0),a(),e(),window.removeEventListener("mousemove",g)),u.current=null}return b.exports.useEffect(function(){return function(){return window.removeEventListener("mousemove",g)}},[g]),T("button",{type:"button",className:Y("btn-context-menu",{disabled:s},{active:r&&!s},{"keyboard-active":l&&!s}),onMouseDown:f,onMouseUp:C,disabled:m,children:[h("span",{className:Y("icon"),children:i}),h("span",{className:"title",children:n}),h("span",{className:"shortcut",children:o})]})}function Ld(t){const{handleControlSelect:e,handleToolSelect:n,onClearFilter:s}=t,i=b.exports.useMemo(()=>[{title:"Input Filter",icon:hf,menuElement:h(Fi,{}),action:o=>{e(un.INPUT_FILTER,o)},order:10},{title:"Dropdown Filter",icon:Dh,menuElement:h(Fi,{}),action:o=>{e(un.DROPDOWN_FILTER,o)},order:15},{title:"Markdown Widget",icon:uf,menuElement:h(Fi,{}),action:o=>{e(un.MARKDOWN,o)},order:20},{title:"Filter Sets",icon:ca,menuElement:h(Fi,{}),action:o=>{e(un.FILTER_SET_MANAGER,o)},order:25},{disabled:!0,menuElement:h("div",{className:"context-menu-group-header",children:"Tools"}),order:30},{title:"Linker",icon:yh,action:()=>{n(Wt.LINKER)},order:40,shortcut:ls.LINKER},{disabled:!0,menuElement:h("div",{className:"context-menu-group-header",children:"Actions"}),order:50},{title:"Clear All Filters",icon:mf,action:()=>{s()},order:60,shortcut:en.TABLE.CLEAR_ALL_FILTERS}],[e,n,s]);return h(ns,{popperClassName:"controls-menu-popper",actions:i})}Ld.propTypes={handleControlSelect:M.exports.func,handleToolSelect:M.exports.func,onClearFilter:M.exports.func};Ld.defaultProps={handleControlSelect:()=>{},handleToolSelect:()=>{},onClearFilter:()=>{}};Fi.propTypes={forwardedProps:M.exports.shape({iconElement:M.exports.node,displayShortcut:M.exports.string,isMouseSelected:M.exports.bool.isRequired,isKeyboardSelected:M.exports.bool.isRequired,closeMenu:M.exports.func.isRequired,menuItem:M.exports.shape({action:M.exports.func,title:M.exports.string,disabled:M.exports.bool}).isRequired})};Fi.defaultProps={forwardedProps:null};const Jy=Ls(Zm,null),eR={layoutStorage:Jy},tR=t=>t.layoutStorage,nR=t=>t.serverConfigValues;Object.entries(eR).map(([t,e])=>Gi.register(t,e));const hh=10;function sR(t){const{onExportLayout:e,onImportLayout:n,onResetLayout:s,onSelect:i,widgets:o=[]}=t,[r,l]=b.exports.useState(!1),[a,d]=b.exports.useState(""),c=b.exports.useRef(null),u=b.exports.useRef(),m=b.exports.useCallback((y,E)=>{y!=null&&i(y,E)},[i]),p=b.exports.useCallback(y=>{d(y.target.value)},[]),g=b.exports.useCallback(y=>{u.current!=null&&(Math.abs(u.current.x-y.clientX)>=hh||Math.abs(u.current.y-y.clientY)>=hh)&&(l(!0),window.removeEventListener("mousemove",g),m(u.current.widget,y),u.current=void 0)},[u,m]),f=b.exports.useCallback((y,E)=>{u.current={x:y.clientX,y:y.clientY,widget:E},window.addEventListener("mousemove",g)},[g]),C=b.exports.useCallback((y,E)=>{window.removeEventListener("mousemove",g),u.current?.widget===E&&(l(!0),m(E)),u.current=void 0},[g,u,m]),S=b.exports.useMemo(()=>o.filter(y=>a?y.name?.toLowerCase().includes(a.toLowerCase()):!0),[a,o]).sort((y,E)=>y.name?.localeCompare(E.name??"")??0),w=b.exports.useMemo(()=>S.map(y=>h("li",{children:T(U,{kind:"ghost","data-testid":`panel-list-item-${y.name??""}-button`,onMouseDown:E=>{f(E,y)},onMouseUp:E=>{C(E,y)},onKeyDown:E=>{(E.key==="Enter"||E.key===" ")&&m(y)},disabled:r,onClick:()=>{},children:[h(Lh,{type:y.type})," ",y.name??""]})},y.name)),[S,r,f,C,m]),v=b.exports.useMemo(()=>w.length===0?h("span",{children:"No bound variables found."}):null,[w]);return T("div",{className:"widget-list-container d-flex flex-column",children:[h("div",{className:"widget-list-header",children:h(Bi,{value:a,placeholder:"Find Table, Plot or Widget",onChange:p,ref:c})}),T("ul",{className:"widget-list flex-grow-1",children:[v&&h("li",{className:"widget-list-message",children:v}),!v&&w]}),h("div",{children:h("hr",{})}),T("div",{className:"widget-list-footer",children:[T(U,{kind:"ghost",onClick:e,children:[T("div",{className:"fa-md fa-layers",children:[h(Z,{mask:da,icon:jd,transform:"right-5 down-5"}),h(Z,{icon:jd,transform:"right-8 down-6"})]}),"Export Layout"]}),T(U,{kind:"ghost",onClick:n,children:[T("div",{className:"fa-md fa-layers",children:[h(Z,{mask:da,icon:ha,transform:"right-5 down-5"}),h(Z,{icon:ha,transform:"right-8 down-6"})]}),"Import Layout"]}),h(U,{kind:"ghost",icon:ei,onClick:s,tooltip:"Reset Layout"})]})]})}const iR=async(t,e,n)=>{let s,i,o,r;if(Er(e)?(s=e.settings,i=e.table,o=void 0,r=e.tableSettings):(s={},i="",o=e.figure,r={}),n!==void 0&&(n.tableSettings!=null&&(r=n.tableSettings),n.table!=null&&(i=n.table),n.figure!=null&&(o=n.figure),n.settings!=null&&(s={...s,...n.settings})),o!==void 0){const d={title:o,name:o,type:I.VariableType.FIGURE},c=await t.getObject(d);return Oi.makeModel(s,c)}const l={title:o,name:i,type:I.VariableType.TABLE},a=await t.getObject(l);return te.applyTableSettings(a,r,ko(Cl.getState())),Oi.makeModelFromSettings(s,a)},oR=async(t,e,n=I.VariableType.TABLE)=>{const{table:s}=e,i={title:s,name:s,type:n},o=await t.getObject(i);return Cd.makeModel(o)};function rR({onAutoFillClick:t=()=>{}}){return T("div",{className:"empty-dashboard-container",children:[T("div",{className:"hint-container",children:[h(Z,{icon:Fh})," ",h("br",{}),"Use the panel list to add objects from a query."]}),T("div",{className:"empty-dashboard",children:[h("div",{className:"add-panels-hint",children:"Drag Panels Here"}),h(U,{kind:"tertiary",onClick:t,children:"Auto fill objects"})]})]})}function lR(t){return t.version===2}function aR(t){return Array.isArray(t)}const br=J.module("UserLayoutUtils"),dR={layoutConfig:[{type:"column",content:[{type:"row",height:40,content:[{type:"stack",content:[{type:"react-component",component:Ii.COMPONENT,title:Ii.TITLE,isClosable:!1},{type:"react-component",component:Kr.COMPONENT,title:Kr.TITLE,isClosable:!1}]},{type:"stack",width:25,content:[{type:"react-component",component:zr.COMPONENT,title:zr.TITLE,isClosable:!1},{type:"react-component",component:qr.COMPONENT,title:qr.TITLE,isClosable:!1}]}]},{type:"row",content:[{type:"stack",title:"Notebooks",content:[]}]}]}],links:[],filterSets:[],version:2},cR={layoutConfig:[],links:[],filterSets:[],version:2};function ap(t){if(lR(t))return t;if(aR(t))return{layoutConfig:t,links:[],filterSets:[],version:2};throw new Error(`Unexpected layout import format: ${t}`)}async function hR(t,e=!0){try{const n=await t.getLayouts();if(n.length>0)try{const s=await t.getLayout(n[0]);return ap(s)}catch(s){br.error("Unable to load layout",n[0],":",s),br.warn("No valid layouts found, falling back to default layout")}}catch(n){br.error("Unable to fetch layout list",n),br.warn("Falling back to default layout")}return e?dR:cR}function uR(t){const{filterSets:e,layoutConfig:n,links:s}=t;return{filterSets:e,layoutConfig:n,links:s,version:2}}const Dr={exportLayout:uR,getDefaultLayout:hR,normalizeLayout:ap},wr=J.module("DownloadServiceWorkerUtils"),dp=class{static registerOnLoaded(){new URL("/ide/",window.location.href).origin===window.location.origin&&("serviceWorker"in navigator?window.addEventListener("load",()=>{const e=new URL("/ide/download/serviceWorker.js",window.location.href);navigator.serviceWorker.register(e).then(n=>{n.update(),wr.info("Registering service worker on ",e,n)}).catch(n=>{wr.error("Failed to register service worker",n)})}):wr.info("Service worker is not supported."))}static async getServiceWorker(){if("serviceWorker"in navigator){const e=(await navigator.serviceWorker.getRegistrations()).find(n=>n.scope.endsWith(dp.DOWNLOAD_PATH));if(e&&e.active)return wr.info("Download service worker is active."),e.active;throw new Error("Can not find download service worker.")}throw new Error("Download service worker is not available.")}static unregisterSW(){}};let Xr=dp;Xr.DOWNLOAD_PATH="/download/";const cp={react:de},mR=zp(cp),pR=qp({requires:mR}),gR=Yp.createRequires(cp),fR=Kp({requires:gR}),CR=J.module("PluginUtils");class Ma{static loadComponentPlugin(e){if("".split(",").includes(e)){const o=de.lazy(()=>ff(()=>import(`./internal/${e}`),[])),r=de.forwardRef((l,a)=>h(b.exports.Suspense,{fallback:h("div",{children:"Loading Plugin..."}),children:h(o,{ref:a,...l})}));return r.pluginName=e,r.displayName="Local Plugin",r}const n=new URL("/ide/plugins/",`${window.location}`),s=new URL(`${e}.js`,n),i=de.forwardRef((o,r)=>h(pR,{url:s,render:({err:l,Component:a})=>{if(l!=null&&l!==""){const d=`Error loading plugin ${e} from ${s} due to ${l}`;return CR.error(d),h("div",{className:"error-message",children:`${d}`})}return h(a,{ref:r,...o})}}));return i.pluginName=e,i.displayName="Plugin",i}static async loadModulePlugin(e){return await fR(e)}static async loadJson(e){return new Promise((n,s)=>{const i=new XMLHttpRequest;i.addEventListener("load",()=>{try{const o=JSON.parse(i.responseText);n(o)}catch(o){s(o)}}),i.addEventListener("error",o=>{s(o)}),i.open("GET",e),i.send()})}}const Ot=J.module("AppMainContainer");class Io extends b.exports.Component{constructor(e){super(e),this.getDashboardPlugins=ge(n=>[...n.entries()].filter(([,s])=>s.DashboardPlugin!=null).map(([s,{DashboardPlugin:i}])=>h(i,{},s))),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.importElement=de.createRef(),this.state={contextActions:[{action:()=>{this.handleToolSelect(Wt.LINKER)},shortcut:ls.LINKER,isGlobal:!0},{action:()=>{this.sendClearFilter()},shortcut:en.TABLE.CLEAR_ALL_FILTERS,isGlobal:!0},{action:()=>{Ot.debug("Consume unhandled save shortcut")},shortcut:ls.SAVE,isGlobal:!0}],isPanelsMenuShown:!1,isSettingsMenuShown:!1,widgets:[]}}static handleWindowBeforeUnload(e){e.preventDefault(),e.returnValue=""}static hydrateConsole(e,n){return wa.hydrate({...e,unzip:s=>Sh.loadAsync(s).then(i=>Object.values(i.files))},n)}componentDidMount(){this.initWidgets(),window.addEventListener("beforeunload",Io.handleWindowBeforeUnload)}componentDidUpdate(e){const{dashboardData:n}=this.props;e.dashboardData!==n&&this.handleDataChange(n)}componentWillUnmount(){this.deinitWidgets(),window.removeEventListener("beforeunload",Io.handleWindowBeforeUnload)}initWidgets(){const{connection:e}=this.props;if(e.subscribeToFieldUpdates==null){Ot.warn("subscribeToFieldUpdates not supported, not initializing widgets");return}this.widgetListenerRemover=e.subscribeToFieldUpdates(n=>{Ot.debug("Got updates",n),this.setState(({widgets:s})=>{const{updated:i,created:o,removed:r}=n,l=[...i,...r],a=s.filter(c=>!l.some(u=>u.name===c.name));return[...i,...o].forEach(c=>{c.name!=null&&c.name!==""&&a.push(c)}),{widgets:a}})})}deinitWidgets(){this.widgetListenerRemover?.()}openNotebookFromURL(){const{match:e}=this.props,{notebookPath:n}=e.params;if(n){const{session:s,sessionConfig:i}=this.props;if(s==null||i==null){Ot.error("No session available to open notebook URL",n);return}const o={id:`/${n}`,itemName:`/${n}`},r=i.type,l={value:null,language:r};this.emitLayoutEvent(Ae.SELECT_NOTEBOOK,s,r,l,o,!0)}}sendClearFilter(){this.emitLayoutEvent(Le.CLEAR_ALL_FILTERS)}emitLayoutEvent(e,...n){this.goldenLayout?.eventHub.emit(e,...n)}handleError(e){ye.isCanceled(e)||Ot.error(e)}handleSettingsMenuHide(){this.setState({isSettingsMenuShown:!1})}handleSettingsMenuShow(){this.setState({isSettingsMenuShown:!0})}handleControlSelect(e,n=null){switch(Ot.debug("handleControlSelect",e),e){case un.DROPDOWN_FILTER:this.emitLayoutEvent(Le.OPEN_DROPDOWN,{title:"DropdownFilter",type:e,createNewStack:!0,dragEvent:n});break;case un.INPUT_FILTER:this.emitLayoutEvent(Le.OPEN_INPUT,{title:"InputFilter",type:e,createNewStack:!0,dragEvent:n});break;case un.MARKDOWN:this.emitLayoutEvent(km.OPEN,{title:"Markdown",type:e,dragEvent:n});break;case un.FILTER_SET_MANAGER:this.emitLayoutEvent(Le.OPEN_FILTER_SET_MANAGER,{title:"FilterSets",type:e,dragEvent:n});break;default:throw new Error(`Unrecognized control type ${e}`)}}handleToolSelect(e){Ot.debug("handleToolSelect",e);const{activeTool:n,setActiveTool:s}=this.props;s(n===e?Wt.DEFAULT:e)}handleClearFilter(){this.sendClearFilter()}handleDataChange(e){const{updateWorkspaceData:n}=this.props,{closed:s,filterSets:i,links:o}=e;n({closed:s,filterSets:i,links:o})}handleGoldenLayoutChange(e){this.goldenLayout=e}handleLayoutConfigChange(e){const{updateWorkspaceData:n}=this.props;n({layoutConfig:e})}handleWidgetMenuClick(){this.setState(({isPanelsMenuShown:e})=>({isPanelsMenuShown:!e}))}handleWidgetSelect(e,n){this.setState({isPanelsMenuShown:!1}),Ot.debug("handleWidgetSelect",e,n),this.openWidget(e,n)}handleWidgetsMenuClose(){this.setState({isPanelsMenuShown:!1})}handleAutoFillClick(){const{widgets:e}=this.state;Ot.debug("handleAutoFillClick",e);const n=e.sort((s,i)=>s.title!=null&&i.title!=null?s.title.localeCompare(i.title):0);for(let s=0;s<n.length;s+=1)this.openWidget(n[s])}handleExportLayoutClick(){Ot.info("handleExportLayoutClick"),this.setState({isPanelsMenuShown:!1});try{const{workspace:e}=this.props,{data:n}=e,s=Dr.exportLayout(n);Ot.info("handleExportLayoutClick exportedConfig",s);const i=new Blob([JSON.stringify(s)],{type:"application/json"}),o=I.i18n.DateTimeFormat.format("yyyy-MM-dd-HHmmss",new Date),r=document.createElement("a");r.href=URL.createObjectURL(i),r.download=`deephaven-app-layout-${o}.json`,r.click()}catch(e){Ot.error("Unable to export layout",e)}}handleImportLayoutClick(){Ot.info("handleImportLayoutClick"),this.setState({isPanelsMenuShown:!1}),this.importElement.current!=null&&(this.importElement.current.value="",this.importElement.current.click())}handleResetLayoutClick(){Ot.info("handleResetLayoutClick"),this.setState({isPanelsMenuShown:!1}),this.resetLayout()}handleImportLayoutFiles(e){e.stopPropagation(),e.preventDefault(),e.target.files!=null&&this.importLayoutFile(e.target.files?.[0])}async importLayoutFile(e){try{const{updateDashboardData:n,updateWorkspaceData:s}=this.props,i=await e.text(),o=JSON.parse(i),{filterSets:r,layoutConfig:l,links:a}=Dr.normalizeLayout(o);s({layoutConfig:l}),n(Sn,{filterSets:r,links:a})}catch(n){Ot.error("Unable to import layout",n)}}async resetLayout(){const{layoutStorage:e,session:n}=this.props,{filterSets:s,layoutConfig:i,links:o}=await Dr.getDefaultLayout(e,n!==void 0),{updateDashboardData:r,updateWorkspaceData:l}=this.props;l({layoutConfig:i}),r(Sn,{filterSets:s,links:o})}handlePaste(e){if(e.target instanceof HTMLElement&&e.target.closest(".monaco-editor"))return;const{clipboardData:n}=e,s=n.getData("Text"),i=/“|”/g;i.test(s)&&(e.preventDefault(),e.stopPropagation(),document.execCommand("insertText",!1,s.replace(i,'"')))}handleLoadTablePlugin(e){const{plugins:n}=this.props,s=n.get(e);return s!=null&&s.TablePlugin!=null?s.TablePlugin:Ma.loadComponentPlugin(e)}hydrateDefault(e,n){const{connection:s}=this.props,{metadata:i}=e;if(i?.type!=null&&(i?.id!=null||i?.name!=null)){const o=i.id!=null?{type:i.type,id:i.id}:{type:i.type,name:i.name,title:i.name};return{fetch:()=>s.getObject(o),localDashboardId:n,...e}}return wa.hydrate(e,n)}hydrateGrid(e,n){return this.hydrateTable(e,n,e.metadata.type??I.VariableType.TABLE)}hydratePandas(e,n){return this.hydrateTable(e,n,I.VariableType.PANDAS)}hydrateTable(e,n,s=I.VariableType.TABLE){const{connection:i}=this.props;return{...e,getDownloadWorker:Xr.getServiceWorker,loadPlugin:this.handleLoadTablePlugin,localDashboardId:n,makeModel:()=>oR(i,e.metadata,s)}}hydrateChart(e,n){const{connection:s}=this.props;return{...e,localDashboardId:n,makeModel:()=>{const{metadata:i,panelState:o}=e;return iR(s,i,o)}}}openWidget(e,n){const{connection:s}=this.props;this.emitLayoutEvent(Ee.OPEN,{dragEvent:n,fetch:()=>s.getObject(e),widget:e})}render(){const{activeTool:e,plugins:n,user:s,workspace:i,serverConfigValues:o}=this.props,{data:r}=i,{layoutConfig:l}=r,{permissions:a}=s,{canUsePanels:d}=a,{contextActions:c,isPanelsMenuShown:u,isSettingsMenuShown:m,widgets:p}=this.state,g=this.getDashboardPlugins(n);return T("div",{className:Y("app-main-tabs","w-100","h-100","d-flex","flex-column",e?`active-tool-${e.toLowerCase()}`:""),onPaste:this.handlePaste,tabIndex:-1,children:[h("nav",{className:"nav-container",children:T("div",{className:"app-main-top-nav-menus",children:[h("img",{src:Jm,alt:"Deephaven Data Labs",width:"115px",className:"ml-1"}),T("div",{children:[T(U,{kind:"ghost",className:"btn-panels-menu",icon:pf,onClick:()=>{},children:["Controls",h(Ld,{handleControlSelect:this.handleControlSelect,handleToolSelect:this.handleToolSelect,onClearFilter:this.handleClearFilter})]}),d&&T(U,{kind:"ghost",className:"btn-panels-menu btn-show-panels","data-testid":"app-main-panels-button",onClick:this.handleWidgetMenuClick,icon:gf,children:["Panels",h(tl,{isShown:u,className:"panels-menu-popper",onExited:this.handleWidgetsMenuClose,closeOnBlur:!0,interactive:!0,children:h(sR,{widgets:p,onExportLayout:this.handleExportLayoutClick,onImportLayout:this.handleImportLayoutClick,onResetLayout:this.handleResetLayoutClick,onSelect:this.handleWidgetSelect})})]}),h(U,{kind:"ghost",className:Y("btn-settings-menu",{"text-warning":s.operateAs!==s.name}),onClick:this.handleSettingsMenuShow,icon:h(Z,{icon:_o,transform:"grow-3 right-1 down-1"}),tooltip:"User Settings"})]})]})}),T(Zb,{emptyDashboard:h(rR,{onAutoFillClick:this.handleAutoFillClick}),id:Sn,layoutConfig:l,onGoldenLayoutChange:this.handleGoldenLayoutChange,onLayoutConfigChange:this.handleLayoutConfigChange,onLayoutInitialized:this.openNotebookFromURL,hydrate:this.hydrateDefault,children:[h(dy,{hydrate:this.hydrateGrid,getDownloadWorker:Xr.getServiceWorker,loadPlugin:this.handleLoadTablePlugin}),h(sy,{hydrate:this.hydrateChart}),h(iy,{}),h(ry,{hydrateConsole:Io.hydrateConsole,notebooksUrl:new URL("/notebooks/",`${window.location}`).href}),h(ly,{}),h(Cy,{hydrate:this.hydratePandas}),h(fy,{}),h(gy,{}),g]}),h(Ht,{in:m,timeout:Xe.transitionMidMs,classNames:"slide-left",mountOnEnter:!0,unmountOnExit:!0,children:h(ji,{serverConfigValues:o,onDone:this.handleSettingsMenuHide})}),h(le,{actions:c}),h("input",{ref:this.importElement,type:"file",accept:".json",style:{display:"none"},onChange:this.handleImportLayoutFiles})]})}}const SR=t=>({activeTool:pl(t),dashboardData:Yt(t,Sn),layoutStorage:tR(t),plugins:nS(t),connection:mE(t,Sn),session:ai(t,Sn)?.session,sessionConfig:ai(t,Sn)?.config,user:ru(t),workspace:ml(t),serverConfigValues:nR(t)}),bR=vt(SR,{setActiveTool:fl,updateDashboardData:Vn,updateWorkspaceData:Ru})(Xp(Io));function wR(){return T("div",{className:"app",children:[h(bR,{}),h(kh,{})]})}const TR=J.module("LocalWorkspaceStorage"),wo=class{static async makeDefaultWorkspaceData(t,e){const{filterSets:n,links:s,layoutConfig:i}=await Dr.getDefaultLayout(t,e?.isConsoleAvailable);return{settings:{defaultDateTimeFormat:st.DEFAULT_DATETIME_FORMAT_STRING,formatter:[],timeZone:st.DEFAULT_TIME_ZONE_ID,showTimeZone:!1,showTSeparator:!0,disableMoveConfirmation:!1,defaultDecimalFormatOptions:{defaultFormatString:ke.DEFAULT_FORMAT_STRING},defaultIntegerFormatOptions:{defaultFormatString:Qe.DEFAULT_FORMAT_STRING},truncateNumbersWithPound:!1,defaultNotebookSettings:{isMinimapEnabled:!1}},layoutConfig:i,closed:[{}],links:s,filterSets:n}}static async makeDefaultWorkspace(t,e){return{data:await wo.makeDefaultWorkspaceData(t,e)}}constructor(t){this.layoutStorage=t}async load(t){try{return JSON.parse(localStorage.getItem(wo.STORAGE_KEY)??"")}catch{return TR.info("Unable to load workspace data, initializing to default data"),wo.makeDefaultWorkspace(this.layoutStorage,t)}}async save(t){return localStorage.setItem(wo.STORAGE_KEY,JSON.stringify(t)),t}};let hp=wo;hp.STORAGE_KEY="deephaven.WorkspaceStorage";class vR extends Error{constructor(){super(...arguments),this.isNoConsolesError=!0}}function ER(t){return t.isNoConsolesError}const ks=J.module("SessionUtils");var up=(t=>(t.ANONYMOUS="anonymous",t.PARENT="parent",t))(up||{});function yR(){return new URL("/jsapi",`${window.location}`)}function mp(){const t=yR();return`${t.protocol}//${t.host}`}function RR(){switch(new URLSearchParams(window.location.search).get("authProvider")){case"parent":return"parent";default:return"anonymous"}}function IR(){const t=mp();return ks.info(`Starting connection to '${t}'...`),new I.IdeConnection(t)}async function FR(t){ks.info("Getting console types...");const e=await t.getConsoleTypes();if(ks.info("Available types:",e),e.length===0)throw new vR("No console types available");const n=e[0];ks.info("Starting session with type",n);const s=await t.startSession(n),i={type:n,id:$e.generate()};return ks.info("Console session established",i),{session:s,config:i,connection:t}}function DR(){const t=mp();return ks.info("createCoreClient",t),new I.CoreClient(t)}async function NR(){if(window.opener==null)throw new Error("window.opener is null, unable to send auth request.");return new Promise(t=>{const e=n=>{const{data:s}=n;if(ks.debug("Received message",s),s?.message!=="loginOptions"){ks.debug("Ignore received message",s);return}window.removeEventListener("message",e),t(s.payload)};window.addEventListener("message",e),window.opener.postMessage("requestLoginOptionsFromParent","*")})}async function _R(t){switch(t){case"parent":return NR();case"anonymous":return{type:I.CoreClient.LOGIN_TYPE_ANONYMOUS};default:throw new Error(`Unknown auth type: ${t}`)}}class MR{constructor(e,n=""){this.storageService=e,this.root=n}async getLayouts(){return(await this.storageService.listItems(this.root,"*.json")).map(n=>n.basename)}async getLayout(e){const s=await(await this.storageService.loadFile(`${this.root}/${e}`)).text();return JSON.parse(s)}}const mo=J.module("GrpcFileStorageTable"),ka=class{constructor(t,e="",n=e){this.currentSize=0,this.listeners=[],this.childTables=new Map,this.storageService=t,this.baseRoot=e,this.root=n,n===e&&(this.doRefresh=Je(this.doRefresh.bind(this),ka.REFRESH_DEBOUNCE))}removeBaseRoot(t){return me.removeRoot(this.baseRoot,t)}getViewportData(){return this.viewportUpdatePromise||this.refreshInternal(),this.viewportUpdatePromise??Promise.resolve({items:[],offset:0})}getSnapshot(t){throw new Error("Method not implemented.")}get size(){return this.currentSize}setExpanded(t,e){const n=t.split("/");let s=n.shift();if((s===void 0||s==="")&&(s=n.shift()),s===void 0||s==="")throw new Error(`Invalid path: ${t}`);const i=n.join("/");if(e){if(!this.childTables.has(s)){const o=new ka(this.storageService,this.baseRoot,`${this.root}/${s}`);this.childTables.set(s,o)}i&&this.childTables.get(s)?.setExpanded(i,e)}else this.childTables.has(s)&&(i?this.childTables.get(s)?.setExpanded(i,e):this.childTables.delete(s));this.currentViewport&&this.refreshInternal()}collapseAll(){this.childTables.clear(),this.currentViewport&&this.refreshInternal()}setSearch(t){throw new Error("Method not implemented.")}setViewport(t){this.currentViewport=t,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(t){return this.listeners=[...this.listeners,t],()=>{this.listeners=this.listeners.filter(e=>e!==t)}}doRefresh(t){mo.debug2("doRefresh",this.root),t(this.fetchData())}refresh(){mo.debug2("refresh",this.root),this.viewportUpdatePromise?.cancel();const t=new Promise(n=>{this.doRefresh(n)}),e=ye.makeCancelable(t.then(n=>{if(this.viewportUpdatePromise!==e)throw new Zr;return this.currentViewportData=n,this.sendUpdate(),n}));e.catch(n=>{ye.isCanceled(n)||mo.error("Error updating viewport",n)}),this.viewportUpdatePromise=e}refreshInternal(){try{this.refresh()}catch(t){ye.isCanceled(t)||mo.error("Unable to refresh data",t)}}async fetchData(){const{currentViewport:t}=this;if(!t)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:r}=i;if(r===this.removeBaseRoot(`${this.root}/${o}`)&&i.type==="directory"){const l=this.childTables.get(o);if(l!=null){l.setViewport({top:0,bottom:t.bottom-s});const a=await l.getViewportData();n.splice(s+1,0,...a.items)}}}return this.currentSize=n.length,mo.debug2(this.root,"items",n,t),n=n.slice(t.top,t.bottom),{items:n,offset:t.top}}sendUpdate(){const{listeners:t}=this,e=this.currentViewportData??{items:[],offset:0};for(let n=0;n<t.length;n+=1)t[n](e)}};let pp=ka;pp.REFRESH_DEBOUNCE=50;const kR=J.module("GrpcFileStorage"),gp=class{constructor(t,e=""){this.tables=[],this.refreshTables=Ln(()=>{this.tables.forEach(n=>n.refresh())},gp.REFRESH_THROTTLE),this.storageService=t,this.root=e}removeRoot(t){return me.removeRoot(this.root,t)}addRoot(t){return me.addRoot(this.root,t)}async createDirectory(t){return await this.storageService.createDirectory(this.addRoot(t)),this.refreshTables(),{type:"directory",id:t,filename:t,basename:me.getBaseName(t)}}async getTable(){const t=new pp(this.storageService,this.root);return this.tables.push(t),t}async saveFile(t){const e=dh.storage.FileContents.text(t.content);return await this.storageService.saveFile(this.addRoot(t.filename),e,!0),this.refreshTables(),t}async loadFile(t){const n=await(await this.storageService.loadFile(this.addRoot(t))).text();return{filename:t,basename:me.getBaseName(t),content:n}}async deleteFile(t){await this.storageService.deleteItem(this.addRoot(t)),this.refreshTables()}async moveFile(t,e){await this.storageService.moveItem(this.addRoot(t),this.addRoot(e)),this.refreshTables()}async info(t){const e=await this.storageService.listItems(this.addRoot(me.getPath(t)),me.getBaseName(t));if(e.length===0)throw new Fd;if(e.length>1)throw kR.error("More than one matching file found, should never happen.",e),new Error("More than one matching file found");const n=e[0];return{filename:this.removeRoot(n.filename),basename:n.basename,id:this.removeRoot(n.filename),type:n.type}}};let fp=gp;fp.REFRESH_THROTTLE=150;const xs=J.module("AppInit");async function xR(){xs.debug("Loading plugins...");try{const t=await Ma.loadJson("/js-plugins/manifest.json");xs.debug("Plugin manifest loaded:",t);const e=[];for(let i=0;i<t.plugins.length;i+=1){const{name:o,main:r}=t.plugins[i],l=`/js-plugins/${o}/${r}`;e.push(Ma.loadModulePlugin(l))}const n=await Promise.all(e),s=new Map;for(let i=0;i<n.length;i+=1){const{name:o}=t.plugins[i];s.set(o,n[i])}return xs.info("Plugins loaded:",s),s}catch(t){return xs.error("Unable to load plugins:",t),new Map}}async function OR(t){let e;try{e=await FR(t)}catch(n){if(!ER(n))throw n}return e}function Pd(t){const{workspace:e,setActiveTool:n,setCommandHistoryStorage:s,setDashboardData:i,setFileStorage:o,setLayoutStorage:r,setDashboardConnection:l,setDashboardSessionWrapper:a,setPlugins:d,setUser:c,setWorkspace:u,setWorkspaceStorage:m,setServerConfigValues:p}=t,[g,f]=b.exports.useState(),[C,S]=b.exports.useState(!0),w=b.exports.useCallback(async()=>{try{xs.info("Initializing Web UI","0.30.0",navigator.userAgent);const F=DR(),D=RR();xs.info(`Login using auth type ${D}...`),await F.login(await _R(D));const N=await xR(),P=await(D===up.ANONYMOUS&&F.getAsIdeConnection==null?IR():F.getAsIdeConnection());P.addEventListener(I.IdeConnection.HACK_CONNECTION_FAILURE,Se=>{const{detail:Re}=Se;xs.error("Connection failure",`${JSON.stringify(Re)}`),f(`Unable to connect: ${Re.details??"Unknown Error"}`)});const H=await OR(P),A="user",q=F.getStorageService(),B=new MR(q,"/layouts"),K=new fp(q,"/notebooks"),x=new hp(B),O=new Ny,G=await x.load({isConsoleAvailable:H!==void 0}),{data:ee}=G,{settings:ne}=ee;ne.defaultDecimalFormatOptions===void 0&&(ne.defaultDecimalFormatOptions={defaultFormatString:ke.DEFAULT_FORMAT_STRING}),ne.defaultIntegerFormatOptions===void 0&&(ne.defaultIntegerFormatOptions={defaultFormatString:Qe.DEFAULT_FORMAT_STRING}),ne.truncateNumbersWithPound===void 0&&(ne.truncateNumbersWithPound=!1);const{shortcutOverrides:V={}}=ne,X=fn.isMacPlatform?V.mac??{}:V.windows??{};Object.entries(X).forEach(([Se,Re])=>{qe.get(Se)?.setKeyState(Re)});const se={filterSets:ee.filterSets,links:ee.links},ce=await F.getServerConfigValues(),Q=new Map(ce),he={name:A,operateAs:A,groups:[],permissions:{isSuperUser:!1,isQueryViewOnly:!1,isNonInteractive:!1,canUsePanels:!0,canCreateDashboard:!0,canCreateCodeStudio:!0,canCreateQueryMonitor:!0,canCopy:Q.get("internal.webClient.appInit.canCopy")!=="false",canDownloadCsv:Q.get("internal.webClient.appInit.canDownloadCsv")!=="false"}};n(Wt.DEFAULT),p(Q),s(O),i(Sn,se),o(K),r(B),l(Sn,P),H!==void 0&&a(Sn,H),d(N),c(he),m(x),u(G)}catch(F){xs.error(F),f(F)}},[n,s,i,o,r,l,a,d,c,u,m,p]),v=b.exports.useCallback(()=>{document.fonts!=null?document.fonts.ready.then(()=>{S(!1)}):S(!1)},[]);b.exports.useEffect(function(){w(),v()},[w,v]);const y=e==null&&g==null||C,E=!y&&g==null,R=g!=null?`${g}`:null;return T(be,{children:[E&&h(wR,{}),h(Jr,{isLoading:y,isLoaded:E,errorMessage:R}),T("div",{id:"preload-fonts",style:{visibility:"hidden",position:"absolute",top:-1e4},children:[h("p",{className:"fira-sans-regular",children:"preload"}),h("p",{className:"fira-sans-semibold",children:"preload"}),h("p",{className:"fira-mono",children:"preload"})]})]})}Pd.propTypes={workspace:M.exports.shape({}),workspaceStorage:M.exports.shape({close:M.exports.func}),setActiveTool:M.exports.func.isRequired,setCommandHistoryStorage:M.exports.func.isRequired,setDashboardData:M.exports.func.isRequired,setFileStorage:M.exports.func.isRequired,setLayoutStorage:M.exports.func.isRequired,setDashboardConnection:M.exports.func.isRequired,setDashboardSessionWrapper:M.exports.func.isRequired,setPlugins:M.exports.func.isRequired,setUser:M.exports.func.isRequired,setWorkspace:M.exports.func.isRequired,setWorkspaceStorage:M.exports.func.isRequired};Pd.defaultProps={workspace:null,workspaceStorage:null};const AR=t=>({workspace:ml(t),workspaceStorage:JC(t)}),uh=vt(AR,{setActiveTool:fl,setCommandHistoryStorage:oS,setDashboardData:Xu,setFileStorage:rS,setLayoutStorage:_y,setDashboardConnection:pE,setDashboardSessionWrapper:gE,setPlugins:aS,setUser:sS,setWorkspace:yu,setWorkspaceStorage:iS,setServerConfigValues:dS})(Pd);function LR(){return h(jp,{basename:"/ide/",children:T(Qp,{children:[h($d,{exact:!0,path:"/",component:uh}),h($d,{path:"/notebook/:notebookPath+",component:uh}),h(Zp,{from:"*",to:"/"})]})})}Boolean(window.location.hostname==="localhost"||window.location.hostname==="[::1]"||window.location.hostname.match(/^127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/));function PR(){"serviceWorker"in navigator&&navigator.serviceWorker.getRegistrations().then(t=>{t.forEach(e=>{e.scope.endsWith("/download/")||e.unregister()})})}function GR(){return b.exports.useEffect(()=>{PR(),Xr.registerOnLoaded(),lt.init({getWorker:()=>new Cf}),window["__react-beautiful-dnd-disable-dev-warnings"]=!0},[]),h(ph,{store:Cl,children:h(LR,{})})}export{GR as AppRoot,GR as default};
|
|
42
|
-
//# sourceMappingURL=AppRoot.
|
|
41
|
+
Barrage Version: ${i}`,children:"Copy Versions"})]})]})]}),h("div",{className:"app-settings-footer-item",children:h(Hy,{})})]}),h("div",{className:"app-settings-footer-section",children:h("div",{className:"logo",children:h("a",{target:"_blank",rel:"noreferrer noopener",href:"https://deephaven.io",className:"d-inline-block custom-link p-1",children:h("img",{src:Jm,alt:"Deephaven Data Labs",width:"230px"})})})})]})]})]})}};let ji=Zn;ji.defaultProps={onDone:()=>{}};ji.FORMATTING_SECTION_KEY="SettingsMenu.formatting";ji.COLUMN_SPECIFIC_SECTION_KEY="SettingsMenu.columnFormatting";ji.APPLICATION_SECTION_KEY="ApplicationMenu.settings";ji.SHORTCUT_SECTION_KEY="SettingsMenu.shortcuts";const ch=10;function Fi(t){const{forwardedProps:{menuItem:{action:e,title:n,disabled:s},iconElement:i,displayShortcut:o,isMouseSelected:r,isKeyboardSelected:l,closeMenu:a}}=t,d=b.exports.useRef(),c=b.exports.useRef(),u=b.exports.useRef(null),[m,p]=b.exports.useState(!1),g=b.exports.useCallback(S=>{d.current!=null&&c.current!=null&&u.current&&(Math.abs(d.current-S.clientX)>=ch||Math.abs(c.current-S.clientY)>=ch)&&(p(!0),window.removeEventListener("mousemove",g),a(),e(S),u.current=null)},[e,a]);function f(S){d.current=S.clientX,c.current=S.clientY,u.current=S.target,window.addEventListener("mousemove",g)}function C(S){u.current===S.target&&(p(!0),a(),e(),window.removeEventListener("mousemove",g)),u.current=null}return b.exports.useEffect(function(){return function(){return window.removeEventListener("mousemove",g)}},[g]),T("button",{type:"button",className:Y("btn-context-menu",{disabled:s},{active:r&&!s},{"keyboard-active":l&&!s}),onMouseDown:f,onMouseUp:C,disabled:m,children:[h("span",{className:Y("icon"),children:i}),h("span",{className:"title",children:n}),h("span",{className:"shortcut",children:o})]})}function Ld(t){const{handleControlSelect:e,handleToolSelect:n,onClearFilter:s}=t,i=b.exports.useMemo(()=>[{title:"Input Filter",icon:hf,menuElement:h(Fi,{}),action:o=>{e(un.INPUT_FILTER,o)},order:10},{title:"Dropdown Filter",icon:Dh,menuElement:h(Fi,{}),action:o=>{e(un.DROPDOWN_FILTER,o)},order:15},{title:"Markdown Widget",icon:uf,menuElement:h(Fi,{}),action:o=>{e(un.MARKDOWN,o)},order:20},{title:"Filter Sets",icon:ca,menuElement:h(Fi,{}),action:o=>{e(un.FILTER_SET_MANAGER,o)},order:25},{disabled:!0,menuElement:h("div",{className:"context-menu-group-header",children:"Tools"}),order:30},{title:"Linker",icon:yh,action:()=>{n(Wt.LINKER)},order:40,shortcut:ls.LINKER},{disabled:!0,menuElement:h("div",{className:"context-menu-group-header",children:"Actions"}),order:50},{title:"Clear All Filters",icon:mf,action:()=>{s()},order:60,shortcut:en.TABLE.CLEAR_ALL_FILTERS}],[e,n,s]);return h(ns,{popperClassName:"controls-menu-popper",actions:i})}Ld.propTypes={handleControlSelect:M.exports.func,handleToolSelect:M.exports.func,onClearFilter:M.exports.func};Ld.defaultProps={handleControlSelect:()=>{},handleToolSelect:()=>{},onClearFilter:()=>{}};Fi.propTypes={forwardedProps:M.exports.shape({iconElement:M.exports.node,displayShortcut:M.exports.string,isMouseSelected:M.exports.bool.isRequired,isKeyboardSelected:M.exports.bool.isRequired,closeMenu:M.exports.func.isRequired,menuItem:M.exports.shape({action:M.exports.func,title:M.exports.string,disabled:M.exports.bool}).isRequired})};Fi.defaultProps={forwardedProps:null};const Jy=Ls(Zm,null),eR={layoutStorage:Jy},tR=t=>t.layoutStorage,nR=t=>t.serverConfigValues;Object.entries(eR).map(([t,e])=>Gi.register(t,e));const hh=10;function sR(t){const{onExportLayout:e,onImportLayout:n,onResetLayout:s,onSelect:i,widgets:o=[]}=t,[r,l]=b.exports.useState(!1),[a,d]=b.exports.useState(""),c=b.exports.useRef(null),u=b.exports.useRef(),m=b.exports.useCallback((y,E)=>{y!=null&&i(y,E)},[i]),p=b.exports.useCallback(y=>{d(y.target.value)},[]),g=b.exports.useCallback(y=>{u.current!=null&&(Math.abs(u.current.x-y.clientX)>=hh||Math.abs(u.current.y-y.clientY)>=hh)&&(l(!0),window.removeEventListener("mousemove",g),m(u.current.widget,y),u.current=void 0)},[u,m]),f=b.exports.useCallback((y,E)=>{u.current={x:y.clientX,y:y.clientY,widget:E},window.addEventListener("mousemove",g)},[g]),C=b.exports.useCallback((y,E)=>{window.removeEventListener("mousemove",g),u.current?.widget===E&&(l(!0),m(E)),u.current=void 0},[g,u,m]),S=b.exports.useMemo(()=>o.filter(y=>a?y.name?.toLowerCase().includes(a.toLowerCase()):!0),[a,o]).sort((y,E)=>y.name?.localeCompare(E.name??"")??0),w=b.exports.useMemo(()=>S.map(y=>h("li",{children:T(U,{kind:"ghost","data-testid":`panel-list-item-${y.name??""}-button`,onMouseDown:E=>{f(E,y)},onMouseUp:E=>{C(E,y)},onKeyDown:E=>{(E.key==="Enter"||E.key===" ")&&m(y)},disabled:r,onClick:()=>{},children:[h(Lh,{type:y.type})," ",y.name??""]})},y.name)),[S,r,f,C,m]),v=b.exports.useMemo(()=>w.length===0?h("span",{children:"No bound variables found."}):null,[w]);return T("div",{className:"widget-list-container d-flex flex-column",children:[h("div",{className:"widget-list-header",children:h(Bi,{value:a,placeholder:"Find Table, Plot or Widget",onChange:p,ref:c})}),T("ul",{className:"widget-list flex-grow-1",children:[v&&h("li",{className:"widget-list-message",children:v}),!v&&w]}),h("div",{children:h("hr",{})}),T("div",{className:"widget-list-footer",children:[T(U,{kind:"ghost",onClick:e,children:[T("div",{className:"fa-md fa-layers",children:[h(Z,{mask:da,icon:jd,transform:"right-5 down-5"}),h(Z,{icon:jd,transform:"right-8 down-6"})]}),"Export Layout"]}),T(U,{kind:"ghost",onClick:n,children:[T("div",{className:"fa-md fa-layers",children:[h(Z,{mask:da,icon:ha,transform:"right-5 down-5"}),h(Z,{icon:ha,transform:"right-8 down-6"})]}),"Import Layout"]}),h(U,{kind:"ghost",icon:ei,onClick:s,tooltip:"Reset Layout"})]})]})}const iR=async(t,e,n)=>{let s,i,o,r;if(Er(e)?(s=e.settings,i=e.table,o=void 0,r=e.tableSettings):(s={},i="",o=e.figure,r={}),n!==void 0&&(n.tableSettings!=null&&(r=n.tableSettings),n.table!=null&&(i=n.table),n.figure!=null&&(o=n.figure),n.settings!=null&&(s={...s,...n.settings})),o!==void 0){const d={title:o,name:o,type:I.VariableType.FIGURE},c=await t.getObject(d);return Oi.makeModel(s,c)}const l={title:o,name:i,type:I.VariableType.TABLE},a=await t.getObject(l);return te.applyTableSettings(a,r,ko(Cl.getState())),Oi.makeModelFromSettings(s,a)},oR=async(t,e,n=I.VariableType.TABLE)=>{const{table:s}=e,i={title:s,name:s,type:n},o=await t.getObject(i);return Cd.makeModel(o)};function rR({onAutoFillClick:t=()=>{}}){return T("div",{className:"empty-dashboard-container",children:[T("div",{className:"hint-container",children:[h(Z,{icon:Fh})," ",h("br",{}),"Use the panel list to add objects from a query."]}),T("div",{className:"empty-dashboard",children:[h("div",{className:"add-panels-hint",children:"Drag Panels Here"}),h(U,{kind:"tertiary",onClick:t,children:"Auto fill objects"})]})]})}function lR(t){return t.version===2}function aR(t){return Array.isArray(t)}const br=J.module("UserLayoutUtils"),dR={layoutConfig:[{type:"column",content:[{type:"row",height:40,content:[{type:"stack",content:[{type:"react-component",component:Ii.COMPONENT,title:Ii.TITLE,isClosable:!1},{type:"react-component",component:Kr.COMPONENT,title:Kr.TITLE,isClosable:!1}]},{type:"stack",width:25,content:[{type:"react-component",component:zr.COMPONENT,title:zr.TITLE,isClosable:!1},{type:"react-component",component:qr.COMPONENT,title:qr.TITLE,isClosable:!1}]}]},{type:"row",content:[{type:"stack",title:"Notebooks",content:[]}]}]}],links:[],filterSets:[],version:2},cR={layoutConfig:[],links:[],filterSets:[],version:2};function ap(t){if(lR(t))return t;if(aR(t))return{layoutConfig:t,links:[],filterSets:[],version:2};throw new Error(`Unexpected layout import format: ${t}`)}async function hR(t,e=!0){try{const n=await t.getLayouts();if(n.length>0)try{const s=await t.getLayout(n[0]);return ap(s)}catch(s){br.error("Unable to load layout",n[0],":",s),br.warn("No valid layouts found, falling back to default layout")}}catch(n){br.error("Unable to fetch layout list",n),br.warn("Falling back to default layout")}return e?dR:cR}function uR(t){const{filterSets:e,layoutConfig:n,links:s}=t;return{filterSets:e,layoutConfig:n,links:s,version:2}}const Dr={exportLayout:uR,getDefaultLayout:hR,normalizeLayout:ap},wr=J.module("DownloadServiceWorkerUtils"),dp=class{static registerOnLoaded(){new URL("/ide/",window.location.href).origin===window.location.origin&&("serviceWorker"in navigator?window.addEventListener("load",()=>{const e=new URL("/ide/download/serviceWorker.js",window.location.href);navigator.serviceWorker.register(e).then(n=>{n.update(),wr.info("Registering service worker on ",e,n)}).catch(n=>{wr.error("Failed to register service worker",n)})}):wr.info("Service worker is not supported."))}static async getServiceWorker(){if("serviceWorker"in navigator){const e=(await navigator.serviceWorker.getRegistrations()).find(n=>n.scope.endsWith(dp.DOWNLOAD_PATH));if(e&&e.active)return wr.info("Download service worker is active."),e.active;throw new Error("Can not find download service worker.")}throw new Error("Download service worker is not available.")}static unregisterSW(){}};let Xr=dp;Xr.DOWNLOAD_PATH="/download/";const cp={react:de},mR=zp(cp),pR=qp({requires:mR}),gR=Yp.createRequires(cp),fR=Kp({requires:gR}),CR=J.module("PluginUtils");class Ma{static loadComponentPlugin(e){if("".split(",").includes(e)){const o=de.lazy(()=>ff(()=>import(`./internal/${e}`),[])),r=de.forwardRef((l,a)=>h(b.exports.Suspense,{fallback:h("div",{children:"Loading Plugin..."}),children:h(o,{ref:a,...l})}));return r.pluginName=e,r.displayName="Local Plugin",r}const n=new URL("/ide/plugins/",`${window.location}`),s=new URL(`${e}.js`,n),i=de.forwardRef((o,r)=>h(pR,{url:s,render:({err:l,Component:a})=>{if(l!=null&&l!==""){const d=`Error loading plugin ${e} from ${s} due to ${l}`;return CR.error(d),h("div",{className:"error-message",children:`${d}`})}return h(a,{ref:r,...o})}}));return i.pluginName=e,i.displayName="Plugin",i}static async loadModulePlugin(e){return await fR(e)}static async loadJson(e){return new Promise((n,s)=>{const i=new XMLHttpRequest;i.addEventListener("load",()=>{try{const o=JSON.parse(i.responseText);n(o)}catch(o){s(o)}}),i.addEventListener("error",o=>{s(o)}),i.open("GET",e),i.send()})}}const Ot=J.module("AppMainContainer");class Io extends b.exports.Component{constructor(e){super(e),this.getDashboardPlugins=ge(n=>[...n.entries()].filter(([,s])=>s.DashboardPlugin!=null).map(([s,{DashboardPlugin:i}])=>h(i,{},s))),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.importElement=de.createRef(),this.state={contextActions:[{action:()=>{this.handleToolSelect(Wt.LINKER)},shortcut:ls.LINKER,isGlobal:!0},{action:()=>{this.sendClearFilter()},shortcut:en.TABLE.CLEAR_ALL_FILTERS,isGlobal:!0},{action:()=>{Ot.debug("Consume unhandled save shortcut")},shortcut:ls.SAVE,isGlobal:!0}],isPanelsMenuShown:!1,isSettingsMenuShown:!1,widgets:[]}}static handleWindowBeforeUnload(e){e.preventDefault(),e.returnValue=""}static hydrateConsole(e,n){return wa.hydrate({...e,unzip:s=>Sh.loadAsync(s).then(i=>Object.values(i.files))},n)}componentDidMount(){this.initWidgets(),window.addEventListener("beforeunload",Io.handleWindowBeforeUnload)}componentDidUpdate(e){const{dashboardData:n}=this.props;e.dashboardData!==n&&this.handleDataChange(n)}componentWillUnmount(){this.deinitWidgets(),window.removeEventListener("beforeunload",Io.handleWindowBeforeUnload)}initWidgets(){const{connection:e}=this.props;if(e.subscribeToFieldUpdates==null){Ot.warn("subscribeToFieldUpdates not supported, not initializing widgets");return}this.widgetListenerRemover=e.subscribeToFieldUpdates(n=>{Ot.debug("Got updates",n),this.setState(({widgets:s})=>{const{updated:i,created:o,removed:r}=n,l=[...i,...r],a=s.filter(c=>!l.some(u=>u.name===c.name));return[...i,...o].forEach(c=>{c.name!=null&&c.name!==""&&a.push(c)}),{widgets:a}})})}deinitWidgets(){this.widgetListenerRemover?.()}openNotebookFromURL(){const{match:e}=this.props,{notebookPath:n}=e.params;if(n){const{session:s,sessionConfig:i}=this.props;if(s==null||i==null){Ot.error("No session available to open notebook URL",n);return}const o={id:`/${n}`,itemName:`/${n}`},r=i.type,l={value:null,language:r};this.emitLayoutEvent(Ae.SELECT_NOTEBOOK,s,r,l,o,!0)}}sendClearFilter(){this.emitLayoutEvent(Le.CLEAR_ALL_FILTERS)}emitLayoutEvent(e,...n){this.goldenLayout?.eventHub.emit(e,...n)}handleError(e){ye.isCanceled(e)||Ot.error(e)}handleSettingsMenuHide(){this.setState({isSettingsMenuShown:!1})}handleSettingsMenuShow(){this.setState({isSettingsMenuShown:!0})}handleControlSelect(e,n=null){switch(Ot.debug("handleControlSelect",e),e){case un.DROPDOWN_FILTER:this.emitLayoutEvent(Le.OPEN_DROPDOWN,{title:"DropdownFilter",type:e,createNewStack:!0,dragEvent:n});break;case un.INPUT_FILTER:this.emitLayoutEvent(Le.OPEN_INPUT,{title:"InputFilter",type:e,createNewStack:!0,dragEvent:n});break;case un.MARKDOWN:this.emitLayoutEvent(km.OPEN,{title:"Markdown",type:e,dragEvent:n});break;case un.FILTER_SET_MANAGER:this.emitLayoutEvent(Le.OPEN_FILTER_SET_MANAGER,{title:"FilterSets",type:e,dragEvent:n});break;default:throw new Error(`Unrecognized control type ${e}`)}}handleToolSelect(e){Ot.debug("handleToolSelect",e);const{activeTool:n,setActiveTool:s}=this.props;s(n===e?Wt.DEFAULT:e)}handleClearFilter(){this.sendClearFilter()}handleDataChange(e){const{updateWorkspaceData:n}=this.props,{closed:s,filterSets:i,links:o}=e;n({closed:s,filterSets:i,links:o})}handleGoldenLayoutChange(e){this.goldenLayout=e}handleLayoutConfigChange(e){const{updateWorkspaceData:n}=this.props;n({layoutConfig:e})}handleWidgetMenuClick(){this.setState(({isPanelsMenuShown:e})=>({isPanelsMenuShown:!e}))}handleWidgetSelect(e,n){this.setState({isPanelsMenuShown:!1}),Ot.debug("handleWidgetSelect",e,n),this.openWidget(e,n)}handleWidgetsMenuClose(){this.setState({isPanelsMenuShown:!1})}handleAutoFillClick(){const{widgets:e}=this.state;Ot.debug("handleAutoFillClick",e);const n=e.sort((s,i)=>s.title!=null&&i.title!=null?s.title.localeCompare(i.title):0);for(let s=0;s<n.length;s+=1)this.openWidget(n[s])}handleExportLayoutClick(){Ot.info("handleExportLayoutClick"),this.setState({isPanelsMenuShown:!1});try{const{workspace:e}=this.props,{data:n}=e,s=Dr.exportLayout(n);Ot.info("handleExportLayoutClick exportedConfig",s);const i=new Blob([JSON.stringify(s)],{type:"application/json"}),o=I.i18n.DateTimeFormat.format("yyyy-MM-dd-HHmmss",new Date),r=document.createElement("a");r.href=URL.createObjectURL(i),r.download=`deephaven-app-layout-${o}.json`,r.click()}catch(e){Ot.error("Unable to export layout",e)}}handleImportLayoutClick(){Ot.info("handleImportLayoutClick"),this.setState({isPanelsMenuShown:!1}),this.importElement.current!=null&&(this.importElement.current.value="",this.importElement.current.click())}handleResetLayoutClick(){Ot.info("handleResetLayoutClick"),this.setState({isPanelsMenuShown:!1}),this.resetLayout()}handleImportLayoutFiles(e){e.stopPropagation(),e.preventDefault(),e.target.files!=null&&this.importLayoutFile(e.target.files?.[0])}async importLayoutFile(e){try{const{updateDashboardData:n,updateWorkspaceData:s}=this.props,i=await e.text(),o=JSON.parse(i),{filterSets:r,layoutConfig:l,links:a}=Dr.normalizeLayout(o);s({layoutConfig:l}),n(Sn,{filterSets:r,links:a})}catch(n){Ot.error("Unable to import layout",n)}}async resetLayout(){const{layoutStorage:e,session:n}=this.props,{filterSets:s,layoutConfig:i,links:o}=await Dr.getDefaultLayout(e,n!==void 0),{updateDashboardData:r,updateWorkspaceData:l}=this.props;l({layoutConfig:i}),r(Sn,{filterSets:s,links:o})}handlePaste(e){if(e.target instanceof HTMLElement&&e.target.closest(".monaco-editor"))return;const{clipboardData:n}=e,s=n.getData("Text"),i=/“|”/g;i.test(s)&&(e.preventDefault(),e.stopPropagation(),document.execCommand("insertText",!1,s.replace(i,'"')))}handleLoadTablePlugin(e){const{plugins:n}=this.props,s=n.get(e);return s!=null&&s.TablePlugin!=null?s.TablePlugin:Ma.loadComponentPlugin(e)}hydrateDefault(e,n){const{connection:s}=this.props,{metadata:i}=e;if(i?.type!=null&&(i?.id!=null||i?.name!=null)){const o=i.id!=null?{type:i.type,id:i.id}:{type:i.type,name:i.name,title:i.name};return{fetch:()=>s.getObject(o),localDashboardId:n,...e}}return wa.hydrate(e,n)}hydrateGrid(e,n){return this.hydrateTable(e,n,e.metadata.type??I.VariableType.TABLE)}hydratePandas(e,n){return this.hydrateTable(e,n,I.VariableType.PANDAS)}hydrateTable(e,n,s=I.VariableType.TABLE){const{connection:i}=this.props;return{...e,getDownloadWorker:Xr.getServiceWorker,loadPlugin:this.handleLoadTablePlugin,localDashboardId:n,makeModel:()=>oR(i,e.metadata,s)}}hydrateChart(e,n){const{connection:s}=this.props;return{...e,localDashboardId:n,makeModel:()=>{const{metadata:i,panelState:o}=e;return iR(s,i,o)}}}openWidget(e,n){const{connection:s}=this.props;this.emitLayoutEvent(Ee.OPEN,{dragEvent:n,fetch:()=>s.getObject(e),widget:e})}render(){const{activeTool:e,plugins:n,user:s,workspace:i,serverConfigValues:o}=this.props,{data:r}=i,{layoutConfig:l}=r,{permissions:a}=s,{canUsePanels:d}=a,{contextActions:c,isPanelsMenuShown:u,isSettingsMenuShown:m,widgets:p}=this.state,g=this.getDashboardPlugins(n);return T("div",{className:Y("app-main-tabs","w-100","h-100","d-flex","flex-column",e?`active-tool-${e.toLowerCase()}`:""),onPaste:this.handlePaste,tabIndex:-1,children:[h("nav",{className:"nav-container",children:T("div",{className:"app-main-top-nav-menus",children:[h("img",{src:Jm,alt:"Deephaven Data Labs",width:"115px",className:"ml-1"}),T("div",{children:[T(U,{kind:"ghost",className:"btn-panels-menu",icon:pf,onClick:()=>{},children:["Controls",h(Ld,{handleControlSelect:this.handleControlSelect,handleToolSelect:this.handleToolSelect,onClearFilter:this.handleClearFilter})]}),d&&T(U,{kind:"ghost",className:"btn-panels-menu btn-show-panels","data-testid":"app-main-panels-button",onClick:this.handleWidgetMenuClick,icon:gf,children:["Panels",h(tl,{isShown:u,className:"panels-menu-popper",onExited:this.handleWidgetsMenuClose,closeOnBlur:!0,interactive:!0,children:h(sR,{widgets:p,onExportLayout:this.handleExportLayoutClick,onImportLayout:this.handleImportLayoutClick,onResetLayout:this.handleResetLayoutClick,onSelect:this.handleWidgetSelect})})]}),h(U,{kind:"ghost",className:Y("btn-settings-menu",{"text-warning":s.operateAs!==s.name}),onClick:this.handleSettingsMenuShow,icon:h(Z,{icon:_o,transform:"grow-3 right-1 down-1"}),tooltip:"User Settings"})]})]})}),T(Zb,{emptyDashboard:h(rR,{onAutoFillClick:this.handleAutoFillClick}),id:Sn,layoutConfig:l,onGoldenLayoutChange:this.handleGoldenLayoutChange,onLayoutConfigChange:this.handleLayoutConfigChange,onLayoutInitialized:this.openNotebookFromURL,hydrate:this.hydrateDefault,children:[h(dy,{hydrate:this.hydrateGrid,getDownloadWorker:Xr.getServiceWorker,loadPlugin:this.handleLoadTablePlugin}),h(sy,{hydrate:this.hydrateChart}),h(iy,{}),h(ry,{hydrateConsole:Io.hydrateConsole,notebooksUrl:new URL("/notebooks/",`${window.location}`).href}),h(ly,{}),h(Cy,{hydrate:this.hydratePandas}),h(fy,{}),h(gy,{}),g]}),h(Ht,{in:m,timeout:Xe.transitionMidMs,classNames:"slide-left",mountOnEnter:!0,unmountOnExit:!0,children:h(ji,{serverConfigValues:o,onDone:this.handleSettingsMenuHide})}),h(le,{actions:c}),h("input",{ref:this.importElement,type:"file",accept:".json",style:{display:"none"},onChange:this.handleImportLayoutFiles})]})}}const SR=t=>({activeTool:pl(t),dashboardData:Yt(t,Sn),layoutStorage:tR(t),plugins:nS(t),connection:mE(t,Sn),session:ai(t,Sn)?.session,sessionConfig:ai(t,Sn)?.config,user:ru(t),workspace:ml(t),serverConfigValues:nR(t)}),bR=vt(SR,{setActiveTool:fl,updateDashboardData:Vn,updateWorkspaceData:Ru})(Xp(Io));function wR(){return T("div",{className:"app",children:[h(bR,{}),h(kh,{})]})}const TR=J.module("LocalWorkspaceStorage"),wo=class{static async makeDefaultWorkspaceData(t,e){const{filterSets:n,links:s,layoutConfig:i}=await Dr.getDefaultLayout(t,e?.isConsoleAvailable);return{settings:{defaultDateTimeFormat:st.DEFAULT_DATETIME_FORMAT_STRING,formatter:[],timeZone:st.DEFAULT_TIME_ZONE_ID,showTimeZone:!1,showTSeparator:!0,disableMoveConfirmation:!1,defaultDecimalFormatOptions:{defaultFormatString:ke.DEFAULT_FORMAT_STRING},defaultIntegerFormatOptions:{defaultFormatString:Qe.DEFAULT_FORMAT_STRING},truncateNumbersWithPound:!1,defaultNotebookSettings:{isMinimapEnabled:!1}},layoutConfig:i,closed:[{}],links:s,filterSets:n}}static async makeDefaultWorkspace(t,e){return{data:await wo.makeDefaultWorkspaceData(t,e)}}constructor(t){this.layoutStorage=t}async load(t){try{return JSON.parse(localStorage.getItem(wo.STORAGE_KEY)??"")}catch{return TR.info("Unable to load workspace data, initializing to default data"),wo.makeDefaultWorkspace(this.layoutStorage,t)}}async save(t){return localStorage.setItem(wo.STORAGE_KEY,JSON.stringify(t)),t}};let hp=wo;hp.STORAGE_KEY="deephaven.WorkspaceStorage";class vR extends Error{constructor(){super(...arguments),this.isNoConsolesError=!0}}function ER(t){return t.isNoConsolesError}const ks=J.module("SessionUtils");var up=(t=>(t.ANONYMOUS="anonymous",t.PARENT="parent",t))(up||{});function yR(){return new URL("/jsapi",`${window.location}`)}function mp(){const t=yR();return`${t.protocol}//${t.host}`}function RR(){switch(new URLSearchParams(window.location.search).get("authProvider")){case"parent":return"parent";default:return"anonymous"}}function IR(){const t=mp();return ks.info(`Starting connection to '${t}'...`),new I.IdeConnection(t)}async function FR(t){ks.info("Getting console types...");const e=await t.getConsoleTypes();if(ks.info("Available types:",e),e.length===0)throw new vR("No console types available");const n=e[0];ks.info("Starting session with type",n);const s=await t.startSession(n),i={type:n,id:$e.generate()};return ks.info("Console session established",i),{session:s,config:i,connection:t}}function DR(){const t=mp();return ks.info("createCoreClient",t),new I.CoreClient(t)}async function NR(){if(window.opener==null)throw new Error("window.opener is null, unable to send auth request.");return new Promise(t=>{const e=n=>{const{data:s}=n;if(ks.debug("Received message",s),s?.message!=="loginOptions"){ks.debug("Ignore received message",s);return}window.removeEventListener("message",e),t(s.payload)};window.addEventListener("message",e),window.opener.postMessage("requestLoginOptionsFromParent","*")})}async function _R(t){switch(t){case"parent":return NR();case"anonymous":return{type:I.CoreClient.LOGIN_TYPE_ANONYMOUS};default:throw new Error(`Unknown auth type: ${t}`)}}class MR{constructor(e,n=""){this.storageService=e,this.root=n}async getLayouts(){return(await this.storageService.listItems(this.root,"*.json")).map(n=>n.basename)}async getLayout(e){const s=await(await this.storageService.loadFile(`${this.root}/${e}`)).text();return JSON.parse(s)}}const mo=J.module("GrpcFileStorageTable"),ka=class{constructor(t,e="",n=e){this.currentSize=0,this.listeners=[],this.childTables=new Map,this.storageService=t,this.baseRoot=e,this.root=n,n===e&&(this.doRefresh=Je(this.doRefresh.bind(this),ka.REFRESH_DEBOUNCE))}removeBaseRoot(t){return me.removeRoot(this.baseRoot,t)}getViewportData(){return this.viewportUpdatePromise||this.refreshInternal(),this.viewportUpdatePromise??Promise.resolve({items:[],offset:0})}getSnapshot(t){throw new Error("Method not implemented.")}get size(){return this.currentSize}setExpanded(t,e){const n=t.split("/");let s=n.shift();if((s===void 0||s==="")&&(s=n.shift()),s===void 0||s==="")throw new Error(`Invalid path: ${t}`);const i=n.join("/");if(e){if(!this.childTables.has(s)){const o=new ka(this.storageService,this.baseRoot,`${this.root}/${s}`);this.childTables.set(s,o)}i&&this.childTables.get(s)?.setExpanded(i,e)}else this.childTables.has(s)&&(i?this.childTables.get(s)?.setExpanded(i,e):this.childTables.delete(s));this.currentViewport&&this.refreshInternal()}collapseAll(){this.childTables.clear(),this.currentViewport&&this.refreshInternal()}setSearch(t){throw new Error("Method not implemented.")}setViewport(t){this.currentViewport=t,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(t){return this.listeners=[...this.listeners,t],()=>{this.listeners=this.listeners.filter(e=>e!==t)}}doRefresh(t){mo.debug2("doRefresh",this.root),t(this.fetchData())}refresh(){mo.debug2("refresh",this.root),this.viewportUpdatePromise?.cancel();const t=new Promise(n=>{this.doRefresh(n)}),e=ye.makeCancelable(t.then(n=>{if(this.viewportUpdatePromise!==e)throw new Zr;return this.currentViewportData=n,this.sendUpdate(),n}));e.catch(n=>{ye.isCanceled(n)||mo.error("Error updating viewport",n)}),this.viewportUpdatePromise=e}refreshInternal(){try{this.refresh()}catch(t){ye.isCanceled(t)||mo.error("Unable to refresh data",t)}}async fetchData(){const{currentViewport:t}=this;if(!t)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:r}=i;if(r===this.removeBaseRoot(`${this.root}/${o}`)&&i.type==="directory"){const l=this.childTables.get(o);if(l!=null){l.setViewport({top:0,bottom:t.bottom-s});const a=await l.getViewportData();n.splice(s+1,0,...a.items)}}}return this.currentSize=n.length,mo.debug2(this.root,"items",n,t),n=n.slice(t.top,t.bottom),{items:n,offset:t.top}}sendUpdate(){const{listeners:t}=this,e=this.currentViewportData??{items:[],offset:0};for(let n=0;n<t.length;n+=1)t[n](e)}};let pp=ka;pp.REFRESH_DEBOUNCE=50;const kR=J.module("GrpcFileStorage"),gp=class{constructor(t,e=""){this.tables=[],this.refreshTables=Ln(()=>{this.tables.forEach(n=>n.refresh())},gp.REFRESH_THROTTLE),this.storageService=t,this.root=e}removeRoot(t){return me.removeRoot(this.root,t)}addRoot(t){return me.addRoot(this.root,t)}async createDirectory(t){return await this.storageService.createDirectory(this.addRoot(t)),this.refreshTables(),{type:"directory",id:t,filename:t,basename:me.getBaseName(t)}}async getTable(){const t=new pp(this.storageService,this.root);return this.tables.push(t),t}async saveFile(t){const e=dh.storage.FileContents.text(t.content);return await this.storageService.saveFile(this.addRoot(t.filename),e,!0),this.refreshTables(),t}async loadFile(t){const n=await(await this.storageService.loadFile(this.addRoot(t))).text();return{filename:t,basename:me.getBaseName(t),content:n}}async deleteFile(t){await this.storageService.deleteItem(this.addRoot(t)),this.refreshTables()}async moveFile(t,e){await this.storageService.moveItem(this.addRoot(t),this.addRoot(e)),this.refreshTables()}async info(t){const e=await this.storageService.listItems(this.addRoot(me.getPath(t)),me.getBaseName(t));if(e.length===0)throw new Fd;if(e.length>1)throw kR.error("More than one matching file found, should never happen.",e),new Error("More than one matching file found");const n=e[0];return{filename:this.removeRoot(n.filename),basename:n.basename,id:this.removeRoot(n.filename),type:n.type}}};let fp=gp;fp.REFRESH_THROTTLE=150;const xs=J.module("AppInit");async function xR(){xs.debug("Loading plugins...");try{const t=await Ma.loadJson("/js-plugins/manifest.json");xs.debug("Plugin manifest loaded:",t);const e=[];for(let i=0;i<t.plugins.length;i+=1){const{name:o,main:r}=t.plugins[i],l=`/js-plugins/${o}/${r}`;e.push(Ma.loadModulePlugin(l))}const n=await Promise.all(e),s=new Map;for(let i=0;i<n.length;i+=1){const{name:o}=t.plugins[i];s.set(o,n[i])}return xs.info("Plugins loaded:",s),s}catch(t){return xs.error("Unable to load plugins:",t),new Map}}async function OR(t){let e;try{e=await FR(t)}catch(n){if(!ER(n))throw n}return e}function Pd(t){const{workspace:e,setActiveTool:n,setCommandHistoryStorage:s,setDashboardData:i,setFileStorage:o,setLayoutStorage:r,setDashboardConnection:l,setDashboardSessionWrapper:a,setPlugins:d,setUser:c,setWorkspace:u,setWorkspaceStorage:m,setServerConfigValues:p}=t,[g,f]=b.exports.useState(),[C,S]=b.exports.useState(!0),w=b.exports.useCallback(async()=>{try{xs.info("Initializing Web UI","0.30.1",navigator.userAgent);const F=DR(),D=RR();xs.info(`Login using auth type ${D}...`),await F.login(await _R(D));const N=await xR(),P=await(D===up.ANONYMOUS&&F.getAsIdeConnection==null?IR():F.getAsIdeConnection());P.addEventListener(I.IdeConnection.HACK_CONNECTION_FAILURE,Se=>{const{detail:Re}=Se;xs.error("Connection failure",`${JSON.stringify(Re)}`),f(`Unable to connect: ${Re.details??"Unknown Error"}`)});const H=await OR(P),A="user",q=F.getStorageService(),B=new MR(q,"/layouts"),K=new fp(q,"/notebooks"),x=new hp(B),O=new Ny,G=await x.load({isConsoleAvailable:H!==void 0}),{data:ee}=G,{settings:ne}=ee;ne.defaultDecimalFormatOptions===void 0&&(ne.defaultDecimalFormatOptions={defaultFormatString:ke.DEFAULT_FORMAT_STRING}),ne.defaultIntegerFormatOptions===void 0&&(ne.defaultIntegerFormatOptions={defaultFormatString:Qe.DEFAULT_FORMAT_STRING}),ne.truncateNumbersWithPound===void 0&&(ne.truncateNumbersWithPound=!1);const{shortcutOverrides:V={}}=ne,X=fn.isMacPlatform?V.mac??{}:V.windows??{};Object.entries(X).forEach(([Se,Re])=>{qe.get(Se)?.setKeyState(Re)});const se={filterSets:ee.filterSets,links:ee.links},ce=await F.getServerConfigValues(),Q=new Map(ce),he={name:A,operateAs:A,groups:[],permissions:{isSuperUser:!1,isQueryViewOnly:!1,isNonInteractive:!1,canUsePanels:!0,canCreateDashboard:!0,canCreateCodeStudio:!0,canCreateQueryMonitor:!0,canCopy:Q.get("internal.webClient.appInit.canCopy")!=="false",canDownloadCsv:Q.get("internal.webClient.appInit.canDownloadCsv")!=="false"}};n(Wt.DEFAULT),p(Q),s(O),i(Sn,se),o(K),r(B),l(Sn,P),H!==void 0&&a(Sn,H),d(N),c(he),m(x),u(G)}catch(F){xs.error(F),f(F)}},[n,s,i,o,r,l,a,d,c,u,m,p]),v=b.exports.useCallback(()=>{document.fonts!=null?document.fonts.ready.then(()=>{S(!1)}):S(!1)},[]);b.exports.useEffect(function(){w(),v()},[w,v]);const y=e==null&&g==null||C,E=!y&&g==null,R=g!=null?`${g}`:null;return T(be,{children:[E&&h(wR,{}),h(Jr,{isLoading:y,isLoaded:E,errorMessage:R}),T("div",{id:"preload-fonts",style:{visibility:"hidden",position:"absolute",top:-1e4},children:[h("p",{className:"fira-sans-regular",children:"preload"}),h("p",{className:"fira-sans-semibold",children:"preload"}),h("p",{className:"fira-mono",children:"preload"})]})]})}Pd.propTypes={workspace:M.exports.shape({}),workspaceStorage:M.exports.shape({close:M.exports.func}),setActiveTool:M.exports.func.isRequired,setCommandHistoryStorage:M.exports.func.isRequired,setDashboardData:M.exports.func.isRequired,setFileStorage:M.exports.func.isRequired,setLayoutStorage:M.exports.func.isRequired,setDashboardConnection:M.exports.func.isRequired,setDashboardSessionWrapper:M.exports.func.isRequired,setPlugins:M.exports.func.isRequired,setUser:M.exports.func.isRequired,setWorkspace:M.exports.func.isRequired,setWorkspaceStorage:M.exports.func.isRequired};Pd.defaultProps={workspace:null,workspaceStorage:null};const AR=t=>({workspace:ml(t),workspaceStorage:JC(t)}),uh=vt(AR,{setActiveTool:fl,setCommandHistoryStorage:oS,setDashboardData:Xu,setFileStorage:rS,setLayoutStorage:_y,setDashboardConnection:pE,setDashboardSessionWrapper:gE,setPlugins:aS,setUser:sS,setWorkspace:yu,setWorkspaceStorage:iS,setServerConfigValues:dS})(Pd);function LR(){return h(jp,{basename:"/ide/",children:T(Qp,{children:[h($d,{exact:!0,path:"/",component:uh}),h($d,{path:"/notebook/:notebookPath+",component:uh}),h(Zp,{from:"*",to:"/"})]})})}Boolean(window.location.hostname==="localhost"||window.location.hostname==="[::1]"||window.location.hostname.match(/^127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/));function PR(){"serviceWorker"in navigator&&navigator.serviceWorker.getRegistrations().then(t=>{t.forEach(e=>{e.scope.endsWith("/download/")||e.unregister()})})}function GR(){return b.exports.useEffect(()=>{PR(),Xr.registerOnLoaded(),lt.init({getWorker:()=>new Cf}),window["__react-beautiful-dnd-disable-dev-warnings"]=!0},[]),h(ph,{store:Cl,children:h(LR,{})})}export{GR as AppRoot,GR as default};
|
|
42
|
+
//# sourceMappingURL=AppRoot.7498c843.js.map
|