@deephaven/code-studio 0.85.41 → 0.85.43

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (50) hide show
  1. package/build/assets/{AppRoot-DPYC6qg1.js → AppRoot-CM06vHK8.js} +5 -5
  2. package/build/assets/{AppRoot-DPYC6qg1.js.map → AppRoot-CM06vHK8.js.map} +1 -1
  3. package/build/assets/{Chart-ALPFqVpd.js → Chart-B_oldDJI.js} +2 -2
  4. package/build/assets/{Chart-ALPFqVpd.js.map → Chart-B_oldDJI.js.map} +1 -1
  5. package/build/assets/{ControlType-Dmh2yvfm.js → ControlType-BVvvjMaF.js} +4 -4
  6. package/build/assets/{ControlType-Dmh2yvfm.js.map → ControlType-BVvvjMaF.js.map} +1 -1
  7. package/build/assets/{FontBootstrap-xwM6T9Lx.js → FontBootstrap-DLw4BBDm.js} +2 -2
  8. package/build/assets/{FontBootstrap-xwM6T9Lx.js.map → FontBootstrap-DLw4BBDm.js.map} +1 -1
  9. package/build/assets/{FormatterUtils-g3FSuGyM.js → FormatterUtils-BCtpdjWB.js} +2 -2
  10. package/build/assets/{FormatterUtils-g3FSuGyM.js.map → FormatterUtils-BCtpdjWB.js.map} +1 -1
  11. package/build/assets/{Grid-DvkltyWR.js → Grid-D9-uNWgj.js} +2 -2
  12. package/build/assets/{Grid-DvkltyWR.js.map → Grid-D9-uNWgj.js.map} +1 -1
  13. package/build/assets/{IrisGrid-BIpsGMfa.js → IrisGrid-DzubvgJF.js} +3 -3
  14. package/build/assets/IrisGrid-DzubvgJF.js.map +1 -0
  15. package/build/assets/{IrisGridModel-B_hxkOFA.js → IrisGridModel-D4F-tgyo.js} +3 -3
  16. package/build/assets/{IrisGridModel-B_hxkOFA.js.map → IrisGridModel-D4F-tgyo.js.map} +1 -1
  17. package/build/assets/{IrisGridShortcuts-C_SBbOUj.js → IrisGridShortcuts-Bb60KPbS.js} +2 -2
  18. package/build/assets/{IrisGridShortcuts-C_SBbOUj.js.map → IrisGridShortcuts-Bb60KPbS.js.map} +1 -1
  19. package/build/assets/{IrisGridThemeProvider-DegllyJ0.js → IrisGridThemeProvider-DifnC4TA.js} +3 -3
  20. package/build/assets/{IrisGridThemeProvider-DegllyJ0.js.map → IrisGridThemeProvider-DifnC4TA.js.map} +1 -1
  21. package/build/assets/{LocalWorkspaceStorage-B0MpL05f.js → LocalWorkspaceStorage-Uwwg_fVB.js} +2 -2
  22. package/build/assets/{LocalWorkspaceStorage-B0MpL05f.js.map → LocalWorkspaceStorage-Uwwg_fVB.js.map} +1 -1
  23. package/build/assets/{MarkdownEditor-D3swN90B.js → MarkdownEditor-u-slVfX1.js} +2 -2
  24. package/build/assets/{MarkdownEditor-D3swN90B.js.map → MarkdownEditor-u-slVfX1.js.map} +1 -1
  25. package/build/assets/{MarkdownNotebook-D4RMDi9O.js → MarkdownNotebook-DuEd4F92.js} +2 -2
  26. package/build/assets/{MarkdownNotebook-D4RMDi9O.js.map → MarkdownNotebook-DuEd4F92.js.map} +1 -1
  27. package/build/assets/{MissingPartitionError-JzFc7_G7.js → MissingPartitionError-4iseM7kq.js} +2 -2
  28. package/build/assets/MissingPartitionError-4iseM7kq.js.map +1 -0
  29. package/build/assets/Plot-wDSZHXHD.js +2 -0
  30. package/build/assets/{Plot-CT6Y3x6W.js.map → Plot-wDSZHXHD.js.map} +1 -1
  31. package/build/assets/{Plotly-Bc5z1lKI.js → Plotly-vwyC0AnS.js} +2 -2
  32. package/build/assets/{Plotly-Bc5z1lKI.js.map → Plotly-vwyC0AnS.js.map} +1 -1
  33. package/build/assets/{StyleGuideRoot-DPfm3PcQ.js → StyleGuideRoot-CdUtzsMw.js} +2 -2
  34. package/build/assets/{StyleGuideRoot-DPfm3PcQ.js.map → StyleGuideRoot-CdUtzsMw.js.map} +1 -1
  35. package/build/assets/{TokenBoxCellRenderer-Cc1KAs1f.js → TokenBoxCellRenderer-FBeqcVyj.js} +2 -2
  36. package/build/assets/{TokenBoxCellRenderer-Cc1KAs1f.js.map → TokenBoxCellRenderer-FBeqcVyj.js.map} +1 -1
  37. package/build/assets/{index-dbUqFv7I.js → index-CBNByNSW.js} +3 -3
  38. package/build/assets/{index-dbUqFv7I.js.map → index-CBNByNSW.js.map} +1 -1
  39. package/build/assets/{index-3P8NmZhV.js → index-Clxccmsd.js} +2 -2
  40. package/build/assets/{index-3P8NmZhV.js.map → index-Clxccmsd.js.map} +1 -1
  41. package/build/assets/{index-L6GU7AsY.js → index-SbyKVw25.js} +4 -4
  42. package/build/assets/{index-L6GU7AsY.js.map → index-SbyKVw25.js.map} +1 -1
  43. package/build/assets/plotly-B-tleqxD.js +7 -0
  44. package/build/assets/{plotly-Dgz-hS8H.js.map → plotly-B-tleqxD.js.map} +1 -1
  45. package/build/index.html +2 -2
  46. package/package.json +9 -9
  47. package/build/assets/IrisGrid-BIpsGMfa.js.map +0 -1
  48. package/build/assets/MissingPartitionError-JzFc7_G7.js.map +0 -1
  49. package/build/assets/Plot-CT6Y3x6W.js +0 -2
  50. package/build/assets/plotly-Dgz-hS8H.js +0 -7
@@ -1,6 +1,6 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./StyleGuideRoot-DPfm3PcQ.js","./vendor-DKP6ul09.js","./helpers-BosuxZz1.js","./vendor-dwDTpqeK.css","./index-dbUqFv7I.js","./monaco-C4VaWq8m.js","./monaco-BSe5n4Us.css","./index-QQhNGkua.css","./IrisGridModel-B_hxkOFA.js","./ControlType-Dmh2yvfm.js","./ControlType-572S78uV.css","./IrisGridModel-pNa_tAMp.css","./FontBootstrap-xwM6T9Lx.js","./TokenBoxCellRenderer-Cc1KAs1f.js","./IrisGridShortcuts-C_SBbOUj.js","./useMergeRef-4fs_JZU-.js","./IrisGridShortcuts-CJtrNKDP.css","./TokenBoxCellRenderer-DTMTgCrk.css","./LocalWorkspaceStorage-B0MpL05f.js","./LocalWorkspaceStorage-DPzNT156.css","./FontBootstrap-BTg5UkMB.css","./Grid-DvkltyWR.js","./Grid-DPUNpG8i.css","./StyleGuideRoot-DwJcMzan.css"])))=>i.map(i=>d[i]);
2
- import{X as Qe,Y as et,Z as Rt,_ as It,r as m,J as s,a0 as oe,a1 as tt,V as q,a2 as ge,M as F,a3 as w,N as D,a4 as Ot,a5 as xe,a6 as Lt,a7 as kt,a8 as Pt,a9 as ie,aa as _t,I as At,ab as Mt,ac as Ut,ad as Kt,ae as $t,af as Wt,ag as le,ah as Gt}from"./vendor-DKP6ul09.js";import{_ as Bt,W as Vt}from"./monaco-C4VaWq8m.js";import{O as ne,P as B,T as L,I as P,D as _,a as G,b as Ht,u as nt,F as Zt,c as N,d as Yt,g as qt,e as st,f as zt,h as Jt,i as Xt,j as at,k as ot,l as rt,m as it,n as lt,o as Qt,p as Q,S as se,B as y,C as z,q as k,r as Ce,s as ct,K as en,t as Fe,v as tn,w as nn,x as sn,y as fe,z as an,A as on,E as rn,G as ln,H as V,J as cn,L as U,M as ae,N as dn,Q as un,R as hn,U as dt,V as mn,W as Ee,X as pn,Y as gn,Z as fn,_ as bn,$ as vn,a0 as yn,a1 as Sn,a2 as xn,a3 as ut,a4 as ht,a5 as x,a6 as Cn,a7 as Tn,a8 as wn,a9 as jn,aa as ee,ab as Re,ac as Dn,ad as Nn,ae as Fn,af as En,ag as Rn,ah as In,ai as On,aj as Ln,ak as kn,al as Pn,am as _n,an as An,ao as Mn,ap as Un,aq as Kn,ar as $n,as as Wn,at as Gn,au as Bn,av as Vn,aw as Hn}from"./ControlType-Dmh2yvfm.js";import{L as K,v as H,a as Zn,M as Yn,b as qn,c as zn,d as Jn,e as be,f as Xn,g as Qn,s as es,l as ts,h as ns,i as ss,j as as,k as os,m as rs,n as is,o as ls,p as cs,q as ds,r as us,t as hs,u as ms,w as ps,x as gs,y as fs,z as bs,A as vs,B as Ie,C as Oe,D as Le,E as ys,F as Ss,G as xs,H as Cs,I as Ts,J as mt}from"./index-dbUqFv7I.js";import{C as ws,H as js,T as Ds,B as Ns,m as Fs,a as Es,L as pt,s as ke,l as Rs,U as ce,g as Is,N as Os,A as Ls,b as ks,u as Ps,c as _s,d as As,e as Ms,f as Us,h as Ks,G as $s,i as Ws,j as Pe}from"./LocalWorkspaceStorage-B0MpL05f.js";import{T as de,P as Gs,I as gt,S as Bs,D as Vs}from"./IrisGridShortcuts-C_SBbOUj.js";import"./helpers-BosuxZz1.js";import"./useMergeRef-4fs_JZU-.js";function _e(a,e,t,n,o,r,i){try{var l=a[r](i),c=l.value}catch(d){return void t(d)}l.done?e(c):Promise.resolve(c).then(n,o)}function Hs(a){return function(){var e=this,t=arguments;return new Promise(function(n,o){var r=a.apply(e,t);function i(c){_e(r,n,o,i,l,"next",c)}function l(c){_e(r,n,o,i,l,"throw",c)}i(void 0)})}}var Zs=[["api"],["client"],["dashboardData","*","connection"],["dashboardData","*","sessionWrapper"],["layoutStorage"],["storage"]];function ft(a){var e=new Map;return function(n,o){var r,i=[...(r=e.get(this))!==null&&r!==void 0?r:[],n];if(o===Object(o)&&e.set(o,[...i]),i.shift(),!bt(i,a))return o instanceof Map?Array.from(o.entries()):o}}function bt(a,e){for(var t=function(i){if(a.length===e[i].length&&a.every((l,c)=>e[i][c]==="*"||l===e[i][c]))return{v:!0}},n=0;n<e.length;n+=1){var o=t(n);if(typeof o=="object")return o.v}return!1}function vt(a,e){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"root",n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:new Map([[a,"root"]]),o={};return Object.entries(a).forEach(r=>{var[i,l]=r;try{JSON.stringify(l,ft(e)),o[i]=l}catch{var c=l;if(typeof l=="bigint")o[i]=l.toString();else if(n.has(c))o[i]="Circular ref to ".concat(n.get(c));else{var d="".concat(t,".").concat(i);n.set(c,d);var u=d.split(".").slice(1);bt(u,e)||(o[i]=vt(l,e,d,n))}}}),o}function Ys(a){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];return JSON.stringify(vt(a,e),ft(e),2)}function qs(a){return JSON.stringify(a,null,2)}function zs(a){var e=a.getFullYear(),t=String(a.getMonth()+1).padStart(2,"0"),n=String(a.getDate()).padStart(2,"0"),o=String(a.getHours()).padStart(2,"0"),r=String(a.getMinutes()).padStart(2,"0"),i=String(a.getSeconds()).padStart(2,"0");return"".concat(e,"-").concat(t,"-").concat(n,"-").concat(o).concat(r).concat(i)}function Js(a,e,t){return ve.apply(this,arguments)}function ve(){return ve=Hs(function*(a,e,t){var n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:Zs,o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:"".concat(zs(new Date),"_support_logs"),r=new Qe,i=r.folder(o);i.file("console.txt",a.getFormattedHistory()),e!=null&&i.file("metadata.json",qs(e)),t!=null&&i.file("redux.json",Ys(t,n));var l=yield r.generateAsync({type:"blob"}),c=document.createElement("a");c.href=URL.createObjectURL(l),c.download="".concat(o,".zip"),c.click()}),ve.apply(this,arguments)}class Ae{static makeSortConfig(e,t){return{column:e,direction:t}}static makeFilterConfig(e){var t=[],n=[];return e.forEach((o,r)=>{t.push(o),r>0&&n.push(ne.and)}),{filterItems:t,filterOperators:n}}static combineFilterConfigs(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:ne.and;return{filterItems:[...e.filterItems,...t.filterItems],filterOperators:[...e.filterOperators,n,...t.filterOperators]}}static makeFilterItem(e,t,n){return{columnName:e,type:t,value:n}}}function Xs(a,e,t){if(a.length>e){var n=a.length-t;return{toKeep:a.slice(n),toPrune:a.slice(0,n)}}return{toKeep:a,toPrune:[]}}function Me(a,e){var t=Object.keys(a);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(a);e&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(a,o).enumerable})),t.push.apply(t,n)}return t}function Ue(a){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Me(Object(t),!0).forEach(function(n){R(a,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(t)):Me(Object(t)).forEach(function(n){Object.defineProperty(a,n,Object.getOwnPropertyDescriptor(t,n))})}return a}function Ke(a,e,t,n,o,r,i){try{var l=a[r](i),c=l.value}catch(d){return void t(d)}l.done?e(c):Promise.resolve(c).then(n,o)}function M(a){return function(){var e=this,t=arguments;return new Promise(function(n,o){var r=a.apply(e,t);function i(c){Ke(r,n,o,i,l,"next",c)}function l(c){Ke(r,n,o,i,l,"throw",c)}i(void 0)})}}function R(a,e,t){return(e=Qs(e))in a?Object.defineProperty(a,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):a[e]=t,a}function Qs(a){var e=ea(a,"string");return typeof e=="symbol"?e:e+""}function ea(a,e){if(typeof a!="object"||!a)return a;var t=a[Symbol.toPrimitive];if(t!==void 0){var n=t.call(a,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(a)}var ue=K.module("PouchStorageTable"),ta="Deephaven.";et.plugin(Rt);function na(a,e){switch(a){case L.in:case L.contains:return{$regex:new RegExp("".concat(e)).toString()};case L.inIgnoreCase:return{$regex:new RegExp("".concat(e),"i").toString()};case L.eq:return{$eq:e};case L.notEq:return{$ne:e};case L.greaterThan:return{$gt:e};case L.greaterThanOrEqualTo:return{$gte:e};case L.lessThan:return{$lt:e};case L.lessThanOrEqualTo:return{$lte:e};case L.startsWith:return{$regex:new RegExp("^".concat(e,".*")).toString()};default:throw new Error("Unsupported type: ".concat(a))}}function sa(a){for(var{filterItems:e,filterOperators:t}=a,n=null,o=0;o<e.length;o+=1){var r=e[o],{columnName:i,type:l,value:c}=r,d={[i]:na(l,c)};if(o===0)n=d;else if(n!==null&&o-1<t.length){var u=t[o-1];if(u===ne.and)n={$and:[n,d]};else if(u===ne.or)n={$or:[n,d]};else throw new Error("Unexpected filter operator ".concat(u,", ").concat(d))}}if(n==null)throw new Error("Invalid filter config ".concat(a));return n}function he(){var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];return{$and:[...a.map(e=>sa(e)),{name:{$gt:null}},{id:{$gt:null}}]}}function aa(a){var e,t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return[{id:t?"desc":"asc"},...(e=a?.map(n=>({[n.column]:n.direction})))!==null&&e!==void 0?e:[]]}class oa{constructor(e,t){R(this,"db",void 0),R(this,"changes",void 0),R(this,"listeners",[]),R(this,"itemListeners",new Map),R(this,"currentSize",0),R(this,"currentViewport",void 0),R(this,"currentReverse",!1),R(this,"currentFilter",null),R(this,"currentSort",null),R(this,"infoUpdatePromise",void 0),R(this,"viewportUpdatePromise",void 0),R(this,"currentViewportData",void 0),this.db=new et("".concat(ta).concat(e),t),this.db._remote=!1,this.listenForChanges(),this.db.createIndex({index:{fields:["id","name"]}}),this.refreshInfo()}listenForChanges(){this.changes=this.db.changes({live:!0,since:"now",include_docs:!0}).on("change",this.dbUpdate.bind(this))}onUpdate(e){return this.listeners=[...this.listeners,e],()=>{this.listeners=this.listeners.filter(t=>t!==e)}}onItemUpdate(e,t){return this.itemListeners.has(e)||this.itemListeners.set(e,[]),this.itemListeners.set(e,[...this.itemListeners.get(e),t]),this.refreshItem(e),()=>{this.itemListeners.set(e,this.itemListeners.get(e).filter(n=>n!==t))}}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}getViewportData(){var e=this;return M(function*(){var t;return e.viewportUpdatePromise||e.refreshData(),(t=e.viewportUpdatePromise)!==null&&t!==void 0?t:Promise.resolve({items:[],offset:0})})()}put(e){var t=this;return M(function*(){var n=Ue(Ue({},e),{},{_id:e.id});return yield t.db.put(n),n})()}sendUpdate(){for(var e,{listeners:t}=this,n=(e=this.currentViewportData)!==null&&e!==void 0?e:{items:[],offset:0},o=0;o<t.length;o+=1)t[o](n)}sendItemUpdate(e){var t=this.itemListeners.get(e.id);if(t!==void 0)for(var n=0;n<t.length;n+=1)t[n](e)}dbUpdate(e){ue.debug("Update received",e),this.refreshInfo(),e.doc!==void 0&&this.sendItemUpdate(e.doc),this.refreshData()}fetchInfo(e){var t=this;return M(function*(){return t.db.find({selector:e,fields:[]})})()}refreshInfo(){var e=this;return M(function*(){try{var t,n;(t=e.infoUpdatePromise)===null||t===void 0||t.cancel(),e.infoUpdatePromise=B.makeCancelable(e.fetchInfo(he((n=e.currentFilter)!==null&&n!==void 0?n:[])));var o=yield e.infoUpdatePromise;e.currentSize=o.docs.length,e.sendUpdate()}catch(r){if(!B.isCanceled(r))throw ue.error("Unable to refreshInfo",r),r}})()}fetchViewportData(e,t,n){var o=this;return M(function*(){return o.db.find({selector:t,skip:e.top,limit:e.bottom-e.top+1,sort:n,fields:["id","name"]}).then(r=>({items:r.docs,offset:e.top}))})()}refreshData(){var e=this;return M(function*(){if(e.currentViewport)try{var t,n,o=he((t=e.currentFilter)!==null&&t!==void 0?t:[]),r=aa(e.currentSort,e.currentReverse);(n=e.viewportUpdatePromise)===null||n===void 0||n.cancel(),e.viewportUpdatePromise=B.makeCancelable(e.fetchViewportData(e.currentViewport,o,r));var i=yield e.viewportUpdatePromise;return e.currentViewportData=i,e.sendUpdate(),i}catch(l){if(!B.isCanceled(l))throw ue.error("Unable to refreshData",l),l}})()}refreshItem(e){var t=this;return M(function*(){var n=yield t.db.find({selector:{id:e},limit:1}),o=n.docs[0];return o!==void 0&&t.sendItemUpdate(o),o})()}getSnapshot(e){var t=this;return M(function*(){var n=new Map,o=[{id:t.currentReverse?"desc":"asc"}];return yield Promise.all(e.map(function(){var r=M(function*(i){var l,[c,d]=i,u=d-c+1;return t.db.find({selector:he((l=t.currentFilter)!==null&&l!==void 0?l:[]),skip:c,limit:u,sort:o,fields:["id","name"]}).then(h=>{for(var f=0;f<u;f+=1){var C=c+f;n.set(C,h.docs[f])}})});return function(i){return r.apply(this,arguments)}}())),n})()}}function $e(a,e){var t=Object.keys(a);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(a);e&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(a,o).enumerable})),t.push.apply(t,n)}return t}function te(a){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?$e(Object(t),!0).forEach(function(n){yt(a,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(t)):$e(Object(t)).forEach(function(n){Object.defineProperty(a,n,Object.getOwnPropertyDescriptor(t,n))})}return a}function We(a,e,t,n,o,r,i){try{var l=a[r](i),c=l.value}catch(d){return void t(d)}l.done?e(c):Promise.resolve(c).then(n,o)}function J(a){return function(){var e=this,t=arguments;return new Promise(function(n,o){var r=a.apply(e,t);function i(c){We(r,n,o,i,l,"next",c)}function l(c){We(r,n,o,i,l,"throw",c)}i(void 0)})}}function yt(a,e,t){return(e=ra(e))in a?Object.defineProperty(a,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):a[e]=t,a}function ra(a){var e=ia(a,"string");return typeof e=="symbol"?e:e+""}function ia(a,e){if(typeof a!="object"||!a)return a;var t=a[Symbol.toPrimitive];if(t!==void 0){var n=t.call(a,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(a)}var la=2500,ca=2e3,O=K.module("PouchCommandHistoryTable");class Ge extends oa{constructor(e,t){var n;super("CommandHistoryStorage.".concat(e),{auto_compaction:!0,revs_limit:1}),yt(this,"searchText",void 0),this.cache=t,this.cache.tableRegistry.has(this.cacheKey)||this.cache.tableRegistry.set(this.cacheKey,new Set),O.debug("Adding table to registry",this.cacheKey),(n=this.cache.tableRegistry.get(this.cacheKey))===null||n===void 0||n.add(this)}get cacheKey(){return this.db.name}setSearch(e){O.debug("Setting search filters",e),this.searchText=e.trim().toLowerCase(),this.setFilters(e?[Ae.makeFilterConfig([Ae.makeFilterItem("name",L.contains,e)])]:[])}dbUpdate(e){O.debug("Clearing cache and refreshing data",e),this.cache.response.delete(this.cacheKey),super.dbUpdate(e)}fetchData(e){var t=this;return J(function*(){return B.withTimeout(0,J(function*(){t.cache.response.has(t.cacheKey)?O.debug("Fetching from cache",t.searchText,t.viewport):(O.debug("Fetching from PouchDB",t.searchText,t.viewport),t.cache.response.set(t.cacheKey,t.db.allDocs({include_docs:!0}).then(o=>{var r=o.rows.map(c=>c.doc).filter(c=>{var{name:d}=c;return d});O.debug("Fetched ".concat(r.length," command history items"));var{toKeep:i,toPrune:l}=Xs(r,la,ca);return l.length&&t.pruneItems(l),{docs:i}})));var n=t.cache.response.get(t.cacheKey);return t.searchText==null||t.searchText===""?n:te(te({},n),{},{docs:(yield n).docs.filter(o=>{var{name:r}=o;return r.toLowerCase().includes(t.searchText)})})}))})()}fetchInfo(e){var t=this;return J(function*(){return t.fetchData(e)})()}fetchViewportData(e,t,n){var o=this;return J(function*(){var r=yield o.fetchData(t);O.debug("Fetching viewport data",e.top,e.bottom+1,n,r);var i=typeof n[0]=="object"&&n[0].id==="desc",l=i?r.docs.slice(0).reverse():r.docs,c=l.slice(e.top,e.bottom+1);return{items:c,offset:e.top}})()}pruneItems(e){var t=this;return J(function*(){if(t.cache.isPruning.get(t.cacheKey)===!0){O.debug("Pruning already in progress. Skipping.");return}try{O.debug("Pruning ".concat(e.length," command history items"));var n=t.cache.pauseChangeListeners(t.cacheKey);t.cache.isPruning.set(t.cacheKey,!0),yield t.db.bulkDocs(e.map(o=>te(te({},o),{},{_deleted:!0}))),t.cache.isPruning.set(t.cacheKey,!1),n(),O.debug("Finished pruning command history items")}catch(o){O.error("An error occurred while pruning db",o)}})()}close(){var e,t,n;O.debug("Closing table",this,(e=this.cache.tableRegistry.get(this.cacheKey))===null||e===void 0?void 0:e.size),(t=this.cache.tableRegistry.get(this.cacheKey))===null||t===void 0||t.delete(this),(n=this.changes)===null||n===void 0||n.cancel(),super.close()}}function me(a,e,t){return(e=da(e))in a?Object.defineProperty(a,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):a[e]=t,a}function da(a){var e=ua(a,"string");return typeof e=="symbol"?e:e+""}function ua(a,e){if(typeof a!="object"||!a)return a;var t=a[Symbol.toPrimitive];if(t!==void 0){var n=t.call(a,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(a)}var Be=K.module("PouchCommandHistoryCache");class ha{constructor(){me(this,"isPruning",void 0),me(this,"response",void 0),me(this,"tableRegistry",void 0),this.isPruning=new Map,this.response=new Map,this.tableRegistry=new Map}pauseChangeListeners(e){var t,n=[];return(t=this.tableRegistry.get(e))===null||t===void 0||t.forEach(o=>{o.changes&&(Be.debug("Pausing event listeners on '".concat(e,"' table"),o),o.changes.cancel(),n.push(o))}),()=>{n.forEach(o=>{var r,i;(r=(i=this.tableRegistry.get(e))===null||i===void 0?void 0:i.has(o))!==null&&r!==void 0&&r&&(Be.debug("Resuming event listeners on '".concat(e,"' table"),o),o.listenForChanges())})}}}function Ve(a,e){var t=Object.keys(a);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(a);e&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(a,o).enumerable})),t.push.apply(t,n)}return t}function He(a){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Ve(Object(t),!0).forEach(function(n){ye(a,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(t)):Ve(Object(t)).forEach(function(n){Object.defineProperty(a,n,Object.getOwnPropertyDescriptor(t,n))})}return a}function Ze(a,e,t,n,o,r,i){try{var l=a[r](i),c=l.value}catch(d){return void t(d)}l.done?e(c):Promise.resolve(c).then(n,o)}function pe(a){return function(){var e=this,t=arguments;return new Promise(function(n,o){var r=a.apply(e,t);function i(c){Ze(r,n,o,i,l,"next",c)}function l(c){Ze(r,n,o,i,l,"throw",c)}i(void 0)})}}function ye(a,e,t){return(e=ma(e))in a?Object.defineProperty(a,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):a[e]=t,a}function ma(a){var e=pa(a,"string");return typeof e=="symbol"?e:e+""}function pa(a,e){if(typeof a!="object"||!a)return a;var t=a[Symbol.toPrimitive];if(t!==void 0){var n=t.call(a,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(a)}var Ye=K.module("PouchCommandHistoryStorage");class ga{constructor(){ye(this,"cache",new ha),ye(this,"updateTableMap",new Map)}getUpdateTable(e){return this.updateTableMap.has(e)||this.updateTableMap.set(e,new Ge(e,this.cache)),this.updateTableMap.get(e)}getTable(e){var t=this;return pe(function*(){return new Ge(e,t.cache)})()}addItem(e,t,n,o){var r=this;return pe(function*(){return r.updateItem(e,{id:"".concat(new Date().getTime()),name:n,data:o})})()}updateItem(e,t){var n=this;return pe(function*(){var o=n.getUpdateTable(e),r=yield o.refreshItem(t.id),i=He(He({},r??{}),t);return Ye.debug("Updating item",i),yield o.put(i),Ye.debug("Update saved"),t})()}listenItem(e,t,n){var o=this.getUpdateTable(e);return o.onItemUpdate(t,n)}}const St="SET_LAYOUT_STORAGE",fa=a=>({type:St,payload:a});var{dh:ba}=globalThis;const va=K.module("SettingsUtils");function ya(a){return a.formatString!=null}function xt(a){const e=It.parse(window.navigator.userAgent),t=`${e.browser.name??""} ${Number(parseFloat(e.browser.version??""))||""}`,n=`${e.os.name??""} ${e.os.version??""}`;return{"Engine Version":a.get("deephaven.version")??"Unknown","Web UI Version":"0.85.41","Java Version":a.get("java.version")??"Unknown","Barrage Version":a.get("barrage.version")??"Unknown","Browser Name":t.trim()||"Unknown","OS Name":n.trim()||"Unknown"}}function qe(a){return Array.from(a.entries()).filter(e=>e[1].version!==void 0).reduce((e,[t,n])=>({...e,[t]:n.version}),{})}function Se(a){const e=a?.querySelector("input, select, textarea");e&&e.focus()}function Ct(a,e){return a.defaultFormatString===e.defaultFormatString}function Sa(a,e){return Ct(a,e)}function xa(a,e){return Ct(a,e)}function Tt(a){return a!==""&&Ht.isValidColumnName(a)}function Z(a,e,t){if(!e||t.formatString==null||!ya(t))return!1;switch(e){case"datetime":return G.isValid(a,t);case"decimal":return _.isValid(a,t);case"int":return P.isValid(a,t);default:return va.warn("Trying to validate format of unknown type"),!0}}function Ca(a){const{id:e,isNewRule:t,...n}=a;return n}function Ta(a,e){return Tt(e.columnName)&&Z(a,e.columnType,e.format)}function wt(a){const{timestamp:e,timeZone:t,showTimeZone:n,showTSeparator:o,isGlobalOptions:r,legacyGlobalFormat:i}=a,l=nt(),c=m.useMemo(()=>new Zt(l,[],{timeZone:t,showTimeZone:n,showTSeparator:o}),[l,n,o,t]),d=r?G.getGlobalFormats(n,o):G.getFormats(n,o);return i!=null&&!d.includes(i)&&d.unshift(i),s.jsx(s.Fragment,{children:d.map(u=>{const h=G.makeFormat("",u,G.TYPE_GLOBAL);return s.jsx("option",{value:u,"data-testid":"time-format",children:c.getFormattedString(e,N.dataType.DATETIME,"",h)},u)})})}function wa(){return s.jsx(s.Fragment,{children:Yt.TIME_ZONES.map(a=>{const{label:e,value:t}=a;return s.jsx("option",{value:t,children:e},t)})})}const $=K.module("FormattingSectionContent");class Te extends m.PureComponent{static defaultProps={scrollTo:()=>{}};static inputDebounceTime=250;constructor(e){super(e),this.debouncedCommitChanges=tt(this.commitChanges.bind(this),Te.inputDebounceTime),this.queueUpdate=this.queueUpdate.bind(this),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),this.handleShowEmptyStringsChange=this.handleShowEmptyStringsChange.bind(this),this.handleShowNullStringsChange=this.handleShowNullStringsChange.bind(this);const{defaultDateTimeFormat:t,defaultDecimalFormatOptions:n,defaultIntegerFormatOptions:o,showTimeZone:r,showTSeparator:i,timeZone:l,truncateNumbersWithPound:c,showEmptyStrings:d,showNullStrings:u}=e;this.containerRef=q.createRef(),this.pendingUpdates=[],this.state={showTimeZone:r,showTSeparator:i,timeZone:l,defaultDateTimeFormat:t,defaultDecimalFormatOptions:n,defaultIntegerFormatOptions:o,truncateNumbersWithPound:c,showEmptyStrings:d,showNullStrings:u,timestampAtMenuOpen:new Date}}componentDidMount(){Se(this.containerRef.current)}componentWillUnmount(){this.debouncedCommitChanges.flush()}debouncedCommitChanges;pendingUpdates;containerRef;getCachedDateTimeFormatOptions=ge((e,t,n,o=!1,r)=>{const{timestampAtMenuOpen:i}=this.state;return s.jsx(wt,{timestamp:i,timeZone:e,showTimeZone:t,showTSeparator:n,isGlobalOptions:o,legacyGlobalFormat:r})});queueUpdate(e){this.pendingUpdates.push(e),this.debouncedCommitChanges()}handleDefaultDateTimeFormatChange(e){$.debug("handleDefaultDateTimeFormatChange",e);const t={defaultDateTimeFormat:e};this.setState(t),this.queueUpdate(t)}handleDefaultDecimalFormatChange(e){$.debug("handleDefaultDecimalFormatChange",e.target.value);const t={defaultDecimalFormatOptions:{defaultFormatString:e.target.value}};this.setState(t),Z(dh,N.dataType.DECIMAL,_.makeCustomFormat(e.target.value))&&this.queueUpdate(t)}handleDefaultIntegerFormatChange(e){$.debug("handleDefaultIntegerFormatChange",e.target.value);const t={defaultIntegerFormatOptions:{defaultFormatString:e.target.value}};this.setState(t),Z(dh,N.dataType.INT,P.makeCustomFormat(e.target.value))&&this.queueUpdate(t)}handleShowTimeZoneChange(){const{showTimeZone:e}=this.state,t={showTimeZone:!e};this.setState(t),this.queueUpdate(t)}handleShowTSeparatorChange(){const{showTSeparator:e}=this.state,t={showTSeparator:!e};this.setState(t),this.queueUpdate(t)}handleTimeZoneChange(e){const t={timeZone:e};this.setState(t),this.queueUpdate(t)}handleResetDateTimeFormat(){const{defaults:e}=this.props,{defaultDateTimeFormat:t,showTimeZone:n,showTSeparator:o}=e;$.debug("handleResetDateTimeFormat"),this.setState({defaultDateTimeFormat:t,showTimeZone:n,showTSeparator:o}),this.queueUpdate({defaultDateTimeFormat:void 0,showTimeZone:void 0,showTSeparator:void 0})}handleResetTimeZone(){const{defaults:e}=this.props,{timeZone:t}=e;$.debug("handleResetTimeZone"),this.setState({timeZone:t}),this.queueUpdate({timeZone:void 0})}handleResetDecimalFormat(){const{defaults:e}=this.props,{defaultDecimalFormatOptions:t}=e;$.debug("handleResetDecimalFormat"),this.setState({defaultDecimalFormatOptions:t}),this.queueUpdate({defaultDecimalFormatOptions:void 0})}handleResetIntegerFormat(){const{defaults:e}=this.props,{defaultIntegerFormatOptions:t}=e;$.debug("handleResetIntegerFormat"),this.setState({defaultIntegerFormatOptions:t}),this.queueUpdate({defaultIntegerFormatOptions:void 0})}handleTruncateNumbersWithPoundChange(){const{truncateNumbersWithPound:e}=this.state,t={truncateNumbersWithPound:e!==!0};this.setState(t),this.queueUpdate(t)}handleShowEmptyStringsChange(){const{showEmptyStrings:e}=this.state,t={showEmptyStrings:!e};this.setState(t),this.queueUpdate(t)}handleShowNullStringsChange(){const{showNullStrings:e}=this.state,t={showNullStrings:!e};this.setState(t),this.queueUpdate(t)}commitChanges(){const{updateSettings:e}=this.props,t=this.pendingUpdates.reduce((n,o)=>({...n,...o}),{});this.pendingUpdates=[],e(t)}render(){const{defaults:e,dh:t}=this.props,{defaultDateTimeFormat:n,defaultDecimalFormatOptions:o,defaultIntegerFormatOptions:r,timeZone:i,showTimeZone:l,showTSeparator:c,truncateNumbersWithPound:d,showEmptyStrings:u,showNullStrings:h}=this.state,{defaultFormatString:f=_.DEFAULT_FORMAT_STRING}=o??{},{defaultFormatString:C=P.DEFAULT_FORMAT_STRING}=r??{},p=i===e.timeZone,v=c===e.showTSeparator&&l===e.showTimeZone&&n===e.defaultDateTimeFormat,I=Sa(o,e.defaultDecimalFormatOptions),S=xa(r,e.defaultIntegerFormatOptions);return s.jsx("div",{className:"app-settings-formatting-section",ref:this.containerRef,children:s.jsxs("div",{className:"container-fluid p-0",children:[s.jsx("div",{className:"app-settings-menu-description mb-3",children:"Choose the default formatting rule to apply to all table columns based on their type."}),s.jsxs("div",{className:"form-row mb-2",children:[s.jsx("label",{className:"col-form-label col-3",htmlFor:"select-reset-timezone",children:"Time zone"}),s.jsx("div",{className:"col pr-0",children:s.jsx(se,{className:"custom-select",value:i,onChange:this.handleTimeZoneChange,id:"select-reset-timezone",children:s.jsx(wa,{})})}),s.jsx("div",{className:"col-1 btn-col",children:s.jsx(y,{kind:"ghost",icon:H,onClick:this.handleResetTimeZone,tooltip:"Reset Time Zone",className:F("btn-reset","btn-reset-time-zone",{hidden:p})})})]}),s.jsxs("div",{className:"form-row mb-2",children:[s.jsx("label",{className:"col-form-label col-3",htmlFor:"select-default-time-format",children:"DateTime"}),s.jsx("div",{className:"col pr-0",children:s.jsx(se,{className:"custom-select",value:n,onChange:this.handleDefaultDateTimeFormatChange,id:"select-default-time-format",children:this.getCachedDateTimeFormatOptions(i,l,c,!0,n)})}),s.jsx("div",{className:"col-1 btn-col",children:s.jsx(y,{kind:"ghost",icon:H,onClick:this.handleResetDateTimeFormat,tooltip:"Reset DateTime Options",className:F("btn-reset","btn-reset-date-time",{hidden:v})})})]}),s.jsx("div",{className:"form-row",children:s.jsx("div",{className:"offset-3 col-9",children:s.jsx(z,{checked:l??null,onChange:this.handleShowTimeZoneChange,children:"Show time zone in dates"})})}),s.jsx("div",{className:"form-row mb-3",children:s.jsx("div",{className:"offset-3 col-9",children:s.jsx(z,{checked:c??null,onChange:this.handleShowTSeparatorChange,children:"Show 'T' separator"})})}),s.jsxs("div",{className:"form-row mb-2",children:[s.jsx("label",{className:"col-form-label col-3",htmlFor:"default-decimal-format-input",children:"Decimal"}),s.jsx("div",{className:"col pr-0",children:s.jsx("input",{className:F("form-control","flex-grow-1","default-decimal-format-input",{"is-invalid":!Z(t,N.dataType.DECIMAL,_.makeCustomFormat(f))}),"data-lpignore":!0,placeholder:_.DEFAULT_FORMAT_STRING,type:"text",id:"default-decimal-format-input",value:f,onChange:this.handleDefaultDecimalFormatChange})}),s.jsx("div",{className:"col-1 btn-col",children:s.jsx(y,{kind:"ghost",icon:H,onClick:this.handleResetDecimalFormat,tooltip:"Reset Decimal Formatting",className:F("btn-reset","btn-reset-decimal",{hidden:I}),"data-testid":"btn-reset-decimal"})})]}),s.jsxs("div",{className:"form-row mb-2",children:[s.jsx("label",{className:"col-form-label col-3",htmlFor:"default-integer-format-input",children:"Integer"}),s.jsx("div",{className:"col pr-0",children:s.jsx("input",{className:F("form-control","flex-grow-1","default-integer-format-input",{"is-invalid":!Z(t,N.dataType.INT,P.makeCustomFormat(C))}),"data-lpignore":!0,placeholder:P.DEFAULT_FORMAT_STRING,type:"text",id:"default-integer-format-input",value:C,onChange:this.handleDefaultIntegerFormatChange})}),s.jsx("div",{className:"col-1 btn-col",children:s.jsx(y,{kind:"ghost",icon:H,onClick:this.handleResetIntegerFormat,tooltip:"Reset Integer Formatting",className:F("btn-reset","btn-reset-integer",{hidden:S}),"data-testid":"btn-reset-integer"})})]}),s.jsx("div",{className:"form-row mb-2",children:s.jsx("div",{className:"offset-3 col-9",children:s.jsx(z,{checked:d??null,onChange:this.handleTruncateNumbersWithPoundChange,children:"Show truncated numbers as ###"})})}),s.jsxs("div",{className:"form-row mb-3",children:[s.jsx("label",{className:"col-form-label col-3",htmlFor:"default-integer-format-input",children:"String"}),s.jsxs("div",{className:"col pr-0 pt-2",children:[s.jsxs(z,{checked:u??null,onChange:this.handleShowEmptyStringsChange,children:["Show empty strings as"," ",s.jsx("span",{className:"font-italic text-muted",children:"empty"})]}),s.jsxs(z,{checked:h??null,onChange:this.handleShowNullStringsChange,children:["Show null strings as"," ",s.jsx("span",{className:"font-italic text-muted",children:"null"})]})]})]})]})})}}const ja=a=>({defaultDateTimeFormat:Qt(a),defaultDecimalFormatOptions:lt(a),defaultIntegerFormatOptions:it(a),dh:rt(a),showTimeZone:ot(a),showTSeparator:at(a),truncateNumbersWithPound:Xt(a),showEmptyStrings:Jt(a),showNullStrings:zt(a),timeZone:st(a),defaults:qt(a)}),Da=oe(ja,{updateSettings:Q})(Te);function Na(){const[a,e]=m.useState(!1),t=()=>{e(!a)};return s.jsxs(s.Fragment,{children:[s.jsx(y,{kind:"ghost",onClick:t,icon:Zn,children:"Legal Notices"}),s.jsxs(Yn,{isOpen:a,toggle:t,children:[s.jsx(qn,{toggle:t,children:"Legal Notice"}),s.jsxs(zn,{children:[s.jsx("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,494; 9,836,495; 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,346,394; 10,353,893; 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; 10,783,191; 10,866,943; 10,909,183; 10,915,526; 10,922,311; 10,929,394; 11,023,462; 11,126,662; 11,151,133; 11,238,036; 11,249,994; 11,263,211; 11,449,557; 11,514,037; 11,556,528; and 11,574,018. Other patents pending."}),s.jsxs("p",{children:["© 2016-",new Date().getFullYear()," Deephaven Data Labs LLC. Patent Pending."]})]})]})]})}function W(a){const{children:e,isExpanded:t,sectionKey:n,title:o,onToggle:r}=a;return s.jsxs(s.Fragment,{children:[s.jsx("div",{children:s.jsxs(y,{kind:"ghost",className:"btn-collapse-trigger",onClick:()=>r(n),children:[s.jsx("div",{className:"flex-grow-1",children:o}),s.jsx("div",{className:"flex-shrink-0",children:s.jsx(D,{transform:t?"flip-v":"",icon:Jn})})]})}),s.jsx(ws,{in:t,autoFocusOnShow:!0,children:e})]})}W.propTypes={children:w.node,isExpanded:w.bool.isRequired,sectionKey:w.string.isRequired,title:w.node.isRequired,onToggle:w.func};W.defaultProps={children:null,onToggle:()=>{}};function Fa({shortcut:a,displayText:e,categoryName:t,onChange:n}){const[o,r]=m.useState(e),[i,l]=m.useState(a.getKeyState()),[c,d]=m.useState(!1),[u,h]=m.useState("");m.useEffect(function(){r(e),l(a.getKeyState())},[e,a]),m.useEffect(function(){r(k.getDisplayText(i)),a.matchesKeyState(i)&&d(!1)},[i,a]),m.useEffect(function(){if(c){if(!k.isValidKeyState(i)){k.isAllowedKey(i.keyValue)?h("Must contain a modifier key"):h("Must contain an allowed action key");return}const g=Ce.getConflictingShortcuts(i).filter(b=>b.id.startsWith(t)&&b!==a).map(b=>b.name);if(g.length){h(`Conflicts with ${g.join(", ")}`);return}h("")}else h("")},[c,i,t,a]);function f(T){if(T.stopPropagation(),T.preventDefault(),a.isEditable&&!T.repeat){const g=k.getKeyStateFromEvent(T),b=k.createKeyState([en.BACKSPACE]);k.doKeyStatesMatch(g,b)?l(k.NULL_KEY_STATE):l(g)}}function C(T){T.stopPropagation(),T.preventDefault(),a.matchesKeyState(i)||d(!0)}function p(){Fe.disableAllActions()}function v(){Fe.enableAllActions()}function I(){a.setKeyState(i),d(!1),n(a)}function S(){const T=a.getKeyState();l(T),d(!1)}function A(){d(!0),l(a.getDefaultKeyState())}return s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"shortcut-item-container",children:[s.jsxs("label",{className:"shortcut-item-name",children:[a.name,a.tooltip!==void 0&&s.jsx(ct,{children:a.tooltip})]}),s.jsxs("div",{className:"shortcut-item-input-container",children:[s.jsx("input",{className:F("form-control",{"is-invalid":u}),onKeyDown:f,onKeyUp:C,onFocus:p,onBlur:v,disabled:!a.isEditable,value:o,readOnly:!0}),!k.doKeyStatesMatch(i,a.getDefaultKeyState())&&!u&&s.jsx(y,{className:"reset-to-default-button",kind:"ghost",icon:s.jsx(D,{icon:H,transform:{rotate:90,flipX:!0}}),tooltip:"Reset to default",onClick:A})]})]}),c&&s.jsxs("div",{className:F("shortcut-item-message-container",{"is-invalid":u}),children:[s.jsx("div",{className:"shortcut-item-message",children:u}),s.jsxs("div",{className:"shortcut-item-message-buttons",children:[k.isValidKeyState(i)&&s.jsx(y,{kind:"ghost",onClick:I,children:"Confirm"}),s.jsx(y,{kind:"ghost",onClick:S,children:"Undo"})]})]})]})}function Ea({shortcutOverrides:a={},updateSettings:e}){const t=m.useCallback(i=>{const l=k.isMacPlatform,c={mac:{...a.mac},windows:{...a.windows}},d=l?c.mac:c.windows;i.forEach(u=>{u.isDefault()?delete d[u.id]:d[u.id]=u.getKeyState()}),e({shortcutOverrides:c})},[e,a]);let n=Array.from(Ce.shortcutsByCategory.entries()).map(([i,l])=>({name:i,shortcuts:l}));const o=n.findIndex(i=>i.name.toUpperCase()==="GLOBAL"),r=n.splice(o,1);return n=n.concat(r),s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"app-settings-menu-description",children:"Customize shortcuts below. To prevent unexpected results, avoid conflicting shortcuts with the browser or IDE editor."}),n.map(i=>s.jsx(Ra,{name:i.name,shortcuts:i.shortcuts,saveShortcutOverrides:t},i.name))]})}function Ra({name:a,shortcuts:e,saveShortcutOverrides:t}){function n(c){return c.split("_").map(d=>`${d[0].toUpperCase()}${d.slice(1).toLowerCase()}`).join(" ")}const[o,r]=m.useState(e);function i(c){const d=o.filter(h=>h!==c&&!h.isNull()&&h.matchesKeyState(c.getKeyState()));d.forEach(h=>h.setToNull());const u=[c,...d];t(u),r(h=>[...h])}const l=m.useMemo(()=>o.map(c=>c.getDisplayText()),[o]);return s.jsxs("div",{className:"mt-3",children:[s.jsx("div",{className:"font-weight-bold",children:n(a)}),o.map((c,d)=>s.jsx(Fa,{shortcut:c,displayText:l[d],categoryName:a,onChange:i},c.id))]})}const Ia=a=>({shortcutOverrides:tn(a)}),Oa={updateSettings:Q},La=oe(Ia,Oa)(Ea),ka=[{value:N.dataType.DATETIME,label:"DateTime"},{value:N.dataType.DECIMAL,label:"Decimal"},{value:N.dataType.INT,label:"Integer"}];function Pa(){const a=ka.map(e=>s.jsx("option",{value:e.value,children:e.label},`key-columnType-${e.value}`));return s.jsxs(s.Fragment,{children:[s.jsx("option",{disabled:!0,value:"",children:"Select Type"},"key-columnType-placeholder"),a]})}class we extends m.PureComponent{static defaultProps={scrollTo:()=>{}};static inputDebounceTime=250;constructor(e){super(e),this.debouncedCommitChanges=tt(this.commitChanges.bind(this),we.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:t,showTimeZone:n,showTSeparator:o,timeZone:r}=e,i=t.map((l,c)=>({...l,id:c}));this.containerRef=q.createRef(),this.addFormatRuleButtonRef=q.createRef(),this.lastFormatRuleIndex=i.length,this.state={formatSettings:i,formatRulesChanged:!1,showTimeZone:n,showTSeparator:o,timeZone:r,timestampAtMenuOpen:new Date}}componentDidMount(){Se(this.containerRef.current)}componentWillUnmount(){this.debouncedCommitChanges.flush()}debouncedCommitChanges;containerRef;addFormatRuleButtonRef;lastFormatRuleIndex;isDuplicateRule(e){const{formatSettings:t}=this.state;return t.some(n=>n.id!==e.id&&n.columnName===e.columnName&&n.columnType===e.columnType)??!1}getAutoIncrementFormatRuleIndex(){const{lastFormatRuleIndex:e}=this;return this.lastFormatRuleIndex+=1,e}getCachedColumnTypeOptions=ge(()=>s.jsx(Pa,{}));getCachedDateTimeFormatOptions=ge((e,t,n,o=!1,r)=>{const{timestampAtMenuOpen:i}=this.state;return s.jsx(wt,{timestamp:i,timeZone:e,showTimeZone:t,showTSeparator:n,isGlobalOptions:o,legacyGlobalFormat:r})});handleFormatRuleChange(e,t,n){this.setState(o=>{const{formatSettings:r}=o;be(r);const i=[...r];let l={};t==="columnType"&&(l={format:this.makeDefaultFormatterItemByType(n)});const c={...i[e],...l,[t]:n};return i[e]=c,{formatSettings:i}},()=>{this.debouncedCommitChanges()})}handleFormatRuleCreate(){this.setState(e=>{const{formatSettings:t}=e,n={columnType:N.dataType.DATETIME,columnName:"",format:{},id:this.getAutoIncrementFormatRuleIndex(),isNewRule:!0};return{formatSettings:[...t,n],formatRulesChanged:!0}})}handleFormatRuleDelete(e){this.setState(t=>{const{formatSettings:n}=t;return{formatSettings:n.filter((r,i)=>i!==e),formatRulesChanged:!0}},()=>{this.debouncedCommitChanges()})}handleFormatRuleEntered(e){this.scrollToFormatBlockBottom(),Se(e)}commitChanges(){const{formatSettings:e}=this.state,{dh:t}=this.props,n=e.filter(i=>Ta(t,i)).map(Ca)??[],{updateSettings:o}=this.props;o({formatter:n})}scrollToFormatBlockBottom(){const{scrollTo:e}=this.props;e(0,(this.addFormatRuleButtonRef.current?.offsetHeight??0)+(this.addFormatRuleButtonRef.current?.offsetTop??0))}getRuleError(e){const{dh:t}=this.props,n={hasColumnNameError:!1,hasFormatError:!1,message:""},o=[];return e.isNewRule!==void 0&&e.isNewRule||(this.isDuplicateRule(e)&&(n.hasColumnNameError=!0,o.push("Duplicate column name/type combo.")),Tt(e.columnName)||(n.hasColumnNameError=!0,o.push("Column names must start with a letter or underscore and contain only alphanumeric characters or underscores.")),e.format.formatString!=null&&e.format.formatString.length===0?(n.hasFormatError=!0,o.push("Empty formatting rule.")):Z(t,e.columnType,e.format)||(n.hasFormatError=!0,o.push("Invalid formatting rule.")),n.message=o.join(`
3
- `)),n}makeDefaultFormatterItemByType(e){switch(N.getNormalizedType(e)){case N.dataType.INT:{const{defaultIntegerFormatOptions:t}=this.props,{defaultFormatString:n}=t;return P.makeFormat("",n??P.DEFAULT_FORMAT_STRING,P.TYPE_GLOBAL,void 0)}case N.dataType.DECIMAL:{const{defaultDecimalFormatOptions:t}=this.props,{defaultFormatString:n}=t;return _.makeFormat("",n??_.DEFAULT_FORMAT_STRING,_.TYPE_GLOBAL,void 0)}default:return""}}renderFormatRule(e,t){const n=`input-${e}-columnName`,o=`input-${e}-columnType`,r=`input-${e}-format`,i=this.getCachedColumnTypeOptions(),l=h=>this.handleFormatRuleChange(e,"columnName",h.target.value),c=()=>this.handleFormatRuleChange(e,"isNewRule",!1),d=h=>this.handleFormatRuleChange(e,"columnType",h),u=this.getRuleError(t);return s.jsxs("fieldset",{className:"container-fluid format-rule-container",children:[s.jsxs("div",{className:"form-row",children:[s.jsxs("div",{className:"form-group col-7 mb-2",children:[s.jsx("label",{htmlFor:n,children:"Column Name"}),s.jsx("input",{id:n,className:F("form-control",{"is-invalid":u.hasColumnNameError}),"data-lpignore":!0,type:"text",value:t.columnName,onChange:l,onBlur:c})]}),s.jsxs("div",{className:"form-group col mb-2",children:[s.jsx(y,{kind:"ghost",className:"btn-delete-format-rule float-right",tabIndex:-1,onClick:()=>this.handleFormatRuleDelete(e),icon:Xn,tooltip:"Delete","aria-label":"Delete Format Rule"}),s.jsx("label",{htmlFor:o,children:"Column Type"}),s.jsx(se,{id:o,className:"custom-select",value:t.columnType,onChange:d,children:i})]})]}),s.jsx("div",{className:"form-row",children:s.jsxs("div",{className:"form-group col-12 d-flex mb-2",children:[s.jsx("label",{className:"flex-shrink-0 col-form-label mr-3",htmlFor:r,children:"Formatting Rule"}),this.renderFormatRuleInput(e,t.columnType,r,t.format,u.hasFormatError)]})}),s.jsx("div",{className:"form-row",children:s.jsx("div",{className:"form-group col-12 d-flex mb-2",children:u.message&&s.jsx("p",{className:"text-danger",children:u.message})})})]},e)}renderFormatRuleInput(e,t,n,o,r){switch(N.getNormalizedType(t)){case N.dataType.DATETIME:return this.renderDateTimeFormatRuleInput(e,n,o,r);case N.dataType.DECIMAL:return this.renderDecimalFormatRuleInput(e,n,o,r);case N.dataType.INT:return this.renderIntegerFormatRuleInput(e,n,o,r);default:throw new Error(`Unrecognized column type: ${t}`)}}renderDateTimeFormatRuleInput(e,t,n,o){const{showTimeZone:r,showTSeparator:i,timeZone:l}=this.state,c=n.formatString??"";return s.jsxs(se,{className:F("custom-select",{"is-invalid":o}),value:c,id:t,onChange:d=>{const u=G.makeFormat("",d,G.TYPE_GLOBAL);this.handleFormatRuleChange(e,"format",u)},children:[s.jsx("option",{value:"",disabled:!0,children:"Select format"},"default"),this.getCachedDateTimeFormatOptions(l,r,i)]})}renderIntegerFormatRuleInput(e,t,n,o){const{defaultIntegerFormatOptions:r}=this.props;be(r);const{defaultFormatString:i}=r,l=n.formatString??"";return s.jsx("input",{className:F("form-control","flex-grow-1",{"is-invalid":o}),"data-lpignore":!0,id:t,placeholder:i??P.DEFAULT_FORMAT_STRING,type:"text",value:l,onChange:c=>{const d=P.makeFormat("",c.target.value,P.TYPE_GLOBAL,void 0);this.handleFormatRuleChange(e,"format",d)}})}renderDecimalFormatRuleInput(e,t,n,o){const{defaultDecimalFormatOptions:r}=this.props,{defaultFormatString:i}=r,l=n.formatString??"";return s.jsx("input",{className:F("form-control","flex-grow-1",{"is-invalid":o}),"data-lpignore":!0,id:t,placeholder:i??_.DEFAULT_FORMAT_STRING,type:"text",value:l,onChange:c=>{const d=_.makeFormat("",c.target.value,_.TYPE_GLOBAL,void 0);this.handleFormatRuleChange(e,"format",d)}})}render(){const{formatRulesChanged:e,formatSettings:t}=this.state,n=t.map((r,i)=>s.jsx(sn,{onEnter:this.handleFormatRuleEntered,children:this.renderFormatRule(i,r)},r.id)),o=s.jsx(y,{kind:"ghost",className:"mb-3",onClick:this.handleFormatRuleCreate,ref:this.addFormatRuleButtonRef,icon:Qn,children:"Add New Rule"});return s.jsxs("div",{className:"app-settings-formatting-section",ref:this.containerRef,children:[s.jsx("div",{className:"app-settings-menu-description mb-3",children:"Customize the formatting of table columns by applying rules based on matching both a column name and column type."}),s.jsx(Ot,{appear:e,enter:e,exit:e,children:n}),o]})}}const _a=a=>({formatter:nn(a),defaultDecimalFormatOptions:lt(a),defaultIntegerFormatOptions:it(a),dh:rt(a),showTimeZone:ot(a),showTSeparator:at(a),timeZone:st(a)}),Aa=oe(_a,{updateSettings:Q})(we);function Ma(){const a=xe(),e=fe(an),t=fe(on),n=m.useCallback(r=>{a(Q({webgl:r}))},[a]),o=t?s.jsx(de,{children:"WebGL in most cases has significant performance improvements, particularly when plotting large datasets. However, in some environments (such as remote desktop environments), WebGL may not use hardware acceleration and have degraded performance. If you are experiencing issues with WebGL, you can disable it here."}):s.jsx(de,{children:"WebGL is disabled by your system administrator. Contact your system administrator to enable."});return s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"app-settings-menu-description",children:"Advanced settings here. Be careful!"}),s.jsxs("div",{className:"form-row mb-3 pl-1",children:[s.jsx(Lt,{isSelected:e,isDisabled:!t,onChange:n,marginEnd:"size-0",children:"Enable WebGL"}),s.jsxs(kt,{variant:"info",marginTop:"size-50",children:[s.jsx(js,{children:"Enable WebGL"}),s.jsx(Pt,{children:s.jsx(de,{children:o})})]})]})]})}function Ua(){const a=rn(),e=fe(ln),t=xe(),n=m.useCallback(r=>{if(r!=="regular"&&r!=="compact"&&r!=="spacious")throw new Error(`Invalid grid density value: ${r}`);t(Q({gridDensity:r}))},[t]),o=e.gridDensity;return be(a,"ThemeContext value is null"),s.jsxs(s.Fragment,{children:[s.jsx(Ds,{}),s.jsxs(Gs,{label:"Default table density",selectedKey:o,onChange:n,children:[s.jsx(ie,{children:"Regular"},"regular"),s.jsx(ie,{children:"Compact"},"compact"),s.jsx(ie,{children:"Spacious"},"spacious")]})]})}class E extends m.Component{static defaultProps={onDone:()=>{}};static FORMATTING_SECTION_KEY="SettingsMenu.formatting";static COLUMN_SPECIFIC_SECTION_KEY="SettingsMenu.columnFormatting";static APPLICATION_SECTION_KEY="ApplicationMenu.settings";static SHORTCUT_SECTION_KEY="SettingsMenu.shortcuts";static THEME_SECTION_KEY="SettingsMenu.theme";static ADVANCED_SECTION_KEY="SettingsMenu.advanced";static focusFirstInputInContainer(e){const t=e?.querySelector("input, select, textarea");t&&t.focus()}constructor(e){super(e),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.handleLogout=this.handleLogout.bind(this),this.menuContentRef=q.createRef(),this.broadcastChannel=new BroadcastChannel(Ns),this.state={expandedSectionKey:E.FORMATTING_SECTION_KEY}}componentDidMount(){E.focusFirstInputInContainer(this.menuContentRef.current)}componentWillUnmount(){this.broadcastChannel.close()}menuContentRef;broadcastChannel;isSectionExpanded(e){const{expandedSectionKey:t}=this.state;return t===e}handleLogout(){this.broadcastChannel.postMessage(Fs(Es))}handleScrollTo(e,t){this.menuContentRef.current?.scrollTo(e,t)}handleSectionToggle(e){this.setState(t=>({expandedSectionKey:t.expandedSectionKey===e?void 0:e}))}handleClose(){const{onDone:e}=this.props;e()}handleExportSupportLogs(){const{serverConfigValues:e,pluginData:t}=this.props,n=qe(t);Js(ts,{uiVersion:"0.85.41",userAgent:navigator.userAgent,...Object.fromEntries(e),pluginInfo:n},es.getState())}render(){const e="https://github.com/deephaven/web-client-ui/",t="https://deephaven.io/core/docs/",{serverConfigValues:n,pluginData:o,user:r}=this.props,i=xt(n),l=qe(o),c=n.get("deephaven.version"),d=V.COPY_VERSION_INFO.getDisplayText(),u=(p,v)=>s.jsxs(m.Fragment,{children:[s.jsx("div",{children:p}),s.jsx("div",{children:v})]},p),h=r.displayName??r.name,f=r.image!=null&&r.image!=="",C=h!=="";return s.jsxs("div",{className:"app-settings-menu",children:[s.jsxs("header",{className:"app-settings-menu-header",children:[s.jsxs("div",{className:"user-info",children:[s.jsxs("div",{className:"user-image",children:[!f&&s.jsx(D,{icon:ns,transform:"grow-8"}),f&&s.jsx("img",{src:r.image,alt:h})]}),s.jsxs("div",{className:"user-details",children:[C&&s.jsxs("div",{className:"user-name",children:[h,r.operateAs!=null&&r.name!==r.operateAs&&s.jsxs(s.Fragment,{children:[s.jsxs("span",{className:"font-weight-light font-italic",children:[" ","as"," "]}),s.jsxs("span",{className:"operating-as-user",children:[s.jsx(D,{icon:ss,className:"mr-1"}),r.operateAs]})]})]}),r.permissions.canLogout&&s.jsx("button",{type:"button",className:"btn btn-link",onClick:this.handleLogout,children:"logout"})]})]}),s.jsx(y,{kind:"ghost",className:"btn-close-settings-menu",onClick:this.handleClose,icon:s.jsx(D,{icon:as,transform:"grow-4"}),tooltip:"Close"})]}),s.jsxs("div",{className:"app-settings-menu-content",ref:this.menuContentRef,children:[s.jsx("h5",{children:"Settings"}),s.jsx("hr",{className:"my-0"}),s.jsx(W,{sectionKey:E.FORMATTING_SECTION_KEY,isExpanded:this.isSectionExpanded(E.FORMATTING_SECTION_KEY),title:s.jsxs(s.Fragment,{children:[s.jsx(D,{icon:os,transform:"grow-4",className:"mr-2"}),"Default Format & Time zone"]}),onToggle:this.handleSectionToggle,children:s.jsx(Da,{})}),s.jsx(W,{sectionKey:E.COLUMN_SPECIFIC_SECTION_KEY,isExpanded:this.isSectionExpanded(E.COLUMN_SPECIFIC_SECTION_KEY),title:s.jsxs(s.Fragment,{children:[s.jsx(D,{icon:rs,transform:"grow-4",className:"mr-2"}),"Format by Column Name & Type"]}),onToggle:this.handleSectionToggle,children:s.jsx(Aa,{scrollTo:this.handleScrollTo})}),s.jsx(W,{sectionKey:E.THEME_SECTION_KEY,isExpanded:this.isSectionExpanded(E.THEME_SECTION_KEY),onToggle:this.handleSectionToggle,title:s.jsxs(s.Fragment,{children:[s.jsx(D,{icon:is,transform:"grow-4",className:"mr-2"}),"Theme"]}),children:s.jsx(Ua,{})}),s.jsx(W,{sectionKey:E.SHORTCUT_SECTION_KEY,isExpanded:this.isSectionExpanded(E.SHORTCUT_SECTION_KEY),title:s.jsxs(s.Fragment,{children:[s.jsx(D,{icon:ls,transform:"grow-2",className:"mr-2"}),"Keyboard Shortcuts"]}),onToggle:this.handleSectionToggle,children:s.jsx(La,{})}),s.jsx(W,{sectionKey:E.ADVANCED_SECTION_KEY,isExpanded:this.isSectionExpanded(E.ADVANCED_SECTION_KEY),title:s.jsxs(s.Fragment,{children:[s.jsx(D,{icon:cs,transform:"grow-4",className:"mr-2"}),"Advanced"]}),onToggle:this.handleSectionToggle,children:s.jsx(Ma,{})}),s.jsxs("div",{className:"app-settings-footer",children:[s.jsxs("div",{className:"app-settings-footer-section",children:[s.jsxs("div",{className:"app-settings-footer-item",children:[s.jsx("div",{className:"font-weight-bold",children:"Support"}),s.jsxs("div",{children:["GitHub: ",s.jsx("a",{href:e,className:"custom-link",target:"_blank",rel:"noopener noreferrer",children:e})]}),s.jsx(y,{kind:"tertiary",className:"mt-2 py-2",onClick:this.handleExportSupportLogs,children:"Export Logs"})]}),s.jsxs("div",{className:"app-settings-footer-item",children:[s.jsx("div",{className:"font-weight-bold",children:"Documentation"}),s.jsx("a",{target:"_blank",rel:"noreferrer noopener",href:t,className:"custom-link",children:t})]}),s.jsxs("div",{className:"app-settings-footer-item",children:[s.jsx("div",{className:"font-weight-bold",children:"Version"}),s.jsxs("span",{className:"d-inline-block text-muted",children:[c," ",s.jsx(D,{icon:ds}),s.jsxs(ct,{interactive:!0,children:[s.jsx("div",{className:"detailed-server-config",children:Object.entries(i).map(([p,v])=>u(p,v))}),s.jsxs(cn,{kind:"inline",tooltip:"Copy version numbers",copy:Object.entries({...i,...l}).map(([p,v])=>`${p}: ${v}`).join(`
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./StyleGuideRoot-CdUtzsMw.js","./vendor-DKP6ul09.js","./helpers-BosuxZz1.js","./vendor-dwDTpqeK.css","./index-CBNByNSW.js","./monaco-C4VaWq8m.js","./monaco-BSe5n4Us.css","./index-QQhNGkua.css","./IrisGridModel-D4F-tgyo.js","./ControlType-BVvvjMaF.js","./ControlType-572S78uV.css","./IrisGridModel-pNa_tAMp.css","./FontBootstrap-DLw4BBDm.js","./TokenBoxCellRenderer-FBeqcVyj.js","./IrisGridShortcuts-Bb60KPbS.js","./useMergeRef-4fs_JZU-.js","./IrisGridShortcuts-CJtrNKDP.css","./TokenBoxCellRenderer-DTMTgCrk.css","./LocalWorkspaceStorage-Uwwg_fVB.js","./LocalWorkspaceStorage-DPzNT156.css","./FontBootstrap-BTg5UkMB.css","./Grid-D9-uNWgj.js","./Grid-DPUNpG8i.css","./StyleGuideRoot-DwJcMzan.css"])))=>i.map(i=>d[i]);
2
+ import{X as Qe,Y as et,Z as Rt,_ as It,r as m,J as s,a0 as oe,a1 as tt,V as q,a2 as ge,M as F,a3 as w,N as D,a4 as Ot,a5 as xe,a6 as Lt,a7 as kt,a8 as Pt,a9 as ie,aa as _t,I as At,ab as Mt,ac as Ut,ad as Kt,ae as $t,af as Wt,ag as le,ah as Gt}from"./vendor-DKP6ul09.js";import{_ as Bt,W as Vt}from"./monaco-C4VaWq8m.js";import{O as ne,P as B,T as L,I as P,D as _,a as G,b as Ht,u as nt,F as Zt,c as N,d as Yt,g as qt,e as st,f as zt,h as Jt,i as Xt,j as at,k as ot,l as rt,m as it,n as lt,o as Qt,p as Q,S as se,B as y,C as z,q as k,r as Ce,s as ct,K as en,t as Fe,v as tn,w as nn,x as sn,y as fe,z as an,A as on,E as rn,G as ln,H as V,J as cn,L as U,M as ae,N as dn,Q as un,R as hn,U as dt,V as mn,W as Ee,X as pn,Y as gn,Z as fn,_ as bn,$ as vn,a0 as yn,a1 as Sn,a2 as xn,a3 as ut,a4 as ht,a5 as x,a6 as Cn,a7 as Tn,a8 as wn,a9 as jn,aa as ee,ab as Re,ac as Dn,ad as Nn,ae as Fn,af as En,ag as Rn,ah as In,ai as On,aj as Ln,ak as kn,al as Pn,am as _n,an as An,ao as Mn,ap as Un,aq as Kn,ar as $n,as as Wn,at as Gn,au as Bn,av as Vn,aw as Hn}from"./ControlType-BVvvjMaF.js";import{L as K,v as H,a as Zn,M as Yn,b as qn,c as zn,d as Jn,e as be,f as Xn,g as Qn,s as es,l as ts,h as ns,i as ss,j as as,k as os,m as rs,n as is,o as ls,p as cs,q as ds,r as us,t as hs,u as ms,w as ps,x as gs,y as fs,z as bs,A as vs,B as Ie,C as Oe,D as Le,E as ys,F as Ss,G as xs,H as Cs,I as Ts,J as mt}from"./index-CBNByNSW.js";import{C as ws,H as js,T as Ds,B as Ns,m as Fs,a as Es,L as pt,s as ke,l as Rs,U as ce,g as Is,N as Os,A as Ls,b as ks,u as Ps,c as _s,d as As,e as Ms,f as Us,h as Ks,G as $s,i as Ws,j as Pe}from"./LocalWorkspaceStorage-Uwwg_fVB.js";import{T as de,P as Gs,I as gt,S as Bs,D as Vs}from"./IrisGridShortcuts-Bb60KPbS.js";import"./helpers-BosuxZz1.js";import"./useMergeRef-4fs_JZU-.js";function _e(a,e,t,n,o,r,i){try{var l=a[r](i),c=l.value}catch(d){return void t(d)}l.done?e(c):Promise.resolve(c).then(n,o)}function Hs(a){return function(){var e=this,t=arguments;return new Promise(function(n,o){var r=a.apply(e,t);function i(c){_e(r,n,o,i,l,"next",c)}function l(c){_e(r,n,o,i,l,"throw",c)}i(void 0)})}}var Zs=[["api"],["client"],["dashboardData","*","connection"],["dashboardData","*","sessionWrapper"],["layoutStorage"],["storage"]];function ft(a){var e=new Map;return function(n,o){var r,i=[...(r=e.get(this))!==null&&r!==void 0?r:[],n];if(o===Object(o)&&e.set(o,[...i]),i.shift(),!bt(i,a))return o instanceof Map?Array.from(o.entries()):o}}function bt(a,e){for(var t=function(i){if(a.length===e[i].length&&a.every((l,c)=>e[i][c]==="*"||l===e[i][c]))return{v:!0}},n=0;n<e.length;n+=1){var o=t(n);if(typeof o=="object")return o.v}return!1}function vt(a,e){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"root",n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:new Map([[a,"root"]]),o={};return Object.entries(a).forEach(r=>{var[i,l]=r;try{JSON.stringify(l,ft(e)),o[i]=l}catch{var c=l;if(typeof l=="bigint")o[i]=l.toString();else if(n.has(c))o[i]="Circular ref to ".concat(n.get(c));else{var d="".concat(t,".").concat(i);n.set(c,d);var u=d.split(".").slice(1);bt(u,e)||(o[i]=vt(l,e,d,n))}}}),o}function Ys(a){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];return JSON.stringify(vt(a,e),ft(e),2)}function qs(a){return JSON.stringify(a,null,2)}function zs(a){var e=a.getFullYear(),t=String(a.getMonth()+1).padStart(2,"0"),n=String(a.getDate()).padStart(2,"0"),o=String(a.getHours()).padStart(2,"0"),r=String(a.getMinutes()).padStart(2,"0"),i=String(a.getSeconds()).padStart(2,"0");return"".concat(e,"-").concat(t,"-").concat(n,"-").concat(o).concat(r).concat(i)}function Js(a,e,t){return ve.apply(this,arguments)}function ve(){return ve=Hs(function*(a,e,t){var n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:Zs,o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:"".concat(zs(new Date),"_support_logs"),r=new Qe,i=r.folder(o);i.file("console.txt",a.getFormattedHistory()),e!=null&&i.file("metadata.json",qs(e)),t!=null&&i.file("redux.json",Ys(t,n));var l=yield r.generateAsync({type:"blob"}),c=document.createElement("a");c.href=URL.createObjectURL(l),c.download="".concat(o,".zip"),c.click()}),ve.apply(this,arguments)}class Ae{static makeSortConfig(e,t){return{column:e,direction:t}}static makeFilterConfig(e){var t=[],n=[];return e.forEach((o,r)=>{t.push(o),r>0&&n.push(ne.and)}),{filterItems:t,filterOperators:n}}static combineFilterConfigs(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:ne.and;return{filterItems:[...e.filterItems,...t.filterItems],filterOperators:[...e.filterOperators,n,...t.filterOperators]}}static makeFilterItem(e,t,n){return{columnName:e,type:t,value:n}}}function Xs(a,e,t){if(a.length>e){var n=a.length-t;return{toKeep:a.slice(n),toPrune:a.slice(0,n)}}return{toKeep:a,toPrune:[]}}function Me(a,e){var t=Object.keys(a);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(a);e&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(a,o).enumerable})),t.push.apply(t,n)}return t}function Ue(a){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Me(Object(t),!0).forEach(function(n){R(a,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(t)):Me(Object(t)).forEach(function(n){Object.defineProperty(a,n,Object.getOwnPropertyDescriptor(t,n))})}return a}function Ke(a,e,t,n,o,r,i){try{var l=a[r](i),c=l.value}catch(d){return void t(d)}l.done?e(c):Promise.resolve(c).then(n,o)}function M(a){return function(){var e=this,t=arguments;return new Promise(function(n,o){var r=a.apply(e,t);function i(c){Ke(r,n,o,i,l,"next",c)}function l(c){Ke(r,n,o,i,l,"throw",c)}i(void 0)})}}function R(a,e,t){return(e=Qs(e))in a?Object.defineProperty(a,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):a[e]=t,a}function Qs(a){var e=ea(a,"string");return typeof e=="symbol"?e:e+""}function ea(a,e){if(typeof a!="object"||!a)return a;var t=a[Symbol.toPrimitive];if(t!==void 0){var n=t.call(a,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(a)}var ue=K.module("PouchStorageTable"),ta="Deephaven.";et.plugin(Rt);function na(a,e){switch(a){case L.in:case L.contains:return{$regex:new RegExp("".concat(e)).toString()};case L.inIgnoreCase:return{$regex:new RegExp("".concat(e),"i").toString()};case L.eq:return{$eq:e};case L.notEq:return{$ne:e};case L.greaterThan:return{$gt:e};case L.greaterThanOrEqualTo:return{$gte:e};case L.lessThan:return{$lt:e};case L.lessThanOrEqualTo:return{$lte:e};case L.startsWith:return{$regex:new RegExp("^".concat(e,".*")).toString()};default:throw new Error("Unsupported type: ".concat(a))}}function sa(a){for(var{filterItems:e,filterOperators:t}=a,n=null,o=0;o<e.length;o+=1){var r=e[o],{columnName:i,type:l,value:c}=r,d={[i]:na(l,c)};if(o===0)n=d;else if(n!==null&&o-1<t.length){var u=t[o-1];if(u===ne.and)n={$and:[n,d]};else if(u===ne.or)n={$or:[n,d]};else throw new Error("Unexpected filter operator ".concat(u,", ").concat(d))}}if(n==null)throw new Error("Invalid filter config ".concat(a));return n}function he(){var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];return{$and:[...a.map(e=>sa(e)),{name:{$gt:null}},{id:{$gt:null}}]}}function aa(a){var e,t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return[{id:t?"desc":"asc"},...(e=a?.map(n=>({[n.column]:n.direction})))!==null&&e!==void 0?e:[]]}class oa{constructor(e,t){R(this,"db",void 0),R(this,"changes",void 0),R(this,"listeners",[]),R(this,"itemListeners",new Map),R(this,"currentSize",0),R(this,"currentViewport",void 0),R(this,"currentReverse",!1),R(this,"currentFilter",null),R(this,"currentSort",null),R(this,"infoUpdatePromise",void 0),R(this,"viewportUpdatePromise",void 0),R(this,"currentViewportData",void 0),this.db=new et("".concat(ta).concat(e),t),this.db._remote=!1,this.listenForChanges(),this.db.createIndex({index:{fields:["id","name"]}}),this.refreshInfo()}listenForChanges(){this.changes=this.db.changes({live:!0,since:"now",include_docs:!0}).on("change",this.dbUpdate.bind(this))}onUpdate(e){return this.listeners=[...this.listeners,e],()=>{this.listeners=this.listeners.filter(t=>t!==e)}}onItemUpdate(e,t){return this.itemListeners.has(e)||this.itemListeners.set(e,[]),this.itemListeners.set(e,[...this.itemListeners.get(e),t]),this.refreshItem(e),()=>{this.itemListeners.set(e,this.itemListeners.get(e).filter(n=>n!==t))}}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}getViewportData(){var e=this;return M(function*(){var t;return e.viewportUpdatePromise||e.refreshData(),(t=e.viewportUpdatePromise)!==null&&t!==void 0?t:Promise.resolve({items:[],offset:0})})()}put(e){var t=this;return M(function*(){var n=Ue(Ue({},e),{},{_id:e.id});return yield t.db.put(n),n})()}sendUpdate(){for(var e,{listeners:t}=this,n=(e=this.currentViewportData)!==null&&e!==void 0?e:{items:[],offset:0},o=0;o<t.length;o+=1)t[o](n)}sendItemUpdate(e){var t=this.itemListeners.get(e.id);if(t!==void 0)for(var n=0;n<t.length;n+=1)t[n](e)}dbUpdate(e){ue.debug("Update received",e),this.refreshInfo(),e.doc!==void 0&&this.sendItemUpdate(e.doc),this.refreshData()}fetchInfo(e){var t=this;return M(function*(){return t.db.find({selector:e,fields:[]})})()}refreshInfo(){var e=this;return M(function*(){try{var t,n;(t=e.infoUpdatePromise)===null||t===void 0||t.cancel(),e.infoUpdatePromise=B.makeCancelable(e.fetchInfo(he((n=e.currentFilter)!==null&&n!==void 0?n:[])));var o=yield e.infoUpdatePromise;e.currentSize=o.docs.length,e.sendUpdate()}catch(r){if(!B.isCanceled(r))throw ue.error("Unable to refreshInfo",r),r}})()}fetchViewportData(e,t,n){var o=this;return M(function*(){return o.db.find({selector:t,skip:e.top,limit:e.bottom-e.top+1,sort:n,fields:["id","name"]}).then(r=>({items:r.docs,offset:e.top}))})()}refreshData(){var e=this;return M(function*(){if(e.currentViewport)try{var t,n,o=he((t=e.currentFilter)!==null&&t!==void 0?t:[]),r=aa(e.currentSort,e.currentReverse);(n=e.viewportUpdatePromise)===null||n===void 0||n.cancel(),e.viewportUpdatePromise=B.makeCancelable(e.fetchViewportData(e.currentViewport,o,r));var i=yield e.viewportUpdatePromise;return e.currentViewportData=i,e.sendUpdate(),i}catch(l){if(!B.isCanceled(l))throw ue.error("Unable to refreshData",l),l}})()}refreshItem(e){var t=this;return M(function*(){var n=yield t.db.find({selector:{id:e},limit:1}),o=n.docs[0];return o!==void 0&&t.sendItemUpdate(o),o})()}getSnapshot(e){var t=this;return M(function*(){var n=new Map,o=[{id:t.currentReverse?"desc":"asc"}];return yield Promise.all(e.map(function(){var r=M(function*(i){var l,[c,d]=i,u=d-c+1;return t.db.find({selector:he((l=t.currentFilter)!==null&&l!==void 0?l:[]),skip:c,limit:u,sort:o,fields:["id","name"]}).then(h=>{for(var f=0;f<u;f+=1){var C=c+f;n.set(C,h.docs[f])}})});return function(i){return r.apply(this,arguments)}}())),n})()}}function $e(a,e){var t=Object.keys(a);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(a);e&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(a,o).enumerable})),t.push.apply(t,n)}return t}function te(a){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?$e(Object(t),!0).forEach(function(n){yt(a,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(t)):$e(Object(t)).forEach(function(n){Object.defineProperty(a,n,Object.getOwnPropertyDescriptor(t,n))})}return a}function We(a,e,t,n,o,r,i){try{var l=a[r](i),c=l.value}catch(d){return void t(d)}l.done?e(c):Promise.resolve(c).then(n,o)}function J(a){return function(){var e=this,t=arguments;return new Promise(function(n,o){var r=a.apply(e,t);function i(c){We(r,n,o,i,l,"next",c)}function l(c){We(r,n,o,i,l,"throw",c)}i(void 0)})}}function yt(a,e,t){return(e=ra(e))in a?Object.defineProperty(a,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):a[e]=t,a}function ra(a){var e=ia(a,"string");return typeof e=="symbol"?e:e+""}function ia(a,e){if(typeof a!="object"||!a)return a;var t=a[Symbol.toPrimitive];if(t!==void 0){var n=t.call(a,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(a)}var la=2500,ca=2e3,O=K.module("PouchCommandHistoryTable");class Ge extends oa{constructor(e,t){var n;super("CommandHistoryStorage.".concat(e),{auto_compaction:!0,revs_limit:1}),yt(this,"searchText",void 0),this.cache=t,this.cache.tableRegistry.has(this.cacheKey)||this.cache.tableRegistry.set(this.cacheKey,new Set),O.debug("Adding table to registry",this.cacheKey),(n=this.cache.tableRegistry.get(this.cacheKey))===null||n===void 0||n.add(this)}get cacheKey(){return this.db.name}setSearch(e){O.debug("Setting search filters",e),this.searchText=e.trim().toLowerCase(),this.setFilters(e?[Ae.makeFilterConfig([Ae.makeFilterItem("name",L.contains,e)])]:[])}dbUpdate(e){O.debug("Clearing cache and refreshing data",e),this.cache.response.delete(this.cacheKey),super.dbUpdate(e)}fetchData(e){var t=this;return J(function*(){return B.withTimeout(0,J(function*(){t.cache.response.has(t.cacheKey)?O.debug("Fetching from cache",t.searchText,t.viewport):(O.debug("Fetching from PouchDB",t.searchText,t.viewport),t.cache.response.set(t.cacheKey,t.db.allDocs({include_docs:!0}).then(o=>{var r=o.rows.map(c=>c.doc).filter(c=>{var{name:d}=c;return d});O.debug("Fetched ".concat(r.length," command history items"));var{toKeep:i,toPrune:l}=Xs(r,la,ca);return l.length&&t.pruneItems(l),{docs:i}})));var n=t.cache.response.get(t.cacheKey);return t.searchText==null||t.searchText===""?n:te(te({},n),{},{docs:(yield n).docs.filter(o=>{var{name:r}=o;return r.toLowerCase().includes(t.searchText)})})}))})()}fetchInfo(e){var t=this;return J(function*(){return t.fetchData(e)})()}fetchViewportData(e,t,n){var o=this;return J(function*(){var r=yield o.fetchData(t);O.debug("Fetching viewport data",e.top,e.bottom+1,n,r);var i=typeof n[0]=="object"&&n[0].id==="desc",l=i?r.docs.slice(0).reverse():r.docs,c=l.slice(e.top,e.bottom+1);return{items:c,offset:e.top}})()}pruneItems(e){var t=this;return J(function*(){if(t.cache.isPruning.get(t.cacheKey)===!0){O.debug("Pruning already in progress. Skipping.");return}try{O.debug("Pruning ".concat(e.length," command history items"));var n=t.cache.pauseChangeListeners(t.cacheKey);t.cache.isPruning.set(t.cacheKey,!0),yield t.db.bulkDocs(e.map(o=>te(te({},o),{},{_deleted:!0}))),t.cache.isPruning.set(t.cacheKey,!1),n(),O.debug("Finished pruning command history items")}catch(o){O.error("An error occurred while pruning db",o)}})()}close(){var e,t,n;O.debug("Closing table",this,(e=this.cache.tableRegistry.get(this.cacheKey))===null||e===void 0?void 0:e.size),(t=this.cache.tableRegistry.get(this.cacheKey))===null||t===void 0||t.delete(this),(n=this.changes)===null||n===void 0||n.cancel(),super.close()}}function me(a,e,t){return(e=da(e))in a?Object.defineProperty(a,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):a[e]=t,a}function da(a){var e=ua(a,"string");return typeof e=="symbol"?e:e+""}function ua(a,e){if(typeof a!="object"||!a)return a;var t=a[Symbol.toPrimitive];if(t!==void 0){var n=t.call(a,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(a)}var Be=K.module("PouchCommandHistoryCache");class ha{constructor(){me(this,"isPruning",void 0),me(this,"response",void 0),me(this,"tableRegistry",void 0),this.isPruning=new Map,this.response=new Map,this.tableRegistry=new Map}pauseChangeListeners(e){var t,n=[];return(t=this.tableRegistry.get(e))===null||t===void 0||t.forEach(o=>{o.changes&&(Be.debug("Pausing event listeners on '".concat(e,"' table"),o),o.changes.cancel(),n.push(o))}),()=>{n.forEach(o=>{var r,i;(r=(i=this.tableRegistry.get(e))===null||i===void 0?void 0:i.has(o))!==null&&r!==void 0&&r&&(Be.debug("Resuming event listeners on '".concat(e,"' table"),o),o.listenForChanges())})}}}function Ve(a,e){var t=Object.keys(a);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(a);e&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(a,o).enumerable})),t.push.apply(t,n)}return t}function He(a){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Ve(Object(t),!0).forEach(function(n){ye(a,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(t)):Ve(Object(t)).forEach(function(n){Object.defineProperty(a,n,Object.getOwnPropertyDescriptor(t,n))})}return a}function Ze(a,e,t,n,o,r,i){try{var l=a[r](i),c=l.value}catch(d){return void t(d)}l.done?e(c):Promise.resolve(c).then(n,o)}function pe(a){return function(){var e=this,t=arguments;return new Promise(function(n,o){var r=a.apply(e,t);function i(c){Ze(r,n,o,i,l,"next",c)}function l(c){Ze(r,n,o,i,l,"throw",c)}i(void 0)})}}function ye(a,e,t){return(e=ma(e))in a?Object.defineProperty(a,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):a[e]=t,a}function ma(a){var e=pa(a,"string");return typeof e=="symbol"?e:e+""}function pa(a,e){if(typeof a!="object"||!a)return a;var t=a[Symbol.toPrimitive];if(t!==void 0){var n=t.call(a,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(a)}var Ye=K.module("PouchCommandHistoryStorage");class ga{constructor(){ye(this,"cache",new ha),ye(this,"updateTableMap",new Map)}getUpdateTable(e){return this.updateTableMap.has(e)||this.updateTableMap.set(e,new Ge(e,this.cache)),this.updateTableMap.get(e)}getTable(e){var t=this;return pe(function*(){return new Ge(e,t.cache)})()}addItem(e,t,n,o){var r=this;return pe(function*(){return r.updateItem(e,{id:"".concat(new Date().getTime()),name:n,data:o})})()}updateItem(e,t){var n=this;return pe(function*(){var o=n.getUpdateTable(e),r=yield o.refreshItem(t.id),i=He(He({},r??{}),t);return Ye.debug("Updating item",i),yield o.put(i),Ye.debug("Update saved"),t})()}listenItem(e,t,n){var o=this.getUpdateTable(e);return o.onItemUpdate(t,n)}}const St="SET_LAYOUT_STORAGE",fa=a=>({type:St,payload:a});var{dh:ba}=globalThis;const va=K.module("SettingsUtils");function ya(a){return a.formatString!=null}function xt(a){const e=It.parse(window.navigator.userAgent),t=`${e.browser.name??""} ${Number(parseFloat(e.browser.version??""))||""}`,n=`${e.os.name??""} ${e.os.version??""}`;return{"Engine Version":a.get("deephaven.version")??"Unknown","Web UI Version":"0.85.43","Java Version":a.get("java.version")??"Unknown","Barrage Version":a.get("barrage.version")??"Unknown","Browser Name":t.trim()||"Unknown","OS Name":n.trim()||"Unknown"}}function qe(a){return Array.from(a.entries()).filter(e=>e[1].version!==void 0).reduce((e,[t,n])=>({...e,[t]:n.version}),{})}function Se(a){const e=a?.querySelector("input, select, textarea");e&&e.focus()}function Ct(a,e){return a.defaultFormatString===e.defaultFormatString}function Sa(a,e){return Ct(a,e)}function xa(a,e){return Ct(a,e)}function Tt(a){return a!==""&&Ht.isValidColumnName(a)}function Z(a,e,t){if(!e||t.formatString==null||!ya(t))return!1;switch(e){case"datetime":return G.isValid(a,t);case"decimal":return _.isValid(a,t);case"int":return P.isValid(a,t);default:return va.warn("Trying to validate format of unknown type"),!0}}function Ca(a){const{id:e,isNewRule:t,...n}=a;return n}function Ta(a,e){return Tt(e.columnName)&&Z(a,e.columnType,e.format)}function wt(a){const{timestamp:e,timeZone:t,showTimeZone:n,showTSeparator:o,isGlobalOptions:r,legacyGlobalFormat:i}=a,l=nt(),c=m.useMemo(()=>new Zt(l,[],{timeZone:t,showTimeZone:n,showTSeparator:o}),[l,n,o,t]),d=r?G.getGlobalFormats(n,o):G.getFormats(n,o);return i!=null&&!d.includes(i)&&d.unshift(i),s.jsx(s.Fragment,{children:d.map(u=>{const h=G.makeFormat("",u,G.TYPE_GLOBAL);return s.jsx("option",{value:u,"data-testid":"time-format",children:c.getFormattedString(e,N.dataType.DATETIME,"",h)},u)})})}function wa(){return s.jsx(s.Fragment,{children:Yt.TIME_ZONES.map(a=>{const{label:e,value:t}=a;return s.jsx("option",{value:t,children:e},t)})})}const $=K.module("FormattingSectionContent");class Te extends m.PureComponent{static defaultProps={scrollTo:()=>{}};static inputDebounceTime=250;constructor(e){super(e),this.debouncedCommitChanges=tt(this.commitChanges.bind(this),Te.inputDebounceTime),this.queueUpdate=this.queueUpdate.bind(this),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),this.handleShowEmptyStringsChange=this.handleShowEmptyStringsChange.bind(this),this.handleShowNullStringsChange=this.handleShowNullStringsChange.bind(this);const{defaultDateTimeFormat:t,defaultDecimalFormatOptions:n,defaultIntegerFormatOptions:o,showTimeZone:r,showTSeparator:i,timeZone:l,truncateNumbersWithPound:c,showEmptyStrings:d,showNullStrings:u}=e;this.containerRef=q.createRef(),this.pendingUpdates=[],this.state={showTimeZone:r,showTSeparator:i,timeZone:l,defaultDateTimeFormat:t,defaultDecimalFormatOptions:n,defaultIntegerFormatOptions:o,truncateNumbersWithPound:c,showEmptyStrings:d,showNullStrings:u,timestampAtMenuOpen:new Date}}componentDidMount(){Se(this.containerRef.current)}componentWillUnmount(){this.debouncedCommitChanges.flush()}debouncedCommitChanges;pendingUpdates;containerRef;getCachedDateTimeFormatOptions=ge((e,t,n,o=!1,r)=>{const{timestampAtMenuOpen:i}=this.state;return s.jsx(wt,{timestamp:i,timeZone:e,showTimeZone:t,showTSeparator:n,isGlobalOptions:o,legacyGlobalFormat:r})});queueUpdate(e){this.pendingUpdates.push(e),this.debouncedCommitChanges()}handleDefaultDateTimeFormatChange(e){$.debug("handleDefaultDateTimeFormatChange",e);const t={defaultDateTimeFormat:e};this.setState(t),this.queueUpdate(t)}handleDefaultDecimalFormatChange(e){$.debug("handleDefaultDecimalFormatChange",e.target.value);const t={defaultDecimalFormatOptions:{defaultFormatString:e.target.value}};this.setState(t),Z(dh,N.dataType.DECIMAL,_.makeCustomFormat(e.target.value))&&this.queueUpdate(t)}handleDefaultIntegerFormatChange(e){$.debug("handleDefaultIntegerFormatChange",e.target.value);const t={defaultIntegerFormatOptions:{defaultFormatString:e.target.value}};this.setState(t),Z(dh,N.dataType.INT,P.makeCustomFormat(e.target.value))&&this.queueUpdate(t)}handleShowTimeZoneChange(){const{showTimeZone:e}=this.state,t={showTimeZone:!e};this.setState(t),this.queueUpdate(t)}handleShowTSeparatorChange(){const{showTSeparator:e}=this.state,t={showTSeparator:!e};this.setState(t),this.queueUpdate(t)}handleTimeZoneChange(e){const t={timeZone:e};this.setState(t),this.queueUpdate(t)}handleResetDateTimeFormat(){const{defaults:e}=this.props,{defaultDateTimeFormat:t,showTimeZone:n,showTSeparator:o}=e;$.debug("handleResetDateTimeFormat"),this.setState({defaultDateTimeFormat:t,showTimeZone:n,showTSeparator:o}),this.queueUpdate({defaultDateTimeFormat:void 0,showTimeZone:void 0,showTSeparator:void 0})}handleResetTimeZone(){const{defaults:e}=this.props,{timeZone:t}=e;$.debug("handleResetTimeZone"),this.setState({timeZone:t}),this.queueUpdate({timeZone:void 0})}handleResetDecimalFormat(){const{defaults:e}=this.props,{defaultDecimalFormatOptions:t}=e;$.debug("handleResetDecimalFormat"),this.setState({defaultDecimalFormatOptions:t}),this.queueUpdate({defaultDecimalFormatOptions:void 0})}handleResetIntegerFormat(){const{defaults:e}=this.props,{defaultIntegerFormatOptions:t}=e;$.debug("handleResetIntegerFormat"),this.setState({defaultIntegerFormatOptions:t}),this.queueUpdate({defaultIntegerFormatOptions:void 0})}handleTruncateNumbersWithPoundChange(){const{truncateNumbersWithPound:e}=this.state,t={truncateNumbersWithPound:e!==!0};this.setState(t),this.queueUpdate(t)}handleShowEmptyStringsChange(){const{showEmptyStrings:e}=this.state,t={showEmptyStrings:!e};this.setState(t),this.queueUpdate(t)}handleShowNullStringsChange(){const{showNullStrings:e}=this.state,t={showNullStrings:!e};this.setState(t),this.queueUpdate(t)}commitChanges(){const{updateSettings:e}=this.props,t=this.pendingUpdates.reduce((n,o)=>({...n,...o}),{});this.pendingUpdates=[],e(t)}render(){const{defaults:e,dh:t}=this.props,{defaultDateTimeFormat:n,defaultDecimalFormatOptions:o,defaultIntegerFormatOptions:r,timeZone:i,showTimeZone:l,showTSeparator:c,truncateNumbersWithPound:d,showEmptyStrings:u,showNullStrings:h}=this.state,{defaultFormatString:f=_.DEFAULT_FORMAT_STRING}=o??{},{defaultFormatString:C=P.DEFAULT_FORMAT_STRING}=r??{},p=i===e.timeZone,v=c===e.showTSeparator&&l===e.showTimeZone&&n===e.defaultDateTimeFormat,I=Sa(o,e.defaultDecimalFormatOptions),S=xa(r,e.defaultIntegerFormatOptions);return s.jsx("div",{className:"app-settings-formatting-section",ref:this.containerRef,children:s.jsxs("div",{className:"container-fluid p-0",children:[s.jsx("div",{className:"app-settings-menu-description mb-3",children:"Choose the default formatting rule to apply to all table columns based on their type."}),s.jsxs("div",{className:"form-row mb-2",children:[s.jsx("label",{className:"col-form-label col-3",htmlFor:"select-reset-timezone",children:"Time zone"}),s.jsx("div",{className:"col pr-0",children:s.jsx(se,{className:"custom-select",value:i,onChange:this.handleTimeZoneChange,id:"select-reset-timezone",children:s.jsx(wa,{})})}),s.jsx("div",{className:"col-1 btn-col",children:s.jsx(y,{kind:"ghost",icon:H,onClick:this.handleResetTimeZone,tooltip:"Reset Time Zone",className:F("btn-reset","btn-reset-time-zone",{hidden:p})})})]}),s.jsxs("div",{className:"form-row mb-2",children:[s.jsx("label",{className:"col-form-label col-3",htmlFor:"select-default-time-format",children:"DateTime"}),s.jsx("div",{className:"col pr-0",children:s.jsx(se,{className:"custom-select",value:n,onChange:this.handleDefaultDateTimeFormatChange,id:"select-default-time-format",children:this.getCachedDateTimeFormatOptions(i,l,c,!0,n)})}),s.jsx("div",{className:"col-1 btn-col",children:s.jsx(y,{kind:"ghost",icon:H,onClick:this.handleResetDateTimeFormat,tooltip:"Reset DateTime Options",className:F("btn-reset","btn-reset-date-time",{hidden:v})})})]}),s.jsx("div",{className:"form-row",children:s.jsx("div",{className:"offset-3 col-9",children:s.jsx(z,{checked:l??null,onChange:this.handleShowTimeZoneChange,children:"Show time zone in dates"})})}),s.jsx("div",{className:"form-row mb-3",children:s.jsx("div",{className:"offset-3 col-9",children:s.jsx(z,{checked:c??null,onChange:this.handleShowTSeparatorChange,children:"Show 'T' separator"})})}),s.jsxs("div",{className:"form-row mb-2",children:[s.jsx("label",{className:"col-form-label col-3",htmlFor:"default-decimal-format-input",children:"Decimal"}),s.jsx("div",{className:"col pr-0",children:s.jsx("input",{className:F("form-control","flex-grow-1","default-decimal-format-input",{"is-invalid":!Z(t,N.dataType.DECIMAL,_.makeCustomFormat(f))}),"data-lpignore":!0,placeholder:_.DEFAULT_FORMAT_STRING,type:"text",id:"default-decimal-format-input",value:f,onChange:this.handleDefaultDecimalFormatChange})}),s.jsx("div",{className:"col-1 btn-col",children:s.jsx(y,{kind:"ghost",icon:H,onClick:this.handleResetDecimalFormat,tooltip:"Reset Decimal Formatting",className:F("btn-reset","btn-reset-decimal",{hidden:I}),"data-testid":"btn-reset-decimal"})})]}),s.jsxs("div",{className:"form-row mb-2",children:[s.jsx("label",{className:"col-form-label col-3",htmlFor:"default-integer-format-input",children:"Integer"}),s.jsx("div",{className:"col pr-0",children:s.jsx("input",{className:F("form-control","flex-grow-1","default-integer-format-input",{"is-invalid":!Z(t,N.dataType.INT,P.makeCustomFormat(C))}),"data-lpignore":!0,placeholder:P.DEFAULT_FORMAT_STRING,type:"text",id:"default-integer-format-input",value:C,onChange:this.handleDefaultIntegerFormatChange})}),s.jsx("div",{className:"col-1 btn-col",children:s.jsx(y,{kind:"ghost",icon:H,onClick:this.handleResetIntegerFormat,tooltip:"Reset Integer Formatting",className:F("btn-reset","btn-reset-integer",{hidden:S}),"data-testid":"btn-reset-integer"})})]}),s.jsx("div",{className:"form-row mb-2",children:s.jsx("div",{className:"offset-3 col-9",children:s.jsx(z,{checked:d??null,onChange:this.handleTruncateNumbersWithPoundChange,children:"Show truncated numbers as ###"})})}),s.jsxs("div",{className:"form-row mb-3",children:[s.jsx("label",{className:"col-form-label col-3",htmlFor:"default-integer-format-input",children:"String"}),s.jsxs("div",{className:"col pr-0 pt-2",children:[s.jsxs(z,{checked:u??null,onChange:this.handleShowEmptyStringsChange,children:["Show empty strings as"," ",s.jsx("span",{className:"font-italic text-muted",children:"empty"})]}),s.jsxs(z,{checked:h??null,onChange:this.handleShowNullStringsChange,children:["Show null strings as"," ",s.jsx("span",{className:"font-italic text-muted",children:"null"})]})]})]})]})})}}const ja=a=>({defaultDateTimeFormat:Qt(a),defaultDecimalFormatOptions:lt(a),defaultIntegerFormatOptions:it(a),dh:rt(a),showTimeZone:ot(a),showTSeparator:at(a),truncateNumbersWithPound:Xt(a),showEmptyStrings:Jt(a),showNullStrings:zt(a),timeZone:st(a),defaults:qt(a)}),Da=oe(ja,{updateSettings:Q})(Te);function Na(){const[a,e]=m.useState(!1),t=()=>{e(!a)};return s.jsxs(s.Fragment,{children:[s.jsx(y,{kind:"ghost",onClick:t,icon:Zn,children:"Legal Notices"}),s.jsxs(Yn,{isOpen:a,toggle:t,children:[s.jsx(qn,{toggle:t,children:"Legal Notice"}),s.jsxs(zn,{children:[s.jsx("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,494; 9,836,495; 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,346,394; 10,353,893; 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; 10,783,191; 10,866,943; 10,909,183; 10,915,526; 10,922,311; 10,929,394; 11,023,462; 11,126,662; 11,151,133; 11,238,036; 11,249,994; 11,263,211; 11,449,557; 11,514,037; 11,556,528; and 11,574,018. Other patents pending."}),s.jsxs("p",{children:["© 2016-",new Date().getFullYear()," Deephaven Data Labs LLC. Patent Pending."]})]})]})]})}function W(a){const{children:e,isExpanded:t,sectionKey:n,title:o,onToggle:r}=a;return s.jsxs(s.Fragment,{children:[s.jsx("div",{children:s.jsxs(y,{kind:"ghost",className:"btn-collapse-trigger",onClick:()=>r(n),children:[s.jsx("div",{className:"flex-grow-1",children:o}),s.jsx("div",{className:"flex-shrink-0",children:s.jsx(D,{transform:t?"flip-v":"",icon:Jn})})]})}),s.jsx(ws,{in:t,autoFocusOnShow:!0,children:e})]})}W.propTypes={children:w.node,isExpanded:w.bool.isRequired,sectionKey:w.string.isRequired,title:w.node.isRequired,onToggle:w.func};W.defaultProps={children:null,onToggle:()=>{}};function Fa({shortcut:a,displayText:e,categoryName:t,onChange:n}){const[o,r]=m.useState(e),[i,l]=m.useState(a.getKeyState()),[c,d]=m.useState(!1),[u,h]=m.useState("");m.useEffect(function(){r(e),l(a.getKeyState())},[e,a]),m.useEffect(function(){r(k.getDisplayText(i)),a.matchesKeyState(i)&&d(!1)},[i,a]),m.useEffect(function(){if(c){if(!k.isValidKeyState(i)){k.isAllowedKey(i.keyValue)?h("Must contain a modifier key"):h("Must contain an allowed action key");return}const g=Ce.getConflictingShortcuts(i).filter(b=>b.id.startsWith(t)&&b!==a).map(b=>b.name);if(g.length){h(`Conflicts with ${g.join(", ")}`);return}h("")}else h("")},[c,i,t,a]);function f(T){if(T.stopPropagation(),T.preventDefault(),a.isEditable&&!T.repeat){const g=k.getKeyStateFromEvent(T),b=k.createKeyState([en.BACKSPACE]);k.doKeyStatesMatch(g,b)?l(k.NULL_KEY_STATE):l(g)}}function C(T){T.stopPropagation(),T.preventDefault(),a.matchesKeyState(i)||d(!0)}function p(){Fe.disableAllActions()}function v(){Fe.enableAllActions()}function I(){a.setKeyState(i),d(!1),n(a)}function S(){const T=a.getKeyState();l(T),d(!1)}function A(){d(!0),l(a.getDefaultKeyState())}return s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"shortcut-item-container",children:[s.jsxs("label",{className:"shortcut-item-name",children:[a.name,a.tooltip!==void 0&&s.jsx(ct,{children:a.tooltip})]}),s.jsxs("div",{className:"shortcut-item-input-container",children:[s.jsx("input",{className:F("form-control",{"is-invalid":u}),onKeyDown:f,onKeyUp:C,onFocus:p,onBlur:v,disabled:!a.isEditable,value:o,readOnly:!0}),!k.doKeyStatesMatch(i,a.getDefaultKeyState())&&!u&&s.jsx(y,{className:"reset-to-default-button",kind:"ghost",icon:s.jsx(D,{icon:H,transform:{rotate:90,flipX:!0}}),tooltip:"Reset to default",onClick:A})]})]}),c&&s.jsxs("div",{className:F("shortcut-item-message-container",{"is-invalid":u}),children:[s.jsx("div",{className:"shortcut-item-message",children:u}),s.jsxs("div",{className:"shortcut-item-message-buttons",children:[k.isValidKeyState(i)&&s.jsx(y,{kind:"ghost",onClick:I,children:"Confirm"}),s.jsx(y,{kind:"ghost",onClick:S,children:"Undo"})]})]})]})}function Ea({shortcutOverrides:a={},updateSettings:e}){const t=m.useCallback(i=>{const l=k.isMacPlatform,c={mac:{...a.mac},windows:{...a.windows}},d=l?c.mac:c.windows;i.forEach(u=>{u.isDefault()?delete d[u.id]:d[u.id]=u.getKeyState()}),e({shortcutOverrides:c})},[e,a]);let n=Array.from(Ce.shortcutsByCategory.entries()).map(([i,l])=>({name:i,shortcuts:l}));const o=n.findIndex(i=>i.name.toUpperCase()==="GLOBAL"),r=n.splice(o,1);return n=n.concat(r),s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"app-settings-menu-description",children:"Customize shortcuts below. To prevent unexpected results, avoid conflicting shortcuts with the browser or IDE editor."}),n.map(i=>s.jsx(Ra,{name:i.name,shortcuts:i.shortcuts,saveShortcutOverrides:t},i.name))]})}function Ra({name:a,shortcuts:e,saveShortcutOverrides:t}){function n(c){return c.split("_").map(d=>`${d[0].toUpperCase()}${d.slice(1).toLowerCase()}`).join(" ")}const[o,r]=m.useState(e);function i(c){const d=o.filter(h=>h!==c&&!h.isNull()&&h.matchesKeyState(c.getKeyState()));d.forEach(h=>h.setToNull());const u=[c,...d];t(u),r(h=>[...h])}const l=m.useMemo(()=>o.map(c=>c.getDisplayText()),[o]);return s.jsxs("div",{className:"mt-3",children:[s.jsx("div",{className:"font-weight-bold",children:n(a)}),o.map((c,d)=>s.jsx(Fa,{shortcut:c,displayText:l[d],categoryName:a,onChange:i},c.id))]})}const Ia=a=>({shortcutOverrides:tn(a)}),Oa={updateSettings:Q},La=oe(Ia,Oa)(Ea),ka=[{value:N.dataType.DATETIME,label:"DateTime"},{value:N.dataType.DECIMAL,label:"Decimal"},{value:N.dataType.INT,label:"Integer"}];function Pa(){const a=ka.map(e=>s.jsx("option",{value:e.value,children:e.label},`key-columnType-${e.value}`));return s.jsxs(s.Fragment,{children:[s.jsx("option",{disabled:!0,value:"",children:"Select Type"},"key-columnType-placeholder"),a]})}class we extends m.PureComponent{static defaultProps={scrollTo:()=>{}};static inputDebounceTime=250;constructor(e){super(e),this.debouncedCommitChanges=tt(this.commitChanges.bind(this),we.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:t,showTimeZone:n,showTSeparator:o,timeZone:r}=e,i=t.map((l,c)=>({...l,id:c}));this.containerRef=q.createRef(),this.addFormatRuleButtonRef=q.createRef(),this.lastFormatRuleIndex=i.length,this.state={formatSettings:i,formatRulesChanged:!1,showTimeZone:n,showTSeparator:o,timeZone:r,timestampAtMenuOpen:new Date}}componentDidMount(){Se(this.containerRef.current)}componentWillUnmount(){this.debouncedCommitChanges.flush()}debouncedCommitChanges;containerRef;addFormatRuleButtonRef;lastFormatRuleIndex;isDuplicateRule(e){const{formatSettings:t}=this.state;return t.some(n=>n.id!==e.id&&n.columnName===e.columnName&&n.columnType===e.columnType)??!1}getAutoIncrementFormatRuleIndex(){const{lastFormatRuleIndex:e}=this;return this.lastFormatRuleIndex+=1,e}getCachedColumnTypeOptions=ge(()=>s.jsx(Pa,{}));getCachedDateTimeFormatOptions=ge((e,t,n,o=!1,r)=>{const{timestampAtMenuOpen:i}=this.state;return s.jsx(wt,{timestamp:i,timeZone:e,showTimeZone:t,showTSeparator:n,isGlobalOptions:o,legacyGlobalFormat:r})});handleFormatRuleChange(e,t,n){this.setState(o=>{const{formatSettings:r}=o;be(r);const i=[...r];let l={};t==="columnType"&&(l={format:this.makeDefaultFormatterItemByType(n)});const c={...i[e],...l,[t]:n};return i[e]=c,{formatSettings:i}},()=>{this.debouncedCommitChanges()})}handleFormatRuleCreate(){this.setState(e=>{const{formatSettings:t}=e,n={columnType:N.dataType.DATETIME,columnName:"",format:{},id:this.getAutoIncrementFormatRuleIndex(),isNewRule:!0};return{formatSettings:[...t,n],formatRulesChanged:!0}})}handleFormatRuleDelete(e){this.setState(t=>{const{formatSettings:n}=t;return{formatSettings:n.filter((r,i)=>i!==e),formatRulesChanged:!0}},()=>{this.debouncedCommitChanges()})}handleFormatRuleEntered(e){this.scrollToFormatBlockBottom(),Se(e)}commitChanges(){const{formatSettings:e}=this.state,{dh:t}=this.props,n=e.filter(i=>Ta(t,i)).map(Ca)??[],{updateSettings:o}=this.props;o({formatter:n})}scrollToFormatBlockBottom(){const{scrollTo:e}=this.props;e(0,(this.addFormatRuleButtonRef.current?.offsetHeight??0)+(this.addFormatRuleButtonRef.current?.offsetTop??0))}getRuleError(e){const{dh:t}=this.props,n={hasColumnNameError:!1,hasFormatError:!1,message:""},o=[];return e.isNewRule!==void 0&&e.isNewRule||(this.isDuplicateRule(e)&&(n.hasColumnNameError=!0,o.push("Duplicate column name/type combo.")),Tt(e.columnName)||(n.hasColumnNameError=!0,o.push("Column names must start with a letter or underscore and contain only alphanumeric characters or underscores.")),e.format.formatString!=null&&e.format.formatString.length===0?(n.hasFormatError=!0,o.push("Empty formatting rule.")):Z(t,e.columnType,e.format)||(n.hasFormatError=!0,o.push("Invalid formatting rule.")),n.message=o.join(`
3
+ `)),n}makeDefaultFormatterItemByType(e){switch(N.getNormalizedType(e)){case N.dataType.INT:{const{defaultIntegerFormatOptions:t}=this.props,{defaultFormatString:n}=t;return P.makeFormat("",n??P.DEFAULT_FORMAT_STRING,P.TYPE_GLOBAL,void 0)}case N.dataType.DECIMAL:{const{defaultDecimalFormatOptions:t}=this.props,{defaultFormatString:n}=t;return _.makeFormat("",n??_.DEFAULT_FORMAT_STRING,_.TYPE_GLOBAL,void 0)}default:return""}}renderFormatRule(e,t){const n=`input-${e}-columnName`,o=`input-${e}-columnType`,r=`input-${e}-format`,i=this.getCachedColumnTypeOptions(),l=h=>this.handleFormatRuleChange(e,"columnName",h.target.value),c=()=>this.handleFormatRuleChange(e,"isNewRule",!1),d=h=>this.handleFormatRuleChange(e,"columnType",h),u=this.getRuleError(t);return s.jsxs("fieldset",{className:"container-fluid format-rule-container",children:[s.jsxs("div",{className:"form-row",children:[s.jsxs("div",{className:"form-group col-7 mb-2",children:[s.jsx("label",{htmlFor:n,children:"Column Name"}),s.jsx("input",{id:n,className:F("form-control",{"is-invalid":u.hasColumnNameError}),"data-lpignore":!0,type:"text",value:t.columnName,onChange:l,onBlur:c})]}),s.jsxs("div",{className:"form-group col mb-2",children:[s.jsx(y,{kind:"ghost",className:"btn-delete-format-rule float-right",tabIndex:-1,onClick:()=>this.handleFormatRuleDelete(e),icon:Xn,tooltip:"Delete","aria-label":"Delete Format Rule"}),s.jsx("label",{htmlFor:o,children:"Column Type"}),s.jsx(se,{id:o,className:"custom-select",value:t.columnType,onChange:d,children:i})]})]}),s.jsx("div",{className:"form-row",children:s.jsxs("div",{className:"form-group col-12 d-flex mb-2",children:[s.jsx("label",{className:"flex-shrink-0 col-form-label mr-3",htmlFor:r,children:"Formatting Rule"}),this.renderFormatRuleInput(e,t.columnType,r,t.format,u.hasFormatError)]})}),s.jsx("div",{className:"form-row",children:s.jsx("div",{className:"form-group col-12 d-flex mb-2",children:u.message&&s.jsx("p",{className:"text-danger",children:u.message})})})]},e)}renderFormatRuleInput(e,t,n,o,r){switch(N.getNormalizedType(t)){case N.dataType.DATETIME:return this.renderDateTimeFormatRuleInput(e,n,o,r);case N.dataType.DECIMAL:return this.renderDecimalFormatRuleInput(e,n,o,r);case N.dataType.INT:return this.renderIntegerFormatRuleInput(e,n,o,r);default:throw new Error(`Unrecognized column type: ${t}`)}}renderDateTimeFormatRuleInput(e,t,n,o){const{showTimeZone:r,showTSeparator:i,timeZone:l}=this.state,c=n.formatString??"";return s.jsxs(se,{className:F("custom-select",{"is-invalid":o}),value:c,id:t,onChange:d=>{const u=G.makeFormat("",d,G.TYPE_GLOBAL);this.handleFormatRuleChange(e,"format",u)},children:[s.jsx("option",{value:"",disabled:!0,children:"Select format"},"default"),this.getCachedDateTimeFormatOptions(l,r,i)]})}renderIntegerFormatRuleInput(e,t,n,o){const{defaultIntegerFormatOptions:r}=this.props;be(r);const{defaultFormatString:i}=r,l=n.formatString??"";return s.jsx("input",{className:F("form-control","flex-grow-1",{"is-invalid":o}),"data-lpignore":!0,id:t,placeholder:i??P.DEFAULT_FORMAT_STRING,type:"text",value:l,onChange:c=>{const d=P.makeFormat("",c.target.value,P.TYPE_GLOBAL,void 0);this.handleFormatRuleChange(e,"format",d)}})}renderDecimalFormatRuleInput(e,t,n,o){const{defaultDecimalFormatOptions:r}=this.props,{defaultFormatString:i}=r,l=n.formatString??"";return s.jsx("input",{className:F("form-control","flex-grow-1",{"is-invalid":o}),"data-lpignore":!0,id:t,placeholder:i??_.DEFAULT_FORMAT_STRING,type:"text",value:l,onChange:c=>{const d=_.makeFormat("",c.target.value,_.TYPE_GLOBAL,void 0);this.handleFormatRuleChange(e,"format",d)}})}render(){const{formatRulesChanged:e,formatSettings:t}=this.state,n=t.map((r,i)=>s.jsx(sn,{onEnter:this.handleFormatRuleEntered,children:this.renderFormatRule(i,r)},r.id)),o=s.jsx(y,{kind:"ghost",className:"mb-3",onClick:this.handleFormatRuleCreate,ref:this.addFormatRuleButtonRef,icon:Qn,children:"Add New Rule"});return s.jsxs("div",{className:"app-settings-formatting-section",ref:this.containerRef,children:[s.jsx("div",{className:"app-settings-menu-description mb-3",children:"Customize the formatting of table columns by applying rules based on matching both a column name and column type."}),s.jsx(Ot,{appear:e,enter:e,exit:e,children:n}),o]})}}const _a=a=>({formatter:nn(a),defaultDecimalFormatOptions:lt(a),defaultIntegerFormatOptions:it(a),dh:rt(a),showTimeZone:ot(a),showTSeparator:at(a),timeZone:st(a)}),Aa=oe(_a,{updateSettings:Q})(we);function Ma(){const a=xe(),e=fe(an),t=fe(on),n=m.useCallback(r=>{a(Q({webgl:r}))},[a]),o=t?s.jsx(de,{children:"WebGL in most cases has significant performance improvements, particularly when plotting large datasets. However, in some environments (such as remote desktop environments), WebGL may not use hardware acceleration and have degraded performance. If you are experiencing issues with WebGL, you can disable it here."}):s.jsx(de,{children:"WebGL is disabled by your system administrator. Contact your system administrator to enable."});return s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"app-settings-menu-description",children:"Advanced settings here. Be careful!"}),s.jsxs("div",{className:"form-row mb-3 pl-1",children:[s.jsx(Lt,{isSelected:e,isDisabled:!t,onChange:n,marginEnd:"size-0",children:"Enable WebGL"}),s.jsxs(kt,{variant:"info",marginTop:"size-50",children:[s.jsx(js,{children:"Enable WebGL"}),s.jsx(Pt,{children:s.jsx(de,{children:o})})]})]})]})}function Ua(){const a=rn(),e=fe(ln),t=xe(),n=m.useCallback(r=>{if(r!=="regular"&&r!=="compact"&&r!=="spacious")throw new Error(`Invalid grid density value: ${r}`);t(Q({gridDensity:r}))},[t]),o=e.gridDensity;return be(a,"ThemeContext value is null"),s.jsxs(s.Fragment,{children:[s.jsx(Ds,{}),s.jsxs(Gs,{label:"Default table density",selectedKey:o,onChange:n,children:[s.jsx(ie,{children:"Regular"},"regular"),s.jsx(ie,{children:"Compact"},"compact"),s.jsx(ie,{children:"Spacious"},"spacious")]})]})}class E extends m.Component{static defaultProps={onDone:()=>{}};static FORMATTING_SECTION_KEY="SettingsMenu.formatting";static COLUMN_SPECIFIC_SECTION_KEY="SettingsMenu.columnFormatting";static APPLICATION_SECTION_KEY="ApplicationMenu.settings";static SHORTCUT_SECTION_KEY="SettingsMenu.shortcuts";static THEME_SECTION_KEY="SettingsMenu.theme";static ADVANCED_SECTION_KEY="SettingsMenu.advanced";static focusFirstInputInContainer(e){const t=e?.querySelector("input, select, textarea");t&&t.focus()}constructor(e){super(e),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.handleLogout=this.handleLogout.bind(this),this.menuContentRef=q.createRef(),this.broadcastChannel=new BroadcastChannel(Ns),this.state={expandedSectionKey:E.FORMATTING_SECTION_KEY}}componentDidMount(){E.focusFirstInputInContainer(this.menuContentRef.current)}componentWillUnmount(){this.broadcastChannel.close()}menuContentRef;broadcastChannel;isSectionExpanded(e){const{expandedSectionKey:t}=this.state;return t===e}handleLogout(){this.broadcastChannel.postMessage(Fs(Es))}handleScrollTo(e,t){this.menuContentRef.current?.scrollTo(e,t)}handleSectionToggle(e){this.setState(t=>({expandedSectionKey:t.expandedSectionKey===e?void 0:e}))}handleClose(){const{onDone:e}=this.props;e()}handleExportSupportLogs(){const{serverConfigValues:e,pluginData:t}=this.props,n=qe(t);Js(ts,{uiVersion:"0.85.43",userAgent:navigator.userAgent,...Object.fromEntries(e),pluginInfo:n},es.getState())}render(){const e="https://github.com/deephaven/web-client-ui/",t="https://deephaven.io/core/docs/",{serverConfigValues:n,pluginData:o,user:r}=this.props,i=xt(n),l=qe(o),c=n.get("deephaven.version"),d=V.COPY_VERSION_INFO.getDisplayText(),u=(p,v)=>s.jsxs(m.Fragment,{children:[s.jsx("div",{children:p}),s.jsx("div",{children:v})]},p),h=r.displayName??r.name,f=r.image!=null&&r.image!=="",C=h!=="";return s.jsxs("div",{className:"app-settings-menu",children:[s.jsxs("header",{className:"app-settings-menu-header",children:[s.jsxs("div",{className:"user-info",children:[s.jsxs("div",{className:"user-image",children:[!f&&s.jsx(D,{icon:ns,transform:"grow-8"}),f&&s.jsx("img",{src:r.image,alt:h})]}),s.jsxs("div",{className:"user-details",children:[C&&s.jsxs("div",{className:"user-name",children:[h,r.operateAs!=null&&r.name!==r.operateAs&&s.jsxs(s.Fragment,{children:[s.jsxs("span",{className:"font-weight-light font-italic",children:[" ","as"," "]}),s.jsxs("span",{className:"operating-as-user",children:[s.jsx(D,{icon:ss,className:"mr-1"}),r.operateAs]})]})]}),r.permissions.canLogout&&s.jsx("button",{type:"button",className:"btn btn-link",onClick:this.handleLogout,children:"logout"})]})]}),s.jsx(y,{kind:"ghost",className:"btn-close-settings-menu",onClick:this.handleClose,icon:s.jsx(D,{icon:as,transform:"grow-4"}),tooltip:"Close"})]}),s.jsxs("div",{className:"app-settings-menu-content",ref:this.menuContentRef,children:[s.jsx("h5",{children:"Settings"}),s.jsx("hr",{className:"my-0"}),s.jsx(W,{sectionKey:E.FORMATTING_SECTION_KEY,isExpanded:this.isSectionExpanded(E.FORMATTING_SECTION_KEY),title:s.jsxs(s.Fragment,{children:[s.jsx(D,{icon:os,transform:"grow-4",className:"mr-2"}),"Default Format & Time zone"]}),onToggle:this.handleSectionToggle,children:s.jsx(Da,{})}),s.jsx(W,{sectionKey:E.COLUMN_SPECIFIC_SECTION_KEY,isExpanded:this.isSectionExpanded(E.COLUMN_SPECIFIC_SECTION_KEY),title:s.jsxs(s.Fragment,{children:[s.jsx(D,{icon:rs,transform:"grow-4",className:"mr-2"}),"Format by Column Name & Type"]}),onToggle:this.handleSectionToggle,children:s.jsx(Aa,{scrollTo:this.handleScrollTo})}),s.jsx(W,{sectionKey:E.THEME_SECTION_KEY,isExpanded:this.isSectionExpanded(E.THEME_SECTION_KEY),onToggle:this.handleSectionToggle,title:s.jsxs(s.Fragment,{children:[s.jsx(D,{icon:is,transform:"grow-4",className:"mr-2"}),"Theme"]}),children:s.jsx(Ua,{})}),s.jsx(W,{sectionKey:E.SHORTCUT_SECTION_KEY,isExpanded:this.isSectionExpanded(E.SHORTCUT_SECTION_KEY),title:s.jsxs(s.Fragment,{children:[s.jsx(D,{icon:ls,transform:"grow-2",className:"mr-2"}),"Keyboard Shortcuts"]}),onToggle:this.handleSectionToggle,children:s.jsx(La,{})}),s.jsx(W,{sectionKey:E.ADVANCED_SECTION_KEY,isExpanded:this.isSectionExpanded(E.ADVANCED_SECTION_KEY),title:s.jsxs(s.Fragment,{children:[s.jsx(D,{icon:cs,transform:"grow-4",className:"mr-2"}),"Advanced"]}),onToggle:this.handleSectionToggle,children:s.jsx(Ma,{})}),s.jsxs("div",{className:"app-settings-footer",children:[s.jsxs("div",{className:"app-settings-footer-section",children:[s.jsxs("div",{className:"app-settings-footer-item",children:[s.jsx("div",{className:"font-weight-bold",children:"Support"}),s.jsxs("div",{children:["GitHub: ",s.jsx("a",{href:e,className:"custom-link",target:"_blank",rel:"noopener noreferrer",children:e})]}),s.jsx(y,{kind:"tertiary",className:"mt-2 py-2",onClick:this.handleExportSupportLogs,children:"Export Logs"})]}),s.jsxs("div",{className:"app-settings-footer-item",children:[s.jsx("div",{className:"font-weight-bold",children:"Documentation"}),s.jsx("a",{target:"_blank",rel:"noreferrer noopener",href:t,className:"custom-link",children:t})]}),s.jsxs("div",{className:"app-settings-footer-item",children:[s.jsx("div",{className:"font-weight-bold",children:"Version"}),s.jsxs("span",{className:"d-inline-block text-muted",children:[c," ",s.jsx(D,{icon:ds}),s.jsxs(ct,{interactive:!0,children:[s.jsx("div",{className:"detailed-server-config",children:Object.entries(i).map(([p,v])=>u(p,v))}),s.jsxs(cn,{kind:"inline",tooltip:"Copy version numbers",copy:Object.entries({...i,...l}).map(([p,v])=>`${p}: ${v}`).join(`
4
4
  `),children:["Copy Versions",s.jsxs("small",{className:"text-muted",children:["(",d,")"]})]})]})]})]}),s.jsxs("div",{className:"app-settings-footer-item",children:[s.jsx("div",{className:"font-weight-bold",children:"Plugins"}),s.jsx("div",{className:"container",children:Array.from(o.entries()).filter(p=>p[1].version!==void 0).map(([p,v])=>s.jsxs("div",{className:"row justify-content-start align-items-center",children:[s.jsx("div",{className:"col pl-0",children:s.jsx("span",{className:"my-0 text-truncate",children:p})}),s.jsx("div",{className:"col-auto",children:s.jsx("span",{children:v?.version})})]},p))})]}),s.jsx("div",{className:"app-settings-footer-item",children:s.jsx(Na,{})})]}),s.jsx("div",{className:"app-settings-footer-section",children:s.jsx("a",{target:"_blank",rel:"noreferrer noopener",href:"https://deephaven.io",style:{display:"block",width:"61.8%"},children:s.jsx(pt,{})})})]})]})]})}}const ze=10;function Y(a){const{forwardedProps:{menuItem:{action:e,title:t,disabled:n},iconElement:o,displayShortcut:r,isMouseSelected:i,isKeyboardSelected:l,closeMenu:c}}=a,d=m.useRef(),u=m.useRef(),h=m.useRef(null),[f,C]=m.useState(!1),p=m.useCallback(S=>{d.current!=null&&u.current!=null&&h.current&&(Math.abs(d.current-S.clientX)>=ze||Math.abs(u.current-S.clientY)>=ze)&&(C(!0),window.removeEventListener("mousemove",p),c(),e(S),h.current=null)},[e,c]);function v(S){d.current=S.clientX,u.current=S.clientY,h.current=S.target,window.addEventListener("mousemove",p)}function I(S){h.current===S.target&&(C(!0),c(),e(),window.removeEventListener("mousemove",p)),h.current=null}return m.useEffect(function(){return function(){return window.removeEventListener("mousemove",p)}},[p]),s.jsxs("button",{type:"button",className:F("btn-context-menu",{disabled:n},{active:i&&!n},{"keyboard-active":l&&!n}),onMouseDown:v,onMouseUp:I,disabled:f,children:[s.jsx("span",{className:F("icon"),children:o}),s.jsx("span",{className:"title",children:t}),s.jsx("span",{className:"shortcut",children:r})]})}function je(a){const{handleControlSelect:e,handleToolSelect:t,onClearFilter:n}=a,o=m.useMemo(()=>[{title:"Input Filter",icon:us,menuElement:s.jsx(Y,{}),action:r=>{e(U.INPUT_FILTER,r)},order:10},{title:"Dropdown Filter",icon:hs,menuElement:s.jsx(Y,{}),action:r=>{e(U.DROPDOWN_FILTER,r)},order:15},{title:"Markdown Widget",icon:ms,menuElement:s.jsx(Y,{}),action:r=>{e(U.MARKDOWN,r)},order:20},{title:"Filter Sets",icon:ps,menuElement:s.jsx(Y,{}),action:r=>{e(U.FILTER_SET_MANAGER,r)},order:25},{disabled:!0,menuElement:s.jsx("div",{className:"context-menu-group-header",children:"Tools"}),order:30},{title:"Linker",icon:gs,action:()=>{t(ae.LINKER)},order:40,shortcut:V.LINKER},{disabled:!0,menuElement:s.jsx("div",{className:"context-menu-group-header",children:"Actions"}),order:50},{title:"Clear All Filters",icon:fs,action:()=>{n()},order:60,shortcut:gt.TABLE.CLEAR_ALL_FILTERS}],[e,t,n]);return s.jsx(dn,{popperClassName:"controls-menu-popper",actions:o})}je.propTypes={handleControlSelect:w.func,handleToolSelect:w.func,onClearFilter:w.func};je.defaultProps={handleControlSelect:()=>{},handleToolSelect:()=>{},onClearFilter:()=>{}};Y.propTypes={forwardedProps:w.shape({iconElement:w.node,displayShortcut:w.string,isMouseSelected:w.bool.isRequired,isKeyboardSelected:w.bool.isRequired,closeMenu:w.func.isRequired,menuItem:w.shape({action:w.func,title:w.string,disabled:w.bool}).isRequired})};Y.defaultProps={forwardedProps:null};const Ka=bs(St,null),$a={layoutStorage:Ka},Wa=a=>a.layoutStorage,Ga=a=>a.serverConfigValues;Object.entries($a).map(([a,e])=>vs.register(a,e));const Je=10;function Ba(a){const{onExportLayout:e,onImportLayout:t,onResetLayout:n,onSelect:o,widgets:r=[]}=a,[i,l]=m.useState(!1),[c,d]=m.useState(""),u=m.useRef(null),h=m.useRef(),f=m.useCallback((g,b)=>{g!=null&&o(g,b)},[o]),C=m.useCallback(g=>{d(g.target.value)},[]),p=m.useCallback(g=>{h.current!=null&&(Math.abs(h.current.x-g.clientX)>=Je||Math.abs(h.current.y-g.clientY)>=Je)&&(l(!0),window.removeEventListener("mousemove",p),f(h.current.widget,g),h.current=void 0)},[h,f]),v=m.useCallback((g,b)=>{h.current={x:g.clientX,y:g.clientY,widget:b},window.addEventListener("mousemove",p)},[p]),I=m.useCallback((g,b)=>{window.removeEventListener("mousemove",p),h.current?.widget===b&&(l(!0),f(b)),h.current=void 0},[p,h,f]),S=m.useMemo(()=>r.filter(g=>c?g.name?.toLowerCase().includes(c.toLowerCase()):!0),[c,r]).sort((g,b)=>g.name?.localeCompare(b.name??"")??0),A=m.useMemo(()=>S.map(g=>s.jsx("li",{children:s.jsxs(y,{kind:"ghost","data-testid":`panel-list-item-${g.name??""}-button`,onMouseDown:b=>{v(b,g)},onMouseUp:b=>{I(b,g)},onKeyDown:b=>{(b.key==="Enter"||b.key===" ")&&f(g)},disabled:i,onClick:()=>{},children:[s.jsx(un,{type:g.type})," ",g.name??""]})},g.name)),[S,i,v,I,f]),T=m.useMemo(()=>A.length===0?s.jsx("span",{children:"No bound variables found."}):null,[A]);return s.jsxs("div",{className:"widget-list-container d-flex flex-column",children:[s.jsx("div",{className:"widget-list-header",children:s.jsx(hn,{value:c,placeholder:"Find Table, Plot or Widget",onChange:C,ref:u})}),s.jsxs("ul",{className:"widget-list flex-grow-1",children:[T&&s.jsx("li",{className:"widget-list-message",children:T}),!T&&A]}),s.jsx("div",{children:s.jsx("hr",{})}),s.jsxs("div",{className:"widget-list-footer",children:[s.jsxs(y,{kind:"ghost",onClick:e,children:[s.jsxs("div",{className:"fa-md fa-layers",children:[s.jsx(D,{mask:Oe,icon:Ie,transform:"right-5 down-5"}),s.jsx(D,{icon:Ie,transform:"right-8 down-6"})]}),"Export Layout"]}),s.jsxs(y,{kind:"ghost",onClick:t,children:[s.jsxs("div",{className:"fa-md fa-layers",children:[s.jsx(D,{mask:Oe,icon:Le,transform:"right-5 down-5"}),s.jsx(D,{icon:Le,transform:"right-8 down-6"})]}),"Import Layout"]}),s.jsx(y,{kind:"ghost",icon:H,onClick:n,tooltip:"Reset Layout"})]})]})}function Va({onAutoFillClick:a=()=>{}}){return s.jsxs("div",{className:"empty-dashboard-container",children:[s.jsxs("div",{className:"hint-container",children:[s.jsx(D,{icon:ys})," ",s.jsx("br",{}),"Use the panel list to add objects from a query."]}),s.jsxs("div",{className:"empty-dashboard",children:[s.jsx("div",{className:"add-panels-hint",children:"Drag Panels Here"}),s.jsx(y,{kind:"tertiary",onClick:a,children:"Auto fill objects"})]})]})}const j=K.module("AppMainContainer");class X extends m.Component{static handleWindowBeforeUnload(e){e.preventDefault(),e.returnValue=""}static hydrateConsole(e,t){return Cn.hydrate({...e,unzip:n=>Qe.loadAsync(n).then(o=>Object.values(o.files))},t)}static handleRefresh(){j.info("Refreshing application"),window.location.reload()}constructor(e){super(e),Tn(this),this.importElement=q.createRef();const{allDashboardData:t}=this.props;this.dashboardLayouts=new Map,this.state={contextActions:[{action:()=>{const{serverConfigValues:n}=this.props,o=xt(n),r=Object.entries(o).map(([i,l])=>`${i}: ${l}`).join(`
5
- `);wn(r)},shortcut:V.COPY_VERSION_INFO,isGlobal:!0},{action:()=>{this.handleToolSelect(ae.LINKER)},shortcut:V.LINKER,isGlobal:!0},{action:()=>{this.sendClearFilter()},shortcut:gt.TABLE.CLEAR_ALL_FILTERS,isGlobal:!0},{action:()=>{this.sendReopenLast()},shortcut:V.REOPEN_CLOSED_PANEL,isGlobal:!0},{action:()=>{j.debug("Consume unhandled save shortcut")},shortcut:V.SAVE,isGlobal:!0}],isPanelsMenuShown:!1,isResetLayoutPromptShown:!1,isSettingsMenuShown:!1,unsavedNotebookCount:0,widgets:[],tabs:Object.entries(t).map(([n,o])=>({key:n,title:o.title??"Untitled",isClosable:n!==x,icon:n===x?Ss:void 0})),activeTabKey:x,layoutIteration:0}}componentDidMount(){this.initWidgets(),this.initDashboardData(),window.addEventListener("beforeunload",X.handleWindowBeforeUnload)}componentDidUpdate(e,t){const{dashboardData:n}=this.props;e.dashboardData!==n&&this.handleDataChange(n)}componentWillUnmount(){this.deinitWidgets(),this.dashboardLayouts.forEach(e=>{ke(e.eventHub,this.handleCreateDashboard)}),window.removeEventListener("beforeunload",X.handleWindowBeforeUnload)}dashboardLayouts;importElement;widgetListenerRemover;initWidgets(){const{connection:e}=this.props;if(e!=null){if(e.subscribeToFieldUpdates==null){j.warn("subscribeToFieldUpdates not supported, not initializing widgets");return}this.widgetListenerRemover=e.subscribeToFieldUpdates(t=>{j.debug("Got updates",t),this.setState(({widgets:n})=>{const{updated:o,created:r,removed:i}=t,l=[...o,...i],c=n.filter(u=>!l.some(h=>h.name===u.name));return[...o,...r].forEach(u=>{u.name!=null&&u.name!==""&&c.push(u)}),{widgets:c}})})}}deinitWidgets(){this.widgetListenerRemover?.()}initDashboardData(){const{setDashboardPluginData:e,updateDashboardData:t,workspace:n}=this.props,{data:o}=n,{filterSets:r,links:i,pluginDataMap:l}=o;if(t(x,{filterSets:r,links:i}),l!=null){const c=Object.keys(l);for(let d=0;d<c.length;d+=1){const u=c[d],h=l[u];j.debug("initDashboardData plugin data",u,h),e(x,u,h)}}}openNotebookFromURL(){const{match:e}=this.props,{notebookPath:t}=e.params;if(t){const{session:n,sessionConfig:o}=this.props;if(n==null||o==null){j.error("No session available to open notebook URL",t);return}const r={id:`/${t}`,itemName:`/${t}`},i=o.type,l={value:null,language:i};this.emitLayoutEvent(jn.SELECT_NOTEBOOK,n,i,l,r,!0)}}sendClearFilter(){this.emitLayoutEvent(ee.CLEAR_ALL_FILTERS)}sendReopenLast(){this.emitLayoutEvent(Re.REOPEN_LAST)}emitLayoutEvent(e,...t){const{activeTabKey:n}=this.state;this.dashboardLayouts.get(n)?.eventHub.emit(e,...t)}handleCancelResetLayoutPrompt(){this.setState({isResetLayoutPromptShown:!1})}handleConfirmResetLayoutPrompt(){this.setState({isResetLayoutPromptShown:!1}),this.resetLayout()}handleError(e){B.isCanceled(e)||j.error(e)}handleSettingsMenuHide(){this.setState({isSettingsMenuShown:!1})}handleSettingsMenuShow(){this.setState({isSettingsMenuShown:!0})}handleControlSelect(e,t){switch(j.debug("handleControlSelect",e),e){case U.DROPDOWN_FILTER:this.emitLayoutEvent(ee.OPEN_DROPDOWN,{title:"DropdownFilter",type:e,createNewStack:!0,dragEvent:t});break;case U.INPUT_FILTER:this.emitLayoutEvent(ee.OPEN_INPUT,{title:"InputFilter",type:e,createNewStack:!0,dragEvent:t});break;case U.MARKDOWN:this.emitLayoutEvent(Dn.OPEN,{title:"Markdown",type:e,dragEvent:t});break;case U.FILTER_SET_MANAGER:this.emitLayoutEvent(ee.OPEN_FILTER_SET_MANAGER,{title:"FilterSets",type:e,dragEvent:t});break;default:throw new Error(`Unrecognized control type ${e}`)}}handleToolSelect(e){j.debug("handleToolSelect",e);const{activeTool:t,setActiveTool:n}=this.props;n(t===e?ae.DEFAULT:e)}handleClearFilter(){this.sendClearFilter()}handleDataChange(e){const{updateWorkspaceData:t}=this.props,{closed:n,filterSets:o,links:r,pluginDataMap:i}=e;t({closed:n,filterSets:o,links:r,pluginDataMap:i})}handleGoldenLayoutChange(e){const{activeTabKey:t}=this.state,n=this.dashboardLayouts.get(t);n!==e&&(n!=null&&ke(n.eventHub,this.handleCreateDashboard),this.dashboardLayouts.set(t,e),Rs(e.eventHub,this.handleCreateDashboard))}handleCreateDashboard({pluginId:e,title:t,data:n}){const o=At(),{setDashboardPluginData:r}=this.props;r(o,e,n),this.setState(({tabs:i})=>({tabs:[...i,{key:o,title:t}],activeTabKey:o}))}handleWidgetMenuClick(){this.setState(({isPanelsMenuShown:e})=>({isPanelsMenuShown:!e}))}handleWidgetSelect(e,t){this.setState({isPanelsMenuShown:!1}),j.debug("handleWidgetSelect",e,t),this.openWidget(e,t)}handleWidgetsMenuClose(){this.setState({isPanelsMenuShown:!1})}handleAutoFillClick(){const{widgets:e}=this.state;j.debug("handleAutoFillClick",e);const t=e.sort((n,o)=>n.title!=null&&o.title!=null?n.title.localeCompare(o.title):0);for(let n=0;n<t.length;n+=1)this.openWidget(t[n])}handleExportLayoutClick(){j.info("handleExportLayoutClick"),this.setState({isPanelsMenuShown:!1});try{const{workspace:e}=this.props,{data:t}=e,n=ce.exportLayout(t);j.info("handleExportLayoutClick exportedConfig",n);const o=new Blob([JSON.stringify(n)],{type:"application/json"}),r=ba.i18n.DateTimeFormat.format("yyyy-MM-dd-HHmmss",new Date),i=document.createElement("a");i.href=URL.createObjectURL(o),i.download=`deephaven-app-layout-${r}.json`,i.click()}catch(e){j.error("Unable to export layout",e)}}handleImportLayoutClick(){j.info("handleImportLayoutClick"),this.setState({isPanelsMenuShown:!1}),this.importElement.current!=null&&(this.importElement.current.value="",this.importElement.current.click())}handleResetLayoutClick(){j.info("handleResetLayoutClick"),this.setState({isPanelsMenuShown:!1,isResetLayoutPromptShown:!0,unsavedNotebookCount:Nn.unsavedNotebookCount()})}handleImportLayoutFiles(e){e.stopPropagation(),e.preventDefault(),e.target.files!=null&&this.importLayoutFile(e.target.files?.[0])}async importLayoutFile(e){try{const{updateDashboardData:t,updateWorkspaceData:n}=this.props,o=await e.text(),r=JSON.parse(o),{filterSets:i,layoutConfig:l,links:c,pluginDataMap:d}=ce.normalizeLayout(r);n({layoutConfig:l}),t(x,{filterSets:i,links:c,pluginDataMap:d}),this.setState(({layoutIteration:u})=>({layoutIteration:u+1}))}catch(t){j.error("Unable to import layout",t)}}async resetLayout(){const{layoutStorage:e,session:t}=this.props,{filterSets:n,layoutConfig:o,links:r}=await ce.getDefaultLayout(e,t!==void 0),{updateDashboardData:i,updateWorkspaceData:l}=this.props;l({layoutConfig:o}),i(x,{filterSets:n,links:r})}handlePaste(e){if(e.target instanceof HTMLElement&&e.target.closest(".monaco-editor"))return;const{clipboardData:t}=e,n=t.getData("Text"),o=/“|”/g;o.test(n)&&(e.preventDefault(),e.stopPropagation(),document.execCommand("insertText",!1,n.replace(o,'"')))}openWidget(e,t){const{connection:n}=this.props;this.emitLayoutEvent(Re.OPEN,{dragEvent:t,fetch:async()=>n?.getObject(e),widget:Fn(e)})}getDashboardPlugins=Mt(e=>Is(e));handleHomeClick(){this.handleTabSelect(x)}handleTabSelect(e){this.setState({activeTabKey:e})}handleTabReorder(e,t){this.setState(({tabs:n})=>{const o=[...n],[r]=o.splice(e,1);return o.splice(t,0,r),{tabs:o}})}handleTabClose(e){this.setState(({tabs:t,activeTabKey:n})=>{const o=t.filter(i=>i.key!==e);let r=n;if(n===e&&o.length>0){const i=t.findIndex(l=>l.key===e);r=i<t.length-1?t[i+1].key:t[i-1].key}return o.length===0&&(r=x),{tabs:o,activeTabKey:r}})}getDashboards(){const{layoutIteration:e,tabs:t}=this.state,{allDashboardData:n,workspace:o}=this.props,{data:r}=o,{layoutConfig:i}=r;return[{id:x,layoutConfig:i,key:`${x}-${e}`},...t.filter(l=>l.key!==x).map(l=>({id:l.key,layoutConfig:n[l.key]?.layoutConfig??En,key:`${l.key}-${e}`}))]}render(){const{activeTool:e,plugins:t,user:n,serverConfigValues:o}=this.props,{permissions:r}=n,{canUsePanels:i}=r,{contextActions:l,isPanelsMenuShown:c,isResetLayoutPromptShown:d,isSettingsMenuShown:u,unsavedNotebookCount:h,widgets:f,tabs:C,activeTabKey:p}=this.state,v=this.getDashboardPlugins(t);return s.jsxs("div",{className:F("app-main-tabs","w-100","h-100","d-flex","flex-column",e?`active-tool-${e.toLowerCase()}`:""),onPaste:this.handlePaste,tabIndex:-1,children:[s.jsxs("div",{className:"app-main-top-nav-menus",children:[s.jsx(pt,{className:"ml-1",style:{maxHeight:"20px"}}),C.length>1&&s.jsx("div",{style:{flexShrink:0,flexGrow:1,display:"flex"},children:s.jsx(Os,{tabs:C,activeKey:p,onSelect:this.handleTabSelect,onReorder:this.handleTabReorder,onClose:this.handleTabClose})}),s.jsxs("div",{className:"app-main-right-menu-buttons",children:[s.jsxs(y,{kind:"ghost",className:"btn-panels-menu",icon:xs,onClick:()=>{},children:["Controls",s.jsx(je,{handleControlSelect:this.handleControlSelect,handleToolSelect:this.handleToolSelect,onClearFilter:this.handleClearFilter})]}),i&&s.jsxs(y,{kind:"ghost",className:"btn-panels-menu btn-show-panels","data-testid":"app-main-panels-button",onClick:this.handleWidgetMenuClick,icon:Cs,children:["Panels",s.jsx(Rn,{isShown:c,className:"panels-menu-popper",onExited:this.handleWidgetsMenuClose,options:{placement:"bottom"},closeOnBlur:!0,interactive:!0,children:s.jsx(Ba,{widgets:f,onExportLayout:this.handleExportLayoutClick,onImportLayout:this.handleImportLayoutClick,onResetLayout:this.handleResetLayoutClick,onSelect:this.handleWidgetSelect})})]}),s.jsx(y,{kind:"ghost",className:F("btn-settings-menu",{"text-warning":n.operateAs!=null&&n.operateAs!==n.name}),onClick:this.handleSettingsMenuShow,icon:s.jsx("span",{className:"fa-layers",children:s.jsx(D,{icon:Ts,transform:"grow-3"})}),tooltip:"User Settings"})]})]}),s.jsx(Ls,{dashboards:this.getDashboards(),activeDashboard:p,onGoldenLayoutChange:this.handleGoldenLayoutChange,emptyDashboard:p===x?s.jsx(Va,{onAutoFillClick:this.handleAutoFillClick}):s.jsx(mt,{}),plugins:[s.jsx(In,{hydrateConsole:X.hydrateConsole,notebooksUrl:new URL("notebooks/",document.baseURI).href},"ConsolePlugin"),...v]}),s.jsx(Bs,{in:u,mountOnEnter:!0,unmountOnExit:!0,children:s.jsx(E,{serverConfigValues:o,pluginData:t,onDone:this.handleSettingsMenuHide,user:n})}),s.jsx(On,{actions:l}),s.jsx("input",{ref:this.importElement,type:"file",accept:".json",style:{display:"none"},onChange:this.handleImportLayoutFiles,"data-testid":"input-import-layout"}),s.jsx(Ln,{confirmButtonText:"Reset",onConfirm:this.handleConfirmResetLayoutPrompt,onCancel:this.handleCancelResetLayoutPrompt,isConfirmDanger:!0,isOpen:d,headerText:h===0?"Reset Layout":"Reset layout and discard unsaved changes",bodyText:h===0?"Do you want to reset your layout? Your existing layout will be lost.":"Do you want to reset your layout? Any unsaved notebooks will be lost."})]})}}const Ha=a=>({activeTool:vn(a),allDashboardData:bn(a),dashboardData:fn(a,x),layoutStorage:Wa(a),plugins:gn(a),connection:pn(a,x),session:Ee(a,x)?.session,sessionConfig:Ee(a,x)?.config,user:mn(a),workspace:dt(a),serverConfigValues:Ga(a)}),Za=oe(Ha,{setActiveTool:ht,setDashboardData:ut,setDashboardPluginData:xn,updateDashboardData:Sn,updateWorkspaceData:yn})(_t(X));function Ya(){return s.jsxs("div",{className:"app",children:[s.jsx(Za,{}),s.jsx(ks,{}),s.jsx(Ut,{})]})}const qa=K.module("AppInit");function Xe(){const a=nt(),e=Ps(),t=_s(),n=kn(),o=As(),r=Ms(),i=Kt(dt),l=xe(),[c,d]=m.useState();m.useEffect(function(){l(Pn(n))},[n,l]),m.useEffect(function(){async function p(){try{const v=await Us(),I=await Ks(a,t,v),S=e.getStorageService(),A=new $s(S,"/layouts"),T=new Ws(a,S,"/notebooks"),g=new Pe(A),b=new ga,De=await g.load({isConsoleAvailable:I!==void 0}),{data:re}=De,{settings:jt}=re,{shortcutOverrides:Ne={}}=jt,Dt=k.isMacPlatform?Ne.mac??{}:Ne.windows??{};Object.entries(Dt).forEach(([Ft,Et])=>{Ce.get(Ft)?.setKeyState(Et)});const Nt={title:"Code Studio",filterSets:re.filterSets,links:re.links};l(_n(a)),l(ht(ae.DEFAULT)),l(An(o)),l(Mn(b)),l(ut(x,Nt)),l(Un(T)),l(fa(A)),l(Kn(x,t)),I!==void 0&&l($n(x,I)),l(Wn(r)),l(Gn(g)),l(Bn(De)),l(Vn(Pe.makeDefaultWorkspaceSettings(o)))}catch(v){qa.error(v),d(v)}}p()},[a,e,t,o,l,r]);const u=i==null&&c==null,h=!u&&c==null,f=c!=null?`${c}`:null;return s.jsxs(s.Fragment,{children:[h&&s.jsx(Ya,{}),s.jsx(mt,{isLoading:u&&f==null,isLoaded:h,errorMessage:f})]})}const za=q.lazy(()=>Bt(()=>import("./StyleGuideRoot-DPfm3PcQ.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23]),import.meta.url)),Ja=new URL(document.baseURI).pathname.replace(/\/$/,"");function Xa(){return s.jsx($t,{basename:Ja,children:s.jsxs(Wt,{children:[s.jsx(le,{exact:!0,path:"/",component:Xe}),s.jsx(le,{path:"/notebooks/:notebookPath+",component:Xe}),s.jsx(le,{path:"/styleguide",component:za}),s.jsx(Gt,{from:"*",to:"/"})]})})}function lo(){return Vs.register(new URL("./download/serviceWorker.js",window.location.href)),Hn.init({getWorker:()=>new Vt}),window["__react-beautiful-dnd-disable-dev-warnings"]=!0,s.jsx(Xa,{})}export{lo as AppRoot,lo as default};
6
- //# sourceMappingURL=AppRoot-DPYC6qg1.js.map
5
+ `);wn(r)},shortcut:V.COPY_VERSION_INFO,isGlobal:!0},{action:()=>{this.handleToolSelect(ae.LINKER)},shortcut:V.LINKER,isGlobal:!0},{action:()=>{this.sendClearFilter()},shortcut:gt.TABLE.CLEAR_ALL_FILTERS,isGlobal:!0},{action:()=>{this.sendReopenLast()},shortcut:V.REOPEN_CLOSED_PANEL,isGlobal:!0},{action:()=>{j.debug("Consume unhandled save shortcut")},shortcut:V.SAVE,isGlobal:!0}],isPanelsMenuShown:!1,isResetLayoutPromptShown:!1,isSettingsMenuShown:!1,unsavedNotebookCount:0,widgets:[],tabs:Object.entries(t).map(([n,o])=>({key:n,title:o.title??"Untitled",isClosable:n!==x,icon:n===x?Ss:void 0})),activeTabKey:x,layoutIteration:0}}componentDidMount(){this.initWidgets(),this.initDashboardData(),window.addEventListener("beforeunload",X.handleWindowBeforeUnload)}componentDidUpdate(e,t){const{dashboardData:n}=this.props;e.dashboardData!==n&&this.handleDataChange(n)}componentWillUnmount(){this.deinitWidgets(),this.dashboardLayouts.forEach(e=>{ke(e.eventHub,this.handleCreateDashboard)}),window.removeEventListener("beforeunload",X.handleWindowBeforeUnload)}dashboardLayouts;importElement;widgetListenerRemover;initWidgets(){const{connection:e}=this.props;if(e!=null){if(e.subscribeToFieldUpdates==null){j.warn("subscribeToFieldUpdates not supported, not initializing widgets");return}this.widgetListenerRemover=e.subscribeToFieldUpdates(t=>{j.debug("Got updates",t),this.setState(({widgets:n})=>{const{updated:o,created:r,removed:i}=t,l=[...o,...i],c=n.filter(u=>!l.some(h=>h.name===u.name));return[...o,...r].forEach(u=>{u.name!=null&&u.name!==""&&c.push(u)}),{widgets:c}})})}}deinitWidgets(){this.widgetListenerRemover?.()}initDashboardData(){const{setDashboardPluginData:e,updateDashboardData:t,workspace:n}=this.props,{data:o}=n,{filterSets:r,links:i,pluginDataMap:l}=o;if(t(x,{filterSets:r,links:i}),l!=null){const c=Object.keys(l);for(let d=0;d<c.length;d+=1){const u=c[d],h=l[u];j.debug("initDashboardData plugin data",u,h),e(x,u,h)}}}openNotebookFromURL(){const{match:e}=this.props,{notebookPath:t}=e.params;if(t){const{session:n,sessionConfig:o}=this.props;if(n==null||o==null){j.error("No session available to open notebook URL",t);return}const r={id:`/${t}`,itemName:`/${t}`},i=o.type,l={value:null,language:i};this.emitLayoutEvent(jn.SELECT_NOTEBOOK,n,i,l,r,!0)}}sendClearFilter(){this.emitLayoutEvent(ee.CLEAR_ALL_FILTERS)}sendReopenLast(){this.emitLayoutEvent(Re.REOPEN_LAST)}emitLayoutEvent(e,...t){const{activeTabKey:n}=this.state;this.dashboardLayouts.get(n)?.eventHub.emit(e,...t)}handleCancelResetLayoutPrompt(){this.setState({isResetLayoutPromptShown:!1})}handleConfirmResetLayoutPrompt(){this.setState({isResetLayoutPromptShown:!1}),this.resetLayout()}handleError(e){B.isCanceled(e)||j.error(e)}handleSettingsMenuHide(){this.setState({isSettingsMenuShown:!1})}handleSettingsMenuShow(){this.setState({isSettingsMenuShown:!0})}handleControlSelect(e,t){switch(j.debug("handleControlSelect",e),e){case U.DROPDOWN_FILTER:this.emitLayoutEvent(ee.OPEN_DROPDOWN,{title:"DropdownFilter",type:e,createNewStack:!0,dragEvent:t});break;case U.INPUT_FILTER:this.emitLayoutEvent(ee.OPEN_INPUT,{title:"InputFilter",type:e,createNewStack:!0,dragEvent:t});break;case U.MARKDOWN:this.emitLayoutEvent(Dn.OPEN,{title:"Markdown",type:e,dragEvent:t});break;case U.FILTER_SET_MANAGER:this.emitLayoutEvent(ee.OPEN_FILTER_SET_MANAGER,{title:"FilterSets",type:e,dragEvent:t});break;default:throw new Error(`Unrecognized control type ${e}`)}}handleToolSelect(e){j.debug("handleToolSelect",e);const{activeTool:t,setActiveTool:n}=this.props;n(t===e?ae.DEFAULT:e)}handleClearFilter(){this.sendClearFilter()}handleDataChange(e){const{updateWorkspaceData:t}=this.props,{closed:n,filterSets:o,links:r,pluginDataMap:i}=e;t({closed:n,filterSets:o,links:r,pluginDataMap:i})}handleGoldenLayoutChange(e){const{activeTabKey:t}=this.state,n=this.dashboardLayouts.get(t);n!==e&&(n!=null&&ke(n.eventHub,this.handleCreateDashboard),this.dashboardLayouts.set(t,e),Rs(e.eventHub,this.handleCreateDashboard))}handleCreateDashboard({pluginId:e,title:t,data:n}){const o=At(),{setDashboardPluginData:r}=this.props;r(o,e,n),this.setState(({tabs:i})=>({tabs:[...i,{key:o,title:t}],activeTabKey:o}))}handleWidgetMenuClick(){this.setState(({isPanelsMenuShown:e})=>({isPanelsMenuShown:!e}))}handleWidgetSelect(e,t){this.setState({isPanelsMenuShown:!1}),j.debug("handleWidgetSelect",e,t),this.openWidget(e,t)}handleWidgetsMenuClose(){this.setState({isPanelsMenuShown:!1})}handleAutoFillClick(){const{widgets:e}=this.state;j.debug("handleAutoFillClick",e);const t=e.sort((n,o)=>n.title!=null&&o.title!=null?n.title.localeCompare(o.title):0);for(let n=0;n<t.length;n+=1)this.openWidget(t[n])}handleExportLayoutClick(){j.info("handleExportLayoutClick"),this.setState({isPanelsMenuShown:!1});try{const{workspace:e}=this.props,{data:t}=e,n=ce.exportLayout(t);j.info("handleExportLayoutClick exportedConfig",n);const o=new Blob([JSON.stringify(n)],{type:"application/json"}),r=ba.i18n.DateTimeFormat.format("yyyy-MM-dd-HHmmss",new Date),i=document.createElement("a");i.href=URL.createObjectURL(o),i.download=`deephaven-app-layout-${r}.json`,i.click()}catch(e){j.error("Unable to export layout",e)}}handleImportLayoutClick(){j.info("handleImportLayoutClick"),this.setState({isPanelsMenuShown:!1}),this.importElement.current!=null&&(this.importElement.current.value="",this.importElement.current.click())}handleResetLayoutClick(){j.info("handleResetLayoutClick"),this.setState({isPanelsMenuShown:!1,isResetLayoutPromptShown:!0,unsavedNotebookCount:Nn.unsavedNotebookCount()})}handleImportLayoutFiles(e){e.stopPropagation(),e.preventDefault(),e.target.files!=null&&this.importLayoutFile(e.target.files?.[0])}async importLayoutFile(e){try{const{updateDashboardData:t,updateWorkspaceData:n}=this.props,o=await e.text(),r=JSON.parse(o),{filterSets:i,layoutConfig:l,links:c,pluginDataMap:d}=ce.normalizeLayout(r);n({layoutConfig:l}),t(x,{filterSets:i,links:c,pluginDataMap:d}),this.setState(({layoutIteration:u})=>({layoutIteration:u+1}))}catch(t){j.error("Unable to import layout",t)}}async resetLayout(){const{layoutStorage:e,session:t}=this.props,{filterSets:n,layoutConfig:o,links:r}=await ce.getDefaultLayout(e,t!==void 0),{updateDashboardData:i,updateWorkspaceData:l}=this.props;l({layoutConfig:o}),i(x,{filterSets:n,links:r})}handlePaste(e){if(e.target instanceof HTMLElement&&e.target.closest(".monaco-editor"))return;const{clipboardData:t}=e,n=t.getData("Text"),o=/“|”/g;o.test(n)&&(e.preventDefault(),e.stopPropagation(),document.execCommand("insertText",!1,n.replace(o,'"')))}openWidget(e,t){const{connection:n}=this.props;this.emitLayoutEvent(Re.OPEN,{dragEvent:t,fetch:async()=>n?.getObject(e),widget:Fn(e)})}getDashboardPlugins=Mt(e=>Is(e));handleHomeClick(){this.handleTabSelect(x)}handleTabSelect(e){this.setState({activeTabKey:e})}handleTabReorder(e,t){this.setState(({tabs:n})=>{const o=[...n],[r]=o.splice(e,1);return o.splice(t,0,r),{tabs:o}})}handleTabClose(e){this.setState(({tabs:t,activeTabKey:n})=>{const o=t.filter(i=>i.key!==e);let r=n;if(n===e&&o.length>0){const i=t.findIndex(l=>l.key===e);r=i<t.length-1?t[i+1].key:t[i-1].key}return o.length===0&&(r=x),{tabs:o,activeTabKey:r}})}getDashboards(){const{layoutIteration:e,tabs:t}=this.state,{allDashboardData:n,workspace:o}=this.props,{data:r}=o,{layoutConfig:i}=r;return[{id:x,layoutConfig:i,key:`${x}-${e}`},...t.filter(l=>l.key!==x).map(l=>({id:l.key,layoutConfig:n[l.key]?.layoutConfig??En,key:`${l.key}-${e}`}))]}render(){const{activeTool:e,plugins:t,user:n,serverConfigValues:o}=this.props,{permissions:r}=n,{canUsePanels:i}=r,{contextActions:l,isPanelsMenuShown:c,isResetLayoutPromptShown:d,isSettingsMenuShown:u,unsavedNotebookCount:h,widgets:f,tabs:C,activeTabKey:p}=this.state,v=this.getDashboardPlugins(t);return s.jsxs("div",{className:F("app-main-tabs","w-100","h-100","d-flex","flex-column",e?`active-tool-${e.toLowerCase()}`:""),onPaste:this.handlePaste,tabIndex:-1,children:[s.jsxs("div",{className:"app-main-top-nav-menus",children:[s.jsx(pt,{className:"ml-1",style:{maxHeight:"20px"}}),C.length>1&&s.jsx("div",{style:{flexShrink:0,flexGrow:1,display:"flex"},children:s.jsx(Os,{tabs:C,activeKey:p,onSelect:this.handleTabSelect,onReorder:this.handleTabReorder,onClose:this.handleTabClose})}),s.jsxs("div",{className:"app-main-right-menu-buttons",children:[s.jsxs(y,{kind:"ghost",className:"btn-panels-menu",icon:xs,onClick:()=>{},children:["Controls",s.jsx(je,{handleControlSelect:this.handleControlSelect,handleToolSelect:this.handleToolSelect,onClearFilter:this.handleClearFilter})]}),i&&s.jsxs(y,{kind:"ghost",className:"btn-panels-menu btn-show-panels","data-testid":"app-main-panels-button",onClick:this.handleWidgetMenuClick,icon:Cs,children:["Panels",s.jsx(Rn,{isShown:c,className:"panels-menu-popper",onExited:this.handleWidgetsMenuClose,options:{placement:"bottom"},closeOnBlur:!0,interactive:!0,children:s.jsx(Ba,{widgets:f,onExportLayout:this.handleExportLayoutClick,onImportLayout:this.handleImportLayoutClick,onResetLayout:this.handleResetLayoutClick,onSelect:this.handleWidgetSelect})})]}),s.jsx(y,{kind:"ghost",className:F("btn-settings-menu",{"text-warning":n.operateAs!=null&&n.operateAs!==n.name}),onClick:this.handleSettingsMenuShow,icon:s.jsx("span",{className:"fa-layers",children:s.jsx(D,{icon:Ts,transform:"grow-3"})}),tooltip:"User Settings"})]})]}),s.jsx(Ls,{dashboards:this.getDashboards(),activeDashboard:p,onGoldenLayoutChange:this.handleGoldenLayoutChange,emptyDashboard:p===x?s.jsx(Va,{onAutoFillClick:this.handleAutoFillClick}):s.jsx(mt,{}),plugins:[s.jsx(In,{hydrateConsole:X.hydrateConsole,notebooksUrl:new URL("notebooks/",document.baseURI).href},"ConsolePlugin"),...v]}),s.jsx(Bs,{in:u,mountOnEnter:!0,unmountOnExit:!0,children:s.jsx(E,{serverConfigValues:o,pluginData:t,onDone:this.handleSettingsMenuHide,user:n})}),s.jsx(On,{actions:l}),s.jsx("input",{ref:this.importElement,type:"file",accept:".json",style:{display:"none"},onChange:this.handleImportLayoutFiles,"data-testid":"input-import-layout"}),s.jsx(Ln,{confirmButtonText:"Reset",onConfirm:this.handleConfirmResetLayoutPrompt,onCancel:this.handleCancelResetLayoutPrompt,isConfirmDanger:!0,isOpen:d,headerText:h===0?"Reset Layout":"Reset layout and discard unsaved changes",bodyText:h===0?"Do you want to reset your layout? Your existing layout will be lost.":"Do you want to reset your layout? Any unsaved notebooks will be lost."})]})}}const Ha=a=>({activeTool:vn(a),allDashboardData:bn(a),dashboardData:fn(a,x),layoutStorage:Wa(a),plugins:gn(a),connection:pn(a,x),session:Ee(a,x)?.session,sessionConfig:Ee(a,x)?.config,user:mn(a),workspace:dt(a),serverConfigValues:Ga(a)}),Za=oe(Ha,{setActiveTool:ht,setDashboardData:ut,setDashboardPluginData:xn,updateDashboardData:Sn,updateWorkspaceData:yn})(_t(X));function Ya(){return s.jsxs("div",{className:"app",children:[s.jsx(Za,{}),s.jsx(ks,{}),s.jsx(Ut,{})]})}const qa=K.module("AppInit");function Xe(){const a=nt(),e=Ps(),t=_s(),n=kn(),o=As(),r=Ms(),i=Kt(dt),l=xe(),[c,d]=m.useState();m.useEffect(function(){l(Pn(n))},[n,l]),m.useEffect(function(){async function p(){try{const v=await Us(),I=await Ks(a,t,v),S=e.getStorageService(),A=new $s(S,"/layouts"),T=new Ws(a,S,"/notebooks"),g=new Pe(A),b=new ga,De=await g.load({isConsoleAvailable:I!==void 0}),{data:re}=De,{settings:jt}=re,{shortcutOverrides:Ne={}}=jt,Dt=k.isMacPlatform?Ne.mac??{}:Ne.windows??{};Object.entries(Dt).forEach(([Ft,Et])=>{Ce.get(Ft)?.setKeyState(Et)});const Nt={title:"Code Studio",filterSets:re.filterSets,links:re.links};l(_n(a)),l(ht(ae.DEFAULT)),l(An(o)),l(Mn(b)),l(ut(x,Nt)),l(Un(T)),l(fa(A)),l(Kn(x,t)),I!==void 0&&l($n(x,I)),l(Wn(r)),l(Gn(g)),l(Bn(De)),l(Vn(Pe.makeDefaultWorkspaceSettings(o)))}catch(v){qa.error(v),d(v)}}p()},[a,e,t,o,l,r]);const u=i==null&&c==null,h=!u&&c==null,f=c!=null?`${c}`:null;return s.jsxs(s.Fragment,{children:[h&&s.jsx(Ya,{}),s.jsx(mt,{isLoading:u&&f==null,isLoaded:h,errorMessage:f})]})}const za=q.lazy(()=>Bt(()=>import("./StyleGuideRoot-CdUtzsMw.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23]),import.meta.url)),Ja=new URL(document.baseURI).pathname.replace(/\/$/,"");function Xa(){return s.jsx($t,{basename:Ja,children:s.jsxs(Wt,{children:[s.jsx(le,{exact:!0,path:"/",component:Xe}),s.jsx(le,{path:"/notebooks/:notebookPath+",component:Xe}),s.jsx(le,{path:"/styleguide",component:za}),s.jsx(Gt,{from:"*",to:"/"})]})})}function lo(){return Vs.register(new URL("./download/serviceWorker.js",window.location.href)),Hn.init({getWorker:()=>new Vt}),window["__react-beautiful-dnd-disable-dev-warnings"]=!0,s.jsx(Xa,{})}export{lo as AppRoot,lo as default};
6
+ //# sourceMappingURL=AppRoot-CM06vHK8.js.map