@deephaven/code-studio 0.85.0 → 0.85.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/assets/{AppRoot-be1f3f23.js → AppRoot-d23aa50f.js} +3 -3
- package/build/assets/{AppRoot-be1f3f23.js.map → AppRoot-d23aa50f.js.map} +1 -1
- package/build/assets/{Chart-afbf32b2.js → Chart-aa9835ca.js} +2 -2
- package/build/assets/{Chart-afbf32b2.js.map → Chart-aa9835ca.js.map} +1 -1
- package/build/assets/{ControlType-f304bca9.js → ControlType-78dfb452.js} +3 -3
- package/build/assets/{ControlType-f304bca9.js.map → ControlType-78dfb452.js.map} +1 -1
- package/build/assets/{FontBootstrap-f6774aa6.js → FontBootstrap-659656f9.js} +2 -2
- package/build/assets/{FontBootstrap-f6774aa6.js.map → FontBootstrap-659656f9.js.map} +1 -1
- package/build/assets/{FormatterUtils-5983dd5d.js → FormatterUtils-aaad22fe.js} +2 -2
- package/build/assets/{FormatterUtils-5983dd5d.js.map → FormatterUtils-aaad22fe.js.map} +1 -1
- package/build/assets/{Grid-6f43b155.js → Grid-a6de25d1.js} +2 -2
- package/build/assets/{Grid-6f43b155.js.map → Grid-a6de25d1.js.map} +1 -1
- package/build/assets/{IrisGrid-4d72b118.js → IrisGrid-d8305089.js} +2 -2
- package/build/assets/{IrisGrid-4d72b118.js.map → IrisGrid-d8305089.js.map} +1 -1
- package/build/assets/{IrisGridModel-ccd93725.js → IrisGridModel-c94c231d.js} +2 -2
- package/build/assets/{IrisGridModel-ccd93725.js.map → IrisGridModel-c94c231d.js.map} +1 -1
- package/build/assets/{IrisGridShortcuts-2b876d25.js → IrisGridShortcuts-fc1c4926.js} +2 -2
- package/build/assets/{IrisGridShortcuts-2b876d25.js.map → IrisGridShortcuts-fc1c4926.js.map} +1 -1
- package/build/assets/{IrisGridThemeProvider-4d526391.js → IrisGridThemeProvider-01eeb078.js} +2 -2
- package/build/assets/{IrisGridThemeProvider-4d526391.js.map → IrisGridThemeProvider-01eeb078.js.map} +1 -1
- package/build/assets/{LocalWorkspaceStorage-ec3d3b96.js → LocalWorkspaceStorage-96b1cd42.js} +2 -2
- package/build/assets/{LocalWorkspaceStorage-ec3d3b96.js.map → LocalWorkspaceStorage-96b1cd42.js.map} +1 -1
- package/build/assets/{MarkdownEditor-2183a9e5.js → MarkdownEditor-f0dce380.js} +2 -2
- package/build/assets/{MarkdownEditor-2183a9e5.js.map → MarkdownEditor-f0dce380.js.map} +1 -1
- package/build/assets/{MarkdownNotebook-ce1f701b.js → MarkdownNotebook-ad4b12eb.js} +2 -2
- package/build/assets/{MarkdownNotebook-ce1f701b.js.map → MarkdownNotebook-ad4b12eb.js.map} +1 -1
- package/build/assets/{MissingPartitionError-e2f06d9e.js → MissingPartitionError-1e88c7f8.js} +2 -2
- package/build/assets/{MissingPartitionError-e2f06d9e.js.map → MissingPartitionError-1e88c7f8.js.map} +1 -1
- package/build/assets/{StyleGuideRoot-aa669173.js → StyleGuideRoot-00b26873.js} +2 -2
- package/build/assets/{StyleGuideRoot-aa669173.js.map → StyleGuideRoot-00b26873.js.map} +1 -1
- package/build/assets/{TokenBoxCellRenderer-db3dc0cd.js → TokenBoxCellRenderer-60830db1.js} +2 -2
- package/build/assets/{TokenBoxCellRenderer-db3dc0cd.js.map → TokenBoxCellRenderer-60830db1.js.map} +1 -1
- package/build/assets/{index-7fdfc8da.js → index-1930b332.js} +2 -2
- package/build/assets/{index-7fdfc8da.js.map → index-1930b332.js.map} +1 -1
- package/build/assets/{index-9f86adb6.js → index-aed9a2a1.js} +2 -2
- package/build/assets/{index-9f86adb6.js.map → index-aed9a2a1.js.map} +1 -1
- package/build/assets/{index-224f4545.js → index-ca0b61a2.js} +3 -3
- package/build/assets/{index-224f4545.js.map → index-ca0b61a2.js.map} +1 -1
- package/build/index.html +2 -2
- package/package.json +20 -20
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import{_ as Ye,W as jt}from"./monaco-b5248072.js";import{P as qe,N as Ft,O as Nt,r as m,I as s,Q as ae,T as ze,M as q,U as he,K as N,V as w,L as j,W as Xe,X as Et,Y as Rt,Z as It,_ as Ot,$ as Pt,a0 as Lt,a1 as kt,a2 as _t,a3 as re,a4 as At,a5 as Mt}from"./vendor-6ba620f4.js";import{O as te,P as G,T as P,D as Ut,I as k,a as _,b as W,u as Je,F as Kt,c as F,d as $t,e as fe,S as ne,B as S,C as z,g as Wt,f as Qe,h as et,i as tt,j as nt,k as st,l as Gt,m as Bt,n as Vt,o as at,p as Ht,q as L,r as be,s as ot,K as Zt,t as we,v as Yt,w as rt,x as qt,y as zt,G as B,z as Xt,A as Jt,E as U,H as se,J as Qt,L as en,M as tn,N as nn,Q as sn,R as it,U as lt,V as an,W as on,X as rn,Y as ln,Z as cn,_ as dn,$ as un,a0 as hn,a1 as De,a2 as mn,a3 as ct,a4 as pn,a5 as gn,a6 as fn,a7 as C,a8 as bn,a9 as Q,aa as je,ab as vn,ac as Sn,ad as yn,ae as Cn,af as Tn,ag as xn,ah as wn,ai as Dn,aj as jn,ak as Fn,al as Nn,am as En,an as Rn,ao as In,ap as On,aq as Pn,ar as Ln,as as kn,at as _n,au as An,av as Mn}from"./ControlType-f304bca9.js";import{L as K,v as V,a as Un,M as Kn,b as $n,c as Wn,d as Gn,l as Bn,e as me,f as Vn,g as Hn,h as Zn,i as Yn,j as qn,k as zn,m as Xn,n as Jn,o as Qn,p as es,q as ts,r as ns,s as ss,t as as,u as os,w as rs,x as Fe,y as Ne,z as Ee,A as is,B as ls,C as cs,D as ds,E as us,F as dt}from"./index-7fdfc8da.js";import{C as hs,B as ms,m as ps,a as gs,T as fs,L as ut,s as Re,l as bs,U as ie,N as vs,A as Ss,g as ys,b as Cs,u as Ts,c as xs,d as ws,e as Ds,f as js,h as Fs,G as Ns,i as Es,j as Ie}from"./LocalWorkspaceStorage-ec3d3b96.js";import{I as ht,S as Rs,D as Is}from"./IrisGridShortcuts-2b876d25.js";import"./helpers-de833af9.js";class Oe{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(te.and)}),{filterItems:t,filterOperators:n}}static combineFilterConfigs(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:te.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 Os(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 Pe(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 Le(a){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Pe(Object(t),!0).forEach(function(n){E(a,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(t)):Pe(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){t(d);return}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 E(a,e,t){return e=Ps(e),e in a?Object.defineProperty(a,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):a[e]=t,a}function Ps(a){var e=Ls(a,"string");return typeof e=="symbol"?e:String(e)}function Ls(a,e){if(typeof a!="object"||a===null)return a;var t=a[Symbol.toPrimitive];if(t!==void 0){var n=t.call(a,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(a)}var le=K.module("PouchStorageTable"),ks="Deephaven.";qe.plugin(Ft);function _s(a,e){switch(a){case P.in:case P.contains:return{$regex:new RegExp("".concat(e)).toString()};case P.inIgnoreCase:return{$regex:new RegExp("".concat(e),"i").toString()};case P.eq:return{$eq:e};case P.notEq:return{$ne:e};case P.greaterThan:return{$gt:e};case P.greaterThanOrEqualTo:return{$gte:e};case P.lessThan:return{$lt:e};case P.lessThanOrEqualTo:return{$lte:e};case P.startsWith:return{$regex:new RegExp("^".concat(e,".*")).toString()};default:throw new Error("Unsupported type: ".concat(a))}}function As(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]:_s(l,c)};if(o===0)n=d;else if(n!==null&&o-1<t.length){var u=t[o-1];if(u===te.and)n={$and:[n,d]};else if(u===te.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 ce(){var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];return{$and:[...a.map(e=>As(e)),{name:{$gt:null}},{id:{$gt:null}}]}}function Ms(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 Us{constructor(e,t){E(this,"db",void 0),E(this,"changes",void 0),E(this,"listeners",[]),E(this,"itemListeners",new Map),E(this,"currentSize",0),E(this,"currentViewport",void 0),E(this,"currentReverse",!1),E(this,"currentFilter",null),E(this,"currentSort",null),E(this,"infoUpdatePromise",void 0),E(this,"viewportUpdatePromise",void 0),E(this,"currentViewportData",void 0),this.db=new qe("".concat(ks).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=Le(Le({},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){le.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=G.makeCancelable(e.fetchInfo(ce((n=e.currentFilter)!==null&&n!==void 0?n:[])));var o=yield e.infoUpdatePromise;e.currentSize=o.docs.length,e.sendUpdate()}catch(r){if(!G.isCanceled(r))throw le.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=ce((t=e.currentFilter)!==null&&t!==void 0?t:[]),r=Ms(e.currentSort,e.currentReverse);(n=e.viewportUpdatePromise)===null||n===void 0||n.cancel(),e.viewportUpdatePromise=G.makeCancelable(e.fetchViewportData(e.currentViewport,o,r));var i=yield e.viewportUpdatePromise;return e.currentViewportData=i,e.sendUpdate(),i}catch(l){if(!G.isCanceled(l))throw le.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:ce((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 T=c+f;n.set(T,h.docs[f])}})});return function(i){return r.apply(this,arguments)}}())),n})()}}const Ks=Us;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 ee(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){mt(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 Ae(a,e,t,n,o,r,i){try{var l=a[r](i),c=l.value}catch(d){t(d);return}l.done?e(c):Promise.resolve(c).then(n,o)}function X(a){return function(){var e=this,t=arguments;return new Promise(function(n,o){var r=a.apply(e,t);function i(c){Ae(r,n,o,i,l,"next",c)}function l(c){Ae(r,n,o,i,l,"throw",c)}i(void 0)})}}function mt(a,e,t){return e=$s(e),e in a?Object.defineProperty(a,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):a[e]=t,a}function $s(a){var e=Ws(a,"string");return typeof e=="symbol"?e:String(e)}function Ws(a,e){if(typeof a!="object"||a===null)return a;var t=a[Symbol.toPrimitive];if(t!==void 0){var n=t.call(a,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(a)}var Gs=2500,Bs=2e3,I=K.module("PouchCommandHistoryTable");class Vs extends Ks{constructor(e,t){var n;super("CommandHistoryStorage.".concat(e),{auto_compaction:!0,revs_limit:1}),mt(this,"searchText",void 0),this.cache=t,this.cache.tableRegistry.has(this.cacheKey)||this.cache.tableRegistry.set(this.cacheKey,new Set),I.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){I.debug("Setting search filters",e),this.searchText=e.trim().toLowerCase(),this.setFilters(e?[Oe.makeFilterConfig([Oe.makeFilterItem("name",P.contains,e)])]:[])}dbUpdate(e){I.debug("Clearing cache and refreshing data",e),this.cache.response.delete(this.cacheKey),super.dbUpdate(e)}fetchData(e){var t=this;return X(function*(){return G.withTimeout(0,X(function*(){t.cache.response.has(t.cacheKey)?I.debug("Fetching from cache",t.searchText,t.viewport):(I.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});I.debug("Fetched ".concat(r.length," command history items"));var{toKeep:i,toPrune:l}=Os(r,Gs,Bs);return l.length&&t.pruneItems(l),{docs:i}})));var n=t.cache.response.get(t.cacheKey);return t.searchText==null||t.searchText===""?n:ee(ee({},n),{},{docs:(yield n).docs.filter(o=>{var{name:r}=o;return r.toLowerCase().includes(t.searchText)})})}))})()}fetchInfo(e){var t=this;return X(function*(){return t.fetchData(e)})()}fetchViewportData(e,t,n){var o=this;return X(function*(){var r=yield o.fetchData(t);I.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 X(function*(){if(t.cache.isPruning.get(t.cacheKey)===!0){I.debug("Pruning already in progress. Skipping.");return}try{I.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=>ee(ee({},o),{},{_deleted:!0}))),t.cache.isPruning.set(t.cacheKey,!1),n(),I.debug("Finished pruning command history items")}catch(o){I.error("An error occurred while pruning db",o)}})()}close(){var e,t,n;I.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()}}const Me=Vs;function de(a,e,t){return e=Hs(e),e in a?Object.defineProperty(a,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):a[e]=t,a}function Hs(a){var e=Zs(a,"string");return typeof e=="symbol"?e:String(e)}function Zs(a,e){if(typeof a!="object"||a===null)return a;var t=a[Symbol.toPrimitive];if(t!==void 0){var n=t.call(a,e||"default");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("PouchCommandHistoryCache");class Ys{constructor(){de(this,"isPruning",void 0),de(this,"response",void 0),de(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&&(Ue.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&&(Ue.debug("Resuming event listeners on '".concat(e,"' table"),o),o.listenForChanges())})}}}const qs=Ys;function Ke(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 $e(a){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Ke(Object(t),!0).forEach(function(n){pe(a,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(t)):Ke(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){t(d);return}l.done?e(c):Promise.resolve(c).then(n,o)}function ue(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 pe(a,e,t){return e=zs(e),e in a?Object.defineProperty(a,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):a[e]=t,a}function zs(a){var e=Xs(a,"string");return typeof e=="symbol"?e:String(e)}function Xs(a,e){if(typeof a!="object"||a===null)return a;var t=a[Symbol.toPrimitive];if(t!==void 0){var n=t.call(a,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(a)}var Ge=K.module("PouchCommandHistoryStorage");class Js{constructor(){pe(this,"cache",new qs),pe(this,"updateTableMap",new Map)}getUpdateTable(e){return this.updateTableMap.has(e)||this.updateTableMap.set(e,new Me(e,this.cache)),this.updateTableMap.get(e)}getTable(e){var t=this;return ue(function*(){return new Me(e,t.cache)})()}addItem(e,t,n,o){var r=this;return ue(function*(){return r.updateItem(e,{id:"".concat(new Date().getTime()),name:n,data:o})})()}updateItem(e,t){var n=this;return ue(function*(){var o=n.getUpdateTable(e),r=yield o.refreshItem(t.id),i=$e($e({},r??{}),t);return Ge.debug("Updating item",i),yield o.put(i),Ge.debug("Update saved"),t})()}listenItem(e,t,n){var o=this.getUpdateTable(e);return o.onItemUpdate(t,n)}}const pt="SET_LAYOUT_STORAGE",Qs=a=>({type:pt,payload:a});var{dh:ea}=globalThis;const gt=ea;const ta=K.module("SettingsUtils");function na(a){return a.formatString!=null}function ft(a){const e=Nt.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.0","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 Be(a){return Array.from(a.entries()).filter(e=>e[1].version!==void 0).reduce((e,[t,n])=>({...e,[t]:n.version}),{})}function ge(a){const e=a?.querySelector("input, select, textarea");e&&e.focus()}function bt(a,e){return a.defaultFormatString===e.defaultFormatString}function sa(a,e){return bt(a,e)}function aa(a,e){return bt(a,e)}function vt(a){return a!==""&&Ut.isValidColumnName(a)}function H(a,e,t){if(!e||t.formatString==null||!na(t))return!1;switch(e){case"datetime":return W.isValid(a,t);case"decimal":return _.isValid(a,t);case"int":return k.isValid(a,t);default:return ta.warn("Trying to validate format of unknown type"),!0}}function oa(a){const{id:e,isNewRule:t,...n}=a;return n}function ra(a,e){return vt(e.columnName)&&H(a,e.columnType,e.format)}function St(a){const{timestamp:e,timeZone:t,showTimeZone:n,showTSeparator:o,isGlobalOptions:r,legacyGlobalFormat:i}=a,l=Je(),c=m.useMemo(()=>new Kt(l,[],{timeZone:t,showTimeZone:n,showTSeparator:o}),[l,n,o,t]),d=r?W.getGlobalFormats(n,o):W.getFormats(n,o);return i!=null&&!d.includes(i)&&d.unshift(i),s.jsx(s.Fragment,{children:d.map(u=>{const h=W.makeFormat("",u,W.TYPE_GLOBAL);return s.jsx("option",{value:u,"data-testid":"time-format",children:c.getFormattedString(e,F.dataType.DATETIME,"",h)},u)})})}function ia(){return s.jsx(s.Fragment,{children:$t.TIME_ZONES.map(a=>{const{label:e,value:t}=a;return s.jsx("option",{value:t,children:e},t)})})}const $=K.module("FormattingSectionContent");class ve extends m.PureComponent{static defaultProps={scrollTo:()=>{}};static inputDebounceTime=250;constructor(e){super(e),this.debouncedCommitChanges=ze(this.commitChanges.bind(this),ve.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(){ge(this.containerRef.current)}componentWillUnmount(){this.debouncedCommitChanges.flush()}debouncedCommitChanges;pendingUpdates;containerRef;getCachedDateTimeFormatOptions=he((e,t,n,o=!1,r)=>{const{timestampAtMenuOpen:i}=this.state;return s.jsx(St,{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),H(dh,F.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),H(dh,F.dataType.INT,k.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:T=k.DEFAULT_FORMAT_STRING}=r??{},p=i===e.timeZone,v=c===e.showTSeparator&&l===e.showTimeZone&&n===e.defaultDateTimeFormat,R=sa(o,e.defaultDecimalFormatOptions),y=aa(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(ne,{className:"custom-select",value:i,onChange:this.handleTimeZoneChange,id:"select-reset-timezone",children:s.jsx(ia,{})})}),s.jsx("div",{className:"col-1 btn-col",children:s.jsx(S,{kind:"ghost",icon:V,onClick:this.handleResetTimeZone,tooltip:"Reset Time Zone",className:N("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(ne,{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(S,{kind:"ghost",icon:V,onClick:this.handleResetDateTimeFormat,tooltip:"Reset DateTime Options",className:N("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:N("form-control","flex-grow-1","default-decimal-format-input",{"is-invalid":!H(t,F.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(S,{kind:"ghost",icon:V,onClick:this.handleResetDecimalFormat,tooltip:"Reset Decimal Formatting",className:N("btn-reset","btn-reset-decimal",{hidden:R}),"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:N("form-control","flex-grow-1","default-integer-format-input",{"is-invalid":!H(t,F.dataType.INT,k.makeCustomFormat(T))}),"data-lpignore":!0,placeholder:k.DEFAULT_FORMAT_STRING,type:"text",id:"default-integer-format-input",value:T,onChange:this.handleDefaultIntegerFormatChange})}),s.jsx("div",{className:"col-1 btn-col",children:s.jsx(S,{kind:"ghost",icon:V,onClick:this.handleResetIntegerFormat,tooltip:"Reset Integer Formatting",className:N("btn-reset","btn-reset-integer",{hidden:y}),"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 la=a=>({defaultDateTimeFormat:Wt(a),defaultDecimalFormatOptions:Qe(a),defaultIntegerFormatOptions:et(a),dh:tt(a),showTimeZone:nt(a),showTSeparator:st(a),truncateNumbersWithPound:Gt(a),showEmptyStrings:Bt(a),showNullStrings:Vt(a),timeZone:at(a),defaults:Ht(a)}),ca=ae(la,{updateSettings:fe})(ve);function da(){const[a,e]=m.useState(!1),t=()=>{e(!a)};return s.jsxs(s.Fragment,{children:[s.jsx(S,{kind:"ghost",onClick:t,icon:Un,children:"Legal Notices"}),s.jsxs(Kn,{isOpen:a,toggle:t,children:[s.jsx($n,{toggle:t,children:"Legal Notice"}),s.jsxs(Wn,{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 Z(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(S,{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(j,{transform:t?"flip-v":"",icon:Gn})})]})}),s.jsx(hs,{in:t,autoFocusOnShow:!0,children:e})]})}Z.propTypes={children:w.node,isExpanded:w.bool.isRequired,sectionKey:w.string.isRequired,title:w.node.isRequired,onToggle:w.func};Z.defaultProps={children:null,onToggle:()=>{}};function ua({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(L.getDisplayText(i)),a.matchesKeyState(i)&&d(!1)},[i,a]),m.useEffect(function(){if(c){if(!L.isValidKeyState(i)){L.isAllowedKey(i.keyValue)?h("Must contain a modifier key"):h("Must contain an allowed action key");return}const g=be.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(x){if(x.stopPropagation(),x.preventDefault(),a.isEditable&&!x.repeat){const g=L.getKeyStateFromEvent(x),b=L.createKeyState([Zt.BACKSPACE]);L.doKeyStatesMatch(g,b)?l(L.NULL_KEY_STATE):l(g)}}function T(x){x.stopPropagation(),x.preventDefault(),a.matchesKeyState(i)||d(!0)}function p(){we.disableAllActions()}function v(){we.enableAllActions()}function R(){a.setKeyState(i),d(!1),n(a)}function y(){const x=a.getKeyState();l(x),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(ot,{children:a.tooltip})]}),s.jsxs("div",{className:"shortcut-item-input-container",children:[s.jsx("input",{className:N("form-control",{"is-invalid":u}),onKeyDown:f,onKeyUp:T,onFocus:p,onBlur:v,disabled:!a.isEditable,value:o,readOnly:!0}),!L.doKeyStatesMatch(i,a.getDefaultKeyState())&&!u&&s.jsx(S,{className:"reset-to-default-button",kind:"ghost",icon:s.jsx(j,{icon:V,transform:{rotate:90,flipX:!0}}),tooltip:"Reset to default",onClick:A})]})]}),c&&s.jsxs("div",{className:N("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:[L.isValidKeyState(i)&&s.jsx(S,{kind:"ghost",onClick:R,children:"Confirm"}),s.jsx(S,{kind:"ghost",onClick:y,children:"Undo"})]})]})]})}function ha({shortcutOverrides:a={},updateSettings:e}){const t=m.useCallback(i=>{const l=L.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(be.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(ma,{name:i.name,shortcuts:i.shortcuts,saveShortcutOverrides:t},i.name))]})}function ma({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(ua,{shortcut:c,displayText:l[d],categoryName:a,onChange:i},c.id))]})}const pa=a=>({shortcutOverrides:Yt(a)}),ga={updateSettings:fe},fa=ae(pa,ga)(ha),ba="yyyy-MM-dd-HHmmss",va=[["api"],["client"],["dashboardData","default","connection"],["dashboardData","default","sessionWrapper","dh"],["layoutStorage"],["storage"]];function Se(a){const e=new Map;return function(n,o){const r=[...e.get(this)??[],n];o===Object(o)&&e.set(o,[...r]),r.shift();for(let i=0;i<a.length;i+=1)if(r.length===a[i].length&&r.every((l,c)=>l===a[i][c]))return;return o}}function yt(a,e,t="root",n=new Map([[a,""]])){const o={};return Object.entries(a).forEach(([r,i])=>{try{JSON.stringify(i,Se(e)),o[r]=i}catch{const c=i;if(typeof i=="bigint")o[r]=i.toString();else if(n.has(c))o[r]=`Circular ref to ${n.get(c)}`;else{const d=`${t}.${r}`;n.set(c,d),o[r]=yt(i,e,d,n)}}}),o}function Sa(a){const e=rt.getState();return JSON.stringify(yt(e,a),Se(a),2)}function ya(a,e){const t={uiVersion:"0.85.0",userAgent:navigator.userAgent,...e};return JSON.stringify(t,Se(a),2)}async function Ca(a=`${gt.i18n.DateTimeFormat.format(ba,new Date)}_support_logs`,e,t=va){const n=new Xe,o=n.folder(a);o.file("console.txt",Bn.getFormattedHistory()),o.file("redux.json",Sa(t)),o.file("metadata.json",ya(t,e));const r=await n.generateAsync({type:"blob"}),i=document.createElement("a");i.href=URL.createObjectURL(r),i.download=`${a}.zip`,i.click()}const Ta=[{value:F.dataType.DATETIME,label:"DateTime"},{value:F.dataType.DECIMAL,label:"Decimal"},{value:F.dataType.INT,label:"Integer"}];function xa(){const a=Ta.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 ye extends m.PureComponent{static defaultProps={scrollTo:()=>{}};static inputDebounceTime=250;constructor(e){super(e),this.debouncedCommitChanges=ze(this.commitChanges.bind(this),ye.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(){ge(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=he(()=>s.jsx(xa,{}));getCachedDateTimeFormatOptions=he((e,t,n,o=!1,r)=>{const{timestampAtMenuOpen:i}=this.state;return s.jsx(St,{timestamp:i,timeZone:e,showTimeZone:t,showTSeparator:n,isGlobalOptions:o,legacyGlobalFormat:r})});handleFormatRuleChange(e,t,n){this.setState(o=>{const{formatSettings:r}=o;me(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:F.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(),ge(e)}commitChanges(){const{formatSettings:e}=this.state,{dh:t}=this.props,n=e.filter(i=>ra(t,i)).map(oa)??[],{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.")),vt(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.")):H(t,e.columnType,e.format)||(n.hasFormatError=!0,o.push("Invalid formatting rule.")),n.message=o.join(`
|
|
1
|
+
import{_ as Ye,W as jt}from"./monaco-b5248072.js";import{P as qe,N as Ft,O as Nt,r as m,I as s,Q as ae,T as ze,M as q,U as he,K as N,V as w,L as j,W as Xe,X as Et,Y as Rt,Z as It,_ as Ot,$ as Pt,a0 as Lt,a1 as kt,a2 as _t,a3 as re,a4 as At,a5 as Mt}from"./vendor-6ba620f4.js";import{O as te,P as G,T as P,D as Ut,I as k,a as _,b as W,u as Je,F as Kt,c as F,d as $t,e as fe,S as ne,B as S,C as z,g as Wt,f as Qe,h as et,i as tt,j as nt,k as st,l as Gt,m as Bt,n as Vt,o as at,p as Ht,q as L,r as be,s as ot,K as Zt,t as we,v as Yt,w as rt,x as qt,y as zt,G as B,z as Xt,A as Jt,E as U,H as se,J as Qt,L as en,M as tn,N as nn,Q as sn,R as it,U as lt,V as an,W as on,X as rn,Y as ln,Z as cn,_ as dn,$ as un,a0 as hn,a1 as De,a2 as mn,a3 as ct,a4 as pn,a5 as gn,a6 as fn,a7 as C,a8 as bn,a9 as Q,aa as je,ab as vn,ac as Sn,ad as yn,ae as Cn,af as Tn,ag as xn,ah as wn,ai as Dn,aj as jn,ak as Fn,al as Nn,am as En,an as Rn,ao as In,ap as On,aq as Pn,ar as Ln,as as kn,at as _n,au as An,av as Mn}from"./ControlType-78dfb452.js";import{L as K,v as V,a as Un,M as Kn,b as $n,c as Wn,d as Gn,l as Bn,e as me,f as Vn,g as Hn,h as Zn,i as Yn,j as qn,k as zn,m as Xn,n as Jn,o as Qn,p as es,q as ts,r as ns,s as ss,t as as,u as os,w as rs,x as Fe,y as Ne,z as Ee,A as is,B as ls,C as cs,D as ds,E as us,F as dt}from"./index-1930b332.js";import{C as hs,B as ms,m as ps,a as gs,T as fs,L as ut,s as Re,l as bs,U as ie,N as vs,A as Ss,g as ys,b as Cs,u as Ts,c as xs,d as ws,e as Ds,f as js,h as Fs,G as Ns,i as Es,j as Ie}from"./LocalWorkspaceStorage-96b1cd42.js";import{I as ht,S as Rs,D as Is}from"./IrisGridShortcuts-fc1c4926.js";import"./helpers-de833af9.js";class Oe{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(te.and)}),{filterItems:t,filterOperators:n}}static combineFilterConfigs(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:te.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 Os(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 Pe(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 Le(a){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Pe(Object(t),!0).forEach(function(n){E(a,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(t)):Pe(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){t(d);return}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 E(a,e,t){return e=Ps(e),e in a?Object.defineProperty(a,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):a[e]=t,a}function Ps(a){var e=Ls(a,"string");return typeof e=="symbol"?e:String(e)}function Ls(a,e){if(typeof a!="object"||a===null)return a;var t=a[Symbol.toPrimitive];if(t!==void 0){var n=t.call(a,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(a)}var le=K.module("PouchStorageTable"),ks="Deephaven.";qe.plugin(Ft);function _s(a,e){switch(a){case P.in:case P.contains:return{$regex:new RegExp("".concat(e)).toString()};case P.inIgnoreCase:return{$regex:new RegExp("".concat(e),"i").toString()};case P.eq:return{$eq:e};case P.notEq:return{$ne:e};case P.greaterThan:return{$gt:e};case P.greaterThanOrEqualTo:return{$gte:e};case P.lessThan:return{$lt:e};case P.lessThanOrEqualTo:return{$lte:e};case P.startsWith:return{$regex:new RegExp("^".concat(e,".*")).toString()};default:throw new Error("Unsupported type: ".concat(a))}}function As(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]:_s(l,c)};if(o===0)n=d;else if(n!==null&&o-1<t.length){var u=t[o-1];if(u===te.and)n={$and:[n,d]};else if(u===te.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 ce(){var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];return{$and:[...a.map(e=>As(e)),{name:{$gt:null}},{id:{$gt:null}}]}}function Ms(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 Us{constructor(e,t){E(this,"db",void 0),E(this,"changes",void 0),E(this,"listeners",[]),E(this,"itemListeners",new Map),E(this,"currentSize",0),E(this,"currentViewport",void 0),E(this,"currentReverse",!1),E(this,"currentFilter",null),E(this,"currentSort",null),E(this,"infoUpdatePromise",void 0),E(this,"viewportUpdatePromise",void 0),E(this,"currentViewportData",void 0),this.db=new qe("".concat(ks).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=Le(Le({},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){le.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=G.makeCancelable(e.fetchInfo(ce((n=e.currentFilter)!==null&&n!==void 0?n:[])));var o=yield e.infoUpdatePromise;e.currentSize=o.docs.length,e.sendUpdate()}catch(r){if(!G.isCanceled(r))throw le.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=ce((t=e.currentFilter)!==null&&t!==void 0?t:[]),r=Ms(e.currentSort,e.currentReverse);(n=e.viewportUpdatePromise)===null||n===void 0||n.cancel(),e.viewportUpdatePromise=G.makeCancelable(e.fetchViewportData(e.currentViewport,o,r));var i=yield e.viewportUpdatePromise;return e.currentViewportData=i,e.sendUpdate(),i}catch(l){if(!G.isCanceled(l))throw le.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:ce((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 T=c+f;n.set(T,h.docs[f])}})});return function(i){return r.apply(this,arguments)}}())),n})()}}const Ks=Us;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 ee(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){mt(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 Ae(a,e,t,n,o,r,i){try{var l=a[r](i),c=l.value}catch(d){t(d);return}l.done?e(c):Promise.resolve(c).then(n,o)}function X(a){return function(){var e=this,t=arguments;return new Promise(function(n,o){var r=a.apply(e,t);function i(c){Ae(r,n,o,i,l,"next",c)}function l(c){Ae(r,n,o,i,l,"throw",c)}i(void 0)})}}function mt(a,e,t){return e=$s(e),e in a?Object.defineProperty(a,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):a[e]=t,a}function $s(a){var e=Ws(a,"string");return typeof e=="symbol"?e:String(e)}function Ws(a,e){if(typeof a!="object"||a===null)return a;var t=a[Symbol.toPrimitive];if(t!==void 0){var n=t.call(a,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(a)}var Gs=2500,Bs=2e3,I=K.module("PouchCommandHistoryTable");class Vs extends Ks{constructor(e,t){var n;super("CommandHistoryStorage.".concat(e),{auto_compaction:!0,revs_limit:1}),mt(this,"searchText",void 0),this.cache=t,this.cache.tableRegistry.has(this.cacheKey)||this.cache.tableRegistry.set(this.cacheKey,new Set),I.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){I.debug("Setting search filters",e),this.searchText=e.trim().toLowerCase(),this.setFilters(e?[Oe.makeFilterConfig([Oe.makeFilterItem("name",P.contains,e)])]:[])}dbUpdate(e){I.debug("Clearing cache and refreshing data",e),this.cache.response.delete(this.cacheKey),super.dbUpdate(e)}fetchData(e){var t=this;return X(function*(){return G.withTimeout(0,X(function*(){t.cache.response.has(t.cacheKey)?I.debug("Fetching from cache",t.searchText,t.viewport):(I.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});I.debug("Fetched ".concat(r.length," command history items"));var{toKeep:i,toPrune:l}=Os(r,Gs,Bs);return l.length&&t.pruneItems(l),{docs:i}})));var n=t.cache.response.get(t.cacheKey);return t.searchText==null||t.searchText===""?n:ee(ee({},n),{},{docs:(yield n).docs.filter(o=>{var{name:r}=o;return r.toLowerCase().includes(t.searchText)})})}))})()}fetchInfo(e){var t=this;return X(function*(){return t.fetchData(e)})()}fetchViewportData(e,t,n){var o=this;return X(function*(){var r=yield o.fetchData(t);I.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 X(function*(){if(t.cache.isPruning.get(t.cacheKey)===!0){I.debug("Pruning already in progress. Skipping.");return}try{I.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=>ee(ee({},o),{},{_deleted:!0}))),t.cache.isPruning.set(t.cacheKey,!1),n(),I.debug("Finished pruning command history items")}catch(o){I.error("An error occurred while pruning db",o)}})()}close(){var e,t,n;I.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()}}const Me=Vs;function de(a,e,t){return e=Hs(e),e in a?Object.defineProperty(a,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):a[e]=t,a}function Hs(a){var e=Zs(a,"string");return typeof e=="symbol"?e:String(e)}function Zs(a,e){if(typeof a!="object"||a===null)return a;var t=a[Symbol.toPrimitive];if(t!==void 0){var n=t.call(a,e||"default");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("PouchCommandHistoryCache");class Ys{constructor(){de(this,"isPruning",void 0),de(this,"response",void 0),de(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&&(Ue.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&&(Ue.debug("Resuming event listeners on '".concat(e,"' table"),o),o.listenForChanges())})}}}const qs=Ys;function Ke(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 $e(a){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Ke(Object(t),!0).forEach(function(n){pe(a,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(t)):Ke(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){t(d);return}l.done?e(c):Promise.resolve(c).then(n,o)}function ue(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 pe(a,e,t){return e=zs(e),e in a?Object.defineProperty(a,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):a[e]=t,a}function zs(a){var e=Xs(a,"string");return typeof e=="symbol"?e:String(e)}function Xs(a,e){if(typeof a!="object"||a===null)return a;var t=a[Symbol.toPrimitive];if(t!==void 0){var n=t.call(a,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(a)}var Ge=K.module("PouchCommandHistoryStorage");class Js{constructor(){pe(this,"cache",new qs),pe(this,"updateTableMap",new Map)}getUpdateTable(e){return this.updateTableMap.has(e)||this.updateTableMap.set(e,new Me(e,this.cache)),this.updateTableMap.get(e)}getTable(e){var t=this;return ue(function*(){return new Me(e,t.cache)})()}addItem(e,t,n,o){var r=this;return ue(function*(){return r.updateItem(e,{id:"".concat(new Date().getTime()),name:n,data:o})})()}updateItem(e,t){var n=this;return ue(function*(){var o=n.getUpdateTable(e),r=yield o.refreshItem(t.id),i=$e($e({},r??{}),t);return Ge.debug("Updating item",i),yield o.put(i),Ge.debug("Update saved"),t})()}listenItem(e,t,n){var o=this.getUpdateTable(e);return o.onItemUpdate(t,n)}}const pt="SET_LAYOUT_STORAGE",Qs=a=>({type:pt,payload:a});var{dh:ea}=globalThis;const gt=ea;const ta=K.module("SettingsUtils");function na(a){return a.formatString!=null}function ft(a){const e=Nt.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.1","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 Be(a){return Array.from(a.entries()).filter(e=>e[1].version!==void 0).reduce((e,[t,n])=>({...e,[t]:n.version}),{})}function ge(a){const e=a?.querySelector("input, select, textarea");e&&e.focus()}function bt(a,e){return a.defaultFormatString===e.defaultFormatString}function sa(a,e){return bt(a,e)}function aa(a,e){return bt(a,e)}function vt(a){return a!==""&&Ut.isValidColumnName(a)}function H(a,e,t){if(!e||t.formatString==null||!na(t))return!1;switch(e){case"datetime":return W.isValid(a,t);case"decimal":return _.isValid(a,t);case"int":return k.isValid(a,t);default:return ta.warn("Trying to validate format of unknown type"),!0}}function oa(a){const{id:e,isNewRule:t,...n}=a;return n}function ra(a,e){return vt(e.columnName)&&H(a,e.columnType,e.format)}function St(a){const{timestamp:e,timeZone:t,showTimeZone:n,showTSeparator:o,isGlobalOptions:r,legacyGlobalFormat:i}=a,l=Je(),c=m.useMemo(()=>new Kt(l,[],{timeZone:t,showTimeZone:n,showTSeparator:o}),[l,n,o,t]),d=r?W.getGlobalFormats(n,o):W.getFormats(n,o);return i!=null&&!d.includes(i)&&d.unshift(i),s.jsx(s.Fragment,{children:d.map(u=>{const h=W.makeFormat("",u,W.TYPE_GLOBAL);return s.jsx("option",{value:u,"data-testid":"time-format",children:c.getFormattedString(e,F.dataType.DATETIME,"",h)},u)})})}function ia(){return s.jsx(s.Fragment,{children:$t.TIME_ZONES.map(a=>{const{label:e,value:t}=a;return s.jsx("option",{value:t,children:e},t)})})}const $=K.module("FormattingSectionContent");class ve extends m.PureComponent{static defaultProps={scrollTo:()=>{}};static inputDebounceTime=250;constructor(e){super(e),this.debouncedCommitChanges=ze(this.commitChanges.bind(this),ve.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(){ge(this.containerRef.current)}componentWillUnmount(){this.debouncedCommitChanges.flush()}debouncedCommitChanges;pendingUpdates;containerRef;getCachedDateTimeFormatOptions=he((e,t,n,o=!1,r)=>{const{timestampAtMenuOpen:i}=this.state;return s.jsx(St,{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),H(dh,F.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),H(dh,F.dataType.INT,k.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:T=k.DEFAULT_FORMAT_STRING}=r??{},p=i===e.timeZone,v=c===e.showTSeparator&&l===e.showTimeZone&&n===e.defaultDateTimeFormat,R=sa(o,e.defaultDecimalFormatOptions),y=aa(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(ne,{className:"custom-select",value:i,onChange:this.handleTimeZoneChange,id:"select-reset-timezone",children:s.jsx(ia,{})})}),s.jsx("div",{className:"col-1 btn-col",children:s.jsx(S,{kind:"ghost",icon:V,onClick:this.handleResetTimeZone,tooltip:"Reset Time Zone",className:N("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(ne,{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(S,{kind:"ghost",icon:V,onClick:this.handleResetDateTimeFormat,tooltip:"Reset DateTime Options",className:N("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:N("form-control","flex-grow-1","default-decimal-format-input",{"is-invalid":!H(t,F.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(S,{kind:"ghost",icon:V,onClick:this.handleResetDecimalFormat,tooltip:"Reset Decimal Formatting",className:N("btn-reset","btn-reset-decimal",{hidden:R}),"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:N("form-control","flex-grow-1","default-integer-format-input",{"is-invalid":!H(t,F.dataType.INT,k.makeCustomFormat(T))}),"data-lpignore":!0,placeholder:k.DEFAULT_FORMAT_STRING,type:"text",id:"default-integer-format-input",value:T,onChange:this.handleDefaultIntegerFormatChange})}),s.jsx("div",{className:"col-1 btn-col",children:s.jsx(S,{kind:"ghost",icon:V,onClick:this.handleResetIntegerFormat,tooltip:"Reset Integer Formatting",className:N("btn-reset","btn-reset-integer",{hidden:y}),"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 la=a=>({defaultDateTimeFormat:Wt(a),defaultDecimalFormatOptions:Qe(a),defaultIntegerFormatOptions:et(a),dh:tt(a),showTimeZone:nt(a),showTSeparator:st(a),truncateNumbersWithPound:Gt(a),showEmptyStrings:Bt(a),showNullStrings:Vt(a),timeZone:at(a),defaults:Ht(a)}),ca=ae(la,{updateSettings:fe})(ve);function da(){const[a,e]=m.useState(!1),t=()=>{e(!a)};return s.jsxs(s.Fragment,{children:[s.jsx(S,{kind:"ghost",onClick:t,icon:Un,children:"Legal Notices"}),s.jsxs(Kn,{isOpen:a,toggle:t,children:[s.jsx($n,{toggle:t,children:"Legal Notice"}),s.jsxs(Wn,{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 Z(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(S,{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(j,{transform:t?"flip-v":"",icon:Gn})})]})}),s.jsx(hs,{in:t,autoFocusOnShow:!0,children:e})]})}Z.propTypes={children:w.node,isExpanded:w.bool.isRequired,sectionKey:w.string.isRequired,title:w.node.isRequired,onToggle:w.func};Z.defaultProps={children:null,onToggle:()=>{}};function ua({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(L.getDisplayText(i)),a.matchesKeyState(i)&&d(!1)},[i,a]),m.useEffect(function(){if(c){if(!L.isValidKeyState(i)){L.isAllowedKey(i.keyValue)?h("Must contain a modifier key"):h("Must contain an allowed action key");return}const g=be.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(x){if(x.stopPropagation(),x.preventDefault(),a.isEditable&&!x.repeat){const g=L.getKeyStateFromEvent(x),b=L.createKeyState([Zt.BACKSPACE]);L.doKeyStatesMatch(g,b)?l(L.NULL_KEY_STATE):l(g)}}function T(x){x.stopPropagation(),x.preventDefault(),a.matchesKeyState(i)||d(!0)}function p(){we.disableAllActions()}function v(){we.enableAllActions()}function R(){a.setKeyState(i),d(!1),n(a)}function y(){const x=a.getKeyState();l(x),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(ot,{children:a.tooltip})]}),s.jsxs("div",{className:"shortcut-item-input-container",children:[s.jsx("input",{className:N("form-control",{"is-invalid":u}),onKeyDown:f,onKeyUp:T,onFocus:p,onBlur:v,disabled:!a.isEditable,value:o,readOnly:!0}),!L.doKeyStatesMatch(i,a.getDefaultKeyState())&&!u&&s.jsx(S,{className:"reset-to-default-button",kind:"ghost",icon:s.jsx(j,{icon:V,transform:{rotate:90,flipX:!0}}),tooltip:"Reset to default",onClick:A})]})]}),c&&s.jsxs("div",{className:N("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:[L.isValidKeyState(i)&&s.jsx(S,{kind:"ghost",onClick:R,children:"Confirm"}),s.jsx(S,{kind:"ghost",onClick:y,children:"Undo"})]})]})]})}function ha({shortcutOverrides:a={},updateSettings:e}){const t=m.useCallback(i=>{const l=L.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(be.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(ma,{name:i.name,shortcuts:i.shortcuts,saveShortcutOverrides:t},i.name))]})}function ma({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(ua,{shortcut:c,displayText:l[d],categoryName:a,onChange:i},c.id))]})}const pa=a=>({shortcutOverrides:Yt(a)}),ga={updateSettings:fe},fa=ae(pa,ga)(ha),ba="yyyy-MM-dd-HHmmss",va=[["api"],["client"],["dashboardData","default","connection"],["dashboardData","default","sessionWrapper","dh"],["layoutStorage"],["storage"]];function Se(a){const e=new Map;return function(n,o){const r=[...e.get(this)??[],n];o===Object(o)&&e.set(o,[...r]),r.shift();for(let i=0;i<a.length;i+=1)if(r.length===a[i].length&&r.every((l,c)=>l===a[i][c]))return;return o}}function yt(a,e,t="root",n=new Map([[a,""]])){const o={};return Object.entries(a).forEach(([r,i])=>{try{JSON.stringify(i,Se(e)),o[r]=i}catch{const c=i;if(typeof i=="bigint")o[r]=i.toString();else if(n.has(c))o[r]=`Circular ref to ${n.get(c)}`;else{const d=`${t}.${r}`;n.set(c,d),o[r]=yt(i,e,d,n)}}}),o}function Sa(a){const e=rt.getState();return JSON.stringify(yt(e,a),Se(a),2)}function ya(a,e){const t={uiVersion:"0.85.1",userAgent:navigator.userAgent,...e};return JSON.stringify(t,Se(a),2)}async function Ca(a=`${gt.i18n.DateTimeFormat.format(ba,new Date)}_support_logs`,e,t=va){const n=new Xe,o=n.folder(a);o.file("console.txt",Bn.getFormattedHistory()),o.file("redux.json",Sa(t)),o.file("metadata.json",ya(t,e));const r=await n.generateAsync({type:"blob"}),i=document.createElement("a");i.href=URL.createObjectURL(r),i.download=`${a}.zip`,i.click()}const Ta=[{value:F.dataType.DATETIME,label:"DateTime"},{value:F.dataType.DECIMAL,label:"Decimal"},{value:F.dataType.INT,label:"Integer"}];function xa(){const a=Ta.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 ye extends m.PureComponent{static defaultProps={scrollTo:()=>{}};static inputDebounceTime=250;constructor(e){super(e),this.debouncedCommitChanges=ze(this.commitChanges.bind(this),ye.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(){ge(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=he(()=>s.jsx(xa,{}));getCachedDateTimeFormatOptions=he((e,t,n,o=!1,r)=>{const{timestampAtMenuOpen:i}=this.state;return s.jsx(St,{timestamp:i,timeZone:e,showTimeZone:t,showTSeparator:n,isGlobalOptions:o,legacyGlobalFormat:r})});handleFormatRuleChange(e,t,n){this.setState(o=>{const{formatSettings:r}=o;me(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:F.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(),ge(e)}commitChanges(){const{formatSettings:e}=this.state,{dh:t}=this.props,n=e.filter(i=>ra(t,i)).map(oa)??[],{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.")),vt(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.")):H(t,e.columnType,e.format)||(n.hasFormatError=!0,o.push("Invalid formatting rule.")),n.message=o.join(`
|
|
2
2
|
`)),n}makeDefaultFormatterItemByType(e){switch(F.getNormalizedType(e)){case F.dataType.INT:{const{defaultIntegerFormatOptions:t}=this.props,{defaultFormatString:n}=t;return k.makeFormat("",n??k.DEFAULT_FORMAT_STRING,k.TYPE_GLOBAL,void 0)}case F.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:N("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(S,{kind:"ghost",className:"btn-delete-format-rule float-right",tabIndex:-1,onClick:()=>this.handleFormatRuleDelete(e),icon:Vn,tooltip:"Delete","aria-label":"Delete Format Rule"}),s.jsx("label",{htmlFor:o,children:"Column Type"}),s.jsx(ne,{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(F.getNormalizedType(t)){case F.dataType.DATETIME:return this.renderDateTimeFormatRuleInput(e,n,o,r);case F.dataType.DECIMAL:return this.renderDecimalFormatRuleInput(e,n,o,r);case F.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(ne,{className:N("custom-select",{"is-invalid":o}),value:c,id:t,onChange:d=>{const u=W.makeFormat("",d,W.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;me(r);const{defaultFormatString:i}=r,l=n.formatString??"";return s.jsx("input",{className:N("form-control","flex-grow-1",{"is-invalid":o}),"data-lpignore":!0,id:t,placeholder:i??k.DEFAULT_FORMAT_STRING,type:"text",value:l,onChange:c=>{const d=k.makeFormat("",c.target.value,k.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:N("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(qt,{onEnter:this.handleFormatRuleEntered,children:this.renderFormatRule(i,r)},r.id)),o=s.jsx(S,{kind:"ghost",className:"mb-3",onClick:this.handleFormatRuleCreate,ref:this.addFormatRuleButtonRef,icon:Hn,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(Et,{appear:e,enter:e,exit:e,children:n}),o]})}}const wa=a=>({formatter:zt(a),defaultDecimalFormatOptions:Qe(a),defaultIntegerFormatOptions:et(a),dh:tt(a),showTimeZone:nt(a),showTSeparator:st(a),timeZone:at(a)}),Da=ae(wa,{updateSettings:fe})(ye);class O 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 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(ms),this.state={expandedSectionKey:O.FORMATTING_SECTION_KEY}}componentDidMount(){O.focusFirstInputInContainer(this.menuContentRef.current)}componentWillUnmount(){this.broadcastChannel.close()}menuContentRef;broadcastChannel;isSectionExpanded(e){const{expandedSectionKey:t}=this.state;return t===e}handleLogout(){this.broadcastChannel.postMessage(ps(gs))}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=Be(t);Ca(void 0,{...Object.fromEntries(e),pluginInfo:n})}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=ft(n),l=Be(o),c=n.get("deephaven.version"),d=B.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!=="",T=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(j,{icon:Zn,transform:"grow-8"}),f&&s.jsx("img",{src:r.image,alt:h})]}),s.jsxs("div",{className:"user-details",children:[T&&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(j,{icon:Yn,className:"mr-1"}),r.operateAs]})]})]}),r.permissions.canLogout&&s.jsx("button",{type:"button",className:"btn btn-link",onClick:this.handleLogout,children:"logout"})]})]}),s.jsx(S,{kind:"ghost",className:"btn-close-settings-menu",onClick:this.handleClose,icon:s.jsx(j,{icon:qn,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(Z,{sectionKey:O.FORMATTING_SECTION_KEY,isExpanded:this.isSectionExpanded(O.FORMATTING_SECTION_KEY),title:s.jsxs(s.Fragment,{children:[s.jsx(j,{icon:zn,transform:"grow-4",className:"mr-2"}),"Default Format & Time zone"]}),onToggle:this.handleSectionToggle,children:s.jsx(ca,{})}),s.jsx(Z,{sectionKey:O.COLUMN_SPECIFIC_SECTION_KEY,isExpanded:this.isSectionExpanded(O.COLUMN_SPECIFIC_SECTION_KEY),title:s.jsxs(s.Fragment,{children:[s.jsx(j,{icon:Xn,transform:"grow-4",className:"mr-2"}),"Format by Column Name & Type"]}),onToggle:this.handleSectionToggle,children:s.jsx(Da,{scrollTo:this.handleScrollTo})}),s.jsx(Xt.Consumer,{children:p=>(me(p,"ThemeContext value is null"),p.themes.length>1?s.jsx(Z,{sectionKey:O.THEME_SECTION_KEY,isExpanded:this.isSectionExpanded(O.THEME_SECTION_KEY),onToggle:this.handleSectionToggle,title:s.jsxs(s.Fragment,{children:[s.jsx(j,{icon:Jn,transform:"grow-4",className:"mr-2"}),"Theme"]}),children:s.jsx(fs,{})}):null)}),s.jsx(Z,{sectionKey:O.SHORTCUT_SECTION_KEY,isExpanded:this.isSectionExpanded(O.SHORTCUT_SECTION_KEY),title:s.jsxs(s.Fragment,{children:[s.jsx(j,{icon:Qn,transform:"grow-2"})," ","Keyboard Shortcuts"]}),onToggle:this.handleSectionToggle,children:s.jsx(fa,{})}),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(S,{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(j,{icon:es}),s.jsxs(ot,{interactive:!0,children:[s.jsx("div",{className:"detailed-server-config",children:Object.entries(i).map(([p,v])=>u(p,v))}),s.jsxs(Jt,{kind:"inline",tooltip:"Copy version numbers",copy:Object.entries({...i,...l}).map(([p,v])=>`${p}: ${v}`).join(`
|
|
3
3
|
`),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(da,{})})]}),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(ut,{})})})]})]})]})}}const Ve=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,T]=m.useState(!1),p=m.useCallback(y=>{d.current!=null&&u.current!=null&&h.current&&(Math.abs(d.current-y.clientX)>=Ve||Math.abs(u.current-y.clientY)>=Ve)&&(T(!0),window.removeEventListener("mousemove",p),c(),e(y),h.current=null)},[e,c]);function v(y){d.current=y.clientX,u.current=y.clientY,h.current=y.target,window.addEventListener("mousemove",p)}function R(y){h.current===y.target&&(T(!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:N("btn-context-menu",{disabled:n},{active:i&&!n},{"keyboard-active":l&&!n}),onMouseDown:v,onMouseUp:R,disabled:f,children:[s.jsx("span",{className:N("icon"),children:o}),s.jsx("span",{className:"title",children:t}),s.jsx("span",{className:"shortcut",children:r})]})}function Ce(a){const{handleControlSelect:e,handleToolSelect:t,onClearFilter:n}=a,o=m.useMemo(()=>[{title:"Input Filter",icon:ts,menuElement:s.jsx(Y,{}),action:r=>{e(U.INPUT_FILTER,r)},order:10},{title:"Dropdown Filter",icon:ns,menuElement:s.jsx(Y,{}),action:r=>{e(U.DROPDOWN_FILTER,r)},order:15},{title:"Markdown Widget",icon:ss,menuElement:s.jsx(Y,{}),action:r=>{e(U.MARKDOWN,r)},order:20},{title:"Filter Sets",icon:as,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:os,action:()=>{t(se.LINKER)},order:40,shortcut:B.LINKER},{disabled:!0,menuElement:s.jsx("div",{className:"context-menu-group-header",children:"Actions"}),order:50},{title:"Clear All Filters",icon:rs,action:()=>{n()},order:60,shortcut:ht.TABLE.CLEAR_ALL_FILTERS}],[e,t,n]);return s.jsx(Qt,{popperClassName:"controls-menu-popper",actions:o})}Ce.propTypes={handleControlSelect:w.func,handleToolSelect:w.func,onClearFilter:w.func};Ce.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 ja=en(pt,null),Fa={layoutStorage:ja},Na=a=>a.layoutStorage,Ea=a=>a.serverConfigValues;Object.entries(Fa).map(([a,e])=>tn.register(a,e));const He=10;function Ra(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]),T=m.useCallback(g=>{d(g.target.value)},[]),p=m.useCallback(g=>{h.current!=null&&(Math.abs(h.current.x-g.clientX)>=He||Math.abs(h.current.y-g.clientY)>=He)&&(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]),R=m.useCallback((g,b)=>{window.removeEventListener("mousemove",p),h.current?.widget===b&&(l(!0),f(b)),h.current=void 0},[p,h,f]),y=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(()=>y.map(g=>s.jsx("li",{children:s.jsxs(S,{kind:"ghost","data-testid":`panel-list-item-${g.name??""}-button`,onMouseDown:b=>{v(b,g)},onMouseUp:b=>{R(b,g)},onKeyDown:b=>{(b.key==="Enter"||b.key===" ")&&f(g)},disabled:i,onClick:()=>{},children:[s.jsx(nn,{type:g.type})," ",g.name??""]})},g.name)),[y,i,v,R,f]),x=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(sn,{value:c,placeholder:"Find Table, Plot or Widget",onChange:T,ref:u})}),s.jsxs("ul",{className:"widget-list flex-grow-1",children:[x&&s.jsx("li",{className:"widget-list-message",children:x}),!x&&A]}),s.jsx("div",{children:s.jsx("hr",{})}),s.jsxs("div",{className:"widget-list-footer",children:[s.jsxs(S,{kind:"ghost",onClick:e,children:[s.jsxs("div",{className:"fa-md fa-layers",children:[s.jsx(j,{mask:Fe,icon:Ne,transform:"right-5 down-5"}),s.jsx(j,{icon:Ne,transform:"right-8 down-6"})]}),"Export Layout"]}),s.jsxs(S,{kind:"ghost",onClick:t,children:[s.jsxs("div",{className:"fa-md fa-layers",children:[s.jsx(j,{mask:Fe,icon:Ee,transform:"right-5 down-5"}),s.jsx(j,{icon:Ee,transform:"right-8 down-6"})]}),"Import Layout"]}),s.jsx(S,{kind:"ghost",icon:V,onClick:n,tooltip:"Reset Layout"})]})]})}function Ia({onAutoFillClick:a=()=>{}}){return s.jsxs("div",{className:"empty-dashboard-container",children:[s.jsxs("div",{className:"hint-container",children:[s.jsx(j,{icon:is})," ",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(S,{kind:"tertiary",onClick:a,children:"Auto fill objects"})]})]})}const D=K.module("AppMainContainer");class J extends m.Component{static handleWindowBeforeUnload(e){e.preventDefault(),e.returnValue=""}static hydrateConsole(e,t){return pn.hydrate({...e,unzip:n=>Xe.loadAsync(n).then(o=>Object.values(o.files))},t)}static handleRefresh(){D.info("Refreshing application"),window.location.reload()}constructor(e){super(e),gn(this),this.importElement=q.createRef();const{allDashboardData:t}=this.props;this.dashboardLayouts=new Map,this.state={contextActions:[{action:()=>{const{serverConfigValues:n}=this.props,o=ft(n),r=Object.entries(o).map(([i,l])=>`${i}: ${l}`).join(`
|
|
4
|
-
`);fn(r)},shortcut:B.COPY_VERSION_INFO,isGlobal:!0},{action:()=>{this.handleToolSelect(se.LINKER)},shortcut:B.LINKER,isGlobal:!0},{action:()=>{this.sendClearFilter()},shortcut:ht.TABLE.CLEAR_ALL_FILTERS,isGlobal:!0},{action:()=>{this.sendReopenLast()},shortcut:B.REOPEN_CLOSED_PANEL,isGlobal:!0},{action:()=>{D.debug("Consume unhandled save shortcut")},shortcut:B.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!==C,icon:n===C?ls:void 0})),activeTabKey:C,layoutIteration:0}}componentDidMount(){this.initWidgets(),this.initDashboardData(),window.addEventListener("beforeunload",J.handleWindowBeforeUnload)}componentDidUpdate(e,t){const{dashboardData:n}=this.props;e.dashboardData!==n&&this.handleDataChange(n)}componentWillUnmount(){this.deinitWidgets(),this.dashboardLayouts.forEach(e=>{Re(e.eventHub,this.handleCreateDashboard)}),window.removeEventListener("beforeunload",J.handleWindowBeforeUnload)}dashboardLayouts;importElement;widgetListenerRemover;initWidgets(){const{connection:e}=this.props;if(e!=null){if(e.subscribeToFieldUpdates==null){D.warn("subscribeToFieldUpdates not supported, not initializing widgets");return}this.widgetListenerRemover=e.subscribeToFieldUpdates(t=>{D.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(C,{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];D.debug("initDashboardData plugin data",u,h),e(C,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){D.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(bn.SELECT_NOTEBOOK,n,i,l,r,!0)}}sendClearFilter(){this.emitLayoutEvent(Q.CLEAR_ALL_FILTERS)}sendReopenLast(){this.emitLayoutEvent(je.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){G.isCanceled(e)||D.error(e)}handleSettingsMenuHide(){this.setState({isSettingsMenuShown:!1})}handleSettingsMenuShow(){this.setState({isSettingsMenuShown:!0})}handleControlSelect(e,t){switch(D.debug("handleControlSelect",e),e){case U.DROPDOWN_FILTER:this.emitLayoutEvent(Q.OPEN_DROPDOWN,{title:"DropdownFilter",type:e,createNewStack:!0,dragEvent:t});break;case U.INPUT_FILTER:this.emitLayoutEvent(Q.OPEN_INPUT,{title:"InputFilter",type:e,createNewStack:!0,dragEvent:t});break;case U.MARKDOWN:this.emitLayoutEvent(vn.OPEN,{title:"Markdown",type:e,dragEvent:t});break;case U.FILTER_SET_MANAGER:this.emitLayoutEvent(Q.OPEN_FILTER_SET_MANAGER,{title:"FilterSets",type:e,dragEvent:t});break;default:throw new Error(`Unrecognized control type ${e}`)}}handleToolSelect(e){D.debug("handleToolSelect",e);const{activeTool:t,setActiveTool:n}=this.props;n(t===e?se.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&&Re(n.eventHub,this.handleCreateDashboard),this.dashboardLayouts.set(t,e),bs(e.eventHub,this.handleCreateDashboard))}handleCreateDashboard({pluginId:e,title:t,data:n}){const o=It(),{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}),D.debug("handleWidgetSelect",e,t),this.openWidget(e,t)}handleWidgetsMenuClose(){this.setState({isPanelsMenuShown:!1})}handleAutoFillClick(){const{widgets:e}=this.state;D.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(){D.info("handleExportLayoutClick"),this.setState({isPanelsMenuShown:!1});try{const{workspace:e}=this.props,{data:t}=e,n=ie.exportLayout(t);D.info("handleExportLayoutClick exportedConfig",n);const o=new Blob([JSON.stringify(n)],{type:"application/json"}),r=gt.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){D.error("Unable to export layout",e)}}handleImportLayoutClick(){D.info("handleImportLayoutClick"),this.setState({isPanelsMenuShown:!1}),this.importElement.current!=null&&(this.importElement.current.value="",this.importElement.current.click())}handleResetLayoutClick(){D.info("handleResetLayoutClick"),this.setState({isPanelsMenuShown:!1,isResetLayoutPromptShown:!0,unsavedNotebookCount:Sn.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}=ie.normalizeLayout(r);n({layoutConfig:l}),t(C,{filterSets:i,links:c,pluginDataMap:d}),this.setState(({layoutIteration:u})=>({layoutIteration:u+1}))}catch(t){D.error("Unable to import layout",t)}}async resetLayout(){const{layoutStorage:e,session:t}=this.props,{filterSets:n,layoutConfig:o,links:r}=await ie.getDefaultLayout(e,t!==void 0),{updateDashboardData:i,updateWorkspaceData:l}=this.props;l({layoutConfig:o}),i(C,{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(je.OPEN,{dragEvent:t,fetch:async()=>n?.getObject(e),widget:yn(e)})}getDashboardPlugins=Ot(e=>ys(e));handleHomeClick(){this.handleTabSelect(C)}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=C),{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:C,layoutConfig:i,key:`${C}-${e}`},...t.filter(l=>l.key!==C).map(l=>({id:l.key,layoutConfig:n[l.key]?.layoutConfig??Cn,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:T,activeTabKey:p}=this.state,v=this.getDashboardPlugins(t);return s.jsxs("div",{className:N("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(ut,{className:"ml-1",style:{maxHeight:"20px"}}),T.length>1&&s.jsx("div",{style:{flexShrink:0,flexGrow:1,display:"flex"},children:s.jsx(vs,{tabs:T,activeKey:p,onSelect:this.handleTabSelect,onReorder:this.handleTabReorder,onClose:this.handleTabClose})}),s.jsxs("div",{className:"app-main-right-menu-buttons",children:[s.jsxs(S,{kind:"ghost",className:"btn-panels-menu",icon:cs,onClick:()=>{},children:["Controls",s.jsx(Ce,{handleControlSelect:this.handleControlSelect,handleToolSelect:this.handleToolSelect,onClearFilter:this.handleClearFilter})]}),i&&s.jsxs(S,{kind:"ghost",className:"btn-panels-menu btn-show-panels","data-testid":"app-main-panels-button",onClick:this.handleWidgetMenuClick,icon:ds,children:["Panels",s.jsx(Tn,{isShown:c,className:"panels-menu-popper",onExited:this.handleWidgetsMenuClose,options:{placement:"bottom"},closeOnBlur:!0,interactive:!0,children:s.jsx(Ra,{widgets:f,onExportLayout:this.handleExportLayoutClick,onImportLayout:this.handleImportLayoutClick,onResetLayout:this.handleResetLayoutClick,onSelect:this.handleWidgetSelect})})]}),s.jsx(S,{kind:"ghost",className:N("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(j,{icon:us,transform:"grow-3"})}),tooltip:"User Settings"})]})]}),s.jsx(Ss,{dashboards:this.getDashboards(),activeDashboard:p,onGoldenLayoutChange:this.handleGoldenLayoutChange,emptyDashboard:p===C?s.jsx(Ia,{onAutoFillClick:this.handleAutoFillClick}):s.jsx(dt,{}),plugins:[s.jsx(xn,{hydrateConsole:J.hydrateConsole,notebooksUrl:new URL("notebooks/",document.baseURI).href},"ConsolePlugin"),...v]}),s.jsx(Rs,{in:u,mountOnEnter:!0,unmountOnExit:!0,children:s.jsx(O,{serverConfigValues:o,pluginData:t,onDone:this.handleSettingsMenuHide,user:n})}),s.jsx(wn,{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(Dn,{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 Oa=a=>({activeTool:ln(a),allDashboardData:cn(a),dashboardData:dn(a,C),layoutStorage:Na(a),plugins:un(a),connection:hn(a,C),session:De(a,C)?.session,sessionConfig:De(a,C)?.config,user:mn(a),workspace:ct(a),serverConfigValues:Ea(a)}),Pa=ae(Oa,{setActiveTool:it,setDashboardData:lt,setDashboardPluginData:an,updateDashboardData:on,updateWorkspaceData:rn})(Rt(J));function La(){return s.jsxs("div",{className:"app",children:[s.jsx(Pa,{}),s.jsx(Cs,{})]})}const ka=K.module("AppInit");function Ze(){const a=Je(),e=Ts(),t=xs(),n=jn(),o=ws(),r=Ds(),i=Pt(ct),l=Lt(),[c,d]=m.useState();m.useEffect(function(){l(Fn(n))},[n,l]),m.useEffect(function(){async function p(){try{const v=await js(),R=await Fs(a,t,v),y=e.getStorageService(),A=new Ns(y,"/layouts"),x=new Es(a,y,"/notebooks"),g=new Ie(A),b=new Js,Te=await g.load({isConsoleAvailable:R!==void 0}),{data:oe}=Te,{settings:Ct}=oe,{shortcutOverrides:xe={}}=Ct,Tt=L.isMacPlatform?xe.mac??{}:xe.windows??{};Object.entries(Tt).forEach(([wt,Dt])=>{be.get(wt)?.setKeyState(Dt)});const xt={title:"Code Studio",filterSets:oe.filterSets,links:oe.links};l(Nn(a)),l(it(se.DEFAULT)),l(En(o)),l(Rn(b)),l(lt(C,xt)),l(In(x)),l(Qs(A)),l(On(C,t)),R!==void 0&&l(Pn(C,R)),l(Ln(r)),l(kn(g)),l(_n(Te)),l(An(Ie.makeDefaultWorkspaceSettings(o)))}catch(v){ka.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(La,{}),s.jsx(dt,{isLoading:u&&f==null,isLoaded:h,errorMessage:f})]})}const _a=q.lazy(()=>Ye(()=>import("./StyleGuideRoot-aa669173.js"),["./StyleGuideRoot-aa669173.js","./vendor-6ba620f4.js","./helpers-de833af9.js","./vendor-fb3fd713.css","./index-7fdfc8da.js","./monaco-b5248072.js","./monaco-f18fde03.css","./index-13e1b819.css","./IrisGridModel-ccd93725.js","./ControlType-f304bca9.js","./ControlType-11f5adfb.css","./IrisGridModel-7cb86ddf.css","./FontBootstrap-f6774aa6.js","./TokenBoxCellRenderer-db3dc0cd.js","./IrisGridShortcuts-2b876d25.js","./TokenBoxCellRenderer-8152a7a1.css","./LocalWorkspaceStorage-ec3d3b96.js","./LocalWorkspaceStorage-034ac57a.css","./FontBootstrap-e6b92032.css","./Grid-6f43b155.js","./Grid-6b71b6c4.css","./StyleGuideRoot-2a500821.css"],import.meta.url)),Aa=new URL(document.baseURI).pathname.replace(/\/$/,"");function Ma(){return s.jsx(kt,{basename:Aa,children:s.jsxs(_t,{children:[s.jsx(re,{exact:!0,path:"/",component:Ze}),s.jsx(re,{path:"/notebooks/:notebookPath+",component:Ze}),s.jsx(re,{path:"/styleguide",component:_a}),s.jsx(At,{from:"*",to:"/"})]})})}({}).VITE_PLAYWRIGHT_CSS==="1"&&await Ye(()=>Promise.resolve({}),["./Playwright-1ab78d2c.css"],import.meta.url);function Za(){return Is.register(new URL("./download/serviceWorker.js",window.location.href)),Mn.init({getWorker:()=>new jt}),window["__react-beautiful-dnd-disable-dev-warnings"]=!0,s.jsx(Mt,{store:rt,children:s.jsx(Ma,{})})}export{Za as AppRoot,Za as default};
|
|
5
|
-
//# sourceMappingURL=AppRoot-
|
|
4
|
+
`);fn(r)},shortcut:B.COPY_VERSION_INFO,isGlobal:!0},{action:()=>{this.handleToolSelect(se.LINKER)},shortcut:B.LINKER,isGlobal:!0},{action:()=>{this.sendClearFilter()},shortcut:ht.TABLE.CLEAR_ALL_FILTERS,isGlobal:!0},{action:()=>{this.sendReopenLast()},shortcut:B.REOPEN_CLOSED_PANEL,isGlobal:!0},{action:()=>{D.debug("Consume unhandled save shortcut")},shortcut:B.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!==C,icon:n===C?ls:void 0})),activeTabKey:C,layoutIteration:0}}componentDidMount(){this.initWidgets(),this.initDashboardData(),window.addEventListener("beforeunload",J.handleWindowBeforeUnload)}componentDidUpdate(e,t){const{dashboardData:n}=this.props;e.dashboardData!==n&&this.handleDataChange(n)}componentWillUnmount(){this.deinitWidgets(),this.dashboardLayouts.forEach(e=>{Re(e.eventHub,this.handleCreateDashboard)}),window.removeEventListener("beforeunload",J.handleWindowBeforeUnload)}dashboardLayouts;importElement;widgetListenerRemover;initWidgets(){const{connection:e}=this.props;if(e!=null){if(e.subscribeToFieldUpdates==null){D.warn("subscribeToFieldUpdates not supported, not initializing widgets");return}this.widgetListenerRemover=e.subscribeToFieldUpdates(t=>{D.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(C,{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];D.debug("initDashboardData plugin data",u,h),e(C,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){D.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(bn.SELECT_NOTEBOOK,n,i,l,r,!0)}}sendClearFilter(){this.emitLayoutEvent(Q.CLEAR_ALL_FILTERS)}sendReopenLast(){this.emitLayoutEvent(je.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){G.isCanceled(e)||D.error(e)}handleSettingsMenuHide(){this.setState({isSettingsMenuShown:!1})}handleSettingsMenuShow(){this.setState({isSettingsMenuShown:!0})}handleControlSelect(e,t){switch(D.debug("handleControlSelect",e),e){case U.DROPDOWN_FILTER:this.emitLayoutEvent(Q.OPEN_DROPDOWN,{title:"DropdownFilter",type:e,createNewStack:!0,dragEvent:t});break;case U.INPUT_FILTER:this.emitLayoutEvent(Q.OPEN_INPUT,{title:"InputFilter",type:e,createNewStack:!0,dragEvent:t});break;case U.MARKDOWN:this.emitLayoutEvent(vn.OPEN,{title:"Markdown",type:e,dragEvent:t});break;case U.FILTER_SET_MANAGER:this.emitLayoutEvent(Q.OPEN_FILTER_SET_MANAGER,{title:"FilterSets",type:e,dragEvent:t});break;default:throw new Error(`Unrecognized control type ${e}`)}}handleToolSelect(e){D.debug("handleToolSelect",e);const{activeTool:t,setActiveTool:n}=this.props;n(t===e?se.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&&Re(n.eventHub,this.handleCreateDashboard),this.dashboardLayouts.set(t,e),bs(e.eventHub,this.handleCreateDashboard))}handleCreateDashboard({pluginId:e,title:t,data:n}){const o=It(),{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}),D.debug("handleWidgetSelect",e,t),this.openWidget(e,t)}handleWidgetsMenuClose(){this.setState({isPanelsMenuShown:!1})}handleAutoFillClick(){const{widgets:e}=this.state;D.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(){D.info("handleExportLayoutClick"),this.setState({isPanelsMenuShown:!1});try{const{workspace:e}=this.props,{data:t}=e,n=ie.exportLayout(t);D.info("handleExportLayoutClick exportedConfig",n);const o=new Blob([JSON.stringify(n)],{type:"application/json"}),r=gt.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){D.error("Unable to export layout",e)}}handleImportLayoutClick(){D.info("handleImportLayoutClick"),this.setState({isPanelsMenuShown:!1}),this.importElement.current!=null&&(this.importElement.current.value="",this.importElement.current.click())}handleResetLayoutClick(){D.info("handleResetLayoutClick"),this.setState({isPanelsMenuShown:!1,isResetLayoutPromptShown:!0,unsavedNotebookCount:Sn.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}=ie.normalizeLayout(r);n({layoutConfig:l}),t(C,{filterSets:i,links:c,pluginDataMap:d}),this.setState(({layoutIteration:u})=>({layoutIteration:u+1}))}catch(t){D.error("Unable to import layout",t)}}async resetLayout(){const{layoutStorage:e,session:t}=this.props,{filterSets:n,layoutConfig:o,links:r}=await ie.getDefaultLayout(e,t!==void 0),{updateDashboardData:i,updateWorkspaceData:l}=this.props;l({layoutConfig:o}),i(C,{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(je.OPEN,{dragEvent:t,fetch:async()=>n?.getObject(e),widget:yn(e)})}getDashboardPlugins=Ot(e=>ys(e));handleHomeClick(){this.handleTabSelect(C)}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=C),{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:C,layoutConfig:i,key:`${C}-${e}`},...t.filter(l=>l.key!==C).map(l=>({id:l.key,layoutConfig:n[l.key]?.layoutConfig??Cn,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:T,activeTabKey:p}=this.state,v=this.getDashboardPlugins(t);return s.jsxs("div",{className:N("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(ut,{className:"ml-1",style:{maxHeight:"20px"}}),T.length>1&&s.jsx("div",{style:{flexShrink:0,flexGrow:1,display:"flex"},children:s.jsx(vs,{tabs:T,activeKey:p,onSelect:this.handleTabSelect,onReorder:this.handleTabReorder,onClose:this.handleTabClose})}),s.jsxs("div",{className:"app-main-right-menu-buttons",children:[s.jsxs(S,{kind:"ghost",className:"btn-panels-menu",icon:cs,onClick:()=>{},children:["Controls",s.jsx(Ce,{handleControlSelect:this.handleControlSelect,handleToolSelect:this.handleToolSelect,onClearFilter:this.handleClearFilter})]}),i&&s.jsxs(S,{kind:"ghost",className:"btn-panels-menu btn-show-panels","data-testid":"app-main-panels-button",onClick:this.handleWidgetMenuClick,icon:ds,children:["Panels",s.jsx(Tn,{isShown:c,className:"panels-menu-popper",onExited:this.handleWidgetsMenuClose,options:{placement:"bottom"},closeOnBlur:!0,interactive:!0,children:s.jsx(Ra,{widgets:f,onExportLayout:this.handleExportLayoutClick,onImportLayout:this.handleImportLayoutClick,onResetLayout:this.handleResetLayoutClick,onSelect:this.handleWidgetSelect})})]}),s.jsx(S,{kind:"ghost",className:N("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(j,{icon:us,transform:"grow-3"})}),tooltip:"User Settings"})]})]}),s.jsx(Ss,{dashboards:this.getDashboards(),activeDashboard:p,onGoldenLayoutChange:this.handleGoldenLayoutChange,emptyDashboard:p===C?s.jsx(Ia,{onAutoFillClick:this.handleAutoFillClick}):s.jsx(dt,{}),plugins:[s.jsx(xn,{hydrateConsole:J.hydrateConsole,notebooksUrl:new URL("notebooks/",document.baseURI).href},"ConsolePlugin"),...v]}),s.jsx(Rs,{in:u,mountOnEnter:!0,unmountOnExit:!0,children:s.jsx(O,{serverConfigValues:o,pluginData:t,onDone:this.handleSettingsMenuHide,user:n})}),s.jsx(wn,{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(Dn,{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 Oa=a=>({activeTool:ln(a),allDashboardData:cn(a),dashboardData:dn(a,C),layoutStorage:Na(a),plugins:un(a),connection:hn(a,C),session:De(a,C)?.session,sessionConfig:De(a,C)?.config,user:mn(a),workspace:ct(a),serverConfigValues:Ea(a)}),Pa=ae(Oa,{setActiveTool:it,setDashboardData:lt,setDashboardPluginData:an,updateDashboardData:on,updateWorkspaceData:rn})(Rt(J));function La(){return s.jsxs("div",{className:"app",children:[s.jsx(Pa,{}),s.jsx(Cs,{})]})}const ka=K.module("AppInit");function Ze(){const a=Je(),e=Ts(),t=xs(),n=jn(),o=ws(),r=Ds(),i=Pt(ct),l=Lt(),[c,d]=m.useState();m.useEffect(function(){l(Fn(n))},[n,l]),m.useEffect(function(){async function p(){try{const v=await js(),R=await Fs(a,t,v),y=e.getStorageService(),A=new Ns(y,"/layouts"),x=new Es(a,y,"/notebooks"),g=new Ie(A),b=new Js,Te=await g.load({isConsoleAvailable:R!==void 0}),{data:oe}=Te,{settings:Ct}=oe,{shortcutOverrides:xe={}}=Ct,Tt=L.isMacPlatform?xe.mac??{}:xe.windows??{};Object.entries(Tt).forEach(([wt,Dt])=>{be.get(wt)?.setKeyState(Dt)});const xt={title:"Code Studio",filterSets:oe.filterSets,links:oe.links};l(Nn(a)),l(it(se.DEFAULT)),l(En(o)),l(Rn(b)),l(lt(C,xt)),l(In(x)),l(Qs(A)),l(On(C,t)),R!==void 0&&l(Pn(C,R)),l(Ln(r)),l(kn(g)),l(_n(Te)),l(An(Ie.makeDefaultWorkspaceSettings(o)))}catch(v){ka.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(La,{}),s.jsx(dt,{isLoading:u&&f==null,isLoaded:h,errorMessage:f})]})}const _a=q.lazy(()=>Ye(()=>import("./StyleGuideRoot-00b26873.js"),["./StyleGuideRoot-00b26873.js","./vendor-6ba620f4.js","./helpers-de833af9.js","./vendor-fb3fd713.css","./index-1930b332.js","./monaco-b5248072.js","./monaco-f18fde03.css","./index-13e1b819.css","./IrisGridModel-c94c231d.js","./ControlType-78dfb452.js","./ControlType-11f5adfb.css","./IrisGridModel-7cb86ddf.css","./FontBootstrap-659656f9.js","./TokenBoxCellRenderer-60830db1.js","./IrisGridShortcuts-fc1c4926.js","./TokenBoxCellRenderer-8152a7a1.css","./LocalWorkspaceStorage-96b1cd42.js","./LocalWorkspaceStorage-034ac57a.css","./FontBootstrap-e6b92032.css","./Grid-a6de25d1.js","./Grid-6b71b6c4.css","./StyleGuideRoot-2a500821.css"],import.meta.url)),Aa=new URL(document.baseURI).pathname.replace(/\/$/,"");function Ma(){return s.jsx(kt,{basename:Aa,children:s.jsxs(_t,{children:[s.jsx(re,{exact:!0,path:"/",component:Ze}),s.jsx(re,{path:"/notebooks/:notebookPath+",component:Ze}),s.jsx(re,{path:"/styleguide",component:_a}),s.jsx(At,{from:"*",to:"/"})]})})}({}).VITE_PLAYWRIGHT_CSS==="1"&&await Ye(()=>Promise.resolve({}),["./Playwright-1ab78d2c.css"],import.meta.url);function Za(){return Is.register(new URL("./download/serviceWorker.js",window.location.href)),Mn.init({getWorker:()=>new jt}),window["__react-beautiful-dnd-disable-dev-warnings"]=!0,s.jsx(Mt,{store:rt,children:s.jsx(Ma,{})})}export{Za as AppRoot,Za as default};
|
|
5
|
+
//# sourceMappingURL=AppRoot-d23aa50f.js.map
|